-mm1
--- diff/CREDITS	2004-02-09 10:36:07.000000000 +0000
+++ source/CREDITS	2004-02-09 10:39:51.000000000 +0000
@@ -818,6 +818,11 @@
 S: Sunnyvale, CA 94087
 S: USA
 
+N: Bruno Ducrot
+E: ducrot@poupinou.org
+D: CPUFreq and ACPI bugfixes.
+S: Mougin, France
+
 N: Don Dugger
 E: n0ano@valinux.com
 D: Linux/IA-64
--- diff/Documentation/Changes	2004-01-19 10:22:54.000000000 +0000
+++ source/Documentation/Changes	2004-02-09 10:39:51.000000000 +0000
@@ -216,13 +216,6 @@
 as root before you can use this.  You'll probably also want to
 get the user-space microcode_ctl utility to use with this.
 
-If you have compiled the driver as a module you may need to add
-the following line:
-
-alias char-major-10-184 microcode
-
-to your /etc/modules.conf file.
-
 Powertweak
 ----------
 
@@ -257,17 +250,6 @@
 
 as root.
 
-If you build ppp support as modules, you will need the following in
-your /etc/modules.conf file:
-
-alias char-major-108	ppp_generic
-alias /dev/ppp		ppp_generic
-alias tty-ldisc-3	ppp_async
-alias tty-ldisc-14	ppp_synctty
-alias ppp-compress-21	bsd_comp
-alias ppp-compress-24	ppp_deflate
-alias ppp-compress-26	ppp_deflate
-
 If you use devfsd and build ppp support as modules, you will need
 the following in your /etc/devfsd.conf file:
 
--- diff/Documentation/DMA-API.txt	2003-06-09 14:18:17.000000000 +0100
+++ source/Documentation/DMA-API.txt	2004-02-09 10:39:51.000000000 +0000
@@ -20,6 +20,10 @@
 To get the pci_ API, you must #include <linux/pci.h>
 To get the dma_ API, you must #include <linux/dma-mapping.h>
 
+
+Part Ia - Using large dma-coherent buffers
+------------------------------------------
+
 void *
 dma_alloc_coherent(struct device *dev, size_t size,
 			     dma_addr_t *dma_handle, int flag)
@@ -42,6 +46,7 @@
 Note: consistent memory can be expensive on some platforms, and the
 minimum allocation length may be as big as a page, so you should
 consolidate your requests for consistent memory as much as possible.
+The simplest way to do that is to use the dma_pool calls (see below).
 
 The flag parameter (dma_alloc_coherent only) allows the caller to
 specify the GFP_ flags (see kmalloc) for the allocation (the
@@ -61,6 +66,79 @@
 consistent allocate.  cpu_addr must be the virtual address returned by
 the consistent allocate
 
+
+Part Ib - Using small dma-coherent buffers
+------------------------------------------
+
+To get this part of the dma_ API, you must #include <linux/dmapool.h>
+
+Many drivers need lots of small dma-coherent memory regions for DMA
+descriptors or I/O buffers.  Rather than allocating in units of a page
+or more using dma_alloc_coherent(), you can use DMA pools.  These work
+much like a kmem_cache_t, except that they use the dma-coherent allocator
+not __get_free_pages().  Also, they understand common hardware constraints
+for alignment, like queue heads needing to be aligned on N byte boundaries.
+
+
+	struct dma_pool *
+	dma_pool_create(const char *name, struct device *dev,
+			size_t size, size_t align, size_t alloc);
+
+	struct pci_pool *
+	pci_pool_create(const char *name, struct pci_device *dev,
+			size_t size, size_t align, size_t alloc);
+
+The pool create() routines initialize a pool of dma-coherent buffers
+for use with a given device.  It must be called in a context which
+can sleep.
+
+The "name" is for diagnostics (like a kmem_cache_t name); dev and size
+are like what you'd pass to dma_alloc_coherent().  The device's hardware
+alignment requirement for this type of data is "align" (which is expressed
+in bytes, and must be a power of two).  If your device has no boundary
+crossing restrictions, pass 0 for alloc; passing 4096 says memory allocated
+from this pool must not cross 4KByte boundaries.
+
+
+	void *dma_pool_alloc(struct dma_pool *pool, int gfp_flags,
+			dma_addr_t *dma_handle);
+
+	void *pci_pool_alloc(struct pci_pool *pool, int gfp_flags,
+			dma_addr_t *dma_handle);
+
+This allocates memory from the pool; the returned memory will meet the size
+and alignment requirements specified at creation time.  Pass GFP_ATOMIC to
+prevent blocking, or if it's permitted (not in_interrupt, not holding SMP locks)
+pass GFP_KERNEL to allow blocking.  Like dma_alloc_coherent(), this returns
+two values:  an address usable by the cpu, and the dma address usable by the
+pool's device.
+
+
+	void dma_pool_free(struct dma_pool *pool, void *vaddr,
+			dma_addr_t addr);
+
+	void pci_pool_free(struct pci_pool *pool, void *vaddr,
+			dma_addr_t addr);
+
+This puts memory back into the pool.  The pool is what was passed to
+the the pool allocation routine; the cpu and dma addresses are what
+were returned when that routine allocated the memory being freed.
+
+
+	void dma_pool_destroy(struct dma_pool *pool);
+
+	void pci_pool_destroy(struct pci_pool *pool);
+
+The pool destroy() routines free the resources of the pool.  They must be
+called in a context which can sleep.  Make sure you've freed all allocated
+memory back to the pool before you destroy it.  While pci_pool_destroy()
+may not be called in interrupt context, it's perfectly safe to do that with
+dma_pool_destroy().
+
+
+Part Ic - DMA addressing limitations
+------------------------------------
+
 int
 dma_supported(struct device *dev, u64 mask)
 int
@@ -86,6 +164,10 @@
 
 Returns: 1 if successful and 0 if not
 
+
+Part Id - Streaming DMA mappings
+--------------------------------
+
 dma_addr_t
 dma_map_single(struct device *dev, void *cpu_addr, size_t size,
 		      enum dma_data_direction direction)
@@ -254,6 +336,7 @@
 
 See also dma_map_single().
 
+
 Part II - Advanced dma_ usage
 -----------------------------
 
--- diff/Documentation/DocBook/deviceiobook.tmpl	2003-05-21 11:49:45.000000000 +0100
+++ source/Documentation/DocBook/deviceiobook.tmpl	2004-02-09 10:39:51.000000000 +0000
@@ -126,7 +126,9 @@
       <para>
 	The functions are named <function>readb</function>,
 	<function>readw</function>, <function>readl</function>,
-	<function>readq</function>, <function>writeb</function>,
+	<function>readq</function>, <function>readb_relaxed</function>,
+	<function>readw_relaxed</function>, <function>readl_relaxed</function>,
+	<function>readq_relaxed</function>, <function>writeb</function>,
 	<function>writew</function>, <function>writel</function> and
 	<function>writeq</function>.
       </para>
@@ -159,6 +161,18 @@
 	author cares. This kind of property cannot be hidden from driver
 	writers in the API.
       </para>
+
+      <para>
+	PCI ordering rules also guarantee that PIO read responses arrive
+	after any outstanding DMA writes on that bus, since for some devices
+	the result of a <function>readb</function> call may signal to the
+	driver that a DMA transaction is complete.  In many cases, however,
+	the driver may want to indicate that the next
+	<function>readb</function> call has no relation to any previous DMA
+	writes performed by the device.  The driver can use
+	<function>readb_relaxed</function> for these cases, although only
+	some platforms will honor the relaxed semantics.
+      </para>
     </sect1>
 
     <sect1>
--- diff/Documentation/SubmittingPatches	2004-02-09 10:36:07.000000000 +0000
+++ source/Documentation/SubmittingPatches	2004-02-09 10:39:52.000000000 +0000
@@ -241,7 +241,7 @@
 
 Simple example, of poor code:
 
-	dev = init_etherdev (NULL, 0);
+	dev = alloc_etherdev (sizeof(struct funky_private));
 	if (!dev)
 		return -ENODEV;
 	#ifdef CONFIG_NET_FUNKINESS
@@ -256,7 +256,7 @@
 	#endif
 
 (in the code itself)
-	dev = init_etherdev (NULL, 0);
+	dev = alloc_etherdev (sizeof(struct funky_private));
 	if (!dev)
 		return -ENODEV;
 	init_funky_net(dev);
--- diff/Documentation/as-iosched.txt	2003-09-30 15:46:10.000000000 +0100
+++ source/Documentation/as-iosched.txt	2004-02-09 10:39:51.000000000 +0000
@@ -11,6 +11,15 @@
 me. Database users don't bother unless you're willing to test a lot of patches
 from me ;) its a known issue.
 
+Also, users with hardware RAID controllers, doing striping, may find
+highly variable performance results with using the as-iosched. The
+as-iosched anticipatory implementation is based on the notion that a disk
+device has only one physical seeking head.  A striped RAID controller
+actually has a head for each physical device in the logical RAID device.
+
+However, setting the antic_expire (see tunable parameters below) produces
+very similar behavior to the deadline IO scheduler.
+
 
 Selecting IO schedulers
 -----------------------
@@ -19,6 +28,107 @@
 globally at boot time only presently.
 
 
+Anticipatory IO scheduler Policies
+----------------------------------
+The as-iosched implementation implements several layers of policies
+to determine when an IO request is dispatched to the disk controller.
+Here are the policies outlined, in order of application.
+
+1. one-way Elevator algorithm.
+
+The elevator algorithm is similar to that used in deadline scheduler, with
+the addition that it allows limited backward movement of the elevator
+(i.e. seeks backwards).  A seek backwards can occur when choosing between
+two IO requests where one is behind the elevator's current position, and
+the other is in front of the elevator's position. If the seek distance to
+the request in back of the elevator is less than half the seek distance to
+the request in front of the elevator, then the request in back can be chosen.
+Backward seeks are also limited to a maximum of MAXBACK (1024*1024) sectors.
+This favors forward movement of the elevator, while allowing opportunistic
+"short" backward seeks.
+
+2. FIFO expiration times for reads and for writes.
+
+This is again very similar to the deadline IO scheduler.  The expiration
+times for requests on these lists is tunable using the parameters read_expire
+and write_expire discussed below.  When a read or a write expires in this way,
+the IO scheduler will interrupt its current elevator sweep or read anticipation
+to service the expired request.
+
+3. Read and write request batching
+
+A batch is a collection of read requests or a collection of write
+requests.  The as scheduler alternates dispatching read and write batches
+to the driver.  In the case a read batch, the scheduler submits read
+requests to the driver as long as there are read requests to submit, and
+the read batch time limit has not been exceeded (read_batch_expire).
+The read batch time limit begins counting down only when there are
+competing write requests pending.
+
+In the case of a write batch, the scheduler submits write requests to
+the driver as long as there are write requests available, and the
+write batch time limit has not been exceeded (write_batch_expire).
+However, the length of write batches will be gradually shortened
+when read batches frequently exceed their time limit.
+
+When changing between batch types, the scheduler waits for all requests
+from the previous batch to complete before scheduling requests for the
+next batch.
+
+The read and write fifo expiration times described in policy 2 above
+are checked only when in scheduling IO of a batch for the corresponding
+(read/write) type.  So for example, the read FIFO timeout values are
+tested only during read batches.  Likewise, the write FIFO timeout
+values are tested only during write batches.  For this reason,
+it is generally not recommended for the read batch time
+to be longer than the write expiration time, nor for the write batch
+time to exceed the read expiration time (see tunable parameters below).
+
+When the IO scheduler changes from a read to a write batch,
+it begins the elevator from the request that is on the head of the
+write expiration FIFO.  Likewise, when changing from a write batch to
+a read batch, scheduler begins the elevator from the first entry
+on the read expiration FIFO.
+
+4. Read anticipation.
+
+Read anticipation occurs only when scheduling a read batch.
+This implementation of read anticipation allows only one read request
+to be dispatched to the disk controller at a time.  In
+contrast, many write requests may be dispatched to the disk controller
+at a time during a write batch.  It is this characteristic that can make
+the anticipatory scheduler perform anomalously with controllers supporting
+TCQ, or with hardware striped RAID devices. Setting the antic_expire
+queue paramter (see below) to zero disables this behavior, and the anticipatory
+scheduler behaves essentially like the deadline scheduler.
+
+When read anticipation is enabled (antic_expire is not zero), reads
+are dispatched to the disk controller one at a time.
+At the end of each read request, the IO scheduler examines its next
+candidate read request from its sorted read list.  If that next request
+is from the same process as the request that just completed,
+or if the next request in the queue is "very close" to the
+just completed request, it is dispatched immediately.  Otherwise,
+statistics (average think time, average seek distance) on the process
+that submitted the just completed request are examined.  If it seems
+likely that that process will submit another request soon, and that
+request is likely to be near the just completed request, then the IO
+scheduler will stop dispatching more read requests for up time (antic_expire)
+milliseconds, hoping that process will submit a new request near the one
+that just completed.  If such a request is made, then it is dispatched
+immediately.  If the antic_expire wait time expires, then the IO scheduler
+will dispatch the next read request from the sorted read queue.
+
+To decide whether an anticipatory wait is worthwhile, the scheduler
+maintains statistics for each process that can be used to compute
+mean "think time" (the time between read requests), and mean seek
+distance for that process.  One observation is that these statistics
+are associated with each process, but those statistics are not associated
+with a specific IO device.  So for example, if a process is doing IO
+on several file systems on separate devices, the statistics will be
+a combination of IO behavior from all those devices.
+
+
 Tuning the anticipatory IO scheduler
 ------------------------------------
 When using 'as', the anticipatory IO scheduler there are 5 parameters under
@@ -26,17 +136,18 @@
 
 The parameters are:
 * read_expire
-    Controls how long until a request becomes "expired". It also controls the
+    Controls how long until a read request becomes "expired". It also controls the
     interval between which expired requests are served, so set to 50, a request
     might take anywhere < 100ms to be serviced _if_ it is the next on the
-    expired list. Obviously it won't make the disk go faster. The result
-    basically equates to the timeslice a single reader gets in the presence of
-    other IO. 100*((seek time / read_expire) + 1) is very roughly the %
-    streaming read efficiency your disk should get with multiple readers.
-    
+    expired list. Obviously request expiration strategies won't make the disk
+    go faster. The result basically equates to the timeslice a single reader
+    gets in the presence of other IO. 100*((seek time / read_expire) + 1) is
+    very roughly the % streaming read efficiency your disk should get with
+    multiple readers.
+
 * read_batch_expire
     Controls how much time a batch of reads is given before pending writes are
-    served. Higher value is more efficient. This might be set below read_expire
+    served. A higher value is more efficient. This might be set below read_expire
     if writes are to be given higher priority than reads, but reads are to be
     as efficient as possible when there are no writes. Generally though, it
     should be some multiple of read_expire.
@@ -45,7 +156,8 @@
 * write_batch_expire are equivalent to the above, for writes.
 
 * antic_expire
-    Controls the maximum amount of time we can anticipate a good read before
+    Controls the maximum amount of time we can anticipate a good read (one
+    with a short seek distance from the most recently completed request) before
     giving up. Many other factors may cause anticipation to be stopped early,
     or some processes will not be "anticipated" at all. Should be a bit higher
     for big seek time devices though not a linear correspondence - most
--- diff/Documentation/binfmt_misc.txt	2003-10-09 09:47:33.000000000 +0100
+++ source/Documentation/binfmt_misc.txt	2004-02-09 10:39:51.000000000 +0000
@@ -15,7 +15,7 @@
 	mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc 
 
 To actually register a new binary type, you have to set up a string looking like
-:name:type:offset:magic:mask:interpreter: (where you can choose the ':' upon
+:name:type:offset:magic:mask:interpreter:flags (where you can choose the ':' upon
 your needs) and echo it to /proc/sys/fs/binfmt_misc/register.
 Here is what the fields mean:
  - 'name' is an identifier string. A new /proc file will be created with this
@@ -34,6 +34,18 @@
    The mask is anded with the byte sequence of the file.
  - 'interpreter' is the program that should be invoked with the binary as first
    argument (specify the full path)
+ - 'flags' is an optional field that controls several aspects of the invocation
+   of the interpreter. It is a string of capital letters, each controls a certain
+   aspect. The following flags are supported -
+      'P' - preserve-argv[0].  Legacy behavior of binfmt_misc is to overwrite the
+            original argv[0] with the full path to the binary.  When this flag is
+            included, binfmt_misc will add an argument to the argument vector for
+            this purpose, thus preserving the original argv[0].
+      'O' - open-binary. Legacy behavior of binfmt_misc is to pass the full path
+            of the binary to the interpreter as an argument. When this flag is
+            included, binfmt_misc will open the file for reading and pass its
+            descriptor as argument, instead of the full path, thus allowing the
+            interpreter to execute non-readable binaries.
 
 There are some restrictions:
  - the whole register string may not exceed 255 characters
@@ -83,9 +95,9 @@
 write a wrapper script for it. See Documentation/java.txt for an
 example.
 
-Your interpreter should NOT look in the PATH for the filename; the
-kernel passes it the full filename to use.  Using the PATH can cause
-unexpected behaviour and be a security hazard.
+Your interpreter should NOT look in the PATH for the filename; the kernel
+passes it the full filename (or the file descriptor) to use.  Using $PATH can
+cause unexpected behaviour and can be a security hazard.
 
 
 There is a web page about binfmt_misc at
--- diff/Documentation/cciss.txt	2003-05-21 11:49:54.000000000 +0100
+++ source/Documentation/cciss.txt	2004-02-09 10:39:51.000000000 +0000
@@ -13,6 +13,7 @@
 	* SA 642
 	* SA 6400
 	* SA 6400 U320 Expansion Module
+	* SA 6i
 
 If nodes are not already created in the /dev/cciss directory
 
--- diff/Documentation/computone.txt	2003-08-20 14:16:23.000000000 +0100
+++ source/Documentation/computone.txt	2004-02-09 10:39:51.000000000 +0000
@@ -41,11 +41,11 @@
 
 	Note the hardware address from the Computone ISA cards installed into
 		the system.  These are required for editing ip2.c or editing
-		/etc/modules.conf, or for specification on the modprobe
+		/etc/modprobe.conf, or for specification on the modprobe
 		command line.
 
-	Note that the /etc/modules.conf file is named /etc/conf.modules
-		with older versions of the module utilities.
+	Note that the /etc/modules.conf should be used for older (pre-2.6)
+		kernels.
 
 Software -
 
@@ -58,7 +58,7 @@
 c) Set address on ISA cards then:
    edit /usr/src/linux/drivers/char/ip2.c if needed 
 	or
-   edit /etc/modules.conf if needed (module).
+   edit /etc/modprobe.conf if needed (module).
 	or both to match this setting.
 d) Run "make modules"
 e) Run "make modules_install"
@@ -145,11 +145,11 @@
 selects polled mode). If no base addresses are specified the defaults in 
 ip2.c are used. If you are autoloading the driver module with kerneld or
 kmod the base addresses and interrupt number must also be set in ip2.c
-and recompile or just insert and options line in /etc/modules.conf or both. 
+and recompile or just insert and options line in /etc/modprobe.conf or both.
 The options line is equivalent to the command line and takes precidence over 
 what is in ip2.c. 
 
-/etc/modules.conf sample:
+/etc/modprobe.conf sample:
 	options ip2 io=1,0x328 irq=1,10
 	alias char-major-71 ip2
 	alias char-major-72 ip2
--- diff/Documentation/crypto/api-intro.txt	2003-10-09 09:47:33.000000000 +0100
+++ source/Documentation/crypto/api-intro.txt	2004-02-09 10:39:51.000000000 +0000
@@ -68,7 +68,7 @@
 CONFIGURATION NOTES
 
 As Triple DES is part of the DES module, for those using modular builds,
-add the following line to /etc/modules.conf:
+add the following line to /etc/modprobe.conf:
 
   alias des3_ede des
 
--- diff/Documentation/digiboard.txt	2003-10-09 09:47:16.000000000 +0100
+++ source/Documentation/digiboard.txt	2004-02-09 10:39:51.000000000 +0000
@@ -24,7 +24,7 @@
 The pcxx driver can be configured using the command line feature while
 loading the kernel with LILO or LOADLIN or, if built as a module,
 with arguments to insmod and modprobe or with parameters in
-/etc/modules.conf for modprobe and kerneld.
+/etc/modprobe.conf for modprobe and kerneld.
 
 After configuring the driver you need to create the device special files
 as described in "Device file creation:" below and set the appropriate
@@ -91,13 +91,13 @@
 
 The remaining board still uses ttyD8-ttyD15 and cud8-cud15.
 
-Example line for /etc/modules.conf for use with kerneld and as default
+Example line for /etc/modprobe.conf for use with kerneld and as default
 parameters for modprobe:
 
 options pcxx           io=0x200 numports=8
 
-For kerneld to work you will likely need to add these two lines to your
-/etc/modules.conf:
+For kmod to work you will likely need to add these two lines to your
+/etc/modprobe.conf:
 
 alias char-major-22    pcxx
 alias char-major-23    pcxx
--- diff/Documentation/fb/intel810.txt	2003-01-02 10:43:02.000000000 +0000
+++ source/Documentation/fb/intel810.txt	2004-02-09 10:39:51.000000000 +0000
@@ -194,7 +194,7 @@
 	modprobe i810fb vram=2 xres=1024 bpp=8 hsync1=30 hsync2=55 vsync1=50 \
 	         vsync2=85 accel=1 mtrr=1
 
-Or just add the following to /etc/modules.conf
+Or just add the following to /etc/modprobe.conf
 
 	options i810fb vram=2 xres=1024 bpp=16 hsync1=30 hsync2=55 vsync1=50 \
 	vsync2=85 accel=1 mtrr=1
--- diff/Documentation/filesystems/proc.txt	2003-09-17 12:28:01.000000000 +0100
+++ source/Documentation/filesystems/proc.txt	2004-02-09 10:39:51.000000000 +0000
@@ -900,6 +900,15 @@
 Every mounted file system needs a super block, so if you plan to mount lots of
 file systems, you may want to increase these numbers.
 
+aio-nr and aio-max-nr
+---------------------
+
+aio-nr is the running total of the number of events specified on the
+io_setup system call for all currently active aio contexts.  If aio-nr
+reaches aio-max-nr then io_setup will fail with EAGAIN.  Note that
+raising aio-max-nr does not result in the pre-allocation or re-sizing
+of any kernel data structures.
+
 2.2 /proc/sys/fs/binfmt_misc - Miscellaneous binary formats
 -----------------------------------------------------------
 
--- diff/Documentation/ftape.txt	2003-10-09 09:47:33.000000000 +0100
+++ source/Documentation/ftape.txt	2004-02-09 10:39:51.000000000 +0000
@@ -242,15 +242,15 @@
    Module parameters can be specified either directly when invoking
    the program 'insmod' at the shell prompt:
 
-   insmod ftape.o ft_tracing=4
+   modprobe ftape ft_tracing=4
 
-   or by editing the file `/etc/modules.conf' in which case they take
+   or by editing the file `/etc/modprobe.conf' in which case they take
    effect each time when the module is loaded with `modprobe' (please
    refer to the respective manual pages). Thus, you should add a line
 
    options ftape ft_tracing=4
 
-   to `/etc/modules.conf` if you intend to increase the debugging
+   to `/etc/modprobe.conf` if you intend to increase the debugging
    output of the driver.
 
 
@@ -298,7 +298,7 @@
 5. Example module parameter setting
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    To do the same, but with ftape compiled as a loadable kernel
-   module, add the following line to `/etc/modules.conf':
+   module, add the following line to `/etc/modprobe.conf':
 
    options ftape ft_probe_fc10=1 ft_tracing=4
 
--- diff/Documentation/hayes-esp.txt	2002-10-16 04:27:12.000000000 +0100
+++ source/Documentation/hayes-esp.txt	2004-02-09 10:39:51.000000000 +0000
@@ -109,7 +109,7 @@
 insmod esp dma=3 trigger=512
 
 The esp module can be automatically loaded when needed.  To cause this to
-happen, add the following lines to /etc/modules.conf (replacing the last line
+happen, add the following lines to /etc/modprobe.conf (replacing the last line
 with options for your configuration):
 
 alias char-major-57 esp
--- diff/Documentation/i386/zero-page.txt	2004-02-09 10:36:07.000000000 +0000
+++ source/Documentation/i386/zero-page.txt	2004-02-09 10:39:51.000000000 +0000
@@ -72,8 +72,10 @@
 0x21c	unsigned long	INITRD_SIZE, size in bytes of ramdisk image
 0x220	4 bytes		(setup.S)
 0x224	unsigned short	setup.S heap end pointer
+0x2cc	4 bytes		DISK80_SIG_BUFFER (setup.S)
 0x2d0 - 0x600		E820MAP
-0x600 - 0x7D4		EDDBUF (setup.S)
+0x600 - 0x7ff		EDDBUF (setup.S) for disk signature read sector
+0x600 - 0x7d3		EDDBUF (setup.S) for edd data
 
 0x800	string, 2K max	COMMAND_LINE, the kernel commandline as
 			copied using CL_OFFSET.
--- diff/Documentation/ide.txt	2003-10-27 09:20:36.000000000 +0000
+++ source/Documentation/ide.txt	2004-02-09 10:39:51.000000000 +0000
@@ -198,12 +198,11 @@
 can only be compiled into the kernel, and the core code (ide.c) can be
 compiled as a loadable module provided no chipset support is needed.
 
-When using ide.c/ide-tape.c as modules in combination with kerneld, add:
+When using ide.c as a module in combination with kmod, add:
 
 	alias block-major-3 ide-probe
-	alias char-major-37 ide-tape
 
-respectively to /etc/modules.conf.
+to /etc/modprobe.conf.
 
 When ide.c is used as a module, you can pass command line parameters to the
 driver using the "options=" keyword to insmod, while replacing any ',' with
--- diff/Documentation/kernel-parameters.txt	2004-02-09 10:36:07.000000000 +0000
+++ source/Documentation/kernel-parameters.txt	2004-02-09 10:39:51.000000000 +0000
@@ -174,11 +174,18 @@
 
 	atascsi=	[HW,SCSI] Atari SCSI
 
-	atkbd.set=	[HW] Select keyboard code set
-			Format: <int>
+	atkbd.extra=	[HW] Enable extra LEDs and keys on IBM RapidAccess, EzKey
+			and similar keyboards
+
+	atkbd.reset=	[HW] Reset keyboard during initialization
+
+	atkbd.set=	[HW] Select keyboard code set 
+			Format: <int> (2 = AT (default) 3 = PS/2)
+
+	atkbd.scroll=	[HW] Enable scroll wheel on MS Office and similar keyboards
+	
 	atkbd.softrepeat=
 			[HW] Use software keyboard repeat
-	atkbd.reset=	[HW] Reset keyboard during initialization
 
 	autotest	[IA64]
 
@@ -237,7 +244,7 @@
 			Forces specified timesource (if avaliable) to be used
 			when calculating gettimeofday(). If specicified timesource
 			is not avalible, it defaults to PIT. 
-			Format: { pit | tsc | cyclone | ... }
+			Format: { pit | tsc | cyclone | pmtmr }
 
 	hpet=		[IA-32,HPET] option to disable HPET and use PIT.
 			Format: disable
--- diff/Documentation/networking/baycom.txt	2002-10-16 04:28:34.000000000 +0100
+++ source/Documentation/networking/baycom.txt	2004-02-09 10:39:51.000000000 +0000
@@ -93,10 +93,10 @@
 modems it should access at which ports. This can be done with the setbaycom
 utility. If you are only using one modem, you can also configure the
 driver from the insmod command line (or by means of an option line in
-/etc/modules.conf).
+/etc/modprobe.conf).
 
 Examples:
-  insmod baycom_ser_fdx mode="ser12*" iobase=0x3f8 irq=4
+  modprobe baycom_ser_fdx mode="ser12*" iobase=0x3f8 irq=4
   sethdlc -i bcsf0 -p mode "ser12*" io 0x3f8 irq 4
 
 Both lines configure the first port to drive a ser12 modem at the first
--- diff/Documentation/networking/bonding.txt	2003-09-30 15:46:10.000000000 +0100
+++ source/Documentation/networking/bonding.txt	2004-02-09 10:39:51.000000000 +0000
@@ -21,7 +21,7 @@
 
 Table of Contents
 =================
- 
+
 Installation
 Bond Configuration
 Module Parameters
@@ -66,18 +66,18 @@
 /usr/include/linux.
 
 To install ifenslave.c, do:
-    # gcc -Wall -Wstrict-prototypes -O -I/usr/src/linux/include ifenslave.c -o ifenslave 
+    # gcc -Wall -Wstrict-prototypes -O -I/usr/src/linux/include ifenslave.c -o ifenslave
     # cp ifenslave /sbin/ifenslave
 
 
 Bond Configuration
 ==================
 
-You will need to add at least the following line to /etc/modules.conf
-so the bonding driver will automatically load when the bond0 interface is 
-configured. Refer to the modules.conf manual page for specific modules.conf 
-syntax details. The Module Parameters section of this document describes each 
-bonding driver parameter. 
+You will need to add at least the following line to /etc/modprobe.conf
+so the bonding driver will automatically load when the bond0 interface is
+configured. Refer to the modprobe.conf manual page for specific modprobe.conf
+syntax details. The Module Parameters section of this document describes each
+bonding driver parameter.
 
 	alias bond0 bonding
 
@@ -113,7 +113,7 @@
 network interface be a slave of bond1.
 
 Restart the networking subsystem or just bring up the bonding device if your
-administration tools allow it. Otherwise, reboot. On Red Hat distros you can 
+administration tools allow it. Otherwise, reboot. On Red Hat distros you can
 issue `ifup bond0' or `/etc/rc.d/init.d/network restart'.
 
 If the administration tools of your distribution do not support
@@ -128,30 +128,30 @@
 
 (use appropriate values for your network above)
 
-You can then create a script containing these commands and place it in the 
+You can then create a script containing these commands and place it in the
 appropriate rc directory.
 
 If you specifically need all network drivers loaded before the bonding driver,
-adding the following line to modules.conf will cause the network driver for 
+adding the following line to modprobe.conf will cause the network driver for
 eth0 and eth1 to be loaded before the bonding driver.
 
-probeall bond0 eth0 eth1 bonding
+install bond0 /sbin/modprobe -a eth0 eth1 && /sbin/modprobe bonding
 
-Be careful not to reference bond0 itself at the end of the line, or modprobe 
+Be careful not to reference bond0 itself at the end of the line, or modprobe
 will die in an endless recursive loop.
 
-To have device characteristics (such as MTU size) propagate to slave devices, 
-set the bond characteristics before enslaving the device.  The characteristics 
+To have device characteristics (such as MTU size) propagate to slave devices,
+set the bond characteristics before enslaving the device.  The characteristics
 are propagated during the enslave process.
 
-If running SNMP agents, the bonding driver should be loaded before any network 
-drivers participating in a bond. This requirement is due to the the interface 
-index (ipAdEntIfIndex) being associated to the first interface found with a 
-given IP address. That is, there is only one ipAdEntIfIndex for each IP 
-address. For example, if eth0 and eth1 are slaves of bond0 and the driver for 
-eth0 is loaded before the bonding driver, the interface for the IP address 
-will be associated with the eth0 interface. This configuration is shown below, 
-the IP address 192.168.1.1 has an interface index of 2 which indexes to eth0 
+If running SNMP agents, the bonding driver should be loaded before any network
+drivers participating in a bond. This requirement is due to the the interface
+index (ipAdEntIfIndex) being associated to the first interface found with a
+given IP address. That is, there is only one ipAdEntIfIndex for each IP
+address. For example, if eth0 and eth1 are slaves of bond0 and the driver for
+eth0 is loaded before the bonding driver, the interface for the IP address
+will be associated with the eth0 interface. This configuration is shown below,
+the IP address 192.168.1.1 has an interface index of 2 which indexes to eth0
 in the ifDescr table (ifDescr.2).
 
      interfaces.ifTable.ifEntry.ifDescr.1 = lo
@@ -189,10 +189,10 @@
 Module Parameters
 =================
 
-Optional parameters for the bonding driver can be supplied as command line 
-arguments to the insmod command. Typically, these parameters are specified in 
-the file /etc/modules.conf (see the manual page for modules.conf). The 
-available bonding driver parameters are listed below. If a parameter is not 
+Optional parameters for the bonding driver can be supplied as command line
+arguments to the insmod command. Typically, these parameters are specified in
+the file /etc/modprobe.conf (see the manual page for modprobe.conf). The
+available bonding driver parameters are listed below. If a parameter is not
 specified the default value is used. When initially configuring a bond, it
 is recommended "tail -f /var/log/messages" be run in a separate window to
 watch for bonding driver error messages.
@@ -202,19 +202,19 @@
 during link failures.
 
 arp_interval
- 
-        Specifies the ARP monitoring frequency in milli-seconds. 
-        If ARP monitoring is used in a load-balancing mode (mode 0 or 2), the 
-        switch should be configured in a mode that evenly distributes packets 
-        across all links - such as round-robin. If the switch is configured to 
-        distribute the packets in an XOR fashion, all replies from the ARP 
-        targets will be received on the same link which could cause the other 
+
+        Specifies the ARP monitoring frequency in milli-seconds.
+        If ARP monitoring is used in a load-balancing mode (mode 0 or 2), the
+        switch should be configured in a mode that evenly distributes packets
+        across all links - such as round-robin. If the switch is configured to
+        distribute the packets in an XOR fashion, all replies from the ARP
+        targets will be received on the same link which could cause the other
         team members to fail. ARP monitoring should not be used in conjunction
-        with miimon. A value of 0 disables ARP monitoring. The default value 
+        with miimon. A value of 0 disables ARP monitoring. The default value
         is 0.
- 
+
 arp_ip_target
- 
+
 	Specifies the ip addresses to use when arp_interval is > 0. These
 	are the targets of the ARP request sent to determine the health of
 	the link to the targets. Specify these values in ddd.ddd.ddd.ddd
@@ -223,8 +223,8 @@
 	maximum number of targets that can be specified is set at 16.
 
 downdelay
- 
-        Specifies the delay time in milli-seconds to disable a link after a 
+
+        Specifies the delay time in milli-seconds to disable a link after a
         link failure has been detected. This should be a multiple of miimon
         value, otherwise the value will be rounded. The default value is 0.
 
@@ -247,7 +247,7 @@
 	and bond2 will be created.  The default value is 1.
 
 miimon
- 
+
         Specifies the frequency in milli-seconds that MII link monitoring
         will occur. A value of zero disables MII link monitoring. A value
         of 100 is a good starting point. See High Availability section for
@@ -258,7 +258,7 @@
 	Specifies one of the bonding policies. The default is
 	round-robin (balance-rr).  Possible values are (you can use
 	either the text or numeric option):
- 
+
 	balance-rr or 0
 
 		Round-robin policy: Transmit in a sequential order
@@ -273,7 +273,7 @@
 		externally visible on only one port (network adapter)
 		to avoid confusing the switch.  This mode provides
 		fault tolerance.
- 
+
 	balance-xor or 2
 
 		XOR policy: Transmit based on [(source MAC address
@@ -293,7 +293,7 @@
 		groups that share the same speed and duplex settings.
 		Transmits and receives on all slaves in the active
 		aggregator.
- 
+
 		Pre-requisites:
 
 		1. Ethtool support in the base drivers for retrieving the
@@ -317,7 +317,7 @@
 		Ethtool support in the base drivers for retrieving the
 		speed of each slave.
 
-	balance-alb or 6 
+	balance-alb or 6
 
 		Adaptive load balancing: includes balance-tlb + receive
 		load balancing (rlb) for IPV4 traffic and does not require
@@ -327,7 +327,7 @@
 		overwrites the src hw address with the unique hw address of
 		one of the slaves in the bond such that different clients
 		use different hw addresses for the server.
-		
+
 		Receive traffic from connections created by the server is
 		also balanced. When the server sends an ARP Request the
 		bonding driver copies and saves the client's IP information
@@ -363,25 +363,11 @@
 		2. Base driver support for setting the hw address of a
 		device also when it is open. This is required so that there
 		will always be one slave in the team using the bond hw
-		address (the current_slave) while having a unique hw
-		address for each slave in the bond. If the current_slave
-		fails it's hw address is swapped with the new current_slave
+		address (the curr_active_slave) while having a unique hw
+		address for each slave in the bond. If the curr_active_slave
+		fails it's hw address is swapped with the new curr_active_slave
 		that was chosen.
 
-multicast
-
-        Option specifying the mode of operation for multicast support.
-        Possible values are:
-
-	disabled or 0
-		Disabled (no multicast support)
-
-        active or 1
-		Enabled on active slave only, useful in active-backup mode
-
-	all or 2
-		Enabled on all slaves, this is the default
-
 primary
 
         A string (eth0, eth2, etc) to equate to a primary device. If this
@@ -397,11 +383,11 @@
         primary is only valid in active-backup mode.
 
 updelay
- 
-        Specifies the delay time in milli-seconds to enable a link after a 
+
+        Specifies the delay time in milli-seconds to enable a link after a
         link up status has been detected. This should be a multiple of miimon
         value, otherwise the value will be rounded. The default value is 0.
- 
+
 use_carrier
 
         Specifies whether or not miimon should use MII or ETHTOOL
@@ -529,20 +515,20 @@
 ----------------------------
 The bonding driver information files reside in the /proc/net/bonding directory.
 
-Sample contents of /proc/net/bonding/bond0 after the driver is loaded with 
+Sample contents of /proc/net/bonding/bond0 after the driver is loaded with
 parameters of mode=0 and miimon=1000 is shown below.
- 
+
         Bonding Mode: load balancing (round-robin)
         Currently Active Slave: eth0
         MII Status: up
         MII Polling Interval (ms): 1000
         Up Delay (ms): 0
         Down Delay (ms): 0
- 
+
         Slave Interface: eth1
         MII Status: up
         Link Failure Count: 1
- 
+
         Slave Interface: eth0
         MII Status: up
         Link Failure Count: 1
@@ -550,34 +536,34 @@
 2) Network verification
 -----------------------
 The network configuration can be verified using the ifconfig command. In
-the example below, the bond0 interface is the master (MASTER) while eth0 and 
-eth1 are slaves (SLAVE). Notice all slaves of bond0 have the same MAC address 
+the example below, the bond0 interface is the master (MASTER) while eth0 and
+eth1 are slaves (SLAVE). Notice all slaves of bond0 have the same MAC address
 (HWaddr) as bond0 for all modes except TLB and ALB that require a unique MAC
 address for each slave.
 
 [root]# /sbin/ifconfig
-bond0     Link encap:Ethernet  HWaddr 00:C0:F0:1F:37:B4  
+bond0     Link encap:Ethernet  HWaddr 00:C0:F0:1F:37:B4
           inet addr:XXX.XXX.XXX.YYY  Bcast:XXX.XXX.XXX.255  Mask:255.255.252.0
           UP BROADCAST RUNNING MASTER MULTICAST  MTU:1500  Metric:1
           RX packets:7224794 errors:0 dropped:0 overruns:0 frame:0
           TX packets:3286647 errors:1 dropped:0 overruns:1 carrier:0
-          collisions:0 txqueuelen:0 
+          collisions:0 txqueuelen:0
 
-eth0      Link encap:Ethernet  HWaddr 00:C0:F0:1F:37:B4  
+eth0      Link encap:Ethernet  HWaddr 00:C0:F0:1F:37:B4
           inet addr:XXX.XXX.XXX.YYY  Bcast:XXX.XXX.XXX.255  Mask:255.255.252.0
           UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
           RX packets:3573025 errors:0 dropped:0 overruns:0 frame:0
           TX packets:1643167 errors:1 dropped:0 overruns:1 carrier:0
-          collisions:0 txqueuelen:100 
-          Interrupt:10 Base address:0x1080 
+          collisions:0 txqueuelen:100
+          Interrupt:10 Base address:0x1080
 
-eth1      Link encap:Ethernet  HWaddr 00:C0:F0:1F:37:B4  
+eth1      Link encap:Ethernet  HWaddr 00:C0:F0:1F:37:B4
           inet addr:XXX.XXX.XXX.YYY  Bcast:XXX.XXX.XXX.255  Mask:255.255.252.0
           UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
           RX packets:3651769 errors:0 dropped:0 overruns:0 frame:0
           TX packets:1643480 errors:0 dropped:0 overruns:0 carrier:0
-          collisions:0 txqueuelen:100 
-          Interrupt:9 Base address:0x1400 
+          collisions:0 txqueuelen:100
+          Interrupt:9 Base address:0x1400
 
 
 Frequently Asked Questions
@@ -605,9 +591,9 @@
 
 5.  What happens when a slave link dies?
 
-	If your ethernet cards support MII or ETHTOOL link status monitoring 
-        and the MII monitoring has been enabled in the driver (see description 
-        of module parameters), there will be no adverse consequences. This 
+	If your ethernet cards support MII or ETHTOOL link status monitoring
+        and the MII monitoring has been enabled in the driver (see description
+        of module parameters), there will be no adverse consequences. This
         release of the bonding driver knows how to get the MII information and
 	enables or disables its slaves according to their link status.
 	See section on High Availability for additional information.
@@ -622,8 +608,8 @@
         slave.
 
 	If neither mii_monitor and arp_interval is configured, the bonding
-	driver will not handle this situation very well. The driver will 
-	continue to send packets but some packets will be lost. Retransmits 
+	driver will not handle this situation very well. The driver will
+	continue to send packets but some packets will be lost. Retransmits
 	will cause serious degradation of performance (in the case when one
 	of two slave links fails, 50% packets will be lost, which is a serious
 	problem for both TCP and UDP).
@@ -636,9 +622,9 @@
 
 7.  Which switches/systems does it work with?
 
-	In round-robin and XOR mode, it works with systems that support 
+	In round-robin and XOR mode, it works with systems that support
 	trunking:
-	
+
 	* Many Cisco switches and routers (look for EtherChannel support).
 	* SunTrunking software.
 	* Alteon AceDirector switches / WebOS (use Trunks).
@@ -646,7 +632,7 @@
 	  models (450) can define trunks between ports on different physical
 	  units.
 	* Linux bonding, of course !
-	
+
 	In 802.3ad mode, it works with with systems that support IEEE 802.3ad
 	Dynamic Link Aggregation:
 
@@ -667,21 +653,21 @@
 	is then passed to all following slaves and remains persistent (even if
 	the the first slave is removed) until the bonding device is brought
 	down or reconfigured.
-	
+
 	If you wish to change the MAC address, you can set it with ifconfig:
 
 	  # ifconfig bond0 hw ether 00:11:22:33:44:55
 
 	The MAC address can be also changed by bringing down/up the device
 	and then changing its slaves (or their order):
-	
+
 	  # ifconfig bond0 down ; modprobe -r bonding
 	  # ifconfig bond0 .... up
 	  # ifenslave bond0 eth...
 
 	This method will automatically take the address from the next slave
 	that will be added.
-	
+
 	To restore your slaves' MAC addresses, you need to detach them
 	from the bond (`ifenslave -d bond0 eth0'), set them down
 	(`ifconfig eth0 down'), unload the drivers (`rmmod 3c59x', for
@@ -729,39 +715,38 @@
 =================
 
 To implement high availability using the bonding driver, the driver needs to be
-compiled as a module, because currently it is the only way to pass parameters 
+compiled as a module, because currently it is the only way to pass parameters
 to the driver. This may change in the future.
 
-High availability is achieved by using MII or ETHTOOL status reporting. You 
-need to verify that all your interfaces support MII or ETHTOOL link status 
-reporting.  On Linux kernel 2.2.17, all the 100 Mbps capable drivers and 
-yellowfin gigabit driver support MII. To determine if ETHTOOL link reporting 
-is available for interface eth0, type "ethtool eth0" and the "Link detected:" 
-line should contain the correct link status. If your system has an interface 
-that does not support MII or ETHTOOL status reporting, a failure of its link 
-will not be detected! A message indicating MII and ETHTOOL is not supported by 
-a network driver is logged when the bonding driver is loaded with a non-zero 
+High availability is achieved by using MII or ETHTOOL status reporting. You
+need to verify that all your interfaces support MII or ETHTOOL link status
+reporting.  On Linux kernel 2.2.17, all the 100 Mbps capable drivers and
+yellowfin gigabit driver support MII. To determine if ETHTOOL link reporting
+is available for interface eth0, type "ethtool eth0" and the "Link detected:"
+line should contain the correct link status. If your system has an interface
+that does not support MII or ETHTOOL status reporting, a failure of its link
+will not be detected! A message indicating MII and ETHTOOL is not supported by
+a network driver is logged when the bonding driver is loaded with a non-zero
 miimon value.
 
 The bonding driver can regularly check all its slaves links using the ETHTOOL
-IOCTL (ETHTOOL_GLINK command) or by checking the MII status registers. The 
-check interval is specified by the module argument "miimon" (MII monitoring). 
-It takes an integer that represents the checking time in milliseconds. It 
-should not come to close to (1000/HZ) (10 milli-seconds on i386) because it 
-may then reduce the system interactivity. A value of 100 seems to be a good 
-starting point. It means that a dead link will be detected at most 100 
+IOCTL (ETHTOOL_GLINK command) or by checking the MII status registers. The
+check interval is specified by the module argument "miimon" (MII monitoring).
+It takes an integer that represents the checking time in milliseconds. It
+should not come to close to (1000/HZ) (10 milli-seconds on i386) because it
+may then reduce the system interactivity. A value of 100 seems to be a good
+starting point. It means that a dead link will be detected at most 100
 milli-seconds after it goes down.
 
 Example:
 
    # modprobe bonding miimon=100
 
-Or, put the following lines in /etc/modules.conf:
+Or, put the following line in /etc/modprobe.conf:
 
-   alias bond0 bonding
    options bond0 miimon=100
 
-There are currently two policies for high availability. They are dependent on 
+There are currently two policies for high availability. They are dependent on
 whether:
 
    a) hosts are connected to a single host or switch that support trunking
@@ -811,7 +796,7 @@
      # ifenslave bond0 eth0 eth1
 
 
-2) High Availability on two or more switches (or a single switch without 
+2) High Availability on two or more switches (or a single switch without
    trunking support)
 ---------------------------------------------------------------------------
 This mode is more problematic because it relies on the fact that there
@@ -829,9 +814,8 @@
 
     # modprobe bonding miimon=100 mode=1
 
-Or, put in your /etc/modules.conf :
+Or, put in your /etc/modprobe.conf :
 
-    alias bond0 bonding
     options bond0 miimon=100 mode=active-backup
 
 Example 1: Using multiple host and multiple switches to build a "no single
@@ -870,10 +854,10 @@
 connected to one switch and host2's to the other. Such system will survive
 a failure of a single host, cable, or switch. The worst thing that may happen
 in the case of a switch failure is that half of the hosts will be temporarily
-unreachable until the other switch expires its tables. 
+unreachable until the other switch expires its tables.
 
 Example 2: Using multiple ethernet cards connected to a switch to configure
-           NIC failover (switch is not required to support trunking). 
+           NIC failover (switch is not required to support trunking).
 
 
           +----------+                          +----------+
@@ -933,7 +917,6 @@
 must add the promisc flag there; it will be propagated down to the
 slave interfaces at ifenslave time; a full example might look like:
 
-   grep bond0 /etc/modules.conf || echo alias bond0 bonding >/etc/modules.conf
    ifconfig bond0 promisc up
    for if in eth1 eth2 ...;do
        ifconfig $if up
@@ -957,7 +940,7 @@
     servers, but may be useful when the front switches send multicast
     information on their links (e.g. VRRP), or even health-check the servers.
     Use the arp_interval/arp_ip_target parameters to count incoming/outgoing
-    frames.  
+    frames.
 
 
 
@@ -973,13 +956,12 @@
 You will also find a lot of information regarding Ethernet, NWay, MII, etc. at
 www.scyld.com.
 
-For new versions of the driver, patches for older kernels and the updated
-userspace tools, take a look at Willy Tarreau's site :
+Patches for 2.2 kernels are at Willy Tarreau's site :
  - http://wtarreau.free.fr/pub/bonding/
- - http://www-miaif.lip6.fr/willy/pub/bonding/
+ - http://www-miaif.lip6.fr/~tarreau/pub/bonding/
 
 To get latest informations about Linux Kernel development, please consult
 the Linux Kernel Mailing List Archives at :
-   http://boudicca.tux.org/hypermail/linux-kernel/latest/
+   http://www.ussg.iu.edu/hypermail/linux/kernel/
 
 -- END --
--- diff/Documentation/networking/dl2k.txt	2002-10-16 04:28:29.000000000 +0100
+++ source/Documentation/networking/dl2k.txt	2004-02-09 10:39:51.000000000 +0000
@@ -37,15 +37,15 @@
 Install linux driver as following command:
 
 1. make all
-2. insmod dl2k.o
+2. insmod dl2k.ko
 3. ifconfig eth0 up 10.xxx.xxx.xxx netmask 255.0.0.0
 		    ^^^^^^^^^^^^^^^\	    ^^^^^^^^\
 				    IP		     NETMASK
 Now eth0 should active, you can test it by "ping" or get more information by
 "ifconfig". If tested ok, continue the next step.
 
-4. cp dl2k.o /lib/modules/`uname -r`/kernel/drivers/net
-5. Add the following lines to /etc/modules.conf:
+4. cp dl2k.ko /lib/modules/`uname -r`/kernel/drivers/net
+5. Add the following line to /etc/modprobe.conf:
 	alias eth0 dl2k
 6. Run "netconfig" or "netconf" to create configuration script ifcfg-eth0
    located at /etc/sysconfig/network-scripts or create it manually.
@@ -154,8 +154,8 @@
   -----------------
   1. Copy dl2k.o to the network modules directory, typically
      /lib/modules/2.x.x-xx/net or /lib/modules/2.x.x/kernel/drivers/net.
-  2. Locate the boot module configuration file, most commonly modules.conf
-     or conf.modules in the /etc directory. Add the following lines:
+  2. Locate the boot module configuration file, most commonly modprobe.conf
+     or modules.conf (for 2.4) in the /etc directory. Add the following lines:
 
      alias ethx dl2k
      options dl2k <optional parameters>
--- diff/Documentation/networking/ifenslave.c	2003-09-30 15:46:10.000000000 +0100
+++ source/Documentation/networking/ifenslave.c	2004-02-09 10:39:51.000000000 +0000
@@ -4,8 +4,6 @@
  *	This program controls the Linux implementation of running multiple
  *	network interfaces in parallel.
  *
- * Usage:	ifenslave [-v] master-interface < slave-interface [metric <N>] > ...
- *
  * Author:	Donald Becker <becker@cesdis.gsfc.nasa.gov>
  *		Copyright 1994-1996 Donald Becker
  *
@@ -90,24 +88,30 @@
  * 	 - For opt_c: slave should not be set to the master's setting
  *	   while it is running. It was already set during enslave. To
  *	   simplify things, it is now handeled separately.
+ *
+ *    - 2003/12/01 - Shmulik Hen <shmulik.hen at intel dot com>
+ *	 - Code cleanup and style changes
+ *	   set version to 1.1.0
  */
 
-#define APP_VERSION	"1.0.12"
-#define APP_RELDATE	"June 30, 2003"
+#define APP_VERSION	"1.1.0"
+#define APP_RELDATE	"December 1, 2003"
 #define APP_NAME	"ifenslave"
 
 static char *version =
-APP_NAME ".c:v" APP_VERSION " (" APP_RELDATE ") "  "\nDonald Becker (becker@cesdis.gsfc.nasa.gov).\n"
-"detach support added on 2000/10/02 by Willy Tarreau (willy at meta-x.org).\n"
-"2.4 kernel support added on 2001/02/16 by Chad N. Tindel (ctindel at ieee dot org.\n";
+APP_NAME ".c:v" APP_VERSION " (" APP_RELDATE ")\n"
+"o Donald Becker (becker@cesdis.gsfc.nasa.gov).\n"
+"o Detach support added on 2000/10/02 by Willy Tarreau (willy at meta-x.org).\n"
+"o 2.4 kernel support added on 2001/02/16 by Chad N. Tindel\n"
+"  (ctindel at ieee dot org).\n";
 
 static const char *usage_msg =
-"Usage: ifenslave [-adfrvVh] <master-interface> < <slave-if> [metric <N>] > ...\n"
-"       ifenslave -c master-interface slave-if\n";
+"Usage: ifenslave [-f] <master-if> <slave-if> [<slave-if>...]\n"
+"       ifenslave -d   <master-if> <slave-if> [<slave-if>...]\n"
+"       ifenslave -c   <master-if> <slave-if>\n"
+"       ifenslave --help\n";
 
-static const char *howto_msg =
-"Usage: ifenslave [-adfrvVh] <master-interface> < <slave-if> [metric <N>] > ...\n"
-"       ifenslave -c master-interface slave-if\n"
+static const char *help_msg =
 "\n"
 "       To create a bond device, simply follow these three steps :\n"
 "       - ensure that the required drivers are properly loaded :\n"
@@ -115,18 +119,32 @@
 "       - assign an IP address to the bond device :\n"
 "         # ifconfig bond0 <addr> netmask <mask> broadcast <bcast>\n"
 "       - attach all the interfaces you need to the bond device :\n"
-"         # ifenslave bond0 eth0 eth1 eth2\n"
+"         # ifenslave [{-f|--force}] bond0 eth0 [eth1 [eth2]...]\n"
 "         If bond0 didn't have a MAC address, it will take eth0's. Then, all\n"
 "         interfaces attached AFTER this assignment will get the same MAC addr.\n"
-"\n"
-"       To detach a dead interface without setting the bond device down :\n"
-"         # ifenslave -d bond0 eth1\n"
+"         (except for ALB/TLB modes)\n"
 "\n"
 "       To set the bond device down and automatically release all the slaves :\n"
 "         # ifconfig bond0 down\n"
 "\n"
+"       To detach a dead interface without setting the bond device down :\n"
+"         # ifenslave {-d|--detach} bond0 eth0 [eth1 [eth2]...]\n"
+"\n"
 "       To change active slave :\n"
-"         # ifenslave -c bond0 eth0\n"
+"         # ifenslave {-c|--change-active} bond0 eth0\n"
+"\n"
+"       To show master interface info\n"
+"         # ifenslave bond0\n"
+"\n"
+"       To show all interfaces info\n"
+"       # ifenslave {-a|--all-interfaces}\n"
+"\n"
+"       To be more verbose\n"
+"       # ifenslave {-v|--verbose} ...\n"
+"\n"
+"       # ifenslave {-u|--usage}   Show usage\n"
+"       # ifenslave {-V|--version} Show version\n"
+"       # ifenslave {-h|--help}    This message\n"
 "\n";
 
 #include <unistd.h>
@@ -153,476 +171,332 @@
 #include <linux/ethtool.h>
 
 struct option longopts[] = {
- /* { name  has_arg  *flag  val } */
-    {"all-interfaces", 0, 0, 'a'},	/* Show all interfaces. */
-    {"force",       0, 0, 'f'},		/* Force the operation. */
-    {"help", 		0, 0, '?'},		/* Give help */
-	{"howto",       0, 0, 'h'},     /* Give some more help */
-    {"receive-slave", 0, 0, 'r'},	/* Make a receive-only slave.  */
-    {"verbose", 	0, 0, 'v'},		/* Report each action taken.  */
-    {"version", 	0, 0, 'V'},		/* Emit version information.  */
-    {"detach",       0, 0, 'd'},	/* Detach a slave interface. */
-    {"change-active", 0, 0, 'c'},	/* Change the active slave.  */
-    { 0, 0, 0, 0 }
+	/* { name  has_arg  *flag  val } */
+	{"all-interfaces",	0, 0, 'a'},	/* Show all interfaces. */
+	{"change-active",	0, 0, 'c'},	/* Change the active slave.  */
+	{"detach",		0, 0, 'd'},	/* Detach a slave interface. */
+	{"force",		0, 0, 'f'},	/* Force the operation. */
+	{"help",		0, 0, 'h'},	/* Give help */
+	{"usage",		0, 0, 'u'},	/* Give usage */
+	{"verbose",		0, 0, 'v'},	/* Report each action taken. */
+	{"version",		0, 0, 'V'},	/* Emit version information. */
+	{ 0, 0, 0, 0}
 };
 
 /* Command-line flags. */
 unsigned int
-opt_a = 0,					/* Show-all-interfaces flag. */
-opt_f = 0,					/* Force the operation. */
-opt_r = 0,					/* Set up a Rx-only slave. */
-opt_d = 0,					/* detach a slave interface. */
-opt_c = 0,					/* change-active-slave flag. */
-verbose = 0,					/* Verbose flag. */
-opt_version = 0,
-opt_howto = 0;
-int skfd = -1;					/* AF_INET socket for ioctl() calls.	*/
+opt_a = 0,	/* Show-all-interfaces flag. */
+opt_c = 0,	/* Change-active-slave flag. */
+opt_d = 0,	/* Detach a slave interface. */
+opt_f = 0,	/* Force the operation. */
+opt_h = 0,	/* Help */
+opt_u = 0,	/* Usage */
+opt_v = 0,	/* Verbose flag. */
+opt_V = 0;	/* Version */
+
+int skfd = -1;		/* AF_INET socket for ioctl() calls.*/
+int abi_ver = 0;	/* userland - kernel ABI version */
+int hwaddr_set = 0;	/* Master's hwaddr is set */
+int saved_errno;
+
+struct ifreq master_mtu, master_flags, master_hwaddr;
+struct ifreq slave_mtu, slave_flags, slave_hwaddr;
+
+struct dev_ifr {
+	struct ifreq *req_ifr;
+	char *req_name;
+	int req_type;
+};
+
+struct dev_ifr master_ifra[] = {
+	{&master_mtu,     "SIOCGIFMTU",     SIOCGIFMTU},
+	{&master_flags,   "SIOCGIFFLAGS",   SIOCGIFFLAGS},
+	{&master_hwaddr,  "SIOCGIFHWADDR",  SIOCGIFHWADDR},
+	{NULL, "", 0}
+};
+
+struct dev_ifr slave_ifra[] = {
+	{&slave_mtu,     "SIOCGIFMTU",     SIOCGIFMTU},
+	{&slave_flags,   "SIOCGIFFLAGS",   SIOCGIFFLAGS},
+	{&slave_hwaddr,  "SIOCGIFHWADDR",  SIOCGIFHWADDR},
+	{NULL, "", 0}
+};
 
 static void if_print(char *ifname);
-static int get_abi_ver(char *master_ifname);
+static int get_drv_info(char *master_ifname);
+static int get_if_settings(char *ifname, struct dev_ifr ifra[]);
+static int get_slave_flags(char *slave_ifname);
+static int set_master_hwaddr(char *master_ifname, struct sockaddr *hwaddr);
+static int set_slave_hwaddr(char *slave_ifname, struct sockaddr *hwaddr);
+static int set_slave_mtu(char *slave_ifname, int mtu);
+static int set_if_flags(char *ifname, short flags);
+static int set_if_up(char *ifname, short flags);
+static int set_if_down(char *ifname, short flags);
+static int clear_if_addr(char *ifname);
+static int set_if_addr(char *master_ifname, char *slave_ifname);
+static int change_active(char *master_ifname, char *slave_ifname);
+static int enslave(char *master_ifname, char *slave_ifname);
+static int release(char *master_ifname, char *slave_ifname);
+#define v_print(fmt, args...)	\
+	if (opt_v)		\
+		fprintf(stderr, fmt, ## args )
 
-int
-main(int argc, char **argv)
+int main(int argc, char *argv[])
 {
-	struct ifreq  ifr2, if_hwaddr, if_ipaddr, if_metric, if_mtu, if_dstaddr;
-	struct ifreq  if_netmask, if_brdaddr, if_flags;
-	int rv, goterr = 0;
-	int c, errflag = 0;
-	sa_family_t master_family;
 	char **spp, *master_ifname, *slave_ifname;
-	int hwaddr_notset;
-	int abi_ver = 0;
+	int c, i, rv;
+	int res = 0;
+	int exclusive = 0;
 
-	while ((c = getopt_long(argc, argv, "acdfrvV?h", longopts, 0)) != EOF)
+	while ((c = getopt_long(argc, argv, "acdfhuvV", longopts, 0)) != EOF) {
 		switch (c) {
-		case 'a': opt_a++; break;
-		case 'f': opt_f++; break;
-		case 'r': opt_r++; break;
-		case 'd': opt_d++; break;
-		case 'c': opt_c++; break;
-		case 'v': verbose++;		break;
-		case 'V': opt_version++;	break;
-		case 'h': opt_howto++;	break;
-		case '?': errflag++;
-		}
+		case 'a': opt_a++; exclusive++; break;
+		case 'c': opt_c++; exclusive++; break;
+		case 'd': opt_d++; exclusive++; break;
+		case 'f': opt_f++; exclusive++; break;
+		case 'h': opt_h++; exclusive++; break;
+		case 'u': opt_u++; exclusive++; break;
+		case 'v': opt_v++; break;
+		case 'V': opt_V++; exclusive++; break;
 
-	/* option check */
-	if (opt_c)
-		if(opt_a || opt_f || opt_r || opt_d || verbose || opt_version ||
-		   opt_howto || errflag ) {
+		case '?':
 			fprintf(stderr, usage_msg);
-			return 2;
+			res = 2;
+			goto out;
 		}
+	}
 
-	if (errflag) {
+	/* options check */
+	if (exclusive > 1) {
 		fprintf(stderr, usage_msg);
-		return 2;
+		res = 2;
+		goto out;
 	}
 
-	if (opt_howto) {
-		fprintf(stderr, howto_msg);
-		return 0;
+	if (opt_v || opt_V) {
+		printf(version);
+		if (opt_V) {
+			res = 0;
+			goto out;
+		}
 	}
 
-	if (verbose || opt_version) {
-		printf(version);
-		if (opt_version)
-			exit(0);
+	if (opt_u) {
+		printf(usage_msg);
+		res = 0;
+		goto out;
 	}
 
-	/* Open a basic socket. */
-	if ((skfd = socket(AF_INET, SOCK_DGRAM,0)) < 0) {
-		perror("socket");
-		exit(-1);
+	if (opt_h) {
+		printf(usage_msg);
+		printf(help_msg);
+		res = 0;
+		goto out;
 	}
 
-	if (verbose)
-		fprintf(stderr, "DEBUG: argc=%d, optind=%d and argv[optind] is %s.\n",
-				argc, optind, argv[optind]);
+	/* Open a basic socket */
+	if ((skfd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
+		perror("socket");
+		res = 1;
+		goto out;
+	}
 
-	/* No remaining args means show all interfaces. */
-	if (optind == argc) {
-		if_print((char *)NULL);
-		(void) close(skfd);
-		exit(0);
+	if (opt_a) {
+		if (optind == argc) {
+			/* No remaining args */
+			/* show all interfaces */
+			if_print((char *)NULL);
+			goto out;
+		} else {
+			/* Just show usage */
+			fprintf(stderr, usage_msg);
+			res = 2;
+			goto out;
+		}
 	}
 
-	/* Copy the interface name. */
+	/* Copy the interface name */
 	spp = argv + optind;
 	master_ifname = *spp++;
-	slave_ifname = *spp++;
 
-	/* Check command line. */
-	if (opt_c) {
-		char **tempp = spp;
-		if ((master_ifname == NULL)||(slave_ifname == NULL)||(*tempp++ != NULL)) {
-			fprintf(stderr, usage_msg);
-			(void) close(skfd);
-			return 2;
-		}
+	if (master_ifname == NULL) {
+		fprintf(stderr, usage_msg);
+		res = 2;
+		goto out;
 	}
 
-	/* A single args means show the configuration for this interface. */
-	if (slave_ifname == NULL) {
-		if_print(master_ifname);
-		(void) close(skfd);
-		exit(0);
+	/* exchange abi version with bonding module */
+	res = get_drv_info(master_ifname);
+	if (res) {
+		fprintf(stderr,
+			"Master '%s': Error: handshake with driver failed. "
+			"Aborting\n",
+			master_ifname);
+		goto out;
 	}
 
-	/* exchange abi version with bonding driver */
-	abi_ver = get_abi_ver(master_ifname);
-	if (abi_ver < 0) {
-		(void) close(skfd);
-		exit(1);
-	}
-
-	/* Get the vitals from the master interface. */
-	{
-		struct ifreq *ifra[7] = { &if_ipaddr, &if_mtu, &if_dstaddr,
-								  &if_brdaddr, &if_netmask, &if_flags,
-								  &if_hwaddr };
-		const char *req_name[7] = {
-			"IP address", "MTU", "destination address",
-			"broadcast address", "netmask", "status flags",
-			"hardware address" };
-		const int ioctl_req_type[7] = {
-			SIOCGIFADDR, SIOCGIFMTU, SIOCGIFDSTADDR,
-			SIOCGIFBRDADDR, SIOCGIFNETMASK, SIOCGIFFLAGS,
-			SIOCGIFHWADDR };
-		int i;
-
-		for (i = 0; i < 7; i++) {
-			strncpy(ifra[i]->ifr_name, master_ifname, IFNAMSIZ);
-			if (ioctl(skfd, ioctl_req_type[i], ifra[i]) < 0) {
-				fprintf(stderr,
-						"Something broke getting the master's %s: %s.\n",
-						req_name[i], strerror(errno));
-			}
-		}
-
-		/* check if master is up; if not then fail any operation */
-		if (!(if_flags.ifr_flags & IFF_UP)) {
-			fprintf(stderr, "Illegal operation; the specified master interface '%s' is not up.\n", master_ifname);
-			(void) close(skfd);
-			exit (1);
-		}
+	slave_ifname = *spp++;
 
-		hwaddr_notset = 1; /* assume master's address not set yet */
-		for (i = 0; hwaddr_notset && (i < 6); i++) {
-			hwaddr_notset &= ((unsigned char *)if_hwaddr.ifr_hwaddr.sa_data)[i] == 0;
+	if (slave_ifname == NULL) {
+		if (opt_d || opt_c) {
+			fprintf(stderr, usage_msg);
+			res = 2;
+			goto out;
 		}
 
-		/* The family '1' is ARPHRD_ETHER for ethernet. */
-		if (if_hwaddr.ifr_hwaddr.sa_family != 1 && !opt_f) {
-			fprintf(stderr, "The specified master interface '%s' is not"
-					" ethernet-like.\n  This program is designed to work"
-					" with ethernet-like network interfaces.\n"
-					" Use the '-f' option to force the operation.\n",
-					master_ifname);
-			(void) close(skfd);
-			exit (1);
-		}
-		master_family = if_hwaddr.ifr_hwaddr.sa_family;
-		if (verbose) {
-			unsigned char *hwaddr = (unsigned char *)if_hwaddr.ifr_hwaddr.sa_data;
-			printf("The current hardware address (SIOCGIFHWADDR) of %s is type %d  "
-				   "%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x.\n", master_ifname,
-				   if_hwaddr.ifr_hwaddr.sa_family, hwaddr[0], hwaddr[1],
-				   hwaddr[2], hwaddr[3], hwaddr[4], hwaddr[5]);
-		}
+		/* A single arg means show the
+		 * configuration for this interface
+		 */
+		if_print(master_ifname);
+		goto out;
 	}
 
+	res = get_if_settings(master_ifname, master_ifra);
+	if (res) {
+		/* Probably a good reason not to go on */
+		fprintf(stderr,
+			"Master '%s': Error: get settings failed: %s. "
+			"Aborting\n",
+			master_ifname, strerror(res));
+		goto out;
+	}
 
-	/* do this when enslaving interfaces */
-	do {
-		if (opt_d) {  /* detach a slave interface from the master */
-			strncpy(if_flags.ifr_name, master_ifname, IFNAMSIZ);
-			strncpy(if_flags.ifr_slave, slave_ifname, IFNAMSIZ);
-			if ((ioctl(skfd, SIOCBONDRELEASE, &if_flags) < 0) &&
-				(ioctl(skfd, BOND_RELEASE_OLD, &if_flags) < 0)) {
-					fprintf(stderr,	"SIOCBONDRELEASE: cannot detach %s from %s. errno=%s.\n",
-							slave_ifname, master_ifname, strerror(errno));
-			}
-			else if (abi_ver < 1) {
-			      	/* The driver is using an old ABI, so we'll set the interface
-				 * down to avoid any conflicts due to same IP/MAC
-				 */
-				strncpy(ifr2.ifr_name, slave_ifname, IFNAMSIZ);
-				if (ioctl(skfd, SIOCGIFFLAGS, &ifr2) < 0) {
-					int saved_errno = errno;
-					fprintf(stderr, "SIOCGIFFLAGS on %s failed: %s\n", slave_ifname,
-						strerror(saved_errno));
-				}
-				else {
-					ifr2.ifr_flags &= ~(IFF_UP | IFF_RUNNING);
-					if (ioctl(skfd, SIOCSIFFLAGS, &ifr2) < 0) {
-						int saved_errno = errno;
-						fprintf(stderr, "Shutting down interface %s failed: %s\n",
-							slave_ifname, strerror(saved_errno));
-					}
-				}
-			}
-		} else if (opt_c) { /* change primary slave */
-			strncpy(if_flags.ifr_name, master_ifname, IFNAMSIZ);
-			strncpy(if_flags.ifr_slave, slave_ifname, IFNAMSIZ);
-			if ((ioctl(skfd, SIOCBONDCHANGEACTIVE, &if_flags) < 0) &&
-			    (ioctl(skfd, BOND_CHANGE_ACTIVE_OLD, &if_flags) < 0)) {
-				fprintf(stderr,	"SIOCBONDCHANGEACTIVE: %s.\n", strerror(errno));
-			}
-		} else {  /* attach a slave interface to the master */
-
-			strncpy(ifr2.ifr_name, slave_ifname, IFNAMSIZ);
-			if (ioctl(skfd, SIOCGIFFLAGS, &ifr2) < 0) {
-				int saved_errno = errno;
-				fprintf(stderr, "SIOCGIFFLAGS on %s failed: %s\n", slave_ifname,
-						strerror(saved_errno));
-				(void) close(skfd);
-				return 1;
-			}
-
-			if ((ifr2.ifr_flags & IFF_SLAVE) && !opt_r) {
-				fprintf(stderr, "%s is already a slave\n", slave_ifname);
-				(void) close(skfd);
-				return 1;
-			}
-
-			/* if hwaddr_notset, assign the slave hw address to the master */
-			if (hwaddr_notset) {
-				/* assign the slave hw address to the
-				 * master since it currently does not
-				 * have one; otherwise, slaves may
-				 * have different hw addresses in
-				 * active-backup mode as seen when enslaving
-				 * using "ifenslave bond0 eth0 eth1" because
-				 * hwaddr_notset is set outside this loop.
-				 * TODO: put this and the "else" portion in
-				 *       a function.
-				 */
-				/* get the slaves MAC address */
-				strncpy(if_hwaddr.ifr_name, slave_ifname,
-					IFNAMSIZ);
-				rv = ioctl(skfd, SIOCGIFHWADDR, &if_hwaddr);
-				if (-1 == rv) {
-					fprintf(stderr, "Could not get MAC "
-						"address of %s: %s\n",
-						slave_ifname,
-						strerror(errno));
-					strncpy(if_hwaddr.ifr_name,
-						master_ifname, IFNAMSIZ);
-					goterr = 1;
-				}
-
-				if (!goterr) {
-					if (abi_ver < 1) {
-						/* In ABI versions older than 1, the
-						 * master's set_mac routine couldn't
-						 * work if it was up, because it
-						 * used the default ethernet set_mac
-						 * function.
-						 */
-						/* bring master down */
-						if_flags.ifr_flags &= ~IFF_UP;
-						if (ioctl(skfd, SIOCSIFFLAGS,
-								&if_flags) < 0) {
-							goterr = 1;
-							fprintf(stderr,
-								"Shutting down "
-								"interface %s failed: "
-								"%s\n",
-								master_ifname,
-								strerror(errno));
-						}
-					}
-
-					strncpy(if_hwaddr.ifr_name,
-						master_ifname, IFNAMSIZ);
-					if (ioctl(skfd, SIOCSIFHWADDR,
-							&if_hwaddr) < 0) {
-						fprintf(stderr,
-							"Could not set MAC "
-							"address of %s: %s\n",
-							master_ifname,
-							strerror(errno));
-						goterr=1;
-					} else {
-						hwaddr_notset = 0;
-					}
-
-					if (abi_ver < 1) {
-						/* bring master back up */
-						if_flags.ifr_flags |= IFF_UP;
-						if (ioctl(skfd, SIOCSIFFLAGS,
-							  &if_flags) < 0) {
-							fprintf(stderr,
-								"Bringing up interface "
-								"%s failed: %s\n",
-								master_ifname,
-								strerror(errno));
-						}
-					}
-				}
-			} else if (abi_ver < 1) { /* if (hwaddr_notset) */
-
-			      	/* The driver is using an old ABI, so we'll set the interface
-				 * down and assign the master's hwaddr to it
-				 */
-				if (ifr2.ifr_flags & IFF_UP) {
-					ifr2.ifr_flags &= ~IFF_UP;
-					if (ioctl(skfd, SIOCSIFFLAGS, &ifr2) < 0) {
-						int saved_errno = errno;
-						fprintf(stderr, "Shutting down interface %s failed: %s\n",
-							slave_ifname, strerror(saved_errno));
-					}
-				}
-
-				strncpy(if_hwaddr.ifr_name, slave_ifname, IFNAMSIZ);
-				if (ioctl(skfd, SIOCSIFHWADDR, &if_hwaddr) < 0) {
-					int saved_errno = errno;
-					fprintf(stderr, "SIOCSIFHWADDR on %s failed: %s\n", if_hwaddr.ifr_name,
-						strerror(saved_errno));
-					if (saved_errno == EBUSY)
-						fprintf(stderr, "  The slave device %s is busy: it must be"
-							" idle before running this command.\n", slave_ifname);
-					else if (saved_errno == EOPNOTSUPP)
-						fprintf(stderr, "  The slave device you specified does not support"
-							" setting the MAC address.\n  Your kernel likely does not"
-							" support slave devices.\n");
-					else if (saved_errno == EINVAL)
-						fprintf(stderr, "  The slave device's address type does not match"
-							" the master's address type.\n");
-				} else {
-					if (verbose) {
-						unsigned char *hwaddr = if_hwaddr.ifr_hwaddr.sa_data;
-						printf("Slave's (%s) hardware address set to "
-							   "%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x.\n", slave_ifname,
-							   hwaddr[0], hwaddr[1], hwaddr[2], hwaddr[3], hwaddr[4], hwaddr[5]);
-					}
-				}
-			}
+	/* check if master is indeed a master;
+	 * if not then fail any operation
+	 */
+	if (!(master_flags.ifr_flags & IFF_MASTER)) {
+		fprintf(stderr,
+			"Illegal operation; the specified interface '%s' "
+			"is not a master. Aborting\n",
+			master_ifname);
+		res = 1;
+		goto out;
+	}
 
-			if (*spp  &&  !strcmp(*spp, "metric")) {
-				if (*++spp == NULL) {
-					fprintf(stderr, usage_msg);
-					(void) close(skfd);
-					exit(2);
-				}
-				if_metric.ifr_metric = atoi(*spp);
-				strncpy(if_metric.ifr_name, slave_ifname, IFNAMSIZ);
-				if (ioctl(skfd, SIOCSIFMETRIC, &if_metric) < 0) {
-					fprintf(stderr, "SIOCSIFMETRIC on %s: %s\n", slave_ifname,
-							strerror(errno));
-					goterr = 1;
-				}
-				spp++;
-			}
+	/* check if master is up; if not then fail any operation */
+	if (!(master_flags.ifr_flags & IFF_UP)) {
+		fprintf(stderr,
+			"Illegal operation; the specified master interface "
+			"'%s' is not up.\n",
+			master_ifname);
+		res = 1;
+		goto out;
+	}
 
-			if (strncpy(if_ipaddr.ifr_name, slave_ifname, IFNAMSIZ) <= 0
-				|| ioctl(skfd, SIOCSIFADDR, &if_ipaddr) < 0) {
-				fprintf(stderr,
-						"Something broke setting the slave's address: %s.\n",
-						strerror(errno));
-			} else {
-				if (verbose) {
-					unsigned char *ipaddr = if_ipaddr.ifr_addr.sa_data;
-					printf("Set the slave's (%s) IP address to %d.%d.%d.%d.\n",
-						   slave_ifname, ipaddr[0], ipaddr[1], ipaddr[2], ipaddr[3]);
-				}
-			}
+	/* Only for enslaving */
+	if (!opt_c && !opt_d) {
+		sa_family_t master_family = master_hwaddr.ifr_hwaddr.sa_family;
+		unsigned char *hwaddr =
+			(unsigned char *)master_hwaddr.ifr_hwaddr.sa_data;
 
-			if (strncpy(if_mtu.ifr_name, slave_ifname, IFNAMSIZ) <= 0
-				|| ioctl(skfd, SIOCSIFMTU, &if_mtu) < 0) {
-				fprintf(stderr, "Something broke setting the slave MTU: %s.\n",
-						strerror(errno));
-			} else {
-				if (verbose)
-					printf("Set the slave's (%s) MTU to %d.\n", slave_ifname, if_mtu.ifr_mtu);
-			}
+		/* The family '1' is ARPHRD_ETHER for ethernet. */
+		if (master_family != 1 && !opt_f) {
+			fprintf(stderr,
+				"Illegal operation: The specified master "
+				"interface '%s' is not ethernet-like.\n "
+				"This program is designed to work with "
+				"ethernet-like network interfaces.\n "
+				"Use the '-f' option to force the "
+				"operation.\n",
+				master_ifname);
+			res = 1;
+			goto out;
+		}
 
-			if (strncpy(if_dstaddr.ifr_name, slave_ifname, IFNAMSIZ) <= 0
-				|| ioctl(skfd, SIOCSIFDSTADDR, &if_dstaddr) < 0) {
-				fprintf(stderr, "Error setting the slave (%s) with SIOCSIFDSTADDR: %s.\n",
-						slave_ifname, strerror(errno));
-			} else {
-				if (verbose) {
-					unsigned char *ipaddr = if_dstaddr.ifr_dstaddr.sa_data;
-					printf("Set the slave's (%s) destination address to %d.%d.%d.%d.\n",
-						   slave_ifname, ipaddr[0], ipaddr[1], ipaddr[2], ipaddr[3]);
-				}
+		/* Check master's hw addr */
+		for (i = 0; i < 6; i++) {
+			if (hwaddr[i] != 0) {
+				hwaddr_set = 1;
+				break;
 			}
+		}
 
-			if (strncpy(if_brdaddr.ifr_name, slave_ifname, IFNAMSIZ) <= 0
-				|| ioctl(skfd, SIOCSIFBRDADDR, &if_brdaddr) < 0) {
-				fprintf(stderr,
-						"Something broke setting the slave (%s) broadcast address: %s.\n",
-						slave_ifname, strerror(errno));
-			} else {
-				if (verbose) {
-					unsigned char *ipaddr = if_brdaddr.ifr_broadaddr.sa_data;
-					printf("Set the slave's (%s) broadcast address to %d.%d.%d.%d.\n",
-						   slave_ifname, ipaddr[0], ipaddr[1], ipaddr[2], ipaddr[3]);
-				}
-			}
+		if (hwaddr_set) {
+			v_print("current hardware address of master '%s' "
+				"is %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x, "
+				"type %d\n",
+				master_ifname,
+				hwaddr[0], hwaddr[1],
+				hwaddr[2], hwaddr[3],
+				hwaddr[4], hwaddr[5],
+				master_family);
+		}
+	}
 
-			if (strncpy(if_netmask.ifr_name, slave_ifname, IFNAMSIZ) <= 0
-				|| ioctl(skfd, SIOCSIFNETMASK, &if_netmask) < 0) {
-				fprintf(stderr,
-						"Something broke setting the slave (%s) netmask: %s.\n",
-						slave_ifname, strerror(errno));
-			} else {
-				if (verbose) {
-					unsigned char *ipaddr = if_netmask.ifr_netmask.sa_data;
-					printf("Set the slave's (%s) netmask to %d.%d.%d.%d.\n",
-						   slave_ifname, ipaddr[0], ipaddr[1], ipaddr[2], ipaddr[3]);
+	/* Accepts only one slave */
+	if (opt_c) {
+		/* change active slave */
+		res = get_slave_flags(slave_ifname);
+		if (res) {
+			fprintf(stderr,
+				"Slave '%s': Error: get flags failed. "
+				"Aborting\n",
+				slave_ifname);
+			goto out;
+		}
+		res = change_active(master_ifname, slave_ifname);
+		if (res) {
+			fprintf(stderr,
+				"Master '%s', Slave '%s': Error: "
+				"Change active failed\n",
+				master_ifname, slave_ifname);
+		}
+	} else {
+		/* Accept multiple slaves */
+		do {
+			if (opt_d) {
+				/* detach a slave interface from the master */
+				rv = get_slave_flags(slave_ifname);
+				if (rv) {
+					/* Can't work with this slave. */
+					/* remember the error and skip it*/
+					fprintf(stderr,
+						"Slave '%s': Error: get flags "
+						"failed. Skipping\n",
+						slave_ifname);
+					res = rv;
+					continue;
 				}
-			}
-
-			if (abi_ver < 1) {
-
-			      	/* The driver is using an old ABI, so we'll set the interface
-				 * up before enslaving it
-				 */
-				ifr2.ifr_flags |= IFF_UP;
-				if ((ifr2.ifr_flags &= ~(IFF_SLAVE | IFF_MASTER)) == 0
-					|| strncpy(ifr2.ifr_name, slave_ifname, IFNAMSIZ) <= 0
-					|| ioctl(skfd, SIOCSIFFLAGS, &ifr2) < 0) {
-						fprintf(stderr,
-							"Something broke setting the slave (%s) flags: %s.\n",
-							slave_ifname, strerror(errno));
-				} else {
-					if (verbose)
-						printf("Set the slave's (%s) flags %4.4x.\n",
-							slave_ifname, if_flags.ifr_flags);
+				rv = release(master_ifname, slave_ifname);
+				if (rv) {
+					fprintf(stderr,
+						"Master '%s', Slave '%s': Error: "
+						"Release failed\n",
+						master_ifname, slave_ifname);
+					res = rv;
 				}
 			} else {
-				/* the bonding module takes care of setting the slave's mac address
-			 	 * and opening its interface
-			 	 */
-				if (ifr2.ifr_flags & IFF_UP) { /* the interface will need to be down */
-					ifr2.ifr_flags &= ~IFF_UP;
-					if (ioctl(skfd, SIOCSIFFLAGS, &ifr2) < 0) {
-						int saved_errno = errno;
-						fprintf(stderr, "Shutting down interface %s failed: %s\n",
-							slave_ifname, strerror(saved_errno));
-					}
+				/* attach a slave interface to the master */
+				rv = get_if_settings(slave_ifname, slave_ifra);
+				if (rv) {
+					/* Can't work with this slave. */
+					/* remember the error and skip it*/
+					fprintf(stderr,
+						"Slave '%s': Error: get "
+						"settings failed: %s. "
+						"Skipping\n",
+						slave_ifname, strerror(rv));
+					res = rv;
+					continue;
 				}
-			}
-
-			/* Do the real thing */
-			if (!opt_r) {
-				strncpy(if_flags.ifr_name, master_ifname, IFNAMSIZ);
-				strncpy(if_flags.ifr_slave, slave_ifname, IFNAMSIZ);
-				if ((ioctl(skfd, SIOCBONDENSLAVE, &if_flags) < 0) &&
-				    (ioctl(skfd, BOND_ENSLAVE_OLD, &if_flags) < 0)) {
-					fprintf(stderr,	"SIOCBONDENSLAVE: %s.\n", strerror(errno));
+				rv = enslave(master_ifname, slave_ifname);
+				if (rv) {
+					fprintf(stderr,
+						"Master '%s', Slave '%s': Error: "
+						"Enslave failed\n",
+						master_ifname, slave_ifname);
+					res = rv;
 				}
 			}
-		}
-	} while ( (slave_ifname = *spp++) != NULL);
+		} while ((slave_ifname = *spp++) != NULL);
+	}
 
-	/* Close the socket. */
-	(void) close(skfd);
+out:
+	if (skfd >= 0) {
+		close(skfd);
+	}
 
-	return(goterr);
+	return res;
 }
 
 static short mif_flags;
@@ -631,35 +505,34 @@
 static int if_getconfig(char *ifname)
 {
 	struct ifreq ifr;
-	int metric, mtu;			/* Parameters of the master interface. */
+	int metric, mtu;	/* Parameters of the master interface. */
 	struct sockaddr dstaddr, broadaddr, netmask;
+	unsigned char *hwaddr;
 
 	strcpy(ifr.ifr_name, ifname);
 	if (ioctl(skfd, SIOCGIFFLAGS, &ifr) < 0)
 		return -1;
 	mif_flags = ifr.ifr_flags;
 	printf("The result of SIOCGIFFLAGS on %s is %x.\n",
-		   ifname, ifr.ifr_flags);
+	       ifname, ifr.ifr_flags);
 
 	strcpy(ifr.ifr_name, ifname);
 	if (ioctl(skfd, SIOCGIFADDR, &ifr) < 0)
 		return -1;
 	printf("The result of SIOCGIFADDR is %2.2x.%2.2x.%2.2x.%2.2x.\n",
-		   ifr.ifr_addr.sa_data[0], ifr.ifr_addr.sa_data[1],
-		   ifr.ifr_addr.sa_data[2], ifr.ifr_addr.sa_data[3]);
+	       ifr.ifr_addr.sa_data[0], ifr.ifr_addr.sa_data[1],
+	       ifr.ifr_addr.sa_data[2], ifr.ifr_addr.sa_data[3]);
 
 	strcpy(ifr.ifr_name, ifname);
 	if (ioctl(skfd, SIOCGIFHWADDR, &ifr) < 0)
 		return -1;
 
-	{
-		/* Gotta convert from 'char' to unsigned for printf().  */
-		unsigned char *hwaddr = (unsigned char *)ifr.ifr_hwaddr.sa_data;
-		printf("The result of SIOCGIFHWADDR is type %d  "
-			   "%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x.\n",
-			   ifr.ifr_hwaddr.sa_family, hwaddr[0], hwaddr[1],
-			   hwaddr[2], hwaddr[3], hwaddr[4], hwaddr[5]);
-	}
+	/* Gotta convert from 'char' to unsigned for printf(). */
+	hwaddr = (unsigned char *)ifr.ifr_hwaddr.sa_data;
+	printf("The result of SIOCGIFHWADDR is type %d  "
+	       "%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x.\n",
+	       ifr.ifr_hwaddr.sa_family, hwaddr[0], hwaddr[1],
+	       hwaddr[2], hwaddr[3], hwaddr[4], hwaddr[5]);
 
 	strcpy(ifr.ifr_name, ifname);
 	if (ioctl(skfd, SIOCGIFMETRIC, &ifr) < 0) {
@@ -691,7 +564,7 @@
 	} else
 		netmask = ifr.ifr_netmask;
 
-	return(0);
+	return 0;
 }
 
 static void if_print(char *ifname)
@@ -705,15 +578,16 @@
 		ifc.ifc_len = sizeof(buff);
 		ifc.ifc_buf = buff;
 		if (ioctl(skfd, SIOCGIFCONF, &ifc) < 0) {
-			fprintf(stderr, "SIOCGIFCONF: %s\n", strerror(errno));
+			perror("SIOCGIFCONF failed");
 			return;
 		}
 
 		ifr = ifc.ifc_req;
 		for (i = ifc.ifc_len / sizeof(struct ifreq); --i >= 0; ifr++) {
 			if (if_getconfig(ifr->ifr_name) < 0) {
-				fprintf(stderr, "%s: unknown interface.\n",
-						ifr->ifr_name);
+				fprintf(stderr,
+					"%s: unknown interface.\n",
+					ifr->ifr_name);
 				continue;
 			}
 
@@ -721,16 +595,18 @@
 			/*ife_print(&ife);*/
 		}
 	} else {
-		if (if_getconfig(ifname) < 0)
-			fprintf(stderr, "%s: unknown interface.\n", ifname);
+		if (if_getconfig(ifname) < 0) {
+			fprintf(stderr,
+				"%s: unknown interface.\n", ifname);
+		}
 	}
 }
 
-static int get_abi_ver(char *master_ifname)
+static int get_drv_info(char *master_ifname)
 {
 	struct ifreq ifr;
 	struct ethtool_drvinfo info;
-	int abi_ver = 0;
+	char *endptr;
 
 	memset(&ifr, 0, sizeof(ifr));
 	strncpy(ifr.ifr_name, master_ifname, IFNAMSIZ);
@@ -739,24 +615,487 @@
 	info.cmd = ETHTOOL_GDRVINFO;
 	strncpy(info.driver, "ifenslave", 32);
 	snprintf(info.fw_version, 32, "%d", BOND_ABI_VERSION);
-	if (ioctl(skfd, SIOCETHTOOL, &ifr) >= 0) {
-		char *endptr;
 
-		abi_ver = strtoul(info.fw_version, &endptr, 0);
-		if (*endptr) {
-			fprintf(stderr, "Error: got invalid string as an ABI "
-				"version from the bonding module\n");
-			return -1;
+	if (ioctl(skfd, SIOCETHTOOL, &ifr) < 0) {
+		if (errno == EOPNOTSUPP) {
+			goto out;
 		}
+
+		saved_errno = errno;
+		v_print("Master '%s': Error: get bonding info failed %s\n",
+			master_ifname, strerror(saved_errno));
+		return 1;
 	}
 
-	if (verbose) {
-        	printf("ABI ver is %d\n", abi_ver);
+	abi_ver = strtoul(info.fw_version, &endptr, 0);
+	if (*endptr) {
+                v_print("Master '%s': Error: got invalid string as an ABI "
+			"version from the bonding module\n",
+			master_ifname);
+		return 1;
 	}
-	return abi_ver;
+
+out:
+	v_print("ABI ver is %d\n", abi_ver);
+
+	return 0;
 }
 
+static int change_active(char *master_ifname, char *slave_ifname)
+{
+	struct ifreq ifr;
+	int res = 0;
 
+	if (!(slave_flags.ifr_flags & IFF_SLAVE)) {
+		fprintf(stderr,
+			"Illegal operation: The specified slave interface "
+			"'%s' is not a slave\n",
+			slave_ifname);
+		return 1;
+	}
+
+	strncpy(ifr.ifr_name, master_ifname, IFNAMSIZ);
+	strncpy(ifr.ifr_slave, slave_ifname, IFNAMSIZ);
+	if ((ioctl(skfd, SIOCBONDCHANGEACTIVE, &ifr) < 0) &&
+	    (ioctl(skfd, BOND_CHANGE_ACTIVE_OLD, &ifr) < 0)) {
+		saved_errno = errno;
+		v_print("Master '%s': Error: SIOCBONDCHANGEACTIVE failed: "
+			"%s\n",
+			master_ifname, strerror(saved_errno));
+		res = 1;
+	}
+
+	return res;
+}
+
+static int enslave(char *master_ifname, char *slave_ifname)
+{
+	struct ifreq ifr;
+	int res = 0;
+
+	if (slave_flags.ifr_flags & IFF_SLAVE) {
+		fprintf(stderr,
+			"Illegal operation: The specified slave interface "
+			"'%s' is already a slave\n",
+			slave_ifname);
+		return 1;
+	}
+
+	res = set_if_down(slave_ifname, slave_flags.ifr_flags);
+	if (res) {
+		fprintf(stderr,
+			"Slave '%s': Error: bring interface down failed\n",
+			slave_ifname);
+		return res;
+	}
+
+	if (abi_ver < 2) {
+		/* Older bonding versions would panic if the slave has no IP
+		 * address, so get the IP setting from the master.
+		 */
+		res = set_if_addr(master_ifname, slave_ifname);
+		if (res) {
+			fprintf(stderr,
+				"Slave '%s': Error: set address failed\n",
+				slave_ifname);
+			return res;
+		}
+	} else {
+		res = clear_if_addr(slave_ifname);
+		if (res) {
+			fprintf(stderr,
+				"Slave '%s': Error: clear address failed\n",
+				slave_ifname);
+			return res;
+		}
+	}
+
+	if (master_mtu.ifr_mtu != slave_mtu.ifr_mtu) {
+		res = set_slave_mtu(slave_ifname, master_mtu.ifr_mtu);
+		if (res) {
+			fprintf(stderr,
+				"Slave '%s': Error: set MTU failed\n",
+				slave_ifname);
+			return res;
+		}
+	}
+
+	if (hwaddr_set) {
+		/* Master already has an hwaddr
+		 * so set it's hwaddr to the slave
+		 */
+		if (abi_ver < 1) {
+			/* The driver is using an old ABI, so
+			 * the application sets the slave's
+			 * hwaddr
+			 */
+			res = set_slave_hwaddr(slave_ifname,
+					       &(master_hwaddr.ifr_hwaddr));
+			if (res) {
+				fprintf(stderr,
+					"Slave '%s': Error: set hw address "
+					"failed\n",
+					slave_ifname);
+				goto undo_mtu;
+			}
+
+			/* For old ABI the application needs to bring the
+			 * slave back up
+			 */
+			res = set_if_up(slave_ifname, slave_flags.ifr_flags);
+			if (res) {
+				fprintf(stderr,
+					"Slave '%s': Error: bring interface "
+					"down failed\n",
+					slave_ifname);
+				goto undo_slave_mac;
+			}
+		}
+		/* The driver is using a new ABI,
+		 * so the driver takes care of setting
+		 * the slave's hwaddr and bringing
+		 * it up again
+		 */
+	} else {
+		/* No hwaddr for master yet, so
+		 * set the slave's hwaddr to it
+		 */
+		if (abi_ver < 1) {
+			/* For old ABI, the master needs to be
+			 * down before setting it's hwaddr
+			 */
+			res = set_if_down(master_ifname, master_flags.ifr_flags);
+			if (res) {
+				fprintf(stderr,
+					"Master '%s': Error: bring interface "
+					"down failed\n",
+					master_ifname);
+				goto undo_mtu;
+			}
+		}
+
+		res = set_master_hwaddr(master_ifname,
+					&(slave_hwaddr.ifr_hwaddr));
+		if (res) {
+			fprintf(stderr,
+				"Master '%s': Error: set hw address "
+				"failed\n",
+				master_ifname);
+			goto undo_mtu;
+		}
+
+		if (abi_ver < 1) {
+			/* For old ABI, bring the master
+			 * back up
+			 */
+			res = set_if_up(master_ifname, master_flags.ifr_flags);
+			if (res) {
+				fprintf(stderr,
+					"Master '%s': Error: bring interface "
+					"up failed\n",
+					master_ifname);
+				goto undo_master_mac;
+			}
+		}
+
+		hwaddr_set = 1;
+	}
+
+	/* Do the real thing */
+	strncpy(ifr.ifr_name, master_ifname, IFNAMSIZ);
+	strncpy(ifr.ifr_slave, slave_ifname, IFNAMSIZ);
+	if ((ioctl(skfd, SIOCBONDENSLAVE, &ifr) < 0) &&
+	    (ioctl(skfd, BOND_ENSLAVE_OLD, &ifr) < 0)) {
+		saved_errno = errno;
+		v_print("Master '%s': Error: SIOCBONDENSLAVE failed: %s\n",
+			master_ifname, strerror(saved_errno));
+		res = 1;
+	}
+
+	if (res) {
+		goto undo_master_mac;
+	}
+
+	return 0;
+
+/* rollback (best effort) */
+undo_master_mac:
+	set_master_hwaddr(master_ifname, &(master_hwaddr.ifr_hwaddr));
+	hwaddr_set = 0;
+	goto undo_mtu;
+undo_slave_mac:
+	set_slave_hwaddr(slave_ifname, &(slave_hwaddr.ifr_hwaddr));
+undo_mtu:
+	set_slave_mtu(slave_ifname, slave_mtu.ifr_mtu);
+	return res;
+}
+
+static int release(char *master_ifname, char *slave_ifname)
+{
+	struct ifreq ifr;
+	int res = 0;
+
+	if (!(slave_flags.ifr_flags & IFF_SLAVE)) {
+		fprintf(stderr,
+			"Illegal operation: The specified slave interface "
+			"'%s' is not a slave\n",
+			slave_ifname);
+		return 1;
+	}
+
+	strncpy(ifr.ifr_name, master_ifname, IFNAMSIZ);
+	strncpy(ifr.ifr_slave, slave_ifname, IFNAMSIZ);
+	if ((ioctl(skfd, SIOCBONDRELEASE, &ifr) < 0) &&
+	    (ioctl(skfd, BOND_RELEASE_OLD, &ifr) < 0)) {
+		saved_errno = errno;
+		v_print("Master '%s': Error: SIOCBONDRELEASE failed: %s\n",
+			master_ifname, strerror(saved_errno));
+		return 1;
+	} else if (abi_ver < 1) {
+		/* The driver is using an old ABI, so we'll set the interface
+		 * down to avoid any conflicts due to same MAC/IP
+		 */
+		res = set_if_down(slave_ifname, slave_flags.ifr_flags);
+		if (res) {
+			fprintf(stderr,
+				"Slave '%s': Error: bring interface "
+				"down failed\n",
+				slave_ifname);
+		}
+	}
+
+	/* set to default mtu */
+	set_slave_mtu(slave_ifname, 1500);
+
+	return res;
+}
+
+static int get_if_settings(char *ifname, struct dev_ifr ifra[])
+{
+	int i;
+	int res = 0;
+
+	for (i = 0; ifra[i].req_ifr; i++) {
+		strncpy(ifra[i].req_ifr->ifr_name, ifname, IFNAMSIZ);
+		res = ioctl(skfd, ifra[i].req_type, ifra[i].req_ifr);
+		if (res < 0) {
+			saved_errno = errno;
+			v_print("Interface '%s': Error: %s failed: %s\n",
+				ifname, ifra[i].req_name,
+				strerror(saved_errno));
+
+			return saved_errno;
+		}
+	}
+
+	return 0;
+}
+
+static int get_slave_flags(char *slave_ifname)
+{
+	int res = 0;
+
+	strncpy(slave_flags.ifr_name, slave_ifname, IFNAMSIZ);
+	res = ioctl(skfd, SIOCGIFFLAGS, &slave_flags);
+	if (res < 0) {
+		saved_errno = errno;
+		v_print("Slave '%s': Error: SIOCGIFFLAGS failed: %s\n",
+			slave_ifname, strerror(saved_errno));
+	} else {
+		v_print("Slave %s: flags %04X.\n",
+			slave_ifname, slave_flags.ifr_flags);
+	}
+
+	return res;
+}
+
+static int set_master_hwaddr(char *master_ifname, struct sockaddr *hwaddr)
+{
+	unsigned char *addr = (unsigned char *)hwaddr->sa_data;
+	struct ifreq ifr;
+	int res = 0;
+
+	strncpy(ifr.ifr_name, master_ifname, IFNAMSIZ);
+	memcpy(&(ifr.ifr_hwaddr), hwaddr, sizeof(struct sockaddr));
+	res = ioctl(skfd, SIOCSIFHWADDR, &ifr);
+	if (res < 0) {
+		saved_errno = errno;
+		v_print("Master '%s': Error: SIOCSIFHWADDR failed: %s\n",
+			master_ifname, strerror(saved_errno));
+		return res;
+	} else {
+		v_print("Master '%s': hardware address set to "
+			"%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x.\n",
+			master_ifname, addr[0], addr[1], addr[2],
+			addr[3], addr[4], addr[5]);
+	}
+
+	return res;
+}
+
+static int set_slave_hwaddr(char *slave_ifname, struct sockaddr *hwaddr)
+{
+	unsigned char *addr = (unsigned char *)hwaddr->sa_data;
+	struct ifreq ifr;
+	int res = 0;
+
+	strncpy(ifr.ifr_name, slave_ifname, IFNAMSIZ);
+	memcpy(&(ifr.ifr_hwaddr), hwaddr, sizeof(struct sockaddr));
+	res = ioctl(skfd, SIOCSIFHWADDR, &ifr);
+	if (res < 0) {
+		saved_errno = errno;
+
+		v_print("Slave '%s': Error: SIOCSIFHWADDR failed: %s\n",
+			slave_ifname, strerror(saved_errno));
+
+		if (saved_errno == EBUSY) {
+			v_print("  The device is busy: it must be idle "
+				"before running this command.\n");
+		} else if (saved_errno == EOPNOTSUPP) {
+			v_print("  The device does not support setting "
+				"the MAC address.\n"
+				"  Your kernel likely does not support slave "
+				"devices.\n");
+		} else if (saved_errno == EINVAL) {
+			v_print("  The device's address type does not match "
+				"the master's address type.\n");
+		}
+		return res;
+	} else {
+		v_print("Slave '%s': hardware address set to "
+			"%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x.\n",
+			slave_ifname, addr[0], addr[1], addr[2],
+			addr[3], addr[4], addr[5]);
+	}
+
+	return res;
+}
+
+static int set_slave_mtu(char *slave_ifname, int mtu)
+{
+	struct ifreq ifr;
+	int res = 0;
+
+	ifr.ifr_mtu = mtu;
+	strncpy(ifr.ifr_name, slave_ifname, IFNAMSIZ);
+
+	res = ioctl(skfd, SIOCSIFMTU, &ifr);
+	if (res < 0) {
+		saved_errno = errno;
+		v_print("Slave '%s': Error: SIOCSIFMTU failed: %s\n",
+			slave_ifname, strerror(saved_errno));
+	} else {
+		v_print("Slave '%s': MTU set to %d.\n", slave_ifname, mtu);
+	}
+
+	return res;
+}
+
+static int set_if_flags(char *ifname, short flags)
+{
+	struct ifreq ifr;
+	int res = 0;
+
+	ifr.ifr_flags = flags;
+	strncpy(ifr.ifr_name, ifname, IFNAMSIZ);
+
+	res = ioctl(skfd, SIOCSIFFLAGS, &ifr);
+	if (res < 0) {
+		saved_errno = errno;
+		v_print("Interface '%s': Error: SIOCSIFFLAGS failed: %s\n",
+			ifname, strerror(saved_errno));
+	} else {
+		v_print("Interface '%s': flags set to %04X.\n", ifname, flags);
+	}
+
+	return res;
+}
+
+static int set_if_up(char *ifname, short flags)
+{
+	return set_if_flags(ifname, flags | IFF_UP);
+}
+
+static int set_if_down(char *ifname, short flags)
+{
+	return set_if_flags(ifname, flags & ~IFF_UP);
+}
+
+static int clear_if_addr(char *ifname)
+{
+	struct ifreq ifr;
+	int res = 0;
+
+	strncpy(ifr.ifr_name, ifname, IFNAMSIZ);
+	ifr.ifr_addr.sa_family = AF_INET;
+	memset(ifr.ifr_addr.sa_data, 0, sizeof(ifr.ifr_addr.sa_data));
+
+	res = ioctl(skfd, SIOCSIFADDR, &ifr);
+	if (res < 0) {
+		saved_errno = errno;
+		v_print("Interface '%s': Error: SIOCSIFADDR failed: %s\n",
+			ifname, strerror(saved_errno));
+	} else {
+		v_print("Interface '%s': address cleared\n", ifname);
+	}
+
+	return res;
+}
+
+static int set_if_addr(char *master_ifname, char *slave_ifname)
+{
+	struct ifreq ifr;
+	int res;
+	unsigned char *ipaddr;
+	int i;
+	struct {
+		char *req_name;
+		char *desc;
+		int g_ioctl;
+		int s_ioctl;
+	} ifra[] = {
+		{"IFADDR", "addr", SIOCGIFADDR, SIOCSIFADDR},
+		{"DSTADDR", "destination addr", SIOCGIFDSTADDR, SIOCSIFDSTADDR},
+		{"BRDADDR", "broadcast addr", SIOCGIFBRDADDR, SIOCSIFBRDADDR},
+		{"NETMASK", "netmask", SIOCGIFNETMASK, SIOCSIFNETMASK},
+		{NULL, NULL, 0, 0},
+	};
+
+	for (i = 0; ifra[i].req_name; i++) {
+		strncpy(ifr.ifr_name, master_ifname, IFNAMSIZ);
+		res = ioctl(skfd, ifra[i].g_ioctl, &ifr);
+		if (res < 0) {
+			int saved_errno = errno;
+
+			v_print("Interface '%s': Error: SIOCG%s failed: %s\n",
+				master_ifname, ifra[i].req_name,
+				strerror(saved_errno));
+
+			ifr.ifr_addr.sa_family = AF_INET;
+			memset(ifr.ifr_addr.sa_data, 0,
+			       sizeof(ifr.ifr_addr.sa_data));
+		}
+
+		strncpy(ifr.ifr_name, slave_ifname, IFNAMSIZ);
+		res = ioctl(skfd, ifra[i].s_ioctl, &ifr);
+		if (res < 0) {
+			int saved_errno = errno;
+
+			v_print("Interface '%s': Error: SIOCS%s failed: %s\n",
+				slave_ifname, ifra[i].req_name,
+				strerror(saved_errno));
+
+			return res;
+		}
+
+		ipaddr = ifr.ifr_addr.sa_data;
+		v_print("Interface '%s': set IP %s to %d.%d.%d.%d\n",
+			slave_ifname, ifra[i].desc,
+			ipaddr[0], ipaddr[1], ipaddr[2], ipaddr[3]);
+	}
+
+	return 0;
+}
 
 /*
  * Local variables:
@@ -768,3 +1107,4 @@
  *  compile-command: "gcc -Wall -Wstrict-prototypes -O -I/usr/src/linux/include ifenslave.c -o ifenslave"
  * End:
  */
+
--- diff/Documentation/networking/ltpc.txt	2002-10-16 04:27:48.000000000 +0100
+++ source/Documentation/networking/ltpc.txt	2004-02-09 10:39:51.000000000 +0000
@@ -25,7 +25,7 @@
 
 If you load the driver as a module, you can pass the parameters "io=",
 "irq=", and "dma=" on the command line with insmod or modprobe, or add
-them as options in /etc/modules.conf:
+them as options in /etc/modprobe.conf:
 
  alias lt0 ltpc # autoload the module when the interface is configured
  options ltpc io=0x240 irq=9 dma=1
--- diff/Documentation/networking/sk98lin.txt	2004-02-09 10:36:07.000000000 +0000
+++ source/Documentation/networking/sk98lin.txt	2004-02-09 10:39:51.000000000 +0000
@@ -174,7 +174,7 @@
 to the driver module.
 
 If you use the kernel module loader, you can set driver parameters
-in the file /etc/modules.conf (or old name: /etc/conf.modules).
+in the file /etc/modprobe.conf (or /etc/modules.conf in 2.4 or earlier).
 To set the driver parameters in this file, proceed as follows:
 
 1. Insert a line of the form :
--- diff/Documentation/networking/tuntap.txt	2003-05-21 11:49:49.000000000 +0100
+++ source/Documentation/networking/tuntap.txt	2004-02-09 10:39:51.000000000 +0000
@@ -45,13 +45,10 @@
      bogus network interfaces to trick firewalls or administrators.
 
   Driver module autoloading
-     Make sure that "Kernel module loader" - module auto-loading support is enabled 
-     in your kernel. 
 
-     Add the following line to the /etc/modules.conf:
-	alias char-major-10-200 tun
-     and run
-        depmod -a 
+     Make sure that "Kernel module loader" - module auto-loading
+     support is enabled in your kernel.  The kernel should load it on
+     first access.
   
   Manual loading 
      insert the module by hand:
--- diff/Documentation/networking/vortex.txt	2003-08-20 14:16:23.000000000 +0100
+++ source/Documentation/networking/vortex.txt	2004-02-09 10:39:51.000000000 +0000
@@ -59,8 +59,8 @@
 =================
 
 There are several parameters which may be provided to the driver when
-its module is loaded.  These are usually placed in /etc/modules.conf
-(used to be conf.modules).  Example:
+its module is loaded.  These are usually placed in /etc/modprobe.conf
+(/etc/modules.conf in 2.4).  Example:
 
 options 3c59x debug=3 rx_copybreak=300
 
@@ -413,9 +413,9 @@
 
       1) Increase the debug level.  Usually this is done via:
 
-         a) modprobe driver.o debug=7
-         b) In /etc/conf.modules (or modules.conf):
-            options driver_name debug=7
+         a) modprobe driver debug=7
+         b) In /etc/modprobe.conf (or /etc/modules.conf for 2.4):
+            options driver debug=7
 
       2) Recreate the problem with the higher debug level,
          send all logs to the maintainer.
--- diff/Documentation/parport.txt	2002-10-16 04:28:25.000000000 +0100
+++ source/Documentation/parport.txt	2004-02-09 10:39:51.000000000 +0000
@@ -39,7 +39,7 @@
 KMod
 ----
 
-If you use kmod, you will find it useful to edit /etc/modules.conf.
+If you use kmod, you will find it useful to edit /etc/modprobe.conf.
 Here is an example of the lines that need to be added:
 
 	alias parport_lowlevel parport_pc
--- diff/Documentation/rocket.txt	2003-06-30 10:07:18.000000000 +0100
+++ source/Documentation/rocket.txt	2004-02-09 10:39:51.000000000 +0000
@@ -43,7 +43,7 @@
 
 If installed as a module, the module must be loaded.  This can be done
 manually by entering "modprobe rocket".  To have the module loaded automatically
-upon system boot, edit the /etc/modules.conf file and add the line
+upon system boot, edit the /etc/modprobe.conf file and add the line
 "alias char-major-46 rocket".
 
 In order to use the ports, their device names (nodes) must be created with mknod.
--- diff/Documentation/s390/3270.txt	2003-08-20 14:16:23.000000000 +0100
+++ source/Documentation/s390/3270.txt	2004-02-09 10:39:51.000000000 +0000
@@ -48,7 +48,7 @@
 script and the resulting /tmp/mkdev3270.
 
 If you have chosen to make tub3270 a module, you add a line to
-/etc/modules.conf.  If you are working on a VM virtual machine, you
+/etc/modprobe.conf.  If you are working on a VM virtual machine, you
 can use DEF GRAF to define virtual 3270 devices.
 
 You may generate both 3270 and 3215 console support, or one or the
@@ -60,7 +60,7 @@
 
 In brief, these are the steps:
 	1. Install the tub3270 patch
-	2. (If a module) add a line to /etc/modules.conf
+	2. (If a module) add a line to /etc/modprobe.conf
 	3. (If VM) define devices with DEF GRAF
 	4. Reboot
 	5. Configure
@@ -84,13 +84,13 @@
 		make modules_install
 
 	2. (Perform this step only if you have configured tub3270 as a
-	module.)  Add a line to /etc/modules.conf to automatically
+	module.)  Add a line to /etc/modprobe.conf to automatically
 	load the driver when it's needed.  With this line added,
 	you will see login prompts appear on your 3270s as soon as
 	boot is complete (or with emulated 3270s, as soon as you dial
 	into your vm guest using the command "DIAL <vmguestname>").
 	Since the line-mode major number is 227, the line to add to
-	/etc/modules.conf should be:
+	/etc/modprobe.conf should be:
 		alias char-major-227 tub3270
 
 	3. Define graphic devices to your vm guest machine, if you
--- diff/Documentation/scsi/BusLogic.txt	2004-01-19 10:22:54.000000000 +0000
+++ source/Documentation/scsi/BusLogic.txt	2004-02-09 10:39:52.000000000 +0000
@@ -40,10 +40,9 @@
 to achieve the full performance that BusLogic SCSI Host Adapters and modern
 SCSI peripherals are capable of, and to provide a highly robust driver that can
 be depended upon for high performance mission critical applications.  All of
-the major performance and error recovery features can be configured from the
-Linux kernel command line or at module initialization time, allowing individual
-installations to tune driver performance and error recovery to their particular
-needs.
+the major performance features can be configured from the Linux kernel command
+line or at module initialization time, allowing individual installations to
+tune driver performance and error recovery to their particular needs.
 
 The latest information on Linux support for BusLogic SCSI Host Adapters, as
 well as the most recent release of this driver and the latest firmware for the
@@ -95,10 +94,10 @@
   adapter hardware configuration, including the synchronous transfer parameters
   requested and negotiated with each target device.  AutoSCSI settings for
   Synchronous Negotiation, Wide Negotiation, and Disconnect/Reconnect are
-  reported for each target device, as well as the status of Tagged Queuing and
-  Error Recovery.  If the same setting is in effect for all target devices,
-  then a single word or phrase is used; otherwise, a letter is provided for
-  each target device to indicate the individual status.  The following examples
+  reported for each target device, as well as the status of Tagged Queuing.
+  If the same setting is in effect for all target devices, then a single word
+  or phrase is used; otherwise, a letter is provided for each target device to
+  indicate the individual status.  The following examples
   should clarify this reporting format:
 
     Synchronous Negotiation: Ultra
@@ -131,9 +130,6 @@
     The status of Wide Negotiation, Disconnect/Reconnect, and Tagged Queuing
     are reported as "Enabled", Disabled", or a sequence of "Y" and "N" letters.
 
-    The Error Recovery option is reported as "Default", "Hard Reset",
-    "Bus Device Reset", "None" or a sequence of "D", "H", "B", and "N" letters.
-
 o Performance Features
 
   BusLogic SCSI Host Adapters directly implement SCSI-2 Tagged Queuing, and so
@@ -477,48 +473,6 @@
   does not cover all the Target Devices, unspecified characters are assumed
   to be "X".
 
-The BusLogic Driver Error Recovery Option allows for explicitly specifying
-the Error Recovery action to be performed when BusLogic_ResetCommand is
-called due to a SCSI Command failing to complete successfully.  The following
-options are available:
-
-ErrorRecovery:Default
-
-  The "ErrorRecovery:Default" or "ER:Default" option selects between the Hard
-  Reset and Bus Device Reset options based on the recommendation of the SCSI
-  Subsystem.
-
-ErrorRecovery:HardReset
-
-  The "ErrorRecovery:HardReset" or "ER:HardReset" option will initiate a Host
-  Adapter Hard Reset which also causes a SCSI Bus Reset.
-
-ErrorRecovery:BusDeviceReset
-
-  The "ErrorRecovery:BusDeviceReset" or "ER:BusDeviceReset" option will send
-  a Bus Device Reset message to the individual Target Device causing the
-  error.  If Error Recovery is again initiated for this Target Device and no
-  SCSI Command to this Target Device has completed successfully since the Bus
-  Device Reset message was sent, then a Hard Reset will be attempted.
-
-ErrorRecovery:None
-
-  The "ErrorRecovery:None" or "ER:None" option suppresses Error Recovery.
-  This option should only be selected if a SCSI Bus Reset or Bus Device Reset
-  will cause the Target Device or a critical operation to suffer a complete
-  and unrecoverable failure.
-
-ErrorRecovery:<Target-Spec>
-
-  The "ErrorRecovery:<Target-Spec>" or "ER:<Target-Spec>" option controls
-  Error Recovery individually for each Target Device.  <Target-Spec> is a
-  sequence of "D", "H", "B", and "N" characters.  "D" selects Default, "H"
-  selects Hard Reset, "B" selects Bus Device Reset, and "N" selects None.
-  The first character refers to Target Device 0, the second to Target Device
-  1, and so on; if the sequence of "D", "H", "B", and "N" characters does not
-  cover all the possible Target Devices, unspecified characters are assumed
-  to be "D".
-
 The BusLogic Driver Miscellaneous Options comprise the following:
 
 BusSettleTime:<seconds>
--- diff/Documentation/scsi/aic79xx.txt	2004-01-19 10:22:54.000000000 +0000
+++ source/Documentation/scsi/aic79xx.txt	2004-02-09 10:39:51.000000000 +0000
@@ -210,7 +210,7 @@
                  INCORRECTLY CAN RENDER YOUR SYSTEM INOPERABLE.
                  USE THEM WITH CAUTION. 
 
-   Edit the file "modules.conf" in the directory /etc and add/edit a
+   Edit the file "modprobe.conf" in the directory /etc and add/edit a
    line containing 'options aic79xx aic79xx=[command[,command...]]' where
    'command' is one or more of the following:
    -----------------------------------------------------------------
--- diff/Documentation/scsi/aic7xxx.txt	2004-01-19 10:22:54.000000000 +0000
+++ source/Documentation/scsi/aic7xxx.txt	2004-02-09 10:39:51.000000000 +0000
@@ -186,7 +186,7 @@
                  INCORRECTLY CAN RENDER YOUR SYSTEM INOPERABLE.
                  USE THEM WITH CAUTION. 
 
-   Edit the file "modules.conf" in the directory /etc and add/edit a
+   Edit the file "modprobe.conf" in the directory /etc and add/edit a
    line containing 'options aic7xxx aic7xxx=[command[,command...]]' where
    'command' is one or more of the following:
    -----------------------------------------------------------------
--- diff/Documentation/scsi/osst.txt	2002-11-18 10:11:54.000000000 +0000
+++ source/Documentation/scsi/osst.txt	2004-02-09 10:39:52.000000000 +0000
@@ -67,7 +67,7 @@
 If you want to have the module autoloaded on access to /dev/osst, you may
 add something like
 alias char-major-206 osst
-to your /etc/modules.conf (old name: conf.modules).
+to your /etc/modprobe.conf (before 2.6: modules.conf).
 
 You may find it convenient to create a symbolic link 
 ln -s nosst0 /dev/tape
--- diff/Documentation/scsi/scsi_mid_low_api.txt	2003-09-30 15:46:10.000000000 +0100
+++ source/Documentation/scsi/scsi_mid_low_api.txt	2004-02-09 10:39:52.000000000 +0000
@@ -1091,14 +1091,44 @@
  *      @scp: pointer to scsi command object
  *      @done: function pointer to be invoked on completion
  *
- *      Returns 0 on success and 1 if the LLD or the HBA is busy (i.e. run
- *      out of resources to queue further commands). Other types of errors
- *      that are detected immediately are flagged by setting scp->result 
- *      to an appropriate value, invoking the 'done' callback, and then
- *      returning 0 from this function. If the command is not performed
- *      immediately (and the LLD is starting (or will start) the given
- *      command) then this function should place 0 in scp->result and
- *      return 0.
+ *      Returns 0 on success.
+ *
+ *	If there's a failure, return either:
+ *
+ *	SCSI_MLQUEUE_DEVICE_BUSY if the device queue is full, or
+ *	SCSI_MLQUEUE_HOST_BUSY if the entire host queue is full
+ *
+ *	On both of these returns, the mid-layer will requeue the I/O
+ *
+ *	- if the return is SCSI_MLQUEUE_DEVICE_BUSY, only that particular
+ *	device will be paused, and it will be unpaused when a command to
+ *	the device returns (or after a brief delay if there are no more
+ *	outstanding commands to it).  Commands to other devices continue
+ *	to be processed normally.
+ *
+ *	- if the return is SCSI_MLQUEUE_HOST_BUSY, all I/O to the host
+ *	is paused and will be unpaused when any command returns from
+ *	the host (or after a brief delay if there are no outstanding
+ *	commands to the host).
+ *
+ *	For compatibility with earlier versions of queuecommand, any
+ *	other return value is treated the same as
+ *	SCSI_MLQUEUE_HOST_BUSY.
+ *
+ *	Other types of errors that are detected immediately may be
+ *	flagged by setting scp->result to an appropriate value,
+ *	invoking the 'done' callback, and then returning 0 from this
+ *	function. If the command is not performed immediately (and the
+ *	LLD is starting (or will start) the given command) then this
+ *	function should place 0 in scp->result and return 0.
+ *
+ *	Command ownership.  If the driver returns zero, it owns the
+ *	command and must take responsibility for ensuring the 'done'
+ *	callback is executed.  Note: the driver may call done before
+ *	returning zero, but after it has called done, it may not
+ *	return any value other than zero.  If the driver makes a
+ *	non-zero return, it must not execute the command's done
+ *	callback at any time.
  *
  *      Locks: struct Scsi_Host::host_lock held on entry (with "irqsave")
  *             and is expected to be held on return.
--- diff/Documentation/sonypi.txt	2003-09-17 12:28:01.000000000 +0100
+++ source/Documentation/sonypi.txt	2004-02-09 10:39:52.000000000 +0000
@@ -43,7 +43,7 @@
 ---------------
 
 Several options can be passed to the sonypi driver, either by adding them
-to /etc/modules.conf file, when the driver is compiled as a module or by
+to /etc/modprobe.conf file, when the driver is compiled as a module or by
 adding the following to the kernel command line (in your bootloader):
 
 	sonypi=minor[,verbose[,fnkeyinit[,camera[,compat[,mask[,useinput]]]]]]
@@ -109,7 +109,7 @@
 -----------
 
 In order to automatically load the sonypi module on use, you can put those
-lines in your /etc/modules.conf file:
+lines in your /etc/modprobe.conf file:
 
 	alias char-major-10-250 sonypi
 	options sonypi minor=250
--- diff/Documentation/sound/alsa/ALSA-Configuration.txt	2003-09-30 15:46:10.000000000 +0100
+++ source/Documentation/sound/alsa/ALSA-Configuration.txt	2004-02-09 10:39:52.000000000 +0000
@@ -55,9 +55,10 @@
     major	- major # for sound driver
 		- default is 116
     cards_limit
-		- specifies card limit # (1-8)
-		- good for kmod support if you do not want to search
-		  for soundcards which are not installed in your system
+		- specifies card limit # for auto-loading (1-8)
+		- default is 1
+		- for auto-loading more than 1 card, specify this option
+		  together with snd-card-X aliases.
     device_mode
 		- specifies permission mask for dynamic sound device filesystem
 		  (available only when DEVFS is enabled)
@@ -173,8 +174,7 @@
     Module for soundcards based on Avance Logic ALS4000 PCI chip.
 
     joystick_port - port # for legacy joystick support.
-                        default: 0x200 for the 1st card.
-                        0 = disabled
+                    0 = disabled (default), 1 = auto-detect
     
     Module supports up to 8 cards, autoprobe and PnP.
 
@@ -199,6 +199,8 @@
 
     Module for soundcards based on Aztech AZF3328 PCI chip.
 
+    joystick	- Enable joystick (default off)
+
     Module supports up to 8 cards.
 
   Module snd-cmi8330
@@ -221,10 +223,11 @@
 
     Module for C-Media CMI8338 and 8738 PCI soundcards.
 
-    mpu_port	- 0x300 (default),0x310,0x320,0x330, -1 (diable)
-    fm_port     - 0x388 (default), -1 (disable)
+    mpu_port	- 0x300,0x310,0x320,0x330, 0 = disable (default)
+    fm_port     - 0x388 (default), 0 = disable (default)
     soft_ac3    - Sofware-conversion of raw SPDIF packets (model 033 only)
                   (default = 1)
+    joystick_port - Joystick port address (0 = disable, 1 = auto-detect)
 
     Module supports autoprobe and multiple chips (max 8).
     
@@ -377,6 +380,8 @@
 			* SoundBlaster PCI 64
 			* SoundBlaster PCI 128
 
+    joystick		- Enable joystick (default off)
+
     Module supports up to 8 cards and autoprobe.
     
   Module snd-ens1371
@@ -387,6 +392,9 @@
 			* SoundBlaster PCI 128
 			* SoundBlaster Vibra PCI
 
+    joystick_port	- port # for joystick (0x200,0x208,0x210,0x218),
+			  0 = disable (default), 1 = auto-detect
+
     Module supports up to 8 cards and autoprobe.
     
   Module snd-es968
@@ -451,6 +459,7 @@
     use_pm		- support the power-management (0 = off, 1 = on,
 			  2 = auto (default))
     enable_mpu		- enable MPU401 (0 = off, 1 = on, 2 = auto (default))
+    joystick		- enable joystick (default off)       
 
     Module supports up to 8 cards and autoprobe.
 
@@ -527,7 +536,7 @@
     Module supports up to 8 cards.
 
     Note: you need to load the firmware via hdsploader utility included
-          in alsa-tools package.
+          in alsa-tools and alsa-firmware packages.
 
     Note: snd-page-alloc module does the job which snd-hammerfall-mem
           module did formerly.  It will allocate the buffers in advance
@@ -581,7 +590,7 @@
 			* ALi m5455
 
     ac97_clock	  - AC'97 codec clock base (0 = auto-detect)
-    joystick_port - Joystick port # (0 = disabled, 0x200)
+    joystick      - Enable joystick (default off)
     mpu_port      - MPU401 port # (0 = disabled, 0x330,0x300)
 
     Module supports autoprobe and multiple bus-master chips (max 8).
@@ -991,10 +1000,11 @@
 
     mpu_port	- 0x300,0x310,0x320,0x330, otherwise obtain BIOS setup
 		  [VIA686A/686B only]
+    joystick	- Enable joystick (default off) [VIA686A/686B only]
     ac97_clock	- AC'97 codec clock base (default 48000Hz)
     dxs_support	- support DXS channels,
 		  0 = auto (defalut), 1 = enable, 2 = disable,
-		  3 = 48k only
+		  3 = 48k only, 4 = no VRA
 		  [VIA8233/C,8235 only]
 
     Module supports autoprobe and multiple bus-master chips (max 8).
@@ -1008,13 +1018,20 @@
     Note: VIA8233/5 (not VIA8233A) can support DXS (direct sound)
 	  channels as the first PCM.  On these channels, up to 4
 	  streams can be played at the same time.
-	  As default (dxs_support = 0), 48k fixed rate is chosen since
-	  the output is often noisy except for 48k on some mother
-	  boards due to the bug of BIOS.
+	  As default (dxs_support = 0), 48k fixed rate is chosen
+	  except for the known devices since the output is often
+	  noisy except for 48k on some mother boards due to the
+	  bug of BIOS.
 	  Please try once dxs_support=1 and if it works on other
-	  sample rates, please let us know the PCI subsystem
-	  vendor/device id's (output of "lspci -nv").
-	  If it doesn't work, use dxs_support=3 or dxs_support=2.
+	  sample rates (e.g. 44.1kHz of mp3 playback), please let us
+	  know the PCI subsystem vendor/device id's (output of
+	  "lspci -nv").
+	  If it doesn't work, try dxs_support=4.  If it still doesn't
+	  work and the default setting is ok, dxs_support=3 is the
+	  right choice.  If the default setting doesn't work at all,
+	  try dxs_support=2 to disable the DXS channels.
+	  In any cases, please let us know the result and the
+	  subsystem vendor/device ids.
 
     Note: for the MPU401 on VIA823x, use snd-mpu401 driver
 	  additonally.  The mpu_port option is for VIA686 chips only.
@@ -1041,11 +1058,13 @@
     Module supports up to 8 cards.
 
     For loading the firmware, use vxloader utility in alsa-tools
-    package.  You can load the firmware automatically by adding
-    the following to /etc/modules.conf
+    and alsa-firmware packages.  You can load the firmware automatically
+    by adding the following to /etc/modprobe.conf
 
-	post-install snd-vx222 "/usr/bin/vxload"
+	install snd-vx222 /sbin/modprobe --first-time -i snd-vx222 && /usr/bin/vxloader
 
+    (for 2.2/2.4 kernels, add "post-install /usr/bin/vxloader" to
+     /etc/modules.conf, instead.)
     IBL size defines the interrupts period for PCM.  The smaller size
     gives smaller latency but leads to more CPU consumption, too.
     The size is usually aligned to 126.  As default (=0), the smallest
@@ -1060,6 +1079,7 @@
     irq_mask - IRQ bitmask, specifies the available IRQs as bits
                (default = 0xffff, all available)
     irq_list - List of available interrupts (default = -1, not specified)
+               4 numbers must be given (if specified).
     ibl      - Capture IBL size. (default = 0, minimum size)
 
     Module supports up to 8 cards.  The module is compiled only when
@@ -1069,13 +1089,15 @@
     up /etc/pcmcia/vxpocket.conf.  See the sound/pcmcia/vx/vxpocket.c.
 
     For loading the firmware, use vxloader utility in alsa-tools
-    package.
+    and alsa-firmware packages.
 
     The irq_mask and irq_list are provided to avoid allocation of
     specific IRQs.  Usually you don't need to specify them.
 
     About capture IBL, see the description of snd-vx222 module.
 
+    Note: the driver is build only when CONFIG_ISA is set.
+    
   Module snd-vxp440
   -----------------
 
@@ -1083,6 +1105,7 @@
 
     irq_mask - IRQ bitmask, specifies the available IRQs as bits
     irq_list - List of available interrupts (default = -1, not specified)
+               4 numbers must be given (if specified).
     ibl      - Capture IBL size. (default = 0, minimum size)
 
     Module supports up to 8 cards.  The module is compiled only when
@@ -1092,24 +1115,30 @@
     up /etc/pcmcia/vxp440.conf.  See the sound/pcmcia/vx/vxp440.c.
 
     For loading the firmware, use vxloader utility in alsa-tools
-    package.
+    and alsa-firmware packages.
 
     The irq_mask and irq_list are provided to avoid allocation of
     specific IRQs.  Usually you don't need to specify them.
 
     About capture IBL, see the description of snd-vx222 module.
 
+    Note: the driver is build only when CONFIG_ISA is set.
+    
   Module snd-ymfpci
   -----------------
 
     Module for Yamaha PCI chips (YMF72x, YMF74x & YMF75x).
 
-    mpu_port	- 0x300,0x330,0x332,0x334, -1 (disable) by default
-    fm_port	- 0x388,0x398,0x3a0,0x3a8, -1 (disable) by default
-    rear_switch - enable shared rear/line-in switch (bool)
+    mpu_port      - 0x300,0x330,0x332,0x334, 0 (disable) by default,
+                    1 (auto-detect for YMF744/754 only)
+    fm_port       - 0x388,0x398,0x3a0,0x3a8, 0 (disable) by default
+                    1 (auto-detect for YMF744/754 only)
+    joystick_port - 0x201,0x202,0x204,0x205, 0 (disable) by default,
+                    1 (auto-detect)
+    rear_switch   - enable shared rear/line-in switch (bool)
 
     Module supports autoprobe and multiple chips (max 8).
-    
+
     The power-management is supported.
 
 
@@ -1126,160 +1155,49 @@
 will be not built in.
 
 
-modprobe/kmod support
-=====================
-
-The modprobe program must know which modules are used for the
-device major numbers.
-Native ALSA devices have got default number 116. Thus a line like
-'alias char-major-116 snd' must be added to /etc/modules.conf. If you have 
-compiled the ALSA driver with the OSS/Free emulation code, then you
-will need to add lines as explained below:
-
-The ALSA driver uses soundcore multiplexer for 2.2+ kernels and OSS compatible
-devices. You should add line like 'alias char-major-14 soundcore'.
-
-Example with OSS/Free emulation turned on:
-
------ /etc/modules.conf
+Module Autoloading Support
+==========================
 
-# ALSA portion
-alias char-major-116 snd
-# OSS/Free portion
-alias char-major-14 soundcore
-
------ /etc/modules.conf
+The ALSA drivers can be loaded automatically on demand by defining
+module aliases.  The string 'snd-card-%1' is requested for ALSA native
+devices where %i is soundcard number from zero to seven.
+
+To auto-load an ALSA driver for OSS services, define the string
+'sound-slot-%i' where %i means the slot number for OSS, which
+corresponds to the card index of ALSA.  Usually, define this
+as the the same card module.
+
+An example configuration for a single emu10k1 card is like below:
+----- /etc/modprobe.conf
+alias snd-card-0 snd-emu10k1
+alias sound-slot-0 snd-emu10k1
+----- /etc/modprobe.conf
+
+The available number of auto-loaded soundcards depends on the module
+option "cards_limit" of snd module.  As default it's set to 1.
+To enable the auto-loading of multiple cards, specify the number of
+soundcards in that option.
+
+When multiple cards are available, it'd better to specify the index
+number for each card via module option, too, so that the order of
+cards is kept consistent.
 
-After the main multiplexer is loaded, its code requests top-level soundcard
-module. String 'snd-card-%i' is requested for native devices where %i is
-soundcard number from zero to seven. String 'sound-slot-%i' is requested
-for native devices where %i is slot number (for ALSA owner this means soundcard
-number).
-
------ /etc/modules.conf
+An example configuration for two soundcards is like below:
 
+----- /etc/modprobe.conf
 # ALSA portion
+options snd cards_limit=2
 alias snd-card-0 snd-interwave
 alias snd-card-1 snd-ens1371
+options snd-interwave index=0
+options snd-ens1371 index=1
 # OSS/Free portion
-alias sound-slot-0 snd-card-0
-alias sound-slot-1 snd-card-1
-
------ /etc/modules.conf
-
-We are finished at this point with the configuration for ALSA native devices,
-but you may also need autoloading for ALSA's add-on OSS/Free emulation
-modules. At this time only one module does not depend on any others, thus
-must be loaded separately - snd-pcm-oss. String 'sound-service-%i-%i'
-is requested for OSS/Free service where first %i means slot number
-(e.g. card number) and second %i means service number.
-
------ /etc/modules.conf
-
-# OSS/Free portion - card #1
-alias sound-service-0-0 snd-mixer-oss
-alias sound-service-0-1 snd-seq-oss
-alias sound-service-0-3 snd-pcm-oss
-alias sound-service-0-8 snd-seq-oss
-alias sound-service-0-12 snd-pcm-oss
-# OSS/Free portion - card #2
-alias sound-service-1-0 snd-mixer-oss
-alias sound-service-1-3 snd-pcm-oss
-alias sound-service-1-12 snd-pcm-oss
-
------ /etc/modules.conf
-
-A complete example for Gravis UltraSound PnP soundcard:
-
------ /etc/modules.conf
-
-# ISA PnP support (don't use IRQs 9,10,11,12,13)
-options isapnp isapnp_reserve_irq=9,10,11,12,13
-
-# ALSA native device support
-alias char-major-116 snd
-options snd major=116 cards_limit=1
-alias snd-card-0 snd-interwave
-options snd-interwave index=0 id="GusPnP"
-
-# OSS/Free setup
-alias char-major-14 soundcore
-alias sound-slot-0 snd-card-0
-alias sound-service-0-0 snd-mixer-oss
-alias sound-service-0-1 snd-seq-oss
-alias sound-service-0-3 snd-pcm-oss
-alias sound-service-0-8 snd-seq-oss
-alias sound-service-0-12 snd-pcm-oss
-
------
-
-A complete example if you want to use more soundcards in one machine
-(the configuration below is for Sound Blaster 16 and Gravis UltraSound Classic):
-
------ /etc/modules.conf
-
-# ISA PnP support (don't use IRQs 9,10,11,12,13)
-# it's only an example to reserve some IRQs for another hardware
-options isapnp isapnp_reserve_irq=9,10,11,12,13
-
-# ALSA native device support
-alias char-major-116 snd
-options snd major=116 cards_limit=2
-alias snd-card-0 snd-gusclassic
-alias snd-card-1 snd-sb16
-options snd-gusclassic index=0 id="Gus" \
-        port=0x220 irq=5 dma1=6 dma2=7
-options snd-sb16 index=1 id="SB16"
-
-# OSS/Free setup
-alias char-major-14 soundcore
-alias sound-slot-0 snd-card-0
-alias sound-service-0-0 snd-mixer-oss
-alias sound-service-0-1 snd-seq-oss
-alias sound-service-0-3 snd-pcm-oss
-alias sound-service-0-8 snd-seq-oss
-alias sound-service-0-12 snd-pcm-oss
-alias sound-slot-1 snd-card-1
-alias sound-service-1-0 snd-mixer-oss
-alias sound-service-1-3 snd-pcm-oss
-alias sound-service-1-12 snd-pcm-oss
-
------
-
-A complete example, two Gravis UltraSound Classic soundcards are installed
-in the system:
-
------ /etc/modules.conf
-
-# ALSA native device support
-alias char-major-116 snd
-options snd major=116 cards_limit=2
-alias snd-card-0 snd-gusclassic
-alias snd-card-1 snd-gusclassic
-options snd-gusclassic index=0,1 id="Gus1","Gus2" \
-        port=0x220,0x240 irq=5,7 dma1=1,5 dma2=3,6
-
-# OSS/Free setup
-alias char-major-14 soundcore
-alias sound-slot-0 snd-card-0
-alias sound-service-0-0 snd-mixer-oss
-alias sound-service-0-1 snd-seq-oss
-alias sound-service-0-3 snd-pcm-oss
-alias sound-service-0-8 snd-seq-oss
-alias sound-service-0-12 snd-pcm-oss
-alias sound-slot-1 snd-card-1
-alias sound-service-1-0 snd-mixer-oss
-alias sound-service-1-3 snd-pcm-oss
-alias sound-service-1-12 snd-pcm-oss
-
------
-
-If you want to autoclean your modules, you should put below line to your
-/etc/crontab:
-
-*/10 * * * *   root  /sbin/modprobe -rs snd-card-0 snd-card-1; /sbin/rmmod -as
+alias sound-slot-0 snd-interwave
+alias sound-slot-1 snd-ens1371
+----- /etc/moprobe.conf
 
-You may also want to extend the soundcard list to follow your requirements.
+In this example, the interwave card is always loaded as the first card
+(index 0) and ens1371 as the second (index 1).
 
 
 ALSA PCM devices to OSS devices mapping
--- diff/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl	2004-01-19 10:22:54.000000000 +0000
+++ source/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl	2004-02-09 10:39:52.000000000 +0000
@@ -341,10 +341,6 @@
       drivers will be on pci directory, because its API is identical
       with the standard PCI cards. 
       </para>
-
-      <para>
-        At this moment, only VX-pocket driver exists.
-      </para>
     </section>
 
     <section id="file-tree-oss-directory">
@@ -500,14 +496,14 @@
           }
 
           // (4)
-          // implemented later
-
-          // (5)
           strcpy(card->driver, "My Chip");
           strcpy(card->shortname, "My Own Chip 123");
           sprintf(card->longname, "%s at 0x%lx irq %i",
                   card->shortname, chip->ioport, chip->irq);
 
+          // (5)
+          // implemented later
+
           // (6)
           if ((err = snd_card_register(card)) < 0) {
                   snd_card_free(card);
@@ -626,21 +622,8 @@
         </para>
       </section>
 
-      <section id="basic-flow-constructor-create-other">
-        <title>4) Create other components, such as mixer, MIDI, etc.</title>
-        <para>
-          Here you define the basic components such as
-          <link linkend="pcm-interface"><citetitle>PCM</citetitle></link>,
-          mixer (e.g. <link linkend="api-ac97"><citetitle>AC97</citetitle></link>),
-          MIDI (e.g. <link linkend="midi-interface"><citetitle>MPU-401</citetitle></link>),
-          and other interfaces.
-          Also, if you want a <link linkend="proc-interface"><citetitle>proc
-        file</citetitle></link>, define it here, too.
-        </para>
-      </section>
-        
       <section id="basic-flow-constructor-main-component">
-        <title>5) Set the driver ID and name strings.</title>
+        <title>4) Set the driver ID and name strings.</title>
         <para>
           <informalexample>
             <programlisting>
@@ -667,6 +650,19 @@
         </para>
       </section>
 
+      <section id="basic-flow-constructor-create-other">
+        <title>5) Create other components, such as mixer, MIDI, etc.</title>
+        <para>
+          Here you define the basic components such as
+          <link linkend="pcm-interface"><citetitle>PCM</citetitle></link>,
+          mixer (e.g. <link linkend="api-ac97"><citetitle>AC97</citetitle></link>),
+          MIDI (e.g. <link linkend="midi-interface"><citetitle>MPU-401</citetitle></link>),
+          and other interfaces.
+          Also, if you want a <link linkend="proc-interface"><citetitle>proc
+        file</citetitle></link>, define it here, too.
+        </para>
+      </section>
+
       <section id="basic-flow-constructor-register-card">
         <title>6) Register the card instance.</title>
         <para>
@@ -1295,11 +1291,11 @@
           // check PCI availability (28bit DMA)
           if ((err = pci_enable_device(pci)) < 0)
                   return err;
-          if (!pci_dma_supported(pci, 0x0fffffff)) {
+          if (pci_set_dma_mask(pci, 0x0fffffff) < 0 ||
+              pci_set_consistent_dma_mask(pci, 0x0fffffff) < 0) {
                   printk(KERN_ERR "error to set 28bit mask DMA\n");
                   return -ENXIO;
           }
-          pci_set_dma_mask(pci, 0x0fffffff);
 
           chip = snd_magic_kcalloc(mychip_t, 0, GFP_KERNEL);
           if (chip == NULL)
@@ -1413,11 +1409,12 @@
 <![CDATA[
   if ((err = pci_enable_device(pci)) < 0)
           return err;
-  if (!pci_dma_supported(pci, 0x0fffffff)) {
+  if (pci_set_dma_mask(pci, 0x0fffffff) < 0 ||
+      pci_set_consistent_dma_mask(pci, 0x0fffffff) < 0) {
           printk(KERN_ERR "error to set 28bit mask DMA\n");
           return -ENXIO;
   }
-  pci_set_dma_mask(pci, 0x0fffffff);
+  
 ]]>
           </programlisting>
         </informalexample>
@@ -1914,8 +1911,27 @@
           .periods_max =      1024,
   };
 
+  /* hardware definition */
+  static snd_pcm_hardware_t snd_mychip_capture_hw = {
+          .info = (SNDRV_PCM_INFO_MMAP |
+                   SNDRV_PCM_INFO_INTERLEAVED |
+                   SNDRV_PCM_INFO_BLOCK_TRANSFER |
+                   SNDRV_PCM_INFO_MMAP_VALID),
+          .formats =          SNDRV_PCM_FMTBIT_S16_LE,
+          .rates =            SNDRV_PCM_RATE_8000_48000,
+          .rate_min =         8000,
+          .rate_max =         48000,
+          .channels_min =     2,
+          .channels_max =     2,
+          .buffer_bytes_max = 32768,
+          .period_bytes_min = 4096,
+          .period_bytes_max = 32768,
+          .periods_min =      1,
+          .periods_max =      1024,
+  };
+
   /* open callback */
-  static int snd_mychip_pcm_open(snd_pcm_substream_t *substream)
+  static int snd_mychip_playback_open(snd_pcm_substream_t *substream)
   {
           mychip_t *chip = snd_pcm_substream_chip(substream);
           snd_pcm_runtime_t *runtime = substream->runtime;
@@ -1926,7 +1942,27 @@
   }
 
   /* close callback */
-  static int snd_mychip_pcm_close(snd_pcm_substream_t *substream)
+  static int snd_mychip_playback_close(snd_pcm_substream_t *substream)
+  {
+          mychip_t *chip = snd_pcm_substream_chip(substream);
+          // the hardware-specific codes will be here
+          return 0;
+
+  }
+
+  /* open callback */
+  static int snd_mychip_capture_open(snd_pcm_substream_t *substream)
+  {
+          mychip_t *chip = snd_pcm_substream_chip(substream);
+          snd_pcm_runtime_t *runtime = substream->runtime;
+
+          runtime->hw = snd_mychip_capture_hw;
+          // more hardware-initialization will be done here
+          return 0;
+  }
+
+  /* close callback */
+  static int snd_mychip_capture_close(snd_pcm_substream_t *substream)
   {
           mychip_t *chip = snd_pcm_substream_chip(substream);
           // the hardware-specific codes will be here
@@ -2005,6 +2041,18 @@
           .pointer =     snd_mychip_pcm_pointer,
   };
 
+  /* operators */
+  static snd_pcm_ops_t snd_mychip_capture_ops = {
+          .open =        snd_mychip_capture_open,
+          .close =       snd_mychip_capture_close,
+          .ioctl =       snd_pcm_lib_ioctl,
+          .hw_params =   snd_mychip_pcm_hw_params,
+          .hw_free =     snd_mychip_pcm_hw_free,
+          .prepare =     snd_mychip_pcm_prepare,
+          .trigger =     snd_mychip_pcm_trigger,
+          .pointer =     snd_mychip_pcm_pointer,
+  };
+
   /*
    *  definitions of capture are omitted here...
    */
@@ -3982,13 +4030,18 @@
 
   static int snd_mychip_ac97(mychip_t *chip)
   {
+          ac97_bus_t bus, *pbus;
           ac97_t ac97;
+          int err;
 
+          memset(&bus, 0, sizeof(bus));
+          bus.write = snd_mychip_ac97_write;
+          bus.read = snd_mychip_ac97_read;
+          if ((err = snd_ac97_bus(chip->card, &bus, &pbus)) < 0)
+                  return err;
           memset(&ac97, 0, sizeof(ac97));
-          ac97.write = snd_mychip_ac97_write;
-          ac97.read = snd_mychip_ac97_read;
           ac97.private_data = chip;
-          return snd_ac97_mixer(card, &ac97, &chip->ac97);
+          return snd_ac97_mixer(pbus, &ac97, &chip->ac97);
   }
 
 ]]>
@@ -4000,9 +4053,29 @@
     <section id="api-ac97-constructor">
       <title>Constructor</title>
       <para>
-        For creating an ac97 instance, call
-      <function>snd_ac97_mixer()</function> with an <type>ac97_t</type>
-      record, in which the callbacks and the private_data is set.
+        For creating an ac97 instance, first call <function>snd_ac97_bus</function>
+      with <type>ac97_bus_t</type> record including callback functions.
+
+        <informalexample>
+          <programlisting>
+<![CDATA[
+  ac97_bus_t bus, *pbus;
+  int err;
+
+  memset(&bus, 0, sizeof(bus));
+  bus.write = snd_mychip_ac97_write;
+  bus.read = snd_mychip_ac97_read;
+  snd_ac97_bus(card, &bus, &pbus);
+]]>
+          </programlisting>
+        </informalexample>
+
+      The bus record is shared among all belonging ac97 instances.
+      </para>
+
+      <para>
+      And then call <function>snd_ac97_mixer()</function> with an <type>ac97_t</type>
+      record together with the bus pointer created above.
 
         <informalexample>
           <programlisting>
@@ -4011,16 +4084,16 @@
   int err;
 
   memset(&ac97, 0, sizeof(ac97));
-  ac97.write = snd_mychip_ac97_write;
-  ac97.read = snd_mychip_ac97_read;
   ac97.private_data = chip;
-  snd_ac97_mixer(card, &ac97, &chip->ac97);
+  snd_ac97_mixer(bus, &ac97, &chip->ac97);
 ]]>
           </programlisting>
         </informalexample>
 
         where chip-&gt;ac97 is the pointer of a newly created
         <type>ac97_t</type> instance.
+        In this case, the chip pointer is set as the private data, so that
+        the read/write callback functions can refer to this chip instance.
         This instance is not necessarily stored in the chip
 	record.  When you need to change the register values from the
         driver, or need the suspend/resume of ac97 codecs, keep this
@@ -4094,14 +4167,11 @@
         The <structfield>wait</structfield> callback is used for a
       certain wait at the standard initialization of the codec. If the
       chip requires the extra wait-time, define this callback. 
-      This callback is always non-atomic, because it's never called
-      in the resume mode.
       </para>
 
       <para>
         The <structfield>init</structfield> callback is used for
-      additional initialization of the codec.  This callback is called
-      after the reset, and should be atomic in the resume mode.
+      additional initialization of the codec.
       </para>
     </section>
 
@@ -4674,10 +4744,7 @@
           </programlisting>
         </informalexample>
 
-        Note that you have to pre-allocate to use this function
-        (i.e. you cannot use this function for
-        <link linkend="buffer-and-memory-non-contiguous"><citetitle>
-        a scatter-gather buffer</citetitle></link>).
+        Note that you have to pre-allocate to use this function.
       </para>
     </section>
 
@@ -4905,6 +4972,8 @@
         When a SG-handler is used, you need to set
       <function>snd_pcm_sgbuf_ops_page</function> as
       the <structfield>page</structfield> callback.
+      (See <link linkend="pcm-interface-operators-page-callback">
+      <citetitle>page callback section</citetitle></link>.)
       </para>
 
       <para>
@@ -4999,13 +5068,14 @@
       <informalexample>
         <programlisting>
 <![CDATA[
-  snd_info_set_text_ops(entry, chip, my_proc_read);
+  snd_info_set_text_ops(entry, chip, read_size, my_proc_read);
 ]]>
         </programlisting>
       </informalexample>
     
     where the second argument (<parameter>chip</parameter>) is the
-    private data to be used in the callbacks and the third
+    private data to be used in the callbacks. The third parameter
+    specifies the read buffer size and the fourth
     (<parameter>my_proc_read</parameter>) is the callback function, which
     is defined like
 
--- diff/Documentation/sound/alsa/OSS-Emulation.txt	2003-09-30 15:46:10.000000000 +0100
+++ source/Documentation/sound/alsa/OSS-Emulation.txt	2004-02-09 10:39:52.000000000 +0000
@@ -1,7 +1,7 @@
 		NOTES ON KERNEL OSS-EMULATION
 		=============================
 
-		Jan. 9, 2003  Takashi Iwai <tiwai@suse.de>
+		Jan. 22, 2004  Takashi Iwai <tiwai@suse.de>
 
 
 Modules
@@ -13,32 +13,20 @@
 When you need to access the OSS PCM, mixer or sequencer devices, the
 corresponding module has to be loaded.
 
-For loading these modules automatically, define the aliases in
-/etc/modules.conf like below:
-
-	alias sound-service-0-0 snd-mixer-oss
-	alias sound-service-0-1 snd-seq-oss
-	alias sound-service-0-3 snd-pcm-oss
-	alias sound-service-0-8 snd-seq-oss
-	alias sound-service-0-12 snd-pcm-oss
-
-Then the access to an OSS device file such as /dev/dsp0 triggers to
-load the necessary module via KMOD.
-
-For auto-loading the secondary card device like /dev/dsp1, the
-following aliases are necessary in addition:
-
-	alias sound-service-1-0 snd-mixer-oss
-	alias sound-service-1-3 snd-pcm-oss
-	alias sound-service-1-12 snd-pcm-oss
-
-Here you don't need to define service-1-1 and service-1-8 because
-there is only one sequencer device.
-Similarly, you can add definitions for the third or later cards as
-sound-service-X-Y.
-
-The OSS-MIDI is emulated directly in the ALSA rawmidi module,
-therefore no extra module exists for that purpose.
+These modules are loaded automatically when the corresponding service
+is called.  The alias is defined sound-service-x-y, where x and y are
+the card number and the minor unit number.  Usually you don't have to
+define these aliases by yourself.
+
+Only necessary step for auto-loading of OSS modules is to define the
+card alias in /etc/modprobe.conf, such as
+
+	alias sound-slot-0 snd-emu10k1
+
+As the second card, define sound-slot-1 as well.
+Note that you can't use the aliased name as the target name (i.e.
+"alias sound-slot-0 snd-card-0" doesn't work any more like the old
+modutils).
 
 The currently available OSS configuration is shown in
 /proc/asound/oss/sndstat.  This shows in the same syntax of
@@ -152,8 +140,7 @@
 	direct		don't use plugins
 	block		force block open mode
 	non-block	force non-block open mode
-	whole-frag	write only whole fragments (optimization affecting
-			playback only)
+	partial-frag	write also partial fragments (affects playback only)
 	no-silence	do not fill silence ahead to avoid clicks
 
 The disable option is useful when one stream direction (playback or
@@ -188,7 +175,7 @@
 
 	options snd-pcm-oss nonblock_open=1
 
-The whole-frag and no-silence commands have been added recently.
+The partial-frag and no-silence commands have been added recently.
 Both commands are for optimization use only.  The former command
 specifies to invoke the write transfer only when the whole fragment is
 filled.  The latter stops writing the silence data ahead
--- diff/Documentation/sound/alsa/SB-Live-mixer.txt	2002-10-16 04:27:11.000000000 +0100
+++ source/Documentation/sound/alsa/SB-Live-mixer.txt	2004-02-09 10:39:52.000000000 +0000
@@ -101,15 +101,15 @@
 The result is forwarded to the ADC capture FIFO (thus to the standard capture
 PCM device).
 
-name='Surround Digital Playback Volume',index=0
+name='Surround Playback Volume',index=0
 
 This control is used to attenuate samples for left and right rear PCM FX-bus
 accumulators. ALSA uses accumulators 2 and 3 for left and right rear PCM samples.
 The result samples are forwarded to the rear I2S DACs. These DACs operate
 separately (they are not inside the AC97 codec).
 
-name='Surround Digital Capture Volume',index=0
-name='Surround Digital Capture Switch',index=0
+name='Surround Capture Volume',index=0
+name='Surround Capture Switch',index=0
 
 These controls are used to attenuate samples for left and right rear PCM FX-bus
 accumulators. ALSA uses accumulators 2 and 3 for left and right rear PCM samples.
@@ -172,13 +172,13 @@
 digital inputs (usually used by a CDROM drive). The result samples are
 forwarded to the ADC capture FIFO (thus to the standard capture PCM device).
 
-name='IEC958 Optical Playback Volume',index=0
+name='IEC958 LiveDrive Playback Volume',index=0
 
 This control is used to attenuate samples from left and right IEC958 optical
 digital input. The result samples are forwarded to the front DAC PCM slots
 of the AC97 codec.
 
-name='IEC958 Optical Capture Volume',index=0
+name='IEC958 LiveDrive Capture Volume',index=0
 
 This control is used to attenuate samples from left and right IEC958 optical
 digital inputs. The result samples are forwarded to the ADC capture FIFO
--- diff/Documentation/sound/oss/AWE32	2002-10-16 04:28:25.000000000 +0100
+++ source/Documentation/sound/oss/AWE32	2004-02-09 10:39:52.000000000 +0000
@@ -47,12 +47,12 @@
 
    Copy it to a directory of your choice, and unpack it there.
 
-4) Edit /etc/modules.conf, and insert the following lines at the end of the
+4) Edit /etc/modprobe.conf, and insert the following lines at the end of the
    file:
 
   alias sound-slot-0 sb
   alias sound-service-0-1 awe_wave
-  post-install awe_wave /usr/local/bin/sfxload PATH_TO_SOUND_BANK_FILE
+  install awe_wave /sbin/modprobe --first-time -i awe_wave && /usr/local/bin/sfxload PATH_TO_SOUND_BANK_FILE
 
   You will of course have to change "PATH_TO_SOUND_BANK_FILE" to the full
   path of of the sound bank file. That will enable the Sound Blaster and AWE
--- diff/Documentation/sound/oss/AudioExcelDSP16	2002-10-16 04:27:08.000000000 +0100
+++ source/Documentation/sound/oss/AudioExcelDSP16	2004-02-09 10:39:52.000000000 +0000
@@ -41,7 +41,7 @@
 		(0x300, 0x310, 0x320 or 0x330)
 mpu_irq		MPU-401 irq line (5, 7, 9, 10 or 0)
 
-The /etc/modules.conf will have lines like this:
+The /etc/modprobe.conf will have lines like this:
 
 options opl3 io=0x388
 options ad1848 io=0x530 irq=11 dma=3
@@ -51,11 +51,11 @@
 ad1848 are the corresponding options for the MSS and OPL3 modules.
 
 Loading MSS and OPL3 needs to pre load the aedsp16 module to set up correctly
-the sound card. Installation dependencies must be written in the modules.conf
+the sound card. Installation dependencies must be written in the modprobe.conf
 file:
 
-pre-install ad1848 modprobe aedsp16
-pre-install opl3 modprobe aedsp16
+install ad1848 /sbin/modprobe aedsp16 && /sbin/modprobe -i ad1848
+install opl3 /sbin/modprobe aedsp16 && /sbin/modprobe -i opl3
 
 Then you must load the sound modules stack in this order:
 sound -> aedsp16 -> [ ad1848, opl3 ]
--- diff/Documentation/sound/oss/CMI8330	2004-01-19 10:22:54.000000000 +0000
+++ source/Documentation/sound/oss/CMI8330	2004-02-09 10:39:52.000000000 +0000
@@ -143,7 +143,7 @@
 
 
 
-Alma Chao <elysian@ethereal.torsion.org> suggests the following /etc/modules.conf:
+Alma Chao <elysian@ethereal.torsion.org> suggests the following /etc/modprobe.conf:
 
 alias sound ad1848
 alias synth0 opl3
--- diff/Documentation/sound/oss/Introduction	2004-01-19 10:22:54.000000000 +0000
+++ source/Documentation/sound/oss/Introduction	2004-02-09 10:39:52.000000000 +0000
@@ -168,7 +168,7 @@
 =========
 
 If loading via modprobe, these common files are automatically loaded 
-when requested by modprobe.  For example, my /etc/modules.conf contains:
+when requested by modprobe.  For example, my /etc/modprobe.conf contains:
 
 alias sound sb 
 options sb io=0x240 irq=9 dma=3 dma16=5 mpu_io=0x300
@@ -228,7 +228,7 @@
 driver, you should do the following:
 
 1.  remove sound modules (detailed above)
-2.  remove the sound modules from /etc/modules.conf
+2.  remove the sound modules from /etc/modprobe.conf
 3.  move the sound modules from /lib/modules/<kernel>/misc
     (for example, I make a /lib/modules/<kernel>/misc/tmp
     directory and copy the sound module files to that 
@@ -265,7 +265,7 @@
     sb.o could be copied (or symlinked) to sb1.o for the
     second SoundBlaster.
 
-2.  Make a second entry in /etc/modules.conf, for example,
+2.  Make a second entry in /etc/modprobe.conf, for example,
     sound1 or sb1.  This second entry should refer to the
     new module names for example sb1, and should include
     the I/O, etc. for the second sound card.
@@ -369,7 +369,7 @@
 2)  On the command line when using insmod or in a bash script
     using command line calls to load sound.
 
-3)  In /etc/modules.conf when using modprobe.
+3)  In /etc/modprobe.conf when using modprobe.
 
 4)  Via Red Hat's GPL'd /usr/sbin/sndconfig program (text based).
 
--- diff/Documentation/sound/oss/MAD16	2002-10-16 04:29:06.000000000 +0100
+++ source/Documentation/sound/oss/MAD16	2004-02-09 10:39:52.000000000 +0000
@@ -1,4 +1,5 @@
-(This recipe has been edited to update the configuration symbols.)
+(This recipe has been edited to update the configuration symbols,
+ and change over to modprobe.conf for 2.6)
 
 From: Shaw Carruthers <shaw@shawc.demon.co.uk>
 
@@ -20,9 +21,9 @@
 CONFIG_SOUND_MAD16=m
 CONFIG_SOUND_YM3812=m
 
-modules.conf has:
+modprobe.conf has:
 
-alias char-major-14 mad16
+alias char-major-14-* mad16
 options sb mad16=1
 options mad16 io=0x530 irq=7 dma=0 dma16=1  && /usr/local/bin/aumix -w 15 -p 20 -m 0 -1 0 -2 0 -3 0 -i 0
 
--- diff/Documentation/sound/oss/Maestro3	2002-10-16 04:28:34.000000000 +0100
+++ source/Documentation/sound/oss/Maestro3	2004-02-09 10:39:52.000000000 +0000
@@ -64,7 +64,7 @@
 installed with the rest of the modules for the kernel on the system.
 Typically this will be in /lib/modules/ somewhere.  'alias sound-slot-0
 maestro3' should also be added to your module configs (typically
-/etc/modules.conf) if you're using modular OSS/Lite sound and want to
+/etc/modprobe.conf) if you're using modular OSS/Lite sound and want to
 default to using a maestro3 chip.
 
 There are very few options to the driver.  One is 'debug' which will 
--- diff/Documentation/sound/oss/OPL3-SA2	2002-10-16 04:27:14.000000000 +0100
+++ source/Documentation/sound/oss/OPL3-SA2	2004-02-09 10:39:52.000000000 +0000
@@ -162,7 +162,7 @@
 modprobe opl3 io=0x388
 
 See the section "Automatic Module Loading" below for how to set up
-/etc/modules.conf to automate this.
+/etc/modprobe.conf to automate this.
 
 An important thing to remember that the opl3sa2 module's io argument is
 for it's own control port, which handles the card's master mixer for
@@ -196,7 +196,7 @@
 
 Lastly, if you're using modules and want to set up automatic module
 loading with kmod, the kernel module loader, here is the section I
-currently use in my modules.conf file:
+currently use in my modprobe.conf file:
 
 # Sound
 alias sound-slot-0 opl3sa2
--- diff/Documentation/sound/oss/Opti	2002-10-16 04:27:53.000000000 +0100
+++ source/Documentation/sound/oss/Opti	2004-02-09 10:39:52.000000000 +0000
@@ -18,7 +18,7 @@
 If you have another OS installed on your computer it is recommended
 that Linux and the other OS use the same resources.
 
-Also, it is recommended that resources specified in /etc/modules.conf
+Also, it is recommended that resources specified in /etc/modprobe.conf
 and resources specified in /etc/isapnp.conf agree.
 
 Compiling the sound driver
@@ -68,9 +68,9 @@
 Using kmod and autoloading the sound driver
 -------------------------------------------
 Comment: as of linux-2.1.90 kmod is replacing kerneld.
-The config file '/etc/modules.conf' is used as before.
+The config file '/etc/modprobe.conf' is used as before.
 
-This is the sound part of my /etc/modules.conf file.
+This is the sound part of my /etc/modprobe.conf file.
 Following that I will explain each line.
 
 alias mixer0 mad16
@@ -80,7 +80,7 @@
 options sb mad16=1
 options mad16 irq=10 dma=0 dma16=1 io=0x530 joystick=1 cdtype=0
 options opl3 io=0x388
-post-install mad16 /sbin/ad1848_mixer_reroute 14 8 15 3 16 6
+install mad16 /sbin/modprobe -i mad16 && /sbin/ad1848_mixer_reroute 14 8 15 3 16 6
 
 If you have an MPU daughtercard or onboard MPU you will want to add to the
 "options mad16" line - eg 
--- diff/Documentation/sound/oss/PAS16	2004-01-19 10:22:54.000000000 +0000
+++ source/Documentation/sound/oss/PAS16	2004-02-09 10:39:52.000000000 +0000
@@ -129,7 +129,7 @@
   You can then get OPL3 functionality by issuing the command:
   insmod opl3
   In addition, you must either add the following line to 
-  /etc/modules.conf:
+  /etc/modprobe.conf:
   options opl3 io=0x388
   or else add the following line to /etc/lilo.conf:
   opl3=0x388
@@ -159,5 +159,5 @@
 append="pas2=0x388,10,3,-1,0,-1,-1,-1 opl3=0x388"
 
 If sound is built totally modular, the above options may be 
-specified in /etc/modules.conf for pas2.o, sb.o and opl3.o 
+specified in /etc/modprobe.conf for pas2, sb and opl3
 respectively. 
--- diff/Documentation/sound/oss/README.modules	2002-10-16 04:27:53.000000000 +0100
+++ source/Documentation/sound/oss/README.modules	2004-02-09 10:39:52.000000000 +0000
@@ -26,10 +26,10 @@
 drivers/sound dir. Now one simply configures and makes one's kernel and
 modules in the usual way.
 
- Then, add to your /etc/modules.conf something like:
+ Then, add to your /etc/modprobe.conf something like:
 
-alias char-major-14 sb
-post-install sb /sbin/modprobe "-k" "adlib_card"
+alias char-major-14-* sb
+install sb /sbin/modprobe -i sb && /sbin/modprobe adlib_card
 options sb io=0x220 irq=7 dma=1 dma16=5 mpu_io=0x330
 options adlib_card io=0x388     # FM synthesizer
 
@@ -65,12 +65,12 @@
  Note that at present there is no way to configure the io, irq and other
 parameters for the modular drivers as one does for the wired drivers.. One
 needs to pass the modules the necessary parameters as arguments, either
-with /etc/modules.conf or with command-line args to modprobe, e.g.
+with /etc/modprobe.conf or with command-line args to modprobe, e.g.
 
-modprobe -k sb io=0x220 irq=7 dma=1 dma16=5 mpu_io=0x330
-modprobe -k adlib_card io=0x388
+modprobe sb io=0x220 irq=7 dma=1 dma16=5 mpu_io=0x330
+modprobe adlib_card io=0x388
 
- recommend using /etc/modules.conf.
+ recommend using /etc/modprobe.conf.
 
 Persistent DMA Buffers:
 
@@ -88,7 +88,7 @@
 
 To make the sound driver use persistent DMA buffers we need to pass the
 sound.o module a "dmabuf=1" command-line argument. This is normally done
-in /etc/modules.conf like so:
+in /etc/modprobe.conf like so:
 
 options sound		dmabuf=1
 
--- diff/Documentation/sound/oss/Wavefront	2004-01-19 10:22:54.000000000 +0000
+++ source/Documentation/sound/oss/Wavefront	2004-02-09 10:39:52.000000000 +0000
@@ -189,16 +189,15 @@
 6) How do I configure my card ?
 ************************************************************
 
-You need to edit /etc/modules.conf. Here's mine (edited to show the
+You need to edit /etc/modprobe.conf. Here's mine (edited to show the
 relevant details):
 
   # Sound system
-  alias char-major-14 wavefront
+  alias char-major-14-* wavefront
   alias synth0 wavefront
   alias mixer0 cs4232
   alias audio0 cs4232
-  pre-install wavefront modprobe "-k" "cs4232"
-  post-install wavefront modprobe "-k" "opl3"
+  install wavefront /sbin/modprobe cs4232 && /sbin/modprobe -i wavefront && /sbin/modprobe opl3
   options wavefront io=0x200 irq=9
   options cs4232 synthirq=9 synthio=0x200 io=0x530 irq=5 dma=1 dma2=0
   options opl3 io=0x388
--- diff/Documentation/sysctl/fs.txt	2003-01-02 10:43:02.000000000 +0000
+++ source/Documentation/sysctl/fs.txt	2004-02-09 10:39:52.000000000 +0000
@@ -138,3 +138,13 @@
 can have. You only need to increase super-max if you need to
 mount more filesystems than the current value in super-max
 allows you to.
+
+==============================================================
+
+aio-nr & aio-max-nr:
+
+aio-nr shows the current system-wide number of asynchronous io
+requests.  aio-max-nr allows you to change the maximum value
+aio-nr can grow to.
+
+==============================================================
--- diff/Documentation/sysctl/kernel.txt	2004-02-09 10:36:07.000000000 +0000
+++ source/Documentation/sysctl/kernel.txt	2004-02-09 10:39:52.000000000 +0000
@@ -254,8 +254,8 @@
 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.
+the minimum length of time between these messages (in jiffies), by
+default we allow one every 5 seconds.
 
 A value of 0 will disable rate limiting.
 
--- diff/Documentation/usb/acm.txt	2002-10-16 04:27:22.000000000 +0100
+++ source/Documentation/usb/acm.txt	2004-02-09 10:39:52.000000000 +0000
@@ -28,7 +28,7 @@
 
 1. Usage
 ~~~~~~~~
-  The drivers/usb/acm.c drivers works with USB modems and USB ISDN terminal
+  The drivers/usb/class/cdc-acm.c drivers works with USB modems and USB ISDN terminal
 adapters that conform to the Universal Serial Bus Communication Device Class
 Abstract Control Model (USB CDC ACM) specification.
 
@@ -65,9 +65,9 @@
 
   To use the modems you need these modules loaded:
 
-	usbcore.o
-	usb-[uo]hci.o or uhci.o
-	acm.o
+	usbcore.ko
+	uhci-hcd.ko ohci-hcd.ko or ehci-hcd.ko
+	cdc-acm.ko
 
   After that, the modem[s] should be accessible. You should be able to use
 minicom, ppp and mgetty with them.
--- diff/Documentation/usb/scanner.txt	2003-05-21 11:49:49.000000000 +0100
+++ source/Documentation/usb/scanner.txt	2004-02-09 10:39:52.000000000 +0000
@@ -146,14 +146,14 @@
 
   options scanner vendor=0x#### product=0x****
 
-to the /etc/modules.conf file replacing the #'s and the *'s with the
+to the /etc/modprobe.conf file replacing the #'s and the *'s with the
 correct IDs.  The IDs can be retrieved from the messages file or
 using "cat /proc/bus/usb/devices".
 
 If the default timeout is too low, i.e. there are frequent "timeout" messages,
 you may want to increase the timeout manually by using the parameter
 "read_timeout".  The time is given in seconds.  This is an example for
-modules.conf with a timeout of 60 seconds:
+modprobe.conf with a timeout of 60 seconds:
 
   options scanner read_timeout=60
  
--- diff/Documentation/video4linux/CQcam.txt	2003-10-09 09:47:33.000000000 +0100
+++ source/Documentation/video4linux/CQcam.txt	2004-02-09 10:39:52.000000000 +0000
@@ -62,7 +62,7 @@
  
   The configuration requires module configuration and device
 configuration.  I like kmod or kerneld process with the
-/etc/modules.conf file so the modules can automatically load/unload as
+/etc/modprobe.conf file so the modules can automatically load/unload as
 they are used.  The video devices could already exist, be generated
 using MAKEDEV, or need to be created.  The following sections detail
 these procedures.
@@ -71,15 +71,15 @@
 2.1 Module Configuration  
 
   Using modules requires a bit of work to install and pass the
-parameters.  Understand that entries in /etc/modules.conf of:
+parameters.  Understand that entries in /etc/modprobe.conf of:
 
    alias parport_lowlevel parport_pc
    options parport_pc io=0x378 irq=none
    alias char-major-81 videodev
    alias char-major-81-0 c-qcam
 
-will cause the kmod/kerneld/modprobe to do certain things.  If you are
-using kmod or kerneld, then a request for a 'char-major-81-0' will cause
+will cause the kmod/modprobe to do certain things.  If you are
+using kmod, then a request for a 'char-major-81-0' will cause
 the 'c-qcam' module to load.  If you have other video sources with
 modules, you might want to assign the different minor numbers to
 different modules.
--- diff/Documentation/video4linux/Zoran	2003-09-30 15:46:10.000000000 +0100
+++ source/Documentation/video4linux/Zoran	2004-02-09 10:39:52.000000000 +0000
@@ -233,7 +233,7 @@
 option with X being the card number as given in the previous section.
 To have more than one card, use card=X1[,X2[,X3,[X4[..]]]]
 
-To automate this, add the following to your /etc/modules.conf:
+To automate this, add the following to your /etc/modprobe.conf:
 
 options zr36067 card=X1[,X2[,X3[,X4[..]]]]
 alias char-major-81-0 zr36067
--- diff/Documentation/video4linux/bttv/Modules.conf	2002-10-16 04:28:23.000000000 +0100
+++ source/Documentation/video4linux/bttv/Modules.conf	2004-02-09 10:39:52.000000000 +0000
@@ -1,3 +1,6 @@
+# For modern kernels (2.6 or above), this belongs in /etc/modprobe.conf
+# For for 2.4 kernels or earlier, this belongs in /etc/modules.conf.
+
 # i2c
 alias char-major-89	i2c-dev
 options i2c-core	i2c_debug=1
--- diff/Documentation/video4linux/bttv/README	2004-02-09 10:36:07.000000000 +0000
+++ source/Documentation/video4linux/bttv/README	2004-02-09 10:39:52.000000000 +0000
@@ -22,7 +22,7 @@
 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:
+cards which have no tuner), try adding this to your modprobe.conf:
 	options i2c-algo-bit bit_test=1
 
 For the WinTV/PVR you need one firmware file from the driver CD:
--- diff/Documentation/video4linux/meye.txt	2003-11-25 15:24:57.000000000 +0000
+++ source/Documentation/video4linux/meye.txt	2004-02-09 10:39:52.000000000 +0000
@@ -42,7 +42,7 @@
 ---------------
 
 Several options can be passed to the meye driver, either by adding them
-to /etc/modules.conf file, when the driver is compiled as a module, or
+to /etc/modprobe.conf file, when the driver is compiled as a module, or
 by adding the following to the kernel command line (in your bootloader):
 
 	meye=gbuffers[,gbufsize[,video_nr]]
@@ -59,7 +59,7 @@
 -----------
 
 In order to automatically load the meye module on use, you can put those lines
-in your /etc/modules.conf file:
+in your /etc/modprobe.conf file:
 
 	alias char-major-81 videodev
 	alias char-major-81-0 meye
--- diff/MAINTAINERS	2004-02-09 10:36:07.000000000 +0000
+++ source/MAINTAINERS	2004-02-09 10:39:57.000000000 +0000
@@ -1188,6 +1188,12 @@
 W:	http://developer.osdl.org/rddunlap/kj-patches/
 S:	Maintained
 
+KGDB FOR I386 PLATFORM
+P:	George Anzinger
+M:	george@mvista.com
+L:	linux-net@vger.kernel.org
+S:	Supported
+
 KERNEL NFSD
 P:	Neil Brown
 M:	neilb@cse.unsw.edu.au
--- diff/Makefile	2004-02-09 10:36:07.000000000 +0000
+++ source/Makefile	2004-02-09 10:39:57.000000000 +0000
@@ -1,8 +1,8 @@
 VERSION = 2
 PATCHLEVEL = 6
 SUBLEVEL = 2
-EXTRAVERSION =
-NAME=Feisty Dunnart
+EXTRAVERSION = -mm1
+NAME=Geriatric Wombat
 
 # *DOCUMENTATION*
 # To see a list of typical targets execute "make help"
@@ -444,6 +444,7 @@
 
 ifdef CONFIG_DEBUG_INFO
 CFLAGS		+= -g
+AFLAGS		+= -g
 endif
 
 # warn about C99 declaration after statement
@@ -830,7 +831,7 @@
       cmd_cscope-file = $(all-sources) > cscope.files
 
 quiet_cmd_cscope = MAKE    cscope.out
-      cmd_cscope = cscope -k -b
+      cmd_cscope = cscope -k -b -q
 
 cscope: FORCE
 	$(call cmd,cscope-file)
--- diff/arch/alpha/oprofile/common.c	2003-06-30 10:07:32.000000000 +0100
+++ source/arch/alpha/oprofile/common.c	2004-02-09 10:39:50.000000000 +0000
@@ -57,7 +57,7 @@
 
 	/* Compute the mask of enabled counters.  */
 	for (i = e = 0; i < model->num_counters; ++i)
-		if (ctr[0].enabled)
+		if (ctr[i].enabled)
 			e |= 1 << i;
 	reg.enable = e;
 
--- diff/arch/arm/kernel/process.c	2004-02-09 10:36:07.000000000 +0000
+++ source/arch/arm/kernel/process.c	2004-02-09 10:39:50.000000000 +0000
@@ -264,7 +264,7 @@
 	if (!thread)
 		thread = ll_alloc_task_struct();
 
-#ifdef CONFIG_SYSRQ
+#ifdef CONFIG_MAGIC_SYSRQ
 	/*
 	 * The stack must be cleared if you want SYSRQ-T to
 	 * give sensible stack usage information
--- diff/arch/arm26/Kconfig	2003-09-30 15:46:11.000000000 +0100
+++ source/arch/arm26/Kconfig	2004-02-09 10:39:50.000000000 +0000
@@ -216,11 +216,6 @@
 
 source "drivers/char/Kconfig"
 
-config KBDMOUSE
-	bool
-	depends on ARCH_ACORN && BUSMOUSE=y
-	default y
-
 source "drivers/media/Kconfig"
 
 source "fs/Kconfig"
--- diff/arch/arm26/kernel/process.c	2003-10-09 09:47:33.000000000 +0100
+++ source/arch/arm26/kernel/process.c	2004-02-09 10:39:50.000000000 +0000
@@ -257,7 +257,7 @@
 	if (!thread)
 		thread = ll_alloc_task_struct();
 
-#ifdef CONFIG_SYSRQ
+#ifdef CONFIG_MAGIC_SYSRQ
 	/*
 	 * The stack must be cleared if you want SYSRQ-T to
 	 * give sensible stack usage information
--- diff/arch/cris/arch-v10/drivers/ethernet.c	2003-07-11 09:39:49.000000000 +0100
+++ source/arch/cris/arch-v10/drivers/ethernet.c	2004-02-09 10:39:50.000000000 +0000
@@ -482,7 +482,7 @@
 	/* Register device */
 	err = register_netdev(dev);
 	if (err) {
-		kfree(dev);
+		free_netdev(dev);
 		return err;
 	}
 
--- diff/arch/h8300/lib/checksum.c	2003-10-09 09:47:33.000000000 +0100
+++ source/arch/h8300/lib/checksum.c	2004-02-09 10:39:50.000000000 +0000
@@ -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/arch/h8300/platform/h8300h/ints.c	2004-01-19 10:22:55.000000000 +0000
+++ source/arch/h8300/platform/h8300h/ints.c	2004-02-09 10:39:50.000000000 +0000
@@ -140,8 +140,9 @@
 	if (use_kmalloc)
 		irq_handle = (irq_handler_t *)kmalloc(sizeof(irq_handler_t), GFP_ATOMIC);
 	else {
-		irq_handle = alloc_bootmem(sizeof(irq_handler_t));
-		(unsigned long)irq_handle |= 0x80000000; /* bootmem allocater */
+		/* use bootmem allocater */
+		irq_handle = (irq_handler_t *)alloc_bootmem(sizeof(irq_handler_t));
+		irq_handle = (irq_handler_t *)((unsigned long)irq_handle | 0x80000000);
 	}
 
 	if (irq_handle == NULL)
@@ -230,11 +231,9 @@
 {
 	int i = *(loff_t *) v;
 
-	if (i < NR_IRQS) {
-		if (irq_list[i]) {
-			seq_printf(p, "%3d: %10u ",i,irq_list[i]->count);
-			seq_printf(p, "%s\n", irq_list[i]->devname);
-		}
+	if ((i < NR_IRQS) && (irq_list[i]!=NULL)) {
+		seq_printf(p, "%3d: %10u ",i,irq_list[i]->count);
+		seq_printf(p, "%s\n", irq_list[i]->devname);
 	}
 
 	return 0;
--- diff/arch/h8300/platform/h8s/ints.c	2004-01-19 10:22:55.000000000 +0000
+++ source/arch/h8300/platform/h8s/ints.c	2004-02-09 10:39:50.000000000 +0000
@@ -178,8 +178,9 @@
 	if (use_kmalloc)
 		irq_handle = (irq_handler_t *)kmalloc(sizeof(irq_handler_t), GFP_ATOMIC);
 	else {
-		irq_handle = alloc_bootmem(sizeof(irq_handler_t));
-		(unsigned long)irq_handle |= 0x80000000; /* bootmem allocater */
+		/* use bootmem allocater */
+		irq_handle = (irq_handler_t *)alloc_bootmem(sizeof(irq_handler_t));
+		irq_handle = (irq_handler_t *)((unsigned long)irq_handle | 0x80000000);
 	}
 
 	if (irq_handle == NULL)
@@ -282,11 +283,9 @@
 {
 	int i = *(loff_t *) v;
 
-	if (i < NR_IRQS) {
-		if (irq_list[i]) {
-			seq_printf(p, "%3d: %10u ",i,irq_list[i]->count);
-			seq_printf(p, "%s\n", irq_list[i]->devname);
-		}
+	if ((i < NR_IRQS) && (irq_list[i] !=NULL)) {
+		seq_printf(p, "%3d: %10u ",i,irq_list[i]->count);
+		seq_printf(p, "%s\n", irq_list[i]->devname);
 	}
 
 	return 0;
--- diff/arch/i386/Kconfig	2004-02-09 10:36:07.000000000 +0000
+++ source/arch/i386/Kconfig	2004-02-09 10:39:50.000000000 +0000
@@ -43,6 +43,15 @@
 	help
 	  Choose this option if your computer is a standard PC or compatible.
 
+config X86_ELAN
+	bool "AMD Elan"
+	help
+	  Select this for an AMD Elan processor.
+
+	  Do not use this option for K6/Athlon/Opteron processors!
+
+	  If unsure, choose "PC-compatible" instead.
+
 config X86_VOYAGER
 	bool "Voyager (NCR)"
 	help
@@ -130,278 +139,318 @@
 	default y
 	depends on SMP && X86_ES7000 && MPENTIUMIII
 
-choice
-	prompt "Processor family"
-	default M686
+if !X86_ELAN
 
-config M386
-	bool "386"
-	---help---
-	  This is the processor type of your CPU. This information is used for
-	  optimizing purposes. In order to compile a kernel that can run on
-	  all x86 CPU types (albeit not optimally fast), you can specify
-	  "386" here.
-
-	  The kernel will not necessarily run on earlier architectures than
-	  the one you have chosen, e.g. a Pentium optimized kernel will run on
-	  a PPro, but not necessarily on a i486.
-
-	  Here are the settings recommended for greatest speed:
-	  - "386" for the AMD/Cyrix/Intel 386DX/DXL/SL/SLC/SX, Cyrix/TI
-	  486DLC/DLC2, UMC 486SX-S and NexGen Nx586.  Only "386" kernels
-	  will run on a 386 class machine.
-	  - "486" for the AMD/Cyrix/IBM/Intel 486DX/DX2/DX4 or
-	  SL/SLC/SLC2/SLC3/SX/SX2 and UMC U5D or U5S.
-	  - "586" for generic Pentium CPUs lacking the TSC
-	  (time stamp counter) register.
-	  - "Pentium-Classic" for the Intel Pentium.
-	  - "Pentium-MMX" for the Intel Pentium MMX.
-	  - "Pentium-Pro" for the Intel Pentium Pro.
-	  - "Pentium-II" for the Intel Pentium II or pre-Coppermine Celeron.
-	  - "Pentium-III" for the Intel Pentium III or Coppermine Celeron.
-	  - "Pentium-4" for the Intel Pentium 4 or P4-based Celeron.
-	  - "K6" for the AMD K6, K6-II and K6-III (aka K6-3D).
-	  - "Athlon" for the AMD K7 family (Athlon/Duron/Thunderbird).
-	  - "Crusoe" for the Transmeta Crusoe series.
-	  - "Winchip-C6" for original IDT Winchip.
-	  - "Winchip-2" for IDT Winchip 2.
-	  - "Winchip-2A" for IDT Winchips with 3dNow! capabilities.
-	  - "CyrixIII/VIA C3" for VIA Cyrix III or VIA C3.
-	  - "VIA C3-2 for VIA C3-2 "Nehemiah" (model 9 and above).
+menu "Processor support"
+
+comment "Select all processors your kernel should support"
 
-	  If you don't know what to do, choose "386".
+config CPU_386
+	bool "386"
+	default n
+	help
+	  Select this for a 386 series processor.
 
-config M486
+config CPU_486
 	bool "486"
+	default y
 	help
 	  Select this for a 486 series processor, either Intel or one of the
 	  compatible processors from AMD, Cyrix, IBM, or Intel.  Includes DX,
 	  DX2, and DX4 variants; also SL/SLC/SLC2/SLC3/SX/SX2 and UMC U5D or
 	  U5S.
 
-config M586
+config CPU_586
 	bool "586/K5/5x86/6x86/6x86MX"
+	default y
 	help
-	  Select this for an 586 or 686 series processor such as the AMD K5,
-	  the Intel 5x86 or 6x86, or the Intel 6x86MX.  This choice does not
-	  assume the RDTSC (Read Time Stamp Counter) instruction.
+	  Select this for a non-Intel 586 or 686 series processor such as
+	  the AMD K5 or the Cyrix 6x86MX.
+
+	  Several CPUs that have their own options below (e.g. AMD K6,
+	  Duron, Athlon and Opteeron, IDT Winchip, Cyrix III and
+	  VIA C3) do _not_ need this option.
 
-config M586TSC
+	  This choice does not assume the RDTSC (Read Time Stamp Counter)
+	  instruction.
+
+config CPU_586TSC
 	bool "Pentium-Classic"
+	default y
 	help
 	  Select this for a Pentium Classic processor with the RDTSC (Read
-	  Time Stamp Counter) instruction for benchmarking.
+	  Time Stamp Counter) instruction.
 
-config M586MMX
+config CPU_586MMX
 	bool "Pentium-MMX"
+	default y
 	help
 	  Select this for a Pentium with the MMX graphics/multimedia
 	  extended instructions.
 
-config M686
+config CPU_686
 	bool "Pentium-Pro"
+	default y
 	help
-	  Select this for Intel Pentium Pro chips.  This enables the use of
-	  Pentium Pro extended instructions, and disables the init-time guard
-	  against the f00f bug found in earlier Pentiums.
+	  Select this for Intel Pentium Pro chips.
 
-config MPENTIUMII
+config CPU_PENTIUMII
 	bool "Pentium-II/Celeron(pre-Coppermine)"
+	default y
 	help
 	  Select this for Intel chips based on the Pentium-II and
-	  pre-Coppermine Celeron core.  This option enables an unaligned
-	  copy optimization, compiles the kernel with optimization flags
-	  tailored for the chip, and applies any applicable Pentium Pro
-	  optimizations.
+	  pre-Coppermine Celeron core.
 
-config MPENTIUMIII
+config CPU_PENTIUMIII
 	bool "Pentium-III/Celeron(Coppermine)/Pentium-III Xeon"
+	default y
 	help
 	  Select this for Intel chips based on the Pentium-III and
-	  Celeron-Coppermine core.  This option enables use of some
-	  extended prefetch instructions in addition to the Pentium II
-	  extensions.
-
-config MPENTIUM4
-	bool "Pentium-4/Celeron(P4-based)/Xeon"
-	help
-	  Select this for Intel Pentium 4 chips.  This includes both
-	  the Pentium 4 and P4-based Celeron chips.  This option
-	  enables compile flags optimized for the chip, uses the
-	  correct cache shift, and applies any applicable Pentium III
-	  optimizations.
+	  Celeron-Coppermine core.
+
+config CPU_PENTIUMM
+	bool "Pentium M"
+	default y
+	help
+	  Select this for Intel Pentium M (not Pentium-4 M)
+	  notebook chips.
+
+config CPU_PENTIUM4
+	bool "Pentium-4/Celeron(P4-based)/Pentium-4 M/Xeon"
+	default y
+	help
+	  Select this for Intel Pentium 4 chips.  This includes
+	  the Pentium 4, P4-based Celeron and Xeon, and
+	  Pentium-4 M (not Pentium M) chips.
 
-config MK6
+config CPU_K6
 	bool "K6/K6-II/K6-III"
+	default y
 	help
-	  Select this for an AMD K6-family processor.  Enables use of
-	  some extended instructions, and passes appropriate optimization
-	  flags to GCC.
+	  Select this for an AMD K6, K6-II or K6-III (aka K6-3D).
 
-config MK7
+config CPU_K7
 	bool "Athlon/Duron/K7"
+	default y
 	help
-	  Select this for an AMD Athlon K7-family processor.  Enables use of
-	  some extended instructions, and passes appropriate optimization
-	  flags to GCC.
+	  Select this for an AMD Athlon K7-family processor.
 
-config MK8
+config CPU_K8
 	bool "Opteron/Athlon64/Hammer/K8"
+	default y
 	help
-	  Select this for an AMD Opteron or Athlon64 Hammer-family processor.  Enables
-	  use of some extended instructions, and passes appropriate optimization
-	  flags to GCC.
-
-config MELAN
-	bool "Elan"
+	  Select this for an AMD Opteron or Athlon64 Hammer-family processor.
 
-config MCRUSOE
+config CPU_CRUSOE
 	bool "Crusoe"
+	default y
 	help
-	  Select this for a Transmeta Crusoe processor.  Treats the processor
-	  like a 586 with TSC, and sets some GCC optimization flags (like a
-	  Pentium Pro with no alignment requirements).
+	  Select this for a Transmeta Crusoe processor.
 
-config MWINCHIPC6
+config CPU_WINCHIPC6
 	bool "Winchip-C6"
+	default y
 	help
-	  Select this for an IDT Winchip C6 chip.  Linux and GCC
-	  treat this chip as a 586TSC with some extended instructions
-	  and alignment requirements.
+	  Select this for an IDT Winchip C6 chip.
 
-config MWINCHIP2
+config CPU_WINCHIP2
 	bool "Winchip-2"
+	default y
 	help
-	  Select this for an IDT Winchip-2.  Linux and GCC
-	  treat this chip as a 586TSC with some extended instructions
-	  and alignment requirements.
+	  Select this for an IDT Winchip-2.
 
-config MWINCHIP3D
+config CPU_WINCHIP3D
 	bool "Winchip-2A/Winchip-3"
+	default y
+	help
+	  Select this for an IDT Winchip-2A or 3 with 3dNow!
+	  capabilities.
+
+config CPU_CYRIXIII
+	bool "Cyrix III/VIA C3"
+	default y
 	help
-	  Select this for an IDT Winchip-2A or 3.  Linux and GCC
-	  treat this chip as a 586TSC with some extended instructions
-	  and alignment reqirements.  Also enable out of order memory
-	  stores for this CPU, which can increase performance of some
-	  operations.
-
-config MCYRIXIII
-	bool "CyrixIII/VIA-C3"
-	help
-	  Select this for a Cyrix III or C3 chip.  Presently Linux and GCC
-	  treat this chip as a generic 586. Whilst the CPU is 686 class,
-	  it lacks the cmov extension which gcc assumes is present when
-	  generating 686 code.
-	  Note that Nehemiah (Model 9) and above will not boot with this
-	  kernel due to them lacking the 3DNow! instructions used in earlier
-	  incarnations of the CPU.
+	  Select this for a Cyrix III or VIA C3 chip.
+
+	  Note that Nehemiah (Model 9) and above need the next
+	  option instead.
 
-config MVIAC3_2
+config CPU_VIAC3_2
 	bool "VIA C3-2 (Nehemiah)"
+	default y
 	help
-	  Select this for a VIA C3 "Nehemiah". Selecting this enables usage
-	  of SSE and tells gcc to treat the CPU as a 686.
-	  Note, this kernel will not boot on older (pre model 9) C3s.
+	  Select this for a VIA C3 "Nehemiah" (model 9 and above).
 
-endchoice
+endmenu
 
-config X86_GENERIC
-       bool "Generic x86 support" 
-       help
-       	  Including some tuning for non selected x86 CPUs too.
-	  when it has moderate overhead. This is intended for generic 
-	  distributions kernels.
+endif
+
+#
+# helper options
+#
+config CPU_INTEL
+	bool
+	depends on CPU_386 || CPU_486 || CPU_586TSC || CPU_686 || CPU_PENTIUMII || CPU_PENTIUMIII || CPU_PENTIUMM || CPU_PENTIUM4
+	default y
+
+config CPU_WINCHIP
+	bool
+	depends on CPU_WINCHIPC6 || CPU_WINCHIP2 || CPU_WINCHIP3D
+	default y
+
+config CPU_ONLY_K7
+	bool
+	depends on CPU_K7 && !CPU_INTEL && !CPU_K6 && !CPU_K8 && !X86_ELAN && !CPU_CRUSOE && !CPU_WINCHIP && !CPU_CYRIXIII && !CPU_VIAC3_2
+	default y
+
+config CPU_ONLY_K8
+	bool
+	depends on CPU_K8 && !CPU_INTEL && !CPU_K6 && !CPU_K7 && !X86_ELAN && !CPU_CRUSOE && !CPU_WINCHIP && !CPU_CYRIXIII && !CPU_VIAC3_2
+	default y
+
+config CPU_ONLY_WINCHIP
+	bool
+	depends on CPU_WINCHIP && !CPU_INTEL && !CPU_K6 && !CPU_K7 && !CPU_K8 && !X86_ELAN && !CPU_CRUSOE && !CPU_CYRIXIII && !CPU_VIAC3_2
+	default y
 
 #
 # Define implied options from the CPU selection here
 #
 config X86_CMPXCHG
 	bool
-	depends on !M386
+	depends on !CPU_386
 	default y
 
 config X86_XADD
 	bool
-	depends on !M386
+	depends on !CPU_386
 	default y
 
 config X86_L1_CACHE_SHIFT
 	int
-	default "7" if MPENTIUM4 || X86_GENERIC
-	default "4" if MELAN || M486 || M386
-	default "5" if MWINCHIP3D || MWINCHIP2 || MWINCHIPC6 || MCRUSOE || MCYRIXIII || MK6 || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || M586 || MVIAC3_2
-	default "6" if MK7 || MK8
+	default "7" if CPU_PENTIUM4
+	default "6" if CPU_K7 || CPU_K8 || CPU_PENTIUMM
+	default "5" if CPU_WINCHIP || CPU_CRUSOE || CPU_CYRIXIII || CPU_K6 || CPU_PENTIUMIII || CPU_PENTIUMII || CPU_686 || CPU_586MMX || CPU_586TSC || CPU_586 || CPU_VIAC3_2
+	default "4" if X86_ELAN || CPU_486 || CPU_386
 
 config RWSEM_GENERIC_SPINLOCK
 	bool
-	depends on M386
+	depends on CPU_386
 	default y
 
 config RWSEM_XCHGADD_ALGORITHM
 	bool
-	depends on !M386
+	depends on !CPU_386
 	default y
 
 config X86_PPRO_FENCE
 	bool
-	depends on M686 || M586MMX || M586TSC || M586 || M486 || M386
+	depends on CPU_686
 	default y
 
 config X86_F00F_BUG
 	bool
-	depends on M586MMX || M586TSC || M586 || M486 || M386
+	depends on CPU_586MMX || CPU_586TSC
 	default y
 
 config X86_WP_WORKS_OK
 	bool
-	depends on !M386
+	depends on !CPU_386
 	default y
 
 config X86_INVLPG
 	bool
-	depends on !M386
+	depends on !CPU_386
 	default y
 
 config X86_BSWAP
 	bool
-	depends on !M386
+	depends on !CPU_386
 	default y
 
 config X86_POPAD_OK
 	bool
-	depends on !M386
+	depends on !CPU_386
 	default y
 
 config X86_ALIGNMENT_16
 	bool
-	depends on MWINCHIP3D || MWINCHIP2 || MWINCHIPC6 || MCYRIXIII || MELAN || MK6 || M586MMX || M586TSC || M586 || M486 || MVIAC3_2
+	depends on CPU_WINCHIP || CPU_CYRIXIII || X86_ELAN || CPU_K6 || CPU_586MMX || CPU_586TSC || CPU_586 || CPU_486 || CPU_VIAC3_2
 	default y
 
-config X86_GOOD_APIC
+config X86_BAD_APIC
 	bool
-	depends on MK7 || MPENTIUM4 || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || MK8
+	depends on CPU_586TSC
 	default y
 
 config X86_INTEL_USERCOPY
 	bool
-	depends on MPENTIUM4 || MPENTIUMIII || MPENTIUMII || M586MMX || X86_GENERIC || MK8 || MK7
+	depends on CPU_K7 || CPU_K8 || CPU_PENTIUMII || CPU_PENTIUMIII || CPU_PENTIUMM || CPU_PENTIUM4
 	default y
 
 config X86_USE_PPRO_CHECKSUM
 	bool
-	depends on MWINCHIP3D || MWINCHIP2 || MWINCHIPC6 || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMIII || MPENTIUMII || M686 || MK8 || MVIAC3_2
+	depends on !CPU_386 && !CPU_486 && !CPU_586 && !CPU_586TSC && !CPU_586MMX && !X86_ELAN && !CPU_CRUSOE
 	default y
 
 config X86_USE_3DNOW
 	bool
-	depends on MCYRIXIII || MK7
+	depends on !CPU_INTEL && !CPU_K6 && !CPU_K8 && !X86_ELAN && !CPU_CRUSOE && !CPU_WINCHIP && !CPU_VIAC3_2
 	default y
 
 config X86_OOSTORE
 	bool
-	depends on (MWINCHIP3D || MWINCHIP2 || MWINCHIPC6) && MTRR
+	depends on CPU_ONLY_WINCHIP && MTRR
 	default y
 
+config X86_4G
+	bool "4 GB kernel-space and 4 GB user-space virtual memory support"
+	help
+          This option is only useful for systems that have more than 1 GB
+          of RAM.
+
+          The default kernel VM layout leaves 1 GB of virtual memory for
+          kernel-space mappings, and 3 GB of VM for user-space applications.
+          This option ups both the kernel-space VM and the user-space VM to
+          4 GB.
+
+          The cost of this option is additional TLB flushes done at
+          system-entry points that transition from user-mode into kernel-mode.
+          I.e. system calls and page faults, and IRQs that interrupt user-mode
+          code. There's also additional overhead to kernel operations that copy
+          memory to/from user-space. The overhead from this is hard to tell and
+          depends on the workload - it can be anything from no visible overhead
+          to 20-30% overhead. A good rule of thumb is to count with a runtime
+          overhead of 20%.
+
+          The upside is the much increased kernel-space VM, which more than
+          quadruples the maximum amount of RAM supported. Kernels compiled with
+          this option boot on 64GB of RAM and still have more than 3.1 GB of
+          'lowmem' left. Another bonus is that highmem IO bouncing decreases,
+          if used with drivers that still use bounce-buffers.
+
+          There's also a 33% increase in user-space VM size - database
+          applications might see a boost from this.
+
+          But the cost of the TLB flushes and the runtime overhead has to be
+          weighed against the bonuses offered by the larger VM spaces. The
+          dividing line depends on the actual workload - there might be 4 GB
+          systems that benefit from this option. Systems with less than 4 GB
+          of RAM will rarely see a benefit from this option - but it's not
+          out of question, the exact circumstances have to be considered.
+
+config X86_SWITCH_PAGETABLES
+	def_bool X86_4G
+
+config X86_4G_VM_LAYOUT
+	def_bool X86_4G
+
+config X86_UACCESS_INDIRECT
+	def_bool X86_4G
+
+config X86_HIGH_ENTRY
+	def_bool X86_4G
+
 config HPET_TIMER
 	bool "HPET Timer Support"
 	help
@@ -459,6 +508,16 @@
 	  This is purely to save memory - each supported CPU adds
 	  approximately eight kilobytes to the kernel image.
 
+config SCHED_SMT
+	bool "SMT (Hyperthreading) scheduler support"
+	depends on SMP
+	default off
+	help
+	  SMT scheduler support improves the CPU scheduler's decision making
+	  when dealing with Intel Pentium 4 chips with HyperThreading at a
+	  cost of slightly increased overhead in some places. If unsure say
+	  N here.
+
 config PREEMPT
 	bool "Preemptible Kernel"
 	help
@@ -513,7 +572,7 @@
 
 config X86_TSC
 	bool
-	depends on (MWINCHIP3D || MWINCHIP2 || MCRUSOE || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || MK8 || MVIAC3_2) && !X86_NUMAQ
+	depends on !X86_NUMAQ && !CPU_386 && !CPU_486 && !CPU_586 && !X86_ELAN && !CPU_WINCHIPC6
 	default y
 
 config X86_MCE
@@ -603,8 +662,6 @@
 
 	  To compile this driver as a module, choose M here: the
 	  module will be called microcode.
-	  If you use modprobe or kmod you may also want to add the line
-	  'alias char-major-10-184 microcode' to your /etc/modules.conf file.
 
 config X86_MSR
 	tristate "/dev/cpu/*/msr - Model-specific register support"
@@ -821,6 +878,19 @@
 	depends on (((X86_SUMMIT || X86_GENERICARCH) && NUMA) || (X86 && EFI))
 	default y
 
+config REGPARM
+	bool "Use register arguments (EXPERIMENTAL)"
+	depends on EXPERIMENTAL
+	default n
+	help
+	Compile the kernel with -mregparm=3. This uses an different ABI
+	and passes the first three arguments of a function call in registers.
+	This will probably break binary only modules.
+
+	This feature is only enabled for gcc-3.0 and later - earlier compilers
+	generate incorrect output with certain kernel constructs when
+	-mregparm=3 is used.
+
 endmenu
 
 
@@ -1030,12 +1100,16 @@
 	  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".
+	  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 "MMConfig", then PCI Express MMCONFIG will be used.
+	  If you choose "Any", the kernel will try MMCONFIG, then 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_GOMMCONFIG
+	bool "MMConfig"
 
 config PCI_GODIRECT
 	bool "Direct"
@@ -1055,6 +1129,12 @@
  	depends on PCI && ((PCI_GODIRECT || PCI_GOANY) || X86_VISWS)
 	default y
 
+config PCI_MMCONFIG
+	bool
+	depends on PCI && (PCI_GOMMCONFIG || PCI_GOANY)
+	select ACPI_BOOT
+	default y
+
 config PCI_USE_VECTOR
 	bool "Vector-based interrupt indexing"
 	depends on X86_LOCAL_APIC && X86_IO_APIC
@@ -1149,6 +1229,15 @@
 	  agent" (/sbin/hotplug) to load modules and set up software needed
 	  to use devices as you hotplug them.
 
+config HOTPLUG_CPU
+	bool "Support for hot-pluggable CPUs (EXPERIMENTAL)"
+	depends on SMP && HOTPLUG && EXPERIMENTAL
+	---help---
+	  Say Y here to experiment with turning CPUs off and on.  CPUs
+	  can be controlled through /sys/devices/system/cpu.
+
+	  Say N.
+
 source "drivers/pcmcia/Kconfig"
 
 source "drivers/pci/hotplug/Kconfig"
@@ -1231,6 +1320,15 @@
 	  This results in a large slowdown, but helps to find certain types
 	  of memory corruptions.
 
+config SPINLINE
+	bool "Spinlock inlining"
+	depends on DEBUG_KERNEL
+	help
+	  This will change spinlocks from out of line to inline, making them
+	  account cost to the callers in readprofile, rather than the lock
+	  itself (as ".text.lock.filename"). This can be helpful for finding
+	  the callers of locks.
+
 config DEBUG_HIGHMEM
 	bool "Highmem debugging"
 	depends on DEBUG_KERNEL && HIGHMEM
@@ -1247,20 +1345,208 @@
 	  Say Y here only if you plan to use gdb to debug the kernel.
 	  If you don't debug the kernel, you can say N.
 	  
+config LOCKMETER
+	bool "Kernel lock metering"
+	depends on SMP
+	help
+	  Say Y to enable kernel lock metering, which adds overhead to SMP locks,
+	  but allows you to see various statistics using the lockstat command.
+
 config DEBUG_SPINLOCK_SLEEP
 	bool "Sleep-inside-spinlock checking"
 	help
 	  If you say Y here, various routines which may sleep will become very
 	  noisy if they are called with a spinlock held.	
 
+config KGDB
+	bool "Include kgdb kernel debugger"
+	depends on DEBUG_KERNEL
+	help
+	  If you say Y here, the system will be compiled with the debug
+	  option (-g) and a debugging stub will be included in the
+	  kernel.  This stub communicates with gdb on another (host)
+	  computer via a serial port.  The host computer should have
+	  access to the kernel binary file (vmlinux) and a serial port
+	  that is connected to the target machine.  Gdb can be made to
+	  configure the serial port or you can use stty and setserial to
+	  do this. See the 'target' command in gdb. This option also
+	  configures in the ability to request a breakpoint early in the
+	  boot process.  To request the breakpoint just include 'kgdb'
+	  as a boot option when booting the target machine.  The system
+	  will then break as soon as it looks at the boot options.  This
+	  option also installs a breakpoint in panic and sends any
+	  kernel faults to the debugger. For more information see the
+	  Documentation/i386/kgdb/kgdb.txt file.
+
+choice
+	depends on KGDB
+    	prompt "Debug serial port BAUD"
+	default KGDB_115200BAUD
+	help
+	  Gdb and the kernel stub need to agree on the baud rate to be
+	  used.  Some systems (x86 family at this writing) allow this to
+	  be configured.
+
+config KGDB_9600BAUD
+	bool "9600"
+
+config KGDB_19200BAUD
+	bool "19200"
+
+config KGDB_38400BAUD
+	bool "38400"
+
+config KGDB_57600BAUD
+	bool "57600"
+
+config KGDB_115200BAUD
+	bool "115200"
+endchoice
+
+config KGDB_PORT
+	hex "hex I/O port address of the debug serial port"
+	depends on KGDB
+	default  3f8
+	help
+	  Some systems (x86 family at this writing) allow the port
+	  address to be configured.  The number entered is assumed to be
+	  hex, don't put 0x in front of it.  The standard address are:
+	  COM1 3f8 , irq 4 and COM2 2f8 irq 3.  Setserial /dev/ttySx
+	  will tell you what you have.  It is good to test the serial
+	  connection with a live system before trying to debug.
+
+config KGDB_IRQ
+	int "IRQ of the debug serial port"
+	depends on KGDB
+	default 4
+	help
+	  This is the irq for the debug port.  If everything is working
+	  correctly and the kernel has interrupts on a control C to the
+	  port should cause a break into the kernel debug stub.
+
+config DEBUG_INFO
+	bool
+	depends on KGDB
+	default y
+
+config KGDB_MORE
+	bool "Add any additional compile options"
+	depends on KGDB
+	default n
+	help
+	  Saying yes here turns on the ability to enter additional
+	  compile options.
+
+
+config KGDB_OPTIONS
+	depends on KGDB_MORE
+	string "Additional compile arguments"
+	default "-O1"
+	help
+	  This option allows you enter additional compile options for
+	  the whole kernel compile.  Each platform will have a default
+	  that seems right for it.  For example on PPC "-ggdb -O1", and
+	  for i386 "-O1".  Note that by configuring KGDB "-g" is already
+	  turned on.  In addition, on i386 platforms
+	  "-fomit-frame-pointer" is deleted from the standard compile
+	  options.
+
+config NO_KGDB_CPUS
+	int "Number of CPUs"
+	depends on KGDB && SMP
+	default NR_CPUS
+	help
+
+	  This option sets the number of cpus for kgdb ONLY.  It is used
+	  to prune some internal structures so they look "nice" when
+	  displayed with gdb.  This is to overcome possibly larger
+	  numbers that may have been entered above.  Enter the real
+	  number to get nice clean kgdb_info displays.
+
+config KGDB_TS
+	bool "Enable kgdb time stamp macros?"
+	depends on KGDB
+	default n
+	help
+	  Kgdb event macros allow you to instrument your code with calls
+	  to the kgdb event recording function.  The event log may be
+	  examined with gdb at a break point.  Turning on this
+	  capability also allows you to choose how many events to
+	  keep. Kgdb always keeps the lastest events.
+
+choice
+	depends on KGDB_TS
+	prompt "Max number of time stamps to save?"
+	default KGDB_TS_128
+
+config KGDB_TS_64
+	bool "64"
+
+config KGDB_TS_128
+	bool "128"
+
+config KGDB_TS_256
+	bool "256"
+
+config KGDB_TS_512
+	bool "512"
+
+config KGDB_TS_1024
+	bool "1024"
+
+endchoice
+
+config STACK_OVERFLOW_TEST
+	bool "Turn on kernel stack overflow testing?"
+	depends on KGDB
+	default n
+	help
+	  This option enables code in the front line interrupt handlers
+	  to check for kernel stack overflow on interrupts and system
+	  calls.  This is part of the kgdb code on x86 systems.
+
+config KGDB_CONSOLE
+	bool "Enable serial console thru kgdb port"
+	depends on KGDB
+	default n
+	help
+	  This option enables the command line "console=kgdb" option.
+	  When the system is booted with this option in the command line
+	  all kernel printk output is sent to gdb (as well as to other
+	  consoles).  For this to work gdb must be connected.  For this
+	  reason, this command line option will generate a breakpoint if
+	  gdb has not yet connected.  After the gdb continue command is
+	  given all pent up console output will be printed by gdb on the
+	  host machine.  Neither this option, nor KGDB require the
+	  serial driver to be configured.
+
+config KGDB_SYSRQ
+	bool "Turn on SysRq 'G' command to do a break?"
+	depends on KGDB
+	default y
+	help
+	  This option includes an option in the SysRq code that allows
+	  you to enter SysRq G which generates a breakpoint to the KGDB
+	  stub.  This will work if the keyboard is alive and can
+	  interrupt the system.  Because of constraints on when the
+	  serial port interrupt can be enabled, this code may allow you
+	  to interrupt the system before the serial port control C is
+	  available.  Just say yes here.
+
 config FRAME_POINTER
 	bool "Compile the kernel with frame pointers"
+	default 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.
 
+config MAGIC_SYSRQ
+	bool
+	depends on KGDB_SYSRQ
+	default y
+
 config X86_FIND_SMP_CONFIG
 	bool
 	depends on X86_LOCAL_APIC || X86_VOYAGER
--- diff/arch/i386/Makefile	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/i386/Makefile	2004-02-09 10:39:50.000000000 +0000
@@ -19,33 +19,63 @@
 OBJCOPYFLAGS	:= -O binary -R .note -R .comment -S
 LDFLAGS_vmlinux :=
 
-CFLAGS += -pipe
+CFLAGS += -pipe -msoft-float
 
 # prevent gcc from keeping the stack 16 byte aligned
 CFLAGS += $(call check_gcc,-mpreferred-stack-boundary=2,)
 
 align := $(subst -functions=0,,$(call check_gcc,-falign-functions=0,-malign-functions=0))
 
-cflags-$(CONFIG_M386)		+= -march=i386
-cflags-$(CONFIG_M486)		+= -march=i486
-cflags-$(CONFIG_M586)		+= -march=i586
-cflags-$(CONFIG_M586TSC)	+= -march=i586
-cflags-$(CONFIG_M586MMX)	+= $(call check_gcc,-march=pentium-mmx,-march=i586)
-cflags-$(CONFIG_M686)		+= -march=i686
-cflags-$(CONFIG_MPENTIUMII)	+= $(call check_gcc,-march=pentium2,-march=i686)
-cflags-$(CONFIG_MPENTIUMIII)	+= $(call check_gcc,-march=pentium3,-march=i686)
-cflags-$(CONFIG_MPENTIUM4)	+= $(call check_gcc,-march=pentium4,-march=i686)
-cflags-$(CONFIG_MK6)		+= $(call check_gcc,-march=k6,-march=i586)
+cflags-$(CONFIG_CPU_PENTIUM4)	:= $(call check_gcc,-march=pentium4,-march=i686)
+
+ifdef CONFIG_CPU_PENTIUM4
+  cflags-$(CONFIG_CPU_K8)	:= $(call check_gcc,-march=pentium3,-march=i686)
+else
+  cflags-$(CONFIG_CPU_K8)	:= $(call check_gcc,-march=k8,$(call check_gcc,-march=athlon,-march=i686 $(align)-functions=4))
+endif
+
 # Please note, that patches that add -march=athlon-xp and friends are pointless.
 # They make zero difference whatsosever to performance at this time.
-cflags-$(CONFIG_MK7)		+= $(call check_gcc,-march=athlon,-march=i686 $(align)-functions=4)
-cflags-$(CONFIG_MK8)		+= $(call check_gcc,-march=k8,$(call check_gcc,-march=athlon,-march=i686 $(align)-functions=4))
-cflags-$(CONFIG_MCRUSOE)	+= -march=i686 $(align)-functions=0 $(align)-jumps=0 $(align)-loops=0
-cflags-$(CONFIG_MWINCHIPC6)	+= $(call check_gcc,-march=winchip-c6,-march=i586)
-cflags-$(CONFIG_MWINCHIP2)	+= $(call check_gcc,-march=winchip2,-march=i586)
-cflags-$(CONFIG_MWINCHIP3D)	+= $(call check_gcc,-march=winchip2,-march=i586)
-cflags-$(CONFIG_MCYRIXIII)	+= $(call check_gcc,-march=c3,-march=i486) $(align)-functions=0 $(align)-jumps=0 $(align)-loops=0
-cflags-$(CONFIG_MVIAC3_2)	+= $(call check_gcc,-march=c3-2,-march=i686)
+ifdef CONFIG_CPU_PENTIUM4
+  cflags-$(CONFIG_CPU_K7)	:= $(call check_gcc,-march=pentium3,-march=i686)
+else
+  cflags-$(CONFIG_CPU_K7)	:= $(call check_gcc,-march=athlon,-march=i686 $(align)-functions=4)
+endif
+
+cflags-$(CONFIG_CPU_PENTIUMM)		:= $(call check_gcc,-march=pentium3,-march=i686)
+cflags-$(CONFIG_CPU_PENTIUMIII)	:= $(call check_gcc,-march=pentium3,-march=i686)
+cflags-$(CONFIG_CPU_PENTIUMII)	:= $(call check_gcc,-march=pentium2,-march=i686)
+cflags-$(CONFIG_CPU_VIAC3_2)  	:= $(call check_gcc,-march=c3-2,-march=i686)
+cflags-$(CONFIG_CPU_CRUSOE)		:= -march=i686 $(align)-functions=0 $(align)-jumps=0 $(align)-loops=0
+cflags-$(CONFIG_CPU_686)      	:= -march=i686
+
+# supports i686 without cmov
+cflags-$(CONFIG_CPU_CYRIXIII)	:= $(call check_gcc,-march=c3,-march=i486) $(align)-functions=0 $(align)-jumps=0 $(align)-loops=0
+
+cflags-$(CONFIG_CPU_K6)	:= -march=k6
+cflags-$(CONFIG_CPU_586MMX)	:= $(call check_gcc,-march=pentium-mmx,-march=i586)
+
+# Winchip supports i586
+cflags-$(CONFIG_CPU_WINCHIPC6)	:= $(call check_gcc,-march=winchip-c6,-march=i486)
+cflags-$(CONFIG_CPU_WINCHIP2)		:= $(call check_gcc,-march=winchip2,-march=i486)
+cflags-$(CONFIG_CPU_WINCHIP3D)	:= $(call check_gcc,-march=winchip2,-march=i486)
+
+cflags-$(CONFIG_CPU_586TSC)	:= -march=i586
+cflags-$(CONFIG_CPU_586)	:= -march=i586
+cflags-$(CONFIG_CPU_486)	:= -march=i486
+cflags-$(CONFIG_CPU_386)	:= -march=i386
+
+# AMD Elan support
+cflags-$(CONFIG_X86_ELAN)	:= -march=i486
+
+# -mregparm=3 works ok on gcc-3.0 and later
+#
+GCC_VERSION			:= $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-version.sh $(CC))
+cflags-$(CONFIG_REGPARM) 	+= $(shell if [ $(GCC_VERSION) -ge 0300 ] ; then echo "-mregparm=3"; fi ;)
+
+# Enable unit-at-a-time mode when possible. It shrinks the
+# kernel considerably.
+CFLAGS += $(call check_gcc,-funit-at-a-time,)
 
 CFLAGS += $(cflags-y)
 
@@ -84,6 +114,9 @@
 # default subarch .h files
 mflags-y += -Iinclude/asm-i386/mach-default
 
+mflags-$(CONFIG_KGDB) += -gdwarf-2
+mflags-$(CONFIG_KGDB_MORE) += $(shell echo $(CONFIG_KGDB_OPTIONS) | sed -e 's/"//g')
+
 head-y := arch/i386/kernel/head.o arch/i386/kernel/init_task.o
 
 libs-y 					+= arch/i386/lib/
--- diff/arch/i386/boot/compressed/misc.c	2003-09-30 15:46:11.000000000 +0100
+++ source/arch/i386/boot/compressed/misc.c	2004-02-09 10:39:50.000000000 +0000
@@ -104,7 +104,7 @@
 static void *malloc(int size);
 static void free(void *where);
 
-static void puts(const char *);
+static void putstr(const char *);
 
 extern int end;
 static long free_mem_ptr = (long)&end;
@@ -169,7 +169,7 @@
 		vidmem[i] = ' ';
 }
 
-static void puts(const char *s)
+static void putstr(const char *s)
 {
 	int x,y,pos;
 	char c;
@@ -287,9 +287,9 @@
 
 static void error(char *x)
 {
-	puts("\n\n");
-	puts(x);
-	puts("\n\n -- System halted");
+	putstr("\n\n");
+	putstr(x);
+	putstr("\n\n -- System halted");
 
 	while(1);	/* Halt */
 }
@@ -373,9 +373,9 @@
 	else setup_output_buffer_if_we_run_high(mv);
 
 	makecrc();
-	puts("Uncompressing Linux... ");
+	putstr("Uncompressing Linux... ");
 	gunzip();
-	puts("Ok, booting the kernel.\n");
+	putstr("Ok, booting the kernel.\n");
 	if (high_loaded) close_output_buffer_if_we_run_high(mv);
 	return high_loaded;
 }
--- diff/arch/i386/boot/setup.S	2004-02-09 10:36:07.000000000 +0000
+++ source/arch/i386/boot/setup.S	2004-02-09 10:39:50.000000000 +0000
@@ -49,6 +49,8 @@
  * by Matt Domsch <Matt_Domsch@dell.com> October 2002
  * conformant to T13 Committee www.t13.org
  *   projects 1572D, 1484D, 1386D, 1226DT
+ * disk signature read by Matt Domsch <Matt_Domsch@dell.com>
+ *	and Andrew Wilks <Andrew_Wilks@dell.com> September 2003
  */
 
 #include <linux/config.h>
@@ -162,7 +164,7 @@
 					# can be located anywhere in
 					# low memory 0x10000 or higher.
 
-ramdisk_max:	.long MAXMEM-1		# (Header version 0x0203 or later)
+ramdisk_max:	.long __MAXMEM-1	# (Header version 0x0203 or later)
 					# The highest safe address for
 					# the contents of an initrd
 
@@ -578,6 +580,25 @@
 #endif
 
 #if defined(CONFIG_EDD) || defined(CONFIG_EDD_MODULE)
+# Read the first sector of device 80h and store the 4-byte signature
+	movl	$0xFFFFFFFF, %eax
+	movl	%eax, (DISK80_SIG_BUFFER)	# assume failure
+	movb	$READ_SECTORS, %ah
+	movb	$1, %al				# read 1 sector
+	movb	$0x80, %dl			# from device 80
+	movb	$0, %dh				# at head 0
+	movw	$1, %cx				# cylinder 0, sector 0
+	pushw	%es
+	pushw	%ds
+	popw	%es
+	movw	$EDDBUF, %bx
+	int	$0x13
+	jc	disk_sig_done
+	movl	(EDDBUF+MBR_SIG_OFFSET), %eax
+	movl	%eax, (DISK80_SIG_BUFFER)	# store success
+disk_sig_done:
+	popw	%es
+
 # Do the BIOS Enhanced Disk Drive calls
 # This consists of two calls:
 #    int 13h ah=41h "Check Extensions Present"
@@ -755,7 +776,7 @@
 # AMD Elan bug fix by Robert Schwebel.
 #
 
-#if defined(CONFIG_MELAN)
+#if defined(CONFIG_X86_ELAN)
 	movb $0x02, %al			# alternate A20 gate
 	outb %al, $0x92			# this works on SC410/SC520
 a20_elan_wait:
--- diff/arch/i386/kernel/Makefile	2004-01-19 10:22:55.000000000 +0000
+++ source/arch/i386/kernel/Makefile	2004-02-09 10:39:50.000000000 +0000
@@ -7,13 +7,14 @@
 obj-y	:= process.o semaphore.o signal.o entry.o traps.o irq.o vm86.o \
 		ptrace.o i8259.o ioport.o ldt.o setup.o time.o sys_i386.o \
 		pci-dma.o i386_ksyms.o i387.o dmi_scan.o bootflag.o \
-		doublefault.o
+		doublefault.o entry_trampoline.o
 
 obj-y				+= cpu/
 obj-y				+= timers/
 obj-$(CONFIG_ACPI_BOOT)		+= acpi/
 obj-$(CONFIG_X86_BIOS_REBOOT)	+= reboot.o
 obj-$(CONFIG_MCA)		+= mca.o
+obj-$(CONFIG_KGDB)		+= kgdb_stub.o
 obj-$(CONFIG_X86_MSR)		+= msr.o
 obj-$(CONFIG_X86_CPUID)		+= cpuid.o
 obj-$(CONFIG_MICROCODE)		+= microcode.o
--- diff/arch/i386/kernel/acpi/boot.c	2004-02-09 10:36:07.000000000 +0000
+++ source/arch/i386/kernel/acpi/boot.c	2004-02-09 10:39:50.000000000 +0000
@@ -27,11 +27,14 @@
 #include <linux/config.h>
 #include <linux/acpi.h>
 #include <linux/efi.h>
+#include <linux/irq.h>
 #include <asm/pgalloc.h>
 #include <asm/io_apic.h>
 #include <asm/apic.h>
 #include <asm/io.h>
+#include <asm/irq.h>
 #include <asm/mpspec.h>
+#include <asm/irq.h>
 
 #if defined (CONFIG_X86_LOCAL_APIC)
 #include <mach_apic.h>
@@ -44,8 +47,8 @@
 int acpi_noirq __initdata = 0;	/* skip ACPI IRQ initialization */
 int acpi_ht __initdata = 1;	/* enable HT */
 
-int acpi_lapic = 0;
-int acpi_ioapic = 0;
+int acpi_lapic;
+int acpi_ioapic;
 
 /* --------------------------------------------------------------------------
                               Boot-time Configuration
@@ -94,6 +97,27 @@
 }
 
 
+#ifdef CONFIG_PCI_MMCONFIG
+static int __init acpi_parse_mcfg(unsigned long phys_addr, unsigned long size)
+{
+	struct acpi_table_mcfg *mcfg;
+
+	if (!phys_addr || !size)
+		return -EINVAL;
+
+	mcfg = (struct acpi_table_mcfg *) __acpi_map_table(phys_addr, size);
+	if (!mcfg) {
+		printk(KERN_WARNING PREFIX "Unable to map MCFG\n");
+		return -ENODEV;
+	}
+
+	if (mcfg->base_address)
+		pci_mmcfg_base_addr = mcfg->base_address;
+
+	return 0;
+}
+#endif /* CONFIG_PCI_MMCONFIG */
+
 #ifdef CONFIG_X86_LOCAL_APIC
 
 static u64 acpi_lapic_addr __initdata = APIC_DEFAULT_PHYS_BASE;
@@ -311,7 +335,14 @@
 
 #endif /* CONFIG_ACPI_BUS */
 
-
+#ifdef CONFIG_X86_IO_APIC
+int acpi_irq_to_vector(u32 irq)
+{
+	if (use_pci_vector() && !platform_legacy_irq(irq))
+ 		irq = IO_APIC_VECTOR(irq);
+	return irq;
+}
+#endif
 
 static unsigned long __init
 acpi_scan_rsdp (
@@ -326,7 +357,7 @@
 	 * RSDP signature.
 	 */
 	for (offset = 0; offset < length; offset += 16) {
-		if (strncmp((char *) (start + offset), "RSD PTR ", sig_len))
+		if (strncmp((char *) __va(start + offset), "RSD PTR ", sig_len))
 			continue;
 		return (start + offset);
 	}
@@ -363,6 +394,37 @@
 }
 #endif
 
+/* detect the location of the ACPI PM Timer */
+#ifdef CONFIG_X86_PM_TIMER
+extern u32 pmtmr_ioport;
+
+static int __init acpi_parse_fadt(unsigned long phys, unsigned long size)
+{
+	struct fadt_descriptor_rev2 *fadt =0;
+
+	fadt = (struct fadt_descriptor_rev2*) __acpi_map_table(phys,size);
+	if(!fadt) {
+		printk(KERN_WARNING PREFIX "Unable to map FADT\n");
+		return 0;
+	}
+
+	if (fadt->revision >= FADT2_REVISION_ID) {
+		/* FADT rev. 2 */
+		if (fadt->xpm_tmr_blk.address_space_id != ACPI_ADR_SPACE_SYSTEM_IO)
+			return 0;
+
+		pmtmr_ioport = fadt->xpm_tmr_blk.address;
+	} else {
+		/* FADT rev. 1 */
+		pmtmr_ioport = fadt->V1_pm_tmr_blk;
+	}
+	if (pmtmr_ioport)
+		printk(KERN_INFO PREFIX "PM-Timer IO Port: %#x\n", pmtmr_ioport);
+	return 0;
+}
+#endif
+
+
 unsigned long __init
 acpi_find_rsdp (void)
 {
@@ -435,6 +497,10 @@
 		return result;
 	}
 
+#ifdef CONFIG_X86_PM_TIMER
+	acpi_table_parse(ACPI_FADT, acpi_parse_fadt);
+#endif
+
 #ifdef CONFIG_X86_LOCAL_APIC
 
 	/* 
@@ -463,7 +529,7 @@
 	 * and (optionally) overriden by a LAPIC_ADDR_OVR entry (64-bit value).
 	 */
 
-	result = acpi_table_parse_madt(ACPI_MADT_LAPIC_ADDR_OVR, acpi_parse_lapic_addr_ovr);
+	result = acpi_table_parse_madt(ACPI_MADT_LAPIC_ADDR_OVR, acpi_parse_lapic_addr_ovr, 0);
 	if (result < 0) {
 		printk(KERN_ERR PREFIX "Error parsing LAPIC address override entry\n");
 		return result;
@@ -471,7 +537,8 @@
 
 	mp_register_lapic_address(acpi_lapic_addr);
 
-	result = acpi_table_parse_madt(ACPI_MADT_LAPIC, acpi_parse_lapic);
+	result = acpi_table_parse_madt(ACPI_MADT_LAPIC, acpi_parse_lapic,
+				       MAX_APICS);
 	if (!result) { 
 		printk(KERN_ERR PREFIX "No LAPIC entries present\n");
 		/* TBD: Cleanup to allow fallback to MPS */
@@ -483,7 +550,7 @@
 		return result;
 	}
 
-	result = acpi_table_parse_madt(ACPI_MADT_LAPIC_NMI, acpi_parse_lapic_nmi);
+	result = acpi_table_parse_madt(ACPI_MADT_LAPIC_NMI, acpi_parse_lapic_nmi, 0);
 	if (result < 0) {
 		printk(KERN_ERR PREFIX "Error parsing LAPIC NMI entry\n");
 		/* TBD: Cleanup to allow fallback to MPS */
@@ -520,8 +587,8 @@
 		return 1;
 	}
 
-	result = acpi_table_parse_madt(ACPI_MADT_IOAPIC, acpi_parse_ioapic);
-	if (!result) { 
+	result = acpi_table_parse_madt(ACPI_MADT_IOAPIC, acpi_parse_ioapic, MAX_IO_APICS);
+	if (!result) {
 		printk(KERN_ERR PREFIX "No IOAPIC entries present\n");
 		return -ENODEV;
 	}
@@ -533,14 +600,14 @@
 	/* Build a default routing table for legacy (ISA) interrupts. */
 	mp_config_acpi_legacy_irqs();
 
-	result = acpi_table_parse_madt(ACPI_MADT_INT_SRC_OVR, acpi_parse_int_src_ovr);
+	result = acpi_table_parse_madt(ACPI_MADT_INT_SRC_OVR, acpi_parse_int_src_ovr, NR_IRQ_VECTORS);
 	if (result < 0) {
 		printk(KERN_ERR PREFIX "Error parsing interrupt source overrides entry\n");
 		/* TBD: Cleanup to allow fallback to MPS */
 		return result;
 	}
 
-	result = acpi_table_parse_madt(ACPI_MADT_NMI_SRC, acpi_parse_nmi_src);
+	result = acpi_table_parse_madt(ACPI_MADT_NMI_SRC, acpi_parse_nmi_src, NR_IRQ_VECTORS);
 	if (result < 0) {
 		printk(KERN_ERR PREFIX "Error parsing NMI SRC entry\n");
 		/* TBD: Cleanup to allow fallback to MPS */
@@ -555,6 +622,19 @@
 
 #endif /* CONFIG_X86_IO_APIC && CONFIG_ACPI_INTERPRETER */
 
+#ifdef CONFIG_PCI_MMCONFIG
+	result = acpi_table_parse(ACPI_MCFG, acpi_parse_mcfg);
+	if (!result) {
+		printk(KERN_WARNING PREFIX "MCFG not present\n");
+		return 0;
+	} else if (result < 0) {
+		printk(KERN_ERR PREFIX "Error parsing MCFG\n");
+		return result;
+	} else if (result > 1) {
+		printk(KERN_WARNING PREFIX "Multiple MCFG tables exist\n");
+	}
+#endif /* CONFIG_PCI_MMCONFIG */
+
 #ifdef CONFIG_X86_LOCAL_APIC
 	if (acpi_lapic && acpi_ioapic) {
 		smp_found_config = 1;
--- diff/arch/i386/kernel/asm-offsets.c	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/i386/kernel/asm-offsets.c	2004-02-09 10:39:50.000000000 +0000
@@ -4,9 +4,11 @@
  * to extract and format the required data.
  */
 
+#include <linux/sched.h>
 #include <linux/signal.h>
 #include <asm/ucontext.h>
 #include "sigframe.h"
+#include <asm/fixmap.h>
 
 #define DEFINE(sym, val) \
         asm volatile("\n->" #sym " %0 " #val : : "i" (val))
@@ -28,4 +30,17 @@
 
 	DEFINE(RT_SIGFRAME_sigcontext,
 	       offsetof (struct rt_sigframe, uc.uc_mcontext));
+	DEFINE(TI_task, offsetof (struct thread_info, task));
+	DEFINE(TI_exec_domain, offsetof (struct thread_info, exec_domain));
+	DEFINE(TI_flags, offsetof (struct thread_info, flags));
+	DEFINE(TI_preempt_count, offsetof (struct thread_info, preempt_count));
+	DEFINE(TI_addr_limit, offsetof (struct thread_info, addr_limit));
+	DEFINE(TI_real_stack, offsetof (struct thread_info, real_stack));
+	DEFINE(TI_virtual_stack, offsetof (struct thread_info, virtual_stack));
+	DEFINE(TI_user_pgd, offsetof (struct thread_info, user_pgd));
+
+	DEFINE(FIX_ENTRY_TRAMPOLINE_0_addr, __fix_to_virt(FIX_ENTRY_TRAMPOLINE_0));
+	DEFINE(FIX_VSYSCALL_addr, __fix_to_virt(FIX_VSYSCALL));
+	DEFINE(PAGE_SIZE_asm, PAGE_SIZE);
+	DEFINE(task_thread_db7, offsetof (struct task_struct, thread.debugreg[7]));
 }
--- diff/arch/i386/kernel/cpu/centaur.c	2003-05-21 11:49:49.000000000 +0100
+++ source/arch/i386/kernel/cpu/centaur.c	2004-02-09 10:39:50.000000000 +0000
@@ -246,7 +246,15 @@
 	lo&=~0x1C0;	/* blank bits 8-6 */
 	wrmsr(MSR_IDT_MCR_CTRL, lo, hi);
 }
-#endif
+#endif /* CONFIG_X86_OOSTORE */
+
+#define ACE_PRESENT	(1 << 6)
+#define ACE_ENABLED	(1 << 7)
+#define ACE_FCR		(1 << 28)	/* MSR_VIA_FCR */
+
+#define RNG_PRESENT	(1 << 2)
+#define RNG_ENABLED	(1 << 3)
+#define RNG_ENABLE	(1 << 6)	/* MSR_VIA_RNG */
 
 static void __init init_c3(struct cpuinfo_x86 *c)
 {
@@ -254,6 +262,24 @@
 
 	/* Test for Centaur Extended Feature Flags presence */
 	if (cpuid_eax(0xC0000000) >= 0xC0000001) {
+		u32 tmp = cpuid_edx(0xC0000001);
+
+		/* enable ACE unit, if present and disabled */
+		if ((tmp & (ACE_PRESENT | ACE_ENABLED)) == ACE_PRESENT) {
+			rdmsr (MSR_VIA_FCR, lo, hi);
+			lo |= ACE_FCR;		/* enable ACE unit */
+			wrmsr (MSR_VIA_FCR, lo, hi);
+			printk(KERN_INFO "CPU: Enabled ACE h/w crypto\n");
+		}
+
+		/* enable RNG unit, if present and disabled */
+		if ((tmp & (RNG_PRESENT | RNG_ENABLED)) == RNG_PRESENT) {
+			rdmsr (MSR_VIA_RNG, lo, hi);
+			lo |= RNG_ENABLE;	/* enable RNG unit */
+			wrmsr (MSR_VIA_RNG, lo, hi);
+			printk(KERN_INFO "CPU: Enabled h/w RNG\n");
+		}
+
 		/* store Centaur Extended Feature Flags as
 		 * word 5 of the CPU capability bit array
 		 */
--- diff/arch/i386/kernel/cpu/common.c	2004-01-19 10:22:55.000000000 +0000
+++ source/arch/i386/kernel/cpu/common.c	2004-02-09 10:39:50.000000000 +0000
@@ -514,12 +514,16 @@
 	set_tss_desc(cpu,t);
 	cpu_gdt_table[cpu][GDT_ENTRY_TSS].b &= 0xfffffdff;
 	load_TR_desc();
-	load_LDT(&init_mm.context);
+	if (cpu)
+		load_LDT(&init_mm.context);
 
 	/* Set up doublefault TSS pointer in the GDT */
 	__set_tss_desc(cpu, GDT_ENTRY_DOUBLEFAULT_TSS, &doublefault_tss);
 	cpu_gdt_table[cpu][GDT_ENTRY_DOUBLEFAULT_TSS].b &= 0xfffffdff;
 
+	if (cpu)
+		trap_init_virtual_GDT();
+
 	/* Clear %fs and %gs. */
 	asm volatile ("xorl %eax, %eax; movl %eax, %fs; movl %eax, %gs");
 
--- diff/arch/i386/kernel/cpu/cpufreq/Kconfig	2004-02-09 10:36:07.000000000 +0000
+++ source/arch/i386/kernel/cpu/cpufreq/Kconfig	2004-02-09 10:39:50.000000000 +0000
@@ -54,7 +54,7 @@
 
 config ELAN_CPUFREQ
 	tristate "AMD Elan"
-	depends on CPU_FREQ_TABLE && MELAN
+	depends on CPU_FREQ_TABLE && X86_ELAN
 	---help---
 	  This adds the CPUFreq driver for AMD Elan SC400 and SC410
 	  processors.
--- diff/arch/i386/kernel/cpu/cpufreq/acpi.c	2004-02-09 10:36:07.000000000 +0000
+++ source/arch/i386/kernel/cpu/cpufreq/acpi.c	2004-02-09 10:39:50.000000000 +0000
@@ -1,9 +1,9 @@
 /*
- * acpi_processor_perf.c - ACPI Processor P-States Driver ($Revision: 1.3 $)
+ * acpi-cpufreq-io.c - ACPI Processor P-States Driver ($Revision: 1.3 $)
  *
  *  Copyright (C) 2001, 2002 Andy Grover <andrew.grover@intel.com>
  *  Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
- *  Copyright (C) 2002, 2003 Dominik Brodowski <linux@brodo.de>
+ *  Copyright (C) 2002 - 2004 Dominik Brodowski <linux@brodo.de>
  *
  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  *
@@ -42,7 +42,6 @@
 #define ACPI_PROCESSOR_CLASS		"processor"
 #define ACPI_PROCESSOR_DRIVER_NAME	"ACPI Processor P-States Driver"
 #define ACPI_PROCESSOR_DEVICE_NAME	"Processor"
-#define ACPI_PROCESSOR_FILE_PERFORMANCE	"performance"
 
 #define _COMPONENT		ACPI_PROCESSOR_COMPONENT
 ACPI_MODULE_NAME		("acpi_processor_perf")
@@ -52,184 +51,13 @@
 MODULE_LICENSE("GPL");
 
 
-static struct acpi_processor_performance	*performance;
-
-
-static int 
-acpi_processor_get_performance_control (
-	struct acpi_processor_performance *perf)
-{
-	int			result = 0;
-	acpi_status		status = 0;
-	struct acpi_buffer	buffer = {ACPI_ALLOCATE_BUFFER, NULL};
-	union acpi_object	*pct = NULL;
-	union acpi_object	obj = {0};
-	struct acpi_pct_register *reg = NULL;
-
-	ACPI_FUNCTION_TRACE("acpi_processor_get_performance_control");
-
-	status = acpi_evaluate_object(perf->pr->handle, "_PCT", NULL, &buffer);
-	if(ACPI_FAILURE(status)) {
-		ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _PCT\n"));
-		return_VALUE(-ENODEV);
-	}
-
-	pct = (union acpi_object *) buffer.pointer;
-	if (!pct || (pct->type != ACPI_TYPE_PACKAGE) 
-		|| (pct->package.count != 2)) {
-		ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid _PCT data\n"));
-		result = -EFAULT;
-		goto end;
-	}
-
-	/*
-	 * control_register
-	 */
-
-	obj = pct->package.elements[0];
-
-	if ((obj.type != ACPI_TYPE_BUFFER) 
-		|| (obj.buffer.length < sizeof(struct acpi_pct_register)) 
-		|| (obj.buffer.pointer == NULL)) {
-		ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 
-			"Invalid _PCT data (control_register)\n"));
-		result = -EFAULT;
-		goto end;
-	}
-
-	reg = (struct acpi_pct_register *) (obj.buffer.pointer);
-
-	if (reg->space_id != ACPI_ADR_SPACE_SYSTEM_IO) {
-		ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-			"Unsupported address space [%d] (control_register)\n",
-			(u32) reg->space_id));
-		result = -EFAULT;
-		goto end;
-	}
-
-	perf->control_register = (u16) reg->address;
-	perf->control_register_bit_width = reg->bit_width;
-	/*
-	 * status_register
-	 */
-
-	obj = pct->package.elements[1];
-
-	if ((obj.type != ACPI_TYPE_BUFFER) 
-		|| (obj.buffer.length < sizeof(struct acpi_pct_register)) 
-		|| (obj.buffer.pointer == NULL)) {
-		ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 
-			"Invalid _PCT data (status_register)\n"));
-		result = -EFAULT;
-		goto end;
-	}
-
-	reg = (struct acpi_pct_register *) (obj.buffer.pointer);
-
-	if (reg->space_id != ACPI_ADR_SPACE_SYSTEM_IO) {
-		ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-			"Unsupported address space [%d] (status_register)\n",
-			(u32) reg->space_id));
-		result = -EFAULT;
-		goto end;
-	}
-
-	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",
-		perf->control_register,
-		perf->status_register));
-
-end:
-	acpi_os_free(buffer.pointer);
-
-	return_VALUE(result);
-}
-
-
-static int 
-acpi_processor_get_performance_states (
-	struct acpi_processor_performance *	perf)
-{
-	int			result = 0;
-	acpi_status		status = AE_OK;
-	struct acpi_buffer	buffer = {ACPI_ALLOCATE_BUFFER, NULL};
-	struct acpi_buffer	format = {sizeof("NNNNNN"), "NNNNNN"};
-	struct acpi_buffer	state = {0, NULL};
-	union acpi_object 	*pss = NULL;
-	int			i = 0;
-
-	ACPI_FUNCTION_TRACE("acpi_processor_get_performance_states");
-
-	status = acpi_evaluate_object(perf->pr->handle, "_PSS", NULL, &buffer);
-	if(ACPI_FAILURE(status)) {
-		ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _PSS\n"));
-		return_VALUE(-ENODEV);
-	}
-
-	pss = (union acpi_object *) buffer.pointer;
-	if (!pss || (pss->type != ACPI_TYPE_PACKAGE)) {
-		ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid _PSS data\n"));
-		result = -EFAULT;
-		goto end;
-	}
-
-	ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found %d performance states\n", 
-		pss->package.count));
-
-	if (pss->package.count > ACPI_PROCESSOR_MAX_PERFORMANCE) {
-		perf->state_count = ACPI_PROCESSOR_MAX_PERFORMANCE;
-		ACPI_DEBUG_PRINT((ACPI_DB_INFO, 
-			"Limiting number of states to max (%d)\n", 
-			ACPI_PROCESSOR_MAX_PERFORMANCE));
-	}
-	else
-		perf->state_count = pss->package.count;
-
-	if (perf->state_count > 1)
-		perf->pr->flags.performance = 1;
-
-	for (i = 0; i < perf->state_count; i++) {
-
-		struct acpi_processor_px *px = &(perf->states[i]);
-
-		state.length = sizeof(struct acpi_processor_px);
-		state.pointer = px;
-
-		ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Extracting state %d\n", i));
-
-		status = acpi_extract_package(&(pss->package.elements[i]), 
-			&format, &state);
-		if (ACPI_FAILURE(status)) {
-			ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid _PSS data\n"));
-			result = -EFAULT;
-			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, 
-			(u32) px->core_frequency, 
-			(u32) px->power, 
-			(u32) px->transition_latency, 
-			(u32) px->bus_master_latency,
-			(u32) px->control, 
-			(u32) px->status));
-	}
+struct cpufreq_acpi_io {
+	struct acpi_processor_performance	acpi_data;
+	struct cpufreq_frequency_table		*freq_table;
+};
 
-end:
-	acpi_os_free(buffer.pointer);
+static struct cpufreq_acpi_io	*acpi_io_data[NR_CPUS];
 
-	return_VALUE(result);
-}
 
 static int
 acpi_processor_write_port(
@@ -270,7 +98,8 @@
 
 static int
 acpi_processor_set_performance (
-	struct acpi_processor_performance	*perf,
+	struct cpufreq_acpi_io	*data,
+	unsigned int		cpu,
 	int			state)
 {
 	u16			port = 0;
@@ -282,38 +111,19 @@
 
 	ACPI_FUNCTION_TRACE("acpi_processor_set_performance");
 
-	if (!perf || !perf->pr)
-		return_VALUE(-EINVAL);
-
-	if (!perf->pr->flags.performance)
-		return_VALUE(-ENODEV);
-
-	if (state >= perf->state_count) {
-		ACPI_DEBUG_PRINT((ACPI_DB_WARN, 
-			"Invalid target state (P%d)\n", state));
-		return_VALUE(-ENODEV);
-	}
-
-	if (state < perf->pr->performance_platform_limit) {
-		ACPI_DEBUG_PRINT((ACPI_DB_WARN, 
-			"Platform limit (P%d) overrides target state (P%d)\n",
-			perf->pr->performance_platform_limit, state));
-		return_VALUE(-ENODEV);
-	}
-
-	if (state == perf->state) {
+	if (state == data->acpi_data.state) {
 		ACPI_DEBUG_PRINT((ACPI_DB_INFO, 
 			"Already at target state (P%d)\n", state));
 		return_VALUE(0);
 	}
 
 	ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Transitioning from P%d to P%d\n",
-		perf->state, state));
+		data->acpi_data.state, state));
 
 	/* cpufreq frequency struct */
-	cpufreq_freqs.cpu = perf->pr->id;
-	cpufreq_freqs.old = perf->states[perf->state].core_frequency;
-	cpufreq_freqs.new = perf->states[state].core_frequency;
+	cpufreq_freqs.cpu = cpu;
+	cpufreq_freqs.old = data->freq_table[data->acpi_data.state].frequency;
+	cpufreq_freqs.new = data->freq_table[state].frequency;
 
 	/* notify cpufreq */
 	cpufreq_notify_transition(&cpufreq_freqs, CPUFREQ_PRECHANGE);
@@ -323,9 +133,9 @@
 	 * control_register.
 	 */
 
-	port = perf->control_register;
-	bit_width = perf->control_register_bit_width;
-	value = (u32) perf->states[state].control;
+	port = data->acpi_data.control_register.address;
+	bit_width = data->acpi_data.control_register.bit_width;
+	value = (u32) data->acpi_data.states[state].control;
 
 	ACPI_DEBUG_PRINT((ACPI_DB_INFO, 
 		"Writing 0x%08x to port 0x%04x\n", value, port));
@@ -344,12 +154,12 @@
 	 * giving up.
 	 */
 
-	port = perf->status_register;
-	bit_width = perf->status_register_bit_width;
+	port = data->acpi_data.status_register.address;
+	bit_width = data->acpi_data.status_register.bit_width;
 
 	ACPI_DEBUG_PRINT((ACPI_DB_INFO, 
 		"Looking for 0x%08x from port 0x%04x\n",
-		(u32) perf->states[state].status, port));
+		(u32) data->acpi_data.states[state].status, port));
 
 	for (i=0; i<100; i++) {
 		ret = acpi_processor_read_port(port, bit_width, &value);
@@ -358,7 +168,7 @@
 				"Invalid port width 0x%04x\n", bit_width));
 			return_VALUE(ret);
 		}
-		if (value == (u32) perf->states[state].status)
+		if (value == (u32) data->acpi_data.states[state].status)
 			break;
 		udelay(10);
 	}
@@ -366,7 +176,7 @@
 	/* notify cpufreq */
 	cpufreq_notify_transition(&cpufreq_freqs, CPUFREQ_POSTCHANGE);
 
-	if (value != (u32) perf->states[state].status) {
+	if (value != (u32) data->acpi_data.states[state].status) {
 		unsigned int tmp = cpufreq_freqs.new;
 		cpufreq_freqs.new = cpufreq_freqs.old;
 		cpufreq_freqs.old = tmp;
@@ -380,169 +190,33 @@
 		"Transition successful after %d microseconds\n",
 		i * 10));
 
-	perf->state = state;
+	data->acpi_data.state = state;
 
 	return_VALUE(0);
 }
 
 
-#ifdef CONFIG_X86_ACPI_CPUFREQ_PROC_INTF
-/* /proc/acpi/processor/../performance interface (DEPRECATED) */
-
-static int acpi_processor_perf_open_fs(struct inode *inode, struct file *file);
-static struct file_operations acpi_processor_perf_fops = {
-	.open 		= acpi_processor_perf_open_fs,
-	.read		= seq_read,
-	.llseek		= seq_lseek,
-	.release	= single_release,
-};
-
-static int acpi_processor_perf_seq_show(struct seq_file *seq, void *offset)
-{
-	struct acpi_processor	*pr = (struct acpi_processor *)seq->private;
-	int			i = 0;
-
-	ACPI_FUNCTION_TRACE("acpi_processor_perf_seq_show");
-
-	if (!pr)
-		goto end;
-
-	if (!pr->flags.performance || !pr->performance) {
-		seq_puts(seq, "<not supported>\n");
-		goto end;
-	}
-
-	seq_printf(seq, "state count:             %d\n"
-			"active state:            P%d\n",
-			pr->performance->state_count,
-			pr->performance->state);
-
-	seq_puts(seq, "states:\n");
-	for (i = 0; i < pr->performance->state_count; i++)
-		seq_printf(seq, "   %cP%d:                  %d MHz, %d mW, %d uS\n",
-			(i == pr->performance->state?'*':' '), i,
-			(u32) pr->performance->states[i].core_frequency,
-			(u32) pr->performance->states[i].power,
-			(u32) pr->performance->states[i].transition_latency);
-
-end:
-	return 0;
-}
-
-static int acpi_processor_perf_open_fs(struct inode *inode, struct file *file)
-{
-	return single_open(file, acpi_processor_perf_seq_show,
-						PDE(inode)->data);
-}
-
-static int
-acpi_processor_write_performance (
-        struct file		*file,
-        const char		__user *buffer,
-        size_t			count,
-        loff_t			*data)
-{
-	int			result = 0;
-	struct acpi_processor	*pr = (struct acpi_processor *) data;
-	char			state_string[12] = {'\0'};
-	unsigned int            new_state = 0;
-	struct cpufreq_policy   policy;
-
-	ACPI_FUNCTION_TRACE("acpi_processor_write_performance");
-
-	if (!pr || !pr->performance || (count > sizeof(state_string) - 1))
-		return_VALUE(-EINVAL);
-	
-	if (copy_from_user(state_string, buffer, count))
-		return_VALUE(-EFAULT);
-	
-	state_string[count] = '\0';
-	new_state = simple_strtoul(state_string, NULL, 0);
-
-	cpufreq_get_policy(&policy, pr->id);
-
-	policy.cpu = pr->id;
-	policy.max = pr->performance->states[new_state].core_frequency * 1000;
-
-	result = cpufreq_set_policy(&policy);
-	if (result)
-		return_VALUE(result);
-
-	return_VALUE(count);
-}
-
-static void
-acpi_cpufreq_add_file (
-	struct acpi_processor *pr)
-{
-	struct proc_dir_entry	*entry = NULL;
-	struct acpi_device	*device = NULL;
-
-	ACPI_FUNCTION_TRACE("acpi_cpufreq_addfile");
-
-	if (acpi_bus_get_device(pr->handle, &device))
-		return_VOID;
-
-	/* add file 'performance' [R/W] */
-	entry = create_proc_entry(ACPI_PROCESSOR_FILE_PERFORMANCE,
-		  S_IFREG|S_IRUGO|S_IWUSR, acpi_device_dir(device));
-	if (!entry)
-		ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-			"Unable to create '%s' fs entry\n",
-			ACPI_PROCESSOR_FILE_PERFORMANCE));
-	else {
-		entry->proc_fops = &acpi_processor_perf_fops;
-		entry->proc_fops->write = acpi_processor_write_performance;
-		entry->data = acpi_driver_data(device);
-	}
-	return_VOID;
-}
-
-static void
-acpi_cpufreq_remove_file (
-	struct acpi_processor *pr)
-{
-	struct acpi_device	*device = NULL;
-
-	ACPI_FUNCTION_TRACE("acpi_cpufreq_addfile");
-
-	if (acpi_bus_get_device(pr->handle, &device))
-		return_VOID;
-
-	/* remove file 'performance' */
-	remove_proc_entry(ACPI_PROCESSOR_FILE_PERFORMANCE,
-		  acpi_device_dir(device));
-
-	return_VOID;
-}
-
-#else
-static void acpi_cpufreq_add_file (struct acpi_processor *pr) { return; }
-static void acpi_cpufreq_remove_file (struct acpi_processor *pr) { return; }
-#endif /* CONFIG_X86_ACPI_CPUFREQ_PROC_INTF */
-
-
 static int
 acpi_cpufreq_target (
 	struct cpufreq_policy   *policy,
 	unsigned int target_freq,
 	unsigned int relation)
 {
-	struct acpi_processor_performance *perf = &performance[policy->cpu];
+	struct cpufreq_acpi_io *data = acpi_io_data[policy->cpu];
 	unsigned int next_state = 0;
 	unsigned int result = 0;
 
 	ACPI_FUNCTION_TRACE("acpi_cpufreq_setpolicy");
 
-	result = cpufreq_frequency_table_target(policy, 
-			&perf->freq_table[perf->pr->limit.state.px],
+	result = cpufreq_frequency_table_target(policy,
+			data->freq_table,
 			target_freq,
 			relation,
 			&next_state);
 	if (result)
 		return_VALUE(result);
 
-	result = acpi_processor_set_performance (perf, next_state);
+	result = acpi_processor_set_performance (data, policy->cpu, next_state);
 
 	return_VALUE(result);
 }
@@ -553,119 +227,110 @@
 	struct cpufreq_policy   *policy)
 {
 	unsigned int result = 0;
-	struct acpi_processor_performance *perf = &performance[policy->cpu];
+	struct cpufreq_acpi_io *data = acpi_io_data[policy->cpu];
 
 	ACPI_FUNCTION_TRACE("acpi_cpufreq_verify");
 
 	result = cpufreq_frequency_table_verify(policy, 
-			&perf->freq_table[perf->pr->limit.state.px]);
-
-	cpufreq_verify_within_limits(
-		policy, 
-		perf->states[perf->state_count - 1].core_frequency * 1000,
-		perf->states[perf->pr->limit.state.px].core_frequency * 1000);
+			data->freq_table);
 
 	return_VALUE(result);
 }
 
 
 static int
-acpi_processor_get_performance_info (
-	struct acpi_processor_performance	*perf)
-{
-	int			result = 0;
-	acpi_status		status = AE_OK;
-	acpi_handle		handle = NULL;
-
-	ACPI_FUNCTION_TRACE("acpi_processor_get_performance_info");
-
-	if (!perf || !perf->pr || !perf->pr->handle)
-		return_VALUE(-EINVAL);
-
-	status = acpi_get_handle(perf->pr->handle, "_PCT", &handle);
-	if (ACPI_FAILURE(status)) {
-		ACPI_DEBUG_PRINT((ACPI_DB_INFO, 
-			"ACPI-based processor performance control unavailable\n"));
-		return_VALUE(-ENODEV);
-	}
-
-	result = acpi_processor_get_performance_control(perf);
-	if (result)
-		return_VALUE(result);
-
-	result = acpi_processor_get_performance_states(perf);
-	if (result)
-		return_VALUE(result);
-
-	result = acpi_processor_get_platform_limit(perf->pr);
-	if (result)
-		return_VALUE(result);
-
-	return_VALUE(0);
-}
-
-
-static int
 acpi_cpufreq_cpu_init (
 	struct cpufreq_policy   *policy)
 {
 	unsigned int		i;
 	unsigned int		cpu = policy->cpu;
-	struct acpi_processor	*pr = NULL;
-	struct acpi_processor_performance *perf = &performance[policy->cpu];
-	struct acpi_device	*device;
+	struct cpufreq_acpi_io	*data;
 	unsigned int		result = 0;
 
 	ACPI_FUNCTION_TRACE("acpi_cpufreq_cpu_init");
 
-	acpi_processor_register_performance(perf, &pr, cpu);
+	data = kmalloc(sizeof(struct cpufreq_acpi_io), GFP_KERNEL);
+	if (!data)
+		return_VALUE(-ENOMEM);
+	memset(data, 0, sizeof(struct cpufreq_acpi_io));
 
-	pr = performance[cpu].pr;
-	if (!pr)
-		return_VALUE(-ENODEV);
+	acpi_io_data[cpu] = data;
 
-	result = acpi_processor_get_performance_info(perf);
+	result = acpi_processor_register_performance(&data->acpi_data, cpu);
 	if (result)
-		return_VALUE(-ENODEV);
+		goto err_free;
 
 	/* capability check */
-	if (!pr->flags.performance)
-		return_VALUE(-ENODEV);
+	if (data->acpi_data.state_count <= 1) {
+		ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "No P-States\n"));
+		result = -ENODEV;
+		goto err_unreg;
+	}
+	if ((data->acpi_data.control_register.space_id != ACPI_ADR_SPACE_SYSTEM_IO) ||
+	    (data->acpi_data.status_register.space_id != ACPI_ADR_SPACE_SYSTEM_IO)) {
+		ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Unsupported address space [%d, %d]\n",
+				  (u32) (data->acpi_data.control_register.space_id),
+				  (u32) (data->acpi_data.status_register.space_id)));
+		result = -ENODEV;
+		goto err_unreg;
+	}
+
+	/* alloc freq_table */
+	data->freq_table = kmalloc(sizeof(struct cpufreq_frequency_table) * (data->acpi_data.state_count + 1), GFP_KERNEL);
+	if (!data->freq_table) {
+		result = -ENOMEM;
+		goto err_unreg;
+	}
 
 	/* detect transition latency */
 	policy->cpuinfo.transition_latency = 0;
-	for (i=0;i<perf->state_count;i++) {
-		if ((perf->states[i].transition_latency * 1000) > policy->cpuinfo.transition_latency)
-			policy->cpuinfo.transition_latency = perf->states[i].transition_latency * 1000;
+	for (i=0; i<data->acpi_data.state_count; i++) {
+		if ((data->acpi_data.states[i].transition_latency * 1000) > policy->cpuinfo.transition_latency)
+			policy->cpuinfo.transition_latency = data->acpi_data.states[i].transition_latency * 1000;
 	}
 	policy->governor = CPUFREQ_DEFAULT_GOVERNOR;
-	policy->cur = perf->states[pr->limit.state.px].core_frequency * 1000;
+
+	/* 
+	 * The current speed is unknown and not detectable by ACPI... argh! Assume 
+	 * it's P0, it will be set to this value later during initialization.
+	 */
+	policy->cur = data->acpi_data.states[0].core_frequency * 1000;
 
 	/* table init */
-	for (i=0; i<=perf->state_count; i++)
+	for (i=0; i<=data->acpi_data.state_count; i++)
 	{
-		perf->freq_table[i].index = i;
-		if (i<perf->state_count)
-			perf->freq_table[i].frequency = perf->states[i].core_frequency * 1000;
+		data->freq_table[i].index = i;
+		if (i<data->acpi_data.state_count)
+			data->freq_table[i].frequency = data->acpi_data.states[i].core_frequency * 1000;
 		else
-			perf->freq_table[i].frequency = CPUFREQ_TABLE_END;
+			data->freq_table[i].frequency = CPUFREQ_TABLE_END;
 	}
 
-	result = cpufreq_frequency_table_cpuinfo(policy, &perf->freq_table[0]);
-
-	acpi_cpufreq_add_file(pr);
-
-	if (acpi_bus_get_device(pr->handle, &device))
-		device = NULL;
+	result = cpufreq_frequency_table_cpuinfo(policy, &data->freq_table[0]);
+	if (result) {
+		goto err_freqfree;
+	}
 		
-	printk(KERN_INFO "cpufreq: %s - ACPI performance management activated.\n",
-		device ? acpi_device_bid(device) : "CPU??");
-	for (i = 0; i < pr->performance->state_count; i++)
+
+	printk(KERN_INFO "cpufreq: CPU%u - ACPI performance management activated.\n",
+	       cpu);
+	for (i = 0; i < data->acpi_data.state_count; i++)
 		printk(KERN_INFO "cpufreq: %cP%d: %d MHz, %d mW, %d uS\n",
-			(i == pr->performance->state?'*':' '), i,
-			(u32) pr->performance->states[i].core_frequency,
-			(u32) pr->performance->states[i].power,
-			(u32) pr->performance->states[i].transition_latency);
+			(i == data->acpi_data.state?'*':' '), i,
+			(u32) data->acpi_data.states[i].core_frequency,
+			(u32) data->acpi_data.states[i].power,
+			(u32) data->acpi_data.states[i].transition_latency);
+
+	return_VALUE(result);
+
+ err_freqfree:
+	kfree(data->freq_table);
+ err_unreg:
+	acpi_processor_unregister_performance(&data->acpi_data, cpu);
+ err_free:
+	kfree(data);
+	acpi_io_data[cpu] = NULL;
+
 	return_VALUE(result);
 }
 
@@ -674,11 +339,16 @@
 acpi_cpufreq_cpu_exit (
 	struct cpufreq_policy   *policy)
 {
-	struct acpi_processor  *pr = performance[policy->cpu].pr;
+	struct cpufreq_acpi_io *data = acpi_io_data[policy->cpu];
+
 
 	ACPI_FUNCTION_TRACE("acpi_cpufreq_cpu_exit");
 
-	acpi_cpufreq_remove_file(pr);
+	if (data) {
+		acpi_io_data[policy->cpu] = NULL;
+		acpi_processor_unregister_performance(&data->acpi_data, policy->cpu);
+		kfree(data);
+	}
 
 	return_VALUE(0);
 }
@@ -698,97 +368,11 @@
 acpi_cpufreq_init (void)
 {
 	int                     result = 0;
-	int                     current_state = 0;
-	int                     i = 0;
-	struct acpi_processor   *pr = NULL;
-	struct acpi_processor_performance *perf = NULL;
 
 	ACPI_FUNCTION_TRACE("acpi_cpufreq_init");
 
-	/* alloc memory */
-	if (performance)
-		return_VALUE(-EBUSY);
-
-	performance = kmalloc(NR_CPUS * sizeof(struct acpi_processor_performance), GFP_KERNEL);
-	if (!performance)
-		return_VALUE(-ENOMEM);
-	memset(performance, 0, NR_CPUS * sizeof(struct acpi_processor_performance));
-
-	/* register struct acpi_processor_performance performance */
-	for (i=0; i<NR_CPUS; i++) {
-		if (cpu_online(i))
-			acpi_processor_register_performance(&performance[i], &pr, i);
-	}
-
-	/* initialize  */
-	for (i=0; i<NR_CPUS; i++) {
-		if (cpu_online(i) && performance[i].pr)
-			result = acpi_processor_get_performance_info(&performance[i]);
-	}
-
-	/* test it on one CPU */
-	for (i=0; i<NR_CPUS; i++) {
-		if (!cpu_online(i))
-			continue;
-		pr = performance[i].pr;
-		if (pr && pr->flags.performance)
-			goto found_capable_cpu;
-	}
-	result = -ENODEV;
-	goto err0;
-
- found_capable_cpu:
-	
  	result = cpufreq_register_driver(&acpi_cpufreq_driver);
-	if (result) 
-		goto err0;
 	
-	perf = pr->performance;
-	current_state = perf->state;
-
-	if (current_state == pr->limit.state.px) {
-		result = acpi_processor_set_performance(perf, (perf->state_count - 1));
-		if (result) {
-			ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Disabled P-States due to failure while switching.\n"));
-			result = -ENODEV;
-			goto err1;
-		}
-	}
-
-	result = acpi_processor_set_performance(perf, pr->limit.state.px);
-	if (result) {
-		ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Disabled P-States due to failure while switching.\n"));
-		result = -ENODEV;
-		goto err1;
-	}
-	
-	if (current_state != 0) {
-		result = acpi_processor_set_performance(perf, current_state);
-		if (result) {
-			ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Disabled P-States due to failure while switching.\n"));
-			result = -ENODEV;
-			goto err1;
-		}
-	}
-
-	return_VALUE(0);
-
-	/* error handling */
- err1:
-	cpufreq_unregister_driver(&acpi_cpufreq_driver);
-	
- err0:
-	/* unregister struct acpi_processor_performance performance */
-	for (i=0; i<NR_CPUS; i++) {
-		if (performance[i].pr) {
-			performance[i].pr->flags.performance = 0;
-			performance[i].pr->performance = NULL;
-			performance[i].pr = NULL;
-		}
-	}
-	kfree(performance);
-	
-	printk(KERN_INFO "cpufreq: No CPUs supporting ACPI performance management found.\n");
 	return_VALUE(result);
 }
 
@@ -796,27 +380,9 @@
 static void __exit
 acpi_cpufreq_exit (void)
 {
-	int                     i = 0;
-
 	ACPI_FUNCTION_TRACE("acpi_cpufreq_exit");
 
-	for (i=0; i<NR_CPUS; i++) {
-		if (performance[i].pr)
-			performance[i].pr->flags.performance = 0;
-	}
-
-	 cpufreq_unregister_driver(&acpi_cpufreq_driver);
-
-	/* unregister struct acpi_processor_performance performance */
-	for (i=0; i<NR_CPUS; i++) {
-		if (performance[i].pr) {
-			performance[i].pr->flags.performance = 0;
-			performance[i].pr->performance = NULL;
-			performance[i].pr = NULL;
-		}
-	}
-
-	kfree(performance);
+	cpufreq_unregister_driver(&acpi_cpufreq_driver);
 
 	return_VOID;
 }
--- diff/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c	2004-02-09 10:36:07.000000000 +0000
+++ source/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c	2004-02-09 10:39:50.000000000 +0000
@@ -57,8 +57,7 @@
 	u32 l, h;
 	cpumask_t cpus_allowed, affected_cpu_map;
 	struct cpufreq_freqs freqs;
-	int hyperthreading = 0;
-	int sibling = 0;
+	int j;
 
 	if (!cpu_online(cpu) || (newstate > DC_DISABLE) || 
 		(newstate == DC_RESV))
@@ -68,13 +67,10 @@
 	cpus_allowed = current->cpus_allowed;
 
 	/* only run on CPU to be set, or on its sibling */
-       affected_cpu_map = cpumask_of_cpu(cpu);
-#ifdef CONFIG_X86_HT
-	hyperthreading = ((cpu_has_ht) && (smp_num_siblings == 2));
-	if (hyperthreading) {
-		sibling = cpu_sibling_map[cpu];
-                cpu_set(sibling, affected_cpu_map);
-	}
+#ifdef CONFIG_SMP
+	affected_cpu_map = cpu_sibling_map[cpu];
+#else
+	affected_cpu_map = cpumask_of_cpu(cpu);
 #endif
 	set_cpus_allowed(current, affected_cpu_map);
         BUG_ON(!cpu_isset(smp_processor_id(), affected_cpu_map));
@@ -97,11 +93,11 @@
 	/* notifiers */
 	freqs.old = stock_freq * l / 8;
 	freqs.new = stock_freq * newstate / 8;
-	freqs.cpu = cpu;
-	cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
-	if (hyperthreading) {
-		freqs.cpu = sibling;
-		cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
+	for_each_cpu(j) {
+		if (cpu_isset(j, affected_cpu_map)) {
+			freqs.cpu = j;
+			cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
+		}
 	}
 
 	rdmsr(MSR_IA32_THERM_STATUS, l, h);
@@ -132,10 +128,11 @@
 	set_cpus_allowed(current, cpus_allowed);
 
 	/* notifiers */
-	cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
-	if (hyperthreading) {
-		freqs.cpu = cpu;
-		cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
+	for_each_cpu(j) {
+		if (cpu_isset(j, affected_cpu_map)) {
+			freqs.cpu = j;
+			cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
+		}
 	}
 
 	return 0;
--- diff/arch/i386/kernel/cpu/intel.c	2004-02-09 10:36:07.000000000 +0000
+++ source/arch/i386/kernel/cpu/intel.c	2004-02-09 10:39:50.000000000 +0000
@@ -10,6 +10,7 @@
 #include <asm/processor.h>
 #include <asm/msr.h>
 #include <asm/uaccess.h>
+#include <asm/desc.h>
 
 #include "cpu.h"
 
@@ -19,8 +20,6 @@
 #include <mach_apic.h>
 #endif
 
-extern int trap_init_f00f_bug(void);
-
 #ifdef CONFIG_X86_INTEL_USERCOPY
 /*
  * Alignment at which movsl is preferred for bulk memory copies.
@@ -165,7 +164,7 @@
 
 		c->f00f_bug = 1;
 		if ( !f00f_workaround_enabled ) {
-			trap_init_f00f_bug();
+			trap_init_virtual_IDT();
 			printk(KERN_NOTICE "Intel Pentium with F0 0F bug - workaround enabled.\n");
 			f00f_workaround_enabled = 1;
 		}
@@ -248,6 +247,12 @@
 	/* SEP CPUID bug: Pentium Pro reports SEP but doesn't have it until model 3 mask 3 */
 	if ((c->x86<<8 | c->x86_model<<4 | c->x86_mask) < 0x633)
 		clear_bit(X86_FEATURE_SEP, c->x86_capability);
+	/*
+	 * FIXME: SEP is disabled for 4G/4G for now:
+	 */
+#ifdef CONFIG_X86_HIGH_ENTRY
+	clear_bit(X86_FEATURE_SEP, c->x86_capability);
+#endif
 
 	/* Names for the Pentium II/Celeron processors 
 	   detectable only by also checking the cache size.
--- diff/arch/i386/kernel/cpu/proc.c	2003-08-26 10:00:51.000000000 +0100
+++ source/arch/i386/kernel/cpu/proc.c	2004-02-09 10:39:50.000000000 +0000
@@ -50,7 +50,7 @@
 		NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 
 		/* VIA/Cyrix/Centaur-defined */
-		NULL, NULL, "xstore", NULL, NULL, NULL, NULL, NULL,
+		NULL, NULL, "rng", "rng_en", NULL, NULL, "ace", "ace_en",
 		NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 		NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 		NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
--- diff/arch/i386/kernel/cpuid.c	2003-09-17 12:28:01.000000000 +0100
+++ source/arch/i386/kernel/cpuid.c	2004-02-09 10:39:50.000000000 +0000
@@ -1,4 +1,3 @@
-#ident "$Id$"
 /* ----------------------------------------------------------------------- *
  *   
  *   Copyright 2000 H. Peter Anvin - All Rights Reserved
--- diff/arch/i386/kernel/doublefault.c	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/i386/kernel/doublefault.c	2004-02-09 10:39:50.000000000 +0000
@@ -7,12 +7,13 @@
 #include <asm/uaccess.h>
 #include <asm/pgtable.h>
 #include <asm/desc.h>
+#include <asm/fixmap.h>
 
 #define DOUBLEFAULT_STACKSIZE (1024)
 static unsigned long doublefault_stack[DOUBLEFAULT_STACKSIZE];
 #define STACK_START (unsigned long)(doublefault_stack+DOUBLEFAULT_STACKSIZE)
 
-#define ptr_ok(x) ((x) > 0xc0000000 && (x) < 0xc1000000)
+#define ptr_ok(x) (((x) > __PAGE_OFFSET && (x) < (__PAGE_OFFSET + 0x01000000)) || ((x) >= FIXADDR_START))
 
 static void doublefault_fn(void)
 {
@@ -38,8 +39,8 @@
 
 			printk("eax = %08lx, ebx = %08lx, ecx = %08lx, edx = %08lx\n",
 				t->eax, t->ebx, t->ecx, t->edx);
-			printk("esi = %08lx, edi = %08lx\n",
-				t->esi, t->edi);
+			printk("esi = %08lx, edi = %08lx, ebp = %08lx\n",
+				t->esi, t->edi, t->ebp);
 		}
 	}
 
--- diff/arch/i386/kernel/edd.c	2003-10-27 09:20:36.000000000 +0000
+++ source/arch/i386/kernel/edd.c	2004-02-09 10:39:50.000000000 +0000
@@ -2,6 +2,7 @@
  * linux/arch/i386/kernel/edd.c
  *  Copyright (C) 2002, 2003 Dell Inc.
  *  by Matt Domsch <Matt_Domsch@dell.com>
+ *  disk80 signature by Matt Domsch, Andrew Wilks, and Sandeep K. Shandilya
  *
  * BIOS Enhanced Disk Drive Services (EDD)
  * conformant to T13 Committee www.t13.org
@@ -59,9 +60,9 @@
 MODULE_DESCRIPTION("sysfs interface to BIOS EDD information");
 MODULE_LICENSE("GPL");
 
-#define EDD_VERSION "0.10 2003-Oct-11"
+#define EDD_VERSION "0.12 2004-Jan-26"
 #define EDD_DEVICE_NAME_SIZE 16
-#define REPORT_URL "http://domsch.com/linux/edd30/results.html"
+#define REPORT_URL "http://linux.dell.com/edd/results.html"
 
 #define left (PAGE_SIZE - (p - buf) - 1)
 
@@ -133,18 +134,18 @@
 
 	for (i = 0; i < 4; i++) {
 		if (isprint(info->params.host_bus_type[i])) {
-			p += snprintf(p, left, "%c", info->params.host_bus_type[i]);
+			p += scnprintf(p, left, "%c", info->params.host_bus_type[i]);
 		} else {
-			p += snprintf(p, left, " ");
+			p += scnprintf(p, left, " ");
 		}
 	}
 
 	if (!strncmp(info->params.host_bus_type, "ISA", 3)) {
-		p += snprintf(p, left, "\tbase_address: %x\n",
+		p += scnprintf(p, left, "\tbase_address: %x\n",
 			     info->params.interface_path.isa.base_address);
 	} else if (!strncmp(info->params.host_bus_type, "PCIX", 4) ||
 		   !strncmp(info->params.host_bus_type, "PCI", 3)) {
-		p += snprintf(p, left,
+		p += scnprintf(p, left,
 			     "\t%02x:%02x.%d  channel: %u\n",
 			     info->params.interface_path.pci.bus,
 			     info->params.interface_path.pci.slot,
@@ -153,12 +154,12 @@
 	} else if (!strncmp(info->params.host_bus_type, "IBND", 4) ||
 		   !strncmp(info->params.host_bus_type, "XPRS", 4) ||
 		   !strncmp(info->params.host_bus_type, "HTPT", 4)) {
-		p += snprintf(p, left,
+		p += scnprintf(p, left,
 			     "\tTBD: %llx\n",
 			     info->params.interface_path.ibnd.reserved);
 
 	} else {
-		p += snprintf(p, left, "\tunknown: %llx\n",
+		p += scnprintf(p, left, "\tunknown: %llx\n",
 			     info->params.interface_path.unknown.reserved);
 	}
 	return (p - buf);
@@ -177,43 +178,43 @@
 
 	for (i = 0; i < 8; i++) {
 		if (isprint(info->params.interface_type[i])) {
-			p += snprintf(p, left, "%c", info->params.interface_type[i]);
+			p += scnprintf(p, left, "%c", info->params.interface_type[i]);
 		} else {
-			p += snprintf(p, left, " ");
+			p += scnprintf(p, left, " ");
 		}
 	}
 	if (!strncmp(info->params.interface_type, "ATAPI", 5)) {
-		p += snprintf(p, left, "\tdevice: %u  lun: %u\n",
+		p += scnprintf(p, left, "\tdevice: %u  lun: %u\n",
 			     info->params.device_path.atapi.device,
 			     info->params.device_path.atapi.lun);
 	} else if (!strncmp(info->params.interface_type, "ATA", 3)) {
-		p += snprintf(p, left, "\tdevice: %u\n",
+		p += scnprintf(p, left, "\tdevice: %u\n",
 			     info->params.device_path.ata.device);
 	} else if (!strncmp(info->params.interface_type, "SCSI", 4)) {
-		p += snprintf(p, left, "\tid: %u  lun: %llu\n",
+		p += scnprintf(p, left, "\tid: %u  lun: %llu\n",
 			     info->params.device_path.scsi.id,
 			     info->params.device_path.scsi.lun);
 	} else if (!strncmp(info->params.interface_type, "USB", 3)) {
-		p += snprintf(p, left, "\tserial_number: %llx\n",
+		p += scnprintf(p, left, "\tserial_number: %llx\n",
 			     info->params.device_path.usb.serial_number);
 	} else if (!strncmp(info->params.interface_type, "1394", 4)) {
-		p += snprintf(p, left, "\teui: %llx\n",
+		p += scnprintf(p, left, "\teui: %llx\n",
 			     info->params.device_path.i1394.eui);
 	} else if (!strncmp(info->params.interface_type, "FIBRE", 5)) {
-		p += snprintf(p, left, "\twwid: %llx lun: %llx\n",
+		p += scnprintf(p, left, "\twwid: %llx lun: %llx\n",
 			     info->params.device_path.fibre.wwid,
 			     info->params.device_path.fibre.lun);
 	} else if (!strncmp(info->params.interface_type, "I2O", 3)) {
-		p += snprintf(p, left, "\tidentity_tag: %llx\n",
+		p += scnprintf(p, left, "\tidentity_tag: %llx\n",
 			     info->params.device_path.i2o.identity_tag);
 	} else if (!strncmp(info->params.interface_type, "RAID", 4)) {
-		p += snprintf(p, left, "\tidentity_tag: %x\n",
+		p += scnprintf(p, left, "\tidentity_tag: %x\n",
 			     info->params.device_path.raid.array_number);
 	} else if (!strncmp(info->params.interface_type, "SATA", 4)) {
-		p += snprintf(p, left, "\tdevice: %u\n",
+		p += scnprintf(p, left, "\tdevice: %u\n",
 			     info->params.device_path.sata.device);
 	} else {
-		p += snprintf(p, left, "\tunknown: %llx %llx\n",
+		p += scnprintf(p, left, "\tunknown: %llx %llx\n",
 			     info->params.device_path.unknown.reserved1,
 			     info->params.device_path.unknown.reserved2);
 	}
@@ -255,7 +256,15 @@
 		return -EINVAL;
 	}
 
-	p += snprintf(p, left, "0x%02x\n", info->version);
+	p += scnprintf(p, left, "0x%02x\n", info->version);
+	return (p - buf);
+}
+
+static ssize_t
+edd_show_disk80_sig(struct edd_device *edev, char *buf)
+{
+	char *p = buf;
+	p += scnprintf(p, left, "0x%08x\n", edd_disk80_sig);
 	return (p - buf);
 }
 
@@ -269,16 +278,16 @@
 	}
 
 	if (info->interface_support & EDD_EXT_FIXED_DISK_ACCESS) {
-		p += snprintf(p, left, "Fixed disk access\n");
+		p += scnprintf(p, left, "Fixed disk access\n");
 	}
 	if (info->interface_support & EDD_EXT_DEVICE_LOCKING_AND_EJECTING) {
-		p += snprintf(p, left, "Device locking and ejecting\n");
+		p += scnprintf(p, left, "Device locking and ejecting\n");
 	}
 	if (info->interface_support & EDD_EXT_ENHANCED_DISK_DRIVE_SUPPORT) {
-		p += snprintf(p, left, "Enhanced Disk Drive support\n");
+		p += scnprintf(p, left, "Enhanced Disk Drive support\n");
 	}
 	if (info->interface_support & EDD_EXT_64BIT_EXTENSIONS) {
-		p += snprintf(p, left, "64-bit extensions\n");
+		p += scnprintf(p, left, "64-bit extensions\n");
 	}
 	return (p - buf);
 }
@@ -293,21 +302,21 @@
 	}
 
 	if (info->params.info_flags & EDD_INFO_DMA_BOUNDARY_ERROR_TRANSPARENT)
-		p += snprintf(p, left, "DMA boundary error transparent\n");
+		p += scnprintf(p, left, "DMA boundary error transparent\n");
 	if (info->params.info_flags & EDD_INFO_GEOMETRY_VALID)
-		p += snprintf(p, left, "geometry valid\n");
+		p += scnprintf(p, left, "geometry valid\n");
 	if (info->params.info_flags & EDD_INFO_REMOVABLE)
-		p += snprintf(p, left, "removable\n");
+		p += scnprintf(p, left, "removable\n");
 	if (info->params.info_flags & EDD_INFO_WRITE_VERIFY)
-		p += snprintf(p, left, "write verify\n");
+		p += scnprintf(p, left, "write verify\n");
 	if (info->params.info_flags & EDD_INFO_MEDIA_CHANGE_NOTIFICATION)
-		p += snprintf(p, left, "media change notification\n");
+		p += scnprintf(p, left, "media change notification\n");
 	if (info->params.info_flags & EDD_INFO_LOCKABLE)
-		p += snprintf(p, left, "lockable\n");
+		p += scnprintf(p, left, "lockable\n");
 	if (info->params.info_flags & EDD_INFO_NO_MEDIA_PRESENT)
-		p += snprintf(p, left, "no media present\n");
+		p += scnprintf(p, left, "no media present\n");
 	if (info->params.info_flags & EDD_INFO_USE_INT13_FN50)
-		p += snprintf(p, left, "use int13 fn50\n");
+		p += scnprintf(p, left, "use int13 fn50\n");
 	return (p - buf);
 }
 
@@ -320,7 +329,7 @@
 		return -EINVAL;
 	}
 
-	p += snprintf(p, left, "0x%x\n", info->params.num_default_cylinders);
+	p += scnprintf(p, left, "0x%x\n", info->params.num_default_cylinders);
 	return (p - buf);
 }
 
@@ -333,7 +342,7 @@
 		return -EINVAL;
 	}
 
-	p += snprintf(p, left, "0x%x\n", info->params.num_default_heads);
+	p += scnprintf(p, left, "0x%x\n", info->params.num_default_heads);
 	return (p - buf);
 }
 
@@ -346,7 +355,7 @@
 		return -EINVAL;
 	}
 
-	p += snprintf(p, left, "0x%x\n", info->params.sectors_per_track);
+	p += scnprintf(p, left, "0x%x\n", info->params.sectors_per_track);
 	return (p - buf);
 }
 
@@ -359,7 +368,7 @@
 		return -EINVAL;
 	}
 
-	p += snprintf(p, left, "0x%llx\n", info->params.number_of_sectors);
+	p += scnprintf(p, left, "0x%llx\n", info->params.number_of_sectors);
 	return (p - buf);
 }
 
@@ -429,6 +438,15 @@
 	return 1;
 }
 
+static int
+edd_has_disk80_sig(struct edd_device *edev)
+{
+	struct edd_info *info = edd_dev_get_info(edev);
+	if (!edev || !info)
+		return 0;
+	return info->device == 0x80;
+}
+
 static EDD_DEVICE_ATTR(raw_data, 0444, edd_show_raw_data, NULL);
 static EDD_DEVICE_ATTR(version, 0444, edd_show_version, NULL);
 static EDD_DEVICE_ATTR(extensions, 0444, edd_show_extensions, NULL);
@@ -443,6 +461,7 @@
 		       edd_has_default_sectors_per_track);
 static EDD_DEVICE_ATTR(interface, 0444, edd_show_interface, edd_has_edd30);
 static EDD_DEVICE_ATTR(host_bus, 0444, edd_show_host_bus, edd_has_edd30);
+static EDD_DEVICE_ATTR(mbr_signature, 0444, edd_show_disk80_sig, edd_has_disk80_sig);
 
 
 /* These are default attributes that are added for every edd
@@ -464,6 +483,7 @@
 	&edd_attr_default_sectors_per_track,
 	&edd_attr_interface,
 	&edd_attr_host_bus,
+	&edd_attr_mbr_signature,
 	NULL,
 };
 
--- diff/arch/i386/kernel/entry.S	2003-11-25 15:24:57.000000000 +0000
+++ source/arch/i386/kernel/entry.S	2004-02-09 10:39:50.000000000 +0000
@@ -43,11 +43,25 @@
 #include <linux/config.h>
 #include <linux/linkage.h>
 #include <asm/thread_info.h>
+#include <asm/asm_offsets.h>
 #include <asm/errno.h>
 #include <asm/segment.h>
+#include <asm/page.h>
 #include <asm/smp.h>
 #include <asm/page.h>
 #include "irq_vectors.h"
+        /* We do not recover from a stack overflow, but at least
+         * we know it happened and should be able to track it down.
+         */
+#ifdef CONFIG_STACK_OVERFLOW_TEST
+#define STACK_OVERFLOW_TEST \
+        testl $7680,%esp;    \
+        jnz   10f;            \
+        call  stack_overflow; \
+10:
+#else
+#define STACK_OVERFLOW_TEST
+#endif
 
 #define nr_syscalls ((syscall_table_size)/4)
 
@@ -87,7 +101,102 @@
 #define resume_kernel		restore_all
 #endif
 
-#define SAVE_ALL \
+#ifdef CONFIG_X86_HIGH_ENTRY
+
+#ifdef CONFIG_X86_SWITCH_PAGETABLES
+
+#if defined(CONFIG_PREEMPT) && defined(CONFIG_SMP)
+/*
+ * If task is preempted in __SWITCH_KERNELSPACE, and moved to another cpu,
+ * __switch_to repoints %esp to the appropriate virtual stack; but %ebp is
+ * left stale, so we must check whether to repeat the real stack calculation.
+ */
+#define repeat_if_esp_changed				\
+	xorl %esp, %ebp;				\
+	testl $0xffffe000, %ebp;			\
+	jnz 0b
+#else
+#define repeat_if_esp_changed
+#endif
+
+/* clobbers ebx, edx and ebp */
+
+#define __SWITCH_KERNELSPACE				\
+	cmpl $0xff000000, %esp;				\
+	jb 1f;						\
+							\
+	/*						\
+	 * switch pagetables and load the real stack,	\
+	 * keep the stack offset:			\
+	 */						\
+							\
+	movl $swapper_pg_dir-__PAGE_OFFSET, %edx;	\
+							\
+	/* GET_THREAD_INFO(%ebp) intermixed */		\
+0:							\
+	movl %esp, %ebp;				\
+	movl %esp, %ebx;				\
+	andl $0xffffe000, %ebp;				\
+	andl $0x00001fff, %ebx;				\
+	orl TI_real_stack(%ebp), %ebx;			\
+	repeat_if_esp_changed;				\
+							\
+	movl %edx, %cr3;				\
+	movl %ebx, %esp;				\
+1:
+
+#endif
+
+
+#define __SWITCH_USERSPACE \
+	/* interrupted any of the user return paths? */	\
+							\
+	movl EIP(%esp), %eax;				\
+							\
+	cmpl $int80_ret_start_marker, %eax;		\
+	jb 33f; /* nope - continue with sysexit check */\
+	cmpl $int80_ret_end_marker, %eax;		\
+	jb 22f; /* yes - switch to virtual stack */	\
+33:							\
+	cmpl $sysexit_ret_start_marker, %eax;		\
+	jb 44f; /* nope - continue with user check */	\
+	cmpl $sysexit_ret_end_marker, %eax;		\
+	jb 22f; /* yes - switch to virtual stack */	\
+	/* return to userspace? */			\
+44:							\
+	movl EFLAGS(%esp),%ecx;				\
+	movb CS(%esp),%cl;				\
+	testl $(VM_MASK | 3),%ecx;			\
+	jz 2f;						\
+22:							\
+	/*						\
+	 * switch to the virtual stack, then switch to	\
+	 * the userspace pagetables.			\
+	 */						\
+							\
+	GET_THREAD_INFO(%ebp);				\
+	movl TI_virtual_stack(%ebp), %edx;		\
+	movl TI_user_pgd(%ebp), %ecx;			\
+							\
+	movl %esp, %ebx;				\
+	andl $0x1fff, %ebx;				\
+	orl %ebx, %edx;					\
+int80_ret_start_marker:					\
+	movl %edx, %esp; 				\
+	movl %ecx, %cr3;				\
+							\
+	__RESTORE_ALL;					\
+int80_ret_end_marker:					\
+2:
+
+#else /* !CONFIG_X86_HIGH_ENTRY */
+
+#define __SWITCH_KERNELSPACE
+#define __SWITCH_USERSPACE
+
+#endif
+
+#define __SAVE_ALL \
 	cld; \
 	pushl %es; \
 	pushl %ds; \
@@ -102,7 +211,7 @@
 	movl %edx, %ds; \
 	movl %edx, %es;
 
-#define RESTORE_INT_REGS \
+#define __RESTORE_INT_REGS \
 	popl %ebx;	\
 	popl %ecx;	\
 	popl %edx;	\
@@ -111,29 +220,28 @@
 	popl %ebp;	\
 	popl %eax
 
-#define RESTORE_REGS	\
-	RESTORE_INT_REGS; \
-1:	popl %ds;	\
-2:	popl %es;	\
+#define __RESTORE_REGS	\
+	__RESTORE_INT_REGS; \
+111:	popl %ds;	\
+222:	popl %es;	\
 .section .fixup,"ax";	\
-3:	movl $0,(%esp);	\
-	jmp 1b;		\
-4:	movl $0,(%esp);	\
-	jmp 2b;		\
+444:	movl $0,(%esp);	\
+	jmp 111b;	\
+555:	movl $0,(%esp);	\
+	jmp 222b;	\
 .previous;		\
 .section __ex_table,"a";\
 	.align 4;	\
-	.long 1b,3b;	\
-	.long 2b,4b;	\
+	.long 111b,444b;\
+	.long 222b,555b;\
 .previous
 
-
-#define RESTORE_ALL	\
-	RESTORE_REGS	\
+#define __RESTORE_ALL	\
+	__RESTORE_REGS	\
 	addl $4, %esp;	\
-1:	iret;		\
+333:	iret;		\
 .section .fixup,"ax";   \
-2:	sti;		\
+666:	sti;		\
 	movl $(__USER_DS), %edx; \
 	movl %edx, %ds; \
 	movl %edx, %es; \
@@ -142,10 +250,19 @@
 .previous;		\
 .section __ex_table,"a";\
 	.align 4;	\
-	.long 1b,2b;	\
+	.long 333b,666b;\
 .previous
 
+#define SAVE_ALL \
+	__SAVE_ALL;					\
+	__SWITCH_KERNELSPACE;				\
+        STACK_OVERFLOW_TEST;
+
+#define RESTORE_ALL					\
+	__SWITCH_USERSPACE;				\
+	__RESTORE_ALL;
 
+.section .entry.text,"ax"
 
 ENTRY(lcall7)
 	pushfl			# We get a different stack layout with call
@@ -163,7 +280,7 @@
 	movl %edx,EIP(%ebp)	# Now we move them to their "normal" places
 	movl %ecx,CS(%ebp)	#
 	andl $-8192, %ebp	# GET_THREAD_INFO
-	movl TI_EXEC_DOMAIN(%ebp), %edx	# Get the execution domain
+	movl TI_exec_domain(%ebp), %edx	# Get the execution domain
 	call *4(%edx)		# Call the lcall7 handler for the domain
 	addl $4, %esp
 	popl %eax
@@ -208,7 +325,7 @@
  	cli				# make sure we don't miss an interrupt
 					# setting need_resched or sigpending
 					# between sampling and the iret
-	movl TI_FLAGS(%ebp), %ecx
+	movl TI_flags(%ebp), %ecx
 	andl $_TIF_WORK_MASK, %ecx	# is there any work to be done on
 					# int/exception return?
 	jne work_pending
@@ -216,18 +333,18 @@
 
 #ifdef CONFIG_PREEMPT
 ENTRY(resume_kernel)
-	cmpl $0,TI_PRE_COUNT(%ebp)	# non-zero preempt_count ?
+	cmpl $0,TI_preempt_count(%ebp)	# non-zero preempt_count ?
 	jnz restore_all
 need_resched:
-	movl TI_FLAGS(%ebp), %ecx	# need_resched set ?
+	movl TI_flags(%ebp), %ecx	# need_resched set ?
 	testb $_TIF_NEED_RESCHED, %cl
 	jz restore_all
 	testl $IF_MASK,EFLAGS(%esp)     # interrupts off (exception path) ?
 	jz restore_all
-	movl $PREEMPT_ACTIVE,TI_PRE_COUNT(%ebp)
+	movl $PREEMPT_ACTIVE,TI_preempt_count(%ebp)
 	sti
 	call schedule
-	movl $0,TI_PRE_COUNT(%ebp)
+	movl $0,TI_preempt_count(%ebp)
 	cli
 	jmp need_resched
 #endif
@@ -246,37 +363,50 @@
 	pushl $(__USER_CS)
 	pushl $SYSENTER_RETURN
 
-/*
- * Load the potential sixth argument from user stack.
- * Careful about security.
- */
-	cmpl $__PAGE_OFFSET-3,%ebp
-	jae syscall_fault
-1:	movl (%ebp),%ebp
-.section __ex_table,"a"
-	.align 4
-	.long 1b,syscall_fault
-.previous
-
 	pushl %eax
 	SAVE_ALL
 	GET_THREAD_INFO(%ebp)
 	cmpl $(nr_syscalls), %eax
 	jae syscall_badsys
 
-	testb $_TIF_SYSCALL_TRACE,TI_FLAGS(%ebp)
+	testb $_TIF_SYSCALL_TRACE,TI_flags(%ebp)
 	jnz syscall_trace_entry
 	call *sys_call_table(,%eax,4)
 	movl %eax,EAX(%esp)
 	cli
-	movl TI_FLAGS(%ebp), %ecx
+	movl TI_flags(%ebp), %ecx
 	testw $_TIF_ALLWORK_MASK, %cx
 	jne syscall_exit_work
+
+#ifdef CONFIG_X86_SWITCH_PAGETABLES
+
+	GET_THREAD_INFO(%ebp)
+	movl TI_virtual_stack(%ebp), %edx
+	movl TI_user_pgd(%ebp), %ecx
+	movl %esp, %ebx
+	andl $0x1fff, %ebx
+	orl %ebx, %edx
+sysexit_ret_start_marker:
+	movl %edx, %esp
+	movl %ecx, %cr3
+#endif
+	/*
+	 * only ebx is not restored by the userspace sysenter vsyscall
+	 * code, it assumes it to be callee-saved.
+	 */
+	movl EBX(%esp), %ebx
+
 /* if something modifies registers it must also disable sysexit */
+
 	movl EIP(%esp), %edx
 	movl OLDESP(%esp), %ecx
+
 	sti
 	sysexit
+#ifdef CONFIG_X86_SWITCH_PAGETABLES
+sysexit_ret_end_marker:
+	nop
+#endif
 
 
 	# system call handler stub
@@ -287,7 +417,7 @@
 	cmpl $(nr_syscalls), %eax
 	jae syscall_badsys
 					# system call tracing in operation
-	testb $_TIF_SYSCALL_TRACE,TI_FLAGS(%ebp)
+	testb $_TIF_SYSCALL_TRACE,TI_flags(%ebp)
 	jnz syscall_trace_entry
 syscall_call:
 	call *sys_call_table(,%eax,4)
@@ -296,10 +426,23 @@
 	cli				# make sure we don't miss an interrupt
 					# setting need_resched or sigpending
 					# between sampling and the iret
-	movl TI_FLAGS(%ebp), %ecx
+	movl TI_flags(%ebp), %ecx
 	testw $_TIF_ALLWORK_MASK, %cx	# current->work
 	jne syscall_exit_work
 restore_all:
+#ifdef CONFIG_TRAP_BAD_SYSCALL_EXITS
+	movl EFLAGS(%esp), %eax		# mix EFLAGS and CS
+	movb CS(%esp), %al
+	testl $(VM_MASK | 3), %eax
+	jz resume_kernelX		# returning to kernel or vm86-space
+
+	cmpl $0,TI_preempt_count(%ebp)	# non-zero preempt_count ?
+	jz resume_kernelX
+
+        int $3
+
+resume_kernelX:
+#endif
 	RESTORE_ALL
 
 	# perform work that needs to be done immediately before resumption
@@ -312,7 +455,7 @@
 	cli				# make sure we don't miss an interrupt
 					# setting need_resched or sigpending
 					# between sampling and the iret
-	movl TI_FLAGS(%ebp), %ecx
+	movl TI_flags(%ebp), %ecx
 	andl $_TIF_WORK_MASK, %ecx	# is there any work to be done other
 					# than syscall tracing?
 	jz restore_all
@@ -327,6 +470,22 @@
 					# vm86-space
 	xorl %edx, %edx
 	call do_notify_resume
+
+#if CONFIG_X86_HIGH_ENTRY
+	/*
+	 * Reload db7 if necessary:
+	 */
+	movl TI_flags(%ebp), %ecx
+	testb $_TIF_DB7, %cl
+	jnz work_db7
+
+	jmp restore_all
+
+work_db7:
+	movl TI_task(%ebp), %edx;
+	movl task_thread_db7(%edx), %edx;
+	movl %edx, %db7;
+#endif
 	jmp restore_all
 
 	ALIGN
@@ -382,7 +541,7 @@
  */
 .data
 ENTRY(interrupt)
-.text
+.previous
 
 vector=0
 ENTRY(irq_entries_start)
@@ -392,7 +551,7 @@
 	jmp common_interrupt
 .data
 	.long 1b
-.text
+.previous
 vector=vector+1
 .endr
 
@@ -433,12 +592,17 @@
 	movl ES(%esp), %edi		# get the function address
 	movl %eax, ORIG_EAX(%esp)
 	movl %ecx, ES(%esp)
-	movl %esp, %edx
 	pushl %esi			# push the error code
-	pushl %edx			# push the pt_regs pointer
 	movl $(__USER_DS), %edx
 	movl %edx, %ds
 	movl %edx, %es
+
+/* clobbers edx, ebx and ebp */
+	__SWITCH_KERNELSPACE
+
+	leal 4(%esp), %edx		# prepare pt_regs
+	pushl %edx			# push pt_regs
+
 	call *%edi
 	addl $8, %esp
 	jmp ret_from_exception
@@ -529,7 +693,7 @@
 	pushl %edx
 	call do_nmi
 	addl $8, %esp
-	RESTORE_ALL
+	jmp restore_all
 
 nmi_stack_fixup:
 	FIX_STACK(12,nmi_stack_correct, 1)
@@ -606,6 +770,8 @@
 	pushl $do_spurious_interrupt_bug
 	jmp error_code
 
+.previous
+
 .data
 ENTRY(sys_call_table)
 	.long sys_restart_syscall	/* 0 - old "setup()" system call, used for restarting */
@@ -882,5 +1048,8 @@
 	.long sys_utimes
  	.long sys_fadvise64_64
 	.long sys_ni_syscall	/* sys_vserver */
+	.long sys_ni_syscall	/* mbind */
+	.long sys_ni_syscall	/* get_mempolicy */
+	.long sys_ni_syscall	/* set_mempolicy */
 
 syscall_table_size=(.-sys_call_table)
--- diff/arch/i386/kernel/head.S	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/i386/kernel/head.S	2004-02-09 10:39:50.000000000 +0000
@@ -16,6 +16,7 @@
 #include <asm/pgtable.h>
 #include <asm/desc.h>
 #include <asm/cache.h>
+#include <asm/asm_offsets.h>
 
 #define OLD_CL_MAGIC_ADDR	0x90020
 #define OLD_CL_MAGIC		0xA33F
@@ -330,7 +331,7 @@
 
 /* This is the default interrupt "handler" :-) */
 int_msg:
-	.asciz "Unknown interrupt\n"
+	.asciz "Unknown interrupt or fault at EIP %p %p %p\n"
 	ALIGN
 ignore_int:
 	cld
@@ -342,9 +343,17 @@
 	movl $(__KERNEL_DS),%eax
 	movl %eax,%ds
 	movl %eax,%es
+	pushl 16(%esp)
+	pushl 24(%esp)
+	pushl 32(%esp)
+	pushl 40(%esp)
 	pushl $int_msg
 	call printk
 	popl %eax
+	popl %eax
+	popl %eax
+	popl %eax
+	popl %eax
 	popl %ds
 	popl %es
 	popl %edx
@@ -377,23 +386,27 @@
 	.fill NR_CPUS-1,8,0		# space for the other GDT descriptors
 
 /*
- * This is initialized to create an identity-mapping at 0-8M (for bootup
- * purposes) and another mapping of the 0-8M area at virtual address
+ * This is initialized to create an identity-mapping at 0-16M (for bootup
+ * purposes) and another mapping of the 0-16M area at virtual address
  * PAGE_OFFSET.
  */
 .org 0x1000
 ENTRY(swapper_pg_dir)
 	.long 0x00102007
 	.long 0x00103007
-	.fill BOOT_USER_PGD_PTRS-2,4,0
-	/* default: 766 entries */
+	.long 0x00104007
+	.long 0x00105007
+	.fill BOOT_USER_PGD_PTRS-4,4,0
+	/* default: 764 entries */
 	.long 0x00102007
 	.long 0x00103007
-	/* default: 254 entries */
-	.fill BOOT_KERNEL_PGD_PTRS-2,4,0
+	.long 0x00104007
+	.long 0x00105007
+	/* default: 252 entries */
+	.fill BOOT_KERNEL_PGD_PTRS-4,4,0
 
 /*
- * The page tables are initialized to only 8MB here - the final page
+ * The page tables are initialized to only 16MB here - the final page
  * tables are set up later depending on memory size.
  */
 .org 0x2000
@@ -402,15 +415,21 @@
 .org 0x3000
 ENTRY(pg1)
 
+.org 0x4000
+ENTRY(pg2)
+
+.org 0x5000
+ENTRY(pg3)
+
 /*
  * empty_zero_page must immediately follow the page tables ! (The
  * initialization loop counts until empty_zero_page)
  */
 
-.org 0x4000
+.org 0x6000
 ENTRY(empty_zero_page)
 
-.org 0x5000
+.org 0x7000
 
 /*
  * Real beginning of normal "text" segment
@@ -419,12 +438,12 @@
 ENTRY(_stext)
 
 /*
- * This starts the data section. Note that the above is all
- * in the text section because it has alignment requirements
- * that we cannot fulfill any other way.
+ * This starts the data section.
  */
 .data
 
+.align PAGE_SIZE_asm
+
 /*
  * The Global Descriptor Table contains 28 quadwords, per-CPU.
  */
@@ -439,7 +458,9 @@
 	.quad 0x00cf9a000000ffff	/* kernel 4GB code at 0x00000000 */
 	.quad 0x00cf92000000ffff	/* kernel 4GB data at 0x00000000 */
 #endif
-	.align L1_CACHE_BYTES
+
+.align PAGE_SIZE_asm
+
 ENTRY(cpu_gdt_table)
 	.quad 0x0000000000000000	/* NULL descriptor */
 	.quad 0x0000000000000000	/* 0x0b reserved */
--- diff/arch/i386/kernel/i386_ksyms.c	2003-10-09 09:47:33.000000000 +0100
+++ source/arch/i386/kernel/i386_ksyms.c	2004-02-09 10:39:50.000000000 +0000
@@ -32,7 +32,6 @@
 #include <asm/pgalloc.h>
 #include <asm/tlbflush.h>
 #include <asm/nmi.h>
-#include <asm/edd.h>
 #include <asm/ist.h>
 
 extern void dump_thread(struct pt_regs *, struct user *);
@@ -98,7 +97,6 @@
 EXPORT_SYMBOL_NOVERS(__down_failed_trylock);
 EXPORT_SYMBOL_NOVERS(__up_wakeup);
 /* Networking helper routines. */
-EXPORT_SYMBOL(csum_partial_copy_generic);
 /* Delay loops */
 EXPORT_SYMBOL(__ndelay);
 EXPORT_SYMBOL(__udelay);
@@ -112,13 +110,17 @@
 EXPORT_SYMBOL(strpbrk);
 EXPORT_SYMBOL(strstr);
 
+#if !defined(CONFIG_X86_UACCESS_INDIRECT)
 EXPORT_SYMBOL(strncpy_from_user);
-EXPORT_SYMBOL(__strncpy_from_user);
+EXPORT_SYMBOL(__direct_strncpy_from_user);
 EXPORT_SYMBOL(clear_user);
 EXPORT_SYMBOL(__clear_user);
 EXPORT_SYMBOL(__copy_from_user_ll);
 EXPORT_SYMBOL(__copy_to_user_ll);
 EXPORT_SYMBOL(strnlen_user);
+#else /* CONFIG_X86_UACCESS_INDIRECT */
+EXPORT_SYMBOL(direct_csum_partial_copy_generic);
+#endif
 
 EXPORT_SYMBOL(dma_alloc_coherent);
 EXPORT_SYMBOL(dma_free_coherent);
@@ -203,11 +205,6 @@
 EXPORT_SYMBOL(kmap_atomic_to_page);
 #endif
 
-#ifdef CONFIG_EDD_MODULE
-EXPORT_SYMBOL(edd);
-EXPORT_SYMBOL(eddnr);
-#endif
-
 #if defined(CONFIG_X86_SPEEDSTEP_SMI) || defined(CONFIG_X86_SPEEDSTEP_SMI_MODULE)
 EXPORT_SYMBOL(ist_info);
 #endif
--- diff/arch/i386/kernel/i387.c	2003-10-09 09:47:33.000000000 +0100
+++ source/arch/i386/kernel/i387.c	2004-02-09 10:39:50.000000000 +0000
@@ -218,6 +218,7 @@
 static int convert_fxsr_to_user( struct _fpstate __user *buf,
 					struct i387_fxsave_struct *fxsave )
 {
+	struct _fpreg tmp[8]; /* 80 bytes scratch area */
 	unsigned long env[7];
 	struct _fpreg __user *to;
 	struct _fpxreg *from;
@@ -234,23 +235,25 @@
 	if ( __copy_to_user( buf, env, 7 * sizeof(unsigned long) ) )
 		return 1;
 
-	to = &buf->_st[0];
+	to = tmp;
 	from = (struct _fpxreg *) &fxsave->st_space[0];
 	for ( i = 0 ; i < 8 ; i++, to++, from++ ) {
 		unsigned long *t = (unsigned long *)to;
 		unsigned long *f = (unsigned long *)from;
 
-		if (__put_user(*f, t) ||
-				__put_user(*(f + 1), t + 1) ||
-				__put_user(from->exponent, &to->exponent))
-			return 1;
+		*t = *f;
+		*(t + 1) = *(f+1);
+		to->exponent = from->exponent;
 	}
+	if (copy_to_user(buf->_st, tmp, sizeof(struct _fpreg [8])))
+		return 1;
 	return 0;
 }
 
 static int convert_fxsr_from_user( struct i387_fxsave_struct *fxsave,
 					  struct _fpstate __user *buf )
 {
+	struct _fpreg tmp[8]; /* 80 bytes scratch area */
 	unsigned long env[7];
 	struct _fpxreg *to;
 	struct _fpreg __user *from;
@@ -258,6 +261,8 @@
 
 	if ( __copy_from_user( env, buf, 7 * sizeof(long) ) )
 		return 1;
+	if (copy_from_user(tmp, buf->_st, sizeof(struct _fpreg [8])))
+		return 1;
 
 	fxsave->cwd = (unsigned short)(env[0] & 0xffff);
 	fxsave->swd = (unsigned short)(env[1] & 0xffff);
@@ -269,15 +274,14 @@
 	fxsave->fos = env[6];
 
 	to = (struct _fpxreg *) &fxsave->st_space[0];
-	from = &buf->_st[0];
+	from = tmp;
 	for ( i = 0 ; i < 8 ; i++, to++, from++ ) {
 		unsigned long *t = (unsigned long *)to;
 		unsigned long *f = (unsigned long *)from;
 
-		if (__get_user(*t, f) ||
-				__get_user(*(t + 1), f + 1) ||
-				__get_user(to->exponent, &from->exponent))
-			return 1;
+		*t = *f;
+		*(t + 1) = *(f + 1);
+		to->exponent = from->exponent;
 	}
 	return 0;
 }
@@ -451,15 +455,18 @@
 
 int set_fpxregs( struct task_struct *tsk, struct user_fxsr_struct __user *buf )
 {
+	int ret = 0;
+
 	if ( cpu_has_fxsr ) {
-		__copy_from_user( &tsk->thread.i387.fxsave, buf,
-				  sizeof(struct user_fxsr_struct) );
+		if (__copy_from_user( &tsk->thread.i387.fxsave, buf,
+				  sizeof(struct user_fxsr_struct) ))
+			ret = -EFAULT;
 		/* mxcsr bit 6 and 31-16 must be zero for security reasons */
 		tsk->thread.i387.fxsave.mxcsr &= 0xffbf;
-		return 0;
 	} else {
-		return -EIO;
+		ret = -EIO;
 	}
+	return ret;
 }
 
 /*
--- diff/arch/i386/kernel/init_task.c	2003-10-09 09:47:33.000000000 +0100
+++ source/arch/i386/kernel/init_task.c	2004-02-09 10:39:50.000000000 +0000
@@ -26,7 +26,7 @@
  */
 union thread_union init_thread_union 
 	__attribute__((__section__(".data.init_task"))) =
-		{ INIT_THREAD_INFO(init_task) };
+		{ INIT_THREAD_INFO(init_task, init_thread_union) };
 
 /*
  * Initial task structure.
@@ -44,5 +44,5 @@
  * section. Since TSS's are completely CPU-local, we want them
  * on exact cacheline boundaries, to eliminate cacheline ping-pong.
  */ 
-struct tss_struct init_tss[NR_CPUS] __cacheline_aligned = { [0 ... NR_CPUS-1] = INIT_TSS };
+struct tss_struct init_tss[NR_CPUS] __attribute__((__section__(".data.tss"))) = { [0 ... NR_CPUS-1] = INIT_TSS };
 
--- diff/arch/i386/kernel/io_apic.c	2004-02-09 10:36:07.000000000 +0000
+++ source/arch/i386/kernel/io_apic.c	2004-02-09 10:39:50.000000000 +0000
@@ -317,8 +317,7 @@
 
 #define IRQ_ALLOWED(cpu, allowed_mask)	cpu_isset(cpu, allowed_mask)
 
-#define CPU_TO_PACKAGEINDEX(i) \
-		((physical_balance && i > cpu_sibling_map[i]) ? cpu_sibling_map[i] : i)
+#define CPU_TO_PACKAGEINDEX(i) (first_cpu(cpu_sibling_map[i]))
 
 #define MAX_BALANCED_IRQ_INTERVAL	(5*HZ)
 #define MIN_BALANCED_IRQ_INTERVAL	(HZ/2)
@@ -401,6 +400,7 @@
 	unsigned long max_cpu_irq = 0, min_cpu_irq = (~0);
 	unsigned long move_this_load = 0;
 	int max_loaded = 0, min_loaded = 0;
+	int load;
 	unsigned long useful_load_threshold = balanced_irq_interval + 10;
 	int selected_irq;
 	int tmp_loaded, first_attempt = 1;
@@ -452,7 +452,7 @@
 	for (i = 0; i < NR_CPUS; i++) {
 		if (!cpu_online(i))
 			continue;
-		if (physical_balance && i > cpu_sibling_map[i])
+		if (i != CPU_TO_PACKAGEINDEX(i))
 			continue;
 		if (min_cpu_irq > CPU_IRQ(i)) {
 			min_cpu_irq = CPU_IRQ(i);
@@ -471,7 +471,7 @@
 	for (i = 0; i < NR_CPUS; i++) {
 		if (!cpu_online(i))
 			continue;
-		if (physical_balance && i > cpu_sibling_map[i])
+		if (i != CPU_TO_PACKAGEINDEX(i))
 			continue;
 		if (max_cpu_irq <= CPU_IRQ(i)) 
 			continue;
@@ -551,9 +551,14 @@
 	 * We seek the least loaded sibling by making the comparison
 	 * (A+B)/2 vs B
 	 */
-	if (physical_balance && (CPU_IRQ(min_loaded) >> 1) >
-					CPU_IRQ(cpu_sibling_map[min_loaded]))
-		min_loaded = cpu_sibling_map[min_loaded];
+	load = CPU_IRQ(min_loaded) >> 1;
+	for_each_cpu_mask(j, cpu_sibling_map[min_loaded]) {
+		if (load > CPU_IRQ(j)) {
+			/* This won't change cpu_sibling_map[min_loaded] */
+			load = CPU_IRQ(j);
+			min_loaded = j;
+		}
+	}
 
 	cpus_and(allowed_mask, cpu_online_map, irq_affinity[selected_irq]);
 	target_cpu_mask = cpumask_of_cpu(min_loaded);
--- diff/arch/i386/kernel/irq.c	2004-01-19 10:22:55.000000000 +0000
+++ source/arch/i386/kernel/irq.c	2004-02-09 10:39:50.000000000 +0000
@@ -34,6 +34,8 @@
 #include <linux/proc_fs.h>
 #include <linux/seq_file.h>
 #include <linux/kallsyms.h>
+#include <linux/notifier.h>
+#include <linux/cpu.h>
 
 #include <asm/atomic.h>
 #include <asm/io.h>
@@ -508,6 +510,8 @@
 
 	irq_exit();
 
+	kgdb_process_breakpoint();
+
 	return 1;
 }
 
@@ -962,7 +966,71 @@
 
 	return full_count;
 }
+#endif
+
+#ifdef CONFIG_HOTPLUG_CPU
+#include <mach_apic.h>
+
+static void migrate_irqs_from(int cpu)
+{
+	cpumask_t mask;
+	unsigned int irq;
+
+	mask = cpumask_of_cpu(cpu);
+	cpus_complement(mask);
+	cpus_and(mask, mask, cpu_online_map);
+	for (irq = 0; irq < NR_IRQS; irq++) {
+		cpus_and(irq_affinity[irq], irq_affinity[irq], mask);
+		if (cpus_empty(irq_affinity[irq]))
+			irq_affinity[irq] = cpumask_of_cpu(0);
 
+		if (irq_desc[irq].handler->set_affinity)
+			irq_desc[irq].handler->set_affinity(irq, mask);
+	}
+}
+
+void enable_all_irqs(int cpu)
+{
+	cpumask_t mask;
+	unsigned int irq;
+
+	mask = cpumask_of_cpu(cpu);
+	cpus_or(mask, mask, cpu_online_map);
+	for (irq = 0; irq < NR_IRQS; irq++) {
+		cpus_or(irq_affinity[irq], irq_affinity[irq], mask);
+		if (cpus_empty(irq_affinity[irq])) {
+			irq_affinity[irq] = cpumask_of_cpu(0);
+		}
+
+		if (irq_desc[irq].handler->set_affinity)
+			irq_desc[irq].handler->set_affinity(irq, mask);
+	}
+}
+
+static int irqs_cpu_notify(struct notifier_block *self,
+                                unsigned long action, void *hcpu)
+{
+	int cpu = (int)hcpu;
+	switch(action) {
+	case CPU_ONLINE:
+		/*
+		 * We could go through all the irqs and add
+		 * this processor to the cpu set - zwane
+		 */
+		enable_all_irqs(cpu);
+		break;
+	case CPU_OFFLINE:
+		migrate_irqs_from(cpu);
+		break;
+	default:
+		break;
+	}
+	return NOTIFY_OK;
+}
+
+static struct notifier_block __devinitdata irqs_cpu_nb = {
+        .notifier_call  = irqs_cpu_notify,
+};
 #endif
 
 static int prof_cpu_mask_read_proc (char *page, char **start, off_t off,
@@ -1051,5 +1119,9 @@
 	 */
 	for (i = 0; i < NR_IRQS; i++)
 		register_irq_proc(i);
+#ifdef CONFIG_HOTPLUG_CPU
+	register_cpu_notifier(&irqs_cpu_nb);
+#endif
+
 }
 
--- diff/arch/i386/kernel/ldt.c	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/i386/kernel/ldt.c	2004-02-09 10:39:50.000000000 +0000
@@ -2,7 +2,7 @@
  * linux/kernel/ldt.c
  *
  * Copyright (C) 1992 Krishna Balasubramanian and Linus Torvalds
- * Copyright (C) 1999 Ingo Molnar <mingo@redhat.com>
+ * Copyright (C) 1999, 2003 Ingo Molnar <mingo@redhat.com>
  */
 
 #include <linux/errno.h>
@@ -18,6 +18,8 @@
 #include <asm/system.h>
 #include <asm/ldt.h>
 #include <asm/desc.h>
+#include <linux/highmem.h>
+#include <asm/atomic_kmap.h>
 
 #ifdef CONFIG_SMP /* avoids "defined but not used" warnig */
 static void flush_ldt(void *null)
@@ -29,34 +31,31 @@
 
 static int alloc_ldt(mm_context_t *pc, int mincount, int reload)
 {
-	void *oldldt;
-	void *newldt;
-	int oldsize;
+	int oldsize, newsize, i;
 
 	if (mincount <= pc->size)
 		return 0;
+	/*
+	 * LDT got larger - reallocate if necessary.
+	 */
 	oldsize = pc->size;
 	mincount = (mincount+511)&(~511);
-	if (mincount*LDT_ENTRY_SIZE > PAGE_SIZE)
-		newldt = vmalloc(mincount*LDT_ENTRY_SIZE);
-	else
-		newldt = kmalloc(mincount*LDT_ENTRY_SIZE, GFP_KERNEL);
-
-	if (!newldt)
-		return -ENOMEM;
-
-	if (oldsize)
-		memcpy(newldt, pc->ldt, oldsize*LDT_ENTRY_SIZE);
-	oldldt = pc->ldt;
-	memset(newldt+oldsize*LDT_ENTRY_SIZE, 0, (mincount-oldsize)*LDT_ENTRY_SIZE);
-	pc->ldt = newldt;
-	wmb();
+	newsize = mincount*LDT_ENTRY_SIZE;
+	for (i = 0; i < newsize; i += PAGE_SIZE) {
+		int nr = i/PAGE_SIZE;
+		BUG_ON(i >= 64*1024);
+		if (!pc->ldt_pages[nr]) {
+			pc->ldt_pages[nr] = alloc_page(GFP_HIGHUSER);
+			if (!pc->ldt_pages[nr])
+				return -ENOMEM;
+			clear_highpage(pc->ldt_pages[nr]);
+		}
+	}
 	pc->size = mincount;
-	wmb();
-
 	if (reload) {
 #ifdef CONFIG_SMP
 		cpumask_t mask;
+
 		preempt_disable();
 		load_LDT(pc);
 		mask = cpumask_of_cpu(smp_processor_id());
@@ -67,21 +66,20 @@
 		load_LDT(pc);
 #endif
 	}
-	if (oldsize) {
-		if (oldsize*LDT_ENTRY_SIZE > PAGE_SIZE)
-			vfree(oldldt);
-		else
-			kfree(oldldt);
-	}
 	return 0;
 }
 
 static inline int copy_ldt(mm_context_t *new, mm_context_t *old)
 {
-	int err = alloc_ldt(new, old->size, 0);
-	if (err < 0)
+	int i, err, size = old->size, nr_pages = (size*LDT_ENTRY_SIZE + PAGE_SIZE-1)/PAGE_SIZE;
+
+	err = alloc_ldt(new, size, 0);
+	if (err < 0) {
+		new->size = 0;
 		return err;
-	memcpy(new->ldt, old->ldt, old->size*LDT_ENTRY_SIZE);
+	}
+	for (i = 0; i < nr_pages; i++)
+		copy_user_highpage(new->ldt_pages[i], old->ldt_pages[i], 0);
 	return 0;
 }
 
@@ -96,6 +94,7 @@
 
 	init_MUTEX(&mm->context.sem);
 	mm->context.size = 0;
+	memset(mm->context.ldt_pages, 0, sizeof(struct page *) * MAX_LDT_PAGES);
 	old_mm = current->mm;
 	if (old_mm && old_mm->context.size > 0) {
 		down(&old_mm->context.sem);
@@ -107,23 +106,21 @@
 
 /*
  * No need to lock the MM as we are the last user
+ * Do not touch the ldt register, we are already
+ * in the next thread.
  */
 void destroy_context(struct mm_struct *mm)
 {
-	if (mm->context.size) {
-		if (mm == current->active_mm)
-			clear_LDT();
-		if (mm->context.size*LDT_ENTRY_SIZE > PAGE_SIZE)
-			vfree(mm->context.ldt);
-		else
-			kfree(mm->context.ldt);
-		mm->context.size = 0;
-	}
+	int i, nr_pages = (mm->context.size*LDT_ENTRY_SIZE + PAGE_SIZE-1) / PAGE_SIZE;
+
+	for (i = 0; i < nr_pages; i++)
+		__free_page(mm->context.ldt_pages[i]);
+	mm->context.size = 0;
 }
 
 static int read_ldt(void __user * ptr, unsigned long bytecount)
 {
-	int err;
+	int err, i;
 	unsigned long size;
 	struct mm_struct * mm = current->mm;
 
@@ -138,8 +135,25 @@
 		size = bytecount;
 
 	err = 0;
-	if (copy_to_user(ptr, mm->context.ldt, size))
-		err = -EFAULT;
+	/*
+	 * This is necessary just in case we got here straight from a
+	 * context-switch where the ptes were set but no tlb flush
+	 * was done yet. We rather avoid doing a TLB flush in the
+	 * context-switch path and do it here instead.
+	 */
+	__flush_tlb_global();
+
+	for (i = 0; i < size; i += PAGE_SIZE) {
+		int nr = i / PAGE_SIZE, bytes;
+		char *kaddr = kmap(mm->context.ldt_pages[nr]);
+
+		bytes = size - i;
+		if (bytes > PAGE_SIZE)
+			bytes = PAGE_SIZE;
+		if (copy_to_user(ptr + i, kaddr, size - i))
+			err = -EFAULT;
+		kunmap(mm->context.ldt_pages[nr]);
+	}
 	up(&mm->context.sem);
 	if (err < 0)
 		return err;
@@ -158,7 +172,7 @@
 
 	err = 0;
 	address = &default_ldt[0];
-	size = 5*sizeof(struct desc_struct);
+	size = 5*LDT_ENTRY_SIZE;
 	if (size > bytecount)
 		size = bytecount;
 
@@ -200,7 +214,15 @@
 			goto out_unlock;
 	}
 
-	lp = (__u32 *) ((ldt_info.entry_number << 3) + (char *) mm->context.ldt);
+	/*
+	 * No rescheduling allowed from this point to the install.
+	 *
+	 * We do a TLB flush for the same reason as in the read_ldt() path.
+	 */
+	preempt_disable();
+	__flush_tlb_global();
+	lp = (__u32 *) ((ldt_info.entry_number << 3) +
+			(char *) __kmap_atomic_vaddr(KM_LDT_PAGE0));
 
    	/* Allow LDTs to be cleared by the user. */
    	if (ldt_info.base_addr == 0 && ldt_info.limit == 0) {
@@ -221,6 +243,7 @@
 	*lp	= entry_1;
 	*(lp+1)	= entry_2;
 	error = 0;
+	preempt_enable();
 
 out_unlock:
 	up(&mm->context.sem);
@@ -248,3 +271,26 @@
 	}
 	return ret;
 }
+
+/*
+ * load one particular LDT into the current CPU
+ */
+void load_LDT_nolock(mm_context_t *pc, int cpu)
+{
+	struct page **pages = pc->ldt_pages;
+	int count = pc->size;
+	int nr_pages, i;
+
+	if (likely(!count)) {
+		pages = &default_ldt_page;
+		count = 5;
+	}
+       	nr_pages = (count*LDT_ENTRY_SIZE + PAGE_SIZE-1) / PAGE_SIZE;
+
+	for (i = 0; i < nr_pages; i++) {
+		__kunmap_atomic_type(KM_LDT_PAGE0 - i);
+		__kmap_atomic(pages[i], KM_LDT_PAGE0 - i);
+	}
+	set_ldt_desc(cpu, (void *)__kmap_atomic_vaddr(KM_LDT_PAGE0), count);
+	load_LDT_desc();
+}
--- diff/arch/i386/kernel/microcode.c	2003-10-27 09:20:43.000000000 +0000
+++ source/arch/i386/kernel/microcode.c	2004-02-09 10:39:50.000000000 +0000
@@ -507,3 +507,4 @@
 
 module_init(microcode_init)
 module_exit(microcode_exit)
+MODULE_ALIAS_MISCDEV(MICROCODE_MINOR);
--- diff/arch/i386/kernel/mpparse.c	2004-02-09 10:36:07.000000000 +0000
+++ source/arch/i386/kernel/mpparse.c	2004-02-09 10:39:50.000000000 +0000
@@ -668,7 +668,7 @@
 		 * Read the physical hardware table.  Anything here will
 		 * override the defaults.
 		 */
-		if (!smp_read_mpc((void *)mpf->mpf_physptr)) {
+		if (!smp_read_mpc((void *)phys_to_virt(mpf->mpf_physptr))) {
 			smp_found_config = 0;
 			printk(KERN_ERR "BIOS bug, MP table errors detected!...\n");
 			printk(KERN_ERR "... disabling SMP support. (tell your hw vendor)\n");
@@ -1126,7 +1126,8 @@
 
 		/* Don't set up the ACPI SCI because it's already set up */
                 if (acpi_fadt.sci_int == irq) {
-                        entry->irq = irq; /*we still need to set entry's irq*/
+			irq = acpi_irq_to_vector(irq);
+			entry->irq = irq; /* we still need to set entry's irq */
 			continue;
                 }
 	
@@ -1156,18 +1157,14 @@
 		if ((1<<bit) & mp_ioapic_routing[ioapic].pin_programmed[idx]) {
 			printk(KERN_DEBUG "Pin %d-%d already programmed\n",
 				mp_ioapic_routing[ioapic].apic_id, ioapic_pin);
- 			if (use_pci_vector() && !platform_legacy_irq(irq))
- 				irq = IO_APIC_VECTOR(irq);
- 			entry->irq = irq;
+ 			entry->irq = acpi_irq_to_vector(irq);
 			continue;
 		}
 
 		mp_ioapic_routing[ioapic].pin_programmed[idx] |= (1<<bit);
 
 		if (!io_apic_set_pci_routing(ioapic, ioapic_pin, irq, edge_level, active_high_low)) {
- 			if (use_pci_vector() && !platform_legacy_irq(irq))
- 				irq = IO_APIC_VECTOR(irq);
- 			entry->irq = irq;
+ 			entry->irq = acpi_irq_to_vector(irq);
  		}
 		printk(KERN_DEBUG "%02x:%02x:%02x[%c] -> %d-%d -> IRQ %d\n",
 			entry->id.segment, entry->id.bus, 
--- diff/arch/i386/kernel/msr.c	2003-09-17 12:28:01.000000000 +0100
+++ source/arch/i386/kernel/msr.c	2004-02-09 10:39:50.000000000 +0000
@@ -1,4 +1,3 @@
-#ident "$Id$"
 /* ----------------------------------------------------------------------- *
  *   
  *   Copyright 2000 H. Peter Anvin - All Rights Reserved
--- diff/arch/i386/kernel/nmi.c	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/i386/kernel/nmi.c	2004-02-09 10:39:50.000000000 +0000
@@ -31,7 +31,16 @@
 #include <asm/mpspec.h>
 #include <asm/nmi.h>
 
+#ifdef CONFIG_KGDB
+#include <asm/kgdb.h>
+#ifdef CONFIG_SMP
+unsigned int nmi_watchdog = NMI_IO_APIC;
+#else
+unsigned int nmi_watchdog = NMI_LOCAL_APIC;
+#endif
+#else
 unsigned int nmi_watchdog = NMI_NONE;
+#endif
 static unsigned int nmi_hz = HZ;
 unsigned int nmi_perfctr_msr;	/* the MSR to reset in NMI handler */
 extern void show_registers(struct pt_regs *regs);
@@ -408,6 +417,9 @@
 	for (i = 0; i < NR_CPUS; i++)
 		alert_counter[i] = 0;
 }
+#ifdef CONFIG_KGDB
+int tune_watchdog = 5*HZ;
+#endif
 
 void nmi_watchdog_tick (struct pt_regs * regs)
 {
@@ -421,12 +433,24 @@
 
 	sum = irq_stat[cpu].apic_timer_irqs;
 
+#ifdef CONFIG_KGDB
+ 	if (! in_kgdb(regs) && last_irq_sums[cpu] == sum ) {
+
+#else
 	if (last_irq_sums[cpu] == sum) {
+#endif
 		/*
 		 * Ayiee, looks like this CPU is stuck ...
 		 * wait a few IRQs (5 seconds) before doing the oops ...
 		 */
 		alert_counter[cpu]++;
+#ifdef CONFIG_KGDB
+                if (alert_counter[cpu] == tune_watchdog) {
+                        kgdb_handle_exception(2, SIGPWR, 0, regs);
+                        last_irq_sums[cpu] = sum;
+                        alert_counter[cpu] = 0;
+                }
+#endif
 		if (alert_counter[cpu] == 5*nmi_hz) {
 			spin_lock(&nmi_print_lock);
 			/*
--- diff/arch/i386/kernel/process.c	2004-01-19 10:22:55.000000000 +0000
+++ source/arch/i386/kernel/process.c	2004-02-09 10:39:50.000000000 +0000
@@ -14,6 +14,7 @@
 #define __KERNEL_SYSCALLS__
 #include <stdarg.h>
 
+#include <linux/cpu.h>
 #include <linux/errno.h>
 #include <linux/sched.h>
 #include <linux/fs.h>
@@ -47,6 +48,7 @@
 #include <asm/i387.h>
 #include <asm/irq.h>
 #include <asm/desc.h>
+#include <asm/atomic_kmap.h>
 #ifdef CONFIG_MATH_EMULATION
 #include <asm/math_emu.h>
 #endif
@@ -54,6 +56,9 @@
 #include <linux/irq.h>
 #include <linux/err.h>
 
+#include <asm/tlbflush.h>
+#include <asm/cpu.h>
+
 asmlinkage void ret_from_fork(void) __asm__("ret_from_fork");
 
 int hlt_counter;
@@ -132,6 +137,60 @@
 	}
 }
 
+#ifdef CONFIG_HOTPLUG_CPU
+
+/* We don't actually take CPU down, just spin without interrupts. */
+static inline void check_cpu_quiescent(void)
+{
+	if (unlikely(__get_cpu_var(cpu_state) == CPU_OFFLINE)) {
+		int cpu = smp_processor_id();
+
+		spin_lock(&call_lock);
+		local_irq_disable();
+		preempt_disable();
+
+		/* Ack it */
+		__get_cpu_var(cpu_state) = CPU_DEAD;
+
+		BUG_ON(cpu_isset(cpu, cpu_online_map));
+		BUG_ON(!cpu_isset(cpu, cpu_active_map));
+		cpu_clear(cpu, cpu_active_map);
+		spin_unlock(&call_lock);
+
+		/* Death loop */
+		while (__get_cpu_var(cpu_state) != CPU_UP_PREPARE)
+			cpu_relax();
+
+		/* Even with irqs disabled, this is safe, since no
+		 * smp_call_funcion can be headed for us now
+		 * (!cpu_active). */
+		spin_lock(&call_lock);
+
+		/* from hereon we're ready to do work */
+		__get_cpu_var(cpu_state) = CPU_ONLINE;
+		wmb();
+
+		//printk("Cpu %u arisen\n", smp_processor_id());
+
+		/* Put ourselves online before doing ___flush_tlb_all,
+		 * so we avoid losing one to a race. */
+		cpu_set(smp_processor_id(), cpu_active_map);
+		cpu_set(smp_processor_id(), cpu_online_map);
+		wmb();
+		spin_unlock(&call_lock);
+
+		__flush_tlb_all();
+		local_irq_enable();
+
+		preempt_enable();
+	}
+}
+#else
+static inline void check_cpu_quiescent(void)
+{
+}
+#endif /* CONFIG_HOTPLUG_CPU */
+
 /*
  * The idle thread. There's no useful work to be
  * done, so just try to conserve power and have a
@@ -148,6 +207,7 @@
 			if (!idle)
 				idle = default_idle;
 
+			check_cpu_quiescent();
 			irq_stat[smp_processor_id()].idle_timestamp = jiffies;
 			idle();
 		}
@@ -252,13 +312,15 @@
  * the "args".
  */
 extern void kernel_thread_helper(void);
-__asm__(".align 4\n"
+__asm__(".section .text\n"
+	".align 4\n"
 	"kernel_thread_helper:\n\t"
 	"movl %edx,%eax\n\t"
 	"pushl %edx\n\t"
 	"call *%ebx\n\t"
 	"pushl %eax\n\t"
-	"call do_exit");
+	"call do_exit\n"
+	".previous");
 
 /*
  * Create a kernel thread
@@ -302,6 +364,9 @@
 	struct task_struct *tsk = current;
 
 	memset(tsk->thread.debugreg, 0, sizeof(unsigned long)*8);
+#ifdef CONFIG_X86_HIGH_ENTRY
+	clear_thread_flag(TIF_DB7);
+#endif
 	memset(tsk->thread.tls_array, 0, sizeof(tsk->thread.tls_array));	
 	/*
 	 * Forget coprocessor state..
@@ -315,9 +380,8 @@
 	if (dead_task->mm) {
 		// temporary debugging check
 		if (dead_task->mm->context.size) {
-			printk("WARNING: dead process %8s still has LDT? <%p/%d>\n",
+			printk("WARNING: dead process %8s still has LDT? <%d>\n",
 					dead_task->comm,
-					dead_task->mm->context.ldt,
 					dead_task->mm->context.size);
 			BUG();
 		}
@@ -352,7 +416,17 @@
 	p->thread.esp = (unsigned long) childregs;
 	p->thread.esp0 = (unsigned long) (childregs+1);
 
+	/*
+	 * get the two stack pages, for the virtual stack.
+	 *
+	 * IMPORTANT: this code relies on the fact that the task
+	 * structure is an 8K aligned piece of physical memory.
+	 */
+	p->thread.stack_page0 = virt_to_page((unsigned long)p->thread_info);
+	p->thread.stack_page1 = virt_to_page((unsigned long)p->thread_info + PAGE_SIZE);
+
 	p->thread.eip = (unsigned long) ret_from_fork;
+	p->thread_info->real_stack = p->thread_info;
 
 	savesegment(fs,p->thread.fs);
 	savesegment(gs,p->thread.gs);
@@ -504,10 +578,41 @@
 
 	__unlazy_fpu(prev_p);
 
+#ifdef CONFIG_X86_HIGH_ENTRY
+	/*
+	 * Set the ptes of the virtual stack. (NOTE: a one-page TLB flush is
+	 * needed because otherwise NMIs could interrupt the
+	 * user-return code with a virtual stack and stale TLBs.)
+	 */
+	__kunmap_atomic_type(KM_VSTACK0);
+	__kunmap_atomic_type(KM_VSTACK1);
+	__kmap_atomic(next->stack_page0, KM_VSTACK0);
+	__kmap_atomic(next->stack_page1, KM_VSTACK1);
+
+	/*
+	 * NOTE: here we rely on the task being the stack as well
+	 */
+	next_p->thread_info->virtual_stack =
+			(void *)__kmap_atomic_vaddr(KM_VSTACK0);
+
+#if defined(CONFIG_PREEMPT) && defined(CONFIG_SMP)
+	/*
+	 * If next was preempted on entry from userspace to kernel,
+	 * and now it's on a different cpu, we need to adjust %esp.
+	 * This assumes that entry.S does not copy %esp while on the
+	 * virtual stack (with interrupts enabled): which is so,
+	 * except within __SWITCH_KERNELSPACE itself.
+	 */
+	if (unlikely(next->esp >= TASK_SIZE)) {
+		next->esp &= THREAD_SIZE - 1;
+		next->esp |= (unsigned long) next_p->thread_info->virtual_stack;
+	}
+#endif
+#endif
 	/*
 	 * Reload esp0, LDT and the page table pointer:
 	 */
-	load_esp0(tss, next);
+	load_virtual_esp0(tss, next_p);
 
 	/*
 	 * Load the per-thread Thread-Local Storage descriptor.
--- diff/arch/i386/kernel/reboot.c	2004-01-19 10:22:55.000000000 +0000
+++ source/arch/i386/kernel/reboot.c	2004-02-09 10:39:50.000000000 +0000
@@ -155,12 +155,11 @@
 	CMOS_WRITE(0x00, 0x8f);
 	spin_unlock_irqrestore(&rtc_lock, flags);
 
-	/* Remap the kernel at virtual address zero, as well as offset zero
-	   from the kernel segment.  This assumes the kernel segment starts at
-	   virtual address PAGE_OFFSET. */
-
-	memcpy (swapper_pg_dir, swapper_pg_dir + USER_PGD_PTRS,
-		sizeof (swapper_pg_dir [0]) * KERNEL_PGD_PTRS);
+	/*
+	 * Remap the first 16 MB of RAM (which includes the kernel image)
+	 * at virtual address zero:
+	 */
+	setup_identity_mappings(swapper_pg_dir, 0, 16*1024*1024);
 
 	/*
 	 * Use `swapper_pg_dir' as our page directory.
--- diff/arch/i386/kernel/setup.c	2004-02-09 10:36:07.000000000 +0000
+++ source/arch/i386/kernel/setup.c	2004-02-09 10:39:50.000000000 +0000
@@ -444,6 +444,12 @@
 #if defined(CONFIG_EDD) || defined(CONFIG_EDD_MODULE)
 unsigned char eddnr;
 struct edd_info edd[EDDMAXNR];
+unsigned int edd_disk80_sig;
+#ifdef CONFIG_EDD_MODULE
+EXPORT_SYMBOL(eddnr);
+EXPORT_SYMBOL(edd);
+EXPORT_SYMBOL(edd_disk80_sig);
+#endif
 /**
  * copy_edd() - Copy the BIOS EDD information
  *              from empty_zero_page into a safe place.
@@ -453,6 +459,7 @@
 {
      eddnr = EDD_NR;
      memcpy(edd, EDD_BUF, sizeof(edd));
+     edd_disk80_sig = DISK80_SIGNATURE;
 }
 #else
 #define copy_edd() do {} while (0)
--- diff/arch/i386/kernel/signal.c	2003-11-25 15:24:57.000000000 +0000
+++ source/arch/i386/kernel/signal.c	2004-02-09 10:39:50.000000000 +0000
@@ -128,28 +128,29 @@
  */
 
 static int
-restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc, int *peax)
+restore_sigcontext(struct pt_regs *regs,
+		struct sigcontext __user *__sc, int *peax)
 {
-	unsigned int err = 0;
+	struct sigcontext scratch; /* 88 bytes of scratch area */
 
 	/* Always make any pending restarted system calls return -EINTR */
 	current_thread_info()->restart_block.fn = do_no_restart_syscall;
 
-#define COPY(x)		err |= __get_user(regs->x, &sc->x)
+	if (copy_from_user(&scratch, __sc, sizeof(scratch)))
+		return -EFAULT;
+
+#define COPY(x)		regs->x = scratch.x
 
 #define COPY_SEG(seg)							\
-	{ unsigned short tmp;						\
-	  err |= __get_user(tmp, &sc->seg);				\
+	{ unsigned short tmp = scratch.seg;				\
 	  regs->x##seg = tmp; }
 
 #define COPY_SEG_STRICT(seg)						\
-	{ unsigned short tmp;						\
-	  err |= __get_user(tmp, &sc->seg);				\
+	{ unsigned short tmp = scratch.seg;				\
 	  regs->x##seg = tmp|3; }
 
 #define GET_SEG(seg)							\
-	{ unsigned short tmp;						\
-	  err |= __get_user(tmp, &sc->seg);				\
+	{ unsigned short tmp = scratch.seg;				\
 	  loadsegment(seg,tmp); }
 
 	GET_SEG(gs);
@@ -168,27 +169,23 @@
 	COPY_SEG_STRICT(ss);
 	
 	{
-		unsigned int tmpflags;
-		err |= __get_user(tmpflags, &sc->eflags);
+		unsigned int tmpflags = scratch.eflags;
 		regs->eflags = (regs->eflags & ~0x40DD5) | (tmpflags & 0x40DD5);
 		regs->orig_eax = -1;		/* disable syscall checks */
 	}
 
 	{
-		struct _fpstate __user * buf;
-		err |= __get_user(buf, &sc->fpstate);
+		struct _fpstate * buf = scratch.fpstate;
 		if (buf) {
 			if (verify_area(VERIFY_READ, buf, sizeof(*buf)))
-				goto badframe;
-			err |= restore_i387(buf);
+				return -EFAULT;
+			if (restore_i387(buf))
+				return -EFAULT;
 		}
 	}
 
-	err |= __get_user(*peax, &sc->eax);
-	return err;
-
-badframe:
-	return 1;
+	*peax = scratch.eax;
+	return 0;
 }
 
 asmlinkage int sys_sigreturn(unsigned long __unused)
@@ -266,46 +263,47 @@
  */
 
 static int
-setup_sigcontext(struct sigcontext __user *sc, struct _fpstate __user *fpstate,
+setup_sigcontext(struct sigcontext __user *__sc, struct _fpstate __user *fpstate,
 		 struct pt_regs *regs, unsigned long mask)
 {
-	int tmp, err = 0;
+	struct sigcontext sc; /* 88 bytes of scratch area */
+	int tmp;
 
 	tmp = 0;
 	__asm__("movl %%gs,%0" : "=r"(tmp): "0"(tmp));
-	err |= __put_user(tmp, (unsigned int *)&sc->gs);
+	*(unsigned int *)&sc.gs = tmp;
 	__asm__("movl %%fs,%0" : "=r"(tmp): "0"(tmp));
-	err |= __put_user(tmp, (unsigned int *)&sc->fs);
-
-	err |= __put_user(regs->xes, (unsigned int *)&sc->es);
-	err |= __put_user(regs->xds, (unsigned int *)&sc->ds);
-	err |= __put_user(regs->edi, &sc->edi);
-	err |= __put_user(regs->esi, &sc->esi);
-	err |= __put_user(regs->ebp, &sc->ebp);
-	err |= __put_user(regs->esp, &sc->esp);
-	err |= __put_user(regs->ebx, &sc->ebx);
-	err |= __put_user(regs->edx, &sc->edx);
-	err |= __put_user(regs->ecx, &sc->ecx);
-	err |= __put_user(regs->eax, &sc->eax);
-	err |= __put_user(current->thread.trap_no, &sc->trapno);
-	err |= __put_user(current->thread.error_code, &sc->err);
-	err |= __put_user(regs->eip, &sc->eip);
-	err |= __put_user(regs->xcs, (unsigned int *)&sc->cs);
-	err |= __put_user(regs->eflags, &sc->eflags);
-	err |= __put_user(regs->esp, &sc->esp_at_signal);
-	err |= __put_user(regs->xss, (unsigned int *)&sc->ss);
+	*(unsigned int *)&sc.fs = tmp;
+	*(unsigned int *)&sc.es = regs->xes;
+	*(unsigned int *)&sc.ds = regs->xds;
+	sc.edi = regs->edi;
+	sc.esi = regs->esi;
+	sc.ebp = regs->ebp;
+	sc.esp = regs->esp;
+	sc.ebx = regs->ebx;
+	sc.edx = regs->edx;
+	sc.ecx = regs->ecx;
+	sc.eax = regs->eax;
+	sc.trapno = current->thread.trap_no;
+	sc.err = current->thread.error_code;
+	sc.eip = regs->eip;
+	*(unsigned int *)&sc.cs = regs->xcs;
+	sc.eflags = regs->eflags;
+	sc.esp_at_signal = regs->esp;
+	*(unsigned int *)&sc.ss = regs->xss;
 
 	tmp = save_i387(fpstate);
 	if (tmp < 0)
-	  err = 1;
-	else
-	  err |= __put_user(tmp ? fpstate : NULL, &sc->fpstate);
+		return 1;
+	sc.fpstate = tmp ? fpstate : NULL;
 
 	/* non-iBCS2 extensions.. */
-	err |= __put_user(mask, &sc->oldmask);
-	err |= __put_user(current->thread.cr2, &sc->cr2);
+	sc.oldmask = mask;
+	sc.cr2 = current->thread.cr2;
 
-	return err;
+	if (copy_to_user(__sc, &sc, sizeof(sc)))
+		return 1;
+	return 0;
 }
 
 /*
@@ -443,7 +441,7 @@
 	/* Create the ucontext.  */
 	err |= __put_user(0, &frame->uc.uc_flags);
 	err |= __put_user(0, &frame->uc.uc_link);
-	err |= __put_user(current->sas_ss_sp, &frame->uc.uc_stack.ss_sp);
+	err |= __put_user(current->sas_ss_sp, (unsigned long *)&frame->uc.uc_stack.ss_sp);
 	err |= __put_user(sas_ss_flags(regs->esp),
 			  &frame->uc.uc_stack.ss_flags);
 	err |= __put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size);
--- diff/arch/i386/kernel/smp.c	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/i386/kernel/smp.c	2004-02-09 10:39:50.000000000 +0000
@@ -327,10 +327,12 @@
 		 
 	if (flush_mm == cpu_tlbstate[cpu].active_mm) {
 		if (cpu_tlbstate[cpu].state == TLBSTATE_OK) {
+#ifndef CONFIG_X86_SWITCH_PAGETABLES
 			if (flush_va == FLUSH_ALL)
 				local_flush_tlb();
 			else
 				__flush_tlb_one(flush_va);
+#endif
 		} else
 			leave_mm(cpu);
 	}
@@ -355,11 +357,15 @@
 	 */
 	BUG_ON(cpus_empty(cpumask));
 
-	cpus_and(tmp, cpumask, cpu_online_map);
+	cpus_and(tmp, cpumask, cpu_callout_map);
 	BUG_ON(!cpus_equal(cpumask, tmp));
 	BUG_ON(cpu_isset(smp_processor_id(), cpumask));
 	BUG_ON(!mm);
 
+	cpus_and(cpumask, cpumask, cpu_active_map);
+	if (cpus_empty(cpumask))
+		return;
+
 	/*
 	 * i'm not happy about this global shared spinlock in the
 	 * MM hot path, but we'll see how contended it is.
@@ -387,30 +393,17 @@
 	 */
 	send_IPI_mask(cpumask, INVALIDATE_TLB_VECTOR);
 
-	while (!cpus_empty(flush_cpumask))
-		/* nothing. lockup detection does not belong here */
+	do {
 		mb();
+		tmp = flush_cpumask;
+		cpus_and(tmp, tmp, cpu_active_map);
+	} while (!cpus_empty(tmp));
 
 	flush_mm = NULL;
 	flush_va = 0;
 	spin_unlock(&tlbstate_lock);
 }
 	
-void flush_tlb_current_task(void)
-{
-	struct mm_struct *mm = current->mm;
-	cpumask_t cpu_mask;
-
-	preempt_disable();
-	cpu_mask = mm->cpu_vm_mask;
-	cpu_clear(smp_processor_id(), cpu_mask);
-
-	local_flush_tlb();
-	if (!cpus_empty(cpu_mask))
-		flush_tlb_others(cpu_mask, mm, FLUSH_ALL);
-	preempt_enable();
-}
-
 void flush_tlb_mm (struct mm_struct * mm)
 {
 	cpumask_t cpu_mask;
@@ -442,7 +435,10 @@
 
 	if (current->active_mm == mm) {
 		if(current->mm)
-			__flush_tlb_one(va);
+#ifndef CONFIG_X86_SWITCH_PAGETABLES
+			__flush_tlb_one(va)
+#endif
+				;
 		 else
 		 	leave_mm(smp_processor_id());
 	}
@@ -466,7 +462,17 @@
 {
 	on_each_cpu(do_flush_tlb_all, 0, 1, 1);
 }
-
+#ifdef CONFIG_KGDB
+/*
+ * By using the NMI code instead of a vector we just sneak thru the
+ * word generator coming out with just what we want.  AND it does
+ * not matter if clustered_apic_mode is set or not.
+ */
+void smp_send_nmi_allbutself(void)
+{
+	send_IPI_allbutself(APIC_DM_NMI);
+}
+#endif
 /*
  * this function sends a 'reschedule' IPI to another CPU.
  * it goes straight through and wastes no time serializing
@@ -481,13 +487,13 @@
  * Structure and data for smp_call_function(). This is designed to minimise
  * static memory requirements. It also looks cleaner.
  */
-static spinlock_t call_lock = SPIN_LOCK_UNLOCKED;
+spinlock_t call_lock = SPIN_LOCK_UNLOCKED;
 
 struct call_data_struct {
 	void (*func) (void *info);
 	void *info;
-	atomic_t started;
-	atomic_t finished;
+	cpumask_t not_started;
+	cpumask_t not_finished;
 	int wait;
 };
 
@@ -514,32 +520,44 @@
  */
 {
 	struct call_data_struct data;
-	int cpus = num_online_cpus()-1;
+	cpumask_t mask;
+	int cpu;
 
-	if (!cpus)
-		return 0;
+	spin_lock(&call_lock);
 
+	cpu = smp_processor_id();
 	data.func = func;
 	data.info = info;
-	atomic_set(&data.started, 0);
+	data.not_started = cpu_active_map;
+	cpu_clear(cpu, data.not_started);
+	if (cpus_empty(data.not_started))
+		goto out_unlock;
+
 	data.wait = wait;
 	if (wait)
-		atomic_set(&data.finished, 0);
+		data.not_finished = data.not_started;
 
-	spin_lock(&call_lock);
 	call_data = &data;
 	mb();
 	
 	/* Send a message to all other CPUs and wait for them to respond */
-	send_IPI_allbutself(CALL_FUNCTION_VECTOR);
+	send_IPI_mask(data.not_started, CALL_FUNCTION_VECTOR);
 
 	/* Wait for response */
-	while (atomic_read(&data.started) != cpus)
-		barrier();
+	do {
+		mb();
+		mask = data.not_started;
+		cpus_and(mask, mask, cpu_active_map);
+	} while(!cpus_empty(mask));
 
 	if (wait)
-		while (atomic_read(&data.finished) != cpus)
-			barrier();
+		do {
+			mb();
+			mask = data.not_finished;
+			cpus_and(mask, mask, cpu_active_map);
+		} while(!cpus_empty(mask));
+
+out_unlock:
 	spin_unlock(&call_lock);
 
 	return 0;
@@ -551,6 +569,7 @@
 	 * Remove this CPU:
 	 */
 	cpu_clear(smp_processor_id(), cpu_online_map);
+	cpu_clear(smp_processor_id(), cpu_active_map);
 	local_irq_disable();
 	disable_local_APIC();
 	if (cpu_data[smp_processor_id()].hlt_works_ok)
@@ -583,17 +602,25 @@
 
 asmlinkage 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;
+	int cpu = smp_processor_id();
 
 	ack_APIC_irq();
+
+	func = call_data->func;
+	info = call_data->info;
+	wait = call_data->wait;
+
 	/*
 	 * Notify initiating CPU that I've grabbed the data and am
 	 * about to execute the function
 	 */
-	mb();
-	atomic_inc(&call_data->started);
+	smp_mb__before_clear_bit();
+	cpu_clear(cpu, call_data->not_started);
+	smp_mb__after_clear_bit();
+
 	/*
 	 * At this point the info structure may be out of scope unless wait==1
 	 */
@@ -602,8 +629,9 @@
 	irq_exit();
 
 	if (wait) {
-		mb();
-		atomic_inc(&call_data->finished);
+		smp_mb__before_clear_bit();
+		cpu_clear(cpu, call_data->not_finished);
+		smp_mb__after_clear_bit();
 	}
 }
 
--- diff/arch/i386/kernel/smpboot.c	2003-10-09 09:47:33.000000000 +0100
+++ source/arch/i386/kernel/smpboot.c	2004-02-09 10:39:50.000000000 +0000
@@ -33,15 +33,20 @@
  *		Dave Jones	:	Report invalid combinations of Athlon CPUs.
 *		Rusty Russell	:	Hacked into shape for new "hotplug" boot process. */
 
+#include <linux/module.h>
 #include <linux/config.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 
 #include <linux/mm.h>
+#include <linux/sched.h>
 #include <linux/kernel_stat.h>
 #include <linux/smp_lock.h>
 #include <linux/irq.h>
 #include <linux/bootmem.h>
+#include <linux/notifier.h>
+#include <linux/cpu.h>
+#include <linux/percpu.h>
 
 #include <linux/delay.h>
 #include <linux/mc146818rtc.h>
@@ -64,7 +69,12 @@
 /* bitmap of online cpus */
 cpumask_t cpu_online_map;
 
-static cpumask_t cpu_callin_map;
+#ifdef CONFIG_HOTPLUG_CPU
+cpumask_t cpu_active_map;
+#endif
+
+/* Initialize, although master cpu never calls in */
+static volatile cpumask_t cpu_callin_map;
 cpumask_t cpu_callout_map;
 static cpumask_t smp_commenced_mask;
 
@@ -82,6 +92,9 @@
 extern unsigned char trampoline_end  [];
 static unsigned char *trampoline_base;
 
+/* State of each CPU. */
+DEFINE_PER_CPU(int, cpu_state) = { 0 };
+
 /*
  * Currently trivial. Write the real->protected mode
  * bootstrap into the page concerned. The caller
@@ -456,7 +469,9 @@
 	 * the local TLBs too.
 	 */
 	local_flush_tlb();
+	/* cpu_set should suffice for this stage of bootup -zwane*/
 	cpu_set(smp_processor_id(), cpu_online_map);
+	cpu_set(smp_processor_id(), cpu_active_map);
 	wmb();
 	return cpu_idle();
 }
@@ -503,6 +518,7 @@
 				{ [0 ... MAX_NUMNODES-1] = CPU_MASK_NONE };
 /* which node each logical CPU is on */
 int cpu_2_node[NR_CPUS] = { [0 ... NR_CPUS-1] = 0 };
+EXPORT_SYMBOL(cpu_2_node);
 
 /* set up a mapping between cpu and node. */
 static inline void map_cpu_to_node(int cpu, int node)
@@ -932,7 +948,7 @@
 /* Where the IO area was mapped on multiquad, always 0 otherwise */
 void *xquad_portio;
 
-int cpu_sibling_map[NR_CPUS] __cacheline_aligned;
+cpumask_t cpu_sibling_map[NR_CPUS] __cacheline_aligned;
 
 static void __init smp_boot_cpus(unsigned int max_cpus)
 {
@@ -950,6 +966,8 @@
 
 	current_thread_info()->cpu = 0;
 	smp_tune_scheduling();
+	cpus_clear(cpu_sibling_map[0]);
+	cpu_set(0, cpu_sibling_map[0]);
 
 	/*
 	 * If we couldn't find an SMP configuration at boot time,
@@ -1078,32 +1096,34 @@
 	Dprintk("Boot done.\n");
 
 	/*
-	 * If Hyper-Threading is avaialble, construct cpu_sibling_map[], so
-	 * that we can tell the sibling CPU efficiently.
+	 * construct cpu_sibling_map[], so that we can tell sibling CPUs
+	 * efficiently.
 	 */
-	if (cpu_has_ht && smp_num_siblings > 1) {
-		for (cpu = 0; cpu < NR_CPUS; cpu++)
-			cpu_sibling_map[cpu] = NO_PROC_ID;
-		
-		for (cpu = 0; cpu < NR_CPUS; cpu++) {
-			int 	i;
-			if (!cpu_isset(cpu, cpu_callout_map))
-				continue;
+	for (cpu = 0; cpu < NR_CPUS; cpu++)
+		cpus_clear(cpu_sibling_map[cpu]);
+
+	for (cpu = 0; cpu < NR_CPUS; cpu++) {
+		int siblings = 0;
+		int i;
+		if (!cpu_isset(cpu, cpu_callout_map))
+			continue;
 
+		if (smp_num_siblings > 1) {
 			for (i = 0; i < NR_CPUS; i++) {
-				if (i == cpu || !cpu_isset(i, cpu_callout_map))
+				if (!cpu_isset(i, cpu_callout_map))
 					continue;
 				if (phys_proc_id[cpu] == phys_proc_id[i]) {
-					cpu_sibling_map[cpu] = i;
-					printk("cpu_sibling_map[%d] = %d\n", cpu, cpu_sibling_map[cpu]);
-					break;
+					siblings++;
+					cpu_set(i, cpu_sibling_map[cpu]);
 				}
 			}
-			if (cpu_sibling_map[cpu] == NO_PROC_ID) {
-				smp_num_siblings = 1;
-				printk(KERN_WARNING "WARNING: No sibling found for CPU %d.\n", cpu);
-			}
+		} else {
+			siblings++;
+			cpu_set(cpu, cpu_sibling_map[cpu]);
 		}
+
+		if (siblings != smp_num_siblings)
+			printk(KERN_WARNING "WARNING: %d siblings found for CPU%d, should be %d\n", siblings, cpu, smp_num_siblings);
 	}
 
 	smpboot_setup_io_apic();
@@ -1117,33 +1137,325 @@
 		synchronize_tsc_bp();
 }
 
+#ifdef CONFIG_SCHED_SMT
+#ifdef CONFIG_NUMA
+static struct sched_group sched_group_cpus[NR_CPUS];
+static struct sched_group sched_group_phys[NR_CPUS];
+static struct sched_group sched_group_nodes[MAX_NUMNODES];
+static DEFINE_PER_CPU(struct sched_domain, phys_domains);
+static DEFINE_PER_CPU(struct sched_domain, node_domains);
+__init void arch_init_sched_domains(void)
+{
+	int i;
+	struct sched_group *first_cpu = NULL, *last_cpu = NULL;
+
+	/* Set up domains */
+	for_each_cpu_mask(i, cpu_online_map) {
+		struct sched_domain *cpu_domain = cpu_sched_domain(i);
+		struct sched_domain *phys_domain = &per_cpu(phys_domains, i);
+		struct sched_domain *node_domain = &per_cpu(node_domains, i);
+		int node = cpu_to_node(i);
+		cpumask_t nodemask = node_to_cpumask(node);
+
+		*cpu_domain = SD_SIBLING_INIT;
+		cpu_domain->span = cpu_sibling_map[i];
+
+		*phys_domain = SD_CPU_INIT;
+		phys_domain->span = nodemask;
+		phys_domain->flags |= SD_FLAG_IDLE;
+
+		*node_domain = SD_NODE_INIT;
+		node_domain->span = cpu_online_map;
+	}
+
+	/* Set up CPU (sibling) groups */
+	for_each_cpu_mask(i, cpu_online_map) {
+		struct sched_domain *cpu_domain = cpu_sched_domain(i);
+		int j;
+		first_cpu = last_cpu = NULL;
+
+		if (i != first_cpu(cpu_domain->span))
+			continue;
+
+		for_each_cpu_mask(j, cpu_domain->span) {
+			struct sched_group *cpu = &sched_group_cpus[j];
+
+			cpu->cpumask = CPU_MASK_NONE;
+			cpu_set(j, cpu->cpumask);
+
+			if (!first_cpu)
+				first_cpu = cpu;
+			if (last_cpu)
+				last_cpu->next = cpu;
+			last_cpu = cpu;
+		}
+		last_cpu->next = first_cpu;
+	}
+
+	for (i = 0; i < MAX_NUMNODES; i++) {
+		int j;
+		cpumask_t nodemask;
+		cpus_and(nodemask, node_to_cpumask(i), cpu_online_map);
+
+		first_cpu = last_cpu = NULL;
+		/* Set up physical groups */
+		for_each_cpu_mask(j, nodemask) {
+			struct sched_domain *cpu_domain = cpu_sched_domain(j);
+			struct sched_group *cpu = &sched_group_phys[j];
+
+			if (j != first_cpu(cpu_domain->span))
+				continue;
+
+			cpu->cpumask = cpu_domain->span;
+
+			if (!first_cpu)
+				first_cpu = cpu;
+			if (last_cpu)
+				last_cpu->next = cpu;
+			last_cpu = cpu;
+		}
+		last_cpu->next = first_cpu;
+	}
+
+	/* Set up nodes */
+	first_cpu = last_cpu = NULL;
+	for (i = 0; i < MAX_NUMNODES; i++) {
+		struct sched_group *cpu = &sched_group_nodes[i];
+		cpumask_t nodemask;
+		cpus_and(nodemask, node_to_cpumask(i), cpu_online_map);
+
+		if (cpus_empty(nodemask))
+			continue;
+
+		cpu->cpumask = nodemask;
+
+		if (!first_cpu)
+			first_cpu = cpu;
+		if (last_cpu)
+			last_cpu->next = cpu;
+		last_cpu = cpu;
+	}
+	last_cpu->next = first_cpu;
+
+
+	mb();
+	for_each_cpu_mask(i, cpu_online_map) {
+		int node = cpu_to_node(i);
+		struct sched_domain *cpu_domain = cpu_sched_domain(i);
+		struct sched_domain *phys_domain = &per_cpu(phys_domains, i);
+		struct sched_domain *node_domain = &per_cpu(node_domains, i);
+		struct sched_group *cpu_group = &sched_group_cpus[i];
+		struct sched_group *phys_group = &sched_group_phys[first_cpu(cpu_domain->span)];
+		struct sched_group *node_group = &sched_group_nodes[node];
+
+		cpu_domain->parent = phys_domain;
+		phys_domain->parent = node_domain;
+
+		node_domain->groups = node_group;
+		phys_domain->groups = phys_group;
+		cpu_domain->groups = cpu_group;
+	}
+}
+#else /* CONFIG_NUMA */
+static struct sched_group sched_group_cpus[NR_CPUS];
+static struct sched_group sched_group_phys[NR_CPUS];
+static DEFINE_PER_CPU(struct sched_domain, phys_domains);
+__init void arch_init_sched_domains(void)
+{
+	int i;
+	struct sched_group *first_cpu = NULL, *last_cpu = NULL;
+
+	/* Set up domains */
+	for_each_cpu_mask(i, cpu_online_map) {
+		struct sched_domain *cpu_domain = cpu_sched_domain(i);
+		struct sched_domain *phys_domain = &per_cpu(phys_domains, i);
+
+		*cpu_domain = SD_SIBLING_INIT;
+		cpu_domain->span = cpu_sibling_map[i];
+
+		*phys_domain = SD_CPU_INIT;
+		phys_domain->span = cpu_online_map;
+		phys_domain->flags |= SD_FLAG_IDLE;
+	}
+
+	/* Set up CPU (sibling) groups */
+	for_each_cpu_mask(i, cpu_online_map) {
+		struct sched_domain *cpu_domain = cpu_sched_domain(i);
+		int j;
+		first_cpu = last_cpu = NULL;
+
+		if (i != first_cpu(cpu_domain->span))
+			continue;
+
+		for_each_cpu_mask(j, cpu_domain->span) {
+			struct sched_group *cpu = &sched_group_cpus[j];
+
+			cpus_clear(cpu->cpumask);
+			cpu_set(j, cpu->cpumask);
+
+			if (!first_cpu)
+				first_cpu = cpu;
+			if (last_cpu)
+				last_cpu->next = cpu;
+			last_cpu = cpu;
+		}
+		last_cpu->next = first_cpu;
+	}
+
+	first_cpu = last_cpu = NULL;
+	/* Set up physical groups */
+	for_each_cpu_mask(i, cpu_online_map) {
+		struct sched_domain *cpu_domain = cpu_sched_domain(i);
+		struct sched_group *cpu = &sched_group_phys[i];
+
+		if (i != first_cpu(cpu_domain->span))
+			continue;
+
+		cpu->cpumask = cpu_domain->span;
+
+		if (!first_cpu)
+			first_cpu = cpu;
+		if (last_cpu)
+			last_cpu->next = cpu;
+		last_cpu = cpu;
+	}
+	last_cpu->next = first_cpu;
+
+	mb();
+	for_each_cpu_mask(i, cpu_online_map) {
+		struct sched_domain *cpu_domain = cpu_sched_domain(i);
+		struct sched_domain *phys_domain = &per_cpu(phys_domains, i);
+		struct sched_group *cpu_group = &sched_group_cpus[i];
+		struct sched_group *phys_group = &sched_group_phys[first_cpu(cpu_domain->span)];
+		cpu_domain->parent = phys_domain;
+		phys_domain->groups = phys_group;
+		cpu_domain->groups = cpu_group;
+	}
+}
+#endif /* CONFIG_NUMA */
+#endif /* CONFIG_SCHED_SMT */
+
 /* These are wrappers to interface to the new boot process.  Someone
    who understands all this stuff should rewrite it properly. --RR 15/Jul/02 */
 void __init smp_prepare_cpus(unsigned int max_cpus)
 {
+	smp_commenced_mask = cpumask_of_cpu(0);
+	cpu_callin_map = cpumask_of_cpu(0);
+	mb();
 	smp_boot_cpus(max_cpus);
 }
 
 void __devinit smp_prepare_boot_cpu(void)
 {
 	cpu_set(smp_processor_id(), cpu_online_map);
+	cpu_set(smp_processor_id(), cpu_active_map);
 	cpu_set(smp_processor_id(), cpu_callout_map);
 }
 
+#ifdef CONFIG_HOTPLUG_CPU
+/* must be called with the cpucontrol mutex held */
+static int __devinit cpu_enable(unsigned int cpu)
+{
+	/* get the target out of it's holding state */
+	per_cpu(cpu_state, cpu) = CPU_UP_PREPARE;
+	wmb();
+
+	/* wait for the processor to ack it. timeout? */
+	while (!cpu_online(cpu))
+		cpu_relax();
+	return 0;
+}
+
+int __cpu_disable(void)
+{
+	int cpu = smp_processor_id();
+	/*
+	 * Nothing for now, perhaps use cpufreq to drop frequency,
+	 * but that could go into generic code.
+ 	 *
+	 * We won't take down the boot processor on i386 due to some
+	 * interrupts only being able to be serviced by the BSP.
+	 * Especially so if we're not using an IOAPIC	-zwane
+	 */
+	if (cpu == 0)
+		return -EBUSY;
+
+	BUG_ON(!cpu_isset(cpu, cpu_active_map));
+	BUG_ON(!cpu_isset(cpu, cpu_online_map));
+	wmb();
+	cpu_clear(cpu, cpu_online_map);
+	wmb();
+
+	return 0;
+}
+
+static void do_nothing(void *unused)
+{
+	return;
+}
+
+void __cpu_die(unsigned int cpu)
+{
+	unsigned int i;
+
+	/* Final threads can take some time to actually clean up */
+	while (!idle_cpu(cpu))
+ 		yield();
+
+	per_cpu(cpu_state, cpu) = CPU_OFFLINE;
+	wmb();
+	for (i = 0; i < 10; i++) {
+		wake_idle_cpu(cpu);
+		/* They ack this in check_cpu_quiescent by setting CPU_DEAD */
+		if (per_cpu(cpu_state, cpu) == CPU_DEAD) {
+			/*
+			 * This prevents a race in smp_call_function due
+			 * to the rapid online of the same CPU which just died.
+			 */
+			smp_call_function(do_nothing, NULL, 1, 1);
+			return;
+		}
+		current->state = TASK_UNINTERRUPTIBLE;
+		schedule_timeout(HZ/10);
+	}
+ 	printk(KERN_ERR "CPU %u didn't die...\n", cpu);
+}
+#else /* ... !CONFIG_HOTPLUG_CPU */
+int __cpu_disable(void)
+{
+	return -ENOSYS;
+}
+
+void __cpu_die(unsigned int cpu)
+{
+	/* We said "no" in __cpu_disable */
+	BUG();
+}
+#endif /* CONFIG_HOTPLUG_CPU */
+
 int __devinit __cpu_up(unsigned int cpu)
 {
 	/* This only works at boot for x86.  See "rewrite" above. */
-	if (cpu_isset(cpu, smp_commenced_mask)) {
+	if (cpu_isset(cpu, smp_commenced_mask) && cpu_online(cpu)) {
 		local_irq_enable();
 		return -ENOSYS;
 	}
 
 	/* In case one didn't come up */
 	if (!cpu_isset(cpu, cpu_callin_map)) {
+		printk(KERN_DEBUG "skipping cpu%d, didn't come online\n", cpu);
 		local_irq_enable();
 		return -EIO;
 	}
 
+#ifdef CONFIG_HOTPLUG_CPU
+	/* Already up, and in cpu_quiescent now? */
+	if (cpu_isset(cpu, smp_commenced_mask)) {
+		cpu_enable(cpu);
+		/* we can simply fall through */
+	}
+#endif
+
 	local_irq_enable();
 	/* Unleash the CPU! */
 	cpu_set(cpu, smp_commenced_mask);
--- diff/arch/i386/kernel/sysenter.c	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/i386/kernel/sysenter.c	2004-02-09 10:39:50.000000000 +0000
@@ -18,13 +18,18 @@
 #include <asm/msr.h>
 #include <asm/pgtable.h>
 #include <asm/unistd.h>
+#include <linux/highmem.h>
 
 extern asmlinkage void sysenter_entry(void);
 
 void enable_sep_cpu(void *info)
 {
 	int cpu = get_cpu();
+#ifdef CONFIG_X86_HIGH_ENTRY
+	struct tss_struct *tss = (struct tss_struct *) __fix_to_virt(FIX_TSS_0) + cpu;
+#else
 	struct tss_struct *tss = init_tss + cpu;
+#endif
 
 	tss->ss1 = __KERNEL_CS;
 	tss->esp1 = sizeof(struct tss_struct) + (unsigned long) tss;
--- diff/arch/i386/kernel/timers/Makefile	2003-09-30 15:46:11.000000000 +0100
+++ source/arch/i386/kernel/timers/Makefile	2004-02-09 10:39:50.000000000 +0000
@@ -6,3 +6,4 @@
 
 obj-$(CONFIG_X86_CYCLONE_TIMER)	+= timer_cyclone.o
 obj-$(CONFIG_HPET_TIMER)	+= timer_hpet.o
+obj-$(CONFIG_X86_PM_TIMER)	+= timer_pm.o
--- diff/arch/i386/kernel/timers/common.c	2003-09-30 15:46:11.000000000 +0100
+++ source/arch/i386/kernel/timers/common.c	2004-02-09 10:39:50.000000000 +0000
@@ -137,3 +137,23 @@
 }
 #endif
 
+/* calculate cpu_khz */
+void __init init_cpu_khz(void)
+{
+	if (cpu_has_tsc) {
+		unsigned long tsc_quotient = calibrate_tsc();
+		if (tsc_quotient) {
+			/* report CPU clock rate in Hz.
+			 * The formula is (10^6 * 2^32) / (2^32 * 1 / (clocks/us)) =
+			 * clock/second. Our precision is about 100 ppm.
+			 */
+			{	unsigned long eax=0, edx=1000;
+				__asm__("divl %2"
+		       		:"=a" (cpu_khz), "=d" (edx)
+        	       		:"r" (tsc_quotient),
+	                	"0" (eax), "1" (edx));
+				printk("Detected %lu.%03lu MHz processor.\n", cpu_khz / 1000, cpu_khz % 1000);
+			}
+		}
+	}
+}
--- diff/arch/i386/kernel/timers/timer.c	2003-09-17 12:28:01.000000000 +0100
+++ source/arch/i386/kernel/timers/timer.c	2004-02-09 10:39:50.000000000 +0000
@@ -19,6 +19,9 @@
 #ifdef CONFIG_HPET_TIMER
 	&timer_hpet,
 #endif
+#ifdef CONFIG_X86_PM_TIMER
+	&timer_pmtmr,
+#endif
 	&timer_tsc,
 	&timer_pit,
 	NULL,
--- diff/arch/i386/kernel/timers/timer_cyclone.c	2004-01-19 10:22:55.000000000 +0000
+++ source/arch/i386/kernel/timers/timer_cyclone.c	2004-02-09 10:39:50.000000000 +0000
@@ -212,26 +212,7 @@
 		}
 	}
 
-	/* init cpu_khz.
-	 * XXX - This should really be done elsewhere, 
-	 * 		and in a more generic fashion. -johnstul@us.ibm.com
-	 */
-	if (cpu_has_tsc) {
-		unsigned long tsc_quotient = calibrate_tsc();
-		if (tsc_quotient) {
-			/* report CPU clock rate in Hz.
-			 * The formula is (10^6 * 2^32) / (2^32 * 1 / (clocks/us)) =
-			 * clock/second. Our precision is about 100 ppm.
-			 */
-			{	unsigned long eax=0, edx=1000;
-				__asm__("divl %2"
-		       		:"=a" (cpu_khz), "=d" (edx)
-        	       		:"r" (tsc_quotient),
-	                	"0" (eax), "1" (edx));
-				printk("Detected %lu.%03lu MHz processor.\n", cpu_khz / 1000, cpu_khz % 1000);
-			}
-		}
-	}
+	init_cpu_khz();
 
 	/* Everything looks good! */
 	return 0;
--- diff/arch/i386/kernel/timers/timer_tsc.c	2004-01-19 10:22:55.000000000 +0000
+++ source/arch/i386/kernel/timers/timer_tsc.c	2004-02-09 10:39:50.000000000 +0000
@@ -232,9 +232,13 @@
 		/* sanity check to ensure we're not always losing ticks */
 		if (lost_count++ > 100) {
 			printk(KERN_WARNING "Losing too many ticks!\n");
-			printk(KERN_WARNING "TSC cannot be used as a timesource."
-					" (Are you running with SpeedStep?)\n");
-			printk(KERN_WARNING "Falling back to a sane timesource.\n");
+			printk(KERN_WARNING "TSC cannot be used as a timesource.  ");
+			printk(KERN_WARNING "Possible reasons for this are:\n");
+			printk(KERN_WARNING "  You're running with Speedstep,\n");
+			printk(KERN_WARNING "  You don't have DMA enabled for your hard disk (see hdparm),\n");
+			printk(KERN_WARNING "  Incorrect TSC synchronization on an SMP system (see dmesg).\n");
+			printk(KERN_WARNING "Falling back to a sane timesource now.\n");
+
 			clock_fallback();
 		}
 	} else
--- diff/arch/i386/kernel/traps.c	2003-10-27 09:20:36.000000000 +0000
+++ source/arch/i386/kernel/traps.c	2004-02-09 10:39:50.000000000 +0000
@@ -54,12 +54,8 @@
 
 #include "mach_traps.h"
 
-asmlinkage int system_call(void);
-asmlinkage void lcall7(void);
-asmlinkage void lcall27(void);
-
-struct desc_struct default_ldt[] = { { 0, 0 }, { 0, 0 }, { 0, 0 },
-		{ 0, 0 }, { 0, 0 } };
+struct desc_struct default_ldt[] __attribute__((__section__(".data.default_ldt"))) = { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 } };
+struct page *default_ldt_page;
 
 /* Do we ignore FPU interrupts ? */
 char ignore_fpu_irq = 0;
@@ -91,6 +87,43 @@
 asmlinkage void spurious_interrupt_bug(void);
 asmlinkage void machine_check(void);
 
+#ifdef CONFIG_KGDB
+extern void sysenter_entry(void);
+#include <asm/kgdb.h>
+#include <linux/init.h>
+extern void int3(void);
+extern void debug(void);
+void set_intr_gate(unsigned int n, void *addr);
+static void set_intr_usr_gate(unsigned int n, void *addr);
+/*
+ * Should be able to call this breakpoint() very early in
+ * bring up.  Just hard code the call where needed.
+ * The breakpoint() code is here because set_?_gate() functions
+ * are local (static) to trap.c.  They need be done only once,
+ * but it does not hurt to do them over.
+ */
+void breakpoint(void)
+{
+	init_entry_mappings();
+        set_intr_usr_gate(3,&int3); /* disable ints on trap */
+	set_intr_gate(1,&debug);
+	set_intr_gate(14,&page_fault);
+
+        BREAKPOINT;
+}
+#define	CHK_REMOTE_DEBUG(trapnr,signr,error_code,regs,after)		\
+    {									\
+	if (!user_mode(regs)  ) \
+	{								\
+		kgdb_handle_exception(trapnr, signr, error_code, regs);	\
+		after;							\
+	} else if ((trapnr == 3) && (regs->eflags &0x200)) local_irq_enable(); \
+    }
+#else
+#define	CHK_REMOTE_DEBUG(trapnr,signr,error_code,regs,after)
+#endif
+
+
 static int kstack_depth_to_print = 24;
 
 void show_trace(struct task_struct *task, unsigned long * stack)
@@ -175,8 +208,9 @@
 		ss = regs->xss & 0xffff;
 	}
 	print_modules();
-	printk("CPU:    %d\nEIP:    %04x:[<%08lx>]    %s\nEFLAGS: %08lx\n",
-		smp_processor_id(), 0xffff & regs->xcs, regs->eip, print_tainted(), regs->eflags);
+	printk("CPU:    %d\nEIP:    %04x:[<%08lx>]    %s VLI\nEFLAGS: %08lx\n",
+		smp_processor_id(), 0xffff & regs->xcs,
+		regs->eip, print_tainted(), regs->eflags);
 
 	print_symbol("EIP is at %s\n", regs->eip);
 	printk("eax: %08lx   ebx: %08lx   ecx: %08lx   edx: %08lx\n",
@@ -192,23 +226,27 @@
 	 * time of the fault..
 	 */
 	if (in_kernel) {
+		u8 *eip;
 
 		printk("\nStack: ");
 		show_stack(NULL, (unsigned long*)esp);
 
 		printk("Code: ");
-		if(regs->eip < PAGE_OFFSET)
-			goto bad;
 
-		for(i=0;i<20;i++)
-		{
-			unsigned char c;
-			if(__get_user(c, &((unsigned char*)regs->eip)[i])) {
-bad:
+		eip = (u8 *)regs->eip - 43;
+		for (i = 0; i < 64; i++, eip++) {
+			unsigned char c = 0xff;
+
+			if ((user_mode(regs) && get_user(c, eip)) ||
+			    (!user_mode(regs) && __direct_get_user(c, eip))) {
+
 				printk(" Bad EIP value.");
 				break;
 			}
-			printk("%02x ", c);
+			if (eip == (u8 *)regs->eip)
+				printk("<%02x> ", c);
+			else
+				printk("%02x ", c);
 		}
 	}
 	printk("\n");
@@ -255,12 +293,36 @@
 void die(const char * str, struct pt_regs * regs, long err)
 {
 	static int die_counter;
+	int nl = 0;
 
 	console_verbose();
 	spin_lock_irq(&die_lock);
 	bust_spinlocks(1);
 	handle_BUG(regs);
 	printk("%s: %04lx [#%d]\n", str, err & 0xffff, ++die_counter);
+#ifdef CONFIG_PREEMPT
+	printk("PREEMPT ");
+	nl = 1;
+#endif
+#ifdef CONFIG_SMP
+	printk("SMP ");
+	nl = 1;
+#endif
+#ifdef CONFIG_DEBUG_PAGEALLOC
+	printk("DEBUG_PAGEALLOC");
+	nl = 1;
+#endif
+	if (nl)
+		printk("\n");
+#ifdef CONFIG_KGDB
+	/* This is about the only place we want to go to kgdb even if in
+	 * user mode.  But we must go in via a trap so within kgdb we will
+	 * always be in kernel mode.
+	 */
+	if (user_mode(regs))
+		BREAKPOINT;
+#endif
+ 	CHK_REMOTE_DEBUG(0,SIGTRAP,err,regs,)
 	show_registers(regs);
 	bust_spinlocks(0);
 	spin_unlock_irq(&die_lock);
@@ -330,6 +392,7 @@
 #define DO_ERROR(trapnr, signr, str, name) \
 asmlinkage void do_##name(struct pt_regs * regs, long error_code) \
 { \
+	CHK_REMOTE_DEBUG(trapnr,signr,error_code,regs,)\
 	do_trap(trapnr, signr, str, 0, regs, error_code, NULL); \
 }
 
@@ -347,7 +410,9 @@
 #define DO_VM86_ERROR(trapnr, signr, str, name) \
 asmlinkage void do_##name(struct pt_regs * regs, long error_code) \
 { \
+	CHK_REMOTE_DEBUG(trapnr, signr, error_code,regs, return)\
 	do_trap(trapnr, signr, str, 1, regs, error_code, NULL); \
+	return; \
 }
 
 #define DO_VM86_ERROR_INFO(trapnr, signr, str, name, sicode, siaddr) \
@@ -394,8 +459,10 @@
 	return;
 
 gp_in_kernel:
-	if (!fixup_exception(regs))
+	if (!fixup_exception(regs)){
+ 		CHK_REMOTE_DEBUG(13,SIGSEGV,error_code,regs,)
 		die("general protection fault", regs, error_code);
+	}
 }
 
 static void mem_parity_error(unsigned char reason, struct pt_regs * regs)
@@ -534,10 +601,18 @@
 	if (regs->eflags & X86_EFLAGS_IF)
 		local_irq_enable();
 
-	/* Mask out spurious debug traps due to lazy DR7 setting */
+	/*
+	 * Mask out spurious debug traps due to lazy DR7 setting or
+	 * due to 4G/4G kernel mode:
+	 */
 	if (condition & (DR_TRAP0|DR_TRAP1|DR_TRAP2|DR_TRAP3)) {
 		if (!tsk->thread.debugreg[7])
 			goto clear_dr7;
+		if (!user_mode(regs)) {
+			// restore upon return-to-userspace:
+			set_thread_flag(TIF_DB7);
+			goto clear_dr7;
+		}
 	}
 
 	if (regs->eflags & VM_MASK)
@@ -557,8 +632,18 @@
 		 * allowing programs to debug themselves without the ptrace()
 		 * interface.
 		 */
+#ifdef CONFIG_KGDB
+		/*
+		 * I think this is the only "real" case of a TF in the kernel
+		 * that really belongs to user space.  Others are
+		 * "Ours all ours!"
+		 */
+		if (((regs->xcs & 3) == 0) && ((void *)regs->eip == sysenter_entry))
+			goto clear_TF_reenable;
+#else
 		if ((regs->xcs & 3) == 0)
 			goto clear_TF_reenable;
+#endif
 		if ((tsk->ptrace & (PT_DTRACE|PT_PTRACED)) == PT_DTRACE)
 			goto clear_TF;
 	}
@@ -570,6 +655,17 @@
 	info.si_errno = 0;
 	info.si_code = TRAP_BRKPT;
 	
+#ifdef CONFIG_KGDB
+        /*
+	 * If this is a kernel mode trap, we need to reset db7 to allow us
+	 * to continue sanely ALSO skip the signal delivery
+         */
+	if ((regs->xcs & 3) == 0)
+		goto clear_dr7;
+
+        /* if not kernel, allow ints but only if they were on */
+       if ( regs->eflags & 0x200) local_irq_enable();
+#endif
 	/* If this is a kernel mode trap, save the user PC on entry to 
 	 * the kernel, that's what the debugger can make sense of.
 	 */
@@ -584,6 +680,7 @@
 	__asm__("movl %0,%%db7"
 		: /* no output */
 		: "r" (0));
+	CHK_REMOTE_DEBUG(1,SIGTRAP,error_code,regs,)
 	return;
 
 debug_vm86:
@@ -779,19 +876,53 @@
 
 #endif /* CONFIG_MATH_EMULATION */
 
-#ifdef CONFIG_X86_F00F_BUG
-void __init trap_init_f00f_bug(void)
+void __init trap_init_virtual_IDT(void)
 {
-	__set_fixmap(FIX_F00F_IDT, __pa(&idt_table), PAGE_KERNEL_RO);
-
 	/*
-	 * Update the IDT descriptor and reload the IDT so that
-	 * it uses the read-only mapped virtual address.
+	 * "idt" is magic - it overlaps the idt_descr
+	 * variable so that updating idt will automatically
+	 * update the idt descriptor..
 	 */
-	idt_descr.address = fix_to_virt(FIX_F00F_IDT);
+	__set_fixmap(FIX_IDT, __pa(&idt_table), PAGE_KERNEL_RO);
+	idt_descr.address = __fix_to_virt(FIX_IDT);
+
 	__asm__ __volatile__("lidt %0" : : "m" (idt_descr));
 }
+
+void __init trap_init_virtual_GDT(void)
+{
+	int cpu = smp_processor_id();
+	struct Xgt_desc_struct *gdt_desc = cpu_gdt_descr + cpu;
+	struct Xgt_desc_struct tmp_desc = {0, 0};
+	struct tss_struct * t;
+
+	__asm__ __volatile__("sgdt %0": "=m" (tmp_desc): :"memory");
+
+#ifdef CONFIG_X86_HIGH_ENTRY
+	if (!cpu) {
+		__set_fixmap(FIX_GDT_0, __pa(cpu_gdt_table), PAGE_KERNEL);
+		__set_fixmap(FIX_GDT_1, __pa(cpu_gdt_table) + PAGE_SIZE, PAGE_KERNEL);
+		__set_fixmap(FIX_TSS_0, __pa(init_tss), PAGE_KERNEL);
+		__set_fixmap(FIX_TSS_1, __pa(init_tss) + 1*PAGE_SIZE, PAGE_KERNEL);
+		__set_fixmap(FIX_TSS_2, __pa(init_tss) + 2*PAGE_SIZE, PAGE_KERNEL);
+		__set_fixmap(FIX_TSS_3, __pa(init_tss) + 3*PAGE_SIZE, PAGE_KERNEL);
+	}
+
+	gdt_desc->address = __fix_to_virt(FIX_GDT_0) + sizeof(cpu_gdt_table[0]) * cpu;
+#else
+	gdt_desc->address = (unsigned long)cpu_gdt_table[cpu];
+#endif
+	__asm__ __volatile__("lgdt %0": "=m" (*gdt_desc));
+
+#ifdef CONFIG_X86_HIGH_ENTRY
+	t = (struct tss_struct *) __fix_to_virt(FIX_TSS_0) + cpu;
+#else
+	t = init_tss + cpu;
 #endif
+	set_tss_desc(cpu, t);
+	cpu_gdt_table[cpu][GDT_ENTRY_TSS].b &= 0xfffffdff;
+	load_TR_desc();
+}
 
 #define _set_gate(gate_addr,type,dpl,addr,seg) \
 do { \
@@ -818,20 +949,26 @@
 	_set_gate(idt_table+n,14,0,addr,__KERNEL_CS);
 }
 
-static void __init set_trap_gate(unsigned int n, void *addr)
+void __init set_trap_gate(unsigned int n, void *addr)
 {
 	_set_gate(idt_table+n,15,0,addr,__KERNEL_CS);
 }
 
-static void __init set_system_gate(unsigned int n, void *addr)
+void __init set_system_gate(unsigned int n, void *addr)
 {
 	_set_gate(idt_table+n,15,3,addr,__KERNEL_CS);
 }
 
-static void __init set_call_gate(void *a, void *addr)
+void __init set_call_gate(void *a, void *addr)
 {
 	_set_gate(a,12,3,addr,__KERNEL_CS);
 }
+#ifdef CONFIG_KGDB
+void set_intr_usr_gate(unsigned int n, void *addr)
+{
+	_set_gate(idt_table+n,14,3,addr,__KERNEL_CS);
+}
+#endif
 
 static void __init set_task_gate(unsigned int n, unsigned int gdt_entry)
 {
@@ -850,11 +987,16 @@
 #ifdef CONFIG_X86_LOCAL_APIC
 	init_apic_mappings();
 #endif
+	init_entry_mappings();
 
 	set_trap_gate(0,&divide_error);
 	set_intr_gate(1,&debug);
 	set_intr_gate(2,&nmi);
+#ifndef CONFIG_KGDB
 	set_system_gate(3,&int3);	/* int3-5 can be called from all */
+#else
+	set_intr_usr_gate(3,&int3);	/* int3-5 can be called from all */
+#endif
 	set_system_gate(4,&overflow);
 	set_system_gate(5,&bounds);
 	set_trap_gate(6,&invalid_op);
--- diff/arch/i386/kernel/vm86.c	2004-01-19 10:22:55.000000000 +0000
+++ source/arch/i386/kernel/vm86.c	2004-02-09 10:39:50.000000000 +0000
@@ -125,7 +125,7 @@
 	tss = init_tss + get_cpu();
 	current->thread.esp0 = current->thread.saved_esp0;
 	current->thread.sysenter_cs = __KERNEL_CS;
-	load_esp0(tss, &current->thread);
+	load_virtual_esp0(tss, current);
 	current->thread.saved_esp0 = 0;
 	put_cpu();
 
@@ -305,7 +305,7 @@
 	tsk->thread.esp0 = (unsigned long) &info->VM86_TSS_ESP0;
 	if (cpu_has_sep)
 		tsk->thread.sysenter_cs = 0;
-	load_esp0(tss, &tsk->thread);
+	load_virtual_esp0(tss, tsk);
 	put_cpu();
 
 	tsk->thread.screen_bitmap = info->screen_bitmap;
--- diff/arch/i386/kernel/vmlinux.lds.S	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/i386/kernel/vmlinux.lds.S	2004-02-09 10:39:50.000000000 +0000
@@ -3,6 +3,10 @@
  */
 
 #include <asm-generic/vmlinux.lds.h>
+#include <linux/config.h>
+#include <asm/page.h>
+#include <asm/processor.h>
+#include <asm/asm_offsets.h>
 	
 OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
 OUTPUT_ARCH(i386)
@@ -10,7 +14,7 @@
 jiffies = jiffies_64;
 SECTIONS
 {
-  . = 0xC0000000 + 0x100000;
+  . = __PAGE_OFFSET + 0x100000;
   /* read-only */
   _text = .;			/* Text and read-only data */
   .text : {
@@ -19,6 +23,19 @@
 	*(.gnu.warning)
 	} = 0x9090
 
+#ifdef CONFIG_X86_4G
+  . = ALIGN(PAGE_SIZE_asm);
+  __entry_tramp_start = .;
+  . = FIX_ENTRY_TRAMPOLINE_0_addr;
+  __start___entry_text = .;
+  .entry.text : AT (__entry_tramp_start) { *(.entry.text) }
+  __entry_tramp_end = __entry_tramp_start + SIZEOF(.entry.text);
+  . = __entry_tramp_end;
+  . = ALIGN(PAGE_SIZE_asm);
+#else
+  .entry.text : { *(.entry.text) }
+#endif
+
   _etext = .;			/* End of text section */
 
   . = ALIGN(16);		/* Exception table */
@@ -34,15 +51,12 @@
 	CONSTRUCTORS
 	}
 
-  . = ALIGN(4096);
+  . = ALIGN(PAGE_SIZE_asm);
   __nosave_begin = .;
   .data_nosave : { *(.data.nosave) }
-  . = ALIGN(4096);
+  . = ALIGN(PAGE_SIZE_asm);
   __nosave_end = .;
 
-  . = ALIGN(4096);
-  .data.page_aligned : { *(.data.idt) }
-
   . = ALIGN(32);
   .data.cacheline_aligned : { *(.data.cacheline_aligned) }
 
@@ -52,7 +66,7 @@
   .data.init_task : { *(.data.init_task) }
 
   /* will be freed after init */
-  . = ALIGN(4096);		/* Init code and data */
+  . = ALIGN(PAGE_SIZE_asm);		/* Init code and data */
   __init_begin = .;
   .init.text : { 
 	_sinittext = .;
@@ -91,7 +105,7 @@
      from .altinstructions and .eh_frame */
   .exit.text : { *(.exit.text) }
   .exit.data : { *(.exit.data) }
-  . = ALIGN(4096);
+  . = ALIGN(PAGE_SIZE_asm);
   __initramfs_start = .;
   .init.ramfs : { *(.init.ramfs) }
   __initramfs_end = .;
@@ -99,10 +113,22 @@
   __per_cpu_start = .;
   .data.percpu  : { *(.data.percpu) }
   __per_cpu_end = .;
-  . = ALIGN(4096);
+  . = ALIGN(PAGE_SIZE_asm);
   __init_end = .;
   /* freed after init ends here */
-	
+
+  . = ALIGN(PAGE_SIZE_asm);
+  .data.page_aligned_tss : { *(.data.tss) }
+
+  . = ALIGN(PAGE_SIZE_asm);
+  .data.page_aligned_default_ldt : { *(.data.default_ldt) }
+
+  . = ALIGN(PAGE_SIZE_asm);
+  .data.page_aligned_idt : { *(.data.idt) }
+
+  . = ALIGN(PAGE_SIZE_asm);
+  .data.page_aligned_gdt : { *(.data.gdt) }
+
   __bss_start = .;		/* BSS */
   .bss : { *(.bss) }
   __bss_stop = .; 
@@ -122,4 +148,6 @@
   .stab.index 0 : { *(.stab.index) }
   .stab.indexstr 0 : { *(.stab.indexstr) }
   .comment 0 : { *(.comment) }
+
+
 }
--- diff/arch/i386/kernel/vsyscall-sysenter.S	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/i386/kernel/vsyscall-sysenter.S	2004-02-09 10:39:50.000000000 +0000
@@ -7,6 +7,11 @@
 	.type __kernel_vsyscall,@function
 __kernel_vsyscall:
 .LSTART_vsyscall:
+	cmpl $192, %eax
+	jne 1f
+	int $0x80
+	ret
+1:
 	push %ecx
 .Lpush_ecx:
 	push %edx
--- diff/arch/i386/kernel/vsyscall.lds	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/i386/kernel/vsyscall.lds	2004-02-09 10:39:50.000000000 +0000
@@ -5,7 +5,7 @@
  */
 
 /* This must match <asm/fixmap.h>.  */
-VSYSCALL_BASE = 0xffffe000;
+VSYSCALL_BASE = 0xffffd000;
 
 SECTIONS
 {
--- diff/arch/i386/lib/Makefile	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/i386/lib/Makefile	2004-02-09 10:39:50.000000000 +0000
@@ -9,4 +9,5 @@
 
 lib-$(CONFIG_X86_USE_3DNOW) += mmx.o
 lib-$(CONFIG_HAVE_DEC_LOCK) += dec_and_lock.o
+lib-$(CONFIG_KGDB) += kgdb_serial.o
 lib-$(CONFIG_DEBUG_IOVIRT)  += iodebug.o
--- diff/arch/i386/lib/checksum.S	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/i386/lib/checksum.S	2004-02-09 10:39:50.000000000 +0000
@@ -280,14 +280,14 @@
 	.previous
 
 .align 4
-.globl csum_partial_copy_generic
+.globl direct_csum_partial_copy_generic
 				
 #ifndef CONFIG_X86_USE_PPRO_CHECKSUM
 
 #define ARGBASE 16		
 #define FP		12
 		
-csum_partial_copy_generic:
+direct_csum_partial_copy_generic:
 	subl  $4,%esp	
 	pushl %edi
 	pushl %esi
@@ -422,7 +422,7 @@
 
 #define ARGBASE 12
 		
-csum_partial_copy_generic:
+direct_csum_partial_copy_generic:
 	pushl %ebx
 	pushl %edi
 	pushl %esi
--- diff/arch/i386/lib/dec_and_lock.c	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/i386/lib/dec_and_lock.c	2004-02-09 10:39:50.000000000 +0000
@@ -10,6 +10,7 @@
 #include <linux/spinlock.h>
 #include <asm/atomic.h>
 
+#ifndef ATOMIC_DEC_AND_LOCK
 int atomic_dec_and_lock(atomic_t *atomic, spinlock_t *lock)
 {
 	int counter;
@@ -38,3 +39,5 @@
 	spin_unlock(lock);
 	return 0;
 }
+#endif
+
--- diff/arch/i386/lib/getuser.S	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/i386/lib/getuser.S	2004-02-09 10:39:50.000000000 +0000
@@ -9,6 +9,7 @@
  * return value.
  */
 #include <asm/thread_info.h>
+#include <asm/asm_offsets.h>
 
 
 /*
@@ -28,7 +29,7 @@
 .globl __get_user_1
 __get_user_1:
 	GET_THREAD_INFO(%edx)
-	cmpl TI_ADDR_LIMIT(%edx),%eax
+	cmpl TI_addr_limit(%edx),%eax
 	jae bad_get_user
 1:	movzbl (%eax),%edx
 	xorl %eax,%eax
@@ -40,7 +41,7 @@
 	addl $1,%eax
 	jc bad_get_user
 	GET_THREAD_INFO(%edx)
-	cmpl TI_ADDR_LIMIT(%edx),%eax
+	cmpl TI_addr_limit(%edx),%eax
 	jae bad_get_user
 2:	movzwl -1(%eax),%edx
 	xorl %eax,%eax
@@ -52,7 +53,7 @@
 	addl $3,%eax
 	jc bad_get_user
 	GET_THREAD_INFO(%edx)
-	cmpl TI_ADDR_LIMIT(%edx),%eax
+	cmpl TI_addr_limit(%edx),%eax
 	jae bad_get_user
 3:	movl -3(%eax),%edx
 	xorl %eax,%eax
--- diff/arch/i386/lib/mmx.c	2003-05-21 11:49:45.000000000 +0100
+++ source/arch/i386/lib/mmx.c	2004-02-09 10:39:50.000000000 +0000
@@ -121,7 +121,7 @@
 	return p;
 }
 
-#ifdef CONFIG_MK7
+#ifdef CONFIG_CPU_ONLY_K7
 
 /*
  *	The K7 has streaming cache bypass load/store. The Cyrix III, K6 and
--- diff/arch/i386/lib/usercopy.c	2004-01-19 10:22:55.000000000 +0000
+++ source/arch/i386/lib/usercopy.c	2004-02-09 10:39:50.000000000 +0000
@@ -76,7 +76,7 @@
  * and returns @count.
  */
 long
-__strncpy_from_user(char *dst, const char __user *src, long count)
+__direct_strncpy_from_user(char *dst, const char __user *src, long count)
 {
 	long res;
 	__do_strncpy_from_user(dst, src, count, res);
@@ -102,7 +102,7 @@
  * and returns @count.
  */
 long
-strncpy_from_user(char *dst, const char __user *src, long count)
+direct_strncpy_from_user(char *dst, const char __user *src, long count)
 {
 	long res = -EFAULT;
 	if (access_ok(VERIFY_READ, src, 1))
@@ -147,7 +147,7 @@
  * On success, this will be zero.
  */
 unsigned long
-clear_user(void __user *to, unsigned long n)
+direct_clear_user(void __user *to, unsigned long n)
 {
 	might_sleep();
 	if (access_ok(VERIFY_WRITE, to, n))
@@ -167,7 +167,7 @@
  * On success, this will be zero.
  */
 unsigned long
-__clear_user(void __user *to, unsigned long n)
+__direct_clear_user(void __user *to, unsigned long n)
 {
 	__do_clear_user(to, n);
 	return n;
@@ -184,7 +184,7 @@
  * On exception, returns 0.
  * If the string is too long, returns a value greater than @n.
  */
-long strnlen_user(const char __user *s, long n)
+long direct_strnlen_user(const char __user *s, long n)
 {
 	unsigned long mask = -__addr_ok(s);
 	unsigned long res, tmp;
@@ -575,3 +575,4 @@
 		n = __copy_user_zeroing_intel(to, (const void *) from, n);
 	return n;
 }
+
--- diff/arch/i386/mach-default/topology.c	2002-12-30 10:17:12.000000000 +0000
+++ source/arch/i386/mach-default/topology.c	2004-02-09 10:39:50.000000000 +0000
@@ -34,10 +34,8 @@
 #ifdef CONFIG_NUMA
 #include <linux/mmzone.h>
 #include <asm/node.h>
-#include <asm/memblk.h>
 
 struct i386_node node_devices[MAX_NUMNODES];
-struct i386_memblk memblk_devices[MAX_NR_MEMBLKS];
 
 static int __init topology_init(void)
 {
@@ -47,8 +45,6 @@
 		arch_register_node(i);
 	for (i = 0; i < NR_CPUS; i++)
 		if (cpu_possible(i)) arch_register_cpu(i);
-	for (i = 0; i < num_online_memblks(); i++)
-		arch_register_memblk(i);
 	return 0;
 }
 
--- diff/arch/i386/mach-es7000/topology.c	2003-06-30 10:07:28.000000000 +0100
+++ source/arch/i386/mach-es7000/topology.c	2004-02-09 10:39:50.000000000 +0000
@@ -34,10 +34,8 @@
 #ifdef CONFIG_NUMA
 #include <linux/mmzone.h>
 #include <asm/node.h>
-#include <asm/memblk.h>
 
 struct i386_node node_devices[MAX_NUMNODES];
-struct i386_memblk memblk_devices[MAX_NR_MEMBLKS];
 
 static int __init topology_init(void)
 {
@@ -47,8 +45,6 @@
 		arch_register_node(i);
 	for (i = 0; i < NR_CPUS; i++)
 		if (cpu_possible(i)) arch_register_cpu(i);
-	for (i = 0; i < num_online_memblks(); i++)
-		arch_register_memblk(i);
 	return 0;
 }
 
--- diff/arch/i386/mach-voyager/voyager_smp.c	2004-02-09 10:36:07.000000000 +0000
+++ source/arch/i386/mach-voyager/voyager_smp.c	2004-02-09 10:39:50.000000000 +0000
@@ -553,7 +553,7 @@
 
 	/* For the 486, we can't use the 4Mb page table trick, so
 	 * must map a region of memory */
-#ifdef CONFIG_M486
+#ifdef CONFIG_CPU_486
 	int i;
 	unsigned long *page_table_copies = (unsigned long *)
 		__get_free_page(GFP_KERNEL);
@@ -612,7 +612,7 @@
 	/* set the original swapper_pg_dir[0] to map 0 to 4Mb transparently
 	 * (so that the booting CPU can find start_32 */
 	orig_swapper_pg_dir0 = swapper_pg_dir[0];
-#ifdef CONFIG_M486
+#ifdef CONFIG_CPU_486
 	if(page_table_copies == NULL)
 		panic("No free memory for 486 page tables\n");
 	for(i = 0; i < PAGE_SIZE/sizeof(unsigned long); i++)
@@ -669,7 +669,7 @@
 	/* reset the page table */
 	swapper_pg_dir[0] = orig_swapper_pg_dir0;
 	local_flush_tlb();
-#ifdef CONFIG_M486
+#ifdef CONFIG_CPU_486
 	free_page((unsigned long)page_table_copies);
 #endif
 	  
--- diff/arch/i386/math-emu/fpu_system.h	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/i386/math-emu/fpu_system.h	2004-02-09 10:39:50.000000000 +0000
@@ -15,6 +15,7 @@
 #include <linux/sched.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
+#include <asm/atomic_kmap.h>
 
 /* This sets the pointer FPU_info to point to the argument part
    of the stack frame of math_emulate() */
@@ -22,7 +23,7 @@
 
 /* s is always from a cpu register, and the cpu does bounds checking
  * during register load --> no further bounds checks needed */
-#define LDT_DESCRIPTOR(s)	(((struct desc_struct *)current->mm->context.ldt)[(s) >> 3])
+#define LDT_DESCRIPTOR(s)	(((struct desc_struct *)__kmap_atomic_vaddr(KM_LDT_PAGE0))[(s) >> 3])
 #define SEG_D_SIZE(x)		((x).b & (3 << 21))
 #define SEG_G_BIT(x)		((x).b & (1 << 23))
 #define SEG_GRANULARITY(x)	(((x).b & (1 << 23)) ? 4096 : 1)
--- diff/arch/i386/mm/fault.c	2003-12-19 09:51:11.000000000 +0000
+++ source/arch/i386/mm/fault.c	2004-02-09 10:39:50.000000000 +0000
@@ -27,6 +27,7 @@
 #include <asm/pgalloc.h>
 #include <asm/hardirq.h>
 #include <asm/desc.h>
+#include <asm/tlbflush.h>
 
 extern void die(const char *,struct pt_regs *,long);
 
@@ -104,8 +105,17 @@
 	if (seg & (1<<2)) {
 		/* Must lock the LDT while reading it. */
 		down(&current->mm->context.sem);
+#if 1
+		/* horrible hack for 4/4 disabled kernels.
+		   I'm not quite sure what the TLB flush is good for,
+		   it's mindlessly copied from the read_ldt code */
+		__flush_tlb_global();
+		desc = kmap(current->mm->context.ldt_pages[(seg&~7)/PAGE_SIZE]);
+		desc = (void *)desc + ((seg & ~7) % PAGE_SIZE);
+#else
 		desc = current->mm->context.ldt;
 		desc = (void *)desc + (seg & ~7);
+#endif
 	} else {
 		/* Must disable preemption while reading the GDT. */
 		desc = (u32 *)&cpu_gdt_table[get_cpu()];
@@ -118,6 +128,9 @@
 		 (desc[1] & 0xff000000);
 
 	if (seg & (1<<2)) { 
+#if 1
+		kunmap((void *)((unsigned long)desc & PAGE_MASK));
+#endif
 		up(&current->mm->context.sem);
 	} else
 		put_cpu();
@@ -243,6 +256,19 @@
 	 * (error_code & 4) == 0, and that the fault was not a
 	 * protection error (error_code & 1) == 0.
 	 */
+#ifdef CONFIG_X86_4G
+	/*
+	 * On 4/4 all kernels faults are either bugs, vmalloc or prefetch
+	 */
+	if (unlikely((regs->xcs & 3) == 0)) {
+		if (error_code & 3)
+			goto bad_area_nosemaphore;
+
+		/* If it's vm86 fall through */
+		if (!(regs->eflags & VM_MASK))
+			goto vmalloc_fault;
+	}
+#else
 	if (unlikely(address >= TASK_SIZE)) { 
 		if (!(error_code & 5))
 			goto vmalloc_fault;
@@ -252,6 +278,7 @@
 		 */
 		goto bad_area_nosemaphore;
 	} 
+#endif
 
 	mm = tsk->mm;
 
@@ -403,6 +430,12 @@
  * Oops. The kernel tried to access some bad page. We'll have to
  * terminate things with extreme prejudice.
  */
+#ifdef CONFIG_KGDB
+        if (!user_mode(regs)){
+                kgdb_handle_exception(14,SIGBUS, error_code, regs);
+                return;
+        }
+#endif
 
 	bust_spinlocks(1);
 
--- diff/arch/i386/mm/init.c	2004-01-19 10:22:55.000000000 +0000
+++ source/arch/i386/mm/init.c	2004-02-09 10:39:50.000000000 +0000
@@ -40,125 +40,13 @@
 #include <asm/tlb.h>
 #include <asm/tlbflush.h>
 #include <asm/sections.h>
+#include <asm/desc.h>
 
 DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
 unsigned long highstart_pfn, highend_pfn;
 
 static int do_test_wp_bit(void);
 
-/*
- * Creates a middle page table and puts a pointer to it in the
- * given global directory entry. This only returns the gd entry
- * in non-PAE compilation mode, since the middle layer is folded.
- */
-static pmd_t * __init one_md_table_init(pgd_t *pgd)
-{
-	pmd_t *pmd_table;
-		
-#ifdef CONFIG_X86_PAE
-	pmd_table = (pmd_t *) alloc_bootmem_low_pages(PAGE_SIZE);
-	set_pgd(pgd, __pgd(__pa(pmd_table) | _PAGE_PRESENT));
-	if (pmd_table != pmd_offset(pgd, 0)) 
-		BUG();
-#else
-	pmd_table = pmd_offset(pgd, 0);
-#endif
-
-	return pmd_table;
-}
-
-/*
- * Create a page table and place a pointer to it in a middle page
- * directory entry.
- */
-static pte_t * __init one_page_table_init(pmd_t *pmd)
-{
-	if (pmd_none(*pmd)) {
-		pte_t *page_table = (pte_t *) alloc_bootmem_low_pages(PAGE_SIZE);
-		set_pmd(pmd, __pmd(__pa(page_table) | _PAGE_TABLE));
-		if (page_table != pte_offset_kernel(pmd, 0))
-			BUG();	
-
-		return page_table;
-	}
-	
-	return pte_offset_kernel(pmd, 0);
-}
-
-/*
- * This function initializes a certain range of kernel virtual memory 
- * with new bootmem page tables, everywhere page tables are missing in
- * the given range.
- */
-
-/*
- * NOTE: The pagetables are allocated contiguous on the physical space 
- * so we can cache the place of the first one and move around without 
- * checking the pgd every time.
- */
-static void __init page_table_range_init (unsigned long start, unsigned long end, pgd_t *pgd_base)
-{
-	pgd_t *pgd;
-	pmd_t *pmd;
-	int pgd_idx, pmd_idx;
-	unsigned long vaddr;
-
-	vaddr = start;
-	pgd_idx = pgd_index(vaddr);
-	pmd_idx = pmd_index(vaddr);
-	pgd = pgd_base + pgd_idx;
-
-	for ( ; (pgd_idx < PTRS_PER_PGD) && (vaddr != end); pgd++, pgd_idx++) {
-		if (pgd_none(*pgd)) 
-			one_md_table_init(pgd);
-
-		pmd = pmd_offset(pgd, vaddr);
-		for (; (pmd_idx < PTRS_PER_PMD) && (vaddr != end); pmd++, pmd_idx++) {
-			if (pmd_none(*pmd)) 
-				one_page_table_init(pmd);
-
-			vaddr += PMD_SIZE;
-		}
-		pmd_idx = 0;
-	}
-}
-
-/*
- * This maps the physical memory to kernel virtual address space, a total 
- * of max_low_pfn pages, by creating page tables starting from address 
- * PAGE_OFFSET.
- */
-static void __init kernel_physical_mapping_init(pgd_t *pgd_base)
-{
-	unsigned long pfn;
-	pgd_t *pgd;
-	pmd_t *pmd;
-	pte_t *pte;
-	int pgd_idx, pmd_idx, pte_ofs;
-
-	pgd_idx = pgd_index(PAGE_OFFSET);
-	pgd = pgd_base + pgd_idx;
-	pfn = 0;
-
-	for (; pgd_idx < PTRS_PER_PGD; pgd++, pgd_idx++) {
-		pmd = one_md_table_init(pgd);
-		if (pfn >= max_low_pfn)
-			continue;
-		for (pmd_idx = 0; pmd_idx < PTRS_PER_PMD && pfn < max_low_pfn; pmd++, pmd_idx++) {
-			/* Map with big pages if possible, otherwise create normal page tables. */
-			if (cpu_has_pse) {
-				set_pmd(pmd, pfn_pmd(pfn, PAGE_KERNEL_LARGE));
-				pfn += PTRS_PER_PTE;
-			} else {
-				pte = one_page_table_init(pmd);
-
-				for (pte_ofs = 0; pte_ofs < PTRS_PER_PTE && pfn < max_low_pfn; pte++, pfn++, pte_ofs++)
-					set_pte(pte, pfn_pte(pfn, PAGE_KERNEL));
-			}
-		}
-	}	
-}
-
 static inline int page_kills_ppro(unsigned long pagenr)
 {
 	if (pagenr >= 0x70000 && pagenr <= 0x7003F)
@@ -206,11 +94,8 @@
 	return 0;
 }
 
-#ifdef CONFIG_HIGHMEM
 pte_t *kmap_pte;
-pgprot_t kmap_prot;
 
-EXPORT_SYMBOL(kmap_prot);
 EXPORT_SYMBOL(kmap_pte);
 
 #define kmap_get_fixmap_pte(vaddr)					\
@@ -218,29 +103,7 @@
 
 void __init kmap_init(void)
 {
-	unsigned long kmap_vstart;
-
-	/* cache the first kmap pte */
-	kmap_vstart = __fix_to_virt(FIX_KMAP_BEGIN);
-	kmap_pte = kmap_get_fixmap_pte(kmap_vstart);
-
-	kmap_prot = PAGE_KERNEL;
-}
-
-void __init permanent_kmaps_init(pgd_t *pgd_base)
-{
-	pgd_t *pgd;
-	pmd_t *pmd;
-	pte_t *pte;
-	unsigned long vaddr;
-
-	vaddr = PKMAP_BASE;
-	page_table_range_init(vaddr, vaddr + PAGE_SIZE*LAST_PKMAP, pgd_base);
-
-	pgd = swapper_pg_dir + pgd_index(vaddr);
-	pmd = pmd_offset(pgd, vaddr);
-	pte = pte_offset_kernel(pmd, vaddr);
-	pkmap_page_table = pte;	
+	kmap_pte = kmap_get_fixmap_pte(__fix_to_virt(FIX_KMAP_BEGIN));
 }
 
 void __init one_highpage_init(struct page *page, int pfn, int bad_ppro)
@@ -255,6 +118,8 @@
 		SetPageReserved(page);
 }
 
+#ifdef CONFIG_HIGHMEM
+
 #ifndef CONFIG_DISCONTIGMEM
 void __init set_highmem_pages_init(int bad_ppro) 
 {
@@ -266,12 +131,9 @@
 #else
 extern void set_highmem_pages_init(int);
 #endif /* !CONFIG_DISCONTIGMEM */
-
 #else
-#define kmap_init() do { } while (0)
-#define permanent_kmaps_init(pgd_base) do { } while (0)
-#define set_highmem_pages_init(bad_ppro) do { } while (0)
-#endif /* CONFIG_HIGHMEM */
+# define set_highmem_pages_init(bad_ppro) do { } while (0)
+#endif
 
 unsigned long __PAGE_KERNEL = _PAGE_KERNEL;
 
@@ -281,30 +143,125 @@
 extern void __init remap_numa_kva(void);
 #endif
 
-static void __init pagetable_init (void)
+static __init void prepare_pagetables(pgd_t *pgd_base, unsigned long address)
+{
+	pgd_t *pgd;
+	pmd_t *pmd;
+	pte_t *pte;
+
+	pgd = pgd_base + pgd_index(address);
+	pmd = pmd_offset(pgd, address);
+	if (!pmd_present(*pmd)) {
+		pte = (pte_t *) alloc_bootmem_low_pages(PAGE_SIZE);
+		set_pmd(pmd, __pmd(_PAGE_TABLE + __pa(pte)));
+	}
+}
+
+static void __init fixrange_init (unsigned long start, unsigned long end, pgd_t *pgd_base)
+{
+	unsigned long vaddr;
+
+	for (vaddr = start; vaddr != end; vaddr += PAGE_SIZE)
+		prepare_pagetables(pgd_base, vaddr);
+}
+
+void setup_identity_mappings(pgd_t *pgd_base, unsigned long start, unsigned long end)
 {
 	unsigned long vaddr;
-	pgd_t *pgd_base = swapper_pg_dir;
+	pgd_t *pgd;
+	int i, j, k;
+	pmd_t *pmd;
+	pte_t *pte, *pte_base;
+
+	pgd = pgd_base;
+
+	for (i = 0; i < PTRS_PER_PGD; pgd++, i++) {
+		vaddr = i*PGDIR_SIZE;
+		if (end && (vaddr >= end))
+			break;
+		pmd = pmd_offset(pgd, 0);
+		for (j = 0; j < PTRS_PER_PMD; pmd++, j++) {
+			vaddr = i*PGDIR_SIZE + j*PMD_SIZE;
+			if (end && (vaddr >= end))
+				break;
+			if (vaddr < start)
+				continue;
+			if (cpu_has_pse) {
+				unsigned long __pe;
 
+				set_in_cr4(X86_CR4_PSE);
+				boot_cpu_data.wp_works_ok = 1;
+				__pe = _KERNPG_TABLE + _PAGE_PSE + vaddr - start;
+				/* Make it "global" too if supported */
+				if (cpu_has_pge) {
+					set_in_cr4(X86_CR4_PGE);
+#if !defined(CONFIG_X86_SWITCH_PAGETABLES)
+					__pe += _PAGE_GLOBAL;
+					__PAGE_KERNEL |= _PAGE_GLOBAL;
+#endif
+				}
+				set_pmd(pmd, __pmd(__pe));
+				continue;
+			}
+			if (!pmd_present(*pmd))
+				pte_base = (pte_t *) alloc_bootmem_low_pages(PAGE_SIZE);
+			else
+				pte_base = (pte_t *) page_address(pmd_page(*pmd));
+			pte = pte_base;
+			for (k = 0; k < PTRS_PER_PTE; pte++, k++) {
+				vaddr = i*PGDIR_SIZE + j*PMD_SIZE + k*PAGE_SIZE;
+				if (end && (vaddr >= end))
+					break;
+				if (vaddr < start)
+					continue;
+				*pte = mk_pte_phys(vaddr-start, PAGE_KERNEL);
+			}
+			set_pmd(pmd, __pmd(_KERNPG_TABLE + __pa(pte_base)));
+		}
+	}
+}
+
+static void __init pagetable_init (void)
+{
+	unsigned long vaddr, end;
+	pgd_t *pgd_base;
 #ifdef CONFIG_X86_PAE
 	int i;
-	/* Init entries of the first-level page table to the zero page */
-	for (i = 0; i < PTRS_PER_PGD; i++)
-		set_pgd(pgd_base + i, __pgd(__pa(empty_zero_page) | _PAGE_PRESENT));
 #endif
 
-	/* Enable PSE if available */
-	if (cpu_has_pse) {
-		set_in_cr4(X86_CR4_PSE);
-	}
+	/*
+	 * This can be zero as well - no problem, in that case we exit
+	 * the loops anyway due to the PTRS_PER_* conditions.
+	 */
+	end = (unsigned long)__va(max_low_pfn*PAGE_SIZE);
 
-	/* Enable PGE if available */
-	if (cpu_has_pge) {
-		set_in_cr4(X86_CR4_PGE);
-		__PAGE_KERNEL |= _PAGE_GLOBAL;
+	pgd_base = swapper_pg_dir;
+#ifdef CONFIG_X86_PAE
+	/*
+	 * It causes too many problems if there's no proper pmd set up
+	 * for all 4 entries of the PGD - so we allocate all of them.
+	 * PAE systems will not miss this extra 4-8K anyway ...
+	 */
+	for (i = 0; i < PTRS_PER_PGD; i++) {
+		pmd_t *pmd = (pmd_t *) alloc_bootmem_low_pages(PAGE_SIZE);
+		set_pgd(pgd_base + i, __pgd(__pa(pmd) + 0x1));
 	}
+#endif
+	/*
+	 * Set up lowmem-sized identity mappings at PAGE_OFFSET:
+	 */
+	setup_identity_mappings(pgd_base, PAGE_OFFSET, end);
 
-	kernel_physical_mapping_init(pgd_base);
+	/*
+	 * Add flat-mode identity-mappings - SMP needs it when
+	 * starting up on an AP from real-mode. (In the non-PAE
+	 * case we already have these mappings through head.S.)
+	 * All user-space mappings are explicitly cleared after
+	 * SMP startup.
+	 */
+#if CONFIG_SMP && CONFIG_X86_PAE
+	setup_identity_mappings(pgd_base, 0, 16*1024*1024);
+#endif
 	remap_numa_kva();
 
 	/*
@@ -312,38 +269,64 @@
 	 * created - mappings will be set by set_fixmap():
 	 */
 	vaddr = __fix_to_virt(__end_of_fixed_addresses - 1) & PMD_MASK;
-	page_table_range_init(vaddr, 0, pgd_base);
+	fixrange_init(vaddr, 0, pgd_base);
 
-	permanent_kmaps_init(pgd_base);
+#if CONFIG_HIGHMEM
+	{
+		pgd_t *pgd;
+		pmd_t *pmd;
+		pte_t *pte;
 
-#ifdef CONFIG_X86_PAE
-	/*
-	 * Add low memory identity-mappings - SMP needs it when
-	 * starting up on an AP from real-mode. In the non-PAE
-	 * case we already have these mappings through head.S.
-	 * All user-space mappings are explicitly cleared after
-	 * SMP startup.
-	 */
-	pgd_base[0] = pgd_base[USER_PTRS_PER_PGD];
+		/*
+		 * Permanent kmaps:
+		 */
+		vaddr = PKMAP_BASE;
+		fixrange_init(vaddr, vaddr + PAGE_SIZE*LAST_PKMAP, pgd_base);
+
+		pgd = swapper_pg_dir + pgd_index(vaddr);
+		pmd = pmd_offset(pgd, vaddr);
+		pte = pte_offset_kernel(pmd, vaddr);
+		pkmap_page_table = pte;
+	}
 #endif
 }
 
-void zap_low_mappings (void)
+/*
+ * Clear kernel pagetables in a PMD_SIZE-aligned range.
+ */
+static void clear_mappings(pgd_t *pgd_base, unsigned long start, unsigned long end)
 {
-	int i;
+	unsigned long vaddr;
+	pgd_t *pgd;
+	pmd_t *pmd;
+	int i, j;
+
+	pgd = pgd_base;
+
+	for (i = 0; i < PTRS_PER_PGD; pgd++, i++) {
+		vaddr = i*PGDIR_SIZE;
+		if (end && (vaddr >= end))
+			break;
+		pmd = pmd_offset(pgd, 0);
+		for (j = 0; j < PTRS_PER_PMD; pmd++, j++) {
+			vaddr = i*PGDIR_SIZE + j*PMD_SIZE;
+			if (end && (vaddr >= end))
+				break;
+			if (vaddr < start)
+				continue;
+			pmd_clear(pmd);
+		}
+	}
+	flush_tlb_all();
+}
+
+void zap_low_mappings(void)
+{
+	printk("zapping low mappings.\n");
 	/*
 	 * Zap initial low-memory mappings.
-	 *
-	 * Note that "pgd_clear()" doesn't do it for
-	 * us, because pgd_clear() is a no-op on i386.
 	 */
-	for (i = 0; i < USER_PTRS_PER_PGD; i++)
-#ifdef CONFIG_X86_PAE
-		set_pgd(swapper_pg_dir+i, __pgd(1 + __pa(empty_zero_page)));
-#else
-		set_pgd(swapper_pg_dir+i, __pgd(0));
-#endif
-	flush_tlb_all();
+	clear_mappings(swapper_pg_dir, 0, 16*1024*1024);
 }
 
 #ifndef CONFIG_DISCONTIGMEM
@@ -393,7 +376,15 @@
 		set_in_cr4(X86_CR4_PAE);
 #endif
 	__flush_tlb_all();
-
+	/*
+	 * Subtle. SMP is doing it's boot stuff late (because it has to
+	 * fork idle threads) - but it also needs low mappings for the
+	 * protected-mode entry to work. We zap these entries only after
+	 * the WP-bit has been tested.
+	 */
+#ifndef CONFIG_SMP
+	zap_low_mappings();
+#endif
 	kmap_init();
 	zone_sizes_init();
 }
@@ -515,22 +506,18 @@
 	if (boot_cpu_data.wp_works_ok < 0)
 		test_wp_bit();
 
-	/*
-	 * Subtle. SMP is doing it's boot stuff late (because it has to
-	 * fork idle threads) - but it also needs low mappings for the
-	 * protected-mode entry to work. We zap these entries only after
-	 * the WP-bit has been tested.
-	 */
-#ifndef CONFIG_SMP
-	zap_low_mappings();
-#endif
+	entry_trampoline_setup();
+	default_ldt_page = virt_to_page(default_ldt);
+	load_LDT(&init_mm.context);
 }
 
-kmem_cache_t *pgd_cache;
-kmem_cache_t *pmd_cache;
+kmem_cache_t *pgd_cache, *pmd_cache, *kpmd_cache;
 
 void __init pgtable_cache_init(void)
 {
+	void (*ctor)(void *, kmem_cache_t *, unsigned long);
+	void (*dtor)(void *, kmem_cache_t *, unsigned long);
+
 	if (PTRS_PER_PMD > 1) {
 		pmd_cache = kmem_cache_create("pmd",
 					PTRS_PER_PMD*sizeof(pmd_t),
@@ -540,13 +527,36 @@
 					NULL);
 		if (!pmd_cache)
 			panic("pgtable_cache_init(): cannot create pmd cache");
+
+		if (TASK_SIZE > PAGE_OFFSET) {
+			kpmd_cache = kmem_cache_create("kpmd",
+					PTRS_PER_PMD*sizeof(pmd_t),
+					0,
+					SLAB_HWCACHE_ALIGN | SLAB_MUST_HWCACHE_ALIGN,
+					kpmd_ctor,
+					NULL);
+			if (!kpmd_cache)
+				panic("pgtable_cache_init(): "
+						"cannot create kpmd cache");
+		}
 	}
+
+	if (PTRS_PER_PMD == 1 || TASK_SIZE <= PAGE_OFFSET)
+		ctor = pgd_ctor;
+	else
+		ctor = NULL;
+
+	if (PTRS_PER_PMD == 1 && TASK_SIZE <= PAGE_OFFSET)
+		dtor = pgd_dtor;
+	else
+		dtor = NULL;
+
 	pgd_cache = kmem_cache_create("pgd",
 				PTRS_PER_PGD*sizeof(pgd_t),
 				0,
 				SLAB_HWCACHE_ALIGN | SLAB_MUST_HWCACHE_ALIGN,
-				pgd_ctor,
-				PTRS_PER_PMD == 1 ? pgd_dtor : NULL);
+				ctor,
+				dtor);
 	if (!pgd_cache)
 		panic("pgtable_cache_init(): Cannot create pgd cache");
 }
--- diff/arch/i386/mm/pgtable.c	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/i386/mm/pgtable.c	2004-02-09 10:39:50.000000000 +0000
@@ -21,6 +21,7 @@
 #include <asm/e820.h>
 #include <asm/tlb.h>
 #include <asm/tlbflush.h>
+#include <asm/atomic_kmap.h>
 
 void show_mem(void)
 {
@@ -157,11 +158,20 @@
 	memset(pmd, 0, PTRS_PER_PMD*sizeof(pmd_t));
 }
 
+void kpmd_ctor(void *__pmd, kmem_cache_t *cache, unsigned long flags)
+{
+	pmd_t *kpmd, *pmd;
+	kpmd = pmd_offset(&swapper_pg_dir[PTRS_PER_PGD-1],
+				(PTRS_PER_PMD - NR_SHARED_PMDS)*PMD_SIZE);
+	pmd = (pmd_t *)__pmd + (PTRS_PER_PMD - NR_SHARED_PMDS);
+
+	memset(__pmd, 0, (PTRS_PER_PMD - NR_SHARED_PMDS)*sizeof(pmd_t));
+	memcpy(pmd, kpmd, NR_SHARED_PMDS*sizeof(pmd_t));
+}
+
 /*
- * List of all pgd's needed for non-PAE so it can invalidate entries
- * in both cached and uncached pgd's; not needed for PAE since the
- * kernel pmd is shared. If PAE were not to share the pmd a similar
- * tactic would be needed. This is essentially codepath-based locking
+ * List of all pgd's needed so it can invalidate entries in both cached
+ * and uncached pgd's. This is essentially codepath-based locking
  * against pageattr.c; it is the unique case in which a valid change
  * of kernel pagetables can't be lazily synchronized by vmalloc faults.
  * vmalloc faults work because attached pagetables are never freed.
@@ -170,30 +180,60 @@
  * could be used. The locking scheme was chosen on the basis of
  * manfred's recommendations and having no core impact whatsoever.
  * -- wli
+ *
+ * The entire issue goes away when XKVA is configured.
  */
 spinlock_t pgd_lock = SPIN_LOCK_UNLOCKED;
 LIST_HEAD(pgd_list);
 
-void pgd_ctor(void *pgd, kmem_cache_t *cache, unsigned long unused)
+/*
+ * This is not that hard to figure out.
+ * (a) PTRS_PER_PMD == 1 means non-PAE.
+ * (b) PTRS_PER_PMD > 1 means PAE.
+ * (c) TASK_SIZE > PAGE_OFFSET means XKVA.
+ * (d) TASK_SIZE <= PAGE_OFFSET means non-XKVA.
+ *
+ * Do *NOT* back out the preconstruction like the patch I'm cleaning
+ * up after this very instant did, or at all, for that matter.
+ * This is never called when PTRS_PER_PMD > 1 && TASK_SIZE > PAGE_OFFSET.
+ * -- wli
+ */
+void pgd_ctor(void *__pgd, kmem_cache_t *cache, unsigned long unused)
 {
+	pgd_t *pgd = (pgd_t *)__pgd;
 	unsigned long flags;
 
-	if (PTRS_PER_PMD == 1)
-		spin_lock_irqsave(&pgd_lock, flags);
+	if (PTRS_PER_PMD == 1) {
+		if (TASK_SIZE <= PAGE_OFFSET)
+			spin_lock_irqsave(&pgd_lock, flags);
+		else
+ 			memcpy(&pgd[PTRS_PER_PGD - NR_SHARED_PMDS],
+ 				&swapper_pg_dir[PTRS_PER_PGD - NR_SHARED_PMDS],
+ 				NR_SHARED_PMDS * sizeof(pgd_t));
+	}
 
-	memcpy((pgd_t *)pgd + USER_PTRS_PER_PGD,
-			swapper_pg_dir + USER_PTRS_PER_PGD,
-			(PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t));
+	if (TASK_SIZE <= PAGE_OFFSET)
+ 		memcpy(pgd + USER_PTRS_PER_PGD,
+ 			swapper_pg_dir + USER_PTRS_PER_PGD,
+ 			(PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t));
 
 	if (PTRS_PER_PMD > 1)
 		return;
 
-	list_add(&virt_to_page(pgd)->lru, &pgd_list);
-	spin_unlock_irqrestore(&pgd_lock, flags);
-	memset(pgd, 0, USER_PTRS_PER_PGD*sizeof(pgd_t));
+	if (TASK_SIZE > PAGE_OFFSET)
+		memset(pgd, 0, (PTRS_PER_PGD - NR_SHARED_PMDS)*sizeof(pgd_t));
+	else {
+		list_add(&virt_to_page(pgd)->lru, &pgd_list);
+		spin_unlock_irqrestore(&pgd_lock, flags);
+		memset(pgd, 0, USER_PTRS_PER_PGD*sizeof(pgd_t));
+	}
 }
 
-/* never called when PTRS_PER_PMD > 1 */
+/*
+ * Never called when PTRS_PER_PMD > 1 || TASK_SIZE > PAGE_OFFSET
+ * for with PAE we would list_del() multiple times, and for non-PAE
+ * with XKVA all the AGP pgd shootdown code is unnecessary.
+ */
 void pgd_dtor(void *pgd, kmem_cache_t *cache, unsigned long unused)
 {
 	unsigned long flags; /* can be called from interrupt context */
@@ -203,6 +243,12 @@
 	spin_unlock_irqrestore(&pgd_lock, flags);
 }
 
+/*
+ * See the comments above pgd_ctor() wrt. preconstruction.
+ * Do *NOT* memcpy() here. If you do, you back out important
+ * anti- cache pollution code.
+ *
+ */
 pgd_t *pgd_alloc(struct mm_struct *mm)
 {
 	int i;
@@ -211,15 +257,33 @@
 	if (PTRS_PER_PMD == 1 || !pgd)
 		return pgd;
 
+	/*
+	 * In the 4G userspace case alias the top 16 MB virtual
+	 * memory range into the user mappings as well (these
+	 * include the trampoline and CPU data structures).
+	 */
 	for (i = 0; i < USER_PTRS_PER_PGD; ++i) {
-		pmd_t *pmd = kmem_cache_alloc(pmd_cache, GFP_KERNEL);
+		kmem_cache_t *cache;
+		pmd_t *pmd;
+
+		if (TASK_SIZE > PAGE_OFFSET && i == USER_PTRS_PER_PGD - 1)
+			cache = kpmd_cache;
+		else
+			cache = pmd_cache;
+
+		pmd = kmem_cache_alloc(cache, GFP_KERNEL);
 		if (!pmd)
 			goto out_oom;
 		set_pgd(&pgd[i], __pgd(1 + __pa((u64)((u32)pmd))));
 	}
-	return pgd;
 
+	return pgd;
 out_oom:
+	/*
+	 * we don't have to handle the kpmd_cache here, since it's the
+	 * last allocation, and has either nothing to free or when it
+	 * succeeds the whole operation succeeds.
+	 */
 	for (i--; i >= 0; i--)
 		kmem_cache_free(pmd_cache, (void *)__va(pgd_val(pgd[i])-1));
 	kmem_cache_free(pgd_cache, pgd);
@@ -230,10 +294,29 @@
 {
 	int i;
 
-	/* in the PAE case user pgd entries are overwritten before usage */
-	if (PTRS_PER_PMD > 1)
-		for (i = 0; i < USER_PTRS_PER_PGD; ++i)
-			kmem_cache_free(pmd_cache, (void *)__va(pgd_val(pgd[i])-1));
 	/* in the non-PAE case, clear_page_tables() clears user pgd entries */
+	if (PTRS_PER_PMD == 1)
+		goto out_free;
+
+	/* in the PAE case user pgd entries are overwritten before usage */
+	for (i = 0; i < USER_PTRS_PER_PGD; ++i) {
+		kmem_cache_t *cache;
+		pmd_t *pmd = __va(pgd_val(pgd[i]) - 1);
+
+		/*
+		 * only userspace pmd's are cleared for us
+		 * by mm/memory.c; it's a slab cache invariant
+		 * that we must separate the kernel pmd slab
+		 * all times, else we'll have bad pmd's.
+		 */
+		if (TASK_SIZE > PAGE_OFFSET && i == USER_PTRS_PER_PGD - 1)
+			cache = kpmd_cache;
+		else
+			cache = pmd_cache;
+
+		kmem_cache_free(cache, pmd);
+	}
+out_free:
 	kmem_cache_free(pgd_cache, pgd);
 }
+
--- diff/arch/i386/oprofile/op_model_p4.c	2003-08-26 10:00:51.000000000 +0100
+++ source/arch/i386/oprofile/op_model_p4.c	2004-02-09 10:39:50.000000000 +0000
@@ -382,11 +382,8 @@
 static unsigned int get_stagger(void)
 {
 #ifdef CONFIG_SMP
-	int cpu;
-	if (smp_num_siblings > 1) {
-		cpu = smp_processor_id();
-		return (cpu_sibling_map[cpu] > cpu) ? 0 : 1;
-	}
+	int cpu = smp_processor_id();
+	return (cpu != first_cpu(cpu_sibling_map[cpu]));
 #endif	
 	return 0;
 }
--- diff/arch/i386/pci/Makefile	2003-07-08 09:55:17.000000000 +0100
+++ source/arch/i386/pci/Makefile	2004-02-09 10:39:50.000000000 +0000
@@ -1,6 +1,7 @@
 obj-y				:= i386.o
 
 obj-$(CONFIG_PCI_BIOS)		+= pcbios.o
+obj-$(CONFIG_PCI_MMCONFIG)	+= mmconfig.o
 obj-$(CONFIG_PCI_DIRECT)	+= direct.o
 
 pci-y				:= fixup.o
--- diff/arch/i386/pci/common.c	2004-02-09 10:36:07.000000000 +0000
+++ source/arch/i386/pci/common.c	2004-02-09 10:39:50.000000000 +0000
@@ -20,7 +20,8 @@
 extern  void pcibios_sort(void);
 #endif
 
-unsigned int pci_probe = PCI_PROBE_BIOS | PCI_PROBE_CONF1 | PCI_PROBE_CONF2;
+unsigned int pci_probe = PCI_PROBE_BIOS | PCI_PROBE_CONF1 | PCI_PROBE_CONF2 |
+				PCI_PROBE_MMCONF;
 
 int pcibios_last_bus = -1;
 struct pci_bus *pci_root_bus = NULL;
@@ -198,6 +199,12 @@
 		return NULL;
 	}
 #endif
+#ifdef CONFIG_PCI_MMCONFIG
+	else if (!strcmp(str, "nommconf")) {
+		pci_probe &= ~PCI_PROBE_MMCONF;
+		return NULL;
+	}
+#endif
 	else if (!strcmp(str, "noacpi")) {
 		acpi_noirq_set();
 		return NULL;
--- diff/arch/i386/pci/irq.c	2004-01-19 10:22:55.000000000 +0000
+++ source/arch/i386/pci/irq.c	2004-02-09 10:39:50.000000000 +0000
@@ -943,12 +943,50 @@
 {
 	u8 pin;
 	extern int interrupt_line_quirk;
+	struct pci_dev *temp_dev;
+
 	pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin);
 	if (pin && !pcibios_lookup_irq(dev, 1) && !dev->irq) {
 		char *msg;
-		if (io_apic_assign_pci_irqs)
-			msg = " Probably buggy MP table.";
-		else if (pci_probe & PCI_BIOS_IRQ_SCAN)
+		msg = "";
+		if (io_apic_assign_pci_irqs) {
+			int irq;
+
+			if (pin) {
+				pin--;		/* interrupt pins are numbered starting from 1 */
+				irq = IO_APIC_get_PCI_irq_vector(dev->bus->number, PCI_SLOT(dev->devfn), pin);
+				/*
+				 * Busses behind bridges are typically not listed in the MP-table.
+				 * In this case we have to look up the IRQ based on the parent bus,
+				 * parent slot, and pin number. The SMP code detects such bridged
+				 * busses itself so we should get into this branch reliably.
+				 */
+				temp_dev = dev;
+				while (irq < 0 && dev->bus->parent) { /* go back to the bridge */
+					struct pci_dev * bridge = dev->bus->self;
+
+					pin = (pin + PCI_SLOT(dev->devfn)) % 4;
+					irq = IO_APIC_get_PCI_irq_vector(bridge->bus->number, 
+							PCI_SLOT(bridge->devfn), pin);
+					if (irq >= 0)
+						printk(KERN_WARNING "PCI: using PPB(B%d,I%d,P%d) to get irq %d\n", 
+							bridge->bus->number, PCI_SLOT(bridge->devfn), pin, irq);
+					dev = bridge;
+				}
+				dev = temp_dev;
+				if (irq >= 0) {
+#ifdef CONFIG_PCI_USE_VECTOR
+					if (!platform_legacy_irq(irq))
+						irq = IO_APIC_VECTOR(irq);
+#endif
+					printk(KERN_INFO "PCI->APIC IRQ transform: (B%d,I%d,P%d) -> %d\n",
+						dev->bus->number, PCI_SLOT(dev->devfn), pin, irq);
+					dev->irq = irq;
+					return 0;
+				} else
+					msg = " Probably buggy MP table.";
+			}
+		} else if (pci_probe & PCI_BIOS_IRQ_SCAN)
 			msg = "";
 		else
 			msg = " Please try using pci=biosirq.";
--- diff/arch/i386/pci/pci.h	2004-02-09 10:36:07.000000000 +0000
+++ source/arch/i386/pci/pci.h	2004-02-09 10:39:50.000000000 +0000
@@ -15,6 +15,9 @@
 #define PCI_PROBE_BIOS		0x0001
 #define PCI_PROBE_CONF1		0x0002
 #define PCI_PROBE_CONF2		0x0004
+#define PCI_PROBE_MMCONF	0x0008
+#define PCI_PROBE_MASK		0x000f
+
 #define PCI_NO_SORT		0x0100
 #define PCI_BIOS_SORT		0x0200
 #define PCI_NO_CHECKS		0x0400
--- diff/arch/ia64/Kconfig	2004-02-09 10:36:07.000000000 +0000
+++ source/arch/ia64/Kconfig	2004-02-09 10:39:51.000000000 +0000
@@ -662,6 +662,13 @@
 	  Say Y here only if you plan to use gdb to debug the kernel.
 	  If you don't debug the kernel, you can say N.
 	  
+config LOCKMETER
+       bool "Kernel lock metering"
+       depends on SMP
+       help
+         Say Y to enable kernel lock metering, which adds overhead to SMP locks,
+         but allows you to see various statistics using the lockstat command.
+
 endmenu
 
 source "security/Kconfig"
--- diff/arch/ia64/hp/sim/simeth.c	2003-08-20 14:16:08.000000000 +0100
+++ source/arch/ia64/hp/sim/simeth.c	2004-02-09 10:39:50.000000000 +0000
@@ -224,7 +224,7 @@
 
 	err = register_netdev(dev);
 	if (err) {
-		kfree(dev);
+		free_netdev(dev);
 		return err;
 	}
 
--- diff/arch/ia64/ia32/sys_ia32.c	2004-02-09 10:36:07.000000000 +0000
+++ source/arch/ia64/ia32/sys_ia32.c	2004-02-09 10:39:51.000000000 +0000
@@ -2413,44 +2413,86 @@
 	return sys_lseek(fd, offset, whence);
 }
 
-extern asmlinkage long sys_getgroups (int gidsetsize, gid_t *grouplist);
+static int
+groups16_to_user(short *grouplist, struct group_info *group_info)
+{
+	int i;
+	short group;
+
+	for (i = 0; i < group_info->ngroups; i++) {
+		group = (short)GROUP_AT(group_info, i);
+		if (put_user(group, grouplist+i))
+			return -EFAULT;
+	}
+
+	return 0;
+}
+
+static int
+groups16_from_user(struct group_info *group_info, short *grouplist)
+{
+	int i;
+	short group;
+
+	for (i = 0; i < group_info->ngroups; i++) {
+		if (get_user(group, grouplist+i))
+			return  -EFAULT;
+		GROUP_AT(group_info, i) = (gid_t)group;
+	}
+
+	return 0;
+}
 
 asmlinkage long
 sys32_getgroups16 (int gidsetsize, short *grouplist)
 {
-	mm_segment_t old_fs = get_fs();
-	gid_t gl[NGROUPS];
-	int ret, i;
+	int i;
 
-	set_fs(KERNEL_DS);
-	ret = sys_getgroups(gidsetsize, gl);
-	set_fs(old_fs);
+	if (gidsetsize < 0)
+		return -EINVAL;
 
-	if (gidsetsize && ret > 0 && ret <= NGROUPS)
-		for (i = 0; i < ret; i++, grouplist++)
-			if (put_user(gl[i], grouplist))
-				return -EFAULT;
-	return ret;
+	get_group_info(current->group_info);
+	i = current->group_info->ngroups;
+	if (gidsetsize) {
+		if (i > gidsetsize) {
+			i = -EINVAL;
+			goto out;
+		}
+		if (groups16_to_user(grouplist, current->group_info)) {
+			i = -EFAULT;
+			goto out;
+		}
+	}
+out:
+	put_group_info(current->group_info);
+	return i;
 }
 
-extern asmlinkage long sys_setgroups (int gidsetsize, gid_t *grouplist);
-
 asmlinkage long
 sys32_setgroups16 (int gidsetsize, short *grouplist)
 {
-	mm_segment_t old_fs = get_fs();
-	gid_t gl[NGROUPS];
-	int ret, i;
+	struct group_info *group_info;
+	int retval;
 
-	if ((unsigned) gidsetsize > NGROUPS)
+	if (!capable(CAP_SETGID))
+		return -EPERM;
+	if ((unsigned)gidsetsize > NGROUPS_MAX)
 		return -EINVAL;
-	for (i = 0; i < gidsetsize; i++, grouplist++)
-		if (get_user(gl[i], grouplist))
-			return -EFAULT;
-	set_fs(KERNEL_DS);
-	ret = sys_setgroups(gidsetsize, gl);
-	set_fs(old_fs);
-	return ret;
+
+	group_info = groups_alloc(gidsetsize);
+	if (!group_info)
+		return -ENOMEM;
+	retval = groups16_from_user(group_info, grouplist);
+	if (retval) {
+		put_group_info(group_info);
+		return retval;
+	}
+
+	retval = set_current_groups(group_info);
+	if (retval)
+		put_group_info(group_info);
+
+	return retval;
 }
 
 asmlinkage long
--- diff/arch/ia64/kernel/acpi.c	2004-02-09 10:36:07.000000000 +0000
+++ source/arch/ia64/kernel/acpi.c	2004-02-09 10:39:51.000000000 +0000
@@ -191,8 +191,6 @@
 
 	if (!lsapic->flags.enabled)
 		printk(" disabled");
-	else if (available_cpus >= NR_CPUS)
-		printk(" ignored (increase NR_CPUS)");
 	else {
 		printk(" enabled");
 #ifdef CONFIG_SMP
@@ -395,12 +393,6 @@
 	size = ma->length_hi;
 	size = (size << 32) | ma->length_lo;
 
-	if (num_memblks >= NR_MEMBLKS) {
-		printk(KERN_ERR "Too many mem chunks in SRAT. Ignoring %ld MBytes at %lx\n",
-		       size/(1024*1024), paddr);
-		return;
-	}
-
 	/* Ignore disabled entries */
 	if (!ma->flags.enabled)
 		return;
@@ -409,7 +401,7 @@
 	pxm_bit_set(pxm);
 
 	/* Insertion sort based on base address */
-	pend = &node_memblk[num_memblks];
+	pend = &node_memblk[num_node_memblks];
 	for (p = &node_memblk[0]; p < pend; p++) {
 		if (paddr < p->start_paddr)
 			break;
@@ -421,7 +413,7 @@
 	p->start_paddr = paddr;
 	p->size = size;
 	p->nid = pxm;
-	num_memblks++;
+	num_node_memblks++;
 }
 
 void __init
@@ -448,7 +440,7 @@
 	}
 
 	/* set logical node id in memory chunk structure */
-	for (i = 0; i < num_memblks; i++)
+	for (i = 0; i < num_node_memblks; i++)
 		node_memblk[i].nid = pxm_to_nid_map[node_memblk[i].nid];
 
 	/* assign memory bank numbers for each chunk on each node */
@@ -456,7 +448,7 @@
 		int bank;
 
 		bank = 0;
-		for (j = 0; j < num_memblks; j++)
+		for (j = 0; j < num_node_memblks; j++)
 			if (node_memblk[j].nid == i)
 				node_memblk[j].bank = bank++;
 	}
@@ -466,7 +458,7 @@
 		node_cpuid[i].nid = pxm_to_nid_map[node_cpuid[i].nid];
 
 	printk(KERN_INFO "Number of logical nodes in system = %d\n", numnodes);
-	printk(KERN_INFO "Number of memory chunks in system = %d\n", num_memblks);
+	printk(KERN_INFO "Number of memory chunks in system = %d\n", num_node_memblks);
 
 	if (!slit_table) return;
 	memset(numa_slit, -1, sizeof(numa_slit));
@@ -552,29 +544,29 @@
 
 	/* Local APIC */
 
-	if (acpi_table_parse_madt(ACPI_MADT_LAPIC_ADDR_OVR, acpi_parse_lapic_addr_ovr) < 0)
+	if (acpi_table_parse_madt(ACPI_MADT_LAPIC_ADDR_OVR, acpi_parse_lapic_addr_ovr, 0) < 0)
 		printk(KERN_ERR PREFIX "Error parsing LAPIC address override entry\n");
 
-	if (acpi_table_parse_madt(ACPI_MADT_LSAPIC, acpi_parse_lsapic) < 1)
+	if (acpi_table_parse_madt(ACPI_MADT_LSAPIC, acpi_parse_lsapic, NR_CPUS) < 1)
 		printk(KERN_ERR PREFIX "Error parsing MADT - no LAPIC entries\n");
 
-	if (acpi_table_parse_madt(ACPI_MADT_LAPIC_NMI, acpi_parse_lapic_nmi) < 0)
+	if (acpi_table_parse_madt(ACPI_MADT_LAPIC_NMI, acpi_parse_lapic_nmi, 0) < 0)
 		printk(KERN_ERR PREFIX "Error parsing LAPIC NMI entry\n");
 
 	/* I/O APIC */
 
-	if (acpi_table_parse_madt(ACPI_MADT_IOSAPIC, acpi_parse_iosapic) < 1)
+	if (acpi_table_parse_madt(ACPI_MADT_IOSAPIC, acpi_parse_iosapic, NR_IOSAPICS) < 1)
 		printk(KERN_ERR PREFIX "Error parsing MADT - no IOSAPIC entries\n");
 
 	/* System-Level Interrupt Routing */
 
-	if (acpi_table_parse_madt(ACPI_MADT_PLAT_INT_SRC, acpi_parse_plat_int_src) < 0)
+	if (acpi_table_parse_madt(ACPI_MADT_PLAT_INT_SRC, acpi_parse_plat_int_src, ACPI_MAX_PLATFORM_INTERRUPTS) < 0)
 		printk(KERN_ERR PREFIX "Error parsing platform interrupt source entry\n");
 
-	if (acpi_table_parse_madt(ACPI_MADT_INT_SRC_OVR, acpi_parse_int_src_ovr) < 0)
+	if (acpi_table_parse_madt(ACPI_MADT_INT_SRC_OVR, acpi_parse_int_src_ovr, 0) < 0)
 		printk(KERN_ERR PREFIX "Error parsing interrupt source overrides entry\n");
 
-	if (acpi_table_parse_madt(ACPI_MADT_NMI_SRC, acpi_parse_nmi_src) < 0)
+	if (acpi_table_parse_madt(ACPI_MADT_NMI_SRC, acpi_parse_nmi_src, 0) < 0)
 		printk(KERN_ERR PREFIX "Error parsing NMI SRC entry\n");
   skip_madt:
 
--- diff/arch/ia64/kernel/iosapic.c	2004-01-19 10:22:55.000000000 +0000
+++ source/arch/ia64/kernel/iosapic.c	2004-02-09 10:39:51.000000000 +0000
@@ -114,7 +114,7 @@
 	char		*addr;		/* base address of IOSAPIC */
 	unsigned int 	gsi_base;	/* first GSI assigned to this IOSAPIC */
 	unsigned short 	num_rte;	/* number of RTE in this IOSAPIC */
-} iosapic_lists[256];
+} iosapic_lists[NR_IOSAPICS];
 
 static int num_iosapic;
 
--- diff/arch/ia64/kernel/unwind.c	2004-02-09 10:36:07.000000000 +0000
+++ source/arch/ia64/kernel/unwind.c	2004-02-09 10:39:51.000000000 +0000
@@ -650,7 +650,7 @@
 
 /* Unwind decoder routines */
 
-static enum unw_register_index __attribute__((const))
+static enum unw_register_index __attribute_const__
 decode_abreg (unsigned char abreg, int memory)
 {
 	switch (abreg) {
--- diff/arch/ia64/lib/dec_and_lock.c	2004-01-19 10:22:55.000000000 +0000
+++ source/arch/ia64/lib/dec_and_lock.c	2004-02-09 10:39:51.000000000 +0000
@@ -13,6 +13,7 @@
 #include <linux/spinlock.h>
 #include <asm/atomic.h>
 
+#ifndef CONFIG_LOCKMETER
 /*
  * Decrement REFCOUNT and if the count reaches zero, acquire the spinlock.  Both of these
  * operations have to be done atomically, so that the count doesn't drop to zero without
@@ -40,3 +41,4 @@
 }
 
 EXPORT_SYMBOL(atomic_dec_and_lock);
+#endif
--- diff/arch/ia64/mm/discontig.c	2004-01-19 10:22:55.000000000 +0000
+++ source/arch/ia64/mm/discontig.c	2004-02-09 10:39:51.000000000 +0000
@@ -419,14 +419,14 @@
 
 	func = arg;
 
-	if (!num_memblks) {
-		/* No SRAT table, to assume one node (node 0) */
+	if (!num_node_memblks) {
+		/* No SRAT table, so assume one node (node 0) */
 		if (start < end)
 			(*func)(start, len, 0);
 		return;
 	}
 
-	for (i = 0; i < num_memblks; i++) {
+	for (i = 0; i < num_node_memblks; i++) {
 		rs = max(start, node_memblk[i].start_paddr);
 		re = min(end, node_memblk[i].start_paddr +
 			 node_memblk[i].size);
--- diff/arch/ia64/mm/numa.c	2004-02-09 10:36:07.000000000 +0000
+++ source/arch/ia64/mm/numa.c	2004-02-09 10:39:51.000000000 +0000
@@ -13,7 +13,6 @@
 #include <linux/config.h>
 #include <linux/cpu.h>
 #include <linux/kernel.h>
-#include <linux/memblk.h>
 #include <linux/mm.h>
 #include <linux/node.h>
 #include <linux/init.h>
@@ -21,7 +20,6 @@
 #include <asm/mmzone.h>
 #include <asm/numa.h>
 
-static struct memblk *sysfs_memblks;
 static struct node *sysfs_nodes;
 static struct cpu *sysfs_cpus;
 
@@ -29,8 +27,8 @@
  * The following structures are usually initialized by ACPI or
  * similar mechanisms and describe the NUMA characteristics of the machine.
  */
-int num_memblks;
-struct node_memblk_s node_memblk[NR_MEMBLKS];
+int num_node_memblks;
+struct node_memblk_s node_memblk[NR_NODE_MEMBLKS];
 struct node_cpuid_s node_cpuid[NR_CPUS];
 /*
  * This is a matrix with "distances" between nodes, they should be
@@ -44,12 +42,12 @@
 {
 	int	i;
 
-	for (i = 0; i < num_memblks; i++)
+	for (i = 0; i < num_node_memblks; i++)
 		if (paddr >= node_memblk[i].start_paddr &&
 		    paddr < node_memblk[i].start_paddr + node_memblk[i].size)
 			break;
 
-	return (i < num_memblks) ? node_memblk[i].nid : (num_memblks ? -1 : 0);
+	return (i < num_node_memblks) ? node_memblk[i].nid : (num_node_memblks ? -1 : 0);
 }
 
 static int __init topology_init(void)
@@ -63,18 +61,8 @@
 	}
 	memset(sysfs_nodes, 0, sizeof(struct node) * numnodes);
 
-	sysfs_memblks = kmalloc(sizeof(struct memblk) * num_memblks,
-				GFP_KERNEL);
-	if (!sysfs_memblks) {
-		kfree(sysfs_nodes);
-		err = -ENOMEM;
-		goto out;
-	}
-	memset(sysfs_memblks, 0, sizeof(struct memblk) * num_memblks);
-
 	sysfs_cpus = kmalloc(sizeof(struct cpu) * NR_CPUS, GFP_KERNEL);
 	if (!sysfs_cpus) {
-		kfree(sysfs_memblks);
 		kfree(sysfs_nodes);
 		err = -ENOMEM;
 		goto out;
@@ -85,11 +73,6 @@
 		if ((err = register_node(&sysfs_nodes[i], i, 0)))
 			goto out;
 
-	for (i = 0; i < num_memblks; i++)
-		if ((err = register_memblk(&sysfs_memblks[i], i,
-					   &sysfs_nodes[memblk_to_node(i)])))
-			goto out;
-
 	for (i = 0; i < NR_CPUS; i++)
 		if (cpu_online(i))
 			if((err = register_cpu(&sysfs_cpus[i], i,
--- diff/arch/ia64/sn/io/hwgfs/hcl.c	2004-02-09 10:36:07.000000000 +0000
+++ source/arch/ia64/sn/io/hwgfs/hcl.c	2004-02-09 10:39:51.000000000 +0000
@@ -645,7 +645,7 @@
 
 
 void
-hwgraph_debug(char *file, char * function, int line, vertex_hdl_t vhdl1, vertex_hdl_t vhdl2, char *format, ...)
+hwgraph_debug(char *file, const char * function, int line, vertex_hdl_t vhdl1, vertex_hdl_t vhdl2, char *format, ...)
 {
 
 	int pos;
--- diff/arch/ia64/sn/io/hwgfs/hcl_util.c	2004-02-09 10:36:07.000000000 +0000
+++ source/arch/ia64/sn/io/hwgfs/hcl_util.c	2004-02-09 10:39:51.000000000 +0000
@@ -151,7 +151,7 @@
 		(void)hwgraph_edge_add( hwgraph_all_cnodes,
 					vhdl,
 					cnodeid_buffer);
-		HWGRAPH_DEBUG((__FILE__, __FUNCTION__, __LINE__, hwgraph_all_cnodes, NULL, "Creating path vhdl1\n"));
+		HWGRAPH_DEBUG(__FILE__, __FUNCTION__, __LINE__, hwgraph_all_cnodes, NULL, "Creating path vhdl1\n");
 	}
 }
 
--- diff/arch/ia64/sn/io/io.c	2004-02-09 10:36:07.000000000 +0000
+++ source/arch/ia64/sn/io/io.c	2004-02-09 10:39:51.000000000 +0000
@@ -6,9 +6,9 @@
  * Copyright (C) 1992-1997, 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/slab.h>
+#include <linux/sched.h>
 #include <asm/sn/types.h>
 #include <asm/sn/sgi.h>
 #include <asm/sn/driver.h>
@@ -123,7 +123,7 @@
 
 	/* sanity check */
 	if (byte_count_max > byte_count)
-		return(NULL);
+		return NULL;
 
 	hubinfo_get(hubv, &hubinfo);
 
@@ -152,7 +152,7 @@
 	 * For now, reject requests that span big windows.
 	 */
 	if ((xtalk_addr % BWIN_SIZE) + byte_count > BWIN_SIZE)
-		return(NULL);
+		return NULL;
 
 
 	/* Round xtalk address down for big window alignement */
@@ -184,7 +184,7 @@
 		     widget == bw_piomap->hpio_xtalk_info.xp_target) {
 			bw_piomap->hpio_holdcnt++;
 			spin_unlock(&hubinfo->h_bwlock);
-			return(bw_piomap);
+			return bw_piomap;
 		}
 	}
 
@@ -264,7 +264,7 @@
 
 done:
 	spin_unlock(&hubinfo->h_bwlock);
-	return(bw_piomap);
+	return bw_piomap;
 }
 
 /*
@@ -330,18 +330,18 @@
 {
 	/* Verify that range can be mapped using the specified piomap */
 	if (xtalk_addr < hub_piomap->hpio_xtalk_info.xp_xtalk_addr)
-		return(0);
+		return 0;
 
 	if (xtalk_addr + byte_count > 
 		( hub_piomap->hpio_xtalk_info.xp_xtalk_addr + 
 			hub_piomap->hpio_xtalk_info.xp_mapsz))
-		return(0);
+		return 0;
 
 	if (hub_piomap->hpio_flags & HUB_PIOMAP_IS_VALID)
-		return(hub_piomap->hpio_xtalk_info.xp_kvaddr + 
-			(xtalk_addr % hub_piomap->hpio_xtalk_info.xp_mapsz));
+		return hub_piomap->hpio_xtalk_info.xp_kvaddr + 
+			(xtalk_addr % hub_piomap->hpio_xtalk_info.xp_mapsz);
 	else
-		return(0);
+		return 0;
 }
 
 
@@ -388,9 +388,9 @@
 			addr = (caddr_t)iaddr;
 		}
 #endif
-		return(addr);
+		return addr;
 	} else
-		return(0);
+		return 0;
 }
 
 
@@ -425,7 +425,7 @@
  	if (flags & XTALK_FIXED)
 		dmamap->hdma_flags |= HUB_DMAMAP_IS_FIXED;
 
-	return(dmamap);
+	return dmamap;
 }
 
 /*
@@ -467,42 +467,12 @@
 	}
 
 	/* There isn't actually any DMA mapping hardware on the hub. */
-        return( (PHYS_TO_DMA(paddr)) );
-}
-
-/*
- * Establish a DMA mapping using the resources allocated in a previous dmamap_alloc.
- * Return an appropriate crosstalk address list that maps to the specified physical 
- * address list.
- */
-/* ARGSUSED */
-alenlist_t
-hub_dmamap_list(hub_dmamap_t hub_dmamap,	/* use these mapping resources */
-		alenlist_t palenlist,		/* map this area of memory */
-		unsigned flags)
-{
-	vertex_hdl_t vhdl;
-
-	ASSERT(hub_dmamap->hdma_flags & HUB_DMAMAP_IS_VALID);
-
-	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;
-		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;
-	}
-
-	/* There isn't actually any DMA mapping hardware on the hub.  */
-	return(palenlist);
+        return (PHYS_TO_DMA(paddr));
 }
 
 /*
  * Driver indicates that it has completed whatever DMA it may have started
- * after an earlier dmamap_addr or dmamap_list call.
+ * after an earlier dmamap_addr call.
  */
 void
 hub_dmamap_done(hub_dmamap_t hub_dmamap)	/* done with these mapping resources */
@@ -532,24 +502,7 @@
 			size_t byte_count,	/* length */
 			unsigned flags)		/* defined in dma.h */
 {
-	return( (PHYS_TO_DMA(paddr)) );
-}
-
-/*
- * Translate a list of IP27 addresses and lengths into a list of crosstalk 
- * addresses and lengths.  No actual hardware mapping takes place; the hub 
- * has no DMA mapping registers -- crosstalk addresses map directly.
- */
-/* ARGSUSED */
-alenlist_t
-hub_dmatrans_list(	vertex_hdl_t dev,	/* translate for this device */
-			device_desc_t dev_desc,	/* device descriptor */
-			alenlist_t palenlist,	/* system address/length list */
-			unsigned flags)		/* defined in dma.h */
-{
-	BUG();
-	/* no translation needed */
-	return(palenlist);
+	return (PHYS_TO_DMA(paddr));
 }
 
 /*ARGSUSED*/
@@ -568,15 +521,6 @@
     /* XXX- flush caches, if cache coherency WAR is needed */
 }
 
-/*ARGSUSED*/
-void
-hub_dmalist_drain(	vertex_hdl_t vhdl,
-			alenlist_t list)
-{
-    /* XXX- flush caches, if cache coherency WAR is needed */
-}
-
-
 
 /* CONFIGURATION MANAGEMENT */
 
@@ -609,8 +553,8 @@
 {
 	nasid_t nasid = NASID_GET(addr);
 
-	if (((__psunsigned_t)addr >= RAW_NODE_SWIN_BASE(nasid, 0)) &&
-	    ((__psunsigned_t)addr < RAW_NODE_SWIN_BASE(nasid, 1)))
+	if (((unsigned long)addr >= RAW_NODE_SWIN_BASE(nasid, 0)) &&
+	    ((unsigned long)addr < RAW_NODE_SWIN_BASE(nasid, 1)))
 		return 1;
 	return 0;
 }
@@ -626,8 +570,8 @@
 		return 1;
 
 	/* XXX - Assume this is really a small window address */
-	if (WIDGETID_GET((__psunsigned_t)addra) ==
-	    WIDGETID_GET((__psunsigned_t)addrb))
+	if (WIDGETID_GET((unsigned long)addra) ==
+	    WIDGETID_GET((unsigned long)addrb))
 		return 1;
 
 	return 0;
@@ -768,28 +712,25 @@
  * crosstalk bus provider.
  */
 xtalk_provider_t hub_provider = {
-	(xtalk_piomap_alloc_f *)	hub_piomap_alloc,
-	(xtalk_piomap_free_f *)		hub_piomap_free,
-	(xtalk_piomap_addr_f *)		hub_piomap_addr,
-	(xtalk_piomap_done_f *)		hub_piomap_done,
-	(xtalk_piotrans_addr_f *)	hub_piotrans_addr,
-
-	(xtalk_dmamap_alloc_f *)	hub_dmamap_alloc,
-	(xtalk_dmamap_free_f *)		hub_dmamap_free,
-	(xtalk_dmamap_addr_f *)		hub_dmamap_addr,
-	(xtalk_dmamap_list_f *)		hub_dmamap_list,
-	(xtalk_dmamap_done_f *)		hub_dmamap_done,
-	(xtalk_dmatrans_addr_f *)	hub_dmatrans_addr,
-	(xtalk_dmatrans_list_f *)	hub_dmatrans_list,
-	(xtalk_dmamap_drain_f *)	hub_dmamap_drain,
-	(xtalk_dmaaddr_drain_f *)	hub_dmaaddr_drain,
-	(xtalk_dmalist_drain_f *)	hub_dmalist_drain,
-
-	(xtalk_intr_alloc_f *)		hub_intr_alloc,
-	(xtalk_intr_alloc_f *)		hub_intr_alloc_nothd,
-	(xtalk_intr_free_f *)		hub_intr_free,
-	(xtalk_intr_connect_f *)	hub_intr_connect,
-	(xtalk_intr_disconnect_f *)	hub_intr_disconnect,
-	(xtalk_provider_startup_f *)	hub_provider_startup,
-	(xtalk_provider_shutdown_f *)	hub_provider_shutdown,
+	.piomap_alloc	= (xtalk_piomap_alloc_f *) hub_piomap_alloc,
+	.piomap_free	= (xtalk_piomap_free_f *) hub_piomap_free,
+	.piomap_addr	= (xtalk_piomap_addr_f *) hub_piomap_addr,
+	.piomap_done	= (xtalk_piomap_done_f *) hub_piomap_done,
+	.piotrans_addr	= (xtalk_piotrans_addr_f *) hub_piotrans_addr,
+
+	.dmamap_alloc	= (xtalk_dmamap_alloc_f *) hub_dmamap_alloc,
+	.dmamap_free	= (xtalk_dmamap_free_f *) hub_dmamap_free,
+	.dmamap_addr	= (xtalk_dmamap_addr_f *) hub_dmamap_addr,
+	.dmamap_done	= (xtalk_dmamap_done_f *) hub_dmamap_done,
+	.dmatrans_addr	= (xtalk_dmatrans_addr_f *) hub_dmatrans_addr,
+	.dmamap_drain	= (xtalk_dmamap_drain_f *) hub_dmamap_drain,
+	.dmaaddr_drain	= (xtalk_dmaaddr_drain_f *) hub_dmaaddr_drain,
+
+	.intr_alloc	= (xtalk_intr_alloc_f *) hub_intr_alloc,
+	.intr_alloc_nothd = (xtalk_intr_alloc_f *) hub_intr_alloc_nothd,
+	.intr_free	= (xtalk_intr_free_f *)	hub_intr_free,
+	.intr_connect	= (xtalk_intr_connect_f *) hub_intr_connect,
+	.intr_disconnect = (xtalk_intr_disconnect_f *) hub_intr_disconnect,
+	.provider_startup = (xtalk_provider_startup_f *) hub_provider_startup,
+	.provider_shutdown = (xtalk_provider_shutdown_f *) hub_provider_shutdown,
 };
--- diff/arch/ia64/sn/io/machvec/pci_bus_cvlink.c	2004-02-09 10:36:07.000000000 +0000
+++ source/arch/ia64/sn/io/machvec/pci_bus_cvlink.c	2004-02-09 10:39:51.000000000 +0000
@@ -7,6 +7,7 @@
  */
 
 #include <linux/vmalloc.h>
+#include <linux/slab.h>
 #include <asm/sn/sgi.h>
 #include <asm/sn/iograph.h>
 #include <asm/sn/pci/pci_bus_cvlink.h>
@@ -22,13 +23,20 @@
 static int done_probing;
 extern irqpda_t *irqpdaindr;
 
-static int pci_bus_map_create(vertex_hdl_t xtalk, char * io_moduleid);
+static int pci_bus_map_create(struct pcibr_list_s *softlistp, moduleid_t io_moduleid);
 vertex_hdl_t devfn_to_vertex(unsigned char busnum, unsigned int devfn);
 
 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);
+static 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);
+extern void ioconfig_bus_new_entries(void);
+extern void ioconfig_get_busnum(char *, int *);
+extern int iomoduleid_get(nasid_t);
+extern int pcibr_widget_to_bus(vertex_hdl_t);
+extern int isIO9(int);
 
 #define IS_OPUS(nasid) (cbrick_type_get_nasid(nasid) == MODULE_OPUSBRICK)
 #define IS_ALTIX(nasid) (cbrick_type_get_nasid(nasid) == MODULE_CBRICK)
@@ -37,7 +45,7 @@
  * Init the provider asic for a given device
  */
 
-static void
+static inline void __init
 set_pci_provider(struct sn_device_sysdata *device_sysdata)
 {
 	pciio_info_t pciio_info = pciio_info_get(device_sysdata->vhdl);
@@ -69,7 +77,7 @@
  * pci_bus_to_vertex() - Given a logical Linux Bus Number returns the associated 
  *	pci bus vertex from the SGI IO Infrastructure.
  */
-vertex_hdl_t
+static inline vertex_hdl_t
 pci_bus_to_vertex(unsigned char busnum)
 {
 
@@ -157,16 +165,15 @@
  * 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) {
+static void
+sn_dma_flush_init(unsigned long start, unsigned long end, int idx, int pin, int slot)
+{
 	nasid_t nasid; 
 	unsigned long dnasid;
 	int wid_num;
 	int bus;
 	struct sn_flush_device_list *p;
-	bridge_t *b;
-	bridgereg_t dev_sel;
-	extern int isIO9(int);
+	void *b;
 	int bwin;
 	int i;
 
@@ -178,8 +185,8 @@
 	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");
+		if (!flush_nasid_list[nasid].widget_p) {
+			printk(KERN_WARNING "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 *));
@@ -209,8 +216,8 @@
 	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");
+		if (!flush_nasid_list[nasid].widget_p[wid_num]) {
+			printk(KERN_WARNING "sn_dma_flush_init: Cannot allocate memory for nasid sub-list\n");
 			return;
 		}
 		memset(flush_nasid_list[nasid].widget_p[wid_num], 0, 
@@ -243,7 +250,7 @@
 			break;
 		}
 	}
-	b = (bridge_t *)(NODE_SWIN_BASE(nasid, wid_num) | (bus << 23) );
+	b = (void *)(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
@@ -267,39 +274,34 @@
 	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;
-			dev_sel |= (1<<18);
-			b->b_int_device = dev_sel;
+		if (pin == 1) {
+			p->force_int_addr = (unsigned long)pcireg_bridge_force_always_addr_get(b, 6);
+			pcireg_bridge_intr_device_bit_set(b, (1<<18));
 			dnasid = NASID_GET(virt_to_phys(&p->flush_addr));
-			b->p_int_addr_64[6] = (virt_to_phys(&p->flush_addr) & 0xfffffffff) | 
-				(dnasid << 36) | (0xfUL << 48);
-		} else  if (slot == 3) { /* 12160 SCSI device in IO9 */
-			p->force_int_addr = (unsigned long)&b->b_force_always[4].intr;
-			dev_sel = b->b_int_device;
-			dev_sel |= (2<<12);
-			b->b_int_device = dev_sel;
+			pcireg_bridge_intr_addr_set(b, 6, ((virt_to_phys(&p->flush_addr) & 0xfffffffff) |
+						    (dnasid << 36) | (0xfUL << 48)));
+		} else if (pin == 2) { /* 12160 SCSI device in IO9 */
+			p->force_int_addr = (unsigned long)pcireg_bridge_force_always_addr_get(b, 4);
+			pcireg_bridge_intr_device_bit_set(b, (2<<12));
 			dnasid = NASID_GET(virt_to_phys(&p->flush_addr));
-			b->p_int_addr_64[4] = (virt_to_phys(&p->flush_addr) & 0xfffffffff) | 
-				(dnasid << 36) | (0xfUL << 48);
+			pcireg_bridge_intr_addr_set(b, 4,
+					((virt_to_phys(&p->flush_addr) & 0xfffffffff) |
+					    (dnasid << 36) | (0xfUL << 48)));
 		} else { /* slot == 6 */
-			p->force_int_addr = (unsigned long)&b->b_force_always[7].intr;
-			dev_sel = b->b_int_device;
-			dev_sel |= (5<<21);
-			b->b_int_device = dev_sel;
+			p->force_int_addr = (unsigned long)pcireg_bridge_force_always_addr_get(b, 7);
+			pcireg_bridge_intr_device_bit_set(b, (5<<21));
 			dnasid = NASID_GET(virt_to_phys(&p->flush_addr));
-			b->p_int_addr_64[7] = (virt_to_phys(&p->flush_addr) & 0xfffffffff) | 
-				(dnasid << 36) | (0xfUL << 48);
+			pcireg_bridge_intr_addr_set(b, 7,
+					((virt_to_phys(&p->flush_addr) & 0xfffffffff) |
+					    (dnasid << 36) | (0xfUL << 48)));
 		}
 	} else {
-		p->force_int_addr = (unsigned long)&b->b_force_always[pin + 2].intr;
-		dev_sel = b->b_int_device;
-		dev_sel |= ((slot - 1) << ( pin * 3) );
-		b->b_int_device = dev_sel;
+		p->force_int_addr = (unsigned long)pcireg_bridge_force_always_addr_get(b, (pin +2));
+		pcireg_bridge_intr_device_bit_set(b, (pin << (pin * 3)));
 		dnasid = NASID_GET(virt_to_phys(&p->flush_addr));
-		b->p_int_addr_64[pin + 2] = (virt_to_phys(&p->flush_addr) & 0xfffffffff) | 
-			(dnasid << 36) | (0xfUL << 48);
+		pcireg_bridge_intr_addr_set(b, (pin + 2),
+				((virt_to_phys(&p->flush_addr) & 0xfffffffff) |
+				    (dnasid << 36) | (0xfUL << 48)));
 	}
 }
 
@@ -310,7 +312,7 @@
  *
  *	Other platform specific fixup can also be done here.
  */
-void
+static void __init
 sn_pci_fixup(int arg)
 {
 	struct list_head *ln;
@@ -321,7 +323,7 @@
 	pcibr_intr_t intr_handle;
 	pciio_provider_t *pci_provider;
 	vertex_hdl_t device_vertex;
-	pciio_intr_line_t lines;
+	pciio_intr_line_t lines = 0;
 	extern int numnodes;
 	int cnode;
 
@@ -357,6 +359,11 @@
 		pci_bus = pci_bus_b(ln);
 		widget_sysdata = kmalloc(sizeof(struct sn_widget_sysdata), 
 					GFP_KERNEL);
+		if (!widget_sysdata) {
+			printk(KERN_WARNING "sn_pci_fixup(): Unable to "
+			       "allocate memory for widget_sysdata\n");
+			return;
+		}			
 		widget_sysdata->vhdl = pci_bus_to_vertex(pci_bus->number);
 		pci_bus->sysdata = (void *)widget_sysdata;
 	}
@@ -394,13 +401,12 @@
 
 		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");
+		if (!device_sysdata) {
+			printk(KERN_WARNING "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_dev->sysdata = (void *) device_sysdata;
 		set_pci_provider(device_sysdata);
 
@@ -486,14 +492,22 @@
 		device_vertex = device_sysdata->vhdl;
 		pci_provider = device_sysdata->pci_provider;
  
+		if (!lines) {
+			continue;
+		}
+
 		irqpdaindr->curr = device_dev;
 		intr_handle = (pci_provider->intr_alloc)(device_vertex, NULL, lines, device_vertex);
 
+		if (intr_handle == NULL) {
+			printk("sn_pci_fixup:  pcibr_intr_alloc() failed\n");
+			continue;
+		}
 		irq = intr_handle->bi_irq;
 		irqpdaindr->device_dev[irq] = device_dev;
 		(pci_provider->intr_connect)(intr_handle, (intr_func_t)0, (intr_arg_t)0);
 		device_dev->irq = irq;
-		register_pcibr_intr(irq, intr_handle);
+		register_pcibr_intr(irq, (pcibr_intr_t)intr_handle);
 
 		for (idx = 0; idx < PCI_ROM_RESOURCE; idx++) {
 			int ibits = intr_handle->bi_ibits;
@@ -507,10 +521,10 @@
 			for (i=0; i<8; i++) {
 				if (ibits & (1 << i) ) {
 					sn_dma_flush_init(device_dev->resource[idx].start, 
-							device_dev->resource[idx].end,
-							idx,
-							i,
-							PCI_SLOT(device_dev->devfn));
+						device_dev->resource[idx].end,
+						idx,
+						i,
+						PCIBR_INFO_SLOT_GET_EXT(pcibr_info_get(device_sysdata->vhdl)));
 				}
 			}
 		}
@@ -548,238 +562,132 @@
  * pci_bus_map_create() - Called by pci_bus_to_hcl_cvlink() to finish the job.
  *
  *	Linux PCI Bus numbers are assigned from lowest module_id numbers
- *	(rack/slot etc.) starting from HUB_WIDGET_ID_MAX down to 
- *	HUB_WIDGET_ID_MIN:
- *		widgetnum 15 gets lower Bus Number than widgetnum 14 etc.
- *
- *	Given 2 modules 001c01 and 001c02 we get the following mappings:
- *		001c01, widgetnum 15 = Bus number 0
- *		001c01, widgetnum 14 = Bus number 1
- *		001c02, widgetnum 15 = Bus number 3
- *		001c02, widgetnum 14 = Bus number 4
- *		etc.
- *
- * The rational for starting Bus Number 0 with Widget number 15 is because 
- * the system boot disks are always connected via Widget 15 Slot 0 of the 
- * I-brick.  Linux creates /dev/sd* devices(naming) strating from Bus Number 0 
- * Therefore, /dev/sda1 will be the first disk, on Widget 15 of the lowest 
- * module id(Master Cnode) of the system.
- *	
+ *	(rack/slot etc.)
  */
 static int 
-pci_bus_map_create(vertex_hdl_t xtalk, char * io_moduleid)
+pci_bus_map_create(struct pcibr_list_s *softlistp, moduleid_t moduleid)
 {
+	
+	int basebus_num, bus_number;
+	vertex_hdl_t pci_bus = softlistp->bl_vhdl;
+	char moduleid_str[16];
 
-	vertex_hdl_t master_node_vertex = NULL;
-	vertex_hdl_t xwidget = NULL;
-	vertex_hdl_t pci_bus = NULL;
-	hubinfo_t hubinfo = NULL;
-	xwidgetnum_t widgetnum;
-	char pathname[128];
-	graph_error_t rv;
-	int bus;
-	int basebus_num;
-	extern void ioconfig_get_busnum(char *, int *);
-
-	int bus_number;
+	memset(moduleid_str, 0, 16);
+	format_module_id(moduleid_str, moduleid, MODULE_FORMAT_BRIEF);
+        (void) ioconfig_get_busnum((char *)moduleid_str, &basebus_num);
 
 	/*
-	 * Loop throught this vertex and get the Xwidgets ..
+	 * Assign the correct bus number and also the nasid of this 
+	 * pci Xwidget.
 	 */
-
-
-	/* PCI devices */
-
-	for (widgetnum = HUB_WIDGET_ID_MAX; widgetnum >= HUB_WIDGET_ID_MIN; widgetnum--) {
-		sprintf(pathname, "%d", widgetnum);
-		xwidget = NULL;
-		
-		/*
-		 * Example - /hw/module/001c16/Pbrick/xtalk/8 is the xwidget
-		 *	     /hw/module/001c16/Pbrick/xtalk/8/pci/1 is device
-		 */
-		rv = hwgraph_traverse(xtalk, pathname, &xwidget);
-		if ( (rv != GRAPH_SUCCESS) ) {
-			if (!xwidget) {
-				continue;
-			}
-		}
-
-		sprintf(pathname, "%d/"EDGE_LBL_PCI, widgetnum);
-		pci_bus = NULL;
-		if (hwgraph_traverse(xtalk, pathname, &pci_bus) != GRAPH_SUCCESS)
-			if (!pci_bus) {
-				continue;
-}
-
-		/*
-		 * Assign the correct bus number and also the nasid of this 
-		 * pci Xwidget.
-		 * 
-		 * Should not be any race here ...
-		 */
-		num_bridges++;
-		busnum_to_pcibr_vhdl[num_bridges - 1] = pci_bus;
-
-		/*
-		 * Get the master node and from there get the NASID.
-		 */
-		master_node_vertex = device_master_get(xwidget);
-		if (!master_node_vertex) {
-			printk("WARNING: pci_bus_map_create: Unable to get .master for vertex 0x%p\n", (void *)xwidget);
-		}
-	
-		hubinfo_get(master_node_vertex, &hubinfo);
-		if (!hubinfo) {
-			printk("WARNING: pci_bus_map_create: Unable to get hubinfo for master node vertex 0x%p\n", (void *)master_node_vertex);
-			return(1);
-		} else {
-			busnum_to_nid[num_bridges - 1] = hubinfo->h_nasid;
-		}
-
-		/*
-		 * Pre assign DMA maps needed for 32 Bits Page Map DMA.
-		 */
-		busnum_to_atedmamaps[num_bridges - 1] = (void *) kmalloc(
-			sizeof(struct pcibr_dmamap_s) * MAX_ATE_MAPS, GFP_KERNEL);
-		if (!busnum_to_atedmamaps[num_bridges - 1])
-			printk("WARNING: pci_bus_map_create: Unable to precreate ATE DMA Maps for busnum %d vertex 0x%p\n", num_bridges - 1, (void *)xwidget);
-
-		memset(busnum_to_atedmamaps[num_bridges - 1], 0x0, 
-			sizeof(struct pcibr_dmamap_s) * MAX_ATE_MAPS);
-
+	bus_number = basebus_num + pcibr_widget_to_bus(pci_bus);
+#ifdef DEBUG
+	{
+	char hwpath[MAXDEVNAME] = "\0";
+	extern int hwgraph_vertex_name_get(vertex_hdl_t, char *, uint);
+
+	pcibr_soft_t pcibr_soft = softlistp->bl_soft;
+	hwgraph_vertex_name_get(pci_bus, hwpath, MAXDEVNAME);
+	printk("%s:\n\tbus_num %d, basebus_num %d, brick_bus %d, "
+		"bus_vhdl 0x%lx, brick_type %d\n", hwpath, bus_number,
+		basebus_num, pcibr_widget_to_bus(pci_bus),
+		(uint64_t)pci_bus, pcibr_soft->bs_bricktype);
 	}
+#endif
+	busnum_to_pcibr_vhdl[bus_number] = pci_bus;
 
 	/*
-	 * PCIX devices
-	 * We number busses differently for PCI-X devices.
-	 * We start from Lowest Widget on up ..
+	 * Pre assign DMA maps needed for 32 Bits Page Map DMA.
 	 */
-
-        (void) ioconfig_get_busnum((char *)io_moduleid, &basebus_num);
-
-	for (widgetnum = HUB_WIDGET_ID_MIN; widgetnum <= HUB_WIDGET_ID_MAX; widgetnum++) {
-
-		/* Do both buses */
-		for ( bus = 0; bus < 2; bus++ ) {
-			sprintf(pathname, "%d", widgetnum);
-			xwidget = NULL;
-			
-			/*
-			 * Example - /hw/module/001c16/Pbrick/xtalk/8 is the xwidget
-			 *	     /hw/module/001c16/Pbrick/xtalk/8/pci-x/0 is the bus
-			 *	     /hw/module/001c16/Pbrick/xtalk/8/pci-x/0/1 is device
-			 */
-			rv = hwgraph_traverse(xtalk, pathname, &xwidget);
-			if ( (rv != GRAPH_SUCCESS) ) {
-				if (!xwidget) {
-					continue;
-				}
-			}
-	
-			if ( bus == 0 )
-				sprintf(pathname, "%d/"EDGE_LBL_PCIX_0, widgetnum);
-			else
-				sprintf(pathname, "%d/"EDGE_LBL_PCIX_1, widgetnum);
-			pci_bus = NULL;
-			if (hwgraph_traverse(xtalk, pathname, &pci_bus) != GRAPH_SUCCESS)
-				if (!pci_bus) {
-					continue;
-				}
-	
-			/*
-			 * Assign the correct bus number and also the nasid of this 
-			 * pci Xwidget.
-			 * 
-			 * Should not be any race here ...
-			 */
-			bus_number = basebus_num + bus + io_brick_map_widget(MODULE_PXBRICK, widgetnum);
-#ifdef DEBUG
-			printk("bus_number %d basebus_num %d bus %d io %d\n", 
-				bus_number, basebus_num, bus, 
-				io_brick_map_widget(MODULE_PXBRICK, widgetnum));
-#endif
-			busnum_to_pcibr_vhdl[bus_number] = pci_bus;
-	
-			/*
-			 * Pre assign DMA maps needed for 32 Bits Page Map DMA.
-			 */
-			busnum_to_atedmamaps[bus_number] = (void *) kmalloc(
-				sizeof(struct pcibr_dmamap_s) * MAX_ATE_MAPS, GFP_KERNEL);
-			if (!busnum_to_atedmamaps[bus_number])
-				printk("WARNING: pci_bus_map_create: Unable to precreate ATE DMA Maps for busnum %d vertex 0x%p\n", num_bridges - 1, (void *)xwidget);
-	
-			memset(busnum_to_atedmamaps[bus_number], 0x0, 
-				sizeof(struct pcibr_dmamap_s) * MAX_ATE_MAPS);
-		}
+	busnum_to_atedmamaps[bus_number] = (void *) vmalloc(
+			sizeof(struct pcibr_dmamap_s)*MAX_ATE_MAPS);
+	if (busnum_to_atedmamaps[bus_number] <= 0) {
+		printk("pci_bus_map_create: Cannot allocate memory for ate maps\n");
+		return -1;
 	}
-
-        return(0);
+	memset(busnum_to_atedmamaps[bus_number], 0x0, 
+			sizeof(struct pcibr_dmamap_s) * MAX_ATE_MAPS);
+	return(0);
 }
 
 /*
- * pci_bus_to_hcl_cvlink() - This routine is called after SGI IO Infrastructure   
- *      initialization has completed to set up the mappings between Xbridge
- *      and logical pci bus numbers.  We also set up the NASID for each of these
- *      xbridges.
+ * pci_bus_to_hcl_cvlink() - This routine is called after SGI IO Infrastructure 
+ *      initialization has completed to set up the mappings between PCI BRIDGE
+ *      ASIC and logical pci bus numbers. 
  *
  *      Must be called before pci_init() is invoked.
  */
 int
 pci_bus_to_hcl_cvlink(void) 
 {
+	int i;
+	extern pcibr_list_p pcibr_list;
 
-	vertex_hdl_t devfs_hdl = NULL;
-	vertex_hdl_t xtalk = NULL;
-	int rv = 0;
-	char name[256];
-	char tmp_name[256];
-	int i, ii, j;
-	char *brick_name;
-	extern void ioconfig_bus_new_entries(void);
-
-	/*
-	 * Figure out which IO Brick is connected to the Compute Bricks.
-	 */
 	for (i = 0; i < nummodules; i++) {
-		extern int iomoduleid_get(nasid_t);
-		moduleid_t iobrick_id;
-		nasid_t nasid = -1;
-		int nodecnt;
-		int n = 0;
-
-		nodecnt = modules[i]->nodecnt;
-		for ( n = 0; n < nodecnt; n++ ) {
-			nasid = cnodeid_to_nasid(modules[i]->nodes[n]);
-			iobrick_id = iomoduleid_get(nasid);
-			if ((int)iobrick_id > 0) { /* Valid module id */
-				char name[12];
-				memset(name, 0, 12);
-				format_module_id((char *)&(modules[i]->io[n].moduleid), iobrick_id, MODULE_FORMAT_BRIEF);
+		struct pcibr_list_s *softlistp = pcibr_list;
+		struct pcibr_list_s *first_in_list = NULL;
+		struct pcibr_list_s *last_in_list = NULL;
+
+		/* Walk the list of pcibr_soft structs looking for matches */
+		while (softlistp) {
+			struct pcibr_soft_s *pcibr_soft = softlistp->bl_soft;
+			moduleid_t moduleid;
+			
+			/* Is this PCI bus associated with this moduleid? */
+			moduleid = NODE_MODULEID(
+			    NASID_TO_COMPACT_NODEID(pcibr_soft->bs_nasid));
+			if (modules[i]->id == moduleid) {
+				struct pcibr_list_s *new_element;
+
+				new_element = kmalloc(sizeof (struct pcibr_soft_s), GFP_KERNEL);
+				if (new_element == NULL) {
+					printk("%s: Couldn't allocate memory\n",__FUNCTION__);
+					return -ENOMEM;
+				}
+				new_element->bl_soft = softlistp->bl_soft;
+				new_element->bl_vhdl = softlistp->bl_vhdl;
+				new_element->bl_next = NULL;
+
+				/* list empty so just put it on the list */
+				if (first_in_list == NULL) {
+					first_in_list = new_element;
+					last_in_list = new_element;
+					softlistp = softlistp->bl_next;
+					continue;
+				}
+
+				/* 
+ 				 * BASEIO IObricks attached to a module have 
+				 * a higher priority than non BASEIO IOBricks 
+				 * when it comes to persistant pci bus
+				 * numbering, so put them on the front of the
+				 * list.
+				 */
+				if (isIO9(pcibr_soft->bs_nasid)) {
+					new_element->bl_next = first_in_list;
+					first_in_list = new_element;
+				} else {
+					last_in_list->bl_next = new_element;
+					last_in_list = new_element;
+				}
 			}
+			softlistp = softlistp->bl_next;
 		}
-	}
 				
-	devfs_hdl = hwgraph_path_to_vertex("hw/module");
-	for (i = 0; i < nummodules ; i++) {
-	    for ( j = 0; j < 2; j++ ) {
-		if ( j == 0 )
-			brick_name = EDGE_LBL_PXBRICK;
-		else
-			brick_name = EDGE_LBL_IXBRICK;
-
-		for ( ii = 0; ii < 2 ; ii++ ) {
-			memset(name, 0, 256);
-			memset(tmp_name, 0, 256);
-			format_module_id(name, modules[i]->id, MODULE_FORMAT_BRIEF);
-			sprintf(tmp_name, "/slab/%d/%s/xtalk", geo_slab(modules[i]->geoid[ii]), brick_name);
-			strcat(name, tmp_name);
-			xtalk = NULL;
-			rv = hwgraph_edge_get(devfs_hdl, name, &xtalk);
-			if ( rv == 0 ) 
-				pci_bus_map_create(xtalk, (char *)&(modules[i]->io[ii].moduleid));
+		/* 
+		 * We now have a list of all the pci bridges associated with
+		 * the module_id, modules[i].  Call pci_bus_map_create() for
+		 * each pci bridge
+		 */
+		softlistp = first_in_list;
+		while (softlistp) {
+			moduleid_t iobrick;
+			struct pcibr_list_s *next = softlistp->bl_next;
+			iobrick = iomoduleid_get(softlistp->bl_soft->bs_nasid);
+			pci_bus_map_create(softlistp, iobrick);
+			kfree(softlistp);
+			softlistp = next;
 		}
-	    }
 	}
 
 	/*
@@ -806,6 +714,11 @@
 		return 0;
 
 	/*
+	 * This is needed to avoid bounce limit checks in the blk layer
+	 */
+	ia64_max_iommu_merge_mask = ~PAGE_MASK;
+
+	/*
 	 * set pci_raw_ops, etc.
 	 */
 	sn_pci_fixup(0);
--- diff/arch/ia64/sn/io/machvec/pci_dma.c	2004-02-09 10:36:07.000000000 +0000
+++ source/arch/ia64/sn/io/machvec/pci_dma.c	2004-02-09 10:39:51.000000000 +0000
@@ -138,6 +138,8 @@
 	if (!(cpuaddr = (void *)__get_free_pages(GFP_ATOMIC, get_order(size))))
 		return NULL;
 
+	memset(cpuaddr, 0x0, size);
+
 	/* physical addr. of the memory we just got */
 	phys_addr = __pa(cpuaddr);
 
@@ -154,7 +156,8 @@
 		*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);
+		dma_map = pcibr_dmamap_alloc(vhdl, NULL, size, PCIIO_DMA_CMD | 
+					     MINIMAL_ATE_FLAG(phys_addr, size));
 		if (dma_map) {
 			*dma_handle = (dma_addr_t)
 				pcibr_dmamap_addr(dma_map, phys_addr, size);
@@ -248,18 +251,6 @@
 		phys_addr = __pa((unsigned long)page_address(sg->page) + sg->offset);
 
 		/*
-		 * Handle the most common case: 64 bit cards.  This
-		 * call should always succeed.
-		 */
-		if (IS_PCIA64(hwdev)) {
-			sg->dma_address = pcibr_dmatrans_addr(vhdl, NULL, phys_addr,
-						       sg->length,
-						       PCIIO_DMA_DATA | PCIIO_DMA_A64);
-			sg->dma_length = sg->length;
-			continue;
-		}
-
-		/*
 		 * Handle 32-63 bit cards via direct mapping
 		 */
 		if (IS_PCI32G(hwdev)) {
@@ -385,13 +376,6 @@
 	dma_addr = 0;
 	phys_addr = __pa(ptr);
 
-	if (IS_PCIA64(hwdev)) {
-		/* This device supports 64 bit DMA addresses. */
-		dma_addr = pcibr_dmatrans_addr(vhdl, NULL, phys_addr, size,
-					       PCIIO_DMA_DATA | PCIIO_DMA_A64);
-		return dma_addr;
-	}
-
 	/*
 	 * Devices that support 32 bit to 63 bit DMA addresses get
 	 * 32 bit DMA addresses.
@@ -410,7 +394,8 @@
 	 * let's use the PMU instead.
 	 */
 	dma_map = NULL;
-	dma_map = pcibr_dmamap_alloc(vhdl, NULL, size, PCIIO_DMA_DATA);
+	dma_map = pcibr_dmamap_alloc(vhdl, NULL, size, PCIIO_DMA_DATA | 
+				     MINIMAL_ATE_FLAG(phys_addr, size));
 
 	if (!dma_map) {
 		printk(KERN_ERR "pci_map_single: Unable to allocate anymore "
--- diff/arch/ia64/sn/io/platform_init/sgi_io_init.c	2004-02-09 10:36:07.000000000 +0000
+++ source/arch/ia64/sn/io/platform_init/sgi_io_init.c	2004-02-09 10:39:51.000000000 +0000
@@ -131,7 +131,7 @@
 	klhwg_add_all_modules(hwgraph_root);
 	klhwg_add_all_nodes(hwgraph_root);
 
-	for (cnode = 0; cnode < numnodes; cnode++) {
+	for (cnode = 0; cnode < numionodes; cnode++) {
 		extern void per_hub_init(cnodeid_t);
 		per_hub_init(cnode);
 	}
--- diff/arch/ia64/sn/io/sn2/klconflib.c	2004-02-09 10:36:07.000000000 +0000
+++ source/arch/ia64/sn/io/sn2/klconflib.c	2004-02-09 10:39:51.000000000 +0000
@@ -31,6 +31,8 @@
 #define DBG(x...)
 #endif /* DEBUG_KLGRAPH */
 
+extern int numionodes;
+
 lboard_t *root_lboard[MAX_COMPACT_NODES];
 static int hasmetarouter;
 
@@ -38,13 +40,13 @@
 char brick_types[MAX_BRICK_TYPES + 1] = "crikxdpn%#=vo^34567890123456789...";
 
 lboard_t *
-find_lboard(lboard_t *start, unsigned char brd_type)
+find_lboard_any(lboard_t *start, unsigned char brd_type)
 {
 	/* Search all boards stored on this node. */
 	while (start) {
 		if (start->brd_type == brd_type)
 			return start;
-		start = KLCF_NEXT(start);
+		start = KLCF_NEXT_ANY(start);
 	}
 
 	/* Didn't find it. */
@@ -52,19 +54,59 @@
 }
 
 lboard_t *
-find_lboard_class(lboard_t *start, unsigned char brd_type)
+find_lboard_nasid(lboard_t *start, nasid_t nasid, unsigned char brd_type)
 {
-	/* Search all boards stored on this node. */
+
+	while (start) {
+		if ((start->brd_type == brd_type) && 
+		    (start->brd_nasid == nasid))
+			return start;
+
+		if (numionodes == numnodes)
+			start = KLCF_NEXT_ANY(start);
+		else
+			start = KLCF_NEXT(start);
+	}
+
+	/* Didn't find it. */
+	return (lboard_t *)NULL;
+}
+
+lboard_t *
+find_lboard_class_any(lboard_t *start, unsigned char brd_type)
+{
+        /* Search all boards stored on this node. */
 	while (start) {
 		if (KLCLASS(start->brd_type) == KLCLASS(brd_type))
 			return start;
-		start = KLCF_NEXT(start);
+		start = KLCF_NEXT_ANY(start);
+	}
+
+	/* Didn't find it. */
+	return (lboard_t *)NULL;
+}
+
+lboard_t *
+find_lboard_class_nasid(lboard_t *start, nasid_t nasid, unsigned char brd_type)
+{
+	/* Search all boards stored on this node. */
+	while (start) {
+		if (KLCLASS(start->brd_type) == KLCLASS(brd_type) && 
+		    (start->brd_nasid == nasid))
+			return start;
+
+		if (numionodes == numnodes)
+			start = KLCF_NEXT_ANY(start);
+		else
+			start = KLCF_NEXT(start);
 	}
 
 	/* Didn't find it. */
 	return (lboard_t *)NULL;
 }
 
+
+
 klinfo_t *
 find_component(lboard_t *brd, klinfo_t *kli, unsigned char struct_type)
 {
@@ -116,20 +158,6 @@
 	return (lboard_t *)NULL;
 }
 
-lboard_t *
-find_lboard_module(lboard_t *start, geoid_t geoid)
-{
-        /* Search all boards stored on this node. */
-        while (start) {
-                if (geo_cmp(start->brd_geoid, geoid))
-                        return start;
-                start = KLCF_NEXT(start);
-        }
-
-        /* Didn't find it. */
-        return (lboard_t *)NULL;
-}
-
 /*
  * Convert a NIC name to a name for use in the hardware graph.
  */
@@ -218,7 +246,7 @@
 	/*
 	 * look for boards that might contain an xbow or xbridge
 	 */
-	brd = find_lboard((lboard_t *)KL_CONFIG_INFO(nasid), KLTYPE_IOBRICK_XBOW);
+	brd = find_lboard_nasid((lboard_t *)KL_CONFIG_INFO(nasid), nasid, KLTYPE_IOBRICK_XBOW);
 	if (brd == NULL) return 0;
 		
 	if ((xbow_p = (klxbow_t *)find_component(brd, NULL, KLSTRUCT_XBOW))
@@ -285,40 +313,6 @@
 
 #define MHZ	1000000
 
-
-/* Get the canonical hardware graph name for the given pci component
- * on the given io board.
- */
-void
-device_component_canonical_name_get(lboard_t 	*brd,
-				    klinfo_t 	*component,
-				    char 	*name)
-{
-	slotid_t 	slot;
-	char 		board_name[20];
-
-	ASSERT(brd);
-
-	/* Convert the [ CLASS | TYPE ] kind of slotid
-	 * into a string
-	 */
-	slot = brd->brd_slot;
-
-	/* Get the io board name  */
-	if (!brd || (brd->brd_sversion < 2)) {
-		strcpy(name, EDGE_LBL_XWIDGET);
-	} else {
-		nic_name_convert(brd->brd_name, board_name);
-	}
-
-	/* Give out the canonical  name of the pci device*/
-	sprintf(name,
-		"/dev/hw/"EDGE_LBL_MODULE "/%x/"EDGE_LBL_SLAB"/%d/"
-		EDGE_LBL_SLOT"/%s/"EDGE_LBL_PCI"/%d",
-		geo_module(brd->brd_geoid), geo_slab(brd->brd_geoid), 
-		board_name, KLCF_BRIDGE_W_ID(component));
-}
-
 /*
  * Get the serial number of the main  component of a board
  * Returns 0 if a valid serial number is found
@@ -506,7 +500,7 @@
 format_module_id(char *buffer, moduleid_t m, int fmt)
 {
 	int rack, position;
-	char brickchar;
+	unsigned char brickchar;
 
 	rack = MODULE_GET_RACK(m);
 	ASSERT(MODULE_GET_BTYPE(m) < MAX_BRICK_TYPES);
@@ -560,112 +554,21 @@
 
 }
 
-/*
- * Parse a module id, in either brief or long form.
- * Returns < 0 on error.
- * The long form does not include a brick type, so it defaults to 0 (CBrick)
- */
-int
-parse_module_id(char *buffer)
-{
-	unsigned int	v, rack, bay, type, form;
-	moduleid_t	m;
-	char 		c;
-
-	if (strstr(buffer, EDGE_LBL_RACK "/") == buffer) {
-		form = MODULE_FORMAT_LONG;
-		buffer += strlen(EDGE_LBL_RACK "/");
-
-		/* A long module ID must be exactly 5 non-template chars. */
-		if (strlen(buffer) != strlen("/" EDGE_LBL_RPOS "/") + 5)
-			return -1;
-	}
-	else {
-		form = MODULE_FORMAT_BRIEF;
-
-		/* A brief module id must be exactly 6 characters */
-		if (strlen(buffer) != 6)
-			return -2;
-	}
-
-	/* The rack number must be exactly 3 digits */
-	if (!(isdigit(buffer[0]) && isdigit(buffer[1]) && isdigit(buffer[2])))
-		return -3;
-
-	rack = 0;
-	v = *buffer++ - '0';
-	if (v > RACK_CLASS_MASK(rack) >> RACK_CLASS_SHFT(rack))
-		return -4;
-	RACK_ADD_CLASS(rack, v);
-
-	v = *buffer++ - '0';
-	if (v > RACK_GROUP_MASK(rack) >> RACK_GROUP_SHFT(rack))
-		return -5;
-	RACK_ADD_GROUP(rack, v);
-
-	v = *buffer++ - '0';
-	/* rack numbers are 1-based */
-	if (v-1 > RACK_NUM_MASK(rack) >> RACK_NUM_SHFT(rack))
-		return -6;
-	RACK_ADD_NUM(rack, v);
-
-	if (form == MODULE_FORMAT_BRIEF) {
-		/* Next should be a module type character.  Accept ucase or lcase. */
-		c = *buffer++;
-		if (!isalpha(c))
-			return -7;
-
-		/* strchr() returns a pointer into brick_types[], or NULL */
-		type = (unsigned int)(strchr(brick_types, tolower(c)) - brick_types);
-		if (type > MODULE_BTYPE_MASK >> MODULE_BTYPE_SHFT)
-			return -8;
-	}
-	else {
-		/* Hardcode the module type, and skip over the boilerplate */
-		type = MODULE_CBRICK;
-
-		if (strstr(buffer, "/" EDGE_LBL_RPOS "/") != buffer)
-			return -9;
-
-		buffer += strlen("/" EDGE_LBL_RPOS "/");
-	}
-		
-	/* The bay number is last.  Make sure it's exactly two digits */
-
-	if (!(isdigit(buffer[0]) && isdigit(buffer[1]) && !buffer[2]))
-		return -10;
-
-	bay = 10 * (buffer[0] - '0') + (buffer[1] - '0');
-
-	if (bay > MODULE_BPOS_MASK >> MODULE_BPOS_SHFT)
-		return -11;
-
-	m = RBT_TO_MODULE(rack, bay, type);
-
-	/* 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;
-		}
-	} 
+	module = iomoduleid_get(nasid);
+	if (module < 0 ) {
+		return MODULE_CBRICK;
+	}
+	t = MODULE_GET_BTYPE(module);
+	if ((char)t == 'o') {
+		return MODULE_OPUSBRICK;
+	} else {
+		return MODULE_CBRICK;
+	}
 	return -1;
 }
--- diff/arch/ia64/sn/io/sn2/klgraph.c	2004-02-09 10:36:07.000000000 +0000
+++ source/arch/ia64/sn/io/sn2/klgraph.c	2004-02-09 10:39:51.000000000 +0000
@@ -43,7 +43,7 @@
 
 	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"));
+	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) {
@@ -71,7 +71,7 @@
 		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"));
+		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);
@@ -98,7 +98,7 @@
 
         (void) hwgraph_path_add(node_vertex, name, &my_cpu);
 
-	HWGRAPH_DEBUG((__FILE__, __FUNCTION__,__LINE__, my_cpu, NULL, "Created path for active cpu slice.\n"));
+	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);
@@ -107,7 +107,7 @@
         if (hwgraph_edge_get(node_vertex, EDGE_LBL_CPU, &cpu_dir) == GRAPH_SUCCESS) {
                 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));
+		HWGRAPH_DEBUG(__FILE__, __FUNCTION__,__LINE__, cpu_dir, my_cpu, "Created % from vhdl1 to vhdl2.\n", name);
         }
 }
 
@@ -124,8 +124,9 @@
 	/*REFERENCED*/
 	graph_error_t err;
 
-	if ((brd = find_lboard((lboard_t *)KL_CONFIG_INFO(nasid), KLTYPE_IOBRICK_XBOW)) == NULL)
-			return;
+	if (!(brd = find_lboard_nasid((lboard_t *)KL_CONFIG_INFO(nasid), 
+			nasid, KLTYPE_IOBRICK_XBOW)))
+		return;
 
 	if (KL_CONFIG_DUPLICATE_BOARD(brd))
 	    return;
@@ -165,7 +166,7 @@
 			return;
                 }
 
-		HWGRAPH_DEBUG((__FILE__, __FUNCTION__, __LINE__, xbow_v, NULL, "Created path for xtalk.\n"));
+		HWGRAPH_DEBUG(__FILE__, __FUNCTION__, __LINE__, xbow_v, NULL, "Created path for xtalk.\n");
 
 		xswitch_vertex_init(xbow_v); 
 
@@ -200,7 +201,7 @@
 	vertex_hdl_t cpu_dir;
 
 	nasid = COMPACT_TO_NASID_NODEID(cnode);
-	brd = find_lboard((lboard_t *)KL_CONFIG_INFO(nasid), KLTYPE_SNIA);
+	brd = find_lboard_any((lboard_t *)KL_CONFIG_INFO(nasid), KLTYPE_SNIA);
 	ASSERT(brd);
 
 	/* Generate a hardware graph path for this board. */
@@ -211,7 +212,7 @@
 		return;
 	}
 
-	HWGRAPH_DEBUG((__FILE__, __FUNCTION__, __LINE__, node_vertex, NULL, "Created path for SHUB node.\n"));
+	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)
@@ -249,7 +250,7 @@
 			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"));
+		HWGRAPH_DEBUG(__FILE__, __FUNCTION__, __LINE__, cpu_dir, NULL, "Created cpu directiry on SHUB node.\n");
 
 	}
 
@@ -280,7 +281,7 @@
 
 	for (cnode = 0; cnode < numnodes; cnode++) {
 		nasid = COMPACT_TO_NASID_NODEID(cnode);
-		brd = find_lboard_class((lboard_t *)KL_CONFIG_INFO(nasid),
+		brd = find_lboard_class_any((lboard_t *)KL_CONFIG_INFO(nasid),
 				KLTYPE_ROUTER);
 
 		if (!brd)
@@ -304,10 +305,10 @@
 						  "failed.  Path == %s", path_buffer);
 				return;
 			}
-			HWGRAPH_DEBUG((__FILE__, __FUNCTION__, __LINE__, node_vertex, NULL, "Created router path.\n"));
+			HWGRAPH_DEBUG(__FILE__, __FUNCTION__, __LINE__, node_vertex, NULL, "Created router path.\n");
 
 		/* Find the rest of the routers stored on this node. */
-		} while ( (brd = find_lboard_class(KLCF_NEXT(brd),
+		} while ( (brd = find_lboard_class_any(KLCF_NEXT_ANY(brd),
 			 KLTYPE_ROUTER)) );
 	}
 
@@ -399,7 +400,7 @@
 				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));
+		HWGRAPH_DEBUG(__FILE__, __FUNCTION__, __LINE__, router_hndl, dest_hndl, "Created edge %s from vhdl1 to vhdl2.\n", dest_path);
 		
 	}
 }
@@ -414,7 +415,7 @@
 
 	for (cnode = 0; cnode < numnodes; cnode++) {
 		nasid = COMPACT_TO_NASID_NODEID(cnode);
-		brd = find_lboard_class((lboard_t *)KL_CONFIG_INFO(nasid),
+		brd = find_lboard_class_any((lboard_t *)KL_CONFIG_INFO(nasid),
 				KLTYPE_ROUTER);
 
 		if (!brd)
@@ -428,7 +429,7 @@
 						 cnode, nasid);
 
 		/* Find the rest of the routers stored on this node. */
-		} while ( (brd = find_lboard_class(KLCF_NEXT(brd), KLTYPE_ROUTER)) );
+		} while ( (brd = find_lboard_class_any(KLCF_NEXT_ANY(brd), KLTYPE_ROUTER)) );
 	}
 }
 
@@ -452,8 +453,7 @@
 	for (cnode = 0; cnode < numionodes; cnode++) {
 		nasid = COMPACT_TO_NASID_NODEID(cnode);
 
-		brd = find_lboard((lboard_t *)KL_CONFIG_INFO(nasid), KLTYPE_SNIA);
-		ASSERT(brd);
+		brd = find_lboard_any((lboard_t *)KL_CONFIG_INFO(nasid), KLTYPE_SNIA);
 
 		hub = (klhub_t *)find_first_component(brd, KLSTRUCT_HUB);
 		ASSERT(hub);
@@ -492,14 +492,14 @@
 
 				rc = hwgraph_path_add(hub_hndl, EDGE_LBL_INTERCONNECT, &hub_hndl);
 
-				HWGRAPH_DEBUG((__FILE__, __FUNCTION__, __LINE__, hub_hndl, NULL, "Created link path.\n"));
+				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);
 
-				HWGRAPH_DEBUG((__FILE__, __FUNCTION__, __LINE__, hub_hndl, dest_hndl, "Created edge %s from vhdl1 to vhdl2.\n", buf));
+				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",
@@ -511,69 +511,6 @@
 	}
 }
 
-/* Store the pci/vme disabled board information as extended administrative
- * hints which can later be used by the drivers using the device/driver
- * admin interface. 
- */
-static void __init
-klhwg_device_disable_hints_add(void)
-{
-	cnodeid_t	cnode; 		/* node we are looking at */
-	nasid_t		nasid;		/* nasid of the node */
-	lboard_t	*board;		/* board we are looking at */
-	int		comp_index;	/* component index */
-	klinfo_t	*component;	/* component in the board we are
-					 * looking at 
-					 */
-	char		device_name[MAXDEVNAME];
-	
-	for(cnode = 0; cnode < numnodes; cnode++) {
-		nasid = COMPACT_TO_NASID_NODEID(cnode);
-		board = (lboard_t *)KL_CONFIG_INFO(nasid);
-		/* Check out all the board info stored  on a node */
-		while(board) {
-			/* No need to look at duplicate boards or non-io 
-			 * boards
-			 */
-			if (KL_CONFIG_DUPLICATE_BOARD(board) ||
-			    KLCLASS(board->brd_type) != KLCLASS_IO) {
-				board = KLCF_NEXT(board);
-				continue;
-			}
-			/* Check out all the components of a board */
-			for (comp_index = 0; 
-			     comp_index < KLCF_NUM_COMPS(board);
-			     comp_index++) {
-				component = KLCF_COMP(board,comp_index);
-				/* If the component is enabled move on to
-				 * the next component
-				 */
-				if (KLCONFIG_INFO_ENABLED(component))
-					continue;
-				/* NOTE : Since the prom only supports
-				 * the disabling of pci devices the following
-				 * piece of code makes sense. 
-				 * Make sure that this assumption is valid
-				 */
-				/* This component is disabled. Store this
-				 * hint in the extended device admin table
-				 */
-				/* Get the canonical name of the pci device */
-				device_component_canonical_name_get(board,
-							    component,
-							    device_name);
-#ifdef DEBUG
-				printf("%s DISABLED\n",device_name);
-#endif				
-			}
-			/* go to the next board info stored on this 
-			 * node 
-			 */
-			board = KLCF_NEXT(board);
-		}
-	}
-}
-
 void __init
 klhwg_add_all_modules(vertex_hdl_t hwgraph_root)
 {
@@ -596,7 +533,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_DEBUG(__FILE__, __FUNCTION__, __LINE__, module_vhdl, NULL, "Created module path.\n");
 
 		hwgraph_fastinfo_set(module_vhdl, (arbitrary_info_t) modules[cm]);
 
@@ -608,7 +545,7 @@
 		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_DEBUG(__FILE__, __FUNCTION__, __LINE__, vhdl, NULL, "Created L1 path.\n");
 
 		hwgraph_info_add_LBL(vhdl, INFO_LBL_ELSC,
 				     (arbitrary_info_t)1);
@@ -637,10 +574,4 @@
 	klhwg_add_all_routers(hwgraph_root);
 	klhwg_connect_routers(hwgraph_root);
 	klhwg_connect_hubs(hwgraph_root);
-
-	/* Go through the entire system's klconfig
-	 * to figure out which pci components have been disabled
-	 */
-	klhwg_device_disable_hints_add();
-
 }
--- diff/arch/ia64/sn/io/sn2/ml_iograph.c	2004-02-09 10:36:07.000000000 +0000
+++ source/arch/ia64/sn/io/sn2/ml_iograph.c	2004-02-09 10:39:51.000000000 +0000
@@ -46,8 +46,9 @@
 	int rc;
 
 	xvolinfo = kmalloc(sizeof(struct xswitch_vol_s), GFP_KERNEL);
-	if (xvolinfo <= 0 ) {
-		printk("xswitch_vertex_init: out of memory\n");
+	if (!xvolinfo) {
+		printk(KERN_WARNING "xswitch_vertex_init(): Unable to "
+			"allocate memory\n");
 		return;
 	}
        	memset(xvolinfo, 0, sizeof(struct xswitch_vol_s));
@@ -239,30 +240,29 @@
 static void
 early_probe_for_widget(vertex_hdl_t hubv, xwidget_hwid_t hwid)
 {
-	hubreg_t llp_csr_reg;
 	nasid_t nasid;
 	hubinfo_t hubinfo;
+	hubreg_t llp_csr_reg;
+	widgetreg_t widget_id;
+	int result = 0;
+
+	hwid->part_num = XWIDGET_PART_NUM_NONE;
+	hwid->rev_num = XWIDGET_REV_NUM_NONE;
+	hwid->mfg_num = XWIDGET_MFG_NUM_NONE;
 
 	hubinfo_get(hubv, &hubinfo);
 	nasid = hubinfo->h_nasid;
 
 	llp_csr_reg = REMOTE_HUB_L(nasid, IIO_LLP_CSR);
-	/* 
-	 * If link is up, read the widget's part number.
-	 * A direct connect widget must respond to widgetnum=0.
-	 */
-	if (llp_csr_reg & IIO_LLP_CSR_IS_UP) {
-		/* TBD: Put hub into "indirect" mode */
-		/*
-		 * We're able to read from a widget because our hub's 
-		 * WIDGET_ID was set up earlier.
-		 */
-		widgetreg_t widget_id = *(volatile widgetreg_t *)
-			(RAW_NODE_SWIN_BASE(nasid, 0x0) + WIDGET_ID);
+	if (!(llp_csr_reg & IIO_LLP_CSR_IS_UP))
+		return;
 
-		DBG("early_probe_for_widget: Hub Vertex 0x%p is UP widget_id = 0x%x Register 0x%p\n", hubv, widget_id,
-		(volatile widgetreg_t *)(RAW_NODE_SWIN_BASE(nasid, 0x0) + WIDGET_ID) );
+	/* Read the Cross-Talk Widget Id on the other end */
+	result = snia_badaddr_val((volatile void *)
+			(RAW_NODE_SWIN_BASE(nasid, 0x0) + WIDGET_ID), 
+			4, (void *) &widget_id);
 
+	if (result == 0) { /* Found something connected */
 		hwid->part_num = XWIDGET_PART_NUM(widget_id);
 		hwid->rev_num = XWIDGET_REV_NUM(widget_id);
 		hwid->mfg_num = XWIDGET_MFG_NUM(widget_id);
@@ -344,13 +344,12 @@
 			return;
 		}
 
-		board = find_lboard_class(
-				(lboard_t *)KL_CONFIG_INFO(nasid),
-				KLCLASS_IOBRICK);
+		board = find_lboard_class_nasid( (lboard_t *)KL_CONFIG_INFO(nasid),
+				nasid, KLCLASS_IOBRICK);
 		if (!board && NODEPDA(cnode)->xbow_peer != INVALID_NASID) {
-		    	board = find_lboard_class(
-					(lboard_t *)KL_CONFIG_INFO( NODEPDA(cnode)->xbow_peer),
-						KLCLASS_IOBRICK);
+		    	board = find_lboard_class_nasid(
+				(lboard_t *)KL_CONFIG_INFO( NODEPDA(cnode)->xbow_peer),
+					NODEPDA(cnode)->xbow_peer, KLCLASS_IOBRICK);
 		}
 
 		if (board) {
@@ -365,7 +364,7 @@
 		{
 			lboard_t *brd;
 
-			brd = find_lboard((lboard_t *)KL_CONFIG_INFO(nasid), KLTYPE_SNIA);
+			brd = find_lboard_any((lboard_t *)KL_CONFIG_INFO(nasid), KLTYPE_SNIA);
 			if ( brd != (lboard_t *)0 ) {
 				board->brd_geoid = brd->brd_geoid;
 			}
@@ -584,10 +583,9 @@
 
 	} else {
 		void	*bridge;
-		extern uint64_t pcireg_control_get(void *);
 
 		bridge = (void *)NODE_SWIN_BASE(COMPACT_TO_NASID_NODEID(cnodeid), 0);
-		npdap->basew_id = pcireg_control_get(bridge) & WIDGET_WIDGET_ID;
+		npdap->basew_id = pcireg_bridge_control_get(bridge) & WIDGET_WIDGET_ID;
 
 		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;
@@ -764,7 +762,7 @@
         /* Look for brick prefix in table */
         for (i = 0; i < num_bricks; i++) {
                if (brick_type == io_brick_tab[i].ibm_type)
-                       return(io_brick_tab[i].ibm_map_wid[widget_num]);
+                       return io_brick_tab[i].ibm_map_wid[widget_num];
         }
 
         return 0;
--- diff/arch/ia64/sn/io/sn2/module.c	2004-02-09 10:36:07.000000000 +0000
+++ source/arch/ia64/sn/io/sn2/module.c	2004-02-09 10:39:51.000000000 +0000
@@ -139,7 +139,7 @@
     /*
      * record brick serial number
      */
-    board = find_lboard((lboard_t *) KL_CONFIG_INFO(host_nasid), KLTYPE_SNIA);
+    board = find_lboard_nasid((lboard_t *) KL_CONFIG_INFO(host_nasid), host_nasid, KLTYPE_SNIA);
 
     if (! board || KL_CONFIG_DUPLICATE_BOARD(board))
     {
@@ -152,8 +152,8 @@
 	m->snum_valid = 1;
     }
 
-    board = find_lboard((lboard_t *) KL_CONFIG_INFO(nasid),
-			KLTYPE_IOBRICK_XBOW);
+    board = find_lboard_nasid((lboard_t *) KL_CONFIG_INFO(nasid),
+			nasid, KLTYPE_IOBRICK_XBOW);
 
     if (! board || KL_CONFIG_DUPLICATE_BOARD(board))
 	return 0;
@@ -185,6 +185,7 @@
     nasid_t		nasid;
     int			nserial;
     module_t	       *m;
+    extern		int numionodes;
 
     DPRINTF("*******module_init\n");
 
@@ -196,14 +197,40 @@
      */
     for (node = 0; node < numnodes; node++) {
 	nasid = COMPACT_TO_NASID_NODEID(node);
-
-	board = find_lboard((lboard_t *) KL_CONFIG_INFO(nasid), KLTYPE_SNIA);
+	board = find_lboard_nasid((lboard_t *) KL_CONFIG_INFO(nasid), nasid, KLTYPE_SNIA);
 	ASSERT(board);
 
-	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));
+	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);
 
 	m = module_add_node(board->brd_geoid, node);
 	if (! m->snum_valid && module_probe_snum(m, nasid, nasid))
 	    nserial++;
     }
+
+    /*
+     * Second scan, look for headless/memless board hosted by compute nodes.
+     */
+    for (node = numnodes; node < numionodes; node++) {
+	nasid_t		nasid;
+	char		serial_number[16];
+
+        nasid = COMPACT_TO_NASID_NODEID(node);
+	board = find_lboard_nasid((lboard_t *) KL_CONFIG_INFO(nasid), 
+				nasid, KLTYPE_SNIA);
+	ASSERT(board);
+
+	HWGRAPH_DEBUG(__FILE__, __FUNCTION__, __LINE__, NULL, NULL, "Found headless/memless lboard 0x%lx node %d nasid %d cnode %d\n", (unsigned long)board, node, (int)nasid, (int)node);
+
+        m = module_add_node(board->brd_geoid, node);
+
+	/*
+	 * Get and initialize the serial number.
+	 */
+	board_serial_number_get( board, serial_number );
+    	if( serial_number[0] != '\0' ) {
+        	encode_str_serial( serial_number, m->snum.snum_str );
+        	m->snum_valid = 1;
+		nserial++;
+	}
+    }
 }
--- diff/arch/ia64/sn/io/sn2/pcibr/pcibr_ate.c	2004-02-09 10:36:07.000000000 +0000
+++ source/arch/ia64/sn/io/sn2/pcibr/pcibr_ate.c	2004-02-09 10:39:51.000000000 +0000
@@ -17,106 +17,13 @@
 /*
  * functions
  */
-int               pcibr_init_ext_ate_ram(bridge_t *);
-int               pcibr_ate_alloc(pcibr_soft_t, int);
-void              pcibr_ate_free(pcibr_soft_t, int, int);
-bridge_ate_t      pcibr_flags_to_ate(unsigned);
-bridge_ate_p      pcibr_ate_addr(pcibr_soft_t, int);
-unsigned 	  ate_freeze(pcibr_dmamap_t pcibr_dmamap,
-#if PCIBR_FREEZE_TIME
-	   			unsigned *freeze_time_ptr,
-#endif
-	   			unsigned *cmd_regs);
-void 	  ate_write(pcibr_soft_t pcibr_soft, bridge_ate_p ate_ptr, int ate_count, bridge_ate_t ate);
-void ate_thaw(pcibr_dmamap_t pcibr_dmamap,
-	 			int ate_index,
-#if PCIBR_FREEZE_TIME
-	 			bridge_ate_t ate,
-	 			int ate_total,
-	 			unsigned freeze_time_start,
-#endif
-	 			unsigned *cmd_regs,
-	 			unsigned s);
+int		pcibr_ate_alloc(pcibr_soft_t, int, struct resource *);
+void		pcibr_ate_free(pcibr_soft_t, int, int, struct resource *);
+bridge_ate_t	pcibr_flags_to_ate(pcibr_soft_t, unsigned);
+bridge_ate_p	pcibr_ate_addr(pcibr_soft_t, int);
+void		ate_write(pcibr_soft_t, int, int, bridge_ate_t);
 
-
-/* Convert from ssram_bits in control register to number of SSRAM entries */
-#define ATE_NUM_ENTRIES(n) _ate_info[n]
-
-/* Possible choices for number of ATE entries in Bridge's SSRAM */
-static int               _ate_info[] =
-{
-    0,					/* 0 entries */
-    8 * 1024,				/* 8K entries */
-    16 * 1024,				/* 16K entries */
-    64 * 1024				/* 64K entries */
-};
-
-#define ATE_NUM_SIZES (sizeof(_ate_info) / sizeof(int))
-#define ATE_PROBE_VALUE 0x0123456789abcdefULL
-
-/*
- * Determine the size of this bridge's external mapping SSRAM, and set
- * the control register appropriately to reflect this size, and initialize
- * the external SSRAM.
- */
-int
-pcibr_init_ext_ate_ram(bridge_t *bridge)
-{
-    int                     largest_working_size = 0;
-    int                     num_entries, entry;
-    int                     i, j;
-    bridgereg_t             old_enable, new_enable;
-
-    /* Probe SSRAM to determine its size. */
-    old_enable = bridge->b_int_enable;
-    new_enable = old_enable & ~BRIDGE_IMR_PCI_MST_TIMEOUT;
-    bridge->b_int_enable = new_enable;
-
-    for (i = 1; i < ATE_NUM_SIZES; i++) {
-	/* Try writing a value */
-	bridge->b_ext_ate_ram[ATE_NUM_ENTRIES(i) - 1] = ATE_PROBE_VALUE;
-
-	/* Guard against wrap */
-	for (j = 1; j < i; j++)
-	    bridge->b_ext_ate_ram[ATE_NUM_ENTRIES(j) - 1] = 0;
-
-	/* See if value was written */
-	if (bridge->b_ext_ate_ram[ATE_NUM_ENTRIES(i) - 1] == ATE_PROBE_VALUE)
-				largest_working_size = i;
-    }
-    bridge->b_int_enable = old_enable;
-    bridge->b_wid_tflush;		/* wait until Bridge PIO complete */
-
-    /*
-     * ensure that we write and read without any interruption.
-     * The read following the write is required for the Bridge war
-     */
-
-    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 */
-
-    num_entries = ATE_NUM_ENTRIES(largest_working_size);
-
-    if (pcibr_debug_mask & PCIBR_DEBUG_ATE) {
-	if (num_entries) {
-	    PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_ATE, NULL,
-			"bridge at 0x%x: clearing %d external ATEs\n",
-			bridge, num_entries));
-	} else {
-	    PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_ATE, NULL,
-			"bridge at 0x%x: no external ATE RAM found\n",
-			bridge));
-	}
-    }
-
-    /* Initialize external mapping entries */
-    for (entry = 0; entry < num_entries; entry++)
-	bridge->b_ext_ate_ram[entry] = 0;
-
-    return (num_entries);
-}
+int pcibr_invalidate_ate;  /* by default don't invalidate ATE on free */
 
 /*
  * Allocate "count" contiguous Bridge Address Translation Entries
@@ -127,56 +34,48 @@
  * Return the start index on success, -1 on failure.
  */
 int
-pcibr_ate_alloc(pcibr_soft_t pcibr_soft, int count)
+pcibr_ate_alloc(pcibr_soft_t pcibr_soft, int count, struct resource *res)
 {
     int			    status = 0;
-    struct resource	    *new_res;
-    struct resource         **allocated_res;
+    unsigned long	    flag;
 
-    new_res = (struct resource *) kmalloc( sizeof(struct resource), GFP_ATOMIC);
-    memset(new_res, 0, sizeof(*new_res));
-    status = allocate_resource( &pcibr_soft->bs_int_ate_resource, new_res,
+    memset(res, 0, sizeof(struct resource));
+    flag = pcibr_lock(pcibr_soft);
+    status = allocate_resource( &pcibr_soft->bs_int_ate_resource, res,
 				count, pcibr_soft->bs_int_ate_resource.start, 
 				pcibr_soft->bs_int_ate_resource.end, 1,
 				NULL, NULL);
-
-    if ( status && (pcibr_soft->bs_ext_ate_resource.end != 0) ) {
-	status = allocate_resource( &pcibr_soft->bs_ext_ate_resource, new_res,
-				count, pcibr_soft->bs_ext_ate_resource.start,
-				pcibr_soft->bs_ext_ate_resource.end, 1,
-				NULL, NULL);
-	if (status) {
-		new_res->start = -1;
-	}
-    }
-
     if (status) {
 	/* Failed to allocate */
-	kfree(new_res);
+	pcibr_unlock(pcibr_soft, flag);
 	return -1;
     }
 
     /* Save the resource for freeing */
-    allocated_res = (struct resource **)(((unsigned long)pcibr_soft->bs_allocated_ate_res) + new_res->start * sizeof( unsigned long));
-    *allocated_res = new_res;
+    pcibr_unlock(pcibr_soft, flag);
 
-    return new_res->start;
+    return res->start;
 }
 
 void
-pcibr_ate_free(pcibr_soft_t pcibr_soft, int index, int count)
-/* Who says there's no such thing as a free meal? :-) */
+pcibr_ate_free(pcibr_soft_t pcibr_soft, int index, int count, struct resource *res)
 {
 
-    struct resource **allocated_res;
+    bridge_ate_t ate;
     int status = 0;
+    unsigned long flags;
 
-    allocated_res = (struct resource **)(((unsigned long)pcibr_soft->bs_allocated_ate_res) + index * sizeof(unsigned long));
+    if (pcibr_invalidate_ate) {
+	/* For debugging purposes, clear the valid bit in the ATE */
+	ate = *pcibr_ate_addr(pcibr_soft, index);
+	ate_write(pcibr_soft, index, count, (ate & ~ATE_V));
+    }
 
-    status = release_resource(*allocated_res);
+    flags = pcibr_lock(pcibr_soft);
+    status = release_resource(res);
+    pcibr_unlock(pcibr_soft, flags);
     if (status)
 	BUG(); /* Ouch .. */
-    kfree(*allocated_res);
 
 }
 
@@ -185,7 +84,7 @@
  * into Bridge-specific Address Translation Entry attribute bits.
  */
 bridge_ate_t
-pcibr_flags_to_ate(unsigned flags)
+pcibr_flags_to_ate(pcibr_soft_t pcibr_soft, unsigned flags)
 {
     bridge_ate_t            attributes;
 
@@ -232,6 +131,11 @@
     if (flags & PCIBR_NOPRECISE)
 	attributes &= ~ATE_PREC;
 
+    /* In PCI-X mode, Prefetch & Precise not supported */
+    if (IS_PCIX(pcibr_soft)) {
+	attributes &= ~(ATE_PREC | ATE_PREF);
+    }
+
     return (attributes);
 }
 
@@ -243,189 +147,33 @@
 pcibr_ate_addr(pcibr_soft_t pcibr_soft,
 	       int ate_index)
 {
-    bridge_t *bridge = pcibr_soft->bs_base;
-
-    return (ate_index < pcibr_soft->bs_int_ate_size)
-	? &(bridge->b_int_ate_ram[ate_index].wr)
-	: &(bridge->b_ext_ate_ram[ate_index]);
-}
-
-/* We are starting to get more complexity
- * surrounding writing ATEs, so pull
- * the writing code into this new function.
- */
-
-#if PCIBR_FREEZE_TIME
-#define	ATE_FREEZE()	s = ate_freeze(pcibr_dmamap, &freeze_time, cmd_regs)
-#else
-#define	ATE_FREEZE()	s = ate_freeze(pcibr_dmamap, cmd_regs)
-#endif
-
-unsigned
-ate_freeze(pcibr_dmamap_t pcibr_dmamap,
-#if PCIBR_FREEZE_TIME
-	   unsigned *freeze_time_ptr,
-#endif
-	   unsigned *cmd_regs)
-{
-    pcibr_soft_t            pcibr_soft = pcibr_dmamap->bd_soft;
-#ifdef LATER
-    int                     dma_slot = pcibr_dmamap->bd_slot;
-#endif
-    int                     ext_ates = pcibr_dmamap->bd_flags & PCIBR_DMAMAP_SSRAM;
-    int                     slot;
-
-    unsigned long           s;
-    unsigned                cmd_reg;
-    volatile unsigned      *cmd_lwa;
-    unsigned                cmd_lwd;
-
-    if (!ext_ates)
-	return 0;
-
-    /* Bridge Hardware Bug WAR #484930:
-     * Bridge can't handle updating External ATEs
-     * while DMA is occurring that uses External ATEs,
-     * even if the particular ATEs involved are disjoint.
-     */
-
-    /* need to prevent anyone else from
-     * unfreezing the grant while we
-     * are working; also need to prevent
-     * this thread from being interrupted
-     * to keep PCI grant freeze time
-     * at an absolute minimum.
-     */
-    s = pcibr_lock(pcibr_soft);
-
-#ifdef LATER
-    /* just in case pcibr_dmamap_done was not called */
-    if (pcibr_dmamap->bd_flags & PCIBR_DMAMAP_BUSY) {
-	pcibr_dmamap->bd_flags &= ~PCIBR_DMAMAP_BUSY;
-	if (pcibr_dmamap->bd_flags & PCIBR_DMAMAP_SSRAM)
-	    atomic_dec(&(pcibr_soft->bs_slot[dma_slot]. bss_ext_ates_active));
-	xtalk_dmamap_done(pcibr_dmamap->bd_xtalk);
-    }
-#endif	/* LATER */
-#if PCIBR_FREEZE_TIME
-    *freeze_time_ptr = get_timestamp();
-#endif
-
-    cmd_lwa = 0;
-    for (slot = pcibr_soft->bs_min_slot; 
-		slot < PCIBR_NUM_SLOTS(pcibr_soft); ++slot)
-	if (atomic_read(&pcibr_soft->bs_slot[slot].bss_ext_ates_active)) {
-	    cmd_reg = pcibr_soft->
-		bs_slot[slot].
-		bss_cmd_shadow;
-	    if (cmd_reg & PCI_CMD_BUS_MASTER) {
-		cmd_lwa = pcibr_soft->
-		    bs_slot[slot].
-		    bss_cmd_pointer;
-		cmd_lwd = cmd_reg ^ PCI_CMD_BUS_MASTER;
-		cmd_lwa[0] = cmd_lwd;
-	    }
-	    cmd_regs[slot] = cmd_reg;
-	} else
-	    cmd_regs[slot] = 0;
-
-    if (cmd_lwa) {
-	    bridge_t	*bridge = pcibr_soft->bs_base;
-
-	    /* Read the last master bit that has been cleared. This PIO read
-	     * on the PCI bus is to ensure the completion of any DMAs that
-	     * are due to bus requests issued by PCI devices before the
-	     * clearing of master bits.
-	     */
-	    cmd_lwa[0];
-
-	    /* Flush all the write buffers in the bridge */
-	    for (slot = pcibr_soft->bs_min_slot; 
-				slot < PCIBR_NUM_SLOTS(pcibr_soft); ++slot) {
-		    if (atomic_read(&pcibr_soft->bs_slot[slot].bss_ext_ates_active)) {
-			    /* Flush the write buffer associated with this
-			     * PCI device which might be using dma map RAM.
-			     */
-			bridge->b_wr_req_buf[slot].reg;
-		    }
-	    }
+    if (ate_index < pcibr_soft->bs_int_ate_size) {
+	return (pcireg_int_ate_addr(pcibr_soft, ate_index));
+    } else {
+	printk("pcibr_ate_addr(): INVALID ate_index 0x%x", ate_index);
+	return (bridge_ate_p)0;
     }
-    return s;
-}
-
-void
-ate_write(pcibr_soft_t pcibr_soft,
-	  bridge_ate_p ate_ptr,
-	  int ate_count,
-	  bridge_ate_t ate)
-{
-  	while (ate_count-- > 0) {
-		*ate_ptr++ = ate;
-		ate += IOPGSIZE;
-	}
 }
 
-#if PCIBR_FREEZE_TIME
-#define	ATE_THAW()	ate_thaw(pcibr_dmamap, ate_index, ate, ate_total, freeze_time, cmd_regs, s)
-#else
-#define	ATE_THAW()	ate_thaw(pcibr_dmamap, ate_index, cmd_regs, s)
-#endif
-
+/*
+ * Write the ATE.
+ */
 void
-ate_thaw(pcibr_dmamap_t pcibr_dmamap,
-	 int ate_index,
-#if PCIBR_FREEZE_TIME
-	 bridge_ate_t ate,
-	 int ate_total,
-	 unsigned freeze_time_start,
-#endif
-	 unsigned *cmd_regs,
-	 unsigned s)
+ate_write(pcibr_soft_t pcibr_soft, int ate_index, int count, bridge_ate_t ate)
 {
-    pcibr_soft_t            pcibr_soft = pcibr_dmamap->bd_soft;
-    int                     dma_slot = pcibr_dmamap->bd_slot;
-    int                     slot;
-    bridge_t               *bridge = pcibr_soft->bs_base;
-    int                     ext_ates = pcibr_dmamap->bd_flags & PCIBR_DMAMAP_SSRAM;
-
-    unsigned                cmd_reg;
-
-#if PCIBR_FREEZE_TIME
-    unsigned                freeze_time;
-    static unsigned         max_freeze_time = 0;
-    static unsigned         max_ate_total;
-#endif
-
-    if (!ext_ates)
-	return;
-
-    /* restore cmd regs */
-    for (slot = pcibr_soft->bs_min_slot; 
-		slot < PCIBR_NUM_SLOTS(pcibr_soft); ++slot) {
-	if ((cmd_reg = cmd_regs[slot]) & PCI_CMD_BUS_MASTER) {
-		pcibr_slot_config_set(bridge, slot, PCI_CFG_COMMAND/4, cmd_reg);
+    while (count-- > 0) {
+	if (ate_index < pcibr_soft->bs_int_ate_size) {
+	    pcireg_int_ate_set(pcibr_soft, ate_index, ate);
+	    PCIBR_DEBUG((PCIBR_DEBUG_DMAMAP, pcibr_soft->bs_vhdl,
+			"ate_write(): ate_index=0x%x, ate=0x%lx\n",
+			ate_index, (uint64_t)ate));
+	} else {
+	    printk("ate_write(): INVALID ate_index 0x%x", ate_index);
+	    return;
 	}
+	ate_index++;
+	ate += IOPGSIZE;
     }
-    pcibr_dmamap->bd_flags |= PCIBR_DMAMAP_BUSY;
-    atomic_inc(&(pcibr_soft->bs_slot[dma_slot]. bss_ext_ates_active));
-
-#if PCIBR_FREEZE_TIME
-    freeze_time = get_timestamp() - freeze_time_start;
 
-    if ((max_freeze_time < freeze_time) ||
-	(max_ate_total < ate_total)) {
-	if (max_freeze_time < freeze_time)
-	    max_freeze_time = freeze_time;
-	if (max_ate_total < ate_total)
-	    max_ate_total = ate_total;
-	pcibr_unlock(pcibr_soft, s);
-	printk( "%s: pci freeze time %d usec for %d ATEs\n"
-		"\tfirst ate: %R\n",
-		pcibr_soft->bs_name,
-		freeze_time * 1000 / 1250,
-		ate_total,
-		ate, ate_bits);
-    } else
-#endif
-	pcibr_unlock(pcibr_soft, s);
+    pcireg_tflush_get(pcibr_soft);	/* wait until Bridge PIO complete */
 }
--- diff/arch/ia64/sn/io/sn2/pcibr/pcibr_config.c	2004-02-09 10:36:07.000000000 +0000
+++ source/arch/ia64/sn/io/sn2/pcibr/pcibr_config.c	2004-02-09 10:39:51.000000000 +0000
@@ -34,22 +34,21 @@
  * the 32bit word that contains the "offset" byte.
  */
 cfg_p
-pcibr_func_config_addr(bridge_t *bridge, pciio_bus_t bus, pciio_slot_t slot, 
+pcibr_func_config_addr(pcibr_soft_t soft, pciio_bus_t bus, pciio_slot_t slot, 
 					pciio_function_t func, int offset)
 {
 	/*
 	 * Type 1 config space
 	 */
 	if (bus > 0) {
-		bridge->b_pci_cfg = ((bus << 16) | (slot << 11));
-		return &bridge->b_type1_cfg.f[func].l[(offset)];
+		pcireg_type1_cntr_set(soft, ((bus << 16) | (slot << 11)));
+		return (pcireg_type1_cfg_addr(soft, func, offset));
 	}
 
 	/*
 	 * Type 0 config space
 	 */
-	slot++;
-	return &bridge->b_type0_cfg_dev[slot].f[func].l[offset];
+	return (pcireg_type0_cfg_addr(soft, slot, func, offset));
 }
 
 /*
@@ -58,59 +57,21 @@
  * 32bit word that contains the "offset" byte.
  */
 cfg_p
-pcibr_slot_config_addr(bridge_t *bridge, pciio_slot_t slot, int offset)
+pcibr_slot_config_addr(pcibr_soft_t soft, pciio_slot_t slot, int offset)
 {
-	return pcibr_func_config_addr(bridge, 0, slot, 0, offset);
-}
-
-/*
- * Return config space data for given slot / offset
- */
-unsigned
-pcibr_slot_config_get(bridge_t *bridge, pciio_slot_t slot, int offset)
-{
-	cfg_p  cfg_base;
-	
-	cfg_base = pcibr_slot_config_addr(bridge, slot, 0);
-	return (do_pcibr_config_get(cfg_base, offset, sizeof(unsigned)));
-}
-
-/*
- * Return config space data for given slot / func / offset
- */
-unsigned
-pcibr_func_config_get(bridge_t *bridge, pciio_slot_t slot, 
-					pciio_function_t func, int offset)
-{
-	cfg_p  cfg_base;
-
-	cfg_base = pcibr_func_config_addr(bridge, 0, slot, func, 0);
-	return (do_pcibr_config_get(cfg_base, offset, sizeof(unsigned)));
-}
-
-/*
- * Set config space data for given slot / offset
- */
-void
-pcibr_slot_config_set(bridge_t *bridge, pciio_slot_t slot, 
-					int offset, unsigned val)
-{
-	cfg_p  cfg_base;
-
-	cfg_base = pcibr_slot_config_addr(bridge, slot, 0);
-	do_pcibr_config_set(cfg_base, offset, sizeof(unsigned), val);
+	return pcibr_func_config_addr(soft, 0, slot, 0, offset);
 }
 
 /*
  * Set config space data for given slot / func / offset
  */
 void
-pcibr_func_config_set(bridge_t *bridge, pciio_slot_t slot, 
+pcibr_func_config_set(pcibr_soft_t soft, pciio_slot_t slot, 
 			pciio_function_t func, int offset, unsigned val)
 {
 	cfg_p  cfg_base;
 
-	cfg_base = pcibr_func_config_addr(bridge, 0, slot, func, 0);
+	cfg_base = pcibr_func_config_addr(soft, 0, slot, func, 0);
 	do_pcibr_config_set(cfg_base, offset, sizeof(unsigned), val);
 }
 
@@ -124,8 +85,6 @@
     pciio_bus_t		    pciio_bus;
     pciio_slot_t            pciio_slot;
     pciio_function_t        pciio_func;
-    pcibr_soft_t            pcibr_soft;
-    bridge_t               *bridge;
     cfg_p                   cfgbase = (cfg_p)0;
     pciio_info_t	    pciio_info;
 
@@ -164,11 +123,7 @@
 	pciio_func = PCI_TYPE1_FUNC(reg);
     }
 
-    pcibr_soft = (pcibr_soft_t) pcibr_info->f_mfast;
-
-    bridge = pcibr_soft->bs_base;
-
-    cfgbase = pcibr_func_config_addr(bridge,
+    cfgbase = pcibr_func_config_addr((pcibr_soft_t) pcibr_info->f_mfast,
 			pciio_bus, pciio_slot, pciio_func, 0);
 
     return cfgbase;
--- diff/arch/ia64/sn/io/sn2/pcibr/pcibr_dvr.c	2004-02-09 10:36:07.000000000 +0000
+++ source/arch/ia64/sn/io/sn2/pcibr/pcibr_dvr.c	2004-02-09 10:39:51.000000000 +0000
@@ -30,68 +30,17 @@
  *    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 */
+uint32_t   	  pcibr_debug_mask;			/* 0x00000000 to disable */
 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#      */
-        0, 0, 0, 0, 0, 0, 0, 0,                 /* 0x0 - 0x7    */
-        2,                                      /* 0x8          */
-        1,                                      /* 0x9          */
-        0, 0,                                   /* 0xa - 0xb    */
-        5,                                      /* 0xc          */
-        6,                                      /* 0xd          */
-        4,                                      /* 0xe          */
-        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;
+pcibr_list_p            pcibr_list;
 #endif
 
-extern int              hwgraph_vertex_name_get(vertex_hdl_t vhdl, char *buf, uint buflen);
-extern long             atoi(register char *p);
-extern cnodeid_t        nodevertex_to_cnodeid(vertex_hdl_t vhdl);
-extern char             *dev_to_name(vertex_hdl_t dev, char *buf, uint buflen);
-extern struct map       *atemapalloc(uint64_t);
-extern void             atefree(struct map *, size_t, uint64_t);
-extern void             atemapfree(struct map *);
-extern pciio_dmamap_t   get_free_pciio_dmamap(vertex_hdl_t);
-extern void		free_pciio_dmamap(pcibr_dmamap_t);
-extern void		xwidget_error_register(vertex_hdl_t, error_handler_f *, error_handler_arg_t);
-
-#define	ATE_WRITE()    ate_write(pcibr_soft, ate_ptr, ate_count, ate)
-#if PCIBR_FREEZE_TIME
-#define	ATE_FREEZE()	s = ate_freeze(pcibr_dmamap, &freeze_time, cmd_regs)
-#else
-#define	ATE_FREEZE()	s = ate_freeze(pcibr_dmamap, cmd_regs)
-#endif /* PCIBR_FREEZE_TIME */
-
-#if PCIBR_FREEZE_TIME
-#define	ATE_THAW()	ate_thaw(pcibr_dmamap, ate_index, ate, ate_total, freeze_time, cmd_regs, s)
-#else
-#define	ATE_THAW()	ate_thaw(pcibr_dmamap, ate_index, cmd_regs, s)
-#endif
+extern char *pci_space[];
 
 /* =====================================================================
  *    Function Table of Contents
@@ -102,46 +51,35 @@
  *      perhaps bust this file into smaller chunks.
  */
 
-extern int		 do_pcibr_rrb_free_all(pcibr_soft_t, bridge_t *, pciio_slot_t);
+extern void		 do_pcibr_rrb_free_all(pcibr_soft_t, pciio_slot_t);
 extern void              do_pcibr_rrb_autoalloc(pcibr_soft_t, int, int, int);
+extern void		 pcibr_rrb_alloc_more(pcibr_soft_t pcibr_soft, int slot,
+							int vchan, int more_rrbs);
 
 extern int  		 pcibr_wrb_flush(vertex_hdl_t);
 extern int               pcibr_rrb_alloc(vertex_hdl_t, int *, int *);
-extern void              pcibr_rrb_flush(vertex_hdl_t);
+void            	 pcibr_rrb_alloc_more(pcibr_soft_t, int, int, int);
 
-static int                pcibr_try_set_device(pcibr_soft_t, pciio_slot_t, unsigned, bridgereg_t);
-void                     pcibr_release_device(pcibr_soft_t, pciio_slot_t, bridgereg_t);
+extern void              pcibr_rrb_flush(vertex_hdl_t);
 
-extern void              pcibr_setwidint(xtalk_intr_t);
-extern void              pcibr_clearwidint(bridge_t *);
+static int                pcibr_try_set_device(pcibr_soft_t, pciio_slot_t, unsigned, uint64_t);
+void                     pcibr_release_device(pcibr_soft_t, pciio_slot_t, uint64_t);
 
 extern iopaddr_t         pcibr_bus_addr_alloc(pcibr_soft_t, pciio_win_info_t,
                                               pciio_space_t, int, int, int);
+extern int		 hwgraph_vertex_name_get(vertex_hdl_t vhdl, char *buf, 
+						 uint buflen);
 
-int                      pcibr_attach(vertex_hdl_t);
-int			 pcibr_attach2(vertex_hdl_t, bridge_t *, vertex_hdl_t,
-				       int, pcibr_soft_t *);
 int			 pcibr_detach(vertex_hdl_t);
+void			 pcibr_directmap_init(pcibr_soft_t);
 int			 pcibr_pcix_rbars_calc(pcibr_soft_t);
-extern int               pcibr_init_ext_ate_ram(bridge_t *);
-extern int               pcibr_ate_alloc(pcibr_soft_t, int);
-extern void              pcibr_ate_free(pcibr_soft_t, int, int);
+extern int               pcibr_ate_alloc(pcibr_soft_t, int, struct resource *);
+extern void              pcibr_ate_free(pcibr_soft_t, int, int, struct resource *);
+extern pciio_dmamap_t	 get_free_pciio_dmamap(vertex_hdl_t);
+extern void		 free_pciio_dmamap(pcibr_dmamap_t);
 extern int 		 pcibr_widget_to_bus(vertex_hdl_t pcibr_vhdl);
 
-extern unsigned ate_freeze(pcibr_dmamap_t pcibr_dmamap,
-#if PCIBR_FREEZE_TIME
-	   		 unsigned *freeze_time_ptr,
-#endif
-	   		 unsigned *cmd_regs);
-extern void ate_write(pcibr_soft_t pcibr_soft, bridge_ate_p ate_ptr, int ate_count, bridge_ate_t ate);
-extern void ate_thaw(pcibr_dmamap_t pcibr_dmamap, int ate_index,
-#if PCIBR_FREEZE_TIME
-	 		bridge_ate_t ate,
-	 		int ate_total,
-	 		unsigned freeze_time_start,
-#endif
-	 		unsigned *cmd_regs,
-	 		unsigned s);
+extern void 		ate_write(pcibr_soft_t, int, int, bridge_ate_t);
 
 pcibr_info_t      pcibr_info_get(vertex_hdl_t);
 
@@ -156,7 +94,7 @@
 void                    pcibr_piospace_free(vertex_hdl_t, pciio_space_t, iopaddr_t, size_t);
 
 static iopaddr_t         pcibr_flags_to_d64(unsigned, pcibr_soft_t);
-extern bridge_ate_t     pcibr_flags_to_ate(unsigned);
+extern bridge_ate_t     pcibr_flags_to_ate(pcibr_soft_t, unsigned);
 
 pcibr_dmamap_t          pcibr_dmamap_alloc(vertex_hdl_t, device_desc_t, size_t, unsigned);
 void                    pcibr_dmamap_free(pcibr_dmamap_t);
@@ -168,77 +106,20 @@
 iopaddr_t               pcibr_dmatrans_addr(vertex_hdl_t, device_desc_t, paddr_t, size_t, unsigned);
 void                    pcibr_dmamap_drain(pcibr_dmamap_t);
 void                    pcibr_dmaaddr_drain(vertex_hdl_t, paddr_t, size_t);
-void                    pcibr_dmalist_drain(vertex_hdl_t, alenlist_t);
 iopaddr_t               pcibr_dmamap_pciaddr_get(pcibr_dmamap_t);
 
-extern unsigned		pcibr_intr_bits(pciio_info_t info, 
-					pciio_intr_line_t lines, int nslots);
-extern pcibr_intr_t     pcibr_intr_alloc(vertex_hdl_t, device_desc_t, pciio_intr_line_t, vertex_hdl_t);
-extern void             pcibr_intr_free(pcibr_intr_t);
-extern void             pcibr_setpciint(xtalk_intr_t);
-extern int              pcibr_intr_connect(pcibr_intr_t, intr_func_t, intr_arg_t);
-extern void             pcibr_intr_disconnect(pcibr_intr_t);
-
-extern vertex_hdl_t     pcibr_intr_cpu_get(pcibr_intr_t);
-extern void             pcibr_intr_func(intr_arg_t);
-
-extern void             print_bridge_errcmd(uint32_t, char *);
-
-extern void             pcibr_error_dump(pcibr_soft_t);
-extern uint32_t       pcibr_errintr_group(uint32_t);
-extern void	        pcibr_pioerr_check(pcibr_soft_t);
-extern void             pcibr_error_intr_handler(int, void *, struct pt_regs *);
-
-extern int              pcibr_addr_toslot(pcibr_soft_t, iopaddr_t, pciio_space_t *, iopaddr_t *, pciio_function_t *);
-extern void             pcibr_error_cleanup(pcibr_soft_t, int);
-extern void                    pcibr_device_disable(pcibr_soft_t, int);
-extern int              pcibr_pioerror(pcibr_soft_t, int, ioerror_mode_t, ioerror_t *);
-extern int              pcibr_dmard_error(pcibr_soft_t, int, ioerror_mode_t, ioerror_t *);
-extern int              pcibr_dmawr_error(pcibr_soft_t, int, ioerror_mode_t, ioerror_t *);
-extern int              pcibr_error_handler(error_handler_arg_t, int, ioerror_mode_t, ioerror_t *);
-extern int              pcibr_error_handler_wrapper(error_handler_arg_t, int, ioerror_mode_t, ioerror_t *);
 void                    pcibr_provider_startup(vertex_hdl_t);
 void                    pcibr_provider_shutdown(vertex_hdl_t);
 
 int                     pcibr_reset(vertex_hdl_t);
 pciio_endian_t          pcibr_endian_set(vertex_hdl_t, pciio_endian_t, pciio_endian_t);
-int                     pcibr_priority_bits_set(pcibr_soft_t, pciio_slot_t, pciio_priority_t);
-pciio_priority_t        pcibr_priority_set(vertex_hdl_t, pciio_priority_t);
 int                     pcibr_device_flags_set(vertex_hdl_t, pcibr_device_flags_t);
 
-extern cfg_p            pcibr_config_addr(vertex_hdl_t, unsigned);
-extern uint64_t         pcibr_config_get(vertex_hdl_t, unsigned, unsigned);
-extern void             pcibr_config_set(vertex_hdl_t, unsigned, unsigned, uint64_t);
-
-extern pcibr_hints_t    pcibr_hints_get(vertex_hdl_t, int);
-extern void             pcibr_hints_fix_rrbs(vertex_hdl_t);
-extern void             pcibr_hints_dualslot(vertex_hdl_t, pciio_slot_t, pciio_slot_t);
-extern void	 	pcibr_hints_intr_bits(vertex_hdl_t, pcibr_intr_bits_f *);
-extern void             pcibr_set_rrb_callback(vertex_hdl_t, rrb_alloc_funct_t);
-extern void             pcibr_hints_handsoff(vertex_hdl_t);
-extern void             pcibr_hints_subdevs(vertex_hdl_t, pciio_slot_t, uint64_t);
-
-extern int		pcibr_slot_info_init(vertex_hdl_t,pciio_slot_t);
 extern int		pcibr_slot_info_free(vertex_hdl_t,pciio_slot_t);
-extern int	        pcibr_slot_info_return(pcibr_soft_t, pciio_slot_t,
-                                               pcibr_slot_info_resp_t);
-extern void       	pcibr_slot_func_info_return(pcibr_info_h, int,
-                                                    pcibr_slot_func_info_resp_t);
-extern int		pcibr_slot_addr_space_init(vertex_hdl_t,pciio_slot_t);
-extern int		pcibr_slot_pcix_rbar_init(pcibr_soft_t, pciio_slot_t);
-extern int		pcibr_slot_device_init(vertex_hdl_t, pciio_slot_t);
-extern int		pcibr_slot_guest_info_init(vertex_hdl_t,pciio_slot_t);
-extern int		pcibr_slot_call_device_attach(vertex_hdl_t,
-						      pciio_slot_t, int);
-extern int		pcibr_slot_call_device_detach(vertex_hdl_t,
-						      pciio_slot_t, int);
-extern int              pcibr_slot_attach(vertex_hdl_t, pciio_slot_t, int, 
-                                                      char *, int *);
 extern int              pcibr_slot_detach(vertex_hdl_t, pciio_slot_t, int,
                                                       char *, int *);
 
-extern int		pcibr_slot_initial_rrb_alloc(vertex_hdl_t, pciio_slot_t);
-extern int		pcibr_initial_rrb(vertex_hdl_t, pciio_slot_t, pciio_slot_t);
+pciio_businfo_t		pcibr_businfo_get(vertex_hdl_t);
 
 /* =====================================================================
  *    Device(x) register management
@@ -256,33 +137,23 @@
 pcibr_try_set_device(pcibr_soft_t pcibr_soft,
 		     pciio_slot_t slot,
 		     unsigned flags,
-		     bridgereg_t mask)
+		     uint64_t mask)
 {
-    bridge_t               *bridge;
     pcibr_soft_slot_t       slotp;
-    bridgereg_t             old;
-    bridgereg_t             new;
-    bridgereg_t             chg;
-    bridgereg_t             bad;
-    bridgereg_t             badpmu;
-    bridgereg_t             badd32;
-    bridgereg_t             badd64;
-    bridgereg_t             fix;
-    unsigned long           s;
-    bridgereg_t             xmask;
-
-    xmask = mask;
-    if (mask == BRIDGE_DEV_PMU_BITS)
-	xmask = XBRIDGE_DEV_PMU_BITS;
-    if (mask == BRIDGE_DEV_D64_BITS)
-	xmask = XBRIDGE_DEV_D64_BITS;
+    uint64_t		    old;
+    uint64_t		    new;
+    uint64_t		    chg;
+    uint64_t		    bad;
+    uint64_t		    badpmu;
+    uint64_t		    badd32;
+    uint64_t		    badd64;
+    uint64_t		    fix;
+    unsigned long	    s;
 
     slotp = &pcibr_soft->bs_slot[slot];
 
     s = pcibr_lock(pcibr_soft);
 
-    bridge = pcibr_soft->bs_base;
-
     old = slotp->bss_device;
 
     /* figure out what the desired
@@ -390,21 +261,21 @@
      * PIC, can cause problems for 32-bit devices.
      */
     if (mask == BRIDGE_DEV_D64_BITS &&
-                                PCIBR_WAR_ENABLED(PV855271, pcibr_soft)) {
-        if (flags & PCIBR_VCHAN1) {
-                new |= BRIDGE_DEV_VIRTUAL_EN;
-                xmask |= BRIDGE_DEV_VIRTUAL_EN;
-        }
+				PCIBR_WAR_ENABLED(PV855271, pcibr_soft)) {
+	if (flags & PCIBR_VCHAN1) {
+		new |= BRIDGE_DEV_VIRTUAL_EN;
+		mask |= BRIDGE_DEV_VIRTUAL_EN;
+	}
     }
 
     /* PIC BRINGUP WAR (PV# 878674):   Don't allow 64bit PIO accesses */
-    if (IS_PIC_SOFT(pcibr_soft) && (flags & PCIBR_64BIT) &&
+    if ((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 */
+    chg &= mask;				/* of the interesting bits */
 
     if (chg) {
 
@@ -476,9 +347,10 @@
 	pcibr_unlock(pcibr_soft, s);
 	return 0;
     }
-    bridge->b_device[slot].reg = new;
+    
+    pcireg_device_set(pcibr_soft, slot, new);
     slotp->bss_device = new;
-    bridge->b_wid_tflush;		/* wait until Bridge PIO complete */
+    pcireg_tflush_get(pcibr_soft);	/* wait until Bridge PIO complete */
     pcibr_unlock(pcibr_soft, s);
 
     PCIBR_DEBUG((PCIBR_DEBUG_DEVREG, pcibr_soft->bs_vhdl,
@@ -489,7 +361,7 @@
 void
 pcibr_release_device(pcibr_soft_t pcibr_soft,
 		     pciio_slot_t slot,
-		     bridgereg_t mask)
+		     uint64_t mask)
 {
     pcibr_soft_slot_t       slotp;
     unsigned long           s;
@@ -508,22 +380,6 @@
     pcibr_unlock(pcibr_soft, s);
 }
 
-/*
- * flush write gather buffer for slot
- */
-static void
-pcibr_device_write_gather_flush(pcibr_soft_t pcibr_soft,
-              pciio_slot_t slot)
-{
-    bridge_t               *bridge;
-    unsigned long          s;
-    volatile uint32_t     wrf; 
-    s = pcibr_lock(pcibr_soft);
-    bridge = pcibr_soft->bs_base;
-    
-    wrf = bridge->b_wr_req_buf[slot].reg;
-    pcibr_unlock(pcibr_soft, s);
-}   
 
 /* =====================================================================
  *    Bridge (pcibr) "Device Driver" entry points
@@ -535,7 +391,7 @@
 {
 	vertex_hdl_t		pcibr_vhdl = file->f_dentry->d_fsdata;
 	pcibr_soft_t            pcibr_soft;
-	bridge_t               *bridge;
+	void               *bridge;
 	unsigned long		phys_addr;
 	int			error = 0;
 
@@ -547,7 +403,7 @@
         error = io_remap_page_range(vma, phys_addr, vma->vm_start,
 				    vma->vm_end - vma->vm_start,
 				    vma->vm_page_prot);
-	return(error);
+	return error;
 }
 
 /*
@@ -683,7 +539,6 @@
     vertex_hdl_t	 pcibr_vhdl;
     pciio_slot_t	 slot;
     pcibr_soft_t	 pcibr_soft;
-    bridge_t		*bridge;
     int                  count_vchan0, count_vchan1;
     unsigned long	 s;
     int			 error_call;
@@ -695,7 +550,6 @@
     slot = PCIBR_INFO_SLOT_GET_INT(pciio_info);
 
     pcibr_soft = pcibr_soft_get(pcibr_vhdl);
-    bridge = pcibr_soft->bs_base;
 
     /* Clear all the hardware xtalk resources for this device */
     xtalk_widgetdev_shutdown(pcibr_soft->bs_conn, slot);
@@ -718,7 +572,7 @@
                                        pcibr_soft->bs_rrb_valid[slot][VCHAN3];
 
         /* Free the rrbs allocated to this slot, both the normal & virtual */
-	do_pcibr_rrb_free_all(pcibr_soft, bridge, slot);
+	do_pcibr_rrb_free_all(pcibr_soft, slot);
 
         count_vchan0 = pcibr_soft->bs_rrb_valid_dflt[slot][VCHAN0];
         count_vchan1 = pcibr_soft->bs_rrb_valid_dflt[slot][VCHAN1];
@@ -741,7 +595,7 @@
     if (error_call)
         error = error_call;
 
-    return(error);
+    return error;
     
 }
 
@@ -823,951 +677,6 @@
     }
 }
 
-/* 
- * build a convenience link path in the
- * form of ".../<iobrick>/bus/<busnum>"
- * 
- * returns 1 on success, 0 otherwise
- *
- * depends on hwgraph separator == '/'
- */
-int
-pcibr_bus_cnvlink(vertex_hdl_t f_c)
-{
-        char dst[MAXDEVNAME];
-	char *dp = dst;
-        char *cp, *xp;
-        int widgetnum;
-        char pcibus[8];
-	vertex_hdl_t nvtx, svtx;
-	int rv;
-
-	PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_ATTACH, f_c, "pcibr_bus_cnvlink\n"));
-
-	if (GRAPH_SUCCESS != hwgraph_vertex_name_get(f_c, dst, MAXDEVNAME))
-		return 0;
-
-	/* dst example == /hw/module/001c02/Pbrick/xtalk/8/pci/direct */
-
-	/* find the widget number */
-	xp = strstr(dst, "/"EDGE_LBL_XTALK"/");
-	if (xp == NULL)
-		return 0;
-	widgetnum = simple_strtoul(xp+7, NULL, 0);
-	if (widgetnum < XBOW_PORT_8 || widgetnum > XBOW_PORT_F)
-		return 0;
-
-	/* remove "/pci/direct" from path */
-	cp = strstr(dst, "/" EDGE_LBL_PCI "/" EDGE_LBL_DIRECT);
-	if (cp == NULL)
-		return 0;
-	*cp = (char)NULL;
-
-	/* get the vertex for the widget */
-	if (GRAPH_SUCCESS != hwgraph_traverse(NULL, dp, &svtx))	
-		return 0;
-
-	*xp = (char)NULL;		/* remove "/xtalk/..." from path */
-
-	/* dst example now == /hw/module/001c02/Pbrick */
-
-	/* get the bus number */
-        strcat(dst, "/");
-        strcat(dst, EDGE_LBL_BUS);
-        sprintf(pcibus, "%d", p_busnum[widgetnum]);
-
-	/* link to bus to widget */
-	rv = hwgraph_path_add(NULL, dp, &nvtx);
-	if (GRAPH_SUCCESS == rv)
-		rv = hwgraph_edge_add(nvtx, svtx, pcibus);
-
-	return (rv == GRAPH_SUCCESS);
-}
-
-
-/*
- *    pcibr_attach: called every time the crosstalk
- *      infrastructure is asked to initialize a widget
- *      that matches the part number we handed to the
- *      registration routine above.
- */
-/*ARGSUSED */
-int
-pcibr_attach(vertex_hdl_t xconn_vhdl)
-{
-    /* REFERENCED */
-    graph_error_t           rc;
-    vertex_hdl_t            pcibr_vhdl;
-    bridge_t               *bridge;
-
-    PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_ATTACH, xconn_vhdl, "pcibr_attach\n"));
-
-    bridge = (bridge_t *)
-	xtalk_piotrans_addr(xconn_vhdl, NULL,
-			    0, sizeof(bridge_t), 0);
-    /*
-     * Create the vertex for the PCI bus, which we
-     * will also use to hold the pcibr_soft and
-     * which will be the "master" vertex for all the
-     * pciio connection points we will hang off it.
-     * This needs to happen before we call nic_bridge_vertex_info
-     * as we are some of the *_vmc functions need access to the edges.
-     *
-     * Opening this vertex will provide access to
-     * the Bridge registers themselves.
-     */
-    rc = hwgraph_path_add(xconn_vhdl, EDGE_LBL_PCI, &pcibr_vhdl);
-    ASSERT(rc == GRAPH_SUCCESS);
-
-    pciio_provider_register(pcibr_vhdl, &pcibr_provider);
-    pciio_provider_startup(pcibr_vhdl);
-
-    return pcibr_attach2(xconn_vhdl, bridge, pcibr_vhdl, 0, NULL);
-}
-
-
-/*ARGSUSED */
-int
-pcibr_attach2(vertex_hdl_t xconn_vhdl, bridge_t *bridge, 
-	      vertex_hdl_t pcibr_vhdl, int busnum, pcibr_soft_t *ret_softp)
-{
-    /* REFERENCED */
-    vertex_hdl_t            ctlr_vhdl;
-    bridgereg_t             id;
-    int                     rev;
-    pcibr_soft_t            pcibr_soft;
-    pcibr_info_t            pcibr_info;
-    xwidget_info_t          info;
-    xtalk_intr_t            xtalk_intr;
-    int                     slot;
-    int                     ibit;
-    vertex_hdl_t            noslot_conn;
-    char                    devnm[MAXDEVNAME], *s;
-    pcibr_hints_t           pcibr_hints;
-    uint64_t              int_enable;
-    picreg_t                int_enable_64;
-    unsigned                rrb_fixed = 0;
-
-#if PCI_FBBE
-    int                     fast_back_to_back_enable;
-#endif
-    nasid_t		    nasid;
-    int	                    iobrick_type_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));
-
-    ctlr_vhdl = NULL;
-    ctlr_vhdl = hwgraph_register(pcibr_vhdl, EDGE_LBL_CONTROLLER, 0, 
-                0, 0, 0,
-		S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP, 0, 0, 
-		(struct file_operations *)&pcibr_fops, (void *)pcibr_vhdl);
-    ASSERT(ctlr_vhdl != NULL);
-
-    /*
-     * Get the hint structure; if some NIC callback
-     * marked this vertex as "hands-off" then we
-     * just return here, before doing anything else.
-     */
-    pcibr_hints = pcibr_hints_get(xconn_vhdl, 0);
-
-    if (pcibr_hints && pcibr_hints->ph_hands_off)
-	return -1;			/* generic operations disabled */
-
-    id = bridge->b_wid_id;
-    rev = XWIDGET_PART_REV_NUM(id);
-
-    hwgraph_info_add_LBL(pcibr_vhdl, INFO_LBL_PCIBR_ASIC_REV, (arbitrary_info_t) rev);
-
-    /*
-     * allocate soft state structure, fill in some
-     * fields, and hook it up to our vertex.
-     */
-    pcibr_soft = kmalloc(sizeof(*(pcibr_soft)), GFP_KERNEL);
-    if (ret_softp)
-	*ret_softp = 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;
-    pcibr_soft->bs_base = bridge;
-    pcibr_soft->bs_rev_num = rev;
-    pcibr_soft->bs_intr_bits = (pcibr_intr_bits_f *)pcibr_intr_bits;
-
-    pcibr_soft->bs_min_slot = 0;		/* lowest possible slot# */
-    pcibr_soft->bs_max_slot = 7;		/* highest possible slot# */
-    pcibr_soft->bs_busnum = busnum;
-    pcibr_soft->bs_bridge_type = PCIBR_BRIDGETYPE_PIC;
-    switch(pcibr_soft->bs_bridge_type) {
-    case PCIBR_BRIDGETYPE_BRIDGE:
-	pcibr_soft->bs_int_ate_size = BRIDGE_INTERNAL_ATES;
-	pcibr_soft->bs_bridge_mode = 0;	/* speed is not available in bridge */
-	break;
-    case PCIBR_BRIDGETYPE_PIC:
-        pcibr_soft->bs_min_slot = 0;
-	pcibr_soft->bs_max_slot = 3;
-	pcibr_soft->bs_int_ate_size = XBRIDGE_INTERNAL_ATES;
-	pcibr_soft->bs_bridge_mode = 
-	   (((bridge->p_wid_stat_64 & PIC_STAT_PCIX_SPEED) >> 33) |
-	    ((bridge->p_wid_stat_64 & PIC_STAT_PCIX_ACTIVE) >> 33));
-
-	/* We have to clear PIC's write request buffer to avoid parity
-	 * errors.  See PV#854845.
-	 */
-	{
-	int i;
-
-	for (i=0; i < PIC_WR_REQ_BUFSIZE; i++) {
-		bridge->p_wr_req_lower[i] = 0;
-		bridge->p_wr_req_upper[i] = 0;
-		bridge->p_wr_req_parity[i] = 0;
-	}
-	}
-
-	break;
-    case PCIBR_BRIDGETYPE_XBRIDGE:
-	pcibr_soft->bs_int_ate_size = XBRIDGE_INTERNAL_ATES;
-	pcibr_soft->bs_bridge_mode = 
-	   ((bridge->b_wid_control & BRIDGE_CTRL_PCI_SPEED) >> 3);
-	break;
-    }
-
-    PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_ATTACH, pcibr_vhdl,
-		"pcibr_attach2: pcibr_soft=0x%x, mode=0x%x\n",
-                pcibr_soft, pcibr_soft->bs_bridge_mode));
-    pcibr_soft->bsi_err_intr = 0;
-
-    /* Bridges up through REV C
-     * are unable to set the direct
-     * byteswappers to BYTE_STREAM.
-     */
-    if (pcibr_soft->bs_rev_num <= BRIDGE_PART_REV_C) {
-	pcibr_soft->bs_pio_end_io = PCIIO_WORD_VALUES;
-	pcibr_soft->bs_pio_end_mem = PCIIO_WORD_VALUES;
-    }
-#if PCIBR_SOFT_LIST
-    /*
-     * link all the pcibr_soft structs
-     */
-    {
-	pcibr_list_p            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;
-	pcibr_list = self;
-    }
-#endif /* PCIBR_SOFT_LIST */
-
-    /*
-     * get the name of this bridge vertex and keep the info. Use this
-     * only where it is really needed now: like error interrupts.
-     */
-    s = dev_to_name(pcibr_vhdl, devnm, MAXDEVNAME);
-    pcibr_soft->bs_name = kmalloc(strlen(s) + 1, GFP_KERNEL);
-    strcpy(pcibr_soft->bs_name, s);
-
-    PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_ATTACH, pcibr_vhdl,
-		"pcibr_attach2: %s ASIC: rev %s (code=0x%x)\n",
-		"PIC",
-		(rev == BRIDGE_PART_REV_A) ? "A" : 
-                (rev == BRIDGE_PART_REV_B) ? "B" :
-                (rev == BRIDGE_PART_REV_C) ? "C" :
-                (rev == BRIDGE_PART_REV_D) ? "D" :
-                (rev == XBRIDGE_PART_REV_A) ? "A" :
-                (rev == XBRIDGE_PART_REV_B) ? "B" :
-                (IS_PIC_PART_REV_A(rev)) ? "A" : 
-                "unknown", rev, pcibr_soft->bs_name));
-
-    info = xwidget_info_get(xconn_vhdl);
-    pcibr_soft->bs_xid = xwidget_info_id_get(info);
-    pcibr_soft->bs_master = xwidget_info_master_get(info);
-    pcibr_soft->bs_mxid = xwidget_info_masterid_get(info);
-
-    pcibr_soft->bs_first_slot = pcibr_soft->bs_min_slot;
-    pcibr_soft->bs_last_slot = pcibr_soft->bs_max_slot;
-    /*
-     * Bridge can only reset slots 0, 1, 2, and 3.  Ibrick internal
-     * slots 4, 5, 6, and 7 must be reset as a group, so do not
-     * reset them.
-     */
-    pcibr_soft->bs_last_reset = 3;
-
-    nasid = NASID_GET(bridge);
-
-    if ((pcibr_soft->bs_bricktype = iobrick_type_get_nasid(nasid)) < 0)
-	printk(KERN_WARNING "0x%p: Unknown bricktype : 0x%x\n", (void *)xconn_vhdl,
-				(unsigned int)pcibr_soft->bs_bricktype);
-
-    pcibr_soft->bs_moduleid = iomoduleid_get(nasid);
-
-    if (pcibr_soft->bs_bricktype > 0) {
-	switch (pcibr_soft->bs_bricktype) {
-	case MODULE_PXBRICK:
-	case MODULE_IXBRICK:
-	    pcibr_soft->bs_first_slot = 0;
-	    pcibr_soft->bs_last_slot = 1;
-	    pcibr_soft->bs_last_reset = 1;
-
-	    /* If Bus 1 has IO9 then there are 4 devices in that bus.  Note
-	     * we figure this out from klconfig since the kernel has yet to 
-	     * probe
-	     */
-	    if (pcibr_widget_to_bus(pcibr_vhdl) == 1) {
-		lboard_t *brd = (lboard_t *)KL_CONFIG_INFO(nasid);
-
-		while (brd) {
-		    if (brd->brd_flags & LOCAL_MASTER_IO6) {
-			pcibr_soft->bs_last_slot = 3;
-			pcibr_soft->bs_last_reset = 3;
-		    }
-		    brd = KLCF_NEXT(brd);
-		}
-	    }
-	    break;
-	case MODULE_PBRICK:
-            pcibr_soft->bs_first_slot = 1;
-            pcibr_soft->bs_last_slot = 2;
-            pcibr_soft->bs_last_reset = 2;
-            break;
-
-        case MODULE_IBRICK:
-	    /*
-	     * Here's the current baseio layout for SN1 style systems:
-	     *
-	     *    0    1    2    3    4    5    6    7		slot#
-	     *
-	     *    x    scsi x    x    ioc3 usb  x    x  	O300 Ibrick
-	     *
-             * x == never occupied
-             * E == external (add-in) slot
-	     *
-	     */
-            pcibr_soft->bs_first_slot = 1;	/* Ibrick first slot == 1 */
-            if (pcibr_soft->bs_xid == 0xe) { 
-                pcibr_soft->bs_last_slot = 2;
-                pcibr_soft->bs_last_reset = 2;
-            } else {
-		pcibr_soft->bs_last_slot = 6;
-	    }
-            break;
-	default:
-	    break;
-        }
-
-	PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_ATTACH, pcibr_vhdl,
-		    "pcibr_attach2: %cbrick, slots %d-%d\n",
-		    MODULE_GET_BTCHAR(pcibr_soft->bs_moduleid),
-		    pcibr_soft->bs_first_slot, pcibr_soft->bs_last_slot));
-    }
-
-    /*
-     * Initialize bridge and bus locks
-     */
-    spin_lock_init(&pcibr_soft->bs_lock);
-    /*
-     * If we have one, process the hints structure.
-     */
-    if (pcibr_hints) {
-	PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_HINTS, pcibr_vhdl,
-                    "pcibr_attach2: pcibr_hints=0x%x\n", pcibr_hints));
-
-	rrb_fixed = pcibr_hints->ph_rrb_fixed;
-
-	pcibr_soft->bs_rrb_fixed = rrb_fixed;
-
-	if (pcibr_hints->ph_intr_bits) {
-	    pcibr_soft->bs_intr_bits = pcibr_hints->ph_intr_bits;
-	}
-
-	for (slot = pcibr_soft->bs_min_slot; 
-				slot < PCIBR_NUM_SLOTS(pcibr_soft); ++slot) {
-	    int hslot = pcibr_hints->ph_host_slot[slot] - 1;
-
-	    if (hslot < 0) {
-		pcibr_soft->bs_slot[slot].host_slot = slot;
-	    } else {
-		pcibr_soft->bs_slot[slot].has_host = 1;
-		pcibr_soft->bs_slot[slot].host_slot = hslot;
-	    }
-	}
-    }
-    /*
-     * Set-up initial values for state fields
-     */
-    for (slot = pcibr_soft->bs_min_slot; 
-				slot < PCIBR_NUM_SLOTS(pcibr_soft); ++slot) {
-	pcibr_soft->bs_slot[slot].bss_devio.bssd_space = PCIIO_SPACE_NONE;
-	pcibr_soft->bs_slot[slot].bss_devio.bssd_ref_cnt = 0;
-	pcibr_soft->bs_slot[slot].bss_d64_base = PCIBR_D64_BASE_UNSET;
-	pcibr_soft->bs_slot[slot].bss_d32_base = PCIBR_D32_BASE_UNSET;
-	pcibr_soft->bs_slot[slot].bss_ext_ates_active = ATOMIC_INIT(0);
-	pcibr_soft->bs_rrb_valid_dflt[slot][VCHAN0] = -1;
-    }
-
-    for (ibit = 0; ibit < 8; ++ibit) {
-	pcibr_soft->bs_intr[ibit].bsi_xtalk_intr = 0;
-	pcibr_soft->bs_intr[ibit].bsi_pcibr_intr_wrap.iw_soft = pcibr_soft;
-	pcibr_soft->bs_intr[ibit].bsi_pcibr_intr_wrap.iw_list = NULL;
-	pcibr_soft->bs_intr[ibit].bsi_pcibr_intr_wrap.iw_stat = 
-							&(bridge->b_int_status);
-	pcibr_soft->bs_intr[ibit].bsi_pcibr_intr_wrap.iw_ibit = ibit;
-	pcibr_soft->bs_intr[ibit].bsi_pcibr_intr_wrap.iw_hdlrcnt = 0;
-	pcibr_soft->bs_intr[ibit].bsi_pcibr_intr_wrap.iw_shared = 0;
-	pcibr_soft->bs_intr[ibit].bsi_pcibr_intr_wrap.iw_connected = 0;
-    }
-
-    /*
-     * connect up our error handler.  PIC has 2 busses (thus resulting in 2
-     * pcibr_soft structs under 1 widget), so only register a xwidget error
-     * handler for PIC's bus0.  NOTE: for PIC pcibr_error_handler_wrapper()
-     * is a wrapper routine we register that will call the real error handler
-     * pcibr_error_handler() with the correct pcibr_soft struct.
-     */
-    if (busnum == 0) {
-    	xwidget_error_register(xconn_vhdl, pcibr_error_handler_wrapper, pcibr_soft);
-    }
-
-    /*
-     * Initialize various Bridge registers.
-     */
-  
-    /*
-     * On pre-Rev.D bridges, set the PCI_RETRY_CNT
-     * to zero to avoid dropping stores. (#475347)
-     */
-    if (rev < BRIDGE_PART_REV_D)
-	bridge->b_bus_timeout &= ~BRIDGE_BUS_PCI_RETRY_MASK;
-
-    /*
-     * Clear all pending interrupts.
-     */
-    bridge->b_int_rst_stat = (BRIDGE_IRR_ALL_CLR);
-
-    /* Initialize some PIC specific registers. */
-    {
-	picreg_t pic_ctrl_reg = bridge->p_wid_control_64;
-
-	/* Bridges Requester ID: bus = busnum, dev = 0, func = 0 */
-	pic_ctrl_reg &= ~PIC_CTRL_BUS_NUM_MASK;
-	pic_ctrl_reg |= PIC_CTRL_BUS_NUM(busnum);
-	pic_ctrl_reg &= ~PIC_CTRL_DEV_NUM_MASK;
-	pic_ctrl_reg &= ~PIC_CTRL_FUN_NUM_MASK;
-
-	pic_ctrl_reg &= ~PIC_CTRL_NO_SNOOP;
-	pic_ctrl_reg &= ~PIC_CTRL_RELAX_ORDER;
-
-	/* enable parity checking on PICs internal RAM */
-	pic_ctrl_reg |= PIC_CTRL_PAR_EN_RESP;
-	pic_ctrl_reg |= PIC_CTRL_PAR_EN_ATE;
-	/* PIC BRINGUP WAR (PV# 862253): dont enable write request
-	 * parity checking.
-	 */
-	if (!PCIBR_WAR_ENABLED(PV862253, pcibr_soft)) {
-	    pic_ctrl_reg |= PIC_CTRL_PAR_EN_REQ;
-	}
-
-	bridge->p_wid_control_64 = pic_ctrl_reg;
-    }
-    bridge->b_int_device = (uint32_t) 0x006db6db;
-    {
-	bridgereg_t             dirmap;
-	paddr_t                 paddr;
-	iopaddr_t               xbase;
-	xwidgetnum_t            xport;
-	iopaddr_t               offset;
-	int                     num_entries = 0;
-	int                     entry;
-	cnodeid_t		cnodeid;
-	nasid_t			nasid;
-
-	/* Set the Bridge's 32-bit PCI to XTalk
-	 * Direct Map register to the most useful
-	 * value we can determine.  Note that we
-	 * must use a single xid for all of:
-	 *      direct-mapped 32-bit DMA accesses
-	 *      direct-mapped 64-bit DMA accesses
-	 *      DMA accesses through the PMU
-	 *      interrupts
-	 * This is the only way to guarantee that
-	 * completion interrupts will reach a CPU
-	 * after all DMA data has reached memory.
-	 * (Of course, there may be a few special
-	 * drivers/controlers that explicitly manage
-	 * this ordering problem.)
-	 */
-
-	cnodeid = 0;  /* default node id */
-	nasid = COMPACT_TO_NASID_NODEID(cnodeid);
-	paddr = NODE_OFFSET(nasid) + 0;
-
-	/* currently, we just assume that if we ask
-	 * for a DMA mapping to "zero" the XIO
-	 * host will transmute this into a request
-	 * for the lowest hunk of memory.
-	 */
-	xbase = xtalk_dmatrans_addr(xconn_vhdl, 0,
-				    paddr, PAGE_SIZE, 0);
-
-	if (xbase != XIO_NOWHERE) {
-	    if (XIO_PACKED(xbase)) {
-		xport = XIO_PORT(xbase);
-		xbase = XIO_ADDR(xbase);
-	    } else
-		xport = pcibr_soft->bs_mxid;
-
-	    offset = xbase & ((1ull << BRIDGE_DIRMAP_OFF_ADDRSHFT) - 1ull);
-	    xbase >>= BRIDGE_DIRMAP_OFF_ADDRSHFT;
-
-	    dirmap = xport << BRIDGE_DIRMAP_W_ID_SHFT;
-
-	    if (xbase)
-		dirmap |= BRIDGE_DIRMAP_OFF & xbase;
-	    else if (offset >= (512 << 20))
-		dirmap |= BRIDGE_DIRMAP_ADD512;
-
-	    bridge->b_dir_map = dirmap;
-	}
-	/*
-	 * Set bridge's idea of page size according to the system's
-	 * idea of "IO page size".  TBD: The idea of IO page size
-	 * should really go away.
-	 */
-	/*
-	 * ensure that we write and read without any interruption.
-	 * The read following the write is required for the Bridge war
-	 */
-#if IOPGSIZE == 4096
-        bridge->p_wid_control_64 &= ~BRIDGE_CTRL_PAGE_SIZE;
-#elif IOPGSIZE == 16384
-        bridge->p_wid_control_64 |= BRIDGE_CTRL_PAGE_SIZE;
-#else
-	<<<Unable to deal with IOPGSIZE >>>;
-#endif
-	bridge->b_wid_control;		/* inval addr bug war */
-
-	/* Initialize internal mapping entries */
-	for (entry = 0; entry < pcibr_soft->bs_int_ate_size; entry++) {
-	    bridge->b_int_ate_ram[entry].wr = 0;
-	}
-
-	/*
-	 * Determine if there's external mapping SSRAM on this
-	 * bridge.  Set up Bridge control register appropriately,
-	 * inititlize SSRAM, and set software up to manage RAM
-	 * entries as an allocatable resource.
-	 *
-	 * Currently, we just use the rm* routines to manage ATE
-	 * allocation.  We should probably replace this with a
-	 * Best Fit allocator.
-	 *
-	 * For now, if we have external SSRAM, avoid using
-	 * the internal ssram: we can't turn PREFETCH on
-	 * when we use the internal SSRAM; and besides,
-	 * this also guarantees that no allocation will
-	 * straddle the internal/external line, so we
-	 * can increment ATE write addresses rather than
-	 * recomparing against BRIDGE_INTERNAL_ATES every
-	 * time.
-	 */
-
-	num_entries = 0;
-
-	/* we always have 128 ATEs (512 for Xbridge) inside the chip
-	 * even if disabled for debugging.
-	 */
-	pcibr_soft->bs_int_ate_resource.start = 0;
-	pcibr_soft->bs_int_ate_resource.end = pcibr_soft->bs_int_ate_size - 1;
-
-	if (num_entries > pcibr_soft->bs_int_ate_size) {
-#if PCIBR_ATE_NOTBOTH			/* for debug -- forces us to use external ates */
-	    printk("pcibr_attach: disabling internal ATEs.\n");
-	    pcibr_ate_alloc(pcibr_soft, pcibr_soft->bs_int_ate_size);
-#endif
-	   pcibr_soft->bs_ext_ate_resource.start = pcibr_soft->bs_int_ate_size;
-	   pcibr_soft->bs_ext_ate_resource.end = num_entries;
-	}
-
-        pcibr_soft->bs_allocated_ate_res = (void *) kmalloc(pcibr_soft->bs_int_ate_size * sizeof(unsigned long), GFP_KERNEL);
-	memset(pcibr_soft->bs_allocated_ate_res, 0x0, pcibr_soft->bs_int_ate_size * sizeof(unsigned long));
-
-	PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_ATE, pcibr_vhdl,
-		    "pcibr_attach2: %d ATEs, %d internal & %d external\n",
-		    num_entries ? num_entries : pcibr_soft->bs_int_ate_size,
-		    pcibr_soft->bs_int_ate_size,
-		    num_entries ? num_entries-pcibr_soft->bs_int_ate_size : 0));
-    }
-
-    {
-	bridgereg_t             dirmap;
-	iopaddr_t               xbase;
-
-	/*
-	 * now figure the *real* xtalk base address
-	 * that dirmap sends us to.
-	 */
-	dirmap = bridge->b_dir_map;
-	if (dirmap & BRIDGE_DIRMAP_OFF)
-	    xbase = (iopaddr_t)(dirmap & BRIDGE_DIRMAP_OFF)
-			<< BRIDGE_DIRMAP_OFF_ADDRSHFT;
-	else if (dirmap & BRIDGE_DIRMAP_ADD512)
-	    xbase = 512 << 20;
-	else
-	    xbase = 0;
-
-	pcibr_soft->bs_dir_xbase = xbase;
-
-	/* it is entirely possible that we may, at this
-	 * point, have our dirmap pointing somewhere
-	 * other than our "master" port.
-	 */
-	pcibr_soft->bs_dir_xport =
-	    (dirmap & BRIDGE_DIRMAP_W_ID) >> BRIDGE_DIRMAP_W_ID_SHFT;
-    }
-
-    /* pcibr sources an error interrupt;
-     * figure out where to send it.
-     *
-     * If any interrupts are enabled in bridge,
-     * then the prom set us up and our interrupt
-     * has already been reconnected in mlreset
-     * above.
-     *
-     * Need to set the D_INTR_ISERR flag
-     * in the dev_desc used for allocating the
-     * error interrupt, so our interrupt will
-     * be properly routed and prioritized.
-     *
-     * If our crosstalk provider wants to
-     * fix widget error interrupts to specific
-     * destinations, D_INTR_ISERR is how it
-     * knows to do this.
-     */
-
-    xtalk_intr = xtalk_intr_alloc(xconn_vhdl, (device_desc_t)0, pcibr_vhdl);
-	{
-		int irq = ((hub_intr_t)xtalk_intr)->i_bit;
-		int cpu = ((hub_intr_t)xtalk_intr)->i_cpuid;
-
-		intr_unreserve_level(cpu, irq);
-		((hub_intr_t)xtalk_intr)->i_bit = SGI_PCIBR_ERROR;
-	}
-    ASSERT(xtalk_intr != NULL);
-
-    pcibr_soft->bsi_err_intr = xtalk_intr;
-
-    /*
-     * On IP35 with XBridge, we do some extra checks in pcibr_setwidint
-     * in order to work around some addressing limitations.  In order
-     * for that fire wall to work properly, we need to make sure we
-     * start from a known clean state.
-     */
-    pcibr_clearwidint(bridge);
-
-    xtalk_intr_connect(xtalk_intr, (intr_func_t) pcibr_error_intr_handler,
-		(intr_arg_t) pcibr_soft, (xtalk_intr_setfunc_t)pcibr_setwidint, (void *)bridge);
-
-    request_irq(SGI_PCIBR_ERROR, (void *)pcibr_error_intr_handler, SA_SHIRQ, "PCIBR error",
-					(intr_arg_t) pcibr_soft);
-
-    PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_INTR_ALLOC, pcibr_vhdl,
-		"pcibr_setwidint: b_wid_int_upper=0x%x, b_wid_int_lower=0x%x\n",
-		bridge->b_wid_int_upper, bridge->b_wid_int_lower));
-
-    /*
-     * now we can start handling error interrupts;
-     * enable all of them.
-     * NOTE: some PCI ints may already be enabled.
-     */
-    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) {
-	/*
-	 * We commonly get master timeouts when talking to ql.
-	 * We also see RESP_XTALK_ERROR and LLP_TX_RETRY interrupts.
-	 * Insure that these are all disabled for now.
-	 */
-	int_enable &= ~(BRIDGE_IMR_PCI_MST_TIMEOUT |
-			BRIDGE_ISR_RESP_XTLK_ERR |
-			BRIDGE_ISR_LLP_TX_RETRY);
-    }
-    if (pcibr_soft->bs_rev_num < BRIDGE_PART_REV_C) {
-	int_enable &= ~BRIDGE_ISR_BAD_XRESP_PKT;
-    }
-#endif				/* BRIDGE_ERROR_INTR_WAR */
-
-#ifdef QL_SCSI_CTRL_WAR			/* for IP30 only */
-    /* Really a QL rev A issue, but all newer hearts have newer QLs.
-     * Forces all IO6/MSCSI to be new.
-     */
-    if (heart_rev() == HEART_REV_A)
-	int_enable &= ~BRIDGE_IMR_PCI_MST_TIMEOUT;
-#endif
-
-#ifdef BRIDGE1_TIMEOUT_WAR
-    if (pcibr_soft->bs_rev_num == BRIDGE_PART_REV_A) {
-	/*
-	 * Turn off these interrupts.  They can't be trusted in bridge 1
-	 */
-	int_enable &= ~(BRIDGE_IMR_XREAD_REQ_TIMEOUT |
-			BRIDGE_IMR_UNEXP_RESP);
-    }
-#endif
-
-    /* PIC BRINGUP WAR (PV# 856864 & 856865): allow the tnums that are
-     * locked out to be freed up sooner (by timing out) so that the
-     * read tnums are never completely used up.
-     */
-    if (PCIBR_WAR_ENABLED(PV856864, pcibr_soft)) {
-        int_enable &= ~PIC_ISR_PCIX_REQ_TOUT;
-        int_enable &= ~BRIDGE_ISR_XREAD_REQ_TIMEOUT;
-
-        bridge->b_wid_req_timeout = 0x750;
-    }
-
-    /*
-     * PIC BRINGUP WAR (PV# 856866, 859504, 861476, 861478): Don't use
-     * RRB0, RRB8, RRB1, and RRB9.  Assign them to DEVICE[2|3]--VCHAN3
-     * so they are not used
-     */
-    if (PCIBR_WAR_ENABLED(PV856866, pcibr_soft)) {
-        bridge->b_even_resp |= 0x000f000f;
-        bridge->b_odd_resp |= 0x000f000f;
-    }
-
-    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 */
-
-    /*
-     * Depending on the rev of bridge, disable certain features.
-     * Easiest way seems to be to force the PCIBR_NOwhatever
-     * flag to be on for all DMA calls, which overrides any
-     * PCIBR_whatever flag or even the setting of whatever
-     * from the PCIIO_DMA_class flags (or even from the other
-     * PCIBR flags, since NO overrides YES).
-     */
-    pcibr_soft->bs_dma_flags = 0;
-
-    /* PREFETCH:
-     * Always completely disabled for REV.A;
-     * at "pcibr_prefetch_enable_rev", anyone
-     * asking for PCIIO_PREFETCH gets it.
-     * Between these two points, you have to ask
-     * for PCIBR_PREFETCH, which promises that
-     * your driver knows about known Bridge WARs.
-     */
-    if (pcibr_soft->bs_rev_num < BRIDGE_PART_REV_B)
-	pcibr_soft->bs_dma_flags |= PCIBR_NOPREFETCH;
-    else if (pcibr_soft->bs_rev_num < 
-		(BRIDGE_WIDGET_PART_NUM << 4))
-	pcibr_soft->bs_dma_flags |= PCIIO_NOPREFETCH;
-
-    /* WRITE_GATHER: Disabled */
-    if (pcibr_soft->bs_rev_num < 
-		(BRIDGE_WIDGET_PART_NUM << 4))
-	pcibr_soft->bs_dma_flags |= PCIBR_NOWRITE_GATHER;
-
-    /* PIC only supports 64-bit direct mapping in PCI-X mode.  Since
-     * all PCI-X devices that initiate memory transactions must be
-     * capable of generating 64-bit addressed, we force 64-bit DMAs.
-     */
-    if (IS_PCIX(pcibr_soft)) {
-	pcibr_soft->bs_dma_flags |= PCIIO_DMA_A64;
-    }
-
-    {
-
-    iopaddr_t               prom_base_addr = pcibr_soft->bs_xid << 24;
-    int                     prom_base_size = 0x1000000;
-    int			    status;
-    struct resource	    *res;
-
-    /* Allocate resource maps based on bus page size; for I/O and memory
-     * space, free all pages except those in the base area and in the
-     * range set by the PROM. 
-     *
-     * PROM creates BAR addresses in this format: 0x0ws00000 where w is
-     * the widget number and s is the device register offset for the slot.
-     */
-
-    /* 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), GFP_KERNEL);
-    if (!res)
-	panic("PCIBR:Unable to allocate resource structure\n");
-
-    /* Block off the range used by PROM. */
-    res->start = prom_base_addr;
-    res->end = prom_base_addr + (prom_base_size - 1);
-    status = request_resource(&pcibr_soft->bs_io_win_root_resource, res);
-    if (status)
-	panic("PCIBR:Unable to request_resource()\n");
-
-    /* Setup the Small Window Root Resource */
-    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), GFP_KERNEL);
-    if (!res)
-        panic("PCIBR:Unable to allocate resource structure\n");
-
-    /* Block off the range used by PROM. */
-    res->start = prom_base_addr;
-    res->end = prom_base_addr + (prom_base_size - 1);;
-    status = request_resource(&pcibr_soft->bs_mem_win_root_resource, res);
-    if (status)
-        panic("PCIBR:Unable to request_resource()\n");
-
-    }
-
-    /* build "no-slot" connection point
-     */
-    pcibr_info = pcibr_device_info_new
-	(pcibr_soft, PCIIO_SLOT_NONE, PCIIO_FUNC_NONE,
-	 PCIIO_VENDOR_ID_NONE, PCIIO_DEVICE_ID_NONE);
-    noslot_conn = pciio_device_info_register
-	(pcibr_vhdl, &pcibr_info->f_c);
-
-    /* Remember the no slot connection point info for tearing it
-     * down during detach.
-     */
-    pcibr_soft->bs_noslot_conn = noslot_conn;
-    pcibr_soft->bs_noslot_info = pcibr_info;
-#if PCI_FBBE
-    fast_back_to_back_enable = 1;
-#endif
-
-#if PCI_FBBE
-    if (fast_back_to_back_enable) {
-	/*
-	 * All devices on the bus are capable of fast back to back, so
-	 * we need to set the fast back to back bit in all devices on
-	 * the bus that are capable of doing such accesses.
-	 */
-    }
-#endif
-
-    for (slot = pcibr_soft->bs_min_slot; 
-				slot < PCIBR_NUM_SLOTS(pcibr_soft); ++slot) {
-	/* Find out what is out there */
-	(void)pcibr_slot_info_init(pcibr_vhdl,slot);
-    }
-    for (slot = pcibr_soft->bs_min_slot; 
-				slot < PCIBR_NUM_SLOTS(pcibr_soft); ++slot)
-	/* Set up the address space for this slot in the PCI land */
-	(void)pcibr_slot_addr_space_init(pcibr_vhdl, slot);
-
-    for (slot = pcibr_soft->bs_min_slot; 
-				slot < PCIBR_NUM_SLOTS(pcibr_soft); ++slot)
-	/* Setup the device register */
-	(void)pcibr_slot_device_init(pcibr_vhdl, slot);
-
-    if (IS_PCIX(pcibr_soft)) {
-        pcibr_soft->bs_pcix_rbar_inuse = 0;
-        pcibr_soft->bs_pcix_rbar_avail = NUM_RBAR;
-	pcibr_soft->bs_pcix_rbar_percent_allowed = 
-					pcibr_pcix_rbars_calc(pcibr_soft);
-
-	for (slot = pcibr_soft->bs_min_slot; 
-				slot < PCIBR_NUM_SLOTS(pcibr_soft); ++slot)
-	    /* Setup the PCI-X Read Buffer Attribute Registers (RBARs) */
-	    (void)pcibr_slot_pcix_rbar_init(pcibr_soft, slot);
-    }
-
-    /* Set up convenience links */
-    pcibr_bus_cnvlink(pcibr_soft->bs_vhdl);
-
-    for (slot = pcibr_soft->bs_min_slot; 
-				slot < PCIBR_NUM_SLOTS(pcibr_soft); ++slot)
-	/* Setup host/guest relations */
-	(void)pcibr_slot_guest_info_init(pcibr_vhdl, slot);
-
-    /* Handle initial RRB management for Bridge and Xbridge */
-    pcibr_initial_rrb(pcibr_vhdl, 
-                      pcibr_soft->bs_first_slot, pcibr_soft->bs_last_slot);
-    
-{  /* Before any drivers get called that may want to re-allocate
-    * RRB's, let's get some special cases pre-allocated. Drivers
-    * may override these pre-allocations, but by doing pre-allocations
-    * now we're assured not to step all over what the driver intended.
-    *
-    * Note: Someday this should probably be moved over to pcibr_rrb.c
-    */
-    /*
-     * Each Pbrick PCI bus only has slots 1 and 2.   Similarly for
-     * widget 0xe on Ibricks.  Allocate RRB's accordingly.
-     */
-    if (pcibr_soft->bs_bricktype > 0) {
-	switch (pcibr_soft->bs_bricktype) {
-	case MODULE_PBRICK:
-		do_pcibr_rrb_autoalloc(pcibr_soft, 1, VCHAN0, 8);
-		do_pcibr_rrb_autoalloc(pcibr_soft, 2, VCHAN0, 8);
-		break;
-	case MODULE_IBRICK:
-	  	/* port 0xe on the Ibrick only has slots 1 and 2 */
-		if (pcibr_soft->bs_xid == 0xe) {
-			do_pcibr_rrb_autoalloc(pcibr_soft, 1, VCHAN0, 8);
-			do_pcibr_rrb_autoalloc(pcibr_soft, 2, VCHAN0, 8);
-		}
-		else {
-		    	/* allocate one RRB for the serial port */
-			do_pcibr_rrb_autoalloc(pcibr_soft, 0, VCHAN0, 1);
-		}
-		break;
-	case MODULE_PXBRICK:
-	case MODULE_IXBRICK:
-		/* 
-		 * If the IO9 is in the PXBrick (bus1, slot1) allocate
-                 * RRBs to all the devices
-		 */
-		if ((pcibr_widget_to_bus(pcibr_vhdl) == 1) &&
-		    (pcibr_soft->bs_slot[0].bss_vendor_id == 0x10A9) &&
-		    (pcibr_soft->bs_slot[0].bss_device_id == 0x100A)) {
-			do_pcibr_rrb_autoalloc(pcibr_soft, 0, VCHAN0, 4);
-			do_pcibr_rrb_autoalloc(pcibr_soft, 1, VCHAN0, 4);
-			do_pcibr_rrb_autoalloc(pcibr_soft, 2, VCHAN0, 4);
-			do_pcibr_rrb_autoalloc(pcibr_soft, 3, VCHAN0, 4);
-		} else {
-			do_pcibr_rrb_autoalloc(pcibr_soft, 0, VCHAN0, 8);
-			do_pcibr_rrb_autoalloc(pcibr_soft, 1, VCHAN0, 8);
-		}
-		break;
-	} /* switch */
-    }
-
-#ifdef LATER
-    if (strstr(nicinfo, XTALK_PCI_PART_NUM)) {
-	do_pcibr_rrb_autoalloc(pcibr_soft, 1, VCHAN0, 8);
-    }
-#endif
-}  /* OK Special RRB allocations are done. */
-
-    for (slot = pcibr_soft->bs_min_slot; 
-				slot < PCIBR_NUM_SLOTS(pcibr_soft); ++slot)
-	/* Call the device attach */
-	(void)pcibr_slot_call_device_attach(pcibr_vhdl, slot, 0);
-
-    pciio_device_attach(noslot_conn, (int)0);
-
-    return 0;
-}
-
 /*
  * pcibr_detach:
  *	Detach the bridge device from the hwgraph after cleaning out all the 
@@ -1777,25 +686,22 @@
 int
 pcibr_detach(vertex_hdl_t xconn)
 {
-    pciio_slot_t	slot;
-    vertex_hdl_t	pcibr_vhdl;
-    pcibr_soft_t	pcibr_soft;
-    bridge_t		*bridge;
-    unsigned             s;
+    pciio_slot_t	 slot;
+    vertex_hdl_t	 pcibr_vhdl;
+    pcibr_soft_t	 pcibr_soft;
+    unsigned long        s;
 
     PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_DETACH, xconn, "pcibr_detach\n"));
 
     /* Get the bridge vertex from its xtalk connection point */
     if (hwgraph_traverse(xconn, EDGE_LBL_PCI, &pcibr_vhdl) != GRAPH_SUCCESS)
-	return(1);
+	return 1;
 
     pcibr_soft = pcibr_soft_get(pcibr_vhdl);
-    bridge = pcibr_soft->bs_base;
-
 
-    s = pcibr_lock(pcibr_soft);
     /* Disable the interrupts from the bridge */
-    bridge->p_int_enable_64 = 0;
+    s = pcibr_lock(pcibr_soft);
+    pcireg_intr_enable_set(pcibr_soft, 0);
     pcibr_unlock(pcibr_soft, s);
 
     /* Detach all the PCI devices talking to this bridge */
@@ -1823,26 +729,64 @@
 
     /* 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 */
-    hwgraph_edge_remove(pcibr_vhdl, EDGE_LBL_CONTROLLER, NULL);
-    /* Remove the PCI bridge vertex */
-    hwgraph_edge_remove(xconn, EDGE_LBL_PCI, NULL);
 
-    return(0);
+    return 0;
 }
 
+
+/*
+ * Set the Bridge's 32-bit PCI to XTalk Direct Map register to the most useful
+ * value we can determine.  Note that we must use a single xid for all of:
+ * 	-direct-mapped 32-bit DMA accesses
+ *	-direct-mapped 64-bit DMA accesses
+ * 	-DMA accesses through the PMU
+ *	-interrupts
+ * This is the only way to guarantee that completion interrupts will reach a
+ * CPU after all DMA data has reached memory.
+ */
+void
+pcibr_directmap_init(pcibr_soft_t pcibr_soft)
+{
+    paddr_t		paddr;
+    iopaddr_t		xbase;
+    uint64_t		diroff;
+    cnodeid_t		cnodeid = 0;	/* We need api for diroff api */
+    nasid_t		nasid;
+
+    nasid = COMPACT_TO_NASID_NODEID(cnodeid);
+    paddr = NODE_OFFSET(nasid) + 0;
+
+    /* Assume that if we ask for a DMA mapping to zero the XIO host will
+     * transmute this into a request for the lowest hunk of memory.
+     */
+    xbase = xtalk_dmatrans_addr(pcibr_soft->bs_conn, 0, paddr, PAGE_SIZE, 0);
+
+    diroff = xbase >> BRIDGE_DIRMAP_OFF_ADDRSHFT;
+    pcireg_dirmap_diroff_set(pcibr_soft, diroff);
+    pcireg_dirmap_wid_set(pcibr_soft, pcibr_soft->bs_mxid);
+    pcibr_soft->bs_dir_xport = pcibr_soft->bs_mxid;
+    if (xbase  == (512 << 20)) { /* 512Meg */
+	pcireg_dirmap_add512_set(pcibr_soft);
+	pcibr_soft->bs_dir_xbase = (512 << 20);
+    } else {
+	pcireg_dirmap_add512_clr(pcibr_soft);
+	pcibr_soft->bs_dir_xbase = diroff << BRIDGE_DIRMAP_OFF_ADDRSHFT;
+    }
+}
+
+
 int
 pcibr_asic_rev(vertex_hdl_t pconn_vhdl)
 {
-    vertex_hdl_t          pcibr_vhdl;
-    int                     tmp_vhdl;
+    vertex_hdl_t            pcibr_vhdl;
+    int			    rc;
     arbitrary_info_t        ainfo;
 
     if (GRAPH_SUCCESS !=
 	hwgraph_traverse(pconn_vhdl, EDGE_LBL_MASTER, &pcibr_vhdl))
 	return -1;
 
-    tmp_vhdl = hwgraph_info_get_LBL(pcibr_vhdl, INFO_LBL_PCIBR_ASIC_REV, &ainfo);
+    rc = hwgraph_info_get_LBL(pcibr_vhdl, INFO_LBL_PCIBR_ASIC_REV, &ainfo);
 
     /*
      * Any hwgraph function that returns a vertex handle will implicity
@@ -1855,20 +799,10 @@
      */
     hwgraph_vertex_unref(pcibr_vhdl);
 
-    if (tmp_vhdl != GRAPH_SUCCESS) 
+    if (rc != GRAPH_SUCCESS) 
 	return -1;
-    return (int) ainfo;
-}
 
-int
-pcibr_write_gather_flush(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);
-    pciio_slot_t  slot;
-    slot = PCIBR_INFO_SLOT_GET_INT(pciio_info);
-    pcibr_device_write_gather_flush(pcibr_soft, slot);
-    return 0;
+    return (int) ainfo;
 }
 
 /* =====================================================================
@@ -1884,14 +818,12 @@
 		      unsigned flags)
 {
     pcibr_info_t            pcibr_info = pcibr_info_get(pconn_vhdl);
-    pciio_info_t            pciio_info = &pcibr_info->f_c;
+    pciio_info_t            pciio_info = pciio_info_get(pconn_vhdl);
     pcibr_soft_t            pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info);
-    bridge_t               *bridge = pcibr_soft->bs_base;
-
     unsigned                bar;	/* which BASE reg on device is decoding */
     iopaddr_t               xio_addr = XIO_NOWHERE;
-    iopaddr_t               base;	/* base of devio(x) mapped area on PCI */
-    iopaddr_t               limit;	/* base of devio(x) mapped area on PCI */
+    iopaddr_t               base = 0;
+    iopaddr_t               limit = 0;
 
     pciio_space_t           wspace;	/* which space device is decoding */
     iopaddr_t               wbase;	/* base of device decode on PCI */
@@ -2012,7 +944,7 @@
     maxtry = PCIBR_NUM_SLOTS(pcibr_soft) * 2;
     halftry = PCIBR_NUM_SLOTS(pcibr_soft) - 1;
     for (try = 0; try < maxtry; ++try) {
-	bridgereg_t             devreg;
+	uint64_t		devreg;
 	unsigned                offset;
 
 	/* calculate win based on slot, attempt, and max possible
@@ -2080,14 +1012,13 @@
 		devreg &= ~BRIDGE_DEV_DEV_SWAP;
 
 	    if (pcibr_soft->bs_slot[win].bss_device != devreg) {
-		bridge->b_device[win].reg = devreg;
+		pcireg_device_set(pcibr_soft, win, devreg);
 		pcibr_soft->bs_slot[win].bss_device = devreg;
-		bridge->b_wid_tflush;   /* wait until Bridge PIO complete */
-#ifdef PCI_LATER
+		pcireg_tflush_get(pcibr_soft);	
+
 		PCIBR_DEBUG((PCIBR_DEBUG_DEVREG, pconn_vhdl, 
 			    "pcibr_addr_pci_to_xio: Device(%d): 0x%x\n",
 			    win, devreg));
-#endif
 	    }
 	    pcibr_soft->bs_slot[win].bss_devio.bssd_space = space;
 	    pcibr_soft->bs_slot[win].bss_devio.bssd_base = mbase;
@@ -2200,7 +1131,7 @@
     if (xio_addr != XIO_NOWHERE) {
 	unsigned                bst;	/* nonzero to set bytestream */
 	unsigned               *bfp;	/* addr of record of how swapper is set */
-	unsigned                swb;	/* which control bit to mung */
+	uint64_t		swb;	/* which control bit to mung */
 	unsigned                bfo;	/* current swapper setting */
 	unsigned                bfn;	/* desired swapper setting */
 
@@ -2226,13 +1157,13 @@
 		    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;
-	    octl = bridge->p_wid_control_64;
-	    nctl = bst ? octl | (uint64_t)swb : octl & ((uint64_t)~swb);
+	    swb = (space == PCIIO_SPACE_IO) ? 0: BRIDGE_CTRL_MEM_SWAP;
+	    if (bst) {
+		pcireg_control_bit_set(pcibr_soft, swb);
+	    } else {
+		pcireg_control_bit_clr(pcibr_soft, swb);
+	    }
 
-	    if (octl != nctl)		/* make the change if any */
-		bridge->b_wid_control = nctl;
 	    *bfp = bfn;			/* record the assignment */
 
 	    PCIBR_DEBUG((PCIBR_DEBUG_PIOMAP, pconn_vhdl,
@@ -2324,7 +1255,7 @@
     pcibr_piomap->bp_pciaddr = pci_addr;
     pcibr_piomap->bp_mapsz = req_size;
     pcibr_piomap->bp_soft = pcibr_soft;
-    pcibr_piomap->bp_toc[0] = ATOMIC_INIT(0);
+    pcibr_piomap->bp_toc = ATOMIC_INIT(0);
 
     if (mapptr) {
 	s = pcibr_lock(pcibr_soft);
@@ -2383,7 +1314,7 @@
                 "pcibr_piomap_addr: map=0x%lx, addr=0x%lx\n", 
 		pcibr_piomap, addr));
 
-    return(addr);
+    return addr;
 }
 
 /*ARGSUSED */
@@ -2424,7 +1355,7 @@
     PCIBR_DEBUG((PCIBR_DEBUG_PIODIR, pconn_vhdl,
 		"pcibr_piotrans_addr: xio_addr=0x%lx, addr=0x%lx\n",
 		xio_addr, addr));
-    return(addr);
+    return addr;
 }
 
 /*
@@ -2546,6 +1477,7 @@
     return start_addr;
 }
 
+#define ERR_MSG "!Device %s freeing size (0x%lx) different than allocated (0x%lx)"
 /*ARGSUSED */
 void
 pcibr_piospace_free(vertex_hdl_t pconn_vhdl,
@@ -2689,7 +1621,7 @@
 	attributes &= (PCI64_ATTR_BAR | PCI64_ATTR_SWAP);
     }
 
-    return (attributes);
+    return attributes;
 }
 
 /*ARGSUSED */
@@ -2775,7 +1707,7 @@
 		    else
 			min_rrbs = 1;
 		    if (have_rrbs < min_rrbs)
-			do_pcibr_rrb_autoalloc(pcibr_soft, slot, vchan,
+			pcibr_rrb_alloc_more(pcibr_soft, slot, vchan,
 					       min_rrbs - have_rrbs);
 		}
 	    }
@@ -2845,7 +1777,7 @@
 		     - 1) + 1;		/* round UP */
     }
 
-    ate_index = pcibr_ate_alloc(pcibr_soft, ate_count);
+    ate_index = pcibr_ate_alloc(pcibr_soft, ate_count, &pcibr_dmamap->resource);
 
     if (ate_index != -1) {
 	if (!pcibr_try_set_device(pcibr_soft, slot, flags, BRIDGE_DEV_PMU_BITS)) {
@@ -2857,7 +1789,7 @@
 			"pcibr_dmamap_alloc: using PMU, ate_index=%d, "
 			"pcibr_dmamap=0x%lx\n", ate_index, pcibr_dmamap));
 
-	    ate_proto = pcibr_flags_to_ate(flags);
+	    ate_proto = pcibr_flags_to_ate(pcibr_soft, flags);
 
 	    pcibr_dmamap->bd_flags = flags;
 	    pcibr_dmamap->bd_pci_addr =
@@ -2890,7 +1822,7 @@
 		    else
 			min_rrbs = 1;
 		    if (have_rrbs < min_rrbs)
-			do_pcibr_rrb_autoalloc(pcibr_soft, slot, vchan,
+			pcibr_rrb_alloc_more(pcibr_soft, slot, vchan,
 					       min_rrbs - have_rrbs);
 		}
 	    }
@@ -2900,7 +1832,7 @@
 		    "pcibr_dmamap_alloc: PMU use failed, ate_index=%d\n",
 		    ate_index));
 
-	pcibr_ate_free(pcibr_soft, ate_index, ate_count);
+	pcibr_ate_free(pcibr_soft, ate_index, ate_count, &pcibr_dmamap->resource);
     }
     /* total failure: sorry, you just can't
      * get from here to there that way.
@@ -2920,16 +1852,6 @@
     pciio_slot_t            slot = PCIBR_SLOT_TO_DEVICE(pcibr_soft,
 							pcibr_dmamap->bd_slot);
 
-    unsigned                flags = pcibr_dmamap->bd_flags;
-
-    /* Make sure that bss_ext_ates_active
-     * is properly kept up to date.
-     */
-
-    if (PCIBR_DMAMAP_BUSY & flags)
-	if (PCIBR_DMAMAP_SSRAM & flags)
-	    atomic_dec(&(pcibr_soft->bs_slot[slot]. bss_ext_ates_active));
-
     xtalk_dmamap_free(pcibr_dmamap->bd_xtalk);
 
     if (pcibr_dmamap->bd_flags & PCIIO_DMA_A64) {
@@ -2938,8 +1860,9 @@
     if (pcibr_dmamap->bd_ate_count) {
 	pcibr_ate_free(pcibr_dmamap->bd_soft,
 		       pcibr_dmamap->bd_ate_index,
-		       pcibr_dmamap->bd_ate_count);
-	pcibr_release_device(pcibr_soft, slot, BRIDGE_DEV_PMU_BITS);
+		       pcibr_dmamap->bd_ate_count,
+		       &pcibr_dmamap->resource);
+	pcibr_release_device(pcibr_soft, slot, XBRIDGE_DEV_PMU_BITS);
     }
 
     PCIBR_DEBUG((PCIBR_DEBUG_DMAMAP, pcibr_dmamap->bd_dev,
@@ -2992,7 +1915,7 @@
     for (slot = soft->bs_min_slot; slot < PCIBR_NUM_SLOTS(soft); ++slot)
 	if ((xio_addr >= PCIBR_BRIDGE_DEVIO(soft, slot)) &&
 	    (xio_lim < PCIBR_BRIDGE_DEVIO(soft, slot + 1))) {
-	    bridgereg_t             dev;
+	    uint64_t		dev;
 
 	    dev = soft->bs_slot[slot].bss_device;
 	    pci_addr = dev & BRIDGE_DEV_OFF_MASK;
@@ -3091,33 +2014,14 @@
 		    paddr, paddr + req_size - 1, xio_port, xio_addr, pci_addr));
 
     } else {
-	bridge_t               *bridge = pcibr_soft->bs_base;
 	iopaddr_t               offset = IOPGOFF(xio_addr);
 	bridge_ate_t            ate_proto = pcibr_dmamap->bd_ate_proto;
 	int                     ate_count = IOPG(offset + req_size - 1) + 1;
-
 	int                     ate_index = pcibr_dmamap->bd_ate_index;
-	unsigned                cmd_regs[8];
-	unsigned                s;
-
-#if PCIBR_FREEZE_TIME
-	int                     ate_total = ate_count;
-	unsigned                freeze_time;
-#endif
-	bridge_ate_p            ate_ptr = pcibr_dmamap->bd_ate_ptr;
 	bridge_ate_t            ate;
 
-	/* Bridge Hardware WAR #482836:
-	 * If the transfer is not cache aligned
-	 * and the Bridge Rev is <= B, force
-	 * prefetch to be off.
-	 */
-	if (flags & PCIBR_NOPREFETCH)
-	    ate_proto &= ~ATE_PREF;
-
-	ate = ate_proto
-	    | (xio_port << ATE_TIDSHIFT)
-	    | (xio_addr - offset);
+	ate = ate_proto | (xio_addr - offset);
+	ate |= (xio_port << ATE_TIDSHIFT);
 
 	pci_addr = pcibr_dmamap->bd_pci_addr + offset;
 
@@ -3128,10 +2032,8 @@
 
 	ASSERT(ate_count > 0);
 	if (ate_count <= pcibr_dmamap->bd_ate_count) {
-		ATE_FREEZE();
-		ATE_WRITE();
-		ATE_THAW();
-		bridge->b_wid_tflush;	/* wait until Bridge PIO complete */
+		ate_write(pcibr_soft, ate_index, ate_count, ate);
+
 		PCIBR_DEBUG((PCIBR_DEBUG_DMAMAP, pcibr_dmamap->bd_dev,
 			    "pcibr_dmamap_addr (PMU) : wanted paddr "
 			    "[0x%lx..0x%lx] returning PCI 0x%lx\n", 
@@ -3163,19 +2065,6 @@
 void
 pcibr_dmamap_done(pcibr_dmamap_t pcibr_dmamap)
 {
-    /*
-     * We could go through and invalidate ATEs here;
-     * for performance reasons, we don't.
-     * We also don't enforce the strict alternation
-     * between _addr/_list and _done, but Hub does.
-     */
-
-    if (pcibr_dmamap->bd_flags & PCIBR_DMAMAP_BUSY) {
-	pcibr_dmamap->bd_flags &= ~PCIBR_DMAMAP_BUSY;
-
-	if (pcibr_dmamap->bd_flags & PCIBR_DMAMAP_SSRAM)
-	    atomic_dec(&(pcibr_dmamap->bd_soft->bs_slot[pcibr_dmamap->bd_slot]. bss_ext_ates_active));
-    }
     xtalk_dmamap_done(pcibr_dmamap->bd_xtalk);
 
     PCIBR_DEBUG((PCIBR_DEBUG_DMAMAP, pcibr_dmamap->bd_dev,
@@ -3198,7 +2087,7 @@
 	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(NASID_TO_COMPACT_NODEID(NASID_GET(pcibr_soft->bs_dir_xbase)));
+	return NASID_TO_COMPACT_NODEID(NASID_GET(pcibr_soft->bs_dir_xbase));
 }
 
 /*ARGSUSED */
@@ -3281,17 +2170,13 @@
 	if ((pci_addr != PCIBR_D64_BASE_UNSET) &&
 	    (flags == slotp->bss_d64_flags)) {
 
-	    pci_addr |=  xio_addr
-		| ((uint64_t) xio_port << PCI64_ATTR_TARG_SHFT);
-
-#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\n",
-			    paddr, paddr + req_size - 1, xio_addr, pci_addr));
-	    return (pci_addr);
+	    pci_addr |= xio_addr |
+		((uint64_t) xio_port << PCI64_ATTR_TARG_SHFT);
+	    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\n",
+			paddr, paddr + req_size - 1, xio_addr, pci_addr));
+	    return pci_addr;
 	}
 	if (!pcibr_try_set_device(pcibr_soft, pciio_slot, flags, BRIDGE_DEV_D64_BITS)) {
 	    pci_addr = pcibr_flags_to_d64(flags, pcibr_soft);
@@ -3313,7 +2198,7 @@
 		    else
 			min_rrbs = 1;
 		    if (have_rrbs < min_rrbs)
-			do_pcibr_rrb_autoalloc(pcibr_soft, pciio_slot, vchan,
+			pcibr_rrb_alloc_more(pcibr_soft, pciio_slot, vchan,
 					       min_rrbs - have_rrbs);
 		}
 	    }
@@ -3322,7 +2207,7 @@
 			"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);
+	    return pci_addr;
 	}
 
 	PCIBR_DEBUG((PCIBR_DEBUG_DMADIR, pconn_vhdl,
@@ -3375,7 +2260,7 @@
                             " xio_port=0x%x, direct32: pci_addr=0x%lx\n",
                             paddr, paddr + req_size - 1, xio_addr, pci_addr));
 
-		return (pci_addr);
+		return pci_addr;
 	    }
 	    if (!pcibr_try_set_device(pcibr_soft, pciio_slot, flags, BRIDGE_DEV_D32_BITS)) {
 
@@ -3394,7 +2279,7 @@
 			else
 			    min_rrbs = 1;
 			if (have_rrbs < min_rrbs)
-			    do_pcibr_rrb_autoalloc(pcibr_soft, pciio_slot, 
+			    pcibr_rrb_alloc_more(pcibr_soft, pciio_slot, 
 						   vchan, min_rrbs - have_rrbs);
 		    }
 		}
@@ -3404,7 +2289,7 @@
 			    "new flags: 0x%x\n", paddr, paddr + req_size - 1,
 			    xio_addr, pci_addr, (uint64_t) flags));
 
-		return (pci_addr);
+		return pci_addr;
 	    }
 	    /* our flags conflict with Device(x).
 	     */
@@ -3441,17 +2326,6 @@
     xtalk_dmaaddr_drain(xconn_vhdl, paddr, bytes);
 }
 
-void
-pcibr_dmalist_drain(vertex_hdl_t pconn_vhdl,
-		    alenlist_t list)
-{
-    pciio_info_t            pciio_info = pciio_info_get(pconn_vhdl);
-    pcibr_soft_t            pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info);
-    vertex_hdl_t            xconn_vhdl = pcibr_soft->bs_conn;
-
-    xtalk_dmalist_drain(xconn_vhdl, list);
-}
-
 /*
  * Get the starting PCIbus address out of the given DMA map.
  * This function is supposed to be used by a close friend of PCI bridge
@@ -3461,7 +2335,7 @@
 iopaddr_t
 pcibr_dmamap_pciaddr_get(pcibr_dmamap_t pcibr_dmamap)
 {
-    return (pcibr_dmamap->bd_pci_addr);
+    return pcibr_dmamap->bd_pci_addr;
 }
 
 /* =====================================================================
@@ -3494,8 +2368,8 @@
     pciio_info_t            pciio_info = pciio_info_get(pconn_vhdl);
     pciio_slot_t            pciio_slot = PCIBR_INFO_SLOT_GET_INT(pciio_info);
     pcibr_soft_t            pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info);
-    bridgereg_t             devreg;
-    unsigned long           s;
+    uint64_t		    devreg;
+    unsigned long	    s;
 
     /*
      * Bridge supports hardware swapping; so we can always
@@ -3514,102 +2388,17 @@
      * have to change the logic here.
      */
     if (pcibr_soft->bs_slot[pciio_slot].bss_device != devreg) {
-	bridge_t               *bridge = pcibr_soft->bs_base;
-
-	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_endian_set: Device(%d): %x\n", pciio_slot, devreg);
-    return desired_end;
-}
-
-/* This (re)sets the GBR and REALTIME bits and also keeps track of how
- * many sets are outstanding. Reset succeeds only if the number of outstanding
- * sets == 1.
- */
-int
-pcibr_priority_bits_set(pcibr_soft_t pcibr_soft,
-			pciio_slot_t pciio_slot,
-			pciio_priority_t device_prio)
-{
-    unsigned long           s;
-    int                    *counter;
-    bridgereg_t             rtbits = 0;
-    bridgereg_t             devreg;
-    int                     rc = PRIO_SUCCESS;
-
-    /* in dual-slot configurations, the host and the
-     * guest have separate DMA resources, so they
-     * have separate requirements for priority bits.
-     */
-
-    counter = &(pcibr_soft->bs_slot[pciio_slot].bss_pri_uctr);
-
-    /*
-     * Bridge supports PCI notions of LOW and HIGH priority
-     * arbitration rings via a "REAL_TIME" bit in the per-device
-     * Bridge register. The "GBR" bit controls access to the GBR
-     * ring on the xbow. These two bits are (re)set together.
-     *
-     * XXX- Bug in Rev B Bridge Si:
-     * Symptom: Prefetcher starts operating incorrectly. This happens
-     * due to corruption of the address storage ram in the prefetcher
-     * when a non-real time PCI request is pulled and a real-time one is
-     * put in it's place. Workaround: Use only a single arbitration ring
-     * on PCI bus. GBR and RR can still be uniquely used per
-     * device. NETLIST MERGE DONE, WILL BE FIXED IN REV C.
-     */
-
-    if (pcibr_soft->bs_rev_num != BRIDGE_PART_REV_B)
-	rtbits |= BRIDGE_DEV_RT;
-
-    /* NOTE- if we ever put DEV_RT or DEV_GBR on
-     * the disabled list, we will have to take
-     * it into account here.
-     */
-
-    s = pcibr_lock(pcibr_soft);
-    devreg = pcibr_soft->bs_slot[pciio_slot].bss_device;
-    if (device_prio == PCI_PRIO_HIGH) {
-	if ((++*counter == 1)) {
-	    if (rtbits)
-		devreg |= rtbits;
-	    else
-		rc = PRIO_FAIL;
-	}
-    } else if (device_prio == PCI_PRIO_LOW) {
-	if (*counter <= 0)
-	    rc = PRIO_FAIL;
-	else if (--*counter == 0)
-	    if (rtbits)
-		devreg &= ~rtbits;
-    }
-    if (pcibr_soft->bs_slot[pciio_slot].bss_device != devreg) {
-	bridge_t               *bridge = pcibr_soft->bs_base;
-
-	bridge->b_device[pciio_slot].reg = devreg;
+	pcireg_device_set(pcibr_soft, pciio_slot, devreg);
 	pcibr_soft->bs_slot[pciio_slot].bss_device = devreg;
-	bridge->b_wid_tflush;		/* wait until Bridge PIO complete */
+	pcireg_tflush_get(pcibr_soft);
     }
     pcibr_unlock(pcibr_soft, s);
 
-    return rc;
-}
-
-pciio_priority_t
-pcibr_priority_set(vertex_hdl_t pconn_vhdl,
-		   pciio_priority_t device_prio)
-{
-    pciio_info_t            pciio_info = pciio_info_get(pconn_vhdl);
-    pciio_slot_t            pciio_slot = PCIBR_INFO_SLOT_GET_INT(pciio_info);
-    pcibr_soft_t            pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info);
-
-    (void) pcibr_priority_bits_set(pcibr_soft, pciio_slot, device_prio);
+    PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_DEVREG, pconn_vhdl,
+    		"pcibr_endian_set: Device(%d): 0x%x\n",
+		pciio_slot, devreg));
 
-    return device_prio;
+    return desired_end;
 }
 
 /*
@@ -3630,8 +2419,8 @@
     pciio_info_t            pciio_info = pciio_info_get(pconn_vhdl);
     pciio_slot_t            pciio_slot = PCIBR_INFO_SLOT_GET_INT(pciio_info);
     pcibr_soft_t            pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info);
-    bridgereg_t             set = 0;
-    bridgereg_t             clr = 0;
+    uint64_t		    set = 0;
+    uint64_t		    clr = 0;
 
     ASSERT((flags & PCIBR_DEVICE_FLAGS) == flags);
 
@@ -3640,11 +2429,6 @@
     if (flags & PCIBR_NOWRITE_GATHER)
 	clr |= BRIDGE_DEV_PMU_WRGA_EN;
 
-    if (flags & PCIBR_WRITE_GATHER)
-	set |= BRIDGE_DEV_DIR_WRGA_EN;
-    if (flags & PCIBR_NOWRITE_GATHER)
-	clr |= BRIDGE_DEV_DIR_WRGA_EN;
-
     if (flags & PCIBR_PREFETCH)
 	set |= BRIDGE_DEV_PREF;
     if (flags & PCIBR_NOPREFETCH)
@@ -3665,19 +2449,22 @@
     if (flags & PCIBR_NO64BIT)
 	clr |= BRIDGE_DEV_DEV_SIZE;
 
+    /* PIC BRINGUP WAR (PV# 878674):   Don't allow 64bit PIO accesses */
+    if ((flags & PCIBR_64BIT) && PCIBR_WAR_ENABLED(PV878674, pcibr_soft)) {
+	set &= ~BRIDGE_DEV_DEV_SIZE;
+    }
+
     if (set || clr) {
-	bridgereg_t             devreg;
-	unsigned long           s;
+	uint64_t		devreg;
+	unsigned long		s;
 
 	s = pcibr_lock(pcibr_soft);
 	devreg = pcibr_soft->bs_slot[pciio_slot].bss_device;
 	devreg = (devreg & ~clr) | set;
 	if (pcibr_soft->bs_slot[pciio_slot].bss_device != devreg) {
-	    bridge_t               *bridge = pcibr_soft->bs_base;
-
-	    bridge->b_device[pciio_slot].reg = devreg;
+	    pcireg_device_set(pcibr_soft, pciio_slot, devreg);
 	    pcibr_soft->bs_slot[pciio_slot].bss_device = devreg;
-	    bridge->b_wid_tflush;	/* wait until Bridge PIO complete */
+	    pcireg_tflush_get(pcibr_soft);
 	}
 	pcibr_unlock(pcibr_soft, s);
 
@@ -3685,7 +2472,7 @@
 		    "pcibr_device_flags_set: Device(%d): 0x%x\n",
 		    pciio_slot, devreg));
     }
-    return (1);
+    return 1;
 }
 
 /*
@@ -3711,7 +2498,7 @@
 	    printk(KERN_WARNING
 		"%lx: Must oversubscribe Read Buffer Attribute Registers"
 		"(RBAR).  Bus has %d RBARs but %d funcs need them.\n",
-		(unsigned long)pcibr_soft->bs_vhdl, NUM_RBAR, pcibr_soft->bs_pcix_num_funcs);
+		pcibr_soft->bs_name, NUM_RBAR, pcibr_soft->bs_pcix_num_funcs);
 	    percent_allowed = 0;
 	} else {
 	    percent_allowed = (((NUM_RBAR-pcibr_soft->bs_pcix_num_funcs)*100) /
@@ -3728,51 +2515,12 @@
 	    percent_allowed=(percent_allowed > 100) ? 100 : percent_allowed+1;
 	}
     } else {
-	return(ENODEV);
+	return -ENODEV;
     }
 
-    return(percent_allowed);
+    return percent_allowed;
 }
 
-pciio_provider_t        pcibr_provider =
-{
-    (pciio_piomap_alloc_f *) pcibr_piomap_alloc,
-    (pciio_piomap_free_f *) pcibr_piomap_free,
-    (pciio_piomap_addr_f *) pcibr_piomap_addr,
-    (pciio_piomap_done_f *) pcibr_piomap_done,
-    (pciio_piotrans_addr_f *) pcibr_piotrans_addr,
-    (pciio_piospace_alloc_f *) pcibr_piospace_alloc,
-    (pciio_piospace_free_f *) pcibr_piospace_free,
-
-    (pciio_dmamap_alloc_f *) pcibr_dmamap_alloc,
-    (pciio_dmamap_free_f *) pcibr_dmamap_free,
-    (pciio_dmamap_addr_f *) pcibr_dmamap_addr,
-    (pciio_dmamap_done_f *) pcibr_dmamap_done,
-    (pciio_dmatrans_addr_f *) pcibr_dmatrans_addr,
-    (pciio_dmamap_drain_f *) pcibr_dmamap_drain,
-    (pciio_dmaaddr_drain_f *) pcibr_dmaaddr_drain,
-    (pciio_dmalist_drain_f *) pcibr_dmalist_drain,
-
-    (pciio_intr_alloc_f *) pcibr_intr_alloc,
-    (pciio_intr_free_f *) pcibr_intr_free,
-    (pciio_intr_connect_f *) pcibr_intr_connect,
-    (pciio_intr_disconnect_f *) pcibr_intr_disconnect,
-    (pciio_intr_cpu_get_f *) pcibr_intr_cpu_get,
-
-    (pciio_provider_startup_f *) pcibr_provider_startup,
-    (pciio_provider_shutdown_f *) pcibr_provider_shutdown,
-    (pciio_reset_f *) pcibr_reset,
-    (pciio_write_gather_flush_f *) pcibr_write_gather_flush,
-    (pciio_endian_set_f *) pcibr_endian_set,
-    (pciio_priority_set_f *) pcibr_priority_set,
-    (pciio_config_get_f *) pcibr_config_get,
-    (pciio_config_set_f *) pcibr_config_set,
-    (pciio_error_extract_f *) 0,
-    (pciio_driver_reg_callback_f *) 0,
-    (pciio_driver_unreg_callback_f *) 0,
-    (pciio_device_unregister_f 	*) pcibr_device_unregister,
-};
-
 /*
  * pcibr_debug() is used to print pcibr debug messages to the console.  A
  * user enables tracing by setting the following global variables:
@@ -3794,6 +2542,7 @@
 {
     char hwpath[MAXDEVNAME] = "\0";
     char copy_of_hwpath[MAXDEVNAME];
+    char *buffer;
     char *module = "all";
     short widget = -1;
     short slot = -1;
@@ -3836,38 +2585,59 @@
             (!strcmp(module, pcibr_debug_module) &&
              (widget == pcibr_debug_widget) &&
              (slot == pcibr_debug_slot))) {
-#ifdef LATER
-            printk("PCIBR_DEBUG<%d>\t: %s :", cpuid(), hwpath);
-#else
-            printk("PCIBR_DEBUG\t: %s :", hwpath);
-#endif
-	    /*
-	     * Kernel printk translates to this 3 line sequence.
-	     * Since we have a variable length argument list, we
-	     * need to call printk this way rather than directly
-	     */
-	    {
-		char buffer[500];
 
+	    buffer = kmalloc(1024, GFP_KERNEL);
+	    if (buffer) {
+		printk("PCIBR_DEBUG<%d>\t: %s :", smp_processor_id(), hwpath);
+		/*
+		 * KERN_MSG translates to this 3 line sequence. Since
+		 * we have a variable length argument list, we need to
+		 * call KERN_MSG this way rather than directly
+		 */
 		va_start(ap, format);
-		vsnprintf(buffer, 500, format, ap);
+		memset(buffer, 0, 1024);
+		vsnprintf(buffer, 1024, format, ap);
 		va_end(ap);
-		buffer[499] = (char)0;	/* just to be safe */
-		printk("%s", buffer);
+		printk("", "%s", buffer);
+		kfree(buffer);
 	    }
         }
     }
 }
 
+/*
+ * given a xconn_vhdl and a bus number under that widget, return a 
+ * bridge_t pointer.
+ */
+void *
+pcibr_bridge_ptr_get(vertex_hdl_t widget_vhdl, int bus_num)
+{
+    void       *bridge;
+
+    bridge = (void *)xtalk_piotrans_addr(widget_vhdl, 0, 0, 
+							sizeof(bridge), 0);
+
+    /* PIC ASIC has two bridges (ie. two buses) under a single widget */
+    if (bus_num == 1) {
+	bridge = (void *)((char *)bridge + PIC_BUS1_OFFSET);
+    }
+    return bridge;
+}		
+
+
 int
-isIO9(nasid_t nasid) {
+isIO9(nasid_t nasid)
+{
 	lboard_t *brd = (lboard_t *)KL_CONFIG_INFO(nasid);
 
 	while (brd) {
 		if (brd->brd_flags & LOCAL_MASTER_IO6) {
 			return 1;
 		}
-		brd = KLCF_NEXT(brd);
+                if (numionodes == numnodes)
+                        brd = KLCF_NEXT_ANY(brd);
+                else
+                        brd = KLCF_NEXT(brd);
 	}
 	/* if it's dual ported, check the peer also */
 	nasid = NODEPDA(NASID_TO_COMPACT_NODEID(nasid))->xbow_peer;
@@ -3877,7 +2647,11 @@
 		if (brd->brd_flags & LOCAL_MASTER_IO6) {
 			return 1;
 		}
-		brd = KLCF_NEXT(brd);
+                if (numionodes == numnodes)
+                        brd = KLCF_NEXT_ANY(brd);
+                else
+                        brd = KLCF_NEXT(brd);
+
 	}
 	return 0;
 }
--- diff/arch/ia64/sn/io/sn2/pcibr/pcibr_error.c	2004-02-09 10:36:07.000000000 +0000
+++ source/arch/ia64/sn/io/sn2/pcibr/pcibr_error.c	2004-02-09 10:39:51.000000000 +0000
@@ -45,7 +45,7 @@
                                    BRIDGE_ISR_PCIBUS_PIOERR;
 #endif
 
-int                     pcibr_llp_control_war_cnt; /* PCIBR_LLP_CONTROL_WAR */
+int pcibr_pioerr_dump = 1;	/* always dump pio errors */
 
 /*
  * register values
@@ -107,29 +107,22 @@
 
 #define F(s,n)          { 1l<<(s),-(s), n }
 
-static struct reg_values       space_v[] =
-{
-    {PCIIO_SPACE_NONE, "none"},
-    {PCIIO_SPACE_ROM, "ROM"},
-    {PCIIO_SPACE_IO, "I/O"},
-    {PCIIO_SPACE_MEM, "MEM"},
-    {PCIIO_SPACE_MEM32, "MEM(32)"},
-    {PCIIO_SPACE_MEM64, "MEM(64)"},
-    {PCIIO_SPACE_CFG, "CFG"},
-    {PCIIO_SPACE_WIN(0), "WIN(0)"},
-    {PCIIO_SPACE_WIN(1), "WIN(1)"},
-    {PCIIO_SPACE_WIN(2), "WIN(2)"},
-    {PCIIO_SPACE_WIN(3), "WIN(3)"},
-    {PCIIO_SPACE_WIN(4), "WIN(4)"},
-    {PCIIO_SPACE_WIN(5), "WIN(5)"},
-    {PCIIO_SPACE_BAD, "BAD"},
-    {0}
-};
-struct reg_desc         space_desc[] =
-{
-    {0xFF, 0, "space", 0, space_v},
-    {0}
-};
+char *pci_space[] = {"NONE",
+                     "ROM",
+                     "IO",
+                     "",
+                     "MEM",
+                     "MEM32",
+                     "MEM64",
+                     "CFG",
+                     "WIN0",
+                     "WIN1",
+                     "WIN2",
+                     "WIN3",
+                     "WIN4",
+                     "WIN5",
+                     "",
+                     "BAD"};
 
 static char             *pcibr_isr_errs[] =
 {
@@ -261,7 +254,7 @@
 static void
 pcibr_show_dir_state(paddr_t paddr, char *prefix)
 {
-#ifdef LATER
+#ifdef PCIBR_LATER
 	int state;
 	uint64_t vec_ptr;
 	hubreg_t elo;
@@ -270,15 +263,18 @@
 
 	get_dir_ent(paddr, &state, &vec_ptr, &elo);
 
-	printk("%saddr 0x%lx: state 0x%x owner 0x%lx (%s)\n", 
-		prefix, paddr, state, vec_ptr, dir_state_str[state]);
-#endif
+	printf("%saddr 0x%lx: state 0x%x owner 0x%lx (%s)\n", 
+		prefix, (uint64_t)paddr, state, (uint64_t)vec_ptr, 
+		dir_state_str[state]);
+#endif /* PCIBR_LATER */
 }
 
-static void
-print_bridge_errcmd(uint32_t cmdword, char *errtype)
+
+void
+print_bridge_errcmd(pcibr_soft_t pcibr_soft, uint32_t cmdword, char *errtype)
 {
-    printk("\t    Bridge %s Error Command Word Register ", errtype);
+    printk(
+	    "\t    Bridge %sError Command Word Register ", errtype);
     print_register(cmdword, xtalk_cmd_bits);
 }
 
@@ -290,20 +286,12 @@
 void
 pcibr_error_dump(pcibr_soft_t pcibr_soft)
 {
-    bridge_t               *bridge = pcibr_soft->bs_base;
     uint64_t		    int_status;
-    picreg_t		    int_status_64;
     uint64_t		    mult_int;
-    picreg_t		    mult_int_64;
     uint64_t		    bit;
-    int			    number_bits;
     int                     i;
-    char		    *reg_desc;
-    paddr_t		    addr = (paddr_t)0;
 
-    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;
+    int_status = (pcireg_intr_status_get(pcibr_soft) & ~BRIDGE_ISR_INT_MSK);
 
     if (!int_status) {
 	/* No error bits set */
@@ -320,21 +308,11 @@
 	    int_status, pcibr_soft->bs_name,
 	    "PIC");
 
-    for (i = PCIBR_ISR_ERR_START; i < number_bits; i++) {
+    for (i = PCIBR_ISR_ERR_START; i < 64; i++) {
 	bit = 1ull << i;
 
-	/*
-	 * A number of int_status bits are only defined for Bridge.
-	 * Ignore them in the case of an XBridge or PIC.
-	 */
-	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 (((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) ||
@@ -351,14 +329,14 @@
 
 	    case PIC_ISR_INT_RAM_PERR:	    /* bit41	INT_RAM_PERR */
 		/* XXX: should breakdown meaning of bits in reg */
-		printk( "\t	Internal RAM Parity Error: 0x%lx\n",
-		    bridge->p_ate_parity_err_64);
+		printk("\t	Internal RAM Parity Error: 0x%lx\n",
+		    pcireg_parity_err_get(pcibr_soft));
 		break;
 
 	    case PIC_ISR_PCIX_ARB_ERR:	    /* bit40	PCI_X_ARB_ERR */
 		/* XXX: should breakdown meaning of bits in reg */
-		printk( "\t	Arbitration Reg: 0x%lx\n",
-		    bridge->b_arb);
+		printk("\t	Arbitration Reg: 0x%lx\n",
+		    pcireg_arbitration_get(pcibr_soft));
 		break;
 
 	    case PIC_ISR_PCIX_REQ_TOUT:	    /* bit39	PCI_X_REQ_TOUT */
@@ -366,8 +344,8 @@
 		printk(
 		    "\t	   PCI-X DMA Request Error Address 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);
+		    pcireg_pcix_req_err_addr_get(pcibr_soft),
+		    pcireg_pcix_req_err_attr_get(pcibr_soft));
 		break;
 
 	    case PIC_ISR_PCIX_SPLIT_MSG_PE: /* bit45	PCI_X_SPLIT_MES_PE */
@@ -377,8 +355,8 @@
 		printk(
 		    "\t	   PCI-X Split Request Address Reg: 0x%lx\n"
 		    "\t	   PCI-X Split Request Attribute Reg: 0x%lx\n",
-		    bridge->p_pcix_pio_split_addr_64,
-		    bridge->p_pcix_pio_split_attr_64);
+		    pcireg_pcix_pio_split_addr_get(pcibr_soft),
+		    pcireg_pcix_pio_split_attr_get(pcibr_soft));
 		/* FALL THRU */
 
 	    case PIC_ISR_PCIX_UNEX_COMP:    /* bit42	PCI_X_UNEX_COMP */
@@ -394,20 +372,19 @@
 		    "\t	   PCI-X Bus Error Address Reg: 0x%lx\n"
 		    "\t	   PCI-X Bus Error Attribute Reg: 0x%lx\n"
 		    "\t	   PCI-X Bus Error Data Reg: 0x%lx\n",
-		    bridge->p_pcix_bus_err_addr_64,
-		    bridge->p_pcix_bus_err_attr_64,
-		    bridge->p_pcix_bus_err_data_64);
+		    pcireg_pcix_bus_err_addr_get(pcibr_soft),
+		    pcireg_pcix_bus_err_attr_get(pcibr_soft),
+		    pcireg_pcix_bus_err_data_get(pcibr_soft));
 		break;
 
-	    case BRIDGE_ISR_PAGE_FAULT:	    /* bit30	PMU_PAGE_FAULT */
-	        reg_desc = "Map Fault Address";
-
-		printk( "\t    %s Register: 0x%x\n", reg_desc,
-		    bridge->b_ram_perr_or_map_fault);
+	    case BRIDGE_ISR_PAGE_FAULT:	/* bit30    PMU_PAGE_FAULT */
+		printk("\t    Map Fault Address Reg: 0x%lx\n",
+		    pcireg_map_fault_get(pcibr_soft));
 		break;
 
-	    case BRIDGE_ISR_UNEXP_RESP:    /* bit29	UNEXPECTED_RESP */
-		print_bridge_errcmd(bridge->b_wid_aux_err, "Aux ");
+	    case BRIDGE_ISR_UNEXP_RESP:		/* bit29    UNEXPECTED_RESP */
+		print_bridge_errcmd(pcibr_soft,
+			    pcireg_linkside_err_get(pcibr_soft), "Aux ");
 
 		/* PIC in PCI-X mode, dump the PCIX DMA Request registers */
 		if (IS_PCIX(pcibr_soft)) {
@@ -415,96 +392,98 @@
 		    printk( 
 			"\t    PCI-X DMA Request Error Addr Reg: 0x%lx\n"
 			"\t    PCI-X DMA Request Error Attr Reg: 0x%lx\n",
-			bridge->p_pcix_dma_req_err_addr_64,
-			bridge->p_pcix_dma_req_err_attr_64);
+			pcireg_pcix_req_err_addr_get(pcibr_soft),
+			pcireg_pcix_req_err_attr_get(pcibr_soft));
 		}
 		break;
 
-	    case BRIDGE_ISR_BAD_XRESP_PKT:  /* bit28	BAD_RESP_PACKET */
-	    case BRIDGE_ISR_RESP_XTLK_ERR:  /* bit26	RESP_XTALK_ERROR */
-	        print_bridge_errcmd(bridge->b_wid_aux_err, "Aux ");
+	    case BRIDGE_ISR_BAD_XRESP_PKT:	/* bit28    BAD_RESP_PACKET */
+	    case BRIDGE_ISR_RESP_XTLK_ERR:	/* bit26    RESP_XTALK_ERROR */
+		print_bridge_errcmd(pcibr_soft,
+				pcireg_linkside_err_get(pcibr_soft), "Aux ");
 		 
-		/* XXX: should breakdown meaning of attribute bit */
-		printk( 
+		/* PCI-X mode, DMA Request Error registers are valid.  But
+		 * in PCI mode, Response Buffer Address register are valid.
+		 */
+		if (IS_PCIX(pcibr_soft)) {
+		    /* 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);
-		if (bit == BRIDGE_ISR_RESP_XTLK_ERR) {
+			pcireg_pcix_req_err_addr_get(pcibr_soft),
+			pcireg_pcix_req_err_attr_get(pcibr_soft));
+		} else {
+		    printk(
+		        "\t    Bridge Response Buf Error Addr Reg: 0x%lx\n"
+		        "\t    dev-num %d buff-num %d addr 0x%lx\n",
+			pcireg_resp_err_get(pcibr_soft),
+			(int)pcireg_resp_err_dev_get(pcibr_soft),
+			(int)pcireg_resp_err_buf_get(pcibr_soft),
+			pcireg_resp_err_addr_get(pcibr_soft));
+		    if (bit == BRIDGE_ISR_RESP_XTLK_ERR) {
 			/* display memory directory associated with cacheline */
-			pcibr_show_dir_state(addr, "\t    ");
+			pcibr_show_dir_state(
+				    pcireg_resp_err_get(pcibr_soft), "\t    ");
+		    }
 		}
 		break;
 
-	    case BRIDGE_ISR_BAD_XREQ_PKT:   /* bit27	BAD_XREQ_PACKET */
-	    case BRIDGE_ISR_REQ_XTLK_ERR:   /* bit25	REQ_XTALK_ERROR */
-	    case BRIDGE_ISR_INVLD_ADDR:	    /* bit24	INVALID_ADDRESS */
-		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"
+	    case BRIDGE_ISR_BAD_XREQ_PKT:	/* bit27    BAD_XREQ_PACKET */
+	    case BRIDGE_ISR_REQ_XTLK_ERR:	/* bit25    REQ_XTALK_ERROR */
+	    case BRIDGE_ISR_INVLD_ADDR:		/* bit24    INVALID_ADDRESS */
+		print_bridge_errcmd(pcibr_soft,
+				pcireg_cmdword_err_get(pcibr_soft), "");
+		printk(
+		    "\t    Bridge Error 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));
+		    pcireg_bus_err_get(pcibr_soft),
+		    pcireg_bus_err_get(pcibr_soft));
 		break;
 
-	    case BRIDGE_ISR_UNSUPPORTED_XOP:/* bit23	UNSUPPORTED_XOP */
-		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);
+	    case BRIDGE_ISR_UNSUPPORTED_XOP:	/* bit23    UNSUPPORTED_XOP */
+		print_bridge_errcmd(pcibr_soft,
+				pcireg_linkside_err_get(pcibr_soft), "Aux ");
+		printk("\t    Address Holding Link Side Error Reg: 0x%lx\n",
+			pcireg_linkside_err_addr_get(pcibr_soft));
 		break;
 
-	    case BRIDGE_ISR_XREQ_FIFO_OFLOW:/* bit22	XREQ_FIFO_OFLOW */
-		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);
+	    case BRIDGE_ISR_XREQ_FIFO_OFLOW:	/* bit22    XREQ_FIFO_OFLOW */
+		print_bridge_errcmd(pcibr_soft,
+				pcireg_linkside_err_get(pcibr_soft), "Aux ");
+		printk("\t    Address Holding Link Side Error Reg: 0x%lx\n",
+			pcireg_linkside_err_addr_get(pcibr_soft));
 		break;
 
-	    case BRIDGE_ISR_PCI_ABORT:	    /* bit15	PCI_ABORT */
-	    case BRIDGE_ISR_PCI_PARITY:	    /* bit14	PCI_PARITY */
-	    case BRIDGE_ISR_PCI_SERR:	    /* bit13	PCI_SERR */
-	    case BRIDGE_ISR_PCI_PERR:	    /* bit12	PCI_PERR */
-	    case BRIDGE_ISR_PCI_MST_TIMEOUT:/* bit11	PCI_MASTER_TOUT */
-	    case BRIDGE_ISR_PCI_RETRY_CNT:  /* bit10	PCI_RETRY_CNT */
-	    case BRIDGE_ISR_GIO_B_ENBL_ERR: /* bit08	GIO BENABLE_ERR */
-		printk( 
-		    "\t    PCI Error Upper Address Register: 0x%lx\n"
-		    "\t    PCI Error Lower Address Register: 0x%lx\n"
+	    case BRIDGE_ISR_PCI_ABORT:		/* bit15    PCI_ABORT */
+	    case BRIDGE_ISR_PCI_PARITY:		/* bit14    PCI_PARITY */
+	    case BRIDGE_ISR_PCI_SERR:		/* bit13    PCI_SERR */
+	    case BRIDGE_ISR_PCI_PERR:		/* bit12    PCI_PERR */
+	    case BRIDGE_ISR_PCI_MST_TIMEOUT:	/* bit11    PCI_MASTER_TOUT */
+	    case BRIDGE_ISR_PCI_RETRY_CNT:	/* bit10    PCI_RETRY_CNT */
+		printk("\t    PCI Error Address Register: 0x%lx\n"
 		    "\t    PCI Error Address: 0x%lx\n",
-		    (uint64_t) bridge->b_pci_err_upper,
-		    (uint64_t) bridge->b_pci_err_lower,
-		    (((uint64_t) bridge->b_pci_err_upper << 32) |
-		    bridge->b_pci_err_lower));
+		    pcireg_pci_bus_addr_get(pcibr_soft),
+		    pcireg_pci_bus_addr_addr_get(pcibr_soft));
 		break;
 
-	    case BRIDGE_ISR_XREAD_REQ_TIMEOUT: /* bit09	XREAD_REQ_TOUT */
-		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"
+	    case BRIDGE_ISR_XREAD_REQ_TIMEOUT:	/* bit09    XREAD_REQ_TOUT */
+		printk("\t    Bridge Response Buf Error Addr Reg: 0x%lx\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);
+		    pcireg_resp_err_get(pcibr_soft),
+		    (int)pcireg_resp_err_dev_get(pcibr_soft),
+		    (int)pcireg_resp_err_buf_get(pcibr_soft),
+		    pcireg_resp_err_get(pcibr_soft));
 		break;
 	    }
 	}
     }
 
-    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;
+    mult_int = pcireg_intr_multiple_get(pcibr_soft);
 
     if (mult_int & ~BRIDGE_ISR_INT_MSK) {
-	printk( "    %s Multiple Interrupt Register is 0x%lx\n",
-		"PIC", mult_int);
-	for (i = PCIBR_ISR_ERR_START; i < number_bits; i++) {
+	printk("    %s Multiple Interrupt Register is 0x%lx\n",
+		pcibr_soft->bs_asic_name, mult_int);
+	for (i = PCIBR_ISR_ERR_START; i < 64; i++) {
 	    if (mult_int & (1ull << i))
 		printk( "\t%s\n", pcibr_isr_errs[i]);
 	}
@@ -519,11 +498,7 @@
 static void
 pcibr_pioerr_check(pcibr_soft_t soft)
 {
-    bridge_t		   *bridge;
-    uint64_t              int_status;
-    picreg_t                int_status_64;
-    bridgereg_t		    pci_err_lower;
-    bridgereg_t		    pci_err_upper;
+    uint64_t		    int_status;
     iopaddr_t		    pci_addr;
     pciio_slot_t	    slot;
     pcibr_piomap_t	    map;
@@ -532,16 +507,10 @@
     unsigned		    win;
     int			    func;
 
-    bridge = soft->bs_base;
-    int_status_64 = (bridge->p_int_status_64 & ~BRIDGE_ISR_INT_MSK);
-    int_status = (uint64_t)int_status_64;
+    int_status = pcireg_intr_status_get(soft);
 
     if (int_status & BRIDGE_ISR_PCIBUS_PIOERR) {
-	pci_err_lower = bridge->b_pci_err_lower;
-	pci_err_upper = bridge->b_pci_err_upper;
-
-	pci_addr = pci_err_upper & BRIDGE_ERRUPPR_ADDRMASK;
-	pci_addr = (pci_addr << 32) | pci_err_lower;
+	pci_addr = pcireg_pci_bus_addr_get(soft);
 
 	slot = PCIBR_NUM_SLOTS(soft);
 	while (slot-- > 0) {
@@ -564,7 +533,7 @@
 		    else if (map->bp_space == PCIIO_SPACE_ROM)
 			base += pcibr_info->f_rbase;
 		    if ((pci_addr >= base) && (pci_addr < (base + size)))
-			atomic_inc(&map->bp_toc[0]);
+			atomic_inc(&map->bp_toc);
 		}
 	    }
 	}
@@ -595,11 +564,9 @@
 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;
-    picreg_t                int_status_64;
-    int			    number_bits;
+    void               *bridge;
+    uint64_t		    int_status;
+    uint64_t		    err_status;
     int                     i;
     uint64_t		    disable_errintr_mask = 0;
     nasid_t		    nasid;
@@ -662,9 +629,7 @@
 	return(pcibr_error_intr_handler(irq, arg, ep));
     }
 
-    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;
+    int_status = pcireg_intr_status_get(pcibr_soft);
 
     PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_INTR_ERROR, pcibr_soft->bs_conn,
 		"pcibr_error_intr_handler: int_status=0x%lx\n", int_status));
@@ -672,7 +637,7 @@
     /* int_status is which bits we have to clear;
      * err_status is the bits we haven't handled yet.
      */
-    err_status = int_status & ~BRIDGE_ISR_MULTI_ERR;
+    err_status = int_status;
 
     if (!(int_status & ~BRIDGE_ISR_INT_MSK)) {
 	/*
@@ -688,9 +653,10 @@
     }
 
     if (err_status) {
-	struct bs_errintr_stat_s *bs_estat = pcibr_soft->bs_errintr_stat;
+	struct bs_errintr_stat_s *bs_estat ;
+        bs_estat = &pcibr_soft->bs_errintr_stat[PCIBR_ISR_ERR_START];
 
-	for (i = PCIBR_ISR_ERR_START; i < number_bits; i++, bs_estat++) {
+	for (i = PCIBR_ISR_ERR_START; i < 64; i++, bs_estat++) {
 	    if (err_status & (1ull << i)) {
 		uint32_t              errrate = 0;
 		uint32_t              errcount = 0;
@@ -827,7 +793,7 @@
 	 * could eat up too much cpu time.
 	 */
 	s = pcibr_lock(pcibr_soft);
-	bridge->p_int_enable_64 &= (picreg_t)(~disable_errintr_mask);
+	pcireg_intr_enable_bit_clr(pcibr_soft, disable_errintr_mask);
 	pcibr_unlock(pcibr_soft, s);
     }
     /*
@@ -836,31 +802,22 @@
      * which will cause a BRIDGE_ISR_INVLD_ADDR.
      */
     if ((err_status & BRIDGE_ISR_INVLD_ADDR) &&
-	(0x00000000 == bridge->b_wid_err_upper) &&
-	(0x00C00000 == (0xFFC00000 & bridge->b_wid_err_lower)) &&
-	(0x00402000 == (0x00F07F00 & bridge->b_wid_err_cmdword))) {
+	(0x00C00000 == (pcireg_bus_err_get(pcibr_soft) & 0xFFFFFFFFFFC00000)) &&
+	(0x00402000 == (0x00F07F00 & pcireg_cmdword_err_get(pcibr_soft)))) {
 	err_status &= ~BRIDGE_ISR_INVLD_ADDR;
     }
     /*
-     * The bridge bug (PCIBR_LLP_CONTROL_WAR), where the llp_config or control registers
-     * need to be read back after being written, affects an MP
-     * system since there could be small windows between writing
-     * the register and reading it back on one cpu while another
-     * cpu is fielding an interrupt. If we run into this scenario,
-     * workaround the problem by ignoring the error. (bug 454474)
-     * pcibr_llp_control_war_cnt keeps an approximate number of
-     * times we saw this problem on a system.
+     * pcibr_pioerr_dump is a systune that make be used to not
+     * print bridge registers for interrupts generated by pio-errors.
+     * Some customers do early probes and expect a lot of failed
+     * pios.
      */
-
-    if ((err_status & BRIDGE_ISR_INVLD_ADDR) &&
-	((((uint64_t) bridge->b_wid_err_upper << 32) | (bridge->b_wid_err_lower))
-	 == (BRIDGE_INT_RST_STAT & 0xff0))) {
-	pcibr_llp_control_war_cnt++;
-	err_status &= ~BRIDGE_ISR_INVLD_ADDR;
+    if (!pcibr_pioerr_dump) {
+	bridge_errors_to_dump &= ~BRIDGE_ISR_PCIBUS_PIOERR;
+    } else {
+	bridge_errors_to_dump |= BRIDGE_ISR_PCIBUS_PIOERR;
     }
 
-    bridge_errors_to_dump |= BRIDGE_ISR_PCIBUS_PIOERR;
-
     /* Dump/Log Bridge error interrupt info */
     if (err_status & bridge_errors_to_dump) {
 	printk("BRIDGE ERR_STATUS 0x%lx\n", err_status);
@@ -873,10 +830,11 @@
      * has only been seen in simulation
      */
     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);
-        panic("PCI Bridge Error interrupt killed the system");
+	(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);
+	/* machine_error_dump(""); */
+	panic("PCI Bridge Error interrupt killed the system");
     }
 
     if (err_status & BRIDGE_ISR_ERROR_FATAL) {
@@ -893,7 +851,7 @@
      * 
      * PIC doesn't require groups of interrupts to be cleared...
      */
-    bridge->p_int_rst_stat_64 = (picreg_t)(int_status | BRIDGE_IRR_MULTI_CLR);
+    pcireg_intr_reset_set(pcibr_soft, (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
@@ -901,7 +859,7 @@
      */
     if ((err_status & PIC_ISR_PCIX_ARB_ERR) &&
 		PCIBR_WAR_ENABLED(PV856155, pcibr_soft)) {
-	bridge->b_arb |= (0xf << 20);
+	pcireg_arbitration_bit_set(pcibr_soft, (0xf << 20));
     }
 
     /* Zero out bserr_intstat field */
@@ -909,18 +867,196 @@
     return IRQ_HANDLED;
 }
 
+/*
+ * pcibr_addr_toslot
+ *      Given the 'pciaddr' find out which slot this address is
+ *      allocated to, and return the slot number.
+ *      While we have the info handy, construct the
+ *      function number, space code and offset as well.
+ *
+ * NOTE: if this routine is called, we don't know whether
+ * the address is in CFG, MEM, or I/O space. We have to guess.
+ * This will be the case on PIO stores, where the only way
+ * we have of getting the address is to check the Bridge, which
+ * stores the PCI address but not the space and not the xtalk
+ * address (from which we could get it).
+ */
+static int
+pcibr_addr_toslot(pcibr_soft_t pcibr_soft,
+		  iopaddr_t pciaddr,
+		  pciio_space_t *spacep,
+		  iopaddr_t *offsetp,
+		  pciio_function_t *funcp)
+{
+    int                     s, f = 0, w;
+    iopaddr_t               base;
+    size_t                  size;
+    pciio_piospace_t        piosp;
+
+    /*
+     * Check if the address is in config space
+     */
+
+    if ((pciaddr >= BRIDGE_CONFIG_BASE) && (pciaddr < BRIDGE_CONFIG_END)) {
+
+	if (pciaddr >= BRIDGE_CONFIG1_BASE)
+	    pciaddr -= BRIDGE_CONFIG1_BASE;
+	else
+	    pciaddr -= BRIDGE_CONFIG_BASE;
+
+	s = pciaddr / BRIDGE_CONFIG_SLOT_SIZE;
+	pciaddr %= BRIDGE_CONFIG_SLOT_SIZE;
+
+	if (funcp) {
+	    f = pciaddr / 0x100;
+	    pciaddr %= 0x100;
+	}
+	if (spacep)
+	    *spacep = PCIIO_SPACE_CFG;
+	if (offsetp)
+	    *offsetp = pciaddr;
+	if (funcp)
+	    *funcp = f;
+
+	return s;
+    }
+    for (s = pcibr_soft->bs_min_slot; s < PCIBR_NUM_SLOTS(pcibr_soft); ++s) {
+	int                     nf = pcibr_soft->bs_slot[s].bss_ninfo;
+	pcibr_info_h            pcibr_infoh = pcibr_soft->bs_slot[s].bss_infos;
+
+	for (f = 0; f < nf; f++) {
+	    pcibr_info_t            pcibr_info = pcibr_infoh[f];
+
+	    if (!pcibr_info)
+		continue;
+	    for (w = 0; w < 6; w++) {
+		if (pcibr_info->f_window[w].w_space
+		    == PCIIO_SPACE_NONE) {
+		    continue;
+		}
+		base = pcibr_info->f_window[w].w_base;
+		size = pcibr_info->f_window[w].w_size;
+
+		if ((pciaddr >= base) && (pciaddr < (base + size))) {
+		    if (spacep)
+			*spacep = PCIIO_SPACE_WIN(w);
+		    if (offsetp)
+			*offsetp = pciaddr - base;
+		    if (funcp)
+			*funcp = f;
+		    return s;
+		}			/* endif match */
+	    }				/* next window */
+	}				/* next func */
+    }					/* next slot */
+
+    /*
+     * Check if the address was allocated as part of the
+     * pcibr_piospace_alloc calls.
+     */
+    for (s = pcibr_soft->bs_min_slot; s < PCIBR_NUM_SLOTS(pcibr_soft); ++s) {
+	int                     nf = pcibr_soft->bs_slot[s].bss_ninfo;
+	pcibr_info_h            pcibr_infoh = pcibr_soft->bs_slot[s].bss_infos;
+
+	for (f = 0; f < nf; f++) {
+	    pcibr_info_t            pcibr_info = pcibr_infoh[f];
+
+	    if (!pcibr_info)
+		continue;
+	    piosp = pcibr_info->f_piospace;
+	    while (piosp) {
+		if ((piosp->start <= pciaddr) &&
+		    ((piosp->count + piosp->start) > pciaddr)) {
+		    if (spacep)
+			*spacep = piosp->space;
+		    if (offsetp)
+			*offsetp = pciaddr - piosp->start;
+		    return s;
+		}			/* endif match */
+		piosp = piosp->next;
+	    }				/* next piosp */
+	}				/* next func */
+    }					/* next slot */
+
+    /*
+     * Some other random address on the PCI bus ...
+     * we have no way of knowing whether this was
+     * a MEM or I/O access; so, for now, we just
+     * assume that the low 1G is MEM, the next
+     * 3G is I/O, and anything above the 4G limit
+     * is obviously MEM.
+     */
+
+    if (spacep)
+	*spacep = ((pciaddr < (1ul << 30)) ? PCIIO_SPACE_MEM :
+		   (pciaddr < (4ul << 30)) ? PCIIO_SPACE_IO :
+		   PCIIO_SPACE_MEM);
+    if (offsetp)
+	*offsetp = pciaddr;
+
+    return PCIIO_SLOT_NONE;
+
+}
+
 void
 pcibr_error_cleanup(pcibr_soft_t pcibr_soft, int error_code)
 {
-    bridge_t               *bridge = pcibr_soft->bs_base;
+    uint64_t	clr_bits = BRIDGE_IRR_ALL_CLR;
 
     ASSERT(error_code & IOECODE_PIO);
     error_code = error_code;
 
-    bridge->p_int_rst_stat_64 = BRIDGE_IRR_PCI_GRP_CLR |
-				    PIC_PCIX_GRP_CLR |
-				    BRIDGE_IRR_MULTI_CLR;
-    (void) bridge->b_wid_tflush;	/* flushbus */
+    pcireg_intr_reset_set(pcibr_soft, clr_bits);
+
+    pcireg_tflush_get(pcibr_soft);	/* flushbus */
+}
+
+
+/*
+ * pcibr_error_extract
+ *      Given the 'pcibr vertex handle' find out which slot
+ *      the bridge status error address (from pcibr_soft info
+ *      hanging off the vertex)
+ *      allocated to, and return the slot number.
+ *      While we have the info handy, construct the
+ *      space code and offset as well.
+ *
+ * NOTE: if this routine is called, we don't know whether
+ * the address is in CFG, MEM, or I/O space. We have to guess.
+ * This will be the case on PIO stores, where the only way
+ * we have of getting the address is to check the Bridge, which
+ * stores the PCI address but not the space and not the xtalk
+ * address (from which we could get it).
+ *
+ * XXX- this interface has no way to return the function
+ * number on a multifunction card, even though that data
+ * is available.
+ */
+
+pciio_slot_t
+pcibr_error_extract(vertex_hdl_t pcibr_vhdl,
+		    pciio_space_t *spacep,
+		    iopaddr_t *offsetp)
+{
+    pcibr_soft_t            pcibr_soft = 0;
+    iopaddr_t               bserr_addr;
+    pciio_slot_t            slot = PCIIO_SLOT_NONE;
+    arbitrary_info_t	    rev;
+
+    /* Do a sanity check as to whether we really got a 
+     * bridge vertex handle.
+     */
+    if (hwgraph_info_get_LBL(pcibr_vhdl, INFO_LBL_PCIBR_ASIC_REV, &rev) !=
+	GRAPH_SUCCESS) 
+	return(slot);
+
+    pcibr_soft = pcibr_soft_get(pcibr_vhdl);
+    if (pcibr_soft) {
+	bserr_addr = pcireg_pci_bus_addr_get(pcibr_soft);
+	slot = pcibr_addr_toslot(pcibr_soft, bserr_addr,
+				 spacep, offsetp, NULL);
+    }
+    return slot;
 }
 
 /*ARGSUSED */
@@ -953,6 +1089,28 @@
  *      to handle the error, it expects the bus-interface to disable that
  *      device, and takes any steps needed here to take away any resources
  *      associated with this device.
+ *
+ * A note about slots:
+ *
+ * 	PIC-based bridges use zero-based device numbering when devices to
+ * 	internal registers.  However, the physical slots are numbered using a
+ *	one-based scheme because in PCI-X, device 0 is reserved (see comments
+ * 	in pcibr_private.h for a better description).
+ *
+ * 	When building up the hwgraph, we use the external (one-based) number
+ *	scheme when numbering slot components so that hwgraph more accuratly
+ * 	reflects what is silkscreened on the bricks.
+ *
+ * 	Since pciio_error_handler() needs to ultimatly be able to do a hwgraph
+ *	lookup, the ioerror that gets built up in pcibr_pioerror() encodes the
+ *	external (one-based) slot number.  However, loops in pcibr_pioerror() 
+ * 	which attempt to translate the virtual address into the correct
+ * 	PCI physical address use the device (zero-based) numbering when 
+ * 	walking through bridge structures.
+ *
+ * 	To that end, pcibr_pioerror() uses device to denote the 
+ *	zero-based device number, and external_slot to denote the corresponding
+ *	one-based slot number.  Loop counters (eg. cs) are always device based.
  */
 
 /* BEM_ADD_IOE doesn't dump the whole ioerror, it just
@@ -1017,7 +1175,8 @@
     iopaddr_t               raw_paddr;	/* raw PCI address */
 
     pciio_space_t           space;	/* final PCI space */
-    pciio_slot_t            slot;	/* final PCI slot, if appropriate */
+    pciio_slot_t            device;	/* final PCI device if appropriate */
+    pciio_slot_t            external_slot;/* external slot for device */
     pciio_function_t        func;	/* final PCI func, if appropriate */
     iopaddr_t               offset;	/* final PCI offset */
     
@@ -1039,16 +1198,16 @@
                 "pcibr_pioerror: pcibr_soft=0x%lx, bad_xaddr=0x%lx\n",
 		pcibr_soft, bad_xaddr));
 
-    slot = PCIIO_SLOT_NONE;
+    device = PCIIO_SLOT_NONE;
     func = PCIIO_FUNC_NONE;
     raw_space = PCIIO_SPACE_NONE;
     raw_paddr = 0;
 
-    if ((bad_xaddr >= PCIBR_BUS_TYPE0_CFG_DEV0(pcibr_soft)) &&
+    if ((bad_xaddr >= PCIBR_BUS_TYPE0_CFG_DEV(pcibr_soft, 0)) &&
 	(bad_xaddr < PCIBR_TYPE1_CFG(pcibr_soft))) {
-	raw_paddr = bad_xaddr - PCIBR_BUS_TYPE0_CFG_DEV0(pcibr_soft);
-	slot = raw_paddr / BRIDGE_TYPE0_CFG_SLOT_OFF;
-	raw_paddr = raw_paddr % BRIDGE_TYPE0_CFG_SLOT_OFF;
+	raw_paddr = bad_xaddr - PCIBR_BUS_TYPE0_CFG_DEV(pcibr_soft, 0);
+	device = raw_paddr / BRIDGE_CONFIG_SLOT_SIZE;
+	raw_paddr = raw_paddr % BRIDGE_CONFIG_SLOT_SIZE;
 	raw_space = PCIIO_SPACE_CFG;
     }
     if ((bad_xaddr >= PCIBR_TYPE1_CFG(pcibr_soft)) &&
@@ -1060,11 +1219,11 @@
 	raw_paddr = bad_xaddr - PCIBR_TYPE1_CFG(pcibr_soft);
 	raw_space = PCIIO_SPACE_CFG;
     }
-    if ((bad_xaddr >= PCIBR_BRIDGE_DEVIO0(pcibr_soft)) &&
+    if ((bad_xaddr >= PCIBR_BRIDGE_DEVIO(pcibr_soft, 0)) &&
 	(bad_xaddr < PCIBR_BRIDGE_DEVIO(pcibr_soft, BRIDGE_DEV_CNT))) {
 	int                     x;
 
-	raw_paddr = bad_xaddr - PCIBR_BRIDGE_DEVIO0(pcibr_soft);
+	raw_paddr = bad_xaddr - PCIBR_BRIDGE_DEVIO(pcibr_soft, 0);
 	x = raw_paddr / BRIDGE_DEVIO_OFF;
 	raw_paddr %= BRIDGE_DEVIO_OFF;
 	/* first two devio windows are double-sized */
@@ -1101,25 +1260,37 @@
 	} else
 	    raw_paddr += pcibr_soft->bs_slot[x].bss_devio.bssd_base;
     }
-    if ((bad_xaddr >= BRIDGE_PCI_MEM32_BASE) &&
-	(bad_xaddr <= BRIDGE_PCI_MEM32_LIMIT)) {
-	raw_space = PCIIO_SPACE_MEM32;
-	raw_paddr = bad_xaddr - BRIDGE_PCI_MEM32_BASE;
-    }
-    if ((bad_xaddr >= BRIDGE_PCI_MEM64_BASE) &&
-	(bad_xaddr <= BRIDGE_PCI_MEM64_LIMIT)) {
-	raw_space = PCIIO_SPACE_MEM64;
-	raw_paddr = bad_xaddr - BRIDGE_PCI_MEM64_BASE;
-    }
-    if ((bad_xaddr >= BRIDGE_PCI_IO_BASE) &&
-	(bad_xaddr <= BRIDGE_PCI_IO_LIMIT)) {
-	raw_space = PCIIO_SPACE_IO;
-	raw_paddr = bad_xaddr - BRIDGE_PCI_IO_BASE;
+
+    if (IS_PIC_BUSNUM_SOFT(pcibr_soft, 0)) {
+    	if ((bad_xaddr >= PICBRIDGE0_PCI_MEM32_BASE) &&
+	    (bad_xaddr <= PICBRIDGE0_PCI_MEM32_LIMIT)) {
+	    raw_space = PCIIO_SPACE_MEM32;
+	    raw_paddr = bad_xaddr - PICBRIDGE0_PCI_MEM32_BASE;
+    	}
+    	if ((bad_xaddr >= PICBRIDGE0_PCI_MEM64_BASE) &&
+	    (bad_xaddr <= PICBRIDGE0_PCI_MEM64_LIMIT)) {
+	    raw_space = PCIIO_SPACE_MEM64;
+	    raw_paddr = bad_xaddr - PICBRIDGE0_PCI_MEM64_BASE;
+    	}
+    } else if (IS_PIC_BUSNUM_SOFT(pcibr_soft, 1)) {
+    	if ((bad_xaddr >= PICBRIDGE1_PCI_MEM32_BASE) &&
+	    (bad_xaddr <= PICBRIDGE1_PCI_MEM32_LIMIT)) {
+	    raw_space = PCIIO_SPACE_MEM32;
+	    raw_paddr = bad_xaddr - PICBRIDGE1_PCI_MEM32_BASE;
+    	}
+    	if ((bad_xaddr >= PICBRIDGE1_PCI_MEM64_BASE) &&
+	    (bad_xaddr <= PICBRIDGE1_PCI_MEM64_LIMIT)) {
+	    raw_space = PCIIO_SPACE_MEM64;
+	    raw_paddr = bad_xaddr - PICBRIDGE1_PCI_MEM64_BASE;
+    	}
+    } else {
+	printk("pcibr_pioerror(): unknown bridge type");
+	return IOERROR_UNHANDLED;
     }
     space = raw_space;
     offset = raw_paddr;
 
-    if ((slot == PCIIO_SLOT_NONE) && (space != PCIIO_SPACE_NONE)) {
+    if ((device == PCIIO_SLOT_NONE) && (space != PCIIO_SPACE_NONE)) {
 	/* we've got a space/offset but not which
 	 * PCI slot decodes it. Check through our
 	 * notions of which devices decode where.
@@ -1133,16 +1304,16 @@
 
 	for (cs = pcibr_soft->bs_min_slot; 
 		(cs < PCIBR_NUM_SLOTS(pcibr_soft)) && 
-					(slot == PCIIO_SLOT_NONE); cs++) {
+				(device == PCIIO_SLOT_NONE); cs++) {
 	    int                     nf = pcibr_soft->bs_slot[cs].bss_ninfo;
 	    pcibr_info_h            pcibr_infoh = pcibr_soft->bs_slot[cs].bss_infos;
 
-	    for (cf = 0; (cf < nf) && (slot == PCIIO_SLOT_NONE); cf++) {
+	    for (cf = 0; (cf < nf) && (device == PCIIO_SLOT_NONE); cf++) {
 		pcibr_info_t            pcibr_info = pcibr_infoh[cf];
 
 		if (!pcibr_info)
 		    continue;
-		for (cw = 0; (cw < 6) && (slot == PCIIO_SLOT_NONE); ++cw) {
+		for (cw = 0; (cw < 6) && (device == PCIIO_SLOT_NONE); ++cw) {
 		    if (((wx = pcibr_info->f_window[cw].w_space) != PCIIO_SPACE_NONE) &&
 			((wb = pcibr_info->f_window[cw].w_base) != 0) &&
 			((ws = pcibr_info->f_window[cw].w_size) != 0) &&
@@ -1158,7 +1329,7 @@
 			     ((space == PCIIO_SPACE_MEM) ||
 			      (space == PCIIO_SPACE_MEM32) ||
 			      (space == PCIIO_SPACE_MEM64)))) {
-			    slot = cs;
+			    device = cs;
 			    func = cf;
 			    space = PCIIO_SPACE_WIN(cw);
 			    offset -= wb;
@@ -1211,7 +1382,7 @@
 	    wb = map->bp_pciaddr;
 	    ws = map->bp_mapsz;
 	    cw = wx - PCIIO_SPACE_WIN(0);
-	    if (cw < 6) {
+	    if (cw >= 0 && cw < 6) {
 		wb += pcibr_soft->bs_slot[cs].bss_window[cw].bssw_base;
 		wx = pcibr_soft->bs_slot[cs].bss_window[cw].bssw_space;
 	    }
@@ -1224,32 +1395,35 @@
 		wx = PCIIO_SPACE_MEM;
 	    wl = wb + ws;
 	    if ((wx == raw_space) && (raw_paddr >= wb) && (raw_paddr < wl)) {
-		atomic_inc(&map->bp_toc[0]);
-		if (slot == PCIIO_SLOT_NONE) {
-		    slot = cs;
+		atomic_inc(&map->bp_toc);
+		if (device == PCIIO_SLOT_NONE) {
+		    device = cs;
+		    func = cf;
 		    space = map->bp_space;
-		    if (cw < 6)
-			offset -= pcibr_soft->bs_slot[cs].bss_window[cw].bssw_base;
+		    if (cw >= 0 && cw < 6)
+			offset -= pcibr_soft->bs_slot[device].bss_window[cw].bssw_base;
 		}
+
+		break;
 	    }
 	    }
 	}
     }
 
     PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_ERROR_HDLR, pcibr_soft->bs_conn,
-                "pcibr_pioerror: offset=0x%x, slot=0x%x, func=0x%x\n",
-		offset, slot, func));
+                "pcibr_pioerror: space=%d, offset=0x%lx, dev=0x%x, func=0x%x\n",
+		space, offset, device, func));
 
     if (space != PCIIO_SPACE_NONE) {
-	if (slot != PCIIO_SLOT_NONE) {
-	    if (func != PCIIO_FUNC_NONE) {
+	if (device != PCIIO_SLOT_NONE)  {
+	    external_slot = PCIBR_DEVICE_TO_SLOT(pcibr_soft, device);
+
+	    if (func != PCIIO_FUNC_NONE)
 		IOERROR_SETVALUE(ioe, widgetdev, 
-				 pciio_widgetdev_create(slot,func));
-	    }
-	    else {
+				 pciio_widgetdev_create(external_slot,func));
+	    else
     		IOERROR_SETVALUE(ioe, widgetdev, 
-				 pciio_widgetdev_create(slot,0));
-	    }
+				 pciio_widgetdev_create(external_slot,0));
 	}
 	IOERROR_SETVALUE(ioe, busspace, space);
 	IOERROR_SETVALUE(ioe, busaddr, offset);
@@ -1265,7 +1439,7 @@
 	/* if appropriate, give the error handler for this slot
 	 * a shot at this probe access as well.
 	 */
-	return (slot == PCIIO_SLOT_NONE) ? IOERROR_HANDLED :
+	return (device == PCIIO_SLOT_NONE) ? IOERROR_HANDLED :
 	    pciio_error_handler(pcibr_vhdl, error_code, mode, ioe);
     }
     /*
@@ -1355,10 +1529,11 @@
 	 *      other errors.
 	 */
 	if (IOERROR_FIELDVALID(ioe, widgetdev)) {
-		short widdev;
-		IOERROR_GETVALUE(widdev, ioe, widgetdev);
-		pcibr_device_disable(pcibr_soft, 
-				 pciio_widgetdev_slot_get(widdev));
+	    short widdev;
+	    IOERROR_GETVALUE(widdev, ioe, widgetdev);
+	    external_slot = pciio_widgetdev_slot_get(widdev);
+	    device = PCIBR_SLOT_TO_DEVICE(pcibr_soft, external_slot);
+	    pcibr_device_disable(pcibr_soft, device);
 	}
 	if (mode == MODE_DEVUSERERROR)
 	    pcibr_error_cleanup(pcibr_soft, error_code);
@@ -1381,10 +1556,8 @@
 		     ioerror_t *ioe)
 {
     vertex_hdl_t            pcibr_vhdl = pcibr_soft->bs_vhdl;
-    bridge_t               *bridge = pcibr_soft->bs_base;
-    bridgereg_t             bus_lowaddr, bus_uppraddr;
     int                     retval = 0;
-    int                     bufnum;
+    int                     bufnum, device;
 
     /*
      * In case of DMA errors, bridge should have logged the
@@ -1401,19 +1574,10 @@
     /*
      * read error log registers
      */
-    bus_lowaddr = bridge->b_wid_resp_lower;
-    bus_uppraddr = bridge->b_wid_resp_upper;
-
-    bufnum = BRIDGE_RESP_ERRUPPR_BUFNUM(bus_uppraddr);
-    IOERROR_SETVALUE(ioe, widgetdev, 
-		     pciio_widgetdev_create(
-				    BRIDGE_RESP_ERRUPPR_DEVICE(bus_uppraddr),
-				    0));
-    IOERROR_SETVALUE(ioe, busaddr,
-		     (bus_lowaddr |
-		      ((iopaddr_t)
-		       (bus_uppraddr &
-			BRIDGE_ERRUPPR_ADDRMASK) << 32)));
+    bufnum = pcireg_resp_err_buf_get(pcibr_soft);
+    device = pcireg_resp_err_dev_get(pcibr_soft);
+    IOERROR_SETVALUE(ioe, widgetdev, pciio_widgetdev_create(device, 0));
+    IOERROR_SETVALUE(ioe, busaddr, pcireg_resp_err_get(pcibr_soft));
 
     /*
      * need to ensure that the xtalk address in ioe
@@ -1436,7 +1600,7 @@
      * not is dependent on INT_ENABLE register. This write just makes sure
      * that if the interrupt was enabled, we do get the interrupt.
      */
-    bridge->b_int_rst_stat = BRIDGE_IRR_RESP_BUF_GRP_CLR;
+    pcireg_intr_reset_set(pcibr_soft, BRIDGE_IRR_RESP_BUF_GRP_CLR);
 
     /*
      * Also, release the "bufnum" back to buffer pool that could be re-used.
@@ -1445,19 +1609,13 @@
      */
 
     {
-	reg_p                   regp;
-	bridgereg_t             regv;
-	bridgereg_t             mask;
-
-	regp = (bufnum & 1)
-	    ? &bridge->b_odd_resp
-	    : &bridge->b_even_resp;
+	uint64_t		rrb_reg;
+	uint64_t		mask;
 
+	rrb_reg = pcireg_rrb_get(pcibr_soft, (bufnum & 1));
 	mask = 0xF << ((bufnum >> 1) * 4);
-
-	regv = *regp;
-	*regp = regv & ~mask;
-	*regp = regv;
+	pcireg_rrb_set(pcibr_soft, (bufnum & 1), (rrb_reg & ~mask));
+	pcireg_rrb_set(pcibr_soft, (bufnum & 1), rrb_reg);
     }
 
     return retval;
@@ -1705,9 +1863,9 @@
      */
     if ((pio_retval == -1) && (dma_retval == -1)) {
     	return IOERROR_BADERRORCODE;
-    } else if (dma_retval != IOERROR_HANDLED) {
+    } else if ((dma_retval != IOERROR_HANDLED) && (dma_retval != -1)) {
 	return dma_retval;
-    } else if (pio_retval != IOERROR_HANDLED) {
+    } else if ((pio_retval != IOERROR_HANDLED) && (pio_retval != -1)) {
 	return pio_retval;
     } else {
 	return IOERROR_HANDLED;
--- diff/arch/ia64/sn/io/sn2/pcibr/pcibr_hints.c	2004-02-09 10:36:07.000000000 +0000
+++ source/arch/ia64/sn/io/sn2/pcibr/pcibr_hints.c	2004-02-09 10:39:51.000000000 +0000
@@ -33,8 +33,11 @@
     if (alloc && (rv != GRAPH_SUCCESS)) {
 
 	hint = kmalloc(sizeof (*(hint)), GFP_KERNEL);
-	if ( !hint )
+	if ( !hint ) {
+		printk(KERN_WARNING "pcibr_hints_get(): unable to allocate "
+			"memory\n");
 		goto abnormal_exit;
+	}
 	memset(hint, 0, sizeof (*(hint)));
 
 	hint->rrb_alloc_funct = NULL;
@@ -57,7 +60,7 @@
 
 abnormal_exit:
     kfree(hint);
-    return(NULL);
+    return NULL;
 
 }
 
--- diff/arch/ia64/sn/io/sn2/pcibr/pcibr_intr.c	2004-02-09 10:36:07.000000000 +0000
+++ source/arch/ia64/sn/io/sn2/pcibr/pcibr_intr.c	2004-02-09 10:39:51.000000000 +0000
@@ -25,14 +25,14 @@
 	/* FIXME - compare_and_swap_ptr NOT ATOMIC */
 	if (*location == old_ptr) {
 		*location = new_ptr;
-		return(1);
+		return 1;
 	}
 	else
-		return(0);
+		return 0;
 }
 #endif
 
-unsigned		pcibr_intr_bits(pciio_info_t info, pciio_intr_line_t lines, int nslots);
+unsigned int		pcibr_intr_bits(pciio_info_t info, pciio_intr_line_t lines, int nslots);
 pcibr_intr_t            pcibr_intr_alloc(vertex_hdl_t, device_desc_t, pciio_intr_line_t, vertex_hdl_t);
 void                    pcibr_intr_free(pcibr_intr_t);
 void              pcibr_setpciint(xtalk_intr_t);
@@ -40,8 +40,6 @@
 void                    pcibr_intr_disconnect(pcibr_intr_t);
 
 vertex_hdl_t            pcibr_intr_cpu_get(pcibr_intr_t);
-void                    pcibr_xintr_preset(void *, int, xwidgetnum_t, iopaddr_t, xtalk_intr_vector_t);
-void                    pcibr_intr_func(intr_arg_t);
 
 extern pcibr_info_t      pcibr_info_get(vertex_hdl_t);
 
@@ -49,7 +47,7 @@
  *    INTERRUPT MANAGEMENT
  */
 
-unsigned
+unsigned int
 pcibr_intr_bits(pciio_info_t info,
 		pciio_intr_line_t lines, int nslots)
 {
@@ -100,7 +98,8 @@
 extern struct sn_flush_nasid_entry flush_nasid_list[MAX_NASIDS];
 
 void
-sn_dma_flush(unsigned long addr) {
+sn_dma_flush(unsigned long addr)
+{
 	nasid_t nasid;
 	int wid_num;
 	volatile struct sn_flush_device_list *p;
@@ -144,7 +143,7 @@
 
 	/* force an interrupt. */
 
-	*(bridgereg_t *)(p->force_int_addr) = 1;
+	*(volatile uint32_t *)(p->force_int_addr) = 1;
 
 	/* wait for the interrupt to come back. */
 
@@ -152,8 +151,6 @@
 
 	/* okay, everything is synched up. */
 	spin_unlock_irqrestore(&p->flush_lock, flags);
-
-	return;
 }
 
 EXPORT_SYMBOL(sn_dma_flush);
@@ -200,7 +197,6 @@
 	unsigned	bit;
 	unsigned	bits;
 	pcibr_soft_t    pcibr_soft = intr->bi_soft;
-	bridge_t       *bridge = pcibr_soft->bs_base;
 
 	bits = intr->bi_ibits;
 	for (bit = 0; bit < 8; bit++) {
@@ -209,7 +205,7 @@
 			PCIBR_DEBUG((PCIBR_DEBUG_INTR, pcibr_soft->bs_vhdl,
 		    		"pcibr_force_interrupt: bit=0x%x\n", bit));
 
-    			bridge->b_force_pin[bit].intr = 1;
+			pcireg_force_intr_set(pcibr_soft, bit);
 		}
 	}
 }
@@ -225,7 +221,6 @@
     pciio_slot_t            pciio_slot = PCIBR_INFO_SLOT_GET_INT(pcibr_info);
     pcibr_soft_t            pcibr_soft = (pcibr_soft_t) pcibr_info->f_mfast;
     vertex_hdl_t            xconn_vhdl = pcibr_soft->bs_conn;
-    bridge_t               *bridge = pcibr_soft->bs_base;
     int                     is_threaded = 0;
 
     xtalk_intr_t           *xtalk_intr_p;
@@ -239,8 +234,6 @@
     pcibr_intr_t            pcibr_intr;
     pcibr_intr_list_t       intr_entry;
     pcibr_intr_list_t       intr_list;
-    bridgereg_t             int_dev;
-
 
     PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_INTR_ALLOC, pconn_vhdl,
     		"pcibr_intr_alloc: %s%s%s%s%s\n",
@@ -266,9 +259,9 @@
     pcibr_intr->bi_ibuf.ib_in = 0;
     pcibr_intr->bi_ibuf.ib_out = 0;
     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));
 
+    pcibr_int_bits = pcibr_soft->bs_intr_bits((pciio_info_t)pcibr_info, 
+					lines, PCIBR_NUM_SLOTS(pcibr_soft));
 
     /*
      * For each PCI interrupt line requested, figure
@@ -336,10 +329,10 @@
 		     * now tell the bridge which slot is
 		     * using this interrupt line.
 		     */
-		    int_dev = bridge->b_int_device;
-		    int_dev &= ~BRIDGE_INT_DEV_MASK(pcibr_int_bit);
-		    int_dev |= pciio_slot << BRIDGE_INT_DEV_SHFT(pcibr_int_bit);
-		    bridge->b_int_device = int_dev;	/* XXXMP */
+		    pcireg_intr_device_bit_clr(pcibr_soft, 
+			    BRIDGE_INT_DEV_MASK(pcibr_int_bit));
+		    pcireg_intr_device_bit_set(pcibr_soft, 
+			    (pciio_slot << BRIDGE_INT_DEV_SHFT(pcibr_int_bit)));
 
 		    PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_INTR_ALLOC, pconn_vhdl,
 		    		"bridge intr bit %d clears my wrb\n",
@@ -367,7 +360,8 @@
 
 	    intr_entry->il_next = NULL;
 	    intr_entry->il_intr = pcibr_intr;
-	    intr_entry->il_wrbf = &(bridge->b_wr_req_buf[pciio_slot].reg);
+	    intr_entry->il_soft = pcibr_soft;
+	    intr_entry->il_slot = pciio_slot;
 	    intr_list_p = 
 		&pcibr_soft->bs_intr[pcibr_int_bit].bsi_pcibr_intr_wrap.iw_list;
 
@@ -479,19 +473,14 @@
 
 	    if ((!intr_shared) && (*xtalk_intrp)) {
 
-		bridge_t 	*bridge = pcibr_soft->bs_base;
-		bridgereg_t	int_dev;
-
 		xtalk_intr_free(*xtalk_intrp);
 		*xtalk_intrp = 0;
 
 		/* Clear the PCI device interrupt to bridge interrupt pin
 		 * mapping.
 		 */
-		int_dev = bridge->b_int_device;
-		int_dev &= ~BRIDGE_INT_DEV_MASK(pcibr_int_bit);
-		bridge->b_int_device = int_dev;
-
+		pcireg_intr_device_bit_clr(pcibr_soft, 
+			BRIDGE_INT_DEV_MASK(pcibr_int_bit));
 	    }
 	}
     }
@@ -504,17 +493,21 @@
     iopaddr_t		 addr;
     xtalk_intr_vector_t	 vect;
     vertex_hdl_t	 vhdl;
-    bridge_t		*bridge;
-    picreg_t	*int_addr;
-
+    int			 bus_num;
+    int			 pcibr_int_bit;
+    void		 *bridge;
+    
     addr = xtalk_intr_addr_get(xtalk_intr);
     vect = xtalk_intr_vector_get(xtalk_intr);
     vhdl = xtalk_intr_dev_get(xtalk_intr);
-    bridge = (bridge_t *)xtalk_piotrans_addr(vhdl, 0, 0, sizeof(bridge_t), 0);
 
-    int_addr = (picreg_t *)xtalk_intr_sfarg_get(xtalk_intr);
-    *int_addr = ((PIC_INT_ADDR_FLD & ((uint64_t)vect << 48)) |
-		     (PIC_INT_ADDR_HOST & addr));
+    /* bus and int_bits are stored in sfarg, bus bit3, int_bits bit2:0 */
+    pcibr_int_bit = *((int *)xtalk_intr_sfarg_get(xtalk_intr)) & 0x7;
+    bus_num = ((*((int *)xtalk_intr_sfarg_get(xtalk_intr)) & 0x8) >> 3);
+
+    bridge = pcibr_bridge_ptr_get(vhdl, bus_num);
+    pcireg_bridge_intr_addr_vect_set(bridge, pcibr_int_bit, vect);
+    pcireg_bridge_intr_addr_addr_set(bridge, pcibr_int_bit, addr);
 }
 
 /*ARGSUSED */
@@ -522,11 +515,9 @@
 pcibr_intr_connect(pcibr_intr_t pcibr_intr, intr_func_t intr_func, intr_arg_t intr_arg)
 {
     pcibr_soft_t            pcibr_soft = pcibr_intr->bi_soft;
-    bridge_t               *bridge = pcibr_soft->bs_base;
     unsigned                pcibr_int_bits = pcibr_intr->bi_ibits;
     unsigned                pcibr_int_bit;
-    uint64_t		    int_enable;
-    unsigned long           s;
+    unsigned long	    s;
 
     if (pcibr_intr == NULL)
 	return -1;
@@ -566,37 +557,27 @@
 	     * Use the pcibr wrapper function to handle all Bridge interrupts
 	     * regardless of whether the interrupt line is shared or not.
 	     */
-	    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,
-			       			(void *)int_addr);
+	    int_addr = pcireg_intr_addr_addr(pcibr_soft, pcibr_int_bit);
+	    pcibr_soft->bs_intr[pcibr_int_bit].bsi_int_bit = 
+			       ((pcibr_soft->bs_busnum << 3) | pcibr_int_bit);
+	    xtalk_intr_connect(xtalk_intr,
+			       NULL,
+			       (intr_arg_t) intr_wrap,
+			       (xtalk_intr_setfunc_t) pcibr_setpciint,
+			       &pcibr_soft->bs_intr[pcibr_int_bit].bsi_int_bit);
 
 	    pcibr_soft->bs_intr[pcibr_int_bit].bsi_pcibr_intr_wrap.iw_connected = 1;
 
 	    PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_INTR_ALLOC, pcibr_intr->bi_dev,
-			"pcibr_setpciint: int_addr=0x%x, *int_addr=0x%x, "
-			"pcibr_int_bit=0x%x\n", int_addr,
-			 *(picreg_t *)int_addr,
+			"pcibr_setpciint: int_addr=0x%lx, *int_addr=0x%lx, "
+			"pcibr_int_bit=0x%x\n", int_addr, 
+			pcireg_intr_addr_get(pcibr_soft, pcibr_int_bit),
 			pcibr_int_bit));
 	}
 
-	/* PIC WAR. PV# 854697
-	 * On PIC we must write 64-bit MMRs with 64-bit stores
-	 */
 	s = pcibr_lock(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;
-	} else {
-	    bridgereg_t int_enable;
-
-	    int_enable = bridge->b_int_enable;
-	    int_enable |= pcibr_int_bits;
-	    bridge->b_int_enable = int_enable;
-	}
-	bridge->b_wid_tflush;	/* wait until Bridge PIO complete */
+	pcireg_intr_enable_bit_set(pcibr_soft, pcibr_int_bits);
+	pcireg_tflush_get(pcibr_soft);
 	pcibr_unlock(pcibr_soft, s);
 
     return 0;
@@ -607,12 +588,10 @@
 pcibr_intr_disconnect(pcibr_intr_t pcibr_intr)
 {
     pcibr_soft_t            pcibr_soft = pcibr_intr->bi_soft;
-    bridge_t               *bridge = pcibr_soft->bs_base;
     unsigned                pcibr_int_bits = pcibr_intr->bi_ibits;
     unsigned                pcibr_int_bit;
-    pcibr_intr_wrap_t       intr_wrap;
-    uint64_t                int_enable;
-    unsigned long           s;
+    pcibr_intr_wrap_t	    intr_wrap;
+    unsigned long	    s;
 
     /* Stop calling the function. Now.
      */
@@ -636,16 +615,8 @@
 	return;
 
     s = pcibr_lock(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;
-    } else {
-	int_enable = (uint64_t)bridge->b_int_enable;
-	int_enable &= ~pcibr_int_bits;
-	bridge->b_int_enable = (bridgereg_t)int_enable;
-    }
-    bridge->b_wid_tflush;		/* wait until Bridge PIO complete */
+    pcireg_intr_enable_bit_clr(pcibr_soft, pcibr_int_bits);
+    pcireg_tflush_get(pcibr_soft); 	/* wait until Bridge PIO complete */
     pcibr_unlock(pcibr_soft, s);
 
     PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_INTR_ALLOC, pcibr_intr->bi_dev,
@@ -654,7 +625,6 @@
 
     for (pcibr_int_bit = 0; pcibr_int_bit < 8; pcibr_int_bit++)
 	if (pcibr_int_bits & (1 << pcibr_int_bit)) {
-            void                   *int_addr;
 
 	    /* if the interrupt line is now shared,
 	     * do not disconnect it.
@@ -674,19 +644,18 @@
 	     * where the another pcibr_intr_alloc()
 	     * was in progress as we disconnected.
 	     */
+	    intr_wrap = &pcibr_soft->bs_intr[pcibr_int_bit].bsi_pcibr_intr_wrap;
 	    if (!pcibr_soft->bs_intr[pcibr_int_bit].bsi_pcibr_intr_wrap.iw_shared)
 		continue;
 
-	    intr_wrap = &pcibr_soft->bs_intr[pcibr_int_bit].bsi_pcibr_intr_wrap;
-            if (!pcibr_soft->bs_intr[pcibr_int_bit].bsi_pcibr_intr_wrap.iw_shared)
-                continue;
-
-            int_addr = (void *)&(bridge->p_int_addr_64[pcibr_int_bit]);
-
+	    pcibr_soft->bs_intr[pcibr_int_bit].bsi_int_bit =
+				((pcibr_soft->bs_busnum << 3) | pcibr_int_bit);
 	    xtalk_intr_connect(pcibr_soft->bs_intr[pcibr_int_bit].bsi_xtalk_intr,
-				pcibr_intr_func, (intr_arg_t) intr_wrap,
-			       (xtalk_intr_setfunc_t)pcibr_setpciint,
-			       (void *)(long)pcibr_int_bit);
+			       NULL,
+			       (intr_arg_t) intr_wrap,
+			       (xtalk_intr_setfunc_t) pcibr_setpciint,
+			       &pcibr_soft->bs_intr[pcibr_int_bit].bsi_int_bit);
+
 	    PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_INTR_ALLOC, pcibr_intr->bi_dev,
 			"pcibr_intr_disconnect: now-sharing int_bits=0x%x\n",
 			pcibr_int_bit));
@@ -711,10 +680,9 @@
  *    INTERRUPT HANDLING
  */
 void
-pcibr_clearwidint(bridge_t *bridge)
+pcibr_clearwidint(pcibr_soft_t pcibr_soft)
 {
-    bridge->b_wid_int_upper = 0;
-    bridge->b_wid_int_lower = 0;
+    pcireg_intr_dst_set(pcibr_soft, 0);
 }
 
 
@@ -724,257 +692,10 @@
     xwidgetnum_t            targ = xtalk_intr_target_get(intr);
     iopaddr_t               addr = xtalk_intr_addr_get(intr);
     xtalk_intr_vector_t     vect = xtalk_intr_vector_get(intr);
-    widgetreg_t		    NEW_b_wid_int_upper, NEW_b_wid_int_lower;
-    widgetreg_t		    OLD_b_wid_int_upper, OLD_b_wid_int_lower;
-
-    bridge_t               *bridge = (bridge_t *)xtalk_intr_sfarg_get(intr);
-
-    NEW_b_wid_int_upper = ( (0x000F0000 & (targ << 16)) |
-			       XTALK_ADDR_TO_UPPER(addr));
-    NEW_b_wid_int_lower = XTALK_ADDR_TO_LOWER(addr);
-
-    OLD_b_wid_int_upper = bridge->b_wid_int_upper;
-    OLD_b_wid_int_lower = bridge->b_wid_int_lower;
-
-    /* Verify that all interrupts from this Bridge are using a single PI */
-    if ((OLD_b_wid_int_upper != 0) && (OLD_b_wid_int_lower != 0)) {
-	/*
-	 * Once set, these registers shouldn't change; they should
-	 * be set multiple times with the same values.
-	 *
-	 * If we're attempting to change these registers, it means
-	 * that our heuristics for allocating interrupts in a way
-	 * appropriate for IP35 have failed, and the admin needs to
-	 * explicitly direct some interrupts (or we need to make the
-	 * heuristics more clever).
-	 *
-	 * In practice, we hope this doesn't happen very often, if
-	 * at all.
-	 */
-	if ((OLD_b_wid_int_upper != NEW_b_wid_int_upper) ||
-	    (OLD_b_wid_int_lower != NEW_b_wid_int_lower)) {
-		printk(KERN_WARNING  "Interrupt allocation is too complex.\n");
-		printk(KERN_WARNING  "Use explicit administrative interrupt targetting.\n");
-		printk(KERN_WARNING  "bridge=0x%lx targ=0x%x\n", (unsigned long)bridge, targ);
-		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);
-		panic("PCI Bridge interrupt targetting error\n");
-	}
-    }
-
-    bridge->b_wid_int_upper = NEW_b_wid_int_upper;
-    bridge->b_wid_int_lower = NEW_b_wid_int_lower;
-    bridge->b_int_host_err = vect;
-
-}
-
-/*
- * pcibr_intr_preset: called during mlreset time
- * if the platform specific code needs to route
- * one of the Bridge's xtalk interrupts before the
- * xtalk infrastructure is available.
- */
-void
-pcibr_xintr_preset(void *which_widget,
-		   int which_widget_intr,
-		   xwidgetnum_t targ,
-		   iopaddr_t addr,
-		   xtalk_intr_vector_t vect)
-{
-    bridge_t               *bridge = (bridge_t *) which_widget;
-
-    if (which_widget_intr == -1) {
-	/* bridge widget error interrupt */
-	bridge->b_wid_int_upper = ( (0x000F0000 & (targ << 16)) |
-				   XTALK_ADDR_TO_UPPER(addr));
-	bridge->b_wid_int_lower = XTALK_ADDR_TO_LOWER(addr);
-	bridge->b_int_host_err = vect;
-printk("pcibr_xintr_preset: b_wid_int_upper 0x%lx b_wid_int_lower 0x%lx b_int_host_err 0x%x\n",
-	( (0x000F0000 & (targ << 16)) | XTALK_ADDR_TO_UPPER(addr)),
-	XTALK_ADDR_TO_LOWER(addr), vect);
-
-	/* turn on all interrupts except
-	 * the PCI interrupt requests,
-	 * at least at heart.
-	 */
-	bridge->b_int_enable |= ~BRIDGE_IMR_INT_MSK;
-
-    } else {
-	/* routing a PCI device interrupt.
-	 * targ and low 38 bits of addr must
-	 * be the same as the already set
-	 * value for the widget error interrupt.
-	 */
-	bridge->b_int_addr[which_widget_intr].addr =
-	    ((BRIDGE_INT_ADDR_HOST & (addr >> 30)) |
-	     (BRIDGE_INT_ADDR_FLD & vect));
-	/*
-	 * now bridge can let it through;
-	 * NB: still should be blocked at
-	 * xtalk provider end, until the service
-	 * function is set.
-	 */
-	bridge->b_int_enable |= 1 << vect;
-    }
-    bridge->b_wid_tflush;		/* wait until Bridge PIO complete */
-}
-
 
-/*
- * pcibr_intr_func()
- *
- * This is the pcibr interrupt "wrapper" function that is called,
- * in interrupt context, to initiate the interrupt handler(s) registered
- * (via pcibr_intr_alloc/connect) for the occurring interrupt. Non-threaded 
- * handlers will be called directly, and threaded handlers will have their 
- * thread woken up.
- */
-void
-pcibr_intr_func(intr_arg_t arg)
-{
-    pcibr_intr_wrap_t       wrap = (pcibr_intr_wrap_t) arg;
-    reg_p                   wrbf;
-    intr_func_t             func;
-    pcibr_intr_t            intr;
-    pcibr_intr_list_t       list;
-    int                     clearit;
-    int			    do_nonthreaded = 1;
-    int			    is_threaded = 0;
-    int			    x = 0;
-    pcibr_soft_t            pcibr_soft = wrap->iw_soft;
-    bridge_t               *bridge = pcibr_soft->bs_base;
-    uint64_t		    p_enable = pcibr_soft->bs_int_enable;
-    int			    bit = wrap->iw_ibit;
-
-	/*
-	 * PIC WAR.  PV#855272
-	 * Early attempt at a workaround for the runaway
-	 * interrupt problem.   Briefly disable the enable bit for
-	 * this device.
-	 */
-	if (PCIBR_WAR_ENABLED(PV855272, pcibr_soft)) {
-		unsigned s;
-
-		/* disable-enable interrupts for this bridge pin */
-
-		p_enable &= ~(1 << bit);
-	        s = pcibr_lock(pcibr_soft);
-		bridge->p_int_enable_64 = p_enable;
-		p_enable |= (1 << bit);
-		bridge->p_int_enable_64 = p_enable;
-	        pcibr_unlock(pcibr_soft, s);
-	}
-
-	/*
-	 * If any handler is still running from a previous interrupt
-	 * just return. If there's a need to call the handler(s) again,
-	 * another interrupt will be generated either by the device or by
-	 * pcibr_force_interrupt().
-	 */
-
-	if (wrap->iw_hdlrcnt) {
-		return;
-	}
-
-    /*
-     * Call all interrupt handlers registered.
-     * First, the pcibr_intrd threads for any threaded handlers will be
-     * awoken, then any non-threaded handlers will be called sequentially.
-     */
-	
-	clearit = 1;
-	while (do_nonthreaded) {
-	    for (list = wrap->iw_list; list != NULL; list = list->il_next) {
-		if ((intr = list->il_intr) && (intr->bi_flags & PCIIO_INTR_CONNECTED)) {
+    pcibr_soft_t	   bridge = (pcibr_soft_t)xtalk_intr_sfarg_get(intr);
 
-
-		/*
-		 * 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 */
-			/* Only need to flush write buffers if sharing */
-
-			if ((wrap->iw_shared) && (wrbf = list->il_wrbf)) {
-			    if ((x = *wrbf))	/* write request buffer flush */
-#ifdef SUPPORT_PRINTING_V_FORMAT
-				printk(KERN_ALERT  "pcibr_intr_func %v: \n"
-				    "write buffer flush failed, wrbf=0x%x\n", 
-				    list->il_intr->bi_dev, wrbf);
-#else
-				printk(KERN_ALERT  "pcibr_intr_func %p: \n"
-				    "write buffer flush failed, wrbf=0x%lx\n", 
-				    (void *)list->il_intr->bi_dev, (long) wrbf);
-#endif
-			}
-			func = intr->bi_func;
-			if ( func )
-				func(intr->bi_arg);
-		    }
-		    clearit = 0;
-		}
-	    }
-	    do_nonthreaded = 0;
-
-	    /*
-	     * If the non-threaded handler was the last to complete,
-	     * (i.e., no threaded handlers still running) force an
-	     * interrupt to avoid a potential deadlock situation.
-	     */
-	    if (wrap->iw_hdlrcnt == 0) {
-		pcibr_force_interrupt((pcibr_intr_t) wrap);
-	    }
-	}
-
-	/* If there were no handlers,
-	 * disable the interrupt and return.
-	 * It will get enabled again after
-	 * a handler is connected.
-	 * If we don't do this, we would
-	 * sit here and spin through the
-	 * list forever.
-	 */
-	if (clearit) {
-	    pcibr_soft_t            pcibr_soft = wrap->iw_soft;
-	    bridge_t               *bridge = pcibr_soft->bs_base;
-	    bridgereg_t             int_enable;
-	    bridgereg_t		    mask = 1 << wrap->iw_ibit;
-	    unsigned long           s;
-
-	    /* PIC BRINUGP WAR (PV# 854697):
-	     * On PIC we must write 64-bit MMRs with 64-bit stores
-	     */
-	    s = pcibr_lock(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;
-	    } else {
-		int_enable = (uint64_t)bridge->b_int_enable;
-		int_enable &= ~mask;
-		bridge->b_int_enable = (bridgereg_t)int_enable;
-	    }
-	    bridge->b_wid_tflush;	/* wait until Bridge PIO complete */
-	    pcibr_unlock(pcibr_soft, s);
-	    return;
-	}
+    pcireg_intr_dst_target_id_set(bridge, targ);
+    pcireg_intr_dst_addr_set(bridge, addr);
+    pcireg_intr_host_err_set(bridge, vect);
 }
--- diff/arch/ia64/sn/io/sn2/pcibr/pcibr_reg.c	2004-02-09 10:36:07.000000000 +0000
+++ source/arch/ia64/sn/io/sn2/pcibr/pcibr_reg.c	2004-02-09 10:39:51.000000000 +0000
@@ -14,94 +14,867 @@
 #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
+ * Identification Register Access -- Read Only			    0000_0000 
  */
+static uint64_t
+__pcireg_id_get(pic_t *bridge)
+{
+	return bridge->p_wid_id;
+}
 
 uint64_t
-pcireg_control_get(void *ptr)
+pcireg_bridge_id_get(void *ptr)
 {
-	uint64_t ret = 0;
-	pic_t *bridge;
+	return __pcireg_id_get((pic_t *)ptr);
+}
 
-	if (IS_IOADDR(ptr))
-		bridge = (pic_t *) ptr;
-	else
-		bridge = (pic_t *) ((pcibr_soft_t) (ptr))->bs_base;
+uint64_t
+pcireg_id_get(pcibr_soft_t ptr)
+{
+	return __pcireg_id_get((pic_t *)ptr->bs_base);
+}
 
-	ret = ((pic_t *) bridge)->p_wid_control;
-	return ret;
+
+
+/*
+ * Address Bus Side Holding Register Access -- Read Only	    0000_0010
+ */
+uint64_t
+pcireg_bus_err_get(pcibr_soft_t ptr)
+{
+	pic_t *bridge = (pic_t *)ptr->bs_base;
+
+	return bridge->p_wid_err;
 }
 
+
 /*
- * Interrupt Status Register Access -- Read Only                    0000_0100
+ * Control Register Access -- Read/Write			    0000_0020
  */
+static uint64_t
+__pcireg_control_get(pic_t *bridge)
+{
+	return bridge->p_wid_control;
+}
+
+uint64_t
+pcireg_bridge_control_get(void *ptr)
+{
+	return __pcireg_control_get((pic_t *)ptr);
+}
+
 uint64_t
-pcireg_intr_status_get(void *ptr)
+pcireg_control_get(pcibr_soft_t ptr)
+{
+	return __pcireg_control_get((pic_t *)ptr->bs_base);
+}
+
+
+void
+pcireg_control_set(pcibr_soft_t ptr, uint64_t val)
+{
+	pic_t *bridge = (pic_t *)ptr->bs_base;
+
+	/* WAR for PV 439897 & 454474.  Add a readback of the control 
+	 * register.  Lock to protect against MP accesses to this
+	 * register along with other write-only registers (See PVs).
+	 * This register isnt accessed in the "hot path" so the splhi
+	 * shouldn't be a bottleneck
+	 */
+
+	bridge->p_wid_control = val;
+	bridge->p_wid_control;	/* WAR */
+}
+
+
+void
+pcireg_control_bit_clr(pcibr_soft_t ptr, uint64_t bits)
+{
+	pic_t *bridge = (pic_t *)ptr->bs_base;
+
+	/* WAR for PV 439897 & 454474.  Add a readback of the control
+	 * register.  Lock to protect against MP accesses to this
+	 * register along with other write-only registers (See PVs).
+	 * This register isnt accessed in the "hot path" so the splhi
+	 * shouldn't be a bottleneck
+	 */
+
+	bridge->p_wid_control &= ~bits;
+	bridge->p_wid_control;	/* WAR */
+}
+
+
+void
+pcireg_control_bit_set(pcibr_soft_t ptr, uint64_t bits)
+{
+	pic_t *bridge = (pic_t *)ptr->bs_base;
+
+	/* WAR for PV 439897 & 454474.  Add a readback of the control
+	 * register.  Lock to protect against MP accesses to this
+	 * register along with other write-only registers (See PVs).
+	 * This register isnt accessed in the "hot path" so the splhi
+	 * shouldn't be a bottleneck
+	 */
+
+	bridge->p_wid_control |= bits;
+	bridge->p_wid_control;	/* WAR */
+}
+
+/*
+ * Bus Speed (from control register); -- Read Only access	    0000_0020
+ * 0x00 == 33MHz, 0x01 == 66MHz, 0x10 == 100MHz, 0x11 == 133MHz
+ */
+uint64_t
+pcireg_speed_get(pcibr_soft_t ptr)
+{
+	uint64_t speedbits;
+	pic_t *bridge = (pic_t *)ptr->bs_base;
+
+	speedbits = bridge->p_wid_control & PIC_CTRL_PCI_SPEED;
+	return (speedbits >> 4);
+}
+
+/*
+ * Bus Mode (ie. PCIX or PCI) (from Status register);		    0000_0008
+ * 0x0 == PCI, 0x1 == PCI-X
+ */
+uint64_t
+pcireg_mode_get(pcibr_soft_t ptr)
+{
+	uint64_t pcix_active_bit;
+	pic_t *bridge = (pic_t *)ptr->bs_base;
+
+	pcix_active_bit = bridge->p_wid_stat & PIC_STAT_PCIX_ACTIVE;
+	return (pcix_active_bit >> PIC_STAT_PCIX_ACTIVE_SHFT);
+}
+
+void
+pcireg_req_timeout_set(pcibr_soft_t ptr, uint64_t val)
+{
+	pic_t *bridge = (pic_t *)ptr->bs_base;
+
+	bridge->p_wid_req_timeout = val;
+}
+
+/*
+ * Interrupt Destination Addr Register Access -- Read/Write	    0000_0038
+ */
+
+void
+pcireg_intr_dst_set(pcibr_soft_t ptr, uint64_t val)
+{
+	pic_t *bridge = (pic_t *)ptr->bs_base;
+
+	bridge->p_wid_int = val;
+}
+
+/*
+ * Intr Destination Addr Reg Access (target_id) -- Read/Write	    0000_0038
+ */
+uint64_t
+pcireg_intr_dst_target_id_get(pcibr_soft_t ptr)
+{
+	uint64_t tid_bits;
+	pic_t *bridge = (pic_t *)ptr->bs_base;
+
+	tid_bits = (bridge->p_wid_int & PIC_INTR_DEST_TID);
+	return (tid_bits >> PIC_INTR_DEST_TID_SHFT);
+}
+
+void
+pcireg_intr_dst_target_id_set(pcibr_soft_t ptr, uint64_t target_id)
+{
+	pic_t *bridge = (pic_t *)ptr->bs_base;
+
+	bridge->p_wid_int &= ~PIC_INTR_DEST_TID;
+	bridge->p_wid_int |=
+		    ((target_id << PIC_INTR_DEST_TID_SHFT) & PIC_INTR_DEST_TID);
+}
+
+/*
+ * Intr Destination Addr Register Access (addr) -- Read/Write	    0000_0038
+ */
+uint64_t
+pcireg_intr_dst_addr_get(pcibr_soft_t ptr)
+{
+	pic_t *bridge = (pic_t *)ptr->bs_base;
+
+	return bridge->p_wid_int & PIC_XTALK_ADDR_MASK;
+}
+
+void
+pcireg_intr_dst_addr_set(pcibr_soft_t ptr, uint64_t addr)
+{
+	pic_t *bridge = (pic_t *)ptr->bs_base;
+
+	bridge->p_wid_int &= ~PIC_XTALK_ADDR_MASK;
+	bridge->p_wid_int |= (addr & PIC_XTALK_ADDR_MASK);
+}
+
+/*
+ * Cmd Word Holding Bus Side Error Register Access -- Read Only	    0000_0040
+ */
+uint64_t
+pcireg_cmdword_err_get(pcibr_soft_t ptr)
+{
+	pic_t *bridge = (pic_t *)ptr->bs_base;
+
+	return bridge->p_wid_err_cmdword;
+}
+
+/*
+ * PCI/PCIX Target Flush Register Access -- Read Only		    0000_0050
+ */
+uint64_t
+pcireg_tflush_get(pcibr_soft_t ptr)
 {
-	short bridge_type;
-	pic_t *bridge;
 	uint64_t ret = 0;
+	pic_t *bridge = (pic_t *)ptr->bs_base;
 
-	if (IS_IOADDR(ptr))
-		bridge = (pic_t *) ptr;
-	else
-		bridge = (pic_t *) ((pcibr_soft_t) (ptr))->bs_base;
+	ret = bridge->p_wid_tflush;
 
-	ret = ((pic_t *) bridge)->p_int_status;
+	/* Read of the Targer Flush should always return zero */
+	ASSERT_ALWAYS(ret == 0);
 	return ret;
 }
 
+/*
+ * Cmd Word Holding Link Side Error Register Access -- Read Only    0000_0058
+ */
+uint64_t
+pcireg_linkside_err_get(pcibr_soft_t ptr)
+{
+	pic_t *bridge = (pic_t *)ptr->bs_base;
+
+	return bridge->p_wid_aux_err;
+}
+
+/*
+ * PCI Response Buffer Address Holding Register -- Read Only	    0000_0068
+ */
+uint64_t
+pcireg_resp_err_get(pcibr_soft_t ptr)
+{
+	pic_t *bridge = (pic_t *)ptr->bs_base;
+
+	return bridge->p_wid_resp;
+}
+
+/*
+ * PCI Resp Buffer Address Holding Reg (Address) -- Read Only	    0000_0068
+ */
+uint64_t
+pcireg_resp_err_addr_get(pcibr_soft_t ptr)
+{
+	pic_t *bridge = (pic_t *)ptr->bs_base;
+
+	return bridge->p_wid_resp & PIC_RSP_BUF_ADDR;
+}
+
+/*
+ * PCI Resp Buffer Address Holding Register (Buffer)-- Read Only    0000_0068
+ */
+uint64_t
+pcireg_resp_err_buf_get(pcibr_soft_t ptr)
+{
+	uint64_t bufnum_bits;
+	pic_t *bridge = (pic_t *)ptr->bs_base;
+
+	bufnum_bits = (bridge->p_wid_resp_upper & PIC_RSP_BUF_NUM);
+	return (bufnum_bits >> PIC_RSP_BUF_NUM_SHFT);
+}
+
+/*
+ * PCI Resp Buffer Address Holding Register (Device)-- Read Only    0000_0068
+ */
+uint64_t
+pcireg_resp_err_dev_get(pcibr_soft_t ptr)
+{
+	uint64_t devnum_bits;
+	pic_t *bridge = (pic_t *)ptr->bs_base;
+
+	devnum_bits = (bridge->p_wid_resp_upper & PIC_RSP_BUF_DEV_NUM);
+	return (devnum_bits >> PIC_RSP_BUF_DEV_NUM_SHFT);
+}
+
+/*
+ * Address Holding Register Link Side Errors -- Read Only	    0000_0078
+ */
+uint64_t
+pcireg_linkside_err_addr_get(pcibr_soft_t ptr)
+{
+	pic_t *bridge = (pic_t *)ptr->bs_base;
+
+	return bridge->p_wid_addr_lkerr;
+}
+
+void
+pcireg_dirmap_wid_set(pcibr_soft_t ptr, uint64_t target)
+{
+	pic_t *bridge = (pic_t *)ptr->bs_base;
+
+	bridge->p_dir_map &= ~PIC_DIRMAP_WID;
+	bridge->p_dir_map |=
+		    ((target << PIC_DIRMAP_WID_SHFT) & PIC_DIRMAP_WID);
+}
+
+void
+pcireg_dirmap_diroff_set(pcibr_soft_t ptr, uint64_t dir_off)
+{
+	pic_t *bridge = (pic_t *)ptr->bs_base;
+
+	bridge->p_dir_map &= ~PIC_DIRMAP_DIROFF;
+	bridge->p_dir_map |= (dir_off & PIC_DIRMAP_DIROFF);
+}
+
+void
+pcireg_dirmap_add512_set(pcibr_soft_t ptr)
+{
+	pic_t *bridge = (pic_t *)ptr->bs_base;
+
+	bridge->p_dir_map |= PIC_DIRMAP_ADD512;
+}
+
+void
+pcireg_dirmap_add512_clr(pcibr_soft_t ptr)
+{
+	pic_t *bridge = (pic_t *)ptr->bs_base;
+
+	bridge->p_dir_map &= ~PIC_DIRMAP_ADD512;
+}
+
+/*
+ * PCI Page Map Fault Address Register Access -- Read Only	    0000_0090
+ */
+uint64_t
+pcireg_map_fault_get(pcibr_soft_t ptr)
+{
+	pic_t *bridge = (pic_t *)ptr->bs_base;
+
+	return bridge->p_map_fault;
+}
+
+/*
+ * Arbitration Register Access -- Read/Write			    0000_00A0
+ */
+uint64_t
+pcireg_arbitration_get(pcibr_soft_t ptr)
+{
+	pic_t *bridge = (pic_t *)ptr->bs_base;
+
+	return bridge->p_arb;
+}
+
+void
+pcireg_arbitration_bit_set(pcibr_soft_t ptr, uint64_t bits)
+{
+	pic_t *bridge = (pic_t *)ptr->bs_base;
+
+	bridge->p_arb |= bits;
+}
+
+/*
+ * Internal Ram Parity Error Register Access -- Read Only	    0000_00B0
+ */
+uint64_t
+pcireg_parity_err_get(pcibr_soft_t ptr)
+{
+	pic_t *bridge = (pic_t *)ptr->bs_base;
+
+	return bridge->p_ate_parity_err;
+}
+
+/*
+ * Type 1 Configuration Register Access -- Read/Write		    0000_00C8
+ */
+void
+pcireg_type1_cntr_set(pcibr_soft_t ptr, uint64_t val)
+{
+	pic_t *bridge = (pic_t *)ptr->bs_base;
+
+	bridge->p_pci_cfg = val;
+}
+
+/*
+ * PCI Bus Error Lower Addr Holding Reg Access -- Read Only	    0000_00D8
+ */
+uint64_t
+pcireg_pci_bus_addr_get(pcibr_soft_t ptr)
+{
+	pic_t *bridge = (pic_t *)ptr->bs_base;
+
+	return bridge->p_pci_err;
+}
+
+/*
+ * PCI Bus Error Addr Holding Reg Access (Address) -- Read Only	    0000_00D8
+ */
+uint64_t
+pcireg_pci_bus_addr_addr_get(pcibr_soft_t ptr)
+{
+	pic_t *bridge = (pic_t *)ptr->bs_base;
+
+	return bridge->p_pci_err & PIC_XTALK_ADDR_MASK;
+}
+
+/*
+ * Interrupt Status Register Access -- Read Only		    0000_0100
+ */
+uint64_t
+pcireg_intr_status_get(pcibr_soft_t ptr)
+{
+	pic_t *bridge = (pic_t *)ptr->bs_base;
+
+	return bridge->p_int_status;
+}
+
+/*
+ * Interrupt Enable Register Access -- Read/Write		    0000_0108
+ */
+uint64_t
+pcireg_intr_enable_get(pcibr_soft_t ptr)
+{
+	pic_t *bridge = (pic_t *)ptr->bs_base;
+
+	return bridge->p_int_enable;
+}
+
+void
+pcireg_intr_enable_set(pcibr_soft_t ptr, uint64_t val)
+{
+	pic_t *bridge = (pic_t *)ptr->bs_base;
+
+	bridge->p_int_enable = val;
+}
+
 void
-pcireg_intr_enable_bit_clr(void *ptr, uint64_t bits)
+pcireg_intr_enable_bit_clr(pcibr_soft_t ptr, uint64_t bits)
 {
-	pic_t *bridge;
+	pic_t *bridge = (pic_t *)ptr->bs_base;
 
-	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)
+pcireg_intr_enable_bit_set(pcibr_soft_t ptr, uint64_t bits)
 {
-	pic_t *bridge;
+	pic_t *bridge = (pic_t *)ptr->bs_base;
 
-	if (IS_IOADDR(ptr))
-		bridge = (pic_t *) ptr;
-	else
-		bridge = (pic_t *) ((pcibr_soft_t) (ptr))->bs_base;
 	bridge->p_int_enable |= bits;
 }
 
+/*
+ * Interrupt Reset Register Access -- Write Only		    0000_0110
+ */
+void
+pcireg_intr_reset_set(pcibr_soft_t ptr, uint64_t val)
+{
+	pic_t *bridge = (pic_t *)ptr->bs_base;
+
+	bridge->p_int_rst_stat = val;
+}
+
+void
+pcireg_intr_mode_set(pcibr_soft_t ptr, uint64_t val)
+{
+	pic_t *bridge = (pic_t *)ptr->bs_base;
+
+	bridge->p_int_mode = val;
+}
+
 void
-pcireg_intr_addr_addr_set(void *ptr, int int_n, uint64_t addr)
+pcireg_intr_device_set(pcibr_soft_t ptr, uint64_t val)
 {
-	pic_t *bridge;
+	pic_t *bridge = (pic_t *)ptr->bs_base;
 
-	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);
+	bridge->p_int_device = val;
+}
+
+static void
+__pcireg_intr_device_bit_set(pic_t *bridge, uint64_t bits)
+{
+	bridge->p_int_device |= bits;
+}
+
+void
+pcireg_bridge_intr_device_bit_set(void *ptr, uint64_t bits)
+{
+	__pcireg_intr_device_bit_set((pic_t *)ptr, bits);
+}
+
+void
+pcireg_intr_device_bit_set(pcibr_soft_t ptr, uint64_t bits)
+{
+	__pcireg_intr_device_bit_set((pic_t *)ptr->bs_base, bits);
+}
+
+void
+pcireg_intr_device_bit_clr(pcibr_soft_t ptr, uint64_t bits)
+{
+	pic_t *bridge = (pic_t *)ptr->bs_base;
+
+	bridge->p_int_device &= ~bits;
 }
 
 /*
- * Force Interrupt Register Access -- Write Only        0000_01C0 - 0000_01F8
+ * Host Error Interrupt Field Register Access -- Read/Write	    0000_0128
  */
 void
-pcireg_force_intr_set(void *ptr, int int_n)
+pcireg_intr_host_err_set(pcibr_soft_t ptr, uint64_t val)
+{
+	pic_t *bridge = (pic_t *)ptr->bs_base;
+
+	bridge->p_int_host_err = val;
+}
+
+/*
+ * Interrupt Host Address Register -- Read/Write	0000_0130 - 0000_0168
+ */
+uint64_t
+pcireg_intr_addr_get(pcibr_soft_t ptr, int int_n)
 {
-	pic_t *bridge;
+	pic_t *bridge = (pic_t *)ptr->bs_base;
+
+	return bridge->p_int_addr[int_n];
+}
+
+static void
+__pcireg_intr_addr_set(pic_t *bridge, int int_n, uint64_t val)
+{
+	bridge->p_int_addr[int_n] = val;
+}
+
+void
+pcireg_bridge_intr_addr_set(void *ptr, int int_n, uint64_t val)
+{
+	__pcireg_intr_addr_set((pic_t *)ptr, int_n, val);
+}
+
+void
+pcireg_intr_addr_set(pcibr_soft_t ptr, int int_n, uint64_t val)
+{
+	__pcireg_intr_addr_set((pic_t *)ptr->bs_base, int_n, val);
+}
+
+void *
+pcireg_intr_addr_addr(pcibr_soft_t ptr, int int_n)
+{
+	pic_t *bridge = (pic_t *)ptr->bs_base;
+
+	return (void *)&(bridge->p_int_addr[int_n]);
+}
+
+static void
+__pcireg_intr_addr_vect_set(pic_t *bridge, int int_n, uint64_t vect)
+{
+	bridge->p_int_addr[int_n] &= ~PIC_HOST_INTR_FLD;
+	bridge->p_int_addr[int_n] |=
+		    ((vect << PIC_HOST_INTR_FLD_SHFT) & PIC_HOST_INTR_FLD);
+}
+
+void
+pcireg_bridge_intr_addr_vect_set(void *ptr, int int_n, uint64_t vect)
+{
+	__pcireg_intr_addr_vect_set((pic_t *)ptr, int_n, vect);
+}
+
+void
+pcireg_intr_addr_vect_set(pcibr_soft_t ptr, int int_n, uint64_t vect)
+{
+	__pcireg_intr_addr_vect_set((pic_t *)ptr->bs_base, int_n, vect);
+}
+
+
+
+/*
+ * Intr Host Address Register (int_addr) -- Read/Write	0000_0130 - 0000_0168
+ */
+static void
+__pcireg_intr_addr_addr_set(pic_t *bridge, int int_n, uint64_t addr)
+{
+	bridge->p_int_addr[int_n] &= ~PIC_HOST_INTR_ADDR;
+	bridge->p_int_addr[int_n] |= (addr & PIC_HOST_INTR_ADDR);
+}
+
+void
+pcireg_bridge_intr_addr_addr_set(void *ptr, int int_n, uint64_t addr)
+{
+	__pcireg_intr_addr_addr_set((pic_t *)ptr, int_n, addr);
+}
+
+void
+pcireg_intr_addr_addr_set(pcibr_soft_t ptr, int int_n, uint64_t addr)
+{
+	__pcireg_intr_addr_addr_set((pic_t *)ptr->bs_base, int_n, addr);
+}
+
+/*
+ * Multiple Interrupt Register Access -- Read Only		    0000_0178
+ */
+uint64_t
+pcireg_intr_multiple_get(pcibr_soft_t ptr)
+{
+	pic_t *bridge = (pic_t *)ptr->bs_base;
+
+	return bridge->p_mult_int;
+}
+
+/*
+ * Force Always Intr Register Access -- Write Only	0000_0180 - 0000_01B8
+ */
+static void *
+__pcireg_force_always_addr_get(pic_t *bridge, int int_n)
+{
+	return (void *)&(bridge->p_force_always[int_n]);
+}
+
+void *
+pcireg_bridge_force_always_addr_get(void *ptr, int int_n)
+{
+	return __pcireg_force_always_addr_get((pic_t *)ptr, int_n);
+}
+
+void *
+pcireg_force_always_addr_get(pcibr_soft_t ptr, int int_n)
+{
+	return __pcireg_force_always_addr_get((pic_t *)ptr->bs_base, int_n);
+}
+
+/*
+ * Force Interrupt Register Access -- Write Only	0000_01C0 - 0000_01F8
+ */
+void
+pcireg_force_intr_set(pcibr_soft_t ptr, int int_n)
+{
+	pic_t *bridge = (pic_t *)ptr->bs_base;
 
-	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;
 }
+
+/*
+ * Device(x) Register Access -- Read/Write		0000_0200 - 0000_0218
+ */
+uint64_t
+pcireg_device_get(pcibr_soft_t ptr, int device)
+{
+	pic_t *bridge = (pic_t *)ptr->bs_base;
+
+	ASSERT_ALWAYS((device >= 0) && (device <= 3));
+	return bridge->p_device[device];
+}
+
+void
+pcireg_device_set(pcibr_soft_t ptr, int device, uint64_t val)
+{
+	pic_t *bridge = (pic_t *)ptr->bs_base;
+
+	ASSERT_ALWAYS((device >= 0) && (device <= 3));
+	bridge->p_device[device] = val;
+}
+
+/*
+ * Device(x) Write Buffer Flush Reg Access -- Read Only	0000_0240 - 0000_0258
+ */
+uint64_t
+pcireg_wrb_flush_get(pcibr_soft_t ptr, int device)
+{
+	pic_t *bridge = (pic_t *)ptr->bs_base;
+	uint64_t ret = 0;
+
+	ASSERT_ALWAYS((device >= 0) && (device <= 3));
+	ret = bridge->p_wr_req_buf[device];
+
+	/* Read of the Write Buffer Flush should always return zero */
+	ASSERT_ALWAYS(ret == 0);
+	return ret;
+}
+
+/*
+ * Even/Odd RRB Register Access -- Read/Write		0000_0280 - 0000_0288
+ */
+uint64_t
+pcireg_rrb_get(pcibr_soft_t ptr, int even_odd)
+{
+	pic_t *bridge = (pic_t *)ptr->bs_base;
+
+	return bridge->p_rrb_map[even_odd];
+}
+
+void
+pcireg_rrb_set(pcibr_soft_t ptr, int even_odd, uint64_t val)
+{
+	pic_t *bridge = (pic_t *)ptr->bs_base;
+
+	bridge->p_rrb_map[even_odd] = val;
+}
+
+void
+pcireg_rrb_bit_set(pcibr_soft_t ptr, int even_odd, uint64_t bits)
+{
+	pic_t *bridge = (pic_t *)ptr->bs_base;
+
+	bridge->p_rrb_map[even_odd] |= bits;
+}
+
+/*
+ * RRB Status Register Access -- Read Only			    0000_0290
+ */
+uint64_t
+pcireg_rrb_status_get(pcibr_soft_t ptr)
+{
+	pic_t *bridge = (pic_t *)ptr->bs_base;
+
+	return bridge->p_resp_status;
+}
+
+/*
+ * RRB Clear Register Access -- Write Only			    0000_0298
+ */
+void
+pcireg_rrb_clear_set(pcibr_soft_t ptr, uint64_t val)
+{
+	pic_t *bridge = (pic_t *)ptr->bs_base;
+
+	bridge->p_resp_clear = val;
+}
+
+/*
+ * PCIX Bus Error Address Register Access -- Read Only		    0000_0600
+ */
+uint64_t
+pcireg_pcix_bus_err_addr_get(pcibr_soft_t ptr)
+{
+	pic_t *bridge = (pic_t *)ptr->bs_base;
+
+	return bridge->p_pcix_bus_err_addr;
+}
+
+/*
+ * PCIX Bus Error Attribute Register Access -- Read Only	    0000_0608
+ */
+uint64_t
+pcireg_pcix_bus_err_attr_get(pcibr_soft_t ptr)
+{
+	pic_t *bridge = (pic_t *)ptr->bs_base;
+
+	return bridge->p_pcix_bus_err_attr;
+}
+
+/*
+ * PCIX Bus Error Data Register Access -- Read Only		    0000_0610
+ */
+uint64_t
+pcireg_pcix_bus_err_data_get(pcibr_soft_t ptr)
+{
+	pic_t *bridge = (pic_t *)ptr->bs_base;
+
+	return bridge->p_pcix_bus_err_data;
+}
+
+/*
+ * PCIX PIO Split Request Address Register Access -- Read Only	    0000_0618
+ */
+uint64_t
+pcireg_pcix_pio_split_addr_get(pcibr_soft_t ptr)
+{
+	pic_t *bridge = (pic_t *)ptr->bs_base;
+
+	return bridge->p_pcix_pio_split_addr;
+}
+
+/*
+ * PCIX PIO Split Request Attribute Register Access -- Read Only    0000_0620
+ */
+uint64_t
+pcireg_pcix_pio_split_attr_get(pcibr_soft_t ptr)
+{
+	pic_t *bridge = (pic_t *)ptr->bs_base;
+
+	return bridge->p_pcix_pio_split_attr;
+}
+
+/*
+ * PCIX DMA Request Error Attribute Register Access -- Read Only    0000_0628
+ */
+uint64_t
+pcireg_pcix_req_err_attr_get(pcibr_soft_t ptr)
+{
+	pic_t *bridge = (pic_t *)ptr->bs_base;
+
+	return bridge->p_pcix_dma_req_err_attr;
+}
+
+/*
+ * PCIX DMA Request Error Address Register Access -- Read Only	    0000_0630
+ */
+uint64_t
+pcireg_pcix_req_err_addr_get(pcibr_soft_t ptr)
+{
+	pic_t *bridge = (pic_t *)ptr->bs_base;
+
+	return bridge->p_pcix_dma_req_err_addr;
+}
+
+/*
+ * Type 0 Configuration Space Access -- Read/Write
+ */
+cfg_p
+pcireg_type0_cfg_addr(pcibr_soft_t ptr, uint8_t slot, uint8_t func, int off)
+{
+	pic_t *bridge = (pic_t *)ptr->bs_base;
+
+	/* Type 0 Config space accesses on PIC are 1-4, not 0-3 since
+	 * it is a PCIX Bridge.  See sys/PCI/pic.h for explanation.
+	 */
+	slot++;
+	ASSERT_ALWAYS(((int) slot >= 1) && ((int) slot <= 4));
+	return &(bridge->p_type0_cfg_dev[slot].f[func].l[(off / 4)]);
+}
+
+/*
+ * Type 1 Configuration Space Access -- Read/Write
+ */
+cfg_p
+pcireg_type1_cfg_addr(pcibr_soft_t ptr, uint8_t func, int offset)
+{
+	pic_t *bridge = (pic_t *)ptr->bs_base;
+
+	/*
+	 * Return a config space address for the given slot/func/offset.
+	 * Note the returned ptr is a 32bit word (ie. cfg_p) aligned ptr
+	 * pointing to the 32bit word that contains the "offset" byte.
+	 */
+	return &(bridge->p_type1_cfg.f[func].l[(offset / 4)]);
+}
+
+/*
+ * Internal ATE SSRAM Access -- Read/Write 
+ */
+bridge_ate_t
+pcireg_int_ate_get(pcibr_soft_t ptr, int ate_index)
+{
+	pic_t *bridge = (pic_t *)ptr->bs_base;
+
+	ASSERT_ALWAYS((ate_index >= 0) && (ate_index <= 1024));
+	return bridge->p_int_ate_ram[ate_index];
+}
+
+void
+pcireg_int_ate_set(pcibr_soft_t ptr, int ate_index, bridge_ate_t val)
+{
+	pic_t *bridge = (pic_t *)ptr->bs_base;
+
+	ASSERT_ALWAYS((ate_index >= 0) && (ate_index <= 1024));
+	bridge->p_int_ate_ram[ate_index] = (picate_t) val;
+}
+
+bridge_ate_p
+pcireg_int_ate_addr(pcibr_soft_t ptr, int ate_index)
+{
+	pic_t *bridge = (pic_t *)ptr->bs_base;
+
+	ASSERT_ALWAYS((ate_index >= 0) && (ate_index <= 1024));
+	return &(bridge->p_int_ate_ram[ate_index]);
+}
--- diff/arch/ia64/sn/io/sn2/pcibr/pcibr_rrb.c	2004-02-09 10:36:07.000000000 +0000
+++ source/arch/ia64/sn/io/sn2/pcibr/pcibr_rrb.c	2004-02-09 10:39:51.000000000 +0000
@@ -14,23 +14,19 @@
 #include <asm/sn/pci/pcibr_private.h>
 #include <asm/sn/pci/pci_defs.h>
 
-void              do_pcibr_rrb_clear(bridge_t *, int);
-void              do_pcibr_rrb_flush(bridge_t *, int);
-int               do_pcibr_rrb_count_valid(bridge_t *, pciio_slot_t, int);
-int               do_pcibr_rrb_count_avail(bridge_t *, pciio_slot_t);
-int               do_pcibr_rrb_alloc(bridge_t *, pciio_slot_t, int, int);
-int               do_pcibr_rrb_free(bridge_t *, pciio_slot_t, int, int);
-void		  do_pcibr_rrb_free_all(pcibr_soft_t, bridge_t *, pciio_slot_t);
-
-void              do_pcibr_rrb_autoalloc(pcibr_soft_t, int, int, int);
-
-int		  pcibr_wrb_flush(vertex_hdl_t);
-int               pcibr_rrb_alloc(vertex_hdl_t, int *, int *);
-int               pcibr_rrb_check(vertex_hdl_t, int *, int *, int *, int *);
-void              pcibr_rrb_flush(vertex_hdl_t);
-int		  pcibr_slot_initial_rrb_alloc(vertex_hdl_t,pciio_slot_t);
+void		pcibr_rrb_alloc_init(pcibr_soft_t, int, int, int);
+void		pcibr_rrb_alloc_more(pcibr_soft_t, int, int, int);
+
+int		pcibr_wrb_flush(vertex_hdl_t);
+int		pcibr_rrb_alloc(vertex_hdl_t, int *, int *);
+int		pcibr_rrb_check(vertex_hdl_t, int *, int *, int *, int *);
+int		pcibr_alloc_all_rrbs(vertex_hdl_t, int, int, int, int, 
+			     	     int, int, int, int, int);
+void		pcibr_rrb_flush(vertex_hdl_t);
+int		pcibr_slot_initial_rrb_alloc(vertex_hdl_t,pciio_slot_t);
+
+void            pcibr_rrb_debug(char *, pcibr_soft_t);
 
-void		  pcibr_rrb_debug(char *, pcibr_soft_t);
 
 /*
  * RRB Management
@@ -52,23 +48,27 @@
 #define RRB_MASK (0xf)			/* mask a single rrb within reg */
 #define RRB_SIZE (4)			/* sizeof rrb within reg (bits) */
  
-#define RRB_ENABLE_BIT(bridge)		(0x8)  /* [BRIDGE | PIC]_RRB_EN */
-#define NUM_PDEV_BITS(bridge)		(1)
-#define NUM_VDEV_BITS(bridge)		(2)
-#define NUMBER_VCHANNELS(bridge)	(4)
-#define SLOT_2_PDEV(bridge, slot)	((slot) >> 1)
-#define SLOT_2_RRB_REG(bridge, slot)	((slot) & 0x1)
- 
-/* validate that the slot and virtual channel are valid for a given bridge */
-#define VALIDATE_SLOT_n_VCHAN(bridge, s, v) \
-    (((((s) != PCIIO_SLOT_NONE) && ((s) <= (pciio_slot_t)3)) && (((v) >= 0) && ((v) <= 3))) ? 1 : 0)
+#define RRB_ENABLE_BIT		      (0x8)  /* [BRIDGE | PIC]_RRB_EN */
+#define NUM_PDEV_BITS		      (1)
+#define NUMBER_VCHANNELS	      (4)
+#define SLOT_2_PDEV(slot)		((slot) >> 1)
+#define SLOT_2_RRB_REG(slot)  		((slot) & 0x1)
+
+#define RRB_VALID(rrb)		      (0x00010000 << (rrb))
+#define RRB_INUSE(rrb)		      (0x00000001 << (rrb))
+#define RRB_CLEAR(rrb)		      (0x00000001 << (rrb))
+ 
+/* validate that the slot and virtual channel are valid */
+#define VALIDATE_SLOT_n_VCHAN(s, v) \
+    (((((s) != PCIIO_SLOT_NONE) && ((s) <= (pciio_slot_t)3)) && \
+      (((v) >= 0) && ((v) <= 3))) ? 1 : 0)
  
 /*  
  * Count how many RRBs are marked valid for the specified PCI slot
  * and virtual channel.	 Return the count.
  */ 
-int
-do_pcibr_rrb_count_valid(bridge_t *bridge,
+static int
+do_pcibr_rrb_count_valid(pcibr_soft_t pcibr_soft,
 			 pciio_slot_t slot,
 			 int vchan)
 {
@@ -76,18 +76,18 @@
     uint16_t enable_bit, vchan_bits, pdev_bits, rrb_bits;
     int rrb_index, cnt=0;
 
-    if (!VALIDATE_SLOT_n_VCHAN(bridge, slot, vchan)) {
+    if (!VALIDATE_SLOT_n_VCHAN(slot, vchan)) {
 	printk(KERN_WARNING "do_pcibr_rrb_count_valid() invalid slot/vchan [%d/%d]\n", slot, vchan);
 	return 0;
     }
     
-    enable_bit = RRB_ENABLE_BIT(bridge);
-    vchan_bits = vchan << NUM_PDEV_BITS(bridge);
-    pdev_bits = SLOT_2_PDEV(bridge, slot);
+    enable_bit = RRB_ENABLE_BIT;
+    vchan_bits = vchan << NUM_PDEV_BITS;
+    pdev_bits = SLOT_2_PDEV(slot);
     rrb_bits = enable_bit | vchan_bits | pdev_bits;
     
-    tmp = bridge->b_rrb_map[SLOT_2_RRB_REG(bridge, slot)].reg;
-
+    tmp = pcireg_rrb_get(pcibr_soft, SLOT_2_RRB_REG(slot));
+    
     for (rrb_index = 0; rrb_index < 8; rrb_index++) {
 	if ((tmp & RRB_MASK) == rrb_bits)
 	    cnt++;
@@ -101,23 +101,23 @@
  * Count how many RRBs are available to be allocated to the specified
  * slot.  Return the count.
  */ 
-int
-do_pcibr_rrb_count_avail(bridge_t *bridge,
+static int
+do_pcibr_rrb_count_avail(pcibr_soft_t pcibr_soft,
 			 pciio_slot_t slot)
 {
     uint64_t tmp;
     uint16_t enable_bit;
     int rrb_index, cnt=0;
     
-    if (!VALIDATE_SLOT_n_VCHAN(bridge, slot, 0)) {
+    if (!VALIDATE_SLOT_n_VCHAN(slot, 0)) {
 	printk(KERN_WARNING "do_pcibr_rrb_count_avail() invalid slot/vchan");
 	return 0;
     }
     
-    enable_bit = RRB_ENABLE_BIT(bridge);
-
-    tmp = bridge->b_rrb_map[SLOT_2_RRB_REG(bridge, slot)].reg;
-
+    enable_bit = RRB_ENABLE_BIT;
+    
+    tmp = pcireg_rrb_get(pcibr_soft, SLOT_2_RRB_REG(slot));
+    
     for (rrb_index = 0; rrb_index < 8; rrb_index++) {
 	if ((tmp & enable_bit) != enable_bit)
 	    cnt++;
@@ -135,8 +135,8 @@
  * Note that if a request can be partially filled, it will be, even if
  * we return failure.
  */ 
-int
-do_pcibr_rrb_alloc(bridge_t *bridge,
+static int
+do_pcibr_rrb_alloc(pcibr_soft_t pcibr_soft,
 		   pciio_slot_t slot,
 		   int vchan,
 		   int more)
@@ -145,18 +145,18 @@
     uint16_t enable_bit, vchan_bits, pdev_bits, rrb_bits;
     int rrb_index;
     
-    if (!VALIDATE_SLOT_n_VCHAN(bridge, slot, vchan)) {
+    if (!VALIDATE_SLOT_n_VCHAN(slot, vchan)) {
 	printk(KERN_WARNING "do_pcibr_rrb_alloc() invalid slot/vchan");
 	return -1;
     }
     
-    enable_bit = RRB_ENABLE_BIT(bridge);
-    vchan_bits = vchan << NUM_PDEV_BITS(bridge);
-    pdev_bits = SLOT_2_PDEV(bridge, slot);
+    enable_bit = RRB_ENABLE_BIT;
+    vchan_bits = vchan << NUM_PDEV_BITS;
+    pdev_bits = SLOT_2_PDEV(slot);
     rrb_bits = enable_bit | vchan_bits | pdev_bits;
-
-    reg = tmp = bridge->b_rrb_map[SLOT_2_RRB_REG(bridge, slot)].reg;
-
+    
+    reg = tmp = pcireg_rrb_get(pcibr_soft, SLOT_2_RRB_REG(slot));
+    
     for (rrb_index = 0; ((rrb_index < 8) && (more > 0)); rrb_index++) {
 	if ((tmp & enable_bit) != enable_bit) {
 	    /* clear the rrb and OR in the new rrb into 'reg' */
@@ -166,11 +166,41 @@
 	}
 	tmp = (tmp >> RRB_SIZE);
     }
-
-    bridge->b_rrb_map[SLOT_2_RRB_REG(bridge, slot)].reg = reg;
+    
+    pcireg_rrb_set(pcibr_soft, SLOT_2_RRB_REG(slot), reg);
     return (more ? -1 : 0);
 }
  
+/*
+ * Wait for the the specified rrb to have no outstanding XIO pkts
+ * and for all data to be drained.  Mark the rrb as no longer being 
+ * valid.
+ */
+static void
+do_pcibr_rrb_clear(pcibr_soft_t pcibr_soft, int rrb)
+{
+    uint64_t             status;
+
+    /* bridge_lock must be held;  this RRB must be disabled. */
+
+    /* wait until RRB has no outstanduing XIO packets. */
+    status = pcireg_rrb_status_get(pcibr_soft);
+    while (status & RRB_INUSE(rrb)) {
+	status = pcireg_rrb_status_get(pcibr_soft);
+    }
+
+    /* if the RRB has data, drain it. */
+    if (status & RRB_VALID(rrb)) {
+	pcireg_rrb_clear_set(pcibr_soft, RRB_CLEAR(rrb));
+
+	/* wait until RRB is no longer valid. */
+	status = pcireg_rrb_status_get(pcibr_soft);
+	while (status & RRB_VALID(rrb)) {
+	    status = pcireg_rrb_status_get(pcibr_soft);
+	}
+    }
+}
+
  
 /*  
  * Release some of the RRBs that have been allocated for the specified
@@ -180,8 +210,8 @@
  * Note that if a request can be partially fulfilled, it will be, even
  * if we return failure.
  */ 
-int
-do_pcibr_rrb_free(bridge_t *bridge,
+static int
+do_pcibr_rrb_free(pcibr_soft_t pcibr_soft,
 		  pciio_slot_t slot,
 		  int vchan,
 		  int less)
@@ -190,18 +220,18 @@
     uint16_t enable_bit, vchan_bits, pdev_bits, rrb_bits;
     int rrb_index;
     
-    if (!VALIDATE_SLOT_n_VCHAN(bridge, slot, vchan)) {
+    if (!VALIDATE_SLOT_n_VCHAN(slot, vchan)) {
 	printk(KERN_WARNING "do_pcibr_rrb_free() invalid slot/vchan");
 	return -1;
     }
     
-    enable_bit = RRB_ENABLE_BIT(bridge);
-    vchan_bits = vchan << NUM_PDEV_BITS(bridge);
-    pdev_bits = SLOT_2_PDEV(bridge, slot);
+    enable_bit = RRB_ENABLE_BIT;
+    vchan_bits = vchan << NUM_PDEV_BITS;
+    pdev_bits = SLOT_2_PDEV(slot);
     rrb_bits = enable_bit | vchan_bits | pdev_bits;
-
-    reg = tmp = bridge->b_rrb_map[SLOT_2_RRB_REG(bridge, slot)].reg;
-
+    
+    reg = tmp = pcireg_rrb_get(pcibr_soft, SLOT_2_RRB_REG(slot));
+    
     for (rrb_index = 0; ((rrb_index < 8) && (less > 0)); rrb_index++) {
 	if ((tmp & RRB_MASK) == rrb_bits) {
 	   /*
@@ -210,132 +240,144 @@
 	    *	  reg = reg & ~(RRB_MASK << (RRB_SIZE * rrb_index));
 	    * But to be compatible with old code we'll only clear enable.
 	    */
-	    reg = reg & ~(RRB_ENABLE_BIT(bridge) << (RRB_SIZE * rrb_index));
+	    reg = reg & ~(RRB_ENABLE_BIT << (RRB_SIZE * rrb_index));
 	    clr = clr | (enable_bit << (RRB_SIZE * rrb_index));
 	    less--;
 	}
 	tmp = (tmp >> RRB_SIZE);
     }
-
-    bridge->b_rrb_map[SLOT_2_RRB_REG(bridge, slot)].reg = reg;
-
+    
+    pcireg_rrb_set(pcibr_soft, SLOT_2_RRB_REG(slot), reg);
+    
     /* call do_pcibr_rrb_clear() for all the rrbs we've freed */
     for (rrb_index = 0; rrb_index < 8; rrb_index++) {
-	int evn_odd = SLOT_2_RRB_REG(bridge, slot);
+	int evn_odd = SLOT_2_RRB_REG(slot);
 	if (clr & (enable_bit << (RRB_SIZE * rrb_index)))
-	    do_pcibr_rrb_clear(bridge, (2 * rrb_index) + evn_odd);
+	    do_pcibr_rrb_clear(pcibr_soft, (2 * rrb_index) + evn_odd);
     }
     
     return (less ? -1 : 0);
 }
  
-  
+/* 
+ * Flush the specified rrb by calling do_pcibr_rrb_clear().  This
+ * routine is just a wrapper to make sure the rrb is disabled 
+ * before calling do_pcibr_rrb_clear().
+ */
+static void
+do_pcibr_rrb_flush(pcibr_soft_t pcibr_soft, int rrbn)
+{
+    uint64_t	rrbv;
+    int		shft = (RRB_SIZE * (rrbn >> 1));
+    uint64_t	ebit = RRB_ENABLE_BIT << shft;
+
+    rrbv = pcireg_rrb_get(pcibr_soft, (rrbn & 1));
+    if (rrbv & ebit) {
+	pcireg_rrb_set(pcibr_soft, (rrbn & 1), (rrbv & ~ebit));
+    }
+
+    do_pcibr_rrb_clear(pcibr_soft, rrbn);
+
+    if (rrbv & ebit) {
+	pcireg_rrb_set(pcibr_soft, (rrbn & 1), rrbv);
+    }
+}
+
 /*  
  * free all the rrbs (both the normal and virtual channels) for the
  * specified slot.
  */ 
 void
 do_pcibr_rrb_free_all(pcibr_soft_t pcibr_soft,
-		      bridge_t *bridge,
 		      pciio_slot_t slot)
 {
     int vchan;
-    int vchan_total = NUMBER_VCHANNELS(bridge);
+    int vchan_total = NUMBER_VCHANNELS;
     
     /* pretend we own all 8 rrbs and just ignore the return value */
     for (vchan = 0; vchan < vchan_total; vchan++) {
-	    (void)do_pcibr_rrb_free(bridge, slot, vchan, 8);
+	    do_pcibr_rrb_free(pcibr_soft, slot, vchan, 8);
 	    pcibr_soft->bs_rrb_valid[slot][vchan] = 0;
     }
 }
- 
- 
+
+
 /*
- * Wait for the the specified rrb to have no outstanding XIO pkts
- * and for all data to be drained.  Mark the rrb as no longer being 
- * valid.
+ * Initialize a slot with a given number of RRBs.  (this routine
+ * will also give back RRBs if the slot has more than we want).
  */
 void
-do_pcibr_rrb_clear(bridge_t *bridge, int rrb)
-{
-    uint64_t             status;
+pcibr_rrb_alloc_init(pcibr_soft_t pcibr_soft,
+		     int slot,
+		     int vchan,
+		     int init_rrbs)
+{
+    int			 had = pcibr_soft->bs_rrb_valid[slot][vchan];
+    int			 have = had;
+    int			 added = 0;
 
-    /* bridge_lock must be held;
-     * this RRB must be disabled.
-     */
-
-    /* wait until RRB has no outstanduing XIO packets. */
-    while ((status = bridge->b_resp_status) & BRIDGE_RRB_INUSE(rrb)) {
-	;				/* XXX- beats on bridge. bad idea? */
-    }
-
-    /* if the RRB has data, drain it. */
-    if (status & BRIDGE_RRB_VALID(rrb)) {
-	bridge->b_resp_clear = BRIDGE_RRB_CLEAR(rrb);
+    for (added = 0; have < init_rrbs; ++added, ++have) {
+	if (pcibr_soft->bs_rrb_res[slot] > 0)
+	    pcibr_soft->bs_rrb_res[slot]--;
+	else if (pcibr_soft->bs_rrb_avail[slot & 1] > 0)
+	    pcibr_soft->bs_rrb_avail[slot & 1]--;
+	else
+	    break;
+	if (do_pcibr_rrb_alloc(pcibr_soft, slot, vchan, 1) < 0)
+	    break;
 
-	/* wait until RRB is no longer valid. */
-	while ((status = bridge->b_resp_status) & BRIDGE_RRB_VALID(rrb)) {
-		;				/* XXX- beats on bridge. bad idea? */
-	}
+	pcibr_soft->bs_rrb_valid[slot][vchan]++;
     }
-}
-
-
-/* 
- * Flush the specified rrb by calling do_pcibr_rrb_clear().  This
- * routine is just a wrapper to make sure the rrb is disabled 
- * before calling do_pcibr_rrb_clear().
- */
-void
-do_pcibr_rrb_flush(bridge_t *bridge, int rrbn)
-{
-    reg_p	 rrbp = &bridge->b_rrb_map[rrbn & 1].reg;
-    bridgereg_t	 rrbv;
-    int		 shft = (RRB_SIZE * (rrbn >> 1));
-    unsigned long	 ebit = RRB_ENABLE_BIT(bridge) << shft;
 
-    rrbv = *rrbp;
-
-    if (rrbv & ebit) {
-	*rrbp = rrbv & ~ebit;
+    /* Free any extra RRBs that the slot may have allocated to it */
+    while (have > init_rrbs) {
+	pcibr_soft->bs_rrb_avail[slot & 1]++;
+	pcibr_soft->bs_rrb_valid[slot][vchan]--;
+	do_pcibr_rrb_free(pcibr_soft, slot, vchan, 1);
+	added--;
+	have--;
     }
 
-    do_pcibr_rrb_clear(bridge, rrbn);
+    PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_RRB, pcibr_soft->bs_vhdl,
+		"pcibr_rrb_alloc_init: had %d, added/removed %d, "
+		"(of requested %d) RRBs "
+		"to slot %d, vchan %d\n", had, added, init_rrbs,
+		PCIBR_DEVICE_TO_SLOT(pcibr_soft, slot), vchan));
 
-    if (rrbv & ebit) {
-	*rrbp = rrbv;
-    }
+    pcibr_rrb_debug("pcibr_rrb_alloc_init", pcibr_soft);
 }
 
 
+/*
+ * Allocate more RRBs to a given slot (if the RRBs are available).
+ */
 void
-do_pcibr_rrb_autoalloc(pcibr_soft_t pcibr_soft,
-		       int slot,
-		       int vchan, 
-		       int more_rrbs)
+pcibr_rrb_alloc_more(pcibr_soft_t pcibr_soft,
+		     int slot,
+		     int vchan, 
+		     int more_rrbs)
 {
-    bridge_t               *bridge = pcibr_soft->bs_base;
-    int                     got;
+    int			 added;
 
-    for (got = 0; got < more_rrbs; ++got) {
+    for (added = 0; added < more_rrbs; ++added) {
 	if (pcibr_soft->bs_rrb_res[slot] > 0)
 	    pcibr_soft->bs_rrb_res[slot]--;
 	else if (pcibr_soft->bs_rrb_avail[slot & 1] > 0)
 	    pcibr_soft->bs_rrb_avail[slot & 1]--;
 	else
 	    break;
-	if (do_pcibr_rrb_alloc(bridge, slot, vchan, 1) < 0)
+	if (do_pcibr_rrb_alloc(pcibr_soft, slot, vchan, 1) < 0)
 	    break;
 
 	pcibr_soft->bs_rrb_valid[slot][vchan]++;
     }
 
     PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_RRB, pcibr_soft->bs_vhdl,
-		"do_pcibr_rrb_autoalloc: added %d (of %d requested) RRBs "
-		"to slot %d, vchan %d\n", got, more_rrbs, 
+		"pcibr_rrb_alloc_more: added %d (of %d requested) RRBs "
+		"to slot %d, vchan %d\n", added, more_rrbs, 
 		PCIBR_DEVICE_TO_SLOT(pcibr_soft, slot), vchan));
 
-    pcibr_rrb_debug("do_pcibr_rrb_autoalloc", pcibr_soft);
+    pcibr_rrb_debug("pcibr_rrb_alloc_more", pcibr_soft);
 }
 
 
@@ -348,25 +390,24 @@
     pciio_info_t  pciio_info = pciio_info_get(pconn_vhdl);
     pcibr_soft_t  pcibr_soft = (pcibr_soft_t)pciio_info_mfast_get(pciio_info);
     pciio_slot_t  slot = PCIBR_INFO_SLOT_GET_INT(pciio_info);
-    bridge_t	 *bridge = pcibr_soft->bs_base;
 
     uint64_t tmp;
     uint16_t enable_bit, pdev_bits, rrb_bits, rrb_mask;
     int rrb_index;
     unsigned long s;
 
-    enable_bit = RRB_ENABLE_BIT(bridge);
-    pdev_bits = SLOT_2_PDEV(bridge, slot);
+    enable_bit = RRB_ENABLE_BIT;
+    pdev_bits = SLOT_2_PDEV(slot);
     rrb_bits = enable_bit | pdev_bits;
-    rrb_mask = enable_bit | ((NUM_PDEV_BITS(bridge) << 1) - 1);
+    rrb_mask = enable_bit | ((NUM_PDEV_BITS << 1) - 1);
 
-    tmp = bridge->b_rrb_map[SLOT_2_RRB_REG(bridge, slot)].reg;
+    tmp = pcireg_rrb_get(pcibr_soft, SLOT_2_RRB_REG(slot));
 
     s = pcibr_lock(pcibr_soft);
     for (rrb_index = 0; rrb_index < 8; rrb_index++) {
-	int evn_odd = SLOT_2_RRB_REG(bridge, slot);
+	int evn_odd = SLOT_2_RRB_REG(slot);
 	if ((tmp & rrb_mask) == rrb_bits)
-	    do_pcibr_rrb_flush(bridge, (2 * rrb_index) + evn_odd);
+	    do_pcibr_rrb_flush(pcibr_soft, (2 * rrb_index) + evn_odd);
 	tmp = (tmp >> RRB_SIZE);
     }
     pcibr_unlock(pcibr_soft, s);
@@ -383,13 +424,10 @@
     pciio_info_t            pciio_info = pciio_info_get(pconn_vhdl);
     pciio_slot_t            pciio_slot = PCIBR_INFO_SLOT_GET_INT(pciio_info);
     pcibr_soft_t            pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info);
-    bridge_t               *bridge = pcibr_soft->bs_base;
-    volatile bridgereg_t   *wrb_flush;
 
-    wrb_flush = &(bridge->b_wr_req_buf[pciio_slot].reg);
-    while (*wrb_flush)
-	;
-    return(0);
+    pcireg_wrb_flush_get(pcibr_soft, pciio_slot);
+
+    return 0;
 }
 
 /*
@@ -411,7 +449,6 @@
     pciio_info_t            pciio_info = pciio_info_get(pconn_vhdl);
     pciio_slot_t            pciio_slot = PCIBR_INFO_SLOT_GET_INT(pciio_info);
     pcibr_soft_t            pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info);
-    bridge_t               *bridge = pcibr_soft->bs_base;
     int                     desired_vchan0;
     int                     desired_vchan1;
     int                     orig_vchan0;
@@ -441,7 +478,7 @@
 
     s = pcibr_lock(pcibr_soft);
 
-    vchan_total = NUMBER_VCHANNELS(bridge);
+    vchan_total = NUMBER_VCHANNELS;
 
     /* Save the boot-time RRB configuration for this slot */
     if (pcibr_soft->bs_rrb_valid_dflt[pciio_slot][VCHAN0] < 0) {
@@ -507,14 +544,14 @@
 	/* Commit the allocations: free, then alloc.
 	 */
 	if (delta_vchan0 < 0)
-	    (void) do_pcibr_rrb_free(bridge, pciio_slot, VCHAN0, -delta_vchan0);
+	    do_pcibr_rrb_free(pcibr_soft, pciio_slot, VCHAN0, -delta_vchan0);
 	if (delta_vchan1 < 0)
-	    (void) do_pcibr_rrb_free(bridge, pciio_slot, VCHAN1, -delta_vchan1);
+	    do_pcibr_rrb_free(pcibr_soft, pciio_slot, VCHAN1, -delta_vchan1);
 
 	if (delta_vchan0 > 0)
-	    (void) do_pcibr_rrb_alloc(bridge, pciio_slot, VCHAN0, delta_vchan0);
+	    do_pcibr_rrb_alloc(pcibr_soft, pciio_slot, VCHAN0, delta_vchan0);
 	if (delta_vchan1 > 0)
-	    (void) do_pcibr_rrb_alloc(bridge, pciio_slot, VCHAN1, delta_vchan1);
+	    do_pcibr_rrb_alloc(pcibr_soft, pciio_slot, VCHAN1, delta_vchan1);
 
 	/* Return final values to caller.
 	 */
@@ -666,7 +703,6 @@
     pcibr_soft_t	 pcibr_soft;
     pcibr_info_h	 pcibr_infoh;
     pcibr_info_t	 pcibr_info;
-    bridge_t		*bridge;
     int 		 vchan_total;
     int			 vchan;
     int                  chan[4];
@@ -674,17 +710,15 @@
     pcibr_soft = pcibr_soft_get(pcibr_vhdl);
 
     if (!pcibr_soft)
-	return(-EINVAL);
+	return -EINVAL;
 
     if (!PCIBR_VALID_SLOT(pcibr_soft, slot))
-	return(-EINVAL);
-
-    bridge = pcibr_soft->bs_base;
+	return -EINVAL;
 
     /* How many RRBs are on this slot? */
-    vchan_total = NUMBER_VCHANNELS(bridge);
+    vchan_total = NUMBER_VCHANNELS;
     for (vchan = 0; vchan < vchan_total; vchan++) 
-        chan[vchan] = do_pcibr_rrb_count_valid(bridge, slot, vchan);
+        chan[vchan] = do_pcibr_rrb_count_valid(pcibr_soft, slot, vchan);
 
     PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_RRB, pcibr_vhdl,
 	    "pcibr_slot_initial_rrb_alloc: slot %d started with %d+%d+%d+%d\n",
@@ -695,44 +729,44 @@
      */
     pcibr_infoh = pcibr_soft->bs_slot[slot].bss_infos;
     pcibr_info = pcibr_infoh[0];
+    /*
+     * PIC BRINGUP WAR (PV# 856866, 859504, 861476, 861478):
+     * Don't free RRBs we allocated to device[2|3]--vchan3 as
+     * a WAR to those PVs mentioned above.  In pcibr_attach2
+     * we allocate RRB0,8,1,9 to device[2|3]--vchan3.
+     */
+    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) {
 
-    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) {
-
-        for (vchan = 0; vchan < 2; vchan++) {
-            do_pcibr_rrb_free(bridge, slot, vchan, 8);
-            pcibr_soft->bs_rrb_valid[slot][vchan] = 0;
-        }
+	for (vchan = 0; vchan < 2; vchan++) {
+	    do_pcibr_rrb_free(pcibr_soft, slot, vchan, 8);
+	    pcibr_soft->bs_rrb_valid[slot][vchan] = 0;
+	}
 
         pcibr_soft->bs_rrb_valid[slot][3] = chan[3];
 
-        return(-ENODEV);
+        return -ENODEV;
     }
 
-    /* Give back any assigned to empty slots */
-    if ((pcibr_info->f_vendor == PCIIO_VENDOR_ID_NONE) && !pcibr_soft->bs_slot[slot].has_host) {
-	do_pcibr_rrb_free_all(pcibr_soft, bridge, slot);
-	return(-ENODEV);
+    if ((pcibr_info->f_vendor == PCIIO_VENDOR_ID_NONE) &&
+	!pcibr_soft->bs_slot[slot].has_host) {
+	do_pcibr_rrb_free_all(pcibr_soft, slot);
+        
+	/* Reserve RRBs for this empty slot for hot-plug */
+	for (vchan = 0; vchan < vchan_total; vchan++) 
+	    pcibr_soft->bs_rrb_valid[slot][vchan] = 0;
+
+	return -ENODEV;
     }
 
     for (vchan = 0; vchan < vchan_total; vchan++)
         pcibr_soft->bs_rrb_valid[slot][vchan] = chan[vchan];
 
-    return(0);
+    return 0;
 }
 
-void
-rrb_reserved_free(pcibr_soft_t pcibr_soft, int slot)
-{
-        int res = pcibr_soft->bs_rrb_res[slot];
-
-        if (res) {
-                 pcibr_soft->bs_rrb_avail[slot & 1] += res;
-                 pcibr_soft->bs_rrb_res[slot] = 0;
-        }
-}
 
 /*
  * pcibr_initial_rrb
@@ -750,7 +784,6 @@
 			     pciio_slot_t first, pciio_slot_t last)
 {
     pcibr_soft_t            pcibr_soft = pcibr_soft_get(pcibr_vhdl);
-    bridge_t               *bridge = pcibr_soft->bs_base;
     pciio_slot_t            slot;
     int			    rrb_total;
     int			    vchan_total;
@@ -763,12 +796,12 @@
     have[1][0] = have[1][1] = have[1][2] = 0;
     res[0] = res[1] = 0;
 
-    vchan_total = NUMBER_VCHANNELS(bridge);
+    vchan_total = NUMBER_VCHANNELS;
 
     for (slot = pcibr_soft->bs_min_slot; 
 			slot < PCIBR_NUM_SLOTS(pcibr_soft); ++slot) {
         /* Initial RRB management; give back RRBs in all non-existent slots */
-        (void) pcibr_slot_initial_rrb_alloc(pcibr_vhdl, slot);
+        pcibr_slot_initial_rrb_alloc(pcibr_vhdl, slot);
 
         /* Base calculations only on existing slots */
         if ((slot >= first) && (slot <= last)) {
@@ -782,8 +815,8 @@
     }
 
     /* Initialize even/odd slot available RRB counts */
-    pcibr_soft->bs_rrb_avail[0] = do_pcibr_rrb_count_avail(bridge, 0);
-    pcibr_soft->bs_rrb_avail[1] = do_pcibr_rrb_count_avail(bridge, 1);
+    pcibr_soft->bs_rrb_avail[0] = do_pcibr_rrb_count_avail(pcibr_soft, 0);
+    pcibr_soft->bs_rrb_avail[1] = do_pcibr_rrb_count_avail(pcibr_soft, 1);
 
     /*
      * Calculate reserved RRBs for slots based on current RRB usage
@@ -804,6 +837,9 @@
     for (slot = first; slot <= last; ++slot) {
         int                     r;
 
+	if (pcibr_soft->bs_unused_slot & (1 << slot))
+	    continue;
+
 	rrb_total = 0;
 	for (vchan = 0; vchan < vchan_total; vchan++)
 		rrb_total += pcibr_soft->bs_rrb_valid[slot][vchan];
@@ -829,7 +865,6 @@
 pcibr_rrb_debug(char *calling_func, pcibr_soft_t pcibr_soft)
 {
     pciio_slot_t slot;
-    char tmp_str[256];
     
     if (pcibr_debug_mask & PCIBR_DEBUG_RRB) {
         PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_RRB, pcibr_soft->bs_vhdl,
@@ -837,23 +872,17 @@
                     pcibr_soft->bs_rrb_avail[0], pcibr_soft->bs_rrb_avail[1]));
 
         PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_RRB, pcibr_soft->bs_vhdl,
-                        "\tslot\tvchan0\tvchan1\tvchan2\tvchan3\treserved\n"));
+                    "\tslot\tvchan0\tvchan1\tvchan2\tvchan3\treserved\n"));
 
         for (slot=0; slot < PCIBR_NUM_SLOTS(pcibr_soft); slot++) {
-	    /*
-             * 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.
-             */
-            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]);
             PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_RRB, pcibr_soft->bs_vhdl,
-                        "%s", 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]));
         }
     }
 }
--- diff/arch/ia64/sn/io/sn2/pcibr/pcibr_slot.c	2004-02-09 10:36:07.000000000 +0000
+++ source/arch/ia64/sn/io/sn2/pcibr/pcibr_slot.c	2004-02-09 10:39:51.000000000 +0000
@@ -37,11 +37,12 @@
 		 pciio_slot_t slot, int drv_flags);
 int pcibr_slot_detach(vertex_hdl_t pcibr_vhdl, pciio_slot_t slot,
                  int drv_flags, char *l1_msg, int *sub_errorp);
-static int pcibr_probe_slot(bridge_t *, cfg_p, unsigned int *);
+static int pcibr_probe_slot(pcibr_soft_t, cfg_p, unsigned int *);
+static int pcibr_probe_work(pcibr_soft_t pcibr_soft, void *addr, int len, void *valp);
 void pcibr_device_info_free(vertex_hdl_t, pciio_slot_t);
 iopaddr_t pcibr_bus_addr_alloc(pcibr_soft_t, pciio_win_info_t, 
                                pciio_space_t, int, int, int);
-void pciibr_bus_addr_free(pcibr_soft_t, pciio_win_info_t);
+void pcibr_bus_addr_free(pciio_win_info_t);
 cfg_p pcibr_find_capability(cfg_p, unsigned);
 extern uint64_t  do_pcibr_config_get(cfg_p, unsigned, unsigned);
 void do_pcibr_config_set(cfg_p, unsigned, unsigned, uint64_t); 
@@ -57,22 +58,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 };
 
-char *pci_space_name[] = {"NONE", 
-			  "ROM",
-			  "IO",
-			  "",
-			  "MEM",
-			  "MEM32",
-			  "MEM64",
-			  "CFG",
-			  "WIN0",
-			  "WIN1",
-			  "WIN2",
-			  "WIN3",
-			  "WIN4",
-			  "WIN5",
-			  "",
-			  "BAD"};
 
 /*
  * pcibr_slot_info_init
@@ -87,7 +72,6 @@
     pcibr_soft_t	    pcibr_soft;
     pcibr_info_h	    pcibr_infoh;
     pcibr_info_t	    pcibr_info;
-    bridge_t		   *bridge;
     cfg_p                   cfgw;
     unsigned                idword;
     unsigned                pfail;
@@ -106,28 +90,28 @@
     int			    func;
     vertex_hdl_t	    conn_vhdl;
     pcibr_soft_slot_t	    slotp;
-    
+    uint64_t		    device_reg;
+
     /* Get the basic software information required to proceed */
     pcibr_soft = pcibr_soft_get(pcibr_vhdl);
     if (!pcibr_soft)
-	return(EINVAL);
+	return -EINVAL;
 
-    bridge = pcibr_soft->bs_base;
     if (!PCIBR_VALID_SLOT(pcibr_soft, slot))
-	return(EINVAL);
+	return -EINVAL;
 
     /* If we have a host slot (eg:- IOC3 has 2 PCI slots and the initialization
      * is done by the host slot then we are done.
      */
     if (pcibr_soft->bs_slot[slot].has_host) {
-	return(0);    
+	return 0;
     }
 
     /* Try to read the device-id/vendor-id from the config space */
-    cfgw = pcibr_slot_config_addr(bridge, slot, 0);
+    cfgw = pcibr_slot_config_addr(pcibr_soft, slot, 0);
 
-    if (pcibr_probe_slot(bridge, cfgw, &idword)) 
-	return(ENODEV);
+    if (pcibr_probe_slot(pcibr_soft, cfgw, &idword)) 
+	return -ENODEV;
 
     slotp = &pcibr_soft->bs_slot[slot];
     slotp->slot_status |= SLOT_POWER_UP;
@@ -143,7 +127,7 @@
      * and we are done.
      */
     if (vendor == 0xFFFF) 
-	return(ENODEV);			
+	return -ENODEV;
     
     htype = do_pcibr_config_get(cfgw, PCI_CFG_HEADER_TYPE, 1);
     nfunc = 1;
@@ -157,8 +141,8 @@
 
     if (htype & 0x80) {		/* MULTIFUNCTION */
 	for (func = 1; func < 8; ++func) {
-	    cfgw = pcibr_func_config_addr(bridge, 0, slot, func, 0);
-	    if (pcibr_probe_slot(bridge, cfgw, &idwords[func])) {
+	    cfgw = pcibr_func_config_addr(pcibr_soft, 0, slot, func, 0);
+	    if (pcibr_probe_slot(pcibr_soft, cfgw, &idwords[func])) {
 		pfail |= 1 << func;
 		continue;
 	    }
@@ -170,11 +154,11 @@
 	    nfunc = func + 1;
 	    rfunc = 0;
 	}
-        cfgw = pcibr_slot_config_addr(bridge, slot, 0);
+        cfgw = pcibr_slot_config_addr(pcibr_soft, slot, 0);
     }
     pcibr_infoh = kmalloc(nfunc*sizeof (*(pcibr_infoh)), GFP_KERNEL);
     if ( !pcibr_infoh ) {
-	return ENOMEM;
+	return -ENOMEM;
     }
     memset(pcibr_infoh, 0, nfunc*sizeof (*(pcibr_infoh)));
     
@@ -189,7 +173,7 @@
 		continue;
 	    
 	    idword = idwords[func];
-	    cfgw = pcibr_func_config_addr(bridge, 0, slot, func, 0);
+	    cfgw = pcibr_func_config_addr(pcibr_soft, 0, slot, func, 0);
 	    
 	    device = 0xFFFF & (idword >> 16);
 	    htype = do_pcibr_config_get(cfgw, PCI_CFG_HEADER_TYPE, 1);
@@ -223,9 +207,8 @@
 	 */
 
 	lt_time = do_pcibr_config_get(cfgw, PCI_CFG_LATENCY_TIMER, 1);
-
-	if ((lt_time == 0) && !(bridge->b_device[slot].reg & BRIDGE_DEV_RT) &&
-				       (device == 0x5 /* RAD_DEV */)) {
+	device_reg = pcireg_device_get(pcibr_soft, slot);
+	if ((lt_time == 0) && !(device_reg & BRIDGE_DEV_RT)) {
 	     unsigned	min_gnt;
 	     unsigned	min_gnt_mult;
 	    
@@ -272,12 +255,14 @@
 			"func=%d, to 0x20\n",
 			PCIBR_DEVICE_TO_SLOT(pcibr_soft, slot), func));
 	    }
+	}
 
-	    /* Get the PCI-X capability if running in PCI-X mode.  If the func
-	     * doesnt have a pcix capability, allocate a PCIIO_VENDOR_ID_NONE
-	     * pcibr_info struct so the device driver for that function is not
-	     * called.
-	     */
+	/* Get the PCI-X capability if running in PCI-X mode.  If the func
+	 * doesnt have a pcix capability, allocate a PCIIO_VENDOR_ID_NONE
+	 * pcibr_info struct so the device driver for that function is not
+	 * called.
+	 */
+	if (IS_PCIX(pcibr_soft)) {
 	    if (!(pcix_cap = pcibr_find_capability(cfgw, PCI_CAP_PCIX))) {
 		printk(KERN_WARNING
 		        "%s: Bus running in PCI-X mode, But card in slot %d, "
@@ -398,7 +383,31 @@
 	    }
 
 	    if (base != 0) {	/* estimate size */
+		pciio_space_t	tmp_space = space;
+		iopaddr_t	tmp_base;
+
 		size = base & -base;
+
+		/*
+		 * Reserve this space in the relavent address map.  Don't
+		 * care about the return code from pcibr_bus_addr_alloc().
+		 */
+
+		if (space == PCIIO_SPACE_MEM && code != PCI_BA_MEM_1MEG) {
+			tmp_space = PCIIO_SPACE_MEM32;
+		}
+
+                tmp_base = pcibr_bus_addr_alloc(pcibr_soft,
+                                            	&pcibr_info->f_window[win],
+                                            	tmp_space,
+                                            	base, size, 0);
+
+		PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_BAR, pcibr_vhdl,
+			"pcibr_slot_info_init: slot=%d, func=%d win %d "
+			"reserving space %s [0x%lx..0x%lx], tmp_base 0x%lx\n",
+			PCIBR_DEVICE_TO_SLOT(pcibr_soft, slot), func, win,
+			pci_space[tmp_space], (uint64_t)base,
+			(uint64_t)(base + size - 1), (uint64_t)tmp_base));
 	    } else {		/* calculate size */
 		do_pcibr_config_set(wptr, (win * 4), 4, ~0);    /* write 1's */
 		size = do_pcibr_config_get(wptr, (win * 4), 4); /* read back */
@@ -419,7 +428,7 @@
 	}				/* next win */
     }				/* next func */
 
-    return(0);
+    return 0;
 }					
 
 /*
@@ -438,7 +447,7 @@
 
     /* Check to see if there is a capabilities pointer in the cfg header */
     if (!(do_pcibr_config_get(cfgw, PCI_CFG_STATUS, 2) & PCI_STAT_CAP_LIST)) {
-	return (NULL);
+	return NULL;
     }
 
     /*
@@ -453,13 +462,13 @@
     while (cap_nxt && (defend_against_circular_linkedlist <= 48)) {
 	cap_id = do_pcibr_config_get(cfgw, cap_nxt, 1);
 	if (cap_id == capability) {
-	    return ((cfg_p)((char *)cfgw + cap_nxt));
+	    return (cfg_p)((char *)cfgw + cap_nxt);
 	}
 	cap_nxt = (do_pcibr_config_get(cfgw, cap_nxt+1, 1) & 0xfc);
 	defend_against_circular_linkedlist++;
     }
 
-    return (NULL);
+    return NULL;
 }
 
 /*
@@ -478,10 +487,10 @@
     pcibr_soft = pcibr_soft_get(pcibr_vhdl);
 
     if (!pcibr_soft)
-	return(EINVAL);
+	return -EINVAL;
 
     if (!PCIBR_VALID_SLOT(pcibr_soft, slot))
-	return(EINVAL);
+	return -EINVAL;
 
     nfunc = pcibr_soft->bs_slot[slot].bss_ninfo;
 
@@ -491,7 +500,7 @@
     kfree(pcibr_infoh);
     pcibr_soft->bs_slot[slot].bss_ninfo = 0;
 
-    return(0);
+    return 0;
 }
 
 /*
@@ -508,13 +517,13 @@
     int			 func;
 
     if (!PCIBR_VALID_SLOT(pcibr_soft, slot))
-	return(EINVAL);
+	return -EINVAL;
 
     if ((nfunc = pcibr_soft->bs_slot[slot].bss_ninfo) < 1)
-	return(EINVAL);
+	return -EINVAL;
 
     if (!(pcibr_infoh = pcibr_soft->bs_slot[slot].bss_infos))
-	return(EINVAL);
+	return -EINVAL;
 
     PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_RBAR, pcibr_soft->bs_vhdl,
 		"pcibr_slot_pcix_rbar_init for slot %d\n", 
@@ -586,7 +595,7 @@
 		pcibr_soft->bs_pcix_rbar_inuse,
 		pcibr_soft->bs_pcix_rbar_avail));
     }
-    return(0);
+    return 0;
 }
 
 int as_debug = 0;
@@ -602,41 +611,38 @@
     pcibr_soft_t	 pcibr_soft;
     pcibr_info_h	 pcibr_infoh;
     pcibr_info_t	 pcibr_info;
-    bridge_t		*bridge;
     iopaddr_t            mask;
     int		       	 nbars;
     int		       	 nfunc;
     int			 func;
     int			 win;
     int                  rc = 0;
-    int			 align;
+    int			 align = 0;
     int			 align_slot;
 
     pcibr_soft = pcibr_soft_get(pcibr_vhdl);
 
     if (!pcibr_soft)
-	return(EINVAL);
+	return -EINVAL;
 
     if (!PCIBR_VALID_SLOT(pcibr_soft, slot))
-	return(EINVAL);
-
-    bridge = pcibr_soft->bs_base;
+	return -EINVAL;
 
     /* allocate address space,
      * for windows that have not been
      * previously assigned.
      */
     if (pcibr_soft->bs_slot[slot].has_host) {
-	return(0);
+	return 0;
     }
 
     nfunc = pcibr_soft->bs_slot[slot].bss_ninfo;
     if (nfunc < 1)
-	return(EINVAL);
+	return -EINVAL;
 
     pcibr_infoh = pcibr_soft->bs_slot[slot].bss_infos;
     if (!pcibr_infoh)
-	return(EINVAL);
+	return -EINVAL;
 
     /*
      * Try to make the DevIO windows not
@@ -668,7 +674,7 @@
 	if (pcibr_info->f_vendor == PCIIO_VENDOR_ID_NONE)
 	    continue;
 	
-        cfgw = pcibr_func_config_addr(bridge, 0, slot, func, 0);
+        cfgw = pcibr_func_config_addr(pcibr_soft, 0, slot, func, 0);
 	wptr = cfgw + PCI_CFG_BASE_ADDR_0 / 4;
 
 	if ((do_pcibr_config_get(cfgw, PCI_CFG_HEADER_TYPE, 1) & 0x7f) != 0)
@@ -821,7 +827,7 @@
 	    do_pcibr_config_set(cfgw, PCI_CFG_COMMAND, 4, 
 				pci_cfg_cmd_reg | pci_cfg_cmd_reg_add);
     }				/* next func */
-    return(rc);
+    return rc;
 }
 
 /*
@@ -834,40 +840,45 @@
 		       pciio_slot_t slot)
 {
     pcibr_soft_t	 pcibr_soft;
-    bridge_t		*bridge;
-    bridgereg_t		 devreg;
+    uint64_t		 devreg;
 
     pcibr_soft = pcibr_soft_get(pcibr_vhdl);
 
     if (!pcibr_soft)
-	return(EINVAL);
+	return -EINVAL;
 
     if (!PCIBR_VALID_SLOT(pcibr_soft, slot))
-	return(EINVAL);
-
-    bridge = pcibr_soft->bs_base;
+	return -EINVAL;
 
     /*
-     * Adjustments to Device(x)
-     * and init of bss_device shadow
+     * Adjustments to Device(x) and init of bss_device shadow
      */
-    devreg = bridge->b_device[slot].reg;
+    devreg = pcireg_device_get(pcibr_soft, slot);
     devreg &= ~BRIDGE_DEV_PAGE_CHK_DIS;
 
     /*
-     * PIC WAR. PV# 855271
-     * Don't enable virtual channels in the PIC by default.
-     * Can cause problems with 32-bit devices. (The bit is only intended
-     * for 64-bit devices).  We set the bit in pcibr_try_set_device()
-     * if we're 64-bit and requesting virtual channels.
+     * Enable virtual channels by default (exception: see PIC WAR below)
      */
-    if (PCIBR_WAR_ENABLED(PV855271, pcibr_soft))
-	devreg |= BRIDGE_DEV_COH;
-    else
-	devreg |= BRIDGE_DEV_COH | BRIDGE_DEV_VIRTUAL_EN;
+    devreg |= BRIDGE_DEV_VIRTUAL_EN;
+
+    /*
+     * PIC WAR. PV# 855271:  Disable virtual channels in the PIC since
+     * it can cause problems with 32-bit devices.  We'll set the bit in
+     * pcibr_try_set_device() iff we're 64-bit and requesting virtual 
+     * channels.
+     */
+    if (PCIBR_WAR_ENABLED(PV855271, pcibr_soft)) {
+	devreg &= ~BRIDGE_DEV_VIRTUAL_EN;
+    }
+    devreg |= BRIDGE_DEV_COH;
+
     pcibr_soft->bs_slot[slot].bss_device = devreg;
-    bridge->b_device[slot].reg = devreg;
-    return(0);
+    pcireg_device_set(pcibr_soft, slot, devreg);
+
+    PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_DEVREG, pcibr_vhdl,
+		"pcibr_slot_device_init: Device(%d): 0x%x\n",
+		slot, devreg));
+    return 0;
 }
 
 /*
@@ -886,10 +897,10 @@
     pcibr_soft = pcibr_soft_get(pcibr_vhdl);
 
     if (!pcibr_soft)
-	return(EINVAL);
+	return -EINVAL;
 
     if (!PCIBR_VALID_SLOT(pcibr_soft, slot))
-	return(EINVAL);
+	return -EINVAL;
 
     slotp = &pcibr_soft->bs_slot[slot];
 
@@ -901,7 +912,7 @@
     if (pcibr_soft->bs_slot[slot].bss_ninfo < 1) {
 	pcibr_infoh = kmalloc(sizeof (*(pcibr_infoh)), GFP_KERNEL);
 	if ( !pcibr_infoh ) {
-		return ENOMEM;
+		return -ENOMEM;
 	}
 	memset(pcibr_infoh, 0, sizeof (*(pcibr_infoh)));
 
@@ -939,7 +950,7 @@
 			 EDGE_LBL_GUEST);
     }
 
-    return(0);
+    return 0;
 }
 
 
@@ -966,13 +977,13 @@
     pcibr_soft = pcibr_soft_get(pcibr_vhdl);
 
     if (!pcibr_soft)
-	return(EINVAL);
+	return -EINVAL;
 
     if (!PCIBR_VALID_SLOT(pcibr_soft, slot))
-	return(EINVAL);
+	return -EINVAL;
 
     if (pcibr_soft->bs_slot[slot].has_host) {
-        return(EPERM);
+        return -EPERM;
     }
     
     xconn_vhdl = pcibr_soft->bs_conn;
@@ -1018,7 +1029,7 @@
         pcibr_soft->bs_slot[slot].slot_status |= SLOT_STARTUP_CMPLT;
     }
         
-    return(error);
+    return error;
 }
 
 /*
@@ -1044,13 +1055,13 @@
     pcibr_soft = pcibr_soft_get(pcibr_vhdl);
 
     if (!pcibr_soft)
-	return(EINVAL);
+	return -EINVAL;
 
     if (!PCIBR_VALID_SLOT(pcibr_soft, slot))
-	return(EINVAL);
+	return -EINVAL;
 
     if (pcibr_soft->bs_slot[slot].has_host)
-        return(EPERM);
+        return -EPERM;
 
     nfunc = pcibr_soft->bs_slot[slot].bss_ninfo;
     pcibr_infoh = pcibr_soft->bs_slot[slot].bss_infos;
@@ -1105,45 +1116,7 @@
         pcibr_soft->bs_slot[slot].slot_status |= SLOT_SHUTDOWN_CMPLT;
     }
         
-    return(error);
-}
-
-/*
- * pcibr_slot_attach
- *	This is a place holder routine to keep track of all the
- *	slot-specific initialization that needs to be done.
- *	This is usually called when we want to initialize a new
- * 	PCI card on the bus.
- */
-int
-pcibr_slot_attach(vertex_hdl_t pcibr_vhdl,
-		  pciio_slot_t slot,
-		  int          drv_flags,
-		  char        *l1_msg,
-                  int         *sub_errorp)
-{
-    pcibr_soft_t  pcibr_soft = pcibr_soft_get(pcibr_vhdl);
-    int		  error;
-
-    /* Do not allow a multi-function card to be hot-plug inserted */
-    if (pcibr_soft->bs_slot[slot].bss_ninfo > 1) {
-        if (sub_errorp)
-            *sub_errorp = EPERM;
-        return(PCI_MULTI_FUNC_ERR);
-    }
-
-    /* Call the device attach */
-    error = pcibr_slot_call_device_attach(pcibr_vhdl, slot, drv_flags);
-    if (error) {
-        if (sub_errorp)
-            *sub_errorp = error;
-        if (error == EUNATCH)
-            return(PCI_NO_DRIVER);
-        else
-            return(PCI_SLOT_DRV_ATTACH_ERR);
-    }
-
-    return(0);
+    return error;
 }
 
 /*
@@ -1166,7 +1139,9 @@
     if (error) {
         if (sub_errorp)
             *sub_errorp = error;       
-        return(PCI_SLOT_DRV_DETACH_ERR);
+	if (l1_msg)
+	    ;
+        return PCI_SLOT_DRV_DETACH_ERR;
     }
 
     /* Recalculate the RBARs for all the devices on the bus since we've
@@ -1185,7 +1160,7 @@
             (void)pcibr_slot_pcix_rbar_init(pcibr_soft, tmp_slot);
     }
 
-    return (0);
+    return 0;
 
 }
 
@@ -1197,33 +1172,35 @@
  * through the valp parameter.
  */
 static int
-pcibr_probe_slot_pic(bridge_t *bridge,
-                 cfg_p cfg,
-                 unsigned *valp)
+pcibr_probe_slot(pcibr_soft_t pcibr_soft,
+		 cfg_p cfg,
+		 unsigned *valp)
 {
-	int rv;
-	picreg_t p_old_enable = (picreg_t)0, p_new_enable;
-	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);
-	bridge->p_int_enable_64 = p_new_enable;
-
-	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;
-
-	if (bridge->p_int_status_64 & (BRIDGE_IRR_PCI_GRP | PIC_PCIX_GRP_CLR)) {
-		bridge->p_int_rst_stat_64 = (BRIDGE_IRR_PCI_GRP_CLR | PIC_PCIX_GRP_CLR);
-		(void) bridge->b_wid_tflush;	/* flushbus */
-	}
-	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 */
+    return pcibr_probe_work(pcibr_soft, (void *)cfg, 4, (void *)valp);
+}
+
+/*
+ * Probe an offset within a piomap with errors disabled.
+ * len must be 1, 2, 4, or 8.  	The probed address must be a multiple of
+ * len.
+ *
+ * Returns:	0	if the offset was probed and put valid data in valp
+ *		-1	if there was a usage error such as improper alignment
+ *			or out of bounds offset/len combination.  In this
+ *			case, the map was not probed
+ *		1 	if the offset was probed but resulted in an error
+ *			such as device not responding, bus error, etc.
+ */
+
+int
+pcibr_piomap_probe(pcibr_piomap_t piomap, off_t offset, int len, void *valp)
+{
+	if (offset + len > piomap->bp_mapsz) {
+		return -1;
 	}
-	bridge->p_int_enable_64 = p_old_enable;
-	bridge->b_wid_tflush;		/* wait until Bridge PIO complete */
-	return(rv);
+
+	return pcibr_probe_work(piomap->bp_soft,
+				piomap->bp_kvaddr + offset, len, valp);
 }
 
 /*
@@ -1234,11 +1211,31 @@
  * through the valp parameter.
  */
 static int
-pcibr_probe_slot(bridge_t *bridge,
-		 cfg_p cfg,
-		 unsigned *valp)
+pcibr_probe_work(pcibr_soft_t pcibr_soft,
+		 void *addr,
+		 int len,
+		 void *valp)
 {
-    return(pcibr_probe_slot_pic(bridge, cfg, valp));
+    int			rv;
+
+    /*
+     * Sanity checks ...
+     */
+
+    if (len != 1 && len != 2 && len != 4 && len != 8) {
+	return -1;				/* invalid len */
+    }
+
+    if ((uint64_t)addr & (len-1)) {
+	return -1;				/* invalid alignment */
+    }
+
+    rv = snia_badaddr_val((void *)addr, len, valp);
+
+    /* Clear the int_view register incase it was set */
+    pcireg_intr_reset_set(pcibr_soft, BRIDGE_IRR_MULTI_CLR);
+
+    return (rv ? 1 : 0);	/* return 1 for snia_badaddr_val error, 0 if ok */
 }
 
 
@@ -1249,7 +1246,6 @@
     pcibr_info_t	pcibr_info;
     pciio_function_t	func;
     pcibr_soft_slot_t	slotp = &pcibr_soft->bs_slot[slot];
-    bridge_t           *bridge = pcibr_soft->bs_base; 
     cfg_p               cfgw;
     int			nfunc = slotp->bss_ninfo;
     int                 bar;
@@ -1267,7 +1263,7 @@
         s = pcibr_lock(pcibr_soft);
 
         /* Disable memory and I/O BARs */
-	cfgw = pcibr_func_config_addr(bridge, 0, slot, func, 0);
+	cfgw = pcibr_func_config_addr(pcibr_soft, 0, slot, func, 0);
 	cmd_reg = do_pcibr_config_get(cfgw, PCI_CFG_COMMAND, 4);
 	cmd_reg &= (PCI_CMD_MEM_SPACE | PCI_CMD_IO_SPACE);
 	do_pcibr_config_set(cfgw, PCI_CFG_COMMAND, 4, cmd_reg);
@@ -1277,7 +1273,7 @@
                 continue;
 
             /* Free the PCI bus space */
-            pciibr_bus_addr_free(pcibr_soft, &pcibr_info->f_window[bar]);
+            pcibr_bus_addr_free(&pcibr_info->f_window[bar]);
 
             /* Get index of the DevIO(x) register used to access this BAR */
             devio_index = pcibr_info->f_window[bar].w_devio_index;
@@ -1295,7 +1291,7 @@
 
         /* Free the Expansion ROM PCI bus space */
 	if(pcibr_info->f_rbase && pcibr_info->f_rsize) {
-            pciibr_bus_addr_free(pcibr_soft, &pcibr_info->f_rwindow);
+            pcibr_bus_addr_free(&pcibr_info->f_rwindow);
         }
 
         pcibr_unlock(pcibr_soft, s);
@@ -1317,12 +1313,6 @@
     slotp->bss_d64_flags = 0;
     slotp->bss_d32_base = PCIBR_D32_BASE_UNSET;
     slotp->bss_d32_flags = 0;
-
-    /* Clear out shadow info necessary for the external SSRAM workaround */
-    slotp->bss_ext_ates_active = ATOMIC_INIT(0);
-    slotp->bss_cmd_pointer = 0;
-    slotp->bss_cmd_shadow = 0;
-
 }
 
 
@@ -1360,12 +1350,12 @@
 				  ? &win_info_p->w_win_alloc
 				  : NULL,
 				  start, size, align);
-    return(iopaddr);
+    return iopaddr;
 }
 
 
 void
-pciibr_bus_addr_free(pcibr_soft_t pcibr_soft, pciio_win_info_t win_info_p)
+pcibr_bus_addr_free(pciio_win_info_t win_info_p)
 {
 	pciio_device_win_free(&win_info_p->w_win_alloc);
 }
@@ -1381,17 +1371,16 @@
     pcibr_soft_t	pcibr_soft = pcibr_soft_get(pcibr_vhdl);
     xwidgetnum_t	widget = pcibr_soft->bs_xid;
     int			bricktype = pcibr_soft->bs_bricktype;
-    int			bus = pcibr_soft->bs_busnum;
+    int			bus;
     
-    /* 
-     * For PIC there are 2 busses per widget and pcibr_soft->bs_busnum
-     * will be 0 or 1.  For [X]BRIDGE there is 1 bus per widget and 
-     * pcibr_soft->bs_busnum will always be zero.  So we add bs_busnum
-     * to what io_brick_map_widget returns to get the bus number.
-     */
-    if ((bus += io_brick_map_widget(bricktype, widget)) > 0) {
-	return bus;
-    } else {
+    if ((bus = io_brick_map_widget(bricktype, widget)) <= 0) {
+	printk(KERN_WARNING "pcibr_widget_to_bus() bad bricktype %d\n", bricktype);
 	return 0;
     }
+
+    /* For PIC there are 2 busses per widget and pcibr_soft->bs_busnum
+     * will be 0 or 1.  Add in the correct PIC bus offset.
+     */
+    bus += pcibr_soft->bs_busnum;
+    return bus;
 }
--- diff/arch/ia64/sn/io/sn2/pciio.c	2004-02-09 10:36:07.000000000 +0000
+++ source/arch/ia64/sn/io/sn2/pciio.c	2004-02-09 10:39:51.000000000 +0000
@@ -304,13 +304,6 @@
 	(dev, addr, size);
 }
 
-void
-pciio_dmalist_drain(vertex_hdl_t dev, alenlist_t list)
-{
-    DEV_FUNC(dev, dmalist_drain)
-	(dev, list);
-}
-
 /* =====================================================================
  *          INTERRUPT MANAGEMENT
  *
@@ -703,30 +696,6 @@
     return (pciio_info->c_pops);
 }
 
-int
-pciio_businfo_multi_master_get(pciio_businfo_t businfo)
-{
-    return businfo->bi_multi_master;
-}
-
-pciio_asic_type_t
-pciio_businfo_asic_type_get(pciio_businfo_t businfo)
-{
-    return businfo->bi_asic_type;
-}
-
-pciio_bus_type_t
-pciio_businfo_bus_type_get(pciio_businfo_t businfo)
-{
-    return businfo->bi_bus_type;
-}
-
-pciio_bus_speed_t
-pciio_businfo_bus_speed_get(pciio_businfo_t businfo)
-{
-    return businfo->bi_bus_speed;
-}
-
 /* =====================================================================
  *          GENERIC PCI INITIALIZATION FUNCTIONS
  */
@@ -792,9 +761,12 @@
 	pciio_info = kmalloc(sizeof (*(pciio_info)), GFP_KERNEL);
 	if ( pciio_info )
 		memset(pciio_info, 0, sizeof (*(pciio_info)));
+	else {
+		printk(KERN_WARNING "pciio_device_info_new(): Unable to "
+ 			"allocate memory\n");
+ 		return NULL;
+	}
     }
-    ASSERT(pciio_info != NULL);
-
     pciio_info->c_slot = slot;
     pciio_info->c_func = func;
     pciio_info->c_vendor = vendor_id;
@@ -859,13 +831,8 @@
 			    pciio_info->c_slot,
 			    pciio_info->c_func);
 
-    hwgraph_edge_remove(connectpt,name,&pconn);
     pciio_info_set(pconn,0);
 
-    /* Remove the link to our pci provider */
-    hwgraph_edge_remove(pconn, EDGE_LBL_MASTER, NULL);
-
-
     hwgraph_vertex_unref(pconn);
     hwgraph_vertex_destroy(pconn);
     
@@ -1036,12 +1003,3 @@
 {
 	return (pci_info->c_type1);
 }
-
-pciio_businfo_t
-pciio_businfo_get(vertex_hdl_t conn)
-{
-	pciio_info_t		info;
-
-	info = pciio_info_get(conn);
-	return DEV_FUNC(conn, businfo_get)(conn);
-}
--- diff/arch/ia64/sn/io/sn2/pic.c	2004-02-09 10:36:07.000000000 +0000
+++ source/arch/ia64/sn/io/sn2/pic.c	2004-02-09 10:39:51.000000000 +0000
@@ -17,12 +17,41 @@
 #include <asm/sn/pci/pic.h>
 #include <asm/sn/sn_private.h>
 
+extern struct file_operations pcibr_fops;
+extern pcibr_list_p	pcibr_list;
 
-#define PCI_BUS_NO_1 1
+static int		pic_attach2(vertex_hdl_t, void *, vertex_hdl_t,
+ 				int, pcibr_soft_t *);
+
+extern int		isIO9(nasid_t);
+extern char	       *dev_to_name(vertex_hdl_t dev, char *buf, uint buflen);
+extern int		pcibr_widget_to_bus(vertex_hdl_t pcibr_vhdl);
+extern pcibr_hints_t	pcibr_hints_get(vertex_hdl_t, int);
+extern unsigned		pcibr_intr_bits(pciio_info_t info,
+				pciio_intr_line_t lines, int nslots);
+extern void		pcibr_setwidint(xtalk_intr_t);
+extern int		pcibr_error_handler_wrapper(error_handler_arg_t, int,
+				ioerror_mode_t, ioerror_t *);
+extern void		pcibr_error_intr_handler(intr_arg_t);
+extern void		pcibr_directmap_init(pcibr_soft_t);
+extern int		pcibr_slot_info_init(vertex_hdl_t,pciio_slot_t);
+extern int		pcibr_slot_addr_space_init(vertex_hdl_t,pciio_slot_t);
+extern int		pcibr_slot_device_init(vertex_hdl_t, pciio_slot_t);
+extern int		pcibr_slot_pcix_rbar_init(pcibr_soft_t, pciio_slot_t);
+extern int		pcibr_slot_guest_info_init(vertex_hdl_t,pciio_slot_t);
+extern int		pcibr_slot_call_device_attach(vertex_hdl_t,
+				pciio_slot_t, int);
+extern void		pcibr_rrb_alloc_init(pcibr_soft_t, int, int, int);
+extern int		pcibr_pcix_rbars_calc(pcibr_soft_t);
+extern pcibr_info_t	pcibr_device_info_new(pcibr_soft_t, pciio_slot_t,
+				pciio_function_t, pciio_vendor_id_t,
+				pciio_device_id_t);
+extern int		pcibr_initial_rrb(vertex_hdl_t, pciio_slot_t, 
+				pciio_slot_t);
+extern void		xwidget_error_register(vertex_hdl_t, error_handler_f *,
+				error_handler_arg_t);
+extern void		pcibr_clearwidint(pcibr_soft_t);
 
-extern int pcibr_attach2(vertex_hdl_t, bridge_t *, vertex_hdl_t, int, pcibr_soft_t *);
-extern void pcibr_driver_reg_callback(vertex_hdl_t, int, int, int);
-extern void pcibr_driver_unreg_callback(vertex_hdl_t, int, int, int);
 
 
 /*
@@ -30,10 +59,9 @@
  */
 static int
 pic_bus1_widget_info_dup(vertex_hdl_t conn_v, vertex_hdl_t peer_conn_v,
-							cnodeid_t xbow_peer)
+					cnodeid_t xbow_peer, char *peer_path)
 {
 	xwidget_info_t widget_info, peer_widget_info;
-	char peer_path[256];
 	vertex_hdl_t peer_hubv;
 	hubinfo_t peer_hub_info;
 
@@ -48,7 +76,7 @@
 			(arbitrary_info_t *)&widget_info) == GRAPH_SUCCESS) {
 		peer_widget_info = kmalloc(sizeof (*(peer_widget_info)), GFP_KERNEL);
 		if ( !peer_widget_info ) {
-			return 0;
+			return -ENOMEM;
 		}
 		memset(peer_widget_info, 0, sizeof (*(peer_widget_info)));
 
@@ -96,7 +124,7 @@
 	char pathname[256], peer_path[256], tmpbuf[256];
 	char *p;
 	int rc;
-	vertex_hdl_t peer_conn_v;
+	vertex_hdl_t peer_conn_v, hubv;
 	int pos;
 	slabid_t slab;
 
@@ -141,9 +169,15 @@
 			     * vertex but that should be safe and we don't
 			     * really expect the additions to fail anyway.
 			     */
-			    if (!pic_bus1_widget_info_dup(conn_v, peer_conn_v, xbow_peer))
+			    if (!pic_bus1_widget_info_dup(conn_v, peer_conn_v, 
+							  xbow_peer, peer_path))
 					return 0;
 
+			    hubv = cnodeid_to_vertex(xbow_peer);
+			    ASSERT(hubv != GRAPH_VERTEX_NONE);
+			    device_master_set(peer_conn_v, hubv);
+			    xtalk_provider_register(hubv, &hub_provider);
+			    xtalk_provider_startup(hubv);
 			    return peer_conn_v;
 			}
 		}
@@ -151,12 +185,15 @@
 	return 0;
 }
 
-
+/*
+ * PIC has two buses under a single widget.  pic_attach() calls pic_attach2()
+ * to attach each of those buses.
+ */
 int
 pic_attach(vertex_hdl_t conn_v)
 {
 	int		rc;
-	bridge_t	*bridge0, *bridge1 = (bridge_t *)0;
+	void	*bridge0, *bridge1 = (void *)0;
 	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;
@@ -165,9 +202,8 @@
 
 	PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_ATTACH, conn_v, "pic_attach()\n"));
 
-	bridge0 = (bridge_t *) xtalk_piotrans_addr(conn_v, NULL,
-	                        0, sizeof(bridge_t), 0);
-	bridge1 = (bridge_t *)((char *)bridge0 + PIC_BUS1_OFFSET);
+	bridge0 = pcibr_bridge_ptr_get(conn_v, 0);
+	bridge1 = pcibr_bridge_ptr_get(conn_v, 1);
 
 	PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_ATTACH, conn_v,
 		    "pic_attach: bridge0=0x%lx, bridge1=0x%lx\n", 
@@ -215,8 +251,23 @@
 	pciio_provider_startup(pcibr_vhdl0);
 	pciio_provider_startup(pcibr_vhdl1);
 
-	pcibr_attach2(conn_v0, bridge0, pcibr_vhdl0, 0, &bus0_soft);
-	pcibr_attach2(conn_v1, bridge1, pcibr_vhdl1, 1, &bus1_soft);
+	pic_attach2(conn_v0, bridge0, pcibr_vhdl0, 0, &bus0_soft);
+	pic_attach2(conn_v1, bridge1, pcibr_vhdl1, 1, &bus1_soft);
+
+	{
+	    /* If we're dual-ported finish duplicating the peer info structure.
+	     * The error handler and arg are done in pic_attach2().
+	     */
+	    xwidget_info_t info0, info1;
+		if (conn_v0 != conn_v1) {	/* dual ported */
+			info0 = xwidget_info_get(conn_v0);
+			info1 = xwidget_info_get(conn_v1);
+			if (info1->w_efunc == (error_handler_f *)NULL)
+				info1->w_efunc = info0->w_efunc;
+			if (info1->w_einfo == (error_handler_arg_t)0)
+				info1->w_einfo = bus1_soft;
+		}
+	}
 
 	/* save a pointer to the PIC's other bus's soft struct */
         bus0_soft->bs_peers_soft = bus1_soft;
@@ -229,6 +280,506 @@
 	return 0;
 }
 
+
+/*
+ * PIC has two buses under a single widget.  pic_attach() calls pic_attach2()
+ * to attach each of those buses.
+ */
+static int
+pic_attach2(vertex_hdl_t xconn_vhdl, void *bridge,
+	      vertex_hdl_t pcibr_vhdl, int busnum, pcibr_soft_t *ret_softp)
+{
+    vertex_hdl_t	    ctlr_vhdl;
+    pcibr_soft_t	    pcibr_soft;
+    pcibr_info_t	    pcibr_info;
+    xwidget_info_t	    info;
+    xtalk_intr_t	    xtalk_intr;
+    pcibr_list_p	    self;
+    int			    entry, slot, ibit, i;
+    vertex_hdl_t	    noslot_conn;
+    char		    devnm[MAXDEVNAME], *s;
+    pcibr_hints_t	    pcibr_hints;
+    picreg_t		    id;
+    picreg_t		    int_enable;
+    picreg_t		    pic_ctrl_reg;
+
+    int			    iobrick_type_get_nasid(nasid_t nasid);
+    int			    iomoduleid_get(nasid_t nasid);
+    int			    irq;
+    int			    cpu;
+
+    PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_ATTACH, pcibr_vhdl,
+		"pic_attach2: bridge=0x%lx, busnum=%d\n", bridge, busnum));
+
+    ctlr_vhdl = NULL;
+    ctlr_vhdl = hwgraph_register(pcibr_vhdl, EDGE_LBL_CONTROLLER, 0,
+		0, 0, 0,
+		S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP, 0, 0,
+		(struct file_operations *)&pcibr_fops, (void *)pcibr_vhdl);
+    ASSERT(ctlr_vhdl != NULL);
+
+    id = pcireg_bridge_id_get(bridge);
+    hwgraph_info_add_LBL(pcibr_vhdl, INFO_LBL_PCIBR_ASIC_REV,
+                         (arbitrary_info_t)XWIDGET_PART_REV_NUM(id));
+
+    /*
+     * Get the hint structure; if some NIC callback marked this vertex as
+     * "hands-off" then we just return here, before doing anything else.
+     */
+    pcibr_hints = pcibr_hints_get(xconn_vhdl, 0);
+
+    if (pcibr_hints && pcibr_hints->ph_hands_off)
+        return -1;
+
+    /* allocate soft structure to hang off the vertex.  Link the new soft
+     * structure to the pcibr_list linked list
+     */
+    pcibr_soft = kmalloc(sizeof (*(pcibr_soft)), GFP_KERNEL);
+    if ( !pcibr_soft )
+	return -ENOMEM;
+
+    self = kmalloc(sizeof (*(self)), GFP_KERNEL);
+    if ( !self ) {
+	kfree(pcibr_soft);
+	return -ENOMEM;
+    }
+    memset(pcibr_soft, 0, sizeof (*(pcibr_soft)));
+    memset(self, 0, sizeof (*(self)));
+
+    self->bl_soft = pcibr_soft;
+    self->bl_vhdl = pcibr_vhdl;
+    self->bl_next = pcibr_list;
+    pcibr_list = self;
+
+    if (ret_softp)
+        *ret_softp = pcibr_soft;
+
+    memset(pcibr_soft, 0, sizeof *pcibr_soft);
+    pcibr_soft_set(pcibr_vhdl, pcibr_soft);
+
+    s = dev_to_name(pcibr_vhdl, devnm, MAXDEVNAME);
+    pcibr_soft->bs_name = kmalloc(strlen(s) + 1, GFP_KERNEL);
+    strcpy(pcibr_soft->bs_name, s);
+
+    pcibr_soft->bs_conn = xconn_vhdl;
+    pcibr_soft->bs_vhdl = pcibr_vhdl;
+    pcibr_soft->bs_base = (void *)bridge;
+    pcibr_soft->bs_rev_num = XWIDGET_PART_REV_NUM(id);
+    pcibr_soft->bs_intr_bits = (pcibr_intr_bits_f *)pcibr_intr_bits;
+    pcibr_soft->bsi_err_intr = 0;
+    pcibr_soft->bs_min_slot = 0;
+    pcibr_soft->bs_max_slot = 3;
+    pcibr_soft->bs_busnum = busnum;
+    pcibr_soft->bs_bridge_type = PCIBR_BRIDGETYPE_PIC;
+    pcibr_soft->bs_int_ate_size = PIC_INTERNAL_ATES;
+    /* Make sure this is called after setting the bs_base and bs_bridge_type */
+    pcibr_soft->bs_bridge_mode = (pcireg_speed_get(pcibr_soft) << 1) |
+                                  pcireg_mode_get(pcibr_soft);
+
+    info = xwidget_info_get(xconn_vhdl);
+    pcibr_soft->bs_xid = xwidget_info_id_get(info);
+    pcibr_soft->bs_master = xwidget_info_master_get(info);
+    pcibr_soft->bs_mxid = xwidget_info_masterid_get(info);
+
+    strcpy(pcibr_soft->bs_asic_name, "PIC");
+
+    PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_ATTACH, pcibr_vhdl,
+                "pic_attach2: pcibr_soft=0x%lx, mode=0x%x\n",
+                pcibr_soft, pcibr_soft->bs_bridge_mode));
+
+    PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_ATTACH, pcibr_vhdl,
+                "pic_attach2: %s ASIC: rev %s (code=0x%x)\n",
+                pcibr_soft->bs_asic_name,
+                (IS_PIC_PART_REV_A(pcibr_soft->bs_rev_num)) ? "A" :
+                (IS_PIC_PART_REV_B(pcibr_soft->bs_rev_num)) ? "B" :
+                (IS_PIC_PART_REV_C(pcibr_soft->bs_rev_num)) ? "C" :
+                "unknown", pcibr_soft->bs_rev_num));
+
+    /* PV854845: Must clear write request buffer to avoid parity errors */
+    for (i=0; i < PIC_WR_REQ_BUFSIZE; i++) {
+        ((pic_t *)bridge)->p_wr_req_lower[i] = 0;
+        ((pic_t *)bridge)->p_wr_req_upper[i] = 0;
+        ((pic_t *)bridge)->p_wr_req_parity[i] = 0;
+    }
+
+    pcibr_soft->bs_nasid = NASID_GET(bridge);
+
+    pcibr_soft->bs_bricktype = iobrick_type_get_nasid(pcibr_soft->bs_nasid);
+    if (pcibr_soft->bs_bricktype < 0)
+        printk(KERN_WARNING "%s: bricktype was unknown by L1 (ret val = 0x%x)\n",
+                pcibr_soft->bs_name, pcibr_soft->bs_bricktype);
+
+    pcibr_soft->bs_moduleid = iomoduleid_get(pcibr_soft->bs_nasid);
+
+    if (pcibr_soft->bs_bricktype > 0) {
+        switch (pcibr_soft->bs_bricktype) {
+	case MODULE_PXBRICK:
+	case MODULE_IXBRICK:
+	case MODULE_OPUSBRICK:
+            pcibr_soft->bs_first_slot = 0;
+            pcibr_soft->bs_last_slot = 1;
+            pcibr_soft->bs_last_reset = 1;
+
+            /* Bus 1 of IXBrick has a IO9, so there are 4 devices, not 2 */
+	    if ((pcibr_widget_to_bus(pcibr_vhdl) == 1) 
+		    && isIO9(pcibr_soft->bs_nasid)) {
+                pcibr_soft->bs_last_slot = 3;
+                pcibr_soft->bs_last_reset = 3;
+            }
+            break;
+
+        case MODULE_CGBRICK:
+            pcibr_soft->bs_first_slot = 0;
+            pcibr_soft->bs_last_slot = 0;
+            pcibr_soft->bs_last_reset = 0;
+            break;
+
+        default:
+	    printk(KERN_WARNING "%s: Unknown bricktype: 0x%x\n",
+                    pcibr_soft->bs_name, pcibr_soft->bs_bricktype);
+            break;
+        }
+
+        PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_ATTACH, pcibr_vhdl,
+                    "pic_attach2: bricktype=%d, brickbus=%d, "
+		    "slots %d-%d\n", pcibr_soft->bs_bricktype,
+		    pcibr_widget_to_bus(pcibr_vhdl),
+                    pcibr_soft->bs_first_slot, pcibr_soft->bs_last_slot));
+    }
+
+    /*
+     * Initialize bridge and bus locks
+     */
+    spin_lock_init(&pcibr_soft->bs_lock);
+
+    /*
+     * If we have one, process the hints structure.
+     */
+    if (pcibr_hints) {
+        unsigned	rrb_fixed;
+        PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_HINTS, pcibr_vhdl,
+                    "pic_attach2: pcibr_hints=0x%lx\n", pcibr_hints));
+
+        rrb_fixed = pcibr_hints->ph_rrb_fixed;
+
+        pcibr_soft->bs_rrb_fixed = rrb_fixed;
+
+        if (pcibr_hints->ph_intr_bits)
+            pcibr_soft->bs_intr_bits = pcibr_hints->ph_intr_bits;
+
+
+        for (slot = pcibr_soft->bs_min_slot;
+                                slot < PCIBR_NUM_SLOTS(pcibr_soft); ++slot) {
+            int hslot = pcibr_hints->ph_host_slot[slot] - 1;
+
+            if (hslot < 0) {
+                pcibr_soft->bs_slot[slot].host_slot = slot;
+            } else {
+                pcibr_soft->bs_slot[slot].has_host = 1;
+                pcibr_soft->bs_slot[slot].host_slot = hslot;
+            }
+        }
+    }
+
+    /*
+     * Set-up initial values for state fields
+     */
+    for (slot = pcibr_soft->bs_min_slot;
+                                slot < PCIBR_NUM_SLOTS(pcibr_soft); ++slot) {
+        pcibr_soft->bs_slot[slot].bss_devio.bssd_space = PCIIO_SPACE_NONE;
+        pcibr_soft->bs_slot[slot].bss_devio.bssd_ref_cnt = 0;
+        pcibr_soft->bs_slot[slot].bss_d64_base = PCIBR_D64_BASE_UNSET;
+        pcibr_soft->bs_slot[slot].bss_d32_base = PCIBR_D32_BASE_UNSET;
+        pcibr_soft->bs_rrb_valid_dflt[slot][VCHAN0] = -1;
+    }
+
+    for (ibit = 0; ibit < 8; ++ibit) {
+        pcibr_soft->bs_intr[ibit].bsi_xtalk_intr = 0;
+        pcibr_soft->bs_intr[ibit].bsi_pcibr_intr_wrap.iw_soft = pcibr_soft;
+        pcibr_soft->bs_intr[ibit].bsi_pcibr_intr_wrap.iw_list = NULL;
+        pcibr_soft->bs_intr[ibit].bsi_pcibr_intr_wrap.iw_ibit = ibit;
+        pcibr_soft->bs_intr[ibit].bsi_pcibr_intr_wrap.iw_hdlrcnt = 0;
+        pcibr_soft->bs_intr[ibit].bsi_pcibr_intr_wrap.iw_shared = 0;
+        pcibr_soft->bs_intr[ibit].bsi_pcibr_intr_wrap.iw_connected = 0;
+    }
+
+
+    /*
+     * connect up our error handler.  PIC has 2 busses (thus resulting in 2
+     * pcibr_soft structs under 1 widget), so only register a xwidget error
+     * handler for PIC's bus0.  NOTE: for PIC pcibr_error_handler_wrapper()
+     * is a wrapper routine we register that will call the real error handler
+     * pcibr_error_handler() with the correct pcibr_soft struct.
+     */
+    if (busnum == 0) {
+        xwidget_error_register(xconn_vhdl,
+                                pcibr_error_handler_wrapper, pcibr_soft);
+    }
+
+    /*
+     * Clear all pending interrupts.  Assume all interrupts are from slot 3
+     * until otherise setup.
+     */
+    pcireg_intr_reset_set(pcibr_soft, PIC_IRR_ALL_CLR);
+    pcireg_intr_device_set(pcibr_soft, 0x006db6db);
+
+    /* Setup the mapping register used for direct mapping */
+    pcibr_directmap_init(pcibr_soft);
+
+    /*
+     * Initialize the PICs control register.
+     */
+    pic_ctrl_reg = pcireg_control_get(pcibr_soft);
+
+    /* Bridges Requester ID: bus = busnum, dev = 0, func = 0 */
+    pic_ctrl_reg &= ~PIC_CTRL_BUS_NUM_MASK;
+    pic_ctrl_reg |= PIC_CTRL_BUS_NUM(busnum);
+    pic_ctrl_reg &= ~PIC_CTRL_DEV_NUM_MASK;
+    pic_ctrl_reg &= ~PIC_CTRL_FUN_NUM_MASK;
+
+    pic_ctrl_reg &= ~PIC_CTRL_NO_SNOOP;
+    pic_ctrl_reg &= ~PIC_CTRL_RELAX_ORDER;
+
+    /* enable parity checking on PICs internal RAM */
+    pic_ctrl_reg |= PIC_CTRL_PAR_EN_RESP;
+    pic_ctrl_reg |= PIC_CTRL_PAR_EN_ATE;
+
+    /* PIC BRINGUP WAR (PV# 862253): dont enable write request parity */
+    if (!PCIBR_WAR_ENABLED(PV862253, pcibr_soft)) {
+        pic_ctrl_reg |= PIC_CTRL_PAR_EN_REQ;
+    }
+
+    pic_ctrl_reg |= PIC_CTRL_PAGE_SIZE;
+
+    pcireg_control_set(pcibr_soft, pic_ctrl_reg);
+
+    /* Initialize internal mapping entries (ie. the ATEs) */
+    for (entry = 0; entry < pcibr_soft->bs_int_ate_size; entry++)
+	pcireg_int_ate_set(pcibr_soft, entry, 0);
+
+    pcibr_soft->bs_int_ate_resource.start = 0;
+    pcibr_soft->bs_int_ate_resource.end = pcibr_soft->bs_int_ate_size - 1;
+
+    /* Setup the PICs error interrupt handler. */
+    xtalk_intr = xtalk_intr_alloc(xconn_vhdl, (device_desc_t)0, pcibr_vhdl);
+
+    ASSERT(xtalk_intr != NULL);
+
+    irq = ((hub_intr_t)xtalk_intr)->i_bit;
+    cpu = ((hub_intr_t)xtalk_intr)->i_cpuid;
+
+    intr_unreserve_level(cpu, irq);
+    ((hub_intr_t)xtalk_intr)->i_bit = SGI_PCIBR_ERROR;
+    xtalk_intr->xi_vector = SGI_PCIBR_ERROR;
+
+    pcibr_soft->bsi_err_intr = xtalk_intr;
+
+    /*
+     * On IP35 with XBridge, we do some extra checks in pcibr_setwidint
+     * in order to work around some addressing limitations.  In order
+     * for that fire wall to work properly, we need to make sure we
+     * start from a known clean state.
+     */
+    pcibr_clearwidint(pcibr_soft);
+
+    xtalk_intr_connect(xtalk_intr,
+		       (intr_func_t) pcibr_error_intr_handler,
+		       (intr_arg_t) pcibr_soft,
+		       (xtalk_intr_setfunc_t) pcibr_setwidint,
+		       (void *) pcibr_soft);
+
+    request_irq(SGI_PCIBR_ERROR, (void *)pcibr_error_intr_handler, SA_SHIRQ, 
+			"PCIBR error", (intr_arg_t) pcibr_soft);
+
+    PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_INTR_ALLOC, pcibr_vhdl,
+		"pcibr_setwidint: target_id=0x%lx, int_addr=0x%lx\n",
+		pcireg_intr_dst_target_id_get(pcibr_soft),
+		pcireg_intr_dst_addr_get(pcibr_soft)));
+
+    /* now we can start handling error interrupts */
+    int_enable = pcireg_intr_enable_get(pcibr_soft);
+    int_enable |= PIC_ISR_ERRORS;
+
+    /* PIC BRINGUP WAR (PV# 856864 & 856865): allow the tnums that are
+     * locked out to be freed up sooner (by timing out) so that the
+     * read tnums are never completely used up.
+     */
+    if (PCIBR_WAR_ENABLED(PV856864, pcibr_soft)) {
+	int_enable &= ~PIC_ISR_PCIX_REQ_TOUT;
+	int_enable &= ~PIC_ISR_XREAD_REQ_TIMEOUT;
+
+	pcireg_req_timeout_set(pcibr_soft, 0x750);
+    }
+
+    pcireg_intr_enable_set(pcibr_soft, int_enable);
+    pcireg_intr_mode_set(pcibr_soft, 0); /* dont send 'clear interrupt' pkts */
+    pcireg_tflush_get(pcibr_soft);       /* wait until Bridge PIO complete */
+
+    /*
+     * PIC BRINGUP WAR (PV# 856866, 859504, 861476, 861478): Don't use
+     * RRB0, RRB8, RRB1, and RRB9.  Assign them to DEVICE[2|3]--VCHAN3
+     * so they are not used.  This works since there is currently no
+     * API to penable VCHAN3.
+     */
+    if (PCIBR_WAR_ENABLED(PV856866, pcibr_soft)) {
+	pcireg_rrb_bit_set(pcibr_soft, 0, 0x000f000f);	/* even rrb reg */
+	pcireg_rrb_bit_set(pcibr_soft, 1, 0x000f000f);	/* odd rrb reg */
+    }
+
+    /* PIC only supports 64-bit direct mapping in PCI-X mode.  Since
+     * all PCI-X devices that initiate memory transactions must be
+     * capable of generating 64-bit addressed, we force 64-bit DMAs.
+     */
+    pcibr_soft->bs_dma_flags = 0;
+    if (IS_PCIX(pcibr_soft)) {
+	pcibr_soft->bs_dma_flags |= PCIIO_DMA_A64;
+    }
+
+    {
+
+    iopaddr_t		    prom_base_addr = pcibr_soft->bs_xid << 24;
+    int			    prom_base_size = 0x1000000;
+    int			    status;
+    struct resource	    *res;
+
+    /* Allocate resource maps based on bus page size; for I/O and memory
+     * space, free all pages except those in the base area and in the
+     * range set by the PROM.
+     *
+     * PROM creates BAR addresses in this format: 0x0ws00000 where w is
+     * the widget number and s is the device register offset for the slot.
+     */
+
+    /* 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), GFP_KERNEL);
+    if (!res)
+	panic("PCIBR:Unable to allocate resource structure\n");
+
+    /* Block off the range used by PROM. */
+    res->start = prom_base_addr;
+    res->end = prom_base_addr + (prom_base_size - 1);
+    status = request_resource(&pcibr_soft->bs_io_win_root_resource, res);
+    if (status)
+	panic("PCIBR:Unable to request_resource()\n");
+
+    /* Setup the Small Window Root Resource */
+    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), GFP_KERNEL);
+    if (!res)
+	panic("PCIBR:Unable to allocate resource structure\n");
+
+    /* Block off the range used by PROM. */
+    res->start = prom_base_addr;
+    res->end = prom_base_addr + (prom_base_size - 1);;
+    status = request_resource(&pcibr_soft->bs_mem_win_root_resource, res);
+    if (status)
+	panic("PCIBR:Unable to request_resource()\n");
+
+    }
+
+
+    /* build "no-slot" connection point */
+    pcibr_info = pcibr_device_info_new(pcibr_soft, PCIIO_SLOT_NONE,
+		 PCIIO_FUNC_NONE, PCIIO_VENDOR_ID_NONE, PCIIO_DEVICE_ID_NONE);
+    noslot_conn = pciio_device_info_register(pcibr_vhdl, &pcibr_info->f_c);
+
+    /* Store no slot connection point info for tearing it down during detach. */
+    pcibr_soft->bs_noslot_conn = noslot_conn;
+    pcibr_soft->bs_noslot_info = pcibr_info;
+
+    for (slot = pcibr_soft->bs_min_slot;
+				slot < PCIBR_NUM_SLOTS(pcibr_soft); ++slot) {
+	/* Find out what is out there */
+	(void)pcibr_slot_info_init(pcibr_vhdl, slot);
+    }
+
+    for (slot = pcibr_soft->bs_min_slot;
+				slot < PCIBR_NUM_SLOTS(pcibr_soft); ++slot) {
+	/* Set up the address space for this slot in the PCI land */
+	(void)pcibr_slot_addr_space_init(pcibr_vhdl, slot);
+    }
+
+    for (slot = pcibr_soft->bs_min_slot;
+				slot < PCIBR_NUM_SLOTS(pcibr_soft); ++slot) {
+	/* Setup the device register */
+	(void)pcibr_slot_device_init(pcibr_vhdl, slot);
+    }
+
+    if (IS_PCIX(pcibr_soft)) {
+	pcibr_soft->bs_pcix_rbar_inuse = 0;
+	pcibr_soft->bs_pcix_rbar_avail = NUM_RBAR;
+	pcibr_soft->bs_pcix_rbar_percent_allowed =
+					pcibr_pcix_rbars_calc(pcibr_soft);
+
+	for (slot = pcibr_soft->bs_min_slot;
+				slot < PCIBR_NUM_SLOTS(pcibr_soft); ++slot) {
+	    /* Setup the PCI-X Read Buffer Attribute Registers (RBARs) */
+	    (void)pcibr_slot_pcix_rbar_init(pcibr_soft, slot);
+	}
+    }
+
+    for (slot = pcibr_soft->bs_min_slot;
+				slot < PCIBR_NUM_SLOTS(pcibr_soft); ++slot) {
+	/* Setup host/guest relations */
+	(void)pcibr_slot_guest_info_init(pcibr_vhdl, slot);
+    }
+
+    /* Handle initial RRB management */
+    pcibr_initial_rrb(pcibr_vhdl,
+		      pcibr_soft->bs_first_slot, pcibr_soft->bs_last_slot);
+
+   /* Before any drivers get called that may want to re-allocate RRB's,
+    * let's get some special cases pre-allocated. Drivers may override
+    * these pre-allocations, but by doing pre-allocations now we're
+    * assured not to step all over what the driver intended.
+    */
+    if (pcibr_soft->bs_bricktype > 0) {
+	switch (pcibr_soft->bs_bricktype) {
+	case MODULE_PXBRICK:
+	case MODULE_IXBRICK:
+	case MODULE_OPUSBRICK:
+		/*
+		 * If IO9 in bus 1, allocate RRBs to all the IO9 devices
+		 */
+		if ((pcibr_widget_to_bus(pcibr_vhdl) == 1) &&
+		    (pcibr_soft->bs_slot[0].bss_vendor_id == 0x10A9) &&
+		    (pcibr_soft->bs_slot[0].bss_device_id == 0x100A)) {
+			pcibr_rrb_alloc_init(pcibr_soft, 0, VCHAN0, 4);
+			pcibr_rrb_alloc_init(pcibr_soft, 1, VCHAN0, 4);
+			pcibr_rrb_alloc_init(pcibr_soft, 2, VCHAN0, 4);
+			pcibr_rrb_alloc_init(pcibr_soft, 3, VCHAN0, 4);
+		} else {
+			pcibr_rrb_alloc_init(pcibr_soft, 0, VCHAN0, 4);
+			pcibr_rrb_alloc_init(pcibr_soft, 1, VCHAN0, 4);
+		}
+		break;
+
+	case MODULE_CGBRICK:
+		pcibr_rrb_alloc_init(pcibr_soft, 0, VCHAN0, 8);
+		break;
+	} /* switch */
+    }
+
+
+    for (slot = pcibr_soft->bs_min_slot;
+				slot < PCIBR_NUM_SLOTS(pcibr_soft); ++slot) {
+	/* Call the device attach */
+	(void)pcibr_slot_call_device_attach(pcibr_vhdl, slot, 0);
+    }
+
+    pciio_device_attach(noslot_conn, 0);
+
+    return 0;
+}
+
+
 /*
  * pci provider functions
  *
@@ -237,6 +788,8 @@
  */
 pciio_provider_t        pci_pic_provider =
 {
+    PCIIO_ASIC_TYPE_PIC,
+
     (pciio_piomap_alloc_f *) pcibr_piomap_alloc,
     (pciio_piomap_free_f *) pcibr_piomap_free,
     (pciio_piomap_addr_f *) pcibr_piomap_addr,
@@ -252,7 +805,6 @@
     (pciio_dmatrans_addr_f *) pcibr_dmatrans_addr,
     (pciio_dmamap_drain_f *) pcibr_dmamap_drain,
     (pciio_dmaaddr_drain_f *) pcibr_dmaaddr_drain,
-    (pciio_dmalist_drain_f *) pcibr_dmalist_drain,
 
     (pciio_intr_alloc_f *) pcibr_intr_alloc,
     (pciio_intr_free_f *) pcibr_intr_free,
@@ -263,12 +815,12 @@
     (pciio_provider_startup_f *) pcibr_provider_startup,
     (pciio_provider_shutdown_f *) pcibr_provider_shutdown,
     (pciio_reset_f *) pcibr_reset,
-    (pciio_write_gather_flush_f *) pcibr_write_gather_flush,
     (pciio_endian_set_f *) pcibr_endian_set,
-    (pciio_priority_set_f *) pcibr_priority_set,
     (pciio_config_get_f *) pcibr_config_get,
     (pciio_config_set_f *) pcibr_config_set,
-    (pciio_error_extract_f *) 0,
+
+    (pciio_error_extract_f *) pcibr_error_extract,
+
     (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,
--- diff/arch/ia64/sn/io/sn2/shuberror.c	2004-02-09 10:36:07.000000000 +0000
+++ source/arch/ia64/sn/io/sn2/shuberror.c	2004-02-09 10:39:51.000000000 +0000
@@ -13,6 +13,7 @@
 #include <asm/io.h>
 #include <asm/irq.h>
 #include <asm/smp.h>
+#include <asm/delay.h>
 #include <asm/sn/sgi.h>
 #include <asm/sn/io.h>
 #include <asm/sn/iograph.h>
--- diff/arch/ia64/sn/io/sn2/xbow.c	2004-02-09 10:36:07.000000000 +0000
+++ source/arch/ia64/sn/io/sn2/xbow.c	2004-02-09 10:39:51.000000000 +0000
@@ -9,11 +9,15 @@
 #include <linux/slab.h>
 #include <linux/module.h>
 #include <linux/interrupt.h>
+#include <linux/mm.h>
+#include <linux/delay.h>
+#include <asm/sn/sgi.h>
 #include <asm/sn/sn2/sn_private.h>
 #include <asm/sn/iograph.h>
 #include <asm/sn/simulator.h>
 #include <asm/sn/hcl.h>
 #include <asm/sn/hcl_util.h>
+#include <asm/sn/pci/pcibr_private.h>
 
 /* #define DEBUG		1 */
 /* #define XBOW_DEBUG	1 */
--- diff/arch/ia64/sn/io/sn2/xtalk.c	2004-02-09 10:36:07.000000000 +0000
+++ source/arch/ia64/sn/io/sn2/xtalk.c	2004-02-09 10:39:51.000000000 +0000
@@ -30,9 +30,6 @@
  * completely disappear.
  */
 
-#define	NEW(ptr)	(ptr = kmalloc(sizeof (*(ptr)), GFP_KERNEL))
-#define	DEL(ptr)	(kfree(ptr))
-
 char                    widget_info_fingerprint[] = "widget_info";
 
 /* =====================================================================
@@ -50,13 +47,10 @@
 xtalk_dmamap_t          xtalk_dmamap_alloc(vertex_hdl_t, device_desc_t, size_t, unsigned);
 void                    xtalk_dmamap_free(xtalk_dmamap_t);
 iopaddr_t               xtalk_dmamap_addr(xtalk_dmamap_t, paddr_t, size_t);
-alenlist_t              xtalk_dmamap_list(xtalk_dmamap_t, alenlist_t, unsigned);
 void                    xtalk_dmamap_done(xtalk_dmamap_t);
 iopaddr_t               xtalk_dmatrans_addr(vertex_hdl_t, device_desc_t, paddr_t, size_t, unsigned);
-alenlist_t              xtalk_dmatrans_list(vertex_hdl_t, device_desc_t, alenlist_t, unsigned);
 void			xtalk_dmamap_drain(xtalk_dmamap_t);
 void			xtalk_dmaaddr_drain(vertex_hdl_t, iopaddr_t, size_t);
-void			xtalk_dmalist_drain(vertex_hdl_t, alenlist_t);
 xtalk_intr_t            xtalk_intr_alloc(vertex_hdl_t, device_desc_t, vertex_hdl_t);
 xtalk_intr_t            xtalk_intr_alloc_nothd(vertex_hdl_t, device_desc_t, vertex_hdl_t);
 void                    xtalk_intr_free(xtalk_intr_t);
@@ -355,16 +349,6 @@
 }
 
 
-alenlist_t
-xtalk_dmamap_list(xtalk_dmamap_t xtalk_dmamap,	/* use these mapping resources */
-		  alenlist_t alenlist,	/* map this Address/Length List */
-		  unsigned flags)
-{
-    return DMAMAP_FUNC(xtalk_dmamap, dmamap_list)
-	(CAST_DMAMAP(xtalk_dmamap), alenlist, flags);
-}
-
-
 void
 xtalk_dmamap_done(xtalk_dmamap_t xtalk_dmamap)
 {
@@ -385,16 +369,6 @@
 }
 
 
-alenlist_t
-xtalk_dmatrans_list(vertex_hdl_t dev,	/* translate for this device */
-		    device_desc_t dev_desc,	/* device descriptor */
-		    alenlist_t palenlist,	/* system address/length list */
-		    unsigned flags)
-{				/* defined in dma.h */
-    return DEV_FUNC(dev, dmatrans_list)
-	(dev, dev_desc, palenlist, flags);
-}
-
 void
 xtalk_dmamap_drain(xtalk_dmamap_t map)
 {
@@ -409,13 +383,6 @@
 	(dev, addr, size);
 }
 
-void
-xtalk_dmalist_drain(vertex_hdl_t dev, alenlist_t list)
-{
-    DEV_FUNC(dev, dmalist_drain)
-	(dev, list);
-}
-
 /* =====================================================================
  *                    INTERRUPT MANAGEMENT
  *
@@ -855,7 +822,9 @@
     char		    *s,devnm[MAXDEVNAME];
 
     /* Allocate widget_info and associate it with widget vertex */
-    NEW(widget_info);
+    widget_info = kmalloc(sizeof(*widget_info), GFP_KERNEL);
+     if (!widget_info)
+ 	return - ENOMEM;
 
     /* Initialize widget_info */
     widget_info->w_vertex = widget;
@@ -898,16 +867,13 @@
 
     /* Make sure that we have valid widget information initialized */
     if (!(widget_info = xwidget_info_get(widget)))
-	return(1);
+	return 1;
 
     hwid = &(widget_info->w_hwid);
 
-    /* Clean out the xwidget information */
-    (void)kfree(widget_info->w_name);
-    memset((void *)widget_info, 0, sizeof(widget_info));
-    DEL(widget_info);
-    
-    return(0);
+    kfree(widget_info->w_name);
+    kfree(widget_info);
+    return 0;
 }
 
 void
--- diff/arch/ia64/sn/io/xswitch.c	2004-02-09 10:36:07.000000000 +0000
+++ source/arch/ia64/sn/io/xswitch.c	2004-02-09 10:39:51.000000000 +0000
@@ -8,6 +8,7 @@
 
 #include <linux/types.h>
 #include <linux/slab.h>
+#include <asm/errno.h>
 #include <asm/sn/sgi.h>
 #include <asm/sn/driver.h>
 #include <asm/sn/iograph.h>
@@ -18,8 +19,6 @@
 #include <asm/sn/xtalk/xwidget.h>
 #include <asm/sn/xtalk/xtalk_private.h>
 
-#define	NEW(ptr)	(ptr = kmalloc(sizeof (*(ptr)), GFP_KERNEL))
-#define	DEL(ptr)	(kfree(ptr))
 
 /*
  * This file provides generic support for Crosstalk
@@ -118,7 +117,12 @@
     if (xswitch_info == NULL) {
 	int                     port;
 
-	NEW(xswitch_info);
+	xswitch_info = kmalloc(sizeof(*xswitch_info), GFP_KERNEL);
+	if (!xswitch_info) {
+		printk(KERN_WARNING "xswitch_info_new(): Unable to "
+			"allocate memory\n");
+		return NULL;
+	}
 	xswitch_info->census = 0;
 	for (port = 0; port <= XSWITCH_CENSUS_PORT_MAX; port++) {
 	    xswitch_info_vhdl_set(xswitch_info, port,
--- diff/arch/ia64/sn/kernel/bte.c	2004-02-09 10:36:07.000000000 +0000
+++ source/arch/ia64/sn/kernel/bte.c	2004-02-09 10:39:51.000000000 +0000
@@ -7,6 +7,7 @@
  */
 
 #include <linux/config.h>
+#include <asm/sn/sgi.h>
 #include <asm/sn/nodepda.h>
 #include <asm/sn/addrs.h>
 #include <asm/sn/arch.h>
@@ -14,6 +15,7 @@
 #include <asm/sn/pda.h>
 #include <asm/sn/sn2/shubio.h>
 #include <asm/nodedata.h>
+#include <asm/delay.h>
 
 #include <linux/bootmem.h>
 #include <linux/string.h>
--- diff/arch/ia64/sn/kernel/irq.c	2004-02-09 10:36:07.000000000 +0000
+++ source/arch/ia64/sn/kernel/irq.c	2004-02-09 10:39:51.000000000 +0000
@@ -14,6 +14,7 @@
 #include <linux/irq.h>
 #include <linux/interrupt.h>
 #include <linux/slab.h>
+#include <linux/bootmem.h>
 #include <asm/page.h>
 #include <asm/pgtable.h>
 #include <asm/sn/sgi.h>
@@ -40,8 +41,12 @@
 extern void pcibr_force_interrupt(pcibr_intr_t intr);
 extern int sn_force_interrupt_flag;
 
-static pcibr_intr_list_t *pcibr_intr_list;
+struct sn_intr_list_t {
+	struct sn_intr_list_t *next;
+	pcibr_intr_t intr;
+};
 
+static struct sn_intr_list_t *sn_intr_list[NR_IRQS];
 
 
 static unsigned int
@@ -114,30 +119,24 @@
 }
 
 static void
-sn_set_affinity_irq(unsigned int irq, cpumask_t mask)
+sn_set_affinity_irq(unsigned int irq, unsigned long cpu)
 {
-#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 CONFIG_SMP
+	int redir = 0;
+	struct sn_intr_list_t *p = sn_intr_list[irq];
+	pcibr_intr_t intr;
+	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;
+	intr = p->intr;
 
 	if (intr == NULL)
 		return; 
 
-	cpu = first_cpu(mask);
-	if (IS_PIC_SOFT(intr->bi_soft) ) {
-		sn_shub_redirect_intr(intr, cpu);
-	} else { 
-		return; 
-	}
+	sn_shub_redirect_intr(intr, cpu);
 	(void) set_irq_affinity_info(irq, cpu_physical_id(intr->bi_cpu), redir);
 #endif /* CONFIG_SMP */
 }
@@ -156,7 +155,8 @@
 
 
 struct irq_desc *
-sn_irq_desc(unsigned int irq) {
+sn_irq_desc(unsigned int irq)
+{
 
 	irq = SN_IVEC_FROM_IRQ(irq);
 
@@ -164,12 +164,14 @@
 }
 
 u8
-sn_irq_to_vector(u8 irq) {
+sn_irq_to_vector(u8 irq)
+{
 	return(irq);
 }
 
 unsigned int
-sn_local_vector_to_irq(u8 vector) {
+sn_local_vector_to_irq(u8 vector)
+{
 	return (CPU_VECTOR_TO_IRQ(smp_processor_id(), vector));
 }
 
@@ -179,7 +181,7 @@
 	int i;
 	irq_desc_t *base_desc = _irq_desc;
 
-	for (i=IA64_FIRST_DEVICE_VECTOR; i<NR_IRQS; i++) {
+	for (i=0; i<NR_IRQS; i++) {
 		if (base_desc[i].handler == &no_irq_type) {
 			base_desc[i].handler = &irq_type_sn;
 		}
@@ -187,60 +189,56 @@
 }
 
 void
-register_pcibr_intr(int irq, pcibr_intr_t intr) {
-	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(pcibr_intr_list_t) * NR_IRQS, GFP_KERNEL);
-		if (pcibr_intr_list == NULL) 
-			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(pcibr_intr_list_t) * NR_IRQS);
-	}
+register_pcibr_intr(int irq, pcibr_intr_t intr)
+{
+	struct sn_intr_list_t *p = kmalloc(sizeof(struct sn_intr_list_t), GFP_KERNEL);
+	struct sn_intr_list_t *list;
+	int cpu = intr->bi_cpu;
+
 	if (pdacpu(cpu)->sn_last_irq < irq) {
 		pdacpu(cpu)->sn_last_irq = irq;
 	}
-	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->il_next) list = list->il_next;
-		list->il_next = p;
-		p->il_next = NULL;
-		p->il_intr = intr;
+	if (pdacpu(cpu)->sn_first_irq == 0 || pdacpu(cpu)->sn_first_irq > irq) pdacpu(cpu)->sn_first_irq = irq;
+	if (!p) panic("Could not allocate memory for sn_intr_list_t\n");
+	if ((list = sn_intr_list[irq])) {
+		while (list->next) list = list->next;
+		list->next = p;
+		p->next = NULL;
+		p->intr = intr;
 	} else {
-		pcibr_intr_list[irq] = p;
-		p->il_next = NULL;
-		p->il_intr = intr;
+		sn_intr_list[irq] = p;
+		p->next = NULL;
+		p->intr = intr;
 	}
 }
 
 void
-force_polled_int(void) {
+force_polled_int(void)
+{
 	int i;
-	pcibr_intr_list_t p;
+	struct sn_intr_list_t *p;
 
 	for (i=0; i<NR_IRQS;i++) {
-		p = pcibr_intr_list[i];
+		p = sn_intr_list[i];
 		while (p) {
-			if (p->il_intr){
-				pcibr_force_interrupt(p->il_intr);
+			if (p->intr){
+				pcibr_force_interrupt(p->intr);
 			}
-			p = p->il_next;
+			p = p->next;
 		}
 	}
 }
 
 static void
-force_interrupt(int irq) {
-	pcibr_intr_list_t p = pcibr_intr_list[irq];
+force_interrupt(int irq)
+{
+	struct sn_intr_list_t *p = sn_intr_list[irq];
 
 	while (p) {
-		if (p->il_intr) {
-			pcibr_force_interrupt(p->il_intr);
+		if (p->intr) {
+			pcibr_force_interrupt(p->intr);
 		}
-		p = p->il_next;
+		p = p->next;
 	}
 }
 
@@ -255,14 +253,15 @@
 */
 
 static void
-sn_check_intr(int irq, pcibr_intr_t intr) {
+sn_check_intr(int irq, pcibr_intr_t intr)
+{
 	unsigned long regval;
 	int irr_reg_num;
 	int irr_bit;
 	unsigned long irr_reg;
 
 
-	regval = pcireg_intr_status_get(intr->bi_soft->bs_base);
+	regval = pcireg_intr_status_get(intr->bi_soft);
 	irr_reg_num = irq_to_vector(irq) / 64;
 	irr_bit = irq_to_vector(irq) % 64;
 	switch (irr_reg_num) {
@@ -294,68 +293,20 @@
 }
 
 void
-sn_lb_int_war_check(void) {
+sn_lb_int_war_check(void)
+{
 	int i;
 
 	if (pda->sn_first_irq == 0) return;
 	for (i=pda->sn_first_irq;
 		i <= pda->sn_last_irq; i++) {
-			pcibr_intr_list_t p = pcibr_intr_list[i];
+			struct sn_intr_list_t *p = sn_intr_list[i];
 			if (p == NULL) {
 				continue;
 			}
 			while (p) {
-				sn_check_intr(i, p->il_intr);
-				p = p->il_next;
+				sn_check_intr(i, p->intr);
+				p = p->next;
 			}
 	}
 }
-
-static inline int
-sn_get_next_bit(void) {
-	int i;
-	int bit;
-
-	for (i = 3; i >= 0; i--) {
-		if (pda->sn_soft_irr[i] != 0) {
-			bit = (i * 64) +  __ffs(pda->sn_soft_irr[i]);
-			__change_bit(bit, (volatile void *)pda->sn_soft_irr);
-			return(bit);
-		}
-	}
-	return IA64_SPURIOUS_INT_VECTOR;
-}
-
-void
-sn_set_tpr(int vector) {
-	if (vector > IA64_LAST_DEVICE_VECTOR || vector < IA64_FIRST_DEVICE_VECTOR) {
-		ia64_setreg(_IA64_REG_CR_TPR, vector);
-	} else {
-		ia64_setreg(_IA64_REG_CR_TPR, IA64_LAST_DEVICE_VECTOR);
-	}
-}
-
-static inline void
-sn_get_all_ivr(void) {
-	int vector;
-
-	vector = ia64_get_ivr();
-	while (vector != IA64_SPURIOUS_INT_VECTOR) {
-		__set_bit(vector, (volatile void *)pda->sn_soft_irr);
-		ia64_eoi();
-		if (vector > IA64_LAST_DEVICE_VECTOR) return;
-		vector = ia64_get_ivr();
-	}
-}
-	
-int
-sn_get_ivr(void) {
-	int vector;
-
-	vector = sn_get_next_bit();
-	if (vector == IA64_SPURIOUS_INT_VECTOR) {
-		sn_get_all_ivr();
-		vector = sn_get_next_bit();
-	}
-	return vector;
-}
--- diff/arch/ia64/sn/kernel/mca.c	2004-02-09 10:36:07.000000000 +0000
+++ source/arch/ia64/sn/kernel/mca.c	2004-02-09 10:39:51.000000000 +0000
@@ -12,6 +12,7 @@
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/timer.h>
+#include <asm/sn/sgi.h>
 #include <asm/mca.h>
 #include <asm/sal.h>
 #include <asm/sn/sn_sal.h>
--- diff/arch/ia64/sn/kernel/probe.c	2004-02-09 10:36:07.000000000 +0000
+++ source/arch/ia64/sn/kernel/probe.c	2004-02-09 10:39:51.000000000 +0000
@@ -8,6 +8,7 @@
  * Copyright (c) 2000-2003 Silicon Graphics, Inc.  All rights reserved.
  */
 
+#include <asm/sn/sgi.h>
 #include <asm/sn/sn_sal.h>
 
 /**
--- diff/arch/ia64/sn/kernel/setup.c	2004-02-09 10:36:07.000000000 +0000
+++ source/arch/ia64/sn/kernel/setup.c	2004-02-09 10:39:51.000000000 +0000
@@ -7,6 +7,7 @@
  */
 
 #include <linux/config.h>
+#include <linux/module.h>
 #include <linux/init.h>
 #include <linux/delay.h>
 #include <linux/kernel.h>
@@ -50,8 +51,6 @@
 
 DEFINE_PER_CPU(struct pda_s, pda_percpu);
 
-#define pxm_to_nasid(pxm) ((pxm)<<1)
-
 #define MAX_PHYS_MEMORY		(1UL << 49)     /* 1 TB */
 
 extern void bte_init_node (nodepda_t *, cnodeid_t);
@@ -61,6 +60,8 @@
 extern void init_platform_hubinfo(nodepda_t **nodepdaindr);
 extern void (*ia64_mark_idle)(int);
 extern void snidle(int);
+extern unsigned char acpi_kbd_controller_present;
+
 
 unsigned long sn_rtc_cycles_per_second;   
 
@@ -70,8 +71,7 @@
 
 short physical_node_map[MAX_PHYSNODE_ID];
 
-int     numionodes;
-
+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],
@@ -120,6 +120,29 @@
 char drive_info[4*16];
 #endif
 
+/*
+ * This routine can only be used during init, since
+ * smp_boot_data is an init data structure.
+ * We have to use smp_boot_data.cpu_phys_id to find
+ * the physical id of the processor because the normal
+ * cpu_physical_id() relies on data structures that
+ * may not be initialized yet.
+ */
+
+static int
+pxm_to_nasid(int pxm)
+{
+	int i;
+	int nid;
+
+	nid = pxm_to_nid_map[pxm];
+	for (i = 0; i < num_memblks; i++) {
+		if (node_memblk[i].nid == nid) {
+			return NASID_GET(node_memblk[i].start_paddr);
+		}
+	}
+	return -1;
+}
 /**
  * early_sn_setup - early setup routine for SN platforms
  *
@@ -223,6 +246,22 @@
 	extern void sn_cpu_init(void);
 	extern nasid_t snia_get_console_nasid(void);
 
+	/*
+	 * If the generic code has enabled vga console support - lets
+	 * get rid of it again. This is a kludge for the fact that ACPI
+	 * currtently has no way of informing us if legacy VGA is available
+	 * or not.
+	 */
+#if defined(CONFIG_VT) && defined(CONFIG_VGA_CONSOLE)
+	if (conswitchp == &vga_con) {
+		printk(KERN_DEBUG "SGI: Disabling VGA console\n");
+#ifdef CONFIG_DUMMY_CONSOLE
+		conswitchp = &dummy_con;
+#else
+		conswitchp = NULL;
+#endif /* CONFIG_DUMMY_CONSOLE */
+	}
+#endif /* def(CONFIG_VT) && def(CONFIG_VGA_CONSOLE) */
 
 	MAX_DMA_ADDRESS = PAGE_OFFSET + MAX_PHYS_MEMORY;
 
@@ -231,6 +270,19 @@
 		if (pxm_to_nid_map[pxm] != -1)
 			physical_node_map[pxm_to_nasid(pxm)] = pxm_to_nid_map[pxm];
 
+
+	/*
+	 * Old PROMs do not provide an ACPI FADT. Disable legacy keyboard
+	 * support here so we don't have to listen to failed keyboard probe
+	 * messages.
+	 */
+	if ((major < 2 || (major == 2 && minor <= 9)) &&
+	    acpi_kbd_controller_present) {
+		printk(KERN_INFO "Disabling legacy keyboard support as prom "
+		       "is too old and doesn't provide FADT\n");
+		acpi_kbd_controller_present = 0;
+	}
+
 	printk("SGI SAL version %x.%02x\n", major, minor);
 
 	/*
@@ -277,11 +329,6 @@
 	 */
 	sn_init_pdas(cmdline_p);
 
-	/*
-	 * Check for WARs.
-	 */
-	sn_check_for_wars();
-
 	ia64_mark_idle = &snidle;
 
 	/* 
@@ -340,7 +387,7 @@
 	/*
 	 * Now copy the array of nodepda pointers to each nodepda.
 	 */
-        for (cnode=0; cnode < numnodes; cnode++)
+        for (cnode=0; cnode < numionodes; cnode++)
 		memcpy(nodepdaindr[cnode]->pernode_pdaindr, nodepdaindr, sizeof(nodepdaindr));
 
 
@@ -371,7 +418,8 @@
 	int	cpuphyid;
 	int	nasid;
 	int	slice;
-	int	cnode, i;
+	int	cnode;
+	static int	wars_have_been_checked;
 
 	/*
 	 * The boot cpu makes this call again after platform initialization is
@@ -393,12 +441,24 @@
 	pda->hb_count = HZ/2;
 	pda->hb_state = 0;
 	pda->idle_flag = 0;
+
+	if (cpuid != 0){
+		memcpy(pda->cnodeid_to_nasid_table, pdacpu(0)->cnodeid_to_nasid_table,
+				sizeof(pda->cnodeid_to_nasid_table));
+	}
+
+	/*
+	 * Check for WARs.
+	 * Only needs to be done once, on BSP.
+	 * Has to be done after loop above, because it uses pda.cnodeid_to_nasid_table[i].
+	 * Has to be done before assignment below.
+	 */
+	if (!wars_have_been_checked) {
+		sn_check_for_wars();
+		wars_have_been_checked = 1;
+	}
 	pda->shub_1_1_found = shub_1_1_found;
 	
-	memset(pda->cnodeid_to_nasid_table, -1, sizeof(pda->cnodeid_to_nasid_table));
-	for (i=0; i<numnodes; i++)
-		pda->cnodeid_to_nasid_table[i] = pxm_to_nasid(nid_to_pxm_map[i]);
-
 	if (local_node_data->active_cpu_count == 1)
 		nodepda->node_first_cpu = cpuid;
 
@@ -437,8 +497,10 @@
  */
 
 void
-scan_for_ionodes(void) {
+scan_for_ionodes(void)
+{
 	int nasid = 0;
+	lboard_t *brd;
 
 	/* Setup ionodes with memory */
 	for (nasid = 0; nasid < MAX_PHYSNODE_ID; nasid +=2) {
@@ -450,12 +512,40 @@
 
 		klgraph_header = cnodeid = -1;
 		klgraph_header = ia64_sn_get_klconfig_addr(nasid);
-		if (klgraph_header <= 0)
+		if (klgraph_header <= 0) {
+			if ( IS_RUNNING_ON_SIMULATOR() )
+				continue;
 			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);
 	}
+
+	/* Scan headless/memless IO Nodes. */
+	for (nasid = 0; nasid < MAX_PHYSNODE_ID; nasid +=2) {
+		/* if there's no nasid, don't try to read the klconfig on the node */
+		if (physical_node_map[nasid] == -1) continue;
+		brd = find_lboard_any((lboard_t *)root_lboard[nasid_to_cnodeid(nasid)], KLTYPE_SNIA);
+		if (brd) {
+			brd = KLCF_NEXT_ANY(brd); /* Skip this node's lboard */
+			if (!brd)
+				continue;
+		}
+
+		brd = find_lboard_any(brd, KLTYPE_SNIA);
+		while (brd) {
+			pda->cnodeid_to_nasid_table[numionodes] = brd->brd_nasid;
+			physical_node_map[brd->brd_nasid] = numionodes;
+			root_lboard[numionodes] = brd;
+			numionodes++;
+			brd = KLCF_NEXT_ANY(brd);
+			if (!brd)
+				break;
+
+			brd = find_lboard_any(brd, KLTYPE_SNIA);
+		}
+	}
 }
--- diff/arch/ia64/sn/kernel/sn2/io.c	2003-10-27 09:20:36.000000000 +0000
+++ source/arch/ia64/sn/kernel/sn2/io.c	2004-02-09 10:39:51.000000000 +0000
@@ -23,6 +23,10 @@
 #undef __sn_readw
 #undef __sn_readl
 #undef __sn_readq
+#undef __sn_readb_relaxed
+#undef __sn_readw_relaxed
+#undef __sn_readl_relaxed
+#undef __sn_readq_relaxed
 
 unsigned int
 __sn_inb (unsigned long port)
@@ -84,4 +88,28 @@
 	return ___sn_readq (addr);
 }
 
+unsigned char
+__sn_readb_relaxed (void *addr)
+{
+	return ___sn_readb_relaxed (addr);
+}
+
+unsigned short
+__sn_readw_relaxed (void *addr)
+{
+	return ___sn_readw_relaxed (addr);
+}
+
+unsigned int
+__sn_readl_relaxed (void *addr)
+{
+	return ___sn_readl_relaxed (addr);
+}
+
+unsigned long
+__sn_readq_relaxed (void *addr)
+{
+	return ___sn_readq_relaxed (addr);
+}
+
 #endif
--- diff/arch/ia64/sn/kernel/sn2/prominfo_proc.c	2003-07-11 09:39:50.000000000 +0100
+++ source/arch/ia64/sn/kernel/sn2/prominfo_proc.c	2004-02-09 10:39:51.000000000 +0000
@@ -14,6 +14,7 @@
 #include <linux/proc_fs.h>
 #include <asm/system.h>
 #include <asm/io.h>
+#include <asm/sn/sn2/addrs.h>
 #include <asm/sn/simulator.h>
 
 /* to lookup nasids */
--- diff/arch/ia64/sn/kernel/sn2/sn2_smp.c	2004-02-09 10:36:07.000000000 +0000
+++ source/arch/ia64/sn/kernel/sn2/sn2_smp.c	2004-02-09 10:39:51.000000000 +0000
@@ -21,6 +21,7 @@
 
 #include <asm/processor.h>
 #include <asm/irq.h>
+#include <asm/sn/sgi.h>
 #include <asm/sal.h>
 #include <asm/system.h>
 #include <asm/delay.h>
--- diff/arch/ia64/sn/kernel/sn2/sn_proc_fs.c	2004-02-09 10:36:07.000000000 +0000
+++ source/arch/ia64/sn/kernel/sn2/sn_proc_fs.c	2004-02-09 10:39:51.000000000 +0000
@@ -10,6 +10,7 @@
 
 #ifdef CONFIG_PROC_FS
 #include <linux/proc_fs.h>
+#include <asm/sn/sgi.h>
 #include <asm/sn/sn_sal.h>
 
 
--- diff/arch/m68k/Kconfig	2004-01-19 10:22:55.000000000 +0000
+++ source/arch/m68k/Kconfig	2004-02-09 10:39:51.000000000 +0000
@@ -1073,8 +1073,7 @@
 	  precision in some cases.
 
 	  To compile this driver as a module, choose M here: the
-	  module will be called genrtc. To load the module automatically
-	  add 'alias char-major-10-135 genrtc' to your /etc/modules.conf
+	  module will be called genrtc.
 
 config GEN_RTC_X
 	bool "Extended RTC operation"
--- diff/arch/mips/kernel/sysirix.c	2003-09-30 15:46:11.000000000 +0100
+++ source/arch/mips/kernel/sysirix.c	2004-02-09 10:39:51.000000000 +0000
@@ -368,7 +368,7 @@
 			retval = HZ;
 			goto out;
 		case 4:
-			retval = NGROUPS;
+			retval = NGROUPS_MAX;
 			goto out;
 		case 5:
 			retval = NR_OPEN;
--- diff/arch/ppc/8260_io/enet.c	2003-09-30 15:46:11.000000000 +0100
+++ source/arch/ppc/8260_io/enet.c	2004-02-09 10:39:51.000000000 +0000
@@ -851,7 +851,7 @@
 
 	err = register_netdev(dev);
 	if (err) {
-		kfree(dev);
+		free_netdev(dev);
 		return err;
 	}
 
--- diff/arch/ppc/8260_io/fcc_enet.c	2003-09-30 15:46:11.000000000 +0100
+++ source/arch/ppc/8260_io/fcc_enet.c	2004-02-09 10:39:51.000000000 +0000
@@ -1371,7 +1371,7 @@
 
 		err = register_netdev(dev);
 		if (err) {
-			kfree(dev);
+			free_netdev(dev);
 			return err;
 		}
 
--- diff/arch/ppc/8xx_io/enet.c	2003-09-30 15:46:11.000000000 +0100
+++ source/arch/ppc/8xx_io/enet.c	2004-02-09 10:39:51.000000000 +0000
@@ -949,7 +949,7 @@
 
 	err = register_netdev(dev);
 	if (err) {
-		kfree(dev);
+		free_netdev(dev);
 		return err;
 	}
 
--- diff/arch/ppc/8xx_io/fec.c	2003-06-30 10:07:19.000000000 +0100
+++ source/arch/ppc/8xx_io/fec.c	2004-02-09 10:39:51.000000000 +0000
@@ -1748,7 +1748,7 @@
 
 	err = register_netdev(dev);
 	if (err) {
-		kfree(dev);
+		free_netdev(dev);
 		return err;
 	}
 
--- diff/arch/ppc/Kconfig	2004-02-09 10:36:07.000000000 +0000
+++ source/arch/ppc/Kconfig	2004-02-09 10:39:51.000000000 +0000
@@ -30,6 +30,10 @@
 	bool
 	default y
 
+# All PPCs use generic nvram driver through ppc_md
+config GENERIC_NVRAM
+	bool
+	default y
 
 source "init/Kconfig"
 
@@ -181,7 +185,7 @@
 
 config PPC601_SYNC_FIX
 	bool "Workarounds for PPC601 bugs"
-	depends on 6xx
+	depends on 6xx && (PPC_PREP || PPC_PMAC)
 	help
 	  Some versions of the PPC601 (the first PowerPC chip) have bugs which
 	  mean that extra synchronization instructions are required near
@@ -583,11 +587,6 @@
 	depends on PPC_MULTIPLATFORM
 	default y
 
-config PPC_GEN550
-	bool
-	depends on SANDPOINT
-	default y
-
 config PPC_PMAC
 	bool
 	depends on PPC_MULTIPLATFORM
@@ -603,6 +602,11 @@
 	depends on PPC_PMAC || PPC_CHRP
 	default y
 
+config PPC_GEN550
+	bool
+	depends on SANDPOINT || MCPN765
+	default y
+
 config FORCE
 	bool
 	depends on 6xx && (PCORE || POWERPMC250)
@@ -989,8 +993,6 @@
 
 source "drivers/pcmcia/Kconfig"
 
-source "drivers/parport/Kconfig"
-
 endmenu
 
 menu "Advanced setup"
@@ -1088,179 +1090,10 @@
 	depends on ADVANCED_OPTIONS && 8xx
 endmenu
 
-source "drivers/base/Kconfig"
-
-source "drivers/mtd/Kconfig"
-
-source "drivers/pnp/Kconfig"
-
-source "drivers/block/Kconfig"
-
-source "drivers/md/Kconfig"
-
-source "drivers/ide/Kconfig"
-
-source "drivers/scsi/Kconfig"
-
-source "drivers/message/fusion/Kconfig"
-
-source "drivers/ieee1394/Kconfig"
-
-source "drivers/message/i2o/Kconfig"
-
-source "net/Kconfig"
-
-source "drivers/isdn/Kconfig"
-
-source "drivers/video/Kconfig"
-
-source "drivers/cdrom/Kconfig"
-
-source "drivers/input/Kconfig"
-
-
-menu "Macintosh device drivers"
-
-# we want to change this to something like CONFIG_SYSCTRL_CUDA/PMU
-config ADB_CUDA
-	bool "Support for CUDA based PowerMacs"
-	depends on PPC_PMAC
-	help
-	  This provides support for CUDA based Power Macintosh systems.  This
-	  includes most OldWorld PowerMacs, the first generation iMacs, the
-	  Blue&White G3 and the "Yikes" G4 (PCI Graphics).  All later models
-	  should use CONFIG_ADB_PMU instead.  It is safe to say Y here even if
-	  your machine doesn't have a CUDA.
-
-	  If unsure say Y.
-
-config ADB_PMU
-	bool "Support for PMU  based PowerMacs"
-	depends on PPC_PMAC
-	help
-	  On PowerBooks, iBooks, and recent iMacs and Power Macintoshes, the
-	  PMU is an embedded microprocessor whose primary function is to
-	  control system power, and battery charging on the portable models.
-	  The PMU also controls the ADB (Apple Desktop Bus) which connects to
-	  the keyboard and mouse on some machines, as well as the non-volatile
-	  RAM and the RTC (real time clock) chip.  Say Y to enable support for
-	  this device; you should do so if your machine is one of those
-	  mentioned above.
-
-config PMAC_PBOOK
-	bool "Power management support for PowerBooks"
-	depends on ADB_PMU
-	---help---
-	  This provides support for putting a PowerBook to sleep; it also
-	  enables media bay support.  Power management works on the
-	  PB2400/3400/3500, Wallstreet, Lombard, and Bronze PowerBook G3 and
-	  the Titanium Powerbook G4, as well as the iBooks.  You should get
-	  the power management daemon, pmud, to make it work and you must have
-	  the /dev/pmu device (see the pmud README).
-
-	  Get pmud from <ftp://ftp.samba.org/pub/ppclinux/pmud/>.
-
-	  If you have a PowerBook, you should say Y here.
-
-	  You may also want to compile the dma sound driver as a module and
-	  have it autoloaded. The act of removing the module shuts down the
-	  sound hardware for more power savings.
-
-config PM
-	bool
-	depends on PPC_PMAC && ADB_PMU && PMAC_PBOOK
-	default y
-
-config PMAC_APM_EMU
-	tristate "APM emulation"
-	depends on PMAC_PBOOK
-
-# made a separate option since backlight may end up beeing used
-# on non-powerbook machines (but only on PMU based ones AFAIK)
-config PMAC_BACKLIGHT
-	bool "Backlight control for LCD screens"
-	depends on ADB_PMU
-	help
-	  Say Y here to build in code to manage the LCD backlight on a
-	  Macintosh PowerBook.  With this code, the backlight will be turned
-	  on and off appropriately on power-management and lid-open/lid-closed
-	  events; also, the PowerBook button device will be enabled so you can
-	  change the screen brightness.
-
-config MAC_FLOPPY
-	bool "Support for PowerMac floppy"
-	depends on PPC_PMAC
-	help
-	  If you have a SWIM-3 (Super Woz Integrated Machine 3; from Apple)
-	  floppy controller, say Y here. Most commonly found in PowerMacs.
-
-config MAC_SERIAL
-	tristate "Support for PowerMac serial ports (OBSOLETE DRIVER)"
-	depends on PPC_PMAC
-	help
-	  This driver is obsolete. Use CONFIG_SERIAL_PMACZILOG in
-	  "Character devices --> Serial drivers --> PowerMac z85c30" option.
-
-config ADB
-	bool "Apple Desktop Bus (ADB) support"
-	depends on PPC_PMAC
-	help
-	  Apple Desktop Bus (ADB) support is for support of devices which
-	  are connected to an ADB port.  ADB devices tend to have 4 pins.
-	  If you have an Apple Macintosh prior to the iMac, an iBook or
-	  PowerBook, or a "Blue and White G3", you probably want to say Y
-	  here.  Otherwise say N.
-
-config ADB_MACIO
-	bool "Include MacIO (CHRP) ADB driver"
-	depends on ADB
-	help
-	  Say Y here to include direct support for the ADB controller in the
-	  Hydra chip used on PowerPC Macintoshes of the CHRP type.  (The Hydra
-	  also includes a MESH II SCSI controller, DBDMA controller, VIA chip,
-	  OpenPIC controller and two RS422/Geoports.)
-
-config INPUT_ADBHID
-	bool "Support for ADB input devices (keyboard, mice, ...)"
-	depends on ADB && INPUT=y
-	help
-	  Say Y here if you want to have ADB (Apple Desktop Bus) HID devices
-	  such as keyboards, mice, joysticks, trackpads  or graphic tablets
-	  handled by the input layer.  If you say Y here, make sure to say Y to
-	  the corresponding drivers "Keyboard support" (CONFIG_INPUT_KEYBDEV),
-	  "Mouse Support" (CONFIG_INPUT_MOUSEDEV) and "Event interface
-	  support" (CONFIG_INPUT_EVDEV) as well.
-
-	  If unsure, say Y.
-
-config MAC_EMUMOUSEBTN
-	bool "Support for mouse button 2+3 emulation"
-	depends on INPUT_ADBHID
-	help
-	  This provides generic support for emulating the 2nd and 3rd mouse
-	  button with keypresses.  If you say Y here, the emulation is still
-	  disabled by default.  The emulation is controlled by these sysctl
-	  entries:
-	  /proc/sys/dev/mac_hid/mouse_button_emulation
-	  /proc/sys/dev/mac_hid/mouse_button2_keycode
-	  /proc/sys/dev/mac_hid/mouse_button3_keycode
-
-	  If you have an Apple machine with a 1-button mouse, say Y here.
-
-config ANSLCD
-	bool "Support for ANS LCD display"
-	depends on ADB_CUDA
-
-endmenu
-
-source "drivers/char/Kconfig"
-
-source "drivers/media/Kconfig"
+source "drivers/Kconfig"
 
 source "fs/Kconfig"
 
-source "sound/Kconfig"
-
 source "arch/ppc/8xx_io/Kconfig"
 
 source "arch/ppc/8260_io/Kconfig"
@@ -1285,8 +1118,6 @@
 
 endmenu
 
-source "drivers/usb/Kconfig"
-
 source "lib/Kconfig"
 
 
@@ -1404,7 +1235,7 @@
 
 config SERIAL_TEXT_DEBUG
 	bool "Support for early boot texts over serial port"
-	depends on 4xx || GT64260 || LOPEC || MCPN765 || PPLUS || PRPMC800 || SANDPOINT
+	depends on 4xx || GT64260 || LOPEC || PPLUS || PRPMC800 || PPC_GEN550
 
 config OCP
 	bool
--- diff/arch/ppc/boot/ld.script	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/ppc/boot/ld.script	2004-02-09 10:39:51.000000000 +0000
@@ -82,6 +82,7 @@
     *(__ksymtab)
     *(__ksymtab_strings)
     *(__bug_table)
+    *(__kcrctab)
   }
 
 }
--- diff/arch/ppc/configs/pmac_defconfig	2003-10-09 09:47:33.000000000 +0100
+++ source/arch/ppc/configs/pmac_defconfig	2004-02-09 10:39:51.000000000 +0000
@@ -6,13 +6,15 @@
 CONFIG_HAVE_DEC_LOCK=y
 CONFIG_PPC=y
 CONFIG_PPC32=y
+CONFIG_GENERIC_NVRAM=y
 
 #
 # Code maturity level options
 #
 CONFIG_EXPERIMENTAL=y
-CONFIG_CLEAN_COMPILE=y
+# CONFIG_CLEAN_COMPILE is not set
 # CONFIG_STANDALONE is not set
+CONFIG_BROKEN=y
 CONFIG_BROKEN_ON_SMP=y
 
 #
@@ -23,8 +25,7 @@
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
 CONFIG_LOG_BUF_SHIFT=14
-CONFIG_IKCONFIG=y
-CONFIG_IKCONFIG_PROC=y
+# CONFIG_IKCONFIG is not set
 # CONFIG_EMBEDDED is not set
 CONFIG_KALLSYMS=y
 CONFIG_FUTEX=y
@@ -32,6 +33,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,16 +55,15 @@
 # CONFIG_POWER4 is not set
 # CONFIG_8xx is not set
 CONFIG_ALTIVEC=y
-CONFIG_TAU=y
-# CONFIG_TAU_INT is not set
-# CONFIG_TAU_AVERAGE is not set
+# CONFIG_TAU is not set
 CONFIG_CPU_FREQ=y
 CONFIG_CPU_FREQ_PROC_INTF=y
 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 is not set
+CONFIG_CPU_FREQ_GOV_POWERSAVE=y
+CONFIG_CPU_FREQ_GOV_USERSPACE=y
+CONFIG_CPU_FREQ_24_API=y
 CONFIG_CPU_FREQ_PMAC=y
 CONFIG_CPU_FREQ_TABLE=y
 CONFIG_PPC601_SYNC_FIX=y
@@ -101,7 +102,7 @@
 CONFIG_PPCBUG_NVRAM=y
 # CONFIG_SMP is not set
 # CONFIG_PREEMPT is not set
-# CONFIG_HIGHMEM is not set
+CONFIG_HIGHMEM=y
 CONFIG_KERNEL_ELF=y
 CONFIG_BINFMT_ELF=y
 CONFIG_BINFMT_MISC=m
@@ -131,14 +132,10 @@
 CONFIG_TCIC=m
 
 #
-# Parallel port support
-#
-# CONFIG_PARPORT is not set
-
-#
 # Advanced setup
 #
 CONFIG_ADVANCED_OPTIONS=y
+# CONFIG_HIGHMEM_START_BOOL is not set
 CONFIG_HIGHMEM_START=0xfe000000
 # CONFIG_LOWMEM_SIZE_BOOL is not set
 CONFIG_LOWMEM_SIZE=0x30000000
@@ -149,6 +146,10 @@
 CONFIG_BOOT_LOAD=0x00800000
 
 #
+# Device Drivers
+#
+
+#
 # Generic Driver Options
 #
 # CONFIG_FW_LOADER is not set
@@ -159,6 +160,11 @@
 # CONFIG_MTD is not set
 
 #
+# Parallel port support
+#
+# CONFIG_PARPORT is not set
+
+#
 # Plug and Play support
 #
 # CONFIG_PNP is not set
@@ -166,6 +172,7 @@
 #
 # 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
@@ -179,11 +186,6 @@
 CONFIG_LBD=y
 
 #
-# Multi-device support (RAID and LVM)
-#
-# CONFIG_MD is not set
-
-#
 # ATA/ATAPI/MFM/RLL support
 #
 CONFIG_IDE=y
@@ -213,7 +215,6 @@
 # CONFIG_BLK_DEV_OPTI621 is not set
 CONFIG_BLK_DEV_SL82C105=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
@@ -284,15 +285,16 @@
 CONFIG_SCSI_AIC7XXX=m
 CONFIG_AIC7XXX_CMDS_PER_DEVICE=253
 CONFIG_AIC7XXX_RESET_DELAY_MS=15000
-# CONFIG_AIC7XXX_PROBE_EISA_VL is not set
 # CONFIG_AIC7XXX_BUILD_FIRMWARE is not set
 CONFIG_AIC7XXX_DEBUG_ENABLE=y
 CONFIG_AIC7XXX_DEBUG_MASK=0
 CONFIG_AIC7XXX_REG_PRETTY_PRINT=y
 CONFIG_SCSI_AIC7XXX_OLD=m
 # CONFIG_SCSI_AIC79XX is not set
+# CONFIG_SCSI_DPT_I2O is not set
 CONFIG_SCSI_ADVANSYS=m
 # 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
@@ -301,16 +303,24 @@
 # CONFIG_SCSI_FUTURE_DOMAIN is not set
 # CONFIG_SCSI_GDTH is not set
 # CONFIG_SCSI_IPS is not set
+# CONFIG_SCSI_INITIO 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_QLA21XX is not set
+# CONFIG_SCSI_QLA22XX is not set
+# CONFIG_SCSI_QLA23XX is not set
 # CONFIG_SCSI_DC395x is not set
+# CONFIG_SCSI_DC390T is not set
 # CONFIG_SCSI_NSP32 is not set
 # CONFIG_SCSI_DEBUG is not set
 CONFIG_SCSI_MESH=y
@@ -327,6 +337,11 @@
 # CONFIG_PCMCIA_QLOGIC is not set
 
 #
+# Multi-device support (RAID and LVM)
+#
+# CONFIG_MD is not set
+
+#
 # Fusion MPT device support
 #
 # CONFIG_FUSION is not set
@@ -340,15 +355,12 @@
 # Subsystem Options
 #
 # CONFIG_IEEE1394_VERBOSEDEBUG is not set
-# CONFIG_IEEE1394_OUI_DB is not set
+CONFIG_IEEE1394_OUI_DB=y
 
 #
 # Device Drivers
 #
-
-#
-# Texas Instruments PCILynx requires I2C bit-banging
-#
+CONFIG_IEEE1394_PCILYNX=m
 CONFIG_IEEE1394_OHCI1394=m
 
 #
@@ -368,6 +380,23 @@
 # CONFIG_I2O is not set
 
 #
+# Macintosh device drivers
+#
+CONFIG_ADB_CUDA=y
+CONFIG_ADB_PMU=y
+CONFIG_PMAC_PBOOK=y
+CONFIG_PMAC_APM_EMU=y
+CONFIG_PMAC_BACKLIGHT=y
+# CONFIG_MAC_FLOPPY is not set
+# CONFIG_MAC_SERIAL is not set
+CONFIG_ADB=y
+CONFIG_ADB_MACIO=y
+CONFIG_INPUT_ADBHID=y
+CONFIG_MAC_EMUMOUSEBTN=y
+# CONFIG_THERM_WINDTUNNEL is not set
+# CONFIG_ANSLCD is not set
+
+#
 # Networking support
 #
 CONFIG_NET=y
@@ -513,10 +542,11 @@
 # CONFIG_NET_TULIP is not set
 # CONFIG_HP100 is not set
 CONFIG_NET_PCI=y
-CONFIG_PCNET32=y
+# CONFIG_PCNET32 is not set
 # 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 is not set
@@ -543,7 +573,7 @@
 # CONFIG_R8169 is not set
 # CONFIG_SIS190 is not set
 # CONFIG_SK98LIN is not set
-# CONFIG_TIGON3 is not set
+CONFIG_TIGON3=y
 
 #
 # Ethernet (10000 Mbit)
@@ -557,8 +587,8 @@
 CONFIG_PPP_ASYNC=y
 CONFIG_PPP_SYNC_TTY=m
 CONFIG_PPP_DEFLATE=y
-CONFIG_PPP_BSDCOMP=m
-# CONFIG_PPPOE is not set
+CONFIG_PPP_BSDCOMP=y
+CONFIG_PPPOE=m
 # CONFIG_SLIP is not set
 
 #
@@ -689,58 +719,9 @@
 # CONFIG_ISDN_BOOL is not set
 
 #
-# Graphics support
+# Telephony Support
 #
-CONFIG_FB=y
-# CONFIG_FB_CYBER2000 is not set
-CONFIG_FB_OF=y
-CONFIG_FB_CONTROL=y
-CONFIG_FB_PLATINUM=y
-CONFIG_FB_VALKYRIE=y
-CONFIG_FB_CT65550=y
-CONFIG_FB_IMSTT=y
-# 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 is not set
-CONFIG_FB_MATROX_G100A=y
-CONFIG_FB_MATROX_G100=y
-# CONFIG_FB_MATROX_MULTIHEAD is not set
-CONFIG_FB_RADEON=y
-CONFIG_FB_ATY128=y
-CONFIG_FB_ATY=y
-CONFIG_FB_ATY_CT=y
-CONFIG_FB_ATY_GX=y
-# CONFIG_FB_ATY_XL_INIT is not set
-# CONFIG_FB_SIS is not set
-# CONFIG_FB_NEOMAGIC is not set
-CONFIG_FB_3DFX=y
-# 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
+# CONFIG_PHONE is not set
 
 #
 # Input device support
@@ -764,11 +745,8 @@
 #
 # CONFIG_GAMEPORT is not set
 CONFIG_SOUND_GAMEPORT=y
-CONFIG_SERIO=y
+# CONFIG_SERIO is not set
 # 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
@@ -786,22 +764,6 @@
 # CONFIG_INPUT_MISC is not set
 
 #
-# Macintosh device drivers
-#
-CONFIG_ADB_CUDA=y
-CONFIG_ADB_PMU=y
-CONFIG_PMAC_PBOOK=y
-CONFIG_PMAC_APM_EMU=y
-CONFIG_PMAC_BACKLIGHT=y
-# CONFIG_MAC_FLOPPY is not set
-CONFIG_MAC_SERIAL=y
-CONFIG_ADB=y
-CONFIG_ADB_MACIO=y
-CONFIG_INPUT_ADBHID=y
-CONFIG_MAC_EMUMOUSEBTN=y
-# CONFIG_ANSLCD is not set
-
-#
 # Character devices
 #
 CONFIG_VT=y
@@ -821,56 +783,16 @@
 # Non-8250 serial port support
 #
 CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
 CONFIG_SERIAL_PMACZILOG=y
-# CONFIG_SERIAL_PMACZILOG_CONSOLE is not set
+CONFIG_SERIAL_PMACZILOG_CONSOLE=y
 CONFIG_UNIX98_PTYS=y
 CONFIG_UNIX98_PTY_COUNT=256
 
 #
-# I2C support
-#
-CONFIG_I2C=m
-CONFIG_I2C_CHARDEV=m
-
-#
-# I2C Algorithms
-#
-# CONFIG_I2C_ALGOBIT is not set
-# CONFIG_I2C_ALGOPCF is not set
-
-#
-# I2C Hardware Bus support
-#
-# CONFIG_I2C_ALI1535 is not set
-# CONFIG_I2C_ALI15X3 is not set
-# CONFIG_I2C_AMD756 is not set
-# CONFIG_I2C_AMD8111 is not set
-# CONFIG_I2C_I801 is not set
-CONFIG_I2C_KEYWEST=m
-# CONFIG_I2C_NFORCE2 is not set
-# CONFIG_I2C_PIIX4 is not set
-# CONFIG_I2C_SIS5595 is not set
-# CONFIG_I2C_SIS630 is not set
-# CONFIG_I2C_SIS96X is not set
-# CONFIG_I2C_VIAPRO is not set
-
-#
-# I2C Hardware Sensors Chip support
-#
-# CONFIG_I2C_SENSOR is not set
-# CONFIG_SENSORS_ADM1021 is not set
-# CONFIG_SENSORS_EEPROM is not set
-# CONFIG_SENSORS_IT87 is not set
-# CONFIG_SENSORS_LM75 is not set
-# CONFIG_SENSORS_LM78 is not set
-# CONFIG_SENSORS_LM85 is not set
-# CONFIG_SENSORS_VIA686A is not set
-# CONFIG_SENSORS_W83781D is not set
-
-#
 # Mice
 #
-CONFIG_BUSMOUSE=y
+# CONFIG_BUSMOUSE is not set
 # CONFIG_QIC02_TAPE is not set
 
 #
@@ -884,7 +806,7 @@
 # CONFIG_WATCHDOG is not set
 CONFIG_NVRAM=y
 CONFIG_GEN_RTC=y
-# CONFIG_GEN_RTC_X is not set
+CONFIG_GEN_RTC_X=y
 # CONFIG_DTLK is not set
 # CONFIG_R3964 is not set
 # CONFIG_APPLICOM is not set
@@ -893,8 +815,15 @@
 # Ftape, the floppy tape device driver
 #
 # CONFIG_FTAPE is not set
-# CONFIG_AGP is not set
-# CONFIG_DRM is not set
+CONFIG_AGP=m
+CONFIG_AGP_UNINORTH=m
+CONFIG_DRM=y
+# CONFIG_DRM_TDFX is not set
+# CONFIG_DRM_GAMMA is not set
+CONFIG_DRM_R128=m
+CONFIG_DRM_RADEON=m
+# CONFIG_DRM_MGA is not set
+# CONFIG_DRM_SIS is not set
 
 #
 # PCMCIA character devices
@@ -903,167 +832,131 @@
 # CONFIG_RAW_DRIVER is not set
 
 #
-# Multimedia devices
-#
-# CONFIG_VIDEO_DEV is not set
-
-#
-# Digital Video Broadcasting Devices
+# I2C support
 #
-# CONFIG_DVB is not set
+CONFIG_I2C=y
+CONFIG_I2C_CHARDEV=y
 
 #
-# File systems
+# I2C Algorithms
 #
-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 is not set
+CONFIG_I2C_ALGOBIT=y
+# CONFIG_I2C_ALGOPCF is not set
 
 #
-# CD-ROM/DVD Filesystems
+# I2C Hardware Bus support
 #
-CONFIG_ISO9660_FS=y
-# CONFIG_JOLIET is not set
-# CONFIG_ZISOFS is not set
-# CONFIG_UDF_FS is not set
+# CONFIG_I2C_ALI1535 is not set
+# CONFIG_I2C_ALI15X3 is not set
+# CONFIG_I2C_AMD756 is not set
+# CONFIG_I2C_AMD8111 is not set
+# CONFIG_I2C_ELV is not set
+# CONFIG_I2C_I801 is not set
+# CONFIG_I2C_I810 is not set
+# CONFIG_I2C_ISA is not set
+CONFIG_I2C_KEYWEST=m
+# CONFIG_I2C_NFORCE2 is not set
+# CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_I2C_PIIX4 is not set
+# CONFIG_I2C_PROSAVAGE is not set
+# CONFIG_I2C_SAVAGE4 is not set
+# CONFIG_SCx200_ACB is not set
+# CONFIG_I2C_SIS5595 is not set
+# CONFIG_I2C_SIS630 is not set
+# CONFIG_I2C_SIS96X is not set
+# CONFIG_I2C_VELLEMAN is not set
+# CONFIG_I2C_VIA is not set
+# CONFIG_I2C_VIAPRO is not set
+# CONFIG_I2C_VOODOO3 is not set
 
 #
-# DOS/FAT/NT Filesystems
+# I2C Hardware Sensors Chip support
 #
-CONFIG_FAT_FS=m
-CONFIG_MSDOS_FS=m
-CONFIG_VFAT_FS=m
-# CONFIG_NTFS_FS is not set
+# CONFIG_I2C_SENSOR is not set
+# CONFIG_SENSORS_ADM1021 is not set
+# CONFIG_SENSORS_ASB100 is not set
+# CONFIG_SENSORS_EEPROM is not set
+# CONFIG_SENSORS_IT87 is not set
+# CONFIG_SENSORS_LM75 is not set
+# CONFIG_SENSORS_LM78 is not set
+# CONFIG_SENSORS_LM83 is not set
+# CONFIG_SENSORS_LM85 is not set
+# CONFIG_SENSORS_LM90 is not set
+# CONFIG_SENSORS_VIA686A is not set
+# CONFIG_SENSORS_W83781D is not set
+# CONFIG_SENSORS_W83L785TS is not set
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+# CONFIG_I2C_DEBUG_CHIP is not set
 
 #
-# Pseudo filesystems
+# Multimedia devices
 #
-CONFIG_PROC_FS=y
-CONFIG_PROC_KCORE=y
-CONFIG_DEVFS_FS=y
-# CONFIG_DEVFS_MOUNT is not set
-# CONFIG_DEVFS_DEBUG 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
+# CONFIG_VIDEO_DEV is not set
 
 #
-# Miscellaneous filesystems
+# Digital Video Broadcasting Devices
 #
-# CONFIG_ADFS_FS is not set
-# CONFIG_AFFS_FS is not set
-CONFIG_HFS_FS=m
-# 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
+# CONFIG_DVB is not set
 
 #
-# Network File Systems
+# Graphics support
 #
-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=m
-# CONFIG_SMB_NLS_DEFAULT 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
+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_CONTROL=y
+CONFIG_FB_PLATINUM=y
+CONFIG_FB_VALKYRIE=y
+CONFIG_FB_CT65550=y
+CONFIG_FB_IMSTT=y
+# CONFIG_FB_S3TRIO is not set
+# CONFIG_FB_VGA16 is not set
+CONFIG_FB_RIVA=y
+CONFIG_FB_MATROX=y
+CONFIG_FB_MATROX_MILLENIUM=y
+CONFIG_FB_MATROX_MYSTIQUE=y
+# CONFIG_FB_MATROX_G450 is not set
+CONFIG_FB_MATROX_G100A=y
+CONFIG_FB_MATROX_G100=y
+# CONFIG_FB_MATROX_I2C is not set
+# CONFIG_FB_MATROX_MULTIHEAD is not set
+CONFIG_FB_RADEON=y
+CONFIG_FB_ATY128=y
+CONFIG_FB_ATY=y
+CONFIG_FB_ATY_CT=y
+CONFIG_FB_ATY_GX=y
+# CONFIG_FB_ATY_XL_INIT is not set
+# CONFIG_FB_SIS is not set
+# CONFIG_FB_NEOMAGIC is not set
+# CONFIG_FB_KYRO is not set
+CONFIG_FB_3DFX=y
+# CONFIG_FB_VOODOO1 is not set
+# CONFIG_FB_TRIDENT is not set
+# CONFIG_FB_PM3 is not set
+# CONFIG_FB_VIRTUAL is not set
 
 #
-# Partition Types
+# Console display driver support
 #
-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=y
-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 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
+# 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
 
 #
-# Native Language Support
+# Logo configuration
 #
-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_1250 is not set
-# CONFIG_NLS_CODEPAGE_1251 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
-# 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
+CONFIG_LOGO=y
+CONFIG_LOGO_LINUX_MONO=y
+CONFIG_LOGO_LINUX_VGA16=y
+CONFIG_LOGO_LINUX_CLUT224=y
 
 #
 # Sound
@@ -1164,7 +1057,7 @@
 #
 # CONFIG_USB_EHCI_HCD is not set
 CONFIG_USB_OHCI_HCD=y
-# CONFIG_USB_UHCI_HCD is not set
+CONFIG_USB_UHCI_HCD=y
 
 #
 # USB Device Class drivers
@@ -1234,8 +1127,20 @@
 # CONFIG_USB_SERIAL_IR is not set
 # CONFIG_USB_SERIAL_EDGEPORT is not set
 # CONFIG_USB_SERIAL_EDGEPORT_TI is not set
-# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
-# CONFIG_USB_SERIAL_KEYSPAN is not set
+CONFIG_USB_SERIAL_KEYSPAN_PDA=m
+CONFIG_USB_SERIAL_KEYSPAN=m
+CONFIG_USB_SERIAL_KEYSPAN_MPR=y
+CONFIG_USB_SERIAL_KEYSPAN_USA28=y
+CONFIG_USB_SERIAL_KEYSPAN_USA28X=y
+CONFIG_USB_SERIAL_KEYSPAN_USA28XA=y
+CONFIG_USB_SERIAL_KEYSPAN_USA28XB=y
+CONFIG_USB_SERIAL_KEYSPAN_USA19=y
+CONFIG_USB_SERIAL_KEYSPAN_USA18X=y
+CONFIG_USB_SERIAL_KEYSPAN_USA19W=y
+CONFIG_USB_SERIAL_KEYSPAN_USA19QW=y
+CONFIG_USB_SERIAL_KEYSPAN_USA19QI=y
+CONFIG_USB_SERIAL_KEYSPAN_USA49W=y
+CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y
 # CONFIG_USB_SERIAL_KLSI is not set
 # CONFIG_USB_SERIAL_KOBIL_SCT is not set
 # CONFIG_USB_SERIAL_MCT_U232 is not set
@@ -1244,19 +1149,176 @@
 # CONFIG_USB_SERIAL_CYBERJACK is not set
 # CONFIG_USB_SERIAL_XIRCOM is not set
 # CONFIG_USB_SERIAL_OMNINET is not set
+CONFIG_USB_EZUSB=y
 
 #
 # 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
 # CONFIG_USB_GADGET 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 is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+CONFIG_ISO9660_FS=y
+# CONFIG_JOLIET is not set
+# CONFIG_ZISOFS 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_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=y
+# 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=m
+# CONFIG_SMB_NLS_DEFAULT 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=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=y
+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 is not set
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
+# CONFIG_EFI_PARTITION is not set
+
+#
+# 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
+# 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=m
+# 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
+
+#
 # Library routines
 #
 CONFIG_CRC32=y
@@ -1266,7 +1328,16 @@
 #
 # Kernel hacking
 #
-# CONFIG_DEBUG_KERNEL is not set
+CONFIG_DEBUG_KERNEL=y
+# CONFIG_DEBUG_SLAB is not set
+# CONFIG_MAGIC_SYSRQ is not set
+# CONFIG_DEBUG_SPINLOCK is not set
+# CONFIG_DEBUG_HIGHMEM is not set
+# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
+# CONFIG_KGDB is not set
+# CONFIG_XMON is not set
+# CONFIG_BDI_SWITCH is not set
+# CONFIG_DEBUG_INFO is not set
 CONFIG_BOOTX_TEXT=y
 
 #
--- diff/arch/ppc/kernel/Makefile	2004-02-09 10:36:07.000000000 +0000
+++ source/arch/ppc/kernel/Makefile	2004-02-09 10:39:51.000000000 +0000
@@ -22,11 +22,12 @@
 					semaphore.o syscalls.o setup.o \
 					cputable.o ppc_htab.o
 obj-$(CONFIG_6xx)		+= l2cr.o cpu_setup_6xx.o
+obj-$(CONFIG_POWER4)		+= cpu_setup_power4.o
 obj-$(CONFIG_MODULES)		+= module.o ppc_ksyms.o
 obj-$(CONFIG_PCI)		+= pci.o
 obj-$(CONFIG_PCI)		+= pci-dma.o
 obj-$(CONFIG_KGDB)		+= ppc-stub.o
-obj-$(CONFIG_SMP)		+= smp.o
+obj-$(CONFIG_SMP)		+= smp.o smp-tbsync.o
 obj-$(CONFIG_TAU)		+= temp.o
 
 ifdef CONFIG_MATH_EMULATION
--- diff/arch/ppc/kernel/cpu_setup_6xx.S	2003-10-27 09:20:37.000000000 +0000
+++ source/arch/ppc/kernel/cpu_setup_6xx.S	2004-02-09 10:39:51.000000000 +0000
@@ -142,7 +142,7 @@
 	sync
 	isync
 	blr
-	
+
 /* 740/750/7400/7410
  * Enable Store Gathering (SGE), Address Brodcast (ABE),
  * Branch History Table (BHTE), Branch Target ICache (BTIC)
@@ -213,7 +213,7 @@
 	li	r7,CPU_FTR_CAN_NAP
 	andc	r6,r6,r7
 	stw	r6,CPU_SPEC_FEATURES(r5)
-1:	
+1:
 	mfspr	r11,HID0
 
 	/* All of the bits we have to set.....
@@ -248,20 +248,21 @@
 /* Definitions for the table use to save CPU states */
 #define CS_HID0		0
 #define CS_HID1		4
-#define	CS_MSSCR0	8
-#define CS_MSSSR0	12
-#define CS_ICTRL	16
-#define CS_LDSTCR	20
-#define CS_LDSTDB	24
-#define CS_SIZE		28
+#define CS_HID2		8
+#define	CS_MSSCR0	12
+#define CS_MSSSR0	16
+#define CS_ICTRL	20
+#define CS_LDSTCR	24
+#define CS_LDSTDB	28
+#define CS_SIZE		32
 
 	.data
 	.balign	L1_CACHE_LINE_SIZE
-cpu_state_storage:	
+cpu_state_storage:
 	.space	CS_SIZE
 	.balign	L1_CACHE_LINE_SIZE,0
 	.text
-	
+
 /* Called in normal context to backup CPU 0 state. This
  * does not include cache settings. This function is also
  * called for machine sleep. This does not include the MMU
@@ -311,11 +312,18 @@
 	stw	r4,CS_LDSTCR(r5)
 	mfspr	r4,SPRN_LDSTDB
 	stw	r4,CS_LDSTDB(r5)
-1:	
+1:
 	bne	cr5,1f
 	/* Backup 750FX specific registers */
 	mfspr	r4,SPRN_HID1
 	stw	r4,CS_HID1(r5)
+	/* If rev 2.x, backup HID2 */
+	mfspr	r3,PVR
+	andi.	r3,r3,0xff00
+	cmpi	cr0,r3,0x0200
+	bne	1f
+	mfspr	r4,SPRN_HID2
+	stw	r4,CS_HID2(r5)
 1:
 	mtcr	r7
 	blr
@@ -395,9 +403,19 @@
 	sync
 2:	bne	cr5,1f
 	/* Restore 750FX specific registers
-	 * that is restore PLL config & switch
-	 * to PLL 0
+	 * that is restore HID2 on rev 2.x and PLL config & switch
+	 * to PLL 0 on all
 	 */
+	/* If rev 2.x, restore HID2 with low voltage bit cleared */
+	mfspr	r3,PVR
+	andi.	r3,r3,0xff00
+	cmpi	cr0,r3,0x0200
+	bne	4f
+	lwz	r4,CS_HID2(r5)
+	rlwinm	r4,r4,0,19,17
+	mtspr	SPRN_HID2,r4
+	sync
+4:
 	lwz	r4,CS_HID1(r5)
 	rlwinm  r5,r4,0,16,14
 	mtspr	SPRN_HID1,r5
--- diff/arch/ppc/kernel/head.S	2003-10-27 09:20:37.000000000 +0000
+++ source/arch/ppc/kernel/head.S	2004-02-09 10:39:51.000000000 +0000
@@ -141,17 +141,6 @@
 	mr	r27,r7
 	li	r24,0			/* cpu # */
 
-#ifdef CONFIG_POWER4
-/*
- * On the PPC970, we have to turn off real-mode cache inhibit
- * early, before we first turn the MMU off.
- */
-	mfspr	r0,SPRN_PVR
-	srwi	r0,r0,16
-	cmpwi	r0,0x39
-	beql	ppc970_setup_hid
-#endif /* CONFIG_POWER4 */
-
 /*
  * early_init() does the early machine identification and does
  * the necessary low-level setup and clears the BSS
@@ -159,6 +148,14 @@
  */
 	bl	early_init
 
+/*
+ * On POWER4, we first need to tweak some CPU configuration registers
+ * like real mode cache inhibit or exception base
+ */
+#ifdef CONFIG_POWER4
+	bl	__power4_cpu_preinit
+#endif /* CONFIG_POWER4 */
+
 #ifdef CONFIG_APUS
 /* On APUS the __va/__pa constants need to be set to the correct
  * values before continuing.
@@ -1216,7 +1213,7 @@
 __secondary_start:
 #ifdef CONFIG_PPC64BRIDGE
 	mfmsr	r0
-	clrldi	r0,r0,1		/* make sure it's in 32-bit mode */
+	clrldi	r0,r0,1			/* make sure it's in 32-bit mode */
 	SYNC
 	MTMSRD(r0)
 	isync
@@ -1278,26 +1275,15 @@
  */
 _GLOBAL(__setup_cpu_power3)
 	blr
-_GLOBAL(__setup_cpu_power4)
-	blr
-_GLOBAL(__setup_cpu_ppc970)
-	blr
 _GLOBAL(__setup_cpu_generic)
 	blr
 
-#ifndef CONFIG_6xx
+#if !defined(CONFIG_6xx) && !defined(CONFIG_POWER4)
 _GLOBAL(__save_cpu_setup)
 	blr
 _GLOBAL(__restore_cpu_setup)
-#ifdef CONFIG_POWER4
-	/* turn off real-mode cache inhibit on the PPC970 */
-	mfspr	r0,SPRN_PVR
-	srwi	r0,r0,16
-	cmpwi	r0,0x39
-	beq	ppc970_setup_hid
-#endif
 	blr
-#endif /* CONFIG_6xx */
+#endif /* !defined(CONFIG_6xx) && !defined(CONFIG_POWER4) */
 
 
 /*
@@ -1633,10 +1619,14 @@
 	lis	r4,0x2000		/* set pseudo-segment reg 12 */
 	ori	r5,r4,0x0ccc
 	mtsr	12,r5
+#if 0
 	ori	r5,r4,0x0888		/* set pseudo-segment reg 8 */
 	mtsr	8,r5			/* (for access to serial port) */
-	ori	r5,r4,0x0999		/* set pseudo-segment reg 8 */
+#endif
+#ifdef CONFIG_BOOTX_TEXT
+	ori	r5,r4,0x0999		/* set pseudo-segment reg 9 */
 	mtsr	9,r5			/* (for access to screen) */
+#endif
 	mfmsr	r0
 	clrldi	r0,r0,1
 	sync
@@ -1644,43 +1634,8 @@
 	isync
 	blr
 
-/*
- * On 970 (G5), we pre-set a few bits in HID0 & HID1
- */
-ppc970_setup_hid:
-	li	r0,0
-	sync
-	mtspr	0x3f4,r0
-	isync
-	sync
-	mtspr	0x3f6,r0
-	isync
-	mfspr	r0,SPRN_HID0
-	li	r11,1			/* clear DOZE, NAP and SLEEP */
-	rldimi	r0,r11,52,8		/* set DPM */
-	mtspr	SPRN_HID0,r0
-	mfspr	r0,SPRN_HID0
-	mfspr	r0,SPRN_HID0
-	mfspr	r0,SPRN_HID0
-	mfspr	r0,SPRN_HID0
-	mfspr	r0,SPRN_HID0
-	mfspr	r0,SPRN_HID0
-	sync
-	isync
-	mfspr	r0,SPRN_HID1
-	li	r11,0x1200		/* enable i-fetch cacheability */
-	sldi	r11,r11,44		/* and prefetch */
-	or	r0,r0,r11
-	mtspr	SPRN_HID1,r0
-	mtspr	SPRN_HID1,r0
-	isync
-	li	r0,0
-	sync
-	mtspr	0x137,0
-	isync
-	blr
 #endif /* CONFIG_POWER4 */
-
+	
 #ifdef CONFIG_8260
 /* Jump into the system reset for the rom.
  * We first disable the MMU, and then jump to the ROM reset address.
--- diff/arch/ppc/kernel/idle_power4.S	2003-09-30 15:46:12.000000000 +0100
+++ source/arch/ppc/kernel/idle_power4.S	2004-02-09 10:39:51.000000000 +0000
@@ -28,17 +28,11 @@
 
 /*
  * Init idle, called at early CPU setup time from head.S for each CPU
- * Make sure no rest of NAP mode remains in HID0, save default
- * values for some CPU specific registers. Called with r24
- * containing CPU number and r3 reloc offset
+ * So nothing for now. Called with r24 containing CPU number and r3
+ * reloc offset
  */
  	.globl	init_idle_power4
 init_idle_power4:
-BEGIN_FTR_SECTION
-	mfspr	r4,SPRN_HID0
-	rlwinm	r4,r4,0,10,8	/* Clear NAP */
-	mtspr	SPRN_HID0, r4
-END_FTR_SECTION_IFSET(CPU_FTR_CAN_NAP)
 	blr
 
 /*
@@ -48,10 +42,9 @@
  */
 	.globl	power4_idle
 power4_idle:
-	/* Check if we can nap or doze, put HID0 mask in r3
-	 */
-	lis	r3, 0
 BEGIN_FTR_SECTION
+	blr
+END_FTR_SECTION_IFCLR(CPU_FTR_CAN_NAP)
 	/* We must dynamically check for the NAP feature as it
 	 * can be cleared by CPU init after the fixups are done
 	 */
@@ -59,16 +52,11 @@
 	lwz	r4,cur_cpu_spec@l(r4)
 	lwz	r4,CPU_SPEC_FEATURES(r4)
 	andi.	r0,r4,CPU_FTR_CAN_NAP
-	beq	1f
+	beqlr
 	/* Now check if user or arch enabled NAP mode */
 	lis	r4,powersave_nap@ha
 	lwz	r4,powersave_nap@l(r4)
 	cmpi	0,r4,0
-	beq	1f
-	lis	r3,HID0_NAP@h
-1:	
-END_FTR_SECTION_IFSET(CPU_FTR_CAN_NAP)
-	cmpi	0,r3,0
 	beqlr
 
 	/* Clear MSR:EE */
@@ -85,18 +73,6 @@
 	blr
 1:	
 	/* Go to NAP now */	
-	mfspr	r4,SPRN_HID0
-	lis	r5,(HID0_NAP|HID0_SLEEP)@h
-	andc	r4,r4,r5
-	or	r4,r4,r3
-	oris	r4,r4,HID0_DPM@h	/* that should be done once for all  */
-	mtspr	SPRN_HID0,r4
-	mfspr	r0,SPRN_HID0
-	mfspr	r0,SPRN_HID0
-	mfspr	r0,SPRN_HID0
-	mfspr	r0,SPRN_HID0
-	mfspr	r0,SPRN_HID0
-	mfspr	r0,SPRN_HID0
 BEGIN_FTR_SECTION
 	DSSALL
 	sync
--- diff/arch/ppc/kernel/misc.S	2004-02-09 10:36:07.000000000 +0000
+++ source/arch/ppc/kernel/misc.S	2004-02-09 10:39:51.000000000 +0000
@@ -201,7 +201,7 @@
 	mr	r4,r24
 	bctr
 
-#ifdef CONFIG_CPU_FREQ_PMAC
+#if defined(CONFIG_CPU_FREQ_PMAC) && defined(CONFIG_6xx)
 
 /* This gets called by via-pmu.c to switch the PLL selection
  * on 750fx CPU. This function should really be moved to some
@@ -253,7 +253,7 @@
 	mtmsr	r7
 	blr
 
-#endif /* CONFIG_CPU_FREQ_PMAC */
+#endif /* CONFIG_CPU_FREQ_PMAC && CONFIG_6xx */
 
 /* void local_save_flags_ptr(unsigned long *flags) */
 _GLOBAL(local_save_flags_ptr)
--- diff/arch/ppc/kernel/pci.c	2003-09-30 15:46:12.000000000 +0100
+++ source/arch/ppc/kernel/pci.c	2004-02-09 10:39:51.000000000 +0000
@@ -46,7 +46,9 @@
 static void fixup_rev1_53c810(struct pci_dev* dev);
 static void fixup_cpc710_pci64(struct pci_dev* dev);
 #ifdef CONFIG_PPC_PMAC
-static void pcibios_fixup_cardbus(struct pci_dev* dev);
+extern void pmac_pci_fixup_cardbus(struct pci_dev* dev);
+extern void pmac_pci_fixup_pciata(struct pci_dev* dev);
+extern void pmac_pci_fixup_k2_sata(struct pci_dev* dev);
 #endif
 #ifdef CONFIG_PPC_OF
 static u8* pci_to_OF_bus_map;
@@ -69,7 +71,9 @@
 	{ PCI_FIXUP_HEADER,	PCI_ANY_ID,		PCI_ANY_ID,			pcibios_fixup_resources },
 #ifdef CONFIG_PPC_PMAC
 	/* We should add per-machine fixup support in xxx_setup.c or xxx_pci.c */
-	{ PCI_FIXUP_FINAL,	PCI_VENDOR_ID_TI,	PCI_ANY_ID,			pcibios_fixup_cardbus },
+	{ PCI_FIXUP_FINAL,	PCI_VENDOR_ID_TI,	PCI_ANY_ID,			pmac_pci_fixup_cardbus },
+	{ PCI_FIXUP_FINAL,	PCI_ANY_ID,		PCI_ANY_ID,			pmac_pci_fixup_pciata },
+	{ PCI_FIXUP_HEADER,	PCI_VENDOR_ID_SERVERWORKS, 0x0240,			pmac_pci_fixup_k2_sata },
 #endif /* CONFIG_PPC_PMAC */
  	{ 0 }
 };
@@ -155,42 +159,6 @@
 		ppc_md.pcibios_fixup_resources(dev);
 }
 
-#ifdef CONFIG_PPC_PMAC
-static void
-pcibios_fixup_cardbus(struct pci_dev* dev)
-{
-	if (_machine != _MACH_Pmac)
-		return;
-	/*
-	 * Fix the interrupt routing on the various cardbus bridges
-	 * used on powerbooks
-	 */
-	if (dev->vendor != PCI_VENDOR_ID_TI)
-		return;
-	if (dev->device == PCI_DEVICE_ID_TI_1130 ||
-	    dev->device == PCI_DEVICE_ID_TI_1131) {
-		u8 val;
-	    	/* Enable PCI interrupt */
-		if (pci_read_config_byte(dev, 0x91, &val) == 0)
-			pci_write_config_byte(dev, 0x91, val | 0x30);
-		/* Disable ISA interrupt mode */
-		if (pci_read_config_byte(dev, 0x92, &val) == 0)
-			pci_write_config_byte(dev, 0x92, val & ~0x06);
-	}
-	if (dev->device == PCI_DEVICE_ID_TI_1210 ||
-	    dev->device == PCI_DEVICE_ID_TI_1211 ||
-	    dev->device == PCI_DEVICE_ID_TI_1410) {
-		u8 val;
-		/* 0x8c == TI122X_IRQMUX, 2 says to route the INTA
-		   signal out the MFUNC0 pin */
-		if (pci_read_config_byte(dev, 0x8c, &val) == 0)
-			pci_write_config_byte(dev, 0x8c, (val & ~0x0f) | 2);
-		/* Disable ISA interrupt mode */
-		if (pci_read_config_byte(dev, 0x92, &val) == 0)
-			pci_write_config_byte(dev, 0x92, val & ~0x06);
-	}
-}
-#endif /* CONFIG_PPC_PMAC */
 
 void
 pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
@@ -832,6 +800,17 @@
 		return NULL;
 
 	/* Fixup bus number according to what OF think it is. */
+#ifdef CONFIG_PPC_PMAC
+	/* The G5 need a special case here. Basically, we don't remap all
+	 * busses on it so we don't create the pci-OF-map. However, we do
+	 * remap the AGP bus and so have to deal with it. A future better
+	 * fix has to be done by making the remapping per-host and always
+	 * filling the pci_to_OF map. --BenH
+	 */
+	if (_machine == _MACH_Pmac && busnr >= 0xf0)
+		busnr -= 0xf0;
+	else
+#endif
 	if (pci_to_OF_bus_map)
 		busnr = pci_to_OF_bus_map[busnr];
 	if (busnr == 0xff)
@@ -922,9 +901,10 @@
 pci_process_bridge_OF_ranges(struct pci_controller *hose,
 			   struct device_node *dev, int primary)
 {
-	unsigned int *ranges, *prev;
+	static unsigned int static_lc_ranges[1024] __initdata;
+	unsigned int *dt_ranges, *lc_ranges, *ranges, *prev;
 	unsigned int size;
-	int rlen = 0;
+	int rlen = 0, orig_rlen;
 	int memno = 0;
 	struct resource *res;
 	int np, na = prom_n_addr_cells(dev);
@@ -934,7 +914,22 @@
 	 * that can have more than 3 ranges, fortunately using contiguous
 	 * addresses -- BenH
 	 */
-	ranges = (unsigned int *) get_property(dev, "ranges", &rlen);
+	dt_ranges = (unsigned int *) get_property(dev, "ranges", &rlen);
+	if (!dt_ranges)
+		return;
+	/* Sanity check, though hopefully that never happens */
+	if (rlen > 1024) {
+		printk(KERN_WARNING "OF ranges property too large !\n");
+		rlen = 1024;
+	}
+	lc_ranges = static_lc_ranges;
+	memcpy(lc_ranges, dt_ranges, rlen);
+	orig_rlen = rlen;
+
+	/* Let's work on a copy of the "ranges" property instead of damaging
+	 * the device-tree image in memory
+	 */
+	ranges = lc_ranges;
 	prev = NULL;
 	while ((rlen -= np * sizeof(unsigned int)) >= 0) {
 		if (prev) {
@@ -959,10 +954,9 @@
 	 *			(size depending on dev->n_addr_cells)
 	 *   cells 4+5 or 5+6:	the size of the range
 	 */
-	rlen = 0;
-	hose->io_base_phys = 0;
-	ranges = (unsigned int *) get_property(dev, "ranges", &rlen);
-	while ((rlen -= np * sizeof(unsigned int)) >= 0) {
+	ranges = lc_ranges;
+	rlen = orig_rlen;
+	while (ranges && (rlen -= np * sizeof(unsigned int)) >= 0) {
 		res = NULL;
 		size = ranges[na+4];
 		switch (ranges[0] >> 24) {
@@ -1059,7 +1053,7 @@
 
  	res = *(bus->resource[0]);
 
-	DBG("Remapping Bus %d, bridge: %s\n", bus->number, bridge->name);
+	DBG("Remapping Bus %d, bridge: %s\n", bus->number, bridge->slot_name);
 	res.start -= ((unsigned long) hose->io_base_virt - isa_io_base);
 	res.end -= ((unsigned long) hose->io_base_virt - isa_io_base);
 	DBG("  IO window: %08lx-%08lx\n", res.start, res.end);
@@ -1662,12 +1656,23 @@
  * Note that the returned IO or memory base is a physical address
  */
 
-long
-sys_pciconfig_iobase(long which, unsigned long bus, unsigned long devfn)
+long sys_pciconfig_iobase(long which, unsigned long bus, unsigned long devfn)
 {
-	struct pci_controller* hose = pci_bus_to_hose(bus);
+	struct pci_controller* hose;
 	long result = -EOPNOTSUPP;
 
+	/* Argh ! Please forgive me for that hack, but that's the
+	 * simplest way to get existing XFree to not lockup on some
+	 * G5 machines... So when something asks for bus 0 io base
+	 * (bus 0 is HT root), we return the AGP one instead.
+	 */
+#ifdef CONFIG_PPC_PMAC
+	if (_machine == _MACH_Pmac && machine_is_compatible("MacRISC4"))
+		if (bus == 0)
+			bus = 0xf0;
+#endif /* CONFIG_PPC_PMAC */
+
+	hose = pci_bus_to_hose(bus);
 	if (!hose)
 		return -ENODEV;
 
--- diff/arch/ppc/kernel/ppc_ksyms.c	2004-02-09 10:36:07.000000000 +0000
+++ source/arch/ppc/kernel/ppc_ksyms.c	2004-02-09 10:39:51.000000000 +0000
@@ -75,6 +75,7 @@
 extern unsigned long mm_ptov (unsigned long paddr);
 
 EXPORT_SYMBOL(clear_page);
+EXPORT_SYMBOL(clear_user_page);
 EXPORT_SYMBOL(do_signal);
 EXPORT_SYMBOL(do_syscall_trace);
 EXPORT_SYMBOL(transfer_to_handler);
@@ -236,12 +237,6 @@
 EXPORT_SYMBOL(cuda_request);
 EXPORT_SYMBOL(cuda_poll);
 #endif /* CONFIG_ADB_CUDA */
-#ifdef CONFIG_PMAC_BACKLIGHT
-EXPORT_SYMBOL(get_backlight_level);
-EXPORT_SYMBOL(set_backlight_level);
-EXPORT_SYMBOL(set_backlight_enable);
-EXPORT_SYMBOL(register_backlight_controller);
-#endif /* CONFIG_PMAC_BACKLIGHT */
 #ifdef CONFIG_PPC_MULTIPLATFORM
 EXPORT_SYMBOL(_machine);
 #endif
@@ -282,14 +277,6 @@
 #ifdef CONFIG_VT
 EXPORT_SYMBOL(kd_mksound);
 #endif
-#ifdef CONFIG_NVRAM
-EXPORT_SYMBOL(nvram_read_byte);
-EXPORT_SYMBOL(nvram_write_byte);
-#ifdef CONFIG_PPC_PMAC
-EXPORT_SYMBOL(pmac_xpram_read);
-EXPORT_SYMBOL(pmac_xpram_write);
-#endif
-#endif /* CONFIG_NVRAM */
 EXPORT_SYMBOL(to_tm);
 
 EXPORT_SYMBOL(pm_power_off);
--- diff/arch/ppc/kernel/setup.c	2004-02-09 10:36:07.000000000 +0000
+++ source/arch/ppc/kernel/setup.c	2004-02-09 10:39:51.000000000 +0000
@@ -35,6 +35,7 @@
 #include <asm/system.h>
 #include <asm/pmac_feature.h>
 #include <asm/sections.h>
+#include <asm/nvram.h>
 #include <asm/xmon.h>
 
 #if defined CONFIG_KGDB
@@ -48,11 +49,6 @@
 extern void do_cpu_ftr_fixups(unsigned long offset);
 extern void reloc_got2(unsigned long offset);
 
-
-#ifdef CONFIG_KGDB
-extern void kgdb_map_scc(void);
-#endif
-
 extern void ppc6xx_idle(void);
 extern void power4_idle(void);
 
@@ -116,6 +112,9 @@
 
 void machine_restart(char *cmd)
 {
+#ifdef CONFIG_NVRAM
+	nvram_sync();
+#endif
 	ppc_md.restart(cmd);
 }
 
@@ -123,6 +122,9 @@
 
 void machine_power_off(void)
 {
+#ifdef CONFIG_NVRAM
+	nvram_sync();
+#endif
 	ppc_md.power_off();
 }
 
@@ -130,6 +132,9 @@
 
 void machine_halt(void)
 {
+#ifdef CONFIG_NVRAM
+	nvram_sync();
+#endif
 	ppc_md.halt();
 }
 
@@ -563,24 +568,30 @@
 __setup("l2cr=", ppc_setup_l2cr);
 
 #ifdef CONFIG_NVRAM
-/* Generic nvram hooks we now look into ppc_md.nvram_read_val
- * on pmac too ;)
- * //XX Those 2 could be moved to headers
- */
-unsigned char
-nvram_read_byte(int addr)
+
+/* Generic nvram hooks used by drivers/char/gen_nvram.c */
+unsigned char nvram_read_byte(int addr)
 {
 	if (ppc_md.nvram_read_val)
 		return ppc_md.nvram_read_val(addr);
 	return 0xff;
 }
+EXPORT_SYMBOL(nvram_read_byte);
 
-void
-nvram_write_byte(unsigned char val, int addr)
+void nvram_write_byte(unsigned char val, int addr)
 {
 	if (ppc_md.nvram_write_val)
-		ppc_md.nvram_write_val(val, addr);
+		ppc_md.nvram_write_val(addr, val);
 }
+EXPORT_SYMBOL(nvram_write_byte);
+
+void nvram_sync(void)
+{
+	if (ppc_md.nvram_sync)
+		ppc_md.nvram_sync();
+}
+EXPORT_SYMBOL(nvram_sync);
+
 #endif /* CONFIG_NVRAM */
 
 static struct cpu cpu_devices[NR_CPUS];
@@ -632,7 +643,8 @@
 	if ( ppc_md.progress ) ppc_md.progress("setup_arch: enter", 0x3eab);
 
 #if defined(CONFIG_KGDB)
-	kgdb_map_scc();
+	if (ppc_md.kgdb_map_scc)
+		ppc_md.kgdb_map_scc();
 	set_debug_traps();
 	if (strstr(cmd_line, "gdb")) {
 		if (ppc_md.progress)
--- diff/arch/ppc/kernel/smp.c	2003-10-09 09:47:33.000000000 +0100
+++ source/arch/ppc/kernel/smp.c	2004-02-09 10:39:51.000000000 +0000
@@ -61,10 +61,6 @@
 /* all cpu mappings are 1-1 -- Cort */
 volatile unsigned long cpu_callin_map[NR_CPUS];
 
-#define TB_SYNC_PASSES 4
-volatile unsigned long __initdata tb_sync_flag = 0;
-volatile unsigned long __initdata tb_offset = 0;
-
 int start_secondary(void *);
 extern int cpu_idle(void *unused);
 void smp_call_function_interrupt(void);
@@ -83,11 +79,14 @@
 #define PPC_MSG_INVALIDATE_TLB	2
 #define PPC_MSG_XMON_BREAK	3
 
-#define smp_message_pass(t,m,d,w) \
-    do { if (smp_ops) \
-	     atomic_inc(&ipi_sent); \
-	     smp_ops->message_pass((t),(m),(d),(w)); \
-       } while(0)
+static inline void
+smp_message_pass(int target, int msg, unsigned long data, int wait)
+{
+	if (smp_ops){
+		atomic_inc(&ipi_sent);
+		smp_ops->message_pass(target,msg,data,wait);
+	}
+}
 
 /*
  * Common functions
@@ -291,41 +290,6 @@
 		atomic_inc(&call_data->finished);
 }
 
-/* FIXME: Do this properly for all archs --RR */
-static spinlock_t timebase_lock = SPIN_LOCK_UNLOCKED;
-static unsigned int timebase_upper = 0, timebase_lower = 0;
-
-void __devinit
-smp_generic_give_timebase(void)
-{
-	spin_lock(&timebase_lock);
-	do {
-		timebase_upper = get_tbu();
-		timebase_lower = get_tbl();
-	} while (timebase_upper != get_tbu());
-	spin_unlock(&timebase_lock);
-
-	while (timebase_upper || timebase_lower)
-		rmb();
-}
-
-void __devinit
-smp_generic_take_timebase(void)
-{
-	int done = 0;
-
-	while (!done) {
-		spin_lock(&timebase_lock);
-		if (timebase_upper || timebase_lower) {
-			set_tb(timebase_upper, timebase_lower);
-			timebase_upper = 0;
-			timebase_lower = 0;
-			done = 1;
-		}
-		spin_unlock(&timebase_lock);
-	}
-}
-
 static void __devinit smp_store_cpu_info(int id)
 {
         struct cpuinfo_PPC *c = &cpu_data[id];
--- diff/arch/ppc/mm/hashtable.S	2003-10-27 09:20:37.000000000 +0000
+++ source/arch/ppc/mm/hashtable.S	2004-02-09 10:39:51.000000000 +0000
@@ -37,6 +37,32 @@
 #endif /* CONFIG_SMP */
 
 /*
+ * Sync CPUs with hash_page taking & releasing the hash
+ * table lock
+ */
+#ifdef CONFIG_SMP
+	.text
+_GLOBAL(hash_page_sync)
+	lis	r8,mmu_hash_lock@h
+	ori	r8,r8,mmu_hash_lock@l
+	lis	r0,0x0fff
+	b	10f
+11:	lwz	r6,0(r8)
+	cmpwi	0,r6,0
+	bne	11b
+10:	lwarx	r6,0,r8
+	cmpwi	0,r6,0
+	bne-	11b
+	stwcx.	r0,0,r8
+	bne-	10b
+	isync
+	eieio
+	li	r0,0
+	stw	r0,0(r8)
+	blr	
+#endif
+
+/*
  * Load a PTE into the hash table, if possible.
  * The address is in r4, and r3 contains an access flag:
  * _PAGE_RW (0x400) if a write.
@@ -417,21 +443,6 @@
 	lwz	r6,next_slot@l(r4)
 	addi	r6,r6,PTE_SIZE
 	andi.	r6,r6,7*PTE_SIZE
-#ifdef CONFIG_POWER4
-	/*
-	 * Since we don't have BATs on POWER4, we rely on always having
-	 * PTEs in the hash table to map the hash table and the code
-	 * that manipulates it in virtual mode, namely flush_hash_page and
-	 * flush_hash_segments.  Otherwise we can get a DSI inside those
-	 * routines which leads to a deadlock on the hash_table_lock on
-	 * SMP machines.  We avoid this by never overwriting the first
-	 * PTE of each PTEG if it is already valid.
-	 *	-- paulus.
-	 */
-	bne	102f
-	li	r6,PTE_SIZE
-102:
-#endif /* CONFIG_POWER4 */
 	stw	r6,next_slot@l(r4)
 	add	r4,r3,r6
 
--- diff/arch/ppc/mm/init.c	2003-10-09 09:47:33.000000000 +0100
+++ source/arch/ppc/mm/init.c	2004-02-09 10:39:51.000000000 +0000
@@ -291,6 +291,8 @@
 		ppc_md.progress("MMU:exit", 0x211);
 
 #ifdef CONFIG_BOOTX_TEXT
+	/* By default, we are no longer mapped */
+       	boot_text_mapped = 0;
 	/* Must be done last, or ppc_md.progress will die. */
 	map_boot_text();
 #endif
--- diff/arch/ppc/mm/pgtable.c	2003-10-09 09:47:33.000000000 +0100
+++ source/arch/ppc/mm/pgtable.c	2004-02-09 10:39:51.000000000 +0000
@@ -44,6 +44,10 @@
 
 extern char etext[], _stext[];
 
+#ifdef CONFIG_SMP
+extern void hash_page_sync(void);
+#endif
+
 #ifdef HAVE_BATS
 extern unsigned long v_mapped_by_bats(unsigned long va);
 extern unsigned long p_mapped_by_bats(unsigned long pa);
@@ -109,11 +113,17 @@
 
 void pte_free_kernel(pte_t *pte)
 {
+#ifdef CONFIG_SMP
+	hash_page_sync();
+#endif
 	free_page((unsigned long)pte);
 }
 
 void pte_free(struct page *pte)
 {
+#ifdef CONFIG_SMP
+	hash_page_sync();
+#endif
 	__free_page(pte);
 }
 
--- diff/arch/ppc/mm/ppc_mmu.c	2003-10-27 09:20:37.000000000 +0000
+++ source/arch/ppc/mm/ppc_mmu.c	2004-02-09 10:39:51.000000000 +0000
@@ -83,6 +83,9 @@
 
 unsigned long __init mmu_mapin_ram(void)
 {
+#ifdef CONFIG_POWER4
+	return 0;
+#else
 	unsigned long tot, bl, done;
 	unsigned long max_size = (256<<20);
 	unsigned long align;
@@ -119,6 +122,7 @@
 	}
 
 	return done;
+#endif
 }
 
 /*
@@ -244,9 +248,10 @@
 	Hash = mem_pieces_find(Hash_size, Hash_size);
 	cacheable_memzero(Hash, Hash_size);
 	_SDR1 = __pa(Hash) | SDR1_LOW_BITS;
-	Hash_end = (PTE *) ((unsigned long)Hash + Hash_size);
 #endif /* CONFIG_POWER4 */
 
+	Hash_end = (PTE *) ((unsigned long)Hash + Hash_size);
+
 	printk("Total memory = %ldMB; using %ldkB for hash table (at %p)\n",
 	       total_memory >> 20, Hash_size >> 10, Hash);
 
--- diff/arch/ppc/mm/tlb.c	2003-09-30 15:46:12.000000000 +0100
+++ source/arch/ppc/mm/tlb.c	2004-02-09 10:39:51.000000000 +0000
@@ -47,6 +47,26 @@
 }
 
 /*
+ * Called by ptep_test_and_clear_young()
+ */
+void flush_hash_one_pte(pte_t *ptep)
+{
+	struct page *ptepage;
+	struct mm_struct *mm;
+	unsigned long ptephys;
+	unsigned long addr;
+
+	if (Hash == 0)
+		return;
+	
+	ptepage = virt_to_page(ptep);
+	mm = (struct mm_struct *) ptepage->mapping;
+	ptephys = __pa(ptep) & PAGE_MASK;
+	addr = ptepage->index + (((unsigned long)ptep & ~PAGE_MASK) << 9);
+	flush_hash_pages(mm->context, addr, ptephys, 1);
+}
+
+/*
  * Called at the end of a mmu_gather operation to make sure the
  * TLB flush is completely done.
  */
--- diff/arch/ppc/platforms/Makefile	2003-07-11 09:39:50.000000000 +0100
+++ source/arch/ppc/platforms/Makefile	2004-02-09 10:39:51.000000000 +0000
@@ -17,7 +17,8 @@
 obj-$(CONFIG_PCI)		+= apus_pci.o
 endif
 obj-$(CONFIG_PPC_PMAC)		+= pmac_pic.o pmac_setup.o pmac_time.o \
-					pmac_feature.o pmac_pci.o pmac_sleep.o
+					pmac_feature.o pmac_pci.o pmac_sleep.o \
+					pmac_low_i2c.o
 obj-$(CONFIG_PPC_CHRP)		+= chrp_setup.o chrp_time.o chrp_pci.o
 obj-$(CONFIG_PPC_PREP)		+= prep_pci.o prep_time.o prep_setup.o
 ifeq ($(CONFIG_PPC_PMAC),y)
--- diff/arch/ppc/platforms/mcpn765_setup.c	2003-09-17 12:28:02.000000000 +0100
+++ source/arch/ppc/platforms/mcpn765_setup.c	2004-02-09 10:39:51.000000000 +0000
@@ -50,6 +50,7 @@
 #include <asm/pci-bridge.h>
 #include <asm/bootinfo.h>
 #include <asm/pplus.h>
+#include <asm/kgdb.h>
 
 #include "mcpn765.h"
 #include "mcpn765_serial.h"
@@ -78,9 +79,6 @@
 extern u_int openpic_irq(void);
 extern char cmd_line[];
 
-extern void gen550_progress(char *, unsigned short);
-extern void gen550_init(int, struct uart_port *);
-
 int use_of_interrupt_tree = 0;
 
 static void mcpn765_halt(void);
@@ -472,6 +470,9 @@
 #if defined(CONFIG_SERIAL_8250) && \
 	(defined(CONFIG_KGDB) || defined(CONFIG_SERIAL_TEXT_DEBUG))
 	mcpn765_early_serial_map();
+#ifdef CONFIG_KGDB
+	ppc_md.kgdb_map_scc = gen550_kgdb_map_scc;
+#endif
 #ifdef CONFIG_SERIAL_TEXT_DEBUG
 	ppc_md.progress = gen550_progress;
 #endif
--- diff/arch/ppc/platforms/pmac_backlight.c	2003-09-30 15:46:12.000000000 +0100
+++ source/arch/ppc/platforms/pmac_backlight.c	2004-02-09 10:39:51.000000000 +0000
@@ -8,6 +8,7 @@
 
 #include <linux/config.h>
 #include <linux/kernel.h>
+#include <linux/module.h>
 #include <linux/stddef.h>
 #include <linux/reboot.h>
 #include <linux/nvram.h>
@@ -37,6 +38,10 @@
 	char *prop;
 	int valid = 0;
 
+	/* There's already a matching controller, bail out */
+	if (backlighter != NULL)
+		return;
+
 	bk_node = find_devices("backlight");
 
 #ifdef CONFIG_ADB_PMU
@@ -84,6 +89,7 @@
 	printk(KERN_INFO "Registered \"%s\" backlight controller, level: %d/15\n",
 		type, backlight_level);
 }
+EXPORT_SYMBOL(register_backlight_controller);
 
 void __pmac
 unregister_backlight_controller(struct backlight_controller *ctrler, void *data)
@@ -92,6 +98,7 @@
 	if (ctrler == backlighter && data == backlighter_data)
 		backlighter = NULL;
 }
+EXPORT_SYMBOL(unregister_backlight_controller);
 
 int __pmac
 set_backlight_enable(int enable)
@@ -105,6 +112,7 @@
 		backlight_enabled = enable;
 	return rc;
 }
+EXPORT_SYMBOL(set_backlight_enable);
 
 int __pmac
 get_backlight_enable(void)
@@ -113,6 +121,7 @@
 		return -ENODEV;
 	return backlight_enabled;
 }
+EXPORT_SYMBOL(get_backlight_enable);
 
 int __pmac
 set_backlight_level(int level)
@@ -137,6 +146,7 @@
 	}
 	return rc;
 }
+EXPORT_SYMBOL(set_backlight_level);
 
 int __pmac
 get_backlight_level(void)
@@ -145,3 +155,4 @@
 		return -ENODEV;
 	return backlight_level;
 }
+EXPORT_SYMBOL(get_backlight_level);
--- diff/arch/ppc/platforms/pmac_cpufreq.c	2003-09-30 15:46:12.000000000 +0100
+++ source/arch/ppc/platforms/pmac_cpufreq.c	2004-02-09 10:39:51.000000000 +0000
@@ -22,6 +22,7 @@
 #include <linux/cpufreq.h>
 #include <linux/init.h>
 #include <linux/sysdev.h>
+#include <linux/i2c.h>
 #include <asm/prom.h>
 #include <asm/machdep.h>
 #include <asm/irq.h>
@@ -38,6 +39,14 @@
  */
 #undef DEBUG_FREQ
 
+/*
+ * There is a problem with the core cpufreq code on SMP kernels,
+ * it won't recalculate the Bogomips properly
+ */
+#ifdef CONFIG_SMP
+#warning "WARNING, CPUFREQ not recommended on SMP kernels"
+#endif
+
 extern void low_choose_750fx_pll(int pll);
 extern void low_sleep_handler(void);
 extern void openpic_suspend(struct sys_device *sysdev, u32 state);
@@ -48,7 +57,14 @@
 static unsigned int low_freq;
 static unsigned int hi_freq;
 static unsigned int cur_freq;
+
+/* Clean that up some day ... use a func ptr or at least an enum... */
 static int cpufreq_uses_pmu;
+static int cpufreq_uses_gpios;
+
+static u32 voltage_gpio;
+static u32 frequency_gpio;
+static u32 slew_done_gpio;
 
 #define PMAC_CPU_LOW_SPEED	1
 #define PMAC_CPU_HIGH_SPEED	0
@@ -65,8 +81,7 @@
 	{0,			CPUFREQ_TABLE_END},
 };
 
-static inline void
-wakeup_decrementer(void)
+static inline void wakeup_decrementer(void)
 {
 	set_dec(tb_ticks_per_jiffy);
 	/* No currently-supported powerbook has a 601,
@@ -76,8 +91,7 @@
 }
 
 #ifdef DEBUG_FREQ
-static inline void
-debug_calc_bogomips(void)
+static inline void debug_calc_bogomips(void)
 {
 	/* This will cause a recalc of bogomips and display the
 	 * result. We backup/restore the value to avoid affecting the
@@ -89,17 +103,18 @@
 	calibrate_delay();
 	loops_per_jiffy = save_lpj;
 }
-#endif
+#endif /* DEBUG_FREQ */
 
 /* Switch CPU speed under 750FX CPU control
  */
-static int __pmac
-cpu_750fx_cpu_speed(int low_speed)
+static int __pmac cpu_750fx_cpu_speed(int low_speed)
 {
 #ifdef DEBUG_FREQ
 	printk(KERN_DEBUG "HID1, before: %x\n", mfspr(SPRN_HID1));
 #endif
+#ifdef CONFIG_6xx
 	low_choose_750fx_pll(low_speed);
+#endif
 #ifdef DEBUG_FREQ
 	printk(KERN_DEBUG "HID1, after: %x\n", mfspr(SPRN_HID1));
 	debug_calc_bogomips();
@@ -108,15 +123,54 @@
 	return 0;
 }
 
+/* Switch CPU speed using slewing GPIOs
+ */
+static int __pmac gpios_set_cpu_speed(unsigned int low_speed)
+{
+	int gpio;
+
+	/* If ramping up, set voltage first */
+	if (low_speed == 0) {
+		pmac_call_feature(PMAC_FTR_WRITE_GPIO, NULL, voltage_gpio, 0x05);
+		/* Delay is way too big but it's ok, we schedule */
+		set_current_state(TASK_UNINTERRUPTIBLE);
+		schedule_timeout(HZ/100);
+	}
+
+	/* Set frequency */
+	pmac_call_feature(PMAC_FTR_WRITE_GPIO, NULL, frequency_gpio, low_speed ? 0x04 : 0x05);
+	udelay(200);
+	do {
+		set_current_state(TASK_UNINTERRUPTIBLE);
+		schedule_timeout(1);
+		gpio = pmac_call_feature(PMAC_FTR_READ_GPIO, NULL, slew_done_gpio, 0);
+	} while((gpio & 0x02) == 0);
+
+	/* If ramping down, set voltage last */
+	if (low_speed == 1) {
+		pmac_call_feature(PMAC_FTR_WRITE_GPIO, NULL, voltage_gpio, 0x04);
+		/* Delay is way too big but it's ok, we schedule */
+		set_current_state(TASK_UNINTERRUPTIBLE);
+		schedule_timeout(HZ/100);
+	}
+
+#ifdef DEBUG_FREQ
+	debug_calc_bogomips();
+#endif
+
+	return 0;
+}
+
 /* Switch CPU speed under PMU control
  */
-static int __pmac
-pmu_set_cpu_speed(unsigned int low_speed)
+static int __pmac pmu_set_cpu_speed(unsigned int low_speed)
 {
 	struct adb_request req;
 	unsigned long save_l2cr;
 	unsigned long save_l3cr;
 
+	preempt_disable();
+
 #ifdef DEBUG_FREQ
 	printk(KERN_DEBUG "HID1, before: %x\n", mfspr(SPRN_HID1));
 #endif
@@ -197,11 +251,12 @@
 	debug_calc_bogomips();
 #endif
 
+	preempt_enable();
+
 	return 0;
 }
 
-static int __pmac
-do_set_cpu_speed(int speed_mode)
+static int __pmac do_set_cpu_speed(int speed_mode)
 {
 	struct cpufreq_freqs freqs;
 	int rc;
@@ -216,6 +271,8 @@
 	cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
 	if (cpufreq_uses_pmu)
 		rc = pmu_set_cpu_speed(speed_mode);
+	else if (cpufreq_uses_gpios)
+		rc = gpios_set_cpu_speed(speed_mode);
 	else
 		rc = cpu_750fx_cpu_speed(speed_mode);
 	cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
@@ -224,16 +281,14 @@
 	return rc;
 }
 
-static int __pmac
-pmac_cpufreq_verify(struct cpufreq_policy *policy)
+static int __pmac pmac_cpufreq_verify(struct cpufreq_policy *policy)
 {
 	return cpufreq_frequency_table_verify(policy, pmac_cpu_freqs);
 }
 
-static int __pmac
-pmac_cpufreq_target(	struct cpufreq_policy *policy,
-			unsigned int target_freq,
-			unsigned int relation)
+static int __pmac pmac_cpufreq_target(	struct cpufreq_policy *policy,
+					unsigned int target_freq,
+					unsigned int relation)
 {
 	unsigned int    newstate = 0;
 
@@ -244,15 +299,13 @@
 	return do_set_cpu_speed(newstate);
 }
 
-unsigned int __pmac
-pmac_get_one_cpufreq(int i)
+unsigned int __pmac pmac_get_one_cpufreq(int i)
 {
 	/* Supports only one CPU for now */
 	return (i == 0) ? cur_freq : 0;
 }
 
-static int __pmac
-pmac_cpufreq_cpu_init(struct cpufreq_policy *policy)
+static int __pmac pmac_cpufreq_cpu_init(struct cpufreq_policy *policy)
 {
 	if (policy->cpu != 0)
 		return -ENODEV;
@@ -264,6 +317,18 @@
 	return cpufreq_frequency_table_cpuinfo(policy, &pmac_cpu_freqs[0]);
 }
 
+static u32 __pmac read_gpio(struct device_node *np)
+{
+	u32 *reg = (u32 *)get_property(np, "reg", NULL);
+
+	if (reg == NULL)
+		return 0;
+	/* That works for all keylargos but shall be fixed properly
+	 * some day...
+	 */
+	return 0x50 + (*reg);
+}
+
 static struct cpufreq_driver pmac_cpufreq_driver = {
 	.verify 	= pmac_cpufreq_verify,
 	.target 	= pmac_cpufreq_target,
@@ -272,15 +337,17 @@
 	.owner		= THIS_MODULE,
 };
 
+
 /* Currently, we support the following machines:
  *
+ *  - Titanium PowerBook 1Ghz (PMU based, 667Mhz & 1Ghz)
  *  - Titanium PowerBook 800 (PMU based, 667Mhz & 800Mhz)
  *  - Titanium PowerBook 500 (PMU based, 300Mhz & 500Mhz)
  *  - iBook2 500 (PMU based, 400Mhz & 500Mhz)
  *  - iBook2 700 (CPU based, 400Mhz & 700Mhz, support low voltage)
+ *  - Recent MacRISC3 machines
  */
-static int __init
-pmac_cpufreq_setup(void)
+static int __init pmac_cpufreq_setup(void)
 {
 	struct device_node	*cpunode;
 	u32			*value;
@@ -304,6 +371,74 @@
 	if (machine_is_compatible("PowerBook3,4") ||
 	    machine_is_compatible("PowerBook3,5") ||
 	    machine_is_compatible("MacRISC3")) {
+		struct device_node *volt_gpio_np = of_find_node_by_name(NULL, "voltage-gpio");
+		struct device_node *freq_gpio_np = of_find_node_by_name(NULL, "frequency-gpio");
+		struct device_node *slew_done_gpio_np = of_find_node_by_name(NULL, "slewing-done");
+
+		/*
+		 * Check to see if it's GPIO driven or PMU only
+		 *
+		 * The way we extract the GPIO address is slightly hackish, but it
+		 * works well enough for now. We need to abstract the whole GPIO
+		 * stuff sooner or later anyway
+		 */
+
+		if (volt_gpio_np)
+			voltage_gpio = read_gpio(volt_gpio_np);
+		if (freq_gpio_np)
+			frequency_gpio = read_gpio(freq_gpio_np);
+		if (slew_done_gpio_np)
+			slew_done_gpio = read_gpio(slew_done_gpio_np);
+
+		/* If we use the frequency GPIOs, calculate the min/max speeds based
+		 * on the bus frequencies
+		 */
+		if (frequency_gpio && slew_done_gpio) {
+			int lenp, rc;
+			u32 *freqs, *ratio;
+
+			freqs = (u32 *)get_property(cpunode, "bus-frequencies", &lenp);
+			lenp /= sizeof(u32);
+			if (freqs == NULL || lenp != 2) {
+				printk(KERN_ERR "cpufreq: bus-frequencies incorrect or missing\n");
+				goto out;
+			}
+			ratio = (u32 *)get_property(cpunode, "processor-to-bus-ratio*2", NULL);
+			if (ratio == NULL) {
+				printk(KERN_ERR "cpufreq: processor-to-bus-ratio*2 missing\n");
+				goto out;
+			}
+
+			/* Get the min/max bus frequencies */
+			low_freq = min(freqs[0], freqs[1]);
+			hi_freq = max(freqs[0], freqs[1]);
+
+			/* Grrrr.. It _seems_ that the device-tree is lying on the low bus
+			 * frequency, it claims it to be around 84Mhz on some models while
+			 * it appears to be approx. 101Mhz on all. Let's hack around here...
+			 * fortunately, we don't need to be too precise
+			 */
+			if (low_freq < 98000000)
+				low_freq = 101000000;
+			
+			/* Convert those to CPU core clocks */
+			low_freq = (low_freq * (*ratio)) / 2000;
+			hi_freq = (hi_freq * (*ratio)) / 2000;
+
+			/* Now we get the frequencies, we read the GPIO to see what is out current
+			 * speed
+			 */
+			rc = pmac_call_feature(PMAC_FTR_READ_GPIO, NULL, frequency_gpio, 0);
+			cur_freq = (rc & 0x01) ? hi_freq : low_freq;
+
+			has_freq_ctl = 1;
+			cpufreq_uses_gpios = 1;
+			goto out;
+		}
+
+		/* If we use the PMU, look for the min & max frequencies in the
+		 * device-tree
+		 */
 		value = (u32 *)get_property(cpunode, "min-clock-frequency", NULL);
 		if (!value)
 			goto out;
@@ -359,6 +494,11 @@
 	pmac_cpu_freqs[CPUFREQ_LOW].frequency = low_freq;
 	pmac_cpu_freqs[CPUFREQ_HIGH].frequency = hi_freq;
 
+	printk(KERN_INFO "Registering PowerMac CPU frequency driver\n");
+	printk(KERN_INFO "Low: %d Mhz, High: %d Mhz, Boot: %d Mhz, switch method: %s\n",
+	       low_freq/1000, hi_freq/1000, cur_freq/1000,
+	       cpufreq_uses_pmu ? "PMU" : (cpufreq_uses_gpios ? "GPIOs" : "CPU"));
+
 	return cpufreq_register_driver(&pmac_cpufreq_driver);
 }
 
--- diff/arch/ppc/platforms/pmac_feature.c	2003-09-30 15:46:12.000000000 +0100
+++ source/arch/ppc/platforms/pmac_feature.c	2004-02-09 10:39:51.000000000 +0000
@@ -41,6 +41,7 @@
 #include <asm/pmac_feature.h>
 #include <asm/dbdma.h>
 #include <asm/pci-bridge.h>
+#include <asm/pmac_low_i2c.h>
 
 #undef DEBUG_FEATURE
 
@@ -50,9 +51,13 @@
 #define DBG(fmt,...)
 #endif
 
-/* Exported from arch/ppc/kernel/idle.c */
+#ifdef CONFIG_6xx
 extern int powersave_lowspeed;
+#endif
+
 extern int powersave_nap;
+extern struct pci_dev *k2_skiplist[2];
+
 
 /*
  * We use a single global lock to protect accesses. Each driver has
@@ -95,7 +100,8 @@
 	"Paddington",
 	"Keylargo",
 	"Pangea",
-	"Intrepid"
+	"Intrepid",
+	"K2"
 };
 
 
@@ -113,14 +119,15 @@
 static struct device_node* uninorth_node __pmacdata;
 static u32* uninorth_base __pmacdata;
 static u32 uninorth_rev __pmacdata;
-
+static int uninorth_u3 __pmacdata;
+static void *u3_ht;
 
 /*
  * For each motherboard family, we have a table of functions pointers
  * that handle the various features.
  */
 
-typedef int (*feature_call)(struct device_node* node, int param, int value);
+typedef long (*feature_call)(struct device_node* node, long param, long value);
 
 struct feature_table_entry {
 	unsigned int	selector;
@@ -161,8 +168,10 @@
 	return 0;
 }
 
-static int __pmac
-ohare_htw_scc_enable(struct device_node* node, int param, int value)
+#ifndef CONFIG_POWER4
+
+static long __pmac
+ohare_htw_scc_enable(struct device_node* node, long param, long value)
 {
 	struct macio_chip*	macio;
 	unsigned long		chan_mask;
@@ -254,22 +263,22 @@
 	return 0;
 }
 
-static int __pmac
-ohare_floppy_enable(struct device_node* node, int param, int value)
+static long __pmac
+ohare_floppy_enable(struct device_node* node, long param, long value)
 {
 	return simple_feature_tweak(node, macio_ohare,
 		OHARE_FCR, OH_FLOPPY_ENABLE, value);
 }
 
-static int __pmac
-ohare_mesh_enable(struct device_node* node, int param, int value)
+static long __pmac
+ohare_mesh_enable(struct device_node* node, long param, long value)
 {
 	return simple_feature_tweak(node, macio_ohare,
 		OHARE_FCR, OH_MESH_ENABLE, value);
 }
 
-static int __pmac
-ohare_ide_enable(struct device_node* node, int param, int value)
+static long __pmac
+ohare_ide_enable(struct device_node* node, long param, long value)
 {
 	switch(param) {
 	    case 0:
@@ -289,8 +298,8 @@
 	}
 }
 
-static int __pmac
-ohare_ide_reset(struct device_node* node, int param, int value)
+static long __pmac
+ohare_ide_reset(struct device_node* node, long param, long value)
 {
 	switch(param) {
 	    case 0:
@@ -304,8 +313,8 @@
 	}
 }
 
-static int __pmac
-ohare_sleep_state(struct device_node* node, int param, int value)
+static long __pmac
+ohare_sleep_state(struct device_node* node, long param, long value)
 {
 	struct macio_chip*	macio = &macio_chips[0];
 
@@ -320,8 +329,8 @@
 	return 0;
 }
 
-static int __pmac
-heathrow_modem_enable(struct device_node* node, int param, int value)
+static long __pmac
+heathrow_modem_enable(struct device_node* node, long param, long value)
 {
 	struct macio_chip*	macio;
 	u8			gpio;
@@ -364,8 +373,8 @@
 	return 0;
 }
 
-static int __pmac
-heathrow_floppy_enable(struct device_node* node, int param, int value)
+static long __pmac
+heathrow_floppy_enable(struct device_node* node, long param, long value)
 {
 	return simple_feature_tweak(node, macio_unknown,
 		HEATHROW_FCR,
@@ -373,8 +382,8 @@
 		value);
 }
 
-static int __pmac
-heathrow_mesh_enable(struct device_node* node, int param, int value)
+static long __pmac
+heathrow_mesh_enable(struct device_node* node, long param, long value)
 {
 	struct macio_chip*	macio;
 	unsigned long		flags;
@@ -390,22 +399,11 @@
 		MACIO_BIC(HEATHROW_FCR, HRW_MESH_ENABLE);
 	(void)MACIO_IN32(HEATHROW_FCR);
 	udelay(10);
-	/* Set/Clear termination power (todo: test ! the bit value
-	 * used by Darwin doesn't seem to match what we used so
-	 * far. If you experience problems, turn #if 1 into #if 0
-	 * and tell me about it --BenH.
-	 */
-#if 1
+	/* Set/Clear termination power */
 	if (value)
-		MACIO_BIC(HEATHROW_MBCR, 0x00000004);
+		MACIO_BIC(HEATHROW_MBCR, 0x04000000);
 	else
-		MACIO_BIS(HEATHROW_MBCR, 0x00000004);
-#else
-	if (value)
-		MACIO_BIC(HEATHROW_MBCR, 0x00040000);
-	else
-		MACIO_BIS(HEATHROW_MBCR, 0x00040000);
-#endif
+		MACIO_BIS(HEATHROW_MBCR, 0x04000000);
 	(void)MACIO_IN32(HEATHROW_MBCR);
 	udelay(10);
 	UNLOCK(flags);
@@ -413,8 +411,8 @@
 	return 0;
 }
 
-static int __pmac
-heathrow_ide_enable(struct device_node* node, int param, int value)
+static long __pmac
+heathrow_ide_enable(struct device_node* node, long param, long value)
 {
 	switch(param) {
 	    case 0:
@@ -428,8 +426,8 @@
 	}
 }
 
-static int __pmac
-heathrow_ide_reset(struct device_node* node, int param, int value)
+static long __pmac
+heathrow_ide_reset(struct device_node* node, long param, long value)
 {
 	switch(param) {
 	    case 0:
@@ -443,8 +441,8 @@
 	}
 }
 
-static int __pmac
-heathrow_bmac_enable(struct device_node* node, int param, int value)
+static long __pmac
+heathrow_bmac_enable(struct device_node* node, long param, long value)
 {
 	struct macio_chip*	macio;
 	unsigned long		flags;
@@ -472,8 +470,8 @@
 	return 0;
 }
 
-static int __pmac
-heathrow_sound_enable(struct device_node* node, int param, int value)
+static long __pmac
+heathrow_sound_enable(struct device_node* node, long param, long value)
 {
 	struct macio_chip*	macio;
 	unsigned long		flags;
@@ -608,8 +606,8 @@
 	}
 }
 
-static int __pmac
-heathrow_sleep_state(struct device_node* node, int param, int value)
+static long __pmac
+heathrow_sleep_state(struct device_node* node, long param, long value)
 {
 	if ((pmac_mb.board_flags & PMAC_MB_CAN_SLEEP) == 0)
 		return -EPERM;
@@ -625,8 +623,8 @@
 	return 0;
 }
 
-static int __pmac
-core99_scc_enable(struct device_node* node, int param, int value)
+static long __pmac
+core99_scc_enable(struct device_node* node, long param, long value)
 {
 	struct macio_chip*	macio;
 	unsigned long		flags;
@@ -726,8 +724,8 @@
 	return 0;
 }
 
-static int __pmac
-core99_modem_enable(struct device_node* node, int param, int value)
+static long __pmac
+core99_modem_enable(struct device_node* node, long param, long value)
 {
 	struct macio_chip*	macio;
 	u8			gpio;
@@ -778,8 +776,8 @@
 	return 0;
 }
 
-static int __pmac
-pangea_modem_enable(struct device_node* node, int param, int value)
+static long __pmac
+pangea_modem_enable(struct device_node* node, long param, long value)
 {
 	struct macio_chip*	macio;
 	u8			gpio;
@@ -833,8 +831,8 @@
 	return 0;
 }
 
-static int __pmac
-core99_ata100_enable(struct device_node* node, int value)
+static long __pmac
+core99_ata100_enable(struct device_node* node, long value)
 {
 	unsigned long flags;
 	struct pci_dev *pdev = NULL;
@@ -863,8 +861,8 @@
     	return 0;
 }
 
-static int __pmac
-core99_ide_enable(struct device_node* node, int param, int value)
+static long __pmac
+core99_ide_enable(struct device_node* node, long param, long value)
 {
 	/* Bus ID 0 to 2 are KeyLargo based IDE, busID 3 is U2
 	 * based ata-100
@@ -886,8 +884,8 @@
 	}
 }
 
-static int __pmac
-core99_ide_reset(struct device_node* node, int param, int value)
+static long __pmac
+core99_ide_reset(struct device_node* node, long param, long value)
 {
 	switch(param) {
 	    case 0:
@@ -904,8 +902,8 @@
 	}
 }
 
-static int __pmac
-core99_gmac_enable(struct device_node* node, int param, int value)
+static long __pmac
+core99_gmac_enable(struct device_node* node, long param, long value)
 {
 	unsigned long flags;
 
@@ -921,8 +919,8 @@
 	return 0;
 }
 
-static int __pmac
-core99_gmac_phy_reset(struct device_node* node, int param, int value)
+static long __pmac
+core99_gmac_phy_reset(struct device_node* node, long param, long value)
 {
 	unsigned long flags;
 	struct macio_chip* macio;
@@ -938,16 +936,16 @@
 	UNLOCK(flags);
 	mdelay(10);
 	LOCK(flags);
-	MACIO_OUT8(KL_GPIO_ETH_PHY_RESET, KEYLARGO_GPIO_OUTPUT_ENABLE
-		| KEYLARGO_GPIO_OUTOUT_DATA);
+	MACIO_OUT8(KL_GPIO_ETH_PHY_RESET, /*KEYLARGO_GPIO_OUTPUT_ENABLE | */
+		KEYLARGO_GPIO_OUTOUT_DATA);
 	UNLOCK(flags);
 	mdelay(10);
 
 	return 0;
 }
 
-static int __pmac
-core99_sound_chip_enable(struct device_node* node, int param, int value)
+static long __pmac
+core99_sound_chip_enable(struct device_node* node, long param, long value)
 {
 	struct macio_chip*	macio;
 	unsigned long		flags;
@@ -976,8 +974,8 @@
 	return 0;
 }
 
-static int __pmac
-core99_airport_enable(struct device_node* node, int param, int value)
+static long __pmac
+core99_airport_enable(struct device_node* node, long param, long value)
 {
 	struct macio_chip*	macio;
 	unsigned long		flags;
@@ -1063,8 +1061,8 @@
 }
 
 #ifdef CONFIG_SMP
-static int __pmac
-core99_reset_cpu(struct device_node* node, int param, int value)
+static long __pmac
+core99_reset_cpu(struct device_node* node, long param, long value)
 {
 	unsigned int reset_io = 0;
 	unsigned long flags;
@@ -1099,7 +1097,7 @@
 	MACIO_OUT8(reset_io, KEYLARGO_GPIO_OUTPUT_ENABLE);
 	(void)MACIO_IN8(reset_io);
 	udelay(1);
-	MACIO_OUT8(reset_io, KEYLARGO_GPIO_OUTOUT_DATA | KEYLARGO_GPIO_OUTPUT_ENABLE);
+	MACIO_OUT8(reset_io, 0);
 	(void)MACIO_IN8(reset_io);
 	UNLOCK(flags);
 
@@ -1107,8 +1105,8 @@
 }
 #endif /* CONFIG_SMP */
 
-static int __pmac
-core99_usb_enable(struct device_node* node, int param, int value)
+static long __pmac
+core99_usb_enable(struct device_node* node, long param, long value)
 {
 	struct macio_chip* macio;
 	unsigned long flags;
@@ -1121,9 +1119,6 @@
 	    macio->type != macio_intrepid)
 		return -ENODEV;
 
-	/* XXX Fix handling of 3rd USB controller in Intrepid, move the
-	 * port connect stuff (KL4_*) to the sleep code eventually
-	 */
 	prop = (char *)get_property(node, "AAPL,clock-id", NULL);
 	if (!prop)
 		return -ENODEV;
@@ -1131,6 +1126,8 @@
 		number = 0;
 	else if (strncmp(prop, "usb1u148", 8) == 0)
 		number = 2;
+	else if (strncmp(prop, "usb2u248", 8) == 0)
+		number = 4;
 	else
 		return -ENODEV;
 
@@ -1147,44 +1144,79 @@
 			mdelay(1);
 			LOCK(flags);
 			MACIO_BIS(KEYLARGO_FCR0, KL0_USB0_CELL_ENABLE);
-		} else {
+		} else if (number == 2) {
 			MACIO_BIC(KEYLARGO_FCR0, (KL0_USB1_PAD_SUSPEND0 | KL0_USB1_PAD_SUSPEND1));
 			UNLOCK(flags);
 			(void)MACIO_IN32(KEYLARGO_FCR0);
 			mdelay(1);
 			LOCK(flags);
 			MACIO_BIS(KEYLARGO_FCR0, KL0_USB1_CELL_ENABLE);
+		} else if (number == 4) {
+			MACIO_BIC(KEYLARGO_FCR1, (KL1_USB2_PAD_SUSPEND0 | KL1_USB2_PAD_SUSPEND1));
+			UNLOCK(flags);
+			(void)MACIO_IN32(KEYLARGO_FCR1);
+			mdelay(1);
+			LOCK(flags);
+			MACIO_BIS(KEYLARGO_FCR0, KL1_USB2_CELL_ENABLE);
+		}
+		if (number < 4) {
+			reg = MACIO_IN32(KEYLARGO_FCR4);
+			reg &=	~(KL4_PORT_WAKEUP_ENABLE(number) | KL4_PORT_RESUME_WAKE_EN(number) |
+				KL4_PORT_CONNECT_WAKE_EN(number) | KL4_PORT_DISCONNECT_WAKE_EN(number));
+			reg &=	~(KL4_PORT_WAKEUP_ENABLE(number+1) | KL4_PORT_RESUME_WAKE_EN(number+1) |
+				KL4_PORT_CONNECT_WAKE_EN(number+1) | KL4_PORT_DISCONNECT_WAKE_EN(number+1));
+			MACIO_OUT32(KEYLARGO_FCR4, reg);
+			(void)MACIO_IN32(KEYLARGO_FCR4);
+			udelay(10);
+		} else {
+			reg = MACIO_IN32(KEYLARGO_FCR3);
+			reg &=	~(KL3_IT_PORT_WAKEUP_ENABLE(0) | KL3_IT_PORT_RESUME_WAKE_EN(0) |
+				KL3_IT_PORT_CONNECT_WAKE_EN(0) | KL3_IT_PORT_DISCONNECT_WAKE_EN(0));
+			reg &=	~(KL3_IT_PORT_WAKEUP_ENABLE(1) | KL3_IT_PORT_RESUME_WAKE_EN(1) |
+				KL3_IT_PORT_CONNECT_WAKE_EN(1) | KL3_IT_PORT_DISCONNECT_WAKE_EN(1));
+			MACIO_OUT32(KEYLARGO_FCR3, reg);
+			(void)MACIO_IN32(KEYLARGO_FCR3);
+			udelay(10);
 		}
-		reg = MACIO_IN32(KEYLARGO_FCR4);
-		reg &=	~(KL4_PORT_WAKEUP_ENABLE(number) | KL4_PORT_RESUME_WAKE_EN(number) |
-			KL4_PORT_CONNECT_WAKE_EN(number) | KL4_PORT_DISCONNECT_WAKE_EN(number));
-		reg &=	~(KL4_PORT_WAKEUP_ENABLE(number+1) | KL4_PORT_RESUME_WAKE_EN(number+1) |
-			KL4_PORT_CONNECT_WAKE_EN(number+1) | KL4_PORT_DISCONNECT_WAKE_EN(number+1));
-		MACIO_OUT32(KEYLARGO_FCR4, reg);
-		(void)MACIO_IN32(KEYLARGO_FCR4);
-		udelay(10);
 	} else {
 		/* Turn OFF */
-		reg = MACIO_IN32(KEYLARGO_FCR4);
-		reg |=	KL4_PORT_WAKEUP_ENABLE(number) | KL4_PORT_RESUME_WAKE_EN(number) |
-			KL4_PORT_CONNECT_WAKE_EN(number) | KL4_PORT_DISCONNECT_WAKE_EN(number);
-		reg |=	KL4_PORT_WAKEUP_ENABLE(number+1) | KL4_PORT_RESUME_WAKE_EN(number+1) |
-			KL4_PORT_CONNECT_WAKE_EN(number+1) | KL4_PORT_DISCONNECT_WAKE_EN(number+1);
-		MACIO_OUT32(KEYLARGO_FCR4, reg);
-		(void)MACIO_IN32(KEYLARGO_FCR4);
-		udelay(1);
+		if (number < 4) {
+			reg = MACIO_IN32(KEYLARGO_FCR4);
+			reg |=	KL4_PORT_WAKEUP_ENABLE(number) | KL4_PORT_RESUME_WAKE_EN(number) |
+				KL4_PORT_CONNECT_WAKE_EN(number) | KL4_PORT_DISCONNECT_WAKE_EN(number);
+			reg |=	KL4_PORT_WAKEUP_ENABLE(number+1) | KL4_PORT_RESUME_WAKE_EN(number+1) |
+				KL4_PORT_CONNECT_WAKE_EN(number+1) | KL4_PORT_DISCONNECT_WAKE_EN(number+1);
+			MACIO_OUT32(KEYLARGO_FCR4, reg);
+			(void)MACIO_IN32(KEYLARGO_FCR4);
+			udelay(1);
+		} else {
+			reg = MACIO_IN32(KEYLARGO_FCR3);
+			reg |=	KL3_IT_PORT_WAKEUP_ENABLE(0) | KL3_IT_PORT_RESUME_WAKE_EN(0) |
+				KL3_IT_PORT_CONNECT_WAKE_EN(0) | KL3_IT_PORT_DISCONNECT_WAKE_EN(0);
+			reg |=	KL3_IT_PORT_WAKEUP_ENABLE(1) | KL3_IT_PORT_RESUME_WAKE_EN(1) |
+				KL3_IT_PORT_CONNECT_WAKE_EN(1) | KL3_IT_PORT_DISCONNECT_WAKE_EN(1);
+			MACIO_OUT32(KEYLARGO_FCR3, reg);
+			(void)MACIO_IN32(KEYLARGO_FCR3);
+			udelay(1);
+		}
 		if (number == 0) {
 			MACIO_BIC(KEYLARGO_FCR0, KL0_USB0_CELL_ENABLE);
 			(void)MACIO_IN32(KEYLARGO_FCR0);
 			udelay(1);
 			MACIO_BIS(KEYLARGO_FCR0, (KL0_USB0_PAD_SUSPEND0 | KL0_USB0_PAD_SUSPEND1));
 			(void)MACIO_IN32(KEYLARGO_FCR0);
-		} else {
+		} else if (number == 2) {
 			MACIO_BIC(KEYLARGO_FCR0, KL0_USB1_CELL_ENABLE);
 			(void)MACIO_IN32(KEYLARGO_FCR0);
 			udelay(1);
 			MACIO_BIS(KEYLARGO_FCR0, (KL0_USB1_PAD_SUSPEND0 | KL0_USB1_PAD_SUSPEND1));
 			(void)MACIO_IN32(KEYLARGO_FCR0);
+		} else if (number == 4) {
+			MACIO_BIC(KEYLARGO_FCR1, KL1_USB2_CELL_ENABLE);
+			(void)MACIO_IN32(KEYLARGO_FCR1);
+			udelay(1);
+			MACIO_BIS(KEYLARGO_FCR1, (KL1_USB2_PAD_SUSPEND0 | KL1_USB2_PAD_SUSPEND1));
+			(void)MACIO_IN32(KEYLARGO_FCR1);
 		}
 		udelay(1);
 	}
@@ -1193,8 +1225,8 @@
 	return 0;
 }
 
-static int __pmac
-core99_firewire_enable(struct device_node* node, int param, int value)
+static long __pmac
+core99_firewire_enable(struct device_node* node, long param, long value)
 {
 	unsigned long flags;
 	struct macio_chip* macio;
@@ -1220,8 +1252,8 @@
 	return 0;
 }
 
-static int __pmac
-core99_firewire_cable_power(struct device_node* node, int param, int value)
+static long __pmac
+core99_firewire_cable_power(struct device_node* node, long param, long value)
 {
 	unsigned long flags;
 	struct macio_chip* macio;
@@ -1251,8 +1283,10 @@
 	return 0;
 }
 
-static int __pmac
-core99_read_gpio(struct device_node* node, int param, int value)
+#endif /* CONFIG_POWER4 */
+
+static long __pmac
+core99_read_gpio(struct device_node* node, long param, long value)
 {
 	struct macio_chip* macio = &macio_chips[0];
 
@@ -1260,8 +1294,8 @@
 }
 
 
-static int __pmac
-core99_write_gpio(struct device_node* node, int param, int value)
+static long __pmac
+core99_write_gpio(struct device_node* node, long param, long value)
 {
 	struct macio_chip* macio = &macio_chips[0];
 
@@ -1269,6 +1303,145 @@
 	return 0;
 }
 
+#ifdef CONFIG_POWER4
+
+static long __pmac
+g5_gmac_enable(struct device_node* node, long param, long value)
+{
+	struct macio_chip* macio = &macio_chips[0];
+	unsigned long flags;
+	struct pci_dev *pdev;
+	u8 pbus, pid;
+
+	/* XXX FIXME: We should fix pci_device_from_OF_node here, and
+	 * get to a real pci_dev or we'll get into trouble with PCI
+	 * domains the day we get overlapping numbers (like if we ever
+	 * decide to show the HT root
+	 */
+	if (pci_device_from_OF_node(node, &pbus, &pid) == 0)
+		pdev = pci_find_slot(pbus, pid);
+
+	LOCK(flags);
+	if (value) {
+		MACIO_BIS(KEYLARGO_FCR1, K2_FCR1_GMAC_CLK_ENABLE);
+		mb();
+		k2_skiplist[0] = NULL;
+	} else {
+		k2_skiplist[0] = pdev;
+		mb();
+		MACIO_BIC(KEYLARGO_FCR1, K2_FCR1_GMAC_CLK_ENABLE);
+	}
+	
+	UNLOCK(flags);
+	mdelay(1);
+
+	return 0;
+}
+
+static long __pmac
+g5_fw_enable(struct device_node* node, long param, long value)
+{
+	struct macio_chip* macio = &macio_chips[0];
+	unsigned long flags;
+	struct pci_dev *pdev;
+	u8 pbus, pid;
+
+	/* XXX FIXME: We should fix pci_device_from_OF_node here, and
+	 * get to a real pci_dev or we'll get into trouble with PCI
+	 * domains the day we get overlapping numbers (like if we ever
+	 * decide to show the HT root
+	 */
+	if (pci_device_from_OF_node(node, &pbus, &pid) == 0)
+		pdev = pci_find_slot(pbus, pid);
+
+	LOCK(flags);
+	if (value) {
+		MACIO_BIS(KEYLARGO_FCR1, K2_FCR1_FW_CLK_ENABLE);
+		mb();
+		k2_skiplist[1] = NULL;
+	} else {
+		k2_skiplist[0] = pdev;
+		mb();
+		MACIO_BIC(KEYLARGO_FCR1, K2_FCR1_FW_CLK_ENABLE);
+	}
+	
+	UNLOCK(flags);
+	mdelay(1);
+
+	return 0;
+}
+
+static long __pmac
+g5_mpic_enable(struct device_node* node, long param, long value)
+{
+	unsigned long flags;
+
+	if (node->parent == NULL || strcmp(node->parent->name, "u3"))
+		return 0;
+
+	LOCK(flags);
+	UN_BIS(U3_TOGGLE_REG, U3_MPIC_RESET | U3_MPIC_OUTPUT_ENABLE);
+	UNLOCK(flags);
+
+	return 0;
+}
+
+#ifdef CONFIG_SMP
+static long __pmac
+g5_reset_cpu(struct device_node* node, long param, long value)
+{
+	unsigned int reset_io = 0;
+	unsigned long flags;
+	struct macio_chip* macio;
+	struct device_node* np;
+
+	macio = &macio_chips[0];
+	if (macio->type != macio_keylargo2)
+		return -ENODEV;
+
+	np = find_path_device("/cpus");
+	if (np == NULL)
+		return -ENODEV;
+	for (np = np->child; np != NULL; np = np->sibling) {
+		u32* num = (u32 *)get_property(np, "reg", NULL);
+		u32* rst = (u32 *)get_property(np, "soft-reset", NULL);
+		if (num == NULL || rst == NULL)
+			continue;
+		if (param == *num) {
+			reset_io = *rst;
+			break;
+		}
+	}
+	if (np == NULL || reset_io == 0)
+		return -ENODEV;
+
+	LOCK(flags);
+	MACIO_OUT8(reset_io, KEYLARGO_GPIO_OUTPUT_ENABLE);
+	(void)MACIO_IN8(reset_io);
+	udelay(1);
+	MACIO_OUT8(reset_io, 0);
+	(void)MACIO_IN8(reset_io);
+	UNLOCK(flags);
+
+	return 0;
+}
+#endif /* CONFIG_SMP */
+
+/*
+ * This can be called from pmac_smp so isn't static
+ *
+ * This takes the second CPU off the bus on dual CPU machines
+ * running UP
+ */
+void __pmac g5_phy_disable_cpu1(void)
+{
+	UN_OUT(U3_API_PHY_CONFIG_1, 0);
+}
+
+#endif /* CONFIG_POWER4 */
+
+#ifndef CONFIG_POWER4
+
 static void __pmac
 keylargo_shutdown(struct macio_chip* macio, int sleep_mode)
 {
@@ -1541,8 +1714,8 @@
 	return 0;
 }
 
-static int __pmac
-core99_sleep_state(struct device_node* node, int param, int value)
+static long __pmac
+core99_sleep_state(struct device_node* node, long param, long value)
 {
 	/* Param == 1 means to enter the "fake sleep" mode that is
 	 * used for CPU speed switch
@@ -1568,8 +1741,10 @@
 	return 0;
 }
 
-static int __pmac
-generic_get_mb_info(struct device_node* node, int param, int value)
+#endif /* CONFIG_POWER4 */
+
+static long __pmac
+generic_get_mb_info(struct device_node* node, long param, long value)
 {
 	switch(param) {
 		case PMAC_MB_INFO_MODEL:
@@ -1579,9 +1754,9 @@
 		case PMAC_MB_INFO_NAME:
 			/* hack hack hack... but should work */
 			*((const char **)value) = pmac_mb.model_name;
-			break;
+			return 0;
 	}
-	return 0;
+	return -EINVAL;
 }
 
 
@@ -1596,6 +1771,8 @@
 	{ 0, NULL }
 };
 
+#ifndef CONFIG_POWER4
+
 /* OHare based motherboards. Currently, we only use these on the
  * 2400,3400 and 3500 series powerbooks. Some older desktops seem
  * to have issues with turning on/off those asic cells
@@ -1741,10 +1918,29 @@
 	{ 0, NULL }
 };
 
+#else /* CONFIG_POWER4 */
+
+/* G5 features
+ */
+static struct feature_table_entry g5_features[]  __pmacdata = {
+	{ PMAC_FTR_GMAC_ENABLE,		g5_gmac_enable },
+	{ PMAC_FTR_1394_ENABLE,		g5_fw_enable },
+	{ PMAC_FTR_ENABLE_MPIC,		g5_mpic_enable },
+#ifdef CONFIG_SMP
+	{ PMAC_FTR_RESET_CPU,		g5_reset_cpu },
+#endif /* CONFIG_SMP */
+	{ PMAC_FTR_READ_GPIO,		core99_read_gpio },
+	{ PMAC_FTR_WRITE_GPIO,		core99_write_gpio },
+	{ 0, NULL }
+};
+
+#endif /* CONFIG_POWER4 */
+
 static struct pmac_mb_def pmac_mb_defs[] __pmacdata = {
 	/* Warning: ordering is important as some models may claim
 	 * beeing compatible with several types
 	 */
+#ifndef CONFIG_POWER4
 	{	"AAPL,8500",			"PowerMac 8500/8600",
 		PMAC_TYPE_PSURGE,		NULL,
 		0
@@ -1753,6 +1949,14 @@
 		PMAC_TYPE_PSURGE,		NULL,
 		0
 	},
+	{	"AAPL,7200",			"PowerMac 7200",
+		PMAC_TYPE_PSURGE,		NULL,
+		0
+	},
+	{	"AAPL,7300",			"PowerMac 7200/7300",
+		PMAC_TYPE_PSURGE,		NULL,
+		0
+	},
 	{	"AAPL,7500",			"PowerMac 7500",
 		PMAC_TYPE_PSURGE,		NULL,
 		0
@@ -1905,20 +2109,43 @@
 		PMAC_TYPE_UNKNOWN_INTREPID,	intrepid_features,
 		PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE,
 	},
+	{	"PowerBook5,2",			"PowerBook G4 15\"",
+		PMAC_TYPE_UNKNOWN_INTREPID,	intrepid_features,
+		PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE,
+	},
+	{	"PowerBook5,3",			"PowerBook G4 17\"",
+		PMAC_TYPE_UNKNOWN_INTREPID,	intrepid_features,
+		PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE,
+	},
 	{	"PowerBook6,1",			"PowerBook G4 12\"",
 		PMAC_TYPE_UNKNOWN_INTREPID,	intrepid_features,
 		PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE,
 	},
+	{	"PowerBook6,2",			"PowerBook G4",
+		PMAC_TYPE_UNKNOWN_INTREPID,	intrepid_features,
+		PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE,
+	},
+	{	"PowerBook6,3",			"iBook G4",
+		PMAC_TYPE_UNKNOWN_INTREPID,	intrepid_features,
+		PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE,
+	},
+#else /* CONFIG_POWER4 */
+	{	"PowerMac7,2",			"PowerMac G5",
+		PMAC_TYPE_POWERMAC_G5,		g5_features,
+		0,
+	},
+#endif /* CONFIG_POWER4 */
 };
 
 /*
  * The toplevel feature_call callback
  */
-int __pmac
+long __pmac
 pmac_do_feature_call(unsigned int selector, ...)
 {
 	struct device_node* node;
-	int param, value, i;
+	long param, value;
+	int i;
 	feature_call func = NULL;
 	va_list args;
 
@@ -1939,8 +2166,8 @@
 
 	va_start(args, selector);
 	node = (struct device_node*)va_arg(args, void*);
-	param = va_arg(args, int);
-	value = va_arg(args, int);
+	param = va_arg(args, long);
+	value = va_arg(args, long);
 	va_end(args);
 
 	return func(node, param, value);
@@ -1976,6 +2203,7 @@
 
 	/* Fallback to selection depending on mac-io chip type */
 	switch(macio->type) {
+#ifndef CONFIG_POWER4
 	    case macio_grand_central:
 		pmac_mb.model_id = PMAC_TYPE_PSURGE;
 		pmac_mb.model_name = "Unknown PowerSurge";
@@ -2009,10 +2237,18 @@
 		pmac_mb.model_name = "Unknown Intrepid-based";
 	    	pmac_mb.features = intrepid_features;
 	    	break;
+#else /* CONFIG_POWER4 */
+	    case macio_keylargo2:
+		pmac_mb.model_id = PMAC_TYPE_POWERMAC_G5;
+		pmac_mb.model_name = "Unknown G5";
+	    	pmac_mb.features = g5_features;
+	    	break;
+#endif /* CONFIG_POWER4 */
 	    default:
 	    	return -ENODEV;
 	}
 found:
+#ifndef CONFIG_POWER4
 	/* Fixup Hooper vs. Comet */
 	if (pmac_mb.model_id == PMAC_TYPE_HOOPER) {
 		u32* mach_id_ptr = (u32*)ioremap(0xf3000034, 4);
@@ -2026,6 +2262,7 @@
 			pmac_mb.model_id = PMAC_TYPE_COMET;
 		iounmap(mach_id_ptr);
 	}
+#endif /* CONFIG_POWER4 */
 
 #ifdef CONFIG_6xx
 	/* Set default value of powersave_nap on machines that support it.
@@ -2057,7 +2294,9 @@
 	 */
 	powersave_lowspeed = 1;
 #endif /* CONFIG_6xx */
-
+#ifdef CONFIG_POWER4
+	powersave_nap = 1;
+#endif
 	/* Check for "mobile" machine */
 	if (model && (strncmp(model, "PowerBook", 9) == 0
 		   || strncmp(model, "iBook", 5) == 0))
@@ -2076,18 +2315,26 @@
 	unsigned long actrl;
 
 	/* Locate core99 Uni-N */
-	uninorth_node = find_devices("uni-n");
+	uninorth_node = of_find_node_by_name(NULL, "uni-n");
+	/* Locate G5 u3 */
+	if (uninorth_node == NULL) {
+		uninorth_node = of_find_node_by_name(NULL, "u3");
+		uninorth_u3 = 1;
+	}
 	if (uninorth_node && uninorth_node->n_addrs > 0) {
-		uninorth_base = ioremap(uninorth_node->addrs[0].address, 0x4000);
+		unsigned long address = uninorth_node->addrs[0].address;
+		uninorth_base = ioremap(address, 0x40000);
 		uninorth_rev = in_be32(UN_REG(UNI_N_VERSION));
+		if (uninorth_u3)
+			u3_ht = ioremap(address + U3_HT_CONFIG_BASE, 0x1000);
 	} else
 		uninorth_node = NULL;
 
 	if (!uninorth_node)
 		return;
 
-	printk(KERN_INFO "Found Uninorth memory controller & host bridge, revision: %d\n",
-			uninorth_rev);
+	printk(KERN_INFO "Found %s memory controller & host bridge, revision: %d\n",
+	       uninorth_u3 ? "U3" : "UniNorth", uninorth_rev);
 	printk(KERN_INFO "Mapped at 0x%08lx\n", (unsigned long)uninorth_base);
 
 	/* Set the arbitrer QAck delay according to what Apple does
@@ -2172,6 +2419,7 @@
 	probe_one_macio("mac-io", "paddington", macio_paddington);
 	probe_one_macio("mac-io", "gatwick", macio_gatwick);
 	probe_one_macio("mac-io", "heathrow", macio_heathrow);
+	probe_one_macio("mac-io", "K2-Keylargo", macio_keylargo2);
 
 	/* Make sure the "main" macio chip appear first */
 	if (macio_chips[0].type == macio_gatwick
@@ -2244,19 +2492,60 @@
 		MACIO_BIS(OHARE_FCR, OH_IOBUS_ENABLE);
 	}
 
+#ifdef CONFIG_POWER4
+	if (macio_chips[0].type == macio_keylargo2) {
+#ifndef CONFIG_SMP
+		/* On SMP machines running UP, we have the second CPU eating
+		 * bus cycles. We need to take it off the bus. This is done
+		 * from pmac_smp for SMP kernels running on one CPU
+		 */
+		np = of_find_node_by_type(NULL, "cpu");
+		if (np != NULL)
+			np = of_find_node_by_type(np, "cpu");
+		if (np != NULL) {
+			g5_phy_disable_cpu1();
+			of_node_put(np);
+		}
+#endif /* CONFIG_SMP */
+		/* Enable GMAC for now for PCI probing. It will be disabled
+		 * later on after PCI probe
+		 */
+		np = of_find_node_by_name(NULL, "ethernet");
+		while(np) {
+			if (device_is_compatible(np, "K2-GMAC"))
+				g5_gmac_enable(np, 0, 1);
+			np = of_find_node_by_name(np, "ethernet");
+		}
+
+		/* Enable FW before PCI probe. Will be disabled later on
+		 * Note: We should have a batter way to check that we are
+		 * dealing with uninorth internal cell and not a PCI cell
+		 * on the external PCI. The code below works though.
+		 */
+		np = of_find_node_by_name(NULL, "firewire");
+		while(np) {
+			if (device_is_compatible(np, "pci106b,5811")) {
+				macio_chips[0].flags |= MACIO_FLAG_FW_SUPPORTED;
+				g5_fw_enable(np, 0, 1);
+			}
+			np = of_find_node_by_name(np, "firewire");
+		}
+	}
+#else /* CONFIG_POWER4 */
+
 	if (macio_chips[0].type == macio_keylargo ||
 	    macio_chips[0].type == macio_pangea ||
 	    macio_chips[0].type == macio_intrepid) {
 		/* Enable GMAC for now for PCI probing. It will be disabled
 		 * later on after PCI probe
 		 */
-		np = find_devices("ethernet");
+		np = of_find_node_by_name(NULL, "ethernet");
 		while(np) {
 			if (np->parent
 			    && device_is_compatible(np->parent, "uni-north")
 			    && device_is_compatible(np, "gmac"))
 				core99_gmac_enable(np, 0, 1);
-			np = np->next;
+			np = of_find_node_by_name(np, "ethernet");
 		}
 
 		/* Enable FW before PCI probe. Will be disabled later on
@@ -2264,7 +2553,7 @@
 		 * dealing with uninorth internal cell and not a PCI cell
 		 * on the external PCI. The code below works though.
 		 */
-		np = find_devices("firewire");
+		np = of_find_node_by_name(NULL, "firewire");
 		while(np) {
 			if (np->parent
 			    && device_is_compatible(np->parent, "uni-north")
@@ -2274,18 +2563,18 @@
 				macio_chips[0].flags |= MACIO_FLAG_FW_SUPPORTED;
 				core99_firewire_enable(np, 0, 1);
 			}
-			np = np->next;
+			np = of_find_node_by_name(np, "firewire");
 		}
 
 		/* Enable ATA-100 before PCI probe. */
-		np = find_devices("ata-6");
+		np = of_find_node_by_name(NULL, "ata-6");
 		while(np) {
 			if (np->parent
 			    && device_is_compatible(np->parent, "uni-north")
 			    && device_is_compatible(np, "kauai-ata")) {
 				core99_ata100_enable(np, 1);
 			}
-			np = np->next;
+			np = of_find_node_by_name(np, "ata-6");
 		}
 
 		/* Switch airport off */
@@ -2313,6 +2602,99 @@
 		MACIO_BIC(HEATHROW_FCR, HRW_SOUND_POWER_N);
 	}
 
+	/* Hack for bumping clock speed on the new PowerBooks and the
+	 * iBook G4. This implements the "platform-do-clockspreading" OF
+	 * property. For safety, we also check the product ID in the
+	 * device-tree to make reasonably sure we won't set wrong values
+	 * in the clock chip.
+	 *
+	 * Of course, ultimately, we have to implement a real parser for
+	 * the platform-do-* stuff...
+	 */
+	while (machine_is_compatible("PowerBook5,2") ||
+	       machine_is_compatible("PowerBook5,3") ||
+	       machine_is_compatible("PowerBook6,2") ||
+	       machine_is_compatible("PowerBook6,3")) {
+		struct device_node *ui2c = of_find_node_by_type(NULL, "i2c");
+		struct device_node *dt = of_find_node_by_name(NULL, "device-tree");
+		u8 buffer[9];
+		u32 *productID;
+		int i, rc, changed = 0;
+		
+		if (dt == NULL)
+			break;
+		productID = (u32 *)get_property(dt, "pid#", NULL);
+		if (productID == NULL)
+			break;
+		while(ui2c) {
+			struct device_node *p = of_get_parent(ui2c);
+			if (p && !strcmp(p->name, "uni-n"))
+				break;
+			ui2c = of_find_node_by_type(np, "i2c");
+		}
+		if (ui2c == NULL)
+			break;
+		DBG("Trying to bump clock speed for PID: %08x...\n", *productID);
+		rc = pmac_low_i2c_open(ui2c, 1);
+		if (rc != 0)
+			break;
+		pmac_low_i2c_setmode(ui2c, pmac_low_i2c_mode_combined);
+		rc = pmac_low_i2c_xfer(ui2c, 0xd2 | pmac_low_i2c_read, 0x80, buffer, 9);
+		DBG("read result: %d,", rc);
+		if (rc != 0) {
+			pmac_low_i2c_close(ui2c);
+			break;
+		}
+		for (i=0; i<9; i++)
+			DBG(" %02x", buffer[i]);
+		DBG("\n");
+		
+		switch(*productID) {
+		case 0x1182:	/* AlBook 12" rev 2 */
+		case 0x1183:	/* iBook G4 12" */
+			buffer[0] = (buffer[0] & 0x8f) | 0x70;
+			buffer[2] = (buffer[2] & 0x7f) | 0x00;
+			buffer[5] = (buffer[5] & 0x80) | 0x31;
+			buffer[6] = (buffer[6] & 0x40) | 0xb0;
+			buffer[7] = (buffer[7] & 0x00) | 0xc0;
+			buffer[8] = (buffer[8] & 0x00) | 0x30;
+			changed = 1;
+			break;
+		case 0x3142:	/* AlBook 15" (ATI M10) */
+		case 0x3143:	/* AlBook 17" (ATI M10) */
+			buffer[0] = (buffer[0] & 0xaf) | 0x50;
+			buffer[2] = (buffer[2] & 0x7f) | 0x00;
+			buffer[5] = (buffer[5] & 0x80) | 0x31;
+			buffer[6] = (buffer[6] & 0x40) | 0xb0;
+			buffer[7] = (buffer[7] & 0x00) | 0xd0;
+			buffer[8] = (buffer[8] & 0x00) | 0x30;
+			changed = 1;
+			break;
+		default:
+			DBG("i2c-hwclock: Machine model not handled\n");
+			break;
+		}
+		if (!changed) {
+			pmac_low_i2c_close(ui2c);
+			break;
+		}
+		pmac_low_i2c_setmode(ui2c, pmac_low_i2c_mode_stdsub);
+		rc = pmac_low_i2c_xfer(ui2c, 0xd2 | pmac_low_i2c_write, 0x80, buffer, 9);
+		DBG("write result: %d,", rc);
+		pmac_low_i2c_setmode(ui2c, pmac_low_i2c_mode_combined);
+		rc = pmac_low_i2c_xfer(ui2c, 0xd2 | pmac_low_i2c_read, 0x80, buffer, 9);
+		DBG("read result: %d,", rc);
+		if (rc != 0) {
+			pmac_low_i2c_close(ui2c);
+			break;
+		}
+		for (i=0; i<9; i++)
+			DBG(" %02x", buffer[i]);
+		pmac_low_i2c_close(ui2c);
+		break;
+	}
+
+#endif /* CONFIG_POWER4 */
 
 	/* On all machines, switch modem & serial ports off */
 	np = find_devices("ch-a");
@@ -2339,6 +2721,9 @@
 		return;
 	}
 
+	/* Setup low-level i2c stuffs */
+	pmac_init_low_i2c();
+
 	/* Probe machine type */
 	if (probe_motherboard())
 		printk(KERN_WARNING "Unknown PowerMac !\n");
@@ -2367,3 +2752,55 @@
 }
 
 device_initcall(pmac_feature_late_init);
+
+#ifdef CONFIG_POWER4
+
+static void dump_HT_speeds(char *name, u32 cfg, u32 frq)
+{
+	int	freqs[16] = { 200,300,400,500,600,800,1000,0,0,0,0,0,0,0,0,0 };
+	int	bits[8] = { 8,16,0,32,2,4,0,0 };
+	int	freq = (frq >> 8) & 0xf;
+
+	if (freqs[freq] == 0)
+		printk("%s: Unknown HT link frequency %x\n", name, freq);
+	else
+		printk("%s: %d MHz on main link, (%d in / %d out) bits width\n",
+		       name, freqs[freq],
+		       bits[(cfg >> 28) & 0x7], bits[(cfg >> 24) & 0x7]);
+}
+
+void __init pmac_check_ht_link(void)
+{
+	u32	ufreq, freq, ucfg, cfg;
+	struct device_node *pcix_node;
+	u8  	px_bus, px_devfn;
+	struct pci_controller *px_hose;
+
+	(void)in_be32(u3_ht + U3_HT_LINK_COMMAND);
+	ucfg = cfg = in_be32(u3_ht + U3_HT_LINK_CONFIG);
+	ufreq = freq = in_be32(u3_ht + U3_HT_LINK_FREQ);
+	dump_HT_speeds("U3 HyperTransport", cfg, freq);
+
+	pcix_node = of_find_compatible_node(NULL, "pci", "pci-x");
+	if (pcix_node == NULL) {
+		printk("No PCI-X bridge found\n");
+		return;
+	}
+	if (pci_device_from_OF_node(pcix_node, &px_bus, &px_devfn) != 0) {
+		printk("PCI-X bridge found but not matched to pci\n");
+		return;
+	}
+	px_hose = pci_find_hose_for_OF_device(pcix_node);
+	if (px_hose == NULL) {
+		printk("PCI-X bridge found but not matched to host\n");
+		return;
+	}	
+	early_read_config_dword(px_hose, px_bus, px_devfn, 0xc4, &cfg);
+	early_read_config_dword(px_hose, px_bus, px_devfn, 0xcc, &freq);
+	dump_HT_speeds("PCI-X HT Uplink", cfg, freq);
+	early_read_config_dword(px_hose, px_bus, px_devfn, 0xc8, &cfg);
+	early_read_config_dword(px_hose, px_bus, px_devfn, 0xd0, &freq);
+	dump_HT_speeds("PCI-X HT Downlink", cfg, freq);
+}
+
+#endif /* CONFIG_POWER4 */
--- diff/arch/ppc/platforms/pmac_nvram.c	2003-09-30 15:46:12.000000000 +0100
+++ source/arch/ppc/platforms/pmac_nvram.c	2004-02-09 10:39:51.000000000 +0000
@@ -8,8 +8,7 @@
  *  as published by the Free Software Foundation; either version
  *  2 of the License, or (at your option) any later version.
  *
- *  Todo: - cleanup some coding horrors in the flash code
- *        - add support for the OF persistent properties
+ *  Todo: - add support for the OF persistent properties
  */
 #include <linux/config.h>
 #include <linux/module.h>
@@ -21,29 +20,40 @@
 #include <linux/slab.h>
 #include <linux/delay.h>
 #include <linux/errno.h>
+#include <linux/adb.h>
+#include <linux/pmu.h>
+#include <linux/bootmem.h>
+#include <linux/completion.h>
+#include <linux/spinlock.h>
 #include <asm/sections.h>
 #include <asm/io.h>
 #include <asm/system.h>
 #include <asm/prom.h>
 #include <asm/machdep.h>
 #include <asm/nvram.h>
-#include <linux/adb.h>
-#include <linux/pmu.h>
 
-#undef DEBUG
+#define DEBUG
+
+#ifdef DEBUG
+#define DBG(x...) printk(x)
+#else
+#define DBG(x...)
+#endif
 
 #define NVRAM_SIZE		0x2000	/* 8kB of non-volatile RAM */
 
 #define CORE99_SIGNATURE	0x5a
 #define CORE99_ADLER_START	0x14
 
-/* Core99 nvram is a flash */
-#define CORE99_FLASH_STATUS_DONE	0x80
-#define CORE99_FLASH_STATUS_ERR		0x38
-#define CORE99_FLASH_CMD_ERASE_CONFIRM	0xd0
-#define CORE99_FLASH_CMD_ERASE_SETUP	0x20
-#define CORE99_FLASH_CMD_RESET		0xff
-#define CORE99_FLASH_CMD_WRITE_SETUP	0x40
+/* On Core99, nvram is either a sharp, a micron or an AMD flash */
+#define SM_FLASH_STATUS_DONE	0x80
+#define SM_FLASH_STATUS_ERR		0x38
+#define SM_FLASH_CMD_ERASE_CONFIRM	0xd0
+#define SM_FLASH_CMD_ERASE_SETUP	0x20
+#define SM_FLASH_CMD_RESET		0xff
+#define SM_FLASH_CMD_WRITE_SETUP	0x40
+#define SM_FLASH_CMD_CLEAR_STATUS	0x50
+#define SM_FLASH_CMD_READ_STATUS	0x70
 
 /* CHRP NVRAM header */
 struct chrp_header {
@@ -70,21 +80,110 @@
 static int nvram_mult, is_core_99;
 static int core99_bank = 0;
 static int nvram_partitions[3];
-
-/* FIXME: kmalloc fails to allocate the image now that I had to move it
- *        before time_init(). For now, I allocate a static buffer here
- *        but it's a waste of space on all but core99 machines
- */
-#if 0
-static char* nvram_image;
-#else
-static char nvram_image[NVRAM_SIZE] __pmacdata;
-#endif
+static spinlock_t nv_lock = SPIN_LOCK_UNLOCKED;
 
 extern int pmac_newworld;
+extern int system_running;
+
+static int (*core99_write_bank)(int bank, u8* datas);
+static int (*core99_erase_bank)(int bank);
+
+static char *nvram_image __pmacdata;
+
+
+static unsigned char __pmac core99_nvram_read_byte(int addr)
+{
+	if (nvram_image == NULL)
+		return 0xff;
+	return nvram_image[addr];
+}
+
+static void __pmac core99_nvram_write_byte(int addr, unsigned char val)
+{
+	if (nvram_image == NULL)
+		return;
+	nvram_image[addr] = val;
+}
+
+
+static unsigned char __openfirmware direct_nvram_read_byte(int addr)
+{
+	return in_8(&nvram_data[(addr & (NVRAM_SIZE - 1)) * nvram_mult]);
+}
+
+static void __openfirmware direct_nvram_write_byte(int addr, unsigned char val)
+{
+	out_8(&nvram_data[(addr & (NVRAM_SIZE - 1)) * nvram_mult], val);
+}
+
+
+static unsigned char __pmac indirect_nvram_read_byte(int addr)
+{
+	unsigned char val;
+	unsigned long flags;
+
+	spin_lock_irqsave(&nv_lock, flags);
+	out_8(nvram_addr, addr >> 5);
+	val = in_8(&nvram_data[(addr & 0x1f) << 4]);
+	spin_unlock_irqrestore(&nv_lock, flags);
+
+	return val;
+}
+
+static void __pmac indirect_nvram_write_byte(int addr, unsigned char val)
+{
+	unsigned long flags;
+
+	spin_lock_irqsave(&nv_lock, flags);
+	out_8(nvram_addr, addr >> 5);
+	out_8(&nvram_data[(addr & 0x1f) << 4], val);
+	spin_unlock_irqrestore(&nv_lock, flags);
+}
+
+
+#ifdef CONFIG_ADB_PMU
+
+static void __pmac pmu_nvram_complete(struct adb_request *req)
+{
+	if (req->arg)
+		complete((struct completion *)req->arg);
+}
 
-static u8 __pmac
-chrp_checksum(struct chrp_header* hdr)
+static unsigned char __pmac pmu_nvram_read_byte(int addr)
+{
+	struct adb_request req;
+	DECLARE_COMPLETION(req_complete); 
+	
+	req.arg = system_running ? &req_complete : NULL;
+	if (pmu_request(&req, pmu_nvram_complete, 3, PMU_READ_NVRAM,
+			(addr >> 8) & 0xff, addr & 0xff))
+		return 0xff;
+	if (system_running)
+		wait_for_completion(&req_complete);
+	while (!req.complete)
+		pmu_poll();
+	return req.reply[0];
+}
+
+static void __pmac pmu_nvram_write_byte(int addr, unsigned char val)
+{
+	struct adb_request req;
+	DECLARE_COMPLETION(req_complete); 
+	
+	req.arg = system_running ? &req_complete : NULL;
+	if (pmu_request(&req, pmu_nvram_complete, 4, PMU_WRITE_NVRAM,
+			(addr >> 8) & 0xff, addr & 0xff, val))
+		return;
+	if (system_running)
+		wait_for_completion(&req_complete);
+	while (!req.complete)
+		pmu_poll();
+}
+
+#endif /* CONFIG_ADB_PMU */
+
+
+static u8 __pmac chrp_checksum(struct chrp_header* hdr)
 {
 	u8 *ptr;
 	u16 sum = hdr->signature;
@@ -95,8 +194,7 @@
 	return sum;
 }
 
-static u32 __pmac
-core99_calc_adler(u8 *buffer)
+static u32 __pmac core99_calc_adler(u8 *buffer)
 {
 	int cnt;
 	u32 low, high;
@@ -118,86 +216,186 @@
 	return (high << 16) | low;
 }
 
-static u32 __pmac
-core99_check(u8* datas)
+static u32 __pmac core99_check(u8* datas)
 {
 	struct core99_header* hdr99 = (struct core99_header*)datas;
 
 	if (hdr99->hdr.signature != CORE99_SIGNATURE) {
-#ifdef DEBUG
-		printk("Invalid signature\n");
-#endif
+		DBG("Invalid signature\n");
 		return 0;
 	}
 	if (hdr99->hdr.cksum != chrp_checksum(&hdr99->hdr)) {
-#ifdef DEBUG
-		printk("Invalid checksum\n");
-#endif
+		DBG("Invalid checksum\n");
 		return 0;
 	}
 	if (hdr99->adler != core99_calc_adler(datas)) {
-#ifdef DEBUG
-		printk("Invalid adler\n");
-#endif
+		DBG("Invalid adler\n");
 		return 0;
 	}
 	return hdr99->generation;
 }
 
-static int __pmac
-core99_erase_bank(int bank)
+static int __pmac sm_erase_bank(int bank)
 {
 	int stat, i;
+	unsigned long timeout;
 
 	u8* base = (u8 *)nvram_data + core99_bank*NVRAM_SIZE;
 
-	out_8(base, CORE99_FLASH_CMD_ERASE_SETUP);
-	out_8(base, CORE99_FLASH_CMD_ERASE_CONFIRM);
-	do { stat = in_8(base); }
-	while(!(stat & CORE99_FLASH_STATUS_DONE));
-	out_8(base, CORE99_FLASH_CMD_RESET);
-	if (stat & CORE99_FLASH_STATUS_ERR) {
-		printk("nvram: flash error 0x%02x on erase !\n", stat);
-		return -ENXIO;
-	}
+       	DBG("nvram: Sharp/Micron Erasing bank %d...\n", bank);
+
+	out_8(base, SM_FLASH_CMD_ERASE_SETUP);
+	out_8(base, SM_FLASH_CMD_ERASE_CONFIRM);
+	timeout = 0;
+	do {
+		if (++timeout > 1000000) {
+			printk(KERN_ERR "nvram: Sharp/Miron flash erase timeout !\n");
+			break;
+		}
+		out_8(base, SM_FLASH_CMD_READ_STATUS);
+		stat = in_8(base);
+	} while (!(stat & SM_FLASH_STATUS_DONE));
+
+	out_8(base, SM_FLASH_CMD_CLEAR_STATUS);
+	out_8(base, SM_FLASH_CMD_RESET);
+
 	for (i=0; i<NVRAM_SIZE; i++)
 		if (base[i] != 0xff) {
-			printk("nvram: flash erase failed !\n");
+			printk(KERN_ERR "nvram: Sharp/Micron flash erase failed !\n");
 			return -ENXIO;
 		}
 	return 0;
 }
 
-static int __pmac
-core99_write_bank(int bank, u8* datas)
+static int __pmac sm_write_bank(int bank, u8* datas)
 {
 	int i, stat = 0;
+	unsigned long timeout;
 
 	u8* base = (u8 *)nvram_data + core99_bank*NVRAM_SIZE;
 
+       	DBG("nvram: Sharp/Micron Writing bank %d...\n", bank);
+
 	for (i=0; i<NVRAM_SIZE; i++) {
-		out_8(base+i, CORE99_FLASH_CMD_WRITE_SETUP);
+		out_8(base+i, SM_FLASH_CMD_WRITE_SETUP);
+		udelay(1);
 		out_8(base+i, datas[i]);
-		do { stat = in_8(base); }
-		while(!(stat & CORE99_FLASH_STATUS_DONE));
-		if (stat & CORE99_FLASH_STATUS_ERR)
+		timeout = 0;
+		do {
+			if (++timeout > 1000000) {
+				printk(KERN_ERR "nvram: Sharp/Micron flash write timeout !\n");
+				break;
+			}
+			out_8(base, SM_FLASH_CMD_READ_STATUS);
+			stat = in_8(base);
+		} while (!(stat & SM_FLASH_STATUS_DONE));
+		if (!(stat & SM_FLASH_STATUS_DONE))
 			break;
 	}
-	out_8(base, CORE99_FLASH_CMD_RESET);
-	if (stat & CORE99_FLASH_STATUS_ERR) {
-		printk("nvram: flash error 0x%02x on write !\n", stat);
-		return -ENXIO;
+	out_8(base, SM_FLASH_CMD_CLEAR_STATUS);
+	out_8(base, SM_FLASH_CMD_RESET);
+	for (i=0; i<NVRAM_SIZE; i++)
+		if (base[i] != datas[i]) {
+			printk(KERN_ERR "nvram: Sharp/Micron flash write failed !\n");
+			return -ENXIO;
+		}
+	return 0;
+}
+
+static int __pmac amd_erase_bank(int bank)
+{
+	int i, stat = 0;
+	unsigned long timeout;
+
+	u8* base = (u8 *)nvram_data + core99_bank*NVRAM_SIZE;
+
+       	DBG("nvram: AMD Erasing bank %d...\n", bank);
+
+	/* Unlock 1 */
+	out_8(base+0x555, 0xaa);
+	udelay(1);
+	/* Unlock 2 */
+	out_8(base+0x2aa, 0x55);
+	udelay(1);
+
+	/* Sector-Erase */
+	out_8(base+0x555, 0x80);
+	udelay(1);
+	out_8(base+0x555, 0xaa);
+	udelay(1);
+	out_8(base+0x2aa, 0x55);
+	udelay(1);
+	out_8(base, 0x30);
+	udelay(1);
+
+	timeout = 0;
+	do {
+		if (++timeout > 1000000) {
+			printk(KERN_ERR "nvram: AMD flash erase timeout !\n");
+			break;
+		}
+		stat = in_8(base) ^ in_8(base);
+	} while (stat != 0);
+	
+	/* Reset */
+	out_8(base, 0xf0);
+	udelay(1);
+	
+	for (i=0; i<NVRAM_SIZE; i++)
+		if (base[i] != 0xff) {
+			printk(KERN_ERR "nvram: AMD flash erase failed !\n");
+			return -ENXIO;
+		}
+	return 0;
+}
+
+static int __pmac amd_write_bank(int bank, u8* datas)
+{
+	int i, stat = 0;
+	unsigned long timeout;
+
+	u8* base = (u8 *)nvram_data + core99_bank*NVRAM_SIZE;
+
+       	DBG("nvram: AMD Writing bank %d...\n", bank);
+
+	for (i=0; i<NVRAM_SIZE; i++) {
+		/* Unlock 1 */
+		out_8(base+0x555, 0xaa);
+		udelay(1);
+		/* Unlock 2 */
+		out_8(base+0x2aa, 0x55);
+		udelay(1);
+
+		/* Write single word */
+		out_8(base+0x555, 0xa0);
+		udelay(1);
+		out_8(base+i, datas[i]);
+		
+		timeout = 0;
+		do {
+			if (++timeout > 1000000) {
+				printk(KERN_ERR "nvram: AMD flash write timeout !\n");
+				break;
+			}
+			stat = in_8(base) ^ in_8(base);
+		} while (stat != 0);
+		if (stat != 0)
+			break;
 	}
+
+	/* Reset */
+	out_8(base, 0xf0);
+	udelay(1);
+
 	for (i=0; i<NVRAM_SIZE; i++)
 		if (base[i] != datas[i]) {
-			printk("nvram: flash write failed !\n");
+			printk(KERN_ERR "nvram: AMD flash write failed !\n");
 			return -ENXIO;
 		}
 	return 0;
 }
 
-static void __init
-lookup_partitions(void)
+static void __init lookup_partitions(void)
 {
 	u8 buffer[17];
 	int i, offset;
@@ -227,15 +425,49 @@
 		nvram_partitions[pmac_nvram_XPRAM] = 0x1300;
 		nvram_partitions[pmac_nvram_NR] = 0x1400;
 	}
+	DBG("nvram: OF partition at 0x%x\n", nvram_partitions[pmac_nvram_OF]);
+	DBG("nvram: XP partition at 0x%x\n", nvram_partitions[pmac_nvram_XPRAM]);
+	DBG("nvram: NR partition at 0x%x\n", nvram_partitions[pmac_nvram_NR]);
+}
+
+static void __pmac core99_nvram_sync(void)
+{
+	struct core99_header* hdr99;
+	unsigned long flags;
+
+	if (!is_core_99 || !nvram_data || !nvram_image)
+		return;
+
+	spin_lock_irqsave(&nv_lock, flags);
+	if (!memcmp(nvram_image, (u8*)nvram_data + core99_bank*NVRAM_SIZE,
+		NVRAM_SIZE))
+		goto bail;
+
+	DBG("Updating nvram...\n");
+
+	hdr99 = (struct core99_header*)nvram_image;
+	hdr99->generation++;
+	hdr99->hdr.signature = CORE99_SIGNATURE;
+	hdr99->hdr.cksum = chrp_checksum(&hdr99->hdr);
+	hdr99->adler = core99_calc_adler(nvram_image);
+	core99_bank = core99_bank ? 0 : 1;
+	if (core99_erase_bank)
+		if (core99_erase_bank(core99_bank)) {
+			printk("nvram: Error erasing bank %d\n", core99_bank);
+			goto bail;
+		}
+	if (core99_write_bank)
+		if (core99_write_bank(core99_bank, nvram_image))
+			printk("nvram: Error writing bank %d\n", core99_bank);
+ bail:
+	spin_unlock_irqrestore(&nv_lock, flags);
+
 #ifdef DEBUG
-	printk("nvram: OF partition at 0x%x\n", nvram_partitions[pmac_nvram_OF]);
-	printk("nvram: XP partition at 0x%x\n", nvram_partitions[pmac_nvram_XPRAM]);
-	printk("nvram: NR partition at 0x%x\n", nvram_partitions[pmac_nvram_NR]);
+       	mdelay(2000);
 #endif
 }
 
-void __init
-pmac_nvram_init(void)
+void __init pmac_nvram_init(void)
 {
 	struct device_node *dp;
 
@@ -256,38 +488,65 @@
 			printk(KERN_ERR "nvram: no address\n");
 			return;
 		}
-#if 0
-		nvram_image = kmalloc(NVRAM_SIZE, GFP_KERNEL);
-		if (!nvram_image) {
-			printk(KERN_ERR "nvram: can't allocate image\n");
+		nvram_image = alloc_bootmem(NVRAM_SIZE);
+		if (nvram_image == NULL) {
+			printk(KERN_ERR "nvram: can't allocate ram image\n");
 			return;
 		}
-#endif
 		nvram_data = ioremap(dp->addrs[0].address, NVRAM_SIZE*2);
-#ifdef DEBUG
-		printk("nvram: Checking bank 0...\n");
-#endif
+		nvram_naddrs = 1; /* Make sure we get the correct case */
+
+		DBG("nvram: Checking bank 0...\n");
+
 		gen_bank0 = core99_check((u8 *)nvram_data);
 		gen_bank1 = core99_check((u8 *)nvram_data + NVRAM_SIZE);
 		core99_bank = (gen_bank0 < gen_bank1) ? 1 : 0;
-#ifdef DEBUG
-		printk("nvram: gen0=%d, gen1=%d\n", gen_bank0, gen_bank1);
-		printk("nvram: Active bank is: %d\n", core99_bank);
-#endif
+
+		DBG("nvram: gen0=%d, gen1=%d\n", gen_bank0, gen_bank1);
+		DBG("nvram: Active bank is: %d\n", core99_bank);
+
 		for (i=0; i<NVRAM_SIZE; i++)
 			nvram_image[i] = nvram_data[i + core99_bank*NVRAM_SIZE];
+
+		ppc_md.nvram_read_val	= core99_nvram_read_byte;
+		ppc_md.nvram_write_val	= core99_nvram_write_byte;
+		ppc_md.nvram_sync	= core99_nvram_sync;
+		/* 
+		 * Maybe we could be smarter here though making an exclusive list
+		 * of known flash chips is a bit nasty as older OF didn't provide us
+		 * with a useful "compatible" entry. A solution would be to really
+		 * identify the chip using flash id commands and base ourselves on
+		 * a list of known chips IDs
+		 */
+		if (device_is_compatible(dp, "amd-0137")) {
+			core99_erase_bank = amd_erase_bank;
+			core99_write_bank = amd_write_bank;
+		} else {
+			core99_erase_bank = sm_erase_bank;
+			core99_write_bank = sm_write_bank;
+		}
 	} else if (_machine == _MACH_chrp && nvram_naddrs == 1) {
 		nvram_data = ioremap(dp->addrs[0].address + isa_mem_base,
 				     dp->addrs[0].size);
 		nvram_mult = 1;
+		ppc_md.nvram_read_val	= direct_nvram_read_byte;
+		ppc_md.nvram_write_val	= direct_nvram_write_byte;
 	} else if (nvram_naddrs == 1) {
 		nvram_data = ioremap(dp->addrs[0].address, dp->addrs[0].size);
 		nvram_mult = (dp->addrs[0].size + NVRAM_SIZE - 1) / NVRAM_SIZE;
+		ppc_md.nvram_read_val	= direct_nvram_read_byte;
+		ppc_md.nvram_write_val	= direct_nvram_write_byte;
 	} else if (nvram_naddrs == 2) {
 		nvram_addr = ioremap(dp->addrs[0].address, dp->addrs[0].size);
 		nvram_data = ioremap(dp->addrs[1].address, dp->addrs[1].size);
+		ppc_md.nvram_read_val	= indirect_nvram_read_byte;
+		ppc_md.nvram_write_val	= indirect_nvram_write_byte;
 	} else if (nvram_naddrs == 0 && sys_ctrler == SYS_CTRLER_PMU) {
+#ifdef CONFIG_ADB_PMU
 		nvram_naddrs = -1;
+		ppc_md.nvram_read_val	= pmu_nvram_read_byte;
+		ppc_md.nvram_write_val	= pmu_nvram_write_byte;
+#endif /* CONFIG_ADB_PMU */
 	} else {
 		printk(KERN_ERR "Don't know how to access NVRAM with %d addresses\n",
 		       nvram_naddrs);
@@ -295,117 +554,31 @@
 	lookup_partitions();
 }
 
-void __pmac
-pmac_nvram_update(void)
-{
-	struct core99_header* hdr99;
-
-	if (!is_core_99 || !nvram_data || !nvram_image)
-		return;
-	if (!memcmp(nvram_image, (u8*)nvram_data + core99_bank*NVRAM_SIZE,
-		NVRAM_SIZE))
-		return;
-#ifdef DEBUG
-	printk("Updating nvram...\n");
-#endif
-	hdr99 = (struct core99_header*)nvram_image;
-	hdr99->generation++;
-	hdr99->hdr.signature = CORE99_SIGNATURE;
-	hdr99->hdr.cksum = chrp_checksum(&hdr99->hdr);
-	hdr99->adler = core99_calc_adler(nvram_image);
-	core99_bank = core99_bank ? 0 : 1;
-	if (core99_erase_bank(core99_bank)) {
-		printk("nvram: Error erasing bank %d\n", core99_bank);
-		return;
-	}
-	if (core99_write_bank(core99_bank, nvram_image))
-		printk("nvram: Error writing bank %d\n", core99_bank);
-}
-
-unsigned char __pmac
-pmac_nvram_read_byte(int addr)
-{
-	switch (nvram_naddrs) {
-#ifdef CONFIG_ADB_PMU
-	case -1: {
-		struct adb_request req;
-
-		if (pmu_request(&req, NULL, 3, PMU_READ_NVRAM,
-				(addr >> 8) & 0xff, addr & 0xff))
-			break;
-		while (!req.complete)
-			pmu_poll();
-		return req.reply[0];
-	}
-#endif
-	case 1:
-		if (is_core_99)
-			return nvram_image[addr];
-		return nvram_data[(addr & (NVRAM_SIZE - 1)) * nvram_mult];
-	case 2:
-		*nvram_addr = addr >> 5;
-		eieio();
-		return nvram_data[(addr & 0x1f) << 4];
-	}
-	return 0;
-}
-
-void __pmac
-pmac_nvram_write_byte(int addr, unsigned char val)
-{
-	switch (nvram_naddrs) {
-#ifdef CONFIG_ADB_PMU
-	case -1: {
-		struct adb_request req;
-
-		if (pmu_request(&req, NULL, 4, PMU_WRITE_NVRAM,
-				(addr >> 8) & 0xff, addr & 0xff, val))
-			break;
-		while (!req.complete)
-			pmu_poll();
-		break;
-	}
-#endif
-	case 1:
-		if (is_core_99) {
-			nvram_image[addr] = val;
-			break;
-		}
-		nvram_data[(addr & (NVRAM_SIZE - 1)) * nvram_mult] = val;
-		break;
-	case 2:
-		*nvram_addr = addr >> 5;
-		eieio();
-		nvram_data[(addr & 0x1f) << 4] = val;
-		break;
-	}
-	eieio();
-}
-
-int __pmac
-pmac_get_partition(int partition)
+int __pmac pmac_get_partition(int partition)
 {
 	return nvram_partitions[partition];
 }
 
-u8 __pmac
-pmac_xpram_read(int xpaddr)
+u8 __pmac pmac_xpram_read(int xpaddr)
 {
 	int offset = nvram_partitions[pmac_nvram_XPRAM];
 
 	if (offset < 0)
-		return 0;
+		return 0xff;
 
-	return pmac_nvram_read_byte(xpaddr + offset);
+	return ppc_md.nvram_read_val(xpaddr + offset);
 }
 
-void __pmac
-pmac_xpram_write(int xpaddr, u8 data)
+void __pmac pmac_xpram_write(int xpaddr, u8 data)
 {
 	int offset = nvram_partitions[pmac_nvram_XPRAM];
 
 	if (offset < 0)
 		return;
 
-	pmac_nvram_write_byte(data, xpaddr + offset);
+	ppc_md.nvram_write_val(xpaddr + offset, data);
 }
+
+EXPORT_SYMBOL(pmac_get_partition);
+EXPORT_SYMBOL(pmac_xpram_read);
+EXPORT_SYMBOL(pmac_xpram_write);
--- diff/arch/ppc/platforms/pmac_pci.c	2003-09-30 15:46:12.000000000 +0100
+++ source/arch/ppc/platforms/pmac_pci.c	2004-02-09 10:39:51.000000000 +0000
@@ -1,13 +1,11 @@
 /*
  * Support for PCI bridges found on Power Macintoshes.
- *
- * This includes support for bandit, chaos, grackle (motorola
- * MPC106), and uninorth
+ * At present the "bandit" and "chaos" bridges are supported.
+ * Fortunately you access configuration space in the same
+ * way with either bridge.
  *
  * Copyright (C) 1997 Paul Mackerras (paulus@cs.anu.edu.au)
  *
- * Maintained by Benjamin Herrenschmidt (benh@kernel.crashing.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
@@ -30,11 +28,30 @@
 
 #undef DEBUG
 
-static void add_bridges(struct device_node *dev);
+#ifdef DEBUG
+#ifdef CONFIG_XMON
+extern void xmon_printf(const char *fmt, ...);
+#define DBG(x...) xmon_printf(x)
+#else
+#define DBG(x...) printk(x)
+#endif
+#else
+#define DBG(x...)
+#endif
+
+static int add_bridge(struct device_node *dev);
+extern void pmac_check_ht_link(void);
 
 /* XXX Could be per-controller, but I don't think we risk anything by
  * assuming we won't have both UniNorth and Bandit */
 static int has_uninorth;
+#ifdef CONFIG_POWER4
+static struct pci_controller *u3_agp;
+#endif /* CONFIG_POWER4 */
+
+extern u8 pci_cache_line_size;
+
+struct pci_dev *k2_skiplist[2];
 
 /*
  * Magic constants for enabling cache coherency in the bandit/PSX bridge.
@@ -51,7 +68,7 @@
 {
 	for (; node != 0;node = node->sibling) {
 		int * bus_range;
-		unsigned int *class_code;		
+		unsigned int *class_code;
 		int len;
 
 		/* For PCI<->PCI bridges or CardBus bridges, we go down */
@@ -81,7 +98,7 @@
 	int * bus_range;
 	int len;
 
-	/* Lookup the "bus-range" property for the hose */	
+	/* Lookup the "bus-range" property for the hose */
 	bus_range = (int *) get_property(bridge, "bus-range", &len);
 	if (bus_range == NULL || len < 2 * sizeof(int)) {
 		printk(KERN_WARNING "Can't get bus-range for %s\n",
@@ -92,7 +109,7 @@
 }
 
 /*
- * Apple MacRISC (UniNorth, Bandit, Chaos) PCI controllers.
+ * Apple MacRISC (U3, UniNorth, Bandit, Chaos) PCI controllers.
  *
  * The "Bandit" version is present in all early PCI PowerMacs,
  * and up to the first ones using Grackle. Some machines may
@@ -106,6 +123,11 @@
  * The "UniNorth" version is present in all Core99 machines
  * (iBook, G4, new IMacs, and all the recent Apple machines).
  * It contains 3 controllers in one ASIC.
+ *
+ * The U3 is the bridge used on G5 machines. It contains on
+ * AGP bus which is dealt with the old UniNorth access routines
+ * and an HyperTransport bus which uses its own set of access
+ * functions.
  */
 
 #define MACRISC_CFA0(devfn, off)	\
@@ -211,12 +233,22 @@
 static int __pmac
 chaos_validate_dev(struct pci_bus *bus, int devfn, int offset)
 {
-	if (pci_busdev_to_OF_node(bus, devfn) == 0)
+	struct device_node *np;
+	u32 *vendor, *device;
+
+	np = pci_busdev_to_OF_node(bus, devfn);
+	if (np == NULL)
 		return PCIBIOS_DEVICE_NOT_FOUND;
-	if (/*(dev->vendor == 0x106b) && (dev->device == 3) &&*/ (offset >= 0x10)
-	    && (offset != 0x14) && (offset != 0x18) && (offset <= 0x24)) {
+
+	vendor = (u32 *)get_property(np, "vendor-id", NULL);
+	device = (u32 *)get_property(np, "device-id", NULL);
+	if (vendor == NULL || device == NULL)
+		return PCIBIOS_DEVICE_NOT_FOUND;
+
+	if ((*vendor == 0x106b) && (*device == 3) && (offset >= 0x10)
+	    && (offset != 0x14) && (offset != 0x18) && (offset <= 0x24))
 		return PCIBIOS_BAD_REGISTER_NUMBER;
-	}
+
 	return PCIBIOS_SUCCESSFUL;
 }
 
@@ -248,6 +280,128 @@
 	chaos_write_config
 };
 
+#ifdef CONFIG_POWER4
+
+/*
+ * These versions of U3 HyperTransport config space access ops do not
+ * implement self-view of the HT host yet
+ */
+
+#define U3_HT_CFA0(devfn, off)		\
+		((((unsigned long)devfn) << 8) | offset)
+#define U3_HT_CFA1(bus, devfn, off)	\
+		(U3_HT_CFA0(devfn, off) \
+		+ (((unsigned long)bus) << 16) \
+		+ 0x01000000UL)
+
+static unsigned long __pmac
+u3_ht_cfg_access(struct pci_controller* hose, u8 bus, u8 devfn, u8 offset)
+{
+	if (bus == hose->first_busno) {
+		/* For now, we don't self probe U3 HT bridge */
+		if (PCI_FUNC(devfn) != 0 || PCI_SLOT(devfn) > 7 ||
+		    PCI_SLOT(devfn) < 1)
+			return 0;
+		return ((unsigned long)hose->cfg_data) + U3_HT_CFA0(devfn, offset);
+	} else
+		return ((unsigned long)hose->cfg_data) + U3_HT_CFA1(bus, devfn, offset);
+}
+
+static int __pmac
+u3_ht_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
+		    int len, u32 *val)
+{
+	struct pci_controller *hose = bus->sysdata;
+	unsigned int addr;
+	int i;
+
+	/*
+	 * When a device in K2 is powered down, we die on config
+	 * cycle accesses. Fix that here.
+	 */
+	for (i=0; i<2; i++)
+		if (k2_skiplist[i] && k2_skiplist[i]->bus == bus &&
+		    k2_skiplist[i]->devfn == devfn) {
+			switch (len) {
+			case 1:
+				*val = 0xff; break;
+			case 2:
+				*val = 0xffff; break;
+			default:
+				*val = 0xfffffffful; break;
+			}
+			return PCIBIOS_SUCCESSFUL;
+		}
+	    
+	addr = u3_ht_cfg_access(hose, bus->number, devfn, offset);
+	if (!addr)
+		return PCIBIOS_DEVICE_NOT_FOUND;
+	/*
+	 * Note: the caller has already checked that offset is
+	 * suitably aligned and that len is 1, 2 or 4.
+	 */
+	switch (len) {
+	case 1:
+		*val = in_8((u8 *)addr);
+		break;
+	case 2:
+		*val = in_le16((u16 *)addr);
+		break;
+	default:
+		*val = in_le32((u32 *)addr);
+		break;
+	}
+	return PCIBIOS_SUCCESSFUL;
+}
+
+static int __pmac
+u3_ht_write_config(struct pci_bus *bus, unsigned int devfn, int offset,
+		     int len, u32 val)
+{
+	struct pci_controller *hose = bus->sysdata;
+	unsigned int addr;
+	int i;
+
+	/*
+	 * When a device in K2 is powered down, we die on config
+	 * cycle accesses. Fix that here.
+	 */
+	for (i=0; i<2; i++)
+		if (k2_skiplist[i] && k2_skiplist[i]->bus == bus &&
+		    k2_skiplist[i]->devfn == devfn)
+			return PCIBIOS_SUCCESSFUL;
+
+	addr = u3_ht_cfg_access(hose, bus->number, devfn, offset);
+	if (!addr)
+		return PCIBIOS_DEVICE_NOT_FOUND;
+	/*
+	 * Note: the caller has already checked that offset is
+	 * suitably aligned and that len is 1, 2 or 4.
+	 */
+	switch (len) {
+	case 1:
+		out_8((u8 *)addr, val);
+		(void) in_8((u8 *)addr);
+		break;
+	case 2:
+		out_le16((u16 *)addr, val);
+		(void) in_le16((u16 *)addr);
+		break;
+	default:
+		out_le32((u32 *)addr, val);
+		(void) in_le32((u32 *)addr);
+		break;
+	}
+	return PCIBIOS_SUCCESSFUL;
+}
+
+static struct pci_ops u3_ht_pci_ops =
+{
+	u3_ht_read_config,
+	u3_ht_write_config
+};
+
+#endif /* CONFIG_POWER4 */
 
 /*
  * For a bandit bridge, turn on cache coherency if necessary.
@@ -309,9 +463,7 @@
 	    || strcmp(p2pbridge->parent->name, "pci") != 0)
 		return;
 	if (pci_device_from_OF_node(p2pbridge, &bus, &devfn) < 0) {
-#ifdef DEBUG
-		printk("Can't find PCI infos for PCI<->PCI bridge\n");
-#endif	
+		DBG("Can't find PCI infos for PCI<->PCI bridge\n");
 		return;
 	}
 	/* Warning: At this point, we have not yet renumbered all busses.
@@ -319,9 +471,7 @@
 	 */
 	hose = pci_find_hose_for_OF_device(p2pbridge);
 	if (!hose) {
-#ifdef DEBUG
-		printk("Can't find hose for PCI<->PCI bridge\n");
-#endif	
+		DBG("Can't find hose for PCI<->PCI bridge\n");
 		return;
 	}
 	if (early_read_config_word(hose, bus, devfn,
@@ -333,13 +483,114 @@
 	early_write_config_word(hose, bus, devfn, PCI_BRIDGE_CONTROL, val);
 }
 
+/*
+ * Some Apple desktop machines have a NEC PD720100A USB2 controller
+ * on the motherboard. Open Firmware, on these, will disable the
+ * EHCI part of it so it behaves like a pair of OHCI's. This fixup
+ * code re-enables it ;)
+ */
+static void __init
+fixup_nec_usb2(void)
+{
+	struct device_node *nec;
+
+	for (nec = NULL; (nec = of_find_node_by_name(nec, "usb")) != NULL;) {
+		struct pci_controller *hose;
+		u32 data, *prop;
+		u8 bus, devfn;
+		
+		prop = (u32 *)get_property(nec, "vendor-id", NULL);
+		if (prop == NULL)
+			continue;
+		if (0x1033 != *prop)
+			continue;
+		prop = (u32 *)get_property(nec, "device-id", NULL);
+		if (prop == NULL)
+			continue;
+		if (0x0035 != *prop)
+			continue;
+		prop = (u32 *)get_property(nec, "reg", 0);
+		if (prop == NULL)
+			continue;
+		devfn = (prop[0] >> 8) & 0xff;
+		bus = (prop[0] >> 16) & 0xff;
+		if (PCI_FUNC(devfn) != 0)
+			continue;
+		hose = pci_find_hose_for_OF_device(nec);
+		if (!hose)
+			continue;
+		early_read_config_dword(hose, bus, devfn, 0xe4, &data);
+		if (data & 1UL) {
+			printk("Found NEC PD720100A USB2 chip with disabled EHCI, fixing up...\n");
+			data &= ~1UL;
+			early_write_config_dword(hose, bus, devfn, 0xe4, data);
+			early_write_config_byte(hose, bus, devfn | 2, PCI_INTERRUPT_LINE,
+				nec->intrs[0].line);
+		}
+	}
+}
+
 void __init
 pmac_find_bridges(void)
 {
-	add_bridges(find_devices("bandit"));
-	add_bridges(find_devices("chaos"));
-	add_bridges(find_devices("pci"));
+	struct device_node *np, *root;
+	struct device_node *ht = NULL;
+
+	root = of_find_node_by_path("/");
+	if (root == NULL) {
+		printk(KERN_CRIT "pmac_find_bridges: can't find root of device tree\n");
+		return;
+	}
+	for (np = NULL; (np = of_get_next_child(root, np)) != NULL;) {
+		if (np->name == NULL)
+			continue;
+		if (strcmp(np->name, "bandit") == 0
+		    || strcmp(np->name, "chaos") == 0
+		    || strcmp(np->name, "pci") == 0) {
+			if (add_bridge(np) == 0)
+				of_node_get(np);
+		}
+		if (strcmp(np->name, "ht") == 0) {
+			of_node_get(np);
+			ht = np;
+		}
+	}
+	of_node_put(root);
+
+	/* Probe HT last as it relies on the agp resources to be already
+	 * setup
+	 */
+	if (ht && add_bridge(ht) != 0)
+		of_node_put(ht);
+
 	init_p2pbridge();
+	fixup_nec_usb2();
+#ifdef CONFIG_POWER4 
+	/* There is something wrong with DMA on U3/HT. I haven't figured out
+	 * the details yet, but if I set the cache line size to 128 bytes like
+	 * it should, I'm getting memory corruption caused by devices like
+	 * sungem (even without the MWI bit set, but maybe sungem doesn't
+	 * care). Right now, it appears that setting up a 64 bytes line size
+	 * works properly, 64 bytes beeing the max transfer size of HT, I
+	 * suppose this is related the way HT/PCI are hooked together. I still
+	 * need to dive into more specs though to be really sure of what's
+	 * going on. --BenH.
+	 *
+	 * Ok, apparently, it's just that HT can't do more than 64 bytes
+	 * transactions. MWI seem to be meaningless there as well, it may
+	 * be worth nop'ing out pci_set_mwi too though I haven't done that
+	 * yet.
+	 *
+	 * Note that it's a bit different for whatever is in the AGP slot.
+	 * For now, I don't care, but this can become a real issue, we
+	 * should probably hook pci_set_mwi anyway to make sure it sets
+	 * the real cache line size in there.
+	 */
+	if (machine_is_compatible("MacRISC4"))
+		pci_cache_line_size = 16; /* 64 bytes */
+
+	pmac_check_ht_link();
+#endif /* CONFIG_POWER4 */
 }
 
 #define GRACKLE_CFA(b, d, o)	(0x80 | ((b) << 8) | ((d) << 16) \
@@ -410,6 +661,118 @@
 		ioremap(addr->address + 0xc00000, 0x1000);
 }
 
+#ifdef CONFIG_POWER4
+
+static void __init
+setup_u3_agp(struct pci_controller* hose, struct reg_property* addr)
+{
+	/* On G5, we move AGP up to high bus number so we don't need
+	 * to reassign bus numbers for HT. If we ever have P2P bridges
+	 * on AGP, we'll have to move pci_assign_all_busses to the
+	 * pci_controller structure so we enable it for AGP and not for
+	 * HT childs.
+	 * We hard code the address because of the different size of
+	 * the reg address cell, we shall fix that by killing struct
+	 * reg_property and using some accessor functions instead
+	 */
+       	hose->first_busno = 0xf0;
+	hose->last_busno = 0xff;
+	has_uninorth = 1;
+	hose->ops = &macrisc_pci_ops;
+	hose->cfg_addr = ioremap(0xf0000000 + 0x800000, 0x1000);
+	hose->cfg_data = ioremap(0xf0000000 + 0xc00000, 0x1000);
+
+	u3_agp = hose;
+}
+
+static void __init
+setup_u3_ht(struct pci_controller* hose, struct reg_property *addr)
+{
+	struct device_node *np = (struct device_node *)hose->arch_data;
+	int i, cur;
+
+	hose->ops = &u3_ht_pci_ops;
+
+	/* We hard code the address because of the different size of
+	 * the reg address cell, we shall fix that by killing struct
+	 * reg_property and using some accessor functions instead
+	 */
+	hose->cfg_data = (volatile unsigned char *)ioremap(0xf2000000, 0x02000000);
+
+	/*
+	 * /ht node doesn't expose a "ranges" property, so we "remove" regions that
+	 * have been allocated to AGP. So far, this version of the code doesn't assign
+	 * any of the 0xfxxxxxxx "fine" memory regions to /ht.
+	 * We need to fix that sooner or later by either parsing all child "ranges"
+	 * properties or figuring out the U3 address space decoding logic and
+	 * then read it's configuration register (if any).
+	 */
+	hose->io_base_phys = 0xf4000000 + 0x00400000;
+	hose->io_base_virt = ioremap(hose->io_base_phys, 0x00400000);
+	isa_io_base = (unsigned long) hose->io_base_virt;
+	hose->io_resource.name = np->full_name;
+	hose->io_resource.start = 0;
+	hose->io_resource.end = 0x003fffff;
+	hose->io_resource.flags = IORESOURCE_IO;
+	hose->pci_mem_offset = 0;
+	hose->first_busno = 0;
+	hose->last_busno = 0xef;
+	hose->mem_resources[0].name = np->full_name;
+	hose->mem_resources[0].start = 0x80000000;
+	hose->mem_resources[0].end = 0xefffffff;
+	hose->mem_resources[0].flags = IORESOURCE_MEM;
+
+	if (u3_agp == NULL) {
+		DBG("U3 has no AGP, using full resource range\n");
+		return;
+	}
+
+	/* We "remove" the AGP resources from the resources allocated to HT, that
+	 * is we create "holes". However, that code does assumptions that so far
+	 * happen to be true (cross fingers...), typically that resources in the
+	 * AGP node are properly ordered
+	 */
+	cur = 0;
+	for (i=0; i<3; i++) {
+		struct resource *res = &u3_agp->mem_resources[i];
+		if (res->flags != IORESOURCE_MEM)
+			continue;
+		/* We don't care about "fine" resources */
+		if (res->start >= 0xf0000000)
+			continue;
+		/* Check if it's just a matter of "shrinking" us in one direction */
+		if (hose->mem_resources[cur].start == res->start) {
+			DBG("U3/HT: shrink start of %d, %08lx -> %08lx\n",
+			    cur, hose->mem_resources[cur].start, res->end + 1);
+			hose->mem_resources[cur].start = res->end + 1;
+			continue;
+		}
+		if (hose->mem_resources[cur].end == res->end) {
+			DBG("U3/HT: shrink end of %d, %08lx -> %08lx\n",
+			    cur, hose->mem_resources[cur].end, res->start - 1);
+			hose->mem_resources[cur].end = res->start - 1;
+			continue;
+		}
+		/* No, it's not the case, we need a hole */
+		if (cur == 2) {
+			/* not enough resources to make a hole, we drop part of the range */
+			printk(KERN_WARNING "Running out of resources for /ht host !\n");
+			hose->mem_resources[cur].end = res->start - 1;
+			continue;
+		}		
+		cur++;
+       		DBG("U3/HT: hole, %d end at %08lx, %d start at %08lx\n",
+		    cur-1, res->start - 1, cur, res->end + 1);
+		hose->mem_resources[cur].name = np->full_name;
+		hose->mem_resources[cur].flags = IORESOURCE_MEM;
+		hose->mem_resources[cur].start = res->end + 1;
+		hose->mem_resources[cur].end = hose->mem_resources[cur-1].end;
+		hose->mem_resources[cur-1].end = res->start - 1;
+	}
+}
+
+#endif /* CONFIG_POWER4 */
+
 void __init
 setup_grackle(struct pci_controller *hose)
 {
@@ -426,69 +789,77 @@
  * "pci" (a MPC106) and no bandit or chaos bridges, and contrariwise,
  * if we have one or more bandit or chaos bridges, we don't have a MPC106.
  */
-static void __init
-add_bridges(struct device_node *dev)
+static int __init
+add_bridge(struct device_node *dev)
 {
 	int len;
 	struct pci_controller *hose;
 	struct reg_property *addr;
 	char* disp_name;
 	int *bus_range;
-	int first = 1, primary;
+	int primary = 1;
 
-	for (; dev != NULL; dev = dev->next) {
-		addr = (struct reg_property *) get_property(dev, "reg", &len);
-		if (addr == NULL || len < sizeof(*addr)) {
-			printk(KERN_WARNING "Can't use %s: no address\n",
-			       dev->full_name);
-			continue;
-		}
-		bus_range = (int *) get_property(dev, "bus-range", &len);
-		if (bus_range == NULL || len < 2 * sizeof(int)) {
-			printk(KERN_WARNING "Can't get bus-range for %s, assume bus 0\n",
-				       dev->full_name);
-		}
-	
-		hose = pcibios_alloc_controller();
-		if (!hose)
-			continue;
-		hose->arch_data = dev;
-		hose->first_busno = bus_range ? bus_range[0] : 0;
-		hose->last_busno = bus_range ? bus_range[1] : 0xff;
-
-		disp_name = NULL;
-		primary = first;
-		if (device_is_compatible(dev, "uni-north")) {
-			primary = setup_uninorth(hose, addr);
-			disp_name = "UniNorth";
-		} else if (strcmp(dev->name, "pci") == 0) {
-			/* XXX assume this is a mpc106 (grackle) */
-			setup_grackle(hose);
-			disp_name = "Grackle (MPC106)";
-		} else if (strcmp(dev->name, "bandit") == 0) {
-			setup_bandit(hose, addr);
-			disp_name = "Bandit";
-		} else if (strcmp(dev->name, "chaos") == 0) {
-			setup_chaos(hose, addr);
-			disp_name = "Chaos";
-			primary = 0;
-		}
-		printk(KERN_INFO "Found %s PCI host bridge at 0x%08x. Firmware bus number: %d->%d\n",
-			disp_name, addr->address, hose->first_busno, hose->last_busno);
-#ifdef DEBUG
-		printk(" ->Hose at 0x%08lx, cfg_addr=0x%08lx,cfg_data=0x%08lx\n",
-			hose, hose->cfg_addr, hose->cfg_data);
-#endif	
-	
-		/* Interpret the "ranges" property */
-		/* This also maps the I/O region and sets isa_io/mem_base */
-		pci_process_bridge_OF_ranges(hose, dev, primary);
+	DBG("Adding PCI host bridge %s\n", dev->full_name);
 
-		/* Fixup "bus-range" OF property */
-		fixup_bus_range(dev);
+       	addr = (struct reg_property *) get_property(dev, "reg", &len);
+       	if (addr == NULL || len < sizeof(*addr)) {
+       		printk(KERN_WARNING "Can't use %s: no address\n",
+       		       dev->full_name);
+       		return -ENODEV;
+       	}
+       	bus_range = (int *) get_property(dev, "bus-range", &len);
+       	if (bus_range == NULL || len < 2 * sizeof(int)) {
+       		printk(KERN_WARNING "Can't get bus-range for %s, assume bus 0\n",
+       			       dev->full_name);
+       	}
+
+       	hose = pcibios_alloc_controller();
+       	if (!hose)
+       		return -ENOMEM;
+       	hose->arch_data = dev;
+       	hose->first_busno = bus_range ? bus_range[0] : 0;
+       	hose->last_busno = bus_range ? bus_range[1] : 0xff;
+
+	disp_name = NULL;
+#ifdef CONFIG_POWER4
+       	if (device_is_compatible(dev, "u3-agp")) {
+       		setup_u3_agp(hose, addr);
+       		disp_name = "U3-AGP";
+       		primary = 0;
+       	} else if (device_is_compatible(dev, "u3-ht")) {
+       		setup_u3_ht(hose, addr);
+       		disp_name = "U3-HT";
+       		primary = 1;
+       	} else
+#endif /* CONFIG_POWER4 */
+	if (device_is_compatible(dev, "uni-north")) {
+       		primary = setup_uninorth(hose, addr);
+       		disp_name = "UniNorth";
+       	} else if (strcmp(dev->name, "pci") == 0) {
+       		/* XXX assume this is a mpc106 (grackle) */
+       		setup_grackle(hose);
+       		disp_name = "Grackle (MPC106)";
+       	} else if (strcmp(dev->name, "bandit") == 0) {
+       		setup_bandit(hose, addr);
+       		disp_name = "Bandit";
+       	} else if (strcmp(dev->name, "chaos") == 0) {
+       		setup_chaos(hose, addr);
+       		disp_name = "Chaos";
+       		primary = 0;
+       	}
+       	printk(KERN_INFO "Found %s PCI host bridge at 0x%08x. Firmware bus number: %d->%d\n",
+       		disp_name, addr->address, hose->first_busno, hose->last_busno);
+       	DBG(" ->Hose at 0x%p, cfg_addr=0x%p,cfg_data=0x%p\n",
+       		hose, hose->cfg_addr, hose->cfg_data);
+
+       	/* Interpret the "ranges" property */
+       	/* This also maps the I/O region and sets isa_io/mem_base */
+       	pci_process_bridge_OF_ranges(hose, dev, primary);
 
-		first &= !primary;
-	}
+       	/* Fixup "bus-range" OF property */
+       	fixup_bus_range(dev);
+
+	return 0;
 }
 
 static void __init
@@ -575,7 +946,7 @@
 		cmd |= PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER | PCI_COMMAND_INVALIDATE;
     		pci_write_config_word(dev, PCI_COMMAND, cmd);
     		pci_write_config_byte(dev, PCI_LATENCY_TIMER, 16);
-    		pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, 8);
+    		pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, pci_cache_line_size);
 	}
 
 	return 0;
@@ -628,3 +999,108 @@
 	}
 }
 
+void pmac_pci_fixup_cardbus(struct pci_dev* dev)
+{
+	if (_machine != _MACH_Pmac)
+		return;
+	/*
+	 * Fix the interrupt routing on the various cardbus bridges
+	 * used on powerbooks
+	 */
+	if (dev->vendor != PCI_VENDOR_ID_TI)
+		return;
+	if (dev->device == PCI_DEVICE_ID_TI_1130 ||
+	    dev->device == PCI_DEVICE_ID_TI_1131) {
+		u8 val;
+	    	/* Enable PCI interrupt */
+		if (pci_read_config_byte(dev, 0x91, &val) == 0)
+			pci_write_config_byte(dev, 0x91, val | 0x30);
+		/* Disable ISA interrupt mode */
+		if (pci_read_config_byte(dev, 0x92, &val) == 0)
+			pci_write_config_byte(dev, 0x92, val & ~0x06);
+	}
+	if (dev->device == PCI_DEVICE_ID_TI_1210 ||
+	    dev->device == PCI_DEVICE_ID_TI_1211 ||
+	    dev->device == PCI_DEVICE_ID_TI_1410 ||
+	    dev->device == PCI_DEVICE_ID_TI_1510) {
+		u8 val;
+		/* 0x8c == TI122X_IRQMUX, 2 says to route the INTA
+		   signal out the MFUNC0 pin */
+		if (pci_read_config_byte(dev, 0x8c, &val) == 0)
+			pci_write_config_byte(dev, 0x8c, (val & ~0x0f) | 2);
+		/* Disable ISA interrupt mode */
+		if (pci_read_config_byte(dev, 0x92, &val) == 0)
+			pci_write_config_byte(dev, 0x92, val & ~0x06);
+	}
+}
+
+void pmac_pci_fixup_pciata(struct pci_dev* dev)
+{
+       u8 progif = 0;
+
+       /*
+        * On PowerMacs, we try to switch any PCI ATA controller to
+	* fully native mode
+        */
+	if (_machine != _MACH_Pmac)
+		return;
+	/* Some controllers don't have the class IDE */
+	if (dev->vendor == PCI_VENDOR_ID_PROMISE)
+		switch(dev->device) {
+		case PCI_DEVICE_ID_PROMISE_20246:
+		case PCI_DEVICE_ID_PROMISE_20262:
+		case PCI_DEVICE_ID_PROMISE_20263:
+		case PCI_DEVICE_ID_PROMISE_20265:
+		case PCI_DEVICE_ID_PROMISE_20267:
+		case PCI_DEVICE_ID_PROMISE_20268:
+		case PCI_DEVICE_ID_PROMISE_20269:
+		case PCI_DEVICE_ID_PROMISE_20270:
+		case PCI_DEVICE_ID_PROMISE_20271:
+		case PCI_DEVICE_ID_PROMISE_20275:
+		case PCI_DEVICE_ID_PROMISE_20276:
+		case PCI_DEVICE_ID_PROMISE_20277:
+			goto good;
+		}
+	/* Others, check PCI class */
+	if ((dev->class >> 8) != PCI_CLASS_STORAGE_IDE)
+		return;
+ good:
+	pci_read_config_byte(dev, PCI_CLASS_PROG, &progif);
+	if ((progif & 5) != 5) {
+		printk(KERN_INFO "Forcing PCI IDE into native mode: %s\n", pci_name(dev));
+		(void) pci_write_config_byte(dev, PCI_CLASS_PROG, progif|5);
+		if (pci_read_config_byte(dev, PCI_CLASS_PROG, &progif) ||
+		    (progif & 5) != 5)
+			printk(KERN_ERR "Rewrite of PROGIF failed !\n");
+	}
+}
+
+/*
+ * Disable second function on K2-SATA, it's broken
+ * and disable IO BARs on first one
+ */
+void __pmac pmac_pci_fixup_k2_sata(struct pci_dev* dev)
+{
+	int i;
+	u16 cmd;
+
+	if (PCI_FUNC(dev->devfn) > 0) {
+		pci_read_config_word(dev, PCI_COMMAND, &cmd);
+		cmd &= ~(PCI_COMMAND_IO | PCI_COMMAND_MEMORY);
+		pci_write_config_word(dev, PCI_COMMAND, cmd);
+		for (i = 0; i < 6; i++) {
+			dev->resource[i].start = dev->resource[i].end = 0;
+			dev->resource[i].flags = 0;
+			pci_write_config_dword(dev, PCI_BASE_ADDRESS_0 + 4 * i, 0);
+		}
+	} else {
+		pci_read_config_word(dev, PCI_COMMAND, &cmd);
+		cmd &= ~PCI_COMMAND_IO;
+		pci_write_config_word(dev, PCI_COMMAND, cmd);
+		for (i = 0; i < 5; i++) {
+			dev->resource[i].start = dev->resource[i].end = 0;
+			dev->resource[i].flags = 0;
+			pci_write_config_dword(dev, PCI_BASE_ADDRESS_0 + 4 * i, 0);
+		}
+	}
+}
--- diff/arch/ppc/platforms/pmac_pic.c	2003-09-30 15:46:12.000000000 +0100
+++ source/arch/ppc/platforms/pmac_pic.c	2004-02-09 10:39:51.000000000 +0000
@@ -34,6 +34,7 @@
 #include <asm/time.h>
 #include <asm/open_pic.h>
 #include <asm/xmon.h>
+#include <asm/pmac_feature.h>
 
 #include "pmac_pic.h"
 
@@ -363,32 +364,76 @@
 	return irqctrler->intrs[0].line;
 }
 
-void __init
-pmac_pic_init(void)
+#ifdef CONFIG_POWER4
+static irqreturn_t k2u3_action(int cpl, void *dev_id, struct pt_regs *regs)
+{
+	int irq;
+
+	irq = openpic2_get_irq(regs);
+	if (irq != -1)
+		ppc_irq_dispatch_handler(regs, irq);
+	return IRQ_HANDLED;
+}
+#endif /* CONFIG_POWER4 */
+
+void __init pmac_pic_init(void)
 {
         int i;
-        struct device_node *irqctrler;
+        struct device_node *irqctrler  = NULL;
+        struct device_node *irqctrler2 = NULL;
+	struct device_node *np;
         unsigned long addr;
 	int irq_cascade = -1;
 
 	/* We first try to detect Apple's new Core99 chipset, since mac-io
 	 * is quite different on those machines and contains an IBM MPIC2.
 	 */
-	irqctrler = find_type_devices("open-pic");
+	np = find_type_devices("open-pic");
+	while(np) {
+		if (np->parent && !strcmp(np->parent->name, "u3"))
+			irqctrler2 = np;
+		else
+			irqctrler = np;
+		np = np->next;
+	}
 	if (irqctrler != NULL)
 	{
-		printk("PowerMac using OpenPIC irq controller\n");
 		if (irqctrler->n_addrs > 0)
 		{
-			unsigned char senses[NR_IRQS];
+			unsigned char senses[128];
+
+			printk(KERN_INFO "PowerMac using OpenPIC irq controller at 0x%08x\n",
+			       irqctrler->addrs[0].address);
 
-			prom_get_irq_senses(senses, 0, NR_IRQS);
+			prom_get_irq_senses(senses, 0, 128);
 			OpenPIC_InitSenses = senses;
-			OpenPIC_NumInitSenses = NR_IRQS;
+			OpenPIC_NumInitSenses = 128;
 			ppc_md.get_irq = openpic_get_irq;
+			pmac_call_feature(PMAC_FTR_ENABLE_MPIC, irqctrler, 0, 0);
 			OpenPIC_Addr = ioremap(irqctrler->addrs[0].address,
 					       irqctrler->addrs[0].size);
 			openpic_init(0);
+
+#ifdef CONFIG_POWER4
+			if (irqctrler2 != NULL && irqctrler2->n_intrs > 0 &&
+			    irqctrler2->n_addrs > 0) {
+				printk(KERN_INFO "Slave OpenPIC at 0x%08x hooked on IRQ %d\n",
+				       irqctrler2->addrs[0].address,
+				       irqctrler2->intrs[0].line);
+				pmac_call_feature(PMAC_FTR_ENABLE_MPIC, irqctrler2, 0, 0);
+				OpenPIC2_Addr = ioremap(irqctrler2->addrs[0].address,
+							irqctrler2->addrs[0].size);
+				prom_get_irq_senses(senses, PMAC_OPENPIC2_OFFSET,
+						    PMAC_OPENPIC2_OFFSET+128);
+				OpenPIC_InitSenses = senses;
+				OpenPIC_NumInitSenses = 128;
+				openpic2_init(PMAC_OPENPIC2_OFFSET);
+				if (request_irq(irqctrler2->intrs[0].line, k2u3_action, 0,
+						"U3->K2 Cascade", NULL))
+					printk("Unable to get OpenPIC IRQ for cascade\n");
+			}
+#endif /* CONFIG_POWER4 */
+
 #ifdef CONFIG_XMON
 			{
 				struct device_node* pswitch;
--- diff/arch/ppc/platforms/pmac_setup.c	2003-09-30 15:46:12.000000000 +0100
+++ source/arch/ppc/platforms/pmac_setup.c	2004-02-09 10:39:51.000000000 +0000
@@ -332,7 +332,7 @@
 
 #ifdef CONFIG_SMP
 	/* Check for Core99 */
-	if (find_devices("uni-n"))
+	if (find_devices("uni-n") || find_devices("u3"))
 		ppc_md.smp_ops = &core99_smp_ops;
 	else
 		ppc_md.smp_ops = &psurge_smp_ops;
@@ -469,10 +469,6 @@
 	struct adb_request req;
 #endif /* CONFIG_ADB_CUDA */
 
-#ifdef CONFIG_NVRAM
-	pmac_nvram_update();
-#endif
-
 	switch (sys_ctrler) {
 #ifdef CONFIG_ADB_CUDA
 	case SYS_CTRLER_CUDA:
@@ -498,10 +494,6 @@
 	struct adb_request req;
 #endif /* CONFIG_ADB_CUDA */
 
-#ifdef CONFIG_NVRAM
-	pmac_nvram_update();
-#endif
-
 	switch (sys_ctrler) {
 #ifdef CONFIG_ADB_CUDA
 	case SYS_CTRLER_CUDA:
@@ -637,11 +629,6 @@
 	ppc_md.get_rtc_time   = pmac_get_rtc_time;
 	ppc_md.calibrate_decr = pmac_calibrate_decr;
 
-#ifdef CONFIG_NVRAM
-	ppc_md.nvram_read_val	= pmac_nvram_read_byte;
-	ppc_md.nvram_write_val	= pmac_nvram_write_byte;
-#endif
-
 	ppc_md.find_end_of_memory = pmac_find_end_of_memory;
 
 	ppc_md.feature_call   = pmac_do_feature_call;
@@ -685,6 +672,14 @@
 				break;
 			}
 	}
+	np = find_devices("u3");
+	if (np) {
+		for (np = np->child; np != NULL; np = np->sibling)
+			if (strncmp(np->name, "i2c", 3) == 0) {
+				of_platform_device_create(np, "u3-i2c");
+				break;
+			}
+	}
 
 	np = find_devices("valkyrie");
 	if (np)
--- diff/arch/ppc/platforms/pmac_smp.c	2003-10-27 09:20:37.000000000 +0000
+++ source/arch/ppc/platforms/pmac_smp.c	2004-02-09 10:39:51.000000000 +0000
@@ -119,8 +119,7 @@
 /* Sync flag for HW tb sync */
 static volatile int sec_tb_reset = 0;
 
-static void __init
-core99_init_caches(int cpu)
+static void __init core99_init_caches(int cpu)
 {
 	if (!(cur_cpu_spec[0]->cpu_features & CPU_FTR_L2CR))
 		return;
@@ -188,8 +187,7 @@
  */
 static unsigned long psurge_smp_message[NR_CPUS];
 
-void __pmac
-psurge_smp_message_recv(struct pt_regs *regs)
+void __pmac psurge_smp_message_recv(struct pt_regs *regs)
 {
 	int cpu = smp_processor_id();
 	int msg;
@@ -206,15 +204,14 @@
 			smp_message_recv(msg, regs);
 }
 
-irqreturn_t __pmac
-psurge_primary_intr(int irq, void *d, struct pt_regs *regs)
+irqreturn_t __pmac psurge_primary_intr(int irq, void *d, struct pt_regs *regs)
 {
 	psurge_smp_message_recv(regs);
 	return IRQ_HANDLED;
 }
 
-static void __pmac
-smp_psurge_message_pass(int target, int msg, unsigned long data, int wait)
+static void __pmac smp_psurge_message_pass(int target, int msg, unsigned long data,
+					   int wait)
 {
 	int i;
 
@@ -410,8 +407,7 @@
 	smp_tb_synchronized = 1;
 }
 
-static void __init
-smp_psurge_setup_cpu(int cpu_nr)
+static void __init smp_psurge_setup_cpu(int cpu_nr)
 {
 
 	if (cpu_nr == 0) {
@@ -435,41 +431,54 @@
 		psurge_dual_sync_tb(cpu_nr);
 }
 
-void __init
-smp_psurge_take_timebase(void)
+void __init smp_psurge_take_timebase(void)
 {
 	/* Dummy implementation */
 }
 
-void __init
-smp_psurge_give_timebase(void)
+void __init smp_psurge_give_timebase(void)
 {
 	/* Dummy implementation */
 }
 
-static int __init
-smp_core99_probe(void)
+static int __init smp_core99_probe(void)
 {
+#ifdef CONFIG_6xx
 	extern int powersave_nap;
-	struct device_node *cpus;
-	int i, ncpus = 1;
+#endif
+	struct device_node *cpus, *firstcpu;
+	int i, ncpus = 0, boot_cpu = -1;
 	u32 *tbprop;
 
 	if (ppc_md.progress) ppc_md.progress("smp_core99_probe", 0x345);
-	cpus = find_type_devices("cpu");
-	if (cpus == NULL)
-		return 0;
-
-	tbprop = (u32 *)get_property(cpus, "timebase-enable", NULL);
-	if (tbprop)
-		core99_tb_gpio = *tbprop;
-	else
-		core99_tb_gpio = KL_GPIO_TB_ENABLE;
+	cpus = firstcpu = find_type_devices("cpu");
+	while(cpus != NULL) {
+		u32 *regprop = (u32 *)get_property(cpus, "reg", NULL);
+		char *stateprop = (char *)get_property(cpus, "state", NULL);
+		if (regprop != NULL && stateprop != NULL &&
+		    !strncmp(stateprop, "running", 7))
+			boot_cpu = *regprop;
+		++ncpus;
+		cpus = cpus->next;
+	}
+	if (boot_cpu == -1)
+		printk(KERN_WARNING "Couldn't detect boot CPU !\n");
+	if (boot_cpu != 0)
+		printk(KERN_WARNING "Boot CPU is %d, unsupported setup !\n", boot_cpu);
 
-       	while ((cpus = cpus->next) != NULL)
-	       	++ncpus;
+	if (machine_is_compatible("MacRISC4")) {
+		extern struct smp_ops_t core99_smp_ops;
 
-	printk("smp_core99_probe: found %d cpus\n", ncpus);
+		core99_smp_ops.take_timebase = smp_generic_take_timebase;
+		core99_smp_ops.give_timebase = smp_generic_give_timebase;
+	} else {
+		if (firstcpu != NULL)
+			tbprop = (u32 *)get_property(firstcpu, "timebase-enable", NULL);
+		if (tbprop)
+			core99_tb_gpio = *tbprop;
+		else
+			core99_tb_gpio = KL_GPIO_TB_ENABLE;
+	}
 
 	if (ncpus > 1) {
 		openpic_request_IPIs();
@@ -484,8 +493,7 @@
 	return ncpus;
 }
 
-static void __init
-smp_core99_kick_cpu(int nr)
+static void __init smp_core99_kick_cpu(int nr)
 {
 	unsigned long save_vector, new_vector;
 	unsigned long flags;
@@ -539,23 +547,31 @@
 	if (ppc_md.progress) ppc_md.progress("smp_core99_kick_cpu done", 0x347);
 }
 
-static void __init
-smp_core99_setup_cpu(int cpu_nr)
+static void __init smp_core99_setup_cpu(int cpu_nr)
 {
-	/* Setup some registers */
+	/* Setup L2/L3 */
 	if (cpu_nr != 0)
 		core99_init_caches(cpu_nr);
 
 	/* Setup openpic */
 	do_openpic_setup_cpu();
 
-	/* Setup L2/L3 */
-	if (cpu_nr == 0)
+	if (cpu_nr == 0) {
+#ifdef CONFIG_POWER4
+		extern void g5_phy_disable_cpu1(void);
+
+		/* If we didn't start the second CPU, we must take
+		 * it off the bus
+		 */
+		if (machine_is_compatible("MacRISC4") &&
+		    num_online_cpus() < 2)		
+			g5_phy_disable_cpu1();
+#endif /* CONFIG_POWER4 */
 		if (ppc_md.progress) ppc_md.progress("core99_setup_cpu 0 done", 0x349);
+	}
 }
 
-void __init
-smp_core99_take_timebase(void)
+void __init smp_core99_take_timebase(void)
 {
 	/* Secondary processor "takes" the timebase by freezing
 	 * it, resetting its local TB and telling CPU 0 to go on
@@ -572,8 +588,7 @@
        	sec_tb_reset = 1;
 }
 
-void __init
-smp_core99_give_timebase(void)
+void __init smp_core99_give_timebase(void)
 {
 	unsigned int t;
 
--- diff/arch/ppc/platforms/pmac_time.c	2003-10-27 09:20:37.000000000 +0000
+++ source/arch/ppc/platforms/pmac_time.c	2004-02-09 10:39:51.000000000 +0000
@@ -266,6 +266,14 @@
 		if (via_calibrate_decr())
 			return;
 
+	/* Special case: QuickSilver G4s seem to have a badly calibrated
+	 * timebase-frequency in OF, VIA is much better on these. We should
+	 * probably implement calibration based on the KL timer on these
+	 * machines anyway... -BenH
+	 */
+	if (machine_is_compatible("PowerMac3,5"))
+		if (via_calibrate_decr())
+			return;
 	/*
 	 * The cpu node should have a timebase-frequency property
 	 * to tell us the rate at which the decrementer counts.
--- diff/arch/ppc/platforms/sandpoint.c	2003-09-17 12:28:03.000000000 +0100
+++ source/arch/ppc/platforms/sandpoint.c	2004-02-09 10:39:51.000000000 +0000
@@ -103,12 +103,10 @@
 #include <asm/bootinfo.h>
 #include <asm/mpc10x.h>
 #include <asm/pci-bridge.h>
+#include <asm/kgdb.h>
 
 #include "sandpoint.h"
 
-extern void gen550_progress(char *, unsigned short);
-extern void gen550_init(int, struct uart_port *);
-
 unsigned char __res[sizeof(bd_t)];
 
 static void sandpoint_halt(void);
@@ -706,6 +704,9 @@
 #if defined(CONFIG_SERIAL_8250) && \
 	(defined(CONFIG_KGDB) || defined(CONFIG_SERIAL_TEXT_DEBUG))
 	sandpoint_early_serial_map();
+#ifdef CONFIG_KGDB
+	ppc_md.kgdb_map_scc = gen550_kgdb_map_scc;
+#endif
 #ifdef CONFIG_SERIAL_TEXT_DEBUG
 	ppc_md.progress = gen550_progress;
 #endif
--- diff/arch/ppc/syslib/Makefile	2003-09-17 12:28:03.000000000 +0100
+++ source/arch/ppc/syslib/Makefile	2004-02-09 10:39:51.000000000 +0000
@@ -31,6 +31,7 @@
 endif
 obj-$(CONFIG_PPC_OF)		+= prom_init.o prom.o of_device.o
 obj-$(CONFIG_PPC_PMAC)		+= open_pic.o indirect_pci.o
+obj-$(CONFIG_POWER4)		+= open_pic2.o
 obj-$(CONFIG_PPC_CHRP)		+= open_pic.o indirect_pci.o i8259.o
 obj-$(CONFIG_PPC_PREP)		+= open_pic.o indirect_pci.o i8259.o
 obj-$(CONFIG_ADIR)		+= i8259.o indirect_pci.o pci_auto.o \
@@ -66,7 +67,7 @@
 obj-$(CONFIG_SPRUCE)		+= cpc700_pic.o indirect_pci.o pci_auto.o \
 				   todc_time.o
 obj-$(CONFIG_8260)		+= m8260_setup.o ppc8260_pic.o
-ifeq ($(CONFIG_SERIAL_8250)$(CONFIG_PPC_GEN550),yy)
+ifeq ($(CONFIG_PPC_GEN550),y)
 obj-$(CONFIG_KGDB)		+= gen550_kgdb.o gen550_dbg.o
 obj-$(CONFIG_SERIAL_TEXT_DEBUG)	+= gen550_dbg.o
 endif
--- diff/arch/ppc/syslib/gen550_dbg.c	2003-07-11 09:39:50.000000000 +0100
+++ source/arch/ppc/syslib/gen550_dbg.c	2004-02-09 10:39:51.000000000 +0000
@@ -17,6 +17,8 @@
  */
 
 #include <linux/config.h>
+#include <linux/types.h>
+#include <linux/serial.h>
 #include <linux/tty.h>		/* For linux/serial_core.h */
 #include <linux/serial_core.h>
 #include <linux/serialP.h>
--- diff/arch/ppc/syslib/gen550_kgdb.c	2003-09-30 15:46:12.000000000 +0100
+++ source/arch/ppc/syslib/gen550_kgdb.c	2004-02-09 10:39:51.000000000 +0000
@@ -77,7 +77,7 @@
  * to use.
  */
 void
-kgdb_map_scc(void)
+gen550_kgdb_map_scc(void)
 {
 	printk(KERN_DEBUG "kgdb init\n");
 	kgdb_debugport = serial_init(KGDB_PORT, NULL);
--- diff/arch/ppc/syslib/of_device.c	2003-10-27 09:20:37.000000000 +0000
+++ source/arch/ppc/syslib/of_device.c	2004-02-09 10:39:51.000000000 +0000
@@ -183,6 +183,7 @@
 	struct of_device *ofdev;
 
         ofdev = to_of_device(dev);
+	of_node_put(ofdev->node);
 	kfree(ofdev);
 }
 
@@ -242,7 +243,7 @@
 		return NULL;
 	memset(dev, 0, sizeof(*dev));
 
-	dev->node = np;
+	dev->node = of_node_get(np);
 	dev->dma_mask = 0xffffffffUL;
 	dev->dev.dma_mask = &dev->dma_mask;
 	dev->dev.parent = NULL;
--- diff/arch/ppc/syslib/open_pic.c	2003-09-30 15:46:12.000000000 +0100
+++ source/arch/ppc/syslib/open_pic.c	2004-02-09 10:39:51.000000000 +0000
@@ -610,12 +610,15 @@
 
 void __devinit do_openpic_setup_cpu(void)
 {
+#ifdef CONFIG_IRQ_ALL_CPUS
  	int i;
-	u32 msk = 1 << smp_hw_index[smp_processor_id()];
-
+	u32 msk;
+#endif
 	spin_lock(&openpic_setup_lock);
 
 #ifdef CONFIG_IRQ_ALL_CPUS
+	msk = 1 << smp_hw_index[smp_processor_id()];
+
  	/* let the openpic know we want intrs. default affinity
  	 * is 0xffffffff until changed via /proc
  	 * That's how it's done on x86. If we want it differently, then
@@ -788,15 +791,25 @@
  */
 static void openpic_ack_irq(unsigned int irq_nr)
 {
+#ifdef __SLOW_VERSION__
 	openpic_disable_irq(irq_nr);
 	openpic_eoi();
+#else
+	if ((irq_desc[irq_nr].status & IRQ_LEVEL) == 0)
+		openpic_eoi();
+#endif
 }
 
 static void openpic_end_irq(unsigned int irq_nr)
 {
+#ifdef __SLOW_VERSION__
 	if (!(irq_desc[irq_nr].status & (IRQ_DISABLED|IRQ_INPROGRESS))
 	    && irq_desc[irq_nr].action)
 		openpic_enable_irq(irq_nr);
+#else
+	if ((irq_desc[irq_nr].status & IRQ_LEVEL) != 0)
+		openpic_eoi();
+#endif
 }
 
 static void openpic_set_affinity(unsigned int irq_nr, unsigned long cpumask)
--- diff/arch/ppc/syslib/prom.c	2003-09-30 15:46:12.000000000 +0100
+++ source/arch/ppc/syslib/prom.c	2004-02-09 10:39:51.000000000 +0000
@@ -160,7 +160,7 @@
 			   match on /chosen.interrupt_controller */
 			if ((name != NULL
 			     && strcmp(name, "interrupt-controller") == 0)
-			    || (ic != NULL && iclen == 0)) {
+			    || (ic != NULL && iclen == 0 && strcmp(name, "AppleKiwi"))) {
 				if (n == 0)
 					dflt_interrupt_controller = np;
 				++n;
@@ -217,7 +217,7 @@
 		ifunc = interpret_macio_props;
 	else if (!strcmp(np->type, "isa"))
 		ifunc = interpret_isa_props;
-	else if (!strcmp(np->name, "uni-n"))
+	else if (!strcmp(np->name, "uni-n") || !strcmp(np->name, "u3"))
 		ifunc = interpret_root_props;
 	else if (!((ifunc == interpret_dbdma_props
 		    || ifunc == interpret_macio_props)
@@ -431,10 +431,21 @@
 		 * This doesn't cope with the general case of multiple
 		 * cascaded interrupt controllers, but then neither will
 		 * irq.c at the moment either.  -- paulus
+		 * The G5 triggers that code, I add a machine test. On
+		 * those machines, we want to offset interrupts from the
+		 * second openpic by 128 -- BenH
 		 */
-		if (num_interrupt_controllers > 1 && ic != NULL
+		if (_machine != _MACH_Pmac && num_interrupt_controllers > 1
+		    && ic != NULL
 		    && get_property(ic, "interrupt-parent", NULL) == NULL)
 			offset = 16;
+		else if (_machine == _MACH_Pmac && num_interrupt_controllers > 1
+			 && ic != NULL && ic->parent != NULL) {
+			char *name = get_property(ic->parent, "name", NULL);
+			if (name && !strcmp(name, "u3"))
+				offset = 128;
+		}
+
 		np->intrs[i].line = irq[0] + offset;
 		if (n > 1)
 			np->intrs[i].sense = irq[1];
@@ -1212,8 +1223,6 @@
  * Request an OF device resource. Currently handles child of PCI devices,
  * or other nodes attached to the root node. Ultimately, put some
  * link to resources in the OF node.
- * WARNING: out_resource->name should be initialized before calling this
- * function.
  */
 struct resource* __openfirmware
 request_OF_resource(struct device_node* node, int index, const char* name_postfix)
@@ -1276,7 +1285,7 @@
 {
 	struct pci_dev* pcidev;
 	u8 pci_bus, pci_devfn;
-	unsigned long iomask;
+	unsigned long iomask, start, end;
 	struct device_node* nd;
 	struct resource* parent;
 	struct resource *res = NULL;
@@ -1305,18 +1314,23 @@
 	if (pcidev)
 		parent = find_parent_pci_resource(pcidev, &node->addrs[index]);
 	if (!parent) {
-		printk(KERN_WARNING "request_OF_resource(%s), parent not found\n",
+		printk(KERN_WARNING "release_OF_resource(%s), parent not found\n",
 			node->name);
 		return -ENODEV;
 	}
 
-	/* Find us in the parent */
+	/* Find us in the parent and its childs */
 	res = parent->child;
+	start = node->addrs[index].address;
+	end = start + node->addrs[index].size - 1;
 	while (res) {
-		if (res->start == node->addrs[index].address &&
-		    res->end == (res->start + node->addrs[index].size - 1))
+		if (res->start == start && res->end == end &&
+		    (res->flags & IORESOURCE_BUSY))
 		    	break;
-		res = res->sibling;
+		if (res->start <= start && res->end >= end)
+			res = res->child;
+		else
+			res = res->sibling;
 	}
 	if (!res)
 		return -ENODEV;
--- diff/arch/ppc/syslib/prom_init.c	2003-09-30 15:46:12.000000000 +0100
+++ source/arch/ppc/syslib/prom_init.c	2004-02-09 10:39:51.000000000 +0000
@@ -260,6 +260,74 @@
 	}
 }
 
+#ifdef CONFIG_POWER4
+/*
+ * Set up a hash table with a set of entries in it to map the
+ * first 64MB of RAM.  This is used on 64-bit machines since
+ * some of them don't have BATs.
+ */
+
+static inline void make_pte(unsigned long htab, unsigned int hsize,
+			    unsigned int va, unsigned int pa, int mode)
+{
+	unsigned int *pteg;
+	unsigned int hash, i, vsid;
+
+	vsid = ((va >> 28) * 0x111) << 12;
+	hash = ((va ^ vsid) >> 5) & 0x7fff80;
+	pteg = (unsigned int *)(htab + (hash & (hsize - 1)));
+	for (i = 0; i < 8; ++i, pteg += 4) {
+		if ((pteg[1] & 1) == 0) {
+			pteg[1] = vsid | ((va >> 16) & 0xf80) | 1;
+			pteg[3] = pa | mode;
+			break;
+		}
+	}
+}
+
+extern unsigned long _SDR1;
+extern PTE *Hash;
+extern unsigned long Hash_size;
+
+static void __init
+prom_alloc_htab(void)
+{
+	unsigned int hsize;
+	unsigned long htab;
+	unsigned int addr;
+
+	/*
+	 * Because of OF bugs we can't use the "claim" client
+	 * interface to allocate memory for the hash table.
+	 * This code is only used on 64-bit PPCs, and the only
+	 * 64-bit PPCs at the moment are RS/6000s, and their
+	 * OF is based at 0xc00000 (the 12M point), so we just
+	 * arbitrarily use the 0x800000 - 0xc00000 region for the
+	 * hash table.
+	 *  -- paulus.
+	 */
+	hsize = 4 << 20;	/* POWER4 has no BATs */
+	htab = (8 << 20);
+	call_prom("claim", 3, 1, htab, hsize, 0);
+	Hash = (void *)(htab + KERNELBASE);
+	Hash_size = hsize;
+	_SDR1 = htab + __ilog2(hsize) - 18;
+
+	/*
+	 * Put in PTEs for the first 64MB of RAM
+	 */
+	memset((void *)htab, 0, hsize);
+	for (addr = 0; addr < 0x4000000; addr += 0x1000)
+		make_pte(htab, hsize, addr + KERNELBASE, addr,
+			 _PAGE_ACCESSED | _PAGE_COHERENT | PP_RWXX);
+#if 0 /* DEBUG stuff mapping the SCC */
+	make_pte(htab, hsize, 0x80013000, 0x80013000,
+		 _PAGE_ACCESSED | _PAGE_NO_CACHE | _PAGE_GUARDED | PP_RWXX);
+#endif
+}
+#endif /* CONFIG_POWER4 */
+
+
 /*
  * If we have a display that we don't know how to drive,
  * we will want to try to execute OF's open method for it
@@ -434,13 +502,26 @@
 		address += 0x1000;
 
 #ifdef CONFIG_POWER4
-	extern int boot_text_mapped;
-	btext_setup_display(width, height, depth, pitch, address);
-	boot_text_mapped = 0;
-#else
+	{
+		extern boot_infos_t disp_bi;
+		unsigned long va, pa, i, offset;
+       		va = 0x90000000;
+		pa = address & 0xfffff000ul;
+		offset = address & 0x00000fff;
+
+		for (i=0; i<0x4000; i++) {  
+			make_pte((unsigned long)Hash - KERNELBASE, Hash_size, va, pa, 
+				 _PAGE_ACCESSED | _PAGE_NO_CACHE | _PAGE_GUARDED | PP_RWXX);
+			va += 0x1000;
+			pa += 0x1000;
+		}
+		btext_setup_display(width, height, depth, pitch, 0x90000000 | offset);
+		disp_bi.dispDeviceBase = (u8 *)address;
+	}
+#else /* CONFIG_POWER4 */
 	btext_setup_display(width, height, depth, pitch, address);
 	btext_prepare_BAT();
-#endif
+#endif /* CONFIG_POWER4 */
 #endif /* CONFIG_BOOTX_TEXT */
 }
 
@@ -648,72 +729,6 @@
 	}
 }
 
-#ifdef CONFIG_POWER4
-/*
- * Set up a hash table with a set of entries in it to map the
- * first 64MB of RAM.  This is used on 64-bit machines since
- * some of them don't have BATs.
- * We assume the PTE will fit in the primary PTEG.
- */
-
-static inline void make_pte(unsigned long htab, unsigned int hsize,
-			    unsigned int va, unsigned int pa, int mode)
-{
-	unsigned int *pteg;
-	unsigned int hash, i, vsid;
-
-	vsid = ((va >> 28) * 0x111) << 12;
-	hash = ((va ^ vsid) >> 5) & 0x7fff80;
-	pteg = (unsigned int *)(htab + (hash & (hsize - 1)));
-	for (i = 0; i < 8; ++i, pteg += 4) {
-		if ((pteg[1] & 1) == 0) {
-			pteg[1] = vsid | ((va >> 16) & 0xf80) | 1;
-			pteg[3] = pa | mode;
-			break;
-		}
-	}
-}
-
-extern unsigned long _SDR1;
-extern PTE *Hash;
-extern unsigned long Hash_size;
-
-static void __init
-prom_alloc_htab(void)
-{
-	unsigned int hsize;
-	unsigned long htab;
-	unsigned int addr;
-
-	/*
-	 * Because of OF bugs we can't use the "claim" client
-	 * interface to allocate memory for the hash table.
-	 * This code is only used on 64-bit PPCs, and the only
-	 * 64-bit PPCs at the moment are RS/6000s, and their
-	 * OF is based at 0xc00000 (the 12M point), so we just
-	 * arbitrarily use the 0x800000 - 0xc00000 region for the
-	 * hash table.
-	 *  -- paulus.
-	 */
-	hsize = 4 << 20;	/* POWER4 has no BATs */
-	htab = (8 << 20);
-	call_prom("claim", 3, 1, htab, hsize, 0);
-	Hash = (void *)(htab + KERNELBASE);
-	Hash_size = hsize;
-	_SDR1 = htab + __ilog2(hsize) - 18;
-
-	/*
-	 * Put in PTEs for the first 64MB of RAM
-	 */
-	cacheable_memzero((void *)htab, hsize);
-	for (addr = 0; addr < 0x4000000; addr += 0x1000)
-		make_pte(htab, hsize, addr + KERNELBASE, addr,
-			 _PAGE_ACCESSED | _PAGE_COHERENT | PP_RWXX);
-	make_pte(htab, hsize, 0x80013000, 0x80013000,
-		 _PAGE_ACCESSED | _PAGE_NO_CACHE | _PAGE_GUARDED | PP_RWXX);
-}
-#endif /* CONFIG_POWER4 */
-
 static void __init
 prom_instantiate_rtas(void)
 {
@@ -836,9 +851,10 @@
 	 * loaded by an OF bootloader which did set a BAT for us.
 	 * This breaks OF translate so we force phys to be 0.
 	 */
-	if (offset == 0)
+	if (offset == 0) {
+		prom_print("(already at 0xc0000000) phys=0\n");
 		phys = 0;
-	else if ((int) call_prom("getprop", 4, 1, prom_chosen, "mmu",
+	} else if ((int) call_prom("getprop", 4, 1, prom_chosen, "mmu",
 				 &prom_mmu, sizeof(prom_mmu)) <= 0) {
 		prom_print(" no MMU found\n");
 	} else if ((int)call_prom_ret("call-method", 4, 4, result, "translate",
--- diff/arch/ppc64/Kconfig	2004-02-09 10:36:07.000000000 +0000
+++ source/arch/ppc64/Kconfig	2004-02-09 10:39:51.000000000 +0000
@@ -251,54 +251,10 @@
 
 endmenu
 
-source "drivers/base/Kconfig"
-
-source "drivers/mtd/Kconfig"
-
-source "drivers/parport/Kconfig"
-
-source "drivers/pnp/Kconfig"
-
-source "drivers/block/Kconfig"
-
-source "drivers/ide/Kconfig"
-
-source "drivers/scsi/Kconfig"
-
-source "drivers/md/Kconfig"
-
-source "drivers/message/fusion/Kconfig"
-
-source "drivers/ieee1394/Kconfig"
-
-source "drivers/message/i2o/Kconfig"
-
-source "net/Kconfig"
-
-source "drivers/isdn/Kconfig"
-
-source "drivers/telephony/Kconfig"
-
-#
-# input before char - char/joystick depends on it. As does USB.
-#
-source "drivers/input/Kconfig"
-
-source "drivers/char/Kconfig"
-
-source "drivers/i2c/Kconfig"
-
-source "drivers/media/Kconfig"
+source "drivers/Kconfig"
 
 source "fs/Kconfig"
 
-source "drivers/video/Kconfig"
-
-source "sound/Kconfig"
-
-source "drivers/usb/Kconfig"
-
-
 menu "iSeries device drivers"
 	depends on PPC_ISERIES
 
@@ -401,6 +357,13 @@
 	  debugging info resulting in a larger kernel image.
 	  Say Y here only if you plan to use gdb to debug the kernel.
 	  If you don't debug the kernel, you can say N.
+
+config DEBUG_SPINLOCK_SLEEP
+	bool "Sleep-inside-spinlock checking"
+	depends on DEBUG_KERNEL
+	help
+	  If you say Y here, various routines which may sleep will become very
+	  noisy if they are called with a spinlock held.
 	  
 endmenu
 
--- diff/arch/ppc64/kernel/Makefile	2004-02-09 10:36:07.000000000 +0000
+++ source/arch/ppc64/kernel/Makefile	2004-02-09 10:39:51.000000000 +0000
@@ -39,6 +39,6 @@
 obj-$(CONFIG_SCANLOG)		+= scanlog.o
 obj-$(CONFIG_VIOPATH)		+= viopath.o
 obj-$(CONFIG_LPARCFG)		+= lparcfg.o
-
+obj-$(CONFIG_HVC_CONSOLE)   += hvconsole.o
 
 CFLAGS_ioctl32.o += -Ifs/
--- diff/arch/ppc64/kernel/head.S	2004-02-09 10:36:08.000000000 +0000
+++ source/arch/ppc64/kernel/head.S	2004-02-09 10:39:51.000000000 +0000
@@ -52,7 +52,7 @@
 /*
  * hcall interface to pSeries LPAR
  */
-#define HSC .long 0x44000022
+#define HVSC .long 0x44000022
 #define H_SET_ASR		0x30
 
 /*
@@ -1743,7 +1743,7 @@
 	cmpwi	r3,0x34         /* Pulsar */
 	bne	98f
 97:	li	r3,H_SET_ASR    /* hcall = H_SET_ASR */
-	HSC     		/* Invoking hcall */
+	HVSC     		/* Invoking hcall */
 	b	99f
 98:                             /* !(rpa hypervisor) || !(star)  */
 	mtasr	r4	        /* set the stab location         */
@@ -1912,7 +1912,7 @@
 	cmpwi	r3,0x34         /* Pulsar */
 	bne	98f
 97:	li	r3,H_SET_ASR    /* hcall = H_SET_ASR */
-	HSC     	        /* Invoking hcall */
+	HVSC     	        /* Invoking hcall */
 	b     	99f
 98:                             /* !(rpa hypervisor) || !(star) */
 	mtasr	r4	        /* set the stab location         */
--- diff/arch/ppc64/kernel/iSeries_htab.c	2004-02-09 10:36:08.000000000 +0000
+++ source/arch/ppc64/kernel/iSeries_htab.c	2004-02-09 10:39:51.000000000 +0000
@@ -109,6 +109,12 @@
 	return -1;
 }
 
+/*
+ * The HyperVisor expects the "flags" argument in this form:
+ * 	bits  0..59 : reserved
+ * 	bit      60 : N
+ * 	bits 61..63 : PP2,PP1,PP0
+ */
 static long iSeries_hpte_updatepp(unsigned long slot, unsigned long newpp,
 				  unsigned long va, int large, int local)
 {
@@ -117,7 +123,7 @@
 
 	HvCallHpt_get(&hpte, slot);
 	if ((hpte.dw0.dw0.avpn == avpn) && (hpte.dw0.dw0.v)) {
-		HvCallHpt_setPp(slot, newpp);
+		HvCallHpt_setPp(slot, (newpp & 0x3) | ((newpp & 0x4) << 1));
 		return 0;
 	}
 	return -1;
--- diff/arch/ppc64/kernel/idle.c	2004-02-09 10:36:08.000000000 +0000
+++ source/arch/ppc64/kernel/idle.c	2004-02-09 10:39:51.000000000 +0000
@@ -161,7 +161,7 @@
 	struct paca_struct *lpaca = get_paca(), *ppaca;
 	unsigned long start_snooze;
 
-	ppaca = &paca[(lpaca->xPacaIndex) ^ 1];
+	ppaca = &paca[smp_processor_id() ^ 1];
 
 	while (1) {
 		/* Indicate to the HV that we are idle.  Now would be
--- diff/arch/ppc64/kernel/lparcfg.c	2004-02-09 10:36:08.000000000 +0000
+++ source/arch/ppc64/kernel/lparcfg.c	2004-02-09 10:39:51.000000000 +0000
@@ -134,7 +134,7 @@
 	memset(buf, 0, size); 
 
 	shared = (int)(lpaca->xLpPacaPtr->xSharedProc);
-	n += snprintf(buf, LPARCFG_BUFF_SIZE - n,
+	n += scnprintf(buf, LPARCFG_BUFF_SIZE - n,
 		      "serial_number=%c%c%c%c%c%c%c\n", 
 		      e2a(xItExtVpdPanel.mfgID[2]),
 		      e2a(xItExtVpdPanel.mfgID[3]),
@@ -144,7 +144,7 @@
 		      e2a(xItExtVpdPanel.systemSerial[4]),
 		      e2a(xItExtVpdPanel.systemSerial[5])); 
 
-	n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, 
+	n += scnprintf(buf+n, LPARCFG_BUFF_SIZE - n,
 		      "system_type=%c%c%c%c\n",
 		      e2a(xItExtVpdPanel.machineType[0]),
 		      e2a(xItExtVpdPanel.machineType[1]),
@@ -152,23 +152,23 @@
 		      e2a(xItExtVpdPanel.machineType[3])); 
 
 	lp_index = HvLpConfig_getLpIndex(); 
-	n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, 
+	n += scnprintf(buf+n, LPARCFG_BUFF_SIZE - n,
 		      "partition_id=%d\n", (int)lp_index); 
 
-	n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, 
+	n += scnprintf(buf+n, LPARCFG_BUFF_SIZE - n,
 		      "system_active_processors=%d\n", 
 		      (int)HvLpConfig_getSystemPhysicalProcessors()); 
 
-	n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, 
+	n += scnprintf(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, 
+	n += scnprintf(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, 
+	n += scnprintf(buf+n, LPARCFG_BUFF_SIZE - n,
 		      "partition_potential_processors=%d\n", max_processors);  
 
 	if(shared) {
@@ -178,22 +178,22 @@
 		entitled_capacity = processors * 100; 
 		max_entitled_capacity = max_processors * 100; 
 	}
-	n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, 
+	n += scnprintf(buf+n, LPARCFG_BUFF_SIZE - n,
 		      "partition_entitled_capacity=%d\n", entitled_capacity);
 
-	n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, 
+	n += scnprintf(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", 
+		n += scnprintf(buf+n, LPARCFG_BUFF_SIZE - n, "pool=%d\n",
 			      (int)pool_id); 
-		n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, 
+		n += scnprintf(buf+n, LPARCFG_BUFF_SIZE - n,
 			      "pool_capacity=%d\n", (int)(HvLpConfig_getNumProcsInSharedPool(pool_id)*100)); 
 	}
 
-	n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, 
+	n += scnprintf(buf+n, LPARCFG_BUFF_SIZE - n,
 		      "shared_processor_mode=%d\n", shared);
 
 	return 0;
@@ -297,13 +297,13 @@
 		if(lp_index_ptr) lp_index = *lp_index_ptr;
 	}
 
-	n  = snprintf(buf, LPARCFG_BUFF_SIZE - n,
+	n  = scnprintf(buf, LPARCFG_BUFF_SIZE - n,
 		      "serial_number=%s\n", system_id); 
 
-	n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, 
+	n += scnprintf(buf+n, LPARCFG_BUFF_SIZE - n,
 		      "system_type=%s\n", model); 
 
-	n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, 
+	n += scnprintf(buf+n, LPARCFG_BUFF_SIZE - n,
 		      "partition_id=%d\n", (int)lp_index); 
 
 	rtas_node = find_path_device("/rtas");
@@ -317,74 +317,74 @@
 	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, 
+		n += scnprintf(buf+n, LPARCFG_BUFF_SIZE - n,
 			      "R4=0x%lx\n", h_entitled);
-		n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, 
+		n += scnprintf(buf+n, LPARCFG_BUFF_SIZE - n,
 			      "R5=0x%lx\n", h_unallocated);
-		n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, 
+		n += scnprintf(buf+n, LPARCFG_BUFF_SIZE - n,
 			      "R6=0x%lx\n", h_aggregation);
-		n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, 
+		n += scnprintf(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", 
+		n += scnprintf(buf+n, LPARCFG_BUFF_SIZE - n,
+			      "system_active_processors=%ld\n", 
 			      (h_resource >> 2*8) & 0xffff);
-		n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, 
+		n += scnprintf(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, 
+		n += scnprintf(buf+n, LPARCFG_BUFF_SIZE - n,
 			      "system_active_processors=%d\n", 
 			      system_active_processors);
-		n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, 
+		n += scnprintf(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, 
+	n += scnprintf(buf+n, LPARCFG_BUFF_SIZE - n,
 		      "partition_active_processors=%d\n", processors);  
-	n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, 
+	n += scnprintf(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, 
+		n += scnprintf(buf+n, LPARCFG_BUFF_SIZE - n,
 			      "partition_entitled_capacity=%ld\n", h_entitled);
 	} else {
-		n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, 
+		n += scnprintf(buf+n, LPARCFG_BUFF_SIZE - n,
 			      "partition_entitled_capacity=%d\n", system_active_processors*100);
 	}
 
-	n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, 
+	n += scnprintf(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, 
+	n += scnprintf(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 += scnprintf(buf+n, LPARCFG_BUFF_SIZE - n,
+			      "pool=%ld\n", (h_aggregation >> 0*8)&0xffff);
 
-		n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, 
-			      "pool_capacity=%d\n", (h_resource >> 3*8) &0xffff);
+		n += scnprintf(buf+n, LPARCFG_BUFF_SIZE - n,
+			      "pool_capacity=%ld\n", (h_resource >> 3*8) &0xffff);
 
-		n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, 
-			      "group=%d\n", (h_aggregation >> 2*8)&0xffff);
+		n += scnprintf(buf+n, LPARCFG_BUFF_SIZE - n,
+			      "group=%ld\n", (h_aggregation >> 2*8)&0xffff);
 
-		n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, 
-			      "capped=%d\n", (h_resource >> 6*8)&0x40);
+		n += scnprintf(buf+n, LPARCFG_BUFF_SIZE - n,
+			      "capped=%ld\n", (h_resource >> 6*8)&0x40);
 
-		n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, 
+		n += scnprintf(buf+n, LPARCFG_BUFF_SIZE - n,
 			      "capacity_weight=%d\n", (int)(h_resource>>5*8)&0xFF);
 	}
 	return 0;
--- diff/arch/ppc64/kernel/pSeries_hvCall.S	2004-02-09 10:36:08.000000000 +0000
+++ source/arch/ppc64/kernel/pSeries_hvCall.S	2004-02-09 10:39:51.000000000 +0000
@@ -22,7 +22,7 @@
 /*
  * hcall interface to pSeries LPAR
  */
-#define HSC .long 0x44000022
+#define HVSC .long 0x44000022
 
 /* long plpar_hcall(unsigned long opcode,	 R3 
 		 unsigned long arg1,		 R4 
@@ -44,7 +44,7 @@
         std     r9,-16(r1)
         std     r10,-24(r1)
 	
-	HSC                     /* invoke the hypervisor */
+	HVSC                    /* invoke the hypervisor */
 
         ld      r10,-8(r1)      /* Fetch r4-r7 ret args. */
         std     r4,0(r10)
@@ -63,7 +63,7 @@
 _GLOBAL(plpar_hcall_norets)
 	mfcr	r0
 	std	r0,-8(r1)
-	HSC                     /* invoke the hypervisor */
+	HVSC                    /* invoke the hypervisor */
 	ld	r0,-8(r1)
 	mtcrf	0xff,r0
 	blr                     /* return r3 = status */
@@ -94,7 +94,7 @@
 
         std     r12,-8(r1)      /* Save out ptr */
 	
-	HSC                    /* invoke the hypervisor */
+	HVSC                    /* invoke the hypervisor */
 
         ld      r10,-8(r1)      /* Fetch r4 ret arg */
         std     r4,0(r10)
@@ -126,7 +126,7 @@
 	std     r10,16(r1)
 	std     r14,8(r1)
 	
-	HSC                    /* invoke the hypervisor */
+	HVSC                    /* invoke the hypervisor */
 
 	ld      r14,32(r1)      /* Fetch r4-r7 ret args. */
 	std     r4,0(r14)
--- diff/arch/ppc64/kernel/pSeries_lpar.c	2004-02-09 10:36:08.000000000 +0000
+++ source/arch/ppc64/kernel/pSeries_lpar.c	2004-02-09 10:39:51.000000000 +0000
@@ -313,69 +313,6 @@
 	}
 }
 
-int hvc_get_chars(int index, char *buf, int count)
-{
-	unsigned long got;
-
-	if (plpar_hcall(H_GET_TERM_CHAR, index, 0, 0, 0, &got,
-		(unsigned long *)buf, (unsigned long *)buf+1) == H_Success) {
-		/*
-		 * Work around a HV bug where it gives us a null
-		 * after every \r.  -- paulus
-		 */
-		if (got > 0) {
-			int i;
-			for (i = 1; i < got; ++i) {
-				if (buf[i] == 0 && buf[i-1] == '\r') {
-					--got;
-					if (i < got)
-						memmove(&buf[i], &buf[i+1],
-							got - i);
-				}
-			}
-		}
-		return got;
-	}
-	return 0;
-}
-
-int hvc_put_chars(int index, const char *buf, int count)
-{
-	unsigned long *lbuf = (unsigned long *) buf;
-	long ret;
-
-	ret = plpar_hcall_norets(H_PUT_TERM_CHAR, index, count, lbuf[0],
-				 lbuf[1]);
-	if (ret == H_Success)
-		return count;
-	if (ret == H_Busy)
-		return 0;
-	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)
-{
-	struct device_node *vty;
-	int num_found = 0;
-
-	/* 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 num_found;
-}
-
 long pSeries_lpar_hpte_insert(unsigned long hpte_group,
 			      unsigned long va, unsigned long prpn,
 			      int secondary, unsigned long hpteflags,
--- diff/arch/ppc64/kernel/pSeries_pci.c	2004-02-09 10:36:08.000000000 +0000
+++ source/arch/ppc64/kernel/pSeries_pci.c	2004-02-09 10:39:51.000000000 +0000
@@ -721,3 +721,29 @@
 	}
 	return NULL;
 }
+
+/*
+ * ppc64 can have multifunction devices that do not respond to function 0.
+ * In this case we must scan all functions.
+ */
+int
+pcibios_scan_all_fns(struct pci_bus *bus, int devfn)
+{
+       struct device_node *busdn, *dn;
+
+       if (bus->self)
+               busdn = pci_device_to_OF_node(bus->self);
+       else
+               busdn = bus->sysdata;   /* must be a phb */
+
+       /*
+        * Check to see if there is any of the 8 functions are in the
+        * device tree.  If they are then we need to scan all the
+        * functions of this slot.
+        */
+       for (dn = busdn->child; dn; dn = dn->sibling)
+               if ((dn->devfn >> 3) == (devfn >> 3))
+                       return 1;
+
+       return 0;
+}
--- diff/arch/ppc64/kernel/proc_ppc64.c	2004-02-09 10:36:09.000000000 +0000
+++ source/arch/ppc64/kernel/proc_ppc64.c	2004-02-09 10:39:51.000000000 +0000
@@ -268,12 +268,10 @@
 static int do_remove_node(char *buf)
 {
 	struct device_node *node;
-	int rv = 0;
+	int rv = -ENODEV;
 
 	if ((node = of_find_node_by_path(buf)))
-		of_remove_node(node);
-	else
-		rv = -ENODEV;
+		rv = of_remove_node(node);
 
 	of_node_put(node);
 	return rv;
--- diff/arch/ppc64/kernel/prom.c	2004-02-09 10:36:09.000000000 +0000
+++ source/arch/ppc64/kernel/prom.c	2004-02-09 10:39:51.000000000 +0000
@@ -2507,29 +2507,48 @@
 
 /*
  * Remove an OF device node from the system.
+ * Caller should have already "gotten" np.
  */
 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);
+
+	if (!parent)
 		return -EINVAL;
+
+	/* Make sure we are not recursively removing
+	 * more than one level of nodes.  We need to
+	 * allow this so we can remove a slot containing
+	 * an IOA.
+	 */
+	for (child = of_get_next_child(np, NULL);
+	     child != NULL;
+	     child = of_get_next_child(np, child)) {
+		struct device_node *grandchild;
+
+		if ((grandchild = of_get_next_child(child, NULL))) {
+			/* Too deep */
+			of_node_put(grandchild);
+			of_node_put(child);
+			return -EBUSY;
+		}
+	}
+
+	/* Now that we're reasonably sure that we won't
+	 * overflow our stack, remove any children of np.
+	 */
+	for (child = of_get_next_child(np, NULL);
+	     child != NULL;
+	     child = of_get_next_child(np, child)) {
+		int rc;
+
+		if ((rc = of_remove_node(child))) {
+			of_node_put(child);
+			return rc;
+		}
 	}
-	of_node_put(child);
 
 	write_lock(&devtree_lock);
 	OF_MARK_STALE(np);
@@ -2545,8 +2564,8 @@
 		prev->allnext = np->allnext;
 	}
 
-	if (np->parent->child == np)
-		np->parent->child = np->sibling;
+	if (parent->child == np)
+		parent->child = np->sibling;
 	else {
 		struct device_node *prevsib;
 		for (prevsib = np->parent->child;
--- diff/arch/ppc64/kernel/rtas-proc.c	2004-02-09 10:36:09.000000000 +0000
+++ source/arch/ppc64/kernel/rtas-proc.c	2004-02-09 10:39:51.000000000 +0000
@@ -285,13 +285,13 @@
 		size_t count, loff_t *ppos)
 {
 	char stkbuf[40];  /* its small, its on stack */
-	int n;
+	int n, sn;
 	if (power_on_time == 0)
-		n = snprintf(stkbuf, 40, "Power on time not set\n");
+		n = scnprintf(stkbuf,sizeof(stkbuf),"Power on time not set\n");
 	else
-		n = snprintf(stkbuf, 40, "%lu\n", power_on_time);
+		n = scnprintf(stkbuf,sizeof(stkbuf),"%lu\n",power_on_time);
 
-	int sn = strlen (stkbuf) +1;
+	sn = strlen (stkbuf) +1;
 	if (*ppos >= sn)
 		return 0;
 	if (n > sn - *ppos)
@@ -331,18 +331,19 @@
 static ssize_t ppc_rtas_progress_read(struct file * file, char * buf,
 		size_t count, loff_t *ppos)
 {
-	int n = 0;
+	int sn, n = 0;
+	char *tmpbuf;
 
 	if (progress_led == NULL) return 0;
 
-	char * tmpbuf = kmalloc (MAX_LINELENGTH, GFP_KERNEL);
+	tmpbuf = kmalloc (MAX_LINELENGTH, GFP_KERNEL);
 	if (!tmpbuf) {
 		printk(KERN_ERR "error: kmalloc failed\n");
 		return -ENOMEM;
 	}
 	n = sprintf (tmpbuf, "%s\n", progress_led);
 
-	int sn = strlen (tmpbuf) +1;
+	sn = strlen (tmpbuf) +1;
 	if (*ppos >= sn) {
 		kfree (tmpbuf);
 		return 0;
@@ -398,25 +399,25 @@
 {
 	unsigned int year, mon, day, hour, min, sec;
 	unsigned long *ret = kmalloc(4*8, GFP_KERNEL);
-	int n, error;
+	int n, sn, error;
+	char stkbuf[40];  /* its small, its on stack */
 
 	error = rtas_call(rtas_token("get-time-of-day"), 0, 8, ret);
 	
 	year = ret[0]; mon  = ret[1]; day  = ret[2];
 	hour = ret[3]; min  = ret[4]; sec  = ret[5];
 
-	char stkbuf[40];  /* its small, its on stack */
-
 	if (error != 0){
 		printk(KERN_WARNING "error: reading the clock returned: %s\n", 
 				ppc_rtas_process_error(error));
-		n = snprintf (stkbuf, 40, "0");
+		n = scnprintf (stkbuf, sizeof(stkbuf), "0");
 	} else { 
-		n = snprintf (stkbuf, 40, "%lu\n", mktime(year, mon, day, hour, min, sec));
+		n = scnprintf (stkbuf, sizeof(stkbuf), "%lu\n",
+				mktime(year, mon, day, hour, min, sec));
 	}
 	kfree(ret);
 
-	int sn = strlen (stkbuf) +1;
+	sn = strlen (stkbuf) +1;
 	if (*ppos >= sn)
 		return 0;
 	if (n > sn - *ppos)
@@ -819,7 +820,7 @@
 		n += check_location_string(ret, buffer + n);
 		n += sprintf ( buffer+n, " ");
 		/* see how many characters we have printed */
-		snprintf ( t, 50, "%s ", ret);
+		scnprintf(t, sizeof(t), "%s ", ret);
 
 		pos += strlen(t);
 		if (pos >= llen) pos=0;
@@ -860,11 +861,12 @@
 static ssize_t ppc_rtas_tone_freq_read(struct file * file, char * buf,
 		size_t count, loff_t *ppos)
 {
-	int n;
+	int n, sn;
 	char stkbuf[40];  /* its small, its on stack */
-	n = snprintf(stkbuf, 40, "%lu\n", rtas_tone_frequency);
 
-	int sn = strlen (stkbuf) +1;
+	n = scnprintf(stkbuf, 40, "%lu\n", rtas_tone_frequency);
+
+	sn = strlen (stkbuf) +1;
 	if (*ppos >= sn)
 		return 0;
 	if (n > sn - *ppos)
@@ -913,11 +915,12 @@
 static ssize_t ppc_rtas_tone_volume_read(struct file * file, char * buf,
 		size_t count, loff_t *ppos)
 {
-	int n;
+	int n, sn;
 	char stkbuf[40];  /* its small, its on stack */
-	n = snprintf(stkbuf, 40, "%lu\n", rtas_tone_volume);
 
-	int sn = strlen (stkbuf) +1;
+	n = scnprintf(stkbuf, 40, "%lu\n", rtas_tone_volume);
+
+	sn = strlen (stkbuf) +1;
 	if (*ppos >= sn)
 		return 0;
 	if (n > sn - *ppos)
--- diff/arch/ppc64/kernel/setup.c	2004-02-09 10:36:09.000000000 +0000
+++ source/arch/ppc64/kernel/setup.c	2004-02-09 10:39:51.000000000 +0000
@@ -283,6 +283,10 @@
 unsigned long ppc_proc_freq;
 unsigned long ppc_tb_freq;
 
+#ifdef CONFIG_SMP
+DEFINE_PER_CPU(unsigned int, pvr);
+#endif
+
 static int show_cpuinfo(struct seq_file *m, void *v)
 {
 	unsigned long cpu_id = (unsigned long)v - 1;
@@ -302,7 +306,7 @@
 		return 0;
 
 #ifdef CONFIG_SMP
-	pvr = paca[cpu_id].pvr;
+	pvr = per_cpu(pvr, cpu_id);
 #else
 	pvr = _get_PVR();
 #endif
--- diff/arch/ppc64/kernel/smp.c	2004-02-09 10:36:09.000000000 +0000
+++ source/arch/ppc64/kernel/smp.c	2004-02-09 10:39:51.000000000 +0000
@@ -575,9 +575,11 @@
 
 struct thread_info *current_set[NR_CPUS];
 
+DECLARE_PER_CPU(unsigned int, pvr);
+
 static void __devinit smp_store_cpu_info(int id)
 {
-	paca[id].pvr = _get_PVR();
+	per_cpu(pvr, id) = _get_PVR();
 }
 
 void __init smp_prepare_cpus(unsigned int max_cpus)
--- diff/arch/ppc64/kernel/stab.c	2004-02-09 10:36:09.000000000 +0000
+++ source/arch/ppc64/kernel/stab.c	2004-02-09 10:39:51.000000000 +0000
@@ -141,8 +141,7 @@
 	return (global_entry | (castout_entry & 0x7));
 }
 
-static inline void __ste_allocate(unsigned long esid, unsigned long vsid,
-				  mm_context_t context)
+static inline void __ste_allocate(unsigned long esid, unsigned long vsid)
 {
 	unsigned char stab_entry;
 	unsigned long *offset;
@@ -185,7 +184,7 @@
 	}
 
 	esid = GET_ESID(ea);
-	__ste_allocate(esid, vsid, context);
+	__ste_allocate(esid, vsid);
 	/* Order update */
 	asm volatile("sync":::"memory");
 
@@ -215,7 +214,7 @@
 	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);
+	__ste_allocate(pc_esid, vsid);
 
 	if (pc_esid == stack_esid)
 		return;
@@ -223,7 +222,7 @@
 	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);
+	__ste_allocate(stack_esid, vsid);
 
 	if (pc_esid == unmapped_base_esid || stack_esid == unmapped_base_esid)
 		return;
@@ -232,7 +231,7 @@
 	    (REGION_ID(unmapped_base) >= KERNEL_REGION_ID))
 		return;
 	vsid = get_vsid(mm->context, unmapped_base);
-	__ste_allocate(unmapped_base_esid, vsid, mm->context);
+	__ste_allocate(unmapped_base_esid, vsid);
 
 	/* Order update */
 	asm volatile("sync" : : : "memory");
--- diff/arch/ppc64/kernel/time.c	2004-02-09 10:36:09.000000000 +0000
+++ source/arch/ppc64/kernel/time.c	2004-02-09 10:39:51.000000000 +0000
@@ -267,7 +267,7 @@
 	int next_dec;
 	unsigned long cur_tb;
 	struct paca_struct *lpaca = get_paca();
-	unsigned long cpu = lpaca->xPacaIndex;
+	unsigned long cpu = smp_processor_id();
 
 	irq_enter();
 
--- diff/arch/ppc64/kernel/vio.c	2004-02-09 10:36:09.000000000 +0000
+++ source/arch/ppc64/kernel/vio.c	2004-02-09 10:39:51.000000000 +0000
@@ -4,6 +4,7 @@
  *    Copyright (c) 2003 IBM Corp.
  *     Dave Engebretsen engebret@us.ibm.com
  *     Santiago Leon santil@us.ibm.com
+ *     Hollis Blanchard <hollisb@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
@@ -16,14 +17,16 @@
 #include <linux/pci.h>
 #include <linux/version.h>
 #include <linux/module.h>
+#include <linux/kobject.h>
+#include <linux/mm.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 */
+
+#define DBGENTER() pr_debug("%s entered\n", __FUNCTION__)
 
 extern struct TceTable *build_tce_table(struct TceTable *tbl);
 
@@ -32,83 +35,74 @@
 extern void tce_free(struct TceTable *tbl, dma_addr_t dma_addr,
 		     unsigned order, unsigned num_pages);
 
+static int vio_num_address_cells;
+static struct vio_dev *vio_bus_device; /* fake "parent" device */
 
-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
- */
+/* convert from struct device to struct vio_dev and pass to driver.
+ * dev->driver has already been set by generic code because vio_bus_match
+ * succeeded. */
+static int vio_bus_probe(struct device *dev)
+{
+	struct vio_dev *viodev = to_vio_dev(dev);
+	struct vio_driver *viodrv = to_vio_driver(dev->driver);
+	const struct vio_device_id *id;
+	int error = -ENODEV;
+
+	DBGENTER();
+
+	if (!viodrv->probe)
+		return error;
+
+	id = vio_match_device(viodrv->id_table, viodev);
+	if (id) {
+		error = viodrv->probe(viodev, id);
+	}
+
+	return error;
+}
+
+/* convert from struct device to struct vio_dev and pass to driver. */
+static int vio_bus_remove(struct device *dev)
+{
+	struct vio_dev *viodev = to_vio_dev(dev);
+	struct vio_driver *viodrv = to_vio_driver(dev->driver);
+
+	DBGENTER();
+
+	if (viodrv->remove) {
+		return viodrv->remove(viodev);
+	}
+
+	/* driver can't remove */
+	return 1;
+}
 
 /**
  * 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 vio_register_driver(struct vio_driver *viodrv)
 {
-	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++;
-			}
-		}
-	}
+	printk(KERN_DEBUG "%s: driver %s registering\n", __FUNCTION__,
+		viodrv->name);
 
-	list_add_tail(&drv->node, &registered_vio_drivers);
+	/* fill in 'struct driver' fields */
+	viodrv->driver.name = viodrv->name;
+	viodrv->driver.bus = &vio_bus_type;
+	viodrv->driver.probe = vio_bus_probe;
+	viodrv->driver.remove = vio_bus_remove;
 
-	return count;
+	return driver_register(&viodrv->driver);
 }
 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)
+void vio_unregister_driver(struct vio_driver *viodrv)
 {
-	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;
+	driver_unregister(&viodrv->driver);
 }
 EXPORT_SYMBOL(vio_unregister_driver);
 
@@ -121,9 +115,11 @@
  * 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)
+const struct vio_device_id * vio_match_device(const struct vio_device_id *ids,
+	const struct vio_dev *dev)
 {
+	DBGENTER();
+
 	while (ids->type) {
 		if ((strncmp(dev->archdata->type, ids->type, strlen(ids->type)) == 0) &&
 			device_is_compatible((struct device_node*)dev->archdata, ids->compat))
@@ -136,18 +132,33 @@
 /**
  * vio_bus_init: - Initialize the virtual IO bus
  */
-int __init
-vio_bus_init(void)
+static int __init vio_bus_init(void)
 {
-	struct device_node *node_vroot, *node_vdev;
+	struct device_node *node_vroot, *of_node;
+	int err;
 
-	INIT_LIST_HEAD(&vio_bus.devices);
+	err = bus_register(&vio_bus_type);
+	if (err) {
+		printk(KERN_ERR "failed to register VIO bus\n");
+		return err;
+	}
+
+	/* the fake parent of all vio devices, just to give us a nice directory */
+	vio_bus_device = kmalloc(sizeof(struct vio_dev), GFP_KERNEL);
+	if (!vio_bus_device) {
+		return 1;
+	}
+	memset(vio_bus_device, 0, sizeof(struct vio_dev));
+	strcpy(vio_bus_device->dev.bus_id, "vdevice");
+
+	err = device_register(&vio_bus_device->dev);
+	if (err) {
+		printk(KERN_WARNING "%s: device_register returned %i\n", __FUNCTION__,
+			err);
+		kfree(vio_bus_device);
+		return err;
+	}
 
-	/*
-	 * 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"
@@ -157,12 +168,16 @@
 
 	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);
+	/*
+	 * Create struct vio_devices for each virtual device in the device tree.
+	 * Drivers will associate with them later.
+	 */
+	for (of_node = node_vroot->child;
+			of_node != NULL;
+			of_node = of_node->sibling) {
+		printk(KERN_DEBUG "%s: processing %p\n", __FUNCTION__, of_node);
 
-		vio_register_device(node_vdev);
+		vio_register_device(of_node);
 	}
 
 	return 0;
@@ -171,98 +186,91 @@
 __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)
+/* vio_dev refcount hit 0 */
+static void __devinit vio_dev_release(struct device *dev)
 {
-	struct vio_driver *driver;
-
-	list_for_each_entry(driver, &registered_vio_drivers, node) {
-		const struct vio_device_id* id;
+	struct vio_dev *viodev = to_vio_dev(dev);
 
-		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;
-		}
-	}
+	DBGENTER();
 
-	printk(KERN_DEBUG "%s: device %p found no driver\n", __FUNCTION__, dev);
-	return NULL;
+	/* XXX free TCE table */
+	of_node_put(viodev->archdata);
+	kfree(viodev);
 }
 
 /**
  * vio_register_device: - Register a new vio device.
- * @archdata:	The OF node for this device.
+ * @of_node:	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.
+ * of_node (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 * __devinit vio_register_device(struct device_node *of_node)
 {
-	struct vio_dev *dev;
+	struct vio_dev *viodev;
 	unsigned int *unit_address;
 	unsigned int *irq_p;
 
-	/* guarantee all vio_devs have 'device_type' field*/
-	if ((NULL == node_vdev->type)) {
+	DBGENTER();
+
+	/* we need the 'device_type' property, in order to match with drivers */
+	if ((NULL == of_node->type)) {
 		printk(KERN_WARNING
 			"%s: node %s missing 'device_type'\n", __FUNCTION__,
-			node_vdev->name ? node_vdev->name : "<unknown>");
+			of_node->name ? of_node->name : "<unknown>");
 		return NULL;
 	}
 
-	unit_address = (unsigned int *)get_property(node_vdev, "reg", NULL);
+	unit_address = (unsigned int *)get_property(of_node, "reg", NULL);
 	if (!unit_address) {
 		printk(KERN_WARNING "%s: node %s missing 'reg'\n", __FUNCTION__,
-			node_vdev->name ? node_vdev->name : "<unknown>");
+			of_node->name ? of_node->name : "<unknown>");
 		return NULL;
 	}
 
 	/* allocate a vio_dev for this node */
-	dev = kmalloc(sizeof(*dev), GFP_KERNEL);
-	if (!dev)
+	viodev = kmalloc(sizeof(struct vio_dev), GFP_KERNEL);
+	if (!viodev) {
 		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;
 	}
+	memset(viodev, 0, sizeof(struct vio_dev));
 
-	list_add_tail(&dev->devices_list, &vio_bus.devices);
-
-	vio_probe_device(dev); /* finally, assign it to a driver */
+	viodev->archdata = (void *)of_node_get(of_node);
+	viodev->unit_address = *unit_address;
+	viodev->tce_table = vio_build_tce_table(viodev);
+
+	viodev->irq = (unsigned int) -1;
+	irq_p = (unsigned int *)get_property(of_node, "interrupts", 0);
+	if (irq_p) {
+		viodev->irq = irq_offset_up(*irq_p);
+	}
+
+	/* init generic 'struct device' fields: */
+	viodev->dev.parent = &vio_bus_device->dev;
+	viodev->dev.bus = &vio_bus_type;
+	snprintf(viodev->dev.bus_id, BUS_ID_SIZE, "%s@%lx",
+		of_node->name, viodev->unit_address);
+	viodev->dev.release = vio_dev_release;
+
+	/* register with generic device framework */
+	if (device_register(&viodev->dev)) {
+		printk(KERN_ERR "%s: failed to register device %s\n", __FUNCTION__,
+			viodev->dev.bus_id);
+		/* XXX free TCE table */
+		kfree(viodev);
+		return NULL;
+	}
 
-	return dev;
+	return viodev;
 }
 EXPORT_SYMBOL(vio_register_device);
 
-int __devinit vio_unregister_device(struct vio_dev *dev)
+void __devinit vio_unregister_device(struct vio_dev *viodev)
 {
-	list_del(&dev->devices_list);
-	of_node_put(dev->archdata);
-
-	return 0;
+	DBGENTER();
+	device_unregister(&viodev->dev);
 }
 EXPORT_SYMBOL(vio_unregister_device);
 
@@ -532,5 +540,29 @@
 }
 EXPORT_SYMBOL(vio_free_consistent);
 
+static int vio_bus_match(struct device *dev, struct device_driver *drv)
+{
+	const struct vio_dev *vio_dev = to_vio_dev(dev);
+	struct vio_driver *vio_drv = to_vio_driver(drv);
+	const struct vio_device_id *ids = vio_drv->id_table;
+	const struct vio_device_id *found_id;
+
+	DBGENTER();
+
+	if (!ids)
+		return 0;
+
+	found_id = vio_match_device(ids, vio_dev);
+	if (found_id)
+		return 1;
+
+	return 0;
+}
+
+struct bus_type vio_bus_type = {
+	.name = "vio",
+	.match = vio_bus_match,
+};
+
 EXPORT_SYMBOL(plpar_hcall_norets);
 EXPORT_SYMBOL(plpar_hcall_8arg_2ret);
--- diff/arch/ppc64/mm/numa.c	2004-02-09 10:36:09.000000000 +0000
+++ source/arch/ppc64/mm/numa.c	2004-02-09 10:39:51.000000000 +0000
@@ -273,8 +273,8 @@
 					physbase = start_paddr;
 				}
 
-				if (size > end_paddr - start_paddr)
-					size = end_paddr - start_paddr;
+				if (size > end_paddr - physbase)
+					size = end_paddr - physbase;
 
 				dbg("free_bootmem %lx %lx\n", physbase, size);
 				free_bootmem_node(NODE_DATA(nid), physbase,
@@ -294,8 +294,8 @@
 					physbase = start_paddr;
 				}
 
-				if (size > end_paddr - start_paddr)
-					size = end_paddr - start_paddr;
+				if (size > end_paddr - physbase)
+					size = end_paddr - physbase;
 
 				dbg("reserve_bootmem %lx %lx\n", physbase,
 				    size);
--- diff/arch/ppc64/xmon/start.c	2004-02-09 10:36:09.000000000 +0000
+++ source/arch/ppc64/xmon/start.c	2004-02-09 10:39:51.000000000 +0000
@@ -41,7 +41,7 @@
 static struct sysrq_key_op sysrq_xmon_op = 
 {
 	.handler =	sysrq_handle_xmon,
-	.help_msg =	"xmon",
+	.help_msg =	"Xmon",
 	.action_msg =	"Entering xmon\n",
 };
 
--- diff/arch/ppc64/xmon/xmon.c	2004-02-09 10:36:09.000000000 +0000
+++ source/arch/ppc64/xmon/xmon.c	2004-02-09 10:39:51.000000000 +0000
@@ -16,6 +16,7 @@
 #include <linux/reboot.h>
 #include <linux/delay.h>
 #include <linux/kallsyms.h>
+#include <linux/cpumask.h>
 
 #include <asm/ptrace.h>
 #include <asm/string.h>
@@ -37,7 +38,7 @@
 #define skipbl	xmon_skipbl
 
 #ifdef CONFIG_SMP
-volatile unsigned long cpus_in_xmon = 0;
+volatile cpumask_t cpus_in_xmon = CPU_MASK_NONE;
 static unsigned long got_xmon = 0;
 static volatile int take_xmon = -1;
 static volatile int leaving_xmon = 0;
@@ -288,17 +289,18 @@
 	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)) {
+	if (cpu_test_and_set(smp_processor_id(), cpus_in_xmon)) {
 		/* xmon probably caused an exception itself */
 		printf("We are already in xmon\n");
 		for (;;)
-			;
+			cpu_relax();
 	}
 	while (test_and_set_bit(0, &got_xmon)) {
 		if (take_xmon == smp_processor_id()) {
 			take_xmon = -1;
 			break;
 		}
+		cpu_relax();
 	}
 	/*
 	 * XXX: breakpoints are removed while any cpu is in xmon
@@ -325,7 +327,7 @@
 	leaving_xmon = 1;
 	if (cmd != 's')
 		clear_bit(0, &got_xmon);
-	clear_bit(smp_processor_id(), &cpus_in_xmon);
+	cpu_clear(smp_processor_id(), cpus_in_xmon);
 #endif /* CONFIG_SMP */
 	set_msrd(msr);		/* restore interrupt enable */
 }
@@ -602,6 +604,7 @@
 			printf(" (type ? for help)\n");
 			break;
 		}
+		cpu_relax();
 	}
 }
 
@@ -638,7 +641,7 @@
 		/* print cpus waiting or in xmon */
 		printf("cpus stopped:");
 		for (cpu = 0; cpu < NR_CPUS; ++cpu) {
-			if (test_bit(cpu, &cpus_in_xmon)) {
+			if (cpu_isset(cpu, cpus_in_xmon)) {
 				printf(" %x", cpu);
 				if (cpu == smp_processor_id())
 					printf("*", cpu);
@@ -664,6 +667,7 @@
 			take_xmon = -1;
 			break;
 		}
+		cpu_relax();
 	}
 }
 #endif /* CONFIG_SMP */
--- diff/arch/s390/kernel/compat_linux.c	2004-02-09 10:36:09.000000000 +0000
+++ source/arch/s390/kernel/compat_linux.c	2004-02-09 10:39:51.000000000 +0000
@@ -190,40 +190,82 @@
 	return sys_setfsgid((gid_t)gid);
 }
 
+static int groups16_to_user(u16 *grouplist, struct group_info *group_info)
+{
+	int i;
+	u16 group;
+
+	for (i = 0; i < group_info->ngroups; i++) {
+		group = (u16)GROUP_AT(group_info, i);
+		if (put_user(group, grouplist+i))
+			return -EFAULT;
+	}
+
+	return 0;
+}
+
+static int groups16_from_user(struct group_info *group_info, u16 *grouplist)
+{
+	int i;
+	u16 group;
+
+	for (i = 0; i < group_info->ngroups; i++) {
+		if (get_user(group, grouplist+i))
+			return  -EFAULT;
+		GROUP_AT(group_info, i) = (gid_t)group;
+	}
+
+	return 0;
+}
+
 asmlinkage long sys32_getgroups16(int gidsetsize, u16 *grouplist)
 {
-	u16 groups[NGROUPS];
-	int i,j;
+	int i;
 
 	if (gidsetsize < 0)
 		return -EINVAL;
-	i = current->ngroups;
+
+	get_group_info(current->group_info);
+	i = current->group_info->ngroups;
 	if (gidsetsize) {
-		if (i > gidsetsize)
-			return -EINVAL;
-		for(j=0;j<i;j++)
-			groups[j] = current->groups[j];
-		if (copy_to_user(grouplist, groups, sizeof(u16)*i))
-			return -EFAULT;
+		if (i > gidsetsize) {
+			i = -EINVAL;
+			goto out;
+		}
+		if (groups16_to_user(grouplist, current->group_info))
+			i = -EFAULT;
+			goto out;
+		}
 	}
+out:
+	put_group_info(current->group_info);
 	return i;
 }
 
 asmlinkage long sys32_setgroups16(int gidsetsize, u16 *grouplist)
 {
-	u16 groups[NGROUPS];
-	int i;
+	struct group_info *group_info;
+	int retval;
 
 	if (!capable(CAP_SETGID))
 		return -EPERM;
-	if ((unsigned) gidsetsize > NGROUPS)
+	if ((unsigned)gidsetsize > NGROUPS_MAX)
 		return -EINVAL;
-	if (copy_from_user(groups, grouplist, gidsetsize * sizeof(u16)))
-		return -EFAULT;
-	for (i = 0 ; i < gidsetsize ; i++)
-		current->groups[i] = (gid_t)groups[i];
-	current->ngroups = gidsetsize;
-	return 0;
+
+	group_info = groups_alloc(gidsetsize);
+	if (!group_info)
+		return -ENOMEM;
+	retval = groups16_from_user(group_info, grouplist);
+	if (retval) {
+		put_group_info(group_info);
+		return retval;
+	}
+
+	retval = set_current_groups(group_info);
+	if (retval)
+		put_group_info(group_info);
+
+	return retval;
 }
 
 asmlinkage long sys32_getuid16(void)
--- diff/arch/sparc/prom/printf.c	2002-10-16 04:27:16.000000000 +0100
+++ source/arch/sparc/prom/printf.c	2004-02-09 10:39:51.000000000 +0000
@@ -39,7 +39,7 @@
 	int i;
 
 	va_start(args, fmt);
-	i = vsnprintf(ppbuf, sizeof(ppbuf), fmt, args);
+	i = vscnprintf(ppbuf, sizeof(ppbuf), fmt, args);
 	va_end(args);
 
 	prom_write(ppbuf, i);
--- diff/arch/sparc64/Kconfig	2004-02-09 10:36:09.000000000 +0000
+++ source/arch/sparc64/Kconfig	2004-02-09 10:39:51.000000000 +0000
@@ -731,12 +731,19 @@
 	depends on DEBUG_KERNEL
 	bool "Debug BOOTMEM initialization"
 
+config LOCKMETER
+	bool "Kernel lock metering"
+	depends on SMP && !PREEMPT
+	help
+	  Say Y to enable kernel lock metering, which adds overhead to SMP locks,
+	  but allows you to see various statistics using the lockstat command.
+
 # We have a custom atomic_dec_and_lock() implementation but it's not
 # compatible with spinlock debugging so we need to fall back on
 # the generic version in that case.
 config HAVE_DEC_LOCK
 	bool
-	depends on SMP && !DEBUG_SPINLOCK
+	depends on SMP && !DEBUG_SPINLOCK && !LOCKMETER
 	default y
 
 config MCOUNT
--- diff/arch/sparc64/kernel/head.S	2004-02-09 10:36:09.000000000 +0000
+++ source/arch/sparc64/kernel/head.S	2004-02-09 10:39:51.000000000 +0000
@@ -61,7 +61,7 @@
 	 * 0x0202 : Supports kernel params string
 	 * 0x0201 : Supports reboot_command
 	 */
-        .half   0x0300          /* HdrS version */
+	.half   0x0300          /* HdrS version */
 
 root_flags:
         .half   1
@@ -159,6 +159,21 @@
 	blu,pt	%xcc, 1b
 	 add	%l0, (1 << 3), %l0
 
+	/* Search the small TLB.  OBP never maps us like that but
+	 * newer SILO can.
+	 */
+	clr	%l0
+
+1:	ldxa	[%l0] ASI_ITLB_TAG_READ, %g1
+	membar	#Sync
+	andn	%g1, %l2, %g1
+	cmp	%g1, %g2
+	be,pn	%xcc, cheetah_got_tlbentry
+	 nop
+	cmp	%l0, (15 << 3)
+	blu,pt	%xcc, 1b
+	 add	%l0, (1 << 3), %l0
+
 	/* BUG() if we get here... */
 	ta	0x5
 
@@ -167,7 +182,8 @@
 	ldxa	[%l0] ASI_ITLB_DATA_ACCESS, %g1
 	membar	#Sync
 	and	%g1, %g3, %g1
-	sub	%g1, %g2, %g1
+	set	0x5fff, %l0
+	andn	%g1, %l0, %g1
 	or	%g5, %g1, %g5
 
 	/* Clear out any KERNBASE area entries. */
--- diff/arch/sparc64/kernel/sys_sparc32.c	2004-02-09 10:36:09.000000000 +0000
+++ source/arch/sparc64/kernel/sys_sparc32.c	2004-02-09 10:39:51.000000000 +0000
@@ -179,40 +179,82 @@
 	return sys_setfsgid((gid_t)gid);
 }
 
+static int groups16_to_user(u16 *grouplist, struct group_info *group_info)
+{
+	int i;
+	u16 group;
+
+	for (i = 0; i < group_info->ngroups; i++) {
+		group = (u16)GROUP_AT(group_info, i);
+		if (put_user(group, grouplist+i))
+			return -EFAULT;
+	}
+
+	return 0;
+}
+
+static int groups16_from_user(struct group_info *group_info, u16 *grouplist)
+{
+	int i;
+	u16 group;
+
+	for (i = 0; i < group_info->ngroups; i++) {
+		if (get_user(group, grouplist+i))
+			return  -EFAULT;
+		GROUP_AT(group_info, i) = (gid_t)group;
+	}
+
+	return 0;
+}
+
 asmlinkage long sys32_getgroups16(int gidsetsize, u16 *grouplist)
 {
-	u16 groups[NGROUPS];
-	int i,j;
+	int i;
 
 	if (gidsetsize < 0)
 		return -EINVAL;
-	i = current->ngroups;
+
+	get_group_info(current->group_info);
+	i = current->group_info->ngroups;
 	if (gidsetsize) {
-		if (i > gidsetsize)
-			return -EINVAL;
-		for(j=0;j<i;j++)
-			groups[j] = current->groups[j];
-		if (copy_to_user(grouplist, groups, sizeof(u16)*i))
-			return -EFAULT;
+		if (i > gidsetsize) {
+			i = -EINVAL;
+			goto out;
+		}
+		if (groups16_to_user(grouplist, current->group_info)) {
+			i = -EFAULT;
+			goto out;
+		}
 	}
+out:
+	put_group_info(current->group_info);
 	return i;
 }
 
 asmlinkage long sys32_setgroups16(int gidsetsize, u16 *grouplist)
 {
-	u16 groups[NGROUPS];
-	int i;
+	struct group_info *group_info;
+	int retval;
 
 	if (!capable(CAP_SETGID))
 		return -EPERM;
-	if ((unsigned) gidsetsize > NGROUPS)
+	if ((unsigned)gidsetsize > NGROUPS_MAX)
 		return -EINVAL;
-	if (copy_from_user(groups, grouplist, gidsetsize * sizeof(u16)))
-		return -EFAULT;
-	for (i = 0 ; i < gidsetsize ; i++)
-		current->groups[i] = (gid_t)groups[i];
-	current->ngroups = gidsetsize;
-	return 0;
+
+	group_info = groups_alloc(gidsetsize);
+	if (!group_info)
+		return -ENOMEM;
+	retval = groups16_from_user(group_info, grouplist);
+	if (retval) {
+		put_group_info(group_info);
+		return retval;
+	}
+
+	retval = set_current_groups(group_info);
+	if (retval)
+		put_group_info(group_info);
+
+	return retval;
 }
 
 asmlinkage long sys32_getuid16(void)
--- diff/arch/sparc64/lib/rwlock.S	2003-11-25 15:24:57.000000000 +0000
+++ source/arch/sparc64/lib/rwlock.S	2004-02-09 10:39:51.000000000 +0000
@@ -85,5 +85,20 @@
 __write_trylock_fail:
 	retl
 	 mov		0, %o0
+
+	.globl	__read_trylock
+__read_trylock: /* %o0 = lock_ptr */
+	ldsw		[%o0], %g5
+	brlz,pn		%g5, 100f
+	add		%g5, 1, %g7
+	cas		[%o0], %g5, %g7
+	cmp		%g5, %g7
+	bne,pn		%icc, __read_trylock
+	 membar		#StoreLoad | #StoreStore
+	retl
+	mov		1, %o0
+100:	retl
+	mov		0, %o0
+
 rwlock_impl_end:
 
--- diff/arch/sparc64/prom/printf.c	2003-05-21 11:50:14.000000000 +0100
+++ source/arch/sparc64/prom/printf.c	2004-02-09 10:39:51.000000000 +0000
@@ -40,7 +40,7 @@
 	int i;
 
 	va_start(args, fmt);
-	i = vsnprintf(ppbuf, sizeof(ppbuf), fmt, args);
+	i = vscnprintf(ppbuf, sizeof(ppbuf), fmt, args);
 	va_end(args);
 
 	prom_write(ppbuf, i);
--- diff/arch/um/Kconfig	2004-02-09 10:36:09.000000000 +0000
+++ source/arch/um/Kconfig	2004-02-09 10:39:51.000000000 +0000
@@ -61,6 +61,20 @@
 
 config NET
 	bool "Networking support"
+	help
+	Unless you really know what you are doing, you should say Y here.
+	The reason is that some programs need kernel networking support even
+	when running on a stand-alone machine that isn't connected to any
+	other computer. If you are upgrading from an older kernel, you
+	should consider updating your networking tools too because changes
+	in the kernel and the tools often go hand in hand. The tools are
+	contained in the package net-tools, the location and version number
+	of which are given in Documentation/Changes.
+
+	For a general introduction to Linux networking, it is highly
+	recommended to read the NET-HOWTO, available from
+	<http://www.tldp.org/docs.html#howto>.
+
 
 source "fs/Kconfig.binfmt"
 
@@ -85,6 +99,19 @@
         If you'd like to be able to work with files stored on the host, 
         say Y or M here; otherwise say N.
 
+config HPPFS
+	tristate "HoneyPot ProcFS"
+	help
+	hppfs (HoneyPot ProcFS) is a filesystem which allows UML /proc 
+	entries to be overridden, removed, or fabricated from the host.
+	Its purpose is to allow a UML to appear to be a physical machine
+	by removing or changing anything in /proc which gives away the
+	identity of a UML.
+
+	See http://user-mode-linux.sf.net/hppfs.html for more information.
+
+	You only need this if you are setting up a UML honeypot.  Otherwise,
+	it is safe to say 'N' here.
 
 config MCONSOLE
 	bool "Management console"
@@ -105,6 +132,16 @@
 config MAGIC_SYSRQ
 	bool "Magic SysRq key"
 	depends on MCONSOLE
+	help
+	If you say Y here, you will have some control over the system even
+	if the system crashes for example during kernel debugging (e.g., you
+	will be able to flush the buffer cache to disk, reboot the system
+	immediately or dump some status information). This is accomplished
+	by pressing various keys while holding SysRq (Alt+PrintScreen). It
+	also works on a serial console (on PC hardware at least), if you
+	send a BREAK and then within 5 seconds a command keypress. The
+	keys are documented in Documentation/sysrq.txt. Don't say Y
+	unless you really know what this hack does.
 
 config HOST_2G_2G
 	bool "2G/2G host address space split"
@@ -160,6 +197,9 @@
 config HIGHMEM
 	bool "Highmem support"
 
+config PROC_MM
+	bool "/proc/mm support"
+
 config KERNEL_STACK_ORDER
 	int "Kernel stack size order"
 	default 2
@@ -168,6 +208,17 @@
 	be 1 << order pages.  The default is OK unless you're running Valgrind
 	on UML, in which case, set this to 3.
 
+config UML_REAL_TIME_CLOCK
+	bool "Real-time Clock"
+	default y
+	help
+	This option makes UML time deltas match wall clock deltas.  This should
+	normally be enabled.  The exception would be if you are debugging with
+	UML and spend long times with UML stopped at a breakpoint.  In this
+	case, when UML is restarted, it will call the timer enough times to make
+	up for the time spent at the breakpoint.  This could result in a 
+	noticable lag.  If this is a problem, then disable this option.
+
 endmenu
 
 source "init/Kconfig"
@@ -240,6 +291,10 @@
 config PT_PROXY
 	bool "Enable ptrace proxy"
 	depends on XTERM_CHAN && DEBUG_INFO
+	help
+	This option enables a debugging interface which allows gdb to debug
+	the kernel without needing to actually attach to kernel threads.
+	If you want to do kernel debugging, say Y here; otherwise say N.
 
 config GPROF
 	bool "Enable gprof support"
--- diff/arch/um/Kconfig_block	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/um/Kconfig_block	2004-02-09 10:39:51.000000000 +0000
@@ -29,6 +29,20 @@
         wise choice too.  In all other cases (for example, if you're just
         playing around with User-Mode Linux) you can choose N.
 
+# Turn this back on when the driver actually works
+#
+#config BLK_DEV_COW
+#	tristate "COW block device"
+#	help
+#	This is a layered driver which sits above two other block devices.
+#	One is read-only, and the other is a read-write layer which stores
+#	all changes.  This provides the illusion that the read-only layer
+#	can be mounted read-write and changed.
+
+config BLK_DEV_COW_COMMON
+	bool
+	default BLK_DEV_COW || BLK_DEV_UBD
+
 config BLK_DEV_LOOP
 	tristate "Loopback device support"
 
--- diff/arch/um/Kconfig_net	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/um/Kconfig_net	2004-02-09 10:39:51.000000000 +0000
@@ -1,5 +1,5 @@
 
-menu "Network Devices"
+menu "UML Network Devices"
 	depends on NET
 
 # UML virtual driver
@@ -176,73 +176,5 @@
 	
         Startup example: "eth0=slirp,FE:FD:01:02:03:04,/usr/local/bin/slirp"
 
-
-# Below are hardware-independent drivers mirrored from
-# drivers/net/Config.in. It would be nice if Linux
-# had HW independent drivers separated from the other
-# but it does not. Until then each non-ISA/PCI arch
-# needs to provide it's own menu of network drivers
-config DUMMY
-	tristate "Dummy net driver support"
-
-config BONDING
-	tristate "Bonding driver support"
-
-config EQUALIZER
-	tristate "EQL (serial line load balancing) support"
-
-config TUN
-	tristate "Universal TUN/TAP device driver support"
-
-config ETHERTAP
-	tristate "Ethertap network tap (OBSOLETE)"
-	depends on EXPERIMENTAL && NETLINK
-
-config PPP
-	tristate "PPP (point-to-point protocol) support"
-
-config PPP_MULTILINK
-	bool "PPP multilink support (EXPERIMENTAL)"
-	depends on PPP && EXPERIMENTAL
-
-config PPP_FILTER
-	bool "PPP filtering"
-	depends on PPP && FILTER
-
-config PPP_ASYNC
-	tristate "PPP support for async serial ports"
-	depends on PPP
-
-config PPP_SYNC_TTY
-	tristate "PPP support for sync tty ports"
-	depends on PPP
-
-config PPP_DEFLATE
-	tristate "PPP Deflate compression"
-	depends on PPP
-
-config PPP_BSDCOMP
-	tristate "PPP BSD-Compress compression"
-	depends on PPP
-
-config PPPOE
-	tristate "PPP over Ethernet (EXPERIMENTAL)"
-	depends on PPP && EXPERIMENTAL
-
-config SLIP
-	tristate "SLIP (serial line) support"
-
-config SLIP_COMPRESSED
-	bool "CSLIP compressed headers"
-	depends on SLIP=y
-
-config SLIP_SMART
-	bool "Keepalive and linefill"
-	depends on SLIP=y
-
-config SLIP_MODE_SLIP6
-	bool "Six bit SLIP encapsulation"
-	depends on SLIP=y
-
 endmenu
 
--- diff/arch/um/Makefile	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/um/Makefile	2004-02-09 10:39:51.000000000 +0000
@@ -24,15 +24,17 @@
 # Have to precede the include because the included Makefiles reference them.
 SYMLINK_HEADERS = include/asm-um/archparam.h include/asm-um/system.h \
 	include/asm-um/sigcontext.h include/asm-um/processor.h \
-	include/asm-um/ptrace.h include/asm-um/arch-signal.h
+	include/asm-um/ptrace.h include/asm-um/arch-signal.h \
+	include/asm-um/module.h
 
 ARCH_SYMLINKS = include/asm-um/arch $(ARCH_DIR)/include/sysdep $(ARCH_DIR)/os \
 	$(SYMLINK_HEADERS) $(ARCH_DIR)/include/uml-config.h
 
 GEN_HEADERS += $(ARCH_DIR)/include/task.h $(ARCH_DIR)/include/kern_constants.h
 
-include $(ARCH_DIR)/Makefile-$(SUBARCH)
-include $(ARCH_DIR)/Makefile-os-$(OS)
+.PHONY: sys_prepare
+sys_prepare:
+	@:
 
 MAKEFILE-$(CONFIG_MODE_TT) += Makefile-tt
 MAKEFILE-$(CONFIG_MODE_SKAS) += Makefile-skas
@@ -41,6 +43,9 @@
   include $(addprefix $(ARCH_DIR)/,$(MAKEFILE-y))
 endif
 
+include $(ARCH_DIR)/Makefile-$(SUBARCH)
+include $(ARCH_DIR)/Makefile-os-$(OS)
+
 EXTRAVERSION := $(EXTRAVERSION)-1um
 
 ARCH_INCLUDE = -I$(ARCH_DIR)/include
@@ -52,14 +57,20 @@
 
 CFLAGS += $(CFLAGS-y) -D__arch_um__ -DSUBARCH=\"$(SUBARCH)\" \
 	-D_LARGEFILE64_SOURCE $(ARCH_INCLUDE) -Derrno=kernel_errno \
-	$(MODE_INCLUDE)
+	-Dsigprocmask=kernel_sigprocmask $(MODE_INCLUDE)
 
 LINK_WRAPS = -Wl,--wrap,malloc -Wl,--wrap,free -Wl,--wrap,calloc
 
+# These are needed for clean and mrproper, since in that case .config is not
+# included; the values here are meaningless
+
+CONFIG_NEST_LEVEL ?= 0
+CONFIG_KERNEL_HALF_GIGS ?=  0
+
 SIZE = (($(CONFIG_NEST_LEVEL) + $(CONFIG_KERNEL_HALF_GIGS)) * 0x20000000)
 
 ifeq ($(CONFIG_MODE_SKAS), y)
-$(SYS_HEADERS) : $(ARCH_DIR)/kernel/skas/include/skas_ptregs.h
+$(SYS_HEADERS) : $(TOPDIR)/$(ARCH_DIR)/include/skas_ptregs.h
 endif
 
 include/linux/version.h: arch/$(ARCH)/Makefile
@@ -98,17 +109,17 @@
 CONFIG_KERNEL_STACK_ORDER ?= 2
 STACK_SIZE := $(shell echo $$[ 4096 * (1 << $(CONFIG_KERNEL_STACK_ORDER)) ] )
 
-AFLAGS_vmlinux.lds.o = -U$(SUBARCH) \
+AFLAGS_vmlinux.lds.o = $(shell echo -U$(SUBARCH) \
 	-DSTART=$$(($(TOP_ADDR) - $(SIZE))) -DELF_ARCH=$(ELF_ARCH) \
 	-DELF_FORMAT=\"$(ELF_FORMAT)\" $(CPP_MODE_TT) \
-	-DKERNEL_STACK_SIZE=$(STACK_SIZE)
+	-DKERNEL_STACK_SIZE=$(STACK_SIZE))
 
-AFLAGS_$(LD_SCRIPT-y:.s=).o = $(AFLAGS_vmlinux.lds.o) -P -C -Uum
+export AFLAGS_$(LD_SCRIPT-y:.s=).o = $(AFLAGS_vmlinux.lds.o) -P -C -Uum
 
 LD_SCRIPT-y := $(ARCH_DIR)/$(LD_SCRIPT-y)
 
-$(LD_SCRIPT-y) : $(LD_SCRIPT-y:.s=.S) scripts FORCE
-	$(call if_changed_dep,as_s_S)
+#$(LD_SCRIPT-y) : $(LD_SCRIPT-y:.s=.S) scripts FORCE
+#	$(call if_changed_dep,as_s_S)
 
 linux: vmlinux $(LD_SCRIPT-y)
 	$(CC) -Wl,-T,$(LD_SCRIPT-y) $(LINK-y) $(LINK_WRAPS) \
@@ -116,16 +127,22 @@
 
 USER_CFLAGS := $(patsubst -I%,,$(CFLAGS))
 USER_CFLAGS := $(patsubst -Derrno=kernel_errno,,$(USER_CFLAGS))
+USER_CFLAGS := $(patsubst -Dsigprocmask=kernel_sigprocmask,,$(USER_CFLAGS))
 USER_CFLAGS := $(patsubst -D__KERNEL__,,$(USER_CFLAGS)) $(ARCH_INCLUDE) \
 	$(MODE_INCLUDE)
 
 # To get a definition of F_SETSIG
 USER_CFLAGS += -D_GNU_SOURCE
 
+ifdef CONFIG_DEBUG_INFO
+USER_CFLAGS          += -g
+endif
+
 CLEAN_FILES += linux x.i gmon.out $(ARCH_DIR)/uml.lds.s \
-	$(ARCH_DIR)/dyn_link.ld.s $(GEN_HEADERS)
+	$(ARCH_DIR)/dyn_link.ld.s $(ARCH_DIR)/include/uml-config.h \
+	$(GEN_HEADERS)
 
-$(ARCH_DIR)/main.o: $(ARCH_DIR)/main.c
+$(ARCH_DIR)/main.o: $(ARCH_DIR)/main.c sys_prepare
 	$(CC) $(USER_CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
 
 archmrproper:
@@ -161,19 +178,23 @@
 $(ARCH_DIR)/os:
 	cd $(ARCH_DIR) && ln -sf os-$(OS) os
 
-$(ARCH_DIR)/include/uml-config.h :
+$(ARCH_DIR)/include/uml-config.h : $(TOPDIR)/include/linux/autoconf.h
 	sed 's/ CONFIG/ UML_CONFIG/' $(TOPDIR)/include/linux/autoconf.h > $@
 
+filechk_$(ARCH_DIR)/include/task.h := $(ARCH_DIR)/util/mk_task
+
 $(ARCH_DIR)/include/task.h : $(ARCH_DIR)/util/mk_task
-	$< > $@
+	$(call filechk,$@)
+
+filechk_$(ARCH_DIR)/include/kern_constants.h := $(ARCH_DIR)/util/mk_constants
 
 $(ARCH_DIR)/include/kern_constants.h : $(ARCH_DIR)/util/mk_constants
-	$< > $@
+	$(call filechk,$@)
 
-$(ARCH_DIR)/util/mk_task : $(ARCH_DIR)/kernel/skas/include/skas_ptregs.h \
-	$(ARCH_DIR)/util FORCE ;
+$(ARCH_DIR)/util/mk_task $(ARCH_DIR)/util/mk_constants : $(ARCH_DIR)/util \
+	sys_prepare FORCE ;
 
 $(ARCH_DIR)/util: FORCE
-	@$(call descend,$@,)
+	$(MAKE) -f scripts/Makefile.build obj=$@
 
-export SUBARCH USER_CFLAGS OS
+export SUBARCH USER_CFLAGS OS 
--- diff/arch/um/Makefile-i386	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/um/Makefile-i386	2004-02-09 10:39:51.000000000 +0000
@@ -16,22 +16,28 @@
 
 SYS_HEADERS = $(SYS_DIR)/sc.h $(SYS_DIR)/thread.h
 
+sys_prepare: $(SYS_DIR)/sc.h
+
 prepare: $(SYS_HEADERS)
 
+filechk_$(SYS_DIR)/sc.h := $(SYS_UTIL_DIR)/mk_sc
+
 $(SYS_DIR)/sc.h: $(SYS_UTIL_DIR)/mk_sc
-	$< > $@
+	$(call filechk,$@)
+
+filechk_$(SYS_DIR)/thread.h := $(SYS_UTIL_DIR)/mk_thread 
 
 $(SYS_DIR)/thread.h: $(SYS_UTIL_DIR)/mk_thread 
-	$< > $@
+	$(call filechk,$@)
 
-$(SYS_UTIL_DIR)/mk_sc: FORCE ; 
-	@$(call descend,$(SYS_UTIL_DIR),$@)
+$(SYS_UTIL_DIR)/mk_sc: scripts/fixdep include/config/MARKER FORCE ; 
+	+@$(call descend,$(SYS_UTIL_DIR),$@)
 
-$(SYS_UTIL_DIR)/mk_thread: $(ARCH_SYMLINKS) $(GEN_HEADERS) FORCE ; 
-	@$(call descend,$(SYS_UTIL_DIR),$@)
+$(SYS_UTIL_DIR)/mk_thread: $(ARCH_SYMLINKS) $(GEN_HEADERS) sys_prepare FORCE ; 
+	+@$(call descend,$(SYS_UTIL_DIR),$@)
 
 $(SYS_UTIL_DIR): include/asm FORCE
-	@$(call descend,$@,)
+	+@$(call descend,$@,)
 
 sysclean :
 	rm -f $(SYS_HEADERS)
--- diff/arch/um/Makefile-skas	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/um/Makefile-skas	2004-02-09 10:39:51.000000000 +0000
@@ -14,7 +14,7 @@
 LINK_SKAS = -Wl,-rpath,/lib 
 LD_SCRIPT_SKAS = dyn.lds.s
 
-GEN_HEADERS += $(ARCH_DIR)/kernel/skas/include/skas_ptregs.h
+GEN_HEADERS += $(TOPDIR)/$(ARCH_DIR)/include/skas_ptregs.h
 
-$(ARCH_DIR)/kernel/skas/include/skas_ptregs.h :
-	$(MAKE) -C $(ARCH_DIR)/kernel/skas include/skas_ptregs.h
+$(TOPDIR)/$(ARCH_DIR)/include/skas_ptregs.h :
+	$(call descend,$(ARCH_DIR)/kernel/skas,$@)
--- diff/arch/um/config.release	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/um/config.release	2004-02-09 10:39:51.000000000 +0000
@@ -228,7 +228,6 @@
 CONFIG_EXT2_FS=y
 CONFIG_SYSV_FS=m
 CONFIG_UDF_FS=m
-# CONFIG_UDF_RW is not set
 CONFIG_UFS_FS=m
 # CONFIG_UFS_FS_WRITE is not set
 
--- diff/arch/um/defconfig	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/um/defconfig	2004-02-09 10:39:51.000000000 +0000
@@ -3,29 +3,19 @@
 #
 CONFIG_USERMODE=y
 CONFIG_MMU=y
-CONFIG_SWAP=y
 CONFIG_UID16=y
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
-CONFIG_CONFIG_LOG_BUF_SHIFT=14
 
 #
-# Code maturity level options
-#
-CONFIG_EXPERIMENTAL=y
-
-#
-# General Setup
+# UML-specific options
 #
 CONFIG_MODE_TT=y
 CONFIG_MODE_SKAS=y
 CONFIG_NET=y
-CONFIG_SYSVIPC=y
-CONFIG_BSD_PROCESS_ACCT=y
-CONFIG_SYSCTL=y
-CONFIG_BINFMT_AOUT=y
 CONFIG_BINFMT_ELF=y
 CONFIG_BINFMT_MISC=y
 CONFIG_HOSTFS=y
+CONFIG_HPPFS=y
 CONFIG_MCONSOLE=y
 CONFIG_MAGIC_SYSRQ=y
 # CONFIG_HOST_2G_2G is not set
@@ -34,14 +24,43 @@
 CONFIG_NEST_LEVEL=0
 CONFIG_KERNEL_HALF_GIGS=1
 # CONFIG_HIGHMEM is not set
-CONFIG_PROC_MM=y
+# CONFIG_PROC_MM is not set
 CONFIG_KERNEL_STACK_ORDER=2
+CONFIG_UML_REAL_TIME_CLOCK=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 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_KMOD is not set
+# CONFIG_MODULES is not set
+
+#
+# Generic Driver Options
+#
 
 #
 # Character Devices
@@ -69,6 +88,7 @@
 #
 CONFIG_BLK_DEV_UBD=y
 # CONFIG_BLK_DEV_UBD_SYNC is not set
+CONFIG_BLK_DEV_COW_COMMON=y
 CONFIG_BLK_DEV_LOOP=y
 CONFIG_BLK_DEV_NBD=y
 CONFIG_BLK_DEV_RAM=y
@@ -78,7 +98,7 @@
 CONFIG_NETDEVICES=y
 
 #
-# Network Devices
+# UML Network Devices
 #
 CONFIG_UML_NET=y
 CONFIG_UML_NET_ETHERTAP=y
@@ -88,22 +108,6 @@
 CONFIG_UML_NET_MCAST=y
 # CONFIG_UML_NET_PCAP is not set
 CONFIG_UML_NET_SLIRP=y
-CONFIG_DUMMY=y
-# CONFIG_BONDING is not set
-# CONFIG_EQUALIZER is not set
-CONFIG_TUN=y
-# CONFIG_ETHERTAP is not set
-CONFIG_PPP=y
-# CONFIG_PPP_MULTILINK is not set
-# CONFIG_PPP_ASYNC is not set
-# CONFIG_PPP_SYNC_TTY is not set
-# CONFIG_PPP_DEFLATE is not set
-# CONFIG_PPP_BSDCOMP is not set
-# CONFIG_PPPOE is not set
-CONFIG_SLIP=y
-# CONFIG_SLIP_COMPRESSED is not set
-# CONFIG_SLIP_SMART is not set
-# CONFIG_SLIP_MODE_SLIP6 is not set
 
 #
 # Networking support
@@ -115,8 +119,6 @@
 CONFIG_PACKET=y
 CONFIG_PACKET_MMAP=y
 # CONFIG_NETLINK_DEV is not set
-# CONFIG_NETFILTER is not set
-# CONFIG_FILTER is not set
 CONFIG_UNIX=y
 # CONFIG_NET_KEY is not set
 CONFIG_INET=y
@@ -130,8 +132,11 @@
 # CONFIG_SYN_COOKIES is not set
 # CONFIG_INET_AH is not set
 # CONFIG_INET_ESP is not set
-# CONFIG_XFRM_USER 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)
@@ -140,9 +145,9 @@
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
 # CONFIG_VLAN_8021Q is not set
-# CONFIG_LLC is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE 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
@@ -160,6 +165,10 @@
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+CONFIG_DUMMY=y
+# CONFIG_BONDING is not set
+# CONFIG_EQUALIZER is not set
+CONFIG_TUN=y
 
 #
 # Ethernet (10 or 100Mbit)
@@ -171,12 +180,28 @@
 #
 
 #
+# Ethernet (10000 Mbit)
+#
+CONFIG_PPP=y
+# CONFIG_PPP_MULTILINK is not set
+# CONFIG_PPP_FILTER is not set
+# CONFIG_PPP_ASYNC is not set
+# CONFIG_PPP_SYNC_TTY is not set
+# CONFIG_PPP_DEFLATE is not set
+# CONFIG_PPP_BSDCOMP is not set
+# CONFIG_PPPOE is not set
+CONFIG_SLIP=y
+# CONFIG_SLIP_COMPRESSED is not set
+# CONFIG_SLIP_SMART is not set
+# CONFIG_SLIP_MODE_SLIP6 is not set
+
+#
 # Wireless LAN (non-hamradio)
 #
 # CONFIG_NET_RADIO is not set
 
 #
-# Token Ring devices (depends on LLC=y)
+# Token Ring devices
 #
 # CONFIG_SHAPER is not set
 
@@ -186,68 +211,101 @@
 # 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
+
+#
 # 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=y
+# 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=y
+# CONFIG_ROMFS_FS is not set
 CONFIG_QUOTA=y
 # CONFIG_QFMT_V1 is not set
 # CONFIG_QFMT_V2 is not set
 CONFIG_QUOTACTL=y
-CONFIG_AUTOFS_FS=m
-CONFIG_AUTOFS4_FS=m
-CONFIG_REISERFS_FS=m
-# CONFIG_REISERFS_CHECK is not set
-# CONFIG_REISERFS_PROC_INFO is not set
+CONFIG_AUTOFS_FS=y
+CONFIG_AUTOFS4_FS=y
+
+#
+# CD-ROM/DVD Filesystems
+#
+CONFIG_ISO9660_FS=y
+# CONFIG_JOLIET is not set
+# CONFIG_ZISOFS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# 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=y
+CONFIG_DEVFS_MOUNT=y
+# CONFIG_DEVFS_DEBUG is not set
+CONFIG_DEVPTS_FS=y
+# CONFIG_DEVPTS_FS_XATTR is not set
+# CONFIG_TMPFS 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_EXT3_FS is not set
-# CONFIG_JBD is not set
-CONFIG_FAT_FS=m
-CONFIG_MSDOS_FS=m
-CONFIG_VFAT_FS=m
 # CONFIG_EFS_FS is not set
 CONFIG_JFFS_FS=y
 CONFIG_JFFS_FS_VERBOSE=0
-CONFIG_JFFS_PROC_FS=y
 # CONFIG_JFFS2_FS is not set
 # CONFIG_CRAMFS is not set
-# CONFIG_TMPFS is not set
-CONFIG_RAMFS=y
-CONFIG_ISO9660_FS=m
-# CONFIG_JOLIET is not set
-# CONFIG_ZISOFS is not set
-# CONFIG_JFS_FS is not set
-CONFIG_MINIX_FS=m
 # CONFIG_VXFS_FS is not set
-# CONFIG_NTFS_FS is not set
 # CONFIG_HPFS_FS is not set
-CONFIG_PROC_FS=y
-CONFIG_DEVFS_FS=y
-CONFIG_DEVFS_MOUNT=y
-# CONFIG_DEVFS_DEBUG is not set
-CONFIG_DEVPTS_FS=y
 # CONFIG_QNX4FS_FS is not set
-# CONFIG_ROMFS_FS is not set
-CONFIG_EXT2_FS=y
-# CONFIG_EXT2_FS_XATTR is not set
 # CONFIG_SYSV_FS is not set
-# CONFIG_UDF_FS is not set
 # CONFIG_UFS_FS is not set
-# CONFIG_XFS_FS is not set
 
 #
 # Network File Systems
 #
-# CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
 # CONFIG_NFS_FS is not set
 # CONFIG_NFSD is not set
 # CONFIG_EXPORTFS is not set
-# CONFIG_CIFS 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
 
 #
@@ -317,28 +375,7 @@
 #
 # SCSI support
 #
-CONFIG_SCSI=y
-CONFIG_GENERIC_ISA_DMA=y
-
-#
-# SCSI support type (disk, tape, CD-ROM)
-#
-CONFIG_BLK_DEV_SD=y
-CONFIG_SD_EXTRA_DEVS=40
-CONFIG_CHR_DEV_ST=y
-CONFIG_BLK_DEV_SR=y
-CONFIG_BLK_DEV_SR_VENDOR=y
-CONFIG_SR_EXTRA_DEVS=2
-CONFIG_CHR_DEV_SG=y
-
-#
-# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
-#
-CONFIG_SCSI_DEBUG_QUEUES=y
-CONFIG_SCSI_MULTI_LUN=y
-CONFIG_SCSI_CONSTANTS=y
-CONFIG_SCSI_LOGGING=y
-CONFIG_SCSI_DEBUG=y
+# CONFIG_SCSI is not set
 
 #
 # Multi-device support (RAID and LVM)
@@ -360,6 +397,7 @@
 CONFIG_MTD_BLOCK=y
 # CONFIG_FTL is not set
 # CONFIG_NFTL is not set
+# CONFIG_INFTL is not set
 
 #
 # RAM/ROM/Flash chip drivers
@@ -374,20 +412,21 @@
 #
 # Mapping drivers for chip access
 #
+# CONFIG_MTD_COMPLEX_MAPPINGS is not set
 
 #
 # Self-contained MTD device drivers
 #
 # CONFIG_MTD_SLRAM is not set
 # CONFIG_MTD_MTDRAM is not set
-CONFIG_MTD_BLKMTD=m
+CONFIG_MTD_BLKMTD=y
 
 #
 # 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_DOC2001PLUS is not set
 
 #
 # NAND Flash Device Drivers
--- diff/arch/um/drivers/Makefile	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/um/drivers/Makefile	2004-02-09 10:39:51.000000000 +0000
@@ -1,5 +1,5 @@
 # 
-# Copyright (C) 2000, 2002 Jeff Dike (jdike@karaya.com)
+# Copyright (C) 2000, 2002, 2003 Jeff Dike (jdike@karaya.com)
 # Licensed under the GPL
 #
 
@@ -39,6 +39,8 @@
 obj-$(CONFIG_TTY_CHAN) += tty.o 
 obj-$(CONFIG_XTERM_CHAN) += xterm.o xterm_kern.o
 obj-$(CONFIG_UML_WATCHDOG) += harddog.o
+obj-$(CONFIG_BLK_DEV_COW) += cow_kern.o
+obj-$(CONFIG_BLK_DEV_COW_COMMON) += cow_user.o
 
 obj-y += stdio_console.o $(CHAN_OBJS)
 
@@ -46,7 +48,7 @@
 
 USER_OBJS := $(filter %_user.o,$(obj-y) $(obj-m) $(USER_SINGLE_OBJS)) fd.o \
 	null.o pty.o tty.o xterm.o
-USER_OBJS := $(foreach file,$(USER_OBJS),arch/um/drivers/$(file))
+USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file))
 
 $(USER_OBJS) : %.o: %.c
 	$(CC) $(CFLAGS_$(notdir $@)) $(USER_CFLAGS) -c -o $@ $<
--- diff/arch/um/drivers/chan_kern.c	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/um/drivers/chan_kern.c	2004-02-09 10:39:51.000000000 +0000
@@ -8,6 +8,7 @@
 #include <linux/list.h>
 #include <linux/slab.h>
 #include <linux/tty.h>
+#include <linux/string.h>
 #include <linux/tty_flip.h>
 #include <asm/irq.h>
 #include "chan_kern.h"
@@ -265,6 +266,11 @@
 {
 	int n = 0;
 
+	if(chan == NULL){
+		CONFIG_CHUNK(str, size, n, "none", 1);
+		return(n);
+	}
+
 	CONFIG_CHUNK(str, size, n, chan->ops->type, 0);
 
 	if(chan->dev == NULL){
@@ -420,7 +426,8 @@
 		INIT_LIST_HEAD(chans);
 	}
 
-	if((out = strchr(str, ',')) != NULL){
+	out = strchr(str, ',');
+	if(out != NULL){
 		in = str;
 		*out = '\0';
 		out++;
@@ -475,12 +482,15 @@
 				goto out;
 			}
 			err = chan->ops->read(chan->fd, &c, chan->data);
-			if(err > 0) tty_receive_char(tty, c);
+			if(err > 0) 
+				tty_receive_char(tty, c);
 		} while(err > 0);
+
 		if(err == 0) reactivate_fd(chan->fd, irq);
 		if(err == -EIO){
 			if(chan->primary){
-				if(tty != NULL) tty_hangup(tty);
+				if(tty != NULL) 
+					tty_hangup(tty);
 				line_disable(dev, irq);
 				close_chan(chans);
 				free_chan(chans);
--- diff/arch/um/drivers/chan_user.c	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/um/drivers/chan_user.c	2004-02-09 10:39:51.000000000 +0000
@@ -1,5 +1,5 @@
 /* 
- * Copyright (C) 2000, 2001 Jeff Dike (jdike@karaya.com)
+ * Copyright (C) 2000 - 2003 Jeff Dike (jdike@addtoit.com)
  * Licensed under the GPL
  */
 
@@ -7,7 +7,6 @@
 #include <stdlib.h>
 #include <errno.h>
 #include <termios.h>
-#include <fcntl.h>
 #include <string.h>
 #include <signal.h>
 #include <sys/stat.h>
@@ -24,29 +23,27 @@
 
 void generic_close(int fd, void *unused)
 {
-	close(fd);
+	os_close_file(fd);
 }
 
 int generic_read(int fd, char *c_out, void *unused)
 {
 	int n;
 
-	n = read(fd, c_out, sizeof(*c_out));
-	if(n < 0){
-		if(errno == EAGAIN) return(0);
-		return(-errno);
-	}
-	else if(n == 0) return(-EIO);
-	return(1);
+	n = os_read_file(fd, c_out, sizeof(*c_out));
+
+	if(n == -EAGAIN) 
+		return(0);
+	else if(n == 0) 
+		return(-EIO);
+	return(n);
 }
 
+/* XXX Trivial wrapper around os_write_file */
+
 int generic_write(int fd, const char *buf, int n, void *unused)
 {
-	int count;
-
-	count = write(fd, buf, n);
-	if(count < 0) return(-errno);
-	return(count);
+	return(os_write_file(fd, buf, n));
 }
 
 int generic_console_write(int fd, const char *buf, int n, void *unused)
@@ -68,15 +65,18 @@
 int generic_window_size(int fd, void *unused, unsigned short *rows_out,
 			unsigned short *cols_out)
 {
-	struct winsize size;
-	int ret = 0;
+	int rows, cols;
+	int ret;
+
+	ret = os_window_size(fd, &rows, &cols);
+	if(ret < 0)
+		return(ret);
+
+	ret = ((*rows_out != rows) || (*cols_out != cols));
+
+	*rows_out = rows;
+	*cols_out = cols;
 
-	if(ioctl(fd, TIOCGWINSZ, &size) == 0){
-		ret = ((*rows_out != size.ws_row) || 
-		       (*cols_out != size.ws_col));
-		*rows_out = size.ws_row;
-		*cols_out = size.ws_col;
-	}
 	return(ret);
 }
 
@@ -100,14 +100,16 @@
 	struct winch_data *data = arg;
 	sigset_t sigs;
 	int pty_fd, pipe_fd;
+	int count, err;
 	char c = 1;
 
-	close(data->close_me);
+	os_close_file(data->close_me);
 	pty_fd = data->pty_fd;
 	pipe_fd = data->pipe_fd;
-	if(write(pipe_fd, &c, sizeof(c)) != sizeof(c))
+	count = os_write_file(pipe_fd, &c, sizeof(c));
+	if(count != sizeof(c))
 		printk("winch_thread : failed to write synchronization "
-		       "byte, errno = %d\n", errno);
+		       "byte, err = %d\n", -count);
 
 	signal(SIGWINCH, winch_handler);
 	sigfillset(&sigs);
@@ -123,26 +125,24 @@
 		exit(1);
 	}
 
-	if(ioctl(pty_fd, TIOCSCTTY, 0) < 0){
-		printk("winch_thread : TIOCSCTTY failed, errno = %d\n", errno);
-		exit(1);
-	}
-	if(tcsetpgrp(pty_fd, os_getpid()) < 0){
-		printk("winch_thread : tcsetpgrp failed, errno = %d\n", errno);
+	err = os_new_tty_pgrp(pty_fd, os_getpid());
+	if(err < 0){
+		printk("winch_thread : new_tty_pgrp failed, err = %d\n", -err);
 		exit(1);
 	}
 
-	if(read(pipe_fd, &c, sizeof(c)) != sizeof(c))
+	count = os_read_file(pipe_fd, &c, sizeof(c));
+	if(count != sizeof(c))
 		printk("winch_thread : failed to read synchronization byte, "
-		       "errno = %d\n", errno);
+		       "err = %d\n", -count);
 
 	while(1){
 		pause();
 
-		if(write(pipe_fd, &c, sizeof(c)) != sizeof(c)){
-			printk("winch_thread : write failed, errno = %d\n",
-			       errno);
-		}
+		count = os_write_file(pipe_fd, &c, sizeof(c));
+		if(count != sizeof(c))
+			printk("winch_thread : write failed, err = %d\n",
+			       -count);
 	}
 }
 
@@ -154,8 +154,8 @@
 	char c;
 
 	err = os_pipe(fds, 1, 1);
-	if(err){
-		printk("winch_tramp : os_pipe failed, errno = %d\n", -err);
+	if(err < 0){
+		printk("winch_tramp : os_pipe failed, err = %d\n", -err);
 		return(err);
 	}
 
@@ -168,12 +168,12 @@
 		return(pid);
 	}
 
-	close(fds[1]);
+	os_close_file(fds[1]);
 	*fd_out = fds[0];
-	n = read(fds[0], &c, sizeof(c));
+	n = os_read_file(fds[0], &c, sizeof(c));
 	if(n != sizeof(c)){
 		printk("winch_tramp : failed to read synchronization byte\n");
-		printk("read returned %d, errno = %d\n", n, errno);
+		printk("read failed, err = %d\n", -n);
 		printk("fd %d will not support SIGWINCH\n", fd);
 		*fd_out = -1;
 	}
@@ -183,20 +183,24 @@
 void register_winch(int fd, void *device_data)
 {
 	int pid, thread, thread_fd;
+	int count;
 	char c = 1;
 
-	if(!isatty(fd)) return;
+	if(!isatty(fd)) 
+		return;
 
 	pid = tcgetpgrp(fd);
-	if(!CHOOSE_MODE(is_tracer_winch(pid, fd, device_data), 0) && 
-	   (pid == -1)){
+	if(!CHOOSE_MODE_PROC(is_tracer_winch, is_skas_winch, pid, fd, 
+			     device_data) && (pid == -1)){
 		thread = winch_tramp(fd, device_data, &thread_fd);
 		if(fd != -1){
 			register_winch_irq(thread_fd, fd, thread, device_data);
 
-			if(write(thread_fd, &c, sizeof(c)) != sizeof(c))
+			count = os_write_file(thread_fd, &c, sizeof(c));
+			if(count != sizeof(c))
 				printk("register_winch : failed to write "
-				       "synchronization byte\n");
+				       "synchronization byte, err = %d\n",
+					-count);
 		}
 	}
 }
--- diff/arch/um/drivers/daemon_user.c	2003-02-13 11:46:50.000000000 +0000
+++ source/arch/um/drivers/daemon_user.c	2004-02-09 10:39:51.000000000 +0000
@@ -53,7 +53,8 @@
 	struct request_v3 req;
 	int fd, n, err;
 
-	if((pri->control = socket(AF_UNIX, SOCK_STREAM, 0)) < 0){
+	pri->control = socket(AF_UNIX, SOCK_STREAM, 0);
+	if(pri->control < 0){
 		printk("daemon_open : control socket failed, errno = %d\n", 
 		       errno);		
 		return(-errno);
@@ -67,7 +68,8 @@
 		goto out;
 	}
 
-	if((fd = socket(AF_UNIX, SOCK_DGRAM, 0)) < 0){
+	fd = socket(AF_UNIX, SOCK_DGRAM, 0);
+	if(fd < 0){
 		printk("daemon_open : data socket failed, errno = %d\n", 
 		       errno);
 		err = -errno;
@@ -91,18 +93,18 @@
 	req.version = SWITCH_VERSION;
 	req.type = REQ_NEW_CONTROL;
 	req.sock = *local_addr;
-	n = write(pri->control, &req, sizeof(req));
+	n = os_write_file(pri->control, &req, sizeof(req));
 	if(n != sizeof(req)){
-		printk("daemon_open : control setup request returned %d, "
-		       "errno = %d\n", n, errno);
+		printk("daemon_open : control setup request failed, err = %d\n",
+		       -n);
 		err = -ENOTCONN;
 		goto out;		
 	}
 
-	n = read(pri->control, sun, sizeof(*sun));
+	n = os_read_file(pri->control, sun, sizeof(*sun));
 	if(n != sizeof(*sun)){
-		printk("daemon_open : read of data socket returned %d, "
-		       "errno = %d\n", n, errno);
+		printk("daemon_open : read of data socket failed, err = %d\n", 
+		       -n);
 		err = -ENOTCONN;
 		goto out_close;		
 	}
@@ -111,9 +113,9 @@
 	return(fd);
 
  out_close:
-	close(fd);
+	os_close_file(fd);
  out:
-	close(pri->control);
+	os_close_file(pri->control);
 	return(err);
 }
 
@@ -153,8 +155,8 @@
 {
 	struct daemon_data *pri = data;
 
-	close(pri->fd);
-	close(pri->control);
+	os_close_file(pri->fd);
+	os_close_file(pri->control);
 	if(pri->data_addr != NULL) kfree(pri->data_addr);
 	if(pri->ctl_addr != NULL) kfree(pri->ctl_addr);
 	if(pri->local_addr != NULL) kfree(pri->local_addr);
--- diff/arch/um/drivers/fd.c	2003-02-13 11:46:50.000000000 +0000
+++ source/arch/um/drivers/fd.c	2004-02-09 10:39:51.000000000 +0000
@@ -35,7 +35,8 @@
 		printk("fd_init : couldn't parse file descriptor '%s'\n", str);
 		return(NULL);
 	}
-	if((data = um_kmalloc(sizeof(*data))) == NULL) return(NULL);
+	data = um_kmalloc(sizeof(*data));
+	if(data == NULL) return(NULL);
 	*data = ((struct fd_chan) { .fd  	= n,
 				    .raw  	= opts->raw });
 	return(data);
--- diff/arch/um/drivers/harddog_user.c	2003-02-13 11:46:50.000000000 +0000
+++ source/arch/um/drivers/harddog_user.c	2004-02-09 10:39:51.000000000 +0000
@@ -27,10 +27,10 @@
 	dup2(data->stdin, 0);
 	dup2(data->stdout, 1);
 	dup2(data->stdout, 2);
-	close(data->stdin);
-	close(data->stdout);
-	close(data->close_me[0]);
-	close(data->close_me[1]);
+	os_close_file(data->stdin);
+	os_close_file(data->stdout);
+	os_close_file(data->close_me[0]);
+	os_close_file(data->close_me[1]);
 }
 
 int start_watchdog(int *in_fd_ret, int *out_fd_ret, char *sock)
@@ -44,15 +44,15 @@
 	char **args = NULL;
 
 	err = os_pipe(in_fds, 1, 0);
-	if(err){
-		printk("harddog_open - os_pipe failed, errno = %d\n", -err);
-		return(err);
+	if(err < 0){
+		printk("harddog_open - os_pipe failed, err = %d\n", -err);
+		goto out;
 	}
 
 	err = os_pipe(out_fds, 1, 0);
-	if(err){
-		printk("harddog_open - os_pipe failed, errno = %d\n", -err);
-		return(err);
+	if(err < 0){
+		printk("harddog_open - os_pipe failed, err = %d\n", -err);
+		goto out_close_in;
 	}
 
 	data.stdin = out_fds[0];
@@ -72,42 +72,47 @@
 
 	pid = run_helper(pre_exec, &data, args, NULL);
 
-	close(out_fds[0]);
-	close(in_fds[1]);
+	os_close_file(out_fds[0]);
+	os_close_file(in_fds[1]);
 
 	if(pid < 0){
 		err = -pid;
-		printk("harddog_open - run_helper failed, errno = %d\n", err);
-		goto out;
+		printk("harddog_open - run_helper failed, errno = %d\n", -err);
+		goto out_close_out;
 	}
 
-	n = read(in_fds[0], &c, sizeof(c));
+	n = os_read_file(in_fds[0], &c, sizeof(c));
 	if(n == 0){
 		printk("harddog_open - EOF on watchdog pipe\n");
 		helper_wait(pid);
 		err = -EIO;
-		goto out;
+		goto out_close_out;
 	}
 	else if(n < 0){
 		printk("harddog_open - read of watchdog pipe failed, "
-		       "errno = %d\n", errno);
+		       "err = %d\n", -n);
 		helper_wait(pid);
-		err = -errno;
-		goto out;
+		err = n;
+		goto out_close_out;
 	}
 	*in_fd_ret = in_fds[0];
 	*out_fd_ret = out_fds[1];
 	return(0);
+
+ out_close_in:
+	os_close_file(in_fds[0]);
+	os_close_file(in_fds[1]);
+ out_close_out:
+	os_close_file(out_fds[0]);
+	os_close_file(out_fds[1]);
  out:
-	close(out_fds[1]);
-	close(in_fds[0]);
 	return(err);
 }
 
 void stop_watchdog(int in_fd, int out_fd)
 {
-	close(in_fd);
-	close(out_fd);
+	os_close_file(in_fd);
+	os_close_file(out_fd);
 }
 
 int ping_watchdog(int fd)
@@ -115,11 +120,12 @@
 	int n;
 	char c = '\n';
 
-	n = write(fd, &c, sizeof(c));
-	if(n < sizeof(c)){
-		printk("ping_watchdog - write failed, errno = %d\n",
-		       errno);
-		return(-errno);
+	n = os_write_file(fd, &c, sizeof(c));
+	if(n != sizeof(c)){
+		printk("ping_watchdog - write failed, err = %d\n", -n);
+		if(n < 0) 
+			return(n);
+		return(-EIO);
 	}
 	return 1;
 
--- diff/arch/um/drivers/hostaudio_kern.c	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/um/drivers/hostaudio_kern.c	2004-02-09 10:39:51.000000000 +0000
@@ -5,12 +5,12 @@
 
 #include "linux/config.h"
 #include "linux/module.h"
-#include "linux/version.h"
 #include "linux/init.h"
 #include "linux/slab.h"
 #include "linux/fs.h"
 #include "linux/sound.h"
 #include "linux/soundcard.h"
+#include "asm/uaccess.h"
 #include "kern_util.h"
 #include "init.h"
 #include "hostaudio.h"
@@ -19,30 +19,39 @@
 char *dsp = HOSTAUDIO_DEV_DSP;
 char *mixer = HOSTAUDIO_DEV_MIXER;
 
+#define DSP_HELP \
+"    This is used to specify the host dsp device to the hostaudio driver.\n" \
+"    The default is \"" HOSTAUDIO_DEV_DSP "\".\n\n"
+
+#define MIXER_HELP \
+"    This is used to specify the host mixer device to the hostaudio driver.\n" \
+"    The default is \"" HOSTAUDIO_DEV_MIXER "\".\n\n"
+
 #ifndef MODULE
 static int set_dsp(char *name, int *add)
 {
-	dsp = uml_strdup(name);
+	dsp = name;
 	return(0);
 }
 
-__uml_setup("dsp=", set_dsp,
-"dsp=<dsp device>\n"
-"    This is used to specify the host dsp device to the hostaudio driver.\n"
-"    The default is \"" HOSTAUDIO_DEV_DSP "\".\n\n"
-);
+__uml_setup("dsp=", set_dsp, "dsp=<dsp device>\n" DSP_HELP);
 
 static int set_mixer(char *name, int *add)
 {
-	mixer = uml_strdup(name);
+	mixer = name;
 	return(0);
 }
 
-__uml_setup("mixer=", set_mixer,
-"mixer=<mixer device>\n"
-"    This is used to specify the host mixer device to the hostaudio driver.\n"
-"    The default is \"" HOSTAUDIO_DEV_MIXER "\".\n\n"
-);
+__uml_setup("mixer=", set_mixer, "mixer=<mixer device>\n" MIXER_HELP);
+
+#else /*MODULE*/
+
+MODULE_PARM(dsp, "s");
+MODULE_PARM_DESC(dsp, DSP_HELP);
+
+MODULE_PARM(mixer, "s");
+MODULE_PARM_DESC(mixer, MIXER_HELP);
+
 #endif
 
 /* /dev/dsp file operations */
@@ -51,23 +60,55 @@
 			      loff_t *ppos)
 {
         struct hostaudio_state *state = file->private_data;
+	void *kbuf;
+	int err;
 
 #ifdef DEBUG
         printk("hostaudio: read called, count = %d\n", count);
 #endif
 
-        return(hostaudio_read_user(state, buffer, count, ppos));
+	kbuf = kmalloc(count, GFP_KERNEL);
+	if(kbuf == NULL)
+		return(-ENOMEM);
+
+        err = hostaudio_read_user(state, kbuf, count, ppos);
+	if(err < 0)
+		goto out;
+
+	if(copy_to_user(buffer, kbuf, err))
+		err = -EFAULT;
+
+ out:
+	kfree(kbuf);
+	return(err);
 }
 
 static ssize_t hostaudio_write(struct file *file, const char *buffer, 
 			       size_t count, loff_t *ppos)
 {
         struct hostaudio_state *state = file->private_data;
+	void *kbuf;
+	int err;
 
 #ifdef DEBUG
         printk("hostaudio: write called, count = %d\n", count);
 #endif
-        return(hostaudio_write_user(state, buffer, count, ppos));
+
+	kbuf = kmalloc(count, GFP_KERNEL);
+	if(kbuf == NULL)
+		return(-ENOMEM);
+
+	err = -EFAULT;
+	if(copy_from_user(kbuf, buffer, count))
+		goto out;
+
+        err = hostaudio_write_user(state, kbuf, count, ppos);
+	if(err < 0)
+		goto out;
+
+ out:
+	kfree(kbuf);
+	return(err);
 }
 
 static unsigned int hostaudio_poll(struct file *file, 
@@ -86,12 +127,43 @@
 			   unsigned int cmd, unsigned long arg)
 {
         struct hostaudio_state *state = file->private_data;
+	unsigned long data = 0;
+	int err;
 
 #ifdef DEBUG
         printk("hostaudio: ioctl called, cmd = %u\n", cmd);
 #endif
+	switch(cmd){
+	case SNDCTL_DSP_SPEED:
+	case SNDCTL_DSP_STEREO:
+	case SNDCTL_DSP_GETBLKSIZE:
+	case SNDCTL_DSP_CHANNELS:
+	case SNDCTL_DSP_SUBDIVIDE:
+	case SNDCTL_DSP_SETFRAGMENT:
+		if(get_user(data, (int *) arg))
+			return(-EFAULT);
+		break;
+	default:
+		break;
+	}
+
+        err = hostaudio_ioctl_user(state, cmd, (unsigned long) &data);
+
+	switch(cmd){
+	case SNDCTL_DSP_SPEED:
+	case SNDCTL_DSP_STEREO:
+	case SNDCTL_DSP_GETBLKSIZE:
+	case SNDCTL_DSP_CHANNELS:
+	case SNDCTL_DSP_SUBDIVIDE:
+	case SNDCTL_DSP_SETFRAGMENT:
+		if(put_user(data, (int *) arg))
+			return(-EFAULT);
+		break;
+	default:
+		break;
+	}
 
-        return(hostaudio_ioctl_user(state, cmd, arg));
+	return(err);
 }
 
 static int hostaudio_open(struct inode *inode, struct file *file)
@@ -225,7 +297,8 @@
 
 static int __init hostaudio_init_module(void)
 {
-        printk(KERN_INFO "UML Audio Relay\n");
+        printk(KERN_INFO "UML Audio Relay (host dsp = %s, host mixer = %s)\n",
+	       dsp, mixer);
 
 	module_data.dev_audio = register_sound_dsp(&hostaudio_fops, -1);
         if(module_data.dev_audio < 0){
--- diff/arch/um/drivers/hostaudio_user.c	2002-10-16 04:28:30.000000000 +0100
+++ source/arch/um/drivers/hostaudio_user.c	2004-02-09 10:39:51.000000000 +0000
@@ -4,9 +4,6 @@
  */
 
 #include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/ioctl.h>
-#include <fcntl.h>
 #include <unistd.h>
 #include <errno.h>
 #include "hostaudio.h"
@@ -20,45 +17,31 @@
 ssize_t hostaudio_read_user(struct hostaudio_state *state, char *buffer, 
 			    size_t count, loff_t *ppos)
 {
-	ssize_t ret;
-
 #ifdef DEBUG
         printk("hostaudio: read_user called, count = %d\n", count);
 #endif
 
-        ret = read(state->fd, buffer, count);
-
-        if(ret < 0) return(-errno);
-        return(ret);
+	return(os_read_file(state->fd, buffer, count));
 }
 
 ssize_t hostaudio_write_user(struct hostaudio_state *state, const char *buffer,
 			     size_t count, loff_t *ppos)
 {
-	ssize_t ret;
-
 #ifdef DEBUG
         printk("hostaudio: write_user called, count = %d\n", count);
 #endif
 
-        ret = write(state->fd, buffer, count);
-
-        if(ret < 0) return(-errno);
-        return(ret);
+	return(os_write_file(state->fd, buffer, count));
 }
 
 int hostaudio_ioctl_user(struct hostaudio_state *state, unsigned int cmd, 
 			 unsigned long arg)
 {
-	int ret;
 #ifdef DEBUG
         printk("hostaudio: ioctl_user called, cmd = %u\n", cmd);
 #endif
 
-        ret = ioctl(state->fd, cmd, arg);
-	
-        if(ret < 0) return(-errno);
-        return(ret);
+	return(os_ioctl_generic(state->fd, cmd, arg));
 }
 
 int hostaudio_open_user(struct hostaudio_state *state, int r, int w, char *dsp)
@@ -67,14 +50,15 @@
         printk("hostaudio: open_user called\n");
 #endif
 
-        state->fd = os_open_file(dsp, of_set_rw(OPENFLAGS(), r, w), 0);
-
-        if(state->fd >= 0) return(0);
+	state->fd = os_open_file(dsp, of_set_rw(OPENFLAGS(), r, w), 0);
 
-        printk("hostaudio_open_user failed to open '%s', errno = %d\n",
-	       dsp, errno);
+	if(state->fd < 0) {
+		printk("hostaudio_open_user failed to open '%s', err = %d\n",
+		       dsp, -state->fd);
+		return(state->fd); 
+	}
         
-        return(-errno); 
+	return(0);
 }
 
 int hostaudio_release_user(struct hostaudio_state *state)
@@ -82,10 +66,10 @@
 #ifdef DEBUG
         printk("hostaudio: release called\n");
 #endif
-        if(state->fd >= 0){
-		close(state->fd);
-		state->fd=-1;
-        }
+	if(state->fd >= 0){
+		os_close_file(state->fd);
+		state->fd = -1;
+	}
 
         return(0);
 }
@@ -95,15 +79,11 @@
 int hostmixer_ioctl_mixdev_user(struct hostmixer_state *state, 
 				unsigned int cmd, unsigned long arg)
 {
-	int ret;
 #ifdef DEBUG
         printk("hostmixer: ioctl_user called cmd = %u\n",cmd);
 #endif
 
-        ret = ioctl(state->fd, cmd, arg);
-	if(ret < 0) 
-		return(-errno);
-	return(ret);
+	return(os_ioctl_generic(state->fd, cmd, arg));
 }
 
 int hostmixer_open_mixdev_user(struct hostmixer_state *state, int r, int w,
@@ -115,12 +95,13 @@
 
         state->fd = os_open_file(mixer, of_set_rw(OPENFLAGS(), r, w), 0);
 
-        if(state->fd >= 0) return(0);
-
-        printk("hostaudio_open_mixdev_user failed to open '%s', errno = %d\n",
-	       mixer, errno);
+	if(state->fd < 0) {
+	        printk("hostaudio_open_mixdev_user failed to open '%s', "
+		       "err = %d\n", mixer, state->fd);
+		return(state->fd); 
+	}
         
-        return(-errno); 
+	return(0);
 }
 
 int hostmixer_release_mixdev_user(struct hostmixer_state *state)
@@ -130,7 +111,7 @@
 #endif
 
         if(state->fd >= 0){
-		close(state->fd);
+		os_close_file(state->fd);
 		state->fd = -1;
         }
 
--- diff/arch/um/drivers/line.c	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/um/drivers/line.c	2004-02-09 10:39:51.000000000 +0000
@@ -6,8 +6,8 @@
 #include "linux/sched.h"
 #include "linux/slab.h"
 #include "linux/list.h"
+#include "linux/interrupt.h"
 #include "linux/devfs_fs_kernel.h"
-#include "asm/irq.h"
 #include "asm/uaccess.h"
 #include "chan_kern.h"
 #include "irq_user.h"
@@ -16,38 +16,55 @@
 #include "user_util.h"
 #include "kern_util.h"
 #include "os.h"
+#include "irq_kern.h"
 
 #define LINE_BUFSIZE 4096
 
-void line_interrupt(int irq, void *data, struct pt_regs *unused)
+static irqreturn_t line_interrupt(int irq, void *data, struct pt_regs *unused)
 {
 	struct line *dev = data;
 
 	if(dev->count > 0) 
 		chan_interrupt(&dev->chan_list, &dev->task, dev->tty, irq, 
 			       dev);
+	return IRQ_HANDLED;
 }
 
-void line_timer_cb(void *arg)
+static void line_timer_cb(void *arg)
 {
 	struct line *dev = arg;
 
 	line_interrupt(dev->driver->read_irq, dev, NULL);
 }
 
-static void buffer_data(struct line *line, const char *buf, int len)
+static int write_room(struct line *dev)
 {
-	int end;
+	int n;
+
+	if(dev->buffer == NULL) return(LINE_BUFSIZE - 1);
+
+	n = dev->head - dev->tail;
+	if(n <= 0) n = LINE_BUFSIZE + n;
+	return(n - 1);
+}
+
+static int buffer_data(struct line *line, const char *buf, int len)
+{
+	int end, room;
 
 	if(line->buffer == NULL){
 		line->buffer = kmalloc(LINE_BUFSIZE, GFP_ATOMIC);
 		if(line->buffer == NULL){
 			printk("buffer_data - atomic allocation failed\n");
-			return;
+			return(0);
 		}
 		line->head = line->buffer;
 		line->tail = line->buffer;
 	}
+
+	room = write_room(line);
+	len = (len > room) ? room : len;
+
 	end = line->buffer + LINE_BUFSIZE - line->tail;
 	if(len < end){
 		memcpy(line->tail, buf, len);
@@ -60,6 +77,8 @@
 		memcpy(line->buffer, buf, len);
 		line->tail = line->buffer + len;
 	}
+
+	return(len);
 }
 
 static int flush_buffer(struct line *line)
@@ -95,7 +114,7 @@
 	struct line *line;
 	char *new;
 	unsigned long flags;
-	int n, err, i;
+	int n, err, i, ret = 0;
 
 	if(tty->stopped) return 0;
 
@@ -104,9 +123,13 @@
 		if(new == NULL)
 			return(0);
 		n = copy_from_user(new, buf, len);
-		if(n == len)
-			return(-EFAULT);
 		buf = new;
+		if(n == len){
+			len = -EFAULT;
+			goto out_free;
+		}
+
+		len -= n;
 	}
 
 	i = tty->index;
@@ -115,41 +138,50 @@
 	down(&line->sem);
 	if(line->head != line->tail){
 		local_irq_save(flags);
-		buffer_data(line, buf, len);
+		ret += buffer_data(line, buf, len);
 		err = flush_buffer(line);
 		local_irq_restore(flags);
 		if(err <= 0)
-			goto out;
+			goto out_up;
 	}
 	else {
 		n = write_chan(&line->chan_list, buf, len, 
 			       line->driver->write_irq);
 		if(n < 0){
-			len = n;
-			goto out;
+			ret = n;
+			goto out_up;
 		}
-		if(n < len)
-			buffer_data(line, buf + n, len - n);
+
+		len -= n;
+		ret += n;
+		if(len > 0)
+			ret += buffer_data(line, buf + n, len);
 	}
- out:
+ out_up:
 	up(&line->sem);
-	return(len);
+ out_free:
+	if(from_user)
+		kfree(buf);
+	return(ret);
 }
 
-void line_write_interrupt(int irq, void *data, struct pt_regs *unused)
+static irqreturn_t line_write_interrupt(int irq, void *data, 
+					struct pt_regs *unused)
 {
 	struct line *dev = data;
 	struct tty_struct *tty = dev->tty;
 	int err;
 
 	err = flush_buffer(dev);
-	if(err == 0) return;
+	if(err == 0) 
+		return(IRQ_NONE);
 	else if(err < 0){
 		dev->head = dev->buffer;
 		dev->tail = dev->buffer;
 	}
 
-	if(tty == NULL) return;
+	if(tty == NULL) 
+		return(IRQ_NONE);
 
 	if(test_bit(TTY_DO_WRITE_WAKEUP, &tty->flags) &&
 	   (tty->ldisc.write_wakeup != NULL))
@@ -161,21 +193,9 @@
 	 * writes.
 	 */
 
-	if (waitqueue_active(&tty->write_wait))
+	if(waitqueue_active(&tty->write_wait))
 		wake_up_interruptible(&tty->write_wait);
-
-}
-
-int line_write_room(struct tty_struct *tty)
-{
-	struct line *dev = tty->driver_data;
-	int n;
-
-	if(dev->buffer == NULL) return(LINE_BUFSIZE - 1);
-
-	n = dev->head - dev->tail;
-	if(n <= 0) n = LINE_BUFSIZE + n;
-	return(n - 1);
+	return(IRQ_HANDLED);
 }
 
 int line_setup_irq(int fd, int input, int output, void *data)
@@ -305,7 +325,7 @@
 		if(*end != '='){
 			printk(KERN_ERR "line_setup failed to parse \"%s\"\n", 
 			       init);
-			return(1);
+			return(0);
 		}
 		init = end;
 	}
@@ -313,12 +333,12 @@
 	if((n >= 0) && (n >= num)){
 		printk("line_setup - %d out of range ((0 ... %d) allowed)\n",
 		       n, num);
-		return(1);
+		return(0);
 	}
 	else if(n >= 0){
 		if(lines[n].count > 0){
 			printk("line_setup - device %d is open\n", n);
-			return(1);
+			return(0);
 		}
 		if(lines[n].init_pri <= INIT_ONE){
 			lines[n].init_pri = INIT_ONE;
@@ -332,7 +352,7 @@
 	else if(!all_allowed){
 		printk("line_setup - can't configure all devices from "
 		       "mconsole\n");
-		return(1);
+		return(0);
 	}
 	else {
 		for(i = 0; i < num; i++){
@@ -346,7 +366,7 @@
 			}
 		}
 	}
-	return(0);
+	return(1);
 }
 
 int line_config(struct line *lines, int num, char *str)
@@ -357,7 +377,7 @@
 		printk("line_config - uml_strdup failed\n");
 		return(-ENOMEM);
 	}
-	return(line_setup(lines, num, new, 0));
+	return(!line_setup(lines, num, new, 0));
 }
 
 int line_get_config(char *name, struct line *lines, int num, char *str, 
@@ -369,7 +389,7 @@
 
 	dev = simple_strtoul(name, &end, 0);
 	if((*end != '\0') || (end == name)){
-		*error_out = "line_setup failed to parse device number";
+		*error_out = "line_get_config failed to parse device number";
 		return(0);
 	}
 
@@ -379,15 +399,15 @@
 	}
 
 	line = &lines[dev];
+
 	down(&line->sem);
-	
 	if(!line->valid)
 		CONFIG_CHUNK(str, size, n, "none", 1);
 	else if(line->count == 0)
 		CONFIG_CHUNK(str, size, n, line->init_str, 1);
 	else n = chan_config_string(&line->chan_list, str, size, error_out);
-
 	up(&line->sem);
+
 	return(n);
 }
 
@@ -396,7 +416,14 @@
 	char config[sizeof("conxxxx=none\0")];
 
 	sprintf(config, "%s=none", str);
-	return(line_setup(lines, num, config, 0));
+	return(!line_setup(lines, num, config, 0));
+}
+
+int line_write_room(struct tty_struct *tty)
+{
+	struct line *dev = tty->driver_data;
+
+	return(write_room(dev));
 }
 
 struct tty_driver *line_register_devfs(struct lines *set,
@@ -412,7 +439,8 @@
 		return NULL;
 
 	driver->driver_name = line_driver->name;
-	driver->name = line_driver->devfs_name;
+	driver->name = line_driver->device_name;
+	driver->devfs_name = line_driver->devfs_name;
 	driver->major = line_driver->major;
 	driver->minor_start = line_driver->minor_start;
 	driver->type = line_driver->type;
@@ -432,7 +460,7 @@
 
 	for(i = 0; i < nlines; i++){
 		if(!lines[i].valid) 
-			tty_unregister_devfs(driver, i);
+			tty_unregister_device(driver, i);
 	}
 
 	mconsole_register_dev(&line_driver->mc);
@@ -465,24 +493,25 @@
 	struct line *line;
 };
 
-void winch_interrupt(int irq, void *data, struct pt_regs *unused)
+irqreturn_t winch_interrupt(int irq, void *data, struct pt_regs *unused)
 {
 	struct winch *winch = data;
 	struct tty_struct *tty;
 	int err;
 	char c;
 
-	err = generic_read(winch->fd, &c, NULL);
-	if(err < 0){
-		if(err != -EAGAIN){
-			printk("winch_interrupt : read failed, errno = %d\n", 
-			       -err);
-			printk("fd %d is losing SIGWINCH support\n", 
-			       winch->tty_fd);
-			free_irq(irq, data);
-			return;
+	if(winch->fd != -1){
+		err = generic_read(winch->fd, &c, NULL);
+		if(err < 0){
+			if(err != -EAGAIN){
+				printk("winch_interrupt : read failed, "
+				       "errno = %d\n", -err);
+				printk("fd %d is losing SIGWINCH support\n", 
+				       winch->tty_fd);
+				return(IRQ_HANDLED);
+			}
+			goto out;
 		}
-		goto out;
 	}
 	tty = winch->line->tty;
 	if(tty != NULL){
@@ -492,7 +521,9 @@
 		kill_pg(tty->pgrp, SIGWINCH, 1);
 	}
  out:
-	reactivate_fd(winch->fd, WINCH_IRQ);
+	if(winch->fd != -1)
+		reactivate_fd(winch->fd, WINCH_IRQ);
+	return(IRQ_HANDLED);
 }
 
 DECLARE_MUTEX(winch_handler_sem);
@@ -529,7 +560,10 @@
 
 	list_for_each(ele, &winch_handlers){
 		winch = list_entry(ele, struct winch, list);
-		close(winch->fd);
+		if(winch->fd != -1){
+			deactivate_fd(winch->fd, WINCH_IRQ);
+			os_close_file(winch->fd);
+		}
 		if(winch->pid != -1) 
 			os_kill_process(winch->pid, 1);
 	}
--- diff/arch/um/drivers/mcast_user.c	2003-02-13 11:46:50.000000000 +0000
+++ source/arch/um/drivers/mcast_user.c	2004-02-09 10:39:51.000000000 +0000
@@ -23,6 +23,7 @@
 #include "kern_util.h"
 #include "user_util.h"
 #include "user.h"
+#include "os.h"
 
 #define MAX_PACKET (ETH_MAX_PACKET + ETH_HEADER_OTHER)
 
@@ -62,7 +63,8 @@
 		goto out;
 	}
 
-	if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0){
+	fd = socket(AF_INET, SOCK_DGRAM, 0);
+	if (fd < 0){
 		printk("mcast_open : data socket failed, errno = %d\n", 
 		       errno);
 		fd = -ENOMEM;
@@ -72,7 +74,7 @@
 	if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(yes)) < 0) {
 		printk("mcast_open: SO_REUSEADDR failed, errno = %d\n",
 			errno);
-		close(fd);
+		os_close_file(fd);
 		fd = -EINVAL;
 		goto out;
 	}
@@ -82,7 +84,7 @@
 		       sizeof(pri->ttl)) < 0) {
 		printk("mcast_open: IP_MULTICAST_TTL failed, error = %d\n",
 			errno);
-		close(fd);
+		os_close_file(fd);
 		fd = -EINVAL;
 		goto out;
 	}
@@ -91,7 +93,7 @@
 	if (setsockopt(fd, SOL_IP, IP_MULTICAST_LOOP, &yes, sizeof(yes)) < 0) {
 		printk("mcast_open: IP_MULTICAST_LOOP failed, error = %d\n",
 			errno);
-		close(fd);
+		os_close_file(fd);
 		fd = -EINVAL;
 		goto out;
 	}
@@ -99,7 +101,7 @@
 	/* bind socket to mcast address */
 	if (bind(fd, (struct sockaddr *) sin, sizeof(*sin)) < 0) {
 		printk("mcast_open : data bind failed, errno = %d\n", errno);
-		close(fd);
+		os_close_file(fd);
 		fd = -EINVAL;
 		goto out;
 	}		
@@ -115,7 +117,7 @@
 		       "interface on the host.\n");
 		printk("eth0 should be configured in order to use the "
 		       "multicast transport.\n");
-		close(fd);
+		os_close_file(fd);
 		fd = -EINVAL;
 	}
 
@@ -137,7 +139,7 @@
 			errno);
 	}
 
-	close(fd);
+	os_close_file(fd);
 }
 
 int mcast_user_write(int fd, void *buf, int len, struct mcast_data *pri)
--- diff/arch/um/drivers/mconsole_kern.c	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/um/drivers/mconsole_kern.c	2004-02-09 10:39:51.000000000 +0000
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2001 Lennert Buytenhek (buytenh@gnu.org)
- * Copyright (C) 2001, 2002 Jeff Dike (jdike@karaya.com)
+ * Copyright (C) 2001 - 2003 Jeff Dike (jdike@addtoit.com)
  * Licensed under the GPL
  */
 
@@ -15,6 +15,9 @@
 #include "linux/sysrq.h"
 #include "linux/workqueue.h"
 #include "linux/module.h"
+#include "linux/file.h"
+#include "linux/fs.h"
+#include "linux/namei.h"
 #include "linux/proc_fs.h"
 #include "asm/irq.h"
 #include "asm/uaccess.h"
@@ -27,6 +30,7 @@
 #include "init.h"
 #include "os.h"
 #include "umid.h"
+#include "irq_kern.h"
 
 static int do_unlink_socket(struct notifier_block *notifier, 
 			    unsigned long what, void *data)
@@ -67,7 +71,7 @@
 
 DECLARE_WORK(mconsole_work, mc_work_proc, NULL);
 
-void mconsole_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+irqreturn_t mconsole_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	int fd;
 	struct mconsole_entry *new;
@@ -75,9 +79,10 @@
 
 	fd = (int) dev_id;
 	while (mconsole_get_request(fd, &req)){
-		if(req.cmd->as_interrupt) (*req.cmd->handler)(&req);
+		if(req.cmd->context == MCONSOLE_INTR) 
+			(*req.cmd->handler)(&req);
 		else {
-			new = kmalloc(sizeof(req), GFP_ATOMIC);
+			new = kmalloc(sizeof(*new), GFP_ATOMIC);
 			if(new == NULL)
 				mconsole_reply(&req, "Out of memory", 1, 0);
 			else {
@@ -88,6 +93,7 @@
 	}
 	if(!list_empty(&mc_requests)) schedule_work(&mconsole_work);
 	reactivate_fd(fd, MCONSOLE_IRQ);
+	return(IRQ_HANDLED);
 }
 
 void mconsole_version(struct mc_request *req)
@@ -100,20 +106,110 @@
 	mconsole_reply(req, version, 0, 0);
 }
 
+void mconsole_log(struct mc_request *req)
+{
+	int len;
+	char *ptr = req->request.data;
+	
+	ptr += strlen("log");
+	while(isspace(*ptr)) ptr++;
+
+	len = req->len - (ptr - req->request.data);
+	printk("%.*s", len, ptr);
+	mconsole_reply(req, "", 0, 0);
+}
+
+void mconsole_proc(struct mc_request *req)
+{
+	struct nameidata nd;
+	struct file_system_type *proc;
+	struct super_block *super;
+	struct file *file;
+	int n, err;
+	char *ptr = req->request.data, *buf;
+	
+	ptr += strlen("proc");
+	while(isspace(*ptr)) ptr++;
+
+	proc = get_fs_type("proc");
+	if(proc == NULL){
+		mconsole_reply(req, "procfs not registered", 1, 0);
+		goto out;
+	}
+
+	super = (*proc->get_sb)(proc, 0, NULL, NULL);
+	put_filesystem(proc);
+	if(super == NULL){
+		mconsole_reply(req, "Failed to get procfs superblock", 1, 0);
+		goto out;
+	}
+	up_write(&super->s_umount);
+
+	nd.dentry = super->s_root;
+	nd.mnt = NULL;
+	nd.flags = O_RDONLY + 1;
+	nd.last_type = LAST_ROOT;
+
+	err = link_path_walk(ptr, &nd);
+	if(err){
+		mconsole_reply(req, "Failed to look up file", 1, 0);
+		goto out_kill;
+	}
+
+	file = dentry_open(nd.dentry, nd.mnt, O_RDONLY);
+	if(IS_ERR(file)){
+		mconsole_reply(req, "Failed to open file", 1, 0);
+		goto out_kill;
+	}
+
+	buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
+	if(buf == NULL){
+		mconsole_reply(req, "Failed to allocate buffer", 1, 0);
+		goto out_fput;
+	}
+
+	if((file->f_op != NULL) && (file->f_op->read != NULL)){
+		do {
+			n = (*file->f_op->read)(file, buf, PAGE_SIZE - 1, 
+						&file->f_pos);
+			if(n >= 0){
+				buf[n] = '\0';
+				mconsole_reply(req, buf, 0, (n > 0));
+			}
+			else {
+				mconsole_reply(req, "Read of file failed", 
+					       1, 0);
+				goto out_free;
+			}
+		} while(n > 0);
+	}
+	else mconsole_reply(req, "", 0, 0);
+
+ out_free:
+	kfree(buf);
+ out_fput:
+	fput(file);
+ out_kill:
+	deactivate_super(super);
+ out: ;
+}
+
 #define UML_MCONSOLE_HELPTEXT \
-"Commands:
-    version - Get kernel version
-    help - Print this message
-    halt - Halt UML
-    reboot - Reboot UML
-    config <dev>=<config> - Add a new device to UML; 
-	same syntax as command line
-    config <dev> - Query the configuration of a device
-    remove <dev> - Remove a device from UML
-    sysrq <letter> - Performs the SysRq action controlled by the letter
-    cad - invoke the Ctl-Alt-Del handler
-    stop - pause the UML; it will do nothing until it receives a 'go'
-    go - continue the UML after a 'stop'
+"Commands: \n\
+    version - Get kernel version \n\
+    help - Print this message \n\
+    halt - Halt UML \n\
+    reboot - Reboot UML \n\
+    config <dev>=<config> - Add a new device to UML;  \n\
+	same syntax as command line \n\
+    config <dev> - Query the configuration of a device \n\
+    remove <dev> - Remove a device from UML \n\
+    sysrq <letter> - Performs the SysRq action controlled by the letter \n\
+    cad - invoke the Ctl-Alt-Del handler \n\
+    stop - pause the UML; it will do nothing until it receives a 'go' \n\
+    go - continue the UML after a 'stop' \n\
+    log <string> - make UML enter <string> into the kernel log\n\
+    proc <file> - returns the contents of the UML's /proc/<file>\n\
 "
 
 void mconsole_help(struct mc_request *req)
@@ -302,7 +398,7 @@
 	if(umid_file_name("mconsole", file, sizeof(file))) return(-1);
 	snprintf(mconsole_socket_name, sizeof(file), "%s", file);
 
-	sock = create_unix_socket(file, sizeof(file));
+	sock = os_create_unix_socket(file, sizeof(file), 1);
 	if (sock < 0){
 		printk("Failed to initialize management console\n");
 		return(1);
@@ -344,11 +440,16 @@
 	if(buf == NULL) 
 		return(-ENOMEM);
 
-	if(copy_from_user(buf, buffer, count))
-		return(-EFAULT);
+	if(copy_from_user(buf, buffer, count)){
+		count = -EFAULT;
+		goto out;
+	}
+
 	buf[count] = '\0';
 
 	mconsole_notify(notify_socket, MCONSOLE_USER_NOTIFY, buf, count);
+ out:
+	kfree(buf);
 	return(count);
 }
 
--- diff/arch/um/drivers/mconsole_user.c	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/um/drivers/mconsole_user.c	2004-02-09 10:39:51.000000000 +0000
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2001 Lennert Buytenhek (buytenh@gnu.org)
- * Copyright (C) 2001, 2002 Jeff Dike (jdike@karaya.com)
+ * Copyright (C) 2001 - 2003 Jeff Dike (jdike@addtoit.com)
  * Licensed under the GPL
  */
 
@@ -18,16 +18,18 @@
 #include "umid.h"
 
 static struct mconsole_command commands[] = {
-	{ "version", mconsole_version, 1 },
-	{ "halt", mconsole_halt, 0 },
-	{ "reboot", mconsole_reboot, 0 },
-	{ "config", mconsole_config, 0 },
-	{ "remove", mconsole_remove, 0 },
-	{ "sysrq", mconsole_sysrq, 1 },
-	{ "help", mconsole_help, 1 },
-	{ "cad", mconsole_cad, 1 },
-	{ "stop", mconsole_stop, 0 },
-	{ "go", mconsole_go, 1 },
+	{ "version", mconsole_version, MCONSOLE_INTR },
+	{ "halt", mconsole_halt, MCONSOLE_PROC },
+	{ "reboot", mconsole_reboot, MCONSOLE_PROC },
+	{ "config", mconsole_config, MCONSOLE_PROC },
+	{ "remove", mconsole_remove, MCONSOLE_PROC },
+	{ "sysrq", mconsole_sysrq, MCONSOLE_INTR },
+	{ "help", mconsole_help, MCONSOLE_INTR },
+	{ "cad", mconsole_cad, MCONSOLE_INTR },
+	{ "stop", mconsole_stop, MCONSOLE_PROC },
+	{ "go", mconsole_go, MCONSOLE_INTR },
+	{ "log", mconsole_log, MCONSOLE_INTR },
+	{ "proc", mconsole_proc, MCONSOLE_PROC },
 };
 
 /* Initialized in mconsole_init, which is an initcall */
@@ -139,6 +141,7 @@
 		memcpy(reply.data, str, len);
 		reply.data[len] = '\0';
 		total -= len;
+		str += len;
 		reply.len = len + 1;
 
 		len = sizeof(reply) + reply.len - sizeof(reply.data);
--- diff/arch/um/drivers/mmapper_kern.c	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/um/drivers/mmapper_kern.c	2004-02-09 10:39:51.000000000 +0000
@@ -120,7 +120,10 @@
 	printk(KERN_INFO "Mapper v0.1\n");
 
 	v_buf = (char *) find_iomem("mmapper", &mmapper_size);
-	if(mmapper_size == 0) return(0);
+	if(mmapper_size == 0){
+		printk(KERN_ERR "mmapper_init - find_iomem failed\n");
+		return(0);
+	}
 
 	p_buf = __pa(v_buf);
 
--- diff/arch/um/drivers/net_kern.c	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/um/drivers/net_kern.c	2004-02-09 10:39:51.000000000 +0000
@@ -26,6 +26,7 @@
 #include "mconsole_kern.h"
 #include "init.h"
 #include "irq_user.h"
+#include "irq_kern.h"
 
 static spinlock_t opened_lock = SPIN_LOCK_UNLOCKED;
 LIST_HEAD(opened);
@@ -37,7 +38,8 @@
 	struct sk_buff *skb;
 
 	/* If we can't allocate memory, try again next round. */
-	if ((skb = dev_alloc_skb(dev->mtu)) == NULL) {
+	skb = dev_alloc_skb(dev->mtu);
+	if (skb == NULL) {
 		lp->stats.rx_dropped++;
 		return 0;
 	}
@@ -61,14 +63,14 @@
 	return pkt_len;
 }
 
-void uml_net_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+irqreturn_t uml_net_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct net_device *dev = dev_id;
 	struct uml_net_private *lp = dev->priv;
 	int err;
 
 	if(!netif_running(dev))
-		return;
+		return(IRQ_NONE);
 
 	spin_lock(&lp->lock);
 	while((err = uml_net_rx(dev)) > 0) ;
@@ -83,6 +85,7 @@
 
  out:
 	spin_unlock(&lp->lock);
+	return(IRQ_HANDLED);
 }
 
 static int uml_net_open(struct net_device *dev)
@@ -252,37 +255,6 @@
 #endif
 }
 
-/*
- * default do nothing hard header packet routines for struct net_device init.
- * real ethernet transports will overwrite with real routines.
- */
-static int uml_net_hard_header(struct sk_buff *skb, struct net_device *dev,
-                 unsigned short type, void *daddr, void *saddr, unsigned len)
-{
-	return(0); /* no change */
-}
-
-static int uml_net_rebuild_header(struct sk_buff *skb)
-{
-	return(0); /* ignore */ 
-}
-
-static int uml_net_header_cache(struct neighbour *neigh, struct hh_cache *hh)
-{
-	return(-1); /* fail */
-}
-
-static void uml_net_header_cache_update(struct hh_cache *hh,
-                 struct net_device *dev, unsigned char * haddr)
-{
-	/* ignore */
-}
-
-static int uml_net_header_parse(struct sk_buff *skb, unsigned char *haddr)
-{
-	return(0); /* nothing */
-}
-
 static spinlock_t devices_lock = SPIN_LOCK_UNLOCKED;
 static struct list_head devices = LIST_HEAD_INIT(devices);
 
@@ -292,7 +264,7 @@
 	struct uml_net *device;
 	struct net_device *dev;
 	struct uml_net_private *lp;
-	int err, size;
+	int save, err, size;
 
 	size = transport->private_size + sizeof(struct uml_net_private) + 
 		sizeof(((struct uml_net_private *) 0)->user);
@@ -334,12 +306,6 @@
 	snprintf(dev->name, sizeof(dev->name), "eth%d", n);
 	device->dev = dev;
 
-        dev->hard_header = uml_net_hard_header;
-        dev->rebuild_header = uml_net_rebuild_header;
-        dev->hard_header_cache = uml_net_header_cache;
-        dev->header_cache_update= uml_net_header_cache_update;
-        dev->hard_header_parse = uml_net_header_parse;
-
 	(*transport->kern->init)(dev, init);
 
 	dev->mtu = transport->user->max_packet;
@@ -358,25 +324,37 @@
 	rtnl_lock();
 	err = register_netdevice(dev);
 	rtnl_unlock();
-	if (err)
+	if (err) {
+		device->dev = NULL;
+		/* XXX: should we call ->remove() here? */
+		free_netdev(dev);
 		return 1;
+	}
 	lp = dev->priv;
 
-	INIT_LIST_HEAD(&lp->list);
-	spin_lock_init(&lp->lock);
-	lp->dev = dev;
-	lp->fd = -1;
-	lp->mac = { 0xfe, 0xfd, 0x0, 0x0, 0x0, 0x0 };
-	lp->have_mac = device->have_mac;
-	lp->protocol = transport->kern->protocol;
-	lp->open = transport->user->open;
-	lp->close = transport->user->close;
-	lp->remove = transport->user->remove;
-	lp->read = transport->kern->read;
-	lp->write = transport->kern->write;
-	lp->add_address = transport->user->add_address;
-	lp->delete_address = transport->user->delete_address;
-	lp->set_mtu = transport->user->set_mtu;
+	/* lp.user is the first four bytes of the transport data, which
+	 * has already been initialized.  This structure assignment will
+	 * overwrite that, so we make sure that .user gets overwritten with
+	 * what it already has.
+	 */
+	save = lp->user[0];
+	*lp = ((struct uml_net_private) 
+		{ .list  		= LIST_HEAD_INIT(lp->list),
+		  .lock 		= SPIN_LOCK_UNLOCKED,
+		  .dev 			= dev,
+		  .fd 			= -1,
+		  .mac 			= { 0xfe, 0xfd, 0x0, 0x0, 0x0, 0x0},
+		  .have_mac 		= device->have_mac,
+		  .protocol 		= transport->kern->protocol,
+		  .open 		= transport->user->open,
+		  .close 		= transport->user->close,
+		  .remove 		= transport->user->remove,
+		  .read 		= transport->kern->read,
+		  .write 		= transport->kern->write,
+		  .add_address 		= transport->user->add_address,
+		  .delete_address  	= transport->user->delete_address,
+		  .set_mtu 		= transport->user->set_mtu,
+		  .user  		= { save } });
 
 	init_timer(&lp->tl);
 	lp->tl.function = uml_net_user_timer_expire;
@@ -609,7 +587,8 @@
 	unregister_netdev(dev);
 
 	list_del(&device->list);
-	free_netdev(device);
+	kfree(device);
+	free_netdev(dev);
 	return(0);
 }
 
--- diff/arch/um/drivers/net_user.c	2002-10-16 04:27:19.000000000 +0100
+++ source/arch/um/drivers/net_user.c	2004-02-09 10:39:51.000000000 +0000
@@ -26,8 +26,7 @@
 	if(gate_addr == NULL) return(0);
 	if(sscanf(gate_addr, "%d.%d.%d.%d", &tap_addr[0], 
 		  &tap_addr[1], &tap_addr[2], &tap_addr[3]) != 4){
-		printk("Invalid tap IP address - '%s'\n", 
-		       gate_addr);
+		printk("Invalid tap IP address - '%s'\n", gate_addr);
 		return(-EINVAL);
 	}
 	return(0);
@@ -60,18 +59,18 @@
 	}
 		
 	*output = '\0';
-	if(read(fd, &remain, sizeof(remain)) != sizeof(remain)){
-		printk("read_output - read of length failed, errno = %d\n",
-		       errno);
+	n = os_read_file(fd, &remain, sizeof(remain));
+	if(n != sizeof(remain)){
+		printk("read_output - read of length failed, err = %d\n", -n);
 		return;
 	}
 
 	while(remain != 0){
 		n = (remain < len) ? remain : len;
-		actual = read(fd, output, n);
+		actual = os_read_file(fd, output, n);
 		if(actual != n){
 			printk("read_output - read of data failed, "
-			       "errno = %d\n", errno);
+			       "err = %d\n", -actual);
 			return;
 		}
 		remain -= actual;
@@ -83,13 +82,12 @@
 {
 	int n;
 
-	while(((n = read(fd,  buf,  len)) < 0) && (errno == EINTR)) ;
+	n = os_read_file(fd,  buf,  len);
 
-	if(n < 0){
-		if(errno == EAGAIN) return(0);
-		return(-errno);
-	}
-	else if(n == 0) return(-ENOTCONN);
+	if(n == -EAGAIN) 
+		return(0);
+	else if(n == 0) 
+		return(-ENOTCONN);
 	return(n);
 }
 
@@ -112,13 +110,13 @@
 {
 	int n;
 
-	while(((n = write(fd, buf, len)) < 0) && (errno == EINTR)) ;
-	if(n < 0){
-		if(errno == EAGAIN) return(0);
-		return(-errno);
-	}
-	else if(n == 0) return(-ENOTCONN);
-	return(n);	
+	n = os_write_file(fd, buf, len);
+
+	if(n == -EAGAIN) 
+		return(0);
+	else if(n == 0) 
+		return(-ENOTCONN);
+	return(n);
 }
 
 int net_send(int fd, void *buf, int len)
@@ -157,7 +155,7 @@
 {
 	struct change_pre_exec_data *data = arg;
 
-	close(data->close_me);
+	os_close_file(data->close_me);
 	dup2(data->stdout, 1);
 }
 
@@ -167,15 +165,15 @@
 	struct change_pre_exec_data pe_data;
 
 	err = os_pipe(fds, 1, 0);
-	if(err){
-		printk("change_tramp - pipe failed, errno = %d\n", -err);
+	if(err < 0){
+		printk("change_tramp - pipe failed, err = %d\n", -err);
 		return(err);
 	}
 	pe_data.close_me = fds[0];
 	pe_data.stdout = fds[1];
 	pid = run_helper(change_pre_exec, &pe_data, argv, NULL);
 
-	close(fds[1]);
+	os_close_file(fds[1]);
 	read_output(fds[0], output, output_len);
 	waitpid(pid, NULL, 0);	
 	return(pid);
--- diff/arch/um/drivers/null.c	2003-02-13 11:46:50.000000000 +0000
+++ source/arch/um/drivers/null.c	2004-02-09 10:39:51.000000000 +0000
@@ -5,7 +5,6 @@
 
 #include <stdlib.h>
 #include <errno.h>
-#include <fcntl.h>
 #include "chan_user.h"
 #include "os.h"
 
--- diff/arch/um/drivers/port_kern.c	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/um/drivers/port_kern.c	2004-02-09 10:39:51.000000000 +0000
@@ -6,6 +6,7 @@
 #include "linux/list.h"
 #include "linux/sched.h"
 #include "linux/slab.h"
+#include "linux/interrupt.h"
 #include "linux/irq.h"
 #include "linux/spinlock.h"
 #include "linux/errno.h"
@@ -14,6 +15,7 @@
 #include "kern_util.h"
 #include "kern.h"
 #include "irq_user.h"
+#include "irq_kern.h"
 #include "port.h"
 #include "init.h"
 #include "os.h"
@@ -38,21 +40,21 @@
 struct connection {
 	struct list_head list;
 	int fd;
- 	int helper_pid;
+	int helper_pid;
 	int socket[2];
 	int telnetd_pid;
 	struct port_list *port;
 };
 
-static void pipe_interrupt(int irq, void *data, struct pt_regs *regs)
+static irqreturn_t pipe_interrupt(int irq, void *data, struct pt_regs *regs)
 {
 	struct connection *conn = data;
 	int fd;
 
- 	fd = os_rcv_fd(conn->socket[0], &conn->helper_pid);
+	fd = os_rcv_fd(conn->socket[0], &conn->helper_pid);
 	if(fd < 0){
 		if(fd == -EAGAIN)
-			return;
+			return(IRQ_NONE);
 
 		printk(KERN_ERR "pipe_interrupt : os_rcv_fd returned %d\n", 
 		       -fd);
@@ -65,6 +67,7 @@
 	list_add(&conn->list, &conn->port->connections);
 
 	up(&conn->port->sem);
+	return(IRQ_HANDLED);
 }
 
 static int port_accept(struct port_list *port)
@@ -102,8 +105,7 @@
 	}
 
 	list_add(&conn->list, &port->pending);
-	ret = 1;
-	goto out;
+	return(1);
 
  out_free:
 	kfree(conn);
@@ -138,12 +140,13 @@
 
 DECLARE_WORK(port_work, port_work_proc, NULL);
 
-static void port_interrupt(int irq, void *data, struct pt_regs *regs)
+static irqreturn_t port_interrupt(int irq, void *data, struct pt_regs *regs)
 {
 	struct port_list *port = data;
 
 	port->has_connection = 1;
 	schedule_work(&port_work);
+	return(IRQ_HANDLED);
 } 
 
 void *port_data(int port_num)
--- diff/arch/um/drivers/port_user.c	2003-02-13 11:46:50.000000000 +0000
+++ source/arch/um/drivers/port_user.c	2004-02-09 10:39:51.000000000 +0000
@@ -47,10 +47,12 @@
 		return(NULL);
 	}
 
-	if((kern_data = port_data(port)) == NULL) 
+	kern_data = port_data(port);
+	if(kern_data == NULL) 
 		return(NULL);
 
-	if((data = um_kmalloc(sizeof(*data))) == NULL) 
+	data = um_kmalloc(sizeof(*data));
+	if(data == NULL) 
 		goto err;
 
 	*data = ((struct port_chan) { .raw  		= opts->raw,
@@ -90,7 +92,7 @@
 	struct port_chan *data = d;
 
 	port_remove_dev(data->kernel_data);
-	close(fd);
+	os_close_file(fd);
 }
 
 int port_console_write(int fd, const char *buf, int n, void *d)
@@ -130,11 +132,15 @@
 		goto out;
 	}
   
-	if((listen(fd, 1) < 0) || (os_set_fd_block(fd, 0))){
+	if(listen(fd, 1) < 0){
 		err = -errno;
 		goto out;
 	}
 
+	err = os_set_fd_block(fd, 0);
+	if(err < 0)
+		goto out;
+
 	return(fd);
  out:
 	os_close_file(fd);
@@ -153,10 +159,10 @@
 	dup2(data->sock_fd, 0);
 	dup2(data->sock_fd, 1);
 	dup2(data->sock_fd, 2);
-	close(data->sock_fd);
+	os_close_file(data->sock_fd);
 	dup2(data->pipe_fd, 3);
 	os_shutdown_socket(3, 1, 0);
-	close(data->pipe_fd);
+	os_close_file(data->pipe_fd);
 }
 
 int port_connection(int fd, int *socket, int *pid_out)
@@ -166,11 +172,12 @@
 			 "/usr/lib/uml/port-helper", NULL };
 	struct port_pre_exec_data data;
 
-	if((new = os_accept_connection(fd)) < 0)
-		return(-errno);
+	new = os_accept_connection(fd);
+	if(new < 0)
+		return(new);
 
 	err = os_pipe(socket, 0, 0);
-	if(err) 
+	if(err < 0) 
 		goto out_close;
 
 	data = ((struct port_pre_exec_data)
@@ -186,11 +193,11 @@
 
  out_shutdown:
 	os_shutdown_socket(socket[0], 1, 1);
-	close(socket[0]);
+	os_close_file(socket[0]);
 	os_shutdown_socket(socket[1], 1, 1);	
-	close(socket[1]);
+	os_close_file(socket[1]);
  out_close:
-	close(new);
+	os_close_file(new);
 	return(err);
 }
 
--- diff/arch/um/drivers/pty.c	2003-02-13 11:46:50.000000000 +0000
+++ source/arch/um/drivers/pty.c	2004-02-09 10:39:51.000000000 +0000
@@ -7,12 +7,12 @@
 #include <unistd.h>
 #include <string.h>
 #include <errno.h>
-#include <fcntl.h>
 #include <termios.h>
 #include "chan_user.h"
 #include "user.h"
 #include "user_util.h"
 #include "kern_util.h"
+#include "os.h"
 
 struct pty_chan {
 	void (*announce)(char *dev_name, int dev);
@@ -26,7 +26,8 @@
 {
 	struct pty_chan *data;
 
-	if((data = um_kmalloc(sizeof(*data))) == NULL) return(NULL);
+	data = um_kmalloc(sizeof(*data));
+	if(data == NULL) return(NULL);
 	*data = ((struct pty_chan) { .announce  	= opts->announce, 
 				     .dev  		= device,
 				     .raw  		= opts->raw });
@@ -39,7 +40,8 @@
 	char *dev;
 	int fd;
 
-	if((fd = get_pty()) < 0){
+	fd = get_pty();
+	if(fd < 0){
 		printk("open_pts : Failed to open pts\n");
 		return(-errno);
 	}
@@ -57,29 +59,27 @@
 
 int getmaster(char *line)
 {
-	struct stat stb;
 	char *pty, *bank, *cp;
-	int master;
+	int master, err;
 
 	pty = &line[strlen("/dev/ptyp")];
 	for (bank = "pqrs"; *bank; bank++) {
 		line[strlen("/dev/pty")] = *bank;
 		*pty = '0';
-		if (stat(line, &stb) < 0)
+		if (os_stat_file(line, NULL) < 0)
 			break;
 		for (cp = "0123456789abcdef"; *cp; cp++) {
 			*pty = *cp;
-			master = open(line, O_RDWR);
+			master = os_open_file(line, of_rdwr(OPENFLAGS()), 0);
 			if (master >= 0) {
 				char *tp = &line[strlen("/dev/")];
-				int ok;
 
 				/* verify slave side is usable */
 				*tp = 't';
-				ok = access(line, R_OK|W_OK) == 0;
+				err = os_access(line, OS_ACC_RW_OK);
 				*tp = 'p';
-				if (ok) return(master);
-				(void) close(master);
+				if(err == 0) return(master);
+				(void) os_close_file(master);
 			}
 		}
 	}
--- diff/arch/um/drivers/slip_user.c	2003-02-13 11:46:50.000000000 +0000
+++ source/arch/um/drivers/slip_user.c	2004-02-09 10:39:51.000000000 +0000
@@ -4,11 +4,9 @@
 #include <stddef.h>
 #include <sched.h>
 #include <string.h>
-#include <sys/fcntl.h>
 #include <sys/errno.h>
 #include <sys/termios.h>
 #include <sys/wait.h>
-#include <sys/ioctl.h>
 #include <sys/signal.h>
 #include "user_util.h"
 #include "kern_util.h"
@@ -65,9 +63,9 @@
 {
 	struct slip_pre_exec_data *data = arg;
 
-	if(data->stdin != -1) dup2(data->stdin, 0);
+	if(data->stdin >= 0) dup2(data->stdin, 0);
 	dup2(data->stdout, 1);
-	if(data->close_me != -1) close(data->close_me);
+	if(data->close_me >= 0) os_close_file(data->close_me);
 }
 
 static int slip_tramp(char **argv, int fd)
@@ -77,8 +75,8 @@
 	int status, pid, fds[2], err, output_len;
 
 	err = os_pipe(fds, 1, 0);
-	if(err){
-		printk("slip_tramp : pipe failed, errno = %d\n", -err);
+	if(err < 0){
+		printk("slip_tramp : pipe failed, err = %d\n", -err);
 		return(err);
 	}
 
@@ -96,7 +94,7 @@
 			printk("slip_tramp : failed to allocate output "
 			       "buffer\n");
 
-		close(fds[1]);
+		os_close_file(fds[1]);
 		read_output(fds[0], output, output_len);
 		if(output != NULL){
 			printk("%s", output);
@@ -105,7 +103,7 @@
 		if(waitpid(pid, &status, 0) < 0) err = errno;
 		else if(!WIFEXITED(status) || (WEXITSTATUS(status) != 0)){
 			printk("'%s' didn't exit with status 0\n", argv[0]);
-			err = EINVAL;
+			err = -EINVAL;
 		}
 	}
 	return(err);
@@ -118,15 +116,17 @@
 	char gate_buf[sizeof("nnn.nnn.nnn.nnn\0")];
 	char *argv[] = { "uml_net", version_buf, "slip", "up", gate_buf, 
 			 NULL };
-	int sfd, mfd, disc, sencap, err;
+	int sfd, mfd, err;
 
-	if((mfd = get_pty()) < 0){
-		printk("umn : Failed to open pty\n");
-		return(-1);
+	mfd = get_pty();
+	if(mfd < 0){
+		printk("umn : Failed to open pty, err = %d\n", -mfd);
+		return(mfd);
 	}
-	if((sfd = os_open_file(ptsname(mfd), of_rdwr(OPENFLAGS()), 0)) < 0){
-		printk("Couldn't open tty for slip line\n");
-		return(-1);
+	sfd = os_open_file(ptsname(mfd), of_rdwr(OPENFLAGS()), 0);
+	if(sfd < 0){
+		printk("Couldn't open tty for slip line, err = %d\n", -sfd);
+		return(sfd);
 	}
 	if(set_up_tty(sfd)) return(-1);
 	pri->slave = sfd;
@@ -138,28 +138,23 @@
 
 		err = slip_tramp(argv, sfd);
 
-		if(err != 0){
-			printk("slip_tramp failed - errno = %d\n", err);
-			return(-err);
+		if(err < 0){
+			printk("slip_tramp failed - err = %d\n", -err);
+			return(err);
 		}
-		if(ioctl(pri->slave, SIOCGIFNAME, pri->name) < 0){
-			printk("SIOCGIFNAME failed, errno = %d\n", errno);
-			return(-errno);
+		err = os_get_ifname(pri->slave, pri->name);
+		if(err < 0){
+			printk("get_ifname failed, err = %d\n", -err);
+			return(err);
 		}
 		iter_addresses(pri->dev, open_addr, pri->name);
 	}
 	else {
-		disc = N_SLIP;
-		if(ioctl(sfd, TIOCSETD, &disc) < 0){
-			printk("Failed to set slip line discipline - "
-			       "errno = %d\n", errno);
-			return(-errno);
-		}
-		sencap = 0;
-		if(ioctl(sfd, SIOCSIFENCAP, &sencap) < 0){
-			printk("Failed to set slip encapsulation - "
-			       "errno = %d\n", errno);
-			return(-errno);
+		err = os_set_slip(sfd);
+		if(err < 0){
+			printk("Failed to set slip discipline encapsulation - "
+			       "err = %d\n", -err);
+			return(err);
 		}
 	}
 	return(mfd);
@@ -181,9 +176,9 @@
 	err = slip_tramp(argv, -1);
 
 	if(err != 0)
-		printk("slip_tramp failed - errno = %d\n", err);
-	close(fd);
-	close(pri->slave);
+		printk("slip_tramp failed - errno = %d\n", -err);
+	os_close_file(fd);
+	os_close_file(pri->slave);
 	pri->slave = -1;
 }
 
@@ -243,7 +238,7 @@
 {
 	struct slip_data *pri = data;
 
-	if(pri->slave == -1) return;
+	if(pri->slave < 0) return;
 	open_addr(addr, netmask, pri->name);
 }
 
@@ -252,7 +247,7 @@
 {
 	struct slip_data *pri = data;
 
-	if(pri->slave == -1) return;
+	if(pri->slave < 0) return;
 	close_addr(addr, netmask, pri->name);
 }
 
--- diff/arch/um/drivers/slirp_user.c	2003-02-13 11:46:50.000000000 +0000
+++ source/arch/um/drivers/slirp_user.c	2004-02-09 10:39:51.000000000 +0000
@@ -4,7 +4,6 @@
 #include <stddef.h>
 #include <sched.h>
 #include <string.h>
-#include <sys/fcntl.h>
 #include <sys/errno.h>
 #include <sys/wait.h>
 #include <sys/signal.h>
@@ -48,15 +47,15 @@
 
 	return(pid);
 }
- 
+
+/* XXX This is just a trivial wrapper around os_pipe */ 
 static int slirp_datachan(int *mfd, int *sfd)
 {
 	int fds[2], err;
 
 	err = os_pipe(fds, 1, 1);
-	if(err){
-		printk("slirp_datachan: Failed to open pipe, errno = %d\n",
-		       -err);
+	if(err < 0){
+		printk("slirp_datachan: Failed to open pipe, err = %d\n", -err);
 		return(err);
 	}
 
@@ -77,7 +76,7 @@
 	pid = slirp_tramp(pri->argw.argv, sfd);
 
 	if(pid < 0){
-		printk("slirp_tramp failed - errno = %d\n", pid);
+		printk("slirp_tramp failed - errno = %d\n", -pid);
 		os_close_file(sfd);	
 		os_close_file(mfd);	
 		return(pid);
@@ -97,8 +96,8 @@
 	struct slirp_data *pri = data;
 	int status,err;
 
-	close(fd);
-	close(pri->slave);
+	os_close_file(fd);
+	os_close_file(pri->slave);
 
 	pri->slave = -1;
 
--- diff/arch/um/drivers/ssl.c	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/um/drivers/ssl.c	2004-02-09 10:39:51.000000000 +0000
@@ -10,6 +10,7 @@
 #include "linux/major.h"
 #include "linux/mm.h"
 #include "linux/init.h"
+#include "linux/console.h"
 #include "asm/termbits.h"
 #include "asm/irq.h"
 #include "line.h"
@@ -53,8 +54,9 @@
 
 static struct line_driver driver = {
 	.name 			= "UML serial line",
-	.devfs_name 		= "tts/%d",
-	.major 			= TTYAUX_MAJOR,
+	.device_name 		= "ttS",
+	.devfs_name 		= "tts/",
+	.major 			= TTY_MAJOR,
 	.minor_start 		= 64,
 	.type 		 	= TTY_DRIVER_TYPE_SERIAL,
 	.subtype 	 	= 0,
@@ -149,6 +151,9 @@
 	case TCSETSW:
 	case TCGETA:
 	case TIOCMGET:
+	case TCSBRK:
+	case TCSBRKP:
+	case TIOCMSET:
 		ret = -ENOIOCTLCMD;
 		break;
 	default:
@@ -212,6 +217,39 @@
  */
 static int ssl_init_done = 0;
 
+extern int tty_init(void);
+
+static void ssl_console_write(struct console *c, const char *string, 
+			      unsigned len)
+{
+	struct line *line = &serial_lines[c->index];
+	if(ssl_init_done)
+		down(&line->sem);
+	console_write_chan(&line->chan_list, string, len);
+	if(ssl_init_done)
+		up(&line->sem);
+}
+
+static struct tty_driver *ssl_console_device(struct console *c, int *index)
+{
+	*index = c->index;
+	return ssl_driver;
+}
+
+static int ssl_console_setup(struct console *co, char *options)
+{
+	return(0);
+}
+
+static struct console ssl_cons = {
+	name:		"ttyS",
+	write:		ssl_console_write,
+	device:		ssl_console_device,
+	setup:		ssl_console_setup,
+	flags:		CON_PRINTBUFFER,
+	index:		-1,
+};
+
 int ssl_init(void)
 {
 	char *new_title;
@@ -219,6 +257,8 @@
 	printk(KERN_INFO "Initializing software serial port version %d\n", 
 	       ssl_version);
 
+	tty_init();
+
 	ssl_driver = line_register_devfs(&lines, &driver, &ssl_ops,
 		serial_lines, sizeof(serial_lines)/sizeof(serial_lines[0]));
 
@@ -227,6 +267,7 @@
 	new_title = add_xterm_umid(opts.xterm_title);
 	if(new_title != NULL) opts.xterm_title = new_title;
 
+	register_console(&ssl_cons);
 	ssl_init_done = 1;
 	return(0);
 }
@@ -235,9 +276,9 @@
 
 static int ssl_chan_setup(char *str)
 {
-	line_setup(serial_lines, sizeof(serial_lines)/sizeof(serial_lines[0]),
-		   str, 1);
-	return(1);
+	return(line_setup(serial_lines, 
+			  sizeof(serial_lines)/sizeof(serial_lines[0]), 
+			  str, 1));
 }
 
 __setup("ssl", ssl_chan_setup);
--- diff/arch/um/drivers/stdio_console.c	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/um/drivers/stdio_console.c	2004-02-09 10:39:51.000000000 +0000
@@ -83,7 +83,8 @@
 
 static struct line_driver driver = {
 	.name 			= "UML console",
-	.devfs_name 		= "vc/%d",
+	.device_name 		= "tty",
+	.devfs_name 		= "vc/",
 	.major 			= TTY_MAJOR,
 	.minor_start 		= 0,
 	.type 		 	= TTY_DRIVER_TYPE_CONSOLE,
@@ -159,14 +160,28 @@
 
 static int con_init_done = 0;
 
+static struct tty_operations console_ops = {
+	.open 	 		= con_open,
+	.close 	 		= con_close,
+	.write 	 		= con_write,
+	.chars_in_buffer 	= chars_in_buffer,
+	.set_termios 		= set_termios,
+	.write_room		= line_write_room,
+};
+
+extern int tty_init(void);
+
 int stdio_init(void)
 {
 	char *new_title;
 
 	printk(KERN_INFO "Initializing stdio console driver\n");
 
+	tty_init();
+
 	console_driver = line_register_devfs(&console_lines, &driver,
-				&console_ops, vts, sizeof(vts)/sizeof(vts[0]));
+					     &console_ops, vts,
+					     sizeof(vts)/sizeof(vts[0]));
 
 	lines_init(vts, sizeof(vts)/sizeof(vts[0]));
 
@@ -183,19 +198,14 @@
 static void console_write(struct console *console, const char *string, 
 			  unsigned len)
 {
-	if(con_init_done) down(&vts[console->index].sem);
-	console_write_chan(&vts[console->index].chan_list, string, len);
-	if(con_init_done) up(&vts[console->index].sem);
-}
+	struct line *line = &vts[console->index];
 
-static struct tty_operations console_ops = {
-	.open 	 		= con_open,
-	.close 	 		= con_close,
-	.write 	 		= con_write,
-	.chars_in_buffer 	= chars_in_buffer,
-	.set_termios 		= set_termios,
-	.write_room		= line_write_room,
-};
+	if(con_init_done)
+		down(&line->sem);
+	console_write_chan(&line->chan_list, string, len);
+	if(con_init_done)
+		up(&line->sem);
+}
 
 static struct tty_driver *console_device(struct console *c, int *index)
 {
@@ -208,22 +218,28 @@
 	return(0);
 }
 
-static struct console stdiocons = INIT_CONSOLE("tty", console_write, 
-					       console_device, console_setup,
-					       CON_PRINTBUFFER);
+static struct console stdiocons = {
+	name:		"tty",
+	write:		console_write,
+	device:		console_device,
+	setup:		console_setup,
+	flags:		CON_PRINTBUFFER,
+	index:		-1,
+};
 
-static void __init stdio_console_init(void)
+static int __init stdio_console_init(void)
 {
 	INIT_LIST_HEAD(&vts[0].chan_list);
 	list_add(&init_console_chan.list, &vts[0].chan_list);
 	register_console(&stdiocons);
+	return(0);
 }
+
 console_initcall(stdio_console_init);
 
 static int console_chan_setup(char *str)
 {
-	line_setup(vts, sizeof(vts)/sizeof(vts[0]), str, 1);
-	return(1);
+	return(line_setup(vts, sizeof(vts)/sizeof(vts[0]), str, 1));
 }
 
 __setup("con", console_chan_setup);
--- diff/arch/um/drivers/tty.c	2003-02-13 11:46:50.000000000 +0000
+++ source/arch/um/drivers/tty.c	2004-02-09 10:39:51.000000000 +0000
@@ -5,7 +5,6 @@
 
 #include <stdio.h>
 #include <termios.h>
-#include <fcntl.h>
 #include <errno.h>
 #include <unistd.h>
 #include "chan_user.h"
@@ -30,7 +29,8 @@
 	}
 	str++;
 
-	if((data = um_kmalloc(sizeof(*data))) == NULL) 
+	data = um_kmalloc(sizeof(*data)); 
+	if(data == NULL) 
 		return(NULL);
 	*data = ((struct tty_chan) { .dev 	= str,
 				     .raw 	= opts->raw });
--- diff/arch/um/drivers/ubd_kern.c	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/um/drivers/ubd_kern.c	2004-02-09 10:39:51.000000000 +0000
@@ -8,6 +8,13 @@
  * old style ubd by setting UBD_SHIFT to 0
  * 2002-09-27...2002-10-18 massive tinkering for 2.5
  * partitions have changed in 2.5
+ * 2003-01-29 more tinkering for 2.5.59-1
+ * This should now address the sysfs problems and has
+ * the symlink for devfs to allow for booting with
+ * the common /dev/ubd/discX/... names rather than
+ * only /dev/ubdN/discN this version also has lots of
+ * clean ups preparing for ubd-many.
+ * James McMechan
  */
 
 #define MAJOR_NR UBD_MAJOR
@@ -40,9 +47,12 @@
 #include "mconsole_kern.h"
 #include "init.h"
 #include "irq_user.h"
+#include "irq_kern.h"
 #include "ubd_user.h"
 #include "2_5compat.h"
 #include "os.h"
+#include "mem.h"
+#include "mem_kern.h"
 
 static spinlock_t ubd_io_lock = SPIN_LOCK_UNLOCKED;
 static spinlock_t ubd_lock = SPIN_LOCK_UNLOCKED;
@@ -56,6 +66,10 @@
 
 #define MAX_DEV (8)
 
+/* Changed in early boot */
+static int ubd_do_mmap = 0;
+#define UBD_MMAP_BLOCK_SIZE PAGE_SIZE
+
 static struct block_device_operations ubd_blops = {
         .owner		= THIS_MODULE,
         .open		= ubd_open,
@@ -67,7 +81,7 @@
 static request_queue_t *ubd_queue;
 
 /* Protected by ubd_lock */
-static int fake_major = 0;
+static int fake_major = MAJOR_NR;
 
 static struct gendisk *ubd_gendisk[MAX_DEV];
 static struct gendisk *fake_gendisk[MAX_DEV];
@@ -96,13 +110,19 @@
 
 struct ubd {
 	char *file;
-	int is_dir;
 	int count;
 	int fd;
 	__u64 size;
 	struct openflags boot_openflags;
 	struct openflags openflags;
+	int no_cow;
 	struct cow cow;
+
+	int map_writes;
+	int map_reads;
+	int nomap_writes;
+	int nomap_reads;
+	int write_maps;
 };
 
 #define DEFAULT_COW { \
@@ -115,21 +135,28 @@
 
 #define DEFAULT_UBD { \
 	.file = 		NULL, \
-	.is_dir =		0, \
 	.count =		0, \
 	.fd =			-1, \
 	.size =			-1, \
 	.boot_openflags =	OPEN_FLAGS, \
 	.openflags =		OPEN_FLAGS, \
+        .no_cow =               0, \
         .cow =			DEFAULT_COW, \
+	.map_writes		= 0, \
+	.map_reads		= 0, \
+	.nomap_writes		= 0, \
+	.nomap_reads		= 0, \
+	.write_maps		= 0, \
 }
 
 struct ubd ubd_dev[MAX_DEV] = { [ 0 ... MAX_DEV - 1 ] = DEFAULT_UBD };
 
 static int ubd0_init(void)
 {
-	if(ubd_dev[0].file == NULL)
-		ubd_dev[0].file = "root_fs";
+	struct ubd *dev = &ubd_dev[0];
+
+	if(dev->file == NULL)
+		dev->file = "root_fs";
 	return(0);
 }
 
@@ -196,19 +223,46 @@
 "    Create ide0 entries that map onto ubd devices.\n\n"
 );
 
+static int parse_unit(char **ptr)
+{
+	char *str = *ptr, *end;
+	int n = -1;
+
+	if(isdigit(*str)) {
+		n = simple_strtoul(str, &end, 0);
+		if(end == str)
+			return(-1);
+		*ptr = end;
+	}
+	else if (('a' <= *str) && (*str <= 'h')) {
+		n = *str - 'a';
+		str++;
+		*ptr = str;
+	}
+	return(n);
+}
+
 static int ubd_setup_common(char *str, int *index_out)
 {
+	struct ubd *dev;
 	struct openflags flags = global_openflags;
 	char *backing_file;
 	int n, err;
 
 	if(index_out) *index_out = -1;
-	n = *str++;
+	n = *str;
 	if(n == '='){
-		static int fake_major_allowed = 1;
 		char *end;
 		int major;
 
+		str++;
+		if(!strcmp(str, "mmap")){
+			CHOOSE_MODE(printk("mmap not supported by the ubd "
+					   "driver in tt mode\n"),
+				    ubd_do_mmap = 1);
+			return(0);
+		}
+
 		if(!strcmp(str, "sync")){
 			global_openflags.s = 1;
 			return(0);
@@ -220,20 +274,14 @@
 			return(1);
 		}
 
-		if(!fake_major_allowed){
-			printk(KERN_ERR "Can't assign a fake major twice\n");
-			return(1);
-		}
-
 		err = 1;
  		spin_lock(&ubd_lock);
- 		if(!fake_major_allowed){
+ 		if(fake_major != MAJOR_NR){
  			printk(KERN_ERR "Can't assign a fake major twice\n");
  			goto out1;
  		}
  
  		fake_major = major;
-		fake_major_allowed = 0;
 
 		printk(KERN_INFO "Setting extra ubd major number to %d\n",
 		       major);
@@ -243,25 +291,23 @@
 		return(err);
 	}
 
-	if(n < '0'){
-		printk(KERN_ERR "ubd_setup : index out of range\n"); }
-
-	if((n >= '0') && (n <= '9')) n -= '0';
-	else if((n >= 'a') && (n <= 'z')) n -= 'a';
-	else {
-		printk(KERN_ERR "ubd_setup : device syntax invalid\n");
+	n = parse_unit(&str);
+	if(n < 0){
+		printk(KERN_ERR "ubd_setup : couldn't parse unit number "
+		       "'%s'\n", str);
 		return(1);
 	}
 	if(n >= MAX_DEV){
-		printk(KERN_ERR "ubd_setup : index out of range "
-		       "(%d devices)\n", MAX_DEV);	
+		printk(KERN_ERR "ubd_setup : index %d out of range "
+		       "(%d devices)\n", n, MAX_DEV);
 		return(1);
 	}
 
 	err = 1;
 	spin_lock(&ubd_lock);
 
-	if(ubd_dev[n].file != NULL){
+	dev = &ubd_dev[n];
+	if(dev->file != NULL){
 		printk(KERN_ERR "ubd_setup : device already configured\n");
 		goto out2;
 	}
@@ -276,6 +322,11 @@
 		flags.s = 1;
 		str++;
 	}
+	if (*str == 'd'){
+		dev->no_cow = 1;
+		str++;
+	}
+
 	if(*str++ != '='){
 		printk(KERN_ERR "ubd_setup : Expected '='\n");
 		goto out2;
@@ -284,14 +335,17 @@
 	err = 0;
 	backing_file = strchr(str, ',');
 	if(backing_file){
-		*backing_file = '\0';
-		backing_file++;
+		if(dev->no_cow)
+			printk(KERN_ERR "Can't specify both 'd' and a "
+			       "cow file\n");
+		else {
+			*backing_file = '\0';
+			backing_file++;
+		}
 	}
-	ubd_dev[n].file = str;
-	if(ubd_is_dir(ubd_dev[n].file))
-		ubd_dev[n].is_dir = 1;
-	ubd_dev[n].cow.file = backing_file;
-	ubd_dev[n].boot_openflags = flags;
+	dev->file = str;
+	dev->cow.file = backing_file;
+	dev->boot_openflags = flags;
  out2:
 	spin_unlock(&ubd_lock);
 	return(err);
@@ -321,8 +375,7 @@
 static int fakehd_set = 0;
 static int fakehd(char *str)
 {
-	printk(KERN_INFO 
-	       "fakehd : Changing ubd name to \"hd\".\n");
+	printk(KERN_INFO "fakehd : Changing ubd name to \"hd\".\n");
 	fakehd_set = 1;
 	return 1;
 }
@@ -368,32 +421,42 @@
 {
 	struct io_thread_req req;
 	struct request *rq = elv_next_request(ubd_queue);
-	int n;
+	int n, err;
 
 	do_ubd = NULL;
 	intr_count++;
 	n = read_ubd_fs(thread_fd, &req, sizeof(req));
 	if(n != sizeof(req)){
 		printk(KERN_ERR "Pid %d - spurious interrupt in ubd_handler, "
-		       "errno = %d\n", os_getpid(), -n);
+		       "err = %d\n", os_getpid(), -n);
 		spin_lock(&ubd_io_lock);
 		end_request(rq, 0);
 		spin_unlock(&ubd_io_lock);
 		return;
 	}
         
-        if((req.offset != ((__u64) (rq->sector)) << 9) ||
-	   (req.length != (rq->current_nr_sectors) << 9))
+	if((req.op != UBD_MMAP) && 
+	   ((req.offset != ((__u64) (rq->sector)) << 9) ||
+	    (req.length != (rq->current_nr_sectors) << 9)))
 		panic("I/O op mismatch");
 	
+	if(req.map_fd != -1){
+		err = physmem_subst_mapping(req.buffer, req.map_fd, 
+					    req.map_offset, 1);
+		if(err)
+			printk("ubd_handler - physmem_subst_mapping failed, "
+			       "err = %d\n", -err);
+	}
+
 	ubd_finish(rq, req.error);
 	reactivate_fd(thread_fd, UBD_IRQ);	
 	do_ubd_request(ubd_queue);
 }
 
-static void ubd_intr(int irq, void *dev, struct pt_regs *unused)
+static irqreturn_t ubd_intr(int irq, void *dev, struct pt_regs *unused)
 {
 	ubd_handler();
+	return(IRQ_HANDLED);
 }
 
 /* Only changed by ubd_init, which is an initcall. */
@@ -429,18 +492,20 @@
 static int ubd_open_dev(struct ubd *dev)
 {
 	struct openflags flags;
-	int err, n, create_cow, *create_ptr;
+	char **back_ptr;
+	int err, create_cow, *create_ptr;
 
+	dev->openflags = dev->boot_openflags;
 	create_cow = 0;
 	create_ptr = (dev->cow.file != NULL) ? &create_cow : NULL;
-	dev->fd = open_ubd_file(dev->file, &dev->openflags, &dev->cow.file,
+	back_ptr = dev->no_cow ? NULL : &dev->cow.file;
+	dev->fd = open_ubd_file(dev->file, &dev->openflags, back_ptr,
 				&dev->cow.bitmap_offset, &dev->cow.bitmap_len, 
 				&dev->cow.data_offset, create_ptr);
 
 	if((dev->fd == -ENOENT) && create_cow){
-		n = dev - ubd_dev;
 		dev->fd = create_cow_file(dev->file, dev->cow.file, 
-					  dev->openflags, 1 << 9,
+					  dev->openflags, 1 << 9, PAGE_SIZE,
 					  &dev->cow.bitmap_offset, 
 					  &dev->cow.bitmap_len,
 					  &dev->cow.data_offset);
@@ -455,13 +520,17 @@
 	if(dev->cow.file != NULL){
 		err = -ENOMEM;
 		dev->cow.bitmap = (void *) vmalloc(dev->cow.bitmap_len);
-		if(dev->cow.bitmap == NULL) goto error;
+		if(dev->cow.bitmap == NULL){
+			printk(KERN_ERR "Failed to vmalloc COW bitmap\n");
+			goto error;
+		}
 		flush_tlb_kernel_vm();
 
 		err = read_cow_bitmap(dev->fd, dev->cow.bitmap, 
 				      dev->cow.bitmap_offset, 
 				      dev->cow.bitmap_len);
-		if(err) goto error;
+		if(err < 0)
+			goto error;
 
 		flags = dev->openflags;
 		flags.w = 0;
@@ -481,17 +550,31 @@
 			
 {
 	struct gendisk *disk;
+	char from[sizeof("ubd/nnnnn\0")], to[sizeof("discnnnnn/disc\0")];
+	int err;
 
 	disk = alloc_disk(1 << UBD_SHIFT);
-	if (!disk)
-		return -ENOMEM;
+	if(disk == NULL)
+		return(-ENOMEM);
 
 	disk->major = major;
 	disk->first_minor = unit << UBD_SHIFT;
 	disk->fops = &ubd_blops;
 	set_capacity(disk, size / 512);
-	sprintf(disk->disk_name, "ubd");
-	sprintf(disk->devfs_name, "ubd/disc%d", unit);
+	if(major == MAJOR_NR){
+		sprintf(disk->disk_name, "ubd%c", 'a' + unit);
+		sprintf(disk->devfs_name, "ubd/disc%d", unit);
+		sprintf(from, "ubd/%d", unit);
+		sprintf(to, "disc%d/disc", unit);
+		err = devfs_mk_symlink(from, to);
+		if(err)
+			printk("ubd_new_disk failed to make link from %s to "
+			       "%s, error = %d\n", from, to, err);
+	}
+	else {
+		sprintf(disk->disk_name, "ubd_fake%d", unit);
+		sprintf(disk->devfs_name, "ubd_fake/disc%d", unit);
+	}
 
 	disk->private_data = &ubd_dev[unit];
 	disk->queue = ubd_queue;
@@ -506,24 +589,21 @@
 	struct ubd *dev = &ubd_dev[n];
 	int err;
 
-	if(dev->is_dir)
-		return(-EISDIR);
-
-	if (!dev->file)
+	if(dev->file == NULL)
 		return(-ENODEV);
 
 	if (ubd_open_dev(dev))
 		return(-ENODEV);
 
 	err = ubd_file_size(dev, &dev->size);
-	if(err)
+	if(err < 0)
 		return(err);
 
 	err = ubd_new_disk(MAJOR_NR, dev->size, n, &ubd_gendisk[n]);
 	if(err) 
 		return(err);
  
-	if(fake_major)
+	if(fake_major != MAJOR_NR)
 		ubd_new_disk(fake_major, dev->size, n, 
 			     &fake_gendisk[n]);
 
@@ -561,42 +641,42 @@
 	return(err);
 }
 
-static int ubd_get_config(char *dev, char *str, int size, char **error_out)
+static int ubd_get_config(char *name, char *str, int size, char **error_out)
 {
-	struct ubd *ubd;
+	struct ubd *dev;
 	char *end;
-	int major, n = 0;
+	int n, len = 0;
 
-	major = simple_strtoul(dev, &end, 0);
-	if((*end != '\0') || (end == dev)){
-		*error_out = "ubd_get_config : didn't parse major number";
+	n = simple_strtoul(name, &end, 0);
+	if((*end != '\0') || (end == name)){
+		*error_out = "ubd_get_config : didn't parse device number";
 		return(-1);
 	}
 
-	if((major >= MAX_DEV) || (major < 0)){
-		*error_out = "ubd_get_config : major number out of range";
+	if((n >= MAX_DEV) || (n < 0)){
+		*error_out = "ubd_get_config : device number out of range";
 		return(-1);
 	}
 
-	ubd = &ubd_dev[major];
+	dev = &ubd_dev[n];
 	spin_lock(&ubd_lock);
 
-	if(ubd->file == NULL){
-		CONFIG_CHUNK(str, size, n, "", 1);
+	if(dev->file == NULL){
+		CONFIG_CHUNK(str, size, len, "", 1);
 		goto out;
 	}
 
-	CONFIG_CHUNK(str, size, n, ubd->file, 0);
+	CONFIG_CHUNK(str, size, len, dev->file, 0);
 
-	if(ubd->cow.file != NULL){
-		CONFIG_CHUNK(str, size, n, ",", 0);
-		CONFIG_CHUNK(str, size, n, ubd->cow.file, 1);
+	if(dev->cow.file != NULL){
+		CONFIG_CHUNK(str, size, len, ",", 0);
+		CONFIG_CHUNK(str, size, len, dev->cow.file, 1);
 	}
-	else CONFIG_CHUNK(str, size, n, "", 1);
+	else CONFIG_CHUNK(str, size, len, "", 1);
 
  out:
 	spin_unlock(&ubd_lock);
-	return(n);
+	return(len);
 }
 
 static int ubd_remove(char *str)
@@ -604,11 +684,9 @@
 	struct ubd *dev;
 	int n, err = -ENODEV;
 
-	if(!isdigit(*str))
-		return(err);	/* it should be a number 0-7/a-h */
+	n = parse_unit(&str);
 
-	n = *str - '0';
-	if(n >= MAX_DEV) 
+	if((n < 0) || (n >= MAX_DEV))
 		return(err);
 
 	dev = &ubd_dev[n];
@@ -669,7 +747,7 @@
 		
 	elevator_init(ubd_queue, &elevator_noop);
 
-	if (fake_major != 0) {
+	if (fake_major != MAJOR_NR) {
 		char name[sizeof("ubd_nnn\0")];
 
 		snprintf(name, sizeof(name), "ubd_%d", fake_major);
@@ -696,6 +774,7 @@
 	io_pid = start_io_thread(stack + PAGE_SIZE - sizeof(void *), 
 				 &thread_fd);
 	if(io_pid < 0){
+		io_pid = -1;
 		printk(KERN_ERR 
 		       "ubd : Failed to start I/O thread (errno = %d) - "
 		       "falling back to synchronous I/O\n", -io_pid);
@@ -703,8 +782,8 @@
 	}
 	err = um_request_irq(UBD_IRQ, thread_fd, IRQ_READ, ubd_intr, 
 			     SA_INTERRUPT, "ubd", ubd_dev);
-	if(err != 0) printk(KERN_ERR 
-			    "um_request_irq failed - errno = %d\n", -err);
+	if(err != 0) 
+		printk(KERN_ERR "um_request_irq failed - errno = %d\n", -err);
 	return(err);
 }
 
@@ -714,15 +793,9 @@
 {
 	struct gendisk *disk = inode->i_bdev->bd_disk;
 	struct ubd *dev = disk->private_data;
-	int err = -EISDIR;
-
-	if(dev->is_dir == 1)
-		goto out;
+	int err = 0;
 
-	err = 0;
 	if(dev->count == 0){
-		dev->openflags = dev->boot_openflags;
-
 		err = ubd_open_dev(dev);
 		if(err){
 			printk(KERN_ERR "%s: Can't open \"%s\": errno = %d\n",
@@ -749,62 +822,156 @@
 	return(0);
 }
 
-void cowify_req(struct io_thread_req *req, struct ubd *dev)
+static void cowify_bitmap(__u64 io_offset, int length, unsigned long *cow_mask, 
+			  __u64 *cow_offset, unsigned long *bitmap, 
+			  __u64 bitmap_offset, unsigned long *bitmap_words,
+			  __u64 bitmap_len)
+{
+	__u64 sector = io_offset >> 9;
+	int i, update_bitmap = 0;
+
+	for(i = 0; i < length >> 9; i++){
+		if(cow_mask != NULL)
+			ubd_set_bit(i, (unsigned char *) cow_mask);
+		if(ubd_test_bit(sector + i, (unsigned char *) bitmap))
+			continue;
+
+		update_bitmap = 1;
+		ubd_set_bit(sector + i, (unsigned char *) bitmap);
+	}
+
+	if(!update_bitmap)
+		return;
+
+	*cow_offset = sector / (sizeof(unsigned long) * 8);
+
+	/* This takes care of the case where we're exactly at the end of the
+	 * device, and *cow_offset + 1 is off the end.  So, just back it up
+	 * by one word.  Thanks to Lynn Kerby for the fix and James McMechan
+	 * for the original diagnosis.
+	 */
+	if(*cow_offset == ((bitmap_len + sizeof(unsigned long) - 1) / 
+			   sizeof(unsigned long) - 1))
+		(*cow_offset)--;
+
+	bitmap_words[0] = bitmap[*cow_offset];
+	bitmap_words[1] = bitmap[*cow_offset + 1];
+
+	*cow_offset *= sizeof(unsigned long);
+	*cow_offset += bitmap_offset;
+}
+
+static void cowify_req(struct io_thread_req *req, unsigned long *bitmap, 
+		       __u64 bitmap_offset, __u64 bitmap_len)
 {
-        int i, update_bitmap, sector = req->offset >> 9;
+	__u64 sector = req->offset >> 9;
+	int i;
 
 	if(req->length > (sizeof(req->sector_mask) * 8) << 9)
 		panic("Operation too long");
+
 	if(req->op == UBD_READ) {
 		for(i = 0; i < req->length >> 9; i++){
-			if(ubd_test_bit(sector + i, (unsigned char *) 
-					dev->cow.bitmap)){
+			if(ubd_test_bit(sector + i, (unsigned char *) bitmap))
 				ubd_set_bit(i, (unsigned char *) 
 					    &req->sector_mask);
-			}
                 }
-        } 
-        else {
-		update_bitmap = 0;
-		for(i = 0; i < req->length >> 9; i++){
-			ubd_set_bit(i, (unsigned char *) 
-				    &req->sector_mask);
-			if(!ubd_test_bit(sector + i, (unsigned char *) 
-					 dev->cow.bitmap))
-				update_bitmap = 1;
-			ubd_set_bit(sector + i, (unsigned char *) 
-				    dev->cow.bitmap);
-		}
-		if(update_bitmap){
-			req->cow_offset = sector / (sizeof(unsigned long) * 8);
-			req->bitmap_words[0] = 
-				dev->cow.bitmap[req->cow_offset];
-			req->bitmap_words[1] = 
-				dev->cow.bitmap[req->cow_offset + 1];
-			req->cow_offset *= sizeof(unsigned long);
-			req->cow_offset += dev->cow.bitmap_offset;
+	}
+	else cowify_bitmap(req->offset, req->length, &req->sector_mask,
+			   &req->cow_offset, bitmap, bitmap_offset, 
+			   req->bitmap_words, bitmap_len);
+}
+
+static int mmap_fd(struct request *req, struct ubd *dev, __u64 offset)
+{
+	__u64 sector;
+	unsigned char *bitmap;
+	int bit, i;
+
+	/* mmap must have been requested on the command line */
+	if(!ubd_do_mmap)
+		return(-1);
+
+	/* The buffer must be page aligned */
+	if(((unsigned long) req->buffer % UBD_MMAP_BLOCK_SIZE) != 0)
+		return(-1);
+
+	/* The request must be a page long */
+	if((req->current_nr_sectors << 9) != PAGE_SIZE)
+		return(-1);
+
+	if(dev->cow.file == NULL)
+		return(dev->fd);
+
+	sector = offset >> 9;
+	bitmap = (unsigned char *) dev->cow.bitmap;
+	bit = ubd_test_bit(sector, bitmap);
+
+	for(i = 1; i < req->current_nr_sectors; i++){
+		if(ubd_test_bit(sector + i, bitmap) != bit)
+			return(-1);
+	}
+
+	if(bit || (rq_data_dir(req) == WRITE))
+		offset += dev->cow.data_offset;
+
+	/* The data on disk must be page aligned */
+	if((offset % UBD_MMAP_BLOCK_SIZE) != 0)
+		return(-1);
+
+	return(bit ? dev->fd : dev->cow.fd);
+}
+
+static int prepare_mmap_request(struct ubd *dev, int fd, __u64 offset, 
+				struct request *req, 
+				struct io_thread_req *io_req)
+{
+	int err;
+
+	if(rq_data_dir(req) == WRITE){
+		/* Writes are almost no-ops since the new data is already in the
+		 * host page cache
+		 */
+		dev->map_writes++;
+		if(dev->cow.file != NULL)
+			cowify_bitmap(io_req->offset, io_req->length, 
+				      &io_req->sector_mask, &io_req->cow_offset,
+				      dev->cow.bitmap, dev->cow.bitmap_offset,
+				      io_req->bitmap_words, 
+				      dev->cow.bitmap_len);
+	}
+	else {
+		int w;
+
+		if((dev->cow.file != NULL) && (fd == dev->cow.fd))
+			w = 0;
+		else w = dev->openflags.w;
+
+		if((dev->cow.file != NULL) && (fd == dev->fd))
+			offset += dev->cow.data_offset;
+
+		err = physmem_subst_mapping(req->buffer, fd, offset, w);
+		if(err){
+			printk("physmem_subst_mapping failed, err = %d\n", 
+			       -err);
+			return(1);
 		}
+		dev->map_reads++;
 	}
+	io_req->op = UBD_MMAP;
+	io_req->buffer = req->buffer;
+	return(0);
 }
 
 static int prepare_request(struct request *req, struct io_thread_req *io_req)
 {
 	struct gendisk *disk = req->rq_disk;
 	struct ubd *dev = disk->private_data;
-	__u64 block;
-	int nsect;
+	__u64 offset;
+	int len, fd;
 
 	if(req->rq_status == RQ_INACTIVE) return(1);
 
-	if(dev->is_dir){
-		strcpy(req->buffer, "HOSTFS:");
-		strcat(req->buffer, dev->file);
- 		spin_lock(&ubd_io_lock);
-		end_request(req, 1);
- 		spin_unlock(&ubd_io_lock);
-		return(1);
-	}
-
 	if((rq_data_dir(req) == WRITE) && !dev->openflags.w){
 		printk("Write attempted on readonly ubd device %s\n", 
 		       disk->disk_name);
@@ -814,23 +981,49 @@
 		return(1);
 	}
 
-        block = req->sector;
-        nsect = req->current_nr_sectors;
+	offset = ((__u64) req->sector) << 9;
+	len = req->current_nr_sectors << 9;
 
-	io_req->op = rq_data_dir(req) == READ ? UBD_READ : UBD_WRITE;
 	io_req->fds[0] = (dev->cow.file != NULL) ? dev->cow.fd : dev->fd;
 	io_req->fds[1] = dev->fd;
+	io_req->map_fd = -1;
+	io_req->cow_offset = -1;
+	io_req->offset = offset;
+	io_req->length = len;
+	io_req->error = 0;
+	io_req->sector_mask = 0;
+
+	fd = mmap_fd(req, dev, io_req->offset);
+	if(fd > 0){
+		/* If mmapping is otherwise OK, but the first access to the 
+		 * page is a write, then it's not mapped in yet.  So we have 
+		 * to write the data to disk first, then we can map the disk
+		 * page in and continue normally from there.
+		 */
+		if((rq_data_dir(req) == WRITE) && !is_remapped(req->buffer)){
+			io_req->map_fd = dev->fd;
+			io_req->map_offset = io_req->offset + 
+				dev->cow.data_offset;
+			dev->write_maps++;
+		}
+		else return(prepare_mmap_request(dev, fd, io_req->offset, req, 
+						 io_req));
+	}
+
+	if(rq_data_dir(req) == READ)
+		dev->nomap_reads++;
+	else dev->nomap_writes++;
+
+	io_req->op = (rq_data_dir(req) == READ) ? UBD_READ : UBD_WRITE;
 	io_req->offsets[0] = 0;
 	io_req->offsets[1] = dev->cow.data_offset;
-	io_req->offset = ((__u64) block) << 9;
-	io_req->length = nsect << 9;
 	io_req->buffer = req->buffer;
 	io_req->sectorsize = 1 << 9;
-	io_req->sector_mask = 0;
-	io_req->cow_offset = -1;
-	io_req->error = 0;
 
-        if(dev->cow.file != NULL) cowify_req(io_req, dev);
+	if(dev->cow.file != NULL) 
+		cowify_req(io_req, dev->cow.bitmap, dev->cow.bitmap_offset,
+			   dev->cow.bitmap_len);
+
 	return(0);
 }
 
@@ -885,7 +1078,7 @@
 		g.heads = 128;
 		g.sectors = 32;
 		g.cylinders = dev->size / (128 * 32 * 512);
-		g.start = 2;
+		g.start = get_start_sect(inode->i_bdev);
 		return(copy_to_user(loc, &g, sizeof(g)) ? -EFAULT : 0);
 
 	case HDIO_SET_UNMASKINTR:
@@ -935,6 +1128,142 @@
 	return(-EINVAL);
 }
 
+static int ubd_check_remapped(int fd, unsigned long address, int is_write,
+			      __u64 offset)
+{
+	__u64 bitmap_offset;
+	unsigned long new_bitmap[2];
+	int i, err, n;
+
+	/* If it's not a write access, we can't do anything about it */
+	if(!is_write)
+		return(0);
+
+	/* We have a write */
+	for(i = 0; i < sizeof(ubd_dev) / sizeof(ubd_dev[0]); i++){
+		struct ubd *dev = &ubd_dev[i];
+
+		if((dev->fd != fd) && (dev->cow.fd != fd))
+			continue;
+
+		/* It's a write to a ubd device */
+
+		if(!dev->openflags.w){
+			/* It's a write access on a read-only device - probably
+			 * shouldn't happen.  If the kernel is trying to change
+			 * something with no intention of writing it back out,
+			 * then this message will clue us in that this needs
+			 * fixing
+			 */
+			printk("Write access to mapped page from readonly ubd "
+			       "device %d\n", i);
+			return(0);
+		}
+
+		/* It's a write to a writeable ubd device - it must be COWed
+		 * because, otherwise, the page would have been mapped in 
+		 * writeable
+		 */
+
+		if(!dev->cow.file)
+			panic("Write fault on writeable non-COW ubd device %d",
+			      i);
+
+		/* It should also be an access to the backing file since the 
+		 * COW pages should be mapped in read-write
+		 */
+
+		if(fd == dev->fd)
+			panic("Write fault on a backing page of ubd "
+			      "device %d\n", i);
+
+		/* So, we do the write, copying the backing data to the COW 
+		 * file... 
+		 */
+
+		err = os_seek_file(dev->fd, offset + dev->cow.data_offset);
+		if(err < 0)
+			panic("Couldn't seek to %lld in COW file of ubd "
+			      "device %d, err = %d", 
+			      offset + dev->cow.data_offset, i, -err);
+
+		n = os_write_file(dev->fd, (void *) address, PAGE_SIZE);
+		if(n != PAGE_SIZE)
+			panic("Couldn't copy data to COW file of ubd "
+			      "device %d, err = %d", i, -n);
+
+		/* ... updating the COW bitmap... */
+
+		cowify_bitmap(offset, PAGE_SIZE, NULL, &bitmap_offset, 
+			      dev->cow.bitmap, dev->cow.bitmap_offset, 
+			      new_bitmap, dev->cow.bitmap_len);
+
+		err = os_seek_file(dev->fd, bitmap_offset);
+		if(err < 0)
+			panic("Couldn't seek to %lld in COW file of ubd "
+			      "device %d, err = %d", bitmap_offset, i, -err);
+
+		n = os_write_file(dev->fd, new_bitmap, sizeof(new_bitmap));
+		if(n != sizeof(new_bitmap))
+			panic("Couldn't update bitmap  of ubd device %d, "
+			      "err = %d", i, -n);
+		
+		/* Maybe we can map the COW page in, and maybe we can't.  If
+		 * it is a pre-V3 COW file, we can't, since the alignment will 
+		 * be wrong.  If it is a V3 or later COW file which has been 
+		 * moved to a system with a larger page size, then maybe we 
+		 * can't, depending on the exact location of the page.
+		 */
+
+		offset += dev->cow.data_offset;
+
+		/* Remove the remapping, putting the original anonymous page
+		 * back.  If the COW file can be mapped in, that is done.
+		 * Otherwise, the COW page is read in.
+		 */
+
+		if(!physmem_remove_mapping((void *) address))
+			panic("Address 0x%lx not remapped by ubd device %d", 
+			      address, i);
+		if((offset % UBD_MMAP_BLOCK_SIZE) == 0)
+			physmem_subst_mapping((void *) address, dev->fd, 
+					      offset, 1);
+		else {
+			err = os_seek_file(dev->fd, offset);
+			if(err < 0)
+				panic("Couldn't seek to %lld in COW file of "
+				      "ubd device %d, err = %d", offset, i, 
+				      -err);
+
+			n = os_read_file(dev->fd, (void *) address, PAGE_SIZE);
+			if(n != PAGE_SIZE)
+				panic("Failed to read page from offset %llx of "
+				      "COW file of ubd device %d, err = %d",
+				      offset, i, -n);
+		}
+
+		return(1);
+	}
+
+	/* It's not a write on a ubd device */
+	return(0);
+}
+
+static struct remapper ubd_remapper = {
+	.list	= LIST_HEAD_INIT(ubd_remapper.list),
+	.proc	= ubd_check_remapped,
+};
+
+static int ubd_remapper_setup(void)
+{
+	if(ubd_do_mmap)
+		register_remapper(&ubd_remapper);
+
+	return(0);
+}
+
+__initcall(ubd_remapper_setup);
+
 /*
  * Overrides for Emacs so that we follow Linus's tabbing style.
  * Emacs will notice this stuff at the end of the file and automatically
--- diff/arch/um/drivers/ubd_user.c	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/um/drivers/ubd_user.c	2004-02-09 10:39:51.000000000 +0000
@@ -11,11 +11,8 @@
 #include <signal.h>
 #include <string.h>
 #include <netinet/in.h>
-#include <sys/stat.h>
 #include <sys/time.h>
-#include <sys/fcntl.h>
 #include <sys/socket.h>
-#include <string.h>
 #include <sys/mman.h>
 #include <sys/param.h>
 #include "asm/types.h"
@@ -24,146 +21,30 @@
 #include "user.h"
 #include "ubd_user.h"
 #include "os.h"
+#include "cow.h"
 
 #include <endian.h>
 #include <byteswap.h>
-#if __BYTE_ORDER == __BIG_ENDIAN
-# define ntohll(x) (x)
-# define htonll(x) (x)
-#elif __BYTE_ORDER == __LITTLE_ENDIAN
-# define ntohll(x)  bswap_64(x)
-# define htonll(x)  bswap_64(x)
-#else
-#error "__BYTE_ORDER not defined"
-#endif
-
-#define PATH_LEN_V1 256
-
-struct cow_header_v1 {
-	int magic;
-	int version;
-	char backing_file[PATH_LEN_V1];
-	time_t mtime;
-	__u64 size;
-	int sectorsize;
-};
-
-#define PATH_LEN_V2 MAXPATHLEN
-
-struct cow_header_v2 {
-	unsigned long magic;
-	unsigned long version;
-	char backing_file[PATH_LEN_V2];
-	time_t mtime;
-	__u64 size;
-	int sectorsize;
-};
-
-union cow_header {
-	struct cow_header_v1 v1;
-	struct cow_header_v2 v2;
-};
-
-#define COW_MAGIC 0x4f4f4f4d  /* MOOO */
-#define COW_VERSION 2
-
-static void sizes(__u64 size, int sectorsize, int bitmap_offset, 
-		  unsigned long *bitmap_len_out, int *data_offset_out)
-{
-	*bitmap_len_out = (size + sectorsize - 1) / (8 * sectorsize);
-
-	*data_offset_out = bitmap_offset + *bitmap_len_out;
-	*data_offset_out = (*data_offset_out + sectorsize - 1) / sectorsize;
-	*data_offset_out *= sectorsize;
-}
-
-static int read_cow_header(int fd, int *magic_out, char **backing_file_out, 
-			   time_t *mtime_out, __u64 *size_out, 
-			   int *sectorsize_out, int *bitmap_offset_out)
-{
-	union cow_header *header;
-	char *file;
-	int err, n;
-	unsigned long version, magic;
-
-	header = um_kmalloc(sizeof(*header));
-	if(header == NULL){
-		printk("read_cow_header - Failed to allocate header\n");
-		return(-ENOMEM);
-	}
-	err = -EINVAL;
-	n = read(fd, header, sizeof(*header));
-	if(n < offsetof(typeof(header->v1), backing_file)){
-		printk("read_cow_header - short header\n");
-		goto out;
-	}
-
-	magic = header->v1.magic;
-	if(magic == COW_MAGIC) {
-		version = header->v1.version;
-	}
-	else if(magic == ntohl(COW_MAGIC)){
-		version = ntohl(header->v1.version);
-	}
-	else goto out;
-
-	*magic_out = COW_MAGIC;
-
-	if(version == 1){
-		if(n < sizeof(header->v1)){
-			printk("read_cow_header - failed to read V1 header\n");
-			goto out;
-		}
-		*mtime_out = header->v1.mtime;
-		*size_out = header->v1.size;
-		*sectorsize_out = header->v1.sectorsize;
-		*bitmap_offset_out = sizeof(header->v1);
-		file = header->v1.backing_file;
-	}
-	else if(version == 2){
-		if(n < sizeof(header->v2)){
-			printk("read_cow_header - failed to read V2 header\n");
-			goto out;
-		}
-		*mtime_out = ntohl(header->v2.mtime);
-		*size_out = ntohll(header->v2.size);
-		*sectorsize_out = ntohl(header->v2.sectorsize);
-		*bitmap_offset_out = sizeof(header->v2);
-		file = header->v2.backing_file;
-	}
-	else {
-		printk("read_cow_header - invalid COW version\n");
-		goto out;
-	}
-	err = -ENOMEM;
-	*backing_file_out = uml_strdup(file);
-	if(*backing_file_out == NULL){
-		printk("read_cow_header - failed to allocate backing file\n");
-		goto out;
-	}
-	err = 0;
- out:
-	kfree(header);
-	return(err);
-}
 
 static int same_backing_files(char *from_cmdline, char *from_cow, char *cow)
 {
-	struct stat buf1, buf2;
+	struct uml_stat buf1, buf2;
+	int err;
 
 	if(from_cmdline == NULL) return(1);
 	if(!strcmp(from_cmdline, from_cow)) return(1);
 
-	if(stat(from_cmdline, &buf1) < 0){
-		printk("Couldn't stat '%s', errno = %d\n", from_cmdline, 
-		       errno);
+	err = os_stat_file(from_cmdline, &buf1);
+	if(err < 0){
+		printk("Couldn't stat '%s', err = %d\n", from_cmdline, -err);
 		return(1);
 	}
-	if(stat(from_cow, &buf2) < 0){
-		printk("Couldn't stat '%s', errno = %d\n", from_cow, errno);
+	err = os_stat_file(from_cow, &buf2);
+	if(err < 0){
+		printk("Couldn't stat '%s', err = %d\n", from_cow, -err);
 		return(1);
 	}
-	if((buf1.st_dev == buf2.st_dev) && (buf1.st_ino == buf2.st_ino))
+	if((buf1.ust_dev == buf2.ust_dev) && (buf1.ust_ino == buf2.ust_ino))
 		return(1);
 
 	printk("Backing file mismatch - \"%s\" requested,\n"
@@ -174,20 +55,21 @@
 
 static int backing_file_mismatch(char *file, __u64 size, time_t mtime)
 {
-	struct stat64 buf;
+	unsigned long modtime;
 	long long actual;
 	int err;
 
-  	if(stat64(file, &buf) < 0){
-		printk("Failed to stat backing file \"%s\", errno = %d\n",
-		       file, errno);
-		return(-errno);
+	err = os_file_modtime(file, &modtime);
+	if(err < 0){
+		printk("Failed to get modification time of backing file "
+		       "\"%s\", err = %d\n", file, -err);
+		return(err);
 	}
 
 	err = os_file_size(file, &actual);
-	if(err){
+	if(err < 0){
 		printk("Failed to get size of backing file \"%s\", "
-		       "errno = %d\n", file, -err);
+		       "err = %d\n", file, -err);
 		return(err);
 	}
 
@@ -196,9 +78,9 @@
 		       "file\n", size, actual);
 		return(-EINVAL);
 	}
-	if(buf.st_mtime != mtime){
+	if(modtime != mtime){
 		printk("mtime mismatch (%ld vs %ld) of COW header vs backing "
-		       "file\n", mtime, buf.st_mtime);
+		       "file\n", mtime, modtime);
 		return(-EINVAL);
 	}
 	return(0);
@@ -209,124 +91,16 @@
 	int err;
 
 	err = os_seek_file(fd, offset);
-	if(err != 0) return(-errno);
-	err = read(fd, buf, len);
-	if(err < 0) return(-errno);
-	return(0);
-}
+	if(err < 0) 
+		return(err);
 
-static int absolutize(char *to, int size, char *from)
-{
-	char save_cwd[256], *slash;
-	int remaining;
+	err = os_read_file(fd, buf, len);
+	if(err < 0) 
+		return(err);
 
-	if(getcwd(save_cwd, sizeof(save_cwd)) == NULL) {
-		printk("absolutize : unable to get cwd - errno = %d\n", errno);
-		return(-1);
-	}
-	slash = strrchr(from, '/');
-	if(slash != NULL){
-		*slash = '\0';
-		if(chdir(from)){
-			*slash = '/';
-			printk("absolutize : Can't cd to '%s' - errno = %d\n",
-			       from, errno);
-			return(-1);
-		}
-		*slash = '/';
-		if(getcwd(to, size) == NULL){
-			printk("absolutize : unable to get cwd of '%s' - "
-			       "errno = %d\n", from, errno);
-			return(-1);
-		}
-		remaining = size - strlen(to);
-		if(strlen(slash) + 1 > remaining){
-			printk("absolutize : unable to fit '%s' into %d "
-			       "chars\n", from, size);
-			return(-1);
-		}
-		strcat(to, slash);
-	}
-	else {
-		if(strlen(save_cwd) + 1 + strlen(from) + 1 > size){
-			printk("absolutize : unable to fit '%s' into %d "
-			       "chars\n", from, size);
-			return(-1);
-		}
-		strcpy(to, save_cwd);
-		strcat(to, "/");
-		strcat(to, from);
-	}
-	chdir(save_cwd);
 	return(0);
 }
 
-static int write_cow_header(char *cow_file, int fd, char *backing_file, 
-			    int sectorsize, long long *size)
-{
-        struct cow_header_v2 *header;
-	struct stat64 buf;
-	int err;
-
-	err = os_seek_file(fd, 0);
-	if(err != 0){
-		printk("write_cow_header - lseek failed, errno = %d\n", errno);
-		return(-errno);
-	}
-
-	err = -ENOMEM;
-	header = um_kmalloc(sizeof(*header));
-	if(header == NULL){
-		printk("Failed to allocate COW V2 header\n");
-		goto out;
-	}
-	header->magic = htonl(COW_MAGIC);
-	header->version = htonl(COW_VERSION);
-
-	err = -EINVAL;
-	if(strlen(backing_file) > sizeof(header->backing_file) - 1){
-		printk("Backing file name \"%s\" is too long - names are "
-		       "limited to %d characters\n", backing_file, 
-		       sizeof(header->backing_file) - 1);
-		goto out_free;
-	}
-
-	if(absolutize(header->backing_file, sizeof(header->backing_file), 
-		      backing_file))
-		goto out_free;
-
-	err = stat64(header->backing_file, &buf);
-	if(err < 0){
-		printk("Stat of backing file '%s' failed, errno = %d\n",
-		       header->backing_file, errno);
-		err = -errno;
-		goto out_free;
-	}
-
-	err = os_file_size(header->backing_file, size);
-	if(err){
-		printk("Couldn't get size of backing file '%s', errno = %d\n",
-		       header->backing_file, -*size);
-		goto out_free;
-	}
-
-	header->mtime = htonl(buf.st_mtime);
-	header->size = htonll(*size);
-	header->sectorsize = htonl(sectorsize);
-
-	err = write(fd, header, sizeof(*header));
-	if(err != sizeof(*header)){
-		printk("Write of header to new COW file '%s' failed, "
-		       "errno = %d\n", cow_file, errno);
-		goto out_free;
-	}
-	err = 0;
- out_free:
-	kfree(header);
- out:
-	return(err);
-}
-
 int open_ubd_file(char *file, struct openflags *openflags, 
 		  char **backing_file_out, int *bitmap_offset_out, 
 		  unsigned long *bitmap_len_out, int *data_offset_out, 
@@ -334,26 +108,36 @@
 {
 	time_t mtime;
 	__u64 size;
+	__u32 version, align;
 	char *backing_file;
-        int fd, err, sectorsize, magic, same, mode = 0644;
+	int fd, err, sectorsize, same, mode = 0644;
 
-        if((fd = os_open_file(file, *openflags, mode)) < 0){
+	fd = os_open_file(file, *openflags, mode);
+	if(fd < 0){
 		if((fd == -ENOENT) && (create_cow_out != NULL))
 			*create_cow_out = 1;
                 if(!openflags->w ||
                    ((errno != EROFS) && (errno != EACCES))) return(-errno);
 		openflags->w = 0;
-                if((fd = os_open_file(file, *openflags, mode)) < 0) 
+		fd = os_open_file(file, *openflags, mode); 
+		if(fd < 0) 
 			return(fd);
         }
+
+	err = os_lock_file(fd, openflags->w);
+	if(err < 0){
+		printk("Failed to lock '%s', err = %d\n", file, -err);
+		goto out_close;
+	}
+	
 	if(backing_file_out == NULL) return(fd);
 
-	err = read_cow_header(fd, &magic, &backing_file, &mtime, &size, 
-			      &sectorsize, bitmap_offset_out);
+	err = read_cow_header(file_reader, &fd, &version, &backing_file, &mtime,
+			      &size, &sectorsize, &align, bitmap_offset_out);
 	if(err && (*backing_file_out != NULL)){
 		printk("Failed to read COW header from COW file \"%s\", "
-		       "errno = %d\n", file, err);
-		goto error;
+		       "errno = %d\n", file, -err);
+		goto out_close;
 	}
 	if(err) return(fd);
 
@@ -363,36 +147,33 @@
 
 	if(!same && !backing_file_mismatch(*backing_file_out, size, mtime)){
 		printk("Switching backing file to '%s'\n", *backing_file_out);
-		err = write_cow_header(file, fd, *backing_file_out, 
-				       sectorsize, &size);
+		err = write_cow_header(file, fd, *backing_file_out,
+				       sectorsize, align, &size);
 		if(err){
-			printk("Switch failed, errno = %d\n", err);
+			printk("Switch failed, errno = %d\n", -err);
 			return(err);
 		}
 	}
 	else {
 		*backing_file_out = backing_file;
 		err = backing_file_mismatch(*backing_file_out, size, mtime);
-		if(err) goto error;
+		if(err) goto out_close;
 	}
 
-	sizes(size, sectorsize, *bitmap_offset_out, bitmap_len_out, 
-	      data_offset_out);
+	cow_sizes(version, size, sectorsize, align, *bitmap_offset_out, 
+		  bitmap_len_out, data_offset_out);
 
         return(fd);
- error:
-	close(fd);
+ out_close:
+	os_close_file(fd);
 	return(err);
 }
 
 int create_cow_file(char *cow_file, char *backing_file, struct openflags flags,
-		    int sectorsize, int *bitmap_offset_out, 
+		    int sectorsize, int alignment, int *bitmap_offset_out, 
 		    unsigned long *bitmap_len_out, int *data_offset_out)
 {
-	__u64 blocks;
-	long zero;
-	int err, fd, i;
-	long long size;
+	int err, fd;
 
 	flags.c = 1;
 	fd = open_ubd_file(cow_file, &flags, NULL, NULL, NULL, NULL, NULL);
@@ -403,57 +184,49 @@
 		goto out;
 	}
 
-	err = write_cow_header(cow_file, fd, backing_file, sectorsize, &size);
-	if(err) goto out_close;
-
-	blocks = (size + sectorsize - 1) / sectorsize;
-	blocks = (blocks + sizeof(long) * 8 - 1) / (sizeof(long) * 8);
-	zero = 0;
-	for(i = 0; i < blocks; i++){
-		err = write(fd, &zero, sizeof(zero));
-		if(err != sizeof(zero)){
-			printk("Write of bitmap to new COW file '%s' failed, "
-			       "errno = %d\n", cow_file, errno);
-			goto out_close;
-		}
-	}
-
-	sizes(size, sectorsize, sizeof(struct cow_header_v2), 
-	      bitmap_len_out, data_offset_out);
-	*bitmap_offset_out = sizeof(struct cow_header_v2);
-
-	return(fd);
-
- out_close:
-	close(fd);
+	err = init_cow_file(fd, cow_file, backing_file, sectorsize, alignment,
+			    bitmap_offset_out, bitmap_len_out, 
+			    data_offset_out);
+	if(!err)
+		return(fd);
+	os_close_file(fd);
  out:
 	return(err);
 }
 
+/* XXX Just trivial wrappers around os_read_file and os_write_file */
 int read_ubd_fs(int fd, void *buffer, int len)
 {
-	int n;
-
-	n = read(fd, buffer, len);
-	if(n < 0) return(-errno);
-	else return(n);
+	return(os_read_file(fd, buffer, len));
 }
 
 int write_ubd_fs(int fd, char *buffer, int len)
 {
-	int n;
-
-	n = write(fd, buffer, len);
-	if(n < 0) return(-errno);
-	else return(n);
+	return(os_write_file(fd, buffer, len));
 }
 
-int ubd_is_dir(char *file)
+static int update_bitmap(struct io_thread_req *req)
 {
-	struct stat64 buf;
+	int n;
+
+	if(req->cow_offset == -1)
+		return(0);
+
+	n = os_seek_file(req->fds[1], req->cow_offset);
+	if(n < 0){
+		printk("do_io - bitmap lseek failed : err = %d\n", -n);
+		return(1);
+	}
+
+	n = os_write_file(req->fds[1], &req->bitmap_words,
+		          sizeof(req->bitmap_words));
+	if(n != sizeof(req->bitmap_words)){
+		printk("do_io - bitmap update failed, err = %d fd = %d\n", -n,
+		       req->fds[1]);
+		return(1);
+	}
 
-	if(stat64(file, &buf) < 0) return(0);
-	return(S_ISDIR(buf.st_mode));
+	return(0);
 }
 
 void do_io(struct io_thread_req *req)
@@ -461,8 +234,18 @@
 	char *buf;
 	unsigned long len;
 	int n, nsectors, start, end, bit;
+	int err;
 	__u64 off;
 
+	if(req->op == UBD_MMAP){
+		/* Touch the page to force the host to do any necessary IO to 
+		 * get it into memory 
+		 */
+		n = *((volatile int *) req->buffer);
+		req->error = update_bitmap(req);
+		return;
+	}
+
 	nsectors = req->length / req->sectorsize;
 	start = 0;
 	do {
@@ -473,15 +256,14 @@
 				    &req->sector_mask) == bit))
 			end++;
 
-		if(end != nsectors)
-			printk("end != nsectors\n");
 		off = req->offset + req->offsets[bit] + 
 			start * req->sectorsize;
 		len = (end - start) * req->sectorsize;
 		buf = &req->buffer[start * req->sectorsize];
 
-		if(os_seek_file(req->fds[bit], off) != 0){
-			printk("do_io - lseek failed : errno = %d\n", errno);
+		err = os_seek_file(req->fds[bit], off);
+		if(err < 0){
+			printk("do_io - lseek failed : err = %d\n", -err);
 			req->error = 1;
 			return;
 		}
@@ -490,11 +272,10 @@
 			do {
 				buf = &buf[n];
 				len -= n;
-				n = read(req->fds[bit], buf, len);
+				n = os_read_file(req->fds[bit], buf, len);
 				if (n < 0) {
-					printk("do_io - read returned %d : "
-					       "errno = %d fd = %d\n", n,
-					       errno, req->fds[bit]);
+					printk("do_io - read failed, err = %d "
+					       "fd = %d\n", -n, req->fds[bit]);
 					req->error = 1;
 					return;
 				}
@@ -502,11 +283,10 @@
 			if (n < len) memset(&buf[n], 0, len - n);
 		}
 		else {
-			n = write(req->fds[bit], buf, len);
+			n = os_write_file(req->fds[bit], buf, len);
 			if(n != len){
-				printk("do_io - write returned %d : "
-				       "errno = %d fd = %d\n", n, 
-				       errno, req->fds[bit]);
+				printk("do_io - write failed err = %d "
+				       "fd = %d\n", -n, req->fds[bit]);
 				req->error = 1;
 				return;
 			}
@@ -515,24 +295,7 @@
 		start = end;
 	} while(start < nsectors);
 
-	if(req->cow_offset != -1){
-		if(os_seek_file(req->fds[1], req->cow_offset) != 0){
-			printk("do_io - bitmap lseek failed : errno = %d\n",
-			       errno);
-			req->error = 1;
-			return;
-		}
-		n = write(req->fds[1], &req->bitmap_words, 
-			  sizeof(req->bitmap_words));
-		if(n != sizeof(req->bitmap_words)){
-			printk("do_io - bitmap update returned %d : "
-			       "errno = %d fd = %d\n", n, errno, req->fds[1]);
-			req->error = 1;
-			return;
-		}
-	}
-	req->error = 0;
-	return;
+	req->error = update_bitmap(req);
 }
 
 /* Changed in start_io_thread, which is serialized by being called only
@@ -550,19 +313,23 @@
 
 	signal(SIGWINCH, SIG_IGN);
 	while(1){
-		n = read(kernel_fd, &req, sizeof(req));
-		if(n < 0) printk("io_thread - read returned %d, errno = %d\n",
-				 n, errno);
-		else if(n < sizeof(req)){
-			printk("io_thread - short read : length = %d\n", n);
+		n = os_read_file(kernel_fd, &req, sizeof(req));
+		if(n != sizeof(req)){
+			if(n < 0)
+				printk("io_thread - read failed, fd = %d, "
+				       "err = %d\n", kernel_fd, -n);
+			else {
+				printk("io_thread - short read, fd = %d, "
+				       "length = %d\n", kernel_fd, n);
+			}
 			continue;
 		}
 		io_count++;
 		do_io(&req);
-		n = write(kernel_fd, &req, sizeof(req));
+		n = os_write_file(kernel_fd, &req, sizeof(req));
 		if(n != sizeof(req))
-			printk("io_thread - write failed, errno = %d\n",
-			       errno);
+			printk("io_thread - write failed, fd = %d, err = %d\n",
+			       kernel_fd, -n);
 	}
 }
 
@@ -571,10 +338,11 @@
 	int pid, fds[2], err;
 
 	err = os_pipe(fds, 1, 1);
-	if(err){
-		printk("start_io_thread - os_pipe failed, errno = %d\n", -err);
-		return(-1);
+	if(err < 0){
+		printk("start_io_thread - os_pipe failed, err = %d\n", -err);
+		goto out;
 	}
+
 	kernel_fd = fds[0];
 	*fd_out = fds[1];
 
@@ -582,32 +350,19 @@
 		    NULL);
 	if(pid < 0){
 		printk("start_io_thread - clone failed : errno = %d\n", errno);
-		return(-errno);
+		goto out_close;
 	}
-	return(pid);
-}
-
-#ifdef notdef
-int start_io_thread(unsigned long sp, int *fd_out)
-{
-	int pid;
 
-	if((kernel_fd = get_pty()) < 0) return(-1);
-	raw(kernel_fd, 0);
-	if((*fd_out = open(ptsname(kernel_fd), O_RDWR)) < 0){
-		printk("Couldn't open tty for IO\n");
-		return(-1);
-	}
-
-	pid = clone(io_thread, (void *) sp, CLONE_FILES | CLONE_VM | SIGCHLD,
-		    NULL);
-	if(pid < 0){
-		printk("start_io_thread - clone failed : errno = %d\n", errno);
-		return(-errno);
-	}
 	return(pid);
+
+ out_close:
+	os_close_file(fds[0]);
+	os_close_file(fds[1]);
+	kernel_fd = -1;
+	*fd_out = -1;
+ out:
+	return(err);
 }
-#endif
 
 /*
  * Overrides for Emacs so that we follow Linus's tabbing style.
--- diff/arch/um/drivers/xterm.c	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/um/drivers/xterm.c	2004-02-09 10:39:51.000000000 +0000
@@ -8,7 +8,6 @@
 #include <unistd.h>
 #include <string.h>
 #include <errno.h>
-#include <fcntl.h>
 #include <termios.h>
 #include <signal.h>
 #include <sched.h>
@@ -36,7 +35,8 @@
 {
 	struct xterm_chan *data;
 
-	if((data = malloc(sizeof(*data))) == NULL) return(NULL);
+	data = malloc(sizeof(*data));
+	if(data == NULL) return(NULL);
 	*data = ((struct xterm_chan) { .pid 		= -1, 
 				       .helper_pid 	= -1,
 				       .device 		= device, 
@@ -93,7 +93,7 @@
 			 "/usr/lib/uml/port-helper", "-uml-socket",
 			 file, NULL };
 
-	if(access(argv[4], X_OK))
+	if(os_access(argv[4], OS_ACC_X_OK) < 0)
 		argv[4] = "port-helper";
 
 	fd = mkstemp(file);
@@ -106,13 +106,13 @@
 		printk("xterm_open : unlink failed, errno = %d\n", errno);
 		return(-errno);
 	}
-	close(fd);
+	os_close_file(fd);
 
-	fd = create_unix_socket(file, sizeof(file));
+	fd = os_create_unix_socket(file, sizeof(file), 1);
 	if(fd < 0){
 		printk("xterm_open : create_unix_socket failed, errno = %d\n", 
 		       -fd);
-		return(-fd);
+		return(fd);
 	}
 
 	sprintf(title, data->title, data->device);
@@ -128,15 +128,16 @@
 	if(data->direct_rcv)
 		new = os_rcv_fd(fd, &data->helper_pid);
 	else {
-		if((err = os_set_fd_block(fd, 0)) != 0){
+		err = os_set_fd_block(fd, 0);
+		if(err < 0){
 			printk("xterm_open : failed to set descriptor "
-			       "non-blocking, errno = %d\n", err);
+			       "non-blocking, err = %d\n", -err);
 			return(err);
 		}
 		new = xterm_fd(fd, &data->helper_pid);
 	}
 	if(new < 0){
-		printk("xterm_open : os_rcv_fd failed, errno = %d\n", -new);
+		printk("xterm_open : os_rcv_fd failed, err = %d\n", -new);
 		goto out;
 	}
 
@@ -160,7 +161,7 @@
 	if(data->helper_pid != -1) 
 		os_kill_process(data->helper_pid, 0);
 	data->helper_pid = -1;
-	close(fd);
+	os_close_file(fd);
 }
 
 void xterm_free(void *d)
--- diff/arch/um/drivers/xterm_kern.c	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/um/drivers/xterm_kern.c	2004-02-09 10:39:51.000000000 +0000
@@ -5,9 +5,12 @@
 
 #include "linux/errno.h"
 #include "linux/slab.h"
+#include "linux/signal.h"
+#include "linux/interrupt.h"
 #include "asm/semaphore.h"
 #include "asm/irq.h"
 #include "irq_user.h"
+#include "irq_kern.h"
 #include "kern_util.h"
 #include "os.h"
 #include "xterm.h"
@@ -19,17 +22,18 @@
 	int new_fd;
 };
 
-static void xterm_interrupt(int irq, void *data, struct pt_regs *regs)
+static irqreturn_t xterm_interrupt(int irq, void *data, struct pt_regs *regs)
 {
 	struct xterm_wait *xterm = data;
 	int fd;
 
 	fd = os_rcv_fd(xterm->fd, &xterm->pid);
 	if(fd == -EAGAIN)
-		return;
+		return(IRQ_NONE);
 
 	xterm->new_fd = fd;
 	up(&xterm->sem);
+	return(IRQ_HANDLED);
 }
 
 int xterm_fd(int socket, int *pid_out)
@@ -54,7 +58,8 @@
 	if(err){
 		printk(KERN_ERR "xterm_fd : failed to get IRQ for xterm, "
 		       "err = %d\n",  err);
-		return(err);
+		ret = err;
+		goto out;
 	}
 	down(&data->sem);
 
@@ -62,6 +67,7 @@
 
 	ret = data->new_fd;
 	*pid_out = data->pid;
+ out:
 	kfree(data);
 
 	return(ret);
--- diff/arch/um/dyn.lds.S	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/um/dyn.lds.S	2004-02-09 10:39:51.000000000 +0000
@@ -10,12 +10,15 @@
 {
   . = START + SIZEOF_HEADERS;
   .interp         : { *(.interp) }
-  . = ALIGN(4096);
   __binary_start = .;
   . = ALIGN(4096);		/* Init code and data */
   _stext = .;
   __init_begin = .;
-  .text.init : { *(.text.init) }
+  .init.text : { 
+	_sinittext = .;
+	*(.init.text)
+	_einittext = .;
+  }
 
   . = ALIGN(4096);
 
@@ -67,7 +70,7 @@
 
   #include "asm/common.lds.S"
 
-  .data.init : { *(.data.init) }
+  init.data : { *(.init.data) }
 
   /* Ensure the __preinit_array_start label is properly aligned.  We
      could instead move the label definition inside the section, but
--- diff/arch/um/include/2_5compat.h	2002-10-16 04:28:20.000000000 +0100
+++ source/arch/um/include/2_5compat.h	2004-02-09 10:39:51.000000000 +0000
@@ -6,20 +6,6 @@
 #ifndef __2_5_COMPAT_H__
 #define __2_5_COMPAT_H__
 
-#include "linux/version.h"
-
-#define INIT_CONSOLE(dev_name, write_proc, device_proc, setup_proc, f) { \
-	name :		dev_name, \
-	write :		write_proc, \
-	read :		NULL, \
-	device :	device_proc, \
-	setup :		setup_proc, \
-	flags :		f, \
-	index :		-1, \
-	cflag :		0, \
-	next :		NULL \
-}
-
 #define INIT_HARDSECT(arr, maj, sizes)
 
 #define SET_PRI(task) do ; while(0)
--- diff/arch/um/include/kern_util.h	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/um/include/kern_util.h	2004-02-09 10:39:51.000000000 +0000
@@ -63,10 +63,9 @@
 extern void *syscall_sp(void *t);
 extern void syscall_trace(void);
 extern int hz(void);
-extern void idle_timer(void);
+extern void uml_idle_timer(void);
 extern unsigned int do_IRQ(int irq, union uml_pt_regs *regs);
 extern int external_pid(void *t);
-extern int pid_to_processor_id(int pid);
 extern void boot_timer_handler(int sig);
 extern void interrupt_end(void);
 extern void initial_thread_cb(void (*proc)(void *), void *arg);
@@ -90,9 +89,7 @@
 extern char *uml_strdup(char *string);
 extern void unprotect_kernel_mem(void);
 extern void protect_kernel_mem(void);
-extern void set_kmem_end(unsigned long);
 extern void uml_cleanup(void);
-extern int pid_to_processor_id(int pid);
 extern void set_current(void *t);
 extern void lock_signalled_task(void *t);
 extern void IPI_handler(int cpu);
@@ -101,7 +98,9 @@
 extern int clear_user_proc(void *buf, int size);
 extern int copy_to_user_proc(void *to, void *from, int size);
 extern int copy_from_user_proc(void *to, void *from, int size);
+extern int strlen_user_proc(char *str);
 extern void bus_handler(int sig, union uml_pt_regs *regs);
+extern void winch(int sig, union uml_pt_regs *regs);
 extern long execute_syscall(void *r);
 extern int smp_sigio_handler(void);
 extern void *get_current(void);
@@ -112,6 +111,8 @@
 extern void free_irq(unsigned int, void *);
 extern int um_in_interrupt(void);
 extern int cpu(void);
+extern unsigned long long time_stamp(void);
+
 #endif
 
 /*
--- diff/arch/um/include/line.h	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/um/include/line.h	2004-02-09 10:39:51.000000000 +0000
@@ -9,12 +9,14 @@
 #include "linux/list.h"
 #include "linux/workqueue.h"
 #include "linux/tty.h"
+#include "linux/interrupt.h"
 #include "asm/semaphore.h"
 #include "chan_user.h"
 #include "mconsole_kern.h"
 
 struct line_driver {
 	char *name;
+	char *device_name;
 	char *devfs_name;
 	short major;
 	short minor_start;
@@ -67,8 +69,6 @@
 
 #define LINES_INIT(n) {  num :		n }
 
-extern void line_interrupt(int irq, void *data, struct pt_regs *unused);
-extern void line_write_interrupt(int irq, void *data, struct pt_regs *unused);
 extern void line_close(struct line *lines, struct tty_struct *tty);
 extern int line_open(struct line *lines, struct tty_struct *tty, 
 		     struct chan_opts *opts);
--- diff/arch/um/include/mconsole.h	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/um/include/mconsole.h	2004-02-09 10:39:51.000000000 +0000
@@ -41,11 +41,13 @@
 
 struct mc_request;
 
+enum mc_context { MCONSOLE_INTR, MCONSOLE_PROC };
+
 struct mconsole_command
 {
 	char *command;
 	void (*handler)(struct mc_request *req);
-	int as_interrupt;
+	enum mc_context context;
 };
 
 struct mc_request
@@ -77,6 +79,8 @@
 extern void mconsole_cad(struct mc_request *req);
 extern void mconsole_stop(struct mc_request *req);
 extern void mconsole_go(struct mc_request *req);
+extern void mconsole_log(struct mc_request *req);
+extern void mconsole_proc(struct mc_request *req);
 
 extern int mconsole_get_request(int fd, struct mc_request *req);
 extern int mconsole_notify(char *sock_name, int type, const void *data, 
--- diff/arch/um/include/mem.h	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/um/include/mem.h	2004-02-09 10:39:51.000000000 +0000
@@ -1,19 +1,17 @@
 /* 
- * Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
+ * Copyright (C) 2002, 2003 Jeff Dike (jdike@addtoit.com)
  * Licensed under the GPL
  */
 
 #ifndef __MEM_H__
 #define __MEM_H__
 
-struct vm_reserved {
-	struct list_head list;
-	unsigned long start;
-	unsigned long end;
-};
+#include "linux/types.h"
 
-extern void set_usable_vm(unsigned long start, unsigned long end);
-extern void set_kmem_end(unsigned long new);
+extern int phys_mapping(unsigned long phys, __u64 *offset_out);
+extern int physmem_subst_mapping(void *virt, int fd, __u64 offset, int w);
+extern int is_remapped(void *virt);
+extern int physmem_remove_mapping(void *virt);
 
 #endif
 
--- diff/arch/um/include/mem_user.h	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/um/include/mem_user.h	2004-02-09 10:39:51.000000000 +0000
@@ -32,43 +32,38 @@
 #ifndef _MEM_USER_H
 #define _MEM_USER_H
 
-struct mem_region {
+struct iomem_region {
+	struct iomem_region *next;
 	char *driver;
-	unsigned long start_pfn;
-	unsigned long start;
-	unsigned long len;
-	void *mem_map;
 	int fd;
+	int size;
+	unsigned long phys;
+	unsigned long virt;
 };
 
-extern struct mem_region *regions[];
-extern struct mem_region physmem_region;
+extern struct iomem_region *iomem_regions;
+extern int iomem_size;
 
 #define ROUND_4M(n) ((((unsigned long) (n)) + (1 << 22)) & ~((1 << 22) - 1))
 
 extern unsigned long host_task_size;
 extern unsigned long task_size;
 
+extern void check_devanon(void);
 extern int init_mem_user(void);
 extern int create_mem_file(unsigned long len);
-extern void setup_range(int fd, char *driver, unsigned long start,
-			unsigned long pfn, unsigned long total, int need_vm, 
-			struct mem_region *region, void *reserved);
 extern void setup_memory(void *entry);
 extern unsigned long find_iomem(char *driver, unsigned long *len_out);
-extern int init_maps(struct mem_region *region);
-extern int nregions(void);
-extern int reserve_vm(unsigned long start, unsigned long end, void *e);
+extern int init_maps(unsigned long physmem, unsigned long iomem, 
+		     unsigned long highmem);
 extern unsigned long get_vm(unsigned long len);
 extern void setup_physmem(unsigned long start, unsigned long usable,
-			  unsigned long len);
-extern int setup_region(struct mem_region *region, void *entry);
+			  unsigned long len, unsigned long highmem);
 extern void add_iomem(char *name, int fd, unsigned long size);
-extern struct mem_region *phys_region(unsigned long phys);
 extern unsigned long phys_offset(unsigned long phys);
 extern void unmap_physmem(void);
-extern int map_memory(unsigned long virt, unsigned long phys, 
-		      unsigned long len, int r, int w, int x);
+extern void map_memory(unsigned long virt, unsigned long phys, 
+		       unsigned long len, int r, int w, int x);
 extern int protect_memory(unsigned long addr, unsigned long len, 
 			  int r, int w, int x, int must_succeed);
 extern unsigned long get_kmem_end(void);
--- diff/arch/um/include/os.h	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/um/include/os.h	2004-02-09 10:39:51.000000000 +0000
@@ -17,6 +17,32 @@
 #define OS_TYPE_FIFO 6
 #define OS_TYPE_SOCK 7
 
+/* os_access() flags */
+#define OS_ACC_F_OK    0       /* Test for existence.  */
+#define OS_ACC_X_OK    1       /* Test for execute permission.  */
+#define OS_ACC_W_OK    2       /* Test for write permission.  */
+#define OS_ACC_R_OK    4       /* Test for read permission.  */
+#define OS_ACC_RW_OK   (OS_ACC_W_OK | OS_ACC_R_OK) /* Test for RW permission */
+
+/*
+ * types taken from stat_file() in hostfs_user.c
+ * (if they are wrong here, they are wrong there...).
+ */
+struct uml_stat {
+	int                ust_dev;        /* device */
+	unsigned long long ust_ino;        /* inode */
+	int                ust_mode;       /* protection */
+	int                ust_nlink;      /* number of hard links */
+	int                ust_uid;        /* user ID of owner */
+	int                ust_gid;        /* group ID of owner */
+	unsigned long long ust_size;       /* total size, in bytes */
+	int                ust_blksize;    /* blocksize for filesystem I/O */
+	unsigned long long ust_blocks;     /* number of blocks allocated */
+	unsigned long      ust_atime;      /* time of last access */
+	unsigned long      ust_mtime;      /* time of last modification */
+	unsigned long      ust_ctime;      /* time of last change */
+};
+
 struct openflags {
 	unsigned int r : 1;
 	unsigned int w : 1;
@@ -84,29 +110,47 @@
 	flags.e = 1; 
 	return(flags); 
 }
- 
+
 static inline struct openflags of_cloexec(struct openflags flags)
 { 
 	flags.cl = 1; 
 	return(flags); 
 }
   
+extern int os_stat_file(const char *file_name, struct uml_stat *buf);
+extern int os_stat_fd(const int fd, struct uml_stat *buf);
+extern int os_access(const char *file, int mode);
+extern void os_print_error(int error, const char* str);
+extern int os_get_exec_close(int fd, int *close_on_exec);
+extern int os_set_exec_close(int fd, int close_on_exec);
+extern int os_ioctl_generic(int fd, unsigned int cmd, unsigned long arg);
+extern int os_window_size(int fd, int *rows, int *cols);
+extern int os_new_tty_pgrp(int fd, int pid);
+extern int os_get_ifname(int fd, char *namebuf);
+extern int os_set_slip(int fd);
+extern int os_set_owner(int fd, int pid);
+extern int os_sigio_async(int master, int slave);
+extern int os_mode_fd(int fd, int mode);
+
 extern int os_seek_file(int fd, __u64 offset);
 extern int os_open_file(char *file, struct openflags flags, int mode);
 extern int os_read_file(int fd, void *buf, int len);
-extern int os_write_file(int fd, void *buf, int count);
+extern int os_write_file(int fd, const void *buf, int count);
 extern int os_file_size(char *file, long long *size_out);
+extern int os_file_modtime(char *file, unsigned long *modtime);
 extern int os_pipe(int *fd, int stream, int close_on_exec);
 extern int os_set_fd_async(int fd, int owner);
 extern int os_set_fd_block(int fd, int blocking);
 extern int os_accept_connection(int fd);
+extern int os_create_unix_socket(char *file, int len, int close_on_exec);
 extern int os_shutdown_socket(int fd, int r, int w);
 extern void os_close_file(int fd);
 extern int os_rcv_fd(int fd, int *helper_pid_out);
-extern int create_unix_socket(char *file, int len);
+extern int create_unix_socket(char *file, int len, int close_on_exec);
 extern int os_connect_socket(char *name);
 extern int os_file_type(char *file);
 extern int os_file_mode(char *file, struct openflags *mode_out);
+extern int os_lock_file(int fd, int excl);
 
 extern unsigned long os_process_pc(int pid);
 extern int os_process_parent(int pid);
@@ -115,11 +159,12 @@
 extern void os_usr1_process(int pid);
 extern int os_getpid(void);
 
-extern int os_map_memory(void *virt, int fd, unsigned long off, 
+extern int os_map_memory(void *virt, int fd, unsigned long long off, 
 			 unsigned long len, int r, int w, int x);
 extern int os_protect_memory(void *addr, unsigned long len, 
 			     int r, int w, int x);
 extern int os_unmap_memory(void *addr, int len);
+extern void os_flush_stdout(void);
 
 #endif
 
--- diff/arch/um/include/skas_ptrace.h	2003-02-13 11:46:50.000000000 +0000
+++ source/arch/um/include/skas_ptrace.h	2004-02-09 10:39:51.000000000 +0000
@@ -1,5 +1,5 @@
 /* 
- * Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
+ * Copyright (C) 2000, 2001, 2002 Jeff Dike (jdike@karaya.com)
  * Licensed under the GPL
  */
 
--- diff/arch/um/include/sysdep-i386/frame_user.h	2003-02-13 11:46:50.000000000 +0000
+++ source/arch/um/include/sysdep-i386/frame_user.h	2004-02-09 10:39:51.000000000 +0000
@@ -56,26 +56,26 @@
  * it would have to be __builtin_frame_address(1).
  */
 
-static inline unsigned long frame_restorer(void)
-{
-	unsigned long *fp;
-
-	fp = __builtin_frame_address(0);
-	return((unsigned long) (fp + 1));
-}
+#define frame_restorer() \
+({ \
+	unsigned long *fp; \
+\
+	fp = __builtin_frame_address(0); \
+	((unsigned long) (fp + 1)); \
+})
 
 /* Similarly, this returns the value of sp when the handler was first
  * entered.  This is used to calculate the proper sp when delivering
  * signals.
  */
 
-static inline unsigned long frame_sp(void)
-{
-	unsigned long *fp;
-
-	fp = __builtin_frame_address(0);
-	return((unsigned long) (fp + 1));
-}
+#define frame_sp() \
+({ \
+	unsigned long *fp; \
+\
+	fp = __builtin_frame_address(0); \
+	((unsigned long) (fp + 1)); \
+})
 
 #endif
 
--- diff/arch/um/include/sysdep-i386/sigcontext.h	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/um/include/sysdep-i386/sigcontext.h	2004-02-09 10:39:51.000000000 +0000
@@ -28,8 +28,8 @@
  */
 #define SC_START_SYSCALL(sc) do SC_EAX(sc) = -ENOSYS; while(0)
 
-/* These are General Protection and Page Fault */
-#define SEGV_IS_FIXABLE(trap) ((trap == 13) || (trap == 14))
+/* This is Page Fault */
+#define SEGV_IS_FIXABLE(trap) (trap == 14)
 
 #define SC_SEGV_IS_FIXABLE(sc) (SEGV_IS_FIXABLE(SC_TRAPNO(sc)))
 
--- diff/arch/um/include/ubd_user.h	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/um/include/ubd_user.h	2004-02-09 10:39:51.000000000 +0000
@@ -9,7 +9,7 @@
 
 #include "os.h"
 
-enum ubd_req { UBD_READ, UBD_WRITE };
+enum ubd_req { UBD_READ, UBD_WRITE, UBD_MMAP };
 
 struct io_thread_req {
 	enum ubd_req op;
@@ -20,8 +20,10 @@
 	char *buffer;
 	int sectorsize;
 	unsigned long sector_mask;
-	unsigned long cow_offset;
+	unsigned long long cow_offset;
 	unsigned long bitmap_words[2];
+	int map_fd;
+	unsigned long long map_offset;
 	int error;
 };
 
@@ -31,7 +33,7 @@
 			 int *create_cow_out);
 extern int create_cow_file(char *cow_file, char *backing_file, 
 			   struct openflags flags, int sectorsize, 
-			   int *bitmap_offset_out, 
+			   int alignment, int *bitmap_offset_out, 
 			   unsigned long *bitmap_len_out,
 			   int *data_offset_out);
 extern int read_cow_bitmap(int fd, void *buf, int offset, int len);
@@ -39,7 +41,6 @@
 extern int write_ubd_fs(int fd, char *buffer, int len);
 extern int start_io_thread(unsigned long sp, int *fds_out);
 extern void do_io(struct io_thread_req *req);
-extern int ubd_is_dir(char *file);
 
 static inline int ubd_test_bit(__u64 bit, unsigned char *data)
 {
--- diff/arch/um/include/um_uaccess.h	2003-01-02 10:43:04.000000000 +0000
+++ source/arch/um/include/um_uaccess.h	2004-02-09 10:39:51.000000000 +0000
@@ -38,22 +38,73 @@
 				from, n));
 }
 
+/*
+ * strncpy_from_user: - Copy a NUL terminated string from userspace.
+ * @dst:   Destination address, in kernel space.  This buffer must be at
+ *         least @count bytes long.
+ * @src:   Source address, in user space.
+ * @count: Maximum number of bytes to copy, including the trailing NUL.
+ * 
+ * Copies a NUL-terminated string from userspace to kernel space.
+ *
+ * On success, returns the length of the string (not including the trailing
+ * NUL).
+ *
+ * If access to userspace fails, returns -EFAULT (some data may have been
+ * copied).
+ *
+ * If @count is smaller than the length of the string, copies @count bytes
+ * and returns @count.
+ */
+
 static inline int strncpy_from_user(char *dst, const char *src, int count)
 {
 	return(CHOOSE_MODE_PROC(strncpy_from_user_tt, strncpy_from_user_skas,
 				dst, src, count));
 }
 
+/*
+ * __clear_user: - Zero a block of memory in user space, with less checking.
+ * @to:   Destination address, in user space.
+ * @n:    Number of bytes to zero.
+ *
+ * Zero a block of memory in user space.  Caller must check
+ * the specified block with access_ok() before calling this function.
+ *
+ * Returns number of bytes that could not be cleared.
+ * On success, this will be zero.
+ */
 static inline int __clear_user(void *mem, int len)
 {
 	return(CHOOSE_MODE_PROC(__clear_user_tt, __clear_user_skas, mem, len));
 }
 
+/*
+ * clear_user: - Zero a block of memory in user space.
+ * @to:   Destination address, in user space.
+ * @n:    Number of bytes to zero.
+ *
+ * Zero a block of memory in user space.
+ *
+ * Returns number of bytes that could not be cleared.
+ * On success, this will be zero.
+ */
 static inline int clear_user(void *mem, int len)
 {
 	return(CHOOSE_MODE_PROC(clear_user_tt, clear_user_skas, mem, len));
 }
 
+/*
+ * strlen_user: - Get the size of a string in user space.
+ * @str: The string to measure.
+ * @n:   The maximum valid length
+ *
+ * Get the size of a NUL-terminated string in user space.
+ *
+ * Returns the size of the string INCLUDING the terminating NUL.
+ * On exception, returns 0.
+ * If the string is too long, returns a value greater than @n.
+ */
 static inline int strnlen_user(const void *str, int len)
 {
 	return(CHOOSE_MODE_PROC(strnlen_user_tt, strnlen_user_skas, str, len));
--- diff/arch/um/include/user.h	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/um/include/user.h	2004-02-09 10:39:51.000000000 +0000
@@ -14,6 +14,7 @@
 extern void kfree(void *ptr);
 extern int in_aton(char *str);
 extern int open_gdb_chan(void);
+extern int strlcpy(char *, const char *, int);
 
 #endif
 
--- diff/arch/um/include/user_util.h	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/um/include/user_util.h	2004-02-09 10:39:51.000000000 +0000
@@ -14,8 +14,6 @@
 extern int unlockpt(int __fd);
 extern char *ptsname(int __fd);
 
-enum { OP_NONE, OP_EXEC, OP_FORK, OP_TRACE_ON, OP_REBOOT, OP_HALT, OP_CB };
-
 struct cpu_task {
 	int pid;
 	void *task;
@@ -59,7 +57,6 @@
 extern void *add_signal_handler(int sig, void (*handler)(int));
 extern int start_fork_tramp(void *arg, unsigned long temp_stack, 
 			    int clone_flags, int (*tramp)(void *));
-extern int clone_and_wait(int (*fn)(void *), void *arg, void *sp, int flags);
 extern int linux_main(int argc, char **argv);
 extern void set_cmdline(char *cmd);
 extern void input_cb(void (*proc)(void *), void *arg, int arg_len);
@@ -86,11 +83,13 @@
 extern int run_kernel_thread(int (*fn)(void *), void *arg, void **jmp_ptr);
 extern void write_sigio_workaround(void);
 extern void arch_check_bugs(void);
+extern int cpu_feature(char *what, char *buf, int len);
 extern int arch_handle_signal(int sig, union uml_pt_regs *regs);
 extern int arch_fixup(unsigned long address, void *sc_ptr);
 extern void forward_pending_sigio(int target);
 extern int can_do_skas(void);
- 
+extern void arch_init_thread(void);
+
 #endif
 
 /*
--- diff/arch/um/kernel/Makefile	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/um/kernel/Makefile	2004-02-09 10:39:51.000000000 +0000
@@ -7,11 +7,11 @@
 
 obj-y = checksum.o config.o exec_kern.o exitcode.o frame_kern.o frame.o \
 	helper.o init_task.o irq.o irq_user.o ksyms.o mem.o mem_user.o \
-	process.o process_kern.o ptrace.o reboot.o resource.o sigio_user.o \
-	sigio_kern.o signal_kern.o signal_user.o smp.o syscall_kern.o \
-	syscall_user.o sysrq.o sys_call_table.o tempfile.o time.o \
-	time_kern.o tlb.o trap_kern.o trap_user.o uaccess_user.o um_arch.o \
-	umid.o user_syms.o user_util.o
+	physmem.o process.o process_kern.o ptrace.o reboot.o resource.o \
+	sigio_user.o sigio_kern.o signal_kern.o signal_user.o smp.o \
+	syscall_kern.o syscall_user.o sysrq.o sys_call_table.o tempfile.o \
+	time.o time_kern.o tlb.o trap_kern.o trap_user.o uaccess_user.o \
+	um_arch.o umid.o user_syms.o user_util.o
 
 obj-$(CONFIG_BLK_DEV_INITRD) += initrd_kern.o initrd_user.o
 obj-$(CONFIG_GPROF)	+= gprof_syms.o
@@ -21,6 +21,8 @@
 obj-$(CONFIG_MODE_TT) += tt/
 obj-$(CONFIG_MODE_SKAS) += skas/
 
+clean-files	:= config.c
+
 user-objs-$(CONFIG_TTY_LOG) += tty_log.o
 
 USER_OBJS := $(filter %_user.o,$(obj-y))  $(user-objs-y) config.o helper.o \
@@ -45,17 +47,13 @@
 $(obj)/frame.o: $(src)/frame.c
 	$(CC) $(CFLAGS_$(notdir $@)) -c -o $@ $<
 
-QUOTE = 'my $$config=`cat $(TOPDIR)/.config`; $$config =~ s/"/\\"/g ; while(<STDIN>) { $$_ =~ s/CONFIG/$$config/; print $$_ }'
+QUOTE = 'my $$config=`cat $(TOPDIR)/.config`; $$config =~ s/"/\\"/g ; $$config =~ s/\n/\\n"\n"/g ; while(<STDIN>) { $$_ =~ s/CONFIG/$$config/; print $$_ }'
 
 $(obj)/config.c : $(src)/config.c.in $(TOPDIR)/.config
 	$(PERL) -e $(QUOTE) < $(src)/config.c.in > $@
 
 $(obj)/config.o : $(obj)/config.c
 
-clean:
-	rm -f config.c
-	for dir in $(subdir-y) ; do $(MAKE) -C $$dir clean; done
-
 modules:
 
 fastdep:
--- diff/arch/um/kernel/config.c.in	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/um/kernel/config.c.in	2004-02-09 10:39:51.000000000 +0000
@@ -7,9 +7,7 @@
 #include <stdlib.h>
 #include "init.h"
 
-static __initdata char *config = "
-CONFIG
-";
+static __initdata char *config = "CONFIG";
 
 static int __init print_config(char *line, int *add)
 {
--- diff/arch/um/kernel/exec_kern.c	2003-02-26 16:01:01.000000000 +0000
+++ source/arch/um/kernel/exec_kern.c	2004-02-09 10:39:51.000000000 +0000
@@ -32,10 +32,15 @@
 	CHOOSE_MODE_PROC(start_thread_tt, start_thread_skas, regs, eip, esp);
 }
 
+extern void log_exec(char **argv, void *tty);
+
 static int execve1(char *file, char **argv, char **env)
 {
         int error;
 
+#ifdef CONFIG_TTY_LOG
+	log_exec(argv, current->tty);
+#endif
         error = do_execve(file, argv, env, &current->thread.regs);
         if (error == 0){
                 current->ptrace &= ~PT_DTRACE;
--- diff/arch/um/kernel/frame.c	2003-02-13 11:46:50.000000000 +0000
+++ source/arch/um/kernel/frame.c	2004-02-09 10:39:51.000000000 +0000
@@ -279,7 +279,7 @@
 	struct sc_frame_raw raw_sc;
 	struct si_frame_raw raw_si;
 	void *stack, *sigstack;
-	unsigned long top, sig_top, base;
+	unsigned long top, base;
 
 	stack = mmap(NULL, PAGE_SIZE, PROT_READ | PROT_WRITE | PROT_EXEC,
 		     MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
@@ -292,7 +292,6 @@
 	}
 
 	top = (unsigned long) stack + PAGE_SIZE - sizeof(void *);
-	sig_top = (unsigned long) sigstack + PAGE_SIZE;
 
 	/* Get the sigcontext, no sigrestorer layout */
 	raw_sc.restorer = 0;
--- diff/arch/um/kernel/frame_kern.c	2003-02-13 11:46:50.000000000 +0000
+++ source/arch/um/kernel/frame_kern.c	2004-02-09 10:39:51.000000000 +0000
@@ -6,7 +6,6 @@
 #include "asm/ptrace.h"
 #include "asm/uaccess.h"
 #include "asm/signal.h"
-#include "asm/uaccess.h"
 #include "asm/ucontext.h"
 #include "frame_kern.h"
 #include "sigcontext.h"
@@ -29,12 +28,15 @@
 			    sizeof(restorer)));
 }
 
+extern int userspace_pid[];
+
 static int copy_sc_to_user(void *to, void *fp, struct pt_regs *from, 
 			   struct arch_frame_data *arch)
 {
 	return(CHOOSE_MODE(copy_sc_to_user_tt(to, fp, UPT_SC(&from->regs), 
 					      arch),
-			   copy_sc_to_user_skas(to, fp, &from->regs,
+			   copy_sc_to_user_skas(userspace_pid[0], to, fp, 
+						&from->regs,
 						current->thread.cr2,
 						current->thread.err)));
 }
--- diff/arch/um/kernel/helper.c	2003-01-02 10:43:04.000000000 +0000
+++ source/arch/um/kernel/helper.c	2004-02-09 10:39:51.000000000 +0000
@@ -7,7 +7,6 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <errno.h>
-#include <fcntl.h>
 #include <sched.h>
 #include <sys/signal.h>
 #include <sys/wait.h>
@@ -33,6 +32,7 @@
 {
 	struct helper_data *data = arg;
 	char **argv = data->argv;
+	int errval;
 
 	if(helper_pause){
 		signal(SIGHUP, helper_hup);
@@ -41,8 +41,9 @@
 	if(data->pre_exec != NULL)
 		(*data->pre_exec)(data->pre_data);
 	execvp(argv[0], argv);
+	errval = errno;
 	printk("execvp of '%s' failed - errno = %d\n", argv[0], errno);
-	write(data->fd, &errno, sizeof(errno));
+	os_write_file(data->fd, &errval, sizeof(errval));
 	os_kill_process(os_getpid(), 0);
 	return(0);
 }
@@ -59,17 +60,20 @@
 	if((stack_out != NULL) && (*stack_out != 0))
 		stack = *stack_out;
 	else stack = alloc_stack(0, um_in_interrupt());
-	if(stack == 0) return(-ENOMEM);
+	if(stack == 0) 
+		return(-ENOMEM);
 
 	err = os_pipe(fds, 1, 0);
-	if(err){
-		printk("run_helper : pipe failed, errno = %d\n", -err);
-		return(err);
+	if(err < 0){
+		printk("run_helper : pipe failed, err = %d\n", -err);
+		goto out_free;
 	}
-	if(fcntl(fds[1], F_SETFD, 1) != 0){
-		printk("run_helper : setting FD_CLOEXEC failed, errno = %d\n",
-		       errno);
-		return(-errno);
+
+	err = os_set_exec_close(fds[1], 1);
+	if(err < 0){
+		printk("run_helper : setting FD_CLOEXEC failed, err = %d\n",
+		       -err);
+		goto out_close;
 	}
 
 	sp = stack + page_size() - sizeof(void *);
@@ -80,23 +84,34 @@
 	pid = clone(helper_child, (void *) sp, CLONE_VM | SIGCHLD, &data);
 	if(pid < 0){
 		printk("run_helper : clone failed, errno = %d\n", errno);
-		return(-errno);
+		err = -errno;
+		goto out_close;
 	}
-	close(fds[1]);
-	n = read(fds[0], &err, sizeof(err));
+
+	os_close_file(fds[1]);
+	n = os_read_file(fds[0], &err, sizeof(err));
 	if(n < 0){
-		printk("run_helper : read on pipe failed, errno = %d\n", 
-		       errno);
-		return(-errno);
+		printk("run_helper : read on pipe failed, err = %d\n", -n);
+		err = n;
+		goto out_kill;
 	}
 	else if(n != 0){
 		waitpid(pid, NULL, 0);
-		pid = -err;
+		pid = -errno;
 	}
 
 	if(stack_out == NULL) free_stack(stack, 0);
         else *stack_out = stack;
 	return(pid);
+
+ out_kill:
+	os_kill_process(pid, 1);
+ out_close:
+	os_close_file(fds[0]);
+	os_close_file(fds[1]);
+ out_free:
+	free_stack(stack, 0);
+	return(err);
 }
 
 int run_helper_thread(int (*proc)(void *), void *arg, unsigned int flags, 
@@ -117,9 +132,11 @@
 	}
 	if(stack_out == NULL){
 		pid = waitpid(pid, &status, 0);
-		if(pid < 0)
+		if(pid < 0){
 			printk("run_helper_thread - wait failed, errno = %d\n",
-			       pid);
+			       errno);
+			pid = -errno;
+		}
 		if(!WIFEXITED(status) || (WEXITSTATUS(status) != 0))
 			printk("run_helper_thread - thread returned status "
 			       "0x%x\n", status);
--- diff/arch/um/kernel/init_task.c	2003-10-09 09:47:33.000000000 +0100
+++ source/arch/um/kernel/init_task.c	2004-02-09 10:39:51.000000000 +0000
@@ -8,7 +8,6 @@
 #include "linux/module.h"
 #include "linux/sched.h"
 #include "linux/init_task.h"
-#include "linux/version.h"
 #include "asm/uaccess.h"
 #include "asm/pgtable.h"
 #include "user_util.h"
@@ -18,7 +17,7 @@
 struct mm_struct init_mm = INIT_MM(init_mm);
 static struct files_struct init_files = INIT_FILES;
 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
-
+static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
 EXPORT_SYMBOL(init_mm);
 
 /*
@@ -43,26 +42,12 @@
 __attribute__((__section__(".data.init_task"))) = 
 { INIT_THREAD_INFO(init_task) };
 
-struct task_struct *alloc_task_struct(void)
-{
-	return((struct task_struct *) 
-	       __get_free_pages(GFP_KERNEL, CONFIG_KERNEL_STACK_ORDER));
-}
-
 void unprotect_stack(unsigned long stack)
 {
 	protect_memory(stack, (1 << CONFIG_KERNEL_STACK_ORDER) * PAGE_SIZE, 
 		       1, 1, 0, 1);
 }
 
-void free_task_struct(struct task_struct *task)
-{
-	/* free_pages decrements the page counter and only actually frees
-	 * the pages if they are now not accessed by anything.
-	 */
-	free_pages((unsigned long) task, CONFIG_KERNEL_STACK_ORDER);
-}
-
 /*
  * Overrides for Emacs so that we follow Linus's tabbing style.
  * Emacs will notice this stuff at the end of the file and automatically
--- diff/arch/um/kernel/initrd_user.c	2002-10-16 04:27:19.000000000 +0100
+++ source/arch/um/kernel/initrd_user.c	2004-02-09 10:39:51.000000000 +0000
@@ -6,7 +6,6 @@
 #include <unistd.h>
 #include <sys/types.h>
 #include <sys/stat.h>
-#include <fcntl.h>
 #include <errno.h>
 
 #include "user_util.h"
@@ -19,13 +18,15 @@
 {
 	int fd, n;
 
-	if((fd = os_open_file(filename, of_read(OPENFLAGS()), 0)) < 0){
-		printk("Opening '%s' failed - errno = %d\n", filename, errno);
+	fd = os_open_file(filename, of_read(OPENFLAGS()), 0);
+	if(fd < 0){
+		printk("Opening '%s' failed - err = %d\n", filename, -fd);
 		return(-1);
 	}
-	if((n = read(fd, buf, size)) != size){
-		printk("Read of %d bytes from '%s' returned %d, errno = %d\n",
-		       size, filename, n, errno);
+	n = os_read_file(fd, buf, size);
+	if(n != size){
+		printk("Read of %d bytes from '%s' failed, err = %d\n", size, 
+		       filename, -n);
 		return(-1);
 	}
 	return(0);
--- diff/arch/um/kernel/irq.c	2004-01-19 10:22:55.000000000 +0000
+++ source/arch/um/kernel/irq.c	2004-02-09 10:39:51.000000000 +0000
@@ -29,6 +29,7 @@
 #include "user_util.h"
 #include "kern_util.h"
 #include "irq_user.h"
+#include "irq_kern.h"
 
 static void register_irq_proc (unsigned int irq);
 
@@ -83,65 +84,55 @@
 	end_none
 };
 
-/* Not changed */
-volatile unsigned long irq_err_count;
-
 /*
  * Generic, controller-independent functions:
  */
 
-int get_irq_list(char *buf)
+int show_interrupts(struct seq_file *p, void *v)
 {
-	int i, j;
-	unsigned long flags;
+	int i = *(loff_t *) v, j;
 	struct irqaction * action;
-	char *p = buf;
+	unsigned long flags;
 
-	p += sprintf(p, "           ");
-	for (j=0; j<num_online_cpus(); j++)
-		p += sprintf(p, "CPU%d       ",j);
-	*p++ = '\n';
+	if (i == 0) {
+		seq_printf(p, "           ");
+		for (j=0; j<NR_CPUS; j++)
+			if (cpu_online(j))
+				seq_printf(p, "CPU%d       ",j);
+		seq_putc(p, '\n');
+	}
 
-	for (i = 0 ; i < NR_IRQS ; i++) {
+	if (i < NR_IRQS) {
 		spin_lock_irqsave(&irq_desc[i].lock, flags);
 		action = irq_desc[i].action;
 		if (!action) 
-			goto end;
-		p += sprintf(p, "%3d: ",i);
+			goto skip;
+		seq_printf(p, "%3d: ",i);
 #ifndef CONFIG_SMP
-		p += sprintf(p, "%10u ", kstat_irqs(i));
+		seq_printf(p, "%10u ", kstat_irqs(i));
 #else
-		for (j = 0; j < num_online_cpus(); j++)
-			p += sprintf(p, "%10u ",
-				kstat_cpu(cpu_logical_map(j)).irqs[i]);
+		for (j = 0; j < NR_CPUS; j++)
+			if (cpu_online(j))
+				seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]);
 #endif
-		p += sprintf(p, " %14s", irq_desc[i].handler->typename);
-		p += sprintf(p, "  %s", action->name);
+		seq_printf(p, " %14s", irq_desc[i].handler->typename);
+		seq_printf(p, "  %s", action->name);
 
 		for (action=action->next; action; action = action->next)
-			p += sprintf(p, ", %s", action->name);
-		*p++ = '\n';
-	end:
+			seq_printf(p, ", %s", action->name);
+
+		seq_putc(p, '\n');
+skip:
 		spin_unlock_irqrestore(&irq_desc[i].lock, flags);
+	} else if (i == NR_IRQS) {
+		seq_printf(p, "NMI: ");
+		for (j = 0; j < NR_CPUS; j++)
+			if (cpu_online(j))
+				seq_printf(p, "%10u ", nmi_count(j));
+		seq_putc(p, '\n');
 	}
-	p += sprintf(p, "\n");
-#ifdef notdef
-#ifdef CONFIG_SMP
-	p += sprintf(p, "LOC: ");
-	for (j = 0; j < num_online_cpus(); j++)
-		p += sprintf(p, "%10u ",
-			apic_timer_irqs[cpu_logical_map(j)]);
-	p += sprintf(p, "\n");
-#endif
-#endif
-	p += sprintf(p, "ERR: %10lu\n", irq_err_count);
-	return p - buf;
-}
 
-
-int show_interrupts(struct seq_file *p, void *v)
-{
-	return(0);
+	return 0;
 }
 
 /*
@@ -230,8 +221,11 @@
  
 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);
 }
 
 /**
@@ -252,7 +246,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;
 		desc->status = status;
 		if ((status & (IRQ_PENDING | IRQ_REPLAY)) == IRQ_PENDING) {
 			desc->status = status | IRQ_REPLAY;
@@ -282,13 +276,12 @@
 	 * 0 return value means that this irq is already being
 	 * handled by some other CPU. (or is disabled)
 	 */
-	int cpu = smp_processor_id();
 	irq_desc_t *desc = irq_desc + irq;
 	struct irqaction * action;
 	unsigned int status;
 
 	irq_enter();
-	kstat_cpu(cpu).irqs[irq]++;
+	kstat_this_cpu.irqs[irq]++;
 	spin_lock(&desc->lock);
 	desc->handler->ack(irq);
 	/*
@@ -385,7 +378,7 @@
  */
  
 int request_irq(unsigned int irq,
-		void (*handler)(int, void *, struct pt_regs *),
+		irqreturn_t (*handler)(int, void *, struct pt_regs *),
 		unsigned long irqflags, 
 		const char * devname,
 		void *dev_id)
@@ -433,15 +426,19 @@
 EXPORT_SYMBOL(request_irq);
 
 int um_request_irq(unsigned int irq, int fd, int type,
-		   void (*handler)(int, void *, struct pt_regs *),
+		   irqreturn_t (*handler)(int, void *, struct pt_regs *),
 		   unsigned long irqflags, const char * devname,
 		   void *dev_id)
 {
-	int retval;
+	int err;
 
-	retval = request_irq(irq, handler, irqflags, devname, dev_id);
-	if(retval) return(retval);
-	return(activate_fd(irq, fd, type, dev_id));
+	err = request_irq(irq, handler, irqflags, devname, dev_id);
+	if(err) 
+		return(err);
+
+	if(fd != -1)
+		err = activate_fd(irq, fd, type, dev_id);
+	return(err);
 }
 
 /* this was setup_x86_irq but it seems pretty generic */
@@ -474,7 +471,8 @@
 	 */
 	spin_lock_irqsave(&desc->lock,flags);
 	p = &desc->action;
-	if ((old = *p) != NULL) {
+	old = *p;
+	if (old != NULL) {
 		/* Can't share interrupts unless both agree to */
 		if (!(old->flags & new->flags & SA_SHIRQ)) {
 			spin_unlock_irqrestore(&desc->lock,flags);
@@ -586,12 +584,14 @@
 					unsigned long count, void *data)
 {
 	int irq = (long) data, full_count = count, err;
-	cpumask_t new_value, tmp;
+	cpumask_t new_value;
 
 	if (!irq_desc[irq].handler->set_affinity)
 		return -EIO;
 
 	err = cpumask_parse(buffer, count, new_value);
+	if(err)
+		return(err);
 
 #ifdef CONFIG_SMP
 	/*
@@ -614,6 +614,7 @@
 			int count, int *eof, void *data)
 {
 	int len = cpumask_snprintf(page, count, *(cpumask_t *)data);
+
 	if (count - len < 2)
 		return -EINVAL;
 	len += sprintf(page + len, "\n");
--- diff/arch/um/kernel/irq_user.c	2003-02-13 11:46:50.000000000 +0000
+++ source/arch/um/kernel/irq_user.c	2004-02-09 10:39:51.000000000 +0000
@@ -6,7 +6,6 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <errno.h>
-#include <fcntl.h>
 #include <signal.h>
 #include <string.h>
 #include <sys/poll.h>
@@ -49,7 +48,8 @@
 
 	if(smp_sigio_handler()) return;
 	while(1){
-		if((n = poll(pollfds, pollfds_num, 0)) < 0){
+		n = poll(pollfds, pollfds_num, 0);
+		if(n < 0){
 			if(errno == EINTR) continue;
 			printk("sigio_handler : poll returned %d, "
 			       "errno = %d\n", n, errno);
@@ -366,34 +366,31 @@
 
 void forward_ipi(int fd, int pid)
 {
-	if(fcntl(fd, F_SETOWN, pid) < 0){
-		int save_errno = errno;
-		if(fcntl(fd, F_GETOWN, 0) != pid){
-			printk("forward_ipi: F_SETOWN failed, fd = %d, "
-			       "me = %d, target = %d, errno = %d\n", fd, 
-			       os_getpid(), pid, save_errno);
-		}
-	}
+	int err;
+
+	err = os_set_owner(fd, pid);
+	if(err < 0)
+		printk("forward_ipi: set_owner failed, fd = %d, me = %d, "
+		       "target = %d, err = %d\n", fd, os_getpid(), pid, -err);
 }
 
 void forward_interrupts(int pid)
 {
 	struct irq_fd *irq;
 	unsigned long flags;
+	int err;
 
 	flags = irq_lock();
 	for(irq=active_fds;irq != NULL;irq = irq->next){
-		if(fcntl(irq->fd, F_SETOWN, pid) < 0){
-			int save_errno = errno;
-			if(fcntl(irq->fd, F_GETOWN, 0) != pid){
-				/* XXX Just remove the irq rather than
-				 * print out an infinite stream of these
-				 */
-				printk("Failed to forward %d to pid %d, "
-				       "errno = %d\n", irq->fd, pid, 
-				       save_errno);
-			}
+		err = os_set_owner(irq->fd, pid);
+		if(err < 0){
+			/* XXX Just remove the irq rather than
+			 * print out an infinite stream of these
+			 */
+			printk("Failed to forward %d to pid %d, err = %d\n",
+			       irq->fd, pid, -err);
 		}
+
 		irq->pid = pid;
 	}
 	irq_unlock(flags);
--- diff/arch/um/kernel/ksyms.c	2003-02-13 11:46:50.000000000 +0000
+++ source/arch/um/kernel/ksyms.c	2004-02-09 10:39:51.000000000 +0000
@@ -1,5 +1,5 @@
 /* 
- * Copyright (C) 2001, 2002 Jeff Dike (jdike@karaya.com)
+ * Copyright (C) 2001 - 2003 Jeff Dike (jdike@addtoit.com)
  * Licensed under the GPL
  */
 
@@ -34,34 +34,62 @@
 EXPORT_SYMBOL(flush_tlb_range);
 EXPORT_SYMBOL(host_task_size);
 EXPORT_SYMBOL(arch_validate);
+EXPORT_SYMBOL(get_kmem_end);
 
-EXPORT_SYMBOL(region_pa);
-EXPORT_SYMBOL(region_va);
-EXPORT_SYMBOL(phys_mem_map);
-EXPORT_SYMBOL(page_mem_map);
 EXPORT_SYMBOL(page_to_phys);
 EXPORT_SYMBOL(phys_to_page);
 EXPORT_SYMBOL(high_physmem);
 EXPORT_SYMBOL(empty_zero_page);
 EXPORT_SYMBOL(um_virt_to_phys);
+EXPORT_SYMBOL(__virt_to_page);
+EXPORT_SYMBOL(to_phys);
+EXPORT_SYMBOL(to_virt);
 EXPORT_SYMBOL(mode_tt);
 EXPORT_SYMBOL(handle_page_fault);
 
+#ifdef CONFIG_MODE_TT
+EXPORT_SYMBOL(copy_from_user_tt);
+EXPORT_SYMBOL(copy_to_user_tt);
+#endif
+
+#ifdef CONFIG_MODE_SKAS
+EXPORT_SYMBOL(copy_to_user_skas);
+EXPORT_SYMBOL(copy_from_user_skas);
+#endif
+
+EXPORT_SYMBOL(os_stat_fd);
+EXPORT_SYMBOL(os_stat_file);
+EXPORT_SYMBOL(os_access);
+EXPORT_SYMBOL(os_print_error);
+EXPORT_SYMBOL(os_get_exec_close);
+EXPORT_SYMBOL(os_set_exec_close);
 EXPORT_SYMBOL(os_getpid);
 EXPORT_SYMBOL(os_open_file);
 EXPORT_SYMBOL(os_read_file);
 EXPORT_SYMBOL(os_write_file);
 EXPORT_SYMBOL(os_seek_file);
+EXPORT_SYMBOL(os_lock_file);
 EXPORT_SYMBOL(os_pipe);
 EXPORT_SYMBOL(os_file_type);
+EXPORT_SYMBOL(os_file_mode);
+EXPORT_SYMBOL(os_file_size);
+EXPORT_SYMBOL(os_flush_stdout);
 EXPORT_SYMBOL(os_close_file);
+EXPORT_SYMBOL(os_set_fd_async);
+EXPORT_SYMBOL(os_set_fd_block);
 EXPORT_SYMBOL(helper_wait);
 EXPORT_SYMBOL(os_shutdown_socket);
+EXPORT_SYMBOL(os_create_unix_socket);
 EXPORT_SYMBOL(os_connect_socket);
+EXPORT_SYMBOL(os_accept_connection);
+EXPORT_SYMBOL(os_rcv_fd);
 EXPORT_SYMBOL(run_helper);
 EXPORT_SYMBOL(start_thread);
 EXPORT_SYMBOL(dump_thread);
 
+EXPORT_SYMBOL(do_gettimeofday);
+EXPORT_SYMBOL(do_settimeofday);
+
 /* This is here because UML expands open to sys_open, not to a system
  * call instruction.
  */
@@ -90,3 +118,13 @@
 EXPORT_SYMBOL(kmap_atomic_to_page);
 #endif
 
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * Emacs will notice this stuff at the end of the file and automatically
+ * adjust the settings for this buffer only.  This must remain at the end
+ * of the file.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-file-style: "linux"
+ * End:
+ */
--- diff/arch/um/kernel/mem.c	2003-10-09 09:47:33.000000000 +0100
+++ source/arch/um/kernel/mem.c	2004-02-09 10:39:51.000000000 +0000
@@ -1,74 +1,67 @@
 /* 
- * Copyright (C) 2000, 2001, 2002 Jeff Dike (jdike@karaya.com)
+ * Copyright (C) 2000 - 2003 Jeff Dike (jdike@addtoit.com)
  * Licensed under the GPL
  */
 
-#include "linux/config.h"
-#include "linux/module.h"
-#include "linux/types.h"
+#include "linux/stddef.h"
+#include "linux/kernel.h"
 #include "linux/mm.h"
-#include "linux/fs.h"
-#include "linux/init.h"
 #include "linux/bootmem.h"
 #include "linux/swap.h"
-#include "linux/slab.h"
-#include "linux/vmalloc.h"
 #include "linux/highmem.h"
+#include "linux/gfp.h"
 #include "asm/page.h"
-#include "asm/pgtable.h"
+#include "asm/fixmap.h"
 #include "asm/pgalloc.h"
-#include "asm/bitops.h"
-#include "asm/uaccess.h"
-#include "asm/tlb.h"
 #include "user_util.h"
 #include "kern_util.h"
-#include "mem_user.h"
-#include "mem.h"
 #include "kern.h"
-#include "init.h"
-#include "os.h"
-#include "mode_kern.h"
+#include "mem_user.h"
 #include "uml_uaccess.h"
+#include "os.h"
+
+extern char __binary_start;
 
 /* Changed during early boot */
-pgd_t swapper_pg_dir[1024];
-unsigned long high_physmem;
-unsigned long vm_start;
-unsigned long vm_end;
-unsigned long highmem;
 unsigned long *empty_zero_page = NULL;
 unsigned long *empty_bad_page = NULL;
-
-/* Not modified */
-const char bad_pmd_string[] = "Bad pmd in pte_alloc: %08lx\n";
-
-extern char __init_begin, __init_end;
-extern long physmem_size;
-
-/* Not changed by UML */
-DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
-
-/* Changed during early boot */
+pgd_t swapper_pg_dir[1024];
+unsigned long highmem;
 int kmalloc_ok = 0;
 
-#define NREGIONS (phys_region_index(0xffffffff) - phys_region_index(0x0) + 1)
-struct mem_region *regions[NREGIONS] = { [ 0 ... NREGIONS - 1 ] = NULL };
-#define REGION_SIZE ((0xffffffff & ~REGION_MASK) + 1)
-
-/* Changed during early boot */
 static unsigned long brk_end;
+static unsigned long totalram_pages = 0;
+
+void unmap_physmem(void)
+{
+	os_unmap_memory((void *) brk_end, uml_reserved - brk_end);
+}
 
 static void map_cb(void *unused)
 {
 	map_memory(brk_end, __pa(brk_end), uml_reserved - brk_end, 1, 1, 0);
 }
 
-void unmap_physmem(void)
+#ifdef CONFIG_HIGHMEM
+static void setup_highmem(unsigned long highmem_start, 
+			  unsigned long highmem_len)
 {
-	os_unmap_memory((void *) brk_end, uml_reserved - brk_end);
-}
+	struct page *page;
+	unsigned long highmem_pfn;
+	int i;
 
-extern char __binary_start;
+	highmem_start_page = virt_to_page(highmem_start);
+
+	highmem_pfn = __pa(highmem_start) >> PAGE_SHIFT;
+	for(i = 0; i < highmem_len >> PAGE_SHIFT; i++){
+		page = &mem_map[highmem_pfn + i];
+		ClearPageReserved(page);
+		set_bit(PG_highmem, &page->flags);
+		atomic_set(&page->count, 1);
+		__free_page(page);
+	}
+}
+#endif
 
 void mem_init(void)
 {
@@ -103,50 +96,15 @@
 	totalhigh_pages = highmem >> PAGE_SHIFT;
 	totalram_pages += totalhigh_pages;
 	num_physpages = totalram_pages;
-	max_mapnr = totalram_pages;
 	max_pfn = totalram_pages;
 	printk(KERN_INFO "Memory: %luk available\n", 
 	       (unsigned long) nr_free_pages() << (PAGE_SHIFT-10));
 	kmalloc_ok = 1;
-}
-
-/* Changed during early boot */
-static unsigned long kmem_top = 0;
-
-unsigned long get_kmem_end(void)
-{
-	if(kmem_top == 0)
-		kmem_top = CHOOSE_MODE(kmem_end_tt, kmem_end_skas);
-	return(kmem_top);
-}
-
-void set_kmem_end(unsigned long new)
-{
-	kmem_top = new;
-}
 
 #ifdef CONFIG_HIGHMEM
-/* Changed during early boot */
-pte_t *kmap_pte;
-pgprot_t kmap_prot;
-
-EXPORT_SYMBOL(kmap_prot);
-EXPORT_SYMBOL(kmap_pte);
-
-#define kmap_get_fixmap_pte(vaddr)					\
-	pte_offset_kernel(pmd_offset(pgd_offset_k(vaddr), (vaddr)), (vaddr))
-
-void __init kmap_init(void)
-{
-	unsigned long kmap_vstart;
-
-	/* cache the first kmap pte */
-	kmap_vstart = __fix_to_virt(FIX_KMAP_BEGIN);
-	kmap_pte = kmap_get_fixmap_pte(kmap_vstart);
-
-	kmap_prot = PAGE_KERNEL;
+	setup_highmem(end_iomem, highmem);
+#endif
 }
-#endif /* CONFIG_HIGHMEM */
 
 static void __init fixrange_init(unsigned long start, unsigned long end, 
 				 pgd_t *pgd_base)
@@ -178,76 +136,24 @@
 	}
 }
 
-int init_maps(struct mem_region *region)
-{
-	struct page *p, *map;
-	int i, n, len;
-
-	if(region == &physmem_region){
-		region->mem_map = mem_map;
-		return(0);
-	}
-	else if(region->mem_map != NULL) return(0);
-
-	n = region->len >> PAGE_SHIFT;
-	len = n * sizeof(struct page);
-	if(kmalloc_ok){
-		map = kmalloc(len, GFP_KERNEL);
-		if(map == NULL) map = vmalloc(len);
-	}
-	else map = alloc_bootmem_low_pages(len);
-
-	if(map == NULL)
-		return(-ENOMEM);
-	for(i = 0; i < n; i++){
-		p = &map[i];
-		set_page_count(p, 0);
-		SetPageReserved(p);
-		INIT_LIST_HEAD(&p->list);
-	}
-	region->mem_map = map;
-	return(0);
-}
+#if CONFIG_HIGHMEM
+pte_t *kmap_pte;
+pgprot_t kmap_prot;
 
-DECLARE_MUTEX(regions_sem);
+#define kmap_get_fixmap_pte(vaddr)					\
+	pte_offset(pmd_offset(pgd_offset_k(vaddr), (vaddr)), (vaddr))
 
-static int setup_one_range(int fd, char *driver, unsigned long start, 
-			   unsigned long pfn, int len, 
-			   struct mem_region *region)
+void __init kmap_init(void)
 {
-	int i;
-
-	down(&regions_sem);
-	for(i = 0; i < NREGIONS; i++){
-		if(regions[i] == NULL) break;		
-	}
-	if(i == NREGIONS){
-		printk("setup_range : no free regions\n");
-		i = -1;
-		goto out;
-	}
-
-	if(fd == -1)
-		fd = create_mem_file(len);
+	unsigned long kmap_vstart;
 
-	if(region == NULL){
-		region = alloc_bootmem_low_pages(sizeof(*region));
-		if(region == NULL)
-			panic("Failed to allocating mem_region");
-	}
+	/* cache the first kmap pte */
+	kmap_vstart = __fix_to_virt(FIX_KMAP_BEGIN);
+	kmap_pte = kmap_get_fixmap_pte(kmap_vstart);
 
-	*region = ((struct mem_region) { .driver 	= driver,
-					 .start_pfn 	= pfn,
-					 .start 	= start, 
-					 .len 		= len, 
-					 .fd 		= fd } );
-	regions[i] = region;
- out:
-	up(&regions_sem);
-	return(i);
+	kmap_prot = PAGE_KERNEL;
 }
 
-#ifdef CONFIG_HIGHMEM
 static void init_highmem(void)
 {
 	pgd_t *pgd;
@@ -268,63 +174,20 @@
 
 	kmap_init();
 }
-
-void setup_highmem(unsigned long len)
-{
-	struct mem_region *region;
-	struct page *page, *map;
-	unsigned long phys;
-	int i, cur, index;
-
-	phys = physmem_size;
-	do {
-		cur = min(len, (unsigned long) REGION_SIZE);
-		i = setup_one_range(-1, NULL, -1, phys >> PAGE_SHIFT, cur, 
-				    NULL);
-		if(i == -1){
-			printk("setup_highmem - setup_one_range failed\n");
-			return;
-		}
-		region = regions[i];
-		index = phys / PAGE_SIZE;
-		region->mem_map = &mem_map[index];
-
-		map = region->mem_map;
-		for(i = 0; i < (cur >> PAGE_SHIFT); i++){
-			page = &map[i];
-			ClearPageReserved(page);
-			set_bit(PG_highmem, &page->flags);
-			atomic_set(&page->count, 1);
-			__free_page(page);
-		}
-		phys += cur;
-		len -= cur;
-	} while(len > 0);
-}
-#endif
+#endif /* CONFIG_HIGHMEM */
 
 void paging_init(void)
 {
-	struct mem_region *region;
-	unsigned long zones_size[MAX_NR_ZONES], start, end, vaddr;
-	int i, index;
+	unsigned long zones_size[MAX_NR_ZONES], vaddr;
+	int i;
 
 	empty_zero_page = (unsigned long *) alloc_bootmem_low_pages(PAGE_SIZE);
 	empty_bad_page = (unsigned long *) alloc_bootmem_low_pages(PAGE_SIZE);
 	for(i=0;i<sizeof(zones_size)/sizeof(zones_size[0]);i++) 
 		zones_size[i] = 0;
-	zones_size[0] = (high_physmem >> PAGE_SHIFT) - 
-		(uml_physmem >> PAGE_SHIFT);
+	zones_size[0] = (end_iomem >> PAGE_SHIFT) - (uml_physmem >> PAGE_SHIFT);
 	zones_size[2] = highmem >> PAGE_SHIFT;
 	free_area_init(zones_size);
-	start = phys_region_index(__pa(uml_physmem));
-	end = phys_region_index(__pa(high_physmem - 1));
-	for(i = start; i <= end; i++){
-		region = regions[i];
-		index = (region->start - uml_physmem) / PAGE_SIZE;
-		region->mem_map = &mem_map[index];
-		if(i > start) free_bootmem(__pa(region->start), region->len);
-	}
 
 	/*
 	 * Fixed mappings, only the page table structure has to be
@@ -335,15 +198,33 @@
 
 #ifdef CONFIG_HIGHMEM
 	init_highmem();
-	setup_highmem(highmem);
 #endif
 }
 
-pte_t __bad_page(void)
+struct page *arch_validate(struct page *page, int mask, int order)
 {
-	clear_page(empty_bad_page);
-        return pte_mkdirty(mk_pte((struct page *) empty_bad_page, 
-				  PAGE_SHARED));
+	unsigned long addr, zero = 0;
+	int i;
+
+ again:
+	if(page == NULL) return(page);
+	if(PageHighMem(page)) return(page);
+
+	addr = (unsigned long) page_address(page);
+	for(i = 0; i < (1 << order); i++){
+		current->thread.fault_addr = (void *) addr;
+		if(__do_copy_to_user((void *) addr, &zero, 
+				     sizeof(zero),
+				     &current->thread.fault_addr,
+				     &current->thread.fault_catcher)){
+			if(!(mask & __GFP_WAIT)) return(NULL);
+			else break;
+		}
+		addr += PAGE_SIZE;
+	}
+	if(i == (1 << order)) return(page);
+	page = alloc_pages(mask, order);
+	goto again;
 }
 
 /* This can't do anything because nothing in the kernel image can be freed
@@ -401,395 +282,6 @@
         printk("%d pages swap cached\n", cached);
 }
 
-static int __init uml_mem_setup(char *line, int *add)
-{
-	char *retptr;
-	physmem_size = memparse(line,&retptr);
-	return 0;
-}
-__uml_setup("mem=", uml_mem_setup,
-"mem=<Amount of desired ram>\n"
-"    This controls how much \"physical\" memory the kernel allocates\n"
-"    for the system. The size is specified as a number followed by\n"
-"    one of 'k', 'K', 'm', 'M', which have the obvious meanings.\n"
-"    This is not related to the amount of memory in the physical\n"
-"    machine. It can be more, and the excess, if it's ever used, will\n"
-"    just be swapped out.\n        Example: mem=64M\n\n"
-);
-
-struct page *arch_validate(struct page *page, int mask, int order)
-{
-	unsigned long addr, zero = 0;
-	int i;
-
- again:
-	if(page == NULL) return(page);
-	if(PageHighMem(page)) return(page);
-
-	addr = (unsigned long) page_address(page);
-	for(i = 0; i < (1 << order); i++){
-		current->thread.fault_addr = (void *) addr;
-		if(__do_copy_to_user((void *) addr, &zero, 
-				     sizeof(zero),
-				     &current->thread.fault_addr,
-				     &current->thread.fault_catcher)){
-			if(!(mask & __GFP_WAIT)) return(NULL);
-			else break;
-		}
-		addr += PAGE_SIZE;
-	}
-	if(i == (1 << order)) return(page);
-	page = alloc_pages(mask, order);
-	goto again;
-}
-
-DECLARE_MUTEX(vm_reserved_sem);
-static struct list_head vm_reserved = LIST_HEAD_INIT(vm_reserved);
-
-/* Static structures, linked in to the list in early boot */
-static struct vm_reserved head = {
-	.list 		= LIST_HEAD_INIT(head.list),
-	.start 		= 0,
-	.end 		= 0xffffffff
-};
-
-static struct vm_reserved tail = {
-	.list 		= LIST_HEAD_INIT(tail.list),
-	.start 		= 0,
-	.end 		= 0xffffffff
-};
-
-void set_usable_vm(unsigned long start, unsigned long end)
-{
-	list_add(&head.list, &vm_reserved);
-	list_add(&tail.list, &head.list);
-	head.end = start;
-	tail.start = end;
-}
-
-int reserve_vm(unsigned long start, unsigned long end, void *e)
-	       
-{
-	struct vm_reserved *entry = e, *reserved, *prev;
-	struct list_head *ele;
-	int err;
-
-	down(&vm_reserved_sem);
-	list_for_each(ele, &vm_reserved){
-		reserved = list_entry(ele, struct vm_reserved, list);
-		if(reserved->start >= end) goto found;
-	}
-	panic("Reserved vm out of range");
- found:
-	prev = list_entry(ele->prev, struct vm_reserved, list);
-	if(prev->end > start)
-		panic("Can't reserve vm");
-	if(entry == NULL)
-		entry = kmalloc(sizeof(*entry), GFP_KERNEL);
-	if(entry == NULL){
-		printk("reserve_vm : Failed to allocate entry\n");
-		err = -ENOMEM;
-		goto out;
-	}
-	*entry = ((struct vm_reserved) 
-		{ .list 	= LIST_HEAD_INIT(entry->list),
-		  .start 	= start,
-		  .end 		= end });
-	list_add(&entry->list, &prev->list);
-	err = 0;
- out:
-	up(&vm_reserved_sem);
-	return(0);
-}
-
-unsigned long get_vm(unsigned long len)
-{
-	struct vm_reserved *this, *next;
-	struct list_head *ele;
-	unsigned long start;
-	int err;
-	
-	down(&vm_reserved_sem);
-	list_for_each(ele, &vm_reserved){
-		this = list_entry(ele, struct vm_reserved, list);
-		next = list_entry(ele->next, struct vm_reserved, list);
-		if((this->start < next->start) && 
-		   (this->end + len + PAGE_SIZE <= next->start))
-			goto found;
-	}
-	up(&vm_reserved_sem);
-	return(0);
- found:
-	up(&vm_reserved_sem);
-	start = (unsigned long) UML_ROUND_UP(this->end) + PAGE_SIZE;
-	err = reserve_vm(start, start + len, NULL);
-	if(err) return(0);
-	return(start);
-}
-
-int nregions(void)
-{
-	return(NREGIONS);
-}
-
-void setup_range(int fd, char *driver, unsigned long start, unsigned long pfn,
-		 unsigned long len, int need_vm, struct mem_region *region, 
-		 void *reserved)
-{
-	int i, cur;
-
-	do {
-		cur = min(len, (unsigned long) REGION_SIZE);
-		i = setup_one_range(fd, driver, start, pfn, cur, region);
-		region = regions[i];
-		if(need_vm && setup_region(region, reserved)){
-			kfree(region);
-			regions[i] = NULL;
-			return;
-		}
-		start += cur;
-		if(pfn != -1) pfn += cur;
-		len -= cur;
-	} while(len > 0);
-}
-
-struct iomem {
-	char *name;
-	int fd;
-	unsigned long size;
-};
-
-/* iomem regions can only be added on the command line at the moment.  
- * Locking will be needed when they can be added via mconsole.
- */
-
-struct iomem iomem_regions[NREGIONS] = { [ 0 ... NREGIONS - 1 ] =
-					 { .name  	= NULL,
-					   .fd  	= -1,
-					   .size 	= 0 } };
-
-int num_iomem_regions = 0;
-
-void add_iomem(char *name, int fd, unsigned long size)
-{
-	if(num_iomem_regions == sizeof(iomem_regions)/sizeof(iomem_regions[0]))
-		return;
-	size = (size + PAGE_SIZE - 1) & PAGE_MASK;
-	iomem_regions[num_iomem_regions++] = 
-		((struct iomem) { .name 	= name,
-				  .fd 		= fd,
-				  .size 	= size } );
-}
-
-int setup_iomem(void)
-{
-	struct iomem *iomem;
-	int i;
-
-	for(i = 0; i < num_iomem_regions; i++){
-		iomem = &iomem_regions[i];
-		setup_range(iomem->fd, iomem->name, -1, -1, iomem->size, 1, 
-			    NULL, NULL);
-	}
-	return(0);
-}
-
-__initcall(setup_iomem);
-
-#define PFN_UP(x)	(((x) + PAGE_SIZE-1) >> PAGE_SHIFT)
-#define PFN_DOWN(x)	((x) >> PAGE_SHIFT)
-
-/* Changed during early boot */
-static struct mem_region physmem_region;
-static struct vm_reserved physmem_reserved;
-
-void setup_physmem(unsigned long start, unsigned long reserve_end,
-		   unsigned long len)
-{
-	struct mem_region *region = &physmem_region;
-	struct vm_reserved *reserved = &physmem_reserved;
-	unsigned long cur, pfn = 0;
-	int do_free = 1, bootmap_size;
-
-	do {
-		cur = min(len, (unsigned long) REGION_SIZE);
-		if(region == NULL) 
-			region = alloc_bootmem_low_pages(sizeof(*region));
-		if(reserved == NULL) 
-			reserved = alloc_bootmem_low_pages(sizeof(*reserved));
-		if((region == NULL) || (reserved == NULL))
-			panic("Couldn't allocate physmem region or vm "
-			      "reservation\n");
-		setup_range(-1, NULL, start, pfn, cur, 1, region, reserved);
-
-		if(do_free){
-			unsigned long reserve = reserve_end - start;
-			int pfn = PFN_UP(__pa(reserve_end));
-			int delta = (len - reserve) >> PAGE_SHIFT;
-
-			bootmap_size = init_bootmem(pfn, pfn + delta);
-			free_bootmem(__pa(reserve_end) + bootmap_size,
-				     cur - bootmap_size - reserve);
-			do_free = 0;
-		}
-		start += cur;
-		pfn += cur >> PAGE_SHIFT;
-		len -= cur;
-		region = NULL;
-		reserved = NULL;
-	} while(len > 0);
-}
-
-struct mem_region *phys_region(unsigned long phys)
-{
-	unsigned int n = phys_region_index(phys);
-
-	if(regions[n] == NULL) 
-		panic("Physical address in uninitialized region");
-	return(regions[n]);
-}
-
-unsigned long phys_offset(unsigned long phys)
-{
-	return(phys_addr(phys));
-}
-
-struct page *phys_mem_map(unsigned long phys)
-{
-	return((struct page *) phys_region(phys)->mem_map);
-}
-
-struct page *pte_mem_map(pte_t pte)
-{
-	return(phys_mem_map(pte_val(pte)));
-}
-
-struct mem_region *page_region(struct page *page, int *index_out)
-{
-	int i;
-	struct mem_region *region;
-	struct page *map;
-
-	for(i = 0; i < NREGIONS; i++){
-		region = regions[i];
-		if(region == NULL) continue;
-		map = region->mem_map;
-		if((page >= map) && (page < &map[region->len >> PAGE_SHIFT])){
-			if(index_out != NULL) *index_out = i;
-			return(region);
-		}
-	}
-	panic("No region found for page");
-	return(NULL);
-}
-
-unsigned long page_to_pfn(struct page *page)
-{
-	struct mem_region *region = page_region(page, NULL);
-
-	return(region->start_pfn + (page - (struct page *) region->mem_map));
-}
-
-struct mem_region *pfn_to_region(unsigned long pfn, int *index_out)
-{
-	struct mem_region *region;
-	int i;
-
-	for(i = 0; i < NREGIONS; i++){
-		region = regions[i];
-		if(region == NULL)
-			continue;
-
-		if((region->start_pfn <= pfn) &&
-		   (region->start_pfn + (region->len >> PAGE_SHIFT) > pfn)){
-			if(index_out != NULL) 
-				*index_out = i;
-			return(region);
-		}
-	}
-	return(NULL);
-}
-
-struct page *pfn_to_page(unsigned long pfn)
-{
-	struct mem_region *region = pfn_to_region(pfn, NULL);
-	struct page *mem_map = (struct page *) region->mem_map;
-
-	return(&mem_map[pfn - region->start_pfn]);
-}
-
-unsigned long phys_to_pfn(unsigned long p)
-{
-	struct mem_region *region = regions[phys_region_index(p)];
-
-	return(region->start_pfn + (phys_addr(p) >> PAGE_SHIFT));
-}
-
-unsigned long pfn_to_phys(unsigned long pfn)
-{
-	int n;
-	struct mem_region *region = pfn_to_region(pfn, &n);
-
-	return(mk_phys((pfn - region->start_pfn) << PAGE_SHIFT, n));
-}
-
-struct page *page_mem_map(struct page *page)
-{
-	return((struct page *) page_region(page, NULL)->mem_map);
-}
-
-extern unsigned long region_pa(void *virt)
-{
-	struct mem_region *region;
-	unsigned long addr = (unsigned long) virt;
-	int i;
-
-	for(i = 0; i < NREGIONS; i++){
-		region = regions[i];
-		if(region == NULL) continue;
-		if((region->start <= addr) && 
-		   (addr <= region->start + region->len))
-			return(mk_phys(addr - region->start, i));
-	}
-	panic("region_pa : no region for virtual address");
-	return(0);
-}
-
-extern void *region_va(unsigned long phys)
-{
-	return((void *) (phys_region(phys)->start + phys_addr(phys)));
-}
-
-unsigned long page_to_phys(struct page *page)
-{
-	int n;
-	struct mem_region *region = page_region(page, &n);
-	struct page *map = region->mem_map;
-	return(mk_phys((page - map) << PAGE_SHIFT, n));
-}
-
-struct page *phys_to_page(unsigned long phys)
-{
-	struct page *mem_map;
-
-	mem_map = phys_mem_map(phys);
-	return(mem_map + (phys_offset(phys) >> PAGE_SHIFT));
-}
-
-static int setup_mem_maps(void)
-{
-	struct mem_region *region;
-	int i;
-
-	for(i = 0; i < NREGIONS; i++){
-		region = regions[i];
-		if((region != NULL) && (region->fd > 0)) init_maps(region);
-	}
-	return(0);
-}
-
-__initcall(setup_mem_maps);
-
 /*
  * Allocate and free page tables.
  */
--- diff/arch/um/kernel/mem_user.c	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/um/kernel/mem_user.c	2004-02-09 10:39:51.000000000 +0000
@@ -34,10 +34,9 @@
 #include <stddef.h>
 #include <stdarg.h>
 #include <unistd.h>
-#include <fcntl.h>
 #include <errno.h>
 #include <string.h>
-#include <sys/stat.h>
+#include <fcntl.h>
 #include <sys/types.h>
 #include <sys/mman.h>
 #include "kern_util.h"
@@ -47,105 +46,145 @@
 #include "init.h"
 #include "os.h"
 #include "tempfile.h"
+#include "kern_constants.h"
 
 extern struct mem_region physmem_region;
 
 #define TEMPNAME_TEMPLATE "vm_file-XXXXXX"
 
-int create_mem_file(unsigned long len)
+static int create_tmp_file(unsigned long len)
 {
-	int fd;
+	int fd, err;
 	char zero;
 
 	fd = make_tempfile(TEMPNAME_TEMPLATE, NULL, 1);
-	if (fchmod(fd, 0777) < 0){
-		perror("fchmod");
+	if(fd < 0) {
+		os_print_error(fd, "make_tempfile");
+		exit(1);
+	}
+
+	err = os_mode_fd(fd, 0777);
+	if(err < 0){
+		os_print_error(err, "os_mode_fd");
 		exit(1);
 	}
-	if(os_seek_file(fd, len) < 0){
-		perror("lseek");
+	err = os_seek_file(fd, len);
+	if(err < 0){
+		os_print_error(err, "os_seek_file");
 		exit(1);
 	}
 	zero = 0;
-	if(write(fd, &zero, 1) != 1){
-		perror("write");
+	err = os_write_file(fd, &zero, 1);
+	if(err != 1){
+		os_print_error(err, "os_write_file");
 		exit(1);
 	}
-	if(fcntl(fd, F_SETFD, 1) != 0)
-		perror("Setting FD_CLOEXEC failed");
+
 	return(fd);
 }
 
-int setup_region(struct mem_region *region, void *entry)
+static int have_devanon = 0;
+
+void check_devanon(void)
+{
+	int fd;
+
+	printk("Checking for /dev/anon on the host...");
+	fd = open("/dev/anon", O_RDWR);
+	if(fd < 0){
+		printk("Not available (open failed with errno %d)\n", errno);
+		return;
+	}
+
+	printk("OK\n");
+	have_devanon = 1;
+}
+
+static int create_anon_file(unsigned long len)
 {
-	void *loc, *start;
-	char *driver;
-	int err, offset;
-
-	if(region->start != -1){
-		err = reserve_vm(region->start, 
-				 region->start + region->len, entry);
-		if(err){
-			printk("setup_region : failed to reserve "
-			       "0x%x - 0x%x for driver '%s'\n",
-			       region->start, 
-			       region->start + region->len,
-			       region->driver);
-			return(-1);
-		}
-	}
-	else region->start = get_vm(region->len);
-	if(region->start == 0){
-		if(region->driver == NULL) driver = "physmem";
-		else driver = region->driver;
-		printk("setup_region : failed to find vm for "
-		       "driver '%s' (length %d)\n", driver, region->len);
-		return(-1);
-	}
-	if(region->start == uml_physmem){
-		start = (void *) uml_reserved;
-		offset = uml_reserved - uml_physmem;
-	}
-	else {
-		start = (void *) region->start;
-		offset = 0;
-	}
-
-	loc = mmap(start, region->len - offset, PROT_READ | PROT_WRITE, 
-		   MAP_SHARED | MAP_FIXED, region->fd, offset);
-	if(loc != start){
-		perror("Mapping memory");
+	void *addr;
+	int fd;
+
+	fd = open("/dev/anon", O_RDWR);
+	if(fd < 0) {
+		os_print_error(fd, "opening /dev/anon");
 		exit(1);
 	}
-	return(0);
+
+	addr = mmap(NULL, len, PROT_READ | PROT_WRITE , MAP_PRIVATE, fd, 0);
+	if(addr == MAP_FAILED){
+		os_print_error((int) addr, "mapping physmem file");
+		exit(1);
+	}
+	munmap(addr, len);
+
+	return(fd);
+}
+
+int create_mem_file(unsigned long len)
+{
+	int err, fd;
+
+	if(have_devanon)
+		fd = create_anon_file(len);
+	else fd = create_tmp_file(len);
+
+	err = os_set_exec_close(fd, 1);
+	if(err < 0)
+		os_print_error(err, "exec_close");
+	return(fd);
 }
 
+struct iomem_region *iomem_regions = NULL;
+int iomem_size = 0;
+
 static int __init parse_iomem(char *str, int *add)
 {
-	struct stat buf;
+	struct iomem_region *new;
+	struct uml_stat buf;
 	char *file, *driver;
-	int fd;
+	int fd, err;
 
 	driver = str;
 	file = strchr(str,',');
 	if(file == NULL){
-		printk("parse_iomem : failed to parse iomem\n");
-		return(1);
+		printf("parse_iomem : failed to parse iomem\n");
+		goto out;
 	}
 	*file = '\0';
 	file++;
 	fd = os_open_file(file, of_rdwr(OPENFLAGS()), 0);
 	if(fd < 0){
-		printk("parse_iomem - Couldn't open io file, errno = %d\n", 
-		       errno);
-		return(1);
-	}
-	if(fstat(fd, &buf) < 0) {
-		printk("parse_iomem - cannot fstat file, errno = %d\n", errno);
-		return(1);
+		os_print_error(fd, "parse_iomem - Couldn't open io file");
+		goto out;
 	}
-	add_iomem(driver, fd, buf.st_size);
+
+	err = os_stat_fd(fd, &buf);
+	if(err < 0){
+		os_print_error(err, "parse_iomem - cannot stat_fd file");
+		goto out_close;
+	}
+
+	new = malloc(sizeof(*new));
+	if(new == NULL){
+		perror("Couldn't allocate iomem_region struct");
+		goto out_close;
+	}
+
+	*new = ((struct iomem_region) { .next		= iomem_regions,
+					.driver		= driver,
+					.fd		= fd,
+					.size		= buf.ust_size,
+					.phys		= 0,
+					.virt		= 0 });
+	iomem_regions = new;
+	iomem_size += new->size + UM_KERN_PAGE_SIZE;
+
 	return(0);
+ out_close:
+	os_close_file(fd);
+ out:
+	return(1);
 }
 
 __uml_setup("iomem=", parse_iomem,
@@ -153,73 +192,20 @@
 "    Configure <file> as an IO memory region named <name>.\n\n"
 );
 
-#ifdef notdef
-int logging = 0;
-int logging_fd = -1;
-
-int logging_line = 0;
-char logging_buf[256];
-
-void log(char *fmt, ...)
-{
-	va_list ap;
-	struct timeval tv;
-	struct openflags flags;
-
-	if(logging == 0) return;
-	if(logging_fd < 0){
-		flags = of_create(of_trunc(of_rdrw(OPENFLAGS())));
-		logging_fd = os_open_file("log", flags, 0644);
-	}
-	gettimeofday(&tv, NULL);
-	sprintf(logging_buf, "%d\t %u.%u  ", logging_line++, tv.tv_sec, 
-		tv.tv_usec);
-	va_start(ap, fmt);
-	vsprintf(&logging_buf[strlen(logging_buf)], fmt, ap);
-	va_end(ap);
-	write(logging_fd, logging_buf, strlen(logging_buf));
-}
-#endif
-
-int map_memory(unsigned long virt, unsigned long phys, unsigned long len, 
-	       int r, int w, int x)
-{
-	struct mem_region *region = phys_region(phys);
-
-	return(os_map_memory((void *) virt, region->fd, phys_offset(phys), len,
-			     r, w, x));
-}
-
 int protect_memory(unsigned long addr, unsigned long len, int r, int w, int x,
 		   int must_succeed)
 {
-	if(os_protect_memory((void *) addr, len, r, w, x) < 0){
+	int err;
+
+	err = os_protect_memory((void *) addr, len, r, w, x);
+	if(err < 0){
                 if(must_succeed)
-                        panic("protect failed, errno = %d", errno);
-                else return(-errno);
+			panic("protect failed, err = %d", -err);
+		else return(err);
 	}
 	return(0);
 }
 
-unsigned long find_iomem(char *driver, unsigned long *len_out)
-{
-	struct mem_region *region;
-	int i, n;
-
-	n = nregions();
-	for(i = 0; i < n; i++){
-		region = regions[i];
-		if(region == NULL) continue;
-		if((region->driver != NULL) &&
-		   !strcmp(region->driver, driver)){
-			*len_out = region->len;
-			return(region->start);
-		}
-	}
-	*len_out = 0;
-	return 0;
-}
-
 /*
  * Overrides for Emacs so that we follow Linus's tabbing style.
  * Emacs will notice this stuff at the end of the file and automatically
--- diff/arch/um/kernel/process.c	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/um/kernel/process.c	2004-02-09 10:39:51.000000000 +0000
@@ -9,12 +9,10 @@
 #include <sched.h>
 #include <errno.h>
 #include <stdarg.h>
-#include <fcntl.h>
 #include <stdlib.h>
 #include <setjmp.h>
 #include <sys/time.h>
 #include <sys/ptrace.h>
-#include <sys/ioctl.h>
 #include <sys/wait.h>
 #include <sys/mman.h>
 #include <asm/ptrace.h>
@@ -58,7 +56,11 @@
 {
 	int flags = altstack ? SA_ONSTACK : 0;
 
-	set_handler(SIGSEGV, (__sighandler_t) sig_handler, flags,
+	/* NODEFER is set here because SEGV isn't turned back on when the 
+	 * handler is ready to receive signals.  This causes any segfault
+	 * during a copy_user to kill the process because the fault is blocked.
+	 */
+	set_handler(SIGSEGV, (__sighandler_t) sig_handler, flags | SA_NODEFER,
 		    SIGUSR1, SIGIO, SIGWINCH, SIGALRM, SIGVTALRM, -1);
 	set_handler(SIGTRAP, (__sighandler_t) sig_handler, flags, 
 		    SIGUSR1, SIGIO, SIGWINCH, SIGALRM, SIGVTALRM, -1);
@@ -72,7 +74,6 @@
 		    SIGUSR1, SIGIO, SIGWINCH, SIGALRM, SIGVTALRM, -1);
 	set_handler(SIGUSR2, (__sighandler_t) sig_handler, 
 		    SA_NOMASK | flags, -1);
-	(void) CHOOSE_MODE(signal(SIGCHLD, SIG_IGN), (void *) 0);
 	signal(SIGHUP, SIG_IGN);
 
 	init_irq_signals(altstack);
@@ -123,11 +124,12 @@
 	/* Start the process and wait for it to kill itself */
 	new_pid = clone(outer_tramp, (void *) sp, clone_flags, &arg);
 	if(new_pid < 0) return(-errno);
-	while((err = waitpid(new_pid, &status, 0) < 0) && (errno == EINTR)) ;
+	while(((err = waitpid(new_pid, &status, 0)) < 0) && (errno == EINTR)) ;
 	if(err < 0) panic("Waiting for outer trampoline failed - errno = %d", 
 			  errno);
 	if(!WIFSIGNALED(status) || (WTERMSIG(status) != SIGKILL))
-		panic("outer trampoline didn't exit with SIGKILL");
+		panic("outer trampoline didn't exit with SIGKILL, "
+		      "status = %d", status);
 
 	return(arg.pid);
 }
@@ -138,7 +140,7 @@
 
 	os_stop_process(os_getpid());
 
-	if(read(fd, &c, sizeof(c)) != sizeof(c))
+	if(os_read_file(fd, &c, sizeof(c)) != sizeof(c))
 		panic("read failed in suspend_new_thread");
 }
 
@@ -233,7 +235,7 @@
 	int n;
 
 	*jmp_ptr = &buf;
-	n = setjmp(buf);
+	n = sigsetjmp(buf, 1);
 	if(n != 0)
 		return(n);
 	(*fn)(arg);
@@ -273,7 +275,7 @@
 	stop_ptraced_child(pid, stack, 1);
 
 	printf("Checking for /proc/mm...");
-	if(access("/proc/mm", W_OK)){
+	if(os_access("/proc/mm", OS_ACC_W_OK) < 0){
 		printf("not found\n");
 		ret = 0;
 	}
--- diff/arch/um/kernel/process_kern.c	2003-10-09 09:47:33.000000000 +0100
+++ source/arch/um/kernel/process_kern.c	2004-02-09 10:39:51.000000000 +0000
@@ -16,6 +16,7 @@
 #include "linux/module.h"
 #include "linux/init.h"
 #include "linux/capability.h"
+#include "linux/spinlock.h"
 #include "asm/unistd.h"
 #include "asm/mman.h"
 #include "asm/segment.h"
@@ -23,7 +24,6 @@
 #include "asm/pgtable.h"
 #include "asm/processor.h"
 #include "asm/tlbflush.h"
-#include "asm/spinlock.h"
 #include "asm/uaccess.h"
 #include "asm/user.h"
 #include "user_util.h"
@@ -52,17 +52,12 @@
 
 struct task_struct *get_task(int pid, int require)
 {
-        struct task_struct *task, *ret;
+        struct task_struct *ret;
 
-        ret = NULL;
         read_lock(&tasklist_lock);
-        for_each_process(task){
-                if(task->pid == pid){
-                        ret = task;
-                        break;
-                }
-        }
+	ret = find_task_by_pid(pid);
         read_unlock(&tasklist_lock);
+
         if(require && (ret == NULL)) panic("get_task couldn't find a task\n");
         return(ret);
 }
@@ -95,7 +90,8 @@
 	int flags = GFP_KERNEL;
 
 	if(atomic) flags |= GFP_ATOMIC;
-	if((page = __get_free_pages(flags, order)) == 0)
+	page = __get_free_pages(flags, order);
+	if(page == 0)
 		return(0);
 	stack_protections(page);
 	return(page);
@@ -103,13 +99,15 @@
 
 int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
 {
-	struct task_struct *p;
+	int pid;
 
 	current->thread.request.u.thread.proc = fn;
 	current->thread.request.u.thread.arg = arg;
-	p = do_fork(CLONE_VM | flags, 0, NULL, 0, NULL, NULL);
-	if(IS_ERR(p)) panic("do_fork failed in kernel_thread");
-	return(p->pid);
+	pid = do_fork(CLONE_VM | CLONE_UNTRACED | flags, 0, NULL, 0, NULL, 
+		      NULL);
+	if(pid < 0)
+		panic("do_fork failed in kernel_thread, errno = %d", pid);
+	return(pid);
 }
 
 void switch_mm(struct mm_struct *prev, struct mm_struct *next, 
@@ -129,7 +127,7 @@
 		{ external_pid(task), task });
 }
 
-void *switch_to(void *prev, void *next, void *last)
+void *_switch_to(void *prev, void *next, void *last)
 {
 	return(CHOOSE_MODE(switch_to_tt(prev, next), 
 			   switch_to_skas(prev, next)));
@@ -149,7 +147,7 @@
 void exit_thread(void)
 {
 	CHOOSE_MODE(exit_thread_tt(), exit_thread_skas());
-	unprotect_stack((unsigned long) current->thread_info);
+	unprotect_stack((unsigned long) current_thread);
 }
  
 void *get_current(void)
@@ -157,6 +155,10 @@
 	return(current);
 }
 
+void prepare_to_copy(struct task_struct *tsk)
+{
+}
+
 int copy_thread(int nr, unsigned long clone_flags, unsigned long sp,
 		unsigned long stack_top, struct task_struct * p, 
 		struct pt_regs *regs)
@@ -190,7 +192,7 @@
 
 void default_idle(void)
 {
-	idle_timer();
+	uml_idle_timer();
 
 	atomic_inc(&init_mm.mm_count);
 	current->mm = &init_mm;
@@ -367,10 +369,15 @@
 	return(clear_user(buf, size));
 }
 
+int strlen_user_proc(char *str)
+{
+	return(strlen_user(str));
+}
+
 int smp_sigio_handler(void)
 {
 #ifdef CONFIG_SMP
-	int cpu = current->thread_info->cpu;
+	int cpu = current_thread->cpu;
 	IPI_handler(cpu);
 	if(cpu != 0)
 		return(1);
@@ -385,7 +392,7 @@
 
 int cpu(void)
 {
-	return(current->thread_info->cpu);
+	return(current_thread->cpu);
 }
 
 /*
--- diff/arch/um/kernel/ptrace.c	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/um/kernel/ptrace.c	2004-02-09 10:39:51.000000000 +0000
@@ -311,11 +311,8 @@
 
 	/* the 0x80 provides a way for the tracing parent to distinguish
 	   between a syscall stop and SIGTRAP delivery */
- 	current->exit_code = SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD)
- 					? 0x80 : 0);
-	current->state = TASK_STOPPED;
-	notify_parent(current, SIGCHLD);
-	schedule();
+	ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD)
+				 ? 0x80 : 0));
 
 	/*
 	 * this isn't the same as continuing with a signal, but it will do
--- diff/arch/um/kernel/reboot.c	2003-10-09 09:47:33.000000000 +0100
+++ source/arch/um/kernel/reboot.c	2004-02-09 10:39:51.000000000 +0000
@@ -15,6 +15,7 @@
 #ifdef CONFIG_SMP
 static void kill_idlers(int me)
 {
+#ifdef CONFIG_MODE_TT
 	struct task_struct *p;
 	int i;
 
@@ -23,6 +24,7 @@
 		if((p != NULL) && (p->thread.mode.tt.extern_pid != me))
 			os_kill_process(p->thread.mode.tt.extern_pid, 0);
 	}
+#endif
 }
 #endif
 
--- diff/arch/um/kernel/sigio_kern.c	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/um/kernel/sigio_kern.c	2004-02-09 10:39:51.000000000 +0000
@@ -6,18 +6,21 @@
 #include "linux/kernel.h"
 #include "linux/list.h"
 #include "linux/slab.h"
-#include "asm/irq.h"
+#include "linux/signal.h"
+#include "linux/interrupt.h"
 #include "init.h"
 #include "sigio.h"
 #include "irq_user.h"
+#include "irq_kern.h"
 
 /* Protected by sigio_lock() called from write_sigio_workaround */
 static int sigio_irq_fd = -1;
 
-void sigio_interrupt(int irq, void *data, struct pt_regs *unused)
+irqreturn_t sigio_interrupt(int irq, void *data, struct pt_regs *unused)
 {
 	read_sigio_fd(sigio_irq_fd);
 	reactivate_fd(sigio_irq_fd, SIGIO_WRITE_IRQ);
+	return(IRQ_HANDLED);
 }
 
 int write_sigio_irq(int fd)
--- diff/arch/um/kernel/sigio_user.c	2003-02-13 11:46:50.000000000 +0000
+++ source/arch/um/kernel/sigio_user.c	2004-02-09 10:39:51.000000000 +0000
@@ -7,7 +7,6 @@
 #include <stdlib.h>
 #include <termios.h>
 #include <pty.h>
-#include <fcntl.h>
 #include <signal.h>
 #include <errno.h>
 #include <string.h>
@@ -26,7 +25,7 @@
 int pty_close_sigio = 0;
 
 /* Used as a flag during SIGIO testing early in boot */
-static int got_sigio = 0;
+static volatile int got_sigio = 0;
 
 void __init handler(int sig)
 {
@@ -45,7 +44,7 @@
 
 	info->err = 0;
 	if(openpty(&info->master, &info->slave, NULL, NULL, NULL))
-		info->err = errno;
+		info->err = -errno;
 }
 
 void __init check_one_sigio(void (*proc)(int, int))
@@ -53,11 +52,11 @@
 	struct sigaction old, new;
 	struct termios tt;
 	struct openpty_arg pty = { .master = -1, .slave = -1 };
-	int master, slave, flags;
+	int master, slave, err;
 
 	initial_thread_cb(openpty_cb, &pty);
 	if(pty.err){
-		printk("openpty failed, errno = %d\n", pty.err);
+		printk("openpty failed, errno = %d\n", -pty.err);
 		return;
 	}
 
@@ -69,23 +68,16 @@
 		return;
 	}
 
+	/* XXX These can fail with EINTR */
 	if(tcgetattr(master, &tt) < 0)
 		panic("check_sigio : tcgetattr failed, errno = %d\n", errno);
 	cfmakeraw(&tt);
 	if(tcsetattr(master, TCSADRAIN, &tt) < 0)
 		panic("check_sigio : tcsetattr failed, errno = %d\n", errno);
 
-	if((flags = fcntl(master, F_GETFL)) < 0)
-		panic("tty_fds : fcntl F_GETFL failed, errno = %d\n", errno);
-
-	if((fcntl(master, F_SETFL, flags | O_NONBLOCK | O_ASYNC) < 0) ||
-	   (fcntl(master, F_SETOWN, os_getpid()) < 0))
-		panic("check_sigio : fcntl F_SETFL or F_SETOWN failed, "
-		      "errno = %d\n", errno);
-
-	if((fcntl(slave, F_SETFL, flags | O_NONBLOCK) < 0))
-		panic("check_sigio : fcntl F_SETFL failed, errno = %d\n", 
-		      errno);
+	err = os_sigio_async(master, slave);
+	if(err < 0)
+		panic("tty_fds : sigio_async failed, err = %d\n", -err);
 
 	if(sigaction(SIGIO, NULL, &old) < 0)
 		panic("check_sigio : sigaction 1 failed, errno = %d\n", errno);
@@ -97,8 +89,8 @@
 	got_sigio = 0;
 	(*proc)(master, slave);
 		
-	close(master);
-	close(slave);
+	os_close_file(master);
+	os_close_file(slave);
 
 	if(sigaction(SIGIO, &old, NULL) < 0)
 		panic("check_sigio : sigaction 3 failed, errno = %d\n", errno);
@@ -112,25 +104,25 @@
 	printk("Checking that host ptys support output SIGIO...");
 
 	memset(buf, 0, sizeof(buf));
-	while(write(master, buf, sizeof(buf)) > 0) ;
+
+	while(os_write_file(master, buf, sizeof(buf)) > 0) ;
 	if(errno != EAGAIN)
 		panic("check_sigio : write failed, errno = %d\n", errno);
-
-	while(((n = read(slave, buf, sizeof(buf))) > 0) && !got_sigio) ;
+	while(((n = os_read_file(slave, buf, sizeof(buf))) > 0) && !got_sigio) ;
 
 	if(got_sigio){
 		printk("Yes\n");
 		pty_output_sigio = 1;
 	}
-	else if(errno == EAGAIN) printk("No, enabling workaround\n");
-	else panic("check_sigio : read failed, errno = %d\n", errno);
+	else if(n == -EAGAIN) printk("No, enabling workaround\n");
+	else panic("check_sigio : read failed, err = %d\n", n);
 }
 
 static void tty_close(int master, int slave)
 {
 	printk("Checking that host ptys support SIGIO on close...");
 
-	close(slave);
+	os_close_file(slave);
 	if(got_sigio){
 		printk("Yes\n");
 		pty_close_sigio = 1;
@@ -140,7 +132,8 @@
 
 void __init check_sigio(void)
 {
-	if(access("/dev/ptmx", R_OK) && access("/dev/ptyp0", R_OK)){
+	if((os_access("/dev/ptmx", OS_ACC_R_OK) < 0) &&
+	   (os_access("/dev/ptyp0", OS_ACC_R_OK) < 0)){
 		printk("No pseudo-terminals available - skipping pty SIGIO "
 		       "check\n");
 		return;
@@ -201,11 +194,10 @@
 			p = &fds->poll[i];
 			if(p->revents == 0) continue;
 			if(p->fd == sigio_private[1]){
-				n = read(sigio_private[1], &c, sizeof(c));
+				n = os_read_file(sigio_private[1], &c, sizeof(c));
 				if(n != sizeof(c))
 					printk("write_sigio_thread : "
-					       "read failed, errno = %d\n",
-					       errno);
+					       "read failed, err = %d\n", -n);
 				tmp = current_poll;
 				current_poll = next_poll;
 				next_poll = tmp;
@@ -218,10 +210,10 @@
 					(fds->used - i) * sizeof(*fds->poll));
 			}
 
-			n = write(respond_fd, &c, sizeof(c));
+			n = os_write_file(respond_fd, &c, sizeof(c));
 			if(n != sizeof(c))
 				printk("write_sigio_thread : write failed, "
-				       "errno = %d\n", errno);
+				       "err = %d\n", -n);
 		}
 	}
 }
@@ -252,15 +244,15 @@
 	char c;
 
 	flags = set_signals(0);
-	n = write(sigio_private[0], &c, sizeof(c));
+	n = os_write_file(sigio_private[0], &c, sizeof(c));
 	if(n != sizeof(c)){
-		printk("update_thread : write failed, errno = %d\n", errno);
+		printk("update_thread : write failed, err = %d\n", -n);
 		goto fail;
 	}
 
-	n = read(sigio_private[0], &c, sizeof(c));
+	n = os_read_file(sigio_private[0], &c, sizeof(c));
 	if(n != sizeof(c)){
-		printk("update_thread : read failed, errno = %d\n", errno);
+		printk("update_thread : read failed, err = %d\n", -n);
 		goto fail;
 	}
 
@@ -271,10 +263,10 @@
 	if(write_sigio_pid != -1) 
 		os_kill_process(write_sigio_pid, 1);
 	write_sigio_pid = -1;
-	close(sigio_private[0]);
-	close(sigio_private[1]);	
-	close(write_sigio_fds[0]);
-	close(write_sigio_fds[1]);
+	os_close_file(sigio_private[0]);
+	os_close_file(sigio_private[1]);	
+	os_close_file(write_sigio_fds[0]);
+	os_close_file(write_sigio_fds[1]);
 	sigio_unlock();
 	set_signals(flags);
 }
@@ -369,15 +361,15 @@
 		goto out;
 
 	err = os_pipe(write_sigio_fds, 1, 1);
-	if(err){
+	if(err < 0){
 		printk("write_sigio_workaround - os_pipe 1 failed, "
-		       "errno = %d\n", -err);
+		       "err = %d\n", -err);
 		goto out;
 	}
 	err = os_pipe(sigio_private, 1, 1);
-	if(err){
+	if(err < 0){
 		printk("write_sigio_workaround - os_pipe 2 failed, "
-		       "errno = %d\n", -err);
+		       "err = %d\n", -err);
 		goto out_close1;
 	}
 	if(setup_initial_poll(sigio_private[1]))
@@ -399,11 +391,11 @@
 	os_kill_process(write_sigio_pid, 1);
 	write_sigio_pid = -1;
  out_close2:
-	close(sigio_private[0]);
-	close(sigio_private[1]);	
+	os_close_file(sigio_private[0]);
+	os_close_file(sigio_private[1]);	
  out_close1:
-	close(write_sigio_fds[0]);
-	close(write_sigio_fds[1]);
+	os_close_file(write_sigio_fds[0]);
+	os_close_file(write_sigio_fds[1]);
 	sigio_unlock();
 }
 
@@ -412,10 +404,16 @@
 	int n;
 	char c;
 
-	n = read(fd, &c, sizeof(c));
+	n = os_read_file(fd, &c, sizeof(c));
 	if(n != sizeof(c)){
-		printk("read_sigio_fd - read failed, errno = %d\n", errno);
-		return(-errno);
+		if(n < 0) {
+			printk("read_sigio_fd - read failed, err = %d\n", -n);
+			return(n);
+		} 
+		else { 
+			printk("read_sigio_fd - short read, bytes = %d\n", n);
+			return(-EIO);
+		}
 	}
 	return(n);
 }
--- diff/arch/um/kernel/signal_kern.c	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/um/kernel/signal_kern.c	2004-02-09 10:39:51.000000000 +0000
@@ -36,7 +36,7 @@
 	if(sig == SIGSEGV){
 		struct k_sigaction *ka;
 
-		ka = &current->sig->action[SIGSEGV - 1];
+		ka = &current->sighand->action[SIGSEGV - 1];
 		ka->sa.sa_handler = SIG_DFL;
 	}
 	force_sig(SIGSEGV, current);
@@ -60,10 +60,10 @@
 	int err, ret;
 
 	ret = 0;
+	/* Always make any pending restarted system calls return -EINTR */
+	current_thread_info()->restart_block.fn = do_no_restart_syscall;
 	switch(error){
 	case -ERESTART_RESTARTBLOCK:
-		current_thread_info()->restart_block.fn = 
-			do_no_restart_syscall;
 	case -ERESTARTNOHAND:
 		ret = -EINTR;
 		break;
@@ -142,7 +142,7 @@
 		return(0);
 
 	/* Whee!  Actually deliver the signal.  */
-	ka = &current->sig->action[sig -1 ];
+	ka = &current->sighand->action[sig -1 ];
 	err = handle_signal(regs, sig, ka, &info, oldset, error);
 	if(!err) return(1);
 
@@ -201,7 +201,7 @@
 	}
 }
 
-int sys_rt_sigsuspend(sigset_t *unewset, size_t sigsetsize)
+int sys_rt_sigsuspend(sigset_t __user *unewset, size_t sigsetsize)
 {
 	sigset_t saveset, newset;
 
@@ -227,20 +227,59 @@
 	}
 }
 
+int sys_sigaction(int sig, const struct old_sigaction __user *act,
+			 struct old_sigaction __user *oact)
+{
+	struct k_sigaction new_ka, old_ka;
+	int ret;
+
+	if (act) {
+		old_sigset_t mask;
+		if (verify_area(VERIFY_READ, act, sizeof(*act)) ||
+		    __get_user(new_ka.sa.sa_handler, &act->sa_handler) ||
+		    __get_user(new_ka.sa.sa_restorer, &act->sa_restorer))
+			return -EFAULT;
+		__get_user(new_ka.sa.sa_flags, &act->sa_flags);
+		__get_user(mask, &act->sa_mask);
+		siginitset(&new_ka.sa.sa_mask, mask);
+	}
+
+	ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);
+
+	if (!ret && oact) {
+		if (verify_area(VERIFY_WRITE, oact, sizeof(*oact)) ||
+		    __put_user(old_ka.sa.sa_handler, &oact->sa_handler) ||
+		    __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer))
+			return -EFAULT;
+		__put_user(old_ka.sa.sa_flags, &oact->sa_flags);
+		__put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask);
+	}
+
+	return ret;
+}
+
+int sys_sigaltstack(const stack_t *uss, stack_t *uoss)
+{
+	return(do_sigaltstack(uss, uoss, PT_REGS_SP(&current->thread.regs)));
+}
+
+extern int userspace_pid[];
+
 static int copy_sc_from_user(struct pt_regs *to, void *from, 
 			     struct arch_frame_data *arch)
 {
 	int ret;
 
 	ret = CHOOSE_MODE(copy_sc_from_user_tt(UPT_SC(&to->regs), from, arch),
-			  copy_sc_from_user_skas(&to->regs, from));
+			  copy_sc_from_user_skas(userspace_pid[0], 
+						 &to->regs, from));
 	return(ret);
 }
 
 int sys_sigreturn(struct pt_regs regs)
 {
-	void *sc = sp_to_sc(PT_REGS_SP(&current->thread.regs));
-	void *mask = sp_to_mask(PT_REGS_SP(&current->thread.regs));
+	void __user *sc = sp_to_sc(PT_REGS_SP(&current->thread.regs));
+	void __user *mask = sp_to_mask(PT_REGS_SP(&current->thread.regs));
 	int sig_size = (_NSIG_WORDS - 1) * sizeof(unsigned long);
 
 	spin_lock_irq(&current->sighand->siglock);
@@ -257,8 +296,8 @@
 
 int sys_rt_sigreturn(struct pt_regs regs)
 {
-	struct ucontext *uc = sp_to_uc(PT_REGS_SP(&current->thread.regs));
-	void *fp;
+	unsigned long sp = PT_REGS_SP(&current->thread.regs);
+	struct ucontext __user *uc = sp_to_uc(sp);
 	int sig_size = _NSIG_WORDS * sizeof(unsigned long);
 
 	spin_lock_irq(&current->sighand->siglock);
@@ -266,7 +305,6 @@
 	sigdelsetmask(&current->blocked, ~_BLOCKABLE);
 	recalc_sigpending();
 	spin_unlock_irq(&current->sighand->siglock);
-	fp = (void *) (((unsigned long) uc) + sizeof(struct ucontext));
 	copy_sc_from_user(&current->thread.regs, &uc->uc_mcontext,
 			  &signal_frame_si.common.arch);
 	return(PT_REGS_SYSCALL_RET(&current->thread.regs));
--- diff/arch/um/kernel/skas/Makefile	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/um/kernel/skas/Makefile	2004-02-09 10:39:51.000000000 +0000
@@ -5,20 +5,24 @@
 
 obj-y = exec_kern.o exec_user.o mem.o mem_user.o mmu.o process.o \
 	process_kern.o syscall_kern.o syscall_user.o time.o tlb.o trap_user.o \
-	sys-$(SUBARCH)/
+	uaccess.o sys-$(SUBARCH)/
+
+host-progs	:= util/mk_ptregs
+clean-files	:= include/skas_ptregs.h
 
 USER_OBJS = $(filter %_user.o,$(obj-y)) process.o time.o
 USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file))
 
-include/skas_ptregs.h : util/mk_ptregs
-	util/mk_ptregs > $@
-
-util/mk_ptregs :
-	$(MAKE) -C util
+$(TOPDIR)/arch/um/include/skas_ptregs.h : $(src)/util/mk_ptregs
+	@echo -n '  Generating $@'
+	@$< > $@.tmp
+	@if [ -r $@ ] && cmp -s $@ $@.tmp; then \
+		echo ' (unchanged)'; \
+		rm -f $@.tmp; \
+	else \
+		echo ' (updated)'; \
+		mv -f $@.tmp $@; \
+	fi
 
 $(USER_OBJS) : %.o: %.c
 	$(CC) $(CFLAGS_$(notdir $@)) $(USER_CFLAGS) -c -o $@ $<
-
-clean :
-	$(MAKE) -C util clean
-	$(RM) -f include/skas_ptregs.h
--- diff/arch/um/kernel/skas/include/mode.h	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/um/kernel/skas/include/mode.h	2004-02-09 10:39:51.000000000 +0000
@@ -12,14 +12,16 @@
 extern int have_fpx_regs;
 
 extern void user_time_init_skas(void);
-extern int copy_sc_from_user_skas(union uml_pt_regs *regs, void *from_ptr);
-extern int copy_sc_to_user_skas(void *to_ptr, void *fp, 
+extern int copy_sc_from_user_skas(int pid, union uml_pt_regs *regs, 
+				  void *from_ptr);
+extern int copy_sc_to_user_skas(int pid, void *to_ptr, void *fp, 
 				union uml_pt_regs *regs, 
 				unsigned long fault_addr, int fault_type);
 extern void sig_handler_common_skas(int sig, void *sc_ptr);
 extern void halt_skas(void);
 extern void reboot_skas(void);
 extern void kill_off_processes_skas(void);
+extern int is_skas_winch(int pid, int fd, void *data);
 
 #endif
 
--- diff/arch/um/kernel/skas/include/skas.h	2003-02-13 11:46:50.000000000 +0000
+++ source/arch/um/kernel/skas/include/skas.h	2004-02-09 10:39:51.000000000 +0000
@@ -8,7 +8,7 @@
 
 #include "sysdep/ptrace.h"
 
-extern int userspace_pid;
+extern int userspace_pid[];
 
 extern void switch_threads(void *me, void *next);
 extern void thread_wait(void *sw, void *fb);
@@ -32,7 +32,7 @@
 extern int new_mm(int from);
 extern void save_registers(union uml_pt_regs *regs);
 extern void restore_registers(union uml_pt_regs *regs);
-extern void start_userspace(void);
+extern void start_userspace(int cpu);
 extern void init_registers(int pid);
 
 #endif
--- diff/arch/um/kernel/skas/include/uaccess.h	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/um/kernel/skas/include/uaccess.h	2004-02-09 10:39:51.000000000 +0000
@@ -6,20 +6,10 @@
 #ifndef __SKAS_UACCESS_H
 #define __SKAS_UACCESS_H
 
-#include "linux/string.h"
-#include "linux/sched.h"
-#include "linux/err.h"
-#include "asm/processor.h"
-#include "asm/pgtable.h"
-#include "asm/errno.h"
-#include "asm/current.h"
-#include "asm/a.out.h"
-#include "kern_util.h"
-
 #define access_ok_skas(type, addr, size) \
 	((segment_eq(get_fs(), KERNEL_DS)) || \
 	 (((unsigned long) (addr) < TASK_SIZE) && \
-	  ((unsigned long) (addr) + (size) < TASK_SIZE)))
+	  ((unsigned long) (addr) + (size) <= TASK_SIZE)))
 
 static inline int verify_area_skas(int type, const void * addr, 
 				   unsigned long size)
@@ -27,197 +17,12 @@
 	return(access_ok_skas(type, addr, size) ? 0 : -EFAULT);
 }
 
-static inline unsigned long maybe_map(unsigned long virt, int is_write)
-{
-	pte_t pte;
-
-	void *phys = um_virt_to_phys(current, virt, &pte);
-	int dummy_code;
-
-	if(IS_ERR(phys) || (is_write && !pte_write(pte))){
-		if(handle_page_fault(virt, 0, is_write, 0, &dummy_code))
-			return(0);
-		phys = um_virt_to_phys(current, virt, NULL);
-	}
-	return((unsigned long) __va((unsigned long) phys));
-}
-
-static inline int buffer_op(unsigned long addr, int len, 
-			    int (*op)(unsigned long addr, int len, void *arg),
-			    void *arg)
-{
-	int size = min(PAGE_ALIGN(addr) - addr, (unsigned long) len);
-	int remain = len, n;
-
-	n = (*op)(addr, size, arg);
-	if(n != 0)
-		return(n < 0 ? remain : 0);
-
-	addr += size;
-	remain -= size;
-	if(remain == 0) 
-		return(0);
-
-	while(addr < ((addr + remain) & PAGE_MASK)){
-		n = (*op)(addr, PAGE_SIZE, arg);
-		if(n != 0)
-			return(n < 0 ? remain : 0);
-
-		addr += PAGE_SIZE;
-		remain -= PAGE_SIZE;
-	}
-	if(remain == 0)
-		return(0);
-
-	n = (*op)(addr, remain, arg);
-	if(n != 0)
-		return(n < 0 ? remain : 0);
-	return(0);
-}
-
-static inline int copy_chunk_from_user(unsigned long from, int len, void *arg)
-{
-	unsigned long *to_ptr = arg, to = *to_ptr;
-
-	from = maybe_map(from, 0);
-	if(from == 0)
-		return(-1);
-
-	memcpy((void *) to, (void *) from, len);
-	*to_ptr += len;
-	return(0);
-}
-
-static inline int copy_from_user_skas(void *to, const void *from, int n)
-{
-	if(segment_eq(get_fs(), KERNEL_DS)){
-		memcpy(to, from, n);
-		return(0);
-	}
-
-	return(access_ok_skas(VERIFY_READ, from, n) ?
-	       buffer_op((unsigned long) from, n, copy_chunk_from_user, &to) :
-	       n);
-}
-
-static inline int copy_chunk_to_user(unsigned long to, int len, void *arg)
-{
-	unsigned long *from_ptr = arg, from = *from_ptr;
-
-	to = maybe_map(to, 1);
-	if(to == 0)
-		return(-1);
-
-	memcpy((void *) to, (void *) from, len);
-	*from_ptr += len;
-	return(0);
-}
-
-static inline int copy_to_user_skas(void *to, const void *from, int n)
-{
-	if(segment_eq(get_fs(), KERNEL_DS)){
-		memcpy(to, from, n);
-		return(0);
-	}
-
-	return(access_ok_skas(VERIFY_WRITE, to, n) ?
-	       buffer_op((unsigned long) to, n, copy_chunk_to_user, &from) :
-	       n);
-}
-
-static inline int strncpy_chunk_from_user(unsigned long from, int len, 
-					  void *arg)
-{
-        char **to_ptr = arg, *to = *to_ptr;
-	int n;
-
-	from = maybe_map(from, 0);
-	if(from == 0)
-		return(-1);
-
-	strncpy(to, (void *) from, len);
-	n = strnlen(to, len);
-	*to_ptr += n;
-
-	if(n < len) 
-	        return(1);
-	return(0);
-}
-
-static inline int strncpy_from_user_skas(char *dst, const char *src, int count)
-{
-	int n;
-	char *ptr = dst;
-
-	if(segment_eq(get_fs(), KERNEL_DS)){
-		strncpy(dst, src, count);
-		return(strnlen(dst, count));
-	}
-
-	if(!access_ok_skas(VERIFY_READ, src, 1))
-		return(-EFAULT);
-
-	n = buffer_op((unsigned long) src, count, strncpy_chunk_from_user, 
-		      &ptr);
-	if(n != 0)
-		return(-EFAULT);
-	return(strnlen(dst, count));
-}
-
-static inline int clear_chunk(unsigned long addr, int len, void *unused)
-{
-	addr = maybe_map(addr, 1);
-	if(addr == 0) 
-		return(-1);
-
-	memset((void *) addr, 0, len);
-	return(0);
-}
-
-static inline int __clear_user_skas(void *mem, int len)
-{
-	return(buffer_op((unsigned long) mem, len, clear_chunk, NULL));
-}
-
-static inline int clear_user_skas(void *mem, int len)
-{
-	if(segment_eq(get_fs(), KERNEL_DS)){
-		memset(mem, 0, len);
-		return(0);
-	}
-
-	return(access_ok_skas(VERIFY_WRITE, mem, len) ? 
-	       buffer_op((unsigned long) mem, len, clear_chunk, NULL) : len);
-}
-
-static inline int strnlen_chunk(unsigned long str, int len, void *arg)
-{
-	int *len_ptr = arg, n;
-
-	str = maybe_map(str, 0);
-	if(str == 0) 
-		return(-1);
-
-	n = strnlen((void *) str, len);
-	*len_ptr += n;
-
-	if(n < len)
-		return(1);
-	return(0);
-}
-
-static inline int strnlen_user_skas(const void *str, int len)
-{
-	int count = 0, n;
-
-	if(segment_eq(get_fs(), KERNEL_DS))
-		return(strnlen(str, len) + 1);
-
-	n = buffer_op((unsigned long) str, len, strnlen_chunk, &count);
-	if(n == 0)
-		return(count + 1);
-	return(-EFAULT);
-}
+extern int copy_from_user_skas(void *to, const void *from, int n);
+extern int copy_to_user_skas(void *to, const void *from, int n);
+extern int strncpy_from_user_skas(char *dst, const char *src, int count);
+extern int __clear_user_skas(void *mem, int len);
+extern int clear_user_skas(void *mem, int len);
+extern int strnlen_user_skas(const void *str, int len);
 
 #endif
 
--- diff/arch/um/kernel/skas/mem_user.c	2003-02-13 11:46:50.000000000 +0000
+++ source/arch/um/kernel/skas/mem_user.c	2004-02-09 10:39:51.000000000 +0000
@@ -7,6 +7,7 @@
 #include <sys/mman.h>
 #include <sys/ptrace.h>
 #include "mem_user.h"
+#include "mem.h"
 #include "user.h"
 #include "os.h"
 #include "proc_mm.h"
@@ -15,12 +16,12 @@
 	 int r, int w, int x)
 {
 	struct proc_mm_op map;
-	struct mem_region *region;
-	int prot, n;
+	__u64 offset;
+	int prot, n, phys_fd;
 
 	prot = (r ? PROT_READ : 0) | (w ? PROT_WRITE : 0) | 
 		(x ? PROT_EXEC : 0);
-	region = phys_region(phys);
+	phys_fd = phys_mapping(phys, &offset);
 
 	map = ((struct proc_mm_op) { .op 	= MM_MMAP,
 				     .u 	= 
@@ -30,12 +31,12 @@
 					 .prot		= prot,
 					 .flags		= MAP_SHARED | 
 					                  MAP_FIXED,
-					 .fd		= region->fd,
-					 .offset	= phys_offset(phys)
+					 .fd		= phys_fd,
+					 .offset	= offset
 				       } } } );
 	n = os_write_file(fd, &map, sizeof(map));
 	if(n != sizeof(map)) 
-		printk("map : /proc/mm map failed, errno = %d\n", errno);
+		printk("map : /proc/mm map failed, err = %d\n", -n);
 }
 
 int unmap(int fd, void *addr, int len)
@@ -49,8 +50,13 @@
 					 { .addr 	= (unsigned long) addr,
 					   .len		= len } } } );
 	n = os_write_file(fd, &unmap, sizeof(unmap));
-	if((n != 0) && (n != sizeof(unmap)))
-		return(-errno);
+	if(n != sizeof(unmap)) {
+		if(n < 0) 
+			return(n);
+		else if(n > 0) 
+			return(-EIO);
+	}
+
 	return(0);
 }
 
@@ -71,11 +77,15 @@
 					   .prot	= prot } } } );
 
 	n = os_write_file(fd, &protect, sizeof(protect));
-	if((n != 0) && (n != sizeof(protect))){
+	if(n != sizeof(protect)) {
+		if(n == 0) return(0);
+
 		if(must_succeed)
-			panic("protect failed, errno = %d", errno);
-		return(-errno);
+			panic("protect failed, err = %d", -n);
+
+		return(-EIO);
 	}
+
 	return(0);
 }
 
--- diff/arch/um/kernel/skas/mmu.c	2003-01-02 10:43:05.000000000 +0000
+++ source/arch/um/kernel/skas/mmu.c	2004-02-09 10:39:51.000000000 +0000
@@ -22,9 +22,11 @@
 	else from = -1;
 
 	mm->context.skas.mm_fd = new_mm(from);
-	if(mm->context.skas.mm_fd < 0)
-		panic("init_new_context_skas - new_mm failed, errno = %d\n",
-		      mm->context.skas.mm_fd);
+	if(mm->context.skas.mm_fd < 0){
+		printk("init_new_context_skas - new_mm failed, errno = %d\n",
+		       mm->context.skas.mm_fd);
+		return(mm->context.skas.mm_fd);
+	}
 
 	return(0);
 }
--- diff/arch/um/kernel/skas/process.c	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/um/kernel/skas/process.c	2004-02-09 10:39:51.000000000 +0000
@@ -4,6 +4,7 @@
  */
 
 #include <stdlib.h>
+#include <unistd.h>
 #include <errno.h>
 #include <signal.h>
 #include <setjmp.h>
@@ -24,6 +25,18 @@
 #include "os.h"
 #include "proc_mm.h"
 #include "skas_ptrace.h"
+#include "chan_user.h"
+
+int is_skas_winch(int pid, int fd, void *data)
+{
+	if(pid != getpid())
+		return(0);
+
+	register_winch_irq(-1, fd, -1, data);
+	return(1);
+}
+
+/* These are set once at boot time and not changed thereafter */
 
 unsigned long exec_regs[FRAME_SIZE];
 unsigned long exec_fp_regs[HOST_FP_SIZE];
@@ -48,11 +61,11 @@
 	int err, syscall_nr, status;
 
 	syscall_nr = PT_SYSCALL_NR(regs->skas.regs);
+	UPT_SYSCALL_NR(regs) = syscall_nr;
 	if(syscall_nr < 1){
 		relay_signal(SIGTRAP, regs);
 		return;
 	}
-	UPT_SYSCALL_NR(regs) = syscall_nr;
 
 	err = ptrace(PTRACE_POKEUSER, pid, PT_SYSCALL_NR_OFFSET, __NR_getpid);
 	if(err < 0)
@@ -72,8 +85,6 @@
 	handle_syscall(regs);
 }
 
-int userspace_pid;
-
 static int userspace_tramp(void *arg)
 {
 	init_new_thread_signals(0);
@@ -83,7 +94,11 @@
 	return(0);
 }
 
-void start_userspace(void)
+/* Each element set once, and only accessed by a single processor anyway */
+#define NR_CPUS 1
+int userspace_pid[NR_CPUS];
+
+void start_userspace(int cpu)
 {
 	void *stack;
 	unsigned long sp;
@@ -114,21 +129,21 @@
 	if(munmap(stack, PAGE_SIZE) < 0)
 		panic("start_userspace : munmap failed, errno = %d\n", errno);
 
-	userspace_pid = pid;
+	userspace_pid[cpu] = pid;
 }
 
 void userspace(union uml_pt_regs *regs)
 {
-	int err, status, op;
+	int err, status, op, pid = userspace_pid[0];
 
 	restore_registers(regs);
 		
-	err = ptrace(PTRACE_SYSCALL, userspace_pid, 0, 0);
+	err = ptrace(PTRACE_SYSCALL, pid, 0, 0);
 	if(err)
 		panic("userspace - PTRACE_SYSCALL failed, errno = %d\n", 
 		       errno);
 	while(1){
-		err = waitpid(userspace_pid, &status, WUNTRACED);
+		err = waitpid(pid, &status, WUNTRACED);
 		if(err < 0)
 			panic("userspace - waitpid failed, errno = %d\n", 
 			      errno);
@@ -139,16 +154,17 @@
 		if(WIFSTOPPED(status)){
 		  	switch(WSTOPSIG(status)){
 			case SIGSEGV:
-				handle_segv(userspace_pid);
+				handle_segv(pid);
 				break;
 			case SIGTRAP:
-			        handle_trap(userspace_pid, regs);
+			        handle_trap(pid, regs);
 				break;
 			case SIGIO:
 			case SIGVTALRM:
 			case SIGILL:
 			case SIGBUS:
 			case SIGFPE:
+			case SIGWINCH:
 				user_signal(WSTOPSIG(status), regs);
 				break;
 			default:
@@ -162,7 +178,7 @@
 
 		op = singlestepping_skas() ? PTRACE_SINGLESTEP : 
 			PTRACE_SYSCALL;
-		err = ptrace(op, userspace_pid, 0, 0);
+		err = ptrace(op, pid, 0, 0);
 		if(err)
 			panic("userspace - PTRACE_SYSCALL failed, "
 			      "errno = %d\n", errno);
@@ -177,7 +193,7 @@
 	*switch_buf_ptr = &switch_buf;
 	*fork_buf_ptr = &fork_buf;
 
-	if(setjmp(fork_buf) == 0)
+	if(sigsetjmp(fork_buf, 1) == 0)
 		new_thread_proc(stack, handler);
 
 	remove_sigstack();
@@ -189,16 +205,16 @@
 
 	*switch_buf = &buf;
 	fork_buf = fb;
-	if(setjmp(buf) == 0)
-		longjmp(*fork_buf, 1);
+	if(sigsetjmp(buf, 1) == 0)
+		siglongjmp(*fork_buf, 1);
 }
 
-static int move_registers(int int_op, int fp_op, union uml_pt_regs *regs,
-			  unsigned long *fp_regs)
+static int move_registers(int pid, int int_op, int fp_op, 
+			  union uml_pt_regs *regs, unsigned long *fp_regs)
 {
-	if(ptrace(int_op, userspace_pid, 0, regs->skas.regs) < 0)
+	if(ptrace(int_op, pid, 0, regs->skas.regs) < 0)
 		return(-errno);
-	if(ptrace(fp_op, userspace_pid, 0, fp_regs) < 0)
+	if(ptrace(fp_op, pid, 0, fp_regs) < 0)
 		return(-errno);
 	return(0);
 }
@@ -217,10 +233,11 @@
 		fp_regs = regs->skas.fp;
 	}
 
-	err = move_registers(PTRACE_GETREGS, fp_op, regs, fp_regs);
+	err = move_registers(userspace_pid[0], PTRACE_GETREGS, fp_op, regs, 
+			     fp_regs);
 	if(err)
 		panic("save_registers - saving registers failed, errno = %d\n",
-		      err);
+		      -err);
 }
 
 void restore_registers(union uml_pt_regs *regs)
@@ -237,10 +254,11 @@
 		fp_regs = regs->skas.fp;
 	}
 
-	err = move_registers(PTRACE_SETREGS, fp_op, regs, fp_regs);
+	err = move_registers(userspace_pid[0], PTRACE_SETREGS, fp_op, regs, 
+			     fp_regs);
 	if(err)
 		panic("restore_registers - saving registers failed, "
-		      "errno = %d\n", err);
+		      "errno = %d\n", -err);
 }
 
 void switch_threads(void *me, void *next)
@@ -248,8 +266,8 @@
 	jmp_buf my_buf, **me_ptr = me, *next_buf = next;
 	
 	*me_ptr = &my_buf;
-	if(setjmp(my_buf) == 0)
-		longjmp(*next_buf, 1);
+	if(sigsetjmp(my_buf, 1) == 0)
+		siglongjmp(*next_buf, 1);
 }
 
 static jmp_buf initial_jmpbuf;
@@ -265,14 +283,14 @@
 	int n;
 
 	*fork_buf_ptr = &initial_jmpbuf;
-	n = setjmp(initial_jmpbuf);
+	n = sigsetjmp(initial_jmpbuf, 1);
 	if(n == 0)
 		new_thread_proc((void *) stack, new_thread_handler);
 	else if(n == 1)
 		remove_sigstack();
 	else if(n == 2){
 		(*cb_proc)(cb_arg);
-		longjmp(*cb_back, 1);
+		siglongjmp(*cb_back, 1);
 	}
 	else if(n == 3){
 		kmalloc_ok = 0;
@@ -282,7 +300,7 @@
 		kmalloc_ok = 0;
 		return(1);
 	}
-	longjmp(**switch_buf, 1);
+	siglongjmp(**switch_buf, 1);
 }
 
 void remove_sigstack(void)
@@ -304,8 +322,8 @@
 	cb_back = &here;
 
 	block_signals();
-	if(setjmp(here) == 0)
-		longjmp(initial_jmpbuf, 2);
+	if(sigsetjmp(here, 1) == 0)
+		siglongjmp(initial_jmpbuf, 2);
 	unblock_signals();
 
 	cb_proc = NULL;
@@ -316,22 +334,23 @@
 void halt_skas(void)
 {
 	block_signals();
-	longjmp(initial_jmpbuf, 3);
+	siglongjmp(initial_jmpbuf, 3);
 }
 
 void reboot_skas(void)
 {
 	block_signals();
-	longjmp(initial_jmpbuf, 4);
+	siglongjmp(initial_jmpbuf, 4);
 }
 
 int new_mm(int from)
 {
 	struct proc_mm_op copy;
-	int n, fd = os_open_file("/proc/mm", of_write(OPENFLAGS()), 0);
+	int n, fd = os_open_file("/proc/mm", 
+				 of_cloexec(of_write(OPENFLAGS())), 0);
 
 	if(fd < 0)
-		return(-errno);
+		return(fd);
 
 	if(from != -1){
 		copy = ((struct proc_mm_op) { .op 	= MM_COPY_SEGMENTS,
@@ -340,8 +359,9 @@
 		n = os_write_file(fd, &copy, sizeof(copy));
 		if(n != sizeof(copy)) 
 			printk("new_mm : /proc/mm copy_segments failed, "
-			       "errno = %d\n", errno);
+			       "err = %d\n", -n);
 	}
+
 	return(fd);
 }
 
@@ -349,7 +369,8 @@
 {
 	int err;
 
-	err = ptrace(PTRACE_SWITCH_MM, userspace_pid, 0, mm_fd);
+#warning need cpu pid in switch_mm_skas
+	err = ptrace(PTRACE_SWITCH_MM, userspace_pid[0], 0, mm_fd);
 	if(err)
 		panic("switch_mm_skas - PTRACE_SWITCH_MM failed, errno = %d\n",
 		      errno);
@@ -357,7 +378,8 @@
 
 void kill_off_processes_skas(void)
 {
-	os_kill_process(userspace_pid, 1);
+#warning need to loop over userspace_pids in kill_off_processes_skas
+	os_kill_process(userspace_pid[0], 1);
 }
 
 void init_registers(int pid)
--- diff/arch/um/kernel/skas/process_kern.c	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/um/kernel/skas/process_kern.c	2004-02-09 10:39:51.000000000 +0000
@@ -61,11 +61,13 @@
 	thread_wait(&current->thread.mode.skas.switch_buf, 
 		    current->thread.mode.skas.fork_buf);
 
-#ifdef CONFIG_SMP
-	schedule_tail(NULL);
-#endif
+	if(current->thread.prev_sched != NULL)
+		schedule_tail(current->thread.prev_sched);
 	current->thread.prev_sched = NULL;
 
+	/* The return value is 1 if the kernel thread execs a process,
+	 * 0 if it just exits
+	 */
 	n = run_kernel_thread(fn, arg, &current->thread.exec_buf);
 	if(n == 1)
 		userspace(&current->thread.regs.regs);
@@ -93,9 +95,8 @@
 		    current->thread.mode.skas.fork_buf);
   	
 	force_flush_all();
-#ifdef CONFIG_SMP
-	schedule_tail(current->thread.prev_sched);
-#endif
+	if(current->thread.prev_sched != NULL)
+		schedule_tail(current->thread.prev_sched);
 	current->thread.prev_sched = NULL;
 	unblock_signals();
 
@@ -136,7 +137,7 @@
 
 void init_idle_skas(void)
 {
-	cpu_tasks[current->thread_info->cpu].pid = os_getpid();
+	cpu_tasks[current_thread->cpu].pid = os_getpid();
 	default_idle();
 }
 
@@ -160,11 +161,11 @@
 
 int start_uml_skas(void)
 {
-	start_userspace();
+	start_userspace(0);
 	capture_signal_stack();
+	uml_idle_timer();
 
 	init_new_thread_signals(1);
-	idle_timer();
 
 	init_task.thread.request.u.thread.proc = start_kernel_proc;
 	init_task.thread.request.u.thread.arg = NULL;
@@ -175,12 +176,14 @@
 
 int external_pid_skas(struct task_struct *task)
 {
-	return(userspace_pid);
+#warning Need to look up userspace_pid by cpu	
+	return(userspace_pid[0]);
 }
 
 int thread_pid_skas(struct task_struct *task)
 {
-	return(userspace_pid);
+#warning Need to look up userspace_pid by cpu	
+	return(userspace_pid[0]);
 }
 
 /*
--- diff/arch/um/kernel/skas/sys-i386/sigcontext.c	2003-02-13 11:46:50.000000000 +0000
+++ source/arch/um/kernel/skas/sys-i386/sigcontext.c	2004-02-09 10:39:51.000000000 +0000
@@ -12,10 +12,9 @@
 #include "kern_util.h"
 #include "user.h"
 #include "sigcontext.h"
+#include "mode.h"
 
-extern int userspace_pid;
-
-int copy_sc_from_user_skas(union uml_pt_regs *regs, void *from_ptr)
+int copy_sc_from_user_skas(int pid, union uml_pt_regs *regs, void *from_ptr)
 {
   	struct sigcontext sc, *from = from_ptr;
 	unsigned long fpregs[FP_FRAME_SIZE];
@@ -41,13 +40,12 @@
 	regs->skas.regs[EIP] = sc.eip;
 	regs->skas.regs[CS] = sc.cs;
 	regs->skas.regs[EFL] = sc.eflags;
-	regs->skas.regs[UESP] = sc.esp_at_signal;
 	regs->skas.regs[SS] = sc.ss;
 	regs->skas.fault_addr = sc.cr2;
 	regs->skas.fault_type = FAULT_WRITE(sc.err);
 	regs->skas.trap_type = sc.trapno;
 
-	err = ptrace(PTRACE_SETFPREGS, userspace_pid, 0, fpregs);
+	err = ptrace(PTRACE_SETFPREGS, pid, 0, fpregs);
 	if(err < 0){
 	  	printk("copy_sc_to_user - PTRACE_SETFPREGS failed, "
 		       "errno = %d\n", errno);
@@ -57,8 +55,9 @@
 	return(0);
 }
 
-int copy_sc_to_user_skas(void *to_ptr, void *fp, union uml_pt_regs *regs, 
-			 unsigned long fault_addr, int fault_type)
+int copy_sc_to_user_skas(int pid, void *to_ptr, void *fp, 
+			 union uml_pt_regs *regs, unsigned long fault_addr, 
+			 int fault_type)
 {
   	struct sigcontext sc, *to = to_ptr;
 	struct _fpstate *to_fp;
@@ -86,7 +85,7 @@
 	sc.err = TO_SC_ERR(fault_type);
 	sc.trapno = regs->skas.trap_type;
 
-	err = ptrace(PTRACE_GETFPREGS, userspace_pid, 0, fpregs);
+	err = ptrace(PTRACE_GETFPREGS, pid, 0, fpregs);
 	if(err < 0){
 	  	printk("copy_sc_to_user - PTRACE_GETFPREGS failed, "
 		       "errno = %d\n", errno);
--- diff/arch/um/kernel/skas/syscall_kern.c	2003-02-13 11:46:50.000000000 +0000
+++ source/arch/um/kernel/skas/syscall_kern.c	2004-02-09 10:39:51.000000000 +0000
@@ -1,5 +1,5 @@
 /* 
- * Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
+ * Copyright (C) 2002 - 2003 Jeff Dike (jdike@addtoit.com)
  * Licensed under the GPL
  */
 
--- diff/arch/um/kernel/skas/trap_user.c	2003-02-13 11:46:50.000000000 +0000
+++ source/arch/um/kernel/skas/trap_user.c	2004-02-09 10:39:51.000000000 +0000
@@ -1,5 +1,5 @@
 /* 
- * Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
+ * Copyright (C) 2002 - 2003 Jeff Dike (jdike@addtoit.com)
  * Licensed under the GPL
  */
 
@@ -41,8 +41,6 @@
 {
 	struct signal_info *info;
 
-	if(sig == SIGVTALRM)
-		missed_ticks[cpu()]++;
 	regs->skas.is_user = 1;
 	regs->skas.fault_addr = 0;
 	regs->skas.fault_type = 0;
--- diff/arch/um/kernel/skas/util/Makefile	2003-01-02 10:43:05.000000000 +0000
+++ source/arch/um/kernel/skas/util/Makefile	2004-02-09 10:39:51.000000000 +0000
@@ -1,10 +1,10 @@
 all: mk_ptregs
 
 mk_ptregs : mk_ptregs.o
-	$(CC) -o mk_ptregs mk_ptregs.o
+	$(HOSTCC) -o mk_ptregs mk_ptregs.o
 
 mk_ptregs.o : mk_ptregs.c
-	$(CC) -c $< 
+	$(HOSTCC) -c $< 
 
 clean : 
 	$(RM) -f mk_ptregs *.o *~
--- diff/arch/um/kernel/skas/util/mk_ptregs.c	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/um/kernel/skas/util/mk_ptregs.c	2004-02-09 10:39:51.000000000 +0000
@@ -1,3 +1,4 @@
+#include <stdio.h>
 #include <asm/ptrace.h>
 #include <asm/user.h>
 
--- diff/arch/um/kernel/smp.c	2003-10-09 09:47:33.000000000 +0100
+++ source/arch/um/kernel/smp.c	2004-02-09 10:39:51.000000000 +0000
@@ -1,9 +1,15 @@
 /* 
- * Copyright (C) 2000 Jeff Dike (jdike@karaya.com)
+ * Copyright (C) 2000 - 2003 Jeff Dike (jdike@addtoit.com)
  * Licensed under the GPL
  */
 
 #include "linux/config.h"
+#include "linux/percpu.h"
+#include "asm/pgalloc.h"
+#include "asm/tlb.h"
+
+/* For some reason, mmu_gathers are referenced when CONFIG_SMP is off. */
+DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
 
 #ifdef CONFIG_SMP
 
@@ -23,7 +29,7 @@
 #include "os.h"
 
 /* CPU online map, set by smp_boot_cpus */
-unsigned long cpu_online_map = cpumask_of_cpu(0);
+unsigned long cpu_online_map = CPU_MASK_NONE;
 
 EXPORT_SYMBOL(cpu_online_map);
 
@@ -55,7 +61,7 @@
 
 void smp_send_reschedule(int cpu)
 {
-	write(cpu_data[cpu].ipi_pipe[1], "R", 1);
+	os_write_file(cpu_data[cpu].ipi_pipe[1], "R", 1);
 	num_reschedules_sent++;
 }
 
@@ -100,35 +106,34 @@
 
 	printk(KERN_INFO "Stopping all CPUs...");
 	for(i = 0; i < num_online_cpus(); i++){
-		if(i == current->thread_info->cpu)
+		if(i == current_thread->cpu)
 			continue;
-		write(cpu_data[i].ipi_pipe[1], "S", 1);
+		os_write_file(cpu_data[i].ipi_pipe[1], "S", 1);
 	}
 	printk("done\n");
 }
 
-static cpumask_t smp_commenced_mask;
-static cpumask_t smp_callin_map = CPU_MASK_NONE;
+static cpumask_t smp_commenced_mask = CPU_MASK_NONE;
+static cpumask_t cpu_callin_map = CPU_MASK_NONE;
 
 static int idle_proc(void *cpup)
 {
 	int cpu = (int) cpup, err;
 
 	err = os_pipe(cpu_data[cpu].ipi_pipe, 1, 1);
-	if(err)
-		panic("CPU#%d failed to create IPI pipe, errno = %d", cpu, 
-		      -err);
+	if(err < 0)
+		panic("CPU#%d failed to create IPI pipe, err = %d", cpu, -err);
 
 	activate_ipi(cpu_data[cpu].ipi_pipe[0], 
 		     current->thread.mode.tt.extern_pid);
  
 	wmb();
-	if (cpu_test_and_set(cpu, &smp_callin_map)) {
+	if (cpu_test_and_set(cpu, cpu_callin_map)) {
 		printk("huh, CPU#%d already present??\n", cpu);
 		BUG();
 	}
 
-	while (!cpu_isset(cpu, &smp_commenced_mask))
+	while (!cpu_isset(cpu, smp_commenced_mask))
 		cpu_relax();
 
 	cpu_set(cpu, cpu_online_map);
@@ -143,16 +148,20 @@
 
         current->thread.request.u.thread.proc = idle_proc;
         current->thread.request.u.thread.arg = (void *) cpu;
-	new_task = do_fork(CLONE_VM | CLONE_IDLETASK, 0, NULL, 0, NULL, NULL);
-	if(IS_ERR(new_task)) panic("do_fork failed in idle_thread");
+	new_task = copy_process(CLONE_VM | CLONE_IDLETASK, 0, NULL, 0, NULL, 
+				NULL);
+	if(IS_ERR(new_task)) 
+		panic("copy_process failed in idle_thread, error = %ld",
+		      PTR_ERR(new_task));
 
 	cpu_tasks[cpu] = ((struct cpu_task) 
 		          { .pid = 	new_task->thread.mode.tt.extern_pid,
 			    .task = 	new_task } );
 	idle_threads[cpu] = new_task;
-	CHOOSE_MODE(write(new_task->thread.mode.tt.switch_pipe[1], &c, 
+	CHOOSE_MODE(os_write_file(new_task->thread.mode.tt.switch_pipe[1], &c, 
 			  sizeof(c)),
 		    ({ panic("skas mode doesn't support SMP"); }));
+	wake_up_forked_process(new_task);
 	return(new_task);
 }
 
@@ -160,15 +169,17 @@
 {
 	struct task_struct *idle;
 	unsigned long waittime;
-	int err, cpu;
+	int err, cpu, me = smp_processor_id();
 
-	cpu_set(0, cpu_online_map);
-	cpu_set(0, smp_callin_map);
+	cpu_clear(me, cpu_online_map);
+	cpu_set(me, cpu_online_map);
+	cpu_set(me, cpu_callin_map);
 
-	err = os_pipe(cpu_data[0].ipi_pipe, 1, 1);
-	if(err)	panic("CPU#0 failed to create IPI pipe, errno = %d", -err);
+	err = os_pipe(cpu_data[me].ipi_pipe, 1, 1);
+	if(err < 0)
+		panic("CPU#0 failed to create IPI pipe, errno = %d", -err);
 
-	activate_ipi(cpu_data[0].ipi_pipe[0], 
+	activate_ipi(cpu_data[me].ipi_pipe[0], 
 		     current->thread.mode.tt.extern_pid);
 
 	for(cpu = 1; cpu < ncpus; cpu++){
@@ -180,10 +191,10 @@
 		unhash_process(idle);
 
 		waittime = 200000000;
-		while (waittime-- && !cpu_isset(cpu, smp_callin_map))
+		while (waittime-- && !cpu_isset(cpu, cpu_callin_map))
 			cpu_relax();
 
-		if (cpu_isset(cpu, smp_callin_map))
+		if (cpu_isset(cpu, cpu_callin_map))
 			printk("done\n");
 		else printk("failed\n");
 	}
@@ -216,7 +227,7 @@
 	int fd;
 
 	fd = cpu_data[cpu].ipi_pipe[0];
-	while (read(fd, &c, 1) == 1) {
+	while (os_read_file(fd, &c, 1) == 1) {
 		switch (c) {
 		case 'C':
 			smp_call_function_slave(cpu);
@@ -273,9 +284,9 @@
 	info = _info;
 
 	for (i=0;i<NR_CPUS;i++)
-		if((i != current->thread_info->cpu) && 
+		if((i != current_thread->cpu) && 
 		   cpu_isset(i, cpu_online_map))
-			write(cpu_data[i].ipi_pipe[1], "C", 1);
+			os_write_file(cpu_data[i].ipi_pipe[1], "C", 1);
 
 	while (atomic_read(&scf_started) != cpus)
 		barrier();
--- diff/arch/um/kernel/sys_call_table.c	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/um/kernel/sys_call_table.c	2004-02-09 10:39:51.000000000 +0000
@@ -5,7 +5,6 @@
 
 #include "linux/config.h"
 #include "linux/unistd.h"
-#include "linux/version.h"
 #include "linux/sys.h"
 #include "linux/swap.h"
 #include "linux/sysctl.h"
@@ -152,7 +151,6 @@
 extern syscall_handler_t sys_munlockall;
 extern syscall_handler_t sys_sched_setparam;
 extern syscall_handler_t sys_sched_getparam;
-extern syscall_handler_t sys_sched_setscheduler;
 extern syscall_handler_t sys_sched_getscheduler;
 extern syscall_handler_t sys_sched_get_priority_max;
 extern syscall_handler_t sys_sched_get_priority_min;
@@ -219,15 +217,30 @@
 extern syscall_handler_t sys_gettid;
 extern syscall_handler_t sys_readahead;
 extern syscall_handler_t sys_tkill;
+extern syscall_handler_t sys_setxattr;
+extern syscall_handler_t sys_lsetxattr;
+extern syscall_handler_t sys_fsetxattr;
+extern syscall_handler_t sys_getxattr;
+extern syscall_handler_t sys_lgetxattr;
+extern syscall_handler_t sys_fgetxattr;
+extern syscall_handler_t sys_listxattr;
+extern syscall_handler_t sys_llistxattr;
+extern syscall_handler_t sys_flistxattr;
+extern syscall_handler_t sys_removexattr;
+extern syscall_handler_t sys_lremovexattr;
+extern syscall_handler_t sys_fremovexattr;
 extern syscall_handler_t sys_sendfile64;
 extern syscall_handler_t sys_futex;
 extern syscall_handler_t sys_sched_setaffinity;
 extern syscall_handler_t sys_sched_getaffinity;
+extern syscall_handler_t sys_set_thread_area;
+extern syscall_handler_t sys_get_thread_area;
 extern syscall_handler_t sys_io_setup;
 extern syscall_handler_t sys_io_destroy;
 extern syscall_handler_t sys_io_getevents;
 extern syscall_handler_t sys_io_submit;
 extern syscall_handler_t sys_io_cancel;
+extern syscall_handler_t sys_fadvise64;
 extern syscall_handler_t sys_exit_group;
 extern syscall_handler_t sys_lookup_dcookie;
 extern syscall_handler_t sys_epoll_create;
@@ -235,6 +248,20 @@
 extern syscall_handler_t sys_epoll_wait;
 extern syscall_handler_t sys_remap_file_pages;
 extern syscall_handler_t sys_set_tid_address;
+extern syscall_handler_t sys_timer_create;
+extern syscall_handler_t sys_timer_settime;
+extern syscall_handler_t sys_timer_gettime;
+extern syscall_handler_t sys_timer_getoverrun;
+extern syscall_handler_t sys_timer_delete;
+extern syscall_handler_t sys_clock_settime;
+extern syscall_handler_t sys_clock_gettime;
+extern syscall_handler_t sys_clock_getres;
+extern syscall_handler_t sys_clock_nanosleep;
+extern syscall_handler_t sys_statfs64;
+extern syscall_handler_t sys_fstatfs64;
+extern syscall_handler_t sys_tgkill;
+extern syscall_handler_t sys_utimes;
+extern syscall_handler_t sys_fadvise64_64;
 
 #ifdef CONFIG_NFSD
 #define NFSSERVCTL sys_nfsservctl
@@ -246,7 +273,7 @@
 extern syscall_handler_t um_time;
 extern syscall_handler_t um_stime;
 
-#define LAST_GENERIC_SYSCALL __NR_set_tid_address
+#define LAST_GENERIC_SYSCALL __NR_vserver
 
 #if LAST_GENERIC_SYSCALL > LAST_ARCH_SYSCALL
 #define LAST_SYSCALL LAST_GENERIC_SYSCALL
@@ -413,7 +440,7 @@
 	[ __NR_munlockall ] = sys_munlockall,
 	[ __NR_sched_setparam ] = sys_sched_setparam,
 	[ __NR_sched_getparam ] = sys_sched_getparam,
-	[ __NR_sched_setscheduler ] = sys_sched_setscheduler,
+	[ __NR_sched_setscheduler ] = (syscall_handler_t *) sys_sched_setscheduler,
 	[ __NR_sched_getscheduler ] = sys_sched_getscheduler,
 	[ __NR_sched_yield ] = (syscall_handler_t *) yield,
 	[ __NR_sched_get_priority_max ] = sys_sched_get_priority_max,
@@ -455,32 +482,37 @@
 	[ __NR_stat64 ] = sys_stat64,
 	[ __NR_lstat64 ] = sys_lstat64,
 	[ __NR_fstat64 ] = sys_fstat64,
-	[ __NR_fcntl64 ] = sys_fcntl64,
 	[ __NR_getdents64 ] = sys_getdents64,
+	[ __NR_fcntl64 ] = sys_fcntl64,
+	[ 223 ] = sys_ni_syscall,
 	[ __NR_gettid ] = sys_gettid,
 	[ __NR_readahead ] = sys_readahead,
-	[ __NR_setxattr ] = sys_ni_syscall,
-	[ __NR_lsetxattr ] = sys_ni_syscall,
-	[ __NR_fsetxattr ] = sys_ni_syscall,
-	[ __NR_getxattr ] = sys_ni_syscall,
-	[ __NR_lgetxattr ] = sys_ni_syscall,
-	[ __NR_fgetxattr ] = sys_ni_syscall,
-	[ __NR_listxattr ] = sys_ni_syscall,
-	[ __NR_llistxattr ] = sys_ni_syscall,
-	[ __NR_flistxattr ] = sys_ni_syscall,
-	[ __NR_removexattr ] = sys_ni_syscall,
-	[ __NR_lremovexattr ] = sys_ni_syscall,
-	[ __NR_fremovexattr ] = sys_ni_syscall,
+	[ __NR_setxattr ] = sys_setxattr,
+	[ __NR_lsetxattr ] = sys_lsetxattr,
+	[ __NR_fsetxattr ] = sys_fsetxattr,
+	[ __NR_getxattr ] = sys_getxattr,
+	[ __NR_lgetxattr ] = sys_lgetxattr,
+	[ __NR_fgetxattr ] = sys_fgetxattr,
+	[ __NR_listxattr ] = sys_listxattr,
+	[ __NR_llistxattr ] = sys_llistxattr,
+	[ __NR_flistxattr ] = sys_flistxattr,
+	[ __NR_removexattr ] = sys_removexattr,
+	[ __NR_lremovexattr ] = sys_lremovexattr,
+	[ __NR_fremovexattr ] = sys_fremovexattr,
 	[ __NR_tkill ] = sys_tkill,
 	[ __NR_sendfile64 ] = sys_sendfile64,
 	[ __NR_futex ] = sys_futex,
 	[ __NR_sched_setaffinity ] = sys_sched_setaffinity,
 	[ __NR_sched_getaffinity ] = sys_sched_getaffinity,
+	[ __NR_set_thread_area ] = sys_ni_syscall,
+	[ __NR_get_thread_area ] = sys_ni_syscall,
 	[ __NR_io_setup ] = sys_io_setup,
 	[ __NR_io_destroy ] = sys_io_destroy,
 	[ __NR_io_getevents ] = sys_io_getevents,
 	[ __NR_io_submit ] = sys_io_submit,
 	[ __NR_io_cancel ] = sys_io_cancel,
+	[ __NR_fadvise64 ] = sys_fadvise64,
+	[ 251 ] = sys_ni_syscall,
 	[ __NR_exit_group ] = sys_exit_group,
 	[ __NR_lookup_dcookie ] = sys_lookup_dcookie,
 	[ __NR_epoll_create ] = sys_epoll_create,
@@ -488,6 +520,21 @@
 	[ __NR_epoll_wait ] = sys_epoll_wait,
         [ __NR_remap_file_pages ] = sys_remap_file_pages,
         [ __NR_set_tid_address ] = sys_set_tid_address,
+	[ __NR_timer_create ] = sys_timer_create,
+	[ __NR_timer_settime ] = sys_timer_settime,
+	[ __NR_timer_gettime ] = sys_timer_gettime,
+	[ __NR_timer_getoverrun ] = sys_timer_getoverrun,
+	[ __NR_timer_delete ] = sys_timer_delete,
+	[ __NR_clock_settime ] = sys_clock_settime,
+	[ __NR_clock_gettime ] = sys_clock_gettime,
+	[ __NR_clock_getres ] = sys_clock_getres,
+	[ __NR_clock_nanosleep ] = sys_clock_nanosleep,
+	[ __NR_statfs64 ] = sys_statfs64,
+	[ __NR_fstatfs64 ] = sys_fstatfs64,
+	[ __NR_tgkill ] = sys_tgkill,
+	[ __NR_utimes ] = sys_utimes,
+	[ __NR_fadvise64_64 ] = sys_fadvise64_64,
+	[ __NR_vserver ] = sys_ni_syscall,
 
 	ARCH_SYSCALLS
 	[ LAST_SYSCALL + 1 ... NR_syscalls ] = 
--- diff/arch/um/kernel/syscall_kern.c	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/um/kernel/syscall_kern.c	2004-02-09 10:39:51.000000000 +0000
@@ -1,5 +1,5 @@
 /* 
- * Copyright (C) 2000 Jeff Dike (jdike@karaya.com)
+ * Copyright (C) 2000 - 2003 Jeff Dike (jdike@addtoit.com)
  * Licensed under the GPL
  */
 
@@ -35,39 +35,40 @@
 
 long sys_fork(void)
 {
-	struct task_struct *p;
+	long ret;
 
 	current->thread.forking = 1;
-        p = do_fork(SIGCHLD, 0, NULL, 0, NULL, NULL);
+        ret = do_fork(SIGCHLD, 0, NULL, 0, NULL, NULL);
 	current->thread.forking = 0;
-	return(IS_ERR(p) ? PTR_ERR(p) : p->pid);
+	return(ret);
 }
 
-long sys_clone(unsigned long clone_flags, unsigned long newsp)
+long sys_clone(unsigned long clone_flags, unsigned long newsp, 
+	       int *parent_tid, int *child_tid)
 {
-	struct task_struct *p;
+	long ret;
 
 	current->thread.forking = 1;
-	p = do_fork(clone_flags, newsp, NULL, 0, NULL, NULL);
+	ret = do_fork(clone_flags, newsp, NULL, 0, parent_tid, child_tid);
 	current->thread.forking = 0;
-	return(IS_ERR(p) ? PTR_ERR(p) : p->pid);
+	return(ret);
 }
 
 long sys_vfork(void)
 {
-	struct task_struct *p;
+	long ret;
 
 	current->thread.forking = 1;
-	p = do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, 0, NULL, 0, NULL, NULL);
+	ret = do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, 0, NULL, 0, NULL, 
+		      NULL);
 	current->thread.forking = 0;
-	return(IS_ERR(p) ? PTR_ERR(p) : p->pid);
+	return(ret);
 }
 
 /* common code for old and new mmaps */
-static inline long do_mmap2(
-	unsigned long addr, unsigned long len,
-	unsigned long prot, unsigned long flags,
-	unsigned long fd, unsigned long pgoff)
+long do_mmap2(struct mm_struct *mm, unsigned long addr, unsigned long len,
+	      unsigned long prot, unsigned long flags, unsigned long fd,
+	      unsigned long pgoff)
 {
 	int error = -EBADF;
 	struct file * file = NULL;
@@ -79,9 +80,9 @@
 			goto out;
 	}
 
-	down_write(&current->mm->mmap_sem);
+	down_write(&mm->mmap_sem);
 	error = do_mmap_pgoff(file, addr, len, prot, flags, pgoff);
-	up_write(&current->mm->mmap_sem);
+	up_write(&mm->mmap_sem);
 
 	if (file)
 		fput(file);
@@ -93,7 +94,7 @@
 	       unsigned long prot, unsigned long flags,
 	       unsigned long fd, unsigned long pgoff)
 {
-	return do_mmap2(addr, len, prot, flags, fd, pgoff);
+	return do_mmap2(current->mm, addr, len, prot, flags, fd, pgoff);
 }
 
 /*
@@ -120,7 +121,8 @@
 	if (offset & ~PAGE_MASK)
 		goto out;
 
-	err = do_mmap2(addr, len, prot, flags, fd, offset >> PAGE_SHIFT);
+	err = do_mmap2(current->mm, addr, len, prot, flags, fd, 
+		       offset >> PAGE_SHIFT);
  out:
 	return err;
 }
@@ -135,43 +137,12 @@
 
         error = do_pipe(fd);
         if (!error) {
-                if (copy_to_user(fildes, fd, 2*sizeof(int)))
+		if (copy_to_user(fildes, fd, sizeof(fd)))
                         error = -EFAULT;
         }
         return error;
 }
 
-int sys_sigaction(int sig, const struct old_sigaction *act,
-			 struct old_sigaction *oact)
-{
-	struct k_sigaction new_ka, old_ka;
-	int ret;
-
-	if (act) {
-		old_sigset_t mask;
-		if (verify_area(VERIFY_READ, act, sizeof(*act)) ||
-		    __get_user(new_ka.sa.sa_handler, &act->sa_handler) ||
-		    __get_user(new_ka.sa.sa_restorer, &act->sa_restorer))
-			return -EFAULT;
-		__get_user(new_ka.sa.sa_flags, &act->sa_flags);
-		__get_user(mask, &act->sa_mask);
-		siginitset(&new_ka.sa.sa_mask, mask);
-	}
-
-	ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);
-
-	if (!ret && oact) {
-		if (verify_area(VERIFY_WRITE, oact, sizeof(*oact)) ||
-		    __put_user(old_ka.sa.sa_handler, &oact->sa_handler) ||
-		    __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer))
-			return -EFAULT;
-		__put_user(old_ka.sa.sa_flags, &oact->sa_flags);
-		__put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask);
-	}
-
-	return ret;
-}
-
 /*
  * sys_ipc() is the de-multiplexer for the SysV IPC calls..
  *
@@ -253,7 +224,7 @@
 		return sys_shmctl (first, second,
 				   (struct shmid_ds *) ptr);
 	default:
-		return -EINVAL;
+		return -ENOSYS;
 	}
 }
 
@@ -302,11 +273,6 @@
 	return error;
 }
 
-int sys_sigaltstack(const stack_t *uss, stack_t *uoss)
-{
-	return(do_sigaltstack(uss, uoss, PT_REGS_SP(&current->thread.regs)));
-}
-
 long execute_syscall(void *r)
 {
 	return(CHOOSE_MODE_PROC(execute_syscall_tt, execute_syscall_skas, r));
--- diff/arch/um/kernel/sysrq.c	2003-10-09 09:47:33.000000000 +0100
+++ source/arch/um/kernel/sysrq.c	2004-02-09 10:39:51.000000000 +0000
@@ -55,6 +55,14 @@
 	show_trace((unsigned long *)esp);
 }
 
+void show_stack(struct task_struct *task, unsigned long *sp)
+{
+	if(task)
+		show_trace_task(task);
+	else
+		show_trace(sp);
+}
+
 /*
  * Overrides for Emacs so that we follow Linus's tabbing style.
  * Emacs will notice this stuff at the end of the file and automatically
--- diff/arch/um/kernel/tempfile.c	2003-02-13 11:46:50.000000000 +0000
+++ source/arch/um/kernel/tempfile.c	2004-02-09 10:39:51.000000000 +0000
@@ -28,6 +28,7 @@
 	}
 	if((dir == NULL) || (*dir == '\0')) 
 		dir = "/tmp";
+
 	tempdir = malloc(strlen(dir) + 2);
 	if(tempdir == NULL){
 		fprintf(stderr, "Failed to malloc tempdir, "
@@ -49,7 +50,8 @@
 	else
 		*tempname = 0;
 	strcat(tempname, template);
-	if((fd = mkstemp(tempname)) < 0){
+	fd = mkstemp(tempname);
+	if(fd < 0){
 		fprintf(stderr, "open - cannot create %s: %s\n", tempname, 
 			strerror(errno));
 		return -1;
@@ -59,7 +61,8 @@
 		return -1;
 	}
 	if(out_tempname){
-		if((*out_tempname = strdup(tempname)) == NULL){
+		*out_tempname = strdup(tempname);
+		if(*out_tempname == NULL){
 			perror("strdup");
 			return -1;
 		}
--- diff/arch/um/kernel/time.c	2003-10-09 09:47:33.000000000 +0100
+++ source/arch/um/kernel/time.c	2004-02-09 10:39:51.000000000 +0000
@@ -4,24 +4,33 @@
  */
 
 #include <stdio.h>
+#include <stdlib.h>
 #include <unistd.h>
 #include <time.h>
 #include <sys/time.h>
 #include <signal.h>
 #include <errno.h>
-#include "linux/module.h"
 #include "user_util.h"
 #include "kern_util.h"
 #include "user.h"
 #include "process.h"
 #include "signal_user.h"
 #include "time_user.h"
+#include "kern_constants.h"
+
+/* XXX This really needs to be declared and initialized in a kernel file since 
+ * it's in <linux/time.h>
+ */
+extern struct timespec wall_to_monotonic;
 
 extern struct timeval xtime;
 
+struct timeval local_offset = { 0, 0 };
+
 void timer(void)
 {
 	gettimeofday(&xtime, NULL);
+	timeradd(&xtime, &local_offset, &xtime);
 }
 
 void set_interval(int timer_type)
@@ -66,7 +75,7 @@
 		       errno);
 }
 
-void idle_timer(void)
+void uml_idle_timer(void)
 {
 	if(signal(SIGVTALRM, SIG_IGN) == SIG_ERR)
 		panic("Couldn't unset SIGVTALRM handler");
@@ -76,14 +85,54 @@
 	set_interval(ITIMER_REAL);
 }
 
+static unsigned long long get_host_hz(void)
+{
+	char mhzline[16], *end;
+	int ret, mult, mhz, rest, len;
+
+	ret = cpu_feature("cpu MHz", mhzline, 
+			  sizeof(mhzline) / sizeof(mhzline[0]));
+	if(!ret)
+		panic ("Could not get host MHZ");
+
+	mhz = strtoul(mhzline, &end, 10);
+
+	/* This business is to parse a floating point number without using
+	 * floating types.
+	 */
+
+	rest = 0;
+	mult = 0;
+	if(*end == '.'){
+		end++;
+		len = strlen(end);
+		if(len < 6)
+			mult = 6 - len;
+		else if(len > 6)
+			end[6] = '\0';
+		rest = strtoul(end, NULL, 10);
+		while(mult-- > 0)
+			rest *= 10;
+	}
+
+	return(1000000 * mhz + rest);
+}
+
+unsigned long long host_hz = 0;
+
 void time_init(void)
 {
+	struct timespec now;
+ 
+	host_hz = get_host_hz();
 	if(signal(SIGVTALRM, boot_timer_handler) == SIG_ERR)
 		panic("Couldn't set SIGVTALRM handler");
 	set_interval(ITIMER_VIRTUAL);
-}
 
-struct timeval local_offset = { 0, 0 };
+	do_posix_clock_monotonic_gettime(&now);
+	wall_to_monotonic.tv_sec = -now.tv_sec;
+	wall_to_monotonic.tv_nsec = -now.tv_nsec;
+}
 
 void do_gettimeofday(struct timeval *tv)
 {
@@ -95,15 +144,13 @@
 	time_unlock(flags);
 }
 
-EXPORT_SYMBOL(do_gettimeofday);
-
 int do_settimeofday(struct timespec *tv)
 {
 	struct timeval now;
 	unsigned long flags;
 	struct timeval tv_in;
 
-	if ((unsigned long)tv->tv_nsec >= NSEC_PER_SEC)
+	if ((unsigned long) tv->tv_nsec >= UM_NSEC_PER_SEC)
 		return -EINVAL;
 
 	tv_in.tv_sec = tv->tv_sec;
@@ -113,9 +160,9 @@
 	gettimeofday(&now, NULL);
 	timersub(&tv_in, &now, &local_offset);
 	time_unlock(flags);
-}
 
-EXPORT_SYMBOL(do_settimeofday);
+	return(0);
+}
 
 void idle_sleep(int secs)
 {
--- diff/arch/um/kernel/time_kern.c	2003-10-09 09:47:33.000000000 +0100
+++ source/arch/um/kernel/time_kern.c	2004-02-09 10:39:51.000000000 +0000
@@ -30,6 +30,14 @@
 	return(HZ);
 }
 
+/*
+ * Scheduler clock - returns current time in nanosec units.
+ */
+unsigned long long sched_clock(void)
+{
+	return (unsigned long long)jiffies_64 * (1000000000 / HZ);
+}
+
 /* Changed at early boot */
 int timer_irq_inited = 0;
 
@@ -39,13 +47,47 @@
  */
 int __attribute__ ((__section__ (".unprotected"))) missed_ticks[NR_CPUS];
 
+static int first_tick;
+static unsigned long long prev_tsc;
+static long long delta;   		/* Deviation per interval */
+
+extern unsigned long long host_hz;
+
 void timer_irq(union uml_pt_regs *regs)
 {
-	int cpu = current->thread_info->cpu, ticks = missed_ticks[cpu];
+	unsigned long long ticks = 0;
+
+	if(!timer_irq_inited){
+		/* This is to ensure that ticks don't pile up when
+		 * the timer handler is suspended */
+		first_tick = 0;
+		return;
+	}
+
+	if(first_tick){
+#if defined(CONFIG_UML_REAL_TIME_CLOCK)
+		unsigned long long tsc;
+		/* We've had 1 tick */
+		tsc = time_stamp();
+
+		delta += tsc - prev_tsc;
+		prev_tsc = tsc;
+
+		ticks += (delta * HZ) / host_hz;
+		delta -= (ticks * host_hz) / HZ;
+#else
+		ticks = 1;
+#endif
+	}
+	else {
+		prev_tsc = time_stamp();
+		first_tick = 1;
+	}
 
-        if(!timer_irq_inited) return;
-	missed_ticks[cpu] = 0;
-	while(ticks--) do_IRQ(TIMER_IRQ, regs);
+	while(ticks > 0){
+		do_IRQ(TIMER_IRQ, regs);
+		ticks--;
+	}
 }
 
 void boot_timer_handler(int sig)
@@ -58,12 +100,13 @@
 	do_timer(&regs);
 }
 
-void um_timer(int irq, void *dev, struct pt_regs *regs)
+irqreturn_t um_timer(int irq, void *dev, struct pt_regs *regs)
 {
 	do_timer(regs);
-	write_seqlock(&xtime_lock);
+	write_seqlock_irq(&xtime_lock);
 	timer();
-	write_sequnlock(&xtime_lock);
+	write_sequnlock_irq(&xtime_lock);
+	return(IRQ_HANDLED);
 }
 
 long um_time(int * tloc)
@@ -81,12 +124,12 @@
 long um_stime(int * tptr)
 {
 	int value;
-	struct timeval new;
+	struct timespec new;
 
 	if (get_user(value, tptr))
                 return -EFAULT;
 	new.tv_sec = value;
-	new.tv_usec = 0;
+	new.tv_nsec = 0;
 	do_settimeofday(&new);
 	return 0;
 }
@@ -125,9 +168,11 @@
 void timer_handler(int sig, union uml_pt_regs *regs)
 {
 #ifdef CONFIG_SMP
+	local_irq_disable();
 	update_process_times(user_context(UPT_SP(regs)));
+	local_irq_enable();
 #endif
-	if(current->thread_info->cpu == 0)
+	if(current_thread->cpu == 0)
 		timer_irq(regs);
 }
 
@@ -136,6 +181,7 @@
 unsigned long time_lock(void)
 {
 	unsigned long flags;
+
 	spin_lock_irqsave(&timer_spinlock, flags);
 	return(flags);
 }
@@ -150,8 +196,8 @@
 	int err;
 
 	CHOOSE_MODE(user_time_init_tt(), user_time_init_skas());
-	if((err = request_irq(TIMER_IRQ, um_timer, SA_INTERRUPT, "timer", 
-			      NULL)) != 0)
+	err = request_irq(TIMER_IRQ, um_timer, SA_INTERRUPT, "timer", NULL);
+	if(err != 0)
 		printk(KERN_ERR "timer_init : request_irq failed - "
 		       "errno = %d\n", -err);
 	timer_irq_inited = 1;
@@ -160,7 +206,6 @@
 
 __initcall(timer_init);
 
-
 /*
  * Overrides for Emacs so that we follow Linus's tabbing style.
  * Emacs will notice this stuff at the end of the file and automatically
--- diff/arch/um/kernel/trap_kern.c	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/um/kernel/trap_kern.c	2004-02-09 10:39:51.000000000 +0000
@@ -16,12 +16,15 @@
 #include "asm/tlbflush.h"
 #include "asm/a.out.h"
 #include "asm/current.h"
+#include "asm/irq.h"
 #include "user_util.h"
 #include "kern_util.h"
 #include "kern.h"
 #include "chan_kern.h"
 #include "mconsole_kern.h"
 #include "2_5compat.h"
+#include "mem.h"
+#include "mem_kern.h"
 
 int handle_page_fault(unsigned long address, unsigned long ip, 
 		      int is_write, int is_user, int *code_out)
@@ -51,12 +54,12 @@
 	if(is_write && !(vma->vm_flags & VM_WRITE)) 
 		goto out;
 	page = address & PAGE_MASK;
-	if(page == (unsigned long) current->thread_info + PAGE_SIZE)
+	if(page == (unsigned long) current_thread + PAGE_SIZE)
 		panic("Kernel stack overflow");
 	pgd = pgd_offset(mm, page);
 	pmd = pmd_offset(pgd, page);
- survive:
 	do {
+ survive:
 		switch (handle_mm_fault(mm, vma, address, is_write)){
 		case VM_FAULT_MINOR:
 			current->min_flt++;
@@ -71,14 +74,20 @@
 			err = -ENOMEM;
 			goto out_of_memory;
 		default:
-			BUG();
+			if (current->pid == 1) {
+				up_read(&mm->mmap_sem);
+				yield();
+				down_read(&mm->mmap_sem);
+				goto survive;
+			}
+			goto out;
 		}
 		pte = pte_offset_kernel(pmd, page);
 	} while(!pte_present(*pte));
+	err = 0;
 	*pte = pte_mkyoung(*pte);
 	if(pte_write(*pte)) *pte = pte_mkdirty(*pte);
 	flush_tlb_page(vma, page);
-	err = 0;
  out:
 	up_read(&mm->mmap_sem);
 	return(err);
@@ -98,6 +107,33 @@
 	goto out;
 }
 
+LIST_HEAD(physmem_remappers);
+
+void register_remapper(struct remapper *info)
+{
+	list_add(&info->list, &physmem_remappers);
+}
+
+static int check_remapped_addr(unsigned long address, int is_write)
+{
+	struct remapper *remapper;
+	struct list_head *ele;
+	__u64 offset;
+	int fd;
+
+	fd = phys_mapping(__pa(address), &offset);
+	if(fd == -1)
+		return(0);
+
+	list_for_each(ele, &physmem_remappers){
+		remapper = list_entry(ele, struct remapper, list);
+		if((*remapper->proc)(fd, address, is_write, offset))
+			return(1);
+	}
+
+	return(0);
+}
+
 unsigned long segv(unsigned long address, unsigned long ip, int is_write, 
 		   int is_user, void *sc)
 {
@@ -109,7 +145,9 @@
                 flush_tlb_kernel_vm();
                 return(0);
         }
-        if(current->mm == NULL)
+	else if(check_remapped_addr(address & PAGE_MASK, is_write))
+		return(0);
+	else if(current->mm == NULL)
 		panic("Segfault with no mm");
 	err = handle_page_fault(address, ip, is_write, is_user, &si.si_code);
 
@@ -120,9 +158,8 @@
 		current->thread.fault_addr = (void *) address;
 		do_longjmp(catcher, 1);
 	} 
-	else if(current->thread.fault_addr != NULL){
+	else if(current->thread.fault_addr != NULL)
 		panic("fault_addr set but no fault catcher");
-	}
 	else if(arch_fixup(ip, sc))
 		return(0);
 
@@ -155,8 +192,6 @@
 {
 	struct siginfo si;
 
-	printk(KERN_ERR "Unfixable SEGV in '%s' (pid %d) at 0x%lx "
-	       "(ip 0x%lx)\n", current->comm, current->pid, address, ip);
 	si.si_signo = SIGSEGV;
 	si.si_code = SEGV_ACCERR;
 	si.si_addr = (void *) address;
@@ -180,6 +215,11 @@
 	else relay_signal(sig, regs);
 }
 
+void winch(int sig, union uml_pt_regs *regs)
+{
+	do_IRQ(WINCH_IRQ, regs);
+}
+
 void trap_init(void)
 {
 }
--- diff/arch/um/kernel/trap_user.c	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/um/kernel/trap_user.c	2004-02-09 10:39:51.000000000 +0000
@@ -5,11 +5,9 @@
 
 #include <stdlib.h>
 #include <errno.h>
-#include <fcntl.h>
 #include <setjmp.h>
 #include <signal.h>
 #include <sys/time.h>
-#include <sys/ioctl.h>
 #include <sys/ptrace.h>
 #include <sys/wait.h>
 #include <asm/page.h>
@@ -82,6 +80,8 @@
 		     .is_irq 		= 0 },
 	[ SIGILL ] { .handler 		= relay_signal,
 		     .is_irq 		= 0 },
+	[ SIGWINCH ] { .handler		= winch,
+		       .is_irq		= 1 },
 	[ SIGBUS ] { .handler 		= bus_handler,
 		     .is_irq 		= 0 },
 	[ SIGSEGV] { .handler 		= segv_handler,
@@ -123,7 +123,7 @@
 {
 	jmp_buf *buf = b;
 
-	longjmp(*buf, val);
+	siglongjmp(*buf, val);
 }
 
 /*
--- diff/arch/um/kernel/tt/Makefile	2003-05-21 11:49:50.000000000 +0100
+++ source/arch/um/kernel/tt/Makefile	2004-02-09 10:39:51.000000000 +0000
@@ -1,5 +1,5 @@
 # 
-# Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
+# Copyright (C) 2002 - 2003 Jeff Dike (jdike@addtoit.com)
 # Licensed under the GPL
 #
 
@@ -7,7 +7,7 @@
 
 obj-y = exec_kern.o exec_user.o gdb.o ksyms.o mem.o mem_user.o process_kern.o \
 	syscall_kern.o syscall_user.o time.o tlb.o tracer.o trap_user.o \
-	uaccess_user.o sys-$(SUBARCH)/
+	uaccess.o uaccess_user.o sys-$(SUBARCH)/
 
 obj-$(CONFIG_PT_PROXY) += gdb_kern.o ptproxy/
 
--- diff/arch/um/kernel/tt/exec_kern.c	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/um/kernel/tt/exec_kern.c	2004-02-09 10:39:51.000000000 +0000
@@ -17,6 +17,7 @@
 #include "mem_user.h"
 #include "os.h"
 #include "tlb.h"
+#include "mode.h"
 
 static int exec_tramp(void *sig_stack)
 {
@@ -47,17 +48,17 @@
 		do_exit(SIGKILL);
 	}
 
-	if(current->thread_info->cpu == 0)
+	if(current_thread->cpu == 0)
 		forward_interrupts(new_pid);
 	current->thread.request.op = OP_EXEC;
 	current->thread.request.u.exec.pid = new_pid;
-	unprotect_stack((unsigned long) current->thread_info);
+	unprotect_stack((unsigned long) current_thread);
 	os_usr1_process(os_getpid());
 
 	enable_timer();
 	free_page(stack);
 	protect_memory(uml_reserved, high_physmem - uml_reserved, 1, 1, 0, 1);
-	task_protections((unsigned long) current->thread_info);
+	task_protections((unsigned long) current_thread);
 	force_flush_all();
 	unblock_signals();
 }
--- diff/arch/um/kernel/tt/include/mode.h	2003-02-13 11:46:50.000000000 +0000
+++ source/arch/um/kernel/tt/include/mode.h	2004-02-09 10:39:51.000000000 +0000
@@ -8,6 +8,8 @@
 
 #include "sysdep/ptrace.h"
 
+enum { OP_NONE, OP_EXEC, OP_FORK, OP_TRACE_ON, OP_REBOOT, OP_HALT, OP_CB };
+
 extern int tracing_pid;
 
 extern int tracer(int (*init_proc)(void *), void *sp);
--- diff/arch/um/kernel/tt/include/uaccess.h	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/um/kernel/tt/include/uaccess.h	2004-02-09 10:39:51.000000000 +0000
@@ -1,5 +1,5 @@
 /* 
- * Copyright (C) 2000, 2001 Jeff Dike (jdike@karaya.com)
+ * Copyright (C) 2000 - 2003 Jeff Dike (jdike@addtoit.com)
  * Licensed under the GPL
  */
 
@@ -43,65 +43,19 @@
 
 extern int __do_copy_from_user(void *to, const void *from, int n,
 			       void **fault_addr, void **fault_catcher);
-
-static inline int copy_from_user_tt(void *to, const void *from, int n)
-{
-	return(access_ok_tt(VERIFY_READ, from, n) ?
-	       __do_copy_from_user(to, from, n, 
-				   &current->thread.fault_addr,
-				   &current->thread.fault_catcher) : n);
-}
-
-static inline int copy_to_user_tt(void *to, const void *from, int n)
-{
-	return(access_ok_tt(VERIFY_WRITE, to, n) ?
-	       __do_copy_to_user(to, from, n, 
-				   &current->thread.fault_addr,
-				   &current->thread.fault_catcher) : n);
-}
-
 extern int __do_strncpy_from_user(char *dst, const char *src, size_t n,
 				  void **fault_addr, void **fault_catcher);
-
-static inline int strncpy_from_user_tt(char *dst, const char *src, int count)
-{
-	int n;
-
-	if(!access_ok_tt(VERIFY_READ, src, 1)) return(-EFAULT);
-	n = __do_strncpy_from_user(dst, src, count, 
-				   &current->thread.fault_addr,
-				   &current->thread.fault_catcher);
-	if(n < 0) return(-EFAULT);
-	return(n);
-}
-
 extern int __do_clear_user(void *mem, size_t len, void **fault_addr,
 			   void **fault_catcher);
-
-static inline int __clear_user_tt(void *mem, int len)
-{
-	return(__do_clear_user(mem, len,
-			       &current->thread.fault_addr,
-			       &current->thread.fault_catcher));
-}
-
-static inline int clear_user_tt(void *mem, int len)
-{
-	return(access_ok_tt(VERIFY_WRITE, mem, len) ? 
-	       __do_clear_user(mem, len, 
-			       &current->thread.fault_addr,
-			       &current->thread.fault_catcher) : len);
-}
-
 extern int __do_strnlen_user(const char *str, unsigned long n,
 			     void **fault_addr, void **fault_catcher);
 
-static inline int strnlen_user_tt(const void *str, int len)
-{
-	return(__do_strnlen_user(str, len,
-				 &current->thread.fault_addr,
-				 &current->thread.fault_catcher));
-}
+extern int copy_from_user_tt(void *to, const void *from, int n);
+extern int copy_to_user_tt(void *to, const void *from, int n);
+extern int strncpy_from_user_tt(char *dst, const char *src, int count);
+extern int __clear_user_tt(void *mem, int len);
+extern int clear_user_tt(void *mem, int len);
+extern int strnlen_user_tt(const void *str, int len);
 
 #endif
 
--- diff/arch/um/kernel/tt/mem_user.c	2003-02-13 11:46:50.000000000 +0000
+++ source/arch/um/kernel/tt/mem_user.c	2004-02-09 10:39:51.000000000 +0000
@@ -25,14 +25,13 @@
 	size = (unsigned long) segment_end - 
 		(unsigned long) segment_start;
 	data = create_mem_file(size);
-	if((addr = mmap(NULL, size, PROT_WRITE | PROT_READ, 
-			MAP_SHARED, data, 0)) == MAP_FAILED){
+	addr = mmap(NULL, size, PROT_WRITE | PROT_READ, MAP_SHARED, data, 0);
+	if(addr == MAP_FAILED){
 		perror("mapping new data segment");
 		exit(1);
 	}
 	memcpy(addr, segment_start, size);
-	if(switcheroo(data, prot, addr, segment_start, 
-		      size) < 0){
+	if(switcheroo(data, prot, addr, segment_start, size) < 0){
 		printf("switcheroo failed\n");
 		exit(1);
 	}
--- diff/arch/um/kernel/tt/process_kern.c	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/um/kernel/tt/process_kern.c	2004-02-09 10:39:51.000000000 +0000
@@ -62,7 +62,7 @@
 	reading = 0;
 	err = os_write_file(to->thread.mode.tt.switch_pipe[1], &c, sizeof(c));
 	if(err != sizeof(c))
-		panic("write of switch_pipe failed, errno = %d", -err);
+		panic("write of switch_pipe failed, err = %d", -err);
 
 	reading = 1;
 	if((from->state == TASK_ZOMBIE) || (from->state == TASK_DEAD))
@@ -104,48 +104,72 @@
 
 void release_thread_tt(struct task_struct *task)
 {
-	os_kill_process(task->thread.mode.tt.extern_pid, 0);
+	int pid = task->thread.mode.tt.extern_pid;
+
+	if(os_getpid() != pid)
+		os_kill_process(pid, 0);
 }
 
 void exit_thread_tt(void)
 {
-	close(current->thread.mode.tt.switch_pipe[0]);
-	close(current->thread.mode.tt.switch_pipe[1]);
+	os_close_file(current->thread.mode.tt.switch_pipe[0]);
+	os_close_file(current->thread.mode.tt.switch_pipe[1]);
 }
 
 void schedule_tail(task_t *prev);
 
 static void new_thread_handler(int sig)
 {
+	unsigned long disable;
 	int (*fn)(void *);
 	void *arg;
 
 	fn = current->thread.request.u.thread.proc;
 	arg = current->thread.request.u.thread.arg;
+
 	UPT_SC(&current->thread.regs.regs) = (void *) (&sig + 1);
+	disable = (1 << (SIGVTALRM - 1)) | (1 << (SIGALRM - 1)) |
+		(1 << (SIGIO - 1)) | (1 << (SIGPROF - 1));
+	SC_SIGMASK(UPT_SC(&current->thread.regs.regs)) &= ~disable;
+
 	suspend_new_thread(current->thread.mode.tt.switch_pipe[0]);
 
-	block_signals();
+	force_flush_all();
+	if(current->thread.prev_sched != NULL)
+		schedule_tail(current->thread.prev_sched);
+	current->thread.prev_sched = NULL;
+
 	init_new_thread_signals(1);
-#ifdef CONFIG_SMP
-	schedule_tail(current->thread.prev_sched);
-#endif
 	enable_timer();
 	free_page(current->thread.temp_stack);
 	set_cmdline("(kernel thread)");
-	force_flush_all();
 
-	current->thread.prev_sched = NULL;
 	change_sig(SIGUSR1, 1);
 	change_sig(SIGVTALRM, 1);
 	change_sig(SIGPROF, 1);
-	unblock_signals();
+	local_irq_enable();
 	if(!run_kernel_thread(fn, arg, &current->thread.exec_buf))
 		do_exit(0);
 }
 
 static int new_thread_proc(void *stack)
 {
+	/* local_irq_disable is needed to block out signals until this thread is
+	 * properly scheduled.  Otherwise, the tracing thread will get mighty 
+	 * upset about any signals that arrive before that.  
+	 * This has the complication that it sets the saved signal mask in
+	 * the sigcontext to block signals.  This gets restored when this
+	 * thread (or a descendant, since they get a copy of this sigcontext)
+	 * returns to userspace.
+	 * So, this is compensated for elsewhere.
+	 * XXX There is still a small window until local_irq_disable() actually 
+	 * finishes where signals are possible - shouldn't be a problem in 
+	 * practice since SIGIO hasn't been forwarded here yet, and the 
+	 * local_irq_disable should finish before a SIGVTALRM has time to be 
+	 * delivered.
+	 */
+
+	local_irq_disable();
 	init_new_thread_stack(stack, new_thread_handler);
 	os_usr1_process(os_getpid());
 	return(0);
@@ -156,7 +180,7 @@
  * itself with a SIGUSR1.  set_user_mode has to be run with SIGUSR1 off,
  * so it is blocked before it's called.  They are re-enabled on sigreturn
  * despite the fact that they were blocked when the SIGUSR1 was issued because
- * copy_thread copies the parent's signcontext, including the signal mask
+ * copy_thread copies the parent's sigcontext, including the signal mask
  * onto the signal frame.
  */
 
@@ -165,35 +189,32 @@
  	UPT_SC(&current->thread.regs.regs) = (void *) (&sig + 1);
 	suspend_new_thread(current->thread.mode.tt.switch_pipe[0]);
 
-#ifdef CONFIG_SMP	
-	schedule_tail(NULL);
-#endif
+	force_flush_all();
+	if(current->thread.prev_sched != NULL)
+		schedule_tail(current->thread.prev_sched);
+	current->thread.prev_sched = NULL;
+
 	enable_timer();
 	change_sig(SIGVTALRM, 1);
 	local_irq_enable();
-	force_flush_all();
 	if(current->mm != current->parent->mm)
 		protect_memory(uml_reserved, high_physmem - uml_reserved, 1, 
 			       1, 0, 1);
-	task_protections((unsigned long) current->thread_info);
-
-	current->thread.prev_sched = NULL;
+	task_protections((unsigned long) current_thread);
 
 	free_page(current->thread.temp_stack);
+	local_irq_disable();
 	change_sig(SIGUSR1, 0);
 	set_user_mode(current);
 }
 
-static int sigusr1 = SIGUSR1;
-
 int fork_tramp(void *stack)
 {
-	int sig = sigusr1;
-
 	local_irq_disable();
+	arch_init_thread();
 	init_new_thread_stack(stack, finish_fork_handler);
 
-	kill(os_getpid(), sig);
+	os_usr1_process(os_getpid());
 	return(0);
 }
 
@@ -213,8 +234,8 @@
 	}
 
 	err = os_pipe(p->thread.mode.tt.switch_pipe, 1, 1);
-	if(err){
-		printk("copy_thread : pipe failed, errno = %d\n", -err);
+	if(err < 0){
+		printk("copy_thread : pipe failed, err = %d\n", -err);
 		return(err);
 	}
 
@@ -377,8 +398,8 @@
 
 	pages = (1 << CONFIG_KERNEL_STACK_ORDER);
 
-	start = (unsigned long) current->thread_info + PAGE_SIZE;
-	end = (unsigned long) current + PAGE_SIZE * pages;
+	start = (unsigned long) current_thread + PAGE_SIZE;
+	end = (unsigned long) current_thread + PAGE_SIZE * pages;
 	protect_memory(uml_reserved, start - uml_reserved, 1, w, 1, 1);
 	protect_memory(end, high_physmem - end, 1, w, 1, 1);
 
@@ -454,8 +475,9 @@
 
 	init_task.thread.mode.tt.extern_pid = pid;
 	err = os_pipe(init_task.thread.mode.tt.switch_pipe, 1, 1);
-	if(err)	panic("Can't create switch pipe for init_task, errno = %d", 
-		      err);
+	if(err)	
+		panic("Can't create switch pipe for init_task, errno = %d", 
+		      -err);
 }
 
 int singlestepping_tt(void *t)
--- diff/arch/um/kernel/tt/ptproxy/proxy.c	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/um/kernel/tt/ptproxy/proxy.c	2004-02-09 10:39:51.000000000 +0000
@@ -15,7 +15,6 @@
 #include <unistd.h>
 #include <signal.h>
 #include <string.h>
-#include <fcntl.h>
 #include <termios.h>
 #include <sys/wait.h>
 #include <sys/types.h>
@@ -293,10 +292,10 @@
 }
 
 char gdb_init_string[] = 
-"att 1
-b panic
-b stop
-handle SIGWINCH nostop noprint pass
+"att 1 \n\
+b panic \n\
+b stop \n\
+handle SIGWINCH nostop noprint pass \n\
 ";
 
 int start_debugger(char *prog, int startup, int stop, int *fd_out)
@@ -304,7 +303,8 @@
 	int slave, child;
 
 	slave = open_gdb_chan();
-	if((child = fork()) == 0){
+	child = fork();
+	if(child == 0){
 		char *tempname = NULL;
 		int fd;
 
@@ -327,18 +327,19 @@
 			exit(1);
 #endif
 		}
-		if((fd = make_tempfile("/tmp/gdb_init-XXXXXX", &tempname, 0)) < 0){
-			printk("start_debugger : make_tempfile failed, errno = %d\n",
-			       errno);
+		fd = make_tempfile("/tmp/gdb_init-XXXXXX", &tempname, 0);
+		if(fd < 0){
+			printk("start_debugger : make_tempfile failed,"
+			       "err = %d\n", -fd);
 			exit(1);
 		}
-		write(fd, gdb_init_string, sizeof(gdb_init_string) - 1);
+		os_write_file(fd, gdb_init_string, sizeof(gdb_init_string) - 1);
 		if(startup){
 			if(stop){
-				write(fd, "b start_kernel\n",
+				os_write_file(fd, "b start_kernel\n",
 				      strlen("b start_kernel\n"));
 			}
-			write(fd, "c\n", strlen("c\n"));
+			os_write_file(fd, "c\n", strlen("c\n"));
 		}
 		if(ptrace(PTRACE_TRACEME, 0, 0, 0) < 0){
 			printk("start_debugger :  PTRACE_TRACEME failed, "
--- diff/arch/um/kernel/tt/ptproxy/sysdep.c	2003-01-02 10:43:05.000000000 +0000
+++ source/arch/um/kernel/tt/ptproxy/sysdep.c	2004-02-09 10:39:51.000000000 +0000
@@ -9,6 +9,7 @@
 #include <string.h>
 #include <stdlib.h>
 #include <signal.h>
+#include <errno.h>
 #include <sys/types.h>
 #include <sys/ptrace.h>
 #include <asm/ptrace.h>
--- diff/arch/um/kernel/tt/ptproxy/wait.c	2003-01-02 10:43:05.000000000 +0000
+++ source/arch/um/kernel/tt/ptproxy/wait.c	2004-02-09 10:39:51.000000000 +0000
@@ -56,21 +56,23 @@
 int real_wait_return(struct debugger *debugger)
 {
 	unsigned long ip;
-	int err, pid;
+	int pid;
 
 	pid = debugger->pid;
+
 	ip = ptrace(PTRACE_PEEKUSER, pid, PT_IP_OFFSET, 0);
 	ip = IP_RESTART_SYSCALL(ip);
-	err = ptrace(PTRACE_POKEUSER, pid, PT_IP_OFFSET, ip);
+
 	if(ptrace(PTRACE_POKEUSER, pid, PT_IP_OFFSET, ip) < 0)
 		tracer_panic("real_wait_return : Failed to restart system "
-			     "call, errno = %d\n");
+			     "call, errno = %d\n", errno);
+
 	if((ptrace(PTRACE_SYSCALL, debugger->pid, 0, SIGCHLD) < 0) ||
 	   (ptrace(PTRACE_SYSCALL, debugger->pid, 0, 0) < 0) ||
 	   (ptrace(PTRACE_SYSCALL, debugger->pid, 0, 0) < 0) ||
 	   debugger_normal_return(debugger, -1))
 		tracer_panic("real_wait_return : gdb failed to wait, "
-			     "errno = %d\n");
+			     "errno = %d\n", errno);
 	return(0);
 }
 
--- diff/arch/um/kernel/tt/syscall_kern.c	2003-02-26 16:01:01.000000000 +0000
+++ source/arch/um/kernel/tt/syscall_kern.c	2004-02-09 10:39:51.000000000 +0000
@@ -1,5 +1,5 @@
 /* 
- * Copyright (C) 2000 Jeff Dike (jdike@karaya.com)
+ * Copyright (C) 2000 - 2003 Jeff Dike (jdike@addtoit.com)
  * Licensed under the GPL
  */
 
--- diff/arch/um/kernel/tt/tracer.c	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/um/kernel/tt/tracer.c	2004-02-09 10:39:51.000000000 +0000
@@ -39,16 +39,17 @@
 		return(0);
 
 	register_winch_irq(tracer_winch[0], fd, -1, data);
-	return(0);
+	return(1);
 }
 
 static void tracer_winch_handler(int sig)
 {
+	int n;
 	char c = 1;
 
-	if(write(tracer_winch[1], &c, sizeof(c)) != sizeof(c))
-		printk("tracer_winch_handler - write failed, errno = %d\n",
-		       errno);
+	n = os_write_file(tracer_winch[1], &c, sizeof(c));
+	if(n != sizeof(c))
+		printk("tracer_winch_handler - write failed, err = %d\n", -n);
 }
 
 /* Called only by the tracing thread during initialization */
@@ -58,9 +59,8 @@
 	int err;
 
 	err = os_pipe(tracer_winch, 1, 1);
-	if(err){
-		printk("setup_tracer_winch : os_pipe failed, errno = %d\n", 
-		       -err);
+	if(err < 0){
+		printk("setup_tracer_winch : os_pipe failed, err = %d\n", -err);
 		return;
 	}
 	signal(SIGWINCH, tracer_winch_handler);
@@ -130,8 +130,8 @@
 	case SIGTSTP:
 		if(ptrace(PTRACE_CONT, pid, 0, sig) < 0)
 			tracer_panic("sleeping_process_signal : Failed to "
-				     "continue pid %d, errno = %d\n", pid,
-				     sig);
+				     "continue pid %d, signal = %d, "
+				     "errno = %d\n", pid, sig, errno);
 		break;
 
 	/* This happens when the debugger (e.g. strace) is doing system call 
@@ -145,7 +145,7 @@
 		if(ptrace(PTRACE_SYSCALL, pid, 0, 0) < 0)
 			tracer_panic("sleeping_process_signal : Failed to "
 				     "PTRACE_SYSCALL pid %d, errno = %d\n",
-				     pid, sig);
+				     pid, errno);
 		break;
 	case SIGSTOP:
 		break;
@@ -218,7 +218,7 @@
 			err = attach(debugger_parent);
 			if(err){
 				printf("Failed to attach debugger parent %d, "
-				       "errno = %d\n", debugger_parent, err);
+				       "errno = %d\n", debugger_parent, -err);
 				debugger_parent = -1;
 			}
 			else {
@@ -233,7 +233,8 @@
 	}
 	set_cmdline("(tracing thread)");
 	while(1){
-		if((pid = waitpid(-1, &status, WUNTRACED)) <= 0){
+		pid = waitpid(-1, &status, WUNTRACED);
+		if(pid <= 0){
 			if(errno != ECHILD){
 				printf("wait failed - errno = %d\n", errno);
 			}
@@ -401,7 +402,7 @@
 		
 		if(!strcmp(line, "go"))	debug_stop = 0;
 		else if(!strcmp(line, "parent")) debug_parent = 1;
-		else printk("Unknown debug option : '%s'\n", line);
+		else printf("Unknown debug option : '%s'\n", line);
 
 		line = next;
 	}
--- diff/arch/um/kernel/tt/uaccess_user.c	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/um/kernel/tt/uaccess_user.c	2004-02-09 10:39:51.000000000 +0000
@@ -8,15 +8,20 @@
 #include <string.h>
 #include "user_util.h"
 #include "uml_uaccess.h"
+#include "task.h"
+#include "kern_util.h"
 
 int __do_copy_from_user(void *to, const void *from, int n,
 			void **fault_addr, void **fault_catcher)
 {
+	struct tt_regs save = TASK_REGS(get_current())->tt;
 	unsigned long fault;
 	int faulted;
 
 	fault = __do_user_copy(to, from, n, fault_addr, fault_catcher,
 			       __do_copy, &faulted);
+	TASK_REGS(get_current())->tt = save;
+
 	if(!faulted) return(0);
 	else return(n - (fault - (unsigned long) from));
 }
@@ -29,11 +34,14 @@
 int __do_strncpy_from_user(char *dst, const char *src, unsigned long count,
 			   void **fault_addr, void **fault_catcher)
 {
+	struct tt_regs save = TASK_REGS(get_current())->tt;
 	unsigned long fault;
 	int faulted;
 
 	fault = __do_user_copy(dst, src, count, fault_addr, fault_catcher,
 			       __do_strncpy, &faulted);
+	TASK_REGS(get_current())->tt = save;
+
 	if(!faulted) return(strlen(dst));
 	else return(-1);
 }
@@ -46,11 +54,14 @@
 int __do_clear_user(void *mem, unsigned long len,
 		    void **fault_addr, void **fault_catcher)
 {
+	struct tt_regs save = TASK_REGS(get_current())->tt;
 	unsigned long fault;
 	int faulted;
 
 	fault = __do_user_copy(mem, NULL, len, fault_addr, fault_catcher,
 			       __do_clear, &faulted);
+	TASK_REGS(get_current())->tt = save;
+
 	if(!faulted) return(0);
 	else return(len - (fault - (unsigned long) mem));
 }
@@ -58,19 +69,20 @@
 int __do_strnlen_user(const char *str, unsigned long n,
 		      void **fault_addr, void **fault_catcher)
 {
+	struct tt_regs save = TASK_REGS(get_current())->tt;
 	int ret;
 	unsigned long *faddrp = (unsigned long *)fault_addr;
 	jmp_buf jbuf;
 
 	*fault_catcher = &jbuf;
-	if(setjmp(jbuf) == 0){
+	if(sigsetjmp(jbuf, 1) == 0)
 		ret = strlen(str) + 1;
-	} 
-	else {
-		ret = *faddrp - (unsigned long) str;
-	}
+	else ret = *faddrp - (unsigned long) str;
+
 	*fault_addr = NULL;
 	*fault_catcher = NULL;
+
+	TASK_REGS(get_current())->tt = save;
 	return ret;
 }
 
--- diff/arch/um/kernel/tt/unmap.c	2003-02-13 11:46:50.000000000 +0000
+++ source/arch/um/kernel/tt/unmap.c	2004-02-09 10:39:51.000000000 +0000
@@ -3,10 +3,7 @@
  * Licensed under the GPL
  */
 
-#include <stdio.h>
-#include <errno.h>
 #include <sys/mman.h>
-#include "user.h"
 
 int switcheroo(int fd, int prot, void *from, void *to, int size)
 {
--- diff/arch/um/kernel/tty_log.c	2003-01-02 10:43:05.000000000 +0000
+++ source/arch/um/kernel/tty_log.c	2004-02-09 10:39:51.000000000 +0000
@@ -9,10 +9,10 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <fcntl.h>
 #include <sys/time.h>
 #include "init.h"
 #include "user.h"
+#include "kern_util.h"
 #include "os.h"
 
 #define TTY_LOG_DIR "./"
@@ -24,29 +24,40 @@
 #define TTY_LOG_OPEN 1
 #define TTY_LOG_CLOSE 2
 #define TTY_LOG_WRITE 3
+#define TTY_LOG_EXEC 4
+
+#define TTY_READ 1
+#define TTY_WRITE 2
 
 struct tty_log_buf {
 	int what;
 	unsigned long tty;
 	int len;
+	int direction;
+	unsigned long sec;
+	unsigned long usec;
 };
 
-int open_tty_log(void *tty)
+int open_tty_log(void *tty, void *current_tty)
 {
 	struct timeval tv;
 	struct tty_log_buf data;
 	char buf[strlen(tty_log_dir) + sizeof("01234567890-01234567\0")];
 	int fd;
 
+	gettimeofday(&tv, NULL);
 	if(tty_log_fd != -1){
-		data = ((struct tty_log_buf) { what :	TTY_LOG_OPEN,
-					       tty : (unsigned long) tty,
-					       len : 0 });
-		write(tty_log_fd, &data, sizeof(data));
+		data = ((struct tty_log_buf) { .what 	= TTY_LOG_OPEN,
+					       .tty  = (unsigned long) tty,
+					       .len  = sizeof(current_tty),
+					       .direction = 0,
+					       .sec = tv.tv_sec,
+					       .usec = tv.tv_usec } );
+		os_write_file(tty_log_fd, &data, sizeof(data));
+		os_write_file(tty_log_fd, &current_tty, data.len);
 		return(tty_log_fd);
 	}
 
-	gettimeofday(&tv, NULL);
 	sprintf(buf, "%s/%0u-%0u", tty_log_dir, (unsigned int) tv.tv_sec, 
  		(unsigned int) tv.tv_usec);
 
@@ -62,30 +73,117 @@
 void close_tty_log(int fd, void *tty)
 {
 	struct tty_log_buf data;
+	struct timeval tv;
 
 	if(tty_log_fd != -1){
-		data = ((struct tty_log_buf) { what :	TTY_LOG_CLOSE,
-					       tty : (unsigned long) tty,
-					       len : 0 });
-		write(tty_log_fd, &data, sizeof(data));
+		gettimeofday(&tv, NULL);
+		data = ((struct tty_log_buf) { .what 	= TTY_LOG_CLOSE,
+					       .tty  = (unsigned long) tty,
+					       .len  = 0,
+					       .direction = 0,
+					       .sec = tv.tv_sec,
+					       .usec = tv.tv_usec } );
+		os_write_file(tty_log_fd, &data, sizeof(data));
 		return;
 	}
-	close(fd);
+	os_close_file(fd);
 }
 
-int write_tty_log(int fd, char *buf, int len, void *tty)
+static int log_chunk(int fd, const char *buf, int len)
 {
+	int total = 0, try, missed, n;
+	char chunk[64];
+
+	while(len > 0){
+		try = (len > sizeof(chunk)) ? sizeof(chunk) : len;
+		missed = copy_from_user_proc(chunk, (char *) buf, try);
+		try -= missed;
+		n = os_write_file(fd, chunk, try);
+		if(n != try) {
+			if(n < 0) 
+				return(n);
+			return(-EIO);
+		}
+		if(missed != 0)
+			return(-EFAULT);
+
+		len -= try;
+		total += try;
+		buf += try;
+	}
+
+	return(total);
+}
+
+int write_tty_log(int fd, const char *buf, int len, void *tty, int is_read)
+{
+	struct timeval tv;
 	struct tty_log_buf data;
+	int direction;
 
 	if(fd == tty_log_fd){
-		data = ((struct tty_log_buf) { what :	TTY_LOG_WRITE,
-					       tty : (unsigned long) tty,
-					       len : len });
-		write(tty_log_fd, &data, sizeof(data));
+		gettimeofday(&tv, NULL);
+		direction = is_read ? TTY_READ : TTY_WRITE;
+		data = ((struct tty_log_buf) { .what 	= TTY_LOG_WRITE,
+					       .tty  = (unsigned long) tty,
+					       .len  = len,
+					       .direction = direction,
+					       .sec = tv.tv_sec,
+					       .usec = tv.tv_usec } );
+		os_write_file(tty_log_fd, &data, sizeof(data));
 	}
-	return(write(fd, buf, len));
+
+	return(log_chunk(fd, buf, len));
 }
 
+void log_exec(char **argv, void *tty)
+{
+	struct timeval tv;
+	struct tty_log_buf data;
+	char **ptr,*arg;
+	int len;
+	
+	if(tty_log_fd == -1) return;
+
+	gettimeofday(&tv, NULL);
+
+	len = 0;
+	for(ptr = argv; ; ptr++){
+		if(copy_from_user_proc(&arg, ptr, sizeof(arg)))
+			return;
+		if(arg == NULL) break;
+		len += strlen_user_proc(arg);
+	}
+
+	data = ((struct tty_log_buf) { .what 	= TTY_LOG_EXEC,
+				       .tty  = (unsigned long) tty,
+				       .len  = len,
+				       .direction = 0,
+				       .sec = tv.tv_sec,
+				       .usec = tv.tv_usec } );
+	os_write_file(tty_log_fd, &data, sizeof(data));
+
+	for(ptr = argv; ; ptr++){
+		if(copy_from_user_proc(&arg, ptr, sizeof(arg)))
+			return;
+		if(arg == NULL) break;
+		log_chunk(tty_log_fd, arg, strlen_user_proc(arg));
+	}
+}
+
+extern void register_tty_logger(int (*opener)(void *, void *),
+				int (*writer)(int, const char *, int, 
+					      void *, int),
+				void (*closer)(int, void *));
+
+static int register_logger(void)
+{
+	register_tty_logger(open_tty_log, write_tty_log, close_tty_log);
+	return(0);
+}
+
+__uml_initcall(register_logger);
+
 static int __init set_tty_log_dir(char *name, int *add)
 {
 	tty_log_dir = name;
@@ -104,7 +202,7 @@
 
 	tty_log_fd = strtoul(name, &end, 0);
 	if((*end != '\0') || (end == name)){
-		printk("set_tty_log_fd - strtoul failed on '%s'\n", name);
+		printf("set_tty_log_fd - strtoul failed on '%s'\n", name);
 		tty_log_fd = -1;
 	}
 	return 0;
--- diff/arch/um/kernel/uaccess_user.c	2003-02-13 11:46:50.000000000 +0000
+++ source/arch/um/kernel/uaccess_user.c	2004-02-09 10:39:51.000000000 +0000
@@ -20,7 +20,7 @@
 
 	jmp_buf jbuf;
 	*fault_catcher = &jbuf;
-	if(setjmp(jbuf) == 0){
+	if(sigsetjmp(jbuf, 1) == 0){
 		(*op)(to, from, n);
 		ret = 0;
 		*faulted_out = 0;
--- diff/arch/um/kernel/um_arch.c	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/um/kernel/um_arch.c	2004-02-09 10:39:51.000000000 +0000
@@ -38,13 +38,18 @@
 #include "mode_kern.h"
 #include "mode.h"
 
-#define DEFAULT_COMMAND_LINE "root=6200"
+#define DEFAULT_COMMAND_LINE "root=98:0"
 
 struct cpuinfo_um boot_cpu_data = { 
 	.loops_per_jiffy	= 0,
 	.ipi_pipe		= { -1, -1 }
 };
 
+/* Placeholder to make UML link until the vsyscall stuff is actually 
+ * implemented
+ */
+void *__kernel_vsyscall;
+
 unsigned long thread_saved_pc(struct task_struct *task)
 {
 	return(os_process_pc(CHOOSE_MODE_PROC(thread_pid_tt, thread_pid_skas,
@@ -53,18 +58,22 @@
 
 static int show_cpuinfo(struct seq_file *m, void *v)
 {
-	int index;
+	int index = 0;
 
-	index = (struct cpuinfo_um *)v - cpu_data;
 #ifdef CONFIG_SMP
+	index = (struct cpuinfo_um *) v - cpu_data;
 	if (!cpu_online(index))
 		return 0;
 #endif
 
-	seq_printf(m, "bogomips\t: %lu.%02lu\n",
+	seq_printf(m, "processor\t: %d\n", index);
+	seq_printf(m, "vendor_id\t: User Mode Linux\n");
+	seq_printf(m, "model name\t: UML\n");
+	seq_printf(m, "mode\t\t: %s\n", CHOOSE_MODE("tt", "skas"));
+	seq_printf(m, "host\t\t: %s\n", host_info);
+	seq_printf(m, "bogomips\t: %lu.%02lu\n\n",
 		   loops_per_jiffy/(500000/HZ),
 		   (loops_per_jiffy/(5000/HZ)) % 100);
-	seq_printf(m, "host\t\t: %s\n", host_info);
 
 	return(0);
 }
@@ -134,12 +143,12 @@
 	if(umid != NULL){
 		snprintf(argv1_begin, 
 			 (argv1_end - argv1_begin) * sizeof(*ptr), 
-			 "(%s)", umid);
+			 "(%s) ", umid);
 		ptr = &argv1_begin[strlen(argv1_begin)];
 	}
 	else ptr = argv1_begin;
 
-	snprintf(ptr, (argv1_end - ptr) * sizeof(*ptr), " [%s]", cmd);
+	snprintf(ptr, (argv1_end - ptr) * sizeof(*ptr), "[%s]", cmd);
 	memset(argv1_begin + strlen(argv1_begin), '\0', 
 	       argv1_end - argv1_begin - strlen(argv1_begin));
 #endif
@@ -179,7 +188,7 @@
 static int __init uml_ncpus_setup(char *line, int *add)
 {
        if (!sscanf(line, "%d", &ncpus)) {
-               printk("Couldn't parse [%s]\n", line);
+               printf("Couldn't parse [%s]\n", line);
                return -1;
        }
 
@@ -210,7 +219,7 @@
 
 static int __init mode_tt_setup(char *line, int *add)
 {
-	printk("CONFIG_MODE_TT disabled - 'mode=tt' ignored\n");
+	printf("CONFIG_MODE_TT disabled - 'mode=tt' ignored\n");
 	return(0);
 }
 
@@ -221,7 +230,7 @@
 
 static int __init mode_tt_setup(char *line, int *add)
 {
-	printk("CONFIG_MODE_SKAS disabled - 'mode=tt' redundant\n");
+	printf("CONFIG_MODE_SKAS disabled - 'mode=tt' redundant\n");
 	return(0);
 }
 
@@ -291,7 +300,7 @@
 
 /* Set during early boot */
 unsigned long brk_start;
-static struct vm_reserved kernel_vm_reserved;
+unsigned long end_iomem;
 
 #define MIN_VMALLOC (32 * 1024 * 1024)
 
@@ -299,7 +308,7 @@
 {
 	unsigned long avail;
 	unsigned long virtmem_size, max_physmem;
-	unsigned int i, add, err;
+	unsigned int i, add;
 
 	for (i = 1; i < argc; i++){
 		if((i == 1) && (argv[i][0] == ' ')) continue;
@@ -328,12 +337,16 @@
 	argv1_end = &argv[1][strlen(argv[1])];
 #endif
   
-	set_usable_vm(uml_physmem, get_kmem_end());
-
 	highmem = 0;
-	max_physmem = get_kmem_end() - uml_physmem - MIN_VMALLOC;
-	if(physmem_size > max_physmem){
-		highmem = physmem_size - max_physmem;
+	iomem_size = (iomem_size + PAGE_SIZE - 1) & PAGE_MASK;
+	max_physmem = get_kmem_end() - uml_physmem - iomem_size - MIN_VMALLOC;
+
+	/* Zones have to begin on a 1 << MAX_ORDER page boundary,
+	 * so this makes sure that's true for highmem
+	 */
+	max_physmem &= ~((1 << (PAGE_SHIFT + MAX_ORDER)) - 1);
+	if(physmem_size + iomem_size > max_physmem){
+		highmem = physmem_size + iomem_size - max_physmem;
 		physmem_size -= highmem;
 #ifndef CONFIG_HIGHMEM
 		highmem = 0;
@@ -343,11 +356,19 @@
 	}
 
 	high_physmem = uml_physmem + physmem_size;
-	high_memory = (void *) high_physmem;
+	end_iomem = high_physmem + iomem_size;
+	high_memory = (void *) end_iomem;
 
 	start_vm = VMALLOC_START;
 
-	setup_physmem(uml_physmem, uml_reserved, physmem_size);
+	setup_physmem(uml_physmem, uml_reserved, physmem_size, highmem);
+	if(init_maps(physmem_size, iomem_size, highmem)){
+		printf("Failed to allocate mem_map for %ld bytes of physical "
+		       "memory and %ld bytes of highmem\n", physmem_size,
+		       highmem);
+		exit(1);
+	}
+
 	virtmem_size = physmem_size;
 	avail = get_kmem_end() - start_vm;
 	if(physmem_size > avail) virtmem_size = avail;
@@ -357,18 +378,13 @@
 		printf("Kernel virtual memory size shrunk to %ld bytes\n",
 		       virtmem_size);
 
-	err = reserve_vm(high_physmem, end_vm, &kernel_vm_reserved);
-	if(err){
-		printf("Failed to reserve VM area for kernel VM\n");
-		exit(1);
-	}
-
   	uml_postsetup();
 
 	init_task.thread.kernel_stack = (unsigned long) &init_thread_info + 
 		2 * PAGE_SIZE;
 
 	task_protections((unsigned long) &init_thread_info);
+	os_flush_stdout();
 
 	return(CHOOSE_MODE(start_uml_tt(), start_uml_skas()));
 }
@@ -376,8 +392,8 @@
 static int panic_exit(struct notifier_block *self, unsigned long unused1,
 		      void *unused2)
 {
-#ifdef CONFIG_SYSRQ
-	handle_sysrq('p', &current->thread.regs, NULL, NULL);
+#ifdef CONFIG_MAGIC_SYSRQ
+	handle_sysrq('p', &current->thread.regs, NULL);
 #endif
 	machine_halt();
 	return(0);
@@ -403,6 +419,7 @@
 	arch_check_bugs();
 	check_ptrace();
 	check_sigio();
+	check_devanon();
 }
 
 /*
--- diff/arch/um/kernel/umid.c	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/um/kernel/umid.c	2004-02-09 10:39:51.000000000 +0000
@@ -5,7 +5,6 @@
 
 #include <stdio.h>
 #include <unistd.h>
-#include <fcntl.h>
 #include <errno.h>
 #include <string.h>
 #include <stdlib.h>
@@ -33,18 +32,19 @@
 static int umid_is_random = 1;
 static int umid_inited = 0;
 
-static int make_umid(void);
+static int make_umid(int (*printer)(const char *fmt, ...));
 
-static int __init set_umid(char *name, int is_random)
+static int __init set_umid(char *name, int is_random, 
+			   int (*printer)(const char *fmt, ...))
 {
 	if(umid_inited){
-		printk("Unique machine name can't be set twice\n");
+		(*printer)("Unique machine name can't be set twice\n");
 		return(-1);
 	}
 
 	if(strlen(name) > UMID_LEN - 1)
-		printk("Unique machine name is being truncated to %s "
-		       "characters\n", UMID_LEN);
+		(*printer)("Unique machine name is being truncated to %s "
+			   "characters\n", UMID_LEN);
 	strlcpy(umid, name, sizeof(umid));
 
 	umid_is_random = is_random;
@@ -54,7 +54,7 @@
 
 static int __init set_umid_arg(char *name, int *add)
 {
-	return(set_umid(name, 0));
+	return(set_umid(name, 0, printf));
 }
 
 __uml_setup("umid=", set_umid_arg,
@@ -67,7 +67,7 @@
 {
 	int n;
 
-	if(!umid_inited && make_umid()) return(-1);
+	if(!umid_inited && make_umid(printk)) return(-1);
 
 	n = strlen(uml_dir) + strlen(umid) + strlen(name) + 1;
 	if(n > len){
@@ -85,22 +85,23 @@
 {
 	char file[strlen(uml_dir) + UMID_LEN + sizeof("/pid\0")];
 	char pid[sizeof("nnnnn\0")];
-	int fd;
+	int fd, n;
 
 	if(umid_file_name("pid", file, sizeof(file))) return 0;
 
 	fd = os_open_file(file, of_create(of_excl(of_rdwr(OPENFLAGS()))), 
 			  0644);
 	if(fd < 0){
-		printk("Open of machine pid file \"%s\" failed - "
-		       "errno = %d\n", file, -fd);
+		printf("Open of machine pid file \"%s\" failed - "
+		       "err = %d\n", file, -fd);
 		return 0;
 	}
 
 	sprintf(pid, "%d\n", os_getpid());
-	if(write(fd, pid, strlen(pid)) != strlen(pid))
-		printk("Write of pid file failed - errno = %d\n", errno);
-	close(fd);
+	n = os_write_file(fd, pid, strlen(pid));
+	if(n != strlen(pid))
+		printf("Write of pid file failed - err = %d\n", -n);
+	os_close_file(fd);
 	return 0;
 }
 
@@ -111,7 +112,8 @@
 	int len;
 	char file[256];
 
-	if((directory = opendir(dir)) == NULL){
+	directory = opendir(dir);
+	if(directory == NULL){
 		printk("actually_do_remove : couldn't open directory '%s', "
 		       "errno = %d\n", dir, errno);
 		return(1);
@@ -160,22 +162,24 @@
 {
 	char file[strlen(uml_dir) + UMID_LEN + sizeof("/pid\0")];
 	char pid[sizeof("nnnnn\0")], *end;
-	int dead, fd, p;
+	int dead, fd, p, n;
 
 	sprintf(file, "%s/pid", dir);
 	dead = 0;
-	if((fd = os_open_file(file, of_read(OPENFLAGS()), 0)) < 0){
+	fd = os_open_file(file, of_read(OPENFLAGS()), 0);
+	if(fd < 0){
 		if(fd != -ENOENT){
 			printk("not_dead_yet : couldn't open pid file '%s', "
-			       "errno = %d\n", file, -fd);
+			       "err = %d\n", file, -fd);
 			return(1);
 		}
 		dead = 1;
 	}
 	if(fd > 0){
-		if(read(fd, pid, sizeof(pid)) < 0){
+		n = os_read_file(fd, pid, sizeof(pid));
+		if(n < 0){
 			printk("not_dead_yet : couldn't read pid file '%s', "
-			       "errno = %d\n", file, errno);
+			       "err = %d\n", file, -n);
 			return(1);
 		}
 		p = strtoul(pid, &end, 0);
@@ -197,7 +201,7 @@
 	if((strlen(name) > 0) && (name[strlen(name) - 1] != '/')){
 		uml_dir = malloc(strlen(name) + 1);
 		if(uml_dir == NULL){
-			printk("Failed to malloc uml_dir - error = %d\n",
+			printf("Failed to malloc uml_dir - error = %d\n",
 			       errno);
 			uml_dir = name;
 			return(0);
@@ -217,7 +221,7 @@
 		char *home = getenv("HOME");
 
 		if(home == NULL){
-			printk("make_uml_dir : no value in environment for "
+			printf("make_uml_dir : no value in environment for "
 			       "$HOME\n");
 			exit(1);
 		}
@@ -232,57 +236,59 @@
 		dir[len + 1] = '\0';
 	}
 
-	if((uml_dir = malloc(strlen(dir) + 1)) == NULL){
+	uml_dir = malloc(strlen(dir) + 1);
+	if(uml_dir == NULL){
 		printf("make_uml_dir : malloc failed, errno = %d\n", errno);
 		exit(1);
 	}
 	strcpy(uml_dir, dir);
 	
 	if((mkdir(uml_dir, 0777) < 0) && (errno != EEXIST)){
-	        printk("Failed to mkdir %s - errno = %i\n", uml_dir, errno);
+	        printf("Failed to mkdir %s - errno = %i\n", uml_dir, errno);
 		return(-1);
 	}
 	return 0;
 }
 
-static int __init make_umid(void)
+static int __init make_umid(int (*printer)(const char *fmt, ...))
 {
 	int fd, err;
 	char tmp[strlen(uml_dir) + UMID_LEN + 1];
 
 	strlcpy(tmp, uml_dir, sizeof(tmp));
 
-	if(*umid == 0){
+	if(!umid_inited){
 		strcat(tmp, "XXXXXX");
 		fd = mkstemp(tmp);
 		if(fd < 0){
-			printk("make_umid - mkstemp failed, errno = %d\n",
-			       errno);
+			(*printer)("make_umid - mkstemp failed, errno = %d\n",
+				   errno);
 			return(1);
 		}
 
-		close(fd);
+		os_close_file(fd);
 		/* There's a nice tiny little race between this unlink and
 		 * the mkdir below.  It'd be nice if there were a mkstemp
 		 * for directories.
 		 */
 		unlink(tmp);
-		set_umid(&tmp[strlen(uml_dir)], 1);
+		set_umid(&tmp[strlen(uml_dir)], 1, printer);
 	}
 	
 	sprintf(tmp, "%s%s", uml_dir, umid);
 
-	if((err = mkdir(tmp, 0777)) < 0){
+	err = mkdir(tmp, 0777);
+	if(err < 0){
 		if(errno == EEXIST){
 			if(not_dead_yet(tmp)){
-				printk("umid '%s' is in use\n", umid);
+				(*printer)("umid '%s' is in use\n", umid);
 				return(-1);
 			}
 			err = mkdir(tmp, 0777);
 		}
 	}
 	if(err < 0){
-		printk("Failed to create %s - errno = %d\n", umid, errno);
+		(*printer)("Failed to create %s - errno = %d\n", umid, errno);
 		return(-1);
 	}
 
@@ -295,7 +301,13 @@
 );
 
 __uml_postsetup(make_uml_dir);
-__uml_postsetup(make_umid);
+
+static int __init make_umid_setup(void)
+{
+	return(make_umid(printf));
+}
+
+__uml_postsetup(make_umid_setup);
 __uml_postsetup(create_pid_file);
 
 /*
--- diff/arch/um/kernel/user_syms.c	2003-02-13 11:46:50.000000000 +0000
+++ source/arch/um/kernel/user_syms.c	2004-02-09 10:39:51.000000000 +0000
@@ -1,7 +1,7 @@
 #include <stdio.h>
 #include <unistd.h>
-#include <fcntl.h>
 #include <dirent.h>
+#include <fcntl.h>
 #include <errno.h>
 #include <utime.h>
 #include <string.h>
@@ -27,7 +27,7 @@
 #define __MODULE_STRING_1(x)	#x
 #define __MODULE_STRING(x)	__MODULE_STRING_1(x)
 
-#if !defined(__AUTOCONF_INCLUDED__)
+#if !defined(AUTOCONF_INCLUDED)
 
 #define __EXPORT_SYMBOL(sym,str)   error config_must_be_included_before_module
 #define EXPORT_SYMBOL(var)	   error config_must_be_included_before_module
--- diff/arch/um/kernel/user_util.c	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/um/kernel/user_util.c	2004-02-09 10:39:51.000000000 +0000
@@ -5,7 +5,6 @@
 
 #include <stdio.h>
 #include <stdlib.h>
-#include <fcntl.h>
 #include <unistd.h>
 #include <limits.h>
 #include <sys/mman.h> 
@@ -82,7 +81,8 @@
 	int status, ret;
 
 	while(1){
-		if(((ret = waitpid(pid, &status, WUNTRACED)) < 0) ||
+		ret = waitpid(pid, &status, WUNTRACED);
+		if((ret < 0) ||
 		   !WIFSTOPPED(status) || (WSTOPSIG(status) != sig)){
 			if(ret < 0){
 				if(errno == EINTR) continue;
@@ -119,17 +119,6 @@
 	}
 }
 
-int clone_and_wait(int (*fn)(void *), void *arg, void *sp, int flags)
-{
-	int pid;
-
-	pid = clone(fn, sp, flags, arg);
- 	if(pid < 0) return(-1);
-	wait_for_stop(pid, SIGSTOP, PTRACE_CONT, NULL);
-	ptrace(PTRACE_CONT, pid, 0, 0);
-	return(pid);
-}
-
 int raw(int fd, int complain)
 {
 	struct termios tt;
--- diff/arch/um/main.c	2003-02-13 11:46:50.000000000 +0000
+++ source/arch/um/main.c	2004-02-09 10:39:51.000000000 +0000
@@ -8,6 +8,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <signal.h>
+#include <errno.h>
 #include <sys/resource.h>
 #include <sys/mman.h>
 #include <sys/user.h>
@@ -123,12 +124,14 @@
 
 	set_stklim();
 
-	if((new_argv = malloc((argc + 1) * sizeof(char *))) == NULL){
+	new_argv = malloc((argc + 1) * sizeof(char *));
+	if(new_argv == NULL){
 		perror("Mallocing argv");
 		exit(1);
 	}
 	for(i=0;i<argc;i++){
-		if((new_argv[i] = strdup(argv[i])) == NULL){
+		new_argv[i] = strdup(argv[i]);
+		if(new_argv[i] == NULL){
 			perror("Mallocing an arg");
 			exit(1);
 		}
--- diff/arch/um/os-Linux/drivers/ethertap_kern.c	2003-06-30 10:07:20.000000000 +0100
+++ source/arch/um/os-Linux/drivers/ethertap_kern.c	2004-02-09 10:39:51.000000000 +0000
@@ -8,7 +8,6 @@
 #include "linux/init.h"
 #include "linux/netdevice.h"
 #include "linux/etherdevice.h"
-#include "linux/init.h"
 #include "net_kern.h"
 #include "net_user.h"
 #include "etap.h"
--- diff/arch/um/os-Linux/drivers/ethertap_user.c	2003-02-13 11:46:50.000000000 +0000
+++ source/arch/um/os-Linux/drivers/ethertap_user.c	2004-02-09 10:39:51.000000000 +0000
@@ -8,7 +8,6 @@
 #include <stdio.h>
 #include <unistd.h>
 #include <stddef.h>
-#include <fcntl.h>
 #include <stdlib.h>
 #include <sys/errno.h>
 #include <sys/socket.h>
@@ -42,13 +41,14 @@
 {
 	struct addr_change change;
 	void *output;
+	int n;
 
 	change.what = op;
 	memcpy(change.addr, addr, sizeof(change.addr));
 	memcpy(change.netmask, netmask, sizeof(change.netmask));
-	if(write(fd, &change, sizeof(change)) != sizeof(change))
-		printk("etap_change - request failed, errno = %d\n",
-		       errno);
+	n = os_write_file(fd, &change, sizeof(change));
+	if(n != sizeof(change))
+		printk("etap_change - request failed, err = %d\n", -n);
 	output = um_kmalloc(page_size());
 	if(output == NULL)
 		printk("etap_change : Failed to allocate output buffer\n");
@@ -82,15 +82,15 @@
 	struct etap_pre_exec_data *data = arg;
 
 	dup2(data->control_remote, 1);
-	close(data->data_me);
-	close(data->control_me);
+	os_close_file(data->data_me);
+	os_close_file(data->control_me);
 }
 
 static int etap_tramp(char *dev, char *gate, int control_me, 
 		      int control_remote, int data_me, int data_remote)
 {
 	struct etap_pre_exec_data pe_data;
-	int pid, status, err;
+	int pid, status, err, n;
 	char version_buf[sizeof("nnnnn\0")];
 	char data_fd_buf[sizeof("nnnnnn\0")];
 	char gate_buf[sizeof("nnn.nnn.nnn.nnn\0")];
@@ -114,21 +114,21 @@
 	pe_data.data_me = data_me;
 	pid = run_helper(etap_pre_exec, &pe_data, args, NULL);
 
-	if(pid < 0) err = errno;
-	close(data_remote);
-	close(control_remote);
-	if(read(control_me, &c, sizeof(c)) != sizeof(c)){
-		printk("etap_tramp : read of status failed, errno = %d\n",
-		       errno);
-		return(EINVAL);
+	if(pid < 0) err = pid;
+	os_close_file(data_remote);
+	os_close_file(control_remote);
+	n = os_read_file(control_me, &c, sizeof(c));
+	if(n != sizeof(c)){
+		printk("etap_tramp : read of status failed, err = %d\n", -n);
+		return(-EINVAL);
 	}
 	if(c != 1){
 		printk("etap_tramp : uml_net failed\n");
-		err = EINVAL;
-		if(waitpid(pid, &status, 0) < 0) err = errno;
-		else if(!WIFEXITED(status) || (WEXITSTATUS(status) != 1)){
+		err = -EINVAL;
+		if(waitpid(pid, &status, 0) < 0)
+			err = -errno;
+		else if(!WIFEXITED(status) || (WEXITSTATUS(status) != 1))
 			printk("uml_net didn't exit with status 1\n");
-		}
 	}
 	return(err);
 }
@@ -143,14 +143,14 @@
 	if(err) return(err);
 
 	err = os_pipe(data_fds, 0, 0);
-	if(err){
-		printk("data os_pipe failed - errno = %d\n", -err);
+	if(err < 0){
+		printk("data os_pipe failed - err = %d\n", -err);
 		return(err);
 	}
 
 	err = os_pipe(control_fds, 1, 0);
-	if(err){
-		printk("control os_pipe failed - errno = %d\n", -err);
+	if(err < 0){
+		printk("control os_pipe failed - err = %d\n", -err);
 		return(err);
 	}
 	
@@ -167,9 +167,9 @@
 		kfree(output);
 	}
 
-	if(err != 0){
-		printk("etap_tramp failed - errno = %d\n", err);
-		return(-err);
+	if(err < 0){
+		printk("etap_tramp failed - err = %d\n", -err);
+		return(err);
 	}
 
 	pri->data_fd = data_fds[0];
@@ -183,11 +183,11 @@
 	struct ethertap_data *pri = data;
 
 	iter_addresses(pri->dev, etap_close_addr, &pri->control_fd);
-	close(fd);
+	os_close_file(fd);
 	os_shutdown_socket(pri->data_fd, 1, 1);
-	close(pri->data_fd);
+	os_close_file(pri->data_fd);
 	pri->data_fd = -1;
-	close(pri->control_fd);
+	os_close_file(pri->control_fd);
 	pri->control_fd = -1;
 }
 
--- diff/arch/um/os-Linux/drivers/tuntap_user.c	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/um/os-Linux/drivers/tuntap_user.c	2004-02-09 10:39:51.000000000 +0000
@@ -8,7 +8,6 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <errno.h>
-#include <fcntl.h>
 #include <sys/wait.h>
 #include <sys/socket.h>
 #include <sys/un.h>
@@ -61,7 +60,7 @@
 	struct tuntap_pre_exec_data *data = arg;
 	
 	dup2(data->stdout, 1);
-	close(data->close_me);
+	os_close_file(data->close_me);
 }
 
 static int tuntap_open_tramp(char *gate, int *fd_out, int me, int remote,
@@ -86,7 +85,7 @@
 
 	if(pid < 0) return(-pid);
 
-	close(remote);
+	os_close_file(remote);
 
 	msg.msg_name = NULL;
 	msg.msg_namelen = 0;
@@ -107,19 +106,19 @@
 	if(n < 0){
 		printk("tuntap_open_tramp : recvmsg failed - errno = %d\n", 
 		       errno);
-		return(errno);
+		return(-errno);
 	}
 	waitpid(pid, NULL, 0);
 
 	cmsg = CMSG_FIRSTHDR(&msg);
 	if(cmsg == NULL){
 		printk("tuntap_open_tramp : didn't receive a message\n");
-		return(EINVAL);
+		return(-EINVAL);
 	}
 	if((cmsg->cmsg_level != SOL_SOCKET) || 
 	   (cmsg->cmsg_type != SCM_RIGHTS)){
 		printk("tuntap_open_tramp : didn't receive a descriptor\n");
-		return(EINVAL);
+		return(-EINVAL);
 	}
 	*fd_out = ((int *) CMSG_DATA(cmsg))[0];
 	return(0);
@@ -133,27 +132,29 @@
 	int err, fds[2], len, used;
 
 	err = tap_open_common(pri->dev, pri->gate_addr);
-	if(err) return(err);
+	if(err < 0) 
+		return(err);
 
 	if(pri->fixed_config){
-		if((pri->fd = open("/dev/net/tun", O_RDWR)) < 0){
-			printk("Failed to open /dev/net/tun, errno = %d\n",
-			       errno);
-			return(-errno);
+		pri->fd = os_open_file("/dev/net/tun", of_rdwr(OPENFLAGS()), 0);
+		if(pri->fd < 0){
+			printk("Failed to open /dev/net/tun, err = %d\n",
+			       -pri->fd);
+			return(pri->fd);
 		}
 		memset(&ifr, 0, sizeof(ifr));
-		ifr.ifr_flags = IFF_TAP;
+		ifr.ifr_flags = IFF_TAP | IFF_NO_PI;
 		strlcpy(ifr.ifr_name, pri->dev_name, sizeof(ifr.ifr_name));
 		if(ioctl(pri->fd, TUNSETIFF, (void *) &ifr) < 0){
-			printk("TUNSETIFF failed, errno = %d", errno);
-			close(pri->fd);
+			printk("TUNSETIFF failed, errno = %d\n", errno);
+			os_close_file(pri->fd);
 			return(-errno);
 		}
 	}
 	else {
 		err = os_pipe(fds, 0, 0);
-		if(err){
-			printk("tuntap_open : os_pipe failed - errno = %d\n",
+		if(err < 0){
+			printk("tuntap_open : os_pipe failed - err = %d\n",
 			       -err);
 			return(err);
 		}
@@ -166,19 +167,19 @@
 					fds[1], buffer, len, &used);
 
 		output = buffer;
-		if(err == 0){
-			pri->dev_name = uml_strdup(buffer);
-			output += IFNAMSIZ;
-			printk(output);
-			free_output_buffer(buffer);
-		}
-		else {
-			printk(output);
+		if(err < 0) {
+			printk("%s", output);
 			free_output_buffer(buffer);
-			printk("tuntap_open_tramp failed - errno = %d\n", err);
-			return(-err);
+			printk("tuntap_open_tramp failed - err = %d\n", -err);
+			return(err);
 		}
-		close(fds[0]);
+
+		pri->dev_name = uml_strdup(buffer);
+		output += IFNAMSIZ;
+		printk("%s", output);
+		free_output_buffer(buffer);
+
+		os_close_file(fds[0]);
 		iter_addresses(pri->dev, open_addr, pri->dev_name);
 	}
 
@@ -191,7 +192,7 @@
 
 	if(!pri->fixed_config) 
 		iter_addresses(pri->dev, close_addr, pri->dev_name);
-	close(fd);
+	os_close_file(fd);
 	pri->fd = -1;
 }
 
--- diff/arch/um/os-Linux/file.c	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/um/os-Linux/file.c	2004-02-09 10:39:51.000000000 +0000
@@ -8,6 +8,8 @@
 #include <errno.h>
 #include <fcntl.h>
 #include <signal.h>
+#include <sys/types.h>
+#include <sys/stat.h>
 #include <sys/socket.h>
 #include <sys/un.h>
 #include <sys/ioctl.h>
@@ -17,33 +19,235 @@
 #include "user.h"
 #include "kern_util.h"
 
-int os_file_type(char *file)
+static void copy_stat(struct uml_stat *dst, struct stat64 *src)
+{
+	*dst = ((struct uml_stat) {
+		.ust_dev     = src->st_dev,     /* device */
+		.ust_ino     = src->st_ino,     /* inode */
+		.ust_mode    = src->st_mode,    /* protection */
+		.ust_nlink   = src->st_nlink,   /* number of hard links */
+		.ust_uid     = src->st_uid,     /* user ID of owner */
+		.ust_gid     = src->st_gid,     /* group ID of owner */
+		.ust_size    = src->st_size,    /* total size, in bytes */
+		.ust_blksize = src->st_blksize, /* blocksize for filesys I/O */
+		.ust_blocks  = src->st_blocks,  /* number of blocks allocated */
+		.ust_atime   = src->st_atime,   /* time of last access */
+		.ust_mtime   = src->st_mtime,   /* time of last modification */
+		.ust_ctime   = src->st_ctime,   /* time of last change */
+	});
+}
+
+int os_stat_fd(const int fd, struct uml_stat *ubuf)
+{
+	struct stat64 sbuf;
+	int err;
+
+	do {
+		err = fstat64(fd, &sbuf);
+	} while((err < 0) && (errno == EINTR)) ;
+
+	if(err < 0) 
+		return(-errno);
+
+	if(ubuf != NULL)
+		copy_stat(ubuf, &sbuf);
+	return(err);
+}
+
+int os_stat_file(const char *file_name, struct uml_stat *ubuf)
+{
+	struct stat64 sbuf;
+	int err;
+
+	do {
+		err = stat64(file_name, &sbuf);
+	} while((err < 0) && (errno == EINTR)) ;
+
+	if(err < 0) 
+		return(-errno);
+
+	if(ubuf != NULL)
+		copy_stat(ubuf, &sbuf);
+	return(err);
+}
+
+int os_access(const char* file, int mode)
+{
+	int amode, err;
+
+	amode=(mode&OS_ACC_R_OK ? R_OK : 0) | (mode&OS_ACC_W_OK ? W_OK : 0) |
+	      (mode&OS_ACC_X_OK ? X_OK : 0) | (mode&OS_ACC_F_OK ? F_OK : 0) ;
+
+	err = access(file, amode);
+	if(err < 0)
+		return(-errno);
+
+	return(0);
+}
+
+void os_print_error(int error, const char* str)
+{
+	errno = error < 0 ? -error : error;
+
+	perror(str);
+}
+
+/* FIXME? required only by hostaudio (because it passes ioctls verbatim) */
+int os_ioctl_generic(int fd, unsigned int cmd, unsigned long arg)
+{
+	int err;
+
+	err = ioctl(fd, cmd, arg);
+	if(err < 0)
+		return(-errno);
+
+	return(err);
+}
+
+int os_window_size(int fd, int *rows, int *cols)
+{
+	struct winsize size;
+
+	if(ioctl(fd, TIOCGWINSZ, &size) < 0)
+		return(-errno);
+
+	*rows = size.ws_row;
+	*cols = size.ws_col;
+
+	return(0);
+}
+
+int os_new_tty_pgrp(int fd, int pid)
 {
-	struct stat64 buf;
+	if(ioctl(fd, TIOCSCTTY, 0) < 0){
+		printk("TIOCSCTTY failed, errno = %d\n", errno);
+		return(-errno);
+	}
+
+	if(tcsetpgrp(fd, pid) < 0){
+		printk("tcsetpgrp failed, errno = %d\n", errno);
+		return(-errno);
+	}
+
+	return(0);
+}
+
+/* FIXME: ensure namebuf in os_get_if_name is big enough */
+int os_get_ifname(int fd, char* namebuf)
+{
+	if(ioctl(fd, SIOCGIFNAME, namebuf) < 0)
+		return(-errno);
+
+	return(0);
+}
+
+int os_set_slip(int fd)
+{
+	int disc, sencap;
+
+	disc = N_SLIP;
+	if(ioctl(fd, TIOCSETD, &disc) < 0){
+		printk("Failed to set slip line discipline - "
+		       "errno = %d\n", errno);
+		return(-errno);
+	}
+
+	sencap = 0;
+	if(ioctl(fd, SIOCSIFENCAP, &sencap) < 0){
+		printk("Failed to set slip encapsulation - "
+		       "errno = %d\n", errno);
+		return(-errno);
+	}
+
+	return(0);
+}
+
+int os_set_owner(int fd, int pid)
+{
+	if(fcntl(fd, F_SETOWN, pid) < 0){
+		int save_errno = errno;
+
+		if(fcntl(fd, F_GETOWN, 0) != pid)
+			return(-save_errno);
+	}
+
+	return(0);
+}
+
+/* FIXME? moved wholesale from sigio_user.c to get fcntls out of that file */ 
+int os_sigio_async(int master, int slave)
+{
+	int flags;
 
-	if(stat64(file, &buf) == -1)
+	flags = fcntl(master, F_GETFL);
+	if(flags < 0) {
+		printk("fcntl F_GETFL failed, errno = %d\n", errno);
 		return(-errno);
+	}
+
+	if((fcntl(master, F_SETFL, flags | O_NONBLOCK | O_ASYNC) < 0) ||
+	   (fcntl(master, F_SETOWN, os_getpid()) < 0)){
+		printk("fcntl F_SETFL or F_SETOWN failed, errno = %d\n", errno);
+		return(-errno);
+	}
+
+	if((fcntl(slave, F_SETFL, flags | O_NONBLOCK) < 0)){
+		printk("fcntl F_SETFL failed, errno = %d\n", errno);
+		return(-errno);
+	}
 
-	if(S_ISDIR(buf.st_mode)) return(OS_TYPE_DIR);
-	else if(S_ISLNK(buf.st_mode)) return(OS_TYPE_SYMLINK);
-	else if(S_ISCHR(buf.st_mode)) return(OS_TYPE_CHARDEV);
-	else if(S_ISBLK(buf.st_mode)) return(OS_TYPE_BLOCKDEV);
-	else if(S_ISFIFO(buf.st_mode)) return(OS_TYPE_FIFO);
-	else if(S_ISSOCK(buf.st_mode)) return(OS_TYPE_SOCK);
+	return(0);
+}
+
+int os_mode_fd(int fd, int mode)
+{
+	int err;
+
+	do {
+		err = fchmod(fd, mode);
+	} while((err < 0) && (errno==EINTR)) ;
+
+	if(err < 0)
+		return(-errno);
+
+	return(0);
+}
+
+int os_file_type(char *file)
+{
+	struct uml_stat buf;
+	int err;
+
+	err = os_stat_file(file, &buf);
+	if(err < 0)
+		return(err);
+
+	if(S_ISDIR(buf.ust_mode)) return(OS_TYPE_DIR);
+	else if(S_ISLNK(buf.ust_mode)) return(OS_TYPE_SYMLINK);
+	else if(S_ISCHR(buf.ust_mode)) return(OS_TYPE_CHARDEV);
+	else if(S_ISBLK(buf.ust_mode)) return(OS_TYPE_BLOCKDEV);
+	else if(S_ISFIFO(buf.ust_mode)) return(OS_TYPE_FIFO);
+	else if(S_ISSOCK(buf.ust_mode)) return(OS_TYPE_SOCK);
 	else return(OS_TYPE_FILE);
 }
 
 int os_file_mode(char *file, struct openflags *mode_out)
 {
+	int err;
+
 	*mode_out = OPENFLAGS();
 
-	if(!access(file, W_OK)) *mode_out = of_write(*mode_out);
-	else if(errno != EACCES) 
-		return(-errno);
+	err = os_access(file, OS_ACC_W_OK);
+	if((err < 0) && (err != -EACCES))
+		return(err);
 
-	if(!access(file, R_OK)) *mode_out = of_read(*mode_out);
-	else if(errno != EACCES) 
-		return(-errno);
+	*mode_out = of_write(*mode_out);
+
+	err = os_access(file, OS_ACC_R_OK);
+	if((err < 0) && (err != -EACCES))
+		return(err);
+
+	*mode_out = of_read(*mode_out);
 
 	return(0);
 }
@@ -63,16 +267,14 @@
 	if(flags.e) f |= O_EXCL;
 
 	fd = open64(file, f, mode);
-	if(fd < 0) return(-errno);
-	
-	if(flags.cl){
-		if(fcntl(fd, F_SETFD, 1)){
-			close(fd);
-			return(-errno);
-		}
+	if(fd < 0)
+		return(-errno);
+
+	if(flags.cl && fcntl(fd, F_SETFD, 1)){
+		os_close_file(fd);
+		return(-errno);
 	}
 
- 	return(fd);
 	return(fd);
 }
 
@@ -90,7 +292,7 @@
 
 	err = connect(fd, (struct sockaddr *) &sock, sizeof(sock));
 	if(err)
-		return(err);
+		return(-errno);
 
 	return(fd);
 }
@@ -109,88 +311,162 @@
 	return(0);
 }
 
-int os_read_file(int fd, void *buf, int len)
+static int fault_buffer(void *start, int len, 
+			int (*copy_proc)(void *addr, void *buf, int len))
 {
-	int n;
+	int page = getpagesize(), i;
+	char c;
 
-	/* Force buf into memory if it's not already. */
+	for(i = 0; i < len; i += page){
+		if((*copy_proc)(start + i, &c, sizeof(c)))
+			return(-EFAULT);
+	}
+	if((len % page) != 0){
+		if((*copy_proc)(start + len - 1, &c, sizeof(c)))
+			return(-EFAULT);
+	}
+	return(0);
+}
 
-	/* XXX This fails if buf is kernel memory */
-#ifdef notdef
-	if(copy_to_user_proc(buf, &c, sizeof(c)))
-		return(-EFAULT);
-#endif
+static int file_io(int fd, void *buf, int len,
+		   int (*io_proc)(int fd, void *buf, int len),
+		   int (*copy_user_proc)(void *addr, void *buf, int len))
+{
+	int n, err;
+
+	do {
+		n = (*io_proc)(fd, buf, len);
+		if((n < 0) && (errno == EFAULT)){
+			err = fault_buffer(buf, len, copy_user_proc);
+			if(err)
+				return(err);
+			n = (*io_proc)(fd, buf, len);
+		}
+	} while((n < 0) && (errno == EINTR));
 
-	n = read(fd, buf, len);
 	if(n < 0)
 		return(-errno);
 	return(n);
 }
 
-int os_write_file(int fd, void *buf, int count)
+int os_read_file(int fd, void *buf, int len)
 {
-	int n;
-
-	/* Force buf into memory if it's not already. */
-	
-	/* XXX This fails if buf is kernel memory */
-#ifdef notdef
-	if(copy_to_user_proc(buf, buf, buf[0]))
-		return(-EFAULT);
-#endif
+	return(file_io(fd, buf, len, (int (*)(int, void *, int)) read, 
+		       copy_from_user_proc));
+}
 
-	n = write(fd, buf, count);
-	if(n < 0)
-		return(-errno);
-	return(n);
+int os_write_file(int fd, const void *buf, int len)
+{
+	return(file_io(fd, (void *) buf, len, 
+		       (int (*)(int, void *, int)) write, copy_to_user_proc));
 }
 
 int os_file_size(char *file, long long *size_out)
 {
-	struct stat64 buf;
+	struct uml_stat buf;
+	int err;
 
-	if(stat64(file, &buf) == -1){
-		printk("Couldn't stat \"%s\" : errno = %d\n", file, errno);
-		return(-errno);
+	err = os_stat_file(file, &buf);
+	if(err < 0){
+		printk("Couldn't stat \"%s\" : err = %d\n", file, -err);
+		return(err);
 	}
-	if(S_ISBLK(buf.st_mode)){
+
+	if(S_ISBLK(buf.ust_mode)){
 		int fd, blocks;
 
-		if((fd = open64(file, O_RDONLY)) < 0){
-			printk("Couldn't open \"%s\", errno = %d\n", file,
-			       errno);
-			return(-errno);
+		fd = os_open_file(file, of_read(OPENFLAGS()), 0);
+		if(fd < 0){
+			printk("Couldn't open \"%s\", errno = %d\n", file, -fd);
+			return(fd);
 		}
 		if(ioctl(fd, BLKGETSIZE, &blocks) < 0){
 			printk("Couldn't get the block size of \"%s\", "
 			       "errno = %d\n", file, errno);
-			close(fd);
-			return(-errno);
+			err = -errno;
+			os_close_file(fd);
+			return(err);
 		}
 		*size_out = ((long long) blocks) * 512;
-		close(fd);
+		os_close_file(fd);
 		return(0);
 	}
-	*size_out = buf.st_size;
+	*size_out = buf.ust_size;
+	return(0);
+}
+
+int os_file_modtime(char *file, unsigned long *modtime)
+{
+	struct uml_stat buf;
+	int err;
+
+	err = os_stat_file(file, &buf);
+	if(err < 0){
+		printk("Couldn't stat \"%s\" : err = %d\n", file, -err);
+		return(err);
+	}
+
+	*modtime = buf.ust_mtime;
 	return(0);
 }
 
+int os_get_exec_close(int fd, int* close_on_exec)
+{
+	int ret;
+
+	do {
+		ret = fcntl(fd, F_GETFD);
+	} while((ret < 0) && (errno == EINTR)) ;
+
+	if(ret < 0)
+		return(-errno);
+
+	*close_on_exec = (ret&FD_CLOEXEC) ? 1 : 0;
+	return(ret);
+}
+
+int os_set_exec_close(int fd, int close_on_exec)
+{
+	int flag, err;
+
+	if(close_on_exec) flag = FD_CLOEXEC;
+	else flag = 0;
+
+	do {
+		err = fcntl(fd, F_SETFD, flag);
+	} while((err < 0) && (errno == EINTR)) ;
+
+	if(err < 0)
+		return(-errno);
+	return(err);
+}
+
 int os_pipe(int *fds, int stream, int close_on_exec)
 {
 	int err, type = stream ? SOCK_STREAM : SOCK_DGRAM;
 
 	err = socketpair(AF_UNIX, type, 0, fds);
-	if(err) 
+	if(err < 0) 
 		return(-errno);
 
 	if(!close_on_exec)
 		return(0);
 
-	if((fcntl(fds[0], F_SETFD, 1) < 0) || (fcntl(fds[1], F_SETFD, 1) < 0))
-		printk("os_pipe : Setting FD_CLOEXEC failed, errno = %d", 
-		       errno);
+	err = os_set_exec_close(fds[0], 1);
+	if(err < 0)
+		goto error;
+
+	err = os_set_exec_close(fds[1], 1);
+	if(err < 0)
+		goto error;
 
 	return(0);
+
+ error:
+	printk("os_pipe : Setting FD_CLOEXEC failed, err = %d\n", -err);
+	os_close_file(fds[1]);
+	os_close_file(fds[0]);
+	return(err);
 }
 
 int os_set_fd_async(int fd, int owner)
@@ -270,7 +546,7 @@
 		return(-EINVAL);
 	}
 	err = shutdown(fd, what);
-	if(err)
+	if(err < 0)
 		return(-errno);
 	return(0);
 }
@@ -315,7 +591,7 @@
 	return(new);
 }
 
-int create_unix_socket(char *file, int len)
+int os_create_unix_socket(char *file, int len, int close_on_exec)
 {
 	struct sockaddr_un addr;
 	int sock, err;
@@ -327,6 +603,13 @@
 		return(-errno);
 	}
 
+	if(close_on_exec) {
+		err = os_set_exec_close(sock, 1);
+		if(err < 0)
+			printk("create_unix_socket : close_on_exec failed, "
+		       "err = %d", -err);
+	}
+
 	addr.sun_family = AF_UNIX;
 
 	/* XXX Be more careful about overflow */
@@ -334,14 +617,45 @@
 
 	err = bind(sock, (struct sockaddr *) &addr, sizeof(addr));
 	if (err < 0){
-		printk("create_listening_socket - bind failed, errno = %d\n",
-		       errno);
+		printk("create_listening_socket at '%s' - bind failed, "
+		       "errno = %d\n", file, errno);
 		return(-errno);
 	}
 
 	return(sock);
 }
 
+void os_flush_stdout(void)
+{
+	fflush(stdout);
+}
+
+int os_lock_file(int fd, int excl)
+{
+	int type = excl ? F_WRLCK : F_RDLCK;
+	struct flock lock = ((struct flock) { .l_type	= type,
+					      .l_whence	= SEEK_SET,
+					      .l_start	= 0,
+					      .l_len	= 0 } );
+	int err, save;
+
+	err = fcntl(fd, F_SETLK, &lock);
+	if(!err)
+		goto out;
+
+	save = -errno;
+	err = fcntl(fd, F_GETLK, &lock);
+	if(err){
+		err = -errno;
+		goto out;
+	}
+
+	printk("F_SETLK failed, file already locked by pid %d\n", lock.l_pid);
+	err = save;
+ out:
+	return(err);
+}
+
 /*
  * Overrides for Emacs so that we follow Linus's tabbing style.
  * Emacs will notice this stuff at the end of the file and automatically
--- diff/arch/um/os-Linux/process.c	2003-02-13 11:46:50.000000000 +0000
+++ source/arch/um/os-Linux/process.c	2004-02-09 10:39:51.000000000 +0000
@@ -1,5 +1,5 @@
 /* 
- * Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
+ * Copyright (C) 2002 Jeff Dike (jdike@addtoit.com)
  * Licensed under the GPL
  */
 
@@ -7,32 +7,37 @@
 #include <stdio.h>
 #include <errno.h>
 #include <signal.h>
+#include <linux/unistd.h>
 #include <sys/mman.h>
 #include <sys/wait.h>
 #include "os.h"
 #include "user.h"
 
+#define ARBITRARY_ADDR -1
+#define FAILURE_PID    -1
+
 unsigned long os_process_pc(int pid)
 {
 	char proc_stat[sizeof("/proc/#####/stat\0")], buf[256];
 	unsigned long pc;
-	int fd;
+	int fd, err;
 
 	sprintf(proc_stat, "/proc/%d/stat", pid);
 	fd = os_open_file(proc_stat, of_read(OPENFLAGS()), 0);
 	if(fd < 0){
-		printk("os_process_pc - couldn't open '%s', errno = %d\n", 
-		       proc_stat, errno);
-		return(-1);
+		printk("os_process_pc - couldn't open '%s', err = %d\n", 
+		       proc_stat, -fd);
+		return(ARBITRARY_ADDR);
 	}
-	if(read(fd, buf, sizeof(buf)) < 0){
-		printk("os_process_pc - couldn't read '%s', errno = %d\n", 
-		       proc_stat, errno);
-		close(fd);
-		return(-1);
+	err = os_read_file(fd, buf, sizeof(buf));
+	if(err < 0){
+		printk("os_process_pc - couldn't read '%s', err = %d\n", 
+		       proc_stat, -err);
+		os_close_file(fd);
+		return(ARBITRARY_ADDR);
 	}
-	close(fd);
-	pc = -1;
+	os_close_file(fd);
+	pc = ARBITRARY_ADDR;
 	if(sscanf(buf, "%*d %*s %*c %*d %*d %*d %*d %*d %*d %*d %*d "
 		  "%*d %*d %*d %*d %*d %*d %*d %*d %*d %*d %*d %*d %*d %*d "
 		  "%*d %*d %*d %*d %ld", &pc) != 1){
@@ -52,22 +57,23 @@
 	snprintf(stat, sizeof(stat), "/proc/%d/stat", pid);
 	fd = os_open_file(stat, of_read(OPENFLAGS()), 0);
 	if(fd < 0){
-		printk("Couldn't open '%s', errno = %d\n", stat, -fd);
-		return(-1);
+		printk("Couldn't open '%s', err = %d\n", stat, -fd);
+		return(FAILURE_PID);
 	}
 
-	n = read(fd, data, sizeof(data));
-	close(fd);
+	n = os_read_file(fd, data, sizeof(data));
+	os_close_file(fd);
 
 	if(n < 0){
-		printk("Couldn't read '%s', errno = %d\n", stat);
-		return(-1);
+		printk("Couldn't read '%s', err = %d\n", stat, -n);
+		return(FAILURE_PID);
 	}
 
-	parent = -1;
+	parent = FAILURE_PID;
 	/* XXX This will break if there is a space in the command */
 	n = sscanf(data, "%*d %*s %*c %d", &parent);
-	if(n != 1) printk("Failed to scan '%s'\n", data);
+	if(n != 1) 
+		printk("Failed to scan '%s'\n", data);
 
 	return(parent);
 }
@@ -87,7 +93,8 @@
 
 void os_usr1_process(int pid)
 {
-	kill(pid, SIGUSR1);
+	syscall(__NR_tkill, pid, SIGUSR1); 
+	/* kill(pid, SIGUSR1); */
 }
 
 int os_getpid(void)
@@ -95,7 +102,7 @@
 	return(getpid());
 }
 
-int os_map_memory(void *virt, int fd, unsigned long off, unsigned long len, 
+int os_map_memory(void *virt, int fd, unsigned long long off, unsigned long len,
 		  int r, int w, int x)
 {
 	void *loc;
@@ -104,8 +111,8 @@
 	prot = (r ? PROT_READ : 0) | (w ? PROT_WRITE : 0) | 
 		(x ? PROT_EXEC : 0);
 
-	loc = mmap((void *) virt, len, prot, MAP_SHARED | MAP_FIXED, 
-		   fd, off);
+	loc = mmap64((void *) virt, len, prot, MAP_SHARED | MAP_FIXED, 
+		     fd, off);
 	if(loc == MAP_FAILED)
 		return(-errno);
 	return(0);
@@ -126,7 +133,8 @@
         int err;
 
         err = munmap(addr, len);
-        if(err < 0) return(-errno);
+	if(err < 0)
+		return(-errno);
         return(0);
 }
 
--- diff/arch/um/os-Linux/tty.c	2003-01-02 10:43:05.000000000 +0000
+++ source/arch/um/os-Linux/tty.c	2004-02-09 10:39:51.000000000 +0000
@@ -28,10 +28,10 @@
 	struct grantpt_info info;
 	int fd;
 
-	if((fd = os_open_file("/dev/ptmx", of_rdwr(OPENFLAGS()), 0)) < 0){
-		printk("get_pty : Couldn't open /dev/ptmx - errno = %d\n",
-		       errno);
-		return(-1);
+	fd = os_open_file("/dev/ptmx", of_rdwr(OPENFLAGS()), 0);
+	if(fd < 0){
+		printk("get_pty : Couldn't open /dev/ptmx - err = %d\n", -fd);
+		return(fd);
 	}
 
 	info.fd = fd;
@@ -39,7 +39,7 @@
 
 	if(info.res < 0){
 		printk("get_pty : Couldn't grant pty - errno = %d\n", 
-		       info.err);
+		       -info.err);
 		return(-1);
 	}
 	if(unlockpt(fd) < 0){
--- diff/arch/um/sys-i386/Makefile	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/um/sys-i386/Makefile	2004-02-09 10:39:51.000000000 +0000
@@ -1,7 +1,8 @@
-obj-y = bugs.o checksum.o extable.o fault.o ksyms.o ldt.o module.o \
-	ptrace.o ptrace_user.o semaphore.o sigcontext.o syscalls.o sysrq.o
+obj-y = bugs.o checksum.o fault.o ksyms.o ldt.o ptrace.o \
+	ptrace_user.o semaphore.o sigcontext.o syscalls.o sysrq.o time.o
 
 obj-$(CONFIG_HIGHMEM) += highmem.o
+obj-$(CONFIG_MODULES) += module.o
 
 USER_OBJS := bugs.o ptrace_user.o sigcontext.o fault.o
 USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file))
@@ -9,6 +10,8 @@
 SYMLINKS = semaphore.c highmem.c module.c
 SYMLINKS := $(foreach f,$(SYMLINKS),$(src)/$f)
 
+clean-files := $(SYMLINKS)
+
 semaphore.c-dir = kernel
 highmem.c-dir = mm
 module.c-dir = kernel
@@ -24,8 +27,7 @@
 $(SYMLINKS): 
 	$(call make_link,$@)
 
-clean:
-	$(MAKE) -C util clean
+subdir- := util
 
 fastdep:
 
--- diff/arch/um/sys-i386/bugs.c	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/um/sys-i386/bugs.c	2004-02-09 10:39:51.000000000 +0000
@@ -4,20 +4,21 @@
  */
 
 #include <unistd.h>
-#include <fcntl.h>
 #include <errno.h>
 #include <string.h>
 #include <sys/signal.h>
+#include <asm/ldt.h>
 #include "kern_util.h"
 #include "user.h"
 #include "sysdep/ptrace.h"
 #include "task.h"
+#include "os.h"
 
 #define MAXTOKEN 64
 
 /* Set during early boot */
-int cpu_has_cmov = 1;
-int cpu_has_xmm = 0;
+int host_has_cmov = 1;
+int host_has_xmm = 0;
 
 static char token(int fd, char *buf, int len, char stop)
 {
@@ -27,13 +28,15 @@
 	ptr = buf;
 	end = &buf[len];
 	do {
-		n = read(fd, ptr, sizeof(*ptr));
+		n = os_read_file(fd, ptr, sizeof(*ptr));
 		c = *ptr++;
-		if(n == 0) return(0);
-		else if(n != sizeof(*ptr)){
-			printk("Reading /proc/cpuinfo failed, "
-			       "errno = %d\n", errno);
-			return(-errno);
+		if(n != sizeof(*ptr)){
+			if(n == 0) return(0);
+			printk("Reading /proc/cpuinfo failed, err = %d\n", -n);
+			if(n < 0) 
+				return(n);
+			else 
+				return(-EIO);
 		}
 	} while((c != '\n') && (c != stop) && (ptr < end));
 
@@ -45,45 +48,79 @@
 	return(c);
 }
 
-static int check_cpu_feature(char *feature, int *have_it)
+static int find_cpuinfo_line(int fd, char *key, char *scratch, int len)
 {
-	char buf[MAXTOKEN], c;
-	int fd, len = sizeof(buf)/sizeof(buf[0]), n;
-
-	printk("Checking for host processor %s support...", feature);
-	fd = open("/proc/cpuinfo", O_RDONLY);
-	if(fd < 0){
-		printk("Couldn't open /proc/cpuinfo, errno = %d\n", errno);
-		return(0);
-	}
+	int n;
+	char c;
 
-	*have_it = 0;
-	buf[len - 1] = '\0';
+	scratch[len - 1] = '\0';
 	while(1){
-		c = token(fd, buf, len - 1, ':');
-		if(c <= 0) goto out;
+		c = token(fd, scratch, len - 1, ':');
+		if(c <= 0)
+			return(0);
 		else if(c != ':'){
 			printk("Failed to find ':' in /proc/cpuinfo\n");
-			goto out;
+			return(0);
 		}
 
-		if(!strncmp(buf, "flags", strlen("flags"))) break;
+		if(!strncmp(scratch, key, strlen(key))) 
+			return(1);
 
 		do {
-			n = read(fd, &c, sizeof(c));
+			n = os_read_file(fd, &c, sizeof(c));
 			if(n != sizeof(c)){
 				printk("Failed to find newline in "
-				       "/proc/cpuinfo, n = %d, errno = %d\n",
-				       n, errno);
-				goto out;
+				       "/proc/cpuinfo, err = %d\n", -n);
+				return(0);
 			}
 		} while(c != '\n');
 	}
+	return(0);
+}
+
+int cpu_feature(char *what, char *buf, int len)
+{
+	int fd, ret = 0;
+
+	fd = os_open_file("/proc/cpuinfo", of_read(OPENFLAGS()), 0);
+	if(fd < 0){
+		printk("Couldn't open /proc/cpuinfo, err = %d\n", -fd);
+		return(0);
+	}
+
+	if(!find_cpuinfo_line(fd, what, buf, len)){
+		printk("Couldn't find '%s' line in /proc/cpuinfo\n", what);
+		goto out_close;
+	}
+
+	token(fd, buf, len, '\n');
+	ret = 1;
+
+ out_close:
+	os_close_file(fd);
+	return(ret);
+}
+
+static int check_cpu_flag(char *feature, int *have_it)
+{
+	char buf[MAXTOKEN], c;
+	int fd, len = sizeof(buf)/sizeof(buf[0]);
+
+	printk("Checking for host processor %s support...", feature);
+	fd = os_open_file("/proc/cpuinfo", of_read(OPENFLAGS()), 0);
+	if(fd < 0){
+		printk("Couldn't open /proc/cpuinfo, err = %d\n", -fd);
+		return(0);
+	}
+
+	*have_it = 0;
+	if(!find_cpuinfo_line(fd, "flags", buf, sizeof(buf) / sizeof(buf[0])))
+		goto out;
 
 	c = token(fd, buf, len - 1, ' ');
 	if(c < 0) goto out;
 	else if(c != ' '){
-		printk("Failed to find ':' in /proc/cpuinfo\n");
+		printk("Failed to find ' ' in /proc/cpuinfo\n");
 		goto out;
 	}
 
@@ -100,21 +137,48 @@
  out:
 	if(*have_it == 0) printk("No\n");
 	else if(*have_it == 1) printk("Yes\n");
-	close(fd);
+	os_close_file(fd);
 	return(1);
 }
 
+#if 0 /* This doesn't work in tt mode, plus it's causing compilation problems
+       * for some people.
+       */
+static void disable_lcall(void)
+{
+	struct modify_ldt_ldt_s ldt;
+	int err;
+
+	bzero(&ldt, sizeof(ldt));
+	ldt.entry_number = 7;
+	ldt.base_addr = 0;
+	ldt.limit = 0;
+	err = modify_ldt(1, &ldt, sizeof(ldt));
+	if(err)
+		printk("Failed to disable lcall7 - errno = %d\n", errno);
+}
+#endif
+
+void arch_init_thread(void)
+{
+#if 0
+	disable_lcall();
+#endif
+}
+
 void arch_check_bugs(void)
 {
 	int have_it;
 
-	if(access("/proc/cpuinfo", R_OK)){
+	if(os_access("/proc/cpuinfo", OS_ACC_R_OK) < 0){
 		printk("/proc/cpuinfo not available - skipping CPU capability "
 		       "checks\n");
 		return;
 	}
-	if(check_cpu_feature("cmov", &have_it)) cpu_has_cmov = have_it;
-	if(check_cpu_feature("xmm", &have_it)) cpu_has_xmm = have_it;
+	if(check_cpu_flag("cmov", &have_it)) 
+		host_has_cmov = have_it;
+	if(check_cpu_flag("xmm", &have_it)) 
+		host_has_xmm = have_it;
 }
 
 int arch_handle_signal(int sig, union uml_pt_regs *regs)
@@ -130,18 +194,18 @@
 	if((*((char *) ip) != 0x0f) || ((*((char *) (ip + 1)) & 0xf0) != 0x40))
 		return(0);
 
-	if(cpu_has_cmov == 0)
+	if(host_has_cmov == 0)
 		panic("SIGILL caused by cmov, which this processor doesn't "
 		      "implement, boot a filesystem compiled for older "
 		      "processors");
-	else if(cpu_has_cmov == 1)
+	else if(host_has_cmov == 1)
 		panic("SIGILL caused by cmov, which this processor claims to "
 		      "implement");
-	else if(cpu_has_cmov == -1)
+	else if(host_has_cmov == -1)
 		panic("SIGILL caused by cmov, couldn't tell if this processor "
 		      "implements it, boot a filesystem compiled for older "
 		      "processors");
-	else panic("Bad value for cpu_has_cmov (%d)", cpu_has_cmov);
+	else panic("Bad value for host_has_cmov (%d)", host_has_cmov);
 	return(0);
 }
 
--- diff/arch/um/sys-i386/ptrace_user.c	2003-01-02 10:43:05.000000000 +0000
+++ source/arch/um/sys-i386/ptrace_user.c	2004-02-09 10:39:51.000000000 +0000
@@ -39,10 +39,10 @@
 	nregs = sizeof(dummy->u_debugreg)/sizeof(dummy->u_debugreg[0]);
 	for(i = 0; i < nregs; i++){
 		if((i == 4) || (i == 5)) continue;
-		if(ptrace(PTRACE_POKEUSR, pid, &dummy->u_debugreg[i],
+		if(ptrace(PTRACE_POKEUSER, pid, &dummy->u_debugreg[i],
 			  regs[i]) < 0)
-			printk("write_debugregs - ptrace failed, "
-			       "errno = %d\n", errno);
+			printk("write_debugregs - ptrace failed on "
+			       "register %d, errno = %d\n", errno);
 	}
 }
 
@@ -54,7 +54,7 @@
 	dummy = NULL;
 	nregs = sizeof(dummy->u_debugreg)/sizeof(dummy->u_debugreg[0]);
 	for(i = 0; i < nregs; i++){
-		regs[i] = ptrace(PTRACE_PEEKUSR, pid, 
+		regs[i] = ptrace(PTRACE_PEEKUSER, pid, 
 				 &dummy->u_debugreg[i], 0);
 	}
 }
--- diff/arch/um/sys-i386/util/Makefile	2003-05-21 11:49:50.000000000 +0100
+++ source/arch/um/sys-i386/util/Makefile	2004-02-09 10:39:51.000000000 +0000
@@ -6,10 +6,10 @@
 mk_sc-objs	:= mk_sc.o
 
 $(obj)/mk_thread : $(obj)/mk_thread_kern.o $(obj)/mk_thread_user.o
-	$(CC) $(CFLAGS) -o $@ $^
+	$(HOSTCC) $(CFLAGS) -o $@ $^
 
 $(obj)/mk_thread_user.o : $(src)/mk_thread_user.c
-	$(CC) $(USER_CFLAGS) -c -o $@ $<
+	$(HOSTCC) $(USER_CFLAGS) -c -o $@ $<
 
 clean :
 	$(RM) -f $(build-targets)
--- diff/arch/um/sys-i386/util/mk_sc.c	2002-10-16 04:28:35.000000000 +0100
+++ source/arch/um/sys-i386/util/mk_sc.c	2004-02-09 10:39:51.000000000 +0000
@@ -38,6 +38,7 @@
   SC_OFFSET("SC_ERR", err);
   SC_OFFSET("SC_CR2", cr2);
   SC_OFFSET("SC_FPSTATE", fpstate);
+  SC_OFFSET("SC_SIGMASK", oldmask);
   SC_FP_OFFSET("SC_FP_CW", cw);
   SC_FP_OFFSET("SC_FP_SW", sw);
   SC_FP_OFFSET("SC_FP_TAG", tag);
--- diff/arch/um/uml.lds.S	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/um/uml.lds.S	2004-02-09 10:39:51.000000000 +0000
@@ -9,7 +9,6 @@
 {
   . = START + SIZEOF_HEADERS;
 
-  . = ALIGN(4096);
   __binary_start = .;
 #ifdef MODE_TT
   .thread_private : {
@@ -26,7 +25,11 @@
   . = ALIGN(4096);		/* Init code and data */
   _stext = .;
   __init_begin = .;
-  .text.init : { *(.text.init) }
+  .init.text : { 
+	_sinittext = .;
+	*(.init.text)
+	_einittext = .;
+  }
   . = ALIGN(4096);
   .text      :
   {
@@ -38,7 +41,7 @@
 
   #include "asm/common.lds.S"
 
-  .data.init : { *(.data.init) }
+  init.data : { *(init.data) }
   .data    :
   {
     . = ALIGN(KERNEL_STACK_SIZE);		/* init_task */
--- diff/arch/um/util/Makefile	2003-05-21 11:49:50.000000000 +0100
+++ source/arch/um/util/Makefile	2004-02-09 10:39:51.000000000 +0000
@@ -3,19 +3,19 @@
 		   mk_constants_user.o mk_constants_kern.o
 
 $(obj)/mk_task: $(obj)/mk_task_user.o $(obj)/mk_task_kern.o
-	$(CC) -o $@ $^
+	$(HOSTCC) -o $@ $^
 
 $(obj)/mk_task_user.o: $(src)/mk_task_user.c
-	$(CC) -o $@ -c $< 
+	$(HOSTCC) -o $@ -c $< 
 
 $(obj)/mk_constants : $(obj)/mk_constants_user.o $(obj)/mk_constants_kern.o
-	$(CC) -o $@ $^
+	$(HOSTCC) -o $@ $^
 
 $(obj)/mk_constants_user.o : $(src)/mk_constants_user.c
-	$(CC) -c $< -o $@
+	$(HOSTCC) -c $< -o $@
 
 $(obj)/mk_constants_kern.o : $(src)/mk_constants_kern.c
-	$(CC) $(CFLAGS) -c $< -o $@
+	$(HOSTCC) $(CFLAGS) -c $< -o $@
 
 clean:
 	$(RM) $(build-targets)
--- diff/arch/um/util/mk_constants_kern.c	2003-10-09 09:47:16.000000000 +0100
+++ source/arch/um/util/mk_constants_kern.c	2004-02-09 10:39:51.000000000 +0000
@@ -1,5 +1,6 @@
 #include "linux/kernel.h"
 #include "linux/stringify.h"
+#include "linux/time.h"
 #include "asm/page.h"
 
 extern void print_head(void);
@@ -11,6 +12,7 @@
 {
   print_head();
   print_constant_int("UM_KERN_PAGE_SIZE", PAGE_SIZE);
+
   print_constant_str("UM_KERN_EMERG", KERN_EMERG);
   print_constant_str("UM_KERN_ALERT", KERN_ALERT);
   print_constant_str("UM_KERN_CRIT", KERN_CRIT);
@@ -19,6 +21,8 @@
   print_constant_str("UM_KERN_NOTICE", KERN_NOTICE);
   print_constant_str("UM_KERN_INFO", KERN_INFO);
   print_constant_str("UM_KERN_DEBUG", KERN_DEBUG);
+
+  print_constant_int("UM_NSEC_PER_SEC", NSEC_PER_SEC);
   print_tail();
   return(0);
 }
--- diff/arch/x86_64/Kconfig	2004-02-09 10:36:09.000000000 +0000
+++ source/arch/x86_64/Kconfig	2004-02-09 10:39:51.000000000 +0000
@@ -111,10 +111,6 @@
 	bool
 	default y
 
-config X86_GOOD_APIC
-	bool
-	default y
-
 config X86_MSR
 	tristate "/dev/cpu/*/msr - Model-specific register support"
 	help
@@ -433,6 +429,7 @@
 config DEBUG_INFO
 	bool "Compile the kernel with debug info"
 	depends on DEBUG_KERNEL
+	default n
 	help
           If you say Y here the resulting kernel image will include
 	  debugging info resulting in a larger kernel image.
@@ -464,9 +461,8 @@
        help
          Add a simple leak tracer to the IOMMU code. This is useful when you
 	 are debugging a buggy device driver that leaks IOMMU mappings.
-       
-#config X86_REMOTE_DEBUG
-#       bool "kgdb debugging stub"
+
+source "arch/x86_64/Kconfig.kgdb"
 
 endmenu
 
--- diff/arch/x86_64/Makefile	2004-02-09 10:36:09.000000000 +0000
+++ source/arch/x86_64/Makefile	2004-02-09 10:39:51.000000000 +0000
@@ -52,7 +52,10 @@
 ifneq ($(CONFIG_DEBUG_INFO),y)
 CFLAGS += -fno-asynchronous-unwind-tables
 endif
-#CFLAGS += $(call check_gcc,-funit-at-a-time,)
+
+# Enable unit-at-a-time mode when possible. It shrinks the
+# kernel considerably.
+CFLAGS += $(call check_gcc,-funit-at-a-time,)
 
 head-y := arch/x86_64/kernel/head.o arch/x86_64/kernel/head64.o arch/x86_64/kernel/init_task.o
 
--- diff/arch/x86_64/ia32/sys_ia32.c	2004-02-09 10:36:09.000000000 +0000
+++ source/arch/x86_64/ia32/sys_ia32.c	2004-02-09 10:39:51.000000000 +0000
@@ -274,13 +274,16 @@
 		return -EINVAL;
 
 	if (act) {
+		compat_uptr_t handler, restorer;
+
 		if (verify_area(VERIFY_READ, act, sizeof(*act)) ||
-		    __get_user((long)new_ka.sa.sa_handler, &act->sa_handler) ||
+		    __get_user(handler, &act->sa_handler) ||
 		    __get_user(new_ka.sa.sa_flags, &act->sa_flags) ||
-		    __get_user((long)new_ka.sa.sa_restorer, &act->sa_restorer)||
+		    __get_user(restorer, &act->sa_restorer)||
 		    __copy_from_user(&set32, &act->sa_mask, sizeof(compat_sigset_t)))
 			return -EFAULT;
-
+		new_ka.sa.sa_handler = compat_ptr(handler);
+		new_ka.sa.sa_restorer = compat_ptr(restorer);
 		/* FIXME: here we rely on _COMPAT_NSIG_WORS to be >= than _NSIG_WORDS << 1 */
 		switch (_NSIG_WORDS) {
 		case 4: new_ka.sa.sa_mask.sig[3] = set32.sig[6]
@@ -331,13 +334,18 @@
 
         if (act) {
 		compat_old_sigset_t mask;
+		compat_uptr_t handler, restorer;
 
 		if (verify_area(VERIFY_READ, act, sizeof(*act)) ||
-		    __get_user((long)new_ka.sa.sa_handler, &act->sa_handler) ||
+		    __get_user(handler, &act->sa_handler) ||
 		    __get_user(new_ka.sa.sa_flags, &act->sa_flags) ||
-		    __get_user((long)new_ka.sa.sa_restorer, &act->sa_restorer) ||
+		    __get_user(restorer, &act->sa_restorer) ||
 		    __get_user(mask, &act->sa_mask))
 			return -EFAULT;
+
+		new_ka.sa.sa_handler = compat_ptr(handler);
+		new_ka.sa.sa_restorer = compat_ptr(restorer);
+
 		siginitset(&new_ka.sa.sa_mask, mask);
         }
 
@@ -525,7 +533,7 @@
 	put_user(reclen, &dirent->d_reclen);
 	copy_to_user(dirent->d_name, name, namlen);
 	put_user(0, dirent->d_name + namlen);
-	((char *) dirent) += reclen;
+	dirent = ((void *)dirent) + reclen;
 	buf->current_dir = dirent;
 	buf->count -= reclen;
 	return 0;
--- diff/arch/x86_64/kernel/Makefile	2004-01-19 10:22:55.000000000 +0000
+++ source/arch/x86_64/kernel/Makefile	2004-02-09 10:39:51.000000000 +0000
@@ -24,6 +24,7 @@
 obj-$(CONFIG_DUMMY_IOMMU)	+= pci-nommu.o pci-dma.o
 
 obj-$(CONFIG_MODULES)		+= module.o
+obj-$(CONFIG_KGDB)		+= kgdb_stub.o
 
 obj-y				+= topology.o
 
--- diff/arch/x86_64/kernel/acpi/boot.c	2004-02-09 10:36:09.000000000 +0000
+++ source/arch/x86_64/kernel/acpi/boot.c	2004-02-09 10:39:51.000000000 +0000
@@ -51,8 +51,8 @@
 int acpi_noirq __initdata = 0;	/* skip ACPI IRQ initialization */
 int acpi_ht __initdata = 1;	/* enable HT */
 
-int acpi_lapic = 0;
-int acpi_ioapic = 0;
+int acpi_lapic;
+int acpi_ioapic;
 
 /* --------------------------------------------------------------------------
                               Boot-time Configuration
@@ -439,7 +439,7 @@
 	 * and (optionally) overriden by a LAPIC_ADDR_OVR entry (64-bit value).
 	 */
 
-	result = acpi_table_parse_madt(ACPI_MADT_LAPIC_ADDR_OVR, acpi_parse_lapic_addr_ovr);
+	result = acpi_table_parse_madt(ACPI_MADT_LAPIC_ADDR_OVR, acpi_parse_lapic_addr_ovr, 0);
 	if (result < 0) {
 		printk(KERN_ERR PREFIX "Error parsing LAPIC address override entry\n");
 		return result;
@@ -447,7 +447,8 @@
 
 	mp_register_lapic_address(acpi_lapic_addr);
 
-	result = acpi_table_parse_madt(ACPI_MADT_LAPIC, acpi_parse_lapic);
+	result = acpi_table_parse_madt(ACPI_MADT_LAPIC, acpi_parse_lapic,
+				       MAX_APICS);
 	if (!result) { 
 		printk(KERN_ERR PREFIX "No LAPIC entries present\n");
 		/* TBD: Cleanup to allow fallback to MPS */
@@ -459,7 +460,7 @@
 		return result;
 	}
 
-	result = acpi_table_parse_madt(ACPI_MADT_LAPIC_NMI, acpi_parse_lapic_nmi);
+	result = acpi_table_parse_madt(ACPI_MADT_LAPIC_NMI, acpi_parse_lapic_nmi, 0);
 	if (result < 0) {
 		printk(KERN_ERR PREFIX "Error parsing LAPIC NMI entry\n");
 		/* TBD: Cleanup to allow fallback to MPS */
@@ -496,8 +497,8 @@
 		return 1;
 	}
 
-	result = acpi_table_parse_madt(ACPI_MADT_IOAPIC, acpi_parse_ioapic);
-	if (!result) { 
+	result = acpi_table_parse_madt(ACPI_MADT_IOAPIC, acpi_parse_ioapic, MAX_IO_APICS);
+	if (!result) {
 		printk(KERN_ERR PREFIX "No IOAPIC entries present\n");
 		return -ENODEV;
 	}
@@ -509,14 +510,15 @@
 	/* Build a default routing table for legacy (ISA) interrupts. */
 	mp_config_acpi_legacy_irqs();
 
-	result = acpi_table_parse_madt(ACPI_MADT_INT_SRC_OVR, acpi_parse_int_src_ovr);
+	result = acpi_table_parse_madt(ACPI_MADT_INT_SRC_OVR, acpi_parse_int_src_ovr, NR_IRQ_VECTORS);
 	if (result < 0) {
 		printk(KERN_ERR PREFIX "Error parsing interrupt source overrides entry\n");
 		/* TBD: Cleanup to allow fallback to MPS */
 		return result;
 	}
 
-	result = acpi_table_parse_madt(ACPI_MADT_NMI_SRC, acpi_parse_nmi_src);
+	result = acpi_table_parse_madt(ACPI_MADT_NMI_SRC, acpi_parse_nmi_src,
+				       NR_IRQ_VECTORS);
 	if (result < 0) {
 		printk(KERN_ERR PREFIX "Error parsing NMI SRC entry\n");
 		/* TBD: Cleanup to allow fallback to MPS */
--- diff/arch/x86_64/kernel/aperture.c	2003-08-26 10:00:52.000000000 +0100
+++ source/arch/x86_64/kernel/aperture.c	2004-02-09 10:39:51.000000000 +0000
@@ -87,13 +87,15 @@
 /* Find a PCI capability */ 
 static __u32 __init find_cap(int num, int slot, int func, int cap) 
 { 
+	u8 pos;
+	int bytes;
 	if (!(read_pci_config_16(num,slot,func,PCI_STATUS) & PCI_STATUS_CAP_LIST))
 		return 0;
-	u8 pos = read_pci_config_byte(num,slot,func,PCI_CAPABILITY_LIST);
-	int bytes;
+	pos = read_pci_config_byte(num,slot,func,PCI_CAPABILITY_LIST);
 	for (bytes = 0; bytes < 48 && pos >= 0x40; bytes++) { 
+		u8 id;
 		pos &= ~3; 
-		u8 id = read_pci_config_byte(num,slot,func,pos+PCI_CAP_LIST_ID); 
+		id = read_pci_config_byte(num,slot,func,pos+PCI_CAP_LIST_ID);
 		if (id == 0xff)
 			break;
 		if (id == cap) 
@@ -106,26 +108,31 @@
 /* Read a standard AGPv3 bridge header */
 static __u32 __init read_agp(int num, int slot, int func, int cap, u32 *order)
 { 
-	printk("AGP bridge at %02x:%02x:%02x\n", num, slot, func); 
-	u32 apsizereg = read_pci_config_16(num,slot,func, cap + 0x14);
+	u32 apsize;
+	u32 apsizereg;
+	int nbits;
+	u32 aper_low, aper_hi;
+	u64 aper;
 
+	printk("AGP bridge at %02x:%02x:%02x\n", num, slot, func);
+	apsizereg = read_pci_config_16(num,slot,func, cap + 0x14);
 	if (apsizereg == 0xffffffff) {
 		printk("APSIZE in AGP bridge unreadable\n");
 		return 0;
 	}
 
-	u32 apsize = apsizereg & 0xfff;
+	apsize = apsizereg & 0xfff;
 	/* Some BIOS use weird encodings not in the AGPv3 table. */
 	if (apsize & 0xff) 
 		apsize |= 0xf00; 
-	int nbits = hweight16(apsize);
+	nbits = hweight16(apsize);
 	*order = 7 - nbits;
 	if ((int)*order < 0) /* < 32MB */
 		*order = 0;
 	
-	u32 aper_low = read_pci_config(num,slot,func, 0x10); 
-	u32 aper_hi = read_pci_config(num,slot,func,0x14); 
-	u64 aper = (aper_low & ~((1<<22)-1)) | ((u64)aper_hi << 32); 
+	aper_low = read_pci_config(num,slot,func, 0x10);
+	aper_hi = read_pci_config(num,slot,func,0x14);
+	aper = (aper_low & ~((1<<22)-1)) | ((u64)aper_hi << 32);
 
 	printk("Aperture from AGP @ %Lx size %u MB (APSIZE %x)\n", 
 	       aper, 32 << *order, apsizereg);
@@ -155,6 +162,7 @@
 		for (slot = 0; slot < 32; slot++) { 
 			for (func = 0; func < 8; func++) { 
 				u32 class, cap;
+				u8 type;
 				class = read_pci_config(num,slot,func,
 							PCI_CLASS_REVISION);
 				if (class == 0xffffffff)
@@ -172,7 +180,7 @@
 				} 
 				
 				/* No multi-function device? */
-				u8 type = read_pci_config_byte(num,slot,func,
+				type = read_pci_config_byte(num,slot,func,
 							       PCI_HEADER_TYPE);
 				if (!(type & 0x80))
 					break;
--- diff/arch/x86_64/kernel/early_printk.c	2003-06-09 14:18:18.000000000 +0100
+++ source/arch/x86_64/kernel/early_printk.c	2004-02-09 10:39:51.000000000 +0000
@@ -155,7 +155,7 @@
 	int n; 
 	va_list ap;
 	va_start(ap,fmt); 
-	n = vsnprintf(buf,512,fmt,ap);
+	n = vscnprintf(buf,512,fmt,ap);
 	early_console->write(early_console,buf,n);
 	va_end(ap); 
 } 
--- diff/arch/x86_64/kernel/entry.S	2004-02-09 10:36:09.000000000 +0000
+++ source/arch/x86_64/kernel/entry.S	2004-02-09 10:39:51.000000000 +0000
@@ -436,7 +436,7 @@
 	popq  %rdi
 	cli	
 	subl $1,%gs:pda_irqcount
-#ifdef CONFIG_KGDB
+#ifdef CONFIG_DEBUG_INFO
 	movq RBP(%rdi),%rbp
 #endif
 	leaq ARGOFFSET(%rdi),%rsp
--- diff/arch/x86_64/kernel/irq.c	2004-01-19 10:22:55.000000000 +0000
+++ source/arch/x86_64/kernel/irq.c	2004-02-09 10:39:51.000000000 +0000
@@ -405,6 +405,9 @@
 	spin_unlock(&desc->lock);
 
 	irq_exit();
+
+	kgdb_process_breakpoint();
+
 	return 1;
 }
 
--- diff/arch/x86_64/kernel/nmi.c	2003-09-30 15:46:12.000000000 +0100
+++ source/arch/x86_64/kernel/nmi.c	2004-02-09 10:39:51.000000000 +0000
@@ -311,11 +311,11 @@
 
 void nmi_watchdog_tick (struct pt_regs * regs, unsigned reason)
 {
+	int sum, cpu = safe_smp_processor_id();
+
 	if (nmi_watchdog_disabled)
 		return;
 
-	int sum, cpu = safe_smp_processor_id();
-
 	sum = read_pda(apic_timer_irqs);
 	if (last_irq_sums[cpu] == sum) {
 		/*
--- diff/arch/x86_64/kernel/pci-gart.c	2004-02-09 10:36:09.000000000 +0000
+++ source/arch/x86_64/kernel/pci-gart.c	2004-02-09 10:39:51.000000000 +0000
@@ -117,11 +117,11 @@
 
 static void free_iommu(unsigned long offset, int size)
 { 
+	unsigned long flags;
 	if (size == 1) { 
 		clear_bit(offset, iommu_gart_bitmap); 
 		return;
 	}
-	unsigned long flags;
 	spin_lock_irqsave(&iommu_bitmap_lock, flags);
 	__clear_bit_string(iommu_gart_bitmap, offset, size);
 	spin_unlock_irqrestore(&iommu_bitmap_lock, flags);
@@ -329,6 +329,7 @@
 { 
 	unsigned long npages = to_pages(phys_mem, size);
 	unsigned long iommu_page = alloc_iommu(npages);
+	int i;
 	if (iommu_page == -1) {
 		if (!nonforced_iommu(dev, phys_mem, size))
 			return phys_mem; 
@@ -338,7 +339,6 @@
 		return bad_dma_address;
 	}
 
-	int i;
 	for (i = 0; i < npages; i++) {
 		iommu_gatt_base[iommu_page + i] = GPTE_ENCODE(phys_mem);
 		SET_LEAK(iommu_page + i);
@@ -398,11 +398,11 @@
 		      struct scatterlist *sout, unsigned long pages)
 {
 	unsigned long iommu_start = alloc_iommu(pages);
-	if (iommu_start == -1)
-		return -1;
-
 	unsigned long iommu_page = iommu_start; 
 	int i;
+
+	if (iommu_start == -1)
+		return -1;
 	
 	for (i = start; i < stopat; i++) {
 		struct scatterlist *s = &sg[i];
@@ -519,12 +519,12 @@
 {
 	unsigned long iommu_page; 
 	int npages;
+	int i;
 	if (dma_addr < iommu_bus_base + EMERGENCY_PAGES*PAGE_SIZE || 
 	    dma_addr > iommu_bus_base + iommu_size)
 		return;
 	iommu_page = (dma_addr - iommu_bus_base)>>PAGE_SHIFT;	
 	npages = to_pages(dma_addr, size);
-	int i;
 	for (i = 0; i < npages; i++) { 
 		iommu_gatt_base[iommu_page + i] = 0; 
 		CLEAR_LEAK(iommu_page + i);
--- diff/arch/x86_64/kernel/smp.c	2003-11-25 15:24:57.000000000 +0000
+++ source/arch/x86_64/kernel/smp.c	2004-02-09 10:39:51.000000000 +0000
@@ -362,6 +362,18 @@
 	send_IPI_mask(cpumask_of_cpu(cpu), RESCHEDULE_VECTOR);
 }
 
+#ifdef CONFIG_KGDB
+/*
+ * By using the NMI code instead of a vector we just sneak thru the
+ * word generator coming out with just what we want.  AND it does
+ * not matter if clustered_apic_mode is set or not.
+ */
+void smp_send_nmi_allbutself(void)
+{
+	send_IPI_allbutself(APIC_DM_NMI);
+}
+#endif
+
 /*
  * Structure and data for smp_call_function(). This is designed to minimise
  * static memory requirements. It also looks cleaner.
--- diff/arch/x86_64/kernel/suspend_asm.S	2002-12-30 10:17:12.000000000 +0000
+++ source/arch/x86_64/kernel/suspend_asm.S	2004-02-09 10:39:51.000000000 +0000
@@ -122,4 +122,4 @@
 	.quad 0
 loop2:	
 	.quad 0		
-	.previous
\ No newline at end of file
+	.previous
--- diff/arch/x86_64/kernel/sys_x86_64.c	2004-02-09 10:36:09.000000000 +0000
+++ source/arch/x86_64/kernel/sys_x86_64.c	2004-02-09 10:39:51.000000000 +0000
@@ -105,13 +105,13 @@
 		return -ENOMEM;
 
 	if (addr) {
-	addr = PAGE_ALIGN(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;
+	} else
+		addr = mm->free_area_cache;
 	if (addr < begin) 
 		addr = begin; 
 	start_addr = addr;
--- diff/arch/x86_64/kernel/traps.c	2004-02-09 10:36:09.000000000 +0000
+++ source/arch/x86_64/kernel/traps.c	2004-02-09 10:39:51.000000000 +0000
@@ -45,6 +45,9 @@
 #include <asm/proto.h>
 
 #include <linux/irq.h>
+#ifdef CONFIG_KGDB
+#include <asm/kgdb.h>
+#endif
 
 extern struct gate_struct idt_table[256]; 
 
--- diff/arch/x86_64/lib/Makefile	2003-06-30 10:07:20.000000000 +0100
+++ source/arch/x86_64/lib/Makefile	2004-02-09 10:39:51.000000000 +0000
@@ -11,3 +11,4 @@
 
 lib-$(CONFIG_IO_DEBUG) += iodebug.o
 lib-$(CONFIG_HAVE_DEC_LOCK) += dec_and_lock.o
+lib-$(CONFIG_KGDB) += kgdb_serial.o
--- diff/arch/x86_64/lib/csum-partial.c	2003-10-09 09:47:33.000000000 +0100
+++ source/arch/x86_64/lib/csum-partial.c	2004-02-09 10:39:51.000000000 +0000
@@ -56,6 +56,8 @@
 		}
 		count >>= 1;		/* nr of 32-bit words.. */
 		if (count) {
+			unsigned long zero;
+			unsigned count64;
 			if (4 & (unsigned long) buff) {
 				result += *(unsigned int *) buff;
 				count--;
@@ -65,8 +67,8 @@
 			count >>= 1;	/* nr of 64-bit words.. */
 
 			/* main loop using 64byte blocks */
-				unsigned long zero = 0; 
-			unsigned count64 = count >> 3; 
+			zero = 0;
+			count64 = count >> 3;
 			while (count64) { 
 				asm("addq 0*8(%[src]),%[res]\n\t"
 				    "adcq 1*8(%[src]),%[res]\n\t"
--- diff/arch/x86_64/mm/fault.c	2004-02-09 10:36:09.000000000 +0000
+++ source/arch/x86_64/mm/fault.c	2004-02-09 10:39:51.000000000 +0000
@@ -142,6 +142,10 @@
 void dump_pagetable(unsigned long address)
 {
 	pml4_t *pml4;
+	pgd_t *pgd;
+	pmd_t *pmd;
+	pte_t *pte;
+
 	asm("movq %%cr3,%0" : "=r" (pml4));
 
 	pml4 = __va((unsigned long)pml4 & PHYSICAL_PAGE_MASK); 
@@ -150,17 +154,17 @@
 	if (bad_address(pml4)) goto bad;
 	if (!pml4_present(*pml4)) goto ret; 
 
-	pgd_t *pgd = __pgd_offset_k((pgd_t *)pml4_page(*pml4), address); 
+	pgd = __pgd_offset_k((pgd_t *)pml4_page(*pml4), address);
 	if (bad_address(pgd)) goto bad;
 	printk("PGD %lx ", pgd_val(*pgd)); 
 	if (!pgd_present(*pgd))	goto ret;
 
-	pmd_t *pmd = pmd_offset(pgd, address); 
+	pmd = pmd_offset(pgd, address);
 	if (bad_address(pmd)) goto bad;
 	printk("PMD %lx ", pmd_val(*pmd));
 	if (!pmd_present(*pmd))	goto ret;	 
 
-	pte_t *pte = pte_offset_kernel(pmd, address);
+	pte = pte_offset_kernel(pmd, address);
 	if (bad_address(pte)) goto bad;
 	printk("PTE %lx", pte_val(*pte)); 
 ret:
--- diff/arch/x86_64/mm/init.c	2003-10-09 09:47:33.000000000 +0100
+++ source/arch/x86_64/mm/init.c	2004-02-09 10:39:51.000000000 +0000
@@ -39,7 +39,7 @@
 
 #define Dprintk(x...)
 
-extern char _stext;
+extern char _stext[];
 
 DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
 
@@ -80,7 +80,7 @@
 
 /* References to section boundaries */
 
-extern char _text, _etext, _edata, __bss_start, _end;
+extern char _text, _etext, _edata, __bss_start, _end[];
 extern char __init_begin, __init_end;
 
 int after_bootmem;
@@ -442,7 +442,7 @@
 	kclist_add(&kcore_mem, __va(0), max_low_pfn << PAGE_SHIFT); 
 	kclist_add(&kcore_vmalloc, (void *)VMALLOC_START, 
 		   VMALLOC_END-VMALLOC_START);
-	kclist_add(&kcore_kernel, &_stext, &_end - &_stext); 
+	kclist_add(&kcore_kernel, &_stext, _end - _stext);
 	kclist_add(&kcore_modules, (void *)MODULES_VADDR, MODULES_LEN);
 	kclist_add(&kcore_vsyscall, (void *)VSYSCALL_START, 
 				 VSYSCALL_END - VSYSCALL_START);
--- diff/drivers/Kconfig	2004-02-09 10:36:09.000000000 +0000
+++ source/drivers/Kconfig	2004-02-09 10:39:52.000000000 +0000
@@ -26,6 +26,8 @@
 
 source "drivers/message/i2o/Kconfig"
 
+source "drivers/macintosh/Kconfig"
+
 source "net/Kconfig"
 
 source "drivers/isdn/Kconfig"
--- diff/drivers/acpi/Kconfig	2004-01-19 10:22:55.000000000 +0000
+++ source/drivers/acpi/Kconfig	2004-02-09 10:39:52.000000000 +0000
@@ -263,5 +263,23 @@
 	  particular, many Toshiba laptops require this for correct operation
 	  of the AC module.
 
+config X86_PM_TIMER
+	bool "Power Management Timer Support"
+	depends on X86 && ACPI
+	depends on ACPI_BOOT && EXPERIMENTAL
+	default n
+	help
+	  The Power Management Timer is available on all ACPI-capable,
+	  in most cases even if ACPI is unusable or blacklisted.
+
+	  This timing source is not affected by powermanagement features
+	  like aggressive processor idling, throttling, frequency and/or
+	  voltage scaling, unlike the commonly used Time Stamp Counter
+	  (TSC) timing source.
+
+	  So, if you see messages like 'Losing too many ticks!' in the
+	  kernel logs, and/or you are using a this on a notebook which
+	  does not yet have an HPET, you should say "Y" here.
+
 endmenu
 
--- diff/drivers/acpi/ac.c	2004-02-09 10:36:09.000000000 +0000
+++ source/drivers/acpi/ac.c	2004-02-09 10:39:52.000000000 +0000
@@ -246,8 +246,8 @@
 	memset(ac, 0, sizeof(struct acpi_ac));
 
 	ac->handle = device->handle;
-	sprintf(acpi_device_name(device), "%s", ACPI_AC_DEVICE_NAME);
-	sprintf(acpi_device_class(device), "%s", ACPI_AC_CLASS);
+	strcpy(acpi_device_name(device), ACPI_AC_DEVICE_NAME);
+	strcpy(acpi_device_class(device), ACPI_AC_CLASS);
 	acpi_driver_data(device) = ac;
 
 	result = acpi_ac_get_state(ac);
--- diff/drivers/acpi/asus_acpi.c	2004-02-09 10:36:09.000000000 +0000
+++ source/drivers/acpi/asus_acpi.c	2004-02-09 10:39:52.000000000 +0000
@@ -869,8 +869,8 @@
 	memset(hotk, 0, sizeof(struct asus_hotk));
 
 	hotk->handle = device->handle;
-	sprintf(acpi_device_name(device), "%s", ACPI_HOTK_DEVICE_NAME);
-	sprintf(acpi_device_class(device), "%s", ACPI_HOTK_CLASS);
+	strcpy(acpi_device_name(device), ACPI_HOTK_DEVICE_NAME);
+	strcpy(acpi_device_class(device), ACPI_HOTK_CLASS);
 	acpi_driver_data(device) = hotk;
 	hotk->device = device;
 
--- diff/drivers/acpi/battery.c	2004-02-09 10:36:09.000000000 +0000
+++ source/drivers/acpi/battery.c	2004-02-09 10:39:52.000000000 +0000
@@ -735,8 +735,8 @@
 	memset(battery, 0, sizeof(struct acpi_battery));
 
 	battery->handle = device->handle;
-	sprintf(acpi_device_name(device), "%s", ACPI_BATTERY_DEVICE_NAME);
-	sprintf(acpi_device_class(device), "%s", ACPI_BATTERY_CLASS);
+	strcpy(acpi_device_name(device), ACPI_BATTERY_DEVICE_NAME);
+	strcpy(acpi_device_class(device), ACPI_BATTERY_CLASS);
 	acpi_driver_data(device) = battery;
 
 	result = acpi_battery_check(battery);
--- diff/drivers/acpi/bus.c	2004-02-09 10:36:09.000000000 +0000
+++ source/drivers/acpi/bus.c	2004-02-09 10:39:52.000000000 +0000
@@ -296,8 +296,8 @@
 	if (!event)
 		return_VALUE(-ENOMEM);
 
-	sprintf(event->device_class, "%s", device->pnp.device_class);
-	sprintf(event->bus_id, "%s", device->pnp.bus_id);
+	strcpy(event->device_class, device->pnp.device_class);
+	strcpy(event->bus_id, device->pnp.bus_id);
 	event->type = type;
 	event->data = data;
 
--- diff/drivers/acpi/button.c	2004-02-09 10:36:09.000000000 +0000
+++ source/drivers/acpi/button.c	2004-02-09 10:39:52.000000000 +0000
@@ -316,35 +316,35 @@
 	 */
 	if (!strcmp(acpi_device_hid(device), ACPI_BUTTON_HID_POWER)) {
 		button->type = ACPI_BUTTON_TYPE_POWER;
-		sprintf(acpi_device_name(device), "%s",
+		strcpy(acpi_device_name(device),
 			ACPI_BUTTON_DEVICE_NAME_POWER);
 		sprintf(acpi_device_class(device), "%s/%s", 
 			ACPI_BUTTON_CLASS, ACPI_BUTTON_SUBCLASS_POWER);
 	}
 	else if (!strcmp(acpi_device_hid(device), ACPI_BUTTON_HID_POWERF)) {
 		button->type = ACPI_BUTTON_TYPE_POWERF;
-		sprintf(acpi_device_name(device), "%s",
+		strcpy(acpi_device_name(device),
 			ACPI_BUTTON_DEVICE_NAME_POWERF);
 		sprintf(acpi_device_class(device), "%s/%s", 
 			ACPI_BUTTON_CLASS, ACPI_BUTTON_SUBCLASS_POWER);
 	}
 	else if (!strcmp(acpi_device_hid(device), ACPI_BUTTON_HID_SLEEP)) {
 		button->type = ACPI_BUTTON_TYPE_SLEEP;
-		sprintf(acpi_device_name(device), "%s",
+		strcpy(acpi_device_name(device),
 			ACPI_BUTTON_DEVICE_NAME_SLEEP);
 		sprintf(acpi_device_class(device), "%s/%s", 
 			ACPI_BUTTON_CLASS, ACPI_BUTTON_SUBCLASS_SLEEP);
 	}
 	else if (!strcmp(acpi_device_hid(device), ACPI_BUTTON_HID_SLEEPF)) {
 		button->type = ACPI_BUTTON_TYPE_SLEEPF;
-		sprintf(acpi_device_name(device), "%s",
+		strcpy(acpi_device_name(device),
 			ACPI_BUTTON_DEVICE_NAME_SLEEPF);
 		sprintf(acpi_device_class(device), "%s/%s", 
 			ACPI_BUTTON_CLASS, ACPI_BUTTON_SUBCLASS_SLEEP);
 	}
 	else if (!strcmp(acpi_device_hid(device), ACPI_BUTTON_HID_LID)) {
 		button->type = ACPI_BUTTON_TYPE_LID;
-		sprintf(acpi_device_name(device), "%s",
+		strcpy(acpi_device_name(device),
 			ACPI_BUTTON_DEVICE_NAME_LID);
 		sprintf(acpi_device_class(device), "%s/%s", 
 			ACPI_BUTTON_CLASS, ACPI_BUTTON_SUBCLASS_LID);
--- diff/drivers/acpi/ec.c	2004-02-09 10:36:09.000000000 +0000
+++ source/drivers/acpi/ec.c	2004-02-09 10:39:52.000000000 +0000
@@ -578,8 +578,8 @@
 	ec->handle = device->handle;
 	ec->uid = -1;
 	ec->lock = SPIN_LOCK_UNLOCKED;
-	sprintf(acpi_device_name(device), "%s", ACPI_EC_DEVICE_NAME);
-	sprintf(acpi_device_class(device), "%s", ACPI_EC_CLASS);
+	strcpy(acpi_device_name(device), ACPI_EC_DEVICE_NAME);
+	strcpy(acpi_device_class(device), ACPI_EC_CLASS);
 	acpi_driver_data(device) = ec;
 
 	/* Use the global lock for all EC transactions? */
--- diff/drivers/acpi/fan.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/acpi/fan.c	2004-02-09 10:39:52.000000000 +0000
@@ -214,8 +214,8 @@
 	memset(fan, 0, sizeof(struct acpi_fan));
 
 	fan->handle = device->handle;
-	sprintf(acpi_device_name(device), "%s", ACPI_FAN_DEVICE_NAME);
-	sprintf(acpi_device_class(device), "%s", ACPI_FAN_CLASS);
+	strcpy(acpi_device_name(device), ACPI_FAN_DEVICE_NAME);
+	strcpy(acpi_device_class(device), ACPI_FAN_CLASS);
 	acpi_driver_data(device) = fan;
 
 	result = acpi_bus_get_power(fan->handle, &state);
--- diff/drivers/acpi/numa.c	2003-02-26 16:01:07.000000000 +0000
+++ source/drivers/acpi/numa.c	2004-02-09 10:39:52.000000000 +0000
@@ -30,8 +30,9 @@
 #include <linux/errno.h>
 #include <linux/acpi.h>
 #include <acpi/acpi_bus.h>
+#include <acpi/acmacros.h>
 
-extern int __init acpi_table_parse_madt_family (enum acpi_table_id id, unsigned long madt_size, int entry_id, acpi_madt_entry_handler handler);
+extern int __init acpi_table_parse_madt_family (enum acpi_table_id id, unsigned long madt_size, int entry_id, acpi_madt_entry_handler handler, unsigned int max_entries);
 
 void __init
 acpi_table_print_srat_entry (
@@ -46,9 +47,9 @@
 	{
 		struct acpi_table_processor_affinity *p =
 			(struct acpi_table_processor_affinity*) header;
-		printk(KERN_INFO PREFIX "SRAT Processor (id[0x%02x] eid[0x%02x]) in proximity domain %d %s\n",
+		ACPI_DEBUG_PRINT((ACPI_DB_INFO "SRAT Processor (id[0x%02x] eid[0x%02x]) in proximity domain %d %s\n",
 		       p->apic_id, p->lsapic_eid, p->proximity_domain,
-		       p->flags.enabled?"enabled":"disabled");
+		       p->flags.enabled?"enabled":"disabled"));
 	}
 		break;
 
@@ -56,11 +57,11 @@
 	{
 		struct acpi_table_memory_affinity *p =
 			(struct acpi_table_memory_affinity*) header;
-		printk(KERN_INFO PREFIX "SRAT Memory (0x%08x%08x length 0x%08x%08x type 0x%x) in proximity domain %d %s%s\n",
+		ACPI_DEBUG_PRINT((ACPI_DB_INFO "SRAT Memory (0x%08x%08x length 0x%08x%08x type 0x%x) in proximity domain %d %s%s\n",
 		       p->base_addr_hi, p->base_addr_lo, p->length_hi, p->length_lo,
 		       p->memory_type, p->proximity_domain,
 		       p->flags.enabled ? "enabled" : "disabled",
-		       p->flags.hot_pluggable ? " hot-pluggable" : "");
+		       p->flags.hot_pluggable ? " hot-pluggable" : ""));
 	}
 		break;
 
@@ -97,7 +98,7 @@
 static int __init
 acpi_parse_processor_affinity (acpi_table_entry_header *header)
 {
-	struct acpi_table_processor_affinity *processor_affinity = NULL;
+	struct acpi_table_processor_affinity *processor_affinity;
 
 	processor_affinity = (struct acpi_table_processor_affinity*) header;
 	if (!processor_affinity)
@@ -115,7 +116,7 @@
 static int __init
 acpi_parse_memory_affinity (acpi_table_entry_header *header)
 {
-	struct acpi_table_memory_affinity *memory_affinity = NULL;
+	struct acpi_table_memory_affinity *memory_affinity;
 
 	memory_affinity = (struct acpi_table_memory_affinity*) header;
 	if (!memory_affinity)
@@ -133,7 +134,7 @@
 static int __init
 acpi_parse_srat (unsigned long phys_addr, unsigned long size)
 {
-	struct acpi_table_srat	*srat = NULL;
+	struct acpi_table_srat	*srat;
 
 	if (!phys_addr || !size)
 		return -EINVAL;
@@ -149,10 +150,11 @@
 int __init
 acpi_table_parse_srat (
 	enum acpi_srat_entry_id	id,
-	acpi_madt_entry_handler	handler)
+	acpi_madt_entry_handler	handler,
+	unsigned int max_entries)
 {
 	return acpi_table_parse_madt_family(ACPI_SRAT, sizeof(struct acpi_table_srat),
-					    id, handler);
+					    id, handler, max_entries);
 }
 
 
@@ -166,9 +168,11 @@
 
 	if (result > 0) {
 		result = acpi_table_parse_srat(ACPI_SRAT_PROCESSOR_AFFINITY,
-					       acpi_parse_processor_affinity);
+					       acpi_parse_processor_affinity,
+					       NR_CPUS);
 		result = acpi_table_parse_srat(ACPI_SRAT_MEMORY_AFFINITY,
-					       acpi_parse_memory_affinity);
+					       acpi_parse_memory_affinity,
+					       NR_MEMBLKS);
 	} else {
 		/* FIXME */
 		printk("Warning: acpi_table_parse(ACPI_SRAT) returned %d!\n",result);
--- diff/drivers/acpi/osl.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/acpi/osl.c	2004-02-09 10:39:52.000000000 +0000
@@ -249,7 +249,7 @@
 	 */
 	irq = acpi_fadt.sci_int;
 
-#ifdef CONFIG_IA64
+#if defined(CONFIG_IA64) || defined(CONFIG_PCI_USE_VECTOR)
 	irq = acpi_irq_to_vector(irq);
 	if (irq < 0) {
 		printk(KERN_ERR PREFIX "SCI (ACPI interrupt %d) not registered\n",
@@ -272,7 +272,7 @@
 acpi_os_remove_interrupt_handler(u32 irq, OSD_HANDLER handler)
 {
 	if (irq) {
-#ifdef CONFIG_IA64
+#if defined(CONFIG_IA64) || defined(CONFIG_PCI_USE_VECTOR)
 		irq = acpi_irq_to_vector(irq);
 #endif
 		free_irq(irq, acpi_irq);
--- diff/drivers/acpi/pci_link.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/acpi/pci_link.c	2004-02-09 10:39:52.000000000 +0000
@@ -652,8 +652,8 @@
 
 	link->device = device;
 	link->handle = device->handle;
-	sprintf(acpi_device_name(device), "%s", ACPI_PCI_LINK_DEVICE_NAME);
-	sprintf(acpi_device_class(device), "%s", ACPI_PCI_LINK_CLASS);
+	strcpy(acpi_device_name(device), ACPI_PCI_LINK_DEVICE_NAME);
+	strcpy(acpi_device_class(device), ACPI_PCI_LINK_CLASS);
 	acpi_driver_data(device) = link;
 
 	result = acpi_pci_link_get_possible(link);
--- diff/drivers/acpi/pci_root.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/acpi/pci_root.c	2004-02-09 10:39:52.000000000 +0000
@@ -134,8 +134,8 @@
 	memset(root, 0, sizeof(struct acpi_pci_root));
 
 	root->handle = device->handle;
-	sprintf(acpi_device_name(device), "%s", ACPI_PCI_ROOT_DEVICE_NAME);
-	sprintf(acpi_device_class(device), "%s", ACPI_PCI_ROOT_CLASS);
+	strcpy(acpi_device_name(device), ACPI_PCI_ROOT_DEVICE_NAME);
+	strcpy(acpi_device_class(device), ACPI_PCI_ROOT_CLASS);
 	acpi_driver_data(device) = root;
 
 	/*
--- diff/drivers/acpi/power.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/acpi/power.c	2004-02-09 10:39:52.000000000 +0000
@@ -503,9 +503,9 @@
 	memset(resource, 0, sizeof(struct acpi_power_resource));
 
 	resource->handle = device->handle;
-	sprintf(resource->name, "%s", device->pnp.bus_id);
-	sprintf(acpi_device_name(device), "%s", ACPI_POWER_DEVICE_NAME);
-	sprintf(acpi_device_class(device), "%s", ACPI_POWER_CLASS);
+	strcpy(resource->name, device->pnp.bus_id);
+	strcpy(acpi_device_name(device), ACPI_POWER_DEVICE_NAME);
+	strcpy(acpi_device_class(device), ACPI_POWER_CLASS);
 	acpi_driver_data(device) = resource;
 
 	/* Evalute the object to get the system level and resource order. */
--- diff/drivers/acpi/processor.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/acpi/processor.c	2004-02-09 10:39:52.000000000 +0000
@@ -3,6 +3,7 @@
  *
  *  Copyright (C) 2001, 2002 Andy Grover <andrew.grover@intel.com>
  *  Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
+ *  Copyright (C) 2004       Dominik Brodowski <linux@brodo.de>
  *
  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  *
@@ -22,7 +23,7 @@
  *
  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  *  TBD:
- *	1. Make # power/performance states dynamic.
+ *	1. Make # power states dynamic.
  *	2. Support duty_cycle values that span bit 4.
  *	3. Optimize by having scheduler determine business instead of
  *	   having us try to calculate it here.
@@ -55,9 +56,9 @@
 #define ACPI_PROCESSOR_DEVICE_NAME	"Processor"
 #define ACPI_PROCESSOR_FILE_INFO	"info"
 #define ACPI_PROCESSOR_FILE_POWER	"power"
-#define ACPI_PROCESSOR_FILE_PERFORMANCE	"performance"
 #define ACPI_PROCESSOR_FILE_THROTTLING	"throttling"
 #define ACPI_PROCESSOR_FILE_LIMIT	"limit"
+#define ACPI_PROCESSOR_FILE_PERFORMANCE	"performance"
 #define ACPI_PROCESSOR_NOTIFY_PERFORMANCE 0x80
 #define ACPI_PROCESSOR_NOTIFY_POWER	0x81
 
@@ -746,7 +747,62 @@
 /* --------------------------------------------------------------------------
                               Performance Management
    -------------------------------------------------------------------------- */
-int 
+#ifdef CONFIG_CPU_FREQ
+
+static DECLARE_MUTEX(performance_sem);
+
+/*
+ * _PPC support is implemented as a CPUfreq policy notifier: 
+ * This means each time a CPUfreq driver registered also with
+ * the ACPI core is asked to change the speed policy, the maximum
+ * value is adjusted so that it is within the platform limit.
+ * 
+ * Also, when a new platform limit value is detected, the CPUfreq
+ * policy is adjusted accordingly.
+ */
+
+static int acpi_processor_ppc_is_init = 0;
+
+static int acpi_processor_ppc_notifier(struct notifier_block *nb, 
+	unsigned long event,
+	void *data)
+{
+	struct cpufreq_policy *policy = data;
+	struct acpi_processor *pr;
+	unsigned int ppc = 0;
+
+	down(&performance_sem);
+
+	if (event != CPUFREQ_INCOMPATIBLE)
+		goto out;
+
+	pr = processors[policy->cpu];
+	if (!pr || !pr->performance)
+		goto out;
+
+	ppc = (unsigned int) pr->performance_platform_limit;
+	if (!ppc)
+		goto out;
+
+	if (ppc > pr->performance->state_count)
+		goto out;
+
+	cpufreq_verify_within_limits(policy, 0, 
+		pr->performance->states[ppc].core_frequency * 1000);
+
+ out:
+	up(&performance_sem);
+
+	return 0;
+}
+
+
+static struct notifier_block acpi_ppc_notifier_block = {
+	.notifier_call = acpi_processor_ppc_notifier,
+};
+
+
+static int
 acpi_processor_get_platform_limit (
 	struct acpi_processor*	pr)
 {
@@ -770,35 +826,491 @@
 
 	pr->performance_platform_limit = (int) ppc;
 	
-	acpi_processor_get_limit_info(pr);
+	return_VALUE(0);
+}
+
+
+static int acpi_processor_ppc_has_changed(
+	struct acpi_processor *pr)
+{
+	int ret = acpi_processor_get_platform_limit(pr);
+	if (ret < 0)
+		return (ret);
+	else
+		return cpufreq_update_policy(pr->id);
+}
+
+
+static void acpi_processor_ppc_init(void) {
+	if (!cpufreq_register_notifier(&acpi_ppc_notifier_block, CPUFREQ_POLICY_NOTIFIER))
+		acpi_processor_ppc_is_init = 1;
+	else
+		printk(KERN_DEBUG "Warning: Processor Platform Limit not supported.\n");
+}
+
+
+static void acpi_processor_ppc_exit(void) {
+	if (acpi_processor_ppc_is_init)
+		cpufreq_unregister_notifier(&acpi_ppc_notifier_block, CPUFREQ_POLICY_NOTIFIER);
+
+	acpi_processor_ppc_is_init = 0;
+}
+
+/*
+ * when registering a cpufreq driver with this ACPI processor driver, the
+ * _PCT and _PSS structures are read out and written into struct
+ * acpi_processor_performance.
+ */
+
+static int acpi_processor_set_pdc (struct acpi_processor *pr)
+{
+	acpi_status             status = AE_OK;
+	u32			arg0_buf[3];
+	union acpi_object	arg0 = {ACPI_TYPE_BUFFER};
+	struct acpi_object_list no_object = {1, &arg0};
+	struct acpi_object_list *pdc;
+
+	ACPI_FUNCTION_TRACE("acpi_processor_set_pdc");
 	
+	arg0.buffer.length = 12;
+	arg0.buffer.pointer = (u8 *) arg0_buf;
+	arg0_buf[0] = ACPI_PDC_REVISION_ID;
+	arg0_buf[1] = 0;
+	arg0_buf[2] = 0;
+
+	pdc = (pr->performance->pdc) ? pr->performance->pdc : &no_object;
+
+	status = acpi_evaluate_object(pr->handle, "_PDC", pdc, NULL);
+
+	if ((ACPI_FAILURE(status)) && (pr->performance->pdc))
+		ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Error evaluating _PDC, using legacy perf. control...\n"));
+
+	return_VALUE(status);
+}
+
+
+static int 
+acpi_processor_get_performance_control (
+	struct acpi_processor *pr)
+{
+	int			result = 0;
+	acpi_status		status = 0;
+	struct acpi_buffer	buffer = {ACPI_ALLOCATE_BUFFER, NULL};
+	union acpi_object	*pct = NULL;
+	union acpi_object	obj = {0};
+
+	ACPI_FUNCTION_TRACE("acpi_processor_get_performance_control");
+
+	status = acpi_evaluate_object(pr->handle, "_PCT", NULL, &buffer);
+	if(ACPI_FAILURE(status)) {
+		ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _PCT\n"));
+		return_VALUE(-ENODEV);
+	}
+
+	pct = (union acpi_object *) buffer.pointer;
+	if (!pct || (pct->type != ACPI_TYPE_PACKAGE) 
+		|| (pct->package.count != 2)) {
+		ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid _PCT data\n"));
+		result = -EFAULT;
+		goto end;
+	}
+
+	/*
+	 * control_register
+	 */
+
+	obj = pct->package.elements[0];
+
+	if ((obj.type != ACPI_TYPE_BUFFER) 
+		|| (obj.buffer.length < sizeof(struct acpi_pct_register)) 
+		|| (obj.buffer.pointer == NULL)) {
+		ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 
+			"Invalid _PCT data (control_register)\n"));
+		result = -EFAULT;
+		goto end;
+	}
+	memcpy(&pr->performance->control_register, obj.buffer.pointer, sizeof(struct acpi_pct_register));
+
+
+	/*
+	 * status_register
+	 */
+
+	obj = pct->package.elements[1];
+
+	if ((obj.type != ACPI_TYPE_BUFFER) 
+		|| (obj.buffer.length < sizeof(struct acpi_pct_register)) 
+		|| (obj.buffer.pointer == NULL)) {
+		ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 
+			"Invalid _PCT data (status_register)\n"));
+		result = -EFAULT;
+		goto end;
+	}
+
+	memcpy(&pr->performance->status_register, obj.buffer.pointer, sizeof(struct acpi_pct_register));
+
+end:
+	acpi_os_free(buffer.pointer);
+
+	return_VALUE(result);
+}
+
+
+static int 
+acpi_processor_get_performance_states (
+	struct acpi_processor	*pr)
+{
+	int			result = 0;
+	acpi_status		status = AE_OK;
+	struct acpi_buffer	buffer = {ACPI_ALLOCATE_BUFFER, NULL};
+	struct acpi_buffer	format = {sizeof("NNNNNN"), "NNNNNN"};
+	struct acpi_buffer	state = {0, NULL};
+	union acpi_object 	*pss = NULL;
+	int			i = 0;
+
+	ACPI_FUNCTION_TRACE("acpi_processor_get_performance_states");
+
+	status = acpi_evaluate_object(pr->handle, "_PSS", NULL, &buffer);
+	if(ACPI_FAILURE(status)) {
+		ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _PSS\n"));
+		return_VALUE(-ENODEV);
+	}
+
+	pss = (union acpi_object *) buffer.pointer;
+	if (!pss || (pss->type != ACPI_TYPE_PACKAGE)) {
+		ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid _PSS data\n"));
+		result = -EFAULT;
+		goto end;
+	}
+
+	ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found %d performance states\n", 
+		pss->package.count));
+
+	pr->performance->state_count = pss->package.count;
+	pr->performance->states = kmalloc(sizeof(struct acpi_processor_px) * pss->package.count, GFP_KERNEL);
+	if (!pr->performance->states) {
+		result = -ENOMEM;
+		goto end;
+	}
+
+	for (i = 0; i < pr->performance->state_count; i++) {
+
+		struct acpi_processor_px *px = &(pr->performance->states[i]);
+
+		state.length = sizeof(struct acpi_processor_px);
+		state.pointer = px;
+
+		ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Extracting state %d\n", i));
+
+		status = acpi_extract_package(&(pss->package.elements[i]), 
+			&format, &state);
+		if (ACPI_FAILURE(status)) {
+			ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid _PSS data\n"));
+			result = -EFAULT;
+			kfree(pr->performance->states);
+			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, 
+			(u32) px->core_frequency, 
+			(u32) px->power, 
+			(u32) px->transition_latency, 
+			(u32) px->bus_master_latency,
+			(u32) px->control, 
+			(u32) px->status));
+
+		if (!px->core_frequency) {
+			ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "core_frequency is 0\n"));
+			result = -EFAULT;
+			kfree(pr->performance->states);
+			goto end;
+		}
+	}
+
+end:
+	acpi_os_free(buffer.pointer);
+
+	return_VALUE(result);
+}
+
+
+static int
+acpi_processor_get_performance_info (
+	struct acpi_processor	*pr)
+{
+	int			result = 0;
+	acpi_status		status = AE_OK;
+	acpi_handle		handle = NULL;
+
+	ACPI_FUNCTION_TRACE("acpi_processor_get_performance_info");
+
+	if (!pr || !pr->performance || !pr->handle)
+		return_VALUE(-EINVAL);
+
+	status = acpi_get_handle(pr->handle, "_PCT", &handle);
+	if (ACPI_FAILURE(status)) {
+		ACPI_DEBUG_PRINT((ACPI_DB_INFO, 
+			"ACPI-based processor performance control unavailable\n"));
+		return_VALUE(-ENODEV);
+	}
+
+	acpi_processor_set_pdc(pr);
+
+	result = acpi_processor_get_performance_control(pr);
+	if (result)
+		return_VALUE(result);
+
+	result = acpi_processor_get_performance_states(pr);
+	if (result)
+		return_VALUE(result);
+
+	result = acpi_processor_get_platform_limit(pr);
+	if (result)
+		return_VALUE(result);
+
 	return_VALUE(0);
 }
-EXPORT_SYMBOL(acpi_processor_get_platform_limit);
+
+
+#ifdef CONFIG_X86_ACPI_CPUFREQ_PROC_INTF
+/* /proc/acpi/processor/../performance interface (DEPRECATED) */
+
+static int acpi_processor_perf_open_fs(struct inode *inode, struct file *file);
+static struct file_operations acpi_processor_perf_fops = {
+	.open 		= acpi_processor_perf_open_fs,
+	.read		= seq_read,
+	.llseek		= seq_lseek,
+	.release	= single_release,
+};
+
+static int acpi_processor_perf_seq_show(struct seq_file *seq, void *offset)
+{
+	struct acpi_processor	*pr = (struct acpi_processor *)seq->private;
+	int			i = 0;
+
+	ACPI_FUNCTION_TRACE("acpi_processor_perf_seq_show");
+
+	if (!pr)
+		goto end;
+
+	if (!pr->performance) {
+		seq_puts(seq, "<not supported>\n");
+		goto end;
+	}
+
+	seq_printf(seq, "state count:             %d\n"
+			"active state:            P%d\n",
+			pr->performance->state_count,
+			pr->performance->state);
+
+	seq_puts(seq, "states:\n");
+	for (i = 0; i < pr->performance->state_count; i++)
+		seq_printf(seq, "   %cP%d:                  %d MHz, %d mW, %d uS\n",
+			(i == pr->performance->state?'*':' '), i,
+			(u32) pr->performance->states[i].core_frequency,
+			(u32) pr->performance->states[i].power,
+			(u32) pr->performance->states[i].transition_latency);
+
+end:
+	return 0;
+}
+
+static int acpi_processor_perf_open_fs(struct inode *inode, struct file *file)
+{
+	return single_open(file, acpi_processor_perf_seq_show,
+						PDE(inode)->data);
+}
+
+static int
+acpi_processor_write_performance (
+        struct file		*file,
+        const char		__user *buffer,
+        size_t			count,
+        loff_t			*data)
+{
+	int			result = 0;
+	struct seq_file		*m = (struct seq_file *) file->private_data;
+	struct acpi_processor	*pr = (struct acpi_processor *) m->private;
+	struct acpi_processor_performance *perf;
+	char			state_string[12] = {'\0'};
+	unsigned int            new_state = 0;
+	struct cpufreq_policy   policy;
+
+	ACPI_FUNCTION_TRACE("acpi_processor_write_performance");
+
+	if (!pr || (count > sizeof(state_string) - 1))
+		return_VALUE(-EINVAL);
+
+	perf = pr->performance;
+	if (!perf)
+		return_VALUE(-EINVAL);
+	
+	if (copy_from_user(state_string, buffer, count))
+		return_VALUE(-EFAULT);
+	
+	state_string[count] = '\0';
+	new_state = simple_strtoul(state_string, NULL, 0);
+
+	if (new_state >= perf->state_count)
+		return_VALUE(-EINVAL);
+
+	cpufreq_get_policy(&policy, pr->id);
+
+	policy.cpu = pr->id;
+	policy.min = perf->states[new_state].core_frequency * 1000;
+	policy.max = perf->states[new_state].core_frequency * 1000;
+
+	result = cpufreq_set_policy(&policy);
+	if (result)
+		return_VALUE(result);
+
+	return_VALUE(count);
+}
+
+static void
+acpi_cpufreq_add_file (
+	struct acpi_processor *pr)
+{
+	struct proc_dir_entry	*entry = NULL;
+	struct acpi_device	*device = NULL;
+
+	ACPI_FUNCTION_TRACE("acpi_cpufreq_addfile");
+
+	if (acpi_bus_get_device(pr->handle, &device))
+		return_VOID;
+
+	/* add file 'performance' [R/W] */
+	entry = create_proc_entry(ACPI_PROCESSOR_FILE_PERFORMANCE,
+		  S_IFREG|S_IRUGO|S_IWUSR, acpi_device_dir(device));
+	if (!entry)
+		ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+			"Unable to create '%s' fs entry\n",
+			ACPI_PROCESSOR_FILE_PERFORMANCE));
+	else {
+		entry->proc_fops = &acpi_processor_perf_fops;
+		entry->proc_fops->write = acpi_processor_write_performance;
+		entry->data = acpi_driver_data(device);
+	}
+	return_VOID;
+}
+
+static void
+acpi_cpufreq_remove_file (
+	struct acpi_processor *pr)
+{
+	struct acpi_device	*device = NULL;
+
+	ACPI_FUNCTION_TRACE("acpi_cpufreq_addfile");
+
+	if (acpi_bus_get_device(pr->handle, &device))
+		return_VOID;
+
+	/* remove file 'performance' */
+	remove_proc_entry(ACPI_PROCESSOR_FILE_PERFORMANCE,
+		  acpi_device_dir(device));
+
+	return_VOID;
+}
+
+#else
+static void acpi_cpufreq_add_file (struct acpi_processor *pr) { return; }
+static void acpi_cpufreq_remove_file (struct acpi_processor *pr) { return; }
+#endif /* CONFIG_X86_ACPI_CPUFREQ_PROC_INTF */
+
 
 int 
 acpi_processor_register_performance (
 	struct acpi_processor_performance * performance,
-	struct acpi_processor ** pr,
 	unsigned int cpu)
 {
+	struct acpi_processor *pr;
+
 	ACPI_FUNCTION_TRACE("acpi_processor_register_performance");
 
-	*pr = processors[cpu];
-	if (!*pr)
+	if (!acpi_processor_ppc_is_init)
+		return_VALUE(-EINVAL);
+
+	down(&performance_sem);
+
+	pr = processors[cpu];
+	if (!pr) {
+		up(&performance_sem);
 		return_VALUE(-ENODEV);
+	}
 
-	if ((*pr)->performance)
+	if (pr->performance) {
+		up(&performance_sem);
 		return_VALUE(-EBUSY);
+	}
 
-	(*pr)->performance = performance;
-	performance->pr = *pr;
-	return 0;
+	pr->performance = performance;
+
+	if (acpi_processor_get_performance_info(pr)) {
+		pr->performance = NULL;
+		up(&performance_sem);
+		return_VALUE(-EIO);
+	}
+
+	acpi_cpufreq_add_file(pr);
+
+	up(&performance_sem);
+	return_VALUE(0);
 }
 EXPORT_SYMBOL(acpi_processor_register_performance);
 
-/* for the rest of it, check cpufreq/acpi.c */
 
+void 
+acpi_processor_unregister_performance (
+	struct acpi_processor_performance * performance,
+	unsigned int cpu)
+{
+	struct acpi_processor *pr;
+
+	ACPI_FUNCTION_TRACE("acpi_processor_unregister_performance");
+
+	if (!acpi_processor_ppc_is_init)
+		return_VOID;
+
+	down(&performance_sem);
+
+	pr = processors[cpu];
+	if (!pr) {
+		up(&performance_sem);
+		return_VOID;
+	}
+
+	kfree(pr->performance->states);
+	pr->performance = NULL;
+
+	acpi_cpufreq_remove_file(pr);
+
+	up(&performance_sem);
+
+	return_VOID;
+}
+EXPORT_SYMBOL(acpi_processor_unregister_performance);
+
+
+/* for the rest of it, check arch/i386/kernel/cpu/cpufreq/acpi.c */
+
+#else  /* !CONFIG_CPU_FREQ */
+
+static void acpi_processor_ppc_init(void) { return; }
+static void acpi_processor_ppc_exit(void) { return; }
+
+static int acpi_processor_ppc_has_changed(struct acpi_processor *pr) {
+	static unsigned int printout = 1;
+	if (printout) {
+		printk(KERN_WARNING "Warning: Processor Platform Limit event detected, but not handled.\n");
+		printk(KERN_WARNING "Consider compiling CPUfreq support into your kernel.\n");
+		printout = 0;
+	}
+	return 0;
+}
+
+#endif /* CONFIG_CPU_FREQ */
 
 /* --------------------------------------------------------------------------
                               Throttling Control
@@ -1043,27 +1555,6 @@
 	if (!pr->flags.limit)
 		return_VALUE(-ENODEV);
 
-#ifdef CONFIG_CPU_FREQ
-	if (pr->flags.performance) {
-		px = pr->performance_platform_limit;
-		if (pr->limit.user.px > px)
-			px = pr->limit.user.px;
-		if (pr->limit.thermal.px > px)
-			px = pr->limit.thermal.px;
-		{
-			struct cpufreq_policy policy;
-			policy.cpu = pr->id;
-			cpufreq_get_policy(&policy, pr->id);
-			policy.max = pr->performance->states[px].core_frequency * 1000; /* racy */
-			result = cpufreq_set_policy(&policy);
-		}
-		if (result)
-			goto end;
-	} else if (pr->performance_platform_limit) {
-		ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Platform limit event detected. Consider using ACPI P-States CPUfreq driver\n"));
-	}
-#endif
-
 	if (pr->flags.throttling) {
 		if (pr->limit.user.tx > tx)
 			tx = pr->limit.user.tx;
@@ -1091,6 +1582,113 @@
 }
 
 
+#ifdef CONFIG_CPU_FREQ
+
+/* If a passive cooling situation is detected, primarily CPUfreq is used, as it
+ * offers (in most cases) voltage scaling in addition to frequency scaling, and
+ * thus a cubic (instead of linear) reduction of energy. Also, we allow for
+ * _any_ cpufreq driver and not only the acpi-cpufreq driver.
+ */
+
+static unsigned int cpufreq_thermal_reduction_pctg[NR_CPUS];
+static unsigned int acpi_thermal_cpufreq_is_init = 0;
+
+
+static int cpu_has_cpufreq(unsigned int cpu)
+{
+	struct cpufreq_policy policy;
+	if (!acpi_thermal_cpufreq_is_init)
+		return -ENODEV;
+	if (!cpufreq_get_policy(&policy, cpu))
+		return -ENODEV;
+	return 0;
+}
+
+
+static int acpi_thermal_cpufreq_increase(unsigned int cpu)
+{
+	if (!cpu_has_cpufreq)
+		return -ENODEV;
+
+	if (cpufreq_thermal_reduction_pctg[cpu] < 60) {
+		cpufreq_thermal_reduction_pctg[cpu] += 20;
+		cpufreq_update_policy(cpu);
+		return 0;
+	}
+
+	return -ERANGE;
+}
+
+
+static int acpi_thermal_cpufreq_decrease(unsigned int cpu)
+{
+	if (!cpu_has_cpufreq)
+		return -ENODEV;
+
+	if (cpufreq_thermal_reduction_pctg[cpu] >= 20) {
+		cpufreq_thermal_reduction_pctg[cpu] -= 20;
+		cpufreq_update_policy(cpu);
+		return 0;
+	}
+
+	return -ERANGE;
+}
+
+
+static int acpi_thermal_cpufreq_notifier(
+	struct notifier_block *nb,
+	unsigned long event,
+	void *data)
+{
+	struct cpufreq_policy *policy = data;
+	unsigned long max_freq = 0;
+
+	if (event != CPUFREQ_ADJUST)
+		goto out;
+
+	max_freq = (policy->cpuinfo.max_freq * (100 - cpufreq_thermal_reduction_pctg[policy->cpu])) / 100;
+
+	cpufreq_verify_within_limits(policy, 0, max_freq);
+
+ out:
+	return 0;
+}
+
+
+static struct notifier_block acpi_thermal_cpufreq_notifier_block = {
+	.notifier_call = acpi_thermal_cpufreq_notifier,
+};
+
+
+static void acpi_thermal_cpufreq_init(void) {
+	int i;
+
+	for (i=0; i<NR_CPUS; i++)
+		cpufreq_thermal_reduction_pctg[i] = 0;
+
+	i = cpufreq_register_notifier(&acpi_thermal_cpufreq_notifier_block, CPUFREQ_POLICY_NOTIFIER);
+	if (!i)
+		acpi_thermal_cpufreq_is_init = 1;
+}
+
+static void acpi_thermal_cpufreq_exit(void) {
+	if (acpi_thermal_cpufreq_is_init)
+		cpufreq_unregister_notifier(&acpi_thermal_cpufreq_notifier_block, CPUFREQ_POLICY_NOTIFIER);
+
+	acpi_thermal_cpufreq_is_init = 0;
+}
+
+#else /* ! CONFIG_CPU_FREQ */
+
+static void acpi_thermal_cpufreq_init(void) { return; }
+static void acpi_thermal_cpufreq_exit(void) { return; }
+static int acpi_thermal_cpufreq_increase(unsigned int cpu) { return -ENODEV; }
+static int acpi_thermal_cpufreq_decrease(unsigned int cpu) { return -ENODEV; }
+
+
+#endif
+
+
 int
 acpi_processor_set_thermal_limit (
 	acpi_handle		handle,
@@ -1099,7 +1697,6 @@
 	int			result = 0;
 	struct acpi_processor	*pr = NULL;
 	struct acpi_device	*device = NULL;
-	int			px = 0;
 	int			tx = 0;
 
 	ACPI_FUNCTION_TRACE("acpi_processor_set_thermal_limit");
@@ -1116,12 +1713,7 @@
 	if (!pr)
 		return_VALUE(-ENODEV);
 
-	if (!pr->flags.limit)
-		return_VALUE(-ENODEV);
-
 	/* Thermal limits are always relative to the current Px/Tx state. */
-	if (pr->flags.performance)
-		pr->limit.thermal.px = pr->performance->state;
 	if (pr->flags.throttling)
 		pr->limit.thermal.tx = pr->throttling.state;
 
@@ -1130,26 +1722,27 @@
 	 * performance state.
 	 */
 
-	px = pr->limit.thermal.px;
 	tx = pr->limit.thermal.tx;
 
 	switch (type) {
 
 	case ACPI_PROCESSOR_LIMIT_NONE:
-		px = 0;
+		do {
+			result = acpi_thermal_cpufreq_decrease(pr->id);
+		} while (!result);
 		tx = 0;
 		break;
 
 	case ACPI_PROCESSOR_LIMIT_INCREMENT:
-		if (pr->flags.performance) {
-			if (px == (pr->performance->state_count - 1))
-				ACPI_DEBUG_PRINT((ACPI_DB_INFO, 
+		/* if going up: P-states first, T-states later */
+
+		result = acpi_thermal_cpufreq_increase(pr->id);
+		if (!result)
+			goto end;
+		else if (result == -ERANGE)
+			ACPI_DEBUG_PRINT((ACPI_DB_INFO, 
 					"At maximum performance state\n"));
-			else {
-				px++;
-				goto end;
-			}
-		}
+
 		if (pr->flags.throttling) {
 			if (tx == (pr->throttling.state_count - 1))
 				ACPI_DEBUG_PRINT((ACPI_DB_INFO, 
@@ -1160,37 +1753,41 @@
 		break;
 
 	case ACPI_PROCESSOR_LIMIT_DECREMENT:
-		if (pr->flags.performance) {
-			if (px == pr->performance_platform_limit)
-				ACPI_DEBUG_PRINT((ACPI_DB_INFO, 
-					"At minimum performance state\n"));
-			else  {
-				px--;
-				goto end;
-			}
-		}
+		/* if going down: T-states first, P-states later */
+
 		if (pr->flags.throttling) {
 			if (tx == 0)
 				ACPI_DEBUG_PRINT((ACPI_DB_INFO, 
 					"At minimum throttling state\n"));
-			else
+			else {
 				tx--;
+				goto end;
+			}
 		}
+
+		result = acpi_thermal_cpufreq_decrease(pr->id);
+		if (result == -ERANGE)
+			ACPI_DEBUG_PRINT((ACPI_DB_INFO, 
+					"At minimum performance state\n"));
+
 		break;
 	}
 
 end:
-	pr->limit.thermal.px = px;
-	pr->limit.thermal.tx = tx;
+	if (pr->flags.throttling) {
+		pr->limit.thermal.px = 0;
+		pr->limit.thermal.tx = tx;
 
-	result = acpi_processor_apply_limit(pr);
-	if (result)
-		ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 
-			"Unable to set thermal limit\n"));
+		result = acpi_processor_apply_limit(pr);
+		if (result)
+			ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 
+					  "Unable to set thermal limit\n"));
 
-	ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Thermal limit now (P%d:T%d)\n",
-		pr->limit.thermal.px,
-		pr->limit.thermal.tx));
+		ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Thermal limit now (P%d:T%d)\n",
+				  pr->limit.thermal.px,
+				  pr->limit.thermal.tx));
+	} else
+		result = 0;
 
 	return_VALUE(result);
 }
@@ -1205,7 +1802,7 @@
 	if (!pr)
 		return_VALUE(-EINVAL);
 
-	if (pr->flags.performance || pr->flags.throttling)
+	if (pr->flags.throttling)
 		pr->flags.limit = 1;
 
 	return_VALUE(0);
@@ -1232,14 +1829,12 @@
 			"bus mastering control:   %s\n"
 			"power management:        %s\n"
 			"throttling control:      %s\n"
-			"performance management:  %s\n"
 			"limit interface:         %s\n",
 			pr->id,
 			pr->acpi_id,
 			pr->flags.bm_control ? "yes" : "no",
 			pr->flags.power ? "yes" : "no",
 			pr->flags.throttling ? "yes" : "no",
-			pr->flags.performance ? "yes" : "no",
 			pr->flags.limit ? "yes" : "no");
 
 end:
@@ -1396,11 +1991,9 @@
 	}
 
 	seq_printf(seq, "active limit:            P%d:T%d\n"
-			"platform limit:          P%d:T0\n"
 			"user limit:              P%d:T%d\n"
 			"thermal limit:           P%d:T%d\n",
 			pr->limit.state.px, pr->limit.state.tx,
-			pr->flags.performance?pr->performance_platform_limit:0,
 			pr->limit.user.px, pr->limit.user.tx,
 			pr->limit.thermal.px, pr->limit.thermal.tx);
 
@@ -1447,15 +2040,6 @@
 		return_VALUE(-EINVAL);
 	}
 
-	if (pr->flags.performance) {
-		if ((px < pr->performance_platform_limit) 
-			|| (px > (pr->performance->state_count - 1))) {
-			ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid px\n"));
-			return_VALUE(-EINVAL);
-		}
-		pr->limit.user.px = px;
-	}
-
 	if (pr->flags.throttling) {
 		if ((tx < 0) || (tx > (pr->throttling.state_count - 1))) {
 			ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid tx\n"));
@@ -1635,9 +2219,9 @@
 	}
 
 	acpi_processor_get_power_info(pr);
-	pr->flags.performance = 0;
-	pr->performance_platform_limit = 0;
-	acpi_processor_get_platform_limit(pr);
+#ifdef CONFIG_CPU_FREQ
+	acpi_processor_ppc_has_changed(pr);
+#endif
 	acpi_processor_get_throttling_info(pr);
 	acpi_processor_get_limit_info(pr);
 
@@ -1651,7 +2235,6 @@
 	u32			event,
 	void			*data)
 {
-	int			result = 0;
 	struct acpi_processor	*pr = (struct acpi_processor *) data;
 	struct acpi_device	*device = NULL;
 
@@ -1665,9 +2248,7 @@
 
 	switch (event) {
 	case ACPI_PROCESSOR_NOTIFY_PERFORMANCE:
-		result = acpi_processor_get_platform_limit(pr);
-		if (!result)
-			acpi_processor_apply_limit(pr);
+		acpi_processor_ppc_has_changed(pr);
 		acpi_bus_generate_event(device, event, 
 			pr->performance_platform_limit);
 		break;
@@ -1705,8 +2286,8 @@
 	memset(pr, 0, sizeof(struct acpi_processor));
 
 	pr->handle = device->handle;
-	sprintf(acpi_device_name(device), "%s", ACPI_PROCESSOR_DEVICE_NAME);
-	sprintf(acpi_device_class(device), "%s", ACPI_PROCESSOR_CLASS);
+	strcpy(acpi_device_name(device), ACPI_PROCESSOR_DEVICE_NAME);
+	strcpy(acpi_device_class(device), ACPI_PROCESSOR_CLASS);
 	acpi_driver_data(device) = pr;
 
 	result = acpi_processor_get_info(pr);
@@ -1813,6 +2394,10 @@
 		return_VALUE(-ENODEV);
 	}
 
+	acpi_thermal_cpufreq_init();
+
+	acpi_processor_ppc_init();
+
 	return_VALUE(0);
 }
 
@@ -1822,6 +2407,10 @@
 {
 	ACPI_FUNCTION_TRACE("acpi_processor_exit");
 
+	acpi_processor_ppc_exit();
+
+	acpi_thermal_cpufreq_exit();
+
 	acpi_bus_unregister_driver(&acpi_processor_driver);
 
 	remove_proc_entry(ACPI_PROCESSOR_CLASS, acpi_root_dir);
--- diff/drivers/acpi/scan.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/acpi/scan.c	2004-02-09 10:39:52.000000000 +0000
@@ -486,13 +486,13 @@
 	 */
 	switch (type) {
 	case ACPI_BUS_TYPE_SYSTEM:
-		sprintf(device->pnp.bus_id, "%s", "ACPI");
+		strcpy(device->pnp.bus_id, "ACPI");
 		break;
 	case ACPI_BUS_TYPE_POWER_BUTTON:
-		sprintf(device->pnp.bus_id, "%s", "PWRF");
+		strcpy(device->pnp.bus_id, "PWRF");
 		break;
 	case ACPI_BUS_TYPE_SLEEP_BUTTON:
-		sprintf(device->pnp.bus_id, "%s", "SLPF");
+		strcpy(device->pnp.bus_id, "SLPF");
 		break;
 	default:
 		acpi_get_name(handle, ACPI_SINGLE_NAME, &buffer);
@@ -503,7 +503,7 @@
 			else
 				break;
 		}
-		sprintf(device->pnp.bus_id, "%s", bus_id);
+		strcpy(device->pnp.bus_id, bus_id);
 		break;
 	}
 }
@@ -565,16 +565,16 @@
 	 */
 	if ((parent == ACPI_ROOT_OBJECT) && (type == ACPI_BUS_TYPE_DEVICE)) {
 		hid = ACPI_BUS_HID;
-		sprintf(device->pnp.device_name, "%s", ACPI_BUS_DEVICE_NAME);
-		sprintf(device->pnp.device_class, "%s", ACPI_BUS_CLASS);
+		strcpy(device->pnp.device_name, ACPI_BUS_DEVICE_NAME);
+		strcpy(device->pnp.device_class, ACPI_BUS_CLASS);
 	}
 
 	if (hid) {
-		sprintf(device->pnp.hardware_id, "%s", hid);
+		strcpy(device->pnp.hardware_id, hid);
 		device->flags.hardware_id = 1;
 	}
 	if (uid) {
-		sprintf(device->pnp.unique_id, "%s", uid);
+		strcpy(device->pnp.unique_id, uid);
 		device->flags.unique_id = 1;
 	}
 	if (cid_list) {
--- diff/drivers/acpi/tables.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/acpi/tables.c	2004-02-09 10:39:52.000000000 +0000
@@ -58,6 +58,7 @@
 	[ACPI_SSDT]		= "SSDT",
 	[ACPI_SPMI]		= "SPMI",
 	[ACPI_HPET]		= "HPET",
+	[ACPI_MCFG]		= "MCFG",
 };
 
 static char *mps_inti_flags_polarity[] = { "dfl", "high", "res", "low" };
@@ -302,13 +303,14 @@
 	enum acpi_table_id	id,
 	unsigned long		madt_size,
 	int			entry_id,
-	acpi_madt_entry_handler	handler)
+	acpi_madt_entry_handler	handler,
+	unsigned int		max_entries)
 {
 	void			*madt = NULL;
-	acpi_table_entry_header	*entry = NULL;
-	unsigned long		count = 0;
-	unsigned long		madt_end = 0;
-	unsigned int			i = 0;
+	acpi_table_entry_header	*entry;
+	unsigned int		count = 0;
+	unsigned long		madt_end;
+	unsigned int		i;
 
 	if (!handler)
 		return -EINVAL;
@@ -342,13 +344,18 @@
 		((unsigned long) madt + madt_size);
 
 	while (((unsigned long) entry) < madt_end) {
-		if (entry->type == entry_id) {
-			count++;
+		if (entry->type == entry_id &&
+		    (!max_entries || count++ < max_entries))
 			handler(entry);
-		}
+
 		entry = (acpi_table_entry_header *)
 			((unsigned long) entry + entry->length);
 	}
+	if (max_entries && count > max_entries) {
+		printk(KERN_WARNING PREFIX "[%s:0x%02x] ignored %i entries of "
+		       "%i found\n", acpi_table_signatures[id], entry_id,
+		       count - max_entries, count);
+	}
 
 	return count;
 }
@@ -357,10 +364,11 @@
 int __init
 acpi_table_parse_madt (
 	enum acpi_madt_entry_id	id,
-	acpi_madt_entry_handler	handler)
+	acpi_madt_entry_handler	handler,
+	unsigned int max_entries)
 {
 	return acpi_table_parse_madt_family(ACPI_APIC, sizeof(struct acpi_table_madt),
-					    id, handler);
+					    id, handler, max_entries);
 }
 
 
@@ -585,4 +593,3 @@
 
 	return 0;
 }
-
--- diff/drivers/acpi/thermal.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/acpi/thermal.c	2004-02-09 10:39:52.000000000 +0000
@@ -1246,9 +1246,9 @@
 	memset(tz, 0, sizeof(struct acpi_thermal));
 
 	tz->handle = device->handle;
-	sprintf(tz->name, "%s", device->pnp.bus_id);
-	sprintf(acpi_device_name(device), "%s", ACPI_THERMAL_DEVICE_NAME);
-	sprintf(acpi_device_class(device), "%s", ACPI_THERMAL_CLASS);
+	strcpy(tz->name, device->pnp.bus_id);
+	strcpy(acpi_device_name(device), ACPI_THERMAL_DEVICE_NAME);
+	strcpy(acpi_device_class(device), ACPI_THERMAL_CLASS);
 	acpi_driver_data(device) = tz;
 
 	result = acpi_thermal_get_info(tz);
--- diff/drivers/atm/atmtcp.c	2003-10-09 09:47:33.000000000 +0100
+++ source/drivers/atm/atmtcp.c	2004-02-09 10:39:52.000000000 +0000
@@ -255,7 +255,7 @@
 	dev_data = PRIV(atmtcp_dev);
 	dev_data->vcc = NULL;
 	if (dev_data->persist) return;
-	PRIV(atmtcp_dev) = NULL;
+	atmtcp_dev->dev_data = NULL;
 	kfree(dev_data);
 	shutdown_atm_dev(atmtcp_dev);
 	vcc->dev_data = NULL;
@@ -380,7 +380,7 @@
 	}
 	dev->ci_range.vpi_bits = MAX_VPI_BITS;
 	dev->ci_range.vci_bits = MAX_VCI_BITS;
-	PRIV(dev) = dev_data;
+	dev->dev_data = dev_data;
 	PRIV(dev)->vcc = NULL;
 	PRIV(dev)->persist = persist;
 	if (result) *result = dev;
--- diff/drivers/atm/eni.c	2003-10-09 09:47:33.000000000 +0100
+++ source/drivers/atm/eni.c	2004-02-09 10:39:52.000000000 +0000
@@ -1875,7 +1875,7 @@
 	DPRINTK("eni_close: done waiting\n");
 	/* deallocate memory */
 	kfree(ENI_VCC(vcc));
-	ENI_VCC(vcc) = NULL;
+	vcc->dev_data = NULL;
 	clear_bit(ATM_VF_ADDR,&vcc->flags);
 	/*foo();*/
 }
@@ -1891,7 +1891,8 @@
 
 	DPRINTK(">eni_open\n");
 	EVENT("eni_open\n",0,0);
-	if (!test_bit(ATM_VF_PARTIAL,&vcc->flags)) ENI_VCC(vcc) = NULL;
+	if (!test_bit(ATM_VF_PARTIAL,&vcc->flags))
+		vcc->dev_data = NULL;
 	eni_dev = ENI_DEV(vcc->dev);
 	if (vci != ATM_VPI_UNSPEC && vpi != ATM_VCI_UNSPEC)
 		set_bit(ATM_VF_ADDR,&vcc->flags);
@@ -1902,7 +1903,7 @@
 	if (!test_bit(ATM_VF_PARTIAL,&vcc->flags)) {
 		eni_vcc = kmalloc(sizeof(struct eni_vcc),GFP_KERNEL);
 		if (!eni_vcc) return -ENOMEM;
-		ENI_VCC(vcc) = eni_vcc;
+		vcc->dev_data = eni_vcc;
 		eni_vcc->tx = NULL; /* for eni_close after open_rx */
 		if ((error = open_rx_first(vcc))) {
 			eni_close(vcc);
@@ -2230,7 +2231,7 @@
 	if (!dev) goto out2;
 	pci_set_drvdata(pci_dev, dev);
 	eni_dev->pci_dev = pci_dev;
-	ENI_DEV(dev) = eni_dev;
+	dev->dev_data = eni_dev;
 	eni_dev->asic = ent->driver_data;
 	error = eni_do_init(dev);
 	if (error) goto out3;
--- diff/drivers/atm/fore200e.c	2003-10-27 09:20:37.000000000 +0000
+++ source/drivers/atm/fore200e.c	2004-02-09 10:39:52.000000000 +0000
@@ -1417,7 +1417,7 @@
 	return -ENOMEM;
     }
 
-    FORE200E_VCC(vcc) = fore200e_vcc;
+    vcc->dev_data = fore200e_vcc;
     
     if (fore200e_activate_vcin(fore200e, 1, vcc, vcc->qos.rxtp.max_sdu) < 0) {
 	kfree(fore200e_vcc);
@@ -2482,7 +2482,7 @@
 	return -ENODEV;
     }
 
-    FORE200E_DEV(atm_dev) = fore200e;
+    atm_dev->dev_data = fore200e;
     fore200e->atm_dev = atm_dev;
 
     atm_dev->ci_range.vpi_bits = 8;
--- diff/drivers/atm/he.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/atm/he.c	2004-02-09 10:39:52.000000000 +0000
@@ -380,7 +380,7 @@
 	he_dev->pci_dev = pci_dev;
 	he_dev->atm_dev = atm_dev;
 	he_dev->atm_dev->dev_data = he_dev;
-	HE_DEV(atm_dev) = he_dev;
+	atm_dev->dev_data = he_dev;
 	he_dev->number = atm_dev->number;
 	if (he_start(atm_dev)) {
 		he_stop(he_dev);
@@ -2361,7 +2361,7 @@
 	init_waitqueue_head(&he_vcc->rx_waitq);
 	init_waitqueue_head(&he_vcc->tx_waitq);
 
-	HE_VCC(vcc) = he_vcc;
+	vcc->dev_data = he_vcc;
 
 	if (vcc->qos.txtp.traffic_class != ATM_NONE) {
 		int pcr_goal;
--- diff/drivers/atm/idt77105.c	2003-05-21 11:49:54.000000000 +0100
+++ source/drivers/atm/idt77105.c	2004-02-09 10:39:52.000000000 +0000
@@ -265,7 +265,7 @@
 {
 	unsigned long flags;
 
-	if (!(PRIV(dev) = kmalloc(sizeof(struct idt77105_priv),GFP_KERNEL)))
+	if (!(dev->dev_data = kmalloc(sizeof(struct idt77105_priv),GFP_KERNEL)))
 		return -ENOMEM;
 	PRIV(dev)->dev = dev;
 	spin_lock_irqsave(&idt77105_priv_lock, flags);
@@ -343,7 +343,7 @@
                 else
                     idt77105_all = walk->next;
 	        dev->phy = NULL;
-                PRIV(dev) = NULL;
+                dev->dev_data = NULL;
                 kfree(walk);
                 break;
             }
--- diff/drivers/atm/iphase.c	2003-10-09 09:47:33.000000000 +0100
+++ source/drivers/atm/iphase.c	2004-02-09 10:39:52.000000000 +0000
@@ -1754,7 +1754,7 @@
                          (iadev->tx_buf_sz - sizeof(struct cpcs_trailer))){
            printk("IA:  SDU size over (%d) the configured SDU size %d\n",
 		  vcc->qos.txtp.max_sdu,iadev->tx_buf_sz);
-	   INPH_IA_VCC(vcc) = NULL;  
+	   vcc->dev_data = NULL;
            kfree(ia_vcc);
            return -EINVAL; 
         }
@@ -2671,7 +2671,7 @@
         }
 	kfree(INPH_IA_VCC(vcc));  
         ia_vcc = NULL;
-        INPH_IA_VCC(vcc) = NULL;  
+        vcc->dev_data = NULL;
         clear_bit(ATM_VF_ADDR,&vcc->flags);
         return;        
 }  
@@ -2684,7 +2684,7 @@
 	if (!test_bit(ATM_VF_PARTIAL,&vcc->flags))  
 	{  
 		IF_EVENT(printk("ia: not partially allocated resources\n");)  
-		INPH_IA_VCC(vcc) = NULL;  
+		vcc->dev_data = NULL;
 	}  
 	iadev = INPH_IA_DEV(vcc->dev);  
 	if (vcc->vci != ATM_VPI_UNSPEC && vcc->vpi != ATM_VCI_UNSPEC)  
@@ -2700,7 +2700,7 @@
 	/* Device dependent initialization */  
 	ia_vcc = kmalloc(sizeof(*ia_vcc), GFP_KERNEL);  
 	if (!ia_vcc) return -ENOMEM;  
-	INPH_IA_VCC(vcc) = ia_vcc;  
+	vcc->dev_data = ia_vcc;
   
 	if ((error = open_rx(vcc)))  
 	{  
@@ -3196,7 +3196,7 @@
 		ret = -ENOMEM;
 		goto err_out_disable_dev;
 	}
-	INPH_IA_DEV(dev) = iadev; 
+	dev->dev_data = iadev;
 	IF_INIT(printk(DEV_LABEL "registered at (itf :%d)\n", dev->number);)
 	IF_INIT(printk("dev_id = 0x%x iadev->LineRate = %d \n", (u32)dev,
 		iadev->LineRate);)
--- diff/drivers/atm/suni.c	2003-05-21 11:49:54.000000000 +0100
+++ source/drivers/atm/suni.c	2004-02-09 10:39:52.000000000 +0000
@@ -230,7 +230,7 @@
 	unsigned long flags;
 	int first;
 
-	if (!(PRIV(dev) = kmalloc(sizeof(struct suni_priv),GFP_KERNEL)))
+	if (!(dev->dev_data = kmalloc(sizeof(struct suni_priv),GFP_KERNEL)))
 		return -ENOMEM;
 
 	PRIV(dev)->dev = dev;
--- diff/drivers/atm/uPD98402.c	2003-09-30 15:46:12.000000000 +0100
+++ source/drivers/atm/uPD98402.c	2004-02-09 10:39:52.000000000 +0000
@@ -211,7 +211,7 @@
 static int uPD98402_start(struct atm_dev *dev)
 {
 	DPRINTK("phy_start\n");
-	if (!(PRIV(dev) = kmalloc(sizeof(struct uPD98402_priv),GFP_KERNEL)))
+	if (!(dev->dev_data = kmalloc(sizeof(struct uPD98402_priv),GFP_KERNEL)))
 		return -ENOMEM;
 	spin_lock_init(&PRIV(dev)->lock);
 	memset(&PRIV(dev)->sonet_stats,0,sizeof(struct k_sonet_stats));
--- diff/drivers/atm/zatm.c	2003-10-09 09:47:33.000000000 +0100
+++ source/drivers/atm/zatm.c	2004-02-09 10:39:52.000000000 +0000
@@ -1368,7 +1368,7 @@
         DPRINTK("zatm_close: done waiting\n");
         /* deallocate memory */
         kfree(ZATM_VCC(vcc));
-        ZATM_VCC(vcc) = NULL;
+	vcc->dev_data = NULL;
 	clear_bit(ATM_VF_ADDR,&vcc->flags);
 }
 
@@ -1383,7 +1383,8 @@
 
 	DPRINTK(">zatm_open\n");
 	zatm_dev = ZATM_DEV(vcc->dev);
-	if (!test_bit(ATM_VF_PARTIAL,&vcc->flags)) ZATM_VCC(vcc) = NULL;
+	if (!test_bit(ATM_VF_PARTIAL,&vcc->flags))
+		vcc->dev_data = NULL;
 	if (vci != ATM_VPI_UNSPEC && vpi != ATM_VCI_UNSPEC)
 		set_bit(ATM_VF_ADDR,&vcc->flags);
 	if (vcc->qos.aal != ATM_AAL5) return -EINVAL; /* @@@ AAL0 */
@@ -1395,7 +1396,7 @@
 			clear_bit(ATM_VF_ADDR,&vcc->flags);
 			return -ENOMEM;
 		}
-		ZATM_VCC(vcc) = zatm_vcc;
+		vcc->dev_data = zatm_vcc;
 		ZATM_VCC(vcc)->tx_chan = 0; /* for zatm_close after open_rx */
 		if ((error = open_rx_first(vcc))) {
 	                zatm_close(vcc);
@@ -1597,7 +1598,7 @@
 			dev = atm_dev_register(DEV_LABEL,&ops,-1,NULL);
 			if (!dev) break;
 			zatm_dev->pci_dev = pci_dev;
-			ZATM_DEV(dev) = zatm_dev;
+			dev->dev_data = zatm_dev;
 			zatm_dev->copper = type;
 			if (zatm_init(dev) || zatm_start(dev)) {
 				atm_dev_deregister(dev);
--- diff/drivers/base/Makefile	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/base/Makefile	2004-02-09 10:39:52.000000000 +0000
@@ -3,6 +3,7 @@
 obj-y			:= core.o sys.o interface.o bus.o \
 			   driver.o class.o class_simple.o platform.o \
 			   cpu.o firmware.o init.o map.o
+obj-$(CONFIG_PCI)	+= dmapool.o
 obj-y			+= power/
 obj-$(CONFIG_FW_LOADER)	+= firmware_class.o
-obj-$(CONFIG_NUMA)	+= node.o  memblk.o
+obj-$(CONFIG_NUMA)	+= node.o
--- diff/drivers/base/class_simple.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/base/class_simple.c	2004-02-09 10:39:52.000000000 +0000
@@ -170,6 +170,24 @@
 EXPORT_SYMBOL(class_simple_device_add);
 
 /**
+ * class_simple_set_hotplug - set the hotplug callback in the embedded struct class
+ * @cs: pointer to the struct class_simple to hold the pointer
+ * @hotplug: function pointer to the hotplug function
+ *
+ * Implement and set a hotplug function to add environment variables specific to this 
+ * class on the hotplug event.
+ */
+int class_simple_set_hotplug(struct class_simple *cs, 
+	int (*hotplug)(struct class_device *dev, char **envp, int num_envp, char *buffer, int buffer_size))
+{
+	if ((cs == NULL) || (IS_ERR(cs)))
+		return -ENODEV;
+	cs->class.hotplug = hotplug;
+	return 0;
+}
+EXPORT_SYMBOL(class_simple_set_hotplug);
+
+/**
  * 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.
  *
--- diff/drivers/base/core.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/base/core.c	2004-02-09 10:39:52.000000000 +0000
@@ -76,7 +76,6 @@
 static void device_release(struct kobject * kobj)
 {
 	struct device * dev = to_dev(kobj);
-	struct completion * c = dev->complete;
 
 	if (dev->release)
 		dev->release(dev);
@@ -86,8 +85,6 @@
 			dev->bus_id);
 		WARN_ON(1);
 	}
-	if (c)
-		complete(c);
 }
 
 static struct kobj_type ktype_device = {
@@ -197,6 +194,7 @@
 	INIT_LIST_HEAD(&dev->children);
 	INIT_LIST_HEAD(&dev->driver_list);
 	INIT_LIST_HEAD(&dev->bus_list);
+	INIT_LIST_HEAD(&dev->dma_pools);
 }
 
 /**
@@ -355,25 +353,6 @@
 
 
 /**
- *	device_unregister_wait - Unregister device and wait for it to be freed.
- *	@dev: Device to unregister.
- *
- *	For the cases where the caller needs to wait for all references to
- *	be dropped from the device before continuing (e.g. modules with
- *	statically allocated devices), this function uses a completion struct
- *	to wait, along with a matching complete() in device_release() above.
- */
-
-void device_unregister_wait(struct device * dev)
-{
-	struct completion c;
-	init_completion(&c);
-	dev->complete = &c;
-	device_unregister(dev);
-	wait_for_completion(&c);
-}
-
-/**
  *	device_for_each_child - device child iterator.
  *	@dev:	parent struct device.
  *	@data:	data for the callback.
@@ -421,7 +400,6 @@
 
 EXPORT_SYMBOL(device_del);
 EXPORT_SYMBOL(device_unregister);
-EXPORT_SYMBOL(device_unregister_wait);
 EXPORT_SYMBOL(get_device);
 EXPORT_SYMBOL(put_device);
 EXPORT_SYMBOL(device_find);
--- diff/drivers/base/cpu.c	2003-10-27 09:20:43.000000000 +0000
+++ source/drivers/base/cpu.c	2004-02-09 10:39:52.000000000 +0000
@@ -7,6 +7,7 @@
 #include <linux/init.h>
 #include <linux/cpu.h>
 #include <linux/topology.h>
+#include <linux/device.h>
 
 
 struct sysdev_class cpu_sysdev_class = {
@@ -14,6 +15,46 @@
 };
 EXPORT_SYMBOL(cpu_sysdev_class);
 
+#ifdef CONFIG_HOTPLUG_CPU
+static ssize_t show_online(struct sys_device *dev, char *buf)
+{
+	struct cpu *cpu = container_of(dev, struct cpu, sysdev);
+
+	return sprintf(buf, "%u\n", !!cpu_online(cpu->sysdev.id));
+}
+
+static ssize_t store_online(struct sys_device *dev, const char *buf,
+			    size_t count)
+{
+	struct cpu *cpu = container_of(dev, struct cpu, sysdev);
+	ssize_t ret;
+
+	switch (buf[0]) {
+	case '0':
+		ret = cpu_down(cpu->sysdev.id);
+		break;
+	case '1':
+		ret = cpu_up(cpu->sysdev.id);
+		break;
+	default:
+		ret = -EINVAL;
+	}
+
+	if (ret >= 0)
+		ret = count;
+	return ret;
+}
+static SYSDEV_ATTR(online, 0600, show_online, store_online);
+
+static void __init register_cpu_control(struct cpu *cpu)
+{
+	sysdev_create_file(&cpu->sysdev, &attr_online);
+}
+#else /* ... !CONFIG_HOTPLUG_CPU */
+static void __init register_cpu_control(struct cpu *cpu)
+{
+}
+#endif /* CONFIG_HOTPLUG_CPU */
 
 /*
  * register_cpu - Setup a driverfs device for a CPU.
@@ -34,6 +75,8 @@
 		error = sysfs_create_link(&root->sysdev.kobj,
 					  &cpu->sysdev.kobj,
 					  kobject_name(&cpu->sysdev.kobj));
+	if (!error)
+		register_cpu_control(cpu);
 	return error;
 }
 
--- diff/drivers/block/Kconfig.iosched	2003-10-09 09:47:16.000000000 +0100
+++ source/drivers/block/Kconfig.iosched	2004-02-09 10:39:52.000000000 +0000
@@ -27,3 +27,10 @@
 	  a disk at any one time, its behaviour is almost identical to the
 	  anticipatory I/O scheduler and so is a good choice.
 
+config IOSCHED_CFQ
+	bool "CFQ I/O scheduler" if EMBEDDED
+	default y
+	---help---
+	  The CFQ I/O scheduler tries to distribute bandwidth equally
+	  among all processes in the system. It should provide a fair
+	  working environment, suitable for desktop systems.
--- diff/drivers/block/Makefile	2003-10-27 09:20:37.000000000 +0000
+++ source/drivers/block/Makefile	2004-02-09 10:39:52.000000000 +0000
@@ -18,6 +18,7 @@
 obj-$(CONFIG_IOSCHED_NOOP)	+= noop-iosched.o
 obj-$(CONFIG_IOSCHED_AS)	+= as-iosched.o
 obj-$(CONFIG_IOSCHED_DEADLINE)	+= deadline-iosched.o
+obj-$(CONFIG_IOSCHED_CFQ)	+= cfq-iosched.o
 obj-$(CONFIG_MAC_FLOPPY)	+= swim3.o
 obj-$(CONFIG_BLK_DEV_FD)	+= floppy.o
 obj-$(CONFIG_BLK_DEV_FD98)	+= floppy98.o
--- diff/drivers/block/cciss.c	2003-10-09 09:47:33.000000000 +0100
+++ source/drivers/block/cciss.c	2004-02-09 10:39:52.000000000 +0000
@@ -45,12 +45,14 @@
 #include <linux/completion.h>
 
 #define CCISS_DRIVER_VERSION(maj,min,submin) ((maj<<16)|(min<<8)|(submin))
-#define DRIVER_NAME "Compaq CISS Driver (v 2.5.0)"
-#define DRIVER_VERSION CCISS_DRIVER_VERSION(2,5,0)
+#define DRIVER_NAME "Compaq CISS Driver (v 2.6.0)"
+#define DRIVER_VERSION CCISS_DRIVER_VERSION(2,6,0)
 
 /* Embedded module documentation macros - see modules.h */
-MODULE_AUTHOR("Charles M. White III - Compaq Computer Corporation");
-MODULE_DESCRIPTION("Driver for Compaq Smart Array Controller 5xxx v. 2.5.0");
+MODULE_AUTHOR("Hewlett-Packard Company");
+MODULE_DESCRIPTION("Driver for HP Controller SA5xxx SA6xxx version 2.6.0");
+MODULE_SUPPORTED_DEVICE("HP SA5i SA5i+ SA532 SA5300 SA5312 SA641 SA642 SA6400"
+			" SA6i");
 MODULE_LICENSE("GPL");
 
 #include "cciss_cmd.h"
@@ -75,6 +77,8 @@
 		0x0E11, 0x409C, 0, 0, 0},
 	{ PCI_VENDOR_ID_COMPAQ, PCI_DEVICE_ID_COMPAQ_CISSC,
 		0x0E11, 0x409D, 0, 0, 0},
+	{ PCI_VENDOR_ID_COMPAQ, PCI_DEVICE_ID_COMPAQ_CISSC,
+		0x0E11, 0x4091, 0, 0, 0},
 	{0,}
 };
 MODULE_DEVICE_TABLE(pci, cciss_pci_device_id);
@@ -94,6 +98,7 @@
 	{ 0x409B0E11, "Smart Array 642", &SA5_access},
 	{ 0x409C0E11, "Smart Array 6400", &SA5_access},
 	{ 0x409D0E11, "Smart Array 6400 EM", &SA5_access},
+	{ 0x40910E11, "Smart Array 6i", &SA5_access},
 };
 
 /* How long to wait (in millesconds) for board to go into simple mode */
@@ -103,7 +108,7 @@
 /*define how many times we will try a command because of bus resets */
 #define MAX_CMD_RETRIES 3
 
-#define READ_AHEAD 	 128
+#define READ_AHEAD 	 256
 #define NR_CMDS		 384 /* #commands that can be outstanding */
 #define MAX_CTLR 8
 
@@ -151,6 +156,11 @@
 /*
  * Report information about this controller.
  */
+#define ENG_GIG 1048576000
+#define ENG_GIG_FACTOR (ENG_GIG/512)
+#define RAID_UNKNOWN 6
+static const char *raid_label[] = {"0","4","1(0+1)","5","5+1","ADG",
+	                                   "UNKNOWN"};
 #ifdef CONFIG_PROC_FS
 
 static struct proc_dir_entry *proc_cciss;
@@ -163,49 +173,80 @@
         int size, i, ctlr;
         ctlr_info_t *h = (ctlr_info_t*)data;
         drive_info_struct *drv;
+	unsigned long flags;
+	unsigned int vol_sz, vol_sz_frac;
 
         ctlr = h->ctlr;
-        size = sprintf(buffer, "%s:  Compaq %s Controller\n"
-                "       Board ID: 0x%08lx\n"
-		"       Firmware Version: %c%c%c%c\n"
-                "       Memory Address: 0x%08lx\n"
-                "       IRQ: %d\n"
-                "       Logical drives: %d\n"
-		"       Highest Logical Volume ID: %d\n"
-                "       Current Q depth: %d\n"
-                "       Max Q depth since init: %d\n"
-		"       Max # commands on controller since init: %d\n"
-		"       Max SG entries since init: %d\n\n",
+
+	/* prevent displaying bogus info during configuration
+	 * or deconfiguration of a logical volume
+	 */
+	spin_lock_irqsave(CCISS_LOCK(ctlr), flags);
+	if (h->busy_configuring) {
+		spin_unlock_irqrestore(CCISS_LOCK(ctlr), flags);
+	return -EBUSY;
+	}
+	h->busy_configuring = 1;
+	spin_unlock_irqrestore(CCISS_LOCK(ctlr), flags);
+
+        size = sprintf(buffer, "%s: HP %s Controller\n"
+		"Board ID: 0x%08lx\n"
+		"Firmware Version: %c%c%c%c\n"
+		"IRQ: %d\n"
+		"Logical drives: %d\n"
+		"Current Q depth: %d\n"
+		"Current # commands on controller: %d\n"
+		"Max Q depth since init: %d\n"
+		"Max # commands on controller since init: %d\n"
+		"Max SG entries since init: %d\n\n",
                 h->devname,
                 h->product_name,
                 (unsigned long)h->board_id,
 		h->firm_ver[0], h->firm_ver[1], h->firm_ver[2], h->firm_ver[3],
-                (unsigned long)h->vaddr,
                 (unsigned int)h->intr,
                 h->num_luns, 
-                h->highest_lun, 
-                h->Qdepth, h->maxQsinceinit, h->max_outstanding, h->maxSG);
+		h->Qdepth, h->commands_outstanding,
+		h->maxQsinceinit, h->max_outstanding, h->maxSG);
 
         pos += size; len += size;
 	cciss_proc_tape_report(ctlr, buffer, &pos, &len);
 	for(i=0; i<h->highest_lun; i++) {
+		sector_t tmp;
+
                 drv = &h->drv[i];
 		if (drv->block_size == 0)
 			continue;
-                size = sprintf(buffer+len, "cciss/c%dd%d: blksz=%d nr_blocks=%llu\n",
-                                ctlr, i, drv->block_size, (unsigned long long)drv->nr_blocks);
+		vol_sz = drv->nr_blocks;
+		sector_div(vol_sz, ENG_GIG_FACTOR);
+
+		/*
+		 * Awkwardly do this:
+		 * vol_sz_frac =
+		 *     (drv->nr_blocks%ENG_GIG_FACTOR)*100/ENG_GIG_FACTOR;
+		 */
+		tmp = drv->nr_blocks;
+		vol_sz_frac = sector_div(tmp, ENG_GIG_FACTOR);
+
+		/* Now, vol_sz_frac = (drv->nr_blocks%ENG_GIG_FACTOR) */
+
+		vol_sz_frac *= 100;
+		sector_div(vol_sz_frac, ENG_GIG_FACTOR);
+
+		if (drv->raid_level > 5)
+			drv->raid_level = RAID_UNKNOWN;
+		size = sprintf(buffer+len, "cciss/c%dd%d:"
+				"\t%4d.%02dGB\tRAID %s\n",
+				ctlr, i, vol_sz,vol_sz_frac,
+				raid_label[drv->raid_level]);
                 pos += size; len += size;
         }
 
-	size = sprintf(buffer+len, "nr_allocs = %d\nnr_frees = %d\n",
-                        h->nr_allocs, h->nr_frees);
-        pos += size; len += size;
-
         *eof = 1;
         *start = buffer+offset;
         len -= offset;
         if (len>length)
                 len = length;
+	h->busy_configuring = 0;
         return len;
 }
 
@@ -1304,7 +1345,7 @@
 		*total_size = 0;
 		*block_size = BLOCK_SIZE;
 	}
-	printk(KERN_INFO "      blocks= %d block_size= %d\n",
+	printk(KERN_INFO "      blocks= %u block_size= %d\n",
 		*total_size, *block_size);
 	return;
 }
@@ -1978,7 +2019,7 @@
 
 
 	/* Is this interrupt for us? */
-	if ( h->access.intr_pending(h) == 0)
+	if (( h->access.intr_pending(h) == 0) || (h->interrupts_enabled == 0))
 		return IRQ_NONE;
 
 	/*
@@ -2078,18 +2119,61 @@
 	c->io_mem_addr = 0;
 	c->io_mem_length = 0;
 }
+
+static int find_PCI_BAR_index(struct pci_dev *pdev,
+				unsigned long pci_bar_addr)
+{
+	int i, offset, mem_type, bar_type;
+	if (pci_bar_addr == PCI_BASE_ADDRESS_0) /* looking for BAR zero? */
+		return 0;
+	offset = 0;
+	for (i=0; i<DEVICE_COUNT_RESOURCE; i++) {
+		bar_type = pci_resource_flags(pdev, i) &
+			PCI_BASE_ADDRESS_SPACE;
+		if (bar_type == PCI_BASE_ADDRESS_SPACE_IO)
+			offset += 4;
+		else {
+			mem_type = pci_resource_flags(pdev, i) &
+				PCI_BASE_ADDRESS_MEM_TYPE_MASK;
+			switch (mem_type) {
+				case PCI_BASE_ADDRESS_MEM_TYPE_32:
+				case PCI_BASE_ADDRESS_MEM_TYPE_1M:
+					offset += 4; /* 32 bit */
+					break;
+				case PCI_BASE_ADDRESS_MEM_TYPE_64:
+					offset += 8;
+					break;
+				default: /* reserved in PCI 2.2 */
+					printk(KERN_WARNING "Base address is invalid\n");
+			       		return -1;
+				break;
+			}
+		}
+ 		if (offset == pci_bar_addr - PCI_BASE_ADDRESS_0)
+			return i+1;
+	}
+	return -1;
+}
+
 static int cciss_pci_init(ctlr_info_t *c, struct pci_dev *pdev)
 {
-	ushort vendor_id, device_id, command;
-	unchar cache_line_size, latency_timer;
-	unchar irq, revision;
-	uint addr[6];
+	ushort subsystem_vendor_id, subsystem_device_id, command;
+	unchar irq = pdev->irq;
 	__u32 board_id, scratchpad = 0;
-	int cfg_offset;
-	int cfg_base_addr;
-	int cfg_base_addr_index;
+	__u64 cfg_offset;
+	__u32 cfg_base_addr;
+	__u64 cfg_base_addr_index;
 	int i;
 
+	/* check to see if controller has been disabled */
+	/* BEFORE trying to enable it */
+	(void) pci_read_config_word(pdev, PCI_COMMAND,&command);
+	if(!(command & 0x02))
+	{
+		printk(KERN_WARNING "cciss: controller appears to be disabled\n");
+		return(-1);
+	}
+
 	if (pci_enable_device(pdev))
 	{
 		printk(KERN_ERR "cciss: Unable to Enable PCI device\n");
@@ -2101,38 +2185,19 @@
 		return(-1);
 	}
 
-	vendor_id = pdev->vendor;
-	device_id = pdev->device;
-	irq = pdev->irq;
-
-	for(i=0; i<6; i++)
-		addr[i] = pdev->resource[i].start;
-
-	(void) pci_read_config_word(pdev, PCI_COMMAND,&command);
-	(void) pci_read_config_byte(pdev, PCI_CLASS_REVISION, &revision);
-	(void) pci_read_config_byte(pdev, PCI_CACHE_LINE_SIZE,
-						&cache_line_size);
-	(void) pci_read_config_byte(pdev, PCI_LATENCY_TIMER,
-						&latency_timer);
-	(void) pci_read_config_dword(pdev, PCI_SUBSYSTEM_VENDOR_ID, 
-						&board_id);
-
-	/* check to see if controller has been disabled */
-	if(!(command & 0x02))
-	{
-		printk(KERN_WARNING "cciss: controller appears to be disabled\n");
-		return(-1);
-	}
+	subsystem_vendor_id = pdev->subsystem_vendor;
+	subsystem_device_id = pdev->subsystem_device;
+	board_id = (((__u32) (subsystem_device_id << 16) & 0xffff0000) |
+					subsystem_vendor_id);
 
 	/* search for our IO range so we can protect it */
-	for(i=0; i<6; i++)
+	for(i=0; i<DEVICE_COUNT_RESOURCE; i++)
 	{
 		/* is this an IO range */ 
-		if( pdev->resource[i].flags & 0x01 )
-		{
-			c->io_mem_addr = pdev->resource[i].start;
-			c->io_mem_length = pdev->resource[i].end -
-				pdev->resource[i].start +1; 
+		if( pci_resource_flags(pdev, i) & 0x01 ) {
+			c->io_mem_addr = pci_resource_start(pdev, i);
+			c->io_mem_length = pci_resource_end(pdev, i) -
+				pci_resource_start(pdev, i) +1;
 #ifdef CCISS_DEBUG
 			printk("IO value found base_addr[%d] %lx %lx\n", i,
 				c->io_mem_addr, c->io_mem_length);
@@ -2151,15 +2216,8 @@
 	}
 
 #ifdef CCISS_DEBUG
-	printk("vendor_id = %x\n", vendor_id);
-	printk("device_id = %x\n", device_id);
 	printk("command = %x\n", command);
-	for(i=0; i<6; i++)
-		printk("addr[%d] = %x\n", i, addr[i]);
-	printk("revision = %x\n", revision);
 	printk("irq = %x\n", irq);
-	printk("cache_line_size = %x\n", cache_line_size);
-	printk("latency_timer = %x\n", latency_timer);
 	printk("board_id = %x\n", board_id);
 #endif /* CCISS_DEBUG */ 
 
@@ -2170,7 +2228,7 @@
          *   table
 	 */
 
-	c->paddr = addr[0] ; /* addressing mode bits already removed */
+	c->paddr = pci_resource_start(pdev, 0); /* addressing mode bits already removed */
 #ifdef CCISS_DEBUG
 	printk("address 0 = %x\n", c->paddr);
 #endif /* CCISS_DEBUG */ 
@@ -2192,22 +2250,27 @@
 
 	/* get the address index number */
 	cfg_base_addr = readl(c->vaddr + SA5_CTCFG_OFFSET);
-	/* I am not prepared to deal with a 64 bit address value */
-	cfg_base_addr &= 0xffff;
+	cfg_base_addr &= (__u32) 0x0000ffff;
 #ifdef CCISS_DEBUG
 	printk("cfg base address = %x\n", cfg_base_addr);
 #endif /* CCISS_DEBUG */
-	cfg_base_addr_index = (cfg_base_addr  - PCI_BASE_ADDRESS_0)/4;
+	cfg_base_addr_index =
+		find_PCI_BAR_index(pdev, cfg_base_addr);
 #ifdef CCISS_DEBUG
 	printk("cfg base address index = %x\n", cfg_base_addr_index);
 #endif /* CCISS_DEBUG */
+	if (cfg_base_addr_index == -1) {
+		printk(KERN_WARNING "cciss: Cannot find cfg_base_addr_index\n");
+		release_io_mem(c);
+		return -1;
+	}
 
 	cfg_offset = readl(c->vaddr + SA5_CTMEM_OFFSET);
 #ifdef CCISS_DEBUG
 	printk("cfg offset = %x\n", cfg_offset);
 #endif /* CCISS_DEBUG */
 	c->cfgtable = (CfgTable_struct *) 
-		remap_pci_mem((addr[cfg_base_addr_index] & 0xfffffff0)
+		remap_pci_mem(pci_resource_start(pdev, cfg_base_addr_index)
 				+ cfg_offset, sizeof(CfgTable_struct));
 	c->board_id = board_id;
 
@@ -2236,6 +2299,17 @@
 		printk("Does not appear to be a valid CISS config table\n");
 		return -1;
 	}
+
+#ifdef CONFIG_X86
+{
+	/* Need to enable prefetch in the SCSI core for 6400 in x86 */
+	__u32 prefetch;
+	prefetch = readl(&(c->cfgtable->SCSI_Prefetch));
+	prefetch |= 0x100;
+	writel(prefetch, &(c->cfgtable->SCSI_Prefetch));
+}
+#endif
+
 #ifdef CCISS_DEBUG
 	printk("Trying to put board into Simple mode\n");
 #endif /* CCISS_DEBUG */ 
@@ -2501,6 +2575,7 @@
 	if (!q)
 		goto clean4;
 
+	q->backing_dev_info.ra_pages = READ_AHEAD;
 	hba[i]->queue = q;
 	q->queuedata = hba[i];
 
@@ -2610,7 +2685,6 @@
 	pci_set_drvdata(pdev, NULL);
 	iounmap((void*)hba[i]->vaddr);
 	cciss_unregister_scsi(i);  /* unhook from SCSI subsystem */
-	blk_cleanup_queue(hba[i]->queue);
 	unregister_blkdev(COMPAQ_CISS_MAJOR+i, hba[i]->devname);
 	remove_proc_entry(hba[i]->devname, proc_cciss);	
 	
@@ -2621,6 +2695,7 @@
 			del_gendisk(disk);
 	}
 
+	blk_cleanup_queue(hba[i]->queue);
 	pci_free_consistent(hba[i]->pdev, NR_CMDS * sizeof(CommandList_struct),
 			    hba[i]->cmd_pool, hba[i]->cmd_pool_dhandle);
 	pci_free_consistent(hba[i]->pdev, NR_CMDS * sizeof( ErrorInfo_struct),
@@ -2646,7 +2721,7 @@
 	printk(KERN_INFO DRIVER_NAME "\n");
 
 	/* Register for our PCI devices */
-	return pci_register_driver(&cciss_pci_driver);
+	return pci_module_init(&cciss_pci_driver);
 }
 
 static int __init init_cciss_module(void)
--- diff/drivers/block/cciss.h	2003-08-20 14:16:27.000000000 +0100
+++ source/drivers/block/cciss.h	2004-02-09 10:39:52.000000000 +0000
@@ -32,6 +32,7 @@
 	int 	heads;
 	int	sectors;
 	int 	cylinders;
+	int	raid_level;
 } drive_info_struct;
 
 struct ctlr_info 
@@ -42,13 +43,13 @@
 	char	firm_ver[4]; // Firmware version 
 	struct pci_dev *pdev;
 	__u32	board_id;
-	ulong   vaddr;
-	__u32	paddr;	
+	unsigned long vaddr;
+	unsigned long paddr;
 	unsigned long io_mem_addr;
 	unsigned long io_mem_length;
 	CfgTable_struct *cfgtable;
 	int	intr;
-
+	int	interrupts_enabled;
 	int 	max_commands;
 	int	commands_outstanding;
 	int 	max_outstanding; /* Debug */ 
@@ -78,6 +79,7 @@
         unsigned long  		*cmd_pool_bits;
 	int			nr_allocs;
 	int			nr_frees; 
+	int			busy_configuring;
 
 	// Disk structures we need to pass back
 	struct gendisk   *gendisk[NWD];
@@ -134,9 +136,11 @@
 {
 	if (val) 
 	{ /* Turn interrupts on */
+		h->interrupts_enabled = 1;
 		writel(0, h->vaddr + SA5_REPLY_INTR_MASK_OFFSET);
 	} else /* Turn them off */
 	{
+		h->interrupts_enabled = 0;
         	writel( SA5_INTR_OFF, 
 			h->vaddr + SA5_REPLY_INTR_MASK_OFFSET);
 	}
@@ -150,9 +154,11 @@
 {
         if (val)
         { /* Turn interrupts on */
+		h->interrupts_enabled = 1;
                 writel(0, h->vaddr + SA5_REPLY_INTR_MASK_OFFSET);
         } else /* Turn them off */
         {
+		h->interrupts_enabled = 0;
                 writel( SA5B_INTR_OFF,
                         h->vaddr + SA5_REPLY_INTR_MASK_OFFSET);
         }
--- diff/drivers/block/cciss_cmd.h	2003-05-21 11:49:45.000000000 +0100
+++ source/drivers/block/cciss_cmd.h	2004-02-09 10:39:52.000000000 +0000
@@ -265,6 +265,7 @@
   DWORD            Reserved; 
   BYTE             ServerName[16];
   DWORD            HeartBeat;
+  DWORD            SCSI_Prefetch;
 } CfgTable_struct;
 #pragma pack()	 
 #endif // CCISS_CMD_H
--- diff/drivers/block/cryptoloop.c	2003-08-26 10:00:52.000000000 +0100
+++ source/drivers/block/cryptoloop.c	2004-02-09 10:39:52.000000000 +0000
@@ -87,43 +87,49 @@
 
 
 static int
-cryptoloop_transfer_ecb(struct loop_device *lo, int cmd, char *raw_buf,
-		     char *loop_buf, int size, sector_t IV)
+cryptoloop_transfer_ecb(struct loop_device *lo, int cmd,
+			struct page *raw_page, unsigned raw_off,
+			struct page *loop_page, unsigned loop_off,
+			int size, sector_t IV)
 {
 	struct crypto_tfm *tfm = (struct crypto_tfm *) lo->key_data;
 	struct scatterlist sg_out = { 0, };
 	struct scatterlist sg_in = { 0, };
 
 	encdec_ecb_t encdecfunc;
-	char const *in;
-	char *out;
+	struct page *in_page, *out_page;
+	unsigned in_offs, out_offs;
 
 	if (cmd == READ) {
-		in = raw_buf;
-		out = loop_buf;
+		in_page = raw_page;
+		in_offs = raw_off;
+		out_page = loop_page;
+		out_offs = loop_off;
 		encdecfunc = tfm->crt_u.cipher.cit_decrypt;
 	} else {
-		in = loop_buf;
-		out = raw_buf;
+		in_page = loop_page;
+		in_offs = loop_off;
+		out_page = raw_page;
+		out_offs = raw_off;
 		encdecfunc = tfm->crt_u.cipher.cit_encrypt;
 	}
 
 	while (size > 0) {
 		const int sz = min(size, LOOP_IV_SECTOR_SIZE);
 
-		sg_in.page = virt_to_page(in);
-		sg_in.offset = (unsigned long)in & ~PAGE_MASK;
+		sg_in.page = in_page;
+		sg_in.offset = in_offs;
 		sg_in.length = sz;
 
-		sg_out.page = virt_to_page(out);
-		sg_out.offset = (unsigned long)out & ~PAGE_MASK;
+		sg_out.page = out_page;
+		sg_out.offset = out_offs;
 		sg_out.length = sz;
 
 		encdecfunc(tfm, &sg_out, &sg_in, sz);
 
 		size -= sz;
-		in += sz;
-		out += sz;
+		in_offs += sz;
+		out_offs += sz;
 	}
 
 	return 0;
@@ -135,24 +141,30 @@
 			unsigned int nsg, u8 *iv);
 
 static int
-cryptoloop_transfer_cbc(struct loop_device *lo, int cmd, char *raw_buf,
-		     char *loop_buf, int size, sector_t IV)
+cryptoloop_transfer_cbc(struct loop_device *lo, int cmd,
+			struct page *raw_page, unsigned raw_off,
+			struct page *loop_page, unsigned loop_off,
+			int size, sector_t IV)
 {
 	struct crypto_tfm *tfm = (struct crypto_tfm *) lo->key_data;
 	struct scatterlist sg_out = { 0, };
 	struct scatterlist sg_in = { 0, };
 
 	encdec_cbc_t encdecfunc;
-	char const *in;
-	char *out;
+	struct page *in_page, *out_page;
+	unsigned in_offs, out_offs;
 
 	if (cmd == READ) {
-		in = raw_buf;
-		out = loop_buf;
+		in_page = raw_page;
+		in_offs = raw_off;
+		out_page = loop_page;
+		out_offs = loop_off;
 		encdecfunc = tfm->crt_u.cipher.cit_decrypt_iv;
 	} else {
-		in = loop_buf;
-		out = raw_buf;
+		in_page = loop_page;
+		in_offs = loop_off;
+		out_page = raw_page;
+		out_offs = raw_off;
 		encdecfunc = tfm->crt_u.cipher.cit_encrypt_iv;
 	}
 
@@ -161,39 +173,43 @@
 		u32 iv[4] = { 0, };
 		iv[0] = cpu_to_le32(IV & 0xffffffff);
 
-		sg_in.page = virt_to_page(in);
-		sg_in.offset = offset_in_page(in);
+		sg_in.page = in_page;
+		sg_in.offset = in_offs;
 		sg_in.length = sz;
 
-		sg_out.page = virt_to_page(out);
-		sg_out.offset = offset_in_page(out);
+		sg_out.page = out_page;
+		sg_out.offset = out_offs;
 		sg_out.length = sz;
 
 		encdecfunc(tfm, &sg_out, &sg_in, sz, (u8 *)iv);
 
 		IV++;
 		size -= sz;
-		in += sz;
-		out += sz;
+		in_offs += sz;
+		out_offs += sz;
 	}
 
 	return 0;
 }
 
 static int
-cryptoloop_transfer(struct loop_device *lo, int cmd, char *raw_buf,
-		     char *loop_buf, int size, sector_t IV)
+cryptoloop_transfer(struct loop_device *lo, int cmd,
+		    struct page *raw_page, unsigned raw_off,
+		    struct page *loop_page, unsigned loop_off,
+		    int size, sector_t IV)
 {
 	struct crypto_tfm *tfm = (struct crypto_tfm *) lo->key_data;
 	if(tfm->crt_cipher.cit_mode == CRYPTO_TFM_MODE_ECB)
 	{
 		lo->transfer = cryptoloop_transfer_ecb;
-		return cryptoloop_transfer_ecb(lo, cmd, raw_buf, loop_buf, size, IV);
+		return cryptoloop_transfer_ecb(lo, cmd, raw_page, raw_off,
+					       loop_page, loop_off, size, IV);
 	}	
 	if(tfm->crt_cipher.cit_mode == CRYPTO_TFM_MODE_CBC)
 	{	
 		lo->transfer = cryptoloop_transfer_cbc;
-		return cryptoloop_transfer_cbc(lo, cmd, raw_buf, loop_buf, size, IV);
+		return cryptoloop_transfer_cbc(lo, cmd, raw_page, raw_off,
+					       loop_page, loop_off, size, IV);
 	}
 	
 	/*  This is not supposed to happen */
--- diff/drivers/block/floppy.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/block/floppy.c	2004-02-09 10:39:52.000000000 +0000
@@ -4376,6 +4376,7 @@
 		/* to be cleaned up... */
 		disks[drive]->private_data = (void*)(long)drive;
 		disks[drive]->queue = floppy_queue;
+		disks[drive]->flags |= GENHD_FL_REMOVABLE;
 		add_disk(disks[drive]);
 	}
 
--- diff/drivers/block/genhd.c	2004-01-19 10:22:56.000000000 +0000
+++ source/drivers/block/genhd.c	2004-02-09 10:39:52.000000000 +0000
@@ -260,8 +260,10 @@
 	if (&sgp->kobj.entry == block_subsys.kset.list.next)
 		seq_puts(part, "major minor  #blocks  name\n\n");
 
-	/* Don't show non-partitionable devices or empty devices */
-	if (!get_capacity(sgp) || sgp->minors == 1)
+	/* Don't show non-partitionable removeable devices or empty devices */
+	if (!get_capacity(sgp) ||
+	    (sgp->minors == 1 && (sgp->flags & GENHD_FL_REMOVABLE))
+		)
 		return 0;
 
 	/* show the full disk and all non-0 size partitions of it */
--- diff/drivers/block/ll_rw_blk.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/block/ll_rw_blk.c	2004-02-09 10:39:52.000000000 +0000
@@ -27,6 +27,7 @@
 #include <linux/completion.h>
 #include <linux/slab.h>
 #include <linux/swap.h>
+#include <linux/writeback.h>
 
 static void blk_unplug_work(void *data);
 static void blk_unplug_timeout(unsigned long data);
@@ -521,10 +522,10 @@
 {
 	int bits, i;
 
-	if (depth > q->nr_requests * 2) {
-		depth = q->nr_requests * 2;
-		printk(KERN_ERR "%s: adjusted depth to %d\n",
-				__FUNCTION__, depth);
+	if (depth > q->nr_requests / 2) {
+		q->nr_requests = depth * 2;
+		printk(KERN_INFO "%s: large TCQ depth: adjusted nr_requests "
+				 "to %lu\n", __FUNCTION__, q->nr_requests);
 	}
 
 	tags->tag_index = kmalloc(depth * sizeof(struct request *), GFP_ATOMIC);
@@ -1334,6 +1335,8 @@
 	&iosched_as;
 #elif defined(CONFIG_IOSCHED_DEADLINE)
 	&iosched_deadline;
+#elif defined(CONFIG_IOSCHED_CFQ)
+	&iosched_cfq;
 #elif defined(CONFIG_IOSCHED_NOOP)
 	&elevator_noop;
 #else
@@ -1352,6 +1355,10 @@
 	if (!strcmp(str, "as"))
 		chosen_elevator = &iosched_as;
 #endif
+#ifdef CONFIG_IOSCHED_CFQ
+	if (!strcmp(str, "cfq"))
+		chosen_elevator = &iosched_cfq;
+#endif
 #ifdef CONFIG_IOSCHED_NOOP
 	if (!strcmp(str, "noop"))
 		chosen_elevator = &elevator_noop;
@@ -1884,18 +1891,22 @@
  * Waits for up to @timeout jiffies for a queue (any queue) to exit congestion.
  * If no queues are congested then just wait for the next request to be
  * returned.
+ *
+ * Returns the number of jiffies remaining, this is zero, unless we returned
+ * before @timeout expired.
  */
-void blk_congestion_wait(int rw, long timeout)
+long blk_congestion_wait(int rw, long timeout)
 {
+	long ret;
 	DEFINE_WAIT(wait);
 	wait_queue_head_t *wqh = &congestion_wqh[rw];
 
 	blk_run_queues();
 	prepare_to_wait(wqh, &wait, TASK_UNINTERRUPTIBLE);
-	io_schedule_timeout(timeout);
+	ret = io_schedule_timeout(timeout);
 	finish_wait(wqh, &wait);
+	return ret;
 }
-
 EXPORT_SYMBOL(blk_congestion_wait);
 
 /*
@@ -2305,6 +2316,15 @@
 		mod_page_state(pgpgout, count);
 	else
 		mod_page_state(pgpgin, count);
+
+	if (unlikely(block_dump)) {
+		char b[BDEVNAME_SIZE];
+		printk("%s(%d): %s block %Lu on %s\n",
+			current->comm, current->pid,
+			(rw & WRITE) ? "WRITE" : "READ",
+			(unsigned long long)bio->bi_sector, bdevname(bio->bi_bdev,b));
+	}
+
 	generic_make_request(bio);
 	return 1;
 }
@@ -2596,6 +2616,12 @@
 			disk_stat_add(disk, write_ticks, duration);
 			break;
 		    case READ:
+			/*
+			 * schedule the writeout of pending dirty data when the disk is idle.
+			 * (postpone writeback until system is quiescent again.)
+			 */
+			if (unlikely(laptop_mode))
+				disk_is_spun_up(1);
 			disk_stat_inc(disk, reads);
 			disk_stat_add(disk, read_ticks, duration);
 			break;
--- diff/drivers/block/loop.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/block/loop.c	2004-02-09 10:39:52.000000000 +0000
@@ -76,24 +76,34 @@
 /*
  * Transfer functions
  */
-static int transfer_none(struct loop_device *lo, int cmd, char *raw_buf,
-			 char *loop_buf, int size, sector_t real_block)
+static int transfer_none(struct loop_device *lo, int cmd,
+			 struct page *raw_page, unsigned raw_off,
+			 struct page *loop_page, unsigned loop_off,
+			 int size, sector_t real_block)
 {
-	if (raw_buf != loop_buf) {
-		if (cmd == READ)
-			memcpy(loop_buf, raw_buf, size);
-		else
-			memcpy(raw_buf, loop_buf, size);
-	}
+	char *raw_buf = kmap_atomic(raw_page, KM_USER0) + raw_off;
+	char *loop_buf = kmap_atomic(loop_page, KM_USER1) + loop_off;
+
+	if (cmd == READ)
+		memcpy(loop_buf, raw_buf, size);
+	else
+		memcpy(raw_buf, loop_buf, size);
 
+	kunmap_atomic(raw_buf, KM_USER0);
+	kunmap_atomic(loop_buf, KM_USER1);
+	cond_resched();
 	return 0;
 }
 
-static int transfer_xor(struct loop_device *lo, int cmd, char *raw_buf,
-			char *loop_buf, int size, sector_t real_block)
+static int transfer_xor(struct loop_device *lo, int cmd,
+			struct page *raw_page, unsigned raw_off,
+			struct page *loop_page, unsigned loop_off,
+			int size, sector_t real_block)
 {
-	char	*in, *out, *key;
-	int	i, keysize;
+	char *raw_buf = kmap_atomic(raw_page, KM_USER0) + raw_off;
+	char *loop_buf = kmap_atomic(loop_page, KM_USER1) + loop_off;
+	char *in, *out, *key;
+	int i, keysize;
 
 	if (cmd == READ) {
 		in = raw_buf;
@@ -107,6 +117,10 @@
 	keysize = lo->lo_encrypt_key_size;
 	for (i = 0; i < size; i++)
 		*out++ = *in++ ^ key[(i & 511) % keysize];
+
+	kunmap_atomic(raw_buf, KM_USER0);
+	kunmap_atomic(loop_buf, KM_USER1);
+	cond_resched();
 	return 0;
 }
 
@@ -162,13 +176,15 @@
 }
 
 static inline int
-lo_do_transfer(struct loop_device *lo, int cmd, char *rbuf,
-	       char *lbuf, int size, sector_t rblock)
+lo_do_transfer(struct loop_device *lo, int cmd,
+	       struct page *rpage, unsigned roffs,
+	       struct page *lpage, unsigned loffs,
+	       int size, sector_t rblock)
 {
 	if (!lo->transfer)
 		return 0;
 
-	return lo->transfer(lo, cmd, rbuf, lbuf, size, rblock);
+	return lo->transfer(lo, cmd, rpage, roffs, lpage, loffs, size, rblock);
 }
 
 static int
@@ -178,16 +194,15 @@
 	struct address_space *mapping = file->f_mapping;
 	struct address_space_operations *aops = mapping->a_ops;
 	struct page *page;
-	char *kaddr, *data;
 	pgoff_t index;
-	unsigned size, offset;
+	unsigned size, offset, bv_offs;
 	int len;
 	int ret = 0;
 
 	down(&mapping->host->i_sem);
 	index = pos >> PAGE_CACHE_SHIFT;
 	offset = pos & ((pgoff_t)PAGE_CACHE_SIZE - 1);
-	data = kmap(bvec->bv_page) + bvec->bv_offset;
+	bv_offs = bvec->bv_offset;
 	len = bvec->bv_len;
 	while (len > 0) {
 		sector_t IV;
@@ -204,25 +219,28 @@
 			goto fail;
 		if (aops->prepare_write(file, page, offset, offset+size))
 			goto unlock;
-		kaddr = kmap(page);
-		transfer_result = lo_do_transfer(lo, WRITE, kaddr + offset,
-						 data, size, IV);
+		transfer_result = lo_do_transfer(lo, WRITE, page, offset,
+						 bvec->bv_page, bv_offs,
+						 size, IV);
 		if (transfer_result) {
+			char *kaddr;
+
 			/*
 			 * The transfer failed, but we still write the data to
 			 * keep prepare/commit calls balanced.
 			 */
 			printk(KERN_ERR "loop: transfer error block %llu\n",
 			       (unsigned long long)index);
+			kaddr = kmap_atomic(page, KM_USER0);
 			memset(kaddr + offset, 0, size);
+			kunmap_atomic(kaddr, KM_USER0);
 		}
 		flush_dcache_page(page);
-		kunmap(page);
 		if (aops->commit_write(file, page, offset, offset+size))
 			goto unlock;
 		if (transfer_result)
 			goto unlock;
-		data += size;
+		bv_offs += size;
 		len -= size;
 		offset = 0;
 		index++;
@@ -232,7 +250,6 @@
 	}
 	up(&mapping->host->i_sem);
 out:
-	kunmap(bvec->bv_page);
 	return ret;
 
 unlock:
@@ -247,12 +264,10 @@
 static int
 lo_send(struct loop_device *lo, struct bio *bio, int bsize, loff_t pos)
 {
-	unsigned vecnr;
-	int ret = 0;
-
-	for (vecnr = 0; vecnr < bio->bi_vcnt; vecnr++) {
-		struct bio_vec *bvec = &bio->bi_io_vec[vecnr];
+	struct bio_vec *bvec;
+	int i, ret = 0;
 
+	bio_for_each_segment(bvec, bio, i) {
 		ret = do_lo_send(lo, bvec, bsize, pos);
 		if (ret < 0)
 			break;
@@ -263,7 +278,8 @@
 
 struct lo_read_data {
 	struct loop_device *lo;
-	char *data;
+	struct page *page;
+	unsigned offset;
 	int bsize;
 };
 
@@ -271,7 +287,6 @@
 lo_read_actor(read_descriptor_t *desc, struct page *page,
 	      unsigned long offset, unsigned long size)
 {
-	char *kaddr;
 	unsigned long count = desc->count;
 	struct lo_read_data *p = (struct lo_read_data*)desc->buf;
 	struct loop_device *lo = p->lo;
@@ -282,18 +297,16 @@
 	if (size > count)
 		size = count;
 
-	kaddr = kmap(page);
-	if (lo_do_transfer(lo, READ, kaddr + offset, p->data, size, IV)) {
+	if (lo_do_transfer(lo, READ, page, offset, p->page, p->offset, size, IV)) {
 		size = 0;
 		printk(KERN_ERR "loop: transfer error block %ld\n",
 		       page->index);
 		desc->error = -EINVAL;
 	}
-	kunmap(page);
 	
 	desc->count = count - size;
 	desc->written += size;
-	p->data += size;
+	p->offset += size;
 	return size;
 }
 
@@ -306,24 +319,22 @@
 	int retval;
 
 	cookie.lo = lo;
-	cookie.data = kmap(bvec->bv_page) + bvec->bv_offset;
+	cookie.page = bvec->bv_page;
+	cookie.offset = bvec->bv_offset;
 	cookie.bsize = bsize;
 	file = lo->lo_backing_file;
 	retval = file->f_op->sendfile(file, &pos, bvec->bv_len,
 			lo_read_actor, &cookie);
-	kunmap(bvec->bv_page);
 	return (retval < 0)? retval: 0;
 }
 
 static int
 lo_receive(struct loop_device *lo, struct bio *bio, int bsize, loff_t pos)
 {
-	unsigned vecnr;
-	int ret = 0;
-
-	for (vecnr = 0; vecnr < bio->bi_vcnt; vecnr++) {
-		struct bio_vec *bvec = &bio->bi_io_vec[vecnr];
+	struct bio_vec *bvec;
+	int i, ret = 0;
 
+	bio_for_each_segment(bvec, bio, i) {
 		ret = do_lo_receive(lo, bvec, bsize, pos);
 		if (ret < 0)
 			break;
@@ -345,23 +356,6 @@
 	return ret;
 }
 
-static int loop_end_io_transfer(struct bio *, unsigned int, int);
-
-static void loop_put_buffer(struct bio *bio)
-{
-	/*
-	 * check bi_end_io, may just be a remapped bio
-	 */
-	if (bio && bio->bi_end_io == loop_end_io_transfer) {
-		int i;
-
-		for (i = 0; i < bio->bi_vcnt; i++)
-			__free_page(bio->bi_io_vec[i].bv_page);
-
-		bio_put(bio);
-	}
-}
-
 /*
  * Add bio to back of pending list
  */
@@ -399,129 +393,8 @@
 	return bio;
 }
 
-/*
- * if this was a WRITE lo->transfer stuff has already been done. for READs,
- * queue it for the loop thread and let it do the transfer out of
- * bi_end_io context (we don't want to do decrypt of a page with irqs
- * disabled)
- */
-static int loop_end_io_transfer(struct bio *bio, unsigned int bytes_done, int err)
-{
-	struct bio *rbh = bio->bi_private;
-	struct loop_device *lo = rbh->bi_bdev->bd_disk->private_data;
-
-	if (bio->bi_size)
-		return 1;
-
-	if (err || bio_rw(bio) == WRITE) {
-		bio_endio(rbh, rbh->bi_size, err);
-		if (atomic_dec_and_test(&lo->lo_pending))
-			up(&lo->lo_bh_mutex);
-		loop_put_buffer(bio);
-	} else
-		loop_add_bio(lo, bio);
-
-	return 0;
-}
-
-static struct bio *loop_copy_bio(struct bio *rbh)
-{
-	struct bio *bio;
-	struct bio_vec *bv;
-	int i;
-
-	bio = bio_alloc(__GFP_NOWARN, rbh->bi_vcnt);
-	if (!bio)
-		return NULL;
-
-	/*
-	 * iterate iovec list and alloc pages
-	 */
-	__bio_for_each_segment(bv, rbh, i, 0) {
-		struct bio_vec *bbv = &bio->bi_io_vec[i];
-
-		bbv->bv_page = alloc_page(__GFP_NOWARN|__GFP_HIGHMEM);
-		if (bbv->bv_page == NULL)
-			goto oom;
-
-		bbv->bv_len = bv->bv_len;
-		bbv->bv_offset = bv->bv_offset;
-	}
-
-	bio->bi_vcnt = rbh->bi_vcnt;
-	bio->bi_size = rbh->bi_size;
-
-	return bio;
-
-oom:
-	while (--i >= 0)
-		__free_page(bio->bi_io_vec[i].bv_page);
-
-	bio_put(bio);
-	return NULL;
-}
-
-static struct bio *loop_get_buffer(struct loop_device *lo, struct bio *rbh)
-{
-	struct bio *bio;
-
-	/*
-	 * When called on the page reclaim -> writepage path, this code can
-	 * trivially consume all memory.  So we drop PF_MEMALLOC to avoid
-	 * stealing all the page reserves and throttle to the writeout rate.
-	 * pdflush will have been woken by page reclaim.  Let it do its work.
-	 */
-	do {
-		int flags = current->flags;
-
-		current->flags &= ~PF_MEMALLOC;
-		bio = loop_copy_bio(rbh);
-		if (flags & PF_MEMALLOC)
-			current->flags |= PF_MEMALLOC;
-
-		if (bio == NULL)
-			blk_congestion_wait(WRITE, HZ/10);
-	} while (bio == NULL);
-
-	bio->bi_end_io = loop_end_io_transfer;
-	bio->bi_private = rbh;
-	bio->bi_sector = rbh->bi_sector + (lo->lo_offset >> 9);
-	bio->bi_rw = rbh->bi_rw;
-	bio->bi_bdev = lo->lo_device;
-
-	return bio;
-}
-
-static int loop_transfer_bio(struct loop_device *lo,
-			     struct bio *to_bio, struct bio *from_bio)
-{
-	sector_t IV;
-	struct bio_vec *from_bvec, *to_bvec;
-	char *vto, *vfrom;
-	int ret = 0, i;
-
-	IV = from_bio->bi_sector + (lo->lo_offset >> 9);
-
-	__bio_for_each_segment(from_bvec, from_bio, i, 0) {
-		to_bvec = &to_bio->bi_io_vec[i];
-
-		kmap(from_bvec->bv_page);
-		kmap(to_bvec->bv_page);
-		vfrom = page_address(from_bvec->bv_page) + from_bvec->bv_offset;
-		vto = page_address(to_bvec->bv_page) + to_bvec->bv_offset;
-		ret |= lo_do_transfer(lo, bio_data_dir(to_bio), vto, vfrom,
-					from_bvec->bv_len, IV);
-		kunmap(from_bvec->bv_page);
-		kunmap(to_bvec->bv_page);
-		IV += from_bvec->bv_len >> 9;
-	}
-
-	return ret;
-}
-		
 static int loop_make_request(request_queue_t *q, struct bio *old_bio)
 {
-	struct bio *new_bio = NULL;
 	struct loop_device *lo = q->queuedata;
 	int rw = bio_rw(old_bio);
 
@@ -543,31 +416,11 @@
 		printk(KERN_ERR "loop: unknown command (%x)\n", rw);
 		goto err;
 	}
-
-	/*
-	 * file backed, queue for loop_thread to handle
-	 */
-	if (lo->lo_flags & LO_FLAGS_DO_BMAP) {
-		loop_add_bio(lo, old_bio);
-		return 0;
-	}
-
-	/*
-	 * piggy old buffer on original, and submit for I/O
-	 */
-	new_bio = loop_get_buffer(lo, old_bio);
-	if (rw == WRITE) {
-		if (loop_transfer_bio(lo, new_bio, old_bio))
-			goto err;
-	}
-
-	generic_make_request(new_bio);
+	loop_add_bio(lo, old_bio);
 	return 0;
-
 err:
 	if (atomic_dec_and_test(&lo->lo_pending))
 		up(&lo->lo_bh_mutex);
-	loop_put_buffer(new_bio);
 out:
 	bio_io_error(old_bio, old_bio->bi_size);
 	return 0;
@@ -580,20 +433,8 @@
 {
 	int ret;
 
-	/*
-	 * For block backed loop, we know this is a READ
-	 */
-	if (lo->lo_flags & LO_FLAGS_DO_BMAP) {
-		ret = do_bio_filebacked(lo, bio);
-		bio_endio(bio, bio->bi_size, ret);
-	} else {
-		struct bio *rbh = bio->bi_private;
-
-		ret = loop_transfer_bio(lo, bio, rbh);
-
-		bio_endio(rbh, rbh->bi_size, ret);
-		loop_put_buffer(bio);
-	}
+	ret = do_bio_filebacked(lo, bio);
+	bio_endio(bio, bio->bi_size, ret);
 }
 
 /*
@@ -684,31 +525,23 @@
 		lo_flags |= LO_FLAGS_READ_ONLY;
 
 	error = -EINVAL;
-	if (S_ISBLK(inode->i_mode)) {
-		lo_device = I_BDEV(inode);
-		if (lo_device == bdev) {
-			error = -EBUSY;
-			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)) {
+	if (S_ISREG(inode->i_mode) || S_ISBLK(inode->i_mode)) {
 		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.
 		 */
-		if (!inode->i_fop->sendfile)
+		if (!lo_file->f_op->sendfile)
 			goto out_putf;
 
 		if (!aops->prepare_write || !aops->commit_write)
 			lo_flags |= LO_FLAGS_READ_ONLY;
 
 		lo_blocksize = inode->i_blksize;
-		lo_flags |= LO_FLAGS_DO_BMAP;
-	} else
+		error = 0;
+	} else {
 		goto out_putf;
+	}
 
 	if (!(lo_file->f_mode & FMODE_WRITE))
 		lo_flags |= LO_FLAGS_READ_ONLY;
@@ -738,21 +571,6 @@
 	blk_queue_make_request(lo->lo_queue, loop_make_request);
 	lo->lo_queue->queuedata = lo;
 
-	/*
-	 * we remap to a block device, make sure we correctly stack limits
-	 */
-	if (S_ISBLK(inode->i_mode)) {
-		request_queue_t *q = bdev_get_queue(lo_device);
-
-		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);
@@ -1196,7 +1014,6 @@
 		lo->lo_queue = blk_alloc_queue(GFP_KERNEL);
 		if (!lo->lo_queue)
 			goto out_mem4;
-		disks[i]->queue = lo->lo_queue;
 		init_MUTEX(&lo->lo_ctl_mutex);
 		init_MUTEX_LOCKED(&lo->lo_sem);
 		init_MUTEX_LOCKED(&lo->lo_bh_mutex);
@@ -1209,14 +1026,18 @@
 		sprintf(disk->devfs_name, "loop/%d", i);
 		disk->private_data = lo;
 		disk->queue = lo->lo_queue;
-		add_disk(disk);
 	}
+
+	/* We cannot fail after we call this, so another loop!*/
+	for (i = 0; i < max_loop; i++)
+		add_disk(disks[i]);
 	printk(KERN_INFO "loop: loaded (max %d devices)\n", max_loop);
 	return 0;
 
 out_mem4:
 	while (i--)
 		blk_put_queue(loop_dev[i].lo_queue);
+	devfs_remove("loop");
 	i = max_loop;
 out_mem3:
 	while (i--)
--- diff/drivers/block/paride/bpck6.c	2003-06-09 14:18:18.000000000 +0100
+++ source/drivers/block/paride/bpck6.c	2004-02-09 10:39:52.000000000 +0000
@@ -228,7 +228,7 @@
 
 	if (p) {
 		memset(p, 0, sizeof(PPC));
-		pi->private = (int)p;
+		pi->private = (unsigned long)p;
 		return 0;
 	}
 
--- diff/drivers/block/paride/frpw.c	2002-11-18 10:11:54.000000000 +0000
+++ source/drivers/block/paride/frpw.c	2004-02-09 10:39:52.000000000 +0000
@@ -261,7 +261,7 @@
 	frpw_disconnect(pi);
 
         if (verbose)  {
-            printk("%s: frpw: port 0x%x, chip %d, mode %d, test=(%d,%d,%d)\n",
+            printk("%s: frpw: port 0x%x, chip %ld, mode %d, test=(%d,%d,%d)\n",
                    pi->device,pi->port,(pi->private%2),pi->mode,e[0],e[1],r);
         }
 
--- diff/drivers/block/paride/paride.c	2003-08-20 14:16:27.000000000 +0100
+++ source/drivers/block/paride/paride.c	2004-02-09 10:39:52.000000000 +0000
@@ -102,7 +102,7 @@
 
 #endif
 
-void pi_do_claimed(PIA * pi, void (*cont) (void))
+int pi_schedule_claimed(PIA * pi, void (*cont) (void))
 {
 #ifdef CONFIG_PARPORT
 	unsigned long flags;
@@ -111,12 +111,19 @@
 	if (pi->pardev && parport_claim(pi->pardev)) {
 		pi->claim_cont = cont;
 		spin_unlock_irqrestore(&pi_spinlock, flags);
-		return;
+		return 0;
 	}
 	pi->claimed = 1;
 	spin_unlock_irqrestore(&pi_spinlock, flags);
 #endif
-	cont();
+	return 1;
+}
+EXPORT_SYMBOL(pi_schedule_claimed);
+
+void pi_do_claimed(PIA * pi, void (*cont) (void))
+{
+	if (pi_schedule_claimed(pi, cont))
+		cont();
 }
 
 EXPORT_SYMBOL(pi_do_claimed);
@@ -133,7 +140,7 @@
 #endif
 }
 
-static void pi_unclaim(PIA * pi)
+void pi_unclaim(PIA * pi)
 {
 	pi->claimed = 0;
 #ifdef CONFIG_PARPORT
@@ -142,6 +149,8 @@
 #endif
 }
 
+EXPORT_SYMBOL(pi_unclaim);
+
 void pi_connect(PIA * pi)
 {
 	pi_claim(pi);
--- diff/drivers/block/paride/paride.h	2002-11-18 10:11:54.000000000 +0000
+++ source/drivers/block/paride/paride.h	2004-02-09 10:39:52.000000000 +0000
@@ -45,7 +45,7 @@
 	int	saved_r0;	     /* saved port state */
 	int	saved_r2;	     /* saved port state */
 	int	reserved;	     /* number of ports reserved */
-	int	private;	     /* for protocol module */
+	unsigned long	private;     /* for protocol module */
 
 	wait_queue_head_t parq;     /* semaphore for parport sharing */
 	void	*pardev;	     /* pointer to pardevice */
@@ -88,11 +88,14 @@
 
 extern void pi_read_block(PIA *pi, char * buf, int count);
 
+extern void pi_unclaim(PIA *pi);
+
 extern void pi_connect(PIA *pi);
 
 extern void pi_disconnect(PIA *pi);
 
 extern void pi_do_claimed(PIA *pi, void (*cont)(void));
+extern int pi_schedule_claimed(PIA *pi, void (*cont)(void));
 
 /* macros and functions exported to the protocol modules */
 
--- diff/drivers/block/paride/pd.c	2003-09-17 12:28:04.000000000 +0100
+++ source/drivers/block/paride/pd.c	2004-02-09 10:39:52.000000000 +0000
@@ -138,7 +138,6 @@
 static int drive3[8] = { 0, 0, 0, -1, 0, 1, -1, -1 };
 
 static int (*drives[4])[8] = {&drive0, &drive1, &drive2, &drive3};
-static int pd_drive_count;
 
 enum {D_PRT, D_PRO, D_UNI, D_MOD, D_GEO, D_SBY, D_DLY, D_SLV};
 
@@ -153,6 +152,8 @@
 #include <linux/blkdev.h>
 #include <linux/blkpg.h>
 #include <asm/uaccess.h>
+#include <linux/sched.h>
+#include <linux/workqueue.h>
 
 static spinlock_t pd_lock = SPIN_LOCK_UNLOCKED;
 
@@ -188,7 +189,6 @@
 MODULE_PARM(drive3, "1-8i");
 
 #include "paride.h"
-#include "pseudo.h"
 
 #define PD_BITS    4
 
@@ -235,21 +235,6 @@
 #define IDE_IDENTIFY    	0xec
 #define IDE_EJECT		0xed
 
-void pd_setup(char *str, int *ints);
-static int pd_open(struct inode *inode, struct file *file);
-static void do_pd_request(request_queue_t * q);
-static int pd_ioctl(struct inode *inode, struct file *file,
-		    unsigned int cmd, unsigned long arg);
-static int pd_release(struct inode *inode, struct file *file);
-static int pd_revalidate(struct gendisk *p);
-static int pd_detect(void);
-static void do_pd_read(void);
-static void do_pd_read_start(void);
-static void do_pd_write(void);
-static void do_pd_write_start(void);
-static void do_pd_read_drq(void);
-static void do_pd_write_done(void);
-
 #define PD_NAMELEN	8
 
 struct pd_unit {
@@ -266,153 +251,19 @@
 	int removable;		/* removable media device  ?  */
 	int standby;
 	int alt_geom;
-	int present;
 	char name[PD_NAMELEN];	/* pda, pdb, etc ... */
 	struct gendisk *gd;
 };
 
 struct pd_unit pd[PD_UNITS];
 
-static int pd_identify(struct pd_unit *disk);
-static void pd_media_check(struct pd_unit *disk);
-static void pd_doorlock(struct pd_unit *disk, int func);
-static int pd_check_media(struct gendisk *p);
-static void pd_eject(struct pd_unit *disk);
-
 static char pd_scratch[512];	/* scratch block buffer */
 
-/* the variables below are used mainly in the I/O request engine, which
-   processes only one request at a time.
-*/
-
-static struct pd_unit *pd_current; /* current request's drive */
-static int pd_retries = 0;	/* i/o error retry count */
-static int pd_busy = 0;		/* request being processed ? */
-static struct request *pd_req;	/* current request */
-static int pd_block;		/* address of next requested block */
-static int pd_count;		/* number of blocks still to do */
-static int pd_run;		/* sectors in current cluster */
-static int pd_cmd;		/* current command READ/WRITE */
-static char *pd_buf;		/* buffer for request in progress */
-
-static DECLARE_WAIT_QUEUE_HEAD(pd_wait_open);
-
 static char *pd_errs[17] = { "ERR", "INDEX", "ECC", "DRQ", "SEEK", "WRERR",
 	"READY", "BUSY", "AMNF", "TK0NF", "ABRT", "MCR",
 	"IDNF", "MC", "UNC", "???", "TMO"
 };
 
-/* kernel glue structures */
-
-extern struct block_device_operations pd_fops;
-
-static struct block_device_operations pd_fops = {
-	.owner		= THIS_MODULE,
-	.open		= pd_open,
-	.release	= pd_release,
-	.ioctl		= pd_ioctl,
-	.media_changed	= pd_check_media,
-	.revalidate_disk= pd_revalidate
-};
-
-static void pd_init_units(void)
-{
-	int unit;
-
-	pd_drive_count = 0;
-	for (unit = 0; unit < PD_UNITS; unit++) {
-		int *parm = *drives[unit];
-		struct pd_unit *disk = pd + unit;
-		disk->pi = &disk->pia;
-		disk->access = 0;
-		disk->changed = 1;
-		disk->capacity = 0;
-		disk->drive = parm[D_SLV];
-		disk->present = 0;
-		snprintf(disk->name, PD_NAMELEN, "%s%c", name, 'a'+unit);
-		disk->alt_geom = parm[D_GEO];
-		disk->standby = parm[D_SBY];
-		if (parm[D_PRT])
-			pd_drive_count++;
-	}
-}
-
-static int pd_open(struct inode *inode, struct file *file)
-{
-	struct pd_unit *disk = inode->i_bdev->bd_disk->private_data;
-
-	disk->access++;
-
-	if (disk->removable) {
-		pd_media_check(disk);
-		pd_doorlock(disk, IDE_DOORLOCK);
-	}
-	return 0;
-}
-
-static int pd_ioctl(struct inode *inode, struct file *file,
-	 unsigned int cmd, unsigned long arg)
-{
-	struct pd_unit *disk = inode->i_bdev->bd_disk->private_data;
-	struct hd_geometry *geo = (struct hd_geometry *) arg;
-	struct hd_geometry g;
-
-	switch (cmd) {
-	case CDROMEJECT:
-		if (disk->access == 1)
-			pd_eject(disk);
-		return 0;
-	case HDIO_GETGEO:
-		if (disk->alt_geom) {
-			g.heads = PD_LOG_HEADS;
-			g.sectors = PD_LOG_SECTS;
-			g.cylinders = disk->capacity / (g.heads * g.sectors);
-		} else {
-			g.heads = disk->heads;
-			g.sectors = disk->sectors;
-			g.cylinders = disk->cylinders;
-		}
-		g.start = get_start_sect(inode->i_bdev);
-		if (copy_to_user(geo, &g, sizeof(struct hd_geometry)))
-			return -EFAULT;
-		return 0;
-	default:
-		return -EINVAL;
-	}
-}
-
-static int pd_release(struct inode *inode, struct file *file)
-{
-	struct pd_unit *disk = inode->i_bdev->bd_disk->private_data;
-
-	if (!--disk->access && disk->removable)
-		pd_doorlock(disk, IDE_DOORUNLOCK);
-
-	return 0;
-}
-
-static int pd_check_media(struct gendisk *p)
-{
-	struct pd_unit *disk = p->private_data;
-	int r;
-	if (!disk->removable)
-		return 0;
-	pd_media_check(disk);
-	r = disk->changed;
-	disk->changed = 0;
-	return r;
-}
-
-static int pd_revalidate(struct gendisk *p)
-{
-	struct pd_unit *disk = p->private_data;
-	if (pd_identify(disk))
-		set_capacity(p, disk->capacity);
-	else
-		set_capacity(p, 0);
-	return 0;
-}
-
 static inline int status_reg(struct pd_unit *disk)
 {
 	return pi_read_regr(disk->pi, 1, 6);
@@ -453,11 +304,9 @@
 
 static void pd_reset(struct pd_unit *disk)
 {				/* called only for MASTER drive */
-	pi_connect(disk->pi);
 	write_status(disk, 4);
 	udelay(50);
 	write_status(disk, 0);
-	pi_disconnect(disk->pi);
 	udelay(250);
 }
 
@@ -514,6 +363,236 @@
 	pd_send_command(disk, count, s, h, c0, c1, func);
 }
 
+/* The i/o request engine */
+
+enum action {Fail = 0, Ok = 1, Hold, Wait};
+
+static struct request *pd_req;	/* current request */
+static enum action (*phase)(void);
+
+static void run_fsm(void);
+
+static void ps_tq_int( void *data);
+
+static DECLARE_WORK(fsm_tq, ps_tq_int, NULL);
+
+static void schedule_fsm(void)
+{
+	if (!nice)
+		schedule_work(&fsm_tq);
+	else
+		schedule_delayed_work(&fsm_tq, nice-1);
+}
+
+static void ps_tq_int(void *data)
+{
+	run_fsm();
+}
+
+static enum action do_pd_io_start(void);
+static enum action pd_special(void);
+static enum action do_pd_read_start(void);
+static enum action do_pd_write_start(void);
+static enum action do_pd_read_drq(void);
+static enum action do_pd_write_done(void);
+
+static struct request_queue *pd_queue;
+static int pd_claimed;
+
+static struct pd_unit *pd_current; /* current request's drive */
+static PIA *pi_current; /* current request's PIA */
+
+static void run_fsm(void)
+{
+	while (1) {
+		enum action res;
+		unsigned long saved_flags;
+		int stop = 0;
+
+		if (!phase) {
+			pd_current = pd_req->rq_disk->private_data;
+			pi_current = pd_current->pi;
+			phase = do_pd_io_start;
+		}
+
+		switch (pd_claimed) {
+			case 0:
+				pd_claimed = 1;
+				if (!pi_schedule_claimed(pi_current, run_fsm))
+					return;
+			case 1:
+				pd_claimed = 2;
+				pi_current->proto->connect(pi_current);
+		}
+
+		switch(res = phase()) {
+			case Ok: case Fail:
+				pi_disconnect(pi_current);
+				pd_claimed = 0;
+				phase = NULL;
+				spin_lock_irqsave(&pd_lock, saved_flags);
+				end_request(pd_req, res);
+				pd_req = elv_next_request(pd_queue);
+				if (!pd_req)
+					stop = 1;
+				spin_unlock_irqrestore(&pd_lock, saved_flags);
+				if (stop)
+					return;
+			case Hold:
+				schedule_fsm();
+				return;
+			case Wait:
+				pi_disconnect(pi_current);
+				pd_claimed = 0;
+		}
+	}
+}
+
+static int pd_retries = 0;	/* i/o error retry count */
+static int pd_block;		/* address of next requested block */
+static int pd_count;		/* number of blocks still to do */
+static int pd_run;		/* sectors in current cluster */
+static int pd_cmd;		/* current command READ/WRITE */
+static char *pd_buf;		/* buffer for request in progress */
+
+static enum action do_pd_io_start(void)
+{
+	if (pd_req->flags & REQ_SPECIAL) {
+		phase = pd_special;
+		return pd_special();
+	}
+
+	pd_cmd = rq_data_dir(pd_req);
+	if (pd_cmd == READ || pd_cmd == WRITE) {
+		pd_block = pd_req->sector;
+		pd_count = pd_req->current_nr_sectors;
+		if (pd_block + pd_count > get_capacity(pd_req->rq_disk))
+			return Fail;
+		pd_run = pd_req->nr_sectors;
+		pd_buf = pd_req->buffer;
+		pd_retries = 0;
+		if (pd_cmd == READ)
+			return do_pd_read_start();
+		else
+			return do_pd_write_start();
+	}
+	return Fail;
+}
+
+static enum action pd_special(void)
+{
+	enum action (*func)(struct pd_unit *) = pd_req->special;
+	return func(pd_current);
+}
+
+static int pd_next_buf(void)
+{
+	unsigned long saved_flags;
+
+	pd_count--;
+	pd_run--;
+	pd_buf += 512;
+	pd_block++;
+	if (!pd_run)
+		return 1;
+	if (pd_count)
+		return 0;
+	spin_lock_irqsave(&pd_lock, saved_flags);
+	end_request(pd_req, 1);
+	pd_count = pd_req->current_nr_sectors;
+	pd_buf = pd_req->buffer;
+	spin_unlock_irqrestore(&pd_lock, saved_flags);
+	return 0;
+}
+
+static unsigned long pd_timeout;
+
+static enum action do_pd_read_start(void)
+{
+	if (pd_wait_for(pd_current, STAT_READY, "do_pd_read") & STAT_ERR) {
+		if (pd_retries < PD_MAX_RETRIES) {
+			pd_retries++;
+			return Wait;
+		}
+		return Fail;
+	}
+	pd_ide_command(pd_current, IDE_READ, pd_block, pd_run);
+	phase = do_pd_read_drq;
+	pd_timeout = jiffies + PD_TMO;
+	return Hold;
+}
+
+static enum action do_pd_write_start(void)
+{
+	if (pd_wait_for(pd_current, STAT_READY, "do_pd_write") & STAT_ERR) {
+		if (pd_retries < PD_MAX_RETRIES) {
+			pd_retries++;
+			return Wait;
+		}
+		return Fail;
+	}
+	pd_ide_command(pd_current, IDE_WRITE, pd_block, pd_run);
+	while (1) {
+		if (pd_wait_for(pd_current, STAT_DRQ, "do_pd_write_drq") & STAT_ERR) {
+			if (pd_retries < PD_MAX_RETRIES) {
+				pd_retries++;
+				return Wait;
+			}
+			return Fail;
+		}
+		pi_write_block(pd_current->pi, pd_buf, 512);
+		if (pd_next_buf())
+			break;
+	}
+	phase = do_pd_write_done;
+	pd_timeout = jiffies + PD_TMO;
+	return Hold;
+}
+
+static inline int pd_ready(void)
+{
+	return !(status_reg(pd_current) & STAT_BUSY);
+}
+
+static enum action do_pd_read_drq(void)
+{
+	if (!pd_ready() && !time_after_eq(jiffies, pd_timeout))
+		return Hold;
+
+	while (1) {
+		if (pd_wait_for(pd_current, STAT_DRQ, "do_pd_read_drq") & STAT_ERR) {
+			if (pd_retries < PD_MAX_RETRIES) {
+				pd_retries++;
+				phase = do_pd_read_start;
+				return Wait;
+			}
+			return Fail;
+		}
+		pi_read_block(pd_current->pi, pd_buf, 512);
+		if (pd_next_buf())
+			break;
+	}
+	return Ok;
+}
+
+static enum action do_pd_write_done(void)
+{
+	if (!pd_ready() && !time_after_eq(jiffies, pd_timeout))
+		return Hold;
+
+	if (pd_wait_for(pd_current, STAT_READY, "do_pd_write_done") & STAT_ERR) {
+		if (pd_retries < PD_MAX_RETRIES) {
+			pd_retries++;
+			phase = do_pd_write_start;
+			return Wait;
+		}
+		return Fail;
+	}
+	return Ok;
+}
+
+/* special io requests */
+
 /* According to the ATA standard, the default CHS geometry should be
    available following a reset.  Some Western Digital drives come up
    in a mode where only LBA addresses are accepted until the device
@@ -522,43 +601,45 @@
 
 static void pd_init_dev_parms(struct pd_unit *disk)
 {
-	pi_connect(disk->pi);
 	pd_wait_for(disk, 0, DBMSG("before init_dev_parms"));
 	pd_send_command(disk, disk->sectors, 0, disk->heads - 1, 0, 0,
 			IDE_INIT_DEV_PARMS);
 	udelay(300);
 	pd_wait_for(disk, 0, "Initialise device parameters");
-	pi_disconnect(disk->pi);
 }
 
-static void pd_doorlock(struct pd_unit *disk, int func)
+static enum action pd_door_lock(struct pd_unit *disk)
+{
+	if (!(pd_wait_for(disk, STAT_READY, "Lock") & STAT_ERR)) {
+		pd_send_command(disk, 1, 0, 0, 0, 0, IDE_DOORLOCK);
+		pd_wait_for(disk, STAT_READY, "Lock done");
+	}
+	return Ok;
+}
+
+static enum action pd_door_unlock(struct pd_unit *disk)
 {
-	pi_connect(disk->pi);
 	if (!(pd_wait_for(disk, STAT_READY, "Lock") & STAT_ERR)) {
-		pd_send_command(disk, 1, 0, 0, 0, 0, func);
+		pd_send_command(disk, 1, 0, 0, 0, 0, IDE_DOORUNLOCK);
 		pd_wait_for(disk, STAT_READY, "Lock done");
 	}
-	pi_disconnect(disk->pi);
+	return Ok;
 }
 
-static void pd_eject(struct pd_unit *disk)
+static enum action pd_eject(struct pd_unit *disk)
 {
-	pi_connect(disk->pi);
 	pd_wait_for(disk, 0, DBMSG("before unlock on eject"));
 	pd_send_command(disk, 1, 0, 0, 0, 0, IDE_DOORUNLOCK);
 	pd_wait_for(disk, 0, DBMSG("after unlock on eject"));
 	pd_wait_for(disk, 0, DBMSG("before eject"));
 	pd_send_command(disk, 0, 0, 0, 0, 0, IDE_EJECT);
 	pd_wait_for(disk, 0, DBMSG("after eject"));
-	pi_disconnect(disk->pi);
+	return Ok;
 }
 
-static void pd_media_check(struct pd_unit *disk)
+static enum action pd_media_check(struct pd_unit *disk)
 {
-	int r;
-
-	pi_connect(disk->pi);
-	r = pd_wait_for(disk, STAT_READY, DBMSG("before media_check"));
+	int r = pd_wait_for(disk, STAT_READY, DBMSG("before media_check"));
 	if (!(r & STAT_ERR)) {
 		pd_send_command(disk, 1, 1, 0, 0, 0, IDE_READ_VRFY);
 		r = pd_wait_for(disk, STAT_READY, DBMSG("RDY after READ_VRFY"));
@@ -571,20 +652,17 @@
 		pd_send_command(disk, 1, 1, 0, 0, 0, IDE_READ_VRFY);
 		r = pd_wait_for(disk, STAT_READY, DBMSG("RDY after VRFY"));
 	}
-	pi_disconnect(disk->pi);
-
+	return Ok;
 }
 
 static void pd_standby_off(struct pd_unit *disk)
 {
-	pi_connect(disk->pi);
 	pd_wait_for(disk, 0, DBMSG("before STANDBY"));
 	pd_send_command(disk, 0, 0, 0, 0, 0, IDE_STANDBY);
 	pd_wait_for(disk, 0, DBMSG("after STANDBY"));
-	pi_disconnect(disk->pi);
 }
 
-static int pd_identify(struct pd_unit *disk)
+static enum action pd_identify(struct pd_unit *disk)
 {
 	int j;
 	char id[PD_ID_LEN + 1];
@@ -598,17 +676,13 @@
 	if (disk->drive == 0)
 		pd_reset(disk);
 
-	pi_connect(disk->pi);
 	write_reg(disk, 6, DRIVE(disk));
 	pd_wait_for(disk, 0, DBMSG("before IDENT"));
 	pd_send_command(disk, 1, 0, 0, 0, 0, IDE_IDENTIFY);
 
-	if (pd_wait_for(disk, STAT_DRQ, DBMSG("IDENT DRQ")) & STAT_ERR) {
-		pi_disconnect(disk->pi);
-		return 0;
-	}
+	if (pd_wait_for(disk, STAT_DRQ, DBMSG("IDENT DRQ")) & STAT_ERR)
+		return Fail;
 	pi_read_block(disk->pi, pd_scratch, 512);
-	pi_disconnect(disk->pi);
 	disk->can_lba = pd_scratch[99] & 2;
 	disk->sectors = le16_to_cpu(*(u16 *) (pd_scratch + 12));
 	disk->heads = le16_to_cpu(*(u16 *) (pd_scratch + 6));
@@ -640,250 +714,209 @@
 	if (!disk->standby)
 		pd_standby_off(disk);
 
-	return 1;
-}
-
-static int pd_probe_drive(struct pd_unit *disk)
-{
-	if (disk->drive == -1) {
-		for (disk->drive = 0; disk->drive <= 1; disk->drive++)
-			if (pd_identify(disk))
-				return 1;
-		return 0;
-	}
-	return pd_identify(disk);
+	return Ok;
 }
 
-static struct request_queue *pd_queue;
+/* end of io request engine */
 
-static int pd_detect(void)
+static void do_pd_request(request_queue_t * q)
 {
-	int k, unit;
-	struct pd_unit *disk;
-
-	k = 0;
-	if (pd_drive_count == 0) { /* nothing spec'd - so autoprobe for 1 */
-		disk = pd;
-		if (pi_init(disk->pi, 1, -1, -1, -1, -1, -1, pd_scratch,
-			    PI_PD, verbose, disk->name)) {
-			if (pd_probe_drive(disk)) {
-				disk->present = 1;
-				k = 1;
-			} else
-				pi_release(disk->pi);
-		}
+	if (pd_req)
+		return;
+	pd_req = elv_next_request(q);
+	if (!pd_req)
+		return;
 
-	} else {
-		for (unit = 0, disk = pd; unit < PD_UNITS; unit++, disk++) {
-			int *parm = *drives[unit];
-			if (!parm[D_PRT])
-				continue;
-			if (pi_init(disk->pi, 0, parm[D_PRT], parm[D_MOD],
-				     parm[D_UNI], parm[D_PRO], parm[D_DLY],
-				     pd_scratch, PI_PD, verbose, disk->name)) {
-				if (pd_probe_drive(disk)) {
-					disk->present = 1;
-					k = unit + 1;
-				} else
-					pi_release(disk->pi);
-			}
-		}
-	}
-	for (unit = 0, disk = pd; unit < PD_UNITS; unit++, disk++) {
-		if (disk->present) {
-			struct gendisk *p = alloc_disk(1 << PD_BITS);
-			if (!p) {
-				disk->present = 0;
-				k--;
-				continue;
-			}
-			strcpy(p->disk_name, disk->name);
-			p->fops = &pd_fops;
-			p->major = major;
-			p->first_minor = unit << PD_BITS;
-			set_capacity(p, disk->capacity);
-			disk->gd = p;
-			p->private_data = disk;
-			p->queue = pd_queue;
-			add_disk(p);
-		}
-	}
-	if (k)
-		return 1;
-	printk("%s: no valid drive found\n", name);
-	return 0;
+	schedule_fsm();
 }
 
-/* The i/o request engine */
-
-static int pd_ready(void)
+static int pd_special_command(struct pd_unit *disk,
+		      enum action (*func)(struct pd_unit *disk))
 {
-	return !(status_reg(pd_current) & STAT_BUSY);
+	DECLARE_COMPLETION(wait);
+	struct request rq;
+	int err = 0;
+
+	memset(&rq, 0, sizeof(rq));
+	rq.errors = 0;
+	rq.rq_status = RQ_ACTIVE;
+	rq.rq_disk = disk->gd;
+	rq.ref_count = 1;
+	rq.waiting = &wait;
+	blk_insert_request(disk->gd->queue, &rq, 0, func, 0);
+	wait_for_completion(&wait);
+	rq.waiting = NULL;
+	if (rq.errors)
+		err = -EIO;
+	blk_put_request(&rq);
+	return err;
 }
 
-static void do_pd_request(request_queue_t * q)
-{
-	if (pd_busy)
-		return;
-repeat:
-	pd_req = elv_next_request(q);
-	if (!pd_req)
-		return;
+/* kernel glue structures */
 
-	pd_block = pd_req->sector;
-	pd_run = pd_req->nr_sectors;
-	pd_count = pd_req->current_nr_sectors;
-	pd_current = pd_req->rq_disk->private_data;
-	if (pd_block + pd_count > get_capacity(pd_req->rq_disk)) {
-		end_request(pd_req, 0);
-		goto repeat;
-	}
+static int pd_open(struct inode *inode, struct file *file)
+{
+	struct pd_unit *disk = inode->i_bdev->bd_disk->private_data;
 
-	pd_cmd = rq_data_dir(pd_req);
-	pd_buf = pd_req->buffer;
-	pd_retries = 0;
+	disk->access++;
 
-	pd_busy = 1;
-	if (pd_cmd == READ)
-		pi_do_claimed(pd_current->pi, do_pd_read);
-	else if (pd_cmd == WRITE)
-		pi_do_claimed(pd_current->pi, do_pd_write);
-	else {
-		pd_busy = 0;
-		end_request(pd_req, 0);
-		goto repeat;
+	if (disk->removable) {
+		pd_special_command(disk, pd_media_check);
+		pd_special_command(disk, pd_door_lock);
 	}
+	return 0;
 }
 
-static int pd_next_buf(void)
+static int pd_ioctl(struct inode *inode, struct file *file,
+	 unsigned int cmd, unsigned long arg)
 {
-	unsigned long saved_flags;
+	struct pd_unit *disk = inode->i_bdev->bd_disk->private_data;
+	struct hd_geometry *geo = (struct hd_geometry *) arg;
+	struct hd_geometry g;
 
-	pd_count--;
-	pd_run--;
-	pd_buf += 512;
-	pd_block++;
-	if (!pd_run)
-		return 1;
-	if (pd_count)
+	switch (cmd) {
+	case CDROMEJECT:
+		if (disk->access == 1)
+			pd_special_command(disk, pd_eject);
 		return 0;
-	spin_lock_irqsave(&pd_lock, saved_flags);
-	end_request(pd_req, 1);
-	pd_count = pd_req->current_nr_sectors;
-	pd_buf = pd_req->buffer;
-	spin_unlock_irqrestore(&pd_lock, saved_flags);
-	return 0;
+	case HDIO_GETGEO:
+		if (disk->alt_geom) {
+			g.heads = PD_LOG_HEADS;
+			g.sectors = PD_LOG_SECTS;
+			g.cylinders = disk->capacity / (g.heads * g.sectors);
+		} else {
+			g.heads = disk->heads;
+			g.sectors = disk->sectors;
+			g.cylinders = disk->cylinders;
+		}
+		g.start = get_start_sect(inode->i_bdev);
+		if (copy_to_user(geo, &g, sizeof(struct hd_geometry)))
+			return -EFAULT;
+		return 0;
+	default:
+		return -EINVAL;
+	}
 }
 
-static inline void next_request(int success)
+static int pd_release(struct inode *inode, struct file *file)
 {
-	unsigned long saved_flags;
+	struct pd_unit *disk = inode->i_bdev->bd_disk->private_data;
 
-	spin_lock_irqsave(&pd_lock, saved_flags);
-	end_request(pd_req, success);
-	pd_busy = 0;
-	do_pd_request(pd_queue);
-	spin_unlock_irqrestore(&pd_lock, saved_flags);
+	if (!--disk->access && disk->removable)
+		pd_special_command(disk, pd_door_unlock);
+
+	return 0;
 }
 
-static void do_pd_read(void)
+static int pd_check_media(struct gendisk *p)
 {
-	ps_set_intr(do_pd_read_start, 0, 0, nice);
+	struct pd_unit *disk = p->private_data;
+	int r;
+	if (!disk->removable)
+		return 0;
+	pd_special_command(disk, pd_media_check);
+	r = disk->changed;
+	disk->changed = 0;
+	return r;
 }
 
-static void do_pd_read_start(void)
+static int pd_revalidate(struct gendisk *p)
 {
-	pd_busy = 1;
-
-	pi_connect(pd_current->pi);
-	if (pd_wait_for(pd_current, STAT_READY, "do_pd_read") & STAT_ERR) {
-		pi_disconnect(pd_current->pi);
-		if (pd_retries < PD_MAX_RETRIES) {
-			pd_retries++;
-			pi_do_claimed(pd_current->pi, do_pd_read_start);
-			return;
-		}
-		next_request(0);
-		return;
-	}
-	pd_ide_command(pd_current, IDE_READ, pd_block, pd_run);
-	ps_set_intr(do_pd_read_drq, pd_ready, PD_TMO, nice);
+	struct pd_unit *disk = p->private_data;
+	if (pd_special_command(disk, pd_identify) == 0)
+		set_capacity(p, disk->capacity);
+	else
+		set_capacity(p, 0);
+	return 0;
 }
 
-static void do_pd_read_drq(void)
+static struct block_device_operations pd_fops = {
+	.owner		= THIS_MODULE,
+	.open		= pd_open,
+	.release	= pd_release,
+	.ioctl		= pd_ioctl,
+	.media_changed	= pd_check_media,
+	.revalidate_disk= pd_revalidate
+};
+
+/* probing */
+
+static void pd_probe_drive(struct pd_unit *disk)
 {
-	while (1) {
-		if (pd_wait_for(pd_current, STAT_DRQ, "do_pd_read_drq") & STAT_ERR) {
-			pi_disconnect(pd_current->pi);
-			if (pd_retries < PD_MAX_RETRIES) {
-				pd_retries++;
-				pi_do_claimed(pd_current->pi, do_pd_read_start);
+	struct gendisk *p = alloc_disk(1 << PD_BITS);
+	if (!p)
+		return;
+	strcpy(p->disk_name, disk->name);
+	p->fops = &pd_fops;
+	p->major = major;
+	p->first_minor = (disk - pd) << PD_BITS;
+	disk->gd = p;
+	p->private_data = disk;
+	p->queue = pd_queue;
+
+	if (disk->drive == -1) {
+		for (disk->drive = 0; disk->drive <= 1; disk->drive++)
+			if (pd_special_command(disk, pd_identify) == 0)
 				return;
-			}
-			next_request(0);
-			return;
-		}
-		pi_read_block(pd_current->pi, pd_buf, 512);
-		if (pd_next_buf())
-			break;
-	}
-	pi_disconnect(pd_current->pi);
-	next_request(1);
+	} else if (pd_special_command(disk, pd_identify) == 0)
+		return;
+	disk->gd = NULL;
+	put_disk(p);
 }
 
-static void do_pd_write(void)
+static int pd_detect(void)
 {
-	ps_set_intr(do_pd_write_start, 0, 0, nice);
-}
+	int found = 0, unit, pd_drive_count = 0;
+	struct pd_unit *disk;
 
-static void do_pd_write_start(void)
-{
-	pd_busy = 1;
+	for (unit = 0; unit < PD_UNITS; unit++) {
+		int *parm = *drives[unit];
+		struct pd_unit *disk = pd + unit;
+		disk->pi = &disk->pia;
+		disk->access = 0;
+		disk->changed = 1;
+		disk->capacity = 0;
+		disk->drive = parm[D_SLV];
+		snprintf(disk->name, PD_NAMELEN, "%s%c", name, 'a'+unit);
+		disk->alt_geom = parm[D_GEO];
+		disk->standby = parm[D_SBY];
+		if (parm[D_PRT])
+			pd_drive_count++;
+	}
 
-	pi_connect(pd_current->pi);
-	if (pd_wait_for(pd_current, STAT_READY, "do_pd_write") & STAT_ERR) {
-		pi_disconnect(pd_current->pi);
-		if (pd_retries < PD_MAX_RETRIES) {
-			pd_retries++;
-			pi_do_claimed(pd_current->pi, do_pd_write_start);
-			return;
+	if (pd_drive_count == 0) { /* nothing spec'd - so autoprobe for 1 */
+		disk = pd;
+		if (pi_init(disk->pi, 1, -1, -1, -1, -1, -1, pd_scratch,
+			    PI_PD, verbose, disk->name)) {
+			pd_probe_drive(disk);
+			if (!disk->gd)
+				pi_release(disk->pi);
 		}
-		next_request(0);
-		return;
-	}
-	pd_ide_command(pd_current, IDE_WRITE, pd_block, pd_run);
-	while (1) {
-		if (pd_wait_for(pd_current, STAT_DRQ, "do_pd_write_drq") & STAT_ERR) {
-			pi_disconnect(pd_current->pi);
-			if (pd_retries < PD_MAX_RETRIES) {
-				pd_retries++;
-				pi_do_claimed(pd_current->pi, do_pd_write_start);
-				return;
+
+	} else {
+		for (unit = 0, disk = pd; unit < PD_UNITS; unit++, disk++) {
+			int *parm = *drives[unit];
+			if (!parm[D_PRT])
+				continue;
+			if (pi_init(disk->pi, 0, parm[D_PRT], parm[D_MOD],
+				     parm[D_UNI], parm[D_PRO], parm[D_DLY],
+				     pd_scratch, PI_PD, verbose, disk->name)) {
+				pd_probe_drive(disk);
+				if (!disk->gd)
+					pi_release(disk->pi);
 			}
-			next_request(0);
-			return;
 		}
-		pi_write_block(pd_current->pi, pd_buf, 512);
-		if (pd_next_buf())
-			break;
 	}
-	ps_set_intr(do_pd_write_done, pd_ready, PD_TMO, nice);
-}
-
-static void do_pd_write_done(void)
-{
-	if (pd_wait_for(pd_current, STAT_READY, "do_pd_write_done") & STAT_ERR) {
-		pi_disconnect(pd_current->pi);
-		if (pd_retries < PD_MAX_RETRIES) {
-			pd_retries++;
-			pi_do_claimed(pd_current->pi, do_pd_write_start);
-			return;
+	for (unit = 0, disk = pd; unit < PD_UNITS; unit++, disk++) {
+		if (disk->gd) {
+			set_capacity(disk->gd, disk->capacity);
+			add_disk(disk->gd);
+			found = 1;
 		}
-		next_request(0);
-		return;
 	}
-	pi_disconnect(pd_current->pi);
-	next_request(1);
+	if (!found)
+		printk("%s: no valid drive found\n", name);
+	return found;
 }
 
 static int __init pd_init(void)
@@ -902,7 +935,6 @@
 
 	printk("%s: %s version %s, major %d, cluster %d, nice %d\n",
 	       name, name, PD_VERSION, major, cluster, nice);
-	pd_init_units();
 	if (!pd_detect())
 		goto out3;
 
@@ -922,8 +954,8 @@
 	int unit;
 	unregister_blkdev(major, name);
 	for (unit = 0, disk = pd; unit < PD_UNITS; unit++, disk++) {
-		if (disk->present) {
-			struct gendisk *p = disk->gd;
+		struct gendisk *p = disk->gd;
+		if (p) {
 			disk->gd = NULL;
 			del_gendisk(p);
 			put_disk(p);
--- diff/drivers/block/ps2esdi.c	2003-10-09 09:47:33.000000000 +0100
+++ source/drivers/block/ps2esdi.c	2004-02-09 10:39:52.000000000 +0000
@@ -743,7 +743,7 @@
 	drive_num = int_ret_code >> 5;
 	switch (int_ret_code & 0xf) {
 	case INT_CMD_COMPLETE:
-		for (i = ESDI_TIMEOUT; i & !(inb(ESDI_STATUS) & STATUS_STAT_AVAIL); i--);
+		for (i = ESDI_TIMEOUT; i && !(inb(ESDI_STATUS) & STATUS_STAT_AVAIL); i--);
 		if (!(inb(ESDI_STATUS) & STATUS_STAT_AVAIL)) {
 			printk("%s: timeout reading status word\n", DEVICE_NAME);
 			outb((int_ret_code & 0xe0) | ATT_EOI, ESDI_ATTN);
@@ -879,7 +879,7 @@
 		break;
 
 	case INT_CMD_COMPLETE:
-		for (i = ESDI_TIMEOUT; i & !(inb(ESDI_STATUS) & STATUS_STAT_AVAIL); i--);
+		for (i = ESDI_TIMEOUT; i && !(inb(ESDI_STATUS) & STATUS_STAT_AVAIL); i--);
 		if (!(inb(ESDI_STATUS) & STATUS_STAT_AVAIL)) {
 			printk("%s: timeout reading status word\n", DEVICE_NAME);
 			outb((int_ret_code & 0xe0) | ATT_EOI, ESDI_ATTN);
--- diff/drivers/block/rd.c	2003-10-09 09:47:16.000000000 +0100
+++ source/drivers/block/rd.c	2004-02-09 10:39:52.000000000 +0000
@@ -1,15 +1,15 @@
 /*
  * ramdisk.c - Multiple RAM disk driver - gzip-loading version - v. 0.8 beta.
- * 
- * (C) Chad Page, Theodore Ts'o, et. al, 1995. 
+ *
+ * (C) Chad Page, Theodore Ts'o, et. al, 1995.
  *
  * This RAM disk is designed to have filesystems created on it and mounted
- * just like a regular floppy disk.  
- *  
+ * just like a regular floppy disk.
+ *
  * It also does something suggested by Linus: use the buffer cache as the
  * RAM disk data.  This makes it possible to dynamically allocate the RAM disk
- * buffer - with some consequences I have to deal with as I write this. 
- * 
+ * buffer - with some consequences I have to deal with as I write this.
+ *
  * This code is based on the original ramdisk.c, written mostly by
  * Theodore Ts'o (TYT) in 1991.  The code was largely rewritten by
  * Chad Page to use the buffer cache to store the RAM disk data in
@@ -33,7 +33,7 @@
  *
  *  Added initrd: Werner Almesberger & Hans Lermen, Feb '96
  *
- * 4/25/96 : Made RAM disk size a parameter (default is now 4 MB) 
+ * 4/25/96 : Made RAM disk size a parameter (default is now 4 MB)
  *		- Chad Page
  *
  * Add support for fs images split across >1 disk, Paul Gortmaker, Mar '98
@@ -60,7 +60,7 @@
 #include <asm/uaccess.h>
 
 /* The RAM disk size is now a parameter */
-#define NUM_RAMDISKS 16		/* This cannot be overridden (yet) */ 
+#define NUM_RAMDISKS 16		/* This cannot be overridden (yet) */
 
 /* Various static variables go here.  Most are used only in the RAM disk code.
  */
@@ -73,7 +73,7 @@
  * Parameters for the boot-loading of the RAM disk.  These are set by
  * init/main.c (from arguments to the kernel command line) or from the
  * architecture-specific setup routine (from the stored boot sector
- * information). 
+ * information).
  */
 int rd_size = CONFIG_BLK_DEV_RAM_SIZE;		/* Size of the RAM disks */
 /*
@@ -94,7 +94,7 @@
  *               2000 Transmeta Corp.
  * aops copied from ramfs.
  */
-static int ramdisk_readpage(struct file *file, struct page * page)
+static int ramdisk_readpage(struct file *file, struct page *page)
 {
 	if (!PageUptodate(page)) {
 		void *kaddr = kmap_atomic(page, KM_USER0);
@@ -108,7 +108,8 @@
 	return 0;
 }
 
-static int ramdisk_prepare_write(struct file *file, struct page *page, unsigned offset, unsigned to)
+static int ramdisk_prepare_write(struct file *file, struct page *page,
+				unsigned offset, unsigned to)
 {
 	if (!PageUptodate(page)) {
 		void *kaddr = kmap_atomic(page, KM_USER0);
@@ -122,7 +123,8 @@
 	return 0;
 }
 
-static int ramdisk_commit_write(struct file *file, struct page *page, unsigned offset, unsigned to)
+static int ramdisk_commit_write(struct file *file, struct page *page,
+				unsigned offset, unsigned to)
 {
 	return 0;
 }
@@ -212,7 +214,7 @@
  * 19-JAN-1998  Richard Gooch <rgooch@atnf.csiro.au>  Added devfs support
  *
  */
-static int rd_make_request(request_queue_t * q, struct bio *bio)
+static int rd_make_request(request_queue_t *q, struct bio *bio)
 {
 	struct block_device *bdev = bio->bi_bdev;
 	struct address_space * mapping = bdev->bd_inode->i_mapping;
@@ -242,7 +244,8 @@
 	return 0;
 } 
 
-static int rd_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
+static int rd_ioctl(struct inode *inode, struct file *file,
+			unsigned int cmd, unsigned long arg)
 {
 	int error;
 	struct block_device *bdev = inode->i_bdev;
@@ -250,9 +253,11 @@
 	if (cmd != BLKFLSBUF)
 		return -EINVAL;
 
-	/* special: we want to release the ramdisk memory,
-	   it's not like with the other blockdevices where
-	   this ioctl only flushes away the buffer cache. */
+	/*
+	 * special: we want to release the ramdisk memory, it's not like with
+	 * the other blockdevices where this ioctl only flushes away the buffer
+	 * cache
+	 */
 	error = -EBUSY;
 	down(&bdev->bd_sem);
 	if (bdev->bd_openers <= 2) {
@@ -268,7 +273,7 @@
 	.memory_backed	= 1,	/* Does not contribute to dirty memory */
 };
 
-static int rd_open(struct inode * inode, struct file * filp)
+static int rd_open(struct inode *inode, struct file *filp)
 {
 	unsigned unit = iminor(inode);
 
@@ -295,12 +300,14 @@
 	.ioctl =	rd_ioctl,
 };
 
-/* Before freeing the module, invalidate all of the protected buffers! */
-static void __exit rd_cleanup (void)
+/*
+ * Before freeing the module, invalidate all of the protected buffers!
+ */
+static void __exit rd_cleanup(void)
 {
 	int i;
 
-	for (i = 0 ; i < NUM_RAMDISKS; i++) {
+	for (i = 0; i < NUM_RAMDISKS; i++) {
 		struct block_device *bdev = rd_bdev[i];
 		rd_bdev[i] = NULL;
 		if (bdev) {
@@ -311,17 +318,19 @@
 		put_disk(rd_disks[i]);
 	}
 	devfs_remove("rd");
-	unregister_blkdev(RAMDISK_MAJOR, "ramdisk" );
+	unregister_blkdev(RAMDISK_MAJOR, "ramdisk");
 }
 
-/* This is the registration and initialization section of the RAM disk driver */
-static int __init rd_init (void)
+/*
+ * This is the registration and initialization section of the RAM disk driver
+ */
+static int __init rd_init(void)
 {
 	int i;
 	int err = -ENOMEM;
 
 	if (rd_blocksize > PAGE_SIZE || rd_blocksize < 512 ||
-	    (rd_blocksize & (rd_blocksize-1))) {
+			(rd_blocksize & (rd_blocksize-1))) {
 		printk("RAMDISK: wrong blocksize %d, reverting to defaults\n",
 		       rd_blocksize);
 		rd_blocksize = BLOCK_SIZE;
@@ -362,8 +371,8 @@
 
 	/* rd_size is given in kB */
 	printk("RAMDISK driver initialized: "
-	       "%d RAM disks of %dK size %d blocksize\n",
-	       NUM_RAMDISKS, rd_size, rd_blocksize);
+		"%d RAM disks of %dK size %d blocksize\n",
+		NUM_RAMDISKS, rd_size, rd_blocksize);
 
 	return 0;
 out_queue:
--- diff/drivers/block/scsi_ioctl.c	2003-12-19 09:51:11.000000000 +0000
+++ source/drivers/block/scsi_ioctl.c	2004-02-09 10:39:52.000000000 +0000
@@ -46,14 +46,14 @@
 #define SCSI_SENSE_BUFFERSIZE 64
 #endif
 
-static int blk_do_rq(request_queue_t *q, struct block_device *bdev, 
+static int blk_do_rq(request_queue_t *q, struct gendisk *bd_disk,
 		     struct request *rq)
 {
 	char sense[SCSI_SENSE_BUFFERSIZE];
 	DECLARE_COMPLETION(wait);
 	int err = 0;
 
-	rq->rq_disk = bdev->bd_disk;
+	rq->rq_disk = bd_disk;
 
 	/*
 	 * we need an extra reference to the request, so we can look at
@@ -142,7 +142,7 @@
 	return put_user(1, p);
 }
 
-static int sg_io(request_queue_t *q, struct block_device *bdev,
+static int sg_io(request_queue_t *q, struct gendisk *bd_disk,
 		 struct sg_io_hdr *hdr)
 {
 	unsigned long start_time;
@@ -190,7 +190,7 @@
 		 * first try to map it into a bio. reading from device will
 		 * be a write to vm.
 		 */
-		bio = bio_map_user(bdev, (unsigned long) hdr->dxferp,
+		bio = bio_map_user(q, NULL, (unsigned long) hdr->dxferp,
 				   hdr->dxfer_len, reading);
 
 		/*
@@ -246,7 +246,7 @@
 	 * (if he doesn't check that is his problem).
 	 * N.B. a non-zero SCSI status is _not_ necessarily an error.
 	 */
-	blk_do_rq(q, bdev, rq);
+	blk_do_rq(q, bd_disk, rq);
 
 	if (bio)
 		bio_unmap_user(bio, reading);
@@ -296,7 +296,7 @@
 #define READ_DEFECT_DATA_TIMEOUT	(60 * HZ )
 #define OMAX_SB_LEN 16          /* For backward compatibility */
 
-static int sg_scsi_ioctl(request_queue_t *q, struct block_device *bdev,
+static int sg_scsi_ioctl(request_queue_t *q, struct gendisk *bd_disk,
 			 Scsi_Ioctl_Command *sic)
 {
 	struct request *rq;
@@ -312,7 +312,7 @@
 		return -EFAULT;
 	if (in_len > PAGE_SIZE || out_len > PAGE_SIZE)
 		return -EINVAL;
-	if (get_user(opcode, sic->data))
+	if (get_user(opcode, (int *)sic->data))
 		return -EFAULT;
 
 	bytes = max(in_len, out_len);
@@ -369,7 +369,7 @@
 	rq->data_len = bytes;
 	rq->flags |= REQ_BLOCK_PC;
 
-	blk_do_rq(q, bdev, rq);
+	blk_do_rq(q, bd_disk, rq);
 	err = rq->errors & 0xff;	/* only 8 bit SCSI status */
 	if (err) {
 		if (rq->sense_len && rq->sense) {
@@ -389,13 +389,13 @@
 	return err;
 }
 
-int scsi_cmd_ioctl(struct block_device *bdev, unsigned int cmd, unsigned long arg)
+int scsi_cmd_ioctl(struct gendisk *bd_disk, unsigned int cmd, unsigned long arg)
 {
 	request_queue_t *q;
 	struct request *rq;
 	int close = 0, err;
 
-	q = bdev_get_queue(bdev);
+	q = bd_disk->queue;
 	if (!q)
 		return -ENXIO;
 
@@ -446,7 +446,7 @@
 
 			old_cdb = hdr.cmdp;
 			hdr.cmdp = cdb;
-			err = sg_io(q, bdev, &hdr);
+			err = sg_io(q, bd_disk, &hdr);
 
 			hdr.cmdp = old_cdb;
 			if (copy_to_user((struct sg_io_hdr *) arg, &hdr, sizeof(hdr)))
@@ -493,7 +493,7 @@
 			hdr.timeout = cgc.timeout;
 			hdr.cmdp = cgc.cmd;
 			hdr.cmd_len = sizeof(cgc.cmd);
-			err = sg_io(q, bdev, &hdr);
+			err = sg_io(q, bd_disk, &hdr);
 
 			if (hdr.status)
 				err = -EIO;
@@ -514,7 +514,8 @@
 			if (!arg)
 				break;
 
-			err = sg_scsi_ioctl(q, bdev, (Scsi_Ioctl_Command *)arg);
+			err = sg_scsi_ioctl(q, bd_disk,
+					    (Scsi_Ioctl_Command *)arg);
 			break;
 		case CDROMCLOSETRAY:
 			close = 1;
@@ -528,7 +529,7 @@
 			rq->cmd[0] = GPCMD_START_STOP_UNIT;
 			rq->cmd[4] = 0x02 + (close != 0);
 			rq->cmd_len = 6;
-			err = blk_do_rq(q, bdev, rq);
+			err = blk_do_rq(q, bd_disk, rq);
 			blk_put_request(rq);
 			break;
 		default:
--- diff/drivers/block/swim3.c	2003-08-20 14:16:27.000000000 +0100
+++ source/drivers/block/swim3.c	2004-02-09 10:39:52.000000000 +0000
@@ -24,7 +24,10 @@
 #include <linux/delay.h>
 #include <linux/fd.h>
 #include <linux/ioctl.h>
+#include <linux/blkdev.h>
 #include <linux/devfs_fs_kernel.h>
+#include <linux/interrupt.h>
+#include <linux/module.h>
 #include <asm/io.h>
 #include <asm/dbdma.h>
 #include <asm/prom.h>
@@ -144,7 +147,7 @@
 #define RELAX		3	/* also eject in progress */
 #define READ_DATA_0	4
 #define TWOMEG_DRIVE	5
-#define SINGLE_SIDED	6
+#define SINGLE_SIDED	6	/* drive or diskette is 4MB type? */
 #define DRIVE_PRESENT	7
 #define DISK_IN		8
 #define WRITE_PROT	9
@@ -184,6 +187,7 @@
 	int	req_sector;	/* sector number ditto */
 	int	scount;		/* # sectors we're transferring at present */
 	int	retries;
+	int	settle_time;
 	int	secpercyl;	/* disk geometry information */
 	int	secpertrack;
 	int	total_secs;
@@ -232,8 +236,9 @@
 static void act(struct floppy_state *fs);
 static void scan_timeout(unsigned long data);
 static void seek_timeout(unsigned long data);
+static void settle_timeout(unsigned long data);
 static void xfer_timeout(unsigned long data);
-static void swim3_interrupt(int irq, void *dev_id, struct pt_regs *regs);
+static irqreturn_t swim3_interrupt(int irq, void *dev_id, struct pt_regs *regs);
 /*static void fd_dma_interrupt(int irq, void *dev_id, struct pt_regs *regs);*/
 static int grab_drive(struct floppy_state *fs, enum swim_state state,
 		      int interruptible);
@@ -274,7 +279,6 @@
 	udelay(2);
 	out_8(&sw->select, sw->select & ~LSTRB);
 	udelay(1);
-	out_8(&sw->select, RELAX);
 }
 
 static int swim3_readbit(struct floppy_state *fs, int bit)
@@ -283,9 +287,8 @@
 	int stat;
 
 	swim3_select(fs, bit);
-	udelay(10);
+	udelay(1);
 	stat = in_8(&sw->status);
-	out_8(&sw->select, RELAX);
 	return (stat & DATA) == 0;
 }
 
@@ -374,13 +377,13 @@
 static inline void scan_track(struct floppy_state *fs)
 {
 	volatile struct swim3 *sw = fs->swim3;
-	int xx;
 
 	swim3_select(fs, READ_DATA_0);
-	xx = sw->intr;		/* clear SEEN_SECTOR bit */
+	in_8(&sw->intr);		/* clear SEEN_SECTOR bit */
+	in_8(&sw->error);
+	out_8(&sw->intr_enable, SEEN_SECTOR);
 	out_8(&sw->control_bis, DO_ACTION);
 	/* enable intr when track found */
-	out_8(&sw->intr_enable, ERROR_INTR | SEEN_SECTOR);
 	set_timeout(fs, HZ, scan_timeout);	/* enable timeout */
 }
 
@@ -395,12 +398,14 @@
 		swim3_action(fs, SEEK_NEGATIVE);
 		sw->nseek = -n;
 	}
-	fs->expect_cyl = (fs->cur_cyl > 0)? fs->cur_cyl + n: -1;
+	fs->expect_cyl = (fs->cur_cyl >= 0)? fs->cur_cyl + n: -1;
 	swim3_select(fs, STEP);
-	out_8(&sw->control_bis, DO_SEEK);
+	in_8(&sw->error);
 	/* enable intr when seek finished */
-	out_8(&sw->intr_enable, ERROR_INTR | SEEK_DONE);
-	set_timeout(fs, HZ/2, seek_timeout);	/* enable timeout */
+	out_8(&sw->intr_enable, SEEK_DONE);
+	out_8(&sw->control_bis, DO_SEEK);
+	set_timeout(fs, 3*HZ, seek_timeout);	/* enable timeout */
+	fs->settle_time = 0;
 }
 
 static inline void init_dma(struct dbdma_cmd *cp, int cmd,
@@ -448,18 +453,21 @@
 	}
 	++cp;
 	out_le16(&cp->command, DBDMA_STOP);
+	out_8(&sw->control_bic, DO_ACTION | WRITE_SECTORS);
+	in_8(&sw->error);
+	out_8(&sw->control_bic, DO_ACTION | WRITE_SECTORS);
+	if (rq_data_dir(fd_req) == WRITE)
+		out_8(&sw->control_bis, WRITE_SECTORS);
+	in_8(&sw->intr);
 	out_le32(&dr->control, (RUN << 16) | RUN);
-	out_8(&sw->control_bis,
-	      (rq_data_dir(fd_req) == WRITE? WRITE_SECTORS: 0) | DO_ACTION);
 	/* enable intr when transfer complete */
-	out_8(&sw->intr_enable, ERROR_INTR | TRANSFER_DONE);
+	out_8(&sw->intr_enable, TRANSFER_DONE);
+	out_8(&sw->control_bis, DO_ACTION);
 	set_timeout(fs, 2*HZ, xfer_timeout);	/* enable timeout */
 }
 
 static void act(struct floppy_state *fs)
 {
-	volatile struct swim3 *sw = fs->swim3;
-
 	for (;;) {
 		switch (fs->state) {
 		case idle:
@@ -492,20 +500,10 @@
 			return;
 
 		case settling:
-			/* wait for SEEK_COMPLETE to become true */
-			swim3_select(fs, SEEK_COMPLETE);
-			udelay(10);
-			out_8(&sw->intr_enable, ERROR_INTR | DATA_CHANGED);
-			in_8(&sw->intr);	/* clear DATA_CHANGED */
-			if (in_8(&sw->status) & DATA) {
-				/* seek_complete is not yet true */
-				set_timeout(fs, HZ/2, seek_timeout);
-				return;
-			}
-			out_8(&sw->intr_enable, 0);
-			in_8(&sw->intr);
-			fs->state = locating;
-			break;
+			/* check for SEEK_COMPLETE after 30ms */
+			fs->settle_time = (HZ + 32) / 33;
+			set_timeout(fs, fs->settle_time, settle_timeout);
+			return;
 
 		case do_transfer:
 			if (fs->cur_cyl != fs->req_cyl) {
@@ -537,7 +535,7 @@
 	volatile struct swim3 *sw = fs->swim3;
 
 	fs->timeout_pending = 0;
-	out_8(&sw->control_bic, DO_ACTION);
+	out_8(&sw->control_bic, DO_ACTION | WRITE_SECTORS);
 	out_8(&sw->select, RELAX);
 	out_8(&sw->intr_enable, 0);
 	fs->cur_cyl = -1;
@@ -557,20 +555,34 @@
 	volatile struct swim3 *sw = fs->swim3;
 
 	fs->timeout_pending = 0;
-	if (fs->state == settling) {
-		printk(KERN_ERR "swim3: MSI sel=%x ctrl=%x stat=%x intr=%x ie=%x\n",
-		       sw->select, sw->control, sw->status, sw->intr, sw->intr_enable);
-	}
 	out_8(&sw->control_bic, DO_SEEK);
 	out_8(&sw->select, RELAX);
 	out_8(&sw->intr_enable, 0);
-	if (fs->state == settling && swim3_readbit(fs, SEEK_COMPLETE)) {
-		/* printk(KERN_DEBUG "swim3: missed settling interrupt\n"); */
+	printk(KERN_ERR "swim3: seek timeout\n");
+	end_request(fd_req, 0);
+	fs->state = idle;
+	start_request(fs);
+}
+
+static void settle_timeout(unsigned long data)
+{
+	struct floppy_state *fs = (struct floppy_state *) data;
+	volatile struct swim3 *sw = fs->swim3;
+
+	fs->timeout_pending = 0;
+	if (swim3_readbit(fs, SEEK_COMPLETE)) {
+		out_8(&sw->select, RELAX);
 		fs->state = locating;
 		act(fs);
 		return;
 	}
-	printk(KERN_ERR "swim3: seek timeout\n");
+	out_8(&sw->select, RELAX);
+	if (fs->settle_time < 2*HZ) {
+		++fs->settle_time;
+		set_timeout(fs, 1, settle_timeout);
+		return;
+	}
+	printk(KERN_ERR "swim3: seek settle timeout\n");
 	end_request(fd_req, 0);
 	fs->state = idle;
 	start_request(fs);
@@ -583,9 +595,13 @@
 	struct dbdma_regs *dr = fs->dma;
 	struct dbdma_cmd *cp = fs->dma_cmd;
 	unsigned long s;
+	int n;
 
 	fs->timeout_pending = 0;
 	st_le32(&dr->control, RUN << 16);
+	/* We must wait a bit for dbdma to stop */
+	for (n = 0; (in_le32(&dr->status) & ACTIVE) && n < 1000; n++)
+		udelay(1);
 	out_8(&sw->intr_enable, 0);
 	out_8(&sw->control_bic, WRITE_SECTORS | DO_ACTION);
 	out_8(&sw->select, RELAX);
@@ -604,7 +620,7 @@
 	start_request(fs);
 }
 
-static void swim3_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t swim3_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct floppy_state *fs = (struct floppy_state *) dev_id;
 	volatile struct swim3 *sw = fs->swim3;
@@ -613,18 +629,15 @@
 	struct dbdma_regs *dr;
 	struct dbdma_cmd *cp;
 
-	err = in_8(&sw->error);
 	intr = in_8(&sw->intr);
-#if 0
-	printk("swim3 intr state=%d intr=%x err=%x\n", fs->state, intr, err);
-#endif
+	err = (intr & ERROR_INTR)? in_8(&sw->error): 0;
 	if ((intr & ERROR_INTR) && fs->state != do_transfer)
 		printk(KERN_ERR "swim3_interrupt, state=%d, dir=%lx, intr=%x, err=%x\n",
 		       fs->state, rq_data_dir(fd_req), intr, err);
 	switch (fs->state) {
 	case locating:
 		if (intr & SEEN_SECTOR) {
-			out_8(&sw->control_bic, DO_ACTION);
+			out_8(&sw->control_bic, DO_ACTION | WRITE_SECTORS);
 			out_8(&sw->select, RELAX);
 			out_8(&sw->intr_enable, 0);
 			del_timer(&fs->timeout);
@@ -674,19 +687,33 @@
 	case do_transfer:
 		if ((intr & (ERROR_INTR | TRANSFER_DONE)) == 0)
 			break;
-		dr = fs->dma;
-		cp = fs->dma_cmd;
-		/* We must wait a bit for dbdma to complete */
-		for (n=0; (in_le32(&dr->status) & ACTIVE) && n < 1000; n++)
-			udelay(10);
-		DBDMA_DO_STOP(dr);
 		out_8(&sw->intr_enable, 0);
 		out_8(&sw->control_bic, WRITE_SECTORS | DO_ACTION);
 		out_8(&sw->select, RELAX);
 		del_timer(&fs->timeout);
 		fs->timeout_pending = 0;
+		dr = fs->dma;
+		cp = fs->dma_cmd;
 		if (rq_data_dir(fd_req) == WRITE)
 			++cp;
+		/*
+		 * Check that the main data transfer has finished.
+		 * On writing, the swim3 sometimes doesn't use
+		 * up all the bytes of the postamble, so we can still
+		 * see DMA active here.  That doesn't matter as long
+		 * as all the sector data has been transferred.
+		 */
+		if ((intr & ERROR_INTR) == 0 && cp->xfer_status == 0) {
+			/* wait a little while for DMA to complete */
+			for (n = 0; n < 100; ++n) {
+				if (cp->xfer_status != 0)
+					break;
+				udelay(1);
+				barrier();
+			}
+		}
+		/* turn off DMA */
+		out_le32(&dr->control, (RUN | PAUSE) << 16);
 		stat = ld_le16(&cp->xfer_status);
 		resid = ld_le16(&cp->res_count);
 		if (intr & ERROR_INTR) {
@@ -742,6 +769,7 @@
 	default:
 		printk(KERN_ERR "swim3: don't know what to do in state %d\n", fs->state);
 	}
+	return IRQ_HANDLED;
 }
 
 /*
@@ -793,16 +821,19 @@
 	if (err)
 		return err;
 	swim3_action(fs, EJECT);
-	for (n = 2*HZ; n > 0; --n) {
-		if (swim3_readbit(fs, RELAX))
-			break;
+	for (n = 20; n > 0; --n) {
 		if (signal_pending(current)) {
 			err = -EINTR;
 			break;
 		}
+		swim3_select(fs, RELAX);
 		current->state = TASK_INTERRUPTIBLE;
 		schedule_timeout(1);
+		if (swim3_readbit(fs, DISK_IN) == 0)
+			break;
 	}
+	swim3_select(fs, RELAX);
+	udelay(150);
 	fs->ejected = 1;
 	release_drive(fs);
 	return err;
@@ -847,29 +878,31 @@
 	if (fs->ref_count == 0) {
 		if (fs->media_bay && check_media_bay(fs->media_bay, MB_FD))
 			return -ENXIO;
-		out_8(&sw->mode, 0x95);
-		out_8(&sw->control_bic, 0xff);
 		out_8(&sw->setup, S_IBM_DRIVE | S_FCLK_DIV2);
+		out_8(&sw->control_bic, 0xff);
+		out_8(&sw->mode, 0x95);
 		udelay(10);
 		out_8(&sw->intr_enable, 0);
 		out_8(&sw->control_bis, DRIVE_ENABLE | INTR_ENABLE);
 		swim3_action(fs, MOTOR_ON);
 		fs->write_prot = -1;
 		fs->cur_cyl = -1;
-		for (n = HZ; n > 0; --n) {
-			if (swim3_readbit(fs, SEEK_COMPLETE))
+		for (n = 0; n < 2 * HZ; ++n) {
+			if (n >= HZ/30 && swim3_readbit(fs, SEEK_COMPLETE))
 				break;
 			if (signal_pending(current)) {
 				err = -EINTR;
 				break;
 			}
+			swim3_select(fs, RELAX);
 			current->state = TASK_INTERRUPTIBLE;
 			schedule_timeout(1);
 		}
 		if (err == 0 && (swim3_readbit(fs, SEEK_COMPLETE) == 0
 				 || swim3_readbit(fs, DISK_IN) == 0))
 			err = -ENXIO;
-		swim3_action(fs, 9);
+		swim3_action(fs, SETMFM);
+		swim3_select(fs, RELAX);
 
 	} else if (fs->ref_count == -1 || filp->f_flags & O_EXCL)
 		return -EBUSY;
@@ -892,6 +925,7 @@
 		if (fs->ref_count == 0) {
 			swim3_action(fs, MOTOR_OFF);
 			out_8(&sw->control_bic, DRIVE_ENABLE | INTR_ENABLE);
+			swim3_select(fs, RELAX);
 		}
 		return err;
 	}
@@ -911,6 +945,7 @@
 	if (fs->ref_count > 0 && --fs->ref_count == 0) {
 		swim3_action(fs, MOTOR_OFF);
 		out_8(&sw->control_bic, 0xff);
+		swim3_select(fs, RELAX);
 	}
 	return 0;
 }
@@ -933,15 +968,17 @@
 	sw = fs->swim3;
 	grab_drive(fs, revalidating, 0);
 	out_8(&sw->intr_enable, 0);
-	out_8(&sw->control_bis, DRIVE_ENABLE | INTR_ENABLE);
-	swim3_action(fs, MOTOR_ON);
+	out_8(&sw->control_bis, DRIVE_ENABLE);
+	swim3_action(fs, MOTOR_ON);	/* necessary? */
 	fs->write_prot = -1;
 	fs->cur_cyl = -1;
+	mdelay(1);
 	for (n = HZ; n > 0; --n) {
 		if (swim3_readbit(fs, SEEK_COMPLETE))
 			break;
 		if (signal_pending(current))
 			break;
+		swim3_select(fs, RELAX);
 		current->state = TASK_INTERRUPTIBLE;
 		schedule_timeout(1);
 	}
@@ -951,17 +988,14 @@
 		swim3_action(fs, MOTOR_OFF);
 	else {
 		fs->ejected = 0;
-		swim3_action(fs, 9);
+		swim3_action(fs, SETMFM);
 	}
+	swim3_select(fs, RELAX);
 
 	release_drive(fs);
 	return ret;
 }
 
-static void floppy_off(unsigned int nr)
-{
-}
-
 static struct block_device_operations floppy_fops = {
 	.open		= floppy_open,
 	.release	= floppy_release,
@@ -1104,3 +1138,5 @@
 	
 	return 0;
 }
+
+module_init(swim3_init)
--- diff/drivers/cdrom/cdrom.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/cdrom/cdrom.c	2004-02-09 10:39:52.000000000 +0000
@@ -695,6 +695,35 @@
 	return ret;
 }
 
+static int mo_open_write(struct cdrom_device_info *cdi)
+{
+	struct cdrom_generic_command cgc;
+	char buffer[255];
+	int ret;
+
+	init_cdrom_command(&cgc, &buffer, 4, CGC_DATA_READ);
+	cgc.quiet = 1;
+
+	/*
+	 * obtain write protect information as per
+	 * drivers/scsi/sd.c:sd_read_write_protect_flag
+	 */
+
+	ret = cdrom_mode_sense(cdi, &cgc, GPMODE_ALL_PAGES, 0);
+	if (ret)
+		ret = cdrom_mode_sense(cdi, &cgc, GPMODE_VENDOR_PAGE, 0);
+	if (ret) {
+		cgc.buflen = 255;
+		ret = cdrom_mode_sense(cdi, &cgc, GPMODE_ALL_PAGES, 0);
+	}
+
+	/* drive gave us no info, let the user go ahead */
+	if (ret)
+		return 0;
+
+	return buffer[3] & 0x80;
+}
+
 /*
  * returns 0 for ok to open write, non-0 to disallow
  */
@@ -706,11 +735,8 @@
 		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;
+		ret = mo_open_write(cdi);
 
 	return ret;
 }
@@ -1773,7 +1799,7 @@
 	int ret;
 
 	/* Try the generic SCSI command ioctl's first.. */
-	ret = scsi_cmd_ioctl(ip->i_bdev, cmd, arg);
+	ret = scsi_cmd_ioctl(ip->i_bdev->bd_disk, cmd, arg);
 	if (ret != -ENOTTY)
 		return ret;
 
@@ -2268,7 +2294,7 @@
 			return -EINVAL;
 
 		/* FIXME: we need upper bound checking, too!! */
-		if (lba < 0 || ra.nframes <= 0 || ra.nframes > 64)
+		if (lba < 0 || ra.nframes <= 0 || ra.nframes > CD_FRAMES)
 			return -EINVAL;
 
 		/*
--- diff/drivers/char/Kconfig	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/char/Kconfig	2004-02-09 10:39:52.000000000 +0000
@@ -588,30 +588,6 @@
 	bool "Support for console on line printer"
 	depends on PC9800_OLDLP
 
-
-menu "Mice"
-
-config BUSMOUSE
-	tristate "Bus Mouse Support"
-	---help---
-	  Say Y here if your machine has a bus mouse as opposed to a serial
-	  mouse. Most people have a regular serial MouseSystem or
-	  Microsoft mouse (made by Logitech) that plugs into a COM port
-	  (rectangular with 9 or 25 pins). These people say N here. 
-
-	  If you have a laptop, you either have to check the documentation or
-	  experiment a bit to find out whether the trackball is a serial mouse
-	  or not; it's best to say Y here for you.
-
-	  This is the generic bus mouse driver code. If you have a bus mouse,
-	  you will have to say Y here and also to the specific driver for your
-	  mouse below.
-
-	  To compile this driver as a module, choose M here: the
-	  module will be called busmouse.
-
-endmenu
-
 config QIC02_TAPE
 	tristate "QIC-02 tape support"
 	help
@@ -794,8 +770,7 @@
 	  precision in some cases.
 
 	  To compile this driver as a module, choose M here: the
-	  module will be called genrtc. To load the module automatically
-	  add 'alias char-major-10-135 genrtc' to your /etc/modules.conf
+	  module will be called genrtc.
 
 config GEN_RTC_X
 	bool "Extended RTC operation"
@@ -962,12 +937,16 @@
 	  If compiled as a module, it will be called scx200_gpio.
 
 config RAW_DRIVER
-	tristate "RAW driver (/dev/raw/rawN)"
+	tristate "RAW driver (/dev/raw/rawN) (OBSOLETE)"
 	help
 	  The raw driver permits block devices to be bound to /dev/raw/rawN. 
 	  Once bound, I/O against /dev/raw/rawN uses efficient zero-copy I/O. 
 	  See the raw(8) manpage for more details.
 
+          The raw driver is deprecated and may be removed from 2.7
+          kernels.  Applications should simply open the device (eg /dev/hda1)
+          with the O_DIRECT flag.
+
 config MAX_RAW_DEVS
 	int "Maximum number of RAW devices to support (1-8192)"
 	depends on RAW_DRIVER
--- diff/drivers/char/Makefile	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/char/Makefile	2004-02-09 10:39:52.000000000 +0000
@@ -49,7 +49,6 @@
 obj-$(CONFIG_TIPAR) += tipar.o
 obj-$(CONFIG_PC9800_OLDLP) += lp_old98.o
 
-obj-$(CONFIG_BUSMOUSE) += busmouse.o
 obj-$(CONFIG_DTLK) += dtlk.o
 obj-$(CONFIG_R3964) += n_r3964.o
 obj-$(CONFIG_APPLICOM) += applicom.o
@@ -57,7 +56,9 @@
 obj-$(CONFIG_RTC) += rtc.o
 obj-$(CONFIG_GEN_RTC) += genrtc.o
 obj-$(CONFIG_EFI_RTC) += efirtc.o
-ifeq ($(CONFIG_PPC),)
+ifeq ($(CONFIG_GENERIC_NVRAM),y)
+  obj-$(CONFIG_NVRAM) += generic_nvram.o
+else
   obj-$(CONFIG_NVRAM) += nvram.o
 endif
 obj-$(CONFIG_TOSHIBA) += toshiba.o
--- diff/drivers/char/agp/intel-agp.c	2004-01-19 10:22:56.000000000 +0000
+++ source/drivers/char/agp/intel-agp.c	2004-02-09 10:39:52.000000000 +0000
@@ -1432,6 +1432,8 @@
 		intel_configure();
 	else if (bridge->driver == &intel_845_driver)
 		intel_845_configure();
+	else if (bridge->driver == &intel_830mp_driver)
+		intel_830mp_configure();
 
 	return 0;
 }
--- diff/drivers/char/amiserial.c	2003-10-09 09:47:33.000000000 +0100
+++ source/drivers/char/amiserial.c	2004-02-09 10:39:52.000000000 +0000
@@ -1248,57 +1248,48 @@
 }
 
 
-static int get_modem_info(struct async_struct * info, unsigned int *value)
+static int rs_tiocmget(struct tty_struct *tty, struct file *file)
 {
+	struct async_struct * info = (struct async_struct *)tty->driver_data;
 	unsigned char control, status;
-	unsigned int result;
 	unsigned long flags;
 
+	if (serial_paranoia_check(info, tty->name, "rs_ioctl"))
+		return -ENODEV;
+	if (tty->flags & (1 << TTY_IO_ERROR))
+		return -EIO;
+
 	control = info->MCR;
 	local_irq_save(flags);
 	status = ciab.pra;
 	local_irq_restore(flags);
-	result =  ((control & SER_RTS) ? TIOCM_RTS : 0)
+	return    ((control & SER_RTS) ? TIOCM_RTS : 0)
 		| ((control & SER_DTR) ? TIOCM_DTR : 0)
 		| (!(status  & SER_DCD) ? TIOCM_CAR : 0)
 		| (!(status  & SER_DSR) ? TIOCM_DSR : 0)
 		| (!(status  & SER_CTS) ? TIOCM_CTS : 0);
-	if (copy_to_user(value, &result, sizeof(int)))
-		return -EFAULT;
-	return 0;
 }
 
-static int set_modem_info(struct async_struct * info, unsigned int cmd,
-			  unsigned int *value)
+static int rs_tiocmset(struct tty_struct *tty, struct file *file,
+		       unsigned int set, unsigned int clear)
 {
-	unsigned int arg;
+	struct async_struct * info = (struct async_struct *)tty->driver_data;
 	unsigned long flags;
 
-	if (copy_from_user(&arg, value, sizeof(int)))
-		return -EFAULT;
+	if (serial_paranoia_check(info, tty->name, "rs_ioctl"))
+		return -ENODEV;
+	if (tty->flags & (1 << TTY_IO_ERROR))
+		return -EIO;
 
-	switch (cmd) {
-	case TIOCMBIS: 
-	        if (arg & TIOCM_RTS)
-			info->MCR |= SER_RTS;
-		if (arg & TIOCM_DTR)
-			info->MCR |= SER_DTR;
-		break;
-	case TIOCMBIC:
-	        if (arg & TIOCM_RTS)
-			info->MCR &= ~SER_RTS;
-		if (arg & TIOCM_DTR)
-			info->MCR &= ~SER_DTR;
-		break;
-	case TIOCMSET:
-		info->MCR = ((info->MCR & ~(SER_RTS | SER_DTR))
-			     | ((arg & TIOCM_RTS) ? SER_RTS : 0)
-			     | ((arg & TIOCM_DTR) ? SER_DTR : 0));
-		break;
-	default:
-		return -EINVAL;
-	}
 	local_irq_save(flags);
+	if (set & TIOCM_RTS)
+		info->MCR |= SER_RTS;
+	if (set & TIOCM_DTR)
+		info->MCR |= SER_DTR;
+	if (clear & TIOCM_RTS)
+		info->MCR &= ~SER_RTS;
+	if (clear & TIOCM_DTR)
+		info->MCR &= ~SER_DTR;
 	rtsdtr_ctrl(info->MCR);
 	local_irq_restore(flags);
 	return 0;
@@ -1344,12 +1335,6 @@
 	}
 
 	switch (cmd) {
-		case TIOCMGET:
-			return get_modem_info(info, (unsigned int *) arg);
-		case TIOCMBIS:
-		case TIOCMBIC:
-		case TIOCMSET:
-			return set_modem_info(info, cmd, (unsigned int *) arg);
 		case TIOCGSERIAL:
 			return get_serial_info(info,
 					       (struct serial_struct *) arg);
@@ -2045,6 +2030,8 @@
 	.send_xchar = rs_send_xchar,
 	.wait_until_sent = rs_wait_until_sent,
 	.read_proc = rs_read_proc,
+	.tiocmget = rs_tiocmget,
+	.tiocmset = rs_tiocmset,
 };
 
 /*
--- diff/drivers/char/cyclades.c	2003-10-09 09:47:33.000000000 +0100
+++ source/drivers/char/cyclades.c	2004-02-09 10:39:52.000000000 +0000
@@ -3632,8 +3632,9 @@
 }
 
 static int
-get_modem_info(struct cyclades_port * info, unsigned int *value)
+cy_tiocmget(struct tty_struct *tty, struct file *file)
 {
+  struct cyclades_port * info = (struct cyclades_port *)tty->driver_data;
   int card,chip,channel,index;
   unsigned char *base_addr;
   unsigned long flags;
@@ -3645,6 +3646,9 @@
   struct BOARD_CTRL *board_ctrl;
   struct CH_CTRL *ch_ctrl;
 
+    if (serial_paranoia_check(info, tty->name, __FUNCTION__))
+	return -ENODEV;
+
     card = info->card;
     channel = (info->line) - (cy_card[card].first_line);
     if (!IS_CYC_Z(cy_card[card])) {
@@ -3700,24 +3704,27 @@
 	}
 
     }
-    return cy_put_user(result, value);
-} /* get_modem_info */
+    return result;
+} /* cy_tiomget */
 
 
 static int
-set_modem_info(struct cyclades_port * info, unsigned int cmd,
-                          unsigned int *value)
+cy_tiocmset(struct tty_struct *tty, struct file *file,
+            unsigned int set, unsigned int clear)
 {
+  struct cyclades_port * info = (struct cyclades_port *)tty->driver_data;
   int card,chip,channel,index;
   unsigned char *base_addr;
   unsigned long flags;
-  unsigned int arg = cy_get_user((unsigned long *) value);
   struct FIRM_ID *firm_id;
   struct ZFW_CTRL *zfw_ctrl;
   struct BOARD_CTRL *board_ctrl;
   struct CH_CTRL *ch_ctrl;
   int retval;
 
+    if (serial_paranoia_check(info, tty->name, __FUNCTION__))
+	return -ENODEV;
+
     card = info->card;
     channel = (info->line) - (cy_card[card].first_line);
     if (!IS_CYC_Z(cy_card[card])) {
@@ -3728,66 +3735,7 @@
 		       (cy_card[card].base_addr
 		       + (cy_chip_offset[chip]<<index));
 
-	switch (cmd) {
-	case TIOCMBIS:
-	    if (arg & TIOCM_RTS){
-		CY_LOCK(info, flags);
-		cy_writeb((u_long)base_addr+(CyCAR<<index), (u_char)channel);
-                if (info->rtsdtr_inv) {
-		    cy_writeb((u_long)base_addr+(CyMSVR2<<index), CyDTR);
-                } else {
-		    cy_writeb((u_long)base_addr+(CyMSVR1<<index), CyRTS);
-                }
-		CY_UNLOCK(info, flags);
-	    }
-	    if (arg & TIOCM_DTR){
-		CY_LOCK(info, flags);
-		cy_writeb((u_long)base_addr+(CyCAR<<index), (u_char)channel);
-                if (info->rtsdtr_inv) {
-		    cy_writeb((u_long)base_addr+(CyMSVR1<<index), CyRTS);
-                } else {
-		    cy_writeb((u_long)base_addr+(CyMSVR2<<index), CyDTR);
-                }
-#ifdef CY_DEBUG_DTR
-		printk("cyc:set_modem_info raising DTR\n");
-		printk("     status: 0x%x, 0x%x\n",
-		    cy_readb(base_addr+(CyMSVR1<<index)), 
-                    cy_readb(base_addr+(CyMSVR2<<index)));
-#endif
-		CY_UNLOCK(info, flags);
-	    }
-	    break;
-	case TIOCMBIC:
-	    if (arg & TIOCM_RTS){
-		CY_LOCK(info, flags);
-		cy_writeb((u_long)base_addr+(CyCAR<<index), 
-                          (u_char)channel);
-                if (info->rtsdtr_inv) {
-		    	cy_writeb((u_long)base_addr+(CyMSVR2<<index), ~CyDTR);
-                } else {
-		    	cy_writeb((u_long)base_addr+(CyMSVR1<<index), ~CyRTS);
-                }
-		CY_UNLOCK(info, flags);
-	    }
-	    if (arg & TIOCM_DTR){
-		CY_LOCK(info, flags);
-		cy_writeb((u_long)base_addr+(CyCAR<<index), (u_char)channel);
-                if (info->rtsdtr_inv) {
-			cy_writeb((u_long)base_addr+(CyMSVR1<<index), ~CyRTS);
-                } else {
-			cy_writeb((u_long)base_addr+(CyMSVR2<<index), ~CyDTR);
-                }
-#ifdef CY_DEBUG_DTR
-		printk("cyc:set_modem_info dropping DTR\n");
-		printk("     status: 0x%x, 0x%x\n",
-		    cy_readb(base_addr+(CyMSVR1<<index)), 
-                    cy_readb(base_addr+(CyMSVR2<<index)));
-#endif
-		CY_UNLOCK(info, flags);
-	    }
-	    break;
-	case TIOCMSET:
-	    if (arg & TIOCM_RTS){
+	if (set & TIOCM_RTS){
 		CY_LOCK(info, flags);
 	        cy_writeb((u_long)base_addr+(CyCAR<<index), (u_char)channel);
                 if (info->rtsdtr_inv) {
@@ -3796,7 +3744,8 @@
 			cy_writeb((u_long)base_addr+(CyMSVR1<<index), CyRTS);
                 }
 		CY_UNLOCK(info, flags);
-	    }else{
+	}
+	if (clear & TIOCM_RTS) {
 		CY_LOCK(info, flags);
 		cy_writeb((u_long)base_addr+(CyCAR<<index), (u_char)channel);
                 if (info->rtsdtr_inv) {
@@ -3805,8 +3754,8 @@
 			cy_writeb((u_long)base_addr+(CyMSVR1<<index), ~CyRTS);
                 }
 		CY_UNLOCK(info, flags);
-	    }
-	    if (arg & TIOCM_DTR){
+	}
+	if (set & TIOCM_DTR){
 		CY_LOCK(info, flags);
 		cy_writeb((u_long)base_addr+(CyCAR<<index), (u_char)channel);
                 if (info->rtsdtr_inv) {
@@ -3821,7 +3770,8 @@
                     cy_readb(base_addr+(CyMSVR2<<index)));
 #endif
 		CY_UNLOCK(info, flags);
-	    }else{
+	}
+	if (clear & TIOCM_DTR) {
 		CY_LOCK(info, flags);
 		cy_writeb((u_long)base_addr+(CyCAR<<index), (u_char)channel);
                 if (info->rtsdtr_inv) {
@@ -3837,10 +3787,6 @@
                     cy_readb(base_addr+(CyMSVR2<<index)));
 #endif
 		CY_UNLOCK(info, flags);
-	    }
-	    break;
-	default:
-	    return -EINVAL;
 	}
     } else {
 	base_addr = (unsigned char*) (cy_card[card].base_addr);
@@ -3854,54 +3800,19 @@
 	    board_ctrl = &zfw_ctrl->board_ctrl;
 	    ch_ctrl = zfw_ctrl->ch_ctrl;
 
-	    switch (cmd) {
-	    case TIOCMBIS:
-		if (arg & TIOCM_RTS){
-		    CY_LOCK(info, flags);
-		    cy_writel(&ch_ctrl[channel].rs_control,
-                       cy_readl(&ch_ctrl[channel].rs_control) | C_RS_RTS);
-		    CY_UNLOCK(info, flags);
-		}
-		if (arg & TIOCM_DTR){
-		    CY_LOCK(info, flags);
-		    cy_writel(&ch_ctrl[channel].rs_control,
-                       cy_readl(&ch_ctrl[channel].rs_control) | C_RS_DTR);
-#ifdef CY_DEBUG_DTR
-		    printk("cyc:set_modem_info raising Z DTR\n");
-#endif
-		    CY_UNLOCK(info, flags);
-		}
-		break;
-	    case TIOCMBIC:
-		if (arg & TIOCM_RTS){
-		    CY_LOCK(info, flags);
-		    cy_writel(&ch_ctrl[channel].rs_control,
-                       cy_readl(&ch_ctrl[channel].rs_control) & ~C_RS_RTS);
-		    CY_UNLOCK(info, flags);
-		}
-		if (arg & TIOCM_DTR){
-		    CY_LOCK(info, flags);
-		    cy_writel(&ch_ctrl[channel].rs_control,
-                       cy_readl(&ch_ctrl[channel].rs_control) & ~C_RS_DTR);
-#ifdef CY_DEBUG_DTR
-		    printk("cyc:set_modem_info clearing Z DTR\n");
-#endif
-		    CY_UNLOCK(info, flags);
-		}
-		break;
-	    case TIOCMSET:
-		if (arg & TIOCM_RTS){
+	    if (set & TIOCM_RTS){
 		    CY_LOCK(info, flags);
 		    cy_writel(&ch_ctrl[channel].rs_control,
                        cy_readl(&ch_ctrl[channel].rs_control) | C_RS_RTS);
 		    CY_UNLOCK(info, flags);
-		}else{
+	    }
+	    if (clear & TIOCM_RTS) {
 		    CY_LOCK(info, flags);
 		    cy_writel(&ch_ctrl[channel].rs_control,
                        cy_readl(&ch_ctrl[channel].rs_control) & ~C_RS_RTS);
 		    CY_UNLOCK(info, flags);
-		}
-		if (arg & TIOCM_DTR){
+	    }
+	    if (set & TIOCM_DTR){
 		    CY_LOCK(info, flags);
 		    cy_writel(&ch_ctrl[channel].rs_control,
                        cy_readl(&ch_ctrl[channel].rs_control) | C_RS_DTR);
@@ -3909,7 +3820,8 @@
 		    printk("cyc:set_modem_info raising Z DTR\n");
 #endif
 		    CY_UNLOCK(info, flags);
-		}else{
+	    }
+	    if (clear & TIOCM_DTR) {
 		    CY_LOCK(info, flags);
 		    cy_writel(&ch_ctrl[channel].rs_control,
                        cy_readl(&ch_ctrl[channel].rs_control) & ~C_RS_DTR);
@@ -3917,10 +3829,6 @@
 		    printk("cyc:set_modem_info clearing Z DTR\n");
 #endif
 		    CY_UNLOCK(info, flags);
-		}
-		break;
-	    default:
-		return -EINVAL;
 	    }
 	}else{
 	    return -ENODEV;
@@ -3935,7 +3843,7 @@
 	CY_UNLOCK(info, flags);
     }
     return 0;
-} /* set_modem_info */
+} /* cy_tiocmset */
 
 /*
  * cy_break() --- routine which turns the break handling on or off
@@ -4242,14 +4150,6 @@
 	case CYGETWAIT:
 	    ret_val = info->closing_wait / (HZ/100);
 	    break;
-        case TIOCMGET:
-            ret_val = get_modem_info(info, (unsigned int *) arg);
-            break;
-        case TIOCMBIS:
-        case TIOCMBIC:
-        case TIOCMSET:
-            ret_val = set_modem_info(info, cmd, (unsigned int *) arg);
-            break;
         case TIOCGSERIAL:
             ret_val = get_serial_info(info, (struct serial_struct *) arg);
             break;
@@ -5429,6 +5329,8 @@
     .break_ctl = cy_break,
     .wait_until_sent = cy_wait_until_sent,
     .read_proc = cyclades_get_proc_info,
+    .tiocmget = cy_tiocmget,
+    .tiocmset = cy_tiocmset,
 };
 
 static int __init
--- diff/drivers/char/drm/Kconfig	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/char/drm/Kconfig	2004-02-09 10:39:52.000000000 +0000
@@ -76,7 +76,7 @@
 	tristate "SiS video cards"
 	depends on DRM && AGP
 	help
-	  Choose this option if you have a SiS 630 or compatibel video 
+	  Choose this option if you have a SiS 630 or compatible video 
           chipset. If M is selected the module will be called sis. AGP
           support is required for this driver to work.
 
--- diff/drivers/char/drm/drm.h	2003-07-22 18:54:27.000000000 +0100
+++ source/drivers/char/drm/drm.h	2004-02-09 10:39:52.000000000 +0000
@@ -580,6 +580,16 @@
 	unsigned long handle;	/**< Used for mapping / unmapping */
 } drm_scatter_gather_t;
 
+/**
+ * DRM_IOCTL_SET_VERSION ioctl argument type.
+ */
+typedef struct drm_set_version {
+	int drm_di_major;
+	int drm_di_minor;
+	int drm_dd_major;
+	int drm_dd_minor;
+} drm_set_version_t;
+
 
 #define DRM_IOCTL_BASE			'd'
 #define DRM_IO(nr)			_IO(DRM_IOCTL_BASE,nr)
@@ -594,6 +604,7 @@
 #define DRM_IOCTL_GET_MAP               DRM_IOWR(0x04, drm_map_t)
 #define DRM_IOCTL_GET_CLIENT            DRM_IOWR(0x05, drm_client_t)
 #define DRM_IOCTL_GET_STATS             DRM_IOR( 0x06, drm_stats_t)
+#define DRM_IOCTL_SET_VERSION		DRM_IOWR(0x07, drm_set_version_t)
 
 #define DRM_IOCTL_SET_UNIQUE		DRM_IOW( 0x10, drm_unique_t)
 #define DRM_IOCTL_AUTH_MAGIC		DRM_IOW( 0x11, drm_auth_t)
--- diff/drivers/char/drm/drmP.h	2004-01-19 10:22:56.000000000 +0000
+++ source/drivers/char/drm/drmP.h	2004-02-09 10:39:52.000000000 +0000
@@ -92,8 +92,8 @@
 #ifndef __HAVE_DMA
 #define __HAVE_DMA		0
 #endif
-#ifndef __HAVE_DMA_IRQ
-#define __HAVE_DMA_IRQ		0
+#ifndef __HAVE_IRQ
+#define __HAVE_IRQ		0
 #endif
 #ifndef __HAVE_DMA_WAITLIST
 #define __HAVE_DMA_WAITLIST	0
@@ -324,6 +324,7 @@
 #define DRM_BUFCOUNT(x) ((x)->count - DRM_LEFTCOUNT(x))
 #define DRM_WAITCOUNT(dev,idx) DRM_BUFCOUNT(&dev->queuelist[idx]->waitlist)
 
+#define DRM_IF_VERSION(maj, min) ((maj) << 16 | (min))
 /**
  * Get the private SAREA mapping.
  *
@@ -362,10 +363,13 @@
 typedef int drm_ioctl_t( struct inode *inode, struct file *filp,
 			 unsigned int cmd, unsigned long arg );
 
-typedef struct drm_pci_list {
-	u16 vendor;
-	u16 device;
-} drm_pci_list_t;
+typedef struct drm_pci_id_list
+{
+	int vendor;
+	int device;
+	long driver_private;
+	char *name;
+} drm_pci_id_list_t;
 
 typedef struct drm_ioctl_desc {
 	drm_ioctl_t	     *func;
@@ -488,6 +492,9 @@
 	struct drm_device *dev;
 	int 		  remove_auth_on_close;
 	unsigned long     lock_count;
+#ifdef DRIVER_FILE_FIELDS
+	DRIVER_FILE_FIELDS;
+#endif
 } drm_file_t;
 
 /** Wait queue */
@@ -622,6 +629,8 @@
 	int		  unique_len;	/**< Length of unique field */
 	dev_t		  device;	/**< Device number for mknod */
 	char		  *devname;	/**< For /proc/interrupts */
+	int		  minor;        /**< Minor device number */
+	int		  if_version;	/**< Highest interface version set */
 
 	int		  blocked;	/**< Blocked due to VC switch? */
 	struct proc_dir_entry *root;	/**< Root for this device's entries */
@@ -679,6 +688,7 @@
 	/** \name Context support */
 	/*@{*/
 	int		  irq;		/**< Interrupt used by board */
+	int		  irq_enabled;	/**< True if irq handler is enabled */
 	__volatile__ long context_flag;	/**< Context swapping flag */
 	__volatile__ long interrupt_flag; /**< Interruption handler flag */
 	__volatile__ long dma_flag;	/**< DMA dispatch flag */
@@ -714,7 +724,12 @@
 #if __REALLY_HAVE_AGP
 	drm_agp_head_t    *agp;	/**< AGP data */
 #endif
-	struct pci_dev *pdev;		/**< PCI device structure */
+
+	struct pci_dev    *pdev;	/**< PCI device structure */
+	int               pci_domain;	/**< PCI bus domain number */
+	int               pci_bus;	/**< PCI bus number */
+	int               pci_slot;	/**< PCI slot number */
+	int               pci_func;	/**< PCI function number */
 #ifdef __alpha__
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,3)
 	struct pci_controler *hose;
@@ -804,8 +819,8 @@
 #endif
 
 				/* Misc. IOCTL support (drm_ioctl.h) */
-extern int	     DRM(irq_busid)(struct inode *inode, struct file *filp,
-				    unsigned int cmd, unsigned long arg);
+extern int	     DRM(irq_by_busid)(struct inode *inode, struct file *filp,
+				       unsigned int cmd, unsigned long arg);
 extern int	     DRM(getunique)(struct inode *inode, struct file *filp,
 				    unsigned int cmd, unsigned long arg);
 extern int	     DRM(setunique)(struct inode *inode, struct file *filp,
@@ -816,6 +831,8 @@
 				    unsigned int cmd, unsigned long arg);
 extern int	     DRM(getstats)(struct inode *inode, struct file *filp,
 				   unsigned int cmd, unsigned long arg);
+extern int	     DRM(setversion)(struct inode *inode, struct file *filp,
+				     unsigned int cmd, unsigned long arg);
 
 				/* Context IOCTL support (drm_context.h) */
 extern int	     DRM(resctx)( struct inode *inode, struct file *filp,
@@ -900,12 +917,17 @@
 extern void	     DRM(dma_takedown)(drm_device_t *dev);
 extern void	     DRM(free_buffer)(drm_device_t *dev, drm_buf_t *buf);
 extern void	     DRM(reclaim_buffers)( struct file *filp );
-#if __HAVE_DMA_IRQ
+#endif /* __HAVE_DMA */
+
+				/* IRQ support (drm_irq.h) */
+#if __HAVE_IRQ || __HAVE_DMA
 extern int           DRM(control)( struct inode *inode, struct file *filp,
 				   unsigned int cmd, unsigned long arg );
-extern int           DRM(irq_install)( drm_device_t *dev, int irq );
+#endif
+#if __HAVE_IRQ
+extern int           DRM(irq_install)( drm_device_t *dev );
 extern int           DRM(irq_uninstall)( drm_device_t *dev );
-extern irqreturn_t   DRM(dma_service)( DRM_IRQ_ARGS );
+extern irqreturn_t   DRM(irq_handler)( DRM_IRQ_ARGS );
 extern void          DRM(driver_irq_preinstall)( drm_device_t *dev );
 extern void          DRM(driver_irq_postinstall)( drm_device_t *dev );
 extern void          DRM(driver_irq_uninstall)( drm_device_t *dev );
@@ -915,12 +937,11 @@
 extern int           DRM(vblank_wait)(drm_device_t *dev, unsigned int *vbl_seq);
 extern void          DRM(vbl_send_signals)( drm_device_t *dev );
 #endif
-#if __HAVE_DMA_IRQ_BH
-extern void          DRM(dma_immediate_bh)( void *dev );
+#if __HAVE_IRQ_BH
+extern void          DRM(irq_immediate_bh)( void *dev );
 #endif
 #endif
 
-#endif /* __HAVE_DMA */
 
 #if __REALLY_HAVE_AGP
 				/* AGP/GART support (drm_agpsupport.h) */
--- diff/drivers/char/drm/drm_bufs.h	2003-07-22 18:54:27.000000000 +0100
+++ source/drivers/char/drm/drm_bufs.h	2004-02-09 10:39:52.000000000 +0000
@@ -147,7 +147,9 @@
 					      MTRR_TYPE_WRCOMB, 1 );
 		}
 #endif
-		map->handle = DRM(ioremap)( map->offset, map->size, dev );
+		if (map->type == _DRM_REGISTERS)
+			map->handle = DRM(ioremap)( map->offset, map->size,
+						    dev );
 		break;
 
 	case _DRM_SHM:
@@ -160,6 +162,12 @@
 		}
 		map->offset = (unsigned long)map->handle;
 		if ( map->flags & _DRM_CONTAINS_LOCK ) {
+			/* Prevent a 2nd X Server from creating a 2nd lock */
+			if (dev->lock.hw_lock != NULL) {
+				vfree( map->handle );
+				DRM(free)( map, sizeof(*map), DRM_MEM_MAPS );
+				return -EBUSY;
+			}
 			dev->sigdata.lock =
 			dev->lock.hw_lock = map->handle; /* Pointer to lock */
 		}
--- diff/drivers/char/drm/drm_dma.h	2003-07-22 18:54:27.000000000 +0100
+++ source/drivers/char/drm/drm_dma.h	2004-02-09 10:39:52.000000000 +0000
@@ -43,15 +43,6 @@
 #ifndef __HAVE_DMA_RECLAIM
 #define __HAVE_DMA_RECLAIM	0
 #endif
-#ifndef __HAVE_SHARED_IRQ
-#define __HAVE_SHARED_IRQ	0
-#endif
-
-#if __HAVE_SHARED_IRQ
-#define DRM_IRQ_TYPE		SA_SHIRQ
-#else
-#define DRM_IRQ_TYPE		0
-#endif
 
 #if __HAVE_DMA
 
@@ -214,293 +205,11 @@
 }
 #endif
 
-
-
-
-#if __HAVE_DMA_IRQ
-
-/**
- * Install IRQ handler.
- *
- * \param dev DRM device.
- * \param irq IRQ number.
- *
- * Initializes the IRQ related data, and setups drm_device::vbl_queue. Installs the handler, calling the driver
- * \c DRM(driver_irq_preinstall)() and \c DRM(driver_irq_postinstall)() functions
- * before and after the installation.
- */
-int DRM(irq_install)( drm_device_t *dev, int irq )
-{
-	int ret;
-
-	if ( !irq )
-		return -EINVAL;
-
-	down( &dev->struct_sem );
-
-	/* Driver must have been initialized */
-	if ( !dev->dev_private ) {
-		up( &dev->struct_sem );
-		return -EINVAL;
-	}
-
-	if ( dev->irq ) {
-		up( &dev->struct_sem );
-		return -EBUSY;
-	}
-	dev->irq = irq;
-	up( &dev->struct_sem );
-
-	DRM_DEBUG( "%s: irq=%d\n", __FUNCTION__, irq );
-
-	dev->context_flag = 0;
-	dev->interrupt_flag = 0;
-	dev->dma_flag = 0;
-
-	dev->dma->next_buffer = NULL;
-	dev->dma->next_queue = NULL;
-	dev->dma->this_buffer = NULL;
-
-#if __HAVE_DMA_IRQ_BH
-	INIT_WORK(&dev->work, DRM(dma_immediate_bh), dev);
-#endif
-
-#if __HAVE_VBL_IRQ
-	init_waitqueue_head(&dev->vbl_queue);
-
-	spin_lock_init( &dev->vbl_lock );
-
-	INIT_LIST_HEAD( &dev->vbl_sigs.head );
-
-	dev->vbl_pending = 0;
-#endif
-
-				/* Before installing handler */
-	DRM(driver_irq_preinstall)(dev);
-
-				/* Install handler */
-	ret = request_irq( dev->irq, DRM(dma_service),
-			   DRM_IRQ_TYPE, dev->devname, dev );
-	if ( ret < 0 ) {
-		down( &dev->struct_sem );
-		dev->irq = 0;
-		up( &dev->struct_sem );
-		return ret;
-	}
-
-				/* After installing handler */
-	DRM(driver_irq_postinstall)(dev);
-
-	return 0;
-}
-
-/**
- * Uninstall the IRQ handler.
- *
- * \param dev DRM device.
- *
- * Calls the driver's \c DRM(driver_irq_uninstall)() function, and stops the irq.
- */
-int DRM(irq_uninstall)( drm_device_t *dev )
-{
-	int irq;
-
-	down( &dev->struct_sem );
-	irq = dev->irq;
-	dev->irq = 0;
-	up( &dev->struct_sem );
-
-	if ( !irq )
-		return -EINVAL;
-
-	DRM_DEBUG( "%s: irq=%d\n", __FUNCTION__, irq );
-
-	DRM(driver_irq_uninstall)( dev );
-
-	free_irq( irq, dev );
-
-	return 0;
-}
-
-/**
- * IRQ control ioctl.
- *
- * \param inode device inode.
- * \param filp file pointer.
- * \param cmd command.
- * \param arg user argument, pointing to a drm_control structure.
- * \return zero on success or a negative number on failure.
- *
- * Calls irq_install() or irq_uninstall() according to \p arg.
- */
-int DRM(control)( struct inode *inode, struct file *filp,
-		  unsigned int cmd, unsigned long arg )
-{
-	drm_file_t *priv = filp->private_data;
-	drm_device_t *dev = priv->dev;
-	drm_control_t ctl;
-
-	if ( copy_from_user( &ctl, (drm_control_t *)arg, sizeof(ctl) ) )
-		return -EFAULT;
-
-	switch ( ctl.func ) {
-	case DRM_INST_HANDLER:
-		return DRM(irq_install)( dev, ctl.irq );
-	case DRM_UNINST_HANDLER:
-		return DRM(irq_uninstall)( dev );
-	default:
-		return -EINVAL;
-	}
-}
-
-#if __HAVE_VBL_IRQ
-
-/**
- * Wait for VBLANK.
- *
- * \param inode device inode.
- * \param filp file pointer.
- * \param cmd command.
- * \param data user argument, pointing to a drm_wait_vblank structure.
- * \return zero on success or a negative number on failure.
- *
- * Verifies the IRQ is installed. 
- *
- * If a signal is requested checks if this task has already scheduled the same signal
- * for the same vblank sequence number - nothing to be done in
- * that case. If the number of tasks waiting for the interrupt exceeds 100 the
- * function fails. Otherwise adds a new entry to drm_device::vbl_sigs for this
- * task.
- *
- * If a signal is not requested, then calls vblank_wait().
- */
-int DRM(wait_vblank)( DRM_IOCTL_ARGS )
-{
-	drm_file_t *priv = filp->private_data;
-	drm_device_t *dev = priv->dev;
-	drm_wait_vblank_t vblwait;
-	struct timeval now;
-	int ret = 0;
-	unsigned int flags;
-
-	if (!dev->irq)
-		return -EINVAL;
-
-	DRM_COPY_FROM_USER_IOCTL( vblwait, (drm_wait_vblank_t *)data,
-				  sizeof(vblwait) );
-
-	switch ( vblwait.request.type & ~_DRM_VBLANK_FLAGS_MASK ) {
-	case _DRM_VBLANK_RELATIVE:
-		vblwait.request.sequence += atomic_read( &dev->vbl_received );
-		vblwait.request.type &= ~_DRM_VBLANK_RELATIVE;
-	case _DRM_VBLANK_ABSOLUTE:
-		break;
-	default:
-		return -EINVAL;
-	}
-
-	flags = vblwait.request.type & _DRM_VBLANK_FLAGS_MASK;
-	
-	if ( flags & _DRM_VBLANK_SIGNAL ) {
-		unsigned long irqflags;
-		drm_vbl_sig_t *vbl_sig;
-		
-		vblwait.reply.sequence = atomic_read( &dev->vbl_received );
-
-		spin_lock_irqsave( &dev->vbl_lock, irqflags );
-
-		/* Check if this task has already scheduled the same signal
-		 * for the same vblank sequence number; nothing to be done in
-		 * that case
-		 */
-		list_for_each_entry( vbl_sig, &dev->vbl_sigs.head, head ) {
-			if (vbl_sig->sequence == vblwait.request.sequence
-			    && vbl_sig->info.si_signo == vblwait.request.signal
-			    && vbl_sig->task == current)
-			{
-				spin_unlock_irqrestore( &dev->vbl_lock, irqflags );
-				goto done;
-			}
-		}
-
-		if ( dev->vbl_pending >= 100 ) {
-			spin_unlock_irqrestore( &dev->vbl_lock, irqflags );
-			return -EBUSY;
-		}
-
-		dev->vbl_pending++;
-
-		spin_unlock_irqrestore( &dev->vbl_lock, irqflags );
-
-		if ( !( vbl_sig = DRM_MALLOC( sizeof( drm_vbl_sig_t ) ) ) ) {
-			return -ENOMEM;
-		}
-
-		memset( (void *)vbl_sig, 0, sizeof(*vbl_sig) );
-
-		vbl_sig->sequence = vblwait.request.sequence;
-		vbl_sig->info.si_signo = vblwait.request.signal;
-		vbl_sig->task = current;
-
-		spin_lock_irqsave( &dev->vbl_lock, irqflags );
-
-		list_add_tail( (struct list_head *) vbl_sig, &dev->vbl_sigs.head );
-
-		spin_unlock_irqrestore( &dev->vbl_lock, irqflags );
-	} else {
-		ret = DRM(vblank_wait)( dev, &vblwait.request.sequence );
-
-		do_gettimeofday( &now );
-		vblwait.reply.tval_sec = now.tv_sec;
-		vblwait.reply.tval_usec = now.tv_usec;
-	}
-
-done:
-	DRM_COPY_TO_USER_IOCTL( (drm_wait_vblank_t *)data, vblwait,
-				sizeof(vblwait) );
-
-	return ret;
-}
-
-/**
- * Send the VBLANK signals.
- *
- * \param dev DRM device.
- *
- * Sends a signal for each task in drm_device::vbl_sigs and empties the list.
- *
- * If a signal is not requested, then calls vblank_wait().
+#if !__HAVE_IRQ
+/* This stub DRM_IOCTL_CONTROL handler is for the drivers that used to require
+ * IRQs for DMA but no longer do.  It maintains compatibility with the X Servers
+ * that try to use the control ioctl by simply returning success.
  */
-void DRM(vbl_send_signals)( drm_device_t *dev )
-{
-	struct list_head *list, *tmp;
-	drm_vbl_sig_t *vbl_sig;
-	unsigned int vbl_seq = atomic_read( &dev->vbl_received );
-	unsigned long flags;
-
-	spin_lock_irqsave( &dev->vbl_lock, flags );
-
-	list_for_each_safe( list, tmp, &dev->vbl_sigs.head ) {
-		vbl_sig = list_entry( list, drm_vbl_sig_t, head );
-		if ( ( vbl_seq - vbl_sig->sequence ) <= (1<<23) ) {
-			vbl_sig->info.si_code = vbl_seq;
-			send_sig_info( vbl_sig->info.si_signo, &vbl_sig->info, vbl_sig->task );
-
-			list_del( list );
-
-			DRM_FREE( vbl_sig, sizeof(*vbl_sig) );
-
-			dev->vbl_pending--;
-		}
-	}
-
-	spin_unlock_irqrestore( &dev->vbl_lock, flags );
-}
-
-#endif	/* __HAVE_VBL_IRQ */
-
-#else
-
 int DRM(control)( struct inode *inode, struct file *filp,
 		  unsigned int cmd, unsigned long arg )
 {
@@ -517,7 +226,6 @@
 		return -EINVAL;
 	}
 }
-
-#endif /* __HAVE_DMA_IRQ */
+#endif
 
 #endif /* __HAVE_DMA */
--- diff/drivers/char/drm/drm_drv.h	2003-10-27 09:20:43.000000000 +0000
+++ source/drivers/char/drm/drm_drv.h	2004-02-09 10:39:52.000000000 +0000
@@ -58,8 +58,8 @@
 #ifndef __HAVE_CTX_BITMAP
 #define __HAVE_CTX_BITMAP		0
 #endif
-#ifndef __HAVE_DMA_IRQ
-#define __HAVE_DMA_IRQ			0
+#ifndef __HAVE_IRQ
+#define __HAVE_IRQ			0
 #endif
 #ifndef __HAVE_DMA_QUEUE
 #define __HAVE_DMA_QUEUE		0
@@ -126,6 +126,9 @@
 #ifndef DRIVER_IOCTLS
 #define DRIVER_IOCTLS
 #endif
+#ifndef DRIVER_OPEN_HELPER
+#define DRIVER_OPEN_HELPER( priv, dev )
+#endif
 #ifndef DRIVER_FOPS
 #define DRIVER_FOPS				\
 static struct file_operations	DRM(fops) = {	\
@@ -159,15 +162,8 @@
 #undef DRM_OPTIONS_FUNC
 #endif
 
-/**
- * The default number of instances (minor numbers) to initialize.
- */
-#ifndef DRIVER_NUM_CARDS
-#define DRIVER_NUM_CARDS 1
-#endif
-
-static drm_device_t	*DRM(device);
-static int		*DRM(minor);
+#define MAX_DEVICES 4
+static drm_device_t	DRM(device)[MAX_DEVICES];
 static int		DRM(numdevs) = 0;
 
 DRIVER_FOPS;
@@ -177,10 +173,13 @@
 	[DRM_IOCTL_NR(DRM_IOCTL_VERSION)]       = { DRM(version),     0, 0 },
 	[DRM_IOCTL_NR(DRM_IOCTL_GET_UNIQUE)]    = { DRM(getunique),   0, 0 },
 	[DRM_IOCTL_NR(DRM_IOCTL_GET_MAGIC)]     = { DRM(getmagic),    0, 0 },
-	[DRM_IOCTL_NR(DRM_IOCTL_IRQ_BUSID)]     = { DRM(irq_busid),   0, 1 },
+#if __HAVE_IRQ
+	[DRM_IOCTL_NR(DRM_IOCTL_IRQ_BUSID)]     = { DRM(irq_by_busid), 0, 1 },
+#endif
 	[DRM_IOCTL_NR(DRM_IOCTL_GET_MAP)]       = { DRM(getmap),      0, 0 },
 	[DRM_IOCTL_NR(DRM_IOCTL_GET_CLIENT)]    = { DRM(getclient),   0, 0 },
 	[DRM_IOCTL_NR(DRM_IOCTL_GET_STATS)]     = { DRM(getstats),    0, 0 },
+	[DRM_IOCTL_NR(DRM_IOCTL_SET_VERSION)]   = { DRM(setversion),  0, 1 },
 
 	[DRM_IOCTL_NR(DRM_IOCTL_SET_UNIQUE)]    = { DRM(setunique),   1, 1 },
 	[DRM_IOCTL_NR(DRM_IOCTL_BLOCK)]         = { DRM(noop),        1, 1 },
@@ -222,9 +221,9 @@
 	[DRM_IOCTL_NR(DRM_IOCTL_INFO_BUFS)]     = { DRM(infobufs),    1, 0 },
 	[DRM_IOCTL_NR(DRM_IOCTL_MAP_BUFS)]      = { DRM(mapbufs),     1, 0 },
 	[DRM_IOCTL_NR(DRM_IOCTL_FREE_BUFS)]     = { DRM(freebufs),    1, 0 },
-
-	/* The DRM_IOCTL_DMA ioctl should be defined by the driver.
-	 */
+	/* The DRM_IOCTL_DMA ioctl should be defined by the driver. */
+#endif
+#if __HAVE_IRQ || __HAVE_DMA
 	[DRM_IOCTL_NR(DRM_IOCTL_CONTROL)]       = { DRM(control),     1, 1 },
 #endif
 
@@ -337,7 +336,7 @@
 	dev->queue_reserved = 0;
 	dev->queue_slots = 0;
 	dev->queuelist = NULL;
-	dev->irq = 0;
+	dev->irq_enabled = 0;
 	dev->context_flag = 0;
 	dev->interrupt_flag = 0;
 	dev->dma_flag = 0;
@@ -345,6 +344,7 @@
 	dev->last_switch = 0;
 	dev->last_checked = 0;
 	init_waitqueue_head( &dev->context_wait );
+	dev->if_version = 0;
 
 	dev->ctx_start = 0;
 	dev->lck_start = 0;
@@ -391,8 +391,8 @@
 	DRM_DEBUG( "\n" );
 
 	DRIVER_PRETAKEDOWN();
-#if __HAVE_DMA_IRQ
-	if ( dev->irq ) DRM(irq_uninstall)( dev );
+#if __HAVE_IRQ
+	if ( dev->irq_enabled ) DRM(irq_uninstall)( dev );
 #endif
 
 	down( &dev->struct_sem );
@@ -534,52 +534,111 @@
 	return 0;
 }
 
-/**
- * Figure out how many instances to initialize.
- *
- * \return number of cards found.
- *
- * Searches for every PCI card in \c DRIVER_CARD_LIST with matching vendor and device ids.
- */
-static int drm_count_cards(void)
+static drm_pci_id_list_t DRM(pciidlist)[] = {
+	DRIVER_PCI_IDS
+};
+
+static int DRM(probe)(struct pci_dev *pdev)
 {
-	int num = 0;
-#if defined(DRIVER_CARD_LIST)
-	int i;
-	drm_pci_list_t *l;
-	u16 device, vendor;
-	struct pci_dev *pdev = NULL;
+	drm_device_t *dev;
+#if __HAVE_CTX_BITMAP
+	int retcode;
 #endif
+	int i;
+	char *desc = NULL;
 
 	DRM_DEBUG( "\n" );
 
-#if defined(DRIVER_COUNT_CARDS)
-	num = DRIVER_COUNT_CARDS();
-#elif defined(DRIVER_CARD_LIST)
-	for (i = 0, l = DRIVER_CARD_LIST; l[i].vendor != 0; i++) {
-		pdev = NULL;
-		vendor = l[i].vendor;
-		device = l[i].device;
-		if(device == 0xffff) device = PCI_ANY_ID;
-		if(vendor == 0xffff) vendor = PCI_ANY_ID;
-		while ((pdev = pci_find_device(vendor, device, pdev))) {
-			num++;
+	for (i = 0; DRM(pciidlist)[i].vendor != 0; i++) {
+		if ((DRM(pciidlist)[i].vendor == pdev->vendor) &&
+		    (DRM(pciidlist)[i].device == pdev->device)) {
+			desc = DRM(pciidlist)[i].name;
 		}
 	}
+	if (desc == NULL)
+		return -ENODEV;
+
+	if (DRM(numdevs) >= MAX_DEVICES)
+		return -ENODEV;
+
+	dev = &(DRM(device)[DRM(numdevs)]);
+
+	memset( (void *)dev, 0, sizeof(*dev) );
+	dev->count_lock = SPIN_LOCK_UNLOCKED;
+	init_timer( &dev->timer );
+	sema_init( &dev->struct_sem, 1 );
+
+	if ((dev->minor = DRM(stub_register)(DRIVER_NAME, &DRM(fops),dev)) < 0)
+		return -EPERM;
+	dev->device = MKDEV(DRM_MAJOR, dev->minor );
+	dev->name   = DRIVER_NAME;
+
+	dev->pdev   = pdev;
+#ifdef __alpha__
+	dev->hose   = pdev->sysdata;
+	dev->pci_domain = dev->hose->bus->number;
 #else
-	num = DRIVER_NUM_CARDS;
+	dev->pci_domain = 0;
+#endif
+	dev->pci_bus = pdev->bus->number;
+	dev->pci_slot = PCI_SLOT(pdev->devfn);
+	dev->pci_func = PCI_FUNC(pdev->devfn);
+	dev->irq = pdev->irq;
+
+	DRIVER_PREINIT();
+
+#if __REALLY_HAVE_AGP
+	dev->agp = DRM(agp_init)();
+#if __MUST_HAVE_AGP
+	if ( dev->agp == NULL ) {
+		DRM_ERROR( "Cannot initialize the agpgart module.\n" );
+		DRM(stub_unregister)(dev->minor);
+		DRM(takedown)( dev );
+		return -ENOMEM;
+	}
+#endif
+#if __REALLY_HAVE_MTRR
+	if (dev->agp)
+		dev->agp->agp_mtrr = mtrr_add( dev->agp->agp_info.aper_base,
+					dev->agp->agp_info.aper_size*1024*1024,
+					MTRR_TYPE_WRCOMB,
+					1 );
+#endif
+#endif
+
+#if __HAVE_CTX_BITMAP
+	retcode = DRM(ctxbitmap_init)( dev );
+	if( retcode ) {
+		DRM_ERROR( "Cannot allocate memory for context bitmap.\n" );
+		DRM(stub_unregister)(dev->minor);
+		DRM(takedown)( dev );
+		return retcode;
+ 	}
 #endif
-	DRM_DEBUG("numdevs = %d\n", num);
-	return num;
+	DRM(numdevs)++; /* no errors, mark it reserved */
+	
+	DRM_INFO( "Initialized %s %d.%d.%d %s on minor %d: %s\n",
+		DRIVER_NAME,
+		DRIVER_MAJOR,
+		DRIVER_MINOR,
+		DRIVER_PATCHLEVEL,
+		DRIVER_DATE,
+		dev->minor,
+		desc );
+
+	DRIVER_POSTINIT();
+
+	return 0;
 }
 
+
 /**
  * Module initialization. Called via init_module at module load time, or via
  * linux/init/main.c (this is not currently supported).
  *
  * \return zero on success or a negative number on failure.
  *
- * Allocates and initialize an array of drm_device structures, and attempts to
+ * Initializes an array of drm_device structures, and attempts to
  * initialize all available devices, using consecutive minors, registering the
  * stubs and initializing the AGP device.
  * 
@@ -588,88 +647,19 @@
  */
 static int __init drm_init( void )
 {
+	struct pci_dev *pdev = NULL;
 
-	drm_device_t *dev;
-	int i;
-#if __HAVE_CTX_BITMAP
-	int retcode;
-#endif
 	DRM_DEBUG( "\n" );
 
 #ifdef MODULE
 	DRM(parse_options)( drm_opts );
 #endif
 
-	DRM(numdevs) = drm_count_cards();
-	/* Force at least one instance. */
-	if (DRM(numdevs) <= 0)
-		DRM(numdevs) = 1;
-
-	DRM(device) = kmalloc(sizeof(*DRM(device)) * DRM(numdevs), GFP_KERNEL);
-	if (!DRM(device)) {
-		return -ENOMEM;
-	}
-	DRM(minor) = kmalloc(sizeof(*DRM(minor)) * DRM(numdevs), GFP_KERNEL);
-	if (!DRM(minor)) {
-		kfree(DRM(device));
-		return -ENOMEM;
-	}
-
-	DRIVER_PREINIT();
-
 	DRM(mem_init)();
 
-	for (i = 0; i < DRM(numdevs); i++) {
-		dev = &(DRM(device)[i]);
-		memset( (void *)dev, 0, sizeof(*dev) );
-		dev->count_lock = SPIN_LOCK_UNLOCKED;
-		init_timer( &dev->timer );
-		sema_init( &dev->struct_sem, 1 );
-
-		if ((DRM(minor)[i] = DRM(stub_register)(DRIVER_NAME, &DRM(fops),dev)) < 0)
-			return -EPERM;
-		dev->device = MKDEV(DRM_MAJOR, DRM(minor)[i] );
-		dev->name   = DRIVER_NAME;
-
-#if __REALLY_HAVE_AGP
-		dev->agp = DRM(agp_init)();
-#if __MUST_HAVE_AGP
-		if ( dev->agp == NULL ) {
-			DRM_ERROR( "Cannot initialize the agpgart module.\n" );
-			DRM(stub_unregister)(DRM(minor)[i]);
-			DRM(takedown)( dev );
-			return -EINVAL;
-		}
-#endif
-#if __REALLY_HAVE_MTRR
-		if (dev->agp)
-			dev->agp->agp_mtrr = mtrr_add( dev->agp->agp_info.aper_base,
-				       dev->agp->agp_info.aper_size*1024*1024,
-				       MTRR_TYPE_WRCOMB,
-				       1 );
-#endif
-#endif
-
-#if __HAVE_CTX_BITMAP
-		retcode = DRM(ctxbitmap_init)( dev );
-		if( retcode ) {
-			DRM_ERROR( "Cannot allocate memory for context bitmap.\n" );
-			DRM(stub_unregister)(DRM(minor)[i]);
-			DRM(takedown)( dev );
-			return retcode;
-		}
-#endif
-		DRM_INFO( "Initialized %s %d.%d.%d %s on minor %d\n",
-		  	DRIVER_NAME,
-		  	DRIVER_MAJOR,
-		  	DRIVER_MINOR,
-		  	DRIVER_PATCHLEVEL,
-		  	DRIVER_DATE,
-		  	DRM(minor)[i] );
+	while ((pdev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, pdev)) != NULL) {
+		DRM(probe)(pdev);
 	}
-
-	DRIVER_POSTINIT();
-
 	return 0;
 }
 
@@ -689,10 +679,10 @@
 
 	for (i = DRM(numdevs) - 1; i >= 0; i--) {
 		dev = &(DRM(device)[i]);
-		if ( DRM(stub_unregister)(DRM(minor)[i]) ) {
+		if ( DRM(stub_unregister)(dev->minor) ) {
 			DRM_ERROR( "Cannot unload module\n" );
 		} else {
-			DRM_DEBUG("minor %d unregistered\n", DRM(minor)[i]);
+			DRM_DEBUG("minor %d unregistered\n", dev->minor);
 			if (i == 0) {
 				DRM_INFO( "Module unloaded\n" );
 			}
@@ -722,8 +712,6 @@
 #endif
 	}
 	DRIVER_POSTCLEANUP();
-	kfree(DRM(minor));
-	kfree(DRM(device));
 	DRM(numdevs) = 0;
 }
 
@@ -795,7 +783,7 @@
 	int i;
 
 	for (i = 0; i < DRM(numdevs); i++) {
-		if (iminor(inode) == DRM(minor)[i]) {
+		if (iminor(inode) == DRM(device)[i].minor) {
 			dev = &(DRM(device)[i]);
 			break;
 		}
--- diff/drivers/char/drm/drm_fops.h	2003-10-09 09:47:16.000000000 +0100
+++ source/drivers/char/drm/drm_fops.h	2004-02-09 10:39:52.000000000 +0000
@@ -72,6 +72,8 @@
 	priv->authenticated = capable(CAP_SYS_ADMIN);
 	priv->lock_count    = 0;
 
+	DRIVER_OPEN_HELPER( priv, dev );
+
 	down(&dev->struct_sem);
 	if (!dev->file_last) {
 		priv->next	= NULL;
--- diff/drivers/char/drm/drm_ioctl.h	2003-07-22 18:54:27.000000000 +0100
+++ source/drivers/char/drm/drm_ioctl.h	2004-02-09 10:39:52.000000000 +0000
@@ -35,69 +35,7 @@
 
 #include "drmP.h"
 
-
-/**
- * Get interrupt from bus id.
- * 
- * \param inode device inode.
- * \param filp file pointer.
- * \param cmd command.
- * \param arg user argument, pointing to a drm_irq_busid structure.
- * \return zero on success or a negative number on failure.
- * 
- * Finds the PCI device with the specified bus id and gets its IRQ number.
- */
-int DRM(irq_busid)(struct inode *inode, struct file *filp,
-		   unsigned int cmd, unsigned long arg)
-{
-	drm_irq_busid_t p;
-	struct pci_dev	*dev;
-
-	if (copy_from_user(&p, (drm_irq_busid_t *)arg, sizeof(p)))
-		return -EFAULT;
-#ifdef __alpha__
-	{
-		int domain = p.busnum >> 8;
-		p.busnum &= 0xff;
-
-		/*
-		 * Find the hose the device is on (the domain number is the
-		 * hose index) and offset the bus by the root bus of that
-		 * hose.
-		 */
-                for(dev = pci_find_device(PCI_ANY_ID,PCI_ANY_ID,NULL);
-                    dev;
-                    dev = pci_find_device(PCI_ANY_ID,PCI_ANY_ID,dev)) {
-			struct pci_controller *hose = dev->sysdata;
-			
-			if (hose->index == domain) {
-				p.busnum += hose->bus->number;
-				break;
-			}
-		}
-	}
-#endif
-	dev = pci_find_slot(p.busnum, PCI_DEVFN(p.devnum, p.funcnum));
-	if (!dev) {
-		DRM_ERROR("pci_find_slot failed for %d:%d:%d\n",
-			  p.busnum, p.devnum, p.funcnum);
-		p.irq = 0;
-		goto out;
-	}			
-	if (pci_enable_device(dev) != 0) {
-		DRM_ERROR("pci_enable_device failed for %d:%d:%d\n",
-			  p.busnum, p.devnum, p.funcnum);
-		p.irq = 0;
-		goto out;
-	}		
-	p.irq = dev->irq;
- out:
-	DRM_DEBUG("%d:%d:%d => IRQ %d\n",
-		  p.busnum, p.devnum, p.funcnum, p.irq);
-	if (copy_to_user((drm_irq_busid_t *)arg, &p, sizeof(p)))
-		return -EFAULT;
-	return 0;
-}
+#include <linux/pci.h>
 
 /**
  * Get the bus id.
@@ -138,8 +76,10 @@
  * \param arg user argument, pointing to a drm_unique structure.
  * \return zero on success or a negative number on failure.
  *
- * Copies the bus id from userspace into drm_device::unique, and searches for
- * the respective PCI device, updating drm_device::pdev.
+ * Copies the bus id from userspace into drm_device::unique, and verifies that
+ * it matches the device this DRM is attached to (EINVAL otherwise).  Deprecated
+ * in interface version 1.1 and will return EBUSY when setversion has requested
+ * version 1.1 or greater.
  */
 int DRM(setunique)(struct inode *inode, struct file *filp,
 		   unsigned int cmd, unsigned long arg)
@@ -147,6 +87,7 @@
 	drm_file_t	 *priv	 = filp->private_data;
 	drm_device_t	 *dev	 = priv->dev;
 	drm_unique_t	 u;
+	int		 domain, bus, slot, func, ret;
 
 	if (dev->unique_len || dev->unique) return -EBUSY;
 
@@ -164,55 +105,42 @@
 
 	dev->devname = DRM(alloc)(strlen(dev->name) + strlen(dev->unique) + 2,
 				  DRM_MEM_DRIVER);
-	if(!dev->devname) {
-		DRM(free)(dev->devname, sizeof(*dev->devname), DRM_MEM_DRIVER);
+	if (!dev->devname)
 		return -ENOMEM;
-	}
+
 	sprintf(dev->devname, "%s@%s", dev->name, dev->unique);
 
-	do {
-		struct pci_dev *pci_dev;
-                int domain, b, d, f;
-                char *p;
- 
-                for(p = dev->unique; p && *p && *p != ':'; p++);
-                if (!p || !*p) break;
-                b = (int)simple_strtoul(p+1, &p, 10);
-                if (*p != ':') break;
-                d = (int)simple_strtoul(p+1, &p, 10);
-                if (*p != ':') break;
-                f = (int)simple_strtoul(p+1, &p, 10);
-                if (*p) break;
- 
-		domain = b >> 8;
-		b &= 0xff;
-
-#ifdef __alpha__
-		/*
-		 * Find the hose the device is on (the domain number is the
-		 * hose index) and offset the bus by the root bus of that
-		 * hose.
-		 */
-                for(pci_dev = pci_find_device(PCI_ANY_ID,PCI_ANY_ID,NULL);
-                    pci_dev;
-                    pci_dev = pci_find_device(PCI_ANY_ID,PCI_ANY_ID,pci_dev)) {
-			struct pci_controller *hose = pci_dev->sysdata;
-			
-			if (hose->index == domain) {
-				b += hose->bus->number;
-				break;
-			}
-		}
-#endif
+	/* Return error if the busid submitted doesn't match the device's actual
+	 * busid.
+	 */
+	ret = sscanf(dev->unique, "PCI:%d:%d:%d", &bus, &slot, &func);
+	if (ret != 3)
+		return DRM_ERR(EINVAL);
+	domain = bus >> 8;
+	bus &= 0xff;
+	
+	if ((domain != dev->pci_domain) ||
+	    (bus != dev->pci_bus) ||
+	    (slot != dev->pci_slot) ||
+	    (func != dev->pci_func))
+		return -EINVAL;
 
-                pci_dev = pci_find_slot(b, PCI_DEVFN(d,f));
-                if (pci_dev) {
-			dev->pdev = pci_dev;
-#ifdef __alpha__
-			dev->hose = pci_dev->sysdata;
-#endif
-		}
-        } while(0);
+	return 0;
+}
+
+static int
+DRM(set_busid)(drm_device_t *dev)
+{
+	if (dev->unique != NULL)
+		return EBUSY;
+
+	dev->unique_len = 20;
+	dev->unique = DRM(alloc)(dev->unique_len + 1, DRM_MEM_DRIVER);
+	if (dev->unique == NULL)
+		return ENOMEM;
+
+	snprintf(dev->unique, dev->unique_len, "pci:%04x:%02x:%02x.%d",
+		dev->pci_domain, dev->pci_bus, dev->pci_slot, dev->pci_func);
 
 	return 0;
 }
@@ -363,3 +291,48 @@
 		return -EFAULT;
 	return 0;
 }
+
+#define DRM_IF_MAJOR	1
+#define DRM_IF_MINOR	2
+
+int DRM(setversion)(DRM_IOCTL_ARGS)
+{
+	DRM_DEVICE;
+	drm_set_version_t sv;
+	drm_set_version_t retv;
+	int if_version;
+
+	DRM_COPY_FROM_USER_IOCTL(sv, (drm_set_version_t *)data, sizeof(sv));
+
+	retv.drm_di_major = DRM_IF_MAJOR;
+	retv.drm_di_minor = DRM_IF_MINOR;
+	retv.drm_dd_major = DRIVER_MAJOR;
+	retv.drm_dd_minor = DRIVER_MINOR;
+
+	DRM_COPY_TO_USER_IOCTL((drm_set_version_t *)data, retv, sizeof(sv));
+
+	if (sv.drm_di_major != -1) {
+		if (sv.drm_di_major != DRM_IF_MAJOR ||
+		    sv.drm_di_minor < 0 || sv.drm_di_minor > DRM_IF_MINOR)
+			return EINVAL;
+		if_version = DRM_IF_VERSION(sv.drm_di_major, sv.drm_dd_minor);
+		dev->if_version = DRM_MAX(if_version, dev->if_version);
+		if (sv.drm_di_minor >= 1) {
+			/*
+			 * Version 1.1 includes tying of DRM to specific device
+			 */
+			DRM(set_busid)(dev);
+		}
+	}
+
+	if (sv.drm_dd_major != -1) {
+		if (sv.drm_dd_major != DRIVER_MAJOR ||
+		    sv.drm_dd_minor < 0 || sv.drm_dd_minor > DRIVER_MINOR)
+			return EINVAL;
+#ifdef DRIVER_SETVERSION
+		DRIVER_SETVERSION(dev, &sv);
+#endif
+	}
+	return 0;
+}
+
--- diff/drivers/char/drm/drm_os_linux.h	2003-09-30 15:46:12.000000000 +0100
+++ source/drivers/char/drm/drm_os_linux.h	2004-02-09 10:39:52.000000000 +0000
@@ -62,8 +62,12 @@
 	verify_area( VERIFY_READ, uaddr, size )
 #define DRM_COPY_FROM_USER_UNCHECKED(arg1, arg2, arg3) 	\
 	__copy_from_user(arg1, arg2, arg3)
+#define DRM_COPY_TO_USER_UNCHECKED(arg1, arg2, arg3)	\
+	__copy_to_user(arg1, arg2, arg3)
 #define DRM_GET_USER_UNCHECKED(val, uaddr)		\
 	__get_user(val, uaddr)
+#define DRM_PUT_USER_UNCHECKED(uaddr, val)		\
+	__put_user(val, uaddr)
 
 
 /** 'malloc' without the overhead of DRM(alloc)() */
@@ -71,6 +75,8 @@
 /** 'free' without the overhead of DRM(free)() */
 #define DRM_FREE(x,size) kfree(x)
 
+#define DRM_GET_PRIV_WITH_RETURN(_priv, _filp) _priv = _filp->private_data
+
 /** 
  * Get the pointer to the SAREA.
  *
--- diff/drivers/char/drm/gamma.h	2003-05-21 11:50:14.000000000 +0100
+++ source/drivers/char/drm/gamma.h	2004-02-09 10:39:52.000000000 +0000
@@ -53,6 +53,10 @@
 	[DRM_IOCTL_NR(DRM_IOCTL_GAMMA_INIT)] = { gamma_dma_init,  1, 1 }, \
 	[DRM_IOCTL_NR(DRM_IOCTL_GAMMA_COPY)] = { gamma_dma_copy,  1, 1 }
 
+#define DRIVER_PCI_IDS							\
+	{0x3d3d, 0x0008, 0, "3DLabs GLINT Gamma G1"},			\
+	{0, 0, 0, NULL}
+
 #define IOCTL_TABLE_NAME	DRM(ioctls)
 #define IOCTL_FUNC_NAME 	DRM(ioctl)
 
@@ -104,8 +108,8 @@
 	return 0;							\
 } while (0)
 
-#define __HAVE_DMA_IRQ			1
-#define __HAVE_DMA_IRQ_BH		1
+#define __HAVE_IRQ			1
+#define __HAVE_IRQ_BH			1
 
 #define DRIVER_AGP_BUFFERS_MAP( dev )					\
 	((drm_gamma_private_t *)((dev)->dev_private))->buffers
--- diff/drivers/char/drm/gamma_dma.c	2003-09-30 15:46:12.000000000 +0100
+++ source/drivers/char/drm/gamma_dma.c	2004-02-09 10:39:52.000000000 +0000
@@ -116,7 +116,7 @@
 	return (!GAMMA_READ(GAMMA_DMACOUNT));
 }
 
-irqreturn_t gamma_dma_service( DRM_IRQ_ARGS )
+irqreturn_t gamma_irq_handler( DRM_IRQ_ARGS )
 {
 	drm_device_t	 *dev = (drm_device_t *)arg;
 	drm_device_dma_t *dma = dev->dma;
@@ -262,7 +262,7 @@
 	gamma_dma_schedule((drm_device_t *)dev, 0);
 }
 
-void gamma_dma_immediate_bh(void *dev)
+void gamma_irq_immediate_bh(void *dev)
 {
 	gamma_dma_schedule(dev, 0);
 }
@@ -656,12 +656,12 @@
 {
 	DRM_DEBUG( "%s\n", __FUNCTION__ );
 
-#if _HAVE_DMA_IRQ
+#if __HAVE_IRQ
 	/* Make sure interrupts are disabled here because the uninstall ioctl
 	 * may not have been called from userspace and after dev_private
 	 * is freed, it's too late.
 	 */
-	if ( dev->irq ) DRM(irq_uninstall)(dev);
+	if ( dev->irq_enabled ) DRM(irq_uninstall)(dev);
 #endif
 
 	if ( dev->dev_private ) {
--- diff/drivers/char/drm/gamma_drv.c	2003-05-21 11:50:14.000000000 +0100
+++ source/drivers/char/drm/gamma_drv.c	2004-02-09 10:39:52.000000000 +0000
@@ -48,6 +48,7 @@
 #include "drm_fops.h"
 #include "drm_init.h"
 #include "drm_ioctl.h"
+#include "drm_irq.h"
 #include "gamma_lists.h"        /* NOTE */
 #include "drm_lock.h"
 #include "gamma_lock.h"		/* NOTE */
--- diff/drivers/char/drm/i810.h	2003-08-26 10:00:52.000000000 +0100
+++ source/drivers/char/drm/i810.h	2004-02-09 10:39:52.000000000 +0000
@@ -77,7 +77,14 @@
 	[DRM_IOCTL_NR(DRM_IOCTL_I810_MC)]      = { i810_dma_mc,     1, 1 }, \
 	[DRM_IOCTL_NR(DRM_IOCTL_I810_RSTATUS)] = { i810_rstatus,    1, 0 }, \
 	[DRM_IOCTL_NR(DRM_IOCTL_I810_FLIP)] =    { i810_flip_bufs,  1, 0 }
- 
+
+#define DRIVER_PCI_IDS							\
+	{0x8086, 0x7121, 0, "Intel i810 GMCH"},				\
+	{0x8086, 0x7123, 0, "Intel i810-DC100 GMCH"},			\
+	{0x8086, 0x7125, 0, "Intel i810E GMCH"},			\
+	{0x8086, 0x1132, 0, "Intel i815 GMCH"},				\
+	{0, 0, 0, NULL}
+
 
 #define __HAVE_COUNTERS         4
 #define __HAVE_COUNTER6         _DRM_STAT_IRQ
@@ -112,7 +119,7 @@
  * a noop stub is generated for compatibility.
  */
 /* XXX: Add vblank support? */
-#define __HAVE_DMA_IRQ		0
+#define __HAVE_IRQ		0
 
 /* Buffer customization:
  */
--- diff/drivers/char/drm/i810_dma.c	2003-09-30 15:46:12.000000000 +0100
+++ source/drivers/char/drm/i810_dma.c	2004-02-09 10:39:52.000000000 +0000
@@ -53,41 +53,41 @@
 
 static inline void i810_print_status_page(drm_device_t *dev)
 {
-   	drm_device_dma_t *dma = dev->dma;
-      	drm_i810_private_t *dev_priv = dev->dev_private;
+	drm_device_dma_t *dma = dev->dma;
+	drm_i810_private_t *dev_priv = dev->dev_private;
 	u32 *temp = dev_priv->hw_status_page;
-   	int i;
+	int i;
 
-   	DRM_DEBUG(  "hw_status: Interrupt Status : %x\n", temp[0]);
-   	DRM_DEBUG(  "hw_status: LpRing Head ptr : %x\n", temp[1]);
-   	DRM_DEBUG(  "hw_status: IRing Head ptr : %x\n", temp[2]);
-      	DRM_DEBUG(  "hw_status: Reserved : %x\n", temp[3]);
+	DRM_DEBUG(  "hw_status: Interrupt Status : %x\n", temp[0]);
+	DRM_DEBUG(  "hw_status: LpRing Head ptr : %x\n", temp[1]);
+	DRM_DEBUG(  "hw_status: IRing Head ptr : %x\n", temp[2]);
+	DRM_DEBUG(  "hw_status: Reserved : %x\n", temp[3]);
 	DRM_DEBUG(  "hw_status: Last Render: %x\n", temp[4]);
-   	DRM_DEBUG(  "hw_status: Driver Counter : %d\n", temp[5]);
-   	for(i = 6; i < dma->buf_count + 6; i++) {
-	   	DRM_DEBUG( "buffer status idx : %d used: %d\n", i - 6, temp[i]);
+	DRM_DEBUG(  "hw_status: Driver Counter : %d\n", temp[5]);
+	for(i = 6; i < dma->buf_count + 6; i++) {
+		DRM_DEBUG( "buffer status idx : %d used: %d\n", i - 6, temp[i]);
 	}
 }
 
 static drm_buf_t *i810_freelist_get(drm_device_t *dev)
 {
-   	drm_device_dma_t *dma = dev->dma;
+	drm_device_dma_t *dma = dev->dma;
 	int		 i;
-   	int 		 used;
+	int		 used;
 
 	/* Linear search might not be the best solution */
 
-   	for (i = 0; i < dma->buf_count; i++) {
-	   	drm_buf_t *buf = dma->buflist[ i ];
-	   	drm_i810_buf_priv_t *buf_priv = buf->dev_private;
+	for (i = 0; i < dma->buf_count; i++) {
+		drm_buf_t *buf = dma->buflist[ i ];
+		drm_i810_buf_priv_t *buf_priv = buf->dev_private;
 		/* In use is already a pointer */
-	   	used = cmpxchg(buf_priv->in_use, I810_BUF_FREE,
+		used = cmpxchg(buf_priv->in_use, I810_BUF_FREE,
 			       I810_BUF_CLIENT);
 		if (used == I810_BUF_FREE) {
 			return buf;
 		}
 	}
-   	return NULL;
+	return NULL;
 }
 
 /* This should only be called if the buffer is not sent to the hardware
@@ -96,17 +96,17 @@
 
 static int i810_freelist_put(drm_device_t *dev, drm_buf_t *buf)
 {
-   	drm_i810_buf_priv_t *buf_priv = buf->dev_private;
-   	int used;
+	drm_i810_buf_priv_t *buf_priv = buf->dev_private;
+	int used;
 
-   	/* In use is already a pointer */
-   	used = cmpxchg(buf_priv->in_use, I810_BUF_CLIENT, I810_BUF_FREE);
+	/* In use is already a pointer */
+	used = cmpxchg(buf_priv->in_use, I810_BUF_CLIENT, I810_BUF_FREE);
 	if (used != I810_BUF_CLIENT) {
-	   	DRM_ERROR("Freeing buffer thats not in use : %d\n", buf->idx);
-	   	return -EINVAL;
+		DRM_ERROR("Freeing buffer thats not in use : %d\n", buf->idx);
+		return -EINVAL;
 	}
 
-   	return 0;
+	return 0;
 }
 
 static struct file_operations i810_buffer_fops = {
@@ -135,7 +135,7 @@
 	vma->vm_flags |= (VM_IO | VM_DONTCOPY);
 	vma->vm_file = filp;
 
-   	buf_priv->currently_mapped = I810_BUF_MAPPED;
+	buf_priv->currently_mapped = I810_BUF_MAPPED;
 	unlock_kernel();
 
 	if (remap_page_range(DRM_RPR_ARG(vma) vma->vm_start,
@@ -150,8 +150,8 @@
 	drm_file_t	  *priv	  = filp->private_data;
 	drm_device_t	  *dev	  = priv->dev;
 	drm_i810_buf_priv_t *buf_priv = buf->dev_private;
-      	drm_i810_private_t *dev_priv = dev->dev_private;
-   	struct file_operations *old_fops;
+	drm_i810_private_t *dev_priv = dev->dev_private;
+	struct file_operations *old_fops;
 	int retcode = 0;
 
 	if (buf_priv->currently_mapped == I810_BUF_MAPPED) 
@@ -192,8 +192,8 @@
 			    (size_t) buf->total);
 	up_write(&current->mm->mmap_sem);
 
-   	buf_priv->currently_mapped = I810_BUF_UNMAPPED;
-   	buf_priv->virtual = 0;
+	buf_priv->currently_mapped = I810_BUF_UNMAPPED;
+	buf_priv->virtual = 0;
 
 	return retcode;
 }
@@ -208,22 +208,22 @@
 	buf = i810_freelist_get(dev);
 	if (!buf) {
 		retcode = -ENOMEM;
-	   	DRM_DEBUG("retcode=%d\n", retcode);
+		DRM_DEBUG("retcode=%d\n", retcode);
 		return retcode;
 	}
 
 	retcode = i810_map_buffer(buf, filp);
 	if (retcode) {
 		i810_freelist_put(dev, buf);
-	   	DRM_ERROR("mapbuf failed, retcode %d\n", retcode);
+		DRM_ERROR("mapbuf failed, retcode %d\n", retcode);
 		return retcode;
 	}
 	buf->filp = filp;
 	buf_priv = buf->dev_private;
 	d->granted = 1;
-   	d->request_idx = buf->idx;
-   	d->request_size = buf->total;
-   	d->virtual = buf_priv->virtual;
+	d->request_idx = buf->idx;
+	d->request_size = buf->total;
+	d->virtual = buf_priv->virtual;
 
 	return retcode;
 }
@@ -232,33 +232,33 @@
 {
 	drm_device_dma_t *dma = dev->dma;
 
-#if _HAVE_DMA_IRQ
+#if __HAVE_IRQ
 	/* Make sure interrupts are disabled here because the uninstall ioctl
 	 * may not have been called from userspace and after dev_private
 	 * is freed, it's too late.
 	 */
-	if (dev->irq) DRM(irq_uninstall)(dev);
+	if (dev->irq_enabled) DRM(irq_uninstall)(dev);
 #endif
 
 	if (dev->dev_private) {
 		int i;
-	   	drm_i810_private_t *dev_priv =
-	     		(drm_i810_private_t *) dev->dev_private;
+		drm_i810_private_t *dev_priv =
+			(drm_i810_private_t *) dev->dev_private;
 
 		if (dev_priv->ring.virtual_start) {
-		   	DRM(ioremapfree)((void *) dev_priv->ring.virtual_start,
+			DRM(ioremapfree)((void *) dev_priv->ring.virtual_start,
 					 dev_priv->ring.Size, dev);
 		}
-	   	if (dev_priv->hw_status_page) {
-		   	pci_free_consistent(dev->pdev, PAGE_SIZE,
+		if (dev_priv->hw_status_page) {
+			pci_free_consistent(dev->pdev, PAGE_SIZE,
 					    dev_priv->hw_status_page,
 					    dev_priv->dma_status_page);
-		   	/* Need to rewrite hardware status page */
-		   	I810_WRITE(0x02080, 0x1ffff000);
+			/* Need to rewrite hardware status page */
+			I810_WRITE(0x02080, 0x1ffff000);
 		}
-	   	DRM(free)(dev->dev_private, sizeof(drm_i810_private_t),
+		DRM(free)(dev->dev_private, sizeof(drm_i810_private_t),
 			 DRM_MEM_DRIVER);
-	   	dev->dev_private = NULL;
+		dev->dev_private = NULL;
 
 		for (i = 0; i < dma->buf_count; i++) {
 			drm_buf_t *buf = dma->buflist[ i ];
@@ -267,73 +267,73 @@
 				DRM(ioremapfree)(buf_priv->kernel_virtual, buf->total, dev);
 		}
 	}
-   	return 0;
+	return 0;
 }
 
 static int i810_wait_ring(drm_device_t *dev, int n)
 {
-   	drm_i810_private_t *dev_priv = dev->dev_private;
-   	drm_i810_ring_buffer_t *ring = &(dev_priv->ring);
-   	int iters = 0;
-   	unsigned long end;
+	drm_i810_private_t *dev_priv = dev->dev_private;
+	drm_i810_ring_buffer_t *ring = &(dev_priv->ring);
+	int iters = 0;
+	unsigned long end;
 	unsigned int last_head = I810_READ(LP_RING + RING_HEAD) & HEAD_ADDR;
 
 	end = jiffies + (HZ*3);
-   	while (ring->space < n) {
-	   	ring->head = I810_READ(LP_RING + RING_HEAD) & HEAD_ADDR;
-	   	ring->space = ring->head - (ring->tail+8);
+	while (ring->space < n) {
+		ring->head = I810_READ(LP_RING + RING_HEAD) & HEAD_ADDR;
+		ring->space = ring->head - (ring->tail+8);
 		if (ring->space < 0) ring->space += ring->Size;
-	   
+
 		if (ring->head != last_head) {
 			end = jiffies + (HZ*3);
 			last_head = ring->head;
 		}
 	  
-	   	iters++;
+		iters++;
 		if (time_before(end, jiffies)) {
-		   	DRM_ERROR("space: %d wanted %d\n", ring->space, n);
-		   	DRM_ERROR("lockup\n");
-		   	goto out_wait_ring;
+			DRM_ERROR("space: %d wanted %d\n", ring->space, n);
+			DRM_ERROR("lockup\n");
+			goto out_wait_ring;
 		}
 		udelay(1);
 	}
 
 out_wait_ring:
-   	return iters;
+	return iters;
 }
 
 static void i810_kernel_lost_context(drm_device_t *dev)
 {
-      	drm_i810_private_t *dev_priv = dev->dev_private;
-   	drm_i810_ring_buffer_t *ring = &(dev_priv->ring);
+	drm_i810_private_t *dev_priv = dev->dev_private;
+	drm_i810_ring_buffer_t *ring = &(dev_priv->ring);
 
-   	ring->head = I810_READ(LP_RING + RING_HEAD) & HEAD_ADDR;
-     	ring->tail = I810_READ(LP_RING + RING_TAIL);
-     	ring->space = ring->head - (ring->tail+8);
-     	if (ring->space < 0) ring->space += ring->Size;
+	ring->head = I810_READ(LP_RING + RING_HEAD) & HEAD_ADDR;
+	ring->tail = I810_READ(LP_RING + RING_TAIL);
+	ring->space = ring->head - (ring->tail+8);
+	if (ring->space < 0) ring->space += ring->Size;
 }
 
 static int i810_freelist_init(drm_device_t *dev, drm_i810_private_t *dev_priv)
 {
-      	drm_device_dma_t *dma = dev->dma;
-   	int my_idx = 24;
-   	u32 *hw_status = (u32 *)(dev_priv->hw_status_page + my_idx);
-   	int i;
+	drm_device_dma_t *dma = dev->dma;
+	int my_idx = 24;
+	u32 *hw_status = (u32 *)(dev_priv->hw_status_page + my_idx);
+	int i;
 
 	if (dma->buf_count > 1019) {
-	   	/* Not enough space in the status page for the freelist */
-	   	return -EINVAL;
+		/* Not enough space in the status page for the freelist */
+		return -EINVAL;
 	}
 
-   	for (i = 0; i < dma->buf_count; i++) {
-	   	drm_buf_t *buf = dma->buflist[ i ];
-	   	drm_i810_buf_priv_t *buf_priv = buf->dev_private;
+	for (i = 0; i < dma->buf_count; i++) {
+		drm_buf_t *buf = dma->buflist[ i ];
+		drm_i810_buf_priv_t *buf_priv = buf->dev_private;
 
-	   	buf_priv->in_use = hw_status++;
-	   	buf_priv->my_use_idx = my_idx;
-	   	my_idx += 4;
+		buf_priv->in_use = hw_status++;
+		buf_priv->my_use_idx = my_idx;
+		my_idx += 4;
 
-	   	*buf_priv->in_use = I810_BUF_FREE;
+		*buf_priv->in_use = I810_BUF_FREE;
 
 		buf_priv->kernel_virtual = DRM(ioremap)(buf->bus_address,
 							buf->total, dev);
@@ -347,7 +347,7 @@
 {
 	struct list_head *list;
 
-   	memset(dev_priv, 0, sizeof(drm_i810_private_t));
+	memset(dev_priv, 0, sizeof(drm_i810_private_t));
 
 	list_for_each(list, &dev->maplist->head) {
 		drm_map_list_t *r_list = list_entry(list, drm_map_list_t, head);
@@ -355,51 +355,51 @@
 		    r_list->map->type == _DRM_SHM &&
 		    r_list->map->flags & _DRM_CONTAINS_LOCK ) {
 			dev_priv->sarea_map = r_list->map;
- 			break;
- 		}
- 	}
+			break;
+		}
+	}
 	if (!dev_priv->sarea_map) {
 		dev->dev_private = (void *)dev_priv;
-	   	i810_dma_cleanup(dev);
-	   	DRM_ERROR("can not find sarea!\n");
-	   	return -EINVAL;
+		i810_dma_cleanup(dev);
+		DRM_ERROR("can not find sarea!\n");
+		return -EINVAL;
 	}
 	DRM_FIND_MAP( dev_priv->mmio_map, init->mmio_offset );
 	if (!dev_priv->mmio_map) {
 		dev->dev_private = (void *)dev_priv;
-	   	i810_dma_cleanup(dev);
-	   	DRM_ERROR("can not find mmio map!\n");
-	   	return -EINVAL;
+		i810_dma_cleanup(dev);
+		DRM_ERROR("can not find mmio map!\n");
+		return -EINVAL;
 	}
 	DRM_FIND_MAP( dev_priv->buffer_map, init->buffers_offset );
 	if (!dev_priv->buffer_map) {
 		dev->dev_private = (void *)dev_priv;
-	   	i810_dma_cleanup(dev);
-	   	DRM_ERROR("can not find dma buffer map!\n");
-	   	return -EINVAL;
+		i810_dma_cleanup(dev);
+		DRM_ERROR("can not find dma buffer map!\n");
+		return -EINVAL;
 	}
 
 	dev_priv->sarea_priv = (drm_i810_sarea_t *)
 		((u8 *)dev_priv->sarea_map->handle +
 		 init->sarea_priv_offset);
 
-   	dev_priv->ring.Start = init->ring_start;
-   	dev_priv->ring.End = init->ring_end;
-   	dev_priv->ring.Size = init->ring_size;
+	dev_priv->ring.Start = init->ring_start;
+	dev_priv->ring.End = init->ring_end;
+	dev_priv->ring.Size = init->ring_size;
 
-   	dev_priv->ring.virtual_start = DRM(ioremap)(dev->agp->base +
+	dev_priv->ring.virtual_start = DRM(ioremap)(dev->agp->base +
 						    init->ring_start,
 						    init->ring_size, dev);
 
-   	if (dev_priv->ring.virtual_start == NULL) {
+	if (dev_priv->ring.virtual_start == NULL) {
 		dev->dev_private = (void *) dev_priv;
-	   	i810_dma_cleanup(dev);
-	   	DRM_ERROR("can not ioremap virtual address for"
+		i810_dma_cleanup(dev);
+		DRM_ERROR("can not ioremap virtual address for"
 			  " ring buffer\n");
-	   	return -ENOMEM;
+		return -ENOMEM;
 	}
 
-   	dev_priv->ring.tail_mask = dev_priv->ring.Size - 1;
+	dev_priv->ring.tail_mask = dev_priv->ring.Size - 1;
 
 	dev_priv->w = init->w;
 	dev_priv->h = init->h;
@@ -415,33 +415,33 @@
 	dev_priv->back_di1 = init->back_offset | init->pitch_bits;
 	dev_priv->zi1 = init->depth_offset | init->pitch_bits;
 
-   	/* Program Hardware Status Page */
-   	dev_priv->hw_status_page =
+	/* Program Hardware Status Page */
+	dev_priv->hw_status_page =
 		pci_alloc_consistent(dev->pdev, PAGE_SIZE,
 						&dev_priv->dma_status_page);
-   	if (!dev_priv->hw_status_page) {
+	if (!dev_priv->hw_status_page) {
 		dev->dev_private = (void *)dev_priv;
 		i810_dma_cleanup(dev);
 		DRM_ERROR("Can not allocate hardware status page\n");
 		return -ENOMEM;
 	}
-   	memset(dev_priv->hw_status_page, 0, PAGE_SIZE);
-   	DRM_DEBUG("hw status page @ %p\n", dev_priv->hw_status_page);
+	memset(dev_priv->hw_status_page, 0, PAGE_SIZE);
+	DRM_DEBUG("hw status page @ %p\n", dev_priv->hw_status_page);
 
 	I810_WRITE(0x02080, dev_priv->dma_status_page);
-   	DRM_DEBUG("Enabled hardware status page\n");
+	DRM_DEBUG("Enabled hardware status page\n");
 
-   	/* Now we need to init our freelist */
+	/* Now we need to init our freelist */
 	if (i810_freelist_init(dev, dev_priv) != 0) {
 		dev->dev_private = (void *)dev_priv;
-	   	i810_dma_cleanup(dev);
-	   	DRM_ERROR("Not enough space in the status page for"
+		i810_dma_cleanup(dev);
+		DRM_ERROR("Not enough space in the status page for"
 			  " the freelist\n");
-	   	return -ENOMEM;
+		return -ENOMEM;
 	}
 	dev->dev_private = (void *)dev_priv;
 
-   	return 0;
+	return 0;
 }
 
 /* i810 DRM version 1.1 used a smaller init structure with different
@@ -476,12 +476,12 @@
 
 		/* This is a v1.1 client, fix the params */
 		DRM_INFO("Using PRE v1.2 init.\n");
-	 	init->pitch_bits = init->h;
-	 	init->pitch = init->w;
-	 	init->h = init->overlay_physical;
-	 	init->w = init->overlay_offset;
-	 	init->overlay_physical = 0;
-	 	init->overlay_offset = 0;
+		init->pitch_bits = init->h;
+		init->pitch = init->w;
+		init->h = init->overlay_physical;
+		init->w = init->overlay_offset;
+		init->overlay_physical = 0;
+		init->overlay_offset = 0;
 	}
 
 	return 0;
@@ -490,55 +490,55 @@
 int i810_dma_init(struct inode *inode, struct file *filp,
 		  unsigned int cmd, unsigned long arg)
 {
-   	drm_file_t *priv = filp->private_data;
-   	drm_device_t *dev = priv->dev;
-   	drm_i810_private_t *dev_priv;
-   	drm_i810_init_t init;
-   	int retcode = 0;
+	drm_file_t *priv = filp->private_data;
+	drm_device_t *dev = priv->dev;
+	drm_i810_private_t *dev_priv;
+	drm_i810_init_t init;
+	int retcode = 0;
 
 	/* Get only the init func */
 	if (copy_from_user(&init, (void *)arg, sizeof(drm_i810_init_func_t))) 
 		return -EFAULT;
 
-   	switch(init.func) {
-	 	case I810_INIT_DMA:
-	 	       	/* This case is for backward compatibility. It
+	switch(init.func) {
+		case I810_INIT_DMA:
+			/* This case is for backward compatibility. It
 			 * handles XFree 4.1.0 and 4.2.0, and has to
 			 * do some parameter checking as described below.
 			 * It will someday go away.
 			 */
 			retcode = i810_dma_init_compat(&init, arg);
-			if (retcode)
+			if (retcode) 
 				return retcode;
 
-	   		dev_priv = DRM(alloc)(sizeof(drm_i810_private_t),
+			dev_priv = DRM(alloc)(sizeof(drm_i810_private_t),
 					     DRM_MEM_DRIVER);
-	   		if (dev_priv == NULL)
-				return -ENOMEM;
-	   		retcode = i810_dma_initialize(dev, dev_priv, &init);
+			if (dev_priv == NULL)
+			       return -ENOMEM;
+			retcode = i810_dma_initialize(dev, dev_priv, &init);
 			break;
 
 		default:
-	 	case I810_INIT_DMA_1_4:
+		case I810_INIT_DMA_1_4:
 			DRM_INFO("Using v1.4 init.\n");
-  			if (copy_from_user(&init, (drm_i810_init_t *)arg,
+			if (copy_from_user(&init, (drm_i810_init_t *)arg,
 					  sizeof(drm_i810_init_t))) {
 				return -EFAULT;
 			}
-	   		dev_priv = DRM(alloc)(sizeof(drm_i810_private_t),
+			dev_priv = DRM(alloc)(sizeof(drm_i810_private_t),
 					     DRM_MEM_DRIVER);
 			if (dev_priv == NULL) 
 				return -ENOMEM;
-	   		retcode = i810_dma_initialize(dev, dev_priv, &init);
+			retcode = i810_dma_initialize(dev, dev_priv, &init);
 			break;
 
-	 	case I810_CLEANUP_DMA:
-		        DRM_INFO("DMA Cleanup\n");
-	   		retcode = i810_dma_cleanup(dev);
-              	   	break;
+		case I810_CLEANUP_DMA:
+			DRM_INFO("DMA Cleanup\n");
+			retcode = i810_dma_cleanup(dev);
+			break;
 	}
 
-   	return retcode;
+	return retcode;
 }
 
 
@@ -552,7 +552,7 @@
 static void i810EmitContextVerified( drm_device_t *dev,
 				     volatile unsigned int *code )
 {
-   	drm_i810_private_t *dev_priv = dev->dev_private;
+	drm_i810_private_t *dev_priv = dev->dev_private;
 	int i, j = 0;
 	unsigned int tmp;
 	RING_LOCALS;
@@ -586,7 +586,7 @@
 static void i810EmitTexVerified( drm_device_t *dev,
 				 volatile unsigned int *code )
 {
-   	drm_i810_private_t *dev_priv = dev->dev_private;
+	drm_i810_private_t *dev_priv = dev->dev_private;
 	int i, j = 0;
 	unsigned int tmp;
 	RING_LOCALS;
@@ -622,7 +622,7 @@
 static void i810EmitDestVerified( drm_device_t *dev,
 				  volatile unsigned int *code )
 {
-   	drm_i810_private_t *dev_priv = dev->dev_private;
+	drm_i810_private_t *dev_priv = dev->dev_private;
 	unsigned int tmp;
 	RING_LOCALS;
 
@@ -658,8 +658,8 @@
 
 static void i810EmitState( drm_device_t *dev )
 {
-   	drm_i810_private_t *dev_priv = dev->dev_private;
-      	drm_i810_sarea_t *sarea_priv = dev_priv->sarea_priv;
+	drm_i810_private_t *dev_priv = dev->dev_private;
+	drm_i810_sarea_t *sarea_priv = dev_priv->sarea_priv;
 	unsigned int dirty = sarea_priv->dirty;
 	
 	DRM_DEBUG("%s %x\n", __FUNCTION__, dirty);
@@ -693,8 +693,8 @@
 				     unsigned int clear_color,
 				     unsigned int clear_zval )
 {
-   	drm_i810_private_t *dev_priv = dev->dev_private;
-      	drm_i810_sarea_t *sarea_priv = dev_priv->sarea_priv;
+	drm_i810_private_t *dev_priv = dev->dev_private;
+	drm_i810_sarea_t *sarea_priv = dev_priv->sarea_priv;
 	int nbox = sarea_priv->nbox;
 	drm_clip_rect_t *pbox = sarea_priv->boxes;
 	int pitch = dev_priv->pitch;
@@ -703,17 +703,17 @@
 	RING_LOCALS;
 	
 	if ( dev_priv->current_page == 1 ) {
-	        unsigned int tmp = flags;
-	       
+		unsigned int tmp = flags;
+
 		flags &= ~(I810_FRONT | I810_BACK);
 		if (tmp & I810_FRONT) flags |= I810_BACK;
 		if (tmp & I810_BACK) flags |= I810_FRONT;
 	}
 
-  	i810_kernel_lost_context(dev);
+	i810_kernel_lost_context(dev);
 
-      	if (nbox > I810_NR_SAREA_CLIPRECTS)
-     		nbox = I810_NR_SAREA_CLIPRECTS;
+	if (nbox > I810_NR_SAREA_CLIPRECTS)
+		nbox = I810_NR_SAREA_CLIPRECTS;
 
 	for (i = 0 ; i < nbox ; i++, pbox++) {
 		unsigned int x = pbox->x1;
@@ -728,7 +728,7 @@
 		    pbox->y2 > dev_priv->h)
 			continue;
 
-	   	if ( flags & I810_FRONT ) {
+		if ( flags & I810_FRONT ) {
 			BEGIN_LP_RING( 6 );
 			OUT_RING( BR00_BITBLT_CLIENT |
 				  BR00_OP_COLOR_BLT | 0x3 );
@@ -768,8 +768,8 @@
 
 static void i810_dma_dispatch_swap( drm_device_t *dev )
 {
-   	drm_i810_private_t *dev_priv = dev->dev_private;
-      	drm_i810_sarea_t *sarea_priv = dev_priv->sarea_priv;
+	drm_i810_private_t *dev_priv = dev->dev_private;
+	drm_i810_sarea_t *sarea_priv = dev_priv->sarea_priv;
 	int nbox = sarea_priv->nbox;
 	drm_clip_rect_t *pbox = sarea_priv->boxes;
 	int pitch = dev_priv->pitch;
@@ -779,10 +779,10 @@
 
 	DRM_DEBUG("swapbuffers\n");
 
-  	i810_kernel_lost_context(dev);
+	i810_kernel_lost_context(dev);
 
-      	if (nbox > I810_NR_SAREA_CLIPRECTS)
-     		nbox = I810_NR_SAREA_CLIPRECTS;
+	if (nbox > I810_NR_SAREA_CLIPRECTS)
+		nbox = I810_NR_SAREA_CLIPRECTS;
 
 	for (i = 0 ; i < nbox; i++, pbox++)
 	{
@@ -820,19 +820,19 @@
 				     int discard,
 				     int used)
 {
-   	drm_i810_private_t *dev_priv = dev->dev_private;
+	drm_i810_private_t *dev_priv = dev->dev_private;
 	drm_i810_buf_priv_t *buf_priv = buf->dev_private;
-   	drm_i810_sarea_t *sarea_priv = dev_priv->sarea_priv;
-   	drm_clip_rect_t *box = sarea_priv->boxes;
-   	int nbox = sarea_priv->nbox;
+	drm_i810_sarea_t *sarea_priv = dev_priv->sarea_priv;
+	drm_clip_rect_t *box = sarea_priv->boxes;
+	int nbox = sarea_priv->nbox;
 	unsigned long address = (unsigned long)buf->bus_address;
 	unsigned long start = address - dev->agp->base;
 	int i = 0;
-   	RING_LOCALS;
+	RING_LOCALS;
 
-   	i810_kernel_lost_context(dev);
+	i810_kernel_lost_context(dev);
 
-   	if (nbox > I810_NR_SAREA_CLIPRECTS)
+	if (nbox > I810_NR_SAREA_CLIPRECTS)
 		nbox = I810_NR_SAREA_CLIPRECTS;
 
 	if (used > 4*1024)
@@ -898,7 +898,7 @@
 
 static void i810_dma_dispatch_flip( drm_device_t *dev )
 {
-        drm_i810_private_t *dev_priv = dev->dev_private;
+	drm_i810_private_t *dev_priv = dev->dev_private;
 	int pitch = dev_priv->pitch;
 	RING_LOCALS;
 
@@ -907,10 +907,10 @@
 		dev_priv->current_page,
 		dev_priv->sarea_priv->pf_current_page);
 	
-        i810_kernel_lost_context(dev);
+	i810_kernel_lost_context(dev);
 
 	BEGIN_LP_RING( 2 );
-   	OUT_RING( INST_PARSER_CLIENT | INST_OP_FLUSH | INST_FLUSH_MAP_CACHE ); 
+	OUT_RING( INST_PARSER_CLIENT | INST_OP_FLUSH | INST_FLUSH_MAP_CACHE ); 
 	OUT_RING( 0 );
 	ADVANCE_LP_RING();
 
@@ -945,44 +945,44 @@
 
 void i810_dma_quiescent(drm_device_t *dev)
 {
-      	drm_i810_private_t *dev_priv = dev->dev_private;
-   	RING_LOCALS;
+	drm_i810_private_t *dev_priv = dev->dev_private;
+	RING_LOCALS;
 
-/*  	printk("%s\n", __FUNCTION__); */
+/*	printk("%s\n", __FUNCTION__); */
 
-  	i810_kernel_lost_context(dev);
+	i810_kernel_lost_context(dev);
 
-   	BEGIN_LP_RING(4);
-   	OUT_RING( INST_PARSER_CLIENT | INST_OP_FLUSH | INST_FLUSH_MAP_CACHE );
-   	OUT_RING( CMD_REPORT_HEAD );
-      	OUT_RING( 0 );
-      	OUT_RING( 0 );
-   	ADVANCE_LP_RING();
+	BEGIN_LP_RING(4);
+	OUT_RING( INST_PARSER_CLIENT | INST_OP_FLUSH | INST_FLUSH_MAP_CACHE );
+	OUT_RING( CMD_REPORT_HEAD );
+	OUT_RING( 0 );
+	OUT_RING( 0 );
+	ADVANCE_LP_RING();
 
 	i810_wait_ring( dev, dev_priv->ring.Size - 8 );
 }
 
 static int i810_flush_queue(drm_device_t *dev)
 {
-   	drm_i810_private_t *dev_priv = dev->dev_private;
+	drm_i810_private_t *dev_priv = dev->dev_private;
 	drm_device_dma_t *dma = dev->dma;
-   	int i, ret = 0;
-   	RING_LOCALS;
+	int i, ret = 0;
+	RING_LOCALS;
 	
-/*  	printk("%s\n", __FUNCTION__); */
+/*	printk("%s\n", __FUNCTION__); */
 
-   	i810_kernel_lost_context(dev);
+	i810_kernel_lost_context(dev);
 
-   	BEGIN_LP_RING(2);
-      	OUT_RING( CMD_REPORT_HEAD );
-      	OUT_RING( 0 );
-      	ADVANCE_LP_RING();
+	BEGIN_LP_RING(2);
+	OUT_RING( CMD_REPORT_HEAD );
+	OUT_RING( 0 );
+	ADVANCE_LP_RING();
 
 	i810_wait_ring( dev, dev_priv->ring.Size - 8 );
 
-   	for (i = 0; i < dma->buf_count; i++) {
-	   	drm_buf_t *buf = dma->buflist[ i ];
-	   	drm_i810_buf_priv_t *buf_priv = buf->dev_private;
+	for (i = 0; i < dma->buf_count; i++) {
+		drm_buf_t *buf = dma->buflist[ i ];
+		drm_i810_buf_priv_t *buf_priv = buf->dev_private;
 
 		int used = cmpxchg(buf_priv->in_use, I810_BUF_HARDWARE,
 				   I810_BUF_FREE);
@@ -993,7 +993,7 @@
 			DRM_DEBUG("still on client\n");
 	}
 
-   	return ret;
+	return ret;
 }
 
 /* Must be called with the lock held */
@@ -1005,14 +1005,14 @@
 	int		 i;
 
 	if (!dma) return;
-      	if (!dev->dev_private) return;
+	if (!dev->dev_private) return;
 	if (!dma->buflist) return;
 
-        i810_flush_queue(dev);
+	i810_flush_queue(dev);
 
 	for (i = 0; i < dma->buf_count; i++) {
-	   	drm_buf_t *buf = dma->buflist[ i ];
-	   	drm_i810_buf_priv_t *buf_priv = buf->dev_private;
+		drm_buf_t *buf = dma->buflist[ i ];
+		drm_i810_buf_priv_t *buf_priv = buf->dev_private;
 
 		if (buf->filp == filp && buf_priv) {
 			int used = cmpxchg(buf_priv->in_use, I810_BUF_CLIENT,
@@ -1021,7 +1021,7 @@
 			if (used == I810_BUF_CLIENT)
 				DRM_DEBUG("reclaimed from client\n");
 			if (buf_priv->currently_mapped == I810_BUF_MAPPED)
-		     		buf_priv->currently_mapped = I810_BUF_UNMAPPED;
+				buf_priv->currently_mapped = I810_BUF_UNMAPPED;
 		}
 	}
 }
@@ -1029,16 +1029,16 @@
 int i810_flush_ioctl(struct inode *inode, struct file *filp,
 		     unsigned int cmd, unsigned long arg)
 {
-   	drm_file_t	  *priv	  = filp->private_data;
-   	drm_device_t	  *dev	  = priv->dev;
+	drm_file_t	  *priv	  = filp->private_data;
+	drm_device_t	  *dev	  = priv->dev;
 
 	if (!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) {
 		DRM_ERROR("i810_flush_ioctl called without lock held\n");
 		return -EINVAL;
 	}
 
-   	i810_flush_queue(dev);
-   	return 0;
+	i810_flush_queue(dev);
+	return 0;
 }
 
 
@@ -1048,10 +1048,10 @@
 	drm_file_t *priv = filp->private_data;
 	drm_device_t *dev = priv->dev;
 	drm_device_dma_t *dma = dev->dma;
-   	drm_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private;
-      	u32 *hw_status = dev_priv->hw_status_page;
-   	drm_i810_sarea_t *sarea_priv = (drm_i810_sarea_t *)
-     					dev_priv->sarea_priv;
+	drm_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private;
+	u32 *hw_status = dev_priv->hw_status_page;
+	drm_i810_sarea_t *sarea_priv = (drm_i810_sarea_t *)
+					dev_priv->sarea_priv;
 	drm_i810_vertex_t vertex;
 
 	if (copy_from_user(&vertex, (drm_i810_vertex_t *)arg, sizeof(vertex)))
@@ -1072,10 +1072,10 @@
 				  dma->buflist[ vertex.idx ],
 				  vertex.discard, vertex.used );
 
-   	atomic_add(vertex.used, &dev->counts[_DRM_STAT_SECONDARY]);
+	atomic_add(vertex.used, &dev->counts[_DRM_STAT_SECONDARY]);
 	atomic_inc(&dev->counts[_DRM_STAT_DMA]);
 	sarea_priv->last_enqueue = dev_priv->counter-1;
-   	sarea_priv->last_dispatch = (int) hw_status[5];
+	sarea_priv->last_dispatch = (int) hw_status[5];
 
 	return 0;
 }
@@ -1089,7 +1089,7 @@
 	drm_device_t *dev = priv->dev;
 	drm_i810_clear_t clear;
 
-   	if (copy_from_user(&clear, (drm_i810_clear_t *)arg, sizeof(clear)))
+	if (copy_from_user(&clear, (drm_i810_clear_t *)arg, sizeof(clear)))
 		return -EFAULT;
 
 	if (!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) {
@@ -1097,15 +1097,15 @@
 		return -EINVAL;
 	}
 
- 	/* GH: Someone's doing nasty things... */
- 	if (!dev->dev_private) {
- 		return -EINVAL;
- 	}
+	/* GH: Someone's doing nasty things... */
+	if (!dev->dev_private) {
+		return -EINVAL;
+	}
 
 	i810_dma_dispatch_clear( dev, clear.flags,
 				 clear.clear_color,
 				 clear.clear_depth );
-   	return 0;
+	return 0;
 }
 
 int i810_swap_bufs(struct inode *inode, struct file *filp,
@@ -1122,20 +1122,20 @@
 	}
 
 	i810_dma_dispatch_swap( dev );
-   	return 0;
+	return 0;
 }
 
 int i810_getage(struct inode *inode, struct file *filp, unsigned int cmd,
 		unsigned long arg)
 {
-   	drm_file_t	  *priv	    = filp->private_data;
+	drm_file_t	  *priv	    = filp->private_data;
 	drm_device_t	  *dev	    = priv->dev;
-   	drm_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private;
-      	u32 *hw_status = dev_priv->hw_status_page;
-   	drm_i810_sarea_t *sarea_priv = (drm_i810_sarea_t *)
-     					dev_priv->sarea_priv;
+	drm_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private;
+	u32 *hw_status = dev_priv->hw_status_page;
+	drm_i810_sarea_t *sarea_priv = (drm_i810_sarea_t *)
+					dev_priv->sarea_priv;
 
-      	sarea_priv->last_dispatch = (int) hw_status[5];
+	sarea_priv->last_dispatch = (int) hw_status[5];
 	return 0;
 }
 
@@ -1146,12 +1146,12 @@
 	drm_device_t	  *dev	    = priv->dev;
 	int		  retcode   = 0;
 	drm_i810_dma_t	  d;
-   	drm_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private;
-   	u32 *hw_status = dev_priv->hw_status_page;
-   	drm_i810_sarea_t *sarea_priv = (drm_i810_sarea_t *)
-     					dev_priv->sarea_priv;
+	drm_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private;
+	u32 *hw_status = dev_priv->hw_status_page;
+	drm_i810_sarea_t *sarea_priv = (drm_i810_sarea_t *)
+					dev_priv->sarea_priv;
 
-   	if (copy_from_user(&d, (drm_i810_dma_t *)arg, sizeof(d)))
+	if (copy_from_user(&d, (drm_i810_dma_t *)arg, sizeof(d)))
 		return -EFAULT;
 
 	if (!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) {
@@ -1168,7 +1168,7 @@
 
 	if (copy_to_user((drm_dma_t *)arg, &d, sizeof(d)))
 		return -EFAULT;
-   	sarea_priv->last_dispatch = (int) hw_status[5];
+	sarea_priv->last_dispatch = (int) hw_status[5];
 
 	return retcode;
 }
@@ -1384,5 +1384,5 @@
 		i810_do_init_pageflip( dev );
 
 	i810_dma_dispatch_flip( dev );
-   	return 0;
+	return 0;
 }
--- diff/drivers/char/drm/i830.h	2003-05-21 11:50:14.000000000 +0100
+++ source/drivers/char/drm/i830.h	2004-02-09 10:39:52.000000000 +0000
@@ -77,6 +77,13 @@
 	[DRM_IOCTL_NR(DRM_IOCTL_I830_GETPARAM)] = { i830_getparam,  1, 0 }, \
 	[DRM_IOCTL_NR(DRM_IOCTL_I830_SETPARAM)] = { i830_setparam,  1, 0 } 
 
+#define DRIVER_PCI_IDS							\
+	{0x8086, 0x3577, 0, "Intel i830M GMCH"},			\
+	{0x8086, 0x2562, 0, "Intel i845G GMCH"},			\
+	{0x8086, 0x3582, 0, "Intel i852GM/i855GM GMCH"},		\
+ 	{0x8086, 0x2572, 0, "Intel i865G GMCH"}, 		\
+	{0, 0, 0, NULL}
+
 #define __HAVE_COUNTERS         4
 #define __HAVE_COUNTER6         _DRM_STAT_IRQ
 #define __HAVE_COUNTER7         _DRM_STAT_PRIMARY
@@ -115,10 +122,10 @@
 #define USE_IRQS 0
 
 #if USE_IRQS
-#define __HAVE_DMA_IRQ		1
+#define __HAVE_IRQ		1
 #define __HAVE_SHARED_IRQ	1
 #else
-#define __HAVE_DMA_IRQ          0
+#define __HAVE_IRQ		0
 #endif
 
 
--- diff/drivers/char/drm/i830_dma.c	2003-06-09 14:18:18.000000000 +0100
+++ source/drivers/char/drm/i830_dma.c	2004-02-09 10:39:52.000000000 +0000
@@ -231,12 +231,12 @@
 {
 	drm_device_dma_t *dma = dev->dma;
 
-#if _HAVE_DMA_IRQ
+#if __HAVE_IRQ
 	/* Make sure interrupts are disabled here because the uninstall ioctl
 	 * may not have been called from userspace and after dev_private
 	 * is freed, it's too late.
 	 */
-	if (dev->irq) DRM(irq_uninstall)(dev);
+	if (dev->irq_enabled) DRM(irq_uninstall)(dev);
 #endif
 
 	if (dev->dev_private) {
@@ -1539,7 +1539,7 @@
 
 	switch( param.param ) {
 	case I830_PARAM_IRQ_ACTIVE:
-		value = dev->irq ? 1 : 0;
+		value = dev->irq_enabled;
 		break;
 	default:
 		return -EINVAL;
--- diff/drivers/char/drm/i830_drv.c	2003-05-21 11:50:14.000000000 +0100
+++ source/drivers/char/drm/i830_drv.c	2004-02-09 10:39:52.000000000 +0000
@@ -50,6 +50,7 @@
 #include "drm_fops.h"
 #include "drm_init.h"
 #include "drm_ioctl.h"
+#include "drm_irq.h"
 #include "drm_lock.h"
 #include "drm_memory.h"
 #include "drm_proc.h"
--- diff/drivers/char/drm/i830_irq.c	2003-09-30 15:46:12.000000000 +0100
+++ source/drivers/char/drm/i830_irq.c	2004-02-09 10:39:52.000000000 +0000
@@ -35,7 +35,7 @@
 #include <linux/delay.h>
 
 
-irqreturn_t DRM(dma_service)( DRM_IRQ_ARGS )
+irqreturn_t DRM(irq_handler)( DRM_IRQ_ARGS )
 {
 	drm_device_t	 *dev = (drm_device_t *)arg;
       	drm_i830_private_t *dev_priv = (drm_i830_private_t *)dev->dev_private;
--- diff/drivers/char/drm/mga.h	2003-05-21 11:50:14.000000000 +0100
+++ source/drivers/char/drm/mga.h	2004-02-09 10:39:52.000000000 +0000
@@ -64,6 +64,12 @@
 	[DRM_IOCTL_NR(DRM_IOCTL_MGA_BLIT)]    = { mga_dma_blit,    1, 0 }, \
 	[DRM_IOCTL_NR(DRM_IOCTL_MGA_GETPARAM)]= { mga_getparam,    1, 0 },
 
+#define DRIVER_PCI_IDS							\
+	{0x102b, 0x0521, 0, "Matrox G200 (AGP)"},			\
+	{0x102b, 0x0525, 0, "Matrox G400/G450 (AGP)"},			\
+	{0x102b, 0x2527, 0, "Matrox G550 (AGP)"},			\
+	{0, 0, 0, NULL}
+
 #define __HAVE_COUNTERS         3
 #define __HAVE_COUNTER6         _DRM_STAT_IRQ
 #define __HAVE_COUNTER7         _DRM_STAT_PRIMARY
@@ -78,7 +84,7 @@
 /* DMA customization:
  */
 #define __HAVE_DMA		1
-#define __HAVE_DMA_IRQ		1
+#define __HAVE_IRQ		1
 #define __HAVE_VBL_IRQ		1
 #define __HAVE_SHARED_IRQ       1
 
--- diff/drivers/char/drm/mga_dma.c	2003-06-09 14:18:18.000000000 +0100
+++ source/drivers/char/drm/mga_dma.c	2004-02-09 10:39:52.000000000 +0000
@@ -500,14 +500,6 @@
 		return DRM_ERR(EINVAL);
 	}
 
-	DRM_FIND_MAP( dev_priv->fb, init->fb_offset );
-	if(!dev_priv->fb) {
-		DRM_ERROR( "failed to find framebuffer!\n" );
-		/* Assign dev_private so we can do cleanup. */
-		dev->dev_private = (void *)dev_priv;
-		mga_do_cleanup_dma( dev );
-		return DRM_ERR(EINVAL);
-	}
 	DRM_FIND_MAP( dev_priv->mmio, init->mmio_offset );
 	if(!dev_priv->mmio) {
 		DRM_ERROR( "failed to find mmio region!\n" );
@@ -639,12 +631,12 @@
 {
 	DRM_DEBUG( "\n" );
 
-#if _HAVE_DMA_IRQ
+#if __HAVE_IRQ
 	/* Make sure interrupts are disabled here because the uninstall ioctl
 	 * may not have been called from userspace and after dev_private
 	 * is freed, it's too late.
 	 */
-	if ( dev->irq ) DRM(irq_uninstall)(dev);
+	if ( dev->irq_enabled ) DRM(irq_uninstall)(dev);
 #endif
 
 	if ( dev->dev_private ) {
--- diff/drivers/char/drm/mga_drv.c	2002-10-16 04:27:56.000000000 +0100
+++ source/drivers/char/drm/mga_drv.c	2004-02-09 10:39:52.000000000 +0000
@@ -45,6 +45,7 @@
 #include "drm_fops.h"
 #include "drm_init.h"
 #include "drm_ioctl.h"
+#include "drm_irq.h"
 #include "drm_lock.h"
 #include "drm_memory.h"
 #include "drm_proc.h"
--- diff/drivers/char/drm/mga_drv.h	2003-06-09 14:18:18.000000000 +0100
+++ source/drivers/char/drm/mga_drv.h	2004-02-09 10:39:52.000000000 +0000
@@ -91,7 +91,6 @@
 	unsigned int texture_size;
 
 	drm_local_map_t *sarea;
-	drm_local_map_t *fb;
 	drm_local_map_t *mmio;
 	drm_local_map_t *status;
 	drm_local_map_t *warp;
--- diff/drivers/char/drm/mga_irq.c	2003-05-21 11:50:14.000000000 +0100
+++ source/drivers/char/drm/mga_irq.c	2004-02-09 10:39:52.000000000 +0000
@@ -36,7 +36,7 @@
 #include "mga_drm.h"
 #include "mga_drv.h"
 
-irqreturn_t mga_dma_service( DRM_IRQ_ARGS )
+irqreturn_t mga_irq_handler( DRM_IRQ_ARGS )
 {
 	drm_device_t *dev = (drm_device_t *) arg;
 	drm_mga_private_t *dev_priv = 
--- diff/drivers/char/drm/r128.h	2003-08-26 10:00:52.000000000 +0100
+++ source/drivers/char/drm/r128.h	2004-02-09 10:39:52.000000000 +0000
@@ -79,6 +79,46 @@
    [DRM_IOCTL_NR(DRM_IOCTL_R128_INDIRECT)]   = { r128_cce_indirect, 1, 1 }, \
    [DRM_IOCTL_NR(DRM_IOCTL_R128_GETPARAM)]   = { r128_getparam, 1, 0 },
 
+#define DRIVER_PCI_IDS							\
+	{0x1002, 0x4c45, 0, "ATI Rage 128 Mobility LE (PCI)"},		\
+	{0x1002, 0x4c46, 0, "ATI Rage 128 Mobility LF (AGP)"},		\
+	{0x1002, 0x4d46, 0, "ATI Rage 128 Mobility MF (AGP)"},		\
+	{0x1002, 0x4d4c, 0, "ATI Rage 128 Mobility ML (AGP)"},		\
+	{0x1002, 0x5041, 0, "ATI Rage 128 Pro PA (PCI)"},		\
+	{0x1002, 0x5042, 0, "ATI Rage 128 Pro PB (AGP)"},		\
+	{0x1002, 0x5043, 0, "ATI Rage 128 Pro PC (AGP)"},		\
+	{0x1002, 0x5044, 0, "ATI Rage 128 Pro PD (PCI)"},		\
+	{0x1002, 0x5045, 0, "ATI Rage 128 Pro PE (AGP)"},		\
+	{0x1002, 0x5046, 0, "ATI Rage 128 Pro PF (AGP)"},		\
+	{0x1002, 0x5047, 0, "ATI Rage 128 Pro PG (PCI)"},		\
+	{0x1002, 0x5048, 0, "ATI Rage 128 Pro PH (AGP)"},		\
+	{0x1002, 0x5049, 0, "ATI Rage 128 Pro PI (AGP)"},		\
+	{0x1002, 0x504A, 0, "ATI Rage 128 Pro PJ (PCI)"},		\
+	{0x1002, 0x504B, 0, "ATI Rage 128 Pro PK (AGP)"},		\
+	{0x1002, 0x504C, 0, "ATI Rage 128 Pro PL (AGP)"},		\
+	{0x1002, 0x504D, 0, "ATI Rage 128 Pro PM (PCI)"},		\
+	{0x1002, 0x504E, 0, "ATI Rage 128 Pro PN (AGP)"},		\
+	{0x1002, 0x504F, 0, "ATI Rage 128 Pro PO (AGP)"},		\
+	{0x1002, 0x5050, 0, "ATI Rage 128 Pro PP (PCI)"},		\
+	{0x1002, 0x5051, 0, "ATI Rage 128 Pro PQ (AGP)"},		\
+	{0x1002, 0x5052, 0, "ATI Rage 128 Pro PR (PCI)"},		\
+	{0x1002, 0x5053, 0, "ATI Rage 128 Pro PS (PCI)"},		\
+	{0x1002, 0x5054, 0, "ATI Rage 128 Pro PT (AGP)"},		\
+	{0x1002, 0x5055, 0, "ATI Rage 128 Pro PU (AGP)"},		\
+	{0x1002, 0x5056, 0, "ATI Rage 128 Pro PV (PCI)"},		\
+	{0x1002, 0x5057, 0, "ATI Rage 128 Pro PW (AGP)"},		\
+	{0x1002, 0x5058, 0, "ATI Rage 128 Pro PX (AGP)"},		\
+	{0x1002, 0x5245, 0, "ATI Rage 128 RE (PCI)"},			\
+	{0x1002, 0x5246, 0, "ATI Rage 128 RF (AGP)"},			\
+	{0x1002, 0x5247, 0, "ATI Rage 128 RG (AGP)"},			\
+	{0x1002, 0x524b, 0, "ATI Rage 128 RK (PCI)"},			\
+	{0x1002, 0x524c, 0, "ATI Rage 128 RL (AGP)"},			\
+	{0x1002, 0x534d, 0, "ATI Rage 128 SM (AGP)"},			\
+	{0x1002, 0x5446, 0, "ATI Rage 128 Pro Ultra TF (AGP)"},		\
+	{0x1002, 0x544C, 0, "ATI Rage 128 Pro Ultra TL (AGP)"},		\
+	{0x1002, 0x5452, 0, "ATI Rage 128 Pro Ultra TR (AGP)"},		\
+	{0, 0, 0, NULL}
+
 /* Driver customization:
  */
 #define DRIVER_PRERELEASE() do {					\
@@ -97,7 +137,7 @@
 /* DMA customization:
  */
 #define __HAVE_DMA		1
-#define __HAVE_DMA_IRQ		1
+#define __HAVE_IRQ		1
 #define __HAVE_VBL_IRQ		1
 #define __HAVE_SHARED_IRQ       1
 
--- diff/drivers/char/drm/r128_cce.c	2003-09-30 15:46:12.000000000 +0100
+++ source/drivers/char/drm/r128_cce.c	2004-02-09 10:39:52.000000000 +0000
@@ -212,7 +212,7 @@
 	int i;
 
 	for ( i = 0 ; i < dev_priv->usec_timeout ; i++ ) {
-		if ( GET_RING_HEAD( &dev_priv->ring ) == dev_priv->ring.tail ) {
+		if ( GET_RING_HEAD( dev_priv ) == dev_priv->ring.tail ) {
 			int pm4stat = R128_READ( R128_PM4_STAT );
 			if ( ( (pm4stat & R128_PM4_FIFOCNT_MASK) >=
 			       dev_priv->cce_fifo_size ) &&
@@ -238,7 +238,8 @@
 	r128_do_wait_for_idle( dev_priv );
 
 	R128_WRITE( R128_PM4_BUFFER_CNTL,
-		    dev_priv->cce_mode | dev_priv->ring.size_l2qw );
+		    dev_priv->cce_mode | dev_priv->ring.size_l2qw
+		    | R128_PM4_BUFFER_CNTL_NOUPDATE );
 	R128_READ( R128_PM4_BUFFER_ADDR ); /* as per the sample code */
 	R128_WRITE( R128_PM4_MICRO_CNTL, R128_PM4_MICRO_FREERUN );
 
@@ -253,7 +254,6 @@
 {
 	R128_WRITE( R128_PM4_BUFFER_DL_WPTR, 0 );
 	R128_WRITE( R128_PM4_BUFFER_DL_RPTR, 0 );
-	SET_RING_HEAD( &dev_priv->ring, 0 );
 	dev_priv->ring.tail = 0;
 }
 
@@ -264,7 +264,8 @@
 static void r128_do_cce_stop( drm_r128_private_t *dev_priv )
 {
 	R128_WRITE( R128_PM4_MICRO_CNTL, 0 );
-	R128_WRITE( R128_PM4_BUFFER_CNTL, R128_PM4_NONPM4 );
+	R128_WRITE( R128_PM4_BUFFER_CNTL,
+		    R128_PM4_NONPM4 | R128_PM4_BUFFER_CNTL_NOUPDATE );
 
 	dev_priv->cce_running = 0;
 }
@@ -333,26 +334,6 @@
 	R128_WRITE( R128_PM4_BUFFER_DL_WPTR, 0 );
 	R128_WRITE( R128_PM4_BUFFER_DL_RPTR, 0 );
 
-	/* DL_RPTR_ADDR is a physical address in AGP space. */
-	SET_RING_HEAD( &dev_priv->ring, 0 );
-
-	if ( !dev_priv->is_pci ) {
-		R128_WRITE( R128_PM4_BUFFER_DL_RPTR_ADDR,
-			    dev_priv->ring_rptr->offset );
-	} else {
-		drm_sg_mem_t *entry = dev->sg;
-		unsigned long tmp_ofs, page_ofs;
-
-		tmp_ofs = dev_priv->ring_rptr->offset - dev->sg->handle;
-		page_ofs = tmp_ofs >> PAGE_SHIFT;
-
-		R128_WRITE( R128_PM4_BUFFER_DL_RPTR_ADDR,
-     			    entry->busaddr[page_ofs]);
-		DRM_DEBUG( "ring rptr: offset=0x%08lx handle=0x%08lx\n",
-			   (unsigned long) entry->busaddr[page_ofs],
-     			   entry->handle + tmp_ofs );
-	}
-
 	/* Set watermark control */
 	R128_WRITE( R128_PM4_BUFFER_WM_CNTL,
 		    ((R128_WATERMARK_L/4) << R128_WMA_SHIFT)
@@ -486,13 +467,6 @@
 		return DRM_ERR(EINVAL);
 	}
 
-	DRM_FIND_MAP( dev_priv->fb, init->fb_offset );
-	if(!dev_priv->fb) {
-		DRM_ERROR("could not find framebuffer!\n");
-		dev->dev_private = (void *)dev_priv;
-		r128_do_cleanup_cce( dev );
-		return DRM_ERR(EINVAL);
-	}
 	DRM_FIND_MAP( dev_priv->mmio, init->mmio_offset );
 	if(!dev_priv->mmio) {
 		DRM_ERROR("could not find mmio region!\n");
@@ -567,9 +541,6 @@
 #endif
 		dev_priv->cce_buffers_offset = dev->sg->handle;
 
-	dev_priv->ring.head = ((__volatile__ u32 *)
-			       dev_priv->ring_rptr->handle);
-
 	dev_priv->ring.start = (u32 *)dev_priv->cce_ring->handle;
 	dev_priv->ring.end = ((u32 *)dev_priv->cce_ring->handle
 			      + init->ring_size / sizeof(u32));
@@ -580,7 +551,6 @@
 		(dev_priv->ring.size / sizeof(u32)) - 1;
 
 	dev_priv->ring.high_mark = 128;
-	dev_priv->ring.ring_rptr = dev_priv->ring_rptr;
 
 	dev_priv->sarea_priv->last_frame = 0;
 	R128_WRITE( R128_LAST_FRAME_REG, dev_priv->sarea_priv->last_frame );
@@ -589,8 +559,9 @@
 	R128_WRITE( R128_LAST_DISPATCH_REG,
 		    dev_priv->sarea_priv->last_dispatch );
 
-#if __REALLY_HAVE_SG
+#if __REALLY_HAVE_AGP
 	if ( dev_priv->is_pci ) {
+#endif
 		if (!DRM(ati_pcigart_init)( dev, &dev_priv->phys_pci_gart,
      					    &dev_priv->bus_pci_gart) ) {
 			DRM_ERROR( "failed to init PCI GART!\n" );
@@ -599,6 +570,7 @@
 			return DRM_ERR(ENOMEM);
 		}
 		R128_WRITE( R128_PCI_GART_PAGE, dev_priv->bus_pci_gart );
+#if __REALLY_HAVE_AGP
 	}
 #endif
 
@@ -615,12 +587,12 @@
 int r128_do_cleanup_cce( drm_device_t *dev )
 {
 
-#if _HAVE_DMA_IRQ
+#if __HAVE_IRQ
 	/* Make sure interrupts are disabled here because the uninstall ioctl
 	 * may not have been called from userspace and after dev_private
 	 * is freed, it's too late.
 	 */
-	if ( dev->irq ) DRM(irq_uninstall)(dev);
+	if ( dev->irq_enabled ) DRM(irq_uninstall)(dev);
 #endif
 
 	if ( dev->dev_private ) {
@@ -901,7 +873,7 @@
 	int i;
 
 	for ( i = 0 ; i < dev_priv->usec_timeout ; i++ ) {
-		r128_update_ring_snapshot( ring );
+		r128_update_ring_snapshot( dev_priv );
 		if ( ring->space >= n )
 			return 0;
 		DRM_UDELAY( 1 );
--- diff/drivers/char/drm/r128_drv.c	2002-10-16 04:27:48.000000000 +0100
+++ source/drivers/char/drm/r128_drv.c	2004-02-09 10:39:52.000000000 +0000
@@ -47,6 +47,7 @@
 #include "drm_fops.h"
 #include "drm_init.h"
 #include "drm_ioctl.h"
+#include "drm_irq.h"
 #include "drm_lock.h"
 #include "drm_memory.h"
 #include "drm_proc.h"
--- diff/drivers/char/drm/r128_drv.h	2003-08-20 14:16:27.000000000 +0100
+++ source/drivers/char/drm/r128_drv.h	2004-02-09 10:39:52.000000000 +0000
@@ -34,8 +34,7 @@
 #ifndef __R128_DRV_H__
 #define __R128_DRV_H__
 
-#define GET_RING_HEAD(ring)		DRM_READ32(  (ring)->ring_rptr, 0 ) /* (ring)->head */
-#define SET_RING_HEAD(ring,val)		DRM_WRITE32( (ring)->ring_rptr, 0, (val) ) /* (ring)->head */
+#define GET_RING_HEAD(dev_priv)		R128_READ( R128_PM4_BUFFER_DL_RPTR )
 
 typedef struct drm_r128_freelist {
    	unsigned int age;
@@ -50,13 +49,11 @@
 	int size;
 	int size_l2qw;
 
-	volatile u32 *head;
 	u32 tail;
 	u32 tail_mask;
 	int space;
 
 	int high_mark;
-	drm_local_map_t *ring_rptr;
 } drm_r128_ring_buffer_t;
 
 typedef struct drm_r128_private {
@@ -100,7 +97,6 @@
 	u32 span_pitch_offset_c;
 
 	drm_local_map_t *sarea;
-	drm_local_map_t *fb;
 	drm_local_map_t *mmio;
 	drm_local_map_t *cce_ring;
 	drm_local_map_t *ring_rptr;
@@ -132,14 +128,6 @@
 
 extern int r128_wait_ring( drm_r128_private_t *dev_priv, int n );
 
-static __inline__ void
-r128_update_ring_snapshot( drm_r128_ring_buffer_t *ring )
-{
-	ring->space = (GET_RING_HEAD( ring ) - ring->tail) * sizeof(u32);
-	if ( ring->space <= 0 )
-		ring->space += ring->size;
-}
-
 extern int r128_do_cce_idle( drm_r128_private_t *dev_priv );
 extern int r128_do_cleanup_cce( drm_device_t *dev );
 extern int r128_do_cleanup_pageflip( drm_device_t *dev );
@@ -279,6 +267,7 @@
 #	define R128_PM4_64PIO_64VCBM_64INDBM	(7  << 28)
 #	define R128_PM4_64BM_64VCBM_64INDBM	(8  << 28)
 #	define R128_PM4_64PIO_64VCPIO_64INDPIO	(15 << 28)
+#	define R128_PM4_BUFFER_CNTL_NOUPDATE	(1  << 27)
 
 #define R128_PM4_BUFFER_WM_CNTL		0x0708
 #	define R128_WMA_SHIFT			0
@@ -403,6 +392,15 @@
 					 (pkt) | ((n) << 16))
 
 
+static __inline__ void
+r128_update_ring_snapshot( drm_r128_private_t *dev_priv )
+{
+	drm_r128_ring_buffer_t *ring = &dev_priv->ring;
+	ring->space = (GET_RING_HEAD( dev_priv ) - ring->tail) * sizeof(u32);
+	if ( ring->space <= 0 )
+		ring->space += ring->size;
+}
+
 /* ================================================================
  * Misc helper macros
  */
@@ -412,7 +410,7 @@
 	drm_r128_ring_buffer_t *ring = &dev_priv->ring; int i;		\
 	if ( ring->space < ring->high_mark ) {				\
 		for ( i = 0 ; i < dev_priv->usec_timeout ; i++ ) {	\
-			r128_update_ring_snapshot( ring );		\
+			r128_update_ring_snapshot( dev_priv );		\
 			if ( ring->space >= ring->high_mark )		\
 				goto __ring_space_done;			\
 			DRM_UDELAY(1);				\
@@ -445,17 +443,10 @@
  * Ring control
  */
 
-#if defined(__powerpc__)
-#define r128_flush_write_combine()	(void) GET_RING_HEAD( &dev_priv->ring )
-#else
-#define r128_flush_write_combine()	DRM_WRITEMEMORYBARRIER()
-#endif
-
-
 #define R128_VERBOSE	0
 
 #define RING_LOCALS							\
-	int write; unsigned int tail_mask; volatile u32 *ring;
+	int write, _nr; unsigned int tail_mask; volatile u32 *ring;
 
 #define BEGIN_RING( n ) do {						\
 	if ( R128_VERBOSE ) {						\
@@ -463,9 +454,10 @@
 			   (n), __FUNCTION__ );				\
 	}								\
 	if ( dev_priv->ring.space <= (n) * sizeof(u32) ) {		\
+		COMMIT_RING();						\
 		r128_wait_ring( dev_priv, (n) * sizeof(u32) );		\
 	}								\
-	dev_priv->ring.space -= (n) * sizeof(u32);			\
+	_nr = n; dev_priv->ring.space -= (n) * sizeof(u32);		\
 	ring = dev_priv->ring.start;					\
 	write = dev_priv->ring.tail;					\
 	tail_mask = dev_priv->ring.tail_mask;				\
@@ -488,9 +480,23 @@
 			dev_priv->ring.start,				\
 			write * sizeof(u32) );				\
 	}								\
-	r128_flush_write_combine();					\
-	dev_priv->ring.tail = write;					\
-	R128_WRITE( R128_PM4_BUFFER_DL_WPTR, write );			\
+	if (((dev_priv->ring.tail + _nr) & tail_mask) != write) {	\
+		DRM_ERROR( 						\
+			"ADVANCE_RING(): mismatch: nr: %x write: %x line: %d\n",	\
+			((dev_priv->ring.tail + _nr) & tail_mask),	\
+			write, __LINE__);				\
+	} else								\
+		dev_priv->ring.tail = write;				\
+} while (0)
+
+#define COMMIT_RING() do {						\
+	if ( R128_VERBOSE ) {						\
+		DRM_INFO( "COMMIT_RING() tail=0x%06x\n",		\
+			dev_priv->ring.tail );				\
+	}								\
+	DRM_MEMORYBARRIER();						\
+	R128_WRITE( R128_PM4_BUFFER_DL_WPTR, dev_priv->ring.tail );	\
+	R128_READ( R128_PM4_BUFFER_DL_WPTR );				\
 } while (0)
 
 #define OUT_RING( x ) do {						\
--- diff/drivers/char/drm/r128_irq.c	2003-05-21 11:50:14.000000000 +0100
+++ source/drivers/char/drm/r128_irq.c	2004-02-09 10:39:52.000000000 +0000
@@ -36,7 +36,7 @@
 #include "r128_drm.h"
 #include "r128_drv.h"
 
-irqreturn_t r128_dma_service( DRM_IRQ_ARGS )
+irqreturn_t r128_irq_handler( DRM_IRQ_ARGS )
 {
 	drm_device_t *dev = (drm_device_t *) arg;
 	drm_r128_private_t *dev_priv = 
--- diff/drivers/char/drm/r128_state.c	2003-08-20 14:16:27.000000000 +0100
+++ source/drivers/char/drm/r128_state.c	2004-02-09 10:39:52.000000000 +0000
@@ -45,7 +45,7 @@
 	RING_LOCALS;
 	DRM_DEBUG( "    %s\n", __FUNCTION__ );
 
-	BEGIN_RING( 17 );
+	BEGIN_RING( (count < 3? count: 3) * 5 + 2 );
 
 	if ( count >= 1 ) {
 		OUT_RING( CCE_PACKET0( R128_AUX1_SC_LEFT, 3 ) );
@@ -1269,6 +1269,7 @@
 		sarea_priv->nbox = R128_NR_SAREA_CLIPRECTS;
 
 	r128_cce_dispatch_clear( dev, &clear );
+	COMMIT_RING();
 
 	/* Make sure we restore the 3D state next time.
 	 */
@@ -1304,8 +1305,10 @@
 	R128_WRITE( R128_CRTC_OFFSET,      dev_priv->crtc_offset );
 	R128_WRITE( R128_CRTC_OFFSET_CNTL, dev_priv->crtc_offset_cntl );
 
-	if (dev_priv->current_page != 0)
+	if (dev_priv->current_page != 0) {
 		r128_cce_dispatch_flip( dev );
+		COMMIT_RING();
+	}
 
 	dev_priv->page_flipping = 0;
 	return 0;
@@ -1330,6 +1333,7 @@
 
 	r128_cce_dispatch_flip( dev );
 
+	COMMIT_RING();
 	return 0;
 }
 
@@ -1351,6 +1355,7 @@
 	dev_priv->sarea_priv->dirty |= (R128_UPLOAD_CONTEXT |
 					R128_UPLOAD_MASKS);
 
+	COMMIT_RING();
 	return 0;
 }
 
@@ -1410,6 +1415,7 @@
 
 	r128_cce_dispatch_vertex( dev, buf );
 
+	COMMIT_RING();
 	return 0;
 }
 
@@ -1481,6 +1487,7 @@
 
 	r128_cce_dispatch_indices( dev, buf, elts.start, elts.end, count );
 
+	COMMIT_RING();
 	return 0;
 }
 
@@ -1490,6 +1497,7 @@
 	drm_device_dma_t *dma = dev->dma;
 	drm_r128_private_t *dev_priv = dev->dev_private;
 	drm_r128_blit_t blit;
+	int ret;
 
 	LOCK_TEST_WITH_RETURN( dev, filp );
 
@@ -1507,7 +1515,10 @@
 	RING_SPACE_TEST_WITH_RETURN( dev_priv );
 	VB_AGE_TEST_WITH_RETURN( dev_priv );
 
-	return r128_cce_dispatch_blit( filp, dev, &blit );
+	ret = r128_cce_dispatch_blit( filp, dev, &blit );
+
+	COMMIT_RING();
+	return ret;
 }
 
 int r128_cce_depth( DRM_IOCTL_ARGS )
@@ -1515,6 +1526,7 @@
 	DRM_DEVICE;
 	drm_r128_private_t *dev_priv = dev->dev_private;
 	drm_r128_depth_t depth;
+	int ret;
 
 	LOCK_TEST_WITH_RETURN( dev, filp );
 
@@ -1523,18 +1535,20 @@
 
 	RING_SPACE_TEST_WITH_RETURN( dev_priv );
 
+	ret = DRM_ERR(EINVAL);
 	switch ( depth.func ) {
 	case R128_WRITE_SPAN:
-		return r128_cce_dispatch_write_span( dev, &depth );
+		ret = r128_cce_dispatch_write_span( dev, &depth );
 	case R128_WRITE_PIXELS:
-		return r128_cce_dispatch_write_pixels( dev, &depth );
+		ret = r128_cce_dispatch_write_pixels( dev, &depth );
 	case R128_READ_SPAN:
-		return r128_cce_dispatch_read_span( dev, &depth );
+		ret = r128_cce_dispatch_read_span( dev, &depth );
 	case R128_READ_PIXELS:
-		return r128_cce_dispatch_read_pixels( dev, &depth );
+		ret = r128_cce_dispatch_read_pixels( dev, &depth );
 	}
 
-	return DRM_ERR(EINVAL);
+	COMMIT_RING();
+	return ret;
 }
 
 int r128_cce_stipple( DRM_IOCTL_ARGS )
@@ -1557,6 +1571,7 @@
 
 	r128_cce_dispatch_stipple( dev, mask );
 
+	COMMIT_RING();
 	return 0;
 }
 
@@ -1632,6 +1647,7 @@
 	 */
 	r128_cce_dispatch_indirect( dev, buf, indirect.start, indirect.end );
 
+	COMMIT_RING();
 	return 0;
 }
 
--- diff/drivers/char/drm/radeon.h	2003-09-30 15:46:12.000000000 +0100
+++ source/drivers/char/drm/radeon.h	2004-02-09 10:39:52.000000000 +0000
@@ -51,7 +51,7 @@
 #define DRIVER_DATE		"20020828"
 
 #define DRIVER_MAJOR		1
-#define DRIVER_MINOR		9
+#define DRIVER_MINOR		10
 #define DRIVER_PATCHLEVEL	0
 
 /* Interface history:
@@ -81,6 +81,9 @@
  *       Add 'GET' queries for starting additional clients on different VT's.
  * 1.9 - Add DRM_IOCTL_RADEON_CP_RESUME ioctl.
  *       Add texture rectangle support for r100.
+ * 1.10- Add SETPARAM ioctl; first parameter to set is FB_LOCATION, which
+ *       clients use to tell the DRM where they think the framebuffer is 
+ *       located in the card's address space
  */
 #define DRIVER_IOCTLS							     \
  [DRM_IOCTL_NR(DRM_IOCTL_DMA)]               = { radeon_cp_buffers,  1, 0 }, \
@@ -106,10 +109,82 @@
  [DRM_IOCTL_NR(DRM_IOCTL_RADEON_ALLOC)]      = { radeon_mem_alloc,   1, 0 }, \
  [DRM_IOCTL_NR(DRM_IOCTL_RADEON_FREE)]       = { radeon_mem_free,    1, 0 }, \
  [DRM_IOCTL_NR(DRM_IOCTL_RADEON_INIT_HEAP)]  = { radeon_mem_init_heap, 1, 1 }, \
- [DRM_IOCTL_NR(DRM_IOCTL_RADEON_IRQ_EMIT)]   = { radeon_irq_emit, 1, 0 }, \
- [DRM_IOCTL_NR(DRM_IOCTL_RADEON_IRQ_WAIT)]   = { radeon_irq_wait, 1, 0 },
+ [DRM_IOCTL_NR(DRM_IOCTL_RADEON_IRQ_EMIT)]   = { radeon_irq_emit,    1, 0 }, \
+ [DRM_IOCTL_NR(DRM_IOCTL_RADEON_IRQ_WAIT)]   = { radeon_irq_wait,    1, 0 }, \
+ [DRM_IOCTL_NR(DRM_IOCTL_RADEON_SETPARAM)]   = { radeon_cp_setparam, 1, 0 }, \
+
+#define DRIVER_PCI_IDS							\
+	{0x1002, 0x4136, 0, "ATI Radeon RS100 IGP 320M"},		\
+	{0x1002, 0x4137, 0, "ATI Radeon RS200 IGP"},			\
+	{0x1002, 0x4237, 0, "ATI Radeon RS250 IGP"},			\
+	{0x1002, 0x4242, 0, "ATI Radeon BB R200 AIW 8500DV"},		\
+	{0x1002, 0x4242, 0, "ATI Radeon BC R200"},			\
+	{0x1002, 0x4336, 0, "ATI Radeon RS100 Mobility U1"},		\
+	{0x1002, 0x4337, 0, "ATI Radeon RS200 Mobility IGP 340M"},	\
+	{0x1002, 0x4437, 0, "ATI Radeon RS250 Mobility IGP"},		\
+	{0x1002, 0x4964, 0, "ATI Radeon Id R250 9000"},			\
+	{0x1002, 0x4965, 0, "ATI Radeon Ie R250 9000"},			\
+	{0x1002, 0x4966, 0, "ATI Radeon If R250 9000"},			\
+	{0x1002, 0x4967, 0, "ATI Radeon Ig R250 9000"},			\
+	{0x1002, 0x4C57, 0, "ATI Radeon LW Mobility 7500 M7"},		\
+	{0x1002, 0x4C58, 0, "ATI Radeon LX RV200 Mobility FireGL 7800 M7"}, \
+	{0x1002, 0x4C59, 0, "ATI Radeon LY Mobility M6"},		\
+	{0x1002, 0x4C5A, 0, "ATI Radeon LZ Mobility M6"},		\
+	{0x1002, 0x4C64, 0, "ATI Radeon Ld R250 Mobility 9000 M9"},	\
+	{0x1002, 0x4C65, 0, "ATI Radeon Le R250 Mobility 9000 M9"},	\
+	{0x1002, 0x4C66, 0, "ATI Radeon Lf R250 Mobility 9000 M9"},	\
+	{0x1002, 0x4C67, 0, "ATI Radeon Lg R250 Mobility 9000 M9"},	\
+	{0x1002, 0x5144, 0, "ATI Radeon QD R100"},			\
+	{0x1002, 0x5145, 0, "ATI Radeon QE R100"},			\
+	{0x1002, 0x5146, 0, "ATI Radeon QF R100"},			\
+	{0x1002, 0x5147, 0, "ATI Radeon QG R100"},			\
+	{0x1002, 0x5148, 0, "ATI Radeon QH R200 8500"},			\
+	{0x1002, 0x5149, 0, "ATI Radeon QI R200"},			\
+	{0x1002, 0x514A, 0, "ATI Radeon QJ R200"},			\
+	{0x1002, 0x514B, 0, "ATI Radeon QK R200"},			\
+	{0x1002, 0x514C, 0, "ATI Radeon QL R200 8500 LE"},		\
+	{0x1002, 0x514D, 0, "ATI Radeon QM R200 9100"},			\
+	{0x1002, 0x514E, 0, "ATI Radeon QN R200 8500 LE"},		\
+	{0x1002, 0x514F, 0, "ATI Radeon QO R200 8500 LE"},		\
+	{0x1002, 0x5157, 0, "ATI Radeon QW RV200 7500"},		\
+	{0x1002, 0x5158, 0, "ATI Radeon QX RV200 7500"},		\
+	{0x1002, 0x5159, 0, "ATI Radeon QY RV100 7000/VE"},		\
+	{0x1002, 0x515A, 0, "ATI Radeon QZ RV100 7000/VE"},		\
+	{0x1002, 0x5168, 0, "ATI Radeon Qh R200"},			\
+	{0x1002, 0x5169, 0, "ATI Radeon Qi R200"},			\
+	{0x1002, 0x516A, 0, "ATI Radeon Qj R200"},			\
+	{0x1002, 0x516B, 0, "ATI Radeon Qk R200"},			\
+	{0x1002, 0x516C, 0, "ATI Radeon Ql R200"},			\
+	{0x1002, 0x5834, 0, "ATI Radeon RS300 IGP"},			\
+	{0x1002, 0x5835, 0, "ATI Radeon RS300 Mobility IGP"},		\
+	{0x1002, 0x5836, 0, "ATI Radeon RS300 IGP"},			\
+	{0x1002, 0x5837, 0, "ATI Radeon RS300 IGP"},			\
+	{0x1002, 0x5960, 0, "ATI Radeon RV280 9200"},			\
+	{0x1002, 0x5961, 0, "ATI Radeon RV280 9200 SE"},		\
+	{0x1002, 0x5962, 0, "ATI Radeon RV280 9200"},			\
+	{0x1002, 0x5963, 0, "ATI Radeon RV280 9200"},			\
+	{0x1002, 0x5964, 0, "ATI Radeon RV280 9200 SE"},		\
+	{0x1002, 0x5968, 0, "ATI Radeon RV280 9200"},			\
+	{0x1002, 0x5969, 0, "ATI Radeon RV280 9200"},			\
+	{0x1002, 0x596A, 0, "ATI Radeon RV280 9200"},			\
+	{0x1002, 0x596B, 0, "ATI Radeon RV280 9200"},			\
+	{0x1002, 0x5c61, 0, "ATI Radeon RV280 Mobility"},		\
+	{0x1002, 0x5c62, 0, "ATI Radeon RV280"},			\
+	{0x1002, 0x5c63, 0, "ATI Radeon RV280 Mobility"},		\
+	{0x1002, 0x5c64, 0, "ATI Radeon RV280"},			\
+	{0, 0, 0, NULL}
 
+#define DRIVER_FILE_FIELDS						\
+	int64_t radeon_fb_delta;					\
 
+#define DRIVER_OPEN_HELPER( filp_priv, dev )				\
+do {									\
+	drm_radeon_private_t *dev_priv = dev->dev_private;		\
+	if ( dev_priv )							\
+		filp_priv->radeon_fb_delta = dev_priv->fb_location;	\
+	else								\
+		filp_priv->radeon_fb_delta = 0;				\
+} while( 0 )
 
 /* When a client dies:
  *    - Check for and clean up flipped page state
@@ -125,7 +200,7 @@
 			radeon_do_cleanup_pageflip( dev );		\
 		}							\
 		radeon_mem_release( filp, dev_priv->gart_heap );	\
-                radeon_mem_release( filp, dev_priv->fb_heap );		\
+		radeon_mem_release( filp, dev_priv->fb_heap );		\
 	}								\
 } while (0)
 
@@ -142,7 +217,7 @@
 /* DMA customization:
  */
 #define __HAVE_DMA		1
-#define __HAVE_DMA_IRQ		1
+#define __HAVE_IRQ		1
 #define __HAVE_VBL_IRQ		1
 #define __HAVE_SHARED_IRQ       1
 
--- diff/drivers/char/drm/radeon_cp.c	2003-09-30 15:46:12.000000000 +0100
+++ source/drivers/char/drm/radeon_cp.c	2004-02-09 10:39:52.000000000 +0000
@@ -855,7 +855,8 @@
 
 	/* Initialize the memory controller */
 	RADEON_WRITE( RADEON_MC_FB_LOCATION,
-		      (dev_priv->gart_vm_start - 1) & 0xffff0000 );
+		      ( ( dev_priv->gart_vm_start - 1 ) & 0xffff0000 )
+		    | ( dev_priv->fb_location >> 16 ) );
 
 #if __REALLY_HAVE_AGP
 	if ( !dev_priv->is_pci ) {
@@ -1071,13 +1072,6 @@
 	dev_priv->depth_offset	= init->depth_offset;
 	dev_priv->depth_pitch	= init->depth_pitch;
 
-	dev_priv->front_pitch_offset = (((dev_priv->front_pitch/64) << 22) |
-					(dev_priv->front_offset >> 10));
-	dev_priv->back_pitch_offset = (((dev_priv->back_pitch/64) << 22) |
-				       (dev_priv->back_offset >> 10));
-	dev_priv->depth_pitch_offset = (((dev_priv->depth_pitch/64) << 22) |
-					(dev_priv->depth_offset >> 10));
-
 	/* Hardware state for depth clears.  Remove this if/when we no
 	 * longer clear the depth buffer with a 3D rectangle.  Hard-code
 	 * all values to prevent unwanted 3D state from slipping through
@@ -1124,13 +1118,6 @@
 		return DRM_ERR(EINVAL);
 	}
 
-	DRM_FIND_MAP( dev_priv->fb, init->fb_offset );
-	if(!dev_priv->fb) {
-		DRM_ERROR("could not find framebuffer!\n");
-		dev->dev_private = (void *)dev_priv;
-		radeon_do_cleanup_cp(dev);
-		return DRM_ERR(EINVAL);
-	}
 	DRM_FIND_MAP( dev_priv->mmio, init->mmio_offset );
 	if(!dev_priv->mmio) {
 		DRM_ERROR("could not find mmio region!\n");
@@ -1204,9 +1191,26 @@
 			   dev_priv->buffers->handle );
 	}
 
+	dev_priv->fb_location = ( RADEON_READ( RADEON_MC_FB_LOCATION )
+				& 0xffff ) << 16;
+
+	dev_priv->front_pitch_offset = (((dev_priv->front_pitch/64) << 22) |
+					( ( dev_priv->front_offset
+					  + dev_priv->fb_location ) >> 10 ) );
+
+	dev_priv->back_pitch_offset = (((dev_priv->back_pitch/64) << 22) |
+				       ( ( dev_priv->back_offset
+					 + dev_priv->fb_location ) >> 10 ) );
+
+	dev_priv->depth_pitch_offset = (((dev_priv->depth_pitch/64) << 22) |
+					( ( dev_priv->depth_offset
+					  + dev_priv->fb_location ) >> 10 ) );
+
 
 	dev_priv->gart_size = init->gart_size;
-	dev_priv->gart_vm_start = RADEON_READ( RADEON_CONFIG_APER_SIZE );
+	dev_priv->gart_vm_start = dev_priv->fb_location
+				+ RADEON_READ( RADEON_CONFIG_APER_SIZE );
+
 #if __REALLY_HAVE_AGP
 	if ( !dev_priv->is_pci )
 		dev_priv->gart_buffers_offset = (dev_priv->buffers->offset
@@ -1271,12 +1275,12 @@
 {
 	DRM_DEBUG( "\n" );
 
-#if _HAVE_DMA_IRQ
+#if __HAVE_IRQ
 	/* Make sure interrupts are disabled here because the uninstall ioctl
 	 * may not have been called from userspace and after dev_private
 	 * is freed, it's too late.
 	 */
-	if ( dev->irq ) DRM(irq_uninstall)(dev);
+	if ( dev->irq_enabled ) DRM(irq_uninstall)(dev);
 #endif
 
 	if ( dev->dev_private ) {
--- diff/drivers/char/drm/radeon_drm.h	2003-09-30 15:46:12.000000000 +0100
+++ source/drivers/char/drm/radeon_drm.h	2004-02-09 10:39:52.000000000 +0000
@@ -390,6 +390,7 @@
 #define DRM_IOCTL_RADEON_IRQ_WAIT   DRM_IOW( 0x57, drm_radeon_irq_wait_t)
 /* added by Charl P. Botha - see radeon_cp.c for details */
 #define DRM_IOCTL_RADEON_CP_RESUME  DRM_IO(0x58)
+#define DRM_IOCTL_RADEON_SETPARAM   DRM_IOW(0x59, drm_radeon_setparam_t)
 
 typedef struct drm_radeon_init {
 	enum {
@@ -502,7 +503,7 @@
 } drm_radeon_tex_image_t;
 
 typedef struct drm_radeon_texture {
-	int offset;
+	unsigned int offset;
 	int pitch;
 	int format;
 	int width;			/* Texture image coordinates */
@@ -537,6 +538,7 @@
 #define RADEON_PARAM_STATUS_HANDLE         8
 #define RADEON_PARAM_SAREA_HANDLE          9
 #define RADEON_PARAM_GART_TEX_HANDLE       10
+#define RADEON_PARAM_SCRATCH_OFFSET        11
 
 typedef struct drm_radeon_getparam {
 	int param;
@@ -578,4 +580,16 @@
 } drm_radeon_irq_wait_t;
 
 
+/* 1.10: Clients tell the DRM where they think the framebuffer is located in
+ * the card's address space, via a new generic ioctl to set parameters
+ */
+
+typedef struct drm_radeon_setparam {
+	unsigned int param;
+	int64_t      value;
+} drm_radeon_setparam_t;
+
+#define RADEON_SETPARAM_FB_LOCATION    1 /* determined framebuffer location */
+
+
 #endif
--- diff/drivers/char/drm/radeon_drv.c	2003-07-22 18:54:27.000000000 +0100
+++ source/drivers/char/drm/radeon_drv.c	2004-02-09 10:39:52.000000000 +0000
@@ -48,6 +48,7 @@
 #include "drm_fops.h"
 #include "drm_init.h"
 #include "drm_ioctl.h"
+#include "drm_irq.h"
 #include "drm_lock.h"
 #include "drm_memory.h"
 #include "drm_proc.h"
--- diff/drivers/char/drm/radeon_drv.h	2003-09-30 15:46:12.000000000 +0100
+++ source/drivers/char/drm/radeon_drv.h	2004-02-09 10:39:52.000000000 +0000
@@ -73,6 +73,8 @@
 	drm_radeon_ring_buffer_t ring;
 	drm_radeon_sarea_t *sarea_priv;
 
+	u32 fb_location;
+
 	int gart_size;
 	u32 gart_vm_start;
 	unsigned long gart_buffers_offset;
@@ -133,7 +135,6 @@
 	unsigned long gart_textures_offset;
 
 	drm_local_map_t *sarea;
-	drm_local_map_t *fb;
 	drm_local_map_t *mmio;
 	drm_local_map_t *cp_ring;
 	drm_local_map_t *ring_rptr;
@@ -184,6 +185,7 @@
 extern int radeon_cp_vertex2( DRM_IOCTL_ARGS );
 extern int radeon_cp_cmdbuf( DRM_IOCTL_ARGS );
 extern int radeon_cp_getparam( DRM_IOCTL_ARGS );
+extern int radeon_cp_setparam( DRM_IOCTL_ARGS );
 extern int radeon_cp_flip( DRM_IOCTL_ARGS );
 
 extern int radeon_mem_alloc( DRM_IOCTL_ARGS );
@@ -239,6 +241,7 @@
 #define RADEON_CRTC2_OFFSET		0x0324
 #define RADEON_CRTC2_OFFSET_CNTL	0x0328
 
+#define RADEON_RB3D_COLOROFFSET		0x1c40
 #define RADEON_RB3D_COLORPITCH		0x1c48
 
 #define RADEON_DP_GUI_MASTER_CNTL	0x146c
@@ -332,6 +335,7 @@
 #define RADEON_PP_MISC			0x1c14
 #define RADEON_PP_ROT_MATRIX_0		0x1d58
 #define RADEON_PP_TXFILTER_0		0x1c54
+#define RADEON_PP_TXOFFSET_0		0x1c5c
 #define RADEON_PP_TXFILTER_1		0x1c6c
 #define RADEON_PP_TXFILTER_2		0x1c84
 
--- diff/drivers/char/drm/radeon_irq.c	2003-05-21 11:50:14.000000000 +0100
+++ source/drivers/char/drm/radeon_irq.c	2004-02-09 10:39:52.000000000 +0000
@@ -54,7 +54,7 @@
  * tied to dma at all, this is just a hangover from dri prehistory.
  */
 
-irqreturn_t DRM(dma_service)( DRM_IRQ_ARGS )
+irqreturn_t DRM(irq_handler)( DRM_IRQ_ARGS )
 {
 	drm_device_t *dev = (drm_device_t *) arg;
 	drm_radeon_private_t *dev_priv = 
--- diff/drivers/char/drm/radeon_state.c	2003-09-30 15:46:12.000000000 +0100
+++ source/drivers/char/drm/radeon_state.c	2004-02-09 10:39:52.000000000 +0000
@@ -36,6 +36,151 @@
 
 
 /* ================================================================
+ * Helper functions for client state checking and fixup
+ */
+
+static __inline__ int radeon_check_and_fixup_offset( drm_radeon_private_t *dev_priv,
+						     drm_file_t *filp_priv,
+						     u32 *offset ) {
+	u32 off = *offset;
+
+	if ( off >= dev_priv->fb_location &&
+	     off < ( dev_priv->gart_vm_start + dev_priv->gart_size ) )
+		return 0;
+
+	off += filp_priv->radeon_fb_delta;
+
+	DRM_DEBUG( "offset fixed up to 0x%x\n", off );
+
+	if ( off < dev_priv->fb_location ||
+	     off >= ( dev_priv->gart_vm_start + dev_priv->gart_size ) )
+		return DRM_ERR( EINVAL );
+
+	*offset = off;
+
+	return 0;
+}
+
+static __inline__ int radeon_check_and_fixup_offset_user( drm_radeon_private_t *dev_priv,
+							  drm_file_t *filp_priv,
+							  u32 *offset ) {
+	u32 off;
+
+	DRM_GET_USER_UNCHECKED( off, offset );
+
+	if ( radeon_check_and_fixup_offset( dev_priv, filp_priv, &off ) )
+		return DRM_ERR( EINVAL );
+
+	DRM_PUT_USER_UNCHECKED( offset, off );
+
+	return 0;
+}
+
+static __inline__ int radeon_check_and_fixup_packets( drm_radeon_private_t *dev_priv,
+						      drm_file_t *filp_priv,
+						      int id,
+						      u32 *data ) {
+	if ( id == RADEON_EMIT_PP_MISC &&
+	     radeon_check_and_fixup_offset_user( dev_priv, filp_priv,
+						 &data[( RADEON_RB3D_DEPTHOFFSET
+							 - RADEON_PP_MISC ) / 4] ) ) {
+		DRM_ERROR( "Invalid depth buffer offset\n" );
+		return DRM_ERR( EINVAL );
+	} else if ( id == RADEON_EMIT_PP_CNTL &&
+		    radeon_check_and_fixup_offset_user( dev_priv, filp_priv,
+							&data[( RADEON_RB3D_COLOROFFSET
+								- RADEON_PP_CNTL ) / 4] ) ) {
+		DRM_ERROR( "Invalid colour buffer offset\n" );
+		return DRM_ERR( EINVAL );
+	} else if ( id >= R200_EMIT_PP_TXOFFSET_0 &&
+		    id <= R200_EMIT_PP_TXOFFSET_5 &&
+		    radeon_check_and_fixup_offset_user( dev_priv, filp_priv,
+							&data[0] ) ) {
+		DRM_ERROR( "Invalid R200 texture offset\n" );
+		return DRM_ERR( EINVAL );
+	} else if ( ( id == RADEON_EMIT_PP_TXFILTER_0 || id == RADEON_EMIT_PP_TXFILTER_1 ||
+		      id == RADEON_EMIT_PP_TXFILTER_2 /*|| id == RADEON_EMIT_PP_TXFILTER_3 ||
+		      id == RADEON_EMIT_PP_TXFILTER_4 || id == RADEON_EMIT_PP_TXFILTER_5*/ ) &&
+		    radeon_check_and_fixup_offset_user( dev_priv, filp_priv,
+							&data[( RADEON_PP_TXOFFSET_0
+								- RADEON_PP_TXFILTER_0 ) / 4] ) ) {
+		DRM_ERROR( "Invalid R100 texture offset\n" );
+		return DRM_ERR( EINVAL );
+	} else if ( id == R200_PP_CUBIC_OFFSET_F1_0 || id == R200_PP_CUBIC_OFFSET_F1_1 ||
+		    id == R200_PP_CUBIC_OFFSET_F1_2 || id == R200_PP_CUBIC_OFFSET_F1_3 ||
+		    id == R200_PP_CUBIC_OFFSET_F1_4 || id == R200_PP_CUBIC_OFFSET_F1_5 ) {
+		int i;
+		for ( i = 0; i < 6; i++ ) {
+			if ( radeon_check_and_fixup_offset_user( dev_priv,
+								 filp_priv,
+								 &data[i] ) ) {
+				DRM_ERROR( "Invalid R200 cubic texture offset\n" );
+				return DRM_ERR( EINVAL );
+			}
+		}
+	}
+
+	return 0;
+}
+
+static __inline__ int radeon_check_and_fixup_packet3( drm_radeon_private_t *dev_priv,
+						      drm_file_t *filp_priv,
+						      drm_radeon_cmd_buffer_t *cmdbuf,
+						      unsigned int *cmdsz ) {
+	u32 tmp[4], *cmd = ( u32* )cmdbuf->buf;
+
+	if ( DRM_COPY_FROM_USER_UNCHECKED( tmp, cmd, sizeof( tmp ) ) ) {
+		DRM_ERROR( "Failed to copy data from user space\n" );
+		return DRM_ERR( EFAULT );
+	}
+
+	*cmdsz = 2 + ( ( tmp[0] & RADEON_CP_PACKET_COUNT_MASK ) >> 16 );
+
+	if ( ( tmp[0] & 0xc0000000 ) != RADEON_CP_PACKET3 ) {
+		DRM_ERROR( "Not a type 3 packet\n" );
+		return DRM_ERR( EINVAL );
+	}
+
+	if ( 4 * *cmdsz > cmdbuf->bufsz ) {
+		DRM_ERROR( "Packet size larger than size of data provided\n" );
+		return DRM_ERR( EINVAL );
+	}
+
+	/* Check client state and fix it up if necessary */
+	if ( tmp[0] & 0x8000 ) { /* MSB of opcode: next DWORD GUI_CNTL */
+		u32 offset;
+
+		if ( tmp[1] & ( RADEON_GMC_SRC_PITCH_OFFSET_CNTL
+			      | RADEON_GMC_DST_PITCH_OFFSET_CNTL ) ) {
+			offset = tmp[2] << 10;
+			if ( radeon_check_and_fixup_offset( dev_priv, filp_priv, &offset ) ) {
+				DRM_ERROR( "Invalid first packet offset\n" );
+				return DRM_ERR( EINVAL );
+			}
+			tmp[2] = ( tmp[2] & 0xffc00000 ) | offset >> 10;
+		}
+
+		if ( ( tmp[1] & RADEON_GMC_SRC_PITCH_OFFSET_CNTL ) &&
+		     ( tmp[1] & RADEON_GMC_DST_PITCH_OFFSET_CNTL ) ) {
+			offset = tmp[3] << 10;
+			if ( radeon_check_and_fixup_offset( dev_priv, filp_priv, &offset ) ) {
+				DRM_ERROR( "Invalid second packet offset\n" );
+				return DRM_ERR( EINVAL );
+			}
+			tmp[3] = ( tmp[3] & 0xffc00000 ) | offset >> 10;
+		}
+
+		if ( DRM_COPY_TO_USER_UNCHECKED( cmd, tmp, sizeof( tmp ) ) ) {
+			DRM_ERROR( "Failed to copy data to user space\n" );
+			return DRM_ERR( EFAULT );
+		}
+	}
+
+	return 0;
+}
+
+
+/* ================================================================
  * CP hardware state programming functions
  */
 
@@ -57,15 +202,28 @@
 
 /* Emit 1.1 state
  */
-static void radeon_emit_state( drm_radeon_private_t *dev_priv,
-			       drm_radeon_context_regs_t *ctx,
-			       drm_radeon_texture_regs_t *tex,
-			       unsigned int dirty )
+static int radeon_emit_state( drm_radeon_private_t *dev_priv,
+			      drm_file_t *filp_priv,
+			      drm_radeon_context_regs_t *ctx,
+			      drm_radeon_texture_regs_t *tex,
+			      unsigned int dirty )
 {
 	RING_LOCALS;
 	DRM_DEBUG( "dirty=0x%08x\n", dirty );
 
 	if ( dirty & RADEON_UPLOAD_CONTEXT ) {
+		if ( radeon_check_and_fixup_offset( dev_priv, filp_priv,
+						    &ctx->rb3d_depthoffset ) ) {
+			DRM_ERROR( "Invalid depth buffer offset\n" );
+			return DRM_ERR( EINVAL );
+		}
+
+		if ( radeon_check_and_fixup_offset( dev_priv, filp_priv,
+						    &ctx->rb3d_coloroffset ) ) {
+			DRM_ERROR( "Invalid depth buffer offset\n" );
+			return DRM_ERR( EINVAL );
+		}
+
 		BEGIN_RING( 14 );
 		OUT_RING( CP_PACKET0( RADEON_PP_MISC, 6 ) );
 		OUT_RING( ctx->pp_misc );
@@ -149,6 +307,12 @@
 	}
 
 	if ( dirty & RADEON_UPLOAD_TEX0 ) {
+		if ( radeon_check_and_fixup_offset( dev_priv, filp_priv,
+						    &tex[0].pp_txoffset ) ) {
+			DRM_ERROR( "Invalid texture offset for unit 0\n" );
+			return DRM_ERR( EINVAL );
+		}
+
 		BEGIN_RING( 9 );
 		OUT_RING( CP_PACKET0( RADEON_PP_TXFILTER_0, 5 ) );
 		OUT_RING( tex[0].pp_txfilter );
@@ -163,6 +327,12 @@
 	}
 
 	if ( dirty & RADEON_UPLOAD_TEX1 ) {
+		if ( radeon_check_and_fixup_offset( dev_priv, filp_priv,
+						    &tex[1].pp_txoffset ) ) {
+			DRM_ERROR( "Invalid texture offset for unit 1\n" );
+			return DRM_ERR( EINVAL );
+		}
+
 		BEGIN_RING( 9 );
 		OUT_RING( CP_PACKET0( RADEON_PP_TXFILTER_1, 5 ) );
 		OUT_RING( tex[1].pp_txfilter );
@@ -177,6 +347,12 @@
 	}
 
 	if ( dirty & RADEON_UPLOAD_TEX2 ) {
+		if ( radeon_check_and_fixup_offset( dev_priv, filp_priv,
+						    &tex[2].pp_txoffset ) ) {
+			DRM_ERROR( "Invalid texture offset for unit 2\n" );
+			return DRM_ERR( EINVAL );
+		}
+
 		BEGIN_RING( 9 );
 		OUT_RING( CP_PACKET0( RADEON_PP_TXFILTER_2, 5 ) );
 		OUT_RING( tex[2].pp_txfilter );
@@ -189,12 +365,15 @@
 		OUT_RING( tex[2].pp_border_color );
 		ADVANCE_RING();
 	}
+
+	return 0;
 }
 
 /* Emit 1.2 state
  */
-static void radeon_emit_state2( drm_radeon_private_t *dev_priv,
-				drm_radeon_state_t *state )
+static int radeon_emit_state2( drm_radeon_private_t *dev_priv,
+			       drm_file_t *filp_priv,
+			       drm_radeon_state_t *state )
 {
 	RING_LOCALS;
 
@@ -206,7 +385,7 @@
 		ADVANCE_RING();
 	}
 
-	radeon_emit_state( dev_priv, &state->context, 
+	return radeon_emit_state( dev_priv, filp_priv, &state->context,
 			   state->tex, state->dirty );
 }
 
@@ -1065,6 +1244,7 @@
 				       drm_radeon_tex_image_t *image )
 {
 	drm_radeon_private_t *dev_priv = dev->dev_private;
+	drm_file_t *filp_priv;
 	drm_buf_t *buf;
 	u32 format;
 	u32 *buffer;
@@ -1074,6 +1254,13 @@
 	int i;
 	RING_LOCALS;
 
+	DRM_GET_PRIV_WITH_RETURN( filp_priv, filp );
+
+	if ( radeon_check_and_fixup_offset( dev_priv, filp_priv, &tex->offset ) ) {
+		DRM_ERROR( "Invalid destination offset\n" );
+		return DRM_ERR( EINVAL );
+	}
+
 	dev_priv->stats.boxes |= RADEON_BOX_TEXTURE_LOAD;
 
 	/* Flush the pixel cache.  This ensures no pixel data gets mixed
@@ -1221,7 +1408,7 @@
 		/* Update the input parameters for next time */
 		image->y += height;
 		image->height -= height;
-		(const u8 *)image->data += size;
+		image->data = (const u8 *)image->data + size;
 	} while (image->height > 0);
 
 	/* Flush the pixel cache after the blit completes.  This ensures
@@ -1377,6 +1564,7 @@
 {
 	DRM_DEVICE;
 	drm_radeon_private_t *dev_priv = dev->dev_private;
+	drm_file_t *filp_priv;
 	drm_radeon_sarea_t *sarea_priv = dev_priv->sarea_priv;
 	drm_device_dma_t *dma = dev->dma;
 	drm_buf_t *buf;
@@ -1390,6 +1578,8 @@
 		return DRM_ERR(EINVAL);
 	}
 
+	DRM_GET_PRIV_WITH_RETURN( filp_priv, filp );
+
 	DRM_COPY_FROM_USER_IOCTL( vertex, (drm_radeon_vertex_t *)data,
 			     sizeof(vertex) );
 
@@ -1429,11 +1619,14 @@
 		buf->used = vertex.count; /* not used? */
 
 		if ( sarea_priv->dirty & ~RADEON_UPLOAD_CLIPRECTS ) {
-			radeon_emit_state( dev_priv,
-					   &sarea_priv->context_state,
-					   sarea_priv->tex_state,
-					   sarea_priv->dirty );
-			
+			if ( radeon_emit_state( dev_priv, filp_priv,
+						&sarea_priv->context_state,
+						sarea_priv->tex_state,
+						sarea_priv->dirty ) ) {
+				DRM_ERROR( "radeon_emit_state failed\n" );
+				return DRM_ERR( EINVAL );
+			}
+
 			sarea_priv->dirty &= ~(RADEON_UPLOAD_TEX0IMAGES |
 					       RADEON_UPLOAD_TEX1IMAGES |
 					       RADEON_UPLOAD_TEX2IMAGES |
@@ -1461,6 +1654,7 @@
 {
 	DRM_DEVICE;
 	drm_radeon_private_t *dev_priv = dev->dev_private;
+	drm_file_t *filp_priv;
 	drm_radeon_sarea_t *sarea_priv = dev_priv->sarea_priv;
 	drm_device_dma_t *dma = dev->dma;
 	drm_buf_t *buf;
@@ -1475,6 +1669,8 @@
 		return DRM_ERR(EINVAL);
 	}
 
+	DRM_GET_PRIV_WITH_RETURN( filp_priv, filp );
+
 	DRM_COPY_FROM_USER_IOCTL( elts, (drm_radeon_indices_t *)data,
 			     sizeof(elts) );
 
@@ -1523,10 +1719,13 @@
 	buf->used = elts.end;
 
 	if ( sarea_priv->dirty & ~RADEON_UPLOAD_CLIPRECTS ) {
-		radeon_emit_state( dev_priv,
-				   &sarea_priv->context_state,
-				   sarea_priv->tex_state,
-				   sarea_priv->dirty );
+		if ( radeon_emit_state( dev_priv, filp_priv,
+					&sarea_priv->context_state,
+					sarea_priv->tex_state,
+					sarea_priv->dirty ) ) {
+			DRM_ERROR( "radeon_emit_state failed\n" );
+			return DRM_ERR( EINVAL );
+		}
 
 		sarea_priv->dirty &= ~(RADEON_UPLOAD_TEX0IMAGES |
 				       RADEON_UPLOAD_TEX1IMAGES |
@@ -1686,6 +1885,7 @@
 {
 	DRM_DEVICE;
 	drm_radeon_private_t *dev_priv = dev->dev_private;
+	drm_file_t *filp_priv;
 	drm_radeon_sarea_t *sarea_priv = dev_priv->sarea_priv;
 	drm_device_dma_t *dma = dev->dma;
 	drm_buf_t *buf;
@@ -1700,6 +1900,8 @@
 		return DRM_ERR(EINVAL);
 	}
 
+	DRM_GET_PRIV_WITH_RETURN( filp_priv, filp );
+
 	DRM_COPY_FROM_USER_IOCTL( vertex, (drm_radeon_vertex2_t *)data,
 			     sizeof(vertex) );
 
@@ -1747,7 +1949,10 @@
 					     sizeof(state) ) )
 				return DRM_ERR(EFAULT);
 
-			radeon_emit_state2( dev_priv, &state );
+			if ( radeon_emit_state2( dev_priv, filp_priv, &state ) ) {
+				DRM_ERROR( "radeon_emit_state2 failed\n" );
+				return DRM_ERR( EINVAL );
+			}
 
 			laststate = prim.stateidx;
 		}
@@ -1784,6 +1989,7 @@
 
 static int radeon_emit_packets( 
 	drm_radeon_private_t *dev_priv,
+	drm_file_t *filp_priv,
 	drm_radeon_cmd_header_t header,
 	drm_radeon_cmd_buffer_t *cmdbuf )
 {
@@ -1798,8 +2004,15 @@
 	sz = packet[id].len;
 	reg = packet[id].start;
 
-	if (sz * sizeof(int) > cmdbuf->bufsz) 
+	if (sz * sizeof(int) > cmdbuf->bufsz) {
+		DRM_ERROR( "Packet size provided larger than data provided\n" );
 		return DRM_ERR(EINVAL);
+	}
+
+	if ( radeon_check_and_fixup_packets( dev_priv, filp_priv, id, data ) ) {
+		DRM_ERROR( "Packet verification failed\n" );
+		return DRM_ERR( EINVAL );
+	}
 
 	BEGIN_RING(sz+1);
 	OUT_RING( CP_PACKET0( reg, (sz-1) ) );
@@ -1882,24 +2095,21 @@
 
 
 static int radeon_emit_packet3( drm_device_t *dev,
+				drm_file_t *filp_priv,
 				drm_radeon_cmd_buffer_t *cmdbuf )
 {
 	drm_radeon_private_t *dev_priv = dev->dev_private;
-	int cmdsz, tmp;
-	int *cmd = (int *)cmdbuf->buf;
+	unsigned int cmdsz;
+	int *cmd = (int *)cmdbuf->buf, ret;
 	RING_LOCALS;
 
-
 	DRM_DEBUG("\n");
 
-	if (DRM_GET_USER_UNCHECKED( tmp, &cmd[0]))
-		return DRM_ERR(EFAULT);
-
-	cmdsz = 2 + ((tmp & RADEON_CP_PACKET_COUNT_MASK) >> 16);
-
-	if ((tmp & 0xc0000000) != RADEON_CP_PACKET3 ||
-	    cmdsz * 4 > cmdbuf->bufsz)
-		return DRM_ERR(EINVAL);
+	if ( ( ret = radeon_check_and_fixup_packet3( dev_priv, filp_priv,
+						     cmdbuf, &cmdsz ) ) ) {
+		DRM_ERROR( "Packet verification failed\n" );
+		return ret;
+	}
 
 	BEGIN_RING( cmdsz );
 	OUT_RING_USER_TABLE( cmd, cmdsz );
@@ -1912,27 +2122,25 @@
 
 
 static int radeon_emit_packet3_cliprect( drm_device_t *dev,
+					 drm_file_t *filp_priv,
 					 drm_radeon_cmd_buffer_t *cmdbuf,
 					 int orig_nbox )
 {
 	drm_radeon_private_t *dev_priv = dev->dev_private;
 	drm_clip_rect_t box;
-	int cmdsz, tmp;
-	int *cmd = (int *)cmdbuf->buf;
+	unsigned int cmdsz;
+	int *cmd = (int *)cmdbuf->buf, ret;
 	drm_clip_rect_t *boxes = cmdbuf->boxes;
 	int i = 0;
 	RING_LOCALS;
 
 	DRM_DEBUG("\n");
 
-	if (DRM_GET_USER_UNCHECKED( tmp, &cmd[0]))
-		return DRM_ERR(EFAULT);
-
-	cmdsz = 2 + ((tmp & RADEON_CP_PACKET_COUNT_MASK) >> 16);
-
-	if ((tmp & 0xc0000000) != RADEON_CP_PACKET3 ||
-	    cmdsz * 4 > cmdbuf->bufsz)
-		return DRM_ERR(EINVAL);
+	if ( ( ret = radeon_check_and_fixup_packet3( dev_priv, filp_priv,
+						     cmdbuf, &cmdsz ) ) ) {
+		DRM_ERROR( "Packet verification failed\n" );
+		return ret;
+	}
 
 	if (!orig_nbox)
 		goto out;
@@ -2009,6 +2217,7 @@
 {
 	DRM_DEVICE;
 	drm_radeon_private_t *dev_priv = dev->dev_private;
+	drm_file_t *filp_priv;
 	drm_device_dma_t *dma = dev->dma;
 	drm_buf_t *buf = 0;
 	int idx;
@@ -2023,6 +2232,8 @@
 		return DRM_ERR(EINVAL);
 	}
 
+	DRM_GET_PRIV_WITH_RETURN( filp_priv, filp );
+
 	DRM_COPY_FROM_USER_IOCTL( cmdbuf, (drm_radeon_cmd_buffer_t *)data,
 			     sizeof(cmdbuf) );
 
@@ -2053,7 +2264,7 @@
 		switch (header.header.cmd_type) {
 		case RADEON_CMD_PACKET: 
 			DRM_DEBUG("RADEON_CMD_PACKET\n");
-			if (radeon_emit_packets( dev_priv, header, &cmdbuf )) {
+			if (radeon_emit_packets( dev_priv, filp_priv, header, &cmdbuf )) {
 				DRM_ERROR("radeon_emit_packets failed\n");
 				return DRM_ERR(EINVAL);
 			}
@@ -2096,7 +2307,7 @@
 
 		case RADEON_CMD_PACKET3:
 			DRM_DEBUG("RADEON_CMD_PACKET3\n");
-			if (radeon_emit_packet3( dev, &cmdbuf )) {
+			if (radeon_emit_packet3( dev, filp_priv, &cmdbuf )) {
 				DRM_ERROR("radeon_emit_packet3 failed\n");
 				return DRM_ERR(EINVAL);
 			}
@@ -2104,7 +2315,7 @@
 
 		case RADEON_CMD_PACKET3_CLIP:
 			DRM_DEBUG("RADEON_CMD_PACKET3_CLIP\n");
-			if (radeon_emit_packet3_cliprect( dev, &cmdbuf, orig_nbox )) {
+			if (radeon_emit_packet3_cliprect( dev, filp_priv, &cmdbuf, orig_nbox )) {
 				DRM_ERROR("radeon_emit_packet3_clip failed\n");
 				return DRM_ERR(EINVAL);
 			}
@@ -2203,3 +2414,31 @@
 	
 	return 0;
 }
+
+int radeon_cp_setparam( DRM_IOCTL_ARGS ) {
+	DRM_DEVICE;
+	drm_radeon_private_t *dev_priv = dev->dev_private;
+	drm_file_t *filp_priv;
+	drm_radeon_setparam_t sp;
+
+	if ( !dev_priv ) {
+		DRM_ERROR( "%s called with no initialization\n", __FUNCTION__ );
+		return DRM_ERR( EINVAL );
+	}
+
+	DRM_GET_PRIV_WITH_RETURN( filp_priv, filp );
+
+	DRM_COPY_FROM_USER_IOCTL( sp, ( drm_radeon_setparam_t* )data,
+				  sizeof( sp ) );
+
+	switch( sp.param ) {
+	case RADEON_SETPARAM_FB_LOCATION:
+		filp_priv->radeon_fb_delta = dev_priv->fb_location - sp.value;
+		break;
+	default:
+		DRM_DEBUG( "Invalid parameter %d\n", sp.param );
+		return DRM_ERR( EINVAL );
+	}
+
+	return 0;
+}
--- diff/drivers/char/drm/sis.h	2003-09-30 15:46:12.000000000 +0100
+++ source/drivers/char/drm/sis.h	2004-02-09 10:39:52.000000000 +0000
@@ -62,6 +62,13 @@
 	[DRM_IOCTL_NR(DRM_IOCTL_SIS_AGP_FREE)]	= { sis_ioctl_agp_free,	1, 0 }, \
 	[DRM_IOCTL_NR(DRM_IOCTL_SIS_FB_INIT)]	= { sis_fb_init,	1, 1 }
 
+#define DRIVER_PCI_IDS							\
+	{0x1039, 0x0300, 0, "SiS 300/305"},				\
+	{0x1039, 0x5300, 0, "SiS 540"},					\
+	{0x1039, 0x6300, 0, "SiS 630"},					\
+	{0x1039, 0x7300, 0, "SiS 730"},					\
+	{0, 0, 0, NULL}
+
 #define __HAVE_COUNTERS		5
 
 /* Buffer customization:
--- diff/drivers/char/drm/sis_mm.c	2003-09-30 15:46:12.000000000 +0100
+++ source/drivers/char/drm/sis_mm.c	2004-02-09 10:39:52.000000000 +0000
@@ -34,7 +34,11 @@
 #include "sis_drv.h"
 #include "sis_ds.h"
 #if defined(__linux__) && defined(CONFIG_FB_SIS)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
 #include <video/sisfb.h>
+#else
+#include <linux/sisfb.h>
+#endif
 #endif
 
 #define MAX_CONTEXT 100
@@ -132,7 +136,7 @@
 		retval = DRM_ERR(EINVAL);
 	sis_free(fb.free);
 
-	DRM_DEBUG("free fb, offset = %lu\n", fb.free);
+	DRM_DEBUG("free fb, offset = 0x%lx\n", fb.free);
 
 	return retval;
 }
--- diff/drivers/char/drm/tdfx.h	2002-10-16 04:28:22.000000000 +0100
+++ source/drivers/char/drm/tdfx.h	2004-02-09 10:39:52.000000000 +0000
@@ -39,4 +39,22 @@
 #define __HAVE_MTRR		1
 #define __HAVE_CTX_BITMAP	1
 
+#define DRIVER_AUTHOR		"VA Linux Systems Inc."
+
+#define DRIVER_NAME		"tdfx"
+#define DRIVER_DESC		"3dfx Banshee/Voodoo3+"
+#define DRIVER_DATE		"20010216"
+
+#define DRIVER_MAJOR		1
+#define DRIVER_MINOR		0
+#define DRIVER_PATCHLEVEL	0
+
+#define DRIVER_PCI_IDS							\
+	{0x121a, 0x0003, 0, "3dfx Voodoo Banshee"},			\
+	{0x121a, 0x0004, 0, "3dfx Voodoo3 2000"},			\
+	{0x121a, 0x0005, 0, "3dfx Voodoo3 3000"},			\
+	{0x121a, 0x0007, 0, "3dfx Voodoo4"},				\
+	{0x121a, 0x0009, 0, "3dfx Voodoo5"},				\
+	{0, 0, 0, NULL}
+
 #endif
--- diff/drivers/char/drm/tdfx_drv.c	2002-10-16 04:28:22.000000000 +0100
+++ source/drivers/char/drm/tdfx_drv.c	2004-02-09 10:39:52.000000000 +0000
@@ -34,47 +34,6 @@
 #include "tdfx.h"
 #include "drmP.h"
 
-#define DRIVER_AUTHOR		"VA Linux Systems Inc."
-
-#define DRIVER_NAME		"tdfx"
-#define DRIVER_DESC		"3dfx Banshee/Voodoo3+"
-#define DRIVER_DATE		"20010216"
-
-#define DRIVER_MAJOR		1
-#define DRIVER_MINOR		0
-#define DRIVER_PATCHLEVEL	0
-
-#ifndef PCI_VENDOR_ID_3DFX
-#define PCI_VENDOR_ID_3DFX 0x121A
-#endif
-#ifndef PCI_DEVICE_ID_3DFX_VOODOO5
-#define PCI_DEVICE_ID_3DFX_VOODOO5 0x0009
-#endif
-#ifndef PCI_DEVICE_ID_3DFX_VOODOO4
-#define PCI_DEVICE_ID_3DFX_VOODOO4 0x0007
-#endif
-#ifndef PCI_DEVICE_ID_3DFX_VOODOO3_3000 /* Voodoo3 3000 */
-#define PCI_DEVICE_ID_3DFX_VOODOO3_3000 0x0005
-#endif
-#ifndef PCI_DEVICE_ID_3DFX_VOODOO3_2000 /* Voodoo3 3000 */
-#define PCI_DEVICE_ID_3DFX_VOODOO3_2000 0x0004
-#endif
-#ifndef PCI_DEVICE_ID_3DFX_BANSHEE
-#define PCI_DEVICE_ID_3DFX_BANSHEE 0x0003
-#endif
-
-static drm_pci_list_t DRM(idlist)[] = {
-	{ PCI_VENDOR_ID_3DFX, PCI_DEVICE_ID_3DFX_BANSHEE },
-	{ PCI_VENDOR_ID_3DFX, PCI_DEVICE_ID_3DFX_VOODOO3_2000 },
-	{ PCI_VENDOR_ID_3DFX, PCI_DEVICE_ID_3DFX_VOODOO3_3000 },
-	{ PCI_VENDOR_ID_3DFX, PCI_DEVICE_ID_3DFX_VOODOO4 },
-	{ PCI_VENDOR_ID_3DFX, PCI_DEVICE_ID_3DFX_VOODOO5 },
-	{ 0, 0 }
-};
-
-#define DRIVER_CARD_LIST DRM(idlist)
-
-
 #include "drm_auth.h"
 #include "drm_bufs.h"
 #include "drm_context.h"
--- diff/drivers/char/dz.c	2003-10-09 09:47:34.000000000 +0100
+++ source/drivers/char/dz.c	2004-02-09 10:39:52.000000000 +0000
@@ -986,11 +986,7 @@
 		return 0;
 
 	case TIOCGSOFTCAR:
-		error = verify_area (VERIFY_WRITE, (void *)arg, sizeof(long));
-		if (error)
-			return error;
-		put_user(C_CLOCAL(tty) ? 1 : 0, (unsigned long *)arg);
-		return 0;
+		return put_user(C_CLOCAL(tty) ? 1 : 0, (unsigned long *)arg);
 
 	case TIOCSSOFTCAR:
 		if (get_user (arg, (unsigned long *)arg))
@@ -1001,10 +997,6 @@
 		return 0;
 
 	case TIOCGSERIAL:
-		error = verify_area(VERIFY_WRITE, (void *)arg,
-		                    sizeof(struct serial_struct));
-		if (error)
-			return error;
 		return get_serial_info(info, (struct serial_struct *)arg);
 
 	case TIOCSSERIAL:
--- diff/drivers/char/epca.c	2003-10-09 09:47:16.000000000 +0100
+++ source/drivers/char/epca.c	2004-02-09 10:39:52.000000000 +0000
@@ -2931,6 +2931,96 @@
 }
 /* --------------------- Begin pc_ioctl  ----------------------- */
 
+static int pc_tiocmget(struct tty_struct *tty, struct file *file)
+{
+	struct channel *ch = (struct channel *) tty->driver_data;
+	volatile struct board_chan *bc;
+	unsigned int mstat, mflag = 0;
+	unsigned long flags;
+
+	if (ch)
+		bc = ch->brdchan;
+	else
+	{
+		printk(KERN_ERR "<Error> - ch is NULL in pc_tiocmget!\n");
+		return(-EINVAL);
+	}
+
+	save_flags(flags);
+	cli();
+	globalwinon(ch);
+	mstat = bc->mstat;
+	memoff(ch);
+	restore_flags(flags);
+
+	if (mstat & ch->m_dtr)
+		mflag |= TIOCM_DTR;
+
+	if (mstat & ch->m_rts)
+		mflag |= TIOCM_RTS;
+
+	if (mstat & ch->m_cts)
+		mflag |= TIOCM_CTS;
+
+	if (mstat & ch->dsr)
+		mflag |= TIOCM_DSR;
+
+	if (mstat & ch->m_ri)
+		mflag |= TIOCM_RI;
+
+	if (mstat & ch->dcd)
+		mflag |= TIOCM_CD;
+
+	return mflag;
+}
+
+static int pc_tiocmset(struct tty_struct *tty, struct file *file,
+		       unsigned int set, unsigned int clear)
+{
+	struct channel *ch = (struct channel *) tty->driver_data;
+	unsigned long flags;
+
+	if (!ch) {
+		printk(KERN_ERR "<Error> - ch is NULL in pc_tiocmset!\n");
+		return(-EINVAL);
+	}
+
+	save_flags(flags);
+	cli();
+	/*
+	 * I think this modemfake stuff is broken.  It doesn't
+	 * correctly reflect the behaviour desired by the TIOCM*
+	 * ioctls.  Therefore this is probably broken.
+	 */
+	if (set & TIOCM_RTS) {
+		ch->modemfake |= ch->m_rts;
+		ch->modem |= ch->m_rts;
+	}
+	if (set & TIOCM_DTR) {
+		ch->modemfake |= ch->m_dtr;
+		ch->modem |= ch->m_dtr;
+	}
+	if (clear & TIOCM_RTS) {
+		ch->modemfake |= ch->m_rts;
+		ch->modem &= ~ch->m_rts;
+	}
+	if (clear & TIOCM_DTR) {
+		ch->modemfake |= ch->m_dtr;
+		ch->modem &= ~ch->m_dtr;
+	}
+
+	globalwinon(ch);
+
+	/*  --------------------------------------------------------------
+		The below routine generally sets up parity, baud, flow control
+		issues, etc.... It effect both control flags and input flags.
+	------------------------------------------------------------------ */
+
+	epcaparam(tty,ch);
+	memoff(ch);
+	restore_flags(flags);
+}
+
 static int pc_ioctl(struct tty_struct *tty, struct file * file,
 		    unsigned int cmd, unsigned long arg)
 { /* Begin pc_ioctl */
@@ -3021,90 +3111,15 @@
 		}
 
 		case TIOCMODG:
-		case TIOCMGET:
-
-			mflag = 0;
-
-			cli();
-			globalwinon(ch);
-			mstat = bc->mstat;
-			memoff(ch);
-			restore_flags(flags);
-
-			if (mstat & ch->m_dtr)
-				mflag |= TIOCM_DTR;
-
-			if (mstat & ch->m_rts)
-				mflag |= TIOCM_RTS;
-
-			if (mstat & ch->m_cts)
-				mflag |= TIOCM_CTS;
-
-			if (mstat & ch->dsr)
-				mflag |= TIOCM_DSR;
-
-			if (mstat & ch->m_ri)
-				mflag |= TIOCM_RI;
-
-			if (mstat & ch->dcd)
-				mflag |= TIOCM_CD;
-
-			error = verify_area(VERIFY_WRITE, (void *) arg,sizeof(long));
-
-			if (error)
-				return error;
-
-			putUser(mflag, (unsigned int *) arg);
-
+			mflag = pc_tiocmget(tty, file);
+			if (putUser(mflag, (unsigned int *) arg))
+				return -EFAULT;
 			break;
 
-		case TIOCMBIS:
-		case TIOCMBIC:
 		case TIOCMODS:
-		case TIOCMSET:
-
-			getUser(mstat, (unsigned int *)arg);
-
-			mflag = 0;
-			if (mstat & TIOCM_DTR)
-				mflag |= ch->m_dtr;
-
-			if (mstat & TIOCM_RTS)
-				mflag |= ch->m_rts;
-
-			switch (cmd) 
-			{ /* Begin switch cmd */
-
-				case TIOCMODS:
-				case TIOCMSET:
-					ch->modemfake = ch->m_dtr|ch->m_rts;
-					ch->modem = mflag;
-					break;
-
-				case TIOCMBIS:
-					ch->modemfake |= mflag;
-					ch->modem |= mflag;
-					break;
-
-				case TIOCMBIC:
-					ch->modemfake |= mflag;
-					ch->modem &= ~mflag;
-					break;
-
-			} /* End switch cmd */
-
-			cli();
-			globalwinon(ch);
-
-			/*  --------------------------------------------------------------
-				The below routine generally sets up parity, baud, flow control 
-				issues, etc.... It effect both control flags and input flags.
-			------------------------------------------------------------------ */
-
-			epcaparam(tty,ch);
-			memoff(ch);
-			restore_flags(flags);
-			break;
+			if (getUser(mstat, (unsigned int *)arg))
+				return -EFAULT;
+			return pc_tiocmset(tty, file, mstat, ~mstat);
 
 		case TIOCSDTR:
 			ch->omodem |= ch->m_dtr;
--- diff/drivers/char/esp.c	2003-10-09 09:47:34.000000000 +0100
+++ source/drivers/char/esp.c	2004-02-09 10:39:52.000000000 +0000
@@ -1753,55 +1753,52 @@
 }
 
 
-static int get_modem_info(struct esp_struct * info, unsigned int *value)
+static int esp_tiocmget(struct tty_struct *tty, struct file *file)
 {
+	struct esp_struct * info = (struct esp_struct *)tty->driver_data;
 	unsigned char control, status;
-	unsigned int result;
+
+	if (serial_paranoia_check(info, tty->name, __FUNCTION__))
+		return -ENODEV;
+	if (tty->flags & (1 << TTY_IO_ERROR))
+		return -EIO;
 
 	control = info->MCR;
 	cli();
 	serial_out(info, UART_ESI_CMD1, ESI_GET_UART_STAT);
 	status = serial_in(info, UART_ESI_STAT2);
 	sti();
-	result =  ((control & UART_MCR_RTS) ? TIOCM_RTS : 0)
+	return    ((control & UART_MCR_RTS) ? TIOCM_RTS : 0)
 		| ((control & UART_MCR_DTR) ? TIOCM_DTR : 0)
 		| ((status  & UART_MSR_DCD) ? TIOCM_CAR : 0)
 		| ((status  & UART_MSR_RI) ? TIOCM_RNG : 0)
 		| ((status  & UART_MSR_DSR) ? TIOCM_DSR : 0)
 		| ((status  & UART_MSR_CTS) ? TIOCM_CTS : 0);
-	return put_user(result,value);
 }
 
-static int set_modem_info(struct esp_struct * info, unsigned int cmd,
-			  unsigned int *value)
+static int esp_tiocmset(struct tty_struct *tty, struct file *file,
+			unsigned int set, unsigned int clear)
 {
+	struct esp_struct * info = (struct esp_struct *)tty->driver_data;
 	unsigned int arg;
 
-	if (get_user(arg, value))
-		return -EFAULT;
+	if (serial_paranoia_check(info, tty->name, __FUNCTION__))
+		return -ENODEV;
+	if (tty->flags & (1 << TTY_IO_ERROR))
+		return -EIO;
 
-	switch (cmd) {
-	case TIOCMBIS: 
-		if (arg & TIOCM_RTS)
-			info->MCR |= UART_MCR_RTS;
-		if (arg & TIOCM_DTR)
-			info->MCR |= UART_MCR_DTR;
-		break;
-	case TIOCMBIC:
-		if (arg & TIOCM_RTS)
-			info->MCR &= ~UART_MCR_RTS;
-		if (arg & TIOCM_DTR)
-			info->MCR &= ~UART_MCR_DTR;
-		break;
-	case TIOCMSET:
-		info->MCR = ((info->MCR & ~(UART_MCR_RTS | UART_MCR_DTR))
-			     | ((arg & TIOCM_RTS) ? UART_MCR_RTS : 0)
-			     | ((arg & TIOCM_DTR) ? UART_MCR_DTR : 0));
-		break;
-	default:
-		return -EINVAL;
-	}
 	cli();
+
+	if (set & TIOCM_RTS)
+		info->MCR |= UART_MCR_RTS;
+	if (set & TIOCM_DTR)
+		info->MCR |= UART_MCR_DTR;
+
+	if (clear & TIOCM_RTS)
+		info->MCR &= ~UART_MCR_RTS;
+	if (clear & TIOCM_DTR)
+		info->MCR &= ~UART_MCR_DTR;
+
 	serial_out(info, UART_ESI_CMD1, ESI_WRITE_UART);
 	serial_out(info, UART_ESI_CMD2, UART_MCR);
 	serial_out(info, UART_ESI_CMD2, info->MCR);
@@ -1853,12 +1850,6 @@
 	}
 	
 	switch (cmd) {
-		case TIOCMGET:
-			return get_modem_info(info, (unsigned int *) arg);
-		case TIOCMBIS:
-		case TIOCMBIC:
-		case TIOCMSET:
-			return set_modem_info(info, cmd, (unsigned int *) arg);
 		case TIOCGSERIAL:
 			return get_serial_info(info,
 					       (struct serial_struct *) arg);
@@ -2444,6 +2435,8 @@
 	.hangup = esp_hangup,
 	.break_ctl = esp_break,
 	.wait_until_sent = rs_wait_until_sent,
+	.tiocmget = esp_tiocmget,
+	.tiocmset = esp_tiocmset,
 };
 
 /*
--- diff/drivers/char/genrtc.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/char/genrtc.c	2004-02-09 10:39:52.000000000 +0000
@@ -523,4 +523,4 @@
 
 MODULE_AUTHOR("Richard Zidlicky");
 MODULE_LICENSE("GPL");
-
+MODULE_ALIAS_MISCDEV(RTC_MINOR);
--- diff/drivers/char/hvc_console.c	2003-09-30 15:46:13.000000000 +0100
+++ source/drivers/char/hvc_console.c	2004-02-09 10:39:52.000000000 +0000
@@ -29,6 +29,7 @@
 #include <linux/kbd_kern.h>
 #include <asm/uaccess.h>
 #include <linux/spinlock.h>
+#include <linux/cpumask.h>
 
 extern int hvc_count(int *);
 extern int hvc_get_chars(int index, char *buf, int count);
@@ -223,10 +224,10 @@
 	spin_unlock_irqrestore(&hp->lock, flags);
 }
 
-#if defined (CONFIG_XMON)
-extern unsigned long cpus_in_xmon;
+#if defined(CONFIG_XMON) && defined(CONFIG_SMP)
+extern cpumask_t cpus_in_xmon;
 #else
-unsigned long cpus_in_xmon=0;
+static const cpumask_t cpus_in_xmon = CPU_MASK_NONE;
 #endif
 
 
@@ -237,7 +238,7 @@
 	daemonize("khvcd");
 
 	for (;;) {
-		if (!cpus_in_xmon) {
+		if (cpus_empty(cpus_in_xmon)) {
 			for (i = 0; i < MAX_NR_HVC_CONSOLES; ++i)
 				hvc_poll(i);
 		}
@@ -268,8 +269,9 @@
 		return -ENOMEM;
 
 	hvc_driver->owner = THIS_MODULE;
+	hvc_driver->devfs_name = "hvc/";
 	hvc_driver->driver_name = "hvc";
-	hvc_driver->name = "hvc/";
+	hvc_driver->name = "hvc";
 	hvc_driver->major = HVC_MAJOR;
 	hvc_driver->minor_start = HVC_MINOR;
 	hvc_driver->type = TTY_DRIVER_TYPE_SYSTEM;
--- diff/drivers/char/hw_random.c	2003-09-30 15:46:13.000000000 +0100
+++ source/drivers/char/hw_random.c	2004-02-09 10:39:52.000000000 +0000
@@ -454,11 +454,7 @@
 
 static void via_cleanup(void)
 {
-	u32 lo, hi;
-
-	rdmsr(MSR_VIA_RNG, lo, hi);
-	lo &= ~VIA_RNG_ENABLE;
-	wrmsr(MSR_VIA_RNG, lo, hi);
+	/* do nothing */
 }
 
 
--- diff/drivers/char/ip2/ip2.h	2003-05-21 11:49:54.000000000 +0100
+++ source/drivers/char/ip2/ip2.h	2004-02-09 10:39:52.000000000 +0000
@@ -59,7 +59,7 @@
  * console warning.
  
  * When the driver is loaded as a module these setting can be overridden on the 
- * modprobe command line or on an option line in /etc/modules.conf.
+ * modprobe command line or on an option line in /etc/modprobe.conf.
  * If the driver is built-in the configuration must be 
  * set here for ISA cards and address set to 1 and 2 for PCI and EISA.
  *
@@ -80,7 +80,7 @@
 
  /* this structure is zeroed out because the suggested method is to configure
   * the driver as a module, set up the parameters with an options line in
-  * /etc/modules.conf and load with modprobe, kerneld or kmod, the kernel
+  * /etc/modprobe.conf and load with modprobe or kmod, the kernel
   * module loader
   */
 
--- diff/drivers/char/ip2main.c	2003-10-09 09:47:34.000000000 +0100
+++ source/drivers/char/ip2main.c	2004-02-09 10:39:52.000000000 +0000
@@ -186,6 +186,9 @@
 static void ip2_stop(PTTY);
 static void ip2_start(PTTY);
 static void ip2_hangup(PTTY);
+static int  ip2_tiocmget(struct tty_struct *tty, struct file *file);
+static int  ip2_tiocmset(struct tty_struct *tty, struct file *file,
+			 unsigned int set, unsigned int clear);
 
 static void set_irq(int, int);
 static void ip2_interrupt_bh(i2eBordStrPtr pB);
@@ -466,6 +469,8 @@
 	.start           = ip2_start,
 	.hangup          = ip2_hangup,
 	.read_proc       = ip2_read_proc,
+	.tiocmget	 = ip2_tiocmget,
+	.tiocmset	 = ip2_tiocmset,
 };
 
 /******************************************************************************/
@@ -1951,6 +1956,80 @@
 /* Device Ioctl Section                                                       */
 /******************************************************************************/
 
+static int ip2_tiocmget(struct tty_struct *tty, struct file *file)
+{
+	i2ChanStrPtr pCh = DevTable[tty->index];
+	wait_queue_t wait;
+
+	if (pCh == NULL)
+		return -ENODEV;
+
+/*
+	FIXME - the following code is causing a NULL pointer dereference in
+	2.3.51 in an interrupt handler.  It's suppose to prompt the board
+	to return the DSS signal status immediately.  Why doesn't it do
+	the same thing in 2.2.14?
+*/
+
+/*	This thing is still busted in the 1.2.12 driver on 2.4.x
+	and even hoses the serial console so the oops can be trapped.
+		/\/\|=mhw=|\/\/			*/
+
+#ifdef	ENABLE_DSSNOW
+	i2QueueCommands(PTYPE_BYPASS, pCh, 100, 1, CMD_DSS_NOW);
+
+	init_waitqueue_entry(&wait, current);
+	add_wait_queue(&pCh->dss_now_wait, &wait);
+	set_current_state( TASK_INTERRUPTIBLE );
+
+	serviceOutgoingFifo( pCh->pMyBord );
+
+	schedule();
+
+	set_current_state( TASK_RUNNING );
+	remove_wait_queue(&pCh->dss_now_wait, &wait);
+
+	if (signal_pending(current)) {
+		return -EINTR;
+	}
+#endif
+	return  ((pCh->dataSetOut & I2_RTS) ? TIOCM_RTS : 0)
+	      | ((pCh->dataSetOut & I2_DTR) ? TIOCM_DTR : 0)
+	      | ((pCh->dataSetIn  & I2_DCD) ? TIOCM_CAR : 0)
+	      | ((pCh->dataSetIn  & I2_RI)  ? TIOCM_RNG : 0)
+	      | ((pCh->dataSetIn  & I2_DSR) ? TIOCM_DSR : 0)
+	      | ((pCh->dataSetIn  & I2_CTS) ? TIOCM_CTS : 0);
+}
+
+static int ip2_tiocmset(struct tty_struct *tty, struct file *file,
+			unsigned int set, unsigned int clear)
+{
+	i2ChanStrPtr pCh = DevTable[tty->index];
+
+	if (pCh == NULL)
+		return -ENODEV;
+
+	if (set & TIOCM_RTS) {
+		i2QueueCommands(PTYPE_INLINE, pCh, 100, 1, CMD_RTSUP);
+		pCh->dataSetOut |= I2_RTS;
+	}
+	if (set & TIOCM_DTR) {
+		i2QueueCommands(PTYPE_INLINE, pCh, 100, 1, CMD_DTRUP);
+		pCh->dataSetOut |= I2_DTR;
+	}
+
+	if (clear & TIOCM_RTS) {
+		i2QueueCommands(PTYPE_INLINE, pCh, 100, 1, CMD_RTSDN);
+		pCh->dataSetOut &= ~I2_RTS;
+	}
+	if (clear & TIOCM_DTR) {
+		i2QueueCommands(PTYPE_INLINE, pCh, 100, 1, CMD_DTRDN);
+		pCh->dataSetOut &= ~I2_DTR;
+	}
+	serviceOutgoingFifo( pCh->pMyBord );
+	return 0;
+}
+
 /******************************************************************************/
 /* Function:   ip2_ioctl()                                                    */
 /* Parameters: Pointer to tty structure                                       */
@@ -2078,57 +2157,6 @@
 		
 		break;
 
-	case TIOCMGET:
-
-		ip2trace (CHANN, ITRC_IOCTL, 8, 1, rc );
-
-/*
-	FIXME - the following code is causing a NULL pointer dereference in
-	2.3.51 in an interrupt handler.  It's suppose to prompt the board
-	to return the DSS signal status immediately.  Why doesn't it do
-	the same thing in 2.2.14?
-*/
-
-/*	This thing is still busted in the 1.2.12 driver on 2.4.x
-	and even hoses the serial console so the oops can be trapped.
-		/\/\|=mhw=|\/\/			*/
-
-#ifdef	ENABLE_DSSNOW
-		i2QueueCommands(PTYPE_BYPASS, pCh, 100, 1, CMD_DSS_NOW);
-
-		init_waitqueue_entry(&wait, current);
-		add_wait_queue(&pCh->dss_now_wait, &wait);
-		set_current_state( TASK_INTERRUPTIBLE );
-
-		serviceOutgoingFifo( pCh->pMyBord );
-
-		schedule();
-
-		set_current_state( TASK_RUNNING );
-		remove_wait_queue(&pCh->dss_now_wait, &wait);
-
-		if (signal_pending(current)) {
-			return -EINTR;
-		}
-#endif
-		rc = put_user(
-				    ((pCh->dataSetOut & I2_RTS) ? TIOCM_RTS : 0)
-				  | ((pCh->dataSetOut & I2_DTR) ? TIOCM_DTR : 0)
-				  | ((pCh->dataSetIn  & I2_DCD) ? TIOCM_CAR : 0)
-				  | ((pCh->dataSetIn  & I2_RI)  ? TIOCM_RNG : 0)
-				  | ((pCh->dataSetIn  & I2_DSR) ? TIOCM_DSR : 0)
-				  | ((pCh->dataSetIn  & I2_CTS) ? TIOCM_CTS : 0),
-				(unsigned int *) arg);
-		break;
-
-	case TIOCMBIS:
-	case TIOCMBIC:
-	case TIOCMSET:
-		ip2trace (CHANN, ITRC_IOCTL, 9, 0 );
-
-		rc = set_modem_info(pCh, cmd, (unsigned int *) arg);
-		break;
-
 	/*
 	 * Wait for any of the 4 modem inputs (DCD,RI,DSR,CTS) to change - mask
 	 * passed in arg for lines of interest (use |'ed TIOCM_RNG/DSR/CD/CTS
@@ -2239,70 +2267,6 @@
 }
 
 /******************************************************************************/
-/* Function:   set_modem_info()                                               */
-/* Parameters: Pointer to channel structure                                   */
-/*             Specific ioctl command                                         */
-/*             Pointer to source for new settings                             */
-/* Returns:    Nothing                                                        */
-/*                                                                            */
-/* Description:                                                               */
-/* This returns the current settings of the dataset signal inputs to the user */
-/* program.                                                                   */
-/******************************************************************************/
-static int
-set_modem_info(i2ChanStrPtr pCh, unsigned cmd, unsigned int *value)
-{
-	int rc;
-	unsigned int arg;
-
-	rc = get_user(arg,value);
-	if (rc)
-		return rc;
-	switch(cmd) {
-	case TIOCMBIS:
-		if (arg & TIOCM_RTS) {
-			i2QueueCommands(PTYPE_INLINE, pCh, 100, 1, CMD_RTSUP);
-			pCh->dataSetOut |= I2_RTS;
-		}
-		if (arg & TIOCM_DTR) {
-			i2QueueCommands(PTYPE_INLINE, pCh, 100, 1, CMD_DTRUP);
-			pCh->dataSetOut |= I2_DTR;
-		}
-		break;
-	case TIOCMBIC:
-		if (arg & TIOCM_RTS) {
-			i2QueueCommands(PTYPE_INLINE, pCh, 100, 1, CMD_RTSDN);
-			pCh->dataSetOut &= ~I2_RTS;
-		}
-		if (arg & TIOCM_DTR) {
-			i2QueueCommands(PTYPE_INLINE, pCh, 100, 1, CMD_DTRDN);
-			pCh->dataSetOut &= ~I2_DTR;
-		}
-		break;
-	case TIOCMSET:
-		if ( (arg & TIOCM_RTS) && !(pCh->dataSetOut & I2_RTS) ) {
-			i2QueueCommands(PTYPE_INLINE, pCh, 100, 1, CMD_RTSUP);
-			pCh->dataSetOut |= I2_RTS;
-		} else if ( !(arg & TIOCM_RTS) && (pCh->dataSetOut & I2_RTS) ) {
-			i2QueueCommands(PTYPE_INLINE, pCh, 100, 1, CMD_RTSDN);
-			pCh->dataSetOut &= ~I2_RTS;
-		}
-		if ( (arg & TIOCM_DTR) && !(pCh->dataSetOut & I2_DTR) ) {
-			i2QueueCommands(PTYPE_INLINE, pCh, 100, 1, CMD_DTRUP);
-			pCh->dataSetOut |= I2_DTR;
-		} else if ( !(arg & TIOCM_DTR) && (pCh->dataSetOut & I2_DTR) ) {
-			i2QueueCommands(PTYPE_INLINE, pCh, 100, 1, CMD_DTRDN);
-			pCh->dataSetOut &= ~I2_DTR;
-		}
-		break;
-	default:
-		return -EINVAL;
-	}
-	serviceOutgoingFifo( pCh->pMyBord );
-	return 0;
-}
-
-/******************************************************************************/
 /* Function:   GetSerialInfo()                                                */
 /* Parameters: Pointer to channel structure                                   */
 /*             Pointer to old termios structure                               */
@@ -2964,7 +2928,7 @@
 			rc = put_user(ip2_throttle, pIndex++ );
 			rc = put_user(ip2_unthrottle, pIndex++ );
 			rc = put_user(ip2_ioctl, pIndex++ );
-			rc = put_user(set_modem_info, pIndex++ );
+			rc = put_user(0, pIndex++ );
 			rc = put_user(get_serial_info, pIndex++ );
 			rc = put_user(set_serial_info, pIndex++ );
 			rc = put_user(ip2_set_termios, pIndex++ );
--- diff/drivers/char/isicom.c	2003-10-09 09:47:34.000000000 +0100
+++ source/drivers/char/isicom.c	2004-02-09 10:39:52.000000000 +0000
@@ -29,7 +29,7 @@
  *	You can find the original tools for this direct from Multitech
  *		ftp://ftp.multitech.com/ISI-Cards/
  *
- *	Having installed the cards the module options (/etc/modules.conf)
+ *	Having installed the cards the module options (/etc/modprobe.conf)
  *
  *	options isicom   io=card1,card2,card3,card4 irq=card1,card2,card3,card4
  *
@@ -1291,63 +1291,44 @@
 out:	restore_flags(flags);
 }
 
-static int isicom_get_modem_info(struct isi_port * port, unsigned int * value)
+static int isicom_tiocmget(struct tty_struct *tty, struct file *file)
 {
+	struct isi_port * port = (struct isi_port *) tty->driver_data;
 	/* just send the port status */
-	unsigned int info;
 	unsigned short status = port->status;
+
+	if (isicom_paranoia_check(port, tty->name, "isicom_ioctl"))
+		return -ENODEV;
 	
-	info =  ((status & ISI_RTS) ? TIOCM_RTS : 0) |
+	return  ((status & ISI_RTS) ? TIOCM_RTS : 0) |
 		((status & ISI_DTR) ? TIOCM_DTR : 0) |
 		((status & ISI_DCD) ? TIOCM_CAR : 0) |
 		((status & ISI_DSR) ? TIOCM_DSR : 0) |
 		((status & ISI_CTS) ? TIOCM_CTS : 0) |
 		((status & ISI_RI ) ? TIOCM_RI  : 0);
-	return put_user(info, (unsigned int *) value);
 }
 
-static int isicom_set_modem_info(struct isi_port * port, unsigned int cmd,
-					unsigned int * value)
+static int isicom_tiocmset(struct tty_struct *tty, struct file *file,
+			   unsigned int set, unsigned int clear)
 {
+	struct isi_port * port = (struct isi_port *) tty->driver_data;
 	unsigned int arg;
 	unsigned long flags;
 	
-	if(get_user(arg, value))
-		return -EFAULT;
+	if (isicom_paranoia_check(port, tty->name, "isicom_ioctl"))
+		return -ENODEV;
 	
 	save_flags(flags); cli();
-	
-	switch(cmd) {
-		case TIOCMBIS:
-			if (arg & TIOCM_RTS) 
-				raise_rts(port);
-			if (arg & TIOCM_DTR) 
-				raise_dtr(port);
-			break;
-		
-		case TIOCMBIC:
-			if (arg & TIOCM_RTS)
-				drop_rts(port);
-			if (arg & TIOCM_DTR)
-				drop_dtr(port);	
-			break;
-			
-		case TIOCMSET:
-			if (arg & TIOCM_RTS)
-				raise_rts(port);
-			else
-				drop_rts(port);
-			
-			if (arg & TIOCM_DTR)
-				raise_dtr(port);
-			else
-				drop_dtr(port);
-			break;
-		
-		default:
-			restore_flags(flags);
-			return -EINVAL;		 	
-	}
+	if (set & TIOCM_RTS)
+		raise_rts(port);
+	if (set & TIOCM_DTR)
+		raise_dtr(port);
+
+	if (clear & TIOCM_RTS)
+		drop_rts(port);
+	if (clear & TIOCM_DTR)
+		drop_dtr(port);
+
 	restore_flags(flags);
 	return 0;
 }			
@@ -1445,15 +1426,6 @@
 				(arg ? CLOCAL : 0));
 			return 0;	
 			
-		case TIOCMGET:
-			return isicom_get_modem_info(port, (unsigned int*) arg);
-			
-		case TIOCMBIS:
-		case TIOCMBIC:
-		case TIOCMSET: 	
-			return isicom_set_modem_info(port, cmd, 
-					(unsigned int *) arg);
-		
 		case TIOCGSERIAL:
 			return isicom_get_serial_info(port, 
 					(struct serial_struct *) arg);
@@ -1640,6 +1612,8 @@
 	.start	= isicom_start,
 	.hangup	= isicom_hangup,
 	.flush_buffer	= isicom_flush_buffer,
+	.tiocmget	= isicom_tiocmget,
+	.tiocmset	= isicom_tiocmset,
 };
 
 static int register_drivers(void)
--- diff/drivers/char/istallion.c	2003-10-09 09:47:34.000000000 +0100
+++ source/drivers/char/istallion.c	2004-02-09 10:39:52.000000000 +0000
@@ -417,7 +417,6 @@
 #ifndef PCI_DEVICE_ID_ECRA
 #define	PCI_DEVICE_ID_ECRA		0x0004
 #endif
-#endif
 
 static struct pci_device_id istallion_pci_tbl[] = {
 	{ PCI_VENDOR_ID_STALLION, PCI_DEVICE_ID_ECRA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
@@ -425,6 +424,8 @@
 };
 MODULE_DEVICE_TABLE(pci, istallion_pci_tbl);
 
+#endif /* CONFIG_PCI */
+
 /*****************************************************************************/
 
 /*
@@ -1990,6 +1991,61 @@
 
 /*****************************************************************************/
 
+static int stli_tiocmget(struct tty_struct *tty, struct file *file)
+{
+	stliport_t *portp = tty->driver_data;
+	stlibrd_t *brdp;
+	int rc;
+
+	if (portp == (stliport_t *) NULL)
+		return(-ENODEV);
+	if ((portp->brdnr < 0) || (portp->brdnr >= stli_nrbrds))
+		return(0);
+	brdp = stli_brds[portp->brdnr];
+	if (brdp == (stlibrd_t *) NULL)
+		return(0);
+	if (tty->flags & (1 << TTY_IO_ERROR))
+		return(-EIO);
+
+	if ((rc = stli_cmdwait(brdp, portp, A_GETSIGNALS,
+			       &portp->asig, sizeof(asysigs_t), 1)) < 0)
+		return(rc);
+
+	return stli_mktiocm(portp->asig.sigvalue);
+}
+
+static int stli_tiocmset(struct tty_struct *tty, struct file *file,
+			 unsigned int set, unsigned int clear)
+{
+	stliport_t *portp = tty->driver_data;
+	stlibrd_t *brdp;
+	int rts = -1, dtr = -1;
+
+	if (portp == (stliport_t *) NULL)
+		return(-ENODEV);
+	if ((portp->brdnr < 0) || (portp->brdnr >= stli_nrbrds))
+		return(0);
+	brdp = stli_brds[portp->brdnr];
+	if (brdp == (stlibrd_t *) NULL)
+		return(0);
+	if (tty->flags & (1 << TTY_IO_ERROR))
+		return(-EIO);
+
+	if (set & TIOCM_RTS)
+		rts = 1;
+	if (set & TIOCM_DTR)
+		dtr = 1;
+	if (clear & TIOCM_RTS)
+		rts = 0;
+	if (clear & TIOCM_DTR)
+		dtr = 0;
+
+	stli_mkasysigs(&portp->asig, dtr, rts);
+
+	return stli_cmdwait(brdp, portp, A_SETSIGNALS, &portp->asig,
+			    sizeof(asysigs_t), 0);
+}
+
 static int stli_ioctl(struct tty_struct *tty, struct file *file, unsigned int cmd, unsigned long arg)
 {
 	stliport_t	*portp;
@@ -2033,43 +2089,6 @@
 				(tty->termios->c_cflag & ~CLOCAL) |
 				(ival ? CLOCAL : 0);
 		break;
-	case TIOCMGET:
-		if ((rc = verify_area(VERIFY_WRITE, (void *) arg,
-		    sizeof(unsigned int))) == 0) {
-			if ((rc = stli_cmdwait(brdp, portp, A_GETSIGNALS,
-			    &portp->asig, sizeof(asysigs_t), 1)) < 0)
-				return(rc);
-			lval = stli_mktiocm(portp->asig.sigvalue);
-			put_user(lval, (unsigned int *) arg);
-		}
-		break;
-	case TIOCMBIS:
-		if ((rc = get_user(ival, (unsigned int *) arg)) == 0) {
-			stli_mkasysigs(&portp->asig,
-				((ival & TIOCM_DTR) ? 1 : -1),
-				((ival & TIOCM_RTS) ? 1 : -1));
-			rc = stli_cmdwait(brdp, portp, A_SETSIGNALS,
-				&portp->asig, sizeof(asysigs_t), 0);
-		}
-		break;
-	case TIOCMBIC:
-		if ((rc = get_user(ival, (unsigned int *) arg)) == 0) {
-			stli_mkasysigs(&portp->asig,
-				((ival & TIOCM_DTR) ? 0 : -1),
-				((ival & TIOCM_RTS) ? 0 : -1));
-			rc = stli_cmdwait(brdp, portp, A_SETSIGNALS,
-				&portp->asig, sizeof(asysigs_t), 0);
-		}
-		break;
-	case TIOCMSET:
-		if ((rc = get_user(ival, (unsigned int *) arg)) == 0) {
-			stli_mkasysigs(&portp->asig,
-				((ival & TIOCM_DTR) ? 1 : 0),
-				((ival & TIOCM_RTS) ? 1 : 0));
-			rc = stli_cmdwait(brdp, portp, A_SETSIGNALS,
-				&portp->asig, sizeof(asysigs_t), 0);
-		}
-		break;
 	case TIOCGSERIAL:
 		if ((rc = verify_area(VERIFY_WRITE, (void *) arg,
 		    sizeof(struct serial_struct))) == 0)
@@ -5254,6 +5273,8 @@
 	.wait_until_sent = stli_waituntilsent,
 	.send_xchar = stli_sendxchar,
 	.read_proc = stli_readproc,
+	.tiocmget = stli_tiocmget,
+	.tiocmset = stli_tiocmset,
 };
 
 /*****************************************************************************/
--- diff/drivers/char/keyboard.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/char/keyboard.c	2004-02-09 10:39:52.000000000 +0000
@@ -202,7 +202,7 @@
 		return -EINVAL;
 
 	oldkey = INPUT_KEYCODE(dev, scancode);
-	INPUT_KEYCODE(dev, scancode) = keycode;
+	SET_INPUT_KEYCODE(dev, scancode, oldkey);
 
 	clear_bit(oldkey, dev->keybit);
 	set_bit(keycode, dev->keybit);
@@ -972,11 +972,6 @@
 static int emulate_raw(struct vc_data *vc, unsigned int keycode, 
 		       unsigned char up_flag)
 {
-#ifdef CONFIG_MAC_EMUMOUSEBTN
-	if (mac_hid_mouse_emulate_buttons(1, keycode, !up_flag))
-		return 0;
-#endif /* CONFIG_MAC_EMUMOUSEBTN */
-
 	if (keycode > 255 || !x86_keycodes[keycode])
 		return -1; 
 
@@ -1055,6 +1050,11 @@
 
 	rep = (down == 2);
 
+#ifdef CONFIG_MAC_EMUMOUSEBTN
+	if (mac_hid_mouse_emulate_buttons(1, keycode, down))
+		return;
+#endif /* CONFIG_MAC_EMUMOUSEBTN */
+
 	if ((raw_mode = (kbd->kbdmode == VC_RAW)))
 		if (emulate_raw(vc, keycode, !down << 7))
 			if (keycode < BTN_MISC)
@@ -1067,6 +1067,9 @@
 	}
 	if (sysrq_down && down && !rep) {
 		handle_sysrq(kbd_sysrq_xlate[keycode], regs, tty);
+#ifdef CONFIG_KGDB_SYSRQ
+                sysrq_down = 0;        /* in case we miss the "up" event */
+#endif
 		return;
 	}
 #endif
--- diff/drivers/char/mem.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/char/mem.c	2004-02-09 10:39:52.000000000 +0000
@@ -41,6 +41,7 @@
 extern void tapechar_init(void);
 #endif
 
+#ifdef pgprot_noncached
 /*
  * Architectures vary in how they handle caching for addresses
  * outside of main memory.
@@ -66,19 +67,21 @@
 	  && addr >= __pa(high_memory);
 #elif defined(CONFIG_IA64)
 	/*
-	 * On ia64, we ignore O_SYNC because we cannot tolerate memory attribute aliases.
+	 * On ia64, we ignore O_SYNC because we cannot tolerate memory
+	 * attribute aliases.
 	 */
 	return !(efi_mem_attributes(addr) & EFI_MEMORY_WB);
 #else
 	/*
-	 * Accessing memory above the top the kernel knows about or through a file pointer
-	 * that was marked O_SYNC will be done non-cached.
+	 * Accessing memory above the top the kernel knows about or through a
+	 * file pointer that was marked O_SYNC will be done non-cached.
 	 */
 	if (file->f_flags & O_SYNC)
 		return 1;
 	return addr >= __pa(high_memory);
 #endif
 }
+#endif		/* pgprot_noncached */
 
 #ifndef ARCH_HAS_VALID_PHYS_ADDR_RANGE
 static inline int valid_phys_addr_range(unsigned long addr, size_t *count)
@@ -168,28 +171,24 @@
 	return do_write_mem(file, __va(p), p, buf, count, ppos);
 }
 
-static int mmap_mem(struct file * file, struct vm_area_struct * vma)
+static int mmap_mem(struct file *file, struct vm_area_struct *vma)
 {
 	unsigned long offset = vma->vm_pgoff << PAGE_SHIFT;
-	int uncached;
 
-	uncached = uncached_access(file, offset);
 #ifdef pgprot_noncached
-	if (uncached)
+	if (uncached_access(file, offset))
 		vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
 #endif
 
-	/* Don't try to swap out physical pages.. */
-	vma->vm_flags |= VM_RESERVED;
-
 	/*
-	 * Don't dump addresses that are not real memory to a core file.
+	 * Don't try to swap out physical pages..
+	 * And treat /dev/mem mappings as "IO" regions: they may not
+	 * describe valid pageframes.
 	 */
-	if (uncached)
-		vma->vm_flags |= VM_IO;
+	vma->vm_flags |= VM_RESERVED|VM_IO;
 
-	if (remap_page_range(vma, vma->vm_start, offset, vma->vm_end-vma->vm_start,
-			     vma->vm_page_prot))
+	if (remap_page_range(vma, vma->vm_start, offset,
+			vma->vm_end-vma->vm_start, vma->vm_page_prot))
 		return -EAGAIN;
 	return 0;
 }
--- diff/drivers/char/moxa.c	2003-10-09 09:47:34.000000000 +0100
+++ source/drivers/char/moxa.c	2004-02-09 10:39:52.000000000 +0000
@@ -49,6 +49,7 @@
 #include <linux/tty_driver.h>
 #include <linux/delay.h>
 #include <linux/pci.h>
+#include <linux/init.h>
 
 #include <asm/system.h>
 #include <asm/io.h>
@@ -231,6 +232,9 @@
 static void moxa_stop(struct tty_struct *);
 static void moxa_start(struct tty_struct *);
 static void moxa_hangup(struct tty_struct *);
+static int moxa_tiocmget(struct tty_struct *tty, struct file *file);
+static int moxa_tiocmset(struct tty_struct *tty, struct file *file,
+			 unsigned int set, unsigned int clear);
 static void moxa_poll(unsigned long);
 static void set_tty_param(struct tty_struct *);
 static int block_till_ready(struct tty_struct *, struct file *,
@@ -288,11 +292,13 @@
 	.stop = moxa_stop,
 	.start = moxa_start,
 	.hangup = moxa_hangup,
+	.tiocmget = moxa_tiocmget,
+	.tiocmset = moxa_tiocmset,
 };
 
 static int __init moxa_init(void)
 {
-	int i, n, numBoards;
+	int i, numBoards;
 	struct moxa_str *ch;
 
 	printk(KERN_INFO "MOXA Intellio family driver version %s\n", MOXA_VERSION);
@@ -410,7 +416,7 @@
 #ifdef CONFIG_PCI
 	{
 		struct pci_dev *p = NULL;
-		n = (sizeof(moxa_pcibrds) / sizeof(moxa_pcibrds[0])) - 1;
+		int n = (sizeof(moxa_pcibrds) / sizeof(moxa_pcibrds[0])) - 1;
 		i = 0;
 		while (i < n) {
 			while ((p = pci_find_device(moxa_pcibrds[i].vendor, moxa_pcibrds[i].device, p))!=NULL)
@@ -741,6 +747,55 @@
 	ch->statusflags |= LOWWAIT;
 }
 
+static int moxa_tiocmget(struct tty_struct *tty, struct file *file)
+{
+	struct moxa_str *ch = (struct moxa_str *) tty->driver_data;
+	int port;
+	int flag = 0, dtr, rts;
+
+	port = PORTNO(tty);
+	if ((port != MAX_PORTS) && (!ch))
+		return (-EINVAL);
+
+	MoxaPortGetLineOut(ch->port, &dtr, &rts);
+	if (dtr)
+		flag |= TIOCM_DTR;
+	if (rts)
+		flag |= TIOCM_RTS;
+	dtr = MoxaPortLineStatus(ch->port);
+	if (dtr & 1)
+		flag |= TIOCM_CTS;
+	if (dtr & 2)
+		flag |= TIOCM_DSR;
+	if (dtr & 4)
+		flag |= TIOCM_CD;
+	return flag;
+}
+
+static int moxa_tiocmset(struct tty_struct *tty, struct file *file,
+			 unsigned int set, unsigned int clear)
+{
+	struct moxa_str *ch = (struct moxa_str *) tty->driver_data;
+	int port;
+	int flag = 0, dtr, rts;
+
+	port = PORTNO(tty);
+	if ((port != MAX_PORTS) && (!ch))
+		return (-EINVAL);
+
+	MoxaPortGetLineOut(ch->port, &dtr, &rts);
+	if (set & TIOCM_RTS)
+		rts = 1;
+	if (set & TIOCM_DTR)
+		dtr = 1;
+	if (clear & TIOCM_RTS)
+		rts = 0;
+	if (clear & TIOCM_DTR)
+		dtr = 0;
+	MoxaPortLineCtrl(ch->port, dtr, rts);
+	return 0;
+}
+
 static int moxa_ioctl(struct tty_struct *tty, struct file *file,
 		      unsigned int cmd, unsigned long arg)
 {
@@ -784,51 +839,6 @@
 		else
 			ch->asyncflags |= ASYNC_CHECK_CD;
 		return (0);
-	case TIOCMGET:
-		flag = 0;
-		MoxaPortGetLineOut(ch->port, &dtr, &rts);
-		if (dtr)
-			flag |= TIOCM_DTR;
-		if (rts)
-			flag |= TIOCM_RTS;
-		dtr = MoxaPortLineStatus(ch->port);
-		if (dtr & 1)
-			flag |= TIOCM_CTS;
-		if (dtr & 2)
-			flag |= TIOCM_DSR;
-		if (dtr & 4)
-			flag |= TIOCM_CD;
-		return put_user(flag, (unsigned int *) arg);
-	case TIOCMBIS:
-		if(get_user(retval, (unsigned int *) arg))
-			return -EFAULT;
-		MoxaPortGetLineOut(ch->port, &dtr, &rts);
-		if (retval & TIOCM_RTS)
-			rts = 1;
-		if (retval & TIOCM_DTR)
-			dtr = 1;
-		MoxaPortLineCtrl(ch->port, dtr, rts);
-		return (0);
-	case TIOCMBIC:
-		if(get_user(retval, (unsigned int *) arg))
-			return -EFAULT;
-		MoxaPortGetLineOut(ch->port, &dtr, &rts);
-		if (retval & TIOCM_RTS)
-			rts = 0;
-		if (retval & TIOCM_DTR)
-			dtr = 0;
-		MoxaPortLineCtrl(ch->port, dtr, rts);
-		return (0);
-	case TIOCMSET:
-		if(get_user(retval, (unsigned long *) arg))
-			return -EFAULT;
-		dtr = rts = 0;
-		if (retval & TIOCM_RTS)
-			rts = 1;
-		if (retval & TIOCM_DTR)
-			dtr = 1;
-		MoxaPortLineCtrl(ch->port, dtr, rts);
-		return (0);
 	case TIOCGSERIAL:
 		return (moxa_get_serial_info(ch, (struct serial_struct *) arg));
 
--- diff/drivers/char/mxser.c	2003-10-09 09:47:34.000000000 +0100
+++ source/drivers/char/mxser.c	2004-02-09 10:39:52.000000000 +0000
@@ -56,6 +56,7 @@
 #include <linux/mm.h>
 #include <linux/smp_lock.h>
 #include <linux/pci.h>
+#include <linux/init.h>
 
 #include <asm/system.h>
 #include <asm/io.h>
@@ -349,8 +350,8 @@
 static int mxser_set_serial_info(struct mxser_struct *, struct serial_struct *);
 static int mxser_get_lsr_info(struct mxser_struct *, unsigned int *);
 static void mxser_send_break(struct mxser_struct *, int);
-static int mxser_get_modem_info(struct mxser_struct *, unsigned int *);
-static int mxser_set_modem_info(struct mxser_struct *, unsigned int, unsigned int *);
+static int mxser_tiocmget(struct tty_struct *, struct file *);
+static int mxser_tiocmset(struct tty_struct *, struct file *, unsigned int, unsigned int);
 
 /*
  * The MOXA C168/C104 serial driver boot-time initialization code!
@@ -491,12 +492,13 @@
 	.stop = mxser_stop,
 	.start = mxser_start,
 	.hangup = mxser_hangup,
+	.tiocmget = mxser_tiocmget,
+	.tiocmset = mxser_tiocmset,
 };
 
 static int __init mxser_module_init(void)
 {
 	int i, m, retval, b;
-	int n, index;
 	struct mxser_hwconf hwconf;
 
 	mxvar_sdriver = alloc_tty_driver(MXSER_PORTS + 1);
@@ -600,9 +602,8 @@
 #ifdef CONFIG_PCI
 	{
 		struct pci_dev *pdev = NULL;
-
-		n = (sizeof(mxser_pcibrds) / sizeof(mxser_pcibrds[0])) - 1;
-		index = 0;
+		int n = (sizeof(mxser_pcibrds) / sizeof(mxser_pcibrds[0])) - 1;
+		int index = 0;
 		for (b = 0; b < n; b++) {
 			while ((pdev = pci_find_device(mxser_pcibrds[b].vendor, mxser_pcibrds[b].device, pdev)))
 			{
@@ -1009,12 +1010,6 @@
 		tty->termios->c_cflag = ((tty->termios->c_cflag & ~CLOCAL) |
 					 (arg ? CLOCAL : 0));
 		return (0);
-	case TIOCMGET:
-		return (mxser_get_modem_info(info, (unsigned int *) arg));
-	case TIOCMBIS:
-	case TIOCMBIC:
-	case TIOCMSET:
-		return (mxser_set_modem_info(info, cmd, (unsigned int *) arg));
 	case TIOCGSERIAL:
 		return (mxser_get_serial_info(info, (struct serial_struct *) arg));
 	case TIOCSSERIAL:
@@ -2150,13 +2145,18 @@
 	restore_flags(flags);
 }
 
-static int mxser_get_modem_info(struct mxser_struct *info,
-				unsigned int *value)
+static int mxser_tiocmget(struct tty_struct *tty, struct file *file)
 {
+	struct mxser_struct *info = (struct mxser_struct *) tty->driver_data;
 	unsigned char control, status;
 	unsigned int result;
 	unsigned long flags;
 
+	if (PORTNO(tty) == MXSER_PORTS)
+		return (-ENOIOCTLCMD);
+	if (tty->flags & (1 << TTY_IO_ERROR))
+		return (-EIO);
+
 	control = info->MCR;
 	save_flags(flags);
 	cli();
@@ -2164,46 +2164,38 @@
 	if (status & UART_MSR_ANY_DELTA)
 		mxser_check_modem_status(info, status);
 	restore_flags(flags);
-	result = ((control & UART_MCR_RTS) ? TIOCM_RTS : 0) |
+	return ((control & UART_MCR_RTS) ? TIOCM_RTS : 0) |
 	    ((control & UART_MCR_DTR) ? TIOCM_DTR : 0) |
 	    ((status & UART_MSR_DCD) ? TIOCM_CAR : 0) |
 	    ((status & UART_MSR_RI) ? TIOCM_RNG : 0) |
 	    ((status & UART_MSR_DSR) ? TIOCM_DSR : 0) |
 	    ((status & UART_MSR_CTS) ? TIOCM_CTS : 0);
-	return put_user(result, value);
 }
 
-static int mxser_set_modem_info(struct mxser_struct *info, unsigned int cmd,
-				unsigned int *value)
+static int mxser_tiocmset(struct tty_struct *tty, struct file *file,
+			  unsigned int set, unsigned int clear)
 {
+	struct mxser_struct *info = (struct mxser_struct *) tty->driver_data;
 	unsigned int arg;
 	unsigned long flags;
 
-	if(get_user(arg, value))
-		return -EFAULT;
-	switch (cmd) {
-	case TIOCMBIS:
-		if (arg & TIOCM_RTS)
-			info->MCR |= UART_MCR_RTS;
-		if (arg & TIOCM_DTR)
-			info->MCR |= UART_MCR_DTR;
-		break;
-	case TIOCMBIC:
-		if (arg & TIOCM_RTS)
-			info->MCR &= ~UART_MCR_RTS;
-		if (arg & TIOCM_DTR)
-			info->MCR &= ~UART_MCR_DTR;
-		break;
-	case TIOCMSET:
-		info->MCR = ((info->MCR & ~(UART_MCR_RTS | UART_MCR_DTR)) |
-			     ((arg & TIOCM_RTS) ? UART_MCR_RTS : 0) |
-			     ((arg & TIOCM_DTR) ? UART_MCR_DTR : 0));
-		break;
-	default:
-		return (-EINVAL);
-	}
+	if (PORTNO(tty) == MXSER_PORTS)
+		return (-ENOIOCTLCMD);
+	if (tty->flags & (1 << TTY_IO_ERROR))
+		return (-EIO);
+
 	save_flags(flags);
 	cli();
+	if (set & TIOCM_RTS)
+		info->MCR |= UART_MCR_RTS;
+	if (set & TIOCM_DTR)
+		info->MCR |= UART_MCR_DTR;
+
+	if (clear & TIOCM_RTS)
+		info->MCR &= ~UART_MCR_RTS;
+	if (clear & TIOCM_DTR)
+		info->MCR &= ~UART_MCR_DTR;
+
 	outb(info->MCR, info->base + UART_MCR);
 	restore_flags(flags);
 	return (0);
--- diff/drivers/char/pcmcia/synclink_cs.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/char/pcmcia/synclink_cs.c	2004-02-09 10:39:52.000000000 +0000
@@ -244,7 +244,6 @@
 	char netname[10];
 	struct net_device *netdev;
 	struct net_device_stats netstats;
-	struct net_device netdevice;
 #endif
 } MGSLPC_INFO;
 
@@ -4206,35 +4205,46 @@
 #ifdef CONFIG_SYNCLINK_SYNCPPP
 /* syncppp net device routines
  */
+ 
+static void mgslpc_setup(struct net_device *dev)
+{
+	dev->open = mgslpc_sppp_open;
+	dev->stop = mgslpc_sppp_close;
+	dev->hard_start_xmit = mgslpc_sppp_tx;
+	dev->do_ioctl = mgslpc_sppp_ioctl;
+	dev->get_stats = mgslpc_net_stats;
+	dev->tx_timeout = mgslpc_sppp_tx_timeout;
+	dev->watchdog_timeo = 10*HZ;
+}
 
 void mgslpc_sppp_init(MGSLPC_INFO *info)
 {
 	struct net_device *d;
 
 	sprintf(info->netname,"mgslp%d",info->line);
+ 
+	d = alloc_netdev(0, info->netname, mgslpc_setup);
+	if (!d) {
+		printk(KERN_WARNING "%s: alloc_netdev failed.\n",
+						info->netname);
+		return;
+	}
 
 	info->if_ptr = &info->pppdev;
-	info->netdev = info->pppdev.dev = &info->netdevice;
+	info->netdev = info->pppdev.dev = d;
 
 	sppp_attach(&info->pppdev);
 
-	d = info->netdev;
-	strcpy(d->name,info->netname);
 	d->base_addr = info->io_base;
 	d->irq = info->irq_level;
 	d->priv = info;
-	d->init = NULL;
-	d->open = mgslpc_sppp_open;
-	d->stop = mgslpc_sppp_close;
-	d->hard_start_xmit = mgslpc_sppp_tx;
-	d->do_ioctl = mgslpc_sppp_ioctl;
-	d->get_stats = mgslpc_net_stats;
-	d->tx_timeout = mgslpc_sppp_tx_timeout;
-	d->watchdog_timeo = 10*HZ;
 
 	if (register_netdev(d)) {
 		printk(KERN_WARNING "%s: register_netdev failed.\n", d->name);
 		sppp_detach(info->netdev);
+		info->netdev = NULL;
+		info->pppdev.dev = NULL;
+		free_netdev(d);
 		return;
 	}
 
@@ -4246,8 +4256,11 @@
 {
 	if (debug_level >= DEBUG_LEVEL_INFO)
 		printk("mgslpc_sppp_delete(%s)\n",info->netname);	
-	sppp_detach(info->netdev);
 	unregister_netdev(info->netdev);
+	sppp_detach(info->netdev);
+	free_netdev(info->netdev);
+	info->netdev = NULL;
+	info->pppdev.dev = NULL;
 }
 
 int mgslpc_sppp_open(struct net_device *d)
--- diff/drivers/char/pcxx.c	2003-10-09 09:47:34.000000000 +0100
+++ source/drivers/char/pcxx.c	2004-02-09 10:39:52.000000000 +0000
@@ -173,6 +173,9 @@
 static inline void memoff(struct channel *ch);
 static inline void assertgwinon(struct channel *ch);
 static inline void assertmemoff(struct channel *ch);
+static int pcxe_tiocmget(struct tty_struct *tty, struct file *file);
+static int pcxe_tiocmset(struct tty_struct *tty, struct file *file,
+			 unsigned int set, unsigned int clear);
 
 #define TZ_BUFSZ 4096
 
@@ -1029,6 +1032,8 @@
 	.stop = pcxe_stop,
 	.start = pcxe_start,
 	.hangup = pcxe_hangup,
+	.tiocmget = pcxe_tiocmget,
+	.tiocmset = pcxe_tiocmset,
 };
 
 /*
@@ -1983,6 +1988,89 @@
 }
 
 
+static int pcxe_tiocmget(struct tty_struct *tty, struct file *file)
+{
+	struct channel *ch = (struct channel *) tty->driver_data;
+	volatile struct board_chan *bc;
+	unsigned long flags;
+	int mflag = 0;
+
+	if(ch)
+		bc = ch->brdchan;
+	else {
+		printk("ch is NULL in %s!\n", __FUNCTION__);
+		return(-EINVAL);
+	}
+
+	save_flags(flags);
+	cli();
+	globalwinon(ch);
+	mstat = bc->mstat;
+	memoff(ch);
+	restore_flags(flags);
+
+	if(mstat & DTR)
+		mflag |= TIOCM_DTR;
+	if(mstat & RTS)
+		mflag |= TIOCM_RTS;
+	if(mstat & CTS)
+		mflag |= TIOCM_CTS;
+	if(mstat & ch->dsr)
+		mflag |= TIOCM_DSR;
+	if(mstat & RI)
+		mflag |= TIOCM_RI;
+	if(mstat & ch->dcd)
+		mflag |= TIOCM_CD;
+
+	return mflag;
+}
+
+
+static int pcxe_tiocmset(struct tty_struct *tty, struct file *file,
+			 unsigned int set, unsigned int clear)
+{
+	struct channel *ch = (struct channel *) tty->driver_data;
+	volatile struct board_chan *bc;
+	unsigned long flags;
+
+	if(ch)
+		bc = ch->brdchan;
+	else {
+		printk("ch is NULL in %s!\n", __FUNCTION__);
+		return(-EINVAL);
+	}
+
+	save_flags(flags);
+	cli();
+	/*
+	 * I think this modemfake stuff is broken.  It doesn't
+	 * correctly reflect the behaviour desired by the TIOCM*
+	 * ioctls.  Therefore this is probably broken.
+	 */
+	if (set & TIOCM_DTR) {
+		ch->modemfake |= DTR;
+		ch->modem |= DTR;
+	}
+	if (set & TIOCM_RTS) {
+		ch->modemfake |= RTS;
+		ch->modem |= RTS;
+	}
+
+	if (clear & TIOCM_DTR) {
+		ch->modemfake |= DTR;
+		ch->modem &= ~DTR;
+	}
+	if (clear & TIOCM_RTS) {
+		ch->modemfake |= RTS;
+		ch->modem &= ~RTS;
+	}
+	globalwinon(ch);
+	pcxxparam(tty,ch);
+	memoff(ch);
+	restore_flags(flags);
+}
+
+
 static int pcxe_ioctl(struct tty_struct *tty, struct file * file,
 		    unsigned int cmd, unsigned long arg)
 {
@@ -2036,69 +2124,15 @@
 			return 0;
 
 		case TIOCMODG:
-		case TIOCMGET:
-			mflag = 0;
-
-			cli();
-			globalwinon(ch);
-			mstat = bc->mstat;
-			memoff(ch);
-			restore_flags(flags);
-
-			if(mstat & DTR)
-				mflag |= TIOCM_DTR;
-			if(mstat & RTS)
-				mflag |= TIOCM_RTS;
-			if(mstat & CTS)
-				mflag |= TIOCM_CTS;
-			if(mstat & ch->dsr)
-				mflag |= TIOCM_DSR;
-			if(mstat & RI)
-				mflag |= TIOCM_RI;
-			if(mstat & ch->dcd)
-				mflag |= TIOCM_CD;
-
+			mflag = pcxe_tiocmget(tty, file);
 			if (put_user(mflag, (unsigned int *) arg))
 				return -EFAULT;
 			break;
 
-		case TIOCMBIS:
-		case TIOCMBIC:
 		case TIOCMODS:
-		case TIOCMSET:
 			if (get_user(mstat, (unsigned int *) arg))
 				return -EFAULT;
-
-			mflag = 0;
-			if(mstat & TIOCM_DTR)
-				mflag |= DTR;
-			if(mstat & TIOCM_RTS)
-				mflag |= RTS;
-
-			switch(cmd) {
-				case TIOCMODS:
-				case TIOCMSET:
-					ch->modemfake = DTR|RTS;
-					ch->modem = mflag;
-					break;
-
-				case TIOCMBIS:
-					ch->modemfake |= mflag;
-					ch->modem |= mflag;
-					break;
-
-				case TIOCMBIC:
-					ch->modemfake &= ~mflag;
-					ch->modem &= ~mflag;
-					break;
-			}
-
-			cli();
-			globalwinon(ch);
-			pcxxparam(tty,ch);
-			memoff(ch);
-			restore_flags(flags);
-			break;
+			return pcxe_tiocmset(tty, file, mstat, ~mstat);
 
 		case TIOCSDTR:
 			cli();
--- diff/drivers/char/rio/rio_linux.c	2003-10-09 09:47:34.000000000 +0100
+++ source/drivers/char/rio/rio_linux.c	2004-02-09 10:39:52.000000000 +0000
@@ -728,6 +728,11 @@
       rc = gs_setserial(&PortP->gs, (struct serial_struct *) arg);
     break;
 #if 0
+  /*
+   * note: these IOCTLs no longer reach here.  Use
+   * tiocmset/tiocmget driver methods instead.  The
+   * #if 0 disablement predates this comment.
+   */
   case TIOCMGET:
     if ((rc = verify_area(VERIFY_WRITE, (void *) arg,
                           sizeof(unsigned int))) == 0) {
--- diff/drivers/char/riscom8.c	2003-09-17 12:28:05.000000000 +0100
+++ source/drivers/char/riscom8.c	2004-02-09 10:39:52.000000000 +0000
@@ -1306,13 +1306,17 @@
 		(tty->ldisc.write_wakeup)(tty);
 }
 
-static int rc_get_modem_info(struct riscom_port * port, unsigned int *value)
+static int rc_tiocmget(struct tty_struct *tty, struct file *file)
 {
+	struct riscom_port *port = (struct riscom_port *)tty->driver_data;
 	struct riscom_board * bp;
 	unsigned char status;
 	unsigned int result;
 	unsigned long flags;
 
+	if (rc_paranoia_check(port, tty->name, __FUNCTION__))
+		return -ENODEV;
+
 	bp = port_Board(port);
 	save_flags(flags); cli();
 	rc_out(bp, CD180_CAR, port_No(port));
@@ -1324,41 +1328,32 @@
 		| ((status & MSVR_CD)  ? TIOCM_CAR : 0)
 		| ((status & MSVR_DSR) ? TIOCM_DSR : 0)
 		| ((status & MSVR_CTS) ? TIOCM_CTS : 0);
-	return put_user(result, value);
+	return result;
 }
 
-static int rc_set_modem_info(struct riscom_port * port, unsigned int cmd,
-			     unsigned int *value)
+static int rc_tiocmset(struct tty_struct *tty, struct file *file,
+		       unsigned int set, unsigned int clear)
 {
-	unsigned int arg;
+	struct riscom_port *port = (struct riscom_port *)tty->driver_data;
 	unsigned long flags;
-	struct riscom_board *bp = port_Board(port);
+	struct riscom_board *bp;
+
+	if (rc_paranoia_check(port, tty->name, __FUNCTION__))
+		return -ENODEV;
+
+	bp = port_Board(port);
 
-	if (get_user(arg, value))
-		return -EFAULT;
-	switch (cmd) {
-	 case TIOCMBIS: 
-		if (arg & TIOCM_RTS) 
-			port->MSVR |= MSVR_RTS;
-		if (arg & TIOCM_DTR)
-			bp->DTR &= ~(1u << port_No(port));
-		break;
-	case TIOCMBIC:
-		if (arg & TIOCM_RTS)
-			port->MSVR &= ~MSVR_RTS;
-		if (arg & TIOCM_DTR)
-			bp->DTR |= (1u << port_No(port));
-		break;
-	case TIOCMSET:
-		port->MSVR = (arg & TIOCM_RTS) ? (port->MSVR | MSVR_RTS) : 
-					         (port->MSVR & ~MSVR_RTS);
-		bp->DTR = arg & TIOCM_DTR ? (bp->DTR &= ~(1u << port_No(port))) :
-					    (bp->DTR |=  (1u << port_No(port)));
-		break;
-	 default:
-		return -EINVAL;
-	}
 	save_flags(flags); cli();
+	if (set & TIOCM_RTS)
+		port->MSVR |= MSVR_RTS;
+	if (set & TIOCM_DTR)
+		bp->DTR &= ~(1u << port_No(port));
+
+	if (clear & TIOCM_RTS)
+		port->MSVR &= ~MSVR_RTS;
+	if (clear & TIOCM_DTR)
+		bp->DTR |= (1u << port_No(port));
+
 	rc_out(bp, CD180_CAR, port_No(port));
 	rc_out(bp, CD180_MSVR, port->MSVR);
 	rc_out(bp, RC_DTR, bp->DTR);
@@ -1485,12 +1480,6 @@
 			((tty->termios->c_cflag & ~CLOCAL) |
 			(arg ? CLOCAL : 0));
 		break;
-	 case TIOCMGET:
-		return rc_get_modem_info(port, (unsigned int *) arg);
-	 case TIOCMBIS:
-	 case TIOCMBIC:
-	 case TIOCMSET:
-		return rc_set_modem_info(port, cmd, (unsigned int *) arg);
 	 case TIOCGSERIAL:	
 		return rc_get_serial_info(port, (struct serial_struct *) arg);
 	 case TIOCSSERIAL:	
@@ -1677,6 +1666,8 @@
 	.stop = rc_stop,
 	.start = rc_start,
 	.hangup = rc_hangup,
+	.tiocmget = rc_tiocmget,
+	.tiocmset = rc_tiocmset,
 };
 
 static inline int rc_init_drivers(void)
--- diff/drivers/char/rocket.c	2003-10-27 09:20:37.000000000 +0000
+++ source/drivers/char/rocket.c	2004-02-09 10:39:52.000000000 +0000
@@ -1216,59 +1216,6 @@
 /********************************************************************************************/
 /*  Here are the routines used by rp_ioctl.  These are all called from exception handlers.  */
 
-static int get_modem_info(struct r_port *info, unsigned int *value)
-{
-	unsigned int control, result, ChanStatus;
-
-	ChanStatus = sGetChanStatusLo(&info->channel);
-
-	control = info->channel.TxControl[3];
-	result = ((control & SET_RTS) ? TIOCM_RTS : 0) | 
-		((control & SET_DTR) ?  TIOCM_DTR : 0) |
-		((ChanStatus & CD_ACT) ? TIOCM_CAR : 0) |
-		(sGetChanRI(&info->channel) ? TIOCM_RNG : 0) |
-		((ChanStatus & DSR_ACT) ? TIOCM_DSR : 0) |
-		((ChanStatus & CTS_ACT) ? TIOCM_CTS : 0);
-
-	if (copy_to_user(value, &result, sizeof (int)))
-		return -EFAULT;
-	return 0;
-}
-
-static int set_modem_info(struct r_port *info, unsigned int cmd,
-			  unsigned int *value)
-{
-	unsigned int arg;
-
-	if (copy_from_user(&arg, value, sizeof (int)))
-		return -EFAULT;
-
-	switch (cmd) {
-	case TIOCMBIS:
-		if (arg & TIOCM_RTS)
-			info->channel.TxControl[3] |= SET_RTS;
-		if (arg & TIOCM_DTR)
-			info->channel.TxControl[3] |= SET_DTR;
-		break;
-	case TIOCMBIC:
-		if (arg & TIOCM_RTS)
-			info->channel.TxControl[3] &= ~SET_RTS;
-		if (arg & TIOCM_DTR)
-			info->channel.TxControl[3] &= ~SET_DTR;
-		break;
-	case TIOCMSET:
-		info->channel.TxControl[3] = ((info->channel.TxControl[3] & ~(SET_RTS | SET_DTR)) | 
-					      ((arg & TIOCM_RTS) ? SET_RTS : 0) | 
-					      ((arg & TIOCM_DTR) ? SET_DTR : 0));
-		break;
-	default:
-		return -EINVAL;
-	}
-
-	sOutDW(info->channel.IndexAddr, *(DWord_t *) & (info->channel.TxControl[0]));
-	return 0;
-}
-
 /*
  *  Returns the state of the serial modem control lines.  These next 2 functions 
  *  are the way kernel versions > 2.5 handle modem control lines rather than IOCTLs.
@@ -1432,12 +1379,6 @@
 		return -ENXIO;
 
 	switch (cmd) {
-	case TIOCMGET:
-		return get_modem_info(info, (unsigned int *) arg);
-	case TIOCMBIS:
-	case TIOCMBIC:
-	case TIOCMSET:
-		return set_modem_info(info, cmd, (unsigned int *) arg);
 	case RCKP_GET_STRUCT:
 		if (copy_to_user((void *) arg, info, sizeof (struct r_port)))
 			return -EFAULT;
--- diff/drivers/char/selection.c	2003-06-30 10:07:20.000000000 +0100
+++ source/drivers/char/selection.c	2004-02-09 10:39:52.000000000 +0000
@@ -24,6 +24,7 @@
 #include <linux/consolemap.h>
 #include <linux/selection.h>
 #include <linux/tiocl.h>
+#include <linux/console.h>
 
 #ifndef MIN
 #define MIN(a,b)	((a) < (b) ? (a) : (b))
@@ -290,7 +291,10 @@
 	int	pasted = 0, count;
 	DECLARE_WAITQUEUE(wait, current);
 
+	acquire_console_sem();
 	poke_blanked_console();
+	release_console_sem();
+
 	add_wait_queue(&vt->paste_wait, &wait);
 	while (sel_buffer && sel_buffer_lth > pasted) {
 		set_current_state(TASK_INTERRUPTIBLE);
--- diff/drivers/char/serial167.c	2003-10-09 09:47:34.000000000 +0100
+++ source/drivers/char/serial167.c	2004-02-09 10:39:52.000000000 +0000
@@ -1492,8 +1492,9 @@
 } /* set_serial_info */
 
 static int
-get_modem_info(struct cyclades_port * info, unsigned int *value)
+cy_tiocmget(struct tty_struct *tty, struct file *file)
 {
+  struct cyclades_port * info = (struct cyclades_port *)tty->driver_data;
   int channel;
   volatile unsigned char *base_addr = (u_char *)BASE_ADDR;
   unsigned long flags;
@@ -1507,36 +1508,32 @@
         status = base_addr[CyMSVR1] | base_addr[CyMSVR2];
     local_irq_restore(flags);
 
-    result =  ((status  & CyRTS) ? TIOCM_RTS : 0)
+    return    ((status  & CyRTS) ? TIOCM_RTS : 0)
             | ((status  & CyDTR) ? TIOCM_DTR : 0)
             | ((status  & CyDCD) ? TIOCM_CAR : 0)
             | ((status  & CyDSR) ? TIOCM_DSR : 0)
             | ((status  & CyCTS) ? TIOCM_CTS : 0);
-    return put_user(result,(unsigned int *) value);
-} /* get_modem_info */
+} /* cy_tiocmget */
 
 static int
-set_modem_info(struct cyclades_port * info, unsigned int cmd,
-                          unsigned int *value)
+cy_tiocmset(struct tty_struct *tty, struct file *file,
+	    unsigned int set, unsigned int clear)
 {
+  struct cyclades_port * info = (struct cyclades_port *)tty->driver_data;
   int channel;
   volatile unsigned char *base_addr = (u_char *)BASE_ADDR;
   unsigned long flags;
   unsigned int arg;
 	  
-    if (get_user(arg, (unsigned long *) value))
-	return -EFAULT;
     channel = info->line;
 
-    switch (cmd) {
-    case TIOCMBIS:
-	if (arg & TIOCM_RTS){
+	if (set & TIOCM_RTS){
 	    local_irq_save(flags);
 		base_addr[CyCAR] = (u_char)channel;
 		base_addr[CyMSVR1] = CyRTS;
 	    local_irq_restore(flags);
 	}
-	if (arg & TIOCM_DTR){
+	if (set & TIOCM_DTR){
 	    local_irq_save(flags);
 	    base_addr[CyCAR] = (u_char)channel;
 /* CP('S');CP('2'); */
@@ -1547,15 +1544,14 @@
 #endif
 	    local_irq_restore(flags);
 	}
-	break;
-    case TIOCMBIC:
-	if (arg & TIOCM_RTS){
+
+	if (clear & TIOCM_RTS){
 	    local_irq_save(flags);
 		base_addr[CyCAR] = (u_char)channel;
 		base_addr[CyMSVR1] = 0;
 	    local_irq_restore(flags);
 	}
-	if (arg & TIOCM_DTR){
+	if (clear & TIOCM_DTR){
 	    local_irq_save(flags);
 	    base_addr[CyCAR] = (u_char)channel;
 /* CP('C');CP('2'); */
@@ -1566,44 +1562,7 @@
 #endif
 	    local_irq_restore(flags);
 	}
-	break;
-    case TIOCMSET:
-	if (arg & TIOCM_RTS){
-	    local_irq_save(flags);
-		base_addr[CyCAR] = (u_char)channel;
-		base_addr[CyMSVR1] = CyRTS;
-	    local_irq_restore(flags);
-	}else{
-	    local_irq_save(flags);
-		base_addr[CyCAR] = (u_char)channel;
-		base_addr[CyMSVR1] = 0;
-	    local_irq_restore(flags);
-	}
-	if (arg & TIOCM_DTR){
-	    local_irq_save(flags);
-	    base_addr[CyCAR] = (u_char)channel;
-/* CP('S');CP('3'); */
-	    base_addr[CyMSVR2] = CyDTR;
-#ifdef SERIAL_DEBUG_DTR
-            printk("cyc: %d: raising DTR\n", __LINE__);
-            printk("     status: 0x%x, 0x%x\n", base_addr[CyMSVR1], base_addr[CyMSVR2]);
-#endif
-	    local_irq_restore(flags);
-	}else{
-	    local_irq_save(flags);
-	    base_addr[CyCAR] = (u_char)channel;
-/* CP('C');CP('3'); */
-	    base_addr[CyMSVR2] = 0;
-#ifdef SERIAL_DEBUG_DTR
-            printk("cyc: %d: dropping DTR\n", __LINE__);
-            printk("     status: 0x%x, 0x%x\n", base_addr[CyMSVR1], base_addr[CyMSVR2]);
-#endif
-	    local_irq_restore(flags);
-	}
-	break;
-    default:
-		return -EINVAL;
-        }
+
     return 0;
 } /* set_modem_info */
 
@@ -1777,11 +1736,6 @@
             tty_wait_until_sent(tty,0);
             send_break(info, arg ? arg*(HZ/10) : HZ/4);
             break;
-        case TIOCMBIS:
-        case TIOCMBIC:
-        case TIOCMSET:
-            ret_val = set_modem_info(info, cmd, (unsigned int *) arg);
-            break;
 
 /* The following commands are incompletely implemented!!! */
         case TIOCGSOFTCAR:
@@ -1794,9 +1748,6 @@
             tty->termios->c_cflag =
                     ((tty->termios->c_cflag & ~CLOCAL) | (val ? CLOCAL : 0));
             break;
-        case TIOCMGET:
-            ret_val = get_modem_info(info, (unsigned int *) arg);
-            break;
         case TIOCGSERIAL:
             ret_val = get_serial_info(info, (struct serial_struct *) arg);
             break;
@@ -2299,6 +2250,8 @@
 	.stop = cy_stop,
 	.start = cy_start,
 	.hangup = cy_hangup,
+	.tiocmget = cy_tiocmget,
+	.tiocmset = cy_tiocmset,
 };
 /* The serial driver boot-time initialization code!
     Hardware I/O ports are mapped to character special devices on a
--- diff/drivers/char/sh-sci.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/char/sh-sci.c	2004-02-09 10:39:52.000000000 +0000
@@ -1056,6 +1056,31 @@
         return;
 }
 
+static int sci_tiocmget(struct tty_struct *tty, struct file *file)
+{
+	struct sci_port *port = tty->driver_data;
+	return sci_getsignals(port);
+}
+
+static int sci_tiocmset(struct tty_struct *tty, struct file *file,
+			unsigned int set, unsigned int clear)
+{
+	struct sci_port *port = tty->driver_data;
+	int rts = -1, dtr = -1;
+
+	if (set & TIOCM_RTS)
+		rts = 1;
+	if (set & TIOCM_DTR)
+		dtr = 1;
+	if (clear & TIOCM_RTS)
+		rts = 0;
+	if (clear & TIOCM_DTR)
+		dtr = 0;
+
+	sci_setsignals(port, dtr, rts);
+	return 0;
+}
+
 static int sci_ioctl(struct tty_struct * tty, struct file * filp, 
                      unsigned int cmd, unsigned long arg)
 {
@@ -1086,26 +1111,6 @@
 			rc = gs_setserial(&port->gs,
 					  (struct serial_struct *) arg);
 		break;
-	case TIOCMGET:
-		ival = sci_getsignals(port);
-		rc = put_user(ival, (unsigned int __user *) arg);
-		break;
-	case TIOCMBIS:
-		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 __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 __user *)arg)) == 0)
-			sci_setsignals(port, ((ival & TIOCM_DTR) ? 1 : 0),
-			                     ((ival & TIOCM_RTS) ? 1 : 0));
-		break;
-
 	default:
 		rc = -ENOIOCTLCMD;
 		break;
@@ -1219,6 +1224,8 @@
 #ifdef CONFIG_PROC_FS
 	.read_proc = sci_read_proc,
 #endif
+	.tiocmget = sci_tiocmget,
+	.tiocmset = sci_tiocmset,
 };
 
 /* ********************************************************************** *
--- diff/drivers/char/sn_serial.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/char/sn_serial.c	2004-02-09 10:39:52.000000000 +0000
@@ -22,6 +22,7 @@
 #include <linux/circ_buf.h>
 #include <linux/serial_reg.h>
 #include <asm/uaccess.h>
+#include <asm/sn/sgi.h>
 #include <asm/sn/sn_sal.h>
 #include <asm/sn/pci/pciio.h>
 #include <asm/sn/simulator.h>
@@ -258,7 +259,7 @@
 	va_list args;
 
 	va_start(args, fmt);
-	printed_len = vsnprintf(printk_buf, sizeof(printk_buf), fmt, args);
+	printed_len = vscnprintf(printk_buf, sizeof(printk_buf), fmt, args);
 	early_printk_sn_sal(printk_buf, printed_len);
 	va_end(args);
 	return printed_len;
--- diff/drivers/char/specialix.c	2003-09-30 15:46:13.000000000 +0100
+++ source/drivers/char/specialix.c	2004-02-09 10:39:52.000000000 +0000
@@ -92,6 +92,7 @@
 #include <linux/delay.h>
 #include <linux/version.h>
 #include <linux/pci.h>
+#include <linux/init.h>
 #include <asm/uaccess.h>
 
 #include "specialix_io8.h"
@@ -1652,13 +1653,17 @@
 }
 
 
-static int sx_get_modem_info(struct specialix_port * port, unsigned int *value)
+static int sx_tiocmget(struct tty_struct *tty, struct file *file)
 {
+	struct specialix_port *port = (struct specialix_port *)tty->driver_data;
 	struct specialix_board * bp;
 	unsigned char status;
 	unsigned int result;
 	unsigned long flags;
 
+	if (sx_paranoia_check(port, tty->name, __FUNCTION__))
+		return -ENODEV;
+
 	bp = port_Board(port);
 	save_flags(flags); cli();
 	sx_out(bp, CD186x_CAR, port_No(port));
@@ -1682,71 +1687,51 @@
 		          |/* ((status & MSVR_DSR) ? */ TIOCM_DSR /* : 0) */
 		          |   ((status & MSVR_CTS) ? TIOCM_CTS : 0);
 	}
-	put_user(result,(unsigned int *) value);
-	return 0;
+
+	return result;
 }
 
 
-static int sx_set_modem_info(struct specialix_port * port, unsigned int cmd,
-                             unsigned int *value)
+static int sx_tiocmset(struct tty_struct *tty, struct file *file,
+		       unsigned int set, unsigned int clear)
 {
+	struct specialix_port *port = (struct specialix_port *)tty->driver_data;
 	int error;
 	unsigned int arg;
 	unsigned long flags;
-	struct specialix_board *bp = port_Board(port);
+	struct specialix_board *bp;
 
-	error = verify_area(VERIFY_READ, value, sizeof(int));
-	if (error) 
-		return error;
+	if (sx_paranoia_check(port, tty->name, __FUNCTION__))
+		return -ENODEV;
+
+	bp = port_Board(port);
 
-	get_user(arg, (unsigned long *) value);
-	switch (cmd) {
-	case TIOCMBIS: 
-	   /*	if (arg & TIOCM_RTS) 
-			port->MSVR |= MSVR_RTS; */
-	   /*   if (arg & TIOCM_DTR)
-			port->MSVR |= MSVR_DTR; */
-
-		if (SX_CRTSCTS(port->tty)) {
-			if (arg & TIOCM_RTS)
-				port->MSVR |= MSVR_DTR; 
-		} else {
-			if (arg & TIOCM_DTR)
-				port->MSVR |= MSVR_DTR; 
-		}	     
-		break;
-	case TIOCMBIC:
-	  /*	if (arg & TIOCM_RTS)
-			port->MSVR &= ~MSVR_RTS; */
-	  /*    if (arg & TIOCM_DTR)
-			port->MSVR &= ~MSVR_DTR; */
-		if (SX_CRTSCTS(port->tty)) {
-			if (arg & TIOCM_RTS)
-				port->MSVR &= ~MSVR_DTR;
-		} else {
-			if (arg & TIOCM_DTR)
-				port->MSVR &= ~MSVR_DTR;
-		}
-		break;
-	case TIOCMSET:
-	  /* port->MSVR = (arg & TIOCM_RTS) ? (port->MSVR | MSVR_RTS) : 
-						 (port->MSVR & ~MSVR_RTS); */
-	  /* port->MSVR = (arg & TIOCM_DTR) ? (port->MSVR | MSVR_DTR) : 
-						 (port->MSVR & ~MSVR_DTR); */
-		if (SX_CRTSCTS(port->tty)) {
-	  		port->MSVR = (arg & TIOCM_RTS) ? 
-			                         (port->MSVR |  MSVR_DTR) : 
-			                         (port->MSVR & ~MSVR_DTR);
-		} else {
-			port->MSVR = (arg & TIOCM_DTR) ?
-			                         (port->MSVR |  MSVR_DTR):
-			                         (port->MSVR & ~MSVR_DTR);
-		}
-		break;
-	default:
-		return -EINVAL;
-	}
 	save_flags(flags); cli();
+   /*	if (set & TIOCM_RTS)
+		port->MSVR |= MSVR_RTS; */
+   /*   if (set & TIOCM_DTR)
+		port->MSVR |= MSVR_DTR; */
+
+	if (SX_CRTSCTS(port->tty)) {
+		if (set & TIOCM_RTS)
+			port->MSVR |= MSVR_DTR;
+	} else {
+		if (set & TIOCM_DTR)
+			port->MSVR |= MSVR_DTR;
+	}
+
+  /*	if (clear & TIOCM_RTS)
+		port->MSVR &= ~MSVR_RTS; */
+  /*    if (clear & TIOCM_DTR)
+		port->MSVR &= ~MSVR_DTR; */
+	if (SX_CRTSCTS(port->tty)) {
+		if (clear & TIOCM_RTS)
+			port->MSVR &= ~MSVR_DTR;
+	} else {
+		if (clear & TIOCM_DTR)
+			port->MSVR &= ~MSVR_DTR;
+	}
+
 	sx_out(bp, CD186x_CAR, port_No(port));
 	sx_out(bp, CD186x_MSVR, port->MSVR);
 	restore_flags(flags);
@@ -1896,16 +1881,6 @@
 			((tty->termios->c_cflag & ~CLOCAL) |
 			(arg ? CLOCAL : 0));
 		return 0;
-	 case TIOCMGET:
-		error = verify_area(VERIFY_WRITE, (void *) arg,
-		                    sizeof(unsigned int));
-		if (error)
-			return error;
-		return sx_get_modem_info(port, (unsigned int *) arg);
-	 case TIOCMBIS:
-	 case TIOCMBIC:
-	 case TIOCMSET:
-		return sx_set_modem_info(port, cmd, (unsigned int *) arg);
 	 case TIOCGSERIAL:	
 		return sx_get_serial_info(port, (struct serial_struct *) arg);
 	 case TIOCSSERIAL:	
@@ -2115,6 +2090,8 @@
 	.stop = sx_stop,
 	.start = sx_start,
 	.hangup = sx_hangup,
+	.tiocmget = sx_tiocmget,
+	.tiocmset = sx_tiocmset,
 };
 
 static int sx_init_drivers(void)
--- diff/drivers/char/stallion.c	2003-10-09 09:47:34.000000000 +0100
+++ source/drivers/char/stallion.c	2004-02-09 10:39:52.000000000 +0000
@@ -1514,6 +1514,48 @@
 
 /*****************************************************************************/
 
+static int stl_tiocmget(struct tty_struct *tty, struct file *file)
+{
+	stlport_t	*portp;
+
+	if (tty == (struct tty_struct *) NULL)
+		return(-ENODEV);
+	portp = tty->driver_data;
+	if (portp == (stlport_t *) NULL)
+		return(-ENODEV);
+	if (tty->flags & (1 << TTY_IO_ERROR))
+		return(-EIO);
+
+	return stl_getsignals(portp);
+}
+
+static int stl_tiocmset(struct tty_struct *tty, struct file *file,
+			unsigned int set, unsigned int clear)
+{
+	stlport_t	*portp;
+	int rts = -1, dtr = -1;
+
+	if (tty == (struct tty_struct *) NULL)
+		return(-ENODEV);
+	portp = tty->driver_data;
+	if (portp == (stlport_t *) NULL)
+		return(-ENODEV);
+	if (tty->flags & (1 << TTY_IO_ERROR))
+		return(-EIO);
+
+	if (set & TIOCM_RTS)
+		rts = 1;
+	if (set & TIOCM_DTR)
+		dtr = 1;
+	if (clear & TIOCM_RTS)
+		rts = 0;
+	if (clear & TIOCM_DTR)
+		dtr = 0;
+
+	stl_setsignals(portp, dtr, rts);
+	return 0;
+}
+
 static int stl_ioctl(struct tty_struct *tty, struct file *file, unsigned int cmd, unsigned long arg)
 {
 	stlport_t	*portp;
@@ -1553,37 +1595,6 @@
 				(ival ? CLOCAL : 0);
 		}
 		break;
-	case TIOCMGET:
-		if ((rc = verify_area(VERIFY_WRITE, (void *) arg,
-		    sizeof(unsigned int))) == 0) {
-			ival = stl_getsignals(portp);
-			put_user(ival, (unsigned int *) arg);
-		}
-		break;
-	case TIOCMBIS:
-		if ((rc = verify_area(VERIFY_READ, (void *) arg,
-		    sizeof(unsigned int))) == 0) {
-			get_user(ival, (unsigned int *) arg);
-			stl_setsignals(portp, ((ival & TIOCM_DTR) ? 1 : -1),
-				((ival & TIOCM_RTS) ? 1 : -1));
-		}
-		break;
-	case TIOCMBIC:
-		if ((rc = verify_area(VERIFY_READ, (void *) arg,
-		    sizeof(unsigned int))) == 0) {
-			get_user(ival, (unsigned int *) arg);
-			stl_setsignals(portp, ((ival & TIOCM_DTR) ? 0 : -1),
-				((ival & TIOCM_RTS) ? 0 : -1));
-		}
-		break;
-	case TIOCMSET:
-		if ((rc = verify_area(VERIFY_READ, (void *) arg,
-		    sizeof(unsigned int))) == 0) {
-			get_user(ival, (unsigned int *) arg);
-			stl_setsignals(portp, ((ival & TIOCM_DTR) ? 1 : 0),
-				((ival & TIOCM_RTS) ? 1 : 0));
-		}
-		break;
 	case TIOCGSERIAL:
 		if ((rc = verify_area(VERIFY_WRITE, (void *) arg,
 		    sizeof(struct serial_struct))) == 0)
@@ -3137,6 +3148,8 @@
 	.wait_until_sent = stl_waituntilsent,
 	.send_xchar = stl_sendxchar,
 	.read_proc = stl_readproc,
+	.tiocmget = stl_tiocmget,
+	.tiocmset = stl_tiocmset,
 };
 
 /*****************************************************************************/
--- diff/drivers/char/sx.c	2004-01-19 10:22:56.000000000 +0000
+++ source/drivers/char/sx.c	2004-02-09 10:39:52.000000000 +0000
@@ -1743,6 +1743,32 @@
 }
 
 
+static int sx_tiocmget(struct tty_struct *tty, struct file *file)
+{
+	struct sx_port *port = tty->driver_data;
+	return sx_getsignals(port);
+}
+
+static int sx_tiocmset(struct tty_struct *tty, struct file *file,
+		       unsigned int set, unsigned int clear)
+{
+	struct sx_port *port = tty->driver_data;
+	int rts = -1, dtr = -1;
+
+	if (set & TIOCM_RTS)
+		rts = 1;
+	if (set & TIOCM_DTR)
+		dtr = 1;
+	if (clear & TIOCM_RTS)
+		rts = 0;
+	if (clear & TIOCM_DTR)
+		dtr = 0;
+
+	sx_setsignals(port, dtr, rts);
+	sx_reconfigure_port(port);
+	return 0;
+}
+
 static int sx_ioctl (struct tty_struct * tty, struct file * filp, 
                      unsigned int cmd, unsigned long arg)
 {
@@ -1775,34 +1801,6 @@
 		                      sizeof(struct serial_struct))) == 0)
 			rc = gs_setserial(&port->gs, (struct serial_struct *) arg);
 		break;
-	case TIOCMGET:
-		if ((rc = verify_area(VERIFY_WRITE, (void *) arg,
-		                      sizeof(unsigned int))) == 0) {
-			ival = sx_getsignals(port);
-			put_user(ival, (unsigned int *) arg);
-		}
-		break;
-	case TIOCMBIS:
-		if ((rc = get_user(ival, (unsigned int *) arg)) == 0) {
-			sx_setsignals(port, ((ival & TIOCM_DTR) ? 1 : -1),
-			                     ((ival & TIOCM_RTS) ? 1 : -1));
-			sx_reconfigure_port(port);
-		}
-		break;
-	case TIOCMBIC:
-		if ((rc = get_user(ival, (unsigned int *) arg)) == 0) {
-			sx_setsignals(port, ((ival & TIOCM_DTR) ? 0 : -1),
-			                     ((ival & TIOCM_RTS) ? 0 : -1));
-			sx_reconfigure_port(port);
-		}
-		break;
-	case TIOCMSET:
-		if ((rc = get_user(ival, (unsigned int *) arg)) == 0) {
-			sx_setsignals(port, ((ival & TIOCM_DTR) ? 1 : 0),
-			                     ((ival & TIOCM_RTS) ? 1 : 0));
-			sx_reconfigure_port(port);
-		}
-		break;
 	default:
 		rc = -ENOIOCTLCMD;
 		break;
@@ -2217,6 +2215,8 @@
 	.stop = gs_stop,
 	.start = gs_start,
 	.hangup = gs_hangup,
+	.tiocmget = sx_tiocmget,
+	.tiocmset = sx_tiocmset,
 };
 
 static int sx_init_drivers(void)
--- diff/drivers/char/synclink.c	2003-10-27 09:20:37.000000000 +0000
+++ source/drivers/char/synclink.c	2004-02-09 10:39:52.000000000 +0000
@@ -327,7 +327,6 @@
 	char netname[10];
 	struct net_device *netdev;
 	struct net_device_stats netstats;
-	struct net_device netdevice;
 #endif
 };
 
@@ -737,8 +736,8 @@
 
 #ifdef CONFIG_SYNCLINK_SYNCPPP
 /* SPPP/HDLC stuff */
-void mgsl_sppp_init(struct mgsl_struct *info);
-void mgsl_sppp_delete(struct mgsl_struct *info);
+static void mgsl_sppp_init(struct mgsl_struct *info);
+static void mgsl_sppp_delete(struct mgsl_struct *info);
 int mgsl_sppp_open(struct net_device *d);
 int mgsl_sppp_close(struct net_device *d);
 void mgsl_sppp_tx_timeout(struct net_device *d);
@@ -7820,36 +7819,45 @@
 #ifdef CONFIG_SYNCLINK_SYNCPPP
 /* syncppp net device routines
  */
+static void mgsl_setup(struct net_device *dev)
+{
+	dev->open = mgsl_sppp_open;
+	dev->stop = mgsl_sppp_close;
+	dev->hard_start_xmit = mgsl_sppp_tx;
+	dev->do_ioctl = mgsl_sppp_ioctl;
+	dev->get_stats = mgsl_net_stats;
+	dev->tx_timeout = mgsl_sppp_tx_timeout;
+	dev->watchdog_timeo = 10*HZ;
+}
 
-void mgsl_sppp_init(struct mgsl_struct *info)
+static void mgsl_sppp_init(struct mgsl_struct *info)
 {
 	struct net_device *d;
 
 	sprintf(info->netname,"mgsl%d",info->line);
 
+	d = alloc_netdev(0, info->netname, mgsl_setup);
+	if (!d) {
+		printk(KERN_WARNING "%s: alloc_netdev failed.\n",
+						info->netname);
+		return;
+	}
+
 	info->if_ptr = &info->pppdev;
-	info->netdev = info->pppdev.dev = &info->netdevice;
+	info->netdev = info->pppdev.dev = d;
 
 	sppp_attach(&info->pppdev);
 
-	d = info->netdev;
-	strcpy(d->name,info->netname);
 	d->base_addr = info->io_base;
 	d->irq = info->irq_level;
 	d->dma = info->dma_level;
 	d->priv = info;
-	d->init = NULL;
-	d->open = mgsl_sppp_open;
-	d->stop = mgsl_sppp_close;
-	d->hard_start_xmit = mgsl_sppp_tx;
-	d->do_ioctl = mgsl_sppp_ioctl;
-	d->get_stats = mgsl_net_stats;
-	d->tx_timeout = mgsl_sppp_tx_timeout;
-	d->watchdog_timeo = 10*HZ;
 
 	if (register_netdev(d)) {
 		printk(KERN_WARNING "%s: register_netdev failed.\n", d->name);
 		sppp_detach(info->netdev);
+		info->netdev = NULL;
+		free_netdev(d);
 		return;
 	}
 
@@ -7861,8 +7869,11 @@
 {
 	if (debug_level >= DEBUG_LEVEL_INFO)
 		printk("mgsl_sppp_delete(%s)\n",info->netname);	
-	sppp_detach(info->netdev);
 	unregister_netdev(info->netdev);
+	sppp_detach(info->netdev);
+	free_netdev(info->netdev);
+	info->netdev = NULL;
+	info->pppdev.dev = NULL;
 }
 
 int mgsl_sppp_open(struct net_device *d)
--- diff/drivers/char/synclinkmp.c	2003-10-27 09:20:37.000000000 +0000
+++ source/drivers/char/synclinkmp.c	2004-02-09 10:39:52.000000000 +0000
@@ -289,7 +289,6 @@
 	char netname[10];
 	struct net_device *netdev;
 	struct net_device_stats netstats;
-	struct net_device netdevice;
 #endif
 } SLMP_INFO;
 
@@ -1627,35 +1626,44 @@
 
 /* syncppp support and callbacks */
 
+static void cb_setup(struct net_device *dev)
+{
+	dev->open = sppp_cb_open;
+	dev->stop = sppp_cb_close;
+	dev->hard_start_xmit = sppp_cb_tx;
+	dev->do_ioctl = sppp_cb_ioctl;
+	dev->get_stats = sppp_cb_net_stats;
+	dev->tx_timeout = sppp_cb_tx_timeout;
+	dev->watchdog_timeo = 10*HZ;
+}
+
 static void sppp_init(SLMP_INFO *info)
 {
 	struct net_device *d;
 
 	sprintf(info->netname,"mgslm%dp%d",info->adapter_num,info->port_num);
 
+	d = alloc_netdev(0, info->netname, cb_setup);
+	if (!d) {
+		printk(KERN_WARNING "%s: alloc_netdev failed.\n",
+						info->netname);
+		return;
+	}
+
 	info->if_ptr = &info->pppdev;
-	info->netdev = info->pppdev.dev = &info->netdevice;
+	info->netdev = info->pppdev.dev = d;
 
 	sppp_attach(&info->pppdev);
 
-	d = info->netdev;
-	strcpy(d->name,info->netname);
-	d->base_addr = 0;
 	d->irq = info->irq_level;
-	d->dma = 0;
 	d->priv = info;
-	d->init = NULL;
-	d->open = sppp_cb_open;
-	d->stop = sppp_cb_close;
-	d->hard_start_xmit = sppp_cb_tx;
-	d->do_ioctl = sppp_cb_ioctl;
-	d->get_stats = sppp_cb_net_stats;
-	d->tx_timeout = sppp_cb_tx_timeout;
-	d->watchdog_timeo = 10*HZ;
 
 	if (register_netdev(d)) {
 		printk(KERN_WARNING "%s: register_netdev failed.\n", d->name);
 		sppp_detach(info->netdev);
+		info->netdev = NULL;
+		info->pppdev.dev = NULL;
+		free_netdev(d);
 		return;
 	}
 
@@ -1667,8 +1675,11 @@
 {
 	if (debug_level >= DEBUG_LEVEL_INFO)
 		printk("sppp_delete(%s)\n",info->netname);
-	sppp_detach(info->netdev);
 	unregister_netdev(info->netdev);
+	sppp_detach(info->netdev);
+	free_netdev(info->netdev);
+	info->netdev = NULL;
+	info->pppdev.dev = NULL;
 }
 
 static int sppp_cb_open(struct net_device *d)
--- diff/drivers/char/sysrq.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/char/sysrq.c	2004-02-09 10:39:52.000000000 +0000
@@ -35,6 +35,25 @@
 #include <linux/spinlock.h>
 
 #include <asm/ptrace.h>
+#ifdef CONFIG_KGDB_SYSRQ
+
+#define  GDB_OP &kgdb_op
+static void kgdb_sysrq(int key, struct pt_regs *pt_regs, struct tty_struct *tty)
+{
+	printk("kgdb sysrq\n");
+	breakpoint();
+}
+
+static struct sysrq_key_op kgdb_op = {
+	.handler	= kgdb_sysrq,
+	.help_msg	= "kGdb|Fgdb",
+	.action_msg	= "Debug breakpoint\n",
+};
+
+#else
+#define  GDB_OP NULL
+#endif
+
 
 extern void reset_vc(unsigned int);
 
@@ -238,8 +257,8 @@
 /* c */ NULL,
 /* d */	NULL,
 /* e */	&sysrq_term_op,
-/* f */	NULL,
-/* g */	NULL,
+/* f */	GDB_OP,
+/* g */	GDB_OP,
 /* h */	NULL,
 /* i */	&sysrq_kill_op,
 /* j */	NULL,
--- diff/drivers/char/tty_io.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/char/tty_io.c	2004-02-09 10:39:52.000000000 +0000
@@ -1484,7 +1484,12 @@
 #ifdef CONFIG_VT
 	if (tty->driver->type == TTY_DRIVER_TYPE_CONSOLE) {
 		unsigned int currcons = tty->index;
-		if (vc_resize(currcons, tmp_ws.ws_col, tmp_ws.ws_row))
+		int rc;
+
+		acquire_console_sem();
+		rc = vc_resize(currcons, tmp_ws.ws_col, tmp_ws.ws_row);
+		release_console_sem();
+		if (rc)
 			return -ENXIO;
 	}
 #endif
@@ -2350,12 +2355,18 @@
 static struct cdev vc0_cdev;
 #endif
 
+static int tty_initialized;
+
 /*
  * Ok, now we can initialize the rest of the tty devices and can count
  * on memory allocations, interrupts etc..
  */
-static int __init tty_init(void)
+int __init tty_init(void)
 {
+        if (tty_initialized)
+                return 0;
+	tty_initialized = 1;
+
 	strcpy(tty_cdev.kobj.name, "dev.tty");
 	cdev_init(&tty_cdev, &tty_fops);
 	if (cdev_add(&tty_cdev, MKDEV(TTYAUX_MAJOR, 0), 1) ||
--- diff/drivers/char/viocons.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/char/viocons.c	2004-02-09 10:39:52.000000000 +0000
@@ -149,7 +149,7 @@
 
 	spin_lock_irqsave(&consoleloglock, flags);
 	va_start(args, fmt);
-	i = vsnprintf(buf, sizeof(buf) - 1, fmt, args);
+	i = vscnprintf(buf, sizeof(buf) - 1, fmt, args);
 	va_end(args);
 	buf[i++] = '\r';
 	HvCall_writeLogBuffer(buf, i);
--- diff/drivers/char/vt.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/char/vt.c	2004-02-09 10:39:52.000000000 +0000
@@ -148,7 +148,6 @@
 static int con_open(struct tty_struct *, struct file *);
 static void vc_init(unsigned int console, unsigned int rows,
 		    unsigned int cols, int do_clear);
-static void blank_screen(unsigned long dummy);
 static void gotoxy(int currcons, int new_x, int new_y);
 static void save_cur(int currcons);
 static void reset_terminal(int currcons, int do_clear);
@@ -156,8 +155,8 @@
 static void set_vesa_blanking(unsigned long arg);
 static void set_cursor(int currcons);
 static void hide_cursor(int currcons);
-static void unblank_screen_t(unsigned long dummy);
 static void console_callback(void *ignored);
+static void blank_screen_t(unsigned long dummy);
 
 static int printable;		/* Is console ready for printing? */
 
@@ -214,6 +213,13 @@
 int (*console_blank_hook)(int);
 
 static struct timer_list console_timer;
+static int blank_state;
+static int blank_timer_expired;
+enum {
+	blank_off = 0,
+	blank_normal_wait,
+	blank_vesa_wait,
+};
 
 /*
  *	Low-Level Functions
@@ -337,6 +343,8 @@
 
 void update_region(int currcons, unsigned long start, int count)
 {
+	WARN_CONSOLE_UNLOCKED();
+
 	if (DO_UPDATE) {
 		hide_cursor(currcons);
 		do_update_region(currcons, start, count);
@@ -400,6 +408,8 @@
 {
 	unsigned short *p;
 
+	WARN_CONSOLE_UNLOCKED();
+
 	count /= 2;
 	p = screenpos(currcons, offset, viewed);
 	if (sw->con_invert_region)
@@ -445,6 +455,8 @@
 	static unsigned short old;
 	static unsigned short oldx, oldy;
 
+	WARN_CONSOLE_UNLOCKED();
+
 	if (p) {
 		scr_writew(old, p);
 		if (DO_UPDATE)
@@ -564,6 +576,8 @@
 
 static void set_origin(int currcons)
 {
+	WARN_CONSOLE_UNLOCKED();
+
 	if (!IS_VISIBLE ||
 	    !sw->con_set_origin ||
 	    !sw->con_set_origin(vc_cons[currcons].d))
@@ -575,6 +589,8 @@
 
 static inline void save_screen(int currcons)
 {
+	WARN_CONSOLE_UNLOCKED();
+
 	if (sw->con_save_screen)
 		sw->con_save_screen(vc_cons[currcons].d);
 }
@@ -588,6 +604,8 @@
 	int redraw = 1;
 	int currcons, old_console;
 
+	WARN_CONSOLE_UNLOCKED();
+
 	if (!vc_cons_allocated(new_console)) {
 		/* strange ... */
 		/* printk("redraw_screen: tty %d not allocated ??\n", new_console+1); */
@@ -665,6 +683,8 @@
 
 int vc_allocate(unsigned int currcons)	/* return 0 on success */
 {
+	WARN_CONSOLE_UNLOCKED();
+
 	if (currcons >= MAX_NR_CONSOLES)
 		return -ENXIO;
 	if (!vc_cons[currcons].d) {
@@ -731,6 +751,8 @@
 	unsigned int new_cols, new_rows, new_row_size, new_screen_size;
 	unsigned short *newscreen;
 
+	WARN_CONSOLE_UNLOCKED();
+
 	if (!vc_cons_allocated(currcons))
 		return -ENXIO;
 
@@ -817,7 +839,8 @@
 
 void vc_disallocate(unsigned int currcons)
 {
-	acquire_console_sem();
+	WARN_CONSOLE_UNLOCKED();
+
 	if (vc_cons_allocated(currcons)) {
 	    sw->con_deinit(vc_cons[currcons].d);
 	    if (kmalloced)
@@ -826,7 +849,6 @@
 		kfree(vc_cons[currcons].d);
 	    vc_cons[currcons].d = NULL;
 	}
-	release_console_sem();
 }
 
 /*
@@ -2081,6 +2103,10 @@
 			sw->con_scrolldelta(vc_cons[currcons].d, scrollback_delta);
 		scrollback_delta = 0;
 	}
+	if (blank_timer_expired) {
+		do_blank_screen(0);
+		blank_timer_expired = 0;
+	}
 
 	release_console_sem();
 }
@@ -2091,6 +2117,8 @@
 	schedule_console_callback();
 }
 
+struct tty_driver *console_driver;
+
 #ifdef CONFIG_VT_CONSOLE
 
 /*
@@ -2190,8 +2218,6 @@
 	clear_bit(0, &printing);
 }
 
-struct tty_driver *console_driver;
-
 static struct tty_driver *vt_console_device(struct console *c, int *index)
 {
 	*index = c->index ? c->index-1 : fg_console;
@@ -2414,7 +2440,9 @@
 
 	currcons = tty->index;
 
+	acquire_console_sem();
 	i = vc_allocate(currcons);
+	release_console_sem();
 	if (i)
 		return i;
 
@@ -2480,16 +2508,20 @@
 	const char *display_desc = NULL;
 	unsigned int currcons = 0;
 
+	acquire_console_sem();
+
 	if (conswitchp)
 		display_desc = conswitchp->con_startup();
 	if (!display_desc) {
 		fg_console = 0;
+		release_console_sem();
 		return 0;
 	}
 
 	init_timer(&console_timer);
-	console_timer.function = blank_screen;
+	console_timer.function = blank_screen_t;
 	if (blankinterval) {
+		blank_state = blank_normal_wait;
 		mod_timer(&console_timer, jiffies + blankinterval);
 	}
 
@@ -2520,6 +2552,8 @@
 	printable = 1;
 	printk("\n");
 
+	release_console_sem();
+
 #ifdef CONFIG_VT_CONSOLE
 	register_console(&vt_console_driver);
 #endif
@@ -2599,8 +2633,13 @@
 	int i, j = -1;
 	const char *desc;
 
+	acquire_console_sem();
+
 	desc = csw->con_startup();
-	if (!desc) return;
+	if (!desc) {
+		release_console_sem();
+		return;
+	}
 	if (deflt)
 		conswitchp = csw;
 
@@ -2640,6 +2679,8 @@
 		       desc, vc_cons[j].d->vc_cols, vc_cons[j].d->vc_rows);
 	else
 		printk("to %s\n", desc);
+
+	release_console_sem();
 }
 
 void give_up_console(const struct consw *csw)
@@ -2688,23 +2729,24 @@
     }
 }
 
-/*
- * This is a timer handler
- */
-static void vesa_powerdown_screen(unsigned long dummy)
-{
-	console_timer.function = unblank_screen_t;
-
-	vesa_powerdown();
-}
-
-static void timer_do_blank_screen(int entering_gfx, int from_timer_handler)
+void do_blank_screen(int entering_gfx)
 {
 	int currcons = fg_console;
 	int i;
 
-	if (console_blanked)
+	WARN_CONSOLE_UNLOCKED();
+
+	if (console_blanked) {
+		if (blank_state == blank_vesa_wait) {
+			blank_state = blank_off;
+			vesa_powerdown();
+
+		}
+		return;
+	}
+	if (blank_state != blank_normal_wait)
 		return;
+	blank_state = blank_off;
 
 	/* entering graphics mode? */
 	if (entering_gfx) {
@@ -2723,9 +2765,8 @@
 	}
 
 	hide_cursor(currcons);
-	if (!from_timer_handler)
-		del_timer_sync(&console_timer);
-	console_timer.function = unblank_screen_t;
+	del_timer_sync(&console_timer);
+	blank_timer_expired = 0;
 
 	save_screen(currcons);
 	/* In case we need to reset origin, blanking hook returns 1 */
@@ -2738,7 +2779,7 @@
 		return;
 
 	if (vesa_off_interval) {
-		console_timer.function = vesa_powerdown_screen;
+		blank_state = blank_vesa_wait,
 		mod_timer(&console_timer, jiffies + vesa_off_interval);
 	}
 
@@ -2746,18 +2787,6 @@
 		sw->con_blank(vc_cons[currcons].d, vesa_blank_mode + 1);
 }
 
-void do_blank_screen(int entering_gfx)
-{
-	timer_do_blank_screen(entering_gfx, 0);
-}
-
-/*
- * This is a timer handler
- */
-static void unblank_screen_t(unsigned long dummy)
-{
-	unblank_screen();
-}
 
 /*
  * Called by timer as well as from vt_console_driver
@@ -2766,6 +2795,8 @@
 {
 	int currcons;
 
+	WARN_CONSOLE_UNLOCKED();
+
 	ignore_poke = 0;
 	if (!console_blanked)
 		return;
@@ -2778,9 +2809,9 @@
 	if (vcmode != KD_TEXT)
 		return; /* but leave console_blanked != 0 */
 
-	console_timer.function = blank_screen;
 	if (blankinterval) {
 		mod_timer(&console_timer, jiffies + blankinterval);
+		blank_state = blank_normal_wait;
 	}
 
 	console_blanked = 0;
@@ -2794,23 +2825,33 @@
 }
 
 /*
- * This is both a user-level callable and a timer handler
+ * We defer the timer blanking to work queue so it can take the console semaphore
+ * (console operations can still happen at irq time, but only from printk which
+ * has the console semaphore. Not perfect yet, but better than no locking
  */
-static void blank_screen(unsigned long dummy)
+static void blank_screen_t(unsigned long dummy)
 {
-	timer_do_blank_screen(0, 1);
+	blank_timer_expired = 1;
+	schedule_work(&console_work);
 }
 
 void poke_blanked_console(void)
 {
+	WARN_CONSOLE_UNLOCKED();
+
+	/* This isn't perfectly race free, but a race here would be mostly harmless,
+	 * at worse, we'll do a spurrious blank and it's unlikely
+	 */
 	del_timer(&console_timer);
+	blank_timer_expired = 0;
+
 	if (ignore_poke || !vt_cons[fg_console] || vt_cons[fg_console]->vc_mode == KD_GRAPHICS)
 		return;
-	if (console_blanked) {
-		console_timer.function = unblank_screen_t;
-		mod_timer(&console_timer, jiffies);	/* Now */
-	} else if (blankinterval) {
+	if (console_blanked)
+		unblank_screen();
+	else if (blankinterval) {
 		mod_timer(&console_timer, jiffies + blankinterval);
+		blank_state = blank_normal_wait;
 	}
 }
 
@@ -2820,6 +2861,8 @@
 
 void set_palette(int currcons)
 {
+	WARN_CONSOLE_UNLOCKED();
+
 	if (vcmode != KD_GRAPHICS)
 		sw->con_set_palette(vc_cons[currcons].d, color_table);
 }
@@ -2828,6 +2871,8 @@
 {
     int i, j, k;
 
+    WARN_CONSOLE_UNLOCKED();
+
     for (i = 0; i < 16; i++)
 	if (set) {
 	    get_user(default_red[i], arg++);
@@ -2859,12 +2904,24 @@
 
 int con_set_cmap(unsigned char *arg)
 {
-	return set_get_cmap (arg,1);
+	int rc;
+
+	acquire_console_sem();
+	rc = set_get_cmap (arg,1);
+	release_console_sem();
+
+	return rc;
 }
 
 int con_get_cmap(unsigned char *arg)
 {
-	return set_get_cmap (arg,0);
+	int rc;
+
+	acquire_console_sem();
+	rc = set_get_cmap (arg,0);
+	release_console_sem();
+
+	return rc;
 }
 
 void reset_palette(int currcons)
@@ -2938,8 +2995,12 @@
 		set = 1;
 	} else if (op->op == KD_FONT_OP_GET)
 		set = 0;
-	else
-		return sw->con_font_op(vc_cons[currcons].d, op);
+	else {
+		acquire_console_sem();
+		rc = sw->con_font_op(vc_cons[currcons].d, op);
+		release_console_sem();
+		return rc;
+	}
 	if (op->data) {
 		temp = kmalloc(size, GFP_KERNEL);
 		if (!temp)
@@ -3001,13 +3062,13 @@
 	return screenpos(currcons, 2 * w_offset, viewed);
 }
 
-void getconsxy(int currcons, char *p)
+void getconsxy(int currcons, unsigned char *p)
 {
 	p[0] = x;
 	p[1] = y;
 }
 
-void putconsxy(int currcons, char *p)
+void putconsxy(int currcons, unsigned char *p)
 {
 	gotoxy(currcons, p[0], p[1]);
 	set_cursor(currcons);
@@ -3034,10 +3095,14 @@
 	switch (rqst)
 	{
 	case PM_RESUME:
+		acquire_console_sem();
 		unblank_screen();
+		release_console_sem();
 		break;
 	case PM_SUSPEND:
+		acquire_console_sem();
 		do_blank_screen(0);
+		release_console_sem();
 		break;
 	}
 	return 0;
--- diff/drivers/char/vt_ioctl.c	2004-01-19 10:22:56.000000000 +0000
+++ source/drivers/char/vt_ioctl.c	2004-02-09 10:39:52.000000000 +0000
@@ -470,6 +470,9 @@
 		 * currently, setting the mode from KD_TEXT to KD_GRAPHICS
 		 * doesn't do a whole lot. i'm not sure if it should do any
 		 * restoration of modes or what...
+		 *
+		 * XXX It should at least call into the driver, fbdev's definitely
+		 * need to restore their engine state. --BenH
 		 */
 		if (!perm)
 			return -EPERM;
@@ -492,10 +495,12 @@
 		/*
 		 * explicitly blank/unblank the screen if switching modes
 		 */
+		acquire_console_sem();
 		if (arg == KD_TEXT)
 			unblank_screen();
 		else
 			do_blank_screen(1);
+		release_console_sem();
 		return 0;
 
 	case KDGETMODE:
@@ -665,18 +670,29 @@
 			return -EFAULT;
 		if (tmp.mode != VT_AUTO && tmp.mode != VT_PROCESS)
 			return -EINVAL;
+		acquire_console_sem();
 		vt_cons[console]->vt_mode = tmp;
 		/* the frsig is ignored, so we set it to 0 */
 		vt_cons[console]->vt_mode.frsig = 0;
 		vt_cons[console]->vt_pid = current->pid;
 		/* no switch is required -- saw@shade.msu.ru */
 		vt_cons[console]->vt_newvt = -1; 
+		release_console_sem();
 		return 0;
 	}
 
 	case VT_GETMODE:
-		return copy_to_user((void*)arg, &(vt_cons[console]->vt_mode), 
-							sizeof(struct vt_mode)) ? -EFAULT : 0; 
+	{
+		struct vt_mode tmp;
+		int rc;
+
+		acquire_console_sem();
+		memcpy(&tmp, &vt_cons[console]->vt_mode, sizeof(struct vt_mode));
+		release_console_sem();
+
+		rc = copy_to_user((void*)arg, &tmp, sizeof(struct vt_mode));
+		return rc ? -EFAULT : 0;
+	}
 
 	/*
 	 * Returns global vt state. Note that VT 0 is always open, since
@@ -718,7 +734,9 @@
 		if (arg == 0 || arg > MAX_NR_CONSOLES)
 			return -ENXIO;
 		arg--;
+		acquire_console_sem();
 		i = vc_allocate(arg);
+		release_console_sem();
 		if (i)
 			return i;
 		set_console(arg);
@@ -768,17 +786,20 @@
 				 * The current vt has been released, so
 				 * complete the switch.
 				 */
-				int newvt = vt_cons[console]->vt_newvt;
+				int newvt;
+				acquire_console_sem();
+				newvt = vt_cons[console]->vt_newvt;
 				vt_cons[console]->vt_newvt = -1;
 				i = vc_allocate(newvt);
-				if (i)
+				if (i) {
+					release_console_sem();
 					return i;
+				}
 				/*
 				 * When we actually do the console switch,
 				 * make sure we are atomic with respect to
 				 * other console switches..
 				 */
-				acquire_console_sem();
 				complete_change_console(newvt);
 				release_console_sem();
 			}
@@ -806,16 +827,21 @@
 			return -ENXIO;
 		if (arg == 0) {
 		    /* disallocate all unused consoles, but leave 0 */
-		    for (i=1; i<MAX_NR_CONSOLES; i++)
-		      if (! VT_BUSY(i))
-			vc_disallocate(i);
+			acquire_console_sem();
+			for (i=1; i<MAX_NR_CONSOLES; i++)
+				if (! VT_BUSY(i))
+					vc_disallocate(i);
+			release_console_sem();
 		} else {
-		    /* disallocate a single console, if possible */
-		    arg--;
-		    if (VT_BUSY(arg))
-		      return -EBUSY;
-		    if (arg)			      /* leave 0 */
-		      vc_disallocate(arg);
+			/* disallocate a single console, if possible */
+			arg--;
+			if (VT_BUSY(arg))
+				return -EBUSY;
+			if (arg) {			      /* leave 0 */
+				acquire_console_sem();
+				vc_disallocate(arg);
+				release_console_sem();
+			}
 		}
 		return 0;
 
@@ -828,8 +854,11 @@
 		if (get_user(ll, &vtsizes->v_rows) ||
 		    get_user(cc, &vtsizes->v_cols))
 			return -EFAULT;
-		for (i = 0; i < MAX_NR_CONSOLES; i++)
+		for (i = 0; i < MAX_NR_CONSOLES; i++) {
+			acquire_console_sem();
                         vc_resize(i, cc, ll);
+			release_console_sem();
+		}
 		return 0;
 	}
 
@@ -870,11 +899,13 @@
 		for (i = 0; i < MAX_NR_CONSOLES; i++) {
 			if (!vc_cons[i].d)
 				continue;
+			acquire_console_sem();
 			if (vlin)
 				vc_cons[i].d->vc_scan_lines = vlin;
 			if (clin)
 				vc_cons[i].d->vc_font.height = clin;
 			vc_resize(i, cc, ll);
+			release_console_sem();
 		}
   		return 0;
 	}
--- diff/drivers/cpufreq/cpufreq.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/cpufreq/cpufreq.c	2004-02-09 10:39:52.000000000 +0000
@@ -198,7 +198,7 @@
 	else if (policy->policy == CPUFREQ_POLICY_PERFORMANCE)
 		return sprintf(buf, "performance\n");
 	else if (policy->governor)
-		return snprintf(buf, CPUFREQ_NAME_LEN, "%s\n", policy->governor->name);
+		return scnprintf(buf, CPUFREQ_NAME_LEN, "%s\n", policy->governor->name);
 	return -EINVAL;
 }
 
@@ -234,7 +234,7 @@
  */
 static ssize_t show_scaling_driver (struct cpufreq_policy * policy, char *buf)
 {
-	return snprintf(buf, CPUFREQ_NAME_LEN, "%s\n", cpufreq_driver->name);
+	return scnprintf(buf, CPUFREQ_NAME_LEN, "%s\n", cpufreq_driver->name);
 }
 
 /**
@@ -254,7 +254,7 @@
 	list_for_each_entry(t, &cpufreq_governor_list, governor_list) {
 		if (i >= (ssize_t) ((PAGE_SIZE / sizeof(char)) - (CPUFREQ_NAME_LEN + 2)))
 			goto out;
-		i += snprintf(&buf[i], CPUFREQ_NAME_LEN, "%s ", t->name);
+		i += scnprintf(&buf[i], CPUFREQ_NAME_LEN, "%s ", t->name);
 	}
  out:
 	i += sprintf(&buf[i], "\n");
--- diff/drivers/cpufreq/proc_intf.c	2003-09-17 12:28:05.000000000 +0100
+++ source/drivers/cpufreq/proc_intf.c	2004-02-09 10:39:52.000000000 +0000
@@ -139,7 +139,7 @@
 				break;
 			} 
 		} else
-			p += snprintf(p, CPUFREQ_NAME_LEN, "%s\n", policy.governor->name);
+			p += scnprintf(p, CPUFREQ_NAME_LEN, "%s\n", policy.governor->name);
 	}
 end:
 	len = (p - page);
--- diff/drivers/i2c/busses/Kconfig	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/i2c/busses/Kconfig	2004-02-09 10:39:52.000000000 +0000
@@ -69,6 +69,18 @@
 	  This support is also available as a module.  If so, the module 
 	  will be called i2c-elv.
 
+config I2C_HYDRA
+	tristate "CHRP Apple Hydra Mac I/O I2C interface"
+	depends on I2C && PCI && PPC_CHRP && EXPERIMENTAL
+	select I2C_ALGOBIT
+	help
+	  This supports the use of the I2C interface in the Apple Hydra Mac
+	  I/O chip on some CHRP machines (e.g. the LongTrail).  Say Y if you
+	  have such a machine.
+
+	  This support is also available as a module.  If so, the module
+	  will be called i2c-hydra.
+
 config I2C_I801
 	tristate "Intel 801"
 	depends on I2C && PCI && EXPERIMENTAL
--- diff/drivers/i2c/busses/Makefile	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/i2c/busses/Makefile	2004-02-09 10:39:52.000000000 +0000
@@ -8,6 +8,7 @@
 obj-$(CONFIG_I2C_AMD8111)	+= i2c-amd8111.o
 obj-$(CONFIG_I2C_ELEKTOR)	+= i2c-elektor.o
 obj-$(CONFIG_I2C_ELV)		+= i2c-elv.o
+obj-$(CONFIG_I2C_HYDRA)		+= i2c-hydra.o
 obj-$(CONFIG_I2C_I801)		+= i2c-i801.o
 obj-$(CONFIG_I2C_I810)		+= i2c-i810.o
 obj-$(CONFIG_I2C_IBM_IIC)	+= i2c-ibm_iic.o
--- diff/drivers/i2c/busses/i2c-keywest.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/i2c/busses/i2c-keywest.c	2004-02-09 10:39:52.000000000 +0000
@@ -26,6 +26,8 @@
     2001/12/13 BenH	New implementation
     2001/12/15 BenH	Add support for "byte" and "quick"
                         transfers. Add i2c_xfer routine.
+    2003/09/21 BenH	Rework state machine with Paulus help
+    2004/01/21 BenH	Merge in Greg KH changes, polled mode is back
 
     My understanding of the various modes supported by keywest are:
 
@@ -67,9 +69,35 @@
 #include <asm/prom.h>
 #include <asm/machdep.h>
 #include <asm/pmac_feature.h>
+#include <asm/pmac_low_i2c.h>
 
 #include "i2c-keywest.h"
 
+/* Currently, we don't deal with the weird interrupt cascade of the G5
+ * machines with the ppc64 kernel, so use Polled mode on these
+ */
+#ifdef CONFIG_PPC64
+#define POLLED_MODE
+#else
+#undef POLLED_MODE
+#endif
+
+/* Some debug macros */
+#define WRONG_STATE(name) do {\
+		pr_debug("KW: wrong state. Got %s, state: %s (isr: %02x)\n", \
+			 name, __kw_state_names[iface->state], isr);	\
+	} while(0)
+
+#ifdef DEBUG
+static const char *__kw_state_names[] = {
+	"state_idle",
+	"state_addr",
+	"state_read",
+	"state_write",
+	"state_stop",
+	"state_dead"
+};
+#endif /* DEBUG */
 
 MODULE_AUTHOR("Benjamin Herrenschmidt <benh@kernel.crashing.org>");
 MODULE_DESCRIPTION("I2C driver for Apple's Keywest");
@@ -78,121 +106,154 @@
 
 static int probe = 0;
 
+#ifdef POLLED_MODE
+/* Don't schedule, the g5 fan controller is too
+ * timing sensitive
+ */
+static u8
+wait_interrupt(struct keywest_iface* iface)
+{
+	int i;
+	u8 isr;
+	
+	for (i = 0; i < 200000; i++) {
+		isr = read_reg(reg_isr) & KW_I2C_IRQ_MASK;
+		if (isr != 0)
+			return isr;
+		udelay(1);
+	}
+	return isr;
+}
+#endif /* POLLED_MODE */
+
 static void
 do_stop(struct keywest_iface* iface, int result)
 {
-	write_reg(reg_control, read_reg(reg_control) | KW_I2C_CTL_STOP);
+	write_reg(reg_control, KW_I2C_CTL_STOP);
 	iface->state = state_stop;
 	iface->result = result;
 }
 
 /* Main state machine for standard & standard sub mode */
-static int
+static void
 handle_interrupt(struct keywest_iface *iface, u8 isr)
 {
 	int ack;
-	int rearm_timer = 1;
 	
-	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);
-		return rearm_timer;
-	}
-	if (isr & KW_I2C_IRQ_STOP && iface->state != state_stop) {
-		iface->result = -1;
-		iface->state = state_stop;
-	}
-	switch(iface->state) {
-	case state_addr:
-		if (!(isr & KW_I2C_IRQ_ADDR)) {
-			do_stop(iface, -1);
-			break;
+	if (isr == 0) {
+		if (iface->state != state_stop) {
+			pr_debug("KW: Timeout !\n");
+			do_stop(iface, -EIO);
 		}
-		ack = read_reg(reg_status);
-		pr_debug("ack on set address: %x\n", ack);
-		if ((ack & KW_I2C_STAT_LAST_AAK) == 0) {
-			do_stop(iface, -1);
-			break;
-		}
-		/* Handle rw "quick" mode */
-		if (iface->datalen == 0)
-			do_stop(iface, 0);
-		else if (iface->read_write == I2C_SMBUS_READ) {
-			iface->state = state_read;
-			if (iface->datalen > 1)
-				write_reg(reg_control, read_reg(reg_control)
-					| KW_I2C_CTL_AAK);
-		} else {
-			iface->state = state_write;
-			pr_debug("write byte: %x\n", *(iface->data));
-			write_reg(reg_data, *(iface->data++));
-			iface->datalen--;
-		}
-		
-		break;
-	case state_read:
-		if (!(isr & KW_I2C_IRQ_DATA)) {
-			do_stop(iface, -1);
-			break;
-		}
-		*(iface->data++) = read_reg(reg_data);
-		pr_debug("read byte: %x\n", *(iface->data-1));
-		iface->datalen--;
-		if (iface->datalen == 0)
-			iface->state = state_stop;
-		else
-			write_reg(reg_control, 0);
-		break;
-	case state_write:
-		if (!(isr & KW_I2C_IRQ_DATA)) {
-			do_stop(iface, -1);
-			break;
+		if (iface->state == state_stop) {
+			ack = read_reg(reg_status);
+			if (!(ack & KW_I2C_STAT_BUSY)) {
+				iface->state = state_idle;
+				write_reg(reg_ier, 0x00);
+#ifndef POLLED_MODE
+				complete(&iface->complete);
+#endif /* POLLED_MODE */
+			}
 		}
-		/* Check ack status */
+		return;
+	}
+
+	if (isr & KW_I2C_IRQ_ADDR) {
 		ack = read_reg(reg_status);
-		pr_debug("ack on data write: %x\n", ack);
+		if (iface->state != state_addr) {
+			write_reg(reg_isr, KW_I2C_IRQ_ADDR);
+			WRONG_STATE("KW_I2C_IRQ_ADDR"); 
+			do_stop(iface, -EIO);
+			return;
+		}
 		if ((ack & KW_I2C_STAT_LAST_AAK) == 0) {
-			do_stop(iface, -1);
-			break;
+			iface->state = state_stop;		     
+			iface->result = -ENODEV;
+			pr_debug("KW: NAK on address\n");
+		} else {
+			/* Handle rw "quick" mode */
+			if (iface->datalen == 0) {
+				do_stop(iface, 0);
+			} else if (iface->read_write == I2C_SMBUS_READ) {
+				iface->state = state_read;
+				if (iface->datalen > 1)
+					write_reg(reg_control, KW_I2C_CTL_AAK);
+			} else {
+				iface->state = state_write;
+				write_reg(reg_data, *(iface->data++));
+				iface->datalen--;
+			}
 		}
-		if (iface->datalen) {
-			pr_debug("write byte: %x\n", *(iface->data));
-			write_reg(reg_data, *(iface->data++));
+		write_reg(reg_isr, KW_I2C_IRQ_ADDR);
+	}
+
+	if (isr & KW_I2C_IRQ_DATA) {
+		if (iface->state == state_read) {
+			*(iface->data++) = read_reg(reg_data);
+			write_reg(reg_isr, KW_I2C_IRQ_DATA);
 			iface->datalen--;
-		} else
-			do_stop(iface, 0);
-		break;
-		
-	case state_stop:
-		if (!(isr & KW_I2C_IRQ_STOP) && (++iface->stopretry) < 10)
-			do_stop(iface, -1);
-		else {
-			rearm_timer = 0;
-			iface->state = state_idle;
-			write_reg(reg_control, 0x00);
-			write_reg(reg_ier, 0x00);
-			complete(&iface->complete);
+			if (iface->datalen == 0)
+				iface->state = state_stop;
+			else if (iface->datalen == 1)
+				write_reg(reg_control, 0);
+		} else if (iface->state == state_write) {
+			/* Check ack status */
+			ack = read_reg(reg_status);
+			if ((ack & KW_I2C_STAT_LAST_AAK) == 0) {
+				pr_debug("KW: nack on data write (%x): %x\n",
+				    iface->data[-1], ack);
+				do_stop(iface, -EIO);
+			} else if (iface->datalen) {
+				write_reg(reg_data, *(iface->data++));
+				iface->datalen--;
+			} else {
+				write_reg(reg_control, KW_I2C_CTL_STOP);
+				iface->state = state_stop;
+				iface->result = 0;
+			}
+			write_reg(reg_isr, KW_I2C_IRQ_DATA);
+		} else {
+			write_reg(reg_isr, KW_I2C_IRQ_DATA);
+			WRONG_STATE("KW_I2C_IRQ_DATA"); 
+			if (iface->state != state_stop)
+				do_stop(iface, -EIO);
 		}
-		break;
 	}
-	
-	write_reg(reg_isr, isr);
 
-	return rearm_timer;
+	if (isr & KW_I2C_IRQ_STOP) {
+		write_reg(reg_isr, KW_I2C_IRQ_STOP);
+		if (iface->state != state_stop) {
+			WRONG_STATE("KW_I2C_IRQ_STOP");
+			iface->result = -EIO;
+		}
+		iface->state = state_idle;
+		write_reg(reg_ier, 0x00);
+#ifndef POLLED_MODE
+		complete(&iface->complete);
+#endif /* POLLED_MODE */			
+	}
+
+	if (isr & KW_I2C_IRQ_START)
+		write_reg(reg_isr, KW_I2C_IRQ_START);
 }
 
+#ifndef POLLED_MODE
+
 /* Interrupt handler */
 static irqreturn_t
 keywest_irq(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct keywest_iface *iface = (struct keywest_iface *)dev_id;
+	unsigned long flags;
 
-	spin_lock(&iface->lock);
+	spin_lock_irqsave(&iface->lock, flags);
 	del_timer(&iface->timeout_timer);
-	if (handle_interrupt(iface, read_reg(reg_isr)))
-		mod_timer(&iface->timeout_timer, jiffies + POLL_TIMEOUT);
-	spin_unlock(&iface->lock);
+	handle_interrupt(iface, read_reg(reg_isr));
+	if (iface->state != state_idle) {
+		iface->timeout_timer.expires = jiffies + POLL_TIMEOUT;
+		add_timer(&iface->timeout_timer);
+	}
+	spin_unlock_irqrestore(&iface->lock, flags);
 	return IRQ_HANDLED;
 }
 
@@ -200,14 +261,20 @@
 keywest_timeout(unsigned long data)
 {
 	struct keywest_iface *iface = (struct keywest_iface *)data;
+	unsigned long flags;
 
 	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);
-	spin_unlock(&iface->lock);
+	spin_lock_irqsave(&iface->lock, flags);
+	handle_interrupt(iface, read_reg(reg_isr));
+	if (iface->state != state_idle) {
+		iface->timeout_timer.expires = jiffies + POLL_TIMEOUT;
+		add_timer(&iface->timeout_timer);
+	}
+	spin_unlock_irqrestore(&iface->lock, flags);
 }
 
+#endif /* POLLED_MODE */
+
 /*
  * SMBUS-type transfer entrypoint
  */
@@ -228,46 +295,54 @@
 	int rc = 0;
 
 	if (iface->state == state_dead)
-		return -1;
+		return -ENXIO;
 		
 	/* Prepare datas & select mode */
 	iface->cur_mode &= ~KW_I2C_MODE_MODE_MASK;
 	switch (size) {
-	    case I2C_SMBUS_QUICK:
+        case I2C_SMBUS_QUICK:
 	    	len = 0;
 	    	buffer = NULL;
 	    	iface->cur_mode |= KW_I2C_MODE_STANDARD;
 	    	break;
-	    case I2C_SMBUS_BYTE:
+        case I2C_SMBUS_BYTE:
 	    	len = 1;
 	    	buffer = &data->byte;
 	    	iface->cur_mode |= KW_I2C_MODE_STANDARD;
 	    	break;
-	    case I2C_SMBUS_BYTE_DATA:
+        case I2C_SMBUS_BYTE_DATA:
 	    	len = 1;
 	    	buffer = &data->byte;
 	    	iface->cur_mode |= KW_I2C_MODE_STANDARDSUB;
 	    	break;
-	    case I2C_SMBUS_WORD_DATA:
+        case I2C_SMBUS_WORD_DATA:
 	    	len = 2;
 	    	cur_word = cpu_to_le16(data->word);
 	    	buffer = (u8 *)&cur_word;
 	    	iface->cur_mode |= KW_I2C_MODE_STANDARDSUB;
 		break;
-	    case I2C_SMBUS_BLOCK_DATA:
+        case I2C_SMBUS_BLOCK_DATA:
 	    	len = data->block[0];
 	    	buffer = &data->block[1];
 	    	iface->cur_mode |= KW_I2C_MODE_STANDARDSUB;
 		break;
-	    default:
+        default:
 	    	return -1;
 	}
 
+	/* Turn a standardsub read into a combined mode access */
+ 	if (read_write == I2C_SMBUS_READ
+ 	    && (iface->cur_mode & KW_I2C_MODE_MODE_MASK) == KW_I2C_MODE_STANDARDSUB) {
+ 		iface->cur_mode &= ~KW_I2C_MODE_MODE_MASK;
+ 		iface->cur_mode |= KW_I2C_MODE_COMBINED;
+ 	}
+
 	/* Original driver had this limitation */
 	if (len > 32)
 		len = 32;
 
-	down(&iface->sem);
+	if (pmac_low_i2c_lock(iface->node))
+		return -ENXIO;
 
 	pr_debug("chan: %d, addr: 0x%x, transfer len: %d, read: %d\n",
 		chan->chan_no, addr, len, read_write == I2C_SMBUS_READ);
@@ -276,12 +351,11 @@
 	iface->datalen = len;
 	iface->state = state_addr;
 	iface->result = 0;
-	iface->stopretry = 0;
 	iface->read_write = read_write;
 	
 	/* Setup channel & clear pending irqs */
-	write_reg(reg_mode, iface->cur_mode | (chan->chan_no << 4));
 	write_reg(reg_isr, read_reg(reg_isr));
+	write_reg(reg_mode, iface->cur_mode | (chan->chan_no << 4));
 	write_reg(reg_status, 0);
 
 	/* Set up address and r/w bit */
@@ -293,15 +367,31 @@
 	    || (iface->cur_mode & KW_I2C_MODE_MODE_MASK) == KW_I2C_MODE_COMBINED)
 		write_reg(reg_subaddr, command);
 
+#ifndef POLLED_MODE
 	/* Arm timeout */
-	mod_timer(&iface->timeout_timer, jiffies + POLL_TIMEOUT);
+	iface->timeout_timer.expires = jiffies + POLL_TIMEOUT;
+	add_timer(&iface->timeout_timer);
+#endif
 
 	/* Start sending address & enable interrupt*/
-	write_reg(reg_control, read_reg(reg_control) | KW_I2C_CTL_XADDR);
+	write_reg(reg_control, KW_I2C_CTL_XADDR);
 	write_reg(reg_ier, KW_I2C_IRQ_MASK);
 
-	/* Wait interrupt operations completion */
+#ifdef POLLED_MODE
+	pr_debug("using polled mode...\n");
+	/* State machine, to turn into an interrupt handler */
+	while(iface->state != state_idle) {
+		unsigned long flags;
+
+		u8 isr = wait_interrupt(iface);
+		spin_lock_irqsave(&iface->lock, flags);
+		handle_interrupt(iface, isr);
+		spin_unlock_irqrestore(&iface->lock, flags);
+	}
+#else /* POLLED_MODE */
+	pr_debug("using interrupt mode...\n");
 	wait_for_completion(&iface->complete);	
+#endif /* POLLED_MODE */	
 
 	rc = iface->result;	
 	pr_debug("transfer done, result: %d\n", rc);
@@ -310,7 +400,7 @@
 	    	data->word = le16_to_cpu(cur_word);
 	
 	/* Release sem */
-	up(&iface->sem);
+	pmac_low_i2c_unlock(iface->node);
 	
 	return rc;
 }
@@ -329,7 +419,11 @@
 	int i, completed;
 	int rc = 0;
 
-	down(&iface->sem);
+	if (iface->state == state_dead)
+		return -ENXIO;
+
+	if (pmac_low_i2c_lock(iface->node))
+		return -ENXIO;
 
 	/* Set adapter to standard mode */
 	iface->cur_mode &= ~KW_I2C_MODE_MODE_MASK;
@@ -360,7 +454,6 @@
 		iface->datalen = pmsg->len;
 		iface->state = state_addr;
 		iface->result = 0;
-		iface->stopretry = 0;
 		if (pmsg->flags & I2C_M_RD)
 			iface->read_write = I2C_SMBUS_READ;
 		else
@@ -373,15 +466,27 @@
 			(addr << 1) |
 			((iface->read_write == I2C_SMBUS_READ) ? 0x01 : 0x00));
 
+#ifndef POLLED_MODE
 		/* Arm timeout */
-		mod_timer(&iface->timeout_timer, jiffies + POLL_TIMEOUT);
+		iface->timeout_timer.expires = jiffies + POLL_TIMEOUT;
+		add_timer(&iface->timeout_timer);
+#endif
 
 		/* Start sending address & enable interrupt*/
-		write_reg(reg_control, read_reg(reg_control) | KW_I2C_CTL_XADDR);
 		write_reg(reg_ier, KW_I2C_IRQ_MASK);
+		write_reg(reg_control, KW_I2C_CTL_XADDR);
 
-		/* Wait interrupt operations completion */
+#ifdef POLLED_MODE
+		pr_debug("using polled mode...\n");
+		/* State machine, to turn into an interrupt handler */
+		while(iface->state != state_idle) {
+			u8 isr = wait_interrupt(iface);
+			handle_interrupt(iface, isr);
+		}
+#else /* POLLED_MODE */
+		pr_debug("using interrupt mode...\n");
 		wait_for_completion(&iface->complete);	
+#endif /* POLLED_MODE */	
 
 		rc = iface->result;
 		if (rc == 0)
@@ -390,7 +495,7 @@
 	}
 
 	/* Release sem */
-	up(&iface->sem);
+	pmac_low_i2c_unlock(iface->node);
 
 	return completed;
 }
@@ -421,6 +526,9 @@
 	struct keywest_iface* iface;
 	int rc;
 
+	if (pmac_low_i2c_lock(np))
+		return -ENODEV;
+
 	psteps = (unsigned long *)get_property(np, "AAPL,address-step", NULL);
 	steps = psteps ? (*psteps) : 0x10;
 
@@ -428,7 +536,7 @@
 	for (bsteps = 0; (steps & 0x01) == 0; bsteps++)
 		steps >>= 1;
 
-	if (!strcmp(np->parent->name, "uni-n")) {
+	if (np->parent->name[0] == 'u') {
 		nchan = 2;
 		addroffset = 3;
 	} else {
@@ -441,12 +549,13 @@
 	iface = (struct keywest_iface *) kmalloc(tsize, GFP_KERNEL);
 	if (iface == NULL) {
 		printk(KERN_ERR "i2c-keywest: can't allocate inteface !\n");
+		pmac_low_i2c_unlock(np);
 		return -ENOMEM;
 	}
 	memset(iface, 0, tsize);
-	init_MUTEX(&iface->sem);
 	spin_lock_init(&iface->lock);
 	init_completion(&iface->complete);
+	iface->node = of_node_get(np);
 	iface->bsteps = bsteps;
 	iface->chan_count = nchan;
 	iface->state = state_idle;
@@ -458,12 +567,15 @@
 	if (iface->base == 0) {
 		printk(KERN_ERR "i2c-keywest: can't map inteface !\n");
 		kfree(iface);
+		pmac_low_i2c_unlock(np);
 		return -ENOMEM;
 	}
 
+#ifndef POLLED_MODE
 	init_timer(&iface->timeout_timer);
 	iface->timeout_timer.function = keywest_timeout;
 	iface->timeout_timer.data = (unsigned long)iface;
+#endif
 
 	/* Select interface rate */
 	iface->cur_mode = KW_I2C_MODE_100KHZ;
@@ -483,8 +595,8 @@
 			*prate);
 	}
 	
-	/* Select standard sub mode */
-	iface->cur_mode |= KW_I2C_MODE_STANDARDSUB;
+	/* Select standard mode by default */
+	iface->cur_mode |= KW_I2C_MODE_STANDARD;
 	
 	/* Write mode */
 	write_reg(reg_mode, iface->cur_mode);
@@ -493,14 +605,17 @@
 	write_reg(reg_ier, 0x00);
 	write_reg(reg_isr, KW_I2C_IRQ_MASK);
 
+#ifndef POLLED_MODE
 	/* Request chip interrupt */	
-	rc = request_irq(iface->irq, keywest_irq, 0, "keywest i2c", iface);
+	rc = request_irq(iface->irq, keywest_irq, SA_INTERRUPT, "keywest i2c", iface);
 	if (rc) {
 		printk(KERN_ERR "i2c-keywest: can't get IRQ %d !\n", iface->irq);
 		iounmap((void *)iface->base);
 		kfree(iface);
+		pmac_low_i2c_unlock(np);
 		return -ENODEV;
 	}
+#endif /* POLLED_MODE */
 
 	dev_set_drvdata(dev, iface);
 	
@@ -539,6 +654,7 @@
 	printk(KERN_INFO "Found KeyWest i2c on \"%s\", %d channel%s, stepping: %d bits\n",
 		np->parent->name, nchan, nchan > 1 ? "s" : "", bsteps);
 		
+	pmac_low_i2c_unlock(np);
 	return 0;
 }
 
@@ -549,8 +665,10 @@
 	int i, rc;
 	
 	/* Make sure we stop all activity */
-	down(&iface->sem);
+	if (pmac_low_i2c_lock(iface->node))
+		return -ENODEV;
 
+#ifndef POLLED_MODE
 	spin_lock_irq(&iface->lock);
 	while (iface->state != state_idle) {
 		spin_unlock_irq(&iface->lock);
@@ -558,10 +676,14 @@
 		schedule_timeout(HZ/10);
 		spin_lock_irq(&iface->lock);
 	}
+#endif /* POLLED_MODE */
 	iface->state = state_dead;
+#ifndef POLLED_MODE
 	spin_unlock_irq(&iface->lock);
 	free_irq(iface->irq, iface);
-	up(&iface->sem);
+#endif /* POLLED_MODE */
+
+	pmac_low_i2c_unlock(iface->node);
 
 	/* Release all channels */
 	for (i=0; i<iface->chan_count; i++) {
@@ -576,6 +698,7 @@
 	}
 	iounmap((void *)iface->base);
 	dev_set_drvdata(dev, NULL);
+	of_node_put(iface->node);
 	kfree(iface);
 
 	return 0;
@@ -634,8 +757,8 @@
 static int __init
 i2c_keywest_init(void)
 {
-	macio_register_driver(&i2c_keywest_macio_driver);
 	of_register_driver(&i2c_keywest_of_platform_driver);
+	macio_register_driver(&i2c_keywest_macio_driver);
 
 	return 0;
 }
@@ -643,8 +766,8 @@
 static void __exit
 i2c_keywest_cleanup(void)
 {
-	macio_unregister_driver(&i2c_keywest_macio_driver);
 	of_unregister_driver(&i2c_keywest_of_platform_driver);
+	macio_unregister_driver(&i2c_keywest_macio_driver);
 }
 
 module_init(i2c_keywest_init);
--- diff/drivers/i2c/busses/i2c-keywest.h	2003-09-30 15:46:13.000000000 +0100
+++ source/drivers/i2c/busses/i2c-keywest.h	2004-02-09 10:39:52.000000000 +0000
@@ -51,20 +51,19 @@
 /* Physical interface */
 struct keywest_iface
 {
+	struct device_node	*node;
 	unsigned long		base;
 	unsigned		bsteps;
 	int			irq;
-	struct semaphore	sem;
 	spinlock_t		lock;
-	struct keywest_chan*	channels;
+	struct keywest_chan	*channels;
 	unsigned		chan_count;
 	u8			cur_mode;
 	char			read_write;
-	u8*			data;
+	u8			*data;
 	unsigned		datalen;
 	int			state;
 	int			result;
-	int			stopretry;
 	struct timer_list	timeout_timer;
 	struct completion	complete;
 };
@@ -98,8 +97,7 @@
 {
 	out_8(((volatile u8 *)iface->base)
 		+ (((unsigned)reg) << iface->bsteps), val);
-	(void)__read_reg(iface, reg);
-	udelay(10);
+	(void)__read_reg(iface, reg_subaddr);
 }
 
 #define write_reg(reg, val)	__write_reg(iface, reg, val) 
--- diff/drivers/i2c/chips/Kconfig	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/i2c/chips/Kconfig	2004-02-09 10:39:52.000000000 +0000
@@ -45,6 +45,17 @@
 	  This driver can also be built as a module.  If so, the module
 	  will be called eeprom.
 
+config SENSORS_GL518SM
+	tristate "Genesys Logic GL518SM"
+	depends on I2C && EXPERIMENTAL
+	select I2C_SENSOR
+	help
+	  If you say yes here you get support for Genesys Logic GL518SM
+	  sensor chips.
+
+	  This driver can also be built as a module.  If so, the module
+	  will be called gl518sm.
+
 config SENSORS_IT87
 	tristate "ITE IT87xx and compatibles"
 	depends on I2C && EXPERIMENTAL
--- diff/drivers/i2c/chips/Makefile	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/i2c/chips/Makefile	2004-02-09 10:39:52.000000000 +0000
@@ -8,6 +8,7 @@
 
 obj-$(CONFIG_SENSORS_ADM1021)	+= adm1021.o
 obj-$(CONFIG_SENSORS_EEPROM)	+= eeprom.o
+obj-$(CONFIG_SENSORS_GL518SM)	+= gl518sm.o
 obj-$(CONFIG_SENSORS_IT87)	+= it87.o
 obj-$(CONFIG_SENSORS_LM75)	+= lm75.o
 obj-$(CONFIG_SENSORS_LM78)	+= lm78.o
--- diff/drivers/i2c/chips/it87.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/i2c/chips/it87.c	2004-02-09 10:39:52.000000000 +0000
@@ -126,14 +126,13 @@
 				205-(val)*5)
 #define ALARMS_FROM_REG(val) (val)
 
-static int log2(int val)
+static int DIV_TO_REG(int val)
 {
 	int answer = 0;
 	while ((val >>= 1))
 		answer++;
 	return answer;
 }
-#define DIV_TO_REG(val) log2(val)
 #define DIV_FROM_REG(val) (1 << (val))
 
 /* Initial limits. Use the config file to set better limits. */
--- diff/drivers/i2c/chips/lm85.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/i2c/chips/lm85.c	2004-02-09 10:39:52.000000000 +0000
@@ -816,7 +816,7 @@
 			kind = lm85b ;
 		} else if( company == LM85_COMPANY_NATIONAL
 		    && (verstep & 0xf0) == LM85_VERSTEP_GENERIC ) {
-			dev_err(&adapter->dev, "Unrecgonized version/stepping 0x%02x"
+			dev_err(&adapter->dev, "Unrecognized version/stepping 0x%02x"
 				" Defaulting to LM85.\n", verstep);
 			kind = any_chip ;
 		} else if( company == LM85_COMPANY_ANALOG_DEV
@@ -827,7 +827,7 @@
 			kind = adt7463 ;
 		} else if( company == LM85_COMPANY_ANALOG_DEV
 		    && (verstep & 0xf0) == LM85_VERSTEP_GENERIC ) {
-			dev_err(&adapter->dev, "Unrecgonized version/stepping 0x%02x"
+			dev_err(&adapter->dev, "Unrecognized version/stepping 0x%02x"
 				" Defaulting to ADM1027.\n", verstep);
 			kind = adm1027 ;
 		} else if( kind == 0 && (verstep & 0xf0) == 0x60) {
@@ -1204,7 +1204,7 @@
 
 /* Thanks to Richard Barrington for adding the LM85 to sensors-detect.
  * Thanks to Margit Schubert-While <margitsw@t-online.de> for help with
- *     post 2.7.0 CVS changes
+ *     post 2.7.0 CVS changes.
  */
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Philip Pokorny <ppokorny@penguincomputing.com>, Margit Schubert-While <margitsw@t-online.de>");
--- diff/drivers/i2c/chips/w83l785ts.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/i2c/chips/w83l785ts.c	2004-02-09 10:39:52.000000000 +0000
@@ -38,6 +38,9 @@
 #include <linux/i2c.h>
 #include <linux/i2c-sensor.h>
 
+/* How many retries on register read error */
+#define MAX_RETRIES	5
+
 /*
  * Address to scan
  * Address is fully defined internally and cannot be changed.
@@ -82,6 +85,7 @@
 static int w83l785ts_detect(struct i2c_adapter *adapter, int address,
 	int kind);
 static int w83l785ts_detach_client(struct i2c_client *client);
+static u8 w83l785ts_read_value(struct i2c_client *client, u8 reg, u8 defval);
 static void w83l785ts_update_client(struct i2c_client *client);
 
 /*
@@ -137,8 +141,8 @@
 	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)
+static DEVICE_ATTR(temp_input1, S_IRUGO, show_temp, NULL)
+static DEVICE_ATTR(temp_max1, S_IRUGO, show_temp_over, NULL)
 
 /*
  * Real code
@@ -196,10 +200,10 @@
 	 * 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)) {
+		if (((w83l785ts_read_value(new_client,
+		      W83L785TS_REG_CONFIG, 0) & 0x80) != 0x00)
+		 || ((w83l785ts_read_value(new_client,
+		      W83L785TS_REG_TYPE, 0) & 0xFC) != 0x00)) {
 			dev_dbg(&adapter->dev,
 				"W83L785TS-S detection failed at 0x%02x.\n",
 				address);
@@ -211,12 +215,12 @@
 		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);
+		man_id = (w83l785ts_read_value(new_client,
+			 W83L785TS_REG_MAN_ID1, 0) << 8) +
+			 w83l785ts_read_value(new_client,
+			 W83L785TS_REG_MAN_ID2, 0);
+		chip_id = w83l785ts_read_value(new_client,
+			  W83L785TS_REG_CHIP_ID, 0);
 
 		if (man_id == 0x5CA3) { /* Winbond */
 			if (chip_id == 0x70) { /* W83L785TS-S */
@@ -239,6 +243,9 @@
 	data->valid = 0;
 	init_MUTEX(&data->update_lock);
 
+	/* Default values in case the first read fails (unlikely). */
+	data->temp_over = data->temp = 0;
+
 	/* Tell the I2C layer a new client has arrived. */
 	if ((err = i2c_attach_client(new_client))) 
 		goto exit_free;
@@ -249,8 +256,8 @@
 	 */
 
 	/* Register sysfs hooks */
-	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_input1);
+	device_create_file(&new_client->dev, &dev_attr_temp_max1);
 
 	return 0;
 
@@ -274,6 +281,26 @@
 	return 0;
 }
 
+static u8 w83l785ts_read_value(struct i2c_client *client, u8 reg, u8 defval)
+{
+	int value, i;
+
+	/* Frequent read errors have been reported on Asus boards, so we
+	 * retry on read errors. If it still fails (unlikely), return the
+	 * default value requested by the caller. */
+	for (i = 1; i <= MAX_RETRIES; i++) {
+		value = i2c_smbus_read_byte_data(client, reg);
+		if (value >= 0)
+			return value;
+		dev_dbg(&client->dev, "Read failed, will retry in %d.\n", i);
+		i2c_delay(i);
+	}
+
+	dev_err(&client->dev, "Couldn't read value from register. "
+		"Please report.\n");
+	return defval;
+}
+
 static void w83l785ts_update_client(struct i2c_client *client)
 {
 	struct w83l785ts_data *data = i2c_get_clientdata(client);
@@ -284,10 +311,10 @@
 	 || (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->temp = w83l785ts_read_value(client,
+			     W83L785TS_REG_TEMP, data->temp);
+		data->temp_over = w83l785ts_read_value(client,
+				  W83L785TS_REG_TEMP_OVER, data->temp_over);
 
 		data->last_updated = jiffies;
 		data->valid = 1;
--- diff/drivers/i2c/i2c-core.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/i2c/i2c-core.c	2004-02-09 10:39:52.000000000 +0000
@@ -598,7 +598,7 @@
 		ret = adap->algo->master_xfer(adap,&msg,1);
 		up(&adap->bus_lock);
 	
-		dev_dbg(&client->dev, "master_recv: return:%d (count:%d, addr:0x%02x)\n",
+		dev_dbg(&client->adapter->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
--- diff/drivers/ide/ide-cd.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/ide/ide-cd.c	2004-02-09 10:39:52.000000000 +0000
@@ -294,10 +294,12 @@
  * 4.60  Dec 17, 2003	- Add mt rainier support
  *			- Bump timeout for packet commands, matches sr
  *			- Odd stuff
+ * 4.61  Jan 22, 2004	- support hardware sector sizes other than 2kB,
+ *			  Pascal Schmidt <der.eremit@email.de>
  *
  *************************************************************************/
  
-#define IDECD_VERSION "4.60"
+#define IDECD_VERSION "4.61"
 
 #include <linux/config.h>
 #include <linux/module.h>
@@ -818,6 +820,14 @@
 				do_end_request = 1;
 		} else if (sense_key == ILLEGAL_REQUEST ||
 			   sense_key == DATA_PROTECT) {
+			/*
+			 * check if this was a write protected media
+			 */
+			if (rq_data_dir(rq) == WRITE) {
+				printk("ide-cd: media marked write protected\n");
+				set_disk_ro(drive->disk, 1);
+			}
+
 			/* No point in retrying after an illegal
 			   request or data protect error.*/
 			ide_dump_status (drive, "command error", stat);
@@ -1211,6 +1221,9 @@
 {
 	struct cdrom_info *info = drive->driver_data;
 	struct request *rq = HWGROUP(drive)->rq;
+	unsigned short sectors_per_frame;
+
+	sectors_per_frame = queue_hardsect_size(drive->queue) >> SECTOR_BITS;
 
 	/* Can't do anything if there's no buffer. */
 	if (info->buffer == NULL) return 0;
@@ -1249,7 +1262,7 @@
 	   will fail.  I think that this will never happen, but let's be
 	   paranoid and check. */
 	if (rq->current_nr_sectors < bio_cur_sectors(rq->bio) &&
-	    (rq->sector % SECTORS_PER_FRAME) != 0) {
+	    (rq->sector & (sectors_per_frame - 1))) {
 		printk("%s: cdrom_read_from_buffer: buffer botch (%ld)\n",
 			drive->name, (long)rq->sector);
 		cdrom_end_request(drive, 0);
@@ -1268,13 +1281,10 @@
 static ide_startstop_t cdrom_start_read_continuation (ide_drive_t *drive)
 {
 	struct request *rq = HWGROUP(drive)->rq;
-	int nsect, sector, nframes, frame, nskip;
+	unsigned short sectors_per_frame;
+	int nskip;
 
-	/* Number of sectors to transfer. */
-	nsect = rq->nr_sectors;
-
-	/* Starting sector. */
-	sector = rq->sector;
+	sectors_per_frame = queue_hardsect_size(drive->queue) >> SECTOR_BITS;
 
 	/* If the requested sector doesn't start on a cdrom block boundary,
 	   we must adjust the start of the transfer so that it does,
@@ -1283,31 +1293,19 @@
 	   of the buffer, it will mean that we're to skip a number
 	   of sectors equal to the amount by which CURRENT_NR_SECTORS
 	   is larger than the buffer size. */
-	nskip = (sector % SECTORS_PER_FRAME);
+	nskip = rq->sector & (sectors_per_frame - 1);
 	if (nskip > 0) {
 		/* Sanity check... */
 		if (rq->current_nr_sectors != bio_cur_sectors(rq->bio) &&
-			(rq->sector % CD_FRAMESIZE != 0)) {
+			(rq->sector & (sectors_per_frame - 1))) {
 			printk ("%s: cdrom_start_read_continuation: buffer botch (%u)\n",
 				drive->name, rq->current_nr_sectors);
 			cdrom_end_request(drive, 0);
 			return ide_stopped;
 		}
-		sector -= nskip;
-		nsect += nskip;
 		rq->current_nr_sectors += nskip;
 	}
 
-	/* Convert from sectors to cdrom blocks, rounding up the transfer
-	   length if needed. */
-	nframes = (nsect + SECTORS_PER_FRAME-1) / SECTORS_PER_FRAME;
-	frame = sector / SECTORS_PER_FRAME;
-
-	/* Largest number of frames was can transfer at once is 64k-1. For
-	   some drives we need to limit this even more. */
-	nframes = MIN (nframes, (CDROM_CONFIG_FLAGS (drive)->limit_nframes) ?
-		(65534 / CD_FRAMESIZE) : 65535);
-
 	/* Set up the command */
 	rq->timeout = ATAPI_WAIT_PC;
 
@@ -1346,13 +1344,9 @@
 static ide_startstop_t cdrom_start_seek_continuation (ide_drive_t *drive)
 {
 	struct request *rq = HWGROUP(drive)->rq;
-	int sector, frame, nskip;
+	int frame = rq->sector;
 
-	sector = rq->sector;
-	nskip = (sector % SECTORS_PER_FRAME);
-	if (nskip > 0)
-		sector -= nskip;
-	frame = sector / SECTORS_PER_FRAME;
+	sector_div(frame, queue_hardsect_size(drive->queue) >> SECTOR_BITS);
 
 	memset(rq->cmd, 0, sizeof(rq->cmd));
 	rq->cmd[0] = GPCMD_SEEK;
@@ -1396,6 +1390,9 @@
 {
 	struct cdrom_info *info = drive->driver_data;
 	struct request *rq = HWGROUP(drive)->rq;
+	unsigned short sectors_per_frame;
+
+	sectors_per_frame = queue_hardsect_size(drive->queue) >> SECTOR_BITS;
 
 	/* We may be retrying this request after an error.  Fix up
 	   any weirdness which might be present in the request packet. */
@@ -1411,10 +1408,9 @@
 	info->nsectors_buffered = 0;
 
 	/* use dma, if possible. */
-	if (drive->using_dma && (rq->sector % SECTORS_PER_FRAME == 0) &&
-				(rq->nr_sectors % SECTORS_PER_FRAME == 0))
-		info->dma = 1;
-	else
+	info->dma = drive->using_dma;
+	if ((rq->sector & (sectors_per_frame - 1)) ||
+	    (rq->nr_sectors & (sectors_per_frame - 1)))
 		info->dma = 0;
 
 	info->cmd = READ;
@@ -1950,11 +1946,22 @@
 static ide_startstop_t cdrom_start_write(ide_drive_t *drive, struct request *rq)
 {
 	struct cdrom_info *info = drive->driver_data;
+	struct gendisk *g = drive->disk;
+	unsigned short sectors_per_frame = queue_hardsect_size(drive->queue) >> SECTOR_BITS;
 
 	/*
-	 * writes *must* be 2kB frame aligned
+	 * writes *must* be hardware frame aligned
 	 */
-	if ((rq->nr_sectors & 3) || (rq->sector & 3)) {
+	if ((rq->nr_sectors & (sectors_per_frame - 1)) ||
+	    (rq->sector & (sectors_per_frame - 1))) {
+		cdrom_end_request(drive, 0);
+		return ide_stopped;
+	}
+
+	/*
+	 * disk has become write protected
+	 */
+	if (g->policy) {
 		cdrom_end_request(drive, 0);
 		return ide_stopped;
 	}
@@ -1969,12 +1976,12 @@
 
 	info->nsectors_buffered = 0;
 
-        /* use dma, if possible. we don't need to check more, since we
-	 * know that the transfer is always (at least!) 2KB aligned */
+	/* use dma, if possible. we don't need to check more, since we
+	 * know that the transfer is always (at least!) frame aligned */
 	info->dma = drive->using_dma ? 1 : 0;
 	info->cmd = WRITE;
 
-	/* Start sending the read request to the drive. */
+	/* Start sending the write request to the drive. */
 	return cdrom_start_packet_command(drive, 32768, cdrom_start_write_cont);
 }
 
@@ -2209,6 +2216,7 @@
 }
 
 static int cdrom_read_capacity(ide_drive_t *drive, unsigned long *capacity,
+			       unsigned long *sectors_per_frame,
 			       struct request_sense *sense)
 {
 	struct {
@@ -2227,8 +2235,11 @@
 	req.data_len = sizeof(capbuf);
 
 	stat = cdrom_queue_packet_command(drive, &req);
-	if (stat == 0)
+	if (stat == 0) {
 		*capacity = 1 + be32_to_cpu(capbuf.lba);
+		*sectors_per_frame =
+			be32_to_cpu(capbuf.blocklen) >> SECTOR_BITS;
+	}
 
 	return stat;
 }
@@ -2270,6 +2281,7 @@
 		struct atapi_toc_entry  ent;
 	} ms_tmp;
 	long last_written;
+	unsigned long sectors_per_frame = SECTORS_PER_FRAME;
 
 	if (toc == NULL) {
 		/* Try to allocate space. */
@@ -2289,12 +2301,15 @@
 	if (CDROM_STATE_FLAGS(drive)->toc_valid)
 		return 0;
 
-	/* Try to get the total cdrom capacity. */
-	stat = cdrom_read_capacity(drive, &toc->capacity, sense);
+	/* Try to get the total cdrom capacity and sector size. */
+	stat = cdrom_read_capacity(drive, &toc->capacity, &sectors_per_frame,
+				   sense);
 	if (stat)
 		toc->capacity = 0x1fffff;
 
-	set_capacity(drive->disk, toc->capacity * SECTORS_PER_FRAME);
+	set_capacity(drive->disk, toc->capacity * sectors_per_frame);
+	blk_queue_hardsect_size(drive->queue,
+				sectors_per_frame << SECTOR_BITS);
 
 	/* First read just the header, so we know how long the TOC is. */
 	stat = cdrom_read_tocentry(drive, 0, 1, 0, (char *) &toc->hdr,
@@ -2406,7 +2421,7 @@
 	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);
+		set_capacity(drive->disk, toc->capacity * sectors_per_frame);
 	}
 
 	/* Remember that we've read this stuff. */
@@ -3306,12 +3321,12 @@
 static
 sector_t ide_cdrom_capacity (ide_drive_t *drive)
 {
-	unsigned long capacity;
+	unsigned long capacity, sectors_per_frame;
 
-	if (cdrom_read_capacity(drive, &capacity, NULL))
+	if (cdrom_read_capacity(drive, &capacity, &sectors_per_frame, NULL))
 		return 0;
 
-	return capacity * SECTORS_PER_FRAME;
+	return capacity * sectors_per_frame;
 }
 
 static
@@ -3511,7 +3526,7 @@
 	snprintf(g->devfs_name, sizeof(g->devfs_name),
 			"%s/cd", drive->devfs_name);
 	g->driverfs_dev = &drive->gendev;
-	g->flags = GENHD_FL_CD;
+	g->flags = GENHD_FL_CD | GENHD_FL_REMOVABLE;
 	if (ide_cdrom_setup(drive)) {
 		struct cdrom_device_info *devinfo = &info->devinfo;
 		DRIVER(drive)->busy--;
--- diff/drivers/ide/ide-floppy.c	2003-10-27 09:20:37.000000000 +0000
+++ source/drivers/ide/ide-floppy.c	2004-02-09 10:39:52.000000000 +0000
@@ -1317,6 +1317,7 @@
 	}
 	header = (idefloppy_mode_parameter_header_t *) pc.buffer;
 	floppy->wp = header->wp;
+	set_disk_ro(drive->disk, floppy->wp);
 	page = (idefloppy_flexible_disk_page_t *) (header + 1);
 
 	page->transfer_rate = ntohs(page->transfer_rate);
--- diff/drivers/ide/ide-tape.c	2004-01-19 10:22:56.000000000 +0000
+++ source/drivers/ide/ide-tape.c	2004-02-09 10:39:52.000000000 +0000
@@ -6502,3 +6502,4 @@
 
 module_init(idetape_init);
 module_exit(idetape_exit);
+MODULE_ALIAS_CHARDEV_MAJOR(IDETAPE_MAJOR);
--- diff/drivers/ide/ide.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/ide/ide.c	2004-02-09 10:39:52.000000000 +0000
@@ -1689,7 +1689,7 @@
 
 		case CDROMEJECT:
 		case CDROMCLOSETRAY:
-			return scsi_cmd_ioctl(bdev, cmd, arg);
+			return scsi_cmd_ioctl(bdev->bd_disk, cmd, arg);
 
 		case HDIO_GET_BUSSTATE:
 			if (!capable(CAP_SYS_ADMIN))
--- diff/drivers/ide/pci/alim15x3.c	2003-11-25 15:24:57.000000000 +0000
+++ source/drivers/ide/pci/alim15x3.c	2004-02-09 10:39:52.000000000 +0000
@@ -1,5 +1,5 @@
 /*
- * linux/drivers/ide/pci/alim15x3.c		Version 0.16	2003/01/02
+ * linux/drivers/ide/pci/alim15x3.c		Version 0.17	2003/01/02
  *
  *  Copyright (C) 1998-2000 Michel Aubry, Maintainer
  *  Copyright (C) 1998-2000 Andrzej Krzysztofowicz, Maintainer
@@ -19,6 +19,7 @@
  *	Don't use LBA48 mode on ALi <= 0xC4
  *	Don't poke 0x79 with a non ALi northbridge
  *	Don't flip undefined bits on newer chipsets (fix Fujitsu laptop hang)
+ *	Allow UDMA6 on revisions > 0xC4
  *
  *  Documentation
  *	Chipset documentation available under NDA only
@@ -406,7 +407,9 @@
 {
 	u8 mode = 0, can_ultra	= ali15x3_can_ultra(drive);
 
-	if (m5229_revision >= 0xC4 && can_ultra) {
+	if (m5229_revision > 0xC4 && can_ultra) {
+		mode = 4;
+	} else if (m5229_revision == 0xC4 && can_ultra) {
 		mode = 3;
 	} else if (m5229_revision >= 0xC2 && can_ultra) {
 		mode = 2;
@@ -439,11 +442,15 @@
 {
 	ide_hwif_t *hwif	= HWIF(drive);
 	struct pci_dev *dev	= hwif->pci_dev;
-	u8 speed	= ide_rate_filter(ali15x3_ratemask(drive), xferspeed);
+	u8 speed		= ide_rate_filter(ali15x3_ratemask(drive), xferspeed);
+	u8 speed1		= speed;
 	u8 unit			= (drive->select.b.unit & 0x01);
 	u8 tmpbyte		= 0x00;
 	int m5229_udma		= (hwif->channel) ? 0x57 : 0x56;
 
+        if (speed == XFER_UDMA_6)
+                speed1 = 0x47;
+
 	if (speed < XFER_UDMA_0) {
 		u8 ultra_enable	= (unit) ? 0x7f : 0xf7;
 		/*
@@ -461,7 +468,7 @@
 		/*
 		 * enable ultra dma and set timing
 		 */
-		tmpbyte |= ((0x08 | ((4-speed)&0x07)) << (unit << 2));
+		tmpbyte |= ((0x08 | ((4-speed1)&0x07)) << (unit << 2));
 		pci_write_config_byte(dev, m5229_udma, tmpbyte);
 		if (speed >= XFER_UDMA_3) {
 			pci_read_config_byte(dev, 0x4b, &tmpbyte);
@@ -757,7 +764,7 @@
 	hwif->atapi_dma = 1;
 
 	if (m5229_revision > 0x20)
-		hwif->ultra_mask = 0x3f;
+		hwif->ultra_mask = 0x7f;
 	hwif->mwdma_mask = 0x07;
 	hwif->swdma_mask = 0x07;
 
--- diff/drivers/ide/pci/sc1200.c	2003-10-09 09:47:34.000000000 +0100
+++ source/drivers/ide/pci/sc1200.c	2004-02-09 10:39:52.000000000 +0000
@@ -420,7 +420,7 @@
 				ss = kmalloc(sizeof(sc1200_saved_state_t), GFP_KERNEL);
 				if (ss == NULL)
 					return -ENOMEM;
-				(sc1200_saved_state_t *)hwif->config_data = ss;
+				hwif->config_data = (unsigned long)ss;
 			}
 			ss = (sc1200_saved_state_t *)hwif->config_data;
 			//
--- diff/drivers/ide/pci/siimage.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/ide/pci/siimage.c	2004-02-09 10:39:52.000000000 +0000
@@ -1,5 +1,5 @@
 /*
- * linux/drivers/ide/pci/siimage.c		Version 1.06	June 11, 2003
+ * linux/drivers/ide/pci/siimage.c		Version 1.07	Nov 30, 2003
  *
  * Copyright (C) 2001-2002	Andre Hedrick <andre@linux-ide.org>
  * Copyright (C) 2003		Red Hat <alan@redhat.com>
@@ -1044,6 +1044,27 @@
 	hwif->mmio			= 2;
 }
 
+static int is_dev_seagate_sata(ide_drive_t *drive)
+{
+	const char *s = &drive->id->model[0];
+	unsigned len;
+
+	if (!drive->present)
+		return 0;
+
+	len = strnlen(s, sizeof(drive->id->model));
+
+	if ((len > 4) && (!memcmp(s, "ST", 2))) {
+		if ((!memcmp(s + len - 2, "AS", 2)) ||
+		    (!memcmp(s + len - 3, "ASL", 3))) {
+			printk(KERN_INFO "%s: applying pessimistic Seagate "
+					 "errata fix\n", drive->name);
+			return 1;
+		}
+	}
+	return 0;
+}
+
 /**
  *	init_iops_siimage	-	set up iops
  *	@hwif: interface to set up
@@ -1065,7 +1086,7 @@
 	hwif->hwif_data = 0;
 
 	hwif->rqsize = 128;
-	if (is_sata(hwif))
+	if (is_sata(hwif) && is_dev_seagate_sata(&hwif->drives[0]))
 		hwif->rqsize = 15;
 
 	if (pci_get_drvdata(dev) == NULL)
--- diff/drivers/ide/pci/triflex.c	2003-09-17 12:28:06.000000000 +0100
+++ source/drivers/ide/pci/triflex.c	2004-02-09 10:39:52.000000000 +0000
@@ -45,6 +45,7 @@
 
 static struct pci_dev *triflex_dev;
 
+#ifdef CONFIG_PROC_FS
 static int triflex_get_info(char *buf, char **addr, off_t offset, int count)
 {
 	char *p = buf;
@@ -91,6 +92,7 @@
 	
 	return len > count ? count : len;
 }
+#endif
 
 static int triflex_tune_chipset(ide_drive_t *drive, u8 xferspeed)
 {
--- diff/drivers/ide/pci/triflex.h	2003-08-20 14:16:28.000000000 +0100
+++ source/drivers/ide/pci/triflex.h	2004-02-09 10:39:52.000000000 +0000
@@ -14,8 +14,16 @@
 
 static unsigned int __devinit init_chipset_triflex(struct pci_dev *, const char *);
 static void init_hwif_triflex(ide_hwif_t *);
+#ifdef CONFIG_PROC_FS
 static int triflex_get_info(char *, char **, off_t, int);
 
+static ide_pci_host_proc_t triflex_proc __initdata = {
+	.name		= "triflex",
+	.set		= 1,
+	.get_info 	= triflex_get_info,
+};
+#endif
+
 static ide_pci_device_t triflex_devices[] __devinitdata = {
 	{
 		.vendor 	= PCI_VENDOR_ID_COMPAQ,
@@ -33,14 +41,6 @@
 	}
 };
 
-#ifdef CONFIG_PROC_FS
-static ide_pci_host_proc_t triflex_proc __initdata = {
-	.name		= "triflex",
-	.set		= 1,
-	.get_info 	= triflex_get_info,
-};
-#endif
-
 static struct pci_device_id triflex_pci_tbl[] = {
 	{ PCI_VENDOR_ID_COMPAQ, PCI_DEVICE_ID_COMPAQ_TRIFLEX_IDE, PCI_ANY_ID, 
 		PCI_ANY_ID, 0, 0, 0 },
--- diff/drivers/ide/ppc/pmac.c	2003-09-17 12:28:06.000000000 +0100
+++ source/drivers/ide/ppc/pmac.c	2004-02-09 10:39:52.000000000 +0000
@@ -69,7 +69,7 @@
 #ifdef CONFIG_BLK_DEV_IDEDMA_PMAC
 	/* Those fields are duplicating what is in hwif. We currently
 	 * can't use the hwif ones because of some assumptions that are
-	 * being done by the generic code about the kind of dma controller
+	 * beeing done by the generic code about the kind of dma controller
 	 * and format of the dma table. This will have to be fixed though.
 	 */
 	volatile struct dbdma_regs*	dma_regs;
@@ -90,15 +90,17 @@
 	controller_heathrow,	/* Heathrow/Paddington */
 	controller_kl_ata3,	/* KeyLargo ATA-3 */
 	controller_kl_ata4,	/* KeyLargo ATA-4 */
-	controller_un_ata6	/* UniNorth2 ATA-6 */
+	controller_un_ata6,	/* UniNorth2 ATA-6 */
+	controller_k2_ata6	/* K2 ATA-6 */
 };
 
 static const char* model_name[] = {
 	"OHare ATA",		/* OHare based */
 	"Heathrow ATA",		/* Heathrow/Paddington */
-	"KeyLargo ATA-3",	/* KeyLargo ATA-3 */
-	"KeyLargo ATA-4",	/* KeyLargo ATA-4 */
-	"UniNorth ATA-6"	/* UniNorth2 ATA-6 */
+	"KeyLargo ATA-3",	/* KeyLargo ATA-3 (MDMA only) */
+	"KeyLargo ATA-4",	/* KeyLargo ATA-4 (UDMA/66) */
+	"UniNorth ATA-6",	/* UniNorth2 ATA-6 (UDMA/100) */
+	"K2 ATA-6",		/* K2 ATA-6 (UDMA/100) */
 };
 
 /*
@@ -336,16 +338,19 @@
 /* allow up to 256 DBDMA commands per xfer */
 #define MAX_DCMDS		256
 
-/* Wait 2s for disk to answer on IDE bus after
- * enable operation.
- * NOTE: There is at least one case I know of a disk that needs about 10sec
- *       before anwering on the bus. I beleive we could add a kernel command
- *       line arg to override this delay for such cases.
- *       
- * NOTE2: This has to be fixed with a BSY wait loop. I'm working on adding
- *        that to the generic probe code.
+/* 
+ * Wait 1s for disk to answer on IDE bus after a hard reset
+ * of the device (via GPIO/FCR).
+ * 
+ * Some devices seem to "pollute" the bus even after dropping
+ * the BSY bit (typically some combo drives slave on the UDMA
+ * bus) after a hard reset. Since we hard reset all drives on
+ * KeyLargo ATA66, we have to keep that delay around. I may end
+ * up not hard resetting anymore on these and keep the delay only
+ * for older interfaces instead (we have to reset when coming
+ * from MacOS...) --BenH. 
  */
-#define IDE_WAKEUP_DELAY_MS	2000
+#define IDE_WAKEUP_DELAY	(1*HZ)
 
 static void pmac_ide_setup_dma(pmac_ide_hwif_t *pmif, ide_hwif_t *hwif);
 static int pmac_ide_build_dmatable(ide_drive_t *drive, struct request *rq);
@@ -357,9 +362,16 @@
 
 #endif /* CONFIG_BLK_DEV_IDEDMA_PMAC */
 
+/*
+ * Below is the code for blinking the laptop LED along with hard
+ * disk activity.
+ */
+
 #ifdef CONFIG_BLK_DEV_IDE_PMAC_BLINK
 
-/* Set to 50ms */
+/* Set to 50ms minimum led-on time (also used to limit frequency
+ * of requests sent to the PMU
+ */
 #define PMU_HD_BLINK_TIME	(HZ/50)
 
 static struct adb_request pmu_blink_on, pmu_blink_off;
@@ -402,6 +414,7 @@
 	pmu_blink_stoptime = jiffies + PMU_HD_BLINK_TIME;
 	wmb();
 	mod_timer(&pmu_blink_timer, pmu_blink_stoptime);
+	/* Fast path when LED is already ON */
 	if (pmu_blink_ledstate == 1)
 		return;
 	spin_lock_irqsave(&pmu_blink_lock, flags);
@@ -418,6 +431,11 @@
 	struct device_node *dt;
 	const char *model;
 
+	/* Currently, I only enable this feature on KeyLargo based laptops,
+	 * older laptops may support it (at least heathrow/paddington) but
+	 * I don't feel like loading those venerable old machines with so
+	 * much additional interrupt & PMU activity...
+	 */
 	if (pmu_get_model() != PMU_KEYLARGO_BASED)
 		return 0;
 	
@@ -476,9 +494,11 @@
 		*irq = pmac_ide[ix].irq;
 }
 
-/* Setup timings for the selected drive (master/slave). I still need to verify if this
- * is enough, I beleive selectproc will be called whenever an IDE command is started,
- * but... */
+/*
+ * Apply the timings of the proper unit (master/slave) to the shared
+ * timing register when selecting that unit. This version is for
+ * ASICs with a single timing register
+ */
 static void __pmac
 pmac_ide_selectproc(ide_drive_t *drive)
 {
@@ -496,6 +516,11 @@
 	(void)readl((unsigned *)(IDE_DATA_REG+IDE_TIMING_CONFIG));
 }
 
+/*
+ * Apply the timings of the proper unit (master/slave) to the shared
+ * timing register when selecting that unit. This version is for
+ * ASICs with a dual timing register (Kauai)
+ */
 static void __pmac
 pmac_ide_kauai_selectproc(ide_drive_t *drive)
 {
@@ -518,6 +543,9 @@
 	(void)readl((unsigned *)(IDE_DATA_REG + IDE_KAUAI_PIO_CONFIG));
 }
 
+/*
+ * Force an update of controller timing values for a given drive
+ */
 static void __pmac
 pmac_ide_do_update_timings(ide_drive_t *drive)
 {
@@ -526,12 +554,29 @@
 	if (pmif == NULL)
 		return;
 
-	if (pmif->kind == controller_un_ata6)
+	if (pmif->kind == controller_un_ata6 || pmif->kind == controller_k2_ata6)
 		pmac_ide_kauai_selectproc(drive);
 	else
 		pmac_ide_selectproc(drive);
 }
 
+static void
+pmac_outbsync(ide_drive_t *drive, u8 value, unsigned long port)
+{
+	u32 tmp;
+	
+	writeb(value, port);	
+	tmp = readl((unsigned *)(IDE_DATA_REG + IDE_TIMING_CONFIG));
+}
+
+/*
+ * Send the SET_FEATURE IDE command to the drive and update drive->id with
+ * the new state. We currently don't use the generic routine as it used to
+ * cause various trouble, especially with older mediabays.
+ * This code is sometimes triggering a spurrious interrupt though, I need
+ * to sort that out sooner or later and see if I can finally get the
+ * common version to work properly in all cases
+ */
 static int __pmac
 pmac_ide_do_setfeature(ide_drive_t *drive, u8 command)
 {
@@ -606,7 +651,9 @@
 	return result;
 }
 
-/* Calculate PIO timings */
+/*
+ * Old tuning functions (called on hdparm -p), sets up drive PIO timings
+ */
 static void __pmac
 pmac_ide_tuneproc(ide_drive_t *drive, u8 pio)
 {
@@ -625,7 +672,8 @@
 	pio = ide_get_best_pio_mode(drive, pio, 4, &d);
 
 	switch (pmif->kind) {
-	case controller_un_ata6: {
+	case controller_un_ata6:
+	case controller_k2_ata6: {
 		/* 100Mhz cell */
 		u32 tr = kauai_lookup_timing(kauai_pio_timings, d.cycle_time);
 		if (tr == 0)
@@ -685,6 +733,10 @@
 }
 
 #ifdef CONFIG_BLK_DEV_IDEDMA_PMAC
+
+/*
+ * Calculate KeyLargo ATA/66 UDMA timings
+ */
 static int __pmac
 set_timings_udma_ata4(u32 *timings, u8 speed)
 {
@@ -710,6 +762,9 @@
 	return 0;
 }
 
+/*
+ * Calculate Kauai ATA/100 UDMA timings
+ */
 static int __pmac
 set_timings_udma_ata6(u32 *pio_timings, u32 *ultra_timings, u8 speed)
 {
@@ -727,6 +782,9 @@
 	return 0;
 }
 
+/*
+ * Calculate MDMA timings for all cells
+ */
 static int __pmac
 set_timings_mdma(ide_drive_t *drive, int intf_type, u32 *timings, u32 *timings2,
 			u8 speed, int drive_cycle_time)
@@ -753,6 +811,7 @@
 	/* Get the proper timing array for this controller */
 	switch(intf_type) {
 		case controller_un_ata6:
+		case controller_k2_ata6:
 			break;
 		case controller_kl_ata4:
 			tm = mdma_timings_66;
@@ -784,7 +843,8 @@
 #endif
 	}
 	switch(intf_type) {
-	case controller_un_ata6: {
+	case controller_un_ata6:
+	case controller_k2_ata6: {
 		/* 100Mhz cell */
 		u32 tr = kauai_lookup_timing(kauai_mdma_timings, cycleTime);
 		if (tr == 0)
@@ -854,8 +914,12 @@
 }
 #endif /* #ifdef CONFIG_BLK_DEV_IDEDMA_PMAC */
 
-/* You may notice we don't use this function on normal operation,
- * our, normal mdma function is supposed to be more precise
+/* 
+ * Speedproc. This function is called by the core to set any of the standard
+ * timing (PIO, MDMA or UDMA) to both the drive and the controller.
+ * You may notice we don't use this function on normal "dma check" operation,
+ * our dedicated function is more precise as it uses the drive provided
+ * cycle time value. We should probably fix this one to deal with that too...
  */
 static int __pmac
 pmac_ide_tune_chipset (ide_drive_t *drive, byte speed)
@@ -874,7 +938,8 @@
 	switch(speed) {
 #ifdef CONFIG_BLK_DEV_IDEDMA_PMAC
 		case XFER_UDMA_5:
-			if (pmif->kind != controller_un_ata6)
+			if (pmif->kind != controller_un_ata6 &&
+			    pmif->kind != controller_k2_ata6)
 				return 1;
 		case XFER_UDMA_4:
 		case XFER_UDMA_3:
@@ -885,7 +950,8 @@
 		case XFER_UDMA_0:
 			if (pmif->kind == controller_kl_ata4)
 				ret = set_timings_udma_ata4(timings, speed);
-			else if (pmif->kind == controller_un_ata6)
+			else if (pmif->kind == controller_un_ata6
+				 || pmif->kind == controller_k2_ata6)
 				ret = set_timings_udma_ata6(timings, timings2, speed);
 			else
 				ret = 1;		
@@ -923,6 +989,10 @@
 	return 0;
 }
 
+/*
+ * Blast some well known "safe" values to the timing registers at init or
+ * wakeup from sleep time, before we do real calculation
+ */
 static void __pmac
 sanitize_timings(pmac_ide_hwif_t *pmif)
 {
@@ -930,6 +1000,7 @@
 	
 	switch(pmif->kind) {
 		case controller_un_ata6:
+		case controller_k2_ata6:
 			value = 0x08618a92;
 			value2 = 0x00002921;
 			break;
@@ -1052,9 +1123,11 @@
 	if (!pmif->mediabay) {
 		ppc_md.feature_call(PMAC_FTR_IDE_RESET, pmif->node, pmif->aapl_bus_id, 1);
 		ppc_md.feature_call(PMAC_FTR_IDE_ENABLE, pmif->node, pmif->aapl_bus_id, 1);
-		mdelay(10);
+		set_current_state(TASK_UNINTERRUPTIBLE);
+		schedule_timeout(HZ/100);
 		ppc_md.feature_call(PMAC_FTR_IDE_RESET, pmif->node, pmif->aapl_bus_id, 0);
-		mdelay(100);
+		set_current_state(TASK_UNINTERRUPTIBLE);
+		schedule_timeout(IDE_WAKEUP_DELAY);
 	}
 
 	/* Sanitize drive timings */
@@ -1063,6 +1136,13 @@
 	return 0;
 }
 
+/*
+ * Setup, register & probe an IDE channel driven by this driver, this is
+ * called by one of the 2 probe functions (macio or PCI). Note that a channel
+ * that ends up beeing free of any device is not kept around by this driver
+ * (it is kept in 2.4). This introduce an interface numbering change on some
+ * rare machines unfortunately, but it's better this way.
+ */
 static int
 pmac_ide_setup_device(pmac_ide_hwif_t *pmif, ide_hwif_t *hwif)
 {
@@ -1073,6 +1153,8 @@
 	pmif->broken_dma = pmif->broken_dma_warn = 0;
 	if (device_is_compatible(np, "kauai-ata"))
 		pmif->kind = controller_un_ata6;
+	else if (device_is_compatible(np, "K2-UATA"))
+		pmif->kind = controller_k2_ata6;
 	else if (device_is_compatible(np, "keylargo-ata")) {
 		if (strcmp(np->name, "ata-4") == 0)
 			pmif->kind = controller_kl_ata4;
@@ -1089,7 +1171,8 @@
 	pmif->aapl_bus_id =  bidp ? *bidp : 0;
 
 	/* Get cable type from device-tree */
-	if (pmif->kind == controller_kl_ata4 || pmif->kind == controller_un_ata6) {
+	if (pmif->kind == controller_kl_ata4 || pmif->kind == controller_un_ata6
+	    || pmif->kind == controller_k2_ata6) {
 		char* cable = get_property(np, "cable-type", NULL);
 		if (cable && !strncmp(cable, "80-", 3))
 			pmif->cable_80 = 1;
@@ -1119,13 +1202,16 @@
  		/* This is necessary to enable IDE when net-booting */
 		ppc_md.feature_call(PMAC_FTR_IDE_RESET, np, pmif->aapl_bus_id, 1);
 		ppc_md.feature_call(PMAC_FTR_IDE_ENABLE, np, pmif->aapl_bus_id, 1);
-		mdelay(10);
+		set_current_state(TASK_UNINTERRUPTIBLE);
+		schedule_timeout(HZ/100);
 		ppc_md.feature_call(PMAC_FTR_IDE_RESET, np, pmif->aapl_bus_id, 0);
-		mdelay(100);
+		set_current_state(TASK_UNINTERRUPTIBLE);
+		schedule_timeout(IDE_WAKEUP_DELAY);		
 	}
 
 	/* Setup MMIO ops */
 	default_hwif_mmiops(hwif);
+       	hwif->OUTBSYNC = pmac_outbsync;
 
 	/* Tell common code _not_ to mess with resources */
 	hwif->mmio = 2;
@@ -1139,7 +1225,7 @@
 	hwif->drives[0].unmask = 1;
 	hwif->drives[1].unmask = 1;
 	hwif->tuneproc = pmac_ide_tuneproc;
-	if (pmif->kind == controller_un_ata6)
+	if (pmif->kind == controller_un_ata6 || pmif->kind == controller_k2_ata6)
 		hwif->selectproc = pmac_ide_kauai_selectproc;
 	else
 		hwif->selectproc = pmac_ide_selectproc;
@@ -1187,6 +1273,9 @@
 	return 0;
 }
 
+/*
+ * Attach to a macio probed interface
+ */
 static int __devinit
 pmac_ide_macio_attach(struct macio_dev *mdev, const struct of_match *match)
 {
@@ -1215,17 +1304,8 @@
 		return -ENXIO;
 	}
 
-	/*
-	 * Some older OFs have bogus sizes, causing request_OF_resource
-	 * to fail. We fix them up here
-	 */
-	if (mdev->ofdev.node->addrs[0].size > 0x1000)
-		mdev->ofdev.node->addrs[0].size = 0x1000;
-	if (mdev->ofdev.node->n_addrs > 1 && mdev->ofdev.node->addrs[1].size > 0x100)
-		mdev->ofdev.node->addrs[1].size = 0x100;
-
 	/* Request memory resource for IO ports */
-	if (request_OF_resource(mdev->ofdev.node, 0, "  (mac-io ata ports)") == NULL) {
+	if (macio_request_resource(mdev, 0, "ide-pmac (ports)")) {
 		printk(KERN_ERR "ide%d: can't request mmio resource !\n", i);
 		return -EBUSY;
 	}
@@ -1235,14 +1315,14 @@
 	 * fixes in irq.c. That works well enough for the single case
 	 * where that happens though...
 	 */
-	if (mdev->ofdev.node->n_intrs == 0) {
+	if (macio_irq_count(mdev) == 0) {
 		printk(KERN_WARNING "ide%d: no intrs for device %s, using 13\n",
 			i, mdev->ofdev.node->full_name);
 		irq = 13;
 	} else
-		irq = mdev->ofdev.node->intrs[0].line;
+		irq = macio_irq(mdev, 0);
 
-	base =  (unsigned long) ioremap(mdev->ofdev.node->addrs[0].address, 0x400);
+	base =  (unsigned long)ioremap(macio_resource_start(mdev, 0), 0x400);
 	regbase = base;
 
 	hwif->pci_dev = mdev->bus->pdev;
@@ -1253,10 +1333,13 @@
 	pmif->regbase = regbase;
 	pmif->irq = irq;
 #ifdef CONFIG_BLK_DEV_IDEDMA_PMAC
-	if (mdev->ofdev.node->n_addrs >= 2)
-		pmif->dma_regs = (volatile struct dbdma_regs*)
-			ioremap(mdev->ofdev.node->addrs[1].address, 0x1000);
-	else
+	if (macio_resource_count(mdev) >= 2) {
+		if (macio_request_resource(mdev, 1, "ide-pmac (dma)"))
+			printk(KERN_WARNING "ide%d: can't request DMA resource !\n", i);
+		else
+			pmif->dma_regs = (volatile struct dbdma_regs*)
+				ioremap(macio_resource_start(mdev, 1), 0x1000);
+	} else
 		pmif->dma_regs = NULL;
 #endif /* CONFIG_BLK_DEV_IDEDMA_PMAC */
 	dev_set_drvdata(&mdev->ofdev.dev, hwif);
@@ -1269,7 +1352,9 @@
 		if (pmif->dma_regs)
 			iounmap((void *)pmif->dma_regs);
 		memset(pmif, 0, sizeof(*pmif));
-		release_OF_resource(mdev->ofdev.node, 0);
+		macio_release_resource(mdev, 0);
+		if (pmif->dma_regs)
+			macio_release_resource(mdev, 1);
 	}
 
 	return rc;
@@ -1305,6 +1390,9 @@
 	return rc;
 }
 
+/*
+ * Attach to a PCI probed interface
+ */
 static int __devinit
 pmac_ide_pci_attach(struct pci_dev *pdev, const struct pci_device_id *id)
 {
@@ -1439,8 +1527,10 @@
 	.resume		= pmac_ide_macio_resume,
 };
 
-static struct pci_device_id pmac_ide_pci_match[] __devinitdata = {
-	{ PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_KAUAI_ATA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
+static struct pci_device_id pmac_ide_pci_match[] = {
+	{ PCI_VENDOR_ID_APPLE, PCI_DEVIEC_ID_APPLE_UNI_N_ATA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
+	{ PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_IPID_ATA100, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
+	{ PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_K2_ATA100, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
 };
 
 static struct pci_driver pmac_ide_pci_driver = {
@@ -1468,6 +1558,11 @@
 
 #ifdef CONFIG_BLK_DEV_IDEDMA_PMAC
 
+/*
+ * This is very close to the generic ide-dma version of the function except
+ * that we don't use the fields in the hwif but our own copies for sg_table
+ * and friends. We build & map the sglist for a given request
+ */
 static int __pmac
 pmac_ide_build_sglist(ide_drive_t *drive, struct request *rq)
 {
@@ -1489,6 +1584,9 @@
 	return pci_map_sg(hwif->pci_dev, sg, nents, pmif->sg_dma_direction);
 }
 
+/*
+ * Same as above but for a "raw" taskfile request
+ */
 static int __pmac
 pmac_ide_raw_build_sglist(ide_drive_t *drive, struct request *rq)
 {
@@ -1630,7 +1728,9 @@
 	}
 }
 
-/* Calculate MultiWord DMA timings */
+/*
+ * Pick up best MDMA timing for the drive and apply it
+ */
 static int __pmac
 pmac_ide_mdma_enable(ide_drive_t *drive, u16 mode)
 {
@@ -1685,7 +1785,9 @@
 	return 1;
 }
 
-/* Calculate Ultra DMA timings */
+/*
+ * Pick up best UDMA timing for the drive and apply it
+ */
 static int __pmac
 pmac_ide_udma_enable(ide_drive_t *drive, u16 mode)
 {
@@ -1704,7 +1806,7 @@
 	timing_local[1] = *timings2;
 	
 	/* Calculate timings for interface */
-	if (pmif->kind == controller_un_ata6)
+	if (pmif->kind == controller_un_ata6 || pmif->kind == controller_k2_ata6)
 		ret = set_timings_udma_ata6(	&timing_local[0],
 						&timing_local[1],
 						mode);
@@ -1733,6 +1835,10 @@
 	return 1;
 }
 
+/*
+ * Check what is the best DMA timing setting for the drive and
+ * call appropriate functions to apply it.
+ */
 static int __pmac
 pmac_ide_dma_check(ide_drive_t *drive)
 {
@@ -1754,11 +1860,13 @@
 		short mode;
 		
 		map = XFER_MWDMA;
-		if (pmif->kind == controller_kl_ata4 || pmif->kind == controller_un_ata6) {
+		if (pmif->kind == controller_kl_ata4 || pmif->kind == controller_un_ata6
+		    || pmif->kind == controller_k2_ata6) {
 			map |= XFER_UDMA;
 			if (pmif->cable_80) {
 				map |= XFER_UDMA_66;
-				if (pmif->kind == controller_un_ata6)
+				if (pmif->kind == controller_un_ata6 ||
+				    pmif->kind == controller_k2_ata6)
 					map |= XFER_UDMA_100;
 			}
 		}
@@ -1774,6 +1882,10 @@
 	return 0;
 }
 
+/*
+ * Prepare a DMA transfer. We build the DMA table, adjust the timings for
+ * a read on KeyLargo ATA/66 and mark us as waiting for DMA completion
+ */
 static int __pmac
 pmac_ide_dma_start(ide_drive_t *drive, int reading)
 {
@@ -1802,6 +1914,9 @@
 	return 0;
 }
 
+/*
+ * Start a DMA READ command
+ */
 static int __pmac
 pmac_ide_dma_read(ide_drive_t *drive)
 {
@@ -1831,6 +1946,9 @@
 	return pmac_ide_dma_begin(drive);
 }
 
+/*
+ * Start a DMA WRITE command
+ */
 static int __pmac
 pmac_ide_dma_write (ide_drive_t *drive)
 {
@@ -1865,6 +1983,10 @@
 	return HWIF(drive)->ide_dma_begin(drive);
 }
 
+/*
+ * Kick the DMA controller into life after the DMA command has been issued
+ * to the drive.
+ */
 static int __pmac
 pmac_ide_dma_begin (ide_drive_t *drive)
 {
@@ -1881,6 +2003,9 @@
 	return 0;
 }
 
+/*
+ * After a DMA transfer, make sure the controller is stopped
+ */
 static int __pmac
 pmac_ide_dma_end (ide_drive_t *drive)
 {
@@ -1900,6 +2025,12 @@
 	return (dstat & (RUN|DEAD|ACTIVE)) != RUN;
 }
 
+/*
+ * Check out that the interrupt we got was for us. We can't always know this
+ * for sure with those Apple interfaces (well, we could on the recent ones but
+ * that's not implemented yet), on the other hand, we don't have shared interrupts
+ * so it's not really a problem
+ */
 static int __pmac
 pmac_ide_dma_test_irq (ide_drive_t *drive)
 {
@@ -1982,6 +2113,10 @@
 	return 0;
 }
 
+/*
+ * Allocate the data structures needed for using DMA with an interface
+ * and fill the proper list of functions pointers
+ */
 static void __init 
 pmac_ide_setup_dma(pmac_ide_hwif_t *pmif, ide_hwif_t *hwif)
 {
@@ -2049,6 +2184,7 @@
 	hwif->atapi_dma = 1;
 	switch(pmif->kind) {
 		case controller_un_ata6:
+		case controller_k2_ata6:
 			hwif->ultra_mask = pmif->cable_80 ? 0x3f : 0x07;
 			hwif->mwdma_mask = 0x07;
 			hwif->swdma_mask = 0x00;
--- diff/drivers/ieee1394/eth1394.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/ieee1394/eth1394.c	2004-02-09 10:39:52.000000000 +0000
@@ -395,8 +395,8 @@
 	}
 }
 
-/* This function is called by register_netdev */
-static int ether1394_init_dev (struct net_device *dev)
+/* This function is called right before register_netdev */
+static void ether1394_init_dev (struct net_device *dev)
 {
 	/* Our functions */
 	dev->open		= ether1394_open;
@@ -423,8 +423,6 @@
 	dev->type		= ARPHRD_IEEE1394;
 
 	ether1394_reset_priv (dev, 1);
-
-	return 0;
 }
 
 /*
@@ -461,8 +459,6 @@
 
 	SET_MODULE_OWNER(dev);
 
-	dev->init = ether1394_init_dev;
-
 	priv = (struct eth1394_priv *)dev->priv;
 
 	spin_lock_init(&priv->lock);
@@ -483,6 +479,8 @@
 		goto out;
         }
 
+	ether1394_init_dev(dev);
+
 	if (register_netdev (dev)) {
 		ETH1394_PRINT (KERN_ERR, dev->name, "Error registering network driver\n");
 		goto out;
@@ -507,7 +505,7 @@
 
 out:
 	if (dev != NULL)
-		kfree(dev);
+		free_netdev(dev);
 	if (hi)
 		hpsb_destroy_hostinfo(&eth1394_highlevel, host);
 
--- diff/drivers/ieee1394/highlevel.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/ieee1394/highlevel.c	2004-02-09 10:39:52.000000000 +0000
@@ -521,7 +521,7 @@
                                 rcode = RCODE_TYPE_ERROR;
                         }
 
-			(u8 *)data += partlength;
+			data += partlength;
                         length -= partlength;
                         addr += partlength;
 
@@ -567,7 +567,7 @@
                                 rcode = RCODE_TYPE_ERROR;
                         }
 
-			(u8 *)data += partlength;
+			data += partlength;
                         length -= partlength;
                         addr += partlength;
 
--- diff/drivers/input/evdev.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/input/evdev.c	2004-02-09 10:39:52.000000000 +0000
@@ -232,7 +232,7 @@
 			if (t < 0 || t > dev->keycodemax || !dev->keycodesize) return -EINVAL;
 			if (get_user(v, ((int *) arg) + 1)) return -EFAULT;
 			u = INPUT_KEYCODE(dev, t);
-			INPUT_KEYCODE(dev, t) = v;
+			SET_INPUT_KEYCODE(dev, t, v);
 			for (i = 0; i < dev->keycodemax; i++) if (v == u) break;
 			if (i == dev->keycodemax) clear_bit(u, dev->keybit);
 			set_bit(v, dev->keybit);
--- diff/drivers/input/gameport/ns558.c	2003-08-26 10:00:52.000000000 +0100
+++ source/drivers/input/gameport/ns558.c	2004-02-09 10:39:52.000000000 +0000
@@ -77,7 +77,7 @@
  * No one should be using this address.
  */
 
-	if (check_region(io, 1))
+	if (!request_region(io, 1, "ns558-isa"))
 		return;
 
 /*
@@ -89,7 +89,8 @@
 	outb(~c & ~3, io);
 	if (~(u = v = inb(io)) & 3) {
 		outb(c, io);
-		return;
+		i = 0;
+		goto out;
 	}
 /*
  * After a trigger, there must be at least some bits changing.
@@ -99,7 +100,8 @@
 
 	if (u == v) {
 		outb(c, io);
-		return;
+		i = 0;
+		goto out;
 	}
 	wait_ms(3);
 /*
@@ -110,7 +112,8 @@
 	for (i = 0; i < 1000; i++)
 		if ((u ^ inb(io)) & 0xf) {
 			outb(c, io);
-			return;
+			i = 0;
+			goto out;
 		}
 /* 
  * And now find the number of mirrors of the port.
@@ -118,7 +121,9 @@
 
 	for (i = 1; i < 5; i++) {
 
-		if (check_region(io & (-1 << i), (1 << i)))	/* Don't disturb anyone */
+		release_region(io & (-1 << (i-1)), (1 << (i-1)));
+
+		if (!request_region(io & (-1 << i), (1 << i), "ns558-isa"))	/* Don't disturb anyone */
 			break;
 
 		outb(0xff, io & (-1 << i));
@@ -126,18 +131,25 @@
 			if (inb(io & (-1 << i)) != inb((io & (-1 << i)) + (1 << i) - 1)) b++;
 		wait_ms(3);
 
-		if (b > 300)					/* We allow 30% difference */
+		if (b > 300) {					/* We allow 30% difference */
+			release_region(io & (-1 << i), (1 << i));
 			break;
+		}
 	}
 
 	i--;
 
+	if (i != 4) {
+		if (!request_region(io & (-1 << i), (1 << i), "ns558-isa"))
+			return;
+	}
+
 	if (!(port = kmalloc(sizeof(struct ns558), GFP_KERNEL))) {
 		printk(KERN_ERR "ns558: Memory allocation failed.\n");
-		return;
+		goto out;
 	}
-       	memset(port, 0, sizeof(struct ns558));
-	
+	memset(port, 0, sizeof(struct ns558));
+
 	port->type = NS558_ISA;
 	port->size = (1 << i);
 	port->gameport.io = io;
@@ -148,8 +160,6 @@
 	sprintf(port->phys, "isa%04x/gameport0", io & (-1 << i));
 	sprintf(port->name, "NS558 ISA");
 
-	request_region(io & (-1 << i), (1 << i), "ns558-isa");
-
 	gameport_register_port(&port->gameport);
 
 	printk(KERN_INFO "gameport: NS558 ISA at %#x", port->gameport.io);
@@ -157,6 +167,9 @@
 	printk(" speed %d kHz\n", port->gameport.speed);
 
 	list_add(&port->node, &ns558_list);
+	return;
+out:
+	release_region(io & (-1 << i), (1 << i));
 }
 
 #ifdef CONFIG_PNP
--- diff/drivers/input/joystick/db9.c	2003-09-30 15:46:14.000000000 +0100
+++ source/drivers/input/joystick/db9.c	2004-02-09 10:39:52.000000000 +0000
@@ -531,9 +531,7 @@
 		return NULL;
 	}
 
-	for (pp = parport_enumerate(); pp && (config[0] > 0); pp = pp->next)
-		config[0]--;
-
+	pp = parport_find_number(config[0]);
 	if (!pp) {
 		printk(KERN_ERR "db9.c: no such parport\n");
 		return NULL;
@@ -542,12 +540,15 @@
 	if (db9_bidirectional[config[1]]) {
 		if (!(pp->modes & PARPORT_MODE_TRISTATE)) {
 			printk(KERN_ERR "db9.c: specified parport is not bidirectional\n");
+			parport_put_port(pp);
 			return NULL;
 		}
 	}
 
-	if (!(db9 = kmalloc(sizeof(struct db9), GFP_KERNEL)))
+	if (!(db9 = kmalloc(sizeof(struct db9), GFP_KERNEL))) {
+		parport_put_port(pp);
 		return NULL;
+	}
 	memset(db9, 0, sizeof(struct db9));
 
 	db9->mode = config[1];
@@ -556,6 +557,7 @@
 	db9->timer.function = db9_timer;
 
 	db9->pd = parport_register_device(pp, "db9", NULL, NULL, NULL, PARPORT_DEV_EXCL, NULL);
+	parport_put_port(pp);
 
 	if (!db9->pd) {
 		printk(KERN_ERR "db9.c: parport busy already - lp.o loaded?\n");
--- diff/drivers/input/joystick/gamecon.c	2003-06-30 10:07:33.000000000 +0100
+++ source/drivers/input/joystick/gamecon.c	2004-02-09 10:39:52.000000000 +0000
@@ -478,20 +478,23 @@
 	if (config[0] < 0)
 		return NULL;
 
-	for (pp = parport_enumerate(); pp && (config[0] > 0); pp = pp->next)
-		config[0]--;
+	pp = parport_find_number(config[0]);
 
 	if (!pp) {
 		printk(KERN_ERR "gamecon.c: no such parport\n");
 		return NULL;
 	}
 
-	if (!(gc = kmalloc(sizeof(struct gc), GFP_KERNEL)))
+	if (!(gc = kmalloc(sizeof(struct gc), GFP_KERNEL))) {
+		parport_put_port(pp);
 		return NULL;
+	}
 	memset(gc, 0, sizeof(struct gc));
 
 	gc->pd = parport_register_device(pp, "gamecon", NULL, NULL, NULL, PARPORT_DEV_EXCL, NULL);
 
+	parport_put_port(pp);
+
 	if (!gc->pd) {
 		printk(KERN_ERR "gamecon.c: parport busy already - lp.o loaded?\n");
 		kfree(gc);
--- diff/drivers/input/joystick/turbografx.c	2002-10-16 04:28:33.000000000 +0100
+++ source/drivers/input/joystick/turbografx.c	2004-02-09 10:39:52.000000000 +0000
@@ -142,19 +142,22 @@
 	if (config[0] < 0)
 		return NULL;
 
-	for (pp = parport_enumerate(); pp && (config[0] > 0); pp = pp->next)
-		config[0]--;
+	pp = parport_find_number(config[0]);
 
 	if (!pp) {
 		printk(KERN_ERR "turbografx.c: no such parport\n");
 		return NULL;
 	}
 
-	if (!(tgfx = kmalloc(sizeof(struct tgfx), GFP_KERNEL)))
+	if (!(tgfx = kmalloc(sizeof(struct tgfx), GFP_KERNEL))) {
+		parport_put_port(pp);
 		return NULL;
+	}
 	memset(tgfx, 0, sizeof(struct tgfx));
 
 	tgfx->pd = parport_register_device(pp, "turbografx", NULL, NULL, NULL, PARPORT_DEV_EXCL, NULL);
+		
+	parport_put_port(pp);
 
 	if (!tgfx->pd) {
 		printk(KERN_ERR "turbografx.c: parport busy already - lp.o loaded?\n");
--- diff/drivers/input/keyboard/Kconfig	2003-10-09 09:47:34.000000000 +0100
+++ source/drivers/input/keyboard/Kconfig	2004-02-09 10:39:52.000000000 +0000
@@ -17,6 +17,7 @@
 	depends on INPUT && INPUT_KEYBOARD
 	select SERIO
 	select SERIO_I8042 if PC
+	select SERIO_GSCPS2 if GSC
 	help
 	  Say Y here if you want to use a standard AT or PS/2 keyboard. Usually
 	  you'll need this, unless you have a different type keyboard (USB, ADB
--- diff/drivers/input/keyboard/atkbd.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/input/keyboard/atkbd.c	2004-02-09 10:39:52.000000000 +0000
@@ -37,14 +37,13 @@
 
 static int atkbd_set = 2;
 module_param_named(set, atkbd_set, int, 0);
-MODULE_PARM_DESC(set, "Select keyboard code set (2 = default, 3, 4)");
+MODULE_PARM_DESC(set, "Select keyboard code set (2 = default, 3 = PS/2 native)");
+
 #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");
 
@@ -52,6 +51,14 @@
 module_param_named(softrepeat, atkbd_softrepeat, bool, 0);
 MODULE_PARM_DESC(softrepeat, "Use software keyboard repeat");
 
+static int atkbd_scroll;
+module_param_named(scroll, atkbd_scroll, bool, 0);
+MODULE_PARM_DESC(scroll, "Enable scroll-wheel on MS Office and similar keyboards");
+
+static int atkbd_extra;
+module_param_named(extra, atkbd_extra, bool, 0);
+MODULE_PARM_DESC(extra, "Enable extra LEDs and keys on IBM RapidAcces, EzKey and similar keyboards");
+
 /*
  * Scancode to keycode tables. These are just the default setting, and
  * are loadable via an userland utility.
@@ -127,11 +134,11 @@
 #define ATKBD_CMD_EX_SETLEDS	0x20eb
 #define ATKBD_CMD_OK_GETID	0x02e8
 
+
 #define ATKBD_RET_ACK		0xfa
 #define ATKBD_RET_NAK		0xfe
 #define ATKBD_RET_BAT		0xaa
 #define ATKBD_RET_EMUL0		0xe0
-#define ATKBD_RET_EMULX		0x80
 #define ATKBD_RET_EMUL1		0xe1
 #define ATKBD_RET_RELEASE	0xf0
 #define ATKBD_RET_HANGUEL	0xf1
@@ -141,6 +148,22 @@
 #define ATKBD_KEY_UNKNOWN	  0
 #define ATKBD_KEY_NULL		255
 
+#define ATKBD_SCR_1		254
+#define ATKBD_SCR_2		253
+#define ATKBD_SCR_4		252
+#define ATKBD_SCR_8		251
+#define ATKBD_SCR_CLICK		250
+
+#define ATKBD_SPECIAL		250
+
+static unsigned char atkbd_scroll_keys[5][2] = {
+	{ ATKBD_SCR_1,     0x45 },
+	{ ATKBD_SCR_2,     0x29 },
+	{ ATKBD_SCR_4,     0x36 },
+	{ ATKBD_SCR_8,     0x27 },
+	{ ATKBD_SCR_CLICK, 0x60 },
+};
+
 /*
  * The atkbd control structure
  */
@@ -155,6 +178,7 @@
 	unsigned char cmdbuf[4];
 	unsigned char cmdcnt;
 	unsigned char set;
+	unsigned char extra;
 	unsigned char release;
 	int lastkey;
 	volatile signed char ack;
@@ -189,6 +213,7 @@
 {
 	struct atkbd *atkbd = serio->private;
 	unsigned int code = data;
+	int scroll = 0, click = -1;
 	int value;
 
 #ifdef ATKBD_DEBUG
@@ -284,6 +309,21 @@
 			else
 				printk(KERN_WARNING "atkbd.c: Use 'setkeycodes %s%02x <keycode>' to make it known.\n",						code & 0x80 ? "e0" : "", code & 0x7f);
 			break;
+		case ATKBD_SCR_1:
+			scroll = 1 - atkbd->release * 2;
+			break;
+		case ATKBD_SCR_2:
+			scroll = 2 - atkbd->release * 4;
+			break;
+		case ATKBD_SCR_4:
+			scroll = 4 - atkbd->release * 8;
+			break;
+		case ATKBD_SCR_8:
+			scroll = 8 - atkbd->release * 16;
+			break;
+		case ATKBD_SCR_CLICK:
+			click = !atkbd->release;
+			break;
 		default:
 			value = atkbd->release ? 0 :
 				(1 + (!atkbd_softrepeat && test_bit(atkbd->keycode[code], atkbd->dev.key)));
@@ -305,6 +345,13 @@
 			atkbd_report_key(&atkbd->dev, regs, atkbd->keycode[code], value);
 	}
 
+	if (scroll || click != -1) {
+		input_regs(&atkbd->dev, regs);
+		input_report_key(&atkbd->dev, BTN_MIDDLE, click);
+		input_report_rel(&atkbd->dev, REL_WHEEL, scroll);
+		input_sync(&atkbd->dev);
+	}
+
 	atkbd->release = 0;
 out:
 	return IRQ_HANDLED;
@@ -420,7 +467,7 @@
 			         | (test_bit(LED_CAPSL,   dev->led) ? 4 : 0);
 		        atkbd_command(atkbd, param, ATKBD_CMD_SETLEDS);
 
-			if (atkbd->set == 4) {
+			if (atkbd->extra) {
 				param[0] = 0;
 				param[1] = (test_bit(LED_COMPOSE, dev->led) ? 0x01 : 0)
 					 | (test_bit(LED_SLEEP,   dev->led) ? 0x02 : 0)
@@ -529,21 +576,22 @@
 		return 3;
 	}
 
-	if (atkbd_set != 2) 
-		if (!atkbd_command(atkbd, param, ATKBD_CMD_OK_GETID)) {
-			atkbd->id = param[0] << 8 | param[1];
+	if (atkbd_extra) {
+		param[0] = 0x71;
+		if (!atkbd_command(atkbd, param, ATKBD_CMD_EX_ENABLE)) {
+			atkbd->extra = 1;
 			return 2;
 		}
-
-	if (atkbd_set == 4) {
-		param[0] = 0x71;
-		if (!atkbd_command(atkbd, param, ATKBD_CMD_EX_ENABLE))
-			return 4;
 	}
 
 	if (atkbd_set != 3) 
 		return 2;
 
+	if (!atkbd_command(atkbd, param, ATKBD_CMD_OK_GETID)) {
+		atkbd->id = param[0] << 8 | param[1];
+		return 2;
+	}
+
 	param[0] = 3;
 	if (atkbd_command(atkbd, param, ATKBD_CMD_SSCANSET))
 		return 2;
@@ -696,24 +744,32 @@
 		atkbd->id = 0xab00;
 	}
 
-	if (atkbd->set == 4) {
+	if (atkbd->extra) {
 		atkbd->dev.ledbit[0] |= BIT(LED_COMPOSE) | BIT(LED_SUSPEND) | BIT(LED_SLEEP) | BIT(LED_MUTE) | BIT(LED_MISC);
-		sprintf(atkbd->name, "AT Set 2 Extended keyboard");
+		sprintf(atkbd->name, "AT Set 2 Extra keyboard");
 	} else
 		sprintf(atkbd->name, "AT %s Set %d keyboard",
 			atkbd->translated ? "Translated" : "Raw", atkbd->set);
 
 	sprintf(atkbd->phys, "%s/input0", serio->phys);
 
+	if (atkbd_scroll) {
+		for (i = 0; i < 5; i++)
+			atkbd_set2_keycode[atkbd_scroll_keys[i][1]] = atkbd_scroll_keys[i][0];
+		atkbd->dev.evbit[0] |= BIT(EV_REL);
+		atkbd->dev.relbit[0] = BIT(REL_WHEEL);
+		set_bit(BTN_MIDDLE, atkbd->dev.keybit);
+	}
+
 	if (atkbd->translated) {
 		for (i = 0; i < 128; i++) {
 			atkbd->keycode[i] = atkbd_set2_keycode[atkbd_unxlate_table[i]];
 			atkbd->keycode[i | 0x80] = atkbd_set2_keycode[atkbd_unxlate_table[i] | 0x80];
 		}
-	} else if (atkbd->set == 2) {
-		memcpy(atkbd->keycode, atkbd_set2_keycode, sizeof(atkbd->keycode));
-	} else {
+	} else if (atkbd->set == 3) {
 		memcpy(atkbd->keycode, atkbd_set3_keycode, sizeof(atkbd->keycode));
+	} else {
+		memcpy(atkbd->keycode, atkbd_set2_keycode, sizeof(atkbd->keycode));
 	}
 
 	atkbd->dev.name = atkbd->name;
@@ -724,7 +780,7 @@
 	atkbd->dev.id.version = atkbd->id;
 
 	for (i = 0; i < 512; i++)
-		if (atkbd->keycode[i] && atkbd->keycode[i] < 255)
+		if (atkbd->keycode[i] && atkbd->keycode[i] < ATKBD_SPECIAL)
 			set_bit(atkbd->keycode[i], atkbd->dev.keybit);
 
 	input_register_device(&atkbd->dev);
@@ -741,46 +797,20 @@
 {
 	struct atkbd *atkbd = serio->private;
 	struct serio_dev *dev = serio->dev;
-	int i;
 
-        if (!dev) {
-                printk(KERN_DEBUG "atkbd: reconnect request, but serio is disconnected, ignoring...\n");
-                return -1;
-        }
+	if (!dev) {
+		printk(KERN_DEBUG "atkbd: reconnect request, but serio is disconnected, ignoring...\n");
+		return -1;
+	}
 
 	if (atkbd->write) {
 		if (atkbd_probe(atkbd))
 			return -1;
-
-		atkbd->set = atkbd_set_3(atkbd);
+		if (atkbd->set != atkbd_set_3(atkbd))
+			return -1;
 		atkbd_enable(atkbd);
-	} else {
-		atkbd->set = 2;
-		atkbd->id = 0xab00;
-	}
-
-	/*
-	 * Here we probably should check if the keyboard has the same set that
-         * it had before and bail out if it's different. But this will most likely
-         * cause new keyboard device be created... and for the user it will look
-         * like keyboard is lost
-	 */
-
-	if (atkbd->translated) {
-		for (i = 0; i < 128; i++) {
-			atkbd->keycode[i] = atkbd_set2_keycode[atkbd_unxlate_table[i]];
-			atkbd->keycode[i | 0x80] = atkbd_set2_keycode[atkbd_unxlate_table[i] | 0x80];
-		}
-	} else if (atkbd->set == 2) {
-		memcpy(atkbd->keycode, atkbd_set2_keycode, sizeof(atkbd->keycode));
-	} else {
-		memcpy(atkbd->keycode, atkbd_set3_keycode, sizeof(atkbd->keycode));
 	}
 
-	for (i = 0; i < 512; i++)
-		if (atkbd->keycode[i] && atkbd->keycode[i] < 255)
-			set_bit(atkbd->keycode[i], atkbd->dev.keybit);
-
 	return 0;
 }
 
--- diff/drivers/input/keyboard/hpps2atkbd.h	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/input/keyboard/hpps2atkbd.h	2004-02-09 10:39:52.000000000 +0000
@@ -4,14 +4,9 @@
  * Copyright (c) 2004 Helge Deller <deller@gmx.de>
  * Copyright (c) 2002 Laurent Canet <canetl@esiee.fr>
  * Copyright (c) 2002 Thibaut Varene <varenet@esiee.fr>
+ * Copyright (c) 2000 Xavier Debacker <debackex@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
+ * HP PS/2 AT-compatible Keyboard, found in PA/RISC Workstations & Laptops
  *
  * 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,87 +14,100 @@
  */
 
 
-#define KBD_UNKNOWN 0
-
-/* Raw SET 2 scancode table */
+/* undefine if you have a RDI PRECISIONBOOK */
+#define STANDARD_KEYBOARD
 
-#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    */
+#if defined(STANDARD_KEYBOARD)
+# define CONFLICT(x,y) x
+#else
+# define CONFLICT(x,y) y
 #endif
 
+/* sadly RDI (Tadpole) decided to ship a different keyboard layout
+   than HP for their PS/2 laptop keyboard which leads to conflicting
+   keycodes between a normal HP PS/2 keyboard and a RDI Precisionbook.
+                                HP:		RDI:            */
+#define C_07	CONFLICT(	KEY_F12,	KEY_F1		)
+#define C_11	CONFLICT(	KEY_LEFTALT,	KEY_LEFTCTRL	)
+#define C_14	CONFLICT(	KEY_LEFTCTRL,	KEY_CAPSLOCK	)
+#define C_58	CONFLICT(	KEY_CAPSLOCK,	KEY_RIGHTCTRL	)
+#define C_61	CONFLICT(	KEY_102ND,	KEY_LEFT	)
 
-static unsigned char atkbd_set2_keycode[512] = {
+/* Raw SET 2 scancode table */
 
-	/* 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
+/* 00 */  KEY_RESERVED, KEY_F9,        KEY_RESERVED,  KEY_F5,        KEY_F3,        KEY_F1,       KEY_F2,        C_07,
+/* 08 */  KEY_ESC,      KEY_F10,       KEY_F8,        KEY_F6,        KEY_F4,        KEY_TAB,      KEY_GRAVE,     KEY_F2,
+/* 10 */  KEY_RESERVED, C_11,          KEY_LEFTSHIFT, KEY_RESERVED,  C_14,          KEY_Q,        KEY_1,         KEY_F3,
+/* 18 */  KEY_RESERVED, KEY_LEFTALT,   KEY_Z,         KEY_S,         KEY_A,         KEY_W,        KEY_2,         KEY_F4,
+/* 20 */  KEY_RESERVED, KEY_C,         KEY_X,         KEY_D,         KEY_E,         KEY_4,        KEY_3,         KEY_F5,
+/* 28 */  KEY_RESERVED, KEY_SPACE,     KEY_V,         KEY_F,         KEY_T,         KEY_R,        KEY_5,         KEY_F6,
+/* 30 */  KEY_RESERVED, KEY_N,         KEY_B,         KEY_H,         KEY_G,         KEY_Y,        KEY_6,         KEY_F7,
+/* 38 */  KEY_RESERVED, KEY_RIGHTALT,  KEY_M,         KEY_J,         KEY_U,         KEY_7,        KEY_8,         KEY_F8,
+/* 40 */  KEY_RESERVED, KEY_COMMA,     KEY_K,         KEY_I,         KEY_O,         KEY_0,        KEY_9,         KEY_F9,
+/* 48 */  KEY_RESERVED, KEY_DOT,       KEY_SLASH,     KEY_L,         KEY_SEMICOLON, KEY_P,        KEY_MINUS,     KEY_F10,
+/* 50 */  KEY_RESERVED, KEY_RESERVED,  KEY_APOSTROPHE,KEY_RESERVED,  KEY_LEFTBRACE, KEY_EQUAL,    KEY_F11,       KEY_SYSRQ,
+/* 58 */  C_58,         KEY_RIGHTSHIFT,KEY_ENTER,     KEY_RIGHTBRACE,KEY_BACKSLASH, KEY_BACKSLASH,KEY_F12,       KEY_SCROLLLOCK,
+/* 60 */  KEY_DOWN,     C_61,          KEY_PAUSE,     KEY_UP,        KEY_DELETE,    KEY_END,      KEY_BACKSPACE, KEY_INSERT,
+/* 68 */  KEY_RESERVED, 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 */  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,
+/* 88 */  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,
+/* 90 */  KEY_RESERVED, KEY_RIGHTALT,  KEY_SYSRQ,     KEY_RESERVED,  KEY_RIGHTCTRL, KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,
+/* 98 */  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_CAPSLOCK, KEY_RESERVED,  KEY_LEFTMETA,
+/* a0 */  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED, KEY_RESERVED,  KEY_RIGHTMETA,
+/* a8 */  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED, KEY_RESERVED,  KEY_COMPOSE,
+/* b0 */  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,
+/* b8 */  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,
+/* c0 */  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,
+/* c8 */  KEY_RESERVED, KEY_RESERVED,  KEY_KPSLASH,   KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,
+/* d0 */  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,
+/* d8 */  KEY_RESERVED, KEY_RESERVED,  KEY_KPENTER,   KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,
+/* e0 */  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,
+/* e8 */  KEY_RESERVED, KEY_END,       KEY_RESERVED,  KEY_LEFT,      KEY_HOME,      KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,
+/* f0 */  KEY_INSERT,   KEY_DELETE,    KEY_DOWN,      KEY_RESERVED,  KEY_RIGHT,     KEY_UP,       KEY_RESERVED,  KEY_PAUSE,
+/* f8 */  KEY_RESERVED, KEY_RESERVED,  KEY_PAGEDOWN,  KEY_RESERVED,  KEY_SYSRQ,     KEY_PAGEUP,   KEY_RESERVED,  KEY_RESERVED,
+
+/* These are offset for escaped keycodes: */
+
+/* 00 */  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,  KEY_F7,        KEY_RESERVED,  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,
+/* 08 */  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,  KEY_LEFTMETA,  KEY_RIGHTMETA, KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,
+/* 10 */  KEY_RESERVED, KEY_RIGHTALT,  KEY_RESERVED,  KEY_RESERVED,  KEY_RIGHTCTRL, KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,
+/* 18 */  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,
+/* 20 */  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,
+/* 28 */  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,
+/* 30 */  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,
+/* 38 */  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,
+/* 40 */  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,
+/* 48 */  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,
+/* 50 */  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,
+/* 58 */  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,
+/* 60 */  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,
+/* 68 */  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,
+/* 70 */  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,
+/* 78 */  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,
+/* 80 */  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,
+/* 88 */  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,
+/* 90 */  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,
+/* 98 */  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,
+/* a0 */  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,
+/* a8 */  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,
+/* b0 */  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,
+/* b8 */  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,
+/* c0 */  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,
+/* c8 */  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,
+/* d0 */  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,
+/* d8 */  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,
+/* e0 */  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,
+/* e8 */  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,
+/* f0 */  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,
+/* f8 */  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED
+
+#undef STANDARD_KEYBOARD
+#undef CONFLICT
+#undef C_07
+#undef C_11
+#undef C_14
+#undef C_58
+#undef C_61
 
-};
--- diff/drivers/input/keyboard/sunkbd.c	2003-08-20 14:16:09.000000000 +0100
+++ source/drivers/input/keyboard/sunkbd.c	2004-02-09 10:39:52.000000000 +0000
@@ -77,6 +77,7 @@
 	struct input_dev dev;
 	struct serio *serio;
 	struct work_struct tq;
+	wait_queue_head_t wait;
 	char name[64];
 	char phys[32];
 	char type;
@@ -96,11 +97,13 @@
 
 	if (sunkbd->reset <= -1) {		/* If cp[i] is 0xff, sunkbd->reset will stay -1. */
 		sunkbd->reset = data;		/* The keyboard sends 0xff 0xff 0xID on powerup */
+		wake_up_interruptible(&sunkbd->wait);
 		goto out;
 	}
 
 	if (sunkbd->layout == -1) {
 		sunkbd->layout = data;
+		wake_up_interruptible(&sunkbd->wait);
 		goto out;
 	}
 
@@ -176,22 +179,19 @@
 
 static int sunkbd_initialize(struct sunkbd *sunkbd)
 {
-	int t;
-
-	t = 1000;
 	sunkbd->reset = -2;
 	sunkbd->serio->write(sunkbd->serio, SUNKBD_CMD_RESET);
-	while (sunkbd->reset < 0 && --t) mdelay(1);
-	if (!t) return -1;
+	wait_event_interruptible_timeout(sunkbd->wait, sunkbd->reset >= 0, HZ);
+	if (sunkbd->reset <0)
+		return -1;
 
 	sunkbd->type = sunkbd->reset;
 
 	if (sunkbd->type == 4) {	/* Type 4 keyboard */
-		t = 250;
 		sunkbd->layout = -2;
 		sunkbd->serio->write(sunkbd->serio, SUNKBD_CMD_LAYOUT);
-		while (sunkbd->layout < 0 && --t) mdelay(1);
-		if (!t) return -1;
+		wait_event_interruptible_timeout(sunkbd->wait, sunkbd->layout >= 0, HZ/4);
+		if (sunkbd->layout < 0) return -1;
 		if (sunkbd->layout & SUNKBD_LAYOUT_5_MASK) sunkbd->type = 5;
 	}
 
@@ -206,9 +206,8 @@
 static void sunkbd_reinit(void *data)
 {
 	struct sunkbd *sunkbd = data;
-	int t = 1000;
 
-	while (sunkbd->reset < 0 && --t) mdelay(1);
+	wait_event_interruptible_timeout(sunkbd->wait, sunkbd->reset >= 0, HZ);
 
 	sunkbd->serio->write(sunkbd->serio, SUNKBD_CMD_SETLED);
 	sunkbd->serio->write(sunkbd->serio, 
@@ -239,6 +238,7 @@
 	memset(sunkbd, 0, sizeof(struct sunkbd));
 
 	init_input_dev(&sunkbd->dev);
+	init_waitqueue_head(&sunkbd->wait);
 
 	sunkbd->dev.evbit[0] = BIT(EV_KEY) | BIT(EV_LED) | BIT(EV_SND) | BIT(EV_REP);
 	sunkbd->dev.ledbit[0] = BIT(LED_CAPSL) | BIT(LED_COMPOSE) | BIT(LED_SCROLLL) | BIT(LED_NUML);
@@ -275,7 +275,7 @@
 		set_bit(sunkbd->keycode[i], sunkbd->dev.keybit);
 	clear_bit(0, sunkbd->dev.keybit);
 
-	sprintf(sunkbd->name, "%s/input", serio->phys);
+	sprintf(sunkbd->phys, "%s/input0", serio->phys);
 
 	sunkbd->dev.name = sunkbd->name;
 	sunkbd->dev.phys = sunkbd->phys;
--- diff/drivers/input/misc/Kconfig	2003-09-30 15:46:14.000000000 +0100
+++ source/drivers/input/misc/Kconfig	2004-02-09 10:39:52.000000000 +0000
@@ -54,12 +54,3 @@
 	  To compile this driver as a module, choose M here: the
 	  module will be called uinput.
 
-config INPUT_GSC
-	tristate "PA-RISC GSC PS/2 keyboard/mouse support"
-	depends on GSC && INPUT && INPUT_MISC
-	help
-	  Say Y here if you have a PS/2 keyboard and/or mouse attached
-	  to your PA-RISC box.	HP run the keyboard in AT mode rather than
-	  XT mode like everyone else, so we need our own driver.
-	  Furthermore, the GSC PS/2 controller shares IRQ between mouse and
-	  keyboard.
--- diff/drivers/input/misc/Makefile	2003-02-26 16:00:54.000000000 +0000
+++ source/drivers/input/misc/Makefile	2004-02-09 10:39:52.000000000 +0000
@@ -9,4 +9,3 @@
 obj-$(CONFIG_INPUT_M68K_BEEP)		+= m68kspkr.o
 obj-$(CONFIG_INPUT_98SPKR)		+= 98spkr.o
 obj-$(CONFIG_INPUT_UINPUT)		+= uinput.o
-obj-$(CONFIG_INPUT_GSC)			+= gsc_ps2.o
--- diff/drivers/input/mouse/Kconfig	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/input/mouse/Kconfig	2004-02-09 10:39:52.000000000 +0000
@@ -17,6 +17,7 @@
 	depends on INPUT && INPUT_MOUSE
 	select SERIO
 	select SERIO_I8042 if PC
+	select SERIO_GSCPS2 if GSC
 	---help---
 	  Say Y here if you have a PS/2 mouse connected to your system. This
 	  includes the standard 2 or 3-button PS/2 mouse, as well as PS/2
--- diff/drivers/input/mouse/psmouse-base.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/input/mouse/psmouse-base.c	2004-02-09 10:39:52.000000000 +0000
@@ -134,6 +134,13 @@
 		goto out;
 	}
 
+	if (flags & (SERIO_PARITY|SERIO_TIMEOUT)) {
+		printk(KERN_WARNING "psmouse.c: bad data from KBC -%s%s\n",
+			flags & SERIO_TIMEOUT ? " timeout" : "",
+			flags & SERIO_PARITY ? " bad parity" : "");
+		goto out;
+	}
+
 	if (psmouse->acking) {
 		switch (data) {
 			case PSMOUSE_RET_ACK:
--- diff/drivers/input/serio/Kconfig	2003-09-30 15:46:14.000000000 +0100
+++ source/drivers/input/serio/Kconfig	2004-02-09 10:39:52.000000000 +0000
@@ -20,6 +20,7 @@
 	tristate "i8042 PC Keyboard controller" if EMBEDDED || !X86
 	default y
 	select SERIO
+	depends on !PARISC
 	---help---
 	  i8042 is the chip over which the standard AT keyboard and PS/2
 	  mouse are connected to the computer. If you use these devices,
@@ -48,6 +49,7 @@
 config SERIO_CT82C710
 	tristate "ct82c710 Aux port controller"
 	depends on SERIO
+	depends on !PARISC
 	---help---
 	  Say Y here if you have a Texas Instruments TravelMate notebook
 	  equipped with the ct82c710 chip and want to use a mouse connected
@@ -105,6 +107,20 @@
 	  To compile this driver as a module, choose M here: the
 	  module will be called 98kbd-io.
 
+config SERIO_GSCPS2
+	tristate "HP GSC PS/2 keyboard and PS/2 mouse controller"
+	depends on GSC && SERIO
+	default y
+	help
+	  This driver provides support for the PS/2 ports on PA-RISC machines
+	  over which HP PS/2 keyboards and PS/2 mice may be connected.
+	  If you use these devices, you'll need to say Y here.
+
+	  It's safe to enable this driver, so if unsure, say Y.
+
+	  To compile this driver as a module, choose M here: the
+	  module will be called gscps2.
+
 config SERIO_PCIPS2
 	tristate "PCI PS/2 keyboard and PS/2 mouse controller"
 	depends on PCI && SERIO
--- diff/drivers/input/serio/Makefile	2003-06-30 10:07:29.000000000 +0100
+++ source/drivers/input/serio/Makefile	2004-02-09 10:39:52.000000000 +0000
@@ -14,4 +14,5 @@
 obj-$(CONFIG_SERIO_AMBAKMI)	+= ambakmi.o
 obj-$(CONFIG_SERIO_Q40KBD)	+= q40kbd.o
 obj-$(CONFIG_SERIO_98KBD)	+= 98kbd-io.o
+obj-$(CONFIG_SERIO_GSCPS2)	+= gscps2.o
 obj-$(CONFIG_SERIO_PCIPS2)	+= pcips2.o
--- diff/drivers/input/serio/parkbd.c	2003-05-21 11:50:15.000000000 +0100
+++ source/drivers/input/serio/parkbd.c	2004-02-09 10:39:52.000000000 +0000
@@ -151,7 +151,7 @@
 		return -ENODEV;
 	}
 
-	for (pp = parport_enumerate(); pp != NULL && (parkbd > 0); pp = pp->next) parkbd--;
+	pp = parport_find_number(parkbd);
 
 	if (pp == NULL) {
 		printk(KERN_ERR "parkbd: no such parport\n");
@@ -159,6 +159,7 @@
 	}
 
 	parkbd_dev = parport_register_device(pp, "parkbd", NULL, NULL, parkbd_interrupt, PARPORT_DEV_EXCL, NULL);
+	parport_put_port(pp);
 
 	if (!parkbd_dev)
 		return -ENODEV;
--- diff/drivers/isdn/hardware/eicon/divasmain.c	2003-10-27 09:20:37.000000000 +0000
+++ source/drivers/isdn/hardware/eicon/divasmain.c	2004-02-09 10:39:52.000000000 +0000
@@ -1,4 +1,4 @@
-/* $Id: divasmain.c,v 1.46 2003/10/10 12:28:14 armin Exp $
+/* $Id: divasmain.c,v 1.47 2004/02/03 16:03:01 armin Exp $
  *
  * Low level driver for Eicon DIVA Server ISDN cards.
  *
@@ -41,7 +41,7 @@
 #include "diva_dma.h"
 #include "diva_pci.h"
 
-static char *main_revision = "$Revision: 1.46 $";
+static char *main_revision = "$Revision: 1.47 $";
 
 static int major;
 
@@ -594,7 +594,6 @@
 
 int diva_os_cancel_soft_isr(diva_os_soft_isr_t * psoft_isr)
 {
-	flush_scheduled_work();
 	return (0);
 }
 
--- diff/drivers/isdn/hisax/hisax_hfcpci.c	2003-08-20 14:16:28.000000000 +0100
+++ source/drivers/isdn/hisax/hisax_hfcpci.c	2004-02-09 10:39:52.000000000 +0000
@@ -23,7 +23,7 @@
 #include <linux/slab.h>
 #include <linux/skbuff.h>
 #include <linux/netdevice.h>
-#include <asm/delay.h>
+#include <linux/delay.h>
 #include "hisax_hfcpci.h"
 
 // debugging cruft
--- diff/drivers/isdn/i4l/isdn_ppp.c	2003-09-17 12:28:06.000000000 +0100
+++ source/drivers/isdn/i4l/isdn_ppp.c	2004-02-09 10:39:52.000000000 +0000
@@ -1125,12 +1125,15 @@
 		return -EINVAL;
 
 	switch (cmd) {
+
+#define PPP_VERSION "2.3.7"
 	case SIOCGPPPVER:
 		r = (char *) ifr->ifr_ifru.ifru_data;
 		len = strlen(PPP_VERSION) + 1;
 		if (copy_to_user(r, PPP_VERSION, len))
 			error = -EFAULT;
 		break;
+
 	case SIOCGPPPSTATS:
 		error = isdn_ppp_dev_ioctl_stats(ifr, dev);
 		break;
--- diff/drivers/isdn/i4l/isdn_tty.c	2003-09-30 15:46:14.000000000 +0100
+++ source/drivers/isdn/i4l/isdn_tty.c	2004-02-09 10:39:52.000000000 +0000
@@ -1436,93 +1436,73 @@
 
 
 static int
-isdn_tty_get_modem_info(modem_info * info, uint * value)
+isdn_tty_tiocmget(struct tty_struct *tty, struct file *file)
 {
+	modem_info *info = (modem_info *) tty->driver_data;
 	u_char control,
 	 status;
 	uint result;
 	ulong flags;
 
+	if (isdn_tty_paranoia_check(info, tty->name, __FUNCTION__))
+		return -ENODEV;
+	if (tty->flags & (1 << TTY_IO_ERROR))
+		return -EIO;
+
+#ifdef ISDN_DEBUG_MODEM_IOCTL
+	printk(KERN_DEBUG "ttyI%d ioctl TIOCMGET\n", info->line);
+#endif
+
 	control = info->mcr;
 	save_flags(flags);
 	cli();
 	status = info->msr;
 	restore_flags(flags);
-	result = ((control & UART_MCR_RTS) ? TIOCM_RTS : 0)
+	return ((control & UART_MCR_RTS) ? TIOCM_RTS : 0)
 	    | ((control & UART_MCR_DTR) ? TIOCM_DTR : 0)
 	    | ((status & UART_MSR_DCD) ? TIOCM_CAR : 0)
 	    | ((status & UART_MSR_RI) ? TIOCM_RNG : 0)
 	    | ((status & UART_MSR_DSR) ? TIOCM_DSR : 0)
 	    | ((status & UART_MSR_CTS) ? TIOCM_CTS : 0);
-	return put_user(result, (uint *) value);
 }
 
 static int
-isdn_tty_set_modem_info(modem_info * info, uint cmd, uint * value)
+isdn_tty_tiocmset(struct tty_struct *tty, struct file *file,
+		  unsigned int set, unsigned int clear)
 {
+	modem_info *info = (modem_info *) tty->driver_data;
 	uint arg;
 	int pre_dtr;
 
-	if (get_user(arg, (uint *) value))
-		return -EFAULT;
-	switch (cmd) {
-		case TIOCMBIS:
-#ifdef ISDN_DEBUG_MODEM_IOCTL
-			printk(KERN_DEBUG "ttyI%d ioctl TIOCMBIS\n", info->line);
-#endif
-			if (arg & TIOCM_RTS) {
-				info->mcr |= UART_MCR_RTS;
-			}
-			if (arg & TIOCM_DTR) {
-				info->mcr |= UART_MCR_DTR;
-				isdn_tty_modem_ncarrier(info);
-			}
-			break;
-		case TIOCMBIC:
-#ifdef ISDN_DEBUG_MODEM_IOCTL
-			printk(KERN_DEBUG "ttyI%d ioctl TIOCMBIC\n", info->line);
-#endif
-			if (arg & TIOCM_RTS) {
-				info->mcr &= ~UART_MCR_RTS;
-			}
-			if (arg & TIOCM_DTR) {
-				info->mcr &= ~UART_MCR_DTR;
-				if (info->emu.mdmreg[REG_DTRHUP] & BIT_DTRHUP) {
-					isdn_tty_modem_reset_regs(info, 0);
-#ifdef ISDN_DEBUG_MODEM_HUP
-					printk(KERN_DEBUG "Mhup in TIOCMBIC\n");
-#endif
-					if (info->online)
-						info->ncarrier = 1;
-					isdn_tty_modem_hup(info, 1);
-				}
-			}
-			break;
-		case TIOCMSET:
+	if (isdn_tty_paranoia_check(info, tty->name, __FUNCTION__))
+		return -ENODEV;
+	if (tty->flags & (1 << TTY_IO_ERROR))
+		return -EIO;
+
 #ifdef ISDN_DEBUG_MODEM_IOCTL
-			printk(KERN_DEBUG "ttyI%d ioctl TIOCMSET\n", info->line);
+	printk(KERN_DEBUG "ttyI%d ioctl TIOCMxxx: %x %x\n", info->line, set, clear);
 #endif
-			pre_dtr = (info->mcr & UART_MCR_DTR);
-			info->mcr = ((info->mcr & ~(UART_MCR_RTS | UART_MCR_DTR))
-				 | ((arg & TIOCM_RTS) ? UART_MCR_RTS : 0)
-			       | ((arg & TIOCM_DTR) ? UART_MCR_DTR : 0));
-			if (pre_dtr |= (info->mcr & UART_MCR_DTR)) {
-				if (!(info->mcr & UART_MCR_DTR)) {
-					if (info->emu.mdmreg[REG_DTRHUP] & BIT_DTRHUP) {
-						isdn_tty_modem_reset_regs(info, 0);
+
+	if (set & TIOCM_RTS)
+		info->mcr |= UART_MCR_RTS;
+	if (set & TIOCM_DTR) {
+		info->mcr |= UART_MCR_DTR;
+		isdn_tty_modem_ncarrier(info);
+	}
+
+	if (clear & TIOCM_RTS)
+		info->mcr &= ~UART_MCR_RTS;
+	if (clear & TIOCM_DTR) {
+		info->mcr &= ~UART_MCR_DTR;
+		if (info->emu.mdmreg[REG_DTRHUP] & BIT_DTRHUP) {
+			isdn_tty_modem_reset_regs(info, 0);
 #ifdef ISDN_DEBUG_MODEM_HUP
-						printk(KERN_DEBUG "Mhup in TIOCMSET\n");
+			printk(KERN_DEBUG "Mhup in TIOCMBIC\n");
 #endif
-						if (info->online)
-							info->ncarrier = 1;
-						isdn_tty_modem_hup(info, 1);
-					}
-				} else
-					isdn_tty_modem_ncarrier(info);
-			}
-			break;
-		default:
-			return -EINVAL;
+			if (info->online)
+				info->ncarrier = 1;
+			isdn_tty_modem_hup(info, 1);
+		}
 	}
 	return 0;
 }
@@ -1572,15 +1552,6 @@
 			    ((tty->termios->c_cflag & ~CLOCAL) |
 			     (arg ? CLOCAL : 0));
 			return 0;
-		case TIOCMGET:
-#ifdef ISDN_DEBUG_MODEM_IOCTL
-			printk(KERN_DEBUG "ttyI%d ioctl TIOCMGET\n", info->line);
-#endif
-			return isdn_tty_get_modem_info(info, (uint *) arg);
-		case TIOCMBIS:
-		case TIOCMBIC:
-		case TIOCMSET:
-			return isdn_tty_set_modem_info(info, cmd, (uint *) arg);
 		case TIOCSERGETLSR:	/* Get line status register */
 #ifdef ISDN_DEBUG_MODEM_IOCTL
 			printk(KERN_DEBUG "ttyI%d ioctl TIOCSERGETLSR\n", info->line);
@@ -2006,6 +1977,8 @@
 	.unthrottle = isdn_tty_unthrottle,
 	.set_termios = isdn_tty_set_termios,
 	.hangup = isdn_tty_hangup,
+	.tiocmget = isdn_tty_tiocmget,
+	.tiocmset = isdn_tty_tiocmset,
 };
 
 int
--- diff/drivers/macintosh/Makefile	2003-08-26 10:00:52.000000000 +0100
+++ source/drivers/macintosh/Makefile	2004-02-09 10:39:52.000000000 +0000
@@ -8,9 +8,6 @@
 
 obj-$(CONFIG_PMAC_PBOOK)	+= mediabay.o
 obj-$(CONFIG_MAC_SERIAL)	+= macserial.o
-ifneq ($(CONFIG_MAC),y)
-  obj-$(CONFIG_NVRAM)		+= nvram.o
-endif
 obj-$(CONFIG_MAC_EMUMOUSEBTN)	+= mac_hid.o
 obj-$(CONFIG_INPUT_ADBHID)	+= adbhid.o
 obj-$(CONFIG_ANSLCD)		+= ans-lcd.o
@@ -25,3 +22,6 @@
 obj-$(CONFIG_ADB_IOP)		+= adb-iop.o
 obj-$(CONFIG_ADB_PMU68K)	+= via-pmu68k.o
 obj-$(CONFIG_ADB_MACIO)		+= macio-adb.o
+
+obj-$(CONFIG_THERM_PM72)	+= therm_pm72.o
+obj-$(CONFIG_THERM_WINDTUNNEL)	+= therm_windtunnel.o
--- diff/drivers/macintosh/adb.c	2003-09-30 15:46:14.000000000 +0100
+++ source/drivers/macintosh/adb.c	2004-02-09 10:39:52.000000000 +0000
@@ -83,6 +83,7 @@
 static DECLARE_MUTEX(adb_probe_mutex);
 static struct completion adb_probe_task_comp;
 static int sleepy_trackpad;
+static int autopoll_devs;
 int __adb_probe_sync;
 
 #ifdef CONFIG_PMAC_PBOOK
@@ -379,7 +380,7 @@
 static int
 do_adb_reset_bus(void)
 {
-	int ret, nret, devs;
+	int ret, nret;
 	
 	if (adb_controller == NULL)
 		return -ENXIO;
@@ -390,7 +391,7 @@
 	nret = notifier_call_chain(&adb_client_list, ADB_MSG_PRE_RESET, NULL);
 	if (nret & NOTIFY_STOP_MASK) {
 		if (adb_controller->autopoll)
-			adb_controller->autopoll(devs);
+			adb_controller->autopoll(autopoll_devs);
 		return -EBUSY;
 	}
 
@@ -416,9 +417,9 @@
 	}
 
 	if (!ret) {
-		devs = adb_scan_bus();
+		autopoll_devs = adb_scan_bus();
 		if (adb_controller->autopoll)
-			adb_controller->autopoll(devs);
+			adb_controller->autopoll(autopoll_devs);
 	}
 	up(&adb_handler_sem);
 
--- diff/drivers/macintosh/adbhid.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/macintosh/adbhid.c	2004-02-09 10:39:52.000000000 +0000
@@ -30,6 +30,8 @@
  * To do:
  *
  * Improve Kensington support.
+ * Split mouse/kbd
+ * Move to syfs
  */
 
 #include <linux/config.h>
@@ -63,6 +65,15 @@
 	.notifier_call	= adb_message_handler,
 };
 
+/* Some special keys */
+#define ADB_KEY_DEL		0x33
+#define ADB_KEY_CMD		0x37
+#define ADB_KEY_CAPSLOCK	0x39
+#define ADB_KEY_FN		0x3f
+#define ADB_KEY_FWDEL		0x75
+#define ADB_KEY_POWER_OLD	0x7e
+#define ADB_KEY_POWER		0x7f
+
 unsigned char adb_to_linux_keycodes[128] = {
 	 30, 31, 32, 33, 35, 34, 44, 45, 46, 47, 86, 48, 16, 17, 18, 19,
 	 21, 20,  2,  3,  4,  5,  7,  6, 13, 10,  8, 12,  9, 11, 27, 24,
@@ -84,8 +95,13 @@
 	unsigned char *keycode;
 	char name[64];
 	char phys[32];
+	int flags;
 };
 
+#define FLAG_FN_KEY_PRESSED	0x00000001
+#define FLAG_POWER_FROM_FN	0x00000002
+#define FLAG_EMU_FWDEL_DOWN	0x00000004
+
 static struct adbhid *adbhid[16] = { 0 };
 
 static void adbhid_probe(void);
@@ -148,28 +164,64 @@
 static void
 adbhid_input_keycode(int id, int keycode, int repeat, struct pt_regs *regs)
 {
+	struct adbhid *ahid = adbhid[id];
 	int up_flag;
 
 	up_flag = (keycode & 0x80);
 	keycode &= 0x7f;
 
 	switch (keycode) {
-	case 0x39: /* Generate down/up events for CapsLock everytime. */
-		input_regs(&adbhid[id]->input, regs);
-		input_report_key(&adbhid[id]->input, KEY_CAPSLOCK, 1);
-		input_report_key(&adbhid[id]->input, KEY_CAPSLOCK, 0);
-		input_sync(&adbhid[id]->input);
-		return;
-	case 0x3f: /* ignore Powerbook Fn key */
+	case ADB_KEY_CAPSLOCK: /* Generate down/up events for CapsLock everytime. */
+		input_regs(&ahid->input, regs);
+		input_report_key(&ahid->input, KEY_CAPSLOCK, 1);
+		input_report_key(&ahid->input, KEY_CAPSLOCK, 0);
+		input_sync(&ahid->input);
 		return;
 #ifdef CONFIG_PPC_PMAC
-	case 0x7e: /* Power key on PBook 3400 needs remapping */
+	case ADB_KEY_POWER_OLD: /* Power key on PBook 3400 needs remapping */
 		switch(pmac_call_feature(PMAC_FTR_GET_MB_INFO,
 			NULL, PMAC_MB_INFO_MODEL, 0)) {
 		case PMAC_TYPE_COMET:
 		case PMAC_TYPE_HOOPER:
 		case PMAC_TYPE_KANGA:
-			keycode = 0x7f;
+			keycode = ADB_KEY_POWER;
+		}
+		break;
+	case ADB_KEY_POWER: 
+		/* Fn + Command will produce a bogus "power" keycode */
+		if (ahid->flags & FLAG_FN_KEY_PRESSED) {
+			keycode = ADB_KEY_CMD;
+			if (up_flag)
+				ahid->flags &= ~FLAG_POWER_FROM_FN;
+			else
+				ahid->flags |= FLAG_POWER_FROM_FN;
+		} else if (ahid->flags & FLAG_POWER_FROM_FN) {
+			keycode = ADB_KEY_CMD;
+			ahid->flags &= ~FLAG_POWER_FROM_FN;
+		}
+		break;
+	case ADB_KEY_FN:
+		/* Keep track of the Fn key state */
+		if (up_flag) {
+			ahid->flags &= ~FLAG_FN_KEY_PRESSED;
+			/* Emulate Fn+delete = forward delete */
+			if (ahid->flags & FLAG_EMU_FWDEL_DOWN) {
+				ahid->flags &= ~FLAG_EMU_FWDEL_DOWN;
+				keycode = ADB_KEY_FWDEL;
+				break;
+			}
+		} else
+			ahid->flags |= FLAG_FN_KEY_PRESSED;
+		/* Swallow the key press */
+		return;
+	case ADB_KEY_DEL:
+		/* Emulate Fn+delete = forward delete */
+		if (ahid->flags & FLAG_FN_KEY_PRESSED) {
+			keycode = ADB_KEY_FWDEL;
+			if (up_flag)
+				ahid->flags &= ~FLAG_EMU_FWDEL_DOWN;
+			else
+				ahid->flags |= FLAG_EMU_FWDEL_DOWN;
 		}
 		break;
 #endif /* CONFIG_PPC_PMAC */
@@ -500,6 +552,7 @@
 	adbhid[id]->original_handler_id = original_handler_id;
 	adbhid[id]->current_handler_id = current_handler_id;
 	adbhid[id]->mouse_kind = mouse_kind;
+	adbhid[id]->flags = 0;
 	adbhid[id]->input.private = adbhid[id];
 	adbhid[id]->input.name = adbhid[id]->name;
 	adbhid[id]->input.phys = adbhid[id]->phys;
--- diff/drivers/macintosh/macio_asic.c	2003-09-17 12:28:06.000000000 +0100
+++ source/drivers/macintosh/macio_asic.c	2004-02-09 10:39:52.000000000 +0000
@@ -23,10 +23,13 @@
 #include <asm/prom.h>
 #include <asm/pci-bridge.h>
 
+#define DEBUG
+
+#define MAX_NODE_NAME_SIZE (BUS_ID_SIZE - 12)
+
 static struct macio_chip      *macio_on_hold;
 
-static int
-macio_bus_match(struct device *dev, struct device_driver *drv) 
+static int macio_bus_match(struct device *dev, struct device_driver *drv) 
 {
 	struct macio_dev * macio_dev = to_macio_device(dev);
 	struct macio_driver * macio_drv = to_macio_driver(drv);
@@ -85,41 +88,42 @@
 static int macio_device_remove(struct device *dev)
 {
 	struct macio_dev * macio_dev = to_macio_device(dev);
-	struct macio_driver * drv = to_macio_driver(macio_dev->ofdev.dev.driver);
+	struct macio_driver * drv = to_macio_driver(dev->driver);
 
-	if (drv && drv->remove)
+	if (dev->driver && drv->remove)
 		drv->remove(macio_dev);
 	macio_dev_put(macio_dev);
 
 	return 0;
 }
 
+static void macio_device_shutdown(struct device *dev)
+{
+	struct macio_dev * macio_dev = to_macio_device(dev);
+	struct macio_driver * drv = to_macio_driver(dev->driver);
+
+	if (dev->driver && drv->shutdown)
+		drv->shutdown(macio_dev);
+}
+
 static int macio_device_suspend(struct device *dev, u32 state)
 {
 	struct macio_dev * macio_dev = to_macio_device(dev);
-	struct macio_driver * drv;
-	int error = 0;
+	struct macio_driver * drv = to_macio_driver(dev->driver);
 
-	if (macio_dev->ofdev.dev.driver == NULL)
-		return 0;
-	drv = to_macio_driver(macio_dev->ofdev.dev.driver);
-	if (drv->suspend)
-		error = drv->suspend(macio_dev, state);
-	return error;
+	if (dev->driver && drv->suspend)
+		return drv->suspend(macio_dev, state);
+	return 0;
 }
 
 static int macio_device_resume(struct device * dev)
 {
 	struct macio_dev * macio_dev = to_macio_device(dev);
-	struct macio_driver * drv;
-	int error = 0;
+	struct macio_driver * drv = to_macio_driver(dev->driver);
 
-	if (macio_dev->ofdev.dev.driver == NULL)
-		return 0;
-	drv = to_macio_driver(macio_dev->ofdev.dev.driver);
-	if (drv->resume)
-		error = drv->resume(macio_dev);
-	return error;
+	if (dev->driver && drv->resume)
+		return drv->resume(macio_dev);
+	return 0;
 }
 
 struct bus_type macio_bus_type = {
@@ -129,8 +133,7 @@
        .resume	= macio_device_resume,
 };
 
-static int __init
-macio_bus_driver_init(void)
+static int __init macio_bus_driver_init(void)
 {
 	return bus_register(&macio_bus_type);
 }
@@ -155,6 +158,58 @@
 }
 
 /**
+ * macio_resource_quirks - tweak or skip some resources for a device
+ * @np: pointer to the device node
+ * @res: resulting resource
+ * @index: index of resource in node
+ *
+ * If this routine returns non-null, then the resource is completely
+ * skipped.
+ */
+static int macio_resource_quirks(struct device_node *np, struct resource *res, int index)
+{
+	if (res->flags & IORESOURCE_MEM) {
+		/* Grand Central has too large resource 0 on some machines */
+		if (index == 0 && !strcmp(np->name, "gc")) {
+			np->addrs[0].size = 0x20000;
+			res->end = res->start + 0x1ffff;
+		}
+		/* Airport has bogus resource 2 */
+		if (index >= 2 && !strcmp(np->name, "radio"))
+			return 1;
+		/* DBDMAs may have bogus sizes */
+		if ((res->start & 0x0001f000) == 0x00008000) {
+			np->addrs[index].size = 0x100;
+			res->end = res->start + 0xff;
+		}
+		/* ESCC parent eats child resources. We could have added a level of hierarchy,
+		 * but I don't really feel the need for it */
+		if (!strcmp(np->name, "escc"))
+			return 1;
+		/* ESCC has bogus resources >= 3 */
+		if (index >= 3 && !(strcmp(np->name, "ch-a") && strcmp(np->name, "ch-b")))
+			return 1;
+		/* Media bay has too many resources, keep only first one */
+		if (index > 0 && !strcmp(np->name, "media-bay"))
+			return 1;
+		/* Some older IDE resources have bogus sizes */
+		if (!(strcmp(np->name, "IDE") && strcmp(np->name, "ATA") &&
+		      strcmp(np->type, "ide") && strcmp(np->type, "ata"))) {
+			if (index == 0 && np->addrs[0].size > 0x1000) {
+				np->addrs[0].size = 0x1000;
+				res->end = res->start + 0xfff;
+			}
+			if (index == 1 && np->addrs[1].size > 0x100) {
+				np->addrs[1].size = 0x100;
+				res->end = res->start + 0xff;
+			}
+		}
+	}
+	return 0;
+}
+
+
+/**
  * macio_add_one_device - Add one device from OF node to the device tree
  * @chip: pointer to the macio_chip holding the device
  * @np: pointer to the device node in the OF tree
@@ -164,9 +219,11 @@
  * be exposed to the bay driver some way...
  */
 static struct macio_dev * macio_add_one_device(struct macio_chip *chip, struct device *parent,
-		     struct device_node *np, struct macio_dev *in_bay)
+					       struct device_node *np, struct macio_dev *in_bay,
+					       struct resource *parent_res)
 {
 	struct macio_dev *dev;
+	int i, j;
 	u32 *reg;
 	
 	if (np == NULL)
@@ -186,22 +243,76 @@
 	dev->ofdev.dev.bus = &macio_bus_type;
 	dev->ofdev.dev.release = macio_release_dev;
 
+#ifdef DEBUG
+	printk("preparing mdev @%p, ofdev @%p, dev @%p, kobj @%p\n",
+	       dev, &dev->ofdev, &dev->ofdev.dev, &dev->ofdev.dev.kobj);
+#endif
+
 	/* MacIO itself has a different reg, we use it's PCI base */
 	if (np == chip->of_node) {
-		sprintf(dev->ofdev.dev.bus_id, "%1d.%08lx:%.8s", chip->lbus.index,
+		sprintf(dev->ofdev.dev.bus_id, "%1d.%08lx:%.*s", chip->lbus.index,
 #ifdef CONFIG_PCI
 			pci_resource_start(chip->lbus.pdev, 0),
 #else
 			0, /* NuBus may want to do something better here */
 #endif
-			np->name);
+			MAX_NODE_NAME_SIZE, np->name);
 	} else {
 		reg = (u32 *)get_property(np, "reg", NULL);
-		sprintf(dev->ofdev.dev.bus_id, "%1d.%08x:%.8s", chip->lbus.index,
-			reg ? *reg : 0, np->name);
+		sprintf(dev->ofdev.dev.bus_id, "%1d.%08x:%.*s", chip->lbus.index,
+			reg ? *reg : 0, MAX_NODE_NAME_SIZE, np->name);
 	}
 
+	/* For now, we use pre-parsed entries in the device-tree for
+	 * interrupt routing and addresses, but we should change that
+	 * to dynamically parsed entries and so get rid of most of the
+	 * clutter in struct device_node
+	 */
+	for (i = j = 0; i < np->n_intrs; i++) {
+		struct resource *res = &dev->interrupt[j];
+
+		if (j >= MACIO_DEV_COUNT_IRQS)
+			break;
+		res->start = np->intrs[i].line;
+		res->flags = IORESOURCE_IO;
+		if (np->intrs[j].sense)
+			res->flags |= IORESOURCE_IRQ_LOWLEVEL;
+		else
+			res->flags |= IORESOURCE_IRQ_HIGHEDGE;
+		res->name = dev->ofdev.dev.bus_id;
+		if (macio_resource_quirks(np, res, i))
+			memset(res, 0, sizeof(struct resource));
+		else
+			j++;
+	}
+	dev->n_interrupts = j;
+	for (i = j = 0; i < np->n_addrs; i++) {
+		struct resource *res = &dev->resource[j];
+		
+		if (j >= MACIO_DEV_COUNT_RESOURCES)
+			break;
+		res->start = np->addrs[i].address;
+		res->end = np->addrs[i].address + np->addrs[i].size - 1;
+		res->flags = IORESOURCE_MEM;
+		res->name = dev->ofdev.dev.bus_id;
+		if (macio_resource_quirks(np, res, i))
+			memset(res, 0, sizeof(struct resource));
+		else {
+			j++;
+			/* Currently, we consider failure as harmless, this may
+			 * change in the future, once I've found all the device
+			 * tree bugs in older machines & worked around them
+			 */
+			if (insert_resource(parent_res, res))
+       				printk(KERN_WARNING "Can't request resource %d for MacIO"
+				       " device %s\n", i, dev->ofdev.dev.bus_id);
+		}
+	}
+	dev->n_resources = j;
+
 	if (of_device_register(&dev->ofdev) != 0) {
+		printk(KERN_DEBUG"macio: device registration error for %s!\n",
+		       dev->ofdev.dev.bus_id);
 		kfree(dev);
 		return NULL;
 	}
@@ -234,25 +345,30 @@
 	struct device_node *np, *pnode;
 	struct macio_dev *rdev, *mdev, *mbdev = NULL, *sdev = NULL;
 	struct device *parent = NULL;
+	struct resource *root_res = &iomem_resource;
 	
 	/* Add a node for the macio bus itself */
 #ifdef CONFIG_PCI
-	if (chip->lbus.pdev)
+	if (chip->lbus.pdev) {
 		parent = &chip->lbus.pdev->dev;
+		root_res = &chip->lbus.pdev->resource[0];
+	}
 #endif
 	pnode = of_node_get(chip->of_node);
 	if (pnode == NULL)
 		return;
 
-	rdev = macio_add_one_device(chip, parent, pnode, NULL);
+	/* Add macio itself to hierarchy */
+	rdev = macio_add_one_device(chip, parent, pnode, NULL, root_res);
 	if (rdev == NULL)
 		return;
+	root_res = &rdev->resource[0];
 
 	/* First scan 1st level */
 	for (np = NULL; (np = of_get_next_child(pnode, np)) != NULL;) {
 		if (!macio_skip_device(np)) {
 			of_node_get(np);
-			mdev = macio_add_one_device(chip, &rdev->ofdev.dev, np, NULL);
+			mdev = macio_add_one_device(chip, &rdev->ofdev.dev, np, NULL, root_res);
 			if (mdev == NULL)
 				of_node_put(np);
 			else if (strncmp(np->name, "media-bay", 9) == 0)
@@ -267,17 +383,20 @@
 		for (np = NULL; (np = of_get_next_child(mbdev->ofdev.node, np)) != NULL;)
 			if (!macio_skip_device(np)) {
 				of_node_get(np);
-				if (macio_add_one_device(chip, &mbdev->ofdev.dev, np, mbdev) == NULL)
+				if (macio_add_one_device(chip, &mbdev->ofdev.dev, np, mbdev,
+							 root_res) == NULL)
 					of_node_put(np);
 			}
 	/* Add serial ports if any */
-	if (sdev)
+	if (sdev) {
 		for (np = NULL; (np = of_get_next_child(sdev->ofdev.node, np)) != NULL;)
 			if (!macio_skip_device(np)) {
 				of_node_get(np);
-				if (macio_add_one_device(chip, &sdev->ofdev.dev, np, NULL) == NULL)
+				if (macio_add_one_device(chip, &sdev->ofdev.dev, np, NULL,
+							 root_res) == NULL)
 					of_node_put(np);
 			}
+	}
 }
 
 
@@ -294,6 +413,7 @@
 	drv->driver.bus = &macio_bus_type;
 	drv->driver.probe = macio_device_probe;
 	drv->driver.remove = macio_device_remove;
+	drv->driver.shutdown = macio_device_shutdown;
 
 	/* register with core */
 	count = driver_register(&drv->driver);
@@ -309,6 +429,97 @@
 	driver_unregister(&drv->driver);
 }
 
+/**
+ *	macio_request_resource - Request an MMIO resource
+ * 	@dev: pointer to the device holding the resource
+ *	@resource_no: resource number to request
+ *	@name: resource name
+ *
+ *	Mark  memory region number @resource_no associated with MacIO
+ *	device @dev as being reserved by owner @name.  Do not access
+ *	any address inside the memory regions unless this call returns
+ *	successfully.
+ *
+ *	Returns 0 on success, or %EBUSY on error.  A warning
+ *	message is also printed on failure.
+ */
+int macio_request_resource(struct macio_dev *dev, int resource_no, const char *name)
+{
+	if (macio_resource_len(dev, resource_no) == 0)
+		return 0;
+		
+	if (!request_mem_region(macio_resource_start(dev, resource_no),
+				macio_resource_len(dev, resource_no),
+				name))
+		goto err_out;
+	
+	return 0;
+
+err_out:
+	printk (KERN_WARNING "MacIO: Unable to reserve resource #%d:%lx@%lx"
+		" for device %s\n",
+		resource_no,
+		macio_resource_len(dev, resource_no),
+		macio_resource_start(dev, resource_no),
+		dev->ofdev.dev.bus_id);
+	return -EBUSY;
+}
+
+/**
+ * macio_release_resource - Release an MMIO resource
+ * @dev: pointer to the device holding the resource
+ * @resource_no: resource number to release
+ */
+void macio_release_resource(struct macio_dev *dev, int resource_no)
+{
+	if (macio_resource_len(dev, resource_no) == 0)
+		return;
+	release_mem_region(macio_resource_start(dev, resource_no),
+			   macio_resource_len(dev, resource_no));
+}
+
+/**
+ *	macio_request_resources - Reserve all memory resources
+ *	@dev: MacIO device whose resources are to be reserved
+ *	@name: Name to be associated with resource.
+ *
+ *	Mark all memory regions associated with MacIO device @dev as
+ *	being reserved by owner @name.  Do not access any address inside
+ *	the memory regions unless this call returns successfully.
+ *
+ *	Returns 0 on success, or %EBUSY on error.  A warning
+ *	message is also printed on failure.
+ */
+int macio_request_resources(struct macio_dev *dev, const char *name)
+{
+	int i;
+	
+	for (i = 0; i < dev->n_resources; i++)
+		if (macio_request_resource(dev, i, name))
+			goto err_out;
+	return 0;
+
+err_out:
+	while(--i >= 0)
+		macio_release_resource(dev, i);
+		
+	return -EBUSY;
+}
+
+/**
+ *	macio_release_resources - Release reserved memory resources
+ *	@dev: MacIO device whose resources were previously reserved
+ */
+
+void macio_release_resources(struct macio_dev *dev)
+{
+	int i;
+	
+	for (i = 0; i < dev->n_resources; i++)
+		macio_release_resource(dev, i);
+}
+
+
 #ifdef CONFIG_PCI
 
 static int __devinit macio_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
@@ -416,3 +627,7 @@
 EXPORT_SYMBOL(macio_unregister_driver);
 EXPORT_SYMBOL(macio_dev_get);
 EXPORT_SYMBOL(macio_dev_put);
+EXPORT_SYMBOL(macio_request_resource);
+EXPORT_SYMBOL(macio_release_resource);
+EXPORT_SYMBOL(macio_request_resources);
+EXPORT_SYMBOL(macio_release_resources);
--- diff/drivers/macintosh/macserial.c	2003-09-30 15:46:14.000000000 +0100
+++ source/drivers/macintosh/macserial.c	2004-02-09 10:39:52.000000000 +0000
@@ -1777,47 +1777,65 @@
 	return put_user(status,value);
 }
 
-static int get_modem_info(struct mac_serial *info, unsigned int *value)
+static int rs_tiocmget(struct tty_struct *tty, struct file *file)
 {
+	struct mac_serial * info = (struct mac_serial *)tty->driver_data;
 	unsigned char control, status;
-	unsigned int result;
 	unsigned long flags;
 
+#ifdef CONFIG_KGDB
+	if (info->kgdb_channel)
+		return -ENODEV;
+#endif
+	if (serial_paranoia_check(info, tty->name, __FUNCTION__))
+		return -ENODEV;
+
+	if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) &&
+	    (cmd != TIOCSERCONFIG) && (cmd != TIOCSERGSTRUCT)) {
+		if (tty->flags & (1 << TTY_IO_ERROR))
+		    return -EIO;
+	}
+
 	spin_lock_irqsave(&info->lock, flags);
 	control = info->curregs[5];
 	status = read_zsreg(info->zs_channel, 0);
 	spin_unlock_irqrestore(&info->lock, flags);
-	result =  ((control & RTS) ? TIOCM_RTS: 0)
+	return    ((control & RTS) ? TIOCM_RTS: 0)
 		| ((control & DTR) ? TIOCM_DTR: 0)
 		| ((status  & DCD) ? TIOCM_CAR: 0)
 		| ((status  & CTS) ? 0: TIOCM_CTS);
-	return put_user(result,value);
 }
 
-static int set_modem_info(struct mac_serial *info, unsigned int cmd,
-			  unsigned int *value)
+static int rs_tiocmset(struct tty_struct *tty, struct file *file,
+		       unsigned int set, unsigned int clear)
 {
+	struct mac_serial * info = (struct mac_serial *)tty->driver_data;
 	unsigned int arg, bits;
 	unsigned long flags;
 
-	if (get_user(arg, value))
-		return -EFAULT;
-	bits = (arg & TIOCM_RTS? RTS: 0) + (arg & TIOCM_DTR? DTR: 0);
-	spin_lock_irqsave(&info->lock, flags);
-	switch (cmd) {
-	case TIOCMBIS:
-		info->curregs[5] |= bits;
-		break;
-	case TIOCMBIC:
-		info->curregs[5] &= ~bits;
-		break;
-	case TIOCMSET:
-		info->curregs[5] = (info->curregs[5] & ~(DTR | RTS)) | bits;
-		break;
-	default:
-		spin_unlock_irqrestore(&info->lock, flags);
-		return -EINVAL;
+#ifdef CONFIG_KGDB
+	if (info->kgdb_channel)
+		return -ENODEV;
+#endif
+	if (serial_paranoia_check(info, tty->name, __FUNCTION__))
+		return -ENODEV;
+
+	if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) &&
+	    (cmd != TIOCSERCONFIG) && (cmd != TIOCSERGSTRUCT)) {
+		if (tty->flags & (1 << TTY_IO_ERROR))
+		    return -EIO;
 	}
+
+	spin_lock_irqsave(&info->lock, flags);
+	if (set & TIOCM_RTS)
+		info->curregs[5] |= RTS;
+	if (set & TIOCM_DTR)
+		info->curregs[5] |= DTR;
+	if (clear & TIOCM_RTS)
+		info->curregs[5] &= ~RTS;
+	if (clear & TIOCM_DTR)
+		info->curregs[5] &= ~DTR;
+
 	info->pendregs[5] = info->curregs[5];
 	write_zsreg(info->zs_channel, 5, info->curregs[5]);
 	spin_unlock_irqrestore(&info->lock, flags);
@@ -1863,12 +1881,6 @@
 	}
 
 	switch (cmd) {
-		case TIOCMGET:
-			return get_modem_info(info, (unsigned int *) arg);
-		case TIOCMBIS:
-		case TIOCMBIC:
-		case TIOCMSET:
-			return set_modem_info(info, cmd, (unsigned int *) arg);
 		case TIOCGSERIAL:
 			return get_serial_info(info,
 					(struct serial_struct __user *) arg);
@@ -2488,6 +2500,8 @@
 	.break_ctl = rs_break,
 	.wait_until_sent = rs_wait_until_sent,
 	.read_proc = macserial_read_proc,
+	.tiocmget = rs_tiocmget,
+	.tiocmset = rs_tiocmset,
 };
 
 static int macserial_init(void)
--- diff/drivers/macintosh/mediabay.c	2003-09-30 15:46:14.000000000 +0100
+++ source/drivers/macintosh/mediabay.c	2004-02-09 10:39:52.000000000 +0000
@@ -107,6 +107,11 @@
 #define MS_TO_HZ(ms)	((ms * HZ + 999) / 1000)
 
 /*
+ * Wait that number of ms between each step in normal polling mode
+ */
+#define MB_POLL_DELAY	25
+
+/*
  * Consider the media-bay ID value stable if it is the same for
  * this number of milliseconds
  */
@@ -121,7 +126,7 @@
  * Hold the media-bay reset signal true for this many ticks
  * after a device is inserted before releasing it.
  */
-#define MB_RESET_DELAY	40
+#define MB_RESET_DELAY	50
 
 /*
  * Wait this long after the reset signal is released and before doing
@@ -390,24 +395,28 @@
 	int id = bay->ops->content(bay);
 
 	if (id == bay->last_value) {
-	    if (id != bay->content_id
-	        && ++bay->value_count >= MS_TO_HZ(MB_STABLE_DELAY)) {
-	        /* If the device type changes without going thru "MB_NO", we force
-	           a pass by "MB_NO" to make sure things are properly reset */
-	        if ((id != MB_NO) && (bay->content_id != MB_NO)) {
-	            id = MB_NO;
-		    MBDBG("mediabay%d: forcing MB_NO\n", bay->index);
-		}
-		MBDBG("mediabay%d: switching to %d\n", bay->index, id);
-		set_mb_power(bay, id != MB_NO);
-		bay->content_id = id;
-		if (id == MB_NO) {
+		if (id != bay->content_id) {
+			bay->value_count += MS_TO_HZ(MB_POLL_DELAY);
+			if (bay->value_count >= MS_TO_HZ(MB_STABLE_DELAY)) {
+				/* If the device type changes without going thru
+				 * "MB_NO", we force a pass by "MB_NO" to make sure
+				 * things are properly reset
+				 */
+				if ((id != MB_NO) && (bay->content_id != MB_NO)) {
+					id = MB_NO;
+					MBDBG("mediabay%d: forcing MB_NO\n", bay->index);
+				}
+				MBDBG("mediabay%d: switching to %d\n", bay->index, id);
+				set_mb_power(bay, id != MB_NO);
+				bay->content_id = id;
+				if (id == MB_NO) {
 #ifdef CONFIG_BLK_DEV_IDE
-		    bay->cd_retry = 0;
+					bay->cd_retry = 0;
 #endif
-		    printk(KERN_INFO "media bay %d is empty\n", bay->index);
+					printk(KERN_INFO "media bay %d is empty\n", bay->index);
+				}
+			}
 		}
- 	    }
 	} else {
 		bay->last_value = id;
 		bay->value_count = 0;
@@ -496,8 +505,12 @@
 	    poll_media_bay(bay);
 
 	/* If timer expired or polling IDE busy, run state machine */
-	if ((bay->state != mb_ide_waiting) && (bay->timer != 0) && ((--bay->timer) != 0))
-	    return;
+	if ((bay->state != mb_ide_waiting) && (bay->timer != 0)) {
+		bay->timer -= MS_TO_HZ(MB_POLL_DELAY);
+		if (bay->timer > 0)
+			return;
+		bay->timer = 0;
+	}
 
 	switch(bay->state) {
 	case mb_powering_up:
@@ -572,12 +585,13 @@
 			}
 			break;
 	    	} else if (bay->timer > 0)
-			bay->timer--;
-	    	if (bay->timer == 0) {
+			bay->timer -= MS_TO_HZ(MB_POLL_DELAY);
+	    	if (bay->timer <= 0) {
 			printk("\nIDE Timeout in bay %d !, IDE state is: 0x%02x\n",
 			       i, readb(bay->cd_base + 0x70));
 			MBDBG("mediabay%d: nIDE Timeout !\n", i);
 			set_mb_power(bay, 0);
+			bay->timer = 0;
 	    	}
 		break;
 #endif /* CONFIG_BLK_DEV_IDE */
@@ -630,7 +644,7 @@
 		}
 
 		current->state = TASK_INTERRUPTIBLE;
-		schedule_timeout(MS_TO_HZ(10));
+		schedule_timeout(MS_TO_HZ(MB_POLL_DELAY));
 		if (signal_pending(current))
 			return 0;
 	}
@@ -645,17 +659,16 @@
 
 	ofnode = mdev->ofdev.node;
 
-	if (!request_OF_resource(ofnode, 0, NULL))
-		return -ENXIO;
-
+	if (macio_resource_count(mdev) < 1)
+		return -ENODEV;
+	if (macio_request_resources(mdev, "media-bay"))
+		return -EBUSY;
 	/* Media bay registers are located at the beginning of the
          * mac-io chip, we get the parent address for now (hrm...)
          */
-	if (ofnode->parent->n_addrs == 0)
-		return -ENODEV;
 	regbase = (volatile u32 *)ioremap(ofnode->parent->addrs[0].address, 0x100);
 	if (regbase == NULL) {
-		release_OF_resource(ofnode, 0);
+		macio_release_resources(mdev);
 		return -ENOMEM;
 	}
 	
@@ -684,13 +697,13 @@
 	bay->state = mb_empty;
 	do {
 		set_current_state(TASK_UNINTERRUPTIBLE);
-		schedule_timeout(MS_TO_HZ(10));
+		schedule_timeout(MS_TO_HZ(MB_POLL_DELAY));
 		media_bay_step(i);
 	} while((bay->state != mb_empty) &&
 		(bay->state != mb_up));
 
 	/* Mark us ready by filling our mdev data */
-	dev_set_drvdata(&mdev->ofdev.dev, bay);
+	macio_set_drvdata(mdev, bay);
 
 	/* Startup kernel thread */
 	if (i == 0)
@@ -702,7 +715,7 @@
 
 static int __pmac media_bay_suspend(struct macio_dev *mdev, u32 state)
 {
-	struct media_bay_info	*bay = dev_get_drvdata(&mdev->ofdev.dev);
+	struct media_bay_info	*bay = macio_get_drvdata(mdev);
 
 	if (state != mdev->ofdev.dev.power_state && state >= 2) {
 		down(&bay->lock);
@@ -710,7 +723,7 @@
 		set_mb_power(bay, 0);
 		up(&bay->lock);
 		set_current_state(TASK_UNINTERRUPTIBLE);
-		schedule_timeout(MS_TO_HZ(10));
+		schedule_timeout(MS_TO_HZ(MB_POLL_DELAY));
 		mdev->ofdev.dev.power_state = state;
 	}
 	return 0;
@@ -718,7 +731,7 @@
 
 static int __pmac media_bay_resume(struct macio_dev *mdev)
 {
-	struct media_bay_info	*bay = dev_get_drvdata(&mdev->ofdev.dev);
+	struct media_bay_info	*bay = macio_get_drvdata(mdev);
 
 	if (mdev->ofdev.dev.power_state != 0) {
 		mdev->ofdev.dev.power_state = 0;
@@ -746,7 +759,7 @@
 #endif
 	       	do {
 			set_current_state(TASK_UNINTERRUPTIBLE);
-			schedule_timeout(MS_TO_HZ(10));
+			schedule_timeout(MS_TO_HZ(MB_POLL_DELAY));
 	       		media_bay_step(bay->index);
 	       	} while((bay->state != mb_empty) &&
 	       		(bay->state != mb_up));
--- diff/drivers/macintosh/via-pmu.c	2003-09-17 12:28:06.000000000 +0100
+++ source/drivers/macintosh/via-pmu.c	2004-02-09 10:39:52.000000000 +0000
@@ -168,6 +168,7 @@
 static struct proc_dir_entry *proc_pmu_info;
 static struct proc_dir_entry *proc_pmu_irqstats;
 static struct proc_dir_entry *proc_pmu_options;
+static int option_server_mode;
 
 #ifdef CONFIG_PMAC_PBOOK
 int pmu_battery_count;
@@ -334,7 +335,8 @@
 		pmu_kind = PMU_PADDINGTON_BASED;
 	else if (device_is_compatible(vias->parent, "heathrow"))
 		pmu_kind = PMU_HEATHROW_BASED;
-	else if (device_is_compatible(vias->parent, "Keylargo")) {
+	else if (device_is_compatible(vias->parent, "Keylargo")
+		 || device_is_compatible(vias->parent, "K2-Keylargo")) {
 		struct device_node *gpio, *gpiop;
 
 		pmu_kind = PMU_KEYLARGO_BASED;
@@ -349,6 +351,8 @@
 		if (gpiop && gpiop->n_addrs) {
 			gpio_reg = ioremap(gpiop->addrs->address, 0x10);
 			gpio = find_devices("extint-gpio1");
+			if (gpio == NULL)
+				gpio = find_devices("pmu-interrupt");
 			if (gpio && gpio->parent == gpiop && gpio->n_intrs)
 				gpio_irq = gpio->intrs[0].line;
 		}
@@ -564,7 +568,19 @@
 	pmu_wait_complete(&req);
 	if (req.reply_len > 0)
 		pmu_version = req.reply[0];
-
+	
+	/* Read server mode setting */
+	if (pmu_kind == PMU_KEYLARGO_BASED) {
+		pmu_request(&req, NULL, 2, PMU_POWER_EVENTS,
+			    PMU_PWR_GET_POWERUP_EVENTS);
+		pmu_wait_complete(&req);
+		if (req.reply_len == 2) {
+			if (req.reply[1] & PMU_PWR_WAKEUP_AC_INSERT)
+				option_server_mode = 1;
+			printk(KERN_INFO "via-pmu: Server Mode is %s\n",
+			       option_server_mode ? "enabled" : "disabled");
+		}
+	}
 	return 1;
 }
 
@@ -583,6 +599,28 @@
 	last_jiffy_stamp(0) = tb_last_stamp = get_tbl();
 }
 
+static void pmu_set_server_mode(int server_mode)
+{
+	struct adb_request req;
+
+	if (pmu_kind != PMU_KEYLARGO_BASED)
+		return;
+
+	option_server_mode = server_mode;
+	pmu_request(&req, NULL, 2, PMU_POWER_EVENTS, PMU_PWR_GET_POWERUP_EVENTS);
+	pmu_wait_complete(&req);
+	if (req.reply_len < 2)
+		return;
+	if (server_mode)
+		pmu_request(&req, NULL, 4, PMU_POWER_EVENTS,
+			    PMU_PWR_SET_POWERUP_EVENTS,
+			    req.reply[0], PMU_PWR_WAKEUP_AC_INSERT); 
+	else
+		pmu_request(&req, NULL, 4, PMU_POWER_EVENTS,
+			    PMU_PWR_CLR_POWERUP_EVENTS,
+			    req.reply[0], PMU_PWR_WAKEUP_AC_INSERT); 
+	pmu_wait_complete(&req);
+}
 
 #ifdef CONFIG_PMAC_PBOOK
 
@@ -845,6 +883,8 @@
 	if (pmu_kind == PMU_KEYLARGO_BASED && can_sleep)
 		p += sprintf(p, "lid_wakeup=%d\n", option_lid_wakeup);
 #endif /* CONFIG_PMAC_PBOOK */
+	if (pmu_kind == PMU_KEYLARGO_BASED)
+		p += sprintf(p, "server_mode=%d\n", option_server_mode);
 
 	return p - page;
 }
@@ -884,6 +924,12 @@
 		if (!strcmp(label, "lid_wakeup"))
 			option_lid_wakeup = ((*val) == '1');
 #endif /* CONFIG_PMAC_PBOOK */
+	if (pmu_kind == PMU_KEYLARGO_BASED && !strcmp(label, "server_mode")) {
+		int new_value;
+		new_value = ((*val) == '1');
+		if (new_value != option_server_mode)
+			pmu_set_server_mode(new_value);
+	}
 	return fcount;
 }
 
@@ -1758,6 +1804,11 @@
 		pmu_request(&req, NULL, 2, PMU_SET_INTR_MASK, PMU_INT_ADB |
 						PMU_INT_TICK );
 		pmu_wait_complete(&req);
+	} else {
+		/* Disable server mode on shutdown or we'll just
+		 * wake up again
+		 */
+		pmu_set_server_mode(0);
 	}
 
 	pmu_request(&req, NULL, 5, PMU_SHUTDOWN,
@@ -2288,8 +2339,6 @@
 }
 
 extern long sys_sync(void);
-extern void pm_prepare_console(void);
-extern void pm_restore_console(void);
 
 static int __pmac
 pmac_suspend_devices(void)
--- diff/drivers/md/Makefile	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/md/Makefile	2004-02-09 10:39:52.000000000 +0000
@@ -24,26 +24,43 @@
 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 )
+quiet_cmd_unroll = UNROLL  $@
+      cmd_unroll = $(PERL) $(srctree)/$(src)/unroll.pl $(UNROLL) \
+                   < $< > $@ || ( rm -f $@ && exit 1 )
+
+targets += raid6int1.c
+$(obj)/raid6int1.c:   UNROLL := 1
+$(obj)/raid6int1.c:   $(src)/raid6int.uc $(src)/unroll.pl FORCE
+	$(call if_changed,unroll)
+
+targets += raid6int2.c
+$(obj)/raid6int2.c:   UNROLL := 2
+$(obj)/raid6int2.c:   $(src)/raid6int.uc $(src)/unroll.pl FORCE
+	$(call if_changed,unroll)
+
+targets += raid6int4.c
+$(obj)/raid6int4.c:   UNROLL := 4
+$(obj)/raid6int4.c:   $(src)/raid6int.uc $(src)/unroll.pl FORCE
+	$(call if_changed,unroll)
+
+targets += raid6int8.c
+$(obj)/raid6int8.c:   UNROLL := 8
+$(obj)/raid6int8.c:   $(src)/raid6int.uc $(src)/unroll.pl FORCE
+	$(call if_changed,unroll)
+
+targets += raid6int16.c
+$(obj)/raid6int16.c:  UNROLL := 16
+$(obj)/raid6int16.c:  $(src)/raid6int.uc $(src)/unroll.pl FORCE
+	$(call if_changed,unroll)
+
+targets += raid6int32.c
+$(obj)/raid6int32.c:  UNROLL := 32
+$(obj)/raid6int32.c:  $(src)/raid6int.uc $(src)/unroll.pl FORCE
+	$(call if_changed,unroll)
+
+quiet_cmd_mktable = TABLE   $@
+      cmd_mktable = $(obj)/mktables > $@ || ( rm -f $@ && exit 1 )
+
+targets += raid6tables.c
+$(obj)/raid6tables.c: $(obj)/mktables FORCE
+	$(call if_changed,mktable)
--- diff/drivers/md/dm-stripe.c	2003-09-30 15:46:14.000000000 +0100
+++ source/drivers/md/dm-stripe.c	2004-02-09 10:39:52.000000000 +0000
@@ -195,12 +195,12 @@
 		break;
 
 	case STATUSTYPE_TABLE:
-		offset = snprintf(result, maxlen, "%d " SECTOR_FORMAT,
+		offset = scnprintf(result, maxlen, "%d " SECTOR_FORMAT,
 				  sc->stripes, sc->chunk_mask + 1);
 		for (i = 0; i < sc->stripes; i++) {
 			format_dev_t(buffer, sc->stripe[i].dev->bdev->bd_dev);
 			offset +=
-			    snprintf(result + offset, maxlen - offset,
+			    scnprintf(result + offset, maxlen - offset,
 				     " %s " SECTOR_FORMAT, buffer,
 				     sc->stripe[i].physical_start);
 		}
--- diff/drivers/md/linear.c	2004-01-19 10:22:56.000000000 +0000
+++ source/drivers/md/linear.c	2004-02-09 10:39:52.000000000 +0000
@@ -208,6 +208,14 @@
 	dev_info_t *tmp_dev;
 	sector_t block;
 
+	if (bio_data_dir(bio)==WRITE) {
+		disk_stat_inc(mddev->gendisk, writes);
+		disk_stat_add(mddev->gendisk, write_sectors, bio_sectors(bio));
+	} else {
+		disk_stat_inc(mddev->gendisk, reads);
+		disk_stat_add(mddev->gendisk, read_sectors, bio_sectors(bio));
+	}
+
 	tmp_dev = which_dev(mddev, bio->bi_sector);
 	block = bio->bi_sector >> 1;
   
--- diff/drivers/md/md.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/md/md.c	2004-02-09 10:39:52.000000000 +0000
@@ -512,11 +512,6 @@
 		goto abort;
 	}
 
-	if (sb->md_minor >= MAX_MD_DEVS) {
-		printk(KERN_ERR "md: %s: invalid raid minor (%x)\n",
-			b, sb->md_minor);
-		goto abort;
-	}
 	if (sb->raid_disks <= 0)
 		goto abort;
 
@@ -999,10 +994,10 @@
 	same_pdev = match_dev_unit(mddev, rdev);
 	if (same_pdev)
 		printk(KERN_WARNING
-			"md%d: WARNING: %s appears to be on the same physical"
+			"%s: WARNING: %s appears to be on the same physical"
 	 		" disk as %s. True\n     protection against single-disk"
 			" failure might be compromised.\n",
-			mdidx(mddev), bdevname(rdev->bdev,b),
+			mdname(mddev), bdevname(rdev->bdev,b),
 			bdevname(same_pdev->bdev,b2));
 
 	/* Verify rdev->desc_nr is unique.
@@ -1182,7 +1177,7 @@
 	printk("md:	* <COMPLETE RAID STATE PRINTOUT> *\n");
 	printk("md:	**********************************\n");
 	ITERATE_MDDEV(mddev,tmp) {
-		printk("md%d: ", mdidx(mddev));
+		printk("%s: ", mdname(mddev));
 
 		ITERATE_RDEV(mddev,rdev,tmp2)
 			printk("<%s>", bdevname(rdev->bdev,b));
@@ -1262,8 +1257,8 @@
 		return;
 
 	dprintk(KERN_INFO 
-		"md: updating md%d RAID superblock on device (in sync %d)\n",
-		mdidx(mddev),mddev->in_sync);
+		"md: updating %s RAID superblock on device (in sync %d)\n",
+		mdname(mddev),mddev->in_sync);
 
 	err = 0;
 	ITERATE_RDEV(mddev,rdev,tmp) {
@@ -1429,8 +1424,8 @@
 	if (mddev->major_version != MD_MAJOR_VERSION ||
 			mddev->minor_version > MD_MINOR_VERSION) {
 		printk(KERN_ALERT 
-			"md: md%d: unsupported raid array version %d.%d.%d\n",
-			mdidx(mddev), mddev->major_version,
+			"md: %s: unsupported raid array version %d.%d.%d\n",
+			mdname(mddev), mddev->major_version,
 			mddev->minor_version, mddev->patch_version);
 		goto abort;
 	}
@@ -1438,9 +1433,9 @@
 	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"
+		printk(KERN_ERR "md: %s: raid array is not clean"
 		       " -- starting background reconstruction\n",
-		       mdidx(mddev));
+		       mdname(mddev));
 
 	return 0;
 abort:
@@ -1665,8 +1660,8 @@
 		mddev->ro = 0;
 		set_disk_ro(disk, 0);
 
-		printk(KERN_INFO "md: md%d switched to read-write mode.\n",
-			mdidx(mddev));
+		printk(KERN_INFO "md: %s switched to read-write mode.\n",
+			mdname(mddev));
 		/*
 		 * Kick recovery or resync if necessary
 		 */
@@ -1674,8 +1669,8 @@
 		md_wakeup_thread(mddev->thread);
 		err = 0;
 	} else {
-		printk(KERN_ERR "md: md%d has no personality assigned.\n",
-			mdidx(mddev));
+		printk(KERN_ERR "md: %s has no personality assigned.\n",
+			mdname(mddev));
 		err = -EINVAL;
 	}
 
@@ -1690,7 +1685,7 @@
 
 	if (mddev->pers) {
 		if (atomic_read(&mddev->active)>2) {
-			printk("md: md%d still in use.\n",mdidx(mddev));
+			printk("md: %s still in use.\n",mdname(mddev));
 			return -EBUSY;
 		}
 
@@ -1732,7 +1727,7 @@
 	 */
 	if (!ro) {
 		struct gendisk *disk;
-		printk(KERN_INFO "md: md%d stopped.\n", mdidx(mddev));
+		printk(KERN_INFO "md: %s stopped.\n", mdname(mddev));
 
 		export_array(mddev);
 
@@ -1741,8 +1736,8 @@
 		if (disk)
 			set_capacity(disk, 0);
 	} else
-		printk(KERN_INFO "md: md%d switched to read-only mode.\n",
-			mdidx(mddev));
+		printk(KERN_INFO "md: %s switched to read-only mode.\n",
+			mdname(mddev));
 	err = 0;
 out:
 	return err;
@@ -1821,16 +1816,16 @@
 			break;
 		}
 		if (mddev_lock(mddev)) 
-			printk(KERN_WARNING "md: md%d locked, cannot run\n",
-			       mdidx(mddev));
+			printk(KERN_WARNING "md: %s locked, cannot run\n",
+			       mdname(mddev));
 		else if (mddev->raid_disks || mddev->major_version
 			 || !list_empty(&mddev->disks)) {
 			printk(KERN_WARNING 
-				"md: md%d already running, cannot run %s\n",
-				mdidx(mddev), bdevname(rdev0->bdev,b));
+				"md: %s already running, cannot run %s\n",
+				mdname(mddev), bdevname(rdev0->bdev,b));
 			mddev_unlock(mddev);
-		} else {
-			printk(KERN_INFO "md: created md%d\n", mdidx(mddev));
+		} else if (rdev0->preferred_minor >= 0 && rdev0->preferred_minor < MAX_MD_DEVS) {
+			printk(KERN_INFO "md: created %s\n", mdname(mddev));
 			ITERATE_RDEV_GENERIC(candidates,rdev,tmp) {
 				list_del_init(&rdev->same_set);
 				if (bind_rdev_to_array(rdev, mddev))
@@ -1838,7 +1833,9 @@
 			}
 			autorun_array(mddev);
 			mddev_unlock(mddev);
-		}
+		} else
+			printk(KERN_WARNING "md: %s had invalid preferred minor %d\n",
+			       bdevname(rdev->bdev, b), rdev0->preferred_minor);
 		/* on success, candidates will be empty, on error
 		 * it won't...
 		 */
@@ -2062,8 +2059,8 @@
 		int err;
 		if (!mddev->pers->hot_add_disk) {
 			printk(KERN_WARNING 
-				"md%d: personality does not support diskops!\n",
-			       mdidx(mddev));
+				"%s: personality does not support diskops!\n",
+			       mdname(mddev));
 			return -EINVAL;
 		}
 		rdev = md_import_device(dev, mddev->major_version,
@@ -2088,8 +2085,8 @@
 	 * for major_version==0 superblocks
 	 */
 	if (mddev->major_version != 0) {
-		printk(KERN_WARNING "md%d: ADD_NEW_DISK not supported\n",
-		       mdidx(mddev));
+		printk(KERN_WARNING "%s: ADD_NEW_DISK not supported\n",
+		       mdname(mddev));
 		return -EINVAL;
 	}
 
@@ -2143,8 +2140,8 @@
 	if (!mddev->pers)
 		return -ENODEV;
 
-	printk(KERN_INFO "md: trying to generate %s error in md%d ... \n",
-		__bdevname(dev, b), mdidx(mddev));
+	printk(KERN_INFO "md: trying to generate %s error in %s ... \n",
+		__bdevname(dev, b), mdname(mddev));
 
 	rdev = find_rdev(mddev, dev);
 	if (!rdev) {
@@ -2178,8 +2175,8 @@
 	if (!mddev->pers)
 		return -ENODEV;
 
-	printk(KERN_INFO "md: trying to remove %s from md%d ... \n",
-		__bdevname(dev, b), mdidx(mddev));
+	printk(KERN_INFO "md: trying to remove %s from %s ... \n",
+		__bdevname(dev, b), mdname(mddev));
 
 	rdev = find_rdev(mddev, dev);
 	if (!rdev)
@@ -2193,8 +2190,8 @@
 
 	return 0;
 busy:
-	printk(KERN_WARNING "md: cannot remove active disk %s from md%d ... \n",
-		bdevname(rdev->bdev,b), mdidx(mddev));
+	printk(KERN_WARNING "md: cannot remove active disk %s from %s ... \n",
+		bdevname(rdev->bdev,b), mdname(mddev));
 	return -EBUSY;
 }
 
@@ -2208,19 +2205,19 @@
 	if (!mddev->pers)
 		return -ENODEV;
 
-	printk(KERN_INFO "md: trying to hot-add %s to md%d ... \n",
-		__bdevname(dev, b), mdidx(mddev));
+	printk(KERN_INFO "md: trying to hot-add %s to %s ... \n",
+		__bdevname(dev, b), mdname(mddev));
 
 	if (mddev->major_version != 0) {
-		printk(KERN_WARNING "md%d: HOT_ADD may only be used with"
+		printk(KERN_WARNING "%s: HOT_ADD may only be used with"
 			" version-0 superblocks.\n",
-			mdidx(mddev));
+			mdname(mddev));
 		return -EINVAL;
 	}
 	if (!mddev->pers->hot_add_disk) {
 		printk(KERN_WARNING 
-			"md%d: personality does not support diskops!\n",
-			mdidx(mddev));
+			"%s: personality does not support diskops!\n",
+			mdname(mddev));
 		return -EINVAL;
 	}
 
@@ -2238,8 +2235,8 @@
 
 	if (size < mddev->size) {
 		printk(KERN_WARNING 
-			"md%d: disk size %llu blocks < array size %llu\n",
-			mdidx(mddev), (unsigned long long)size,
+			"%s: disk size %llu blocks < array size %llu\n",
+			mdname(mddev), (unsigned long long)size,
 			(unsigned long long)mddev->size);
 		err = -ENOSPC;
 		goto abort_export;
@@ -2247,8 +2244,8 @@
 
 	if (rdev->faulty) {
 		printk(KERN_WARNING 
-			"md: can not hot-add faulty %s disk to md%d!\n",
-			bdevname(rdev->bdev,b), mdidx(mddev));
+			"md: can not hot-add faulty %s disk to %s!\n",
+			bdevname(rdev->bdev,b), mdname(mddev));
 		err = -EINVAL;
 		goto abort_export;
 	}
@@ -2262,8 +2259,8 @@
 	 */
 
 	if (rdev->desc_nr == mddev->max_disks) {
-		printk(KERN_WARNING "md%d: can not hot-add to full array!\n",
-			mdidx(mddev));
+		printk(KERN_WARNING "%s: can not hot-add to full array!\n",
+			mdname(mddev));
 		err = -EBUSY;
 		goto abort_unbind_export;
 	}
@@ -2445,15 +2442,15 @@
 
 			if (!list_empty(&mddev->disks)) {
 				printk(KERN_WARNING 
-					"md: array md%d already has disks!\n",
-					mdidx(mddev));
+					"md: array %s already has disks!\n",
+					mdname(mddev));
 				err = -EBUSY;
 				goto abort_unlock;
 			}
 			if (mddev->raid_disks) {
 				printk(KERN_WARNING 
-					"md: array md%d already initialised!\n",
-					mdidx(mddev));
+					"md: array %s already initialised!\n",
+					mdname(mddev));
 				err = -EBUSY;
 				goto abort_unlock;
 			}
@@ -2648,7 +2645,7 @@
 	 * Detach thread
 	 */
 
-	daemonize(thread->name, mdidx(thread->mddev));
+	daemonize(thread->name, mdname(thread->mddev));
 
 	current->exit_signal = SIGCHLD;
 	allow_signal(SIGKILL);
@@ -2693,7 +2690,7 @@
 void md_wakeup_thread(mdk_thread_t *thread)
 {
 	if (thread) {
-		dprintk("md: waking up MD thread %p.\n", thread);
+		dprintk("md: waking up MD thread %s.\n", thread->tsk->comm);
 		set_bit(THREAD_WAKEUP, &thread->flags);
 		wake_up(&thread->wqueue);
 	}
@@ -2754,12 +2751,6 @@
 
 void md_error(mddev_t *mddev, mdk_rdev_t *rdev)
 {
-	dprintk("md_error dev:(%d:%d), rdev:(%d:%d), (caller: %p,%p,%p,%p).\n",
-		MD_MAJOR,mdidx(mddev),
-		MAJOR(rdev->bdev->bd_dev), MINOR(rdev->bdev->bd_dev),
-		__builtin_return_address(0),__builtin_return_address(1),
-		__builtin_return_address(2),__builtin_return_address(3));
-
 	if (!mddev) {
 		MD_BUG();
 		return;
@@ -2767,6 +2758,13 @@
 
 	if (!rdev || rdev->faulty)
 		return;
+
+	dprintk("md_error dev:%s, rdev:(%d:%d), (caller: %p,%p,%p,%p).\n",
+		mdname(mddev),
+		MAJOR(rdev->bdev->bd_dev), MINOR(rdev->bdev->bd_dev),
+		__builtin_return_address(0),__builtin_return_address(1),
+		__builtin_return_address(2),__builtin_return_address(3));
+
 	if (!mddev->pers->error_handler)
 		return;
 	mddev->pers->error_handler(mddev,rdev);
@@ -2935,7 +2933,7 @@
 	if (mddev_lock(mddev)!=0) 
 		return -EINTR;
 	if (mddev->pers || mddev->raid_disks || !list_empty(&mddev->disks)) {
-		seq_printf(seq, "md%d : %sactive", mdidx(mddev),
+		seq_printf(seq, "%s : %sactive", mdname(mddev),
 						mddev->pers ? "" : "in");
 		if (mddev->pers) {
 			if (mddev->ro)
@@ -3124,8 +3122,8 @@
 void md_handle_safemode(mddev_t *mddev)
 {
 	if (signal_pending(current)) {
-		printk(KERN_INFO "md: md%d in immediate safe mode\n",
-			mdidx(mddev));
+		printk(KERN_INFO "md: %s in immediate safe mode\n",
+			mdname(mddev));
 		mddev->safemode = 2;
 		flush_signals(current);
 	}
@@ -3167,10 +3165,10 @@
 				continue;
 			if (mddev2->curr_resync && 
 			    match_mddev_units(mddev,mddev2)) {
-				printk(KERN_INFO "md: delaying resync of md%d"
-					" until md%d has finished resync (they"
+				printk(KERN_INFO "md: delaying resync of %s"
+					" until %s has finished resync (they"
 				       	" share one or more physical units)\n",
-				       mdidx(mddev), mdidx(mddev2));
+				       mdname(mddev), mdname(mddev2));
 				if (mddev < mddev2) {/* arbitrarily yield */
 					mddev->curr_resync = 1;
 					wake_up(&resync_wait);
@@ -3191,7 +3189,7 @@
 
 	max_sectors = mddev->size << 1;
 
-	printk(KERN_INFO "md: syncing RAID array md%d\n", mdidx(mddev));
+	printk(KERN_INFO "md: syncing RAID array %s\n", mdname(mddev));
 	printk(KERN_INFO "md: minimum _guaranteed_ reconstruction speed:"
 		" %d KB/sec/disc.\n", sysctl_speed_limit_min);
 	printk(KERN_INFO "md: using maximum available idle IO bandwith "
@@ -3224,8 +3222,8 @@
 
 	if (j)
 		printk(KERN_INFO 
-			"md: resuming recovery of md%d from checkpoint.\n",
-			mdidx(mddev));
+			"md: resuming recovery of %s from checkpoint.\n",
+			mdname(mddev));
 
 	while (j < max_sectors) {
 		int sectors;
@@ -3295,7 +3293,7 @@
 			}
 		}
 	}
-	printk(KERN_INFO "md: md%d: sync done.\n",mdidx(mddev));
+	printk(KERN_INFO "md: %s: sync done.\n",mdname(mddev));
 	/*
 	 * this also signals 'finished resyncing' to md_stop
 	 */
@@ -3310,8 +3308,8 @@
 	    mddev->curr_resync > mddev->recovery_cp) {
 		if (test_bit(MD_RECOVERY_INTR, &mddev->recovery)) {
 			printk(KERN_INFO 
-				"md: checkpointing recovery of md%d.\n",
-				mdidx(mddev));
+				"md: checkpointing recovery of %s.\n",
+				mdname(mddev));
 			mddev->recovery_cp = mddev->curr_resync;
 		} else
 			mddev->recovery_cp = MaxSector;
@@ -3431,11 +3429,11 @@
 				set_bit(MD_RECOVERY_SYNC, &mddev->recovery);
 			mddev->sync_thread = md_register_thread(md_do_sync,
 								mddev,
-								"md%d_resync");
+								"%s_resync");
 			if (!mddev->sync_thread) {
-				printk(KERN_ERR "md%d: could not start resync"
+				printk(KERN_ERR "%s: could not start resync"
 					" thread...\n", 
-					mdidx(mddev));
+					mdname(mddev));
 				/* leave the spares where they are, it shouldn't hurt */
 				mddev->recovery = 0;
 			} else {
--- diff/drivers/md/multipath.c	2004-01-19 10:22:56.000000000 +0000
+++ source/drivers/md/multipath.c	2004-02-09 10:39:52.000000000 +0000
@@ -167,6 +167,13 @@
 	mp_bh->master_bio = bio;
 	mp_bh->mddev = mddev;
 
+	if (bio_data_dir(bio)==WRITE) {
+		disk_stat_inc(mddev->gendisk, writes);
+		disk_stat_add(mddev->gendisk, write_sectors, bio_sectors(bio));
+	} else {
+		disk_stat_inc(mddev->gendisk, reads);
+		disk_stat_add(mddev->gendisk, read_sectors, bio_sectors(bio));
+	}
 	/*
 	 * read balancing logic:
 	 */
@@ -382,8 +389,8 @@
 	struct list_head *tmp;
 
 	if (mddev->level != LEVEL_MULTIPATH) {
-		printk("multipath: md%d: raid level not set to multipath IO (%d)\n",
-		       mdidx(mddev), mddev->level);
+		printk("multipath: %s: raid level not set to multipath IO (%d)\n",
+		       mdname(mddev), mddev->level);
 		goto out;
 	}
 	/*
@@ -396,8 +403,8 @@
 	mddev->private = conf;
 	if (!conf) {
 		printk(KERN_ERR 
-			"multipath: couldn't allocate memory for md%d\n",
-			mdidx(mddev));
+			"multipath: couldn't allocate memory for %s\n",
+			mdname(mddev));
 		goto out;
 	}
 	memset(conf, 0, sizeof(*conf));
@@ -406,8 +413,8 @@
 				   GFP_KERNEL);
 	if (!conf->multipaths) {
 		printk(KERN_ERR 
-			"multipath: couldn't allocate memory for md%d\n",
-			mdidx(mddev));
+			"multipath: couldn't allocate memory for %s\n",
+			mdname(mddev));
 		goto out_free_conf;
 	}
 	memset(conf->multipaths, 0, sizeof(struct multipath_info)*mddev->raid_disks);
@@ -441,8 +448,8 @@
 	conf->device_lock = SPIN_LOCK_UNLOCKED;
 
 	if (!conf->working_disks) {
-		printk(KERN_ERR "multipath: no operational IO paths for md%d\n",
-			mdidx(mddev));
+		printk(KERN_ERR "multipath: no operational IO paths for %s\n",
+			mdname(mddev));
 		goto out_free_conf;
 	}
 	mddev->degraded = conf->raid_disks = conf->working_disks;
@@ -452,25 +459,23 @@
 				    NULL);
 	if (conf->pool == NULL) {
 		printk(KERN_ERR 
-			"multipath: couldn't allocate memory for md%d\n",
-			mdidx(mddev));
+			"multipath: couldn't allocate memory for %s\n",
+			mdname(mddev));
 		goto out_free_conf;
 	}
 
 	{
-		const char * name = "md%d_multipath";
-
-		mddev->thread = md_register_thread(multipathd, mddev, name);
+		mddev->thread = md_register_thread(multipathd, mddev, "%s_multipath");
 		if (!mddev->thread) {
 			printk(KERN_ERR "multipath: couldn't allocate thread"
-				" for md%d\n", mdidx(mddev));
+				" for %s\n", mdname(mddev));
 			goto out_free_conf;
 		}
 	}
 
 	printk(KERN_INFO 
-		"multipath: array md%d active with %d out of %d IO paths\n",
-		mdidx(mddev), conf->working_disks, mddev->raid_disks);
+		"multipath: array %s active with %d out of %d IO paths\n",
+		mdname(mddev), conf->working_disks, mddev->raid_disks);
 	/*
 	 * Ok, everything is just fine now
 	 */
--- diff/drivers/md/raid0.c	2004-01-19 10:22:56.000000000 +0000
+++ source/drivers/md/raid0.c	2004-02-09 10:39:52.000000000 +0000
@@ -240,8 +240,8 @@
 	mdk_rdev_t *rdev;
 	struct list_head *tmp;
 
-	printk("md%d: setting max_sectors to %d, segment boundary to %d\n",
-	       mdidx(mddev),
+	printk("%s: setting max_sectors to %d, segment boundary to %d\n",
+	       mdname(mddev),
 	       mddev->chunk_size >> 9,
 	       (mddev->chunk_size>>1)-1);
 	blk_queue_max_sectors(mddev->queue, mddev->chunk_size >> 9);
@@ -365,6 +365,14 @@
 	unsigned long chunk;
 	sector_t block, rsect;
 
+	if (bio_data_dir(bio)==WRITE) {
+		disk_stat_inc(mddev->gendisk, writes);
+		disk_stat_add(mddev->gendisk, write_sectors, bio_sectors(bio));
+	} else {
+		disk_stat_inc(mddev->gendisk, reads);
+		disk_stat_add(mddev->gendisk, read_sectors, bio_sectors(bio));
+	}
+
 	chunk_size = mddev->chunk_size >> 10;
 	chunk_sects = mddev->chunk_size >> 9;
 	chunksize_bits = ffz(~chunk_size);
--- diff/drivers/md/raid1.c	2004-01-19 10:22:56.000000000 +0000
+++ source/drivers/md/raid1.c	2004-02-09 10:39:52.000000000 +0000
@@ -474,6 +474,14 @@
 	conf->nr_pending++;
 	spin_unlock_irq(&conf->resync_lock);
 
+	if (bio_data_dir(bio)==WRITE) {
+		disk_stat_inc(mddev->gendisk, writes);
+		disk_stat_add(mddev->gendisk, write_sectors, bio_sectors(bio));
+	} else {
+		disk_stat_inc(mddev->gendisk, reads);
+		disk_stat_add(mddev->gendisk, read_sectors, bio_sectors(bio));
+	}
+
 	/*
 	 * make_request() can abort the operation when READA is being
 	 * used and no empty request is available.
@@ -1044,8 +1052,8 @@
 	struct list_head *tmp;
 
 	if (mddev->level != 1) {
-		printk("raid1: md%d: raid level not set to mirroring (%d)\n",
-		       mdidx(mddev), mddev->level);
+		printk("raid1: %s: raid level not set to mirroring (%d)\n",
+		       mdname(mddev), mddev->level);
 		goto out;
 	}
 	/*
@@ -1056,16 +1064,16 @@
 	conf = kmalloc(sizeof(conf_t), GFP_KERNEL);
 	mddev->private = conf;
 	if (!conf) {
-		printk(KERN_ERR "raid1: couldn't allocate memory for md%d\n",
-			mdidx(mddev));
+		printk(KERN_ERR "raid1: couldn't allocate memory for %s\n",
+			mdname(mddev));
 		goto out;
 	}
 	memset(conf, 0, sizeof(*conf));
 	conf->mirrors = kmalloc(sizeof(struct mirror_info)*mddev->raid_disks, 
 				 GFP_KERNEL);
 	if (!conf->mirrors) {
-		printk(KERN_ERR "raid1: couldn't allocate memory for md%d\n",
-		       mdidx(mddev));
+		printk(KERN_ERR "raid1: couldn't allocate memory for %s\n",
+		       mdname(mddev));
 		goto out_free_conf;
 	}
 	memset(conf->mirrors, 0, sizeof(struct mirror_info)*mddev->raid_disks);
@@ -1073,8 +1081,8 @@
 	conf->r1bio_pool = mempool_create(NR_RAID1_BIOS, r1bio_pool_alloc,
 						r1bio_pool_free, mddev);
 	if (!conf->r1bio_pool) {
-		printk(KERN_ERR "raid1: couldn't allocate memory for md%d\n", 
-			mdidx(mddev));
+		printk(KERN_ERR "raid1: couldn't allocate memory for %s\n", 
+			mdname(mddev));
 		goto out_free_conf;
 	}
 
@@ -1113,8 +1121,8 @@
 	init_waitqueue_head(&conf->wait_resume);
 
 	if (!conf->working_disks) {
-		printk(KERN_ERR "raid1: no operational mirrors for md%d\n",
-			mdidx(mddev));
+		printk(KERN_ERR "raid1: no operational mirrors for %s\n",
+			mdname(mddev));
 		goto out_free_conf;
 	}
 
@@ -1142,17 +1150,17 @@
 
 
 	{
-		mddev->thread = md_register_thread(raid1d, mddev, "md%d_raid1");
+		mddev->thread = md_register_thread(raid1d, mddev, "%s_raid1");
 		if (!mddev->thread) {
 			printk(KERN_ERR 
-				"raid1: couldn't allocate thread for md%d\n", 
-				mdidx(mddev));
+				"raid1: couldn't allocate thread for %s\n", 
+				mdname(mddev));
 			goto out_free_conf;
 		}
 	}
 	printk(KERN_INFO 
-		"raid1: raid set md%d active with %d out of %d mirrors\n",
-		mdidx(mddev), mddev->raid_disks - mddev->degraded, 
+		"raid1: raid set %s active with %d out of %d mirrors\n",
+		mdname(mddev), mddev->raid_disks - mddev->degraded, 
 		mddev->raid_disks);
 	/*
 	 * Ok, everything is just fine now
--- diff/drivers/md/raid5.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/md/raid5.c	2004-02-09 10:39:52.000000000 +0000
@@ -1326,6 +1326,14 @@
 	sector_t logical_sector, last_sector;
 	struct stripe_head *sh;
 
+	if (bio_data_dir(bi)==WRITE) {
+		disk_stat_inc(mddev->gendisk, writes);
+		disk_stat_add(mddev->gendisk, write_sectors, bio_sectors(bi));
+	} else {
+		disk_stat_inc(mddev->gendisk, reads);
+		disk_stat_add(mddev->gendisk, read_sectors, bio_sectors(bi));
+	}
+
 	logical_sector = bi->bi_sector & ~(STRIPE_SECTORS-1);
 	last_sector = bi->bi_sector + (bi->bi_size>>9);
 
@@ -1477,7 +1485,7 @@
 	struct list_head *tmp;
 
 	if (mddev->level != 5 && mddev->level != 4) {
-		printk("raid5: md%d: raid level not set to 4/5 (%d)\n", mdidx(mddev), mddev->level);
+		printk("raid5: %s: raid level not set to 4/5 (%d)\n", mdname(mddev), mddev->level);
 		return -EIO;
 	}
 
@@ -1503,7 +1511,7 @@
 
 	mddev->queue->unplug_fn = raid5_unplug_device;
 
-	PRINTK("raid5: run(md%d) called.\n", mdidx(mddev));
+	PRINTK("raid5: run(%s) called.\n", mdname(mddev));
 
 	ITERATE_RDEV(mddev,rdev,tmp) {
 		raid_disk = rdev->raid_disk;
@@ -1535,37 +1543,37 @@
 	conf->max_nr_stripes = NR_STRIPES;
 
 	if (!conf->chunk_size || conf->chunk_size % 4) {
-		printk(KERN_ERR "raid5: invalid chunk size %d for md%d\n",
-			conf->chunk_size, mdidx(mddev));
+		printk(KERN_ERR "raid5: invalid chunk size %d for %s\n",
+			conf->chunk_size, mdname(mddev));
 		goto abort;
 	}
 	if (conf->algorithm > ALGORITHM_RIGHT_SYMMETRIC) {
 		printk(KERN_ERR 
-			"raid5: unsupported parity algorithm %d for md%d\n",
-			conf->algorithm, mdidx(mddev));
+			"raid5: unsupported parity algorithm %d for %s\n",
+			conf->algorithm, mdname(mddev));
 		goto abort;
 	}
 	if (mddev->degraded > 1) {
-		printk(KERN_ERR "raid5: not enough operational devices for md%d"
+		printk(KERN_ERR "raid5: not enough operational devices for %s"
 			" (%d/%d failed)\n",
-			mdidx(mddev), conf->failed_disks, conf->raid_disks);
+			mdname(mddev), conf->failed_disks, conf->raid_disks);
 		goto abort;
 	}
 
 	if (mddev->degraded == 1 &&
 	    mddev->recovery_cp != MaxSector) {
 		printk(KERN_ERR 
-			"raid5: cannot start dirty degraded array for md%d\n",
-			mdidx(mddev));
+			"raid5: cannot start dirty degraded array for %s\n",
+			mdname(mddev));
 		goto abort;
 	}
 
 	{
-		mddev->thread = md_register_thread(raid5d, mddev, "md%d_raid5");
+		mddev->thread = md_register_thread(raid5d, mddev, "%s_raid5");
 		if (!mddev->thread) {
 			printk(KERN_ERR 
-				"raid5: couldn't allocate thread for md%d\n",
-				mdidx(mddev));
+				"raid5: couldn't allocate thread for %s\n",
+				mdname(mddev));
 			goto abort;
 		}
 	}
@@ -1578,18 +1586,18 @@
 		md_unregister_thread(mddev->thread);
 		goto abort;
 	} else
-		printk(KERN_INFO "raid5: allocated %dkB for md%d\n",
-			memory, mdidx(mddev));
+		printk(KERN_INFO "raid5: allocated %dkB for %s\n",
+			memory, mdname(mddev));
 
 	if (mddev->degraded == 0)
-		printk("raid5: raid level %d set md%d active with %d out of %d"
-			" devices, algorithm %d\n", conf->level, mdidx(mddev), 
+		printk("raid5: raid level %d set %s active with %d out of %d"
+			" devices, algorithm %d\n", conf->level, mdname(mddev), 
 			mddev->raid_disks-mddev->degraded, mddev->raid_disks,
 			conf->algorithm);
 	else
-		printk(KERN_ALERT "raid5: raid level %d set md%d active with %d"
+		printk(KERN_ALERT "raid5: raid level %d set %s active with %d"
 			" out of %d devices, algorithm %d\n", conf->level,
-			mdidx(mddev), mddev->raid_disks - mddev->degraded,
+			mdname(mddev), mddev->raid_disks - mddev->degraded,
 			mddev->raid_disks, conf->algorithm);
 
 	print_raid5_conf(conf);
@@ -1616,7 +1624,7 @@
 		kfree(conf);
 	}
 	mddev->private = NULL;
-	printk(KERN_ALERT "raid5: failed to run raid set md%d\n", mdidx(mddev));
+	printk(KERN_ALERT "raid5: failed to run raid set %s\n", mdname(mddev));
 	return -EIO;
 }
 
--- diff/drivers/md/raid6main.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/md/raid6main.c	2004-02-09 10:39:52.000000000 +0000
@@ -1488,6 +1488,14 @@
 	sector_t logical_sector, last_sector;
 	struct stripe_head *sh;
 
+	if (bio_data_dir(bi)==WRITE) {
+		disk_stat_inc(mddev->gendisk, writes);
+		disk_stat_add(mddev->gendisk, write_sectors, bio_sectors(bi));
+	} else {
+		disk_stat_inc(mddev->gendisk, reads);
+		disk_stat_add(mddev->gendisk, read_sectors, bio_sectors(bi));
+	}
+
 	logical_sector = bi->bi_sector & ~(STRIPE_SECTORS-1);
 	last_sector = bi->bi_sector + (bi->bi_size>>9);
 
@@ -1639,7 +1647,7 @@
 	struct list_head *tmp;
 
 	if (mddev->level != 6) {
-		PRINTK("raid6: md%d: raid level not set to 6 (%d)\n", mdidx(mddev), mddev->level);
+		PRINTK("raid6: %s: raid level not set to 6 (%d)\n", mdname(mddev), mddev->level);
 		return -EIO;
 	}
 
@@ -1665,7 +1673,7 @@
 
 	mddev->queue->unplug_fn = raid6_unplug_device;
 
-	PRINTK("raid6: run(md%d) called.\n", mdidx(mddev));
+	PRINTK("raid6: run(%s) called.\n", mdname(mddev));
 
 	ITERATE_RDEV(mddev,rdev,tmp) {
 		raid_disk = rdev->raid_disk;
@@ -1698,42 +1706,42 @@
 	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);
+		printk(KERN_ERR "raid6: not enough configured devices for %s (%d, minimum 4)\n",
+		       mdname(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));
+		printk(KERN_ERR "raid6: invalid chunk size %d for %s\n",
+		       conf->chunk_size, mdname(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));
+		       "raid6: unsupported parity algorithm %d for %s\n",
+		       conf->algorithm, mdname(mddev));
 		goto abort;
 	}
 	if (mddev->degraded > 2) {
-		printk(KERN_ERR "raid6: not enough operational devices for md%d"
+		printk(KERN_ERR "raid6: not enough operational devices for %s"
 		       " (%d/%d failed)\n",
-		       mdidx(mddev), conf->failed_disks, conf->raid_disks);
+		       mdname(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));
+		printk(KERN_ERR "raid6: cannot start dirty degraded array for %s\n", mdname(mddev));
 		goto abort;
 	}
 #endif
 
 	{
-		mddev->thread = md_register_thread(raid6d, mddev, "md%d_raid6");
+		mddev->thread = md_register_thread(raid6d, mddev, "%s_raid6");
 		if (!mddev->thread) {
 			printk(KERN_ERR
-			       "raid6: couldn't allocate thread for md%d\n",
-			       mdidx(mddev));
+			       "raid6: couldn't allocate thread for %s\n",
+			       mdname(mddev));
 			goto abort;
 		}
 	}
@@ -1747,18 +1755,18 @@
 		md_unregister_thread(mddev->thread);
 		goto abort;
 	} else
-		printk(KERN_INFO "raid6: allocated %dkB for md%d\n",
-		       memory, mdidx(mddev));
+		printk(KERN_INFO "raid6: allocated %dkB for %s\n",
+		       memory, mdname(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),
+		printk(KERN_INFO "raid6: raid level %d set %s active with %d out of %d"
+		       " devices, algorithm %d\n", conf->level, mdname(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"
+		printk(KERN_ALERT "raid6: raid level %d set %s active with %d"
 		       " out of %d devices, algorithm %d\n", conf->level,
-		       mdidx(mddev), mddev->raid_disks - mddev->degraded,
+		       mdname(mddev), mddev->raid_disks - mddev->degraded,
 		       mddev->raid_disks, conf->algorithm);
 
 	print_raid6_conf(conf);
@@ -1785,7 +1793,7 @@
 		kfree(conf);
 	}
 	mddev->private = NULL;
-	printk(KERN_ALERT "raid6: failed to run raid set md%d\n", mdidx(mddev));
+	printk(KERN_ALERT "raid6: failed to run raid set %s\n", mdname(mddev));
 	return -EIO;
 }
 
--- diff/drivers/md/raid6x86.h	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/md/raid6x86.h	2004-02-09 10:39:52.000000000 +0000
@@ -1,4 +1,3 @@
-#ident "$Id: raid6x86.h,v 1.3 2002/12/12 22:41:27 hpa Exp $"
 /* ----------------------------------------------------------------------- *
  *
  *   Copyright 2002-2004 H. Peter Anvin - All Rights Reserved
--- diff/drivers/media/dvb/Kconfig	2004-01-19 10:22:57.000000000 +0000
+++ source/drivers/media/dvb/Kconfig	2004-02-09 10:39:52.000000000 +0000
@@ -18,11 +18,12 @@
 	  Please report problems regarding this driver to the LinuxDVB 
 	  mailing list.
 
-	  You might want add the following lines to your /etc/modules.conf:
+	  You might want add the following lines to your /etc/modprobe.conf:
 	  	
 	  	alias char-major-250 dvb
 	  	alias dvb dvb-ttpci
-	  	below dvb-ttpci alps_bsru6 alps_bsrv2 \
+	  	install dvb-ttpci /sbin/modprobe --first-time -i dvb-ttpci && \
+			/sbin/modprobe -a alps_bsru6 alps_bsrv2 \
 	  			grundig_29504-401 grundig_29504-491 \
 	  			ves1820
 
--- diff/drivers/media/dvb/dvb-core/dvb_net.c	2003-10-09 09:47:34.000000000 +0100
+++ source/drivers/media/dvb/dvb-core/dvb_net.c	2004-02-09 10:39:52.000000000 +0000
@@ -523,7 +523,8 @@
         net->base_addr = pid;
                 
 	if ((result = register_netdev(net)) < 0) {
-		kfree(net);
+		dvbnet->device[if_num] = NULL;
+		free_netdev(net);
 		return result;
 	}
 
@@ -545,6 +546,7 @@
 	flush_scheduled_work();
         unregister_netdev(net);
 	dvbnet->state[num]=0;
+	dvbnet->device[num] = NULL;
 	free_netdev(net);
 
 	return 0;
--- diff/drivers/media/dvb/frontends/dst.c	2004-01-19 10:22:57.000000000 +0000
+++ source/drivers/media/dvb/frontends/dst.c	2004-02-09 10:39:52.000000000 +0000
@@ -28,8 +28,8 @@
 #include <linux/string.h>
 #include <linux/slab.h>
 #include <linux/vmalloc.h>
+#include <linux/delay.h>
 #include <asm/div64.h>
-#include <asm/delay.h>
 
 #include "dvb_frontend.h"
 #include "dvb_functions.h"
--- diff/drivers/media/dvb/frontends/ves1820.c	2004-01-19 10:22:57.000000000 +0000
+++ source/drivers/media/dvb/frontends/ves1820.c	2004-02-09 10:39:52.000000000 +0000
@@ -48,23 +48,31 @@
  */
 
 #define SET_PWM(data,pwm) do { 		\
-	(long) data &= ~0xff; 		\
-	(long) data |= pwm; 		\
+	long d = (long)data;		\
+	d &= ~0xff; 			\
+	d |= pwm; 			\
+	data = (void *)d;		\
 } while (0)
 
 #define SET_REG0(data,reg0) do {	\
-	(long) data &= ~(0xff << 8); 	\
-	(long) data |= reg0 << 8; 	\
+	long d = (long)data;		\
+	d &= ~(0xff << 8); 		\
+	d |= reg0 << 8; 		\
+	data = (void *)d;		\
 } while (0)
 
 #define SET_TUNER(data,type) do {	\
-	(long) data &= ~(0xff << 16); 	\
-	(long) data |= type << 16;	\
+	long d = (long)data;		\
+	d &= ~(0xff << 16); 		\
+	d |= type << 16;		\
+	data = (void *)d;		\
 } while (0)
 
 #define SET_DEMOD_ADDR(data,type) do {	\
-	(long) data &= ~(0xff << 24); 	\
-	(long) data |= type << 24;	\
+	long d = (long)data;		\
+	d &= ~(0xff << 24); 		\
+	d |= type << 24;		\
+	data = (void *)d;		\
 } while (0)
 
 #define GET_PWM(data) ((u8) ((long) data & 0xff))
--- diff/drivers/media/dvb/ttusb-dec/ttusb_dec.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/media/dvb/ttusb-dec/ttusb_dec.c	2004-02-09 10:39:52.000000000 +0000
@@ -204,12 +204,23 @@
 				  int *result_length, u8 cmd_result[])
 {
 	int result, actual_len, i;
-	u8 b[COMMAND_PACKET_SIZE + 4];
-	u8 c[COMMAND_PACKET_SIZE + 4];
+	u8 *b;
+	u8 *c;
+	
+	b = kmalloc(COMMAND_PACKET_SIZE + 4, GFP_KERNEL);
+	if (!b)
+		return -ENOMEM;
+	c = kmalloc(COMMAND_PACKET_SIZE + 4, GFP_KERNEL);
+	if (!c) {
+		kfree(b);
+		return -ENOMEM;
+	}
 
 	dprintk("%s\n", __FUNCTION__);
 
 	if ((result = down_interruptible(&dec->usb_sem))) {
+		kfree(b);
+		kfree(c);
 		printk("%s: Failed to down usb semaphore.\n", __FUNCTION__);
 		return result;
 	}
@@ -230,22 +241,26 @@
 	}
 
 	result = usb_bulk_msg(dec->udev, dec->command_pipe, b,
-			      sizeof(b), &actual_len, HZ);
+			      COMMAND_PACKET_SIZE + 4, &actual_len, HZ);
 
 	if (result) {
 		printk("%s: command bulk message failed: error %d\n",
 		       __FUNCTION__, result);
 		up(&dec->usb_sem);
+		kfree(b);
+		kfree(c);
 		return result;
 	}
 
 	result = usb_bulk_msg(dec->udev, dec->result_pipe, c,
-			      sizeof(c), &actual_len, HZ);
+			      COMMAND_PACKET_SIZE + 4, &actual_len, HZ);
 
 	if (result) {
 		printk("%s: result bulk message failed: error %d\n",
 		       __FUNCTION__, result);
 		up(&dec->usb_sem);
+		kfree(b);
+		kfree(c);
 		return result;
 	} else {
 		if (debug) {
@@ -262,6 +277,8 @@
 
 		up(&dec->usb_sem);
 
+		kfree(b);
+		kfree(c);
 		return 0;
 	}
 }
--- diff/drivers/media/video/bw-qcam.c	2003-10-09 09:47:34.000000000 +0100
+++ source/drivers/media/video/bw-qcam.c	2004-02-09 10:39:52.000000000 +0000
@@ -958,45 +958,64 @@
 MODULE_PARM(parport, "1-" __MODULE_STRING(MAX_CAMS) "s");
 #endif
 
-static void __exit exit_bw_qcams(void)
-{
-	unsigned int i;
-
-	for (i = 0; i < num_cams; i++)
-		close_bwqcam(qcams[i]);
-}
-
-static int __init init_bw_qcams(void)
+static int accept_bwqcam(struct parport *port)
 {
-	struct parport *port;
 #ifdef MODULE
 	int n;
-	
-	if(parport[0] && strncmp(parport[0], "auto", 4)){
+
+	if (parport[0] && strncmp(parport[0], "auto", 4) != 0) {
 		/* user gave parport parameters */
 		for(n=0; parport[n] && n<MAX_CAMS; n++){
 			char *ep;
 			unsigned long r;
 			r = simple_strtoul(parport[n], &ep, 0);
-			if(ep == parport[n]){
+			if (ep == parport[n]) {
 				printk(KERN_ERR
 					"bw-qcam: bad port specifier \"%s\"\n",
 					parport[n]);
 				continue;
 			}
-			for (port=parport_enumerate(); port; port=port->next){
-				if(r!=port->number)
-					continue;
-				init_bwqcam(port);
-				break;
-			}
+			if (r == port->number)
+				return 1;
 		}
-		return (num_cams)?0:-ENODEV;
-	} 
-	/* no parameter or "auto" */
-	for (port = parport_enumerate(); port; port=port->next)
+		return 0;
+	}
+#endif
+	return 1;
+}
+
+static void bwqcam_attach(struct parport *port)
+{
+	if (accept_bwqcam(port))
 		init_bwqcam(port);
+}
 
+static void bwqcam_detach(struct parport *port)
+{
+	int i;
+	for (i = 0; i < num_cams; i++) {
+		struct qcam_device *qcam = qcams[i];
+		if (qcam && qcam->pdev->port == port) {
+			qcams[i] = NULL;
+			close_bwqcam(qcam);
+		}
+	}
+}
+
+static struct parport_driver bwqcam_driver = {
+	.name	= "bw-qcam",
+	.attach	= bwqcam_attach,
+	.detach	= bwqcam_detach,
+};
+
+static void __exit exit_bw_qcams(void)
+{
+	parport_unregister_driver(&bwqcam_driver);
+}
+
+static int __init init_bw_qcams(void)
+{
+#ifdef MODULE
 	/* Do some sanity checks on the module parameters. */
 	if (maxpoll > 5000) {
 		printk("Connectix Quickcam max-poll was above 5000. Using 5000.\n");
@@ -1007,13 +1026,8 @@
 		printk("Connectix Quickcam yieldlines was less than 1. Using 1.\n");
 		yieldlines = 1;
 	}
-
-	return (num_cams)?0:-ENODEV;
-#else
-	for (port = parport_enumerate(); port; port=port->next)
-		init_bwqcam(port);
-	return 0;
 #endif
+	return parport_register_driver(&bwqcam_driver);
 }
 
 module_init(init_bw_qcams);
--- diff/drivers/media/video/dpc7146.c	2003-08-20 14:16:09.000000000 +0100
+++ source/drivers/media/video/dpc7146.c	2004-02-09 10:39:52.000000000 +0000
@@ -131,7 +131,7 @@
 	DEB_D(("dpc_v4l2.o: dpc_probe succeeded for this device.\n"));	
 
 	/* we store the pointer in our private data field */
-	(struct dpc*)dev->ext_priv = dpc;
+	dev->ext_priv = dpc;
 
 	return 0;
 }
--- diff/drivers/media/video/hexium_gemini.c	2003-10-09 09:47:34.000000000 +0100
+++ source/drivers/media/video/hexium_gemini.c	2004-02-09 10:39:52.000000000 +0000
@@ -245,7 +245,7 @@
 		return -ENOMEM;
 	}
 	memset(hexium, 0x0, sizeof(struct hexium));
-	(struct hexium *) dev->ext_priv = hexium;
+	dev->ext_priv = hexium;
 
 	/* enable i2c-port pins */
 	saa7146_write(dev, MC1, (MASK_08 | MASK_24 | MASK_10 | MASK_26));
--- diff/drivers/media/video/hexium_orion.c	2003-10-09 09:47:34.000000000 +0100
+++ source/drivers/media/video/hexium_orion.c	2004-02-09 10:39:52.000000000 +0000
@@ -255,7 +255,7 @@
 	if (0x17c8 == dev->pci->subsystem_vendor && 0x0101 == dev->pci->subsystem_device) {
 		printk("hexium_orion: device is a Hexium Orion w/ 1 SVHS + 3 BNC inputs.\n");
 		/* we store the pointer in our private data field */
-		(struct hexium *) dev->ext_priv = hexium;
+		dev->ext_priv = hexium;
 		hexium->type = HEXIUM_ORION_1SVHS_3BNC;
 		return 0;
 	}
@@ -263,7 +263,7 @@
 	if (0x17c8 == dev->pci->subsystem_vendor && 0x2101 == dev->pci->subsystem_device) {
 		printk("hexium_orion: device is a Hexium Orion w/ 4 BNC inputs.\n");
 		/* we store the pointer in our private data field */
-		(struct hexium *) dev->ext_priv = hexium;
+		dev->ext_priv = hexium;
 		hexium->type = HEXIUM_ORION_4BNC;
 		return 0;
 	}
@@ -273,7 +273,7 @@
 	if (0 == (err = i2c_smbus_xfer(&hexium->i2c_adapter, 0x4e, 0, I2C_SMBUS_READ, 0x00, I2C_SMBUS_BYTE_DATA, &data))) {
 		printk("hexium_orion: device is a Hexium HV-PCI6/Orion (old).\n");
 		/* we store the pointer in our private data field */
-		(struct hexium *) dev->ext_priv = hexium;
+		dev->ext_priv = hexium;
 		hexium->type = HEXIUM_HV_PCI6_ORION;
 		return 0;
 	}
--- diff/drivers/media/video/mxb.c	2003-08-20 14:16:09.000000000 +0100
+++ source/drivers/media/video/mxb.c	2004-02-09 10:39:52.000000000 +0000
@@ -261,7 +261,7 @@
 	/* all devices are present, probe was successful */	
 
 	/* we store the pointer in our private data field */
-	(struct mxb*)dev->ext_priv = mxb;
+	dev->ext_priv = mxb;
 
 	return 0;
 }
--- diff/drivers/media/video/videocodec.c	2003-10-09 09:47:34.000000000 +0100
+++ source/drivers/media/video/videocodec.c	2004-02-09 10:39:52.000000000 +0000
@@ -392,15 +392,15 @@
 	videocodec_buf = (char *) kmalloc(size, GFP_KERNEL);
 
 	i = 0;
-	i += snprintf(videocodec_buf + i, size - 1,
+	i += scnprintf(videocodec_buf + i, size - 1,
 		      "<S>lave or attached <M>aster name  type flags    magic    ");
-	i += snprintf(videocodec_buf + i, size - 1, "(connected as)\n");
+	i += scnprintf(videocodec_buf + i, size -i - 1, "(connected as)\n");
 
 	h = codeclist_top;
 	while (h) {
 		if (i > (size - LINESIZE))
 			break;	// security check
-		i += snprintf(videocodec_buf + i, size,
+		i += scnprintf(videocodec_buf + i, size -i -1,
 			      "S %32s %04x %08lx %08lx (TEMPLATE)\n",
 			      h->codec->name, h->codec->type,
 			      h->codec->flags, h->codec->magic);
@@ -408,7 +408,7 @@
 		while (a) {
 			if (i > (size - LINESIZE))
 				break;	// security check
-			i += snprintf(videocodec_buf + i, size,
+			i += scnprintf(videocodec_buf + i, size -i -1,
 				      "M %32s %04x %08lx %08lx (%s)\n",
 				      a->codec->master_data->name,
 				      a->codec->master_data->type,
--- diff/drivers/message/fusion/mptbase.c	2004-01-19 10:22:57.000000000 +0000
+++ source/drivers/message/fusion/mptbase.c	2004-02-09 10:39:53.000000000 +0000
@@ -167,6 +167,7 @@
 static MPT_EVHANDLER		 MptEvHandlers[MPT_MAX_PROTOCOL_DRIVERS];
 					/* Reset handler lookup table */
 static MPT_RESETHANDLER		 MptResetHandlers[MPT_MAX_PROTOCOL_DRIVERS];
+static struct mpt_pci_driver 	*MptDeviceDriverHandlers[MPT_MAX_PROTOCOL_DRIVERS];
 
 static int	FusionInitCalled = 0;
 static int	mpt_base_index = -1;
@@ -183,7 +184,6 @@
 static int	mpt_base_reply(MPT_ADAPTER *ioc, MPT_FRAME_HDR *req, MPT_FRAME_HDR *reply);
 
 static int	mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag);
-static int	mpt_adapter_install(struct pci_dev *pdev);
 static void	mpt_detect_bound_ports(MPT_ADAPTER *this, struct pci_dev *pdev);
 static void	mpt_adapter_disable(MPT_ADAPTER *ioc, int freeup);
 static void	mpt_adapter_dispose(MPT_ADAPTER *ioc);
@@ -232,8 +232,12 @@
 static void	mpt_fc_log_info(MPT_ADAPTER *ioc, u32 log_info);
 static void	mpt_sp_log_info(MPT_ADAPTER *ioc, u32 log_info);
 
-int		fusion_init(void);
-static void	fusion_exit(void);
+/* module entry point */
+static int  __devinit mptbase_probe (struct pci_dev *, const struct pci_device_id *);
+static void __devexit mptbase_remove(struct pci_dev *);
+static void mptbase_shutdown(struct device * );
+static int  __init    fusion_init  (void);
+static void __exit    fusion_exit  (void);
 
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 /*
@@ -260,6 +264,30 @@
 
 #endif
 
+/****************************************************************************
+ * Supported hardware
+ */
+
+static struct pci_device_id mptbase_pci_table[] = {
+	{ PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC909,
+		PCI_ANY_ID, PCI_ANY_ID },
+	{ PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC929,
+		PCI_ANY_ID, PCI_ANY_ID },
+	{ PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC919,
+		PCI_ANY_ID, PCI_ANY_ID },
+	{ PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC929X,
+		PCI_ANY_ID, PCI_ANY_ID },
+	{ PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC919X,
+		PCI_ANY_ID, PCI_ANY_ID },
+	{ PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_53C1030,
+		PCI_ANY_ID, PCI_ANY_ID },
+	{ PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_1030_53C1035,
+		PCI_ANY_ID, PCI_ANY_ID },
+	{0}	/* Terminating entry */
+};
+MODULE_DEVICE_TABLE(pci, mptbase_pci_table);
+
+
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 /* 20000207 -sralston
  *  GRRRRR...  IOSpace (port i/o) register access (for the 909) is back!
@@ -518,7 +546,7 @@
  *	@mf: Pointer to original MPT request frame
  *	@reply: Pointer to MPT reply frame (NULL if TurboReply)
  *
- *	Returns 1 indicating original alloc'd request frame ptr
+	*	Returns 1 indicating original alloc'd request frame ptr
  *	should be freed, or 0 if it shouldn't.
  */
 static int
@@ -805,6 +833,34 @@
 
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 /**
+ *	mpt_device_driver_register - Register device driver hooks
+ */
+int
+mpt_device_driver_register(struct mpt_pci_driver * dd_cbfunc, int cb_idx)
+{
+	if (cb_idx < 1 || cb_idx >= MPT_MAX_PROTOCOL_DRIVERS)
+		return -1;
+
+	MptDeviceDriverHandlers[cb_idx] = dd_cbfunc;
+	return 0;
+}
+
+/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
+/**
+ *	mpt_device_driver_deregister - DeRegister device driver hooks
+ */
+void
+mpt_device_driver_deregister(int cb_idx)
+{
+	if (cb_idx < 1 || cb_idx >= MPT_MAX_PROTOCOL_DRIVERS)
+		return;
+
+	MptDeviceDriverHandlers[cb_idx] = NULL;
+}
+
+
+/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
+/**
  *	mpt_get_msg_frame - Obtain a MPT request frame from the pool (of 1024)
  *	allocated per MPT adapter.
  *	@handle: Handle of registered MPT protocol driver
@@ -1142,88 +1198,6 @@
 	return next;
 }
 
-/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
-/*
- *	mpt_pci_scan - Scan PCI devices for MPT adapters.
- *
- *	Returns count of MPT adapters found, keying off of PCI vendor and
- *	device_id's.
- */
-static int __init
-mpt_pci_scan(void)
-{
-	struct pci_dev *pdev = NULL;
-	struct pci_dev *pdev2;
-	int found = 0;
-	int count = 0;
-	int r;
-
-	dprintk((KERN_INFO MYNAM ": Checking for MPT adapters...\n"));
-
-	/*
-	 *  NOTE: The 929, 929X, 1030 and 1035 will appear as 2 separate PCI devices,
-	 *  one for each channel.
-	 */
-	while ((pdev = pci_find_device(PCI_VENDOR_ID_LSI_LOGIC, PCI_ANY_ID, pdev)) != NULL) {
-		pdev2 = NULL;
-		if ((pdev->device != MPI_MANUFACTPAGE_DEVICEID_FC909) &&
-		    (pdev->device != MPI_MANUFACTPAGE_DEVICEID_FC929) &&
-		    (pdev->device != MPI_MANUFACTPAGE_DEVICEID_FC919) &&
-		    (pdev->device != MPI_MANUFACTPAGE_DEVICEID_FC929X) &&
-		    (pdev->device != MPI_MANUFACTPAGE_DEVICEID_FC919X) &&
-		    (pdev->device != MPI_MANUFACTPAGE_DEVID_53C1030) &&
-		    (pdev->device != MPI_MANUFACTPAGE_DEVID_1030_53C1035) &&
-		    1) {
-			dprintk((KERN_INFO MYNAM ": Skipping LSI device=%04xh\n", pdev->device));
-			continue;
-		}
-
-		/* GRRRRR
-		 * dual function devices (929, 929X, 1030, 1035) may be presented in Func 1,0 order,
-		 * but we'd really really rather have them in Func 0,1 order.
-		 * Do some kind of look ahead here...
-		 */
-		if (pdev->devfn & 1) {
-			pdev2 = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, pdev);
-			if (pdev2 && (pdev2->vendor == 0x1000) &&
-			    (PCI_SLOT(pdev2->devfn) == PCI_SLOT(pdev->devfn)) &&
-			    (pdev2->device == pdev->device) &&
-			    (pdev2->bus->number == pdev->bus->number) &&
-			    !(pdev2->devfn & 1)) {
-				dprintk((KERN_INFO MYNAM ": MPT adapter found: PCI bus/dfn=%02x/%02xh, class=%08x, id=%xh\n",
-					pdev2->bus->number, pdev2->devfn, pdev2->class, pdev2->device));
-				found++;
-				if ((r = mpt_adapter_install(pdev2)) == 0)
-					count++;
-			} else {
-				pdev2 = NULL;
-			}
-		}
-
-		dprintk((KERN_INFO MYNAM ": MPT adapter found: PCI bus/dfn=%02x/%02xh, class=%08x, id=%xh\n",
-			 pdev->bus->number, pdev->devfn, pdev->class, pdev->device));
-		found++;
-		if ((r = mpt_adapter_install(pdev)) == 0)
-			count++;
-
-		if (pdev2)
-			pdev = pdev2;
-	}
-
-	printk(KERN_INFO MYNAM ": %d MPT adapter%s found, %d installed.\n",
-		 found, (found==1) ? "" : "s", count);
-
-	if (!found || !count) {
-		fusion_exit();
-		return -ENODEV;
-	}
-
-#ifdef CONFIG_PROC_FS
-	(void) procmpt_create();
-#endif
-
-	return count;
-}
 
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 /**
@@ -1253,7 +1227,7 @@
 
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 /*
- *	mpt_adapter_install - Install a PCI intelligent MPT adapter.
+ *	mptbase_probe - Install a PCI intelligent MPT adapter.
  *	@pdev: Pointer to pci_dev structure
  *
  *	This routine performs all the steps necessary to bring the IOC of
@@ -1268,8 +1242,8 @@
  *
  *	TODO: Add support for polled controllers
  */
-static int __init
-mpt_adapter_install(struct pci_dev *pdev)
+static int __devinit
+mptbase_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 {
 	MPT_ADAPTER	*ioc;
 	u8		*mem;
@@ -1292,6 +1266,13 @@
 		return r;
 	}
 
+	if (!pci_set_consistent_dma_mask(pdev, mask))
+		dprintk((KERN_INFO MYNAM
+			": Using 64 bit consistent mask\n"));
+	else
+		dprintk((KERN_INFO MYNAM
+			": Not using 64 bit consistent mask\n"));
+
 	ioc = kmalloc(sizeof(MPT_ADAPTER), GFP_ATOMIC);
 	if (ioc == NULL) {
 		printk(KERN_ERR MYNAM ": ERROR - Insufficient memory to add adapter!\n");
@@ -1500,6 +1481,7 @@
 		ioc->pci_irq = pdev->irq;
 
 		pci_set_master(pdev);			/* ?? */
+		pci_set_drvdata(pdev, ioc);
 
 #ifndef __sparc__
 		dprintk((KERN_INFO MYNAM ": %s installed at interrupt %d\n", ioc->name, pdev->irq));
@@ -1520,11 +1502,209 @@
 				ioc->name, r);
 	}
 
-	return r;
+	if(r != 0 )
+		return r;
+
+
+	/* call per device driver probe entry point */
+	for(ii=0; ii<MPT_MAX_PROTOCOL_DRIVERS; ii++) {
+		if(MptDeviceDriverHandlers[ii] &&
+		  MptDeviceDriverHandlers[ii]->probe) {
+			MptDeviceDriverHandlers[ii]->probe(pdev,id);
+		}
+	}
+
+	return 0;
+}
+
+/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
+/*
+ *	mptbase_remove - Remove a PCI intelligent MPT adapter.
+ *	@pdev: Pointer to pci_dev structure
+ *
+ */
+
+static void __devexit
+mptbase_remove(struct pci_dev *pdev)
+{
+	MPT_ADAPTER 	*ioc = pci_get_drvdata(pdev);
+	int ii;
+
+	/* call per device driver remove entry point */
+	for(ii=0; ii<MPT_MAX_PROTOCOL_DRIVERS; ii++) {
+		if(MptDeviceDriverHandlers[ii] &&
+		  MptDeviceDriverHandlers[ii]->remove) {
+			MptDeviceDriverHandlers[ii]->remove(pdev);
+		}
+	}
+
+	/* Disable interrupts! */
+	CHIPREG_WRITE32(&ioc->chip->IntMask, 0xFFFFFFFF);
+
+	ioc->active = 0;
+
+	/* Clear any lingering interrupt */
+	CHIPREG_WRITE32(&ioc->chip->IntStatus, 0);
+
+	CHIPREG_READ32(&ioc->chip->IntStatus);
+
+	Q_DEL_ITEM(ioc);
+	mpt_adapter_dispose(ioc);
+
+	mptscsih_sync_irq(pdev->irq);
+	pci_set_drvdata(pdev, NULL);
 }
 
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 /*
+ *	mptbase_shutdown -
+ *
+ */
+static void
+mptbase_shutdown(struct device * dev)
+{
+	int ii;
+
+	/* call per device driver shutdown entry point */
+	for(ii=0; ii<MPT_MAX_PROTOCOL_DRIVERS; ii++) {
+		if(MptDeviceDriverHandlers[ii] &&
+		  MptDeviceDriverHandlers[ii]->shutdown) {
+			MptDeviceDriverHandlers[ii]->shutdown(dev);
+		}
+	}
+
+}
+
+
+/**************************************************************************
+ * Power Management
+ */
+#ifdef CONFIG_PM
+/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
+/*
+ *	mptbase_suspend - Fusion MPT base driver suspend routine.
+ *
+ *
+ */
+static int
+mptbase_suspend(struct pci_dev *pdev, u32 state)
+{
+	u32 device_state;
+	MPT_ADAPTER *ioc = pci_get_drvdata(pdev);
+	int ii;
+
+	switch(state)
+	{
+		case 1: /* S1 */
+			device_state=1; /* D1 */;
+			break;
+		case 3: /* S3 */
+		case 4: /* S4 */
+			device_state=3; /* D3 */;
+			break;
+		default:
+			return -EAGAIN /*FIXME*/;
+			break;
+	}
+
+	printk(MYIOC_s_INFO_FMT
+	"pci-suspend: pdev=0x%p, slot=%s, Entering operating state [D%d]\n",
+		ioc->name, pdev, pci_name(pdev), device_state);
+
+	/* call per device driver suspend entry point */
+	for(ii=0; ii<MPT_MAX_PROTOCOL_DRIVERS; ii++) {
+		if(MptDeviceDriverHandlers[ii] &&
+		  MptDeviceDriverHandlers[ii]->suspend) {
+			MptDeviceDriverHandlers[ii]->suspend(pdev, state);
+		}
+	}
+
+	pci_save_state(pdev, ioc->PciState);
+
+	/* put ioc into READY_STATE */
+	if(SendIocReset(ioc, MPI_FUNCTION_IOC_MESSAGE_UNIT_RESET, CAN_SLEEP)) {
+		printk(MYIOC_s_ERR_FMT
+		"pci-suspend:  IOC msg unit reset failed!\n", ioc->name);
+	}
+
+	/* disable interrupts */
+	CHIPREG_WRITE32(&ioc->chip->IntMask, 0xFFFFFFFF);
+	ioc->active = 0;
+
+	/* Clear any lingering interrupt */
+	CHIPREG_WRITE32(&ioc->chip->IntStatus, 0);
+
+	pci_disable_device(pdev);
+	pci_set_power_state(pdev, device_state);
+
+	return 0;
+}
+
+/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
+/*
+ *	mptbase_resume - Fusion MPT base driver resume routine.
+ *
+ *
+ */
+static int
+mptbase_resume(struct pci_dev *pdev)
+{
+	MPT_ADAPTER *ioc = pci_get_drvdata(pdev);
+	u32 device_state = pdev->current_state;
+	int recovery_state;
+	int ii;
+
+	printk(MYIOC_s_INFO_FMT
+	"pci-resume: pdev=0x%p, slot=%s, Previous operating state [D%d]\n",
+		ioc->name, pdev, pci_name(pdev), device_state);
+
+	pci_set_power_state(pdev, 0);
+	pci_restore_state(pdev, ioc->PciState);
+	pci_enable_device(pdev);
+
+	/* enable interrupts */
+	CHIPREG_WRITE32(&ioc->chip->IntMask, ~(MPI_HIM_RIM));
+	ioc->active = 1;
+
+	/* F/W not running */
+	if(!CHIPREG_READ32(&ioc->chip->Doorbell)) {
+		/* enable domain validation flags */
+		for (ii=0; ii < MPT_MAX_SCSI_DEVICES; ii++) {
+			ioc->spi_data.dvStatus[ii] |= MPT_SCSICFG_NEED_DV;
+		}
+	}
+
+	printk(MYIOC_s_INFO_FMT
+		"pci-resume: ioc-state=0x%x,doorbell=0x%x\n",
+		ioc->name,
+		(mpt_GetIocState(ioc, 1) >> MPI_IOC_STATE_SHIFT),
+		CHIPREG_READ32(&ioc->chip->Doorbell));
+
+	/* bring ioc to operational state */
+	if ((recovery_state = mpt_do_ioc_recovery(ioc,
+	    MPT_HOSTEVENT_IOC_RECOVER, CAN_SLEEP)) != 0) {
+		printk(MYIOC_s_INFO_FMT
+			"pci-resume: Cannot recover, error:[%x]\n",
+			ioc->name, recovery_state);
+	} else {
+		printk(MYIOC_s_INFO_FMT
+			"pci-resume: success\n", ioc->name);
+	}
+
+	/* call per device driver resume entry point */
+	for(ii=0; ii<MPT_MAX_PROTOCOL_DRIVERS; ii++) {
+		if(MptDeviceDriverHandlers[ii] &&
+		  MptDeviceDriverHandlers[ii]->resume) {
+			MptDeviceDriverHandlers[ii]->resume(pdev);
+		}
+	}
+
+	return 0;
+}
+#endif
+
+/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
+/*
  *	mpt_do_ioc_recovery - Initialize or recover MPT adapter.
  *	@ioc: Pointer to MPT adapter structure
  *	@reason: Event word / reason
@@ -5851,6 +6031,8 @@
 EXPORT_SYMBOL(mpt_event_deregister);
 EXPORT_SYMBOL(mpt_reset_register);
 EXPORT_SYMBOL(mpt_reset_deregister);
+EXPORT_SYMBOL(mpt_device_driver_register);
+EXPORT_SYMBOL(mpt_device_driver_deregister);
 EXPORT_SYMBOL(mpt_get_msg_frame);
 EXPORT_SYMBOL(mpt_put_msg_frame);
 EXPORT_SYMBOL(mpt_free_msg_frame);
@@ -5877,16 +6059,32 @@
 EXPORT_SYMBOL(mpt_ASCQ_TableSz);
 EXPORT_SYMBOL(mpt_ScsiOpcodesPtr);
 
+
+static struct pci_driver mptbase_driver = {
+	.name		= "mptbase",
+	.id_table	= mptbase_pci_table,
+	.probe		= mptbase_probe,
+	.remove		= __devexit_p(mptbase_remove),
+	.driver         = {
+		.shutdown = mptbase_shutdown,
+        },
+#ifdef CONFIG_PM
+	.suspend	= mptbase_suspend,
+	.resume		= mptbase_resume,
+#endif
+};
+
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 /*
  *	fusion_init - Fusion MPT base driver initialization routine.
  *
  *	Returns 0 for success, non-zero for failure.
  */
-int __init
+static int __init
 fusion_init(void)
 {
 	int i;
+	int r;
 
 	if (FusionInitCalled++) {
 		dprintk((KERN_INFO MYNAM ": INFO - Driver late-init entry point called\n"));
@@ -5920,10 +6118,15 @@
 		/* FIXME! */
 	}
 
-	if ((i = mpt_pci_scan()) < 0)
-		return i;
+	r = pci_module_init(&mptbase_driver);
+	if(r)
+		return(r);
 
-	return 0;
+#ifdef CONFIG_PROC_FS
+	(void) procmpt_create();
+#endif
+
+	return r;
 }
 
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
@@ -5933,13 +6136,12 @@
  *	This routine frees all resources associated with each MPT adapter
  *	and removes all %MPT_PROCFS_MPTBASEDIR entries.
  */
-static void
+static void __exit
 fusion_exit(void)
 {
-	MPT_ADAPTER *this;
-	struct pci_dev *pdev = NULL;
 
 	dprintk((KERN_INFO MYNAM ": fusion_exit() called!\n"));
+	pci_unregister_driver(&mptbase_driver);
 
 	/* Whups?  20010120 -sralston
 	 *  Moved this *above* removal of all MptAdapters!
@@ -5948,30 +6150,9 @@
 	(void) procmpt_destroy();
 #endif
 
-	while (! Q_IS_EMPTY(&MptAdapters)) {
-		this = MptAdapters.head;
-
-		/* Disable interrupts! */
-		CHIPREG_WRITE32(&this->chip->IntMask, 0xFFFFFFFF);
-
-		this->active = 0;
-
-		pdev = (struct pci_dev *)this->pcidev;
-		mptscsih_sync_irq(pdev->irq);
-
-		/* Clear any lingering interrupt */
-		CHIPREG_WRITE32(&this->chip->IntStatus, 0);
-
-		CHIPREG_READ32(&this->chip->IntStatus);
-
-		Q_DEL_ITEM(this);
-		mpt_adapter_dispose(this);
-	}
-
 	mpt_reset_deregister(mpt_base_index);
 }
 
-/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 
 module_init(fusion_init);
 module_exit(fusion_exit);
--- diff/drivers/message/fusion/mptbase.h	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/message/fusion/mptbase.h	2004-02-09 10:39:53.000000000 +0000
@@ -80,8 +80,8 @@
 #define COPYRIGHT	"Copyright (c) 1999-2003 " MODULEAUTHOR
 #endif
 
-#define MPT_LINUX_VERSION_COMMON	"2.05.00.06"
-#define MPT_LINUX_PACKAGE_NAME		"@(#)mptlinux-2.05.00.06"
+#define MPT_LINUX_VERSION_COMMON	"3.00.02"
+#define MPT_LINUX_PACKAGE_NAME		"@(#)mptlinux-3.00.02"
 #define WHAT_MAGIC_STRING		"@" "(" "#" ")"
 
 #define show_mptmod_ver(s,ver)  \
@@ -180,6 +180,16 @@
 	MPTUNKNOWN_DRIVER
 } MPT_DRIVER_CLASS;
 
+struct mpt_pci_driver{
+	int  (*probe) (struct pci_dev *dev, const struct pci_device_id *id);
+	void (*remove) (struct pci_dev *dev);
+	void (*shutdown) (struct device * dev);
+#ifdef CONFIG_PM
+	int  (*suspend) (struct pci_dev *dev, u32 state);
+	int  (*resume) (struct pci_dev *dev);
+#endif
+};
+
 /*
  *  MPT adapter / port / bus / device info structures...
  */
@@ -629,6 +639,9 @@
 	FCPortPage0_t		 fc_port_page0[2];
 	LANPage0_t		 lan_cnfg_page0;
 	LANPage1_t		 lan_cnfg_page1;
+#ifdef CONFIG_PM
+	u32           		 PciState[64];     /* save PCI state to this area */
+#endif
 	u8			 FirstWhoInit;
 	u8			 upload_fw;	/* If set, do a fw upload */
 	u8			 reload_fw;	/* Force a FW Reload on next reset */
@@ -1001,6 +1014,8 @@
 extern void	 mpt_event_deregister(int cb_idx);
 extern int	 mpt_reset_register(int cb_idx, MPT_RESETHANDLER reset_func);
 extern void	 mpt_reset_deregister(int cb_idx);
+extern int	 mpt_device_driver_register(struct mpt_pci_driver * dd_cbfunc, int cb_idx);
+extern void	 mpt_device_driver_deregister(int cb_idx);
 extern int	 mpt_register_ascqops_strings(void *ascqTable, int ascqtbl_sz, const char **opsTable);
 extern void	 mpt_deregister_ascqops_strings(void);
 extern MPT_FRAME_HDR	*mpt_get_msg_frame(int handle, int iocid);
--- diff/drivers/message/fusion/mptlan.c	2004-01-19 10:22:57.000000000 +0000
+++ source/drivers/message/fusion/mptlan.c	2004-02-09 10:39:53.000000000 +0000
@@ -1437,7 +1437,7 @@
 	SET_MODULE_OWNER(dev);
 
 	if (register_netdev(dev) != 0) {
-		kfree(dev);
+		free_netdev(dev);
 		dev = NULL;
 	}
 	return dev;
--- diff/drivers/message/fusion/mptscsih.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/message/fusion/mptscsih.c	2004-02-09 10:39:53.000000000 +0000
@@ -75,7 +75,8 @@
 #include <linux/interrupt.h>	/* needed for in_interrupt() proto */
 #include <linux/reboot.h>	/* notifier code */
 #include "../../scsi/scsi.h"
-#include "../../scsi/hosts.h"
+#include <scsi/scsi_host.h>
+
 
 #include "mptbase.h"
 #include "mptscsih.h"
@@ -164,8 +165,8 @@
 static MPT_FRAME_HDR *mptscsih_search_pendingQ(MPT_SCSI_HOST *hd, int scpnt_idx);
 static void	post_pendingQ_commands(MPT_SCSI_HOST *hd);
 
-static int	mptscsih_TMHandler(MPT_SCSI_HOST *hd, u8 type, u8 target, u8 lun, int ctx2abort, int sleepFlag);
-static int	mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8 type, u8 target, u8 lun, int ctx2abort, int sleepFlag);
+static int	mptscsih_TMHandler(MPT_SCSI_HOST *hd, u8 type, u8 target, u8 lun, int ctx2abort, ulong timeout, int sleepFlag);
+static int	mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8 type, u8 target, u8 lun, int ctx2abort, ulong timeout, int sleepFlag);
 
 static int	mptscsih_ioc_reset(MPT_ADAPTER *ioc, int post_reset);
 static int	mptscsih_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply);
@@ -184,7 +185,7 @@
 
 static struct mpt_work_struct   mptscsih_rstTask;
 
-#ifndef MPTSCSIH_DISABLE_DOMAIN_VALIDATION
+#ifdef MPTSCSIH_ENABLE_DOMAIN_VALIDATION
 static int	mptscsih_do_raid(MPT_SCSI_HOST *hd, u8 action, INTERNAL_CMD *io);
 static void	mptscsih_domainValidation(void *hd);
 static int	mptscsih_is_phys_disk(MPT_ADAPTER *ioc, int id);
@@ -194,14 +195,19 @@
 static void	mptscsih_fillbuf(char *buffer, int size, int index, int width);
 #endif
 static int	mptscsih_setup(char *str);
-static int	mptscsih_halt(struct notifier_block *nb, ulong event, void *buf);
 
-/*
- *	Reboot Notification
- */
-static struct notifier_block mptscsih_notifier = {
-	mptscsih_halt, NULL, 0
-};
+/* module entry point */
+static int  __init    mptscsih_init  (void);
+static void __exit    mptscsih_exit  (void);
+
+static int  __devinit mptscsih_probe (struct pci_dev *, const struct pci_device_id *);
+static void __devexit mptscsih_remove(struct pci_dev *);
+static void mptscsih_shutdown(struct device *);
+#ifdef CONFIG_PM
+static int mptscsih_suspend(struct pci_dev *pdev, u32 state);
+static int mptscsih_resume(struct pci_dev *pdev);
+#endif
+
 
 /*
  *	Private data...
@@ -216,7 +222,7 @@
 
 #define SNS_LEN(scp)	sizeof((scp)->sense_buffer)
 
-#ifndef MPTSCSIH_DISABLE_DOMAIN_VALIDATION
+#ifdef MPTSCSIH_ENABLE_DOMAIN_VALIDATION
 /*
  * Domain Validation task structure
  */
@@ -238,6 +244,32 @@
 	driver_setup = MPTSCSIH_DRIVER_SETUP;
 
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
+
+/* see mptscsih.h */
+
+static struct scsi_host_template driver_template = {
+	.proc_name			= "mptscsih",
+	.proc_info			= x_scsi_proc_info,
+	.name				= "MPT SCSI Host",
+	.info				= x_scsi_info,
+	.queuecommand			= x_scsi_queuecommand,
+	.slave_alloc			= x_scsi_slave_alloc,
+	.slave_configure		= x_scsi_slave_configure,
+	.slave_destroy			= x_scsi_slave_destroy,
+	.eh_abort_handler		= x_scsi_abort,
+	.eh_device_reset_handler	= x_scsi_dev_reset,
+	.eh_bus_reset_handler		= x_scsi_bus_reset,
+	.eh_host_reset_handler		= x_scsi_host_reset,
+	.bios_param			= x_scsi_bios_param,
+	.can_queue			= MPT_SCSI_CAN_QUEUE,
+	.this_id			= -1,
+	.sg_tablesize			= MPT_SCSI_SG_DEPTH,
+	.max_sectors			= MPT_SCSI_MAX_SECTORS,
+	.cmd_per_lun			= MPT_SCSI_CMD_PER_LUN,
+	.use_clustering			= ENABLE_CLUSTERING,
+};
+
+/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 /*
  *  Private inline routines...
  */
@@ -264,12 +296,14 @@
 mptscsih_io_direction(Scsi_Cmnd *cmd)
 {
 	switch (cmd->cmnd[0]) {
-	case WRITE_6:		
-	case WRITE_10:		
+	case WRITE_6:
+	case WRITE_10:
+	case WRITE_16:
 		return SCSI_DATA_WRITE;
 		break;
-	case READ_6:		
-	case READ_10:		
+	case READ_6:
+	case READ_10:
+	case READ_16:
 		return SCSI_DATA_READ;
 		break;
 	}
@@ -280,6 +314,7 @@
 	switch (cmd->cmnd[0]) {
 	/*  _DATA_OUT commands	*/
 	case WRITE_6:		case WRITE_10:		case WRITE_12:
+	case WRITE_16:
 	case WRITE_LONG:	case WRITE_SAME:	case WRITE_BUFFER:
 	case WRITE_VERIFY:	case WRITE_VERIFY_12:
 	case COMPARE:		case COPY:		case COPY_VERIFY:
@@ -826,6 +861,13 @@
 			sc->resid = sc->request_bufflen - xfer_cnt;
 			dprintk((KERN_NOTICE "  SET sc->resid=%02xh\n", sc->resid));
 
+			if(sc->underflow > xfer_cnt) {
+				printk(MYIOC_s_INFO_FMT
+				"SCSI data underrun: underflow=%02x, xfercnt=%02x\n",
+				ioc->name, sc->underflow, xfer_cnt);
+				sc->result = DID_SOFT_ERROR << 16;
+			}
+
 			/* Report Queue Full
 			 */
 			if (sc->result == MPI_SCSI_STATUS_TASK_SET_FULL)
@@ -1235,7 +1277,6 @@
 	for(ii=0;ii<hd->ioc->req_depth;ii++)
 		hd->ReqToChain[ii] = MPT_HOST_NO_CHAIN;
 
-
 	/* ChainToChain size must equal the total number
 	 * of chain buffers to be allocated.
 	 * index = chain_idx
@@ -1277,7 +1318,6 @@
 		mem = (u8 *) hd->ChainToChain;
 	}
 	memset(mem, 0xFF, sz);
-
 	sz = num_chain * hd->ioc->req_sz;
 	if (hd->ChainBuffer == NULL) {
 		/* Allocate free chain buffer pool
@@ -1353,28 +1393,25 @@
 }
 
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
-static int BeenHereDoneThat = 0;
 static char *info_kbuf = NULL;
 
-/*  SCSI host fops start here...  */
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
-/**
- *	mptscsih_detect - Register MPT adapter(s) as SCSI host(s) with
- *	linux scsi mid-layer.
- *	@tpnt: Pointer to Scsi_Host_Template structure
+/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
+/*
+ *	mptscsih_probe - Installs scsi devices per bus.
+ *	@pdev: Pointer to pci_dev structure
  *
- *	(linux Scsi_Host_Template.detect routine)
+ *	Returns 0 for success, non-zero for failure.
  *
- *	Returns number of SCSI host adapters that were successfully
- *	registered with the linux scsi mid-layer via the scsi_register()
- *	API call.
  */
-int
-mptscsih_detect(Scsi_Host_Template *tpnt)
+
+static int  __devinit
+mptscsih_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 {
 	struct Scsi_Host	*sh = NULL;
 	MPT_SCSI_HOST		*hd = NULL;
-	MPT_ADAPTER		*this;
+	MPT_ADAPTER 		*ioc = pci_get_drvdata(pdev);
+	int			portnum;
 	MPT_DONE_Q		*freedoneQ;
 	unsigned long		 flags;
 	int			 sz, ii;
@@ -1382,325 +1419,312 @@
 	int			 scale;
 	u8			*mem;
 
-	if (! BeenHereDoneThat++) {
-		show_mptmod_ver(my_NAME, my_VERSION);
-
-		ScsiDoneCtx = mpt_register(mptscsih_io_done, MPTSCSIH_DRIVER);
-		ScsiTaskCtx = mpt_register(mptscsih_taskmgmt_complete, MPTSCSIH_DRIVER);
-		ScsiScanDvCtx = mpt_register(mptscsih_scandv_complete, MPTSCSIH_DRIVER);
+	for (portnum=0; portnum < ioc->facts.NumberOfPorts; portnum++) {
 
-		if (mpt_event_register(ScsiDoneCtx, mptscsih_event_process) == 0) {
-			dprintk((KERN_INFO MYNAM ": Registered for IOC event notifications\n"));
-		} else {
-			/* FIXME! */
+		/* 20010215 -sralston
+		 *  Added sanity check on SCSI Initiator-mode enabled
+		 *  for this MPT adapter.
+		 */
+		if (!(ioc->pfacts[portnum].ProtocolFlags &
+		  MPI_PORTFACTS_PROTOCOL_INITIATOR)) {
+			printk(MYIOC_s_WARN_FMT
+			  "Skipping because SCSI Initiator mode is NOT enabled!\n",
+			  ioc->name);
+			continue;
 		}
 
-		if (mpt_reset_register(ScsiDoneCtx, mptscsih_ioc_reset) == 0) {
-			dprintk((KERN_INFO MYNAM ": Registered for IOC reset notifications\n"));
-		} else {
-			/* FIXME! */
+		/* 20010202 -sralston
+		 *  Added sanity check on readiness of the MPT adapter.
+		 */
+		if (ioc->last_state != MPI_IOC_STATE_OPERATIONAL) {
+			printk(MYIOC_s_WARN_FMT
+			  "Skipping because it's not operational!\n",
+			  ioc->name);
+			continue;
 		}
-	}
-	dprintk((KERN_INFO MYNAM ": mpt_scsih_detect()\n"));
 
-#ifdef MODULE
-	/* Evaluate the command line arguments, if any */
-	if (mptscsih)
-		mptscsih_setup(mptscsih);
-#endif
+		sh = scsi_host_alloc(&driver_template, sizeof(MPT_SCSI_HOST));
+		if (sh != NULL) {
+			spin_lock_irqsave(&ioc->FreeQlock, flags);
 
-	this = mpt_adapter_find_first();
-	while (this != NULL) {
-		int	 portnum;
-		for (portnum=0; portnum < this->facts.NumberOfPorts; portnum++) {
-
-			/* 20010215 -sralston
-			 *  Added sanity check on SCSI Initiator-mode enabled
-			 *  for this MPT adapter.
-			 */
-			if (!(this->pfacts[portnum].ProtocolFlags & MPI_PORTFACTS_PROTOCOL_INITIATOR)) {
-				printk(MYIOC_s_WARN_FMT "Skipping because SCSI Initiator mode is NOT enabled!\n",
-						this->name);
-				continue;
-			}
+			/* Attach the SCSI Host to the IOC structure
+			 */
+			ioc->sh = sh;
 
-			/* 20010202 -sralston
-			 *  Added sanity check on readiness of the MPT adapter.
+			sh->io_port = 0;
+			sh->n_io_port = 0;
+			sh->irq = 0;
+
+			/* set 16 byte cdb's */
+			sh->max_cmd_len = 16;
+
+			/* Yikes!  This is important!
+			 * Otherwise, by default, linux
+			 * only scans target IDs 0-7!
+			 * pfactsN->MaxDevices unreliable
+			 * (not supported in early
+			 *	versions of the FW).
+			 * max_id = 1 + actual max id,
+			 * max_lun = 1 + actual last lun,
+			 *	see hosts.h :o(
 			 */
-			if (this->last_state != MPI_IOC_STATE_OPERATIONAL) {
-				printk(MYIOC_s_WARN_FMT "Skipping because it's not operational!\n",
-						this->name);
-				continue;
+			if ((int)ioc->chip_type > (int)FC929) {
+				sh->max_id = MPT_MAX_SCSI_DEVICES;
+			} else {
+			/* For FC, increase the queue depth
+			 * from MPT_SCSI_CAN_QUEUE (31)
+			 * to MPT_FC_CAN_QUEUE (63).
+			 */
+				sh->can_queue = MPT_FC_CAN_QUEUE;
+				sh->max_id =
+				  MPT_MAX_FC_DEVICES<256 ? MPT_MAX_FC_DEVICES : 255;
 			}
 
-			tpnt->proc_info = mptscsih_proc_info;
-			sh = scsi_register(tpnt, sizeof(MPT_SCSI_HOST));
-			if (sh != NULL) {
-				spin_lock_irqsave(&this->FreeQlock, flags);
-				sh->io_port = 0;
-				sh->n_io_port = 0;
-				sh->irq = 0;
-
-				/* Yikes!  This is important!
-				 * Otherwise, by default, linux
-				 * only scans target IDs 0-7!
-				 * pfactsN->MaxDevices unreliable
-				 * (not supported in early
-				 *	versions of the FW).
-				 * max_id = 1 + actual max id,
-				 * max_lun = 1 + actual last lun,
-				 *	see hosts.h :o(
-				 */
-				if ((int)this->chip_type > (int)FC929)
-					sh->max_id = MPT_MAX_SCSI_DEVICES;
-				else {
-					/* For FC, increase the queue depth
-					 * from MPT_SCSI_CAN_QUEUE (31)
-					 * to MPT_FC_CAN_QUEUE (63).
-					 */
-					sh->can_queue = MPT_FC_CAN_QUEUE;
-					sh->max_id = MPT_MAX_FC_DEVICES<256 ? MPT_MAX_FC_DEVICES : 255;
-				}
-				sh->max_lun = MPT_LAST_LUN + 1;
+			sh->max_lun = MPT_LAST_LUN + 1;
+			sh->max_sectors = MPT_SCSI_MAX_SECTORS;
+			sh->this_id = ioc->pfacts[portnum].PortSCSIID;
 
-				sh->max_sectors = MPT_SCSI_MAX_SECTORS;
-				sh->this_id = this->pfacts[portnum].PortSCSIID;
+			/* Required entry.
+			 */
+			sh->unique_id = ioc->id;
 
-				/* Required entry.
-				 */
-				sh->unique_id = this->id;
+			/* Verify that we won't exceed the maximum
+			 * number of chain buffers
+			 * We can optimize:  ZZ = req_sz/sizeof(SGE)
+			 * For 32bit SGE's:
+			 *  numSGE = 1 + (ZZ-1)*(maxChain -1) + ZZ
+			 *               + (req_sz - 64)/sizeof(SGE)
+			 * A slightly different algorithm is required for
+			 * 64bit SGEs.
+			 */
+			scale = ioc->req_sz/(sizeof(dma_addr_t) + sizeof(u32));
+			if (sizeof(dma_addr_t) == sizeof(u64)) {
+				numSGE = (scale - 1) *
+				  (ioc->facts.MaxChainDepth-1) + scale +
+				  (ioc->req_sz - 60) / (sizeof(dma_addr_t) +
+				  sizeof(u32));
+			} else {
+				numSGE = 1 + (scale - 1) *
+				  (ioc->facts.MaxChainDepth-1) + scale +
+				  (ioc->req_sz - 64) / (sizeof(dma_addr_t) +
+				  sizeof(u32));
+			}
 
-				/* Verify that we won't exceed the maximum
-				 * number of chain buffers
-				 * We can optimize:  ZZ = req_sz/sizeof(SGE)
-				 * For 32bit SGE's:
-				 *  numSGE = 1 + (ZZ-1)*(maxChain -1) + ZZ
-				 *               + (req_sz - 64)/sizeof(SGE)
-				 * A slightly different algorithm is required for
-				 * 64bit SGEs.
-				 */
-				scale = this->req_sz/(sizeof(dma_addr_t) + sizeof(u32));
-				if (sizeof(dma_addr_t) == sizeof(u64)) {
-					numSGE = (scale - 1) * (this->facts.MaxChainDepth-1) + scale +
-						(this->req_sz - 60) / (sizeof(dma_addr_t) + sizeof(u32));
-				} else {
-					numSGE = 1 + (scale - 1) * (this->facts.MaxChainDepth-1) + scale +
-						(this->req_sz - 64) / (sizeof(dma_addr_t) + sizeof(u32));
-				}
+			if (numSGE < sh->sg_tablesize) {
+				/* Reset this value */
+				dprintk((MYIOC_s_INFO_FMT
+				  "Resetting sg_tablesize to %d from %d\n",
+				  ioc->name, numSGE, sh->sg_tablesize));
+				sh->sg_tablesize = numSGE;
+			}
 
-				if (numSGE < sh->sg_tablesize) {
-					/* Reset this value */
-					dprintk((MYIOC_s_INFO_FMT
-						 "Resetting sg_tablesize to %d from %d\n",
-						 this->name, numSGE, sh->sg_tablesize));
-					sh->sg_tablesize = numSGE;
-				}
+			/* Set the pci device pointer in Scsi_Host structure.
+			 */
+			scsi_set_device(sh, &ioc->pcidev->dev);
 
-				/* Set the pci device pointer in Scsi_Host structure.
-				 */
-				scsi_set_device(sh, &this->pcidev->dev);
+			spin_unlock_irqrestore(&ioc->FreeQlock, flags);
 
-				spin_unlock_irqrestore(&this->FreeQlock, flags);
+			hd = (MPT_SCSI_HOST *) sh->hostdata;
+			hd->ioc = ioc;
+			hd->max_sge = sh->sg_tablesize;
 
-				hd = (MPT_SCSI_HOST *) sh->hostdata;
-				hd->ioc = this;
-				hd->max_sge = sh->sg_tablesize;
+			if ((int)ioc->chip_type > (int)FC929)
+			hd->is_spi = 1;
 
-				if ((int)this->chip_type > (int)FC929)
-					hd->is_spi = 1;
+			if (DmpService && (ioc->chip_type == FC919 ||
+			  ioc->chip_type == FC929)) {
+				hd->is_multipath = 1;
+			}
+			hd->port = 0; /* FIXME! */
 
-				if (DmpService &&
-				    (this->chip_type == FC919 || this->chip_type == FC929))
-					hd->is_multipath = 1;
+			/* SCSI needs Scsi_Cmnd lookup table!
+			 * (with size equal to req_depth*PtrSz!)
+			 */
+			sz = hd->ioc->req_depth * sizeof(void *);
+			mem = kmalloc(sz, GFP_ATOMIC);
+			if (mem == NULL)
+				goto mptscsih_probe_failed;
 
-				hd->port = 0;		/* FIXME! */
+			memset(mem, 0, sz);
+			hd->ScsiLookup = (struct scsi_cmnd **) mem;
 
-				/* SCSI needs Scsi_Cmnd lookup table!
-				 * (with size equal to req_depth*PtrSz!)
-				 */
-				sz = hd->ioc->req_depth * sizeof(void *);
-				mem = kmalloc(sz, GFP_ATOMIC);
-				if (mem == NULL)
-					goto done;
+			dprintk((MYIOC_s_INFO_FMT "ScsiLookup @ %p, sz=%d\n",
+				 ioc->name, hd->ScsiLookup, sz));
 
-				memset(mem, 0, sz);
-				hd->ScsiLookup = (struct scsi_cmnd **) mem;
+			if (mptscsih_initChainBuffers(hd, 1) < 0)
+				goto mptscsih_probe_failed;
 
-				dprintk((MYIOC_s_INFO_FMT "ScsiLookup @ %p, sz=%d\n",
-					 this->name, hd->ScsiLookup, sz));
+			/* Allocate memory for free and doneQ's
+			 */
+			sz = sh->can_queue * sizeof(MPT_DONE_Q);
+			mem = kmalloc(sz, GFP_ATOMIC);
+			if (mem == NULL)
+				goto mptscsih_probe_failed;
 
-				if (mptscsih_initChainBuffers(hd, 1) < 0)
-					goto done;
+			memset(mem, 0xFF, sz);
+			hd->memQ = mem;
 
-				/* Allocate memory for free and doneQ's
-				 */
-				sz = sh->can_queue * sizeof(MPT_DONE_Q);
-				mem = kmalloc(sz, GFP_ATOMIC);
-				if (mem == NULL)
-					goto done;
+			/* Initialize the free, done and pending Qs.
+			 */
+			Q_INIT(&hd->freeQ, MPT_DONE_Q);
+			Q_INIT(&hd->doneQ, MPT_DONE_Q);
+			Q_INIT(&hd->pendingQ, MPT_DONE_Q);
+			spin_lock_init(&hd->freedoneQlock);
+
+			mem = hd->memQ;
+			for (ii=0; ii < sh->can_queue; ii++) {
+				freedoneQ = (MPT_DONE_Q *) mem;
+				Q_ADD_TAIL(&hd->freeQ.head, freedoneQ, MPT_DONE_Q);
+				mem += sizeof(MPT_DONE_Q);
+			}
 
-				memset(mem, 0xFF, sz);
-				hd->memQ = mem;
+			/* Initialize this Scsi_Host
+			 * internal task Q.
+			 */
+			Q_INIT(&hd->taskQ, MPT_FRAME_HDR);
+			hd->taskQcnt = 0;
 
-				/* Initialize the free, done and pending Qs.
-				 */
-				Q_INIT(&hd->freeQ, MPT_DONE_Q);
-				Q_INIT(&hd->doneQ, MPT_DONE_Q);
-				Q_INIT(&hd->pendingQ, MPT_DONE_Q);
-				spin_lock_init(&hd->freedoneQlock);
-
-				mem = hd->memQ;
-				for (ii=0; ii < sh->can_queue; ii++) {
-					freedoneQ = (MPT_DONE_Q *) mem;
-					Q_ADD_TAIL(&hd->freeQ.head, freedoneQ, MPT_DONE_Q);
-					mem += sizeof(MPT_DONE_Q);
-				}
+			/* Allocate memory for the device structures.
+			 * A non-Null pointer at an offset
+			 * indicates a device exists.
+			 * max_id = 1 + maximum id (hosts.h)
+			 */
+			sz = sh->max_id * sizeof(void *);
+			mem = kmalloc(sz, GFP_ATOMIC);
+			if (mem == NULL)
+				goto mptscsih_probe_failed;
 
-				/* Initialize this Scsi_Host
-				 * internal task Q.
-				 */
-				Q_INIT(&hd->taskQ, MPT_FRAME_HDR);
-				hd->taskQcnt = 0;
+			memset(mem, 0, sz);
+			hd->Targets = (VirtDevice **) mem;
 
-				/* Allocate memory for the device structures.
-				 * A non-Null pointer at an offset
-				 * indicates a device exists.
-				 * max_id = 1 + maximum id (hosts.h)
-				 */
-				sz = sh->max_id * sizeof(void *);
-				mem = kmalloc(sz, GFP_ATOMIC);
-				if (mem == NULL)
-					goto done;
+			dprintk((KERN_INFO
+			  "  Targets @ %p, sz=%d\n", hd->Targets, sz));
 
-				memset(mem, 0, sz);
-				hd->Targets = (VirtDevice **) mem;
 
-				dprintk((KERN_INFO "  Targets @ %p, sz=%d\n", hd->Targets, sz));
+			/* Clear the TM flags
+			 */
+			hd->tmPending = 0;
+			hd->tmState = TM_STATE_NONE;
+			hd->resetPending = 0;
+			hd->abortSCpnt = NULL;
+			hd->tmPtr = NULL;
+			hd->numTMrequests = 0;
 
+			/* Clear the pointer used to store
+			 * single-threaded commands, i.e., those
+			 * issued during a bus scan, dv and
+			 * configuration pages.
+			 */
+			hd->cmdPtr = NULL;
 
-				/* Clear the TM flags
-				 */
-				hd->tmPending = 0;
-				hd->tmState = TM_STATE_NONE;
-				hd->resetPending = 0;
-				hd->abortSCpnt = NULL;
-				hd->tmPtr = NULL;
-				hd->numTMrequests = 0;
+			/* Initialize this SCSI Hosts' timers
+			 * To use, set the timer expires field
+			 * and add_timer
+			 */
+			init_timer(&hd->timer);
+			hd->timer.data = (unsigned long) hd;
+			hd->timer.function = mptscsih_timer_expired;
+
+			init_timer(&hd->TMtimer);
+			hd->TMtimer.data = (unsigned long) hd;
+			hd->TMtimer.function = mptscsih_taskmgmt_timeout;
+			hd->qtag_tick = jiffies;
 
-				/* Clear the pointer used to store
-				 * single-threaded commands, i.e., those
-				 * issued during a bus scan, dv and
-				 * configuration pages.
-				 */
-				hd->cmdPtr = NULL;
+			/* Moved Earlier Pam D */
+			/* ioc->sh = sh;	*/
 
-				/* Attach the SCSI Host to the IOC structure
+			if (hd->is_spi) {
+				/* Update with the driver setup
+				 * values.
 				 */
-				this->sh = sh;
+				if (hd->ioc->spi_data.maxBusWidth >
+				  driver_setup.max_width) {
+					hd->ioc->spi_data.maxBusWidth =
+					  driver_setup.max_width;
+				}
 
-				/* Initialize this SCSI Hosts' timers
-				 * To use, set the timer expires field
-				 * and add_timer
-				 */
-				init_timer(&hd->timer);
-				hd->timer.data = (unsigned long) hd;
-				hd->timer.function = mptscsih_timer_expired;
-
-				init_timer(&hd->TMtimer);
-				hd->TMtimer.data = (unsigned long) hd;
-				hd->TMtimer.function = mptscsih_taskmgmt_timeout;
-				hd->qtag_tick = jiffies;
-
-				/* Moved Earlier Pam D */
-				/* this->sh = sh;	*/
-
-				if (hd->is_spi) {
-					/* Update with the driver setup
-					 * values.
-					 */
-					if (hd->ioc->spi_data.maxBusWidth > driver_setup.max_width)
-						hd->ioc->spi_data.maxBusWidth = driver_setup.max_width;
-					if (hd->ioc->spi_data.minSyncFactor < driver_setup.min_sync_fac)
-						hd->ioc->spi_data.minSyncFactor = driver_setup.min_sync_fac;
+				if (hd->ioc->spi_data.minSyncFactor <
+				  driver_setup.min_sync_fac) {
+					hd->ioc->spi_data.minSyncFactor =
+					  driver_setup.min_sync_fac;
+				}
 
-					if (hd->ioc->spi_data.minSyncFactor == MPT_ASYNC)
-						hd->ioc->spi_data.maxSyncOffset = 0;
+				if (hd->ioc->spi_data.minSyncFactor == MPT_ASYNC) {
+					hd->ioc->spi_data.maxSyncOffset = 0;
+				}
 
-					hd->negoNvram = 0;
-#ifdef MPTSCSIH_DISABLE_DOMAIN_VALIDATION
-					hd->negoNvram = MPT_SCSICFG_USE_NVRAM;
+				hd->negoNvram = 0;
+#ifndef MPTSCSIH_ENABLE_DOMAIN_VALIDATION
+				hd->negoNvram = MPT_SCSICFG_USE_NVRAM;
 #endif
-					if (driver_setup.dv == 0)
-						hd->negoNvram = MPT_SCSICFG_USE_NVRAM;
-
-					hd->ioc->spi_data.forceDv = 0;
-					for (ii=0; ii < MPT_MAX_SCSI_DEVICES; ii++)
-						hd->ioc->spi_data.dvStatus[ii] = MPT_SCSICFG_NEGOTIATE;
-	
-					if (hd->negoNvram == 0) {
-						for (ii=0; ii < MPT_MAX_SCSI_DEVICES; ii++)
-							hd->ioc->spi_data.dvStatus[ii] |= MPT_SCSICFG_DV_NOT_DONE;
-					}
+				if (driver_setup.dv == 0) {
+					hd->negoNvram = MPT_SCSICFG_USE_NVRAM;
+				}
 
-					ddvprintk((MYIOC_s_INFO_FMT
-						"dv %x width %x factor %x \n",
-						hd->ioc->name, driver_setup.dv,
-						driver_setup.max_width,
-						driver_setup.min_sync_fac));
+				hd->ioc->spi_data.forceDv = 0;
+				for (ii=0; ii < MPT_MAX_SCSI_DEVICES; ii++) {
+					hd->ioc->spi_data.dvStatus[ii] =
+					  MPT_SCSICFG_NEGOTIATE;
+				}
 
+				if (hd->negoNvram == 0) {
+					for (ii=0; ii < MPT_MAX_SCSI_DEVICES; ii++)
+						hd->ioc->spi_data.dvStatus[ii] |=
+						  MPT_SCSICFG_DV_NOT_DONE;
 				}
 
-				mpt_scsi_hosts++;
+				ddvprintk((MYIOC_s_INFO_FMT
+					"dv %x width %x factor %x \n",
+					hd->ioc->name, driver_setup.dv,
+					driver_setup.max_width,
+					driver_setup.min_sync_fac));
+
 			}
 
-		}	/* for each adapter port */
+			mpt_scsi_hosts++;
 
-		this = mpt_adapter_find_next(this);
-	}
+			if(scsi_add_host (sh, &ioc->pcidev->dev)) {
+				dprintk((KERN_ERR MYNAM,
+				  "scsi_add_host failed\n"));
+				goto mptscsih_probe_failed;
+			}
 
-done:
-	if (mpt_scsi_hosts > 0)
-		register_reboot_notifier(&mptscsih_notifier);
-	else {
-		mpt_reset_deregister(ScsiDoneCtx);
-		dprintk((KERN_INFO MYNAM ": Deregistered for IOC reset notifications\n"));
+			scsi_scan_host(sh);
+			return 0;
 
-		mpt_event_deregister(ScsiDoneCtx);
-		dprintk((KERN_INFO MYNAM ": Deregistered for IOC event notifications\n"));
+		} /* scsi_host_alloc */
 
-		mpt_deregister(ScsiScanDvCtx);
-		mpt_deregister(ScsiTaskCtx);
-		mpt_deregister(ScsiDoneCtx);
+	} /* for each adapter port */
 
-		if (info_kbuf != NULL)
-			kfree(info_kbuf);
-	}
+mptscsih_probe_failed:
+
+	mptscsih_remove(pdev);
+	return -ENODEV;
 
-	return mpt_scsi_hosts;
 }
 
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
-/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
-/**
- *	mptscsih_release - Unregister SCSI host from linux scsi mid-layer
- *	@host: Pointer to Scsi_Host structure
+/*
+ *	mptscsih_remove - Removed scsi devices
+ *	@pdev: Pointer to pci_dev structure
  *
- *	(linux Scsi_Host_Template.release routine)
- *	This routine releases all resources associated with the SCSI host
- *	adapter.
  *
- *	Returns 0 for success.
  */
-int
-mptscsih_release(struct Scsi_Host *host)
+static void __devexit
+mptscsih_remove(struct pci_dev *pdev)
 {
-	MPT_SCSI_HOST	*hd;
-	int 		 count;
-	unsigned long	 flags;
+	MPT_ADAPTER 		*ioc = pci_get_drvdata(pdev);
+	struct Scsi_Host 	*host = ioc->sh;
+	MPT_SCSI_HOST		*hd;
+	int 		 	count;
+	unsigned long	 	flags;
+
+	if(!host)
+		return;
 
-	hd = (MPT_SCSI_HOST *) host->hostdata;
+	scsi_remove_host(host);
 
-#ifndef MPTSCSIH_DISABLE_DOMAIN_VALIDATION
+#ifdef MPTSCSIH_ENABLE_DOMAIN_VALIDATION
 	/* Check DV thread active */
 	count = 10 * HZ;
 	spin_lock_irqsave(&dvtaskQ_lock, flags);
@@ -1721,8 +1745,7 @@
 #endif
 #endif
 
-	unregister_reboot_notifier(&mptscsih_notifier);
-
+	hd = (MPT_SCSI_HOST *)host->hostdata;
 	if (hd != NULL) {
 		int sz1, sz2, sz3, sztarget=0;
 		int szr2chain = 0;
@@ -1730,9 +1753,7 @@
 		int szchain = 0;
 		int szQ = 0;
 
-		/* Synchronize disk caches
-		 */
-		(void) mptscsih_synchronize_cache(hd, 0);
+		mptscsih_shutdown(&pdev->dev);
 
 		sz1 = sz2 = sz3 = 0;
 
@@ -1796,72 +1817,203 @@
 			hd->Targets = NULL;
 		}
 
-		dprintk((MYIOC_s_INFO_FMT "Free'd ScsiLookup (%d), chain (%d) and Target (%d+%d) memory\n",
-				hd->ioc->name, sz1, szchain, sz3, sztarget));
+		dprintk((MYIOC_s_INFO_FMT
+		  "Free'd ScsiLookup (%d), chain (%d) and Target (%d+%d) memory\n",
+		  hd->ioc->name, sz1, szchain, sz3, sztarget));
 		dprintk(("Free'd done and free Q (%d) memory\n", szQ));
+
+		/* NULL the Scsi_Host pointer
+		 */
+		hd->ioc->sh = NULL;
 	}
-	/* NULL the Scsi_Host pointer
+
+	scsi_host_put(host);
+
+}
+
+/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
+/*
+ *	mptscsih_shutdown - reboot notifier
+ *
+ */
+static void
+mptscsih_shutdown(struct device * dev)
+{
+	MPT_ADAPTER 		*ioc = pci_get_drvdata(to_pci_dev(dev));
+	struct Scsi_Host 	*host = ioc->sh;
+	MPT_SCSI_HOST		*hd;
+
+	if(!host)
+		return;
+
+	hd = (MPT_SCSI_HOST *)host->hostdata;
+
+	/* Flush the cache of this adapter
 	 */
-	hd->ioc->sh = NULL;
-	scsi_unregister(host);
+	if(hd != NULL)
+		mptscsih_synchronize_cache(hd, 0);
 
-	if (mpt_scsi_hosts) {
-		if (--mpt_scsi_hosts == 0) {
-			mpt_reset_deregister(ScsiDoneCtx);
-			dprintk((KERN_INFO MYNAM ": Deregistered for IOC reset notifications\n"));
+}
 
-			mpt_event_deregister(ScsiDoneCtx);
-			dprintk((KERN_INFO MYNAM ": Deregistered for IOC event notifications\n"));
+#ifdef CONFIG_PM
+/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
+/*
+ *	mptscsih_suspend - Fusion MPT scsie driver suspend routine.
+ *
+ *
+ */
+static int
+mptscsih_suspend(struct pci_dev *pdev, u32 state)
+{
+	mptscsih_shutdown(&pdev->dev);
+	return 0;
+}
 
-			mpt_deregister(ScsiScanDvCtx);
-			mpt_deregister(ScsiTaskCtx);
-			mpt_deregister(ScsiDoneCtx);
+/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
+/*
+ *	mptscsih_resume - Fusion MPT scsi driver resume routine.
+ *
+ *
+ */
+static int
+mptscsih_resume(struct pci_dev *pdev)
+{
+	MPT_ADAPTER 		*ioc = pci_get_drvdata(pdev);
+	struct Scsi_Host 	*host = ioc->sh;
+	MPT_SCSI_HOST		*hd;
 
-			if (info_kbuf != NULL)
-				kfree(info_kbuf);
-		}
-	}
+	if(!host)
+		return 0;
 
+	hd = (MPT_SCSI_HOST *)host->hostdata;
+	if(!hd)
+		return 0;
+
+#ifdef MPTSCSIH_ENABLE_DOMAIN_VALIDATION
+	{
+	unsigned long lflags;
+	spin_lock_irqsave(&dvtaskQ_lock, lflags);
+	if (!dvtaskQ_active) {
+		dvtaskQ_active = 1;
+		spin_unlock_irqrestore(&dvtaskQ_lock, lflags);
+		MPT_INIT_WORK(&mptscsih_dvTask,
+		  mptscsih_domainValidation, (void *) hd);
+		SCHEDULE_TASK(&mptscsih_dvTask);
+	} else {
+		spin_unlock_irqrestore(&dvtaskQ_lock, lflags);
+	}
+	}
+#endif
 	return 0;
 }
 
+#endif
+
+static struct mpt_pci_driver mptscsih_driver = {
+	.probe		= mptscsih_probe,
+	.remove		= __devexit_p(mptscsih_remove),
+	.shutdown	= mptscsih_shutdown,
+#ifdef CONFIG_PM
+	.suspend	= mptscsih_suspend,
+	.resume		= mptscsih_resume,
+#endif
+};
+
+
+/*  SCSI host fops start here...  */
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 /**
- *	mptscsih_halt - Process the reboot notification
- *	@nb: Pointer to a struct notifier_block (ignored)
- *	@event: event (SYS_HALT, SYS_RESTART, SYS_POWER_OFF)
- *	@buf: Pointer to a data buffer (ignored)
- *
- *	This routine called if a system shutdown or reboot is to occur.
+ *	mptscsih_init - Register MPT adapter(s) as SCSI host(s) with
+ *	linux scsi mid-layer.
  *
- *	Return NOTIFY_DONE if this is something other than a reboot message.
- *		NOTIFY_OK if this is a reboot message.
+ *	Returns 0 for success, non-zero for failure.
  */
 static int
-mptscsih_halt(struct notifier_block *nb, ulong event, void *buf)
+__init mptscsih_init(void)
 {
-	MPT_ADAPTER *ioc = NULL;
-	MPT_SCSI_HOST *hd = NULL;
+	MPT_ADAPTER		*ioc;
 
-	/* Ignore all messages other than reboot message
-	 */
-	if ((event != SYS_RESTART) && (event != SYS_HALT)
-		&& (event != SYS_POWER_OFF))
-		return (NOTIFY_DONE);
+	show_mptmod_ver(my_NAME, my_VERSION);
 
-	for (ioc = mpt_adapter_find_first(); ioc != NULL; ioc =	mpt_adapter_find_next(ioc)) {
-		/* Flush the cache of this adapter
-		 */
-		if (ioc->sh) {
-			hd = (MPT_SCSI_HOST *) ioc->sh->hostdata;
-			if (hd) {
-				mptscsih_synchronize_cache(hd, 0);
-			}
+	ScsiDoneCtx = mpt_register(mptscsih_io_done, MPTSCSIH_DRIVER);
+	ScsiTaskCtx = mpt_register(mptscsih_taskmgmt_complete, MPTSCSIH_DRIVER);
+	ScsiScanDvCtx = mpt_register(mptscsih_scandv_complete, MPTSCSIH_DRIVER);
+
+	if(mpt_device_driver_register(&mptscsih_driver,
+	  MPTSCSIH_DRIVER) != 0 ) {
+		dprintk((KERN_INFO MYNAM
+		": failed to register dd callbacks\n"));
+	}
+
+	if (mpt_event_register(ScsiDoneCtx, mptscsih_event_process) == 0) {
+		dprintk((KERN_INFO MYNAM
+		  ": Registered for IOC event notifications\n"));
+	}
+
+	if (mpt_reset_register(ScsiDoneCtx, mptscsih_ioc_reset) == 0) {
+		dprintk((KERN_INFO MYNAM
+		  ": Registered for IOC reset notifications\n"));
+	}
+
+#ifdef MODULE
+	/* Evaluate the command line arguments, if any */
+	if (mptscsih)
+		mptscsih_setup(mptscsih);
+#endif
+
+	/* probing for devices */
+	for(ioc = mpt_adapter_find_first(); ioc != NULL;
+	  ioc = mpt_adapter_find_next(ioc)) {
+		if(mptscsih_probe(ioc->pcidev, ioc->pcidev->driver->id_table)) {
+			dprintk((KERN_INFO MYNAM ": probe failed\n"));
+			return -ENODEV;
 		}
 	}
 
-	unregister_reboot_notifier(&mptscsih_notifier);
-	return NOTIFY_OK;
+	if (mpt_scsi_hosts > 0)
+		return 0;
+
+	mptscsih_exit();
+	return -ENODEV;
+
+}
+
+/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
+/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
+/**
+ *	mptscsih_exit - Unregisters MPT adapter(s)
+ *
+ */
+static void
+__exit mptscsih_exit(void)
+{
+	MPT_ADAPTER	*ioc;
+
+	/* removing devices */
+	for(ioc = mpt_adapter_find_first(); ioc != NULL;
+	  ioc = mpt_adapter_find_next(ioc)) {
+		if ((ioc->last_state != MPI_IOC_STATE_OPERATIONAL) ||
+		  (ioc->sh == NULL))
+			continue;
+		mptscsih_remove(ioc->pcidev);
+	}
+
+	mpt_reset_deregister(ScsiDoneCtx);
+	dprintk((KERN_INFO MYNAM
+	  ": Deregistered for IOC reset notifications\n"));
+
+	mpt_event_deregister(ScsiDoneCtx);
+	dprintk((KERN_INFO MYNAM
+	  ": Deregistered for IOC event notifications\n"));
+
+	mpt_device_driver_deregister(MPTSCSIH_DRIVER);
+	mpt_deregister(ScsiScanDvCtx);
+	mpt_deregister(ScsiTaskCtx);
+	mpt_deregister(ScsiDoneCtx);
+
+	if (info_kbuf != NULL)
+		kfree(info_kbuf);
+
 }
 
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
@@ -2436,7 +2588,7 @@
 					hd->ioc->spi_data.dvStatus[target] =  dvStatus;
 				}
 
-#ifndef MPTSCSIH_DISABLE_DOMAIN_VALIDATION
+#ifdef MPTSCSIH_ENABLE_DOMAIN_VALIDATION
 				if ((dvStatus & MPT_SCSICFG_NEED_DV) ||
 					(hd->ioc->spi_data.forceDv & MPT_SCSICFG_NEED_DV)) {
 					unsigned long lflags;
@@ -2608,7 +2760,7 @@
  *	Returns 0 for SUCCESS or -1 if FAILED.
  */
 static int
-mptscsih_TMHandler(MPT_SCSI_HOST *hd, u8 type, u8 target, u8 lun, int ctx2abort, int sleepFlag)
+mptscsih_TMHandler(MPT_SCSI_HOST *hd, u8 type, u8 target, u8 lun, int ctx2abort, ulong timeout, int sleepFlag)
 {
 	MPT_ADAPTER	*ioc = NULL;
 	int		 rc = -1;
@@ -2664,7 +2816,7 @@
 		 */
 		if (hd->hard_resets < -1)
 			hd->hard_resets++;
-		rc = mptscsih_IssueTaskMgmt(hd, type, target, lun, ctx2abort, sleepFlag);
+		rc = mptscsih_IssueTaskMgmt(hd, type, target, lun, ctx2abort, timeout, sleepFlag);
 		if (rc) {
 			printk(MYIOC_s_INFO_FMT "Issue of TaskMgmt failed!\n", hd->ioc->name);
 		} else {
@@ -2710,7 +2862,7 @@
  *	else other non-zero value returned.
  */
 static int
-mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8 type, u8 target, u8 lun, int ctx2abort, int sleepFlag)
+mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8 type, u8 target, u8 lun, int ctx2abort, ulong timeout, int sleepFlag)
 {
 	MPT_FRAME_HDR	*mf;
 	SCSITaskMgmt_t	*pScsiTm;
@@ -2760,7 +2912,7 @@
 	*/
 	hd->tmPtr = mf;
 	hd->numTMrequests++;
-	hd->TMtimer.expires = jiffies + HZ*20;  /* 20 seconds */
+	hd->TMtimer.expires = jiffies + timeout;
 	add_timer(&hd->TMtimer);
 
 	if ((retval = mpt_send_handshake_request(ScsiTaskCtx, hd->ioc->id,
@@ -2870,7 +3022,8 @@
 
 	spin_unlock_irq(host_lock);
 	if (mptscsih_TMHandler(hd, MPI_SCSITASKMGMT_TASKTYPE_ABORT_TASK,
-	                       SCpnt->device->id, SCpnt->device->lun, ctx2abort, CAN_SLEEP)
+		SCpnt->device->id, SCpnt->device->lun,
+		ctx2abort, (HZ*2) /* 2 second timeout */,CAN_SLEEP)
 		< 0) {
 
 		/* The TM request failed and the subsequent FW-reload failed!
@@ -2940,7 +3093,7 @@
 	}
 
 	if (mptscsih_TMHandler(hd, MPI_SCSITASKMGMT_TASKTYPE_TARGET_RESET,
-	                       SCpnt->device->id, 0, 0, CAN_SLEEP)
+		SCpnt->device->id, 0, 0, (HZ*5) /* 5 second timeout */, CAN_SLEEP)
 		< 0){
 		/* The TM request failed and the subsequent FW-reload failed!
 		 * Fatal error case.
@@ -3004,7 +3157,7 @@
 
 	/* We are now ready to execute the task management request. */
 	if (mptscsih_TMHandler(hd, MPI_SCSITASKMGMT_TASKTYPE_RESET_BUS,
-	                       0, 0, 0, CAN_SLEEP)
+		0, 0, 0, (HZ*5) /* 5 second timeout */, CAN_SLEEP)
 	    < 0){
 
 		/* The TM request failed and the subsequent FW-reload failed!
@@ -3087,7 +3240,7 @@
 mptscsih_tm_pending_wait(MPT_SCSI_HOST * hd)
 {
 	unsigned long  flags;
-	int            loop_count = 60 * 4;  /* Wait 60 seconds */
+	int            loop_count = 10 * 4;  /* Wait 10 seconds */
 	int            status = FAILED;
 
 	do {
@@ -3227,18 +3380,50 @@
  */
 int
 mptscsih_bios_param(struct scsi_device * sdev, struct block_device *bdev,
-		sector_t capacity, int *ip)
+		sector_t capacity, int geom[])
 {
-	int size;
+	int		heads;
+	int		sectors;
+	sector_t	cylinders;
+#ifdef CONFIG_LBD
+	ulong 		dummy;
+#endif
 
-	size = capacity;
-	ip[0] = 64;				/* heads			*/
-	ip[1] = 32;				/* sectors			*/
-	if ((ip[2] = size >> 11) > 1024) {	/* cylinders, test for big disk */
-		ip[0] = 255;			/* heads			*/
-		ip[1] = 63;			/* sectors			*/
-		ip[2] = size / (255 * 63);	/* cylinders			*/
+	heads = 64;
+	sectors = 32;
+#ifdef CONFIG_LBD
+	dummy = heads * sectors;
+	cylinders = capacity;
+	sector_div(cylinders,dummy);
+#else
+	cylinders = (ulong)capacity / (heads * sectors);
+#endif
+
+	/*
+	 * Handle extended translation size for logical drives
+	 * > 1Gb
+	 */
+	if ((ulong)capacity >= 0x200000) {
+		heads = 255;
+		sectors = 63;
+#ifdef CONFIG_LBD
+		dummy = heads * sectors;
+		cylinders = capacity;
+		sector_div(cylinders,dummy);
+#else
+		cylinders = (ulong)capacity / (heads * sectors);
+#endif
 	}
+
+	/* return result */
+	geom[0] = heads;
+	geom[1] = sectors;
+	geom[2] = cylinders;
+
+	dprintk((KERN_NOTICE
+		": bios_param: Id=%i Lun=%i Channel=%i CHS=%i/%i/%i\n",
+		sdev->id, sdev->lun,sdev->channel,(int)cylinders,heads,sectors));
+
 	return 0;
 }
 
@@ -3368,7 +3553,7 @@
 			vdev->raidVolume = 0;
 			if (hd->is_spi && (hd->ioc->spi_data.isRaid & (1 << (device->id)))) {
 				vdev->raidVolume = 1;
-				ddvtprintk((KERN_INFO "RAID Volume @ id %d\n", target_id));
+				ddvtprintk((KERN_INFO "RAID Volume @ id %d\n", device->id));
 			}
 
 			mptscsih_target_settings(hd, vdev, device);
@@ -3650,36 +3835,6 @@
 	return -1;
 }
 
-/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
-
-/* see mptscsih.h */
-
-#ifdef MPT_SCSIHOST_NEED_ENTRY_EXIT_HOOKUPS
-static Scsi_Host_Template driver_template = {
-	.proc_name			= "mptscsih",
-	.proc_info			= x_scsi_proc_info,
-	.name				= "MPT SCSI Host",
-	.detect				= x_scsi_detect,
-	.release			= x_scsi_release,
-	.info				= x_scsi_info,	
-	.queuecommand			= x_scsi_queuecommand,
-	.slave_alloc			= x_scsi_slave_alloc,
-	.slave_configure		= x_scsi_slave_configure,
-	.slave_destroy			= x_scsi_slave_destroy,
-	.eh_abort_handler		= x_scsi_abort,
-	.eh_device_reset_handler	= x_scsi_dev_reset,
-	.eh_bus_reset_handler		= x_scsi_bus_reset,
-	.eh_host_reset_handler		= x_scsi_host_reset,
-	.bios_param			= x_scsi_bios_param,
-	.can_queue			= MPT_SCSI_CAN_QUEUE,
-	.this_id			= -1,
-	.sg_tablesize			= MPT_SCSI_SG_DEPTH,
-	.max_sectors			= MPT_SCSI_MAX_SECTORS,
-	.cmd_per_lun			= MPT_SCSI_CMD_PER_LUN,
-	.use_clustering			= ENABLE_CLUSTERING,
-};
-#include "../../scsi/scsi_module.c"
-#endif
 
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 /* Search the pendingQ for a command with specific index.
@@ -3958,7 +4113,7 @@
 		break;
 
 	case MPI_EVENT_INTEGRATED_RAID:			/* 0B */
-#ifndef MPTSCSIH_DISABLE_DOMAIN_VALIDATION
+#ifdef MPTSCSIH_ENABLE_DOMAIN_VALIDATION
 		/* negoNvram set to 0 if DV enabled and to USE_NVRAM if
 		 * if DV disabled. Need to check for target mode.
 		 */
@@ -3972,7 +4127,7 @@
 			int		 numPDisk;
 			u8		 reason;
 			u8		 physDiskNum;
-			
+
 			reason = (le32_to_cpu(pEvReply->Data[0]) & 0x00FF0000) >> 16;
 			if (reason == MPI_EVENT_RAID_RC_DOMAIN_VAL_NEEDED) {
 				/* New or replaced disk.
@@ -4320,6 +4475,8 @@
 	case WRITE_10:
 	case READ_12:
 	case WRITE_12:
+	case READ_16:
+	case WRITE_16:
 		break;
 	default:
 		return 0;
@@ -4618,7 +4775,7 @@
 			//negoFlags = MPT_TARGET_NO_NEGO_SYNC;
 		}
 
-#ifndef MPTSCSIH_DISABLE_DOMAIN_VALIDATION
+#ifdef MPTSCSIH_ENABLE_DOMAIN_VALIDATION
 		/* Force to async and narrow if DV has not been executed
 		 * for this ID
 		 */
@@ -5000,7 +5157,7 @@
 	return;
 }
 
-#ifndef MPTSCSIH_DISABLE_DOMAIN_VALIDATION
+#ifdef MPTSCSIH_ENABLE_DOMAIN_VALIDATION
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 /*	mptscsih_do_raid - Format and Issue a RAID volume request message.
  *	@hd: Pointer to scsi host structure
@@ -5071,7 +5228,7 @@
 
 	return 0;
 }
-#endif /* ~MPTSCSIH_DISABLE_DOMAIN_VALIDATION */
+#endif /* ~MPTSCSIH_ENABLE_DOMAIN_VALIDATION */
 
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 /**
@@ -5383,7 +5540,7 @@
 		if (ioc->spi_data.sdp1length > 0) {
 			pcfg1Data = (SCSIDevicePage1_t *)pci_alloc_consistent(ioc->pcidev,
 					 ioc->spi_data.sdp1length * 4, &cfg1_dma_addr);
-	
+
 			if (pcfg1Data != NULL) {
 				doConfig = 1;
 				header1.PageVersion = ioc->spi_data.sdp1version;
@@ -5415,7 +5572,7 @@
 				flags = hd->ioc->spi_data.noQas;
 				if (hd->ioc->spi_data.nvram && (hd->ioc->spi_data.nvram[id] != MPT_HOST_NVRAM_INVALID)) {
 					data = hd->ioc->spi_data.nvram[id];
-	
+
 					if (data & MPT_NVRAM_WIDE_DISABLE)
 						flags |= MPT_TARGET_NO_NEGO_WIDE;
 
@@ -5424,7 +5581,7 @@
 						flags |= MPT_TARGET_NO_NEGO_SYNC;
 				}
 			}
-	
+
 			/* Force to async, narrow */
 			mptscsih_setDevicePage1Flags(0, MPT_ASYNC, 0, &requested,
 					&configuration, flags);
@@ -5467,7 +5624,7 @@
 	return 0;
 }
 
-#ifndef MPTSCSIH_DISABLE_DOMAIN_VALIDATION
+#ifdef MPTSCSIH_ENABLE_DOMAIN_VALIDATION
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 /**
  *	mptscsih_domainValidation - Top level handler for domain validation.
@@ -5520,7 +5677,7 @@
 			/* DV only to SCSI adapters */
 			if ((int)ioc->chip_type <= (int)FC929)
 				continue;
-			
+
 			/* Make sure everything looks ok */
 			if (ioc->sh == NULL)
 				continue;
@@ -6914,7 +7071,7 @@
 		break;
 	}
 }
-#endif /* ~MPTSCSIH_DISABLE_DOMAIN_VALIDATION */
+#endif /* ~MPTSCSIH_ENABLE_DOMAIN_VALIDATION */
 
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 /* Commandline Parsing routines and defines.
@@ -7009,3 +7166,6 @@
 
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 
+
+module_init(mptscsih_init);
+module_exit(mptscsih_exit);
--- diff/drivers/message/fusion/mptscsih.h	2004-01-19 10:22:57.000000000 +0000
+++ source/drivers/message/fusion/mptscsih.h	2004-02-09 10:39:53.000000000 +0000
@@ -98,13 +98,14 @@
 #define MPT_SCSI_SG_DEPTH	40
 #endif
 
-/* To disable domain validation, uncomment the
+/* To disable domain validation, comment the
  * following line. No effect for FC devices.
  * For SCSI devices, driver will negotiate to
  * NVRAM settings (if available) or to maximum adapter
  * capabilities.
  */
-/* #define MPTSCSIH_DISABLE_DOMAIN_VALIDATION */
+
+#define MPTSCSIH_ENABLE_DOMAIN_VALIDATION
 
 
 /* SCSI driver setup structure. Settings can be overridden
@@ -138,15 +139,6 @@
  */
 
 /*
- *	Conditionalizing with "#ifdef MODULE/#endif" around:
- *		static Scsi_Host_Template driver_template = XX;
- *		#include <../../scsi/scsi_module.c>
- *	lines was REMOVED @ lk-2.4.0-test9
- *	Issue discovered 20001213 by: sshirron
- */
-#define MPT_SCSIHOST_NEED_ENTRY_EXIT_HOOKUPS			1
-
-/*
  *	tq_scheduler disappeared @ lk-2.4.0-test12
  *	(right when <linux/sched.h> newly defined TQ_ACTIVE)
  *	tq_struct reworked in 2.5.41. Include workqueue.h.
@@ -160,8 +152,6 @@
 
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 
-#define x_scsi_detect		mptscsih_detect
-#define x_scsi_release		mptscsih_release
 #define x_scsi_info		mptscsih_info
 #define x_scsi_queuecommand	mptscsih_qcmd
 #define x_scsi_abort		mptscsih_abort
@@ -170,9 +160,6 @@
 #define x_scsi_host_reset	mptscsih_host_reset
 #define x_scsi_bios_param	mptscsih_bios_param
 
-#define x_scsi_taskmgmt_bh	mptscsih_taskmgmt_bh
-#define x_scsi_old_abort	mptscsih_old_abort
-#define x_scsi_old_reset	mptscsih_old_reset
 #define x_scsi_slave_alloc	mptscsih_slave_alloc
 #define x_scsi_slave_configure	mptscsih_slave_configure
 #define x_scsi_slave_destroy	mptscsih_slave_destroy
@@ -182,8 +169,6 @@
 /*
  *	MPT SCSI Host / Initiator decls...
  */
-extern	int		 x_scsi_detect(Scsi_Host_Template *);
-extern	int		 x_scsi_release(struct Scsi_Host *host);
 extern	const char	*x_scsi_info(struct Scsi_Host *);
 extern	int		 x_scsi_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
 extern	int		 x_scsi_abort(Scsi_Cmnd *);
@@ -191,8 +176,7 @@
 extern	int		 x_scsi_dev_reset(Scsi_Cmnd *);
 extern	int		 x_scsi_host_reset(Scsi_Cmnd *);
 extern int		 x_scsi_bios_param(struct scsi_device * sdev, struct block_device *bdev,
-				sector_t capacity, int *ip);
-extern	void		 x_scsi_taskmgmt_bh(void *);
+				sector_t capacity, int geom[]);
 extern	int		 x_scsi_slave_alloc(Scsi_Device *);
 extern	int		 x_scsi_slave_configure(Scsi_Device *);
 extern	void		 x_scsi_slave_destroy(Scsi_Device *);
--- diff/drivers/mtd/chips/cfi_cmdset_0001.c	2003-07-08 09:55:18.000000000 +0100
+++ source/drivers/mtd/chips/cfi_cmdset_0001.c	2004-02-09 10:39:53.000000000 +0000
@@ -1003,13 +1003,25 @@
 	z = 0;
 	while(z < words * CFIDEV_BUSWIDTH) {
 		if (cfi_buswidth_is_1()) {
-			map_write8 (map, *((__u8*)buf)++, adr+z);
+			u8 *b = (u8 *)buf;
+
+			map_write8 (map, *b++, adr+z);
+			buf = (const u_char *)b;
 		} else if (cfi_buswidth_is_2()) {
-			map_write16 (map, *((__u16*)buf)++, adr+z);
+			u16 *b = (u16 *)buf;
+
+			map_write16 (map, *b++, adr+z);
+			buf = (const u_char *)b;
 		} else if (cfi_buswidth_is_4()) {
-			map_write32 (map, *((__u32*)buf)++, adr+z);
+			u32 *b = (u32 *)buf;
+
+			map_write32 (map, *b++, adr+z);
+			buf = (const u_char *)b;
 		} else if (cfi_buswidth_is_8()) {
-			map_write64 (map, *((__u64*)buf)++, adr+z);
+			u64 *b = (u64 *)buf;
+
+			map_write64 (map, *b++, adr+z);
+			buf = (const u_char *)b;
 		} else {
 			ret = -EINVAL;
 			goto out;
@@ -1025,11 +1037,20 @@
 		while (i < CFIDEV_BUSWIDTH)
 			tmp_buf[i++] = 0xff;
 		if (cfi_buswidth_is_2()) {
-			map_write16 (map, *((__u16*)tmp_p)++, adr+z);
+			u16 *b = (u16 *)tmp_p;
+
+			map_write16 (map, *b++, adr+z);
+			tmp_p = (u_char *)b;
 		} else if (cfi_buswidth_is_4()) {
-			map_write32 (map, *((__u32*)tmp_p)++, adr+z);
+			u32 *b = (u32 *)tmp_p;
+
+			map_write32 (map, *b++, adr+z);
+			tmp_p = (u_char *)b;
 		} else if (cfi_buswidth_is_8()) {
-			map_write64 (map, *((__u64*)tmp_p)++, adr+z);
+			u64 *b = (u64 *)tmp_p;
+
+			map_write64 (map, *b++, adr+z);
+			tmp_p = (u_char *)b;
 		} else {
 			ret = -EINVAL;
 			goto out;
--- diff/drivers/mtd/chips/cfi_cmdset_0020.c	2003-10-09 09:47:34.000000000 +0100
+++ source/drivers/mtd/chips/cfi_cmdset_0020.c	2004-02-09 10:39:53.000000000 +0000
@@ -542,11 +542,20 @@
 	/* Write data */
 	for (z = 0; z < len; z += CFIDEV_BUSWIDTH) {
 		if (cfi_buswidth_is_1()) {
-			map_write8 (map, *((__u8*)buf)++, adr+z);
+			u8 *b = (u8 *)buf;
+
+			map_write8 (map, *b++, adr+z);
+			buf = (const u_char *)b;
 		} else if (cfi_buswidth_is_2()) {
-			map_write16 (map, *((__u16*)buf)++, adr+z);
+			u16 *b = (u16 *)buf;
+
+			map_write16 (map, *b++, adr+z);
+			buf = (const u_char *)b;
 		} else if (cfi_buswidth_is_4()) {
-			map_write32 (map, *((__u32*)buf)++, adr+z);
+			u32 *b = (u32 *)buf;
+
+			map_write32 (map, *b++, adr+z);
+			buf = (const u_char *)b;
 		} else {
 			DISABLE_VPP(map);
 			return -EINVAL;
--- diff/drivers/mtd/maps/elan-104nc.c	2003-08-20 14:16:29.000000000 +0100
+++ source/drivers/mtd/maps/elan-104nc.c	2004-02-09 10:39:53.000000000 +0000
@@ -148,7 +148,7 @@
 		elan_104nc_page(map, from);
 		memcpy_fromio(to, iomapadr + (from & WINDOW_MASK), thislen);
 		spin_unlock(&elan_104nc_spin);
-		(__u8*)to += thislen;
+		to += thislen;
 		from += thislen;
 		len -= thislen;
 	}
--- diff/drivers/mtd/maps/sbc_gxx.c	2003-06-30 10:07:21.000000000 +0100
+++ source/drivers/mtd/maps/sbc_gxx.c	2004-02-09 10:39:53.000000000 +0000
@@ -155,7 +155,7 @@
 		sbc_gxx_page(map, from);
 		memcpy_fromio(to, iomapadr + (from & WINDOW_MASK), thislen);
 		spin_unlock(&sbc_gxx_spin);
-		(__u8*)to += thislen;
+		to += thislen;
 		from += thislen;
 		len -= thislen;
 	}
--- diff/drivers/net/3c501.c	2003-09-30 15:46:15.000000000 +0100
+++ source/drivers/net/3c501.c	2004-02-09 10:39:53.000000000 +0000
@@ -136,17 +136,14 @@
 
 #include "3c501.h"
 
-/* A zero-terminated list of I/O addresses to be probed.
-   The 3c501 can be at many locations, but here are the popular ones. */
-static unsigned int netcard_portlist[] __initdata = { 
-	0x280, 0x300, 0
-};
-
-
 /*
  *	The boilerplate probe code.
  */
 
+static int io=0x280;
+static int irq=5;
+static int mem_start;
+
 /**
  * el1_probe:		-	probe for a 3c501
  * @dev: The device structure passed in to probe. 
@@ -160,23 +157,47 @@
  * probe and failing to find anything.
  */
  
-int __init el1_probe(struct net_device *dev)
+struct net_device * __init el1_probe(int unit)
 {
-	int i;
-	int base_addr = dev->base_addr;
+	struct net_device *dev = alloc_etherdev(sizeof(struct net_local));
+	static unsigned ports[] = { 0x280, 0x300, 0};
+	unsigned *port;
+	int err = 0;
+
+	if (!dev)
+		return ERR_PTR(-ENOMEM);
+
+	if (unit >= 0) {
+		sprintf(dev->name, "eth%d", unit);
+		netdev_boot_setup_check(dev);
+		io = dev->base_addr;
+		irq = dev->irq;
+		mem_start = dev->mem_start & 7;
+	}
 
 	SET_MODULE_OWNER(dev);
 
-	if (base_addr > 0x1ff)	/* Check a single specified location. */
-		return el1_probe1(dev, base_addr);
-	else if (base_addr != 0)	/* Don't probe at all. */
-		return -ENXIO;
-
-	for (i = 0; netcard_portlist[i]; i++)
-		if (el1_probe1(dev, netcard_portlist[i]) == 0)
-			return 0;
-
-	return -ENODEV;
+	if (io > 0x1ff) {	/* Check a single specified location. */
+		err = el1_probe1(dev, io);
+	} else if (io != 0) {
+		err = -ENXIO;		/* Don't probe at all. */
+	} else {
+		for (port = ports; *port && el1_probe1(dev, *port); port++)
+			;
+		if (!*port)
+			err = -ENODEV;
+	}
+	if (err)
+		goto out;
+	err = register_netdev(dev);
+	if (err)
+		goto out1;
+	return dev;
+out1:
+	release_region(dev->base_addr, EL1_IO_EXTENT);
+out:
+	free_netdev(dev);
+	return ERR_PTR(err);
 }
 
 /**
@@ -240,6 +261,8 @@
 	 *	high.
 	 */
 
+	dev->irq = irq;
+
 	if (dev->irq < 2)
 	{
 		unsigned long irq_mask;
@@ -267,8 +290,8 @@
 	dev->base_addr = ioaddr;
 	memcpy(dev->dev_addr, station_addr, ETH_ALEN);
 
-	if (dev->mem_start & 0xf)
-		el_debug = dev->mem_start & 0x7;
+	if (mem_start & 0xf)
+		el_debug = mem_start & 0x7;
 	if (autoirq)
 		dev->irq = autoirq;
 
@@ -282,17 +305,7 @@
 	if (el_debug)
 		printk(KERN_DEBUG "%s", version);
 
-	/*
-	 *	Initialize the device structure.
-	 */
-
-	dev->priv = kmalloc(sizeof(struct net_local), GFP_KERNEL);
-	if (dev->priv == NULL) {
-		release_region(ioaddr, EL1_IO_EXTENT);
-		return -ENOMEM;
-	}
 	memset(dev->priv, 0, sizeof(struct net_local));
-
 	lp=dev->priv;
 	spin_lock_init(&lp->lock);
 	
@@ -308,13 +321,6 @@
 	dev->get_stats = &el1_get_stats;
 	dev->set_multicast_list = &set_multicast_list;
 	dev->ethtool_ops = &netdev_ethtool_ops;
-
-	/*
-	 *	Setup the generic properties
-	 */
-
-	ether_setup(dev);
-
 	return 0;
 }
 
@@ -884,14 +890,8 @@
 
 #ifdef MODULE
 
-static struct net_device dev_3c501 = {
-	.init		= el1_probe,
-	.base_addr	= 0x280,
-	.irq		= 5,
-};
+static struct net_device *dev_3c501;
 
-static int io=0x280;
-static int irq=5;
 MODULE_PARM(io, "i");
 MODULE_PARM(irq, "i");
 MODULE_PARM_DESC(io, "EtherLink I/O base address");
@@ -911,10 +911,9 @@
  
 int init_module(void)
 {
-	dev_3c501.irq=irq;
-	dev_3c501.base_addr=io;
-	if (register_netdev(&dev_3c501) != 0)
-		return -EIO;
+	dev_3c501 = el1_probe(-1);
+	if (IS_ERR(dev_3c501))
+		return PTR_ERR(dev_3c501);
 	return 0;
 }
 
@@ -927,19 +926,10 @@
  
 void cleanup_module(void)
 {
-	unregister_netdev(&dev_3c501);
-
-	/*
-	 *	Free up the private structure, or leak memory :-)
-	 */
-
-	kfree(dev_3c501.priv);
-	dev_3c501.priv = NULL;	/* gets re-allocated by el1_probe1 */
-
-	/*
-	 *	If we don't do this, we can't re-insmod it later.
-	 */
-	release_region(dev_3c501.base_addr, EL1_IO_EXTENT);
+	struct net_device *dev = dev_3c501;
+	unregister_netdev(dev);
+	release_region(dev->base_addr, EL1_IO_EXTENT);
+	free_netdev(dev);
 }
 
 #endif /* MODULE */
--- diff/drivers/net/3c501.h	2003-09-17 12:28:07.000000000 +0100
+++ source/drivers/net/3c501.h	2004-02-09 10:39:53.000000000 +0000
@@ -3,7 +3,6 @@
  *	Index to functions.
  */
 
-int el1_probe(struct net_device *dev);
 static int  el1_probe1(struct net_device *dev, int ioaddr);
 static int  el_open(struct net_device *dev);
 static void el_timeout(struct net_device *dev);
--- diff/drivers/net/3c503.c	2003-09-30 15:46:15.000000000 +0100
+++ source/drivers/net/3c503.c	2004-02-09 10:39:53.000000000 +0000
@@ -60,7 +60,6 @@
 #include "3c503.h"
 #define WRD_COUNT 4
 
-int el2_probe(struct net_device *dev);
 static int el2_pio_probe(struct net_device *dev);
 static int el2_probe1(struct net_device *dev, int ioaddr);
 
@@ -90,11 +89,11 @@
    If the ethercard isn't found there is an optional probe for
    ethercard jumpered to programmed-I/O mode.
    */
-int __init 
-el2_probe(struct net_device *dev)
+static int __init do_el2_probe(struct net_device *dev)
 {
     int *addr, addrs[] = { 0xddffe, 0xd9ffe, 0xcdffe, 0xc9ffe, 0};
     int base_addr = dev->base_addr;
+    int irq = dev->irq;
 
     SET_MODULE_OWNER(dev);
     
@@ -104,16 +103,13 @@
 	return -ENXIO;
 
     for (addr = addrs; *addr; addr++) {
-	int i;
-	unsigned int base_bits = isa_readb(*addr);
-	/* Find first set bit. */
-	for(i = 7; i >= 0; i--, base_bits >>= 1)
-	    if (base_bits & 0x1)
-		break;
-	if (base_bits != 1)
+	unsigned base_bits = isa_readb(*addr);
+	int i = ffs(base_bits) - 1;
+	if (i == -1 || base_bits != (1 << i))
 	    continue;
 	if (el2_probe1(dev, netcard_portlist[i]) == 0)
 	    return 0;
+	dev->irq = irq;
     }
 #if ! defined(no_probe_nonshared_memory)
     return el2_pio_probe(dev);
@@ -128,20 +124,54 @@
 el2_pio_probe(struct net_device *dev)
 {
     int i;
-    int base_addr = dev ? dev->base_addr : 0;
+    int base_addr = dev->base_addr;
+    int irq = dev->irq;
 
     if (base_addr > 0x1ff)	/* Check a single specified location. */
 	return el2_probe1(dev, base_addr);
     else if (base_addr != 0)	/* Don't probe at all. */
 	return -ENXIO;
 
-    for (i = 0; netcard_portlist[i]; i++)
+    for (i = 0; netcard_portlist[i]; i++) {
 	if (el2_probe1(dev, netcard_portlist[i]) == 0)
 	    return 0;
+	dev->irq = irq;
+    }
 
     return -ENODEV;
 }
 
+static void cleanup_card(struct net_device *dev)
+{
+	/* NB: el2_close() handles free_irq */
+	release_region(dev->base_addr, EL2_IO_EXTENT);
+}
+
+struct net_device * __init el2_probe(int unit)
+{
+	struct net_device *dev = alloc_ei_netdev();
+	int err;
+
+	if (!dev)
+		return ERR_PTR(-ENOMEM);
+
+	sprintf(dev->name, "eth%d", unit);
+	netdev_boot_setup_check(dev);
+
+	err = do_el2_probe(dev);
+	if (err)
+		goto out;
+	err = register_netdev(dev);
+	if (err)
+		goto out1;
+	return dev;
+out1:
+	cleanup_card(dev);
+out:
+	free_netdev(dev);
+	return ERR_PTR(err);
+}
+
 /* Probe for the Etherlink II card at I/O port base IOADDR,
    returning non-zero on success.  If found, set the station
    address and memory parameters in DEVICE. */
@@ -152,15 +182,19 @@
     static unsigned version_printed;
     unsigned long vendor_id;
 
-    /* FIXME: code reads ioaddr + 0x400, we request ioaddr + 16 */
     if (!request_region(ioaddr, EL2_IO_EXTENT, dev->name))
 	return -EBUSY;
 
+    if (!request_region(ioaddr + 0x400, 8, dev->name)) {
+	retval = -EBUSY;
+	goto out;
+    }
+
     /* Reset and/or avoid any lurking NE2000 */
     if (inb(ioaddr + 0x408) == 0xff) {
     	mdelay(1);
 	retval = -ENODEV;
-	goto out;
+	goto out1;
     }
 
     /* We verify that it's a 3C503 board by checking the first three octets
@@ -171,7 +205,7 @@
     if (   (iobase_reg  & (iobase_reg - 1))
 	|| (membase_reg & (membase_reg - 1))) {
 	retval = -ENODEV;
-	goto out;
+	goto out1;
     }
     saved_406 = inb_p(ioaddr + 0x406);
     outb_p(ECNTRL_RESET|ECNTRL_THIN, ioaddr + 0x406); /* Reset it... */
@@ -184,19 +218,13 @@
 	/* Restore the register we frobbed. */
 	outb(saved_406, ioaddr + 0x406);
 	retval = -ENODEV;
-	goto out;
+	goto out1;
     }
 
     if (ei_debug  &&  version_printed++ == 0)
 	printk(version);
 
     dev->base_addr = ioaddr;
-    /* Allocate dev->priv and fill in 8390 specific dev fields. */
-    if (ethdev_init(dev)) {
-	printk ("3c503: unable to allocate memory for dev->priv.\n");
-	retval = -ENOMEM;
-	goto out;
-    }
 
     printk("%s: 3c503 at i/o base %#3x, node ", dev->name, ioaddr);
 
@@ -309,6 +337,9 @@
     dev->open = &el2_open;
     dev->stop = &el2_close;
     dev->ethtool_ops = &netdev_ethtool_ops;
+#ifdef CONFIG_NET_POLL_CONTROLLER
+    dev->poll_controller = ei_poll;
+#endif
 
     if (dev->mem_start)
 	printk("%s: %s - %dkB RAM, 8kB shared mem window at %#6lx-%#6lx.\n",
@@ -322,7 +353,10 @@
 	printk("\n%s: %s, %dkB RAM, using programmed I/O (REJUMPER for SHARED MEMORY).\n",
 	       dev->name, ei_status.name, (wordlength+1)<<3);
     }
+    release_region(ioaddr + 0x400, 8);
     return 0;
+out1:
+    release_region(ioaddr + 0x400, 8);
 out:
     release_region(ioaddr, EL2_IO_EXTENT);
     return retval;
@@ -633,7 +667,7 @@
 #ifdef MODULE
 #define MAX_EL2_CARDS	4	/* Max number of EL2 cards per module */
 
-static struct net_device dev_el2[MAX_EL2_CARDS];
+static struct net_device *dev_el2[MAX_EL2_CARDS];
 static int io[MAX_EL2_CARDS];
 static int irq[MAX_EL2_CARDS];
 static int xcvr[MAX_EL2_CARDS];	/* choose int. or ext. xcvr */
@@ -651,28 +685,34 @@
 int
 init_module(void)
 {
+	struct net_device *dev;
 	int this_dev, found = 0;
 
 	for (this_dev = 0; this_dev < MAX_EL2_CARDS; this_dev++) {
-		struct net_device *dev = &dev_el2[this_dev];
-		dev->irq = irq[this_dev];
-		dev->base_addr = io[this_dev];
-		dev->mem_end = xcvr[this_dev];	/* low 4bits = xcvr sel. */
-		dev->init = el2_probe;
 		if (io[this_dev] == 0)  {
 			if (this_dev != 0) break; /* only autoprobe 1st one */
 			printk(KERN_NOTICE "3c503.c: Presently autoprobing (not recommended) for a single card.\n");
 		}
-		if (register_netdev(dev) != 0) {
-			printk(KERN_WARNING "3c503.c: No 3c503 card found (i/o = 0x%x).\n", io[this_dev]);
-			if (found != 0) {	/* Got at least one. */
-				return 0;
+		dev = alloc_ei_netdev();
+		if (!dev)
+			break;
+		dev->irq = irq[this_dev];
+		dev->base_addr = io[this_dev];
+		dev->mem_end = xcvr[this_dev];	/* low 4bits = xcvr sel. */
+		if (do_el2_probe(dev) == 0) {
+			if (register_netdev(dev) == 0) {
+				dev_el2[found++] = dev;
+				continue;
 			}
-			return -ENXIO;
+			cleanup_card(dev);
 		}
-		found++;
+		free_netdev(dev);
+		printk(KERN_WARNING "3c503.c: No 3c503 card found (i/o = 0x%x).\n", io[this_dev]);
+		break;
 	}
-	return 0;
+	if (found)
+		return 0;
+	return -ENXIO;
 }
 
 void
@@ -681,13 +721,11 @@
 	int this_dev;
 
 	for (this_dev = 0; this_dev < MAX_EL2_CARDS; this_dev++) {
-		struct net_device *dev = &dev_el2[this_dev];
-		if (dev->priv != NULL) {
-			void *priv = dev->priv;
-			/* NB: el2_close() handles free_irq */
-			release_region(dev->base_addr, EL2_IO_EXTENT);
+		struct net_device *dev = dev_el2[this_dev];
+		if (dev) {
 			unregister_netdev(dev);
-			kfree(priv);
+			cleanup_card(dev);
+			free_netdev(dev);
 		}
 	}
 }
--- diff/drivers/net/3c505.c	2003-09-30 15:46:15.000000000 +0100
+++ source/drivers/net/3c505.c	2004-02-09 10:39:53.000000000 +0000
@@ -1293,42 +1293,6 @@
 	}
 }
 
-/******************************************************
- *
- * initialise Etherlink Plus board
- *
- ******************************************************/
-
-static inline void elp_init(struct net_device *dev)
-{
-	elp_device *adapter = dev->priv;
-
-	/*
-	 * set ptrs to various functions
-	 */
-	dev->open = elp_open;				/* local */
-	dev->stop = elp_close;				/* local */
-	dev->get_stats = elp_get_stats;			/* local */
-	dev->hard_start_xmit = elp_start_xmit;		/* local */
-	dev->tx_timeout = elp_timeout;			/* local */
-	dev->watchdog_timeo = 10*HZ;
-	dev->set_multicast_list = elp_set_mc_list;	/* local */
-	dev->ethtool_ops = &netdev_ethtool_ops;		/* local */
-
-	/* Setup the generic properties */
-	ether_setup(dev);
-
-	/*
-	 * setup ptr to adapter specific information
-	 */
-	memset(&(adapter->stats), 0, sizeof(struct net_device_stats));
-
-	/*
-	 * memory information
-	 */
-	dev->mem_start = dev->mem_end = 0;
-}
-
 /************************************************************
  *
  * A couple of tests to see if there's 3C505 or not
@@ -1442,12 +1406,13 @@
  * work at all if it was in a weird state).
  */
 
-int __init elplus_probe(struct net_device *dev)
+static int __init elplus_setup(struct net_device *dev)
 {
-	elp_device *adapter;
+	elp_device *adapter = dev->priv;
 	int i, tries, tries1, okay;
 	unsigned long timeout;
 	unsigned long cookie = 0;
+	int err = -ENODEV;
 
 	SET_MODULE_OWNER(dev);
 
@@ -1456,17 +1421,8 @@
 	 */
 
 	dev->base_addr = elp_autodetect(dev);
-	if (!(dev->base_addr))
-		return -ENODEV;
-
-	/*
-	 * setup ptr to adapter specific information
-	 */
-	adapter = (elp_device *) (dev->priv = kmalloc(sizeof(elp_device), GFP_KERNEL));
-	if (adapter == NULL) {
-		printk(KERN_ERR "%s: out of memory\n", dev->name);
+	if (!dev->base_addr)
 		return -ENODEV;
-	}
 
 	adapter->send_pcb_semaphore = 0;
 
@@ -1544,8 +1500,7 @@
 		outb_control(adapter->hcr_val & ~(FLSH | ATTN), dev);
 	}
 	printk(KERN_ERR "%s: failed to initialise 3c505\n", dev->name);
-	release_region(dev->base_addr, ELP_IO_EXTENT);
-	return -ENODEV;
+	goto out;
 
       okay:
 	if (dev->irq) {		/* Is there a preset IRQ? */
@@ -1560,14 +1515,14 @@
 	case 0:
 		printk(KERN_ERR "%s: IRQ probe failed: check 3c505 jumpers.\n",
 		       dev->name);
-		return -ENODEV;
+		goto out;
 	case 1:
 	case 6:
 	case 8:
 	case 13:
 		printk(KERN_ERR "%s: Impossible IRQ %d reported by probe_irq_off().\n",
 		       dev->name, dev->irq);
-		return -ENODEV;
+		       goto out;
 	}
 	/*
 	 *  Now we have the IRQ number so we can disable the interrupts from
@@ -1636,16 +1591,48 @@
 		printk(KERN_ERR "%s: adapter configuration failed\n", dev->name);
 	}
 
-	/*
-	 * initialise the device
-	 */
-	elp_init(dev);
+	dev->open = elp_open;				/* local */
+	dev->stop = elp_close;				/* local */
+	dev->get_stats = elp_get_stats;			/* local */
+	dev->hard_start_xmit = elp_start_xmit;		/* local */
+	dev->tx_timeout = elp_timeout;			/* local */
+	dev->watchdog_timeo = 10*HZ;
+	dev->set_multicast_list = elp_set_mc_list;	/* local */
+	dev->ethtool_ops = &netdev_ethtool_ops;		/* local */
+
+	memset(&(adapter->stats), 0, sizeof(struct net_device_stats));
+	dev->mem_start = dev->mem_end = 0;
+
+	err = register_netdev(dev);
+	if (err)
+		goto out;
 
 	return 0;
+out:
+	release_region(dev->base_addr, ELP_IO_EXTENT);
+	return err;
+}
+
+struct net_device * __init elplus_probe(int unit)
+{
+	struct net_device *dev = alloc_etherdev(sizeof(elp_device));
+	int err;
+	if (!dev)
+		return ERR_PTR(-ENOMEM);
+
+	sprintf(dev->name, "eth%d", unit);
+	netdev_boot_setup_check(dev);
+
+	err = elplus_setup(dev);
+	if (err) {
+		free_netdev(dev);
+		return ERR_PTR(err);
+	}
+	return dev;
 }
 
 #ifdef MODULE
-static struct net_device dev_3c505[ELP_MAX_CARDS];
+static struct net_device *dev_3c505[ELP_MAX_CARDS];
 static int io[ELP_MAX_CARDS];
 static int irq[ELP_MAX_CARDS];
 static int dma[ELP_MAX_CARDS];
@@ -1661,10 +1648,12 @@
 	int this_dev, found = 0;
 
 	for (this_dev = 0; this_dev < ELP_MAX_CARDS; this_dev++) {
-		struct net_device *dev = &dev_3c505[this_dev];
+		struct net_device *dev = alloc_etherdev(sizeof(elp_device));
+		if (!dev)
+			break;
+
 		dev->irq = irq[this_dev];
 		dev->base_addr = io[this_dev];
-		dev->init = elplus_probe;
 		if (dma[this_dev]) {
 			dev->dma = dma[this_dev];
 		} else {
@@ -1672,16 +1661,22 @@
 			printk(KERN_WARNING "3c505.c: warning, using default DMA channel,\n");
 		}
 		if (io[this_dev] == 0) {
-			if (this_dev) break;
+			if (this_dev) {
+				free_netdev(dev);
+				break;
+			}
 			printk(KERN_NOTICE "3c505.c: module autoprobe not recommended, give io=xx.\n");
 		}
-		if (register_netdev(dev) != 0) {
+		if (elplus_setup(dev) != 0) {
 			printk(KERN_WARNING "3c505.c: Failed to register card at 0x%x.\n", io[this_dev]);
-			if (found != 0) return 0;
-			return -ENXIO;
+			free_netdev(dev);
+			break;
 		}
+		dev_3c505[this_dev] = dev;
 		found++;
 	}
+	if (!found)
+		return -ENODEV;
 	return 0;
 }
 
@@ -1690,12 +1685,11 @@
 	int this_dev;
 
 	for (this_dev = 0; this_dev < ELP_MAX_CARDS; this_dev++) {
-		struct net_device *dev = &dev_3c505[this_dev];
-		if (dev->priv != NULL) {
+		struct net_device *dev = dev_3c505[this_dev];
+		if (dev) {
 			unregister_netdev(dev);
-			kfree(dev->priv);
-			dev->priv = NULL;
 			release_region(dev->base_addr, ELP_IO_EXTENT);
+			free_netdev(dev);
 		}
 	}
 }
--- diff/drivers/net/3c507.c	2003-09-17 12:28:07.000000000 +0100
+++ source/drivers/net/3c507.c	2004-02-09 10:39:53.000000000 +0000
@@ -74,10 +74,6 @@
 #define debug net_debug
 
 
-/* A zero-terminated list of common I/O addresses to be probed. */
-static unsigned int netcard_portlist[] __initdata =
-	{ 0x300, 0x320, 0x340, 0x280, 0};
-
 /*
   			Details of the i82586.
 
@@ -286,8 +282,6 @@
 
 /* Index to functions, as function prototypes. */
 
-extern int el16_probe(struct net_device *dev);	/* Called from Space.c */
-
 static int	el16_probe1(struct net_device *dev, int ioaddr);
 static int	el16_open(struct net_device *dev);
 static int	el16_send_packet(struct sk_buff *skb, struct net_device *dev);
@@ -301,6 +295,10 @@
 static void init_82586_mem(struct net_device *dev);
 static struct ethtool_ops netdev_ethtool_ops;
 
+static int io = 0x300;
+static int irq;
+static int mem_start;
+
 
 /* Check for a network adaptor of this type, and return '0' iff one exists.
 	If dev->base_addr == 0, probe all likely locations.
@@ -309,23 +307,50 @@
 	device and return success.
 	*/
 
-int __init el16_probe(struct net_device *dev)
+struct net_device * __init el16_probe(int unit)
 {
-	int base_addr = dev->base_addr;
-	int i;
+	struct net_device *dev = alloc_etherdev(sizeof(struct net_local));
+	static unsigned ports[] = { 0x300, 0x320, 0x340, 0x280, 0};
+	unsigned *port;
+	int err = -ENODEV;
+
+	if (!dev)
+		return ERR_PTR(-ENODEV);
+
+	if (unit >= 0) {
+		sprintf(dev->name, "eth%d", unit);
+		netdev_boot_setup_check(dev);
+		io = dev->base_addr;
+		irq = dev->irq;
+		mem_start = dev->mem_start & 15;
+	}
 
 	SET_MODULE_OWNER(dev);
 
-	if (base_addr > 0x1ff)	/* Check a single specified location. */
-		return el16_probe1(dev, base_addr);
-	else if (base_addr != 0)
-		return -ENXIO;		/* Don't probe at all. */
-
-	for (i = 0; netcard_portlist[i]; i++)
-		if (el16_probe1(dev, netcard_portlist[i]) == 0)
-			return 0;
+	if (io > 0x1ff) 	/* Check a single specified location. */
+		err = el16_probe1(dev, io);
+	else if (io != 0)
+		err = -ENXIO;		/* Don't probe at all. */
+	else {
+		for (port = ports; *port; port++) {
+			err = el16_probe1(dev, *port);
+			if (!err)
+				break;
+		}
+	}
 
-	return -ENODEV;
+	if (err)
+		goto out;
+	err = register_netdev(dev);
+	if (err)
+		goto out1;
+	return dev;
+out1:
+	free_irq(dev->irq, dev);
+	release_region(dev->base_addr, EL16_IO_EXTENT);
+out:
+	free_netdev(dev);
+	return ERR_PTR(err);
 }
 
 static int __init el16_probe1(struct net_device *dev, int ioaddr)
@@ -383,8 +408,8 @@
 		printk(" %02x", dev->dev_addr[i]);
 	}
 
-	if ((dev->mem_start & 0xf) > 0)
-		net_debug = dev->mem_start & 7;
+	if (mem_start)
+		net_debug = mem_start & 7;
 
 #ifdef MEM_BASE
 	dev->mem_start = MEM_BASE;
@@ -416,27 +441,18 @@
 	if (net_debug)
 		printk(version);
 
-	/* Initialize the device structure. */
-	lp = dev->priv = kmalloc(sizeof(struct net_local), GFP_KERNEL);
-	if (dev->priv == NULL) {
-		retval = -ENOMEM;
-		goto out;
-	}
-	memset(dev->priv, 0, sizeof(struct net_local));
+	lp = dev->priv;
+ 	memset(lp, 0, sizeof(*lp));
 	spin_lock_init(&lp->lock);
 
-	dev->open		= el16_open;
-	dev->stop		= el16_close;
+ 	dev->open = el16_open;
+ 	dev->stop = el16_close;
 	dev->hard_start_xmit = el16_send_packet;
 	dev->get_stats	= el16_get_stats;
 	dev->tx_timeout = el16_tx_timeout;
 	dev->watchdog_timeo = TX_TIMEOUT;
 	dev->ethtool_ops = &netdev_ethtool_ops;
-
-	ether_setup(dev);	/* Generic ethernet behaviour */
-
-	dev->flags&=~IFF_MULTICAST;	/* Multicast doesn't work */
-
+ 	dev->flags &= ~IFF_MULTICAST;	/* Multicast doesn't work */
 	return 0;
 out:
 	release_region(ioaddr, EL16_IO_EXTENT);
@@ -899,9 +915,7 @@
 };
 
 #ifdef MODULE
-static struct net_device dev_3c507;
-static int io = 0x300;
-static int irq;
+static struct net_device *dev_3c507;
 MODULE_PARM(io, "i");
 MODULE_PARM(irq, "i");
 MODULE_PARM_DESC(io, "EtherLink16 I/O base address");
@@ -911,26 +925,18 @@
 {
 	if (io == 0)
 		printk("3c507: You should not use auto-probing with insmod!\n");
-	dev_3c507.base_addr = io;
-	dev_3c507.irq       = irq;
-	dev_3c507.init	    = el16_probe;
-	if (register_netdev(&dev_3c507) != 0) {
-		printk("3c507: register_netdev() returned non-zero.\n");
-		return -EIO;
-	}
-	return 0;
+	dev_3c507 = el16_probe(-1);
+	return IS_ERR(dev_3c507) ? PTR_ERR(dev_3c507) : 0;
 }
 
 void
 cleanup_module(void)
 {
-	unregister_netdev(&dev_3c507);
-	kfree(dev_3c507.priv);
-	dev_3c507.priv = NULL;
-
-	/* If we don't do this, we can't re-insmod it later. */
-	free_irq(dev_3c507.irq, &dev_3c507);
-	release_region(dev_3c507.base_addr, EL16_IO_EXTENT);
+	struct net_device *dev = dev_3c507;
+	unregister_netdev(dev);
+	free_irq(dev->irq, dev);
+	release_region(dev->base_addr, EL16_IO_EXTENT);
+	free_netdev(dev);
 }
 #endif /* MODULE */
 MODULE_LICENSE("GPL");
--- diff/drivers/net/3c509.c	2003-11-25 15:24:57.000000000 +0000
+++ source/drivers/net/3c509.c	2004-02-09 10:39:53.000000000 +0000
@@ -678,6 +678,8 @@
 		err = el3_common_init(dev);
 
 		if (err) {
+			device->driver_data = NULL;
+			free_netdev(dev);
 			return -ENOMEM;
 		}
 
@@ -737,6 +739,8 @@
 	err = el3_common_init(dev);
 
 	if (err) {
+		eisa_set_drvdata (edev, NULL);
+		free_netdev(dev);
 		return err;
 	}
 
--- diff/drivers/net/3c515.c	2003-09-30 15:46:15.000000000 +0100
+++ source/drivers/net/3c515.c	2004-02-09 10:39:53.000000000 +0000
@@ -307,7 +307,8 @@
 
 struct corkscrew_private {
 	const char *product_name;
-	struct net_device *next_module;
+	struct list_head list;
+	struct net_device *our_dev;
 	/* The Rx and Tx rings are here to keep them quad-word-aligned. */
 	struct boom_rx_desc rx_ring[RX_RING_SIZE];
 	struct boom_tx_desc tx_ring[TX_RING_SIZE];
@@ -329,6 +330,7 @@
 		full_bus_master_tx:1, full_bus_master_rx:1,	/* Boomerang  */
 		tx_full:1;
 	spinlock_t lock;
+	struct device *dev;
 };
 
 /* The action to take with a media selection timer tick.
@@ -367,17 +369,12 @@
 
 MODULE_DEVICE_TABLE(isapnp, corkscrew_isapnp_adapters);
 
-static int corkscrew_isapnp_phys_addr[3];
-
 static int nopnp;
 #endif /* __ISAPNP__ */
 
-static int corkscrew_scan(struct net_device *dev);
-static struct net_device *corkscrew_found_device(struct net_device *dev,
-						 int ioaddr, int irq,
-						 int product_index,
-						 int options);
-static int corkscrew_probe1(struct net_device *dev);
+static struct net_device *corkscrew_scan(int unit);
+static void corkscrew_setup(struct net_device *dev, int ioaddr,
+			    struct pnp_dev *idev, int card_number);
 static int corkscrew_open(struct net_device *dev);
 static void corkscrew_timer(unsigned long arg);
 static int corkscrew_start_xmit(struct sk_buff *skb,
@@ -413,47 +410,99 @@
 #ifdef MODULE
 static int debug = -1;
 /* A list of all installed Vortex devices, for removing the driver module. */
-static struct net_device *root_corkscrew_dev;
+/* we will need locking (and refcounting) if we ever use it for more */
+static LIST_HEAD(root_corkscrew_dev);
 
 int init_module(void)
 {
-	int cards_found;
-
+	int found = 0;
 	if (debug >= 0)
 		corkscrew_debug = debug;
 	if (corkscrew_debug)
 		printk(version);
-
-	root_corkscrew_dev = NULL;
-	cards_found = corkscrew_scan(NULL);
-	return cards_found ? 0 : -ENODEV;
+	while (corkscrew_scan(-1))
+		found++;
+	return found ? 0 : -ENODEV;
 }
 
 #else
-int tc515_probe(struct net_device *dev)
+struct net_device *tc515_probe(int unit)
 {
-	int cards_found = 0;
+	struct net_device *dev = corkscrew_scan(unit);
+	static int printed;
 
-	SET_MODULE_OWNER(dev);
-
-	cards_found = corkscrew_scan(dev);
+	if (!dev)
+		return ERR_PTR(-ENODEV);
 
-	if (corkscrew_debug > 0 && cards_found)
+	if (corkscrew_debug > 0 && !printed) {
+		printed = 1;
 		printk(version);
+	}
 
-	return cards_found ? 0 : -ENODEV;
+	return dev;
 }
 #endif				/* not MODULE */
 
-static int corkscrew_scan(struct net_device *dev)
+static int check_device(unsigned ioaddr)
+{
+	int timer;
+
+	if (!request_region(ioaddr, CORKSCREW_TOTAL_SIZE, "3c515"))
+		return 0;
+	/* Check the resource configuration for a matching ioaddr. */
+	if ((inw(ioaddr + 0x2002) & 0x1f0) != (ioaddr & 0x1f0)) {
+		release_region(ioaddr, CORKSCREW_TOTAL_SIZE);
+		return 0;
+	}
+	/* Verify by reading the device ID from the EEPROM. */
+	outw(EEPROM_Read + 7, ioaddr + Wn0EepromCmd);
+	/* Pause for at least 162 us. for the read to take place. */
+	for (timer = 4; timer >= 0; timer--) {
+		udelay(162);
+		if ((inw(ioaddr + Wn0EepromCmd) & 0x0200) == 0)
+			break;
+	}
+	if (inw(ioaddr + Wn0EepromData) != 0x6d50) {
+		release_region(ioaddr, CORKSCREW_TOTAL_SIZE);
+		return 0;
+	}
+	return 1;
+}
+
+static void cleanup_card(struct net_device *dev)
 {
-	int cards_found = 0;
+	struct corkscrew_private *vp = (struct corkscrew_private *) dev->priv;
+	list_del_init(&vp->list);
+	if (dev->dma)
+		free_dma(dev->dma);
+	outw(TotalReset, dev->base_addr + EL3_CMD);
+	release_region(dev->base_addr, CORKSCREW_TOTAL_SIZE);
+	if (vp->dev)
+		pnp_device_detach(to_pnp_dev(vp->dev));
+}
+
+static struct net_device *corkscrew_scan(int unit)
+{
+	struct net_device *dev;
+	static int cards_found = 0;
 	static int ioaddr;
+	int err;
 #ifdef __ISAPNP__
 	short i;
 	static int pnp_cards;
 #endif
 
+	dev = alloc_etherdev(sizeof(struct corkscrew_private));
+	if (!dev)
+		return ERR_PTR(-ENOMEM);
+
+	if (unit >= 0) {
+		sprintf(dev->name, "eth%d", unit);
+		netdev_boot_setup_check(dev);
+	}
+
+	SET_MODULE_OWNER(dev);
+
 #ifdef __ISAPNP__
 	if(nopnp == 1)
 		goto no_pnp;
@@ -470,7 +519,7 @@
 			if (pnp_activate_dev(idev) < 0) {
 				printk("pnp activate failed (out of resources?)\n");
 				pnp_device_detach(idev);
-				return -ENOMEM;
+				continue;
 			}
 			if (!pnp_port_valid(idev, 0) || !pnp_irq_valid(idev, 0)) {
 				pnp_device_detach(idev);
@@ -478,40 +527,22 @@
 			}
 			ioaddr = pnp_port_start(idev, 0);
 			irq = pnp_irq(idev, 0);
-			if(corkscrew_debug)
-				printk ("ISAPNP reports %s at i/o 0x%x, irq %d\n",
-					(char*) corkscrew_isapnp_adapters[i].driver_data, ioaddr, irq);
-					
-			if ((inw(ioaddr + 0x2002) & 0x1f0) != (ioaddr & 0x1f0)) {
+			if (!check_device(ioaddr)) {
 				pnp_device_detach(idev);
 				continue;
 			}
-			/* Verify by reading the device ID from the EEPROM. */
-			{
-				int timer;
-				outw(EEPROM_Read + 7, ioaddr + Wn0EepromCmd);
-				/* Pause for at least 162 us. for the read to take place. */
-				for (timer = 4; timer >= 0; timer--) {
-					udelay(162);
-					if ((inw(ioaddr + Wn0EepromCmd) & 0x0200)
-				    		== 0)
-							break;
-				}
-				if (inw(ioaddr + Wn0EepromData) != 0x6d50) {
-					pnp_device_detach(idev);
-					continue;
-				}
-			}
+			if(corkscrew_debug)
+				printk ("ISAPNP reports %s at i/o 0x%x, irq %d\n",
+					(char*) corkscrew_isapnp_adapters[i].driver_data, ioaddr, irq);
 			printk(KERN_INFO "3c515 Resource configuration register %#4.4x, DCR %4.4x.\n",
 		     		inl(ioaddr + 0x2002), inw(ioaddr + 0x2000));
 			/* irq = inw(ioaddr + 0x2002) & 15; */ /* Use the irq from isapnp */
-			corkscrew_isapnp_phys_addr[pnp_cards] = ioaddr;
-			corkscrew_found_device(dev, ioaddr, irq, CORKSCREW_ID, dev
-				       	&& dev->mem_start ? dev->
-				       	mem_start : options[cards_found]);
-			dev = 0;
+			corkscrew_setup(dev, ioaddr, idev, cards_found++);
 			pnp_cards++;
-			cards_found++;
+			err = register_netdev(dev);
+			if (!err)
+				return dev;
+			cleanup_card(dev);
 		}
 	}
 no_pnp:
@@ -519,122 +550,64 @@
 
 	/* Check all locations on the ISA bus -- evil! */
 	for (ioaddr = 0x100; ioaddr < 0x400; ioaddr += 0x20) {
-		int irq;
-#ifdef __ISAPNP__
-		/* Make sure this was not already picked up by isapnp */
-		if(ioaddr == corkscrew_isapnp_phys_addr[0]) continue;
-		if(ioaddr == corkscrew_isapnp_phys_addr[1]) continue;
-		if(ioaddr == corkscrew_isapnp_phys_addr[2]) continue;
-#endif /* __ISAPNP__ */
-		if (check_region(ioaddr, CORKSCREW_TOTAL_SIZE))
+		if (!check_device(ioaddr))
 			continue;
-		/* Check the resource configuration for a matching ioaddr. */
-		if ((inw(ioaddr + 0x2002) & 0x1f0) != (ioaddr & 0x1f0))
-			continue;
-		/* Verify by reading the device ID from the EEPROM. */
-		{
-			int timer;
-			outw(EEPROM_Read + 7, ioaddr + Wn0EepromCmd);
-			/* Pause for at least 162 us. for the read to take place. */
-			for (timer = 4; timer >= 0; timer--) {
-				udelay(162);
-				if ((inw(ioaddr + Wn0EepromCmd) & 0x0200)
-				    == 0)
-					break;
-			}
-			if (inw(ioaddr + Wn0EepromData) != 0x6d50)
-				continue;
-		}
+
 		printk(KERN_INFO "3c515 Resource configuration register %#4.4x, DCR %4.4x.\n",
 		     inl(ioaddr + 0x2002), inw(ioaddr + 0x2000));
-		irq = inw(ioaddr + 0x2002) & 15;
-		corkscrew_found_device(dev, ioaddr, irq, CORKSCREW_ID,
-				       dev && dev->mem_start ?  dev->mem_start :
-				         (cards_found >= MAX_UNITS ? -1 :
-						options[cards_found]));
-		dev = 0;
-		cards_found++;
+		corkscrew_setup(dev, ioaddr, NULL, cards_found++);
+		err = register_netdev(dev);
+		if (!err)
+			return dev;
+		cleanup_card(dev);
 	}
-	if (corkscrew_debug)
-		printk(KERN_INFO "%d 3c515 cards found.\n", cards_found);
-	return cards_found;
+	free_netdev(dev);
+	return NULL;
 }
 
-static struct net_device *corkscrew_found_device(struct net_device *dev,
-						 int ioaddr, int irq,
-						 int product_index,
-						 int options)
+static void corkscrew_setup(struct net_device *dev, int ioaddr,
+			    struct pnp_dev *idev, int card_number)
 {
-	struct corkscrew_private *vp;
-
-#ifdef MODULE
-	/* Allocate and fill new device structure. */
-	int dev_size = sizeof(struct net_device) + sizeof(struct corkscrew_private) + 15;	/* Pad for alignment */
+	struct corkscrew_private *vp = (struct corkscrew_private *) dev->priv;
+	unsigned int eeprom[0x40], checksum = 0;	/* EEPROM contents */
+	int i;
+	int irq;
 
-	dev = (struct net_device *) kmalloc(dev_size, GFP_KERNEL);
-	if (!dev)
-		return NULL;
-	memset(dev, 0, dev_size);
-	/* Align the Rx and Tx ring entries.  */
-	dev->priv = (void *) (((long) dev + sizeof(struct net_device) + 15) & ~15);
-	vp = (struct corkscrew_private *) dev->priv;
-	dev->base_addr = ioaddr;
-	dev->irq = irq;
-	dev->dma = (product_index == CORKSCREW_ID ? inw(ioaddr + 0x2000) & 7 : 0);
-	dev->init = corkscrew_probe1;
-	vp->product_name = "3c515";
-	vp->options = options;
-	if (options >= 0) {
-		vp->media_override = ((options & 7) == 2) ? 0 : options & 7;
-		vp->full_duplex = (options & 8) ? 1 : 0;
-		vp->bus_master = (options & 16) ? 1 : 0;
+	if (idev) {
+		irq = pnp_irq(idev, 0);
+		vp->dev = &idev->dev;
 	} else {
-		vp->media_override = 7;
-		vp->full_duplex = 0;
-		vp->bus_master = 0;
+		irq = inw(ioaddr + 0x2002) & 15;
 	}
-	ether_setup(dev);
-	vp->next_module = root_corkscrew_dev;
-	root_corkscrew_dev = dev;
-	SET_MODULE_OWNER(dev);
-	if (register_netdev(dev) != 0) {
-		kfree(dev);
-		return NULL;
-	}
-#else				/* not a MODULE */
-	/* Caution: quad-word alignment required for rings! */
-	dev->priv = kmalloc(sizeof(struct corkscrew_private), GFP_KERNEL);
-	if (!dev->priv)
-		return NULL;
-	memset(dev->priv, 0, sizeof(struct corkscrew_private));
-	dev = init_etherdev(dev, sizeof(struct corkscrew_private));
+
 	dev->base_addr = ioaddr;
 	dev->irq = irq;
-	dev->dma = (product_index == CORKSCREW_ID ? inw(ioaddr + 0x2000) & 7 : 0);
-	vp = (struct corkscrew_private *) dev->priv;
+	dev->dma = inw(ioaddr + 0x2000) & 7;
 	vp->product_name = "3c515";
-	vp->options = options;
-	if (options >= 0) {
-		vp->media_override = ((options & 7) == 2) ? 0 : options & 7;
-		vp->full_duplex = (options & 8) ? 1 : 0;
-		vp->bus_master = (options & 16) ? 1 : 0;
+	vp->options = dev->mem_start;
+	vp->our_dev = dev;
+
+	if (!vp->options) {
+		 if (card_number >= MAX_UNITS)
+			vp->options = -1;
+		else
+			vp->options = options[card_number];
+	}
+
+	if (vp->options >= 0) {
+		vp->media_override = vp->options & 7;
+		if (vp->media_override == 2)
+			vp->media_override = 0;
+		vp->full_duplex = (vp->options & 8) ? 1 : 0;
+		vp->bus_master = (vp->options & 16) ? 1 : 0;
 	} else {
 		vp->media_override = 7;
 		vp->full_duplex = 0;
 		vp->bus_master = 0;
 	}
-
-	corkscrew_probe1(dev);
-#endif				/* MODULE */
-	return dev;
-}
-
-static int corkscrew_probe1(struct net_device *dev)
-{
-	int ioaddr = dev->base_addr;
-	struct corkscrew_private *vp = (struct corkscrew_private *) dev->priv;
-	unsigned int eeprom[0x40], checksum = 0;	/* EEPROM contents */
-	int i;
+#ifdef MODULE
+	list_add(&vp->list, &root_corkscrew_dev);
+#endif
 
 	printk(KERN_INFO "%s: 3Com %s at %#3x,", dev->name, vp->product_name, ioaddr);
 
@@ -706,9 +679,6 @@
 	/* vp->full_bus_master_rx = 0; */
 	vp->full_bus_master_rx = (vp->capabilities & 0x20) ? 1 : 0;
 
-	/* We do a request_region() to register /proc/ioports info. */
-	request_region(ioaddr, CORKSCREW_TOTAL_SIZE, vp->product_name);
-
 	/* The 3c51x-specific entries in the device structure. */
 	dev->open = &corkscrew_open;
 	dev->hard_start_xmit = &corkscrew_start_xmit;
@@ -718,8 +688,6 @@
 	dev->get_stats = &corkscrew_get_stats;
 	dev->set_multicast_list = &set_rx_mode;
 	dev->ethtool_ops = &netdev_ethtool_ops;
-
-	return 0;
 }
 
 
@@ -1607,20 +1575,16 @@
 #ifdef MODULE
 void cleanup_module(void)
 {
-	struct net_device *next_dev;
-
-	while (root_corkscrew_dev) {
-		next_dev =
-		    ((struct corkscrew_private *) root_corkscrew_dev->
-		     priv)->next_module;
-		if (root_corkscrew_dev->dma)
-			free_dma(root_corkscrew_dev->dma);
-		unregister_netdev(root_corkscrew_dev);
-		outw(TotalReset, root_corkscrew_dev->base_addr + EL3_CMD);
-		release_region(root_corkscrew_dev->base_addr,
-			       CORKSCREW_TOTAL_SIZE);
-		free_netdev(root_corkscrew_dev);
-		root_corkscrew_dev = next_dev;
+	while (!list_empty(&root_corkscrew_dev)) {
+		struct net_device *dev;
+		struct corkscrew_private *vp;
+
+		vp = list_entry(root_corkscrew_dev.next,
+				struct corkscrew_private, list);
+		dev = vp->our_dev;
+		unregister_netdev(dev);
+		cleanup_card(dev);
+		free_netdev(dev);
 	}
 }
 #endif				/* MODULE */
--- diff/drivers/net/3c523.c	2003-10-09 09:47:34.000000000 +0100
+++ source/drivers/net/3c523.c	2004-02-09 10:39:53.000000000 +0000
@@ -410,7 +410,7 @@
 
 /*****************************************************************/
 
-int __init elmc_probe(struct net_device *dev)
+static int __init do_elmc_probe(struct net_device *dev)
 {
 	static int slot;
 	int base_addr = dev->base_addr;
@@ -420,7 +420,7 @@
 	int i = 0;
 	unsigned int size = 0;
 	int retval;
-	struct priv *pr;
+	struct priv *pr = dev->priv;
 
 	SET_MODULE_OWNER(dev);
 	if (MCA_bus == 0) {
@@ -455,10 +455,9 @@
 	}
 
 	/* we didn't find any 3c523 in the slots we checked for */
-	if (slot == MCA_NOTFOUND) {
-		retval = ((base_addr || irq) ? -ENXIO : -ENODEV);
-		goto err_out;
-	}
+	if (slot == MCA_NOTFOUND)
+		return ((base_addr || irq) ? -ENXIO : -ENODEV);
+
 	mca_set_adapter_name(slot, "3Com 3c523 Etherlink/MC");
 	mca_set_adapter_procfn(slot, (MCA_ProcFn) elmc_getinfo, dev);
 
@@ -497,13 +496,7 @@
 		break;
 	}
 
-	pr = dev->priv = kmalloc(sizeof(struct priv), GFP_KERNEL);
-	if (dev->priv == NULL) {
-		retval = -ENOMEM;
-		goto err_out;
-	}
 	memset(pr, 0, sizeof(struct priv));
-
 	pr->slot = slot;
 
 	printk(KERN_INFO "%s: 3Com 3c523 Rev 0x%x at %#lx\n", dev->name, (int) revision,
@@ -530,8 +523,6 @@
 	if (!check586(dev, dev->mem_start, size)) {
 		printk(KERN_ERR "%s: memprobe, Can't find memory at 0x%lx!\n", dev->name,
 		       dev->mem_start);
-		kfree(dev->priv);
-		dev->priv = NULL;
 		retval = -ENODEV;
 		goto err_out;
 	}
@@ -573,8 +564,6 @@
 #endif
 	dev->ethtool_ops = &netdev_ethtool_ops;
 	
-	ether_setup(dev);
-
 	/* note that we haven't actually requested the IRQ from the kernel.
 	   That gets done in elmc_open().  I'm not sure that's such a good idea,
 	   but it works, so I'll go with it. */
@@ -585,9 +574,41 @@
 
 	return 0;
 err_out:
+	mca_set_adapter_procfn(slot, NULL, NULL);
 	release_region(dev->base_addr, ELMC_IO_EXTENT);
 	return retval;
 }
+ 
+static void cleanup_card(struct net_device *dev)
+{
+	mca_set_adapter_procfn(((struct priv *) (dev->priv))->slot, NULL, NULL);
+	release_region(dev->base_addr, ELMC_IO_EXTENT);
+}
+
+struct net_device * __init elmc_probe(int unit)
+{
+	struct net_device *dev = alloc_etherdev(sizeof(struct priv));
+	int err;
+
+	if (!dev)
+		return ERR_PTR(-ENOMEM);
+
+	sprintf(dev->name, "eth%d", unit);
+	netdev_boot_setup_check(dev);
+
+	err = do_elmc_probe(dev);
+	if (err)
+		goto out;
+	err = register_netdev(dev);
+	if (err)
+		goto out1;
+	return dev;
+out1:
+	cleanup_card(dev);
+out:
+	free_netdev(dev);
+	return ERR_PTR(err);
+}
 
 /**********************************************
  * init the chip (elmc-interrupt should be disabled?!)
@@ -1245,7 +1266,7 @@
 /* Increase if needed ;) */
 #define MAX_3C523_CARDS 4
 
-static struct net_device dev_elmc[MAX_3C523_CARDS];
+static struct net_device *dev_elmc[MAX_3C523_CARDS];
 static int irq[MAX_3C523_CARDS];
 static int io[MAX_3C523_CARDS];
 MODULE_PARM(irq, "1-" __MODULE_STRING(MAX_3C523_CARDS) "i");
@@ -1258,16 +1279,24 @@
 	int this_dev,found = 0;
 
 	/* Loop until we either can't find any more cards, or we have MAX_3C523_CARDS */	
-	for(this_dev=0; this_dev<MAX_3C523_CARDS; this_dev++) 
-		{
-		struct net_device *dev = &dev_elmc[this_dev];
+	for(this_dev=0; this_dev<MAX_3C523_CARDS; this_dev++) {
+		struct net_device *dev = alloc_etherdev(sizeof(struct priv));
+		if (!dev)
+			break;
 		dev->irq=irq[this_dev];
 		dev->base_addr=io[this_dev];
-		dev->init=elmc_probe;
-		if(register_netdev(dev)!=0) {
-			if(io[this_dev]==0) break;
-			printk(KERN_WARNING "3c523.c: No 3c523 card found at io=%#x\n",io[this_dev]);
-		} else found++;
+		if (do_elmc_probe(dev) == 0) {
+			if (register_netdev(dev) == 0) {
+				dev_elmc[this_dev] = dev;
+				found++;
+				continue;
+			}
+			cleanup_card(dev);
+		}
+		free_netdev(dev);
+		if (io[this_dev]==0)
+			break;
+		printk(KERN_WARNING "3c523.c: No 3c523 card found at io=%#x\n",io[this_dev]);
 	}
 
 	if(found==0) {
@@ -1279,31 +1308,12 @@
 void cleanup_module(void)
 {
 	int this_dev;
-	for(this_dev=0; this_dev<MAX_3C523_CARDS; this_dev++) {
-
-		struct net_device *dev = &dev_elmc[this_dev];
-		if(dev->priv) {
-			/* shutdown interrupts on the card */
-			elmc_id_reset586();
-			if (dev->irq != 0) {
-				/* this should be done by close, but if we failed to
-				   initialize properly something may have gotten hosed. */
-				free_irq(dev->irq, dev);
-				dev->irq = 0;
-			}
-			if (dev->base_addr != 0) {
-				release_region(dev->base_addr, ELMC_IO_EXTENT);
-				dev->base_addr = 0;
-			}
-			irq[this_dev] = 0;
-			io[this_dev] = 0;
+	for (this_dev=0; this_dev<MAX_3C523_CARDS; this_dev++) {
+		struct net_device *dev = dev_elmc[this_dev];
+		if (dev) {
 			unregister_netdev(dev);
-
-			mca_set_adapter_procfn(((struct priv *) (dev->priv))->slot,
-			       NULL, NULL);
-
-			kfree(dev->priv);
-			dev->priv = NULL;
+			cleanup_card(dev);
+			free_netdev(dev);
 		}
 	}
 }
--- diff/drivers/net/3c527.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/net/3c527.c	2004-02-09 10:39:53.000000000 +0000
@@ -212,8 +212,6 @@
 
 
 /* Index to functions, as function prototypes. */
-extern int mc32_probe(struct net_device *dev);
-
 static int	mc32_probe1(struct net_device *dev, int ioaddr);
 static int      mc32_command(struct net_device *dev, u16 cmd, void *data, int len);
 static int	mc32_open(struct net_device *dev);
@@ -226,9 +224,19 @@
 static void	mc32_reset_multicast_list(struct net_device *dev);
 static struct ethtool_ops netdev_ethtool_ops;
 
+static void cleanup_card(struct net_device *dev)
+{
+	struct mc32_local *lp=dev->priv;
+	unsigned slot = lp->slot;
+	mca_mark_as_unused(slot);
+	mca_set_adapter_name(slot, NULL);
+	free_irq(dev->irq, dev);
+	release_region(dev->base_addr, MC32_IO_EXTENT);
+}
+
 /**
  * mc32_probe 	-	Search for supported boards
- * @dev: device to probe
+ * @unit: interface number to use
  *
  * Because MCA bus is a real bus and we can scan for cards we could do a
  * single scan for all boards here. Right now we use the passed in device
@@ -236,10 +244,18 @@
  * in particular.
  */
 
-int __init mc32_probe(struct net_device *dev)
+struct net_device *__init mc32_probe(int unit)
 {
+	struct net_device *dev = alloc_etherdev(sizeof(struct mc32_local));
 	static int current_mca_slot = -1;
 	int i;
+	int err;
+
+	if (!dev)
+		return ERR_PTR(-ENOMEM);
+
+	if (unit >= 0)
+		sprintf(dev->name, "eth%d", unit);
 
 	SET_MODULE_OWNER(dev);
 
@@ -260,12 +276,18 @@
 				mca_set_adapter_name(current_mca_slot, 
 						mc32_adapters[i].name);
 				mca_mark_as_used(current_mca_slot);
-				return 0;
+				err = register_netdev(dev);
+				if (err) {
+					cleanup_card(dev);
+					free_netdev(dev);
+					dev = ERR_PTR(err);
+				}
+				return dev;
 			}
 			
 		}
 	}
-	return -ENODEV;
+	return ERR_PTR(-ENODEV);
 }
 
 /**
@@ -285,7 +307,7 @@
 	int i, err;
 	u8 POS;
 	u32 base;
-	struct mc32_local *lp;
+	struct mc32_local *lp = dev->priv;
 	static u16 mca_io_bases[]={
 		0x7280,0x7290,
 		0x7680,0x7690,
@@ -412,24 +434,14 @@
 	 *	Grab the IRQ
 	 */
 
-	i = request_irq(dev->irq, &mc32_interrupt, SA_SHIRQ | SA_SAMPLE_RANDOM, dev->name, dev);
-	if (i) {
+	err = request_irq(dev->irq, &mc32_interrupt, SA_SHIRQ | SA_SAMPLE_RANDOM, dev->name, dev);
+	if (err) {
 		release_region(dev->base_addr, MC32_IO_EXTENT);
 		printk(KERN_ERR "%s: unable to get IRQ %d.\n", dev->name, dev->irq);
-		return i;
-	}
-
-
-	/* Initialize the device structure. */
-	dev->priv = kmalloc(sizeof(struct mc32_local), GFP_KERNEL);
-	if (dev->priv == NULL)
-	{
-		err = -ENOMEM;
-		goto err_exit_irq; 
+		goto err_exit_ports;
 	}
 
-	memset(dev->priv, 0, sizeof(struct mc32_local));
-	lp = dev->priv;
+	memset(lp, 0, sizeof(struct mc32_local));
 	lp->slot = slot;
 
 	i=0;
@@ -443,7 +455,7 @@
 		{
 			printk(KERN_ERR "%s: failed to boot adapter.\n", dev->name);
 			err = -ENODEV; 
-			goto err_exit_free;
+			goto err_exit_irq;
 		}
 		udelay(1000);
 		if(inb(dev->base_addr+2)&(1<<5))
@@ -458,7 +470,7 @@
 		else
 			printk(KERN_ERR "%s: unknown failure %d.\n", dev->name, base);
 		err = -ENODEV; 
-		goto err_exit_free;
+		goto err_exit_irq;
 	}
 	
 	base=0;
@@ -474,7 +486,7 @@
 			{
 				printk(KERN_ERR "%s: mailbox read fail (%d).\n", dev->name, i);
 				err = -ENODEV;
-				goto err_exit_free;
+				goto err_exit_irq;
 			}
 		}
 
@@ -517,15 +529,11 @@
 	dev->watchdog_timeo	= HZ*5;	/* Board does all the work */
 	dev->ethtool_ops	= &netdev_ethtool_ops;
 
-	/* Fill in the fields of the device structure with ethernet values. */
-	ether_setup(dev);
-	
 	return 0;
 
-err_exit_free:
-	kfree(dev->priv);
 err_exit_irq:
 	free_irq(dev->irq, dev);
+err_exit_ports:
 	release_region(dev->base_addr, MC32_IO_EXTENT);
 	return err;
 }
@@ -1630,7 +1638,7 @@
 
 #ifdef MODULE
 
-static struct net_device this_device;
+static struct net_device *this_device;
 
 /**
  *	init_module		-	entry point
@@ -1642,12 +1650,9 @@
 
 int init_module(void)
 {
-	int result;
-	
-	this_device.init = mc32_probe;
-	if ((result = register_netdev(&this_device)) != 0)
-		return result;
-
+	this_device = mc32_probe(-1);
+	if (IS_ERR(this_device))
+		return PTR_ERR(this_device);
 	return 0;
 }
 
@@ -1664,24 +1669,9 @@
 
 void cleanup_module(void)
 {
-	int slot;
-	
-	unregister_netdev(&this_device);
-
-	/*
-	 * If we don't do this, we can't re-insmod it later.
-	 */
-	 
-	if (this_device.priv)
-	{
-		struct mc32_local *lp=this_device.priv;
-		slot = lp->slot;
-		mca_mark_as_unused(slot);
-		mca_set_adapter_name(slot, NULL);
-		kfree(this_device.priv);
-	}
-	free_irq(this_device.irq, &this_device);
-	release_region(this_device.base_addr, MC32_IO_EXTENT);
+	unregister_netdev(this_device);
+	cleanup_card(this_device);
+	free_netdev(this_device);
 }
 
 #endif /* MODULE */
--- diff/drivers/net/3c59x.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/net/3c59x.c	2004-02-09 10:39:53.000000000 +0000
@@ -920,6 +920,18 @@
 
 static int vortex_cards_found;
 
+#ifdef CONFIG_NET_POLL_CONTROLLER
+static void poll_vortex(struct net_device *dev)
+{
+	struct vortex_private *vp = (struct vortex_private *)dev->priv;
+	unsigned long flags;
+	local_save_flags(flags);
+	local_irq_disable();
+	(vp->full_bus_master_rx ? boomerang_interrupt:vortex_interrupt)(dev->irq,dev,NULL);
+	local_irq_restore(flags);
+} 
+#endif
+
 #ifdef CONFIG_PM
 
 static int vortex_suspend (struct pci_dev *pdev, u32 state)
@@ -1450,6 +1462,9 @@
 	dev->set_multicast_list = set_rx_mode;
 	dev->tx_timeout = vortex_tx_timeout;
 	dev->watchdog_timeo = (watchdog * HZ) / 1000;
+#ifdef CONFIG_NET_POLL_CONTROLLER
+	dev->poll_controller = poll_vortex; 
+#endif
 	if (pdev) {
 		vp->pm_state_valid = 1;
  		pci_save_state(VORTEX_PCI(vp), vp->power_state);
--- diff/drivers/net/8139too.c	2004-01-19 10:22:57.000000000 +0000
+++ source/drivers/net/8139too.c	2004-02-09 10:39:53.000000000 +0000
@@ -92,7 +92,7 @@
 */
 
 #define DRV_NAME	"8139too"
-#define DRV_VERSION	"0.9.26"
+#define DRV_VERSION	"0.9.27"
 
 
 #include <linux/config.h>
@@ -117,17 +117,17 @@
 #define RTL8139_DRIVER_NAME   DRV_NAME " Fast Ethernet driver " DRV_VERSION
 #define PFX DRV_NAME ": "
 
+/* Default Message level */
+#define RTL8139_DEF_MSG_ENABLE   (NETIF_MSG_DRV   | \
+                                 NETIF_MSG_PROBE  | \
+                                 NETIF_MSG_LINK)
+
 
 /* enable PIO instead of MMIO, if CONFIG_8139TOO_PIO is selected */
 #ifdef CONFIG_8139TOO_PIO
 #define USE_IO_OPS 1
 #endif
 
-/* use a 16K rx ring buffer instead of the default 32K */
-#ifdef CONFIG_SH_DREAMCAST
-#define USE_BUF16K 1
-#endif
-
 /* define to 1 to enable copious debugging info */
 #undef RTL8139_DEBUG
 
@@ -146,9 +146,9 @@
 #  define assert(expr) do {} while (0)
 #else
 #  define assert(expr) \
-        if(!(expr)) {					\
-        printk( "Assertion failed! %s,%s,%s,line=%d\n",	\
-        #expr,__FILE__,__FUNCTION__,__LINE__);		\
+        if(unlikely(!(expr))) {				        \
+        printk(KERN_ERR "Assertion failed! %s,%s,%s,line=%d\n",	\
+        #expr,__FILE__,__FUNCTION__,__LINE__);		        \
         }
 #endif
 
@@ -159,9 +159,6 @@
 static int media[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1};
 static int full_duplex[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1};
 
-/* Maximum events (Rx packets, etc.) to handle at each interrupt. */
-static int max_interrupt_work = 20;
-
 /* Maximum number of multicast addresses to filter (vs. Rx-all-multicast).
    The RTL chips use a 64 element hash table based on the Ethernet CRC.  */
 static int multicast_filter_limit = 32;
@@ -169,16 +166,16 @@
 /* bitmapped message enable number */
 static int debug = -1;
 
-/* Size of the in-memory receive ring. */
-#ifdef USE_BUF16K
-#define RX_BUF_LEN_IDX	1	/* 0==8K, 1==16K, 2==32K, 3==64K */
-#else
-#define RX_BUF_LEN_IDX	2	/* 0==8K, 1==16K, 2==32K, 3==64K */
-#endif
-#define RX_BUF_LEN	(8192 << RX_BUF_LEN_IDX)
+/* Ring size is now a config option */
+#define RX_BUF_LEN	(8192 << CONFIG_8139_RXBUF_IDX)
 #define RX_BUF_PAD	16
 #define RX_BUF_WRAP_PAD 2048 /* spare padding to handle lack of packet wrap */
+
+#if RX_BUF_LEN == 65536
+#define RX_BUF_TOT_LEN	RX_BUF_LEN
+#else
 #define RX_BUF_TOT_LEN	(RX_BUF_LEN + RX_BUF_PAD + RX_BUF_WRAP_PAD)
+#endif
 
 /* Number of Tx descriptor registers. */
 #define NUM_TX_DESC	4
@@ -251,6 +248,10 @@
 	{0x11db, 0x1234, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 },
 	{0x1432, 0x9130, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 },
 	{0x02ac, 0x1012, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 },
+	{0x018a, 0x0106, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 },
+	{0x126c, 0x1211, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 },
+	{0x1743, 0x8139, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 },
+	{0x021b, 0x8139, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 }, 
 
 #ifdef CONFIG_SH_SECUREEDGE5410
 	/* Bogus 8139 silicon reports 8129 without external PROM :-( */
@@ -450,7 +451,7 @@
 	RxCfgRcv32K = (1 << 12),
 	RxCfgRcv64K = (1 << 11) | (1 << 12),
 
-	/* Disable packet wrap at end of Rx buffer */
+	/* Disable packet wrap at end of Rx buffer. (not possible with 64k) */
 	RxNoWrap = (1 << 7),
 };
 
@@ -560,6 +561,7 @@
 	int drv_flags;
 	struct pci_dev *pci_dev;
 	u32 pci_state[16];
+	u32 msg_enable;
 	struct net_device_stats stats;
 	unsigned char *rx_ring;
 	unsigned int cur_rx;	/* Index into the Rx buffer of next Rx pkt. */
@@ -574,6 +576,7 @@
 	char twistie, twist_row, twist_col;	/* Twister tune state. */
 	unsigned int default_port:4;	/* Last dev->if_port value. */
 	spinlock_t lock;
+	spinlock_t rx_lock;
 	chip_t chipset;
 	pid_t thr_pid;
 	wait_queue_head_t thr_wait;
@@ -590,13 +593,11 @@
 MODULE_LICENSE("GPL");
 
 MODULE_PARM (multicast_filter_limit, "i");
-MODULE_PARM (max_interrupt_work, "i");
 MODULE_PARM (media, "1-" __MODULE_STRING(MAX_UNITS) "i");
 MODULE_PARM (full_duplex, "1-" __MODULE_STRING(MAX_UNITS) "i");
 MODULE_PARM (debug, "i");
 MODULE_PARM_DESC (debug, "8139too bitmapped message enable number");
 MODULE_PARM_DESC (multicast_filter_limit, "8139too maximum number of filtered multicast addresses");
-MODULE_PARM_DESC (max_interrupt_work, "8139too maximum events handled per interrupt");
 MODULE_PARM_DESC (media, "8139too: Bits 4+9: force full duplex, bit 5: 100Mbps");
 MODULE_PARM_DESC (full_duplex, "8139too: Force full duplex for board(s) (1)");
 
@@ -610,6 +611,10 @@
 static void rtl8139_init_ring (struct net_device *dev);
 static int rtl8139_start_xmit (struct sk_buff *skb,
 			       struct net_device *dev);
+static int rtl8139_poll(struct net_device *dev, int *budget);
+#ifdef CONFIG_NET_POLL_CONTROLLER
+static void rtl8139_poll_controller(struct net_device *dev);
+#endif
 static irqreturn_t rtl8139_interrupt (int irq, void *dev_instance,
 			       struct pt_regs *regs);
 static int rtl8139_close (struct net_device *dev);
@@ -682,16 +687,32 @@
 	PCIErr | PCSTimeout | RxUnderrun | RxOverflow | RxFIFOOver |
 	TxErr | TxOK | RxErr | RxOK;
 
-#ifdef USE_BUF16K 
+static const u16 rtl8139_norx_intr_mask =
+	PCIErr | PCSTimeout | RxUnderrun |
+	TxErr | TxOK | RxErr ;
+
+#if CONFIG_8139_RXBUF_IDX == 0
+static const unsigned int rtl8139_rx_config =
+	RxCfgRcv8K | RxNoWrap |
+	(RX_FIFO_THRESH << RxCfgFIFOShift) |
+	(RX_DMA_BURST << RxCfgDMAShift);
+#elif CONFIG_8139_RXBUF_IDX == 1
 static const unsigned int rtl8139_rx_config =
 	RxCfgRcv16K | RxNoWrap |
 	(RX_FIFO_THRESH << RxCfgFIFOShift) |
 	(RX_DMA_BURST << RxCfgDMAShift);
-#else
+#elif CONFIG_8139_RXBUF_IDX == 2
 static const unsigned int rtl8139_rx_config =
 	RxCfgRcv32K | RxNoWrap |
 	(RX_FIFO_THRESH << RxCfgFIFOShift) |
 	(RX_DMA_BURST << RxCfgDMAShift);
+#elif CONFIG_8139_RXBUF_IDX == 3
+static const unsigned int rtl8139_rx_config =
+	RxCfgRcv64K |
+	(RX_FIFO_THRESH << RxCfgFIFOShift) |
+	(RX_DMA_BURST << RxCfgDMAShift);
+#else
+#error "Invalid configuration for 8139_RXBUF_IDX"
 #endif
 
 static const unsigned int rtl8139_tx_config =
@@ -868,9 +889,7 @@
 
 match:
 	DPRINTK ("chipset id (%d) == index %d, '%s'\n",
-		tmp,
-		tp->chipset,
-		rtl_chip_info[tp->chipset].name);
+		 version, i, rtl_chip_info[i].name);
 
 	if (tp->chipset >= CH_8139B) {
 		u8 new_tmp8 = tmp8 = RTL_R8 (Config1);
@@ -964,6 +983,8 @@
 	/* The Rtl8139-specific entries in the device structure. */
 	dev->open = rtl8139_open;
 	dev->hard_start_xmit = rtl8139_start_xmit;
+	dev->poll = rtl8139_poll;
+	dev->weight = 64;
 	dev->stop = rtl8139_close;
 	dev->get_stats = rtl8139_get_stats;
 	dev->set_multicast_list = rtl8139_set_rx_mode;
@@ -971,6 +992,9 @@
 	dev->ethtool_ops = &rtl8139_ethtool_ops;
 	dev->tx_timeout = rtl8139_tx_timeout;
 	dev->watchdog_timeo = TX_TIMEOUT;
+#ifdef CONFIG_NET_POLL_CONTROLLER
+	dev->poll_controller = rtl8139_poll_controller;
+#endif
 
 	/* note: the hardware is not capable of sg/csum/highdma, however
 	 * through the use of skb_copy_and_csum_dev we enable these
@@ -986,7 +1010,10 @@
 	/* note: tp->chipset set in rtl8139_init_board */
 	tp->drv_flags = board_info[ent->driver_data].hw_flags;
 	tp->mmio_addr = ioaddr;
+	tp->msg_enable =
+		(debug < 0 ? RTL8139_DEF_MSG_ENABLE : ((1 << debug) - 1));
 	spin_lock_init (&tp->lock);
+	spin_lock_init (&tp->rx_lock);
 	init_waitqueue_head (&tp->thr_wait);
 	init_completion (&tp->thr_exited);
 	tp->mii.dev = dev;
@@ -1288,9 +1315,7 @@
 {
 	struct rtl8139_private *tp = dev->priv;
 	int retval;
-#ifdef RTL8139_DEBUG
 	void *ioaddr = tp->mmio_addr;
-#endif
 
 	retval = request_irq (dev->irq, rtl8139_interrupt, SA_SHIRQ, dev->name, dev);
 	if (retval)
@@ -1319,8 +1344,10 @@
 
 	rtl8139_init_ring (dev);
 	rtl8139_hw_start (dev);
+	netif_start_queue (dev);
 
-	DPRINTK ("%s: rtl8139_open() ioaddr %#lx IRQ %d"
+	if (netif_msg_ifup(tp))
+		printk(KERN_DEBUG "%s: rtl8139_open() ioaddr %#lx IRQ %d"
 			" GP Pins %2.2x %s-duplex.\n",
 			dev->name, pci_resource_start (tp->pci_dev, 1),
 			dev->irq, RTL_R8 (MediaStatus),
@@ -1337,7 +1364,7 @@
 	struct rtl8139_private *tp = dev->priv;
 
 	if (tp->phys[0] >= 0) {
-		mii_check_media(&tp->mii, 1, init_media);
+		mii_check_media(&tp->mii, netif_msg_link(tp), init_media);
 	}
 }
 
@@ -1407,8 +1434,6 @@
 
 	/* Enable all known interrupts by setting the interrupt mask. */
 	RTL_W16 (IntrMask, rtl8139_intr_mask);
-
-	netif_start_queue (dev);
 }
 
 
@@ -1631,7 +1656,7 @@
 	}
 }
 
-static void rtl8139_tx_clear (struct rtl8139_private *tp)
+static inline void rtl8139_tx_clear (struct rtl8139_private *tp)
 {
 	tp->cur_tx = 0;
 	tp->dirty_tx = 0;
@@ -1661,6 +1686,7 @@
 	if (tmp8 & CmdTxEnb)
 		RTL_W8 (ChipCmd, CmdRxEnb);
 
+	spin_lock(&tp->rx_lock);
 	/* Disable interrupts by clearing the interrupt mask. */
 	RTL_W16 (IntrMask, 0x0000);
 
@@ -1679,9 +1705,12 @@
 	spin_unlock_irqrestore (&tp->lock, flags);
 
 	/* ...and finally, reset everything */
-	rtl8139_hw_start (dev);
-
-	netif_wake_queue (dev);
+	if (netif_running(dev)) {
+		rtl8139_hw_start (dev);
+		netif_wake_queue (dev);
+	}
+	spin_unlock(&tp->rx_lock);
+	
 }
 
 
@@ -1695,6 +1724,7 @@
 	/* Calculate the next Tx descriptor entry. */
 	entry = tp->cur_tx % NUM_TX_DESC;
 
+	/* Note: the chip doesn't have auto-pad! */
 	if (likely(len < TX_BUF_SIZE)) {
 		if (len < ETH_ZLEN)
 			memset(tp->tx_buf[entry], 0, ETH_ZLEN);
@@ -1706,7 +1736,6 @@
 		return 0;
 	}
 
-	/* Note: the chip doesn't have auto-pad! */
 	spin_lock_irq(&tp->lock);
 	RTL_W32_F (TxStatus0 + (entry * sizeof (u32)),
 		   tp->tx_flag | max(len, (unsigned int)ETH_ZLEN));
@@ -1720,8 +1749,9 @@
 		netif_stop_queue (dev);
 	spin_unlock_irq(&tp->lock);
 
-	DPRINTK ("%s: Queued Tx packet size %u to slot %d.\n",
-		 dev->name, len, entry);
+	if (netif_msg_tx_queued(tp))
+		printk (KERN_DEBUG "%s: Queued Tx packet size %u to slot %d.\n",
+			dev->name, len, entry);
 
 	return 0;
 }
@@ -1751,8 +1781,9 @@
 		/* Note: TxCarrierLost is always asserted at 100mbps. */
 		if (txstatus & (TxOutOfWindow | TxAborted)) {
 			/* There was an major error, log it. */
-			DPRINTK ("%s: Transmit error, Tx status %8.8x.\n",
-				 dev->name, txstatus);
+			if (netif_msg_tx_err(tp))
+				printk(KERN_DEBUG "%s: Transmit error, Tx status %8.8x.\n",
+					dev->name, txstatus);
 			tp->stats.tx_errors++;
 			if (txstatus & TxAborted) {
 				tp->stats.tx_aborted_errors++;
@@ -1792,8 +1823,7 @@
 	if (tp->dirty_tx != dirty_tx) {
 		tp->dirty_tx = dirty_tx;
 		mb();
-		if (netif_queue_stopped (dev))
-			netif_wake_queue (dev);
+		netif_wake_queue (dev);
 	}
 }
 
@@ -1807,8 +1837,9 @@
 	int tmp_work;
 #endif
 
-	DPRINTK ("%s: Ethernet frame had errors, status %8.8x.\n",
-	         dev->name, rx_status);
+	if (netif_msg_rx_err (tp)) 
+		printk(KERN_DEBUG "%s: Ethernet frame had errors, status %8.8x.\n",
+			dev->name, rx_status);
 	tp->stats.rx_errors++;
 	if (!(rx_status & RxStatusOK)) {
 		if (rx_status & RxTooLong) {
@@ -1880,30 +1911,41 @@
 #endif
 }
 
-static void rtl8139_rx_interrupt (struct net_device *dev,
-				  struct rtl8139_private *tp, void *ioaddr)
-{
-	unsigned char *rx_ring;
-	u16 cur_rx;
-
-	assert (dev != NULL);
-	assert (tp != NULL);
-	assert (ioaddr != NULL);
+#if CONFIG_8139_RXBUF_IDX == 3
+static __inline__ void wrap_copy(struct sk_buff *skb, const unsigned char *ring,
+				 u32 offset, unsigned int size)
+{
+	u32 left = RX_BUF_LEN - offset;
+
+	if (size > left) {
+		memcpy(skb->data, ring + offset, left);
+		memcpy(skb->data+left, ring, size - left);
+	} else
+		memcpy(skb->data, ring + offset, size);
+}
+#endif
 
-	rx_ring = tp->rx_ring;
-	cur_rx = tp->cur_rx;
+static int rtl8139_rx(struct net_device *dev, struct rtl8139_private *tp,
+		      int budget)
+{
+	void *ioaddr = tp->mmio_addr;
+	int received = 0;
+	unsigned char *rx_ring = tp->rx_ring;
+	unsigned int cur_rx = tp->cur_rx;
 
 	DPRINTK ("%s: In rtl8139_rx(), current %4.4x BufAddr %4.4x,"
 		 " free to %4.4x, Cmd %2.2x.\n", dev->name, cur_rx,
 		 RTL_R16 (RxBufAddr),
 		 RTL_R16 (RxBufPtr), RTL_R8 (ChipCmd));
 
-	while ((RTL_R8 (ChipCmd) & RxBufEmpty) == 0) {
-		int ring_offset = cur_rx % RX_BUF_LEN;
+	while (netif_running(dev) && received < budget 
+	       && (RTL_R8 (ChipCmd) & RxBufEmpty) == 0) {
+		u32 ring_offset = cur_rx % RX_BUF_LEN;
 		u32 rx_status;
 		unsigned int rx_size;
 		unsigned int pkt_size;
 		struct sk_buff *skb;
+		u16 status;
 
 		rmb();
 
@@ -1912,8 +1954,9 @@
 		rx_size = rx_status >> 16;
 		pkt_size = rx_size - 4;
 
-		DPRINTK ("%s:  rtl8139_rx() status %4.4x, size %4.4x,"
-			 " cur %4.4x.\n", dev->name, rx_status,
+		if (netif_msg_rx_status(tp))
+			printk(KERN_DEBUG "%s:  rtl8139_rx() status %4.4x, size %4.4x,"
+				" cur %4.4x.\n", dev->name, rx_status,
 			 rx_size, cur_rx);
 #if RTL8139_DEBUG > 2
 		{
@@ -1930,9 +1973,9 @@
 		 * Theoretically, this should never happen
 		 * since EarlyRx is disabled.
 		 */
-		if (rx_size == 0xfff0) {
+		if (unlikely(rx_size == 0xfff0)) {
 			tp->xstats.early_rx++;
-			break;
+			goto done;
 		}
 
 		/* If Rx err or invalid rx_size/rx_status received
@@ -1940,55 +1983,69 @@
 		 * Rx process gets reset, so we abort any further
 		 * Rx processing.
 		 */
-		if ((rx_size > (MAX_ETH_FRAME_SIZE+4)) ||
-		    (rx_size < 8) ||
-		    (!(rx_status & RxStatusOK))) {
+		if (unlikely((rx_size > (MAX_ETH_FRAME_SIZE+4)) ||
+			     (rx_size < 8) ||
+			     (!(rx_status & RxStatusOK)))) {
 			rtl8139_rx_err (rx_status, dev, tp, ioaddr);
-			return;
+			return -1;
 		}
 
 		/* Malloc up new buffer, compatible with net-2e. */
 		/* Omit the four octet CRC from the length. */
 
-		/* TODO: consider allocating skb's outside of
-		 * interrupt context, both to speed interrupt processing,
-		 * and also to reduce the chances of having to
-		 * drop packets here under memory pressure.
-		 */
-
 		skb = dev_alloc_skb (pkt_size + 2);
-		if (skb) {
+		if (likely(skb)) {
 			skb->dev = dev;
 			skb_reserve (skb, 2);	/* 16 byte align the IP fields. */
-
+#if CONFIG_8139_RXBUF_IDX == 3
+			wrap_copy(skb, rx_ring, ring_offset+4, pkt_size);
+#else
 			eth_copy_and_sum (skb, &rx_ring[ring_offset + 4], pkt_size, 0);
+#endif
 			skb_put (skb, pkt_size);
 
 			skb->protocol = eth_type_trans (skb, dev);
-			netif_rx (skb);
+
 			dev->last_rx = jiffies;
 			tp->stats.rx_bytes += pkt_size;
 			tp->stats.rx_packets++;
+
+			netif_receive_skb (skb);
 		} else {
-			printk (KERN_WARNING
-				"%s: Memory squeeze, dropping packet.\n",
-				dev->name);
+			if (net_ratelimit()) 
+				printk (KERN_WARNING
+					"%s: Memory squeeze, dropping packet.\n",
+					dev->name);
 			tp->stats.rx_dropped++;
 		}
+		received++;
 
 		cur_rx = (cur_rx + rx_size + 4 + 3) & ~3;
-		RTL_W16 (RxBufPtr, cur_rx - 16);
+		RTL_W16 (RxBufPtr, (u16) (cur_rx - 16));
 
-		if (RTL_R16 (IntrStatus) & RxAckBits)
+		/* Clear out errors and receive interrupts */
+		status = RTL_R16 (IntrStatus) & RxAckBits;
+		if (likely(status != 0)) {
+			if (unlikely(status & (RxFIFOOver | RxOverflow))) {
+				tp->stats.rx_errors++;
+				if (status & RxFIFOOver)
+					tp->stats.rx_fifo_errors++;
+			}
 			RTL_W16_F (IntrStatus, RxAckBits);
+		}
 	}
 
+ done:
+
+#if RTL8139_DEBUG > 1
 	DPRINTK ("%s: Done rtl8139_rx(), current %4.4x BufAddr %4.4x,"
 		 " free to %4.4x, Cmd %2.2x.\n", dev->name, cur_rx,
 		 RTL_R16 (RxBufAddr),
 		 RTL_R16 (RxBufPtr), RTL_R8 (ChipCmd));
+#endif
 
 	tp->cur_rx = cur_rx;
+	return received;
 }
 
 
@@ -2014,14 +2071,12 @@
 		status &= ~RxUnderrun;
 	}
 
-	/* XXX along with rtl8139_rx_err, are we double-counting errors? */
-	if (status &
-	    (RxUnderrun | RxOverflow | RxErr | RxFIFOOver))
+	if (status & (RxUnderrun | RxErr))
 		tp->stats.rx_errors++;
 
 	if (status & PCSTimeout)
 		tp->stats.rx_length_errors++;
-	if (status & (RxUnderrun | RxFIFOOver))
+	if (status & RxUnderrun)
 		tp->stats.rx_fifo_errors++;
 	if (status & PCIErr) {
 		u16 pci_cmd_status;
@@ -2033,6 +2088,39 @@
 	}
 }
 
+static int rtl8139_poll(struct net_device *dev, int *budget)
+{
+	struct rtl8139_private *tp = dev->priv;
+	void *ioaddr = tp->mmio_addr;
+	int orig_budget = min(*budget, dev->quota);
+	int done = 1;
+
+	spin_lock(&tp->rx_lock);
+	if (likely(RTL_R16(IntrStatus) & RxAckBits)) {
+		int work_done;
+
+		work_done = rtl8139_rx(dev, tp, orig_budget);
+		if (likely(work_done > 0)) {
+			*budget -= work_done;
+			dev->quota -= work_done;
+			done = (work_done < orig_budget);
+		}
+	}
+
+	if (done) {
+		/*
+		 * Order is important since data can get interrupted
+		 * again when we think we are done.
+		 */
+		local_irq_disable();
+		RTL_W16_F(IntrMask, rtl8139_intr_mask);
+		__netif_rx_complete(dev);
+		local_irq_enable();
+	}
+	spin_unlock(&tp->rx_lock);
+
+	return !done;
+}
 
 /* The interrupt handler does all of the Rx thread work and cleans up
    after the Tx thread. */
@@ -2041,68 +2129,59 @@
 {
 	struct net_device *dev = (struct net_device *) dev_instance;
 	struct rtl8139_private *tp = dev->priv;
-	int boguscnt = max_interrupt_work;
 	void *ioaddr = tp->mmio_addr;
-	int ackstat, status;
+	u16 status, ackstat;
 	int link_changed = 0; /* avoid bogus "uninit" warning */
 	int handled = 0;
 
 	spin_lock (&tp->lock);
+	status = RTL_R16 (IntrStatus);
 
-	do {
-		status = RTL_R16 (IntrStatus);
+	/* shared irq? */
+	if (unlikely((status & rtl8139_intr_mask) == 0)) 
+		goto out;
 
-		/* h/w no longer present (hotplug?) or major error, bail */
-		if (status == 0xFFFF)
-			break;
+	handled = 1;
 
-		if ((status &
-		     (PCIErr | PCSTimeout | RxUnderrun | RxOverflow |
-		      RxFIFOOver | TxErr | TxOK | RxErr | RxOK)) == 0)
-			break;
+	/* h/w no longer present (hotplug?) or major error, bail */
+	if (unlikely(status == 0xFFFF)) 
+		goto out;
 
-		handled = 1;
+	/* close possible race's with dev_close */
+	if (unlikely(!netif_running(dev))) {
+		RTL_W16 (IntrMask, 0);
+		goto out;
+	}
 
-		/* Acknowledge all of the current interrupt sources ASAP, but
-		   an first get an additional status bit from CSCR. */
-		if (status & RxUnderrun)
-			link_changed = RTL_R16 (CSCR) & CSCR_LinkChangeBit;
+	/* Acknowledge all of the current interrupt sources ASAP, but
+	   an first get an additional status bit from CSCR. */
+	if (unlikely(status & RxUnderrun))
+		link_changed = RTL_R16 (CSCR) & CSCR_LinkChangeBit;
 
-		/* The chip takes special action when we clear RxAckBits,
-		 * so we clear them later in rtl8139_rx_interrupt
-		 */
-		ackstat = status & ~(RxAckBits | TxErr);
+	ackstat = status & ~(RxAckBits | TxErr);
+	if (ackstat)
 		RTL_W16 (IntrStatus, ackstat);
 
-		DPRINTK ("%s: interrupt  status=%#4.4x ackstat=%#4.4x new intstat=%#4.4x.\n",
-			 dev->name, status, ackstat, RTL_R16 (IntrStatus));
-
-		if (netif_running (dev) && (status & RxAckBits))
-			rtl8139_rx_interrupt (dev, tp, ioaddr);
-
-		/* Check uncommon events with one test. */
-		if (status & (PCIErr | PCSTimeout | RxUnderrun | RxOverflow |
-		  	      RxFIFOOver | RxErr))
-			rtl8139_weird_interrupt (dev, tp, ioaddr,
-						 status, link_changed);
-
-		if (netif_running (dev) && (status & (TxOK | TxErr))) {
-			rtl8139_tx_interrupt (dev, tp, ioaddr);
-			if (status & TxErr)
-				RTL_W16 (IntrStatus, TxErr);
+	/* Receive packets are processed by poll routine.
+	   If not running start it now. */
+	if (status & RxAckBits){
+		if (netif_rx_schedule_prep(dev)) {
+			RTL_W16_F (IntrMask, rtl8139_norx_intr_mask);
+			__netif_rx_schedule (dev);
 		}
-
-		boguscnt--;
-	} while (boguscnt > 0);
-
-	if (boguscnt <= 0) {
-		printk (KERN_WARNING "%s: Too much work at interrupt, "
-			"IntrStatus=0x%4.4x.\n", dev->name, status);
-
-		/* Clear all interrupt sources. */
-		RTL_W16 (IntrStatus, 0xffff);
 	}
 
+	/* Check uncommon events with one test. */
+	if (unlikely(status & (PCIErr | PCSTimeout | RxUnderrun | RxErr)))
+		rtl8139_weird_interrupt (dev, tp, ioaddr,
+					 status, link_changed);
+
+	if (status & (TxOK | TxErr)) {
+		rtl8139_tx_interrupt (dev, tp, ioaddr);
+		if (status & TxErr)
+			RTL_W16 (IntrStatus, TxErr);
+	}
+ out:
 	spin_unlock (&tp->lock);
 
 	DPRINTK ("%s: exiting interrupt, intr_status=%#4.4x.\n",
@@ -2110,6 +2189,18 @@
 	return IRQ_RETVAL(handled);
 }
 
+#ifdef CONFIG_NET_POLL_CONTROLLER
+/*
+ * Polling receive - used by netconsole and other diagnostic tools
+ * to allow network i/o with interrupts disabled.
+ */
+static void rtl8139_poll_controller(struct net_device *dev)
+{
+	disable_irq(dev->irq);
+	rtl8139_interrupt(dev->irq, dev, NULL);
+	enable_irq(dev->irq);
+}
+#endif
 
 static int rtl8139_close (struct net_device *dev)
 {
@@ -2130,8 +2221,9 @@
 		}
 		wait_for_completion (&tp->thr_exited);
 	}
-
-	DPRINTK ("%s: Shutting down ethercard, status was 0x%4.4x.\n",
+	
+	if (netif_msg_ifdown(tp))
+		printk(KERN_DEBUG "%s: Shutting down ethercard, status was 0x%4.4x.\n",
 			dev->name, RTL_R16 (IntrStatus));
 
 	spin_lock_irqsave (&tp->lock, flags);
@@ -2289,12 +2381,14 @@
 
 static u32 rtl8139_get_msglevel(struct net_device *dev)
 {
-	return debug;
+	struct rtl8139_private *np = dev->priv;
+	return np->msg_enable;
 }
 
 static void rtl8139_set_msglevel(struct net_device *dev, u32 datum)
 {
-	debug = datum;
+	struct rtl8139_private *np = dev->priv;
+	np->msg_enable = datum;
 }
 
 /* TODO: we are too slack to do reg dumping for pio, for now */
--- diff/drivers/net/82596.c	2003-08-20 14:16:29.000000000 +0100
+++ source/drivers/net/82596.c	2004-02-09 10:39:53.000000000 +0000
@@ -1129,21 +1129,40 @@
 	printk(" %02X%02X, %s\n", add[12], add[13], str);
 }
 
-int __init i82596_probe(struct net_device *dev)
+static int io = 0x300;
+static int irq = 10;
+
+struct net_device * __init i82596_probe(int unit)
 {
+	struct net_device *dev;
 	int i;
 	struct i596_private *lp;
 	char eth_addr[8];
 	static int probed;
+	int err;
 
 	if (probed)
-		return -ENODEV;
+		return ERR_PTR(-ENODEV);
 	probed++;
+
+	dev = alloc_etherdev(0);
+	if (!dev)
+		return ERR_PTR(-ENOMEM);
+
+	if (unit >= 0) {
+		sprintf(dev->name, "eth%d", unit);
+		netdev_boot_setup_check(dev);
+	} else {
+		dev->base_addr = io;
+		dev->irq = irq;
+	}
+
 #ifdef ENABLE_MVME16x_NET
 	if (MACH_IS_MVME16x) {
 		if (mvme16x_config & MVME16x_CONFIG_NO_ETHERNET) {
 			printk(KERN_NOTICE "Ethernet probe disabled - chip not present\n");
-			return -ENODEV;
+			err = -ENODEV;
+			goto out;
 		}
 		memcpy(eth_addr, (void *) 0xfffc1f2c, 6);	/* YUCK! Get addr from NOVRAM */
 		dev->base_addr = MVME_I596_BASE;
@@ -1174,7 +1193,8 @@
 
 		if (!request_region(ioaddr, I596_TOTAL_SIZE, dev->name)) {
 			printk(KERN_ERR "82596: IO address 0x%04x in use\n", ioaddr);
-			return -EBUSY;
+			err = -EBUSY;
+			goto out;
 		}
 
 		for (i = 0; i < 8; i++) {
@@ -1190,8 +1210,8 @@
 
 		if ((checksum % 0x100) || 
 		    (memcmp(eth_addr, "\x00\x00\x49", 3) != 0)) {
-			release_region(ioaddr, I596_TOTAL_SIZE);
-			return -ENODEV;
+			err = -ENODEV;
+			goto out1;
 		}
 
 		dev->base_addr = ioaddr;
@@ -1200,13 +1220,10 @@
 #endif
 	dev->mem_start = (int)__get_free_pages(GFP_ATOMIC, 0);
 	if (!dev->mem_start) {
-#ifdef ENABLE_APRICOT
-		release_region(dev->base_addr, I596_TOTAL_SIZE);
-#endif
-		return -ENOMEM;
+		err = -ENOMEM;
+		goto out1;
 	}
 
-	ether_setup(dev);
 	DEB(DEB_PROBE,printk(KERN_INFO "%s: 82596 at %#3lx,", dev->name, dev->base_addr));
 
 	for (i = 0; i < 6; i++)
@@ -1244,7 +1261,26 @@
 	lp->scb.rfd = I596_NULL;
 	lp->lock = SPIN_LOCK_UNLOCKED;
 
-	return 0;
+	err = register_netdev(dev);
+	if (err)
+		goto out2;
+	return dev;
+out2:
+#ifdef __mc68000__
+	/* XXX This assumes default cache mode to be IOMAP_FULL_CACHING,
+	 * XXX which may be invalid (CONFIG_060_WRITETHROUGH)
+	 */
+	kernel_set_cachemode((void *)(dev->mem_start), 4096,
+			IOMAP_FULL_CACHING);
+#endif
+	free_page ((u32)(dev->mem_start));
+out1:
+#ifdef ENABLE_APRICOT
+	release_region(dev->base_addr, I596_TOTAL_SIZE);
+#endif
+out:
+	free_netdev(dev);
+	return ERR_PTR(err);
 }
 
 static irqreturn_t i596_interrupt(int irq, void *dev_id, struct pt_regs *regs)
@@ -1532,11 +1568,9 @@
 }
 
 #ifdef MODULE
-static struct net_device dev_82596 = { .init = i82596_probe };
+static struct net_device *dev_82596;
 
 #ifdef ENABLE_APRICOT
-static int io = 0x300;
-static int irq = 10;
 MODULE_PARM(irq, "i");
 MODULE_PARM_DESC(irq, "Apricot IRQ number");
 #endif
@@ -1547,34 +1581,31 @@
 
 int init_module(void)
 {
-#ifdef ENABLE_APRICOT
-	dev_82596.base_addr = io;
-	dev_82596.irq = irq;
-#endif
 	if (debug >= 0)
 		i596_debug = debug;
-	if (register_netdev(&dev_82596) != 0)
-		return -EIO;
+	dev_82596 = i82596_probe(-1);
+	if (IS_ERR(dev_82596))
+		return PTR_ERR(dev_82596);
 	return 0;
 }
 
 void cleanup_module(void)
 {
-	unregister_netdev(&dev_82596);
+	unregister_netdev(dev_82596);
 #ifdef __mc68000__
 	/* XXX This assumes default cache mode to be IOMAP_FULL_CACHING,
 	 * XXX which may be invalid (CONFIG_060_WRITETHROUGH)
 	 */
 
-	kernel_set_cachemode((void *)(dev_82596.mem_start), 4096,
+	kernel_set_cachemode((void *)(dev_82596->mem_start), 4096,
 			IOMAP_FULL_CACHING);
 #endif
-	free_page ((u32)(dev_82596.mem_start));
-	dev_82596.priv = NULL;
+	free_page ((u32)(dev_82596->mem_start));
 #ifdef ENABLE_APRICOT
 	/* If we don't do this, we can't re-insmod it later. */
-	release_region(dev_82596.base_addr, I596_TOTAL_SIZE);
+	release_region(dev_82596->base_addr, I596_TOTAL_SIZE);
 #endif
+	free_netdev(dev_82596);
 }
 
 #endif				/* MODULE */
--- diff/drivers/net/8390.c	2003-09-30 15:46:15.000000000 +0100
+++ source/drivers/net/8390.c	2004-02-09 10:39:53.000000000 +0000
@@ -157,15 +157,8 @@
 int ei_open(struct net_device *dev)
 {
 	unsigned long flags;
-	struct ei_device *ei_local = (struct ei_device *) dev->priv;
+	struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev);
 
-	/* This can't happen unless somebody forgot to call ethdev_init(). */
-	if (ei_local == NULL) 
-	{
-		printk(KERN_EMERG "%s: ei_open passed a non-existent device!\n", dev->name);
-		return -ENXIO;
-	}
-	
 	/* The card I/O part of the driver (e.g. 3c503) can hook a Tx timeout
 	    wrapper that does e.g. media check & then calls ei_tx_timeout. */
 	if (dev->tx_timeout == NULL)
@@ -196,7 +189,7 @@
  */
 int ei_close(struct net_device *dev)
 {
-	struct ei_device *ei_local = (struct ei_device *) dev->priv;
+	struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev);
 	unsigned long flags;
 
 	/*
@@ -221,7 +214,7 @@
 void ei_tx_timeout(struct net_device *dev)
 {
 	long e8390_base = dev->base_addr;
-	struct ei_device *ei_local = (struct ei_device *) dev->priv;
+	struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev);
 	int txsr, isr, tickssofar = jiffies - dev->trans_start;
 	unsigned long flags;
 
@@ -267,7 +260,7 @@
 static int ei_start_xmit(struct sk_buff *skb, struct net_device *dev)
 {
 	long e8390_base = dev->base_addr;
-	struct ei_device *ei_local = (struct ei_device *) dev->priv;
+	struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev);
 	int length, send_length, output_page;
 	unsigned long flags;
 	char scratch[ETH_ZLEN];
@@ -435,7 +428,7 @@
 	}
     
 	e8390_base = dev->base_addr;
-	ei_local = (struct ei_device *) dev->priv;
+	ei_local = (struct ei_device *) netdev_priv(dev);
 
 	/*
 	 *	Protect the irq test too.
@@ -523,6 +516,15 @@
 	return IRQ_HANDLED;
 }
 
+#ifdef CONFIG_NET_POLL_CONTROLLER
+void ei_poll(struct net_device *dev)
+{
+	disable_irq(dev->irq);
+	ei_interrupt(dev->irq, dev, NULL);
+	enable_irq(dev->irq);
+}
+#endif
+
 /**
  * ei_tx_err - handle transmitter error
  * @dev: network device which threw the exception
@@ -540,7 +542,7 @@
 static void ei_tx_err(struct net_device *dev)
 {
 	long e8390_base = dev->base_addr;
-	struct ei_device *ei_local = (struct ei_device *) dev->priv;
+	struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev);
 	unsigned char txsr = inb_p(e8390_base+EN0_TSR);
 	unsigned char tx_was_aborted = txsr & (ENTSR_ABT+ENTSR_FU);
 
@@ -583,7 +585,7 @@
 static void ei_tx_intr(struct net_device *dev)
 {
 	long e8390_base = dev->base_addr;
-	struct ei_device *ei_local = (struct ei_device *) dev->priv;
+	struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev);
 	int status = inb(e8390_base + EN0_TSR);
     
 	outb_p(ENISR_TX, e8390_base + EN0_ISR); /* Ack intr. */
@@ -675,7 +677,7 @@
 static void ei_receive(struct net_device *dev)
 {
 	long e8390_base = dev->base_addr;
-	struct ei_device *ei_local = (struct ei_device *) dev->priv;
+	struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev);
 	unsigned char rxing_page, this_frame, next_frame;
 	unsigned short current_offset;
 	int rx_pkt_count = 0;
@@ -813,7 +815,7 @@
 {
 	long e8390_base = dev->base_addr;
 	unsigned char was_txing, must_resend = 0;
-	struct ei_device *ei_local = (struct ei_device *) dev->priv;
+	struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev);
     
 	/*
 	 * Record whether a Tx was in progress and then issue the
@@ -881,7 +883,7 @@
 static struct net_device_stats *get_stats(struct net_device *dev)
 {
 	long ioaddr = dev->base_addr;
-	struct ei_device *ei_local = (struct ei_device *) dev->priv;
+	struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev);
 	unsigned long flags;
     
 	/* If the card is stopped, just return the present stats. */
@@ -936,7 +938,7 @@
 {
 	long e8390_base = dev->base_addr;
 	int i;
-	struct ei_device *ei_local = (struct ei_device*)dev->priv;
+	struct ei_device *ei_local = (struct ei_device*)netdev_priv(dev);
 
 	if (!(dev->flags&(IFF_PROMISC|IFF_ALLMULTI))) 
 	{
@@ -990,53 +992,34 @@
 static void set_multicast_list(struct net_device *dev)
 {
 	unsigned long flags;
-	struct ei_device *ei_local = (struct ei_device*)dev->priv;
+	struct ei_device *ei_local = (struct ei_device*)netdev_priv(dev);
 	
 	spin_lock_irqsave(&ei_local->page_lock, flags);
 	do_set_multicast_list(dev);
 	spin_unlock_irqrestore(&ei_local->page_lock, flags);
 }	
 
-static inline void ei_device_init(struct ei_device *ei_local)
-{
-	spin_lock_init(&ei_local->page_lock);
-}
-
 /**
- * ethdev_init - init rest of 8390 device struct
+ * ethdev_setup - init rest of 8390 device struct
  * @dev: network device structure to init
  *
  * Initialize the rest of the 8390 device structure.  Do NOT __init
  * this, as it is used by 8390 based modular drivers too.
  */
 
-int ethdev_init(struct net_device *dev)
+static void ethdev_setup(struct net_device *dev)
 {
+	struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev);
 	if (ei_debug > 1)
 		printk(version);
     
-	if (dev->priv == NULL) 
-	{
-		dev->priv = kmalloc(sizeof(struct ei_device), GFP_KERNEL);
-		if (dev->priv == NULL)
-			return -ENOMEM;
-		memset(dev->priv, 0, sizeof(struct ei_device));
-		ei_device_init(dev->priv);
-	}
-    
 	dev->hard_start_xmit = &ei_start_xmit;
 	dev->get_stats	= get_stats;
 	dev->set_multicast_list = &set_multicast_list;
 
 	ether_setup(dev);
-        
-	return 0;
-}
 
-/* wrapper to make alloc_netdev happy; probably should just cast... */
-static void __ethdev_init(struct net_device *dev)
-{
-	ethdev_init(dev);
+	spin_lock_init(&ei_local->page_lock);
 }
 
 /**
@@ -1044,15 +1027,10 @@
  *
  * Allocate 8390-specific net_device.
  */
-struct net_device *alloc_ei_netdev(void)
+struct net_device *__alloc_ei_netdev(int size)
 {
-	struct net_device *dev;
-	
-	dev = alloc_netdev(sizeof(struct ei_device), "eth%d", __ethdev_init);
-	if (dev)
-		ei_device_init(dev->priv);
-
-	return dev;
+	return alloc_netdev(sizeof(struct ei_device) + size, "eth%d",
+				ethdev_setup);
 }
 
 
@@ -1072,7 +1050,7 @@
 void NS8390_init(struct net_device *dev, int startp)
 {
 	long e8390_base = dev->base_addr;
-	struct ei_device *ei_local = (struct ei_device *) dev->priv;
+	struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev);
 	int i;
 	int endcfg = ei_local->word16
 	    ? (0x48 | ENDCFG_WTS | (ei_local->bigendian ? ENDCFG_BOS : 0))
@@ -1136,7 +1114,7 @@
 								int start_page)
 {
 	long e8390_base = dev->base_addr;
- 	struct ei_device *ei_local __attribute((unused)) = (struct ei_device *) dev->priv;
+ 	struct ei_device *ei_local __attribute((unused)) = (struct ei_device *) netdev_priv(dev);
    
 	outb_p(E8390_NODMA+E8390_PAGE0, e8390_base+E8390_CMD);
     
@@ -1155,10 +1133,12 @@
 EXPORT_SYMBOL(ei_open);
 EXPORT_SYMBOL(ei_close);
 EXPORT_SYMBOL(ei_interrupt);
+#ifdef CONFIG_NET_POLL_CONTROLLER
+EXPORT_SYMBOL(ei_poll);
+#endif
 EXPORT_SYMBOL(ei_tx_timeout);
-EXPORT_SYMBOL(ethdev_init);
 EXPORT_SYMBOL(NS8390_init);
-EXPORT_SYMBOL(alloc_ei_netdev);
+EXPORT_SYMBOL(__alloc_ei_netdev);
 
 #if defined(MODULE)
 
--- diff/drivers/net/8390.h	2003-09-17 12:28:07.000000000 +0100
+++ source/drivers/net/8390.h	2004-02-09 10:39:53.000000000 +0000
@@ -39,12 +39,19 @@
 #define ei_debug 1
 #endif
 
-extern int ethdev_init(struct net_device *dev);
+#ifdef CONFIG_NET_POLL_CONTROLLER
+extern void ei_poll(struct net_device *dev);
+#endif
+
 extern void NS8390_init(struct net_device *dev, int startp);
 extern int ei_open(struct net_device *dev);
 extern int ei_close(struct net_device *dev);
 extern irqreturn_t ei_interrupt(int irq, void *dev_id, struct pt_regs *regs);
-extern struct net_device *alloc_ei_netdev(void);
+extern struct net_device *__alloc_ei_netdev(int size);
+static inline struct net_device *alloc_ei_netdev(void)
+{
+	return __alloc_ei_netdev(0);
+}
 
 /* You have one of these per-board */
 struct ei_device {
@@ -84,7 +91,7 @@
 /* The maximum time waited (in jiffies) before assuming a Tx failed. (20ms) */
 #define TX_TIMEOUT (20*HZ/100)
 
-#define ei_status (*(struct ei_device *)(dev->priv))
+#define ei_status (*(struct ei_device *)netdev_priv(dev))
 
 /* Some generic ethernet register configurations. */
 #define E8390_TX_IRQ_MASK	0xa	/* For register EN0_ISR */
--- diff/drivers/net/Kconfig	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/net/Kconfig	2004-02-09 10:39:53.000000000 +0000
@@ -1354,8 +1354,9 @@
 	  say N.
 
 config E100
-	tristate "EtherExpressPro/100 support (e100, Alternate Intel driver)"
+	tristate "Intel(R) PRO/100+ support"
 	depends on NET_PCI && PCI
+	select MII
 	---help---
 	  This driver supports Intel(R) PRO/100 family of adapters, which 
 	  includes:
@@ -1428,6 +1429,10 @@
 	  <file:Documentation/networking/net-modules.txt>.  The module
 	  will be called e100.
 
+config E100_NAPI
+	bool "Use Rx Polling (NAPI)"
+	depends on E100
+
 config LNE390
 	tristate "Mylex EISA LNE390A/B support (EXPERIMENTAL)"
 	depends on NET_PCI && EISA && EXPERIMENTAL
@@ -1577,6 +1582,24 @@
 	  experience problems, you can enable this option to restore the
 	  old RX-reset behavior.  If unsure, say N.
 
+config 8139_RXBUF_IDX
+	int "Receive ring size (0 => 8K, 1 => 16K, 2 => 32K, 3 => 64K)"
+	depends on 8139TOO
+	range 0 3
+	default 1 if EMBEDDED || SH_DREAMCAST
+	default 2
+	help
+	   The 8139too driver has a fixed area of memory for receiving data.
+	   The default value is adequate for most systems. The 64KB 
+	   ring size has hardware issues that may cause problems.
+	   Values:
+		0  => 8 KB 
+		1  => 16 KB embedded systems
+		2  => 32 KB default for most systems
+		3  => 64 KB 
+	   If unsure, use the default 2.
+
+
 config SIS900
 	tristate "SiS 900/7016 PCI Fast Ethernet Adapter support"
 	depends on NET_PCI && PCI
@@ -2458,6 +2481,13 @@
 	  To compile this driver as a module, choose M here: the module
 	  will be called shaper.  If unsure, say N.
 
+config NETCONSOLE
+	tristate "Network console logging support (EXPERIMENTAL)"
+	depends on NETDEVICES && EXPERIMENTAL
+	---help---
+	If you want to log kernel messages over the network, enable this.
+	See Documentation/networking/netconsole.txt for details.
+
 source "drivers/net/wan/Kconfig"
 
 source "drivers/net/pcmcia/Kconfig"
--- diff/drivers/net/Makefile	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/net/Makefile	2004-02-09 10:39:53.000000000 +0000
@@ -8,7 +8,6 @@
   obj-$(CONFIG_ISDN) += slhc.o
 endif
 
-obj-$(CONFIG_E100) += e100/
 obj-$(CONFIG_E1000) += e1000/
 obj-$(CONFIG_IXGB) += ixgb/
 obj-$(CONFIG_BONDING) += bonding/
@@ -39,6 +38,7 @@
 obj-$(CONFIG_NE2K_PCI) += ne2k-pci.o 8390.o
 obj-$(CONFIG_PCNET32) += pcnet32.o
 obj-$(CONFIG_EEPRO100) += eepro100.o
+obj-$(CONFIG_E100) += e100.o
 obj-$(CONFIG_TLAN) += tlan.o
 obj-$(CONFIG_EPIC100) += epic100.o
 obj-$(CONFIG_SIS190) += sis190.o
@@ -112,7 +112,6 @@
 obj-$(CONFIG_DUMMY) += dummy.o
 obj-$(CONFIG_DE600) += de600.o
 obj-$(CONFIG_DE620) += de620.o
-obj-$(CONFIG_AT1500) += lance.o
 obj-$(CONFIG_LANCE) += lance.o
 obj-$(CONFIG_SUN3_82586) += sun3_82586.o
 obj-$(CONFIG_SUN3LANCE) += sun3lance.o
@@ -189,3 +188,6 @@
 obj-$(CONFIG_HAMRADIO) += hamradio/
 obj-$(CONFIG_IRDA) += irda/
 
+# Must come after all NICs that might use them
+obj-$(CONFIG_NETCONSOLE) += netconsole.o
+obj-$(CONFIG_KGDB) += kgdb_eth.o
--- diff/drivers/net/Space.c	2004-01-19 10:22:57.000000000 +0000
+++ source/drivers/net/Space.c	2004-02-09 10:39:54.000000000 +0000
@@ -40,63 +40,62 @@
    ethernet adaptor have the name "eth[0123...]".
    */
 
-extern int ne2_probe(struct net_device *dev);
-extern int hp100_probe(struct net_device *dev);
-extern int ultra_probe(struct net_device *dev);
-extern int ultra32_probe(struct net_device *dev);
-extern int wd_probe(struct net_device *dev);
-extern int el2_probe(struct net_device *dev);
-extern int ne_probe(struct net_device *dev);
-extern int hp_probe(struct net_device *dev);
-extern int hp_plus_probe(struct net_device *dev);
-extern int express_probe(struct net_device *);
-extern int eepro_probe(struct net_device *);
-extern int at1500_probe(struct net_device *);
-extern int at1700_probe(struct net_device *);
-extern int fmv18x_probe(struct net_device *);
-extern int eth16i_probe(struct net_device *);
-extern int i82596_probe(struct net_device *);
-extern int ewrk3_probe(struct net_device *);
-extern int el1_probe(struct net_device *);
-extern int wavelan_probe(struct net_device *);
-extern int arlan_probe(struct net_device *);
-extern int el16_probe(struct net_device *);
-extern int elmc_probe(struct net_device *);
-extern int skmca_probe(struct net_device *);
-extern int elplus_probe(struct net_device *);
-extern int ac3200_probe(struct net_device *);
-extern int es_probe(struct net_device *);
-extern int lne390_probe(struct net_device *);
-extern int e2100_probe(struct net_device *);
-extern int ni5010_probe(struct net_device *);
-extern int ni52_probe(struct net_device *);
-extern int ni65_probe(struct net_device *);
-extern int sonic_probe(struct net_device *);
-extern int SK_init(struct net_device *);
-extern int seeq8005_probe(struct net_device *);
-extern int smc_init( struct net_device * );
-extern int atarilance_probe(struct net_device *);
-extern int sun3lance_probe(struct net_device *);
-extern int sun3_82586_probe(struct net_device *);
-extern int apne_probe(struct net_device *);
-extern int bionet_probe(struct net_device *);
-extern int pamsnet_probe(struct net_device *);
-extern int cs89x0_probe(struct net_device *dev);
-extern int hplance_probe(struct net_device *dev);
-extern int bagetlance_probe(struct net_device *);
-extern int mvme147lance_probe(struct net_device *dev);
-extern int tc515_probe(struct net_device *dev);
-extern int lance_probe(struct net_device *dev);
-extern int mace_probe(struct net_device *dev);
-extern int macsonic_probe(struct net_device *dev);
-extern int mac8390_probe(struct net_device *dev);
-extern int mac89x0_probe(struct net_device *dev);
-extern int mc32_probe(struct net_device *dev);
+extern struct net_device *ne2_probe(int unit);
+extern struct net_device *hp100_probe(int unit);
+extern struct net_device *ultra_probe(int unit);
+extern struct net_device *ultra32_probe(int unit);
+extern struct net_device *wd_probe(int unit);
+extern struct net_device *el2_probe(int unit);
+extern struct net_device *ne_probe(int unit);
+extern struct net_device *hp_probe(int unit);
+extern struct net_device *hp_plus_probe(int unit);
+extern struct net_device *express_probe(int unit);
+extern struct net_device *eepro_probe(int unit);
+extern struct net_device *at1700_probe(int unit);
+extern struct net_device *fmv18x_probe(int unit);
+extern struct net_device *eth16i_probe(int unit);
+extern struct net_device *i82596_probe(int unit);
+extern struct net_device *ewrk3_probe(int unit);
+extern struct net_device *el1_probe(int unit);
+extern struct net_device *wavelan_probe(int unit);
+extern struct net_device *arlan_probe(int unit);
+extern struct net_device *el16_probe(int unit);
+extern struct net_device *elmc_probe(int unit);
+extern struct net_device *skmca_probe(int unit);
+extern struct net_device *elplus_probe(int unit);
+extern struct net_device *ac3200_probe(int unit);
+extern struct net_device *es_probe(int unit);
+extern struct net_device *lne390_probe(int unit);
+extern struct net_device *e2100_probe(int unit);
+extern struct net_device *ni5010_probe(int unit);
+extern struct net_device *ni52_probe(int unit);
+extern struct net_device *ni65_probe(int unit);
+extern struct net_device *sonic_probe(int unit);
+extern struct net_device *SK_init(int unit);
+extern struct net_device *seeq8005_probe(int unit);
+extern struct net_device *smc_init(int unit);
+extern struct net_device *atarilance_probe(int unit);
+extern struct net_device *sun3lance_probe(int unit);
+extern struct net_device *sun3_82586_probe(int unit);
+extern struct net_device *apne_probe(int unit);
+extern struct net_device *bionet_probe(int unit);
+extern struct net_device *pamsnet_probe(int unit);
+extern struct net_device *cs89x0_probe(int unit);
+extern struct net_device *hplance_probe(int unit);
+extern struct net_device *bagetlance_probe(int unit);
+extern struct net_device *mvme147lance_probe(int unit);
+extern struct net_device *tc515_probe(int unit);
+extern struct net_device *lance_probe(int unit);
+extern struct net_device *mace_probe(int unit);
+extern struct net_device *macsonic_probe(int unit);
+extern struct net_device *mac8390_probe(int unit);
+extern struct net_device *mac89x0_probe(int unit);
+extern struct net_device *mc32_probe(int unit);
 extern struct net_device *cops_probe(int unit);
 extern struct net_device *ltpc_probe(void);
   
 /* Detachable devices ("pocket adaptors") */
-extern int de620_probe(struct net_device *);
+extern struct net_device *de620_probe(int unit);
 
 /* Fibre Channel adapters */
 extern int iph5526_probe(struct net_device *dev);
@@ -104,33 +103,22 @@
 /* SBNI adapters */
 extern int sbni_probe(int unit);
 
-struct devprobe
-{
-	int (*probe)(struct net_device *dev);
+struct devprobe2 {
+	struct net_device *(*probe)(int unit);
 	int status;	/* non-zero if autoprobe has failed */
 };
 
-/*
- * probe_list walks a list of probe functions and calls each so long
- * as a non-zero ioaddr is given, or as long as it hasn't already failed 
- * to find a card in the past (as recorded by "status") when asked to
- * autoprobe (i.e. a probe that fails to find a card when autoprobing
- * will not be asked to autoprobe again).  It exits when a card is found.
- */
-static int __init probe_list(struct net_device *dev, struct devprobe *plist)
+static int __init probe_list2(int unit, struct devprobe2 *p, int autoprobe)
 {
-	struct devprobe *p = plist;
-	unsigned long base_addr = dev->base_addr;
-
-	while (p->probe != NULL) {
-		if (base_addr && p->probe(dev) == 0) 	/* probe given addr */
+	struct net_device *dev;
+	for (; p->probe; p++) {
+		if (autoprobe && p->status)
+			continue;
+		dev = p->probe(unit);
+		if (!IS_ERR(dev))
 			return 0;
-		else if (p->status == 0) {		/* has autoprobe failed yet? */
-			p->status = p->probe(dev);	/* no, try autoprobe */
-			if (p->status == 0)
-				return 0;
-		}
-		p++;
+		if (autoprobe)
+			p->status = PTR_ERR(dev);
 	}
 	return -ENODEV;
 }
@@ -141,7 +129,8 @@
  * drivers that probe for EISA cards (in the ISA group).  These are the
  * legacy EISA only driver probes, and also the legacy PCI probes
  */
-static struct devprobe eisa_probes[] __initdata = {
+
+static struct devprobe2 eisa_probes[] __initdata = {
 #ifdef CONFIG_ULTRA32 
 	{ultra32_probe, 0},	
 #endif
@@ -157,8 +146,7 @@
 	{NULL, 0},
 };
 
-
-static struct devprobe mca_probes[] __initdata = {
+static struct devprobe2 mca_probes[] __initdata = {
 #ifdef CONFIG_NE2_MCA
 	{ne2_probe, 0},
 #endif
@@ -178,7 +166,7 @@
  * ISA probes that touch addresses < 0x400 (including those that also
  * look for EISA/PCI/MCA cards in addition to ISA cards).
  */
-static struct devprobe isa_probes[] __initdata = {
+static struct devprobe2 isa_probes[] __initdata = {
 #ifdef CONFIG_HP100 		/* ISA, EISA & PCI */
 	{hp100_probe, 0},
 #endif	
@@ -215,9 +203,6 @@
 #ifdef CONFIG_SEEQ8005 
 	{seeq8005_probe, 0},
 #endif
-#ifdef CONFIG_AT1500
-	{at1500_probe, 0},
-#endif
 #ifdef CONFIG_CS89x0
  	{cs89x0_probe, 0},
 #endif
@@ -272,14 +257,14 @@
 	{NULL, 0},
 };
 
-static struct devprobe parport_probes[] __initdata = {
+static struct devprobe2 parport_probes[] __initdata = {
 #ifdef CONFIG_DE620		/* D-Link DE-620 adapter */
 	{de620_probe, 0},
 #endif
 	{NULL, 0},
 };
 
-static struct devprobe m68k_probes[] __initdata = {
+static struct devprobe2 m68k_probes[] __initdata = {
 #ifdef CONFIG_ATARILANCE	/* Lance-based Atari ethernet boards */
 	{atarilance_probe, 0},
 #endif
@@ -319,7 +304,7 @@
 	{NULL, 0},
 };
 
-static struct devprobe mips_probes[] __initdata = {
+static struct devprobe2 mips_probes[] __initdata = {
 #ifdef CONFIG_MIPS_JAZZ_SONIC
 	{sonic_probe, 0},
 #endif
@@ -334,83 +319,65 @@
  * per bus interface. This drives the legacy devices only for now.
  */
  
-static int __init ethif_probe(int unit)
+static void __init ethif_probe2(int unit)
 {
-	struct net_device *dev;
-	int err = -ENODEV;
+	unsigned long base_addr = netdev_boot_base("eth", unit);
 
-	dev = alloc_etherdev(0);
-	if (!dev)
-		return -ENOMEM;
-
-	sprintf(dev->name, "eth%d", unit);
-	netdev_boot_setup_check(dev);
-
-	/* 
-	 * Backwards compatibility - historically an I/O base of 1 was 
-	 * used to indicate not to probe for this ethN interface 
-	 */
-	if (__dev_get_by_name(dev->name) || dev->base_addr == 1) {
-		free_netdev(dev);
-		return -ENXIO;
-	}
-
-	/* 
-	 * The arch specific probes are 1st so that any on-board ethernet
-	 * will be probed before other ISA/EISA/MCA/PCI bus cards.
-	 */
-	if (probe_list(dev, m68k_probes) == 0 ||
-	    probe_list(dev, mips_probes) == 0 ||
-	    probe_list(dev, eisa_probes) == 0 ||
-	    probe_list(dev, mca_probes) == 0 ||
-	    probe_list(dev, isa_probes) == 0 ||
-	    probe_list(dev, parport_probes) == 0) 
-		err = register_netdev(dev);
-
-	if (err)
-		free_netdev(dev);
-	return err;
+	if (base_addr == 1)
+		return;
 
+	(void)(	probe_list2(unit, m68k_probes, base_addr == 0) &&
+		probe_list2(unit, mips_probes, base_addr == 0) &&
+		probe_list2(unit, eisa_probes, base_addr == 0) &&
+		probe_list2(unit, mca_probes, base_addr == 0) &&
+		probe_list2(unit, isa_probes, base_addr == 0) &&
+		probe_list2(unit, parport_probes, base_addr == 0));
 }
 
 #ifdef CONFIG_TR
 /* Token-ring device probe */
-extern int ibmtr_probe(struct net_device *);
-extern int sk_isa_probe(struct net_device *);
-extern int proteon_probe(struct net_device *);
-extern int smctr_probe(struct net_device *);
+extern int ibmtr_probe_card(struct net_device *);
+extern struct net_device *sk_isa_probe(int unit);
+extern struct net_device *proteon_probe(int unit);
+extern struct net_device *smctr_probe(int unit);
+
+static struct devprobe2 tr_probes2[] __initdata = {
+#ifdef CONFIG_SKISA
+	{sk_isa_probe, 0},
+#endif
+#ifdef CONFIG_PROTEON
+	{proteon_probe, 0},
+#endif
+#ifdef CONFIG_SMCTR
+	{smctr_probe, 0},
+#endif
+	{NULL, 0},
+};
 
 static __init int trif_probe(int unit)
 {
-	struct net_device *dev;
 	int err = -ENODEV;
-	
-	dev = alloc_trdev(0);
+#ifdef CONFIG_IBMTR
+	struct net_device *dev = alloc_trdev(0);
 	if (!dev)
 		return -ENOMEM;
 
 	sprintf(dev->name, "tr%d", unit);
 	netdev_boot_setup_check(dev);
-	if (
-#ifdef CONFIG_IBMTR
-	    ibmtr_probe(dev) == 0  ||
-#endif
-#ifdef CONFIG_SKISA
-	    sk_isa_probe(dev) == 0 || 
-#endif
-#ifdef CONFIG_PROTEON
-	    proteon_probe(dev) == 0 ||
-#endif
-#ifdef CONFIG_SMCTR
-	    smctr_probe(dev) == 0 ||
-#endif
-	    0 ) 
-		err = register_netdev(dev);
-		
+	err = ibmtr_probe_card(dev);
 	if (err)
 		free_netdev(dev);
+#endif
 	return err;
+}
+
+static void __init trif_probe2(int unit)
+{
+	unsigned long base_addr = netdev_boot_base("tr", unit);
 
+	if (base_addr == 1)
+		return;
+	probe_list2(unit, tr_probes2, base_addr == 0);
 }
 #endif
 
@@ -437,10 +404,11 @@
 #endif
 #ifdef CONFIG_TR
 	for (num = 0; num < 8; ++num)
-		trif_probe(num);
+		if (!trif_probe(num))
+			trif_probe2(num);
 #endif
 	for (num = 0; num < 8; ++num)
-		ethif_probe(num);
+		ethif_probe2(num);
 
 #ifdef CONFIG_COPS
 	cops_probe(0);
--- diff/drivers/net/a2065.c	2003-08-26 10:00:52.000000000 +0100
+++ source/drivers/net/a2065.c	2004-02-09 10:39:53.000000000 +0000
@@ -737,7 +737,7 @@
 			continue;
 		}
 
-		dev = init_etherdev(NULL, sizeof(struct lance_private));
+		dev = alloc_etherdev(sizeof(struct lance_private));
 
 		if (dev == NULL) {
 			release_resource(r1);
@@ -791,17 +791,22 @@
 		dev->set_multicast_list = &lance_set_multicast;
 		dev->dma = 0;
 
-#ifdef MODULE
-		priv->next_module = root_a2065_dev;
-		root_a2065_dev = priv;
-#endif
-		ether_setup(dev);
 		init_timer(&priv->multicast_timer);
 		priv->multicast_timer.data = (unsigned long) dev;
 		priv->multicast_timer.function =
 			(void (*)(unsigned long)) &lance_set_multicast;
 
-		res = 0;
+		res = register_netdev(dev);
+		if (res) {
+			release_resource(r1);
+			release_resource(r2);
+			free_netdev(dev);
+			break;
+		}
+#ifdef MODULE
+		priv->next_module = root_a2065_dev;
+		root_a2065_dev = priv;
+#endif
 	}
 	return res;
 }
--- diff/drivers/net/ac3200.c	2003-09-30 15:46:15.000000000 +0100
+++ source/drivers/net/ac3200.c	2004-02-09 10:39:53.000000000 +0000
@@ -75,7 +75,6 @@
 #define AC_START_PG		0x00	/* First page of 8390 TX buffer */
 #define AC_STOP_PG		0x80	/* Last page +1 of the 8390 RX ring */
 
-int ac3200_probe(struct net_device *dev);
 static int ac_probe1(int ioaddr, struct net_device *dev);
 
 static int ac_open(struct net_device *dev);
@@ -96,9 +95,11 @@
 	or the unique value in the station address PROM.
 	*/
 
-int __init ac3200_probe(struct net_device *dev)
+static int __init do_ac3200_probe(struct net_device *dev)
 {
 	unsigned short ioaddr = dev->base_addr;
+	int irq = dev->irq;
+	int mem_start = dev->mem_start;
 
 	SET_MODULE_OWNER(dev);
 
@@ -110,13 +111,50 @@
 	if ( ! EISA_bus)
 		return -ENXIO;
 
-	for (ioaddr = 0x1000; ioaddr < 0x9000; ioaddr += 0x1000)
+	for (ioaddr = 0x1000; ioaddr < 0x9000; ioaddr += 0x1000) {
 		if (ac_probe1(ioaddr, dev) == 0)
 			return 0;
+		dev->irq = irq;
+		dev->mem_start = mem_start;
+	}
 
 	return -ENODEV;
 }
 
+static void cleanup_card(struct net_device *dev)
+{
+	/* Someday free_irq may be in ac_close_card() */
+	free_irq(dev->irq, dev);
+	release_region(dev->base_addr, AC_IO_EXTENT);
+	if (ei_status.reg0)
+		iounmap((void *)dev->mem_start);
+}
+
+struct net_device * __init ac3200_probe(int unit)
+{
+	struct net_device *dev = alloc_ei_netdev();
+	int err;
+
+	if (!dev)
+		return ERR_PTR(-ENOMEM);
+
+	sprintf(dev->name, "eth%d", unit);
+	netdev_boot_setup_check(dev);
+
+	err = do_ac3200_probe(dev);
+	if (err)
+		goto out;
+	err = register_netdev(dev);
+	if (err)
+		goto out1;
+	return dev;
+out1:
+	cleanup_card(dev);
+out:
+	free_netdev(dev);
+	return ERR_PTR(err);
+}
+
 static int __init ac_probe1(int ioaddr, struct net_device *dev)
 {
 	int i, retval;
@@ -156,13 +194,6 @@
 	}
 #endif
 
-	/* Allocate dev->priv and fill in 8390 specific dev fields. */
-	if (ethdev_init(dev)) {
-		printk (", unable to allocate memory for dev->priv.\n");
-		retval = -ENOMEM;
-		goto out;
-	}
-
 	/* Assign and allocate the interrupt now. */
 	if (dev->irq == 0) {
 		dev->irq = config2irq(inb(ioaddr + AC_CONFIG));
@@ -210,7 +241,7 @@
 			printk(KERN_CRIT "ac3200.c: or to an address above 0x%lx.\n", virt_to_phys(high_memory));
 			printk(KERN_CRIT "ac3200.c: Driver NOT installed.\n");
 			retval = -EINVAL;
-			goto out2;
+			goto out1;
 		}
 		dev->mem_start = (unsigned long)ioremap(dev->mem_start, AC_STOP_PG*0x100);
 		if (dev->mem_start == 0) {
@@ -218,7 +249,7 @@
 			printk(KERN_ERR "ac3200.c: Try using EISA SCU to set memory below 1MB.\n");
 			printk(KERN_ERR "ac3200.c: Driver NOT installed.\n");
 			retval = -EINVAL;
-			goto out2;
+			goto out1;
 		}
 		ei_status.reg0 = 1;	/* Use as remap flag */
 		printk("ac3200.c: remapped %dkB card memory to virtual address %#lx\n",
@@ -245,13 +276,13 @@
 
 	dev->open = &ac_open;
 	dev->stop = &ac_close_card;
+#ifdef CONFIG_NET_POLL_CONTROLLER
+	dev->poll_controller = ei_poll;
+#endif
 	NS8390_init(dev, 0);
 	return 0;
-out2:
-	free_irq(dev->irq, dev);
 out1:
-	kfree(dev->priv);
-	dev->priv = NULL;
+	free_irq(dev->irq, dev);
 out:
 	release_region(ioaddr, AC_IO_EXTENT);
 	return retval;
@@ -338,7 +369,7 @@
 
 #ifdef MODULE
 #define MAX_AC32_CARDS	4	/* Max number of AC32 cards per module */
-static struct net_device dev_ac32[MAX_AC32_CARDS];
+static struct net_device *dev_ac32[MAX_AC32_CARDS];
 static int io[MAX_AC32_CARDS];
 static int irq[MAX_AC32_CARDS];
 static int mem[MAX_AC32_CARDS];
@@ -354,26 +385,32 @@
 int
 init_module(void)
 {
+	struct net_device *dev;
 	int this_dev, found = 0;
 
 	for (this_dev = 0; this_dev < MAX_AC32_CARDS; this_dev++) {
-		struct net_device *dev = &dev_ac32[this_dev];
+		if (io[this_dev] == 0 && this_dev != 0)
+			break;
+		dev = alloc_ei_netdev();
+		if (!dev)
+			break;
 		dev->irq = irq[this_dev];
 		dev->base_addr = io[this_dev];
 		dev->mem_start = mem[this_dev];		/* Currently ignored by driver */
-		dev->init = ac3200_probe;
-		/* Default is to only install one card. */
-		if (io[this_dev] == 0 && this_dev != 0) break;
-		if (register_netdev(dev) != 0) {
-			printk(KERN_WARNING "ac3200.c: No ac3200 card found (i/o = 0x%x).\n", io[this_dev]);
-			if (found != 0) {	/* Got at least one. */
-				return 0;
+		if (do_ac3200_probe(dev) == 0) {
+			if (register_netdev(dev) == 0) {
+				dev_ac32[found++] = dev;
+				continue;
 			}
-			return -ENXIO;
+			cleanup_card(dev);
 		}
-		found++;
-	}
-	return 0;
+		free_netdev(dev);
+		printk(KERN_WARNING "ac3200.c: No ac3200 card found (i/o = 0x%x).\n", io[this_dev]);
+		break;
+	}
+	if (found)
+		return 0;
+	return -ENXIO;
 }
 
 void
@@ -382,16 +419,11 @@
 	int this_dev;
 
 	for (this_dev = 0; this_dev < MAX_AC32_CARDS; this_dev++) {
-		struct net_device *dev = &dev_ac32[this_dev];
-		if (dev->priv != NULL) {
-			/* Someday free_irq may be in ac_close_card() */
-			free_irq(dev->irq, dev);
-			release_region(dev->base_addr, AC_IO_EXTENT);
-			if (ei_status.reg0)
-				iounmap((void *)dev->mem_start);
+		struct net_device *dev = dev_ac32[this_dev];
+		if (dev) {
 			unregister_netdev(dev);
-			kfree(dev->priv);
-			dev->priv = NULL;
+			cleanup_card(dev);
+			free_netdev(dev);
 		}
 	}
 }
--- diff/drivers/net/acenic.c	2003-09-30 15:46:15.000000000 +0100
+++ source/drivers/net/acenic.c	2004-02-09 10:39:53.000000000 +0000
@@ -731,12 +731,6 @@
 			break;
 		}
 
-		if (register_netdev(dev)) {
-			printk(KERN_ERR "acenic: device registration failed\n");
-			free_netdev(dev);
-			continue;
-		}
-
 		switch(pdev->vendor) {
 		case PCI_VENDOR_ID_ALTEON:
 			if (pdev->device == PCI_DEVICE_ID_FARALLON_PN9100T) {
@@ -824,6 +818,13 @@
 			continue;
 		}
 
+		if (register_netdev(dev)) {
+			printk(KERN_ERR "acenic: device registration failed\n");
+			ace_init_cleanup(dev);
+			free_netdev(dev);
+			continue;
+		}
+
 		if (ap->pci_using_dac)
 			dev->features |= NETIF_F_HIGHDMA;
 
@@ -874,6 +875,7 @@
 	while (root_dev) {
 		ap = root_dev->priv;
 		next = ap->next;
+		unregister_netdev(root_dev);
 
 		regs = ap->regs;
 
@@ -1133,7 +1135,6 @@
 	if (dev->irq)
 		free_irq(dev->irq, dev);
 
-	unregister_netdev(dev);
 	iounmap(ap->regs);
 }
 
--- diff/drivers/net/amd8111e.c	2003-10-27 09:20:38.000000000 +0000
+++ source/drivers/net/amd8111e.c	2004-02-09 10:39:53.000000000 +0000
@@ -1153,6 +1153,17 @@
 	return IRQ_RETVAL(handled);
 }
 
+#ifdef CONFIG_NET_POLL_CONTROLLER
+static void amd8111e_poll(struct net_device *dev)
+{ 
+	unsigned long flags;
+	local_save_flags(flags); 
+	local_irq_disable();
+	amd8111e_interrupt(0, dev, NULL);
+	local_irq_restore(flags); 
+} 
+#endif
+
 /*
 This function closes the network interface and updates the statistics so that most recent statistics will be available after the interface is down.
 */
@@ -1884,6 +1895,9 @@
 	dev->irq =pdev->irq;
 	dev->tx_timeout = amd8111e_tx_timeout; 
 	dev->watchdog_timeo = AMD8111E_TX_TIMEOUT; 
+#ifdef CONFIG_NET_POLL_CONTROLLER
+	dev->poll_controller = amd8111e_poll; 
+#endif
 
 #if AMD8111E_VLAN_TAG_USED
 	dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
--- diff/drivers/net/apne.c	2003-06-09 14:18:18.000000000 +0100
+++ source/drivers/net/apne.c	2004-02-09 10:39:53.000000000 +0000
@@ -72,7 +72,7 @@
 #define NESM_STOP_PG	0x80	/* Last page +1 of RX ring */
 
 
-int apne_probe(struct net_device *dev);
+struct net_device * __init apne_probe(int unit);
 static int apne_probe1(struct net_device *dev, int ioaddr);
 
 static int apne_open(struct net_device *dev);
@@ -116,28 +116,37 @@
 
 static int apne_owned;	/* signal if card already owned */
 
-int __init apne_probe(struct net_device *dev)
+struct net_device * __init apne_probe(int unit)
 {
+	struct net_device *dev;
 #ifndef MANUAL_CONFIG
 	char tuple[8];
 #endif
+	int err;
 
 	if (apne_owned)
-		return -ENODEV;
-
-	SET_MODULE_OWNER(dev);
+		return ERR_PTR(-ENODEV);
 
 	if ( !(AMIGAHW_PRESENT(PCMCIA)) )
-		return (-ENODEV);
+		return ERR_PTR(-ENODEV);
                                 
 	printk("Looking for PCMCIA ethernet card : ");
                                         
 	/* check if a card is inserted */
 	if (!(PCMCIA_INSERTED)) {
 		printk("NO PCMCIA card inserted\n");
-		return (-ENODEV);
+		return ERR_PTR(-ENODEV);
 	}
-                                                                                                
+
+	dev = alloc_ei_netdev();
+	if (!dev)
+		return ERR_PTR(-ENOMEM);
+	if (unit >= 0) {
+		sprintf(dev->name, "eth%d", unit);
+		netdev_boot_setup_check(dev);
+	}
+	SET_MODULE_OWNER(dev);
+
 	/* disable pcmcia irq for readtuple */
 	pcmcia_disable_irq();
 
@@ -145,17 +154,41 @@
 	if ((pcmcia_copy_tuple(CISTPL_FUNCID, tuple, 8) < 3) ||
 		(tuple[2] != CISTPL_FUNCID_NETWORK)) {
 		printk("not an ethernet card\n");
-		return (-ENODEV);
+		/* XXX: shouldn't we re-enable irq here? */
+		free_netdev(dev);
+		return ERR_PTR(-ENODEV);
 	}
 #endif
 
 	printk("ethernet PCMCIA card inserted\n");
 
-	if (init_pcmcia())
-		return apne_probe1(dev, IOBASE);
-	else
-		return (-ENODEV);
+	if (!init_pcmcia()) {
+		/* XXX: shouldn't we re-enable irq here? */
+		free_netdev(dev);
+		return ERR_PTR(-ENODEV);
+	}
+
+	if (!request_region(IOBASE, 0x20, dev->name)) {
+		free_netdev(dev);
+		return ERR_PTR(-EBUSY);
+	}
+
+	err = apne_probe1(dev, IOBASE);
+	if (err) {
+		release_region(IOBASE, 0x20);
+		free_netdev(dev);
+		return ERR_PTR(err);
+	}
+	err = register_netdev(dev);
+	if (!err)
+		return dev;
 
+	pcmcia_disable_irq();
+	free_irq(IRQ_AMIGA_PORTS, dev);
+	pcmcia_reset();
+	release_region(IOBASE, 0x20);
+	free_netdev(dev);
+	return ERR_PTR(err);
 }
 
 static int __init apne_probe1(struct net_device *dev, int ioaddr)
@@ -280,13 +313,6 @@
     i = request_irq(IRQ_AMIGA_PORTS, apne_interrupt, SA_SHIRQ, dev->name, dev);
     if (i) return i;
 
-    /* Allocate dev->priv and fill in 8390 specific dev fields. */
-    if (ethdev_init(dev)) {
-	printk (" unable to get memory for dev->priv.\n");
-	free_irq(IRQ_AMIGA_PORTS, dev);
-	return -ENOMEM;
-    }
-
     for(i = 0; i < ETHER_ADDR_LEN; i++) {
 	printk(" %2.2x", SA_prom[i]);
 	dev->dev_addr[i] = SA_prom[i];
@@ -307,6 +333,9 @@
     ei_status.get_8390_hdr = &apne_get_8390_hdr;
     dev->open = &apne_open;
     dev->stop = &apne_close;
+#ifdef CONFIG_NET_POLL_CONTROLLER
+    dev->poll_controller = ei_poll;
+#endif
     NS8390_init(dev, 0);
 
     pcmcia_ack_int(pcmcia_get_intreq());		/* ack PCMCIA int req */
@@ -534,32 +563,29 @@
 }
 
 #ifdef MODULE
-static struct net_device apne_dev;
+static struct net_device *apne_dev;
 
 int init_module(void)
 {
-	int err;
-
-	apne_dev.init = apne_probe;
-	if ((err = register_netdev(&apne_dev))) {
-		if (err == -EIO)
-			printk("No PCMCIA NEx000 ethernet card found.\n");
-		return (err);
-	}
-	return (0);
+	apne_dev = apne_probe(-1);
+	if (IS_ERR(apne_dev))
+		return PTR_ERR(apne_dev);
+	return 0;
 }
 
 void cleanup_module(void)
 {
-	unregister_netdev(&apne_dev);
+	unregister_netdev(apne_dev);
 
 	pcmcia_disable_irq();
 
-	free_irq(IRQ_AMIGA_PORTS, &apne_dev);
+	free_irq(IRQ_AMIGA_PORTS, apne_dev);
 
 	pcmcia_reset();
 
-	apne_owned = 0;
+	release_region(IOBASE, 0x20);
+
+	free_netdev(apne_dev);
 }
 
 #endif
--- diff/drivers/net/appletalk/cops.c	2003-09-17 12:28:07.000000000 +0100
+++ source/drivers/net/appletalk/cops.c	2004-02-09 10:39:53.000000000 +0000
@@ -262,7 +262,7 @@
 out1:
 	cleanup_card(dev);
 out:
-	kfree(dev);
+	free_netdev(dev);
 	return ERR_PTR(err);
 }
 
--- diff/drivers/net/appletalk/ipddp.c	2002-10-16 04:27:14.000000000 +0100
+++ source/drivers/net/appletalk/ipddp.c	2004-02-09 10:39:53.000000000 +0000
@@ -28,6 +28,7 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/netdevice.h>
+#include <linux/etherdevice.h>
 #include <linux/ip.h>
 #include <linux/atalk.h>
 #include <linux/if_arp.h>
@@ -55,34 +56,24 @@
 static int ipddp_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd);
 
 
-static int __init ipddp_init(struct net_device *dev)
+static struct net_device * __init ipddp_init(void)
 {
 	static unsigned version_printed;
+	struct net_device *dev;
+	int err;
+
+	dev = alloc_etherdev(sizeof(struct net_device_stats));
+	if (!dev)
+		return ERR_PTR(-ENOMEM);
 
 	SET_MODULE_OWNER(dev);
+	strcpy(dev->name, "ipddp%d");
 
 	if (version_printed++ == 0)
                 printk(version);
 
-	/* Let the user now what mode we are in */
-	if(ipddp_mode == IPDDP_ENCAP)
-		printk("%s: Appletalk-IP Encap. mode by Bradford W. Johnson <johns393@maroon.tc.umn.edu>\n", 
-			dev->name);
-	if(ipddp_mode == IPDDP_DECAP)
-		printk("%s: Appletalk-IP Decap. mode by Jay Schulist <jschlst@samba.org>\n", 
-			dev->name);
-
-	/* Fill in the device structure with ethernet-generic values. */
-        ether_setup(dev);
-
 	/* Initalize the device structure. */
         dev->hard_start_xmit = ipddp_xmit;
-
-        dev->priv = kmalloc(sizeof(struct net_device_stats), GFP_KERNEL);
-        if(!dev->priv)
-                return -ENOMEM;
-        memset(dev->priv,0,sizeof(struct net_device_stats));
-
         dev->get_stats      = ipddp_get_stats;
         dev->do_ioctl       = ipddp_ioctl;
 
@@ -97,7 +88,21 @@
          */
         dev->hard_header_len = 14+8+sizeof(struct ddpehdr)+1;
 
-        return 0;
+	err = register_netdev(dev);
+	if (err) {
+		free_netdev(dev);
+		return ERR_PTR(err);
+	}
+
+	/* Let the user now what mode we are in */
+	if(ipddp_mode == IPDDP_ENCAP)
+		printk("%s: Appletalk-IP Encap. mode by Bradford W. Johnson <johns393@maroon.tc.umn.edu>\n", 
+			dev->name);
+	if(ipddp_mode == IPDDP_DECAP)
+		printk("%s: Appletalk-IP Decap. mode by Jay Schulist <jschlst@samba.org>\n", 
+			dev->name);
+
+        return dev;
 }
 
 /*
@@ -281,23 +286,16 @@
         }
 }
 
-static struct net_device dev_ipddp;
+static struct net_device *dev_ipddp;
 
 MODULE_LICENSE("GPL");
 MODULE_PARM(ipddp_mode, "i");
 
 static int __init ipddp_init_module(void)
 {
-	int err;
-
-	dev_ipddp.init = ipddp_init;
-	err=dev_alloc_name(&dev_ipddp, "ipddp%d");
-        if(err < 0)
-                return err;
-
-	if(register_netdev(&dev_ipddp) != 0)
-                return -EIO;
-
+	dev_ipddp = ipddp_init();
+        if (IS_ERR(dev_ipddp))
+                return PTR_ERR(dev_ipddp);
 	return 0;
 }
 
@@ -305,8 +303,8 @@
 {
         struct ipddp_route *p;
 
-	unregister_netdev(&dev_ipddp);
-        kfree(dev_ipddp.priv);
+	unregister_netdev(dev_ipddp);
+        free_netdev(dev_ipddp);
 
         while (ipddp_route_list) {
                 p = ipddp_route_list->next;
--- diff/drivers/net/appletalk/ltpc.c	2003-09-17 12:28:07.000000000 +0100
+++ source/drivers/net/appletalk/ltpc.c	2004-02-09 10:39:53.000000000 +0000
@@ -1213,7 +1213,7 @@
 out2:
 	release_region(io, 8);
 out1:
-	kfree(dev);
+	free_netdev(dev);
 out:
 	return ERR_PTR(err);
 }
--- diff/drivers/net/arcnet/arc-rimi.c	2003-08-26 10:00:52.000000000 +0100
+++ source/drivers/net/arcnet/arc-rimi.c	2004-02-09 10:39:53.000000000 +0000
@@ -26,6 +26,7 @@
  */
 #include <linux/kernel.h>
 #include <linux/module.h>
+#include <linux/moduleparam.h>
 #include <linux/ioport.h>
 #include <linux/slab.h>
 #include <linux/delay.h>
@@ -85,8 +86,6 @@
  */
 static int __init arcrimi_probe(struct net_device *dev)
 {
-	int retval;
-
 	BUGLVL(D_NORMAL) printk(VERSION);
 	BUGLVL(D_NORMAL) printk("E-mail me if you actually test the RIM I driver, please!\n");
 
@@ -114,11 +113,7 @@
 		       "ID!\n");
 		return -ENODEV;
 	}
-	retval = arcrimi_found(dev);
-	if (retval < 0) {
-		release_mem_region(dev->mem_start, BUFFER_SIZE);
-	}
-	return retval;
+	return arcrimi_found(dev);
 }
 
 
@@ -129,11 +124,13 @@
 static int __init arcrimi_found(struct net_device *dev)
 {
 	struct arcnet_local *lp;
-	u_long first_mirror, last_mirror, shmem;
+	unsigned long first_mirror, last_mirror, shmem;
 	int mirror_size;
+	int err;
 
 	/* reserve the irq */
 	if (request_irq(dev->irq, &arcnet_interrupt, 0, "arcnet (RIM I)", dev)) {
+		release_mem_region(dev->mem_start, BUFFER_SIZE);
 		BUGMSG(D_NORMAL, "Can't get IRQ %d!\n", dev->irq);
 		return -ENODEV;
 	}
@@ -168,11 +165,7 @@
 
 	/* initialize the rest of the device structure. */
 
-	lp = dev->priv = kmalloc(sizeof(struct arcnet_local), GFP_KERNEL);
-	if (!lp) {
-		BUGMSG(D_NORMAL, "Can't allocate device data!\n");
-		goto err_free_irq;
-	}
+	lp = dev->priv;
 	lp->card_name = "RIM I";
 	lp->hw.command = arcrimi_command;
 	lp->hw.status = arcrimi_status;
@@ -181,18 +174,6 @@
 	lp->hw.owner = THIS_MODULE;
 	lp->hw.copy_to_card = arcrimi_copy_to_card;
 	lp->hw.copy_from_card = arcrimi_copy_from_card;
-	lp->mem_start = ioremap(dev->mem_start, dev->mem_end - dev->mem_start + 1);
-	if (!lp->mem_start) {
-		BUGMSG(D_NORMAL, "Can't remap device memory!\n");
-		goto err_free_dev_priv;
-	}
-	/* Fill in the fields of the device structure with generic
-	 * values.
-	 */
-	arcdev_setup(dev);
-
-	/* get and check the station ID from offset 1 in shmem */
-	dev->dev_addr[0] = readb(lp->mem_start + 1);
 
 	/*
 	 * re-reserve the memory region - arcrimi_probe() alloced this reqion
@@ -200,25 +181,40 @@
 	 * with the correct size.  There is a VERY slim chance this could
 	 * fail.
 	 */
-	release_mem_region(dev->mem_start, BUFFER_SIZE);
+	release_mem_region(shmem, BUFFER_SIZE);
 	if (!request_mem_region(dev->mem_start,
 				dev->mem_end - dev->mem_start + 1,
 				"arcnet (90xx)")) {
 		BUGMSG(D_NORMAL, "Card memory already allocated\n");
-		goto err_free_dev_priv;
+		goto err_free_irq;
 	}
 
+	lp->mem_start = ioremap(dev->mem_start, dev->mem_end - dev->mem_start + 1);
+	if (!lp->mem_start) {
+		BUGMSG(D_NORMAL, "Can't remap device memory!\n");
+		goto err_release_mem;
+	}
+
+	/* get and check the station ID from offset 1 in shmem */
+	dev->dev_addr[0] = readb(lp->mem_start + 1);
+
 	BUGMSG(D_NORMAL, "ARCnet RIM I: station %02Xh found at IRQ %d, "
 	       "ShMem %lXh (%ld*%d bytes).\n",
 	       dev->dev_addr[0],
 	       dev->irq, dev->mem_start,
 	 (dev->mem_end - dev->mem_start + 1) / mirror_size, mirror_size);
 
+	err = register_netdev(dev);
+	if (err)
+		goto err_unmap;
+
 	return 0;
 
-      err_free_dev_priv:
-	kfree(dev->priv);
-      err_free_irq:
+err_unmap:
+	iounmap(lp->mem_start);
+err_release_mem:
+	release_mem_region(dev->mem_start, dev->mem_end - dev->mem_start + 1);
+err_free_irq:
 	free_irq(dev->irq, dev);
 	return -EIO;
 }
@@ -294,94 +290,79 @@
 	TIME("memcpy_fromio", count, memcpy_fromio(buf, memaddr, count));
 }
 
-#ifdef MODULE
+static int node;
+static int io;			/* use the insmod io= irq= node= options */
+static int irq;
+static char device[9];		/* use eg. device=arc1 to change name */
+
+module_param(node, int, 0);
+module_param(io, int, 0);
+module_param(irq, int, 0);
+module_param_string(device, device, sizeof(device), 0);
+MODULE_LICENSE("GPL");
 
 static struct net_device *my_dev;
 
-/* Module parameters */
-
-static int node = 0;
-static int io = 0x0;		/* <--- EDIT THESE LINES FOR YOUR CONFIGURATION */
-static int irq = 0;		/* or use the insmod io= irq= shmem= options */
-static char *device;		/* use eg. device="arc1" to change name */
-
-MODULE_PARM(node, "i");
-MODULE_PARM(io, "i");
-MODULE_PARM(irq, "i");
-MODULE_PARM(device, "s");
-MODULE_LICENSE("GPL");
-
-int init_module(void)
+static int __init arc_rimi_init(void)
 {
 	struct net_device *dev;
-	int err;
 
-	dev = dev_alloc(device ? : "arc%d", &err);
+	dev = alloc_arcdev(device);
 	if (!dev)
-		return err;
+		return -ENOMEM;
 
 	if (node && node != 0xff)
 		dev->dev_addr[0] = node;
 
-	dev->base_addr = io;
+	dev->mem_start = io;
 	dev->irq = irq;
 	if (dev->irq == 2)
 		dev->irq = 9;
 
-	if (arcrimi_probe(dev))
+	if (arcrimi_probe(dev)) {
+		free_netdev(dev);
 		return -EIO;
+	}
 
 	my_dev = dev;
 	return 0;
 }
 
-void cleanup_module(void)
+static void __exit arc_rimi_exit(void)
 {
 	struct net_device *dev = my_dev;
 	struct arcnet_local *lp = (struct arcnet_local *) dev->priv;
 
 	unregister_netdev(dev);
-	free_irq(dev->irq, dev);
 	iounmap(lp->mem_start);
 	release_mem_region(dev->mem_start, dev->mem_end - dev->mem_start + 1);
-	kfree(dev->priv);
+	free_irq(dev->irq, dev);
 	free_netdev(dev);
 }
 
-#else
-
+#ifndef MODULE
 static int __init arcrimi_setup(char *s)
 {
-	struct net_device *dev;
 	int ints[8];
-
 	s = get_options(s, 8, ints);
 	if (!ints[0])
 		return 1;
-	dev = alloc_bootmem(sizeof(struct net_device));
-	memset(dev, 0, sizeof(struct net_device));
-	dev->init = arcrimi_probe;
-
 	switch (ints[0]) {
 	default:		/* ERROR */
 		printk("arcrimi: Too many arguments.\n");
 	case 3:		/* Node ID */
-		dev->dev_addr[0] = ints[3];
+		node = ints[3];
 	case 2:		/* IRQ */
-		dev->irq = ints[2];
+		irq = ints[2];
 	case 1:		/* IO address */
-		dev->mem_start = ints[1];
+		io = ints[1];
 	}
 	if (*s)
-		strncpy(dev->name, s, 9);
-	else
-		strcpy(dev->name, "arc%d");
-	if (register_netdev(dev))
-		printk(KERN_ERR "arc-rimi: Cannot register arcnet device\n");
-
+		snprintf(device, sizeof(device), "%s", s);
 	return 1;
 }
-
 __setup("arcrimi=", arcrimi_setup);
-
 #endif				/* MODULE */
+
+module_init(arc_rimi_init)
+module_exit(arc_rimi_exit)
--- diff/drivers/net/arcnet/arcnet.c	2003-09-17 12:28:07.000000000 +0100
+++ source/drivers/net/arcnet/arcnet.c	2004-02-09 10:39:53.000000000 +0000
@@ -92,6 +92,7 @@
 EXPORT_SYMBOL(arcnet_unregister_proto);
 EXPORT_SYMBOL(arcnet_debug);
 EXPORT_SYMBOL(arcdev_setup);
+EXPORT_SYMBOL(alloc_arcdev);
 EXPORT_SYMBOL(arcnet_interrupt);
 
 /* Internal function prototypes */
@@ -331,6 +332,11 @@
 	dev->rebuild_header = arcnet_rebuild_header;
 }
 
+struct net_device *alloc_arcdev(char *name)
+{
+	return alloc_netdev(sizeof(struct arcnet_local),
+			    name && *name ? name : "arc%d", arcdev_setup);
+}
 
 /*
  * Open/initialize the board.  This is called sometime after booting when
--- diff/drivers/net/arcnet/com20020-isa.c	2003-10-09 09:47:34.000000000 +0100
+++ source/drivers/net/arcnet/com20020-isa.c	2004-02-09 10:39:53.000000000 +0000
@@ -26,6 +26,7 @@
  * **********************
  */
 #include <linux/module.h>
+#include <linux/moduleparam.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/ioport.h>
@@ -117,49 +118,41 @@
 	return err;
 }
 
-
-#ifdef MODULE
-
-static struct net_device *my_dev;
-
-/* Module parameters */
-
 static int node = 0;
 static int io = 0x0;		/* <--- EDIT THESE LINES FOR YOUR CONFIGURATION */
 static int irq = 0;		/* or use the insmod io= irq= shmem= options */
-static char *device;		/* use eg. device="arc1" to change name */
+static char device[9];		/* use eg. device="arc1" to change name */
 static int timeout = 3;
 static int backplane = 0;
 static int clockp = 0;
 static int clockm = 0;
 
-MODULE_PARM(node, "i");
-MODULE_PARM(io, "i");
-MODULE_PARM(irq, "i");
-MODULE_PARM(device, "s");
-MODULE_PARM(timeout, "i");
-MODULE_PARM(backplane, "i");
-MODULE_PARM(clockp, "i");
-MODULE_PARM(clockm, "i");
+module_param(node, int, 0);
+module_param(io, int, 0);
+module_param(irq, int, 0);
+module_param_string(device, device, sizeof(device), 0);
+module_param(timeout, int, 0);
+module_param(backplane, int, 0);
+module_param(clockp, int, 0);
+module_param(clockm, int, 0);
+
 MODULE_LICENSE("GPL");
 
-int init_module(void)
+static struct net_device *my_dev;
+
+static int __init com20020_init(void)
 {
 	struct net_device *dev;
 	struct arcnet_local *lp;
-	int err;
 
-	dev = dev_alloc(device ? : "arc%d", &err);
+	dev = alloc_arcdev(device);
 	if (!dev)
-		return err;
-	lp = dev->priv = kmalloc(sizeof(struct arcnet_local), GFP_KERNEL);
-	if (!lp)
 		return -ENOMEM;
-	memset(lp, 0, sizeof(struct arcnet_local));
 
 	if (node && node != 0xff)
 		dev->dev_addr[0] = node;
 
+	lp = dev->priv;
 	lp->backplane = backplane;
 	lp->clockp = clockp & 7;
 	lp->clockm = clockm & 3;
@@ -172,21 +165,24 @@
 	if (dev->irq == 2)
 		dev->irq = 9;
 
-	if (com20020isa_probe(dev))
+	if (com20020isa_probe(dev)) {
+		free_netdev(dev);
 		return -EIO;
+	}
 
 	my_dev = dev;
 	return 0;
 }
 
-void cleanup_module(void)
+static void __exit com20020_exit(void)
 {
-	com20020_remove(my_dev);
+	unregister_netdev(my_dev);
+	free_irq(my_dev->irq, my_dev);
 	release_region(my_dev->base_addr, ARCNET_TOTAL_SIZE);
+	free_netdev(my_dev);
 }
 
-#else
-
+#ifndef MODULE
 static int __init com20020isa_setup(char *s)
 {
 	struct net_device *dev;
@@ -196,37 +192,31 @@
 	s = get_options(s, 8, ints);
 	if (!ints[0])
 		return 1;
-	dev = alloc_bootmem(sizeof(struct net_device) + sizeof(struct arcnet_local));
-	memset(dev, 0, sizeof(struct net_device) + sizeof(struct arcnet_local));
-	lp = dev->priv = (struct arcnet_local *) (dev + 1);
-	dev->init = com20020isa_probe;
 
 	switch (ints[0]) {
 	default:		/* ERROR */
 		printk("com90xx: Too many arguments.\n");
 	case 6:		/* Timeout */
-		lp->timeout = ints[6];
+		timeout = ints[6];
 	case 5:		/* CKP value */
-		lp->clockp = ints[5];
+		clockp = ints[5];
 	case 4:		/* Backplane flag */
-		lp->backplane = ints[4];
+		backplane = ints[4];
 	case 3:		/* Node ID */
-		dev->dev_addr[0] = ints[3];
+		node = ints[3];
 	case 2:		/* IRQ */
-		dev->irq = ints[2];
+		irq = ints[2];
 	case 1:		/* IO address */
-		dev->base_addr = ints[1];
+		io = ints[1];
 	}
 	if (*s)
-		strncpy(dev->name, s, 9);
-	else
-		strcpy(dev->name, "arc%d");
-	if (register_netdev(dev))
-		printk(KERN_ERR "com20020: Cannot register arcnet device\n");
-
+		snprintf(device, sizeof(device), "%s", s);
 	return 1;
 }
 
 __setup("com20020=", com20020isa_setup);
 
 #endif				/* MODULE */
+
+module_init(com20020_init)
+module_exit(com20020_exit)
--- diff/drivers/net/arcnet/com20020-pci.c	2003-10-09 09:47:34.000000000 +0100
+++ source/drivers/net/arcnet/com20020-pci.c	2004-02-09 10:39:53.000000000 +0000
@@ -27,6 +27,7 @@
  * **********************
  */
 #include <linux/module.h>
+#include <linux/moduleparam.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/ioport.h>
@@ -46,18 +47,18 @@
 /* Module parameters */
 
 static int node;
-static char *device;		/* use eg. device="arc1" to change name */
+static char device[9];		/* use eg. device="arc1" to change name */
 static int timeout = 3;
 static int backplane;
 static int clockp;
 static int clockm;
 
-MODULE_PARM(node, "i");
-MODULE_PARM(device, "s");
-MODULE_PARM(timeout, "i");
-MODULE_PARM(backplane, "i");
-MODULE_PARM(clockp, "i");
-MODULE_PARM(clockm, "i");
+module_param(node, int, 0);
+module_param_string(device, device, sizeof(device), 0);
+module_param(timeout, int, 0);
+module_param(backplane, int, 0);
+module_param(clockp, int, 0);
+module_param(clockm, int, 0);
 MODULE_LICENSE("GPL");
 
 static int __devinit com20020pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
@@ -68,15 +69,11 @@
 
 	if (pci_enable_device(pdev))
 		return -EIO;
-	dev = dev_alloc(device ? : "arc%d", &err);
+	dev = alloc_arcdev(device);
 	if (!dev)
-		return err;
-	lp = dev->priv = kmalloc(sizeof(struct arcnet_local), GFP_KERNEL);
-	if (!lp) {
-		err = -ENOMEM;
-		goto out_dev;
-	}
-	memset(lp, 0, sizeof(struct arcnet_local));
+		return -ENOMEM;
+	lp = dev->priv;
+
 	pci_set_drvdata(pdev, dev);
 
 	// SOHARD needs PCI base addr 4
@@ -89,6 +86,13 @@
 		ioaddr = pci_resource_start(pdev, 2);
 	}
 
+	if (!request_region(ioaddr, ARCNET_TOTAL_SIZE, "com20020-pci")) {
+		BUGMSG(D_INIT, "IO region %xh-%xh already allocated.\n",
+		       ioaddr, ioaddr + ARCNET_TOTAL_SIZE - 1);
+		err = -EBUSY;
+		goto out_dev;
+	}
+
 	// Dummy access after Reset
 	// ARCNET controller needs this access to detect bustype
 	outb(0x00,ioaddr+1);
@@ -105,12 +109,6 @@
 	lp->timeout = timeout;
 	lp->hw.owner = THIS_MODULE;
 
-	if (!request_region(ioaddr, ARCNET_TOTAL_SIZE, "com20020-pci")) {
-		BUGMSG(D_INIT, "IO region %xh-%xh already allocated.\n",
-		       ioaddr, ioaddr + ARCNET_TOTAL_SIZE - 1);
-		err = -EBUSY;
-		goto out_priv;
-	}
 	if (ASTATUS() == 0xFF) {
 		BUGMSG(D_NORMAL, "IO address %Xh was reported by PCI BIOS, "
 		       "but seems empty!\n", ioaddr);
@@ -129,18 +127,18 @@
 
 out_port:
 	release_region(ioaddr, ARCNET_TOTAL_SIZE);
-out_priv:
-	kfree(dev->priv);
 out_dev:
-	kfree(dev);
+	free_netdev(dev);
 	return err;
 }
 
 static void __devexit com20020pci_remove(struct pci_dev *pdev)
 {
 	struct net_device *dev = pci_get_drvdata(pdev);
-	com20020_remove(dev);
+	unregister_netdev(dev);
+	free_irq(dev->irq, dev);
 	release_region(dev->base_addr, ARCNET_TOTAL_SIZE);
+	free_netdev(dev);
 }
 
 static struct pci_device_id com20020pci_id_table[] = {
--- diff/drivers/net/arcnet/com20020.c	2003-10-09 09:47:34.000000000 +0100
+++ source/drivers/net/arcnet/com20020.c	2004-02-09 10:39:53.000000000 +0000
@@ -172,11 +172,6 @@
 
 	dev->set_multicast_list = com20020_set_mc_list;
 
-	/* Fill in the fields of the device structure with generic
-	 * values.
-	 */
-	arcdev_setup(dev);
-
 	if (!dev->dev_addr[0])
 		dev->dev_addr[0] = inb(ioaddr + 8);	/* FIXME: do this some other way! */
 
@@ -221,7 +216,7 @@
 	       lp->setup >> 1, 
 	       clockrates[3 - ((lp->setup2 & 0xF0) >> 4) + ((lp->setup & 0x0F) >> 1)]);
 
-	if (!dev->init && register_netdev(dev)) {
+	if (register_netdev(dev)) {
 		free_irq(dev->irq, dev);
 		return -EIO;
 	}
@@ -332,19 +327,10 @@
 	}
 }
 
-void com20020_remove(struct net_device *dev)
-{
-	unregister_netdev(dev);
-	free_irq(dev->irq, dev);
-	kfree(dev->priv);
-	free_netdev(dev);
-}
-
 #ifdef MODULE
 
 EXPORT_SYMBOL(com20020_check);
 EXPORT_SYMBOL(com20020_found);
-EXPORT_SYMBOL(com20020_remove);
 
 MODULE_LICENSE("GPL");
 
--- diff/drivers/net/arcnet/com90io.c	2003-08-26 10:00:52.000000000 +0100
+++ source/drivers/net/arcnet/com90io.c	2004-02-09 10:39:53.000000000 +0000
@@ -27,6 +27,7 @@
  */
 #include <linux/kernel.h>
 #include <linux/module.h>
+#include <linux/moduleparam.h>
 #include <linux/ioport.h>
 #include <linux/slab.h>
 #include <linux/delay.h>
@@ -234,6 +235,7 @@
 {
 	struct arcnet_local *lp;
 	int ioaddr = dev->base_addr;
+	int err;
 
 	/* Reserve the irq */
 	if (request_irq(dev->irq, &arcnet_interrupt, 0, "arcnet (COM90xx-IO)", dev)) {
@@ -246,15 +248,6 @@
 		return -EBUSY;
 	}
 
-	/* Initialize the rest of the device structure. */
-	dev->priv = kmalloc(sizeof(struct arcnet_local), GFP_KERNEL);
-	if (!dev->priv) {
-		free_irq(dev->irq, dev);
-		release_region(dev->base_addr, ARCNET_TOTAL_SIZE);
-		return -ENOMEM;
-	}
-	memset(dev->priv, 0, sizeof(struct arcnet_local));
-
 	lp = (struct arcnet_local *) (dev->priv);
 	lp->card_name = "COM90xx I/O";
 	lp->hw.command = com90io_command;
@@ -265,12 +258,6 @@
 	lp->hw.copy_to_card = com90io_copy_to_card;
 	lp->hw.copy_from_card = com90io_copy_from_card;
 
-	/*
-	 * Fill in the fields of the device structure with generic
-	 * values.
-	 */
-	arcdev_setup(dev);
-
 	lp->config = (0x16 | IOMAPflag) & ~ENABLE16flag;
 	SETCONF();
 
@@ -278,6 +265,14 @@
 
 	dev->dev_addr[0] = get_buffer_byte(dev, 1);
 
+	err = register_netdev(dev);
+	if (err) {
+		outb((inb(_CONFIG) & ~IOMAPflag), _CONFIG);
+		free_irq(dev->irq, dev);
+		release_region(dev->base_addr, ARCNET_TOTAL_SIZE);
+		return err;
+	}
+
 	BUGMSG(D_NORMAL, "COM90IO: station %02Xh found at %03lXh, IRQ %d.\n",
 	       dev->dev_addr[0], dev->base_addr, dev->irq);
 
@@ -361,44 +356,67 @@
 	TIME("get_whole_buffer", count, get_whole_buffer(dev, bufnum * 512 + offset, count, buf));
 }
 
-
-#ifdef MODULE
-
-static struct net_device *my_dev;
-
-/* Module parameters */
-
 static int io;			/* use the insmod io= irq= shmem= options */
 static int irq;
-static char *device;		/* use eg. device=arc1 to change name */
+static char device[9];		/* use eg. device=arc1 to change name */
 
-MODULE_PARM(io, "i");
-MODULE_PARM(irq, "i");
-MODULE_PARM(device, "s");
+module_param(io, int, 0);
+module_param(irq, int, 0);
+module_param_string(device, device, sizeof(device), 0);
 MODULE_LICENSE("GPL");
 
-int init_module(void)
+#ifndef MODULE
+static int __init com90io_setup(char *s)
+{
+	int ints[4];
+	s = get_options(s, 4, ints);
+	if (!ints[0])
+		return 0;
+	switch (ints[0]) {
+	default:		/* ERROR */
+		printk("com90io: Too many arguments.\n");
+	case 2:		/* IRQ */
+		irq = ints[2];
+	case 1:		/* IO address */
+		io = ints[1];
+	}
+	if (*s)
+		snprintf(device, sizeof(device), "%s", s);
+	return 1;
+}
+__setup("com90io=", com90io_setup);
+#endif
+
+static struct net_device *my_dev;
+
+static int __init com90io_init(void)
 {
 	struct net_device *dev;
 	int err;
 
-	dev = dev_alloc(device ? : "arc%d", &err);
+	dev = alloc_arcdev(device);
 	if (!dev)
-		return err;
+		return -ENOMEM;
+
+	SET_MODULE_OWNER(dev);
 
 	dev->base_addr = io;
 	dev->irq = irq;
 	if (dev->irq == 2)
 		dev->irq = 9;
 
-	if (com90io_probe(dev))
-		return -EIO;
+	err = com90io_probe(dev);
+
+	if (err) {
+		free_netdev(dev);
+		return err;
+	}
 
 	my_dev = dev;
 	return 0;
 }
 
-void cleanup_module(void)
+static void __exit com90io_exit(void)
 {
 	struct net_device *dev = my_dev;
 	int ioaddr = dev->base_addr;
@@ -410,42 +428,8 @@
 
 	free_irq(dev->irq, dev);
 	release_region(dev->base_addr, ARCNET_TOTAL_SIZE);
-	kfree(dev->priv);
 	free_netdev(dev);
 }
 
-#else
-
-static int __init com90io_setup(char *s)
-{
-	struct net_device *dev;
-	int ints[4];
-
-	s = get_options(s, 4, ints);
-	if (!ints[0])
-		return 0;
-	dev = alloc_bootmem(sizeof(struct net_device));
-	memset(dev, 0, sizeof(struct net_device));
-	dev->init = com90io_probe;
-
-	switch (ints[0]) {
-	default:		/* ERROR */
-		printk("com90io: Too many arguments.\n");
-	case 2:		/* IRQ */
-		dev->irq = ints[2];
-	case 1:		/* IO address */
-		dev->base_addr = ints[1];
-	}
-	if (*s)
-		strncpy(dev->name, s, 9);
-	else
-		strcpy(dev->name, "arc%d");
-	if (register_netdev(dev))
-		printk(KERN_ERR "com90io: Cannot register arcnet device\n");
-
-	return 1;
-}
-
-__setup("com90io=", com90io_setup);
-
-#endif				/* MODULE */
+module_init(com90io_init)
+module_exit(com90io_exit)
--- diff/drivers/net/arcnet/com90xx.c	2003-08-26 10:00:52.000000000 +0100
+++ source/drivers/net/arcnet/com90xx.c	2004-02-09 10:39:53.000000000 +0000
@@ -25,6 +25,7 @@
  * **********************
  */
 #include <linux/module.h>
+#include <linux/moduleparam.h>
 #include <linux/init.h>
 #include <linux/ioport.h>
 #include <linux/delay.h>
@@ -52,8 +53,7 @@
 
 
 /* Internal function declarations */
-static int com90xx_found(struct net_device *dev, int ioaddr, int airq,
-			 u_long shmem);
+static int com90xx_found(int ioaddr, int airq, u_long shmem);
 static void com90xx_command(struct net_device *dev, int command);
 static int com90xx_status(struct net_device *dev);
 static void com90xx_setmask(struct net_device *dev, int mask);
@@ -98,32 +98,43 @@
 
 static int com90xx_skip_probe __initdata = 0;
 
-static int __init com90xx_probe(struct net_device *dev)
+/* Module parameters */
+
+static int io;			/* use the insmod io= irq= shmem= options */
+static int irq;
+static int shmem;
+static char device[9];		/* use eg. device=arc1 to change name */
+
+module_param(io, int, 0);
+module_param(irq, int, 0);
+module_param(shmem, int, 0);
+module_param_string(device, device, sizeof(device), 0);
+
+static void __init com90xx_probe(void)
 {
-	int count, status, ioaddr, numprint, airq, retval = -ENODEV,
-	 openparen = 0;
+	int count, status, ioaddr, numprint, airq, openparen = 0;
 	unsigned long airqmask;
 	int ports[(0x3f0 - 0x200) / 16 + 1] =
 	{0};
 	u_long shmems[(0xFF800 - 0xA0000) / 2048 + 1] =
 	{0};
 	int numports, numshmems, *port;
-	u_long *shmem;
+	u_long *p;
 
-	if (!dev && com90xx_skip_probe)
-		return -ENODEV;
+	if (!io && !irq && !shmem && !*device && com90xx_skip_probe)
+		return;
 
 	BUGLVL(D_NORMAL) printk(VERSION);
 
 	/* set up the arrays where we'll store the possible probe addresses */
 	numports = numshmems = 0;
-	if (dev && dev->base_addr)
-		ports[numports++] = dev->base_addr;
+	if (io)
+		ports[numports++] = io;
 	else
 		for (count = 0x200; count <= 0x3f0; count += 16)
 			ports[numports++] = count;
-	if (dev && dev->mem_start)
-		shmems[numshmems++] = dev->mem_start;
+	if (shmem)
+		shmems[numshmems++] = shmem;
 	else
 		for (count = 0xA0000; count <= 0xFF800; count += 2048)
 			shmems[numshmems++] = count;
@@ -143,22 +154,19 @@
 
 		ioaddr = *port;
 
-		if (check_region(*port, ARCNET_TOTAL_SIZE)) {
+		if (!request_region(*port, ARCNET_TOTAL_SIZE, "arcnet (90xx)")) {
 			BUGMSG2(D_INIT_REASONS, "(check_region)\n");
 			BUGMSG2(D_INIT_REASONS, "S1: ");
 			BUGLVL(D_INIT_REASONS) numprint = 0;
-			*port = ports[numports - 1];
-			numports--;
-			port--;
+			*port-- = ports[--numports];
 			continue;
 		}
 		if (ASTATUS() == 0xFF) {
 			BUGMSG2(D_INIT_REASONS, "(empty)\n");
 			BUGMSG2(D_INIT_REASONS, "S1: ");
 			BUGLVL(D_INIT_REASONS) numprint = 0;
-			*port = ports[numports - 1];
-			numports--;
-			port--;
+			release_region(*port, ARCNET_TOTAL_SIZE);
+			*port-- = ports[--numports];
 			continue;
 		}
 		inb(_RESET);	/* begin resetting card */
@@ -171,14 +179,14 @@
 
 	if (!numports) {
 		BUGMSG2(D_NORMAL, "S1: No ARCnet cards found.\n");
-		return -ENODEV;
+		return;
 	}
 	/* Stage 2: we have now reset any possible ARCnet cards, so we can't
 	 * do anything until they finish.  If D_INIT, print the list of
 	 * cards that are left.
 	 */
 	numprint = -1;
-	for (port = &ports[0]; port - ports < numports; port++) {
+	for (port = &ports[0]; port < ports + numports; port++) {
 		numprint++;
 		numprint %= 8;
 		if (!numprint) {
@@ -194,8 +202,8 @@
 	 * 0xD1 byte in the right place, or are read-only.
 	 */
 	numprint = -1;
-	for (shmem = &shmems[0]; shmem - shmems < numshmems; shmem++) {
-		u_long ptr = *shmem;
+	for (p = &shmems[0]; p < shmems + numshmems; p++) {
+		u_long ptr = *p;
 
 		numprint++;
 		numprint %= 8;
@@ -203,15 +211,13 @@
 			BUGMSG2(D_INIT, "\n");
 			BUGMSG2(D_INIT, "S3: ");
 		}
-		BUGMSG2(D_INIT, "%lXh ", *shmem);
+		BUGMSG2(D_INIT, "%lXh ", *p);
 
-		if (check_mem_region(*shmem, BUFFER_SIZE)) {
+		if (!request_mem_region(*p, BUFFER_SIZE, "arcnet (90xx)")) {
 			BUGMSG2(D_INIT_REASONS, "(check_mem_region)\n");
 			BUGMSG2(D_INIT_REASONS, "Stage 3: ");
 			BUGLVL(D_INIT_REASONS) numprint = 0;
-			*shmem = shmems[numshmems - 1];
-			numshmems--;
-			shmem--;
+			*p-- = shmems[--numshmems];
 			continue;
 		}
 		if (isa_readb(ptr) != TESTvalue) {
@@ -219,9 +225,8 @@
 				isa_readb(ptr), TESTvalue);
 			BUGMSG2(D_INIT_REASONS, "S3: ");
 			BUGLVL(D_INIT_REASONS) numprint = 0;
-			*shmem = shmems[numshmems - 1];
-			numshmems--;
-			shmem--;
+			release_mem_region(*p, BUFFER_SIZE);
+			*p-- = shmems[--numshmems];
 			continue;
 		}
 		/* By writing 0x42 to the TESTvalue location, we also make
@@ -233,9 +238,8 @@
 		if (isa_readb(ptr) != 0x42) {
 			BUGMSG2(D_INIT_REASONS, "(read only)\n");
 			BUGMSG2(D_INIT_REASONS, "S3: ");
-			*shmem = shmems[numshmems - 1];
-			numshmems--;
-			shmem--;
+			release_mem_region(*p, BUFFER_SIZE);
+			*p-- = shmems[--numshmems];
 			continue;
 		}
 		BUGMSG2(D_INIT_REASONS, "\n");
@@ -246,20 +250,22 @@
 
 	if (!numshmems) {
 		BUGMSG2(D_NORMAL, "S3: No ARCnet cards found.\n");
-		return -ENODEV;
+		for (port = &ports[0]; port < ports + numports; port++)
+			release_region(*port, ARCNET_TOTAL_SIZE);
+		return;
 	}
 	/* Stage 4: something of a dummy, to report the shmems that are
 	 * still possible after stage 3.
 	 */
 	numprint = -1;
-	for (shmem = &shmems[0]; shmem - shmems < numshmems; shmem++) {
+	for (p = &shmems[0]; p < shmems + numshmems; p++) {
 		numprint++;
 		numprint %= 8;
 		if (!numprint) {
 			BUGMSG2(D_INIT, "\n");
 			BUGMSG2(D_INIT, "S4: ");
 		}
-		BUGMSG2(D_INIT, "%lXh ", *shmem);
+		BUGMSG2(D_INIT, "%lXh ", *p);
 	}
 	BUGMSG2(D_INIT, "\n");
 
@@ -271,7 +277,8 @@
 	 * after the first one is found.
 	 */
 	numprint = -1;
-	for (port = &ports[0]; port - ports < numports; port++) {
+	for (port = &ports[0]; port < ports + numports; port++) {
+		int found = 0;
 		numprint++;
 		numprint %= 8;
 		if (!numprint) {
@@ -288,9 +295,8 @@
 			BUGMSG2(D_INIT_REASONS, "(status=%Xh)\n", status);
 			BUGMSG2(D_INIT_REASONS, "S5: ");
 			BUGLVL(D_INIT_REASONS) numprint = 0;
-			*port = ports[numports - 1];
-			numports--;
-			port--;
+			release_region(*port, ARCNET_TOTAL_SIZE);
+			*port-- = ports[--numports];
 			continue;
 		}
 		ACOMMAND(CFLAGScmd | RESETclear | CONFIGclear);
@@ -300,15 +306,14 @@
 				status);
 			BUGMSG2(D_INIT_REASONS, "S5: ");
 			BUGLVL(D_INIT_REASONS) numprint = 0;
-			*port = ports[numports - 1];
-			numports--;
-			port--;
+			release_region(*port, ARCNET_TOTAL_SIZE);
+			*port-- = ports[--numports];
 			continue;
 		}
 		/* skip this completely if an IRQ was given, because maybe
 		 * we're on a machine that locks during autoirq!
 		 */
-		if (!dev || !dev->irq) {
+		if (!irq) {
 			/* if we do this, we're sure to get an IRQ since the
 			 * card has just reset and the NORXflag is on until
 			 * we tell it to start receiving.
@@ -323,13 +328,12 @@
 				BUGMSG2(D_INIT_REASONS, "(airq=%d)\n", airq);
 				BUGMSG2(D_INIT_REASONS, "S5: ");
 				BUGLVL(D_INIT_REASONS) numprint = 0;
-				*port = ports[numports - 1];
-				numports--;
-				port--;
+				release_region(*port, ARCNET_TOTAL_SIZE);
+				*port-- = ports[--numports];
 				continue;
 			}
 		} else {
-			airq = dev->irq;
+			airq = irq;
 		}
 
 		BUGMSG2(D_INIT, "(%d,", airq);
@@ -354,21 +358,20 @@
 		mdelay(RESETtime);
 #endif
 
-		for (shmem = &shmems[0]; shmem - shmems < numshmems; shmem++) {
-			u_long ptr = *shmem;
+		for (p = &shmems[0]; p < shmems + numshmems; p++) {
+			u_long ptr = *p;
 
 			if (isa_readb(ptr) == TESTvalue) {	/* found one */
-				BUGMSG2(D_INIT, "%lXh)\n", *shmem);
+				BUGMSG2(D_INIT, "%lXh)\n", *p);
 				openparen = 0;
 
 				/* register the card */
-				retval = com90xx_found(dev, *port, airq, *shmem);
+				if (com90xx_found(*port, airq, *p) == 0)
+					found = 1;
 				numprint = -1;
 
 				/* remove shmem from the list */
-				*shmem = shmems[numshmems - 1];
-				numshmems--;
-
+				*p = shmems[--numshmems];
 				break;	/* go to the next I/O port */
 			} else {
 				BUGMSG2(D_INIT_REASONS, "%Xh-", isa_readb(ptr));
@@ -380,44 +383,39 @@
 			BUGLVL(D_INIT_REASONS) printk("S5: ");
 			BUGLVL(D_INIT_REASONS) numprint = 0;
 		}
-		*port = ports[numports - 1];
-		numports--;
-		port--;
+		if (!found)
+			release_region(*port, ARCNET_TOTAL_SIZE);
+		*port-- = ports[--numports];
 	}
 
 	BUGLVL(D_INIT_REASONS) printk("\n");
 
 	/* Now put back TESTvalue on all leftover shmems. */
-	for (shmem = &shmems[0]; shmem - shmems < numshmems; shmem++)
-		isa_writeb(TESTvalue, *shmem);
-
-	if (retval && dev && !numcards)
-		BUGMSG2(D_NORMAL, "S5: No ARCnet cards found.\n");
-	return retval;
+	for (p = &shmems[0]; p < shmems + numshmems; p++) {
+		isa_writeb(TESTvalue, *p);
+		release_mem_region(*p, BUFFER_SIZE);
+	}
 }
 
 
 /* Set up the struct net_device associated with this card.  Called after
  * probing succeeds.
  */
-static int __init com90xx_found(struct net_device *dev0, int ioaddr, int airq,
-				u_long shmem)
+static int __init com90xx_found(int ioaddr, int airq, u_long shmem)
 {
-	struct net_device *dev = dev0;
+	struct net_device *dev = NULL;
 	struct arcnet_local *lp;
 	u_long first_mirror, last_mirror;
-	int mirror_size, err;
+	int mirror_size;
 
-	/* allocate struct net_device if we don't have one yet */
-	if (!dev && !(dev = dev_alloc("arc%d", &err))) {
+	/* allocate struct net_device */
+	dev = alloc_arcdev(device);
+	if (!dev) {
 		BUGMSG2(D_NORMAL, "com90xx: Can't allocate device!\n");
-		return err;
-	}
-	lp = dev->priv = kmalloc(sizeof(struct arcnet_local), GFP_KERNEL);
-	if (!lp) {
-		BUGMSG(D_NORMAL, "Can't allocate device data!\n");
-		goto err_free_dev;
+		release_mem_region(shmem, BUFFER_SIZE);
+		return -ENOMEM;
 	}
+	lp = dev->priv;
 	/* find the real shared memory start/end points, including mirrors */
 
 	/* guess the actual size of one "memory mirror" - the number of
@@ -442,8 +440,18 @@
 	dev->mem_start = first_mirror;
 	dev->mem_end = last_mirror + MIRROR_SIZE - 1;
 
+	release_mem_region(shmem, BUFFER_SIZE);
+	if (!request_mem_region(dev->mem_start, dev->mem_end - dev->mem_start + 1, "arcnet (90xx)"))
+		goto err_free_dev;
+
+	/* reserve the irq */
+	if (request_irq(airq, &arcnet_interrupt, 0, "arcnet (90xx)", dev)) {
+		BUGMSG(D_NORMAL, "Can't get IRQ %d!\n", airq);
+		goto err_release_mem;
+	}
+	dev->irq = airq;
+
 	/* Initialize the rest of the device structure. */
-	memset(lp, 0, sizeof(struct arcnet_local));
 	lp->card_name = "COM90xx";
 	lp->hw.command = com90xx_command;
 	lp->hw.status = com90xx_status;
@@ -455,24 +463,12 @@
 	lp->mem_start = ioremap(dev->mem_start, dev->mem_end - dev->mem_start + 1);
 	if (!lp->mem_start) {
 		BUGMSG(D_NORMAL, "Can't remap device memory!\n");
-		goto err_free_dev_priv;
+		goto err_free_irq;
 	}
-	/* Fill in the fields of the device structure with generic values. */
-	arcdev_setup(dev);
 
 	/* get and check the station ID from offset 1 in shmem */
 	dev->dev_addr[0] = readb(lp->mem_start + 1);
 
-	/* reserve the irq */
-	if (request_irq(airq, &arcnet_interrupt, 0, "arcnet (90xx)", dev)) {
-		BUGMSG(D_NORMAL, "Can't get IRQ %d!\n", airq);
-		goto err_unmap;
-	}
-	dev->irq = airq;
-
-	/* reserve the I/O and memory regions - guaranteed to work by check_region */
-	request_region(ioaddr, ARCNET_TOTAL_SIZE, "arcnet (90xx)");
-	request_mem_region(dev->mem_start, dev->mem_end - dev->mem_start + 1, "arcnet (90xx)");
 	dev->base_addr = ioaddr;
 
 	BUGMSG(D_NORMAL, "COM90xx station %02Xh found at %03lXh, IRQ %d, "
@@ -481,23 +477,20 @@
 	       dev->base_addr, dev->irq, dev->mem_start,
 	 (dev->mem_end - dev->mem_start + 1) / mirror_size, mirror_size);
 
-	if (!dev0 && register_netdev(dev))
-		goto err_release;
+	if (register_netdev(dev))
+		goto err_unmap;
 
 	cards[numcards++] = dev;
 	return 0;
 
-      err_release:
+err_unmap:
+	iounmap(lp->mem_start);
+err_free_irq:
 	free_irq(dev->irq, dev);
-	release_region(dev->base_addr, ARCNET_TOTAL_SIZE);
+err_release_mem:
 	release_mem_region(dev->mem_start, dev->mem_end - dev->mem_start + 1);
-      err_unmap:
-	iounmap(lp->mem_start);
-      err_free_dev_priv:
-	kfree(dev->priv);
-      err_free_dev:
-	if (!dev0)
-		kfree(dev);
+err_free_dev:
+	free_netdev(dev);
 	return -EIO;
 }
 
@@ -587,37 +580,13 @@
 }
 
 
-/* Module parameters */
-
-static int io;			/* use the insmod io= irq= shmem= options */
-static int irq;
-static int shmem;
-static char *device;		/* use eg. device=arc1 to change name */
-
-MODULE_PARM(io, "i");
-MODULE_PARM(irq, "i");
-MODULE_PARM(shmem, "i");
-MODULE_PARM(device, "s");
 MODULE_LICENSE("GPL");
 
 static int __init com90xx_init(void)
 {
-	struct net_device *dev;
-	int err;
-
-	if (io || irq || shmem || device) {
-		dev = dev_alloc(device ? : "arc%d", &err);
-		if (!dev)
-			return err;
-		dev->base_addr = io;
-		dev->irq = irq;
-		if (dev->irq == 2)
-			dev->irq = 9;
-		dev->mem_start = shmem;
-		com90xx_probe(dev);
-	} else
-		com90xx_probe(NULL);
-
+	if (irq == 2)
+		irq = 9;
+	com90xx_probe();
 	if (!numcards)
 		return -EIO;
 	return 0;
@@ -638,7 +607,6 @@
 		iounmap(lp->mem_start);
 		release_region(dev->base_addr, ARCNET_TOTAL_SIZE);
 		release_mem_region(dev->mem_start, dev->mem_end - dev->mem_start + 1);
-		kfree(dev->priv);
 		free_netdev(dev);
 	}
 }
@@ -669,9 +637,7 @@
 	}
 
 	if (*s)
-		strncpy(device, s, 9);
-	else
-		strcpy(device, "arc%d");
+		snprintf(device, sizeof(device), "%s", s);
 
 	return 1;
 }
--- diff/drivers/net/ariadne.c	2003-08-26 10:00:52.000000000 +0100
+++ source/drivers/net/ariadne.c	2004-02-09 10:39:53.000000000 +0000
@@ -168,7 +168,7 @@
 	    continue;
 	}
 
-	dev = init_etherdev(NULL, sizeof(struct ariadne_private));
+	dev = alloc_etherdev(sizeof(struct ariadne_private));
 
 	if (dev == NULL) {
 	    release_resource(r1);
@@ -205,11 +205,17 @@
 	dev->get_stats = &ariadne_get_stats;
 	dev->set_multicast_list = &set_multicast_list;
 
+	res = register_netdev(dev);
+	if (res) {
+	    release_resource(r1);
+	    release_resource(r2);
+	    free_netdev(dev);
+	    break;
+	}
 #ifdef MODULE
 	priv->next_module = root_ariadne_dev;
 	root_ariadne_dev = priv;
 #endif
-	res = 0;
     }
     return res;
 }
--- diff/drivers/net/arm/am79c961a.c	2003-08-20 14:16:29.000000000 +0100
+++ source/drivers/net/arm/am79c961a.c	2004-02-09 10:39:53.000000000 +0000
@@ -672,6 +672,10 @@
 	dev->base_addr = 0x220;
 	dev->irq = IRQ_EBSA110_ETHERNET;
 
+    	ret = -ENODEV;
+	if (!request_region(dev->base_addr, 0x18, dev->name))
+		goto nodev;
+
 	/*
 	 * Reset the device.
 	 */
@@ -682,14 +686,10 @@
 	 * Check the manufacturer part of the
 	 * ether address.
 	 */
-    	ret = -ENODEV;
 	if (inb(dev->base_addr) != 0x08 ||
 	    inb(dev->base_addr + 2) != 0x00 ||
 	    inb(dev->base_addr + 4) != 0x2b)
-	    	goto nodev;
-
-	if (!request_region(dev->base_addr, 0x18, dev->name))
-		goto nodev;
+	    	goto release;
 
 	am79c961_banner();
 	printk(KERN_INFO "%s: ether address ", dev->name);
@@ -722,7 +722,7 @@
 release:
 	release_region(dev->base_addr, 0x18);
 nodev:
-	kfree(dev);
+	free_netdev(dev);
 out:
 	return ret;
 }
--- diff/drivers/net/arm/ether00.c	2003-09-30 15:46:15.000000000 +0100
+++ source/drivers/net/arm/ether00.c	2004-02-09 10:39:53.000000000 +0000
@@ -923,8 +923,6 @@
 		result = -ENOMEM;
 		goto out_release;
 	}
-	memset(dev,0,sizeof(struct net_device));
-	memset(dev->priv, 0, sizeof(struct net_priv));
 	priv = dev->priv;
 
 	priv->tq_memupdate.routine=ether00_mem_update;
@@ -966,7 +964,7 @@
  out_unmap:
 	iounmap(map_addr);
  out_kfree:
-	kfree(dev);
+	free_netdev(dev);
  out_release:
 	release_mem_region(dev_info->base_addr, MAC_REG_SIZE);
 	return result;
--- diff/drivers/net/arm/ether1.c	2003-11-25 15:24:57.000000000 +0000
+++ source/drivers/net/arm/ether1.c	2004-02-09 10:39:53.000000000 +0000
@@ -1068,7 +1068,7 @@
 release:
 	release_region(dev->base_addr, 16);
 	release_region(dev->base_addr + 0x800, 4096);
-	kfree(dev);
+	free_netdev(dev);
 out:
 	return ret;
 }
--- diff/drivers/net/arm/ether3.c	2003-11-25 15:24:57.000000000 +0000
+++ source/drivers/net/arm/ether3.c	2004-02-09 10:39:53.000000000 +0000
@@ -908,7 +908,7 @@
 failed:
 	release_region(dev->base_addr, 128);
 free:
-	kfree(dev);
+	free_netdev(dev);
 out:
 	return ret;
 }
--- diff/drivers/net/arm/etherh.c	2003-11-25 15:24:58.000000000 +0000
+++ source/drivers/net/arm/etherh.c	2004-02-09 10:39:53.000000000 +0000
@@ -551,15 +551,12 @@
 
 	etherh_banner();
 
-	dev = alloc_etherdev(sizeof(struct etherh_priv));
+	dev = alloc_ei_netdev();
 	if (!dev) {
 		ret = -ENOMEM;
 		goto out;
 	}
 
-	/*
-	 * alloc_etherdev allocs and zeros dev->priv
-	 */
 	eh = dev->priv;
 
 	spin_lock_init(&eh->eidev.page_lock);
@@ -622,21 +619,12 @@
 		goto free;
 	}
 
-	if (ethdev_init(dev)) {
-		ret = -ENODEV;
-		goto release;
-	}
-
 	/*
 	 * If we're in the NIC slot, make sure the IRQ is enabled
 	 */
 	if (dev->irq == 11)
 		etherh_set_ctrl(eh, ETHERH_CP_IE);
 
-	/*
-	 * Unfortunately, ethdev_init eventually calls
-	 * ether_setup, which re-writes dev->flags.
-	 */
 	switch (ec->cid.product) {
 	case PROD_ANT_ETHERM:
 		dev_type = "ANT EtherM";
@@ -705,7 +693,7 @@
  release:
 	release_region(dev->base_addr, 16);
  free:
-	kfree(dev);
+	free_netdev(dev);
  out:
 	return ret;
 }
--- diff/drivers/net/at1700.c	2003-10-09 09:47:34.000000000 +0100
+++ source/drivers/net/at1700.c	2004-02-09 10:39:53.000000000 +0000
@@ -81,12 +81,12 @@
  */
 
 #ifndef CONFIG_X86_PC9800
-static int at1700_probe_list[] __initdata = {
+static unsigned at1700_probe_list[] __initdata = {
 	0x260, 0x280, 0x2a0, 0x240, 0x340, 0x320, 0x380, 0x300, 0
 };
 
 #else /* CONFIG_X86_PC9800 */
-static int at1700_probe_list[] __initdata = {
+static unsigned at1700_probe_list[] __initdata = {
 	0x1d6, 0x1d8, 0x1da, 0x1d4, 0xd4, 0xd2, 0xd8, 0xd0, 0
 };
 
@@ -196,8 +196,6 @@
 
 /* Index to functions, as function prototypes. */
 
-extern int at1700_probe(struct net_device *dev);
-
 static int at1700_probe1(struct net_device *dev, int ioaddr);
 static int read_eeprom(long ioaddr, int location);
 static int net_open(struct net_device *dev);
@@ -232,24 +230,78 @@
    (detachable devices only).
    */
 
-int __init at1700_probe(struct net_device *dev)
+#ifndef CONFIG_X86_PC9800
+static int io = 0x260;
+#else
+static int io = 0xd0;
+#endif
+
+static int irq;
+
+static void cleanup_card(struct net_device *dev)
 {
-	int i;
-	int base_addr = dev->base_addr;
+#ifdef CONFIG_MCA	
+	struct net_local *lp = dev->priv;
+	if (lp->mca_slot)
+		mca_mark_as_unused(lp->mca_slot);
+#endif	
+	free_irq(dev->irq, NULL);
+#ifndef CONFIG_X86_PC9800
+	release_region(dev->base_addr, AT1700_IO_EXTENT);
+#else
+	{
+		int i;
+		for (i = 0; i < 0x2000; i += 0x200)
+			release_region(dev->base_addr + i, 2);
+	}
+#endif
+}
+
+struct net_device * __init at1700_probe(int unit)
+{
+	struct net_device *dev = alloc_etherdev(sizeof(struct net_local));
+	unsigned *port;
+	int err = 0;
+
+	if (!dev)
+		return ERR_PTR(-ENODEV);
+
+	if (unit >= 0) {
+		sprintf(dev->name, "eth%d", unit);
+		netdev_boot_setup_check(dev);
+		io = dev->base_addr;
+		irq = dev->irq;
+	} else {
+		dev->base_addr = io;
+		dev->irq = irq;
+	}
 
 	SET_MODULE_OWNER(dev);
 
-	if (base_addr > 0x1ff)		/* Check a single specified location. */
-		return at1700_probe1(dev, base_addr);
-	else if (base_addr != 0)	/* Don't probe at all. */
-		return -ENXIO;
-
-	for (i = 0; at1700_probe_list[i]; i++) {
-		int ioaddr = at1700_probe_list[i];
-		if (at1700_probe1(dev, ioaddr) == 0)
-			return 0;
+	if (io > 0x1ff) {	/* Check a single specified location. */
+		err = at1700_probe1(dev, io);
+	} else if (io != 0) {	/* Don't probe at all. */
+		err = -ENXIO;
+	} else {
+		for (port = at1700_probe_list; *port; port++) {
+			if (at1700_probe1(dev, *port) == 0)
+				break;
+			dev->irq = irq;
+		}
+		if (!*port)
+			err = -ENODEV;
 	}
-	return -ENODEV;
+	if (err)
+		goto out;
+	err = register_netdev(dev);
+	if (err)
+		goto out1;
+	return dev;
+out1:
+	cleanup_card(dev);
+out:
+	free_netdev(dev);
+	return ERR_PTR(err);
 }
 
 /* The Fujitsu datasheet suggests that the NIC be probed for by checking its
@@ -267,7 +319,7 @@
 	char at1700_irqmap[8] = {3, 4, 5, 9, 10, 11, 14, 15};
 	unsigned int i, irq, is_fmv18x = 0, is_at1700 = 0;
 	int slot, ret = -ENODEV;
-	struct net_local *lp;
+	struct net_local *lp = dev->priv;
 	
 #ifndef CONFIG_X86_PC9800
 	if (!request_region(ioaddr, AT1700_IO_EXTENT, dev->name))
@@ -284,9 +336,10 @@
 	}
 #endif
 
-		/* Resetting the chip doesn't reset the ISA interface, so don't bother.
-	   That means we have to be careful with the register values we probe for.
-	   */
+	/* Resetting the chip doesn't reset the ISA interface, so don't bother.
+	   That means we have to be careful with the register values we probe
+	   for.
+	 */
 #ifdef notdef
 	printk("at1700 probe at %#x, eeprom is %4.4x %4.4x %4.4x ctrl %4.4x.\n",
 		   ioaddr, read_eeprom(ioaddr, 4), read_eeprom(ioaddr, 5),
@@ -331,15 +384,13 @@
 						break;
 
 					/* probing for a card at a particular IO/IRQ */
-				if (dev &&
-					((dev->irq && dev->irq != irq) ||
-					 (dev->base_addr && dev->base_addr != ioaddr))) {
+				if ((dev->irq && dev->irq != irq) ||
+				    (dev->base_addr && dev->base_addr != ioaddr)) {
 				  	slot++;		/* probing next slot */
 				  	continue;
 				}
 
-				if (dev)
-					dev->irq = irq;
+				dev->irq = irq;
 				
 				/* claim the slot */
 				mca_set_adapter_name( slot, at1720_mca_adapters[j].name );
@@ -476,13 +527,7 @@
 	if (net_debug)
 		printk(version);
 
-	/* Initialize the device structure. */
-	dev->priv = kmalloc(sizeof(struct net_local), GFP_KERNEL);
-	if (dev->priv == NULL) {
-		ret = -ENOMEM;
-		goto err_out;
-	}
-	memset(dev->priv, 0, sizeof(struct net_local));
+	memset(lp, 0, sizeof(struct net_local));
 
 	dev->open		= net_open;
 	dev->stop		= net_close;
@@ -492,11 +537,7 @@
 	dev->tx_timeout = net_tx_timeout;
 	dev->watchdog_timeo = TX_TIMEOUT;
 
-	lp = (struct net_local *)dev->priv;
-	lp->lock = SPIN_LOCK_UNLOCKED;
-
-	/* Fill in the fields of 'dev' with ethernet-generic values. */
-	ether_setup(dev);
+	spin_lock_init(&lp->lock);
 
 	lp->jumpered = is_fmv18x;
 	lp->mca_slot = slot;
@@ -505,14 +546,11 @@
 	if (ret) {
 		printk ("  AT1700 at %#3x is unusable due to a conflict on"
 				"IRQ %d.\n", ioaddr, irq);
-		goto err_out_priv;
+		goto err_out;
 	}
 
 	return 0;
 
-err_out_priv:
-	kfree(dev->priv);
-	dev->priv = NULL;
 err_out:
 #ifndef CONFIG_X86_PC9800
 	release_region(ioaddr, AT1700_IO_EXTENT);
@@ -940,14 +978,7 @@
 }
 
 #ifdef MODULE
-static struct net_device dev_at1700;
-#ifndef CONFIG_X86_PC9800
-static int io = 0x260;
-#else
-static int io = 0xd0;
-#endif
-
-static int irq;
+static struct net_device *dev_at1700;
 
 MODULE_PARM(io, "i");
 MODULE_PARM(irq, "i");
@@ -960,41 +991,18 @@
 {
 	if (io == 0)
 		printk("at1700: You should not use auto-probing with insmod!\n");
-	dev_at1700.base_addr = io;
-	dev_at1700.irq       = irq;
-	dev_at1700.init      = at1700_probe;
-	if (register_netdev(&dev_at1700) != 0) {
-		printk("at1700: register_netdev() returned non-zero.\n");
-		return -EIO;
-	}
+	dev_at1700 = at1700_probe(-1);
+	if (IS_ERR(dev_at1700))
+		return PTR_ERR(dev_at1700);
 	return 0;
 }
 
 void
 cleanup_module(void)
 {
-#ifdef CONFIG_MCA	
-	struct net_local *lp = dev_at1700.priv;
-	if(lp->mca_slot)
-	{
-		mca_mark_as_unused(lp->mca_slot);
-	}
-#endif	
-	unregister_netdev(&dev_at1700);
-	kfree(dev_at1700.priv);
-	dev_at1700.priv = NULL;
-
-	/* If we don't do this, we can't re-insmod it later. */
-	free_irq(dev_at1700.irq, NULL);
-#ifndef CONFIG_X86_PC9800
-	release_region(dev_at1700.base_addr, AT1700_IO_EXTENT);
-#else
-	{
-		int i;
-		for (i = 0; i < 0x2000; i += 0x200)
-			release_region(dev_at1700.base_addr + i, 2);
-	}
-#endif
+	unregister_netdev(dev_at1700);
+	cleanup_card(dev_at1700);
+	free_netdev(dev_at1700);
 }
 #endif /* MODULE */
 MODULE_LICENSE("GPL");
--- diff/drivers/net/atari_bionet.c	2003-06-09 14:18:18.000000000 +0100
+++ source/drivers/net/atari_bionet.c	2004-02-09 10:39:53.000000000 +0000
@@ -148,8 +148,6 @@
 
 /* Index to functions, as function prototypes.
  */
-extern int bionet_probe(struct net_device *dev);
-
 static int bionet_open(struct net_device *dev);
 static int bionet_send_packet(struct sk_buff *skb, struct net_device *dev);
 static void bionet_poll_rx(struct net_device *);
@@ -321,15 +319,26 @@
 
 /* Check for a network adaptor of this type, and return '0' if one exists.
  */
-int __init 
-bionet_probe(struct net_device *dev){
+struct net_device * __init bionet_probe(int unit)
+{
+	struct net_device *dev;
 	unsigned char station_addr[6];
 	static unsigned version_printed;
 	static int no_more_found;	/* avoid "Probing for..." printed 4 times */
 	int i;
+	int err;
 
 	if (!MACH_IS_ATARI || no_more_found)
-		return -ENODEV;
+		return ERR_PTR(-ENODEV);
+
+	dev = alloc_etherdev(sizeof(struct net_local));
+	if (!dev)
+		return ERR_PTR(-ENOMEM);
+	if (unit >= 0) {
+		sprintf(dev->name, "eth%d", unit);
+		netdev_boot_setup_check(dev);
+	}
+	SET_MODULE_OWNER(dev);
 
 	printk("Probing for BioNet 100 Adapter...\n");
 
@@ -347,11 +356,10 @@
 	||  station_addr[2] != 'O' ) {
 		no_more_found = 1;
 		printk( "No BioNet 100 found.\n" );
-		return -ENODEV;
+		free_netdev(dev);
+		return ERR_PTR(-ENODEV);
 	}
 
-	SET_MODULE_OWNER(dev);
-
 	if (bionet_debug > 0 && version_printed++ == 0)
 		printk(version);
 
@@ -369,12 +377,6 @@
 			nic_packet, phys_nic_packet );
 	}
 
-	if (dev->priv == NULL)
-		dev->priv = kmalloc(sizeof(struct net_local), GFP_KERNEL);
-	if (!dev->priv)
-		return -ENOMEM;
-	memset(dev->priv, 0, sizeof(struct net_local));
-
 	dev->open		= bionet_open;
 	dev->stop		= bionet_close;
 	dev->hard_start_xmit	= bionet_send_packet;
@@ -390,8 +392,11 @@
 #endif
 		dev->dev_addr[i]  = station_addr[i];
 	}
-	ether_setup(dev);
-	return 0;
+	err = register_netdev(dev);
+	if (!err)
+		return dev;
+	free_netdev(dev);
+	return ERR_PTR(err);
 }
 
 /* Open/initialize the board.  This is called (in the current kernel)
@@ -640,25 +645,20 @@
 
 #ifdef MODULE
 
-static struct net_device bio_dev;
-
-int
-init_module(void) {
-	int err;
+static struct net_device *bio_dev;
 
-	bio_dev.init = bionet_probe;
-	if ((err = register_netdev(&bio_dev))) {
-		if (err == -EEXIST)  {
-			printk("BIONET: devices already present. Module not loaded.\n");
-		}
-		return err;
-	}
+int init_module(void)
+{
+	bio_dev = bionet_probe(-1);
+	if (IS_ERR(bio_dev))
+		return PTR_ERR(bio_dev);
 	return 0;
 }
 
-void
-cleanup_module(void) {
-	unregister_netdev(&bio_dev);
+void cleanup_module(void)
+{
+	unregister_netdev(bio_dev);
+	free_netdev(bio_dev);
 }
 
 #endif /* MODULE */
--- diff/drivers/net/atari_pamsnet.c	2003-08-20 14:16:10.000000000 +0100
+++ source/drivers/net/atari_pamsnet.c	2004-02-09 10:39:53.000000000 +0000
@@ -110,8 +110,6 @@
 #undef READ
 #undef WRITE
 
-extern struct net_device *init_etherdev(struct net_device *dev, int sizeof_private);
-
 /* use 0 for production, 1 for verification, >2 for debug
  */
 #ifndef NET_DEBUG
@@ -158,8 +156,6 @@
 static int	get_status (void);
 static int	calc_received (void *start_address);
 
-extern int pamsnet_probe(struct net_device *dev);
-
 static int pamsnet_open(struct net_device *dev);
 static int pamsnet_send_packet(struct sk_buff *skb, struct net_device *dev);
 static void pamsnet_poll_rx(struct net_device *);
@@ -562,12 +558,12 @@
 /* Check for a network adaptor of this type, and return '0' if one exists.
  */
 
-int __init 
-pamsnet_probe (dev)
-	struct net_device *dev;
+struct net_device * __init pamsnet_probe (int unit)
 {
+	struct net_device *dev;
 	int i;
 	HADDR *hwaddr;
+	int err;
 
 	unsigned char station_addr[6];
 	static unsigned version_printed;
@@ -575,12 +571,18 @@
 	static int no_more_found;
 
 	if (no_more_found)
-		return -ENODEV;
+		return ERR_PTR(-ENODEV);
+	no_more_found = 1;
 
+	dev = alloc_etherdev(sizeof(struct net_local));
+	if (!dev)
+		return ERR_PTR(-ENOMEM);
+	if (unit >= 0) {
+		sprintf(dev->name, "eth%d", unit);
+		netdev_boot_setup_check(dev);
+	}
 	SET_MODULE_OWNER(dev);
 
-	no_more_found = 1;
-
 	printk("Probing for PAM's Net/GK Adapter...\n");
 
 	/* Allocate the DMA buffer here since we need it for probing! */
@@ -618,11 +620,12 @@
 	ENABLE_IRQ();
 	stdma_release();
 
-	if (lance_target < 0)
+	if (lance_target < 0) {
 		printk("No PAM's Net/GK found.\n");
+		free_netdev(dev);
+		return ERR_PTR(-ENODEV);
+	}
 
-	if ((dev == NULL) || (lance_target < 0))
-		return -ENODEV;
 	if (pamsnet_debug > 0 && version_printed++ == 0)
 		printk(version);
 
@@ -632,12 +635,6 @@
 		station_addr[3], station_addr[4], station_addr[5]);
 
 	/* Initialize the device structure. */
-	if (dev->priv == NULL)
-		dev->priv = kmalloc(sizeof(struct net_local), GFP_KERNEL);
-	if (!dev->priv)
-		return -ENOMEM;
-	memset(dev->priv, 0, sizeof(struct net_local));
-
 	dev->open		= pamsnet_open;
 	dev->stop		= pamsnet_close;
 	dev->hard_start_xmit	= pamsnet_send_packet;
@@ -653,9 +650,12 @@
 #endif
 		dev->dev_addr[i]  = station_addr[i];
 	}
-	ether_setup(dev);
+	err = register_netdev(dev);
+	if (!err)
+		return dev;
 
-	return(0);
+	free_netdev(dev);
+	return ERR_PTR(err);
 }
 
 /* Open/initialize the board.  This is called (in the current kernel)
@@ -866,25 +866,20 @@
 
 #ifdef MODULE
 
-static struct net_device pam_dev;
-
-int
-init_module(void) {
-	int err;
+static struct net_device *pam_dev;
 
-	pam_dev.init = pamsnet_probe;
-	if ((err = register_netdev(&pam_dev))) {
-		if (err == -EEXIST)  {
-			printk("PAM's Net/GK: devices already present. Module not loaded.\n");
-		}
-		return err;
-	}
+int init_module(void)
+{
+	pam_dev = pamsnet_probe(-1);
+	if (IS_ERR(pam_dev))
+		return PTR_ERR(pam_dev);
 	return 0;
 }
 
-void
-cleanup_module(void) {
-	unregister_netdev(&pam_dev);
+void cleanup_module(void)
+{
+	unregister_netdev(pam_dev);
+	free_netdev(pam_dev);
 }
 
 #endif /* MODULE */
--- diff/drivers/net/atarilance.c	2003-05-21 11:50:15.000000000 +0100
+++ source/drivers/net/atarilance.c	2004-02-09 10:39:53.000000000 +0000
@@ -371,26 +371,39 @@
 }
 
 
-int __init atarilance_probe( struct net_device *dev )
-{	
+struct net_device * __init atarilance_probe(int unit)
+{
 	int i;
 	static int found;
-
-	SET_MODULE_OWNER(dev);
+	struct net_device *dev;
+	int err = -ENODEV;
 
 	if (!MACH_IS_ATARI || found)
 		/* Assume there's only one board possible... That seems true, since
 		 * the Riebl/PAM board's address cannot be changed. */
-		return( ENODEV );
+		return ERR_PTR(-ENODEV);
+
+	dev = alloc_etherdev(sizeof(struct lance_private));
+	if (!dev)
+		return ERR_PTR(-ENOMEM);
+	if (unit >= 0) {
+		sprintf(dev->name, "eth%d", unit);
+		netdev_boot_setup_check(dev);
+	}
+	SET_MODULE_OWNER(dev);
 
 	for( i = 0; i < N_LANCE_ADDR; ++i ) {
 		if (lance_probe1( dev, &lance_addr_list[i] )) {
 			found = 1;
-			return( 0 );
+			err = register_netdev(dev);
+			if (!err)
+				return dev;
+			free_irq(dev->irq, dev);
+			break;
 		}
 	}
-
-	return( ENODEV );
+	free_netdev(dev);
+	return ERR_PTR(err);
 }
 
 
@@ -511,12 +524,6 @@
 	return( 0 );
 
   probe_ok:
-	init_etherdev( dev, sizeof(struct lance_private) );
-	if (!dev->priv) {
-		dev->priv = kmalloc( sizeof(struct lance_private), GFP_KERNEL );
-		if (!dev->priv)
-			return 0;
-	}
 	lp = (struct lance_private *)dev->priv;
 	MEM = (struct lance_memory *)memaddr;
 	IO = lp->iobase = (struct lance_ioreg *)ioaddr;
@@ -1171,26 +1178,21 @@
 
 
 #ifdef MODULE
-static struct net_device atarilance_dev;
+static struct net_device *atarilance_dev;
 
 int init_module(void)
-
-{	int err;
-
-	atarilance_dev.init = atarilance_probe;
-	if ((err = register_netdev( &atarilance_dev ))) {
-		if (err == -EIO)  {
-			printk( "No Atari Lance board found. Module not loaded.\n");
-		}
-		return( err );
-	}
-	return( 0 );
+{
+	atarilance_dev = atarilance_probe(-1);
+	if (IS_ERR(atarilance_dev))
+		return PTR_ERR(atarilance_dev);
+	return 0;
 }
 
 void cleanup_module(void)
-
 {
-	unregister_netdev( &atarilance_dev );
+	unregister_netdev(atarilance_dev);
+	free_irq(atarilance_dev->irq, atarilance_dev);
+	free_netdev(atarilance_dev);
 }
 
 #endif /* MODULE */
--- diff/drivers/net/atp.c	2003-08-26 10:00:52.000000000 +0100
+++ source/drivers/net/atp.c	2004-02-09 10:39:53.000000000 +0000
@@ -195,7 +195,7 @@
 
 /* Index to functions, as function prototypes. */
 
-static int atp_probe1(struct net_device *dev, long ioaddr);
+static int atp_probe1(long ioaddr);
 static void get_node_ID(struct net_device *dev);
 static unsigned short eeprom_op(long ioaddr, unsigned int cmd);
 static int net_open(struct net_device *dev);
@@ -224,13 +224,13 @@
    
    FIXME: we should use the parport layer for this
    */
-static int __init atp_init(struct net_device *dev)
+static int __init atp_init(void)
 {
 	int *port, ports[] = {0x378, 0x278, 0x3bc, 0};
-	int base_addr = dev ? dev->base_addr : io[0];
+	int base_addr = io[0];
 
 	if (base_addr > 0x1ff)		/* Check a single specified location. */
-		return atp_probe1(dev, base_addr);
+		return atp_probe1(base_addr);
 	else if (base_addr == 1)	/* Don't probe at all. */
 		return -ENXIO;
 
@@ -239,17 +239,19 @@
 		outb(0x57, ioaddr + PAR_DATA);
 		if (inb(ioaddr + PAR_DATA) != 0x57)
 			continue;
-		if (atp_probe1(dev, ioaddr) == 0)
+		if (atp_probe1(ioaddr) == 0)
 			return 0;
 	}
 
 	return -ENODEV;
 }
 
-static int __init atp_probe1(struct net_device *dev, long ioaddr)
+static int __init atp_probe1(long ioaddr)
 {
+	struct net_device *dev = NULL;
 	struct net_local *lp;
 	int saved_ctrl_reg, status, i;
+	int res;
 
 	outb(0xff, ioaddr + PAR_DATA);
 	/* Save the original value of the Control register, in case we guessed
@@ -296,7 +298,7 @@
 		return -ENODEV;
 	}
 
-	dev = init_etherdev(dev, sizeof(struct net_local));
+	dev = alloc_etherdev(sizeof(struct net_local));
 	if (!dev)
 		return -ENOMEM;
 	SET_MODULE_OWNER(dev);
@@ -331,24 +333,13 @@
 		   dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5]);
 
 	/* Reset the ethernet hardware and activate the printer pass-through. */
-    write_reg_high(ioaddr, CMR1, CMR1h_RESET | CMR1h_MUX);
-
-	/* Initialize the device structure. */
-	ether_setup(dev);
-	if (dev->priv == NULL)
-		dev->priv = kmalloc(sizeof(struct net_local), GFP_KERNEL);
-	if (dev->priv == NULL)
-		return -ENOMEM;
-	memset(dev->priv, 0, sizeof(struct net_local));
+	write_reg_high(ioaddr, CMR1, CMR1h_RESET | CMR1h_MUX);
 
 	lp = (struct net_local *)dev->priv;
 	lp->chip_type = RTL8002;
 	lp->addr_mode = CMR2h_Normal;
 	spin_lock_init(&lp->lock);
 
-	lp->next_module = root_atp_dev;
-	root_atp_dev = dev;
-
 	/* For the ATP adapter the "if_port" is really the data transfer mode. */
 	if (xcvr[0])
 		dev->if_port = xcvr[0];
@@ -366,6 +357,15 @@
 	dev->tx_timeout		= tx_timeout;
 	dev->watchdog_timeo	= TX_TIMEOUT;
 
+	res = register_netdev(dev);
+	if (res) {
+		free_netdev(dev);
+		return res;
+	}
+
+	lp->next_module = root_atp_dev;
+	root_atp_dev = dev;
+
 	return 0;
 }
 
@@ -933,7 +933,7 @@
 static int __init atp_init_module(void) {
 	if (debug)					/* Emit version even if no cards detected. */
 		printk(KERN_INFO "%s" KERN_INFO "%s", versionA, versionB);
-	return atp_init(NULL);
+	return atp_init();
 }
 
 static void __exit atp_cleanup_module(void) {
--- diff/drivers/net/au1000_eth.c	2003-08-26 10:00:53.000000000 +0100
+++ source/drivers/net/au1000_eth.c	2004-02-09 10:39:53.000000000 +0000
@@ -56,7 +56,7 @@
 static void dma_free(void *, size_t);
 static void hard_stop(struct net_device *);
 static void enable_rx_tx(struct net_device *dev);
-static int __init au1000_probe1(struct net_device *, long, int, int);
+static int __init au1000_probe1(long, int, int);
 static int au1000_init(struct net_device *);
 static int au1000_open(struct net_device *);
 static int au1000_close(struct net_device *);
@@ -644,17 +644,17 @@
 		}
 		// check for valid entries, au1100 only has one entry
 		if (base_addr && irq) {
-			if (au1000_probe1(NULL, base_addr, irq, i) != 0) {
+			if (au1000_probe1(base_addr, irq, i) != 0)
 				return -ENODEV;
-			}
 		}
 	}
 	return 0;
 }
 
 static int __init
-au1000_probe1(struct net_device *dev, long ioaddr, int irq, int port_num)
+au1000_probe1(long ioaddr, int irq, int port_num)
 {
+	struct net_device *dev;
 	static unsigned version_printed = 0;
 	struct au1000_private *aup = NULL;
 	int i, retval = 0;
@@ -668,15 +668,16 @@
 	if (version_printed++ == 0)
 		printk(version);
 
-	if (!dev)
-		dev = init_etherdev(NULL, sizeof(struct au1000_private));
+	retval = -ENOMEM;
 
+	dev = alloc_etherdev(sizeof(struct au1000_private));
 	if (!dev) {
-		printk (KERN_ERR "au1000 eth: init_etherdev failed\n");  
-		release_region(ioaddr, MAC_IOSIZE);
-		return -ENODEV;
+		printk (KERN_ERR "au1000 eth: alloc_etherdev failed\n");  
+		goto out;
 	}
 
+	SET_MODULE_OWNER(dev);
+
 	printk("%s: Au1xxx ethernet found at 0x%lx, irq %d\n", 
 	       dev->name, ioaddr, irq);
 
@@ -685,10 +686,8 @@
 	/* Allocate the data buffers */
 	aup->vaddr = (u32)dma_alloc(MAX_BUF_SIZE * 
 			(NUM_TX_BUFFS+NUM_RX_BUFFS), &aup->dma_addr);
-	if (!aup->vaddr) {
-		retval = -ENOMEM;
-		goto free_region;
-	}
+	if (!aup->vaddr)
+		goto out1;
 
 	/* aup->mac is the base address of the MAC's registers */
 	aup->mac = (volatile mac_reg_t *)((unsigned long)ioaddr);
@@ -749,10 +748,11 @@
 		MAC_EN_RESET2 | MAC_EN_CLOCK_ENABLE;
 	au_sync_delay(2);
 
-	if (mii_probe(dev) != 0) {
-		 goto free_region;
-	}
+	retval = mii_probe(dev);
+	if (retval)
+		 goto out2;
 
+	retval = -EINVAL;
 	pDBfree = NULL;
 	/* setup the data buffer descriptors and attach a buffer to each one */
 	pDB = aup->db;
@@ -767,13 +767,13 @@
 
 	for (i=0; i<NUM_RX_DMA; i++) {
 		pDB = GetFreeDB(aup);
-		if (!pDB) goto free_region;
+		if (!pDB) goto out2;
 		aup->rx_dma_ring[i]->buff_stat = (unsigned)pDB->dma_addr;
 		aup->rx_db_inuse[i] = pDB;
 	}
 	for (i=0; i<NUM_TX_DMA; i++) {
 		pDB = GetFreeDB(aup);
-		if (!pDB) goto free_region;
+		if (!pDB) goto out2;
 		aup->tx_dma_ring[i]->buff_stat = (unsigned)pDB->dma_addr;
 		aup->tx_dma_ring[i]->len = 0;
 		aup->tx_db_inuse[i] = pDB;
@@ -792,26 +792,25 @@
 	dev->tx_timeout = au1000_tx_timeout;
 	dev->watchdog_timeo = ETH_TX_TIMEOUT;
 
-
-	/* Fill in the fields of the device structure with ethernet values. */
-	ether_setup(dev);
-
 	/* 
 	 * The boot code uses the ethernet controller, so reset it to start 
 	 * fresh.  au1000_init() expects that the device is in reset state.
 	 */
 	reset_mac(dev);
+
+	retval = register_netdev(dev);
+	if (retval)
+		goto out2;
 	return 0;
 
-free_region:
+out2:
+	dma_free(aup->vaddr, MAX_BUF_SIZE * (NUM_TX_BUFFS+NUM_RX_BUFFS));
+out1:
+	free_netdev(dev);
+out:
 	release_region(PHYSADDR(ioaddr), MAC_IOSIZE);
-	unregister_netdev(dev);
-	if (aup->vaddr) 
-		dma_free((void *)aup->vaddr, 
-				MAX_BUF_SIZE * (NUM_TX_BUFFS+NUM_RX_BUFFS));
 	printk(KERN_ERR "%s: au1000_probe1 failed.  Returns %d\n",
 	       dev->name, retval);
-	free_netdev(dev);
 	return retval;
 }
 
@@ -933,15 +932,12 @@
 	int retval;
 	struct au1000_private *aup = (struct au1000_private *) dev->priv;
 
-	MOD_INC_USE_COUNT;
-
 	if (au1000_debug > 4)
 		printk("%s: open: dev=%p\n", dev->name, dev);
 
 	if ((retval = au1000_init(dev))) {
 		printk(KERN_ERR "%s: error in au1000_init\n", dev->name);
 		free_irq(dev->irq, dev);
-		MOD_DEC_USE_COUNT;
 		return retval;
 	}
 	netif_start_queue(dev);
@@ -950,7 +946,6 @@
 					dev->name, dev))) {
 		printk(KERN_ERR "%s: unable to get IRQ %d\n", 
 				dev->name, dev->irq);
-		MOD_DEC_USE_COUNT;
 		return retval;
 	}
 
@@ -984,8 +979,6 @@
 	spin_unlock_irqrestore(&aup->lock, flags);
 
 	reset_mac(dev);
-	kfree(dev);
-	MOD_DEC_USE_COUNT;
 	return 0;
 }
 
--- diff/drivers/net/bagetlance.c	2003-05-21 11:50:15.000000000 +0100
+++ source/drivers/net/bagetlance.c	2004-02-09 10:39:53.000000000 +0000
@@ -465,30 +465,43 @@
 }
 
 
-int __init bagetlance_probe( struct net_device *dev )
-
-{	int i;
+struct net_device * __init bagetlance_probe(int unit)
+{
+	struct net_device *dev;
+	int i;
 	static int found;
-
-	SET_MODULE_OWNER(dev);
+	int err = -ENODEV;
 
 	if (found)
 		/* Assume there's only one board possible... That seems true, since
 		 * the Riebl/PAM board's address cannot be changed. */
-		return( -ENODEV );
+		return ERR_PTR(-ENODEV);
+
+	dev = alloc_etherdev(sizeof(struct lance_private));
+	if (!dev)
+		return ERR_PTR(-ENOMEM);
+
+	SET_MODULE_OWNER(dev);
 
 	for( i = 0; i < N_LANCE_ADDR; ++i ) {
 		if (lance_probe1( dev, &lance_addr_list[i] )) {
 			found = 1;
-			return( 0 );
+			break;
 		}
 	}
-
-	return( -ENODEV );
+	if (!found)
+		goto out;
+	err = register_netdev(dev);
+	if (err)
+		goto out1;
+	return dev;
+out1:
+	free_irq(dev->irq, dev);
+out:
+	free_netdev(dev);
+	return ERR_PTR(err);
 }
 
-
-
 /* Derived from hwreg_present() in vme/config.c: */
 
 static int __init addr_accessible( volatile void *regp, 
@@ -527,6 +540,7 @@
 	if (!addr_accessible( memaddr, 1, 1 )) goto probe_fail;
 
 	if ((unsigned long)memaddr >= KSEG2) {
+			/* FIXME: do we need to undo that on cleanup paths? */
 			extern int kseg2_alloc_io (unsigned long addr, unsigned long size);
 			if (kseg2_alloc_io((unsigned long)memaddr, BAGET_LANCE_MEM_SIZE)) {
 					printk("bagetlance: unable map lance memory\n");
@@ -580,12 +594,6 @@
 	return( 0 );
 
   probe_ok:
-	init_etherdev( dev, sizeof(struct lance_private) );
-	if (!dev->priv) {
-		dev->priv = kmalloc( sizeof(struct lance_private), GFP_KERNEL );
-		if (!dev->priv)
-			return 0;
-	}
 	lp = (struct lance_private *)dev->priv;
 	MEM = (struct lance_memory *)memaddr;
 	IO = lp->iobase = (struct lance_ioreg *)ioaddr;
@@ -617,8 +625,9 @@
 	if (lp->cardtype == PAM_CARD ||
 		memaddr == (unsigned short *)0xffe00000) {
 		/* PAMs card and Riebl on ST use level 5 autovector */
-		request_irq(BAGET_LANCE_IRQ, lance_interrupt, IRQ_TYPE_PRIO,
-		            "PAM/Riebl-ST Ethernet", dev);
+		if (request_irq(BAGET_LANCE_IRQ, lance_interrupt, IRQ_TYPE_PRIO,
+		            "PAM/Riebl-ST Ethernet", dev))
+			goto probe_fail;
 		dev->irq = (unsigned short)BAGET_LANCE_IRQ;
 	}
 	else {
@@ -629,10 +638,11 @@
 		unsigned long irq = BAGET_LANCE_IRQ; 
 		if (!irq) {
 			printk( "Lance: request for VME interrupt failed\n" );
-			return( 0 );
+			goto probe_fail;
 		}
-		request_irq(irq, lance_interrupt, IRQ_TYPE_PRIO,
-		            "Riebl-VME Ethernet", dev);
+		if (request_irq(irq, lance_interrupt, IRQ_TYPE_PRIO,
+		            "Riebl-VME Ethernet", dev))
+			goto probe_fail;
 		dev->irq = irq;
 	}
 
@@ -1331,26 +1341,21 @@
 
 
 #ifdef MODULE
-static struct net_device bagetlance_dev;
+static struct net_device *bagetlance_dev;
 
 int init_module(void)
-
-{	int err;
-
-	bagetlance_dev.init = bagetlance_probe;
-	if ((err = register_netdev( &bagetlance_dev ))) {
-		if (err == -EIO)  {
-			printk( "No Vme Lance board found. Module not loaded.\n");
-		}
-		return( err );
-	}
-	return( 0 );
+{
+	bagetlance_dev = bagetlance_probe(-1);
+	if (IS_ERR(bagetlance_dev))
+		return PTR_ERR(bagetlance_dev);
+	return 0;
 }
 
 void cleanup_module(void)
-
 {
-	unregister_netdev( &bagetlance_dev );
+	unregister_netdev(bagetlance_dev);
+	free_irq(bagetlance_dev->irq, bagetlance_dev);
+	free_netdev(bagetlance_dev);
 }
 
 #endif /* MODULE */
--- diff/drivers/net/bmac.c	2003-09-17 12:28:07.000000000 +0100
+++ source/drivers/net/bmac.c	2004-02-09 10:39:53.000000000 +0000
@@ -26,11 +26,9 @@
 #include <asm/pgtable.h>
 #include <asm/machdep.h>
 #include <asm/pmac_feature.h>
+#include <asm/macio.h>
 #include <asm/irq.h>
-#ifdef CONFIG_PMAC_PBOOK
-#include <linux/adb.h>
-#include <linux/pmu.h>
-#endif
+
 #include "bmac.h"
 
 #define trunc_page(x)	((void *)(((unsigned long)(x)) & ~((unsigned long)(PAGE_SIZE - 1))))
@@ -67,7 +65,7 @@
 	int rx_dma_intr;
 	volatile struct dbdma_cmd *tx_cmds;	/* xmit dma command list */
 	volatile struct dbdma_cmd *rx_cmds;	/* recv dma command list */
-	struct device_node *node;
+	struct macio_dev *mdev;
 	int is_bmac_plus;
 	struct sk_buff *rx_bufs[N_RX_RING];
 	int rx_fill;
@@ -84,9 +82,10 @@
 	unsigned short hash_use_count[64];
 	unsigned short hash_table_mask[4];
 	spinlock_t lock;
-	struct net_device *next_bmac;
 };
 
+#if 0 /* Move that to ethtool */
+
 typedef struct bmac_reg_entry {
 	char *name;
 	unsigned short reg_offset;
@@ -128,16 +127,10 @@
 	{"RXCV", RXCV}
 };
 
-static struct net_device *bmac_devs;
-static unsigned char *bmac_emergency_rxbuf;
-
-#ifdef CONFIG_PMAC_PBOOK
-static int bmac_sleep_notify(struct pmu_sleep_notifier *self, int when);
-static struct pmu_sleep_notifier bmac_sleep_notifier = {
-	bmac_sleep_notify, SLEEP_LEVEL_NET,
-};
 #endif
 
+static unsigned char *bmac_emergency_rxbuf;
+
 /*
  * Number of bytes of private data per BMAC: allow enough for
  * the rx and tx dma commands plus a branch dma command each,
@@ -149,7 +142,6 @@
 	+ sizeof(struct sk_buff_head))
 
 static unsigned char bitrev(unsigned char b);
-static void bmac_probe1(struct device_node *bmac, int is_bmac_plus);
 static int bmac_open(struct net_device *dev);
 static int bmac_close(struct net_device *dev);
 static int bmac_transmit_packet(struct sk_buff *skb, struct net_device *dev);
@@ -166,7 +158,6 @@
 static irqreturn_t bmac_rxdma_intr(int irq, void *dev_id, struct pt_regs *regs);
 static void bmac_set_timeout(struct net_device *dev);
 static void bmac_tx_timeout(unsigned long data);
-static int bmac_proc_info ( char *buffer, char **start, off_t offset, int length);
 static int bmac_output(struct sk_buff *skb, struct net_device *dev);
 static void bmac_start(struct net_device *dev);
 
@@ -244,7 +235,7 @@
 	if (td)
 		dbdma_reset(td);
 
-	pmac_call_feature(PMAC_FTR_BMAC_ENABLE, bp->node, 0, 1);
+	pmac_call_feature(PMAC_FTR_BMAC_ENABLE, macio_get_of_node(bp->mdev), 0, 1);
 }
 
 #define MIFDELAY	udelay(10)
@@ -457,87 +448,80 @@
 	}
 }
 
-static void
-bmac_init_chip(struct net_device *dev)
+static void bmac_init_chip(struct net_device *dev)
 {
 	bmac_init_phy(dev);
 	bmac_init_registers(dev);
 }
 
-#ifdef CONFIG_PMAC_PBOOK
-static int
-bmac_sleep_notify(struct pmu_sleep_notifier *self, int when)
+#ifdef CONFIG_PM
+static int bmac_suspend(struct macio_dev *mdev, u32 state)
 {
-	struct bmac_data *bp;
+	struct net_device* dev = macio_get_drvdata(mdev);	
+	struct bmac_data *bp = dev->priv;	
 	unsigned long flags;
 	unsigned short config;
-	struct net_device* dev = bmac_devs;
 	int i;
 	
-	if (bmac_devs == 0)
-		return PBOOK_SLEEP_OK;
-		
-	bp = (struct bmac_data *) dev->priv;
-	
-	switch (when) {
-	case PBOOK_SLEEP_REQUEST:
-		break;
-	case PBOOK_SLEEP_REJECT:
-		break;
-	case PBOOK_SLEEP_NOW:
-		netif_device_detach(dev);
-		/* prolly should wait for dma to finish & turn off the chip */
-		spin_lock_irqsave(&bp->lock, flags);
-		if (bp->timeout_active) {
-			del_timer(&bp->tx_timeout);
-			bp->timeout_active = 0;
-		}
-		disable_irq(dev->irq);
-		disable_irq(bp->tx_dma_intr);
-		disable_irq(bp->rx_dma_intr);
-		bp->sleeping = 1;
-		spin_unlock_irqrestore(&bp->lock, flags);
-		if (bp->opened) {
-			volatile struct dbdma_regs *rd = bp->rx_dma;
-			volatile struct dbdma_regs *td = bp->tx_dma;
+	netif_device_detach(dev);
+	/* prolly should wait for dma to finish & turn off the chip */
+	spin_lock_irqsave(&bp->lock, flags);
+	if (bp->timeout_active) {
+		del_timer(&bp->tx_timeout);
+		bp->timeout_active = 0;
+	}
+	disable_irq(dev->irq);
+	disable_irq(bp->tx_dma_intr);
+	disable_irq(bp->rx_dma_intr);
+	bp->sleeping = 1;
+	spin_unlock_irqrestore(&bp->lock, flags);
+	if (bp->opened) {
+		volatile struct dbdma_regs *rd = bp->rx_dma;
+		volatile struct dbdma_regs *td = bp->tx_dma;
 			
-			config = bmread(dev, RXCFG);
-			bmwrite(dev, RXCFG, (config & ~RxMACEnable));
-			config = bmread(dev, TXCFG);
-			bmwrite(dev, TXCFG, (config & ~TxMACEnable));
-			bmwrite(dev, INTDISABLE, DisableAll); /* disable all intrs */
-			/* disable rx and tx dma */
-			st_le32(&rd->control, DBDMA_CLEAR(RUN|PAUSE|FLUSH|WAKE));	/* clear run bit */
-			st_le32(&td->control, DBDMA_CLEAR(RUN|PAUSE|FLUSH|WAKE));	/* clear run bit */
-			/* free some skb's */
-			for (i=0; i<N_RX_RING; i++) {
-				if (bp->rx_bufs[i] != NULL) {
-					dev_kfree_skb(bp->rx_bufs[i]);
-					bp->rx_bufs[i] = NULL;
-				}
-			}
-			for (i = 0; i<N_TX_RING; i++) {
-				if (bp->tx_bufs[i] != NULL) {
-					dev_kfree_skb(bp->tx_bufs[i]);
-					bp->tx_bufs[i] = NULL;
-				}
-			}
+		config = bmread(dev, RXCFG);
+		bmwrite(dev, RXCFG, (config & ~RxMACEnable));
+		config = bmread(dev, TXCFG);
+       		bmwrite(dev, TXCFG, (config & ~TxMACEnable));
+		bmwrite(dev, INTDISABLE, DisableAll); /* disable all intrs */
+       		/* disable rx and tx dma */
+       		st_le32(&rd->control, DBDMA_CLEAR(RUN|PAUSE|FLUSH|WAKE));	/* clear run bit */
+       		st_le32(&td->control, DBDMA_CLEAR(RUN|PAUSE|FLUSH|WAKE));	/* clear run bit */
+       		/* free some skb's */
+       		for (i=0; i<N_RX_RING; i++) {
+       			if (bp->rx_bufs[i] != NULL) {
+       				dev_kfree_skb(bp->rx_bufs[i]);
+       				bp->rx_bufs[i] = NULL;
+       			}
+       		}
+       		for (i = 0; i<N_TX_RING; i++) {
+			if (bp->tx_bufs[i] != NULL) {
+		       		dev_kfree_skb(bp->tx_bufs[i]);
+	       			bp->tx_bufs[i] = NULL;
+		       	}
 		}
-		pmac_call_feature(PMAC_FTR_BMAC_ENABLE, bp->node, 0, 0);
-		break;
-	case PBOOK_WAKE:
-		/* see if this is enough */
-		if (bp->opened)
-			bmac_reset_and_enable(dev);
-		enable_irq(dev->irq);
-		enable_irq(bp->tx_dma_intr);
-		enable_irq(bp->rx_dma_intr);
-		netif_device_attach(dev);
-		break;
 	}
-	return PBOOK_SLEEP_OK;
+       	pmac_call_feature(PMAC_FTR_BMAC_ENABLE, macio_get_of_node(bp->mdev), 0, 0);
+	return 0;
 }
-#endif
+
+static int bmac_resume(struct macio_dev *mdev)
+{
+	struct net_device* dev = macio_get_drvdata(mdev);	
+	struct bmac_data *bp = dev->priv;	
+
+	/* see if this is enough */
+	if (bp->opened)
+		bmac_reset_and_enable(dev);
+
+	enable_irq(dev->irq);
+       	enable_irq(bp->tx_dma_intr);
+       	enable_irq(bp->rx_dma_intr);
+       	netif_device_attach(dev);
+
+	return 0;
+}
+#endif /* CONFIG_PM */
 
 static int bmac_set_address(struct net_device *dev, void *addr)
 {
@@ -1277,103 +1261,61 @@
 	spin_unlock_irqrestore(&bp->lock, flags);
 }
 
-static int __init bmac_probe(void)
-{
-	struct device_node *bmac;
-
-	MOD_INC_USE_COUNT;
-
-	for (bmac = find_devices("bmac"); bmac != 0; bmac = bmac->next)
-		bmac_probe1(bmac, 0);
-	for (bmac = find_compatible_devices("network", "bmac+"); bmac != 0;
-	     bmac = bmac->next)
-		bmac_probe1(bmac, 1);
-
-	if (bmac_devs != 0) {
-		proc_net_create ("bmac", 0, bmac_proc_info);
-#ifdef CONFIG_PMAC_PBOOK
-		pmu_register_sleep_notifier(&bmac_sleep_notifier);
-#endif
-	}
-
-	MOD_DEC_USE_COUNT;
-
-	return bmac_devs? 0: -ENODEV;
-}
-
-static void __init bmac_probe1(struct device_node *bmac, int is_bmac_plus)
+static int __devinit bmac_probe(struct macio_dev *mdev, const struct of_match *match)
 {
 	int j, rev, ret;
 	struct bmac_data *bp;
 	unsigned char *addr;
 	struct net_device *dev;
+	int is_bmac_plus = ((int)match->data) != 0;
 
-	if (bmac->n_addrs != 3 || bmac->n_intrs != 3) {
-		printk(KERN_ERR "can't use BMAC %s: need 3 addrs and 3 intrs\n",
-		       bmac->full_name);
-		return;
+	if (macio_resource_count(mdev) != 3 || macio_irq_count(mdev) != 3) {
+		printk(KERN_ERR "BMAC: can't use, need 3 addrs and 3 intrs\n");
+		return -ENODEV;
 	}
-	addr = get_property(bmac, "mac-address", NULL);
+	addr = get_property(macio_get_of_node(mdev), "mac-address", NULL);
 	if (addr == NULL) {
-		addr = get_property(bmac, "local-mac-address", NULL);
+		addr = get_property(macio_get_of_node(mdev), "local-mac-address", NULL);
 		if (addr == NULL) {
-			printk(KERN_ERR "Can't get mac-address for BMAC %s\n",
-			       bmac->full_name);
-			return;
-		}
-	}
-
-	if (bmac_emergency_rxbuf == NULL) {
-		bmac_emergency_rxbuf = kmalloc(RX_BUFLEN, GFP_KERNEL);
-		if (bmac_emergency_rxbuf == NULL) {
-			printk(KERN_ERR "BMAC: can't allocate emergency RX buffer\n");
-			return;
+			printk(KERN_ERR "BMAC: Can't get mac-address\n");
+			return -ENODEV;
 		}
 	}
 
 	dev = alloc_etherdev(PRIV_BYTES);
 	if (!dev) {
-		printk(KERN_ERR "alloc_etherdev failed, out of memory for BMAC %s\n",
-		       bmac->full_name);
-		return;
+		printk(KERN_ERR "BMAC: alloc_etherdev failed, out of memory\n");
+		return -ENOMEM;
 	}
 		
 	bp = (struct bmac_data *) dev->priv;
 	SET_MODULE_OWNER(dev);
-	bp->node = bmac;
+	SET_NETDEV_DEV(dev, &mdev->ofdev.dev);
+	macio_set_drvdata(mdev, dev);
+
+	bp->mdev = mdev;
 	spin_lock_init(&bp->lock);
 
-	if (!request_OF_resource(bmac, 0, " (bmac)")) {
+	if (macio_request_resources(mdev, "bmac")) {
 		printk(KERN_ERR "BMAC: can't request IO resource !\n");
-		goto out1;
-	}
-	if (!request_OF_resource(bmac, 1, " (bmac tx dma)")) {
-		printk(KERN_ERR "BMAC: can't request TX DMA resource !\n");
-		goto out2;
-	}
-	if (!request_OF_resource(bmac, 2, " (bmac rx dma)")) {
-		printk(KERN_ERR "BMAC: can't request RX DMA resource !\n");
-		goto out3;
+		goto out_free;
 	}
 
 	dev->base_addr = (unsigned long)
-		ioremap(bmac->addrs[0].address, bmac->addrs[0].size);
-	if (!dev->base_addr)
-		goto out4;
+		ioremap(macio_resource_start(mdev, 0), macio_resource_len(mdev, 0));
+	if (dev->base_addr == 0)
+		goto out_release;
 
-	dev->irq = bmac->intrs[0].line;
+	dev->irq = macio_irq(mdev, 0);
 
 	bmac_enable_and_reset_chip(dev);
 	bmwrite(dev, INTDISABLE, DisableAll);
 
-	printk(KERN_INFO "%s: BMAC%s at", dev->name, (is_bmac_plus? "+": ""));
 	rev = addr[0] == 0 && addr[1] == 0xA0;
 	for (j = 0; j < 6; ++j) {
 		dev->dev_addr[j] = rev? bitrev(addr[j]): addr[j];
 		printk("%c%.2x", (j? ':': ' '), dev->dev_addr[j]);
 	}
-	XXDEBUG((", base_addr=%#0lx", dev->base_addr));
-	printk("\n");
 
 	/* Enable chip without interrupts for now */
 	bmac_enable_and_reset_chip(dev);
@@ -1392,15 +1334,15 @@
 
 	bp->is_bmac_plus = is_bmac_plus;
 	bp->tx_dma = (volatile struct dbdma_regs *)
-		ioremap(bmac->addrs[1].address, bmac->addrs[1].size);
+		ioremap(macio_resource_start(mdev, 1), macio_resource_len(mdev, 1));
 	if (!bp->tx_dma)
 		goto err_out_iounmap;
-	bp->tx_dma_intr = bmac->intrs[1].line;
+	bp->tx_dma_intr = macio_irq(mdev, 1);
 	bp->rx_dma = (volatile struct dbdma_regs *)
-		ioremap(bmac->addrs[2].address, bmac->addrs[2].size);
+		ioremap(macio_resource_start(mdev, 2), macio_resource_len(mdev, 2));
 	if (!bp->rx_dma)
 		goto err_out_iounmap_tx;
-	bp->rx_dma_intr = bmac->intrs[2].line;
+	bp->rx_dma_intr = macio_irq(mdev, 2);
 
 	bp->tx_cmds = (volatile struct dbdma_cmd *) DBDMA_ALIGN(bp + 1);
 	bp->rx_cmds = bp->tx_cmds + N_TX_RING + 1;
@@ -1415,14 +1357,14 @@
 		printk(KERN_ERR "BMAC: can't get irq %d\n", dev->irq);
 		goto err_out_iounmap_rx;
 	}
-	ret = request_irq(bmac->intrs[1].line, bmac_txdma_intr, 0, "BMAC-txdma", dev);
+	ret = request_irq(bp->tx_dma_intr, bmac_txdma_intr, 0, "BMAC-txdma", dev);
 	if (ret) {
-		printk(KERN_ERR "BMAC: can't get irq %d\n", bmac->intrs[1].line);
+		printk(KERN_ERR "BMAC: can't get irq %d\n", bp->tx_dma_intr);
 		goto err_out_irq0;
 	}
-	ret = request_irq(bmac->intrs[2].line, bmac_rxdma_intr, 0, "BMAC-rxdma", dev);
+	ret = request_irq(bp->rx_dma_intr, bmac_rxdma_intr, 0, "BMAC-rxdma", dev);
 	if (ret) {
-		printk(KERN_ERR "BMAC: can't get irq %d\n", bmac->intrs[2].line);
+		printk(KERN_ERR "BMAC: can't get irq %d\n", bp->rx_dma_intr);
 		goto err_out_irq1;
 	}
 
@@ -1430,22 +1372,23 @@
 	 * re-enabled on open()
 	 */
 	disable_irq(dev->irq);
-	pmac_call_feature(PMAC_FTR_BMAC_ENABLE, bp->node, 0, 0);
+	pmac_call_feature(PMAC_FTR_BMAC_ENABLE, macio_get_of_node(bp->mdev), 0, 0);
 
 	if (register_netdev(dev) != 0) {
-		printk(KERN_ERR "registration failed for BMAC %s\n",
-		       bmac->full_name);
+		printk(KERN_ERR "BMAC: Ethernet registration failed\n");
 		goto err_out_irq2;
 	}
+
+	printk(KERN_INFO "%s: BMAC%s at", dev->name, (is_bmac_plus? "+": ""));
+	XXDEBUG((", base_addr=%#0lx", dev->base_addr));
+	printk("\n");
 	
-	bp->next_bmac = bmac_devs;
-	bmac_devs = dev;
-	return;
+	return 0;
 
 err_out_irq2:
-	free_irq(bmac->intrs[2].line, dev);
+	free_irq(bp->rx_dma_intr, dev);
 err_out_irq1:
-	free_irq(bmac->intrs[1].line, dev);
+	free_irq(bp->tx_dma_intr, dev);
 err_out_irq0:
 	free_irq(dev->irq, dev);
 err_out_iounmap_rx:
@@ -1454,15 +1397,13 @@
 	iounmap((void *)bp->tx_dma);
 err_out_iounmap:
 	iounmap((void *)dev->base_addr);
-out4:
-	release_OF_resource(bp->node, 2);
-out3:
-	release_OF_resource(bp->node, 1);
-out2:
-	release_OF_resource(bp->node, 0);
-out1:
-	pmac_call_feature(PMAC_FTR_BMAC_ENABLE, bp->node, 0, 0);
+out_release:
+	macio_release_resources(mdev);
+out_free:
+	pmac_call_feature(PMAC_FTR_BMAC_ENABLE, macio_get_of_node(bp->mdev), 0, 0);
 	free_netdev(dev);
+
+	return -ENODEV;
 }
 
 static int bmac_open(struct net_device *dev)
@@ -1520,7 +1461,7 @@
 
 	bp->opened = 0;
 	disable_irq(dev->irq);
-	pmac_call_feature(PMAC_FTR_BMAC_ENABLE, bp->node, 0, 0);
+	pmac_call_feature(PMAC_FTR_BMAC_ENABLE, macio_get_of_node(bp->mdev), 0, 0);
 
 	return 0;
 }
@@ -1649,6 +1590,7 @@
 }
 #endif
 
+#if 0
 static int
 bmac_proc_info(char *buffer, char **start, off_t offset, int length)
 {
@@ -1683,46 +1625,86 @@
 
 	return len;
 }
+#endif
 
+static int __devexit bmac_remove(struct macio_dev *mdev)
+{
+	struct net_device *dev = macio_get_drvdata(mdev);
+	struct bmac_data *bp = dev->priv;
 
-MODULE_AUTHOR("Randy Gobbel/Paul Mackerras");
-MODULE_DESCRIPTION("PowerMac BMAC ethernet driver.");
-MODULE_LICENSE("GPL");
+	unregister_netdev(dev);
 
-static void __exit bmac_cleanup (void)
-{
-	struct bmac_data *bp;
-	struct net_device *dev;
+       	free_irq(dev->irq, dev);
+	free_irq(bp->tx_dma_intr, dev);	
+	free_irq(bp->rx_dma_intr, dev);
 
-	if (bmac_emergency_rxbuf != NULL) {
-		kfree(bmac_emergency_rxbuf);
-		bmac_emergency_rxbuf = NULL;
-	}
+	iounmap((void *)dev->base_addr);
+	iounmap((void *)bp->tx_dma);
+	iounmap((void *)bp->rx_dma);
 
-	if (bmac_devs == 0)
-		return;
-#ifdef CONFIG_PMAC_PBOOK
-	pmu_unregister_sleep_notifier(&bmac_sleep_notifier);
+	macio_release_resources(mdev);
+
+	free_netdev(dev);
+
+	return 0;
+}
+
+static struct of_match bmac_match[] = 
+{
+	{
+	.name 		= "bmac",
+	.type		= OF_ANY_MATCH,
+	.compatible	= OF_ANY_MATCH,
+	.data		= (void *)0,
+	},
+	{
+	.name 		= OF_ANY_MATCH,
+	.type		= "network",
+	.compatible	= "bmac+",
+	.data		= (void *)1,
+	},
+	{},
+};
+
+static struct macio_driver bmac_driver = 
+{
+	.name 		= "bmac",
+	.match_table	= bmac_match,
+	.probe		= bmac_probe,
+	.remove		= bmac_remove,
+#ifdef CONFIG_PM
+	.suspend	= bmac_suspend,
+	.resume		= bmac_resume,
 #endif
-	proc_net_remove("bmac");
+};
 
-	do {
-		dev = bmac_devs;
-		bp = (struct bmac_data *) dev->priv;
-		bmac_devs = bp->next_bmac;
 
-		unregister_netdev(dev);
+static int __init bmac_init(void)
+{
+	if (bmac_emergency_rxbuf == NULL) {
+		bmac_emergency_rxbuf = kmalloc(RX_BUFLEN, GFP_KERNEL);
+		if (bmac_emergency_rxbuf == NULL) {
+			printk(KERN_ERR "BMAC: can't allocate emergency RX buffer\n");
+			return -ENOMEM;
+		}
+	}
 
-		release_OF_resource(bp->node, 0);
-		release_OF_resource(bp->node, 1);
-		release_OF_resource(bp->node, 2);
-		free_irq(dev->irq, dev);
-		free_irq(bp->tx_dma_intr, dev);
-		free_irq(bp->rx_dma_intr, dev);
+	return macio_register_driver(&bmac_driver);
+}
 
-		free_netdev(dev);
-	} while (bmac_devs != NULL);
+static void __exit bmac_exit(void)
+{
+	macio_unregister_driver(&bmac_driver);
+
+	if (bmac_emergency_rxbuf != NULL) {
+		kfree(bmac_emergency_rxbuf);
+		bmac_emergency_rxbuf = NULL;
+	}
 }
 
-module_init(bmac_probe);
-module_exit(bmac_cleanup);
+MODULE_AUTHOR("Randy Gobbel/Paul Mackerras");
+MODULE_DESCRIPTION("PowerMac BMAC ethernet driver.");
+MODULE_LICENSE("GPL");
+
+module_init(bmac_init);
+module_exit(bmac_exit);
--- diff/drivers/net/bonding/bond_3ad.c	2003-09-30 15:46:15.000000000 +0100
+++ source/drivers/net/bonding/bond_3ad.c	2004-02-09 10:39:53.000000000 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright(c) 1999 - 2003 Intel Corporation. All rights reserved.
+ * Copyright(c) 1999 - 2004 Intel Corporation. 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
@@ -47,8 +47,13 @@
  *	- Send LACPDU as highest priority packet to further fix the above
  *	  problem on very high Tx traffic load where packets may get dropped
  *	  by the slave.
+ *
+ * 2003/12/01 - Shmulik Hen <shmulik.hen at intel dot com>
+ *	- Code cleanup and style changes
  */
 
+//#define BONDING_DEBUG 1
+
 #include <linux/skbuff.h>
 #include <linux/if_ether.h>
 #include <linux/netdevice.h>
@@ -119,6 +124,7 @@
 
 static struct mac_addr null_mac_addr = {{0, 0, 0, 0, 0, 0}};
 static u16 ad_ticks_per_sec;
+static const int ad_delta_in_ticks = (AD_TIMER_INTERVAL * HZ) / 1000;
 
 // ================= 3AD api to bonding and kernel code ==================
 static u16 __get_link_speed(struct port *port);
@@ -196,13 +202,11 @@
  */
 static inline struct port *__get_first_port(struct bonding *bond)
 {
-	struct slave *slave = bond->next;
-
-	if (slave == (struct slave *)bond) {
+	if (bond->slave_cnt == 0) {
 		return NULL;
 	}
 
-	return &(SLAVE_AD_INFO(slave).port);
+	return &(SLAVE_AD_INFO(bond->first_slave).port);
 }
 
 /**
@@ -218,7 +222,7 @@
 	struct slave *slave = port->slave;
 
 	// If there's no bond for this port, or this is the last slave
-	if ((bond == NULL) || (slave->next == bond->next)) {
+	if ((bond == NULL) || (slave->next == bond->first_slave)) {
 		return NULL;
 	}
 
@@ -236,12 +240,12 @@
 {
 	struct bonding *bond = __get_bond_by_port(port);
 
-	// If there's no bond for this port, or this is the last slave
-	if ((bond == NULL) || (bond->next == (struct slave *)bond)) {
+	// If there's no bond for this port, or bond has no slaves
+	if ((bond == NULL) || (bond->slave_cnt == 0)) {
 		return NULL;
 	}
 
-	return &(SLAVE_AD_INFO(bond->next).aggregator);
+	return &(SLAVE_AD_INFO(bond->first_slave).aggregator);
 }
 
 /**
@@ -257,7 +261,7 @@
 	struct bonding *bond = bond_get_bond_by_slave(slave);
 
 	// If there's no bond for this aggregator, or this is the last slave
-	if ((bond == NULL) || (slave->next == bond->next)) {
+	if ((bond == NULL) || (slave->next == bond->first_slave)) {
 		return NULL;
 	}
 
@@ -392,7 +396,7 @@
 		}
 	}
 
-	BOND_PRINT_DBG(("Port %d Received link speed %d update from adapter", port->actor_port_number, speed));
+	dprintk("Port %d Received link speed %d update from adapter\n", port->actor_port_number, speed);
 	return speed;
 }
 
@@ -418,12 +422,12 @@
 		switch (slave->duplex) {
 		case DUPLEX_FULL:
 			retval=0x1;
-			BOND_PRINT_DBG(("Port %d Received status full duplex update from adapter", port->actor_port_number));
+			dprintk("Port %d Received status full duplex update from adapter\n", port->actor_port_number);
 			break;
 		case DUPLEX_HALF:
 		default:
 			retval=0x0;
-			BOND_PRINT_DBG(("Port %d Received status NOT full duplex update from adapter", port->actor_port_number));
+			dprintk("Port %d Received status NOT full duplex update from adapter\n", port->actor_port_number);
 			break;
 		}
 	}
@@ -1059,7 +1063,7 @@
 
 	// check if the state machine was changed
 	if (port->sm_mux_state != last_state) {
-		BOND_PRINT_DBG(("Mux Machine: Port=%d, Last State=%d, Curr State=%d", port->actor_port_number, last_state, port->sm_mux_state));
+		dprintk("Mux Machine: Port=%d, Last State=%d, Curr State=%d\n", port->actor_port_number, last_state, port->sm_mux_state);
 		switch (port->sm_mux_state) {
 		case AD_MUX_DETACHED:
 			__detach_bond_from_agg(port);
@@ -1158,7 +1162,7 @@
 
 	// check if the State machine was changed or new lacpdu arrived
 	if ((port->sm_rx_state != last_state) || (lacpdu)) {
-		BOND_PRINT_DBG(("Rx Machine: Port=%d, Last State=%d, Curr State=%d", port->actor_port_number, last_state, port->sm_rx_state));
+		dprintk("Rx Machine: Port=%d, Last State=%d, Curr State=%d\n", port->actor_port_number, last_state, port->sm_rx_state);
 		switch (port->sm_rx_state) {
 		case AD_RX_INITIALIZE:
 			if (!(port->actor_oper_port_key & AD_DUPLEX_KEY_BITS)) {
@@ -1204,7 +1208,7 @@
 			// detect loopback situation
 			if (!MAC_ADDRESS_COMPARE(&(lacpdu->actor_system), &(port->actor_system))) {
 				// INFO_RECEIVED_LOOPBACK_FRAMES
-				printk(KERN_ERR "bonding: An illegal loopback occurred on adapter (%s)\n",
+				printk(KERN_ERR DRV_NAME ": An illegal loopback occurred on adapter (%s)\n",
 						port->slave->dev->name);
 				printk(KERN_ERR "Check the configuration to verify that all Adapters "
 						"are connected to 802.3ad compliant switch ports\n");
@@ -1245,7 +1249,7 @@
 			__update_lacpdu_from_port(port);
 			// send the lacpdu
 			if (ad_lacpdu_send(port) >= 0) {
-				BOND_PRINT_DBG(("Sent LACPDU on port %d", port->actor_port_number));
+				dprintk("Sent LACPDU on port %d\n", port->actor_port_number);
 				// mark ntt as false, so it will not be sent again until demanded
 				port->ntt = 0;
 			}
@@ -1318,7 +1322,7 @@
 
 	// check if the state machine was changed
 	if (port->sm_periodic_state != last_state) {
-		BOND_PRINT_DBG(("Periodic Machine: Port=%d, Last State=%d, Curr State=%d", port->actor_port_number, last_state, port->sm_periodic_state));
+		dprintk("Periodic Machine: Port=%d, Last State=%d, Curr State=%d\n", port->actor_port_number, last_state, port->sm_periodic_state);
 		switch (port->sm_periodic_state) {
 		case AD_NO_PERIODIC:
 			port->sm_periodic_timer_counter = 0;	   // zero timer
@@ -1375,7 +1379,7 @@
 				port->next_port_in_aggregator=NULL;
 				port->actor_port_aggregator_identifier=0;
 
-				BOND_PRINT_DBG(("Port %d left LAG %d", port->actor_port_number, temp_aggregator->aggregator_identifier));
+				dprintk("Port %d left LAG %d\n", port->actor_port_number, temp_aggregator->aggregator_identifier);
 				// if the aggregator is empty, clear its parameters, and set it ready to be attached
 				if (!temp_aggregator->lag_ports) {
 					ad_clear_agg(temp_aggregator);
@@ -1384,7 +1388,7 @@
 			}
 		}
 		if (!curr_port) { // meaning: the port was related to an aggregator but was not on the aggregator port list
-			printk(KERN_WARNING "bonding: Warning: Port %d (on %s) was "
+			printk(KERN_WARNING DRV_NAME ": Warning: Port %d (on %s) was "
 			       "related to aggregator %d but was not on its port list\n",
 			       port->actor_port_number, port->slave->dev->name,
 			       port->aggregator->aggregator_identifier);
@@ -1417,7 +1421,7 @@
 			port->next_port_in_aggregator=aggregator->lag_ports;
 			port->aggregator->num_of_ports++;
 			aggregator->lag_ports=port;
-			BOND_PRINT_DBG(("Port %d joined LAG %d(existing LAG)", port->actor_port_number, port->aggregator->aggregator_identifier));
+			dprintk("Port %d joined LAG %d(existing LAG)\n", port->actor_port_number, port->aggregator->aggregator_identifier);
 
 			// mark this port as selected
 			port->sm_vars |= AD_PORT_SELECTED;
@@ -1454,9 +1458,9 @@
 			// mark this port as selected
 			port->sm_vars |= AD_PORT_SELECTED;
 
-			BOND_PRINT_DBG(("Port %d joined LAG %d(new LAG)", port->actor_port_number, port->aggregator->aggregator_identifier));
+			dprintk("Port %d joined LAG %d(new LAG)\n", port->actor_port_number, port->aggregator->aggregator_identifier);
 		} else {
-			printk(KERN_ERR "bonding: Port %d (on %s) did not find a suitable aggregator\n",
+			printk(KERN_ERR DRV_NAME ": Port %d (on %s) did not find a suitable aggregator\n",
 			       port->actor_port_number, port->slave->dev->name);
 		}
 	}
@@ -1580,30 +1584,30 @@
 		    aggregator;
 		    aggregator = __get_next_agg(aggregator)) {
 
-			BOND_PRINT_DBG(("Agg=%d; Ports=%d; a key=%d; p key=%d; Indiv=%d; Active=%d",
+			dprintk("Agg=%d; Ports=%d; a key=%d; p key=%d; Indiv=%d; Active=%d\n",
 					aggregator->aggregator_identifier, aggregator->num_of_ports,
 					aggregator->actor_oper_aggregator_key, aggregator->partner_oper_aggregator_key,
-					aggregator->is_individual, aggregator->is_active));
+					aggregator->is_individual, aggregator->is_active);
 		}
 
 		// check if any partner replys
 		if (best_aggregator->is_individual) {
-			printk(KERN_WARNING "bonding: Warning: No 802.3ad response from the link partner "
+			printk(KERN_WARNING DRV_NAME ": Warning: No 802.3ad response from the link partner "
 					"for any adapters in the bond\n");
 		}
 
 		// check if there are more than one aggregator
 		if (num_of_aggs > 1) {
-			BOND_PRINT_DBG(("Warning: More than one Link Aggregation Group was "
-					"found in the bond. Only one group will function in the bond"));
+			dprintk("Warning: More than one Link Aggregation Group was "
+				"found in the bond. Only one group will function in the bond\n");
 		}
 
 		best_aggregator->is_active = 1;
-		BOND_PRINT_DBG(("LAG %d choosed as the active LAG", best_aggregator->aggregator_identifier));
-		BOND_PRINT_DBG(("Agg=%d; Ports=%d; a key=%d; p key=%d; Indiv=%d; Active=%d",
+		dprintk("LAG %d choosed as the active LAG\n", best_aggregator->aggregator_identifier);
+		dprintk("Agg=%d; Ports=%d; a key=%d; p key=%d; Indiv=%d; Active=%d\n",
 				best_aggregator->aggregator_identifier, best_aggregator->num_of_ports,
 				best_aggregator->actor_oper_aggregator_key, best_aggregator->partner_oper_aggregator_key,
-				best_aggregator->is_individual, best_aggregator->is_active));
+				best_aggregator->is_individual, best_aggregator->is_active);
 
 		// disable the ports that were related to the former active_aggregator
 		if (last_active_aggregator) {
@@ -1644,7 +1648,7 @@
 		aggregator->lag_ports = NULL;
 		aggregator->is_active = 0;
 		aggregator->num_of_ports = 0;
-		BOND_PRINT_DBG(("LAG %d was cleared", aggregator->aggregator_identifier));
+		dprintk("LAG %d was cleared\n", aggregator->aggregator_identifier);
 	}
 }
 
@@ -1729,7 +1733,7 @@
 static void ad_enable_collecting_distributing(struct port *port)
 {
 	if (port->aggregator->is_active) {
-		BOND_PRINT_DBG(("Enabling port %d(LAG %d)", port->actor_port_number, port->aggregator->aggregator_identifier));
+		dprintk("Enabling port %d(LAG %d)\n", port->actor_port_number, port->aggregator->aggregator_identifier);
 		__enable_port(port);
 	}
 }
@@ -1742,7 +1746,7 @@
 static void ad_disable_collecting_distributing(struct port *port)
 {
 	if (port->aggregator && MAC_ADDRESS_COMPARE(&(port->aggregator->partner_system), &(null_mac_addr))) {
-		BOND_PRINT_DBG(("Disabling port %d(LAG %d)", port->actor_port_number, port->aggregator->aggregator_identifier));
+		dprintk("Disabling port %d(LAG %d)\n", port->actor_port_number, port->aggregator->aggregator_identifier);
 		__disable_port(port);
 	}
 }
@@ -1780,7 +1784,7 @@
 
 	// send the marker information
 	if (ad_marker_send(port, &marker) >= 0) {
-		BOND_PRINT_DBG(("Sent Marker Information on port %d", port->actor_port_number));
+		dprintk("Sent Marker Information on port %d\n", port->actor_port_number);
 	}
 }
 #endif
@@ -1803,7 +1807,7 @@
 	// send the marker response
 
 	if (ad_marker_send(port, &marker) >= 0) {
-		BOND_PRINT_DBG(("Sent Marker Response on port %d", port->actor_port_number));
+		dprintk("Sent Marker Response on port %d\n", port->actor_port_number);
 	}
 }
 
@@ -1890,13 +1894,13 @@
 void bond_3ad_initialize(struct bonding *bond, u16 tick_resolution, int lacp_fast)
 {                         
 	// check that the bond is not initialized yet
-	if (MAC_ADDRESS_COMPARE(&(BOND_AD_INFO(bond).system.sys_mac_addr), &(bond->device->dev_addr))) {
+	if (MAC_ADDRESS_COMPARE(&(BOND_AD_INFO(bond).system.sys_mac_addr), &(bond->dev->dev_addr))) {
 
 		aggregator_identifier = 0;
 
 		BOND_AD_INFO(bond).lacp_fast = lacp_fast;
 		BOND_AD_INFO(bond).system.sys_priority = 0xFFFF;
-		BOND_AD_INFO(bond).system.sys_mac_addr = *((struct mac_addr *)bond->device->dev_addr);
+		BOND_AD_INFO(bond).system.sys_mac_addr = *((struct mac_addr *)bond->dev->dev_addr);
 
 		// initialize how many times this module is called in one second(should be about every 100ms)
 		ad_ticks_per_sec = tick_resolution;
@@ -1921,7 +1925,7 @@
 	struct aggregator *aggregator;
 
 	if (bond == NULL) {
-		printk(KERN_CRIT "The slave %s is not attached to its bond\n", slave->dev->name);
+		printk(KERN_ERR "The slave %s is not attached to its bond\n", slave->dev->name);
 		return -1;
 	}
 
@@ -1964,7 +1968,7 @@
 
 		ad_initialize_agg(aggregator);
 
-		aggregator->aggregator_mac_address = *((struct mac_addr *)bond->device->dev_addr);
+		aggregator->aggregator_mac_address = *((struct mac_addr *)bond->dev->dev_addr);
 		aggregator->aggregator_identifier = (++aggregator_identifier);
 		aggregator->slave = slave;
 		aggregator->is_active = 0;
@@ -1996,11 +2000,11 @@
 
 	// if slave is null, the whole port is not initialized
 	if (!port->slave) {
-		printk(KERN_WARNING "bonding: Trying to unbind an uninitialized port on %s\n", slave->dev->name);
+		printk(KERN_WARNING DRV_NAME ": Trying to unbind an uninitialized port on %s\n", slave->dev->name);
 		return;
 	}
 
-	BOND_PRINT_DBG(("Unbinding Link Aggregation Group %d", aggregator->aggregator_identifier));
+	dprintk("Unbinding Link Aggregation Group %d\n", aggregator->aggregator_identifier);
 
 	/* Tell the partner that this port is not suitable for aggregation */
 	port->actor_oper_port_state &= ~AD_STATE_AGGREGATION;
@@ -2024,10 +2028,10 @@
 			// if new aggregator found, copy the aggregator's parameters
 			// and connect the related lag_ports to the new aggregator
 			if ((new_aggregator) && ((!new_aggregator->lag_ports) || ((new_aggregator->lag_ports == port) && !new_aggregator->lag_ports->next_port_in_aggregator))) {
-				BOND_PRINT_DBG(("Some port(s) related to LAG %d - replaceing with LAG %d", aggregator->aggregator_identifier, new_aggregator->aggregator_identifier));
+				dprintk("Some port(s) related to LAG %d - replaceing with LAG %d\n", aggregator->aggregator_identifier, new_aggregator->aggregator_identifier);
 
 				if ((new_aggregator->lag_ports == port) && new_aggregator->is_active) {
-					printk(KERN_INFO "bonding: Removing an active aggregator\n");
+					printk(KERN_INFO DRV_NAME ": Removing an active aggregator\n");
 					// select new active aggregator
 					 select_new_active_agg = 1;
 				}
@@ -2057,7 +2061,7 @@
 					ad_agg_selection_logic(__get_first_agg(port));
 				}
 			} else {
-				printk(KERN_WARNING "bonding: Warning: unbinding aggregator, "
+				printk(KERN_WARNING DRV_NAME ": Warning: unbinding aggregator, "
 				       "and could not find a new aggregator for its ports\n");
 			}
 		} else { // in case that the only port related to this aggregator is the one we want to remove
@@ -2072,7 +2076,7 @@
 		}
 	}
 
-	BOND_PRINT_DBG(("Unbinding port %d", port->actor_port_number));
+	dprintk("Unbinding port %d\n", port->actor_port_number);
 	// find the aggregator that this port is connected to
 	temp_aggregator = __get_first_agg(port);
 	for (; temp_aggregator; temp_aggregator = __get_next_agg(temp_aggregator)) {
@@ -2123,13 +2127,13 @@
 
 	read_lock(&bond->lock);
 
-	//check if there are any slaves
-	if (bond->next == (struct slave *)bond) {
-		goto end;
+	if (bond->kill_timers) {
+		goto out;
 	}
 
-	if ((bond->device->flags & IFF_UP) != IFF_UP) {
-		goto end;
+	//check if there are any slaves
+	if (bond->slave_cnt == 0) {
+		goto re_arm;
 	}
 
 	// check if agg_select_timer timer after initialize is timed out
@@ -2137,8 +2141,8 @@
 		// select the active aggregator for the bond
 		if ((port = __get_first_port(bond))) {
 			if (!port->slave) {
-				printk(KERN_WARNING "bonding: Warning: bond's first port is uninitialized\n");
-				goto end;
+				printk(KERN_WARNING DRV_NAME ": Warning: bond's first port is uninitialized\n");
+				goto re_arm;
 			}
 
 			aggregator = __get_first_agg(port);
@@ -2149,8 +2153,8 @@
 	// for each port run the state machines
 	for (port = __get_first_port(bond); port; port = __get_next_port(port)) {
 		if (!port->slave) {
-			printk(KERN_WARNING "bonding: Warning: Found an uninitialized port\n");
-			goto end;
+			printk(KERN_WARNING DRV_NAME ": Warning: Found an uninitialized port\n");
+			goto re_arm;
 		}
 
 		ad_rx_machine(NULL, port);
@@ -2165,14 +2169,10 @@
 		}
 	}
 
-end:
+re_arm:
+	mod_timer(&(BOND_AD_INFO(bond).ad_timer), jiffies + ad_delta_in_ticks);
+out:
 	read_unlock(&bond->lock);
-
-
-	if ((bond->device->flags & IFF_UP) == IFF_UP) {
-		/* re-arm the timer */
-		mod_timer(&(BOND_AD_INFO(bond).ad_timer), jiffies + (AD_TIMER_INTERVAL * HZ / 1000));
-	}
 }
 
 /**
@@ -2194,14 +2194,14 @@
 		port = &(SLAVE_AD_INFO(slave).port);
 
 		if (!port->slave) {
-			printk(KERN_WARNING "bonding: Warning: port of slave %s is uninitialized\n", slave->dev->name);
+			printk(KERN_WARNING DRV_NAME ": Warning: port of slave %s is uninitialized\n", slave->dev->name);
 			return;
 		}
 
 		switch (lacpdu->subtype) {
 		case AD_TYPE_LACPDU:
 			__ntohs_lacpdu(lacpdu);
-			BOND_PRINT_DBG(("Received LACPDU on port %d", port->actor_port_number));
+			dprintk("Received LACPDU on port %d\n", port->actor_port_number);
 			ad_rx_machine(lacpdu, port);
 			break;
 
@@ -2210,17 +2210,17 @@
 
 			switch (((struct marker *)lacpdu)->tlv_type) {
 			case AD_MARKER_INFORMATION_SUBTYPE:
-				BOND_PRINT_DBG(("Received Marker Information on port %d", port->actor_port_number));
+				dprintk("Received Marker Information on port %d\n", port->actor_port_number);
 				ad_marker_info_received((struct marker *)lacpdu, port);
 				break;
 
 			case AD_MARKER_RESPONSE_SUBTYPE:
-				BOND_PRINT_DBG(("Received Marker Response on port %d", port->actor_port_number));
+				dprintk("Received Marker Response on port %d\n", port->actor_port_number);
 				ad_marker_response_received((struct marker *)lacpdu, port);
 				break;
 
 			default:
-				BOND_PRINT_DBG(("Received an unknown Marker subtype on slot %d", port->actor_port_number));
+				dprintk("Received an unknown Marker subtype on slot %d\n", port->actor_port_number);
 			}
 		}
 	}
@@ -2240,14 +2240,14 @@
 
 	// if slave is null, the whole port is not initialized
 	if (!port->slave) {
-		printk(KERN_WARNING "bonding: Warning: speed changed for uninitialized port on %s\n",
+		printk(KERN_WARNING DRV_NAME ": Warning: speed changed for uninitialized port on %s\n",
 		       slave->dev->name);
 		return;
 	}
 
 	port->actor_admin_port_key &= ~AD_SPEED_KEY_BITS;
 	port->actor_oper_port_key=port->actor_admin_port_key |= (__get_link_speed(port) << 1);
-	BOND_PRINT_DBG(("Port %d changed speed", port->actor_port_number));
+	dprintk("Port %d changed speed\n", port->actor_port_number);
 	// there is no need to reselect a new aggregator, just signal the
 	// state machines to reinitialize
 	port->sm_vars |= AD_PORT_BEGIN;
@@ -2267,14 +2267,14 @@
 
 	// if slave is null, the whole port is not initialized
 	if (!port->slave) {
-		printk(KERN_WARNING "bonding: Warning: duplex changed for uninitialized port on %s\n",
+		printk(KERN_WARNING DRV_NAME ": Warning: duplex changed for uninitialized port on %s\n",
 		       slave->dev->name);
 		return;
 	}
 
 	port->actor_admin_port_key &= ~AD_DUPLEX_KEY_BITS;
 	port->actor_oper_port_key=port->actor_admin_port_key |= __get_duplex(port);
-	BOND_PRINT_DBG(("Port %d changed duplex", port->actor_port_number));
+	dprintk("Port %d changed duplex\n", port->actor_port_number);
 	// there is no need to reselect a new aggregator, just signal the
 	// state machines to reinitialize
 	port->sm_vars |= AD_PORT_BEGIN;
@@ -2295,10 +2295,8 @@
 
 	// if slave is null, the whole port is not initialized
 	if (!port->slave) {
-#ifdef BONDING_DEBUG
-		printk(KERN_WARNING "bonding: Warning: link status changed for uninitialized port on %s\n",
-		       slave->dev->name);
-#endif
+		printk(KERN_WARNING DRV_NAME ": Warning: link status changed for uninitialized port on %s\n",
+			slave->dev->name);
 		return;
 	}
 
@@ -2356,41 +2354,27 @@
 
 int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev)
 {
-	slave_t *slave, *start_at;
-	struct bonding *bond = (struct bonding *) dev->priv;
+	struct slave *slave, *start_at;
+	struct bonding *bond = dev->priv;
 	struct ethhdr *data = (struct ethhdr *)skb->data;
 	int slave_agg_no;
 	int slaves_in_agg;
 	int agg_id;
+	int i;
 	struct ad_info ad_info;
 
-	if (!IS_UP(dev)) { /* bond down */
-		dev_kfree_skb(skb);
-		return 0;
-	}
-
-	if (bond == NULL) {
-		printk(KERN_CRIT "bonding: Error: bond is NULL on device %s\n", dev->name);
-		dev_kfree_skb(skb);
-		return 0;
-	}
-
+	/* make sure that the slaves list will
+	 * not change during tx
+	 */
 	read_lock(&bond->lock);
-	slave = bond->prev;
 
-	/* check if bond is empty */
-	if ((slave == (struct slave *) bond) || (bond->slave_cnt == 0)) {
-		printk(KERN_DEBUG "ERROR: bond is empty\n");
-		dev_kfree_skb(skb);
-		read_unlock(&bond->lock);
-		return 0;
+	if (!BOND_IS_OK(bond)) {
+		goto free_out;
 	}
 
 	if (bond_3ad_get_active_agg_info(bond, &ad_info)) {
 		printk(KERN_DEBUG "ERROR: bond_3ad_get_active_agg_info failed\n");
-		dev_kfree_skb(skb);
-		read_unlock(&bond->lock);
-		return 0;
+		goto free_out;
 	}
 
 	slaves_in_agg = ad_info.ports;
@@ -2399,21 +2383,12 @@
 	if (slaves_in_agg == 0) {
 		/*the aggregator is empty*/
 		printk(KERN_DEBUG "ERROR: active aggregator is empty\n");
-		dev_kfree_skb(skb);
-		read_unlock(&bond->lock);
-		return 0;
+		goto free_out;
 	}
 
-	/* we're at the root, get the first slave */
-	if ((slave == NULL) || (slave->dev == NULL)) {
-		/* no suitable interface, frame not sent */
-		dev_kfree_skb(skb);
-		read_unlock(&bond->lock);
-		return 0;
-	}
+	slave_agg_no = (data->h_dest[5]^bond->dev->dev_addr[5]) % slaves_in_agg;
 
-	slave_agg_no = (data->h_dest[5]^slave->dev->dev_addr[5]) % slaves_in_agg;
-	while (slave != (slave_t *)bond) {
+	bond_for_each_slave(bond, slave, i) {
 		struct aggregator *agg = SLAVE_AD_INFO(slave).port.aggregator;
 
 		if (agg && (agg->aggregator_identifier == agg_id)) {
@@ -2422,37 +2397,18 @@
 				break;
 			}
 		}
-
-		slave = slave->prev;
-		if (slave == NULL) {
-			printk(KERN_ERR "bonding: Error: slave is NULL\n");
-			dev_kfree_skb(skb);
-			read_unlock(&bond->lock);
-			return 0;
-		}
 	}
 
-	if (slave == (slave_t *)bond) {
-		printk(KERN_ERR "bonding: Error: Couldn't find a slave to tx on for aggregator ID %d\n", agg_id);
-		dev_kfree_skb(skb);
-		read_unlock(&bond->lock);
-		return 0;
+	if (slave_agg_no >= 0) {
+		printk(KERN_ERR DRV_NAME ": Error: Couldn't find a slave to tx on for aggregator ID %d\n", agg_id);
+		goto free_out;
 	}
 
 	start_at = slave;
 
-	do {
+	bond_for_each_slave_from(bond, slave, i, start_at) {
 		int slave_agg_id = 0;
-		struct aggregator *agg;
-
-		if (slave == NULL) {
-			printk(KERN_ERR "bonding: Error: slave is NULL\n");
-			dev_kfree_skb(skb);
-			read_unlock(&bond->lock);
-			return 0;
-		}
-
-		agg = SLAVE_AD_INFO(slave).port.aggregator;
+		struct aggregator *agg = SLAVE_AD_INFO(slave).port.aggregator;
 
 		if (agg) {
 			slave_agg_id = agg->aggregator_identifier;
@@ -2463,20 +2419,24 @@
 			skb->dev = slave->dev;			
 			skb->priority = 1;
 			dev_queue_xmit(skb);
-			read_unlock(&bond->lock);
-			return 0;
+
+			goto out;
 		}
-	} while ((slave = slave->next) != start_at);
+	}
 
-	/* no suitable interface, frame not sent */
-	dev_kfree_skb(skb);
+out:
 	read_unlock(&bond->lock);
 	return 0;
+
+free_out:
+	/* no suitable interface, frame not sent */
+	dev_kfree_skb(skb);
+	goto out;
 }
 
 int bond_3ad_lacpdu_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type* ptype)
 {
-	struct bonding *bond = (struct bonding *)dev->priv;
+	struct bonding *bond = dev->priv;
 	struct slave *slave = NULL;
 	int ret = NET_RX_DROP;
 
--- diff/drivers/net/bonding/bond_3ad.h	2003-09-30 15:46:15.000000000 +0100
+++ source/drivers/net/bonding/bond_3ad.h	2004-02-09 10:39:53.000000000 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright(c) 1999 - 2003 Intel Corporation. All rights reserved.
+ * Copyright(c) 1999 - 2004 Intel Corporation. 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
@@ -28,6 +28,9 @@
  * 2003/05/01 - Shmulik Hen <shmulik.hen at intel dot com>
  *	- Renamed bond_3ad_link_status_changed() to
  *	  bond_3ad_handle_link_change() for compatibility with TLB.
+ *
+ * 2003/12/01 - Shmulik Hen <shmulik.hen at intel dot com>
+ *	- Code cleanup and style changes
  */
 
 #ifndef __BOND_3AD_H__
--- diff/drivers/net/bonding/bond_alb.c	2003-10-09 09:47:34.000000000 +0100
+++ source/drivers/net/bonding/bond_alb.c	2004-02-09 10:39:53.000000000 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright(c) 1999 - 2003 Intel Corporation. All rights reserved.
+ * Copyright(c) 1999 - 2004 Intel Corporation. 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
@@ -28,8 +28,16 @@
  * 2003/08/06 - Amir Noam <amir.noam at intel dot com>
  *	- Add support for setting bond's MAC address with special
  *	  handling required for ALB/TLB.
+ *
+ * 2003/12/01 - Shmulik Hen <shmulik.hen at intel dot com>
+ *	- Code cleanup and style changes
+ *
+ * 2003/12/30 - Amir Noam <amir.noam at intel dot com>
+ *	- Fixed: Cannot remove and re-enslave the original active slave.
  */
 
+//#define BONDING_DEBUG 1
+
 #include <linux/skbuff.h>
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
@@ -50,11 +58,11 @@
 
 
 #define ALB_TIMER_TICKS_PER_SEC	    10	/* should be a divisor of HZ */
-#define BOND_TLB_REBALANCE_INTERVAL 10	/* in seconds, periodic re-balancing
-					 * used for division - never set
+#define BOND_TLB_REBALANCE_INTERVAL 10	/* In seconds, periodic re-balancing.
+					 * Used for division - never set
 					 * to zero !!!
 					 */
-#define BOND_ALB_LP_INTERVAL	    1	/* in seconds periodic send of
+#define BOND_ALB_LP_INTERVAL	    1	/* In seconds, periodic send of
 					 * learning packets to the switch
 					 */
 
@@ -66,7 +74,7 @@
 
 #define TLB_HASH_TABLE_SIZE 256	/* The size of the clients hash table.
 				 * Note that this value MUST NOT be smaller
-				 * because the key hash table BYTE wide !
+				 * because the key hash table is BYTE wide !
 				 */
 
 
@@ -86,12 +94,15 @@
  */
 #define RLB_PROMISC_TIMEOUT	10*ALB_TIMER_TICKS_PER_SEC
 
+static const u8 mac_bcast[ETH_ALEN] = {0xff,0xff,0xff,0xff,0xff,0xff};
+static const int alb_delta_in_ticks = HZ / ALB_TIMER_TICKS_PER_SEC;
+
 #pragma pack(1)
 struct learning_pkt {
 	u8 mac_dst[ETH_ALEN];
 	u8 mac_src[ETH_ALEN];
 	u16 type;
-	u8 padding[ETH_ZLEN - (2*ETH_ALEN + 2)];
+	u8 padding[ETH_ZLEN - ETH_HLEN];
 };
 
 struct arp_pkt {
@@ -110,13 +121,12 @@
 /* Forward declaration */
 static void alb_send_learning_packets(struct slave *slave, u8 mac_addr[]);
 
-static inline u8
-_simple_hash(u8 *hash_start, int hash_size)
+static inline u8 _simple_hash(u8 *hash_start, int hash_size)
 {
 	int i;
 	u8 hash = 0;
 
-	for (i=0; i<hash_size; i++) {
+	for (i = 0; i < hash_size; i++) {
 		hash ^= hash_start[i];
 	}
 
@@ -125,193 +135,151 @@
 
 /*********************** tlb specific functions ***************************/
 
-static inline void
-_lock_tx_hashtbl(struct bonding *bond)
+static inline void _lock_tx_hashtbl(struct bonding *bond)
 {
 	spin_lock(&(BOND_ALB_INFO(bond).tx_hashtbl_lock));
 }
 
-static inline void
-_unlock_tx_hashtbl(struct bonding *bond)
+static inline void _unlock_tx_hashtbl(struct bonding *bond)
 {
 	spin_unlock(&(BOND_ALB_INFO(bond).tx_hashtbl_lock));
 }
 
 /* Caller must hold tx_hashtbl lock */
-static inline void
-tlb_init_table_entry(struct bonding *bond, u8 index, u8 save_load)
+static inline void tlb_init_table_entry(struct tlb_client_info *entry, int save_load)
 {
-	struct tlb_client_info *entry;
-
-	if (BOND_ALB_INFO(bond).tx_hashtbl == NULL) {
-		return;
-	}
-
-	entry = &(BOND_ALB_INFO(bond).tx_hashtbl[index]);
-	/* at end of cycle, save the load that was transmitted to the client
-	 * during the cycle, and set the tx_bytes counter to 0 for counting
-	 * the load during the next cycle
-	 */
 	if (save_load) {
 		entry->load_history = 1 + entry->tx_bytes /
-			BOND_TLB_REBALANCE_INTERVAL;
+				      BOND_TLB_REBALANCE_INTERVAL;
 		entry->tx_bytes = 0;
 	}
+
 	entry->tx_slave = NULL;
 	entry->next = TLB_NULL_INDEX;
 	entry->prev = TLB_NULL_INDEX;
 }
 
-static inline void
-tlb_init_slave(struct slave *slave)
+static inline void tlb_init_slave(struct slave *slave)
 {
-	struct tlb_slave_info *slave_info = &(SLAVE_TLB_INFO(slave));
-
-	slave_info->load = 0;
-	slave_info->head = TLB_NULL_INDEX;
+	SLAVE_TLB_INFO(slave).load = 0;
+	SLAVE_TLB_INFO(slave).head = TLB_NULL_INDEX;
 }
 
 /* Caller must hold bond lock for read */
-static inline void
-tlb_clear_slave(struct bonding *bond, struct slave *slave, u8 save_load)
+static void tlb_clear_slave(struct bonding *bond, struct slave *slave, int save_load)
 {
-	struct tlb_client_info *tx_hash_table = NULL;
-	u32 index, next_index;
+	struct tlb_client_info *tx_hash_table;
+	u32 index;
 
-	/* clear slave from tx_hashtbl */
 	_lock_tx_hashtbl(bond);
+
+	/* clear slave from tx_hashtbl */
 	tx_hash_table = BOND_ALB_INFO(bond).tx_hashtbl;
 
-	if (tx_hash_table) {
-		index = SLAVE_TLB_INFO(slave).head;
-		while (index != TLB_NULL_INDEX) {
-			next_index = tx_hash_table[index].next;
-			tlb_init_table_entry(bond, index, save_load);
-			index = next_index;
-		}
+	index = SLAVE_TLB_INFO(slave).head;
+	while (index != TLB_NULL_INDEX) {
+		u32 next_index = tx_hash_table[index].next;
+		tlb_init_table_entry(&tx_hash_table[index], save_load);
+		index = next_index;
 	}
+
 	_unlock_tx_hashtbl(bond);
 
 	tlb_init_slave(slave);
 }
 
 /* Must be called before starting the monitor timer */
-static int
-tlb_initialize(struct bonding *bond)
+static int tlb_initialize(struct bonding *bond)
 {
 	struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond));
+	int size = TLB_HASH_TABLE_SIZE * sizeof(struct tlb_client_info);
 	int i;
-	size_t size;
-
-#if(TLB_HASH_TABLE_SIZE != 256)
-	/* Key to the hash table is byte wide. Check the size! */
-	#error Hash Table size is wrong.
-#endif
 
 	spin_lock_init(&(bond_info->tx_hashtbl_lock));
 
 	_lock_tx_hashtbl(bond);
-	if (bond_info->tx_hashtbl != NULL) {
-		printk (KERN_ERR "%s: TLB hash table is not NULL\n",
-			bond->device->name);
-		_unlock_tx_hashtbl(bond);
-		return -1;
-	}
 
-	size = TLB_HASH_TABLE_SIZE * sizeof(struct tlb_client_info);
 	bond_info->tx_hashtbl = kmalloc(size, GFP_KERNEL);
-	if (bond_info->tx_hashtbl == NULL) {
-		printk (KERN_ERR "%s: Failed to allocate TLB hash table\n",
-			bond->device->name);
+	if (!bond_info->tx_hashtbl) {
+		printk(KERN_ERR DRV_NAME
+		       ": Error: %s: Failed to allocate TLB hash table\n",
+		       bond->dev->name);
 		_unlock_tx_hashtbl(bond);
 		return -1;
 	}
 
 	memset(bond_info->tx_hashtbl, 0, size);
-	for (i=0; i<TLB_HASH_TABLE_SIZE; i++) {
-		tlb_init_table_entry(bond, i, 1);
+
+	for (i = 0; i < TLB_HASH_TABLE_SIZE; i++) {
+		tlb_init_table_entry(&bond_info->tx_hashtbl[i], 1);
 	}
+
 	_unlock_tx_hashtbl(bond);
 
 	return 0;
 }
 
 /* Must be called only after all slaves have been released */
-static void
-tlb_deinitialize(struct bonding *bond)
+static void tlb_deinitialize(struct bonding *bond)
 {
 	struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond));
 
 	_lock_tx_hashtbl(bond);
-	if (bond_info->tx_hashtbl == NULL) {
-		_unlock_tx_hashtbl(bond);
-		return;
-	}
+
 	kfree(bond_info->tx_hashtbl);
 	bond_info->tx_hashtbl = NULL;
+
 	_unlock_tx_hashtbl(bond);
 }
 
 /* Caller must hold bond lock for read */
-static struct slave*
-tlb_get_least_loaded_slave(struct bonding *bond)
+static struct slave *tlb_get_least_loaded_slave(struct bonding *bond)
 {
-	struct slave *slave;
-	struct slave *least_loaded;
-	s64 curr_gap, max_gap;
+	struct slave *slave, *least_loaded;
+	s64 max_gap;
+	int i, found = 0;
 
 	/* Find the first enabled slave */
-	slave = bond_get_first_slave(bond);
-	while (slave) {
+	bond_for_each_slave(bond, slave, i) {
 		if (SLAVE_IS_OK(slave)) {
+			found = 1;
 			break;
 		}
-		slave = bond_get_next_slave(bond, slave);
 	}
 
-	if (!slave) {
+	if (!found) {
 		return NULL;
 	}
 
 	least_loaded = slave;
-	max_gap = (s64)(slave->speed * 1000000) -
-			(s64)(SLAVE_TLB_INFO(slave).load * 8);
+	max_gap = (s64)(slave->speed << 20) - /* Convert to Megabit per sec */
+			(s64)(SLAVE_TLB_INFO(slave).load << 3); /* Bytes to bits */
 
 	/* Find the slave with the largest gap */
-	slave = bond_get_next_slave(bond, slave);
-	while (slave) {
+	bond_for_each_slave_from(bond, slave, i, least_loaded) {
 		if (SLAVE_IS_OK(slave)) {
-			curr_gap = (s64)(slave->speed * 1000000) -
-					(s64)(SLAVE_TLB_INFO(slave).load * 8);
-			if (max_gap < curr_gap) {
+			s64 gap = (s64)(slave->speed << 20) -
+					(s64)(SLAVE_TLB_INFO(slave).load << 3);
+			if (max_gap < gap) {
 				least_loaded = slave;
-				max_gap = curr_gap;
+				max_gap = gap;
 			}
 		}
-		slave = bond_get_next_slave(bond, slave);
 	}
 
 	return least_loaded;
 }
 
 /* Caller must hold bond lock for read */
-struct slave*
-tlb_choose_channel(struct bonding *bond, u32 hash_index, u32 skb_len)
+struct slave *tlb_choose_channel(struct bonding *bond, u32 hash_index, u32 skb_len)
 {
 	struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond));
-	struct tlb_client_info *hash_table = NULL;
-	struct slave *assigned_slave = NULL;
+	struct tlb_client_info *hash_table;
+	struct slave *assigned_slave;
 
 	_lock_tx_hashtbl(bond);
 
 	hash_table = bond_info->tx_hashtbl;
-	if (hash_table == NULL) {
-		printk (KERN_ERR "%s: TLB hash table is NULL\n",
-			bond->device->name);
-		_unlock_tx_hashtbl(bond);
-		return NULL;
-	}
-
 	assigned_slave = hash_table[hash_index].tx_slave;
 	if (!assigned_slave) {
 		assigned_slave = tlb_get_least_loaded_slave(bond);
@@ -345,14 +313,12 @@
 }
 
 /*********************** rlb specific functions ***************************/
-static inline void
-_lock_rx_hashtbl(struct bonding *bond)
+static inline void _lock_rx_hashtbl(struct bonding *bond)
 {
 	spin_lock(&(BOND_ALB_INFO(bond).rx_hashtbl_lock));
 }
 
-static inline void
-_unlock_rx_hashtbl(struct bonding *bond)
+static inline void _unlock_rx_hashtbl(struct bonding *bond)
 {
 	spin_unlock(&(BOND_ALB_INFO(bond).rx_hashtbl_lock));
 }
@@ -360,26 +326,20 @@
 /* when an ARP REPLY is received from a client update its info
  * in the rx_hashtbl
  */
-static void
-rlb_update_entry_from_arp(struct bonding *bond, struct arp_pkt *arp)
+static void rlb_update_entry_from_arp(struct bonding *bond, struct arp_pkt *arp)
 {
-	u32 hash_index;
-	struct rlb_client_info *client_info = NULL;
 	struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond));
+	struct rlb_client_info *client_info;
+	u32 hash_index;
 
 	_lock_rx_hashtbl(bond);
 
-	if (bond_info->rx_hashtbl == NULL) {
-		_unlock_rx_hashtbl(bond);
-		return;
-	}
-	hash_index = _simple_hash((u8*)&(arp->ip_src), 4);
+	hash_index = _simple_hash((u8*)&(arp->ip_src), sizeof(arp->ip_src));
 	client_info = &(bond_info->rx_hashtbl[hash_index]);
 
 	if ((client_info->assigned) &&
 	    (client_info->ip_src == arp->ip_dst) &&
 	    (client_info->ip_dst == arp->ip_src)) {
-
 		/* update the clients MAC address */
 		memcpy(client_info->mac_dst, arp->mac_src, ETH_ALEN);
 		client_info->ntt = 1;
@@ -389,66 +349,60 @@
 	_unlock_rx_hashtbl(bond);
 }
 
-static int
-rlb_arp_recv(struct sk_buff *skb,
-	     struct net_device *dev,
-	     struct packet_type* ptype)
+static int rlb_arp_recv(struct sk_buff *skb, struct net_device *bond_dev, struct packet_type *ptype)
 {
-	struct bonding *bond = (struct bonding *)dev->priv;
-	int ret = NET_RX_DROP;
+	struct bonding *bond = bond_dev->priv;
 	struct arp_pkt *arp = (struct arp_pkt *)skb->data;
+	int res = NET_RX_DROP;
 
-	if (!(dev->flags & IFF_MASTER)) {
+	if (!(bond_dev->flags & IFF_MASTER)) {
 		goto out;
 	}
 
 	if (!arp) {
-		printk(KERN_ERR "Packet has no ARP data\n");
+		dprintk("Packet has no ARP data\n");
 		goto out;
 	}
 
 	if (skb->len < sizeof(struct arp_pkt)) {
-		printk(KERN_ERR "Packet is too small to be an ARP\n");
+		dprintk("Packet is too small to be an ARP\n");
 		goto out;
 	}
 
 	if (arp->op_code == htons(ARPOP_REPLY)) {
 		/* update rx hash table for this ARP */
 		rlb_update_entry_from_arp(bond, arp);
-		BOND_PRINT_DBG(("Server received an ARP Reply from client"));
+		dprintk("Server received an ARP Reply from client\n");
 	}
 
-	ret = NET_RX_SUCCESS;
+	res = NET_RX_SUCCESS;
 
 out:
 	dev_kfree_skb(skb);
 
-	return ret;
+	return res;
 }
 
 /* Caller must hold bond lock for read */
-static struct slave*
-rlb_next_rx_slave(struct bonding *bond)
+static struct slave *rlb_next_rx_slave(struct bonding *bond)
 {
-	struct slave *rx_slave = NULL, *slave = NULL;
-	unsigned int i = 0;
 	struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond));
+	struct slave *rx_slave, *slave, *start_at;
+	int i = 0;
 
-	slave = bond_info->next_rx_slave;
-	if (slave == NULL) {
-		slave = bond->next;
+	if (bond_info->next_rx_slave) {
+		start_at = bond_info->next_rx_slave;
+	} else {
+		start_at = bond->first_slave;
 	}
 
-	/* this loop uses the circular linked list property of the
-	 * slave's list to go through all slaves
-	 */
-	for (i = 0; i < bond->slave_cnt; i++, slave = slave->next) {
+	rx_slave = NULL;
 
+	bond_for_each_slave_from(bond, slave, i, start_at) {
 		if (SLAVE_IS_OK(slave)) {
 			if (!rx_slave) {
 				rx_slave = slave;
-			}
-			else if (slave->speed > rx_slave->speed) {
+			} else if (slave->speed > rx_slave->speed) {
 				rx_slave = slave;
 			}
 		}
@@ -464,48 +418,41 @@
 /* teach the switch the mac of a disabled slave
  * on the primary for fault tolerance
  *
- * Caller must hold bond->ptrlock for write or bond lock for write
+ * Caller must hold bond->curr_slave_lock for write or bond lock for write
  */
-static void
-rlb_teach_disabled_mac_on_primary(struct bonding *bond, u8 addr[])
+static void rlb_teach_disabled_mac_on_primary(struct bonding *bond, u8 addr[])
 {
-	if (!bond->current_slave) {
+	if (!bond->curr_active_slave) {
 		return;
 	}
+
 	if (!bond->alb_info.primary_is_promisc) {
 		bond->alb_info.primary_is_promisc = 1;
-		dev_set_promiscuity(bond->current_slave->dev, 1);
+		dev_set_promiscuity(bond->curr_active_slave->dev, 1);
 	}
+
 	bond->alb_info.rlb_promisc_timeout_counter = 0;
 
-	alb_send_learning_packets(bond->current_slave, addr);
+	alb_send_learning_packets(bond->curr_active_slave, addr);
 }
 
 /* slave being removed should not be active at this point
  *
  * Caller must hold bond lock for read
  */
-static void
-rlb_clear_slave(struct bonding *bond, struct slave *slave)
+static void rlb_clear_slave(struct bonding *bond, struct slave *slave)
 {
-	struct rlb_client_info *rx_hash_table = NULL;
 	struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond));
-	u8 mac_bcast[ETH_ALEN] = {0xff,0xff,0xff,0xff,0xff,0xff};
+	struct rlb_client_info *rx_hash_table;
 	u32 index, next_index;
 
 	/* clear slave from rx_hashtbl */
 	_lock_rx_hashtbl(bond);
-	rx_hash_table = bond_info->rx_hashtbl;
-
-	if (rx_hash_table == NULL) {
-		_unlock_rx_hashtbl(bond);
-		return;
-	}
 
+	rx_hash_table = bond_info->rx_hashtbl;
 	index = bond_info->rx_hashtbl_head;
 	for (; index != RLB_NULL_INDEX; index = next_index) {
 		next_index = rx_hash_table[index].next;
-
 		if (rx_hash_table[index].slave == slave) {
 			struct slave *assigned_slave = rlb_next_rx_slave(bond);
 
@@ -533,23 +480,24 @@
 
 	_unlock_rx_hashtbl(bond);
 
-	write_lock(&bond->ptrlock);
-	if (slave != bond->current_slave) {
+	write_lock(&bond->curr_slave_lock);
+
+	if (slave != bond->curr_active_slave) {
 		rlb_teach_disabled_mac_on_primary(bond, slave->dev->dev_addr);
 	}
-	write_unlock(&bond->ptrlock);
+
+	write_unlock(&bond->curr_slave_lock);
 }
 
-static void
-rlb_update_client(struct rlb_client_info *client_info)
+static void rlb_update_client(struct rlb_client_info *client_info)
 {
-	int i = 0;
+	int i;
 
-	if (client_info->slave == NULL) {
+	if (!client_info->slave) {
 		return;
 	}
 
-	for (i=0; i<RLB_ARP_BURST_SIZE; i++) {
+	for (i = 0; i < RLB_ARP_BURST_SIZE; i++) {
 		arp_send(ARPOP_REPLY, ETH_P_ARP,
 			 client_info->ip_dst,
 			 client_info->slave->dev,
@@ -561,20 +509,14 @@
 }
 
 /* sends ARP REPLIES that update the clients that need updating */
-static void
-rlb_update_rx_clients(struct bonding *bond)
+static void rlb_update_rx_clients(struct bonding *bond)
 {
-	u32 hash_index;
-	struct rlb_client_info *client_info = NULL;
 	struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond));
+	struct rlb_client_info *client_info;
+	u32 hash_index;
 
 	_lock_rx_hashtbl(bond);
 
-	if (bond_info->rx_hashtbl == NULL) {
-		_unlock_rx_hashtbl(bond);
-		return;
-	}
-
 	hash_index = bond_info->rx_hashtbl_head;
 	for (; hash_index != RLB_NULL_INDEX; hash_index = client_info->next) {
 		client_info = &(bond_info->rx_hashtbl[hash_index]);
@@ -595,22 +537,15 @@
 }
 
 /* The slave was assigned a new mac address - update the clients */
-static void
-rlb_req_update_slave_clients(struct bonding *bond, struct slave *slave)
+static void rlb_req_update_slave_clients(struct bonding *bond, struct slave *slave)
 {
-	u32 hash_index;
-	u8 ntt = 0;
 	struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond));
-	u8 mac_bcast[ETH_ALEN] = {0xff,0xff,0xff,0xff,0xff,0xff};
-	struct rlb_client_info* client_info = NULL;
+	struct rlb_client_info *client_info;
+	int ntt = 0;
+	u32 hash_index;
 
 	_lock_rx_hashtbl(bond);
 
-	if (bond_info->rx_hashtbl == NULL) {
-		_unlock_rx_hashtbl(bond);
-		return;
-	}
-
 	hash_index = bond_info->rx_hashtbl_head;
 	for (; hash_index != RLB_NULL_INDEX; hash_index = client_info->next) {
 		client_info = &(bond_info->rx_hashtbl[hash_index]);
@@ -633,37 +568,31 @@
 }
 
 /* mark all clients using src_ip to be updated */
-static void
-rlb_req_update_subnet_clients(struct bonding *bond, u32 src_ip)
+static void rlb_req_update_subnet_clients(struct bonding *bond, u32 src_ip)
 {
-	u32 hash_index;
 	struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond));
-	u8 mac_bcast[ETH_ALEN] = {0xff,0xff,0xff,0xff,0xff,0xff};
-	struct rlb_client_info *client_info = NULL;
+	struct rlb_client_info *client_info;
+	u32 hash_index;
 
 	_lock_rx_hashtbl(bond);
 
-	if (bond_info->rx_hashtbl == NULL) {
-		_unlock_rx_hashtbl(bond);
-		return;
-	}
-
 	hash_index = bond_info->rx_hashtbl_head;
 	for (; hash_index != RLB_NULL_INDEX; hash_index = client_info->next) {
 		client_info = &(bond_info->rx_hashtbl[hash_index]);
 
 		if (!client_info->slave) {
-			printk(KERN_ERR "Bonding: Error: found a client with no"
-			       " channel in the client's hash table\n");
+			printk(KERN_ERR DRV_NAME
+			       ": Error: found a client with no channel in "
+			       "the client's hash table\n");
 			continue;
 		}
 		/*update all clients using this src_ip, that are not assigned
-		 * to the team's address (current_slave) and have a known
+		 * to the team's address (curr_active_slave) and have a known
 		 * unicast mac address.
 		 */
 		if ((client_info->ip_src == src_ip) &&
 		    memcmp(client_info->slave->dev->dev_addr,
-			   bond->device->dev_addr, ETH_ALEN) &&
+			   bond->dev->dev_addr, ETH_ALEN) &&
 		    memcmp(client_info->mac_dst, mac_bcast, ETH_ALEN)) {
 			client_info->ntt = 1;
 			bond_info->rx_ntt = 1;
@@ -674,30 +603,22 @@
 }
 
 /* Caller must hold both bond and ptr locks for read */
-struct slave*
-rlb_choose_channel(struct bonding *bond, struct arp_pkt *arp)
+struct slave *rlb_choose_channel(struct bonding *bond, struct arp_pkt *arp)
 {
 	struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond));
-	struct rlb_client_info *client_info = NULL;
+	struct slave *assigned_slave;
+	struct rlb_client_info *client_info;
 	u32 hash_index = 0;
-	struct slave *assigned_slave = NULL;
-	u8 mac_bcast[ETH_ALEN] = {0xff,0xff,0xff,0xff,0xff,0xff};
 
 	_lock_rx_hashtbl(bond);
 
-	if (bond_info->rx_hashtbl == NULL) {
-		_unlock_rx_hashtbl(bond);
-		return NULL;
-	}
-
-	hash_index = _simple_hash((u8 *)&arp->ip_dst, 4);
+	hash_index = _simple_hash((u8 *)&arp->ip_dst, sizeof(arp->ip_src));
 	client_info = &(bond_info->rx_hashtbl[hash_index]);
 
-	if (client_info->assigned == 1) {
+	if (client_info->assigned) {
 		if ((client_info->ip_src == arp->ip_src) &&
 		    (client_info->ip_dst == arp->ip_dst)) {
 			/* the entry is already assigned to this client */
-
 			if (memcmp(arp->mac_dst, mac_bcast, ETH_ALEN)) {
 				/* update mac address from arp */
 				memcpy(client_info->mac_dst, arp->mac_dst, ETH_ALEN);
@@ -710,12 +631,12 @@
 			}
 		} else {
 			/* the entry is already assigned to some other client,
-			 * move the old client to primary (current_slave) so
+			 * move the old client to primary (curr_active_slave) so
 			 * that the new client can be assigned to this entry.
 			 */
-			if (bond->current_slave &&
-			    client_info->slave != bond->current_slave) {
-				client_info->slave = bond->current_slave;
+			if (bond->curr_active_slave &&
+			    client_info->slave != bond->curr_active_slave) {
+				client_info->slave = bond->curr_active_slave;
 				rlb_update_client(client_info);
 			}
 		}
@@ -736,8 +657,7 @@
 		if (memcmp(client_info->mac_dst, mac_bcast, ETH_ALEN)) {
 			client_info->ntt = 1;
 			bond->alb_info.rx_ntt = 1;
-		}
-		else {
+		} else {
 			client_info->ntt = 0;
 		}
 
@@ -760,10 +680,9 @@
 
 /* chooses (and returns) transmit channel for arp reply
  * does not choose channel for other arp types since they are
- * sent on the current_slave
+ * sent on the curr_active_slave
  */
-static struct slave*
-rlb_arp_xmit(struct sk_buff *skb, struct bonding *bond)
+static struct slave *rlb_arp_xmit(struct sk_buff *skb, struct bonding *bond)
 {
 	struct arp_pkt *arp = (struct arp_pkt *)skb->nh.raw;
 	struct slave *tx_slave = NULL;
@@ -776,9 +695,8 @@
 		if (tx_slave) {
 			memcpy(arp->mac_src,tx_slave->dev->dev_addr, ETH_ALEN);
 		}
-		BOND_PRINT_DBG(("Server sent ARP Reply packet"));
+		dprintk("Server sent ARP Reply packet\n");
 	} else if (arp->op_code == __constant_htons(ARPOP_REQUEST)) {
-
 		/* Create an entry in the rx_hashtbl for this client as a
 		 * place holder.
 		 * When the arp reply is received the entry will be updated
@@ -797,34 +715,29 @@
 		 * updated with their assigned mac.
 		 */
 		rlb_req_update_subnet_clients(bond, arp->ip_src);
-		BOND_PRINT_DBG(("Server sent ARP Request packet"));
+		dprintk("Server sent ARP Request packet\n");
 	}
 
 	return tx_slave;
 }
 
 /* Caller must hold bond lock for read */
-static void
-rlb_rebalance(struct bonding *bond)
+static void rlb_rebalance(struct bonding *bond)
 {
 	struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond));
-	struct slave *assigned_slave = NULL;
+	struct slave *assigned_slave;
+	struct rlb_client_info *client_info;
+	int ntt;
 	u32 hash_index;
-	struct rlb_client_info *client_info = NULL;
-	u8 ntt = 0;
 
 	_lock_rx_hashtbl(bond);
 
-	if (bond_info->rx_hashtbl == NULL) {
-		_unlock_rx_hashtbl(bond);
-		return;
-	}
-
+	ntt = 0;
 	hash_index = bond_info->rx_hashtbl_head;
 	for (; hash_index != RLB_NULL_INDEX; hash_index = client_info->next) {
 		client_info = &(bond_info->rx_hashtbl[hash_index]);
 		assigned_slave = rlb_next_rx_slave(bond);
-		if (assigned_slave && (client_info->slave != assigned_slave)){
+		if (assigned_slave && (client_info->slave != assigned_slave)) {
 			client_info->slave = assigned_slave;
 			client_info->ntt = 1;
 			ntt = 1;
@@ -839,96 +752,83 @@
 }
 
 /* Caller must hold rx_hashtbl lock */
-static inline void
-rlb_init_table_entry(struct rlb_client_info *entry)
+static void rlb_init_table_entry(struct rlb_client_info *entry)
 {
+	memset(entry, 0, sizeof(struct rlb_client_info));
 	entry->next = RLB_NULL_INDEX;
 	entry->prev = RLB_NULL_INDEX;
-	entry->assigned = 0;
-	entry->ntt = 0;
 }
 
-static int
-rlb_initialize(struct bonding *bond)
+static int rlb_initialize(struct bonding *bond)
 {
 	struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond));
 	struct packet_type *pk_type = &(BOND_ALB_INFO(bond).rlb_pkt_type);
+	int size = RLB_HASH_TABLE_SIZE * sizeof(struct rlb_client_info);
 	int i;
-	size_t size;
 
 	spin_lock_init(&(bond_info->rx_hashtbl_lock));
 
 	_lock_rx_hashtbl(bond);
-	if (bond_info->rx_hashtbl != NULL) {
-		printk (KERN_ERR "%s: RLB hash table is not NULL\n",
-			bond->device->name);
-		_unlock_rx_hashtbl(bond);
-		return -1;
-	}
 
-	size = RLB_HASH_TABLE_SIZE * sizeof(struct rlb_client_info);
 	bond_info->rx_hashtbl = kmalloc(size, GFP_KERNEL);
-	if (bond_info->rx_hashtbl == NULL) {
-		printk (KERN_ERR "%s: Failed to allocate"
-			" RLB hash table\n", bond->device->name);
+	if (!bond_info->rx_hashtbl) {
+		printk(KERN_ERR DRV_NAME
+		       ": Error: %s: Failed to allocate RLB hash table\n",
+		       bond->dev->name);
 		_unlock_rx_hashtbl(bond);
 		return -1;
 	}
 
 	bond_info->rx_hashtbl_head = RLB_NULL_INDEX;
 
-	for (i=0; i<RLB_HASH_TABLE_SIZE; i++) {
+	for (i = 0; i < RLB_HASH_TABLE_SIZE; i++) {
 		rlb_init_table_entry(bond_info->rx_hashtbl + i);
 	}
-	_unlock_rx_hashtbl(bond);
 
-	/* register to receive ARPs */
+	_unlock_rx_hashtbl(bond);
 
 	/*initialize packet type*/
 	pk_type->type = __constant_htons(ETH_P_ARP);
-	pk_type->dev = bond->device;
+	pk_type->dev = bond->dev;
 	pk_type->func = rlb_arp_recv;
 
+	/* register to receive ARPs */
 	dev_add_pack(pk_type);
 
 	return 0;
 }
 
-static void
-rlb_deinitialize(struct bonding *bond)
+static void rlb_deinitialize(struct bonding *bond)
 {
 	struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond));
 
 	dev_remove_pack(&(bond_info->rlb_pkt_type));
 
 	_lock_rx_hashtbl(bond);
-	if (bond_info->rx_hashtbl == NULL) {
-		_unlock_rx_hashtbl(bond);
-		return;
-	}
+
 	kfree(bond_info->rx_hashtbl);
 	bond_info->rx_hashtbl = NULL;
+
 	_unlock_rx_hashtbl(bond);
 }
 
 /*********************** tlb/rlb shared functions *********************/
 
-static void
-alb_send_learning_packets(struct slave *slave, u8 mac_addr[])
+static void alb_send_learning_packets(struct slave *slave, u8 mac_addr[])
 {
-	struct sk_buff *skb = NULL;
 	struct learning_pkt pkt;
-	char *data = NULL;
+	int size = sizeof(struct learning_pkt);
 	int i;
-	unsigned int size = sizeof(struct learning_pkt);
 
 	memset(&pkt, 0, size);
 	memcpy(pkt.mac_dst, mac_addr, ETH_ALEN);
 	memcpy(pkt.mac_src, mac_addr, ETH_ALEN);
 	pkt.type = __constant_htons(ETH_P_LOOP);
 
-	for (i=0; i < MAX_LP_RETRY; i++) {
-		skb = NULL;
+	for (i = 0; i < MAX_LP_RETRY; i++) {
+		struct sk_buff *skb;
+		char *data;
+
 		skb = dev_alloc_skb(size);
 		if (!skb) {
 			return;
@@ -936,28 +836,26 @@
 
 		data = skb_put(skb, size);
 		memcpy(data, &pkt, size);
+
 		skb->mac.raw = data;
 		skb->nh.raw = data + ETH_HLEN;
 		skb->protocol = pkt.type;
 		skb->priority = TC_PRIO_CONTROL;
 		skb->dev = slave->dev;
+
 		dev_queue_xmit(skb);
 	}
-
 }
 
 /* hw is a boolean parameter that determines whether we should try and
  * set the hw address of the device as well as the hw address of the
  * net_device
  */
-static int
-alb_set_slave_mac_addr(struct slave *slave, u8 addr[], int hw)
+static int alb_set_slave_mac_addr(struct slave *slave, u8 addr[], int hw)
 {
-	struct net_device *dev = NULL;
+	struct net_device *dev = slave->dev;
 	struct sockaddr s_addr;
 
-	dev = slave->dev;
-
 	if (!hw) {
 		memcpy(dev->dev_addr, addr, dev->addr_len);
 		return 0;
@@ -968,26 +866,23 @@
 	memcpy(s_addr.sa_data, addr, dev->addr_len);
 	s_addr.sa_family = dev->type;
 	if (dev->set_mac_address(dev, &s_addr)) {
-		printk(KERN_DEBUG "bonding: Error: alb_set_slave_mac_addr:"
-				  " dev->set_mac_address of dev %s failed!"
-				  " ALB mode requires that the base driver"
-				  " support setting the hw address also when"
-				  " the network device's interface is open\n",
-				  dev->name);
+		printk(KERN_ERR DRV_NAME
+		       ": Error: dev->set_mac_address of dev %s failed! ALB "
+		       "mode requires that the base driver support setting "
+		       "the hw address also when the network device's "
+		       "interface is open\n",
+		       dev->name);
 		return -EOPNOTSUPP;
 	}
 	return 0;
 }
 
-/* Caller must hold bond lock for write or ptrlock for write*/
-static void
-alb_swap_mac_addr(struct bonding *bond,
-		  struct slave *slave1,
-		  struct slave *slave2)
+/* Caller must hold bond lock for write or curr_slave_lock for write*/
+static void alb_swap_mac_addr(struct bonding *bond, struct slave *slave1, struct slave *slave2)
 {
-	u8 tmp_mac_addr[ETH_ALEN];
 	struct slave *disabled_slave = NULL;
-	u8 slaves_state_differ;
+	u8 tmp_mac_addr[ETH_ALEN];
+	int slaves_state_differ;
 
 	slaves_state_differ = (SLAVE_IS_OK(slave1) != SLAVE_IS_OK(slave2));
 
@@ -1004,8 +899,7 @@
 			 */
 			rlb_req_update_slave_clients(bond, slave1);
 		}
-	}
-	else {
+	} else {
 		disabled_slave = slave1;
 	}
 
@@ -1017,15 +911,14 @@
 			 */
 			rlb_req_update_slave_clients(bond, slave2);
 		}
-	}
-	else {
+	} else {
 		disabled_slave = slave2;
 	}
 
 	if (bond->alb_info.rlb_enabled && slaves_state_differ) {
-			/* A disabled slave was assigned an active mac addr */
-			rlb_teach_disabled_mac_on_primary(bond,
-				disabled_slave->dev->dev_addr);
+		/* A disabled slave was assigned an active mac addr */
+		rlb_teach_disabled_mac_on_primary(bond,
+						  disabled_slave->dev->dev_addr);
 	}
 }
 
@@ -1043,10 +936,8 @@
  *
  * Caller must hold bond lock
  */
-static void
-alb_change_hw_addr_on_detach(struct bonding *bond, struct slave *slave)
+static void alb_change_hw_addr_on_detach(struct bonding *bond, struct slave *slave)
 {
-	struct slave *tmp_slave;
 	int perm_curr_diff;
 	int perm_bond_diff;
 
@@ -1054,20 +945,23 @@
 				slave->dev->dev_addr,
 				ETH_ALEN);
 	perm_bond_diff = memcmp(slave->perm_hwaddr,
-				bond->device->dev_addr,
+				bond->dev->dev_addr,
 				ETH_ALEN);
+
 	if (perm_curr_diff && perm_bond_diff) {
-		tmp_slave = bond_get_first_slave(bond);
-		while (tmp_slave) {
+		struct slave *tmp_slave;
+		int i, found = 0;
+
+		bond_for_each_slave(bond, tmp_slave, i) {
 			if (!memcmp(slave->perm_hwaddr,
-				   tmp_slave->dev->dev_addr,
-				   ETH_ALEN)) {
+				    tmp_slave->dev->dev_addr,
+				    ETH_ALEN)) {
+				found = 1;
 				break;
 			}
-			tmp_slave = bond_get_next_slave(bond, tmp_slave);
 		}
 
-		if (tmp_slave) {
+		if (found) {
 			alb_swap_mac_addr(bond, slave, tmp_slave);
 		}
 	}
@@ -1098,10 +992,11 @@
  * caller must hold the bond lock for write since the mac addresses are compared
  * and may be swapped.
  */
-static int
-alb_handle_addr_collision_on_attach(struct bonding *bond, struct slave *slave)
+static int alb_handle_addr_collision_on_attach(struct bonding *bond, struct slave *slave)
 {
-	struct slave *tmp_slave1, *tmp_slave2;
+	struct slave *tmp_slave1, *tmp_slave2, *free_mac_slave;
+	struct slave *has_bond_addr = bond->curr_active_slave;
+	int i, j, found = 0;
 
 	if (bond->slave_cnt == 0) {
 		/* this is the first slave */
@@ -1112,65 +1007,78 @@
 	 * check uniqueness of slave's mac address against the other
 	 * slaves in the bond.
 	 */
-	if (memcmp(slave->perm_hwaddr, bond->device->dev_addr, ETH_ALEN)) {
-		tmp_slave1 = bond_get_first_slave(bond);
-		for (; tmp_slave1; tmp_slave1 = bond_get_next_slave(bond, tmp_slave1)) {
+	if (memcmp(slave->perm_hwaddr, bond->dev->dev_addr, ETH_ALEN)) {
+		bond_for_each_slave(bond, tmp_slave1, i) {
 			if (!memcmp(tmp_slave1->dev->dev_addr, slave->dev->dev_addr,
 				    ETH_ALEN)) {
+				found = 1;
 				break;
 			}
 		}
-		if (tmp_slave1) {
+
+		if (found) {
 			/* a slave was found that is using the mac address
 			 * of the new slave
 			 */
-			printk(KERN_ERR "bonding: Warning: the hw address "
-			       "of slave %s is not unique - cannot enslave it!"
-			       , slave->dev->name);
+			printk(KERN_ERR DRV_NAME
+			       ": Error: the hw address of slave %s is not "
+			       "unique - cannot enslave it!",
+			       slave->dev->name);
 			return -EINVAL;
 		}
+
 		return 0;
 	}
 
-	/* the slave's address is equal to the address of the bond
-	 * search for a spare address in the bond for this slave.
+	/* The slave's address is equal to the address of the bond.
+	 * Search for a spare address in the bond for this slave.
 	 */
-	tmp_slave1 = bond_get_first_slave(bond);
-	for (; tmp_slave1; tmp_slave1 = bond_get_next_slave(bond, tmp_slave1)) {
-
-		tmp_slave2 = bond_get_first_slave(bond);
-		for (; tmp_slave2; tmp_slave2 = bond_get_next_slave(bond, tmp_slave2)) {
+	free_mac_slave = NULL;
 
+	bond_for_each_slave(bond, tmp_slave1, i) {
+		found = 0;
+		bond_for_each_slave(bond, tmp_slave2, j) {
 			if (!memcmp(tmp_slave1->perm_hwaddr,
 				    tmp_slave2->dev->dev_addr,
 				    ETH_ALEN)) {
-
+				found = 1;
 				break;
 			}
 		}
 
-		if (!tmp_slave2) {
+		if (!found) {
 			/* no slave has tmp_slave1's perm addr
 			 * as its curr addr
 			 */
+			free_mac_slave = tmp_slave1;
 			break;
 		}
+
+		if (!has_bond_addr) {
+			if (!memcmp(tmp_slave1->dev->dev_addr,
+				    bond->dev->dev_addr,
+				    ETH_ALEN)) {
+
+				has_bond_addr = tmp_slave1;
+			}
+		}
 	}
 
-	if (tmp_slave1) {
-		alb_set_slave_mac_addr(slave, tmp_slave1->perm_hwaddr,
+	if (free_mac_slave) {
+		alb_set_slave_mac_addr(slave, free_mac_slave->perm_hwaddr,
 				       bond->alb_info.rlb_enabled);
 
-		printk(KERN_WARNING "bonding: Warning: the hw address "
-		       "of slave %s is in use by the bond; "
-		       "giving it the hw address of %s\n",
-		       slave->dev->name, tmp_slave1->dev->name);
-	} else {
-		printk(KERN_CRIT "bonding: Error: the hw address "
-		       "of slave %s is in use by the bond; "
-		       "couldn't find a slave with a free hw "
-		       "address to give it (this should not have "
-		       "happened)\n", slave->dev->name);
+		printk(KERN_WARNING DRV_NAME
+		       ": Warning: the hw address of slave %s is in use by "
+		       "the bond; giving it the hw address of %s\n",
+		       slave->dev->name, free_mac_slave->dev->name);
+
+	} else if (has_bond_addr) {
+		printk(KERN_ERR DRV_NAME
+		       ": Error: the hw address of slave %s is in use by the "
+		       "bond; couldn't find a slave with a free hw address to "
+		       "give it (this should not have happened)\n",
+		       slave->dev->name);
 		return -EFAULT;
 	}
 
@@ -1188,37 +1096,36 @@
  *
  * For each slave, this function sets the interface to the new address and then
  * changes its dev_addr field to its previous value.
- * 
+ *
  * Unwinding assumes bond's mac address has not yet changed.
  */
-static inline int
-alb_set_mac_address(struct bonding *bond, void *addr)
+static int alb_set_mac_address(struct bonding *bond, void *addr)
 {
 	struct sockaddr sa;
-	struct slave *slave;
+	struct slave *slave, *stop_at;
 	char tmp_addr[ETH_ALEN];
-	int error;
+	int res;
+	int i;
 
 	if (bond->alb_info.rlb_enabled) {
 		return 0;
 	}
 
-	slave = bond_get_first_slave(bond);
-	for (; slave; slave = bond_get_next_slave(bond, slave)) {
+	bond_for_each_slave(bond, slave, i) {
 		if (slave->dev->set_mac_address == NULL) {
-			error = -EOPNOTSUPP;
+			res = -EOPNOTSUPP;
 			goto unwind;
 		}
 
 		/* save net_device's current hw address */
 		memcpy(tmp_addr, slave->dev->dev_addr, ETH_ALEN);
 
-		error = slave->dev->set_mac_address(slave->dev, addr);
+		res = slave->dev->set_mac_address(slave->dev, addr);
 
 		/* restore net_device's hw address */
 		memcpy(slave->dev->dev_addr, tmp_addr, ETH_ALEN);
 
-		if (error) {
+		if (res) {
 			goto unwind;
 		}
 	}
@@ -1226,22 +1133,23 @@
 	return 0;
 
 unwind:
-	memcpy(sa.sa_data, bond->device->dev_addr, bond->device->addr_len);
-	sa.sa_family = bond->device->type;
-	slave = bond_get_first_slave(bond);
-	for (; slave; slave = bond_get_next_slave(bond, slave)) {
+	memcpy(sa.sa_data, bond->dev->dev_addr, bond->dev->addr_len);
+	sa.sa_family = bond->dev->type;
+
+	/* unwind from head to the slave that failed */
+	stop_at = slave;
+	bond_for_each_slave_from_to(bond, slave, i, bond->first_slave, stop_at) {
 		memcpy(tmp_addr, slave->dev->dev_addr, ETH_ALEN);
 		slave->dev->set_mac_address(slave->dev, &sa);
 		memcpy(slave->dev->dev_addr, tmp_addr, ETH_ALEN);
 	}
 
-	return error;
+	return res;
 }
 
 /************************ exported alb funcions ************************/
 
-int
-bond_alb_initialize(struct bonding *bond, int rlb_enabled)
+int bond_alb_initialize(struct bonding *bond, int rlb_enabled)
 {
 	int res;
 
@@ -1263,8 +1171,7 @@
 	return 0;
 }
 
-void
-bond_alb_deinitialize(struct bonding *bond)
+void bond_alb_deinitialize(struct bonding *bond)
 {
 	struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond));
 
@@ -1275,49 +1182,41 @@
 	}
 }
 
-int
-bond_alb_xmit(struct sk_buff *skb, struct net_device *dev)
+int bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev)
 {
-	struct bonding *bond = (struct bonding *) dev->priv;
-	struct ethhdr *eth_data = (struct ethhdr *)skb->data;
+	struct bonding *bond = bond_dev->priv;
+	struct ethhdr *eth_data;
 	struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond));
 	struct slave *tx_slave = NULL;
-	char do_tx_balance = 1;
+	static u32 ip_bcast = 0xffffffff;
 	int hash_size = 0;
+	int do_tx_balance = 1;
 	u32 hash_index = 0;
 	u8 *hash_start = NULL;
-	u8 mac_bcast[ETH_ALEN] = {0xff,0xff,0xff,0xff,0xff,0xff};
 
-	if (!IS_UP(dev)) { /* bond down */
-		dev_kfree_skb(skb);
-		return 0;
-	}
+	skb->mac.raw = (unsigned char *)skb->data;
+	eth_data = (struct ethhdr *)skb->data;
 
-	/* make sure that the current_slave and the slaves list do
+	/* make sure that the curr_active_slave and the slaves list do
 	 * not change during tx
 	 */
 	read_lock(&bond->lock);
+	read_lock(&bond->curr_slave_lock);
 
-	if (bond->slave_cnt == 0) {
-		/* no suitable interface, frame not sent */
-		dev_kfree_skb(skb);
-		read_unlock(&bond->lock);
-		return 0;
+	if (!BOND_IS_OK(bond)) {
+		goto free_out;
 	}
 
-	read_lock(&bond->ptrlock);
-
 	switch (ntohs(skb->protocol)) {
 	case ETH_P_IP:
 		if ((memcmp(eth_data->h_dest, mac_bcast, ETH_ALEN) == 0) ||
-		    (skb->nh.iph->daddr == 0xffffffff)) {
+		    (skb->nh.iph->daddr == ip_bcast)) {
 			do_tx_balance = 0;
 			break;
 		}
 		hash_start = (char*)&(skb->nh.iph->daddr);
-		hash_size = 4;
+		hash_size = sizeof(skb->nh.iph->daddr);
 		break;
-
 	case ETH_P_IPV6:
 		if (memcmp(eth_data->h_dest, mac_bcast, ETH_ALEN) == 0) {
 			do_tx_balance = 0;
@@ -1325,9 +1224,8 @@
 		}
 
 		hash_start = (char*)&(skb->nh.ipv6h->daddr);
-		hash_size = 16;
+		hash_size = sizeof(skb->nh.ipv6h->daddr);
 		break;
-
 	case ETH_P_IPX:
 		if (ipx_hdr(skb)->ipx_checksum !=
 		    __constant_htons(IPX_NO_CHECKSUM)) {
@@ -1336,8 +1234,7 @@
 			break;
 		}
 
-		if (ipx_hdr(skb)->ipx_type !=
-		    __constant_htons(IPX_TYPE_NCP)) {
+		if (ipx_hdr(skb)->ipx_type != IPX_TYPE_NCP) {
 			/* The only protocol worth balancing in
 			 * this family since it has an "ARP" like
 			 * mechanism
@@ -1349,14 +1246,12 @@
 		hash_start = (char*)eth_data->h_dest;
 		hash_size = ETH_ALEN;
 		break;
-
 	case ETH_P_ARP:
 		do_tx_balance = 0;
 		if (bond_info->rlb_enabled) {
 			tx_slave = rlb_arp_xmit(skb, bond);
 		}
 		break;
-
 	default:
 		do_tx_balance = 0;
 		break;
@@ -1369,16 +1264,16 @@
 
 	if (!tx_slave) {
 		/* unbalanced or unassigned, send through primary */
-		tx_slave = bond->current_slave;
+		tx_slave = bond->curr_active_slave;
 		bond_info->unbalanced_load += skb->len;
 	}
 
 	if (tx_slave && SLAVE_IS_OK(tx_slave)) {
 		skb->dev = tx_slave->dev;
-		if (tx_slave != bond->current_slave) {
+		if (tx_slave != bond->curr_active_slave) {
 			memcpy(eth_data->h_source,
-				tx_slave->dev->dev_addr,
-				ETH_ALEN);
+			       tx_slave->dev->dev_addr,
+			       ETH_ALEN);
 		}
 		dev_queue_xmit(skb);
 	} else {
@@ -1386,26 +1281,35 @@
 		if (tx_slave) {
 			tlb_clear_slave(bond, tx_slave, 0);
 		}
-		dev_kfree_skb(skb);
+		goto free_out;
 	}
 
-	read_unlock(&bond->ptrlock);
+out:
+	read_unlock(&bond->curr_slave_lock);
 	read_unlock(&bond->lock);
 	return 0;
+
+free_out:
+	dev_kfree_skb(skb);
+	goto out;
 }
 
-void
-bond_alb_monitor(struct bonding *bond)
+void bond_alb_monitor(struct bonding *bond)
 {
 	struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond));
-	struct slave *slave = NULL;
+	struct slave *slave;
+	int i;
 
 	read_lock(&bond->lock);
 
-	if ((bond->slave_cnt == 0) || !(bond->device->flags & IFF_UP)) {
+	if (bond->kill_timers) {
+		goto out;
+	}
+
+	if (bond->slave_cnt == 0) {
 		bond_info->tx_rebalance_counter = 0;
 		bond_info->lp_counter = 0;
-		goto out;
+		goto re_arm;
 	}
 
 	bond_info->tx_rebalance_counter++;
@@ -1413,51 +1317,53 @@
 
 	/* send learning packets */
 	if (bond_info->lp_counter >= BOND_ALB_LP_TICKS) {
-		/* change of current_slave involves swapping of mac addresses.
+		/* change of curr_active_slave involves swapping of mac addresses.
 		 * in order to avoid this swapping from happening while
-		 * sending the learning packets, the ptrlock must be held for
+		 * sending the learning packets, the curr_slave_lock must be held for
 		 * read.
 		 */
-		read_lock(&bond->ptrlock);
-		slave = bond_get_first_slave(bond);
-		while (slave) {
+		read_lock(&bond->curr_slave_lock);
+
+		bond_for_each_slave(bond, slave, i) {
 			alb_send_learning_packets(slave,slave->dev->dev_addr);
-			slave = bond_get_next_slave(bond, slave);
 		}
-		read_unlock(&bond->ptrlock);
+
+		read_unlock(&bond->curr_slave_lock);
 
 		bond_info->lp_counter = 0;
 	}
 
 	/* rebalance tx traffic */
 	if (bond_info->tx_rebalance_counter >= BOND_TLB_REBALANCE_TICKS) {
-		read_lock(&bond->ptrlock);
-		slave = bond_get_first_slave(bond);
-		while (slave) {
+
+		read_lock(&bond->curr_slave_lock);
+
+		bond_for_each_slave(bond, slave, i) {
 			tlb_clear_slave(bond, slave, 1);
-			if (slave == bond->current_slave) {
+			if (slave == bond->curr_active_slave) {
 				SLAVE_TLB_INFO(slave).load =
 					bond_info->unbalanced_load /
 						BOND_TLB_REBALANCE_INTERVAL;
 				bond_info->unbalanced_load = 0;
 			}
-			slave = bond_get_next_slave(bond, slave);
 		}
-		read_unlock(&bond->ptrlock);
+
+		read_unlock(&bond->curr_slave_lock);
+
 		bond_info->tx_rebalance_counter = 0;
 	}
 
 	/* handle rlb stuff */
 	if (bond_info->rlb_enabled) {
 		/* the following code changes the promiscuity of the
-		 * the current_slave. It needs to be locked with a
+		 * the curr_active_slave. It needs to be locked with a
 		 * write lock to protect from other code that also
 		 * sets the promiscuity.
 		 */
-		write_lock(&bond->ptrlock);
+		write_lock(&bond->curr_slave_lock);
+
 		if (bond_info->primary_is_promisc &&
-		    (++bond_info->rlb_promisc_timeout_counter >=
-			RLB_PROMISC_TIMEOUT)) {
+		    (++bond_info->rlb_promisc_timeout_counter >= RLB_PROMISC_TIMEOUT)) {
 
 			bond_info->rlb_promisc_timeout_counter = 0;
 
@@ -1465,12 +1371,13 @@
 			 * because a slave was disabled then
 			 * it can now leave promiscuous mode.
 			 */
-			dev_set_promiscuity(bond->current_slave->dev, -1);
+			dev_set_promiscuity(bond->curr_active_slave->dev, -1);
 			bond_info->primary_is_promisc = 0;
 		}
-		write_unlock(&bond->ptrlock);
 
-		if (bond_info->rlb_rebalance == 1) {
+		write_unlock(&bond->curr_slave_lock);
+
+		if (bond_info->rlb_rebalance) {
 			bond_info->rlb_rebalance = 0;
 			rlb_rebalance(bond);
 		}
@@ -1490,28 +1397,23 @@
 		}
 	}
 
+re_arm:
+	mod_timer(&(bond_info->alb_timer), jiffies + alb_delta_in_ticks);
 out:
 	read_unlock(&bond->lock);
-
-	if (bond->device->flags & IFF_UP) {
-		/* re-arm the timer */
-		mod_timer(&(bond_info->alb_timer),
-			jiffies + (HZ/ALB_TIMER_TICKS_PER_SEC));
-	}
 }
 
-/* assumption: called before the slave is attched to the bond
+/* assumption: called before the slave is attached to the bond
  * and not locked by the bond lock
  */
-int
-bond_alb_init_slave(struct bonding *bond, struct slave *slave)
+int bond_alb_init_slave(struct bonding *bond, struct slave *slave)
 {
-	int err = 0;
+	int res;
 
-	err = alb_set_slave_mac_addr(slave, slave->perm_hwaddr,
+	res = alb_set_slave_mac_addr(slave, slave->perm_hwaddr,
 				     bond->alb_info.rlb_enabled);
-	if (err) {
-		return err;
+	if (res) {
+		return res;
 	}
 
 	/* caller must hold the bond lock for write since the mac addresses
@@ -1519,12 +1421,12 @@
 	 */
 	write_lock_bh(&bond->lock);
 
-	err = alb_handle_addr_collision_on_attach(bond, slave);
+	res = alb_handle_addr_collision_on_attach(bond, slave);
 
 	write_unlock_bh(&bond->lock);
 
-	if (err) {
-		return err;
+	if (res) {
+		return res;
 	}
 
 	tlb_init_slave(slave);
@@ -1540,8 +1442,7 @@
 }
 
 /* Caller must hold bond lock for write */
-void
-bond_alb_deinit_slave(struct bonding *bond, struct slave *slave)
+void bond_alb_deinit_slave(struct bonding *bond, struct slave *slave)
 {
 	if (bond->slave_cnt > 1) {
 		alb_change_hw_addr_on_detach(bond, slave);
@@ -1556,9 +1457,7 @@
 }
 
 /* Caller must hold bond lock for read */
-void
-bond_alb_handle_link_change(struct bonding *bond, struct slave *slave,
-			    char link)
+void bond_alb_handle_link_change(struct bonding *bond, struct slave *slave, char link)
 {
 	struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond));
 
@@ -1582,109 +1481,111 @@
 }
 
 /**
- * bond_alb_assign_current_slave - assign new current_slave
+ * bond_alb_handle_active_change - assign new curr_active_slave
  * @bond: our bonding struct
  * @new_slave: new slave to assign
  *
- * Set the bond->current_slave to @new_slave and handle
+ * Set the bond->curr_active_slave to @new_slave and handle
  * mac address swapping and promiscuity changes as needed.
  *
- * Caller must hold bond ptrlock for write (or bond lock for write)
+ * Caller must hold bond curr_slave_lock for write (or bond lock for write)
  */
-void
-bond_alb_assign_current_slave(struct bonding *bond, struct slave *new_slave)
+void bond_alb_handle_active_change(struct bonding *bond, struct slave *new_slave)
 {
-	struct slave *swap_slave = bond->current_slave;
+	struct slave *swap_slave;
+	int i;
 
-	if (bond->current_slave == new_slave) {
+	if (bond->curr_active_slave == new_slave) {
 		return;
 	}
 
-	if (bond->current_slave && bond->alb_info.primary_is_promisc) {
-		dev_set_promiscuity(bond->current_slave->dev, -1);
+	if (bond->curr_active_slave && bond->alb_info.primary_is_promisc) {
+		dev_set_promiscuity(bond->curr_active_slave->dev, -1);
 		bond->alb_info.primary_is_promisc = 0;
 		bond->alb_info.rlb_promisc_timeout_counter = 0;
 	}
 
-	bond->current_slave = new_slave;
+	swap_slave = bond->curr_active_slave;
+	bond->curr_active_slave = new_slave;
 
 	if (!new_slave || (bond->slave_cnt == 0)) {
 		return;
 	}
 
-	/* set the new current_slave to the bonds mac address
-	 * i.e. swap mac addresses of old current_slave and new current_slave
+	/* set the new curr_active_slave to the bonds mac address
+	 * i.e. swap mac addresses of old curr_active_slave and new curr_active_slave
 	 */
 	if (!swap_slave) {
+		struct slave *tmp_slave;
 		/* find slave that is holding the bond's mac address */
-		swap_slave = bond_get_first_slave(bond);
-		while (swap_slave) {
-			if (!memcmp(swap_slave->dev->dev_addr,
-				bond->device->dev_addr, ETH_ALEN)) {
+		bond_for_each_slave(bond, tmp_slave, i) {
+			if (!memcmp(tmp_slave->dev->dev_addr,
+				    bond->dev->dev_addr, ETH_ALEN)) {
+				swap_slave = tmp_slave;
 				break;
 			}
-			swap_slave = bond_get_next_slave(bond, swap_slave);
 		}
 	}
 
-	/* current_slave must be set before calling alb_swap_mac_addr */
+	/* curr_active_slave must be set before calling alb_swap_mac_addr */
 	if (swap_slave) {
 		/* swap mac address */
 		alb_swap_mac_addr(bond, swap_slave, new_slave);
 	} else {
 		/* set the new_slave to the bond mac address */
-		alb_set_slave_mac_addr(new_slave, bond->device->dev_addr,
+		alb_set_slave_mac_addr(new_slave, bond->dev->dev_addr,
 				       bond->alb_info.rlb_enabled);
 		/* fasten bond mac on new current slave */
-		alb_send_learning_packets(new_slave, bond->device->dev_addr);
+		alb_send_learning_packets(new_slave, bond->dev->dev_addr);
 	}
 }
 
-int
-bond_alb_set_mac_address(struct net_device *dev, void *addr)
+int bond_alb_set_mac_address(struct net_device *bond_dev, void *addr)
 {
-	struct bonding *bond = dev->priv;
+	struct bonding *bond = bond_dev->priv;
 	struct sockaddr *sa = addr;
-	struct slave *swap_slave = NULL;
-	int error = 0;
+	struct slave *slave, *swap_slave;
+	int res;
+	int i;
 
 	if (!is_valid_ether_addr(sa->sa_data)) {
 		return -EADDRNOTAVAIL;
 	}
 
-	error = alb_set_mac_address(bond, addr);
-	if (error) {
-		return error;
+	res = alb_set_mac_address(bond, addr);
+	if (res) {
+		return res;
 	}
 
-	memcpy(dev->dev_addr, sa->sa_data, dev->addr_len);
+	memcpy(bond_dev->dev_addr, sa->sa_data, bond_dev->addr_len);
 
-	/* If there is no current_slave there is nothing else to do.
+	/* If there is no curr_active_slave there is nothing else to do.
 	 * Otherwise we'll need to pass the new address to it and handle
 	 * duplications.
 	 */
-	if (bond->current_slave == NULL) {
+	if (!bond->curr_active_slave) {
 		return 0;
 	}
 
-	swap_slave = bond_get_first_slave(bond);
-	while (swap_slave) {
-		if (!memcmp(swap_slave->dev->dev_addr, dev->dev_addr, ETH_ALEN)) {
+	swap_slave = NULL;
+
+	bond_for_each_slave(bond, slave, i) {
+		if (!memcmp(slave->dev->dev_addr, bond_dev->dev_addr, ETH_ALEN)) {
+			swap_slave = slave;
 			break;
 		}
-		swap_slave = bond_get_next_slave(bond, swap_slave);
 	}
 
 	if (swap_slave) {
-		alb_swap_mac_addr(bond, swap_slave, bond->current_slave);
+		alb_swap_mac_addr(bond, swap_slave, bond->curr_active_slave);
 	} else {
-		alb_set_slave_mac_addr(bond->current_slave, dev->dev_addr,
+		alb_set_slave_mac_addr(bond->curr_active_slave, bond_dev->dev_addr,
 				       bond->alb_info.rlb_enabled);
 
-		alb_send_learning_packets(bond->current_slave, dev->dev_addr);
+		alb_send_learning_packets(bond->curr_active_slave, bond_dev->dev_addr);
 		if (bond->alb_info.rlb_enabled) {
 			/* inform clients mac address has changed */
-			rlb_req_update_slave_clients(bond, bond->current_slave);
+			rlb_req_update_slave_clients(bond, bond->curr_active_slave);
 		}
 	}
 
--- diff/drivers/net/bonding/bond_alb.h	2003-09-30 15:46:15.000000000 +0100
+++ source/drivers/net/bonding/bond_alb.h	2004-02-09 10:39:53.000000000 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright(c) 1999 - 2003 Intel Corporation. All rights reserved.
+ * Copyright(c) 1999 - 2004 Intel Corporation. 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
@@ -24,6 +24,9 @@
  * 2003/08/06 - Amir Noam <amir.noam at intel dot com>
  *	- Add support for setting bond's MAC address with special
  *	  handling required for ALB/TLB.
+ *
+ * 2003/12/01 - Shmulik Hen <shmulik.hen at intel dot com>
+ *	- Code cleanup and style changes
  */
 
 #ifndef __BOND_ALB_H__
@@ -126,10 +129,10 @@
 int bond_alb_init_slave(struct bonding *bond, struct slave *slave);
 void bond_alb_deinit_slave(struct bonding *bond, struct slave *slave);
 void bond_alb_handle_link_change(struct bonding *bond, struct slave *slave, char link);
-void bond_alb_assign_current_slave(struct bonding *bond, struct slave *new_slave);
-int bond_alb_xmit(struct sk_buff *skb, struct net_device *dev);
+void bond_alb_handle_active_change(struct bonding *bond, struct slave *new_slave);
+int bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev);
 void bond_alb_monitor(struct bonding *bond);
-int bond_alb_set_mac_address(struct net_device *dev, void *addr);
+int bond_alb_set_mac_address(struct net_device *bond_dev, void *addr);
 
 #endif /* __BOND_ALB_H__ */
 
--- diff/drivers/net/bonding/bond_main.c	2004-01-19 10:22:57.000000000 +0000
+++ source/drivers/net/bonding/bond_main.c	2004-02-09 10:39:53.000000000 +0000
@@ -1,7 +1,7 @@
 /*
  * originally based on the dummy device.
  *
- * Copyright 1999, Thomas Davis, tadavis@lbl.gov.  
+ * Copyright 1999, Thomas Davis, tadavis@lbl.gov.
  * Licensed under the GPL. Based on dummy.c, and eql.c devices.
  *
  * bonding.c: an Ethernet Bonding driver
@@ -15,9 +15,9 @@
  *
  * How it works:
  *    ifconfig bond0 ipaddress netmask up
- *      will setup a network device, with an ip address.  No mac address 
- *	will be assigned at this time.  The hw mac address will come from 
- *	the first slave bonded to the channel.  All slaves will then use 
+ *      will setup a network device, with an ip address.  No mac address
+ *	will be assigned at this time.  The hw mac address will come from
+ *	the first slave bonded to the channel.  All slaves will then use
  *	this hw mac address.
  *
  *    ifconfig bond0 down
@@ -26,7 +26,7 @@
  *    ifenslave bond0 eth0
  *	will attach eth0 to bond0 as a slave.  eth0 hw mac address will either
  *	a: be used as initial mac address
- *	b: if a hw mac address already is there, eth0's hw mac address 
+ *	b: if a hw mac address already is there, eth0's hw mac address
  *	   will then be set from bond0.
  *
  * v0.1 - first working version.
@@ -93,14 +93,14 @@
  *
  * 2001/4/5 - Chad N. Tindel <ctindel at ieee dot org>
  *     - Ported to 2.4 Kernel
- * 
+ *
  * 2001/5/2 - Jeffrey E. Mast <jeff at mastfamily dot com>
  *     - When a device is detached from a bond, the slave device is no longer
  *       left thinking that is has a master.
  *
  * 2001/5/16 - Jeffrey E. Mast <jeff at mastfamily dot com>
- *     - memset did not appropriately initialized the bond rw_locks. Used 
- *       rwlock_init to initialize to unlocked state to prevent deadlock when 
+ *     - memset did not appropriately initialized the bond rw_locks. Used
+ *       rwlock_init to initialize to unlocked state to prevent deadlock when
  *       first attempting a lock
  *     - Called SET_MODULE_OWNER for bond device
  *
@@ -119,7 +119,7 @@
  *
  * 2001/6/01 - Chad N. Tindel <ctindel at ieee dot org>
  *     - Added /proc support for getting bond and slave information.
- *       Information is in /proc/net/<bond device>/info. 
+ *       Information is in /proc/net/<bond device>/info.
  *     - Changed the locking when calling bond_close to prevent deadlock.
  *
  * 2001/8/05 - Janice Girouard <girouard at us.ibm.com>
@@ -144,8 +144,8 @@
  *       but only for an up link.
  *
  * 2001/9/20 - Chad N. Tindel <ctindel at ieee dot org>
- *     - Add the device field to bonding_t.  Previously the net_device 
- *       corresponding to a bond wasn't available from the bonding_t 
+ *     - Add the device field to bonding_t.  Previously the net_device
+ *       corresponding to a bond wasn't available from the bonding_t
  *       structure.
  *
  * 2001/9/25 - Janice Girouard <girouard at us.ibm.com>
@@ -155,10 +155,10 @@
  *     - Various memory leak fixes
  *
  * 2001/11/5 - Mark Huth <mark dot huth at mvista dot com>
- *     - Don't take rtnl lock in bond_mii_monitor as it deadlocks under 
- *       certain hotswap conditions.  
+ *     - Don't take rtnl lock in bond_mii_monitor as it deadlocks under
+ *       certain hotswap conditions.
  *       Note:  this same change may be required in bond_arp_monitor ???
- *     - Remove possibility of calling bond_sethwaddr with NULL slave_dev ptr 
+ *     - Remove possibility of calling bond_sethwaddr with NULL slave_dev ptr
  *     - Handle hot swap ethernet interface deregistration events to remove
  *       kernel oops following hot swap of enslaved interface
  *
@@ -222,23 +222,23 @@
  *     - fix deletion of multicast groups after unloading module
  *
  * 2002/11/06 - Kameshwara Rayaprolu <kameshwara.rao * wipro_com>
- *     - Changes to prevent panic from closing the device twice; if we close 
- *       the device in bond_release, we must set the original_flags to down 
+ *     - Changes to prevent panic from closing the device twice; if we close
+ *       the device in bond_release, we must set the original_flags to down
  *       so it won't be closed again by the network layer.
  *
  * 2002/11/07 - Tony Cureington <tony.cureington * hp_com>
  *     - Fix arp_target_hw_addr memory leak
- *     - Created activebackup_arp_monitor function to handle arp monitoring 
- *       in active backup mode - the bond_arp_monitor had several problems... 
- *       such as allowing slaves to tx arps sequentially without any delay 
+ *     - Created activebackup_arp_monitor function to handle arp monitoring
+ *       in active backup mode - the bond_arp_monitor had several problems...
+ *       such as allowing slaves to tx arps sequentially without any delay
  *       for a response
  *     - Renamed bond_arp_monitor to loadbalance_arp_monitor and re-wrote
  *       this function to just handle arp monitoring in load-balancing mode;
  *       it is a lot more compact now
- *     - Changes to ensure one and only one slave transmits in active-backup 
+ *     - Changes to ensure one and only one slave transmits in active-backup
  *       mode
- *     - Robustesize parameters; warn users about bad combinations of 
- *       parameters; also if miimon is specified and a network driver does 
+ *     - Robustesize parameters; warn users about bad combinations of
+ *       parameters; also if miimon is specified and a network driver does
  *       not support MII or ETHTOOL, inform the user of this
  *     - Changes to support link_failure_count when in arp monitoring mode
  *     - Fix up/down delay reported in /proc
@@ -248,7 +248,7 @@
  *
  * 2002/11/16 - Laurent Deniel <laurent.deniel at free.fr>
  *     - fix multicast handling in activebackup_arp_monitor
- *     - remove one unnecessary and confusing current_slave == slave test 
+ *     - remove one unnecessary and confusing curr_active_slave == slave test
  *	 in activebackup_arp_monitor
  *
  *  2002/11/17 - Laurent Deniel <laurent.deniel at free.fr>
@@ -267,7 +267,7 @@
  *	  One change: an invalid choice will cause module load failure,
  *	  rather than the previous behavior of just picking one.
  *	- Minor cleanups; got rid of dup ctype stuff, atoi function
- * 
+ *
  * 2003/02/07 - Jay Vosburgh <fubar at us dot ibm dot com>
  *	- Added use_carrier module parameter that causes miimon to
  *	  use netif_carrier_ok() test instead of MII/ETHTOOL ioctls.
@@ -330,7 +330,7 @@
  *	  new/old ifenslave and new/old bonding.
  *
  * 2003/05/01 - Shmulik Hen <shmulik.hen at intel dot com>
- *	- Fixed bug in bond_release_all(): save old value of current_slave
+ *	- Fixed bug in bond_release_all(): save old value of curr_active_slave
  *	  before setting it to NULL.
  *	- Changed driver versioning scheme to include version number instead
  *	  of release date (that is already in another field). There are 3
@@ -358,7 +358,7 @@
  *
  * 2003/05/01 - Shmulik Hen <shmulik.hen at intel dot com>
  *	- Added support for Transmit load balancing mode.
- *	- Concentrate all assignments of current_slave to a single point
+ *	- Concentrate all assignments of curr_active_slave to a single point
  *	  so specific modes can take actions when the primary adapter is
  *	  changed.
  *	- Take the updelay parameter into consideration during bond_enslave
@@ -426,8 +426,45 @@
  *	- Convert /proc to seq_file interface.
  *	  Change /proc/net/bondX/info to /proc/net/bonding/bondX.
  *	  Set version to 2.4.1.
+ *
+ * 2003/11/20 - Amir Noam <amir.noam at intel dot com>
+ *	- Fix /proc creation/destruction.
+ *
+ * 2003/12/01 - Shmulik Hen <shmulik.hen at intel dot com>
+ *	- Massive cleanup - Set version to 2.5.0
+ *	  Code changes:
+ *	  o Consolidate format of prints and debug prints.
+ *	  o Remove bonding_t/slave_t typedefs and consolidate all casts.
+ *	  o Remove dead code and unnecessary checks.
+ *	  o Consolidate starting/stopping timers.
+ *	  o Consolidate handling of primary module param throughout the code.
+ *	  o Removed multicast module param support - all settings are done
+ *	    according to mode.
+ *	  o Slave list iteration - bond is no longer part of the list,
+ *	    added cyclic list iteration macros.
+ *	  o Consolidate error handling in all xmit functions.
+ *	  Style changes:
+ *	  o Consolidate function naming and declarations.
+ *	  o Consolidate function params and local variables names.
+ *	  o Consolidate return values.
+ *	  o Consolidate curly braces.
+ *	  o Consolidate conditionals format.
+ *	  o Change struct member names and types.
+ *	  o Chomp trailing spaces, remove empty lines, fix indentations.
+ *	  o Re-organize code according to context.
+ *
+ * 2003/12/30 - Amir Noam <amir.noam at intel dot com>
+ *	- Fixed: Cannot remove and re-enslave the original active slave.
+ *	- Fixed: Releasing the original active slave causes mac address duplication.
+ *	- Add support for slaves that use ethtool_ops.
+ *	  Set version to 2.5.3.
+ *
+ * 2004/01/05 - Amir Noam <amir.noam at intel dot com>
+ *	- Save bonding parameters per bond instead of using the global values.
  */
 
+//#define BONDING_DEBUG 1
+
 #include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
@@ -452,7 +489,6 @@
 #include <asm/dma.h>
 #include <asm/uaccess.h>
 #include <linux/errno.h>
-
 #include <linux/netdevice.h>
 #include <linux/inetdevice.h>
 #include <linux/etherdevice.h>
@@ -461,58 +497,71 @@
 #include <linux/rtnetlink.h>
 #include <linux/proc_fs.h>
 #include <linux/seq_file.h>
-
-#include <linux/if_bonding.h>
 #include <linux/smp.h>
 #include <linux/if_ether.h>
 #include <net/arp.h>
 #include <linux/mii.h>
 #include <linux/ethtool.h>
+#include <linux/if_bonding.h>
 #include "bonding.h"
 #include "bond_3ad.h"
 #include "bond_alb.h"
 
-#define DRV_VERSION	"2.4.1"
-#define DRV_RELDATE	"September 15, 2003"
-#define DRV_NAME	"bonding"
-#define DRV_DESCRIPTION	"Ethernet Channel Bonding Driver"
-
-static const char *version =
-DRV_NAME ".c:v" DRV_VERSION " (" DRV_RELDATE ")\n";
+/*---------------------------- Module parameters ----------------------------*/
 
 /* monitor all links that often (in milliseconds). <=0 disables monitoring */
-#ifndef BOND_LINK_MON_INTERV
 #define BOND_LINK_MON_INTERV	0
-#endif
-
-#ifndef BOND_LINK_ARP_INTERV
 #define BOND_LINK_ARP_INTERV	0
-#endif
 
-#ifndef MAX_ARP_IP_TARGETS
-#define MAX_ARP_IP_TARGETS 16
-#endif
+static int max_bonds	= BOND_DEFAULT_MAX_BONDS;
+static int miimon	= BOND_LINK_MON_INTERV;
+static int updelay	= 0;
+static int downdelay	= 0;
+static int use_carrier	= 1;
+static char *mode	= NULL;
+static char *primary	= NULL;
+static char *lacp_rate	= NULL;
+static int arp_interval = BOND_LINK_ARP_INTERV;
+static char *arp_ip_target[BOND_MAX_ARP_TARGETS] = { NULL, };
+
+MODULE_PARM(max_bonds, "i");
+MODULE_PARM_DESC(max_bonds, "Max number of bonded devices");
+MODULE_PARM(miimon, "i");
+MODULE_PARM_DESC(miimon, "Link check interval in milliseconds");
+MODULE_PARM(updelay, "i");
+MODULE_PARM_DESC(updelay, "Delay before considering link up, in milliseconds");
+MODULE_PARM(downdelay, "i");
+MODULE_PARM_DESC(downdelay, "Delay before considering link down, in milliseconds");
+MODULE_PARM(use_carrier, "i");
+MODULE_PARM_DESC(use_carrier, "Use netif_carrier_ok (vs MII ioctls) in miimon; 0 for off, 1 for on (default)");
+MODULE_PARM(mode, "s");
+MODULE_PARM_DESC(mode, "Mode of operation : 0 for round robin, 1 for active-backup, 2 for xor");
+MODULE_PARM(primary, "s");
+MODULE_PARM_DESC(primary, "Primary network device to use");
+MODULE_PARM(lacp_rate, "s");
+MODULE_PARM_DESC(lacp_rate, "LACPDU tx rate to request from 802.3ad partner (slow/fast)");
+MODULE_PARM(arp_interval, "i");
+MODULE_PARM_DESC(arp_interval, "arp interval in milliseconds");
+MODULE_PARM(arp_ip_target, "1-" __MODULE_STRING(BOND_MAX_ARP_TARGETS) "s");
+MODULE_PARM_DESC(arp_ip_target, "arp targets in n.n.n.n form");
 
-#define USES_PRIMARY(mode) \
-		(((mode) == BOND_MODE_ACTIVEBACKUP) || \
-		 ((mode) == BOND_MODE_TLB) || \
-		 ((mode) == BOND_MODE_ALB))
+/*----------------------------- Global variables ----------------------------*/
 
-struct bond_parm_tbl {
-	char *modename;
-	int mode;
-};
+static const char *version =
+	DRV_DESCRIPTION ": v" DRV_VERSION " (" DRV_RELDATE ")\n";
 
-static int arp_interval = BOND_LINK_ARP_INTERV;
-static char *arp_ip_target[MAX_ARP_IP_TARGETS] = { NULL, };
-static u32 arp_target[MAX_ARP_IP_TARGETS] = { 0, } ;
-static int arp_ip_count = 0;
-static u32 my_ip = 0;
-char *arp_target_hw_addr = NULL;
+static LIST_HEAD(bond_dev_list);
 
-static char *primary= NULL;
+#ifdef CONFIG_PROC_FS
+static struct proc_dir_entry *bond_proc_dir = NULL;
+#endif
 
-static int app_abi_ver = 0;
+static u32 arp_target[BOND_MAX_ARP_TARGETS] = { 0, } ;
+static int arp_ip_count	= 0;
+static u32 my_ip	= 0;
+static int bond_mode	= BOND_MODE_ROUNDROBIN;
+static int lacp_fast	= 0;
+static int app_abi_ver	= 0;
 static int orig_app_abi_ver = -1; /* This is used to save the first ABI version
 				   * we receive from the application. Once set,
 				   * it won't be changed, and the module will
@@ -521,14 +570,16 @@
 				   * another ABI version.
 				   */
 
-static int max_bonds	= BOND_DEFAULT_MAX_BONDS;
-static int miimon	= BOND_LINK_MON_INTERV;
-static int use_carrier	= 1;
-static int bond_mode	= BOND_MODE_ROUNDROBIN;
-static int updelay	= 0;
-static int downdelay	= 0;
+struct bond_parm_tbl {
+	char *modename;
+	int mode;
+};
 
-static char *mode	= NULL;
+static struct bond_parm_tbl bond_lacp_tbl[] = {
+{	"slow",		AD_LACP_SLOW},
+{	"fast",		AD_LACP_FAST},
+{	NULL,		-1},
+};
 
 static struct bond_parm_tbl bond_mode_tbl[] = {
 {	"balance-rr",		BOND_MODE_ROUNDROBIN},
@@ -541,103 +592,15 @@
 {	NULL,			-1},
 };
 
-static int multicast_mode	= BOND_MULTICAST_ALL;
-static char *multicast		= NULL;
-
-static struct bond_parm_tbl bond_mc_tbl[] = {
-{	"disabled",		BOND_MULTICAST_DISABLED},
-{	"active",		BOND_MULTICAST_ACTIVE},
-{	"all",			BOND_MULTICAST_ALL},
-{	NULL,			-1},
-};
-
-static int lacp_fast		= 0;
-static char *lacp_rate		= NULL;
-
-static struct bond_parm_tbl bond_lacp_tbl[] = {
-{	"slow",		AD_LACP_SLOW},
-{	"fast",		AD_LACP_FAST},
-{	NULL,		-1},
-};
-
-static LIST_HEAD(bond_dev_list);
-#ifdef CONFIG_PROC_FS
-static struct proc_dir_entry *bond_proc_dir = NULL;
-#endif
+/*-------------------------- Forward declarations ---------------------------*/
 
-MODULE_PARM(max_bonds, "i");
-MODULE_PARM_DESC(max_bonds, "Max number of bonded devices");
-MODULE_PARM(miimon, "i");
-MODULE_PARM_DESC(miimon, "Link check interval in milliseconds");
-MODULE_PARM(use_carrier, "i");
-MODULE_PARM_DESC(use_carrier, "Use netif_carrier_ok (vs MII ioctls) in miimon; 0 for off, 1 for on (default)");
-MODULE_PARM(mode, "s");
-MODULE_PARM_DESC(mode, "Mode of operation : 0 for round robin, 1 for active-backup, 2 for xor");
-MODULE_PARM(arp_interval, "i");
-MODULE_PARM_DESC(arp_interval, "arp interval in milliseconds");
-MODULE_PARM(arp_ip_target, "1-" __MODULE_STRING(MAX_ARP_IP_TARGETS) "s");
-MODULE_PARM_DESC(arp_ip_target, "arp targets in n.n.n.n form");
-MODULE_PARM(updelay, "i");
-MODULE_PARM_DESC(updelay, "Delay before considering link up, in milliseconds");
-MODULE_PARM(downdelay, "i");
-MODULE_PARM_DESC(downdelay, "Delay before considering link down, in milliseconds");
-MODULE_PARM(primary, "s");
-MODULE_PARM_DESC(primary, "Primary network device to use");
-MODULE_PARM(multicast, "s");
-MODULE_PARM_DESC(multicast, "Mode for multicast support : 0 for none, 1 for active slave, 2 for all slaves (default)");
-MODULE_PARM(lacp_rate, "s");
-MODULE_PARM_DESC(lacp_rate, "LACPDU tx rate to request from 802.3ad partner (slow/fast)");
+static inline void bond_set_mode_ops(struct net_device *bond_dev, int mode);
 
-static int bond_xmit_roundrobin(struct sk_buff *skb, struct net_device *dev);
-static int bond_xmit_xor(struct sk_buff *skb, struct net_device *dev);
-static int bond_xmit_activebackup(struct sk_buff *skb, struct net_device *dev);
-static struct net_device_stats *bond_get_stats(struct net_device *dev);
-static void bond_mii_monitor(struct net_device *dev);
-static void loadbalance_arp_monitor(struct net_device *dev);
-static void activebackup_arp_monitor(struct net_device *dev);
-static void bond_mc_list_destroy(struct bonding *bond);
-static void bond_mc_add(bonding_t *bond, void *addr, int alen);
-static void bond_mc_delete(bonding_t *bond, void *addr, int alen);
-static int bond_mc_list_copy (struct dev_mc_list *src, struct bonding *dst, int gpf_flag);
-static inline int dmi_same(struct dev_mc_list *dmi1, struct dev_mc_list *dmi2);
-static void bond_set_promiscuity(bonding_t *bond, int inc);
-static void bond_set_allmulti(bonding_t *bond, int inc);
-static struct dev_mc_list* bond_mc_list_find_dmi(struct dev_mc_list *dmi, struct dev_mc_list *mc_list);
-static void bond_mc_update(bonding_t *bond, slave_t *new, slave_t *old);
-static int bond_enslave(struct net_device *master, struct net_device *slave);
-static int bond_release(struct net_device *master, struct net_device *slave);
-static int bond_release_all(struct net_device *master);
-static int bond_sethwaddr(struct net_device *master, struct net_device *slave);
-static void change_active_interface(struct bonding *bond, struct slave *new);
-static void reselect_active_interface(struct bonding *bond);
-static struct slave *find_best_interface(struct bonding *bond);
-
-
-/* #define BONDING_DEBUG 1 */
-#ifdef BONDING_DEBUG
-#define dprintk(x...) printk(x...)
-#else /* BONDING_DEBUG */
-#define dprintk(x...) do {} while (0)
-#endif /* BONDING_DEBUG */
-
-/* several macros */
-
-static void arp_send_all(slave_t *slave)
-{	
-	int i; 
-
-	for (i = 0; (i<MAX_ARP_IP_TARGETS) && arp_target[i]; i++) { 
-		arp_send(ARPOP_REQUEST, ETH_P_ARP, arp_target[i], slave->dev, 
-			 my_ip, arp_target_hw_addr, slave->dev->dev_addr,
-			 arp_target_hw_addr); 
-	} 
-}
- 
+/*---------------------------- General routines -----------------------------*/
 
-static const char *
-bond_mode_name(void)
+static const char *bond_mode_name(int mode)
 {
-	switch (bond_mode) {
+	switch (mode) {
 	case BOND_MODE_ROUNDROBIN :
 		return "load balancing (round-robin)";
 	case BOND_MODE_ACTIVEBACKUP :
@@ -657,149 +620,7 @@
 	}
 }
 
-static const char *
-multicast_mode_name(void)
-{
-	switch(multicast_mode) {
-	case BOND_MULTICAST_DISABLED :
-		return "disabled";
-	case BOND_MULTICAST_ACTIVE :
-		return "active slave only";
-	case BOND_MULTICAST_ALL :
-		return "all slaves";
-	default :
-		return "unknown";
-	}
-}
-
-void bond_set_slave_inactive_flags(slave_t *slave)
-{
-	slave->state = BOND_STATE_BACKUP;
-	slave->dev->flags |= IFF_NOARP;
-}
-
-void bond_set_slave_active_flags(slave_t *slave)
-{
-	slave->state = BOND_STATE_ACTIVE;
-	slave->dev->flags &= ~IFF_NOARP;
-}
-
-/*
- * This function counts and verifies the the number of attached
- * slaves, checking the count against the expected value (given that incr
- * is either 1 or -1, for add or removal of a slave).  Only
- * bond_xmit_xor() uses the slave_cnt value, but this is still a good
- * consistency check.
- */
-static inline void
-update_slave_cnt(bonding_t *bond, int incr)
-{
-	slave_t *slave = NULL;
-	int expect = bond->slave_cnt + incr;
-
-	bond->slave_cnt = 0;
-	for (slave = bond->prev; slave != (slave_t*)bond;
-	     slave = slave->prev) {
-		bond->slave_cnt++;
-	}
-
-	if (expect != bond->slave_cnt)
-		BUG();
-}
-
-/* 
- * This function detaches the slave <slave> from the list <bond>.
- * WARNING: no check is made to verify if the slave effectively
- * belongs to <bond>. It returns <slave> in case it's needed.
- * Nothing is freed on return, structures are just unchained.
- * If the bond->current_slave pointer was pointing to <slave>,
- * it should be changed by the calling function.
- *
- * bond->lock held for writing by caller.
- */
-static slave_t *
-bond_detach_slave(bonding_t *bond, slave_t *slave)
-{
-	if ((bond == NULL) || (slave == NULL) ||
-	   ((void *)bond == (void *)slave)) {
-		printk(KERN_ERR
-			"bond_detach_slave(): trying to detach "
-			"slave %p from bond %p\n", bond, slave);
-		return slave;
-	}
-
-	if (bond->next == slave) {  /* is the slave at the head ? */
-		if (bond->prev == slave) {  /* is the slave alone ? */
-			bond->prev = bond->next = (slave_t *)bond;
-		} else { /* not alone */
-			bond->next        = slave->next;
-			slave->next->prev = (slave_t *)bond;
-			bond->prev->next  = slave->next;
-		}
-	} else {
-		slave->prev->next = slave->next;
-		if (bond->prev == slave) {  /* is this slave the last one ? */
-			bond->prev = slave->prev;
-		} else {
-			slave->next->prev = slave->prev;
-		}
-	}
-
-	update_slave_cnt(bond, -1);
-
-	return slave;
-}
-
-/*
- * This function attaches the slave <slave> to the list <bond>.
- *
- * bond->lock held for writing by caller.
- */
-static void
-bond_attach_slave(struct bonding *bond, struct slave *new_slave)
-{
-	/* 
-	 * queue to the end of the slaves list, make the first element its
-	 * successor, the last one its predecessor, and make it the bond's
-	 * predecessor. 
-	 *
-	 * Just to clarify, so future bonding driver hackers don't go through
-	 * the same confusion stage I did trying to figure this out, the
-	 * slaves are stored in a double linked circular list, sortof.
-	 * In the ->next direction, the last slave points to the first slave,
-	 * bypassing bond; only the slaves are in the ->next direction.
-	 * In the ->prev direction, however, the first slave points to bond
-	 * and bond points to the last slave.
-	 *
-	 * It looks like a circle with a little bubble hanging off one side
-	 * in the ->prev direction only.
-	 *
-	 * When going through the list once, its best to start at bond->prev
-	 * and go in the ->prev direction, testing for bond.  Doing this
-	 * in the ->next direction doesn't work.  Trust me, I know this now.
-	 * :)  -mts 2002.03.14
-	 */
-	new_slave->prev       = bond->prev;
-	new_slave->prev->next = new_slave;
-	bond->prev            = new_slave;
-	new_slave->next       = bond->next;
-
-	update_slave_cnt(bond, 1);
-}
-
-
-/*
- * Less bad way to call ioctl from within the kernel; this needs to be
- * done some other way to get the call out of interrupt context.
- * Needs "ioctl" variable to be supplied by calling context.
- */
-#define IOCTL(dev, arg, cmd) ({		\
-	int ret;			\
-	mm_segment_t fs = get_fs();	\
-	set_fs(get_ds());		\
-	ret = ioctl(dev, arg, cmd);	\
-	set_fs(fs);			\
-	ret; })
+/*------------------------------- Link status -------------------------------*/
 
 /*
  * Get link speed and duplex from the slave's base driver
@@ -809,52 +630,63 @@
  */
 static int bond_update_speed_duplex(struct slave *slave)
 {
-	struct net_device *dev = slave->dev;
+	struct net_device *slave_dev = slave->dev;
 	static int (* ioctl)(struct net_device *, struct ifreq *, int);
 	struct ifreq ifr;
 	struct ethtool_cmd etool;
 
-	ioctl = dev->do_ioctl;
-	if (ioctl) {
-		etool.cmd = ETHTOOL_GSET;
-		ifr.ifr_data = (char*)&etool;
-		if (IOCTL(dev, &ifr, SIOCETHTOOL) == 0) {
-			slave->speed = etool.speed;
-			slave->duplex = etool.duplex;
-		} else {
-			goto err_out;
+	/* Fake speed and duplex */
+	slave->speed = SPEED_100;
+	slave->duplex = DUPLEX_FULL;
+
+	if (slave_dev->ethtool_ops) {
+		u32 res;
+
+		if (!slave_dev->ethtool_ops->get_settings) {
+			return -1;
 		}
-	} else {
-		goto err_out;
+
+		res = slave_dev->ethtool_ops->get_settings(slave_dev, &etool);
+		if (res < 0) {
+			return -1;
+		}
+
+		goto verify;
 	}
 
-	switch (slave->speed) {
-		case SPEED_10:
-		case SPEED_100:
-		case SPEED_1000:
-			break;
-		default:
-			goto err_out;
+	ioctl = slave_dev->do_ioctl;
+	strncpy(ifr.ifr_name, slave_dev->name, IFNAMSIZ);
+	etool.cmd = ETHTOOL_GSET;
+	ifr.ifr_data = (char*)&etool;
+	if (!ioctl || (IOCTL(slave_dev, &ifr, SIOCETHTOOL) < 0)) {
+		return -1;
+	}
+
+verify:
+	switch (etool.speed) {
+	case SPEED_10:
+	case SPEED_100:
+	case SPEED_1000:
+		break;
+	default:
+		return -1;
 	}
 
-	switch (slave->duplex) {
-		case DUPLEX_FULL:
-		case DUPLEX_HALF:
-			break;
-		default:
-			goto err_out;
+	switch (etool.duplex) {
+	case DUPLEX_FULL:
+	case DUPLEX_HALF:
+		break;
+	default:
+		return -1;
 	}
 
-	return 0;
+	slave->speed = etool.speed;
+	slave->duplex = etool.duplex;
 
-err_out:
-	/* Fake speed and duplex */
-	slave->speed = SPEED_100;
-	slave->duplex = DUPLEX_FULL;
-	return -1;
+	return 0;
 }
 
-/* 
+/*
  * if <dev> supports MII link status reporting, check its link status.
  *
  * We either do MII/ETHTOOL ioctls, or check netif_carrier_ok(),
@@ -870,19 +702,18 @@
  * It'd be nice if there was a good way to tell if a driver supports
  * netif_carrier, but there really isn't.
  */
-static int
-bond_check_dev_link(struct net_device *dev, int reporting)
+static int bond_check_dev_link(struct bonding *bond, struct net_device *slave_dev, int reporting)
 {
 	static int (* ioctl)(struct net_device *, struct ifreq *, int);
 	struct ifreq ifr;
 	struct mii_ioctl_data *mii;
 	struct ethtool_value etool;
 
-	if (use_carrier) {
-		return netif_carrier_ok(dev) ? BMSR_LSTATUS : 0;
+	if (bond->params.use_carrier) {
+		return netif_carrier_ok(slave_dev) ? BMSR_LSTATUS : 0;
 	}
 
-	ioctl = dev->do_ioctl;
+	ioctl = slave_dev->do_ioctl;
 	if (ioctl) {
 		/* TODO: set pointer to correct ioctl on a per team member */
 		/*       bases to make this more efficient. that is, once  */
@@ -897,477 +728,509 @@
 		 */
 
 		/* Yes, the mii is overlaid on the ifreq.ifr_ifru */
+		strncpy(ifr.ifr_name, slave_dev->name, IFNAMSIZ);
 		mii = (struct mii_ioctl_data *)&ifr.ifr_data;
-		if (IOCTL(dev, &ifr, SIOCGMIIPHY) == 0) {
+		if (IOCTL(slave_dev, &ifr, SIOCGMIIPHY) == 0) {
 			mii->reg_num = MII_BMSR;
-			if (IOCTL(dev, &ifr, SIOCGMIIREG) == 0) {
-				return mii->val_out & BMSR_LSTATUS;
+			if (IOCTL(slave_dev, &ifr, SIOCGMIIREG) == 0) {
+				return (mii->val_out & BMSR_LSTATUS);
 			}
 		}
+	}
+
+	/* try SIOCETHTOOL ioctl, some drivers cache ETHTOOL_GLINK */
+	/* for a period of time so we attempt to get link status   */
+	/* from it last if the above MII ioctls fail...            */
+	if (slave_dev->ethtool_ops) {
+		if (slave_dev->ethtool_ops->get_link) {
+			u32 link;
+
+			link = slave_dev->ethtool_ops->get_link(slave_dev);
+
+			return link ? BMSR_LSTATUS : 0;
+		}
+	}
 
-		/* try SIOCETHTOOL ioctl, some drivers cache ETHTOOL_GLINK */
-		/* for a period of time so we attempt to get link status   */
-		/* from it last if the above MII ioctls fail...            */
-	        etool.cmd = ETHTOOL_GLINK;
-	        ifr.ifr_data = (char*)&etool;
-		if (IOCTL(dev, &ifr, SIOCETHTOOL) == 0) {
+	if (ioctl) {
+		strncpy(ifr.ifr_name, slave_dev->name, IFNAMSIZ);
+		etool.cmd = ETHTOOL_GLINK;
+		ifr.ifr_data = (char*)&etool;
+		if (IOCTL(slave_dev, &ifr, SIOCETHTOOL) == 0) {
 			if (etool.data == 1) {
 				return BMSR_LSTATUS;
-			} else { 
-#ifdef BONDING_DEBUG
-				printk(KERN_INFO 
-					":: SIOCETHTOOL shows link down \n");
-#endif
+			} else {
+				dprintk("SIOCETHTOOL shows link down\n");
 				return 0;
-			} 
+			}
 		}
-
 	}
- 
+
 	/*
 	 * If reporting, report that either there's no dev->do_ioctl,
 	 * or both SIOCGMIIREG and SIOCETHTOOL failed (meaning that we
 	 * cannot report link status).  If not reporting, pretend
 	 * we're ok.
 	 */
-	return reporting ? -1 : BMSR_LSTATUS;
+	return (reporting ? -1 : BMSR_LSTATUS);
 }
 
-static u16 bond_check_mii_link(bonding_t *bond)
-{
-	int has_active_interface = 0;
-
-	read_lock_bh(&bond->lock);
-	read_lock(&bond->ptrlock);
-	has_active_interface = (bond->current_slave != NULL);
-	read_unlock(&bond->ptrlock);
-	read_unlock_bh(&bond->lock);
+/*----------------------------- Multicast list ------------------------------*/
 
-	return (has_active_interface ? BMSR_LSTATUS : 0);
+/*
+ * Returns 0 if dmi1 and dmi2 are the same, non-0 otherwise
+ */
+static inline int bond_is_dmi_same(struct dev_mc_list *dmi1, struct dev_mc_list *dmi2)
+{
+	return memcmp(dmi1->dmi_addr, dmi2->dmi_addr, dmi1->dmi_addrlen) == 0 &&
+			dmi1->dmi_addrlen == dmi2->dmi_addrlen;
 }
 
-/* register to receive lacpdus on a bond */
-static void bond_register_lacpdu(struct bonding *bond)
+/*
+ * returns dmi entry if found, NULL otherwise
+ */
+static struct dev_mc_list *bond_mc_list_find_dmi(struct dev_mc_list *dmi, struct dev_mc_list *mc_list)
 {
-	struct packet_type* pk_type = &(BOND_AD_INFO(bond).ad_pkt_type);
+	struct dev_mc_list *idmi;
 
-	/* initialize packet type */
-	pk_type->type = PKT_TYPE_LACPDU;
-	pk_type->dev = bond->device;
-	pk_type->func = bond_3ad_lacpdu_recv;
+	for (idmi = mc_list; idmi; idmi = idmi->next) {
+		if (bond_is_dmi_same(dmi, idmi)) {
+			return idmi;
+		}
+	}
 
-	dev_add_pack(pk_type);
+	return NULL;
 }
 
-/* unregister to receive lacpdus on a bond */
-static void bond_unregister_lacpdu(struct bonding *bond)
+/*
+ * Push the promiscuity flag down to appropriate slaves
+ */
+static void bond_set_promiscuity(struct bonding *bond, int inc)
 {
-	dev_remove_pack(&(BOND_AD_INFO(bond).ad_pkt_type));
+	if (USES_PRIMARY(bond->params.mode)) {
+		/* write lock already acquired */
+		if (bond->curr_active_slave) {
+			dev_set_promiscuity(bond->curr_active_slave->dev, inc);
+		}
+	} else {
+		struct slave *slave;
+		int i;
+		bond_for_each_slave(bond, slave, i) {
+			dev_set_promiscuity(slave->dev, inc);
+		}
+	}
 }
 
-static int bond_open(struct net_device *dev)
+/*
+ * Push the allmulti flag down to all slaves
+ */
+static void bond_set_allmulti(struct bonding *bond, int inc)
 {
-	struct bonding *bond = (struct bonding *)(dev->priv);
-	struct timer_list *timer = &((struct bonding *)(dev->priv))->mii_timer;
-	struct timer_list *arp_timer = &((struct bonding *)(dev->priv))->arp_timer;
-
-	if ((bond_mode == BOND_MODE_TLB) ||
-	    (bond_mode == BOND_MODE_ALB)) {
-		struct timer_list *alb_timer = &(BOND_ALB_INFO(bond).alb_timer);
-
-		/* bond_alb_initialize must be called before the timer
-		 * is started.
-		 */
-		if (bond_alb_initialize(bond, (bond_mode == BOND_MODE_ALB))) {
-			/* something went wrong - fail the open operation */
-			return -1;
+	if (USES_PRIMARY(bond->params.mode)) {
+		/* write lock already acquired */
+		if (bond->curr_active_slave) {
+			dev_set_allmulti(bond->curr_active_slave->dev, inc);
+		}
+	} else {
+		struct slave *slave;
+		int i;
+		bond_for_each_slave(bond, slave, i) {
+			dev_set_allmulti(slave->dev, inc);
 		}
-
-		init_timer(alb_timer);
-		alb_timer->expires  = jiffies + 1;
-		alb_timer->data     = (unsigned long)bond;
-		alb_timer->function = (void *)&bond_alb_monitor;
-		add_timer(alb_timer);
 	}
+}
 
-	if (miimon > 0) {  /* link check interval, in milliseconds. */
-		init_timer(timer);
-		timer->expires  = jiffies + (miimon * HZ / 1000);
-		timer->data     = (unsigned long)dev;
-		timer->function = (void *)&bond_mii_monitor;
-		add_timer(timer);
-	}
-
-	if (arp_interval> 0) {  /* arp interval, in milliseconds. */
-		init_timer(arp_timer);
-		arp_timer->expires  = jiffies + (arp_interval * HZ / 1000);
-		arp_timer->data     = (unsigned long)dev;
-		if (bond_mode == BOND_MODE_ACTIVEBACKUP) {
-			arp_timer->function = (void *)&activebackup_arp_monitor;
-		} else {
-			arp_timer->function = (void *)&loadbalance_arp_monitor;
+/*
+ * Add a Multicast address to slaves
+ * according to mode
+ */
+static void bond_mc_add(struct bonding *bond, void *addr, int alen)
+{
+	if (USES_PRIMARY(bond->params.mode)) {
+		/* write lock already acquired */
+		if (bond->curr_active_slave) {
+			dev_mc_add(bond->curr_active_slave->dev, addr, alen, 0);
+		}
+	} else {
+		struct slave *slave;
+		int i;
+		bond_for_each_slave(bond, slave, i) {
+			dev_mc_add(slave->dev, addr, alen, 0);
 		}
-		add_timer(arp_timer);
-	}
-
-	if (bond_mode == BOND_MODE_8023AD) {
-		struct timer_list *ad_timer = &(BOND_AD_INFO(bond).ad_timer);
-		init_timer(ad_timer);
-		ad_timer->expires  = jiffies + (AD_TIMER_INTERVAL * HZ / 1000);
-		ad_timer->data     = (unsigned long)bond;
-		ad_timer->function = (void *)&bond_3ad_state_machine_handler;
-		add_timer(ad_timer);
-
-		/* register to receive LACPDUs */
-		bond_register_lacpdu(bond);
 	}
-
-	return 0;
 }
 
-static int bond_close(struct net_device *master)
+/*
+ * Remove a multicast address from slave
+ * according to mode
+ */
+static void bond_mc_delete(struct bonding *bond, void *addr, int alen)
 {
-	bonding_t *bond = (struct bonding *) master->priv;
-
-	write_lock_bh(&bond->lock);
-
-	if (miimon > 0) {  /* link check interval, in milliseconds. */
-		del_timer(&bond->mii_timer);
-	}
-	if (arp_interval> 0) {  /* arp interval, in milliseconds. */
-		del_timer(&bond->arp_timer);
-                if (arp_target_hw_addr != NULL) {
-			kfree(arp_target_hw_addr); 
-			arp_target_hw_addr = NULL;
+	if (USES_PRIMARY(bond->params.mode)) {
+		/* write lock already acquired */
+		if (bond->curr_active_slave) {
+			dev_mc_delete(bond->curr_active_slave->dev, addr, alen, 0);
+		}
+	} else {
+		struct slave *slave;
+		int i;
+		bond_for_each_slave(bond, slave, i) {
+			dev_mc_delete(slave->dev, addr, alen, 0);
 		}
 	}
+}
 
-	if (bond_mode == BOND_MODE_8023AD) {
-		del_timer_sync(&(BOND_AD_INFO(bond).ad_timer));
+/*
+ * Totally destroys the mc_list in bond
+ */
+static void bond_mc_list_destroy(struct bonding *bond)
+{
+	struct dev_mc_list *dmi;
 
-		/* Unregister the receive of LACPDUs */
-		bond_unregister_lacpdu(bond);
+	dmi = bond->mc_list;
+	while (dmi) {
+		bond->mc_list = dmi->next;
+		kfree(dmi);
+		dmi = bond->mc_list;
 	}
+}
 
-	bond_mc_list_destroy (bond);
-
-	write_unlock_bh(&bond->lock);
+/*
+ * Copy all the Multicast addresses from src to the bonding device dst
+ */
+static int bond_mc_list_copy(struct dev_mc_list *mc_list, struct bonding *bond, int gpf_flag)
+{
+	struct dev_mc_list *dmi, *new_dmi;
 
-	/* Release the bonded slaves */
-	bond_release_all(master);
+	for (dmi = mc_list; dmi; dmi = dmi->next) {
+		new_dmi = kmalloc(sizeof(struct dev_mc_list), gpf_flag);
 
-	if ((bond_mode == BOND_MODE_TLB) ||
-	    (bond_mode == BOND_MODE_ALB)) {
-		del_timer_sync(&(BOND_ALB_INFO(bond).alb_timer));
+		if (!new_dmi) {
+			/* FIXME: Potential memory leak !!! */
+			return -ENOMEM;
+		}
 
-		bond_alb_deinitialize(bond);
+		new_dmi->next = bond->mc_list;
+		bond->mc_list = new_dmi;
+		new_dmi->dmi_addrlen = dmi->dmi_addrlen;
+		memcpy(new_dmi->dmi_addr, dmi->dmi_addr, dmi->dmi_addrlen);
+		new_dmi->dmi_users = dmi->dmi_users;
+		new_dmi->dmi_gusers = dmi->dmi_gusers;
 	}
 
 	return 0;
 }
 
-/* 
+/*
  * flush all members of flush->mc_list from device dev->mc_list
  */
-static void bond_mc_list_flush(struct net_device *dev, struct net_device *flush)
-{ 
-	struct dev_mc_list *dmi; 
- 
-	for (dmi = flush->mc_list; dmi != NULL; dmi = dmi->next) 
-		dev_mc_delete(dev, dmi->dmi_addr, dmi->dmi_addrlen, 0);
+static void bond_mc_list_flush(struct net_device *bond_dev, struct net_device *slave_dev)
+{
+	struct bonding *bond = bond_dev->priv;
+	struct dev_mc_list *dmi;
 
-	if (bond_mode == BOND_MODE_8023AD) {
+	for (dmi = bond_dev->mc_list; dmi; dmi = dmi->next) {
+		dev_mc_delete(slave_dev, dmi->dmi_addr, dmi->dmi_addrlen, 0);
+	}
+
+	if (bond->params.mode == BOND_MODE_8023AD) {
 		/* del lacpdu mc addr from mc list */
 		u8 lacpdu_multicast[ETH_ALEN] = MULTICAST_LACPDU_ADDR;
 
-		dev_mc_delete(dev, lacpdu_multicast, ETH_ALEN, 0);
+		dev_mc_delete(slave_dev, lacpdu_multicast, ETH_ALEN, 0);
 	}
 }
 
+/*--------------------------- Active slave change ---------------------------*/
+
 /*
- * Totally destroys the mc_list in bond
+ * Update the mc list and multicast-related flags for the new and
+ * old active slaves (if any) according to the multicast mode, and
+ * promiscuous flags unconditionally.
  */
-static void bond_mc_list_destroy(struct bonding *bond)
+static void bond_mc_swap(struct bonding *bond, struct slave *new_active, struct slave *old_active)
 {
 	struct dev_mc_list *dmi;
 
-	dmi = bond->mc_list; 
-	while (dmi) { 
-		bond->mc_list = dmi->next; 
-		kfree(dmi); 
-		dmi = bond->mc_list; 
-	}
-}
-
-/*
- * Add a Multicast address to every slave in the bonding group
- */
-static void bond_mc_add(bonding_t *bond, void *addr, int alen)
-{ 
-	slave_t *slave;
-	switch (multicast_mode) {
-	case BOND_MULTICAST_ACTIVE :
-		/* write lock already acquired */
-		if (bond->current_slave != NULL)
-			dev_mc_add(bond->current_slave->dev, addr, alen, 0);
-		break;
-	case BOND_MULTICAST_ALL :
-		for (slave = bond->prev; slave != (slave_t*)bond; slave = slave->prev)
-			dev_mc_add(slave->dev, addr, alen, 0);
-		break;
-	case BOND_MULTICAST_DISABLED :
-		break;
+	if (!USES_PRIMARY(bond->params.mode)) {
+		/* nothing to do -  mc list is already up-to-date on
+		 * all slaves
+		 */
+		return;
 	}
-} 
 
-/*
- * Remove a multicast address from every slave in the bonding group
- */
-static void bond_mc_delete(bonding_t *bond, void *addr, int alen)
-{ 
-	slave_t *slave; 
-	switch (multicast_mode) {
-	case BOND_MULTICAST_ACTIVE :
-		/* write lock already acquired */
-		if (bond->current_slave != NULL)
-			dev_mc_delete(bond->current_slave->dev, addr, alen, 0);
-		break;
-	case BOND_MULTICAST_ALL :
-		for (slave = bond->prev; slave != (slave_t*)bond; slave = slave->prev)
-			dev_mc_delete(slave->dev, addr, alen, 0);
-		break;
-	case BOND_MULTICAST_DISABLED :
-		break;
-	}
-} 
+	if (old_active) {
+		if (bond->dev->flags & IFF_PROMISC) {
+			dev_set_promiscuity(old_active->dev, -1);
+		}
 
-/*
- * Copy all the Multicast addresses from src to the bonding device dst
- */
-static int bond_mc_list_copy (struct dev_mc_list *src, struct bonding *dst,
- int gpf_flag)
-{
-	struct dev_mc_list *dmi, *new_dmi;
+		if (bond->dev->flags & IFF_ALLMULTI) {
+			dev_set_allmulti(old_active->dev, -1);
+		}
 
-   	for (dmi = src; dmi != NULL; dmi = dmi->next) { 
-		new_dmi = kmalloc(sizeof(struct dev_mc_list), gpf_flag);
+		for (dmi = bond->dev->mc_list; dmi; dmi = dmi->next) {
+			dev_mc_delete(old_active->dev, dmi->dmi_addr, dmi->dmi_addrlen, 0);
+		}
+	}
 
-		if (new_dmi == NULL) {
-			return -ENOMEM; 
+	if (new_active) {
+		if (bond->dev->flags & IFF_PROMISC) {
+			dev_set_promiscuity(new_active->dev, 1);
 		}
 
-		new_dmi->next = dst->mc_list; 
-		dst->mc_list = new_dmi;
+		if (bond->dev->flags & IFF_ALLMULTI) {
+			dev_set_allmulti(new_active->dev, 1);
+		}
 
-		new_dmi->dmi_addrlen = dmi->dmi_addrlen; 
-		memcpy(new_dmi->dmi_addr, dmi->dmi_addr, dmi->dmi_addrlen); 
-		new_dmi->dmi_users = dmi->dmi_users;
-		new_dmi->dmi_gusers = dmi->dmi_gusers; 
-	} 
-	return 0;
+		for (dmi = bond->dev->mc_list; dmi; dmi = dmi->next) {
+			dev_mc_add(new_active->dev, dmi->dmi_addr, dmi->dmi_addrlen, 0);
+		}
+	}
 }
 
-/*
- * Returns 0 if dmi1 and dmi2 are the same, non-0 otherwise
+/**
+ * find_best_interface - select the best available slave to be the active one
+ * @bond: our bonding struct
+ *
+ * Warning: Caller must hold curr_slave_lock for writing.
  */
-static inline int dmi_same(struct dev_mc_list *dmi1, struct dev_mc_list *dmi2)
-{ 
-	return memcmp(dmi1->dmi_addr, dmi2->dmi_addr, dmi1->dmi_addrlen) == 0 &&
-	 dmi1->dmi_addrlen == dmi2->dmi_addrlen;
-} 
+static struct slave *bond_find_best_slave(struct bonding *bond)
+{
+	struct slave *new_active, *old_active;
+	struct slave *bestslave = NULL;
+	int mintime = bond->params.updelay;
+	int i;
 
-/*
- * Push the promiscuity flag down to appropriate slaves
- */
-static void bond_set_promiscuity(bonding_t *bond, int inc)
-{ 
-	slave_t *slave; 
-
-	if (USES_PRIMARY(bond_mode)) {
-		if (bond->current_slave) {
-			dev_set_promiscuity(bond->current_slave->dev, inc);
-		}
+	new_active = old_active = bond->curr_active_slave;
 
-	} else { 
-		for (slave = bond->prev; slave != (slave_t*)bond;
-		     slave = slave->prev) {
-			dev_set_promiscuity(slave->dev, inc);
+	if (!new_active) { /* there were no active slaves left */
+		if (bond->slave_cnt > 0) {  /* found one slave */
+			new_active = bond->first_slave;
+		} else {
+			return NULL; /* still no slave, return NULL */
 		}
 	}
-} 
 
-/*
- * Push the allmulti flag down to all slaves
- */
-static void bond_set_allmulti(bonding_t *bond, int inc)
-{ 
-	slave_t *slave; 
-	switch (multicast_mode) {
-	case BOND_MULTICAST_ACTIVE : 
-		/* write lock already acquired */
-		if (bond->current_slave != NULL)
-			dev_set_allmulti(bond->current_slave->dev, inc);
-		break;
-	case BOND_MULTICAST_ALL :
-		for (slave = bond->prev; slave != (slave_t*)bond; slave = slave->prev)
-			dev_set_allmulti(slave->dev, inc);
-		break;
-	case BOND_MULTICAST_DISABLED :
-		break;
+	/* first try the primary link; if arping, a link must tx/rx traffic
+	 * before it can be considered the curr_active_slave - also, we would skip
+	 * slaves between the curr_active_slave and primary_slave that may be up
+	 * and able to arp
+	 */
+	if ((bond->primary_slave) &&
+	    (!bond->params.arp_interval) &&
+	    (IS_UP(bond->primary_slave->dev))) {
+		new_active = bond->primary_slave;
 	}
-} 
 
-/* 
- * returns dmi entry if found, NULL otherwise 
- */
-static struct dev_mc_list* bond_mc_list_find_dmi(struct dev_mc_list *dmi,
- struct dev_mc_list *mc_list)
-{ 
-	struct dev_mc_list *idmi;
+	/* remember where to stop iterating over the slaves */
+	old_active = new_active;
 
-	for (idmi = mc_list; idmi != NULL; idmi = idmi->next) {
-		if (dmi_same(dmi, idmi)) {
-			return idmi; 
+	bond_for_each_slave_from(bond, new_active, i, old_active) {
+		if (IS_UP(new_active->dev)) {
+			if (new_active->link == BOND_LINK_UP) {
+				return new_active;
+			} else if (new_active->link == BOND_LINK_BACK) {
+				/* link up, but waiting for stabilization */
+				if (new_active->delay < mintime) {
+					mintime = new_active->delay;
+					bestslave = new_active;
+				}
+			}
 		}
 	}
-	return NULL;
-} 
 
-static void set_multicast_list(struct net_device *master)
+	return bestslave;
+}
+
+/**
+ * change_active_interface - change the active slave into the specified one
+ * @bond: our bonding struct
+ * @new: the new slave to make the active one
+ *
+ * Set the new slave to the bond's settings and unset them on the old
+ * curr_active_slave.
+ * Setting include flags, mc-list, promiscuity, allmulti, etc.
+ *
+ * If @new's link state is %BOND_LINK_BACK we'll set it to %BOND_LINK_UP,
+ * because it is apparently the best available slave we have, even though its
+ * updelay hasn't timed out yet.
+ *
+ * Warning: Caller must hold curr_slave_lock for writing.
+ */
+static void bond_change_active_slave(struct bonding *bond, struct slave *new_active)
 {
-	bonding_t *bond = master->priv;
-	struct dev_mc_list *dmi;
+	struct slave *old_active = bond->curr_active_slave;
 
-	write_lock_bh(&bond->lock);
+	if (old_active == new_active) {
+		return;
+	}
 
-	/*
-	 * Do promisc before checking multicast_mode
-	 */
-	if ( (master->flags & IFF_PROMISC) && !(bond->flags & IFF_PROMISC) )
-		bond_set_promiscuity(bond, 1); 
+	if (new_active) {
+		if (new_active->link == BOND_LINK_BACK) {
+			if (USES_PRIMARY(bond->params.mode)) {
+				printk(KERN_INFO DRV_NAME
+				       ": %s: making interface %s the new "
+				       "active one %d ms earlier.\n",
+				       bond->dev->name, new_active->dev->name,
+				       (bond->params.updelay - new_active->delay) * bond->params.miimon);
+			}
 
-	if ( !(master->flags & IFF_PROMISC) && (bond->flags & IFF_PROMISC) ) 
-		bond_set_promiscuity(bond, -1); 
+			new_active->delay = 0;
+			new_active->link = BOND_LINK_UP;
+			new_active->jiffies = jiffies;
 
-	if (multicast_mode == BOND_MULTICAST_DISABLED) {
-		bond->flags = master->flags;
-		write_unlock_bh(&bond->lock);
-		return;
+			if (bond->params.mode == BOND_MODE_8023AD) {
+				bond_3ad_handle_link_change(new_active, BOND_LINK_UP);
+			}
+
+			if ((bond->params.mode == BOND_MODE_TLB) ||
+			    (bond->params.mode == BOND_MODE_ALB)) {
+				bond_alb_handle_link_change(bond, new_active, BOND_LINK_UP);
+			}
+		} else {
+			if (USES_PRIMARY(bond->params.mode)) {
+				printk(KERN_INFO DRV_NAME
+				       ": %s: making interface %s the new "
+				       "active one.\n",
+				       bond->dev->name, new_active->dev->name);
+			}
+		}
 	}
 
-	/* set allmulti flag to slaves */ 
-	if ( (master->flags & IFF_ALLMULTI) && !(bond->flags & IFF_ALLMULTI) ) 
-		bond_set_allmulti(bond, 1); 
+	if (bond->params.mode == BOND_MODE_ACTIVEBACKUP) {
+		if (old_active) {
+			bond_set_slave_inactive_flags(old_active);
+		}
+
+		if (new_active) {
+			bond_set_slave_active_flags(new_active);
+		}
+	}
 
-	if ( !(master->flags & IFF_ALLMULTI) && (bond->flags & IFF_ALLMULTI) )
-		bond_set_allmulti(bond, -1); 
+	if (USES_PRIMARY(bond->params.mode)) {
+		bond_mc_swap(bond, new_active, old_active);
+	}
 
-	bond->flags = master->flags; 
+	if ((bond->params.mode == BOND_MODE_TLB) ||
+	    (bond->params.mode == BOND_MODE_ALB)) {
+		bond_alb_handle_active_change(bond, new_active);
+	} else {
+		bond->curr_active_slave = new_active;
+	}
+}
 
-	/* looking for addresses to add to slaves' mc list */ 
-	for (dmi = master->mc_list; dmi != NULL; dmi = dmi->next) { 
-		if (bond_mc_list_find_dmi(dmi, bond->mc_list) == NULL) 
-		 bond_mc_add(bond, dmi->dmi_addr, dmi->dmi_addrlen); 
-	} 
+/**
+ * bond_select_active_slave - select a new active slave, if needed
+ * @bond: our bonding struct
+ *
+ * This functions shoud be called when one of the following occurs:
+ * - The old curr_active_slave has been released or lost its link.
+ * - The primary_slave has got its link back.
+ * - A slave has got its link back and there's no old curr_active_slave.
+ *
+ * Warning: Caller must hold curr_slave_lock for writing.
+ */
+static void bond_select_active_slave(struct bonding *bond)
+{
+	struct slave *best_slave;
 
-	/* looking for addresses to delete from slaves' list */ 
-	for (dmi = bond->mc_list; dmi != NULL; dmi = dmi->next) { 
-		if (bond_mc_list_find_dmi(dmi, master->mc_list) == NULL) 
-		 bond_mc_delete(bond, dmi->dmi_addr, dmi->dmi_addrlen); 
+	best_slave = bond_find_best_slave(bond);
+	if (best_slave != bond->curr_active_slave) {
+		bond_change_active_slave(bond, best_slave);
 	}
+}
 
+/*--------------------------- slave list handling ---------------------------*/
 
-	/* save master's multicast list */ 
-	bond_mc_list_destroy (bond);
-	bond_mc_list_copy (master->mc_list, bond, GFP_ATOMIC);
+/*
+ * This function attaches the slave to the end of list.
+ *
+ * bond->lock held for writing by caller.
+ */
+static void bond_attach_slave(struct bonding *bond, struct slave *new_slave)
+{
+	if (bond->first_slave == NULL) { /* attaching the first slave */
+		new_slave->next = new_slave;
+		new_slave->prev = new_slave;
+		bond->first_slave = new_slave;
+	} else {
+		new_slave->next = bond->first_slave;
+		new_slave->prev = bond->first_slave->prev;
+		new_slave->next->prev = new_slave;
+		new_slave->prev->next = new_slave;
+	}
 
-	write_unlock_bh(&bond->lock);
+	bond->slave_cnt++;
 }
 
 /*
- * Update the mc list and multicast-related flags for the new and 
- * old active slaves (if any) according to the multicast mode, and
- * promiscuous flags unconditionally.
+ * This function detaches the slave from the list.
+ * WARNING: no check is made to verify if the slave effectively
+ * belongs to <bond>.
+ * Nothing is freed on return, structures are just unchained.
+ * If any slave pointer in bond was pointing to <slave>,
+ * it should be changed by the calling function.
+ *
+ * bond->lock held for writing by caller.
  */
-static void bond_mc_update(bonding_t *bond, slave_t *new, slave_t *old)
+static void bond_detach_slave(struct bonding *bond, struct slave *slave)
 {
-	struct dev_mc_list *dmi;
+	if (slave->next) {
+		slave->next->prev = slave->prev;
+	}
 
-	if (USES_PRIMARY(bond_mode)) {
-		if (bond->device->flags & IFF_PROMISC) {
-			if (old)
-				dev_set_promiscuity(old->dev, -1);
-			if (new)
-				dev_set_promiscuity(new->dev, 1);
-		}
+	if (slave->prev) {
+		slave->prev->next = slave->next;
 	}
 
-	switch(multicast_mode) {
-	case BOND_MULTICAST_ACTIVE :		
-		if (bond->device->flags & IFF_ALLMULTI) {
-			if (old)
-				dev_set_allmulti(old->dev, -1);
-			if (new)
-				dev_set_allmulti(new->dev, 1);
-		}
-		/* first remove all mc addresses from old slave if any,
-		   and _then_ add them to new active slave */
-		if (old) {
-			for (dmi = bond->device->mc_list; dmi != NULL; dmi = dmi->next)
-				dev_mc_delete(old->dev, dmi->dmi_addr, dmi->dmi_addrlen, 0);
-		}
-		if (new) {
-			for (dmi = bond->device->mc_list; dmi != NULL; dmi = dmi->next)
-				dev_mc_add(new->dev, dmi->dmi_addr, dmi->dmi_addrlen, 0);
+	if (bond->first_slave == slave) { /* slave is the first slave */
+		if (bond->slave_cnt > 1) { /* there are more slave */
+			bond->first_slave = slave->next;
+		} else {
+			bond->first_slave = NULL; /* slave was the last one */
 		}
-		break;
-	case BOND_MULTICAST_ALL :
-		/* nothing to do: mc list is already up-to-date on all slaves */
-		break;
-	case BOND_MULTICAST_DISABLED :
-		break;
 	}
+
+	slave->next = NULL;
+	slave->prev = NULL;
+	bond->slave_cnt--;
+}
+
+/*---------------------------------- IOCTL ----------------------------------*/
+
+static int bond_sethwaddr(struct net_device *bond_dev, struct net_device *slave_dev)
+{
+	dprintk("bond_dev=%p\n", bond_dev);
+	dprintk("slave_dev=%p\n", slave_dev);
+	dprintk("slave_dev->addr_len=%d\n", slave_dev->addr_len);
+	memcpy(bond_dev->dev_addr, slave_dev->dev_addr, slave_dev->addr_len);
+	return 0;
 }
 
 /* enslave device <slave> to bond device <master> */
-static int bond_enslave(struct net_device *master_dev, 
-                        struct net_device *slave_dev)
+static int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
 {
-	bonding_t *bond = NULL;
-	slave_t *new_slave = NULL;
-	unsigned long rflags = 0;
-	int err = 0;
+	struct bonding *bond = bond_dev->priv;
+	struct slave *new_slave = NULL;
 	struct dev_mc_list *dmi;
-	struct in_ifaddr **ifap;
-	struct in_ifaddr *ifa;
-	int link_reporting;
 	struct sockaddr addr;
-
-	if (master_dev == NULL || slave_dev == NULL) {
-		return -ENODEV;
-	}
-	bond = (struct bonding *) master_dev->priv;
+	int link_reporting;
+	int res = 0;
 
 	if (slave_dev->do_ioctl == NULL) {
-		printk(KERN_DEBUG
-			"Warning : no link monitoring support for %s\n",
-			slave_dev->name);
+		printk(KERN_WARNING DRV_NAME
+		       ": Warning : no link monitoring support for %s\n",
+		       slave_dev->name);
 	}
 
-
 	/* bond must be initialized by bond_open() before enslaving */
-	if (!(master_dev->flags & IFF_UP)) {
-#ifdef BONDING_DEBUG
-		printk(KERN_CRIT "Error, master_dev is not up\n");
-#endif
+	if (!(bond_dev->flags & IFF_UP)) {
+		dprintk("Error, master_dev is not up\n");
 		return -EPERM;
 	}
 
 	/* already enslaved */
-	if (master_dev->flags & IFF_SLAVE || slave_dev->flags & IFF_SLAVE) {
-#ifdef BONDING_DEBUG
-		printk(KERN_CRIT "Error, Device was already enslaved\n");
-#endif
+	if (slave_dev->flags & IFF_SLAVE) {
+		dprintk("Error, Device was already enslaved\n");
 		return -EBUSY;
 	}
 
@@ -1376,19 +1239,19 @@
 		 * slave interface to be closed.
 		 */
 		if ((slave_dev->flags & IFF_UP)) {
-#ifdef BONDING_DEBUG
-			printk(KERN_CRIT "Error, slave_dev is up\n");
-#endif
+			printk(KERN_ERR DRV_NAME
+			       ": Error: %s is up\n",
+			       slave_dev->name);
 			return -EPERM;
 		}
 
 		if (slave_dev->set_mac_address == NULL) {
-			printk(KERN_CRIT
-			       "The slave device you specified does not support"
-			       " setting the MAC address.\n");
-			printk(KERN_CRIT
-			       "Your kernel likely does not support slave"
-			       " devices.\n");
+			printk(KERN_ERR DRV_NAME
+			       ": Error: The slave device you specified does "
+			       "not support setting the MAC address.\n");
+			printk(KERN_ERR
+			       "Your kernel likely does not support slave "
+			       "devices.\n");
 
 			return -EOPNOTSUPP;
 		}
@@ -1397,26 +1260,29 @@
 		 * slave interface to be open.
 		 */
 		if (!(slave_dev->flags & IFF_UP)) {
-#ifdef BONDING_DEBUG
-			printk(KERN_CRIT "Error, slave_dev is not running\n");
-#endif
+			printk(KERN_ERR DRV_NAME
+			       ": Error: %s is not running\n",
+			       slave_dev->name);
 			return -EINVAL;
 		}
 
-		if ((bond_mode == BOND_MODE_8023AD) ||
-		    (bond_mode == BOND_MODE_TLB) ||
-		    (bond_mode == BOND_MODE_ALB)) {
-			printk(KERN_ERR
-			       "bonding: Error: to use %s mode, you must "
-			       "upgrade ifenslave.\n", bond_mode_name());
+		if ((bond->params.mode == BOND_MODE_8023AD) ||
+		    (bond->params.mode == BOND_MODE_TLB)    ||
+		    (bond->params.mode == BOND_MODE_ALB)) {
+			printk(KERN_ERR DRV_NAME
+			       ": Error: to use %s mode, you must upgrade "
+			       "ifenslave.\n",
+			       bond_mode_name(bond->params.mode));
 			return -EOPNOTSUPP;
 		}
 	}
 
-	if ((new_slave = kmalloc(sizeof(slave_t), GFP_KERNEL)) == NULL) {
+	new_slave = kmalloc(sizeof(struct slave), GFP_KERNEL);
+	if (!new_slave) {
 		return -ENOMEM;
 	}
-	memset(new_slave, 0, sizeof(slave_t));
+
+	memset(new_slave, 0, sizeof(struct slave));
 
 	/* save slave's original flags before calling
 	 * netdev_set_master and dev_open
@@ -1430,37 +1296,29 @@
 		 */
 		memcpy(new_slave->perm_hwaddr, slave_dev->dev_addr, ETH_ALEN);
 
-		if (bond->slave_cnt > 0) {
-			/* set slave to master's mac address
-			 * The application already set the master's
-			 * mac address to that of the first slave
-			 */
-			memcpy(addr.sa_data, master_dev->dev_addr, master_dev->addr_len);
-			addr.sa_family = slave_dev->type;
-			err = slave_dev->set_mac_address(slave_dev, &addr);
-			if (err) {
-#ifdef BONDING_DEBUG
-				printk(KERN_CRIT "Error %d calling set_mac_address\n", err);
-#endif
-				goto err_free;
-			}
+		/* set slave to master's mac address
+		 * The application already set the master's
+		 * mac address to that of the first slave
+		 */
+		memcpy(addr.sa_data, bond_dev->dev_addr, bond_dev->addr_len);
+		addr.sa_family = slave_dev->type;
+		res = slave_dev->set_mac_address(slave_dev, &addr);
+		if (res) {
+			dprintk("Error %d calling set_mac_address\n", res);
+			goto err_free;
 		}
 
 		/* open the slave since the application closed it */
-		err = dev_open(slave_dev);
-		if (err) {
-#ifdef BONDING_DEBUG
-			printk(KERN_CRIT "Openning slave %s failed\n", slave_dev->name);
-#endif
+		res = dev_open(slave_dev);
+		if (res) {
+			dprintk("Openning slave %s failed\n", slave_dev->name);
 			goto err_restore_mac;
 		}
 	}
 
-	err = netdev_set_master(slave_dev, master_dev);
-	if (err) {
-#ifdef BONDING_DEBUG
-		printk(KERN_CRIT "Error %d calling netdev_set_master\n", err);
-#endif
+	res = netdev_set_master(slave_dev, bond_dev);
+	if (res) {
+		dprintk("Error %d calling netdev_set_master\n", res);
 		if (app_abi_ver < 1) {
 			goto err_free;
 		} else {
@@ -1470,40 +1328,40 @@
 
 	new_slave->dev = slave_dev;
 
-	if ((bond_mode == BOND_MODE_TLB) ||
-	    (bond_mode == BOND_MODE_ALB)) {
+	if ((bond->params.mode == BOND_MODE_TLB) ||
+	    (bond->params.mode == BOND_MODE_ALB)) {
 		/* bond_alb_init_slave() must be called before all other stages since
 		 * it might fail and we do not want to have to undo everything
 		 */
-		err = bond_alb_init_slave(bond, new_slave);
-		if (err) {
+		res = bond_alb_init_slave(bond, new_slave);
+		if (res) {
 			goto err_unset_master;
 		}
 	}
 
-	/* set promiscuity level to new slave */ 
-	if (master_dev->flags & IFF_PROMISC) {
-		/* If the mode USES_PRIMARY, then the new slave gets the
-		 * master's promisc (and mc) settings only if it becomes the
-		 * current_slave, and that is taken care of later when calling
-		 * bond_change_active()
-		 */
-		if (!USES_PRIMARY(bond_mode)) {
-			dev_set_promiscuity(slave_dev, 1); 
+	/* If the mode USES_PRIMARY, then the new slave gets the
+	 * master's promisc (and mc) settings only if it becomes the
+	 * curr_active_slave, and that is taken care of later when calling
+	 * bond_change_active()
+	 */
+	if (!USES_PRIMARY(bond->params.mode)) {
+		/* set promiscuity level to new slave */
+		if (bond_dev->flags & IFF_PROMISC) {
+			dev_set_promiscuity(slave_dev, 1);
 		}
-	}
- 
-	if (multicast_mode == BOND_MULTICAST_ALL) {
+
 		/* set allmulti level to new slave */
-		if (master_dev->flags & IFF_ALLMULTI) 
-			dev_set_allmulti(slave_dev, 1); 
-		
-		/* upload master's mc_list to new slave */ 
-		for (dmi = master_dev->mc_list; dmi != NULL; dmi = dmi->next) 
+		if (bond_dev->flags & IFF_ALLMULTI) {
+			dev_set_allmulti(slave_dev, 1);
+		}
+
+		/* upload master's mc_list to new slave */
+		for (dmi = bond_dev->mc_list; dmi; dmi = dmi->next) {
 			dev_mc_add (slave_dev, dmi->dmi_addr, dmi->dmi_addrlen, 0);
+		}
 	}
 
-	if (bond_mode == BOND_MODE_8023AD) {
+	if (bond->params.mode == BOND_MODE_8023AD) {
 		/* add lacpdu mc addr to mc list */
 		u8 lacpdu_multicast[ETH_ALEN] = MULTICAST_LACPDU_ADDR;
 
@@ -1511,15 +1369,16 @@
 	}
 
 	write_lock_bh(&bond->lock);
-	
+
 	bond_attach_slave(bond, new_slave);
+
 	new_slave->delay = 0;
 	new_slave->link_failure_count = 0;
 
-	if (miimon > 0 && !use_carrier) {
-		link_reporting = bond_check_dev_link(slave_dev, 1);
+	if (bond->params.miimon && !bond->params.use_carrier) {
+		link_reporting = bond_check_dev_link(bond, slave_dev, 1);
 
-		if ((link_reporting == -1) && (arp_interval == 0)) {
+		if ((link_reporting == -1) && !bond->params.arp_interval) {
 			/*
 			 * miimon is set but a bonded network driver
 			 * does not support ETHTOOL/MII and
@@ -1528,157 +1387,136 @@
 			 * here (because netif_carrier is always
 			 * supported); thus, we don't need to change
 			 * the messages for netif_carrier.
-			 */ 
-			printk(KERN_ERR
-				"bond_enslave(): MII and ETHTOOL support not "
-				"available for interface %s, and "
-				"arp_interval/arp_ip_target module parameters "
-		       		"not specified, thus bonding will not detect "
-				"link failures! see bonding.txt for details.\n",
-		       		slave_dev->name);
+			 */
+			printk(KERN_WARNING DRV_NAME
+			       ": Warning: MII and ETHTOOL support not "
+			       "available for interface %s, and "
+			       "arp_interval/arp_ip_target module parameters "
+			       "not specified, thus bonding will not detect "
+			       "link failures! see bonding.txt for details.\n",
+			       slave_dev->name);
 		} else if (link_reporting == -1) {
-			/* unable  get link status using mii/ethtool */
-			printk(KERN_WARNING 
-			       "bond_enslave: can't get link status from "
+			/* unable get link status using mii/ethtool */
+			printk(KERN_WARNING DRV_NAME
+			       ": Warning: can't get link status from "
 			       "interface %s; the network driver associated "
-			       "with this interface does not support "
-			       "MII or ETHTOOL link status reporting, thus "
-			       "miimon has no effect on this interface.\n", 
+			       "with this interface does not support MII or "
+			       "ETHTOOL link status reporting, thus miimon "
+			       "has no effect on this interface.\n",
 			       slave_dev->name);
 		}
 	}
 
 	/* check for initial state */
-	if ((miimon <= 0) ||
-	    (bond_check_dev_link(slave_dev, 0) == BMSR_LSTATUS)) {
-		if (updelay) {
-#ifdef BONDING_DEBUG
-			printk(KERN_CRIT "Initial state of slave_dev is "
-			       "BOND_LINK_BACK\n");
-#endif
+	if (!bond->params.miimon ||
+	    (bond_check_dev_link(bond, slave_dev, 0) == BMSR_LSTATUS)) {
+		if (bond->params.updelay) {
+			dprintk("Initial state of slave_dev is "
+				"BOND_LINK_BACK\n");
 			new_slave->link  = BOND_LINK_BACK;
-			new_slave->delay = updelay;
-		}
-		else {
-#ifdef BONDING_DEBUG
-			printk(KERN_DEBUG "Initial state of slave_dev is "
+			new_slave->delay = bond->params.updelay;
+		} else {
+			dprintk("Initial state of slave_dev is "
 				"BOND_LINK_UP\n");
-#endif
 			new_slave->link  = BOND_LINK_UP;
 		}
 		new_slave->jiffies = jiffies;
-	}
-	else {
-#ifdef BONDING_DEBUG
-		printk(KERN_CRIT "Initial state of slave_dev is "
+	} else {
+		dprintk("Initial state of slave_dev is "
 			"BOND_LINK_DOWN\n");
-#endif
 		new_slave->link  = BOND_LINK_DOWN;
 	}
 
 	if (bond_update_speed_duplex(new_slave) &&
 	    (new_slave->link != BOND_LINK_DOWN)) {
-
-		printk(KERN_WARNING
-		       "bond_enslave(): failed to get speed/duplex from %s, "
-		       "speed forced to 100Mbps, duplex forced to Full.\n",
+		printk(KERN_WARNING DRV_NAME
+		       ": Warning: failed to get speed/duplex from %s, speed "
+		       "forced to 100Mbps, duplex forced to Full.\n",
 		       new_slave->dev->name);
-		if (bond_mode == BOND_MODE_8023AD) {
+
+		if (bond->params.mode == BOND_MODE_8023AD) {
 			printk(KERN_WARNING
-			       "Operation of 802.3ad mode requires ETHTOOL support "
-			       "in base driver for proper aggregator selection.\n");
+			       "Operation of 802.3ad mode requires ETHTOOL "
+			       "support in base driver for proper aggregator "
+			       "selection.\n");
 		}
 	}
 
-	/* if we're in active-backup mode, we need one and only one active
-	 * interface. The backup interfaces will have their NOARP flag set
-	 * because we need them to be completely deaf and not to respond to
-	 * any ARP request on the network to avoid fooling a switch. Thus,
-	 * since we guarantee that current_slave always point to the last
-	 * usable interface, we just have to verify this interface's flag.
-	 */
-	if (bond_mode == BOND_MODE_ACTIVEBACKUP) {
-		if (((bond->current_slave == NULL)
-			|| (bond->current_slave->dev->flags & IFF_NOARP))
-			&& (new_slave->link != BOND_LINK_DOWN)) {
-#ifdef BONDING_DEBUG
-			printk(KERN_CRIT "This is the first active slave\n");
-#endif
+	if (USES_PRIMARY(bond->params.mode) && bond->params.primary[0]) {
+		/* if there is a primary slave, remember it */
+		if (strcmp(bond->params.primary, new_slave->dev->name) == 0) {
+			bond->primary_slave = new_slave;
+		}
+	}
+
+	switch (bond->params.mode) {
+	case BOND_MODE_ACTIVEBACKUP:
+		/* if we're in active-backup mode, we need one and only one active
+		 * interface. The backup interfaces will have their NOARP flag set
+		 * because we need them to be completely deaf and not to respond to
+		 * any ARP request on the network to avoid fooling a switch. Thus,
+		 * since we guarantee that curr_active_slave always point to the last
+		 * usable interface, we just have to verify this interface's flag.
+		 */
+		if (((!bond->curr_active_slave) ||
+		     (bond->curr_active_slave->dev->flags & IFF_NOARP)) &&
+		    (new_slave->link != BOND_LINK_DOWN)) {
+			dprintk("This is the first active slave\n");
 			/* first slave or no active slave yet, and this link
 			   is OK, so make this interface the active one */
-			change_active_interface(bond, new_slave);
-		}
-		else {
-#ifdef BONDING_DEBUG
-			printk(KERN_CRIT "This is just a backup slave\n");
-#endif
+			bond_change_active_slave(bond, new_slave);
+		} else {
+			dprintk("This is just a backup slave\n");
 			bond_set_slave_inactive_flags(new_slave);
 		}
-		if (((struct in_device *)slave_dev->ip_ptr) != NULL) {
-			read_lock_irqsave(&(((struct in_device *)slave_dev->ip_ptr)->lock), rflags);
-			ifap= &(((struct in_device *)slave_dev->ip_ptr)->ifa_list);
-			ifa = *ifap;
-			if (ifa != NULL)
-				my_ip = ifa->ifa_address;
-			read_unlock_irqrestore(&(((struct in_device *)slave_dev->ip_ptr)->lock), rflags);
-		}
-
-		/* if there is a primary slave, remember it */
-		if (primary != NULL) {
-			if (strcmp(primary, new_slave->dev->name) == 0) {
-				bond->primary_slave = new_slave;
-			}
-		}
-	} else if (bond_mode == BOND_MODE_8023AD) {
+		break;
+	case BOND_MODE_8023AD:
 		/* in 802.3ad mode, the internal mechanism
 		 * will activate the slaves in the selected
 		 * aggregator
 		 */
 		bond_set_slave_inactive_flags(new_slave);
 		/* if this is the first slave */
-		if (new_slave == bond->next) {
+		if (bond->slave_cnt == 1) {
 			SLAVE_AD_INFO(new_slave).id = 1;
 			/* Initialize AD with the number of times that the AD timer is called in 1 second
 			 * can be called only after the mac address of the bond is set
 			 */
 			bond_3ad_initialize(bond, 1000/AD_TIMER_INTERVAL,
-					    lacp_fast);
+					    bond->params.lacp_fast);
 		} else {
 			SLAVE_AD_INFO(new_slave).id =
-			SLAVE_AD_INFO(new_slave->prev).id + 1;
+				SLAVE_AD_INFO(new_slave->prev).id + 1;
 		}
 
 		bond_3ad_bind_slave(new_slave);
-	} else if ((bond_mode == BOND_MODE_TLB) ||
-		   (bond_mode == BOND_MODE_ALB)) {
+		break;
+	case BOND_MODE_TLB:
+	case BOND_MODE_ALB:
 		new_slave->state = BOND_STATE_ACTIVE;
-		if ((bond->current_slave == NULL) && (new_slave->link != BOND_LINK_DOWN)) {
+		if ((!bond->curr_active_slave) &&
+		    (new_slave->link != BOND_LINK_DOWN)) {
 			/* first slave or no active slave yet, and this link
 			 * is OK, so make this interface the active one
 			 */
-			change_active_interface(bond, new_slave);
+			bond_change_active_slave(bond, new_slave);
 		}
+		break;
+	default:
+		dprintk("This slave is always active in trunk mode\n");
 
-		/* if there is a primary slave, remember it */
-		if (primary != NULL) {
-			if (strcmp(primary, new_slave->dev->name) == 0) {
-				bond->primary_slave = new_slave;
-			}
-		}
-	} else {
-#ifdef BONDING_DEBUG
-		printk(KERN_CRIT "This slave is always active in trunk mode\n");
-#endif
 		/* always active in trunk mode */
 		new_slave->state = BOND_STATE_ACTIVE;
 
-		/* In trunking mode there is little meaning to current_slave
+		/* In trunking mode there is little meaning to curr_active_slave
 		 * anyway (it holds no special properties of the bond device),
 		 * so we can change it without calling change_active_interface()
 		 */
-		if (bond->current_slave == NULL) 
-			bond->current_slave = new_slave;
-	}
+		if (!bond->curr_active_slave) {
+			bond->curr_active_slave = new_slave;
+		}
+		break;
+	} /* switch(bond_mode) */
 
 	write_unlock_bh(&bond->lock);
 
@@ -1692,38 +1530,34 @@
 		 */
 		int ndx = 0;
 
-		for (ndx = 0; ndx < slave_dev->addr_len; ndx++) {
-#ifdef BONDING_DEBUG
-			printk(KERN_DEBUG
-			       "Checking ndx=%d of master_dev->dev_addr\n", ndx);
-#endif
-			if (master_dev->dev_addr[ndx] != 0) {
-#ifdef BONDING_DEBUG
-				printk(KERN_DEBUG
-				       "Found non-zero byte at ndx=%d\n", ndx);
-#endif
+		for (ndx = 0; ndx < bond_dev->addr_len; ndx++) {
+			dprintk("Checking ndx=%d of bond_dev->dev_addr\n",
+				ndx);
+			if (bond_dev->dev_addr[ndx] != 0) {
+				dprintk("Found non-zero byte at ndx=%d\n",
+					ndx);
 				break;
 			}
 		}
-		if (ndx == slave_dev->addr_len) {
+
+		if (ndx == bond_dev->addr_len) {
 			/*
 			 * We got all the way through the address and it was
 			 * all 0's.
 			 */
-#ifdef BONDING_DEBUG
-			printk(KERN_DEBUG "%s doesn't have a MAC address yet.  ",
-			       master_dev->name);
-			printk(KERN_DEBUG "Going to give assign it from %s.\n",
-			       slave_dev->name);
-#endif
-			bond_sethwaddr(master_dev, slave_dev);
+			dprintk("%s doesn't have a MAC address yet.  \n",
+				bond_dev->name);
+			dprintk("Going to give assign it from %s.\n",
+				slave_dev->name);
+			bond_sethwaddr(bond_dev, slave_dev);
 		}
 	}
 
-	printk (KERN_INFO "%s: enslaving %s as a%s interface with a%s link.\n",
-		master_dev->name, slave_dev->name,
-		new_slave->state == BOND_STATE_ACTIVE ? "n active" : " backup",
-		new_slave->link != BOND_LINK_DOWN ? "n up" : " down");
+	printk(KERN_INFO DRV_NAME
+	       ": %s: enslaving %s as a%s interface with a%s link.\n",
+	       bond_dev->name, slave_dev->name,
+	       new_slave->state == BOND_STATE_ACTIVE ? "n active" : " backup",
+	       new_slave->link != BOND_LINK_DOWN ? "n up" : " down");
 
 	/* enslave is successful */
 	return 0;
@@ -1742,227 +1576,12 @@
 
 err_free:
 	kfree(new_slave);
-	return err;
-}
-
-/* 
- * This function changes the active slave to slave <slave_dev>.
- * It returns -EINVAL in the following cases.
- *  - <slave_dev> is not found in the list.
- *  - There is not active slave now.
- *  - <slave_dev> is already active.
- *  - The link state of <slave_dev> is not BOND_LINK_UP.
- *  - <slave_dev> is not running.
- * In these cases, this fuction does nothing.
- * In the other cases, currnt_slave pointer is changed and 0 is returned.
- */
-static int bond_change_active(struct net_device *master_dev, struct net_device *slave_dev)
-{
-	bonding_t *bond;
-	slave_t *slave;
-	slave_t *oldactive = NULL;
-	slave_t *newactive = NULL;
-	int ret = 0;
-
-	if (master_dev == NULL || slave_dev == NULL) {
-		return -ENODEV;
-	}
-
-	/* Verify that master_dev is indeed the master of slave_dev */
-	if (!(slave_dev->flags & IFF_SLAVE) ||
-	    (slave_dev->master != master_dev)) {
-
-		return -EINVAL;
-	}
-
-	bond = (struct bonding *) master_dev->priv;
-	write_lock_bh(&bond->lock);
-	slave = (slave_t *)bond;
-	oldactive = bond->current_slave;
-
-	while ((slave = slave->prev) != (slave_t *)bond) {
-		if(slave_dev == slave->dev) {
-			newactive = slave;
-			break;
-		}
-	}
-
-	/*
-	 * Changing to the current active: do nothing; return success.
-	 */
-	if (newactive && (newactive == oldactive)) {
-		write_unlock_bh(&bond->lock);
-		return 0;
-	}
-
-	if ((newactive != NULL)&&
-	    (oldactive != NULL)&&
-	    (newactive->link == BOND_LINK_UP)&&
-	    IS_UP(newactive->dev)) {
-		change_active_interface(bond, newactive);
-	} else {
-		ret = -EINVAL;
-	}
-	write_unlock_bh(&bond->lock);
-	return ret;
-}
-
-/**
- * find_best_interface - select the best available slave to be the active one
- * @bond: our bonding struct
- *
- * Warning: Caller must hold ptrlock for writing.
- */
-static struct slave *find_best_interface(struct bonding *bond)
-{
-	struct slave *newslave, *oldslave;
-	struct slave *bestslave = NULL;
-	int mintime;
-
-	newslave = oldslave = bond->current_slave;
-
-	if (newslave == NULL) { /* there were no active slaves left */
-		if (bond->next != (slave_t *)bond) {  /* found one slave */
-			newslave = bond->next;
-		} else {
-			return NULL; /* still no slave, return NULL */
-		}
-	}
-
-	mintime = updelay;
-
-	/* first try the primary link; if arping, a link must tx/rx traffic 
-	 * before it can be considered the current_slave - also, we would skip 
-	 * slaves between the current_slave and primary_slave that may be up 
-	 * and able to arp
-	 */
-	if ((bond->primary_slave != NULL) && (arp_interval == 0)) {
-		if (IS_UP(bond->primary_slave->dev)) 
-			newslave = bond->primary_slave;
-	}
-
-	/* remember where to stop iterating over the slaves */
-	oldslave = newslave;
-
-	do {
-		if (IS_UP(newslave->dev)) {
-			if (newslave->link == BOND_LINK_UP) {
-				return newslave;
-			}
-			else if (newslave->link == BOND_LINK_BACK) {
-				/* link up, but waiting for stabilization */
-				if (newslave->delay < mintime) {
-					mintime = newslave->delay;
-					bestslave = newslave;
-				}
-			}
-		}
-	} while ((newslave = newslave->next) != oldslave);
-
-	return bestslave;
-}
-
-/**
- * change_active_interface - change the active slave into the specified one
- * @bond: our bonding struct
- * @new: the new slave to make the active one
- * 
- * Set the new slave to the bond's settings and unset them on the old
- * current_slave.
- * Setting include flags, mc-list, promiscuity, allmulti, etc.
- *
- * If @new's link state is %BOND_LINK_BACK we'll set it to %BOND_LINK_UP,
- * because it is apparently the best available slave we have, even though its
- * updelay hasn't timed out yet.
- *
- * Warning: Caller must hold ptrlock for writing.
- */
-static void change_active_interface(struct bonding *bond, struct slave *new)
-{
-	struct slave *old = bond->current_slave;
-
-	if (old == new) {
-		return;
-	}
-
-	if (new) {
-		if (new->link == BOND_LINK_BACK) {
-			if (USES_PRIMARY(bond_mode)) {
-				printk (KERN_INFO
-					"%s: making interface %s the new "
-					"active one %d ms earlier.\n",
-					bond->device->name, new->dev->name,
-					(updelay - new->delay) * miimon);
-			}
-
-			new->delay = 0;
-			new->link = BOND_LINK_UP;
-			new->jiffies = jiffies;
-
-			if (bond_mode == BOND_MODE_8023AD) {
-				bond_3ad_handle_link_change(new, BOND_LINK_UP);
-			}
-
-			if ((bond_mode == BOND_MODE_TLB) ||
-			    (bond_mode == BOND_MODE_ALB)) {
-				bond_alb_handle_link_change(bond, new, BOND_LINK_UP);
-			}
-		} else {
-			if (USES_PRIMARY(bond_mode)) {
-				printk (KERN_INFO
-					"%s: making interface %s the new active one.\n",
-					bond->device->name, new->dev->name);
-			}
-		}
-	}
-
-	if (bond_mode == BOND_MODE_ACTIVEBACKUP) {
-		if (old) {
-			bond_set_slave_inactive_flags(old);
-		}
-
-		if (new) {
-			bond_set_slave_active_flags(new);
-		}
-	}
-
-	if (USES_PRIMARY(bond_mode)) {
-		bond_mc_update(bond, new, old);
-	}
-
-	if ((bond_mode == BOND_MODE_TLB) ||
-	    (bond_mode == BOND_MODE_ALB)) {
-		bond_alb_assign_current_slave(bond, new);
-	} else {
-		bond->current_slave = new;
-	}
-}
-
-/**
- * reselect_active_interface - select a new active slave, if needed
- * @bond: our bonding struct
- *
- * This functions shoud be called when one of the following occurs:
- * - The old current_slave has been released or lost its link.
- * - The primary_slave has got its link back.
- * - A slave has got its link back and there's no old current_slave.
- *
- * Warning: Caller must hold ptrlock for writing.
- */
-static void reselect_active_interface(struct bonding *bond)
-{
-	struct slave *best_slave;
-
-	best_slave = find_best_interface(bond);
-
-	if (best_slave != bond->current_slave) {
-		change_active_interface(bond, best_slave);
-	}
+	return res;
 }
 
 /*
  * Try to release the slave device <slave> from the bond device <master>
- * It is legal to access current_slave without a lock because all the function
+ * It is legal to access curr_active_slave without a lock because all the function
  * is write-locked.
  *
  * The rules for slave state should be:
@@ -1971,206 +1590,196 @@
  *   for Bonded connections:
  *     The first up interface should be left on and all others downed.
  */
-static int bond_release(struct net_device *master, struct net_device *slave)
+static int bond_release(struct net_device *bond_dev, struct net_device *slave_dev)
 {
-	bonding_t *bond;
-	slave_t *our_slave, *old_current;
+	struct bonding *bond = bond_dev->priv;
+	struct slave *slave, *oldcurrent;
 	struct sockaddr addr;
-	
-	if (master == NULL || slave == NULL)  {
-		return -ENODEV;
+	int mac_addr_differ;
+
+	/* slave is not a slave or master is not master of this slave */
+	if (!(slave_dev->flags & IFF_SLAVE) ||
+	    (slave_dev->master != bond_dev)) {
+		printk(KERN_ERR DRV_NAME
+		       ": Error: %s: cannot release %s.\n",
+		       bond_dev->name, slave_dev->name);
+		return -EINVAL;
 	}
 
-	bond = (struct bonding *) master->priv;
+	write_lock_bh(&bond->lock);
 
-	/* master already enslaved, or slave not enslaved,
-	   or no slave for this master */
-	if ((master->flags & IFF_SLAVE) || !(slave->flags & IFF_SLAVE)) {
-		printk (KERN_DEBUG "%s: cannot release %s.\n", master->name, slave->name);
+	slave = bond_get_slave_by_dev(bond, slave_dev);
+	if (!slave) {
+		/* not a slave of this bond */
+		printk(KERN_INFO DRV_NAME
+		       ": %s: %s not enslaved\n",
+		       bond_dev->name, slave_dev->name);
 		return -EINVAL;
 	}
 
-	write_lock_bh(&bond->lock);
-	bond->current_arp_slave = NULL;
-	our_slave = (slave_t *)bond;
-	old_current = bond->current_slave;
-	while ((our_slave = our_slave->prev) != (slave_t *)bond) {
-		if (our_slave->dev == slave) {
-			int mac_addr_differ = memcmp(bond->device->dev_addr,
-						 our_slave->perm_hwaddr,
-						 ETH_ALEN);
-			if (!mac_addr_differ && (bond->slave_cnt > 1)) {
-				printk(KERN_WARNING "WARNING: the permanent HWaddr of %s "
-				"- %02X:%02X:%02X:%02X:%02X:%02X - "
-				"is still in use by %s. Set the HWaddr "
-				"of %s to a different address "
-				"to avoid conflicts.\n",
-				       slave->name,
-				       our_slave->perm_hwaddr[0],
-				       our_slave->perm_hwaddr[1],
-				       our_slave->perm_hwaddr[2],
-				       our_slave->perm_hwaddr[3],
-				       our_slave->perm_hwaddr[4],
-				       our_slave->perm_hwaddr[5],
-				       bond->device->name,
-				       slave->name);
-			}
+	mac_addr_differ = memcmp(bond_dev->dev_addr,
+				 slave->perm_hwaddr,
+				 ETH_ALEN);
+	if (!mac_addr_differ && (bond->slave_cnt > 1)) {
+		printk(KERN_WARNING DRV_NAME
+		       ": Warning: the permanent HWaddr of %s "
+		       "- %02X:%02X:%02X:%02X:%02X:%02X - is "
+		       "still in use by %s. Set the HWaddr of "
+		       "%s to a different address to avoid "
+		       "conflicts.\n",
+		       slave_dev->name,
+		       slave->perm_hwaddr[0],
+		       slave->perm_hwaddr[1],
+		       slave->perm_hwaddr[2],
+		       slave->perm_hwaddr[3],
+		       slave->perm_hwaddr[4],
+		       slave->perm_hwaddr[5],
+		       bond_dev->name,
+		       slave_dev->name);
+	}
+
+	/* Inform AD package of unbinding of slave. */
+	if (bond->params.mode == BOND_MODE_8023AD) {
+		/* must be called before the slave is
+		 * detached from the list
+		 */
+		bond_3ad_unbind_slave(slave);
+	}
 
-			/* Inform AD package of unbinding of slave. */
-			if (bond_mode == BOND_MODE_8023AD) {
-				/* must be called before the slave is
-				 * detached from the list
-				 */
-				bond_3ad_unbind_slave(our_slave);
-			}
+	printk(KERN_INFO DRV_NAME
+	       ": %s: releasing %s interface %s\n",
+	       bond_dev->name,
+	       (slave->state == BOND_STATE_ACTIVE)
+	       ? "active" : "backup",
+	       slave_dev->name);
 
-			printk (KERN_INFO "%s: releasing %s interface %s\n",
-				master->name,
-				(our_slave->state == BOND_STATE_ACTIVE) ? "active" : "backup",
-				slave->name);
+	oldcurrent = bond->curr_active_slave;
 
-			/* release the slave from its bond */
-			bond_detach_slave(bond, our_slave);
+	bond->current_arp_slave = NULL;
 
-			if (bond->primary_slave == our_slave) {
-				bond->primary_slave = NULL;
-			}
+	/* release the slave from its bond */
+	bond_detach_slave(bond, slave);
 
-			if (bond->current_slave == our_slave) {
-				change_active_interface(bond, NULL);
-				reselect_active_interface(bond);
-			}
+	if (bond->primary_slave == slave) {
+		bond->primary_slave = NULL;
+	}
 
-			if (bond->current_slave == NULL) {
-				printk(KERN_INFO
-					"%s: now running without any active interface !\n",
-					master->name);
-			}
+	if (oldcurrent == slave) {
+		bond_change_active_slave(bond, NULL);
+	}
 
-			if ((bond_mode == BOND_MODE_TLB) ||
-			    (bond_mode == BOND_MODE_ALB)) {
-				/* must be called only after the slave has been
-				 * detached from the list and the current_slave
-				 * has been replaced (if our_slave == old_current)
-				 */
-				bond_alb_deinit_slave(bond, our_slave);
-			}
+	if ((bond->params.mode == BOND_MODE_TLB) ||
+	    (bond->params.mode == BOND_MODE_ALB)) {
+		/* Must be called only after the slave has been
+		 * detached from the list and the curr_active_slave
+		 * has been cleared (if our_slave == old_current),
+		 * but before a new active slave is selected.
+		 */
+		bond_alb_deinit_slave(bond, slave);
+	}
 
-			break;
-		}
+	if (oldcurrent == slave) {
+		bond_select_active_slave(bond);
 
+		if (!bond->curr_active_slave) {
+			printk(KERN_INFO DRV_NAME
+			       ": %s: now running without any active "
+			       "interface !\n",
+			       bond_dev->name);
+		}
 	}
+
 	write_unlock_bh(&bond->lock);
-	
-	if (our_slave == (slave_t *)bond) {
-		/* if we get here, it's because the device was not found */
-		printk (KERN_INFO "%s: %s not enslaved\n", master->name, slave->name);
-		return -EINVAL;
-	}
 
-	/* unset promiscuity level from slave */
-	if (master->flags & IFF_PROMISC) {
-		/* If the mode USES_PRIMARY, then we should only remove its
-		 * promisc settings if it was the current_slave, but that was
-		 * already taken care of above when we detached the slave
-		 */
-		if (!USES_PRIMARY(bond_mode)) {
-			dev_set_promiscuity(slave, -1); 
+	/* If the mode USES_PRIMARY, then we should only remove its
+	 * promisc and mc settings if it was the curr_active_slave, but that was
+	 * already taken care of above when we detached the slave
+	 */
+	if (!USES_PRIMARY(bond->params.mode)) {
+		/* unset promiscuity level from slave */
+		if (bond_dev->flags & IFF_PROMISC) {
+			dev_set_promiscuity(slave_dev, -1);
 		}
-	}
 
-	/* undo settings and restore original values */
-	if (multicast_mode == BOND_MULTICAST_ALL) {
-		/* flush master's mc_list from slave */ 
-		bond_mc_list_flush (slave, master); 
+		/* unset allmulti level from slave */
+		if (bond_dev->flags & IFF_ALLMULTI) {
+			dev_set_allmulti(slave_dev, -1);
+		}
 
-		/* unset allmulti level from slave */ 
-		if (master->flags & IFF_ALLMULTI)
-			dev_set_allmulti(slave, -1); 
+		/* flush master's mc_list from slave */
+		bond_mc_list_flush(bond_dev, slave_dev);
 	}
 
-	netdev_set_master(slave, NULL);
+	netdev_set_master(slave_dev, NULL);
 
 	/* close slave before restoring its mac address */
-	dev_close(slave);
+	dev_close(slave_dev);
 
 	if (app_abi_ver >= 1) {
 		/* restore original ("permanent") mac address */
-		memcpy(addr.sa_data, our_slave->perm_hwaddr, ETH_ALEN);
-		addr.sa_family = slave->type;
-		slave->set_mac_address(slave, &addr);
+		memcpy(addr.sa_data, slave->perm_hwaddr, ETH_ALEN);
+		addr.sa_family = slave_dev->type;
+		slave_dev->set_mac_address(slave_dev, &addr);
 	}
 
 	/* restore the original state of the
 	 * IFF_NOARP flag that might have been
 	 * set by bond_set_slave_inactive_flags()
 	 */
-	if ((our_slave->original_flags & IFF_NOARP) == 0) {
-		slave->flags &= ~IFF_NOARP;
+	if ((slave->original_flags & IFF_NOARP) == 0) {
+		slave_dev->flags &= ~IFF_NOARP;
 	}
 
-	kfree(our_slave);
+	kfree(slave);
 
 	/* if the last slave was removed, zero the mac address
 	 * of the master so it will be set by the application
 	 * to the mac address of the first slave
 	 */
-	if (bond->next == (slave_t*)bond) {
-		memset(master->dev_addr, 0, master->addr_len);
+	if (bond->slave_cnt == 0) {
+		memset(bond_dev->dev_addr, 0, bond_dev->addr_len);
 	}
 
 	return 0;  /* deletion OK */
 }
 
-/* 
+/*
  * This function releases all slaves.
  */
-static int bond_release_all(struct net_device *master)
+static int bond_release_all(struct net_device *bond_dev)
 {
-	bonding_t *bond;
-	slave_t *our_slave, *old_current;
+	struct bonding *bond = bond_dev->priv;
+	struct slave *slave;
 	struct net_device *slave_dev;
 	struct sockaddr addr;
-	int err = 0;
-
-	if (master == NULL)  {
-		return -ENODEV;
-	}
-
-	if (master->flags & IFF_SLAVE) {
-		return -EINVAL;
-	}
-
-	bond = (struct bonding *) master->priv;
 
 	write_lock_bh(&bond->lock);
-	if (bond->next == (struct slave *) bond) {
-		err = -EINVAL;
+
+	if (bond->slave_cnt == 0) {
 		goto out;
 	}
 
-	old_current = bond->current_slave;
-	change_active_interface(bond, NULL);
 	bond->current_arp_slave = NULL;
 	bond->primary_slave = NULL;
+	bond_change_active_slave(bond, NULL);
 
-	while ((our_slave = bond->prev) != (slave_t *)bond) {
+	while ((slave = bond->first_slave) != NULL) {
 		/* Inform AD package of unbinding of slave
 		 * before slave is detached from the list.
 		 */
-		if (bond_mode == BOND_MODE_8023AD) {
-			bond_3ad_unbind_slave(our_slave);
+		if (bond->params.mode == BOND_MODE_8023AD) {
+			bond_3ad_unbind_slave(slave);
 		}
 
-		slave_dev = our_slave->dev;
-		bond_detach_slave(bond, our_slave);
+		slave_dev = slave->dev;
+		bond_detach_slave(bond, slave);
 
-		if ((bond_mode == BOND_MODE_TLB) ||
-		    (bond_mode == BOND_MODE_ALB)) {
+		if ((bond->params.mode == BOND_MODE_TLB) ||
+		    (bond->params.mode == BOND_MODE_ALB)) {
 			/* must be called only after the slave
 			 * has been detached from the list
 			 */
-			bond_alb_deinit_slave(bond, our_slave);
+			bond_alb_deinit_slave(bond, slave);
 		}
 
 		/* now that the slave is detached, unlock and perform
@@ -2179,20 +1788,23 @@
 		 */
 		write_unlock_bh(&bond->lock);
 
-		/* unset promiscuity level from slave */
-		if (master->flags & IFF_PROMISC) {
-			if (!USES_PRIMARY(bond_mode)) {
-				dev_set_promiscuity(slave_dev, -1); 
+		/* If the mode USES_PRIMARY, then we should only remove its
+		 * promisc and mc settings if it was the curr_active_slave, but that was
+		 * already taken care of above when we detached the slave
+		 */
+		if (!USES_PRIMARY(bond->params.mode)) {
+			/* unset promiscuity level from slave */
+			if (bond_dev->flags & IFF_PROMISC) {
+				dev_set_promiscuity(slave_dev, -1);
 			}
-		}
 
-		if (multicast_mode == BOND_MULTICAST_ALL) {
-			/* flush master's mc_list from slave */ 
-			bond_mc_list_flush (slave_dev, master); 
-
-			/* unset allmulti level from slave */ 
-			if (master->flags & IFF_ALLMULTI)
-				dev_set_allmulti(slave_dev, -1); 
+			/* unset allmulti level from slave */
+			if (bond_dev->flags & IFF_ALLMULTI) {
+				dev_set_allmulti(slave_dev, -1);
+			}
+
+			/* flush master's mc_list from slave */
+			bond_mc_list_flush(bond_dev, slave_dev);
 		}
 
 		netdev_set_master(slave_dev, NULL);
@@ -2202,7 +1814,7 @@
 
 		if (app_abi_ver >= 1) {
 			/* restore original ("permanent") mac address*/
-			memcpy(addr.sa_data, our_slave->perm_hwaddr, ETH_ALEN);
+			memcpy(addr.sa_data, slave->perm_hwaddr, ETH_ALEN);
 			addr.sa_family = slave_dev->type;
 			slave_dev->set_mac_address(slave_dev, &addr);
 		}
@@ -2210,11 +1822,11 @@
 		/* restore the original state of the IFF_NOARP flag that might have
 		 * been set by bond_set_slave_inactive_flags()
 		 */
-		if ((our_slave->original_flags & IFF_NOARP) == 0) {
+		if ((slave->original_flags & IFF_NOARP) == 0) {
 			slave_dev->flags &= ~IFF_NOARP;
 		}
 
-		kfree(our_slave);
+		kfree(slave);
 
 		/* re-acquire the lock before getting the next slave */
 		write_lock_bh(&bond->lock);
@@ -2224,72 +1836,240 @@
 	 * set by the application to the mac address of the
 	 * first slave
 	 */
-	memset(master->dev_addr, 0, master->addr_len);
+	memset(bond_dev->dev_addr, 0, bond_dev->addr_len);
 
-	printk (KERN_INFO "%s: released all slaves\n", master->name);
+	printk(KERN_INFO DRV_NAME
+	       ": %s: released all slaves\n",
+	       bond_dev->name);
 
 out:
 	write_unlock_bh(&bond->lock);
 
-	return err;
+	return 0;
 }
 
-/* this function is called regularly to monitor each slave's link. */
-static void bond_mii_monitor(struct net_device *master)
+/*
+ * This function changes the active slave to slave <slave_dev>.
+ * It returns -EINVAL in the following cases.
+ *  - <slave_dev> is not found in the list.
+ *  - There is not active slave now.
+ *  - <slave_dev> is already active.
+ *  - The link state of <slave_dev> is not BOND_LINK_UP.
+ *  - <slave_dev> is not running.
+ * In these cases, this fuction does nothing.
+ * In the other cases, currnt_slave pointer is changed and 0 is returned.
+ */
+static int bond_ioctl_change_active(struct net_device *bond_dev, struct net_device *slave_dev)
 {
-	bonding_t *bond = (struct bonding *) master->priv;
-	slave_t *slave, *oldcurrent;
-	int slave_died = 0;
-	int do_failover = 0;
+	struct bonding *bond = bond_dev->priv;
+	struct slave *old_active = NULL;
+	struct slave *new_active = NULL;
+	int res = 0;
 
-	read_lock(&bond->lock);
+	if (!USES_PRIMARY(bond->params.mode)) {
+		return -EINVAL;
+	}
 
-	/* we will try to read the link status of each of our slaves, and
-	 * set their IFF_RUNNING flag appropriately. For each slave not
-	 * supporting MII status, we won't do anything so that a user-space
-	 * program could monitor the link itself if needed.
-	 */
+	/* Verify that master_dev is indeed the master of slave_dev */
+	if (!(slave_dev->flags & IFF_SLAVE) ||
+	    (slave_dev->master != bond_dev)) {
+		return -EINVAL;
+	}
 
-	slave = (slave_t *)bond;
+	write_lock_bh(&bond->lock);
+
+	old_active = bond->curr_active_slave;
+	new_active = bond_get_slave_by_dev(bond, slave_dev);
+
+	/*
+	 * Changing to the current active: do nothing; return success.
+	 */
+	if (new_active && (new_active == old_active)) {
+		write_unlock_bh(&bond->lock);
+		return 0;
+	}
+
+	if ((new_active) &&
+	    (old_active) &&
+	    (new_active->link == BOND_LINK_UP) &&
+	    IS_UP(new_active->dev)) {
+		bond_change_active_slave(bond, new_active);
+	} else {
+		res = -EINVAL;
+	}
+
+	write_unlock_bh(&bond->lock);
+
+	return res;
+}
+
+static int bond_ethtool_ioctl(struct net_device *bond_dev, struct ifreq *ifr)
+{
+	struct ethtool_drvinfo info;
+	void *addr = ifr->ifr_data;
+	uint32_t cmd;
+
+	if (get_user(cmd, (uint32_t *)addr)) {
+		return -EFAULT;
+	}
+
+	switch (cmd) {
+	case ETHTOOL_GDRVINFO:
+		if (copy_from_user(&info, addr, sizeof(info))) {
+			return -EFAULT;
+		}
+
+		if (strcmp(info.driver, "ifenslave") == 0) {
+			int new_abi_ver;
+			char *endptr;
+
+			new_abi_ver = simple_strtoul(info.fw_version,
+						     &endptr, 0);
+			if (*endptr) {
+				printk(KERN_ERR DRV_NAME
+				       ": Error: got invalid ABI "
+				       "version from application\n");
+
+				return -EINVAL;
+			}
+
+			if (orig_app_abi_ver == -1) {
+				orig_app_abi_ver  = new_abi_ver;
+			}
+
+			app_abi_ver = new_abi_ver;
+		}
+
+		strncpy(info.driver,  DRV_NAME, 32);
+		strncpy(info.version, DRV_VERSION, 32);
+		snprintf(info.fw_version, 32, "%d", BOND_ABI_VERSION);
+
+		if (copy_to_user(addr, &info, sizeof(info))) {
+			return -EFAULT;
+		}
+
+		return 0;
+	default:
+		return -EOPNOTSUPP;
+	}
+}
+
+static int bond_info_query(struct net_device *bond_dev, struct ifbond *info)
+{
+	struct bonding *bond = bond_dev->priv;
+
+	info->bond_mode = bond->params.mode;
+	info->miimon = bond->params.miimon;
+
+	read_lock_bh(&bond->lock);
+	info->num_slaves = bond->slave_cnt;
+	read_unlock_bh(&bond->lock);
+
+	return 0;
+}
+
+static int bond_slave_info_query(struct net_device *bond_dev, struct ifslave *info)
+{
+	struct bonding *bond = bond_dev->priv;
+	struct slave *slave;
+	int i, found = 0;
+
+	if (info->slave_id < 0) {
+		return -ENODEV;
+	}
+
+	read_lock_bh(&bond->lock);
+
+	bond_for_each_slave(bond, slave, i) {
+		if (i == (int)info->slave_id) {
+			found = 1;
+			break;
+		}
+	}
+
+	read_unlock_bh(&bond->lock);
+
+	if (found) {
+		strcpy(info->slave_name, slave->dev->name);
+		info->link = slave->link;
+		info->state = slave->state;
+		info->link_failure_count = slave->link_failure_count;
+	} else {
+		return -ENODEV;
+	}
+
+	return 0;
+}
+
+/*-------------------------------- Monitoring -------------------------------*/
+
+/* this function is called regularly to monitor each slave's link. */
+static void bond_mii_monitor(struct net_device *bond_dev)
+{
+	struct bonding *bond = bond_dev->priv;
+	struct slave *slave, *oldcurrent;
+	int do_failover = 0;
+	int delta_in_ticks;
+	int i;
+
+	read_lock(&bond->lock);
+
+	delta_in_ticks = (bond->params.miimon * HZ) / 1000;
+
+	if (bond->kill_timers) {
+		goto out;
+	}
 
-	read_lock(&bond->ptrlock);
-	oldcurrent = bond->current_slave;
-	read_unlock(&bond->ptrlock);
+	if (bond->slave_cnt == 0) {
+		goto re_arm;
+	}
+
+	/* we will try to read the link status of each of our slaves, and
+	 * set their IFF_RUNNING flag appropriately. For each slave not
+	 * supporting MII status, we won't do anything so that a user-space
+	 * program could monitor the link itself if needed.
+	 */
 
-	while ((slave = slave->prev) != (slave_t *)bond) {
-		struct net_device *dev = slave->dev;
+	read_lock(&bond->curr_slave_lock);
+	oldcurrent = bond->curr_active_slave;
+	read_unlock(&bond->curr_slave_lock);
+
+	bond_for_each_slave(bond, slave, i) {
+		struct net_device *slave_dev = slave->dev;
 		int link_state;
 		u16 old_speed = slave->speed;
 		u8 old_duplex = slave->duplex;
-		
-		link_state = bond_check_dev_link(dev, 0);
+
+		link_state = bond_check_dev_link(bond, slave_dev, 0);
 
 		switch (slave->link) {
 		case BOND_LINK_UP:	/* the link was up */
 			if (link_state == BMSR_LSTATUS) {
 				/* link stays up, nothing more to do */
 				break;
-			}
-			else { /* link going down */
+			} else { /* link going down */
 				slave->link  = BOND_LINK_FAIL;
-				slave->delay = downdelay;
+				slave->delay = bond->params.downdelay;
+
 				if (slave->link_failure_count < UINT_MAX) {
 					slave->link_failure_count++;
 				}
-				if (downdelay > 0) {
-					printk (KERN_INFO
-						"%s: link status down for %sinterface "
-						"%s, disabling it in %d ms.\n",
-						master->name,
-						IS_UP(dev)
-						? ((bond_mode == BOND_MODE_ACTIVEBACKUP)
-						   ? ((slave == oldcurrent)
-						      ? "active " : "backup ")
-						   : "")
-						: "idle ",
-						dev->name,
-						downdelay * miimon);
-					}
+
+				if (bond->params.downdelay) {
+					printk(KERN_INFO DRV_NAME
+					       ": %s: link status down for %s "
+					       "interface %s, disabling it in "
+					       "%d ms.\n",
+					       bond_dev->name,
+					       IS_UP(slave_dev)
+					       ? ((bond->params.mode == BOND_MODE_ACTIVEBACKUP)
+						  ? ((slave == oldcurrent)
+						     ? "active " : "backup ")
+						  : "")
+					       : "idle ",
+					       slave_dev->name,
+					       bond->params.downdelay * bond->params.miimon);
+				}
 			}
 			/* no break ! fall through the BOND_LINK_FAIL test to
 			   ensure proper action to be taken
@@ -2300,35 +2080,35 @@
 				if (slave->delay <= 0) {
 					/* link down for too long time */
 					slave->link = BOND_LINK_DOWN;
+
 					/* in active/backup mode, we must
 					 * completely disable this interface
 					 */
-					if ((bond_mode == BOND_MODE_ACTIVEBACKUP) ||
-					    (bond_mode == BOND_MODE_8023AD)) {
+					if ((bond->params.mode == BOND_MODE_ACTIVEBACKUP) ||
+					    (bond->params.mode == BOND_MODE_8023AD)) {
 						bond_set_slave_inactive_flags(slave);
 					}
 
-					printk(KERN_INFO
-						"%s: link status definitely down "
-						"for interface %s, disabling it",
-						master->name,
-						dev->name);
+					printk(KERN_INFO DRV_NAME
+					       ": %s: link status definitely "
+					       "down for interface %s, "
+					       "disabling it\n",
+					       bond_dev->name,
+					       slave_dev->name);
 
 					/* notify ad that the link status has changed */
-					if (bond_mode == BOND_MODE_8023AD) {
+					if (bond->params.mode == BOND_MODE_8023AD) {
 						bond_3ad_handle_link_change(slave, BOND_LINK_DOWN);
 					}
 
-					if ((bond_mode == BOND_MODE_TLB) ||
-					    (bond_mode == BOND_MODE_ALB)) {
+					if ((bond->params.mode == BOND_MODE_TLB) ||
+					    (bond->params.mode == BOND_MODE_ALB)) {
 						bond_alb_handle_link_change(bond, slave, BOND_LINK_DOWN);
 					}
 
 					if (slave == oldcurrent) {
 						do_failover = 1;
 					}
-
-					slave_died = 1;
 				} else {
 					slave->delay--;
 				}
@@ -2336,12 +2116,12 @@
 				/* link up again */
 				slave->link  = BOND_LINK_UP;
 				slave->jiffies = jiffies;
-				printk(KERN_INFO
-					"%s: link status up again after %d ms "
-					"for interface %s.\n",
-					master->name,
-					(downdelay - slave->delay) * miimon,
-					dev->name);
+				printk(KERN_INFO DRV_NAME
+				       ": %s: link status up again after %d "
+				       "ms for interface %s.\n",
+				       bond_dev->name,
+				       (bond->params.downdelay - slave->delay) * bond->params.miimon,
+				       slave_dev->name);
 			}
 			break;
 		case BOND_LINK_DOWN:	/* the link was down */
@@ -2350,17 +2130,18 @@
 				break;
 			} else {	/* link going up */
 				slave->link  = BOND_LINK_BACK;
-				slave->delay = updelay;
-				
-				if (updelay > 0) {
+				slave->delay = bond->params.updelay;
+
+				if (bond->params.updelay) {
 					/* if updelay == 0, no need to
 					   advertise about a 0 ms delay */
-					printk (KERN_INFO
-						"%s: link status up for interface"
-						" %s, enabling it in %d ms.\n",
-						master->name,
-						dev->name,
-						updelay * miimon);
+					printk(KERN_INFO DRV_NAME
+					       ": %s: link status up for "
+					       "interface %s, enabling it "
+					       "in %d ms.\n",
+					       bond_dev->name,
+					       slave_dev->name,
+					       bond->params.updelay * bond->params.miimon);
 				}
 			}
 			/* no break ! fall through the BOND_LINK_BACK state in
@@ -2370,12 +2151,13 @@
 			if (link_state != BMSR_LSTATUS) {
 				/* link down again */
 				slave->link  = BOND_LINK_DOWN;
-				printk(KERN_INFO
-					"%s: link status down again after %d ms "
-					"for interface %s.\n",
-					master->name,
-					(updelay - slave->delay) * miimon,
-					dev->name);
+
+				printk(KERN_INFO DRV_NAME
+				       ": %s: link status down again after %d "
+				       "ms for interface %s.\n",
+				       bond_dev->name,
+				       (bond->params.updelay - slave->delay) * bond->params.miimon,
+				       slave_dev->name);
 			} else {
 				/* link stays up */
 				if (slave->delay == 0) {
@@ -2383,11 +2165,10 @@
 					slave->link = BOND_LINK_UP;
 					slave->jiffies = jiffies;
 
-					if (bond_mode == BOND_MODE_8023AD) {
+					if (bond->params.mode == BOND_MODE_8023AD) {
 						/* prevent it from being the active one */
 						slave->state = BOND_STATE_BACKUP;
-					}
-					else if (bond_mode != BOND_MODE_ACTIVEBACKUP) {
+					} else if (bond->params.mode != BOND_MODE_ACTIVEBACKUP) {
 						/* make it immediately active */
 						slave->state = BOND_STATE_ACTIVE;
 					} else if (slave != bond->primary_slave) {
@@ -2395,23 +2176,23 @@
 						slave->state = BOND_STATE_BACKUP;
 					}
 
-					printk(KERN_INFO
-						"%s: link status definitely up "
-						"for interface %s.\n",
-						master->name,
-						dev->name);
-	
+					printk(KERN_INFO DRV_NAME
+					       ": %s: link status definitely "
+					       "up for interface %s.\n",
+					       bond_dev->name,
+					       slave_dev->name);
+
 					/* notify ad that the link status has changed */
-					if (bond_mode == BOND_MODE_8023AD) {
+					if (bond->params.mode == BOND_MODE_8023AD) {
 						bond_3ad_handle_link_change(slave, BOND_LINK_UP);
 					}
 
-					if ((bond_mode == BOND_MODE_TLB) ||
-					    (bond_mode == BOND_MODE_ALB)) {
+					if ((bond->params.mode == BOND_MODE_TLB) ||
+					    (bond->params.mode == BOND_MODE_ALB)) {
 						bond_alb_handle_link_change(bond, slave, BOND_LINK_UP);
 					}
 
-					if ((oldcurrent == NULL) ||
+					if ((!oldcurrent) ||
 					    (slave == bond->primary_slave)) {
 						do_failover = 1;
 					}
@@ -2420,120 +2201,128 @@
 				}
 			}
 			break;
-		} /* end of switch */
+		default:
+			/* Should not happen */
+			printk(KERN_ERR "bonding: Error: %s  Illegal value (link=%d)\n",
+			       slave->dev->name, slave->link);
+			goto out;
+		} /* end of switch (slave->link) */
 
 		bond_update_speed_duplex(slave);
 
-		if (bond_mode == BOND_MODE_8023AD) {
+		if (bond->params.mode == BOND_MODE_8023AD) {
 			if (old_speed != slave->speed) {
 				bond_3ad_adapter_speed_changed(slave);
 			}
+
 			if (old_duplex != slave->duplex) {
 				bond_3ad_adapter_duplex_changed(slave);
 			}
 		}
 
-	} /* end of while */
+	} /* end of for */
 
 	if (do_failover) {
-		write_lock(&bond->ptrlock);
+		write_lock(&bond->curr_slave_lock);
+
+		bond_select_active_slave(bond);
 
-		reselect_active_interface(bond);
-		if (oldcurrent && !bond->current_slave) {
-			printk(KERN_INFO
-				"%s: now running without any active interface !\n",
-				master->name);
+		if (oldcurrent && !bond->curr_active_slave) {
+			printk(KERN_INFO DRV_NAME
+			       ": %s: now running without any active "
+			       "interface !\n",
+			       bond_dev->name);
 		}
 
-		write_unlock(&bond->ptrlock);
+		write_unlock(&bond->curr_slave_lock);
 	}
 
+re_arm:
+	if (bond->params.miimon) {
+		mod_timer(&bond->mii_timer, jiffies + delta_in_ticks);
+	}
+out:
 	read_unlock(&bond->lock);
-	/* re-arm the timer */
-	mod_timer(&bond->mii_timer, jiffies + (miimon * HZ / 1000));
 }
 
-/* 
- * this function is called regularly to monitor each slave's link 
+static void bond_arp_send_all(struct bonding *bond, struct slave *slave)
+{
+	int i;
+	u32 *targets = bond->params.arp_targets;
+
+	for (i = 0; (i < BOND_MAX_ARP_TARGETS) && targets[i]; i++) {
+		arp_send(ARPOP_REQUEST, ETH_P_ARP, targets[i], slave->dev,
+			 my_ip, NULL, slave->dev->dev_addr,
+			 NULL);
+	}
+}
+
+/*
+ * this function is called regularly to monitor each slave's link
  * ensuring that traffic is being sent and received when arp monitoring
- * is used in load-balancing mode. if the adapter has been dormant, then an 
- * arp is transmitted to generate traffic. see activebackup_arp_monitor for 
- * arp monitoring in active backup mode. 
+ * is used in load-balancing mode. if the adapter has been dormant, then an
+ * arp is transmitted to generate traffic. see activebackup_arp_monitor for
+ * arp monitoring in active backup mode.
  */
-static void loadbalance_arp_monitor(struct net_device *master)
+static void bond_loadbalance_arp_mon(struct net_device *bond_dev)
 {
-	bonding_t *bond;
-	slave_t *slave, *oldcurrent;
-	int the_delta_in_ticks =  arp_interval * HZ / 1000;
-	int next_timer = jiffies + (arp_interval * HZ / 1000);
+	struct bonding *bond = bond_dev->priv;
+	struct slave *slave, *oldcurrent;
 	int do_failover = 0;
+	int delta_in_ticks;
+	int i;
 
-	bond = (struct bonding *) master->priv; 
-	if (master->priv == NULL) {
-		mod_timer(&bond->arp_timer, next_timer);
-		return;
-	}
+	read_lock(&bond->lock);
 
-	/* TODO: investigate why rtnl_shlock_nowait and rtnl_exlock_nowait
-	 * are called below and add comment why they are required... 
-	 */
-	if ((!IS_UP(master)) || rtnl_shlock_nowait()) {
-		mod_timer(&bond->arp_timer, next_timer);
-		return;
-	}
+	delta_in_ticks = (bond->params.arp_interval * HZ) / 1000;
 
-	if (rtnl_exlock_nowait()) {
-		rtnl_shunlock();
-		mod_timer(&bond->arp_timer, next_timer);
-		return;
+	if (bond->kill_timers) {
+		goto out;
 	}
 
-	read_lock(&bond->lock);
+	if (bond->slave_cnt == 0) {
+		goto re_arm;
+	}
 
-	read_lock(&bond->ptrlock);
-	oldcurrent = bond->current_slave;
-	read_unlock(&bond->ptrlock);
+	read_lock(&bond->curr_slave_lock);
+	oldcurrent = bond->curr_active_slave;
+	read_unlock(&bond->curr_slave_lock);
 
 	/* see if any of the previous devices are up now (i.e. they have
-	 * xmt and rcv traffic). the current_slave does not come into
+	 * xmt and rcv traffic). the curr_active_slave does not come into
 	 * the picture unless it is null. also, slave->jiffies is not needed
 	 * here because we send an arp on each slave and give a slave as
 	 * long as it needs to get the tx/rx within the delta.
 	 * TODO: what about up/down delay in arp mode? it wasn't here before
-	 *       so it can wait 
+	 *       so it can wait
 	 */
-	slave = (slave_t *)bond;
-	while ((slave = slave->prev) != (slave_t *)bond)  {
-
-	  	if (slave->link != BOND_LINK_UP) {
-
-	  		if (((jiffies - slave->dev->trans_start) <= 
-						the_delta_in_ticks) &&  
-			     ((jiffies - slave->dev->last_rx) <= 
-						the_delta_in_ticks)) {
+	bond_for_each_slave(bond, slave, i) {
+		if (slave->link != BOND_LINK_UP) {
+			if (((jiffies - slave->dev->trans_start) <= delta_in_ticks) &&
+			    ((jiffies - slave->dev->last_rx) <= delta_in_ticks)) {
 
 				slave->link  = BOND_LINK_UP;
 				slave->state = BOND_STATE_ACTIVE;
 
 				/* primary_slave has no meaning in round-robin
-				 * mode. the window of a slave being up and 
-				 * current_slave being null after enslaving
+				 * mode. the window of a slave being up and
+				 * curr_active_slave being null after enslaving
 				 * is closed.
 				 */
-				if (oldcurrent == NULL) {
-					printk(KERN_INFO
-						"%s: link status definitely up "
-						"for interface %s, ",
-						master->name,
-						slave->dev->name);
+				if (!oldcurrent) {
+					printk(KERN_INFO DRV_NAME
+					       ": %s: link status definitely "
+					       "up for interface %s, ",
+					       bond_dev->name,
+					       slave->dev->name);
 					do_failover = 1;
 				} else {
-					printk(KERN_INFO
-						"%s: interface %s is now up\n",
-						master->name,
-						slave->dev->name);
+					printk(KERN_INFO DRV_NAME
+					       ": %s: interface %s is now up\n",
+					       bond_dev->name,
+					       slave->dev->name);
 				}
-			} 
+			}
 		} else {
 			/* slave->link == BOND_LINK_UP */
 
@@ -2541,224 +2330,237 @@
 			 * when the source ip is 0, so don't take the link down
 			 * if we don't know our ip yet
 			 */
-			if (((jiffies - slave->dev->trans_start) >= 
-		              (2*the_delta_in_ticks)) ||
-		             (((jiffies - slave->dev->last_rx) >= 
-		               (2*the_delta_in_ticks)) && my_ip !=0)) {
+			if (((jiffies - slave->dev->trans_start) >= (2*delta_in_ticks)) ||
+			    (((jiffies - slave->dev->last_rx) >= (2*delta_in_ticks)) &&
+			     my_ip)) {
+
 				slave->link  = BOND_LINK_DOWN;
 				slave->state = BOND_STATE_BACKUP;
+
 				if (slave->link_failure_count < UINT_MAX) {
 					slave->link_failure_count++;
 				}
-				printk(KERN_INFO
-				       "%s: interface %s is now down.\n",
-				       master->name,
+
+				printk(KERN_INFO DRV_NAME
+				       ": %s: interface %s is now down.\n",
+				       bond_dev->name,
 				       slave->dev->name);
 
 				if (slave == oldcurrent) {
 					do_failover = 1;
 				}
 			}
-		} 
+		}
 
-		/* note: if switch is in round-robin mode, all links 
+		/* note: if switch is in round-robin mode, all links
 		 * must tx arp to ensure all links rx an arp - otherwise
-		 * links may oscillate or not come up at all; if switch is 
-		 * in something like xor mode, there is nothing we can 
-		 * do - all replies will be rx'ed on same link causing slaves 
+		 * links may oscillate or not come up at all; if switch is
+		 * in something like xor mode, there is nothing we can
+		 * do - all replies will be rx'ed on same link causing slaves
 		 * to be unstable during low/no traffic periods
 		 */
 		if (IS_UP(slave->dev)) {
-			arp_send_all(slave);
+			bond_arp_send_all(bond, slave);
 		}
 	}
 
 	if (do_failover) {
-		write_lock(&bond->ptrlock);
+		write_lock(&bond->curr_slave_lock);
 
-		reselect_active_interface(bond);
-		if (oldcurrent && !bond->current_slave) {
-			printk(KERN_INFO
-				"%s: now running without any active interface !\n",
-				master->name);
+		bond_select_active_slave(bond);
+
+		if (oldcurrent && !bond->curr_active_slave) {
+			printk(KERN_INFO DRV_NAME
+			       ": %s: now running without any active "
+			       "interface !\n",
+			       bond_dev->name);
 		}
 
-		write_unlock(&bond->ptrlock);
+		write_unlock(&bond->curr_slave_lock);
 	}
 
+re_arm:
+	if (bond->params.arp_interval) {
+		mod_timer(&bond->arp_timer, jiffies + delta_in_ticks);
+	}
+out:
 	read_unlock(&bond->lock);
-	rtnl_exunlock();
-	rtnl_shunlock();
-
-	/* re-arm the timer */
-	mod_timer(&bond->arp_timer, next_timer);
 }
 
-/* 
+/*
  * When using arp monitoring in active-backup mode, this function is
  * called to determine if any backup slaves have went down or a new
  * current slave needs to be found.
- * The backup slaves never generate traffic, they are considered up by merely 
- * receiving traffic. If the current slave goes down, each backup slave will 
- * be given the opportunity to tx/rx an arp before being taken down - this 
- * prevents all slaves from being taken down due to the current slave not 
+ * The backup slaves never generate traffic, they are considered up by merely
+ * receiving traffic. If the current slave goes down, each backup slave will
+ * be given the opportunity to tx/rx an arp before being taken down - this
+ * prevents all slaves from being taken down due to the current slave not
  * sending any traffic for the backups to receive. The arps are not necessarily
- * necessary, any tx and rx traffic will keep the current slave up. While any 
- * rx traffic will keep the backup slaves up, the current slave is responsible 
- * for generating traffic to keep them up regardless of any other traffic they 
+ * necessary, any tx and rx traffic will keep the current slave up. While any
+ * rx traffic will keep the backup slaves up, the current slave is responsible
+ * for generating traffic to keep them up regardless of any other traffic they
  * may have received.
  * see loadbalance_arp_monitor for arp monitoring in load balancing mode
  */
-static void activebackup_arp_monitor(struct net_device *master)
+static void bond_activebackup_arp_mon(struct net_device *bond_dev)
 {
-	bonding_t *bond;
-	slave_t *slave;
-	int the_delta_in_ticks =  arp_interval * HZ / 1000;
-	int next_timer = jiffies + (arp_interval * HZ / 1000);
-
-	bond = (struct bonding *) master->priv; 
-	if (master->priv == NULL) {
-		mod_timer(&bond->arp_timer, next_timer);
-		return;
-	}
+	struct bonding *bond = bond_dev->priv;
+	struct slave *slave;
+	int delta_in_ticks;
+	int i;
 
-	if (!IS_UP(master)) {
-		mod_timer(&bond->arp_timer, next_timer);
-		return;
+	read_lock(&bond->lock);
+
+	delta_in_ticks = (bond->params.arp_interval * HZ) / 1000;
+
+	if (bond->kill_timers) {
+		goto out;
 	}
 
-	read_lock(&bond->lock);
+	if (bond->slave_cnt == 0) {
+		goto re_arm;
+	}
 
-	/* determine if any slave has come up or any backup slave has 
-	 * gone down 
+	/* determine if any slave has come up or any backup slave has
+	 * gone down
 	 * TODO: what about up/down delay in arp mode? it wasn't here before
-	 *       so it can wait 
+	 *       so it can wait
 	 */
-	slave = (slave_t *)bond;
-	while ((slave = slave->prev) != (slave_t *)bond)  {
-
-	  	if (slave->link != BOND_LINK_UP) {
-			if ((jiffies - slave->dev->last_rx) <=
-			    the_delta_in_ticks) {
+	bond_for_each_slave(bond, slave, i) {
+		if (slave->link != BOND_LINK_UP) {
+			if ((jiffies - slave->dev->last_rx) <= delta_in_ticks) {
 
 				slave->link = BOND_LINK_UP;
-				write_lock(&bond->ptrlock);
-				if ((bond->current_slave == NULL) &&
-				    ((jiffies - slave->dev->trans_start) <=
-				     the_delta_in_ticks)) {
-					change_active_interface(bond, slave);
+
+				write_lock(&bond->curr_slave_lock);
+
+				if ((!bond->curr_active_slave) &&
+				    ((jiffies - slave->dev->trans_start) <= delta_in_ticks)) {
+					bond_change_active_slave(bond, slave);
 					bond->current_arp_slave = NULL;
-				} else if (bond->current_slave != slave) {
-					/* this slave has just come up but we 
+				} else if (bond->curr_active_slave != slave) {
+					/* this slave has just come up but we
 					 * already have a current slave; this
 					 * can also happen if bond_enslave adds
-					 * a new slave that is up while we are 
+					 * a new slave that is up while we are
 					 * searching for a new slave
 					 */
 					bond_set_slave_inactive_flags(slave);
 					bond->current_arp_slave = NULL;
 				}
 
-				if (slave == bond->current_slave) {
-					printk(KERN_INFO
-						"%s: %s is up and now the "
-						"active interface\n",
-						master->name,
-						slave->dev->name);
+				if (slave == bond->curr_active_slave) {
+					printk(KERN_INFO DRV_NAME
+					       ": %s: %s is up and now the "
+					       "active interface\n",
+					       bond_dev->name,
+					       slave->dev->name);
 				} else {
-					printk(KERN_INFO
-						"%s: backup interface %s is "
-						"now up\n",
-						master->name,
-						slave->dev->name);
+					printk(KERN_INFO DRV_NAME
+					       ": %s: backup interface %s is "
+					       "now up\n",
+					       bond_dev->name,
+					       slave->dev->name);
 				}
 
-				write_unlock(&bond->ptrlock);
+				write_unlock(&bond->curr_slave_lock);
 			}
 		} else {
-			read_lock(&bond->ptrlock);
-			if ((slave != bond->current_slave) &&
-			    (bond->current_arp_slave == NULL) &&
-			    (((jiffies - slave->dev->last_rx) >=
-			     3*the_delta_in_ticks) && (my_ip != 0))) {
-				/* a backup slave has gone down; three times 
-				 * the delta allows the current slave to be 
+			read_lock(&bond->curr_slave_lock);
+
+			if ((slave != bond->curr_active_slave) &&
+			    (!bond->current_arp_slave) &&
+			    (((jiffies - slave->dev->last_rx) >= 3*delta_in_ticks) &&
+			     my_ip)) {
+				/* a backup slave has gone down; three times
+				 * the delta allows the current slave to be
 				 * taken out before the backup slave.
 				 * note: a non-null current_arp_slave indicates
-				 * the current_slave went down and we are 
-				 * searching for a new one; under this 
-				 * condition we only take the current_slave 
-				 * down - this gives each slave a chance to 
+				 * the curr_active_slave went down and we are
+				 * searching for a new one; under this
+				 * condition we only take the curr_active_slave
+				 * down - this gives each slave a chance to
 				 * tx/rx traffic before being taken out
 				 */
-				read_unlock(&bond->ptrlock);
+
+				read_unlock(&bond->curr_slave_lock);
+
 				slave->link  = BOND_LINK_DOWN;
+
 				if (slave->link_failure_count < UINT_MAX) {
 					slave->link_failure_count++;
 				}
+
 				bond_set_slave_inactive_flags(slave);
-				printk(KERN_INFO
-					"%s: backup interface %s is now down\n",
-					master->name,
-					slave->dev->name);
+
+				printk(KERN_INFO DRV_NAME
+				       ": %s: backup interface %s is now down\n",
+				       bond_dev->name,
+				       slave->dev->name);
 			} else {
-				read_unlock(&bond->ptrlock);
+				read_unlock(&bond->curr_slave_lock);
 			}
 		}
 	}
 
-	read_lock(&bond->ptrlock);
-	slave = bond->current_slave;
-	read_unlock(&bond->ptrlock);
-
-	if (slave != NULL) {
+	read_lock(&bond->curr_slave_lock);
+	slave = bond->curr_active_slave;
+	read_unlock(&bond->curr_slave_lock);
 
+	if (slave) {
 		/* if we have sent traffic in the past 2*arp_intervals but
-		 * haven't xmit and rx traffic in that time interval, select 
+		 * haven't xmit and rx traffic in that time interval, select
 		 * a different slave. slave->jiffies is only updated when
-		 * a slave first becomes the current_slave - not necessarily
-		 * after every arp; this ensures the slave has a full 2*delta 
-		 * before being taken out. if a primary is being used, check 
-		 * if it is up and needs to take over as the current_slave
+		 * a slave first becomes the curr_active_slave - not necessarily
+		 * after every arp; this ensures the slave has a full 2*delta
+		 * before being taken out. if a primary is being used, check
+		 * if it is up and needs to take over as the curr_active_slave
 		 */
-		if ((((jiffies - slave->dev->trans_start) >= 
-		       (2*the_delta_in_ticks)) ||
-		     (((jiffies - slave->dev->last_rx) >= 
-		       (2*the_delta_in_ticks)) && (my_ip != 0))) &&
-		    ((jiffies - slave->jiffies) >= 2*the_delta_in_ticks)) {
+		if ((((jiffies - slave->dev->trans_start) >= (2*delta_in_ticks)) ||
+		     (((jiffies - slave->dev->last_rx) >= (2*delta_in_ticks)) &&
+		      my_ip)) &&
+		    ((jiffies - slave->jiffies) >= 2*delta_in_ticks)) {
 
 			slave->link  = BOND_LINK_DOWN;
+
 			if (slave->link_failure_count < UINT_MAX) {
 				slave->link_failure_count++;
 			}
-			printk(KERN_INFO "%s: link status down for "
-					 "active interface %s, disabling it",
-			       master->name,
+
+			printk(KERN_INFO DRV_NAME
+			       ": %s: link status down for active interface "
+			       "%s, disabling it\n",
+			       bond_dev->name,
 			       slave->dev->name);
-			write_lock(&bond->ptrlock);
-			reselect_active_interface(bond);
-			slave = bond->current_slave;
-			write_unlock(&bond->ptrlock);
+
+			write_lock(&bond->curr_slave_lock);
+
+			bond_select_active_slave(bond);
+			slave = bond->curr_active_slave;
+
+			write_unlock(&bond->curr_slave_lock);
+
 			bond->current_arp_slave = slave;
-			if (slave != NULL) {
+
+			if (slave) {
 				slave->jiffies = jiffies;
 			}
-
-		} else if ((bond->primary_slave != NULL) && 
-			   (bond->primary_slave != slave) && 
+		} else if ((bond->primary_slave) &&
+			   (bond->primary_slave != slave) &&
 			   (bond->primary_slave->link == BOND_LINK_UP)) {
-			/* at this point, slave is the current_slave */
-			printk(KERN_INFO 
-			       "%s: changing from interface %s to primary "
+			/* at this point, slave is the curr_active_slave */
+			printk(KERN_INFO DRV_NAME
+			       ": %s: changing from interface %s to primary "
 			       "interface %s\n",
-			       master->name, 
-			       slave->dev->name, 
+			       bond_dev->name,
+			       slave->dev->name,
 			       bond->primary_slave->dev->name);
-			       
+
 			/* primary is up so switch to it */
-			write_lock(&bond->ptrlock);
-			change_active_interface(bond, bond->primary_slave);
-			write_unlock(&bond->ptrlock);
+			write_lock(&bond->curr_slave_lock);
+			bond_change_active_slave(bond, bond->primary_slave);
+			write_unlock(&bond->curr_slave_lock);
+
 			slave = bond->primary_slave;
 			slave->jiffies = jiffies;
 		} else {
@@ -2768,567 +2570,617 @@
 		/* the current slave must tx an arp to ensure backup slaves
 		 * rx traffic
 		 */
-		if ((slave != NULL) && (my_ip != 0)) {
-			arp_send_all(slave);
+		if (slave && my_ip) {
+			bond_arp_send_all(bond, slave);
 		}
 	}
 
-	/* if we don't have a current_slave, search for the next available 
-	 * backup slave from the current_arp_slave and make it the candidate 
-	 * for becoming the current_slave
+	/* if we don't have a curr_active_slave, search for the next available
+	 * backup slave from the current_arp_slave and make it the candidate
+	 * for becoming the curr_active_slave
 	 */
-	if (slave == NULL) { 
-
-		if ((bond->current_arp_slave == NULL) ||
-		    (bond->current_arp_slave == (slave_t *)bond)) {
-			bond->current_arp_slave = bond->prev;
-		} 
+	if (!slave) {
+		if (!bond->current_arp_slave) {
+			bond->current_arp_slave = bond->first_slave;
+		}
 
-		if (bond->current_arp_slave != (slave_t *)bond) {
+		if (bond->current_arp_slave) {
 			bond_set_slave_inactive_flags(bond->current_arp_slave);
-			slave = bond->current_arp_slave->next;
 
 			/* search for next candidate */
-			do {
+			bond_for_each_slave_from(bond, slave, i, bond->current_arp_slave) {
 				if (IS_UP(slave->dev)) {
 					slave->link = BOND_LINK_BACK;
 					bond_set_slave_active_flags(slave);
-					arp_send_all(slave);
+					bond_arp_send_all(bond, slave);
 					slave->jiffies = jiffies;
 					bond->current_arp_slave = slave;
 					break;
 				}
 
-				/* if the link state is up at this point, we 
-				 * mark it down - this can happen if we have 
-				 * simultaneous link failures and 
-				 * reselect_active_interface doesn't make this 
-				 * one the current slave so it is still marked 
+				/* if the link state is up at this point, we
+				 * mark it down - this can happen if we have
+				 * simultaneous link failures and
+				 * reselect_active_interface doesn't make this
+				 * one the current slave so it is still marked
 				 * up when it is actually down
 				 */
 				if (slave->link == BOND_LINK_UP) {
 					slave->link  = BOND_LINK_DOWN;
-					if (slave->link_failure_count < 
-							UINT_MAX) {
+					if (slave->link_failure_count < UINT_MAX) {
 						slave->link_failure_count++;
 					}
 
 					bond_set_slave_inactive_flags(slave);
-					printk(KERN_INFO
-						"%s: backup interface "
-						"%s is now down.\n",
-						master->name,
-						slave->dev->name);
+
+					printk(KERN_INFO DRV_NAME
+					       ": %s: backup interface %s is "
+					       "now down.\n",
+					       bond_dev->name,
+					       slave->dev->name);
 				}
-			} while ((slave = slave->next) != 
-					bond->current_arp_slave->next);
+			}
 		}
 	}
 
+re_arm:
+	if (bond->params.arp_interval) {
+		mod_timer(&bond->arp_timer, jiffies + delta_in_ticks);
+	}
+out:
 	read_unlock(&bond->lock);
-	mod_timer(&bond->arp_timer, next_timer);
 }
 
-static int bond_sethwaddr(struct net_device *master, struct net_device *slave)
-{
-#ifdef BONDING_DEBUG
-	printk(KERN_CRIT "bond_sethwaddr: master=%x\n", (unsigned int)master);
-	printk(KERN_CRIT "bond_sethwaddr: slave=%x\n", (unsigned int)slave);
-	printk(KERN_CRIT "bond_sethwaddr: slave->addr_len=%d\n", slave->addr_len);
-#endif
-	memcpy(master->dev_addr, slave->dev_addr, slave->addr_len);
-	return 0;
-}
+/*------------------------------ proc/seq_file-------------------------------*/
 
-static int bond_info_query(struct net_device *master, struct ifbond *info)
-{
-	bonding_t *bond = (struct bonding *) master->priv;
-	slave_t *slave;
+#ifdef CONFIG_PROC_FS
+
+#define SEQ_START_TOKEN ((void *)1)
 
-	info->bond_mode = bond_mode;
-	info->num_slaves = 0;
-	info->miimon = miimon;
+static void *bond_info_seq_start(struct seq_file *seq, loff_t *pos)
+{
+	struct bonding *bond = seq->private;
+	loff_t off = 0;
+	struct slave *slave;
+	int i;
 
+	/* make sure the bond won't be taken away */
+	read_lock(&dev_base_lock);
 	read_lock_bh(&bond->lock);
-	for (slave = bond->prev; slave != (slave_t *)bond; slave = slave->prev) {
-		info->num_slaves++;
+
+	if (*pos == 0) {
+		return SEQ_START_TOKEN;
 	}
-	read_unlock_bh(&bond->lock);
 
-	return 0;
+	bond_for_each_slave(bond, slave, i) {
+		if (++off == *pos) {
+			return slave;
+		}
+	}
+
+	return NULL;
 }
 
-static int bond_slave_info_query(struct net_device *master, 
-					struct ifslave *info)
+static void *bond_info_seq_next(struct seq_file *seq, void *v, loff_t *pos)
 {
-	bonding_t *bond = (struct bonding *) master->priv;
-	slave_t *slave;
-	int cur_ndx = 0;
-
-	if (info->slave_id < 0) {
-		return -ENODEV;
-	}
+	struct bonding *bond = seq->private;
+	struct slave *slave = v;
 
-	read_lock_bh(&bond->lock);
-	for (slave = bond->prev; 
-		 slave != (slave_t *)bond && cur_ndx < info->slave_id; 
-		 slave = slave->prev) {
-		cur_ndx++;
+	++*pos;
+	if (v == SEQ_START_TOKEN) {
+		return bond->first_slave;
 	}
-	read_unlock_bh(&bond->lock);
 
-	if (slave != (slave_t *)bond) {
-		strcpy(info->slave_name, slave->dev->name);
-		info->link = slave->link;
-		info->state = slave->state;
-		info->link_failure_count = slave->link_failure_count;
-	} else {
-		return -ENODEV;
-	}
+	slave = slave->next;
 
-	return 0;
+	return (slave == bond->first_slave) ? NULL : slave;
 }
 
-static int bond_ethtool_ioctl(struct net_device *master_dev, struct ifreq *ifr)
+static void bond_info_seq_stop(struct seq_file *seq, void *v)
 {
-	void *addr = ifr->ifr_data;
-	uint32_t cmd;
+	struct bonding *bond = seq->private;
 
-	if (get_user(cmd, (uint32_t *) addr))
-		return -EFAULT;
+	read_unlock_bh(&bond->lock);
+	read_unlock(&dev_base_lock);
+}
 
-	switch (cmd) {
+static void bond_info_show_master(struct seq_file *seq)
+{
+	struct bonding *bond = seq->private;
+	struct slave *curr;
 
-	case ETHTOOL_GDRVINFO:
-		{
-			struct ethtool_drvinfo info;
-			char *endptr;
+	read_lock(&bond->curr_slave_lock);
+	curr = bond->curr_active_slave;
+	read_unlock(&bond->curr_slave_lock);
+
+	seq_printf(seq, "Bonding Mode: %s\n",
+		   bond_mode_name(bond->params.mode));
+
+	if (USES_PRIMARY(bond->params.mode)) {
+		seq_printf(seq, "Primary Slave: %s\n",
+			   (bond->params.primary[0]) ?
+			   	bond->params.primary : "None");
 
-			if (copy_from_user(&info, addr, sizeof(info)))
-				return -EFAULT;
+		seq_printf(seq, "Currently Active Slave: %s\n",
+			   (curr) ? curr->dev->name : "None");
+	}
 
-			if (strcmp(info.driver, "ifenslave") == 0) {
-				int new_abi_ver;
+	seq_printf(seq, "MII Status: %s\n", (curr) ? "up" : "down");
+	seq_printf(seq, "MII Polling Interval (ms): %d\n", bond->params.miimon);
+	seq_printf(seq, "Up Delay (ms): %d\n",
+		   bond->params.updelay * bond->params.miimon);
+	seq_printf(seq, "Down Delay (ms): %d\n",
+		   bond->params.downdelay * bond->params.miimon);
 
-				new_abi_ver = simple_strtoul(info.fw_version,
-						             &endptr, 0);
-				if (*endptr) {
-					printk(KERN_ERR
-					       "bonding: Error: got invalid ABI"
-					       " version from application\n");
+	if (bond->params.mode == BOND_MODE_8023AD) {
+		struct ad_info ad_info;
 
-					return -EINVAL;
-				}
+		seq_puts(seq, "\n802.3ad info\n");
+		seq_printf(seq, "LACP rate: %s\n",
+			   (bond->params.lacp_fast) ? "fast" : "slow");
 
-				if (orig_app_abi_ver == -1) {
-					orig_app_abi_ver  = new_abi_ver;
-				}
+		if (bond_3ad_get_active_agg_info(bond, &ad_info)) {
+			seq_printf(seq, "bond %s has no active aggregator\n",
+				   bond->dev->name);
+		} else {
+			seq_printf(seq, "Active Aggregator Info:\n");
 
-				app_abi_ver = new_abi_ver;
-			}
+			seq_printf(seq, "\tAggregator ID: %d\n",
+				   ad_info.aggregator_id);
+			seq_printf(seq, "\tNumber of ports: %d\n",
+				   ad_info.ports);
+			seq_printf(seq, "\tActor Key: %d\n",
+				   ad_info.actor_key);
+			seq_printf(seq, "\tPartner Key: %d\n",
+				   ad_info.partner_key);
+			seq_printf(seq, "\tPartner Mac Address: %02x:%02x:%02x:%02x:%02x:%02x\n",
+				   ad_info.partner_system[0],
+				   ad_info.partner_system[1],
+				   ad_info.partner_system[2],
+				   ad_info.partner_system[3],
+				   ad_info.partner_system[4],
+				   ad_info.partner_system[5]);
+		}
+	}
+}
 
-			strncpy(info.driver,  DRV_NAME, 32);
-			strncpy(info.version, DRV_VERSION, 32);
-			snprintf(info.fw_version, 32, "%d", BOND_ABI_VERSION);
+static void bond_info_show_slave(struct seq_file *seq, const struct slave *slave)
+{
+	struct bonding *bond = seq->private;
 
-			if (copy_to_user(addr, &info, sizeof(info)))
-				return -EFAULT;
+	seq_printf(seq, "\nSlave Interface: %s\n", slave->dev->name);
+	seq_printf(seq, "MII Status: %s\n",
+		   (slave->link == BOND_LINK_UP) ?  "up" : "down");
+	seq_printf(seq, "Link Failure Count: %d\n",
+		   slave->link_failure_count);
+
+	if (app_abi_ver >= 1) {
+		seq_printf(seq,
+			   "Permanent HW addr: %02x:%02x:%02x:%02x:%02x:%02x\n",
+			   slave->perm_hwaddr[0],
+			   slave->perm_hwaddr[1],
+			   slave->perm_hwaddr[2],
+			   slave->perm_hwaddr[3],
+			   slave->perm_hwaddr[4],
+			   slave->perm_hwaddr[5]);
+	}
 
-			return 0;
+	if (bond->params.mode == BOND_MODE_8023AD) {
+		const struct aggregator *agg
+			= SLAVE_AD_INFO(slave).port.aggregator;
+
+		if (agg) {
+			seq_printf(seq, "Aggregator ID: %d\n",
+				   agg->aggregator_identifier);
+		} else {
+			seq_puts(seq, "Aggregator ID: N/A\n");
 		}
-		break;
-	default:
-		return -EOPNOTSUPP;
 	}
 }
 
-static int bond_ioctl(struct net_device *master_dev, struct ifreq *ifr, int cmd)
+static int bond_info_seq_show(struct seq_file *seq, void *v)
 {
-	struct net_device *slave_dev = NULL;
-	struct ifbond *u_binfo = NULL, k_binfo;
-	struct ifslave *u_sinfo = NULL, k_sinfo;
-	struct mii_ioctl_data *mii = NULL;
-	int prev_abi_ver = orig_app_abi_ver;
-	int ret = 0;
+	if (v == SEQ_START_TOKEN) {
+		seq_printf(seq, "%s\n", version);
+		bond_info_show_master(seq);
+	} else {
+		bond_info_show_slave(seq, v);
+	}
 
-#ifdef BONDING_DEBUG
-	printk(KERN_INFO "bond_ioctl: master=%s, cmd=%d\n", 
-		master_dev->name, cmd);
-#endif
+	return 0;
+}
 
-	switch (cmd) {
-	case SIOCETHTOOL:
-		return bond_ethtool_ioctl(master_dev, ifr);
+static struct seq_operations bond_info_seq_ops = {
+	.start = bond_info_seq_start,
+	.next  = bond_info_seq_next,
+	.stop  = bond_info_seq_stop,
+	.show  = bond_info_seq_show,
+};
 
-	case SIOCGMIIPHY:
-		mii = (struct mii_ioctl_data *)&ifr->ifr_data;
-		if (mii == NULL) {
-			return -EINVAL;
-		}
-		mii->phy_id = 0;
-		/* Fall Through */
-	case SIOCGMIIREG:
-		/* 
-		 * We do this again just in case we were called by SIOCGMIIREG
-		 * instead of SIOCGMIIPHY.
-		 */
-		mii = (struct mii_ioctl_data *)&ifr->ifr_data;
-		if (mii == NULL) {
-			return -EINVAL;
-		}
-		if (mii->reg_num == 1) {
-			mii->val_out = bond_check_mii_link(
-				(struct bonding *)master_dev->priv);
-		}
-		return 0;
-	case BOND_INFO_QUERY_OLD:
-	case SIOCBONDINFOQUERY:
-		u_binfo = (struct ifbond *)ifr->ifr_data;
-		if (copy_from_user(&k_binfo, u_binfo, sizeof(ifbond))) {
-			return -EFAULT;
-		}
-		ret = bond_info_query(master_dev, &k_binfo);
-		if (ret == 0) {
-			if (copy_to_user(u_binfo, &k_binfo, sizeof(ifbond))) {
-				return -EFAULT;
-			}
-		}
-		return ret;
-	case BOND_SLAVE_INFO_QUERY_OLD:
-	case SIOCBONDSLAVEINFOQUERY:
-		u_sinfo = (struct ifslave *)ifr->ifr_data;
-		if (copy_from_user(&k_sinfo, u_sinfo, sizeof(ifslave))) {
-			return -EFAULT;
-		}
-		ret = bond_slave_info_query(master_dev, &k_sinfo);
-		if (ret == 0) {
-			if (copy_to_user(u_sinfo, &k_sinfo, sizeof(ifslave))) {
-				return -EFAULT;
-			}
-		}
-		return ret;
-	}
+static int bond_info_open(struct inode *inode, struct file *file)
+{
+	struct seq_file *seq;
+	struct proc_dir_entry *proc;
+	int res;
 
-	if (!capable(CAP_NET_ADMIN)) {
-		return -EPERM;
+	res = seq_open(file, &bond_info_seq_ops);
+	if (!res) {
+		/* recover the pointer buried in proc_dir_entry data */
+		seq = file->private_data;
+		proc = PDE(inode);
+		seq->private = proc->data;
 	}
 
-	if (orig_app_abi_ver == -1) {
-		/* no orig_app_abi_ver was provided yet, so we'll use the
-		 * current one from now on, even if it's 0
-		 */
-		orig_app_abi_ver = app_abi_ver;
+	return res;
+}
 
-	} else if (orig_app_abi_ver != app_abi_ver) {
-		printk(KERN_ERR
-		       "bonding: Error: already using ifenslave ABI "
-		       "version %d; to upgrade ifenslave to version %d, "
-		       "you must first reload bonding.\n",
-		       orig_app_abi_ver, app_abi_ver);
-		return -EINVAL;
+static struct file_operations bond_info_fops = {
+	.owner   = THIS_MODULE,
+	.open    = bond_info_open,
+	.read    = seq_read,
+	.llseek  = seq_lseek,
+	.release = seq_release,
+};
+
+static int bond_create_proc_entry(struct bonding *bond)
+{
+	struct net_device *bond_dev = bond->dev;
+
+	if (bond_proc_dir) {
+		bond->proc_entry = create_proc_entry(bond_dev->name,
+						     S_IRUGO,
+						     bond_proc_dir);
+		if (bond->proc_entry == NULL) {
+			printk(KERN_WARNING DRV_NAME
+			       ": Warning: Cannot create /proc/net/%s/%s\n",
+			       DRV_NAME, bond_dev->name);
+		} else {
+			bond->proc_entry->data = bond;
+			bond->proc_entry->proc_fops = &bond_info_fops;
+			bond->proc_entry->owner = THIS_MODULE;
+			memcpy(bond->proc_file_name, bond_dev->name, IFNAMSIZ);
+		}
 	}
 
-	slave_dev = dev_get_by_name(ifr->ifr_slave);
+	return 0;
+}
 
-#ifdef BONDING_DEBUG
-	printk(KERN_INFO "slave_dev=%x: \n", (unsigned int)slave_dev);
-	printk(KERN_INFO "slave_dev->name=%s: \n", slave_dev->name);
-#endif
+static void bond_remove_proc_entry(struct bonding *bond)
+{
+	if (bond_proc_dir && bond->proc_entry) {
+		remove_proc_entry(bond->proc_file_name, bond_proc_dir);
+		memset(bond->proc_file_name, 0, IFNAMSIZ);
+		bond->proc_entry = NULL;
+	}
+}
 
-	if (slave_dev == NULL) {
-		ret = -ENODEV;
-	} else {
-		switch (cmd) {
-		case BOND_ENSLAVE_OLD:
-		case SIOCBONDENSLAVE:		
-			ret = bond_enslave(master_dev, slave_dev);
-			break;
-		case BOND_RELEASE_OLD:			
-		case SIOCBONDRELEASE:	
-			ret = bond_release(master_dev, slave_dev); 
-			break;
-		case BOND_SETHWADDR_OLD:
-		case SIOCBONDSETHWADDR:
-			ret = bond_sethwaddr(master_dev, slave_dev);
-			break;
-		case BOND_CHANGE_ACTIVE_OLD:
-		case SIOCBONDCHANGEACTIVE:
-			if (USES_PRIMARY(bond_mode)) {
-				ret = bond_change_active(master_dev, slave_dev);
-			}
-			else {
-				ret = -EINVAL;
-			}
+/* Create the bonding directory under /proc/net, if doesn't exist yet.
+ * Caller must hold rtnl_lock.
+ */
+static void bond_create_proc_dir(void)
+{
+	int len = strlen(DRV_NAME);
+
+	for (bond_proc_dir = proc_net->subdir; bond_proc_dir;
+	     bond_proc_dir = bond_proc_dir->next) {
+		if ((bond_proc_dir->namelen == len) &&
+		    !memcmp(bond_proc_dir->name, DRV_NAME, len)) {
 			break;
-		default:
-			ret = -EOPNOTSUPP;
 		}
-		dev_put(slave_dev);
 	}
 
-	if (ret < 0) {
-		/* The ioctl failed, so there's no point in changing the
-		 * orig_app_abi_ver. We'll restore it's value just in case
-		 * we've changed it earlier in this function.
-		 */
-		orig_app_abi_ver = prev_abi_ver;
+	if (!bond_proc_dir) {
+		bond_proc_dir = proc_mkdir(DRV_NAME, proc_net);
+		if (bond_proc_dir) {
+			bond_proc_dir->owner = THIS_MODULE;
+		} else {
+			printk(KERN_WARNING DRV_NAME
+				": Warning: cannot create /proc/net/%s\n",
+				DRV_NAME);
+		}
 	}
-
-	return ret;
 }
 
-#ifdef CONFIG_NET_FASTROUTE
-static int bond_accept_fastpath(struct net_device *dev, struct dst_entry *dst)
+/* Destroy the bonding directory under /proc/net, if empty.
+ * Caller must hold rtnl_lock.
+ */
+static void bond_destroy_proc_dir(void)
 {
-	return -1;
+	struct proc_dir_entry *de;
+
+	if (!bond_proc_dir) {
+		return;
+	}
+
+	/* verify that the /proc dir is empty */
+	for (de = bond_proc_dir->subdir; de; de = de->next) {
+		/* ignore . and .. */
+		if (*(de->name) != '.') {
+			break;
+		}
+	}
+
+	if (de) {
+		if (bond_proc_dir->owner == THIS_MODULE) {
+			bond_proc_dir->owner = NULL;
+		}
+	} else {
+		remove_proc_entry(DRV_NAME, proc_net);
+		bond_proc_dir = NULL;
+	}
 }
-#endif
+#endif /* CONFIG_PROC_FS */
 
-/* 
- * in broadcast mode, we send everything to all usable interfaces.
+/*-------------------------- netdev event handling --------------------------*/
+
+/*
+ * Change device name
  */
-static int bond_xmit_broadcast(struct sk_buff *skb, struct net_device *dev)
+static int bond_event_changename(struct bonding *bond)
 {
-	slave_t *slave, *start_at;
-	struct bonding *bond = (struct bonding *) dev->priv;
-	struct net_device *device_we_should_send_to = 0;
+#ifdef CONFIG_PROC_FS
+	bond_remove_proc_entry(bond);
+	bond_create_proc_entry(bond);
+#endif
 
-	if (!IS_UP(dev)) { /* bond down */
-		dev_kfree_skb(skb);
-		return 0;
-	}
+	return NOTIFY_DONE;
+}
 
-	read_lock(&bond->lock);
+static int bond_master_netdev_event(unsigned long event, struct net_device *bond_dev)
+{
+	struct bonding *event_bond = bond_dev->priv;
 
-	read_lock(&bond->ptrlock);
-	slave = start_at = bond->current_slave;
-	read_unlock(&bond->ptrlock);
-
-	if (slave == NULL) { /* we're at the root, get the first slave */
-		/* no suitable interface, frame not sent */
-		read_unlock(&bond->lock);
-		dev_kfree_skb(skb);
-		return 0;
+	switch (event) {
+	case NETDEV_CHANGENAME:
+		return bond_event_changename(event_bond);
+	case NETDEV_UNREGISTER:
+		/*
+		 * TODO: remove a bond from the list?
+		 */
+		break;
+	default:
+		break;
 	}
 
-	do {
-		if (IS_UP(slave->dev)
-		    && (slave->link == BOND_LINK_UP)
-		    && (slave->state == BOND_STATE_ACTIVE)) {
-			if (device_we_should_send_to) {
-				struct sk_buff *skb2;
-				if ((skb2 = skb_clone(skb, GFP_ATOMIC)) == NULL) {
-					printk(KERN_ERR "bond_xmit_broadcast: skb_clone() failed\n");
-					continue;
-				}
+	return NOTIFY_DONE;
+}
 
-				skb2->dev = device_we_should_send_to;
-				skb2->priority = 1;
-				dev_queue_xmit(skb2);
-			}
-			device_we_should_send_to = slave->dev;
-		}
-	} while ((slave = slave->next) != start_at);
+static int bond_slave_netdev_event(unsigned long event, struct net_device *slave_dev)
+{
+	struct net_device *bond_dev = slave_dev->master;
 
-	if (device_we_should_send_to) {
-		skb->dev = device_we_should_send_to;
-		skb->priority = 1;
-		dev_queue_xmit(skb);
-	} else
-		dev_kfree_skb(skb);
+	switch (event) {
+	case NETDEV_UNREGISTER:
+		if (bond_dev) {
+			bond_release(bond_dev, slave_dev);
+		}
+		break;
+	case NETDEV_CHANGE:
+		/*
+		 * TODO: is this what we get if somebody
+		 * sets up a hierarchical bond, then rmmod's
+		 * one of the slave bonding devices?
+		 */
+		break;
+	case NETDEV_DOWN:
+		/*
+		 * ... Or is it this?
+		 */
+		break;
+	case NETDEV_CHANGEMTU:
+		/*
+		 * TODO: Should slaves be allowed to
+		 * independently alter their MTU?  For
+		 * an active-backup bond, slaves need
+		 * not be the same type of device, so
+		 * MTUs may vary.  For other modes,
+		 * slaves arguably should have the
+		 * same MTUs. To do this, we'd need to
+		 * take over the slave's change_mtu
+		 * function for the duration of their
+		 * servitude.
+		 */
+		break;
+	case NETDEV_CHANGENAME:
+		/*
+		 * TODO: handle changing the primary's name
+		 */
+		break;
+	default:
+		break;
+	}
 
-	/* frame sent to all suitable interfaces */
-	read_unlock(&bond->lock);
-	return 0;
+	return NOTIFY_DONE;
 }
 
-static int bond_xmit_roundrobin(struct sk_buff *skb, struct net_device *dev)
+/*
+ * bond_netdev_event: handle netdev notifier chain events.
+ *
+ * This function receives events for the netdev chain.  The caller (an
+ * ioctl handler calling notifier_call_chain) holds the necessary
+ * locks for us to safely manipulate the slave devices (RTNL lock,
+ * dev_probe_lock).
+ */
+static int bond_netdev_event(struct notifier_block *this, unsigned long event, void *ptr)
 {
-	slave_t *slave, *start_at;
-	struct bonding *bond = (struct bonding *) dev->priv;
+	struct net_device *event_dev = (struct net_device *)ptr;
 
-	if (!IS_UP(dev)) { /* bond down */
-		dev_kfree_skb(skb);
-		return 0;
+	dprintk("event_dev: %s, event: %lx\n",
+		(event_dev ? event_dev->name : "None"),
+		event);
+
+	if (event_dev->flags & IFF_MASTER) {
+		dprintk("IFF_MASTER\n");
+		return bond_master_netdev_event(event, event_dev);
 	}
 
-	read_lock(&bond->lock);
-
-	read_lock(&bond->ptrlock);
-	slave = start_at = bond->current_slave;
-	read_unlock(&bond->ptrlock);
-
-	if (slave == NULL) { /* we're at the root, get the first slave */
-		/* no suitable interface, frame not sent */
-		dev_kfree_skb(skb);
-		read_unlock(&bond->lock);
-		return 0;
+	if (event_dev->flags & IFF_SLAVE) {
+		dprintk("IFF_SLAVE\n");
+		return bond_slave_netdev_event(event, event_dev);
 	}
 
-	do {
-		if (IS_UP(slave->dev)
-		    && (slave->link == BOND_LINK_UP)
-		    && (slave->state == BOND_STATE_ACTIVE)) {
+	return NOTIFY_DONE;
+}
 
-			skb->dev = slave->dev;
-			skb->priority = 1;
-			dev_queue_xmit(skb);
+static struct notifier_block bond_netdev_notifier = {
+	.notifier_call = bond_netdev_event,
+};
 
-			write_lock(&bond->ptrlock);
-			bond->current_slave = slave->next;
-			write_unlock(&bond->ptrlock);
+/*-------------------------- Packet type handling ---------------------------*/
 
-			read_unlock(&bond->lock);
-			return 0;
-		}
-	} while ((slave = slave->next) != start_at);
+/* register to receive lacpdus on a bond */
+static void bond_register_lacpdu(struct bonding *bond)
+{
+	struct packet_type *pk_type = &(BOND_AD_INFO(bond).ad_pkt_type);
 
-	/* no suitable interface, frame not sent */
-	dev_kfree_skb(skb);
-	read_unlock(&bond->lock);
-	return 0;
+	/* initialize packet type */
+	pk_type->type = PKT_TYPE_LACPDU;
+	pk_type->dev = bond->dev;
+	pk_type->func = bond_3ad_lacpdu_recv;
+
+	dev_add_pack(pk_type);
 }
 
-/* 
- * in XOR mode, we determine the output device by performing xor on
- * the source and destination hw adresses.  If this device is not 
- * enabled, find the next slave following this xor slave. 
- */
-static int bond_xmit_xor(struct sk_buff *skb, struct net_device *dev)
+/* unregister to receive lacpdus on a bond */
+static void bond_unregister_lacpdu(struct bonding *bond)
 {
-	slave_t *slave, *start_at;
-	struct bonding *bond = (struct bonding *) dev->priv;
-	struct ethhdr *data = (struct ethhdr *)skb->data;
-	int slave_no;
+	dev_remove_pack(&(BOND_AD_INFO(bond).ad_pkt_type));
+}
 
-	if (!IS_UP(dev)) { /* bond down */
-		dev_kfree_skb(skb);
-		return 0;
-	}
+/*-------------------------- Device entry points ----------------------------*/
 
-	read_lock(&bond->lock);
-	slave = bond->prev;
+static int bond_open(struct net_device *bond_dev)
+{
+	struct bonding *bond = bond_dev->priv;
+	struct timer_list *mii_timer = &bond->mii_timer;
+	struct timer_list *arp_timer = &bond->arp_timer;
 
-	/* we're at the root, get the first slave */
-	if (bond->slave_cnt == 0) {
-		/* no suitable interface, frame not sent */
-		dev_kfree_skb(skb);
-		read_unlock(&bond->lock);
-		return 0;
-	}
+	bond->kill_timers = 0;
 
-	slave_no = (data->h_dest[5]^slave->dev->dev_addr[5]) % bond->slave_cnt;
+	if ((bond->params.mode == BOND_MODE_TLB) ||
+	    (bond->params.mode == BOND_MODE_ALB)) {
+		struct timer_list *alb_timer = &(BOND_ALB_INFO(bond).alb_timer);
 
-	while ( (slave_no > 0) && (slave != (slave_t *)bond) ) {
-		slave = slave->prev;
-		slave_no--;
-	} 
-	start_at = slave;
+		/* bond_alb_initialize must be called before the timer
+		 * is started.
+		 */
+		if (bond_alb_initialize(bond, (bond->params.mode == BOND_MODE_ALB))) {
+			/* something went wrong - fail the open operation */
+			return -1;
+		}
 
-	do {
-		if (IS_UP(slave->dev)
-		    && (slave->link == BOND_LINK_UP)
-		    && (slave->state == BOND_STATE_ACTIVE)) {
+		init_timer(alb_timer);
+		alb_timer->expires  = jiffies + 1;
+		alb_timer->data     = (unsigned long)bond;
+		alb_timer->function = (void *)&bond_alb_monitor;
+		add_timer(alb_timer);
+	}
 
-			skb->dev = slave->dev;
-			skb->priority = 1;
-			dev_queue_xmit(skb);
+	if (bond->params.miimon) {  /* link check interval, in milliseconds. */
+		init_timer(mii_timer);
+		mii_timer->expires  = jiffies + 1;
+		mii_timer->data     = (unsigned long)bond_dev;
+		mii_timer->function = (void *)&bond_mii_monitor;
+		add_timer(mii_timer);
+	}
 
-			read_unlock(&bond->lock);
-			return 0;
+	if (bond->params.arp_interval) {  /* arp interval, in milliseconds. */
+		init_timer(arp_timer);
+		arp_timer->expires  = jiffies + 1;
+		arp_timer->data     = (unsigned long)bond_dev;
+		if (bond->params.mode == BOND_MODE_ACTIVEBACKUP) {
+			arp_timer->function = (void *)&bond_activebackup_arp_mon;
+		} else {
+			arp_timer->function = (void *)&bond_loadbalance_arp_mon;
 		}
-	} while ((slave = slave->next) != start_at);
+		add_timer(arp_timer);
+	}
+
+	if (bond->params.mode == BOND_MODE_8023AD) {
+		struct timer_list *ad_timer = &(BOND_AD_INFO(bond).ad_timer);
+		init_timer(ad_timer);
+		ad_timer->expires  = jiffies + 1;
+		ad_timer->data     = (unsigned long)bond;
+		ad_timer->function = (void *)&bond_3ad_state_machine_handler;
+		add_timer(ad_timer);
+
+		/* register to receive LACPDUs */
+		bond_register_lacpdu(bond);
+	}
 
-	/* no suitable interface, frame not sent */
-	dev_kfree_skb(skb);
-	read_unlock(&bond->lock);
 	return 0;
 }
 
-/* 
- * in active-backup mode, we know that bond->current_slave is always valid if
- * the bond has a usable interface.
- */
-static int bond_xmit_activebackup(struct sk_buff *skb, struct net_device *dev)
+static int bond_close(struct net_device *bond_dev)
 {
-	struct bonding *bond = (struct bonding *) dev->priv;
-	int ret;
+	struct bonding *bond = bond_dev->priv;
 
-	if (!IS_UP(dev)) { /* bond down */
-		dev_kfree_skb(skb);
-		return 0;
-	}
+	write_lock_bh(&bond->lock);
 
-	/* if we are sending arp packets, try to at least 
-	   identify our own ip address */
-	if ( (arp_interval > 0) && (my_ip == 0) &&
-		(skb->protocol == __constant_htons(ETH_P_ARP) ) ) {
-		char *the_ip = (((char *)skb->data)) 
-				+ sizeof(struct ethhdr)  
-				+ sizeof(struct arphdr) + 
-				ETH_ALEN;
-		memcpy(&my_ip, the_ip, 4);
+	bond_mc_list_destroy(bond);
+
+	if (bond->params.mode == BOND_MODE_8023AD) {
+		/* Unregister the receive of LACPDUs */
+		bond_unregister_lacpdu(bond);
 	}
 
-	/* if we are sending arp packets and don't know 
-	 * the target hw address, save it so we don't need 
-	 * to use a broadcast address.
-	 * don't do this if in active backup mode because the slaves must 
-	 * receive packets to stay up, and the only ones they receive are 
-	 * broadcasts. 
+	/* signal timers not to re-arm */
+	bond->kill_timers = 1;
+
+	write_unlock_bh(&bond->lock);
+
+	/* del_timer_sync must run without holding the bond->lock
+	 * because a running timer might be trying to hold it too
 	 */
-	if ( (bond_mode != BOND_MODE_ACTIVEBACKUP) && 
-             (arp_ip_count == 1) &&
-	     (arp_interval > 0) && (arp_target_hw_addr == NULL) &&
-	     (skb->protocol == __constant_htons(ETH_P_IP) ) ) {
-		struct ethhdr *eth_hdr = 
-			(struct ethhdr *) (((char *)skb->data));
-		struct iphdr *ip_hdr = (struct iphdr *)(eth_hdr + 1);
-
-		if (arp_target[0] == ip_hdr->daddr) {
-			arp_target_hw_addr = kmalloc(ETH_ALEN, GFP_KERNEL);
-			if (arp_target_hw_addr != NULL)
-				memcpy(arp_target_hw_addr, eth_hdr->h_dest, ETH_ALEN);
-		}
+
+	if (bond->params.miimon) {  /* link check interval, in milliseconds. */
+		del_timer_sync(&bond->mii_timer);
 	}
 
-	read_lock(&bond->lock);
+	if (bond->params.arp_interval) {  /* arp interval, in milliseconds. */
+		del_timer_sync(&bond->arp_timer);
+	}
 
-	read_lock(&bond->ptrlock);
-	if (bond->current_slave != NULL) { /* one usable interface */
-		skb->dev = bond->current_slave->dev;
-		read_unlock(&bond->ptrlock);
-		skb->priority = 1;
-		ret = dev_queue_xmit(skb);
-		read_unlock(&bond->lock);
-		return 0;
+	switch (bond->params.mode) {
+	case BOND_MODE_8023AD:
+		del_timer_sync(&(BOND_AD_INFO(bond).ad_timer));
+		break;
+	case BOND_MODE_TLB:
+	case BOND_MODE_ALB:
+		del_timer_sync(&(BOND_ALB_INFO(bond).alb_timer));
+		break;
+	default:
+		break;
 	}
-	else {
-		read_unlock(&bond->ptrlock);
+
+	/* Release the bonded slaves */
+	bond_release_all(bond_dev);
+
+	if ((bond->params.mode == BOND_MODE_TLB) ||
+	    (bond->params.mode == BOND_MODE_ALB)) {
+		/* Must be called only after all
+		 * slaves have been released
+		 */
+		bond_alb_deinitialize(bond);
 	}
 
-	/* no suitable interface, frame not sent */
-#ifdef BONDING_DEBUG
-	printk(KERN_INFO "There was no suitable interface, so we don't transmit\n");
-#endif
-	dev_kfree_skb(skb);
-	read_unlock(&bond->lock);
 	return 0;
 }
 
-static struct net_device_stats *bond_get_stats(struct net_device *dev)
+static struct net_device_stats *bond_get_stats(struct net_device *bond_dev)
 {
-	bonding_t *bond = dev->priv;
+	struct bonding *bond = bond_dev->priv;
 	struct net_device_stats *stats = &(bond->stats), *sstats;
-	slave_t *slave;
+	struct slave *slave;
+	int i;
 
 	memset(stats, 0, sizeof(struct net_device_stats));
 
 	read_lock_bh(&bond->lock);
 
-	for (slave = bond->prev; slave != (slave_t *)bond; slave = slave->prev) {
+	bond_for_each_slave(bond, slave, i) {
 		sstats = slave->dev->get_stats(slave->dev);
- 
+
 		stats->rx_packets += sstats->rx_packets;
 		stats->rx_bytes += sstats->rx_bytes;
 		stats->rx_errors += sstats->rx_errors;
@@ -3346,290 +3198,290 @@
 		stats->rx_over_errors += sstats->rx_over_errors;
 		stats->rx_crc_errors += sstats->rx_crc_errors;
 		stats->rx_frame_errors += sstats->rx_frame_errors;
-		stats->rx_fifo_errors += sstats->rx_fifo_errors;	
+		stats->rx_fifo_errors += sstats->rx_fifo_errors;
 		stats->rx_missed_errors += sstats->rx_missed_errors;
-	
+
 		stats->tx_aborted_errors += sstats->tx_aborted_errors;
 		stats->tx_carrier_errors += sstats->tx_carrier_errors;
 		stats->tx_fifo_errors += sstats->tx_fifo_errors;
 		stats->tx_heartbeat_errors += sstats->tx_heartbeat_errors;
 		stats->tx_window_errors += sstats->tx_window_errors;
-
 	}
 
 	read_unlock_bh(&bond->lock);
+
 	return stats;
 }
 
-#ifdef CONFIG_PROC_FS
-
-#define SEQ_START_TOKEN ((void *)1)
-
-static void *bond_info_seq_start(struct seq_file *seq, loff_t *pos)
+static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd)
 {
-	struct bonding *bond = seq->private;
-	loff_t off = 0;
-	struct slave *slave;
-
-	/* make sure the bond won't be taken away */
-	read_lock(&dev_base_lock);
-	read_lock_bh(&bond->lock);
-
-	if (*pos == 0) {
-		return SEQ_START_TOKEN;
-	}
+	struct net_device *slave_dev = NULL;
+	struct ifbond *u_binfo = NULL, k_binfo;
+	struct ifslave *u_sinfo = NULL, k_sinfo;
+	struct mii_ioctl_data *mii = NULL;
+	int prev_abi_ver = orig_app_abi_ver;
+	int res = 0;
 
-	for (slave = bond->prev; slave != (slave_t *)bond;
-	     slave = slave->prev) {
+	dprintk("bond_ioctl: master=%s, cmd=%d\n",
+		bond_dev->name, cmd);
 
-		if (++off == *pos) {
-			return slave;
+	switch (cmd) {
+	case SIOCETHTOOL:
+		return bond_ethtool_ioctl(bond_dev, ifr);
+	case SIOCGMIIPHY:
+		mii = (struct mii_ioctl_data *)&ifr->ifr_data;
+		if (!mii) {
+			return -EINVAL;
+		}
+		mii->phy_id = 0;
+		/* Fall Through */
+	case SIOCGMIIREG:
+		/*
+		 * We do this again just in case we were called by SIOCGMIIREG
+		 * instead of SIOCGMIIPHY.
+		 */
+		mii = (struct mii_ioctl_data *)&ifr->ifr_data;
+		if (!mii) {
+			return -EINVAL;
 		}
-	}
-
-	return NULL;
-}
-
-static void *bond_info_seq_next(struct seq_file *seq, void *v, loff_t *pos)
-{
-	struct bonding *bond = seq->private;
-	struct slave *slave = v;
-
-	++*pos;
-	if (v == SEQ_START_TOKEN) {
-		slave = bond->prev;
-	} else {
-		slave = slave->prev;
-	}
-
-	return (slave == (struct slave *) bond) ? NULL : slave;
-}
 
-static void bond_info_seq_stop(struct seq_file *seq, void *v)
-{
-	struct bonding *bond = seq->private;
+		if (mii->reg_num == 1) {
+			struct bonding *bond = bond_dev->priv;
+			mii->val_out = 0;
+			read_lock_bh(&bond->lock);
+			read_lock(&bond->curr_slave_lock);
+			if (bond->curr_active_slave) {
+				mii->val_out = BMSR_LSTATUS;
+			}
+			read_unlock(&bond->curr_slave_lock);
+			read_unlock_bh(&bond->lock);
+		}
 
-	read_unlock_bh(&bond->lock);
-	read_unlock(&dev_base_lock);
-}
+		return 0;
+	case BOND_INFO_QUERY_OLD:
+	case SIOCBONDINFOQUERY:
+		u_binfo = (struct ifbond *)ifr->ifr_data;
 
-static void bond_info_show_master(struct seq_file *seq, struct bonding *bond)
-{
-	struct slave *curr;
+		if (copy_from_user(&k_binfo, u_binfo, sizeof(ifbond))) {
+			return -EFAULT;
+		}
 
-	read_lock(&bond->ptrlock);
-	curr = bond->current_slave;
-	read_unlock(&bond->ptrlock);
-
-	seq_printf(seq, "Bonding Mode: %s\n", bond_mode_name());
-
-	if (USES_PRIMARY(bond_mode)) {
-		if (curr) {
-			seq_printf(seq,
-				   "Currently Active Slave: %s\n",
-				   curr->dev->name);
+		res = bond_info_query(bond_dev, &k_binfo);
+		if (res == 0) {
+			if (copy_to_user(u_binfo, &k_binfo, sizeof(ifbond))) {
+				return -EFAULT;
+			}
 		}
-	}
 
-	seq_printf(seq, "MII Status: %s\n", (curr) ? "up" : "down");
-	seq_printf(seq, "MII Polling Interval (ms): %d\n", miimon);
-	seq_printf(seq, "Up Delay (ms): %d\n", updelay * miimon);
-	seq_printf(seq, "Down Delay (ms): %d\n", downdelay * miimon);
-	seq_printf(seq, "Multicast Mode: %s\n", multicast_mode_name());
+		return res;
+	case BOND_SLAVE_INFO_QUERY_OLD:
+	case SIOCBONDSLAVEINFOQUERY:
+		u_sinfo = (struct ifslave *)ifr->ifr_data;
 
-	if (bond_mode == BOND_MODE_8023AD) {
-		struct ad_info ad_info;
+		if (copy_from_user(&k_sinfo, u_sinfo, sizeof(ifslave))) {
+			return -EFAULT;
+		}
 
-		seq_puts(seq, "\n802.3ad info\n");
+		res = bond_slave_info_query(bond_dev, &k_sinfo);
+		if (res == 0) {
+			if (copy_to_user(u_sinfo, &k_sinfo, sizeof(ifslave))) {
+				return -EFAULT;
+			}
+		}
 
-		if (bond_3ad_get_active_agg_info(bond, &ad_info)) {
-			seq_printf(seq, "bond %s has no active aggregator\n",
-				   bond->device->name);
-		} else {
-			seq_printf(seq, "Active Aggregator Info:\n");
+		return res;
+	default:
+		/* Go on */
+		break;
+	}
 
-			seq_printf(seq, "\tAggregator ID: %d\n",
-				   ad_info.aggregator_id);
-			seq_printf(seq, "\tNumber of ports: %d\n",
-				   ad_info.ports);
-			seq_printf(seq, "\tActor Key: %d\n",
-				   ad_info.actor_key);
-			seq_printf(seq, "\tPartner Key: %d\n",
-				   ad_info.partner_key);
-			seq_printf(seq, "\tPartner Mac Address: %02x:%02x:%02x:%02x:%02x:%02x\n",
-				   ad_info.partner_system[0],
-				   ad_info.partner_system[1],
-				   ad_info.partner_system[2],
-				   ad_info.partner_system[3],
-				   ad_info.partner_system[4],
-				   ad_info.partner_system[5]);
-		}
+	if (!capable(CAP_NET_ADMIN)) {
+		return -EPERM;
 	}
-}
 
-static void bond_info_show_slave(struct seq_file *seq, const struct slave *slave)
-{
-	seq_printf(seq, "\nSlave Interface: %s\n", slave->dev->name);
-	seq_printf(seq, "MII Status: %s\n",
-		   (slave->link == BOND_LINK_UP) ?  "up" : "down");
-	seq_printf(seq, "Link Failure Count: %d\n",
-		   slave->link_failure_count);
+	if (orig_app_abi_ver == -1) {
+		/* no orig_app_abi_ver was provided yet, so we'll use the
+		 * current one from now on, even if it's 0
+		 */
+		orig_app_abi_ver = app_abi_ver;
 
-	if (app_abi_ver >= 1) {
-		seq_printf(seq,
-			   "Permanent HW addr: %02x:%02x:%02x:%02x:%02x:%02x\n",
-			   slave->perm_hwaddr[0],
-			   slave->perm_hwaddr[1],
-			   slave->perm_hwaddr[2],
-			   slave->perm_hwaddr[3],
-			   slave->perm_hwaddr[4],
-			   slave->perm_hwaddr[5]);
+	} else if (orig_app_abi_ver != app_abi_ver) {
+		printk(KERN_ERR DRV_NAME
+		       ": Error: already using ifenslave ABI version %d; to "
+		       "upgrade ifenslave to version %d, you must first "
+		       "reload bonding.\n",
+		       orig_app_abi_ver, app_abi_ver);
+		return -EINVAL;
 	}
 
-	if (bond_mode == BOND_MODE_8023AD) {
-		const struct aggregator *agg
-			= SLAVE_AD_INFO(slave).port.aggregator;
+	slave_dev = dev_get_by_name(ifr->ifr_slave);
 
-		if (agg) {
-			seq_printf(seq, "Aggregator ID: %d\n",
-				   agg->aggregator_identifier);
-		} else {
-			seq_puts(seq, "Aggregator ID: N/A\n");
+	dprintk("slave_dev=%p: \n", slave_dev);
+
+	if (!slave_dev) {
+		res = -ENODEV;
+	} else {
+		dprintk("slave_dev->name=%s: \n", slave_dev->name);
+		switch (cmd) {
+		case BOND_ENSLAVE_OLD:
+		case SIOCBONDENSLAVE:
+			res = bond_enslave(bond_dev, slave_dev);
+			break;
+		case BOND_RELEASE_OLD:
+		case SIOCBONDRELEASE:
+			res = bond_release(bond_dev, slave_dev);
+			break;
+		case BOND_SETHWADDR_OLD:
+		case SIOCBONDSETHWADDR:
+			res = bond_sethwaddr(bond_dev, slave_dev);
+			break;
+		case BOND_CHANGE_ACTIVE_OLD:
+		case SIOCBONDCHANGEACTIVE:
+			res = bond_ioctl_change_active(bond_dev, slave_dev);
+			break;
+		default:
+			res = -EOPNOTSUPP;
 		}
+
+		dev_put(slave_dev);
 	}
-}
 
-static int bond_info_seq_show(struct seq_file *seq, void *v)
-{
-	if (v == SEQ_START_TOKEN) {
-		seq_printf(seq, "%s\n", version);
-		bond_info_show_master(seq, seq->private);
-	} else {
-		bond_info_show_slave(seq, v);
+	if (res < 0) {
+		/* The ioctl failed, so there's no point in changing the
+		 * orig_app_abi_ver. We'll restore it's value just in case
+		 * we've changed it earlier in this function.
+		 */
+		orig_app_abi_ver = prev_abi_ver;
 	}
 
-	return 0;
+	return res;
 }
 
-static struct seq_operations bond_info_seq_ops = {
-	.start = bond_info_seq_start,
-	.next  = bond_info_seq_next,
-	.stop  = bond_info_seq_stop,
-	.show  = bond_info_seq_show,
-};
-
-static int bond_info_open(struct inode *inode, struct file *file)
+static void bond_set_multicast_list(struct net_device *bond_dev)
 {
-	struct seq_file *seq;
-	struct proc_dir_entry *proc;
-	int rc;
-
-	rc = seq_open(file, &bond_info_seq_ops);
-	if (!rc) {
-		/* recover the pointer buried in proc_dir_entry data */
-		seq = file->private_data;
-		proc = PDE(inode);
-		seq->private = proc->data;
-	}
-	return rc;
-}
+	struct bonding *bond = bond_dev->priv;
+	struct dev_mc_list *dmi;
 
-static struct file_operations bond_info_fops = {
-	.owner	 = THIS_MODULE,
-	.open    = bond_info_open,
-	.read    = seq_read,
-	.llseek  = seq_lseek,
-	.release = seq_release,
-};
+	write_lock_bh(&bond->lock);
 
-static int bond_create_proc_info(struct bonding *bond)
-{
-	struct net_device *dev = bond->device;
+	/*
+	 * Do promisc before checking multicast_mode
+	 */
+	if ((bond_dev->flags & IFF_PROMISC) && !(bond->flags & IFF_PROMISC)) {
+		bond_set_promiscuity(bond, 1);
+	}
 
-	if (bond_proc_dir) {
-		bond->bond_proc_file = create_proc_entry(dev->name,
-							 S_IRUGO, 
-							 bond_proc_dir);
-		if (bond->bond_proc_file == NULL) {
-			printk(KERN_WARNING
-			       "%s: Cannot create /proc/net/bonding/%s\n", 
-			       dev->name, dev->name);
-		} else {
-			bond->bond_proc_file->data = bond;
-			bond->bond_proc_file->proc_fops = &bond_info_fops;
-			bond->bond_proc_file->owner = THIS_MODULE;
-			memcpy(bond->procdir_name, dev->name, IFNAMSIZ);
-		}
+	if (!(bond_dev->flags & IFF_PROMISC) && (bond->flags & IFF_PROMISC)) {
+		bond_set_promiscuity(bond, -1);
 	}
 
-	return 0;
-}
+	/* set allmulti flag to slaves */
+	if ((bond_dev->flags & IFF_ALLMULTI) && !(bond->flags & IFF_ALLMULTI)) {
+		bond_set_allmulti(bond, 1);
+	}
 
-static void bond_destroy_proc_info(struct bonding *bond)
-{
-	if (bond_proc_dir && bond->bond_proc_file) {
-		remove_proc_entry(bond->procdir_name, bond_proc_dir);
-		memset(bond->procdir_name, 0, IFNAMSIZ);
-		bond->bond_proc_file = NULL;
+	if (!(bond_dev->flags & IFF_ALLMULTI) && (bond->flags & IFF_ALLMULTI)) {
+		bond_set_allmulti(bond, -1);
 	}
-}
 
-/* Create the bonding directory under /proc/net, if doesn't exist yet.
- * Caller must hold rtnl_lock.
- */
-static void bond_create_proc_dir(void)
-{
-	int len = strlen(DRV_NAME);
+	bond->flags = bond_dev->flags;
 
-	for (bond_proc_dir = proc_net->subdir; bond_proc_dir;
-	     bond_proc_dir = bond_proc_dir->next) {
-		if ((bond_proc_dir->namelen == len) &&
-		    !memcmp(bond_proc_dir->name, DRV_NAME, len)) {
-			break;
+	/* looking for addresses to add to slaves' mc list */
+	for (dmi = bond_dev->mc_list; dmi; dmi = dmi->next) {
+		if (!bond_mc_list_find_dmi(dmi, bond->mc_list)) {
+			bond_mc_add(bond, dmi->dmi_addr, dmi->dmi_addrlen);
 		}
 	}
 
-	if (!bond_proc_dir) {
-		bond_proc_dir = proc_mkdir(DRV_NAME, proc_net);
-		if (bond_proc_dir) {
-			bond_proc_dir->owner = THIS_MODULE;
-		} else {
-			printk(KERN_WARNING DRV_NAME
-				": Warning: cannot create /proc/net/%s\n",
-				DRV_NAME);
+	/* looking for addresses to delete from slaves' list */
+	for (dmi = bond->mc_list; dmi; dmi = dmi->next) {
+		if (!bond_mc_list_find_dmi(dmi, bond_dev->mc_list)) {
+			bond_mc_delete(bond, dmi->dmi_addr, dmi->dmi_addrlen);
 		}
 	}
+
+	/* save master's multicast list */
+	bond_mc_list_destroy(bond);
+	bond_mc_list_copy(bond_dev->mc_list, bond, GFP_ATOMIC);
+
+	write_unlock_bh(&bond->lock);
 }
 
-/* Destroy the bonding directory under /proc/net, if empty.
- * Caller must hold rtnl_lock.
+/*
+ * Change the MTU of all of a master's slaves to match the master
  */
-static void bond_destroy_proc_dir(void)
+static int bond_change_mtu(struct net_device *bond_dev, int new_mtu)
 {
-	struct proc_dir_entry *de;
+	struct bonding *bond = bond_dev->priv;
+	struct slave *slave, *stop_at;
+	int res = 0;
+	int i;
 
-	if (!bond_proc_dir) {
-		return;
-	}
+	dprintk("bond=%p, name=%s, new_mtu=%d\n", bond,
+		(bond_dev ? bond_dev->name : "None"), new_mtu);
 
-	/* verify that the /proc dir is empty */
-	for (de = bond_proc_dir->subdir; de; de = de->next) {
-		/* ignore . and .. */
-		if (*(de->name) != '.') {
-			break;
+	/* Can't hold bond->lock with bh disabled here since
+	 * some base drivers panic. On the other hand we can't
+	 * hold bond->lock without bh disabled because we'll
+	 * deadlock. The only solution is to rely on the fact
+	 * that we're under rtnl_lock here, and the slaves
+	 * list won't change. This doesn't solve the problem
+	 * of setting the slave's MTU while it is
+	 * transmitting, but the assumption is that the base
+	 * driver can handle that.
+	 *
+	 * TODO: figure out a way to safely iterate the slaves
+	 * list, but without holding a lock around the actual
+	 * call to the base driver.
+	 */
+
+	bond_for_each_slave(bond, slave, i) {
+		dprintk("s %p s->p %p c_m %p\n", slave,
+			slave->prev, slave->dev->change_mtu);
+		if (slave->dev->change_mtu) {
+			res = slave->dev->change_mtu(slave->dev, new_mtu);
+		} else {
+			slave->dev->mtu = new_mtu;
+			res = 0;
+		}
+
+		if (res) {
+			/* If we failed to set the slave's mtu to the new value
+			 * we must abort the operation even in ACTIVE_BACKUP
+			 * mode, because if we allow the backup slaves to have
+			 * different mtu values than the active slave we'll
+			 * need to change their mtu when doing a failover. That
+			 * means changing their mtu from timer context, which
+			 * is probably not a good idea.
+			 */
+			dprintk("err %d %s\n", res, slave->dev->name);
+			goto unwind;
 		}
 	}
 
-	if (de) {
-		if (bond_proc_dir->owner == THIS_MODULE) {
-			bond_proc_dir->owner = NULL;
+	bond_dev->mtu = new_mtu;
+
+	return 0;
+
+unwind:
+	/* unwind from head to the slave that failed */
+	stop_at = slave;
+	bond_for_each_slave_from_to(bond, slave, i, bond->first_slave, stop_at) {
+		int tmp_res;
+
+		if (slave->dev->change_mtu) {
+			tmp_res = slave->dev->change_mtu(slave->dev, bond_dev->mtu);
+			if (tmp_res) {
+				dprintk("unwind err %d dev %s\n", tmp_res,
+					slave->dev->name);
+			}
+		} else {
+			slave->dev->mtu = bond_dev->mtu;
 		}
-	} else {
-		remove_proc_entry(DRV_NAME, proc_net);
-		bond_proc_dir = NULL;
 	}
+
+	return res;
 }
-#endif /* CONFIG_PROC_FS */
 
 /*
  * Change HW address
@@ -3638,263 +3490,395 @@
  * downing the master releases all slaves.  We can make bonds full of
  * bonding devices to test this, however.
  */
-static inline int
-bond_set_mac_address(struct net_device *dev, void *addr)
+static int bond_set_mac_address(struct net_device *bond_dev, void *addr)
 {
-	struct bonding *bond = dev->priv;
+	struct bonding *bond = bond_dev->priv;
 	struct sockaddr *sa = addr, tmp_sa;
-	struct slave *slave;
-	int error;
+	struct slave *slave, *stop_at;
+	int res = 0;
+	int i;
 
-	dprintk(KERN_INFO "bond_set_mac_address %p %s\n", dev,
-	       dev->name);
+	dprintk("bond=%p, name=%s\n", bond, (bond_dev ? bond_dev->name : "None"));
 
 	if (!is_valid_ether_addr(sa->sa_data)) {
 		return -EADDRNOTAVAIL;
 	}
 
-	for (slave = bond->prev; slave != (struct slave *)bond;
-	     slave = slave->prev) {
-		dprintk(KERN_INFO "bond_set_mac: slave %p %s\n", slave,
-			slave->dev->name);
+	/* Can't hold bond->lock with bh disabled here since
+	 * some base drivers panic. On the other hand we can't
+	 * hold bond->lock without bh disabled because we'll
+	 * deadlock. The only solution is to rely on the fact
+	 * that we're under rtnl_lock here, and the slaves
+	 * list won't change. This doesn't solve the problem
+	 * of setting the slave's hw address while it is
+	 * transmitting, but the assumption is that the base
+	 * driver can handle that.
+	 *
+	 * TODO: figure out a way to safely iterate the slaves
+	 * list, but without holding a lock around the actual
+	 * call to the base driver.
+	 */
+
+	bond_for_each_slave(bond, slave, i) {
+		dprintk("slave %p %s\n", slave, slave->dev->name);
+
 		if (slave->dev->set_mac_address == NULL) {
-			error = -EOPNOTSUPP;
-			dprintk(KERN_INFO "bond_set_mac EOPNOTSUPP %s\n",
-				slave->dev->name);
+			res = -EOPNOTSUPP;
+			dprintk("EOPNOTSUPP %s\n", slave->dev->name);
 			goto unwind;
 		}
 
-		error = slave->dev->set_mac_address(slave->dev, addr);
-		if (error) {
-			/* TODO: consider downing the slave 
+		res = slave->dev->set_mac_address(slave->dev, addr);
+		if (res) {
+			/* TODO: consider downing the slave
 			 * and retry ?
 			 * User should expect communications
 			 * breakage anyway until ARP finish
 			 * updating, so...
 			 */
-			dprintk(KERN_INFO "bond_set_mac err %d %s\n",
-				error, slave->dev->name);
+			dprintk("err %d %s\n", res, slave->dev->name);
 			goto unwind;
 		}
 	}
 
 	/* success */
-	memcpy(dev->dev_addr, sa->sa_data, dev->addr_len);
+	memcpy(bond_dev->dev_addr, sa->sa_data, bond_dev->addr_len);
 	return 0;
 
 unwind:
-	memcpy(tmp_sa.sa_data, dev->dev_addr, dev->addr_len);
-	tmp_sa.sa_family = dev->type;
+	memcpy(tmp_sa.sa_data, bond_dev->dev_addr, bond_dev->addr_len);
+	tmp_sa.sa_family = bond_dev->type;
+
+	/* unwind from head to the slave that failed */
+	stop_at = slave;
+	bond_for_each_slave_from_to(bond, slave, i, bond->first_slave, stop_at) {
+		int tmp_res;
+
+		tmp_res = slave->dev->set_mac_address(slave->dev, &tmp_sa);
+		if (tmp_res) {
+			dprintk("unwind err %d dev %s\n", tmp_res,
+				slave->dev->name);
+		}
+	}
+
+	return res;
+}
 
-	for (slave = slave->next; slave != bond->next;
-	     slave = slave->next) {
-		int tmp_error;
+static int bond_xmit_roundrobin(struct sk_buff *skb, struct net_device *bond_dev)
+{
+	struct bonding *bond = bond_dev->priv;
+	struct slave *slave, *start_at;
+	int i;
+
+	read_lock(&bond->lock);
+
+	if (!BOND_IS_OK(bond)) {
+		goto free_out;
+	}
+
+	read_lock(&bond->curr_slave_lock);
+	slave = start_at = bond->curr_active_slave;
+	read_unlock(&bond->curr_slave_lock);
+
+	if (!slave) {
+		goto free_out;
+	}
+
+	bond_for_each_slave_from(bond, slave, i, start_at) {
+		if (IS_UP(slave->dev) &&
+		    (slave->link == BOND_LINK_UP) &&
+		    (slave->state == BOND_STATE_ACTIVE)) {
+			skb->dev = slave->dev;
+			skb->priority = 1;
+			dev_queue_xmit(skb);
+
+			write_lock(&bond->curr_slave_lock);
+			bond->curr_active_slave = slave->next;
+			write_unlock(&bond->curr_slave_lock);
 
-		tmp_error = slave->dev->set_mac_address(slave->dev, &tmp_sa);
-		if (tmp_error) {
-			dprintk(KERN_INFO "bond_set_mac_address: "
-				"unwind err %d dev %s\n",
-				tmp_error, slave->dev->name);
+			goto out;
 		}
 	}
 
-	return error;
+out:
+	read_unlock(&bond->lock);
+	return 0;
+
+free_out:
+	/* no suitable interface, frame not sent */
+	dev_kfree_skb(skb);
+	goto out;
 }
 
 /*
- * Change the MTU of all of a master's slaves to match the master
+ * in active-backup mode, we know that bond->curr_active_slave is always valid if
+ * the bond has a usable interface.
  */
-static inline int
-bond_change_mtu(struct net_device *dev, int newmtu)
+static int bond_xmit_activebackup(struct sk_buff *skb, struct net_device *bond_dev)
 {
-	bonding_t *bond = dev->priv;
-	slave_t *slave;
-	int error;
-
-	dprintk(KERN_INFO "CM: b %p nm %d\n", bond, newmtu);
-	for (slave = bond->prev; slave != (slave_t *)bond;
-	     slave = slave->prev) {
-		dprintk(KERN_INFO "CM: s %p s->p %p c_m %p\n", slave,
-			slave->prev, slave->dev->change_mtu);
-		if (slave->dev->change_mtu) {
-			error = slave->dev->change_mtu(slave->dev, newmtu);
-		} else {
-			slave->dev->mtu = newmtu;
-			error = 0;
-		}
+	struct bonding *bond = bond_dev->priv;
 
-		if (error) {
-			/* If we failed to set the slave's mtu to the new value
-			 * we must abort the operation even in ACTIVE_BACKUP
-			 * mode, because if we allow the backup slaves to have
-			 * different mtu values than the active slave we'll
-			 * need to change their mtu when doing a failover. That
-			 * means changing their mtu from timer context, which
-			 * is probably not a good idea.
-			 */
-			dprintk(KERN_INFO "bond_change_mtu err %d %s\n",
-			       error, slave->dev->name);
-			goto unwind;
-		}
+	/* if we are sending arp packets, try to at least
+	   identify our own ip address */
+	if (bond->params.arp_interval && !my_ip &&
+		(skb->protocol == __constant_htons(ETH_P_ARP))) {
+		char *the_ip = (char *)skb->data +
+				sizeof(struct ethhdr) +
+				sizeof(struct arphdr) +
+				ETH_ALEN;
+		memcpy(&my_ip, the_ip, 4);
+	}
+
+	read_lock(&bond->lock);
+	read_lock(&bond->curr_slave_lock);
+
+	if (!BOND_IS_OK(bond)) {
+		goto free_out;
 	}
 
-	dev->mtu = newmtu;
+	if (bond->curr_active_slave) { /* one usable interface */
+		skb->dev = bond->curr_active_slave->dev;
+		skb->priority = 1;
+		dev_queue_xmit(skb);
+		goto out;
+	} else {
+		goto free_out;
+	}
+out:
+	read_unlock(&bond->curr_slave_lock);
+	read_unlock(&bond->lock);
 	return 0;
 
+free_out:
+	/* no suitable interface, frame not sent */
+	dev_kfree_skb(skb);
+	goto out;
+}
 
-unwind:
-	for (slave = slave->next; slave != bond->next;
-	     slave = slave->next) {
+/*
+ * in XOR mode, we determine the output device by performing xor on
+ * the source and destination hw adresses.  If this device is not
+ * enabled, find the next slave following this xor slave.
+ */
+static int bond_xmit_xor(struct sk_buff *skb, struct net_device *bond_dev)
+{
+	struct bonding *bond = bond_dev->priv;
+	struct ethhdr *data = (struct ethhdr *)skb->data;
+	struct slave *slave, *start_at;
+	int slave_no;
+	int i;
 
-		if (slave->dev->change_mtu) {
-			slave->dev->change_mtu(slave->dev, dev->mtu);
-		} else {
-			slave->dev->mtu = dev->mtu;
+	read_lock(&bond->lock);
+
+	if (!BOND_IS_OK(bond)) {
+		goto free_out;
+	}
+
+	slave_no = (data->h_dest[5]^bond_dev->dev_addr[5]) % bond->slave_cnt;
+
+	bond_for_each_slave(bond, slave, i) {
+		slave_no--;
+		if (slave_no < 0) {
+			break;
+		}
+	}
+
+	start_at = slave;
+
+	bond_for_each_slave_from(bond, slave, i, start_at) {
+		if (IS_UP(slave->dev) &&
+		    (slave->link == BOND_LINK_UP) &&
+		    (slave->state == BOND_STATE_ACTIVE)) {
+			skb->dev = slave->dev;
+			skb->priority = 1;
+			dev_queue_xmit(skb);
+
+			goto out;
 		}
 	}
 
-	return error;
+out:
+	read_unlock(&bond->lock);
+	return 0;
+
+free_out:
+	/* no suitable interface, frame not sent */
+	dev_kfree_skb(skb);
+	goto out;
 }
 
 /*
- * Change device name
+ * in broadcast mode, we send everything to all usable interfaces.
  */
-static inline int bond_event_changename(struct bonding *bond)
+static int bond_xmit_broadcast(struct sk_buff *skb, struct net_device *bond_dev)
 {
-#ifdef CONFIG_PROC_FS
-	bond_destroy_proc_info(bond);
-	bond_create_proc_info(bond);
-#endif
+	struct bonding *bond = bond_dev->priv;
+	struct slave *slave, *start_at;
+	struct net_device *tx_dev = NULL;
+	int i;
 
-	return NOTIFY_DONE;
-}
+	read_lock(&bond->lock);
 
-static int bond_master_netdev_event(unsigned long event, struct net_device *event_dev)
-{
-	struct bonding *bond, *event_bond = NULL;
+	if (!BOND_IS_OK(bond)) {
+		goto free_out;
+	}
 
-	list_for_each_entry(bond, &bond_dev_list, bond_list) {
-		if (bond == event_dev->priv) {
-			event_bond = bond;
-			break;
+	read_lock(&bond->curr_slave_lock);
+	start_at = bond->curr_active_slave;
+	read_unlock(&bond->curr_slave_lock);
+
+	if (!start_at) {
+		goto free_out;
+	}
+
+	bond_for_each_slave_from(bond, slave, i, start_at) {
+		if (IS_UP(slave->dev) &&
+		    (slave->link == BOND_LINK_UP) &&
+		    (slave->state == BOND_STATE_ACTIVE)) {
+			if (tx_dev) {
+				struct sk_buff *skb2 = skb_clone(skb, GFP_ATOMIC);
+				if (!skb2) {
+					printk(KERN_ERR DRV_NAME
+					       ": Error: bond_xmit_broadcast(): "
+					       "skb_clone() failed\n");
+					continue;
+				}
+
+				skb2->dev = tx_dev;
+				skb2->priority = 1;
+				dev_queue_xmit(skb2);
+			}
+			tx_dev = slave->dev;
 		}
 	}
 
-	if (event_bond == NULL) {
-		return NOTIFY_DONE;
+	if (tx_dev) {
+		skb->dev = tx_dev;
+		skb->priority = 1;
+		dev_queue_xmit(skb);
+	} else {
+		goto free_out;
 	}
 
-	switch (event) {
-	case NETDEV_CHANGENAME:
-		return bond_event_changename(event_bond);
-	case NETDEV_UNREGISTER:
-		/*
-		 * TODO: remove a bond from the list?
-		 */
-		break;
-	default:
-		break;
-	}
+out:
+	/* frame sent to all suitable interfaces */
+	read_unlock(&bond->lock);
+	return 0;
 
-	return NOTIFY_DONE;
+free_out:
+	/* no suitable interface, frame not sent */
+	dev_kfree_skb(skb);
+	goto out;
 }
 
-static int bond_slave_netdev_event(unsigned long event, struct net_device *event_dev)
+#ifdef CONFIG_NET_FASTROUTE
+static int bond_accept_fastpath(struct net_device *bond_dev, struct dst_entry *dst)
 {
-	struct net_device *master = event_dev->master;
+	return -1;
+}
+#endif
 
-	switch (event) {
-	case NETDEV_UNREGISTER:
-		if (master != NULL) {
-			bond_release(master, event_dev);
-		}
+/*------------------------- Device initialization ---------------------------*/
+
+/*
+ * set bond mode specific net device operations
+ */
+static inline void bond_set_mode_ops(struct net_device *bond_dev, int mode)
+{
+	switch (mode) {
+	case BOND_MODE_ROUNDROBIN:
+		bond_dev->hard_start_xmit = bond_xmit_roundrobin;
 		break;
-	case NETDEV_CHANGE:
-		/*
-		 * TODO: is this what we get if somebody
-		 * sets up a hierarchical bond, then rmmod's
-		 * one of the slave bonding devices?
-		 */
+	case BOND_MODE_ACTIVEBACKUP:
+		bond_dev->hard_start_xmit = bond_xmit_activebackup;
 		break;
-	case NETDEV_DOWN:
-		/*
-		 * ... Or is it this?
-		 */
+	case BOND_MODE_XOR:
+		bond_dev->hard_start_xmit = bond_xmit_xor;
 		break;
-	case NETDEV_CHANGEMTU:
-		/*
-		 * TODO: Should slaves be allowed to
-		 * independently alter their MTU?  For
-		 * an active-backup bond, slaves need
-		 * not be the same type of device, so
-		 * MTUs may vary.  For other modes,
-		 * slaves arguably should have the
-		 * same MTUs. To do this, we'd need to
-		 * take over the slave's change_mtu
-		 * function for the duration of their
-		 * servitude.
-		 */
+	case BOND_MODE_BROADCAST:
+		bond_dev->hard_start_xmit = bond_xmit_broadcast;
 		break;
-	case NETDEV_CHANGENAME:
-		/*
-		 * TODO: handle changing the primary's name
-		 */
+	case BOND_MODE_8023AD:
+		bond_dev->hard_start_xmit = bond_3ad_xmit_xor;
+		break;
+	case BOND_MODE_TLB:
+	case BOND_MODE_ALB:
+		bond_dev->hard_start_xmit = bond_alb_xmit;
+		bond_dev->set_mac_address = bond_alb_set_mac_address;
 		break;
 	default:
+		/* Should never happen, mode already checked */
+		printk(KERN_ERR DRV_NAME
+		       ": Error: Unknown bonding mode %d\n",
+		       mode);
 		break;
 	}
-
-	return NOTIFY_DONE;
 }
 
 /*
- * bond_netdev_event: handle netdev notifier chain events.
- *
- * This function receives events for the netdev chain.  The caller (an
- * ioctl handler calling notifier_call_chain) holds the necessary
- * locks for us to safely manipulate the slave devices (RTNL lock,
- * dev_probe_lock).
+ * Does not allocate but creates a /proc entry.
+ * Allowed to fail.
  */
-static int bond_netdev_event(struct notifier_block *this, unsigned long event, void *ptr)
+static int __init bond_init(struct net_device *bond_dev, struct bond_params *params)
 {
-	struct net_device *event_dev = (struct net_device *)ptr;
-	unsigned short flags;
-	int res = NOTIFY_DONE;
+	struct bonding *bond = bond_dev->priv;
 
-	dprintk(KERN_INFO "bond_netdev_event n_b %p ev %lx ptr %p\n",
-		this, event, ptr);
+	dprintk("Begin bond_init for %s\n", bond_dev->name);
 
-	flags = event_dev->flags & (IFF_MASTER | IFF_SLAVE);
-	switch (flags) {
-	case IFF_MASTER:
-		res = bond_master_netdev_event(event, event_dev);
-		break;
-	case IFF_SLAVE:
-		res = bond_slave_netdev_event(event, event_dev);
-		break;
-	default:
-		/* A master that is also a slave ? */
-		break;
-	}
+	/* initialize rwlocks */
+	rwlock_init(&bond->lock);
+	rwlock_init(&bond->curr_slave_lock);
 
-	return res;
-}
+	bond->params = *params; /* copy params struct */
 
-static struct notifier_block bond_netdev_notifier = {
-	.notifier_call = bond_netdev_event,
-};
+	/* Initialize pointers */
+	bond->first_slave = NULL;
+	bond->curr_active_slave = NULL;
+	bond->current_arp_slave = NULL;
+	bond->primary_slave = NULL;
+	bond->dev = bond_dev;
+
+	/* Initialize the device entry points */
+	bond_dev->open = bond_open;
+	bond_dev->stop = bond_close;
+	bond_dev->get_stats = bond_get_stats;
+	bond_dev->do_ioctl = bond_do_ioctl;
+	bond_dev->set_multicast_list = bond_set_multicast_list;
+	bond_dev->change_mtu = bond_change_mtu;
+	bond_dev->set_mac_address = bond_set_mac_address;
+
+	bond_set_mode_ops(bond_dev, bond->params.mode);
+
+	bond_dev->destructor = free_netdev;
+#ifdef CONFIG_NET_FASTROUTE
+	bond_dev->accept_fastpath = bond_accept_fastpath;
+#endif
+
+	/* Initialize the device options */
+	bond_dev->tx_queue_len = 0;
+	bond_dev->flags |= IFF_MASTER|IFF_MULTICAST;
+
+
+#ifdef CONFIG_PROC_FS
+	bond_create_proc_entry(bond);
+#endif
+
+	list_add_tail(&bond->bond_list, &bond_dev_list);
+
+	return 0;
+}
 
 /* De-initialize device specific data.
  * Caller must hold rtnl_lock.
  */
-static inline void bond_deinit(struct net_device *dev)
+static inline void bond_deinit(struct net_device *bond_dev)
 {
-	struct bonding *bond = dev->priv;
+	struct bonding *bond = bond_dev->priv;
 
 	list_del(&bond->bond_list);
 
 #ifdef CONFIG_PROC_FS
-	bond_destroy_proc_info(bond);
+	bond_remove_proc_entry(bond);
 #endif
 }
 
@@ -3906,10 +3890,10 @@
 	struct bonding *bond, *nxt;
 
 	list_for_each_entry_safe(bond, nxt, &bond_dev_list, bond_list) {
-		struct net_device *dev = bond->device;
+		struct net_device *bond_dev = bond->dev;
 
-		unregister_netdevice(dev);
-		bond_deinit(dev);
+		unregister_netdevice(bond_dev);
+		bond_deinit(bond_dev);
 	}
 
 #ifdef CONFIG_PROC_FS
@@ -3917,125 +3901,21 @@
 #endif
 }
 
-/*
- * Does not allocate but creates a /proc entry.
- * Allowed to fail.
- */
-static int __init bond_init(struct net_device *dev)
-{
-	struct bonding *bond;
-	int count;
-
-#ifdef BONDING_DEBUG
-	printk (KERN_INFO "Begin bond_init for %s\n", dev->name);
-#endif
-	bond = dev->priv;
-
-	/* initialize rwlocks */
-	rwlock_init(&bond->lock);
-	rwlock_init(&bond->ptrlock);
-
-	/* Initialize pointers */
-	bond->next = bond->prev = (slave_t *)bond;
-	bond->current_slave = NULL;
-	bond->current_arp_slave = NULL;
-	bond->device = dev;
-
-	/* Initialize the device structure. */
-	dev->set_mac_address = bond_set_mac_address;
-
-	switch (bond_mode) {
-	case BOND_MODE_ACTIVEBACKUP:
-		dev->hard_start_xmit = bond_xmit_activebackup;
-		break;
-	case BOND_MODE_ROUNDROBIN:
-		dev->hard_start_xmit = bond_xmit_roundrobin;
-		break;
-	case BOND_MODE_XOR:
-		dev->hard_start_xmit = bond_xmit_xor;
-		break;
-	case BOND_MODE_BROADCAST:
-		dev->hard_start_xmit = bond_xmit_broadcast;
-		break;
-	case BOND_MODE_8023AD:
-		dev->hard_start_xmit = bond_3ad_xmit_xor;
-		break;
-	case BOND_MODE_TLB:
-	case BOND_MODE_ALB:
-		dev->hard_start_xmit = bond_alb_xmit;
-		dev->set_mac_address = bond_alb_set_mac_address;
-		break;
-	default:
-		printk(KERN_ERR "Unknown bonding mode %d\n", bond_mode);
-		return -EINVAL;
-	}
-
-	dev->get_stats = bond_get_stats;
-	dev->open = bond_open;
-	dev->stop = bond_close;
-	dev->set_multicast_list = set_multicast_list;
-	dev->do_ioctl = bond_ioctl;
-	dev->change_mtu = bond_change_mtu;
-	dev->tx_queue_len = 0;
-	dev->flags |= IFF_MASTER|IFF_MULTICAST;
-#ifdef CONFIG_NET_FASTROUTE
-	dev->accept_fastpath = bond_accept_fastpath;
-#endif
-
-	printk(KERN_INFO "%s registered with", dev->name);
-	if (miimon > 0) {
-		printk(" MII link monitoring set to %d ms", miimon);
-		updelay /= miimon;
-		downdelay /= miimon;
-	} else {
-		printk("out MII link monitoring");
-	}
-	printk(", in %s mode.\n", bond_mode_name());
-
-	printk(KERN_INFO "%s registered with", dev->name);
-	if (arp_interval > 0) {
-		printk(" ARP monitoring set to %d ms with %d target(s):", 
-			arp_interval, arp_ip_count);
-		for (count=0 ; count<arp_ip_count ; count++)
-                        printk (" %s", arp_ip_target[count]);
-		printk("\n");
-	} else {
-		printk("out ARP monitoring\n");
-	}
- 
-#ifdef CONFIG_PROC_FS
-	bond_create_proc_info(bond);
-#endif
-
-	dev->destructor = free_netdev;
-
-	list_add_tail(&bond->bond_list, &bond_dev_list);
-
-	return 0;
-}
-
-/*
-static int __init bond_probe(struct net_device *dev)
-{
-	bond_init(dev);
-	return 0;
-}
- */
+/*------------------------- Module initialization ---------------------------*/
 
 /*
  * Convert string input module parms.  Accept either the
  * number of the mode or its string name.
  */
-static inline int
-bond_parse_parm(char *mode_arg, struct bond_parm_tbl *tbl)
+static inline int bond_parse_parm(char *mode_arg, struct bond_parm_tbl *tbl)
 {
 	int i;
 
-	for (i = 0; tbl[i].modename != NULL; i++) {
+	for (i = 0; tbl[i].modename; i++) {
 		if ((isdigit(*mode_arg) &&
-		    tbl[i].mode == simple_strtol(mode_arg, NULL, 0)) ||
-		    (0 == strncmp(mode_arg, tbl[i].modename,
-				  strlen(tbl[i].modename)))) {
+		     tbl[i].mode == simple_strtol(mode_arg, NULL, 0)) ||
+		    (strncmp(mode_arg, tbl[i].modename,
+			     strlen(tbl[i].modename)) == 0)) {
 			return tbl[i].mode;
 		}
 	}
@@ -4043,275 +3923,281 @@
 	return -1;
 }
 
-
-static int __init bonding_init(void)
+static int bond_check_params(struct bond_params *params)
 {
-	int no;
-	int err;
-
-	printk(KERN_INFO "%s", version);
-
 	/*
 	 * Convert string parameters.
 	 */
 	if (mode) {
 		bond_mode = bond_parse_parm(mode, bond_mode_tbl);
 		if (bond_mode == -1) {
-			printk(KERN_WARNING
-			       "bonding_init(): Invalid bonding mode \"%s\"\n",
+			printk(KERN_ERR DRV_NAME
+			       ": Error: Invalid bonding mode \"%s\"\n",
 			       mode == NULL ? "NULL" : mode);
 			return -EINVAL;
 		}
 	}
 
-	if (USES_PRIMARY(bond_mode)) {
-		multicast_mode = BOND_MULTICAST_ACTIVE;
-	} else {
-		multicast_mode = BOND_MULTICAST_ALL;
-	}
-
-	if (multicast) {
-		multicast_mode = bond_parse_parm(multicast, bond_mc_tbl);
-		if (multicast_mode == -1) {
-			printk(KERN_WARNING 
-		       "bonding_init(): Invalid multicast mode \"%s\"\n",
-			       multicast == NULL ? "NULL" : multicast);
-			return -EINVAL;
-		}
-	}
-
 	if (lacp_rate) {
 		if (bond_mode != BOND_MODE_8023AD) {
-			printk(KERN_WARNING
-			       "lacp_rate param is irrelevant in mode %s\n",
-			       bond_mode_name());
+			printk(KERN_INFO DRV_NAME
+			       ": lacp_rate param is irrelevant in mode %s\n",
+			       bond_mode_name(bond_mode));
 		} else {
 			lacp_fast = bond_parse_parm(lacp_rate, bond_lacp_tbl);
 			if (lacp_fast == -1) {
-				printk(KERN_WARNING
-			       	       "bonding_init(): Invalid lacp rate "
-				       "\"%s\"\n",
+				printk(KERN_ERR DRV_NAME
+				       ": Error: Invalid lacp rate \"%s\"\n",
 				       lacp_rate == NULL ? "NULL" : lacp_rate);
-
 				return -EINVAL;
 			}
 		}
 	}
 
 	if (max_bonds < 1 || max_bonds > INT_MAX) {
-		printk(KERN_WARNING 
-		       "bonding_init(): max_bonds (%d) not in range %d-%d, "
-		       "so it was reset to BOND_DEFAULT_MAX_BONDS (%d)",
+		printk(KERN_WARNING DRV_NAME
+		       ": Warning: max_bonds (%d) not in range %d-%d, so it "
+		       "was reset to BOND_DEFAULT_MAX_BONDS (%d)",
 		       max_bonds, 1, INT_MAX, BOND_DEFAULT_MAX_BONDS);
 		max_bonds = BOND_DEFAULT_MAX_BONDS;
 	}
 
 	if (miimon < 0) {
-		printk(KERN_WARNING 
-		       "bonding_init(): miimon module parameter (%d), "
+		printk(KERN_WARNING DRV_NAME
+		       ": Warning: miimon module parameter (%d), "
 		       "not in range 0-%d, so it was reset to %d\n",
 		       miimon, INT_MAX, BOND_LINK_MON_INTERV);
 		miimon = BOND_LINK_MON_INTERV;
 	}
 
 	if (updelay < 0) {
-		printk(KERN_WARNING 
-		       "bonding_init(): updelay module parameter (%d), "
+		printk(KERN_WARNING DRV_NAME
+		       ": Warning: updelay module parameter (%d), "
 		       "not in range 0-%d, so it was reset to 0\n",
 		       updelay, INT_MAX);
 		updelay = 0;
 	}
 
 	if (downdelay < 0) {
-		printk(KERN_WARNING 
-		       "bonding_init(): downdelay module parameter (%d), "
+		printk(KERN_WARNING DRV_NAME
+		       ": Warning: downdelay module parameter (%d), "
 		       "not in range 0-%d, so it was reset to 0\n",
 		       downdelay, INT_MAX);
 		downdelay = 0;
 	}
 
+	if ((use_carrier != 0) && (use_carrier != 1)) {
+		printk(KERN_WARNING DRV_NAME
+		       ": Warning: use_carrier module parameter (%d), "
+		       "not of valid value (0/1), so it was set to 1\n",
+		       use_carrier);
+		use_carrier = 1;
+	}
+
 	/* reset values for 802.3ad */
 	if (bond_mode == BOND_MODE_8023AD) {
-		if (arp_interval != 0) {
-			printk(KERN_WARNING "bonding_init(): ARP monitoring"
-			       "can't be used simultaneously with 802.3ad, "
-			       "disabling ARP monitoring\n");
-			arp_interval = 0;
-		}
-
-		if (miimon == 0) {
-			printk(KERN_ERR
-			       "bonding_init(): miimon must be specified, "
-			       "otherwise bonding will not detect link failure, "
-			       "speed and duplex which are essential "
-			       "for 802.3ad operation\n");
-			printk(KERN_ERR "Forcing miimon to 100msec\n");
+		if (!miimon) {
+			printk(KERN_WARNING DRV_NAME
+			       ": Warning: miimon must be specified, "
+			       "otherwise bonding will not detect link "
+			       "failure, speed and duplex which are "
+			       "essential for 802.3ad operation\n");
+			printk(KERN_WARNING "Forcing miimon to 100msec\n");
 			miimon = 100;
 		}
-
-		if (multicast_mode != BOND_MULTICAST_ALL) {
-			printk(KERN_ERR
-			       "bonding_init(): Multicast mode must "
-			       "be set to ALL for 802.3ad\n");
-			printk(KERN_ERR "Forcing Multicast mode to ALL\n");
-			multicast_mode = BOND_MULTICAST_ALL;
-		}
 	}
 
 	/* reset values for TLB/ALB */
 	if ((bond_mode == BOND_MODE_TLB) ||
 	    (bond_mode == BOND_MODE_ALB)) {
-		if (miimon == 0) {
-			printk(KERN_ERR
-			       "bonding_init(): miimon must be specified, "
-			       "otherwise bonding will not detect link failure "
-			       "and link speed which are essential "
+		if (!miimon) {
+			printk(KERN_WARNING DRV_NAME
+			       ": Warning: miimon must be specified, "
+			       "otherwise bonding will not detect link "
+			       "failure and link speed which are essential "
 			       "for TLB/ALB load balancing\n");
-			printk(KERN_ERR "Forcing miimon to 100msec\n");
+			printk(KERN_WARNING "Forcing miimon to 100msec\n");
 			miimon = 100;
 		}
-
-		if (multicast_mode != BOND_MULTICAST_ACTIVE) {
-			printk(KERN_ERR
-			       "bonding_init(): Multicast mode must "
-			       "be set to ACTIVE for TLB/ALB\n");
-			printk(KERN_ERR "Forcing Multicast mode to ACTIVE\n");
-			multicast_mode = BOND_MULTICAST_ACTIVE;
-		}
 	}
 
 	if (bond_mode == BOND_MODE_ALB) {
-		printk(KERN_INFO
-		       "In ALB mode you might experience client disconnections"
-		       " upon reconnection of a link if the bonding module"
-		       " updelay parameter (%d msec) is incompatible with the"
-		       " forwarding delay time of the switch\n", updelay);
+		printk(KERN_NOTICE DRV_NAME
+		       ": In ALB mode you might experience client "
+		       "disconnections upon reconnection of a link if the "
+		       "bonding module updelay parameter (%d msec) is "
+		       "incompatible with the forwarding delay time of the "
+		       "switch\n",
+		       updelay);
 	}
 
-	if (miimon == 0) {
-		if ((updelay != 0) || (downdelay != 0)) {
+	if (!miimon) {
+		if (updelay || downdelay) {
 			/* just warn the user the up/down delay will have
 			 * no effect since miimon is zero...
 			 */
-			printk(KERN_WARNING 
-		               "bonding_init(): miimon module parameter not "
-			       "set and updelay (%d) or downdelay (%d) module "
+			printk(KERN_WARNING DRV_NAME
+			       ": Warning: miimon module parameter not set "
+			       "and updelay (%d) or downdelay (%d) module "
 			       "parameter is set; updelay and downdelay have "
 			       "no effect unless miimon is set\n",
-		               updelay, downdelay);
+			       updelay, downdelay);
 		}
 	} else {
 		/* don't allow arp monitoring */
-		if (arp_interval != 0) {
-			printk(KERN_WARNING 
-		               "bonding_init(): miimon (%d) and arp_interval "
-			       "(%d) can't be used simultaneously, "
-			       "disabling ARP monitoring\n",
-		               miimon, arp_interval);
+		if (arp_interval) {
+			printk(KERN_WARNING DRV_NAME
+			       ": Warning: miimon (%d) and arp_interval (%d) "
+			       "can't be used simultaneously, disabling ARP "
+			       "monitoring\n",
+			       miimon, arp_interval);
 			arp_interval = 0;
 		}
 
 		if ((updelay % miimon) != 0) {
-			/* updelay will be rounded in bond_init() when it
-			 * is divided by miimon, we just inform user here
-			 */
-			printk(KERN_WARNING 
-		               "bonding_init(): updelay (%d) is not a multiple "
+			printk(KERN_WARNING DRV_NAME
+			       ": Warning: updelay (%d) is not a multiple "
 			       "of miimon (%d), updelay rounded to %d ms\n",
-		               updelay, miimon, (updelay / miimon) * miimon);
+			       updelay, miimon, (updelay / miimon) * miimon);
 		}
 
+		updelay /= miimon;
+
 		if ((downdelay % miimon) != 0) {
-			/* downdelay will be rounded in bond_init() when it
-			 * is divided by miimon, we just inform user here
-			 */
-			printk(KERN_WARNING 
-		               "bonding_init(): downdelay (%d) is not a "
-			       "multiple of miimon (%d), downdelay rounded "
-			       "to %d ms\n",
-		               downdelay, miimon, 
+			printk(KERN_WARNING DRV_NAME
+			       ": Warning: downdelay (%d) is not a multiple "
+			       "of miimon (%d), downdelay rounded to %d ms\n",
+			       downdelay, miimon,
 			       (downdelay / miimon) * miimon);
 		}
+
+		downdelay /= miimon;
 	}
 
 	if (arp_interval < 0) {
-		printk(KERN_WARNING 
-		       "bonding_init(): arp_interval module parameter (%d), "
-		       "not in range 0-%d, so it was reset to %d\n",
+		printk(KERN_WARNING DRV_NAME
+		       ": Warning: arp_interval module parameter (%d) "
+		       ", not in range 0-%d, so it was reset to %d\n",
 		       arp_interval, INT_MAX, BOND_LINK_ARP_INTERV);
 		arp_interval = BOND_LINK_ARP_INTERV;
 	}
 
-        for (arp_ip_count=0 ;
-             (arp_ip_count < MAX_ARP_IP_TARGETS) && arp_ip_target[arp_ip_count];
-              arp_ip_count++ ) {
+	for (arp_ip_count = 0;
+	     (arp_ip_count < BOND_MAX_ARP_TARGETS) && arp_ip_target[arp_ip_count];
+	     arp_ip_count++) {
 		/* not complete check, but should be good enough to
 		   catch mistakes */
-		if (!isdigit(arp_ip_target[arp_ip_count][0])) { 
-                        printk(KERN_WARNING
-                               "bonding_init(): bad arp_ip_target module "
-                               "parameter (%s), ARP monitoring will not be "
-                               "performed\n",
-                               arp_ip_target[arp_ip_count]);
-                        arp_interval = 0;
-		} else { 
-			u32 ip = in_aton(arp_ip_target[arp_ip_count]); 
+		if (!isdigit(arp_ip_target[arp_ip_count][0])) {
+			printk(KERN_WARNING DRV_NAME
+			       ": Warning: bad arp_ip_target module parameter "
+			       "(%s), ARP monitoring will not be performed\n",
+			       arp_ip_target[arp_ip_count]);
+			arp_interval = 0;
+		} else {
+			u32 ip = in_aton(arp_ip_target[arp_ip_count]);
 			arp_target[arp_ip_count] = ip;
 		}
-        }
-
+	}
 
-	if ( (arp_interval > 0) && (arp_ip_count==0)) {
+	if (arp_interval && !arp_ip_count) {
 		/* don't allow arping if no arp_ip_target given... */
-		printk(KERN_WARNING 
-		       "bonding_init(): arp_interval module parameter "
-		       "(%d) specified without providing an arp_ip_target "
+		printk(KERN_WARNING DRV_NAME
+		       ": Warning: arp_interval module parameter (%d) "
+		       "specified without providing an arp_ip_target "
 		       "parameter, arp_interval was reset to 0\n",
 		       arp_interval);
 		arp_interval = 0;
 	}
 
-	if ((miimon == 0) && (arp_interval == 0)) {
+	if (miimon) {
+		printk(KERN_INFO DRV_NAME
+		       ": MII link monitoring set to %d ms\n",
+		       miimon);
+	} else if (arp_interval) {
+		int i;
+
+		printk(KERN_INFO DRV_NAME
+		       ": ARP monitoring set to %d ms with %d target(s):",
+		       arp_interval, arp_ip_count);
+
+		for (i = 0; i < arp_ip_count; i++)
+			printk (" %s", arp_ip_target[i]);
+
+		printk("\n");
+
+	} else {
 		/* miimon and arp_interval not set, we need one so things
 		 * work as expected, see bonding.txt for details
 		 */
-		printk(KERN_ERR 
-		       "bonding_init(): either miimon or "
-		       "arp_interval and arp_ip_target module parameters "
-		       "must be specified, otherwise bonding will not detect "
-		       "link failures! see bonding.txt for details.\n");
+		printk(KERN_WARNING DRV_NAME
+		       ": Warning: either miimon or arp_interval and "
+		       "arp_ip_target module parameters must be specified, "
+		       "otherwise bonding will not detect link failures! see "
+		       "bonding.txt for details.\n");
 	}
 
-	if ((primary != NULL) && !USES_PRIMARY(bond_mode)) {
+	if (primary && !USES_PRIMARY(bond_mode)) {
 		/* currently, using a primary only makes sense
 		 * in active backup, TLB or ALB modes
 		 */
-		printk(KERN_WARNING 
-		       "bonding_init(): %s primary device specified but has "
-		       "no effect in %s mode\n",
-		       primary, bond_mode_name());
+		printk(KERN_WARNING DRV_NAME
+		       ": Warning: %s primary device specified but has no "
+		       "effect in %s mode\n",
+		       primary, bond_mode_name(bond_mode));
 		primary = NULL;
 	}
 
+	/* fill params struct with the proper values */
+	params->mode = bond_mode;
+	params->miimon = miimon;
+	params->arp_interval = arp_interval;
+	params->updelay = updelay;
+	params->downdelay = downdelay;
+	params->use_carrier = use_carrier;
+	params->lacp_fast = lacp_fast;
+	params->primary[0] = 0;
+
+	if (primary) {
+		strncpy(params->primary, primary, IFNAMSIZ);
+		params->primary[IFNAMSIZ - 1] = 0;
+	}
+
+	memcpy(params->arp_targets, arp_target, sizeof(arp_target));
+
+	return 0;
+}
+
+static int __init bonding_init(void)
+{
+	struct bond_params params;
+	int i;
+	int res;
+
+	printk(KERN_INFO "%s", version);
+
+	res = bond_check_params(&params);
+	if (res) {
+		return res;
+	}
+
 	rtnl_lock();
 
 #ifdef CONFIG_PROC_FS
 	bond_create_proc_dir();
 #endif
 
-	err = 0;
-	for (no = 0; no < max_bonds; no++) {
-		struct net_device *dev;
-
-		dev = alloc_netdev(sizeof(struct bonding), "", ether_setup);
-		if (!dev) {
-			err = -ENOMEM;
+	for (i = 0; i < max_bonds; i++) {
+		struct net_device *bond_dev;
+
+		bond_dev = alloc_netdev(sizeof(struct bonding), "", ether_setup);
+		if (!bond_dev) {
+			res = -ENOMEM;
 			goto out_err;
 		}
 
-		err = dev_alloc_name(dev, "bond%d");
-		if (err < 0) {
-			free_netdev(dev);
+		res = dev_alloc_name(bond_dev, "bond%d");
+		if (res < 0) {
+			free_netdev(bond_dev);
 			goto out_err;
 		}
 
@@ -4319,18 +4205,18 @@
 		 * /proc files), but before register_netdevice(), because we
 		 * need to set function pointers.
 		 */
-		err = bond_init(dev);
-		if (err < 0) {
-			free_netdev(dev);
+		res = bond_init(bond_dev, &params);
+		if (res < 0) {
+			free_netdev(bond_dev);
 			goto out_err;
 		}
 
-		SET_MODULE_OWNER(dev);
+		SET_MODULE_OWNER(bond_dev);
 
-		err = register_netdevice(dev);
-		if (err < 0) {
-			bond_deinit(dev);
-			free_netdev(dev);
+		res = register_netdevice(bond_dev);
+		if (res < 0) {
+			bond_deinit(bond_dev);
+			free_netdev(bond_dev);
 			goto out_err;
 		}
 	}
@@ -4346,7 +4232,7 @@
 
 	rtnl_unlock();
 
-	return err;
+	return res;
 }
 
 static void __exit bonding_exit(void)
@@ -4362,6 +4248,8 @@
 module_exit(bonding_exit);
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION(DRV_DESCRIPTION ", v" DRV_VERSION);
+MODULE_AUTHOR("Thomas Davis, tadavis@lbl.gov and many others");
+MODULE_SUPPORTED_DEVICE("most ethernet devices");
 
 /*
  * Local variables:
@@ -4370,3 +4258,4 @@
  *  tab-width: 8
  * End:
  */
+
--- diff/drivers/net/bonding/bonding.h	2003-09-30 15:46:15.000000000 +0100
+++ source/drivers/net/bonding/bonding.h	2004-02-09 10:39:53.000000000 +0000
@@ -9,7 +9,7 @@
  *
  *	This software may be used and distributed according to the terms
  *	of the GNU Public License, incorporated herein by reference.
- * 
+ *
  *
  * 2003/03/18 - Amir Noam <amir.noam at intel dot com>,
  *		Tsippy Mendelson <tsippy.mendelson at intel dot com> and
@@ -22,159 +22,220 @@
  *
  * 2003/05/01 - Shmulik Hen <shmulik.hen at intel dot com>
  *	- Added support for Transmit load balancing mode.
+ *
+ * 2003/12/01 - Shmulik Hen <shmulik.hen at intel dot com>
+ *	- Code cleanup and style changes
  */
- 
+
 #ifndef _LINUX_BONDING_H
 #define _LINUX_BONDING_H
 
 #include <linux/timer.h>
 #include <linux/proc_fs.h>
+#include <linux/if_bonding.h>
 #include "bond_3ad.h"
 #include "bond_alb.h"
 
-#ifdef BONDING_DEBUG
+#define DRV_VERSION	"2.5.4"
+#define DRV_RELDATE	"December 30, 2003"
+#define DRV_NAME	"bonding"
+#define DRV_DESCRIPTION	"Ethernet Channel Bonding Driver"
 
-// use this like so: BOND_PRINT_DBG(("foo = %d, bar = %d", foo, bar));
-#define BOND_PRINT_DBG(X)                                     \
-do {                                                          \
-	printk(KERN_DEBUG "%s (%d)", __FUNCTION__, __LINE__); \
-	printk X;                                             \
-	printk("\n");                                         \
-} while(0)
+#define BOND_MAX_ARP_TARGETS	16
 
+#ifdef BONDING_DEBUG
+#define dprintk(fmt, args...) \
+	printk(KERN_DEBUG     \
+	       DRV_NAME ": %s() %d: " fmt, __FUNCTION__, __LINE__ , ## args )
 #else
-#define BOND_PRINT_DBG(X)
+#define dprintk(fmt, args...)
 #endif /* BONDING_DEBUG */
 
-#define IS_UP(dev)  ((((dev)->flags & (IFF_UP)) == (IFF_UP)) && \
-		     (netif_running(dev) && netif_carrier_ok(dev)))
+#define IS_UP(dev)					   \
+	      ((((dev)->flags & IFF_UP) == IFF_UP)	&& \
+	       netif_running(dev)			&& \
+	       netif_carrier_ok(dev))
+
+/*
+ * Checks whether bond is ready for transmit.
+ *
+ * Caller must hold bond->lock
+ */
+#define BOND_IS_OK(bond)			     \
+		   (((bond)->dev->flags & IFF_UP) && \
+		    netif_running((bond)->dev)	  && \
+		    ((bond)->slave_cnt > 0))
 
-/* Checks whether the dev is ready for transmit. We do not check netif_running
- * since a device can be stopped by the driver for short periods of time for
- * maintainance. dev_queue_xmit() handles this by queing the packet until the
- * the dev is running again. Keeping packets ordering requires sticking the
- * same dev as much as possible
- */
-#define SLAVE_IS_OK(slave) \
-		     ((((slave)->dev->flags & (IFF_UP)) == (IFF_UP)) && \
-		     netif_carrier_ok((slave)->dev) && \
+/*
+ * Checks whether slave is ready for transmit.
+ */
+#define SLAVE_IS_OK(slave)			        \
+		    (((slave)->dev->flags & IFF_UP)  && \
+		     netif_running((slave)->dev)     && \
 		     ((slave)->link == BOND_LINK_UP) && \
 		     ((slave)->state == BOND_STATE_ACTIVE))
 
 
-typedef struct slave {
+#define USES_PRIMARY(mode)				\
+		(((mode) == BOND_MODE_ACTIVEBACKUP) ||	\
+		 ((mode) == BOND_MODE_TLB)          ||	\
+		 ((mode) == BOND_MODE_ALB))
+
+/*
+ * Less bad way to call ioctl from within the kernel; this needs to be
+ * done some other way to get the call out of interrupt context.
+ * Needs "ioctl" variable to be supplied by calling context.
+ */
+#define IOCTL(dev, arg, cmd) ({		\
+	int res = 0;			\
+	mm_segment_t fs = get_fs();	\
+	set_fs(get_ds());		\
+	res = ioctl(dev, arg, cmd);	\
+	set_fs(fs);			\
+	res; })
+
+/**
+ * bond_for_each_slave_from - iterate the slaves list from a starting point
+ * @bond:	the bond holding this list.
+ * @pos:	current slave.
+ * @cnt:	counter for max number of moves
+ * @start:	starting point.
+ *
+ * Caller must hold bond->lock
+ */
+#define bond_for_each_slave_from(bond, pos, cnt, start)	\
+	for (cnt = 0, pos = start;				\
+	     cnt < (bond)->slave_cnt;				\
+             cnt++, pos = (pos)->next)
+
+/**
+ * bond_for_each_slave_from_to - iterate the slaves list from start point to stop point
+ * @bond:	the bond holding this list.
+ * @pos:	current slave.
+ * @cnt:	counter for number max of moves
+ * @start:	start point.
+ * @stop:	stop point.
+ *
+ * Caller must hold bond->lock
+ */
+#define bond_for_each_slave_from_to(bond, pos, cnt, start, stop)	\
+	for (cnt = 0, pos = start;					\
+	     ((cnt < (bond)->slave_cnt) && (pos != (stop)->next));	\
+             cnt++, pos = (pos)->next)
+
+/**
+ * bond_for_each_slave - iterate the slaves list from head
+ * @bond:	the bond holding this list.
+ * @pos:	current slave.
+ * @cnt:	counter for max number of moves
+ *
+ * Caller must hold bond->lock
+ */
+#define bond_for_each_slave(bond, pos, cnt)	\
+		bond_for_each_slave_from(bond, pos, cnt, (bond)->first_slave)
+
+
+struct bond_params {
+	int mode;
+	int miimon;
+	int arp_interval;
+	int use_carrier;
+	int updelay;
+	int downdelay;
+	int lacp_fast;
+	char primary[IFNAMSIZ];
+	u32 arp_targets[BOND_MAX_ARP_TARGETS];
+};
+
+struct slave {
+	struct net_device *dev; /* first - usefull for panic debug */
 	struct slave *next;
 	struct slave *prev;
-	struct net_device *dev;
-	short  delay;
-	unsigned long jiffies;
-	char   link;    /* one of BOND_LINK_XXXX */
-	char   state;   /* one of BOND_STATE_XXXX */
-	unsigned short original_flags;
-	u32 link_failure_count;
+	s16    delay;
+	u32    jiffies;
+	s8     link;    /* one of BOND_LINK_XXXX */
+	s8     state;   /* one of BOND_STATE_XXXX */
+	u32    original_flags;
+	u32    link_failure_count;
 	u16    speed;
 	u8     duplex;
 	u8     perm_hwaddr[ETH_ALEN];
 	struct ad_slave_info ad_info; /* HUGE - better to dynamically alloc */
 	struct tlb_slave_info tlb_info;
-} slave_t;
+};
 
 /*
  * Here are the locking policies for the two bonding locks:
  *
  * 1) Get bond->lock when reading/writing slave list.
- * 2) Get bond->ptrlock when reading/writing bond->current_slave.
+ * 2) Get bond->curr_slave_lock when reading/writing bond->curr_active_slave.
  *    (It is unnecessary when the write-lock is put with bond->lock.)
- * 3) When we lock with bond->ptrlock, we must lock with bond->lock
+ * 3) When we lock with bond->curr_slave_lock, we must lock with bond->lock
  *    beforehand.
  */
-typedef struct bonding {
-	slave_t *next;
-	slave_t *prev;
-	slave_t *current_slave;
-	slave_t *primary_slave;
-	slave_t *current_arp_slave;
-	__s32 slave_cnt;
+struct bonding {
+	struct   net_device *dev; /* first - usefull for panic debug */
+	struct   slave *first_slave;
+	struct   slave *curr_active_slave;
+	struct   slave *current_arp_slave;
+	struct   slave *primary_slave;
+	s32      slave_cnt; /* never change this value outside the attach/detach wrappers */
 	rwlock_t lock;
-	rwlock_t ptrlock;
-	struct timer_list mii_timer;
-	struct timer_list arp_timer;
-	struct net_device_stats stats;
+	rwlock_t curr_slave_lock;
+	struct   timer_list mii_timer;
+	struct   timer_list arp_timer;
+	s8       kill_timers;
+	struct   net_device_stats stats;
 #ifdef CONFIG_PROC_FS
-	struct proc_dir_entry *bond_proc_file;
-	char procdir_name[IFNAMSIZ];
+	struct   proc_dir_entry *proc_entry;
+	char     proc_file_name[IFNAMSIZ];
 #endif /* CONFIG_PROC_FS */
-	struct list_head bond_list;
-	struct net_device *device;
-	struct dev_mc_list *mc_list;
-	unsigned short flags;
-	struct ad_bond_info ad_info;
-	struct alb_bond_info alb_info;
-} bonding_t;
-
-/* Forward declarations */
-void bond_set_slave_active_flags(slave_t *slave);
-void bond_set_slave_inactive_flags(slave_t *slave);
-
-/**
- * These functions can be used for iterating the slave list
- * (which is circular)
- * Caller must hold bond lock for read
- */
-extern inline struct slave*
-bond_get_first_slave(struct bonding *bond)
-{
-	/* if there are no slaves return NULL */
-	if (bond->next == (slave_t *)bond) {
-		return NULL;
-	}
-	return bond->next;
-}
-
-/**
- * Caller must hold bond lock for read
- */
-extern inline struct slave*
-bond_get_next_slave(struct bonding *bond, struct slave *slave)
-{
-	/* If we have reached the last slave return NULL */
-	if (slave->next == bond->next) {
-		return NULL;
-	}
-	return slave->next;
-}
+	struct   list_head bond_list;
+	struct   dev_mc_list *mc_list;
+	u16      flags;
+	struct   ad_bond_info ad_info;
+	struct   alb_bond_info alb_info;
+	struct   bond_params params;
+};
 
 /**
  * Returns NULL if the net_device does not belong to any of the bond's slaves
  *
  * Caller must hold bond lock for read
  */
-extern inline struct slave*
-bond_get_slave_by_dev(struct bonding *bond, struct net_device *slave_dev)
+extern inline struct slave *bond_get_slave_by_dev(struct bonding *bond, struct net_device *slave_dev)
 {
-	struct slave *our_slave = bond->next;
-
-	/* check if the list of slaves is empty */
-	if (our_slave == (slave_t *)bond) {
-		return NULL;
-	}
+	struct slave *slave = NULL;
+	int i;
 
-	for (; our_slave; our_slave = bond_get_next_slave(bond, our_slave)) {
-		if (our_slave->dev == slave_dev) {
+	bond_for_each_slave(bond, slave, i) {
+		if (slave->dev == slave_dev) {
 			break;
 		}
 	}
-	return our_slave;
+
+	return slave;
 }
 
-extern inline struct bonding*
-bond_get_bond_by_slave(struct slave *slave)
+extern inline struct bonding *bond_get_bond_by_slave(struct slave *slave)
 {
 	if (!slave || !slave->dev->master) {
 		return NULL;
 	}
 
-	return (struct bonding *)(slave->dev->master->priv);
+	return (struct bonding *)slave->dev->master->priv;
+}
+
+extern inline void bond_set_slave_inactive_flags(struct slave *slave)
+{
+	slave->state = BOND_STATE_BACKUP;
+	slave->dev->flags |= IFF_NOARP;
+}
+
+extern inline void bond_set_slave_active_flags(struct slave *slave)
+{
+	slave->state = BOND_STATE_ACTIVE;
+	slave->dev->flags &= ~IFF_NOARP;
 }
 
 #endif /* _LINUX_BONDING_H */
--- diff/drivers/net/bsd_comp.c	2003-05-21 11:50:15.000000000 +0100
+++ source/drivers/net/bsd_comp.c	2004-02-09 10:39:53.000000000 +0000
@@ -1176,3 +1176,4 @@
 module_init(bsdcomp_init);
 module_exit(bsdcomp_cleanup);
 MODULE_LICENSE("Dual BSD/GPL");
+MODULE_ALIAS("ppp-compress-" __stringify(CI_BSD_COMPRESS));
--- diff/drivers/net/cs89x0.c	2004-01-19 10:22:57.000000000 +0000
+++ source/drivers/net/cs89x0.c	2004-02-09 10:39:53.000000000 +0000
@@ -212,9 +212,7 @@
 
 /* Index to functions, as function prototypes. */
 
-extern int cs89x0_probe(struct net_device *dev);
-
-static int cs89x0_probe1(struct net_device *dev, int ioaddr);
+static int cs89x0_probe1(struct net_device *dev, int ioaddr, int modular);
 static int net_open(struct net_device *dev);
 static int net_send_packet(struct sk_buff *skb, struct net_device *dev);
 static irqreturn_t net_interrupt(int irq, void *dev_id, struct pt_regs *regs);
@@ -274,27 +272,51 @@
    Return 0 on success.
    */
 
-int __init cs89x0_probe(struct net_device *dev)
+struct net_device * __init cs89x0_probe(int unit)
 {
-	int i;
-	int base_addr = dev ? dev->base_addr : 0;
-
-	SET_MODULE_OWNER(dev);
+	struct net_device *dev = alloc_etherdev(sizeof(struct net_local));
+	unsigned *port;
+	int err = 0;
+	int irq;
+	int io;
+
+	if (!dev)
+		return ERR_PTR(-ENODEV);
+
+	sprintf(dev->name, "eth%d", unit);
+	netdev_boot_setup_check(dev);
+	io = dev->base_addr;
+	irq = dev->irq;
 
 	if (net_debug)
-		printk("cs89x0:cs89x0_probe(0x%x)\n", base_addr);
+		printk("cs89x0:cs89x0_probe(0x%x)\n", io);
 
-	if (base_addr > 0x1ff)		/* Check a single specified location. */
-		return cs89x0_probe1(dev, base_addr);
-	else if (base_addr != 0)	/* Don't probe at all. */
-		return -ENXIO;
-
-	for (i = 0; netcard_portlist[i]; i++) {
-		if (cs89x0_probe1(dev, netcard_portlist[i]) == 0)
-			return 0;
+	if (io > 0x1ff)	{	/* Check a single specified location. */
+		err = cs89x0_probe1(dev, io, 0);
+	} else if (io != 0) {	/* Don't probe at all. */
+		err = -ENXIO;
+	} else {
+		for (port = netcard_portlist; *port; port++) {
+			if (cs89x0_probe1(dev, *port, 0) == 0)
+				break;
+			dev->irq = irq;
+		}
+		if (!*port)
+			err = -ENODEV;
 	}
+	if (err)
+		goto out;
+	err = register_netdev(dev);
+	if (err)
+		goto out1;
+	return dev;
+out1:
+	outw(PP_ChipID, dev->base_addr + ADD_PORT);
+	release_region(dev->base_addr, NETCARD_IO_EXTENT);
+out:
+	free_netdev(dev);
 	printk(KERN_WARNING "cs89x0: no cs8900 or cs8920 detected.  Be sure to disable PnP with SETUP\n");
-	return -ENODEV;
+	return ERR_PTR(err);
 }
 
 static int
@@ -375,39 +397,34 @@
  */
 
 static int __init
-cs89x0_probe1(struct net_device *dev, int ioaddr)
+cs89x0_probe1(struct net_device *dev, int ioaddr, int modular)
 {
-	struct net_local *lp;
+	struct net_local *lp = (struct net_local *)dev->priv;
 	static unsigned version_printed;
 	int i;
 	unsigned rev_type = 0;
 	int eeprom_buff[CHKSUM_LEN];
 	int retval;
 
+	SET_MODULE_OWNER(dev);
 	/* Initialize the device structure. */
-	if (dev->priv == NULL) {
-		dev->priv = kmalloc(sizeof(struct net_local), GFP_KERNEL);
-		if (dev->priv == 0) {
-			retval = -ENOMEM;
-			goto out;
-		}
-		lp = (struct net_local *)dev->priv;
+	if (!modular) {
 		memset(lp, 0, sizeof(*lp));
 		spin_lock_init(&lp->lock);
-#if !defined(MODULE) && (ALLOW_DMA != 0)
+#ifndef MODULE
+#if ALLOW_DMA
 		if (g_cs89x0_dma) {
 			lp->use_dma = 1;
 			lp->dma = g_cs89x0_dma;
 			lp->dmasize = 16;	/* Could make this an option... */
 		}
 #endif
-#ifndef MODULE
 		lp->force = g_cs89x0_media__force;
 #endif
         }
-	lp = (struct net_local *)dev->priv;
 
 	/* Grab the region so we can find another board if autoIRQ fails. */
+	/* WTF is going on here? */
 	if (!request_region(ioaddr & ~3, NETCARD_IO_EXTENT, dev->name)) {
 		printk(KERN_ERR "%s: request_region(0x%x, 0x%x) failed\n",
 				dev->name, ioaddr, NETCARD_IO_EXTENT);
@@ -696,9 +713,6 @@
 	dev->set_multicast_list = set_multicast_list;
 	dev->set_mac_address 	= set_mac_address;
 
-	/* Fill in the fields of the device structure with ethernet values. */
-	ether_setup(dev);
-
 	printk("\n");
 	if (net_debug)
 		printk("cs89x0_probe1() successful\n");
@@ -706,9 +720,6 @@
 out2:
 	release_region(ioaddr & ~3, NETCARD_IO_EXTENT);
 out1:
-	kfree(dev->priv);
-	dev->priv = 0;
-out:
 	return retval;
 }
 
@@ -1655,7 +1666,7 @@
 
 #ifdef MODULE
 
-static struct net_device dev_cs89x0;
+static struct net_device *dev_cs89x0;
 
 /*
  * Support the 'debug' module parm even if we're compiled for non-debug to 
@@ -1733,6 +1744,7 @@
 int
 init_module(void)
 {
+	struct net_device *dev = alloc_etherdev(sizeof(struct net_local));
 	struct net_local *lp;
 	int ret = 0;
 
@@ -1741,18 +1753,12 @@
 #else
 	debug = 0;
 #endif
-
-	dev_cs89x0.irq = irq;
-	dev_cs89x0.base_addr = io;
-
-        dev_cs89x0.init = cs89x0_probe;
-        dev_cs89x0.priv = kmalloc(sizeof(struct net_local), GFP_KERNEL);
-	if (dev_cs89x0.priv == 0) {
-		printk(KERN_ERR "cs89x0.c: Out of memory.\n");
+	if (!dev)
 		return -ENOMEM;
-	}
-	memset(dev_cs89x0.priv, 0, sizeof(struct net_local));
-	lp = (struct net_local *)dev_cs89x0.priv;
+
+	dev->irq = irq;
+	dev->base_addr = io;
+	lp = dev->priv;
 
 #if ALLOW_DMA
 	if (use_dma) {
@@ -1782,7 +1788,10 @@
                 printk(KERN_ERR "cs89x0.c: Append io=0xNNN\n");
                 ret = -EPERM;
 		goto out;
-        }
+        } else if (io <= 0x1ff) {
+		ret = -ENXIO;
+		goto out;
+	}
 
 #if ALLOW_DMA
 	if (use_dma && dmasize != 16 && dmasize != 64) {
@@ -1791,30 +1800,31 @@
 		goto out;
 	}
 #endif
+	ret = cs89x0_probe1(dev, io, 1);
+	if (ret)
+		goto out;
 
-        if (register_netdev(&dev_cs89x0) != 0) {
+        if (register_netdev(dev) != 0) {
                 printk(KERN_ERR "cs89x0.c: No card found at 0x%x\n", io);
                 ret = -ENXIO;
+		outw(PP_ChipID, dev->base_addr + ADD_PORT);
+		release_region(dev->base_addr, NETCARD_IO_EXTENT);
 		goto out;
         }
+	dev_cs89x0 = dev;
+	return 0;
 out:
-	if (ret)
-		kfree(dev_cs89x0.priv);
+	free_netdev(dev);
 	return ret;
 }
 
 void
 cleanup_module(void)
 {
-        if (dev_cs89x0.priv != NULL) {
-                /* Free up the private structure, or leak memory :-)  */
-                unregister_netdev(&dev_cs89x0);
-		outw(PP_ChipID, dev_cs89x0.base_addr + ADD_PORT);
-                kfree(dev_cs89x0.priv);
-                dev_cs89x0.priv = NULL;	/* gets re-allocated by cs89x0_probe1 */
-                /* If we don't do this, we can't re-insmod it later. */
-                release_region(dev_cs89x0.base_addr, NETCARD_IO_EXTENT);
-        }
+	unregister_netdev(dev_cs89x0);
+	outw(PP_ChipID, dev_cs89x0->base_addr + ADD_PORT);
+	release_region(dev_cs89x0->base_addr, NETCARD_IO_EXTENT);
+	free_netdev(dev_cs89x0);
 }
 #endif /* MODULE */
 
--- diff/drivers/net/de600.c	2003-05-21 11:50:15.000000000 +0100
+++ source/drivers/net/de600.c	2004-02-09 10:39:53.000000000 +0000
@@ -99,7 +99,7 @@
 static volatile int		tx_fifo_out;
 static volatile int		free_tx_pages = TX_PAGES;
 static int			was_down;
-static spinlock_t		de600_lock;
+static spinlock_t		de600_lock = SPIN_LOCK_UNLOCKED;
 
 static inline u8 de600_read_status(struct net_device *dev)
 {
@@ -398,20 +398,31 @@
 	 */
 }
 
-int __init de600_probe(struct net_device *dev)
+static struct net_device * __init de600_probe(void)
 {
 	int	i;
-	static struct net_device_stats de600_netstats;
-	/*dev->priv = kmalloc(sizeof(struct net_device_stats), GFP_KERNEL);*/
+	struct net_device *dev;
+	int err;
+
+	dev = alloc_etherdev(sizeof(struct net_device_stats));
+	if (!dev)
+		return ERR_PTR(-ENOMEM);
 
 	SET_MODULE_OWNER(dev);
 
+	if (!request_region(DE600_IO, 3, "de600")) {
+		printk(KERN_WARNING "DE600: port 0x%x busy\n", DE600_IO);
+		err = -EBUSY;
+		goto out;
+	}
+
 	printk(KERN_INFO "%s: D-Link DE-600 pocket adapter", dev->name);
 	/* Alpha testers must have the version number to report bugs. */
 	if (de600_debug > 1)
 		printk(version);
 
 	/* probe for adapter */
+	err = -ENODEV;
 	rx_page = 0;
 	select_nic();
 	(void)de600_read_status(dev);
@@ -419,7 +430,7 @@
 	de600_put_command(STOP_RESET);
 	if (de600_read_status(dev) & 0xf0) {
 		printk(": not at I/O %#3x.\n", DATA_PORT);
-		return -ENODEV;
+		goto out1;
 	}
 
 	/*
@@ -444,12 +455,7 @@
 		dev->dev_addr[3] |= 0x70;
 	} else {
 		printk(" not identified in the printer port\n");
-		return -ENODEV;
-	}
-
-	if (!request_region(DE600_IO, 3, "de600")) {
-		printk(KERN_WARNING "DE600: port 0x%x busy\n", DE600_IO);
-		return -EBUSY;
+		goto out1;
 	}
 
 	printk(", Ethernet Address: %02X", dev->dev_addr[0]);
@@ -457,22 +463,27 @@
 		printk(":%02X",dev->dev_addr[i]);
 	printk("\n");
 
-	/* Initialize the device structure. */
-	dev->priv = &de600_netstats;
-
-	memset(dev->priv, 0, sizeof(struct net_device_stats));
 	dev->get_stats = get_stats;
 
 	dev->open = de600_open;
 	dev->stop = de600_close;
 	dev->hard_start_xmit = &de600_start_xmit;
 
-	ether_setup(dev);
-
 	dev->flags&=~IFF_MULTICAST;
 
 	select_prn();
-	return 0;
+
+	err = register_netdev(dev);
+	if (err)
+		goto out1;
+
+	return dev;
+
+out1:
+	release_region(DE600_IO, 3);
+out:
+	free_netdev(dev);
+	return ERR_PTR(err);
 }
 
 static int adapter_init(struct net_device *dev)
@@ -527,21 +538,21 @@
 	return 0; /* OK */
 }
 
-static struct net_device de600_dev;
+static struct net_device *de600_dev;
 
 static int __init de600_init(void)
 {
-	spin_lock_init(&de600_lock);
-	de600_dev.init = de600_probe;
-	if (register_netdev(&de600_dev) != 0)
-		return -EIO;
+	de600_dev = de600_probe();
+	if (IS_ERR(de600_dev))
+		return PTR_ERR(de600_dev);
 	return 0;
 }
 
 static void __exit de600_exit(void)
 {
-	unregister_netdev(&de600_dev);
+	unregister_netdev(de600_dev);
 	release_region(DE600_IO, 3);
+	free_netdev(de600_dev);
 }
 
 module_init(de600_init);
--- diff/drivers/net/de600.h	2003-05-21 11:50:15.000000000 +0100
+++ source/drivers/net/de600.h	2004-02-09 10:39:53.000000000 +0000
@@ -131,7 +131,6 @@
 
 /* Initialization */
 static void	trigger_interrupt(struct net_device *dev);
-int		de600_probe(struct net_device *dev);
 static int	adapter_init(struct net_device *dev);
 
 /*
--- diff/drivers/net/de620.c	2003-05-21 11:50:15.000000000 +0100
+++ source/drivers/net/de620.c	2004-02-09 10:39:53.000000000 +0000
@@ -226,7 +226,6 @@
 
 /* Initialization */
 static int	adapter_init(struct net_device *);
-int		de620_probe(struct net_device *);
 static int	read_eeprom(struct net_device *);
 
 
@@ -814,11 +813,16 @@
  *
  * Check if there is a DE-620 connected
  */
-int __init de620_probe(struct net_device *dev)
+struct net_device * __init de620_probe(int unit)
 {
-	static struct net_device_stats de620_netstats;
-	int i;
 	byte checkbyte = 0xa5;
+	struct net_device *dev;
+	int err = -ENOMEM;
+	int i;
+
+	dev = alloc_etherdev(sizeof(struct net_device_stats));
+	if (!dev)
+		goto out;
 
 	SET_MODULE_OWNER(dev);
 
@@ -831,11 +835,23 @@
 	dev->base_addr = io;
 	dev->irq       = irq;
 
+	/* allow overriding parameters on command line */
+	if (unit >= 0) {
+		sprintf(dev->name, "eth%d", unit);
+		netdev_boot_setup_check(dev);
+	}
+	
 	if (de620_debug)
 		printk(version);
 
 	printk(KERN_INFO "D-Link DE-620 pocket adapter");
 
+	if (!request_region(dev->base_addr, 3, "de620")) {
+		printk(" io 0x%3lX, which is busy.\n", dev->base_addr);
+		err = -EBUSY;
+		goto out1;
+	}
+
 	/* Initially, configure basic nibble mode, so we can read the EEPROM */
 	NIC_Cmd = DEF_NIC_CMD;
 	de620_set_register(dev, W_EIP, EIPRegister);
@@ -846,12 +862,8 @@
 
 	if ((checkbyte != 0xa5) || (read_eeprom(dev) != 0)) {
 		printk(" not identified in the printer port\n");
-		return -ENODEV;
-	}
-
-	if (!request_region(dev->base_addr, 3, "de620")) {
-		printk(KERN_ERR "io 0x%3lX, which is busy.\n", dev->base_addr);
-		return -EBUSY;
+		err = -ENODEV;
+		goto out2;
 	}
 
 	/* else, got it! */
@@ -870,10 +882,6 @@
 	else
 		printk(" UTP)\n");
 
-	/* Initialize the device structure. */
-	dev->priv = &de620_netstats;
-
-	memset(dev->priv, 0, sizeof(struct net_device_stats));
 	dev->get_stats 		= get_stats;
 	dev->open 		= de620_open;
 	dev->stop 		= de620_close;
@@ -884,8 +892,6 @@
 	
 	/* base_addr and irq are already set, see above! */
 
-	ether_setup(dev);
-
 	/* dump eeprom */
 	if (de620_debug) {
 		printk("\nEEPROM contents:\n");
@@ -899,7 +905,17 @@
 		printk("SCR = 0x%02x\n", nic_data.SCR);
 	}
 
-	return 0;
+	err = register_netdev(dev);
+	if (err)
+		goto out2;
+	return dev;
+
+out2:
+	release_region(dev->base_addr, 3);
+out1:
+	free_netdev(dev);
+out:
+	return ERR_PTR(err);
 }
 
 /**********************************
@@ -994,20 +1010,21 @@
  *
  */
 #ifdef MODULE
-static struct net_device de620_dev;
+static struct net_device *de620_dev;
 
 int init_module(void)
 {
-	de620_dev.init = de620_probe;
-	if (register_netdev(&de620_dev) != 0)
-		return -EIO;
+	de620_dev = de620_probe(-1);
+	if (IS_ERR(de620_dev))
+		return PTR_ERR(de620_dev);
 	return 0;
 }
 
 void cleanup_module(void)
 {
-	unregister_netdev(&de620_dev);
-	release_region(de620_dev.base_addr, 3);
+	unregister_netdev(de620_dev);
+	release_region(de620_dev->base_addr, 3);
+	free_netdev(de620_dev);
 }
 #endif /* MODULE */
 MODULE_LICENSE("GPL");
--- diff/drivers/net/declance.c	2003-08-26 10:00:53.000000000 +0100
+++ source/drivers/net/declance.c	2004-02-09 10:39:53.000000000 +0000
@@ -1039,13 +1039,13 @@
 	if (dec_lance_debug && version_printed++ == 0)
 		printk(version);
 
-	dev = init_etherdev(NULL, sizeof(struct lance_private));
+	dev = alloc_etherdev(sizeof(struct lance_private));
 	if (!dev)
 		return -ENOMEM;
 	SET_MODULE_OWNER(dev);
 
 	/*
-	 * init_etherdev ensures the data structures used by the LANCE
+	 * alloc_etherdev ensures the data structures used by the LANCE
 	 * are aligned.
 	 */
 	lp = (struct lance_private *) dev->priv;
@@ -1188,9 +1188,6 @@
 		}
 	}
 
-	lp->next = root_lance_dev;
-	root_lance_dev = dev;
-
 	/* Copy the ethernet address to the device structure, later to the
 	 * lance initialization block so the lance gets it every time it's
 	 * (re)initialized.
@@ -1239,11 +1236,14 @@
 	init_timer(&lp->multicast_timer);
 	lp->multicast_timer.data = (unsigned long) dev;
 	lp->multicast_timer.function = &lance_set_multicast_retry;
-
+	ret = register_netdev(dev);
+	if (ret)
+		goto err_out;
+	lp->next = root_lance_dev;
+	root_lance_dev = dev;
 	return 0;
 
 err_out:
-	unregister_netdev(dev);
 	free_netdev(dev);
 	return ret;
 }
@@ -1288,13 +1288,12 @@
 	while (root_lance_dev) {
 		struct net_device *dev = root_lance_dev;
 		struct lance_private *lp = (struct lance_private *)dev->priv;
-
+		unregister_netdev(dev);
 #ifdef CONFIG_TC
 		if (lp->slot >= 0)
 			release_tc_card(lp->slot);
 #endif
 		root_lance_dev = lp->next;
-		unregister_netdev(dev);
 		free_netdev(dev);
 	}
 }
--- diff/drivers/net/defxx.c	2003-10-27 09:20:38.000000000 +0000
+++ source/drivers/net/defxx.c	2004-02-09 10:39:53.000000000 +0000
@@ -491,7 +491,7 @@
 err_out_region:
 	release_region(ioaddr, pdev ? PFI_K_CSR_IO_LEN : PI_ESIC_K_CSR_IO_LEN);
 err_out:
-	kfree(dev);
+	free_netdev(dev);
 	return err;
 }
 
--- diff/drivers/net/depca.c	2003-09-30 15:46:15.000000000 +0100
+++ source/drivers/net/depca.c	2004-02-09 10:39:53.000000000 +0000
@@ -681,8 +681,7 @@
 	lp->sh_mem = ioremap(mem_start, mem_len);
 	if (lp->sh_mem == NULL) {
 		printk(KERN_ERR "depca: cannot remap ISA memory, aborting\n");
-		release_mem_region (mem_start, mem_len);
-		goto out_priv;
+		goto out1;
 	}
 
 	lp->mem_start = mem_start;
@@ -771,7 +770,7 @@
 		status = -ENXIO;
 		if (!irqnum) {
 			printk(" and failed to detect IRQ line.\n");
-			goto out_priv;
+			goto out2;
 		} else {
 			for (dev->irq = 0, i = 0; (depca_irq[i]) && (!dev->irq); i++)
 				if (irqnum == depca_irq[i]) {
@@ -781,7 +780,7 @@
 
 			if (!dev->irq) {
 				printk(" but incorrect IRQ line detected.\n");
-				return -ENXIO;
+				goto out2;
 			}
 		}
 	} else {
@@ -807,11 +806,14 @@
 	device->driver_data = dev;
 	SET_NETDEV_DEV (dev, device);
 	
-	register_netdev (dev);
-	return 0;
-
- out_priv:
-	
+	status = register_netdev(dev);
+	if (status == 0)
+		return 0;
+out2:
+	iounmap(lp->sh_mem);
+out1:
+	release_mem_region (mem_start, mem_len);
+out_priv:
 	return status;
 }
 
--- diff/drivers/net/dgrs.c	2003-09-30 15:46:15.000000000 +0100
+++ source/drivers/net/dgrs.c	2004-02-09 10:39:53.000000000 +0000
@@ -121,11 +121,22 @@
 #include "dgrs_asstruct.h"
 #include "dgrs_bcomm.h"
 
+#ifdef CONFIG_PCI
 static struct pci_device_id dgrs_pci_tbl[] = {
 	{ SE6_PCI_VENDOR_ID, SE6_PCI_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID, },
 	{ }			/* Terminating entry */
 };
 MODULE_DEVICE_TABLE(pci, dgrs_pci_tbl);
+#endif
+
+#ifdef CONFIG_EISA
+static struct eisa_device_id dgrs_eisa_tbl[] = {
+	{ "DBI0A01" },
+	{ }
+};
+MODULE_DEVICE_TABLE(eisa, dgrs_eisa_tbl);
+#endif
+
 MODULE_LICENSE("GPL");
 
 
@@ -179,11 +190,6 @@
 static int	dgrs_nicmode;
 
 /*
- *	Chain of device structures
- */
-static struct net_device *dgrs_root_dev;
-
-/*
  *	Private per-board data structure (dev->priv)
  */
 typedef struct
@@ -191,7 +197,6 @@
 	/*
 	 *	Stuff for generic ethercard I/F
 	 */
-	struct net_device		*next_dev;
 	struct net_device_stats	stats;
 
 	/*
@@ -1187,7 +1192,7 @@
 	priv->intrcnt = 0;
 	for (i = jiffies + 2*HZ + HZ/2; time_after(i, jiffies); )
 	{
-		barrier();		/* gcc 2.95 needs this */
+		cpu_relax();
 		if (priv->intrcnt >= 2)
 			break;
 	}
@@ -1200,16 +1205,6 @@
 	}
 
 	/*
-	 *	Register the /proc/ioports information...
-	 */
-	if (!request_region(dev->base_addr, 256, "RightSwitch")) {
-		printk(KERN_ERR "%s: io 0x%3lX, which is busy.\n", dev->name,
-				dev->base_addr);
-		rc = -EBUSY;
-		goto err_free_irq;
-	}
-	
-	/*
 	 *	Entry points...
 	 */
 	dev->open = &dgrs_open;
@@ -1242,22 +1237,23 @@
 	return (0);
 }
 
-static int __init 
+static struct net_device * __init 
 dgrs_found_device(
 	int		io,
 	ulong		mem,
 	int		irq,
 	ulong		plxreg,
-	ulong		plxdma
+	ulong		plxdma,
+	struct device   *pdev
 )
 {
-	DGRS_PRIV	*priv;
-	struct net_device *dev, *aux;
-	int i, ret;
+	DGRS_PRIV *priv;
+	struct net_device *dev;
+	int i, ret = -ENOMEM;
 
 	dev = alloc_etherdev(sizeof(DGRS_PRIV));
 	if (!dev)
-		return -ENOMEM;
+		goto err0;
 
 	priv = (DGRS_PRIV *)dev->priv;
 
@@ -1272,19 +1268,19 @@
 	priv->chan = 1;
 	priv->devtbl[0] = dev;
 
-	dev->init = dgrs_probe1;
 	SET_MODULE_OWNER(dev);
-
-	if (register_netdev(dev) != 0) {
-		free_netdev(dev);
-		return -EIO;
-	}
-
-	priv->next_dev = dgrs_root_dev;
-	dgrs_root_dev = dev;
+	SET_NETDEV_DEV(dev, pdev);
+	
+	ret = dgrs_probe1(dev);
+	if (ret) 
+		goto err1;
+
+	ret = register_netdev(dev);
+	if (ret)
+		goto err2;
 
 	if ( !dgrs_nicmode )
-		return (0);	/* Switch mode, we are done */
+		return dev;	/* Switch mode, we are done */
 
 	/*
 	 * Operating card as N separate NICs
@@ -1302,8 +1298,7 @@
 		if (!devN) 
 			goto fail;
 
-		/* Make it an exact copy of dev[0]... */
-		*devN = *dev;
+		/* Don't copy the network device structure! */
 
 		/* copy the priv structure of dev[0] */
 		privN = (DGRS_PRIV *)devN->priv;
@@ -1316,123 +1311,212 @@
 		devN->irq = 0;
 			/* ... and base MAC address off address of 1st port */
 		devN->dev_addr[5] += i;
-			/* ... choose a new name */
-		strncpy(devN->name, "eth%d", IFNAMSIZ);
-		devN->init = dgrs_initclone;
+
+		ret = dgrs_initclone(devN);
+		if (ret)
+			goto fail;
+
 		SET_MODULE_OWNER(devN);
+		SET_NETDEV_DEV(dev, pdev);
 
-		ret = -EIO;
-		if (register_netdev(devN)) {
+		ret = register_netdev(devN);
+		if (ret) {
 			free_netdev(devN);
 			goto fail;
 		}
 		privN->chan = i+1;
 		priv->devtbl[i] = devN;
-		privN->next_dev = dgrs_root_dev;
-		dgrs_root_dev = devN;
 	}
-	return 0;
-fail:	aux = priv->next_dev;
-	while (dgrs_root_dev != aux) {
-		struct net_device *d = dgrs_root_dev;
-		
-		dgrs_root_dev = ((DGRS_PRIV *)d->priv)->next_dev;
+	return dev;
+
+ fail:	
+	while (i >= 0) {
+		struct net_device *d = priv->devtbl[i--];
 		unregister_netdev(d);
 		free_netdev(d);
 	}
-	return ret;
+
+ err2:
+	free_irq(dev->irq, dev);
+ err1:
+	free_netdev(dev);
+ err0:
+	return ERR_PTR(ret);
 }
 
-/*
- *	Scan for all boards
- */
-static int is2iv[8] __initdata = { 0, 3, 5, 7, 10, 11, 12, 15 };
+static void __devexit dgrs_remove(struct net_device *dev)
+{
+	DGRS_PRIV *priv = dev->priv;
+	int i;
+
+	unregister_netdev(dev);
+
+	for (i = 1; i < priv->nports; ++i) {
+		struct net_device *d = priv->devtbl[i];
+		if (d) {
+			unregister_netdev(d);
+			free_netdev(d);
+		}
+	}
+
+	proc_reset(priv->devtbl[0], 1);
 
-static int __init  dgrs_scan(void)
+	if (priv->vmem)
+		iounmap(priv->vmem);
+	if (priv->vplxdma)
+		iounmap((uchar *) priv->vplxdma);
+
+	if (dev->irq)
+		free_irq(dev->irq, dev);
+
+	for (i = 1; i < priv->nports; ++i) {
+		if (priv->devtbl[i])
+			unregister_netdev(priv->devtbl[i]);
+	}
+}
+
+#ifdef CONFIG_PCI
+static int __init dgrs_pci_probe(struct pci_dev *pdev,
+				 const struct pci_device_id *ent)
 {
-	int	cards_found = 0;
+	struct net_device *dev;
+	int err;
 	uint	io;
 	uint	mem;
 	uint	irq;
 	uint	plxreg;
 	uint	plxdma;
-	struct pci_dev *pdev = NULL;
 
 	/*
-	 *	First, check for PCI boards
-	 */
-	while ((pdev = pci_find_device(SE6_PCI_VENDOR_ID, SE6_PCI_DEVICE_ID, pdev)) != NULL)
-	{
-		/*
-		 * Get and check the bus-master and latency values.
-		 * Some PCI BIOSes fail to set the master-enable bit,
-		 * and the latency timer must be set to the maximum
-		 * value to avoid data corruption that occurs when the
-		 * timer expires during a transfer.  Yes, it's a bug.
-		 */
-		if (pci_enable_device(pdev))
-			continue;
-		pci_set_master(pdev);
-
-		plxreg = pci_resource_start (pdev, 0);
-		io = pci_resource_start (pdev, 1);
-		mem = pci_resource_start (pdev, 2);
-		pci_read_config_dword(pdev, 0x30, &plxdma);
-		irq = pdev->irq;
-		plxdma &= ~15;
+	 * Get and check the bus-master and latency values.
+	 * Some PCI BIOSes fail to set the master-enable bit,
+	 * and the latency timer must be set to the maximum
+	 * value to avoid data corruption that occurs when the
+	 * timer expires during a transfer.  Yes, it's a bug.
+	 */
+	err = pci_enable_device(pdev);
+	if (err)
+		return err;
+	err = pci_request_regions(pdev, "RightSwitch");
+	if (err)
+		return err;
+
+	pci_set_master(pdev);
+
+	plxreg = pci_resource_start (pdev, 0);
+	io = pci_resource_start (pdev, 1);
+	mem = pci_resource_start (pdev, 2);
+	pci_read_config_dword(pdev, 0x30, &plxdma);
+	irq = pdev->irq;
+	plxdma &= ~15;
+
+	/*
+	 * On some BIOSES, the PLX "expansion rom" (used for DMA)
+	 * address comes up as "0".  This is probably because
+	 * the BIOS doesn't see a valid 55 AA ROM signature at
+	 * the "ROM" start and zeroes the address.  To get
+	 * around this problem the SE-6 is configured to ask
+	 * for 4 MB of space for the dual port memory.  We then
+	 * must set its range back to 2 MB, and use the upper
+	 * half for DMA register access
+	 */
+	OUTL(io + PLX_SPACE0_RANGE, 0xFFE00000L);
+	if (plxdma == 0)
+		plxdma = mem + (2048L * 1024L);
+	pci_write_config_dword(pdev, 0x30, plxdma + 1);
+	pci_read_config_dword(pdev, 0x30, &plxdma);
+	plxdma &= ~15;
+
+	dev = dgrs_found_device(io, mem, irq, plxreg, plxdma, &pdev->dev);
+	if (IS_ERR(dev)) {
+		pci_release_regions(pdev);
+		return PTR_ERR(dev);
+	}
 
-		/*
-		 * On some BIOSES, the PLX "expansion rom" (used for DMA)
-		 * address comes up as "0".  This is probably because
-		 * the BIOS doesn't see a valid 55 AA ROM signature at
-		 * the "ROM" start and zeroes the address.  To get
-		 * around this problem the SE-6 is configured to ask
-		 * for 4 MB of space for the dual port memory.  We then
-		 * must set its range back to 2 MB, and use the upper
-		 * half for DMA register access
-		 */
-		OUTL(io + PLX_SPACE0_RANGE, 0xFFE00000L);
-		if (plxdma == 0)
-			plxdma = mem + (2048L * 1024L);
-		pci_write_config_dword(pdev, 0x30, plxdma + 1);
-		pci_read_config_dword(pdev, 0x30, &plxdma);
-		plxdma &= ~15;
+	pci_set_drvdata(pdev, dev);
+	return 0;
+}
 
-		dgrs_found_device(io, mem, irq, plxreg, plxdma);
+static void __devexit dgrs_pci_remove(struct pci_dev *pdev)
+{
+	struct net_device *dev = pci_get_drvdata(pdev);
 
-		cards_found++;
-	}
+	dgrs_remove(dev);
+	pci_release_regions(pdev);
+	free_netdev(dev);
+}
 
-	/*
-	 *	Second, check for EISA boards
-	 */
-	if (EISA_bus)
-	{
-		for (io = 0x1000; io < 0x9000; io += 0x1000)
-		{
-			if (inb(io+ES4H_MANUFmsb) != 0x10
-				|| inb(io+ES4H_MANUFlsb) != 0x49
-				|| inb(io+ES4H_PRODUCT) != ES4H_PRODUCT_CODE)
-				continue;
+static struct pci_driver dgrs_pci_driver = {
+	.name = "dgrs",
+	.id_table = dgrs_pci_tbl,
+	.probe = dgrs_pci_probe,
+	.remove = __devexit_p(dgrs_pci_remove),
+};
+#endif
+
+
+#ifdef CONFIG_EISA
+static int is2iv[8] __initdata = { 0, 3, 5, 7, 10, 11, 12, 15 };
 
-			if ( ! (inb(io+ES4H_EC) & ES4H_EC_ENABLE) )
-				continue; /* Not EISA configured */
+static int __init dgrs_eisa_probe (struct device *gendev)
+{
+	struct net_device *dev;
+	struct eisa_device *edev = to_eisa_device(gendev);
+	uint	io = edev->base_addr;
+	uint	mem;
+	uint	irq;
+	int 	rc = -ENODEV; /* Not EISA configured */
+
+	if (!request_region(io, 256, "RightSwitch")) {
+		printk(KERN_ERR "%s: io 0x%3lX, which is busy.\n", dev->name,
+				dev->base_addr);
+		return -EBUSY;
+	}
 
-			mem = (inb(io+ES4H_AS_31_24) << 24)
-				+ (inb(io+ES4H_AS_23_16) << 16);
+	if ( ! (inb(io+ES4H_EC) & ES4H_EC_ENABLE) ) 
+		goto err_out;
 
-			irq = is2iv[ inb(io+ES4H_IS) & ES4H_IS_INTMASK ];
+	mem = (inb(io+ES4H_AS_31_24) << 24)
+		+ (inb(io+ES4H_AS_23_16) << 16);
 
-			dgrs_found_device(io, mem, irq, 0L, 0L);
+	irq = is2iv[ inb(io+ES4H_IS) & ES4H_IS_INTMASK ];
 
-			++cards_found;
-		}
+	dev = dgrs_found_device(io, mem, irq, 0L, 0L, gendev);
+	if (IS_ERR(dev)) {
+		rc = PTR_ERR(dev);
+		goto err_out;
 	}
 
-	return cards_found;
+	gendev->driver_data = dev;
+	return 0;
+ err_out:
+	release_region(io, 256);
+	return rc;
+}
+
+static int __devexit dgrs_eisa_remove(struct device *gendev)
+{
+	struct net_device *dev = gendev->driver_data;
+	
+	dgrs_remove(dev);
+
+	release_region(dev->base_addr, 256);
+		
+	free_netdev(dev);
+	return 0;
 }
 
 
+static struct eisa_driver dgrs_eisa_driver = {
+	.id_table = dgrs_eisa_tbl,
+	.driver = {
+		.name = "dgrs",
+		.probe = dgrs_eisa_probe,
+		.remove = __devexit_p(dgrs_eisa_remove),
+	}
+};
+#endif
+
 /*
  *	Variables that can be overriden from module command line
  */
@@ -1459,8 +1543,8 @@
 
 static int __init dgrs_init_module (void)
 {
-	int	cards_found;
 	int	i;
+	int eisacount = 0, pcicount = 0;
 
 	/*
 	 *	Command line variable overrides
@@ -1501,38 +1585,27 @@
 	/*
 	 *	Find and configure all the cards
 	 */
-	dgrs_root_dev = NULL;
-	cards_found = dgrs_scan();
-
-	return cards_found ? 0 : -ENODEV;
+#ifdef CONFIG_EISA
+	eisacount = eisa_driver_register(&dgrs_eisa_driver);
+	if (eisacount < 0)
+		return eisacount;
+#endif
+#ifdef CONFIG_PCI
+	pcicount = pci_register_driver(&dgrs_pci_driver);
+	if (pcicount < 0)
+		return pcicount;
+#endif
+	return (eisacount + pcicount) == 0 ? -ENODEV : 0;
 }
 
 static void __exit dgrs_cleanup_module (void)
 {
-        while (dgrs_root_dev)
-	{
-		struct net_device	*next_dev;
-		DGRS_PRIV	*priv;
-
-		priv = (DGRS_PRIV *) dgrs_root_dev->priv;
-                next_dev = priv->next_dev;
-                unregister_netdev(dgrs_root_dev);
-
-		proc_reset(priv->devtbl[0], 1);
-
-		if (priv->vmem)
-			iounmap(priv->vmem);
-		if (priv->vplxdma)
-			iounmap((uchar *) priv->vplxdma);
-
-		release_region(dgrs_root_dev->base_addr, 256);
-
-		if (dgrs_root_dev->irq)
-			free_irq(dgrs_root_dev->irq, dgrs_root_dev);
-
-                free_netdev(dgrs_root_dev);
-                dgrs_root_dev = next_dev;
-        }
+#ifdef CONFIG_EISA
+	eisa_driver_unregister (&dgrs_eisa_driver);
+#endif
+#ifdef CONFIG_PCI
+	pci_unregister_driver (&dgrs_pci_driver);
+#endif
 }
 
 module_init(dgrs_init_module);
--- diff/drivers/net/dl2k.c	2003-09-17 12:28:07.000000000 +0100
+++ source/drivers/net/dl2k.c	2004-02-09 10:39:53.000000000 +0000
@@ -745,7 +745,7 @@
 static void 
 rio_free_tx (struct net_device *dev, int irq) 
 {
-	struct netdev_private *np = (struct netdev_private *) dev->priv;
+	struct netdev_private *np = dev->priv;
 	int entry = np->old_tx % TX_RING_SIZE;
 	int tx_use = 0;
 	unsigned long flag = 0;
@@ -855,7 +855,7 @@
 static int
 receive_packet (struct net_device *dev)
 {
-	struct netdev_private *np = (struct netdev_private *) dev->priv;
+	struct netdev_private *np = dev->priv;
 	int entry = np->cur_rx % RX_RING_SIZE;
 	int cnt = 30;
 
--- diff/drivers/net/dummy.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/net/dummy.c	2004-02-09 10:39:53.000000000 +0000
@@ -103,7 +103,7 @@
 		return -ENOMEM;
 
 	if ((err = register_netdev(dev_dummy))) {
-		kfree(dev_dummy);
+		free_netdev(dev_dummy);
 		dev_dummy = NULL;
 	} else {
 		dummies[index] = dev_dummy; 
--- diff/drivers/net/e1000/e1000.h	2003-09-30 15:46:15.000000000 +0100
+++ source/drivers/net/e1000/e1000.h	2004-02-09 10:39:53.000000000 +0000
@@ -1,7 +1,7 @@
 /*******************************************************************************
 
   
-  Copyright(c) 1999 - 2003 Intel Corporation. All rights reserved.
+  Copyright(c) 1999 - 2004 Intel Corporation. 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 
@@ -92,6 +92,16 @@
 
 #define E1000_MAX_INTR 10
 
+/* How many descriptors for TX and RX ? */
+#define E1000_DEFAULT_TXD                  256
+#define E1000_MAX_TXD                      256
+#define E1000_MIN_TXD                       80
+#define E1000_MAX_82544_TXD               4096
+#define E1000_DEFAULT_RXD                  256
+#define E1000_MAX_RXD                      256
+#define E1000_MIN_RXD                       80
+#define E1000_MAX_82544_RXD               4096
+
 /* Supported Rx Buffer Sizes */
 #define E1000_RXBUFFER_2048  2048
 #define E1000_RXBUFFER_4096  4096
@@ -192,10 +202,14 @@
 
 	/* TX */
 	struct e1000_desc_ring tx_ring;
+	spinlock_t tx_lock;
 	uint32_t txd_cmd;
 	uint32_t tx_int_delay;
 	uint32_t tx_abs_int_delay;
 	uint32_t gotcl;
+	uint64_t gotcl_old;
+	uint64_t tpt_old;
+	uint64_t colc_old;
 	uint32_t tx_fifo_head;
 	uint32_t tx_head_addr;
 	uint32_t tx_fifo_size;
@@ -210,6 +224,7 @@
 	uint32_t rx_abs_int_delay;
 	boolean_t rx_csum;
 	uint32_t gorcl;
+	uint64_t gorcl_old;
 
 	/* Interrupt Throttle Rate */
 	uint32_t itr;
--- diff/drivers/net/e1000/e1000_ethtool.c	2003-09-30 15:46:15.000000000 +0100
+++ source/drivers/net/e1000/e1000_ethtool.c	2004-02-09 10:39:53.000000000 +0000
@@ -1,7 +1,7 @@
 /*******************************************************************************
 
   
-  Copyright(c) 1999 - 2003 Intel Corporation. All rights reserved.
+  Copyright(c) 1999 - 2004 Intel Corporation. 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 
@@ -39,6 +39,11 @@
 extern void e1000_down(struct e1000_adapter *adapter);
 extern void e1000_reset(struct e1000_adapter *adapter);
 extern int e1000_set_spd_dplx(struct e1000_adapter *adapter, uint16_t spddplx);
+extern int e1000_setup_rx_resources(struct e1000_adapter *adapter);
+extern int e1000_setup_tx_resources(struct e1000_adapter *adapter);
+extern void e1000_free_rx_resources(struct e1000_adapter *adapter);
+extern void e1000_free_tx_resources(struct e1000_adapter *adapter);
+extern void e1000_update_stats(struct e1000_adapter *adapter);
 
 struct e1000_stats {
 	char stat_string[ETH_GSTRING_LEN];
@@ -440,6 +445,71 @@
 	return ret_val;
 }
 
+static int
+e1000_ethtool_gring(struct e1000_adapter *adapter,
+                    struct ethtool_ringparam *ring)
+{
+	e1000_mac_type mac_type = adapter->hw.mac_type;
+	struct e1000_desc_ring *txdr = &adapter->tx_ring;
+	struct e1000_desc_ring *rxdr = &adapter->rx_ring;
+
+	ring->rx_max_pending = (mac_type < e1000_82544) ? E1000_MAX_RXD :
+		E1000_MAX_82544_RXD;
+	ring->tx_max_pending = (mac_type < e1000_82544) ? E1000_MAX_TXD :
+		E1000_MAX_82544_TXD;
+	ring->rx_mini_max_pending = 0;
+	ring->rx_jumbo_max_pending = 0;
+	ring->rx_pending = rxdr->count;
+	ring->tx_pending = txdr->count;
+	ring->rx_mini_pending = 0;
+	ring->rx_jumbo_pending = 0;
+
+	return 0;
+}
+static int 
+e1000_ethtool_sring(struct e1000_adapter *adapter,
+                    struct ethtool_ringparam *ring)
+{
+	int err;
+	e1000_mac_type mac_type = adapter->hw.mac_type;
+	struct e1000_desc_ring *txdr = &adapter->tx_ring;
+	struct e1000_desc_ring *rxdr = &adapter->rx_ring;
+
+	if(netif_running(adapter->netdev)) {
+		e1000_down(adapter);
+		e1000_free_rx_resources(adapter);
+		e1000_free_tx_resources(adapter);
+	}
+
+	rxdr->count = max(ring->rx_pending,(uint32_t)E1000_MIN_RXD);
+	rxdr->count = min(rxdr->count,(uint32_t)(mac_type < e1000_82544 ?
+		E1000_MAX_RXD : E1000_MAX_82544_RXD));
+	E1000_ROUNDUP(rxdr->count, REQ_RX_DESCRIPTOR_MULTIPLE); 
+
+	txdr->count = max(ring->tx_pending,(uint32_t)E1000_MIN_TXD);
+	txdr->count = min(txdr->count,(uint32_t)(mac_type < e1000_82544 ?
+		E1000_MAX_TXD : E1000_MAX_82544_TXD));
+	E1000_ROUNDUP(txdr->count, REQ_TX_DESCRIPTOR_MULTIPLE); 
+
+	if(netif_running(adapter->netdev)) {
+		if((err = e1000_setup_rx_resources(adapter)))
+			goto err_setup_rx;
+		if((err = e1000_setup_tx_resources(adapter)))
+			goto err_setup_tx;
+		if((err = e1000_up(adapter)))
+			goto err_up;
+	}
+
+	return 0;
+err_up:
+	e1000_free_tx_resources(adapter);
+err_setup_tx:
+	e1000_free_rx_resources(adapter);
+err_setup_rx:
+	e1000_reset(adapter);
+	return err;
+}
+
 #define REG_PATTERN_TEST(R, M, W)                                              \
 {                                                                              \
 	uint32_t pat, value;                                                   \
@@ -579,8 +649,8 @@
 	*data = 0;
 
 	/* Hook up test interrupt handler just for this test */
-	if(request_irq
-	   (netdev->irq, &e1000_test_intr, SA_SHIRQ, netdev->name, netdev)) {
+	if(request_irq(adapter->pdev->irq, &e1000_test_intr, SA_SHIRQ,
+	   netdev->name, netdev)) {
 		*data = 1;
 		return -1;
 	}
@@ -664,7 +734,7 @@
 	msec_delay(10);
 
 	/* Unhook test interrupt handler */
-	free_irq(netdev->irq, netdev);
+	free_irq(adapter->pdev->irq, netdev);
 
 	return *data;
 }
@@ -770,9 +840,9 @@
 				       PCI_DMA_TODEVICE);
 		tx_desc->buffer_addr = cpu_to_le64(txdr->buffer_info[i].dma);
 		tx_desc->lower.data = cpu_to_le32(skb->len);
-		tx_desc->lower.data |= E1000_TXD_CMD_EOP;
-		tx_desc->lower.data |= E1000_TXD_CMD_IFCS;
-		tx_desc->lower.data |= E1000_TXD_CMD_RPS;
+		tx_desc->lower.data |= cpu_to_le32(E1000_TXD_CMD_EOP |
+						   E1000_TXD_CMD_IFCS |
+						   E1000_TXD_CMD_RPS);
 		tx_desc->upper.data = 0;
 	}
 
@@ -1502,6 +1572,19 @@
 		addr += offsetof(struct ethtool_eeprom, data);
 		return e1000_ethtool_seeprom(adapter, &eeprom, addr);
 	}
+	case ETHTOOL_GRINGPARAM: {
+		struct ethtool_ringparam ering = {ETHTOOL_GRINGPARAM};
+		e1000_ethtool_gring(adapter, &ering);
+		if(copy_to_user(addr, &ering, sizeof(ering)))
+			return -EFAULT;
+		return 0;
+	}
+	case ETHTOOL_SRINGPARAM: {
+		struct ethtool_ringparam ering;
+		if(copy_from_user(&ering, addr, sizeof(ering)))
+			return -EFAULT;
+		return e1000_ethtool_sring(adapter, &ering);
+	}
 	case ETHTOOL_GPAUSEPARAM: {
 		struct ethtool_pauseparam epause = {ETHTOOL_GPAUSEPARAM};
 		e1000_ethtool_gpause(adapter, &epause);
@@ -1522,6 +1605,7 @@
 		} stats = { {ETHTOOL_GSTATS, E1000_STATS_LEN} };
 		int i;
 
+		e1000_update_stats(adapter);
 		for(i = 0; i < E1000_STATS_LEN; i++)
 			stats.data[i] = (e1000_gstrings_stats[i].sizeof_stat ==
 					sizeof(uint64_t)) ?
--- diff/drivers/net/e1000/e1000_hw.c	2003-09-30 15:46:15.000000000 +0100
+++ source/drivers/net/e1000/e1000_hw.c	2004-02-09 10:39:53.000000000 +0000
@@ -1,7 +1,7 @@
 /*******************************************************************************
 
   
-  Copyright(c) 1999 - 2003 Intel Corporation. All rights reserved.
+  Copyright(c) 1999 - 2004 Intel Corporation. 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 
@@ -96,8 +96,14 @@
         hw->phy_type = e1000_phy_m88;
         break;
     case IGP01E1000_I_PHY_ID:
-        hw->phy_type = e1000_phy_igp;
-        break;
+        if(hw->mac_type == e1000_82541 ||
+           hw->mac_type == e1000_82541_rev_2 ||
+           hw->mac_type == e1000_82547 ||
+           hw->mac_type == e1000_82547_rev_2) {
+            hw->phy_type = e1000_phy_igp;
+            break;
+        }
+        /* Fall Through */
     default:
         /* Should never have loaded on this device */
         hw->phy_type = e1000_phy_undefined;
@@ -148,7 +154,6 @@
 
         e1000_write_phy_reg(hw, 0x0000, 0x3300);
 
-
         if(hw->mac_type == e1000_82547) {
             uint16_t fused, fine, coarse;
 
@@ -1485,8 +1490,8 @@
             if(mii_status_reg & MII_SR_LINK_STATUS) break;
             msec_delay(100);
         }
-        if(i == 0) { /* We didn't get link */
-            /* Reset the DSP and wait again for link. */
+        if((i == 0) && (hw->phy_type == e1000_phy_m88)) {
+            /* We didn't get link.  Reset the DSP and wait again for link. */
             if((ret_val = e1000_phy_reset_dsp(hw))) {
                 DEBUGOUT("Error Resetting PHY DSP\n");
                 return ret_val;
@@ -1533,6 +1538,25 @@
                                           phy_data)))
             return ret_val;
 
+        /* Polarity reversal workaround for forced 10F/10H links. */
+        if(hw->mac_type <= e1000_82544 &&
+           (hw->forced_speed_duplex == e1000_10_full ||
+            hw->forced_speed_duplex == e1000_10_half)) {
+            if((ret_val = e1000_write_phy_reg(hw, M88E1000_PHY_PAGE_SELECT,
+                                              0x0019)))
+                return ret_val;
+            if((ret_val = e1000_write_phy_reg(hw, M88E1000_PHY_GEN_CONTROL,
+                                              0x8F0F)))
+                return ret_val;
+            /* IEEE requirement is 150ms */
+            msec_delay(200);
+            if((ret_val = e1000_write_phy_reg(hw, M88E1000_PHY_PAGE_SELECT,
+                                              0x0019)))
+                return ret_val;
+            if((ret_val = e1000_write_phy_reg(hw, M88E1000_PHY_GEN_CONTROL,
+                                              0x8F00)))
+                return ret_val;
+        }
     }
     return E1000_SUCCESS;
 }
@@ -1916,7 +1940,6 @@
     uint32_t signal = 0;
     int32_t ret_val;
     uint16_t phy_data;
-    uint16_t lp_capability;
 
     DEBUGFUNC("e1000_check_for_link");
 
@@ -1996,24 +2019,17 @@
 
         /* At this point we know that we are on copper and we have
          * auto-negotiated link.  These are conditions for checking the link
-         * parter capability register.  We use the link partner capability to
-         * determine if TBI Compatibility needs to be turned on or off.  If
-         * the link partner advertises any speed in addition to Gigabit, then
-         * we assume that they are GMII-based, and TBI compatibility is not
-         * needed. If no other speeds are advertised, we assume the link
-         * partner is TBI-based, and we turn on TBI Compatibility.
-         */
-        if(hw->tbi_compatibility_en) {
-            if((ret_val = e1000_read_phy_reg(hw, PHY_LP_ABILITY,
-                                             &lp_capability)))
-                return ret_val;
-            if(lp_capability & (NWAY_LPAR_10T_HD_CAPS |
-                                NWAY_LPAR_10T_FD_CAPS |
-                                NWAY_LPAR_100TX_HD_CAPS |
-                                NWAY_LPAR_100TX_FD_CAPS |
-                                NWAY_LPAR_100T4_CAPS)) {
-                /* If our link partner advertises anything in addition to
-                 * gigabit, we do not need to enable TBI compatibility.
+         * partner capability register.  We use the link speed to determine if
+         * TBI compatibility needs to be turned on or off.  If the link is not
+         * at gigabit speed, then TBI compatibility is not needed.  If we are
+         * at gigabit speed, we turn on TBI compatibility.
+         */
+	if(hw->tbi_compatibility_en) {
+            uint16_t speed, duplex;
+            e1000_get_speed_and_duplex(hw, &speed, &duplex);
+            if(speed != SPEED_1000) {
+                /* If link speed is not set to gigabit speed, we do not need
+                 * to enable TBI compatibility.
                  */
                 if(hw->tbi_compatibility_on) {
                     /* If we previously were in the mode, turn it off. */
@@ -2081,6 +2097,29 @@
         DEBUGOUT("RXing /C/, enable AutoNeg and stop forcing link.\r\n");
         E1000_WRITE_REG(hw, TXCW, hw->txcw);
         E1000_WRITE_REG(hw, CTRL, (ctrl & ~E1000_CTRL_SLU));
+
+        hw->serdes_link_down = FALSE;
+    }
+    /* If we force link for non-auto-negotiation switch, check link status
+     * based on MAC synchronization for internal serdes media type.
+     */
+    else if((hw->media_type == e1000_media_type_internal_serdes) &&
+            !(E1000_TXCW_ANE & E1000_READ_REG(hw, TXCW))) {
+        /* SYNCH bit and IV bit are sticky. */
+        udelay(10);
+        if(E1000_RXCW_SYNCH & E1000_READ_REG(hw, RXCW)) {
+            if(!(rxcw & E1000_RXCW_IV)) {
+                hw->serdes_link_down = FALSE;
+                DEBUGOUT("SERDES: Link is up.\n");
+            }
+        } else {
+            hw->serdes_link_down = TRUE;
+            DEBUGOUT("SERDES: Link is down.\n");
+        }
+    }
+    if((hw->media_type == e1000_media_type_internal_serdes) &&
+       (E1000_TXCW_ANE & E1000_READ_REG(hw, TXCW))) {
+        hw->serdes_link_down = !(E1000_STATUS_LU & E1000_READ_REG(hw, STATUS));
     }
     return E1000_SUCCESS;
 }
@@ -2481,8 +2520,8 @@
         E1000_WRITE_REG(hw, MDIC, mdic);
 
         /* Poll the ready bit to see if the MDI read completed */
-        for(i = 0; i < 64; i++) {
-            udelay(50);
+        for(i = 0; i < 640; i++) {
+            udelay(5);
             mdic = E1000_READ_REG(hw, MDIC);
             if(mdic & E1000_MDIC_READY) break;
         }
@@ -3498,10 +3537,12 @@
     if (e1000_acquire_eeprom(hw) != E1000_SUCCESS)
         return -E1000_ERR_EEPROM;
 
-    if(eeprom->type == e1000_eeprom_microwire)
+    if(eeprom->type == e1000_eeprom_microwire) {
         status = e1000_write_eeprom_microwire(hw, offset, words, data);
-    else
+    } else {
         status = e1000_write_eeprom_spi(hw, offset, words, data);
+        msec_delay(10);
+    }
 
     /* Done with writing */
     e1000_release_eeprom(hw);
@@ -3719,12 +3760,9 @@
         hw->perm_mac_addr[i+1] = (uint8_t) (eeprom_data >> 8);
     }
     if(((hw->mac_type == e1000_82546) || (hw->mac_type == e1000_82546_rev_3)) &&
-       (E1000_READ_REG(hw, STATUS) & E1000_STATUS_FUNC_1)) {
-        if(hw->perm_mac_addr[5] & 0x01)
-            hw->perm_mac_addr[5] &= ~(0x01);
-        else
-            hw->perm_mac_addr[5] |= 0x01;
-    }
+       (E1000_READ_REG(hw, STATUS) & E1000_STATUS_FUNC_1))
+            hw->perm_mac_addr[5] ^= 0x01;
+
     for(i = 0; i < NODE_ADDRESS_SIZE; i++)
         hw->mac_addr[i] = hw->perm_mac_addr[i];
     return E1000_SUCCESS;
@@ -3743,22 +3781,13 @@
 e1000_init_rx_addrs(struct e1000_hw *hw)
 {
     uint32_t i;
-    uint32_t addr_low;
-    uint32_t addr_high;
 
     DEBUGFUNC("e1000_init_rx_addrs");
 
     /* Setup the receive address. */
     DEBUGOUT("Programming MAC Address into RAR[0]\n");
-    addr_low = (hw->mac_addr[0] |
-                (hw->mac_addr[1] << 8) |
-                (hw->mac_addr[2] << 16) | (hw->mac_addr[3] << 24));
-
-    addr_high = (hw->mac_addr[4] |
-                 (hw->mac_addr[5] << 8) | E1000_RAH_AV);
 
-    E1000_WRITE_REG_ARRAY(hw, RA, 0, addr_low);
-    E1000_WRITE_REG_ARRAY(hw, RA, 1, addr_high);
+    e1000_rar_set(hw, hw->mac_addr, 0);
 
     /* Zero out the other 15 receive addresses. */
     DEBUGOUT("Clearing RAR[1-15]\n");
@@ -3775,6 +3804,7 @@
  * mc_addr_list - the list of new multicast addresses
  * mc_addr_count - number of addresses
  * pad - number of bytes between addresses in the list
+ * rar_used_count - offset where to start adding mc addresses into the RAR's
  *
  * The given list replaces any existing list. Clears the last 15 receive
  * address registers and the multicast table. Uses receive address registers
@@ -3785,11 +3815,11 @@
 e1000_mc_addr_list_update(struct e1000_hw *hw,
                           uint8_t *mc_addr_list,
                           uint32_t mc_addr_count,
-                          uint32_t pad)
+                          uint32_t pad,
+                          uint32_t rar_used_count)
 {
     uint32_t hash_value;
     uint32_t i;
-    uint32_t rar_used_count = 1; /* RAR[0] is used for our MAC address */
 
     DEBUGFUNC("e1000_mc_addr_list_update");
 
@@ -4523,8 +4553,8 @@
 e1000_read_reg_io(struct e1000_hw *hw,
                   uint32_t offset)
 {
-    uint32_t io_addr = hw->io_base;
-    uint32_t io_data = hw->io_base + 4;
+    unsigned long io_addr = hw->io_base;
+    unsigned long io_data = hw->io_base + 4;
 
     e1000_io_write(hw, io_addr, offset);
     return e1000_io_read(hw, io_data);
@@ -4543,8 +4573,8 @@
                    uint32_t offset,
                    uint32_t value)
 {
-    uint32_t io_addr = hw->io_base;
-    uint32_t io_data = hw->io_base + 4;
+    unsigned long io_addr = hw->io_base;
+    unsigned long io_data = hw->io_base + 4;
 
     e1000_io_write(hw, io_addr, offset);
     e1000_io_write(hw, io_data, value);
--- diff/drivers/net/e1000/e1000_hw.h	2003-09-30 15:46:15.000000000 +0100
+++ source/drivers/net/e1000/e1000_hw.h	2004-02-09 10:39:53.000000000 +0000
@@ -1,7 +1,7 @@
 /*******************************************************************************
 
   
-  Copyright(c) 1999 - 2003 Intel Corporation. All rights reserved.
+  Copyright(c) 1999 - 2004 Intel Corporation. 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 
@@ -291,7 +291,7 @@
 
 /* Filters (multicast, vlan, receive) */
 void e1000_init_rx_addrs(struct e1000_hw *hw);
-void e1000_mc_addr_list_update(struct e1000_hw *hw, uint8_t * mc_addr_list, uint32_t mc_addr_count, uint32_t pad);
+void e1000_mc_addr_list_update(struct e1000_hw *hw, uint8_t * mc_addr_list, uint32_t mc_addr_count, uint32_t pad, uint32_t rar_used_count);
 uint32_t e1000_hash_mc_addr(struct e1000_hw *hw, uint8_t * mc_addr);
 void e1000_mta_set(struct e1000_hw *hw, uint32_t hash_value);
 void e1000_rar_set(struct e1000_hw *hw, uint8_t * mc_addr, uint32_t rar_index);
@@ -317,9 +317,9 @@
 void e1000_read_pci_cfg(struct e1000_hw *hw, uint32_t reg, uint16_t * value);
 void e1000_write_pci_cfg(struct e1000_hw *hw, uint32_t reg, uint16_t * value);
 /* Port I/O is only supported on 82544 and newer */
-uint32_t e1000_io_read(struct e1000_hw *hw, uint32_t port);
+uint32_t e1000_io_read(struct e1000_hw *hw, unsigned long port);
 uint32_t e1000_read_reg_io(struct e1000_hw *hw, uint32_t offset);
-void e1000_io_write(struct e1000_hw *hw, uint32_t port, uint32_t value);
+void e1000_io_write(struct e1000_hw *hw, unsigned long port, uint32_t value);
 void e1000_write_reg_io(struct e1000_hw *hw, uint32_t offset, uint32_t value);
 int32_t e1000_config_dsp_after_link_change(struct e1000_hw *hw, boolean_t link_up);
 int32_t e1000_set_d3_lplu_state(struct e1000_hw *hw, boolean_t active);
@@ -978,7 +978,7 @@
     e1000_ms_type master_slave;
     e1000_ms_type original_master_slave;
     e1000_ffe_config ffe_config_state;
-    uint32_t io_base;
+    unsigned long io_base;
     uint32_t phy_id;
     uint32_t phy_revision;
     uint32_t phy_addr;
@@ -1021,6 +1021,7 @@
     boolean_t speed_downgraded;
     e1000_dsp_config dsp_config_state;
     boolean_t get_link_status;
+    boolean_t serdes_link_down;
     boolean_t tbi_compatibility_en;
     boolean_t tbi_compatibility_on;
     boolean_t phy_reset_disable;
@@ -1310,6 +1311,7 @@
 #define E1000_RCTL_DPF            0x00400000    /* discard pause frames */
 #define E1000_RCTL_PMCF           0x00800000    /* pass MAC control frames */
 #define E1000_RCTL_BSEX           0x02000000    /* Buffer size extension */
+#define E1000_RCTL_SECRC          0x04000000    /* Strip Ethernet CRC */
 
 /* Receive Descriptor */
 #define E1000_RDT_DELAY 0x0000ffff      /* Delay timer (1=1024us) */
--- diff/drivers/net/e1000/e1000_main.c	2003-10-27 09:20:38.000000000 +0000
+++ source/drivers/net/e1000/e1000_main.c	2004-02-09 10:39:53.000000000 +0000
@@ -1,7 +1,7 @@
 /*******************************************************************************
 
   
-  Copyright(c) 1999 - 2003 Intel Corporation. All rights reserved.
+  Copyright(c) 1999 - 2004 Intel Corporation. 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 
@@ -30,10 +30,25 @@
 
 /* Change Log
  *
- * 5.2.20	9/30/03
+ * 5.2.30.1	1/29/03
+ *   o Set VLAN filtering to IEEE 802.1Q after reset so we don't break
+ *     SoL connections that use VLANs.
+ *   o Allow 1000/Full setting for AutoNeg param for Fiber connections
+ *     Jon D Mason [jonmason@us.ibm.com].
+ *   o Race between Tx queue and Tx clean fixed with a spin lock.
+ *   o Added netpoll support.
+ *   o Fixed endianess bug causing ethtool loopback diags to fail on ppc.
+ *   o Use pdev->irq rather than netdev->irq in preparation for MSI support.
+ *   o Report driver message on user override of InterruptThrottleRate
+ *     module parameter.
+ *   o Change I/O address storage from uint32_t to unsigned long.
+ *   o Added ethtool RINGPARAM support.
+ *
+ * 5.2.22	10/15/03
  *   o Bug fix: SERDES devices might be connected to a back-plane
  *     switch that doesn't support auto-neg, so add the capability
- *     to force 1000/Full.
+ *     to force 1000/Full.  Also, since forcing 1000/Full, sample
+ *     RxSynchronize bit to detect link state.
  *   o Bug fix: Flow control settings for hi/lo watermark didn't
  *     consider changes in the Rx FIFO size, which could occur with
  *     Jumbo Frames or with the reduced FIFO in 82547.
@@ -42,30 +57,19 @@
  *   o Bug fix: hang under heavy Tx stress when running out of Tx
  *     descriptors; wasn't clearing context descriptor when backing
  *     out of send because of no-resource condition.
+ *   o Bug fix: check netif_running in dev->poll so we don't have to
+ *     hang in dev->close until all polls are finished.  [Robert
+ *     Ollson (robert.olsson@data.slu.se)].
+ *   o Revert TxDescriptor ring size back to 256 since change to 1024
+ *     wasn't accepted into the kernel.
  *
  * 5.2.16	8/8/03
- *   o Added support for new controllers: 82545GM, 82546GB, 82541/7_B1
- *   o Bug fix: reset h/w before first EEPROM read because we don't know
- *     who may have been messing with the device before we got there.
- *     [Dave Johnson (ddj -a-t- cascv.brown.edu)]
- *   o Bug fix: read the correct work from EEPROM to detect programmed
- *     WoL settings.
- *   o Bug fix: TSO would hang if space left in FIFO was being miscalculated
- *     when mss dropped without a correspoding drop in the DMA buffer size.
- *   o ASF for Fiber nics isn't supported.
- *   o Bug fix: Workaround added for potential hang with 82544 running in
- *     PCI-X if send buffer terminates within an evenly-aligned dword.
- *   o Feature: Add support for ethtool flow control setting.
- *   o Feature: Add support for ethtool TSO setting.
- *   o Feature: Increase default Tx Descriptor count to 1024 for >= 82544.
- *   
- * 5.1.13	5/28/03
  */
 
 char e1000_driver_name[] = "e1000";
 char e1000_driver_string[] = "Intel(R) PRO/1000 Network Driver";
-char e1000_driver_version[] = "5.2.20-k1";
-char e1000_copyright[] = "Copyright (c) 1999-2003 Intel Corporation.";
+char e1000_driver_version[] = "5.2.30.1-k1";
+char e1000_copyright[] = "Copyright (c) 1999-2004 Intel Corporation.";
 
 /* e1000_pci_tbl - PCI Device ID Table
  *
@@ -89,7 +93,6 @@
 	{0x8086, 0x1011, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
 	{0x8086, 0x1012, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
 	{0x8086, 0x1013, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
-	{0x8086, 0x1014, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
 	{0x8086, 0x1015, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
 	{0x8086, 0x1016, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
 	{0x8086, 0x1017, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
@@ -113,12 +116,17 @@
 
 MODULE_DEVICE_TABLE(pci, e1000_pci_tbl);
 
-/* Local Function Prototypes */
-
 int e1000_up(struct e1000_adapter *adapter);
 void e1000_down(struct e1000_adapter *adapter);
 void e1000_reset(struct e1000_adapter *adapter);
 int e1000_set_spd_dplx(struct e1000_adapter *adapter, uint16_t spddplx);
+int e1000_setup_tx_resources(struct e1000_adapter *adapter);
+int e1000_setup_rx_resources(struct e1000_adapter *adapter);
+void e1000_free_tx_resources(struct e1000_adapter *adapter);
+void e1000_free_rx_resources(struct e1000_adapter *adapter);
+void e1000_update_stats(struct e1000_adapter *adapter);
+
+/* Local Function Prototypes */
 
 static int e1000_init_module(void);
 static void e1000_exit_module(void);
@@ -127,15 +135,11 @@
 static int e1000_sw_init(struct e1000_adapter *adapter);
 static int e1000_open(struct net_device *netdev);
 static int e1000_close(struct net_device *netdev);
-static int e1000_setup_tx_resources(struct e1000_adapter *adapter);
-static int e1000_setup_rx_resources(struct e1000_adapter *adapter);
 static void e1000_configure_tx(struct e1000_adapter *adapter);
 static void e1000_configure_rx(struct e1000_adapter *adapter);
 static void e1000_setup_rctl(struct e1000_adapter *adapter);
 static void e1000_clean_tx_ring(struct e1000_adapter *adapter);
 static void e1000_clean_rx_ring(struct e1000_adapter *adapter);
-static void e1000_free_tx_resources(struct e1000_adapter *adapter);
-static void e1000_free_rx_resources(struct e1000_adapter *adapter);
 static void e1000_set_multi(struct net_device *netdev);
 static void e1000_update_phy_info(unsigned long data);
 static void e1000_watchdog(unsigned long data);
@@ -144,7 +148,6 @@
 static struct net_device_stats * e1000_get_stats(struct net_device *netdev);
 static int e1000_change_mtu(struct net_device *netdev, int new_mtu);
 static int e1000_set_mac(struct net_device *netdev, void *p);
-static void e1000_update_stats(struct e1000_adapter *adapter);
 static inline void e1000_irq_disable(struct e1000_adapter *adapter);
 static inline void e1000_irq_enable(struct e1000_adapter *adapter);
 static irqreturn_t e1000_intr(int irq, void *data, struct pt_regs *regs);
@@ -182,6 +185,11 @@
 static int e1000_resume(struct pci_dev *pdev);
 #endif
 
+#ifdef CONFIG_NET_POLL_CONTROLLER
+/* for netdump / net console */
+static void e1000_netpoll (struct net_device *dev);
+#endif
+
 struct notifier_block e1000_notifier_reboot = {
 	.notifier_call	= e1000_notify_reboot,
 	.next		= NULL,
@@ -268,7 +276,7 @@
 	e1000_configure_rx(adapter);
 	e1000_alloc_rx_buffers(adapter);
 
-	if((err = request_irq(netdev->irq, &e1000_intr,
+	if((err = request_irq(adapter->pdev->irq, &e1000_intr,
 		              SA_SHIRQ | SA_SAMPLE_RANDOM,
 		              netdev->name, netdev)))
 		return err;
@@ -285,7 +293,7 @@
 	struct net_device *netdev = adapter->netdev;
 
 	e1000_irq_disable(adapter);
-	free_irq(netdev->irq, netdev);
+	free_irq(adapter->pdev->irq, netdev);
 	del_timer_sync(&adapter->tx_fifo_stall_timer);
 	del_timer_sync(&adapter->watchdog_timer);
 	del_timer_sync(&adapter->phy_info_timer);
@@ -336,6 +344,10 @@
 	if(adapter->hw.mac_type >= e1000_82544)
 		E1000_WRITE_REG(&adapter->hw, WUC, 0);
 	e1000_init_hw(&adapter->hw);
+
+	/* Enable h/w to recognize an 802.1Q VLAN Ethernet packet */
+	E1000_WRITE_REG(&adapter->hw, VET, ETHERNET_IEEE_VLAN_TYPE);
+
 	e1000_reset_adaptive(&adapter->hw);
 	e1000_phy_get_info(&adapter->hw, &adapter->phy_info);
 }
@@ -434,8 +446,10 @@
 	netdev->vlan_rx_register = e1000_vlan_rx_register;
 	netdev->vlan_rx_add_vid = e1000_vlan_rx_add_vid;
 	netdev->vlan_rx_kill_vid = e1000_vlan_rx_kill_vid;
+#ifdef CONFIG_NET_POLL_CONTROLLER
+	netdev->poll_controller = e1000_netpoll;
+#endif
 
-	netdev->irq = pdev->irq;
 	netdev->mem_start = mmio_start;
 	netdev->mem_end = mmio_start + mmio_len;
 	netdev->base_addr = adapter->hw.io_base;
@@ -669,6 +683,7 @@
 
 	atomic_set(&adapter->irq_sem, 1);
 	spin_lock_init(&adapter->stats_lock);
+	spin_lock_init(&adapter->tx_lock);
 
 	return 0;
 }
@@ -749,7 +764,7 @@
  * Return 0 on success, negative on failure
  **/
 
-static int
+int
 e1000_setup_tx_resources(struct e1000_adapter *adapter)
 {
 	struct e1000_desc_ring *txdr = &adapter->tx_ring;
@@ -866,7 +881,7 @@
  * Returns 0 on success, negative on failure
  **/
 
-static int
+int
 e1000_setup_rx_resources(struct e1000_adapter *adapter)
 {
 	struct e1000_desc_ring *rxdr = &adapter->rx_ring;
@@ -1005,7 +1020,7 @@
  * Free all transmit software resources
  **/
 
-static void
+void
 e1000_free_tx_resources(struct e1000_adapter *adapter)
 {
 	struct pci_dev *pdev = adapter->pdev;
@@ -1073,7 +1088,7 @@
  * Free all receive software resources
  **/
 
-static void
+void
 e1000_free_rx_resources(struct e1000_adapter *adapter)
 {
 	struct e1000_desc_ring *rx_ring = &adapter->rx_ring;
@@ -1281,41 +1296,6 @@
 		e1000_leave_82542_rst(adapter);
 }
 
-static void
-e1000_tx_flush(struct e1000_adapter *adapter)
-{
-	uint32_t ctrl, tctl, txcw, icr;
-
-	e1000_irq_disable(adapter);
-
-	if(adapter->hw.mac_type < e1000_82543) {
-		/* Transmit Unit Reset */
-		tctl = E1000_READ_REG(&adapter->hw, TCTL);
-		E1000_WRITE_REG(&adapter->hw, TCTL, tctl | E1000_TCTL_RST);
-		E1000_WRITE_REG(&adapter->hw, TCTL, tctl);
-		e1000_clean_tx_ring(adapter);
-		e1000_configure_tx(adapter);
-	} else {
-		txcw = E1000_READ_REG(&adapter->hw, TXCW);
-		E1000_WRITE_REG(&adapter->hw, TXCW, txcw & ~E1000_TXCW_ANE);
-
-		ctrl = E1000_READ_REG(&adapter->hw, CTRL);
-		E1000_WRITE_REG(&adapter->hw, CTRL, ctrl | E1000_CTRL_SLU |
-				E1000_CTRL_ILOS);
-
-		mdelay(10);
-
-		e1000_clean_tx_irq(adapter);
-		E1000_WRITE_REG(&adapter->hw, CTRL, ctrl);
-		E1000_WRITE_REG(&adapter->hw, TXCW, txcw);
-
-		/* clear the link status change interrupts this caused */
-		icr = E1000_READ_REG(&adapter->hw, ICR);
-	}
-
-	e1000_irq_enable(adapter);
-}
-
 /* need to wait a few seconds after link up to get diagnostic information from the phy */
 
 static void
@@ -1379,10 +1359,17 @@
 	struct net_device *netdev = adapter->netdev;
 	struct e1000_desc_ring *txdr = &adapter->tx_ring;
 	unsigned int i;
+	uint32_t link;
 
 	e1000_check_for_link(&adapter->hw);
 
-	if(E1000_READ_REG(&adapter->hw, STATUS) & E1000_STATUS_LU) {
+	if((adapter->hw.media_type == e1000_media_type_internal_serdes) &&
+	   !(E1000_READ_REG(&adapter->hw, TXCW) & E1000_TXCW_ANE))
+		link = !adapter->hw.serdes_link_down;
+	else
+		link = E1000_READ_REG(&adapter->hw, STATUS) & E1000_STATUS_LU;
+
+	if(link) {
 		if(!netif_carrier_ok(netdev)) {
 			e1000_get_speed_and_duplex(&adapter->hw,
 			                           &adapter->link_speed,
@@ -1415,14 +1402,26 @@
 	}
 
 	e1000_update_stats(adapter);
+
+	adapter->hw.tx_packet_delta = adapter->stats.tpt - adapter->tpt_old;
+	adapter->tpt_old = adapter->stats.tpt;
+	adapter->hw.collision_delta = adapter->stats.colc - adapter->colc_old;
+	adapter->colc_old = adapter->stats.colc;
+	
+	adapter->gorcl = adapter->stats.gorcl - adapter->gorcl_old;
+	adapter->gorcl_old = adapter->stats.gorcl;
+	adapter->gotcl = adapter->stats.gotcl - adapter->gotcl_old;
+	adapter->gotcl_old = adapter->stats.gotcl;
+
 	e1000_update_adaptive(&adapter->hw);
 
 	if(!netif_carrier_ok(netdev)) {
 		if(E1000_DESC_UNUSED(txdr) + 1 < txdr->count) {
-			unsigned long flags;
-			spin_lock_irqsave(&netdev->xmit_lock, flags);
-			e1000_tx_flush(adapter);
-			spin_unlock_irqrestore(&netdev->xmit_lock, flags);
+			/* We've lost link, so the controller stops DMA,
+			 * but we've got queued Tx work that's never going
+			 * to get done, so reset controller to flush Tx.
+			 * (Do the reset outside of interrupt context). */
+			schedule_work(&adapter->tx_timeout_task);
 		}
 	}
 
@@ -1783,6 +1782,7 @@
 	struct e1000_adapter *adapter = netdev->priv;
 	unsigned int first;
 	unsigned int tx_flags = 0;
+	unsigned long flags;
 	int count;
 
 	if(skb->len <= 0) {
@@ -1790,10 +1790,13 @@
 		return 0;
 	}
 
+	spin_lock_irqsave(&adapter->tx_lock, flags);
+
 	if(adapter->hw.mac_type == e1000_82547) {
 		if(e1000_82547_fifo_workaround(adapter, skb)) {
 			netif_stop_queue(netdev);
 			mod_timer(&adapter->tx_fifo_stall_timer, jiffies);
+			spin_unlock_irqrestore(&adapter->tx_lock, flags);
 			return 1;
 		}
 	}
@@ -1814,11 +1817,14 @@
 		e1000_tx_queue(adapter, count, tx_flags);
 	else {
 		netif_stop_queue(netdev);
+		spin_unlock_irqrestore(&adapter->tx_lock, flags);
 		return 1;
 	}
 
 	netdev->trans_start = jiffies;
 
+	spin_unlock_irqrestore(&adapter->tx_lock, flags);
+	
 	return 0;
 }
 
@@ -1860,6 +1866,7 @@
 {
 	struct e1000_adapter *adapter = netdev->priv;
 
+	e1000_update_stats(adapter);
 	return &adapter->net_stats;
 }
 
@@ -1918,7 +1925,7 @@
  * @adapter: board private structure
  **/
 
-static void
+void
 e1000_update_stats(struct e1000_adapter *adapter)
 {
 	struct e1000_hw *hw = &adapter->hw;
@@ -1936,8 +1943,7 @@
 
 	adapter->stats.crcerrs += E1000_READ_REG(hw, CRCERRS);
 	adapter->stats.gprc += E1000_READ_REG(hw, GPRC);
-	adapter->gorcl = E1000_READ_REG(hw, GORCL);
-	adapter->stats.gorcl += adapter->gorcl;
+	adapter->stats.gorcl += E1000_READ_REG(hw, GORCL);
 	adapter->stats.gorch += E1000_READ_REG(hw, GORCH);
 	adapter->stats.bprc += E1000_READ_REG(hw, BPRC);
 	adapter->stats.mprc += E1000_READ_REG(hw, MPRC);
@@ -1949,8 +1955,6 @@
 	adapter->stats.prc1023 += E1000_READ_REG(hw, PRC1023);
 	adapter->stats.prc1522 += E1000_READ_REG(hw, PRC1522);
 
-	spin_unlock_irqrestore(&adapter->stats_lock, flags);
-
 	/* the rest of the counters are only modified here */
 
 	adapter->stats.symerrs += E1000_READ_REG(hw, SYMERRS);
@@ -1968,8 +1972,7 @@
 	adapter->stats.xofftxc += E1000_READ_REG(hw, XOFFTXC);
 	adapter->stats.fcruc += E1000_READ_REG(hw, FCRUC);
 	adapter->stats.gptc += E1000_READ_REG(hw, GPTC);
-	adapter->gotcl = E1000_READ_REG(hw, GOTCL);
-	adapter->stats.gotcl += adapter->gotcl;
+	adapter->stats.gotcl += E1000_READ_REG(hw, GOTCL);
 	adapter->stats.gotch += E1000_READ_REG(hw, GOTCH);
 	adapter->stats.rnbc += E1000_READ_REG(hw, RNBC);
 	adapter->stats.ruc += E1000_READ_REG(hw, RUC);
@@ -2051,6 +2054,8 @@
 		   !e1000_read_phy_reg(hw, M88E1000_RX_ERR_CNTR, &phy_tmp))
 			adapter->phy_stats.receive_errors += phy_tmp;
 	}
+
+	spin_unlock_irqrestore(&adapter->stats_lock, flags);
 }
 
 /**
@@ -2064,7 +2069,7 @@
 	atomic_inc(&adapter->irq_sem);
 	E1000_WRITE_REG(&adapter->hw, IMC, ~0);
 	E1000_WRITE_FLUSH(&adapter->hw);
-	synchronize_irq(adapter->netdev->irq);
+	synchronize_irq(adapter->pdev->irq);
 }
 
 /**
@@ -2093,6 +2098,7 @@
 {
 	struct net_device *netdev = data;
 	struct e1000_adapter *adapter = netdev->priv;
+	struct e1000_hw *hw = &adapter->hw;
 	uint32_t icr = E1000_READ_REG(&adapter->hw, ICR);
 #ifndef CONFIG_E1000_NAPI
 	unsigned int i;
@@ -2102,7 +2108,7 @@
 		return IRQ_NONE;  /* Not our interrupt */
 
 	if(icr & (E1000_ICR_RXSEQ | E1000_ICR_LSC)) {
-		adapter->hw.get_link_status = 1;
+		hw->get_link_status = 1;
 		mod_timer(&adapter->watchdog_timer, jiffies);
 	}
 
@@ -2114,14 +2120,30 @@
 		*/
 
 		atomic_inc(&adapter->irq_sem);
-		E1000_WRITE_REG(&adapter->hw, IMC, ~0);
+		E1000_WRITE_REG(hw, IMC, ~0);
 		__netif_rx_schedule(netdev);
 	}
 #else
+        /* Writing IMC and IMS is needed for 82547.
+	   Due to Hub Link bus being occupied, an interrupt 
+	   de-assertion message is not able to be sent. 
+	   When an interrupt assertion message is generated later,
+	   two messages are re-ordered and sent out.
+	   That causes APIC to think 82547 is in de-assertion
+	   state, while 82547 is in assertion state, resulting 
+	   in dead lock. Writing IMC forces 82547 into 
+	   de-assertion state.
+        */
+	if(hw->mac_type == e1000_82547 || hw->mac_type == e1000_82547_rev_2)
+		e1000_irq_disable(adapter);
+
 	for(i = 0; i < E1000_MAX_INTR; i++)
 		if(!e1000_clean_rx_irq(adapter) &
 		   !e1000_clean_tx_irq(adapter))
 			break;
+
+	if(hw->mac_type == e1000_82547 || hw->mac_type == e1000_82547_rev_2)
+		e1000_irq_enable(adapter);
 #endif
 
 	return IRQ_HANDLED;
@@ -2146,7 +2168,7 @@
 	*budget -= work_done;
 	netdev->quota -= work_done;
 	
-	if(work_done < work_to_do) {
+	if(work_done < work_to_do || !netif_running(netdev)) {
 		netif_rx_complete(netdev);
 		e1000_irq_enable(adapter);
 	}
@@ -2171,6 +2193,8 @@
 	unsigned int i, eop;
 	boolean_t cleaned = FALSE;
 
+	spin_lock(&adapter->tx_lock);
+
 	i = tx_ring->next_to_clean;
 	eop = tx_ring->buffer_info[i].next_to_watch;
 	eop_desc = E1000_TX_DESC(*tx_ring, eop);
@@ -2215,6 +2239,8 @@
 	if(cleaned && netif_queue_stopped(netdev) && netif_carrier_ok(netdev))
 		netif_wake_queue(netdev);
 
+	spin_unlock(&adapter->tx_lock);
+
 	return cleaned;
 }
 
@@ -2642,13 +2668,13 @@
 }
 
 uint32_t
-e1000_io_read(struct e1000_hw *hw, uint32_t port)
+e1000_io_read(struct e1000_hw *hw, unsigned long port)
 {
 	return inl(port);
 }
 
 void
-e1000_io_write(struct e1000_hw *hw, uint32_t port, uint32_t value)
+e1000_io_write(struct e1000_hw *hw, unsigned long port, uint32_t value)
 {
 	outl(value, port);
 }
@@ -2665,8 +2691,6 @@
 	if(grp) {
 		/* enable VLAN tag insert/strip */
 
-		E1000_WRITE_REG(&adapter->hw, VET, ETHERNET_IEEE_VLAN_TYPE);
-
 		ctrl = E1000_READ_REG(&adapter->hw, CTRL);
 		ctrl |= E1000_CTRL_VME;
 		E1000_WRITE_REG(&adapter->hw, CTRL, ctrl);
@@ -2900,4 +2924,20 @@
 }
 #endif
 
+#ifdef CONFIG_NET_POLL_CONTROLLER
+/*
+ * Polling 'interrupt' - used by things like netconsole to send skbs
+ * without having to re-enable interrupts. It's not called while
+ * the interrupt routine is executing.
+ */
+
+static void e1000_netpoll (struct net_device *dev)
+{
+	struct e1000_adapter *adapter = dev->priv;
+	disable_irq(adapter->pdev->irq);
+	e1000_intr (adapter->pdev->irq, dev, NULL);
+	enable_irq(adapter->pdev->irq);
+}
+#endif
+
 /* e1000_main.c */
--- diff/drivers/net/e1000/e1000_osdep.h	2003-09-30 15:46:15.000000000 +0100
+++ source/drivers/net/e1000/e1000_osdep.h	2004-02-09 10:39:53.000000000 +0000
@@ -1,7 +1,7 @@
 /*******************************************************************************
 
   
-  Copyright(c) 1999 - 2003 Intel Corporation. All rights reserved.
+  Copyright(c) 1999 - 2004 Intel Corporation. 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 
--- diff/drivers/net/e1000/e1000_param.c	2003-09-30 15:46:15.000000000 +0100
+++ source/drivers/net/e1000/e1000_param.c	2004-02-09 10:39:53.000000000 +0000
@@ -1,7 +1,7 @@
 /*******************************************************************************
 
   
-  Copyright(c) 1999 - 2003 Intel Corporation. All rights reserved.
+  Copyright(c) 1999 - 2004 Intel Corporation. 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 
@@ -63,7 +63,7 @@
 /* Transmit Descriptor Count
  *
  * Valid Range: 80-256 for 82542 and 82543 gigabit ethernet controllers
- * Valid Range: 80-4096 for 82544
+ * Valid Range: 80-4096 for 82544 and newer
  *
  * Default Value: 256
  */
@@ -73,7 +73,7 @@
 /* Receive Descriptor Count
  *
  * Valid Range: 80-256 for 82542 and 82543 gigabit ethernet controllers
- * Valid Range: 80-4096 for 82544
+ * Valid Range: 80-4096 for 82544 and newer
  *
  * Default Value: 256
  */
@@ -196,16 +196,6 @@
 #define AUTONEG_ADV_MASK     0x2F
 #define FLOW_CONTROL_DEFAULT FLOW_CONTROL_FULL
 
-#define DEFAULT_TXD                  256
-#define MAX_TXD                      256
-#define MIN_TXD                       80
-#define MAX_82544_TXD               4096
-
-#define DEFAULT_RXD                  256
-#define MAX_RXD                      256
-#define MIN_RXD                       80
-#define MAX_82544_RXD               4096
-
 #define DEFAULT_RDTR                   0
 #define MAX_RXDELAY               0xFFFF
 #define MIN_RXDELAY                    0
@@ -299,7 +289,7 @@
  * e1000_check_options - Range Checking for Command Line Parameters
  * @adapter: board private structure
  *
- * This routine checks all command line paramters for valid user
+ * This routine checks all command line parameters for valid user
  * input.  If an invalid value is given, or if no user specified
  * value exists, a default value is used.  The final value is stored
  * in a variable in the adapter structure.
@@ -320,14 +310,15 @@
 		struct e1000_option opt = {
 			.type = range_option,
 			.name = "Transmit Descriptors",
-			.err  = "using default of " __MODULE_STRING(DEFAULT_TXD),
-			.def  = DEFAULT_TXD,
-			.arg  = { .r = { .min = MIN_TXD }}
+			.err  = "using default of "
+				__MODULE_STRING(E1000_DEFAULT_TXD),
+			.def  = E1000_DEFAULT_TXD,
+			.arg  = { .r = { .min = E1000_MIN_TXD }}
 		};
 		struct e1000_desc_ring *tx_ring = &adapter->tx_ring;
 		e1000_mac_type mac_type = adapter->hw.mac_type;
 		opt.arg.r.max = mac_type < e1000_82544 ?
-			MAX_TXD : MAX_82544_TXD;
+			E1000_MAX_TXD : E1000_MAX_82544_TXD;
 
 		tx_ring->count = TxDescriptors[bd];
 		e1000_validate_option(&tx_ring->count, &opt);
@@ -337,13 +328,15 @@
 		struct e1000_option opt = {
 			.type = range_option,
 			.name = "Receive Descriptors",
-			.err  = "using default of " __MODULE_STRING(DEFAULT_RXD),
-			.def  = DEFAULT_RXD,
-			.arg  = { .r = { .min = MIN_RXD }}
+			.err  = "using default of "
+				__MODULE_STRING(E1000_DEFAULT_RXD),
+			.def  = E1000_DEFAULT_RXD,
+			.arg  = { .r = { .min = E1000_MIN_RXD }}
 		};
 		struct e1000_desc_ring *rx_ring = &adapter->rx_ring;
 		e1000_mac_type mac_type = adapter->hw.mac_type;
-		opt.arg.r.max = mac_type < e1000_82544 ? MAX_RXD : MAX_82544_RXD;
+		opt.arg.r.max = mac_type < e1000_82544 ? E1000_MAX_RXD :
+			E1000_MAX_82544_RXD;
 
 		rx_ring->count = RxDescriptors[bd];
 		e1000_validate_option(&rx_ring->count, &opt);
@@ -446,13 +439,19 @@
 		};
 
 		adapter->itr = InterruptThrottleRate[bd];
-		if(adapter->itr == 0) {
-			printk(KERN_INFO "%s turned off\n", opt.name);
-		} else if(adapter->itr == 1 || adapter->itr == -1) {
-			/* Dynamic mode */
+		switch(adapter->itr) {
+		case -1:
 			adapter->itr = 1;
-		} else {
+			break;
+		case 0:
+			printk(KERN_INFO "%s turned off\n", opt.name);
+			break;
+		case 1:
+			printk(KERN_INFO "%s set to dynamic mode\n", opt.name);
+			break;
+		default:
 			e1000_validate_option(&adapter->itr, &opt);
+			break;
 		}
 	}
 
@@ -490,9 +489,9 @@
 		printk(KERN_INFO "Duplex not valid for fiber adapters, "
 		       "parameter ignored\n");
 	}
-	if((AutoNeg[bd] != OPTION_UNSET)) {
-		printk(KERN_INFO "AutoNeg not valid for fiber adapters, "
-		       "parameter ignored\n");
+	if((AutoNeg[bd] != OPTION_UNSET) && (AutoNeg[bd] != 0x20)) {
+		printk(KERN_INFO "AutoNeg other than Full/1000 is "
+		       "not valid for fiber adapters, parameter ignored\n");
 	}
 }
 
--- diff/drivers/net/e2100.c	2003-09-30 15:46:15.000000000 +0100
+++ source/drivers/net/e2100.c	2004-02-09 10:39:53.000000000 +0000
@@ -95,7 +95,6 @@
 #define E21_BIG_RX_STOP_PG	0xF0	/* Last page +1 of RX ring */
 #define E21_TX_START_PG		E21_RX_STOP_PG	/* First page of TX buffer */
 
-int e2100_probe(struct net_device *dev);
 static int e21_probe1(struct net_device *dev, int ioaddr);
 
 static int e21_open(struct net_device *dev);
@@ -117,10 +116,11 @@
 	station address).
  */
 
-int  __init e2100_probe(struct net_device *dev)
+static int  __init do_e2100_probe(struct net_device *dev)
 {
 	int *port;
 	int base_addr = dev->base_addr;
+	int irq = dev->irq;
 
 	SET_MODULE_OWNER(dev);
 
@@ -129,13 +129,46 @@
 	else if (base_addr != 0)	/* Don't probe at all. */
 		return -ENXIO;
 
-	for (port = e21_probe_list; *port; port++)
+	for (port = e21_probe_list; *port; port++) {
+		dev->irq = irq;
 		if (e21_probe1(dev, *port) == 0)
 			return 0;
+	}
 
 	return -ENODEV;
 }
 
+static void cleanup_card(struct net_device *dev)
+{
+	/* NB: e21_close() handles free_irq */
+	release_region(dev->base_addr, E21_IO_EXTENT);
+}
+
+struct net_device * __init e2100_probe(int unit)
+{
+	struct net_device *dev = alloc_ei_netdev();
+	int err;
+
+	if (!dev)
+		return ERR_PTR(-ENOMEM);
+
+	sprintf(dev->name, "eth%d", unit);
+	netdev_boot_setup_check(dev);
+
+	err = do_e2100_probe(dev);
+	if (err)
+		goto out;
+	err = register_netdev(dev);
+	if (err)
+		goto out1;
+	return dev;
+out1:
+	cleanup_card(dev);
+out:
+	free_netdev(dev);
+	return ERR_PTR(err);
+}
+
 static int __init e21_probe1(struct net_device *dev, int ioaddr)
 {
 	int i, status, retval;
@@ -175,13 +208,6 @@
 	for (i = 0; i < 6; i++)
 		printk(" %02X", station_addr[i]);
 
-	/* Allocate dev->priv and fill in 8390 specific dev fields. */
-	if (ethdev_init(dev)) {
-		printk (" unable to get memory for dev->priv.\n");
-		retval = -ENOMEM;
-		goto out;
-	}
-
 	if (dev->irq < 2) {
 		int irqlist[] = {15,11,10,12,5,9,3,4}, i;
 		for (i = 0; i < 8; i++)
@@ -191,8 +217,6 @@
 			}
 		if (i >= 8) {
 			printk(" unable to get IRQ %d.\n", dev->irq);
-			kfree(dev->priv);
-			dev->priv = NULL;
 			retval = -EAGAIN;
 			goto out;
 		}
@@ -245,6 +269,9 @@
 	ei_status.get_8390_hdr = &e21_get_8390_hdr;
 	dev->open = &e21_open;
 	dev->stop = &e21_close;
+#ifdef CONFIG_NET_POLL_CONTROLLER
+	dev->poll_controller = ei_poll;
+#endif
 	NS8390_init(dev, 0);
 
 	return 0;
@@ -376,7 +403,7 @@
 
 #ifdef MODULE
 #define MAX_E21_CARDS	4	/* Max number of E21 cards per module */
-static struct net_device dev_e21[MAX_E21_CARDS];
+static struct net_device *dev_e21[MAX_E21_CARDS];
 static int io[MAX_E21_CARDS];
 static int irq[MAX_E21_CARDS];
 static int mem[MAX_E21_CARDS];
@@ -398,29 +425,35 @@
 int
 init_module(void)
 {
+	struct net_device *dev;
 	int this_dev, found = 0;
 
 	for (this_dev = 0; this_dev < MAX_E21_CARDS; this_dev++) {
-		struct net_device *dev = &dev_e21[this_dev];
-		dev->irq = irq[this_dev];
-		dev->base_addr = io[this_dev];
-		dev->mem_start = mem[this_dev];
-		dev->mem_end = xcvr[this_dev];	/* low 4bits = xcvr sel. */
-		dev->init = e2100_probe;
 		if (io[this_dev] == 0)  {
 			if (this_dev != 0) break; /* only autoprobe 1st one */
 			printk(KERN_NOTICE "e2100.c: Presently autoprobing (not recommended) for a single card.\n");
 		}
-		if (register_netdev(dev) != 0) {
-			printk(KERN_WARNING "e2100.c: No E2100 card found (i/o = 0x%x).\n", io[this_dev]);
-			if (found != 0) {	/* Got at least one. */
-				return 0;
+		dev = alloc_ei_netdev();
+		if (!dev)
+			break;
+		dev->irq = irq[this_dev];
+		dev->base_addr = io[this_dev];
+		dev->mem_start = mem[this_dev];
+		dev->mem_end = xcvr[this_dev];	/* low 4bits = xcvr sel. */
+		if (do_e2100_probe(dev) == 0) {
+			if (register_netdev(dev) == 0) {
+				dev_e21[found++] = dev;
+				continue;
 			}
-			return -ENXIO;
+			cleanup_card(dev);
 		}
-		found++;
+		free_netdev(dev);
+		printk(KERN_WARNING "e2100.c: No E2100 card found (i/o = 0x%x).\n", io[this_dev]);
+		break;
 	}
-	return 0;
+	if (found)
+		return 0;
+	return -ENXIO;
 }
 
 void
@@ -429,13 +462,11 @@
 	int this_dev;
 
 	for (this_dev = 0; this_dev < MAX_E21_CARDS; this_dev++) {
-		struct net_device *dev = &dev_e21[this_dev];
-		if (dev->priv != NULL) {
-			void *priv = dev->priv;
-			/* NB: e21_close() handles free_irq */
-			release_region(dev->base_addr, E21_IO_EXTENT);
+		struct net_device *dev = dev_e21[this_dev];
+		if (dev) {
 			unregister_netdev(dev);
-			kfree(priv);
+			cleanup_card(dev);
+			free_netdev(dev);
 		}
 	}
 }
--- diff/drivers/net/eepro.c	2003-09-30 15:46:15.000000000 +0100
+++ source/drivers/net/eepro.c	2004-02-09 10:39:53.000000000 +0000
@@ -302,9 +302,7 @@
 
 /* Index to functions, as function prototypes. */
 
-extern int eepro_probe(struct net_device *dev);
-
-static int	eepro_probe1(struct net_device *dev, short ioaddr);
+static int	eepro_probe1(struct net_device *dev, int autoprobe);
 static int	eepro_open(struct net_device *dev);
 static int	eepro_send_packet(struct sk_buff *skb, struct net_device *dev);
 static irqreturn_t eepro_interrupt(int irq, void *dev_id, struct pt_regs *regs);
@@ -527,10 +525,11 @@
    If dev->base_addr == 2, allocate space for the device and return success
    (detachable devices only).
    */
-int __init eepro_probe(struct net_device *dev)
+static int __init do_eepro_probe(struct net_device *dev)
 {
 	int i;
 	int base_addr = dev->base_addr;
+	int irq = dev->irq;
 
 	SET_MODULE_OWNER(dev);
 
@@ -563,24 +562,48 @@
 #endif
 
 	if (base_addr > 0x1ff)		/* Check a single specified location. */
-		return eepro_probe1(dev, base_addr);
+		return eepro_probe1(dev, 0);
 
 	else if (base_addr != 0)	/* Don't probe at all. */
 		return -ENXIO;
 
-
 	for (i = 0; eepro_portlist[i]; i++) {
-		int ioaddr = eepro_portlist[i];
-
-		if (check_region(ioaddr, EEPRO_IO_EXTENT))
-			continue;
-		if (eepro_probe1(dev, ioaddr) == 0)
+		dev->base_addr = eepro_portlist[i];
+		dev->irq = irq;
+		if (eepro_probe1(dev, 1) == 0)
 			return 0;
 	}
 
 	return -ENODEV;
 }
 
+struct net_device * __init eepro_probe(int unit)
+{
+	struct net_device *dev = alloc_etherdev(sizeof(struct eepro_local));
+	int err;
+
+	if (!dev)
+		return ERR_PTR(-ENODEV);
+
+	SET_MODULE_OWNER(dev);
+
+	sprintf(dev->name, "eth%d", unit);
+	netdev_boot_setup_check(dev);
+
+	err = do_eepro_probe(dev);
+	if (err)
+		goto out;
+	err = register_netdev(dev);
+	if (err)
+		goto out1;
+	return dev;
+out1:
+	release_region(dev->base_addr, EEPRO_IO_EXTENT);
+out:
+	free_netdev(dev);
+	return ERR_PTR(err);
+}
+
 static void __init printEEPROMInfo(short ioaddr, struct net_device *dev)
 {
 	unsigned short Word;
@@ -713,83 +736,75 @@
    probes on the ISA bus.  A good device probe avoids doing writes, and
    verifies that the correct device exists and functions.  */
 
-static int __init eepro_probe1(struct net_device *dev, short ioaddr)
+static int __init eepro_probe1(struct net_device *dev, int autoprobe)
 {
 	unsigned short station_addr[6], id, counter;
-	int i, j, irqMask, retval = 0;
+	int i;
 	struct eepro_local *lp;
 	enum iftype { AUI=0, BNC=1, TPE=2 };
+	int ioaddr = dev->base_addr;
+
+	/* Grab the region so we can find another board if autoIRQ fails. */
+	if (!request_region(ioaddr, EEPRO_IO_EXTENT, dev->name)) { 
+		if (!autoprobe)
+			printk(KERN_WARNING "EEPRO: io-port 0x%04x in use \n",
+				ioaddr);
+		return -EBUSY;
+	}
 
 	/* Now, we are going to check for the signature of the
 	   ID_REG (register 2 of bank 0) */
 
-	id=inb(ioaddr + ID_REG);
+	id = inb(ioaddr + ID_REG);
 
-	if (((id) & ID_REG_MASK) != ID_REG_SIG) {
-		retval = -ENODEV;
+	if ((id & ID_REG_MASK) != ID_REG_SIG)
 		goto exit;
-	}
 
-		/* We seem to have the 82595 signature, let's
-		   play with its counter (last 2 bits of
-		   register 2 of bank 0) to be sure. */
+	/* We seem to have the 82595 signature, let's
+	   play with its counter (last 2 bits of
+	   register 2 of bank 0) to be sure. */
 
-		counter = (id & R_ROBIN_BITS);
-
-	if (((id=inb(ioaddr+ID_REG)) & R_ROBIN_BITS)!=(counter + 0x40)) {
-		retval = -ENODEV;
-		goto exit;
-	}
+	counter = id & R_ROBIN_BITS;
 
-			/* Initialize the device structure */
-			dev->priv = kmalloc(sizeof(struct eepro_local), GFP_KERNEL);
-	if (!dev->priv) {
-		retval = -ENOMEM;
+	if ((inb(ioaddr + ID_REG) & R_ROBIN_BITS) != (counter + 0x40))
 		goto exit;
-	}
-
-			memset(dev->priv, 0, sizeof(struct eepro_local));
-
-			lp = (struct eepro_local *)dev->priv;
 
-	/* default values */
-	lp->eepro = 0;
+	lp = (struct eepro_local *)dev->priv;
+	memset(lp, 0, sizeof(struct eepro_local));
 	lp->xmt_bar = XMT_BAR_PRO;
 	lp->xmt_lower_limit_reg = XMT_LOWER_LIMIT_REG_PRO;
 	lp->xmt_upper_limit_reg = XMT_UPPER_LIMIT_REG_PRO;
 	lp->eeprom_reg = EEPROM_REG_PRO;
+	spin_lock_init(&lp->lock);
 
-			/* Now, get the ethernet hardware address from
-			   the EEPROM */
-			station_addr[0] = read_eeprom(ioaddr, 2, dev);
-
-			/* FIXME - find another way to know that we've found
-			 * an Etherexpress 10
-			 */
-			if (station_addr[0] == 0x0000 ||
-			    station_addr[0] == 0xffff) {
-				lp->eepro = LAN595FX_10ISA;
+	/* Now, get the ethernet hardware address from
+	   the EEPROM */
+	station_addr[0] = read_eeprom(ioaddr, 2, dev);
+
+	/* FIXME - find another way to know that we've found
+	 * an Etherexpress 10
+	 */
+	if (station_addr[0] == 0x0000 || station_addr[0] == 0xffff) {
+		lp->eepro = LAN595FX_10ISA;
 		lp->eeprom_reg = EEPROM_REG_10;
 		lp->xmt_lower_limit_reg = XMT_LOWER_LIMIT_REG_10;
 		lp->xmt_upper_limit_reg = XMT_UPPER_LIMIT_REG_10;
 		lp->xmt_bar = XMT_BAR_10;
-				station_addr[0] = read_eeprom(ioaddr, 2, dev);
-			}
-			station_addr[1] = read_eeprom(ioaddr, 3, dev);
-			station_addr[2] = read_eeprom(ioaddr, 4, dev);
+		station_addr[0] = read_eeprom(ioaddr, 2, dev);
+	}
+	station_addr[1] = read_eeprom(ioaddr, 3, dev);
+	station_addr[2] = read_eeprom(ioaddr, 4, dev);
 
 	if (!lp->eepro) {
 		if (read_eeprom(ioaddr,7,dev)== ee_FX_INT2IRQ)
 			lp->eepro = 2;
 		else if (station_addr[2] == SA_ADDR1)
 			lp->eepro = 1;
-			}
-
-			/* Fill in the 'dev' fields. */
-			dev->base_addr = ioaddr;
+	}
 
+	/* Fill in the 'dev' fields. */
 	for (i=0; i < 6; i++)
-				dev->dev_addr[i] = ((unsigned char *) station_addr)[5-i];
+		dev->dev_addr[i] = ((unsigned char *) station_addr)[5-i];
 
 	/* RX buffer must be more than 3K and less than 29K */
 	if (dev->mem_end < 3072 || dev->mem_end > 29696)
@@ -798,65 +813,49 @@
 	/* calculate {xmt,rcv}_{lower,upper}_limit */
 	eepro_recalc(dev);
 
-
-			if (GetBit( read_eeprom(ioaddr, 5, dev),ee_BNC_TPE))
-				dev->if_port = BNC;
+	if (GetBit( read_eeprom(ioaddr, 5, dev),ee_BNC_TPE))
+		dev->if_port = BNC;
 	else
 		dev->if_port = TPE;
 
-	if ((dev->irq < 2) && (lp->eepro!=0)) {
-				i = read_eeprom(ioaddr, 1, dev);
-				irqMask = read_eeprom(ioaddr, 7, dev);
-				i &= 0x07; /* Mask off INT number */
-
-				for (j=0; ((j<16) && (i>=0)); j++) {
-					if ((irqMask & (1<<j))!=0) {
-						if (i==0) {
-							dev->irq = j;
-							break; /* found bit corresponding to irq */
-						}
-						i--; /* count bits set in irqMask */
-					}
-				}
-				if (dev->irq < 2) {
-			printk(KERN_ERR " Duh! invalid interrupt vector stored in EEPROM.\n");
-			retval = -ENODEV;
-			goto freeall;
-				} else
-			if (dev->irq==2) dev->irq = 9;
-			}
-
-			/* Grab the region so we can find another board if autoIRQ fails. */
-			if (!request_region(ioaddr, EEPRO_IO_EXTENT, dev->name)) { 
-				printk(KERN_WARNING "EEPRO: io-port 0x%04x in use \n", ioaddr);
-				goto freeall;
-			}
-			((struct eepro_local *)dev->priv)->lock = SPIN_LOCK_UNLOCKED;
-
-			dev->open               = eepro_open;
-			dev->stop               = eepro_close;
-			dev->hard_start_xmit    = eepro_send_packet;
-			dev->get_stats          = eepro_get_stats;
-			dev->set_multicast_list = &set_multicast_list;
-			dev->tx_timeout		= eepro_tx_timeout;
-			dev->watchdog_timeo	= TX_TIMEOUT;
-
-			/* Fill in the fields of the device structure with
-			   ethernet generic values */
-			ether_setup(dev);
-
+ 	if (dev->irq < 2 && lp->eepro != 0) {
+ 		/* Mask off INT number */
+ 		int count = read_eeprom(ioaddr, 1, dev) & 7;
+ 		unsigned irqMask = read_eeprom(ioaddr, 7, dev);
+ 
+ 		while (count--)
+ 			irqMask &= irqMask - 1;
+ 
+ 		count = ffs(irqMask);
+ 
+ 		if (count)
+ 			dev->irq = count - 1;
+ 
+ 		if (dev->irq < 2) {
+ 			printk(KERN_ERR " Duh! illegal interrupt vector stored in EEPROM.\n");
+ 			goto exit;
+ 		} else if (dev->irq == 2) {
+ 			dev->irq = 9;
+ 		}
+ 	}
+ 
+ 	dev->open               = eepro_open;
+ 	dev->stop               = eepro_close;
+ 	dev->hard_start_xmit    = eepro_send_packet;
+ 	dev->get_stats          = eepro_get_stats;
+ 	dev->set_multicast_list = &set_multicast_list;
+ 	dev->tx_timeout		= eepro_tx_timeout;
+ 	dev->watchdog_timeo	= TX_TIMEOUT;
+ 
 	/* print boot time info */
 	eepro_print_info(dev);
 
 	/* reset 82595 */
-			eepro_reset(ioaddr);
-
+	eepro_reset(ioaddr);
+	return 0;
 exit:
-	return retval;
-freeall:
-	kfree(dev->priv);
-	goto exit;
-
+ 	release_region(dev->base_addr, EEPRO_IO_EXTENT);
+ 	return -ENODEV;
 }
 
 /* Open/initialize the board.  This is called (in the current kernel)
@@ -1701,7 +1700,7 @@
 #ifdef MODULE
 
 #define MAX_EEPRO 8
-static struct net_device dev_eepro[MAX_EEPRO];
+static struct net_device *dev_eepro[MAX_EEPRO];
 
 static int io[MAX_EEPRO];
 static int irq[MAX_EEPRO];
@@ -1729,6 +1728,7 @@
 int
 init_module(void)
 {
+	struct net_device *dev;
 	int i;
 	if (io[0] == 0 && autodetect == 0) {
 		printk(KERN_WARNING "eepro_init_module: Probe is very dangerous in ISA boards!\n");
@@ -1743,17 +1743,24 @@
 	}
 
 	for (i = 0; i < MAX_EEPRO; i++) {
-		struct net_device *d = &dev_eepro[n_eepro];
-		d->mem_end	= mem[i];
-		d->base_addr	= io[i];
-		d->irq		= irq[i];
-		d->init		= eepro_probe;
-
-			if (register_netdev(d) == 0)
-				n_eepro++;
-			else
-				break;
+		dev = alloc_etherdev(sizeof(struct eepro_local));
+		if (!dev)
+			break;
+
+		dev->mem_end = mem[i];
+		dev->base_addr = io[i];
+		dev->irq = irq[i];
+
+		if (do_eepro_probe(dev) == 0) {
+			if (register_netdev(dev) == 0) {
+				dev_eepro[n_eepro++] = dev;
+				continue;
+			}
+			release_region(dev->base_addr, EEPRO_IO_EXTENT);
 		}
+		free_netdev(dev);
+		break;
+	}
 
 	if (n_eepro)
 		printk(KERN_INFO "%s", version);
@@ -1767,15 +1774,10 @@
 	int i;
 
 	for (i=0; i<n_eepro; i++) {
-		struct net_device *d = &dev_eepro[i];
-		unregister_netdev(d);
-
-		kfree(d->priv);
-		d->priv=NULL;
-
-		/* If we don't do this, we can't re-insmod it later. */
-		release_region(d->base_addr, EEPRO_IO_EXTENT);
-
+		struct net_device *dev = dev_eepro[i];
+		unregister_netdev(dev);
+		release_region(dev->base_addr, EEPRO_IO_EXTENT);
+		free_netdev(dev);
 	}
 }
 #endif /* MODULE */
--- diff/drivers/net/eepro100.c	2003-10-09 09:47:16.000000000 +0100
+++ source/drivers/net/eepro100.c	2004-02-09 10:39:53.000000000 +0000
@@ -654,6 +654,23 @@
 	return -ENODEV;
 }
 
+#ifdef CONFIG_NET_POLL_CONTROLLER
+/*
+ * Polling 'interrupt' - used by things like netconsole to send skbs
+ * without having to re-enable interrupts. It's not called while
+ * the interrupt routine is executing.
+ */
+
+static void poll_speedo (struct net_device *dev)
+{
+	/* disable_irq is not very nice, but with the funny lockless design
+	   we have no other choice. */
+	disable_irq(dev->irq);
+	speedo_interrupt (dev->irq, dev, NULL);
+	enable_irq(dev->irq);
+}
+#endif
+
 static int __devinit speedo_found1(struct pci_dev *pdev,
 		long ioaddr, int card_idx, int acpi_idle_state)
 {
@@ -885,6 +902,9 @@
 	dev->get_stats = &speedo_get_stats;
 	dev->set_multicast_list = &set_rx_mode;
 	dev->do_ioctl = &speedo_ioctl;
+#ifdef CONFIG_NET_POLL_CONTROLLER
+	dev->poll_controller = &poll_speedo;
+#endif
 
 	if (register_netdevice(dev))
 		goto err_free_unlock;
--- diff/drivers/net/eexpress.c	2003-10-09 09:47:34.000000000 +0100
+++ source/drivers/net/eexpress.c	2004-02-09 10:39:53.000000000 +0000
@@ -244,7 +244,6 @@
  * Prototypes for Linux interface
  */
 
-extern int express_probe(struct net_device *dev);
 static int eexp_open(struct net_device *dev);
 static int eexp_close(struct net_device *dev);
 static void eexp_timeout(struct net_device *dev);
@@ -334,11 +333,13 @@
  * checks for presence of EtherExpress card
  */
 
-int __init express_probe(struct net_device *dev)
+static int __init do_express_probe(struct net_device *dev)
 {
 	unsigned short *port;
 	static unsigned short ports[] = { 0x240,0x300,0x310,0x270,0x320,0x340,0 };
 	unsigned short ioaddr = dev->base_addr;
+	int dev_irq = dev->irq;
+	int err;
 
 	SET_MODULE_OWNER(dev);
 
@@ -391,27 +392,58 @@
 		}
 	}
 #endif
-	if (ioaddr&0xfe00)
-		return eexp_hw_probe(dev,ioaddr);
-	else if (ioaddr)
+	if (ioaddr&0xfe00) {
+		if (!request_region(ioaddr, EEXP_IO_EXTENT, "EtherExpress"))
+			return -EBUSY;
+		err = eexp_hw_probe(dev,ioaddr);
+		release_region(ioaddr, EEXP_IO_EXTENT);
+		return err;
+	} else if (ioaddr)
 		return -ENXIO;
 
 	for (port=&ports[0] ; *port ; port++ )
 	{
 		unsigned short sum = 0;
 		int i;
+		if (!request_region(*port, EEXP_IO_EXTENT, "EtherExpress"))
+			continue;
 		for ( i=0 ; i<4 ; i++ )
 		{
 			unsigned short t;
 			t = inb(*port + ID_PORT);
 			sum |= (t>>4) << ((t & 0x03)<<2);
 		}
-		if (sum==0xbaba && !eexp_hw_probe(dev,*port))
+		if (sum==0xbaba && !eexp_hw_probe(dev,*port)) {
+			release_region(*port, EEXP_IO_EXTENT);
 			return 0;
+		}
+		release_region(*port, EEXP_IO_EXTENT);
+		dev->irq = dev_irq;
 	}
 	return -ENODEV;
 }
 
+struct net_device * __init express_probe(int unit)
+{
+	struct net_device *dev = alloc_etherdev(sizeof(struct net_local));
+	int err;
+
+	if (!dev)
+		return ERR_PTR(-ENOMEM);
+
+	sprintf(dev->name, "eth%d", unit);
+	netdev_boot_setup_check(dev);
+
+	err = do_express_probe(dev);
+	if (!err) {
+		err = register_netdev(dev);
+		if (!err)
+			return dev;
+	}
+	free_netdev(dev);
+	return ERR_PTR(err);
+}
+
 /*
  * open and initialize the adapter, ready for use
  */
@@ -1058,7 +1090,7 @@
 	unsigned int memory_size;
 	int i;
 	unsigned short xsum = 0;
-	struct net_local *lp;
+	struct net_local *lp = dev->priv;
 
 	printk("%s: EtherExpress 16 at %#x ",dev->name,ioaddr);
 
@@ -1108,17 +1140,18 @@
 		buswidth = !((setupval & 0x400) >> 10);
 	}
 
-	dev->priv = lp = kmalloc(sizeof(struct net_local), GFP_KERNEL);
-	if (!dev->priv)
-		return -ENOMEM;
-
-	memset(dev->priv, 0, sizeof(struct net_local));
+	memset(lp, 0, sizeof(struct net_local));
 	spin_lock_init(&lp->lock);
 
  	printk("(IRQ %d, %s connector, %d-bit bus", dev->irq, 
  	       eexp_ifmap[dev->if_port], buswidth?8:16);
  
+	if (!request_region(dev->base_addr + 0x300e, 1, "EtherExpress"))
+		return -EBUSY;
+
  	eexp_hw_set_interface(dev);
+ 
+	release_region(dev->base_addr + 0x300e, 1);
   
 	/* Find out how much RAM we have on the card */
 	outw(0, dev->base_addr + WRITE_PTR);
@@ -1156,7 +1189,6 @@
 		break;
 	default:
 		printk(") bad memory size (%dk).\n", memory_size);
-		kfree(dev->priv);
 		return -ENODEV;
 		break;
 	}
@@ -1171,7 +1203,6 @@
 	dev->set_multicast_list = &eexp_set_multicast;
 	dev->tx_timeout = eexp_timeout;
 	dev->watchdog_timeo = 2*HZ;
-	ether_setup(dev);
 	return 0;
 }
 
@@ -1654,7 +1685,7 @@
 
 #define EEXP_MAX_CARDS     4    /* max number of cards to support */
 
-static struct net_device dev_eexp[EEXP_MAX_CARDS];
+static struct net_device *dev_eexp[EEXP_MAX_CARDS];
 static int irq[EEXP_MAX_CARDS];
 static int io[EEXP_MAX_CARDS];
 
@@ -1671,25 +1702,30 @@
  */
 int init_module(void)
 {
+	struct net_device *dev;
 	int this_dev, found = 0;
 
 	for (this_dev = 0; this_dev < EEXP_MAX_CARDS; this_dev++) {
-		struct net_device *dev = &dev_eexp[this_dev];
+		dev = alloc_etherdev(sizeof(struct net_local));
 		dev->irq = irq[this_dev];
 		dev->base_addr = io[this_dev];
-		dev->init = express_probe;
 		if (io[this_dev] == 0) {
-			if (this_dev) break;
+			if (this_dev)
+				break;
 			printk(KERN_NOTICE "eexpress.c: Module autoprobe not recommended, give io=xx.\n");
 		}
-		if (register_netdev(dev) != 0) {
-			printk(KERN_WARNING "eexpress.c: Failed to register card at 0x%x.\n", io[this_dev]);
-			if (found != 0) return 0;
-			return -ENXIO;
+		if (do_express_probe(dev) == 0 && register_netdev(dev) == 0) {
+			dev_eexp[this_dev] = dev;
+			found++;
+			continue;
 		}
-		found++;
+		printk(KERN_WARNING "eexpress.c: Failed to register card at 0x%x.\n", io[this_dev]);
+		free_netdev(dev);
+		break;
 	}
-	return 0;
+	if (found)
+		return 0;
+	return -ENXIO;
 }
 
 void cleanup_module(void)
@@ -1697,11 +1733,10 @@
 	int this_dev;
 
 	for (this_dev = 0; this_dev < EEXP_MAX_CARDS; this_dev++) {
-		struct net_device *dev = &dev_eexp[this_dev];
-		if (dev->priv != NULL) {
+		struct net_device *dev = dev_eexp[this_dev];
+		if (dev) {
 			unregister_netdev(dev);
-			kfree(dev->priv);
-			dev->priv = NULL;
+			free_netdev(dev);
 		}
 	}
 }
--- diff/drivers/net/eql.c	2003-08-26 10:00:53.000000000 +0100
+++ source/drivers/net/eql.c	2004-02-09 10:39:53.000000000 +0000
@@ -600,7 +600,7 @@
 
 	err = register_netdev(dev_eql);
 	if (err) 
-		kfree(dev_eql);
+		free_netdev(dev_eql);
 	return err;
 }
 
--- diff/drivers/net/es3210.c	2003-09-30 15:46:15.000000000 +0100
+++ source/drivers/net/es3210.c	2004-02-09 10:39:53.000000000 +0000
@@ -62,7 +62,6 @@
 
 #include "8390.h"
 
-int es_probe(struct net_device *dev);
 static int es_probe1(struct net_device *dev, int ioaddr);
 
 static int es_open(struct net_device *dev);
@@ -125,9 +124,11 @@
  *	PROM for a match against the Racal-Interlan assigned value.
  */
 
-int __init es_probe(struct net_device *dev)
+static int __init do_es_probe(struct net_device *dev)
 {
 	unsigned short ioaddr = dev->base_addr;
+	int irq = dev->irq;
+	int mem_start = dev->mem_start;
 
 	SET_MODULE_OWNER(dev);
 
@@ -144,13 +145,47 @@
 	}
 
 	/* EISA spec allows for up to 16 slots, but 8 is typical. */
-	for (ioaddr = 0x1000; ioaddr < 0x9000; ioaddr += 0x1000)
+	for (ioaddr = 0x1000; ioaddr < 0x9000; ioaddr += 0x1000) {
 		if (es_probe1(dev, ioaddr) == 0)
 			return 0;
+		dev->irq = irq;
+		dev->mem_start = mem_start;
+	}
 
 	return -ENODEV;
 }
 
+static void cleanup_card(struct net_device *dev)
+{
+	free_irq(dev->irq, dev);
+	release_region(dev->base_addr, ES_IO_EXTENT);
+}
+
+struct net_device * __init es_probe(int unit)
+{
+	struct net_device *dev = alloc_ei_netdev();
+	int err;
+
+	if (!dev)
+		return ERR_PTR(-ENOMEM);
+
+	sprintf(dev->name, "eth%d", unit);
+	netdev_boot_setup_check(dev);
+
+	err = do_es_probe(dev);
+	if (err)
+		goto out;
+	err = register_netdev(dev);
+	if (err)
+		goto out1;
+	return dev;
+out1:
+	cleanup_card(dev);
+out:
+	free_netdev(dev);
+	return ERR_PTR(err);
+}
+
 static int __init es_probe1(struct net_device *dev, int ioaddr)
 {
 	int i, retval;
@@ -240,13 +275,6 @@
 
 	printk("mem %#lx-%#lx\n", dev->mem_start, dev->mem_end-1);
 
-	/* Allocate dev->priv and fill in 8390 specific dev fields. */
-	if (ethdev_init(dev)) {
-		printk (" unable to allocate memory for dev->priv.\n");
-		retval = -ENOMEM;
-		goto out1;
-	}
-
 #if ES_DEBUG & ES_D_PROBE
 	if (inb(ioaddr + ES_CFG5))
 		printk("es3210: Warning - DMA channel enabled, but not used here.\n");
@@ -270,6 +298,9 @@
 
 	dev->open = &es_open;
 	dev->stop = &es_close;
+#ifdef CONFIG_NET_POLL_CONTROLLER
+	dev->poll_controller = ei_poll;
+#endif
 	NS8390_init(dev, 0);
 	return 0;
 out1:
@@ -376,7 +407,7 @@
 #ifdef MODULE
 #define MAX_ES_CARDS	4	/* Max number of ES3210 cards per module */
 #define NAMELEN		8	/* # of chars for storing dev->name */
-static struct net_device dev_es3210[MAX_ES_CARDS];
+static struct net_device *dev_es3210[MAX_ES_CARDS];
 static int io[MAX_ES_CARDS];
 static int irq[MAX_ES_CARDS];
 static int mem[MAX_ES_CARDS];
@@ -393,26 +424,32 @@
 int
 init_module(void)
 {
+	struct net_device *dev;
 	int this_dev, found = 0;
 
 	for (this_dev = 0; this_dev < MAX_ES_CARDS; this_dev++) {
-		struct net_device *dev = &dev_es3210[this_dev];
+		if (io[this_dev] == 0 && this_dev != 0)
+			break;
+		dev = alloc_ei_netdev();
+		if (!dev)
+			break;
 		dev->irq = irq[this_dev];
 		dev->base_addr = io[this_dev];
-		dev->mem_start = mem[this_dev];		/* Currently ignored by driver */
-		dev->init = es_probe;
-		/* Default is to only install one card. */
-		if (io[this_dev] == 0 && this_dev != 0) break;
-		if (register_netdev(dev) != 0) {
-			printk(KERN_WARNING "es3210.c: No es3210 card found (i/o = 0x%x).\n", io[this_dev]);
-			if (found != 0) {	/* Got at least one. */
-				return 0;
+		dev->mem_start = mem[this_dev];
+		if (do_es_probe(dev) == 0) {
+			if (register_netdev(dev) == 0) {
+				dev_es3210[found++] = dev;
+				continue;
 			}
-			return -ENXIO;
+			cleanup_card(dev);
 		}
-		found++;
+		free_netdev(dev);
+		printk(KERN_WARNING "es3210.c: No es3210 card found (i/o = 0x%x).\n", io[this_dev]);
+		break;
 	}
-	return 0;
+	if (found)
+		return 0;
+	return -ENXIO;
 }
 
 void
@@ -421,13 +458,11 @@
 	int this_dev;
 
 	for (this_dev = 0; this_dev < MAX_ES_CARDS; this_dev++) {
-		struct net_device *dev = &dev_es3210[this_dev];
-		if (dev->priv != NULL) {
-			void *priv = dev->priv;
-			free_irq(dev->irq, dev);
-			release_region(dev->base_addr, ES_IO_EXTENT);
+		struct net_device *dev = dev_es3210[this_dev];
+		if (dev) {
 			unregister_netdev(dev);
-			kfree(priv);
+			cleanup_card(dev);
+			free_netdev(dev);
 		}
 	}
 }
--- diff/drivers/net/eth16i.c	2003-09-17 12:28:07.000000000 +0100
+++ source/drivers/net/eth16i.c	2004-02-09 10:39:53.000000000 +0000
@@ -369,7 +369,6 @@
 #define NUM_OF_EISA_IRQS   8
 
 static unsigned int eth16i_tx_buf_map[] = { 2048, 2048, 4096, 8192 };
-static unsigned int boot = 1;
 
 /* Use 0 for production, 1 for verification, >2 for debug */
 #ifndef ETH16I_DEBUG
@@ -395,8 +394,6 @@
 
 /* Function prototypes */
 
-extern int     eth16i_probe(struct net_device *dev);
-
 static int     eth16i_probe1(struct net_device *dev, int ioaddr);
 static int     eth16i_check_signature(int ioaddr);
 static int     eth16i_probe_port(int ioaddr);
@@ -418,7 +415,7 @@
 static void    eth16i_skip_packet(struct net_device *dev);
 static void    eth16i_multicast(struct net_device *dev); 
 static void    eth16i_select_regbank(unsigned char regbank, int ioaddr);
-static void    eth16i_initialize(struct net_device *dev);
+static void    eth16i_initialize(struct net_device *dev, int boot);
 
 #if 0
 static int     eth16i_set_irq(struct net_device *dev);
@@ -432,7 +429,7 @@
 
 static char cardname[] __initdata = "ICL EtherTeam 16i/32";
 
-int __init eth16i_probe(struct net_device *dev)
+static int __init do_eth16i_probe(struct net_device *dev)
 {
 	int i;
 	int ioaddr;
@@ -461,14 +458,38 @@
 	return -ENODEV;
 }
 
+struct net_device * __init eth16i_probe(int unit)
+{
+	struct net_device *dev = alloc_etherdev(sizeof(struct eth16i_local));
+	int err;
+
+	if (!dev)
+		return ERR_PTR(-ENOMEM);
+
+	sprintf(dev->name, "eth%d", unit);
+	netdev_boot_setup_check(dev);
+
+	err = do_eth16i_probe(dev);
+	if (err)
+		goto out;
+	err = register_netdev(dev);
+	if (err)
+		goto out1;
+	return dev;
+out1:
+	free_irq(dev->irq, dev);
+	release_region(dev->base_addr, ETH16I_IO_EXTENT);
+out:
+	free_netdev(dev);
+	return ERR_PTR(err);
+}
+
 static int __init eth16i_probe1(struct net_device *dev, int ioaddr)
 {
-	struct eth16i_local *lp;
+	struct eth16i_local *lp = dev->priv;
 	static unsigned version_printed;
 	int retval;
 
-	boot = 1;  /* To inform initilization that we are in boot probe */
-
 	/* Let's grab the region */
 	if (!request_region(ioaddr, ETH16I_IO_EXTENT, dev->name))
 		return -EBUSY;
@@ -531,22 +552,13 @@
 	eth16i_select_regbank(TRANSCEIVER_MODE_RB, ioaddr);
 	outb(0x38, ioaddr + TRANSCEIVER_MODE_REG); 
 
-	eth16i_initialize(dev);   /* Initialize rest of the chip's registers */
+	eth16i_initialize(dev, 1); /* Initialize rest of the chip's registers */
 
 	/* Now let's same some energy by shutting down the chip ;) */
 	BITCLR(ioaddr + CONFIG_REG_1, POWERUP);
 
 	/* Initialize the device structure */
-	if(dev->priv == NULL) {
-		dev->priv = kmalloc(sizeof(struct eth16i_local), GFP_KERNEL);
-		if(dev->priv == NULL) {
-			free_irq(dev->irq, dev);
-			retval = -ENOMEM;
-			goto out;
-		}
-	}
-
-	memset(dev->priv, 0, sizeof(struct eth16i_local));
+	memset(lp, 0, sizeof(struct eth16i_local));
 	dev->open               = eth16i_open;
 	dev->stop               = eth16i_close;
 	dev->hard_start_xmit    = eth16i_tx;
@@ -554,15 +566,7 @@
 	dev->set_multicast_list = eth16i_multicast;
 	dev->tx_timeout 	= eth16i_timeout;
 	dev->watchdog_timeo	= TX_TIMEOUT;
-
-	lp = (struct eth16i_local *)dev->priv;
 	spin_lock_init(&lp->lock);
-
-	/* Fill in the fields of the device structure with ethernet values. */
-	ether_setup(dev);
-
-	boot = 0;
-
 	return 0;
 out:
 	release_region(ioaddr, ETH16I_IO_EXTENT);
@@ -570,7 +574,7 @@
 }
 
 
-static void eth16i_initialize(struct net_device *dev)
+static void eth16i_initialize(struct net_device *dev, int boot)
 {
 	int ioaddr = dev->base_addr;
 	int i, node_w = 0;
@@ -953,7 +957,7 @@
 	outb(0xc0 | POWERUP, ioaddr + CONFIG_REG_1);
 
 	/* Initialize the chip */
-	eth16i_initialize(dev);  
+	eth16i_initialize(dev, 0);  
 
 	/* Set the transmit buffer size */
 	lp->tx_buf_size = eth16i_tx_buf_map[ETH16I_TX_BUF_SIZE & 0x03];
@@ -1401,7 +1405,7 @@
 
 #define MAX_ETH16I_CARDS 4  /* Max number of Eth16i cards per module */
 
-static struct net_device dev_eth16i[MAX_ETH16I_CARDS];
+static struct net_device *dev_eth16i[MAX_ETH16I_CARDS];
 static int io[MAX_ETH16I_CARDS];
 #if 0
 static int irq[MAX_ETH16I_CARDS];
@@ -1431,14 +1435,14 @@
 int init_module(void)
 {
 	int this_dev, found = 0;
+	struct net_device *dev;
+
+	for (this_dev = 0; this_dev < MAX_ETH16I_CARDS; this_dev++) {
+		dev = alloc_etherdev(sizeof(struct eth16i_local));
+		if (!dev)
+			break;
 
-	for(this_dev = 0; this_dev < MAX_ETH16I_CARDS; this_dev++)
-	{
-		struct net_device *dev = &dev_eth16i[this_dev];
-	
-		dev->irq = 0; /* irq[this_dev]; */
 		dev->base_addr = io[this_dev];
-		dev->init = eth16i_probe;
 
 	        if(debug != -1)
 			eth16i_debug = debug;
@@ -1448,44 +1452,43 @@
 
 		dev->if_port = eth16i_parse_mediatype(mediatype[this_dev]);
 
-		if(io[this_dev] == 0)
-		{
-			if(this_dev != 0) break; /* Only autoprobe 1st one */
+		if(io[this_dev] == 0) {
+			if(this_dev != 0) /* Only autoprobe 1st one */
+				break;
 
 			printk(KERN_NOTICE "eth16i.c: Presently autoprobing (not recommended) for a single card.\n");
 		}
 
-		if(register_netdev(dev) != 0)
-		{
-			printk(KERN_WARNING "eth16i.c No Eth16i card found (i/o = 0x%x).\n",
-			       io[this_dev]);
-	    
-			if(found != 0) return 0;
-			return -ENXIO;
+		if (do_eth16i_probe(dev) == 0) {
+			if (register_netdev(dev) == 0) {
+				dev_eth16i[found++] = dev;
+				continue;
+			}
+			free_irq(dev->irq, dev);
+			release_region(dev->base_addr, ETH16I_IO_EXTENT);
 		}
-
-		found++;
+		printk(KERN_WARNING "eth16i.c No Eth16i card found (i/o = 0x%x).\n",
+		       io[this_dev]);
+		free_netdev(dev);
+		break;
 	}
-	return 0;
+	if (found)
+		return 0;
+	return -ENXIO;
 }
 	
 void cleanup_module(void)
 {
 	int this_dev;
 
-	for(this_dev = 0; this_dev < MAX_ETH16I_CARDS; this_dev++)
-	{
-		struct net_device* dev = &dev_eth16i[this_dev];
+	for(this_dev = 0; this_dev < MAX_ETH16I_CARDS; this_dev++) {
+		struct net_device *dev = dev_eth16i[this_dev];
 		
-		if(dev->priv != NULL)
-		{
+		if(dev->priv) {
 			unregister_netdev(dev);
-			kfree(dev->priv);
-			dev->priv = NULL;
-			
 			free_irq(dev->irq, dev);
 			release_region(dev->base_addr, ETH16I_IO_EXTENT);
-			
+			free_netdev(dev);
 		}
 	}
 }
--- diff/drivers/net/ethertap.c	2003-11-25 15:24:58.000000000 +0000
+++ source/drivers/net/ethertap.c	2004-02-09 10:39:53.000000000 +0000
@@ -72,8 +72,7 @@
 	struct net_device *dev;
 	int err = -ENOMEM;
 
-	dev = alloc_netdev(sizeof(struct net_local), "tap%d",
-			   ether_setup);
+	dev = alloc_etherdev(sizeof(struct net_local));
 
 	if (!dev)
 		goto out;
--- diff/drivers/net/ewrk3.c	2003-09-30 15:46:15.000000000 +0100
+++ source/drivers/net/ewrk3.c	2004-02-09 10:39:53.000000000 +0000
@@ -324,25 +324,14 @@
 static int Write_EEPROM(short data, u_long iobase, u_char eaddr);
 static u_char get_hw_addr(struct net_device *dev, u_char * eeprom_image, char chipType);
 
-static void isa_probe(struct net_device *dev, u_long iobase);
-static void eisa_probe(struct net_device *dev, u_long iobase);
-static struct net_device *alloc_device(struct net_device *dev, u_long iobase);
-static int ewrk3_dev_index(char *s);
-static struct net_device *insert_device(struct net_device *dev, u_long iobase, int (*init) (struct net_device *));
+static int ewrk3_probe1(struct net_device *dev, u_long iobase, int irq);
+static int isa_probe(struct net_device *dev, u_long iobase);
+static int eisa_probe(struct net_device *dev, u_long iobase);
 
-
-#ifdef MODULE
-static int autoprobed = 1, loading_module = 1;
-
-#else
-static u_char irq[] =
-{5, 0, 10, 3, 11, 9, 15, 12};
-static int autoprobed, loading_module;
-
-#endif				/* MODULE */
+static u_char irq[MAX_NUM_EWRK3S+1] = {5, 0, 10, 3, 11, 9, 15, 12};
 
 static char name[EWRK3_STRLEN + 1];
-static int num_ewrk3s, num_eth;
+static int num_ewrks3s;
 
 /*
    ** Miscellaneous defines...
@@ -352,38 +341,50 @@
     mdelay(1);\
 }
 
-int __init ewrk3_probe(struct net_device *dev)
+struct net_device * __init ewrk3_probe(int unit)
 {
-	int tmp = num_ewrk3s, status = -ENODEV;
-	u_long iobase = dev->base_addr;
+	struct net_device *dev = alloc_etherdev(sizeof(struct ewrk3_private));
+	int err;
+
+	if (!dev)
+		return ERR_PTR(-ENOMEM);
 
+	if (unit >= 0) {
+		sprintf(dev->name, "eth%d", unit);
+		netdev_boot_setup_check(dev);
+	}
 	SET_MODULE_OWNER(dev);
 
-	if ((iobase == 0) && loading_module) {
-		printk("Autoprobing is not supported when loading a module based driver.\n");
-		status = -EIO;
-	} else {		/* First probe for the Ethernet */
-		/* Address PROM pattern */
-		isa_probe(dev, iobase);
-		eisa_probe(dev, iobase);
-
-		if ((tmp == num_ewrk3s) && (iobase != 0) && loading_module) {
-			printk("%s: ewrk3_probe() cannot find device at 0x%04lx.\n", dev->name,
-			       iobase);
-		}
-		/*
-		   ** Walk the device list to check that at least one device
-		   ** initialised OK
-		 */
-		for (; (dev->priv == NULL) && (dev->next != NULL); dev = dev->next);
+	err = ewrk3_probe1(dev, dev->base_addr, dev->irq);
+	if (err) 
+		goto out;
+	return dev;
+out:
+	free_netdev(dev);
+	return ERR_PTR(err);
+	
+}
 
-		if (dev->priv)
-			status = 0;
-		if (iobase == 0)
-			autoprobed = 1;
-	}
+static int __init ewrk3_probe1(struct net_device *dev, u_long iobase, int irq)
+{
+	int err;
 
-	return status;
+	dev->base_addr = iobase;
+	dev->irq = irq;
+
+	/* Address PROM pattern */
+	err = isa_probe(dev, iobase);
+	if (err != 0) 
+		err = eisa_probe(dev, iobase);
+
+	if (err)
+		return err;
+
+	err = register_netdev(dev);
+	if (err)
+		release_region(dev->base_addr, EWRK3_TOTAL_SIZE);
+
+	return err;
 }
 
 static int __init 
@@ -396,8 +397,8 @@
 	u_char eeprom_image[EEPROM_MAX], chksum, eisa_cr = 0;
 
 	/*
-	   ** Stop the EWRK3. Enable the DBR ROM. Disable interrupts and remote boot.
-	   ** This also disables the EISA_ENABLE bit in the EISA Control Register.
+	** Stop the EWRK3. Enable the DBR ROM. Disable interrupts and remote boot.
+	** This also disables the EISA_ENABLE bit in the EISA Control Register.
 	 */
 	if (iobase > 0x400)
 		eisa_cr = inb(EISA_CR);
@@ -409,232 +410,210 @@
 	icr &= 0x70;
 	outb(icr, EWRK3_ICR);	/* Disable all the IRQs */
 
-	if (nicsr == (CSR_TXD | CSR_RXD)) {
+	if (nicsr == (CSR_TXD | CSR_RXD))
+		return -ENXIO;
 
-		/* Check that the EEPROM is alive and well and not living on Pluto... */
-		for (chksum = 0, i = 0; i < EEPROM_MAX; i += 2) {
-			union {
-				short val;
-				char c[2];
-			} tmp;
-
-			tmp.val = (short) Read_EEPROM(iobase, (i >> 1));
-			eeprom_image[i] = tmp.c[0];
-			eeprom_image[i + 1] = tmp.c[1];
-			chksum += eeprom_image[i] + eeprom_image[i + 1];
-		}
-
-		if (chksum != 0) {	/* Bad EEPROM Data! */
-			printk("%s: Device has a bad on-board EEPROM.\n", dev->name);
-			status = -ENXIO;
-		} else {
-			EthwrkSignature(name, eeprom_image);
-			if (*name != '\0') {	/* found a EWRK3 device */
-				dev->base_addr = iobase;
-
-				if (iobase > 0x400) {
-					outb(eisa_cr, EISA_CR);		/* Rewrite the EISA CR */
-				}
-				lemac = eeprom_image[EEPROM_CHIPVER];
-				cmr = inb(EWRK3_CMR);
-
-				if (((lemac == LeMAC) && ((cmr & CMR_NO_EEPROM) != CMR_NO_EEPROM)) ||
-				((lemac == LeMAC2) && !(cmr & CMR_HS))) {
-					printk("%s: %s at %#4lx", dev->name, name, iobase);
-					hard_strapped = 1;
-				} else if ((iobase & 0x0fff) == EWRK3_EISA_IO_PORTS) {
-					/* EISA slot address */
-					printk("%s: %s at %#4lx (EISA slot %ld)",
-					       dev->name, name, iobase, ((iobase >> 12) & 0x0f));
-				} else {	/* ISA port address */
-					printk("%s: %s at %#4lx", dev->name, name, iobase);
-				}
-
-				if (!status) {
-					printk(", h/w address ");
-					if (lemac != LeMAC2)
-						DevicePresent(iobase);	/* need after EWRK3_INIT */
-					status = get_hw_addr(dev, eeprom_image, lemac);
-					for (i = 0; i < ETH_ALEN - 1; i++) {	/* get the ethernet addr. */
-						printk("%2.2x:", dev->dev_addr[i]);
-					}
-					printk("%2.2x,\n", dev->dev_addr[i]);
 
-					if (status) {
-						printk("      which has an EEPROM CRC error.\n");
-						status = -ENXIO;
-					} else {
-						if (lemac == LeMAC2) {	/* Special LeMAC2 CMR things */
-							cmr &= ~(CMR_RA | CMR_WB | CMR_LINK | CMR_POLARITY | CMR_0WS);
-							if (eeprom_image[EEPROM_MISC0] & READ_AHEAD)
-								cmr |= CMR_RA;
-							if (eeprom_image[EEPROM_MISC0] & WRITE_BEHIND)
-								cmr |= CMR_WB;
-							if (eeprom_image[EEPROM_NETMAN0] & NETMAN_POL)
-								cmr |= CMR_POLARITY;
-							if (eeprom_image[EEPROM_NETMAN0] & NETMAN_LINK)
-								cmr |= CMR_LINK;
-							if (eeprom_image[EEPROM_MISC0] & _0WS_ENA)
-								cmr |= CMR_0WS;
-						}
-						if (eeprom_image[EEPROM_SETUP] & SETUP_DRAM)
-							cmr |= CMR_DRAM;
-						outb(cmr, EWRK3_CMR);
-
-						cr = inb(EWRK3_CR);	/* Set up the Control Register */
-						cr |= eeprom_image[EEPROM_SETUP] & SETUP_APD;
-						if (cr & SETUP_APD)
-							cr |= eeprom_image[EEPROM_SETUP] & SETUP_PS;
-						cr |= eeprom_image[EEPROM_MISC0] & FAST_BUS;
-						cr |= eeprom_image[EEPROM_MISC0] & ENA_16;
-						outb(cr, EWRK3_CR);
+	/* Check that the EEPROM is alive and well and not living on Pluto... */
+	for (chksum = 0, i = 0; i < EEPROM_MAX; i += 2) {
+		union {
+			short val;
+			char c[2];
+		} tmp;
+
+		tmp.val = (short) Read_EEPROM(iobase, (i >> 1));
+		eeprom_image[i] = tmp.c[0];
+		eeprom_image[i + 1] = tmp.c[1];
+		chksum += eeprom_image[i] + eeprom_image[i + 1];
+	}
+
+	if (chksum != 0) {	/* Bad EEPROM Data! */
+		printk("%s: Device has a bad on-board EEPROM.\n", dev->name);
+		return -ENXIO;
+	}
+	
+	EthwrkSignature(name, eeprom_image);
+	if (*name == '\0') 
+		return -ENXIO;
+
+	dev->base_addr = iobase;
+				
+	if (iobase > 0x400) {
+		outb(eisa_cr, EISA_CR);		/* Rewrite the EISA CR */
+	}
+	lemac = eeprom_image[EEPROM_CHIPVER];
+	cmr = inb(EWRK3_CMR);
+	
+	if (((lemac == LeMAC) && ((cmr & CMR_NO_EEPROM) != CMR_NO_EEPROM)) ||
+	    ((lemac == LeMAC2) && !(cmr & CMR_HS))) {
+		printk("%s: %s at %#4lx", dev->name, name, iobase);
+		hard_strapped = 1;
+	} else if ((iobase & 0x0fff) == EWRK3_EISA_IO_PORTS) {
+		/* EISA slot address */
+		printk("%s: %s at %#4lx (EISA slot %ld)",
+		       dev->name, name, iobase, ((iobase >> 12) & 0x0f));
+	} else {	/* ISA port address */
+		printk("%s: %s at %#4lx", dev->name, name, iobase);
+	}
+
+	printk(", h/w address ");
+	if (lemac != LeMAC2)
+		DevicePresent(iobase);	/* need after EWRK3_INIT */
+	status = get_hw_addr(dev, eeprom_image, lemac);
+	for (i = 0; i < ETH_ALEN - 1; i++) {	/* get the ethernet addr. */
+		printk("%2.2x:", dev->dev_addr[i]);
+	}
+	printk("%2.2x,\n", dev->dev_addr[i]);
+	
+	if (status) {
+		printk("      which has an EEPROM CRC error.\n");
+		return -ENXIO;
+	}
+
+	if (lemac == LeMAC2) {	/* Special LeMAC2 CMR things */
+		cmr &= ~(CMR_RA | CMR_WB | CMR_LINK | CMR_POLARITY | CMR_0WS);
+		if (eeprom_image[EEPROM_MISC0] & READ_AHEAD)
+			cmr |= CMR_RA;
+		if (eeprom_image[EEPROM_MISC0] & WRITE_BEHIND)
+			cmr |= CMR_WB;
+		if (eeprom_image[EEPROM_NETMAN0] & NETMAN_POL)
+			cmr |= CMR_POLARITY;
+		if (eeprom_image[EEPROM_NETMAN0] & NETMAN_LINK)
+			cmr |= CMR_LINK;
+		if (eeprom_image[EEPROM_MISC0] & _0WS_ENA)
+			cmr |= CMR_0WS;
+	}
+	if (eeprom_image[EEPROM_SETUP] & SETUP_DRAM)
+		cmr |= CMR_DRAM;
+	outb(cmr, EWRK3_CMR);
+	
+	cr = inb(EWRK3_CR);	/* Set up the Control Register */
+	cr |= eeprom_image[EEPROM_SETUP] & SETUP_APD;
+	if (cr & SETUP_APD)
+		cr |= eeprom_image[EEPROM_SETUP] & SETUP_PS;
+	cr |= eeprom_image[EEPROM_MISC0] & FAST_BUS;
+	cr |= eeprom_image[EEPROM_MISC0] & ENA_16;
+	outb(cr, EWRK3_CR);
 
-						/*
-						   ** Determine the base address and window length for the EWRK3
-						   ** RAM from the memory base register.
-						 */
-						mem_start = inb(EWRK3_MBR);
-						shmem_length = 0;
-						if (mem_start != 0) {
-							if ((mem_start >= 0x0a) && (mem_start <= 0x0f)) {
-								mem_start *= SHMEM_64K;
-								shmem_length = SHMEM_64K;
-							} else if ((mem_start >= 0x14) && (mem_start <= 0x1f)) {
-								mem_start *= SHMEM_32K;
-								shmem_length = SHMEM_32K;
-							} else if ((mem_start >= 0x40) && (mem_start <= 0xff)) {
-								mem_start = mem_start * SHMEM_2K + 0x80000;
-								shmem_length = SHMEM_2K;
-							} else {
-								status = -ENXIO;
-							}
-						}
-						/*
-						   ** See the top of this source code for comments about
-						   ** uncommenting this line.
-						 */
+	/*
+	** Determine the base address and window length for the EWRK3
+	** RAM from the memory base register.
+	*/
+	mem_start = inb(EWRK3_MBR);
+	shmem_length = 0;
+	if (mem_start != 0) {
+		if ((mem_start >= 0x0a) && (mem_start <= 0x0f)) {
+			mem_start *= SHMEM_64K;
+			shmem_length = SHMEM_64K;
+		} else if ((mem_start >= 0x14) && (mem_start <= 0x1f)) {
+			mem_start *= SHMEM_32K;
+			shmem_length = SHMEM_32K;
+		} else if ((mem_start >= 0x40) && (mem_start <= 0xff)) {
+			mem_start = mem_start * SHMEM_2K + 0x80000;
+			shmem_length = SHMEM_2K;
+		} else {
+			return -ENXIO;
+		}
+	}
+	/*
+	** See the top of this source code for comments about
+	** uncommenting this line.
+	*/
 /*          FORCE_2K_MODE; */
+	
+	if (hard_strapped) {
+		printk("      is hard strapped.\n");
+	} else if (mem_start) {
+		printk("      has a %dk RAM window", (int) (shmem_length >> 10));
+		printk(" at 0x%.5lx", mem_start);
+	} else {
+		printk("      is in I/O only mode");
+	}
 
-						if (!status) {
-							if (hard_strapped) {
-								printk("      is hard strapped.\n");
-							} else if (mem_start) {
-								printk("      has a %dk RAM window", (int) (shmem_length >> 10));
-								printk(" at 0x%.5lx", mem_start);
-							} else {
-								printk("      is in I/O only mode");
-							}
-
-							/* private area & initialise */
-							dev->priv = (void *) kmalloc(sizeof(struct ewrk3_private),
-							     GFP_KERNEL);
-							if (dev->priv == NULL) {
-								return -ENOMEM;
-							}
-							lp = (struct ewrk3_private *) dev->priv;
-							memset(dev->priv, 0, sizeof(struct ewrk3_private));
-							lp->shmem_base = mem_start;
-							lp->shmem_length = shmem_length;
-							lp->lemac = lemac;
-							lp->hard_strapped = hard_strapped;
-							lp->led_mask = CR_LED;
-							spin_lock_init(&lp->hw_lock);
-
-							lp->mPage = 64;
-							if (cmr & CMR_DRAM)
-								lp->mPage <<= 1;	/* 2 DRAMS on module */
-
-							sprintf(lp->adapter_name, "%s (%s)", name, dev->name);
-							request_region(iobase, EWRK3_TOTAL_SIZE, lp->adapter_name);
-
-							lp->irq_mask = ICR_TNEM | ICR_TXDM | ICR_RNEM | ICR_RXDM;
-
-							if (!hard_strapped) {
-								/*
-								   ** Enable EWRK3 board interrupts for autoprobing
-								 */
-								icr |= ICR_IE;	/* Enable interrupts */
-								outb(icr, EWRK3_ICR);
-
-								/* The DMA channel may be passed in on this parameter. */
-								dev->dma = 0;
-
-								/* To auto-IRQ we enable the initialization-done and DMA err,
-								   interrupts. For now we will always get a DMA error. */
-								if (dev->irq < 2) {
+	lp = (struct ewrk3_private *) dev->priv;
+	lp->shmem_base = mem_start;
+	lp->shmem_length = shmem_length;
+	lp->lemac = lemac;
+	lp->hard_strapped = hard_strapped;
+	lp->led_mask = CR_LED;
+	spin_lock_init(&lp->hw_lock);
+	
+	lp->mPage = 64;
+	if (cmr & CMR_DRAM)
+		lp->mPage <<= 1;	/* 2 DRAMS on module */
+	
+	sprintf(lp->adapter_name, "%s (%s)", name, dev->name);
+	
+	lp->irq_mask = ICR_TNEM | ICR_TXDM | ICR_RNEM | ICR_RXDM;
+	
+	if (!hard_strapped) {
+		/*
+		** Enable EWRK3 board interrupts for autoprobing
+		*/
+		icr |= ICR_IE;	/* Enable interrupts */
+		outb(icr, EWRK3_ICR);
+		
+		/* The DMA channel may be passed in on this parameter. */
+		dev->dma = 0;
+		
+		/* To auto-IRQ we enable the initialization-done and DMA err,
+		   interrupts. For now we will always get a DMA error. */
+		if (dev->irq < 2) {
 #ifndef MODULE
-									u_char irqnum;
-									unsigned long irq_mask;
+			u_char irqnum;
+			unsigned long irq_mask;
 			
 
-									irq_mask = probe_irq_on();
-
-									/*
-									   ** Trigger a TNE interrupt.
-									 */
-									icr |= ICR_TNEM;
-									outb(1, EWRK3_TDQ);	/* Write to the TX done queue */
-									outb(icr, EWRK3_ICR);	/* Unmask the TXD interrupt */
-
-									irqnum = irq[((icr & IRQ_SEL) >> 4)];
-
-									mdelay(20);
-									dev->irq = probe_irq_off(irq_mask);
-									if ((dev->irq) && (irqnum == dev->irq)) {
-										printk(" and uses IRQ%d.\n", dev->irq);
-									} else {
-										if (!dev->irq) {
-											printk(" and failed to detect IRQ line.\n");
-										} else if ((irqnum == 1) && (lemac == LeMAC2)) {
-											printk(" and an illegal IRQ line detected.\n");
-										} else {
-											printk(", but incorrect IRQ line detected.\n");
-										}
-										status = -ENXIO;
-									}
-
-									DISABLE_IRQs;	/* Mask all interrupts */
-
-#endif				/* MODULE */
-								} else {
-									printk(" and requires IRQ%d.\n", dev->irq);
-								}
-							}
-							if (status)
-								release_region(iobase, EWRK3_TOTAL_SIZE);
-						} else {
-							status = -ENXIO;
-						}
-					}
-				}
+			irq_mask = probe_irq_on();
+			
+			/*
+			** Trigger a TNE interrupt.
+			*/
+			icr |= ICR_TNEM;
+			outb(1, EWRK3_TDQ);	/* Write to the TX done queue */
+			outb(icr, EWRK3_ICR);	/* Unmask the TXD interrupt */
+			
+			irqnum = irq[((icr & IRQ_SEL) >> 4)];
+			
+			mdelay(20);
+			dev->irq = probe_irq_off(irq_mask);
+			if ((dev->irq) && (irqnum == dev->irq)) {
+				printk(" and uses IRQ%d.\n", dev->irq);
 			} else {
-				status = -ENXIO;
-			}
-		}
-
-		if (!status) {
-			if (ewrk3_debug > 1) {
-				printk(version);
+				if (!dev->irq) {
+					printk(" and failed to detect IRQ line.\n");
+				} else if ((irqnum == 1) && (lemac == LeMAC2)) {
+					printk(" and an illegal IRQ line detected.\n");
+				} else {
+					printk(", but incorrect IRQ line detected.\n");
+				}
+				return -ENXIO;
 			}
-			/* The EWRK3-specific entries in the device structure. */
-			dev->open = ewrk3_open;
-			dev->hard_start_xmit = ewrk3_queue_pkt;
-			dev->stop = ewrk3_close;
-			dev->get_stats = ewrk3_get_stats;
-			dev->set_multicast_list = set_multicast_list;
-			dev->do_ioctl = ewrk3_ioctl;
-			dev->tx_timeout = ewrk3_timeout;
-			dev->watchdog_timeo = QUEUE_PKT_TIMEOUT;
 
-			dev->mem_start = 0;
+			DISABLE_IRQs;	/* Mask all interrupts */
 
-			/* Fill in the generic field of the device structure. */
-			ether_setup(dev);
+#endif				/* MODULE */
+		} else {
+			printk(" and requires IRQ%d.\n", dev->irq);
 		}
-	} else {
-		status = -ENXIO;
 	}
-	return status;
+
+	if (ewrk3_debug > 1) {
+		printk(version);
+	}
+	/* The EWRK3-specific entries in the device structure. */
+	dev->open = ewrk3_open;
+	dev->hard_start_xmit = ewrk3_queue_pkt;
+	dev->stop = ewrk3_close;
+	dev->get_stats = ewrk3_get_stats;
+	dev->set_multicast_list = set_multicast_list;
+	dev->do_ioctl = ewrk3_ioctl;
+	dev->tx_timeout = ewrk3_timeout;
+	dev->watchdog_timeo = QUEUE_PKT_TIMEOUT;
+	
+	dev->mem_start = 0;
+
+	return 0;
 }
 
 
@@ -1269,15 +1248,15 @@
 /*
    ** ISA bus I/O device probe
  */
-static void __init isa_probe(struct net_device *dev, u_long ioaddr)
+static int __init isa_probe(struct net_device *dev, u_long ioaddr)
 {
-	int i = num_ewrk3s, maxSlots;
+	int i = num_ewrks3s, maxSlots;
+	int ret = -ENODEV;
+
 	u_long iobase;
 
-	if (!ioaddr && autoprobed)
-		return;		/* Been here before ! */
 	if (ioaddr >= 0x400)
-		return;		/* Not ISA */
+		goto out;
 
 	if (ioaddr == 0) {	/* Autoprobing */
 		iobase = EWRK3_IO_BASE;		/* Get the first slot address */
@@ -1287,38 +1266,37 @@
 		maxSlots = i + 1;
 	}
 
-	for (; (i < maxSlots) && (dev != NULL); iobase += EWRK3_IOP_INC, i++) {
-		if (!check_region(iobase, EWRK3_TOTAL_SIZE)) {
+	for (; (i < maxSlots) && (dev != NULL);
+	     iobase += EWRK3_IOP_INC, i++)
+	{
+		if (request_region(iobase, EWRK3_TOTAL_SIZE, dev->name)) {
 			if (DevicePresent(iobase) == 0) {
-				if ((dev = alloc_device(dev, iobase)) != NULL) {
-					if (ewrk3_hw_init(dev, iobase) == 0) {
-						num_ewrk3s++;
-					}
-					num_eth++;
-				}
+				int irq = dev->irq;
+				ret = ewrk3_hw_init(dev, iobase);
+				if (!ret)
+					break;
+				dev->irq = irq;
 			}
-		} else if (autoprobed) {
-			printk("%s: region already allocated at 0x%04lx.\n", dev->name, iobase);
+			release_region(iobase, EWRK3_TOTAL_SIZE);
 		}
 	}
+ out:
 
-	return;
+	return ret;
 }
 
 /*
    ** EISA bus I/O device probe. Probe from slot 1 since slot 0 is usually
    ** the motherboard.
  */
-static void __init eisa_probe(struct net_device *dev, u_long ioaddr)
+static int __init eisa_probe(struct net_device *dev, u_long ioaddr)
 {
 	int i, maxSlots;
 	u_long iobase;
-	char name[EWRK3_STRLEN];
+	int ret = -ENODEV;
 
-	if (!ioaddr && autoprobed)
-		return;		/* Been here before ! */
 	if (ioaddr < 0x1000)
-		return;		/* Not EISA */
+		goto out;
 
 	if (ioaddr == 0) {	/* Autoprobing */
 		iobase = EISA_SLOT_INC;		/* Get the first slot address */
@@ -1332,114 +1310,22 @@
 
 	for (i = 1; (i < maxSlots) && (dev != NULL); i++, iobase += EISA_SLOT_INC) {
 		if (EISA_signature(name, EISA_ID) == 0) {
-			if (!check_region(iobase, EWRK3_TOTAL_SIZE)) {
-				if (DevicePresent(iobase) == 0) {
-					if ((dev = alloc_device(dev, iobase)) != NULL) {
-						if (ewrk3_hw_init(dev, iobase) == 0) {
-							num_ewrk3s++;
-						}
-						num_eth++;
-					}
-				}
-			} else if (autoprobed) {
-				printk("%s: region already allocated at 0x%04lx.\n", dev->name, iobase);
+			if (request_region(iobase, EWRK3_TOTAL_SIZE, dev->name) &&
+			    DevicePresent(iobase) == 0) {
+				int irq = dev->irq;
+				ret = ewrk3_hw_init(dev, iobase);
+				if (!ret)
+					break;
+				dev->irq = irq;
 			}
+			release_region(iobase, EWRK3_TOTAL_SIZE);
 		}
 	}
 
-	return;
+ out:
+	return ret;
 }
 
-/*
-   ** Search the entire 'eth' device list for a fixed probe. If a match isn't
-   ** found then check for an autoprobe or unused device location. If they
-   ** are not available then insert a new device structure at the end of
-   ** the current list.
- */
-static struct net_device * __init  alloc_device(struct net_device *dev, u_long iobase)
-{
-	struct net_device *adev = NULL;
-	int fixed = 0, new_dev = 0;
-
-	num_eth = ewrk3_dev_index(dev->name);
-	if (loading_module)
-		return dev;
-
-	while (1) {
-		if (((dev->base_addr == EWRK3_NDA) || (dev->base_addr == 0)) && !adev) {
-			adev = dev;
-		} else if ((dev->priv == NULL) && (dev->base_addr == iobase)) {
-			fixed = 1;
-		} else {
-			if (dev->next == NULL) {
-				new_dev = 1;
-			} else if (strncmp(dev->next->name, "eth", 3) != 0) {
-				new_dev = 1;
-			}
-		}
-		if ((dev->next == NULL) || new_dev || fixed)
-			break;
-		dev = dev->next;
-		num_eth++;
-	}
-	if (adev && !fixed) {
-		dev = adev;
-		num_eth = ewrk3_dev_index(dev->name);
-		new_dev = 0;
-	}
-	if (((dev->next == NULL) &&
-	     ((dev->base_addr != EWRK3_NDA) && (dev->base_addr != 0)) && !fixed) ||
-	    new_dev) {
-		num_eth++;	/* New device */
-		dev = insert_device(dev, iobase, ewrk3_probe);
-	}
-	return dev;
-}
-
-/*
-   ** If at end of eth device list and can't use current entry, malloc
-   ** one up. If memory could not be allocated, print an error message.
- */
-static struct net_device * __init
-insert_device(struct net_device *dev, u_long iobase, int (*init) (struct net_device *))
-{
-	struct net_device *new;
-
-	new = (struct net_device *) kmalloc(sizeof(struct net_device) + 8, GFP_KERNEL);
-	if (new == NULL) {
-		printk("eth%d: Device not initialised, insufficient memory\n", num_eth);
-		return NULL;
-	} else {
-		new->next = dev->next;
-		dev->next = new;
-		dev = dev->next;	/* point to the new device */
-		if (num_eth > 9999) {
-			sprintf(dev->name, "eth????");	/* New device name */
-		} else {
-			sprintf(dev->name, "eth%d", num_eth);	/* New device name */
-		}
-		dev->base_addr = iobase;	/* assign the io address */
-		dev->init = init;	/* initialisation routine */
-	}
-
-	return dev;
-}
-
-static int __init 
-ewrk3_dev_index(char *s)
-{
-	int i = 0, j = 0;
-
-	for (; *s; s++) {
-		if (isdigit(*s)) {
-			j = 1;
-			i = (i * 10) + (*s - '0');
-		} else if (j)
-			break;
-	}
-
-	return i;
-}
 
 /*
    ** Read the EWRK3 EEPROM using this routine
@@ -2074,8 +1960,7 @@
 #ifdef MODULE
 static struct net_device *ewrk3_devs[MAX_NUM_EWRK3S];
 static int ndevs;
-static int io[MAX_NUM_EWRK3S+1] = { 0x300, 0, };	/* <--- EDIT THESE LINES FOR YOUR CONFIGURATION */
-static int irq[MAX_NUM_EWRK3S+1] = { 5, 0, };		/* or use the insmod io= irq= options           */
+static int io[MAX_NUM_EWRK3S+1] = { 0x300, 0, };
 
 /* '21' below should really be 'MAX_NUM_EWRK3S' */
 MODULE_PARM(io, "0-21i");
@@ -2083,50 +1968,39 @@
 MODULE_PARM_DESC(io, "EtherWORKS 3 I/O base address(es)");
 MODULE_PARM_DESC(irq, "EtherWORKS 3 IRQ number(s)");
 
-static void ewrk3_exit_module(void)
+static __exit void ewrk3_exit_module(void)
 {
 	int i;
 
 	for( i=0; i<ndevs; i++ ) {
 		unregister_netdev(ewrk3_devs[i]);
-		if (ewrk3_devs[i]->priv) {
-			kfree(ewrk3_devs[i]->priv);
-			ewrk3_devs[i]->priv = NULL;
-		}
-		ewrk3_devs[i]->irq = 0;
-
 		release_region(ewrk3_devs[i]->base_addr, EWRK3_TOTAL_SIZE);
 		free_netdev(ewrk3_devs[i]);
 		ewrk3_devs[i] = NULL;
 	}
 }
 
-static int ewrk3_init_module(void)
+static __init int ewrk3_init_module(void)
 {
 	int i=0;
 
 	while( io[i] && irq[i] ) {
-		ewrk3_devs[ndevs] = kmalloc(sizeof(struct net_device), GFP_KERNEL);
-		if (!ewrk3_devs[ndevs])
-			goto error; 
-		memset(ewrk3_devs[ndevs], 0, sizeof(struct net_device));
-		ewrk3_devs[ndevs]->base_addr = io[i];
-		ewrk3_devs[ndevs]->irq = irq[i];
-		ewrk3_devs[ndevs]->init = ewrk3_probe;
-
-		if (register_netdev(ewrk3_devs[ndevs]) == 0)
-			ndevs++;
-		else
-			kfree(ewrk3_devs[ndevs]);
+		struct net_device *dev
+			= alloc_etherdev(sizeof(struct ewrk3_private));
+
+		if (!dev)
+			break;
 
+		if (ewrk3_probe1(dev, io[i], irq[i]) != 0) {
+			free_netdev(dev);
+			break;
+		}
+
+		ewrk3_devs[ndevs++] = dev;
 		i++;
 	}
 
 	return ndevs ? 0 : -EIO;
-
-error:
-	ewrk3_exit_module();
-	return -ENOMEM;
 }
 
 
--- diff/drivers/net/fc/iph5526.c	2003-09-30 15:46:15.000000000 +0100
+++ source/drivers/net/fc/iph5526.c	2004-02-09 10:39:53.000000000 +0000
@@ -259,6 +259,7 @@
 
 static int __init fcdev_init(struct net_device *dev)
 {
+	SET_MODULE_OWNER(dev);
 	dev->open = iph5526_open;
 	dev->stop = iph5526_close;
 	dev->hard_start_xmit = iph5526_send_packet;
@@ -2896,14 +2897,12 @@
 static int iph5526_open(struct net_device *dev)
 {
 	netif_start_queue(dev);
-	MOD_INC_USE_COUNT;
 	return 0;
 }
 
 static int iph5526_close(struct net_device *dev)
 {
 	netif_stop_queue(dev);
-	MOD_DEC_USE_COUNT;
 	return 0;
 }
 
@@ -4502,7 +4501,7 @@
 		iph5526_probe_pci(dev);
 		err = register_netdev(dev);
 		if (err < 0) {
-			kfree(dev);
+			free_netdev(dev);
 			printk("iph5526.c: init_fcdev failed for card #%d\n", i+1);
 			break;
 		}
--- diff/drivers/net/fc/iph5526_scsi.h	2002-12-16 09:26:06.000000000 +0000
+++ source/drivers/net/fc/iph5526_scsi.h	2004-02-09 10:39:53.000000000 +0000
@@ -25,7 +25,7 @@
 int iph5526_release(struct Scsi_Host *host);
 int iph5526_abort(Scsi_Cmnd *Cmnd);
 const char *iph5526_info(struct Scsi_Host *host);
-int iph5526_biosparam(Disk * disk, struct block_device *n, int ip[]);
+int iph5526_biosparam(struct Scsi_Disk * disk, struct block_device *n, int ip[]);
 
 #endif
 
--- diff/drivers/net/fealnx.c	2003-09-17 12:28:07.000000000 +0100
+++ source/drivers/net/fealnx.c	2004-02-09 10:39:53.000000000 +0000
@@ -1426,7 +1426,7 @@
 	writel(0, dev->base_addr + IMR);
 
 	ioaddr = dev->base_addr;
-	np = (struct netdev_private *) dev->priv;
+	np = dev->priv;
 
 	do {
 		u32 intr_status = readl(ioaddr + ISR);
--- diff/drivers/net/fec.c	2003-06-09 14:18:19.000000000 +0100
+++ source/drivers/net/fec.c	2004-02-09 10:39:53.000000000 +0000
@@ -1638,9 +1638,12 @@
 
 /* Initialize the FEC Ethernet on 860T (or ColdFire 5272).
  */
+ /*
+  * XXX:  We need to clean up on failure exits here.
+  */
 int __init fec_enet_init(struct net_device *dev)
 {
-	struct fec_enet_private *fep;
+	struct fec_enet_private *fep = dev->priv;
 	unsigned long	mem_addr;
 	volatile cbd_t	*bdp;
 	cbd_t		*cbd_base;
@@ -1651,13 +1654,6 @@
 	if (found)
 		return(-ENXIO);
 
-	/* Allocate some private information.
-	*/
-	fep = (struct fec_enet_private *)kmalloc(sizeof(*fep), GFP_KERNEL);
-	if (!fep)
-		return -ENOMEM;
-	memset(fep, 0, sizeof(*fep));
-
 	/* Create an Ethernet device instance.
 	*/
 	fecp = fec_hwp;
@@ -1694,6 +1690,7 @@
 	}
 	mem_addr = __get_free_page(GFP_KERNEL);
 	cbd_base = (cbd_t *)mem_addr;
+	/* XXX: missing check for allocation failure */
 
 	fec_uncache(mem_addr);
 
@@ -1715,6 +1712,7 @@
 		/* Allocate a page.
 		*/
 		mem_addr = __get_free_page(GFP_KERNEL);
+		/* XXX: missing check for allocation failure */
 
 		fec_uncache(mem_addr);
 
@@ -1761,9 +1759,6 @@
 	fec_request_intrs(dev, fecp);
 
 	dev->base_addr = (unsigned long)fecp;
-	dev->priv = fep;
-
-	ether_setup(dev);
 
 	/* The FEC Ethernet specific entries in the device structure. */
 	dev->open = fec_enet_open;
@@ -1949,14 +1944,28 @@
 	fecp->fec_mii_speed = fep->phy_speed;
 }
 
-static struct net_device fec_dev = {
-	.init = fec_enet_init,
-};
+static struct net_device *fec_dev;
 
 static int __init fec_enet_module_init(void)
 {
-	if (register_netdev(&fec_dev) != 0)
+	struct net_device *dev;
+	int err;
+
+	dev = alloc_etherdev(sizeof(struct fec_enet_private));
+	if (!dev)
+		return -ENOMEM;
+	err = fec_enet_init(dev);
+	if (err) {
+		free_netdev(dev);
+		return err;
+	}
+
+	if (register_netdev(dev) != 0) {
+		/* XXX: missing cleanup here */
+		free_netdev(dev);
 		return -EIO;
+	}
+	fec_dev = dev;
 	return(0);
 }
 
--- diff/drivers/net/fmv18x.c	2003-09-17 12:28:08.000000000 +0100
+++ source/drivers/net/fmv18x.c	2004-02-09 10:39:53.000000000 +0000
@@ -57,7 +57,7 @@
 #include <asm/io.h>
 #include <asm/dma.h>
 
-static int fmv18x_probe_list[] __initdata = {
+static unsigned fmv18x_probe_list[] __initdata = {
 	0x220, 0x240, 0x260, 0x280, 0x2a0, 0x2c0, 0x300, 0x340, 0
 };
 
@@ -109,8 +109,6 @@
 
 /* Index to functions, as function prototypes. */
 
-extern int fmv18x_probe(struct net_device *dev);
-
 static int fmv18x_probe1(struct net_device *dev, short ioaddr);
 static int net_open(struct net_device *dev);
 static int net_send_packet(struct sk_buff *skb, struct net_device *dev);
@@ -129,23 +127,50 @@
    (detachable devices only).
    */
 
-int __init fmv18x_probe(struct net_device *dev)
+static int io = 0x220;
+static int irq;
+
+struct net_device * __init fmv18x_probe(int unit)
 {
-	int i;
-	int base_addr = dev->base_addr;
+	struct net_device *dev = alloc_etherdev(sizeof(struct net_local));
+	unsigned *port;
+	int err = 0;
+
+	if (!dev)
+		return ERR_PTR(-ENODEV);
+
+	if (unit >= 0) {
+		sprintf(dev->name, "eth%d", unit);
+		netdev_boot_setup_check(dev);
+		io = dev->base_addr;
+		irq = dev->irq;
+	}
 
 	SET_MODULE_OWNER(dev);
 
-	if (base_addr > 0x1ff)		/* Check a single specified location. */
-		return fmv18x_probe1(dev, base_addr);
-	else if (base_addr != 0)	/* Don't probe at all. */
-		return -ENXIO;
-
-	for (i = 0; fmv18x_probe_list[i]; i++)
-		if (fmv18x_probe1(dev, fmv18x_probe_list[i]) == 0)
-			return 0;
-
-	return -ENODEV;
+	if (io > 0x1ff) {	/* Check a single specified location. */
+		err = fmv18x_probe1(dev, io);
+	} else if (io != 0) {	/* Don't probe at all. */
+		err = -ENXIO;
+	} else {
+		for (port = fmv18x_probe_list; *port; port++)
+			if (fmv18x_probe1(dev, *port) == 0)
+				break;
+		if (!*port)
+			err = -ENODEV;
+	}
+	if (err)
+		goto out;
+	err = register_netdev(dev);
+	if (err)
+		goto out1;
+	return dev;
+out1:
+	free_irq(dev->irq, dev);
+	release_region(dev->base_addr, FMV18X_IO_EXTENT);
+out:
+	free_netdev(dev);
+	return ERR_PTR(err);
 }
 
 /* The Fujitsu datasheet suggests that the NIC be probed for by checking its
@@ -160,7 +185,7 @@
 {
 	char irqmap[4] = {3, 7, 10, 15};
 	char irqmap_pnp[8] = {3, 4, 5, 7, 9, 10, 11, 15};
-	unsigned int i, irq, retval;
+	unsigned int i, retval;
 	struct net_local *lp;
 
 	/* Resetting the chip doesn't reset the ISA interface, so don't bother.
@@ -170,6 +195,9 @@
 	if (!request_region(ioaddr, FMV18X_IO_EXTENT, dev->name))
 		return -EBUSY;
 
+	dev->irq = irq;
+	dev->base_addr = ioaddr;
+
 	/* Check I/O address configuration and Fujitsu vendor code */
 	if (inb(ioaddr+FJ_MACADDR  ) != 0x00
 	||  inb(ioaddr+FJ_MACADDR+1) != 0x00
@@ -181,9 +209,8 @@
 	/* Check PnP mode for FMV-183/184/183A/184A. */
 	/* This PnP routine is very poor. IO and IRQ should be known. */
 	if (inb(ioaddr + FJ_STATUS1) & 0x20) {
-		irq = dev->irq;
 		for (i = 0; i < 8; i++) {
-			if (irq == irqmap_pnp[i])
+			if (dev->irq == irqmap_pnp[i])
 				break;
 		}
 		if (i == 8) {
@@ -193,22 +220,19 @@
 	} else {
 		if (fmv18x_probe_list[inb(ioaddr + FJ_CONFIG0) & 0x07] != ioaddr)
 			return -ENODEV;
-		irq = irqmap[(inb(ioaddr + FJ_CONFIG0)>>6) & 0x03];
+		dev->irq = irqmap[(inb(ioaddr + FJ_CONFIG0)>>6) & 0x03];
 	}
 
 	/* Snarf the interrupt vector now. */
-	retval = request_irq(irq, &net_interrupt, 0, dev->name, dev);
+	retval = request_irq(dev->irq, &net_interrupt, 0, dev->name, dev);
 	if (retval) {
 		printk ("FMV-18x found at %#3x, but it's unusable due to a conflict on"
-				"IRQ %d.\n", ioaddr, irq);
+				"IRQ %d.\n", ioaddr, dev->irq);
 		goto out;
 	}
 
 	printk("%s: FMV-18x found at %#3x, IRQ %d, address ", dev->name,
-		   ioaddr, irq);
-
-	dev->base_addr = ioaddr;
-	dev->irq = irq;
+		   ioaddr, dev->irq);
 
 	for(i = 0; i < 6; i++) {
 		unsigned char val = inb(ioaddr + FJ_MACADDR + i);
@@ -279,14 +303,10 @@
 	dev->watchdog_timeo	= HZ/10;
 	dev->get_stats		= net_get_stats;
 	dev->set_multicast_list = set_multicast_list;
-
-	/* Fill in the fields of 'dev' with ethernet-generic values. */
-
-	ether_setup(dev);
 	return 0;
 
 out_irq:
-	free_irq(irq, dev);
+	free_irq(dev->irq, dev);
 out:
 	release_region(ioaddr, FMV18X_IO_EXTENT);
 	return retval;
@@ -413,9 +433,7 @@
 		lp->tx_queue_len = 0;
 		dev->trans_start = jiffies;
 		lp->tx_started = 1;
-	} else if (lp->tx_queue_len < 4096 - 1502)
-		/* Yes, there is room for one more packet. */
-	else
+	} else if (lp->tx_queue_len >= 4096 - 1502) /* No room for a packet */
 		netif_stop_queue(dev);
 
 	dev_kfree_skb(skb);
@@ -628,9 +646,7 @@
 }
 
 #ifdef MODULE
-static struct net_device dev_fmv18x;
-static int io = 0x220;
-static int irq;
+static struct net_device *dev_fmv18x;
 
 MODULE_PARM(io, "i");
 MODULE_PARM(irq, "i");
@@ -644,26 +660,19 @@
 {
 	if (io == 0)
 		printk("fmv18x: You should not use auto-probing with insmod!\n");
-	dev_fmv18x.base_addr	= io;
-	dev_fmv18x.irq		= irq;
-	dev_fmv18x.init		= fmv18x_probe;
-	if (register_netdev(&dev_fmv18x) != 0) {
-		printk("fmv18x: register_netdev() returned non-zero.\n");
-		return -EIO;
-	}
+	dev_fmv18x = fmv18x_probe(-1);
+	if (IS_ERR(dev_fmv18x))
+		return PTR_ERR(dev_fmv18x);
 	return 0;
 }
 
 void
 cleanup_module(void)
 {
-	unregister_netdev(&dev_fmv18x);
-	kfree(dev_fmv18x.priv);
-	dev_fmv18x.priv = NULL;
-
-	/* If we don't do this, we can't re-insmod it later. */
-	free_irq(dev_fmv18x.irq, &dev_fmv18x);
-	release_region(dev_fmv18x.base_addr, FMV18X_IO_EXTENT);
+	unregister_netdev(dev_fmv18x);
+	free_irq(dev_fmv18x->irq, dev_fmv18x);
+	release_region(dev_fmv18x->base_addr, FMV18X_IO_EXTENT);
+	free_netdev(dev_fmv18x);
 }
 #endif /* MODULE */
 
--- diff/drivers/net/gt96100eth.c	2003-08-26 10:00:53.000000000 +0100
+++ source/drivers/net/gt96100eth.c	2004-02-09 10:39:53.000000000 +0000
@@ -729,10 +729,12 @@
 		return -EBUSY;
 	}
 
-	dev = init_etherdev(0, sizeof(struct gt96100_private));
+	dev = alloc_etherdev(sizeof(struct gt96100_private));
+	if (!dev)
+		goto out;
 	gtif->dev = dev;
 	
-	/* private struct aligned and zeroed by init_etherdev */
+	/* private struct aligned and zeroed by alloc_etherdev */
 	/* Fill in the 'dev' fields. */
 	dev->base_addr = gtif->iobase;
 	dev->irq = gtif->irq;
@@ -740,7 +742,7 @@
 	if ((retval = parse_mac_addr(dev, gtif->mac_str))) {
 		err("%s: MAC address parse failed\n", __FUNCTION__);
 		retval = -EINVAL;
-		goto free_region;
+		goto out1;
 	}
 
 	gp = dev->priv;
@@ -768,7 +770,7 @@
 				       &gp->rx_ring_dma);
 		if (gp->rx_ring == NULL) {
 			retval = -ENOMEM;
-			goto free_region;
+			goto out1;
 		}
 	
 		gp->tx_ring = (gt96100_td_t *)(gp->rx_ring + RX_RING_SIZE);
@@ -781,11 +783,8 @@
 		gp->rx_buff = dmaalloc(PKT_BUF_SZ*RX_RING_SIZE,
 				       &gp->rx_buff_dma);
 		if (gp->rx_buff == NULL) {
-			dmafree(sizeof(gt96100_rd_t) * RX_RING_SIZE
-				+ sizeof(gt96100_td_t) * TX_RING_SIZE,
-				gp->rx_ring);
 			retval = -ENOMEM;
-			goto free_region;
+			goto out2;
 		}
 	}
     
@@ -797,12 +796,8 @@
 		gp->hash_table = (char*)dmaalloc(RX_HASH_TABLE_SIZE,
 						 &gp->hash_table_dma);
 		if (gp->hash_table == NULL) {
-			dmafree(sizeof(gt96100_rd_t) * RX_RING_SIZE
-				+ sizeof(gt96100_td_t) * TX_RING_SIZE,
-				gp->rx_ring);
-			dmafree(PKT_BUF_SZ*RX_RING_SIZE, gp->rx_buff);
 			retval = -ENOMEM;
-			goto free_region;
+			goto out3;
 		}
 	}
     
@@ -819,14 +814,23 @@
 	dev->tx_timeout = gt96100_tx_timeout;
 	dev->watchdog_timeo = GT96100ETH_TX_TIMEOUT;
 
-	/* Fill in the fields of the device structure with ethernet values. */
-	ether_setup(dev);
+	retval = register_netdev(dev);
+	if (retval)
+		goto out4;
 	return 0;
 
- free_region:
-	release_region(gtif->iobase, GT96100_ETH_IO_SIZE);
-	unregister_netdev(dev);
+out4:
+	dmafree(RX_HASH_TABLE_SIZE, gp->hash_table_dma);
+out3:
+	dmafree(PKT_BUF_SZ*RX_RING_SIZE, gp->rx_buff);
+out2:
+	dmafree(sizeof(gt96100_rd_t) * RX_RING_SIZE
+		+ sizeof(gt96100_td_t) * TX_RING_SIZE,
+		gp->rx_ring);
+out1:
 	free_netdev (dev);
+out:
+	release_region(gtif->iobase, GT96100_ETH_IO_SIZE);
 	err("%s failed.  Returns %d\n", __FUNCTION__, retval);
 	return retval;
 }
@@ -1573,9 +1577,14 @@
 		if (gtif->dev != NULL) {
 			struct gt96100_private *gp =
 				(struct gt96100_private *)gtif->dev->priv;
-			release_region(gtif->iobase, gp->io_size);
 			unregister_netdev(gtif->dev);
-			free_netdev (gtif->dev);
+			dmafree(RX_HASH_TABLE_SIZE, gp->hash_table_dma);
+			dmafree(PKT_BUF_SZ*RX_RING_SIZE, gp->rx_buff);
+			dmafree(sizeof(gt96100_rd_t) * RX_RING_SIZE
+				+ sizeof(gt96100_td_t) * TX_RING_SIZE,
+				gp->rx_ring);
+			free_netdev(gtif->dev);
+			release_region(gtif->iobase, gp->io_size);
 		}
 	}
 }
--- diff/drivers/net/hamradio/baycom_epp.c	2003-09-30 15:46:15.000000000 +0100
+++ source/drivers/net/hamradio/baycom_epp.c	2004-02-09 10:39:53.000000000 +0000
@@ -991,9 +991,7 @@
 	
 	baycom_paranoia_check(dev, "epp_open", -ENXIO);
 	bc = (struct baycom_state *)dev->priv;
-        pp = parport_enumerate();
-        while (pp && pp->base != dev->base_addr) 
-                pp = pp->next;
+        pp = parport_find_base(dev->base_addr);
         if (!pp) {
                 printk(KERN_ERR "%s: parport at 0x%lx unknown\n", bc_drvname, dev->base_addr);
                 return -ENXIO;
@@ -1001,17 +999,21 @@
 #if 0
         if (pp->irq < 0) {
                 printk(KERN_ERR "%s: parport at 0x%lx has no irq\n", bc_drvname, pp->base);
+		parport_put_port(pp);
                 return -ENXIO;
         }
 #endif
 	if ((~pp->modes) & (PARPORT_MODE_TRISTATE | PARPORT_MODE_PCSPP | PARPORT_MODE_SAFEININT)) {
                 printk(KERN_ERR "%s: parport at 0x%lx cannot be used\n",
 		       bc_drvname, pp->base);
+		parport_put_port(pp);
                 return -EIO;
 	}
 	memset(&bc->modem, 0, sizeof(bc->modem));
-        if (!(bc->pdev = parport_register_device(pp, dev->name, NULL, epp_wakeup, 
-                                                 epp_interrupt, PARPORT_DEV_EXCL, dev))) {
+        bc->pdev = parport_register_device(pp, dev->name, NULL, epp_wakeup, 
+					epp_interrupt, PARPORT_DEV_EXCL, dev);
+	parport_put_port(pp);
+        if (!bc->pdev) {
                 printk(KERN_ERR "%s: cannot register parport at 0x%lx\n", bc_drvname, pp->base);
                 return -ENXIO;
         }
@@ -1275,7 +1277,7 @@
  * If dev->base_addr == 2, allocate space for the device and return success
  * (detachable devices only).
  */
-static int baycom_probe(struct net_device *dev)
+static void baycom_probe(struct net_device *dev)
 {
 	static char ax25_bcast[AX25_ADDR_LEN] = {
 		'Q' << 1, 'S' << 1, 'T' << 1, ' ' << 1, ' ' << 1, ' ' << 1, '0' << 1
@@ -1288,9 +1290,6 @@
 	};
 	struct baycom_state *bc;
 
-	if (!dev)
-		return -ENXIO;
-	baycom_paranoia_check(dev, "baycom_probe", -ENXIO);
 	/*
 	 * not a real probe! only initialize data structures
 	 */
@@ -1332,8 +1331,6 @@
 
 	/* New style flags */
 	dev->flags = 0;
-
-	return 0;
 }
 
 /* --------------------------------------------------------------------- */
@@ -1368,7 +1365,7 @@
 	/*
 	 * initialize part of the device struct
 	 */
-	dev->init = baycom_probe;
+	baycom_probe(dev);
 }
 
 static int __init init_baycomepp(void)
@@ -1401,7 +1398,7 @@
 
 		if (register_netdev(dev)) {
 			printk(KERN_WARNING "%s: cannot register net device %s\n", bc_drvname, dev->name);
-			kfree(dev);
+			free_netdev(dev);
 			break;
 		}
 		if (set_hw && baycom_setmode(dev->priv, mode[i]))
--- diff/drivers/net/hamradio/baycom_par.c	2003-09-30 15:46:15.000000000 +0100
+++ source/drivers/net/hamradio/baycom_par.c	2004-02-09 10:39:53.000000000 +0000
@@ -314,29 +314,32 @@
 static int par96_open(struct net_device *dev)
 {
 	struct baycom_state *bc = (struct baycom_state *)dev->priv;
-	struct parport *pp = parport_enumerate();
+	struct parport *pp;
 
 	if (!dev || !bc)
 		return -ENXIO;
-	while (pp && pp->base != dev->base_addr) 
-		pp = pp->next;
+	pp = parport_find_base(dev->base_addr);
 	if (!pp) {
 		printk(KERN_ERR "baycom_par: parport at 0x%lx unknown\n", dev->base_addr);
 		return -ENXIO;
 	}
 	if (pp->irq < 0) {
 		printk(KERN_ERR "baycom_par: parport at 0x%lx has no irq\n", pp->base);
+		parport_put_port(pp);
 		return -ENXIO;
 	}
 	if ((~pp->modes) & (PARPORT_MODE_PCSPP | PARPORT_MODE_SAFEININT)) {
 		printk(KERN_ERR "baycom_par: parport at 0x%lx cannot be used\n", pp->base);
+		parport_put_port(pp);
 		return -ENXIO;
 	}
 	memset(&bc->modem, 0, sizeof(bc->modem));
 	bc->hdrv.par.bitrate = 9600;
-	if (!(bc->pdev = parport_register_device(pp, dev->name, NULL, par96_wakeup, 
-						 par96_interrupt, PARPORT_DEV_EXCL, dev))) {
-		printk(KERN_ERR "baycom_par: cannot register parport at 0x%lx\n", pp->base);
+	bc->pdev = parport_register_device(pp, dev->name, NULL, par96_wakeup, 
+				 par96_interrupt, PARPORT_DEV_EXCL, dev);
+	parport_put_port(pp);
+	if (!bc->pdev) {
+		printk(KERN_ERR "baycom_par: cannot register parport at 0x%lx\n", dev->base_addr);
 		return -ENXIO;
 	}
 	if (parport_claim(bc->pdev)) {
--- diff/drivers/net/hamradio/bpqether.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/net/hamradio/bpqether.c	2004-02-09 10:39:53.000000000 +0000
@@ -547,7 +547,7 @@
 
  error:
 	dev_put(edev);
-	kfree(ndev);
+	free_netdev(ndev);
 	return err;
 	
 }
--- diff/drivers/net/hamradio/dmascc.c	2003-06-30 10:07:21.000000000 +0100
+++ source/drivers/net/hamradio/dmascc.c	2004-02-09 10:39:53.000000000 +0000
@@ -242,7 +242,7 @@
 struct scc_info {
   int irq_used;
   int twin_serial_cfg;
-  struct net_device dev[2];
+  struct net_device *dev[2];
   struct scc_priv priv[2];
   struct scc_info *next;
   spinlock_t register_lock;	/* Per device register lock */
@@ -310,18 +310,19 @@
     info = first;
 
     /* Unregister devices */
-    for (i = 0; i < 2; i++) {
-      if (info->dev[i].name)
-	unregister_netdev(&info->dev[i]);
-    }
+    for (i = 0; i < 2; i++)
+	unregister_netdev(info->dev[i]);
 
     /* Reset board */
     if (info->priv[0].type == TYPE_TWIN)
-      outb(0, info->dev[0].base_addr + TWIN_SERIAL_CFG);
+      outb(0, info->dev[0]->base_addr + TWIN_SERIAL_CFG);
     write_scc(&info->priv[0], R9, FHWRES);
-    release_region(info->dev[0].base_addr,
+    release_region(info->dev[0]->base_addr,
 		   hw[info->priv[0].type].io_size);
 
+    for (i = 0; i < 2; i++)
+	free_netdev(info->dev[i]);
+
     /* Free memory */
     first = info->next;
     kfree(info);
@@ -443,156 +444,193 @@
 module_init(dmascc_init);
 module_exit(dmascc_exit);
 
+static void dev_setup(struct net_device *dev)
+{
+	dev->type = ARPHRD_AX25;
+	dev->hard_header_len = 73;
+	dev->mtu = 1500;
+	dev->addr_len = 7;
+	dev->tx_queue_len = 64;
+	memcpy(dev->broadcast, ax25_broadcast, 7);
+	memcpy(dev->dev_addr, ax25_test, 7);
+}
+
+static int __init setup_adapter(int card_base, int type, int n)
+{
+	int i, irq, chip;
+	struct scc_info *info;
+	struct net_device *dev;
+	struct scc_priv *priv;
+	unsigned long time;
+	unsigned int irqs;
+	int tmr_base = card_base + hw[type].tmr_offset;
+	int scc_base = card_base + hw[type].scc_offset;
+	char *chipnames[] = CHIPNAMES;
+
+	/* Allocate memory */
+	info = kmalloc(sizeof(struct scc_info), GFP_KERNEL | GFP_DMA);
+	if (!info) {
+		printk(KERN_ERR "dmascc: "
+			"could not allocate memory for %s at %#3x\n",
+			hw[type].name, card_base);
+		goto out;
+	}
 
-int __init setup_adapter(int card_base, int type, int n) {
-  int i, irq, chip;
-  struct scc_info *info;
-  struct net_device *dev;
-  struct scc_priv *priv;
-  unsigned long time;
-  unsigned int irqs;
-  int tmr_base = card_base + hw[type].tmr_offset;
-  int scc_base = card_base + hw[type].scc_offset;
-  char *chipnames[] = CHIPNAMES;
-
-  /* Allocate memory */
-  info = kmalloc(sizeof(struct scc_info), GFP_KERNEL | GFP_DMA);
-  if (!info) {
-    printk(KERN_ERR "dmascc: could not allocate memory for %s at %#3x\n",
-	   hw[type].name, card_base);
-    return -1;
-  }
-
-  /* Initialize what is necessary for write_scc and write_scc_data */
-  memset(info, 0, sizeof(struct scc_info));
-  spin_lock_init(&info->register_lock);
-  
-  priv = &info->priv[0];
-  priv->type = type;
-  priv->card_base = card_base;
-  priv->scc_cmd = scc_base + SCCA_CMD;
-  priv->scc_data = scc_base + SCCA_DATA;
-  priv->register_lock = &info->register_lock;
-
-  /* Reset SCC */
-  write_scc(priv, R9, FHWRES | MIE | NV);
-
-  /* Determine type of chip by enabling SDLC/HDLC enhancements */
-  write_scc(priv, R15, SHDLCE);
-  if (!read_scc(priv, R15)) {
-    /* WR7' not present. This is an ordinary Z8530 SCC. */
-    chip = Z8530;
-  } else {
-    /* Put one character in TX FIFO */
-    write_scc_data(priv, 0, 0);
-    if (read_scc(priv, R0) & Tx_BUF_EMP) {
-      /* TX FIFO not full. This is a Z85230 ESCC with a 4-byte FIFO. */
-      chip = Z85230;
-    } else {
-      /* TX FIFO full. This is a Z85C30 SCC with a 1-byte FIFO. */
-      chip = Z85C30;
-    }
-  }
-  write_scc(priv, R15, 0);
+	/* Initialize what is necessary for write_scc and write_scc_data */
+	memset(info, 0, sizeof(struct scc_info));
 
-  /* Start IRQ auto-detection */
-  irqs = probe_irq_on();
+	info->dev[0] = alloc_netdev(0, "", dev_setup);
+	if (!info->dev[0]) {
+		printk(KERN_ERR "dmascc: "
+			"could not allocate memory for %s at %#3x\n",
+			hw[type].name, card_base);
+		goto out1;
+	}
 
-  /* Enable interrupts */
-  if (type == TYPE_TWIN) {
-    outb(0, card_base + TWIN_DMA_CFG);
-    inb(card_base + TWIN_CLR_TMR1);
-    inb(card_base + TWIN_CLR_TMR2);
-    outb((info->twin_serial_cfg = TWIN_EI), card_base + TWIN_SERIAL_CFG);
-  } else {
-    write_scc(priv, R15, CTSIE);
-    write_scc(priv, R0, RES_EXT_INT);
-    write_scc(priv, R1, EXT_INT_ENAB);
-  }
-
-  /* Start timer */
-  outb(1, tmr_base + TMR_CNT1);
-  outb(0, tmr_base + TMR_CNT1);
-
-  /* Wait and detect IRQ */
-  time = jiffies; while (jiffies - time < 2 + HZ / TMR_0_HZ);
-  irq = probe_irq_off(irqs);
-
-  /* Clear pending interrupt, disable interrupts */
-  if (type == TYPE_TWIN) {
-    inb(card_base + TWIN_CLR_TMR1);
-  } else {
-    write_scc(priv, R1, 0);
-    write_scc(priv, R15, 0);
-    write_scc(priv, R0, RES_EXT_INT);
-  }
+	info->dev[1] = alloc_netdev(0, "", dev_setup);
+	if (!info->dev[1]) {
+		printk(KERN_ERR "dmascc: "
+			"could not allocate memory for %s at %#3x\n",
+			hw[type].name, card_base);
+		goto out2;
+	}
+	spin_lock_init(&info->register_lock);
 
-  if (irq <= 0) {
-    printk(KERN_ERR "dmascc: could not find irq of %s at %#3x (irq=%d)\n",
-	   hw[type].name, card_base, irq);
-    kfree(info);
-    return -1;
-  }
+	priv = &info->priv[0];
+	priv->type = type;
+	priv->card_base = card_base;
+	priv->scc_cmd = scc_base + SCCA_CMD;
+	priv->scc_data = scc_base + SCCA_DATA;
+	priv->register_lock = &info->register_lock;
+
+	/* Reset SCC */
+	write_scc(priv, R9, FHWRES | MIE | NV);
+
+	/* Determine type of chip by enabling SDLC/HDLC enhancements */
+	write_scc(priv, R15, SHDLCE);
+	if (!read_scc(priv, R15)) {
+		/* WR7' not present. This is an ordinary Z8530 SCC. */
+		chip = Z8530;
+	} else {
+		/* Put one character in TX FIFO */
+		write_scc_data(priv, 0, 0);
+		if (read_scc(priv, R0) & Tx_BUF_EMP) {
+			/* TX FIFO not full. This is a Z85230 ESCC with a 4-byte FIFO. */
+			chip = Z85230;
+		} else {
+			/* TX FIFO full. This is a Z85C30 SCC with a 1-byte FIFO. */
+			chip = Z85C30;
+		}
+	}
+	write_scc(priv, R15, 0);
 
-  /* Set up data structures */
-  for (i = 0; i < 2; i++) {
-    dev = &info->dev[i];
-    priv = &info->priv[i];
-    priv->type = type;
-    priv->chip = chip;
-    priv->dev = dev;
-    priv->info = info;
-    priv->channel = i;
-    spin_lock_init(&priv->ring_lock);
-    priv->register_lock = &info->register_lock;
-    priv->card_base = card_base;
-    priv->scc_cmd = scc_base + (i ? SCCB_CMD : SCCA_CMD);
-    priv->scc_data = scc_base + (i ? SCCB_DATA : SCCA_DATA);
-    priv->tmr_cnt = tmr_base + (i ? TMR_CNT2 : TMR_CNT1);
-    priv->tmr_ctrl = tmr_base + TMR_CTRL;
-    priv->tmr_mode = i ? 0xb0 : 0x70;
-    priv->param.pclk_hz = hw[type].pclk_hz;
-    priv->param.brg_tc = -1;
-    priv->param.clocks = TCTRxCP | RCRTxCP;
-    priv->param.persist = 256;
-    priv->param.dma = -1;
-    INIT_WORK(&priv->rx_work, rx_bh, priv);
-    dev->priv = priv;
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)
-    if (sizeof(dev->name) == sizeof(char *)) dev->name = priv->name;
-#endif
-    sprintf(dev->name, "dmascc%i", 2*n+i);
-    SET_MODULE_OWNER(dev);
-    dev->base_addr = card_base;
-    dev->irq = irq;
-    dev->open = scc_open;
-    dev->stop = scc_close;
-    dev->do_ioctl = scc_ioctl;
-    dev->hard_start_xmit = scc_send_packet;
-    dev->get_stats = scc_get_stats;
-    dev->hard_header = ax25_encapsulate;
-    dev->rebuild_header = ax25_rebuild_header;
-    dev->set_mac_address = scc_set_mac_address;
-    dev->type = ARPHRD_AX25;
-    dev->hard_header_len = 73;
-    dev->mtu = 1500;
-    dev->addr_len = 7;
-    dev->tx_queue_len = 64;
-    memcpy(dev->broadcast, ax25_broadcast, 7);
-    memcpy(dev->dev_addr, ax25_test, 7);
-    rtnl_lock();
-    if (register_netdevice(dev)) {
-      printk(KERN_ERR "dmascc: could not register %s\n", dev->name);
-    }
-    rtnl_unlock();
-  }
+	/* Start IRQ auto-detection */
+	irqs = probe_irq_on();
 
+	/* Enable interrupts */
+	if (type == TYPE_TWIN) {
+		outb(0, card_base + TWIN_DMA_CFG);
+		inb(card_base + TWIN_CLR_TMR1);
+		inb(card_base + TWIN_CLR_TMR2);
+		info->twin_serial_cfg = TWIN_EI;
+		outb(info->twin_serial_cfg, card_base + TWIN_SERIAL_CFG);
+	} else {
+		write_scc(priv, R15, CTSIE);
+		write_scc(priv, R0, RES_EXT_INT);
+		write_scc(priv, R1, EXT_INT_ENAB);
+	}
 
-  info->next = first;
-  first = info;
-  printk(KERN_INFO "dmascc: found %s (%s) at %#3x, irq %d\n", hw[type].name,
-	 chipnames[chip], card_base, irq);
-  return 0;
+	/* Start timer */
+	outb(1, tmr_base + TMR_CNT1);
+	outb(0, tmr_base + TMR_CNT1);
+
+	/* Wait and detect IRQ */
+	time = jiffies; while (jiffies - time < 2 + HZ / TMR_0_HZ);
+	irq = probe_irq_off(irqs);
+
+	/* Clear pending interrupt, disable interrupts */
+	if (type == TYPE_TWIN) {
+		inb(card_base + TWIN_CLR_TMR1);
+	} else {
+		write_scc(priv, R1, 0);
+		write_scc(priv, R15, 0);
+		write_scc(priv, R0, RES_EXT_INT);
+	}
+
+	if (irq <= 0) {
+		printk(KERN_ERR "dmascc: could not find irq of %s at %#3x (irq=%d)\n",
+			hw[type].name, card_base, irq);
+		goto out3;
+	}
+
+	/* Set up data structures */
+	for (i = 0; i < 2; i++) {
+		dev = info->dev[i];
+		priv = &info->priv[i];
+		priv->type = type;
+		priv->chip = chip;
+		priv->dev = dev;
+		priv->info = info;
+		priv->channel = i;
+		spin_lock_init(&priv->ring_lock);
+		priv->register_lock = &info->register_lock;
+		priv->card_base = card_base;
+		priv->scc_cmd = scc_base + (i ? SCCB_CMD : SCCA_CMD);
+		priv->scc_data = scc_base + (i ? SCCB_DATA : SCCA_DATA);
+		priv->tmr_cnt = tmr_base + (i ? TMR_CNT2 : TMR_CNT1);
+		priv->tmr_ctrl = tmr_base + TMR_CTRL;
+		priv->tmr_mode = i ? 0xb0 : 0x70;
+		priv->param.pclk_hz = hw[type].pclk_hz;
+		priv->param.brg_tc = -1;
+		priv->param.clocks = TCTRxCP | RCRTxCP;
+		priv->param.persist = 256;
+		priv->param.dma = -1;
+		INIT_WORK(&priv->rx_work, rx_bh, priv);
+		dev->priv = priv;
+		sprintf(dev->name, "dmascc%i", 2*n+i);
+		SET_MODULE_OWNER(dev);
+		dev->base_addr = card_base;
+		dev->irq = irq;
+		dev->open = scc_open;
+		dev->stop = scc_close;
+		dev->do_ioctl = scc_ioctl;
+		dev->hard_start_xmit = scc_send_packet;
+		dev->get_stats = scc_get_stats;
+		dev->hard_header = ax25_encapsulate;
+		dev->rebuild_header = ax25_rebuild_header;
+		dev->set_mac_address = scc_set_mac_address;
+	}
+	if (register_netdev(info->dev[0])) {
+		printk(KERN_ERR "dmascc: could not register %s\n",
+				info->dev[0]->name);
+		goto out3;
+	}
+	if (register_netdev(info->dev[1])) {
+		printk(KERN_ERR "dmascc: could not register %s\n",
+				info->dev[1]->name);
+		goto out4;
+	}
+
+
+	info->next = first;
+	first = info;
+	printk(KERN_INFO "dmascc: found %s (%s) at %#3x, irq %d\n", hw[type].name,
+	chipnames[chip], card_base, irq);
+	return 0;
+
+out4:
+	unregister_netdev(info->dev[0]);
+out3:
+	if (info->priv[0].type == TYPE_TWIN)
+		outb(0, info->dev[0]->base_addr + TWIN_SERIAL_CFG);
+	write_scc(&info->priv[0], R9, FHWRES);
+	free_netdev(info->dev[1]);
+out2:
+	free_netdev(info->dev[0]);
+out1:
+	kfree(info);
+out:
+	return -1;
 }
 
 
--- diff/drivers/net/hamradio/hdlcdrv.c	2003-09-30 15:46:15.000000000 +0100
+++ source/drivers/net/hamradio/hdlcdrv.c	2004-02-09 10:39:53.000000000 +0000
@@ -832,7 +832,7 @@
 	if (err < 0) {
 		printk(KERN_WARNING "hdlcdrv: cannot register net "
 		       "device %s\n", dev->name);
-		kfree(dev);
+		free_netdev(dev);
 		dev = ERR_PTR(err);
 	}
 	return dev;
--- diff/drivers/net/hamradio/yam.c	2003-09-30 15:46:15.000000000 +0100
+++ source/drivers/net/hamradio/yam.c	2004-02-09 10:39:53.000000000 +0000
@@ -1192,7 +1192,7 @@
 		struct net_device *dev = yam_devs[i];
 		if (dev) {
 			unregister_netdev(dev);
-			kfree(dev);
+			free_netdev(dev);
 		}
 	}
 
--- diff/drivers/net/hp-plus.c	2003-09-30 15:46:15.000000000 +0100
+++ source/drivers/net/hp-plus.c	2004-02-09 10:39:53.000000000 +0000
@@ -92,7 +92,6 @@
 	EnableIRQ = 4, FakeIntr = 8, BootROMEnb = 0x10, IOEnb = 0x20,
 	MemEnable = 0x40, ZeroWait = 0x80, MemDisable = 0x1000, };
 
-int hp_plus_probe(struct net_device *dev);
 static int hpp_probe1(struct net_device *dev, int ioaddr);
 
 static void hpp_reset_8390(struct net_device *dev);
@@ -115,10 +114,11 @@
 /*	Probe a list of addresses for an HP LAN+ adaptor.
 	This routine is almost boilerplate. */
 
-int __init hp_plus_probe(struct net_device *dev)
+static int __init do_hpp_probe(struct net_device *dev)
 {
 	int i;
 	int base_addr = dev->base_addr;
+	int irq = dev->irq;
 
 	SET_MODULE_OWNER(dev);
 
@@ -127,13 +127,46 @@
 	else if (base_addr != 0)	/* Don't probe at all. */
 		return -ENXIO;
 
-	for (i = 0; hpplus_portlist[i]; i++)
+	for (i = 0; hpplus_portlist[i]; i++) {
 		if (hpp_probe1(dev, hpplus_portlist[i]) == 0)
 			return 0;
+		dev->irq = irq;
+	}
 
 	return -ENODEV;
 }
 
+static void cleanup_card(struct net_device *dev)
+{
+	/* NB: hpp_close() handles free_irq */
+	release_region(dev->base_addr - NIC_OFFSET, HP_IO_EXTENT);
+}
+
+struct net_device * __init hp_plus_probe(int unit)
+{
+	struct net_device *dev = alloc_ei_netdev();
+	int err;
+
+	if (!dev)
+		return ERR_PTR(-ENOMEM);
+
+	sprintf(dev->name, "eth%d", unit);
+	netdev_boot_setup_check(dev);
+
+	err = do_hpp_probe(dev);
+	if (err)
+		goto out;
+	err = register_netdev(dev);
+	if (err)
+		goto out1;
+	return dev;
+out1:
+	cleanup_card(dev);
+out:
+	free_netdev(dev);
+	return ERR_PTR(err);
+}
+
 /* Do the interesting part of the probe at a single address. */
 static int __init hpp_probe1(struct net_device *dev, int ioaddr)
 {
@@ -179,13 +212,6 @@
 		printk(" ID %4.4x", inw(ioaddr + 12));
 	}
 
-	/* Allocate dev->priv and fill in 8390 specific dev fields. */
-	if (ethdev_init(dev)) {
-		printk ("hp-plus.c: unable to allocate memory for dev->priv.\n");
-		retval = -ENOMEM;
-		goto out;
-	 }
-
 	/* Read the IRQ line. */
 	outw(HW_Page, ioaddr + HP_PAGING);
 	{
@@ -210,6 +236,9 @@
 
 	dev->open = &hpp_open;
 	dev->stop = &hpp_close;
+#ifdef CONFIG_NET_POLL_CONTROLLER
+	dev->poll_controller = ei_poll;
+#endif
 
 	ei_status.name = name;
 	ei_status.word16 = 0;		/* Agggghhhhh! Debug time: 2 days! */
@@ -400,7 +429,7 @@
 
 #ifdef MODULE
 #define MAX_HPP_CARDS	4	/* Max number of HPP cards per module */
-static struct net_device dev_hpp[MAX_HPP_CARDS];
+static struct net_device *dev_hpp[MAX_HPP_CARDS];
 static int io[MAX_HPP_CARDS];
 static int irq[MAX_HPP_CARDS];
 
@@ -416,27 +445,33 @@
 int
 init_module(void)
 {
+	struct net_device *dev;
 	int this_dev, found = 0;
 
 	for (this_dev = 0; this_dev < MAX_HPP_CARDS; this_dev++) {
-		struct net_device *dev = &dev_hpp[this_dev];
-		dev->irq = irq[this_dev];
-		dev->base_addr = io[this_dev];
-		dev->init = hp_plus_probe;
 		if (io[this_dev] == 0)  {
 			if (this_dev != 0) break; /* only autoprobe 1st one */
 			printk(KERN_NOTICE "hp-plus.c: Presently autoprobing (not recommended) for a single card.\n");
 		}
-		if (register_netdev(dev) != 0) {
-			printk(KERN_WARNING "hp-plus.c: No HP-Plus card found (i/o = 0x%x).\n", io[this_dev]);
-			if (found != 0) {	/* Got at least one. */
-				return 0;
+		dev = alloc_ei_netdev();
+		if (!dev)
+			break;
+		dev->irq = irq[this_dev];
+		dev->base_addr = io[this_dev];
+		if (do_hpp_probe(dev) == 0) {
+			if (register_netdev(dev) == 0) {
+				dev_hpp[found++] = dev;
+				continue;
 			}
-			return -ENXIO;
+			cleanup_card(dev);
 		}
-		found++;
+		free_netdev(dev);
+		printk(KERN_WARNING "hp-plus.c: No HP-Plus card found (i/o = 0x%x).\n", io[this_dev]);
+		break;
 	}
-	return 0;
+	if (found)
+		return 0;
+	return -ENXIO;
 }
 
 void
@@ -445,14 +480,11 @@
 	int this_dev;
 
 	for (this_dev = 0; this_dev < MAX_HPP_CARDS; this_dev++) {
-		struct net_device *dev = &dev_hpp[this_dev];
-		if (dev->priv != NULL) {
-			int ioaddr = dev->base_addr - NIC_OFFSET;
-			void *priv = dev->priv;
-			/* NB: hpp_close() handles free_irq */
-			release_region(ioaddr, HP_IO_EXTENT);
+		struct net_device *dev = dev_hpp[this_dev];
+		if (dev) {
 			unregister_netdev(dev);
-			kfree(priv);
+			cleanup_card(dev);
+			free_netdev(dev);
 		}
 	}
 }
--- diff/drivers/net/hp.c	2003-09-30 15:46:15.000000000 +0100
+++ source/drivers/net/hp.c	2004-02-09 10:39:53.000000000 +0000
@@ -55,7 +55,6 @@
 #define HP_8BSTOP_PG	0x80	/* Last page +1 of RX ring */
 #define HP_16BSTOP_PG	0xFF	/* Same, for 16 bit cards. */
 
-int hp_probe(struct net_device *dev);
 static int hp_probe1(struct net_device *dev, int ioaddr);
 
 static int hp_open(struct net_device *dev);
@@ -79,10 +78,11 @@
 	Also initialize the card and fill in STATION_ADDR with the station
 	address. */
 
-int __init hp_probe(struct net_device *dev)
+static int __init do_hp_probe(struct net_device *dev)
 {
 	int i;
 	int base_addr = dev->base_addr;
+	int irq = dev->irq;
 
 	SET_MODULE_OWNER(dev);
 
@@ -91,13 +91,46 @@
 	else if (base_addr != 0)	/* Don't probe at all. */
 		return -ENXIO;
 
-	for (i = 0; hppclan_portlist[i]; i++)
+	for (i = 0; hppclan_portlist[i]; i++) {
 		if (hp_probe1(dev, hppclan_portlist[i]) == 0)
 			return 0;
+		dev->irq = irq;
+	}
 
 	return -ENODEV;
 }
 
+static void cleanup_card(struct net_device *dev)
+{
+	free_irq(dev->irq, dev);
+	release_region(dev->base_addr - NIC_OFFSET, HP_IO_EXTENT);
+}
+
+struct net_device * __init hp_probe(int unit)
+{
+	struct net_device *dev = alloc_ei_netdev();
+	int err;
+
+	if (!dev)
+		return ERR_PTR(-ENOMEM);
+
+	sprintf(dev->name, "eth%d", unit);
+	netdev_boot_setup_check(dev);
+
+	err = do_hp_probe(dev);
+	if (err)
+		goto out;
+	err = register_netdev(dev);
+	if (err)
+		goto out1;
+	return dev;
+out1:
+	cleanup_card(dev);
+out:
+	free_netdev(dev);
+	return ERR_PTR(err);
+}
+
 static int __init hp_probe1(struct net_device *dev, int ioaddr)
 {
 	int i, retval, board_id, wordmode;
@@ -131,13 +164,6 @@
 	if (ei_debug  &&  version_printed++ == 0)
 		printk(version);
 
-	/* Allocate dev->priv and fill in 8390 specific dev fields. */
-	if (ethdev_init(dev)) {
-		printk (" unable to get memory for dev->priv.\n");
-		retval = -ENOMEM;
-		goto out;
-	}
-
 	printk("%s: %s (ID %02x) at %#3x,", dev->name, name, board_id, ioaddr);
 
 	for(i = 0; i < ETHER_ADDR_LEN; i++)
@@ -166,14 +192,14 @@
 		if (*irqp == 0) {
 			printk(" no free IRQ lines.\n");
 			retval = -EBUSY;
-			goto out1;
+			goto out;
 		}
 	} else {
 		if (dev->irq == 2)
 			dev->irq = 9;
 		if ((retval = request_irq(dev->irq, ei_interrupt, 0, dev->name, dev))) {
 			printk (" unable to get IRQ %d.\n", dev->irq);
-			goto out1;
+			goto out;
 		}
 	}
 
@@ -181,6 +207,9 @@
 	dev->base_addr = ioaddr + NIC_OFFSET;
 	dev->open = &hp_open;
 	dev->stop = &hp_close;
+#ifdef CONFIG_NET_POLL_CONTROLLER
+	dev->poll_controller = ei_poll;
+#endif
 
 	ei_status.name = name;
 	ei_status.word16 = wordmode;
@@ -195,9 +224,6 @@
 	hp_init_card(dev);
 
 	return 0;
-out1:
-	kfree(dev->priv);
-	dev->priv = NULL;
 out:
 	release_region(ioaddr, HP_IO_EXTENT);
 	return retval;
@@ -372,7 +398,7 @@
 
 #ifdef MODULE
 #define MAX_HP_CARDS	4	/* Max number of HP cards per module */
-static struct net_device dev_hp[MAX_HP_CARDS];
+static struct net_device *dev_hp[MAX_HP_CARDS];
 static int io[MAX_HP_CARDS];
 static int irq[MAX_HP_CARDS];
 
@@ -388,27 +414,33 @@
 int
 init_module(void)
 {
+	struct net_device *dev;
 	int this_dev, found = 0;
 
 	for (this_dev = 0; this_dev < MAX_HP_CARDS; this_dev++) {
-		struct net_device *dev = &dev_hp[this_dev];
-		dev->irq = irq[this_dev];
-		dev->base_addr = io[this_dev];
-		dev->init = hp_probe;
 		if (io[this_dev] == 0)  {
 			if (this_dev != 0) break; /* only autoprobe 1st one */
 			printk(KERN_NOTICE "hp.c: Presently autoprobing (not recommended) for a single card.\n");
 		}
-		if (register_netdev(dev) != 0) {
-			printk(KERN_WARNING "hp.c: No HP card found (i/o = 0x%x).\n", io[this_dev]);
-			if (found != 0) {	/* Got at least one. */
-				return 0;
+		dev = alloc_ei_netdev();
+		if (!dev)
+			break;
+		dev->irq = irq[this_dev];
+		dev->base_addr = io[this_dev];
+		if (do_hp_probe(dev) == 0) {
+			if (register_netdev(dev) == 0) {
+				dev_hp[found++] = dev;
+				continue;
 			}
-			return -ENXIO;
+			cleanup_card(dev);
 		}
-		found++;
+		free_netdev(dev);
+		printk(KERN_WARNING "hp.c: No HP card found (i/o = 0x%x).\n", io[this_dev]);
+		break;
 	}
-	return 0;
+	if (found)
+		return 0;
+	return -ENXIO;
 }
 
 void
@@ -417,14 +449,11 @@
 	int this_dev;
 
 	for (this_dev = 0; this_dev < MAX_HP_CARDS; this_dev++) {
-		struct net_device *dev = &dev_hp[this_dev];
-		if (dev->priv != NULL) {
-			int ioaddr = dev->base_addr - NIC_OFFSET;
-			void *priv = dev->priv;
-			free_irq(dev->irq, dev);
-			release_region(ioaddr, HP_IO_EXTENT);
+		struct net_device *dev = dev_hp[this_dev];
+		if (dev) {
 			unregister_netdev(dev);
-			kfree(priv);
+			cleanup_card(dev);
+			free_netdev(dev);
 		}
 	}
 }
--- diff/drivers/net/hp100.c	2003-10-27 09:20:38.000000000 +0000
+++ source/drivers/net/hp100.c	2004-02-09 10:39:53.000000000 +0000
@@ -118,8 +118,6 @@
 #include <asm/bitops.h>
 #include <asm/io.h>
 
-typedef struct net_device_stats hp100_stats_t;
-
 #include "hp100.h"
 
 /*
@@ -130,23 +128,8 @@
 #define HP100_BUS_EISA    1
 #define HP100_BUS_PCI     2
 
-#ifndef PCI_DEVICE_ID_HP_J2585B
-#define PCI_DEVICE_ID_HP_J2585B 0x1031
-#endif
-#ifndef PCI_VENDOR_ID_COMPEX
-#define PCI_VENDOR_ID_COMPEX 0x11f6
-#endif
-#ifndef PCI_DEVICE_ID_COMPEX_ENET100VG4
-#define PCI_DEVICE_ID_COMPEX_ENET100VG4 0x0112
-#endif
-#ifndef PCI_VENDOR_ID_COMPEX2
-#define PCI_VENDOR_ID_COMPEX2 0x101a
-#endif
-#ifndef PCI_DEVICE_ID_COMPEX2_100VG
-#define PCI_DEVICE_ID_COMPEX2_100VG 0x0005
-#endif
-
 #define HP100_REGION_SIZE	0x20	/* for ioports */
+#define HP100_SIG_LEN		8	/* same as EISA_SIG_LEN */
 
 #define HP100_MAX_PACKET_SIZE	(1536+4)
 #define HP100_MIN_PACKET_SIZE	60
@@ -165,20 +148,9 @@
  *  structures
  */
 
-struct hp100_eisa_id {
-	u_int id;
-	const char *name;
-	u_char bus;
-};
-
-struct hp100_pci_id {
-	u_short vendor;
-	u_short device;
-};
-
 struct hp100_private {
-	struct hp100_eisa_id *id;
 	spinlock_t lock;
+	char id[HP100_SIG_LEN];
 	u_short chip;
 	u_short soft_model;
 	u_int memory_size;
@@ -196,7 +168,7 @@
 	u_char mac1_mode;
 	u_char mac2_mode;
 	u_char hash_bytes[8];
-	hp100_stats_t stats;
+	struct net_device_stats stats;
 
 	/* Rings for busmaster mode: */
 	hp100_ring_t *rxrhead;	/* Head (oldest) index into rxring */
@@ -216,83 +188,36 @@
 /*
  *  variables
  */
-
-static struct hp100_eisa_id hp100_eisa_ids[] = {
-
-	/* 10/100 EISA card with revision A Cascade chip */
-	{0x80F1F022, "HP J2577 rev A", HP100_BUS_EISA},
-
-	/* 10/100 ISA card with revision A Cascade chip */
-	{0x50F1F022, "HP J2573 rev A", HP100_BUS_ISA},
-
-	/* 10 only EISA card with Cascade chip */
-	{0x2019F022, "HP 27248B", HP100_BUS_EISA},
-
-	/* 10/100 EISA card with Cascade chip */
-	{0x4019F022, "HP J2577", HP100_BUS_EISA},
-
-	/* 10/100 ISA card with Cascade chip */
-	{0x5019F022, "HP J2573", HP100_BUS_ISA},
-
-	/* 10/100 EISA card with AT&T chip */
-	{0x9019f022, "HP J2577", HP100_BUS_EISA },
-
-	/* 10/100 PCI card - old J2585A */
-	{0x1030103c, "HP J2585A", HP100_BUS_PCI},
-
-	/* 10/100 PCI card - new J2585B - master capable */
-	{0x1041103c, "HP J2585B", HP100_BUS_PCI},
-
-	/* 10 Mbit Combo Adapter */
-	{0x1042103c, "HP J2970", HP100_BUS_PCI},
-
-	/* 10 Mbit 10baseT Adapter */
-	{0x1040103c, "HP J2973", HP100_BUS_PCI},
-
-	/* 10/100 EISA card from Compex */
-	{0x0103180e, "ReadyLink ENET100-VG4", HP100_BUS_EISA},
-
-	/* 10/100 EISA card from Compex - FreedomLine (sq5bpf) */
-	/* Note: plhbrod@mbox.vol.cz reported that same ID have ISA */
-	/*       version of adapter, too... */
-	{0x0104180e, "FreedomLine 100/VG", HP100_BUS_EISA},
-
-	/* 10/100 PCI card from Compex - FreedomLine
-	 *
-	 * I think this card doesn't like aic7178 scsi controller, but
-	 * I haven't tested this much. It works fine on diskless machines.
-	 *                            Jacek Lipkowski <sq5bpf@acid.ch.pw.edu.pl>
-	 */
-	{0x021211f6, "FreedomLine 100/VG", HP100_BUS_PCI},
-
-	/* 10/100 PCI card from Compex (J2585A compatible) */
-	{0x011211f6, "ReadyLink ENET100-VG4", HP100_BUS_PCI},
-	
-	/* 10/100 PCI card from KTI */
-	{0x40008e2e, "KTI DP-200", HP100_BUS_PCI }
+static const char *hp100_isa_tbl[] = {
+	"HWPF150", /* HP J2573 rev A */
+	"HWP1950", /* HP J2573 */
 };
 
-#define HP100_EISA_IDS_SIZE	(sizeof(hp100_eisa_ids)/sizeof(struct hp100_eisa_id))
-
-#ifdef CONFIG_PCI
-static struct hp100_pci_id hp100_pci_ids[] = {
-	{PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_J2585A},
-	{PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_J2585B},
-	{PCI_VENDOR_ID_COMPEX, PCI_DEVICE_ID_COMPEX_ENET100VG4},
-	{PCI_VENDOR_ID_COMPEX2, PCI_DEVICE_ID_COMPEX2_100VG}
+#ifdef CONFIG_EISA
+static struct eisa_device_id hp100_eisa_tbl[] = {
+	{ "HWPF180" }, /* HP J2577 rev A */
+	{ "HWP1920" }, /* HP 27248B */
+	{ "HWP1940" }, /* HP J2577 */
+	{ "HWP1990" }, /* HP J2577 */
+	{ "CPX0301" }, /* ReadyLink ENET100-VG4 */
+	{ "CPX0401" }, /* FreedomLine 100/VG */
 };
+MODULE_DEVICE_TABLE(eisa, hp100_eisa_tbl);
 #endif
 
-#define HP100_PCI_IDS_SIZE	(sizeof(hp100_pci_ids)/sizeof(struct hp100_pci_id))
-
+#ifdef CONFIG_PCI
 static struct pci_device_id hp100_pci_tbl[] = {
 	{PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_J2585A, PCI_ANY_ID, PCI_ANY_ID,},
 	{PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_J2585B, PCI_ANY_ID, PCI_ANY_ID,},
+	{PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_J2970A, PCI_ANY_ID, PCI_ANY_ID,},
+	{PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_J2973A, PCI_ANY_ID, PCI_ANY_ID,},
 	{PCI_VENDOR_ID_COMPEX, PCI_DEVICE_ID_COMPEX_ENET100VG4, PCI_ANY_ID, PCI_ANY_ID,},
 	{PCI_VENDOR_ID_COMPEX2, PCI_DEVICE_ID_COMPEX2_100VG, PCI_ANY_ID, PCI_ANY_ID,},
+/*	{PCI_VENDOR_ID_KTI, PCI_DEVICE_ID_KTI_DP200, PCI_ANY_ID, PCI_ANY_ID }, */
 	{}			/* Terminating entry */
 };
 MODULE_DEVICE_TABLE(pci, hp100_pci_tbl);
+#endif
 
 static int hp100_rx_ratio = HP100_DEFAULT_RX_RATIO;
 static int hp100_priority_tx = HP100_DEFAULT_PRIORITY_TX;
@@ -316,7 +241,7 @@
 static int hp100_start_xmit_bm(struct sk_buff *skb,
 			       struct net_device *dev);
 static void hp100_rx(struct net_device *dev);
-static hp100_stats_t *hp100_get_stats(struct net_device *dev);
+static struct net_device_stats *hp100_get_stats(struct net_device *dev);
 static void hp100_misc_interrupt(struct net_device *dev);
 static void hp100_update_stats(struct net_device *dev);
 static void hp100_clear_stats(struct hp100_private *lp, int ioaddr);
@@ -370,196 +295,180 @@
  *  since this could cause problems when the card is not installed.
  */
 
-int __init hp100_probe(struct net_device *dev)
+/*
+ * Read board id and convert to string.
+ * Effectively same code as decode_eisa_sig
+ */
+static __init const char *hp100_read_id(int ioaddr)
 {
-	int base_addr = dev ? dev->base_addr : 0;
-	int ioaddr = 0;
-	int pci_start_index = 0;
+	int i;
+	static char str[HP100_SIG_LEN];
+	unsigned char sig[4], sum;
+        unsigned short rev;
 
-#ifdef HP100_DEBUG_B
-	hp100_outw(0x4200, TRACE);
-	printk("hp100: %s: probe\n", dev->name);
-#endif
+	hp100_page(ID_MAC_ADDR);
+	sum = 0;
+	for (i = 0; i < 4; i++) {
+		sig[i] = hp100_inb(BOARD_ID + i);
+		sum += sig[i];
+	}
 
-	if (base_addr > 0xff) {	/* Check a single specified location. */
-		if (check_region(base_addr, HP100_REGION_SIZE))
-			return -EINVAL;
-		if (base_addr < 0x400)
-			return hp100_probe1(dev, base_addr, HP100_BUS_ISA,
-					    NULL);
-		if (EISA_bus && base_addr >= 0x1c38 && ((base_addr - 0x1c38) & 0x3ff) == 0)
-			return hp100_probe1(dev, base_addr, HP100_BUS_EISA, NULL);
-#ifdef CONFIG_PCI
-		printk("hp100: %s: You must specify card # in i/o address parameter for PCI bus...", dev->name);
-#else
-		return -ENODEV;
-#endif
-	} else
-#ifdef CONFIG_PCI
-		if (base_addr > 0 && base_addr < 8 + 1)
-			pci_start_index = 0x100 | (base_addr - 1);
-	  else
-#endif
-		if (base_addr != 0)
-			return -ENXIO;
+	sum += hp100_inb(BOARD_ID + i);
+	if (sum != 0xff)
+		return NULL;	/* bad checksum */
 
-	/* First: scan PCI bus(es) */
+        str[0] = ((sig[0] >> 2) & 0x1f) + ('A' - 1);
+        str[1] = (((sig[0] & 3) << 3) | (sig[1] >> 5)) + ('A' - 1);
+        str[2] = (sig[1] & 0x1f) + ('A' - 1);
+        rev = (sig[2] << 8) | sig[3];
+        sprintf(str + 3, "%04X", rev);
 
-#ifdef CONFIG_PCI
-	{
-		int pci_index;
-		struct pci_dev *pci_dev = NULL;
-		int pci_id_index;
-		u_short pci_command;
-
-#ifdef HP100_DEBUG_PCI
-		printk("hp100: %s: PCI BIOS is present, checking for devices..\n", dev->name);
-#endif
-		pci_index = 0;
-		for (pci_id_index = 0; pci_id_index < HP100_PCI_IDS_SIZE;
-		     pci_id_index++) {
-			while ((pci_dev = pci_find_device(hp100_pci_ids[pci_id_index].vendor,
-							  hp100_pci_ids[pci_id_index].device,
-							  pci_dev)) != NULL) {
-				if (pci_index < (pci_start_index & 7)) {
-					pci_index++;
-					continue;
-				}
-				if (pci_enable_device(pci_dev))
-					continue;
-				/* found... */
-				ioaddr = pci_resource_start(pci_dev, 0);
-				if (check_region(ioaddr, HP100_REGION_SIZE))
-					continue;
-				pci_read_config_word(pci_dev, PCI_COMMAND, &pci_command);
-				if (!(pci_command & PCI_COMMAND_IO)) {
-#ifdef HP100_DEBUG
-					printk("hp100: %s: PCI I/O Bit has not been set. Setting...\n", dev->name);
-#endif
-					pci_command |= PCI_COMMAND_IO;
-					pci_write_config_word(pci_dev, PCI_COMMAND, pci_command);
-				}
-				if (!(pci_command & PCI_COMMAND_MASTER)) {
-#ifdef HP100_DEBUG
-					printk("hp100: %s: PCI Master Bit has not been set. Setting...\n", dev->name);
-#endif
-					pci_command |= PCI_COMMAND_MASTER;
-					pci_write_config_word(pci_dev, PCI_COMMAND, pci_command);
-				}
-#ifdef HP100_DEBUG
-				printk("hp100: %s: PCI adapter found at 0x%x\n", dev->name, ioaddr);
-#endif
-				if (hp100_probe1(dev, ioaddr, HP100_BUS_PCI, pci_dev) == 0)
-					return 0;
-			}
-		}
-	}
-	if (pci_start_index > 0)
-		return -ENODEV;
-#endif /* CONFIG_PCI */
+	return str;
+}
 
-	/* Second: Probe all EISA possible port regions (if EISA bus present) */
-	for (ioaddr = 0x1c38; EISA_bus && ioaddr < 0x10000; ioaddr += 0x400) {
-		if (check_region(ioaddr, HP100_REGION_SIZE))
-			continue;
-		if (hp100_probe1(dev, ioaddr, HP100_BUS_EISA, NULL) == 0)
-			return 0;
-	}
+static __init int hp100_isa_probe1(struct net_device *dev, int addr)
+{
+	const char *sig;
+	int i;
+
+	if (!request_region(addr, HP100_REGION_SIZE, "hp100"))
+		goto err;
+
+	sig = hp100_read_id(addr);
+	release_region(addr, HP100_REGION_SIZE);
+
+	if (sig == NULL)
+		goto err;
+
+	for (i = 0; i < ARRAY_SIZE(hp100_isa_tbl); i++) {
+		if (!strcmp(hp100_isa_tbl[i], sig)) 
+			break;
 
-	/* Third: Probe all ISA possible port regions */
-	for (ioaddr = 0x100; ioaddr < 0x400; ioaddr += 0x20) {
-		if (check_region(ioaddr, HP100_REGION_SIZE))
-			continue;
-		if (hp100_probe1(dev, ioaddr, HP100_BUS_ISA, NULL) == 0)
-			return 0;
 	}
 
+	if (i < ARRAY_SIZE(hp100_isa_tbl))
+		return hp100_probe1(dev, addr, HP100_BUS_ISA, NULL);
+ err:
 	return -ENODEV;
+
+}
+/*
+ * Probe for ISA board.
+ * EISA and PCI are handled by device infrastructure.
+ */
+
+static int  __init hp100_isa_probe(struct net_device *dev, int addr)
+{
+	int err = -ENODEV;
+
+	/* Probe for a specific ISA address */		
+	if (addr > 0xff && addr < 0x400)
+		err = hp100_isa_probe1(dev, addr);
+
+	else if (addr != 0) 
+		err = -ENXIO;
+
+	else {
+		/* Probe all ISA possible port regions */
+		for (addr = 0x100; addr < 0x400; addr += 0x20) {
+			err = hp100_isa_probe1(dev, addr);
+			if (!err)
+				break;
+		}
+	}
+	return err;
+}
+
+
+struct net_device * __init hp100_probe(int unit)
+{
+	struct net_device *dev = alloc_etherdev(sizeof(struct hp100_private));
+	int err;
+
+	if (!dev)
+		return ERR_PTR(-ENODEV);
+
+	SET_MODULE_OWNER(dev);
+
+#ifdef HP100_DEBUG_B
+	hp100_outw(0x4200, TRACE);
+	printk("hp100: %s: probe\n", dev->name);
+#endif
+
+	if (unit >= 0) {
+		sprintf(dev->name, "eth%d", unit);
+		netdev_boot_setup_check(dev);
+	}
+
+	err = hp100_isa_probe(dev, dev->base_addr);
+	if (err)
+		goto out;
+
+	err = register_netdev(dev);
+	if (err)
+		goto out1;
+	return dev;
+ out1:
+	release_region(dev->base_addr, HP100_REGION_SIZE);
+ out:
+	free_netdev(dev);
+	return ERR_PTR(err);
 }
 
 static int __init hp100_probe1(struct net_device *dev, int ioaddr,
 			       u_char bus, struct pci_dev *pci_dev)
 {
 	int i;
-
-	u_char uc, uc_1;
-	u_int eisa_id;
+	int err = -ENODEV;
+	const char *eid;
 	u_int chip;
+	u_char uc;
 	u_int memory_size = 0, virt_memory_size = 0;
 	u_short local_mode, lsw;
 	short mem_mapped;
 	unsigned long mem_ptr_phys;
 	void **mem_ptr_virt;
 	struct hp100_private *lp;
-	struct hp100_eisa_id *eid;
 
 #ifdef HP100_DEBUG_B
 	hp100_outw(0x4201, TRACE);
 	printk("hp100: %s: probe1\n", dev->name);
 #endif
 
-	if (dev == NULL) {
-#ifdef HP100_DEBUG
-		printk("hp100_probe1: %s: dev == NULL ?\n", dev->name);
-#endif
-		return -EIO;
-	}
+	/* memory region for programmed i/o */
+	if (!request_region(ioaddr, HP100_REGION_SIZE, "hp100"))
+		goto out1;
 
-	if (hp100_inw(HW_ID) != HP100_HW_ID_CASCADE) {
-		return -ENODEV;
-	} else {
-		chip = hp100_inw(PAGING) & HP100_CHIPID_MASK;
+	if (hp100_inw(HW_ID) != HP100_HW_ID_CASCADE) 
+		goto out2;
+
+	chip = hp100_inw(PAGING) & HP100_CHIPID_MASK;
 #ifdef HP100_DEBUG
-		if (chip == HP100_CHIPID_SHASTA)
-			printk("hp100: %s: Shasta Chip detected. (This is a pre 802.12 chip)\n", dev->name);
-		else if (chip == HP100_CHIPID_RAINIER)
-			printk("hp100: %s: Rainier Chip detected. (This is a pre 802.12 chip)\n", dev->name);
-		else if (chip == HP100_CHIPID_LASSEN)
-			printk("hp100: %s: Lassen Chip detected.\n", dev->name);
-		else
-			printk("hp100: %s: Warning: Unknown CASCADE chip (id=0x%.4x).\n", dev->name, chip);
+	if (chip == HP100_CHIPID_SHASTA)
+		printk("hp100: %s: Shasta Chip detected. (This is a pre 802.12 chip)\n", dev->name);
+	else if (chip == HP100_CHIPID_RAINIER)
+		printk("hp100: %s: Rainier Chip detected. (This is a pre 802.12 chip)\n", dev->name);
+	else if (chip == HP100_CHIPID_LASSEN)
+		printk("hp100: %s: Lassen Chip detected.\n", dev->name);
+	else
+		printk("hp100: %s: Warning: Unknown CASCADE chip (id=0x%.4x).\n", dev->name, chip);
 #endif
-	}
 
 	dev->base_addr = ioaddr;
 
-	hp100_page(ID_MAC_ADDR);
-	for (i = uc = eisa_id = 0; i < 4; i++) {
-		eisa_id >>= 8;
-		uc_1 = hp100_inb(BOARD_ID + i);
-		eisa_id |= uc_1 << 24;
-		uc += uc_1;
-	}
-	uc += hp100_inb(BOARD_ID + 4);
-
-	if (uc != 0xff) {	/* bad checksum? */
-		printk("hp100_probe: %s: bad EISA ID checksum at base port 0x%x\n", dev->name, ioaddr);
-		return -ENODEV;
-	}
-
-	for (i = 0; i < HP100_EISA_IDS_SIZE; i++)
-		if (hp100_eisa_ids[i].id == eisa_id)
-			break;
-	if (i >= HP100_EISA_IDS_SIZE) {
-		for (i = 0; i < HP100_EISA_IDS_SIZE; i++)
-			if ((hp100_eisa_ids[i].id & 0xf0ffffff) == (eisa_id & 0xf0ffffff))
-				break;
-		if (i >= HP100_EISA_IDS_SIZE) {
-			printk ("hp100_probe: %s: card at port 0x%x isn't known (id = 0x%x)\n", dev->name, ioaddr, eisa_id);
-			return -ENODEV;
-		}
-	}
-	eid = &hp100_eisa_ids[i];
-	if ((eid->id & 0x0f000000) < (eisa_id & 0x0f000000)) {
-		printk("hp100_probe: %s: newer version of card %s at port 0x%x - unsupported\n", dev->name, eid->name, ioaddr);
-		return -ENODEV;
+	eid = hp100_read_id(ioaddr);
+	if (eid == NULL) {	/* bad checksum? */
+		printk(KERN_WARNING "hp100_probe: bad ID checksum at base port 0x%x\n", ioaddr);
+		goto out2;
 	}
 
+	hp100_page(ID_MAC_ADDR);
 	for (i = uc = 0; i < 7; i++)
 		uc += hp100_inb(LAN_ADDR + i);
 	if (uc != 0xff) {
-		printk("hp100_probe: %s: bad lan address checksum (card %s at port 0x%x)\n", dev->name, eid->name, ioaddr);
-		return -EIO;
+		printk(KERN_WARNING "hp100_probe: bad lan address checksum at port 0x%x)\n", ioaddr);
+		err = -EIO;
+		goto out2;
 	}
 
 	/* Make sure, that all registers are correctly updated... */
@@ -607,17 +516,17 @@
 		hp100_outw(HP100_MEM_EN | HP100_RESET_LB, OPTION_LSW);
 		hp100_outw(HP100_IO_EN | HP100_SET_LB, OPTION_LSW);
 		hp100_outw(HP100_BM_WRITE | HP100_BM_READ | HP100_RESET_HB, OPTION_LSW);
-		printk("hp100: %s: IO mapped mode forced.\n", dev->name);
+		printk("hp100: IO mapped mode forced.\n");
 	} else if (local_mode == 2) {
 		hp100_outw(HP100_MEM_EN | HP100_SET_LB, OPTION_LSW);
 		hp100_outw(HP100_IO_EN | HP100_SET_LB, OPTION_LSW);
 		hp100_outw(HP100_BM_WRITE | HP100_BM_READ | HP100_RESET_HB, OPTION_LSW);
-		printk("hp100: %s: Shared memory mode requested.\n", dev->name);
+		printk("hp100: Shared memory mode requested.\n");
 	} else if (local_mode == 4) {
 		if (chip == HP100_CHIPID_LASSEN) {
 			hp100_outw(HP100_BM_WRITE | HP100_BM_READ | HP100_SET_HB, OPTION_LSW);
 			hp100_outw(HP100_IO_EN | HP100_MEM_EN | HP100_RESET_LB, OPTION_LSW);
-			printk("hp100: %s: Busmaster mode requested.\n", dev->name);
+			printk("hp100: Busmaster mode requested.\n");
 		}
 		local_mode = 1;
 	}
@@ -643,7 +552,7 @@
 				/* Gracefully fallback to shared memory */
 				goto busmasterfail;
 			}
-			printk("hp100: %s: Busmaster mode enabled.\n", dev->name);
+			printk("hp100: Busmaster mode enabled.\n");
 			hp100_outw(HP100_MEM_EN | HP100_IO_EN | HP100_RESET_LB, OPTION_LSW);
 		} else {
 		busmasterfail:
@@ -675,7 +584,7 @@
 		mem_ptr_phys &= ~0x1fff;	/* 8k alignment */
 
 		if (bus == HP100_BUS_ISA && (mem_ptr_phys & ~0xfffff) != 0) {
-			printk("hp100: %s: Can only use programmed i/o mode.\n", dev->name);
+			printk("hp100: Can only use programmed i/o mode.\n");
 			mem_ptr_phys = 0;
 			mem_mapped = 0;
 			local_mode = 3;	/* Use programmed i/o */
@@ -699,7 +608,7 @@
 			}
 
 			if (mem_ptr_virt == NULL) {	/* all ioremap tries failed */
-				printk("hp100: %s: Failed to ioremap the PCI card memory. Will have to use i/o mapped mode.\n", dev->name);
+				printk("hp100: Failed to ioremap the PCI card memory. Will have to use i/o mapped mode.\n");
 				local_mode = 3;
 				virt_memory_size = 0;
 			}
@@ -710,17 +619,14 @@
 		mem_mapped = 0;
 		mem_ptr_phys = 0;
 		mem_ptr_virt = NULL;
-		printk("hp100: %s: Using (slow) programmed i/o mode.\n", dev->name);
+		printk("hp100: Using (slow) programmed i/o mode.\n");
 	}
 
 	/* Initialise the "private" data structure for this card. */
-	if ((dev->priv = kmalloc(sizeof(struct hp100_private), GFP_KERNEL)) == NULL)
-		return -ENOMEM;
-
 	lp = (struct hp100_private *) dev->priv;
-	memset(lp, 0, sizeof(struct hp100_private));
+
 	spin_lock_init(&lp->lock);
-	lp->id = eid;
+	strlcpy(lp->id, eid, HP100_SIG_LEN);
 	lp->chip = chip;
 	lp->mode = local_mode;
 	lp->bus = bus;
@@ -741,9 +647,6 @@
 	lp->virt_memory_size = virt_memory_size;
 	lp->rx_ratio = hp100_rx_ratio;	/* can be conf'd with insmod */
 
-	/* memory region for programmed i/o */
-	request_region(dev->base_addr, HP100_REGION_SIZE, eid->name);
-
 	dev->open = hp100_open;
 	dev->stop = hp100_close;
 
@@ -776,10 +679,6 @@
 	/* Reset statistics (counters) */
 	hp100_clear_stats(lp, ioaddr);
 
-	SET_MODULE_OWNER(dev);
-	SET_NETDEV_DEV(dev, &pci_dev->dev);
-	ether_setup(dev);
-
 	/* If busmaster mode is wanted, a dma-capable memory area is needed for
 	 * the rx and tx PDLs 
 	 * PCI cards can access the whole PC memory. Therefore GFP_DMA is not
@@ -795,8 +694,10 @@
 		/* Conversion to new PCI API :
 		 * Pages are always aligned and zeroed, no need to it ourself.
 		 * Doc says should be OK for EISA bus as well - Jean II */
-		if ((lp->page_vaddr_algn = pci_alloc_consistent(lp->pci_dev, MAX_RINGSIZE, &page_baddr)) == NULL)
-			return -ENOMEM;
+		if ((lp->page_vaddr_algn = pci_alloc_consistent(lp->pci_dev, MAX_RINGSIZE, &page_baddr)) == NULL) {
+			err = -ENOMEM;
+			goto out2;
+		}
 		lp->whatever_offset = ((u_long) page_baddr) - ((u_long) lp->page_vaddr_algn);
 
 #ifdef HP100_DEBUG_BM
@@ -818,7 +719,7 @@
 	lp->lan_type = hp100_sense_lan(dev);
 
 	/* Print out a message what about what we think we have probed. */
-	printk("hp100: %s: %s at 0x%x, IRQ %d, ", dev->name, lp->id->name, ioaddr, dev->irq);
+	printk("hp100: at 0x%x, IRQ %d, ", ioaddr, dev->irq);
 	switch (bus) {
 	case HP100_BUS_EISA:
 		printk("EISA");
@@ -833,7 +734,7 @@
 	printk(" bus, %dk SRAM (rx/tx %d%%).\n", lp->memory_size >> 10, lp->rx_ratio);
 
 	if (lp->mode == 2) {	/* memory mapped */
-		printk("hp100: %s: Memory area at 0x%lx-0x%lx", dev->name, mem_ptr_phys,
+		printk("hp100: Memory area at 0x%lx-0x%lx", mem_ptr_phys,
 				(mem_ptr_phys + (mem_ptr_phys > 0x100000 ? (u_long) lp->memory_size : 16 * 1024)) - 1);
 		if (mem_ptr_virt)
 			printk(" (virtual base %p)", mem_ptr_virt);
@@ -843,7 +744,8 @@
 		dev->mem_start = mem_ptr_phys;
 		dev->mem_end = mem_ptr_phys + lp->memory_size;
 	}
-	printk("hp100: %s: ", dev->name);
+
+	printk("hp100: ");
 	if (lp->lan_type != HP100_LAN_ERR)
 		printk("Adapter is attached to ");
 	switch (lp->lan_type) {
@@ -861,6 +763,10 @@
 	}
 
 	return 0;
+out2:
+	release_region(ioaddr, HP100_REGION_SIZE);
+out1:
+	return -ENODEV;
 }
 
 /* This procedure puts the card into a stable init state */
@@ -950,6 +856,7 @@
 	/* Finally try to log in the Hub if there may be a VG connection. */
 	if ((lp->lan_type == HP100_LAN_100) || (lp->lan_type == HP100_LAN_ERR))
 		hp100_login_to_vg_hub(dev, 0);	/* relogin */
+
 }
 
 
@@ -1152,7 +1059,7 @@
 	if (request_irq(dev->irq, hp100_interrupt,
 			lp->bus == HP100_BUS_PCI || lp->bus ==
 			HP100_BUS_EISA ? SA_SHIRQ : SA_INTERRUPT,
-			lp->id->name, dev)) {
+			"hp100", dev)) {
 		printk("hp100: %s: unable to get IRQ %d\n", dev->name, dev->irq);
 		return -EAGAIN;
 	}
@@ -2054,7 +1961,7 @@
 /*
  *  statistics
  */
-static hp100_stats_t *hp100_get_stats(struct net_device *dev)
+static struct net_device_stats *hp100_get_stats(struct net_device *dev)
 {
 	unsigned long flags;
 	int ioaddr = dev->base_addr;
@@ -2558,10 +2465,14 @@
 		return HP100_LAN_COAX;
 	}
 
-	if ((lp->id->id == 0x02019F022) ||
-	    (lp->id->id == 0x01042103c) || (lp->id->id == 0x01040103c))
-		return HP100_LAN_ERR;	/* Those cards don't have a 100 Mbit connector */
-
+	/* Those cards don't have a 100 Mbit connector */
+	if ( !strcmp(lp->id, "HWP1920")  ||
+	     (lp->pci_dev && 
+	      lp->pci_dev->vendor == PCI_VENDOR_ID && 
+	      (lp->pci_dev->device == PCI_DEVICE_ID_HP_J2970A ||
+	       lp->pci_dev->device == PCI_DEVICE_ID_HP_J2973A)))
+		return HP100_LAN_ERR;
+	
 	if (val_VG & HP100_LINK_CABLE_ST)	/* Can hear the HUBs tone. */
 		return HP100_LAN_100;
 	return HP100_LAN_ERR;
@@ -2915,122 +2826,248 @@
 #endif
 
 
+static void cleanup_dev(struct net_device *d)
+{
+	struct hp100_private *p = (struct hp100_private *) d->priv;
+
+	unregister_netdev(d);
+	release_region(d->base_addr, HP100_REGION_SIZE);
+
+	if (p->mode == 1)	/* busmaster */
+		pci_free_consistent(p->pci_dev, MAX_RINGSIZE + 0x0f, 
+				    p->page_vaddr_algn, 
+				    virt_to_whatever(d, p->page_vaddr_algn));
+	if (p->mem_ptr_virt)
+		iounmap(p->mem_ptr_virt);
+
+	free_netdev(d);
+}
+
+#ifdef CONFIG_EISA
+static int __init hp100_eisa_probe (struct device *gendev)
+{
+	struct net_device *dev = alloc_etherdev(sizeof(struct hp100_private));
+	struct eisa_device *edev = to_eisa_device(gendev);
+	int err;
+
+	if (!dev)
+		return -ENOMEM;
+
+	SET_MODULE_OWNER(dev);
+	SET_NETDEV_DEV(dev, &edev->dev);
+
+	err = hp100_probe1(dev, edev->base_addr, HP100_BUS_EISA, NULL);
+	if (err)
+		goto out1;
+
+	err = register_netdev(dev);
+	if (err)
+		goto out2;
+	
+#ifdef HP100_DEBUG
+	printk("hp100: %s: EISA adapter found at 0x%x\n", dev->name, 
+	       dev->base_addr);
+#endif
+	gendev->driver_data = dev;
+	return 0;
+ out2:
+	release_region(dev->base_addr, HP100_REGION_SIZE);
+ out1:
+	free_netdev(dev);
+	return err;
+}
+
+static int __devexit hp100_eisa_remove (struct device *gendev)
+{
+	struct net_device *dev = gendev->driver_data;
+	cleanup_dev(dev);
+	return 0;
+}
+
+static struct eisa_driver hp100_eisa_driver = {
+        .id_table = hp100_eisa_tbl,
+        .driver   = {
+                .name    = "hp100",
+                .probe   = hp100_eisa_probe,
+                .remove  = __devexit_p (hp100_eisa_remove),
+        }
+};
+#endif
+
+#ifdef CONFIG_PCI
+static int __devinit hp100_pci_probe (struct pci_dev *pdev,
+				     const struct pci_device_id *ent)
+{
+	struct net_device *dev = alloc_etherdev(sizeof(struct hp100_private));
+	int ioaddr = pci_resource_start(pdev, 0);
+	u_short pci_command;
+	int err;
+	
+	if (!dev)
+		return -ENOMEM;
+
+	SET_MODULE_OWNER(dev);
+	SET_NETDEV_DEV(dev, &pdev->dev);
+
+	pci_read_config_word(pdev, PCI_COMMAND, &pci_command);
+	if (!(pci_command & PCI_COMMAND_IO)) {
+#ifdef HP100_DEBUG
+		printk("hp100: %s: PCI I/O Bit has not been set. Setting...\n", dev->name);
+#endif
+		pci_command |= PCI_COMMAND_IO;
+		pci_write_config_word(pdev, PCI_COMMAND, pci_command);
+	}
+
+	if (!(pci_command & PCI_COMMAND_MASTER)) {
+#ifdef HP100_DEBUG
+		printk("hp100: %s: PCI Master Bit has not been set. Setting...\n", dev->name);
+#endif
+		pci_command |= PCI_COMMAND_MASTER;
+		pci_write_config_word(pdev, PCI_COMMAND, pci_command);
+	}
+	
+
+	err = hp100_probe1(dev, ioaddr, HP100_BUS_PCI, pdev);
+	if (err) 
+		goto out1;
+	err = register_netdev(dev);
+	if (err)
+		goto out2;
+	
+#ifdef HP100_DEBUG
+	printk("hp100: %s: PCI adapter found at 0x%x\n", dev->name, ioaddr);
+#endif
+	pci_set_drvdata(pdev, dev);
+	return 0;
+ out2:
+	release_region(dev->base_addr, HP100_REGION_SIZE);
+ out1:
+	free_netdev(dev);
+	return err;
+}
+
+static void __devexit hp100_pci_remove (struct pci_dev *pdev)
+{
+	struct net_device *dev = pci_get_drvdata(pdev);
+
+	cleanup_dev(dev);
+}
+
+
+static struct pci_driver hp100_pci_driver = {
+	.name		= "hp100",
+	.id_table	= hp100_pci_tbl,
+	.probe		= hp100_pci_probe,
+	.remove		= __devexit_p(hp100_pci_remove),
+};
+#endif
+
 /*
  *  module section
  */
 
-#ifdef MODULE
-
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>, "
               "Siegfried \"Frieder\" Loeffler (dg1sek) <floeff@mathematik.uni-stuttgart.de>");
 MODULE_DESCRIPTION("HP CASCADE Architecture Driver for 100VG-AnyLan Network Adapters");
 
 /*
- * Note: if you have more than five 100vg cards in your pc, feel free to
- * increase this value 
- */
-
-#define HP100_DEVICES 5
-
-/*
- * Note: to register three eisa or pci devices, use:
+ * Note: to register three isa devices, use:
  * option hp100 hp100_port=0,0,0
  *        to register one card at io 0x280 as eth239, use:
- * option hp100 hp100_port=0x280 hp100_name=eth239
+ * option hp100 hp100_port=0x280
  */
-
+#if defined(MODULE) && defined(CONFIG_ISA)
+#define HP100_DEVICES 5
 /* Parameters set by insmod */
 static int hp100_port[HP100_DEVICES] = { 0, [1 ... (HP100_DEVICES-1)] = -1 };
 MODULE_PARM(hp100_port, "1-" __MODULE_STRING(HP100_DEVICES) "i");
 
-/* Allocate HP100_DEVICES strings of length IFNAMSIZ, one string for each device */
-static char hp100_name[HP100_DEVICES][IFNAMSIZ] = { "", "", "", "", "" };
-/* Allow insmod to write those HP100_DEVICES strings individually */
-MODULE_PARM(hp100_name, "1-" __MODULE_STRING(HP100_DEVICES) "c" __MODULE_STRING(IFNAMSIZ));
-
 /* List of devices */
 static struct net_device *hp100_devlist[HP100_DEVICES];
 
-static void release_dev(int i)
+static int __init hp100_isa_init(void)
 {
-	struct net_device *d = hp100_devlist[i];
-	struct hp100_private *p = (struct hp100_private *) d->priv;
+	struct net_device *dev;
+	int i, err, cards = 0;
 
-	unregister_netdev(d);
-	release_region(d->base_addr, HP100_REGION_SIZE);
+	/* Don't autoprobe ISA bus */
+	if (hp100_port[0] == 0)
+		return -ENODEV;
 
-	if (p->mode == 1)	/* busmaster */
-		pci_free_consistent(p->pci_dev, MAX_RINGSIZE + 0x0f, p->page_vaddr_algn, virt_to_whatever(d, p->page_vaddr_algn));
-	if (p->mem_ptr_virt)
-		iounmap(p->mem_ptr_virt);
-	kfree(d->priv);
-	d->priv = NULL;
-	free_netdev(d);
-	hp100_devlist[i] = NULL;
+	/* Loop on all possible base addresses */
+	for (i = 0; i < HP100_DEVICES && hp100_port[i] != -1; ++i) {
+		dev = alloc_etherdev(sizeof(struct hp100_private));
+		if (!dev) {
+			printk(KERN_WARNING "hp100: no memory for network device\n");
+			while (cards > 0)
+				cleanup_dev(hp100_devlist[--cards]);
+
+			return -ENOMEM;
+		}
+		SET_MODULE_OWNER(dev);
+
+		err = hp100_isa_probe(dev, hp100_port[i]);
+		if (!err) {
+			err = register_netdev(dev);
+			if (!err) 
+				hp100_devlist[cards++] = dev;
+			else
+				release_region(dev->base_addr, HP100_REGION_SIZE);
+		}
+
+		if (err)
+			free_netdev(dev);
+	}
+
+	return cards > 0 ? 0 : -ENODEV;
 }
 
-static int __init hp100_module_init(void)
+static void __exit hp100_isa_cleanup(void) 
 {
-	int i, cards;
+	int i;
 
-#ifndef CONFIG_PCI
-	if (hp100_port == 0 && !EISA_bus)
-		printk("hp100: You should not use auto-probing with insmod!\n");
+	for (i = 0; i < HP100_DEVICES; i++) {
+		struct net_device *dev = hp100_devlist[i];
+		if (dev)
+			cleanup_dev(dev);
+	}
+}
+#else
+#define hp100_isa_init()	(0)
+#define hp100_isa_cleanup()	do { } while(0)
 #endif
 
-	/* Loop on all possible base addresses */
-	i = -1;
-	cards = 0;
-	while ((hp100_port[++i] != -1) && (i < HP100_DEVICES)) {
-		/* Create device and set basics args */
-		hp100_devlist[i] = kmalloc(sizeof(struct net_device), GFP_KERNEL);
-		if (!hp100_devlist[i])
-			goto fail;
-		memset(hp100_devlist[i], 0x00, sizeof(struct net_device));
-#if LINUX_VERSION_CODE >= 0x020362	/* 2.3.99-pre7 */
-		memcpy(hp100_devlist[i]->name, hp100_name[i], IFNAMSIZ);	/* Copy name */
-#else
-		hp100_devlist[i]->name = hp100_name[i];
-#endif				/* LINUX_VERSION_CODE >= 0x020362 */
-		hp100_devlist[i]->base_addr = hp100_port[i];
-		hp100_devlist[i]->init = &hp100_probe;
-
-		/* Try to create the device */
-		if (register_netdev(hp100_devlist[i]) != 0) {
-			/* DeAllocate everything */
-			/* Note: if dev->priv is mallocated, there is no way to fail */
-			kfree(hp100_devlist[i]);
-			hp100_devlist[i] = (struct net_device *) NULL;
-		} else
-			cards++;
-	}			/* Loop over all devices */
+static int __init hp100_module_init(void)
+{
+	int err;
 
-	return cards > 0 ? 0 : -ENODEV;
-      fail:
-	while (cards && --i)
-		if (hp100_devlist[i]) {
-			release_dev(i);
-			--cards;
-		}
-	return -ENOMEM;
+	err = hp100_isa_init();
+
+#ifdef CONFIG_EISA
+	err |= eisa_driver_register(&hp100_eisa_driver);
+#endif
+#ifdef CONFIG_PCI
+	err |= pci_module_init(&hp100_pci_driver);
+#endif
+	return err;
 }
 
+
 static void __exit hp100_module_exit(void)
 {
-	int i;
-
-	/* TODO: Check if all skb's are released/freed. */
-	for (i = 0; i < HP100_DEVICES; i++)
-		if (hp100_devlist[i] != (struct net_device *) NULL)
-			release_dev(i);
+	hp100_isa_cleanup();
+#ifdef CONFIG_EISA
+	eisa_driver_unregister (&hp100_eisa_driver);
+#endif
+#ifdef CONFIG_PCI
+	pci_unregister_driver (&hp100_pci_driver);
+#endif
 }
 
 module_init(hp100_module_init)
 module_exit(hp100_module_exit)
 
-#endif				/* MODULE */
-
 
 /*
  * Local variables:
--- diff/drivers/net/hplance.c	2003-08-26 10:00:53.000000000 +0100
+++ source/drivers/net/hplance.c	2004-02-09 10:39:53.000000000 +0000
@@ -50,8 +50,7 @@
  * plus board-specific init, open and close actions. 
  * Oh, and we need to tell the generic code how to read and write LANCE registers...
  */
-int hplance_probe(struct net_device *dev);
-static int hplance_init(struct net_device *dev, int scode);
+static void hplance_init(struct net_device *dev, int scode);
 static int hplance_open(struct net_device *dev);
 static int hplance_close(struct net_device *dev);
 static void hplance_writerap(void *priv, unsigned short value);
@@ -62,57 +61,61 @@
 static struct hplance_private *root_hplance_dev;
 #endif
 
+static void cleanup_card(struct net_device *dev)
+{
+        struct hplance_private *lp = dev->priv;
+	dio_unconfig_board(lp->scode);
+}
+
 /* Find all the HP Lance boards and initialise them... */
-int __init hplance_probe(struct net_device *dev)
+struct net_device * __init hplance_probe(int unit)
 {
-        int cards = 0, called = 0;
+	struct net_device *dev;
+
+        if (!MACH_IS_HP300)
+                return ERR_PTR(-ENODEV);
+
+	dev = alloc_etherdev(sizeof(struct hplance_private));
+	if (!dev)
+		return ERR_PTR(-ENOMEM);
+
+	if (unit >= 0) {
+		sprintf(dev->name, "eth%d", unit);
+		netdev_boot_setup_check(dev);
+	}
 
-        if (!MACH_IS_HP300 || called)
-                return(ENODEV);
-        called++;
+	SET_MODULE_OWNER(dev);
         
         /* Isn't DIO nice? */
         for(;;)
         {
-                int v, scode = dio_find(DIO_ID_LAN);
+                int scode = dio_find(DIO_ID_LAN);
                                 
                 if (!scode)
                         break;
                 
-                if(cards)
-                        dev = NULL;      /* don't trash previous device, make a new one */
-                cards++;
-                
-                v = hplance_init(dev, scode);
-                if (v)                            /* error, abort immediately */
-                        return v;
+		dio_config_board(scode);
+                hplance_init(dev, scode);
+		if (!register_netdev(dev)) {
+			struct hplance_private *lp = dev->priv;
+			lp->next_module = root_hplance_dev;
+			root_hplance_dev = lp;
+			return dev;
+		}
+		cleanup_card(dev);
         }
-        /* OK, return success, or ENODEV if we didn't find any cards */
-        if (!cards)
-                return -ENODEV;
-        return 0;
+	free_netdev(dev);
+	return ERR_PTR(-ENODEV);
 }
 
 /* Initialise a single lance board at the given select code */
-static int __init hplance_init(struct net_device *dev, int scode)
+static void __init hplance_init(struct net_device *dev, int scode)
 {
         const char *name = dio_scodetoname(scode);
         void *va = dio_scodetoviraddr(scode);
         struct hplance_private *lp;
         int i;
         
-#ifdef MODULE
-	dev = init_etherdev(0, sizeof(struct hplance_private));
-	if (!dev)
-		return -ENOMEM;
-#else
-	dev->priv = kmalloc(sizeof(struct hplance_private), GFP_KERNEL);
-	if (dev->priv == NULL)
-		return -ENOMEM;
-	memset(dev->priv, 0, sizeof(struct hplance_private));
-#endif
-	SET_MODULE_OWNER(dev);
-
         printk("%s: %s; select code %d, addr", dev->name, name, scode);
 
         /* reset the board */
@@ -154,17 +157,7 @@
         lp->lance.tx_ring_mod_mask = TX_RING_MOD_MASK;
         lp->scode = scode;
 	lp->base = va;
-        ether_setup(dev);
 	printk(", irq %d\n", lp->lance.irq);
-
-#ifdef MODULE
-        dev->ifindex = dev_new_index();
-        lp->next_module = root_hplance_dev;
-        root_hplance_dev = lp;
-#endif /* MODULE */
-
-        dio_config_board(scode);                  /* tell bus scanning code this one's taken */
-        return 0;
 }
 
 /* This is disgusting. We have to check the DIO status register for ack every
@@ -227,8 +220,10 @@
 MODULE_LICENSE("GPL");
 int init_module(void)
 {
-        root_lance_dev = NULL;
-        return hplance_probe(NULL);
+	int found = 0;
+	while (!IS_ERR(hplance_probe(-1)))
+		found++;
+	return found ? 0 : -ENODEV;
 }
 
 void cleanup_module(void)
@@ -237,8 +232,8 @@
         struct hplance_private *lp;
         while (root_hplance_dev) {
                 lp = root_hplance_dev->next_module;
-                dio_unconfig_board(lp->scode);
                 unregister_netdev(root_lance_dev->dev);
+                cleanup_card(root_lance_dev->dev);
                 free_netdev(root_lance_dev->dev);
                 root_lance_dev = lp;
         }
--- diff/drivers/net/hydra.c	2003-08-26 10:00:53.000000000 +0100
+++ source/drivers/net/hydra.c	2004-02-09 10:39:53.000000000 +0000
@@ -89,13 +89,14 @@
     const char name[] = "NE2000";
     int start_page, stop_page;
     int j;
+    int err;
 
     static u32 hydra_offsets[16] = {
 	0x00, 0x02, 0x04, 0x06, 0x08, 0x0a, 0x0c, 0x0e,
 	0x10, 0x12, 0x14, 0x16, 0x18, 0x1a, 0x1c, 0x1e,
     };
 
-    dev = init_etherdev(NULL, 0);
+    dev = alloc_ei_netdev();
     if (!dev)
 	return -ENOMEM;
     SET_MODULE_OWNER(dev);
@@ -113,13 +114,9 @@
 
     /* Install the Interrupt handler */
     if (request_irq(IRQ_AMIGA_PORTS, ei_interrupt, SA_SHIRQ, "Hydra Ethernet",
-		    dev))
+		    dev)) {
+	free_netdev(dev);
 	return -EAGAIN;
-
-    /* Allocate dev->priv and fill in 8390 specific dev fields. */
-    if (ethdev_init(dev)) {
-	printk("Unable to get memory for dev->priv.\n");
-	return -ENOMEM;
     }
 
     printk("%s: hydra at 0x%08lx, address %02x:%02x:%02x:%02x:%02x:%02x (hydra.c " HYDRA_VERSION ")\n", dev->name, ZTWO_PADDR(board),
@@ -141,12 +138,21 @@
     ei_status.reg_offset = hydra_offsets;
     dev->open = &hydra_open;
     dev->stop = &hydra_close;
+#ifdef CONFIG_NET_POLL_CONTROLLER
+    dev->poll_controller = ei_poll;
+#endif
 #ifdef MODULE
     ei_status.priv = (unsigned long)root_hydra_dev;
     root_hydra_dev = dev;
 #endif
     NS8390_init(dev, 0);
-    return 0;
+    err = register_netdev(dev);
+    if (!err)
+	return 0;
+
+    free_irq(IRQ_AMIGA_PORTS, dev);
+    free_netdev(dev);
+    return err;
 }
 
 static int hydra_open(struct net_device *dev)
--- diff/drivers/net/ibmlana.c	2003-10-09 09:47:34.000000000 +0100
+++ source/drivers/net/ibmlana.c	2004-02-09 10:39:53.000000000 +0000
@@ -906,7 +906,7 @@
 
 static int startslot;		/* counts through slots when probing multiple devices */
 
-int ibmlana_probe(struct net_device *dev)
+static int ibmlana_probe(struct net_device *dev)
 {
 	int force_detect = 0;
 	int slot, z;
@@ -924,34 +924,21 @@
 	if (dev->mem_start == 1)
 		force_detect = 1;
 
-	/* search through slots */
-	if (dev != NULL) {
-		base = dev->mem_start;
-		irq = dev->irq;
-	}
-	slot = mca_find_adapter(IBM_LANA_ID, startslot);
+	base = dev->mem_start;
+	irq = dev->irq;
 
-	while (slot != -1) {
+	for (slot = startslot; (slot = mca_find_adapter(IBM_LANA_ID, slot)) != -1; slot++) {
 		/* deduce card addresses */
 		getaddrs(slot, &base, &memlen, &iobase, &irq, &medium);
 
 		/* slot already in use ? */
-		if (mca_is_adapter_used(slot)) {
-			slot = mca_find_adapter(IBM_LANA_ID, slot + 1);
+		if (mca_is_adapter_used(slot))
 			continue;
-		}
 		/* were we looking for something different ? */
-		if (dev->irq != 0 || dev->mem_start != 0) {
-			if (dev->irq != 0 && dev->irq != irq) {
-				slot = mca_find_adapter(IBM_LANA_ID, slot + 1);
-				continue;
-			}
-			if (dev->mem_start != 0 && dev->mem_start != base) 
-			{
-				slot = mca_find_adapter(IBM_LANA_ID, slot + 1);
-				continue;
-			}
-		}
+		if (dev->irq && dev->irq != irq)
+			continue;
+		if (dev->mem_start && dev->mem_start != base)
+			continue;
 		/* found something that matches */
 		break;
 	}
@@ -977,16 +964,11 @@
 	mca_mark_as_used(slot);
 
 	/* allocate structure */
-	priv = dev->priv = (ibmlana_priv *) kmalloc(sizeof(ibmlana_priv), GFP_KERNEL);
-	if (!priv) {
-		release_region(iobase, IBM_LANA_IORANGE);
-		return -ENOMEM;
-	}
+	priv = dev->priv;
 	priv->slot = slot;
 	priv->realirq = irq;
 	priv->medium = medium;
 	spin_lock_init(&priv->lock);
-	memset(&priv->stat, 0, sizeof(struct net_device_stats));
 
 	/* set base + irq for this device (irq not allocated so far) */
 
@@ -1006,10 +988,6 @@
 	dev->set_multicast_list = ibmlana_set_multicast_list;
 	dev->flags |= IFF_MULTICAST;
 
-	/* generic setup */
-
-	ether_setup(dev);
-
 	/* copy out MAC address */
 
 	for (z = 0; z < sizeof(dev->dev_addr); z++)
@@ -1044,7 +1022,7 @@
 
 #define DEVMAX 5
 
-static struct net_device moddevs[DEVMAX];
+static struct net_device *moddevs[DEVMAX];
 static int irq;
 static int io;
 
@@ -1056,41 +1034,47 @@
 
 int init_module(void)
 {
-	int z, res;
+	int z;
 
 	startslot = 0;
 	for (z = 0; z < DEVMAX; z++) {
-		moddevs[z].init = ibmlana_probe;
-		moddevs[z].irq = irq;
-		moddevs[z].base_addr = io;
-		res = register_netdev(moddevs + z);
-		if (res != 0)
-			return (z > 0) ? 0 : -EIO;
+		struct net_device *dev = alloc_etherdev(sizeof(ibmlana_priv));
+		if (!dev)
+			break;
+		dev->irq = irq;
+		dev->base_addr = io;
+		if (ibmlana_probe(dev)) {
+			free_netdev(dev);
+			break;
+		}
+		if (register_netdev(dev)) {
+			ibmlana_priv *priv = dev->priv;
+			release_region(dev->base_addr, IBM_LANA_IORANGE);
+			mca_mark_as_unused(priv->slot);
+			mca_set_adapter_name(priv->slot, "");
+			mca_set_adapter_procfn(priv->slot, NULL, NULL);
+			free_netdev(dev);
+			break;
+		}
+		moddevs[z] = dev;
 	}
-	return 0;
+	return (z > 0) ? 0 : -EIO;
 }
 
 void cleanup_module(void)
 {
-	struct net_device *dev;
-	ibmlana_priv *priv;
 	int z;
-
 	for (z = 0; z < DEVMAX; z++) {
-		dev = moddevs + z;
-		if (dev->priv != NULL) {
-			priv = (ibmlana_priv *) dev->priv;
+		struct net_device *dev = moddevs[z];
+		if (dev) {
+			ibmlana_priv *priv = (ibmlana_priv *) dev->priv;
+			unregister_netdev(dev);
 			/*DeinitBoard(dev); */
-			if (dev->irq != 0)
-				free_irq(dev->irq, dev);
-			dev->irq = 0;
 			release_region(dev->base_addr, IBM_LANA_IORANGE);
-			unregister_netdev(dev);
 			mca_mark_as_unused(priv->slot);
 			mca_set_adapter_name(priv->slot, "");
 			mca_set_adapter_procfn(priv->slot, NULL, NULL);
-			kfree(dev->priv);
-			dev->priv = NULL;
+			free_netdev(dev);
 		}
 	}
 }
--- diff/drivers/net/ibmlana.h	2002-11-11 11:09:37.000000000 +0000
+++ source/drivers/net/ibmlana.h	2004-02-09 10:39:53.000000000 +0000
@@ -275,7 +275,4 @@
 
 #endif				/* _IBM_LANA_DRIVER_ */
 
-extern int ibmlana_probe(struct net_device *);
-
-
 #endif	/* _IBM_LANA_INCLUDE_ */
--- diff/drivers/net/irda/sa1100_ir.c	2003-10-27 09:20:38.000000000 +0000
+++ source/drivers/net/irda/sa1100_ir.c	2004-02-09 10:39:53.000000000 +0000
@@ -20,6 +20,7 @@
  */
 #include <linux/config.h>
 #include <linux/module.h>
+#include <linux/moduleparam.h>
 #include <linux/types.h>
 #include <linux/init.h>
 #include <linux/errno.h>
@@ -358,9 +359,13 @@
 static int sa1100_irda_suspend(struct device *_dev, u32 state, u32 level)
 {
 	struct net_device *dev = dev_get_drvdata(_dev);
-	struct sa1100_irda *si = dev->priv;
+	struct sa1100_irda *si;
+
+	if (!dev || level != SUSPEND_DISABLE)
+		return 0;
 
-	if (si && si->open && level == SUSPEND_DISABLE) {
+	si = dev->priv;
+	if (si->open) {
 		/*
 		 * Stop the transmit queue
 		 */
@@ -379,9 +384,13 @@
 static int sa1100_irda_resume(struct device *_dev, u32 level)
 {
 	struct net_device *dev = dev_get_drvdata(_dev);
-	struct sa1100_irda *si = dev->priv;
+	struct sa1100_irda *si;
 
-	if (si && si->open && level == RESUME_ENABLE) {
+	if (!dev || level != RESUME_ENABLE)
+		return 0;
+
+	si = dev->priv;
+	if (si->open) {
 		/*
 		 * If we missed a speed change, initialise at the new speed
 		 * directly.  It is debatable whether this is actually
@@ -833,8 +842,6 @@
 	struct sa1100_irda *si = dev->priv;
 	int err;
 
-	MOD_INC_USE_COUNT;
-
 	si->speed = 9600;
 
 	err = request_irq(dev->irq, sa1100_irda_irq, 0, dev->name, dev);
@@ -890,7 +897,6 @@
 err_rx_dma:
 	free_irq(dev->irq, dev);
 err_irq:
-	MOD_DEC_USE_COUNT;
 	return err;
 }
 
@@ -930,8 +936,6 @@
 
 	sa1100_set_power(si, 0);
 
-	MOD_DEC_USE_COUNT;
-
 	return 0;
 }
 
@@ -947,56 +951,48 @@
 	return io->head ? 0 : -ENOMEM;
 }
 
-static struct device_driver sa1100ir_driver = {
-	.name		= "sa1100ir",
-	.bus		= &system_bus_type,
-	.suspend	= sa1100_irda_suspend,
-	.resume		= sa1100_irda_resume,
-};
-
-static struct sys_device sa1100ir_device = {
-	.name		= "sa1100ir",
-	.id		= 0,
-	.root		= NULL,
-	.dev		= {
-		.name	= "Intel Corporation SA11x0 [IrDA]",
-		.bus_id	= "0",
-		.driver	= &sa1100ir_driver,
-	},
-};
-
-static int sa1100_irda_net_init(struct net_device *dev)
+static int sa1100_irda_probe(struct device *_dev)
 {
-	struct sa1100_irda *si = dev->priv;
+	struct platform_device *pdev = to_platform_device(_dev);
+	struct net_device *dev;
+	struct sa1100_irda *si;
 	unsigned int baudrate_mask;
-	int err = -ENOMEM;
+	int err;
 
-	si = kmalloc(sizeof(struct sa1100_irda), GFP_KERNEL);
-	if (!si)
-		goto out;
+	err = request_mem_region(__PREG(Ser2UTCR0), 0x24, "IrDA") ? 0 : -EBUSY;
+	if (err)
+		goto err_mem_1;
+	err = request_mem_region(__PREG(Ser2HSCR0), 0x1c, "IrDA") ? 0 : -EBUSY;
+	if (err)
+		goto err_mem_2;
+	err = request_mem_region(__PREG(Ser2HSCR2), 0x04, "IrDA") ? 0 : -EBUSY;
+	if (err)
+		goto err_mem_3;
 
-	memset(si, 0, sizeof(*si));
+	dev = alloc_irdadev(sizeof(struct sa1100_irda));
+	if (!dev)
+		goto err_mem_4;
 
-	si->dev = &sa1100ir_device.dev;
+	si = dev->priv;
+	si->dev = &pdev->dev;
 
 	/*
 	 * Initialise the HP-SIR buffers
 	 */
 	err = sa1100_irda_init_iobuf(&si->rx_buff, 14384);
 	if (err)
-		goto out;
+		goto err_mem_5;
 	err = sa1100_irda_init_iobuf(&si->tx_buff, 4000);
 	if (err)
-		goto out_free_rx;
+		goto err_mem_5;
 
-	dev->priv = si;
 	dev->hard_start_xmit	= sa1100_irda_hard_xmit;
 	dev->open		= sa1100_irda_start;
 	dev->stop		= sa1100_irda_stop;
 	dev->do_ioctl		= sa1100_irda_ioctl;
 	dev->get_stats		= sa1100_irda_stats;
+	dev->irq		= IRQ_Ser2ICP;
 
-	irda_device_setup(dev);
 	irda_init_max_qos_capabilies(&si->qos);
 
 	/*
@@ -1030,42 +1026,62 @@
 	Ser2UTCR4 = si->utcr4;
 	Ser2HSCR0 = HSCR0_UART;
 
-	return 0;
-
-	kfree(si->tx_buff.head);
-out_free_rx:
-	kfree(si->rx_buff.head);
-out:
-	kfree(si);
+	err = register_netdev(dev);
+	if (err == 0)
+		dev_set_drvdata(&pdev->dev, si);
 
+	if (err) {
+ err_mem_5:
+		kfree(si->tx_buff.head);
+		kfree(si->rx_buff.head);
+		free_netdev(dev);
+ err_mem_4:
+		release_mem_region(__PREG(Ser2HSCR2), 0x04);
+ err_mem_3:
+		release_mem_region(__PREG(Ser2HSCR0), 0x1c);
+ err_mem_2:
+		release_mem_region(__PREG(Ser2UTCR0), 0x24);
+	}
+ err_mem_1:
 	return err;
 }
 
-/*
- * Remove all traces of this driver module from the kernel, so we can't be
- * called.  Note that the device has already been stopped, so we don't have
- * to worry about interrupts or dma.
- */
-static void sa1100_irda_net_uninit(struct net_device *dev)
+static int sa1100_irda_remove(struct device *_dev)
 {
-	struct sa1100_irda *si = dev->priv;
+	struct net_device *dev = dev_get_drvdata(_dev);
 
-	dev->hard_start_xmit	= NULL;
-	dev->open		= NULL;
-	dev->stop		= NULL;
-	dev->do_ioctl		= NULL;
-	dev->get_stats		= NULL;
-	dev->priv		= NULL;
-
-	kfree(si->tx_buff.head);
-	kfree(si->rx_buff.head);
-	kfree(si);
+	if (dev) {
+		struct sa1100_irda *si = dev->priv;
+		unregister_netdev(dev);
+		kfree(si->tx_buff.head);
+		kfree(si->rx_buff.head);
+		free_netdev(dev);
+	}
+
+	release_mem_region(__PREG(Ser2HSCR2), 0x04);
+	release_mem_region(__PREG(Ser2HSCR0), 0x1c);
+	release_mem_region(__PREG(Ser2UTCR0), 0x24);
+
+	return 0;
 }
 
+static struct device_driver sa1100ir_driver = {
+	.name		= "sa11x0-ir",
+	.bus		= &platform_bus_type,
+	.probe		= sa1100_irda_probe,
+	.remove		= sa1100_irda_remove,
+	.suspend	= sa1100_irda_suspend,
+	.resume		= sa1100_irda_resume,
+};
+
+static struct platform_device sa1100ir_device = {
+	.name		= "sa11x0-ir",
+	.id		= 0,
+};
+
 static int __init sa1100_irda_init(void)
 {
-	struct net_device *dev;
-	int err;
+	int ret;
 
 	/*
 	 * Limit power level a sensible range.
@@ -1075,103 +1091,30 @@
 	if (power_level > 3)
 		power_level = 3;
 
-	err = request_mem_region(__PREG(Ser2UTCR0), 0x24, "IrDA") ? 0 : -EBUSY;
-	if (err)
-		goto err_mem_1;
-	err = request_mem_region(__PREG(Ser2HSCR0), 0x1c, "IrDA") ? 0 : -EBUSY;
-	if (err)
-		goto err_mem_2;
-	err = request_mem_region(__PREG(Ser2HSCR2), 0x04, "IrDA") ? 0 : -EBUSY;
-	if (err)
-		goto err_mem_3;
-
-	driver_register(&sa1100ir_driver);
-	sys_device_register(&sa1100ir_device);
-
-	rtnl_lock();
-	dev = dev_alloc("irda%d", &err);
-	if (dev) {
-		dev->irq    = IRQ_Ser2ICP;
-		dev->init   = sa1100_irda_net_init;
-		dev->uninit = sa1100_irda_net_uninit;
-
-		err = register_netdevice(dev);
-
-		if (err)
-			kfree(dev);
-		else
-			dev_set_drvdata(&sa1100ir_device.dev, dev);
+	ret = driver_register(&sa1100ir_driver);
+	if (ret == 0) {
+		ret = platform_device_register(&sa1100ir_device);
+		if (ret)
+			driver_unregister(&sa1100ir_driver);
 	}
-	rtnl_unlock();
-
-	if (err) {
-		sys_device_unregister(&sa1100ir_device);
-		driver_unregister(&sa1100ir_driver);
-
-		release_mem_region(__PREG(Ser2HSCR2), 0x04);
-err_mem_3:
-		release_mem_region(__PREG(Ser2HSCR0), 0x1c);
-err_mem_2:
-		release_mem_region(__PREG(Ser2UTCR0), 0x24);
-	}
-err_mem_1:
-	return err;
+	return ret;
 }
 
 static void __exit sa1100_irda_exit(void)
 {
-	struct net_device *dev = dev_get_drvdata(&sa1100ir_device.dev);
-
-	if (dev)
-		unregister_netdev(dev);
-
-	sys_device_unregister(&sa1100ir_device);
 	driver_unregister(&sa1100ir_driver);
-
-	release_mem_region(__PREG(Ser2HSCR2), 0x04);
-	release_mem_region(__PREG(Ser2HSCR0), 0x1c);
-	release_mem_region(__PREG(Ser2UTCR0), 0x24);
-
-	if(dev)
-		free_netdev(dev);
+	platform_device_unregister(&sa1100ir_device);
 }
 
-static int __init sa1100ir_setup(char *line)
-{
-	char *opt;
-
-	if (!line)
-		return 0;
-
-	while ((opt = strsep(&line, ",")) != NULL) {
-		if (!strncmp(opt, "max_rate:", 9)) {
-			max_rate = simple_strtoul(opt + 9, NULL, 0);
-			continue;
-		}
-		if (!strncmp(opt, "power_level:", 12)) {
-			power_level = simple_strtoul(opt + 12, NULL, 0);
-			continue;
-		}
-		if (!strncmp(opt, "tx_lpm:", 7)) {
-			tx_lpm = simple_strtoul(opt + 7, NULL, 0);
-			continue;
-		}
-	}
-
-	return 1;
-}
-
-__setup("sa1100ir=", sa1100ir_setup);
-
 module_init(sa1100_irda_init);
 module_exit(sa1100_irda_exit);
+module_param(power_level, int, 0);
+module_param(tx_lpm, int, 0);
+module_param(max_rate, int, 0);
 
 MODULE_AUTHOR("Russell King <rmk@arm.linux.org.uk>");
 MODULE_DESCRIPTION("StrongARM SA1100 IrDA driver");
 MODULE_LICENSE("GPL");
-MODULE_PARM(power_level, "i");
 MODULE_PARM_DESC(power_level, "IrDA power level, 1 (low) to 3 (high)");
-MODULE_PARM(tx_lpm, "i");
 MODULE_PARM_DESC(tx_lpm, "Enable transmitter low power (1.6us) mode");
-MODULE_PARM(max_rate, "i");
 MODULE_PARM_DESC(max_rate, "Maximum baud rate (4000000, 115200, 57600, 38400, 19200, 9600)");
--- diff/drivers/net/isa-skeleton.c	2003-05-21 11:50:15.000000000 +0100
+++ source/drivers/net/isa-skeleton.c	2004-02-09 10:39:53.000000000 +0000
@@ -104,8 +104,6 @@
 
 /* Index to functions, as function prototypes. */
 
-extern int netcard_probe(struct net_device *dev);
-
 static int	netcard_probe1(struct net_device *dev, int ioaddr);
 static int	net_open(struct net_device *dev);
 static int	net_send_packet(struct sk_buff *skb, struct net_device *dev);
@@ -129,11 +127,11 @@
  * If dev->base_addr == 2, allocate space for the device and return success
  * (detachable devices only).
  */
-int __init 
-netcard_probe(struct net_device *dev)
+static int __init do_netcard_probe(struct net_device *dev)
 {
 	int i;
 	int base_addr = dev->base_addr;
+	int irq = dev->irq;
 
 	SET_MODULE_OWNER(dev);
 
@@ -144,14 +142,49 @@
 
 	for (i = 0; netcard_portlist[i]; i++) {
 		int ioaddr = netcard_portlist[i];
-		if (check_region(ioaddr, NETCARD_IO_EXTENT))
-			continue;
 		if (netcard_probe1(dev, ioaddr) == 0)
 			return 0;
+		dev->irq = irq;
 	}
 
 	return -ENODEV;
 }
+ 
+static void cleanup_card(struct net_device *dev)
+{
+#ifdef jumpered_dma
+	free_dma(dev->dma);
+#endif
+#ifdef jumpered_interrupts
+	free_irq(dev->irq, dev);
+#endif
+	release_region(dev->base_addr, NETCARD_IO_EXTENT);
+}
+
+struct net_device * __init netcard_probe(int unit)
+{
+	struct net_device *dev = alloc_etherdev(sizeof(struct net_local));
+	int err;
+
+	if (!dev)
+		return ERR_PTR(-ENOMEM);
+
+	sprintf(dev->name, "eth%d", unit);
+	netdev_boot_setup_check(dev);
+
+	err = do_netcard_probe(dev);
+	if (err)
+		goto out;
+	err = register_netdev(dev);
+	if (err)
+		goto out1;
+	return dev;
+out1:
+	cleanup_card(dev);
+out:
+	free_netdev(dev);
+	return ERR_PTR(err);
+}
 
 /*
  * This is the real probe routine. Linux has a history of friendly device
@@ -163,6 +196,11 @@
 	struct net_local *np;
 	static unsigned version_printed;
 	int i;
+	int err = -ENODEV;
+
+	/* Grab the region so that no one else tries to probe our ioports. */
+	if (!request_region(ioaddr, NETCARD_IO_EXTENT, cardname))
+		return -EBUSY;
 
 	/*
 	 * For ethernet adaptors the first three octets of the station address 
@@ -171,9 +209,8 @@
 	 */ 
 	if (inb(ioaddr + 0) != SA_ADDR0
 		||	 inb(ioaddr + 1) != SA_ADDR1
-		||	 inb(ioaddr + 2) != SA_ADDR2) {
-		return -ENODEV;
-	}
+		||	 inb(ioaddr + 2) != SA_ADDR2)
+		goto out;
 
 	if (net_debug  &&  version_printed++ == 0)
 		printk(KERN_DEBUG "%s", version);
@@ -187,6 +224,7 @@
 	for (i = 0; i < 6; i++)
 		printk(" %2.2x", dev->dev_addr[i] = inb(ioaddr + i));
 
+	err = -EAGAIN;
 #ifdef jumpered_interrupts
 	/*
 	 * If this board has jumpered interrupts, allocate the interrupt
@@ -217,7 +255,7 @@
 		if (irqval) {
 			printk("%s: unable to get IRQ %d (irqval=%d).\n",
 				   dev->name, dev->irq, irqval);
-			return -EAGAIN;
+			goto out;
 		}
 	}
 #endif	/* jumpered interrupt */
@@ -229,7 +267,7 @@
 	if (dev->dma == 0) {
 		if (request_dma(dev->dma, cardname)) {
 			printk("DMA %d allocation failed.\n", dev->dma);
-			return -EAGAIN;
+			goto out1;
 		} else
 			printk(", assigned DMA %d.\n", dev->dma);
 	} else {
@@ -256,30 +294,18 @@
 			}
 		if (i <= 0) {
 			printk("DMA probe failed.\n");
-			return -EAGAIN;
+			goto out1;
 		} 
 		if (request_dma(dev->dma, cardname)) {
 			printk("probed DMA %d allocation failed.\n", dev->dma);
-			return -EAGAIN;
+			goto out1;
 		}
 	}
 #endif	/* jumpered DMA */
 
-	/* Initialize the device structure. */
-	if (dev->priv == NULL) {
-		dev->priv = kmalloc(sizeof(struct net_local), GFP_KERNEL);
-		if (dev->priv == NULL)
-			return -ENOMEM;
-	}
-
-	memset(dev->priv, 0, sizeof(struct net_local));
-
 	np = (struct net_local *)dev->priv;
 	spin_lock_init(&np->lock);
 
-	/* Grab the region so that no one else tries to probe our ioports. */
-	request_region(ioaddr, NETCARD_IO_EXTENT, cardname);
-
 	dev->open		= net_open;
 	dev->stop		= net_close;
 	dev->hard_start_xmit	= net_send_packet;
@@ -288,11 +314,14 @@
 
         dev->tx_timeout		= &net_tx_timeout;
         dev->watchdog_timeo	= MY_TX_TIMEOUT; 
-
-	/* Fill in the fields of the device structure with ethernet values. */
-	ether_setup(dev);
-
 	return 0;
+out1:
+#ifdef jumpered_interrupts
+	free_irq(dev->irq, dev);
+#endif
+out:
+	release_region(base_addr, NETCARD_IO_EXTENT);
+	return err;
 }
 
 static void net_tx_timeout(struct net_device *dev)
@@ -635,7 +664,7 @@
 
 #ifdef MODULE
 
-static struct net_device this_device;
+static struct net_device *this_device;
 static int io = 0x300;
 static int irq;
 static int dma;
@@ -644,42 +673,38 @@
 
 int init_module(void)
 {
+	struct net_device *dev;
 	int result;
 
 	if (io == 0)
 		printk(KERN_WARNING "%s: You shouldn't use auto-probing with insmod!\n",
 			   cardname);
+	dev = alloc_etherdev(sizeof(struct net_local));
+	if (!dev)
+		return -ENOMEM;
 
 	/* Copy the parameters from insmod into the device structure. */
-	this_device.base_addr = io;
-	this_device.irq       = irq;
-	this_device.dma       = dma;
-	this_device.mem_start = mem;
-	this_device.init      = netcard_probe;
-
-	if ((result = register_netdev(&this_device)) != 0)
-		return result;
-
-	return 0;
+	dev->base_addr = io;
+	dev->irq       = irq;
+	dev->dma       = dma;
+	dev->mem_start = mem;
+	if (do_netcard_probe(dev) == 0) {
+		if (register_netdev(dev) == 0)
+			this_device = dev;
+			return 0;
+		}
+		cleanup_card(dev);
+	}
+	free_netdev(dev);
+	return -ENXIO;
 }
 
 void
 cleanup_module(void)
 {
-	unregister_netdev(&this_device);
-	/*
-	 * If we don't do this, we can't re-insmod it later.
-	 * Release irq/dma here, when you have jumpered versions and
-	 * allocate them in net_probe1().
-	 */
-	/*
-	   free_irq(this_device.irq, dev);
-	   free_dma(this_device.dma);
-	*/
-	release_region(this_device.base_addr, NETCARD_IO_EXTENT);
-
-	if (this_device.priv)
-		kfree(this_device.priv);
+	unregister_netdev(this_device);
+	cleanup_card(this_device);
+	free_netdev(this_device);
 }
 
 #endif /* MODULE */
--- diff/drivers/net/ixgb/ixgb_main.c	2003-09-17 12:28:08.000000000 +0100
+++ source/drivers/net/ixgb/ixgb_main.c	2004-02-09 10:39:53.000000000 +0000
@@ -446,7 +446,7 @@
 	iounmap(adapter->hw.hw_addr);
       err_ioremap:
 	pci_release_regions(pdev);
-	kfree(netdev);
+	free_netdev(netdev);
       err_alloc_etherdev:
 	return -ENOMEM;
 }
--- diff/drivers/net/jazzsonic.c	2002-11-28 11:30:25.000000000 +0000
+++ source/drivers/net/jazzsonic.c	2004-02-09 10:39:53.000000000 +0000
@@ -80,7 +80,6 @@
 
 /* Index to functions, as function prototypes. */
 
-extern int sonic_probe(struct net_device *dev);
 static int sonic_probe1(struct net_device *dev, unsigned int base_addr,
                         unsigned int irq);
 
@@ -89,29 +88,57 @@
  * Probe for a SONIC ethernet controller on a Mips Jazz board.
  * Actually probing is superfluous but we're paranoid.
  */
-int __init sonic_probe(struct net_device *dev)
+struct net_device * __init sonic_probe(int unit)
 {
-	unsigned int base_addr = dev ? dev->base_addr : 0;
+	struct net_device *dev;
+	struct sonic_local *lp;
+	unsigned int base_addr;
+	int err = 0;
 	int i;
 
 	/*
 	 * Don't probe if we're not running on a Jazz board.
 	 */
 	if (mips_machgroup != MACH_GROUP_JAZZ)
-		return -ENODEV;
-	if (base_addr >= KSEG0)	/* Check a single specified location. */
-		return sonic_probe1(dev, base_addr, dev->irq);
-	else if (base_addr != 0)	/* Don't probe at all. */
-		return -ENXIO;
-
-	for (i = 0; sonic_portlist[i].port; i++) {
-		int base_addr = sonic_portlist[i].port;
-		if (check_region(base_addr, 0x100))
-			continue;
-		if (sonic_probe1(dev, base_addr, sonic_portlist[i].irq) == 0)
-			return 0;
+		return ERR_PTR(-ENODEV);
+
+	dev = alloc_etherdev(0);
+	if (!dev)
+		return ERR_PTR(-ENOMEM);
+
+	sprintf(dev->name, "eth%d", unit);
+	netdev_boot_setup_check(dev);
+	base_addr = dev->base_addr;
+
+	if (base_addr >= KSEG0)	{ /* Check a single specified location. */
+		err = sonic_probe1(dev, base_addr, dev->irq);
+	} else if (base_addr != 0) { /* Don't probe at all. */
+		err = -ENXIO;
+	} else {
+		for (i = 0; sonic_portlist[i].port; i++) {
+			int io = sonic_portlist[i].port;
+			if (sonic_probe1(dev, io, sonic_portlist[i].irq) == 0)
+				break;
+		}
+		if (!sonic_portlist[i].port)
+			err = -ENODEV;
 	}
-	return -ENODEV;
+	if (err)
+		goto out;
+	err = register_netdev(dev);
+	if (err)
+		goto out1;
+	return dev;
+out1:
+	lp = dev->priv;
+	vdma_free(lp->rba_laddr);
+	kfree(lp->rba);
+	vdma_free(lp->cda_laddr);
+	kfree(lp);
+	release_region(dev->base_addr, 0x100);
+out:
+	free_netdev(dev);
+	return ERR_PTR(err);
 }
 
 static int __init sonic_probe1(struct net_device *dev, unsigned int base_addr,
@@ -121,8 +148,11 @@
 	unsigned int silicon_revision;
 	unsigned int val;
 	struct sonic_local *lp;
+	int err = -ENODEV;
 	int i;
 
+	if (!request_region(base_addr, 0x100, dev->name))
+		return -EBUSY;
 	/*
 	 * get the Silicon Revision ID. If this is one of the known
 	 * one assume that we found a SONIC ethernet controller at
@@ -140,12 +170,9 @@
 	if (known_revisions[i] == 0xffff) {
 		printk("SONIC ethernet controller not found (0x%4x)\n",
 		       silicon_revision);
-		return -ENODEV;
+		goto out;
 	}
     
-	if (!request_region(base_addr, 0x100, dev->name))
-		return -EBUSY;
-
 	if (sonic_debug  &&  version_printed++ == 0)
 		printk(version);
 
@@ -175,6 +202,8 @@
 	}
 
 	printk(" IRQ %d\n", irq);
+
+	err = -ENOMEM;
     
 	/* Initialize the device structure. */
 	if (dev->priv == NULL) {
@@ -196,7 +225,7 @@
 		if (lp == NULL) {
 			printk("%s: couldn't allocate memory for descriptors\n",
 			       dev->name);
-			return -ENOMEM;
+			goto out;
 		}
 
 		memset(lp, 0, sizeof(struct sonic_local));
@@ -206,7 +235,7 @@
 		if (lp->cda_laddr == ~0UL) {
 			printk("%s: couldn't get DMA page entry for "
 			       "descriptors\n", dev->name);
-			return -ENOMEM;
+			goto out1;
 		}
 
 		lp->tda_laddr = lp->cda_laddr + sizeof (lp->cda);
@@ -219,7 +248,7 @@
 		if (!lp->rba) {
 			printk("%s: couldn't allocate receive buffers\n",
 			       dev->name);
-			return -ENOMEM;
+			goto out2;
 		}
 
 		/* get virtual dma address */
@@ -228,7 +257,7 @@
 		if (lp->rba_laddr == ~0UL) {
 			printk("%s: couldn't get DMA page entry for receive "
 			       "buffers\n",dev->name);
-			return -ENOMEM;
+			goto out3;
 		}
 
 		/* now convert pointer to KSEG1 pointer */
@@ -252,9 +281,16 @@
 	SONIC_WRITE(SONIC_FAET,0xffff);
 	SONIC_WRITE(SONIC_MPT,0xffff);
 
-	/* Fill in the fields of the device structure with ethernet values. */
-	ether_setup(dev);
 	return 0;
+out3:
+	kfree(lp->rba);
+out2:
+	vdma_free(lp->cda_laddr);
+out1:
+	kfree(lp);
+out:
+	release_region(base_addr, 0x100);
+	return err;
 }
 
 /*
--- diff/drivers/net/lance.c	2003-09-30 15:46:15.000000000 +0100
+++ source/drivers/net/lance.c	2004-02-09 10:39:53.000000000 +0000
@@ -59,8 +59,8 @@
 #include <asm/dma.h>
 
 static unsigned int lance_portlist[] __initdata = { 0x300, 0x320, 0x340, 0x360, 0};
-int lance_probe(struct net_device *dev);
 static int lance_probe1(struct net_device *dev, int ioaddr, int irq, int options);
+static int __init do_lance_probe(struct net_device *dev);
 
 #ifdef LANCE_DEBUG
 static int lance_debug = LANCE_DEBUG;
@@ -274,7 +274,6 @@
 static unsigned char lance_need_isa_bounce_buffers = 1;
 
 static int lance_open(struct net_device *dev);
-static int lance_open_fail(struct net_device *dev);
 static void lance_init_ring(struct net_device *dev, int mode);
 static int lance_start_xmit(struct sk_buff *skb, struct net_device *dev);
 static int lance_rx(struct net_device *dev);
@@ -286,10 +285,21 @@
 
 
 
+static void cleanup_card(struct net_device *dev)
+{
+	struct lance_private *lp = dev->priv;
+	if (dev->dma != 4)
+		free_dma(dev->dma);
+	release_region(dev->base_addr, LANCE_TOTAL_SIZE);
+	kfree(lp->tx_bounce_buffs);
+	kfree((void*)lp->rx_buffs);
+	kfree(lp);
+}
+
 #ifdef MODULE
 #define MAX_CARDS		8	/* Max number of interfaces (cards) per module */
 
-static struct net_device dev_lance[MAX_CARDS];
+static struct net_device *dev_lance[MAX_CARDS];
 static int io[MAX_CARDS];
 static int dma[MAX_CARDS];
 static int irq[MAX_CARDS];
@@ -305,28 +315,35 @@
 
 int init_module(void)
 {
+	struct net_device *dev;
 	int this_dev, found = 0;
 
 	for (this_dev = 0; this_dev < MAX_CARDS; this_dev++) {
-		struct net_device *dev = &dev_lance[this_dev];
-		dev->irq = irq[this_dev];
-		dev->base_addr = io[this_dev];
-		dev->dma = dma[this_dev];
-		dev->init = lance_probe;
 		if (io[this_dev] == 0)  {
-			if (this_dev != 0) break; /* only complain once */
+			if (this_dev != 0) /* only complain once */
+				break;
 			printk(KERN_NOTICE "lance.c: Module autoprobing not allowed. Append \"io=0xNNN\" value(s).\n");
 			return -EPERM;
 		}
-		if (register_netdev(dev) != 0) {
-			printk(KERN_WARNING "lance.c: No PCnet/LANCE card found (i/o = 0x%x).\n", io[this_dev]);
-			if (found != 0) return 0;	/* Got at least one. */
-			return -ENXIO;
+		dev = alloc_etherdev(0);
+		if (!dev)
+			break;
+		dev->irq = irq[this_dev];
+		dev->base_addr = io[this_dev];
+		dev->dma = dma[this_dev];
+		if (do_lance_probe(dev) == 0) {
+			if (register_netdev(dev) == 0) {
+				dev_lance[found++] = dev;
+				continue;
+			}
+			cleanup_card(dev);
 		}
-		found++;
+		free_netdev(dev);
+		break;
 	}
-
-	return 0;
+	if (found != 0)
+		return 0;
+	return -ENXIO;
 }
 
 void cleanup_module(void)
@@ -334,13 +351,11 @@
 	int this_dev;
 
 	for (this_dev = 0; this_dev < MAX_CARDS; this_dev++) {
-		struct net_device *dev = &dev_lance[this_dev];
-		if (dev->priv != NULL) {
+		struct net_device *dev = dev_lance[this_dev];
+		if (dev) {
 			unregister_netdev(dev);	
-			free_dma(dev->dma);
-			release_region(dev->base_addr, LANCE_TOTAL_SIZE);
-			kfree(dev->priv);
-			dev->priv = NULL;
+			cleanup_card(dev);
+			free_netdev(dev);
 		}
 	}
 }
@@ -352,7 +367,7 @@
    board probes now that kmalloc() can allocate ISA DMA-able regions.
    This also allows the LANCE driver to be used as a module.
    */
-int __init lance_probe(struct net_device *dev)
+static int __init do_lance_probe(struct net_device *dev)
 {
 	int *port, result;
 
@@ -387,6 +402,31 @@
 	return -ENODEV;
 }
 
+struct net_device * __init lance_probe(int unit)
+{
+	struct net_device *dev = alloc_etherdev(0);
+	int err;
+
+	if (!dev)
+		return ERR_PTR(-ENODEV);
+
+	sprintf(dev->name, "eth%d", unit);
+	netdev_boot_setup_check(dev);
+
+	err = do_lance_probe(dev);
+	if (err)
+		goto out;
+	err = register_netdev(dev);
+	if (err)
+		goto out1;
+	return dev;
+out1:
+	cleanup_card(dev);
+out:
+	free_netdev(dev);
+	return ERR_PTR(err);
+}
+
 static int __init lance_probe1(struct net_device *dev, int ioaddr, int irq, int options)
 {
 	struct lance_private *lp;
@@ -398,6 +438,7 @@
 	int hp_builtin = 0;			/* HP on-board ethernet. */
 	static int did_version;			/* Already printed version info. */
 	unsigned long flags;
+	int err = -ENOMEM;
 
 	/* First we look for special cases.
 	   Check for HP's on-board ethernet by looking for 'HP' in the BIOS.
@@ -432,7 +473,7 @@
 	outw(88, ioaddr+LANCE_ADDR);
 	if (inw(ioaddr+LANCE_ADDR) != 88) {
 		lance_version = 0;
-	} else {							/* Good, it's a newer chip. */
+	} else {			/* Good, it's a newer chip. */
 		int chip_version = inw(ioaddr+LANCE_DATA);
 		outw(89, ioaddr+LANCE_ADDR);
 		chip_version |= inw(ioaddr+LANCE_DATA) << 16;
@@ -447,13 +488,9 @@
 		}
 	}
 
-	/* We can't use init_etherdev() to allocate dev->priv because it must
+	/* We can't allocate dev->priv from alloc_etherdev() because it must
 	   a ISA DMA-able region. */
-	dev = init_etherdev(dev, 0);
-	if (!dev)
-		return -ENOMEM;
 	SET_MODULE_OWNER(dev);
-	dev->open = lance_open_fail;
 	chipname = chip_table[lance_version].name;
 	printk("%s: %s at %#3x,", dev->name, chipname, ioaddr);
 
@@ -465,8 +502,7 @@
 	dev->base_addr = ioaddr;
 	/* Make certain the data structures used by the LANCE are aligned and DMAble. */
 		
-	lp = (struct lance_private *)(((unsigned long)kmalloc(sizeof(*lp)+7,
-					   GFP_DMA | GFP_KERNEL)+7) & ~7);
+	lp = kmalloc(sizeof(*lp), GFP_DMA | GFP_KERNEL);
 	if(lp==NULL)
 		return -ENODEV;
 	if (lance_debug > 6) printk(" (#0x%05lx)", (unsigned long)lp);
@@ -486,7 +522,7 @@
 		lp->tx_bounce_buffs = NULL;
 
 	lp->chip_version = lance_version;
-	lp->devlock = SPIN_LOCK_UNLOCKED;
+	spin_lock_init(&lp->devlock);
 
 	lp->init_block.mode = 0x0003;		/* Disable Rx and Tx. */
 	for (i = 0; i < 6; i++)
@@ -540,6 +576,7 @@
 		dma_channels = ((inb(DMA1_STAT_REG) >> 4) & 0x0f) |
 			(inb(DMA2_STAT_REG) & 0xf0);
 	}
+	err = -ENODEV;
 	if (dev->irq >= 2)
 		printk(" assigned IRQ %d", dev->irq);
 	else if (lance_version != 0)  {	/* 7990 boards need DMA detection first. */
@@ -559,7 +596,7 @@
 			printk(", probed IRQ %d", dev->irq);
 		else {
 			printk(", failed to detect IRQ line.\n");
-			return -ENODEV;
+			goto out_tx;
 		}
 
 		/* Check for the initialization done bit, 0x0100, which means
@@ -573,7 +610,7 @@
 	} else if (dev->dma) {
 		if (request_dma(dev->dma, chipname)) {
 			printk("DMA %d allocation failed.\n", dev->dma);
-			return -ENODEV;
+			goto out_tx;
 		} else
 			printk(", assigned DMA %d.\n", dev->dma);
 	} else {			/* OK, we have to auto-DMA. */
@@ -613,7 +650,7 @@
 		}
 		if (i == 4) {			/* Failure: bail. */
 			printk("DMA detection failed.\n");
-			return -ENODEV;
+			goto out_tx;
 		}
 	}
 
@@ -629,7 +666,7 @@
 		dev->irq = probe_irq_off(irq_mask);
 		if (dev->irq == 0) {
 			printk("  Failed to detect the 7990 IRQ line.\n");
-			return -ENODEV;
+			goto out_dma;
 		}
 		printk("  Auto-IRQ detected IRQ%d.\n", dev->irq);
 	}
@@ -655,18 +692,18 @@
 	dev->watchdog_timeo = TX_TIMEOUT;
 
 	return 0;
-out_rx:	kfree((void*)lp->rx_buffs);
-out_lp:	kfree(lp);
-	return -ENOMEM;
-}
-
-static int
-lance_open_fail(struct net_device *dev)
-{
-	return -ENODEV;
+out_dma:
+	if (dev->dma != 4)
+		free_dma(dev->dma);
+out_tx:
+	kfree(lp->tx_bounce_buffs);
+out_rx:
+	kfree((void*)lp->rx_buffs);
+out_lp:
+	kfree(lp);
+	return err;
 }
 
-
 
 static int
 lance_open(struct net_device *dev)
--- diff/drivers/net/lasi_82596.c	2003-09-17 12:28:08.000000000 +0100
+++ source/drivers/net/lasi_82596.c	2004-02-09 10:39:53.000000000 +0000
@@ -1149,12 +1149,11 @@
 
 #define LAN_PROM_ADDR	0xF0810000
 
-static int __devinit i82596_probe(struct net_device *dev)
+static int __devinit i82596_probe(struct net_device *dev,
+				  struct device *gen_dev)
 {
 	int i;
 	struct i596_private *lp;
-	/* we're going to overwrite dev->priv, so pull the device out */
-	struct device *gen_dev = dev->priv;
 	char eth_addr[6];
 	dma_addr_t dma_addr;
 
@@ -1204,7 +1203,6 @@
 		return -ENOMEM;
 	}
 
-	ether_setup(dev);
 	DEB(DEB_PROBE,printk("%s: 82596 at %#3lx,", dev->name, dev->base_addr));
 
 	for (i = 0; i < 6; i++)
@@ -1537,12 +1535,19 @@
 
 	netdevice->base_addr = dev->hpa;
 	netdevice->irq = dev->irq;
-	netdevice->init = i82596_probe;
-	netdevice->priv = &dev->dev;
+
+	retval = i82596_probe(netdevice, &dev->dev);
+	if (retval) {
+		free_netdev(netdevice);
+		return -ENODEV;
+	}
 
 	retval = register_netdev(netdevice);
 	if (retval) {
+		struct i596_private *lp = netdevice->priv;
 		printk(KERN_WARNING __FILE__ ": register_netdevice ret'd %d\n", retval);
+		dma_free_noncoherent(lp->dev, sizeof(struct i596_private), 
+				    (void *)netdevice->mem_start, lp->dma_addr);
 		free_netdev(netdevice);
 		return -ENODEV;
 	};
--- diff/drivers/net/lne390.c	2003-09-30 15:46:15.000000000 +0100
+++ source/drivers/net/lne390.c	2004-02-09 10:39:53.000000000 +0000
@@ -49,7 +49,6 @@
 
 #include "8390.h"
 
-int lne390_probe(struct net_device *dev);
 static int lne390_probe1(struct net_device *dev, int ioaddr);
 
 static int lne390_open(struct net_device *dev);
@@ -103,9 +102,11 @@
  *	PROM for a match against the value assigned to Mylex.
  */
 
-int __init lne390_probe(struct net_device *dev)
+static int __init do_lne390_probe(struct net_device *dev)
 {
 	unsigned short ioaddr = dev->base_addr;
+	int irq = dev->irq;
+	int mem_start = dev->mem_start;
 	int ret;
 
 	SET_MODULE_OWNER(dev);
@@ -135,11 +136,46 @@
 		if (lne390_probe1(dev, ioaddr) == 0)
 			return 0;
 		release_region(ioaddr, LNE390_IO_EXTENT);
+		dev->irq = irq;
+		dev->mem_start = mem_start;
 	}
 
 	return -ENODEV;
 }
 
+static void cleanup_card(struct net_device *dev)
+{
+	free_irq(dev->irq, dev);
+	release_region(dev->base_addr, LNE390_IO_EXTENT);
+	if (ei_status.reg0)
+		iounmap((void *)dev->mem_start);
+}
+
+struct net_device * __init lne390_probe(int unit)
+{
+	struct net_device *dev = alloc_ei_netdev();
+	int err;
+
+	if (!dev)
+		return ERR_PTR(-ENOMEM);
+
+	sprintf(dev->name, "eth%d", unit);
+	netdev_boot_setup_check(dev);
+
+	err = do_lne390_probe(dev);
+	if (err)
+		goto out;
+	err = register_netdev(dev);
+	if (err)
+		goto out1;
+	return dev;
+out1:
+	cleanup_card(dev);
+out:
+	free_netdev(dev);
+	return ERR_PTR(err);
+}
+
 static int __init lne390_probe1(struct net_device *dev, int ioaddr)
 {
 	int i, revision, ret;
@@ -174,11 +210,6 @@
 		return -ENODEV;
 	}
 #endif
-	/* Allocate dev->priv and fill in 8390 specific dev fields. */
-	if (ethdev_init(dev)) {
-		printk ("lne390.c: unable to allocate memory for dev->priv!\n");
-		return -ENOMEM;
-	}
 
 	printk("lne390.c: LNE390%X in EISA slot %d, address", 0xa+revision, ioaddr/0x1000);
 	for(i = 0; i < ETHER_ADDR_LEN; i++)
@@ -199,8 +230,6 @@
 
 	if ((ret = request_irq(dev->irq, ei_interrupt, 0, dev->name, dev))) {
 		printk (" unable to get IRQ %d.\n", dev->irq);
-		kfree(dev->priv);
-		dev->priv = NULL;
 		return ret;
 	}
 
@@ -270,12 +299,13 @@
 
 	dev->open = &lne390_open;
 	dev->stop = &lne390_close;
+#ifdef CONFIG_NET_POLL_CONTROLLER
+	dev->poll_controller = ei_poll;
+#endif
 	NS8390_init(dev, 0);
 	return 0;
 cleanup:
 	free_irq(dev->irq, dev);
-	kfree(dev->priv);
-	dev->priv = NULL;
 	return ret;
 }
 
@@ -373,7 +403,7 @@
 
 #ifdef MODULE
 #define MAX_LNE_CARDS	4	/* Max number of LNE390 cards per module */
-static struct net_device dev_lne[MAX_LNE_CARDS];
+static struct net_device *dev_lne[MAX_LNE_CARDS];
 static int io[MAX_LNE_CARDS];
 static int irq[MAX_LNE_CARDS];
 static int mem[MAX_LNE_CARDS];
@@ -389,26 +419,32 @@
 
 int init_module(void)
 {
+	struct net_device *dev;
 	int this_dev, found = 0;
 
 	for (this_dev = 0; this_dev < MAX_LNE_CARDS; this_dev++) {
-		struct net_device *dev = &dev_lne[this_dev];
+		if (io[this_dev] == 0 && this_dev != 0)
+			break;
+		dev = alloc_ei_netdev();
+		if (!dev)
+			break;
 		dev->irq = irq[this_dev];
 		dev->base_addr = io[this_dev];
 		dev->mem_start = mem[this_dev];
-		dev->init = lne390_probe;
-		/* Default is to only install one card. */
-		if (io[this_dev] == 0 && this_dev != 0) break;
-		if (register_netdev(dev) != 0) {
-			printk(KERN_WARNING "lne390.c: No LNE390 card found (i/o = 0x%x).\n", io[this_dev]);
-			if (found != 0) {	/* Got at least one. */
-				return 0;
+		if (do_lne390_probe(dev) == 0) {
+			if (register_netdev(dev) == 0) {
+				dev_lne[found++] = dev;
+				continue;
 			}
-			return -ENXIO;
+			cleanup_card(dev);
 		}
-		found++;
-	}
-	return 0;
+		free_netdev(dev);
+		printk(KERN_WARNING "lne390.c: No LNE390 card found (i/o = 0x%x).\n", io[this_dev]);
+		break;
+	}
+	if (found)
+		return 0;
+	return -ENXIO;
 }
 
 void cleanup_module(void)
@@ -416,15 +452,11 @@
 	int this_dev;
 
 	for (this_dev = 0; this_dev < MAX_LNE_CARDS; this_dev++) {
-		struct net_device *dev = &dev_lne[this_dev];
-		if (dev->priv != NULL) {
-			void *priv = dev->priv;
-			free_irq(dev->irq, dev);
-			release_region(dev->base_addr, LNE390_IO_EXTENT);
-			if (ei_status.reg0)
-				iounmap((void *)dev->mem_start);
+		struct net_device *dev = dev_lne[this_dev];
+		if (dev) {
 			unregister_netdev(dev);
-			kfree(priv);
+			cleanup_card(dev);
+			free_netdev(dev);
 		}
 	}
 }
--- diff/drivers/net/lp486e.c	2003-09-17 12:28:08.000000000 +0100
+++ source/drivers/net/lp486e.c	2004-02-09 10:39:53.000000000 +0000
@@ -1314,18 +1314,23 @@
 static int irq = IRQ;
 
 static int __init lp486e_init_module(void) {
-	struct net_device *dev;
-
-	dev = alloc_etherdev(sizeof(struct i596_private));
+	int err;
+	struct net_device *dev = alloc_etherdev(sizeof(struct i596_private));
 	if (!dev)
 		return -ENOMEM;
 
 	dev->irq = irq;
 	dev->base_addr = io;
-	dev->init = lp486e_probe;
-	if (register_netdev(dev) != 0) {
+	err = lp486e_probe(dev);
+	if (err) {
+		free_netdev(dev);
+		return err;
+	}
+	err = register_netdev(dev);
+	if (err) {
+		release_region(dev->base_addr, LP486E_TOTAL_SIZE);
 		free_netdev(dev);
-		return -EIO;
+		return err;
 	}
 	dev_lp486e = dev;
 	full_duplex = 0;
--- diff/drivers/net/mac8390.c	2003-10-09 09:47:34.000000000 +0100
+++ source/drivers/net/mac8390.c	2004-02-09 10:39:53.000000000 +0000
@@ -124,11 +124,10 @@
 static char version[] __initdata =
 	"mac8390.c: v0.4 2001-05-15 David Huggins-Daines <dhd@debian.org> and others\n";
 		
-extern int mac8390_probe(struct net_device * dev);
 extern enum mac8390_type mac8390_ident(struct nubus_dev * dev);
 extern int mac8390_memsize(unsigned long membase);
 extern int mac8390_memtest(struct net_device * dev);
-extern int mac8390_initdev(struct net_device * dev, struct nubus_dev * ndev,
+static int mac8390_initdev(struct net_device * dev, struct nubus_dev * ndev,
 			   enum mac8390_type type);
 
 static int mac8390_open(struct net_device * dev);
@@ -223,43 +222,43 @@
  	return i * 0x1000;
 }
 
-static int probed __initdata = 0;
-
-int __init mac8390_probe(struct net_device * dev)
+struct net_device * __init mac8390_probe(int unit)
 {
+	struct net_device *dev;
 	volatile unsigned short *i;
-	int boards_found = 0;
 	int version_disp = 0;
 	struct nubus_dev * ndev = NULL;
+	int err = -ENODEV;
 	
 	struct nubus_dir dir;
 	struct nubus_dirent ent;
 	int offset;
+	static unsigned int slots;
 
 	enum mac8390_type cardtype;
 
-	if (probed)
-		return -ENODEV;
-	probed++;
-
 	/* probably should check for Nubus instead */
 
 	if (!MACH_IS_MAC)
-		return -ENODEV;
+		return ERR_PTR(-ENODEV);
+
+	dev = alloc_ei_netdev();
+	if (!dev)
+		return ERR_PTR(-ENOMEM);
+
+	if (unit >= 0)
+		sprintf(dev->name, "eth%d", unit);
+
+ 	SET_MODULE_OWNER(dev);
 
 	while ((ndev = nubus_find_type(NUBUS_CAT_NETWORK, NUBUS_TYPE_ETHERNET, ndev))) {
-		
-		dev = NULL;
-		
-		if ((cardtype = mac8390_ident(ndev)) == MAC8390_NONE)
+		/* Have we seen it already? */
+		if (slots & (1<<ndev->board->slot))
 			continue;
+		slots |= 1<<ndev->board->slot;
 
-		dev = init_etherdev(dev, 0);
-		if (dev == NULL) {
-			printk(KERN_ERR "Unable to allocate etherdev"
-					"structure!\n");
-			return -ENOMEM;
-		}
+		if ((cardtype = mac8390_ident(ndev)) == MAC8390_NONE)
+			continue;
 
 		if (version_disp == 0) {
 			version_disp = 1;
@@ -358,21 +357,25 @@
 					printk(KERN_ERR "Card type %s is"
 							" unsupported, sorry\n",
 					       cardname[cardtype]);
-					return -ENODEV;
+					continue;
 			}
 		}
 
 		/* Do the nasty 8390 stuff */
-		if (mac8390_initdev(dev, ndev, cardtype))
-			continue;
-		boards_found++;
+		if (!mac8390_initdev(dev, ndev, cardtype))
+			break;
 	}
 
-	/* We're outta here */
-	if (boards_found > 0)
-		return 0;
-	else
-		return -ENODEV;
+	if (!ndev)
+		goto out;
+	err = register_netdev(dev);
+	if (err)
+		goto out;
+	return dev;
+
+out:
+	free_netdev(dev);
+	return ERR_PTR(err);
 }
 
 #ifdef MODULE
@@ -380,26 +383,39 @@
 MODULE_DESCRIPTION("Macintosh NS8390-based Nubus Ethernet driver");
 MODULE_LICENSE("GPL");
 
+/* overkill, of course */
+static struct net_device *dev_mac8390[15];
 int init_module(void)
 {
-	if (mac8390_probe(NULL)) {
+	int i;
+	for (i = 0; i < 15; i++) {
+		struct net_device *dev = mac8390_probe(-1);
+		if (IS_ERR(dev))
+			break;
+		dev_mac890[i] = dev;
+	}
+	if (!i) {
 		printk(KERN_NOTICE "mac8390.c: No useable cards found, driver NOT installed.\n");
 		return -ENODEV;
 	}
-	lock_8390_module();
 	return 0;
 }
 
 void cleanup_module(void)
 {
-	/* FIXME: should probably keep track of net_device structs
-           somewhere and unregister them here? */
-	unlock_8390_module();
+	int i;
+	for (i = 0; i < 15; i++) {
+		struct net_device *dev = dev_mac890[i];
+		if (dev) {
+			unregister_netdev(dev);
+			free_netdev(dev);
+		}
+	}
 }
 
 #endif /* MODULE */
 
-int __init mac8390_initdev(struct net_device * dev, struct nubus_dev * ndev,
+static int __init mac8390_initdev(struct net_device * dev, struct nubus_dev * ndev,
 			    enum mac8390_type type)
 {
 	static u32 fwrd4_offsets[16]={
@@ -423,15 +439,12 @@
 
 	int access_bitmode;
 	
-	/* 8390 specific init for dev - allocates dev->priv */
-	if (ethdev_init(dev)) {
-		printk(KERN_ERR "%s: Unable to allocate memory for dev->priv!\n", dev->name);
-		return -ENOMEM;
-	}
-
 	/* Now fill in our stuff */
 	dev->open = &mac8390_open;
 	dev->stop = &mac8390_close;
+#ifdef CONFIG_NET_POLL_CONTROLLER
+	dev->poll_controller = ei_poll;
+#endif
 
 	/* GAR, ei_status is actually a macro even though it looks global */
 	ei_status.name = cardname[type];
@@ -529,7 +542,6 @@
 		printk ("%s: unable to get IRQ %d.\n", dev->name, dev->irq);
 		return -EAGAIN;
 	}	
-	MOD_INC_USE_COUNT;
 	return 0;
 }
 
@@ -537,7 +549,6 @@
 {
 	free_irq(dev->irq, dev);
 	ei_close(dev);
-	MOD_DEC_USE_COUNT;
 	return 0;
 }
 
--- diff/drivers/net/mac89x0.c	2003-05-21 11:50:15.000000000 +0100
+++ source/drivers/net/mac89x0.c	2004-02-09 10:39:53.000000000 +0000
@@ -123,7 +123,6 @@
 
 /* Index to functions, as function prototypes. */
 
-extern int mac89x0_probe(struct net_device *dev);
 #if 0
 extern void reset_chip(struct net_device *dev);
 #endif
@@ -170,8 +169,9 @@
 
 /* Probe for the CS8900 card in slot E.  We won't bother looking
    anywhere else until we have a really good reason to do so. */
-int __init mac89x0_probe(struct net_device *dev)
+struct net_device * __init mac89x0_probe(int unit)
 {
+	struct net_device *dev;
 	static int once_is_enough;
 	struct net_local *lp;
 	static unsigned version_printed;
@@ -179,18 +179,28 @@
 	unsigned rev_type = 0;
 	unsigned long ioaddr;
 	unsigned short sig;
+	int err = -ENODEV;
+
+	dev = alloc_etherdev(sizeof(struct net_local));
+	if (!dev)
+		return ERR_PTR(-ENOMEM);
+
+	if (unit >= 0) {
+		sprintf(dev->name, "eth%d", unit);
+		netdev_boot_setup_check(dev);
+	}
 
 	SET_MODULE_OWNER(dev);
 
 	if (once_is_enough)
-		return -ENODEV;
+		goto out;
 	once_is_enough = 1;
 
 	/* We might have to parameterize this later */
 	slot = 0xE;
 	/* Get out now if there's a real NuBus card in slot E */
 	if (nubus_find_slot(slot, NULL) != NULL)
-		return -ENODEV;	
+		goto out;
 
 	/* The pseudo-ISA bits always live at offset 0x300 (gee,
            wonder why...) */
@@ -206,21 +216,15 @@
 		local_irq_restore(flags);
 
 		if (!card_present)
-			return -ENODEV;
+			goto out;
 	}
 
 	nubus_writew(0, ioaddr + ADD_PORT);
 	sig = nubus_readw(ioaddr + DATA_PORT);
 	if (sig != swab16(CHIP_EISA_ID_SIG))
-		return -ENODEV;
+		goto out;
 
 	/* Initialize the net_device structure. */
-	if (dev->priv == NULL) {
-		dev->priv = kmalloc(sizeof(struct net_local), GFP_KERNEL);
-		if (!dev->priv)
-			return -ENOMEM;
-                memset(dev->priv, 0, sizeof(struct net_local));
-        }
 	lp = (struct net_local *)dev->priv;
 
 	/* Fill in the 'dev' fields. */
@@ -258,9 +262,7 @@
 	/* Try to read the MAC address */
 	if ((readreg(dev, PP_SelfST) & (EEPROM_PRESENT | EEPROM_OK)) == 0) {
 		printk("\nmac89x0: No EEPROM, giving up now.\n");
-		kfree(dev->priv);
-		dev->priv = NULL;
-		return -ENODEV;
+		goto out1;
         } else {
                 for (i = 0; i < ETH_ALEN; i += 2) {
 			/* Big-endian (why??!) */
@@ -277,6 +279,7 @@
 	for (i = 0; i < ETH_ALEN; i++)
 		printk("%2.2x%s", dev->dev_addr[i],
 		       ((i < ETH_ALEN-1) ? ":" : ""));
+	printk("\n");
 
 	dev->open		= net_open;
 	dev->stop		= net_close;
@@ -285,11 +288,15 @@
 	dev->set_multicast_list = &set_multicast_list;
 	dev->set_mac_address = &set_mac_address;
 
-	/* Fill in the fields of the net_device structure with ethernet values. */
-	ether_setup(dev);
-
-	printk("\n");
+	err = register_netdev(dev);
+	if (err)
+		goto out1;
 	return 0;
+out1:
+	nubus_writew(0, dev->base_addr + ADD_PORT);
+out:
+	free_netdev(dev);
+	return ERR_PTR(err);
 }
 
 #if 0
@@ -619,7 +626,7 @@
 
 #ifdef MODULE
 
-static struct net_device dev_cs89x0;
+static struct net_device *dev_cs89x0;
 static int debug;
 
 MODULE_PARM(debug, "i");
@@ -630,36 +637,20 @@
 init_module(void)
 {
 	net_debug = debug;
-        dev_cs89x0.init = mac89x0_probe;
-        dev_cs89x0.priv = kmalloc(sizeof(struct net_local), GFP_KERNEL);
-	if (!dev_cs89x0.priv)
-		return -ENOMEM;
-	memset(dev_cs89x0.priv, 0, sizeof(struct net_local));
-
-        if (register_netdev(&dev_cs89x0) != 0) {
+        dev_cs89x0 = mac89x0_probe(-1);
+	if (IS_ERR(dev_cs89x0)) {
                 printk(KERN_WARNING "mac89x0.c: No card found\n");
-		kfree(dev_cs89x0.priv);
-                return -ENXIO;
-        }
+		return PTR_ERR(dev_cs89x0);
+	}
 	return 0;
 }
 
 void
 cleanup_module(void)
 {
-
-#endif
-#ifdef MODULE
-	nubus_writew(0, dev_cs89x0.base_addr + ADD_PORT);
-#endif
-#ifdef MODULE
-
-        if (dev_cs89x0.priv != NULL) {
-                /* Free up the private structure, or leak memory :-)  */
-                unregister_netdev(&dev_cs89x0);
-                kfree(dev_cs89x0.priv);
-                dev_cs89x0.priv = NULL;	/* gets re-allocated by cs89x0_probe1 */
-        }
+	unregister_netdev(dev_cs89x0);
+	nubus_writew(0, dev_cs89x0->base_addr + ADD_PORT);
+	free_netdev(dev_cs89x0);
 }
 #endif /* MODULE */
 
--- diff/drivers/net/mace.c	2003-09-30 15:46:15.000000000 +0100
+++ source/drivers/net/mace.c	2004-02-09 10:39:53.000000000 +0000
@@ -20,9 +20,10 @@
 #include <asm/dbdma.h>
 #include <asm/io.h>
 #include <asm/pgtable.h>
+#include <asm/macio.h>
+
 #include "mace.h"
 
-static struct net_device *mace_devs;
 static int port_aaui = -1;
 
 #define N_RX_RING	8
@@ -61,8 +62,7 @@
     int timeout_active;
     int port_aaui;
     int chipid;
-    struct device_node* of_node;
-    struct net_device *next_mace;
+    struct macio_dev *mdev;
     spinlock_t lock;
 };
 
@@ -76,8 +76,6 @@
 	+ (N_RX_RING + NCMDS_TX * N_TX_RING + 3) * sizeof(struct dbdma_cmd))
 
 static int bitrev(int);
-static int mace_probe(void);
-static void mace_probe1(struct device_node *mace);
 static int mace_open(struct net_device *dev);
 static int mace_close(struct net_device *dev);
 static int mace_xmit_start(struct sk_buff *skb, struct net_device *dev);
@@ -110,26 +108,19 @@
     return d;
 }
 
-static int __init mace_probe(void)
-{
-	struct device_node *mace;
-
-	for (mace = find_devices("mace"); mace != NULL; mace = mace->next)
-		mace_probe1(mace);
-	return mace_devs? 0: -ENODEV;
-}
 
-static void __init mace_probe1(struct device_node *mace)
+static int __devinit mace_probe(struct macio_dev *mdev, const struct of_match *match)
 {
-	int j, rev;
+	struct device_node *mace = macio_get_of_node(mdev);
 	struct net_device *dev;
 	struct mace_data *mp;
 	unsigned char *addr;
+	int j, rev, rc = -EBUSY;
 
-	if (mace->n_addrs != 3 || mace->n_intrs != 3) {
+	if (macio_resource_count(mdev) != 3 || macio_irq_count(mdev) != 3) {
 		printk(KERN_ERR "can't use MACE %s: need 3 addrs and 3 irqs\n",
 		       mace->full_name);
-		return;
+		return -ENODEV;
 	}
 
 	addr = get_property(mace, "mac-address", NULL);
@@ -138,44 +129,48 @@
 		if (addr == NULL) {
 			printk(KERN_ERR "Can't get mac-address for MACE %s\n",
 			       mace->full_name);
-			return;
+			return -ENODEV;
 		}
 	}
 
+	/*
+	 * lazy allocate the driver-wide dummy buffer. (Note that we
+	 * never have more than one MACE in the system anyway)
+	 */
 	if (dummy_buf == NULL) {
 		dummy_buf = kmalloc(RX_BUFLEN+2, GFP_KERNEL);
 		if (dummy_buf == NULL) {
 			printk(KERN_ERR "MACE: couldn't allocate dummy buffer\n");
-			return;
+			return -ENOMEM;
 		}
 	}
 
-	dev = init_etherdev(0, PRIV_BYTES);
-	if (!dev)
-		return;
+	if (macio_request_resources(mdev, "mace")) {
+		printk(KERN_ERR "MACE: can't request IO resources !\n");
+		return -EBUSY;
+	}
+
+	dev = alloc_etherdev(PRIV_BYTES);
+	if (!dev) {
+		printk(KERN_ERR "MACE: can't allocate ethernet device !\n");
+		rc = -ENOMEM;
+		goto err_release;
+	}
 	SET_MODULE_OWNER(dev);
+	SET_NETDEV_DEV(dev, &mdev->ofdev.dev);
 
 	mp = dev->priv;
-	mp->of_node = mace;
-	
-	if (!request_OF_resource(mace, 0, " (mace)")) {
-		printk(KERN_ERR "MACE: can't request IO resource !\n");
-		goto err_out;
-	}
-	if (!request_OF_resource(mace, 1, " (mace tx dma)")) {
-		printk(KERN_ERR "MACE: can't request TX DMA resource !\n");
-		goto err_out;
-	}
-
-	if (!request_OF_resource(mace, 2, " (mace tx dma)")) {
-		printk(KERN_ERR "MACE: can't request RX DMA resource !\n");
-		goto err_out;
-	}
-
-	dev->base_addr = mace->addrs[0].address;
-	mp->mace = (volatile struct mace *)
-		ioremap(mace->addrs[0].address, 0x1000);
-	dev->irq = mace->intrs[0].line;
+	mp->mdev = mdev;
+	macio_set_drvdata(mdev, dev);
+
+	dev->base_addr = macio_resource_start(mdev, 0);
+	mp->mace = (volatile struct mace *)ioremap(dev->base_addr, 0x1000);
+	if (mp->mace == NULL) {
+		printk(KERN_ERR "MACE: can't map IO resources !\n");
+		rc = -ENOMEM;
+		goto err_free;
+	}
+	dev->irq = macio_irq(mdev, 0);
 
 	printk(KERN_INFO "%s: MACE at", dev->name);
 	rev = addr[0] == 0 && addr[1] == 0xA0;
@@ -190,12 +185,24 @@
 
 	mp = (struct mace_data *) dev->priv;
 	mp->maccc = ENXMT | ENRCV;
+
 	mp->tx_dma = (volatile struct dbdma_regs *)
-		ioremap(mace->addrs[1].address, 0x1000);
-	mp->tx_dma_intr = mace->intrs[1].line;
+		ioremap(macio_resource_start(mdev, 1), 0x1000);
+	if (mp->tx_dma == NULL) {
+		printk(KERN_ERR "MACE: can't map TX DMA resources !\n");
+		rc = -ENOMEM;
+		goto err_unmap_io;
+	}
+	mp->tx_dma_intr = macio_irq(mdev, 1);
+
 	mp->rx_dma = (volatile struct dbdma_regs *)
-		ioremap(mace->addrs[2].address, 0x1000);
-	mp->rx_dma_intr = mace->intrs[2].line;
+		ioremap(macio_resource_start(mdev, 2), 0x1000);
+	if (mp->rx_dma == NULL) {
+		printk(KERN_ERR "MACE: can't map RX DMA resources !\n");
+		rc = -ENOMEM;
+		goto err_unmap_tx_dma;
+	}
+	mp->rx_dma_intr = macio_irq(mdev, 2);;
 
 	mp->tx_cmds = (volatile struct dbdma_cmd *) DBDMA_ALIGN(mp + 1);
 	mp->rx_cmds = mp->tx_cmds + NCMDS_TX * N_TX_RING + 1;
@@ -229,31 +236,81 @@
 	dev->set_multicast_list = mace_set_multicast;
 	dev->set_mac_address = mace_set_address;
 
-	ether_setup(dev);
-
+	/*
+	 * Most of what is below could be moved to mace_open()
+	 */
 	mace_reset(dev);
 
-	if (request_irq(dev->irq, mace_interrupt, 0, "MACE", dev))
+	rc = request_irq(dev->irq, mace_interrupt, 0, "MACE", dev);
+	if (rc) {
 		printk(KERN_ERR "MACE: can't get irq %d\n", dev->irq);
-	if (request_irq(mace->intrs[1].line, mace_txdma_intr, 0, "MACE-txdma",
-			dev))
+		goto err_unmap_rx_dma;
+	}
+	rc = request_irq(mp->tx_dma_intr, mace_txdma_intr, 0, "MACE-txdma", dev);
+	if (rc) {
 		printk(KERN_ERR "MACE: can't get irq %d\n", mace->intrs[1].line);
-	if (request_irq(mace->intrs[2].line, mace_rxdma_intr, 0, "MACE-rxdma",
-			dev))
+		goto err_free_irq;
+	}
+	rc = request_irq(mp->rx_dma_intr, mace_rxdma_intr, 0, "MACE-rxdma", dev);
+	if (rc) {
 		printk(KERN_ERR "MACE: can't get irq %d\n", mace->intrs[2].line);
+		goto err_free_tx_irq;
+	}
+
+	rc = register_netdev(dev);
+	if (rc) {
+		printk(KERN_ERR "Cannot register net device, aborting.\n");
+		goto err_free_rx_irq;
+	}
+
+	return 0;
+ 
+ err_free_rx_irq:
+	free_irq(macio_irq(mdev, 2), dev);
+ err_free_tx_irq:
+	free_irq(macio_irq(mdev, 1), dev);
+ err_free_irq:
+	free_irq(macio_irq(mdev, 0), dev);
+ err_unmap_rx_dma:
+	iounmap((void*)mp->rx_dma);
+ err_unmap_tx_dma:
+	iounmap((void*)mp->tx_dma);
+ err_unmap_io:
+	iounmap((void*)mp->mace);
+ err_free:
+	free_netdev(dev);
+ err_release:
+	macio_release_resources(mdev);
+
+	return rc;
+}
+
+static int __devexit mace_remove(struct macio_dev *mdev)
+{
+	struct net_device *dev = macio_get_drvdata(mdev);
+	struct mace_data *mp;
+
+	BUG_ON(dev == NULL);
+
+	macio_set_drvdata(mdev, NULL);
+
+	mp = dev->priv;
 
-	mp->next_mace = mace_devs;
-	mace_devs = dev;
-	return;
-	
-err_out:
 	unregister_netdev(dev);
-	if (mp->of_node) {
-		release_OF_resource(mp->of_node, 0);
-		release_OF_resource(mp->of_node, 1);
-		release_OF_resource(mp->of_node, 2);
-	}
+
+	free_irq(dev->irq, dev);
+	free_irq(mp->tx_dma_intr, dev);
+	free_irq(mp->rx_dma_intr, dev);
+
+	iounmap((void*)mp->rx_dma);
+	iounmap((void*)mp->tx_dma);
+	iounmap((void*)mp->mace);
+
 	free_netdev(dev);
+
+	macio_release_resources(mdev);
+
+	return 0;
 }
 
 static void dbdma_reset(volatile struct dbdma_regs *dma)
@@ -951,37 +1008,45 @@
     return IRQ_HANDLED;
 }
 
-MODULE_AUTHOR("Paul Mackerras");
-MODULE_DESCRIPTION("PowerMac MACE driver.");
-MODULE_PARM(port_aaui, "i");
-MODULE_PARM_DESC(port_aaui, "MACE uses AAUI port (0-1)");
-MODULE_LICENSE("GPL");
+static struct of_match mace_match[] = 
+{
+	{
+	.name 		= "mace",
+	.type		= OF_ANY_MATCH,
+	.compatible	= OF_ANY_MATCH
+	},
+	{},
+};
 
-static void __exit mace_cleanup (void)
+static struct macio_driver mace_driver = 
 {
-    struct net_device *dev;
-    struct mace_data *mp;
+	.name 		= "mace",
+	.match_table	= mace_match,
+	.probe		= mace_probe,
+	.remove		= mace_remove,
+};
 
-    while ((dev = mace_devs) != 0) {
-		mp = (struct mace_data *) mace_devs->priv;
-		mace_devs = mp->next_mace;
 
-		unregister_netdev(dev);
-		free_irq(dev->irq, dev);
-		free_irq(mp->tx_dma_intr, dev);
-		free_irq(mp->rx_dma_intr, dev);
+static int __init mace_init(void)
+{
+	return macio_register_driver(&mace_driver);
+}
 
-		release_OF_resource(mp->of_node, 0);
-		release_OF_resource(mp->of_node, 1);
-		release_OF_resource(mp->of_node, 2);
+static void __exit mace_cleanup(void)
+{
+	macio_unregister_driver(&mace_driver);
 
-		kfree(dev);
-    }
-    if (dummy_buf != NULL) {
+	if (dummy_buf) {
 		kfree(dummy_buf);
 		dummy_buf = NULL;
-    }
+	}
 }
 
-module_init(mace_probe);
+MODULE_AUTHOR("Paul Mackerras");
+MODULE_DESCRIPTION("PowerMac MACE driver.");
+MODULE_PARM(port_aaui, "i");
+MODULE_PARM_DESC(port_aaui, "MACE uses AAUI port (0-1)");
+MODULE_LICENSE("GPL");
+
+module_init(mace_init);
 module_exit(mace_cleanup);
--- diff/drivers/net/macmace.c	2003-06-09 14:18:19.000000000 +0100
+++ source/drivers/net/macmace.c	2004-02-09 10:39:53.000000000 +0000
@@ -180,7 +180,7 @@
  * model of Macintrash has a MACE (AV macintoshes)
  */
  
-int mace_probe(struct net_device *unused)
+struct net_device *mace_probe(int unit)
 {
 	int j;
 	struct mace_data *mp;
@@ -188,13 +188,19 @@
 	struct net_device *dev;
 	unsigned char checksum = 0;
 	static int found = 0;
+	int err;
 	
-	if (found || macintosh_config->ether_type != MAC_ETHER_MACE) return -ENODEV;
+	if (found || macintosh_config->ether_type != MAC_ETHER_MACE)
+		return ERR_PTR(-ENODEV);
 
 	found = 1;	/* prevent 'finding' one on every device probe */
 
-	dev = init_etherdev(0, PRIV_BYTES);
-	if (!dev) return -ENOMEM;
+	dev = alloc_etherdev(PRIV_BYTES);
+	if (!dev)
+		return ERR_PTR(-ENOMEM);
+
+	if (unit >= 0)
+		sprintf(dev->name, "eth%d", unit);
 
 	mp = (struct mace_data *) dev->priv;
 	dev->base_addr = (u32)MACE_BASE;
@@ -221,7 +227,10 @@
 		checksum ^= bitrev(addr[j<<4]);
 	}
 	
-	if (checksum != 0xFF) return -ENODEV;
+	if (checksum != 0xFF) {
+		free_netdev(dev);
+		return ERR_PTR(-ENODEV);
+	}
 
 	memset(&mp->stats, 0, sizeof(mp->stats));
 
@@ -234,13 +243,16 @@
 	dev->set_multicast_list	= mace_set_multicast;
 	dev->set_mac_address	= mace_set_address;
 
-	ether_setup(dev);
-
 	printk(KERN_INFO "%s: 68K MACE, hardware address %.2X", dev->name, dev->dev_addr[0]);
 	for (j = 1 ; j < 6 ; j++) printk(":%.2X", dev->dev_addr[j]);
 	printk("\n");
 
-	return 0;
+	err = register_netdev(dev);
+	if (!err)
+		return dev;
+
+	free_netdev(dev);
+	return ERR_PTR(err);
 }
 
 /*
--- diff/drivers/net/macsonic.c	2003-08-20 14:16:10.000000000 +0100
+++ source/drivers/net/macsonic.c	2004-02-09 10:39:53.000000000 +0000
@@ -74,7 +74,6 @@
 
 static int reg_offset;
 
-extern int macsonic_probe(struct net_device* dev);
 extern int mac_onboard_sonic_probe(struct net_device* dev);
 extern int mac_nubus_sonic_probe(struct net_device* dev);
 
@@ -110,14 +109,38 @@
 
 #define SONIC_READ_PROM(addr) nubus_readb(prom_addr+addr)
 
-int __init macsonic_probe(struct net_device* dev)
+struct net_device * __init macsonic_probe(int unit)
 {
-	int rv;
+	struct net_device *dev = alloc_etherdev(0);
+	int err;
+
+	if (!dev)
+		return ERR_PTR(-ENOMEM);
+
+	if (unit >= 0)
+		sprintf(dev->name, "eth%d", unit);
+
+ 	SET_MODULE_OWNER(dev);
 
 	/* This will catch fatal stuff like -ENOMEM as well as success */
-	if ((rv = mac_onboard_sonic_probe(dev)) != -ENODEV)
-		return rv;
-	return mac_nubus_sonic_probe(dev);
+	err = mac_onboard_sonic_probe(dev);
+	if (err == 0)
+		goto found;
+	if (err != -ENODEV)
+		goto out;
+	err = mac_nubus_sonic_probe(dev);
+	if (err)
+		goto out;
+found:
+	err = register_netdev(dev);
+	if (err)
+		goto out1;
+	return dev;
+out1:
+	kfree(dev->priv);
+out:
+	free_netdev(dev);
+	return ERR_PTR(err);
 }
 
 /*
@@ -195,6 +218,7 @@
 	if ((lp->rba = (char *)
 	     kmalloc(SONIC_NUM_RRS * SONIC_RBSIZE, GFP_KERNEL | GFP_DMA)) == NULL) {
 		printk(KERN_ERR "%s: couldn't allocate receive buffers\n", dev->name);
+		dev->priv = NULL;
 		kfree(lp);
 		return -ENOMEM;
 	}
@@ -229,8 +253,6 @@
 	sonic_write(dev, SONIC_FAET, 0xffff);
 	sonic_write(dev, SONIC_MPT, 0xffff);
 
-	/* Fill in the fields of the device structure with ethernet values. */
-	ether_setup(dev);
 	return 0;
 }
 
@@ -344,30 +366,6 @@
 
 	printk("yes\n");	
 
-	if (dev) {
-		dev = init_etherdev(dev, sizeof(struct sonic_local));
-		if (!dev)
-			return -ENOMEM;
-		/* methinks this will always be true but better safe than sorry */
-		if (dev->priv == NULL) {
-			dev->priv = kmalloc(sizeof(struct sonic_local), GFP_KERNEL);
-			if (!dev->priv)
-				return -ENOMEM;
-		}
-	} else {
-		dev = init_etherdev(NULL, sizeof(struct sonic_local));
-	}
-
-	if (dev == NULL)
-		return -ENOMEM;
-
-	if(dev->priv) {
-		printk("%s: warning! sonic entering with priv already allocated!\n",
-		       dev->name);
-		printk("%s: discarding, will attempt to reallocate\n", dev->name);
-		dev->priv = NULL;
-	}
-
 	/* Danger!  My arms are flailing wildly!  You *must* set this
            before using sonic_read() */
 
@@ -497,7 +495,6 @@
 {
 	static int slots;
 	struct nubus_dev* ndev = NULL;
-	struct sonic_local* lp;
 	unsigned long base_addr, prom_addr;
 	u16 sonic_dcr;
 	int id;
@@ -567,25 +564,6 @@
 		return -ENODEV;
 	}
 
-	if (dev) {
-		dev = init_etherdev(dev, sizeof(struct sonic_local));
-		if (!dev)
-			return -ENOMEM;
-		/* methinks this will always be true but better safe than sorry */
-		if (dev->priv == NULL) {
-			dev->priv = kmalloc(sizeof(struct sonic_local), GFP_KERNEL);
-			if (!dev->priv) /* FIXME: kfree dev if necessary */
-				return -ENOMEM;
-		}
-	} else {
-		dev = init_etherdev(NULL, sizeof(struct sonic_local));
-	}
-
-	if (dev == NULL)
-		return -ENOMEM;
-
-	lp = (struct sonic_local*) dev->priv;
-	memset(lp, 0, sizeof(struct sonic_local));
 	/* Danger!  My arms are flailing wildly!  You *must* set this
            before using sonic_read() */
 	dev->base_addr = base_addr;
@@ -631,8 +609,7 @@
 }
 
 #ifdef MODULE
-static char namespace[16] = "";
-static struct net_device dev_macsonic;
+static struct net_device *dev_macsonic;
 
 MODULE_PARM(sonic_debug, "i");
 MODULE_PARM_DESC(sonic_debug, "macsonic debug level (1-4)");
@@ -641,24 +618,20 @@
 int
 init_module(void)
 {
-        dev_macsonic.name = namespace;
-        dev_macsonic.init = macsonic_probe;
-
-        if (register_netdev(&dev_macsonic) != 0) {
+        dev_macsonic = macsonic_probe(-1);
+	if (IS_ERR(dev_macsonic)) {
                 printk(KERN_WARNING "macsonic.c: No card found\n");
-                return -ENXIO;
-        }
+		return PTR_ERR(dev_macsonic);
+	}
 	return 0;
 }
 
 void
 cleanup_module(void)
 {
-        if (dev_macsonic.priv != NULL) {
-                unregister_netdev(&dev_macsonic);
-                kfree(dev_macsonic.priv);
-                dev_macsonic.priv = NULL;
-        }
+	unregister_netdev(dev_macsonic);
+	kfree(dev_macsonic->priv);
+	free_netdev(dev_macsonic);
 }
 #endif /* MODULE */
 
--- diff/drivers/net/meth.c	2003-08-26 10:00:53.000000000 +0100
+++ source/drivers/net/meth.c	2004-02-09 10:39:53.000000000 +0000
@@ -95,7 +95,6 @@
     spinlock_t meth_lock;
 } meth_private;
 
-extern struct net_device meth_devs[];
 void meth_tx_timeout (struct net_device *dev);
 void meth_interrupt(int irq, void *dev_id, struct pt_regs *pregs);
         
@@ -762,17 +761,16 @@
 
 /*
  * The init function (sometimes called probe).
- * It is invoked by register_netdev()
  */
-int meth_init(struct net_device *dev)
+static struct net_device *meth_init(struct net_device *dev)
 {
+	struct net_device *dev;
 	meth_private *priv;
 	int ret;
-	/* 
-	 * Then, assign other fields in dev, using ether_setup() and some
-	 * hand assignments
-	 */
-	ether_setup(dev); /* assign some of the fields */
+
+	dev = alloc_etherdev(sizeof(struct meth_private));
+	if (!dev)
+		return ERR_PTR(-ENOMEM);
 
 	dev->open            = meth_open;
 	dev->stop            = meth_release;
@@ -787,16 +785,8 @@
 	dev->irq		 = MACE_ETHERNET_IRQ;
 	SET_MODULE_OWNER(dev);
 
-	/*
-	 * Then, allocate the priv field. This encloses the statistics
-	 * and a few private fields.
-	 */
-	priv = kmalloc(sizeof(struct meth_private), GFP_KERNEL);
-	if (priv == NULL)
-		return -ENOMEM;
-	dev->priv=priv;
-	memset(priv, 0, sizeof(struct meth_private));
-	spin_lock_init(&((struct meth_private *) dev->priv)->meth_lock);
+	priv = dev->priv;
+	spin_lock_init(&priv->meth_lock);
 	/*
 	 * Make the usual checks: check_region(), probe irq, ...  -ENODEV
 	 * should be returned if no device found.  No resource should be
@@ -807,28 +797,41 @@
 	priv->phy_addr = -1; /* No phy is known yet... */
 
 	/* Initialize the hardware */
-	if((ret=meth_reset(dev)) < 0)
-	        return ret;
+	ret = meth_reset(dev);
+	if (ret < 0)
+		goto out;
 
 	/* Allocate the ring buffers */
-	if((ret=meth_init_tx_ring(priv))<0||(ret=meth_init_rx_ring(priv))<0){
-		meth_free_tx_ring(priv);
-		meth_free_rx_ring(priv);
-		return ret;
-	}
+	ret = meth_init_tx_ring(priv);
+	if (ret < 0)
+		goto out;
+
+	ret = meth_init_rx_ring(priv);
+	if (ret < 0)
+		goto out1;
+
+	ret = register_netdev(dev);
+	if (ret)
+		goto out2;
 
 	printk("SGI O2 Fast Ethernet rev. %ld\n", priv->regs->mac_ctrl >> 29);
 
-    return 0;
+	return ret;
+
+out2:
+	meth_free_rx_ring(priv);
+out1:
+	meth_free_tx_ring(priv);
+out:
+	free_netdev(dev);
+	return ERR_PTR(ret);
 }
 
 /*
  * The devices
  */
 
-struct net_device meth_devs[1] = {
-    { init: meth_init, }  /* init, nothing more */
-};
+struct net_device *meth_dev;
 
 /*
  * Finally, the module stuff
@@ -836,23 +839,19 @@
 
 int meth_init_module(void)
 {
-	int result, device_present = 0;
-
-	strcpy(meth_devs[0].name, "eth%d");
-
-	if ( (result = register_netdev(meth_devs)) )
-		printk("meth: error %i registering device \"%s\"\n",
-		       result, meth_devs->name);
-	else device_present++;
-	
-	return device_present ? 0 : -ENODEV;
+	meth_dev = meth_init();
+	if (IS_ERR(meth_dev))
+		return PTR_ERR(meth_dev);
+	return 0;
 }
 
 void meth_cleanup(void)
 {
-    kfree(meth_devs->priv);
-    unregister_netdev(meth_devs);
-    return;
+	meth_private *priv = meth_dev->priv;
+	unregister_netdev(meth_dev);
+	meth_free_rx_ring(priv);
+	meth_free_tx_ring(priv);
+	free_netdev(meth_dev);
 }
 
 module_init(meth_init_module);
--- diff/drivers/net/mvme147.c	2003-08-26 10:00:53.000000000 +0100
+++ source/drivers/net/mvme147.c	2004-02-09 10:39:53.000000000 +0000
@@ -41,7 +41,7 @@
 struct m147lance_private {
 	struct lance_private lance;
 	void *base;
-	void *ram;
+	unsigned long ram;
 };
 
 /* function prototypes... This is easy because all the grot is in the
@@ -49,7 +49,6 @@
  * plus board-specific init, open and close actions.
  * Oh, and we need to tell the generic code how to read and write LANCE registers...
  */
-int mvme147lance_probe(struct net_device *dev);
 static int m147lance_open(struct net_device *dev);
 static int m147lance_close(struct net_device *dev);
 static void m147lance_writerap(struct m147lance_private *lp, unsigned short value);
@@ -60,29 +59,29 @@
 typedef void (*writerdp_t)(void *, unsigned short);
 typedef unsigned short (*readrdp_t)(void *);
 
-#ifdef MODULE
-static struct m147lance_private *root_m147lance_dev;
-#endif
-
 /* Initialise the one and only on-board 7990 */
-int __init mvme147lance_probe(struct net_device *dev)
+struct net_device * __init mvme147lance_probe(int unit)
 {
+	struct net_device *dev;
 	static int called;
 	static const char name[] = "MVME147 LANCE";
 	struct m147lance_private *lp;
 	u_long *addr;
 	u_long address;
+	int err;
 
 	if (!MACH_IS_MVME147 || called)
-		return -ENODEV;
+		return ERR_PTR(-ENODEV);
 	called++;
 
-	SET_MODULE_OWNER(dev);
+	dev = alloc_etherdev(sizeof(struct m147lance_private));
+	if (!dev)
+		return ERR_PTR(-ENOMEM);
 
-	dev->priv = kmalloc(sizeof(struct m147lance_private), GFP_KERNEL);
-	if (dev->priv == NULL)
-		return -ENOMEM;
-	memset(dev->priv, 0, sizeof(struct m147lance_private));
+	if (unit >= 0)
+		sprintf(dev->name, "eth%d", unit);
+
+	SET_MODULE_OWNER(dev);
 
 	/* Fill the dev fields */
 	dev->base_addr = (unsigned long)MVME147_LANCE_BASE;
@@ -114,11 +113,12 @@
 		dev->dev_addr[5]);
 
 	lp = (struct m147lance_private *)dev->priv;
-	lp->ram = (void *)__get_dma_pages(GFP_ATOMIC, 3);	/* 16K */
+	lp->ram = __get_dma_pages(GFP_ATOMIC, 3);	/* 16K */
 	if (!lp->ram)
 	{
 		printk("%s: No memory for LANCE buffers\n", dev->name);
-		return -ENODEV;
+		free_netdev(dev);
+		return ERR_PTR(-ENOMEM);
 	}
 
 	lp->lance.name = (char*)name;                   /* discards const, shut up gcc */
@@ -134,15 +134,15 @@
 	lp->lance.lance_log_tx_bufs = LANCE_LOG_TX_BUFFERS;
 	lp->lance.rx_ring_mod_mask = RX_RING_MOD_MASK;
 	lp->lance.tx_ring_mod_mask = TX_RING_MOD_MASK;
-	ether_setup(dev);
 
-#ifdef MODULE
-	dev->ifindex = dev_new_index();
-	lp->next_module = root_m147lance_dev;
-	root_m147lance_dev = lp;
-#endif /* MODULE */
+	err = register_netdev(dev);
+	if (err) {
+		free_pages(lp->ram, 3);
+		free_netdev(dev);
+		return ERR_PTR(err);
+	}
 
-	return 0;
+	return dev;
 }
 
 static void m147lance_writerap(struct m147lance_private *lp, unsigned short value)
@@ -185,23 +185,21 @@
 #ifdef MODULE
 MODULE_LICENSE("GPL");
 
+static struct net_device *dev_mvme147_lance;
 int init_module(void)
 {
-	root_lance_dev = NULL;
-	return mvme147lance_probe(NULL);
+	dev_mvme147_lance = mvme147lance_probe(-1);
+	if (IS_ERR(dev_mvme147_lance))
+		return PTR_ERR(dev_mvme147_lance);
+	return 0;
 }
 
 void cleanup_module(void)
 {
-	/* Walk the chain of devices, unregistering them */
-	struct m147lance_private *lp;
-	while (root_m147lance_dev) {
-		lp = root_m147lance_dev->next_module;
-		unregister_netdev(root_lance_dev->dev);
-		free_pages(lp->ram, 3);
-		free_netdev(root_lance_dev->dev);
-		root_lance_dev = lp;
-	}
+	struct m147lance_private *lp = dev_mvme147_lance->priv;
+	unregister_netdev(dev_mvme147_lance);
+	free_pages(lp->ram, 3);
+	free_netdev(dev_mvme147_lance);
 }
 
 #endif /* MODULE */
--- diff/drivers/net/ne.c	2003-09-30 15:46:15.000000000 +0100
+++ source/drivers/net/ne.c	2004-02-09 10:39:53.000000000 +0000
@@ -126,7 +126,6 @@
 #define NESM_START_PG	0x40	/* First page of TX buffer */
 #define NESM_STOP_PG	0x80	/* Last page +1 of RX ring */
 
-int ne_probe(struct net_device *dev);
 static int ne_probe1(struct net_device *dev, int ioaddr);
 static int ne_probe_isapnp(struct net_device *dev);
 
@@ -163,9 +162,10 @@
 	E2010	 starts at 0x100 and ends at 0x4000.
 	E2010-x starts at 0x100 and ends at 0xffff.  */
 
-int __init ne_probe(struct net_device *dev)
+static int __init do_ne_probe(struct net_device *dev)
 {
 	unsigned int base_addr = dev->base_addr;
+	int irq = dev->irq;
 
 	SET_MODULE_OWNER(dev);
 
@@ -183,6 +183,7 @@
 	/* Last resort. The semi-risky ISA auto-probe. */
 	for (base_addr = 0; netcard_portlist[base_addr] != 0; base_addr++) {
 		int ioaddr = netcard_portlist[base_addr];
+		dev->irq = irq;
 		if (ne_probe1(dev, ioaddr) == 0)
 			return 0;
 	}
@@ -191,6 +192,40 @@
 	return -ENODEV;
 }
 
+static void cleanup_card(struct net_device *dev)
+{
+	struct pnp_dev *idev = (struct pnp_dev *)ei_status.priv;
+	if (idev)
+		pnp_device_detach(idev);
+	free_irq(dev->irq, dev);
+	release_region(dev->base_addr, NE_IO_EXTENT);
+}
+
+struct net_device * __init ne_probe(int unit)
+{
+	struct net_device *dev = alloc_ei_netdev();
+	int err;
+
+	if (!dev)
+		return ERR_PTR(-ENOMEM);
+
+	sprintf(dev->name, "eth%d", unit);
+	netdev_boot_setup_check(dev);
+
+	err = do_ne_probe(dev);
+	if (err)
+		goto out;
+	err = register_netdev(dev);
+	if (err)
+		goto out1;
+	return dev;
+out1:
+	cleanup_card(dev);
+out:
+	free_netdev(dev);
+	return ERR_PTR(err);
+}
+
 static int __init ne_probe_isapnp(struct net_device *dev)
 {
 	int i;
@@ -425,20 +460,12 @@
 		goto err_out;
 	}
 
-	/* Allocate dev->priv and fill in 8390 specific dev fields. */
-	if (ethdev_init(dev))
-	{
-        	printk (" unable to get memory for dev->priv.\n");
-        	ret = -ENOMEM;
-		goto err_out;
-	}
-
 	/* Snarf the interrupt now.  There's no point in waiting since we cannot
 	   share and the board will usually be enabled. */
 	ret = request_irq(dev->irq, ei_interrupt, 0, name, dev);
 	if (ret) {
 		printk (" unable to get IRQ %d (errno=%d).\n", dev->irq, ret);
-		goto err_out_kfree;
+		goto err_out;
 	}
 
 	dev->base_addr = ioaddr;
@@ -469,12 +496,12 @@
 	ei_status.priv = 0;
 	dev->open = &ne_open;
 	dev->stop = &ne_close;
+#ifdef CONFIG_NET_POLL_CONTROLLER
+	dev->poll_controller = ei_poll;
+#endif
 	NS8390_init(dev, 0);
 	return 0;
 
-err_out_kfree:
-	kfree(dev->priv);
-	dev->priv = NULL;
 err_out:
 	release_region(ioaddr, NE_IO_EXTENT);
 	return ret;
@@ -734,7 +761,7 @@
 
 #ifdef MODULE
 #define MAX_NE_CARDS	4	/* Max number of NE cards per module */
-static struct net_device dev_ne[MAX_NE_CARDS];
+static struct net_device *dev_ne[MAX_NE_CARDS];
 static int io[MAX_NE_CARDS];
 static int irq[MAX_NE_CARDS];
 static int bad[MAX_NE_CARDS];	/* 0xbad = bad sig or no reset ack */
@@ -758,25 +785,31 @@
 	int this_dev, found = 0;
 
 	for (this_dev = 0; this_dev < MAX_NE_CARDS; this_dev++) {
-		struct net_device *dev = &dev_ne[this_dev];
+		struct net_device *dev = alloc_ei_netdev();
+		if (!dev)
+			break;
 		dev->irq = irq[this_dev];
 		dev->mem_end = bad[this_dev];
 		dev->base_addr = io[this_dev];
-		dev->init = ne_probe;
-		if (register_netdev(dev) == 0) {
-			found++;
-			continue;
-		}
-		if (found != 0) { 	/* Got at least one. */
-			return 0;
+		if (do_ne_probe(dev) == 0) {
+			if (register_netdev(dev) == 0) {
+				dev_ne[found++] = dev;
+				continue;
+			}
+			cleanup_card(dev);
 		}
+		free_netdev(dev);
+		if (found)
+			break;
 		if (io[this_dev] != 0)
 			printk(KERN_WARNING "ne.c: No NE*000 card found at i/o = %#x\n", io[this_dev]);
 		else
 			printk(KERN_NOTICE "ne.c: You must supply \"io=0xNNN\" value(s) for ISA cards.\n");
 		return -ENXIO;
 	}
-	return 0;
+	if (found)
+		return 0;
+	return -ENODEV;
 }
 
 void cleanup_module(void)
@@ -784,16 +817,11 @@
 	int this_dev;
 
 	for (this_dev = 0; this_dev < MAX_NE_CARDS; this_dev++) {
-		struct net_device *dev = &dev_ne[this_dev];
-		if (dev->priv != NULL) {
-			void *priv = dev->priv;
-			struct pnp_dev *idev = (struct pnp_dev *)ei_status.priv;
-			if (idev)
-				pnp_device_detach(idev);
-			free_irq(dev->irq, dev);
-			release_region(dev->base_addr, NE_IO_EXTENT);
+		struct net_device *dev = dev_ne[this_dev];
+		if (dev) {
 			unregister_netdev(dev);
-			kfree(priv);
+			cleanup_card(dev);
+			free_netdev(dev);
 		}
 	}
 }
--- diff/drivers/net/ne2.c	2003-10-09 09:47:34.000000000 +0100
+++ source/drivers/net/ne2.c	2004-02-09 10:39:53.000000000 +0000
@@ -242,7 +242,7 @@
  * Note that at boot, this probe only picks up one card at a time.
  */
 
-int __init ne2_probe(struct net_device *dev)
+static int __init do_ne2_probe(struct net_device *dev)
 {
 	static int current_mca_slot = -1;
 	int i;
@@ -262,16 +262,52 @@
 			mca_find_unused_adapter(ne2_adapters[i].id, 0);
 
 		if((current_mca_slot != MCA_NOTFOUND) && !adapter_found) {
+			int res;
 			mca_set_adapter_name(current_mca_slot, 
 					ne2_adapters[i].name);
 			mca_mark_as_used(current_mca_slot);
 			
-			return ne2_probe1(dev, current_mca_slot);
+			res = ne2_probe1(dev, current_mca_slot);
+			if (res)
+				mca_mark_as_unused(current_mca_slot);
+			return res;
 		}
 	}
 	return -ENODEV;
 }
 
+static void cleanup_card(struct net_device *dev)
+{
+	mca_mark_as_unused(ei_status.priv);
+	mca_set_adapter_procfn( ei_status.priv, NULL, NULL);
+	free_irq(dev->irq, dev);
+	release_region(dev->base_addr, NE_IO_EXTENT);
+}
+
+struct net_device * __init ne2_probe(int unit)
+{
+	struct net_device *dev = alloc_ei_netdev();
+	int err;
+
+	if (!dev)
+		return ERR_PTR(-ENOMEM);
+
+	sprintf(dev->name, "eth%d", unit);
+	netdev_boot_setup_check(dev);
+
+	err = do_ne2_probe(dev);
+	if (err)
+		goto out;
+	err = register_netdev(dev);
+	if (err)
+		goto out1;
+	return dev;
+out1:
+	cleanup_card(dev);
+out:
+	free_netdev(dev);
+	return ERR_PTR(err);
+}
 
 static int ne2_procinfo(char *buf, int slot, struct net_device *dev)
 {
@@ -443,14 +479,6 @@
 
 	dev->base_addr = base_addr;
 
-	/* Allocate dev->priv and fill in 8390 specific dev fields. */
-	if (ethdev_init(dev)) {
-		printk (" unable to get memory for dev->priv.\n");
-		free_irq(dev->irq, dev);
-		retval = -ENOMEM;
-		goto out;
-	}
-
 	for(i = 0; i < ETHER_ADDR_LEN; i++) {
 		printk(" %2.2x", SA_prom[i]);
 		dev->dev_addr[i] = SA_prom[i];
@@ -481,6 +509,9 @@
 	
 	dev->open = &ne_open;
 	dev->stop = &ne_close;
+#ifdef CONFIG_NET_POLL_CONTROLLER
+	dev->poll_controller = ei_poll;
+#endif
 	NS8390_init(dev, 0);
 	return 0;
 out:
@@ -735,7 +766,7 @@
 
 #ifdef MODULE
 #define MAX_NE_CARDS	4	/* Max number of NE cards per module */
-static struct net_device dev_ne[MAX_NE_CARDS];
+static struct net_device *dev_ne[MAX_NE_CARDS];
 static int io[MAX_NE_CARDS];
 static int irq[MAX_NE_CARDS];
 static int bad[MAX_NE_CARDS];	/* 0xbad = bad sig or no reset ack */
@@ -754,23 +785,30 @@
 
 int init_module(void)
 {
+	struct net_device *dev;
 	int this_dev, found = 0;
 
 	for (this_dev = 0; this_dev < MAX_NE_CARDS; this_dev++) {
-		struct net_device *dev = &dev_ne[this_dev];
+		dev = alloc_ei_netdev();
+		if (!dev)
+			break;
 		dev->irq = irq[this_dev];
 		dev->mem_end = bad[this_dev];
 		dev->base_addr = io[this_dev];
-		dev->init = ne2_probe;
-		if (register_netdev(dev) != 0) {
-			if (found != 0) return 0;   /* Got at least one. */
-
-			printk(KERN_WARNING "ne2.c: No NE/2 card found.\n");
-			return -ENXIO;
+		if (do_ne2_probe(dev) == 0) {
+			if (register_netdev(dev) == 0) {
+				dev_ne[found++] = dev;
+				continue;
+			}
+			cleanup_card(dev);
 		}
-		found++;
+		free_netdev(dev);
+		break;
 	}
-	return 0;
+	if (found)
+		return 0;
+	printk(KERN_WARNING "ne2.c: No NE/2 card found\n");
+	return -ENXIO;
 }
 
 void cleanup_module(void)
@@ -778,14 +816,11 @@
 	int this_dev;
 
 	for (this_dev = 0; this_dev < MAX_NE_CARDS; this_dev++) {
-		struct net_device *dev = &dev_ne[this_dev];
-		if (dev->priv != NULL) {
-			mca_mark_as_unused(ei_status.priv);
-			mca_set_adapter_procfn( ei_status.priv, NULL, NULL);
-			kfree(dev->priv);
-			free_irq(dev->irq, dev);
-			release_region(dev->base_addr, NE_IO_EXTENT);
+		struct net_device *dev = dev_ne[this_dev];
+		if (dev) {
 			unregister_netdev(dev);
+			cleanup_card(dev);
+			free_netdev(dev);
 		}
 	}
 }
--- diff/drivers/net/ne2k-pci.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/net/ne2k-pci.c	2004-02-09 10:39:53.000000000 +0000
@@ -359,6 +359,9 @@
 	dev->open = &ne2k_pci_open;
 	dev->stop = &ne2k_pci_close;
 	dev->ethtool_ops = &ne2k_pci_ethtool_ops;
+#ifdef CONFIG_NET_POLL_CONTROLLER
+	dev->poll_controller = ei_poll;
+#endif
 	NS8390_init(dev, 0);
 
 	i = register_netdev(dev);
@@ -532,8 +535,12 @@
 		insl(NE_BASE + NE_DATAPORT, buf, count>>2);
 		if (count & 3) {
 			buf += count & ~3;
-			if (count & 2)
-				*((u16*)buf)++ = le16_to_cpu(inw(NE_BASE + NE_DATAPORT));
+			if (count & 2) {
+				u16 *b = (u16 *)buf;
+
+				*b++ = le16_to_cpu(inw(NE_BASE + NE_DATAPORT));
+				buf = (char *)b;
+			}
 			if (count & 1)
 				*buf = inb(NE_BASE + NE_DATAPORT);
 		}
@@ -593,8 +600,12 @@
 		outsl(NE_BASE + NE_DATAPORT, buf, count>>2);
 		if (count & 3) {
 			buf += count & ~3;
-			if (count & 2)
-				outw(cpu_to_le16(*((u16*)buf)++), NE_BASE + NE_DATAPORT);
+			if (count & 2) {
+				u16 *b = (u16 *)buf;
+
+				outw(cpu_to_le16(*b++), NE_BASE + NE_DATAPORT);
+				buf = (char *)b;
+			}
 		}
 	}
 
--- diff/drivers/net/ne2k_cbus.c	2003-09-30 15:46:15.000000000 +0100
+++ source/drivers/net/ne2k_cbus.c	2004-02-09 10:39:53.000000000 +0000
@@ -78,7 +78,6 @@
 
 #include "ne2k_cbus.h"
 
-int ne_probe(struct net_device *dev);
 static int ne_probe1(struct net_device *dev, int ioaddr);
 static int ne_open(struct net_device *dev);
 static int ne_close(struct net_device *dev);
@@ -113,9 +112,10 @@
 	E2010	 starts at 0x100 and ends at 0x4000.
 	E2010-x starts at 0x100 and ends at 0xffff.  */
 
-int __init ne_probe(struct net_device *dev)
+static int __init do_ne_probe(struct net_device *dev)
 {
 	unsigned int base_addr = dev->base_addr;
+	int irq = dev->irq;
 
 	SET_MODULE_OWNER(dev);
 
@@ -135,7 +135,7 @@
 		if (ei_debug > 2)
 			printk(KERN_DEBUG "ne_probe(): call ne_probe_cbus(base_addr=0x%x)\n", base_addr);
 
-		result = ne_probe_cbus(dev, hw, base_addr);
+		result = ne_probe_cbus(dev, hw, base_addr, irq);
 		if (result != 0)
 			ne2k_cbus_destroy(dev);
 
@@ -156,13 +156,13 @@
 		if (hw && hw->hwtype) {
 			const unsigned short *plist;
 			for (plist = hw->portlist; *plist; plist++)
-				if (ne_probe_cbus(dev, hw, *plist) == 0)
+				if (ne_probe_cbus(dev, hw, *plist, irq) == 0)
 					return 0;
 		} else {
 			for (hw = &ne2k_cbus_hwinfo_list[0]; hw->hwtype; hw++) {
 				const unsigned short *plist;
 				for (plist = hw->portlist; *plist; plist++)
-					if (ne_probe_cbus(dev, hw, *plist) == 0)
+					if (ne_probe_cbus(dev, hw, *plist, irq) == 0)
 						return 0;
 			}
 		}
@@ -174,7 +174,45 @@
 	return -ENODEV;
 }
 
-static int __init ne_probe_cbus(struct net_device *dev, const struct ne2k_cbus_hwinfo *hw, int ioaddr)
+static void cleanup_card(struct net_device *dev)
+{
+	const struct ne2k_cbus_region *rlist;
+	const struct ne2k_cbus_hwinfo *hw = ne2k_cbus_get_hwinfo((int)(dev->mem_start & NE2K_CBUS_HARDWARE_TYPE_MASK));
+
+	free_irq(dev->irq, dev);
+	for (rlist = hw->regionlist; rlist->range; rlist++) {
+		release_region(dev->base_addr + rlist->start,
+				rlist->range);
+	}
+	ne2k_cbus_destroy(dev);
+}
+
+struct net_device * __init ne_probe(int unit)
+{
+	struct net_device *dev = alloc_ei_netdev();
+	int err;
+
+	if (!dev)
+		return ERR_PTR(-ENOMEM);
+
+	sprintf(dev->name, "eth%d", unit);
+	netdev_boot_setup_check(dev);
+
+	err = do_ne_probe(dev);
+	if (err)
+		goto out;
+	err = register_netdev(dev);
+	if (err)
+		goto out1;
+	return dev;
+out1:
+	cleanup_card(dev);
+out:
+	free_netdev(dev);
+	return ERR_PTR(err);
+}
+
+static int __init ne_probe_cbus(struct net_device *dev, const struct ne2k_cbus_hwinfo *hw, int ioaddr, int irq)
 {
 	if (ei_debug > 2)
 		printk(KERN_DEBUG "ne_probe_cbus(): entered. (called from %p)\n",
@@ -182,6 +220,7 @@
 
 	if (hw && hw->hwtype) {
 		ne2k_cbus_set_hwtype(dev, hw, ioaddr);
+		dev->irq = irq;
 		return ne_probe1(dev, ioaddr);
 	} else {
 		/* auto detect */
@@ -189,6 +228,7 @@
 		printk(KERN_DEBUG "ne_probe_cbus(): try to determine hardware types.\n");
 		for (hw = &ne2k_cbus_hwinfo_list[0]; hw->hwtype; hw++) {
 			ne2k_cbus_set_hwtype(dev, hw, ioaddr);
+			dev->irq = irq;
 			if (ne_probe1(dev, ioaddr) == 0)
 				return 0;
 		}
@@ -301,11 +341,12 @@
 		if (ei_debug > 2)
 			printk(" [CNET98EL-specific initialize...");
 		outb_p(E8390_NODMA | E8390_STOP, ioaddr + E8390_CMD); /* 0x20|0x1 */
+		ret = -ENODEV;
 		i = inb(ioaddr);
 		if ((i & ~0x2) != (0x20 | 0x01))
-			return -ENODEV;
+			goto err_out;
 		if ((inb(ioaddr + 0x7) & 0x80) != 0x80)
-			return -ENODEV;
+			goto err_out;
 		outb_p(E8390_RXOFF, ioaddr + EN0_RXCR); /* out(ioaddr+0xc, 0x20) */
 		/* outb_p(ENDCFG_WTS|ENDCFG_FT1|ENDCFG_LS, ioaddr+EN0_DCFG); */
 		outb_p(ENDCFG_WTS | 0x48, ioaddr + EN0_DCFG); /* 0x49 */
@@ -330,7 +371,7 @@
 			if (ei_debug > 2)
 				printk("] ");
 			printk("memory failure at %x\n", i);
-			return -ENODEV;
+			goto err_out;
 		}
 		if (ei_debug > 2)
 			printk(" good...");
@@ -338,7 +379,7 @@
 			if (ei_debug > 2)
 				printk("] ");
 			printk("IRQ must be specified for C-NET(98)E/L. probe failed.\n");
-			return -ENODEV;
+			goto err_out;
 		}
 		outb((dev->irq > 5) ? (dev->irq & 4):(dev->irq >> 1), ioaddr + (0x2 | 0x400));
 		outb(0x7e, ioaddr + (0x4 | 0x400));
@@ -457,14 +498,6 @@
 		goto err_out;
 	}
 
-	/* Allocate dev->priv and fill in 8390 specific dev fields. */
-	if (ethdev_init(dev))
-	{
-        	printk (" unable to get memory for dev->priv.\n");
-        	ret = -ENOMEM;
-		goto err_out;
-	}
-
 	/* Snarf the interrupt now.  There's no point in waiting since we cannot
 	   share and the board will usually be enabled. */
 	ret = request_irq(dev->irq, ei_interrupt, 0, name, dev);
@@ -501,6 +534,9 @@
 	ei_status.priv = 0;
 	dev->open = &ne_open;
 	dev->stop = &ne_close;
+#ifdef CONFIG_NET_POLL_CONTROLLER
+	dev->poll_controller = ei_poll;
+#endif
 	NS8390_init(dev, 0);
 	return 0;
 
@@ -779,7 +815,7 @@
 
 #ifdef MODULE
 #define MAX_NE_CARDS	4	/* Max number of NE cards per module */
-static struct net_device dev_ne[MAX_NE_CARDS];
+static struct net_device *dev_ne[MAX_NE_CARDS];
 static int io[MAX_NE_CARDS];
 static int irq[MAX_NE_CARDS];
 static int bad[MAX_NE_CARDS];	/* 0xbad = bad sig or no reset ack */
@@ -806,26 +842,32 @@
 	int this_dev, found = 0;
 
 	for (this_dev = 0; this_dev < MAX_NE_CARDS; this_dev++) {
-		struct net_device *dev = &dev_ne[this_dev];
+		struct net_device *dev = alloc_ei_netdev();
+		if (!dev)
+			break;
 		dev->irq = irq[this_dev];
 		dev->mem_end = bad[this_dev];
 		dev->base_addr = io[this_dev];
 		dev->mem_start = hwtype[this_dev];
-		dev->init = ne_probe;
-		if (register_netdev(dev) == 0) {
-			found++;
-			continue;
-		}
-		if (found != 0) { 	/* Got at least one. */
-			return 0;
+		if (do_ne_probe(dev) == 0) {
+			if (register_netdev(dev) == 0) {
+				dev_ne[found++] = dev;
+				continue;
+			}
+			cleanup_card(dev);
 		}
+		free_netdev(dev);
+		if (found)
+			break;
 		if (io[this_dev] != 0)
 			printk(KERN_WARNING "ne2k_cbus: No NE*000 card found at i/o = %#x\n", io[this_dev]);
 		else
-			printk(KERN_NOTICE "ne2k_cbus: You must supply \"io=0xNNN\" value(s) for C-Bus cards.\n");
+			printk(KERN_NOTICE "ne.c: You must supply \"io=0xNNN\" value(s) for ISA cards.\n");
 		return -ENXIO;
 	}
-	return 0;
+	if (found)
+		return 0;
+ 	return -ENODEV;
 }
 
 void cleanup_module(void)
@@ -833,18 +875,11 @@
 	int this_dev;
 
 	for (this_dev = 0; this_dev < MAX_NE_CARDS; this_dev++) {
-		struct net_device *dev = &dev_ne[this_dev];
-		if (dev->priv != NULL) {
-			const struct ne2k_cbus_region *rlist;
-			const struct ne2k_cbus_hwinfo *hw = ne2k_cbus_get_hwinfo((int)(dev->mem_start & NE2K_CBUS_HARDWARE_TYPE_MASK));
-
-			free_irq(dev->irq, dev);
-			for (rlist = hw->regionlist; rlist->range; rlist++) {
-				release_region(dev->base_addr + rlist->start,
-						rlist->range);
-			}
+		struct net_device *dev = dev_ne[this_dev];
+		if (dev) {
 			unregister_netdev(dev);
-			ne2k_cbus_destroy(dev);
+			cleanup_card(dev);
+			free_netdev(dev);
 		}
 	}
 }
--- diff/drivers/net/ne2k_cbus.h	2003-05-21 11:49:55.000000000 +0100
+++ source/drivers/net/ne2k_cbus.h	2004-02-09 10:39:53.000000000 +0000
@@ -477,5 +477,5 @@
 }
 #endif
 
-static int ne_probe_cbus(struct net_device *dev, const struct ne2k_cbus_hwinfo *hw, int ioaddr);
+static int ne_probe_cbus(struct net_device *dev, const struct ne2k_cbus_hwinfo *hw, int ioaddr, int irq);
 /* End of ne2k_cbus.h */
--- diff/drivers/net/ne3210.c	2003-10-09 09:47:34.000000000 +0100
+++ source/drivers/net/ne3210.c	2004-02-09 10:39:53.000000000 +0000
@@ -111,12 +111,6 @@
 	device->driver_data = dev;
 	ioaddr = edev->base_addr;
 
-	if (ethdev_init (dev)) {
-		printk ("ne3210.c: unable to allocate memory for dev->priv!\n");
-		retval = -ENOMEM;
-		goto out;
-	}
-
 	if (!request_region(ioaddr, NE3210_IO_EXTENT, dev->name)) {
 		retval = -EBUSY;
 		goto out;
@@ -211,6 +205,9 @@
 
 	dev->open = &ne3210_open;
 	dev->stop = &ne3210_close;
+#ifdef CONFIG_NET_POLL_CONTROLLER
+	dev->poll_controller = ei_poll;
+#endif
 	dev->if_port = ifmap_val[port_index];
 
 	if ((retval = register_netdev (dev)))
@@ -357,24 +354,6 @@
 	},
 };
 
-#ifdef MODULE
-#if 0
-#define MAX_NE3210_CARDS	4	/* Max number of NE3210 cards per module */
-static struct net_device dev_ne3210[MAX_NE3210_CARDS];
-static int io[MAX_NE3210_CARDS];
-static int irq[MAX_NE3210_CARDS];
-static int mem[MAX_NE3210_CARDS];
-
-MODULE_PARM(io, "1-" __MODULE_STRING(MAX_NE3210_CARDS) "i");
-MODULE_PARM(irq, "1-" __MODULE_STRING(MAX_NE3210_CARDS) "i");
-MODULE_PARM(mem, "1-" __MODULE_STRING(MAX_NE3210_CARDS) "i");
-MODULE_PARM_DESC(io, "I/O base address(es)");
-MODULE_PARM_DESC(irq, "IRQ number(s)");
-MODULE_PARM_DESC(mem, "memory base address(es)");
-#endif
-#endif /* MODULE */
-
-
 MODULE_DESCRIPTION("NE3210 EISA Ethernet driver");
 MODULE_LICENSE("GPL");
 
--- diff/drivers/net/net_init.c	2003-10-27 09:20:38.000000000 +0000
+++ source/drivers/net/net_init.c	2004-02-09 10:39:53.000000000 +0000
@@ -73,23 +73,28 @@
 struct net_device *alloc_netdev(int sizeof_priv, const char *mask,
 				       void (*setup)(struct net_device *))
 {
+	void *p;
 	struct net_device *dev;
 	int alloc_size;
 
-	/* ensure 32-byte alignment of the private area */
-	alloc_size = sizeof (*dev) + sizeof_priv + 31;
+	/* ensure 32-byte alignment of both the device and private area */
 
-	dev = (struct net_device *) kmalloc (alloc_size, GFP_KERNEL);
-	if (dev == NULL)
-	{
-		printk(KERN_ERR "alloc_dev: Unable to allocate device memory.\n");
+	alloc_size = (sizeof(struct net_device) + 31) & ~31;
+	alloc_size += sizeof_priv + 31;
+
+	p = kmalloc (alloc_size, GFP_KERNEL);
+	if (!p) {
+		printk(KERN_ERR "alloc_dev: Unable to allocate device.\n");
 		return NULL;
 	}
 
-	memset(dev, 0, alloc_size);
+	memset(p, 0, alloc_size);
+
+	dev = (struct net_device *)(((long)p + 31) & ~31);
+	dev->padded = (char *)dev - (char *)p;
 
 	if (sizeof_priv)
-		dev->priv = (void *) (((long)(dev + 1) + 31) & ~31);
+		dev->priv = netdev_priv(dev);
 
 	setup(dev);
 	strcpy(dev->name, mask);
--- diff/drivers/net/ni5010.c	2003-09-30 15:46:15.000000000 +0100
+++ source/drivers/net/ni5010.c	2004-02-09 10:39:53.000000000 +0000
@@ -82,7 +82,7 @@
 
 #ifndef FULL_IODETECT
 /* A zero-terminated list of I/O addresses to be probed. */
-static unsigned int ni5010_portlist[] __initdata =
+static unsigned int ports[] __initdata =
 	{ 0x300, 0x320, 0x340, 0x360, 0x380, 0x3a0, 0 };
 #endif
 
@@ -95,13 +95,11 @@
 struct ni5010_local {
 	struct net_device_stats stats;
 	int o_pkt_size;
-	int i_pkt_size;
 	spinlock_t lock;
 };
 
 /* Index to functions, as function prototypes. */
 
-extern int 	ni5010_probe(struct net_device *dev);
 static int	ni5010_probe1(struct net_device *dev, int ioaddr);
 static int	ni5010_open(struct net_device *dev);
 static int	ni5010_send_packet(struct sk_buff *skb, struct net_device *dev);
@@ -120,38 +118,58 @@
 static void	dump_packet(void *buf, int len);
 static void 	ni5010_show_registers(struct net_device *dev);
 
+static int io;
+static int irq;
 
-int __init ni5010_probe(struct net_device *dev)
+struct net_device * __init ni5010_probe(int unit)
 {
+	struct net_device *dev = alloc_etherdev(sizeof(struct ni5010_local));
 	int *port;
-	int base_addr = dev->base_addr;
+	int err = 0;
 
-        PRINTK2((KERN_DEBUG "%s: Entering ni5010_probe\n", dev->name));
+	if (!dev)
+		return ERR_PTR(-ENOMEM);
 
-	SET_MODULE_OWNER(dev);
+	if (unit >= 0) {
+		sprintf(dev->name, "eth%d", unit);
+		netdev_boot_setup_check(dev);
+		io = dev->base_addr;
+		irq = dev->irq;
+	}
 
-	if (base_addr > 0x1ff)		/* Check a single specified location. */
-		return ni5010_probe1(dev, base_addr);
-	else if (base_addr != 0)	/* Don't probe at all. */
-		return -ENXIO;
+	PRINTK2((KERN_DEBUG "%s: Entering ni5010_probe\n", dev->name));
 
+	SET_MODULE_OWNER(dev);
+
+	if (io > 0x1ff)	{	/* Check a single specified location. */
+		err = ni5010_probe1(dev, io);
+	} else if (io != 0) {	/* Don't probe at all. */
+		err = -ENXIO;
+	} else {
 #ifdef FULL_IODETECT
-		for (int ioaddr=0x200; ioaddr<0x400; ioaddr+=0x20) {
-			if (check_region(ioaddr, NI5010_IO_EXTENT))
-				continue;
-			if (ni5010_probe1(dev, ioaddr) == 0)
-				return 0;
-		}
+		for (io=0x200; io<0x400 && ni5010_probe1(dev, io) ; io+=0x20)
+			;
+		if (io == 0x400)
+			err = -ENODEV;
+
 #else
-		for (port = ni5010_portlist; *port; port++) {
-			int ioaddr = *port;
-			if (check_region(ioaddr, NI5010_IO_EXTENT))
-				continue;
-			if (ni5010_probe1(dev, ioaddr) == 0)
-				return 0;
-		}
+		for (port = ports; *port && ni5010_probe1(dev, *port); port++)
+			;
+		if (!*port)
+			err = -ENODEV;
 #endif	/* FULL_IODETECT */
-	return -ENODEV;
+	}
+	if (err)
+		goto out;
+	err = register_netdev(dev);
+	if (err)
+		goto out1;
+	return dev;
+out1:
+	release_region(dev->base_addr, NI5010_IO_EXTENT);
+out:
+	free_netdev(dev);
+	return ERR_PTR(err);
 }
 
 static inline int rd_port(int ioaddr)
@@ -188,9 +206,17 @@
 static int __init ni5010_probe1(struct net_device *dev, int ioaddr)
 {
 	static unsigned version_printed;
+	struct ni5010_local *lp;
 	int i;
 	unsigned int data = 0;
 	int boguscount = 40;
+	int err = -ENODEV;
+
+	dev->base_addr = ioaddr;
+	dev->irq = irq;
+
+	if (!request_region(ioaddr, NI5010_IO_EXTENT, boardname))
+		return -EBUSY;
 
 	/*
 	 * This is no "official" probe method, I've rather tested which
@@ -205,36 +231,40 @@
 	 *
 	 *   - Andreas
 	 */
-	
+
  	PRINTK2((KERN_DEBUG "%s: entering ni5010_probe1(%#3x)\n", 
  		dev->name, ioaddr));
 
-	if (inb(ioaddr+0) == 0xff) return -ENODEV;
+	if (inb(ioaddr+0) == 0xff)
+		goto out;
 
 	while ( (rd_port(ioaddr) & rd_port(ioaddr) & rd_port(ioaddr) &
 		 rd_port(ioaddr) & rd_port(ioaddr) & rd_port(ioaddr)) != 0xff)
 	{
-		if (boguscount-- == 0) return -ENODEV;
+		if (boguscount-- == 0)
+			goto out;
 	}
 
 	PRINTK2((KERN_DEBUG "%s: I/O #1 passed!\n", dev->name));
 
 	for (i=0; i<32; i++)
 		if ( (data = rd_port(ioaddr)) != 0xff) break;
-	if (data==0xff) return -ENODEV;
+	if (data==0xff)
+		goto out;
 
 	PRINTK2((KERN_DEBUG "%s: I/O #2 passed!\n", dev->name));
 
-	if (		(data == SA_ADDR0) &&
-	     (rd_port(ioaddr) == SA_ADDR1) &&
-	     (rd_port(ioaddr) == SA_ADDR2) ) {
-		for (i=0; i<4; i++) rd_port(ioaddr);
-		if ( (rd_port(ioaddr) != NI5010_MAGICVAL1) ||
-		     (rd_port(ioaddr) != NI5010_MAGICVAL2) ) {
-		     	return -ENODEV;
-		}
-	} else return -ENODEV;
-	
+	if ((data != SA_ADDR0) || (rd_port(ioaddr) != SA_ADDR1) ||
+	    (rd_port(ioaddr) != SA_ADDR2))
+		goto out;
+
+	for (i=0; i<4; i++)
+		rd_port(ioaddr);
+
+	if ( (rd_port(ioaddr) != NI5010_MAGICVAL1) ||
+	     (rd_port(ioaddr) != NI5010_MAGICVAL2) )
+		goto out;
+
 	PRINTK2((KERN_DEBUG "%s: I/O #3 passed!\n", dev->name));
 
 	if (NI5010_DEBUG && version_printed++ == 0)
@@ -267,8 +297,9 @@
 		PRINTK2((KERN_DEBUG "%s: I/O #6 passed!\n", dev->name));
 
 		if (dev->irq == 0) {
+			err = -EAGAIN;
 			printk(KERN_WARNING "%s: no IRQ found!\n", dev->name);
-			return -EAGAIN;
+			goto out;
 		}
 		PRINTK2((KERN_DEBUG "%s: I/O #7 passed!\n", dev->name));
 	} else if (dev->irq == 2) {
@@ -278,19 +309,9 @@
 	PRINTK2((KERN_DEBUG "%s: I/O #9 passed!\n", dev->name));
 
 	/* DMA is not supported (yet?), so no use detecting it */
+	lp = (struct ni5010_local*)dev->priv;
 
-	if (dev->priv == NULL) {
-		struct ni5010_local* lp;
-
-		dev->priv = kmalloc(sizeof(struct ni5010_local), GFP_KERNEL|GFP_DMA);
-		if (dev->priv == NULL) {
-			printk(KERN_WARNING "%s: Failed to allocate private memory\n", dev->name);
-			return -ENOMEM;
-		}
-
-		lp = (struct ni5010_local*)dev->priv;
-		spin_lock_init(&lp->lock);
-	}
+	spin_lock_init(&lp->lock);
 
 	PRINTK2((KERN_DEBUG "%s: I/O #10 passed!\n", dev->name));
 
@@ -315,9 +336,6 @@
 	}
         printk("// bufsize rcv/xmt=%d/%d\n", bufsize_rcv, NI5010_BUFSIZE);
 	memset(dev->priv, 0, sizeof(struct ni5010_local));
-
-	/* Grab the region so we can find another board if autoIRQ fails. */
-	request_region(ioaddr, NI5010_IO_EXTENT, boardname);
 	
 	dev->open		= ni5010_open;
 	dev->stop		= ni5010_close;
@@ -327,9 +345,6 @@
 	dev->tx_timeout		= ni5010_timeout;
 	dev->watchdog_timeo	= HZ/20;
 
-	/* Fill in the fields of the device structure with ethernet values. */
-	ether_setup(dev);
-	
 	dev->flags &= ~IFF_MULTICAST;	/* Multicast doesn't work */
 
 	/* Shut up the ni5010 */
@@ -345,6 +360,9 @@
 	printk(KERN_INFO "Join the NI5010 driver development team!\n");
 	printk(KERN_INFO "Mail to a.mohr@mailto.de or jvbest@wi.leidenuniv.nl\n");
 	return 0;
+out:
+	release_region(dev->base_addr, NI5010_IO_EXTENT);
+	return err;
 }
 
 /* 
@@ -513,6 +531,7 @@
 	int ioaddr = dev->base_addr;
 	unsigned char rcv_stat;
 	struct sk_buff *skb;
+	int i_pkt_size;
 	
 	PRINTK2((KERN_DEBUG "%s: entering ni5010_rx()\n", dev->name)); 
 	
@@ -532,17 +551,17 @@
 	
         outb(0xff, EDLC_RCLR);  /* Clear the interrupt */
 
-	lp->i_pkt_size = inw(IE_RCNT);
-	if (lp->i_pkt_size > ETH_FRAME_LEN || lp->i_pkt_size < 10 ) {
+	i_pkt_size = inw(IE_RCNT);
+	if (i_pkt_size > ETH_FRAME_LEN || i_pkt_size < 10 ) {
 		PRINTK((KERN_DEBUG "%s: Packet size error, packet size = %#4.4x\n", 
-			dev->name, lp->i_pkt_size));
+			dev->name, i_pkt_size));
 		lp->stats.rx_errors++;
 		lp->stats.rx_length_errors++;
 		return;
 	}
 
 	/* Malloc up new buffer. */
-	skb = dev_alloc_skb(lp->i_pkt_size + 3);
+	skb = dev_alloc_skb(i_pkt_size + 3);
 	if (skb == NULL) {
 		printk(KERN_WARNING "%s: Memory squeeze, dropping packet.\n", dev->name);
 		lp->stats.rx_dropped++;
@@ -555,7 +574,7 @@
 	/* Read packet into buffer */
         outb(MM_MUX, IE_MMODE); /* Rcv buffer to system bus */
 	outw(0, IE_GP);	/* Seek to beginning of packet */
-	insb(IE_RBUF, skb_put(skb, lp->i_pkt_size), lp->i_pkt_size); 
+	insb(IE_RBUF, skb_put(skb, i_pkt_size), i_pkt_size); 
 	
 	if (NI5010_DEBUG >= 4) 
 		dump_packet(skb->data, skb->len); 
@@ -564,10 +583,10 @@
 	netif_rx(skb);
 	dev->last_rx = jiffies;
 	lp->stats.rx_packets++;
-	lp->stats.rx_bytes += lp->i_pkt_size;
+	lp->stats.rx_bytes += i_pkt_size;
 
 	PRINTK2((KERN_DEBUG "%s: Received packet, size=%#4.4x\n", 
-		dev->name, lp->i_pkt_size));
+		dev->name, i_pkt_size));
 	
 }
 
@@ -697,10 +716,10 @@
 	
 	if (NI5010_DEBUG > 3) dump_packet(buf, length);
 
-        buf_offs = NI5010_BUFSIZE - length - pad;
-        lp->o_pkt_size = length + pad;
+	buf_offs = NI5010_BUFSIZE - length - pad;
 
 	spin_lock_irqsave(&lp->lock, flags);
+	lp->o_pkt_size = length + pad;
 
 	outb(0, EDLC_RMASK);	/* Mask all receive interrupts */
 	outb(0, IE_MMODE);	/* Put Xmit buffer on system bus */
@@ -745,9 +764,7 @@
 }
 
 #ifdef MODULE
-static struct net_device dev_ni5010;
-static int io;
-static int irq;
+static struct net_device *dev_ni5010;
 
 MODULE_PARM(io, "i");
 MODULE_PARM(irq, "i");
@@ -756,8 +773,6 @@
 
 int init_module(void)
 {
-	int result;
-	
 	PRINTK2((KERN_DEBUG "%s: entering init_module\n", boardname));
 	/*
 	if(io <= 0 || irq == 0){
@@ -771,29 +786,18 @@
 	}
 
 	PRINTK2((KERN_DEBUG "%s: init_module irq=%#2x, io=%#3x\n", boardname, irq, io));
-        dev_ni5010.irq=irq;
-        dev_ni5010.base_addr=io;
-	dev_ni5010.init=ni5010_probe;
-        if ((result = register_netdev(&dev_ni5010)) != 0) {
-        	PRINTK((KERN_WARNING "%s: register_netdev returned %d.\n", 
-        		boardname, result));
-                return -EIO;
-        }
+	dev_ni5010 = ni5010_probe(-1);
+	if (IS_ERR(dev_ni5010))
+		return PTR_ERR(dev_ni5010);
         return 0;
 }
 
-void
-cleanup_module(void)
+void cleanup_module(void)
 {
 	PRINTK2((KERN_DEBUG "%s: entering cleanup_module\n", boardname));
-
-        unregister_netdev(&dev_ni5010);
-
-	release_region(dev_ni5010.base_addr, NI5010_IO_EXTENT);
-	if (dev_ni5010.priv != NULL){
-	        kfree(dev_ni5010.priv);
-	        dev_ni5010.priv = NULL;
-	}
+	unregister_netdev(dev_ni5010);
+	release_region(dev_ni5010->base_addr, NI5010_IO_EXTENT);
+	free_netdev(dev_ni5010);
 }
 #endif /* MODULE */
 MODULE_LICENSE("GPL");
--- diff/drivers/net/ni52.c	2003-09-30 15:46:15.000000000 +0100
+++ source/drivers/net/ni52.c	2004-02-09 10:39:53.000000000 +0000
@@ -354,50 +354,76 @@
 	memset((char *)p->scb,0,sizeof(struct scb_struct));
 }
 
+/* set: io,irq,memstart,memend or set it when calling insmod */
+static int irq=9;
+static int io=0x300;
+static long memstart;	/* e.g 0xd0000 */
+static long memend;	/* e.g 0xd4000 */
+
 /**********************************************
  * probe the ni5210-card
  */
-int __init ni52_probe(struct net_device *dev)
+struct net_device * __init ni52_probe(int unit)
 {
-#ifndef MODULE
-	int *port;
+	struct net_device *dev = alloc_etherdev(sizeof(struct priv));
 	static int ports[] = {0x300, 0x280, 0x360 , 0x320 , 0x340, 0};
-#endif
-	int base_addr = dev->base_addr;
-
-	SET_MODULE_OWNER(dev);
+	int *port;
+	int err = 0;
 
-	if (base_addr > 0x1ff)		/* Check a single specified location. */
-		return ni52_probe1(dev, base_addr);
-	else if (base_addr > 0)		/* Don't probe at all. */
-		return -ENXIO;
+	if (!dev)
+		return ERR_PTR(-ENOMEM);
 
-#ifdef MODULE
-	printk("%s: no autoprobing allowed for modules.\n",dev->name);
-#else
-	for (port = ports; *port; port++) {
-		int ioaddr = *port;
-		dev->base_addr = ioaddr;
-		if (ni52_probe1(dev, ioaddr) == 0)
-			return 0;
+	if (unit >= 0) {
+		sprintf(dev->name, "eth%d", unit);
+		netdev_boot_setup_check(dev);
+		io = dev->base_addr;
+		irq = dev->irq;
+		memstart = dev->mem_start;
+		memend = dev->mem_end;
 	}
 
-#ifdef FULL_IO_PROBE
-	for(dev->base_addr=0x200; dev->base_addr<0x400; dev->base_addr+=8)
-		if (ni52_probe1(dev, dev->base_addr) == 0)
-			return 0;
-#endif
+	SET_MODULE_OWNER(dev);
 
+	if (io > 0x1ff)	{	/* Check a single specified location. */
+		err = ni52_probe1(dev, io);
+	} else if (io > 0) {		/* Don't probe at all. */
+		err = -ENXIO;
+	} else {
+		for (port = ports; *port && ni52_probe1(dev, *port) ; port++)
+			;
+		if (*port)
+			goto got_it;
+#ifdef FULL_IO_PROBE
+		for (io = 0x200; io < 0x400 && ni52_probe1(dev, io); io += 8)
+			;
+		if (io < 0x400)
+			goto got_it;
 #endif
-
-	dev->base_addr = base_addr;
-	return -ENODEV;
+		err = -ENODEV;
+	}
+	if (err)
+		goto out;
+got_it:
+	err = register_netdev(dev);
+	if (err)
+		goto out1;
+	return dev;
+out1:
+	release_region(dev->base_addr, NI52_TOTAL_SIZE);
+out:
+	free_netdev(dev);
+	return ERR_PTR(err);
 }
 
 static int __init ni52_probe1(struct net_device *dev,int ioaddr)
 {
 	int i, size, retval;
 
+	dev->base_addr = ioaddr;
+	dev->irq = irq;
+	dev->mem_start = memstart;
+	dev->mem_end = memend;
+
 	if (!request_region(ioaddr, NI52_TOTAL_SIZE, dev->name))
 		return -EBUSY;
 
@@ -416,7 +442,7 @@
 		goto out;
 	}
 
-	printk("%s: NI5210 found at %#3lx, ",dev->name,dev->base_addr);
+	printk(KERN_INFO "%s: NI5210 found at %#3lx, ",dev->name,dev->base_addr);
 
 	/*
 	 * check (or search) IO-Memory, 8K and 16K
@@ -469,13 +495,6 @@
 	dev->mem_end = dev->mem_start + size; /* set mem_end showed by 'ifconfig' */
 #endif
 
-	dev->priv = (void *) kmalloc(sizeof(struct priv),GFP_KERNEL);
-	if(dev->priv == NULL) {
-		printk("%s: Ooops .. can't allocate private driver memory.\n",dev->name);
-		retval = -ENOMEM;
-		goto out;
-	}
-																	/* warning: we don't free it on errors */
 	memset((char *) dev->priv,0,sizeof(struct priv));
 
 	((struct priv *) (dev->priv))->memtop = isa_bus_to_virt(dev->mem_start) + size;
@@ -503,8 +522,6 @@
 		if(!dev->irq)
 		{
 			printk("?autoirq, Failed to detect IRQ line!\n");
-			kfree(dev->priv);
-			dev->priv = NULL;
 			retval = -EAGAIN;
 			goto out;
 		}
@@ -526,8 +543,6 @@
 
 	dev->if_port 		= 0;
 
-	ether_setup(dev);
-
 	return 0;
 out:
 	release_region(ioaddr, NI52_TOTAL_SIZE);
@@ -1295,13 +1310,7 @@
 }
 
 #ifdef MODULE
-static struct net_device dev_ni52;
-
-/* set: io,irq,memstart,memend or set it when calling insmod */
-static int irq=9;
-static int io=0x300;
-static long memstart;	/* e.g 0xd0000 */
-static long memend;	/* e.g 0xd4000 */
+static struct net_device *dev_ni52;
 
 MODULE_PARM(io, "i");
 MODULE_PARM(irq, "i");
@@ -1318,22 +1327,17 @@
 		printk("ni52: Autoprobing not allowed for modules.\nni52: Set symbols 'io' 'irq' 'memstart' and 'memend'\n");
 		return -ENODEV;
 	}
-	dev_ni52.init = ni52_probe;
-	dev_ni52.irq = irq;
-	dev_ni52.base_addr = io;
-	dev_ni52.mem_end = memend;
-	dev_ni52.mem_start = memstart;
-	if (register_netdev(&dev_ni52) != 0)
-		return -EIO;
+	dev_ni52 = ni52_probe(-1);
+	if (IS_ERR(dev_ni52))
+		return PTR_ERR(dev_ni52);
 	return 0;
 }
 
 void cleanup_module(void)
 {
-	release_region(dev_ni52.base_addr, NI52_TOTAL_SIZE);
-	unregister_netdev(&dev_ni52);
-	kfree(dev_ni52.priv);
-	dev_ni52.priv = NULL;
+	unregister_netdev(dev_ni52);
+	release_region(dev_ni52->base_addr, NI52_TOTAL_SIZE);
+	free_netdev(dev_ni52);
 }
 #endif /* MODULE */
 
--- diff/drivers/net/ni65.c	2003-09-30 15:46:15.000000000 +0100
+++ source/drivers/net/ni65.c	2004-02-09 10:39:53.000000000 +0000
@@ -343,29 +343,64 @@
 	return 0;
 }
 
+static void cleanup_card(struct net_device *dev)
+{
+	struct priv *p = (struct priv *) dev->priv;
+	disable_dma(dev->dma);
+	free_dma(dev->dma);
+	release_region(dev->base_addr, cards[p->cardno].total_size);
+	ni65_free_buffer(p);
+}
+
+/* set: io,irq,dma or set it when calling insmod */
+static int irq;
+static int io;
+static int dma;
+
 /*
  * Probe The Card (not the lance-chip)
  */
-#ifdef MODULE
-static
-#endif
-int __init ni65_probe(struct net_device *dev)
+struct net_device * __init ni65_probe(int unit)
 {
-	int *port;
+	struct net_device *dev = alloc_etherdev(0);
 	static int ports[] = {0x360,0x300,0x320,0x340, 0};
+	int *port;
+	int err = 0;
 
-	if (dev->base_addr > 0x1ff)          /* Check a single specified location. */
-		 return ni65_probe1(dev, dev->base_addr);
-	else if (dev->base_addr > 0)         /* Don't probe at all. */
-		 return -ENXIO;
+	if (!dev)
+		return ERR_PTR(-ENOMEM);
 
-	for (port = ports; *port; port++)
-	{
-		if (ni65_probe1(dev, *port) == 0)
-			 return 0;
-	}
-
-	return -ENODEV;
+	if (unit >= 0) {
+		sprintf(dev->name, "eth%d", unit);
+		netdev_boot_setup_check(dev);
+		irq = dev->irq;
+		dma = dev->dma;
+	} else {
+		dev->base_addr = io;
+	}
+
+	if (dev->base_addr > 0x1ff) { /* Check a single specified location. */
+		err = ni65_probe1(dev, dev->base_addr);
+	} else if (dev->base_addr > 0) { /* Don't probe at all. */
+		err = -ENXIO;
+	} else {
+		for (port = ports; *port && ni65_probe1(dev, *port); port++)
+			;
+		if (!*port)
+			err = -ENODEV;
+	}
+	if (err)
+		goto out;
+
+	err = register_netdev(dev);
+	if (err)
+		goto out1;
+	return dev;
+out1:
+	cleanup_card(dev);
+out:
+	free_netdev(dev);
+	return ERR_PTR(err);
 }
 
 /*
@@ -377,6 +412,9 @@
 	struct priv *p;
 	unsigned long flags;
 
+	dev->irq = irq;
+	dev->dma = dma;
+
 	for(i=0;i<NUM_CARDS;i++) {
 		if(!request_region(ioaddr, cards[i].total_size, cards[i].cardname))
 			continue;
@@ -521,9 +559,6 @@
 	dev->watchdog_timeo	= HZ/2;
 	dev->get_stats		= ni65_get_stats;
 	dev->set_multicast_list = set_multicast_list;
-
-	ether_setup(dev);
-
 	return 0; /* everything is OK */
 }
 
@@ -1213,12 +1248,7 @@
 }
 
 #ifdef MODULE
-static struct net_device dev_ni65 = { .base_addr = 0x360, .irq = 9, .init = ni65_probe };
-
-/* set: io,irq,dma or set it when calling insmod */
-static int irq;
-static int io;
-static int dma;
+static struct net_device *dev_ni65;
 
 MODULE_PARM(irq, "i");
 MODULE_PARM(io, "i");
@@ -1229,26 +1259,15 @@
 
 int init_module(void)
 {
-	dev_ni65.irq = irq;
-	dev_ni65.dma = dma;
-	dev_ni65.base_addr = io;
-	if (register_netdev(&dev_ni65) != 0)
-		return -EIO;
-	return 0;
+ 	dev_ni65 = ni65_probe(-1);
+	return IS_ERR(dev_ni65) ? PTR_ERR(dev_ni65) : 0;
 }
 
 void cleanup_module(void)
 {
-	struct priv *p;
-	p = (struct priv *) dev_ni65.priv;
-	if(!p)
-		BUG();
-	disable_dma(dev_ni65.dma);
-	free_dma(dev_ni65.dma);
-	unregister_netdev(&dev_ni65);
-	release_region(dev_ni65.base_addr,cards[p->cardno].total_size);
-	ni65_free_buffer(p);
-	dev_ni65.priv = NULL;
+ 	unregister_netdev(dev_ni65);
+ 	cleanup_card(dev_ni65);
+ 	free_netdev(dev_ni65);
 }
 #endif /* MODULE */
 
--- diff/drivers/net/ns83820.c	2003-09-30 15:46:15.000000000 +0100
+++ source/drivers/net/ns83820.c	2004-02-09 10:39:53.000000000 +0000
@@ -374,19 +374,6 @@
 #define LINK_DOWN		0x02
 #define LINK_UP			0x04
 
-#define __kick_rx(dev)	writel(CR_RXE, dev->base + CR)
-
-#define kick_rx(dev) do { \
-	dprintk("kick_rx: maybe kicking\n"); \
-	if (test_and_clear_bit(0, &dev->rx_info.idle)) { \
-		dprintk("actually kicking\n"); \
-		writel(dev->rx_info.phy_descs + (4 * DESC_SIZE * dev->rx_info.next_rx), dev->base + RXDP); \
-		if (dev->rx_info.next_rx == dev->rx_info.next_empty) \
-			printk(KERN_DEBUG "%s: uh-oh: next_rx == next_empty???\n", dev->net_dev.name);\
-		__kick_rx(dev); \
-	} \
-} while(0)
-
 #ifdef USE_64BIT_ADDR
 #define HW_ADDR_LEN	8
 #define desc_addr_set(desc, addr)				\
@@ -438,7 +425,6 @@
 
 
 struct ns83820 {
-	struct net_device	net_dev;	/* must be first */
 	struct net_device_stats	stats;
 	u8			*base;
 
@@ -478,6 +464,29 @@
 	struct timer_list	tx_watchdog;
 };
 
+static inline struct ns83820 *PRIV(struct net_device *dev)
+{
+	return netdev_priv(dev);
+}
+
+#define __kick_rx(dev)	writel(CR_RXE, dev->base + CR)
+
+static inline void kick_rx(struct net_device *ndev)
+{
+	struct ns83820 *dev = PRIV(ndev);
+	dprintk("kick_rx: maybe kicking\n");
+	if (test_and_clear_bit(0, &dev->rx_info.idle)) {
+		dprintk("actually kicking\n");
+		writel(dev->rx_info.phy_descs +
+			(4 * DESC_SIZE * dev->rx_info.next_rx),
+		       dev->base + RXDP);
+		if (dev->rx_info.next_rx == dev->rx_info.next_empty)
+			printk(KERN_DEBUG "%s: uh-oh: next_rx == next_empty???\n",
+				ndev->name);
+		__kick_rx(dev);
+	}
+}
+
 //free = (tx_done_idx + NR_TX_DESC-2 - free_idx) % NR_TX_DESC
 #define start_tx_okay(dev)	\
 	(((NR_TX_DESC-2 + dev->tx_done_idx - dev->tx_free_idx) % NR_TX_DESC) > MIN_TX_DESC_FREE)
@@ -546,15 +555,16 @@
 	return 0;
 }
 
-static inline int rx_refill(struct ns83820 *dev, int gfp)
+static inline int rx_refill(struct net_device *ndev, int gfp)
 {
+	struct ns83820 *dev = PRIV(ndev);
 	unsigned i;
 	unsigned long flags = 0;
 
 	if (unlikely(nr_rx_empty(dev) <= 2))
 		return 0;
 
-	dprintk("rx_refill(%p)\n", dev);
+	dprintk("rx_refill(%p)\n", ndev);
 	if (gfp == GFP_ATOMIC)
 		spin_lock_irqsave(&dev->rx_info.lock, flags);
 	for (i=0; i<NR_RX_DESC; i++) {
@@ -570,7 +580,7 @@
 		res &= 0xf;
 		skb_reserve(skb, res);
 
-		skb->dev = &dev->net_dev;
+		skb->dev = ndev;
 		if (gfp != GFP_ATOMIC)
 			spin_lock_irqsave(&dev->rx_info.lock, flags);
 		res = ns83820_add_rx_skb(dev, skb);
@@ -587,20 +597,21 @@
 	return i ? 0 : -ENOMEM;
 }
 
-static void FASTCALL(rx_refill_atomic(struct ns83820 *dev));
-static void rx_refill_atomic(struct ns83820 *dev)
+static void FASTCALL(rx_refill_atomic(struct net_device *ndev));
+static void rx_refill_atomic(struct net_device *ndev)
 {
-	rx_refill(dev, GFP_ATOMIC);
+	rx_refill(ndev, GFP_ATOMIC);
 }
 
 /* REFILL */
 static inline void queue_refill(void *_dev)
 {
-	struct ns83820 *dev = _dev;
+	struct net_device *ndev = _dev;
+	struct ns83820 *dev = PRIV(ndev);
 
-	rx_refill(dev, GFP_KERNEL);
+	rx_refill(ndev, GFP_KERNEL);
 	if (dev->rx_info.up)
-		kick_rx(dev);
+		kick_rx(ndev);
 }
 
 static inline void clear_rx_desc(struct ns83820 *dev, unsigned i)
@@ -608,9 +619,10 @@
 	build_rx_desc(dev, dev->rx_info.descs + (DESC_SIZE * i), 0, 0, CMDSTS_OWN, 0);
 }
 
-static void FASTCALL(phy_intr(struct ns83820 *dev));
-static void phy_intr(struct ns83820 *dev)
+static void FASTCALL(phy_intr(struct net_device *ndev));
+static void phy_intr(struct net_device *ndev)
 {
+	struct ns83820 *dev = PRIV(ndev);
 	static char *speeds[] = { "10", "100", "1000", "1000(?)", "1000F" };
 	u32 cfg, new_cfg;
 	u32 tbisr, tanar, tanlpar;
@@ -688,27 +700,28 @@
 
 	if (newlinkstate & LINK_UP
 	    && dev->linkstate != newlinkstate) {
-		netif_start_queue(&dev->net_dev);
-		netif_wake_queue(&dev->net_dev);
+		netif_start_queue(ndev);
+		netif_wake_queue(ndev);
 		printk(KERN_INFO "%s: link now %s mbps, %s duplex and up.\n",
-			dev->net_dev.name,
+			ndev->name,
 			speeds[speed],
 			fullduplex ? "full" : "half");
 	} else if (newlinkstate & LINK_DOWN
 		   && dev->linkstate != newlinkstate) {
-		netif_stop_queue(&dev->net_dev);
-		printk(KERN_INFO "%s: link now down.\n", dev->net_dev.name);
+		netif_stop_queue(ndev);
+		printk(KERN_INFO "%s: link now down.\n", ndev->name);
 	}
 
 	dev->linkstate = newlinkstate;
 }
 
-static int ns83820_setup_rx(struct ns83820 *dev)
+static int ns83820_setup_rx(struct net_device *ndev)
 {
+	struct ns83820 *dev = PRIV(ndev);
 	unsigned i;
 	int ret;
 
-	dprintk("ns83820_setup_rx(%p)\n", dev);
+	dprintk("ns83820_setup_rx(%p)\n", ndev);
 
 	dev->rx_info.idle = 1;
 	dev->rx_info.next_rx = 0;
@@ -721,7 +734,7 @@
 	writel(0, dev->base + RXDP_HI);
 	writel(dev->rx_info.phy_descs, dev->base + RXDP);
 
-	ret = rx_refill(dev, GFP_KERNEL);
+	ret = rx_refill(ndev, GFP_KERNEL);
 	if (!ret) {
 		dprintk("starting receiver\n");
 		/* prevent the interrupt handler from stomping on us */
@@ -734,7 +747,7 @@
 
 		dev->rx_info.up = 1;
 
-		phy_intr(dev);
+		phy_intr(ndev);
 
 		/* Okay, let it rip */
 		spin_lock_irq(&dev->misc_lock);
@@ -753,7 +766,7 @@
 		writel(1, dev->base + IER);
 		spin_unlock_irq(&dev->misc_lock);
 
-		kick_rx(dev);
+		kick_rx(ndev);
 
 		spin_unlock_irq(&dev->rx_info.lock);
 	}
@@ -793,37 +806,39 @@
 	}
 }
 
-static void FASTCALL(ns83820_rx_kick(struct ns83820 *dev));
-static void ns83820_rx_kick(struct ns83820 *dev)
+static void FASTCALL(ns83820_rx_kick(struct net_device *ndev));
+static void ns83820_rx_kick(struct net_device *ndev)
 {
+	struct ns83820 *dev = PRIV(ndev);
 	/*if (nr_rx_empty(dev) >= NR_RX_DESC/4)*/ {
 		if (dev->rx_info.up) {
-			rx_refill_atomic(dev);
-			kick_rx(dev);
+			rx_refill_atomic(ndev);
+			kick_rx(ndev);
 		}
 	}
 
 	if (dev->rx_info.up && nr_rx_empty(dev) > NR_RX_DESC*3/4)
 		schedule_work(&dev->tq_refill);
 	else
-		kick_rx(dev);
+		kick_rx(ndev);
 	if (dev->rx_info.idle)
-		printk(KERN_DEBUG "%s: BAD\n", dev->net_dev.name);
+		printk(KERN_DEBUG "%s: BAD\n", ndev->name);
 }
 
 /* rx_irq
  *	
  */
-static void FASTCALL(rx_irq(struct ns83820 *dev));
-static void rx_irq(struct ns83820 *dev)
+static void FASTCALL(rx_irq(struct net_device *ndev));
+static void rx_irq(struct net_device *ndev)
 {
+	struct ns83820 *dev = PRIV(ndev);
 	struct rx_info *info = &dev->rx_info;
 	unsigned next_rx;
 	u32 cmdsts, *desc;
 	unsigned long flags;
 	int nr = 0;
 
-	dprintk("rx_irq(%p)\n", dev);
+	dprintk("rx_irq(%p)\n", ndev);
 	dprintk("rxdp: %08x, descs: %08lx next_rx[%d]: %p next_empty[%d]: %p\n",
 		readl(dev->base + RXDP),
 		(long)(dev->rx_info.phy_descs),
@@ -873,7 +888,7 @@
 			} else {
 				skb->ip_summed = CHECKSUM_NONE;
 			}
-			skb->protocol = eth_type_trans(skb, &dev->net_dev);
+			skb->protocol = eth_type_trans(skb, ndev);
 			if (NET_RX_DROP == netif_rx(skb)) {
 netdev_mangle_me_harder_failed:
 				dev->stats.rx_dropped ++;
@@ -899,8 +914,9 @@
 
 static void rx_action(unsigned long _dev)
 {
-	struct ns83820 *dev = (void *)_dev;
-	rx_irq(dev);
+	struct net_device *ndev = (void *)_dev;
+	struct ns83820 *dev = PRIV(ndev);
+	rx_irq(ndev);
 	writel(ihr, dev->base + IHR);
 
 	spin_lock_irq(&dev->misc_lock);
@@ -908,8 +924,8 @@
 	writel(dev->IMR_cache, dev->base + IMR);
 	spin_unlock_irq(&dev->misc_lock);
 
-	rx_irq(dev);
-	ns83820_rx_kick(dev);
+	rx_irq(ndev);
+	ns83820_rx_kick(ndev);
 }
 
 /* Packet Transmit code
@@ -924,13 +940,14 @@
 /* No spinlock needed on the transmit irq path as the interrupt handler is
  * serialized.
  */
-static void do_tx_done(struct ns83820 *dev)
+static void do_tx_done(struct net_device *ndev)
 {
+	struct ns83820 *dev = PRIV(ndev);
 	u32 cmdsts, tx_done_idx, *desc;
 
 	spin_lock_irq(&dev->tx_lock);
 
-	dprintk("do_tx_done(%p)\n", dev);
+	dprintk("do_tx_done(%p)\n", ndev);
 	tx_done_idx = dev->tx_done_idx;
 	desc = dev->tx_descs + (tx_done_idx * DESC_SIZE);
 
@@ -980,10 +997,10 @@
 	/* Allow network stack to resume queueing packets after we've
 	 * finished transmitting at least 1/4 of the packets in the queue.
 	 */
-	if (netif_queue_stopped(&dev->net_dev) && start_tx_okay(dev)) {
-		dprintk("start_queue(%p)\n", dev);
-		netif_start_queue(&dev->net_dev);
-		netif_wake_queue(&dev->net_dev);
+	if (netif_queue_stopped(ndev) && start_tx_okay(dev)) {
+		dprintk("start_queue(%p)\n", ndev);
+		netif_start_queue(ndev);
+		netif_wake_queue(ndev);
 	}
 	spin_unlock_irq(&dev->tx_lock);
 }
@@ -1015,9 +1032,9 @@
  * while trying to track down a bug in either the zero copy code or
  * the tx fifo (hence the MAX_FRAG_LEN).
  */
-static int ns83820_hard_start_xmit(struct sk_buff *skb, struct net_device *_dev)
+static int ns83820_hard_start_xmit(struct sk_buff *skb, struct net_device *ndev)
 {
-	struct ns83820 *dev = (struct ns83820 *)_dev;
+	struct ns83820 *dev = PRIV(ndev);
 	u32 free_idx, cmdsts, extsts;
 	int nr_free, nr_frags;
 	unsigned tx_done_idx, last_idx;
@@ -1033,10 +1050,10 @@
 	nr_frags =  skb_shinfo(skb)->nr_frags;
 again:
 	if (unlikely(dev->CFG_cache & CFG_LNKSTS)) {
-		netif_stop_queue(&dev->net_dev);
+		netif_stop_queue(ndev);
 		if (unlikely(dev->CFG_cache & CFG_LNKSTS))
 			return 1;
-		netif_start_queue(&dev->net_dev);
+		netif_start_queue(ndev);
 	}
 
 	last_idx = free_idx = dev->tx_free_idx;
@@ -1044,13 +1061,13 @@
 	nr_free = (tx_done_idx + NR_TX_DESC-2 - free_idx) % NR_TX_DESC;
 	nr_free -= 1;
 	if (nr_free <= nr_frags) {
-		dprintk("stop_queue - not enough(%p)\n", dev);
-		netif_stop_queue(&dev->net_dev);
+		dprintk("stop_queue - not enough(%p)\n", ndev);
+		netif_stop_queue(ndev);
 
 		/* Check again: we may have raced with a tx done irq */
 		if (dev->tx_done_idx != tx_done_idx) {
-			dprintk("restart queue(%p)\n", dev);
-			netif_start_queue(&dev->net_dev);
+			dprintk("restart queue(%p)\n", ndev);
+			netif_start_queue(ndev);
 			goto again;
 		}
 		return 1;
@@ -1063,8 +1080,8 @@
 
 	nr_free -= nr_frags;
 	if (nr_free < MIN_TX_DESC_FREE) {
-		dprintk("stop_queue - last entry(%p)\n", dev);
-		netif_stop_queue(&dev->net_dev);
+		dprintk("stop_queue - last entry(%p)\n", ndev);
+		netif_stop_queue(ndev);
 		stopped = 1;
 	}
 
@@ -1136,10 +1153,10 @@
 
 	/* Check again: we may have raced with a tx done irq */
 	if (stopped && (dev->tx_done_idx != tx_done_idx) && start_tx_okay(dev))
-		netif_start_queue(&dev->net_dev);
+		netif_start_queue(ndev);
 
 	/* set the transmit start time to catch transmit timeouts */
-	dev->net_dev.trans_start = jiffies;
+	ndev->trans_start = jiffies;
 	return 0;
 }
 
@@ -1161,9 +1178,9 @@
 	dev->stats.tx_carrier_errors	+= readl(base + 0x88) & 0xff;
 }
 
-static struct net_device_stats *ns83820_get_stats(struct net_device *_dev)
+static struct net_device_stats *ns83820_get_stats(struct net_device *ndev)
 {
-	struct ns83820 *dev = (void *)_dev;
+	struct ns83820 *dev = PRIV(ndev);
 
 	/* somewhat overkill */
 	spin_lock_irq(&dev->misc_lock);
@@ -1213,9 +1230,9 @@
 	return -EOPNOTSUPP;
 }
 
-static int ns83820_ioctl(struct net_device *_dev, struct ifreq *rq, int cmd)
+static int ns83820_ioctl(struct net_device *ndev, struct ifreq *rq, int cmd)
 {
-	struct ns83820 *dev = (struct ns83820 *)_dev;
+	struct ns83820 *dev = PRIV(ndev);
 
 	switch(cmd) {
 	case SIOCETHTOOL:
@@ -1233,23 +1250,25 @@
 	spin_unlock(&dev->misc_lock);
 }
 
-static void ns83820_do_isr(struct ns83820 *dev, u32 isr);
+static void ns83820_do_isr(struct net_device *ndev, u32 isr);
 static irqreturn_t ns83820_irq(int foo, void *data, struct pt_regs *regs)
 {
-	struct ns83820 *dev = data;
+	struct net_device *ndev = data;
+	struct ns83820 *dev = PRIV(ndev);
 	u32 isr;
-	dprintk("ns83820_irq(%p)\n", dev);
+	dprintk("ns83820_irq(%p)\n", ndev);
 
 	dev->ihr = 0;
 
 	isr = readl(dev->base + ISR);
 	dprintk("irq: %08x\n", isr);
-	ns83820_do_isr(dev, isr);
+	ns83820_do_isr(ndev, isr);
 	return IRQ_HANDLED;
 }
 
-static void ns83820_do_isr(struct ns83820 *dev, u32 isr)
+static void ns83820_do_isr(struct net_device *ndev, u32 isr)
 {
+	struct ns83820 *dev = PRIV(ndev);
 #ifdef DEBUG
 	if (isr & ~(ISR_PHY | ISR_RXDESC | ISR_RXEARLY | ISR_RXOK | ISR_RXERR | ISR_TXIDLE | ISR_TXOK | ISR_TXDESC))
 		Dprintk("odd isr? 0x%08x\n", isr);
@@ -1258,7 +1277,7 @@
 	if (ISR_RXIDLE & isr) {
 		dev->rx_info.idle = 1;
 		Dprintk("oh dear, we are idle\n");
-		ns83820_rx_kick(dev);
+		ns83820_rx_kick(ndev);
 	}
 
 	if ((ISR_RXDESC | ISR_RXOK) & isr) {
@@ -1270,12 +1289,12 @@
 		spin_unlock_irq(&dev->misc_lock);
 
 		tasklet_schedule(&dev->rx_tasklet);
-		//rx_irq(dev);
+		//rx_irq(ndev);
 		//writel(4, dev->base + IHR);
 	}
 
 	if ((ISR_RXIDLE | ISR_RXORN | ISR_RXDESC | ISR_RXOK | ISR_RXERR) & isr)
-		ns83820_rx_kick(dev);
+		ns83820_rx_kick(ndev);
 
 	if (unlikely(ISR_RXSOVR & isr)) {
 		//printk("overrun: rxsovr\n");
@@ -1297,7 +1316,7 @@
 		txdp -= dev->tx_phy_descs;
 		dev->tx_idx = txdp / (DESC_SIZE * 4);
 		if (dev->tx_idx >= NR_TX_DESC) {
-			printk(KERN_ALERT "%s: BUG -- txdp out of range\n", dev->net_dev.name);
+			printk(KERN_ALERT "%s: BUG -- txdp out of range\n", ndev->name);
 			dev->tx_idx = 0;
 		}
 		/* The may have been a race between a pci originated read
@@ -1313,7 +1332,7 @@
 	 * work has accumulated
 	 */
 	if ((ISR_TXDESC | ISR_TXIDLE | ISR_TXOK | ISR_TXERR) & isr) {
-		do_tx_done(dev);
+		do_tx_done(ndev);
 
 		/* Disable TxOk if there are no outstanding tx packets.
 		 */
@@ -1345,7 +1364,7 @@
 
 	/* PHY: Link up/down/negotiation state change */
 	if (unlikely(ISR_PHY & isr))
-		phy_intr(dev);
+		phy_intr(ndev);
 
 #if 0	/* Still working on the interrupt mitigation strategy */
 	if (dev->ihr)
@@ -1363,9 +1382,9 @@
 	Dprintk("okay!\n");
 }
 
-static int ns83820_stop(struct net_device *_dev)
+static int ns83820_stop(struct net_device *ndev)
 {
-	struct ns83820 *dev = (struct ns83820 *)_dev;
+	struct ns83820 *dev = PRIV(ndev);
 
 	/* FIXME: protect against interrupt handler? */
 	del_timer_sync(&dev->tx_watchdog);
@@ -1392,10 +1411,9 @@
 	return 0;
 }
 
-static void ns83820_do_isr(struct ns83820 *dev, u32 isr);
-static void ns83820_tx_timeout(struct net_device *_dev)
+static void ns83820_tx_timeout(struct net_device *ndev)
 {
-	struct ns83820 *dev = (struct ns83820 *)_dev;
+	struct ns83820 *dev = PRIV(ndev);
         u32 tx_done_idx, *desc;
 	unsigned long flags;
 
@@ -1405,7 +1423,7 @@
 	desc = dev->tx_descs + (tx_done_idx * DESC_SIZE);
 
 	printk(KERN_INFO "%s: tx_timeout: tx_done_idx=%d free_idx=%d cmdsts=%08x\n",
-		dev->net_dev.name,
+		ndev->name,
 		tx_done_idx, dev->tx_free_idx, le32_to_cpu(desc[DESC_CMDSTS]));
 
 #if defined(DEBUG)
@@ -1413,17 +1431,17 @@
 		u32 isr;
 		isr = readl(dev->base + ISR);
 		printk("irq: %08x imr: %08x\n", isr, dev->IMR_cache);
-		ns83820_do_isr(dev, isr);
+		ns83820_do_isr(ndev, isr);
 	}
 #endif
 
-	do_tx_done(dev);
+	do_tx_done(ndev);
 
 	tx_done_idx = dev->tx_done_idx;
 	desc = dev->tx_descs + (tx_done_idx * DESC_SIZE);
 
 	printk(KERN_INFO "%s: after: tx_done_idx=%d free_idx=%d cmdsts=%08x\n",
-		dev->net_dev.name,
+		ndev->name,
 		tx_done_idx, dev->tx_free_idx, le32_to_cpu(desc[DESC_CMDSTS]));
 
 	local_irq_restore(flags);
@@ -1431,7 +1449,8 @@
 
 static void ns83820_tx_watch(unsigned long data)
 {
-	struct ns83820 *dev = (void *)data;
+	struct net_device *ndev = (void *)data;
+	struct ns83820 *dev = PRIV(ndev);
 
 #if defined(DEBUG)
 	printk("ns83820_tx_watch: %u %u %d\n",
@@ -1439,21 +1458,21 @@
 		);
 #endif
 
-	if (time_after(jiffies, dev->net_dev.trans_start + 1*HZ) &&
+	if (time_after(jiffies, ndev->trans_start + 1*HZ) &&
 	    dev->tx_done_idx != dev->tx_free_idx) {
 		printk(KERN_DEBUG "%s: ns83820_tx_watch: %u %u %d\n",
-			dev->net_dev.name,
+			ndev->name,
 			dev->tx_done_idx, dev->tx_free_idx,
 			atomic_read(&dev->nr_tx_skbs));
-		ns83820_tx_timeout(&dev->net_dev);
+		ns83820_tx_timeout(ndev);
 	}
 
 	mod_timer(&dev->tx_watchdog, jiffies + 2*HZ);
 }
 
-static int ns83820_open(struct net_device *_dev)
+static int ns83820_open(struct net_device *ndev)
 {
-	struct ns83820 *dev = (struct ns83820 *)_dev;
+	struct ns83820 *dev = PRIV(ndev);
 	unsigned i;
 	u32 desc;
 	int ret;
@@ -1462,7 +1481,7 @@
 
 	writel(0, dev->base + PQCR);
 
-	ret = ns83820_setup_rx(dev);
+	ret = ns83820_setup_rx(ndev);
 	if (ret)
 		goto failed;
 
@@ -1481,16 +1500,16 @@
 	writel(desc, dev->base + TXDP);
 
 	init_timer(&dev->tx_watchdog);
-	dev->tx_watchdog.data = (unsigned long)dev;
+	dev->tx_watchdog.data = (unsigned long)ndev;
 	dev->tx_watchdog.function = ns83820_tx_watch;
 	mod_timer(&dev->tx_watchdog, jiffies + 2*HZ);
 
-	netif_start_queue(&dev->net_dev);	/* FIXME: wait for phy to come up */
+	netif_start_queue(ndev);	/* FIXME: wait for phy to come up */
 
 	return 0;
 
 failed:
-	ns83820_stop(_dev);
+	ns83820_stop(ndev);
 	return ret;
 }
 
@@ -1513,28 +1532,28 @@
 	}
 }
 
-static int ns83820_change_mtu(struct net_device *_dev, int new_mtu)
+static int ns83820_change_mtu(struct net_device *ndev, int new_mtu)
 {
 	if (new_mtu > RX_BUF_SIZE)
 		return -EINVAL;
-	_dev->mtu = new_mtu;
+	ndev->mtu = new_mtu;
 	return 0;
 }
 
-static void ns83820_set_multicast(struct net_device *_dev)
+static void ns83820_set_multicast(struct net_device *ndev)
 {
-	struct ns83820 *dev = (void *)_dev;
+	struct ns83820 *dev = PRIV(ndev);
 	u8 *rfcr = dev->base + RFCR;
 	u32 and_mask = 0xffffffff;
 	u32 or_mask = 0;
 	u32 val;
 
-	if (dev->net_dev.flags & IFF_PROMISC)
+	if (ndev->flags & IFF_PROMISC)
 		or_mask |= RFCR_AAU | RFCR_AAM;
 	else
 		and_mask &= ~(RFCR_AAU | RFCR_AAM);
 
-	if (dev->net_dev.flags & IFF_ALLMULTI)
+	if (ndev->flags & IFF_ALLMULTI)
 		or_mask |= RFCR_AAM;
 	else
 		and_mask &= ~RFCR_AAM;
@@ -1547,14 +1566,15 @@
 	spin_unlock_irq(&dev->misc_lock);
 }
 
-static void ns83820_run_bist(struct ns83820 *dev, const char *name, u32 enable, u32 done, u32 fail)
+static void ns83820_run_bist(struct net_device *ndev, const char *name, u32 enable, u32 done, u32 fail)
 {
+	struct ns83820 *dev = PRIV(ndev);
 	int timed_out = 0;
 	long start;
 	u32 status;
 	int loops = 0;
 
-	dprintk("%s: start %s\n", dev->net_dev.name, name);
+	dprintk("%s: start %s\n", ndev->name, name);
 
 	start = jiffies;
 
@@ -1578,12 +1598,12 @@
 
 	if (status & fail)
 		printk(KERN_INFO "%s: %s failed! (0x%08x & 0x%08x)\n",
-			dev->net_dev.name, name, status, fail);
+			ndev->name, name, status, fail);
 	else if (timed_out)
 		printk(KERN_INFO "%s: run_bist %s timed out! (%08x)\n",
-			dev->net_dev.name, name, status);
+			ndev->name, name, status);
 
-	dprintk("%s: done %s in %d loops\n", dev->net_dev.name, name, loops);
+	dprintk("%s: done %s in %d loops\n", ndev->name, name, loops);
 }
 
 #ifdef PHY_CODE_IS_FINISHED
@@ -1706,8 +1726,9 @@
 	return data;
 }
 
-static void ns83820_probe_phy(struct ns83820 *dev)
+static void ns83820_probe_phy(struct net_device *ndev)
 {
+	struct ns83820 *dev = PRIV(ndev);
 	static int first;
 	int i;
 #define MII_PHYIDR1	0x02
@@ -1734,11 +1755,11 @@
 		b = ns83820_mii_read_reg(dev, i, MII_PHYIDR2);
 
 		//printk("%s: phy %d: 0x%04x 0x%04x\n",
-		//	dev->net_dev.name, i, a, b);
+		//	ndev->name, i, a, b);
 
 		for (j=0; j<0x16; j+=4) {
 			dprintk("%s: [0x%02x] %04x %04x %04x %04x\n",
-				dev->net_dev.name, j,
+				ndev->name, j,
 				ns83820_mii_read_reg(dev, i, 0 + j),
 				ns83820_mii_read_reg(dev, i, 1 + j),
 				ns83820_mii_read_reg(dev, i, 2 + j),
@@ -1763,6 +1784,7 @@
 
 static int __devinit ns83820_init_one(struct pci_dev *pci_dev, const struct pci_device_id *id)
 {
+	struct net_device *ndev;
 	struct ns83820 *dev;
 	long addr;
 	int err;
@@ -1778,7 +1800,8 @@
 		return -ENODEV;
 	}
 
-	dev = (struct ns83820 *)alloc_etherdev((sizeof *dev) - (sizeof dev->net_dev));
+	ndev = alloc_etherdev(sizeof(struct ns83820));
+	dev = PRIV(ndev);
 	err = -ENOMEM;
 	if (!dev)
 		goto out;
@@ -1790,12 +1813,11 @@
 
 	dev->ee.cache = &dev->MEAR_cache;
 	dev->ee.lock = &dev->misc_lock;
-	SET_MODULE_OWNER(dev->net_dev);
-	SET_NETDEV_DEV(&dev->net_dev, &pci_dev->dev);
-	dev->net_dev.priv = dev;
+	SET_MODULE_OWNER(ndev);
+	SET_NETDEV_DEV(ndev, &pci_dev->dev);
 
-	INIT_WORK(&dev->tq_refill, queue_refill, dev);
-	tasklet_init(&dev->rx_tasklet, rx_action, (unsigned long)dev);
+	INIT_WORK(&dev->tq_refill, queue_refill, ndev);
+	tasklet_init(&dev->rx_tasklet, rx_action, (unsigned long)ndev);
 
 	err = pci_enable_device(pci_dev);
 	if (err) {
@@ -1829,55 +1851,63 @@
 		0);
 
 	err = request_irq(pci_dev->irq, ns83820_irq, SA_SHIRQ,
-			  dev->net_dev.name, dev);
+			  ndev->name, ndev);
 	if (err) {
 		printk(KERN_INFO "ns83820: unable to register irq %d\n",
 			pci_dev->irq);
 		goto out_disable;
 	}
 
-	err = register_netdev(&dev->net_dev);
-	if (err) {
-		printk(KERN_INFO "ns83820: unable to register netdev: %d\n", err);
+	/*
+	 * FIXME: we are holding rtnl_lock() over obscenely long area only
+	 * because some of the setup code uses dev->name.  It's Wrong(tm) -
+	 * we should be using driver-specific names for all that stuff.
+	 * For now that will do, but we really need to come back and kill
+	 * most of the dev_alloc_name() users later.
+	 */
+	rtnl_lock();
+	err = dev_alloc_name(ndev, ndev->name);
+	if (err < 0) {
+		printk(KERN_INFO "ns83820: unable to get netdev name: %d\n", err);
 		goto out_free_irq;
 	}
 
 	printk("%s: ns83820.c: 0x22c: %08x, subsystem: %04x:%04x\n",
-		dev->net_dev.name, le32_to_cpu(readl(dev->base + 0x22c)),
+		ndev->name, le32_to_cpu(readl(dev->base + 0x22c)),
 		pci_dev->subsystem_vendor, pci_dev->subsystem_device);
 
-	dev->net_dev.open = ns83820_open;
-	dev->net_dev.stop = ns83820_stop;
-	dev->net_dev.hard_start_xmit = ns83820_hard_start_xmit;
-	dev->net_dev.get_stats = ns83820_get_stats;
-	dev->net_dev.change_mtu = ns83820_change_mtu;
-	dev->net_dev.set_multicast_list = ns83820_set_multicast;
-	dev->net_dev.do_ioctl = ns83820_ioctl;
-	dev->net_dev.tx_timeout = ns83820_tx_timeout;
-	dev->net_dev.watchdog_timeo = 5 * HZ;
+	ndev->open = ns83820_open;
+	ndev->stop = ns83820_stop;
+	ndev->hard_start_xmit = ns83820_hard_start_xmit;
+	ndev->get_stats = ns83820_get_stats;
+	ndev->change_mtu = ns83820_change_mtu;
+	ndev->set_multicast_list = ns83820_set_multicast;
+	ndev->do_ioctl = ns83820_ioctl;
+	ndev->tx_timeout = ns83820_tx_timeout;
+	ndev->watchdog_timeo = 5 * HZ;
 
-	pci_set_drvdata(pci_dev, dev);
+	pci_set_drvdata(pci_dev, ndev);
 
 	ns83820_do_reset(dev, CR_RST);
 
 	/* Must reset the ram bist before running it */
 	writel(PTSCR_RBIST_RST, dev->base + PTSCR);
-	ns83820_run_bist(dev, "sram bist",   PTSCR_RBIST_EN,
+	ns83820_run_bist(ndev, "sram bist",   PTSCR_RBIST_EN,
 			 PTSCR_RBIST_DONE, PTSCR_RBIST_FAIL);
-	ns83820_run_bist(dev, "eeprom bist", PTSCR_EEBIST_EN, 0,
+	ns83820_run_bist(ndev, "eeprom bist", PTSCR_EEBIST_EN, 0,
 			 PTSCR_EEBIST_FAIL);
-	ns83820_run_bist(dev, "eeprom load", PTSCR_EELOAD_EN, 0, 0);
+	ns83820_run_bist(ndev, "eeprom load", PTSCR_EELOAD_EN, 0, 0);
 
 	/* I love config registers */
 	dev->CFG_cache = readl(dev->base + CFG);
 
 	if ((dev->CFG_cache & CFG_PCI64_DET)) {
 		printk(KERN_INFO "%s: detected 64 bit PCI data bus.\n",
-			dev->net_dev.name);
+			ndev->name);
 		/*dev->CFG_cache |= CFG_DATA64_EN;*/
 		if (!(dev->CFG_cache & CFG_DATA64_EN))
 			printk(KERN_INFO "%s: EEPROM did not enable 64 bit bus.  Disabled.\n",
-				dev->net_dev.name);
+				ndev->name);
 	} else
 		dev->CFG_cache &= ~(CFG_DATA64_EN);
 
@@ -1905,7 +1935,7 @@
 	/* setup optical transceiver if we have one */
 	if (dev->CFG_cache & CFG_TBI_EN) {
 		printk(KERN_INFO "%s: enabling optical transceiver\n",
-			dev->net_dev.name);
+			ndev->name);
 		writel(readl(dev->base + GPIOR) | 0x3e8, dev->base + GPIOR);
 
 		/* setup auto negotiation feature advertisement */
@@ -1926,7 +1956,7 @@
 	dprintk("CFG: %08x\n", dev->CFG_cache);
 
 	if (reset_phy) {
-		printk(KERN_INFO "%s: resetting phy\n", dev->net_dev.name);
+		printk(KERN_INFO "%s: resetting phy\n", ndev->name);
 		writel(dev->CFG_cache | CFG_PHY_RST, dev->base + CFG);
 		set_current_state(TASK_UNINTERRUPTIBLE);
 		schedule_timeout((HZ+99)/100);
@@ -1996,37 +2026,49 @@
 	/* Disable Wake On Lan */
 	writel(0, dev->base + WCSR);
 
-	ns83820_getmac(dev, dev->net_dev.dev_addr);
+	ns83820_getmac(dev, ndev->dev_addr);
 
 	/* Yes, we support dumb IP checksum on transmit */
-	dev->net_dev.features |= NETIF_F_SG;
-	dev->net_dev.features |= NETIF_F_IP_CSUM;
+	ndev->features |= NETIF_F_SG;
+	ndev->features |= NETIF_F_IP_CSUM;
 
 	if (using_dac) {
 		printk(KERN_INFO "%s: using 64 bit addressing.\n",
-			dev->net_dev.name);
-		dev->net_dev.features |= NETIF_F_HIGHDMA;
+			ndev->name);
+		ndev->features |= NETIF_F_HIGHDMA;
 	}
 
 	printk(KERN_INFO "%s: ns83820 v" VERSION ": DP83820 v%u.%u: %02x:%02x:%02x:%02x:%02x:%02x io=0x%08lx irq=%d f=%s\n",
-		dev->net_dev.name,
+		ndev->name,
 		(unsigned)readl(dev->base + SRR) >> 8,
 		(unsigned)readl(dev->base + SRR) & 0xff,
-		dev->net_dev.dev_addr[0], dev->net_dev.dev_addr[1],
-		dev->net_dev.dev_addr[2], dev->net_dev.dev_addr[3],
-		dev->net_dev.dev_addr[4], dev->net_dev.dev_addr[5],
+		ndev->dev_addr[0], ndev->dev_addr[1],
+		ndev->dev_addr[2], ndev->dev_addr[3],
+		ndev->dev_addr[4], ndev->dev_addr[5],
 		addr, pci_dev->irq,
-		(dev->net_dev.features & NETIF_F_HIGHDMA) ? "h,sg" : "sg"
+		(ndev->features & NETIF_F_HIGHDMA) ? "h,sg" : "sg"
 		);
 
 #ifdef PHY_CODE_IS_FINISHED
-	ns83820_probe_phy(dev);
+	ns83820_probe_phy(ndev);
 #endif
 
+	err = register_netdevice(ndev);
+	if (err) {
+		printk(KERN_INFO "ns83820: unable to register netdev: %d\n", err);
+		goto out_cleanup;
+	}
+	rtnl_unlock();
+
 	return 0;
 
+out_cleanup:
+	writel(0, dev->base + IMR);	/* paranoia */
+	writel(0, dev->base + IER);
+	readl(dev->base + IER);
 out_free_irq:
-	free_irq(pci_dev->irq, dev);
+	rtnl_unlock();
+	free_irq(pci_dev->irq, ndev);
 out_disable:
 	if (dev->base)
 		iounmap(dev->base);
@@ -2034,7 +2076,7 @@
 	pci_free_consistent(pci_dev, 4 * DESC_SIZE * NR_RX_DESC, dev->rx_info.descs, dev->rx_info.phy_descs);
 	pci_disable_device(pci_dev);
 out_free:
-	kfree(dev);
+	free_netdev(ndev);
 	pci_set_drvdata(pci_dev, NULL);
 out:
 	return err;
@@ -2042,24 +2084,25 @@
 
 static void __devexit ns83820_remove_one(struct pci_dev *pci_dev)
 {
-	struct ns83820	*dev = pci_get_drvdata(pci_dev);
+	struct net_device *ndev = pci_get_drvdata(pci_dev);
+	struct ns83820 *dev = PRIV(ndev); /* ok even if NULL */
 
-	if (!dev)			/* paranoia */
+	if (!ndev)			/* paranoia */
 		return;
 
 	writel(0, dev->base + IMR);	/* paranoia */
 	writel(0, dev->base + IER);
 	readl(dev->base + IER);
 
-	unregister_netdev(&dev->net_dev);
-	free_irq(dev->pci_dev->irq, dev);
+	unregister_netdev(ndev);
+	free_irq(dev->pci_dev->irq, ndev);
 	iounmap(dev->base);
 	pci_free_consistent(dev->pci_dev, 4 * DESC_SIZE * NR_TX_DESC,
 			dev->tx_descs, dev->tx_phy_descs);
 	pci_free_consistent(dev->pci_dev, 4 * DESC_SIZE * NR_RX_DESC,
 			dev->rx_info.descs, dev->rx_info.phy_descs);
 	pci_disable_device(dev->pci_dev);
-	free_netdev(&dev->net_dev);
+	free_netdev(ndev);
 	pci_set_drvdata(pci_dev, NULL);
 }
 
--- diff/drivers/net/oaknet.c	2003-08-26 10:00:53.000000000 +0100
+++ source/drivers/net/oaknet.c	2004-02-09 10:39:53.000000000 +0000
@@ -94,8 +94,8 @@
 {
 	register int i;
 	int reg0, regd;
-	int ret;
-	struct net_device tmp, *dev = NULL;
+	int ret = -ENOMEM;
+	struct net_device *dev;
 #if 0
 	unsigned long ioaddr = OAKNET_IO_BASE; 
 #else
@@ -105,17 +105,14 @@
 
 	if (!ioaddr)
 		return -ENOMEM;
-	/*
-	 * This MUST happen here because of the nic_* macros
-	 * which have an implicit dependency on dev->base_addr.
-	 */
 
-	tmp.base_addr = ioaddr;
-	dev = &tmp;
+	dev = alloc_ei_netdev();
+	if (!dev)
+		goto out_unmap;
 
 	ret = -EBUSY;
 	if (!request_region(OAKNET_IO_BASE, OAKNET_IO_SIZE, name))
-		goto out_unmap;
+		goto out_dev;
 
 	/* Quick register check to see if the device is really there. */
 
@@ -144,17 +141,7 @@
 		goto out_region;
 	}
 
-	/*
-	 * We're not using the old-style probing API, so we have to allocate
-	 * our own device structure.
-	 */
-
-	dev = init_etherdev(NULL, 0);
-	ret = -ENOMEM;
-	if (!dev)
-		goto out_region;
 	SET_MODULE_OWNER(dev);
-	oaknet_devs = dev;
 
 	/*
 	 * This controller is on an embedded board, so the base address
@@ -164,14 +151,6 @@
 	dev->base_addr = ioaddr;
 	dev->irq = OAKNET_INT;
 
-	/* Allocate 8390-specific device-private area and fields. */
-
-	ret = -ENOMEM;
-	if (ethdev_init(dev)) {
-		printk(" unable to get memory for dev->priv.\n");
-		goto out_dev;
-	}
-
 	/*
 	 * Disable all chip interrupts for now and ACK all pending
 	 * interrupts.
@@ -186,7 +165,7 @@
 	if (request_irq(dev->irq, ei_interrupt, 0, name, dev)) {
 		printk("%s: unable to request interrupt %d.\n",
 		       dev->name, dev->irq);
-		goto out_priv;
+		goto out_region;
 	}
 
 	/* Tell the world about what and where we've found. */
@@ -213,17 +192,24 @@
 
 	dev->open = oaknet_open;
 	dev->stop = oaknet_close;
+#ifdef CONFIG_NET_POLL_CONTROLLER
+	dev->poll_controller = ei_poll;
+#endif
 
 	NS8390_init(dev, FALSE);
+	ret = register_netdev(dev);
+	if (ret)
+		goto out_irq;
+	
+	oaknet_devs = dev;
+	return 0;
 
-	return (0);
-out_priv:
-	kfree(dev->priv);
-out_dev:
-	unregister_netdev(dev);
-	kfree(dev);
+out_irq;
+	free_irq(dev->irq, dev);
 out_region:
 	release_region(OAKNET_IO_BASE, OAKNET_IO_SIZE);
+out_dev:
+	free_netdev(dev);
 out_unmap:
 	iounmap(ioaddr);
 	return ret;
@@ -662,38 +648,18 @@
 }
 
 /*
- * Oak Ethernet module load interface.
- */
-static int __init oaknet_init_module (void)
-{
-	if (oaknet_devs != NULL)
-		return (-EBUSY);
-
-	return (oaknet_init());
-}
-
-/*
  * Oak Ethernet module unload interface.
  */
 static void __exit oaknet_cleanup_module (void)
 {
-	if (oaknet_devs == NULL)
-		return;
-
-	if (oaknet_devs->priv != NULL) {
-		int ioaddr = oaknet_devs->base_addr;
-		void *priv = oaknet_devs->priv;
-		free_irq(oaknet_devs->irq, oaknet_devs);
-		release_region(ioaddr, OAKNET_IO_SIZE);
-		iounmap(ioaddr);
-		unregister_netdev(oaknet_dev);
-		free_netdev(priv);
-	}
-
 	/* Convert to loop once driver supports multiple devices. */
-	kfree(oaknet_devs);
+	unregister_netdev(oaknet_dev);
+	free_irq(oaknet_devs->irq, oaknet_devs);
+	release_region(oaknet_devs->base_addr, OAKNET_IO_SIZE);
+	iounmap(ioaddr);
+	free_netdev(oaknet_devs);
 }
 
-module_init(oaknet_init_module);
+module_init(oaknet_init);
 module_exit(oaknet_cleanup_module);
 MODULE_LICENSE("GPL");
--- diff/drivers/net/pci-skeleton.c	2003-12-19 09:51:11.000000000 +0000
+++ source/drivers/net/pci-skeleton.c	2004-02-09 10:39:53.000000000 +0000
@@ -730,7 +730,7 @@
 #endif
 	pci_release_regions (pdev);
 err_out:
-	kfree (dev);
+	free_netdev (dev);
 	DPRINTK ("EXIT, returning %d\n", rc);
 	return rc;
 }
--- diff/drivers/net/pcmcia/3c574_cs.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/net/pcmcia/3c574_cs.c	2004-02-09 10:39:53.000000000 +0000
@@ -362,23 +362,17 @@
 	if (*linkp == NULL)
 	return;
 
-	if (link->state & DEV_CONFIG) {
+	if (link->state & DEV_CONFIG)
 		tc574_release(link);
-		if (link->state & DEV_STALE_CONFIG)
-			return;
-	}
 
 	if (link->handle)
 		pcmcia_deregister_client(link->handle);
 
 	/* Unlink device structure, free bits */
 	*linkp = link->next;
-	if (link->dev) {
+	if (link->dev)
 		unregister_netdev(dev);
-		free_netdev(dev);
-	} else 
-		kfree(dev);
-
+	free_netdev(dev);
 } /* tc574_detach */
 
 /*
@@ -557,21 +551,11 @@
 {
 	DEBUG(0, "3c574_release(0x%p)\n", link);
 
-	if (link->open) {
-		DEBUG(1, "3c574_cs: release postponed, '%s' still open\n",
-			  link->dev->dev_name);
-		link->state |= DEV_STALE_CONFIG;
-		return;
-	}
-
 	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)
-		tc574_detach(link);
 }
 
 /*
@@ -1300,8 +1284,7 @@
 	link->open--;
 	netif_stop_queue(dev);
 	del_timer_sync(&lp->media);
-	if (link->state & DEV_STALE_CONFIG)
-		tc574_release(link);
+
 	return 0;
 }
 
--- diff/drivers/net/pcmcia/3c589_cs.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/net/pcmcia/3c589_cs.c	2004-02-09 10:39:53.000000000 +0000
@@ -276,23 +276,17 @@
     if (*linkp == NULL)
 	return;
 
-    if (link->state & DEV_CONFIG) {
+    if (link->state & DEV_CONFIG)
 	tc589_release(link);
-	if (link->state & DEV_STALE_CONFIG)
-	    return;
-    }
     
     if (link->handle)
 	pcmcia_deregister_client(link->handle);
     
     /* Unlink device structure, free bits */
     *linkp = link->next;
-    if (link->dev) {
+    if (link->dev)
 	unregister_netdev(dev);
-	free_netdev(dev);
-    } else
-        kfree(dev);
-    
+    free_netdev(dev);
 } /* tc589_detach */
 
 /*======================================================================
@@ -433,21 +427,11 @@
 {
     DEBUG(0, "3c589_release(0x%p)\n", link);
     
-    if (link->open) {
-	DEBUG(1, "3c589_cs: release postponed, '%s' still open\n",
-	      link->dev->dev_name);
-	link->state |= DEV_STALE_CONFIG;
-	return;
-    }
-    
     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)
-	    tc589_detach(link);
 }
 
 /*======================================================================
@@ -1076,8 +1060,6 @@
     link->open--;
     netif_stop_queue(dev);
     del_timer_sync(&lp->media);
-    if (link->state & DEV_STALE_CONFIG)
-	     tc589_release(link);
     
     return 0;
 }
--- diff/drivers/net/pcmcia/axnet_cs.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/net/pcmcia/axnet_cs.c	2004-02-09 10:39:53.000000000 +0000
@@ -119,7 +119,7 @@
 static dev_info_t dev_info = "axnet_cs";
 static dev_link_t *dev_list;
 
-static int axdev_init(struct net_device *dev);
+static void axdev_setup(struct net_device *dev);
 static void AX88190_init(struct net_device *dev, int startp);
 static int ax_open(struct net_device *dev);
 static int ax_close(struct net_device *dev);
@@ -128,7 +128,6 @@
 /*====================================================================*/
 
 typedef struct axnet_dev_t {
-    struct net_device	dev;	/* so &dev == &axnet_dev_t */
     dev_link_t		link;
     dev_node_t		node;
     caddr_t		base;
@@ -140,16 +139,10 @@
     int			flags;
 } axnet_dev_t;
 
-/*======================================================================
-
-    We never need to do anything when a axnet device is "initialized"
-    by the net software, because we only register already-found cards.
-
-======================================================================*/
-
-static int axnet_init(struct net_device *dev)
+static inline axnet_dev_t *PRIV(struct net_device *dev)
 {
-    return 0;
+	void *p = (char *)netdev_priv(dev) + sizeof(struct ei_device);
+	return p;
 }
 
 /*======================================================================
@@ -170,12 +163,15 @@
 
     DEBUG(0, "axnet_attach()\n");
 
-    /* Create new ethernet device */
-    info = kmalloc(sizeof(*info), GFP_KERNEL);
-    if (!info) return NULL;
-    memset(info, 0, sizeof(*info));
-    link = &info->link; dev = &info->dev;
-    link->priv = info;
+    dev = alloc_netdev(sizeof(struct ei_device) + sizeof(axnet_dev_t),
+			"eth%d", axdev_setup);
+
+    if (!dev)
+	return NULL;
+
+    info = PRIV(dev);
+    link = &info->link;
+    link->priv = dev;
     link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
     link->irq.IRQInfo1 = IRQ_INFO2_VALID|IRQ_LEVEL_ID;
     if (irq_list[0] == -1)
@@ -186,8 +182,6 @@
     link->conf.Attributes = CONF_ENABLE_IRQ;
     link->conf.IntType = INT_MEMORY_AND_IO;
 
-    axdev_init(dev);
-    dev->init = &axnet_init;
     dev->open = &axnet_open;
     dev->stop = &axnet_close;
     dev->do_ioctl = &axnet_ioctl;
@@ -226,7 +220,7 @@
 
 static void axnet_detach(dev_link_t *link)
 {
-    axnet_dev_t *info = link->priv;
+    struct net_device *dev = link->priv;
     dev_link_t **linkp;
 
     DEBUG(0, "axnet_detach(0x%p)\n", link);
@@ -237,23 +231,17 @@
     if (*linkp == NULL)
 	return;
 
-    if (link->state & DEV_CONFIG) {
+    if (link->state & DEV_CONFIG)
 	axnet_release(link);
-	if (link->state & DEV_STALE_CONFIG)
-	    return;
-    }
 
     if (link->handle)
 	pcmcia_deregister_client(link->handle);
 
     /* Unlink device structure, free bits */
     *linkp = link->next;
-    if (link->dev) {
-	unregister_netdev(&info->dev);
-	free_netdev(&info->dev);
-    } else
-	kfree(info);
-
+    if (link->dev)
+	unregister_netdev(dev);
+    free_netdev(dev);
 } /* axnet_detach */
 
 /*======================================================================
@@ -349,8 +337,8 @@
 static void axnet_config(dev_link_t *link)
 {
     client_handle_t handle = link->handle;
-    axnet_dev_t *info = link->priv;
-    struct net_device *dev = &info->dev;
+    struct net_device *dev = link->priv;
+    axnet_dev_t *info = PRIV(dev);
     tuple_t tuple;
     cisparse_t parse;
     int i, j, last_ret, last_fn;
@@ -425,15 +413,10 @@
     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) {
-	printk(KERN_NOTICE "axnet_cs: register_netdev() failed\n");
-	goto failed;
-    }
 
     if (!get_prom(link)) {
 	printk(KERN_NOTICE "axnet_cs: this is not an AX88190 card!\n");
 	printk(KERN_NOTICE "axnet_cs: use pcnet_cs instead.\n");
-	unregister_netdev(dev);
 	goto failed;
     }
 
@@ -448,7 +431,6 @@
     ei_status.block_output = &block_output;
 
     strcpy(info->node.dev_name, dev->name);
-    link->dev = &info->node;
 
     if (inb(dev->base_addr + AXNET_TEST) != 0)
 	info->flags |= IS_AX88790;
@@ -487,6 +469,12 @@
 	printk(KERN_NOTICE "  No MII transceivers found!\n");
     }
 
+    if (register_netdev(dev) != 0) {
+	printk(KERN_NOTICE "axnet_cs: register_netdev() failed\n");
+	goto failed;
+    }
+
+    link->dev = &info->node;
     link->state &= ~DEV_CONFIG_PENDING;
     return;
 
@@ -510,21 +498,11 @@
 {
     DEBUG(0, "axnet_release(0x%p)\n", link);
 
-    if (link->open) {
-	DEBUG(1, "axnet_cs: release postponed, '%s' still open\n",
-	      ((axnet_dev_t *)(link->priv))->node.dev_name);
-	link->state |= DEV_STALE_CONFIG;
-	return;
-    }
-
     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)
-	    axnet_detach(link);
 }
 
 /*======================================================================
@@ -540,7 +518,7 @@
 		       event_callback_args_t *args)
 {
     dev_link_t *link = args->client_data;
-    axnet_dev_t *info = link->priv;
+    struct net_device *dev = link->priv;
 
     DEBUG(2, "axnet_event(0x%06x)\n", event);
 
@@ -548,7 +526,7 @@
     case CS_EVENT_CARD_REMOVAL:
 	link->state &= ~DEV_PRESENT;
 	if (link->state & DEV_CONFIG) {
-	    netif_device_detach(&info->dev);
+	    netif_device_detach(dev);
 	    axnet_release(link);
 	}
 	break;
@@ -562,7 +540,7 @@
     case CS_EVENT_RESET_PHYSICAL:
 	if (link->state & DEV_CONFIG) {
 	    if (link->open)
-		netif_device_detach(&info->dev);
+		netif_device_detach(dev);
 	    pcmcia_release_configuration(link->handle);
 	}
 	break;
@@ -573,9 +551,9 @@
 	if (link->state & DEV_CONFIG) {
 	    pcmcia_request_configuration(link->handle, &link->conf);
 	    if (link->open) {
-		axnet_reset_8390(&info->dev);
-		AX88190_init(&info->dev, 1);
-		netif_device_attach(&info->dev);
+		axnet_reset_8390(dev);
+		AX88190_init(dev, 1);
+		netif_device_attach(dev);
 	    }
 	}
 	break;
@@ -645,7 +623,7 @@
 
 static int axnet_open(struct net_device *dev)
 {
-    axnet_dev_t *info = (axnet_dev_t *)dev;
+    axnet_dev_t *info = PRIV(dev);
     dev_link_t *link = &info->link;
     
     DEBUG(2, "axnet_open('%s')\n", dev->name);
@@ -660,7 +638,7 @@
     info->link_status = 0x00;
     init_timer(&info->watchdog);
     info->watchdog.function = &ei_watchdog;
-    info->watchdog.data = (u_long)info;
+    info->watchdog.data = (u_long)dev;
     info->watchdog.expires = jiffies + HZ;
     add_timer(&info->watchdog);
 
@@ -671,7 +649,7 @@
 
 static int axnet_close(struct net_device *dev)
 {
-    axnet_dev_t *info = (axnet_dev_t *)dev;
+    axnet_dev_t *info = PRIV(dev);
     dev_link_t *link = &info->link;
 
     DEBUG(2, "axnet_close('%s')\n", dev->name);
@@ -682,8 +660,6 @@
     link->open--;
     netif_stop_queue(dev);
     del_timer_sync(&info->watchdog);
-    if (link->state & DEV_STALE_CONFIG)
-	axnet_release(link);
 
     return 0;
 } /* axnet_close */
@@ -723,15 +699,15 @@
 
 static irqreturn_t ei_irq_wrapper(int irq, void *dev_id, struct pt_regs *regs)
 {
-    axnet_dev_t *info = dev_id;
-    info->stale = 0;
+    struct net_device *dev = dev_id;
+    PRIV(dev)->stale = 0;
     return ax_interrupt(irq, dev_id, regs);
 }
 
 static void ei_watchdog(u_long arg)
 {
-    axnet_dev_t *info = (axnet_dev_t *)(arg);
-    struct net_device *dev = &info->dev;
+    struct net_device *dev = (struct net_device *)(arg);
+    axnet_dev_t *info = PRIV(dev);
     ioaddr_t nic_base = dev->base_addr;
     ioaddr_t mii_addr = nic_base + AXNET_MII_EEP;
     u_short link;
@@ -801,7 +777,7 @@
 
 static int axnet_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 {
-    axnet_dev_t *info = (axnet_dev_t *)dev;
+    axnet_dev_t *info = PRIV(dev);
     u16 *data = (u16 *)&rq->ifr_data;
     ioaddr_t mii_addr = dev->base_addr + AXNET_MII_EEP;
     switch (cmd) {
@@ -1050,14 +1026,7 @@
 static int ax_open(struct net_device *dev)
 {
 	unsigned long flags;
-	struct ei_device *ei_local = (struct ei_device *) dev->priv;
-
-	/* This can't happen unless somebody forgot to call axdev_init(). */
-	if (ei_local == NULL) 
-	{
-		printk(KERN_EMERG "%s: ax_open passed a non-existent device!\n", dev->name);
-		return -ENXIO;
-	}
+	struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev);
 
 #ifdef HAVE_TX_TIMEOUT
 	/* The card I/O part of the driver (e.g. 3c503) can hook a Tx timeout
@@ -1083,7 +1052,7 @@
 	return 0;
 }
 
-#define dev_lock(dev) (((struct ei_device *)(dev)->priv)->page_lock)
+#define dev_lock(dev) (((struct ei_device *)netdev_priv(dev))->page_lock)
 
 /**
  * ax_close - shut down network device
@@ -1117,7 +1086,7 @@
 void ei_tx_timeout(struct net_device *dev)
 {
 	long e8390_base = dev->base_addr;
-	struct ei_device *ei_local = (struct ei_device *) dev->priv;
+	struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev);
 	int txsr, isr, tickssofar = jiffies - dev->trans_start;
 	unsigned long flags;
 
@@ -1163,7 +1132,7 @@
 static int ei_start_xmit(struct sk_buff *skb, struct net_device *dev)
 {
 	long e8390_base = dev->base_addr;
-	struct ei_device *ei_local = (struct ei_device *) dev->priv;
+	struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev);
 	int length, send_length, output_page;
 	unsigned long flags;
 	u8 packet[ETH_ZLEN];
@@ -1309,7 +1278,7 @@
 	}
     
 	e8390_base = dev->base_addr;
-	ei_local = (struct ei_device *) dev->priv;
+	ei_local = (struct ei_device *) netdev_priv(dev);
 
 	/*
 	 *	Protect the irq test too.
@@ -1421,7 +1390,7 @@
 static void ei_tx_err(struct net_device *dev)
 {
 	long e8390_base = dev->base_addr;
-	struct ei_device *ei_local = (struct ei_device *) dev->priv;
+	struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev);
 	unsigned char txsr = inb_p(e8390_base+EN0_TSR);
 	unsigned char tx_was_aborted = txsr & (ENTSR_ABT+ENTSR_FU);
 
@@ -1462,7 +1431,7 @@
 static void ei_tx_intr(struct net_device *dev)
 {
 	long e8390_base = dev->base_addr;
-	struct ei_device *ei_local = (struct ei_device *) dev->priv;
+	struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev);
 	int status = inb(e8390_base + EN0_TSR);
     
 	/*
@@ -1543,7 +1512,7 @@
 static void ei_receive(struct net_device *dev)
 {
 	long e8390_base = dev->base_addr;
-	struct ei_device *ei_local = (struct ei_device *) dev->priv;
+	struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev);
 	unsigned char rxing_page, this_frame, next_frame;
 	unsigned short current_offset;
 	int rx_pkt_count = 0;
@@ -1663,7 +1632,7 @@
 	axnet_dev_t *info = (axnet_dev_t *)dev;
 	long e8390_base = dev->base_addr;
 	unsigned char was_txing, must_resend = 0;
-	struct ei_device *ei_local = (struct ei_device *) dev->priv;
+	struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev);
     
 	/*
 	 * Record whether a Tx was in progress and then issue the
@@ -1730,7 +1699,7 @@
 static struct net_device_stats *get_stats(struct net_device *dev)
 {
 	long ioaddr = dev->base_addr;
-	struct ei_device *ei_local = (struct ei_device *) dev->priv;
+	struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev);
 	unsigned long flags;
     
 	/* If the card is stopped, just return the present stats. */
@@ -1783,39 +1752,30 @@
 }	
 
 /**
- * axdev_init - init rest of 8390 device struct
+ * axdev_setup - init rest of 8390 device struct
  * @dev: network device structure to init
  *
  * Initialize the rest of the 8390 device structure.  Do NOT __init
  * this, as it is used by 8390 based modular drivers too.
  */
 
-static int axdev_init(struct net_device *dev)
+static void axdev_setup(struct net_device *dev)
 {
+	struct ei_device *ei_local;
 	if (ei_debug > 1)
 		printk(version_8390);
     
 	SET_MODULE_OWNER(dev);
 
-	if (dev->priv == NULL) 
-	{
-		struct ei_device *ei_local;
 		
-		dev->priv = kmalloc(sizeof(struct ei_device), GFP_KERNEL);
-		if (dev->priv == NULL)
-			return -ENOMEM;
-		memset(dev->priv, 0, sizeof(struct ei_device));
-		ei_local = (struct ei_device *)dev->priv;
-		spin_lock_init(&ei_local->page_lock);
-	}
+	ei_local = (struct ei_device *)netdev_priv(dev);
+	spin_lock_init(&ei_local->page_lock);
     
 	dev->hard_start_xmit = &ei_start_xmit;
 	dev->get_stats	= get_stats;
 	dev->set_multicast_list = &set_multicast_list;
 
 	ether_setup(dev);
-        
-	return 0;
 }
 
 /* This page of functions should be 8390 generic */
@@ -1831,9 +1791,9 @@
 
 static void AX88190_init(struct net_device *dev, int startp)
 {
-	axnet_dev_t *info = (axnet_dev_t *)dev;
+	axnet_dev_t *info = PRIV(dev);
 	long e8390_base = dev->base_addr;
-	struct ei_device *ei_local = (struct ei_device *) dev->priv;
+	struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev);
 	int i;
 	int endcfg = ei_local->word16 ? (0x48 | ENDCFG_WTS) : 0x48;
     
@@ -1902,7 +1862,7 @@
 								int start_page)
 {
 	long e8390_base = dev->base_addr;
- 	struct ei_device *ei_local __attribute((unused)) = (struct ei_device *) dev->priv;
+ 	struct ei_device *ei_local __attribute((unused)) = (struct ei_device *) netdev_priv(dev);
     
 	if (inb_p(e8390_base) & E8390_TRANS) 
 	{
--- diff/drivers/net/pcmcia/com20020_cs.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/net/pcmcia/com20020_cs.c	2004-02-09 10:39:53.000000000 +0000
@@ -145,20 +145,6 @@
     dev_node_t          node;
 } com20020_dev_t;
 
-static void com20020_setup(struct net_device *dev)
-{
-	struct arcnet_local *lp = dev->priv;
-
-	lp->timeout = timeout;
-	lp->backplane = backplane;
-	lp->clockp = clockp;
-	lp->clockm = clockm & 3;
-	lp->hw.owner = THIS_MODULE;
-
-	/* fill in our module parameters as defaults */
-	dev->dev_addr[0] = node;
-}
-
 /*======================================================================
 
     com20020_attach() creates an "instance" of the driver, allocating
@@ -187,14 +173,21 @@
     if (!info)
 	goto fail_alloc_info;
 
-    dev = alloc_netdev(sizeof(struct arcnet_local), "arc%d",
-		       com20020_setup);
+    dev = alloc_arcdev("");
     if (!dev)
 	goto fail_alloc_dev;
 
     memset(info, 0, sizeof(struct com20020_dev_t));
     memset(link, 0, sizeof(struct dev_link_t));
     lp = dev->priv;
+    lp->timeout = timeout;
+    lp->backplane = backplane;
+    lp->clockp = clockp;
+    lp->clockm = clockm & 3;
+    lp->hw.owner = THIS_MODULE;
+
+    /* fill in our module parameters as defaults */
+    dev->dev_addr[0] = node;
 
     link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
     link->io.NumPorts1 = 16;
@@ -270,11 +263,8 @@
 
     dev = info->dev;
 
-    if (link->state & DEV_CONFIG) {
+    if (link->state & DEV_CONFIG)
         com20020_release(link);
-        if (link->state & DEV_STALE_CONFIG)
-            return;
-    }
 
     if (link->handle)
         pcmcia_deregister_client(link->handle);
@@ -293,6 +283,8 @@
 
 		if (netif_running(dev))
 		    dev->stop(dev);
+
+		unregister_netdev(dev);
 	    
 		/*
 		 * this is necessary because we register our IRQ separately
@@ -300,10 +292,7 @@
 		 */
 		if (dev->irq)
 		    free_irq(dev->irq, dev);
-		
 		/* ...but I/O ports are done automatically by card services */
-		
-		unregister_netdev(dev);
 	    }
 	    
 	    DEBUG(1,"kfree...\n");
@@ -447,21 +436,11 @@
 
     DEBUG(0, "com20020_release(0x%p)\n", link);
 
-    if (link->open) {
-	DEBUG(1,"postpone...\n");
-	DEBUG(1, "com20020_cs: release postponed, device stll open\n");
-        link->state |= DEV_STALE_CONFIG;
-        return;
-    }
-
     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);
-
-    if (link->state & DEV_STALE_CONFIG)
-	    com20020_detach(link);
 }
 
 /*======================================================================
--- diff/drivers/net/pcmcia/fmvj18x_cs.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/net/pcmcia/fmvj18x_cs.c	2004-02-09 10:39:53.000000000 +0000
@@ -332,11 +332,8 @@
     if (*linkp == NULL)
 	return;
 
-    if (link->state & DEV_CONFIG) {
+    if (link->state & DEV_CONFIG)
 	fmvj18x_release(link);
-	if (link->state & DEV_STALE_CONFIG)
-	    return;
-    }
 
     /* Break the link with Card Services */
     if (link->handle)
@@ -344,12 +341,9 @@
     
     /* Unlink device structure, free pieces */
     *linkp = link->next;
-    if (link->dev) {
+    if (link->dev)
 	unregister_netdev(dev);
-	free_netdev(dev);
-    } else
-    	kfree(dev);
-    
+    free_netdev(dev);
 } /* fmvj18x_detach */
 
 /*====================================================================*/
@@ -723,17 +717,6 @@
 
     DEBUG(0, "fmvj18x_release(0x%p)\n", link);
 
-    /*
-       If the device is currently in use, we won't release until it
-       is actually closed.
-    */
-    if (link->open) {
-	DEBUG(1, "fmvj18x_cs: release postponed, '%s' "
-	      "still open\n", link->dev->dev_name);
-	link->state |= DEV_STALE_CONFIG;
-	return;
-    }
-
     /* Don't bother checking to see if these succeed or not */
     pcmcia_release_window(link->win);
     pcmcia_release_configuration(link->handle);
@@ -741,9 +724,6 @@
     pcmcia_release_irq(link->handle, &link->irq);
     
     link->state &= ~DEV_CONFIG;
-
-    if (link->state & DEV_STALE_CONFIG)
-	    fmvj18x_detach(link);
 }
 
 /*====================================================================*/
@@ -1251,8 +1231,6 @@
 	outb(INTR_OFF, ioaddr + LAN_CTRL);
 
     link->open--;
-    if (link->state & DEV_STALE_CONFIG)
-	    fmvj18x_release(link);
 
     return 0;
 } /* fjn_close */
--- diff/drivers/net/pcmcia/ibmtr_cs.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/net/pcmcia/ibmtr_cs.c	2004-02-09 10:39:53.000000000 +0000
@@ -125,8 +125,7 @@
 
 static dev_link_t *dev_list;
 
-extern int ibmtr_probe(struct net_device *dev);
-extern int trdev_init(struct net_device *dev);
+extern int ibmtr_probe_card(struct net_device *dev);
 extern irqreturn_t tok_interrupt (int irq, void *dev_id, struct pt_regs *regs);
 
 /*====================================================================*/
@@ -199,7 +198,6 @@
 
     link->irq.Instance = info->dev = dev;
     
-    dev->init = &ibmtr_probe;
     SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops);
 
     /* Register with Card Services */
@@ -253,22 +251,22 @@
         return;
 
     dev = info->dev;
+
+    if (link->dev)
+	unregister_netdev(dev);
+
     {
 	struct tok_info *ti = (struct tok_info *)dev->priv;
 	del_timer_sync(&(ti->tr_timer));
     }
-    if (link->state & DEV_CONFIG) {
+    if (link->state & DEV_CONFIG)
         ibmtr_release(link);
-        if (link->state & DEV_STALE_CONFIG)
-            return;
-    }
 
     if (link->handle)
         pcmcia_deregister_client(link->handle);
 
     /* Unlink device structure, free bits */
     *linkp = link->next;
-    unregister_netdev(dev);
     free_netdev(dev);
     kfree(info); 
 } /* ibmtr_detach */
@@ -369,7 +367,7 @@
         Adapters Technical Reference"  SC30-3585 for this info.  */
     ibmtr_hw_setup(dev, mmiobase);
 
-    i = register_netdev(dev);
+    i = ibmtr_probe_card(dev);
     
     if (i != 0) {
 	printk(KERN_NOTICE "ibmtr_cs: register_netdev() failed\n");
@@ -410,13 +408,6 @@
 
     DEBUG(0, "ibmtr_release(0x%p)\n", link);
 
-    if (link->open) {
-	DEBUG(1, "ibmtr_cs: release postponed, '%s' "
-	      "still open\n", info->node.dev_name);
-        link->state |= DEV_STALE_CONFIG;
-        return;
-    }
-
     pcmcia_release_configuration(link->handle);
     pcmcia_release_io(link->handle, &link->io);
     pcmcia_release_irq(link->handle, &link->irq);
@@ -428,9 +419,6 @@
     }
 
     link->state &= ~DEV_CONFIG;
-
-    if (link->state & DEV_STALE_CONFIG)
-	    ibmtr_detach(link);
 }
 
 /*======================================================================
@@ -482,7 +470,7 @@
         if (link->state & DEV_CONFIG) {
             pcmcia_request_configuration(link->handle, &link->conf);
             if (link->open) {
-		(dev->init)(dev);
+		ibmtr_probe(dev);	/* really? */
 		netif_device_attach(dev);
             }
         }
--- diff/drivers/net/pcmcia/nmclan_cs.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/net/pcmcia/nmclan_cs.c	2004-02-09 10:39:53.000000000 +0000
@@ -551,23 +551,17 @@
     if (*linkp == NULL)
 	return;
 
-    if (link->state & DEV_CONFIG) {
+    if (link->state & DEV_CONFIG)
 	nmclan_release(link);
-	if (link->state & DEV_STALE_CONFIG)
-	    return;
-    }
 
     if (link->handle)
 	pcmcia_deregister_client(link->handle);
 
     /* Unlink device structure, free bits */
     *linkp = link->next;
-    if (link->dev) {
+    if (link->dev)
 	unregister_netdev(dev);
-	free_netdev(dev);
-    } else
-	kfree(dev);
-
+    free_netdev(dev);
 } /* nmclan_detach */
 
 /* ----------------------------------------------------------------------------
@@ -812,21 +806,11 @@
 
   DEBUG(0, "nmclan_release(0x%p)\n", link);
 
-  if (link->open) {
-    DEBUG(1, "nmclan_cs: release postponed, '%s' "
-	  "still open\n", link->dev->dev_name);
-    link->state |= DEV_STALE_CONFIG;
-    return;
-  }
-
   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)
-	  nmclan_detach(link);
 }
 
 /* ----------------------------------------------------------------------------
@@ -993,8 +977,6 @@
 
   link->open--;
   netif_stop_queue(dev);
-  if (link->state & DEV_STALE_CONFIG)
-	  nmclan_release(link);
 
   return 0;
 } /* mace_close */
--- diff/drivers/net/pcmcia/pcnet_cs.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/net/pcmcia/pcnet_cs.c	2004-02-09 10:39:53.000000000 +0000
@@ -224,7 +224,6 @@
 static hw_info_t dl10022_info = { 0, 0, 0, 0, IS_DL10022|HAS_MII };
 
 typedef struct pcnet_dev_t {
-    struct net_device	dev;	/* so &dev == &pcnet_dev_t */
     dev_link_t		link;
     dev_node_t		node;
     u_int		flags;
@@ -237,16 +236,10 @@
     u_long		mii_reset;
 } pcnet_dev_t;
 
-/*======================================================================
-
-    We never need to do anything when a pcnet device is "initialized"
-    by the net software, because we only register already-found cards.
-
-======================================================================*/
-
-static int pcnet_init(struct net_device *dev)
+static inline pcnet_dev_t *PRIV(struct net_device *dev)
 {
-    return 0;
+	char *p = netdev_priv(dev);
+	return (pcnet_dev_t *)(p + sizeof(struct ei_device));
 }
 
 /*======================================================================
@@ -268,11 +261,11 @@
     DEBUG(0, "pcnet_attach()\n");
 
     /* Create new ethernet device */
-    info = kmalloc(sizeof(*info), GFP_KERNEL);
-    if (!info) return NULL;
-    memset(info, 0, sizeof(*info));
-    link = &info->link; dev = &info->dev;
-    link->priv = info;
+    dev = __alloc_ei_netdev(sizeof(pcnet_dev_t));
+    if (!dev) return NULL;
+    info = PRIV(dev);
+    link = &info->link;
+    link->priv = dev;
 
     link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
     link->irq.IRQInfo1 = IRQ_INFO2_VALID|IRQ_LEVEL_ID;
@@ -284,9 +277,7 @@
     link->conf.Attributes = CONF_ENABLE_IRQ;
     link->conf.IntType = INT_MEMORY_AND_IO;
 
-    ethdev_init(dev);
     SET_MODULE_OWNER(dev);
-    dev->init = &pcnet_init;
     dev->open = &pcnet_open;
     dev->stop = &pcnet_close;
     dev->set_config = &set_config;
@@ -324,7 +315,7 @@
 
 static void pcnet_detach(dev_link_t *link)
 {
-    pcnet_dev_t *info = link->priv;
+    struct net_device *dev = link->priv;
     dev_link_t **linkp;
 
     DEBUG(0, "pcnet_detach(0x%p)\n", link);
@@ -335,23 +326,17 @@
     if (*linkp == NULL)
 	return;
 
-    if (link->state & DEV_CONFIG) {
+    if (link->state & DEV_CONFIG)
 	pcnet_release(link);
-	if (link->state & DEV_STALE_CONFIG)
-	    return;
-    }
 
     if (link->handle)
 	pcmcia_deregister_client(link->handle);
 
     /* Unlink device structure, free bits */
     *linkp = link->next;
-    if (link->dev) {
-	unregister_netdev(&info->dev);
-	free_netdev(&info->dev);
-    } else
-	 kfree(info);
-
+    if (link->dev)
+	unregister_netdev(dev);
+    free_netdev(dev);
 } /* pcnet_detach */
 
 /*======================================================================
@@ -579,8 +564,8 @@
 static void pcnet_config(dev_link_t *link)
 {
     client_handle_t handle = link->handle;
-    pcnet_dev_t *info = link->priv;
-    struct net_device *dev = &info->dev;
+    struct net_device *dev = link->priv;
+    pcnet_dev_t *info = PRIV(dev);
     tuple_t tuple;
     cisparse_t parse;
     int i, last_ret, last_fn, start_pg, stop_pg, cm_offset;
@@ -782,17 +767,10 @@
 
 static void pcnet_release(dev_link_t *link)
 {
-    pcnet_dev_t *info = link->priv;
+    pcnet_dev_t *info = PRIV(link->priv);
 
     DEBUG(0, "pcnet_release(0x%p)\n", link);
 
-    if (link->open) {
-	DEBUG(1, "pcnet_cs: release postponed, '%s' still open\n",
-	      info->node.dev_name);
-	link->state |= DEV_STALE_CONFIG;
-	return;
-    }
-
     if (info->flags & USE_SHMEM) {
 	iounmap(info->base);
 	pcmcia_release_window(link->win);
@@ -802,9 +780,6 @@
     pcmcia_release_irq(link->handle, &link->irq);
 
     link->state &= ~DEV_CONFIG;
-
-    if (link->state & DEV_STALE_CONFIG)
-	    pcnet_detach(link);
 }
 
 /*======================================================================
@@ -820,7 +795,7 @@
 		       event_callback_args_t *args)
 {
     dev_link_t *link = args->client_data;
-    pcnet_dev_t *info = link->priv;
+    struct net_device *dev = link->priv;
 
     DEBUG(2, "pcnet_event(0x%06x)\n", event);
 
@@ -828,7 +803,7 @@
     case CS_EVENT_CARD_REMOVAL:
 	link->state &= ~DEV_PRESENT;
 	if (link->state & DEV_CONFIG) {
-	    netif_device_detach(&info->dev);
+	    netif_device_detach(dev);
 	    pcnet_release(link);
 	}
 	break;
@@ -842,7 +817,7 @@
     case CS_EVENT_RESET_PHYSICAL:
 	if (link->state & DEV_CONFIG) {
 	    if (link->open)
-		netif_device_detach(&info->dev);
+		netif_device_detach(dev);
 	    pcmcia_release_configuration(link->handle);
 	}
 	break;
@@ -853,9 +828,9 @@
 	if (link->state & DEV_CONFIG) {
 	    pcmcia_request_configuration(link->handle, &link->conf);
 	    if (link->open) {
-		pcnet_reset_8390(&info->dev);
-		NS8390_init(&info->dev, 1);
-		netif_device_attach(&info->dev);
+		pcnet_reset_8390(dev);
+		NS8390_init(dev, 1);
+		netif_device_attach(dev);
 	    }
 	}
 	break;
@@ -1035,7 +1010,7 @@
 static void set_misc_reg(struct net_device *dev)
 {
     ioaddr_t nic_base = dev->base_addr;
-    pcnet_dev_t *info = (pcnet_dev_t *)dev;
+    pcnet_dev_t *info = PRIV(dev);
     u_char tmp;
     
     if (info->flags & HAS_MISC_REG) {
@@ -1065,7 +1040,7 @@
 
 static void mii_phy_probe(struct net_device *dev)
 {
-    pcnet_dev_t *info = (pcnet_dev_t *)dev;	
+    pcnet_dev_t *info = PRIV(dev);
     ioaddr_t mii_addr = dev->base_addr + DLINK_GPIO;
     int i;
     u_int tmp, phyid;
@@ -1089,7 +1064,7 @@
 
 static int pcnet_open(struct net_device *dev)
 {
-    pcnet_dev_t *info = (pcnet_dev_t *)dev;
+    pcnet_dev_t *info = PRIV(dev);
     dev_link_t *link = &info->link;
     
     DEBUG(2, "pcnet_open('%s')\n", dev->name);
@@ -1106,7 +1081,7 @@
     info->link_status = 0x00;
     init_timer(&info->watchdog);
     info->watchdog.function = &ei_watchdog;
-    info->watchdog.data = (u_long)info;
+    info->watchdog.data = (u_long)dev;
     info->watchdog.expires = jiffies + HZ;
     add_timer(&info->watchdog);
 
@@ -1117,7 +1092,7 @@
 
 static int pcnet_close(struct net_device *dev)
 {
-    pcnet_dev_t *info = (pcnet_dev_t *)dev;
+    pcnet_dev_t *info = PRIV(dev);
     dev_link_t *link = &info->link;
 
     DEBUG(2, "pcnet_close('%s')\n", dev->name);
@@ -1128,8 +1103,6 @@
     link->open--;
     netif_stop_queue(dev);
     del_timer_sync(&info->watchdog);
-    if (link->state & DEV_STALE_CONFIG)
-	    pcnet_release(link);
 
     return 0;
 } /* pcnet_close */
@@ -1170,7 +1143,7 @@
 
 static int set_config(struct net_device *dev, struct ifmap *map)
 {
-    pcnet_dev_t *info = (pcnet_dev_t *)dev;
+    pcnet_dev_t *info = PRIV(dev);
     if ((map->port != (u_char)(-1)) && (map->port != dev->if_port)) {
 	if (!(info->flags & HAS_MISC_REG))
 	    return -EOPNOTSUPP;
@@ -1188,7 +1161,8 @@
 
 static irqreturn_t ei_irq_wrapper(int irq, void *dev_id, struct pt_regs *regs)
 {
-    pcnet_dev_t *info = dev_id;
+    struct net_device *dev = dev_id;
+    pcnet_dev_t *info = PRIV(dev);
     info->stale = 0;
     ei_interrupt(irq, dev_id, regs);
     /* FIXME! Was it really ours? */
@@ -1197,8 +1171,8 @@
 
 static void ei_watchdog(u_long arg)
 {
-    pcnet_dev_t *info = (pcnet_dev_t *)(arg);
-    struct net_device *dev = &info->dev;
+    struct net_device *dev = (struct net_device *)arg;
+    pcnet_dev_t *info = PRIV(dev);
     ioaddr_t nic_base = dev->base_addr;
     ioaddr_t mii_addr = nic_base + DLINK_GPIO;
     u_short link;
@@ -1301,7 +1275,7 @@
 
 static int ei_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 {
-    pcnet_dev_t *info = (pcnet_dev_t *)dev;
+    pcnet_dev_t *info = PRIV(dev);
     u16 *data = (u16 *)&rq->ifr_data;
     ioaddr_t mii_addr = dev->base_addr + DLINK_GPIO;
     switch (cmd) {
@@ -1412,7 +1386,7 @@
 			     const u_char *buf, const int start_page)
 {
     ioaddr_t nic_base = dev->base_addr;
-    pcnet_dev_t *info = (pcnet_dev_t *)dev;
+    pcnet_dev_t *info = PRIV(dev);
 #ifdef PCMCIA_DEBUG
     int retries = 0;
 #endif
@@ -1598,7 +1572,7 @@
 			      int stop_pg, int cm_offset)
 {
     struct net_device *dev = link->priv;
-    pcnet_dev_t *info = link->priv;
+    pcnet_dev_t *info = PRIV(dev);
     win_req_t req;
     memreq_t mem;
     int i, window_size, offset, last_ret, last_fn;
--- diff/drivers/net/pcmcia/smc91c92_cs.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/net/pcmcia/smc91c92_cs.c	2004-02-09 10:39:53.000000000 +0000
@@ -411,23 +411,17 @@
     if (*linkp == NULL)
 	return;
 
-    if (link->state & DEV_CONFIG) {
+    if (link->state & DEV_CONFIG)
 	smc91c92_release(link);
-	if (link->state & DEV_STALE_CONFIG)
-	    return;
-    }
 
     if (link->handle)
 	pcmcia_deregister_client(link->handle);
 
     /* Unlink device structure, free bits */
     *linkp = link->next;
-    if (link->dev) {
+    if (link->dev)
 	unregister_netdev(dev);
-	free_netdev(dev);
-    } else
-	kfree(dev);
-
+    free_netdev(dev);
 } /* smc91c92_detach */
 
 /*====================================================================*/
@@ -1070,13 +1064,6 @@
 
     DEBUG(0, "smc91c92_release(0x%p)\n", link);
 
-    if (link->open) {
-	DEBUG(1, "smc91c92_cs: release postponed, '%s' still open\n",
-	      link->dev->dev_name);
-	link->state |= DEV_STALE_CONFIG;
-	return;
-    }
-
     pcmcia_release_configuration(link->handle);
     pcmcia_release_io(link->handle, &link->io);
     pcmcia_release_irq(link->handle, &link->irq);
@@ -1088,9 +1075,6 @@
     }
 
     link->state &= ~DEV_CONFIG;
-
-    if (link->state & DEV_STALE_CONFIG)
-	    smc91c92_detach(link);
 }
 
 /*======================================================================
@@ -1316,8 +1300,6 @@
 
     link->open--;
     del_timer_sync(&smc->media);
-    if (link->state & DEV_STALE_CONFIG)
-	    smc91c92_release(link);
 
     return 0;
 } /* smc_close */
--- diff/drivers/net/pcmcia/xirc2ps_cs.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/net/pcmcia/xirc2ps_cs.c	2004-02-09 10:39:53.000000000 +0000
@@ -683,12 +683,9 @@
 
     /* Unlink device structure, free it */
     *linkp = link->next;
-    if (link->dev) {
+    if (link->dev)
 	unregister_netdev(dev);
-	free_netdev(dev);
-    } else
-	kfree(dev);
-
+    free_netdev(dev);
 } /* xirc2ps_detach */
 
 /****************
--- diff/drivers/net/pcnet32.c	2003-12-19 09:51:11.000000000 +0000
+++ source/drivers/net/pcnet32.c	2004-02-09 10:39:53.000000000 +0000
@@ -456,6 +456,14 @@
     .reset	= pcnet32_dwio_reset
 };
 
+#ifdef CONFIG_NET_POLL_CONTROLLER
+static void pcnet32_poll_controller(struct net_device *dev)
+{ 
+	disable_irq(dev->irq);
+	pcnet32_interrupt(0, dev, NULL);
+	enable_irq(dev->irq);
+} 
+#endif
 
 
 /* only probes for non-PCI devices, the rest are handled by 
@@ -805,12 +813,16 @@
     dev->do_ioctl = &pcnet32_ioctl;
     dev->tx_timeout = pcnet32_tx_timeout;
     dev->watchdog_timeo = (5*HZ);
+#ifdef CONFIG_NET_POLL_CONTROLLER
+    dev->poll_controller = pcnet32_poll_controller;
+#endif    
+
+    /* Fill in the generic fields of the device structure. */
+    if (register_netdev(dev))
+	goto err_free_consistent;
 
     lp->next = pcnet32_dev;
     pcnet32_dev = dev;
-
-    /* Fill in the generic fields of the device structure. */
-    register_netdev(dev);
     printk(KERN_INFO "%s: registered as %s\n",dev->name, lp->name);
     cards_found++;
     return 0;
@@ -1695,12 +1707,16 @@
 static void pcnet32_watchdog(struct net_device *dev)
 {
     struct pcnet32_private *lp = dev->priv;
+    unsigned long flags;
+
+    spin_lock_irqsave(&lp->lock, flags);
 
     /* Print the link status if it has changed */
     if (lp->mii)
 	mii_check_media (&lp->mii_if, 1, 0);
-
     mod_timer (&(lp->watchdog_timer), PCNET32_WATCHDOG_TIMEOUT);
+
+    spin_unlock_irqrestore(&lp->lock, flags);
 }
 
 static struct pci_driver pcnet32_driver = {
--- diff/drivers/net/plip.c	2003-08-26 10:00:53.000000000 +0100
+++ source/drivers/net/plip.c	2004-02-09 10:39:53.000000000 +0000
@@ -277,19 +277,11 @@
    then calls us here.
 
    */
-static int
+static void
 plip_init_netdev(struct net_device *dev)
 {
 	struct net_local *nl = dev->priv;
 
-	printk(KERN_INFO "%s", version);
-	if (dev->irq != -1)
-		printk(KERN_INFO "%s: Parallel port at %#3lx, using IRQ %d.\n",
-		       dev->name, dev->base_addr, dev->irq);
-	else
-		printk(KERN_INFO "%s: Parallel port at %#3lx, not using IRQ.\n",
-		       dev->name, dev->base_addr);
-
 	/* Then, override parts of it */
 	dev->hard_start_xmit	 = plip_tx_packet;
 	dev->open		 = plip_open;
@@ -323,8 +315,6 @@
 		INIT_WORK(&nl->timer, (void (*)(void *))plip_timer_bh, dev);
 
 	spin_lock_init(&nl->lock);
-
-	return 0;
 }
 
 /* Bottom half handler for the delayed request.
@@ -1282,14 +1272,13 @@
 		}
 
 		sprintf(name, "plip%d", unit);
-		dev = alloc_netdev(sizeof(struct net_local), name, 
-				   ether_setup);
+		dev = alloc_etherdev(sizeof(struct net_local));
 		if (!dev) {
 			printk(KERN_ERR "plip: memory squeeze\n");
 			return;
 		}
 		
-		dev->init = plip_init_netdev;
+		strcpy(dev->name, name);
 
 		SET_MODULE_OWNER(dev);
 		dev->irq = port->irq;
@@ -1306,17 +1295,35 @@
 
 		if (!nl->pardev) {
 			printk(KERN_ERR "%s: parport_register failed\n", name);
-			kfree(dev);
+			goto err_free_dev;
 			return;
 		}
 
+		plip_init_netdev(dev);
+
 		if (register_netdev(dev)) {
 			printk(KERN_ERR "%s: network register failed\n", name);
-			kfree(dev);
-		} else {
-			dev_plip[unit++] = dev;
+			goto err_parport_unregister;
 		}
+
+		printk(KERN_INFO "%s", version);
+		if (dev->irq != -1)
+			printk(KERN_INFO "%s: Parallel port at %#3lx, "
+					 "using IRQ %d.\n",
+				         dev->name, dev->base_addr, dev->irq);
+		else
+			printk(KERN_INFO "%s: Parallel port at %#3lx, "
+					 "not using IRQ.\n",
+					 dev->name, dev->base_addr);
+		dev_plip[unit++] = dev;
 	}
+	return;
+
+err_parport_unregister:
+	parport_unregister_device(nl->pardev);
+err_free_dev:
+	free_netdev(dev);
+	return;
 }
 
 /* plip_detach() is called (by the parport code) when a port is
--- diff/drivers/net/ppp_deflate.c	2003-06-30 10:07:21.000000000 +0100
+++ source/drivers/net/ppp_deflate.c	2004-02-09 10:39:53.000000000 +0000
@@ -351,7 +351,7 @@
 	state->w_size         = w_size;
 	state->strm.next_out  = NULL;
 	state->strm.workspace = kmalloc(zlib_inflate_workspacesize(),
-					GFP_KERNEL);
+					GFP_KERNEL|__GFP_REPEAT);
 	if (state->strm.workspace == NULL)
 		goto out_free;
 
@@ -655,3 +655,5 @@
 module_init(deflate_init);
 module_exit(deflate_cleanup);
 MODULE_LICENSE("Dual BSD/GPL");
+MODULE_ALIAS("ppp-compress-" __stringify(CI_DEFLATE));
+MODULE_ALIAS("ppp-compress-" __stringify(CI_DEFLATE_DRAFT));
--- diff/drivers/net/ppp_generic.c	2003-09-30 15:46:15.000000000 +0100
+++ source/drivers/net/ppp_generic.c	2004-02-09 10:39:53.000000000 +0000
@@ -917,19 +917,14 @@
 	return err;
 }
 
-static int
-ppp_net_init(struct net_device *dev)
+static void ppp_setup(struct net_device *dev)
 {
 	dev->hard_header_len = PPP_HDRLEN;
 	dev->mtu = PPP_MTU;
-	dev->hard_start_xmit = ppp_start_xmit;
-	dev->get_stats = ppp_net_stats;
-	dev->do_ioctl = ppp_net_ioctl;
 	dev->addr_len = 0;
 	dev->tx_queue_len = 3;
 	dev->type = ARPHRD_PPP;
 	dev->flags = IFF_POINTOPOINT | IFF_NOARP | IFF_MULTICAST;
-	return 0;
 }
 
 /*
@@ -2272,23 +2267,13 @@
 	int i;
 
 	ppp = kmalloc(sizeof(struct ppp), GFP_KERNEL);
-	if (ppp == 0)
-		goto err;
-	dev = kmalloc(sizeof(struct net_device), GFP_KERNEL);
-	if (dev == 0)
-		goto err;
+	if (!ppp)
+		goto out;
+	dev = alloc_netdev(0, "", ppp_setup);
+	if (!dev)
+		goto out1;
 	memset(ppp, 0, sizeof(struct ppp));
-	memset(dev, 0, sizeof(struct net_device));
 
-	ret = -EEXIST;
-	down(&all_ppp_sem);
-	if (unit < 0)
-		unit = cardmap_find_first_free(all_ppp_units);
-	else if (cardmap_get(all_ppp_units, unit) != NULL)
-		goto err_unlock;	/* unit already exists */
-
-	/* Initialize the new ppp unit */
-	ppp->file.index = unit;
 	ppp->mru = PPP_MRU;
 	init_ppp_file(&ppp->file, INTERFACE);
 	ppp->file.hdrlen = PPP_HDRLEN - 2;	/* don't count proto bytes */
@@ -2301,20 +2286,29 @@
 	ppp->minseq = -1;
 	skb_queue_head_init(&ppp->mrq);
 #endif /* CONFIG_PPP_MULTILINK */
-
 	ppp->dev = dev;
-	dev->init = ppp_net_init;
-	sprintf(dev->name, "ppp%d", unit);
 	dev->priv = ppp;
-	dev->destructor = free_netdev;
 
-	rtnl_lock();
-	ret = register_netdevice(dev);
-	rtnl_unlock();
+	dev->hard_start_xmit = ppp_start_xmit;
+	dev->get_stats = ppp_net_stats;
+	dev->do_ioctl = ppp_net_ioctl;
+
+	ret = -EEXIST;
+	down(&all_ppp_sem);
+	if (unit < 0)
+		unit = cardmap_find_first_free(all_ppp_units);
+	else if (cardmap_get(all_ppp_units, unit) != NULL)
+		goto out2;	/* unit already exists */
+
+	/* Initialize the new ppp unit */
+	ppp->file.index = unit;
+	sprintf(dev->name, "ppp%d", unit);
+
+	ret = register_netdev(dev);
 	if (ret != 0) {
 		printk(KERN_ERR "PPP: couldn't register device %s (%d)\n",
 		       dev->name, ret);
-		goto err_unlock;
+		goto out2;
 	}
 
 	atomic_inc(&ppp_unit_count);
@@ -2323,14 +2317,13 @@
 	*retp = 0;
 	return ppp;
 
- err_unlock:
+out2:
 	up(&all_ppp_sem);
- err:
+	free_netdev(dev);
+out1:
+	kfree(ppp);
+out:
 	*retp = ret;
-	if (ppp)
-		kfree(ppp);
-	if (dev)
-		kfree(dev);
 	return NULL;
 }
 
@@ -2361,8 +2354,10 @@
 	ppp->dev = 0;
 	ppp_unlock(ppp);
 	/* This will call dev_close() for us. */
-	if (dev)
+	if (dev) {
 		unregister_netdev(dev);
+		free_netdev(dev);
+	}
 	cardmap_set(&all_ppp_units, ppp->file.index, NULL);
 	ppp->file.dead = 1;
 	ppp->owner = NULL;
@@ -2673,3 +2668,4 @@
 EXPORT_SYMBOL(all_channels); /* for debugging */
 MODULE_LICENSE("GPL");
 MODULE_ALIAS_CHARDEV_MAJOR(PPP_MAJOR);
+MODULE_ALIAS("/dev/ppp");
--- diff/drivers/net/pppoe.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/net/pppoe.c	2004-02-09 10:39:53.000000000 +0000
@@ -67,7 +67,6 @@
 #include <linux/ppp_channel.h>
 #include <linux/ppp_defs.h>
 #include <linux/if_ppp.h>
-#include <linux/if_pppvar.h>
 #include <linux/notifier.h>
 #include <linux/file.h>
 #include <linux/proc_fs.h>
@@ -517,7 +516,7 @@
 	sk->sk_protocol	   = PX_PROTO_OE;
 	sk->sk_destruct	   = pppoe_sk_free;
 
-	po = pppox_sk(sk) = kmalloc(sizeof(*po), GFP_KERNEL);
+	po = sk->sk_protinfo = kmalloc(sizeof(*po), GFP_KERNEL);
 	if (!po)
 		goto frees;
 	memset(po, 0, sizeof(*po));
--- diff/drivers/net/r8169.c	2003-12-19 09:51:11.000000000 +0000
+++ source/drivers/net/r8169.c	2004-02-09 10:39:53.000000000 +0000
@@ -56,9 +56,11 @@
 	        printk( "Assertion failed! %s,%s,%s,line=%d\n",	\
         	#expr,__FILE__,__FUNCTION__,__LINE__);		\
         }
+#define dprintk(fmt, args...)	do { printk(PFX fmt, ## args) } while (0)
 #else
 #define assert(expr) do {} while (0)
-#endif
+#define dprintk(fmt, args...)	do {} while (0)
+#endif /* RTL8169_DEBUG */
 
 /* media options */
 #define MAX_UNITS 8
@@ -89,9 +91,12 @@
 #define NUM_TX_DESC	64	/* Number of Tx descriptor registers */
 #define NUM_RX_DESC	64	/* Number of Rx descriptor registers */
 #define RX_BUF_SIZE	1536	/* Rx Buffer size */
+#define R8169_TX_RING_BYTES	(NUM_TX_DESC * sizeof(struct TxDesc))
+#define R8169_RX_RING_BYTES	(NUM_RX_DESC * sizeof(struct RxDesc))
 
 #define RTL_MIN_IO_SIZE 0x80
-#define TX_TIMEOUT  (6*HZ)
+#define RTL8169_TX_TIMEOUT	(6*HZ)
+#define RTL8169_PHY_TIMEOUT	(HZ) 
 
 /* write/read MMIO register */
 #define RTL_W8(reg, val8)	writeb ((val8), ioaddr + (reg))
@@ -101,11 +106,35 @@
 #define RTL_R16(reg)		readw (ioaddr + (reg))
 #define RTL_R32(reg)		((unsigned long) readl (ioaddr + (reg)))
 
-static struct {
+enum mac_version {
+	RTL_GIGA_MAC_VER_B = 0x00,
+	/* RTL_GIGA_MAC_VER_C = 0x03, */
+	RTL_GIGA_MAC_VER_D = 0x01,
+	RTL_GIGA_MAC_VER_E = 0x02
+};
+
+enum phy_version {
+	RTL_GIGA_PHY_VER_C = 0x03, /* PHY Reg 0x03 bit0-3 == 0x0000 */
+	RTL_GIGA_PHY_VER_D = 0x04, /* PHY Reg 0x03 bit0-3 == 0x0000 */
+	RTL_GIGA_PHY_VER_E = 0x05, /* PHY Reg 0x03 bit0-3 == 0x0000 */
+	RTL_GIGA_PHY_VER_F = 0x06, /* PHY Reg 0x03 bit0-3 == 0x0001 */
+	RTL_GIGA_PHY_VER_G = 0x07, /* PHY Reg 0x03 bit0-3 == 0x0002 */
+};
+
+
+#define _R(NAME,MAC,MASK) \
+	{ .name = NAME, .mac_version = MAC, .RxConfigMask = MASK }
+
+const static struct {
 	const char *name;
-} board_info[] __devinitdata = {
-	{
-"RealTek RTL8169 Gigabit Ethernet"},};
+	u8 mac_version;
+	u32 RxConfigMask;	/* Clears the bits supported by this chip */
+} rtl_chip_info[] = {
+	_R("RTL8169",		RTL_GIGA_MAC_VER_B, 0xff7e1880),
+	_R("RTL8169s/8110s",	RTL_GIGA_MAC_VER_D, 0xff7e1880),
+	_R("RTL8169s/8110s",	RTL_GIGA_MAC_VER_E, 0xff7e1880)
+};
+#undef _R
 
 static struct pci_device_id rtl8169_pci_tbl[] = {
 	{0x10ec, 0x8169, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
@@ -114,6 +143,8 @@
 
 MODULE_DEVICE_TABLE(pci, rtl8169_pci_tbl);
 
+static int rx_copybreak = 200;
+
 enum RTL8169_registers {
 	MAC0 = 0,		/* Ethernet hardware address. */
 	MAR0 = 8,		/* Multicast filter. */
@@ -242,14 +273,6 @@
 	TBILinkOK = 0x02000000,
 };
 
-const static struct {
-	const char *name;
-	u8 version;		/* depend on RTL8169 docs */
-	u32 RxConfigMask;	/* should clear the bits supported by this chip */
-} rtl_chip_info[] = {
-	{
-"RTL-8169", 0x00, 0xff7e1880,},};
-
 enum _DescStatusBit {
 	OWNbit = 0x80000000,
 	EORbit = 0x40000000,
@@ -257,6 +280,8 @@
 	LSbit = 0x10000000,
 };
 
+#define RsvdMask	0x3fffc000
+
 struct TxDesc {
 	u32 status;
 	u32 vlan_tag;
@@ -277,28 +302,33 @@
 	struct net_device_stats stats;	/* statistics of net device */
 	spinlock_t lock;	/* spin lock flag */
 	int chipset;
-	unsigned long cur_rx;	/* Index into the Rx descriptor buffer of next Rx pkt. */
-	unsigned long cur_tx;	/* Index into the Tx descriptor buffer of next Rx pkt. */
-	unsigned long dirty_tx;
-	unsigned char *TxDescArrays;	/* Index of Tx Descriptor buffer */
-	unsigned char *RxDescArrays;	/* Index of Rx Descriptor buffer */
+	int mac_version;
+	int phy_version;
+	u32 cur_rx; /* Index into the Rx descriptor buffer of next Rx pkt. */
+	u32 cur_tx; /* Index into the Tx descriptor buffer of next Rx pkt. */
+	u32 dirty_rx;
+	u32 dirty_tx;
 	struct TxDesc *TxDescArray;	/* Index of 256-alignment Tx Descriptor buffer */
 	struct RxDesc *RxDescArray;	/* Index of 256-alignment Rx Descriptor buffer */
-	unsigned char *RxBufferRings;	/* Index of Rx Buffer  */
-	unsigned char *RxBufferRing[NUM_RX_DESC];	/* Index of Rx Buffer array */
+	dma_addr_t TxPhyAddr;
+	dma_addr_t RxPhyAddr;
+	struct sk_buff *Rx_skbuff[NUM_RX_DESC];	/* Rx data buffers */
 	struct sk_buff *Tx_skbuff[NUM_TX_DESC];	/* Index of Transmit data buffer */
+	struct timer_list timer;
+	unsigned long phy_link_down_cnt;
 };
 
 MODULE_AUTHOR("Realtek");
 MODULE_DESCRIPTION("RealTek RTL-8169 Gigabit Ethernet driver");
 MODULE_PARM(media, "1-" __MODULE_STRING(MAX_UNITS) "i");
+MODULE_PARM(rx_copybreak, "i");
 MODULE_LICENSE("GPL");
 
 static int rtl8169_open(struct net_device *dev);
 static int rtl8169_start_xmit(struct sk_buff *skb, struct net_device *dev);
 static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance,
 			      struct pt_regs *regs);
-static void rtl8169_init_ring(struct net_device *dev);
+static int rtl8169_init_ring(struct net_device *dev);
 static void rtl8169_hw_start(struct net_device *dev);
 static int rtl8169_close(struct net_device *dev);
 static void rtl8169_set_rx_mode(struct net_device *dev);
@@ -306,11 +336,15 @@
 static struct net_device_stats *rtl8169_get_stats(struct net_device *netdev);
 
 static const u16 rtl8169_intr_mask =
-    SYSErr | PCSTimeout | RxUnderrun | RxOverflow | RxFIFOOver | TxErr | TxOK |
-    RxErr | RxOK;
+    RxUnderrun | RxOverflow | RxFIFOOver | TxErr | TxOK | RxErr | RxOK;
 static const unsigned int rtl8169_rx_config =
     (RX_FIFO_THRESH << RxCfgFIFOShift) | (RX_DMA_BURST << RxCfgDMAShift);
 
+#define PHY_Cap_10_Half_Or_Less PHY_Cap_10_Half
+#define PHY_Cap_10_Full_Or_Less PHY_Cap_10_Full | PHY_Cap_10_Half_Or_Less
+#define PHY_Cap_100_Half_Or_Less PHY_Cap_100_Half | PHY_Cap_10_Full_Or_Less
+#define PHY_Cap_100_Full_Or_Less PHY_Cap_100_Full | PHY_Cap_100_Half_Or_Less
+
 void
 mdio_write(void *ioaddr, int RegAddr, int value)
 {
@@ -342,13 +376,258 @@
 		if (RTL_R32(PHYAR) & 0x80000000) {
 			value = (int) (RTL_R32(PHYAR) & 0xFFFF);
 			break;
-		} else {
-			udelay(100);
 		}
+		udelay(100);
 	}
 	return value;
 }
 
+static void rtl8169_write_gmii_reg_bit(void *ioaddr, int reg, int bitnum,
+				       int bitval)
+{
+	int val;
+
+	val = mdio_read(ioaddr, reg);
+	val = (bitval == 1) ?
+		val | (bitval << bitnum) :  val & ~(0x0001 << bitnum);
+	mdio_write(ioaddr, reg, val & 0xffff); 
+}
+
+static void rtl8169_get_mac_version(struct rtl8169_private *tp, void *ioaddr)
+{
+	const struct {
+		u32 mask;
+		int mac_version;
+	} mac_info[] = {
+		{ 0x1 << 26,	RTL_GIGA_MAC_VER_E },
+		{ 0x1 << 23,	RTL_GIGA_MAC_VER_D }, 
+		{ 0x00000000,	RTL_GIGA_MAC_VER_B } /* Catch-all */
+	}, *p = mac_info;
+	u32 reg;
+
+	reg = RTL_R32(TxConfig) & 0x7c800000;
+	while ((reg & p->mask) != p->mask)
+		p++;
+	tp->mac_version = p->mac_version;
+}
+
+static void rtl8169_print_mac_version(struct rtl8169_private *tp)
+{
+	struct {
+		int version;
+		char *msg;
+	} mac_print[] = {
+		{ RTL_GIGA_MAC_VER_E, "RTL_GIGA_MAC_VER_E" },
+		{ RTL_GIGA_MAC_VER_D, "RTL_GIGA_MAC_VER_D" },
+		{ RTL_GIGA_MAC_VER_B, "RTL_GIGA_MAC_VER_B" },
+		{ 0, NULL }
+	}, *p;
+
+	for (p = mac_print; p->msg; p++) {
+		if (tp->mac_version == p->version) {
+			dprintk("mac_version == %s (%04d)\n", p->msg,
+				  p->version);
+			return;
+		}
+	}
+	dprintk("mac_version == Unknown\n");
+}
+
+static void rtl8169_get_phy_version(struct rtl8169_private *tp, void *ioaddr)
+{
+	const struct {
+		u16 mask;
+		u16 set;
+		int phy_version;
+	} phy_info[] = {
+		{ 0x000f, 0x0002, RTL_GIGA_PHY_VER_G },
+		{ 0x000f, 0x0001, RTL_GIGA_PHY_VER_F },
+		{ 0x000f, 0x0000, RTL_GIGA_PHY_VER_E },
+		{ 0x0000, 0x0000, RTL_GIGA_PHY_VER_D } /* Catch-all */
+	}, *p = phy_info;
+	u16 reg;
+
+	reg = mdio_read(ioaddr, 3) & 0xffff;
+	while ((reg & p->mask) != p->set)
+		p++;
+	tp->phy_version = p->phy_version;
+}
+
+static void rtl8169_print_phy_version(struct rtl8169_private *tp)
+{
+	struct {
+		int version;
+		char *msg;
+		u32 reg;
+	} phy_print[] = {
+		{ RTL_GIGA_PHY_VER_G, "RTL_GIGA_PHY_VER_G", 0x0002 },
+		{ RTL_GIGA_PHY_VER_F, "RTL_GIGA_PHY_VER_F", 0x0001 },
+		{ RTL_GIGA_PHY_VER_E, "RTL_GIGA_PHY_VER_E", 0x0000 },
+		{ RTL_GIGA_PHY_VER_D, "RTL_GIGA_PHY_VER_D", 0x0000 },
+		{ 0, NULL, 0x0000 }
+	}, *p;
+
+	for (p = phy_print; p->msg; p++) {
+		if (tp->phy_version == p->version) {
+			dprintk("phy_version == %s (%04x)\n", p->msg, p->reg);
+			return;
+		}
+	}
+	dprintk("phy_version == Unknown\n");
+}
+
+static void rtl8169_hw_phy_config(struct net_device *dev)
+{
+	struct rtl8169_private *tp = dev->priv;
+	void *ioaddr = tp->mmio_addr;
+	struct {
+		u16 regs[5]; /* Beware of bit-sign propagation */
+	} phy_magic[5] = { {
+		{ 0x0000,	//w 4 15 12 0
+		  0x00a1,	//w 3 15 0 00a1
+		  0x0008,	//w 2 15 0 0008
+		  0x1020,	//w 1 15 0 1020
+		  0x1000 } },{	//w 0 15 0 1000
+		{ 0x7000,	//w 4 15 12 7
+		  0xff41,	//w 3 15 0 ff41
+		  0xde60,	//w 2 15 0 de60
+		  0x0140,	//w 1 15 0 0140
+		  0x0077 } },{	//w 0 15 0 0077
+		{ 0xa000,	//w 4 15 12 a
+		  0xdf01,	//w 3 15 0 df01
+		  0xdf20,	//w 2 15 0 df20
+		  0xff95,	//w 1 15 0 ff95
+		  0xfa00 } },{	//w 0 15 0 fa00
+		{ 0xb000,	//w 4 15 12 b
+		  0xff41,	//w 3 15 0 ff41
+		  0xde20,	//w 2 15 0 de20
+		  0x0140,	//w 1 15 0 0140
+		  0x00bb } },{	//w 0 15 0 00bb
+		{ 0xf000,	//w 4 15 12 f
+		  0xdf01,	//w 3 15 0 df01
+		  0xdf20,	//w 2 15 0 df20
+		  0xff95,	//w 1 15 0 ff95
+		  0xbf00 }	//w 0 15 0 bf00
+		}
+	}, *p = phy_magic;
+	int i;
+
+	rtl8169_print_mac_version(tp);
+	rtl8169_print_phy_version(tp);
+
+	if (tp->mac_version <= RTL_GIGA_MAC_VER_B)
+		return;
+	if (tp->phy_version >= RTL_GIGA_PHY_VER_F) 
+		return;
+
+	dprintk("MAC version != 0 && PHY version == 0 or 1\n");
+	dprintk("Do final_reg2.cfg\n");
+
+	/* Shazam ! */
+
+	// phy config for RTL8169s mac_version C chip
+	mdio_write(ioaddr, 31, 0x0001);			//w 31 2 0 1
+	mdio_write(ioaddr, 21, 0x1000);			//w 21 15 0 1000
+	mdio_write(ioaddr, 24, 0x65c7);			//w 24 15 0 65c7
+	rtl8169_write_gmii_reg_bit(ioaddr, 4, 11, 0);	//w 4 11 11 0
+
+	for (i = 0; i < ARRAY_SIZE(phy_magic); i++, p++) {
+		int val, pos = 4;
+
+		val = (mdio_read(ioaddr, pos) & 0x0fff) | (p->regs[0] & 0xffff);
+		mdio_write(ioaddr, pos, val);
+		while (--pos >= 0)
+			mdio_write(ioaddr, pos, p->regs[4 - pos] & 0xffff);
+		rtl8169_write_gmii_reg_bit(ioaddr, 4, 11, 1); //w 4 11 11 1
+		rtl8169_write_gmii_reg_bit(ioaddr, 4, 11, 0); //w 4 11 11 0
+	}
+	mdio_write(ioaddr, 31, 0x0000); //w 31 2 0 0
+}
+
+static void rtl8169_hw_phy_reset(struct net_device *dev)
+{
+	struct rtl8169_private *tp = dev->priv;
+	void *ioaddr = tp->mmio_addr;
+	int i, val;
+
+	printk(KERN_WARNING PFX "%s: Reset RTL8169s PHY\n", dev->name);
+
+	val = (mdio_read(ioaddr, 0) | 0x8000) & 0xffff;
+	mdio_write(ioaddr, 0, val);
+
+	for (i = 50; i >= 0; i--) {
+		if (!(mdio_read(ioaddr, 0) & 0x8000))
+			break;
+		udelay(100); /* Gross */
+	}
+
+	if (i < 0) {
+		printk(KERN_WARNING PFX "%s: no PHY Reset ack. Giving up.\n",
+		       dev->name);
+	}
+}
+
+static void rtl8169_phy_timer(unsigned long __opaque)
+{
+	struct net_device *dev = (struct net_device *)__opaque;
+	struct rtl8169_private *tp = dev->priv;
+	struct timer_list *timer = &tp->timer;
+	void *ioaddr = tp->mmio_addr;
+
+	assert(tp->mac_version > RTL_GIGA_MAC_VER_B);
+	assert(tp->phy_version < RTL_GIGA_PHY_VER_G);
+
+	if (RTL_R8(PHYstatus) & LinkStatus)
+		tp->phy_link_down_cnt = 0;
+	else {
+		tp->phy_link_down_cnt++;
+		if (tp->phy_link_down_cnt >= 12) {
+			int reg;
+
+			// If link on 1000, perform phy reset.
+			reg = mdio_read(ioaddr, PHY_1000_CTRL_REG);
+			if (reg & PHY_Cap_1000_Full) 
+				rtl8169_hw_phy_reset(dev);
+
+			tp->phy_link_down_cnt = 0;
+		}
+	}
+
+	mod_timer(timer, RTL8169_PHY_TIMEOUT);
+}
+
+static inline void rtl8169_delete_timer(struct net_device *dev)
+{
+	struct rtl8169_private *tp = dev->priv;
+	struct timer_list *timer = &tp->timer;
+
+	if ((tp->mac_version <= RTL_GIGA_MAC_VER_B) ||
+	    (tp->phy_version >= RTL_GIGA_PHY_VER_G))
+		return;
+
+	del_timer_sync(timer);
+
+	tp->phy_link_down_cnt = 0;
+}
+
+static inline void rtl8169_request_timer(struct net_device *dev)
+{
+	struct rtl8169_private *tp = dev->priv;
+	struct timer_list *timer = &tp->timer;
+
+	if ((tp->mac_version <= RTL_GIGA_MAC_VER_B) ||
+	    (tp->phy_version >= RTL_GIGA_PHY_VER_G))
+		return;
+
+	tp->phy_link_down_cnt = 0;
+
+	init_timer(timer);
+	timer->expires = jiffies + RTL8169_PHY_TIMEOUT;
+	timer->data = (unsigned long)(dev);
+	timer->function = rtl8169_phy_timer;
+	add_timer(timer);
+}
+
 static int __devinit
 rtl8169_init_board(struct pci_dev *pdev, struct net_device **dev_out,
 		   void **ioaddr_out)
@@ -356,9 +635,9 @@
 	void *ioaddr = NULL;
 	struct net_device *dev;
 	struct rtl8169_private *tp;
-	int rc, i;
 	unsigned long mmio_start, mmio_end, mmio_flags, mmio_len;
-	u32 tmp;
+	int rc, i, acpi_idle_state = 0, pm_cap;
+
 
 	assert(pdev != NULL);
 	assert(ioaddr_out != NULL);
@@ -379,8 +658,22 @@
 
 	// enable device (incl. PCI PM wakeup and hotplug setup)
 	rc = pci_enable_device(pdev);
-	if (rc)
+	if (rc) {
+		printk(KERN_ERR PFX "%s: unable to enable device\n", pdev->slot_name);
 		goto err_out;
+	}
+
+	/* save power state before pci_enable_device overwrites it */
+	pm_cap = pci_find_capability(pdev, PCI_CAP_ID_PM);
+	if (pm_cap) {
+		u16 pwr_command;
+
+		pci_read_config_word(pdev, pm_cap + PCI_PM_CTRL, &pwr_command);
+		acpi_idle_state = pwr_command & PCI_PM_CTRL_STATE_MASK;
+	} else {
+		printk(KERN_ERR PFX "Cannot find PowerManagement capability, aborting.\n");
+		goto err_out_free_res;
+	}
 
 	mmio_start = pci_resource_start(pdev, 1);
 	mmio_end = pci_resource_end(pdev, 1);
@@ -402,8 +695,10 @@
 	}
 
 	rc = pci_request_regions(pdev, dev->name);
-	if (rc)
+	if (rc) {
+		printk(KERN_ERR PFX "%s: Could not request regions.\n", pdev->slot_name);
 		goto err_out_disable;
+	}
 
 	// enable PCI bus-mastering
 	pci_set_master(pdev);
@@ -420,30 +715,32 @@
 	RTL_W8(ChipCmd, CmdReset);
 
 	// Check that the chip has finished the reset.
-	for (i = 1000; i > 0; i--)
+	for (i = 1000; i > 0; i--) {
 		if ((RTL_R8(ChipCmd) & CmdReset) == 0)
 			break;
-		else
-			udelay(10);
+		udelay(10);
+	}
 
-	// identify chip attached to board
-	tmp = RTL_R32(TxConfig);
-	tmp = ((tmp & 0x7c000000) + ((tmp & 0x00800000) << 2)) >> 24;
-
-	for (i = ARRAY_SIZE(rtl_chip_info) - 1; i >= 0; i--)
-		if (tmp == rtl_chip_info[i].version) {
-			tp->chipset = i;
-			goto match;
-		}
-	//if unknown chip, assume array element #0, original RTL-8169 in this case
-	printk(KERN_DEBUG PFX
-	       "PCI device %s: unknown chip version, assuming RTL-8169\n",
-	       pci_name(pdev));
-	printk(KERN_DEBUG PFX "PCI device %s: TxConfig = 0x%lx\n",
-	       pci_name(pdev), (unsigned long) RTL_R32(TxConfig));
-	tp->chipset = 0;
+	// Identify chip attached to board
+	rtl8169_get_mac_version(tp, ioaddr);
+	rtl8169_get_phy_version(tp, ioaddr);
+
+	rtl8169_print_mac_version(tp);
+	rtl8169_print_phy_version(tp);
+
+	for (i = ARRAY_SIZE(rtl_chip_info) - 1; i >= 0; i--) {
+		if (tp->mac_version == rtl_chip_info[i].mac_version)
+			break;
+	}
+	if (i < 0) {
+		/* Unknown chip: assume array element #0, original RTL-8169 */
+		printk(KERN_DEBUG PFX
+		       "PCI device %s: unknown chip version, assuming %s\n",
+		       pci_name(pdev), rtl_chip_info[0].name);
+		i++;
+	}
+	tp->chipset = i;
 
-match:
 	*ioaddr_out = ioaddr;
 	*dev_out = dev;
 	return 0;
@@ -499,7 +796,7 @@
 	dev->stop = rtl8169_close;
 	dev->tx_timeout = rtl8169_tx_timeout;
 	dev->set_multicast_list = rtl8169_set_rx_mode;
-	dev->watchdog_timeo = TX_TIMEOUT;
+	dev->watchdog_timeo = RTL8169_TX_TIMEOUT;
 	dev->irq = pdev->irq;
 	dev->base_addr = (unsigned long) ioaddr;
 //      dev->do_ioctl           = mii_ioctl;
@@ -528,12 +825,29 @@
 	       "%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x, "
 	       "IRQ %d\n",
 	       dev->name,
-	       board_info[ent->driver_data].name,
+	       rtl_chip_info[ent->driver_data].name,
 	       dev->base_addr,
 	       dev->dev_addr[0], dev->dev_addr[1],
 	       dev->dev_addr[2], dev->dev_addr[3],
 	       dev->dev_addr[4], dev->dev_addr[5], dev->irq);
 
+	rtl8169_hw_phy_config(dev);
+
+	dprintk("Set MAC Reg C+CR Offset 0x82h = 0x01h\n");
+	RTL_W8(0x82, 0x01);
+
+	if (tp->mac_version < RTL_GIGA_MAC_VER_E) {
+		dprintk("Set PCI Latency=0x40\n");
+		pci_write_config_byte(pdev, PCI_LATENCY_TIMER, 0x40);
+	}
+
+	if (tp->mac_version == RTL_GIGA_MAC_VER_D) {
+		dprintk("Set MAC Reg C+CR Offset 0x82h = 0x01h\n");
+		RTL_W8(0x82, 0x01);
+		dprintk("Set PHY Reg 0x0bh = 0x00h\n");
+		mdio_write(ioaddr, 0x0b, 0x0000); //w 0x0b 15 0 0
+	}
+
 	// if TBI is not endbled
 	if (!(RTL_R8(PHYstatus) & TBI_Enable)) {
 		int val = mdio_read(ioaddr, PHY_AUTO_NEGO_REG);
@@ -546,23 +860,23 @@
 			Cap10_100 = 0, Cap1000 = 0;
 			switch (option) {
 			case _10_Half:
-				Cap10_100 = PHY_Cap_10_Half;
+				Cap10_100 = PHY_Cap_10_Half_Or_Less;
 				Cap1000 = PHY_Cap_Null;
 				break;
 			case _10_Full:
-				Cap10_100 = PHY_Cap_10_Full;
+				Cap10_100 = PHY_Cap_10_Full_Or_Less;
 				Cap1000 = PHY_Cap_Null;
 				break;
 			case _100_Half:
-				Cap10_100 = PHY_Cap_100_Half;
+				Cap10_100 = PHY_Cap_100_Half_Or_Less;
 				Cap1000 = PHY_Cap_Null;
 				break;
 			case _100_Full:
-				Cap10_100 = PHY_Cap_100_Full;
+				Cap10_100 = PHY_Cap_100_Full_Or_Less;
 				Cap1000 = PHY_Cap_Null;
 				break;
 			case _1000_Full:
-				Cap10_100 = PHY_Cap_Null;
+				Cap10_100 = PHY_Cap_100_Full_Or_Less;
 				Cap1000 = PHY_Cap_1000_Full;
 				break;
 			default:
@@ -576,9 +890,7 @@
 
 			// enable 10/100 Full/Half Mode, leave PHY_AUTO_NEGO_REG bit4:0 unchanged
 			mdio_write(ioaddr, PHY_AUTO_NEGO_REG,
-				   PHY_Cap_10_Half | PHY_Cap_10_Full |
-				   PHY_Cap_100_Half | PHY_Cap_100_Full | (val &
-									  0x1F));
+				   PHY_Cap_100_Full_Or_Less | (val & 0x1f));
 
 			// enable 1000 Full Mode
 			mdio_write(ioaddr, PHY_1000_CTRL_REG,
@@ -647,56 +959,96 @@
 	pci_set_drvdata(pdev, NULL);
 }
 
+#ifdef CONFIG_PM
+
+static int rtl8169_suspend(struct pci_dev *pdev, u32 state)
+{
+	struct net_device *dev = pci_get_drvdata(pdev);
+	struct rtl8169_private *tp = dev->priv;
+	void *ioaddr = tp->mmio_addr;
+	unsigned long flags;
+
+	if (!netif_running(dev))
+		return 0;
+	
+	netif_device_detach(dev);
+	netif_stop_queue(dev);
+	spin_lock_irqsave(&tp->lock, flags);
+
+	/* Disable interrupts, stop Rx and Tx */
+	RTL_W16(IntrMask, 0);
+	RTL_W8(ChipCmd, 0);
+		
+	/* Update the error counts. */
+	tp->stats.rx_missed_errors += RTL_R32(RxMissed);
+	RTL_W32(RxMissed, 0);
+	spin_unlock_irqrestore(&tp->lock, flags);
+	
+	return 0;
+}
+
+static int rtl8169_resume(struct pci_dev *pdev)
+{
+	struct net_device *dev = pci_get_drvdata(pdev);
+
+	if (!netif_running(dev))
+	    return 0;
+
+	netif_device_attach(dev);
+	rtl8169_hw_start(dev);
+
+	return 0;
+}
+                                                                                
+#endif /* CONFIG_PM */
+
 static int
 rtl8169_open(struct net_device *dev)
 {
 	struct rtl8169_private *tp = dev->priv;
+	struct pci_dev *pdev = tp->pci_dev;
 	int retval;
-	u8 diff;
-	u32 TxPhyAddr, RxPhyAddr;
 
 	retval =
 	    request_irq(dev->irq, rtl8169_interrupt, SA_SHIRQ, dev->name, dev);
-	if (retval) {
-		return retval;
-	}
+	if (retval < 0)
+		goto out;
 
-	tp->TxDescArrays =
-	    kmalloc(NUM_TX_DESC * sizeof (struct TxDesc) + 256, GFP_KERNEL);
-	// Tx Desscriptor needs 256 bytes alignment;
-	TxPhyAddr = virt_to_bus(tp->TxDescArrays);
-	diff = 256 - (TxPhyAddr - ((TxPhyAddr >> 8) << 8));
-	TxPhyAddr += diff;
-	tp->TxDescArray = (struct TxDesc *) (tp->TxDescArrays + diff);
-
-	tp->RxDescArrays =
-	    kmalloc(NUM_RX_DESC * sizeof (struct RxDesc) + 256, GFP_KERNEL);
-	// Rx Desscriptor needs 256 bytes alignment;
-	RxPhyAddr = virt_to_bus(tp->RxDescArrays);
-	diff = 256 - (RxPhyAddr - ((RxPhyAddr >> 8) << 8));
-	RxPhyAddr += diff;
-	tp->RxDescArray = (struct RxDesc *) (tp->RxDescArrays + diff);
+	retval = -ENOMEM;
 
-	if (tp->TxDescArrays == NULL || tp->RxDescArrays == NULL) {
-		printk(KERN_INFO
-		       "Allocate RxDescArray or TxDescArray failed\n");
-		free_irq(dev->irq, dev);
-		if (tp->TxDescArrays)
-			kfree(tp->TxDescArrays);
-		if (tp->RxDescArrays)
-			kfree(tp->RxDescArrays);
-		return -ENOMEM;
-	}
-	tp->RxBufferRings = kmalloc(RX_BUF_SIZE * NUM_RX_DESC, GFP_KERNEL);
-	if (tp->RxBufferRings == NULL) {
-		printk(KERN_INFO "Allocate RxBufferRing failed\n");
-	}
+	/*
+	 * Rx and Tx desscriptors needs 256 bytes alignment.
+	 * pci_alloc_consistent provides more.
+	 */
+	tp->TxDescArray = pci_alloc_consistent(pdev, R8169_TX_RING_BYTES,
+					       &tp->TxPhyAddr);
+	if (!tp->TxDescArray)
+		goto err_free_irq;
+
+	tp->RxDescArray = pci_alloc_consistent(pdev, R8169_RX_RING_BYTES,
+					       &tp->RxPhyAddr);
+	if (!tp->RxDescArray)
+		goto err_free_tx;
+
+	retval = rtl8169_init_ring(dev);
+	if (retval < 0)
+		goto err_free_rx;
 
-	rtl8169_init_ring(dev);
 	rtl8169_hw_start(dev);
 
-	return 0;
-
+	rtl8169_request_timer(dev);
+out:
+	return retval;
+
+err_free_rx:
+	pci_free_consistent(pdev, R8169_RX_RING_BYTES, tp->RxDescArray,
+			    tp->RxPhyAddr);
+err_free_tx:
+	pci_free_consistent(pdev, R8169_TX_RING_BYTES, tp->TxDescArray,
+			    tp->TxPhyAddr);
+err_free_irq:
+	free_irq(dev->irq, dev);
+	goto out;
 }
 
 static void
@@ -733,11 +1085,17 @@
 	RTL_W32(TxConfig,
 		(TX_DMA_BURST << TxDMAShift) | (InterFrameGap <<
 						TxInterFrameGapShift));
+	RTL_W16(CPlusCmd, RTL_R16(CPlusCmd));
+
+	if (tp->mac_version == RTL_GIGA_MAC_VER_D) {
+		dprintk(KERN_INFO PFX "Set MAC Reg C+CR Offset 0xE0: bit-3 and bit-14 MUST be 1\n");
+		RTL_W16(CPlusCmd, RTL_R16(CPlusCmd) | (1 << 14) | (1 << 3));
+	}
 
 	tp->cur_rx = 0;
 
-	RTL_W32(TxDescStartAddr, virt_to_bus(tp->TxDescArray));
-	RTL_W32(RxDescStartAddr, virt_to_bus(tp->RxDescArray));
+	RTL_W32(TxDescStartAddr, tp->TxPhyAddr);
+	RTL_W32(RxDescStartAddr, tp->RxPhyAddr);
 	RTL_W8(Cfg9346, Cfg9346_Lock);
 	udelay(10);
 
@@ -755,31 +1113,131 @@
 
 }
 
-static void
-rtl8169_init_ring(struct net_device *dev)
+static inline void rtl8169_make_unusable_by_asic(struct RxDesc *desc)
+{
+	desc->buf_addr = 0xdeadbeef;
+	desc->status &= ~cpu_to_le32(OWNbit | RsvdMask);
+}
+
+static void rtl8169_free_rx_skb(struct pci_dev *pdev, struct sk_buff **sk_buff,
+				struct RxDesc *desc)
+{
+	pci_unmap_single(pdev, le32_to_cpu(desc->buf_addr), RX_BUF_SIZE,
+			 PCI_DMA_FROMDEVICE);
+	dev_kfree_skb(*sk_buff);
+	*sk_buff = NULL;
+	rtl8169_make_unusable_by_asic(desc);
+}
+
+static inline void rtl8169_return_to_asic(struct RxDesc *desc)
+{
+	desc->status |= cpu_to_le32(OWNbit + RX_BUF_SIZE);
+}
+
+static inline void rtl8169_give_to_asic(struct RxDesc *desc, dma_addr_t mapping)
+{
+	desc->buf_addr = cpu_to_le32(mapping);
+	desc->status |= cpu_to_le32(OWNbit + RX_BUF_SIZE);
+}
+
+static int rtl8169_alloc_rx_skb(struct pci_dev *pdev, struct net_device *dev,
+				struct sk_buff **sk_buff, struct RxDesc *desc)
+{
+	struct sk_buff *skb;
+	dma_addr_t mapping;
+	int ret = 0;
+
+	skb = dev_alloc_skb(RX_BUF_SIZE);
+	if (!skb)
+		goto err_out;
+
+	skb->dev = dev;
+	skb_reserve(skb, 2);
+	*sk_buff = skb;
+
+	mapping = pci_map_single(pdev, skb->tail, RX_BUF_SIZE,
+				 PCI_DMA_FROMDEVICE);
+
+	rtl8169_give_to_asic(desc, mapping);
+
+out:
+	return ret;
+
+err_out:
+	ret = -ENOMEM;
+	rtl8169_make_unusable_by_asic(desc);
+	goto out;
+}
+
+static void rtl8169_rx_clear(struct rtl8169_private *tp)
 {
-	struct rtl8169_private *tp = dev->priv;
 	int i;
 
-	tp->cur_rx = 0;
-	tp->cur_tx = 0;
-	tp->dirty_tx = 0;
+	for (i = 0; i < NUM_RX_DESC; i++) {
+		if (tp->Rx_skbuff[i]) {
+			rtl8169_free_rx_skb(tp->pci_dev, tp->Rx_skbuff + i,
+					    tp->RxDescArray + i);
+		}
+	}
+}
+
+static u32 rtl8169_rx_fill(struct rtl8169_private *tp, struct net_device *dev,
+			   u32 start, u32 end)
+{
+	u32 cur;
+	
+	for (cur = start; end - cur > 0; cur++) {
+		int ret, i = cur % NUM_RX_DESC;
+
+		if (tp->Rx_skbuff[i])
+			continue;
+			
+		ret = rtl8169_alloc_rx_skb(tp->pci_dev, dev, tp->Rx_skbuff + i,
+					   tp->RxDescArray + i);
+		if (ret < 0)
+			break;
+	}
+	return cur - start;
+}
+
+static inline void rtl8169_mark_as_last_descriptor(struct RxDesc *desc)
+{
+	desc->status |= cpu_to_le32(EORbit);
+}
+
+static int rtl8169_init_ring(struct net_device *dev)
+{
+	struct rtl8169_private *tp = dev->priv;
+
+	tp->cur_rx = tp->dirty_rx = 0;
+	tp->cur_tx = tp->dirty_tx = 0;
 	memset(tp->TxDescArray, 0x0, NUM_TX_DESC * sizeof (struct TxDesc));
 	memset(tp->RxDescArray, 0x0, NUM_RX_DESC * sizeof (struct RxDesc));
 
-	for (i = 0; i < NUM_TX_DESC; i++) {
-		tp->Tx_skbuff[i] = NULL;
-	}
-	for (i = 0; i < NUM_RX_DESC; i++) {
-		if (i == (NUM_RX_DESC - 1))
-			tp->RxDescArray[i].status =
-			    (OWNbit | EORbit) + RX_BUF_SIZE;
-		else
-			tp->RxDescArray[i].status = OWNbit + RX_BUF_SIZE;
+	memset(tp->Tx_skbuff, 0x0, NUM_TX_DESC * sizeof(struct sk_buff *));
+	memset(tp->Rx_skbuff, 0x0, NUM_RX_DESC * sizeof(struct sk_buff *));
 
-		tp->RxBufferRing[i] = &(tp->RxBufferRings[i * RX_BUF_SIZE]);
-		tp->RxDescArray[i].buf_addr = virt_to_bus(tp->RxBufferRing[i]);
-	}
+	if (rtl8169_rx_fill(tp, dev, 0, NUM_RX_DESC) != NUM_RX_DESC)
+		goto err_out;
+
+	rtl8169_mark_as_last_descriptor(tp->RxDescArray + NUM_RX_DESC - 1);
+
+	return 0;
+
+err_out:
+	rtl8169_rx_clear(tp);
+	return -ENOMEM;
+}
+
+static void rtl8169_unmap_tx_skb(struct pci_dev *pdev, struct sk_buff **sk_buff,
+				 struct TxDesc *desc)
+{
+	u32 len = sk_buff[0]->len;
+
+	pci_unmap_single(pdev, le32_to_cpu(desc->buf_addr),
+			 len < ETH_ZLEN ? ETH_ZLEN : len, PCI_DMA_TODEVICE);
+	desc->buf_addr = 0x00;
+	*sk_buff = NULL;
 }
 
 static void
@@ -789,9 +1247,12 @@
 
 	tp->cur_tx = 0;
 	for (i = 0; i < NUM_TX_DESC; i++) {
-		if (tp->Tx_skbuff[i] != NULL) {
-			dev_kfree_skb(tp->Tx_skbuff[i]);
-			tp->Tx_skbuff[i] = NULL;
+		struct sk_buff *skb = tp->Tx_skbuff[i];
+
+		if (skb) {
+			rtl8169_unmap_tx_skb(tp->pci_dev, tp->Tx_skbuff + i,
+					     tp->TxDescArray + i);
+			dev_kfree_skb(skb);
 			tp->stats.tx_dropped++;
 		}
 	}
@@ -829,49 +1290,58 @@
 	struct rtl8169_private *tp = dev->priv;
 	void *ioaddr = tp->mmio_addr;
 	int entry = tp->cur_tx % NUM_TX_DESC;
+	u32 len = skb->len;
 
-	if (skb->len < ETH_ZLEN) {
+	if (unlikely(skb->len < ETH_ZLEN)) {
 		skb = skb_padto(skb, ETH_ZLEN);
-		if (skb == NULL)
-			return 0;
+		if (!skb)
+			goto err_update_stats;
+		len = ETH_ZLEN;
 	}
 	
 	spin_lock_irq(&tp->lock);
 
-	if ((tp->TxDescArray[entry].status & OWNbit) == 0) {
+	if (!(le32_to_cpu(tp->TxDescArray[entry].status) & OWNbit)) {
+		dma_addr_t mapping;
+
+		mapping = pci_map_single(tp->pci_dev, skb->data, len,
+					 PCI_DMA_TODEVICE);
+
 		tp->Tx_skbuff[entry] = skb;
-		tp->TxDescArray[entry].buf_addr = virt_to_bus(skb->data);
-		if (entry != (NUM_TX_DESC - 1))
-			tp->TxDescArray[entry].status =
-			    (OWNbit | FSbit | LSbit) | ((skb->len > ETH_ZLEN) ?
-							skb->len : ETH_ZLEN);
-		else
-			tp->TxDescArray[entry].status =
-			    (OWNbit | EORbit | FSbit | LSbit) |
-			    ((skb->len > ETH_ZLEN) ? skb->len : ETH_ZLEN);
+		tp->TxDescArray[entry].buf_addr = cpu_to_le32(mapping);
 
+		tp->TxDescArray[entry].status = cpu_to_le32(OWNbit | FSbit |
+			LSbit | len | (EORbit * !((entry + 1) % NUM_TX_DESC)));
+			
 		RTL_W8(TxPoll, 0x40);	//set polling bit
 
 		dev->trans_start = jiffies;
 
 		tp->cur_tx++;
-	}
+	} else
+		goto err_drop;
 
-	spin_unlock_irq(&tp->lock);
 
 	if ((tp->cur_tx - NUM_TX_DESC) == tp->dirty_tx) {
 		netif_stop_queue(dev);
 	}
+out:
+	spin_unlock_irq(&tp->lock);
 
 	return 0;
+
+err_drop:
+	dev_kfree_skb(skb);
+err_update_stats:
+	tp->stats.tx_dropped++;
+	goto out;
 }
 
 static void
 rtl8169_tx_interrupt(struct net_device *dev, struct rtl8169_private *tp,
 		     void *ioaddr)
 {
-	unsigned long dirty_tx, tx_left = 0;
-	int entry = tp->cur_tx % NUM_TX_DESC;
+	unsigned long dirty_tx, tx_left;
 
 	assert(dev != NULL);
 	assert(tp != NULL);
@@ -881,14 +1351,21 @@
 	tx_left = tp->cur_tx - dirty_tx;
 
 	while (tx_left > 0) {
-		if ((tp->TxDescArray[entry].status & OWNbit) == 0) {
-			dev_kfree_skb_irq(tp->
-					  Tx_skbuff[dirty_tx % NUM_TX_DESC]);
-			tp->Tx_skbuff[dirty_tx % NUM_TX_DESC] = NULL;
+		int entry = dirty_tx % NUM_TX_DESC;
+
+		if (!(le32_to_cpu(tp->TxDescArray[entry].status) & OWNbit)) {
+			struct sk_buff *skb = tp->Tx_skbuff[entry];
+
+			/* FIXME: is it really accurate for TxErr ? */
+			tp->stats.tx_bytes += skb->len >= ETH_ZLEN ?
+					      skb->len : ETH_ZLEN;
 			tp->stats.tx_packets++;
+			rtl8169_unmap_tx_skb(tp->pci_dev, tp->Tx_skbuff + entry,
+					     tp->TxDescArray + entry);
+			dev_kfree_skb_irq(skb);
+			tp->Tx_skbuff[entry] = NULL;
 			dirty_tx++;
 			tx_left--;
-			entry++;
 		}
 	}
 
@@ -899,70 +1376,95 @@
 	}
 }
 
+static inline int rtl8169_try_rx_copy(struct sk_buff **sk_buff, int pkt_size,
+				      struct RxDesc *desc,
+				      struct net_device *dev)
+{
+	int ret = -1;
+
+	if (pkt_size < rx_copybreak) {
+		struct sk_buff *skb;
+
+		skb = dev_alloc_skb(pkt_size + 2);
+		if (skb) {
+			skb->dev = dev;
+			skb_reserve(skb, 2);
+			eth_copy_and_sum(skb, sk_buff[0]->tail, pkt_size, 0);
+			*sk_buff = skb;
+			rtl8169_return_to_asic(desc);
+			ret = 0;
+		}
+	}
+	return ret;
+}
+
 static void
 rtl8169_rx_interrupt(struct net_device *dev, struct rtl8169_private *tp,
 		     void *ioaddr)
 {
-	int cur_rx;
-	struct sk_buff *skb;
-	int pkt_size = 0;
+	int cur_rx, delta;
 
 	assert(dev != NULL);
 	assert(tp != NULL);
 	assert(ioaddr != NULL);
 
-	cur_rx = tp->cur_rx;
+	cur_rx = tp->cur_rx % NUM_RX_DESC;
 
-	while ((tp->RxDescArray[cur_rx].status & OWNbit) == 0) {
+	while (!(le32_to_cpu(tp->RxDescArray[cur_rx].status) & OWNbit)) {
+		u32 status = le32_to_cpu(tp->RxDescArray[cur_rx].status);
 
-		if (tp->RxDescArray[cur_rx].status & RxRES) {
+		if (status & RxRES) {
 			printk(KERN_INFO "%s: Rx ERROR!!!\n", dev->name);
 			tp->stats.rx_errors++;
-			if (tp->RxDescArray[cur_rx].status & (RxRWT | RxRUNT))
+			if (status & (RxRWT | RxRUNT))
 				tp->stats.rx_length_errors++;
-			if (tp->RxDescArray[cur_rx].status & RxCRC)
+			if (status & RxCRC)
 				tp->stats.rx_crc_errors++;
 		} else {
-			pkt_size =
-			    (int) (tp->RxDescArray[cur_rx].
-				   status & 0x00001FFF) - 4;
-			skb = dev_alloc_skb(pkt_size + 2);
-			if (skb != NULL) {
-				skb->dev = dev;
-				skb_reserve(skb, 2);	// 16 byte align the IP fields. //
-				eth_copy_and_sum(skb, tp->RxBufferRing[cur_rx],
-						 pkt_size, 0);
-				skb_put(skb, pkt_size);
-				skb->protocol = eth_type_trans(skb, dev);
-				netif_rx(skb);
-
-				if (cur_rx == (NUM_RX_DESC - 1))
-					tp->RxDescArray[cur_rx].status =
-					    (OWNbit | EORbit) + RX_BUF_SIZE;
-				else
-					tp->RxDescArray[cur_rx].status =
-					    OWNbit + RX_BUF_SIZE;
-
-				tp->RxDescArray[cur_rx].buf_addr =
-				    virt_to_bus(tp->RxBufferRing[cur_rx]);
-				dev->last_rx = jiffies;
-				tp->stats.rx_bytes += pkt_size;
-				tp->stats.rx_packets++;
-			} else {
-				printk(KERN_WARNING
-				       "%s: Memory squeeze, deferring packet.\n",
-				       dev->name);
-				/* We should check that some rx space is free.
-				   If not, free one and mark stats->rx_dropped++. */
-				tp->stats.rx_dropped++;
+			struct RxDesc *desc = tp->RxDescArray + cur_rx;
+			struct sk_buff *skb = tp->Rx_skbuff[cur_rx];
+			int pkt_size = (status & 0x00001FFF) - 4;
+
+			pci_dma_sync_single(tp->pci_dev,
+					    le32_to_cpu(desc->buf_addr),
+					    RX_BUF_SIZE, PCI_DMA_FROMDEVICE);
+
+			if (rtl8169_try_rx_copy(&skb, pkt_size, desc, dev)) {
+				pci_unmap_single(tp->pci_dev,
+						 le32_to_cpu(desc->buf_addr),
+						 RX_BUF_SIZE,
+						 PCI_DMA_FROMDEVICE);
+				tp->Rx_skbuff[cur_rx] = NULL;
 			}
-		}
-
-		cur_rx = (cur_rx + 1) % NUM_RX_DESC;
-
-	}
 
-	tp->cur_rx = cur_rx;
+			skb_put(skb, pkt_size);
+			skb->protocol = eth_type_trans(skb, dev);
+			netif_rx(skb);
+
+			dev->last_rx = jiffies;
+			tp->stats.rx_bytes += pkt_size;
+			tp->stats.rx_packets++;
+		}
+		
+		tp->cur_rx++; 
+		cur_rx = tp->cur_rx % NUM_RX_DESC;
+	}
+
+	delta = rtl8169_rx_fill(tp, dev, tp->dirty_rx, tp->cur_rx);
+	if (delta > 0)
+		tp->dirty_rx += delta;
+	else if (delta < 0)
+		printk(KERN_INFO "%s: no Rx buffer allocated\n", dev->name);
+
+	/*
+	 * FIXME: until there is periodic timer to try and refill the ring,
+	 * a temporary shortage may definitely kill the Rx process.
+	 * - disable the asic to try and avoid an overflow and kick it again
+	 *   after refill ?
+	 * - how do others driver handle this condition (Uh oh...).
+	 */
+	if (tp->dirty_rx + NUM_RX_DESC == tp->cur_rx)
+		printk(KERN_EMERG "%s: Rx buffers exhausted\n", dev->name);
 }
 
 /* The interrupt handler does all of the Rx thread work and cleans up after the Tx thread. */
@@ -991,9 +1493,7 @@
 		RTL_W16(IntrStatus,
 			(status & RxFIFOOver) ? (status | RxOverflow) : status);
 
-		if ((status &
-		     (SYSErr | PCSTimeout | RxUnderrun | RxOverflow | RxFIFOOver
-		      | TxErr | TxOK | RxErr | RxOK)) == 0)
+		if (!(status & rtl8169_intr_mask))
 			break;
 
 		// Rx interrupt 
@@ -1023,11 +1523,13 @@
 rtl8169_close(struct net_device *dev)
 {
 	struct rtl8169_private *tp = dev->priv;
+	struct pci_dev *pdev = tp->pci_dev;
 	void *ioaddr = tp->mmio_addr;
-	int i;
 
 	netif_stop_queue(dev);
 
+	rtl8169_delete_timer(dev);
+
 	spin_lock_irq(&tp->lock);
 
 	/* Stop the chip's Tx and Rx DMA processes. */
@@ -1046,16 +1548,15 @@
 	free_irq(dev->irq, dev);
 
 	rtl8169_tx_clear(tp);
-	kfree(tp->TxDescArrays);
-	kfree(tp->RxDescArrays);
-	tp->TxDescArrays = NULL;
-	tp->RxDescArrays = NULL;
+
+	rtl8169_rx_clear(tp);
+
+	pci_free_consistent(pdev, R8169_RX_RING_BYTES, tp->RxDescArray,
+			    tp->RxPhyAddr);
+	pci_free_consistent(pdev, R8169_TX_RING_BYTES, tp->TxDescArray,
+			    tp->TxPhyAddr);
 	tp->TxDescArray = NULL;
 	tp->RxDescArray = NULL;
-	kfree(tp->RxBufferRings);
-	for (i = 0; i < NUM_RX_DESC; i++) {
-		tp->RxBufferRing[i] = NULL;
-	}
 
 	return 0;
 }
@@ -1109,11 +1610,26 @@
 	spin_unlock_irqrestore(&tp->lock, flags);
 }
 
+/**
+ *  rtl8169_get_stats - Get rtl8169 read/write statistics
+ *  @dev: The Ethernet Device to get statistics for
+ *
+ *  Get TX/RX statistics for rtl8169
+ */
 struct net_device_stats *
 rtl8169_get_stats(struct net_device *dev)
 {
 	struct rtl8169_private *tp = dev->priv;
+	void *ioaddr = tp->mmio_addr;
+	unsigned long flags;
 
+	if (netif_running(dev)) {
+		spin_lock_irqsave(&tp->lock, flags);
+		tp->stats.rx_missed_errors += RTL_R32(RxMissed);
+		RTL_W32(RxMissed, 0);
+		spin_unlock_irqrestore(&tp->lock, flags);
+	}
+		
 	return &tp->stats;
 }
 
@@ -1122,8 +1638,10 @@
 	.id_table	= rtl8169_pci_tbl,
 	.probe		= rtl8169_init_one,
 	.remove		= __devexit_p(rtl8169_remove_one),
-	.suspend	= NULL,
-	.resume		= NULL,
+#ifdef CONFIG_PM
+	.suspend	= rtl8169_suspend,
+	.resume		= rtl8169_resume,
+#endif
 };
 
 static int __init
--- diff/drivers/net/saa9730.c	2003-09-30 15:46:15.000000000 +0100
+++ source/drivers/net/saa9730.c	2004-02-09 10:39:53.000000000 +0000
@@ -996,11 +996,11 @@
         struct net_device *dev = pci_get_drvdata(pdev);
 
         if (dev) {
-		
+                unregister_netdev(dev);
+
 		if (dev->priv)
 			kfree(dev->priv);
 
-                unregister_netdev(dev);
                 free_netdev(dev);
                 pci_release_regions(pdev);
                 pci_disable_device(pdev);
@@ -1015,17 +1015,10 @@
 	unsigned char ethernet_addr[6];
 	int ret = 0;
 
-	dev = init_etherdev(dev, 0);
-
-	if (!dev) 
-		return -ENOMEM;
-	
 	dev->open = lan_saa9730_open_fail;
 
-	if (get_ethernet_addr(ethernet_addr)) {
-		ret = -ENODEV;
-		goto out;
-	}
+	if (get_ethernet_addr(ethernet_addr))
+		return -ENODEV;
 	
 	memcpy(dev->dev_addr, ethernet_addr, 6);
 	dev->base_addr = ioaddr;
@@ -1035,15 +1028,16 @@
 	 * Make certain the data structures used by the controller are aligned 
 	 * and DMAble. 
 	 */
+	/*
+	 *  XXX: that is obviously broken - kfree() won't be happy with us.
+	 */
 	lp = (struct lan_saa9730_private *) (((unsigned long)
 					      kmalloc(sizeof(*lp) + 7,
 						      GFP_DMA | GFP_KERNEL)
 					      + 7) & ~7);
 
-	if (!lp) {
-		ret = -ENOMEM;
-                goto out;
-        }
+	if (!lp)
+		return -ENOMEM;
 
 	dev->priv = lp;
 	memset(lp, 0, sizeof(*lp));
@@ -1057,6 +1051,7 @@
 							 SAA9730_EVM_REGS_ADDR);
 
 	/* Allocate LAN RX/TX frame buffer space. */
+	/* FIXME: a leak */
 	if ((ret = lan_saa9730_allocate_buffers(lp)))
 		goto out;
 
@@ -1095,63 +1090,69 @@
 	dev->watchdog_timeo = (HZ >> 1);
 	dev->dma = 0;
 	
+	ret = register_netdev(dev);
+	if (ret)
+		goto out;
 	return 0;
 
  out:
-	if (dev) {
-		if (dev->priv)
-			kfree(dev->priv);
-		unregister_netdevice(dev);
-		free_netdev(dev);
-	}
-		
+	if (dev->priv)
+		kfree(dev->priv);
 	return ret;
 }
 
 
 static int __devinit saa9730_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 {
-	struct net_device *dev = NULL;
+	struct net_device *dev;
 	unsigned int pci_ioaddr;
 	int err;
 
 	if (lan_saa9730_debug > 1)
 		printk("saa9730.c: PCI bios is present, checking for devices...\n");
 
+	err = -ENOMEM;
+	dev = alloc_etherdev(0);
+	if (!dev)
+		goto out;
+
+	SET_MODULE_OWNER(dev);
+
 	err = pci_enable_device(pdev);
         if (err) {
                 printk(KERN_ERR "Cannot enable PCI device, aborting.\n");
-                goto out;
+                goto out1;
         }
 
 	err = pci_request_regions(pdev, DRV_MODULE_NAME);
 	if (err) {
 		printk(KERN_ERR "Cannot obtain PCI resources, aborting.\n");
-		goto out_disable_pdev;
+		goto out2;
 	}
 
 	pci_irq_line = pdev->irq;
 	/* LAN base address in located at BAR 1. */
-	
+
 	pci_ioaddr = pci_resource_start(pdev, 1);
 	pci_set_master(pdev);
-	
+
 	printk("Found SAA9730 (PCI) at %#x, irq %d.\n",
 	       pci_ioaddr, pci_irq_line);
 
 	err = lan_saa9730_init(dev, pci_ioaddr, pci_irq_line);
 	if (err) {
 		printk("Lan init failed");
-		goto out_disable_pdev;
+		goto out2;
 	}
-	
+
 	pci_set_drvdata(pdev, dev);
 	return 0;
 	
- out_disable_pdev:
+out2:
 	pci_disable_device(pdev);
- out:
-	pci_set_drvdata(pdev, NULL);
+out1:
+	free_netdev(dev);
+out:
 	return err;
 }
 
--- diff/drivers/net/sb1250-mac.c	2003-08-26 10:00:53.000000000 +0100
+++ source/drivers/net/sb1250-mac.c	2004-02-09 10:39:53.000000000 +0000
@@ -2372,6 +2372,7 @@
 	unsigned char *eaddr;
 	uint64_t ea_reg;
 	int i;
+	int err;
 	
 	sc = (struct sbmac_softc *)dev->priv;
 	
@@ -2430,7 +2431,6 @@
 	
 	spin_lock_init(&(sc->sbm_lock));
 	
-	ether_setup(dev);
 	dev->open               = sbmac_open;
 	dev->hard_start_xmit    = sbmac_start_tx;
 	dev->stop               = sbmac_close;
@@ -2444,8 +2444,11 @@
 
 	/* This is needed for PASS2 for Rx H/W checksum feature */
 	sbmac_set_iphdr_offset(sc);
-	
-	return 0;
+
+	err = register_netdev(dev);
+	if (err)
+		sbmac_uninitctx(sc);
+	return err;
 }
 
 
@@ -2811,13 +2814,12 @@
 }
 #endif
 
-static struct net_device *dev_sbmac[MAX_UNITS] = {0,0,0};
+static struct net_device *dev_sbmac[MAX_UNITS];
 
 static int __init
 sbmac_init_module(void)
 {
 	int idx;
-	int macidx = 0;
 	struct net_device *dev;
 	sbmac_port_t port;
 	int chip_max_units;
@@ -2884,26 +2886,24 @@
 		 * Okay, cool.  Initialize this MAC.
 		 */
 
-		dev = init_etherdev(NULL,sizeof(struct sbmac_softc));
+		dev = alloc_etherdev(sizeof(struct sbmac_softc));
 		if (!dev) 
-		  return -ENOMEM;	/* return ENOMEM */
+			return -ENOMEM;	/* return ENOMEM */
 
 		printk(KERN_DEBUG "sbmac: configuring MAC at %lx\n", port);
 
 		dev->irq = K_INT_MAC_0 + idx;
 		dev->base_addr = port;
 		dev->mem_end = 0;
-		/*dev->init = sbmac_init;*/
-		sbmac_init(dev, macidx);
-
-		dev_sbmac[macidx] = dev;
-		macidx++;
+		if (sbmac_init(dev, idx)) {
+			port = A_MAC_CHANNEL_BASE(idx);
+			SBMAC_WRITECSR(KSEG1ADDR(port+R_MAC_ETHERNET_ADDR),
+					sbmac_orig_hwaddr[idx] );
+			free_netdev(dev);
+			continue;
+		}
+		dev_sbmac[idx++] = dev;
 	}
-
-	/*
-	 * Should we care, 'macidx' is the total number of enabled MACs.
-	 */
-	
 	return 0;
 }
 
@@ -2916,21 +2916,12 @@
 	sbmac_port_t port;
 	for (idx = 0; idx < MAX_UNITS; idx++) {
 		dev = dev_sbmac[idx];
-		if (dev == NULL)
-			continue;
-		if (dev->priv != NULL) {
-			struct sbmac_softc *sc = (struct sbmac_softc *) dev->priv;
-			
+		if (!dev) {
+			struct sbmac_softc *sc = dev->priv;
 			unregister_netdev(dev);
-			
 			sbmac_uninitctx(sc);
-			
+			free_netdev(dev);
 		}
-
-	        port = A_MAC_CHANNEL_BASE(idx);
-		SBMAC_WRITECSR(KSEG1ADDR(port+R_MAC_ETHERNET_ADDR), sbmac_orig_hwaddr[idx] );
-		free_netdev(dev);
-		dev_sbmac[idx] = NULL;
 	}
 }
 
--- diff/drivers/net/seeq8005.c	2003-09-17 12:28:08.000000000 +0100
+++ source/drivers/net/seeq8005.c	2004-02-09 10:39:53.000000000 +0000
@@ -78,8 +78,6 @@
 
 /* Index to functions, as function prototypes. */
 
-extern int seeq8005_probe(struct net_device *dev);
-
 static int seeq8005_probe1(struct net_device *dev, int ioaddr);
 static int seeq8005_open(struct net_device *dev);
 static void seeq8005_timeout(struct net_device *dev);
@@ -102,22 +100,48 @@
    If dev->base_addr == 1, always return failure.
    */
 
-int __init 
-seeq8005_probe(struct net_device *dev)
-{
-	int i;
-	int base_addr = dev ? dev->base_addr : 0;
-
-	if (base_addr > 0x1ff)		/* Check a single specified location. */
-		return seeq8005_probe1(dev, base_addr);
-	else if (base_addr != 0)	/* Don't probe at all. */
-		return -ENXIO;
-
-	for (i = 0; seeq8005_portlist[i]; i++)
-		if (seeq8005_probe1(dev, seeq8005_portlist[i]) == 0)
-			return 0;
+static int io = 0x320;
+static int irq = 10;
 
-	return -ENODEV;
+struct net_device * __init seeq8005_probe(int unit)
+{
+	struct net_device *dev = alloc_etherdev(sizeof(struct net_local));
+	unsigned *port;
+	int err = 0;
+
+	if (!dev)
+		return ERR_PTR(-ENODEV);
+
+	if (unit >= 0) {
+		sprintf(dev->name, "eth%d", unit);
+		netdev_boot_setup_check(dev);
+		io = dev->base_addr;
+		irq = dev->irq;
+	}
+
+	if (io > 0x1ff) {	/* Check a single specified location. */
+		err = seeq8005_probe1(dev, io);
+	} else if (io != 0) {	/* Don't probe at all. */
+		err = -ENXIO;
+	} else {
+		for (port = seeq8005_portlist; *port; port++) {
+			if (seeq8005_probe1(dev, *port) == 0)
+				break;
+		}
+		if (!*port)
+			err = -ENODEV;
+	}
+	if (err)
+		goto out;
+	err = register_netdev(dev);
+	if (err)
+		goto out1;
+	return dev;
+out1:
+	release_region(dev->base_addr, SEEQ8005_IO_EXTENT);
+out:
+	free_netdev(dev);
+	return ERR_PTR(err);
 }
 
 /* This is the real probe routine.  Linux has a history of friendly device
@@ -274,6 +298,7 @@
 
 	/* Fill in the 'dev' fields. */
 	dev->base_addr = ioaddr;
+	dev->irq = irq;
 
 	/* Retrieve and print the ethernet address. */
 	for (i = 0; i < 6; i++)
@@ -307,13 +332,6 @@
 		 }
 	}
 #endif
-
-	/* Initialize the device structure. */
-	dev->priv = kmalloc(sizeof(struct net_local), GFP_KERNEL);
-	if (dev->priv == NULL)
-		return -ENOMEM;
-	memset(dev->priv, 0, sizeof(struct net_local));
-
 	dev->open		= seeq8005_open;
 	dev->stop		= seeq8005_close;
 	dev->hard_start_xmit 	= seeq8005_send_packet;
@@ -321,10 +339,6 @@
 	dev->watchdog_timeo	= HZ/20;
 	dev->get_stats		= seeq8005_get_stats;
 	dev->set_multicast_list = set_multicast_list;
-
-	/* Fill in the fields of the device structure with ethernet values. */
-	ether_setup(dev);
-	
 	dev->flags &= ~IFF_MULTICAST;
 
 	return 0;
@@ -721,9 +735,7 @@
 	
 #ifdef MODULE
 
-static struct net_device dev_seeq = { .init = seeq8005_probe };
-static int io = 0x320;
-static int irq = 10;
+static struct net_device *dev_seeq;
 MODULE_LICENSE("GPL");
 MODULE_PARM(io, "i");
 MODULE_PARM(irq, "i");
@@ -732,28 +744,17 @@
 
 int init_module(void)
 {
-	dev_seeq.irq=irq;
-	dev_seeq.base_addr=io;
-	if (register_netdev(&dev_seeq) != 0)
-		return -EIO;
+	dev_seeq = seeq8005_probe(-1);
+	if (IS_ERR(dev_seeq))
+		return PTR_ERR(dev_seeq);
 	return 0;
 }
 
 void cleanup_module(void)
 {
-	unregister_netdev(&dev_seeq);
-
-	/*
-	 *	Free up the private structure, or leak memory :-)
-	 */
-
-	kfree(dev_seeq.priv);
-	dev_seeq.priv = NULL;	/* gets re-allocated by el1_probe1 */
-
-	/*
-	 *	If we don't do this, we can't re-insmod it later.
-	 */
-	release_region(dev_seeq.base_addr, SEEQ8005_IO_EXTENT);
+	unregister_netdev(dev_seeq);
+	release_region(dev_seeq->base_addr, SEEQ8005_IO_EXTENT);
+	free_netdev(dev_seeq);
 }
 
 #endif /* MODULE */
--- diff/drivers/net/sgiseeq.c	2003-08-26 10:00:53.000000000 +0100
+++ source/drivers/net/sgiseeq.c	2004-02-09 10:39:53.000000000 +0000
@@ -600,6 +600,7 @@
 {
 	struct net_device *dev;
 	struct sgiseeq_private *sp;
+	int err = -ENOMEM;
 	int i;
 	
 	sp = (struct sgiseeq_private *) get_zeroed_page(GFP_KERNEL);
@@ -609,19 +610,17 @@
 		return -ENOMEM;
 	}
 
-	dev = init_etherdev(NULL, 0);
+	dev = alloc_etherdev(0);
 	if (!dev) {
 		printk (KERN_ERR
 			"Seeq8003: Could not allocate memory for device.\n");
-		free_page((unsigned long) sp);
-		return -ENOMEM;
+		goto out;
 	}
 
 	if (request_irq(irq, sgiseeq_interrupt, 0, sgiseeqstr, dev)) {
-		printk(KERN_ERR "Seeq8003: Can't get irq %d\n", dev->irq);
-		free_page((unsigned long) sp);
-		unregister_netdev(dev);
-		return -EAGAIN;
+		printk(KERN_ERR "Seeq8003: Can't get irq %d\n", irq);
+		err = -EAGAIN;
+		goto out1;
 	}
 
 	printk(KERN_INFO "%s: SGI Seeq8003 ", dev->name);
@@ -637,6 +636,8 @@
 	}
 	printk("\n");
 
+	SET_MODULE_OWNER(dev);
+
 	dev->priv = sp;
 #ifdef DEBUG
 	gpriv = sp;
@@ -677,12 +678,22 @@
 	dev->set_multicast_list   = sgiseeq_set_multicast;
 	dev->irq                  = irq;
 	dev->dma                  = 0;
-	ether_setup(dev);
+
+	err = register_netdev(dev);
+	if (err)
+		goto out2;
 
 	sp->next_module = root_sgiseeq_dev;
 	root_sgiseeq_dev = dev;
 
 	return 0;
+out2:
+	free_irq(dev->irq, dev);
+out1:
+	free_netdev(dev);
+out:
+	free_page((unsigned long) sp);
+	return err;
 }
 
 static int __init sgiseeq_probe(void)
@@ -701,9 +712,9 @@
 	while (dev) {
 		sp = (struct sgiseeq_private *) dev->priv;
 		next = sp->next_module;
+		unregister_netdev(dev);
 		free_irq(dev->irq, dev);
 		free_page((unsigned long) sp);
-		unregister_netdev(dev);
 		free_netdev(dev);
 		dev = next;
 	}
--- diff/drivers/net/shaper.c	2003-08-26 10:00:53.000000000 +0100
+++ source/drivers/net/shaper.c	2004-02-09 10:39:53.000000000 +0000
@@ -642,7 +642,6 @@
 
 	dev->open		= shaper_open;
 	dev->stop		= shaper_close;
-	dev->destructor 	= free_netdev;
 	dev->hard_start_xmit 	= shaper_start_xmit;
 	dev->get_stats 		= shaper_get_stats;
 	dev->set_multicast_list = NULL;
@@ -718,8 +717,10 @@
 		if (!dev) 
 			break;
 
-		if (register_netdev(dev))
+		if (register_netdev(dev)) {
+			free_netdev(dev);
 			break;
+		}
 
 		devs[i] = dev;
 		shapers_registered++;
@@ -737,9 +738,12 @@
 {
 	int i;
 
-	for (i = 0; i < shapers_registered; i++)
-		if (devs[i])
+	for (i = 0; i < shapers_registered; i++) {
+		if (devs[i]) {
 			unregister_netdev(devs[i]);
+			free_netdev(devs[i]);
+		}
+	}
 
 	kfree(devs);
 	devs = NULL;
--- diff/drivers/net/sk98lin/h/lm80.h	2003-08-20 14:16:30.000000000 +0100
+++ source/drivers/net/sk98lin/h/lm80.h	2004-02-09 10:39:53.000000000 +0000
@@ -2,8 +2,6 @@
  *
  * Name:	lm80.h	
  * Project:	Gigabit Ethernet Adapters, Common Modules
- * Version:	$Revision: 1.6 $
- * Date:	$Date: 2003/05/13 17:26:52 $
  * Purpose:	Contains all defines for the LM80 Chip
  *		(National Semiconductor).
  *
@@ -23,32 +21,6 @@
  *
  ******************************************************************************/
 
-/******************************************************************************
- *
- * History:
- *	$Log: lm80.h,v $
- *	Revision 1.6  2003/05/13 17:26:52  mkarl
- *	Editorial changes.
- *	
- *	Revision 1.5  2003/03/31 07:15:18  mkarl
- *	Corrected Copyright.
- *	Editorial changes.
- *	
- *	Revision 1.4  2002/04/25 11:04:10  rschmidt
- *	Editorial changes
- *	
- *	Revision 1.3  1999/11/22 13:41:19  cgoos
- *	Changed license header to GPL.
- *	
- *	Revision 1.2  1999/03/12 13:26:51  malthoff
- *	remove __STDC__.
- *	
- *	Revision 1.1  1998/06/19 09:28:31  malthoff
- *	created.
- *	
- *
- ******************************************************************************/
-
 #ifndef __INC_LM80_H
 #define __INC_LM80_H
 
--- diff/drivers/net/sk98lin/h/skaddr.h	2003-08-20 14:16:30.000000000 +0100
+++ source/drivers/net/sk98lin/h/skaddr.h	2004-02-09 10:39:53.000000000 +0000
@@ -2,8 +2,6 @@
  *
  * Name:	skaddr.h
  * Project:	Gigabit Ethernet Adapters, ADDR-Modul
- * Version:	$Revision: 1.29 $
- * Date:	$Date: 2003/05/13 16:57:24 $
  * Purpose:	Header file for Address Management (MC, UC, Prom).
  *
  ******************************************************************************/
@@ -24,112 +22,6 @@
 
 /******************************************************************************
  *
- * History:
- *
- *	$Log: skaddr.h,v $
- *	Revision 1.29  2003/05/13 16:57:24  mkarl
- *	Changes for SLIM driver.
- *	Editorial changes.
- *	
- *	Revision 1.28  2003/04/15 09:33:22  tschilli
- *	Copyright messages changed.
- *	
- *	Revision 1.27  2003/04/14 15:55:11  tschilli
- *	"#error C++ is not yet supported." removed.
- *	
- *	Revision 1.26  2002/11/15 07:24:42  tschilli
- *	SK_ADDR_EQUAL macro fixed.
- *	
- *	Revision 1.25  2002/06/10 13:55:18  tschilli
- *	Changes for handling YUKON.
- *	All changes are internally and not visible to the programmer
- *	using this module.
- *	
- *	Revision 1.24  2001/01/22 13:41:34  rassmann
- *	Supporting two nets on dual-port adapters.
- *	
- *	Revision 1.23  2000/08/10 11:27:50  rassmann
- *	Editorial changes.
- *	Preserving 32-bit alignment in structs for the adapter context.
- *	
- *	Revision 1.22  2000/08/07 11:10:40  rassmann
- *	Editorial changes.
- *	
- *	Revision 1.21  2000/05/04 09:39:59  rassmann
- *	Editorial changes.
- *	Corrected multicast address hashing.
- *	
- *	Revision 1.20  1999/11/22 13:46:14  cgoos
- *	Changed license header to GPL.
- *	Allowing overwrite for SK_ADDR_EQUAL.
- *	
- *	Revision 1.19  1999/05/28 10:56:07  rassmann
- *	Editorial changes.
- *	
- *	Revision 1.18  1999/04/06 17:22:04  rassmann
- *	Added private "ActivePort".
- *	
- *	Revision 1.17  1999/01/14 16:18:19  rassmann
- *	Corrected multicast initialization.
- *	
- *	Revision 1.16  1999/01/04 10:30:36  rassmann
- *	SkAddrOverride only possible after SK_INIT_IO phase.
- *	
- *	Revision 1.15  1998/12/29 13:13:11  rassmann
- *	An address override is now preserved in the SK_INIT_IO phase.
- *	All functions return an int now.
- *	Extended parameter checking.
- *	
- *	Revision 1.14  1998/11/24 12:39:45  rassmann
- *	Reserved multicast entry for BPDU address.
- *	13 multicast entries left for protocol.
- *	
- *	Revision 1.13  1998/11/13 17:24:32  rassmann
- *	Changed return value of SkAddrOverride to int.
- *	
- *	Revision 1.12  1998/11/13 16:56:19  rassmann
- *	Added macro SK_ADDR_COMPARE.
- *	Changed return type of SkAddrOverride to SK_BOOL.
- *	
- *	Revision 1.11  1998/10/28 18:16:35  rassmann
- *	Avoiding I/Os before SK_INIT_RUN level.
- *	Aligning InexactFilter.
- *	
- *	Revision 1.10  1998/10/22 11:39:10  rassmann
- *	Corrected signed/unsigned mismatches.
- *	
- *	Revision 1.9  1998/10/15 15:15:49  rassmann
- *	Changed Flags Parameters from SK_U8 to int.
- *	Checked with lint.
- *	
- *	Revision 1.8  1998/09/24 19:15:12  rassmann
- *	Code cleanup.
- *	
- *	Revision 1.7  1998/09/18 20:22:13  rassmann
- *	Added HW access.
- *	
- *	Revision 1.6  1998/09/04 19:40:20  rassmann
- *	Interface enhancements.
- *	
- *	Revision 1.5  1998/09/04 12:40:57  rassmann
- *	Interface cleanup.
- *	
- *	Revision 1.4  1998/09/04 12:14:13  rassmann
- *	Interface cleanup.
- *	
- *	Revision 1.3  1998/09/02 16:56:40  rassmann
- *	Updated interface.
- *	
- *	Revision 1.2  1998/08/27 14:26:09  rassmann
- *	Updated interface.
- *	
- *	Revision 1.1  1998/08/21 08:31:08  rassmann
- *	First public version.
- *
- ******************************************************************************/
-
-/******************************************************************************
- *
  * Description:
  *
  * This module is intended to manage multicast addresses and promiscuous mode
--- diff/drivers/net/sk98lin/h/skcsum.h	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/net/sk98lin/h/skcsum.h	2004-02-09 10:39:53.000000000 +0000
@@ -2,8 +2,6 @@
  *
  * Name:	skcsum.h
  * Project:	GEnesis - SysKonnect SK-NET Gigabit Ethernet (SK-98xx)
- * Version:	$Revision: 1.10 $
- * Date:	$Date: 2003/08/20 13:59:57 $
  * Purpose:	Store/verify Internet checksum in send/receive packets.
  *
  ******************************************************************************/
@@ -23,52 +21,6 @@
 
 /******************************************************************************
  *
- * 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.
- *	
- *	Revision 1.8  2001/02/06 11:15:36  rassmann
- *	Supporting two nets on dual-port adapters.
- *	
- *	Revision 1.7  2000/06/29 13:17:05  rassmann
- *	Corrected reception of a packet with UDP checksum == 0 (which means there
- *	is no UDP checksum).
- *	
- *	Revision 1.6  2000/02/28 12:33:44  cgoos
- *	Changed C++ style comments to C style.
- *	
- *	Revision 1.5  2000/02/21 12:10:05  cgoos
- *	Fixed license comment.
- *	
- *	Revision 1.4  2000/02/21 11:08:37  cgoos
- *	Merged changes back into common source.
- *	
- *	Revision 1.1  1999/07/26 14:47:49  mkarl
- *	changed from common source to windows specific source
- *	added return SKCS_STATUS_IP_CSUM_ERROR_UDP and
- *	SKCS_STATUS_IP_CSUM_ERROR_TCP to pass the NidsTester
- *	changes for Tx csum offload
- *	
- *	Revision 1.2  1998/09/04 12:16:34  mhaveman
- *	Checked in for Stephan to allow compilation.
- *	-Added definition SK_CSUM_EVENT_CLEAR_PROTO_STATS to clear statistic
- *	-Added prototype for SkCsEvent()
- *	
- *	Revision 1.1  1998/09/01 15:36:53  swolf
- *	initial revision
- *
- *	01-Sep-1998 sw	Created.
- *
- ******************************************************************************/
-
-/******************************************************************************
- *
  * Description:
  *
  * Public header file for the "GEnesis" common module "CSUM".
--- diff/drivers/net/sk98lin/h/skdebug.h	2003-08-20 14:16:30.000000000 +0100
+++ source/drivers/net/sk98lin/h/skdebug.h	2004-02-09 10:39:53.000000000 +0000
@@ -2,8 +2,6 @@
  *
  * Name:	skdebug.h
  * Project:	Gigabit Ethernet Adapters, Common Modules
- * Version:	$Revision: 1.14 $
- * Date:	$Date: 2003/05/13 17:26:00 $
  * Purpose:	SK specific DEBUG support
  *
  ******************************************************************************/
@@ -22,58 +20,6 @@
  *
  ******************************************************************************/
 
-/******************************************************************************
- *
- * History:
- *	$Log: skdebug.h,v $
- *	Revision 1.14  2003/05/13 17:26:00  mkarl
- *	Editorial changes.
- *	
- *	Revision 1.13  2003/03/31 07:16:39  mkarl
- *	Corrected Copyright.
- *	
- *	Revision 1.12  2002/07/15 15:37:13  rschmidt
- *	Power Management support
- *	Editorial changes
- *	
- *	Revision 1.11  2002/04/25 11:04:39  rschmidt
- *	Editorial changes
- *	
- *	Revision 1.10  1999/11/22 13:47:40  cgoos
- *	Changed license header to GPL.
- *	
- *	Revision 1.9  1999/09/14 14:02:43  rwahl
- *	Added SK_DBGMOD_PECP.
- *	
- *	Revision 1.8  1998/11/25 08:31:54  gklug
- *	fix: no C++ comments allowed in common sources
- *	
- *	Revision 1.7  1998/11/24 16:47:24  swolf
- *	Driver may now define its own SK_DBG_MSG() (eg. in "h/skdrv1st.h").
- *	
- *	Revision 1.6  1998/10/28 10:23:55  rassmann
- *	ADDED SK_DBGMOD_ADDR.
- *	
- *	Revision 1.5  1998/10/22 09:43:55  gklug
- *	add: CSUM module
- *	
- *	Revision 1.4  1998/10/01 07:54:44  gklug
- *	add: PNMI debug module
- *	
- *	Revision 1.3  1998/09/18 08:32:34  afischer
- *	Macros changed according ssr-spec.:
- *		SK_DBG_MODCHK -> SK_DBG_CHKMOD
- *		SK_DBG_CATCHK -> SK_DBG_CHKCAT
- *	
- *	Revision 1.2  1998/07/03 14:38:25  malthoff
- *	Add category SK_DBGCAT_FATAL.
- *	
- *	Revision 1.1  1998/06/19 13:39:01  malthoff
- *	created.
- *	
- *
- ******************************************************************************/
-
 #ifndef __INC_SKDEBUG_H
 #define __INC_SKDEBUG_H
 
--- diff/drivers/net/sk98lin/h/skdrv1st.h	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/net/sk98lin/h/skdrv1st.h	2004-02-09 10:39:53.000000000 +0000
@@ -2,8 +2,6 @@
  *
  * Name:	skdrv1st.h
  * Project:	GEnesis, PCI Gigabit Ethernet Adapter
- * Version:	$Revision: 1.4 $
- * Date:	$Date: 2003/11/12 14:28:14 $
  * Purpose:	First header file for driver and all other modules
  *
  ******************************************************************************/
@@ -24,87 +22,6 @@
 
 /******************************************************************************
  *
- * 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
- *	
- *	Revision 1.15  2003/07/17 14:54:09  rroesler
- *	Fix: Corrected SK_PNMI_READ macros to copy right amount of bytes
- *	
- *	Revision 1.14  2003/06/03 14:36:32  mlindner
- *	Add: Additions for SK_SLIM
- *	
- *	Revision 1.13  2003/05/26 14:03:06  mlindner
- *	Add: Support for SLIM skaddr
- *	
- *	Revision 1.12  2003/05/26 12:56:39  mlindner
- *	Add: Support for Kernel 2.5/2.6
- *	Add: New SkOsGetTimeCurrent function
- *	Add: SK_PNMI_HUNDREDS_SEC definition
- *	Fix: SK_TICKS_PER_SEC on Intel Itanium2
- *	
- *	Revision 1.11  2003/02/25 14:16:40  mlindner
- *	Fix: Copyright statement
- *	
- *	Revision 1.10  2002/10/02 12:46:02  mlindner
- *	Add: Support for Yukon
- *	
- *	Revision 1.9.2.2  2001/12/07 12:06:42  mlindner
- *	Fix: malloc -> slab changes
- *	
- *	Revision 1.9.2.1  2001/03/12 16:50:59  mlindner
- *	chg: kernel 2.4 adaption
- *	
- *	Revision 1.9  2001/01/22 14:16:04  mlindner
- *	added ProcFs functionality
- *	Dual Net functionality integrated
- *	Rlmt networks added
- *	
- *	Revision 1.8  2000/02/21 12:19:18  cgoos
- *	Added default for SK_DEBUG_CHKMOD/_CHKCAT
- *	
- *	Revision 1.7  1999/11/22 13:50:00  cgoos
- *	Changed license header to GPL.
- *	Added overwrite for several functions.
- *	Removed linux 2.0.x definitions.
- *	Removed PCI vendor ID definition (now in kernel).
- *	
- *	Revision 1.6  1999/07/27 08:03:33  cgoos
- *	Changed SK_IN/OUT macros to readX/writeX instead of memory
- *	accesses (necessary for ALPHA).
- *	
- *	Revision 1.5  1999/07/23 12:10:21  cgoos
- *	Removed SK_RLMT_SLOW_LOOKAHEAD define.
- *	
- *	Revision 1.4  1999/07/14 12:31:13  cgoos
- *	Added SK_RLMT_SLOW_LOOKAHEAD define.
- *	
- *	Revision 1.3  1999/04/07 10:12:54  cgoos
- *	Added check for KERNEL and OPTIMIZATION defines.
- *	
- *	Revision 1.2  1999/03/01 08:51:47  cgoos
- *	Fixed pcibios_read/write definitions.
- *	
- *	Revision 1.1  1999/02/16 07:40:49  cgoos
- *	First version.
- *	
- *	
- *
- ******************************************************************************/
-
-/******************************************************************************
- *
  * Description:
  *
  * This is the first include file of the driver, which includes all
--- diff/drivers/net/sk98lin/h/skdrv2nd.h	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/net/sk98lin/h/skdrv2nd.h	2004-02-09 10:39:53.000000000 +0000
@@ -2,8 +2,6 @@
  *
  * Name:	skdrv2nd.h
  * Project:	GEnesis, PCI Gigabit Ethernet Adapter
- * Version:	$Revision: 1.10 $
- * Date:	$Date: 2003/12/11 16:04:45 $
  * Purpose:	Second header file for driver and all other modules
  *
  ******************************************************************************/
@@ -24,122 +22,6 @@
 
 /******************************************************************************
  *
- * 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
- *	
- *	Revision 1.2  2003/08/07 10:50:54  mlindner
- *	Add: Speed and HW-Csum support for Yukon Lite chipset
- *	
- *	Revision 1.1  2003/07/21 07:25:29  rroesler
- *	Fix: Re-Enter after CVS crash
- *	
- *	Revision 1.19  2003/07/07 09:53:10  rroesler
- *	Fix: Removed proprietary RxTx defines and used the ones from skgehw.h instead
- *	
- *	Revision 1.18  2003/06/12 07:54:14  mlindner
- *	Fix: Changed Descriptor Alignment to 64 Byte
- *	
- *	Revision 1.17  2003/05/26 12:56:39  mlindner
- *	Add: Support for Kernel 2.5/2.6
- *	Add: New SkOsGetTimeCurrent function
- *	Add: SK_PNMI_HUNDREDS_SEC definition
- *	Fix: SK_TICKS_PER_SEC on Intel Itanium2
- *	
- *	Revision 1.16  2003/03/21 14:56:18  rroesler
- *	Added code regarding interrupt moderation
- *	
- *	Revision 1.15  2003/02/25 14:16:40  mlindner
- *	Fix: Copyright statement
- *	
- *	Revision 1.14  2003/02/25 13:26:26  mlindner
- *	Add: Support for various vendors
- *	
- *	Revision 1.13  2002/10/02 12:46:02  mlindner
- *	Add: Support for Yukon
- *	
- *	Revision 1.12.2.2  2001/09/05 12:14:50  mlindner
- *	add: New hardware revision int
- *	
- *	Revision 1.12.2.1  2001/03/12 16:50:59  mlindner
- *	chg: kernel 2.4 adaption
- *	
- *	Revision 1.12  2001/03/01 12:52:15  mlindner
- *	Fixed ring size
- *
- *	Revision 1.11  2001/02/19 13:28:02  mlindner
- *	Changed PNMI parameter values
- *
- *	Revision 1.10  2001/01/22 14:16:04  mlindner
- *	added ProcFs functionality
- *	Dual Net functionality integrated
- *	Rlmt networks added
- *
- *	Revision 1.1  2000/10/05 19:46:50  phargrov
- *	Add directory src/vipk_devs_nonlbl/vipk_sk98lin/
- *	This is the SysKonnect SK-98xx Gigabit Ethernet driver,
- *	contributed by SysKonnect.
- *
- *	Revision 1.9  2000/02/21 10:39:55  cgoos
- *	Added flag for jumbo support usage.
- *
- *	Revision 1.8  1999/11/22 13:50:44  cgoos
- *	Changed license header to GPL.
- *	Fixed two comments.
- *
- *	Revision 1.7  1999/09/28 12:38:21  cgoos
- *	Added CheckQueue to SK_AC.
- *	
- *	Revision 1.6  1999/07/27 08:04:05  cgoos
- *	Added checksumming variables to SK_AC.
- *	
- *	Revision 1.5  1999/03/29 12:33:26  cgoos
- *	Rreversed to fine lock granularity.
- *	
- *	Revision 1.4  1999/03/15 12:14:02  cgoos
- *	Added DriverLock to SK_AC.
- *	Removed other locks.
- *	
- *	Revision 1.3  1999/03/01 08:52:27  cgoos
- *	Changed pAC->PciDev declaration.
- *	
- *	Revision 1.2  1999/02/18 10:57:14  cgoos
- *	Removed SkDrvTimeStamp prototype.
- *	Fixed SkGeOsGetTime prototype.
- *	
- *	Revision 1.1  1999/02/16 07:41:01  cgoos
- *	First version.
- *	
- *	
- *
- ******************************************************************************/
-
-/******************************************************************************
- *
  * Description:
  *
  * This is the second include file of the driver, which includes all other
--- diff/drivers/net/sk98lin/h/skerror.h	2003-08-20 14:16:30.000000000 +0100
+++ source/drivers/net/sk98lin/h/skerror.h	2004-02-09 10:39:53.000000000 +0000
@@ -2,8 +2,6 @@
  *
  * Name:	skerror.h
  * Project:	Gigabit Ethernet Adapters, Common Modules
- * Version:	$Revision: 1.7 $
- * Date:	$Date: 2003/05/13 17:25:13 $
  * Purpose:	SK specific Error log support
  *
  ******************************************************************************/
@@ -22,38 +20,6 @@
  *
  ******************************************************************************/
 
-/******************************************************************************
- *
- * History:
- *	$Log: skerror.h,v $
- *	Revision 1.7  2003/05/13 17:25:13  mkarl
- *	Editorial changes.
- *	
- *	Revision 1.6  2003/03/31 07:17:48  mkarl
- *	Corrected Copyright.
- *	
- *	Revision 1.5  2002/04/25 11:05:10  rschmidt
- *	Editorial changes
- *	
- *	Revision 1.4  1999/11/22 13:51:59  cgoos
- *	Changed license header to GPL.
- *	
- *	Revision 1.3  1999/09/14 14:04:42  rwahl
- *	Added error base SK_ERRBASE_PECP.
- *	Changed error base for driver.
- *	
- *	Revision 1.2  1998/08/11 11:15:41  gklug
- *	chg: comments
- *	
- *	Revision 1.1  1998/08/11 11:09:38  gklug
- *	add: error bases
- *	add: error Classes
- *	first version
- *	
- *	
- *
- ******************************************************************************/
-
 #ifndef _INC_SKERROR_H_
 #define _INC_SKERROR_H_
 
--- diff/drivers/net/sk98lin/h/skgedrv.h	2003-08-20 14:16:30.000000000 +0100
+++ source/drivers/net/sk98lin/h/skgedrv.h	2004-02-09 10:39:53.000000000 +0000
@@ -2,8 +2,6 @@
  *
  * Name:	skgedrv.h
  * Project:	Gigabit Ethernet Adapters, Common Modules
- * Version:	$Revision: 1.10 $
- * Date:	$Date: 2003/07/04 12:25:01 $
  * Purpose:	Interface with the driver
  *
  ******************************************************************************/
@@ -22,47 +20,6 @@
  *
  ******************************************************************************/
 
-/******************************************************************************
- *
- * History:
- *
- *	$Log: skgedrv.h,v $
- *	Revision 1.10  2003/07/04 12:25:01  rschmidt
- *	Added event SK_DRV_DOWNSHIFT_DET for Downshift 4-Pair / 2-Pair
- *	
- *	Revision 1.9  2003/05/13 17:24:21  mkarl
- *	Added events SK_DRV_LINK_UP and SK_DRV_LINK_DOWN for drivers not using
- *	RLMT (SK_NO_RLMT).
- *	Editorial changes.
- *	
- *	Revision 1.8  2003/03/31 07:18:54  mkarl
- *	Corrected Copyright.
- *	
- *	Revision 1.7  2003/03/18 09:43:47  rroesler
- *	Added new event for timer
- *	
- *	Revision 1.6  2002/07/15 15:38:01  rschmidt
- *	Power Management support
- *	Editorial changes
- *	
- *	Revision 1.5  2002/04/25 11:05:47  rschmidt
- *	Editorial changes
- *	
- *	Revision 1.4  1999/11/22 13:52:46  cgoos
- *	Changed license header to GPL.
- *	
- *	Revision 1.3  1998/12/01 13:31:39  cgoos
- *	SWITCH INTERN Event added.
- *	
- *	Revision 1.2  1998/11/25 08:28:38  gklug
- *	rmv: PORT SWITCH Event
- *	
- *	Revision 1.1  1998/09/29 06:14:07  gklug
- *	add: driver events (initial version)
- *	
- *
- ******************************************************************************/
-
 #ifndef __INC_SKGEDRV_H_
 #define __INC_SKGEDRV_H_
 
--- diff/drivers/net/sk98lin/h/skgehw.h	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/net/sk98lin/h/skgehw.h	2004-02-09 10:39:53.000000000 +0000
@@ -2,8 +2,6 @@
  *
  * Name:	skgehw.h
  * Project:	Gigabit Ethernet Adapters, Common Modules
- * Version:	$Revision: 1.56 $
- * Date:	$Date: 2003/09/23 09:01:00 $
  * Purpose:	Defines and Macros for the Gigabit Ethernet Adapter Product Family
  *
  ******************************************************************************/
@@ -22,236 +20,6 @@
  *
  ******************************************************************************/
 
-/******************************************************************************
- *
- * 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
- *
- * Revision 1.52  2003/05/13 17:16:36  mkarl
- * Added SK_FAR for PXE.
- * Editorial changes.
- *
- * Revision 1.51  2003/04/08 16:31:50  rschmidt
- * Added defines for new Chip IDs (YUKON-Lite, YUKON-LP)
- * Editorial changes
- *
- * Revision 1.50  2003/03/31 07:29:45  mkarl
- * Corrected Copyright.
- * Editorial changes.
- *
- * Revision 1.49  2003/01/28 09:43:49  rschmidt
- * Added defines for PCI-Spec. 2.3 IRQ
- * Added defines for CLK_RUN (YUKON-Lite)
- * Editorial changes
- *
- * Revision 1.48  2002/12/05 10:25:11  rschmidt
- * Added defines for Half Duplex Burst Mode On/Off
- * Added defines for Rx GMAC FIFO Flush feature
- * Editorial changes
- *
- * Revision 1.47  2002/11/12 17:01:31  rschmidt
- * Added defines for WOL_CTL_DEFAULT
- * Editorial changes
- *
- * Revision 1.46  2002/10/14 14:47:57  rschmidt
- * Corrected bit mask for HW self test results
- * Added defines for WOL Registers
- * Editorial changes
- *
- * Revision 1.45  2002/10/11 09:25:22  mkarl
- * Added bit mask for HW self test results.
- *
- * Revision 1.44  2002/08/16 14:44:36  rschmidt
- * Added define GPC_HWCFG_GMII_FIB for YUKON Fiber
- *
- * Revision 1.43  2002/08/12 13:31:50  rschmidt
- * Corrected macros for GMAC Address Registers: GM_INADDR(),
- * GM_OUTADDR(), GM_INHASH, GM_OUTHASH.
- * Editorial changes
- *
- * Revision 1.42  2002/08/08 15:37:56  rschmidt
- * Added defines for Power Management Capabilities
- * Editorial changes
- *
- * Revision 1.41  2002/07/23 16:02:25  rschmidt
- * Added macro WOL_REG() to access WOL reg. (HW-Bug in YUKON 1st rev.)
- *
- * Revision 1.40  2002/07/15 15:41:37  rschmidt
- * Added new defines for Power Management Cap. & Control
- * Editorial changes
- *
- * Revision 1.39  2002/06/10 09:37:07  rschmidt
- * Added macros for the ADDR-Module
- *
- * Revision 1.38  2002/06/05 08:15:19  rschmidt
- * Added defines for WOL Registers
- * Editorial changes
- *
- * Revision 1.37  2002/04/25 11:39:23  rschmidt
- * Added new defines for PCI Our Register 1
- * Added new registers and defines for YUKON (Rx FIFO, Tx FIFO,
- * Time Stamp Timer, GMAC Control, GPHY Control,Link Control,
- * GMAC IRQ Source and Mask, Wake-up Frame Pattern Match);
- * Added new defines for Control/Status (VAUX available)
- * Added Chip ID for YUKON
- * Added define for descriptors with UDP ext. for YUKON
- * Added macros to access the GMAC
- * Added new Phy Type for Marvell 88E1011S (GPHY)
- * Editorial changes
- *
- * Revision 1.36  2000/11/09 12:32:49  rassmann
- * Renamed variables.
- *
- * Revision 1.35  2000/05/19 10:17:13  cgoos
- * Added inactivity check in PHY_READ (in DEBUG mode only).
- *
- * Revision 1.34  1999/11/22 13:53:40  cgoos
- * Changed license header to GPL.
- *
- * Revision 1.33  1999/08/27 11:17:10  malthoff
- * It's more savely to put brackets around macro parameters.
- * Brackets added for PHY_READ and PHY_WRITE.
- *
- * Revision 1.32  1999/05/19 07:31:01  cgoos
- * Changes for 1000Base-T.
- * Added HWAC_LINK_LED macro.
- *
- * Revision 1.31  1999/03/12 13:27:40  malthoff
- * Remove __STDC__.
- *
- * Revision 1.30  1999/02/09 09:28:20  malthoff
- * Add PCI_ERRBITS.
- *
- * Revision 1.29  1999/01/26 08:55:48  malthoff
- * Bugfix: The 16 bit field relations inside the descriptor are
- * 	endianess dependend if the descriptor reversal feature
- * 	(PCI_REV_DESC bit in PCI_OUR_REG_2) is enabled.
- * 	Drivers which use this feature has to set the define
- * 	SK_USE_REV_DESC.
- *
- * Revision 1.28  1998/12/10 11:10:22  malthoff
- * bug fix: IS_IRQ_STAT and IS_IRQ_MST_ERR has been twisted.
- *
- * Revision 1.27  1998/11/13 14:19:21  malthoff
- * Bug Fix: The bit definition of B3_PA_CTRL has completely
- * changed from HW Spec v1.3 to v1.5.
- *
- * Revision 1.26  1998/11/04 08:31:48  cgoos
- * Fixed byte ordering in XM_OUTADDR/XM_OUTHASH macros.
- *
- * Revision 1.25  1998/11/04 07:16:25  cgoos
- * Changed byte ordering in XM_INADDR/XM_INHASH again.
- *
- * Revision 1.24  1998/11/02 11:08:43  malthoff
- * RxCtrl and TxCtrl must be volatile.
- *
- * Revision 1.23  1998/10/28 13:50:45  malthoff
- * Fix: Endian support missing in XM_IN/OUT-ADDR/HASH macros.
- *
- * Revision 1.22  1998/10/26 08:01:36  malthoff
- * RX_MFF_CTRL1 is split up into RX_MFF_CTRL1,
- * RX_MFF_STAT_TO, and RX_MFF_TIST_TO.
- * TX_MFF_CTRL1 is split up TX_MFF_CTRL1 and TX_MFF_WAF.
- *
- * Revision 1.21  1998/10/20 07:43:10  malthoff
- * Fix: XM_IN/OUT/ADDR/HASH macros:
- * The pointer must be casted.
- *
- * Revision 1.20  1998/10/19 15:53:59  malthoff
- * Remove ML proto definitions.
- *
- * Revision 1.19  1998/10/16 14:40:17  gklug
- * fix: typo B0_XM_IMSK regs
- *
- * Revision 1.18  1998/10/16 09:46:54  malthoff
- * Remove temp defines for ML diag prototype.
- * Fix register definition for B0_XM1_PHY_DATA, B0_XM1_PHY_DATA
- * B0_XM2_PHY_DATA, B0_XM2_PHY_ADDR, B0_XA1_CSR, B0_XS1_CSR,
- * B0_XS2_CSR, and B0_XA2_CSR.
- *
- * Revision 1.17  1998/10/14 06:03:14  cgoos
- * Changed shifted constant to ULONG.
- *
- * Revision 1.16  1998/10/09 07:05:41  malthoff
- * Rename ALL_PA_ENA_TO to PA_ENA_TO_ALL.
- *
- * Revision 1.15  1998/10/05 07:54:23  malthoff
- * Split up RB_CTRL and it's bit definition into
- * RB_CTRL, RB_TST1, and RB_TST2.
- * Rename RB_RX_HTPP to RB_RX_LTPP.
- * Add ALL_PA_ENA_TO. Modify F_WATER_MARK
- * according to HW Spec. v1.5.
- * Add MFF_TX_CTRL_DEF.
- *
- * Revision 1.14  1998/09/28 13:31:16  malthoff
- * bug fix: B2_MAC_3 is 0x110 not 0x114
- *
- * Revision 1.13  1998/09/24 14:42:56  malthoff
- * Split the RX_MFF_TST into RX_MFF_CTRL2,
- * RX_MFF_TST1, and RX_MFF_TST2.
- * Rename RX_MFF_CTRL to RX_MFF_CTRL1.
- * Add BMU bit CSR_SV_IDLE.
- * Add macros PHY_READ() and PHY_WRITE().
- * Rename macro SK_ADDR() to SK_HW_ADDR()
- * because of conflicts with the Address Module.
- *
- * Revision 1.12  1998/09/16 07:25:33  malthoff
- * Change the parameter order in the XM_INxx and XM_OUTxx macros,
- * to have the IoC as first parameter.
- *
- * Revision 1.11  1998/09/03 09:58:41  malthoff
- * Rework the XM_xxx macros. Use {} instead of () to
- * be compatible with SK_xxx macros which are defined
- * with {}.
- *
- * Revision 1.10  1998/09/02 11:16:39  malthoff
- * Temporary modify B2_I2C_SW to make tests with
- * the GE/ML prototype.
- *
- * Revision 1.9  1998/08/19 09:11:49  gklug
- * fix: struct are removed from c-source (see CCC)
- * add: typedefs for all structs
- *
- * Revision 1.8  1998/08/18 08:27:27  malthoff
- * Add some temporary workarounds to test GE
- * sources with the ML.
- *
- * Revision 1.7  1998/07/03 14:42:26  malthoff
- * bug fix: Correct macro XMA().
- * Add temporary workaround to access the PCI config space over I/O
- *
- * Revision 1.6  1998/06/23 11:30:36  malthoff
- * Remove ';' with ',' in macors.
- *
- * Revision 1.5  1998/06/22 14:20:57  malthoff
- * Add macro SK_ADDR(Base,Addr).
- *
- * Revision 1.4  1998/06/19 13:35:43  malthoff
- * change 'pGec' with 'pAC'
- *
- * Revision 1.3  1998/06/17 14:58:16  cvs
- * Lost keywords reinserted.
- *
- * Revision 1.1  1998/06/17 14:16:36  cvs
- * created
- *
- *
- ******************************************************************************/
-
 #ifndef __INC_SKGEHW_H
 #define __INC_SKGEHW_H
 
--- diff/drivers/net/sk98lin/h/skgehwt.h	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/net/sk98lin/h/skgehwt.h	2004-02-09 10:39:53.000000000 +0000
@@ -2,8 +2,6 @@
  *
  * Name:	skhwt.h
  * 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
  *
  ******************************************************************************/
@@ -22,34 +20,6 @@
  *
  ******************************************************************************/
 
-/******************************************************************************
- *
- * 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.
- *	
- *	Revision 1.5  1999/11/22 13:54:24  cgoos
- *	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
- *	
- *	Revision 1.3  1998/08/14 07:09:29  gklug
- *	fix: chg pAc -> pAC
- *	
- *	Revision 1.2  1998/08/07 12:54:21  gklug
- *	fix: first compiled version
- *	
- *	Revision 1.1  1998/08/07 09:32:58  gklug
- *	first version
- *
- ******************************************************************************/
-
 /*
  * SKGEHWT.H	contains all defines and types for the timer functions
  */
--- diff/drivers/net/sk98lin/h/skgei2c.h	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/net/sk98lin/h/skgei2c.h	2004-02-09 10:39:53.000000000 +0000
@@ -2,8 +2,6 @@
  *
  * Name:	skgei2c.h
  * Project:	Gigabit Ethernet Adapters, TWSI-Module
- * Version:	$Revision: 1.25 $
- * Date:	$Date: 2003/10/20 09:06:05 $
  * Purpose:	Special defines for TWSI
  *
  ******************************************************************************/
@@ -22,100 +20,6 @@
  *
  ******************************************************************************/
 
-/******************************************************************************
- *
- * 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)
- *	
- *	Revision 1.22  2002/10/14 16:45:56  rschmidt
- *	Editorial changes (TWSI)
- *	
- *	Revision 1.21  2002/08/13 08:42:24  rschmidt
- *	Changed define for SK_MIN_SENSORS back to 5
- *	Merged defines for PHY PLL 3V3 voltage (A and B)
- *	Editorial changes
- *	
- *	Revision 1.20  2002/08/06 09:43:56  jschmalz
- *	Extensions and changes for Yukon
- *	
- *	Revision 1.19  2002/08/02 12:00:08  rschmidt
- *	Added defines for YUKON sensors
- *	Editorial changes
- *	
- *	Revision 1.18  2001/08/16 12:44:33  afischer
- *	LM80 sensor init values corrected
- *	
- *	Revision 1.17  1999/11/22 13:55:25  cgoos
- *	Changed license header to GPL.
- *	
- *	Revision 1.16  1999/11/12 08:24:10  malthoff
- *	Change voltage warning and error limits
- *	(warning +-5%, error +-10%).
- *	
- *	Revision 1.15  1999/09/14 14:14:43  malthoff
- *	The 1000BT Dual Link adapter has got only one Fan.
- *	The second Fan has been removed.
- *	
- *	Revision 1.14  1999/05/27 13:40:50  malthoff
- *	Fan Divisor = 1. Assuming fan with 6500 rpm.
- *	
- *	Revision 1.13  1999/05/20 14:56:55  malthoff
- *	Bug Fix: Missing brace in SK_LM80_FAN_FAKTOR.
- *	
- *	Revision 1.12  1999/05/20 09:22:00  cgoos
- *	Changes for 1000Base-T (Fan sensors).
- *	
- *	Revision 1.11  1998/10/14 05:57:22  cgoos
- *	Fixed compilation warnings.
- *	
- *	Revision 1.10  1998/09/04 08:37:00  malthoff
- *	bugfix: correct the SK_I2C_GET_CTL() macro.
- *	
- *	Revision 1.9  1998/08/25 06:10:03  gklug
- *	add: thresholds for all sensors
- *
- *	Revision 1.8  1998/08/20 11:37:42  gklug
- *	chg: change Ioc to IoC
- *	
- *	Revision 1.7  1998/08/20 08:53:11  gklug
- *	fix: compiler errors
- *	add: Threshold values
- *	
- *	Revision 1.6  1998/08/17 11:37:09  malthoff
- *	Bugfix in SK_I2C_CTL macro. The parameter 'dev'
- *	has to be shifted 9 bits.
- *	
- *	Revision 1.5  1998/08/17 06:52:21  malthoff
- *	Remove unrequired macros.
- *	Add macros for accessing TWSI SW register.
- *	
- *	Revision 1.4  1998/08/13 08:30:18  gklug
- *	add: conversion factors for read values
- *	add: new state SEN_VALEXT to read extension value of temperature sensor
- *
- *	Revision 1.3  1998/08/12 13:37:56  gklug
- *	rmv: error numbers and messages
- *
- *	Revision 1.2  1998/08/11 07:54:38  gklug
- *	add: sensor states for GE sensors
- *	add: Macro to access TWSI hardware register
- *	chg: Error messages for TWSI errors
- *
- *	Revision 1.1  1998/07/17 11:27:56  gklug
- *	Created.
- *
- ******************************************************************************/
-
 /*
  * SKGEI2C.H	contains all SK-98xx specific defines for the TWSI handling
  */
--- diff/drivers/net/sk98lin/h/skgeinit.h	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/net/sk98lin/h/skgeinit.h	2004-02-09 10:39:54.000000000 +0000
@@ -2,8 +2,6 @@
  *
  * Name:	skgeinit.h
  * Project:	Gigabit Ethernet Adapters, Common Modules
- * Version:	$Revision: 1.83 $
- * Date:	$Date: 2003/09/16 14:07:37 $
  * Purpose:	Structures and prototypes for the GE Init Module
  *
  ******************************************************************************/
@@ -22,353 +20,6 @@
  *
  ******************************************************************************/
 
-/******************************************************************************
- *
- * 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
- *	
- *	Revision 1.80  2003/05/28 15:25:30  rschmidt
- *	Added SK_FAR to pointers in MAC/PHY read functions (for PXE)
- *	Minor changes to avoid LINT warnings
- *	Editorial changes
- *
- *	Revision 1.79  2003/05/06 12:02:33  rschmidt
- *	Added entry GIYukon in s_GeInit structure
- *	Editorial changes
- *
- *	Revision 1.78  2003/04/28 08:59:57  rschmidt
- *	Added entries GIValIrqMask and GITimeStampCnt in s_GeInit structure
- *
- *	Revision 1.77  2003/04/08 16:27:02  rschmidt
- *	Added entry GILedBlinkCtrl in s_GeInit structure
- *	Added defines for LED Blink Control
- *
- *	Revision 1.76  2003/03/31 07:21:01  mkarl
- *	Added PGmANegAdv to SK_GEPORT.
- *	Corrected Copyright.
- *
- *	Revision 1.75  2003/02/05 13:36:39  rschmidt
- *	Added define SK_FACT_78	for YUKON's Host Clock of 78.12 MHz
- *	Editorial changes
- *
- *	Revision 1.74  2003/01/28 09:39:16  rschmidt
- *	Added entry GIYukonLite in s_GeInit structure
- *	Editorial changes
- *
- *	Revision 1.73  2002/11/15 12:47:25  rschmidt
- *	Replaced error message SKERR_HWI_E024 for Cable Diagnostic with
- *	Rx queue error in SkGeStopPort().
- *
- *	Revision 1.72  2002/11/12 17:08:35  rschmidt
- *	Added entries for Cable Diagnostic to Port structure
- *	Added entries GIPciSlot64 and GIPciClock66 in s_GeInit structure
- *	Added error message for Cable Diagnostic
- *	Added prototypes for SkGmCableDiagStatus()
- *	Editorial changes
- *
- *	Revision 1.71  2002/10/21 11:26:10  mkarl
- *	Changed interface of SkGeInitAssignRamToQueues().
- *
- *	Revision 1.70  2002/10/14 08:21:32  rschmidt
- *	Changed type of GICopperType, GIVauxAvail to SK_BOOL
- *	Added entry PRxOverCnt to Port structure
- *	Added entry GIYukon32Bit in s_GeInit structure
- *	Editorial changes
- *
- *	Revision 1.69  2002/10/09 16:57:15  mkarl
- *	Added some constants and macros for SkGeInitAssignRamToQueues().
- *
- *	Revision 1.68  2002/09/12 08:58:51  rwahl
- *	Retrieve counters needed for XMAC errata workarounds directly because
- *	PNMI returns corrected counter values (e.g. #10620).
- *
- *	Revision 1.67  2002/08/16 14:40:30  rschmidt
- *	Added entries GIGenesis and GICopperType in s_GeInit structure
- *	Added prototypes for SkMacHashing()
- *	Editorial changes
- *
- *	Revision 1.66  2002/08/12 13:27:21  rschmidt
- *	Added defines for Link speed capabilities
- *	Added entry PLinkSpeedCap to Port structure
- *	Added entry GIVauxAvail in s_GeInit structure
- *	Added prototypes for SkMacPromiscMode()
- *	Editorial changes
- *
- *	Revision 1.65  2002/08/08 15:46:18  rschmidt
- *	Added define SK_PHY_ACC_TO for PHY access timeout
- *	Added define SK_XM_RX_HI_WM for XMAC Rx High Watermark
- *	Added define SK_MIN_TXQ_SIZE for Min RAM Buffer Tx Queue Size
- *	Added entry PhyId1 to Port structure
- *
- *	Revision 1.64  2002/07/23 16:02:56  rschmidt
- *	Added entry GIWolOffs in s_GeInit struct (HW-Bug in YUKON 1st rev.)
- *	Added prototypes for: SkGePhyRead(), SkGePhyWrite()
- *
- *	Revision 1.63  2002/07/18 08:17:38  rwahl
- *	Corrected definitions for SK_LSPEED_xxx & SK_LSPEED_STAT_xxx.
- *
- *	Revision 1.62  2002/07/17 18:21:55  rwahl
- *	Added SK_LSPEED_INDETERMINATED define.
- *
- *	Revision 1.61  2002/07/17 17:16:03  rwahl
- *	- MacType now member of GIni struct.
- *	- Struct alignment to 32bit.
- *	- Editorial change.
- *
- *	Revision 1.60  2002/07/15 18:23:39  rwahl
- *	Added GeMacFunc to GE Init structure.
- *	Added prototypes for SkXmUpdateStats(), SkGmUpdateStats(),
- *	  SkXmMacStatistic(), SkGmMacStatistic(), SkXmResetCounter(),
- *	  SkGmResetCounter(), SkXmOverflowStatus(), SkGmOverflowStatus().
- *	Added defines for current link speed state.
- *	Added ERRMSG defintions for MacUpdateStat() & MacStatistics().
- *
- *	Revision 1.59  2002/07/15 15:40:22  rschmidt
- *	Added entry PLinkSpeedUsed to Port structure
- *	Editorial changes
- *
- *	Revision 1.58  2002/06/10 09:36:30  rschmidt
- *	Editorial changes.
- *
- *	Revision 1.57  2002/06/05 08:18:00  rschmidt
- *	Corrected alignment in Port Structure
- *	Added new prototypes for GMAC
- *	Editorial changes
- *
- *	Revision 1.56  2002/04/25 11:38:12  rschmidt
- *	Added defines for Link speed values
- *	Added defines for Loopback parameters for MAC and PHY
- *	Removed entry PRxCmd from Port structure
- *	Added entry PLinkSpeed to Port structure
- *	Added entries GIChipId and GIChipRev to GE Init structure
- *	Removed entry GIAnyPortAct from GE Init structure
- *	Added prototypes for: SkMacInit(), SkMacInitPhy(),
- *	SkMacRxTxDisable(), SkMacSoftRst(), SkMacHardRst(), SkMacIrq(),
- *	SkMacIrqDisable(), SkMacFlushTxFifo(), SkMacFlushRxFifo(),
- *	SkMacAutoNegDone(), SkMacAutoNegLipaPhy(), SkMacSetRxTxEn(),
- *	SkXmPhyRead(), SkXmPhyRead(), SkGmPhyWrite(), SkGmPhyWrite();
- *	Removed prototypes for static functions in SkXmac2.c
- *	Editorial changes
- *
- *	Revision 1.55  2002/02/26 15:24:53  rwahl
- *	Fix: no link with manual configuration (#10673). The previous fix for
- *	#10639 was removed. So for RLMT mode = CLS the RLMT may switch to
- *	misconfigured port. It should not occur for the other RLMT modes.
- *
- *	Revision 1.54  2002/01/18 16:52:52  rwahl
- *	Editorial corrections.
- *
- *	Revision 1.53  2001/11/20 09:19:58  rwahl
- *	Reworked bugfix #10639 (no dependency to RLMT mode).
- *
- *	Revision 1.52  2001/10/26 07:52:23  afischer
- *	Port switching bug in `check local link` mode
- *
- *	Revision 1.51  2001/02/09 12:26:38  cgoos
- *	Inserted #ifdef DIAG for half duplex workaround timer.
- *
- *	Revision 1.50  2001/02/07 07:56:40  rassmann
- *	Corrected copyright.
- *
- *	Revision 1.49  2001/01/31 15:32:18  gklug
- *	fix: problem with autosensing an SR8800 switch
- *	add: counter for autoneg timeouts
- *
- *	Revision 1.48  2000/11/09 11:30:10  rassmann
- *	WA: Waiting after releasing reset until BCom chip is accessible.
- *
- *	Revision 1.47  2000/10/18 12:22:40  cgoos
- *	Added workaround for half duplex hangup.
- *
- *	Revision 1.46  2000/08/10 11:28:00  rassmann
- *	Editorial changes.
- *	Preserving 32-bit alignment in structs for the adapter context.
- *
- *	Revision 1.45  1999/11/22 13:56:19  cgoos
- *	Changed license header to GPL.
- *
- *	Revision 1.44  1999/10/26 07:34:15  malthoff
- *	The define SK_LNK_ON has been lost in v1.41.
- *
- *	Revision 1.43  1999/10/06 09:30:16  cgoos
- *	Changed SK_XM_THR_JUMBO.
- *
- *	Revision 1.42  1999/09/16 12:58:26  cgoos
- *	Changed SK_LED_STANDY macro to be independent of HW link sync.
- *
- *	Revision 1.41  1999/07/30 06:56:14  malthoff
- *	Correct comment for SK_MS_STAT_UNSET.
- *
- *	Revision 1.40  1999/05/27 13:38:46  cgoos
- *	Added SK_BMU_TX_WM.
- *	Made SK_BMU_TX_WM and SK_BMU_RX_WM user-definable.
- *	Changed XMAC Tx treshold to max. values.
- *
- *	Revision 1.39  1999/05/20 14:35:26  malthoff
- *	Remove prototypes for SkGeLinkLED().
- *
- *	Revision 1.38  1999/05/19 11:59:12  cgoos
- *	Added SK_MS_CAP_INDETERMINATED define.
- *
- *	Revision 1.37  1999/05/19 07:32:33  cgoos
- *	Changes for 1000Base-T.
- *	LED-defines for HWAC_LINK_LED macro.
- *
- *	Revision 1.36  1999/04/08 14:00:24  gklug
- *	add:Port struct field PLinkResCt
- *
- *	Revision 1.35  1999/03/25 07:43:07  malthoff
- *	Add error string for SKERR_HWI_E018MSG.
- *
- *	Revision 1.34  1999/03/12 16:25:57  malthoff
- *	Remove PPollRxD and PPollTxD.
- *	Add SKERR_HWI_E017MSG. and SK_DPOLL_MAX.
- *
- *	Revision 1.33  1999/03/12 13:34:41  malthoff
- *	Add Autonegotiation error codes.
- *	Change defines for parameter Mode in SkXmSetRxCmd().
- *	Replace __STDC__ by SK_KR_PROTO.
- *
- *	Revision 1.32  1999/01/25 14:40:20  mhaveman
- *	Added new return states for the virtual management port if multiple
- *	ports are active but differently configured.
- *
- *	Revision 1.31  1998/12/11 15:17:02  gklug
- *	add: Link partnet autoneg states : Unknown Manual and Auto-negotiation
- *
- *	Revision 1.30  1998/12/07 12:17:04  gklug
- *	add: Link Partner auto-negotiation flag
- *
- *	Revision 1.29  1998/12/01 10:54:42  gklug
- *	add: variables for XMAC Errata
- *
- *	Revision 1.28  1998/12/01 10:14:15  gklug
- *	add: PIsave saves the Interrupt status word
- *
- *	Revision 1.27  1998/11/26 15:24:52  mhaveman
- *	Added link status states SK_LMODE_STAT_AUTOHALF and
- *	SK_LMODE_STAT_AUTOFULL which are used by PNMI.
- *
- *	Revision 1.26  1998/11/26 14:53:01  gklug
- *	add:autoNeg Timeout variable
- *
- *	Revision 1.25  1998/11/26 08:58:50  gklug
- *	add: Link Mode configuration (AUTO Sense mode)
- *
- *	Revision 1.24  1998/11/24 13:30:27  gklug
- *	add: PCheckPar to port struct
- *
- *	Revision 1.23  1998/11/18 13:23:26  malthoff
- *	Add SK_PKT_TO_MAX.
- *
- *	Revision 1.22  1998/11/18 13:19:54  gklug
- *	add: PPrevShorts and PLinkBroken to port struct for WA XMAC Errata #C1
- *
- *	Revision 1.21  1998/10/26 08:02:57  malthoff
- *	Add GIRamOffs.
- *
- *	Revision 1.20  1998/10/19 07:28:37  malthoff
- *	Add prototype for SkGeInitRamIface().
- *
- *	Revision 1.19  1998/10/14 14:47:48  malthoff
- *	SK_TIMER should not be defined for Diagnostics.
- *	Add SKERR_HWI_E015MSG and SKERR_HWI_E016MSG.
- *
- *	Revision 1.18  1998/10/14 14:00:03  gklug
- *	add: timer to port struct for workaround of Errata #2
- *
- *	Revision 1.17  1998/10/14 11:23:09  malthoff
- *	Add prototype for SkXmAutoNegDone().
- *	Fix SkXmSetRxCmd() prototype statement.
- *
- *	Revision 1.16  1998/10/14 05:42:29  gklug
- *	add: HWLinkUp flag to Port struct
- *
- *	Revision 1.15  1998/10/09 08:26:33  malthoff
- *	Rename SK_RB_ULPP_B to SK_RB_LLPP_B.
- *
- *	Revision 1.14  1998/10/09 07:11:13  malthoff
- *	bug fix: SK_FACT_53 is 85 not 117.
- *	Rework time out init values.
- *	Add GIPortUsage and corresponding defines.
- *	Add some error log messages.
- *
- *	Revision 1.13  1998/10/06 14:13:14  malthoff
- *	Add prototype for SkGeLoadLnkSyncCnt().
- *
- *	Revision 1.12  1998/10/05 11:29:53  malthoff
- *	bug fix: A comment was not closed.
- *
- *	Revision 1.11  1998/10/05 08:01:59  malthoff
- *	Add default Timeout- Threshold- and
- *	Watermark constants. Add QRam start and end
- *	variables. Also add vars to store the polling
- *	mode and receive command. Add new Error Log
- *	Messages and function prototypes.
- *
- *	Revision 1.10  1998/09/28 13:34:48  malthoff
- *	Add mode bits for LED functions.
- *	Move Autoneg and Flow Ctrl bits from shgesirq.h
- *	Add the required Error Log Entries
- *	and Function Prototypes.
- *
- *	Revision 1.9  1998/09/16 14:38:41  malthoff
- *	Rework the SK_LNK_xxx defines.
- *	Add error log message defines.
- *	Add prototypes for skxmac2.c
- *
- *	Revision 1.8  1998/09/11 05:29:18  gklug
- *	add: init state of a port
- *
- *	Revision 1.7  1998/09/08 08:35:52  gklug
- *	add: defines of the Init Levels
- *
- *	Revision 1.6  1998/09/03 13:48:42  gklug
- *	add: Link strati, capabilities to Port struct
- *
- *	Revision 1.5  1998/09/03 13:30:59  malthoff
- *	Add SK_LNK_BLINK and SK_LNK_PERM.
- *
- *	Revision 1.4  1998/09/03 09:55:31  malthoff
- *	Add constants for parameters Dir and RstMode
- *	when calling SkGeStopPort().
- *	Rework the prototype section.
- *	Add Queue Address offsets PRxQOff, PXsQOff, and PXaQOff.
- *	Remove Ioc with IoC.
- *
- *	Revision 1.3  1998/08/19 09:11:54  gklug
- *	fix: struct are removed from c-source (see CCC)
- *	add: typedefs for all structs
- *
- *	Revision 1.2  1998/07/28 12:38:26  malthoff
- *	The prototypes got the parameter 'IoC'.
- *
- *	Revision 1.1  1998/07/23 09:50:24  malthoff
- *	Created.
- *
- ******************************************************************************/
-
 #ifndef __INC_SKGEINIT_H_
 #define __INC_SKGEINIT_H_
 
--- diff/drivers/net/sk98lin/h/skgepnm2.h	2003-08-20 14:16:30.000000000 +0100
+++ source/drivers/net/sk98lin/h/skgepnm2.h	2004-02-09 10:39:54.000000000 +0000
@@ -2,8 +2,6 @@
  *
  * Name:	skgepnm2.h
  * Project:	GEnesis, PCI Gigabit Ethernet Adapter
- * Version:	$Revision: 1.36 $
- * Date:	$Date: 2003/05/23 12:45:13 $
  * Purpose:	Defines for Private Network Management Interface
  *
  ****************************************************************************/
@@ -22,144 +20,6 @@
  *
  ******************************************************************************/
 
-/*****************************************************************************
- *
- * History:
- *
- *	$Log: skgepnm2.h,v $
- *	Revision 1.36  2003/05/23 12:45:13  tschilli
- *	#ifndef SK_PNMI_HUNDREDS_SEC added to SK_PNMI_HUNDREDS_SEC definition
- *	to allow own time macro defines.
- *	
- *	Revision 1.35  2003/03/27 11:27:48  tschilli
- *	Copyright messages changed.
- *	
- *	Revision 1.34  2002/12/16 09:05:18  tschilli
- *	Code for VCT handling added.
- *	
- *	Revision 1.33  2002/09/10 09:00:03  rwahl
- *	Adapted boolean definitions according sktypes.
- *	
- *	Revision 1.32  2002/08/09 09:47:01  rwahl
- *	Added write-only flag to oid access defines.
- *	Editorial changes.
- *	
- *	Revision 1.31  2002/07/17 19:23:18  rwahl
- *	- Replaced MAC counter definitions by enumeration.
- *	- Added definition SK_PNMI_MAC_TYPES.
- *	- Added chipset defnition for Yukon.
- *	
- *	Revision 1.30  2001/02/06 10:03:41  mkunz
- *	- Pnmi V4 dual net support added. Interface functions and macros extended
- *	- Vpd bug fixed
- *	- OID_SKGE_MTU added
- *	
- *	Revision 1.29  2001/01/22 13:41:37  rassmann
- *	Supporting two nets on dual-port adapters.
- *	
- *	Revision 1.28  2000/08/03 15:12:48  rwahl
- *	- Additional comment for MAC statistic data structure.
- *	
- *	Revision 1.27  2000/08/01 16:10:18  rwahl
- *	- Added mac statistic data structure for StatRxLongFrame counter.
- *	
- *	Revision 1.26  2000/03/31 13:51:34  rwahl
- *	Added SK_UPTR cast to offset calculation for PNMI struct fields;
- *	missing cast caused compiler warnings by Win64 compiler.
- *	
- *	Revision 1.25  1999/11/22 13:57:41  cgoos
- *	Changed license header to GPL.
- *	Allowing overwrite for SK_PNMI_STORE/_READ defines.
- *	
- *	Revision 1.24  1999/04/13 15:11:11  mhaveman
- *	Changed copyright.
- *	
- *	Revision 1.23  1999/01/28 15:07:12  mhaveman
- *	Changed default threshold for port switches per hour from 10
- *	to 240 which means 4 switches per minute. This fits better
- *	the granularity of 32 for the port switch estimate
- *	counter.
- *	
- *	Revision 1.22  1999/01/05 12:52:30  mhaveman
- *	Removed macro SK_PNMI_MICRO_SEC.
- *	
- *	Revision 1.21  1999/01/05 12:50:34  mhaveman
- *	Enlarged macro definition SK_PNMI_HUNDREDS_SEC() so that no 64-bit
- *	arithmetic is necessary if SK_TICKS_PER_SEC is 100.
- *	
- *	Revision 1.20  1998/12/09 14:02:53  mhaveman
- *	Defined macro SK_PNMI_DEF_RLMT_CHG_THRES for default port switch
- *	threshold.
- *	
- *	Revision 1.19  1998/12/03 11:28:41  mhaveman
- *	Removed SK_PNMI_CHECKPTR macro.
- *	
- *	Revision 1.18  1998/12/03 11:21:00  mhaveman
- *	-Added pointer check macro SK_PNMI_CHECKPTR
- *	-Added macros SK_PNMI_VPD_ARR_SIZE and SK_PNMI_VPD_STR_SIZE for
- *	 VPD key evaluation.
- *	
- *	Revision 1.17  1998/11/20 13:20:33  mhaveman
- *	Fixed bug in SK_PNMI_SET_STAT macro. ErrorStatus was not correctly set.
- *	
- *	Revision 1.16  1998/11/20 08:08:49  mhaveman
- *	Macro SK_PNMI_CHECKFLAGS has got a if clause.
- *	
- *	Revision 1.15  1998/11/03 13:53:40  mhaveman
- *	Fixed alignment problem in macor SK_PNMI_SET_STAT macro.
- *	
- *	Revision 1.14  1998/10/30 15:50:13  mhaveman
- *	Added macro SK_PNMI_MICRO_SEC()
- *	
- *	Revision 1.13  1998/10/30 12:32:20  mhaveman
- *	Added forgotten cast in SK_PNMI_READ_U32 macro.
- *
- *	Revision 1.12  1998/10/29 15:40:26  mhaveman
- *	-Changed SK_PNMI_TRAP_SENSOR_LEN because SensorDescr has now
- *	 variable string length.
- *	-Defined SK_PNMI_CHECKFLAGS macro
- *	
- *	Revision 1.11  1998/10/29 08:53:34  mhaveman
- *	Removed SK_PNMI_RLM_XXX table indexed because these counters need
- *	not been saved over XMAC resets.
- *	
- *	Revision 1.10  1998/10/28 08:48:20  mhaveman
- *	-Added macros for storage according to alignment
- *	-Changed type of Instance to SK_U32 because of VPD
- *	-Removed trap structures. Not needed because of alignment problem
- *	-Changed type of Action form SK_U8 to int
- *	
- *	Revision 1.9  1998/10/21 13:34:45  mhaveman
- *	Shit, mismatched calculation of SK_PNMI_HUNDREDS_SEC. Corrected.
- *	
- *	Revision 1.8  1998/10/21 13:24:58  mhaveman
- *	Changed calculation of hundreds of seconds.
- *	
- *	Revision 1.7  1998/10/20 07:31:41  mhaveman
- *	Made type changes to unsigned int where possible.
- *	
- *	Revision 1.6  1998/09/04 17:04:05  mhaveman
- *	Added Sync counters to offset storage to provided settled values on
- *	port switch.
- *	
- *	Revision 1.5  1998/09/04 12:45:35  mhaveman
- *	Removed dummies for SK_DRIVER_ macros. They should be added by driver
- *	writer in skdrv2nd.h.
- *	
- *	Revision 1.4  1998/09/04 11:59:50  mhaveman
- *	Everything compiles now. Driver Macros for counting still missing.
- *	
- *	Revision 1.3  1998/08/24 12:01:35  mhaveman
- *	Intermediate state.
- *	
- *	Revision 1.2  1998/08/17 07:51:40  mhaveman
- *	Intermediate state.
- *	
- *	Revision 1.1  1998/08/11 09:08:40  mhaveman
- *	Intermediate state.
- *	
- ****************************************************************************/
-
 #ifndef _SKGEPNM2_H_
 #define _SKGEPNM2_H_
 
--- diff/drivers/net/sk98lin/h/skgepnmi.h	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/net/sk98lin/h/skgepnmi.h	2004-02-09 10:39:54.000000000 +0000
@@ -2,8 +2,6 @@
  *
  * Name:	skgepnmi.h
  * Project:	GEnesis, PCI Gigabit Ethernet Adapter
- * Version:	$Revision: 1.62 $
- * Date:	$Date: 2003/08/15 12:31:52 $
  * Purpose:	Defines for Private Network Management Interface
  *
  ****************************************************************************/
@@ -22,237 +20,6 @@
  *
  ******************************************************************************/
 
-/*****************************************************************************
- *
- * 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.
- *	OID_SKGE_BOARDLEVEL added.
- *	Return value SK_PNMI_ERR_NOT_SUPPORTED added.
- *	Editorial changes.
- *	
- *	Revision 1.60  2003/03/27 11:27:26  tschilli
- *	Copyright messages changed.
- *	
- *	Revision 1.59  2002/12/16 14:03:50  tschilli
- *	New defines for VCT added.
- *	
- *	Revision 1.58  2002/12/16 09:04:59  tschilli
- *	Code for VCT handling added.
- *	
- *	Revision 1.57  2002/09/26 12:41:05  tschilli
- *	SK_PNMI_PORT BufPort entry in struct SK_PNMI added.
- *	
- *	Revision 1.56  2002/08/16 11:10:41  rwahl
- *	- Replaced c++ comment.
- *	
- *	Revision 1.55  2002/08/09 15:40:21  rwahl
- *	Editorial change (renamed ConfSpeedCap).
- *	
- *	Revision 1.54  2002/08/09 11:06:07  rwahl
- *	Added OID_SKGE_SPEED_CAP.
- *	
- *	Revision 1.53  2002/08/09 09:45:28  rwahl
- *	Added support for NDIS OID_PNP_xxx.
- *	Editorial changes.
- *	
- *	Revision 1.52  2002/08/06 17:54:07  rwahl
- *	- Added speed cap to PNMI config struct.
- *	
- *	Revision 1.51  2002/07/17 19:19:26  rwahl
- *	- Added OID_SKGE_SPEED_MODE and OID_SKGE_SPEED_STATUS.
- *	- Added SK_PNMI_CNT_RX_PMACC_ERR() & SK_PNMI_CNT_RX_LONGFRAMES().
- *	- Added speed mode & status to PNMI config struct.
- *	- Editorial changes.
- *	
- *	Revision 1.50  2002/05/22 08:59:37  rwahl
- *	Added string definitions for error msgs.
- *	
- *	Revision 1.49  2001/11/20 09:23:50  rwahl
- *	- pnmi struct: reordered and aligned to 32bit.
- *	
- *	Revision 1.48  2001/02/23 14:34:24  mkunz
- *	Changed macro PHYS2INST. Added pAC to Interface
- *	
- *	Revision 1.47  2001/02/07 08:28:23  mkunz
- *	- Added Oids: 	OID_SKGE_DIAG_ACTION
- *					OID_SKGE_DIAG_RESULT
- *					OID_SKGE_MULTICAST_LIST
- *					OID_SKGE_CURRENT_PACKET_FILTER
- *					OID_SKGE_INTERMEDIATE_SUPPORT
- *	- Changed value of OID_SKGE_MTU
- *	
- *	Revision 1.46  2001/02/06 10:01:41  mkunz
- *	- Pnmi V4 dual net support added. Interface functions and macros extended
- *	- Vpd bug fixed
- *	- OID_SKGE_MTU added
- *	
- *	Revision 1.45  2001/01/22 13:41:37  rassmann
- *	Supporting two nets on dual-port adapters.
- *	
- *	Revision 1.44  2000/09/07 07:35:27  rwahl
- *	- removed NDIS counter specific data type.
- *	- fixed spelling for OID_SKGE_RLMT_PORT_PREFERRED.
- *	
- *	Revision 1.43  2000/08/04 11:41:08  rwahl
- *	- Fixed compiler warning (port is always >= 0) for macros
- *	  SK_PNMI_CNT_RX_LONGFRAMES & SK_PNMI_CNT_SYNC_OCTETS
- *	
- *	Revision 1.42  2000/08/03 15:14:07  rwahl
- *	- Corrected error in driver macros addressing a physical port.
- *	
- *	Revision 1.41  2000/08/01 16:22:29  rwahl
- *	- Changed MDB version to 3.1.
- *	- Added definitions for StatRxLongFrames counter.
- *	- Added macro to be used by driver to count long frames received.
- *	- Added directive to control width (default = 32bit) of NDIS statistic
- *	  counters (SK_NDIS_64BIT_CTR).
- *	
- *	Revision 1.40  2000/03/31 13:51:34  rwahl
- *	Added SK_UPTR cast to offset calculation for PNMI struct fields;
- *	missing cast caused compiler warnings by Win64 compiler.
- *
- *	Revision 1.39  1999/12/06 10:09:47  rwahl
- *	Added new error log message.
- *	
- *	Revision 1.38  1999/11/22 13:57:55  cgoos
- *	Changed license header to GPL.
- *
- *	Revision 1.37  1999/09/14 14:25:32  rwahl
- *	Set MDB version for 1000Base-T (sensors, Master/Slave) changes.
- *	
- *	Revision 1.36  1999/05/20 09:24:56  cgoos
- *	Changes for 1000Base-T (sensors, Master/Slave).
- *	
- *	Revision 1.35  1999/04/13 15:10:51  mhaveman
- *	Replaced RLMT macros SK_RLMT_CHECK_xxx again by those of PNMI to
- *	grant unified interface. But PNMI macros will store the same
- *	value as RLMT macros.
- *	
- *	Revision 1.34  1999/04/13 15:03:49  mhaveman
- *	-Changed copyright
- *	-Removed SK_PNMI_RLMT_MODE_CHK_xxx macros. Those of RLMT should be
- *	 used.
- *	
- *	Revision 1.33  1999/03/23 10:41:02  mhaveman
- *	Changed comments.
- *	
- *	Revision 1.32  1999/01/25 15:01:33  mhaveman
- *	Added support for multiple simultaniously active ports.
- *	
- *	Revision 1.31  1999/01/19 10:06:26  mhaveman
- *	Added new error log message.
- *	
- *	Revision 1.30  1999/01/05 10:34:49  mhaveman
- *	Fixed little error in RlmtChangeEstimate calculation.
- *	
- *	Revision 1.29  1999/01/05 09:59:41  mhaveman
- *	Redesigned port switch average calculation to avoid 64bit
- *	arithmetic.
- *	
- *	Revision 1.28  1998/12/08 10:05:48  mhaveman
- *	Defined macro SK_PNMI_MIN_STRUCT_SIZE.
- *	
- *	Revision 1.27  1998/12/03 14:39:35  mhaveman
- *	Fixed problem that LSTAT was enumerated wrong.
- *	
- *	Revision 1.26  1998/12/03 11:19:51  mhaveman
- *	Changed contents of errlog message SK_PNMI_ERR016MSG
- *	
- *	Revision 1.25  1998/12/01 10:40:04  mhaveman
- *	Changed size of SensorNumber, ChecksumNumber and RlmtPortNumber in
- *	SK_PNMI_STRUCT_DATA to be conform with OID definition.
- *	
- *	Revision 1.24  1998/11/20 08:09:27  mhaveman
- *	Added macros to convert between logical, physical port indexes and
- *	instances.
- *	
- *	Revision 1.23  1998/11/10 13:41:13  mhaveman
- *	Needed to change interface, because NT driver needs a return value
- *	of needed buffer space on TOO_SHORT errors. Therefore all
- *	SkPnmiGet/Preset/Set functions now have a pointer to the length
- *	parameter, where the needed space on error is returned.
- *	
- *	Revision 1.22  1998/11/03 12:05:51  mhaveman
- *	Added pAC parameter to counter macors.
- *
- *	Revision 1.21  1998/11/02 10:47:36  mhaveman
- *	Added syslog messages for internal errors.
- *	
- *	Revision 1.20  1998/10/30 15:49:36  mhaveman
- *	-Removed unused SK_PNMI_UTILIZATION_BASE and EstOldCnt.
- *	-Redefined SK_PNMI_CHG_EST_BASE to hundreds of seconds.
- *	
- *	Revision 1.19  1998/10/29 15:38:44  mhaveman
- *	Changed string lengths of PNMI_STRUCT_DATA structure because
- *	string OIDs are now encoded with leading length ocetet.
- *	
- *	Revision 1.18  1998/10/29 08:52:27  mhaveman
- *	-Added byte to strings in PNMI_STRUCT_DATA structure.
- *	-Shortened SK_PNMI_RLMT structure to SK_MAX_MACS elements.
- *	
- *	Revision 1.17  1998/10/28 08:49:50  mhaveman
- *	-Changed type of Instance back to SK_U32 because of VPD
- *	-Changed type from SK_U8 to char of PciBusSpeed, PciBusWidth, PMD,
- *	 and Connector.
- *	
- *	Revision 1.16  1998/10/22 10:42:31  mhaveman
- *	-Removed (SK_U32) casts for OIDs
- *	-excluded NDIS OIDs when they are already defined with ifndef _NDIS_
- *	
- *	Revision 1.15  1998/10/20 13:56:28  mhaveman
- *	Headerfile includes now directly other header files to comile correctly.
- *	
- *	Revision 1.14  1998/10/20 07:31:09  mhaveman
- *	Made type changes to unsigned int where possible.
- *	
- *	Revision 1.13  1998/10/19 10:53:13  mhaveman
- *	-Casted OID definitions to SK_U32
- *	-Renamed RlmtMAC... to RlmtPort...
- *	-Changed wrong type of VpdEntriesList from SK_U32 to char *
- *	
- *	Revision 1.12  1998/10/13 07:42:27  mhaveman
- *	-Added OIDs OID_SKGE_TRAP_NUMBER and OID_SKGE_ALL_DATA
- *	-Removed old cvs history entries
- *	-Renamed MacNumber to PortNumber
- *	
- *	Revision 1.11  1998/10/07 10:55:24  mhaveman
- *	-Added OID_MDB_VERSION. Therefore was a renumbering of the VPD OIDs
- *	 necessary.
- *	-Added OID_GEN_ Ids to support the windows driver.
- *	
- *	Revision 1.10  1998/09/30 13:41:10  mhaveman
- *	Renamed some OIDs to reduce usage of 'MAC' which is replaced by 'PORT'.
- *	
- *	Revision 1.9  1998/09/04 17:06:17  mhaveman
- *	-Added SyncCounter as macro.
- *	-Renamed OID_SKGE_.._NO_DESCR_CTS to OID_SKGE_.._NO_BUF_CTS.
- *	-Added macros for driver description and version strings.
- *	
- *	Revision 1.8  1998/09/04 14:36:52  mhaveman
- *	Added OIDs and Structure to access value of macro counters which are
- *	counted by the driver.
- *	
- *	Revision 1.7  1998/09/04 11:59:36  mhaveman
- *	Everything compiles now. Driver Macros for counting still missing.
- *	
- ****************************************************************************/
-
 #ifndef _SKGEPNMI_H_
 #define _SKGEPNMI_H_
 
--- diff/drivers/net/sk98lin/h/skgesirq.h	2003-08-20 14:16:30.000000000 +0100
+++ source/drivers/net/sk98lin/h/skgesirq.h	2004-02-09 10:39:54.000000000 +0000
@@ -2,8 +2,6 @@
  *
  * Name:	skgesirq.h
  * Project:	Gigabit Ethernet Adapters, Common Modules
- * Version:	$Revision: 1.30 $
- * Date:	$Date: 2003/07/04 12:34:13 $
  * Purpose:	SK specific Gigabit Ethernet special IRQ functions
  *
  ******************************************************************************/
@@ -22,111 +20,6 @@
  *
  ******************************************************************************/
 
-/******************************************************************************
- *
- * History:
- *	$Log: skgesirq.h,v $
- *	Revision 1.30  2003/07/04 12:34:13  rschmidt
- *	Added SKERR_SIRQ_E025 for Downshift detected (Yukon-Copper)
- *	
- *	Revision 1.29  2003/05/28 15:14:49  rschmidt
- *	Moved defines for return codes of SkGePortCheckUp() to header file.
- *	Minor changes to avoid LINT warnings.
- *	
- *	Revision 1.28  2003/05/13 17:22:43  mkarl
- *	Editorial changes.
- *	
- *	Revision 1.27  2003/03/31 07:32:34  mkarl
- *	Corrected Copyright.
- *	Editorial changes.
- *	
- *	Revision 1.26  2002/10/14 09:52:36  rschmidt
- *	Added SKERR_SIRQ_E023 and SKERR_SIRQ_E024 for GPHY (Yukon)
- *	Editorial changes
- *	
- *	Revision 1.25  2002/07/15 18:15:52  rwahl
- *	Editorial changes.
- *	
- *	Revision 1.24  2002/07/15 15:39:21  rschmidt
- *	Corrected define for SKERR_SIRQ_E022
- *	Editorial changes
- *	
- *	Revision 1.23  2002/04/25 11:09:45  rschmidt
- *	Removed declarations for SkXmInitPhy(), SkXmRxTxEnable()
- *	Editorial changes
- *	
- *	Revision 1.22  2000/11/09 11:30:10  rassmann
- *	WA: Waiting after releasing reset until BCom chip is accessible.
- *	
- *	Revision 1.21  2000/10/18 12:22:40  cgoos
- *	Added workaround for half duplex hangup.
- *	
- *	Revision 1.20  1999/12/06 10:00:44  cgoos
- *	Added SET event for role.
- *	
- *	Revision 1.19  1999/11/22 13:58:26  cgoos
- *	Changed license header to GPL.
- *	
- *	Revision 1.18  1999/05/19 07:32:59  cgoos
- *	Changes for 1000Base-T.
- *	
- *	Revision 1.17  1999/03/12 13:29:31  malthoff
- *	Move Autonegotiation Error Codes to skgeinit.h.
- *	
- *	Revision 1.16  1999/03/08 10:11:28  gklug
- *	add: AutoNegDone return codes
- *	
- *	Revision 1.15  1998/11/18 13:20:53  gklug
- *	add: different timeouts for active and non-active links
- *	
- *	Revision 1.14  1998/11/04 07:18:14  cgoos
- *	Added prototype for SkXmRxTxEnable.
- *	
- *	Revision 1.13  1998/10/21 05:52:23  gklug
- *	add: parameter DoLoop to InitPhy function
- *	
- *	Revision 1.12  1998/10/19 06:45:03  cgoos
- *	Added prototype for SkXmInitPhy.
- *	
- *	Revision 1.11  1998/10/15 14:34:10  gklug
- *	add: WA_TIME is 500 msec
- *	
- *	Revision 1.10  1998/10/14 14:49:41  malthoff
- *	Remove err log defines E021 and E022. They are
- *	defined in skgeinit.h now.
- *
- *	Revision 1.9  1998/10/14 14:00:39  gklug
- *	add: error logs for init phys
- *	
- *	Revision 1.8  1998/10/14 05:44:05  gklug
- *	add: E020
- *	
- *	Revision 1.7  1998/10/02 06:24:58  gklug
- *	add: error messages
- *	
- *	Revision 1.6  1998/10/01 07:54:45  gklug
- *	add: PNMI debug module
- *	
- *	Revision 1.5  1998/09/28 13:36:31  malthoff
- *	Move the bit definitions for Autonegotiation
- *	and Flow Control to skgeinit.h.
- *	
- *	Revision 1.4  1998/09/15 12:29:34  gklug
- *	add: error logs
- *	
- *	Revision 1.3  1998/09/03 13:54:02  gklug
- *	add: function prototypes
- *	
- *	Revision 1.2  1998/09/03 10:24:36  gklug
- *	add: Events send by PNMI
- *	add: parameter definition for Flow Control etc.
- *	
- *	Revision 1.1  1998/08/27 11:50:27  gklug
- *	initial revision
- *	
- *
- ******************************************************************************/
-
 #ifndef _INC_SKGESIRQ_H_
 #define _INC_SKGESIRQ_H_
 
--- diff/drivers/net/sk98lin/h/ski2c.h	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/net/sk98lin/h/ski2c.h	2004-02-09 10:39:54.000000000 +0000
@@ -2,8 +2,6 @@
  *
  * Name:	ski2c.h
  * 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
  *
  ******************************************************************************/
@@ -22,128 +20,6 @@
  *
  ******************************************************************************/
 
-/******************************************************************************
- *
- * 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
- *	
- *	Revision 1.33  2002/10/14 16:40:50  rschmidt
- *	Editorial changes (TWSI)
- *	
- *	Revision 1.32  2002/08/13 08:55:07  rschmidt
- *	Editorial changes
- *	
- *	Revision 1.31  2002/08/06 09:44:22  jschmalz
- *	Extensions and changes for Yukon
- *	
- *	Revision 1.30  2001/04/05 11:38:09  rassmann
- *	Set SenState to idle in SkI2cWaitIrq().
- *	Changed error message in SkI2cWaitIrq().
- *	
- *	Revision 1.29  2000/08/03 14:28:17  rassmann
- *	- Added function to wait for I2C being ready before resetting the board.
- *	- Replaced one duplicate "out of range" message with correct one.
- *	
- *	Revision 1.28  1999/11/22 13:55:46  cgoos
- *	Changed license header to GPL.
- *	
- *	Revision 1.27  1999/05/20 09:23:10  cgoos
- *	Changes for 1000Base-T (Fan sensors).
- *	
- *	Revision 1.26  1998/12/01 13:45:47  gklug
- *	add: InitLevel to I2c struct
- *	
- *	Revision 1.25  1998/11/03 06:55:16  gklug
- *	add: Dummy Reads to I2c struct
- *	
- *	Revision 1.24  1998/10/02 14:28:59  cgoos
- *	Added prototype for SkI2cIsr.
- *	
- *	Revision 1.23  1998/09/08 12:20:11  gklug
- *	add: prototypes for init and read functions
- *	
- *	Revision 1.22  1998/09/08 07:37:56  gklug
- *	add: log error if PCI_IO voltage sensor could not be initialized
- *	
- *	Revision 1.21  1998/09/04 08:38:05  malthoff
- *	Change the values for I2C_READ and I2C_WRITE
- *	
- *	Revision 1.20  1998/08/25 07:52:22  gklug
- *	chg: Timestamps (last) added for logging
- *
- *	Revision 1.19  1998/08/25 06:09:00  gklug
- *	rmv: warning and error levels of the individual sensors.
- *	add: timing definitions for sending traps and logging errors
- *	
- *	Revision 1.18  1998/08/20 11:41:15  gklug
- *	chg: omit STRCPY macro by using char * as Sensor Description
- *	
- *	Revision 1.17  1998/08/20 11:37:43  gklug
- *	chg: change Ioc to IoC
- *	
- *	Revision 1.16  1998/08/20 11:30:38  gklug
- *	fix: SenRead declaration
- *	
- *	Revision 1.15  1998/08/20 11:27:53  gklug
- *	fix: Compile bugs with new awrning constants
- *	
- *	Revision 1.14  1998/08/20 08:53:12  gklug
- *	fix: compiler errors
- *	add: Threshold values
- *	
- *	Revision 1.13  1998/08/19 12:21:16  gklug
- *	fix: remove struct from C files (see CCC)
- *	add: typedefs for all structs
- *	
- *	Revision 1.12  1998/08/19 10:57:41  gklug
- *	add: Warning levels
- *	
- *	Revision 1.11  1998/08/18 08:37:02  malthoff
- *	Prototypes not required for SK_DIAG.
- *	
- *	Revision 1.10  1998/08/17 13:54:00  gklug
- *	fix: declaration of event function
- *	
- *	Revision 1.9  1998/08/17 06:48:39  malthoff
- *	Remove some unrequired macros.
- *	Fix the compiler errors.
- *	
- *	Revision 1.8  1998/08/14 06:47:19  gklug
- *	fix: Values are intergers
- *
- *	Revision 1.7  1998/08/14 06:26:05  gklug
- *	add: Init error message
- *
- *	Revision 1.6  1998/08/13 08:31:08  gklug
- *	add: Error message
- *
- *	Revision 1.5  1998/08/12 14:32:04  gklug
- *	add: new error code/message
- *
- *	Revision 1.4  1998/08/12 13:39:08  gklug
- *	chg: names of error messages
- *	add: defines for Sensor type and thresholds
- *
- *	Revision 1.3  1998/08/11 07:57:16  gklug
- *	add: sensor struct
- *	add: Timeout defines
- *	add: I2C control struct for pAC
- *
- *	Revision 1.2  1998/07/17 11:29:02  gklug
- *	rmv: Microwire and SMTPANIC
- *
- *	Revision 1.1  1998/06/19 14:30:10  malthoff
- *	Created. Sources taken from ML Project.
- *
- ******************************************************************************/
-
 /*
  * SKI2C.H	contains all I2C specific defines
  */
--- diff/drivers/net/sk98lin/h/skqueue.h	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/net/sk98lin/h/skqueue.h	2004-02-09 10:39:54.000000000 +0000
@@ -2,8 +2,6 @@
  *
  * Name:	skqueue.h
  * 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
  *
  ******************************************************************************/
@@ -22,68 +20,6 @@
  *
  ******************************************************************************/
 
-/******************************************************************************
- *
- * 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.
- *	
- *	Revision 1.14  2002/03/15 10:52:13  mkunz
- *	Added event classes for link aggregation
- *	
- *	Revision 1.13  1999/11/22 13:59:05  cgoos
- *	Changed license header to GPL.
- *	
- *	Revision 1.12  1998/09/08 08:48:01  gklug
- *	add: init level handling
- *	
- *	Revision 1.11  1998/09/03 14:15:11  gklug
- *	add: CSUM and HWAC Eventclass and function.
- *	fix: pParaPtr according to CCC
- *	
- *	Revision 1.10  1998/08/20 12:43:03  gklug
- *	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
- *	
- *	Revision 1.8  1998/08/18 07:00:01  gklug
- *	fix: SK_PTR not defined use void * instead.
- *	
- *	Revision 1.7  1998/08/17 13:43:19  gklug
- *	chg: Parameter will be union of 64bit para, 2 times SK_U32 or SK_PTR
- *	
- *	Revision 1.6  1998/08/14 07:09:30  gklug
- *	fix: chg pAc -> pAC
- *	
- *	Revision 1.5  1998/08/11 14:26:44  gklug
- *	chg: Event Dispatcher returns now int.
- *	
- *	Revision 1.4  1998/08/11 12:15:21  gklug
- *	add: Error numbers of skqueue module
- *	
- *	Revision 1.3  1998/08/07 12:54:23  gklug
- *	fix: first compiled version
- *	
- *	Revision 1.2  1998/08/07 09:34:00  gklug
- *	adapt structure defs to CCC
- *	add: prototypes for functions
- *	
- *	Revision 1.1  1998/07/30 14:52:12  gklug
- *	Initial version.
- *	Defines Event Classes, Event structs and queue management variables.
- *
- ******************************************************************************/
-
-/*
- * SKQUEUE.H	contains all defines and types for the event queue
- */
-
 #ifndef _SKQUEUE_H_
 #define _SKQUEUE_H_
 
--- diff/drivers/net/sk98lin/h/skrlmt.h	2003-08-20 14:16:30.000000000 +0100
+++ source/drivers/net/sk98lin/h/skrlmt.h	2004-02-09 10:39:54.000000000 +0000
@@ -2,8 +2,6 @@
  *
  * Name:	skrlmt.h
  * Project:	GEnesis, PCI Gigabit Ethernet Adapter
- * Version:	$Revision: 1.37 $
- * Date:	$Date: 2003/04/15 09:43:43 $
  * Purpose:	Header file for Redundant Link ManagemenT.
  *
  ******************************************************************************/
@@ -24,137 +22,6 @@
 
 /******************************************************************************
  *
- * History:
- *
- *	$Log: skrlmt.h,v $
- *	Revision 1.37  2003/04/15 09:43:43  tschilli
- *	Copyright messages changed.
- *	
- *	Revision 1.36  2003/04/14 15:56:22  tschilli
- *	"#error C++ is not yet supported." removed.
- *	
- *	Revision 1.35  2003/01/31 14:12:41  mkunz
- *	single port adapter runs now with two identical MAC addresses
- *	
- *	Revision 1.34  2002/09/23 15:13:41  rwahl
- *	Editorial changes.
- *	
- *	Revision 1.33  2001/07/03 12:16:48  mkunz
- *	New Flag ChgBcPrio (Change priority of last broadcast received)
- *	
- *	Revision 1.32  2001/02/14 14:06:31  rassmann
- *	Editorial changes.
- *	
- *	Revision 1.31  2001/02/05 14:25:26  rassmann
- *	Prepared RLMT for transparent operation.
- *	
- *	Revision 1.30  2001/01/22 13:41:39  rassmann
- *	Supporting two nets on dual-port adapters.
- *	
- *	Revision 1.29  2000/11/17 08:58:00  rassmann
- *	Moved CheckSwitch from SK_RLMT_PACKET_RECEIVED to SK_RLMT_TIM event.
- *	
- *	Revision 1.28  2000/11/09 12:24:34  rassmann
- *	Editorial changes.
- *	
- *	Revision 1.27  1999/11/22 13:59:56  cgoos
- *	Changed license header to GPL.
- *	
- *	Revision 1.26  1999/10/04 14:01:19  rassmann
- *	Corrected reaction to reception of BPDU frames (#10441).
- *	
- *	Revision 1.25  1999/07/20 12:53:39  rassmann
- *	Fixed documentation errors for lookahead macros.
- *	
- *	Revision 1.24  1999/05/28 11:15:56  rassmann
- *	Changed behaviour to reflect Design Spec v1.2.
- *	Controlling Link LED(s).
- *	Introduced RLMT Packet Version field in RLMT Packet.
- *	Newstyle lookahead macros (checking meta-information before looking at
- *	  the packet).
- *	
- *	Revision 1.23  1999/01/28 12:50:42  rassmann
- *	Not using broadcast time stamps in CheckLinkState mode.
- *	
- *	Revision 1.22  1999/01/27 14:13:04  rassmann
- *	Monitoring broadcast traffic.
- *	Switching more reliably and not too early if switch is
- *	 configured for spanning tree.
- *	
- *	Revision 1.21  1998/12/08 13:11:25  rassmann
- *	Stopping SegTimer at RlmtStop.
- *	
- *	Revision 1.20  1998/11/24 12:37:33  rassmann
- *	Implemented segmentation check.
- *	
- *	Revision 1.19  1998/11/17 13:43:06  rassmann
- *	Handling (logical) tx failure.
- *	Sending packet on logical address after PORT_SWITCH.
- *	
- *	Revision 1.18  1998/11/13 16:56:56  rassmann
- *	Added macro version of SkRlmtLookaheadPacket.
- *	
- *	Revision 1.17  1998/11/06 18:06:05  rassmann
- *	Corrected timing when RLMT checks fail.
- *	Clearing tx counter earlier in periodical checks.
- *	
- *	Revision 1.16  1998/11/03 13:53:50  rassmann
- *	RLMT should switch now (at least in mode 3).
- *	
- *	Revision 1.15  1998/10/22 11:39:52  rassmann
- *	Corrected signed/unsigned mismatches.
- *	Corrected receive list handling and address recognition.
- *	
- *	Revision 1.14  1998/10/15 15:16:36  rassmann
- *	Finished Spanning Tree checking.
- *	Checked with lint.
- *	
- *	Revision 1.13  1998/09/24 19:16:08  rassmann
- *	Code cleanup.
- *	Introduced Timer for PORT_DOWN due to no RX.
- *	
- *	Revision 1.12  1998/09/16 11:09:52  rassmann
- *	Syntax corrections.
- *	
- *	Revision 1.11  1998/09/15 11:28:50  rassmann
- *	Syntax corrections.
- *	
- *	Revision 1.10  1998/09/14 17:07:38  rassmann
- *	Added code for port checking via LAN.
- *	Changed Mbuf definition.
- *	
- *	Revision 1.9  1998/09/07 11:14:15  rassmann
- *	Syntax corrections.
- *	
- *	Revision 1.8  1998/09/07 09:06:08  rassmann
- *	Syntax corrections.
- *	
- *	Revision 1.7  1998/09/04 19:41:34  rassmann
- *	Syntax corrections.
- *	Started entering code for checking local links.
- *	
- *	Revision 1.6  1998/09/04 12:14:28  rassmann
- *	Interface cleanup.
- *	
- *	Revision 1.5  1998/09/02 16:55:29  rassmann
- *	Updated to reflect new DRV/HWAC/RLMT interface.
- *	
- *	Revision 1.4  1998/09/02 07:26:02  afischer
- *	typedef for SK_RLMT_PORT
- *
- *	Revision 1.3  1998/08/27 14:29:03  rassmann
- *	Code cleanup.
- *	
- *	Revision 1.2  1998/08/27 14:26:25  rassmann
- *	Updated interface.
- *	
- *	Revision 1.1  1998/08/21 08:29:10  rassmann
- *	First public version.
- *	
- ******************************************************************************/
-
-/******************************************************************************
- *
  * Description:
  *
  * This is the header file for Redundant Link ManagemenT.
--- diff/drivers/net/sk98lin/h/sktimer.h	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/net/sk98lin/h/sktimer.h	2004-02-09 10:39:54.000000000 +0000
@@ -2,8 +2,6 @@
  *
  * Name:	sktimer.h
  * 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
  *
  ******************************************************************************/
@@ -22,48 +20,6 @@
  *
  ******************************************************************************/
 
-/******************************************************************************
- *
- * 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.
- *	
- *	Revision 1.9  1999/11/22 14:00:29  cgoos
- *	Changed license header to GPL.
- *	
- *	Revision 1.8  1998/09/08 08:48:02  gklug
- *	add: init level handling
- *	
- *	Revision 1.7  1998/08/20 12:31:29  gklug
- *	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
- *	
- *	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
- *	
- *	Revision 1.4  1998/08/14 07:09:31  gklug
- *	fix: chg pAc -> pAC
- *	
- *	Revision 1.3  1998/08/07 12:54:24  gklug
- *	fix: first compiled version
- *	
- *	Revision 1.2  1998/08/07 09:35:29  gklug
- *	add: Timer control struct for Adapters context
- *	add: function prototypes
- *	
- *	Revision 1.1  1998/08/05 11:27:01  gklug
- *	First version: adapted from SMT
- *	
- *
- ******************************************************************************/
-
 /*
  * SKTIMER.H	contains all defines and types for the timer functions
  */
--- diff/drivers/net/sk98lin/h/sktypes.h	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/net/sk98lin/h/sktypes.h	2004-02-09 10:39:54.000000000 +0000
@@ -2,8 +2,6 @@
  *
  * Name:	sktypes.h
  * Project:	GEnesis, PCI Gigabit Ethernet Adapter
- * Version:	$Revision: 1.2 $
- * Date:	$Date: 2003/10/07 08:16:51 $
  * Purpose:	Define data types for Linux
  *
  ******************************************************************************/
@@ -22,31 +20,6 @@
  *
  ******************************************************************************/
  
- /*****************************************************************************
- *
- * 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
- *	
- *	Revision 1.3  2003/02/25 14:16:40  mlindner
- *	Fix: Copyright statement
- *	
- *	Revision 1.2  1999/11/22 14:01:58  cgoos
- *	Changed license header to GPL.
- *	Now using Linux' fixed size types instead of standard types.
- *	
- *	Revision 1.1  1999/02/16 07:41:40  cgoos
- *	First version.
- *	
- *	
- *
- *****************************************************************************/
-
 /******************************************************************************
  *
  * Description:
--- diff/drivers/net/sk98lin/h/skversion.h	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/net/sk98lin/h/skversion.h	2004-02-09 10:39:54.000000000 +0000
@@ -2,8 +2,6 @@
  *
  * Name:	version.h
  * Project:	GEnesis, PCI Gigabit Ethernet Adapter
- * Version:	$Revision: 1.5 $
- * Date:	$Date: 2003/10/07 08:16:51 $
  * Purpose:	SK specific Error log support
  *
  ******************************************************************************/
@@ -22,42 +20,6 @@
  *
  ******************************************************************************/
 
-/******************************************************************************
- *
- * 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
- *	
- *	Revision 1.2  2003/08/13 12:01:01  mlindner
- *	Add: Changes for Lint
- *	
- *	Revision 1.1  2003/07/24 09:29:56  rroesler
- *	Fix: Re-Enter after CVS crash
- *	
- *	Revision 1.4  2003/02/25 14:16:40  mlindner
- *	Fix: Copyright statement
- *	
- *	Revision 1.3  2003/02/25 13:30:18  mlindner
- *	Add: Support for various vendors
- *	
- *	Revision 1.1.2.1  2001/09/05 13:38:30  mlindner
- *	Removed FILE description
- *	
- *	Revision 1.1  2001/03/06 09:25:00  mlindner
- *	first version
- *	
- *	
- *
- ******************************************************************************/
- 
- 
 #ifdef	lint
 static const char SysKonnectFileId[] = "@(#) (C) SysKonnect GmbH.";
 static const char SysKonnectBuildNumber[] =
--- diff/drivers/net/sk98lin/h/skvpd.h	2003-08-20 14:16:30.000000000 +0100
+++ source/drivers/net/sk98lin/h/skvpd.h	2004-02-09 10:39:54.000000000 +0000
@@ -2,8 +2,6 @@
  *
  * Name:	skvpd.h
  * Project:	GEnesis, PCI Gigabit Ethernet Adapter
- * Version:	$Revision: 1.15 $
- * Date:	$Date: 2003/01/13 10:39:38 $
  * Purpose:	Defines and Macros for VPD handling
  *
  ******************************************************************************/
@@ -21,70 +19,6 @@
  *
  ******************************************************************************/
 
-/******************************************************************************
- *
- * History:
- *
- *	$Log: skvpd.h,v $
- *	Revision 1.15  2003/01/13 10:39:38  rschmidt
- *	Replaced define for PCI device Id for YUKON with GENESIS
- *	Editorial changes
- *	
- *	Revision 1.14  2002/11/14 15:18:10  gheinig
- *	Added const specifier to key and buf parameters for VpdPara,VpdRead
- *	and VpdWrite. This is necessary for the Diag 7 GUI API
- *	
- *	Revision 1.13  2002/10/14 15:58:18  rschmidt
- *	Added entry in rom_size struct s_vpd
- *	Editorial changes
- *	
- *	Revision 1.12  2002/09/09 14:43:51  mkarl
- *	added PCI Id of Yukon for reading VPD in diag before the adapter has
- *	been initialized
- *	editorial changes
- *	
- *	Revision 1.11  2002/07/26 13:19:16  mkarl
- *	added support for Yukon
- *	added vpd_size to VPD struct
- *	
- *	Revision 1.10  2000/08/10 11:29:07  rassmann
- *	Editorial changes.
- *	Preserving 32-bit alignment in structs for the adapter context.
- *	Removed unused function VpdWriteDword() (#if 0).
- *	Made VpdReadKeyword() available for SKDIAG only.
- *	
- *	Revision 1.9  1999/11/22 14:02:27  cgoos
- *	Changed license header to GPL.
- *	
- *	Revision 1.8  1999/03/11 14:26:40  malthoff
- *	Replace __STDC__ with SK_KR_PROTO.
- *	
- *	Revision 1.7  1998/10/28 07:27:17  gklug
- *	rmv: SWAP macros
- *	add: VPD_IN/OUT8 macros
- *	chg: interface definition
- *	
- *	Revision 1.6  1998/10/22 10:03:44  gklug
- *	fix: use SK_OUT16 instead of SK_OUTW
- *	
- *	Revision 1.5  1998/10/14 07:05:31  cgoos
- *	Changed constants in SK_SWAP_32 to UL.
- *	
- *	Revision 1.4  1998/08/19 08:14:09  gklug
- *	fix: remove struct keyword as much as possible from the C-code (see CCC)
- *	
- *	Revision 1.3  1998/08/18 08:18:56  malthoff
- *	Modify VPD in and out macros for SK_DIAG
- *	
- *	Revision 1.2  1998/07/03 14:49:08  malthoff
- *	Add VPD_INxx() and VPD_OUTxx() macros for the Diagnostics tool.
- *	
- *	Revision 1.1  1998/06/19 14:08:03  malthoff
- *	Created.
- *	
- *
- ******************************************************************************/
-
 /*
  * skvpd.h	contains Diagnostic specific defines for VPD handling
  */
--- diff/drivers/net/sk98lin/h/xmac_ii.h	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/net/sk98lin/h/xmac_ii.h	2004-02-09 10:39:54.000000000 +0000
@@ -2,8 +2,6 @@
  *
  * Name:	xmac_ii.h
  * Project:	Gigabit Ethernet Adapters, Common Modules
- * Version:	$Revision: 1.52 $
- * Date:	$Date: 2003/10/02 16:35:50 $
  * Purpose:	Defines and Macros for Gigabit Ethernet Controller
  *
  ******************************************************************************/
@@ -22,207 +20,6 @@
  *
  ******************************************************************************/
 
-/******************************************************************************
- *
- * 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.
- *	
- *	Revision 1.47  2003/03/31 07:37:25  mkarl
- *	Corrected Copyright.
- *	Editorial changes.
- *	
- *	Revision 1.46  2003/01/28 09:47:45  rschmidt
- *	Added defines for copper MDI/MDIX configuration
- *	Added defines for LED Control Register
- *	Editorial changes
- *	
- *	Revision 1.45  2002/12/10 14:35:13  rschmidt
- *	Corrected defines for Extended PHY Specific Control
- *	Added defines for Ext. PHY Specific Ctrl 2 Reg. (Fiber specific)
- *	
- *	Revision 1.44  2002/12/09 14:58:41  rschmidt
- *	Added defines for Ext. PHY Specific Ctrl Reg. (downshift feature)
- *	Added 'GMR_FS_UN_SIZE'-Bit to Rx GMAC FIFO Flush Mask
- *	
- *	Revision 1.43  2002/12/05 10:14:45  rschmidt
- *	Added define for GMAC's Half Duplex Burst Mode
- *	Added define for Rx GMAC FIFO Flush Mask (default)
- *	
- *	Revision 1.42  2002/11/12 16:48:19  rschmidt
- *	Added defines for Cable Diagnostic Register (GPHY)
- *	Editorial changes
- *	
- *	Revision 1.41  2002/10/21 11:20:22  rschmidt
- *	Added bit GMR_FS_GOOD_FC to GMR_FS_ANY_ERR
- *	Editorial changes
- *	
- *	Revision 1.40  2002/10/14 14:54:14  rschmidt
- *	Added defines for GPHY Specific Status and GPHY Interrupt Status
- *	Added bits PHY_M_IS_AN_ERROR and PHY_M_IS_FIFO_ERROR to PHY_M_DEF_MSK
- *	Editorial changes
- *	
- *	Revision 1.39  2002/10/10 15:53:44  mkarl
- *	added some bit definitions for link speed status and LED's
- *	
- *	Revision 1.38  2002/08/21 16:23:46  rschmidt
- *	Added defines for PHY Specific Ctrl Reg
- *	Editorial changes
- *	
- *	Revision 1.37  2002/08/16 14:50:33  rschmidt
- *	Added defines for Auto-Neg. Advertisement YUKON Fiber (88E1011S only)
- *	Changed define PHY_M_DEF_MSK for GPHY IRQ Mask
- *	Editorial changes
- *	
- *	Revision 1.36  2002/08/12 13:21:10  rschmidt
- *	Added defines for different Broadcom PHY Ids
- *	
- *	Revision 1.35  2002/08/08 15:58:01  rschmidt
- *	Added defines for Manual LED Override register (YUKON)
- *	Editorial changes
- *	
- *	Revision 1.34  2002/07/31 17:23:36  rwahl
- *	Added define GMR_FS_ANY_ERR (analogous to XMR_FS_ANY_ERR).
- *	
- *	Revision 1.33  2002/07/23 16:03:37  rschmidt
- *	Added defines for GPHY registers
- *	Editorial changes
- *	
- *	Revision 1.32  2002/07/15 18:14:37  rwahl
- *	Added GMAC MIB counters definitions.
- *	Editorial changes.
- *	
- *	Revision 1.31  2002/07/15 15:42:50  rschmidt
- *	Removed defines from PHY specific reg. which are
- *	common to all PHYs
- *	Added defines for GMAC MIB Counters
- *	Editorial changes
- *	
- *	Revision 1.30  2002/06/05 08:22:12  rschmidt
- *	Changed defines for GMAC Rx Control Register and Rx Status
- *	Editorial changes
- *	
- *	Revision 1.29  2002/04/25 11:43:56  rschmidt
- *	Added define PHY_B_AS_PAUSE_MSK for BCom Pause Res.
- *	Added new registers and defines for YUKON (GMAC, GPHY)
- *	Added Receive Frame Status Encoding for YUKON
- *	Editorial changes
- *	
- *	Revision 1.28  2000/11/09 12:32:49  rassmann
- *	Renamed variables.
- *	
- *	Revision 1.27  2000/05/17 11:00:46  malthoff
- *	Add bit for enable/disable power management in BCOM chip.
- *	
- *	Revision 1.26  1999/11/22 14:03:00  cgoos
- *	Changed license header to GPL.
- *	
- *	Revision 1.25  1999/08/12 19:19:38  malthoff
- *	Add PHY_B_AC_TX_TST bit according to BCOM A1 errata sheet.
- *	
- *	Revision 1.24  1999/07/30 11:27:21  cgoos
- *	Fixed a missing end-of-comment.
- *	
- *	Revision 1.23  1999/07/30 07:03:31  malthoff
- *	Cut some long comments.
- *	Correct the XMAC PHY ID definitions.
- *	
- *	Revision 1.22  1999/05/19 07:33:18  cgoos
- *	Changes for 1000Base-T.
- *	
- *	Revision 1.21  1999/03/25 07:46:11  malthoff
- *	Add XM_HW_CFG, XM_TS_READ, and XM_TS_LOAD registers.
- *	
- *	Revision 1.20  1999/03/12 13:36:09  malthoff
- *	Remove __STDC__.
- *
- *	Revision 1.19  1998/12/10 12:22:54  gklug
- *	fix: RX_PAGE must be in interrupt mask
- *
- *	Revision 1.18  1998/12/10 10:36:36  gklug
- *	fix: swap of pause bits
- *
- *	Revision 1.17  1998/11/18 13:21:45  gklug
- *	fix: Default interrupt mask
- *
- *	Revision 1.16  1998/10/29 15:53:21  gklug
- *	fix: Default mask uses ASS (GP0) signal
- *
- *	Revision 1.15  1998/10/28 13:52:52  malthoff
- *	Add new bits in RX_CMD register.
- *
- *	Revision 1.14  1998/10/19 15:34:53  gklug
- *	fix: typos
- *
- *	Revision 1.13  1998/10/14 07:19:03  malthoff
- *	bug fix: Every define which describes bit 31
- *	must be declared as unsigned long 'UL'.
- *	fix bit definitions of PHY_AN_RFB and PHY_AN_PAUSE.
- *	Remove ANP defines. Rework the RFB defines.
- *
- *	Revision 1.12  1998/10/14 06:22:44  cgoos
- *	Changed shifted constant to ULONG.
- *
- *	Revision 1.11  1998/10/14 05:43:26  gklug
- *	add: shift pause coding
- *	fix: PAUSE bits definition
- *
- *	Revision 1.10  1998/10/13 09:19:21  malthoff
- *	Again change XMR_FS_ANY_ERR because of new info from XaQti.
- *
- *	Revision 1.9  1998/10/09 07:58:30  malthoff
- *	Add XMR_FS_FCS_ERR to XMR_FS_ANY_ERR.
- *
- *	Revision 1.8  1998/10/09 07:18:17  malthoff
- *	bug fix of a bug fix: XM_PAUSE_MODE and XM_DEF_MODE
- *	are not inverted! Bug XM_DEF_MSK is inverted.
- *
- *	Revision 1.7  1998/10/05 08:04:32  malthoff
- *	bug fix: XM_PAUSE_MODE and XM_DEF_MODE
- *	must be inverted declarations.
- *
- *	Revision 1.6  1998/09/28 13:38:18  malthoff
- *	Add default modes and masks XM_DEF_MSK,
- *	XM_PAUSE_MODE and XM_DEF_MODE
- *
- *	Revision 1.5  1998/09/16 14:42:04  malthoff
- *	Bug Fix: XM_GP_PORT is a 32 bit (not a 16 bit) register.
- *
- *	Revision 1.4  1998/08/20 14:59:47  malthoff
- *	Rework this file after reading the XaQti data sheet
- *	"Differences between Rev. B2 & Rev. C XMAC II".
- *	This file is now 100% XMAC II Rev. C complained.
- *
- *	Revision 1.3  1998/06/29 12:18:23  malthoff
- *	Correct XMR_FS_ANY_ERR definition.
- *
- *	Revision 1.2  1998/06/29 12:10:56  malthoff
- *	Add define XMR_FS_ANY_ERR.
- *
- *	Revision 1.1  1998/06/19 13:37:17  malthoff
- *	created.
- *
- *
- ******************************************************************************/
-
 #ifndef __INC_XMAC_H
 #define __INC_XMAC_H
 
--- diff/drivers/net/sk98lin/skaddr.c	2003-08-20 14:16:30.000000000 +0100
+++ source/drivers/net/sk98lin/skaddr.c	2004-02-09 10:39:54.000000000 +0000
@@ -2,8 +2,6 @@
  *
  * Name:	skaddr.c
  * Project:	Gigabit Ethernet Adapters, ADDR-Module
- * Version:	$Revision: 1.52 $
- * Date:	$Date: 2003/06/02 13:46:15 $
  * Purpose:	Manage Addresses (Multicast and Unicast) and Promiscuous Mode.
  *
  ******************************************************************************/
@@ -24,203 +22,6 @@
 
 /******************************************************************************
  *
- * History:
- *
- *	$Log: skaddr.c,v $
- *	Revision 1.52  2003/06/02 13:46:15  tschilli
- *	Editorial changes.
- *	
- *	Revision 1.51  2003/05/13 17:12:43  mkarl
- *	Changes for SLIM Driver via SK_SLIM.
- *	Changes for driver not using RLMT via SK_NO_RLMT.
- *	Changes for driver not supporting MAC address override via SK_NO_MAO.
- *	Separeted GENESIS and YUKON only code to reduce code size.
- *	Editorial changes.
- *	
- *	Revision 1.50  2003/05/08 12:29:31  rschmidt
- *	Replaced all if(GIChipId == CHIP_ID_GENESIS) with new entry GIGenesis.
- *	Changed initialisation for Next0[SK_MAX_MACS] to avoid
- *	compiler errors when SK_MAX_MACS=1.
- *	Editorial changes.
- *	
- *	Revision 1.49  2003/04/15 09:30:51  tschilli
- *	Copyright messages changed.
- *	"#error C++ is not yet supported." removed.
- *	
- *	Revision 1.48  2003/02/12 17:09:37  tschilli
- *	Fix in SkAddrOverride() to set both (physical and logical) MAC addresses
- *	in case that both addresses are identical.
- *	
- *	Revision 1.47  2002/09/17 06:31:10  tschilli
- *	Handling of SK_PROM_MODE_ALL_MC flag in SkAddrGmacMcUpdate()
- *	and SkAddrGmacPromiscuousChange() fixed.
- *	Editorial changes.
- *	
- *	Revision 1.46  2002/08/22 07:55:41  tschilli
- *	New function SkGmacMcHash() for GMAC multicast hashing algorithm added.
- *	Editorial changes.
- *	
- *	Revision 1.45  2002/08/15 12:29:35  tschilli
- *	SkAddrGmacMcUpdate() and SkAddrGmacPromiscuousChange() changed.
- *	
- *	Revision 1.44  2002/08/14 12:18:03  rschmidt
- *	Replaced direct handling of MAC Hashing (XMAC and GMAC)
- *	with routine SkMacHashing().
- *	Replaced wrong 3rd para 'i' with 'PortNumber' in SkMacPromiscMode().
- *	
- *	Revision 1.43  2002/08/13 09:37:43  rschmidt
- *	Corrected some SK_DBG_MSG outputs.
- *	Replaced wrong 2nd para pAC with IoC in SkMacPromiscMode().
- *	Editorial changes.
- *	
- *	Revision 1.42  2002/08/12 11:24:36  rschmidt
- *	Remove setting of logical MAC address GM_SRC_ADDR_2 in SkAddrInit().
- *	Replaced direct handling of MAC Promiscuous Mode (XMAC and GMAC)
- *	with routine SkMacPromiscMode().
- *	Editorial changes.
- *	
- *	Revision 1.41  2002/06/10 13:52:18  tschilli
- *	Changes for handling YUKON.
- *	All changes are internally and not visible to the programmer
- *	using this module.
- *	
- *	Revision 1.40  2001/02/14 14:04:59  rassmann
- *	Editorial changes.
- *	
- *	Revision 1.39  2001/01/30 10:30:04  rassmann
- *	Editorial changes.
- *	
- *	Revision 1.38  2001/01/25 16:26:52  rassmann
- *	Ensured that logical address overrides are done on net's active port.
- *	
- *	Revision 1.37  2001/01/22 13:41:34  rassmann
- *	Supporting two nets on dual-port adapters.
- *	
- *	Revision 1.36  2000/08/07 11:10:39  rassmann
- *	Editorial changes.
- *	
- *	Revision 1.35  2000/05/04 09:38:41  rassmann
- *	Editorial changes.
- *	Corrected multicast address hashing.
- *	
- *	Revision 1.34  1999/11/22 13:23:44  cgoos
- *	Changed license header to GPL.
- *	
- *	Revision 1.33  1999/05/28 10:56:06  rassmann
- *	Editorial changes.
- *	
- *	Revision 1.32  1999/03/31 10:59:20  rassmann
- *	Returning Success instead of DupAddr if address shall be overridden
- *	with same value.
- *	
- *	Revision 1.31  1999/01/14 16:18:17  rassmann
- *	Corrected multicast initialization.
- *	
- *	Revision 1.30  1999/01/04 10:30:35  rassmann
- *	SkAddrOverride only possible after SK_INIT_IO phase.
- *	
- *	Revision 1.29  1998/12/29 13:13:10  rassmann
- *	An address override is now preserved in the SK_INIT_IO phase.
- *	All functions return an int now.
- *	Extended parameter checking.
- *	
- *	Revision 1.28  1998/12/01 11:45:53  rassmann
- *	Code cleanup.
- *	
- *	Revision 1.27  1998/12/01 09:22:49  rassmann
- *	SkAddrMcAdd and SkAddrMcUpdate returned SK_MC_FILTERING_INEXACT
- *	too often.
- *	
- *	Revision 1.26  1998/11/24 12:39:44  rassmann
- *	Reserved multicast entry for BPDU address.
- *	13 multicast entries left for protocol.
- *	
- *	Revision 1.25  1998/11/17 16:54:23  rassmann
- *	Using exact match for up to 14 multicast addresses.
- *	Still receiving all multicasts if more addresses are added.
- *	
- *	Revision 1.24  1998/11/13 17:24:31  rassmann
- *	Changed return value of SkAddrOverride to int.
- *	
- *	Revision 1.23  1998/11/13 16:56:18  rassmann
- *	Added macro SK_ADDR_COMPARE.
- *	Changed return type of SkAddrOverride to SK_BOOL.
- *	
- *	Revision 1.22  1998/11/04 17:06:17  rassmann
- *	Corrected McUpdate and PromiscuousChange functions.
- *	
- *	Revision 1.21  1998/10/29 14:34:04  rassmann
- *	Clearing SK_ADDR struct at startup.
- *	
- *	Revision 1.20  1998/10/28 18:16:34  rassmann
- *	Avoiding I/Os before SK_INIT_RUN level.
- *	Aligning InexactFilter.
- *	
- *	Revision 1.19  1998/10/28 11:29:28  rassmann
- *	Programming physical address in SkAddrMcUpdate.
- *	Corrected programming of exact match entries.
- *	
- *	Revision 1.18  1998/10/28 10:34:48  rassmann
- *	Corrected reading of physical addresses.
- *	
- *	Revision 1.17  1998/10/28 10:26:13  rassmann
- *	Getting ports' current MAC addresses from EPROM now.
- *	Added debug output.
- *	
- *	Revision 1.16  1998/10/27 16:20:12  rassmann
- *	Reading MAC address byte by byte.
- *	
- *	Revision 1.15  1998/10/22 11:39:09  rassmann
- *	Corrected signed/unsigned mismatches.
- *	
- *	Revision 1.14  1998/10/19 17:12:35  rassmann
- *	Syntax corrections.
- *	
- *	Revision 1.13  1998/10/19 17:02:19  rassmann
- *	Now reading permanent MAC addresses from CRF.
- *	
- *	Revision 1.12  1998/10/15 15:15:48  rassmann
- *	Changed Flags Parameters from SK_U8 to int.
- *	Checked with lint.
- *	
- *	Revision 1.11  1998/09/24 19:15:12  rassmann
- *	Code cleanup.
- *	
- *	Revision 1.10  1998/09/18 20:18:54  rassmann
- *	Added HW access.
- *	Implemented swapping.
- *	
- *	Revision 1.9  1998/09/16 11:32:00  rassmann
- *	Including skdrv1st.h again. :(
- *	
- *	Revision 1.8  1998/09/16 11:09:34  rassmann
- *	Syntax corrections.
- *	
- *	Revision 1.7  1998/09/14 17:06:34  rassmann
- *	Minor changes.
- *	
- *	Revision 1.6  1998/09/07 08:45:41  rassmann
- *	Syntax corrections.
- *	
- *	Revision 1.5  1998/09/04 19:40:19  rassmann
- *	Interface enhancements.
- *	
- *	Revision 1.4  1998/09/04 12:14:12  rassmann
- *	Interface cleanup.
- *	
- *	Revision 1.3  1998/09/02 16:56:40  rassmann
- *	Updated interface.
- *	
- *	Revision 1.2  1998/08/27 14:26:09  rassmann
- *	Updated interface.
- *	
- *	Revision 1.1  1998/08/21 08:30:22  rassmann
- *	First public version.
- *
- ******************************************************************************/
-
-/******************************************************************************
- *
  * Description:
  *
  * This module is intended to manage multicast addresses, address override,
--- diff/drivers/net/sk98lin/skcsum.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/net/sk98lin/skcsum.c	2004-02-09 10:39:54.000000000 +0000
@@ -2,8 +2,6 @@
  *
  * Name:	skcsum.c
  * Project:	GEnesis, PCI Gigabit Ethernet Adapter
- * Version:	$Revision: 1.12 $
- * Date:	$Date: 2003/08/20 13:55:53 $
  * Purpose:	Store/verify Internet checksum in send/receive packets.
  *
  ******************************************************************************/
@@ -21,63 +19,6 @@
  *
  ******************************************************************************/
 
-/******************************************************************************
- *
- * 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
- *	
- *	Revision 1.10  2002/04/11 10:02:04  rwahl
- *	Fix in SkCsGetSendInfo():
- *	- function did not return ProtocolFlags in every case.
- *	- pseudo header csum calculated wrong for big endian.
- *	
- *	Revision 1.9  2001/06/13 07:42:08  gklug
- *	fix: NetNumber was wrong in CLEAR_STAT event
- *	add: check for good NetNumber in Clear STAT
- *	
- *	Revision 1.8  2001/02/06 11:15:36  rassmann
- *	Supporting two nets on dual-port adapters.
- *	
- *	Revision 1.7  2000/06/29 13:17:05  rassmann
- *	Corrected reception of a packet with UDP checksum == 0 (which means there
- *	is no UDP checksum).
- *	
- *	Revision 1.6  2000/02/21 12:35:10  cgoos
- *	Fixed license header comment.
- *	
- *	Revision 1.5  2000/02/21 11:05:19  cgoos
- *	Merged changes back to common source.
- *	Fixed rx path for BIG ENDIAN architecture.
- *	
- *	Revision 1.1  1999/07/26 15:28:12  mkarl
- *	added return SKCS_STATUS_IP_CSUM_ERROR_UDP and
- *	SKCS_STATUS_IP_CSUM_ERROR_TCP to pass the NidsTester
- *	changed from common source to windows specific source
- *	therefore restarting with v1.0
- *	
- *	Revision 1.3  1999/05/10 08:39:33  mkarl
- *	prevent overflows in SKCS_HTON16
- *	fixed a bug in pseudo header checksum calculation
- *	added some comments
- *	
- *	Revision 1.2  1998/10/22 11:53:28  swolf
- *	Now using SK_DBG_MSG.
- *	
- *	Revision 1.1  1998/09/01 15:35:41  swolf
- *	initial revision
- *
- *	13-May-1998 sw	Created.
- *
- ******************************************************************************/
-
 #ifdef SK_USE_CSUM	/* Check if CSUM is to be used. */
 
 #ifndef lint
--- diff/drivers/net/sk98lin/skdim.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/net/sk98lin/skdim.c	2004-02-09 10:39:54.000000000 +0000
@@ -2,8 +2,6 @@
  *
  * Name:	skdim.c
  * Project:	GEnesis, PCI Gigabit Ethernet Adapter
- * Version:	$Revision: 1.5 $
- * Date:	$Date: 2003/11/28 12:55:40 $
  * Purpose:	All functions to maintain interrupt moderation
  *
  ******************************************************************************/
@@ -24,40 +22,6 @@
 
 /******************************************************************************
  *
- * 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
- *	
- *	Revision 1.1  2003/07/18 13:39:55  rroesler
- *	Fix: Re-enter after CVS crash
- *	
- *	Revision 1.4  2003/07/07 09:45:47  rroesler
- *	Fix: Compiler warnings corrected
- *	
- *	Revision 1.3  2003/06/10 09:16:40  rroesler
- *	Adapt GetCurrentSystemLoad() to NOT access the kernels
- *	kstat-structure in kernel 2.5/2.6. This must be done
- *	due to a not exported symbol. Instead of evaluating the
- *	SystemLoad directly, the nbr of interrupts is used as
- *	a rough basis for the load.
- *	
- *
- *
- ******************************************************************************/
-
-/******************************************************************************
- *
  * Description:
  *
  * This module is intended to manage the dynamic interrupt moderation on both   
--- diff/drivers/net/sk98lin/skge.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/net/sk98lin/skge.c	2004-02-09 10:39:54.000000000 +0000
@@ -2,8 +2,6 @@
  *
  * Name:	skge.c
  * Project:	GEnesis, PCI Gigabit Ethernet Adapter
- * Version:	$Revision: 1.43 $
- * Date:       	$Date: 2004/01/29 15:47:07 $
  * Purpose:	The main driver source module
  *
  ******************************************************************************/
@@ -38,423 +36,6 @@
 
 /******************************************************************************
  *
- * 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
- *	
- *	Revision 1.15  2003/09/22 08:40:05  mlindner
- *	Add: Added DRIVER_FILE_NAME and DRIVER_REL_DATE
- *	
- *	Revision 1.14  2003/09/22 08:11:10  mlindner
- *	Add: New function for PCI initialization (SkGeInitPCI)
- *	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 *)
- *	
- *	Revision 1.10  2003/08/25 09:24:08  mlindner
- *	Add: Dynamic Interrupt Moderation (DIM) port up message
- *	
- *	Revision 1.9  2003/08/21 14:09:43  mlindner
- *	Fix: Disable Half Duplex with Gigabit-Speed (Yukon). Enable Full Duplex.
- *	
- *	Revision 1.8  2003/08/19 15:09:18  mlindner
- *	Fix: Ignore ConType parameter if empty value
- *	
- *	Revision 1.7  2003/08/13 12:00:35  mlindner
- *	Fix: Removed useless defines
- *	
- *	Revision 1.6  2003/08/12 16:49:41  mlindner
- *	Fix: UDP and TCP HW-CSum calculation (Kernel 2.5/2.6)
- *	Fix: UDP and TCP Proto checks
- *	Fix: Build without ProcFS
- *	Fix: Kernel 2.6 editorial changes
- *	
- *	Revision 1.5  2003/08/07 12:25:07  mlindner
- *	Fix: ConType parameter check and error detection
- *	Fix: Insert various fixes applied to the kernel tree
- *	
- *	Revision 1.4  2003/08/07 10:50:21  mlindner
- *	Add: Speed and HW-Csum support for Yukon Lite chipset
- *	
- *	Revision 1.3  2003/08/06 11:24:08  mlindner
- *	Add: Kernel updates
- *	
- *	Revision 1.2  2003/07/21 08:28:47  rroesler
- *	Fix: Handle padded bytes using skb_put()
- *	
- *	Revision 1.63  2003/07/15 09:26:23  rroesler
- *	Fix: Removed memory leak when sending short padded frames
- *	
- *	Revision 1.62  2003/07/09 11:11:16  rroesler
- *	Fix: Call of ReceiveIrq() performed with parameter SK_FALSE in
- *	     order not to hang the system with multiple spinlocks
- *	
- *	Revision 1.61  2003/07/08 07:32:41  rroesler
- *	Fix: Correct Kernel-version
- *	
- *	Revision 1.60  2003/07/07 15:42:30  rroesler
- *	Fix: Removed function pci_present() for 2.5/2.6 kernels (deprecated)
- *	Fix: Corrected warning in GetConfiguration()
- *	
- *	Revision 1.59  2003/07/07 09:44:32  rroesler
- *	Add: HW checksumming on kernel 2.5/2.6
- *	Add: padding of short frames (<60 bytes) with 0x00 instead of 0xaa
- *	Add: ConType parameter combining multiple other parameters into one
- *	Fix: Corrected bugreport #10721 (warning when changing MTU size)
- *	Fix: Removed obsolete function SetQueueSize()
- *	Fix: Function ChangeMtuSize() returns new MTU size in kernel 2.5/2.6
- *	
- *	Revision 1.58  2003/06/17 07:14:29  mlindner
- *	Add: Disable checksum functionality
- *	Fix: Unload module (Kernel 2.5)
- *	
- *	Revision 1.57  2003/06/05 14:55:27  mlindner
- *	Fix: ProcFS creation (Kernel 2.2.x)
- *	Fix: ProcFS OWNER (Kernel 2.2.x)
- *	
- *	Revision 1.56  2003/06/03 14:34:29  mlindner
- *	Add: Additions for SK_SLIM
- *	Fix: SkGeIoctl SK_IOCTL_GEN
- *	
- *	Revision 1.55  2003/05/26 13:00:52  mlindner
- *	Add: Support for Kernel 2.5/2.6
- *	Add: Support for new IO-control MIB data structure
- *	Add: New SkOsGetTime function
- *	Fix: Race condition with broken LM80 chip
- *	Fix: Race condition with padded frames
- *	
- *	Revision 1.54  2003/04/28 13:07:27  mlindner
- *	Fix: Delay race condition with some server machines
- *	
- *	Revision 1.53  2003/04/28 12:49:49  mlindner
- *	Fix: Code optimization
- *	
- *	Revision 1.52  2003/04/28 12:24:32  mlindner
- *	Fix: Disabled HW Error IRQ on 32-bit Yukon if sensor IRQ occurs
- *	
- *	Revision 1.51  2003/04/16 08:31:14  mlindner
- *	Fix: Kernel 2.2 compilation
- *	
- *	Revision 1.49  2003/04/10 09:08:51  mlindner
- *	Add: Blink mode verification
- *	Fix: Checksum calculation
- *	
- *	Revision 1.48  2003/03/21 14:48:38  rroesler
- *	Added code for interrupt moderation
- *	
- *	Revision 1.47  2003/03/12 13:56:15  mlindner
- *	Fix: Mac update during SK_DRV_NET_UP
- *	
- *	Revision 1.46  2003/02/25 14:16:36  mlindner
- *	Fix: Copyright statement
- *	
- *	Revision 1.45  2003/02/25 13:25:55  mlindner
- *	Add: Performance improvements
- *	Add: Support for various vendors
- *	Fix: Init function
- *	
- *	Revision 1.44  2003/01/09 09:25:26  mlindner
- *	Fix: Remove useless init_module/cleanup_module forward declarations
- *	
- *	Revision 1.43  2002/11/29 08:42:41  mlindner
- *	Fix: Boot message
- *	
- *	Revision 1.42  2002/11/28 13:30:23  mlindner
- *	Add: New frame check
- *	
- *	Revision 1.41  2002/11/27 13:55:18  mlindner
- *	Fix: Drop wrong csum packets
- *	Fix: Initialize proc_entry after hw check
- *	
- *	Revision 1.40  2002/10/31 07:50:37  tschilli
- *	Function SkGeInitAssignRamToQueues() from common module inserted.
- *	Autonegotiation is set to ON for all adapters.
- *	LinkSpeedUsed is used in link up status report.
- *	Role parameter will show up for 1000 Mbps links only.
- *	GetConfiguration() inserted after init level 1 in SkGeChangeMtu().
- *	All return values of SkGeInit() and SkGeInitPort() are checked.
- *	
- *	Revision 1.39  2002/10/02 12:56:05  mlindner
- *	Add: Support for Yukon
- *	Add: Support for ZEROCOPY, scatter-gather and hw checksum
- *	Add: New transmit ring function (use SG and TCP/UDP hardware checksumming)
- *	Add: New init function
- *	Add: Speed check and setup
- *	Add: Merge source for kernel 2.2.x and 2.4.x
- *	Add: Opcode check for tcp
- *	Add: Frame length check
- *	Fix: Transmit complete interrupt
- *	Fix: Interrupt moderation
- *	
- *	Revision 1.29.2.13  2002/01/14 12:44:52  mlindner
- *	Fix: Rlmt modes
- *	
- *	Revision 1.29.2.12  2001/12/07 12:06:18  mlindner
- *	Fix: malloc -> slab changes
- *	
- *	Revision 1.29.2.11  2001/12/06 15:19:20  mlindner
- *	Add: DMA attributes
- *	Fix: Module initialisation
- *	Fix: pci_map_single and pci_unmap_single replaced
- *	
- *	Revision 1.29.2.10  2001/12/06 09:56:50  mlindner
- *	Corrected some printk's
- *	
- *	Revision 1.29.2.9  2001/09/05 12:15:34  mlindner
- *	Add: LBFO Changes
- *	Fix: Counter Errors (Jumbo == to long errors)
- *	Fix: Changed pAC->PciDev declaration
- *	Fix: too short counters
- *	
- *	Revision 1.29.2.8  2001/06/25 12:10:44  mlindner
- *	fix: ReceiveIrq() changed.
- *	
- *	Revision 1.29.2.7  2001/06/25 08:07:05  mlindner
- *	fix: RLMT locking in ReceiveIrq() changed.
- *	
- *	Revision 1.29.2.6  2001/05/21 07:59:29  mlindner
- *	fix: MTU init problems
- *	
- *	Revision 1.29.2.5  2001/05/08 11:25:08  mlindner
- *	fix: removed VLAN error message
- *	
- *	Revision 1.29.2.4  2001/05/04 13:31:43  gklug
- *	fix: do not handle eth_copy on bad fragments received.
- *	
- *	Revision 1.29.2.3  2001/04/23 08:06:43  mlindner
- *	Fix: error handling
- *	
- *	Revision 1.29.2.2  2001/03/15 12:04:54  mlindner
- *	Fixed memory problem
- *	
- *	Revision 1.29.2.1  2001/03/12 16:41:44  mlindner
- *	add: procfs function
- *	add: dual-net function
- *	add: RLMT networks
- *	add: extended PNMI features
- *	
- *	Kernel 2.4.x specific:
- *	Revision 1.xx  2000/09/12 13:31:56  cgoos
- *	Fixed missign "dev=NULL in skge_probe.
- *	Added counting for jumbo frames (corrects error statistic).
- *	Removed VLAN tag check (enables VLAN support).
- *	
- *	Kernel 2.2.x specific:
- *	Revision 1.29  2000/02/21 13:31:56  cgoos
- *	Fixed "unused" warning for UltraSPARC change.
- *	
- *	Partially kernel 2.2.x specific:
- *	Revision 1.28  2000/02/21 10:32:36  cgoos
- *	Added fixes for UltraSPARC.
- *	Now printing RlmtMode and PrefPort setting at startup.
- *	Changed XmitFrame return value.
- *	Fixed rx checksum calculation for BIG ENDIAN systems.
- *	Fixed rx jumbo frames counted as ierrors.
- *	
- *	
- *	Revision 1.27  1999/11/25 09:06:28  cgoos
- *	Changed base_addr to unsigned long.
- *	
- *	Revision 1.26  1999/11/22 13:29:16  cgoos
- *	Changed license header to GPL.
- *	Changes for inclusion in linux kernel (2.2.13).
- *	Removed 2.0.x defines.
- *	Changed SkGeProbe to skge_probe.
- *	Added checks in SkGeIoctl.
- *	
- *	Revision 1.25  1999/10/07 14:47:52  cgoos
- *	Changed 984x to 98xx.
- *	
- *	Revision 1.24  1999/09/30 07:21:01  cgoos
- *	Removed SK_RLMT_SLOW_LOOKAHEAD option.
- *	Giving spanning tree packets also to OS now.
- *	
- *	Revision 1.23  1999/09/29 07:36:50  cgoos
- *	Changed assignment for IsBc/IsMc.
- *	
- *	Revision 1.22  1999/09/28 12:57:09  cgoos
- *	Added CheckQueue also to Single-Port-ISR.
- *	
- *	Revision 1.21  1999/09/28 12:42:41  cgoos
- *	Changed parameter strings for RlmtMode.
- *	
- *	Revision 1.20  1999/09/28 12:37:57  cgoos
- *	Added CheckQueue for fast delivery of RLMT frames.
- *	
- *	Revision 1.19  1999/09/16 07:57:25  cgoos
- *	Copperfield changes.
- *	
- *	Revision 1.18  1999/09/03 13:06:30  cgoos
- *	Fixed RlmtMode=CheckSeg bug: wrong DEV_KFREE_SKB in RLMT_SEND caused
- *	double allocated skb's.
- *	FrameStat in ReceiveIrq was accessed via wrong Rxd.
- *	Queue size for async. standby Tx queue was zero.
- *	FillRxLimit of 0 could cause problems with ReQueue, changed to 1.
- *	Removed debug output of checksum statistic.
- *	
- *	Revision 1.17  1999/08/11 13:55:27  cgoos
- *	Transmit descriptor polling was not reenabled after SkGePortInit.
- *	
- *	Revision 1.16  1999/07/27 15:17:29  cgoos
- *	Added some "\n" in output strings (removed while debuging...).
- *	
- *	Revision 1.15  1999/07/23 12:09:30  cgoos
- *	Performance optimization, rx checksumming, large frame support.
- *	
- *	Revision 1.14  1999/07/14 11:26:27  cgoos
- *	Removed Link LED settings (now in RLMT).
- *	Added status output at NET UP.
- *	Fixed SMP problems with Tx and SWITCH running in parallel.
- *	Fixed return code problem at RLMT_SEND event.
- *	
- *	Revision 1.13  1999/04/07 10:11:42  cgoos
- *	Fixed Single Port problems.
- *	Fixed Multi-Adapter problems.
- *	Always display startup string.
- *	
- *	Revision 1.12  1999/03/29 12:26:37  cgoos
- *	Reversed locking to fine granularity.
- *	Fixed skb double alloc problem (caused by incorrect xmit return code).
- *	Enhanced function descriptions.
- *	
- *	Revision 1.11  1999/03/15 13:10:51  cgoos
- *	Changed device identifier in output string to ethX.
- *	
- *	Revision 1.10  1999/03/15 12:12:34  cgoos
- *	Changed copyright notice.
- *	
- *	Revision 1.9  1999/03/15 12:10:17  cgoos
- *	Changed locking to one driver lock.
- *	Added check of SK_AC-size (for consistency with library).
- *	
- *	Revision 1.8  1999/03/08 11:44:02  cgoos
- *	Fixed missing dev->tbusy in SkGeXmit.
- *	Changed large frame (jumbo) buffer number.
- *	Added copying of short frames.
- *	
- *	Revision 1.7  1999/03/04 13:26:57  cgoos
- *	Fixed spinlock calls for SMP.
- *	
- *	Revision 1.6  1999/03/02 09:53:51  cgoos
- *	Added descriptor revertion for big endian machines.
- *	
- *	Revision 1.5  1999/03/01 08:50:59  cgoos
- *	Fixed SkGeChangeMtu.
- *	Fixed pci config space accesses.
- *	
- *	Revision 1.4  1999/02/18 15:48:44  cgoos
- *	Corrected some printk's.
- *	
- *	Revision 1.3  1999/02/18 12:45:55  cgoos
- *	Changed SK_MAX_CARD_PARAM to default 16
- *	
- *	Revision 1.2  1999/02/18 10:55:32  cgoos
- *	Removed SkGeDrvTimeStamp function.
- *	Printing "ethX:" before adapter type at adapter init.
- *	
- *
- *	10-Feb-1999 cg	Created, based on Linux' acenic.c, 3c59x.c and
- *			SysKonnects GEnesis Solaris driver
- *
- ******************************************************************************/
-
-/******************************************************************************
- *
  * Possible compiler options (#define xxx / -Dxxx):
  *
  *	debugging can be enable by changing SK_DEBUG_CHKMOD and
@@ -1256,7 +837,7 @@
 
 		if ((pAC->GIni.GIMacsFound == 2) && pAC->RlmtNets == 2){
 			unregister_netdev(pAC->dev[1]);
-			kfree(pAC->dev[1]);
+			free_netdev(pAC->dev[1]);
 		}
 
 		FreeResources(SkGeRootDev);
--- diff/drivers/net/sk98lin/skgehwt.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/net/sk98lin/skgehwt.c	2004-02-09 10:39:54.000000000 +0000
@@ -2,8 +2,6 @@
  *
  * Name:	skgehwt.c
  * Project:	Gigabit Ethernet Adapters, Event Scheduler Module
- * Version:	$Revision: 1.15 $
- * Date:	$Date: 2003/09/16 13:41:23 $
  * Purpose:	Hardware Timer
  *
  ******************************************************************************/
@@ -22,60 +20,6 @@
  *
  ******************************************************************************/
 
-/******************************************************************************
- *
- * 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.
- *	
- *	Revision 1.13  1999/11/22 13:31:12  cgoos
- *	Changed license header to GPL.
- *	
- *	Revision 1.12  1998/10/15 15:11:34  gklug
- *	fix: ID_sccs to SysKonnectFileId
- *	
- *	Revision 1.11  1998/10/08 15:27:51  gklug
- *	chg: correction factor is host clock dependent
- *	
- *	Revision 1.10  1998/09/15 14:18:31  cgoos
- *	Changed more BOOLEANs to SK_xxx
- *
- *	Revision 1.9  1998/09/15 14:16:06  cgoos
- *	Changed line 107: FALSE to SK_FALSE
- *	
- *	Revision 1.8  1998/08/24 13:04:44  gklug
- *	fix: typo
- *	
- *	Revision 1.7  1998/08/19 09:50:49  gklug
- *	fix: remove struct keyword from c-code (see CCC) add typedefs
- *	
- *	Revision 1.6  1998/08/17 09:59:02  gklug
- *	fix: typos
- *	
- *	Revision 1.5  1998/08/14 07:09:10  gklug
- *	fix: chg pAc -> pAC
- *	
- *	Revision 1.4  1998/08/10 14:14:52  gklug
- *	rmv: unneccessary SK_ADDR macro
- *	
- *	Revision 1.3  1998/08/07 12:53:44  gklug
- *	fix: first compiled version
- *	
- *	Revision 1.2  1998/08/07 09:19:29  gklug
- *	adapt functions to the C coding conventions
- *	rmv unneccessary functions.
- *	
- *	Revision 1.1  1998/08/05 11:28:36  gklug
- *	first version: adapted from SMT/FDDI
- *
- ******************************************************************************/
-
 /*
  *	Event queue and dispatcher
  */
--- diff/drivers/net/sk98lin/skgeinit.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/net/sk98lin/skgeinit.c	2004-02-09 10:39:54.000000000 +0000
@@ -2,8 +2,6 @@
  *
  * Name:	skgeinit.c
  * Project:	Gigabit Ethernet Adapters, Common Modules
- * Version:	$Revision: 1.97 $
- * Date:	$Date: 2003/10/02 16:45:31 $
  * Purpose:	Contains functions to initialize the adapter
  *
  ******************************************************************************/
@@ -22,446 +20,6 @@
  *
  ******************************************************************************/
 
-/******************************************************************************
- *
- * 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().
- *	Minor changes to avoid LINT warnings.
- *	Editorial changes.
- *	
- *	Revision 1.92  2003/05/13 17:42:26  mkarl
- *	Added SK_FAR for PXE.
- *	Separated code pathes not used for SLIM driver to reduce code size.
- *	Removed calls to I2C for SLIM driver.
- *	Removed currently unused function SkGeLoadLnkSyncCnt.
- *	Editorial changes.
- *	
- *	Revision 1.91  2003/05/06 12:21:48  rschmidt
- *	Added use of pAC->GIni.GIYukon for selection of YUKON branches.
- *	Added defines around GENESIS resp. YUKON branches to reduce
- *	code size for PXE.
- *	Editorial changes.
- *	
- *	Revision 1.90  2003/04/28 09:12:20  rschmidt
- *	Added init for GIValIrqMask (common IRQ mask).
- *	Disabled HW Error IRQ on Yukon if sensor IRQ is set in SkGeInit1()
- *	by changing the common mask stored in GIValIrqMask.
- *	Editorial changes.
- *	
- *	Revision 1.89  2003/04/10 14:33:10  rschmidt
- *	Fixed alignement error of patchable configuration parameter
- *	in struct OemConfig caused by length of recognition string.
- *	
- *	Revision 1.88  2003/04/09 12:59:45  rschmidt
- *	Added define around initialization of patchable OEM specific
- *	configuration parameter.
- *	
- *	Revision 1.87  2003/04/08 16:46:13  rschmidt
- *	Added configuration variable for OEMs and initialization for
- *	GILedBlinkCtrl (LED Blink Control).
- *	Improved detection for YUKON-Lite Rev. A1.
- *	Editorial changes.
- *	
- *	Revision 1.86  2003/03/31 06:53:13  mkarl
- *	Corrected Copyright.
- *	Editorial changes.
- *	
- *	Revision 1.85  2003/02/05 15:30:33  rschmidt
- *	Corrected setting of GIHstClkFact (Host Clock Factor) and
- *	GIPollTimerVal (Descr. Poll Timer Init Value) for YUKON.
- *	Editorial changes.
- *	
- *	Revision 1.84  2003/01/28 09:57:25  rschmidt
- *	Added detection of YUKON-Lite Rev. A0 (stored in GIYukonLite).
- *	Disabled Rx GMAC FIFO Flush for YUKON-Lite Rev. A0.
- *	Added support for CLK_RUN (YUKON-Lite).
- *	Added additional check of PME from D3cold for setting GIVauxAvail.
- *	Editorial changes.
- *	
- *	Revision 1.83  2002/12/17 16:15:41  rschmidt
- *	Added default setting of PhyType (Copper) for YUKON.
- *	Added define around check for HW self test results.
- *	Editorial changes.
- *	
- *	Revision 1.82  2002/12/05 13:40:21  rschmidt
- *	Added setting of Rx GMAC FIFO Flush Mask register.
- *	Corrected PhyType with new define SK_PHY_MARV_FIBER when
- *	YUKON Fiber board was found.
- *	Editorial changes.
- *	
- *	Revision 1.81  2002/11/15 12:48:35  rschmidt
- *	Replaced message SKERR_HWI_E018 with SKERR_HWI_E024 for Rx queue error
- *	in SkGeStopPort().
- *	Added init for pAC->GIni.GIGenesis with SK_FALSE in YUKON-branch.
- *	Editorial changes.
- *	
- *	Revision 1.80  2002/11/12 17:28:30  rschmidt
- *	Initialized GIPciSlot64 and GIPciClock66 in SkGeInit1().
- *	Reduced PCI FIFO watermarks for 32bit/33MHz bus in SkGeInitBmu().
- *	Editorial changes.
- *	
- *	Revision 1.79  2002/10/21 09:31:02  mkarl
- *	Changed SkGeInitAssignRamToQueues(), removed call to
- *	SkGeInitAssignRamToQueues in SkGeInit1 and fixed compiler warning in
- *	SkGeInit1.
- *	
- *	Revision 1.78  2002/10/16 15:55:07  mkarl
- *	Fixed a bug in SkGeInitAssignRamToQueues.
- *	
- *	Revision 1.77  2002/10/14 15:07:22  rschmidt
- *	Corrected timeout handling for Rx queue in SkGeStopPort() (#10748)
- *	Editorial changes.
- *	
- *	Revision 1.76  2002/10/11 09:24:38  mkarl
- *	Added check for HW self test results.
- *	
- *	Revision 1.75  2002/10/09 16:56:44  mkarl
- *	Now call SkGeInitAssignRamToQueues() in Init Level 1 in order to assign
- *	the adapter memory to the queues. This default assignment is not suitable
- *	for dual net mode.
- *	
- *	Revision 1.74  2002/09/12 08:45:06  rwahl
- *	Set defaults for PMSCap, PLinkSpeed & PLinkSpeedCap dependent on PHY.
- *	
- *	Revision 1.73  2002/08/16 15:19:45  rschmidt
- *	Corrected check for Tx queues in SkGeCheckQSize().
- *	Added init for new entry GIGenesis and GICopperType
- *	Replaced all if(GIChipId == CHIP_ID_GENESIS) with new entry GIGenesis.
- *	Replaced wrong 1st para pAC with IoC in SK_IN/OUT macros.
- *	
- *	Revision 1.72  2002/08/12 13:38:55  rschmidt
- *	Added check if VAUX is available (stored in GIVauxAvail)
- *	Initialized PLinkSpeedCap in Port struct with SK_LSPEED_CAP_1000MBPS
- *	Editorial changes.
- *	
- *	Revision 1.71  2002/08/08 16:32:58  rschmidt
- *	Added check for Tx queues in SkGeCheckQSize().
- *	Added start of Time Stamp Timer (YUKON) in SkGeInit2().
- *	Editorial changes.
- *	
- *	Revision 1.70  2002/07/23 16:04:26  rschmidt
- *	Added init for GIWolOffs (HW-Bug in YUKON 1st rev.)
- *	Minor changes
- *	
- *	Revision 1.69  2002/07/17 17:07:08  rwahl
- *	- SkGeInit1(): fixed PHY type debug output; corrected init of GIFunc
- *	  table & GIMacType.
- *	- Editorial changes.
- *	
- *	Revision 1.68  2002/07/15 18:38:31  rwahl
- *	Added initialization for MAC type dependent function table.
- *	
- *	Revision 1.67  2002/07/15 15:45:39  rschmidt
- *	Added Tx Store & Forward for YUKON (GMAC Tx FIFO is only 1 kB)
- *	Replaced SK_PHY_MARV by SK_PHY_MARV_COPPER
- *	Editorial changes
- *	
- *	Revision 1.66  2002/06/10 09:35:08  rschmidt
- *	Replaced C++ comments (//)
- *	Editorial changes
- *	
- *	Revision 1.65  2002/06/05 08:33:37  rschmidt
- *	Changed GIRamSize and Reset sequence for YUKON.
- *	SkMacInit() replaced by SkXmInitMac() resp. SkGmInitMac()
- *	
- *	Revision 1.64  2002/04/25 13:03:20  rschmidt
- *	Changes for handling YUKON.
- *	Removed reference to xmac_ii.h (not necessary).
- *	Moved all defines into header file.
- *	Replaced all SkXm...() functions with SkMac...() to handle also
- *	YUKON's GMAC.
- *	Added handling for GMAC FIFO in SkGeInitMacFifo(), SkGeStopPort().
- *	Removed 'goto'-directive from SkGeCfgSync(), SkGeCheckQSize().
- *	Replaced all XMAC-access macros by functions: SkMacRxTxDisable(),
- *	SkMacFlushTxFifo().
- *	Optimized timeout handling in SkGeStopPort().
- *	Initialized PLinkSpeed in Port struct with SK_LSPEED_AUTO.
- *	Release of GMAC Link Control reset in SkGeInit1().
- *	Initialized GIChipId and GIChipRev in GE Init structure.
- *	Added GIRamSize and PhyType values for YUKON.
- *	Removed use of PRxCmd to setup XMAC.
- *	Moved setting of XM_RX_DIS_CEXT to SkXmInitMac().
- *	Use of SkGeXmitLED() only for GENESIS.
- *	Changes for V-CPU support.
- *	Editorial changes.
- *	
- *	Revision 1.63  2001/04/05 11:02:09  rassmann
- *	Stop Port check of the STOP bit did not take 2/18 sec as wanted.
- *	
- *	Revision 1.62  2001/02/07 07:54:21  rassmann
- *	Corrected copyright.
- *	
- *	Revision 1.61  2001/01/31 15:31:40  gklug
- *	fix: problem with autosensing an SR8800 switch
- *	
- *	Revision 1.60  2000/10/18 12:22:21  cgoos
- *	Added workaround for half duplex hangup.
- *	
- *	Revision 1.59  2000/10/10 11:22:06  gklug
- *	add: in manual half duplex mode ignore carrier extension errors
- *	
- *	Revision 1.58  2000/10/02 14:10:27  rassmann
- *	Reading BCOM PHY after releasing reset until it returns a valid value.
- *	
- *	Revision 1.57  2000/08/03 14:55:28  rassmann
- *	Waiting for I2C to be ready before de-initializing adapter
- *	(prevents sensors from hanging up).
- *	
- *	Revision 1.56  2000/07/27 12:16:48  gklug
- *	fix: Stop Port check of the STOP bit does now take 2/18 sec as wanted
- *	
- *	Revision 1.55  1999/11/22 13:32:26  cgoos
- *	Changed license header to GPL.
- *	
- *	Revision 1.54  1999/10/26 07:32:54  malthoff
- *	Initialize PHWLinkUp with SK_FALSE. Required for Diagnostics.
- *	
- *	Revision 1.53  1999/08/12 19:13:50  malthoff
- *	Fix for 1000BT. Do not owerwrite XM_MMU_CMD when
- *	disabling receiver and transmitter. Other bits
- *	may be lost.
- *	
- *	Revision 1.52  1999/07/01 09:29:54  gklug
- *	fix: DoInitRamQueue needs pAC
- *	
- *	Revision 1.51  1999/07/01 08:42:21  gklug
- *	chg: use Store & forward for RAM buffer when Jumbos are used
- *	
- *	Revision 1.50  1999/05/27 13:19:38  cgoos
- *	Added Tx PCI watermark initialization.
- *	Removed Tx RAM queue Store & Forward setting.
- *	
- *	Revision 1.49  1999/05/20 14:32:45  malthoff
- *	SkGeLinkLED() is completly removed now.
- *	
- *	Revision 1.48  1999/05/19 07:28:24  cgoos
- *	SkGeLinkLED no more available for drivers.
- *	Changes for 1000Base-T.
- *	
- *	Revision 1.47  1999/04/08 13:57:45  gklug
- *	add: Init of new port struct fiels PLinkResCt
- *	chg: StopPort Timer check
- *	
- *	Revision 1.46  1999/03/25 07:42:15  malthoff
- *	SkGeStopPort(): Add workaround for cache incoherency.
- *			Create error log entry, disable port, and
- *			exit loop if it does not terminate.
- *	Add XM_RX_LENERR_OK to the default value for the
- *	XMAC receive command register.
- *	
- *	Revision 1.45  1999/03/12 16:24:47  malthoff
- *	Remove PPollRxD and PPollTxD.
- *	Add check for GIPollTimerVal.
- *
- *	Revision 1.44  1999/03/12 13:40:23  malthoff
- *	Fix: SkGeXmitLED(), SK_LED_TST mode does not work.
- *	Add: Jumbo frame support.
- *	Chg: Resolution of parameter IntTime in SkGeCfgSync().
- *
- *	Revision 1.43  1999/02/09 10:29:46  malthoff
- *	Bugfix: The previous modification again also for the second location.
- *
- *	Revision 1.42  1999/02/09 09:35:16  malthoff
- *	Bugfix: The bits '66 MHz Capable' and 'NEWCAP are reset while
- *		clearing the error bits in the PCI status register.
- *
- *	Revision 1.41  1999/01/18 13:07:02  malthoff
- *	Bugfix: Do not use CFG cycles after during Init- or Runtime, because
- *		they may not be available after Boottime.
- *
- *	Revision 1.40  1999/01/11 12:40:49  malthoff
- *	Bug fix: PCI_STATUS: clearing error bits sets the UDF bit.
- *
- *	Revision 1.39  1998/12/11 15:17:33  gklug
- *	chg: Init LipaAutoNeg with Unknown
- *
- *	Revision 1.38  1998/12/10 11:02:57  malthoff
- *	Disable Error Log Message when calling SkGeInit(level 2)
- *	more than once.
- *
- *	Revision 1.37  1998/12/07 12:18:25  gklug
- *	add: refinement of autosense mode: take into account the autoneg cap of LiPa
- *
- *	Revision 1.36  1998/12/07 07:10:39  gklug
- *	fix: init values of LinkBroken/ Capabilities for management
- *
- *	Revision 1.35  1998/12/02 10:56:20  gklug
- *	fix: do NOT init LoinkSync Counter.
- *
- *	Revision 1.34  1998/12/01 10:53:21  gklug
- *	add: init of additional Counters for workaround
- *
- *	Revision 1.33  1998/12/01 10:00:49  gklug
- *	add: init PIsave var in Port struct
- *
- *	Revision 1.32  1998/11/26 14:50:40  gklug
- *	chg: Default is autosensing with AUTOFULL mode
- *
- *	Revision 1.31  1998/11/25 15:36:16  gklug
- *	fix: do NOT stop LED Timer when port should be stopped
- *
- *	Revision 1.30  1998/11/24 13:15:28  gklug
- *	add: Init PCkeckPar struct member
- *
- *	Revision 1.29  1998/11/18 13:19:27  malthoff
- *	Disable packet arbiter timeouts on receive side.
- *	Use maximum timeout value for packet arbiter
- *	transmit timeouts.
- *	Add TestStopBit() function to handle stop RX/TX
- *	problem with active descriptor poll timers.
- *	Bug Fix: Descriptor Poll Timer not started, because
- *	GIPollTimerVal was initialized with 0.
- *
- *	Revision 1.28  1998/11/13 14:24:26  malthoff
- *	Bug Fix: SkGeStopPort() may hang if a Packet Arbiter Timout
- *	is pending or occurs while waiting for TX_STOP and RX_STOP.
- *	The PA timeout is cleared now while waiting for TX- or RX_STOP.
- *
- *	Revision 1.27  1998/11/02 11:04:36  malthoff
- *	fix the last fix
- *
- *	Revision 1.26  1998/11/02 10:37:03  malthoff
- *	Fix: SkGePollTxD() enables always the synchronounous poll timer.
- *
- *	Revision 1.25  1998/10/28 07:12:43  cgoos
- *	Fixed "LED_STOP" in SkGeLnkSyncCnt, "== SK_INIT_IO" in SkGeInit.
- *	Removed: Reset of RAM Interface in SkGeStopPort.
- *
- *	Revision 1.24  1998/10/27 08:13:12  malthoff
- *	Remove temporary code.
- *
- *	Revision 1.23  1998/10/26 07:45:03  malthoff
- *	Add Address Calculation Workaround: If the EPROM byte
- *	Id is 3, the address offset is 512 kB.
- *	Initialize default values for PLinkMode and PFlowCtrlMode.
- *
- *	Revision 1.22  1998/10/22 09:46:47  gklug
- *	fix SysKonnectFileId typo
- *
- *	Revision 1.21  1998/10/20 12:11:56  malthoff
- *	Don't dendy the Queue config if the size of the unused
- *	Rx qeueu is zero.
- *
- *	Revision 1.20  1998/10/19 07:27:58  malthoff
- *	SkGeInitRamIface() is public to be called by diagnostics.
- *
- *	Revision 1.19  1998/10/16 13:33:45  malthoff
- *	Fix: enabling descriptor polling is not allowed until
- *	the descriptor addresses are set. Descriptor polling
- *	must be handled by the driver.
- *
- *	Revision 1.18  1998/10/16 10:58:27  malthoff
- *	Remove temp. code for Diag prototype.
- *	Remove lint warning for dummy reads.
- *	Call SkGeLoadLnkSyncCnt() during SkGeInitPort().
- *
- *	Revision 1.17  1998/10/14 09:16:06  malthoff
- *	Change parameter LimCount and programming of
- *	the limit counter in SkGeCfgSync().
- *
- *	Revision 1.16  1998/10/13 09:21:16  malthoff
- *	Don't set XM_RX_SELF_RX in RxCmd Reg, because it's
- *	like a Loopback Mode in half duplex.
- *
- *	Revision 1.15  1998/10/09 06:47:40  malthoff
- *	SkGeInitMacArb(): set recovery counters init value
- *	to zero although this counters are not uesd.
- *	Bug fix in Rx Upper/Lower Pause Threshold calculation.
- *	Add XM_RX_SELF_RX to RxCmd.
- *
- *	Revision 1.14  1998/10/06 15:15:53  malthoff
- *	Make sure no pending IRQ is cleared in SkGeLoadLnkSyncCnt().
- *
- *	Revision 1.13  1998/10/06 14:09:36  malthoff
- *	Add SkGeLoadLnkSyncCnt(). Modify
- *	the 'port stopped' condition according
- *	to the current problem report.
- *
- *	Revision 1.12  1998/10/05 08:17:21  malthoff
- *	Add functions: SkGePollRxD(), SkGePollTxD(),
- *	DoCalcAddr(), SkGeCheckQSize(),
- *	DoInitRamQueue(), and SkGeCfgSync().
- *	Add coding for SkGeInitMacArb(), SkGeInitPktArb(),
- *	SkGeInitMacFifo(), SkGeInitRamBufs(),
- *	SkGeInitRamIface(), and SkGeInitBmu().
- *
- *	Revision 1.11  1998/09/29 08:26:29  malthoff
- *	bug fix: SkGeInit0() 'i' should be increment.
- *
- *	Revision 1.10  1998/09/28 13:19:01  malthoff
- *	Coding time: Save the done work.
- *	Modify SkGeLinkLED(), add SkGeXmitLED(),
- *	define SkGeCheckQSize(), SkGeInitMacArb(),
- *	SkGeInitPktArb(), SkGeInitMacFifo(),
- *	SkGeInitRamBufs(), SkGeInitRamIface(),
- *	and SkGeInitBmu(). Do coding for SkGeStopPort(),
- *	SkGeInit1(), SkGeInit2(), and SkGeInit3().
- *	Do coding for SkGeDinit() and SkGeInitPort().
- *
- *	Revision 1.9  1998/09/16 14:29:05  malthoff
- *	Some minor changes.
- *
- *	Revision 1.8  1998/09/11 05:29:14  gklug
- *	add: init state of a port
- *
- *	Revision 1.7  1998/09/04 09:26:25  malthoff
- *	Short temporary modification.
- *
- *	Revision 1.6  1998/09/04 08:27:59  malthoff
- *	Remark the do-while in StopPort() because it never ends
- *	without a GE adapter.
- *
- *	Revision 1.5  1998/09/03 14:05:45  malthoff
- *	Change comment for SkGeInitPort(). Do not
- *	repair the queue sizes if invalid.
- *
- *	Revision 1.4  1998/09/03 10:03:19  malthoff
- *	Implement the new interface according to the
- *	reviewed interface specification.
- *
- *	Revision 1.3  1998/08/19 09:11:25  gklug
- *	fix: struct are removed from c-source (see CCC)
- *
- *	Revision 1.2  1998/07/28 12:33:58  malthoff
- *	Add 'IoC' parameter in function declaration and SK IO macros.
- *
- *	Revision 1.1  1998/07/23 09:48:57  malthoff
- *	Creation. First dummy 'C' file.
- *	SkGeInit(Level 0) is card_start for GE.
- *	SkGeDeInit() is card_stop for GE.
- *
- *
- ******************************************************************************/
 
 #include "h/skdrv1st.h"
 #include "h/skdrv2nd.h"
--- diff/drivers/net/sk98lin/skgemib.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/net/sk98lin/skgemib.c	2004-02-09 10:39:54.000000000 +0000
@@ -2,8 +2,6 @@
  *
  * Name:	skgemib.c
  * Project:	GEnesis, PCI Gigabit Ethernet Adapter
- * Version:	$Revision: 1.11 $
- * Date:	$Date: 2003/09/15 13:38:12 $
  * Purpose:	Private Network Management Interface Management Database
  *
  ****************************************************************************/
@@ -22,54 +20,6 @@
  *
  ******************************************************************************/
 
-/*****************************************************************************
- *
- * 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.
- *	
- *	Revision 1.8  2003/03/27 11:19:15  tschilli
- *	Copyright messages changed.
- *	
- *	Revision 1.7  2002/12/16 09:04:34  tschilli
- *	Code for VCT handling added.
- *	
- *	Revision 1.6  2002/08/09 15:40:21  rwahl
- *	Editorial change (renamed ConfSpeedCap).
- *	
- *	Revision 1.5  2002/08/09 11:05:34  rwahl
- *	Added oid handling for link speed cap.
- *	
- *	Revision 1.4  2002/08/09 09:40:27  rwahl
- *	Added support for NDIS OID_PNP_xxx.
- *	
- *	Revision 1.3  2002/07/17 19:39:54  rwahl
- *	Added handler for OID_SKGE_SPEED_MODE & OID_SKGE_SPEED_STATUS.
- *	
- *	Revision 1.2  2002/05/22 08:59:00  rwahl
- *	- static functions only for release build.
- *	- Source file must be included.
- *	
- *	Revision 1.1  2002/05/22 08:12:42  rwahl
- *	Initial version.
- *	
- ****************************************************************************/
-
 /*
  * PRIVATE OID handler function prototypes
  */
--- diff/drivers/net/sk98lin/skgepnmi.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/net/sk98lin/skgepnmi.c	2004-02-09 10:39:54.000000000 +0000
@@ -2,8 +2,6 @@
  *
  * Name:	skgepnmi.c
  * Project:	GEnesis, PCI Gigabit Ethernet Adapter
- * Version:	$Revision: 1.111 $
- * Date:	$Date: 2003/09/15 13:35:35 $
  * Purpose:	Private Network Management Interface
  *
  ****************************************************************************/
@@ -22,469 +20,6 @@
  *
  ******************************************************************************/
 
-/*****************************************************************************
- *
- * 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.
- *	
- *	Revision 1.108  2003/05/27 07:10:11  tschilli
- *	Bug in SkPnmiGenIoctl() fixed.
- *	
- *	Revision 1.107  2003/05/23 13:01:10  tschilli
- *	Code for DIAG support added (#define SK_DIAG_SUPPORT).
- *	Code for generic PNMI IOCTL support added. The new function
- *	SkPnmiGenIoctl() is used for this purpose.
- *	Handling of OID_SKGE_BOARDLEVEL added.
- *	Incorrect buffer size handling of OID_SKGE_MTU during GET action fixed.
- *	Return code handling in PowerManagement() fixed.
- *	Editorial changes.
- *  
- *	Revision 1.106  2003/04/10 14:47:31  rschmidt
- *	Fixed handling for OID_GEN_RCV_OK and OID_GEN_XMIT_OK for YUKON's GMAC
- *	in GetPhysStatVal().
- *	Replaced macro PHY_READ() with function call SkXmPhyRead().
- *	Made optimisations for readability and code size.
- *	Editorial changes.
- *	
- *	Revision 1.105  2003/04/09 12:51:32  rschmidt
- *	Fixed XMAC only handling for some events in SkPnmiEvent().
- *	Fixed return value for OID_GEN_RCV_OK (SK_PNMI_HRX) in GetPhysStatVal().
- *	Editorial changes.
- *	
- *	Revision 1.104  2003/03/27 11:18:21  tschilli
- *	BRK statements from DEBUG code removed.
- *	OID_GEN_XMIT_OK and OID_GEN_RCV_OK work with Yukon now.
- *	Copyright messages changed.
- *	
- *	Revision 1.103  2002/12/20 09:57:13  tschilli
- *	SK_PNMI_EVT_VCT_RESET event code changed.
- *	Unused variable from Vct() removed.
- *	
- *	Revision 1.102  2002/12/16 14:03:24  tschilli
- *	VCT code in Vct() changed.
- *	
- *	Revision 1.101  2002/12/16 09:04:10  tschilli
- *	Code for VCT handling added.
- *	
- *	Revision 1.100  2002/09/26 14:28:13  tschilli
- *	For XMAC the values in the SK_PNMI_PORT Port struct are copied to
- *	the new SK_PNMI_PORT BufPort struct during a MacUpdate() call.
- *	These values are used when GetPhysStatVal() is called. With this
- *	mechanism you get the best results when software corrections for
- *	counters are needed. Example: RX_LONGFRAMES.
- *	
- *	Revision 1.99  2002/09/17 12:31:19  tschilli
- *	OID_SKGE_TX_HW_ERROR_CTS, OID_SKGE_OUT_ERROR_CTS, OID_GEN_XMIT_ERROR:
- *	Double count of SK_PNMI_HTX_EXCESS_COL in function General() removed.
- *	OID_PNP_CAPABILITIES: sizeof(SK_PM_WAKE_UP_CAPABILITIES) changed to
- *	sizeof(SK_PNP_CAPABILITIES) in function PowerManagement().
- *	
- *	Revision 1.98  2002/09/10 09:00:03  rwahl
- *	Adapted boolean definitions according sktypes.
- *	
- *	Revision 1.97  2002/09/05 15:07:03  rwahl
- *	Editorial changes.
- *	
- *	Revision 1.96  2002/09/05 11:04:14  rwahl
- *	- Rx/Tx packets statistics of virtual port were zero on link down (#10750)
- *	- For GMAC the overflow IRQ for Rx longframe counter was not counted.
- *	- Incorrect calculation for oids OID_SKGE_RX_HW_ERROR_CTS,
- *	  OID_SKGE_IN_ERRORS_CTS,  OID_GEN_RCV_ERROR.
- *	- Moved correction for OID_SKGE_STAT_RX_TOO_LONG to GetPhysStatVal().
- *	- Editorial changes.
- *	
- *	Revision 1.95  2002/09/04 08:53:37  rwahl
- *	- Incorrect statistics for Rx_too_long counter with jumbo frame (#10751)
- *	- StatRxFrameTooLong & StatRxPMaccErr counters were not reset.
- *	- Fixed compiler warning for debug msg arg types.
- *	
- *	Revision 1.94  2002/08/09 15:42:14  rwahl
- *	- Fixed StatAddr table for GMAC.
- *	- VirtualConf(): returned indeterminated status for speed oids if no
- *	  active port.
- *	
- *	Revision 1.93  2002/08/09 11:04:59  rwahl
- *	Added handler for link speed caps.
- *	
- *	Revision 1.92  2002/08/09 09:43:03  rwahl
- *	- Added handler for NDIS OID_PNP_xxx ids.
- *	
- *	Revision 1.91  2002/07/17 19:53:03  rwahl
- *	- Added StatOvrflwBit table for XMAC & GMAC.
- *	- Extended StatAddr table for GMAC. Added check of number of counters
- *	  in enumeration and size of StatAddr table on init level.
- *	- Added use of GIFunc table.
- *	- ChipSet is not static anymore,
- *	- Extended SIRQ event handler for both mac types.
- *	- Fixed rx short counter bug (#10620)
- *	- Added handler for oids SKGE_SPEED_MODE & SKGE_SPEED_STATUS.
- *	- Extended GetPhysStatVal() for GMAC.
- *	- Editorial changes.
- *	
- *	Revision 1.90  2002/05/22 08:56:25  rwahl
- *	- Moved OID table to separate source file.
- *	- Fix: TX_DEFFERAL counter incremented in full-duplex mode.
- *	- Use string definitions for error msgs.
- *	
- *	Revision 1.89  2001/09/18 10:01:30  mkunz
- *	some OID's fixed for dualnetmode
- *	
- *	Revision 1.88  2001/08/02 07:58:08  rwahl
- *	- Fixed NetIndex to csum module at ResetCounter().
- *	
- *	Revision 1.87  2001/04/06 13:35:09  mkunz
- *	-Bugs fixed in handling of OID_SKGE_MTU and the VPD OID's
- *	
- *	Revision 1.86  2001/03/09 09:18:03  mkunz
- *	Changes in SK_DBG_MSG
- *	
- *	Revision 1.85  2001/03/08 09:37:31  mkunz
- *	Bugfix in ResetCounter for Pnmi.Port structure
- *	
- *	Revision 1.84  2001/03/06 09:04:55  mkunz
- *	Made some changes in instance calculation
- *	
- *	Revision 1.83  2001/02/15 09:15:32  mkunz
- *	Necessary changes for dual net mode added
- *	
- *	Revision 1.82  2001/02/07 08:24:19  mkunz
- *	-Made changes in handling of OID_SKGE_MTU
- *	
- *	Revision 1.81  2001/02/06 09:58:00  mkunz
- *	-Vpd bug fixed
- *	-OID_SKGE_MTU added
- *	-pnmi support for dual net mode. Interface function and macros extended
- *	
- *	Revision 1.80  2001/01/22 13:41:35  rassmann
- *	Supporting two nets on dual-port adapters.
- *	
- *	Revision 1.79  2000/12/05 14:57:40  cgoos
- *	SetStruct failed before first Link Up (link mode of virtual
- *	port "INDETERMINATED").
- *	
- *	Revision 1.78  2000/09/12 10:44:58  cgoos
- *	Fixed SK_PNMI_STORE_U32 calls with typecasted argument.
- *	
- *	Revision 1.77  2000/09/07 08:10:19  rwahl
- *	- Modified algorithm for 64bit NDIS statistic counters;
- *	  returns 64bit or 32bit value depending on passed buffer
- *	  size. Indicate capability for 64bit NDIS counter, if passed
- *	  buffer size is zero. OID_GEN_XMIT_ERROR, OID_GEN_RCV_ERROR,
- *	  and OID_GEN_RCV_NO_BUFFER handled as 64bit counter, too.
- *	- corrected OID_SKGE_RLMT_PORT_PREFERRED.
- *	
- *	Revision 1.76  2000/08/03 15:23:39  rwahl
- *	- Correction for FrameTooLong counter has to be moved to OID handling
- *	  routines (instead of statistic counter routine).
- *	- Fix in XMAC Reset Event handling: Only offset counter for hardware
- *	  statistic registers are updated.
- *	
- *	Revision 1.75  2000/08/01 16:46:05  rwahl
- *	- Added StatRxLongFrames counter and correction of FrameTooLong counter.
- *	- Added directive to control width (default = 32bit) of NDIS statistic
- *	  counters (SK_NDIS_64BIT_CTR).
- *	
- *	Revision 1.74  2000/07/04 11:41:53  rwahl
- *	- Added volition connector type.
- *	
- *	Revision 1.73  2000/03/15 16:33:10  rwahl
- *	Fixed bug 10510; wrong reset of virtual port statistic counters.
- *	
- *	Revision 1.72  1999/12/06 16:15:53  rwahl
- *	Fixed problem of instance range for current and factory MAC address.
- *	
- *	Revision 1.71  1999/12/06 10:14:20  rwahl
- *	Fixed bug 10476; set operation for PHY_OPERATION_MODE.
- *	
- *	Revision 1.70  1999/11/22 13:33:34  cgoos
- *	Changed license header to GPL.
- *	
- *	Revision 1.69  1999/10/18 11:42:15  rwahl
- *	Added typecasts for checking event dependent param (debug only).
- *	
- *	Revision 1.68  1999/10/06 09:35:59  cgoos
- *	Added state check to PHY_READ call (hanged if called during startup).
- *	
- *	Revision 1.67  1999/09/22 09:53:20  rwahl
- *	- Read Broadcom register for updating FCS error counter (1000Base-T).
- *
- *	Revision 1.66  1999/08/26 13:47:56  rwahl
- *	Added SK_DRIVER_SENDEVENT when queueing RLMT_CHANGE_THRES trap.
- *	
- *	Revision 1.65  1999/07/26 07:49:35  cgoos
- *	Added two typecasts to avoid compiler warnings.
- *	
- *	Revision 1.64  1999/05/20 09:24:12  cgoos
- *	Changes for 1000Base-T (sensors, Master/Slave).
- *
- *	Revision 1.63  1999/04/13 15:11:58  mhaveman
- *	Moved include of rlmt.h to header skgepnmi.h because some macros
- *	are needed there.
- *	
- *	Revision 1.62  1999/04/13 15:08:07  mhaveman
- *	Replaced again SK_RLMT_CHECK_LINK with SK_PNMI_RLMT_MODE_CHK_LINK
- *	to grant unified interface by only using the PNMI header file.
- *	SK_PNMI_RLMT_MODE_CHK_LINK is defined the same as SK_RLMT_CHECK_LINK.
- *	
- *	Revision 1.61  1999/04/13 15:02:48  mhaveman
- *	Changes caused by review:
- *	-Changed some comments
- *	-Removed redundant check for OID_SKGE_PHYS_FAC_ADDR
- *	-Optimized PRESET check.
- *	-Meaning of error SK_ADDR_DUPLICATE_ADDRESS changed. Set of same
- *	 address will now not cause this error. Removed corresponding check.
- *	
- *	Revision 1.60  1999/03/23 10:41:23  mhaveman
- *	Added comments.
- *	
- *	Revision 1.59  1999/02/19 08:01:28  mhaveman
- *	Fixed bug 10372 that after counter reset all ports were displayed
- *	as inactive.
- *	
- *	Revision 1.58  1999/02/16 18:04:47  mhaveman
- *	Fixed problem of twisted OIDs SENSOR_WAR_TIME and SENSOR_ERR_TIME.
- *	
- *	Revision 1.56  1999/01/27 12:29:11  mhaveman
- *	SkTimerStart was called with time value in milli seconds but needs
- *	micro seconds.
- *	
- *	Revision 1.55  1999/01/25 15:00:38  mhaveman
- *	Added support to allow multiple ports to be active. If this feature in
- *	future will be used, the Management Data Base variables PORT_ACTIVE
- *	and PORT_PREFERED should be moved to the port specific part of RLMT.
- *	Currently they return the values of the first active physical port
- *	found. A set to the virtual port will actually change all active
- *	physical ports. A get returns the melted values of all active physical
- *	ports. If the port values differ a return value INDETERMINATED will
- *	be returned. This effects especially the CONF group.
- *	
- *	Revision 1.54  1999/01/19 10:10:22  mhaveman
- *	-Fixed bug 10354: Counter values of virtual port were wrong after port
- *	 switches
- *	-Added check if a switch to the same port is notified.
- *	
- *	Revision 1.53  1999/01/07 09:25:21  mhaveman
- *	Forgot to initialize a variable.
- *	
- *	Revision 1.52  1999/01/05 10:34:33  mhaveman
- *	Fixed little error in RlmtChangeEstimate calculation.
- *	
- *	Revision 1.51  1999/01/05 09:59:07  mhaveman
- *	-Moved timer start to init level 2
- *	-Redesigned port switch average calculation to avoid 64bit
- *	 arithmetic.
- *	
- *	Revision 1.50  1998/12/10 15:13:59  mhaveman
- *	-Fixed: PHYS_CUR_ADDR returned wrong addresses
- *	-Fixed: RLMT_PORT_PREFERED and RLMT_CHANGE_THRES preset returned
- *	        always BAD_VALUE.
- *	-Fixed: TRAP buffer seemed to sometimes suddenly empty
- *	
- *	Revision 1.49  1998/12/09 16:17:07  mhaveman
- *	Fixed: Couldnot delete VPD keys on UNIX.
- *	
- *	Revision 1.48  1998/12/09 14:11:10  mhaveman
- *	-Add: Debugmessage for XMAC_RESET supressed to minimize output.
- *	-Fixed: RlmtChangeThreshold will now be initialized.
- *	-Fixed: VPD_ENTRIES_LIST extended value with unnecessary space char.
- *	-Fixed: On VPD key creation an invalid key name could be created
- *	        (e.g. A5)
- *	-Some minor changes in comments and code.
- *	
- *	Revision 1.47  1998/12/08 16:00:31  mhaveman
- *	-Fixed: For RLMT_PORT_ACTIVE will now be returned a 0 if no port
- *		is active.
- *	-Fixed: For the RLMT statistics group only the last value was
- *		returned and the rest of the buffer was filled with 0xff
- *	-Fixed: Mysteriously the preset on RLMT_MODE still returned
- *		BAD_VALUE.
- *	Revision 1.46  1998/12/08 10:04:56  mhaveman
- *	-Fixed: Preset on RLMT_MODE returned always BAD_VALUE error.
- *	-Fixed: Alignment error in GetStruct
- *	-Fixed: If for Get/Preset/SetStruct the buffer size is equal or
- *	        larger than SK_PNMI_MIN_STRUCT_SIZE the return value is stored
- *		to the buffer. In this case the caller should always return
- *	        ok to its upper routines. Only if the buffer size is less
- *	        than SK_PNMI_MIN_STRUCT_SIZE and the return value is unequal
- *	        to 0, an error should be returned by the caller.
- *	-Fixed: Wrong number of instances with RLMT statistic.
- *	-Fixed: Return now SK_LMODE_STAT_UNKNOWN if the LinkModeStatus is 0.
- *	
- *	Revision 1.45  1998/12/03 17:17:24  mhaveman
- *	-Removed for VPD create action the buffer size limitation to 4 bytes.
- *	-Pass now physical/active physical port to ADDR for CUR_ADDR set
- *	
- *	Revision 1.44  1998/12/03 15:14:35  mhaveman
- *	Another change to Vpd instance evaluation.
- *
- *	Revision 1.43  1998/12/03 14:18:10  mhaveman
- *	-Fixed problem in PnmiSetStruct. It was impossible to set any value.
- *	-Removed VPD key evaluation for VPD_FREE_BYTES and VPD_ACTION.
- *
- *	Revision 1.42  1998/12/03 11:31:47  mhaveman
- *	Inserted cast to satisfy lint.
- *	
- *	Revision 1.41  1998/12/03 11:28:16  mhaveman
- *	Removed SK_PNMI_CHECKPTR
- *	
- *	Revision 1.40  1998/12/03 11:19:07  mhaveman
- *	Fixed problems
- *	-A set to virtual port will now be ignored. A set with broadcast
- *	 address to any port will be ignored.
- *	-GetStruct function made VPD instance calculation wrong.
- *	-Prefered port returned -1 instead of 0.
- *	
- *	Revision 1.39  1998/11/26 15:30:29  mhaveman
- *	Added sense mode to link mode.
- *	
- *	Revision 1.38  1998/11/23 15:34:00  mhaveman
- *	-Fixed bug for RX counters. On an RX overflow interrupt the high
- *	 words of all RX counters were incremented.
- *	-SET operations on FLOWCTRL_MODE and LINK_MODE accept now the
- *	 value 0, which has no effect. It is usefull for multiple instance
- *	 SETs.
- *	
- *	Revision 1.37  1998/11/20 08:02:04  mhaveman
- *	-Fixed: Ports were compared with MAX_SENSORS
- *	-Fixed: Crash in GetTrapEntry with MEMSET macro
- *	-Fixed: Conversions between physical, logical port index and instance
- *	
- *	Revision 1.36  1998/11/16 07:48:53  mhaveman
- *	Casted SK_DRIVER_SENDEVENT with (void) to eleminate compiler warnings
- *	on Solaris.
- *	
- *	Revision 1.35  1998/11/16 07:45:34  mhaveman
- *	SkAddrOverride now returns value and will be checked.
- *
- *	Revision 1.34  1998/11/10 13:40:37  mhaveman
- *	Needed to change interface, because NT driver needs a return value
- *	of needed buffer space on TOO_SHORT errors. Therefore all
- *	SkPnmiGet/Preset/Set functions now have a pointer to the length
- *	parameter, where the needed space on error is returned.
- *	
- *	Revision 1.33  1998/11/03 13:52:46  mhaveman
- *	Made file lint conform.
- *	
- *	Revision 1.32  1998/11/03 13:19:07  mhaveman
- *	The events SK_HWEV_SET_LMODE and SK_HWEV_SET_FLOWMODE pass now in
- *	Para32[0] the physical MAC index and in Para32[1] the new mode.
- *	
- *	Revision 1.31  1998/11/03 12:30:40  gklug
- *	fix: compiler warning memset
- *
- *	Revision 1.30  1998/11/03 12:04:46  mhaveman
- *	Fixed problem in SENSOR_VALUE, which wrote beyond the buffer end
- *	Fixed alignment problem with CHIPSET.
- *
- *	Revision 1.29  1998/11/02 11:23:54  mhaveman
- *	Corrected SK_ERROR_LOG to SK_ERR_LOG. Sorry.
- *	
- *	Revision 1.28  1998/11/02 10:47:16  mhaveman
- *	Added syslog messages for internal errors.
- *	
- *	Revision 1.27  1998/10/30 15:48:06  mhaveman
- *	Fixed problems after simulation of SK_PNMI_EVT_CHG_EST_TIMER and
- *	RlmtChangeThreshold calculation.
- *	
- *	Revision 1.26  1998/10/29 15:36:55  mhaveman
- *	-Fixed bug in trap buffer handling.
- *	-OID_SKGE_DRIVER_DESCR, OID_SKGE_DRIVER_VERSION, OID_SKGE_HW_DESCR,
- *	 OID_SKGE_HW_VERSION, OID_SKGE_VPD_ENTRIES_LIST, OID_SKGE_VPD_KEY,
- *	 OID_SKGE_VPD_VALUE, and OID_SKGE_SENSOR_DESCR return values with
- *	 a leading octet before each string storing the string length.
- *	-Perform a RlmtUpdate during SK_PNMI_EVT_XMAC_RESET to minimize
- *	 RlmtUpdate calls in GetStatVal.
- *	-Inserted SK_PNMI_CHECKFLAGS macro increase readability.
- *	
- *	Revision 1.25  1998/10/29 08:50:36  mhaveman
- *	Fixed problems after second event simulation.
- *	
- *	Revision 1.24  1998/10/28 08:44:37  mhaveman
- *	-Fixed alignment problem
- *	-Fixed problems during event simulation
- *	-Fixed sequence of error return code (INSTANCE -> ACCESS -> SHORT)
- *	-Changed type of parameter Instance back to SK_U32 because of VPD
- *	-Updated new VPD function calls
- *
- *	Revision 1.23  1998/10/23 10:16:37  mhaveman
- *	Fixed bugs after buffer test simulation.
- *	
- *	Revision 1.22  1998/10/21 13:23:52  mhaveman
- *	-Call syntax of SkOsGetTime() changed to SkOsGetTime(pAc).
- *	-Changed calculation of hundrets of seconds.
- *
- *	Revision 1.20  1998/10/20 07:30:45  mhaveman
- *	Made type changes to unsigned integer where possible.
- *	
- *	Revision 1.19  1998/10/19 10:51:30  mhaveman
- *	-Made Bug fixes after simulation run
- *	-Renamed RlmtMAC... to RlmtPort...
- *	-Marked workarounds with Errata comments
- *	
- *	Revision 1.18  1998/10/14 07:50:08  mhaveman
- *	-For OID_SKGE_LINK_STATUS the link down detection has moved from RLMT
- *	 to HWACCESS.
- *	-Provided all MEMCPY/MEMSET macros with (char *) pointers, because
- *	 Solaris throwed warnings when mapping to bcopy/bset.
- *
- *	Revision 1.17  1998/10/13 07:42:01  mhaveman
- *	-Added OIDs OID_SKGE_TRAP_NUMBER and OID_SKGE_ALL_DATA
- *	-Removed old cvs history entries
- *	-Renamed MacNumber to PortNumber
- *
- *	Revision 1.16  1998/10/07 10:52:49  mhaveman
- *	-Inserted handling of some OID_GEN_ Ids for windows
- *	-Fixed problem with 803.2 statistic.
- *	
- *	Revision 1.15  1998/10/01 09:16:29  mhaveman
- *	Added Debug messages for function call and UpdateFlag tracing.
- *	
- *	Revision 1.14  1998/09/30 13:39:09  mhaveman
- *	-Reduced namings of 'MAC' by replacing them with 'PORT'.
- *	-Completed counting of OID_SKGE_RX_HW_ERROR_CTS,
- *       OID_SKGE_TX_HW_ERROR_CTS,
- *	 OID_SKGE_IN_ERRORS_CTS, and OID_SKGE_OUT_ERROR_CTS.
- *	-SET check for RlmtMode
- *	
- *	Revision 1.13  1998/09/28 13:13:08  mhaveman
- *	Hide strcmp, strlen, and strncpy behind macros SK_STRCMP, SK_STRLEN,
- *	and SK_STRNCPY. (Same reasons as for mem.. and MEM..)
- *	
- *	Revision 1.12  1998/09/16 08:18:36  cgoos
- *	Fix: XM_INxx and XM_OUTxx called with different parameter order:
- *      sometimes IoC,Mac,...  sometimes Mac,IoC,... Now always first variant.
- *	Fix: inserted "Pnmi." into some pAC->pDriverDescription / Version.
- *	Change: memset, memcpy to makros SK_MEMSET, SK_MEMCPY
- *
- *	Revision 1.11  1998/09/04 17:01:45  mhaveman
- *	Added SyncCounter as macro and OID_SKGE_.._NO_DESCR_CTS to
- *	OID_SKGE_RX_NO_BUF_CTS.
- *	
- *	Revision 1.10  1998/09/04 14:35:35  mhaveman
- *	Added macro counters, that are counted by driver.
- *	
- ****************************************************************************/
-
-
 #ifndef _lint
 static const char SysKonnectFileId[] =
 	"@(#) $Id: skgepnmi.c,v 1.111 2003/09/15 13:35:35 tschilli Exp $ (C) Marvell.";
--- diff/drivers/net/sk98lin/skgesirq.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/net/sk98lin/skgesirq.c	2004-02-09 10:39:54.000000000 +0000
@@ -2,8 +2,6 @@
  *
  * Name:	skgesirq.c
  * Project:	Gigabit Ethernet Adapters, Common Modules
- * Version:	$Revision: 1.92 $
- * Date:	$Date: 2003/09/16 14:37:07 $
  * Purpose:	Special IRQ module
  *
  ******************************************************************************/
@@ -22,374 +20,6 @@
  *
  ******************************************************************************/
 
-/******************************************************************************
- *
- * 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
- *	for Downshift detection (Yukon-Copper).
- *	Editorial changes.
- *	
- *	Revision 1.90  2003/05/28 15:35:45  rschmidt
- *	Added parameter AutoNeg in all SkGePortCheckUp...() to save code.
- *	Added setting for AutoNeg only once in SkGePortCheckUp().
- *	Moved defines for return codes of SkGePortCheckUp() to header file.
- *	Editorial changes.
- *	
- *	Revision 1.89  2003/05/13 17:32:20  mkarl
- *	Removed links to RLMT and PNMI for SLIM driver (SK_SLIM).
- *	Separated GENESIS and YUKON only code to reduce code size.
- *	
- *	Revision 1.88  2003/05/06 13:20:34  rschmidt
- *	Changed workaround for Tx hang in half duplex only for Genesis.
- *	Replaced SkPnmiGetVar() calls for Tx Octets Counter
- *	with SkXmMacStatistic() in SkGeSirqIsr().
- *	Added defines around GENESIS resp. YUKON branches to reduce
- *	code size for PXE.
- *	Editorial changes.
- *	
- *	Revision 1.87  2003/04/28 09:18:31  rschmidt
- *	Added increment for GITimeStampCnt (high dword for
- *	Time Stamp Timer counter), when overflow IRQ occurs.
- *	Disabled HW Error IRQ on 32-bit Yukon if sensor IRQ occurs
- *	by changing the common mask stored in GIValIrqMask.
- *	Changed handling for HW Error IRQ in SkGeSirqIsr().
- *	Added clearing of the software forced IRQ in SkGeSirqIsr().
- *	Editorial changes.
- *	
- *	Revision 1.86  2003/04/09 13:03:24  rschmidt
- *	Added workaround for configuration of GPHY's Auto-negotiation
- *	advertisement register after link down event in SkPhyIsrGmac().
- *	
- *	Revision 1.85  2003/04/08 16:39:02  rschmidt
- *	Changed handling for different PhyTypes for source code
- *	portability to PXE, UNDI.
- *	Editorial changes.
- *	
- *	Revision 1.84  2003/03/31 07:01:43  mkarl
- *	Corrected Copyright.
- *	Editorial changes.
- *	
- *	Revision 1.83  2003/02/05 15:10:59  rschmidt
- *	Fixed setting of PLinkSpeedUsed in SkHWLinkUp() when
- *	auto-negotiation is disabled.
- *	Editorial changes.
- *	
- *	Revision 1.82  2003/01/29 13:34:33  rschmidt
- *	Added some typecasts to avoid compiler warnings.
- *	
- *	Revision 1.81  2002/12/05 10:49:51  rschmidt
- *	Fixed missing Link Down Event for fiber (Bug Id #10768)
- *	Added reading of cable length when link is up
- *	Removed testing of unused error bits in PHY ISR
- *	Editorial changes.
- *	
- *	Revision 1.80  2002/11/12 17:15:21  rschmidt
- *	Replaced SkPnmiGetVar() by ...MacStatistic() in SkMacParity().
- *	Editorial changes.
- *	
- *	Revision 1.79  2002/10/14 15:14:51  rschmidt
- *	Changed clearing of IS_M1_PAR_ERR (MAC 1 Parity Error) in
- *	SkMacParity() depending on GIChipRev (HW-Bug #8).
- *	Added error messages for GPHY Auto-Negotiation Error and
- *	FIFO Overflow/Underrun in SkPhyIsrGmac().
- *	Editorial changes.
- *	
- *	Revision 1.78  2002/10/10 15:54:29  mkarl
- *	changes for PLinkSpeedUsed
- *	
- *	Revision 1.77  2002/09/12 08:58:51  rwahl
- *	Retrieve counters needed for XMAC errata workarounds directly because
- *	PNMI returns corrected counter values (e.g. #10620).
- *	
- *	Revision 1.76  2002/08/16 15:21:54  rschmidt
- *	Replaced all if(GIChipId == CHIP_ID_GENESIS) with new entry GIGenesis.
- *	Replaced wrong 1st para pAC with IoC in SK_IN/OUT macros.
- *	Editorial changes.
- *	
- *	Revision 1.75  2002/08/12 13:50:47  rschmidt
- *	Changed clearing of IS_M1_PAR_ERR (MAC 1 Parity Error) in
- *	SkMacParity() by GMF_CLI_TX_FC instead of GMF_CLI_TX_PE (HW-Bug #8).
- *	Added clearing of IS_IRQ_TIST_OV and IS_IRQ_SENSOR in SkGeHwErr().
- *	Corrected handling of Link Up and Auto-Negotiation Over for GPHY.
- *	in SkGePortCheckUpGmac().
- *	Editorial changes.
- *	
- *	Revision 1.74  2002/08/08 16:17:04  rschmidt
- *	Added PhyType check for SK_HWEV_SET_ROLE event (copper only)
- *	Changed Link Up check reading PHY Specific Status (YUKON)
- *	Editorial changes
- *	
- *	Revision 1.73  2002/07/15 18:36:53  rwahl
- *	Editorial changes.
- *	
- *	Revision 1.72  2002/07/15 15:46:26  rschmidt
- *	Added new event: SK_HWEV_SET_SPEED
- *	Editorial changes
- *	
- *	Revision 1.71  2002/06/10 09:34:19  rschmidt
- *	Editorial changes
- *	
- *	Revision 1.70  2002/06/05 08:29:18  rschmidt
- *	SkXmRxTxEnable() replaced by SkMacRxTxEnable().
- *	Editorial changes.
- *	
- *	Revision 1.69  2002/04/25 13:03:49  rschmidt
- *	Changes for handling YUKON.
- *	Use of #ifdef OTHER_PHY to eliminate code for unused Phy types.
- *	Replaced all XMAC-access macros by functions: SkMacRxTxDisable(),
- *	SkMacIrqDisable().
- *	Added handling for GMAC FIFO in SkMacParity().
- *	Replaced all SkXm...() functions with SkMac...() to handle also
- *	YUKON's GMAC.
- *	Macros for XMAC PHY access PHY_READ(), PHY_WRITE() replaced
- *	by functions SkXmPhyRead(), SkXmPhyWrite().
- *	Disabling all PHY interrupts moved to SkMacIrqDisable().
- *	Added handling for GPHY IRQ in SkGeSirqIsr().
- *	Removed status parameter from MAC IRQ handler SkMacIrq().
- *	Added SkGePortCheckUpGmac(), SkPhyIsrGmac() for GMAC.
- *	Editorial changes
- *	
- *	Revision 1.68  2002/02/26 15:24:53  rwahl
- *	Fix: no link with manual configuration (#10673). The previous fix for
- *	#10639 was removed. So for RLMT mode = CLS the RLMT may switch to
- *	misconfigured port. It should not occur for the other RLMT modes.
- *	
- *	Revision 1.67  2001/11/20 09:19:58  rwahl
- *	Reworked bugfix #10639 (no dependency to RLMT mode).
- *	
- *	Revision 1.66  2001/10/26 07:52:53  afischer
- *	Port switching bug in `check local link` mode
- *	
- *	Revision 1.65  2001/02/23 13:41:51  gklug
- *	fix: PHYS2INST should be used correctly for Dual Net operation
- *	chg: do no longer work with older PNMI
- *	
- *	Revision 1.64  2001/02/15 11:27:04  rassmann
- *	Working with RLMT v1 if SK_MAX_NETS undefined.
- *	
- *	Revision 1.63  2001/02/06 10:44:23  mkunz
- *	- NetIndex added to interface functions of pnmi V4 with dual net support
- *	
- *	Revision 1.62  2001/01/31 15:31:41  gklug
- *	fix: problem with autosensing an SR8800 switch
- *	
- *	Revision 1.61  2000/11/09 11:30:09  rassmann
- *	WA: Waiting after releasing reset until BCom chip is accessible.
- *
- *	Revision 1.60  2000/10/18 12:37:48  cgoos
- *	Reinserted the comment for version 1.56.
- *	
- *	Revision 1.59  2000/10/18 12:22:20  cgoos
- *	Added workaround for half duplex hangup.
- *	
- *	Revision 1.58  2000/09/28 13:06:04  gklug
- *	fix: BCom may NOT be touched if XMAC is in RESET state
- *	
- *	Revision 1.57  2000/09/08 12:38:39  cgoos
- *	Added forgotten variable declaration.
- *	
- *	Revision 1.56  2000/09/08 08:12:13  cgoos
- *	Changed handling of parity errors in SkGeHwErr (correct reset of error).
- *
- *	Revision 1.55  2000/06/19 08:36:25  cgoos
- *	Changed comment.
- *	
- *	Revision 1.54  2000/05/22 08:45:57  malthoff
- *	Fix: #10523 is valid for all BCom PHYs.
- *	
- *	Revision 1.53  2000/05/19 10:20:30  cgoos
- *	Removed Solaris debug output code.
- *	
- *	Revision 1.52  2000/05/19 10:19:37  cgoos
- *	Added PHY state check in HWLinkDown.
- *	Move PHY interrupt code to IS_EXT_REG case in SkGeSirqIsr.
- *	
- *	Revision 1.51  2000/05/18 05:56:20  cgoos
- *	Fixed typo.
- *	
- *	Revision 1.50  2000/05/17 12:49:49  malthoff
- *	Fixes BCom link bugs (#10523).
- *	
- *	Revision 1.49  1999/12/17 11:02:50  gklug
- *	fix: read PHY_STAT of Broadcom chip more often to assure good status
- *	
- *	Revision 1.48  1999/12/06 10:01:17  cgoos
- *	Added SET function for Role.
- *	
- *	Revision 1.47  1999/11/22 13:34:24  cgoos
- *	Changed license header to GPL.
- *	
- *	Revision 1.46  1999/09/16 10:30:07  cgoos
- *	Removed debugging output statement from Linux.
- *	
- *	Revision 1.45  1999/09/16 07:32:55  cgoos
- *	Fixed dual-port copperfield bug (PHY_READ from resetted port).
- *	Removed some unused variables.
- *	
- *	Revision 1.44  1999/08/03 15:25:04  cgoos
- *	Removed workaround for disabled interrupts in half duplex mode.
- *	
- *	Revision 1.43  1999/08/03 14:27:58  cgoos
- *	Removed SENSE mode code from SkGePortCheckUpBcom.
- *	
- *	Revision 1.42  1999/07/26 09:16:54  cgoos
- *	Added some typecasts to avoid compiler warnings.
- *	
- *	Revision 1.41  1999/05/19 07:28:59  cgoos
- *	Changes for 1000Base-T.
- *	
- *	Revision 1.40  1999/04/08 13:59:39  gklug
- *	fix: problem with 3Com switches endless RESTARTs
- *	
- *	Revision 1.39  1999/03/08 10:10:52  gklug
- *	fix: AutoSensing did switch to next mode even if LiPa indicated offline
- *	
- *	Revision 1.38  1999/03/08 09:49:03  gklug
- *	fix: Bug using pAC instead of IoC, causing AIX problems
- *	fix: change compare for Linux compiler bug workaround
- *	
- *	Revision 1.37  1999/01/28 14:51:33  gklug
- *	fix: monitor for autosensing and extra RESETS the RX on wire counters
- *	
- *	Revision 1.36  1999/01/22 09:19:55  gklug
- *	fix: Init DupMode and InitPauseMd are now called in RxTxEnable
- *	
- *	Revision 1.35  1998/12/11 15:22:59  gklug
- *	chg: autosensing: check for receive if manual mode was guessed
- *	chg: simplified workaround for XMAC errata
- *	chg: wait additional 100 ms before link goes up.
- *	chg: autoneg timeout to 600 ms
- *	chg: restart autoneg even if configured to autonegotiation
- *	
- *	Revision 1.34  1998/12/10 10:33:14  gklug
- *	add: more debug messages
- *	fix: do a new InitPhy if link went down (AutoSensing problem)
- *	chg: Check for zero shorts if link is NOT up
- *	chg: reset Port if link goes down
- *	chg: wait additional 100 ms when link comes up to check shorts
- *	fix: dummy read extended autoneg status to prevent link going down immediately
- *	
- *	Revision 1.33  1998/12/07 12:18:29  gklug
- *	add: refinement of autosense mode: take into account the autoneg cap of LiPa
- *	
- *	Revision 1.32  1998/12/07 07:11:21  gklug
- *	fix: compiler warning
- *	
- *	Revision 1.31  1998/12/02 09:29:05  gklug
- *	fix: WA XMAC Errata: FCSCt check was not correct.
- *	fix: WA XMAC Errata: Prec Counter were NOT updated in case of short checks.
- *	fix: Clear Stat : now clears the Prev counters of all known Ports
- *	
- *	Revision 1.30  1998/12/01 10:54:15  gklug
- *	dd: workaround for XMAC errata changed. Check RX count and CRC err Count, too.
- *	
- *	Revision 1.29  1998/12/01 10:01:53  gklug
- *	fix: if MAC IRQ occurs during port down, this will be handled correctly
- *	
- *	Revision 1.28  1998/11/26 16:22:11  gklug
- *	fix: bug in autosense if manual modes are used
- *	
- *	Revision 1.27  1998/11/26 15:50:06  gklug
- *	fix: PNMI needs to set PLinkModeConf
- *	
- *	Revision 1.26  1998/11/26 14:51:58  gklug
- *	add: AutoSensing functionalty
- *	
- *	Revision 1.25  1998/11/26 07:34:37  gklug
- *	fix: Init PrevShorts when restarting port due to Link connection
- *	
- *	Revision 1.24  1998/11/25 10:57:32  gklug
- *	fix: remove unreferenced local vars
- *	
- *	Revision 1.23  1998/11/25 08:26:40  gklug
- *	fix: don't do a RESET on a starting or stopping port
- *	
- *	Revision 1.22  1998/11/24 13:29:44  gklug
- *	add: Workaround for MAC parity errata
- *	
- *	Revision 1.21  1998/11/18 15:31:06  gklug
- *	fix: lint bugs
- *	
- *	Revision 1.20  1998/11/18 12:58:54  gklug
- *	fix: use PNMI query instead of hardware access
- *	
- *	Revision 1.19  1998/11/18 12:54:55  gklug
- *	chg: add new workaround for XMAC Errata
- *	add: short event counter monitoring on active link too
- *	
- *	Revision 1.18  1998/11/13 14:27:41  malthoff
- *	Bug Fix: Packet Arbiter Timeout was not cleared correctly
- *	for timeout on TX1 and TX2.
- *	
- *	Revision 1.17  1998/11/04 07:01:59  cgoos
- *	Moved HW link poll sequence.
- *	Added call to SkXmRxTxEnable.
- *	
- *	Revision 1.16  1998/11/03 13:46:03  gklug
- *	add: functionality of SET_LMODE and SET_FLOW_MODE
- *	fix: send RLMT LinkDown event when Port stop is given with LinkUp
- *	
- *	Revision 1.15  1998/11/03 12:56:47  gklug
- *	fix: Needs more events
- *	
- *	Revision 1.14  1998/10/30 07:36:35  gklug
- *	rmv: unnecessary code
- *	
- *	Revision 1.13  1998/10/29 15:21:57  gklug
- *	add: Poll link feature for activating HW link
- *	fix: Deactivate HWLink when Port STOP is given
- *	
- *	Revision 1.12  1998/10/28 07:38:57  cgoos
- *	Checking link status at begin of SkHWLinkUp.
- *	
- *	Revision 1.11  1998/10/22 09:46:50  gklug
- *	fix SysKonnectFileId typo
- *	
- *	Revision 1.10  1998/10/14 13:57:47  gklug
- *	add: Port start/stop event
- *	
- *	Revision 1.9  1998/10/14 05:48:29  cgoos
- *	Added definition for Para.
- *	
- *	Revision 1.8  1998/10/14 05:40:09  gklug
- *	add: Hardware Linkup signal used
- *	
- *	Revision 1.7  1998/10/09 06:50:20  malthoff
- *	Remove ID_sccs by SysKonnectFileId.
- *
- *	Revision 1.6  1998/10/08 09:11:49  gklug
- *	add: clear IRQ commands
- *	
- *	Revision 1.5  1998/10/02 14:27:35  cgoos
- *	Fixed some typos and wrong event names.
- *	
- *	Revision 1.4  1998/10/02 06:24:17  gklug
- *	add: HW error function
- *	fix: OUT macros
- *	
- *	Revision 1.3  1998/10/01 07:03:00  gklug
- *	add: ISR for the usual interrupt source register
- *	
- *	Revision 1.2  1998/09/03 13:50:33  gklug
- *	add: function prototypes
- *	
- *	Revision 1.1  1998/08/27 11:50:21  gklug
- *	initial revision
- *	
- *
- *
- ******************************************************************************/
-
 /*
  *	Special Interrupt handler
  *
--- diff/drivers/net/sk98lin/ski2c.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/net/sk98lin/ski2c.c	2004-02-09 10:39:54.000000000 +0000
@@ -2,8 +2,6 @@
  *
  * Name:	ski2c.c
  * 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
  *
  ******************************************************************************/
@@ -22,219 +20,6 @@
  *
  ******************************************************************************/
 
-/******************************************************************************
- *
- * 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.
- *	
- *	Revision 1.56  2002/12/19 14:20:41  rschmidt
- *	Added debugging code in SkI2cWait().
- *	Replaced all I2C-write operations with function SkI2cWrite().
- *	Fixed compiler warning because of uninitialized 'Time' in SkI2cEvent().
- *	Editorial changes.
- *	
- *	Revision 1.55  2002/10/15 07:23:55  rschmidt
- *	Added setting of the GIYukon32Bit bool variable to distinguish
- *	32-bit adapters.
- *	Editorial changes (TWSI).
- *	
- *	Revision 1.54  2002/08/13 09:05:06  rschmidt
- *	Added new thresholds if VAUX is not available (GIVauxAvail).
- *	Merged defines for PHY PLL 3V3 voltage (A and B).
- *	Editorial changes.
- *	
- *	Revision 1.53  2002/08/08 11:04:53  rwahl
- *	Added missing comment for revision 1.51
- *	
- *	Revision 1.52  2002/08/08 10:09:02  jschmalz
- *	Sensor init state caused wrong error log entry
- *	
- *	Revision 1.51  2002/08/06 09:43:03  jschmalz
- *	Extensions and changes for Yukon
- *	
- *	Revision 1.50  2002/08/02 12:09:22  rschmidt
- *	Added support for YUKON sensors.
- *	Editorial changes.
- *	
- *	Revision 1.49  2002/07/30 11:07:52  rschmidt
- *	Replaced MaxSens init by update for Copper in SkI2cInit1(),
- *	because it was already initialized in SkI2cInit0().
- *	Editorial changes.
- *	
- *	Revision 1.48  2001/08/16 12:44:33  afischer
- *	LM80 sensor init values corrected
- *	
- *	Revision 1.47  2001/04/05 11:38:09  rassmann
- *	Set SenState to idle in SkI2cWaitIrq().
- *	Changed error message in SkI2cWaitIrq().
- *	
- *	Revision 1.46  2001/04/02 14:03:35  rassmann
- *	Changed pAC to IoC in SK_IN32().
- *	
- *	Revision 1.45  2001/03/21 12:12:49  rassmann
- *	Resetting I2C_READY interrupt in SkI2cInit1().
- *	
- *	Revision 1.44  2000/08/07 15:49:03  gklug
- *	Fix: SK_INFAST only in NetWare driver.
- *	
- *	Revision 1.43  2000/08/03 14:28:17  rassmann
- *	Added function to wait for I2C being ready before resetting the board.
- *	Replaced one duplicate "out of range" message with correct one.
- *	
- *	Revision 1.42  1999/11/22 13:35:12  cgoos
- *	Changed license header to GPL.
- *	
- *	Revision 1.41  1999/09/14 14:11:30  malthoff
- *	The 1000BT Dual Link adapter has got only one Fan.
- *	The second Fan has been removed.
- *	
- *	Revision 1.40  1999/05/27 13:37:27  malthoff
- *	Set divisor of 1 for fan count calculation.
- *	
- *	Revision 1.39  1999/05/20 14:54:43  malthoff
- *	I2c.DummyReads is not used in Diagnostics.
- *	
- *	Revision 1.38  1999/05/20 09:20:56  cgoos
- *	Changes for 1000Base-T (up to 9 sensors and fans).
- *	
- *	Revision 1.37  1999/03/25 15:11:36  gklug
- *	fix: reset error flag if sensor reads correct value
- *	
- *	Revision 1.36  1999/01/07 14:11:16  gklug
- *	fix: break added
- *	
- *	Revision 1.35  1999/01/05 15:31:49  gklug
- *	fix: CLEAR STAT command is now added correctly
- *	
- *	Revision 1.34  1998/12/01 13:45:16  gklug
- *	fix: introduced Init level, because we don't need reinits
- *	
- *	Revision 1.33  1998/11/09 14:54:25  malthoff
- *	Modify I2C Transfer Timeout handling for Diagnostics.
- *	
- *	Revision 1.32  1998/11/03 06:54:35  gklug
- *	fix: Need dummy reads at the beginning to init sensors
- *
- *	Revision 1.31  1998/11/03 06:42:42  gklug
- *	fix: select correctVIO range only if between warning levels
- *	
- *	Revision 1.30  1998/11/02 07:36:53  gklug
- *	fix: Error should not include WARNING message
- *	
- *	Revision 1.29  1998/10/30 15:07:43  malthoff
- *	Disable 'I2C does not compelete' error log for diagnostics.
- *	
- *	Revision 1.28  1998/10/22 09:48:11  gklug
- *	fix: SysKonnectFileId typo
- *	
- *	Revision 1.27  1998/10/20 09:59:46  gklug
- *	add: parameter to SkOsGetTime
- *	
- *	Revision 1.26  1998/10/09 06:10:59  malthoff
- *	Remove ID_sccs by SysKonnectFileId.
- *	
- *	Revision 1.25  1998/09/08 12:40:26  gklug
- *	fix: syntax error in if clause
- *	
- *	Revision 1.24  1998/09/08 12:19:42  gklug
- *	chg: INIT Level checking
- *	
- *	Revision 1.23  1998/09/08 07:37:20  gklug
- *	fix: log error if PCI_IO voltage sensor could not be initialized
- *	
- *	Revision 1.22  1998/09/04 08:30:03  malthoff
- *	Bugfixes during SK_DIAG testing:
- *	- correct NS2BCLK() macro
- *	- correct SkI2cSndDev()
- *	- correct SkI2cWait() loop waiting for an event
- *	
- *	Revision 1.21  1998/08/27 14:46:01  gklug
- *	chg: if-then-else replaced by switch
- *
- *	Revision 1.20  1998/08/27 14:40:07  gklug
- *	test: integral types
- *	
- *	Revision 1.19  1998/08/25 07:51:54  gklug
- *	fix: typos for compiling
- *	
- *	Revision 1.18  1998/08/25 06:12:24  gklug
- *	add: count errors and warnings
- *	fix: check not the sensor state but the ErrFlag!
- *	
- *	Revision 1.17  1998/08/25 05:56:48  gklug
- *	add: CheckSensor function
- *	
- *	Revision 1.16  1998/08/20 11:41:10  gklug
- *	chg: omit STRCPY macro by using char * as Sensor Description
- *	
- *	Revision 1.15  1998/08/20 11:37:35  gklug
- *	chg: change Ioc to IoC
- *	
- *	Revision 1.14  1998/08/20 11:32:52  gklug
- *	fix: Para compile error
- *	
- *	Revision 1.13  1998/08/20 11:27:41  gklug
- *	fix: Compile bugs with new awrning constants
- *	
- *	Revision 1.12  1998/08/20 08:53:05  gklug
- *	fix: compiler errors
- *	add: Threshold values
- *	
- *	Revision 1.11  1998/08/19 12:39:22  malthoff
- *	Compiler Fix: Some names have changed.
- *	
- *	Revision 1.10  1998/08/19 12:20:56  gklug
- *	fix: remove struct from C files (see CCC)
- *	
- *	Revision 1.9  1998/08/19 06:28:46  malthoff
- *	SkOsGetTime returns SK_U64 now.
- *	
- *	Revision 1.8  1998/08/17 13:53:33  gklug
- *	fix: Parameter of event function and its result
- *	
- *	Revision 1.7  1998/08/17 07:02:15  malthoff
- *	Modify the functions for accessing the I2C SW Registers.
- *	Modify SkI2cWait().
- *	Put Lm80RcvReg into sklm80.c
- *	Remove Compiler Errors.
- *	
- *	Revision 1.6  1998/08/14 07:13:20  malthoff
- *	remove pAc with pAC
- *	remove smc with pAC
- *	change names to new convention
- *
- *	Revision 1.5  1998/08/14 06:24:49  gklug
- *	add: init level 1 and 2
- *
- *	Revision 1.4  1998/08/12 14:31:12  gklug
- *	add: error log for unknown event
- *
- *	Revision 1.3  1998/08/12 13:37:04  gklug
- *	add: Init 0 function
- *
- *	Revision 1.2  1998/08/11 07:27:15  gklug
- *	add: functions of the interface
- *	adapt rest of source to C coding Conventions
- *	rmv: unnecessary code taken from Mona Lisa
- *
- *	Revision 1.1  1998/06/19 14:28:43  malthoff
- *	Created. Sources taken from ML Projekt.
- *	Sources have to be reworked for GE.
- *
- ******************************************************************************/
-
 /*
  *	I2C Protocol
  */
--- diff/drivers/net/sk98lin/sklm80.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/net/sk98lin/sklm80.c	2004-02-09 10:39:54.000000000 +0000
@@ -2,8 +2,6 @@
  *
  * Name:	sklm80.c
  * 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)
  *
  ******************************************************************************/
@@ -22,86 +20,6 @@
  *
  ******************************************************************************/
 
-/******************************************************************************
- *
- * 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.
- *	
- *	Revision 1.19  2002/08/06 09:43:31  jschmalz
- *	Extensions and changes for Yukon.
- *	
- *	Revision 1.18  2002/08/02 12:26:57  rschmidt
- *	Editorial changes.
- *	
- *	Revision 1.17  1999/11/22 13:35:51  cgoos
- *	Changed license header to GPL.
- *	
- *	Revision 1.16  1999/05/27 14:05:47  malthoff
- *	Fans: Set SenVal to 0 if the fan value is 0 or 0xff. Both values
- *	are outside the limits (0: div zero error, 0xff: value not in
- *	range, assume 0).
- *	
- *	Revision 1.15  1999/05/27 13:38:51  malthoff
- *	Pervent from Division by zero errors.
- *	
- *	Revision 1.14  1999/05/20 09:20:01  cgoos
- *	Changes for 1000Base-T (Fan sensors).
- *	
- *	Revision 1.13  1998/10/22 09:48:14  gklug
- *	fix: SysKonnectFileId typo
- *	
- *	Revision 1.12  1998/10/09 06:12:06  malthoff
- *	Remove ID_sccs by SysKonnectFileId.
- *	
- *	Revision 1.11  1998/09/04 08:33:48  malthoff
- *	bug fix: SenState = SK_SEN_IDLE when
- *	leaving SK_SEN_VALEXT state
- *	
- *	Revision 1.10  1998/08/20 12:02:10  gklug
- *	fix: compiler warnings type mismatch
- *
- *	Revision 1.9  1998/08/20 11:37:38  gklug
- *	chg: change Ioc to IoC
- *	
- *	Revision 1.8  1998/08/19 12:20:58  gklug
- *	fix: remove struct from C files (see CCC)
- *	
- *	Revision 1.7  1998/08/17 07:04:57  malthoff
- *	Take SkLm80RcvReg() function from ski2c.c.
- *	Add IoC parameter to BREAK_OR_WAIT() macro.
- *	
- *	Revision 1.6  1998/08/14 07:11:28  malthoff
- *	remove pAc with pAC.
- *
- *	Revision 1.5  1998/08/14 06:46:55  gklug
- *	fix: temperature can get negative
- *
- *	Revision 1.4  1998/08/13 08:27:04  gklug
- *	add: temperature reading now o.k.
- *	fix: pSen declaration, SK_ERR_LOG call, ADDR macro
- *
- *	Revision 1.3  1998/08/13 07:28:21  gklug
- *	fix: pSen was wrong initialized
- *	add: correct conversion for voltage readings
- *
- *	Revision 1.2  1998/08/11 07:52:14  gklug
- *	add: Lm80 read sensor function
- *
- *	Revision 1.1  1998/07/17 09:57:12  gklug
- *	initial version
- *
- ******************************************************************************/
-
 /*
 	LM80 functions
 */
--- diff/drivers/net/sk98lin/skproc.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/net/sk98lin/skproc.c	2004-02-09 10:39:54.000000000 +0000
@@ -2,8 +2,6 @@
  *
  * Name:	skproc.c
  * Project:	GEnesis, PCI Gigabit Ethernet Adapter
- * Version:	$Revision: 1.11 $
- * Date:	$Date: 2003/12/11 16:03:57 $
  * Purpose:	Funktions to display statictic data
  *
  ******************************************************************************/
@@ -24,98 +22,6 @@
  *	The information in this file is provided "AS IS" without warranty.
  *
  ******************************************************************************/
-/******************************************************************************
- *
- * 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)
- *	
- *	Revision 1.1  2003/07/18 13:39:57  rroesler
- *	Fix: Re-enter after CVS crash
- *	
- *	Revision 1.8  2003/06/27 14:41:42  rroesler
- *	Corrected compiler-warning kernel 2.2
- *	
- *	Revision 1.7  2003/06/27 12:09:51  rroesler
- *	corrected minor edits
- *	
- *	Revision 1.6  2003/05/26 12:58:53  mlindner
- *	Add: Support for Kernel 2.5/2.6
- *	
- *	Revision 1.5  2003/03/19 14:40:47  mlindner
- *	Fix: Editorial changes
- *	
- *	Revision 1.4  2003/02/25 14:16:37  mlindner
- *	Fix: Copyright statement
- *	
- *	Revision 1.3  2002/10/02 12:59:51  mlindner
- *	Add: Support for Yukon
- *	Add: Speed check and setup
- *	Add: Merge source for kernel 2.2.x and 2.4.x
- *	Add: Read sensor names directly from VPD
- *	Fix: Volt values
- *	
- *	Revision 1.2.2.7  2002/01/14 12:45:15  mlindner
- *	Fix: Editorial changes
- *	
- *	Revision 1.2.2.6  2001/12/06 15:26:07  mlindner
- *	Fix: Return value of proc_read
- *	
- *	Revision 1.2.2.5  2001/12/06 09:57:39  mlindner
- *	New ProcFs entries
- *	
- *	Revision 1.2.2.4  2001/09/05 12:16:02  mlindner
- *	Add: New ProcFs entries
- *	Fix: Counter Errors (Jumbo == to long errors)
- *	Fix: Kernel error compilation
- *	Fix: too short counters
- *	
- *	Revision 1.2.2.3  2001/06/25 07:26:26  mlindner
- *	Add: More error messages
- *	
- *	Revision 1.2.2.2  2001/03/15 12:50:13  mlindner
- *	fix: ProcFS owner protection
- *	
- *	Revision 1.2.2.1  2001/03/12 16:43:48  mlindner
- *	chg: 2.4 requirements for procfs
- *	
- *	Revision 1.1  2001/01/22 14:15:31  mlindner
- *	added ProcFs functionality
- *	Dual Net functionality integrated
- *	Rlmt networks added
- *	
- *
- ******************************************************************************/
 
 #include <linux/proc_fs.h>
 #include <linux/seq_file.h>
--- diff/drivers/net/sk98lin/skqueue.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/net/sk98lin/skqueue.c	2004-02-09 10:39:54.000000000 +0000
@@ -2,8 +2,6 @@
  *
  * Name:	skqueue.c
  * 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.
  *
  ******************************************************************************/
@@ -22,77 +20,6 @@
  *
  ******************************************************************************/
 
-/******************************************************************************
- *
- * 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.
- *	
- *	Revision 1.18  2002/05/07 14:11:11  rwahl
- *	Fixed Watcom Precompiler error.
- *	
- *	Revision 1.17  2002/03/25 10:06:41  mkunz
- *	SkIgnoreEvent deleted
- *	
- *	Revision 1.16  2002/03/15 10:51:59  mkunz
- *	Added event classes for link aggregation
- *	
- *	Revision 1.15  1999/11/22 13:36:29  cgoos
- *	Changed license header to GPL.
- *	
- *	Revision 1.14  1998/10/15 15:11:35  gklug
- *	fix: ID_sccs to SysKonnectFileId
- *	
- *	Revision 1.13  1998/09/08 08:47:52  gklug
- *	add: init level handling
- *	
- *	Revision 1.12  1998/09/08 07:43:20  gklug
- *	fix: Sirq Event function name
- *	
- *	Revision 1.11  1998/09/08 05:54:34  gklug
- *	chg: define SK_CSUM is replaced by SK_USE_CSUM
- *	
- *	Revision 1.10  1998/09/03 14:14:49  gklug
- *	add: CSUM and HWAC Eventclass and function.
- *	
- *	Revision 1.9  1998/08/19 09:50:50  gklug
- *	fix: remove struct keyword from c-code (see CCC) add typedefs
- *	
- *	Revision 1.8  1998/08/17 13:43:11  gklug
- *	chg: Parameter will be union of 64bit para, 2 times SK_U32 or SK_PTR
- *	
- *	Revision 1.7  1998/08/14 07:09:11  gklug
- *	fix: chg pAc -> pAC
- *	
- *	Revision 1.6  1998/08/11 12:13:14  gklug
- *	add: return code feature of Event service routines
- *	add: correct Error log calls
- *	
- *	Revision 1.5  1998/08/07 12:53:45  gklug
- *	fix: first compiled version
- *	
- *	Revision 1.4  1998/08/07 09:20:48  gklug
- *	adapt functions to C coding conventions.
- *	
- *	Revision 1.3  1998/08/05 11:29:32  gklug
- *	rmv: Timer event entry. Timer will queue event directly
- *	
- *	Revision 1.2  1998/07/31 11:22:40  gklug
- *	Initial version
- *	
- *	Revision 1.1  1998/07/30 15:14:01  gklug
- *	Initial version. Adapted from SMT
- *
- ******************************************************************************/
-
-
 /*
  *	Event queue and dispatcher
  */
--- diff/drivers/net/sk98lin/skrlmt.c	2003-08-20 14:16:30.000000000 +0100
+++ source/drivers/net/sk98lin/skrlmt.c	2004-02-09 10:39:54.000000000 +0000
@@ -2,8 +2,6 @@
  *
  * Name:	skrlmt.c
  * Project:	GEnesis, PCI Gigabit Ethernet Adapter
- * Version:	$Revision: 1.69 $
- * Date:	$Date: 2003/04/15 09:39:22 $
  * Purpose:	Manage links on SK-NET Adapters, esp. redundant ones.
  *
  ******************************************************************************/
@@ -24,254 +22,6 @@
 
 /******************************************************************************
  *
- * History:
- *
- *	$Log: skrlmt.c,v $
- *	Revision 1.69  2003/04/15 09:39:22  tschilli
- *	Copyright messages changed.
- *	"#error C++ is not yet supported." removed.
- *	
- *	Revision 1.68  2003/01/31 15:26:56  rschmidt
- *	Added init for local variables in RlmtInit().
- *	
- *	Revision 1.67  2003/01/31 14:12:41  mkunz
- *	single port adapter runs now with two identical MAC addresses
- *	
- *	Revision 1.66  2002/09/23 15:14:19  rwahl
- *	- Reset broadcast timestamp on link down.
- *	- Editorial corrections.
- *	
- *	Revision 1.65  2002/07/22 14:29:48  rwahl
- *	- Removed BRK statement from debug check.
- *	
- *	Revision 1.64  2001/11/28 19:36:14  rwahl
- *	- RLMT Packets sent to an invalid MAC address in CLP/CLPSS mode
- *	  (#10650).
- *	- Reworked fix for port switching in CLS mode (#10639)
- *	 (no dependency to RLMT module).
- *	- Enabled dbg output for entry/exit of event functions.
- *	- Editorial changes.
- *	
- *	Revision 1.63  2001/10/26 07:53:18  afischer
- *	Port switching bug in `check local link` mode
- *	
- *	Revision 1.62  2001/07/03 12:16:30  mkunz
- *	New Flag ChgBcPrio (Change priority of last broadcast received)
- *	
- *	Revision 1.61  2001/03/14 12:52:08  rassmann
- *	Fixed reporting of active port up/down to PNMI.
- *	
- *	Revision 1.60  2001/02/21 16:02:25  gklug
- *	fix: when RLMT starts set Active Port for PNMI
- *	
- *	Revision 1.59  2001/02/16 14:38:19  rassmann
- *	Initializing some pointers earlier in the init phase.
- *	Rx Mbufs are freed if the net which they belong to is stopped.
- *	
- *	Revision 1.58  2001/02/14 14:06:31  rassmann
- *	Editorial changes.
- *	
- *	Revision 1.57  2001/02/05 14:25:26  rassmann
- *	Prepared RLMT for transparent operation.
- *	
- *	Revision 1.56  2001/01/30 10:29:09  rassmann
- *	Not checking switching befor RlmtStart.
- *	Editorial changes.
- *	
- *	Revision 1.55  2001/01/22 13:41:38  rassmann
- *	Supporting two nets on dual-port adapters.
- *	
- *	Revision 1.54  2000/11/30 13:25:07  rassmann
- *	Setting SK_TICK_INCR to 1 by default.
- *	
- *	Revision 1.53  2000/11/30 10:48:07  cgoos
- *	Changed definition of SK_RLMT_BC_DELTA.
- *	
- *	Revision 1.52  2000/11/27 12:50:03  rassmann
- *	Checking ports after receiving broadcasts.
- *	
- *	Revision 1.51  2000/11/17 08:58:00  rassmann
- *	Moved CheckSwitch from SK_RLMT_PACKET_RECEIVED to SK_RLMT_TIM event.
- *	
- *	Revision 1.50  2000/11/09 12:24:34  rassmann
- *	Indicating that segmentation check is not running anymore after
- *	  SkRlmtCheckSeg().
- *	Restarting segmentation timer after segmentation log.
- *	Editorial changes.
- *	
- *	Revision 1.49  1999/11/22 13:38:02  cgoos
- *	Changed license header to GPL.
- *	Added initialization to some variables to avoid compiler warnings.
- *	
- *	Revision 1.48  1999/10/04 14:01:17  rassmann
- *	Corrected reaction to reception of BPDU frames (#10441).
- *	
- *	Revision 1.47  1999/07/20 12:53:36  rassmann
- *	Fixed documentation errors for lookahead macros.
- *	
- *	Revision 1.46  1999/05/28 13:29:16  rassmann
- *	Replaced C++-style comment.
- *	
- *	Revision 1.45  1999/05/28 13:28:08  rassmann
- *	Corrected syntax error (xxx).
- *	
- *	Revision 1.44  1999/05/28 11:15:54  rassmann
- *	Changed behaviour to reflect Design Spec v1.2.
- *	Controlling Link LED(s).
- *	Introduced RLMT Packet Version field in RLMT Packet.
- *	Newstyle lookahead macros (checking meta-information before looking at
- *	  the packet).
- *	
- *	Revision 1.43  1999/01/28 13:12:43  rassmann
- *	Corrected Lookahead (bug introduced in previous Rev.).
- *	
- *	Revision 1.42  1999/01/28 12:50:41  rassmann
- *	Not using broadcast time stamps in CheckLinkState mode.
- *	
- *	Revision 1.41  1999/01/27 14:13:02  rassmann
- *	Monitoring broadcast traffic.
- *	Switching more reliably and not too early if switch is
- *	 configured for spanning tree.
- *	
- *	Revision 1.40  1999/01/22 13:17:30  rassmann
- *	Informing PNMI of NET_UP.
- *	Clearing RLMT multicast addresses before setting them for the first time.
- *	Reporting segmentation earlier, setting a "quiet time"
- *	 after a report.
- *	
- *	Revision 1.39  1998/12/10 15:29:53  rassmann
- *	Corrected SuspectStatus in SkRlmtBuildCheckChain().
- *	Corrected CHECK_SEG mode.
- *	
- *	Revision 1.38  1998/12/08 13:11:23  rassmann
- *	Stopping SegTimer at RlmtStop.
- *	
- *	Revision 1.37  1998/12/07 16:51:42  rassmann
- *	Corrected comments.
- *	
- *	Revision 1.36  1998/12/04 10:58:56  rassmann
- *	Setting next pointer to NULL when receiving.
- *	
- *	Revision 1.35  1998/12/03 16:12:42  rassmann
- *	Ignoring/correcting illegal PrefPort values.
- *	
- *	Revision 1.34  1998/12/01 11:45:35  rassmann
- *	Code cleanup.
- *	
- *	Revision 1.33  1998/12/01 10:29:32  rassmann
- *	Starting standby ports before getting the net up.
- *	Checking if a port is started when the link comes up.
- *	
- *	Revision 1.32  1998/11/30 16:19:50  rassmann
- *	New default for PortNoRx.
- *	
- *	Revision 1.31  1998/11/27 19:17:13  rassmann
- *	Corrected handling of LINK_DOWN coming shortly after LINK_UP.
- *	
- *	Revision 1.30  1998/11/24 12:37:31  rassmann
- *	Implemented segmentation check.
- *	
- *	Revision 1.29  1998/11/18 13:04:32  rassmann
- *	Secured PortUpTimer event.
- *	Waiting longer before starting standby port(s).
- *	
- *	Revision 1.28  1998/11/17 13:43:04  rassmann
- *	Handling (logical) tx failure.
- *	Sending packet on logical address after PORT_SWITCH.
- *	
- *	Revision 1.27  1998/11/13 17:09:50  rassmann
- *	Secured some events against being called in wrong state.
- *	
- *	Revision 1.26  1998/11/13 16:56:54  rassmann
- *	Added macro version of SkRlmtLookaheadPacket.
- *	
- *	Revision 1.25  1998/11/06 18:06:04  rassmann
- *	Corrected timing when RLMT checks fail.
- *	Clearing tx counter earlier in periodical checks.
- *	
- *	Revision 1.24  1998/11/05 10:37:27  rassmann
- *	Checking destination address in Lookahead.
- *	
- *	Revision 1.23  1998/11/03 13:53:49  rassmann
- *	RLMT should switch now (at least in mode 3).
- *	
- *	Revision 1.22  1998/10/29 14:34:49  rassmann
- *	Clearing SK_RLMT struct at startup.
- *	Initializing PortsUp during SK_RLMT_START.
- *	
- *	Revision 1.21  1998/10/28 11:30:17  rassmann
- *	Default mode is now SK_RLMT_CHECK_LOC_LINK.
- *	
- *	Revision 1.20  1998/10/26 16:02:03  rassmann
- *	Ignoring LINK_DOWN for links that are down.
- *	
- *	Revision 1.19  1998/10/22 15:54:01  rassmann
- *	Corrected EtherLen.
- *	Starting Link Check when second port comes up.
- *	
- *	Revision 1.18  1998/10/22 11:39:50  rassmann
- *	Corrected signed/unsigned mismatches.
- *	Corrected receive list handling and address recognition.
- *	
- *	Revision 1.17  1998/10/19 17:01:20  rassmann
- *	More detailed checking of received packets.
- *	
- *	Revision 1.16  1998/10/15 15:16:34  rassmann
- *	Finished Spanning Tree checking.
- *	Checked with lint.
- *	
- *	Revision 1.15  1998/09/24 19:16:07  rassmann
- *	Code cleanup.
- *	Introduced Timer for PORT_DOWN due to no RX.
- *	
- *	Revision 1.14  1998/09/18 20:27:14  rassmann
- *	Added address override.
- *	
- *	Revision 1.13  1998/09/16 11:31:48  rassmann
- *	Including skdrv1st.h again. :(
- *	
- *	Revision 1.12  1998/09/16 11:09:50  rassmann
- *	Syntax corrections.
- *	
- *	Revision 1.11  1998/09/15 12:32:03  rassmann
- *	Syntax correction.
- *	
- *	Revision 1.10  1998/09/15 11:28:49  rassmann
- *	Syntax corrections.
- *	
- *	Revision 1.9  1998/09/14 17:07:37  rassmann
- *	Added code for port checking via LAN.
- *	Changed Mbuf definition.
- *	
- *	Revision 1.8  1998/09/07 11:14:14  rassmann
- *	Syntax corrections.
- *	
- *	Revision 1.7  1998/09/07 09:06:07  rassmann
- *	Syntax corrections.
- *	
- *	Revision 1.6  1998/09/04 19:41:33  rassmann
- *	Syntax corrections.
- *	Started entering code for checking local links.
- *	
- *	Revision 1.5  1998/09/04 12:14:27  rassmann
- *	Interface cleanup.
- *	
- *	Revision 1.4  1998/09/02 16:55:28  rassmann
- *	Updated to reflect new DRV/HWAC/RLMT interface.
- *	
- *	Revision 1.3  1998/08/27 14:29:03  rassmann
- *	Code cleanup.
- *	
- *	Revision 1.2  1998/08/27 14:26:24  rassmann
- *	Updated interface.
- *	
- *	Revision 1.1  1998/08/21 08:26:49  rassmann
- *	First public version.
- *
- ******************************************************************************/
-
-/******************************************************************************
- *
  * Description:
  *
  * This module contains code for Link ManagemenT (LMT) of SK-NET Adapters.
--- diff/drivers/net/sk98lin/sktimer.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/net/sk98lin/sktimer.c	2004-02-09 10:39:54.000000000 +0000
@@ -2,8 +2,6 @@
  *
  * Name:	sktimer.c
  * Project:	Gigabit Ethernet Adapters, Event Scheduler Module
- * Version:	$Revision: 1.14 $
- * Date:	$Date: 2003/09/16 13:46:51 $
  * Purpose:	High level timer functions.
  *
  ******************************************************************************/
@@ -22,60 +20,6 @@
  *
  ******************************************************************************/
 
-/******************************************************************************
- *
- * 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.
- *	
- *	Revision 1.12  1999/11/22 13:38:51  cgoos
- *	Changed license header to GPL.
- *	
- *	Revision 1.11  1998/12/17 13:24:13  gklug
- *	fix: restart problem: do NOT destroy timer queue if init 1 is done
- *	
- *	Revision 1.10  1998/10/15 15:11:36  gklug
- *	fix: ID_sccs to SysKonnectFileId
- *	
- *	Revision 1.9  1998/09/15 15:15:04  cgoos
- *	Changed TRUE/FALSE to SK_TRUE/SK_FALSE
- *	
- *	Revision 1.8  1998/09/08 08:47:55  gklug
- *	add: init level handling
- *	
- *	Revision 1.7  1998/08/19 09:50:53  gklug
- *	fix: remove struct keyword from c-code (see CCC) add typedefs
- *	
- *	Revision 1.6  1998/08/17 13:43:13  gklug
- *	chg: Parameter will be union of 64bit para, 2 times SK_U32 or SK_PTR
- *	
- *	Revision 1.5  1998/08/14 07:09:14  gklug
- *	fix: chg pAc -> pAC
- *	
- *	Revision 1.4  1998/08/07 12:53:46  gklug
- *	fix: first compiled version
- *	
- *	Revision 1.3  1998/08/07 09:31:53  gklug
- *	fix: delta spelling
- *	
- *	Revision 1.2  1998/08/07 09:31:02  gklug
- *	adapt functions to new c coding conventions
- *	rmv: "fast" handling
- *	chg: inserting of new timer in queue.
- *	chg: event queue generation when timer runs out
- *	
- *	Revision 1.1  1998/08/05 11:27:55  gklug
- *	first version: adapted from SMT
- *
- ******************************************************************************/
-
-
 /*
  *	Event queue and dispatcher
  */
--- diff/drivers/net/sk98lin/skvpd.c	2003-08-20 14:16:30.000000000 +0100
+++ source/drivers/net/sk98lin/skvpd.c	2004-02-09 10:39:54.000000000 +0000
@@ -2,8 +2,6 @@
  *
  * Name:	skvpd.c
  * Project:	GEnesis, PCI Gigabit Ethernet Adapter
- * Version:	$Revision: 1.37 $
- * Date:	$Date: 2003/01/13 10:42:45 $
  * Purpose:	Shared software to read and write VPD data
  *
  ******************************************************************************/
@@ -21,145 +19,6 @@
  *
  ******************************************************************************/
 
-/******************************************************************************
- *
- * History:
- *
- *	$Log: skvpd.c,v $
- *	Revision 1.37  2003/01/13 10:42:45  rschmidt
- *	Replaced check for PCI device Id from YUKON with GENESIS
- *	to set the VPD size in VpdInit()
- *	Editorial changes
- *	
- *	Revision 1.36  2002/11/14 15:16:56  gheinig
- *	Added const specifier to key and buf parameters for VpdPara, VpdRead
- *	and VpdWrite for Diag 7 GUI
- *	
- *	Revision 1.35  2002/10/21 14:31:59  gheinig
- *	Took out CVS web garbage at head of file
- *	
- *	Revision 1.34  2002/10/21 11:47:24  gheinig
- *	Reverted to version 1.32 due to unwanted commit
- *	
- *	Revision 1.32  2002/10/14 16:04:29  rschmidt
- *	Added saving of VPD ROM Size from PCI_OUR_REG_2
- *	Avoid reading of PCI_OUR_REG_2 in VpdTransferBlock()
- *	Editorial changes
- *	
- *	Revision 1.31  2002/09/10 09:21:32  mkarl
- *	Replaced all if(GIChipId == CHIP_ID_GENESIS) with new entry GIGenesis
- *	
- *	Revision 1.30  2002/09/09 14:43:03  mkarl
- *	changes for diagnostics in order to read VPD data before the adapter
- *	has been initialized
- *	editorial changes
- *	
- *	Revision 1.29  2002/07/26 13:20:43  mkarl
- *	added Yukon support
- *	save size of VPD in pAC->vpd.vpd_size
- *	
- *	Revision 1.28  2002/04/02 15:31:47  afischer
- *	Bug fix in VpdWait()
- *	
- *	Revision 1.27  2000/08/10 11:29:06  rassmann
- *	Editorial changes.
- *	Preserving 32-bit alignment in structs for the adapter context.
- *	Removed unused function VpdWriteDword() (#if 0).
- *	Made VpdReadKeyword() available for SKDIAG only.
- *	
- *	Revision 1.26  2000/06/13 08:00:01  mkarl
- *	additional cast to avoid compile problems in 64 bit environment
- *	
- *	Revision 1.25  1999/11/22 13:39:32  cgoos
- *	Changed license header to GPL.
- *	
- *	Revision 1.24  1999/03/11 14:25:49  malthoff
- *	Replace __STDC__ with SK_KR_PROTO.
- *	
- *	Revision 1.23  1999/01/11 15:13:11  gklug
- *	fix: syntax error
- *	
- *	Revision 1.22  1998/10/30 06:41:15  gklug
- *	rmv: WARNING
- *	
- *	Revision 1.21  1998/10/29 07:15:14  gklug
- *	fix: Write Stream function needs verify.
- *	
- *	Revision 1.20  1998/10/28 18:05:08  gklug
- *	chg: no DEBUG in VpdMayWrite
- *	
- *	Revision 1.19  1998/10/28 15:56:11  gklug
- *	fix: Return len at end of ReadStream
- *	fix: Write even less than 4 bytes correctly
- *	
- *	Revision 1.18  1998/10/28 09:00:47  gklug
- *	fix: unreferenced local vars
- *	
- *	Revision 1.17  1998/10/28 08:25:45  gklug
- *	fix: WARNING
- *	
- *	Revision 1.16  1998/10/28 08:17:30  gklug
- *	fix: typo
- *	
- *	Revision 1.15  1998/10/28 07:50:32  gklug
- *	fix: typo
- *	
- *	Revision 1.14  1998/10/28 07:20:38  gklug
- *	chg: Interface functions to use IoC as parameter as well
- *	fix: VpdRead/WriteDWord now returns SK_U32
- *	chg: VPD_IN/OUT names conform to SK_IN/OUT
- *	add: usage of VPD_IN/OUT8 macros
- *	add: VpdRead/Write Stream functions to r/w a stream of data
- *	fix: VpdTransferBlock swapped illegal
- *	add: VpdMayWrite
- *	
- *	Revision 1.13  1998/10/22 10:02:37  gklug
- *	fix: SysKonnectFileId typo
- *	
- *	Revision 1.12  1998/10/20 10:01:01  gklug
- *	fix: parameter to SkOsGetTime
- *	
- *	Revision 1.11  1998/10/15 12:51:48  malthoff
- *	Remove unrequired parameter p in vpd_setup_para().
- *	
- *	Revision 1.10  1998/10/08 14:52:43  malthoff
- *	Remove CvsId by SysKonnectFileId.
- *	
- *	Revision 1.9  1998/09/16 07:33:52  malthoff
- *	replace memcmp() by SK_MEMCMP and
- *	memcpy() by SK_MEMCPY() to be
- *	independent from the 'C' Standard Library.
- *	
- *	Revision 1.8  1998/08/19 12:52:35  malthoff
- *	compiler fix: use SK_VPD_KEY instead of S_VPD.
- *	
- *	Revision 1.7  1998/08/19 08:14:01  gklug
- *	fix: remove struct keyword as much as possible from the C-code (see CCC)
- *	
- *	Revision 1.6  1998/08/18 13:03:58  gklug
- *	SkOsGetTime now returns SK_U64
- *	
- *	Revision 1.5  1998/08/18 08:17:29  malthoff
- *	Ensure we issue a VPD read in vpd_read_dword().
- *	Discard all VPD keywords other than Vx or Yx, where
- *	x is '0..9' or 'A..Z'.
- *	
- *	Revision 1.4  1998/07/03 14:52:19  malthoff
- *	Add category SK_DBGCAT_FATAL to some debug macros.
- *	bug fix: correct the keyword name check in vpd_write().
- *	
- *	Revision 1.3  1998/06/26 11:16:53  malthoff
- *	Correct the modified File Identifier.
- *	
- *	Revision 1.2  1998/06/26 11:13:43  malthoff
- *	Modify the File Identifier.
- *	
- *	Revision 1.1  1998/06/19 14:11:08  malthoff
- *	Created, Tests with AIX were performed successfully
- *	
- *
- ******************************************************************************/
-
 /*
 	Please refer skvpd.txt for infomation how to include this module
  */
--- diff/drivers/net/sk98lin/skxmac2.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/net/sk98lin/skxmac2.c	2004-02-09 10:39:54.000000000 +0000
@@ -2,8 +2,6 @@
  *
  * Name:	skxmac2.c
  * Project:	Gigabit Ethernet Adapters, Common Modules
- * Version:	$Revision: 1.102 $
- * Date:	$Date: 2003/10/02 16:53:58 $
  * Purpose:	Contains functions to initialize the MACs and PHYs
  *
  ******************************************************************************/
@@ -22,461 +20,6 @@
  *
  ******************************************************************************/
 
-/******************************************************************************
- *
- * 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.
- *	Editorial changes.
- *	
- *	Revision 1.98  2003/07/04 12:53:56  rschmidt
- *	Changed setting of downshift feature in SkGmInitPhyMarv().
- *	Enabled downshift feature only for para 'Speed' set to 'Auto'.
- *	Changed init values for Master & Slave downshift counters.
- *	Editorial changes.
- *	
- *	Revision 1.97  2003/05/28 15:53:47  rschmidt
- *	Removed setting of Yukon PHY's 'force link good' in loopback mode.
- *	Replaced call pFnMacOverflow() with SkXmOverflowStatus() resp.
- *	SkGmOverflowStatus().
- *	Editorial changes.
- *	
- *	Revision 1.96  2003/05/13 17:37:11  mkarl
- *	Removed calls to PNMI for SLIM driver.
- *	Added SK_FAR for PXE.
- *	Separated code pathes not used for SLIM driver.
- *	Some further separations for YUKON and GENESIS.
- *	Editorial changes.
- *	
- *	Revision 1.95  2003/05/06 13:09:53  rschmidt
- *	Changed init sequence for auto-negotiation disabled in SkGmInitMac().
- *	Added defines around GENESIS resp. YUKON branches to reduce
- *	code size for PXE.
- *	Editorial changes.
- *	
- *	Revision 1.94  2003/04/10 14:36:40  rschmidt
- *	Fixed define for debug code in SkGmInitPhyMarv().
- *	
- *	Revision 1.93  2003/04/08 16:58:16  rschmidt
- *	Changed initialisation of GMAC and GPHY for disabling
- *	Flow-Control with parameter 'none' (Bug Id #10769).
- *	Changed init for blinking active LED and normal duplex LED
- *	depending on value from GILedBlinkCtrl (LED Blink Control).
- *	Added control for Link100 LED.
- *	Changed handling for different PhyTypes for source code
- *	portability to PXE, UNDI.
- *	Editorial changes.
- *	
- *	Revision 1.92  2003/03/31 07:12:33  mkarl
- *	Restore PHY_MARV_AUNE_ADV after writing to GM_GP_CTRL in order to make
- *	auto-negotiation of limited flow-control possible.
- *	Corrected Copyright.
- *	Editorial changes.
- *	
- *	Revision 1.91  2003/02/05 15:09:34  rschmidt
- *	Removed setting of 'Collision Test'-bit in SkGmInitPhyMarv().
- *	Disabled auto-update for speed, duplex and flow-control when
- *	auto-negotiation is not enabled (Bug Id #10766).
- *	Editorial changes.
- *	
- *	Revision 1.90  2003/01/29 13:35:19  rschmidt
- *	Increment Rx FIFO Overflow counter only in DEBUG-mode.
- *	Corrected define for blinking active LED.
- *	
- *	Revision 1.89  2003/01/28 16:37:45  rschmidt
- *	Changed init for blinking active LED
- *	
- *	Revision 1.88  2003/01/28 10:09:38  rschmidt
- *	Added debug outputs in SkGmInitMac().
- *	Added customized init of LED registers in SkGmInitPhyMarv(),
- *	for blinking active LED (#ifdef ACT_LED_BLINK) and
- *	for normal duplex LED (#ifdef DUP_LED_NORMAL).
- *	Editorial changes.
- *	
- *	Revision 1.87  2002/12/10 14:39:05  rschmidt
- *	Improved initialization of GPHY in SkGmInitPhyMarv().
- *	Editorial changes.
- *	
- *	Revision 1.86  2002/12/09 15:01:12  rschmidt
- *	Added setup of Ext. PHY Specific Ctrl Reg (downshift feature).
- *	
- *	Revision 1.85  2002/12/05 14:09:16  rschmidt
- *	Improved avoiding endless loop in SkGmPhyRead(), SkGmPhyWrite().
- *	Added additional advertising for 10Base-T when 100Base-T is selected.
- *	Added case SK_PHY_MARV_FIBER for YUKON Fiber adapter.
- *	Editorial changes.
- *	
- *	Revision 1.84  2002/11/15 12:50:09  rschmidt
- *	Changed SkGmCableDiagStatus() when getting results.
- *	
- *	Revision 1.83  2002/11/13 10:28:29  rschmidt
- *	Added some typecasts to avoid compiler warnings.
- *	
- *	Revision 1.82  2002/11/13 09:20:46  rschmidt
- *	Replaced for(..) with do {} while (...) in SkXmUpdateStats().
- *	Replaced 2 macros GM_IN16() with 1 GM_IN32() in SkGmMacStatistic().
- *	Added SkGmCableDiagStatus() for Virtual Cable Test (VCT).
- *	Editorial changes.
- *	
- *	Revision 1.81  2002/10/28 14:28:08  rschmidt
- *	Changed MAC address setup for GMAC in SkGmInitMac().
- *	Optimized handling of counter overflow IRQ in SkGmOverflowStatus().
- *	Editorial changes.
- *	
- *	Revision 1.80  2002/10/14 15:29:44  rschmidt
- *	Corrected disabling of all PHY IRQs.
- *	Added WA for deviation #16 (address used for pause packets).
- *	Set Pause Mode in SkMacRxTxEnable() only for Genesis.
- *	Added IRQ and counter for Receive FIFO Overflow in DEBUG-mode.
- *	SkXmTimeStamp() replaced by SkMacTimeStamp().
- *	Added clearing of GMAC Tx FIFO Underrun IRQ in SkGmIrq().
- *	Editorial changes.
- *	
- *	Revision 1.79  2002/10/10 15:55:36  mkarl
- *	changes for PLinkSpeedUsed
- *	
- *	Revision 1.78  2002/09/12 09:39:51  rwahl
- *	Removed deactivate code for SIRQ overflow event separate for TX/RX.
- *	
- *	Revision 1.77  2002/09/09 12:26:37  mkarl
- *	added handling for Yukon to SkXmTimeStamp
- *	
- *	Revision 1.76  2002/08/21 16:41:16  rschmidt
- *	Added bit GPC_ENA_XC (Enable MDI crossover) in HWCFG_MODE.
- *	Added forced speed settings in SkGmInitPhyMarv().
- *	Added settings of full/half duplex capabilities for YUKON Fiber.
- *	Editorial changes.
- *	
- *	Revision 1.75  2002/08/16 15:12:01  rschmidt
- *	Replaced all if(GIChipId == CHIP_ID_GENESIS) with new entry GIGenesis.
- *	Added function SkMacHashing() for ADDR-Module.
- *	Removed functions SkXmClrSrcCheck(), SkXmClrHashAddr() (calls replaced
- *	with macros).
- *	Removed functions SkGmGetMuxConfig().
- *	Added HWCFG_MODE init for YUKON Fiber.
- *	Changed initialization of GPHY in SkGmInitPhyMarv().
- *	Changed check of parameter in SkXmMacStatistic().
- *	Editorial changes.
- *	
- *	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-Module.
- *	Editorial changes.
- *	
- *	Revision 1.73  2002/08/08 16:26:24  rschmidt
- *	Improved reset sequence for YUKON in SkGmHardRst() and SkGmInitMac().
- *	Replaced XMAC Rx High Watermark init value with SK_XM_RX_HI_WM.
- *	Editorial changes.
- *	
- *	Revision 1.72  2002/07/24 15:11:19  rschmidt
- *	Fixed wrong placement of parenthesis.
- *	Editorial changes.
- *	
- *	Revision 1.71  2002/07/23 16:05:18  rschmidt
- *	Added global functions for PHY: SkGePhyRead(), SkGePhyWrite().
- *	Fixed Tx Counter Overflow IRQ (Bug ID #10730).
- *	Editorial changes.
- *	
- *	Revision 1.70  2002/07/18 14:27:27  rwahl
- *	Fixed syntax error.
- *	
- *	Revision 1.69  2002/07/17 17:08:47  rwahl
- *	Fixed check in SkXmMacStatistic().
- *	
- *	Revision 1.68  2002/07/16 07:35:24  rwahl
- *	Removed check for cleared mib counter in SkGmResetCounter().
- *	
- *	Revision 1.67  2002/07/15 18:35:56  rwahl
- *	Added SkXmUpdateStats(), SkGmUpdateStats(), SkXmMacStatistic(),
- *	  SkGmMacStatistic(), SkXmResetCounter(), SkGmResetCounter(),
- *	  SkXmOverflowStatus(), SkGmOverflowStatus().
- *	Changes to SkXmIrq() & SkGmIrq(): Combined SIRQ Overflow for both
- *	  RX & TX.
- *	Changes to SkGmInitMac(): call to SkGmResetCounter().
- *	Editorial changes.
- *	
- *	Revision 1.66  2002/07/15 15:59:30  rschmidt
- *	Added PHY Address in SkXmPhyRead(), SkXmPhyWrite().
- *	Added MIB Clear Counter in SkGmInitMac().
- *	Added Duplex and Flow-Control settings.
- *	Reset all Multicast filtering Hash reg. in SkGmInitMac().
- *	Added new function: SkGmGetMuxConfig().
- *	Editorial changes.
- *	
- *	Revision 1.65  2002/06/10 09:35:39  rschmidt
- *	Replaced C++ comments (//).
- *	Added #define VCPU around VCPUwaitTime.
- *	Editorial changes.
- *	
- *	Revision 1.64  2002/06/05 08:41:10  rschmidt
- *	Added function for XMAC2: SkXmTimeStamp().
- *	Added function for YUKON: SkGmSetRxCmd().
- *	Changed SkGmInitMac() resp. SkGmHardRst().
- *	Fixed wrong variable in SkXmAutoNegLipaXmac() (debug mode).
- *	SkXmRxTxEnable() replaced by SkMacRxTxEnable().
- *	Editorial changes.
- *	
- *	Revision 1.63  2002/04/25 13:04:44  rschmidt
- *	Changes for handling YUKON.
- *	Use of #ifdef OTHER_PHY to eliminate code for unused Phy types.
- *	Macros for XMAC PHY access PHY_READ(), PHY_WRITE() replaced
- *	by functions SkXmPhyRead(), SkXmPhyWrite();
- *	Removed use of PRxCmd to setup XMAC.
- *	Added define PHY_B_AS_PAUSE_MSK for BCom Pause Res.
- *	Added setting of XM_RX_DIS_CEXT in SkXmInitMac().
- *	Removed status parameter from MAC IRQ handler SkMacIrq(),
- *	SkXmIrq() and SkGmIrq().
- *	SkXmAutoNegLipa...() for ext. Phy replaced by SkMacAutoNegLipaPhy().
- *	Added SkMac...() functions to handle both XMAC and GMAC.
- *	Added functions for YUKON: SkGmHardRst(), SkGmSoftRst(),
- *	SkGmSetRxTxEn(), SkGmIrq(), SkGmInitMac(), SkGmInitPhyMarv(),
- *	SkGmAutoNegDoneMarv(), SkGmPhyRead(), SkGmPhyWrite().
- *	Changes for V-CPU support.
- *	Editorial changes.
- *	
- *	Revision 1.62  2001/08/06 09:50:14  rschmidt
- *	Workaround BCOM Errata #1 for the C5 type.
- *	Editorial changes.
- *	
- *	Revision 1.61  2001/02/09 15:40:59  rassmann
- *	Editorial changes.
- *	
- *	Revision 1.60  2001/02/07 15:02:01  cgoos
- *	Added workaround for Fujitsu switch link down.
- *	
- *	Revision 1.59  2001/01/10 09:38:06  cgoos
- *	Fixed Broadcom C0/A1 Id check for workaround.
- *	
- *	Revision 1.58  2000/11/29 11:30:38  cgoos
- *	Changed DEBUG sections with NW output to xDEBUG
- *	
- *	Revision 1.57  2000/11/27 12:40:40  rassmann
- *	Suppressing preamble after first access to BCom, not before (#10556).
- *	
- *	Revision 1.56  2000/11/09 12:32:48  rassmann
- *	Renamed variables.
- *	
- *	Revision 1.55  2000/11/09 11:30:10  rassmann
- *	WA: Waiting after releasing reset until BCom chip is accessible.
- *	
- *	Revision 1.54  2000/10/02 14:10:27  rassmann
- *	Reading BCOM PHY after releasing reset until it returns a valid value.
- *	
- *	Revision 1.53  2000/07/27 12:22:11  gklug
- *	fix: possible endless loop in XmHardRst.
- *	
- *	Revision 1.52  2000/05/22 08:48:31  malthoff
- *	Fix: #10523 errata valid for all BCOM PHYs.
- *	
- *	Revision 1.51  2000/05/17 12:52:18  malthoff
- *	Fixes BCom link errata (#10523).
- *	
- *	Revision 1.50  1999/11/22 13:40:14  cgoos
- *	Changed license header to GPL.
- *	
- *	Revision 1.49  1999/11/22 08:12:13  malthoff
- *	Add workaround for power consumption feature of BCom C0 chip.
- *	
- *	Revision 1.48  1999/11/16 08:39:01  malthoff
- *	Fix: MDIO preamble suppression is port dependent.
- *	
- *	Revision 1.47  1999/08/27 08:55:35  malthoff
- *	1000BT: Optimizing MDIO transfer by oppressing MDIO preamble.
- *	
- *	Revision 1.46  1999/08/13 11:01:12  malthoff
- *	Fix for 1000BT: pFlowCtrlMode was not set correctly.
- *	
- *	Revision 1.45  1999/08/12 19:18:28  malthoff
- *	1000BT Fixes: Do not owerwrite XM_MMU_CMD.
- *	Do not execute BCOM A1 workaround for B1 chips.
- *	Fix pause frame setting.
- *	Always set PHY_B_AC_TX_TST in PHY_BCOM_AUX_CTRL.
- *	
- *	Revision 1.44  1999/08/03 15:23:48  cgoos
- *	Fixed setting of PHY interrupt mask in half duplex mode.
- *	
- *	Revision 1.43  1999/08/03 15:22:17  cgoos
- *	Added some debug output.
- *	Disabled XMac GP0 interrupt for external PHYs.
- *	
- *	Revision 1.42  1999/08/02 08:39:23  malthoff
- *	BCOM PHY: TX LED: To get the mono flop behaviour it is required
- *	to set the LED Traffic Mode bit in PHY_BCOM_P_EXT_CTRL.
- *	
- *	Revision 1.41  1999/07/30 06:54:31  malthoff
- *	Add temp. workarounds for the BCOM Phy revision A1.
- *	
- *	Revision 1.40  1999/06/01 07:43:26  cgoos
- *	Changed Link Mode Status in SkXmAutoNegDone... from FULL/HALF to
- *	AUTOFULL/AUTOHALF.
- *	
- *	Revision 1.39  1999/05/19 07:29:51  cgoos
- *	Changes for 1000Base-T.
- *	
- *	Revision 1.38  1999/04/08 14:35:10  malthoff
- *	Add code for enabling signal detect. Enabling signal detect is disabled.
- *	
- *	Revision 1.37  1999/03/12 13:42:54  malthoff
- *	Add: Jumbo Frame Support.
- *	Add: Receive modes SK_LENERR_OK_ON/OFF and
- *	SK_BIG_PK_OK_ON/OFF in SkXmSetRxCmd().
- *	
- *	Revision 1.36  1999/03/08 10:10:55  gklug
- *	fix: AutoSensing did switch to next mode even if LiPa indicated offline
- *
- *	Revision 1.35  1999/02/22 15:16:41  malthoff
- *	Remove some compiler warnings.
- *
- *	Revision 1.34  1999/01/22 09:19:59  gklug
- *	fix: Init DupMode and InitPauseMd are now called in RxTxEnable
- *
- *	Revision 1.33  1998/12/11 15:19:11  gklug
- *	chg: lipa autoneg stati
- *	chg: debug messages
- *	chg: do NOT use spurious XmIrq
- *
- *	Revision 1.32  1998/12/10 11:08:44  malthoff
- *	bug fix: pAC has been used for IOs in SkXmHardRst().
- *	SkXmInitPhy() is also called for the Diag in SkXmInitMac().
- *
- *	Revision 1.31  1998/12/10 10:39:11  gklug
- *	fix: do 4 RESETS of the XMAC at the beginning
- *	fix: dummy read interrupt source register BEFORE initializing the Phy
- *	add: debug messages
- *	fix: Linkpartners autoneg capability cannot be shown by TX_PAGE interrupt
- *
- *	Revision 1.30  1998/12/07 12:18:32  gklug
- *	add: refinement of autosense mode: take into account the autoneg cap of LiPa
- *
- *	Revision 1.29  1998/12/07 07:12:29  gklug
- *	fix: if page is received the link is  down.
- *
- *	Revision 1.28  1998/12/01 10:12:47  gklug
- *	chg: if spurious IRQ from XMAC encountered, save it
- *
- *	Revision 1.27  1998/11/26 07:33:38  gklug
- *	add: InitPhy call is now in XmInit function
- *
- *	Revision 1.26  1998/11/18 13:38:24  malthoff
- *	'Imsk' is also unused in SkXmAutoNegDone.
- *
- *	Revision 1.25  1998/11/18 13:28:01  malthoff
- *	Remove unused variable 'Reg' in SkXmAutoNegDone().
- *
- *	Revision 1.24  1998/11/18 13:18:45  gklug
- *	add: workaround for xmac errata #1
- *	add: detect Link Down also when Link partner requested config
- *	chg: XMIrq is only used when link is up
- *
- *	Revision 1.23  1998/11/04 07:07:04  cgoos
- *	Added function SkXmRxTxEnable.
- *
- *	Revision 1.22  1998/10/30 07:35:54  gklug
- *	fix: serve LinkDown interrupt when link is already down
- *
- *	Revision 1.21  1998/10/29 15:32:03  gklug
- *	fix: Link Down signaling
- *
- *	Revision 1.20  1998/10/29 11:17:27  gklug
- *	fix: AutoNegDone bug
- *
- *	Revision 1.19  1998/10/29 10:14:43  malthoff
- *	Add endainesss comment for reading/writing MAC addresses.
- *
- *	Revision 1.18  1998/10/28 07:48:55  cgoos
- *	Fix: ASS somtimes signaled although link is up.
- *
- *	Revision 1.17  1998/10/26 07:55:39  malthoff
- *	Fix in SkXmInitPauseMd(): Pause Mode
- *	was disabled and not enabled.
- *	Fix in SkXmAutoNegDone(): Checking Mode bits
- *	always failed, becaues of some missing braces.
- *
- *	Revision 1.16  1998/10/22 09:46:52  gklug
- *	fix SysKonnectFileId typo
- *
- *	Revision 1.15  1998/10/21 05:51:37  gklug
- *	add: para DoLoop to InitPhy function for loopback set-up
- *
- *	Revision 1.14  1998/10/16 10:59:23  malthoff
- *	Remove Lint warning for dummy reads.
- *
- *	Revision 1.13  1998/10/15 14:01:20  malthoff
- *	Fix: SkXmAutoNegDone() is (int) but does not return a value.
- *
- *	Revision 1.12  1998/10/14 14:45:04  malthoff
- *	Remove SKERR_SIRQ_E0xx and SKERR_SIRQ_E0xxMSG by
- *	SKERR_HWI_Exx and SKERR_HWI_E0xxMSG to be independent
- *	from the Sirq module.
- *
- *	Revision 1.11  1998/10/14 13:59:01  gklug
- *	add: InitPhy function
- *
- *	Revision 1.10  1998/10/14 11:20:57  malthoff
- *	Make SkXmAutoNegDone() public, because it's
- *	used in diagnostics, too.
- *	The Link Up event to the RLMT is issued in SkXmIrq().
- *  SkXmIrq() is not available in diagnostics.
- *  Use PHY_READ when reading PHY registers.
- *
- *	Revision 1.9  1998/10/14 05:50:10  cgoos
- *	Added definition for Para.
- *
- *	Revision 1.8  1998/10/14 05:41:28  gklug
- *	add: Xmac IRQ
- *	add: auto-negotiation done function
- *
- *	Revision 1.7  1998/10/09 06:55:20  malthoff
- *	The configuration of the XMACs Tx Request Threshold
- *	depends from the drivers port usage now. The port
- *	usage is configured in GIPortUsage.
- *
- *	Revision 1.6  1998/10/05 07:48:00  malthoff
- *	minor changes
- *
- *	Revision 1.5  1998/10/01 07:03:54  gklug
- *	add: dummy function for XMAC ISR
- *
- *	Revision 1.4  1998/09/30 12:37:44  malthoff
- *	Add SkXmSetRxCmd() and related code.
- *
- *	Revision 1.3  1998/09/28 13:26:40  malthoff
- *	Add SkXmInitMac(), SkXmInitDupMd(), and SkXmInitPauseMd()
- *
- *	Revision 1.2  1998/09/16 14:34:21  malthoff
- *	Add SkXmClrExactAddr(), SkXmClrSrcCheck(),
- *	SkXmClrHashAddr(), SkXmFlushTxFifo(),
- *	SkXmFlushRxFifo(), and SkXmHardRst().
- *	Finish Coding of SkXmSoftRst().
- *	The sources may be compiled now.
- *
- *	Revision 1.1  1998/09/04 10:05:56  malthoff
- *	Created.
- *
- *
- ******************************************************************************/
-
 #include "h/skdrv1st.h"
 #include "h/skdrv2nd.h"
 
--- diff/drivers/net/sk_g16.c	2003-08-26 10:00:53.000000000 +0100
+++ source/drivers/net/sk_g16.c	2004-02-09 10:39:54.000000000 +0000
@@ -457,8 +457,6 @@
 /* static variables */
 
 static SK_RAM *board;  /* pointer to our memory mapped board components */
-static struct net_device *SK_dev;
-unsigned long SK_ioaddr;
 static spinlock_t SK_lock = SPIN_LOCK_UNLOCKED;
 
 /* Macros */
@@ -472,7 +470,6 @@
  * See for short explanation of each function its definitions header.
  */
 
-int          SK_init(struct net_device *dev);
 static int   SK_probe(struct net_device *dev, short ioaddr);
 
 static void  SK_timeout(struct net_device *dev);
@@ -530,84 +527,71 @@
  *     YY/MM/DD  uid  Description
 -*/
 
+static int io;	/* 0 == probe */
+
 /* 
  * Check for a network adaptor of this type, and return '0' if one exists.
  * If dev->base_addr == 0, probe all likely locations.
  * If dev->base_addr == 1, always return failure.
  */
 
-int __init SK_init(struct net_device *dev)
+struct net_device * __init SK_init(int unit)
 {
-	int ioaddr;			   /* I/O port address used for POS regs */
 	int *port, ports[] = SK_IO_PORTS;  /* SK_G16 supported ports */
 	static unsigned version_printed;
+	struct net_device *dev = alloc_etherdev(sizeof(struct priv));
+	int err = -ENODEV;
+
+	if (!dev)
+		return ERR_PTR(-ENOMEM);
 
-	/* get preconfigured base_addr from dev which is done in Space.c */
-	int base_addr = dev->base_addr; 
+	if (unit >= 0) {
+		sprintf(dev->name, "eth%d", unit);
+		netdev_boot_setup_check(dev);
+		io = dev->base_addr;
+	}
 
 	if (version_printed++ == 0)
 	        PRINTK(("%s: %s", SK_NAME, rcsid));
 
-	if (base_addr > 0x0ff)        /* Check a single specified address */
-	{
-	    int rc = -ENODEV;
-
-	    ioaddr = base_addr;
-
-	    /* Check if on specified address is a SK_G16 */
-	    if (!request_region(ioaddr, ETHERCARD_TOTAL_SIZE, "sk_g16"))
-	    	return -EBUSY;
-
-	    if ( (inb(SK_POS0) == SK_IDLOW) ||
-		 (inb(SK_POS1) == SK_IDHIGH) )  
-	    {
-		rc = SK_probe(dev, ioaddr);
-	    }
+	if (io > 0xff) {        /* Check a single specified address */
+		err = -EBUSY;
+		/* Check if on specified address is a SK_G16 */
+		if (request_region(io, ETHERCARD_TOTAL_SIZE, "sk_g16")) {
+			err = SK_probe(dev, io);
+			if (!err)
+				goto got_it;
+			release_region(io, ETHERCARD_TOTAL_SIZE);
+		}
+	} else if (io > 0) {       /* Don't probe at all */
+		err = -ENXIO;
+	} else {
+		/* Autoprobe base_addr */
+		for (port = &ports[0]; *port; port++) {
+			io = *port;
+
+			/* Check if I/O Port region is used by another board */
+			if (!request_region(io, ETHERCARD_TOTAL_SIZE, "sk_g16"))
+				continue;       /* Try next Port address */
+
+			/* Check if at ioaddr is a SK_G16 */
+			if (SK_probe(dev, io) == 0)
+				goto got_it;
 
-	    if (rc)
-	        release_region(ioaddr, ETHERCARD_TOTAL_SIZE);
-	    return rc;
+			release_region(io, ETHERCARD_TOTAL_SIZE);
+		}
 	}
-	else if (base_addr > 0)       /* Don't probe at all */
-	{
-		return -ENXIO;
+err_out:
+	free_netdev(dev);
+	return ERR_PTR(err);
+
+got_it:
+	err = register_netdev(dev);
+	if (err) {
+		release_region(dev->base_addr, ETHERCARD_TOTAL_SIZE);
+		goto err_out;
 	}
-
-	/* Autoprobe base_addr */
-
-	for (port = &ports[0]; *port; port++) 
-	{
-	    ioaddr = *port;           /* we need ioaddr for accessing POS regs */
-
-	    /* Check if I/O Port region is used by another board */
-
-	    if (!request_region(ioaddr, ETHERCARD_TOTAL_SIZE, "sk_g16"))
-	    {
-		continue;             /* Try next Port address */
-	    }
-
-	    /* Check if at ioaddr is a SK_G16 */
-
-	    if ( !(inb(SK_POS0) == SK_IDLOW) ||
-		 !(inb(SK_POS1) == SK_IDHIGH) )
-	    {
-	        release_region(ioaddr, ETHERCARD_TOTAL_SIZE);
-		continue;             /* Try next Port address */
-	    }
-
-	    dev->base_addr = ioaddr;  /* Set I/O Port Address */
-
-	    if (SK_probe(dev, ioaddr) == 0)  
-	    {
-		return 0; /* Card found and initialized */
-	    }
-
-	    release_region(ioaddr, ETHERCARD_TOTAL_SIZE);
-	}
-
-	dev->base_addr = base_addr;   /* Write back original base_addr */
-
-	return -ENODEV;                /* Failed to find or init driver */
+	return dev;
 
 } /* End of SK_init */
 
@@ -620,54 +604,25 @@
 
 
 #ifdef MODULE
-static int io;	/* 0 == probe */
+
+static struct net_device *SK_dev;
 
 static int __init SK_init_module (void)
 {
-	int rc;
-	
-	SK_dev = init_etherdev (NULL, 0);
-	if (!SK_dev)
-		return -ENOMEM;
-	
-	SK_dev->base_addr = io;
-
-	rc = SK_init (SK_dev);
-	if (rc) {
-		unregister_netdev (SK_dev);
-		kfree (SK_dev);
-		SK_dev = NULL;
-	}
-	
-	return rc;
+ 	SK_dev = SK_init(-1);
+ 	return IS_ERR(SK_dev) ? PTR_ERR(SK_dev) : 0;
 }
-#endif /* MODULE */
-
 
 static void __exit SK_cleanup_module (void)
 {
-	if (SK_dev) {
-		if (SK_dev->priv) {
-			kfree(SK_dev->priv);
-			SK_dev->priv = NULL;
-		}
-		unregister_netdev(SK_dev);
-		free_netdev(SK_dev);
-		SK_dev = NULL;
-	}
-	if (SK_ioaddr) {
-		release_region(SK_ioaddr, ETHERCARD_TOTAL_SIZE);
-		SK_ioaddr = 0;
-	}
-		
+ 	unregister_netdev(SK_dev);
+ 	release_region(SK_dev->base_addr, ETHERCARD_TOTAL_SIZE);
+ 	free_netdev(SK_dev);
 }
 
-
-#ifdef MODULE
 module_init(SK_init_module);
-#endif
 module_exit(SK_cleanup_module);
-
+#endif
 
 
 /*-
@@ -695,7 +650,11 @@
     int sk_addr_flag = 0;   /* SK ADDR correct? 1 - no, 0 - yes */
     unsigned int rom_addr;  /* used to store RAM address used for POS_ADDR */
 
-    struct priv *p;         /* SK_G16 private structure */
+    struct priv *p = dev->priv;         /* SK_G16 private structure */
+
+    if (inb(SK_POS0) != SK_IDLOW || inb(SK_POS1) != SK_IDHIGH)
+	return -ENODEV;
+    dev->base_addr = ioaddr;
 
     if (SK_ADDR & 0x3fff || SK_ADDR < 0xa0000)
     {
@@ -837,12 +796,6 @@
 	    dev->dev_addr[4],
 	    dev->dev_addr[5]);
 
-    /* Allocate memory for private structure */
-    p = dev->priv = (void *) kmalloc(sizeof(struct priv), GFP_KERNEL);
-    if (p == NULL) {
-	   printk("%s: ERROR - no memory for driver data!\n", dev->name);
-	   return -ENOMEM;
-    }
     memset((char *) dev->priv, 0, sizeof(struct priv)); /* clear memory */
 
     /* Assign our Device Driver functions */
@@ -856,10 +809,6 @@
     dev->watchdog_timeo		= HZ/7;
 
 
-    /* Set the generic fields of the device structure */
-
-    ether_setup(dev);
-    
     dev->flags &= ~IFF_MULTICAST;
 
     /* Initialize private structure */
@@ -884,12 +833,7 @@
     SK_print_pos(dev, "End of SK_probe");
     SK_print_ram(dev);
 #endif 
-
-    SK_dev = dev;
-    SK_ioaddr = ioaddr;
-
     return 0;                            /* Initialization done */
-
 } /* End of SK_probe() */
 
 
@@ -1280,7 +1224,7 @@
 
 	memcpy_toio((tmdp->u.buffer & 0x00ffffff), skb->data, skb->len);
 	if (len != skb->len)
-		memcpy_toio((tmdp->u.buffer & 0x00ffffff) + sb->len, pad, len-skb->len);
+		memcpy_toio((tmdp->u.buffer & 0x00ffffff) + skb->len, pad, len-skb->len);
 
 	writew(-len, &tmdp->blen);            /* set length to transmit */
 
--- diff/drivers/net/sk_mca.c	2003-10-09 09:47:34.000000000 +0100
+++ source/drivers/net/sk_mca.c	2004-02-09 10:39:54.000000000 +0000
@@ -1022,18 +1022,39 @@
 
 static int startslot;		/* counts through slots when probing multiple devices */
 
-int __init skmca_probe(struct net_device *dev)
+static void cleanup_card(struct net_device *dev)
 {
+	skmca_priv *priv = dev->priv;
+	DeinitBoard(dev);
+	if (dev->irq != 0)
+		free_irq(dev->irq, dev);
+	mca_mark_as_unused(priv->slot);
+	mca_set_adapter_procfn(priv->slot, NULL, NULL);
+}
+
+struct net_device * __init skmca_probe(int unit)
+{
+	struct net_device *dev;
 	int force_detect = 0;
 	int junior, slot, i;
 	int base = 0, irq = 0;
 	skmca_priv *priv;
 	skmca_medium medium;
+	int err;
 
 	/* can't work without an MCA bus ;-) */
 
 	if (MCA_bus == 0)
-		return -ENODEV;
+		return ERR_PTR(-ENODEV);
+
+	dev = alloc_etherdev(sizeof(skmca_priv));
+	if (!dev)
+		return ERR_PTR(-ENOMEM);
+
+	if (unit >= 0) {
+		sprintf(dev->name, "eth%d", unit);
+		netdev_boot_setup_check(dev);
+	}
 
 	SET_MODULE_OWNER(dev);
 
@@ -1044,37 +1065,24 @@
 
 	/* search through slots */
 
-	if (dev != NULL) {
-		base = dev->mem_start;
-		irq = dev->irq;
-	}
-	slot = dofind(&junior, startslot);
-
-	while (slot != -1) {
+	base = dev->mem_start;
+	irq = dev->base_addr;
+	for (slot = startslot; (slot = dofind(&junior, slot)) != -1; slot++) {
 		/* deduce card addresses */
 
 		getaddrs(slot, junior, &base, &irq, &medium);
 
 		/* slot already in use ? */
 
-		if (mca_is_adapter_used(slot)) {
-			slot = dofind(&junior, slot + 1);
+		if (mca_is_adapter_used(slot))
 			continue;
-		}
 
 		/* were we looking for something different ? */
 
-		if ((dev->irq != 0) || (dev->mem_start != 0)) {
-			if ((dev->irq != 0) && (dev->irq != irq)) {
-				slot = dofind(&junior, slot + 1);
-				continue;
-			}
-			if ((dev->mem_start != 0)
-			    && (dev->mem_start != base)) {
-				slot = dofind(&junior, slot + 1);
-				continue;
-			}
-		}
+		if (dev->irq && dev->irq != irq)
+			continue;
+		if (dev->mem_start && dev->mem_start != base)
+			continue;
 
 		/* found something that matches */
 
@@ -1083,8 +1091,10 @@
 
 	/* nothing found ? */
 
-	if (slot == -1)
-		return ((base != 0) || (irq != 0)) ? ENXIO : ENODEV;
+	if (slot == -1) {
+		free_netdev(dev);
+		return (base || irq) ? ERR_PTR(-ENXIO) : ERR_PTR(-ENODEV);
+	}
 
 	/* make procfs entries */
 
@@ -1102,17 +1112,14 @@
 	       junior ? "Junior MC2" : "MC2+", slot + 1);
 
 	/* allocate structure */
-	priv = dev->priv =
-	    (skmca_priv *) kmalloc(sizeof(skmca_priv), GFP_KERNEL);
-	if (!priv)
-		return -ENOMEM;
+	priv = dev->priv;
 	priv->slot = slot;
 	priv->macbase = base + 0x3fc0;
 	priv->ioregaddr = base + 0x3ff0;
 	priv->ctrladdr = base + 0x3ff2;
 	priv->cmdaddr = base + 0x3ff3;
 	priv->medium = medium;
-	memset(&(priv->stat), 0, sizeof(struct net_device_stats));
+	memset(&priv->stat, 0, sizeof(struct net_device_stats));
 	spin_lock_init(&priv->lock);
 
 	/* set base + irq for this device (irq not allocated so far) */
@@ -1146,9 +1153,6 @@
 	dev->set_multicast_list = skmca_set_multicast_list;
 	dev->flags |= IFF_MULTICAST;
 
-	/* generic setup */
-	ether_setup(dev);
-
 	/* copy out MAC address */
 	for (i = 0; i < 6; i++)
 		dev->dev_addr[i] = SKMCA_READB(priv->macbase + (i << 1));
@@ -1167,7 +1171,13 @@
 
 	startslot = slot + 1;
 
-	return 0;
+	err = register_netdev(dev);
+	if (err) {
+		cleanup_card(dev);
+		free_netdev(dev);
+		dev = ERR_PTR(err);
+	}
+	return dev;
 }
 
 /* ------------------------------------------------------------------------
@@ -1179,51 +1189,34 @@
 
 #define DEVMAX 5
 
-static struct net_device moddevs[DEVMAX] = {
-	{ .name = "    ", .init = skmca_probe },
-	{ .name = "    ", .init = skmca_probe },
-	{ .name = "    ", .init = skmca_probe },
-	{ .name = "    ", .init = skmca_probe },
-	{ .name = "    ", .init = skmca_probe }
-};
-
-int irq;
-int io;
+static struct net_device *moddevs[DEVMAX];
 
 int init_module(void)
 {
-	int z, res;
+	int z;
 
 	startslot = 0;
 	for (z = 0; z < DEVMAX; z++) {
-		strcpy(moddevs[z].name, "     ");
-		res = register_netdev(moddevs + z);
-		if (res != 0)
-			return (z > 0) ? 0 : -EIO;
+		struct net_device *dev = skmca_probe(-1);
+		if (IS_ERR(dev))
+			break;
+		moddevs[z] = dev;
 	}
-
+	if (!z)
+		return -EIO;
 	return 0;
 }
 
 void cleanup_module(void)
 {
-	struct net_device *dev;
-	skmca_priv *priv;
 	int z;
 
 	for (z = 0; z < DEVMAX; z++) {
-		dev = moddevs + z;
-		if (dev->priv != NULL) {
-			priv = (skmca_priv *) dev->priv;
-			DeinitBoard(dev);
-			if (dev->irq != 0)
-				free_irq(dev->irq, dev);
-			dev->irq = 0;
+		struct net_device *dev = moddevs[z];
+		if (dev) {
 			unregister_netdev(dev);
-			mca_mark_as_unused(priv->slot);
-			mca_set_adapter_procfn(priv->slot, NULL, NULL);
-			kfree(dev->priv);
-			dev->priv = NULL;
+			cleanup_card(dev);
+			free_netdev(dev);
 		}
 	}
 }
--- diff/drivers/net/sk_mca.h	2003-09-30 15:46:15.000000000 +0100
+++ source/drivers/net/sk_mca.h	2004-02-09 10:39:54.000000000 +0000
@@ -178,7 +178,4 @@
 
 #endif				/* _SK_MCA_DRIVER_ */
 
-extern int skmca_probe(struct net_device *);
-
-
 #endif	/* _SK_MCA_INCLUDE_ */
--- diff/drivers/net/skfp/skfddi.c	2003-09-30 15:46:15.000000000 +0100
+++ source/drivers/net/skfp/skfddi.c	2004-02-09 10:39:54.000000000 +0000
@@ -39,12 +39,6 @@
  *   are skfddi.c, h/types.h, h/osdef1st.h, h/targetos.h.
  *   The others belong to the SysKonnect FDDI Hardware Module and
  *   should better not be changed.
- * NOTE:
- *   Compiling this driver produces some warnings, but I did not fix
- *   this, because the Hardware Module source is used for different
- *   drivers, and fixing it for Linux might bring problems on other
- *   projects. To keep the source common for all those drivers (and
- *   thus simplify fixes to it), please do not clean it up!
  *
  * Modification History:
  *              Date            Name    Description
@@ -58,6 +52,7 @@
  *		07-May-00	DM	64 bit fixes, new dma interface
  *		31-Jul-03	DB	Audit copy_*_user in skfp_ioctl
  *					  Daniele Bellucci <bellucda@tiscali.it>
+ *		03-Dec-03	SH	Convert to PCI device model
  *
  * Compilation options (-Dxxx):
  *              DRIVERDEBUG     print lots of messages to log file
@@ -70,7 +65,7 @@
 
 /* Version information string - should be updated prior to */
 /* each new release!!! */
-#define VERSION		"2.06"
+#define VERSION		"2.07"
 
 static const char *boot_msg = 
 	"SysKonnect FDDI PCI Adapter driver v" VERSION " for\n"
@@ -80,15 +75,11 @@
 
 #include <linux/module.h>
 #include <linux/kernel.h>
-#include <linux/string.h>
-#include <linux/ptrace.h>
 #include <linux/errno.h>
 #include <linux/ioport.h>
 #include <linux/slab.h>
 #include <linux/interrupt.h>
 #include <linux/pci.h>
-#include <linux/delay.h>
-#include <linux/ctype.h>	// isdigit
 #include <linux/netdevice.h>
 #include <linux/fddidevice.h>
 #include <linux/skbuff.h>
@@ -106,17 +97,7 @@
 #include	"h/smtstate.h"
 
 
-// Define global routines
-int skfp_probe(struct net_device *dev);
-
-
 // Define module-wide (static) routines
-static struct net_device *alloc_device(struct net_device *dev, u_long iobase);
-static struct net_device *insert_device(struct net_device *dev,
-				    int (*init) (struct net_device *));
-static int fddi_dev_index(unsigned char *s);
-static void init_dev(struct net_device *dev, u_long iobase);
-static void link_modules(struct net_device *dev, struct net_device *tmp);
 static int skfp_driver_init(struct net_device *dev);
 static int skfp_open(struct net_device *dev);
 static int skfp_close(struct net_device *dev);
@@ -193,15 +174,6 @@
 // Define module-wide (static) variables
 
 static int num_boards;	/* total number of adapters configured */
-static int num_fddi;
-static int autoprobed;
-
-#ifdef MODULE
-static struct net_device *unlink_modules(struct net_device *p);
-static int loading_module = 1;
-#else
-static int loading_module;
-#endif				// MODULE
 
 #ifdef DRIVERDEBUG
 #define PRINTK(s, args...) printk(s, ## args)
@@ -212,9 +184,9 @@
 #define PRIV(dev) (&(((struct s_smc *)dev->priv)->os))
 
 /*
- * ==============
- * = skfp_probe =
- * ==============
+ * =================
+ * = skfp_init_one =
+ * =================
  *   
  * Overview:
  *   Probes for supported FDDI PCI controllers
@@ -223,30 +195,11 @@
  *   Condition code
  *       
  * Arguments:
- *   dev - pointer to device information
+ *   pdev - pointer to PCI device information
  *
  * Functional Description:
- *   This routine is called by the OS for each FDDI device name (fddi0,
- *   fddi1,...,fddi6, fddi7) specified in drivers/net/Space.c.
- *   If loaded as a module, it will detect and initialize all 
- *   adapters the first time it is called.
- *
- *   Let's say that skfp_probe() is getting called to initialize fddi0.
- *   Furthermore, let's say there are three supported controllers in the
- *   system.  Before skfp_probe() leaves, devices fddi0, fddi1, and fddi2
- *   will be initialized and a global flag will be set to indicate that
- *   skfp_probe() has already been called.
- *
- *   However...the OS doesn't know that we've already initialized
- *   devices fddi1 and fddi2 so skfp_probe() gets called again and again
- *   until it reaches the end of the device list for FDDI (presently,
- *   fddi7).  It's important that the driver "pretend" to probe for
- *   devices fddi1 and fddi2 and return success.  Devices fddi3
- *   through fddi7 will return failure since they weren't initialized.
- *
- *   This algorithm seems to work for the time being.  As other FDDI
- *   drivers are written for Linux, a more generic approach (perhaps
- *   similar to the Ethernet card approach) may need to be implemented.
+ *   This is now called by PCI driver registration process
+ *   for each board found.
  *   
  * Return Codes:
  *   0           - This device (fddi0, fddi1, etc) configured successfully
@@ -259,374 +212,176 @@
  *   initialized and the board resources are read and stored in
  *   the device structure.
  */
-int skfp_probe(struct net_device *dev)
+static int skfp_init_one(struct pci_dev *pdev,
+				const struct pci_device_id *ent)
 {
-	int i;			/* used in for loops */
-	struct pci_dev *pdev = NULL;	/* PCI device structure */
-#ifndef MEM_MAPPED_IO
-	u16 port;		/* temporary I/O (port) address */
-	int port_len;		/* length of port address range (in bytes) */
-#else
-	unsigned long port;
-#endif
-	u16 command;	/* PCI Configuration space Command register val */
+	struct net_device *dev;
 	struct s_smc *smc;	/* board pointer */
-	struct net_device *tmp = dev;
-	u8 first_dev_used = 0;
-	u16 SubSysId;
+	u32 port, len;
+	int err;
 
-	PRINTK(KERN_INFO "entering skfp_probe\n");
-
-	/*
-	 * Verify whether we're going through skfp_probe() again
-	 *
-	 * If so, see if we're going through for a subsequent fddi device that
-	 * we've already initialized.  If we are, return success (0).  If not,
-	 * return failure (-ENODEV).
-	 */
-
-	if (autoprobed) {
-		PRINTK(KERN_INFO "Already entered skfp_probe\n");
-		if (dev != NULL) {
-			if ((strncmp(dev->name, "fddi", 4) == 0) &&
-			    (dev->base_addr != 0)) {
-				return (0);
-			}
-			return (-ENODEV);
-		}
-	}
-	autoprobed = 1;		/* set global flag */
+	PRINTK(KERN_INFO "entering skfp_init_one\n");
 
-	printk("%s\n", boot_msg);
+	if (num_boards == 0) 
+		printk("%s\n", boot_msg);
 
-	/* Scan for Syskonnect FDDI PCI controllers */
-	for (i = 0; i < SKFP_MAX_NUM_BOARDS; i++) {	// scan for PCI cards
-		PRINTK(KERN_INFO "Check device %d\n", i);
-		if ((pdev=pci_find_device(PCI_VENDOR_ID_SK, PCI_DEVICE_ID_SK_FP,
-			pdev)) == 0) {
-			break;
-		}
-		if (pci_enable_device(pdev))
-			continue;
+	err = pci_enable_device(pdev);
+	if (err)
+		goto err_out1;
 
-#ifndef MEM_MAPPED_IO
-		/* Verify that I/O enable bit is set (PCI slot is enabled) */
-		pci_read_config_word(pdev, PCI_COMMAND, &command);
-		if ((command & PCI_COMMAND_IO) == 0) {
-			PRINTK("I/O enable bit not set!");
-			PRINTK(" Verify that slot is enabled\n");
-			continue;
-		}
 
-		/* Turn off memory mapped space and enable mastering */
+#ifdef MEM_MAPPED_IO
+	if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM)) {
+		printk(KERN_ERR "skfp: region is not an MMIO resource\n");
+		err = -EIO;
+		goto err_out1;
+	}
+	port = pci_resource_start(pdev, 0);
+	len = pci_resource_len(pdev, 0);
 
-		PRINTK(KERN_INFO "Command Reg: %04x\n", command);
-		command |= PCI_COMMAND_MASTER;
-		command &= ~PCI_COMMAND_MEMORY;
-		pci_write_config_word(pdev, PCI_COMMAND, command);
-
-		/* Read I/O base address from PCI Configuration Space */
-
-		pci_read_config_word(pdev, PCI_BASE_ADDRESS_1, &port);
-		port &= PCI_BASE_ADDRESS_IO_MASK; // clear I/O bit (bit 0)
-
-		/* Verify port address range is not already being used */
-
-		port_len = FP_IO_LEN;
-		if (check_region(port, port_len) != 0) {
-			printk("I/O range allocated to adapter");
-			printk(" (0x%X-0x%X) is already being used!\n", port,
-			       (port + port_len - 1));
-			continue;
-		}
+	if (len < 0x4000) {
+		printk(KERN_ERR "skfp: Invalid PCI region size: %d\n", len);
+		err = -EIO;
+		goto err_out1;
+	}
 #else
-		/* Verify that MEM enable bit is set (PCI slot is enabled) */
-		pci_read_config_word(pdev, PCI_COMMAND, &command);
-		if ((command & PCI_COMMAND_MEMORY) == 0) {
-			PRINTK("MEMORY-I/O enable bit not set!");
-			PRINTK(" Verify that slot is enabled\n");
-			continue;
-		}
-
-		/* Turn off IO mapped space and enable mastering */
-
-		PRINTK(KERN_INFO "Command Reg: %04x\n", command);
-		command |= PCI_COMMAND_MASTER;
-		command &= ~PCI_COMMAND_IO;
-		pci_write_config_word(pdev, PCI_COMMAND, command);
-
-		port = pci_resource_start(pdev, 0);
-
-		port = (unsigned long)ioremap(port, 0x4000);
-		if (!port){
-			printk("skfp:  Unable to map MEMORY register, "
-			"FDDI adapter will be disabled.\n");
-			break;
-		}
-#endif
-
-		if ((!loading_module) || first_dev_used) {
-			/* Allocate a device structure for this adapter */
-			tmp = alloc_device(dev, port);
-		}
-		first_dev_used = 1;	// only significant first time
-
-		pci_read_config_word(pdev, PCI_SUBSYSTEM_ID, &SubSysId);
-
-		if (tmp != NULL) {
-			if (loading_module)
-				link_modules(dev, tmp);
-			dev = tmp;
-			init_dev(dev, port);
-			dev->irq = pdev->irq;
-
-			/* Initialize board structure with bus-specific info */
-
-			smc = (struct s_smc *) dev->priv;
-			smc->os.dev = dev;
-			smc->os.bus_type = SK_BUS_TYPE_PCI;
-			smc->os.pdev = *pdev;
-			smc->os.QueueSkb = MAX_TX_QUEUE_LEN;
-			smc->os.MaxFrameSize = MAX_FRAME_SIZE;
-			smc->os.dev = dev;
-			smc->hw.slot = -1;
-			smc->os.ResetRequested = FALSE;
-			skb_queue_head_init(&smc->os.SendSkbQueue);
-
-			if (skfp_driver_init(dev) == 0) {
-				// only increment global board 
-				// count on success
-				num_boards++;
-				request_region(dev->base_addr,
-					       FP_IO_LEN, dev->name);
-				if ((SubSysId & 0xff00) == 0x5500 ||
-					(SubSysId & 0xff00) == 0x5800) {
-				printk("%s: SysKonnect FDDI PCI adapter"
-				       " found (SK-%04X)\n", dev->name,
-					SubSysId);
-				} else {
-				printk("%s: FDDI PCI adapter found\n",
-					dev->name);
-				}
-			} else {
-				kfree(dev);
-				i = SKFP_MAX_NUM_BOARDS;	// stop search
-
-			}
-
-		}		// if (dev != NULL)
-
-	}			// for SKFP_MAX_NUM_BOARDS
-
-	/*
-	 * If we're at this point we're going through skfp_probe() for the
-	 * first time. Return success (0) if we've initialized 1 or more
-	 * boards. Otherwise, return failure (-ENODEV).
-	 */
-
-	if (num_boards > 0)
-		return (0);
-	else {
-		printk("no SysKonnect FDDI adapter found\n");
-		return (-ENODEV);
+	if (!(pci_resource_flags(pdev, 1) & IO_RESOURCE_IO)) {
+		printk(KERN_ERR "skfp: region is not PIO resource\n");
+		err = -EIO;
+		goto err_out1;
 	}
-}				// skfp_probe
-
-
-/************************
- *
- * Search the entire 'fddi' device list for a fixed probe. If a match isn't
- * found then check for an autoprobe or unused device location. If they
- * are not available then insert a new device structure at the end of
- * the current list.
- *
- ************************/
-static struct net_device *alloc_device(struct net_device *dev, u_long iobase)
-{
-	struct net_device *adev = NULL;
-	int fixed = 0, new_dev = 0;
-
-	PRINTK(KERN_INFO "entering alloc_device\n");
-	if (!dev)
-		return dev;
 
-	num_fddi = fddi_dev_index(dev->name);
-	if (loading_module) {
-		num_fddi++;
-		dev = insert_device(dev, skfp_probe);
-		return dev;
+	port = pci_resource_start(pdev, 1);
+	len = pci_resource_len(pdev, 1);
+	if (len < FP_IO_LEN) {
+		printk(KERN_ERR "skfp: Invalid PCI region size: %d\n",
+		       io_len);
+		err = -EIO;
+		goto err_out1;
 	}
-	while (1) {
-		if (((dev->base_addr == NO_ADDRESS) ||
-		     (dev->base_addr == 0)) && !adev) {
-			adev = dev;
-		} else if ((dev->priv == NULL) && (dev->base_addr == iobase)) {
-			fixed = 1;
-		} else {
-			if (dev->next == NULL) {
-				new_dev = 1;
-			} else if (strncmp(dev->next->name, "fddi", 4) != 0) {
-				new_dev = 1;
-			}
-		}
-		if ((dev->next == NULL) || new_dev || fixed)
-			break;
-		dev = dev->next;
-		num_fddi++;
-	}			// while (1)
-
-	if (adev && !fixed) {
-		dev = adev;
-		num_fddi = fddi_dev_index(dev->name);
-		new_dev = 0;
-	}
-	if (((dev->next == NULL) && ((dev->base_addr != NO_ADDRESS) &&
-				     (dev->base_addr != 0)) && !fixed) ||
-	    new_dev) {
-		num_fddi++;	/* New device */
-		dev = insert_device(dev, skfp_probe);
-	}
-	if (dev) {
-		if (!dev->priv) {
-			/* Allocate space for private board structure */
-			dev->priv = (void *) kmalloc(sizeof(struct s_smc),
-						     GFP_KERNEL);
-			if (dev->priv == NULL) {
-				printk("%s: Could not allocate memory for",
-					dev->name);
-				printk(" private board structure!\n");
-				return (NULL);
-			}
-			/* clear structure */
-			memset(dev->priv, 0, sizeof(struct s_smc));
-		}
+#endif
+	err = pci_request_regions(pdev, "skfddi");
+	if (err)
+		goto err_out1;
+
+	pci_set_master(pdev);
+
+	dev = alloc_fddidev(sizeof(struct s_smc));
+	if (!dev) {
+		printk(KERN_ERR "skfp: Unable to allocate fddi device, "
+				"FDDI adapter will be disabled.\n");
+		err = -ENOMEM;
+		goto err_out2;
+	}
+
+#ifdef MEM_MAPPED_IO
+	dev->base_addr = (unsigned long) ioremap(port, len);
+	if (!dev->base_addr) {
+		printk(KERN_ERR "skfp:  Unable to map MEMORY register, "
+				"FDDI adapter will be disabled.\n");
+		err = -EIO;
+		goto err_out3;
 	}
-	return dev;
-}				// alloc_device
-
-
-
-/************************
- *
- * Initialize device structure
- *
- ************************/
-static void init_dev(struct net_device *dev, u_long iobase)
-{
-	/* Initialize new device structure */
-
-	dev->mem_end = 0;	/* shared memory isn't used */
-	dev->mem_start = 0;	/* shared memory isn't used */
-	dev->base_addr = iobase;	/* save port (I/O) base address */
-	dev->if_port = 0;	/* not applicable to FDDI adapters */
-	dev->dma = 0;		/* Bus Master DMA doesn't require channel */
-	dev->irq = 0;
-
-	netif_start_queue(dev);
+#else
+	dev->base_addr = port;
+#endif
 
+	dev->irq = pdev->irq;
 	dev->get_stats = &skfp_ctl_get_stats;
 	dev->open = &skfp_open;
 	dev->stop = &skfp_close;
 	dev->hard_start_xmit = &skfp_send_pkt;
-	dev->hard_header = NULL;	/* set in fddi_setup() */
-	dev->rebuild_header = NULL;	/* set in fddi_setup() */
 	dev->set_multicast_list = &skfp_ctl_set_multicast_list;
 	dev->set_mac_address = &skfp_ctl_set_mac_address;
 	dev->do_ioctl = &skfp_ioctl;
-	dev->set_config = NULL;	/* not supported for now &&& */
 	dev->header_cache_update = NULL;	/* not supported */
-	dev->change_mtu = NULL;	/* set in fddi_setup() */
 
 	SET_MODULE_OWNER(dev);
+	SET_NETDEV_DEV(dev, &pdev->dev);
 
-	/* Initialize remaining device structure information */
-	fddi_setup(dev);
-}				// init_device
-
-
-/************************
- *
- * If at end of fddi device list and can't use current entry, malloc
- * one up. If memory could not be allocated, print an error message.
- *
-************************/
-static struct net_device *insert_device(struct net_device *dev,
-				    int (*init) (struct net_device *))
-{
-	struct net_device *new;
-	int len;
-
-	PRINTK(KERN_INFO "entering insert_device\n");
-	len = sizeof(struct net_device) + sizeof(struct s_smc);
-	new = (struct net_device *) kmalloc(len, GFP_KERNEL);
-	if (new == NULL) {
-		printk("fddi%d: Device not initialised, insufficient memory\n",
-		       num_fddi);
-		return NULL;
-	} else {
-		memset((char *) new, 0, len);
-		new->priv = (struct s_smc *) (new + 1);
-		new->init = init;	/* initialisation routine */
-		if (!loading_module) {
-			new->next = dev->next;
-			dev->next = new;
-		}
-		/* create new device name */
-		if (num_fddi > 999) {
-			sprintf(new->name, "fddi????");
-		} else {
-			sprintf(new->name, "fddi%d", num_fddi);
-		}
-	}
-	return new;
-}				// insert_device
-
-
-/************************
- *
- * Get the number of a "fddiX" string
- *
- ************************/
-static int fddi_dev_index(unsigned char *s)
-{
-	int i = 0, j = 0;
-
-	for (; *s; s++) {
-		if (isdigit(*s)) {
-			j = 1;
-			i = (i * 10) + (*s - '0');
-		} else if (j)
-			break;
-	}
-	return i;
-}				// fddi_dev_index
+	/* Initialize board structure with bus-specific info */
+	smc = (struct s_smc *) dev->priv;
+	smc->os.dev = dev;
+	smc->os.bus_type = SK_BUS_TYPE_PCI;
+	smc->os.pdev = *pdev;
+	smc->os.QueueSkb = MAX_TX_QUEUE_LEN;
+	smc->os.MaxFrameSize = MAX_FRAME_SIZE;
+	smc->os.dev = dev;
+	smc->hw.slot = -1;
+	smc->os.ResetRequested = FALSE;
+	skb_queue_head_init(&smc->os.SendSkbQueue);
+
+	err = skfp_driver_init(dev);
+	if (err)
+		goto err_out4;
+
+	err = register_netdev(dev);
+	if (err)
+		goto err_out5;
+
+	++num_boards;
+	pci_set_drvdata(pdev, dev);
+
+	if ((pdev->subsystem_device & 0xff00) == 0x5500 ||
+	    (pdev->subsystem_device & 0xff00) == 0x5800) 
+		printk("%s: SysKonnect FDDI PCI adapter"
+		       " found (SK-%04X)\n", dev->name,	
+		       pdev->subsystem_device);
+	else
+		printk("%s: FDDI PCI adapter found\n", dev->name);
 
+	return 0;
+err_out5:
+	if (smc->os.SharedMemAddr) 
+		pci_free_consistent(pdev, smc->os.SharedMemSize,
+				    smc->os.SharedMemAddr, 
+				    smc->os.SharedMemDMA);
+	pci_free_consistent(pdev, MAX_FRAME_SIZE,
+			    smc->os.LocalRxBuffer, smc->os.LocalRxBufferDMA);
+err_out4:
+#ifdef MEM_MAPPED_IO
+	iounmap((void *) dev->base_addr);
+#endif
+err_out3:
+	free_netdev(dev);
+err_out2:
+	pci_release_regions(pdev);
+err_out1:
+	return err;
+}
 
-/************************
- *
- * Used if loaded as module only. Link the device structures
- * together. Needed to release them all at unload.
- *
-************************/
-static void link_modules(struct net_device *dev, struct net_device *tmp)
+/*
+ * Called for each adapter board from pci_unregister_driver
+ */
+static void __devexit skfp_remove_one(struct pci_dev *pdev)
 {
-	struct net_device *p = dev;
+	struct net_device *p = pci_get_drvdata(pdev);
+	struct s_smc *lp = p->priv;
 
-	if (p) {
-		while (((struct s_smc *) (p->priv))->os.next_module) {
-			p = ((struct s_smc *) (p->priv))->os.next_module;
-		}
+	unregister_netdev(p);
 
-		if (dev != tmp) {
-			((struct s_smc *) (p->priv))->os.next_module = tmp;
-		} else {
-			((struct s_smc *) (p->priv))->os.next_module = NULL;
-		}
+	if (lp->os.SharedMemAddr) {
+		pci_free_consistent(&lp->os.pdev,
+				    lp->os.SharedMemSize,
+				    lp->os.SharedMemAddr,
+				    lp->os.SharedMemDMA);
+		lp->os.SharedMemAddr = NULL;
+	}
+	if (lp->os.LocalRxBuffer) {
+		pci_free_consistent(&lp->os.pdev,
+				    MAX_FRAME_SIZE,
+				    lp->os.LocalRxBuffer,
+				    lp->os.LocalRxBufferDMA);
+		lp->os.LocalRxBuffer = NULL;
 	}
-	return;
-}				// link_modules
-
+#ifdef MEM_MAPPED_IO
+	iounmap((void *) p->base_addr);
+#endif
+	pci_release_regions(pdev);
+	free_netdev(p);
 
+	pci_set_drvdata(pdev, NULL);
+}
 
 /*
  * ====================
@@ -653,11 +408,11 @@
  *    0 - initialization succeeded
  *   -1 - initialization failed
  */
-static int skfp_driver_init(struct net_device *dev)
+static  int skfp_driver_init(struct net_device *dev)
 {
 	struct s_smc *smc = (struct s_smc *) dev->priv;
 	skfddi_priv *bp = PRIV(dev);
-	u8 val;			/* used for I/O read/writes */
+	int err = -EIO;
 
 	PRINTK(KERN_INFO "entering skfp_driver_init\n");
 
@@ -666,9 +421,7 @@
 	smc->hw.iop = dev->base_addr;
 
 	// Get the interrupt level from the PCI Configuration Table
-	val = dev->irq;
-
-	smc->hw.irq = val;
+	smc->hw.irq = dev->irq;
 
 	spin_lock_init(&bp->DriverLock);
 	
@@ -738,7 +491,7 @@
 				    bp->LocalRxBuffer, bp->LocalRxBufferDMA);
 		bp->LocalRxBuffer = NULL;
 	}
-	return (-1);
+	return err;
 }				// skfp_driver_init
 
 
@@ -766,14 +519,15 @@
 static int skfp_open(struct net_device *dev)
 {
 	struct s_smc *smc = (struct s_smc *) dev->priv;
+	int err;
 
 	PRINTK(KERN_INFO "entering skfp_open\n");
 	/* Register IRQ - support shared interrupts by passing device ptr */
-	if (request_irq(dev->irq, (void *) skfp_interrupt, SA_SHIRQ,
-			dev->name, dev)) {
-		printk("%s: Requested IRQ %d is busy\n", dev->name, dev->irq);
-		return (-EAGAIN);
-	}
+	err = request_irq(dev->irq, (void *) skfp_interrupt, SA_SHIRQ,
+			  dev->name, dev);
+	if (err)
+		return err;
+
 	/*
 	 * Set current address to factory MAC address
 	 *
@@ -797,6 +551,7 @@
 	/* Disable promiscuous filter settings */
 	mac_drv_rx_mode(smc, RX_DISABLE_PROMISC);
 
+	netif_start_queue(dev);
 	return (0);
 }				// skfp_open
 
@@ -831,7 +586,6 @@
 static int skfp_close(struct net_device *dev)
 {
 	struct s_smc *smc = (struct s_smc *) dev->priv;
-	struct sk_buff *skb;
 	skfddi_priv *bp = PRIV(dev);
 
 	CLI_FBI();
@@ -844,13 +598,8 @@
 	/* Deregister (free) IRQ */
 	free_irq(dev->irq, dev);
 
-	for (;;) {
-		skb = skb_dequeue(&bp->SendSkbQueue);
-		if (skb == NULL)
-			break;
-		bp->QueueSkb++;
-		dev_kfree_skb(skb);
-	}
+	skb_queue_purge(&bp->SendSkbQueue);
+	bp->QueueSkb = MAX_TX_QUEUE_LEN;
 
 	return (0);
 }				// skfp_close
@@ -1285,6 +1034,8 @@
 		break;
 	default:
 		printk("ioctl for %s: unknow cmd: %04x\n", dev->name, ioc.cmd);
+		status = -EOPNOTSUPP;
+
 	}			// switch
 
 	return status;
@@ -2538,63 +2289,21 @@
 
 }				// drv_reset_indication
 
-
-static struct net_device *mdev;
+static struct pci_driver skfddi_pci_driver = {
+	.name		= "skfddi",
+	.id_table	= skfddi_pci_tbl,
+	.probe		= skfp_init_one,
+	.remove		= __devexit_p(skfp_remove_one),
+};
 
 static int __init skfd_init(void)
 {
-	struct net_device *p;
-
-	if ((mdev = insert_device(NULL, skfp_probe)) == NULL)
-		return -ENOMEM;
-
-	for (p = mdev; p != NULL; p = ((struct s_smc *)p->priv)->os.next_module) {
-		if (register_netdev(p) != 0) {
-			printk("skfddi init_module failed\n");
-			return -EIO;
-		}
-	}
-
-	return 0;
+	return pci_module_init(&skfddi_pci_driver);
 }
 
-static struct net_device *unlink_modules(struct net_device *p)
-{
-	struct net_device *next = NULL;
-
-	if (p->priv) {		/* Private areas allocated? */
-		struct s_smc *lp = (struct s_smc *) p->priv;
-
-		next = lp->os.next_module;
-
-		if (lp->os.SharedMemAddr) {
-			pci_free_consistent(&lp->os.pdev,
-					    lp->os.SharedMemSize,
-					    lp->os.SharedMemAddr,
-					    lp->os.SharedMemDMA);
-			lp->os.SharedMemAddr = NULL;
-		}
-		if (lp->os.LocalRxBuffer) {
-			pci_free_consistent(&lp->os.pdev,
-					    MAX_FRAME_SIZE,
-					    lp->os.LocalRxBuffer,
-					    lp->os.LocalRxBufferDMA);
-			lp->os.LocalRxBuffer = NULL;
-		}
-		release_region(p->base_addr, 
-			(lp->os.bus_type == SK_BUS_TYPE_PCI ? FP_IO_LEN : 0));
-	}
-	unregister_netdev(p);
-	printk("%s: unloaded\n", p->name);
-	free_netdev(p);		/* Free the device structure */
-
-	return next;
-}				// unlink_modules
-
 static void __exit skfd_exit(void)
 {
-	while (mdev)
-		mdev = unlink_modules(mdev);
+	pci_unregister_driver(&skfddi_pci_driver);
 }
 
 module_init(skfd_init);
--- diff/drivers/net/smc-mca.c	2003-09-30 15:46:15.000000000 +0100
+++ source/drivers/net/smc-mca.c	2004-02-09 10:39:54.000000000 +0000
@@ -202,22 +202,18 @@
 		return -ENXIO;
 
         /* Adapter found. */
-	dev  = alloc_etherdev(0);
+	dev  = alloc_ei_netdev();
 	if(!dev)
 		return -ENODEV;
 
 	SET_MODULE_OWNER(dev);
 	SET_NETDEV_DEV(dev, gen_dev);
-
-	rc = register_netdev(dev);
-	if (rc)
-		goto err_free_netdev;
-
-	printk(KERN_INFO "%s: %s found in slot %d\n",
-	       dev->name, smc_mca_adapter_names[adapter], slot + 1);
-
 	mca_device_set_name(mca_dev, smc_mca_adapter_names[adapter]);
 	mca_device_set_claim(mca_dev, 1);
+
+	printk(KERN_INFO "smc_mca: %s found in slot %d\n",
+		       smc_mca_adapter_names[adapter], slot + 1);
+
 	ultra_found++;
 
 	dev->base_addr = ioaddr = mca_device_transform_ioport(mca_dev, tbase);
@@ -266,18 +262,18 @@
 	/* sanity check, shouldn't happen */
 	if (dev->mem_start == 0) {
 		rc = -ENODEV;
-		goto err_unregister_netdev;
+		goto err_unclaim;
 	}
 
 	if (!request_region(ioaddr, ULTRA_IO_EXTENT, dev->name)) {
 		rc = -ENODEV;
-		goto err_unregister_netdev;
+		goto err_unclaim;
 	}
 
 	reg4 = inb(ioaddr + 4) & 0x7f;
 	outb(reg4, ioaddr + 4);
 
-	printk(KERN_INFO "%s: Parameters: %#3x,", dev->name, ioaddr);
+	printk(KERN_INFO "smc_mca[%d]: Parameters: %#3x,", slot + 1, ioaddr);
 
 	for (i = 0; i < 6; i++)
 		printk(" %2.2X", dev->dev_addr[i] = inb(ioaddr + 8 + i));
@@ -299,14 +295,6 @@
 
 	outb(reg4, ioaddr + 4);
 
-	/* Allocate dev->priv and fill in 8390 specific dev fields.
-	 */
-
-	rc = ethdev_init(dev);
-	if (rc) {
-		printk (", no memory for dev->priv.\n");
-		goto err_release_region;
-	}
 	gen_dev->driver_data = dev;
 
 	/* The 8390 isn't at the base address, so fake the offset
@@ -336,16 +324,22 @@
 
 	dev->open = &ultramca_open;
 	dev->stop = &ultramca_close_card;
+#ifdef CONFIG_NET_POLL_CONTROLLER
+	dev->poll_controller = ei_poll;
+#endif
 
 	NS8390_init(dev, 0);
 
+	rc = register_netdev(dev);
+	if (rc)
+		goto err_release_region;
+
 	return 0;
 
 err_release_region:
 	release_region(ioaddr, ULTRA_IO_EXTENT);
-err_unregister_netdev:
-	unregister_netdev(dev);
-err_free_netdev:
+err_unclaim:
+	mca_device_set_claim(mca_dev, 0);
 	free_netdev(dev);
 	return rc;
 }
@@ -463,14 +457,14 @@
 	struct mca_device *mca_dev = to_mca_device(gen_dev);
 	struct net_device *dev = (struct net_device *)gen_dev->driver_data;
 
-	if(dev && dev->priv) {
+	if (dev) {
 		/* NB: ultra_close_card() does free_irq */
 		int ioaddr = dev->base_addr - ULTRA_NIC_OFFSET;
 
+		unregister_netdev(dev);
 		mca_device_set_claim(mca_dev, 0);
 		release_region(ioaddr, ULTRA_IO_EXTENT);
-		unregister_netdev(dev);
-		kfree(dev->priv);
+		free_netdev(dev);
 	}
 	return 0;
 }
--- diff/drivers/net/smc-ultra.c	2003-09-30 15:46:15.000000000 +0100
+++ source/drivers/net/smc-ultra.c	2004-02-09 10:39:54.000000000 +0000
@@ -76,7 +76,6 @@
 static unsigned int ultra_portlist[] __initdata =
 {0x200, 0x220, 0x240, 0x280, 0x300, 0x340, 0x380, 0};
 
-int ultra_probe(struct net_device *dev);
 static int ultra_probe1(struct net_device *dev, int ioaddr);
 
 #ifdef __ISAPNP__
@@ -122,18 +121,30 @@
 #define ULTRA_IO_EXTENT 32
 #define EN0_ERWCNT		0x08	/* Early receive warning count. */
 
+#ifdef CONFIG_NET_POLL_CONTROLLER
+static void ultra_poll(struct net_device *dev)
+{
+	disable_irq(dev->irq);
+	ei_interrupt(dev->irq, dev, NULL);
+	enable_irq(dev->irq);
+}
+#endif
 /*	Probe for the Ultra.  This looks like a 8013 with the station
 	address PROM at I/O ports <base>+8 to <base>+13, with a checksum
 	following.
 */
 
-int __init ultra_probe(struct net_device *dev)
+static int __init do_ultra_probe(struct net_device *dev)
 {
 	int i;
 	int base_addr = dev->base_addr;
+	int irq = dev->irq;
 
 	SET_MODULE_OWNER(dev);
 
+#ifdef CONFIG_NET_POLL_CONTROLLER
+	dev->poll_controller = &ultra_poll;
+#endif
 	if (base_addr > 0x1ff)		/* Check a single specified location. */
 		return ultra_probe1(dev, base_addr);
 	else if (base_addr != 0)	/* Don't probe at all. */
@@ -147,13 +158,51 @@
 	printk(KERN_NOTICE "smc-ultra.c: No ISAPnP cards found, trying standard ones...\n");
 #endif
 
-	for (i = 0; ultra_portlist[i]; i++)
+	for (i = 0; ultra_portlist[i]; i++) {
+		dev->irq = irq;
 		if (ultra_probe1(dev, ultra_portlist[i]) == 0)
 			return 0;
+	}
 
 	return -ENODEV;
 }
 
+static void cleanup_card(struct net_device *dev)
+{
+	/* NB: ultra_close_card() does free_irq */
+#ifdef __ISAPNP__
+	struct pnp_dev *idev = (struct pnp_dev *)ei_status.priv;
+	if (idev)
+		pnp_device_detach(idev);
+#endif
+	release_region(dev->base_addr - ULTRA_NIC_OFFSET, ULTRA_IO_EXTENT);
+}
+
+struct net_device * __init ultra_probe(int unit)
+{
+	struct net_device *dev = alloc_ei_netdev();
+	int err;
+
+	if (!dev)
+		return ERR_PTR(-ENOMEM);
+
+	sprintf(dev->name, "eth%d", unit);
+	netdev_boot_setup_check(dev);
+
+	err = do_ultra_probe(dev);
+	if (err)
+		goto out;
+	err = register_netdev(dev);
+	if (err)
+		goto out1;
+	return dev;
+out1:
+	cleanup_card(dev);
+out:
+	free_netdev(dev);
+	return ERR_PTR(err);
+}
+
 static int __init ultra_probe1(struct net_device *dev, int ioaddr)
 {
 	int i, retval;
@@ -226,13 +275,6 @@
 		eeprom_irq = 1;
 	}
 
-	/* Allocate dev->priv and fill in 8390 specific dev fields. */
-	if (ethdev_init(dev)) {
-		printk (", no memory for dev->priv.\n");
-                retval = -ENOMEM;
-		goto out;
-        }
-
 	/* The 8390 isn't at the base address, so fake the offset */
 	dev->base_addr = ioaddr+ULTRA_NIC_OFFSET;
 
@@ -270,6 +312,9 @@
 	ei_status.reset_8390 = &ultra_reset_8390;
 	dev->open = &ultra_open;
 	dev->stop = &ultra_close_card;
+#ifdef CONFIG_NET_POLL_CONTROLLER
+	dev->poll_controller = ei_poll;
+#endif
 	NS8390_init(dev, 0);
 
 	return 0;
@@ -500,7 +545,7 @@
 
 #ifdef MODULE
 #define MAX_ULTRA_CARDS	4	/* Max number of Ultra cards per module */
-static struct net_device dev_ultra[MAX_ULTRA_CARDS];
+static struct net_device *dev_ultra[MAX_ULTRA_CARDS];
 static int io[MAX_ULTRA_CARDS];
 static int irq[MAX_ULTRA_CARDS];
 
@@ -516,26 +561,33 @@
 int
 init_module(void)
 {
+	struct net_device *dev;
 	int this_dev, found = 0;
 
 	for (this_dev = 0; this_dev < MAX_ULTRA_CARDS; this_dev++) {
-		struct net_device *dev = &dev_ultra[this_dev];
-		dev->irq = irq[this_dev];
-		dev->base_addr = io[this_dev];
-		dev->init = ultra_probe;
 		if (io[this_dev] == 0)  {
 			if (this_dev != 0) break; /* only autoprobe 1st one */
 			printk(KERN_NOTICE "smc-ultra.c: Presently autoprobing (not recommended) for a single card.\n");
 		}
-		if (register_netdev(dev) != 0) {
-			printk(KERN_WARNING "smc-ultra.c: No SMC Ultra card found (i/o = 0x%x).\n", io[this_dev]);
-			if (found != 0) return 0;	/* Got at least one. */
-			return -ENXIO;
+		dev = alloc_ei_netdev();
+		if (!dev)
+			break;
+		dev->irq = irq[this_dev];
+		dev->base_addr = io[this_dev];
+		if (do_ultra_probe(dev) == 0) {
+			if (register_netdev(dev) == 0) {
+				dev_ultra[found++] = dev;
+				continue;
+			}
+			cleanup_card(dev);
 		}
-		found++;
+		free_netdev(dev);
+		printk(KERN_WARNING "smc-ultra.c: No SMC Ultra card found (i/o = 0x%x).\n", io[this_dev]);
+		break;
 	}
-
-	return 0;
+	if (found)
+		return 0;
+	return -ENXIO;
 }
 
 void
@@ -544,20 +596,11 @@
 	int this_dev;
 
 	for (this_dev = 0; this_dev < MAX_ULTRA_CARDS; this_dev++) {
-		struct net_device *dev = &dev_ultra[this_dev];
-		if (dev->priv != NULL) {
-			/* NB: ultra_close_card() does free_irq */
-			int ioaddr = dev->base_addr - ULTRA_NIC_OFFSET;
-
-#ifdef __ISAPNP__
-			struct pnp_dev *idev = (struct pnp_dev *)ei_status.priv;
-			if (idev)
-				pnp_device_detach(idev);
-#endif
-
+		struct net_device *dev = dev_ultra[this_dev];
+		if (dev) {
 			unregister_netdev(dev);
-			release_region(ioaddr, ULTRA_IO_EXTENT);
-			kfree(dev->priv);
+			cleanup_card(dev);
+			free_netdev(dev);
 		}
 	}
 }
--- diff/drivers/net/smc-ultra32.c	2003-09-30 15:46:15.000000000 +0100
+++ source/drivers/net/smc-ultra32.c	2004-02-09 10:39:54.000000000 +0000
@@ -61,7 +61,6 @@
 
 #include "8390.h"
 
-int ultra32_probe(struct net_device *dev);
 static int ultra32_probe1(struct net_device *dev, int ioaddr);
 static int ultra32_open(struct net_device *dev);
 static void ultra32_reset_8390(struct net_device *dev);
@@ -98,26 +97,59 @@
 #define ULTRA32_CFG6	(-0x15)	/* 0xc8b */
 #define ULTRA32_CFG7	0x0d	/* 0xcad */
 
+static void cleanup_card(struct net_device *dev)
+{
+	int ioaddr = dev->base_addr - ULTRA32_NIC_OFFSET;
+	/* NB: ultra32_close_card() does free_irq */
+	release_region(ioaddr, ULTRA32_IO_EXTENT);
+}
 
 /*	Probe for the Ultra32.  This looks like a 8013 with the station
 	address PROM at I/O ports <base>+8 to <base>+13, with a checksum
 	following.
 */
 
-int __init ultra32_probe(struct net_device *dev)
+struct net_device * __init ultra32_probe(int unit)
 {
-	int ioaddr;
-
-	if (!EISA_bus) return -ENODEV;
+	struct net_device *dev;
+	int base;
+	int irq;
+	int err = -ENODEV;
+
+	if (!EISA_bus)
+		return ERR_PTR(-ENODEV);
+
+	dev = alloc_ei_netdev();
+
+	if (!dev)
+		return ERR_PTR(-ENOMEM);
+
+	if (unit >= 0) {
+		sprintf(dev->name, "eth%d", unit);
+		netdev_boot_setup_check(dev);
+	}
 
 	SET_MODULE_OWNER(dev);
 
-	/* EISA spec allows for up to 16 slots, but 8 is typical. */
-	for (ioaddr = 0x1000 + ULTRA32_BASE; ioaddr < 0x9000; ioaddr += 0x1000)
-		if (ultra32_probe1(dev, ioaddr) == 0)
-			return 0;
+	irq = dev->irq;
 
-	return -ENODEV;
+	/* EISA spec allows for up to 16 slots, but 8 is typical. */
+	for (base = 0x1000 + ULTRA32_BASE; base < 0x9000; base += 0x1000) {
+		if (ultra32_probe1(dev, base) == 0)
+			break;
+		dev->irq = irq;
+	}
+	if (base >= 0x9000)
+		goto out;
+	err = register_netdev(dev);
+	if (err)
+		goto out1;
+	return dev;
+out1:
+	cleanup_card(dev);
+out:
+	free_netdev(dev);
+	return ERR_PTR(err);
 }
 
 static int __init ultra32_probe1(struct net_device *dev, int ioaddr)
@@ -210,13 +242,6 @@
 		dev->irq = irq;
 	}
 
-	/* Allocate dev->priv and fill in 8390 specific dev fields. */
-	if (ethdev_init(dev)) {
-		printk (", no memory for dev->priv.\n");
-                retval = -ENOMEM;
-		goto out;
-        }
-
 	/* The 8390 isn't at the base address, so fake the offset */
 	dev->base_addr = ioaddr + ULTRA32_NIC_OFFSET;
 
@@ -243,6 +268,9 @@
 	ei_status.reset_8390 = &ultra32_reset_8390;
 	dev->open = &ultra32_open;
 	dev->stop = &ultra32_close;
+#ifdef CONFIG_NET_POLL_CONTROLLER
+	dev->poll_controller = ei_poll;
+#endif
 	NS8390_init(dev, 0);
 
 	return 0;
@@ -380,7 +408,7 @@
 
 #ifdef MODULE
 #define MAX_ULTRA32_CARDS   4	/* Max number of Ultra cards per module */
-static struct net_device dev_ultra[MAX_ULTRA32_CARDS];
+static struct net_device *dev_ultra[MAX_ULTRA32_CARDS];
 
 MODULE_DESCRIPTION("SMC Ultra32 EISA ethernet driver");
 MODULE_LICENSE("GPL");
@@ -390,18 +418,15 @@
 	int this_dev, found = 0;
 
 	for (this_dev = 0; this_dev < MAX_ULTRA32_CARDS; this_dev++) {
-		struct net_device *dev = &dev_ultra[this_dev];
-		dev->init = ultra32_probe;
-		if (register_netdev(dev) != 0) {
-			if (found > 0) { /* Got at least one. */
-				return 0;
-			}
-			printk(KERN_WARNING "smc-ultra32.c: No SMC Ultra32 found.\n");
-			return -ENXIO;
-		}
-		found++;
+		struct net_device *dev = ultra32_probe(-1);
+		if (IS_ERR(dev))
+			break;
+		dev_ultra[found++] = dev;
 	}
-	return 0;
+	if (found)
+		return 0;
+	printk(KERN_WARNING "smc-ultra32.c: No SMC Ultra32 found.\n");
+	return -ENXIO;
 }
 
 void cleanup_module(void)
@@ -409,14 +434,11 @@
 	int this_dev;
 
 	for (this_dev = 0; this_dev < MAX_ULTRA32_CARDS; this_dev++) {
-		struct net_device *dev = &dev_ultra[this_dev];
-		if (dev->priv != NULL) {
-			int ioaddr = dev->base_addr - ULTRA32_NIC_OFFSET;
-			void *priv = dev->priv;
-			/* NB: ultra32_close_card() does free_irq */
-			release_region(ioaddr, ULTRA32_IO_EXTENT);
+		struct net_device *dev = dev_ultra[this_dev];
+		if (dev) {
 			unregister_netdev(dev);
-			kfree(priv);
+			cleanup_card(dev);
+			free_netdev(dev);
 		}
 	}
 }
--- diff/drivers/net/smc9194.c	2003-09-30 15:46:15.000000000 +0100
+++ source/drivers/net/smc9194.c	2004-02-09 10:39:54.000000000 +0000
@@ -191,7 +191,7 @@
  .
  . NB:This shouldn't be static since it is referred to externally.
 */
-int smc_init(struct net_device *dev);
+struct net_device *smc_init(int unit);
 
 /*
  . The kernel calls this function when someone wants to use the device,
@@ -672,7 +672,7 @@
 
 /*-------------------------------------------------------------------------
  |
- | smc_init( struct net_device * dev )
+ | smc_init(int unit)
  |   Input parameters:
  |	dev->base_addr == 0, try to find all possible locations
  |	dev->base_addr == 1, return failure code
@@ -680,31 +680,56 @@
  |	dev->base_addr == <anything else>   this is the address to check
  |
  |   Output:
- |	0 --> there is a device
- |	anything else, error
+ |	pointer to net_device or ERR_PTR(error)
  |
  ---------------------------------------------------------------------------
 */
-int __init smc_init(struct net_device *dev)
+static int io;
+static int irq;
+static int ifport;
+
+struct net_device * __init smc_init(int unit)
 {
-	int i;
-	int base_addr = dev->base_addr;
+	struct net_device *dev = alloc_etherdev(sizeof(struct smc_local));
+	unsigned *port;
+	int err = 0;
+
+	if (!dev)
+		return ERR_PTR(-ENODEV);
+
+	if (unit >= 0) {
+		sprintf(dev->name, "eth%d", unit);
+		netdev_boot_setup_check(dev);
+		io = dev->base_addr;
+		irq = dev->irq;
+	}
 
 	SET_MODULE_OWNER(dev);
 
-	/*  try a specific location */
-	if (base_addr > 0x1ff)
-		return smc_probe(dev, base_addr);
-	else if (base_addr != 0)
-		return -ENXIO;
-
-	/* check every ethernet address */
-	for (i = 0; smc_portlist[i]; i++)
-		if (smc_probe(dev, smc_portlist[i]) == 0)
-			return 0;
-
-	/* couldn't find anything */
-	return -ENODEV;
+	if (io > 0x1ff) {	/* Check a single specified location. */
+		err = smc_probe(dev, io);
+	} else if (io != 0) {	/* Don't probe at all. */
+		err = -ENXIO;
+	} else {
+		for (port = smc_portlist; *port; port++) {
+			if (smc_probe(dev, *port) == 0)
+				break;
+		}
+		if (!*port)
+			err = -ENODEV;
+	}
+	if (err)
+		goto out;
+	err = register_netdev(dev);
+	if (err)
+		goto out1;
+	return dev;
+out1:
+	free_irq(dev->irq, dev);
+	release_region(dev->base_addr, SMC_IO_EXTENT);
+out:
+	free_netdev(dev);
+	return ERR_PTR(err);
 }
 
 /*----------------------------------------------------------------------
@@ -821,6 +846,9 @@
 	if (!request_region(ioaddr, SMC_IO_EXTENT, dev->name))
 		return -EBUSY;
 
+	dev->irq = irq;
+	dev->if_port = ifport;
+
 	/* First, see if the high byte is 0x33 */
 	bank = inw( ioaddr + BANK_SELECT );
 	if ( (bank & 0xFF00) != 0x3300 ) {
@@ -969,28 +997,14 @@
 		printk("%2.2x:", dev->dev_addr[i] );
 	printk("%2.2x \n", dev->dev_addr[5] );
 
-
-	/* Initialize the private structure. */
-	if (dev->priv == NULL) {
-		dev->priv = kmalloc(sizeof(struct smc_local), GFP_KERNEL);
-		if (dev->priv == NULL) {
-			retval = -ENOMEM;
-			goto err_out;
-		}
-	}
 	/* set the private data to zero by default */
 	memset(dev->priv, 0, sizeof(struct smc_local));
 
-	/* Fill in the fields of the device structure with ethernet values. */
-	ether_setup(dev);
-
 	/* Grab the IRQ */
       	retval = request_irq(dev->irq, &smc_interrupt, 0, dev->name, dev);
       	if (retval) {
 		printk("%s: unable to get IRQ %d (irqval=%d).\n", dev->name,
 			dev->irq, retval);
-		kfree(dev->priv);
-		dev->priv = NULL;
   	  	goto err_out;
       	}
 
@@ -1524,10 +1538,7 @@
 
 #ifdef MODULE
 
-static struct net_device devSMC9194;
-static int io;
-static int irq;
-static int ifport;
+static struct net_device *devSMC9194;
 MODULE_LICENSE("GPL");
 
 MODULE_PARM(io, "i");
@@ -1539,32 +1550,23 @@
 
 int init_module(void)
 {
-	int result;
-
 	if (io == 0)
 		printk(KERN_WARNING
 		CARDNAME": You shouldn't use auto-probing with insmod!\n" );
 
 	/* copy the parameters from insmod into the device structure */
-	devSMC9194.base_addr = io;
-	devSMC9194.irq       = irq;
-	devSMC9194.if_port	= ifport;
-	devSMC9194.init   	= smc_init;
-	if ((result = register_netdev(&devSMC9194)) != 0)
-		return result;
-
+	devSMC9194 = smc_init(-1);
+	if (IS_ERR(devSMC9194))
+		return PTR_ERR(devSMC9194);
 	return 0;
 }
 
 void cleanup_module(void)
 {
-	unregister_netdev(&devSMC9194);
-
-	free_irq(devSMC9194.irq, &devSMC9194);
-	release_region(devSMC9194.base_addr, SMC_IO_EXTENT);
-
-	if (devSMC9194.priv)
-		kfree(devSMC9194.priv);
+	unregister_netdev(devSMC9194);
+	free_irq(devSMC9194->irq, devSMC9194);
+	release_region(devSMC9194->base_addr, SMC_IO_EXTENT);
+	free_netdev(devSMC9194);
 }
 
 #endif /* MODULE */
--- diff/drivers/net/stnic.c	2004-02-09 10:36:10.000000000 +0000
+++ source/drivers/net/stnic.c	2004-02-09 10:39:54.000000000 +0000
@@ -98,28 +98,20 @@
   STNIC_DELAY ();
 }
 
-int __init stnic_probe(void)
+static int __init stnic_probe(void)
 {
   struct net_device *dev;
-  int i;
+  int i, err;
 
   /* If we are not running on a SolutionEngine, give up now */
   if (! MACH_SE)
     return -ENODEV;
 
   /* New style probing API */
-  dev = init_etherdev (NULL, 0);
+  dev = alloc_ei_netdev();
   if (!dev)
   	return -ENOMEM;
   SET_MODULE_OWNER(dev);
-  stnic_dev = dev;
-
-  /* Allocate dev->priv and fill in 8390 specific dev fields. */
-  if (ethdev_init (dev))
-    {
-      printk (KERN_EMERG "Unable to get memory for dev->priv.\n");
-      return -ENOMEM;
-    }
 
 #ifdef CONFIG_SH_STANDARD_BIOS 
   sh_bios_get_node_addr (stnic_eadr);
@@ -132,16 +124,17 @@
   dev->irq = IRQ_STNIC;
   dev->open = &stnic_open;
   dev->stop = &stnic_close;
+#ifdef CONFIG_NET_POLL_CONTROLLER
+  dev->poll_controller = ei_poll;
+#endif
 
   /* Snarf the interrupt now.  There's no point in waiting since we cannot
      share and the board will usually be enabled. */
-  i = request_irq (dev->irq, ei_interrupt, 0, dev->name, dev);
-  if (i)  {
+  err = request_irq (dev->irq, ei_interrupt, 0, dev->name, dev);
+  if (err)  {
       printk (KERN_EMERG " unable to get IRQ %d.\n", dev->irq);
-      unregister_netdev(dev);
-      kfree(dev->priv);
-      kfree(dev);
-      return i;
+      free_netdev(dev);
+      return err;
     }
 
   ei_status.name = dev->name;
@@ -162,6 +155,14 @@
 
   stnic_init (dev);
 
+  err = register_netdev(dev);
+  if (err) {
+    free_irq(dev->irq, dev);
+    free_netdev(dev);
+    return err;
+  }
+  stnic_dev = dev;
+
   printk (KERN_INFO "NS ST-NIC 83902A\n");
 
   return 0;
@@ -305,15 +306,13 @@
   return;
 }
 
-/* Hardware interrupt handler.  */
-irqreturn_t ei_interrupt (int irq, void *dev_id, struct pt_regs *regs);
-
-irqreturn_t
-do_stnic_intr (int irq, void *dev_id, struct pt_regs *regs)
+static void __exit stnic_cleanup(void)
 {
-  return ei_interrupt (0, stnic_dev, regs);
+	unregister_netdev(stnic_dev);
+	free_irq(stnic_dev->irq, stnic_dev);
+	free_netdev(stnic_dev);
 }
 
 module_init(stnic_probe);
-/* No cleanup routine. */
+module_exit(stnic_cleanup);
 MODULE_LICENSE("GPL");
--- diff/drivers/net/sun3_82586.c	2003-05-21 11:50:15.000000000 +0100
+++ source/drivers/net/sun3_82586.c	2004-02-09 10:39:54.000000000 +0000
@@ -55,6 +55,7 @@
 
 #define DEBUG       /* debug on */
 #define SYSBUSVAL 0 /* 16 Bit */
+#define SUN3_82586_TOTAL_SIZE	PAGE_SIZE
 
 #define sun3_attn586()  {*(volatile unsigned char *)(dev->base_addr) |= IEOB_ATTEN; *(volatile unsigned char *)(dev->base_addr) &= ~IEOB_ATTEN;}
 #define sun3_reset586() {*(volatile unsigned char *)(dev->base_addr) = 0; udelay(100); *(volatile unsigned char *)(dev->base_addr) = IEOB_NORSET;}
@@ -277,10 +278,12 @@
 	memset((char *)p->scb,0,sizeof(struct scb_struct));
 }
 
-int __init sun3_82586_probe(struct net_device *dev)
+struct net_device * __init sun3_82586_probe(int unit)
 {
+	struct net_device *dev;
 	unsigned long ioaddr;
 	static int found = 0;
+	int err = -ENOMEM;
 	
 	/* check that this machine has an onboard 82586 */
 	switch(idprom->id_machtype) {
@@ -290,31 +293,51 @@
 		break;
 
 	default:
-		return(-ENODEV);
+		return ERR_PTR(-ENODEV);
 	}
 
-	if(found)
-		return -ENODEV;
+	if (found)
+		return ERR_PTR(-ENODEV);
 	
-	ioaddr = (unsigned long)ioremap(IE_OBIO, PAGE_SIZE);
+	ioaddr = (unsigned long)ioremap(IE_OBIO, SUN3_82586_TOTAL_SIZE);
+	if (!ioaddr)
+		return ERR_PTR(-ENOMEM);
 	found = 1;
 	
+	dev = alloc_etherdev(sizeof(struct priv));
+	if (!dev)
+		goto out;
+	if (unit >= 0) {
+		sprintf(dev->name, "eth%d", unit);
+		netdev_boot_setup_check(dev);
+	}
 	SET_MODULE_OWNER(dev);
 
 	dev->irq = IE_IRQ;
 	dev->base_addr = ioaddr;
-	if(sun3_82586_probe1(dev, ioaddr) == 0)
-		return 0;
-
-	return -ENODEV;
+	err = sun3_82586_probe1(dev, ioaddr);
+	if (err)
+		goto out1;
+	err = register_netdev(dev);
+	if (err)
+		goto out2;
+	return dev;
+
+out2:
+	release_region(ioaddr, SUN3_82586_TOTAL_SIZE);
+out1:
+	free_netdev(dev);
+out:
+	iounmap((void *)ioaddr);
+	return ERR_PTR(err);
 }
 
 static int __init sun3_82586_probe1(struct net_device *dev,int ioaddr)
 {
 	int i, size, retval;
 
-//	if (!request_region(ioaddr, SUN3_82586_TOTAL_SIZE, dev->name))
-//		return -EBUSY;
+	if (!request_region(ioaddr, SUN3_82586_TOTAL_SIZE, dev->name))
+		return -EBUSY;
 
 	/* copy in the ethernet address from the prom */
 	for(i = 0; i < 6 ; i++)
@@ -341,16 +364,6 @@
 		goto out;
 	}
 
-	dev->priv = (void *) kmalloc(sizeof(struct priv),GFP_KERNEL);
-	if(dev->priv == NULL) {
-		printk("%s: Ooops .. can't allocate private driver memory.\n",dev->name);
-		retval = -ENOMEM;
-		goto out;
-	}
-
-	/* warning: we don't free it on errors */
-	memset((char *) dev->priv,0,sizeof(struct priv));
-
 	((struct priv *) (dev->priv))->memtop = (char *)dvma_btov(dev->mem_start);
 	((struct priv *) (dev->priv))->base = (unsigned long) dvma_btov(0);
 	alloc586(dev);
@@ -374,11 +387,9 @@
 	dev->set_multicast_list = set_multicast_list;
 
 	dev->if_port 		= 0;
-
-	ether_setup(dev);
-
 	return 0;
 out:
+	release_region(ioaddr, SUN3_82586_TOTAL_SIZE);
 	return retval;
 }
 
@@ -1138,21 +1149,23 @@
 
 #ifdef MODULE
 #error This code is not currently supported as a module
-static struct net_device dev_sun3_82586;
+static struct net_device *dev_sun3_82586;
 
 int init_module(void)
 {
-	dev_sun3_82586.init = sun3_82586_probe;
-	if (register_netdev(&dev_sun3_82586) != 0)
-		return -EIO;
+	dev_sun3_82586 = sun3_82586_probe(-1);
+	if (IS_ERR(dev_sun3_82586))
+		return PTR_ERR(dev_sun3_82586);
 	return 0;
 }
 
 void cleanup_module(void)
 {
-	unregister_netdev(&dev_sun3_82586);
-	kfree(dev_sun3_82586.priv);
-	dev_sun3_82586.priv = NULL;
+	unsigned long ioaddr = dev_sun3_82586->base_addr;
+	unregister_netdev(dev_sun3_82586);
+	release_region(ioaddr, SUN3_82586_TOTAL_SIZE);
+	iounmap((void *)ioaddr);
+	free_netdev(dev_sun3_82586);
 }
 #endif /* MODULE */
 
--- diff/drivers/net/sun3lance.c	2003-06-09 14:18:19.000000000 +0100
+++ source/drivers/net/sun3lance.c	2004-02-09 10:39:54.000000000 +0000
@@ -246,9 +246,11 @@
 
 /************************* End of Prototypes **************************/
 
-int __init sun3lance_probe( struct net_device *dev )
-{	
+struct net_device * __init sun3lance_probe(int unit)
+{
+	struct net_device *dev;
 	static int found;
+	int err = -ENODEV;
 
 	/* check that this machine has an onboard lance */
 	switch(idprom->id_machtype) {
@@ -259,18 +261,37 @@
 		break;
 
 	default:
-		return(-ENODEV);
+		return ERR_PTR(-ENODEV);
 	}
 
-	if(found)
-		return(-ENODEV);
+	if (found)
+		return ERR_PTR(-ENODEV);
 
-	if (lance_probe(dev)) {
-			found = 1;
-			return( 0 );
+	dev = alloc_etherdev(sizeof(struct lance_private));
+	if (!dev)
+		return ERR_PTR(-ENOMEM);
+	if (unit >= 0) {
+		sprintf(dev->name, "eth%d", unit);
+		netdev_boot_setup_check(dev);
 	}
+	SET_MODULE_OWNER(dev);
+
+	if (!lance_probe(dev))
+		goto out;
 
-	return( -ENODEV );
+	err = register_netdev(dev);
+	if (err)
+		goto out1;
+	found = 1;
+	return dev;
+
+out1:
+#ifdef CONFIG_SUN3
+	iounmap((void *)dev->base_addr);
+#endif
+out:
+	free_netdev(dev);
+	return ERR_PTR(err);
 }
 
 static int __init lance_probe( struct net_device *dev)
@@ -285,6 +306,8 @@
 
 #ifdef CONFIG_SUN3
 	ioaddr = (unsigned long)ioremap(LANCE_OBIO, PAGE_SIZE);
+	if (!ioaddr)
+		return 0;
 #else
 	ioaddr = SUN3X_LANCE;
 #endif
@@ -303,17 +326,15 @@
 		ioaddr_probe[0] = tmp1;
 		ioaddr_probe[1] = tmp2;
 
+#ifdef CONFIG_SUN3
+		iounmap((void *)ioaddr);
+#endif
 		return 0;
 	}
 
-	init_etherdev( dev, sizeof(struct lance_private) );
-	if (!dev->priv) {
-		dev->priv = kmalloc( sizeof(struct lance_private), GFP_KERNEL );
-		if (!dev->priv)
-			return 0;
-	}
 	lp = (struct lance_private *)dev->priv;
 
+	/* XXX - leak? */
 	MEM = dvma_malloc_align(sizeof(struct lance_memory), 0x10000);
 
 	lp->iobase = (volatile unsigned short *)ioaddr;
@@ -921,32 +942,24 @@
 
 
 #ifdef MODULE
-static char devicename[9];
 
-static struct net_device sun3lance_dev =
-{
-	devicename,	/* filled in by register_netdev() */
-	0, 0, 0, 0,	/* memory */
-	0, 0,		/* base, irq */
-	0, 0, 0, NULL, sun3lance_probe,
-};
+static struct net_device *sun3lance_dev;
 
 int init_module(void)
 {
-	int err;
-
-	if ((err = register_netdev( &sun3lance_dev ))) {
-		if (err == -EIO)  {
-			printk( "SUN3 Lance not detected.  Module not loaded.\n");
-		}
-		return( err );
-	}
-	return( 0 );
+	sun3lance_dev = sun3lance_probe(-1);
+	if (IS_ERR(sun3lance_dev))
+		return PTR_ERR(sun3lance_dev);
+	return 0;
 }
 
 void cleanup_module(void)
 {
-	unregister_netdev( &sun3lance_dev );
+	unregister_netdev(sun3lance_dev);
+#ifdef CONFIG_SUN3
+	iounmap((void *)sun3lance_dev->base_addr);
+#endif
+	free_netdev(sun3lance_dev);
 }
 
 #endif /* MODULE */
--- diff/drivers/net/sundance.c	2003-09-17 12:28:08.000000000 +0100
+++ source/drivers/net/sundance.c	2004-02-09 10:39:54.000000000 +0000
@@ -986,8 +986,8 @@
 	{
 		int i;
 		for (i=0; i<TX_RING_SIZE; i++) {
-			printk(KERN_DEBUG "%02x %08Zx %08x %08x(%02x) %08x %08x\n", i,
-				np->tx_ring_dma + i*sizeof(*np->tx_ring),
+			printk(KERN_DEBUG "%02x %08llx %08x %08x(%02x) %08x %08x\n", i,
+				(unsigned long long)np->tx_ring_dma + i*sizeof(*np->tx_ring),
 				le32_to_cpu(np->tx_ring[i].next_desc),
 				le32_to_cpu(np->tx_ring[i].status),
 				(le32_to_cpu(np->tx_ring[i].status) >> 2) & 0xff,
@@ -1136,7 +1136,7 @@
 static int
 reset_tx (struct net_device *dev)
 {
-	struct netdev_private *np = (struct netdev_private*) dev->priv;
+	struct netdev_private *np = dev->priv;
 	long ioaddr = dev->base_addr;
 	struct sk_buff *skb;
 	int i;
@@ -1672,8 +1672,8 @@
 	switch (cmd) {
 		case SIOCDEVPRIVATE:
 		for (i=0; i<TX_RING_SIZE; i++) {
-			printk(KERN_DEBUG "%02x %08Zx %08x %08x(%02x) %08x %08x\n", i,
-				np->tx_ring_dma + i*sizeof(*np->tx_ring),	
+			printk(KERN_DEBUG "%02x %08llx %08x %08x(%02x) %08x %08x\n", i,
+				(unsigned long long)np->tx_ring_dma + i*sizeof(*np->tx_ring),	
 				le32_to_cpu(np->tx_ring[i].next_desc),
 				le32_to_cpu(np->tx_ring[i].status),
 				(le32_to_cpu(np->tx_ring[i].status) >> 2) 
--- diff/drivers/net/tc35815.c	2003-09-30 15:46:16.000000000 +0100
+++ source/drivers/net/tc35815.c	2004-02-09 10:39:54.000000000 +0000
@@ -463,7 +463,6 @@
 static void 	tc35815_chip_reset(struct net_device *dev);
 static void 	tc35815_chip_init(struct net_device *dev);
 static void 	tc35815_phy_chip_init(struct net_device *dev);
-static int 	tc35815_proc_info(char *buffer, char **start, off_t offset, int length, int *eof, void *data);
 
 /* A list of all installed tc35815 devices. */
 static struct net_device *root_tc35815_dev = NULL;
@@ -482,78 +481,76 @@
 tc35815_probe(struct pci_dev *pdev,
 		const struct pci_device_id *ent)
 {
-	static int called = 0;
 	int err = 0;
 	int ret;
+	unsigned long pci_memaddr;
+	unsigned int pci_irq_line;
 
-	if (called)
-		return -ENODEV;
-	called++;
+	printk(KERN_INFO "tc35815_probe: found device %#08x.%#08x\n", ent->vendor, ent->device);
 
-	if (pdev) {
-		unsigned int pci_memaddr;
-		unsigned int pci_irq_line;
+	err = pci_enable_device(pdev);
+	if (err)
+		return err;
 
-		printk(KERN_INFO "tc35815_probe: found device %#08x.%#08x\n", ent->vendor, ent->device);
+        pci_memaddr = pci_resource_start (pdev, 1);
 
-	        pci_memaddr = pci_resource_start (pdev, 1);
+        printk(KERN_INFO "    pci_memaddr=%#08lx  resource_flags=%#08lx\n", pci_memaddr, pci_resource_flags (pdev, 0));
 
-	        printk(KERN_INFO "    pci_memaddr=%#08lx  resource_flags=%#08lx\n", pci_memaddr, pci_resource_flags (pdev, 0));
+	if (!pci_memaddr) {
+		printk(KERN_WARNING "no PCI MEM resources, aborting\n");
+		ret = -ENODEV;
+		goto err_out;
+	}
+	pci_irq_line = pdev->irq;
+	/* irq disabled. */
+	if (pci_irq_line == 0) {
+		printk(KERN_WARNING "no PCI irq, aborting\n");
+		ret = -ENODEV;
+		goto err_out;
+	}
 
-		if (!pci_memaddr) {
-			printk(KERN_WARNING "no PCI MEM resources, aborting\n");
-			return -ENODEV;
-		}
-		pci_irq_line = pdev->irq;
-		/* irq disabled. */
-		if (pci_irq_line == 0) {
-			printk(KERN_WARNING "no PCI irq, aborting\n");
-			return -ENODEV;
-		}
+	ret =  tc35815_probe1(pdev, pci_memaddr, pci_irq_line);
+	if (ret)
+		goto err_out;
 
-		ret =  tc35815_probe1(pdev, pci_memaddr, pci_irq_line);
+	pci_set_master(pdev);
 
-		if (!ret) {
-			if ((err = pci_enable_device(pdev)) < 0) {
-			    printk(KERN_ERR "tc35815_probe: failed to enable device -- err=%d\n", err);
-			    return err;
-			}
-			pci_set_master(pdev);
-		}
+	return 0;
 
-		return ret;
-	}
-	return -ENODEV;
+err_out:
+	pci_disable_device(pdev);
+	return ret;
 }
 
 static int __devinit tc35815_probe1(struct pci_dev *pdev, unsigned int base_addr, unsigned int irq)
 {
 	static unsigned version_printed = 0;
-	int i;
+	int i, ret;
 	struct tc35815_local *lp;
 	struct tc35815_regs *tr;
 	struct net_device *dev;
 
 	/* Allocate a new 'dev' if needed. */
-	dev = init_etherdev(NULL, sizeof(struct tc35815_local));
+	dev = alloc_etherdev(sizeof(struct tc35815_local));
 	if (dev == NULL)
 		return -ENOMEM;
 
 	/*
-	 * init_etherdev allocs and zeros dev->priv
+	 * alloc_etherdev allocs and zeros dev->priv
 	 */
 	lp = dev->priv;
 
 	if (tc35815_debug  &&  version_printed++ == 0)
 		printk(KERN_DEBUG "%s", version);
 
-	printk(KERN_INFO "%s: %s found at %#x, irq %d\n",
-	       dev->name, cardname, base_addr, irq);
-
 	/* Fill in the 'dev' fields. */
 	dev->irq = irq;
 	dev->base_addr = (unsigned long)ioremap(base_addr,
 						sizeof(struct tc35815_regs));
+	if (!dev->base_addr) {
+		ret = -ENOMEM;
+		goto err_out;
+	}
 	tr = (struct tc35815_regs*)dev->base_addr;
 
 	tc35815_chip_reset(dev);
@@ -570,9 +567,6 @@
 		dev->dev_addr[i] = data & 0xff;
 		dev->dev_addr[i+1] = data >> 8;
 	}
-	for (i = 0; i < 6; i++)
-		printk(" %2.2x", dev->dev_addr[i]);
-	printk("\n");
 
 	/* Initialize the device structure. */
 	lp->pdev = pdev;
@@ -594,8 +588,6 @@
 
 	/* do auto negotiation */
 	tc35815_phy_chip_init(dev);
-	printk(KERN_INFO "%s: linkspeed %dMbps, %s Duplex\n",
-	       dev->name, lp->linkspeed, lp->fullduplex ? "Full" : "Half");
 
 	dev->open		= tc35815_open;
 	dev->stop		= tc35815_close;
@@ -604,20 +596,34 @@
 	dev->hard_start_xmit	= tc35815_send_packet;
 	dev->get_stats		= tc35815_get_stats;
 	dev->set_multicast_list = tc35815_set_multicast_list;
+	SET_MODULE_OWNER(dev);
 
-#if 0	/* XXX called in init_etherdev */
-	/* Fill in the fields of the device structure with ethernet values. */
-	ether_setup(dev);
-#endif
+	ret = register_netdev(dev);
+	if (ret)
+		goto err_out_iounmap;
+
+	printk(KERN_INFO "%s: %s found at %#x, irq %d, MAC",
+	       dev->name, cardname, base_addr, irq);
+	for (i = 0; i < 6; i++)
+		printk(" %2.2x", dev->dev_addr[i]);
+	printk("\n");
+	printk(KERN_INFO "%s: linkspeed %dMbps, %s Duplex\n",
+	       dev->name, lp->linkspeed, lp->fullduplex ? "Full" : "Half");
 
 	return 0;
+
+err_out_iounmap:
+	iounmap((void *) dev->base_addr);
+err_out:
+	free_netdev(dev);
+	return ret;
 }
 
 
 static int
 tc35815_init_queues(struct net_device *dev)
 {
-	struct tc35815_local *lp = (struct tc35815_local *)dev->priv;
+	struct tc35815_local *lp = dev->priv;
 	int i;
 	unsigned long fd_addr;
 
@@ -702,7 +708,7 @@
 static void
 tc35815_clear_queues(struct net_device *dev)
 {
-	struct tc35815_local *lp = (struct tc35815_local *)dev->priv;
+	struct tc35815_local *lp = dev->priv;
 	int i;
 
 	for (i = 0; i < TX_FD_NUM; i++) {
@@ -719,7 +725,7 @@
 static void
 tc35815_free_queues(struct net_device *dev)
 {
-	struct tc35815_local *lp = (struct tc35815_local *)dev->priv;
+	struct tc35815_local *lp = dev->priv;
 	int i;
 
 	if (lp->tfd_base) {
@@ -805,7 +811,7 @@
 static void
 panic_queues(struct net_device *dev)
 {
-	struct tc35815_local *lp = (struct tc35815_local *)dev->priv;
+	struct tc35815_local *lp = dev->priv;
 	int i;
 
 	printk("TxFD base %p, start %d, end %d\n",
@@ -823,6 +829,7 @@
 	panic("%s: Illegal queue state.", dev->name);
 }
 
+#if 0
 static void print_buf(char *add, int length)
 {
 	int i;
@@ -839,6 +846,7 @@
 	}
 	printk("\n");
 }
+#endif
 
 static void print_eth(char *add)
 {
@@ -864,7 +872,7 @@
 static int
 tc35815_open(struct net_device *dev)
 {
-	struct tc35815_local *lp = (struct tc35815_local *)dev->priv;
+	struct tc35815_local *lp = dev->priv;
 	/*
 	 * This is used if the interrupt line can turned off (shared).
 	 * See 3c503.c for an example of selecting the IRQ at config-time.
@@ -888,19 +896,17 @@
 	lp->tbusy = 0;
 	netif_start_queue(dev);
 
-	MOD_INC_USE_COUNT;
-
 	return 0;
 }
 
 static void tc35815_tx_timeout(struct net_device *dev)
 {
-	struct tc35815_local *lp = (struct tc35815_local *)dev->priv;
+	struct tc35815_local *lp = dev->priv;
 	struct tc35815_regs *tr = (struct tc35815_regs *)dev->base_addr;
-	int flags;
+	unsigned long flags;
 
 	spin_lock_irqsave(&lp->lock, flags);
-	printk(KERN_WARNING "%s: transmit timed out, status %#x\n",
+	printk(KERN_WARNING "%s: transmit timed out, status %#lx\n",
 	       dev->name, tc_readl(&tr->Tx_Stat));
 	/* Try to restart the adaptor. */
 	tc35815_chip_reset(dev);
@@ -914,7 +920,7 @@
 
 static int tc35815_send_packet(struct sk_buff *skb, struct net_device *dev)
 {
-	struct tc35815_local *lp = (struct tc35815_local *)dev->priv;
+	struct tc35815_local *lp = dev->priv;
 	struct tc35815_regs *tr = (struct tc35815_regs *)dev->base_addr;
 
 	if (netif_queue_stopped(dev)) {
@@ -925,7 +931,7 @@
 		int tickssofar = jiffies - dev->trans_start;
 		if (tickssofar < 5)
 			return 1;
-		printk(KERN_WARNING "%s: transmit timed out, status %#x\n",
+		printk(KERN_WARNING "%s: transmit timed out, status %#lx\n",
 		       dev->name, tc_readl(&tr->Tx_Stat));
 		/* Try to restart the adaptor. */
 		tc35815_chip_reset(dev);
@@ -947,7 +953,7 @@
 		short length = ETH_ZLEN < skb->len ? skb->len : ETH_ZLEN;
 		unsigned char *buf = skb->data;
 		struct TxFD *txfd = &lp->tfd_base[lp->tfd_start];
-		int flags;
+		unsigned long flags;
 		lp->stats.tx_bytes += skb->len;
 
 
@@ -1051,7 +1057,7 @@
 	}
 
 	tr = (struct tc35815_regs*)dev->base_addr;
-	lp = (struct tc35815_local *)dev->priv;
+	lp = dev->priv;
 
 	do {
 		status = tc_readl(&tr->Int_Src);
@@ -1107,7 +1113,7 @@
 static void
 tc35815_rx(struct net_device *dev)
 {
-	struct tc35815_local *lp = (struct tc35815_local *)dev->priv;
+	struct tc35815_local *lp = dev->priv;
 	struct tc35815_regs *tr = (struct tc35815_regs*)dev->base_addr;
 	unsigned int fdctl;
 	int i;
@@ -1157,7 +1163,9 @@
 				offset += len;
 				cur_bd++;
 			}
-	//		print_buf(data,pkt_len);
+#if 0
+			print_buf(data,pkt_len);
+#endif
 			if (tc35815_debug > 3)
 				print_eth(data);
 			skb->protocol = eth_type_trans(skb, dev);
@@ -1247,7 +1255,7 @@
 static void
 tc35815_check_tx_stat(struct net_device *dev, int status)
 {
-	struct tc35815_local *lp = (struct tc35815_local *)dev->priv;
+	struct tc35815_local *lp = dev->priv;
 	const char *msg = NULL;
 
 	/* count collisions */
@@ -1304,7 +1312,7 @@
 static void
 tc35815_txdone(struct net_device *dev)
 {
-	struct tc35815_local *lp = (struct tc35815_local *)dev->priv;
+	struct tc35815_local *lp = dev->priv;
 	struct tc35815_regs *tr = (struct tc35815_regs*)dev->base_addr;
 	struct TxFD *txfd;
 	unsigned int fdctl;
@@ -1379,7 +1387,7 @@
 static int
 tc35815_close(struct net_device *dev)
 {
-	struct tc35815_local *lp = (struct tc35815_local *)dev->priv;
+	struct tc35815_local *lp = dev->priv;
 
 	lp->tbusy = 1;
 	netif_stop_queue(dev);
@@ -1391,8 +1399,6 @@
 
 	tc35815_free_queues(dev);
 
-	MOD_DEC_USE_COUNT;
-
 	return 0;
 }
 
@@ -1402,7 +1408,7 @@
  */
 static struct net_device_stats *tc35815_get_stats(struct net_device *dev)
 {
-	struct tc35815_local *lp = (struct tc35815_local *)dev->priv;
+	struct tc35815_local *lp = dev->priv;
 	struct tc35815_regs *tr = (struct tc35815_regs*)dev->base_addr;
 	unsigned long flags;
 
@@ -1456,7 +1462,7 @@
 		int i;
 		for (i = cam_index / 4; i < cam_index / 4 + 2; i++) {
 			tc_writel(i * 4, &tr->CAM_Adr);
-			printk("CAM 0x%x: %08x",
+			printk("CAM 0x%x: %08lx",
 			       i * 4, tc_readl(&tr->CAM_Data));
 		}
 	}
@@ -1513,9 +1519,9 @@
 
 static unsigned long tc_phy_read(struct net_device *dev, struct tc35815_regs *tr, int phy, int phy_reg)
 {
-	struct tc35815_local *lp = (struct tc35815_local *)dev->priv;
+	struct tc35815_local *lp = dev->priv;
 	unsigned long data;
-	int flags;
+	unsigned long flags;
 	
 	spin_lock_irqsave(&lp->lock, flags);
 
@@ -1529,8 +1535,8 @@
 
 static void tc_phy_write(struct net_device *dev, unsigned long d, struct tc35815_regs *tr, int phy, int phy_reg)
 {
-	struct tc35815_local *lp = (struct tc35815_local *)dev->priv;
-	int flags;
+	struct tc35815_local *lp = dev->priv;
+	unsigned long flags;
 
 	spin_lock_irqsave(&lp->lock, flags);
 
@@ -1543,7 +1549,7 @@
 
 static void tc35815_phy_chip_init(struct net_device *dev)
 {
-	struct tc35815_local *lp = (struct tc35815_local *)dev->priv;
+	struct tc35815_local *lp = dev->priv;
 	struct tc35815_regs *tr = (struct tc35815_regs*)dev->base_addr;
 	static int first = 1;
 	unsigned short ctl;
@@ -1648,9 +1654,9 @@
 
 static void tc35815_chip_init(struct net_device *dev)
 {
-	struct tc35815_local *lp = (struct tc35815_local *)dev->priv;
+	struct tc35815_local *lp = dev->priv;
 	struct tc35815_regs *tr = (struct tc35815_regs*)dev->base_addr;
-	int flags;
+	unsigned long flags;
 	unsigned long txctl = TX_CTL_CMD;
 
 	tc35815_phy_chip_init(dev);
@@ -1696,40 +1702,6 @@
 	spin_unlock_irqrestore(&lp->lock, flags);
 }
 
-static int tc35815_proc_info(char *buffer, char **start, off_t offset, int length, int *eof, void *data)
-{
-	int len = 0;
-	off_t pos = 0;
-	off_t begin = 0;
-	struct net_device *dev;
-
-	len += sprintf(buffer, "TC35815 statistics:\n");
-	for (dev = root_tc35815_dev; dev; dev = ((struct tc35815_local *)dev->priv)->next_module) {
-		struct tc35815_local *lp = (struct tc35815_local *)dev->priv;
-		len += sprintf(buffer + len,
-			       "%s: tx_ints %d, rx_ints %d, max_tx_qlen %d\n",
-			       dev->name,
-			       lp->lstats.tx_ints,
-			       lp->lstats.rx_ints,
-			       lp->lstats.max_tx_qlen);
-		pos = begin + len;
-
-		if (pos < offset) {
-			len = 0;
-			begin = pos;
-		}
-    
-		if (pos > offset+length) break;
-	}
-
-	*start = buffer + (offset - begin);
-	len -= (offset - begin);
-  
-	if (len > length) len = length;
-  
-	return len;
-}
-
 /* XXX */
 void
 tc35815_killall(void)
--- diff/drivers/net/tg3.c	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/net/tg3.c	2004-02-09 10:39:54.000000000 +0000
@@ -2479,6 +2479,13 @@
 static int tg3_init_hw(struct tg3 *);
 static int tg3_halt(struct tg3 *);
 
+#ifdef CONFIG_NET_POLL_CONTROLLER
+static void tg3_poll_controller(struct net_device *dev)
+{
+	tg3_interrupt(dev->irq, dev, NULL);
+}
+#endif
+
 static void tg3_reset_task(void *_data)
 {
 	struct tg3 *tp = _data;
@@ -5850,10 +5857,12 @@
 	return TG3_REGDUMP_LEN;
 }
 
-static void tg3_get_regs(struct net_device *dev, struct ethtool_regs *regs, void *p)
+static void tg3_get_regs(struct net_device *dev,
+		struct ethtool_regs *regs, void *_p)
 {
+	u32 *p = _p;
 	struct tg3 *tp = dev->priv;
-	u8 *orig_p = p;
+	u8 *orig_p = _p;
 	int i;
 
 	regs->version = 0;
@@ -5863,15 +5872,15 @@
 	spin_lock_irq(&tp->lock);
 	spin_lock(&tp->tx_lock);
 
-#define __GET_REG32(reg)	(*((u32 *)(p))++ = tr32(reg))
+#define __GET_REG32(reg)	(*(p)++ = tr32(reg))
 #define GET_REG32_LOOP(base,len)		\
-do {	p = orig_p + (base);			\
+do {	p = (u32 *)(orig_p + (base));		\
 	for (i = 0; i < len; i += 4)		\
 		__GET_REG32((base) + i);	\
 } while (0)
-#define GET_REG32_1(reg)	\
-do {	p = orig_p + (reg);	\
-	__GET_REG32((reg));	\
+#define GET_REG32_1(reg)			\
+do {	p = (u32 *)(orig_p + (reg));		\
+	__GET_REG32((reg));			\
 } while (0)
 
 	GET_REG32_LOOP(TG3PCI_VENDOR, 0xb0);
@@ -7694,6 +7703,9 @@
 	dev->watchdog_timeo = TG3_TX_TIMEOUT;
 	dev->change_mtu = tg3_change_mtu;
 	dev->irq = pdev->irq;
+#ifdef CONFIG_NET_POLL_CONTROLLER
+	dev->poll_controller = tg3_poll_controller;
+#endif
 
 	err = tg3_get_invariants(tp);
 	if (err) {
--- diff/drivers/net/tlan.c	2003-11-25 15:24:58.000000000 +0000
+++ source/drivers/net/tlan.c	2004-02-09 10:39:54.000000000 +0000
@@ -814,6 +814,14 @@
 
 } /* TLan_EisaProbe */
 
+#ifdef CONFIG_NET_POLL_CONTROLLER
+static void TLan_Poll(struct net_device *dev)
+{
+	disable_irq(dev->irq);
+	TLan_HandleInterrupt(dev->irq, dev, NULL);
+	enable_irq(dev->irq);
+}
+#endif
 
 	
 
@@ -893,6 +901,9 @@
 	dev->get_stats = &TLan_GetStats;
 	dev->set_multicast_list = &TLan_SetMulticastList;
 	dev->do_ioctl = &TLan_ioctl;
+#ifdef CONFIG_NET_POLL_CONTROLLER
+	dev->poll_controller = &TLan_Poll;
+#endif
 	dev->tx_timeout = &TLan_tx_timeout;
 	dev->watchdog_timeo = TX_TIMEOUT;
 
--- diff/drivers/net/tokenring/3c359.c	2003-08-26 10:00:53.000000000 +0100
+++ source/drivers/net/tokenring/3c359.c	2004-02-09 10:39:54.000000000 +0000
@@ -314,7 +314,6 @@
 
 	dev->irq=pdev->irq;
 	dev->base_addr=pci_resource_start(pdev,0) ; 
-	dev->init=NULL ; /* Must be null with new api, otherwise get called twice */
 	xl_priv->xl_card_name = pci_name(pdev);
 	xl_priv->xl_mmio=ioremap(pci_resource_start(pdev,1), XL_IO_SPACE);
 	xl_priv->pdev = pdev ; 
@@ -332,7 +331,7 @@
 		
 	if((i = xl_init(dev))) {
 		iounmap(xl_priv->xl_mmio) ; 
-		kfree(dev) ; 
+		free_netdev(dev) ; 
 		pci_release_regions(pdev) ; 
 		return i ; 
 	}				
@@ -352,7 +351,7 @@
 		printk(KERN_ERR "3C359, register netdev failed\n") ;  
 		pci_set_drvdata(pdev,NULL) ; 
 		iounmap(xl_priv->xl_mmio) ; 
-		kfree(dev) ; 
+		free_netdev(dev) ; 
 		pci_release_regions(pdev) ; 
 		return i ; 
 	}
@@ -1130,7 +1129,7 @@
 				xl_freemem(dev) ; 
 				free_irq(dev->irq,dev); 
 				unregister_netdev(dev) ; 
-				kfree(dev) ;  
+				free_netdev(dev) ;  
 				xl_reset(dev) ; 
 				writel(ACK_INTERRUPT | LATCH_ACK, xl_mmio + MMIO_COMMAND) ; 
 				spin_unlock(&xl_priv->xl_lock) ; 
--- diff/drivers/net/tokenring/abyss.c	2003-09-30 15:46:16.000000000 +0100
+++ source/drivers/net/tokenring/abyss.c	2004-02-09 10:39:54.000000000 +0000
@@ -181,7 +181,7 @@
 err_out_region:
 	release_region(pci_ioaddr, ABYSS_IO_EXTENT);
 err_out_trdev:
-	kfree(dev);
+	free_netdev(dev);
 	return ret;
 }
 
--- diff/drivers/net/tokenring/ibmtr.c	2003-11-25 15:24:58.000000000 +0000
+++ source/drivers/net/tokenring/ibmtr.c	2004-02-09 10:39:54.000000000 +0000
@@ -187,7 +187,7 @@
 #define TRC_INITV 0x02		/*  verbose init trace points     */
 unsigned char ibmtr_debug_trace = 0;
 
-int 		ibmtr_probe(struct net_device *dev);
+static int 	ibmtr_probe(struct net_device *dev);
 static int	ibmtr_probe1(struct net_device *dev, int ioaddr);
 static unsigned char get_sram_size(struct tok_info *adapt_info);
 static int 	trdev_init(struct net_device *dev);
@@ -313,6 +313,39 @@
 	}
 }
 
+static void ibmtr_cleanup_card(struct net_device *dev)
+{
+	if (dev->base_addr) {
+		outb(0,dev->base_addr+ADAPTRESET);
+		
+		schedule_timeout(TR_RST_TIME); /* wait 50ms */
+
+		outb(0,dev->base_addr+ADAPTRESETREL);
+	}
+
+#ifndef PCMCIA
+	free_irq(dev->irq, dev);
+	release_region(dev->base_addr, IBMTR_IO_EXTENT);
+
+	{ 
+		struct tok_info *ti = (struct tok_info *) dev->priv;
+		iounmap((u32 *)ti->mmio);
+		iounmap((u32 *)ti->sram_virt);
+	}
+#endif		
+}
+
+int ibmtr_probe_card(struct net_device *dev)
+{
+	int err = ibmtr_probe(dev);
+	if (!err) {
+		err = register_netdev(dev);
+		if (err)
+			ibmtr_cleanup_card(dev);
+	}
+	return err;
+}
+
 /****************************************************************************
  *	ibmtr_probe():  Routine specified in the network device structure
  *	to probe for an IBM Token Ring Adapter.  Routine outline:
@@ -325,7 +358,7 @@
  *	which references it.
  ****************************************************************************/
 
-int __devinit ibmtr_probe(struct net_device *dev)
+static int ibmtr_probe(struct net_device *dev)
 {
 	int i;
 	int base_addr = dev->base_addr;
@@ -1925,23 +1958,24 @@
 	find_turbo_adapters(io);
 
 	for (i = 0; io[i] && (i < IBMTR_MAX_ADAPTERS); i++) {
+		struct net_device *dev;
 		irq[i] = 0;
 		mem[i] = 0;
-		dev_ibmtr[i] = alloc_trdev(sizeof(struct tok_info));
-		if (dev_ibmtr[i] == NULL) { 
+		dev = alloc_trdev(sizeof(struct tok_info));
+		if (dev == NULL) { 
 			if (i == 0)
 				return -ENOMEM;
 			break;
 		}
-		dev_ibmtr[i]->base_addr = io[i];
-		dev_ibmtr[i]->irq = irq[i];
-		dev_ibmtr[i]->mem_start = mem[i];
-		dev_ibmtr[i]->init = &ibmtr_probe;
-		if (register_netdev(dev_ibmtr[i]) != 0) {
-			kfree(dev_ibmtr[i]);
-			dev_ibmtr[i] = NULL;
+		dev->base_addr = io[i];
+		dev->irq = irq[i];
+		dev->mem_start = mem[i];
+
+		if (ibmtr_probe_card(dev)) {
+			free_netdev(dev);
 			continue;
 		}
+		dev_ibmtr[i] = dev;
 		count++;
 	}
 	if (count) return 0;
@@ -1957,27 +1991,9 @@
 	for (i = 0; i < IBMTR_MAX_ADAPTERS; i++){
 		if (!dev_ibmtr[i])
 			continue;
-		if (dev_ibmtr[i]->base_addr) {
-			outb(0,dev_ibmtr[i]->base_addr+ADAPTRESET);
-			
-			schedule_timeout(TR_RST_TIME); /* wait 50ms */
-
-                        outb(0,dev_ibmtr[i]->base_addr+ADAPTRESETREL);
-                }
-
 		unregister_netdev(dev_ibmtr[i]);
-		free_irq(dev_ibmtr[i]->irq, dev_ibmtr[i]);
-		release_region(dev_ibmtr[i]->base_addr, IBMTR_IO_EXTENT);
-#ifndef PCMCIA
-		{ 
-			struct tok_info *ti = (struct tok_info *)
-				dev_ibmtr[i]->priv;
-			iounmap((u32 *)ti->mmio);
-			iounmap((u32 *)ti->sram_virt);
-		}
-#endif		
+		ibmtr_cleanup_card(dev_ibmtr[i]);
 		free_netdev(dev_ibmtr[i]);
-		dev_ibmtr[i] = NULL;
 	}
 }
 module_exit(ibmtr_cleanup);
--- diff/drivers/net/tokenring/madgemc.c	2003-10-09 09:47:34.000000000 +0100
+++ source/drivers/net/tokenring/madgemc.c	2004-02-09 10:39:54.000000000 +0000
@@ -197,7 +197,7 @@
 		card = kmalloc(sizeof(struct madgemc_card), GFP_KERNEL);
 		if (card==NULL) {
 			printk("madgemc: unable to allocate card struct\n");
-			kfree(dev);
+			free_netdev(dev);
 			if (madgemc_card_list)
 				return 0;
 			return -1;
@@ -360,7 +360,7 @@
 			
 			kfree(card);
 			tmsdev_term(dev);
-			kfree(dev);
+			free_netdev(dev);
 			if (madgemc_card_list)
 				return 0;
 			return -1;
@@ -399,7 +399,7 @@
 			       MADGEMC_IO_EXTENT); 
 	getout1:
 		kfree(card);
-		kfree(dev);
+		free_netdev(dev);
 		slot++;
 	}
 
--- diff/drivers/net/tokenring/olympic.c	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/net/tokenring/olympic.c	2004-02-09 10:39:54.000000000 +0000
@@ -228,7 +228,6 @@
 #endif
 	dev->irq=pdev->irq;
 	dev->base_addr=pci_resource_start(pdev, 0);
-	dev->init=NULL; /* Must be NULL otherwise we get called twice */
 	olympic_priv->olympic_card_name = pci_name(pdev);
 	olympic_priv->pdev = pdev; 
 	olympic_priv->olympic_mmio = ioremap(pci_resource_start(pdev,1),256);
--- diff/drivers/net/tokenring/proteon.c	2003-09-30 15:46:16.000000000 +0100
+++ source/drivers/net/tokenring/proteon.c	2004-02-09 10:39:54.000000000 +0000
@@ -63,7 +63,7 @@
 
 static char cardname[] = "Proteon 1392\0";
 
-int proteon_probe(struct net_device *dev);
+struct net_device *proteon_probe(int unit);
 static int proteon_open(struct net_device *dev);
 static int proteon_close(struct net_device *dev);
 static void proteon_read_eeprom(struct net_device *dev);
@@ -89,80 +89,69 @@
 	outw(val, dev->base_addr + reg);
 }
 
-struct proteon_card {
-	struct net_device *dev;
-	struct proteon_card *next;
-};
-
-static struct proteon_card *proteon_card_list;
-
-static int __init proteon_probe1(int ioaddr)
+static int __init proteon_probe1(struct net_device *dev, int ioaddr)
 {
 	unsigned char chk1, chk2;
 	int i;
 
+	if (!request_region(ioaddr, PROTEON_IO_EXTENT, cardname))
+		return -ENODEV;
+		
+
 	chk1 = inb(ioaddr + 0x1f);      /* Get Proteon ID reg 1 */
-	if (chk1 != 0x1f)
-		return (-1);
+	if (chk1 != 0x1f) 
+		goto nodev;
+
 	chk1 = inb(ioaddr + 0x1e) & 0x07;       /* Get Proteon ID reg 0 */
 	for (i=0; i<16; i++) {
 		chk2 = inb(ioaddr + 0x1e) & 0x07;
 		if (((chk1 + 1) & 0x07) != chk2)
-			return (-1);
+			goto nodev;
 		chk1 = chk2;
 	}
+
+	dev->base_addr = ioaddr;
 	return (0);
+nodev:
+	release_region(ioaddr, PROTEON_IO_EXTENT); 
+	return -ENODEV;
 }
 
-int __init proteon_probe(struct net_device *dev)
+struct net_device * __init proteon_probe(int unit)
 {
-        static int versionprinted;
+	struct net_device *dev = alloc_trdev(sizeof(struct net_local));
 	struct net_local *tp;
-	int i,j;
-	struct proteon_card *card;
-
-#ifndef MODULE
-	netdev_boot_setup_check(dev);
-	tr_setup(dev);
-#endif
+        static int versionprinted;
+	const unsigned *port;
+	int j,err = 0;
 
-	SET_MODULE_OWNER(dev);
-	if (!dev->base_addr)
-	{
-		for(i = 0; portlist[i]; i++)
-		{
-			if (!request_region(portlist[i], PROTEON_IO_EXTENT, cardname))
-				continue;
+	if (!dev)
+		return ERR_PTR(-ENOMEM);
 
-			if(proteon_probe1(portlist[i]))
-			{
-				release_region(dev->base_addr, PROTEON_IO_EXTENT); 
-				continue;
-			}
+	if (unit >= 0) {
+		sprintf(dev->name, "tr%d", unit);
+		netdev_boot_setup_check(dev);
+	}
 
-			dev->base_addr = portlist[i];
-			break;
+	SET_MODULE_OWNER(dev);
+	if (dev->base_addr)	/* probe specific location */
+		err = proteon_probe1(dev, dev->base_addr);
+	else {
+		for (port = portlist; *port; port++) {
+			err = proteon_probe1(dev, *port);
+			if (!err)
+				break;
 		}
-		if(!dev->base_addr)
-			return -1;
 	}
-	else
-	{
-		if (!request_region(dev->base_addr, PROTEON_IO_EXTENT, cardname))
-			return -1;
-
-		if(proteon_probe1(dev->base_addr))
-		{
-			release_region(dev->base_addr, PROTEON_IO_EXTENT); 
-			return -1;
-  		}
-	} 
+	if (err)
+		goto out4;
 
 	/* At this point we have found a valid card. */
 
 	if (versionprinted++ == 0)
 		printk(KERN_DEBUG "%s", version);
 
+	err = -EIO;
 	if (tmsdev_init(dev, ISA_MAX_ADDRESS, NULL))
 		goto out4;
 
@@ -264,14 +253,11 @@
 	printk(KERN_DEBUG "%s:    IO: %#4lx  IRQ: %d  DMA: %d\n",
 	       dev->name, dev->base_addr, dev->irq, dev->dma);
 		
-	/* Enlist in the card list */
-	card = kmalloc(sizeof(struct proteon_card), GFP_KERNEL);
-	if (!card)
+	err = register_netdev(dev);
+	if (err)
 		goto out;
-	card->next = proteon_card_list;
-	proteon_card_list = card;
-	card->dev = dev;
-	return 0;
+
+	return dev;
 out:
 	free_dma(dev->dma);
 out2:
@@ -280,7 +266,8 @@
 	tmsdev_term(dev);
 out4:
 	release_region(dev->base_addr, PROTEON_IO_EXTENT); 
-	return -1;
+	free_netdev(dev);
+	return ERR_PTR(err);
 }
 
 /*
@@ -370,50 +357,50 @@
 MODULE_PARM(irq, "1-" __MODULE_STRING(ISATR_MAX_ADAPTERS) "i");
 MODULE_PARM(dma, "1-" __MODULE_STRING(ISATR_MAX_ADAPTERS) "i");
 
-static int __init setup_card(unsigned long io, unsigned irq, unsigned char dma)
+static struct net_device *proteon_dev[ISATR_MAX_ADAPTERS];
+
+static struct net_device * __init setup_card(unsigned long io, unsigned irq, unsigned char dma)
 {
-	int res = -ENOMEM;
-	struct proteon_card *this_card;
-	struct net_device *dev = alloc_trdev(0);
-
-	if (dev) {
-		dev->base_addr = io;
-		dev->irq       = irq;
-		dev->dma       = dma;
-		res = -ENODEV;
-		if (proteon_probe(dev) == 0) {
-			res = register_netdev(dev);
-			if (!res)
-				return 0;
-			release_region(dev->base_addr, PROTEON_IO_EXTENT);
-			free_irq(dev->irq, dev);
-			free_dma(dev->dma);
-			tmsdev_term(dev);
-			this_card = proteon_card_list;
-			proteon_card_list = this_card->next;
-			kfree(this_card);
-		}
-		kfree(dev);
-	}
-	return res;
+	struct net_device *dev = alloc_trdev(sizeof(struct net_local));
+	int err;
+
+	if (!dev)
+		return ERR_PTR(-ENOMEM);
+
+	dev->irq = irq;
+	dev->dma = dma;
+	err = proteon_probe1(dev, io);
+	if (err) 
+		goto out;
+		
+	err = register_netdev(dev);
+	if (err)
+		goto out1;
+	return dev;
+ out1:
+	release_region(dev->base_addr, PROTEON_IO_EXTENT);
+	free_irq(dev->irq, dev);
+	free_dma(dev->dma);
+	tmsdev_term(dev);
+ out:
+	free_netdev(dev);
+	return ERR_PTR(err);
 }
 
 int init_module(void)
 {
-	int i, num;
+	struct net_device *dev;
+	int i, num = 0;
 
-	num = 0;
-	if (io[0]) { /* Only probe addresses from command line */
-		for (i = 0; i < ISATR_MAX_ADAPTERS ; i++) {
-			if (io[i] && setup_card(io[i], irq[i], dma[i]) == 0)
-				num++;
-		}
-	} else {
-		for(i = 0; num < ISATR_MAX_ADAPTERS && portlist[i]; i++) {
-			if (setup_card(portlist[i], irq[num], dma[num]) == 0)
-				num++;
+	for (i = 0; i < ISATR_MAX_ADAPTERS ; i++) {
+		dev = io[0] ? setup_card(io[i], irq[i], dma[i])
+			: proteon_probe(-1);
+		if (!IS_ERR(dev)) {
+			proteon_dev[i] = dev;
+			++num;
 		}
 	}
+
 	printk(KERN_NOTICE "proteon.c: %d cards found.\n", num);
 	/* Probe for cards. */
 	if (num == 0) {
@@ -425,11 +412,13 @@
 
 void cleanup_module(void)
 {
-	struct net_device *dev;
-	struct proteon_card *this_card;
+	int i;
 
-	while (proteon_card_list) {
-		dev = proteon_card_list->dev;
+	for (i = 0; i < ISATR_MAX_ADAPTERS ; i++) {
+		struct net_device *dev = proteon_dev[i];
+		
+		if (!dev) 
+			continue;
 		
 		unregister_netdev(dev);
 		release_region(dev->base_addr, PROTEON_IO_EXTENT);
@@ -437,9 +426,6 @@
 		free_dma(dev->dma);
 		tmsdev_term(dev);
 		free_netdev(dev);
-		this_card = proteon_card_list;
-		proteon_card_list = this_card->next;
-		kfree(this_card);
 	}
 }
 #endif /* MODULE */
--- diff/drivers/net/tokenring/skisa.c	2003-09-30 15:46:16.000000000 +0100
+++ source/drivers/net/tokenring/skisa.c	2004-02-09 10:39:54.000000000 +0000
@@ -56,7 +56,7 @@
 /* A zero-terminated list of IRQs to be probed. 
  * Used again after initial probe for sktr_chipset_init, called from sktr_open.
  */
-static unsigned short irqlist[] = {
+static const unsigned short irqlist[] = {
 	3, 5, 9, 10, 11, 12, 15,
 	0
 };
@@ -69,7 +69,6 @@
 
 static char isa_cardname[] = "SK NET TR 4/16 ISA\0";
 
-int sk_isa_probe(struct net_device *dev);
 static int sk_isa_open(struct net_device *dev);
 static int sk_isa_close(struct net_device *dev);
 static void sk_isa_read_eeprom(struct net_device *dev);
@@ -95,17 +94,14 @@
 	outw(val, dev->base_addr + reg);
 }
 
-struct sk_isa_card {
-	struct net_device *dev;
-	struct sk_isa_card *next;
-};
-
-static struct sk_isa_card *sk_isa_card_list;
 
-static int __init sk_isa_probe1(int ioaddr)
+static int __init sk_isa_probe1(struct net_device *dev, int ioaddr)
 {
 	unsigned char old, chk1, chk2;
 
+	if (!request_region(ioaddr, SK_ISA_IO_EXTENT, isa_cardname))
+		return -ENODEV;
+
 	old = inb(ioaddr + SIFADR);	/* Get the old SIFADR value */
 
 	chk1 = 0;	/* Begin with check value 0 */
@@ -122,8 +118,10 @@
 		chk2 = inb(ioaddr + SIFADD);
 		chk2 ^= 0x0FE;
 
-		if(chk1 != chk2)
-			return (-1);	/* No adapter */
+		if(chk1 != chk2) {
+			release_region(ioaddr, SK_ISA_IO_EXTENT);
+			return -ENODEV;
+		}
 
 		chk1 -= 2;
 	} while(chk1 != 0);	/* Repeat 128 times (all byte values) */
@@ -131,58 +129,45 @@
     	/* Restore the SIFADR value */
 	outb(old, ioaddr + SIFADR);
 
-	return (0);
+	dev->base_addr = ioaddr;
+	return 0;
 }
 
-int __init sk_isa_probe(struct net_device *dev)
+struct net_device * __init sk_isa_probe(int unit)
 {
-        static int versionprinted;
+	struct net_device *dev = alloc_trdev(sizeof(struct net_local));
 	struct net_local *tp;
-	int i,j;
-	struct sk_isa_card *card;
+        static int versionprinted;
+	const unsigned *port;
+	int j, err = 0;
 
-#ifndef MODULE
-	netdev_boot_setup_check(dev);
-	tr_setup(dev);
-#endif
+	if (!dev)
+		return ERR_PTR(-ENOMEM);
 
-	SET_MODULE_OWNER(dev);
-	if (!dev->base_addr)
-	{
-		for(i = 0; portlist[i]; i++)
-		{
-			if (!request_region(portlist[i], SK_ISA_IO_EXTENT, isa_cardname))
-				continue;
-
-			if(sk_isa_probe1(portlist[i]))
-			{
-				release_region(dev->base_addr, SK_ISA_IO_EXTENT); 
-				continue;
-			}
+	if (unit >= 0) {
+		sprintf(dev->name, "tr%d", unit);
+		netdev_boot_setup_check(dev);
+	}
 
-			dev->base_addr = portlist[i];
-			break;
+	SET_MODULE_OWNER(dev);
+	if (dev->base_addr)	/* probe specific location */
+		err = sk_isa_probe1(dev, dev->base_addr);
+	else {
+		for (port = portlist; *port; port++) {
+			err = sk_isa_probe1(dev, *port);
+			if (!err)
+				break;
 		}
-		if(!dev->base_addr)
-			return -1;
 	}
-	else
-	{
-		if (!request_region(dev->base_addr, SK_ISA_IO_EXTENT, isa_cardname))
-			return -1;
-
-		if(sk_isa_probe1(dev->base_addr))
-		{
-			release_region(dev->base_addr, SK_ISA_IO_EXTENT); 
-			return -1;
-  		}
-	} 
+	if (err)
+		goto out4;
 
 	/* At this point we have found a valid card. */
 
 	if (versionprinted++ == 0)
 		printk(KERN_DEBUG "%s", version);
 
+	err = -EIO;
 	if (tmsdev_init(dev, ISA_MAX_ADDRESS, NULL))
 		goto out4;
 
@@ -284,14 +269,11 @@
 	printk(KERN_DEBUG "%s:    IO: %#4lx  IRQ: %d  DMA: %d\n",
 	       dev->name, dev->base_addr, dev->irq, dev->dma);
 		
-	/* Enlist in the card list */
-	card = kmalloc(sizeof(struct sk_isa_card), GFP_KERNEL);
-	if (!card)
+	err = register_netdev(dev);
+	if (err)
 		goto out;
-	card->next = sk_isa_card_list;
-	sk_isa_card_list = card;
-	card->dev = dev;
-	return 0;
+
+	return dev;
 out:
 	free_dma(dev->dma);
 out2:
@@ -300,7 +282,8 @@
 	tmsdev_term(dev);
 out4:
 	release_region(dev->base_addr, SK_ISA_IO_EXTENT); 
-	return -1;
+	free_netdev(dev);
+	return ERR_PTR(err);
 }
 
 /*
@@ -373,6 +356,8 @@
 
 #define ISATR_MAX_ADAPTERS 3
 
+static struct net_device *sk_isa_dev[ISATR_MAX_ADAPTERS];
+
 static int io[ISATR_MAX_ADAPTERS];
 static int irq[ISATR_MAX_ADAPTERS];
 static int dma[ISATR_MAX_ADAPTERS];
@@ -383,50 +368,54 @@
 MODULE_PARM(irq, "1-" __MODULE_STRING(ISATR_MAX_ADAPTERS) "i");
 MODULE_PARM(dma, "1-" __MODULE_STRING(ISATR_MAX_ADAPTERS) "i");
 
-static int __init setup_card(unsigned long io, unsigned irq, unsigned char dma)
+static struct net_device * __init setup_card(unsigned long io, unsigned irq, unsigned char dma)
 {
-	int res = -ENOMEM;
-	struct sk_isa_card *this_card;
-	struct net_device *dev = alloc_trdev(0);
-
-	if (dev) {
-		dev->base_addr = io;
-		dev->irq       = irq;
-		dev->dma       = dma;
-		res = -ENODEV;
-		if (sk_isa_probe(dev) == 0) {
-			res = register_netdev(dev);
-			if (!res)
-				return 0;
-			release_region(dev->base_addr, SK_ISA_IO_EXTENT);
-			free_irq(dev->irq, dev);
-			free_dma(dev->dma);
-			tmsdev_term(dev);
-			this_card = sk_isa_card_list;
-			sk_isa_card_list = this_card->next;
-			kfree(this_card);
-		}
-		kfree(dev);
-	}
-	return res;
+	struct net_device *dev = alloc_trdev(sizeof(struct net_local));
+	int err;
+
+	if (!dev)
+		return ERR_PTR(-ENOMEM);
+
+	dev->base_addr = io;
+	dev->irq       = irq;
+	dev->dma       = dma;
+
+	err = sk_isa_probe1(dev, io);
+	if (err)
+		goto out;
+
+	err = register_netdev(dev);
+	if (err)
+		goto out1;
+	return dev;
+
+ out1:
+	release_region(dev->base_addr, SK_ISA_IO_EXTENT);
+	free_irq(dev->irq, dev);
+	free_dma(dev->dma);
+	tmsdev_term(dev);
+ out:
+	free_netdev(dev);
+	return ERR_PTR(err);
 }
 
 int init_module(void)
 {
+	struct net_device *dev;
 	int i, num;
 
 	num = 0;
-	if (io[0]) { /* Only probe addresses from command line */
-		for (i = 0; i < ISATR_MAX_ADAPTERS ; i++) {
-			if (io[i] && setup_card(io[i], irq[i], dma[i]) == 0)
-				num++;
-		}
-	} else {
-		for(i = 0; num < ISATR_MAX_ADAPTERS && portlist[i]; i++) {
-			if (setup_card(portlist[i], irq[num], dma[num]) == 0)
-				num++;
+	for (i = 0; i < ISATR_MAX_ADAPTERS ; i++) {
+		if (io[0])  /* Only probe addresses from command line */
+			dev = setup_card(io[i], irq[i], dma[i]);
+		else
+			dev = sk_isa_probe(-1);
+		if (!IS_ERR(dev)) {
+			sk_isa_dev[i] = dev;
+			++num;
 		}
 	}
+
 	printk(KERN_NOTICE "skisa.c: %d cards found.\n", num);
 	/* Probe for cards. */
 	if (num == 0) {
@@ -438,11 +427,13 @@
 
 void cleanup_module(void)
 {
-	struct net_device *dev;
-	struct sk_isa_card *this_card;
+	int i;
+
+	for (i = 0; i < ISATR_MAX_ADAPTERS ; i++) {
+		struct net_device *dev = sk_isa_dev[i];
 
-	while (sk_isa_card_list) {
-		dev = sk_isa_card_list->dev;
+		if (!dev) 
+			continue;
 		
 		unregister_netdev(dev);
 		release_region(dev->base_addr, SK_ISA_IO_EXTENT);
@@ -450,9 +441,6 @@
 		free_dma(dev->dma);
 		tmsdev_term(dev);
 		free_netdev(dev);
-		this_card = sk_isa_card_list;
-		sk_isa_card_list = this_card->next;
-		kfree(this_card);
 	}
 }
 #endif /* MODULE */
--- diff/drivers/net/tokenring/smctr.c	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/net/tokenring/smctr.c	2004-02-09 10:39:54.000000000 +0000
@@ -69,13 +69,6 @@
 
 #define SMCTR_IO_EXTENT   20
 
-/* A zero-terminated list of I/O addresses to be probed. */
-static unsigned int smctr_portlist[] __initdata = {
-        0x200, 0x220, 0x240, 0x260, 0x280, 0x2A0, 0x2C0, 0x2E0, 0x300,
-        0x320, 0x340, 0x360, 0x380,
-        0
-};
-
 #ifdef CONFIG_MCA
 static unsigned int smctr_posid = 0x6ec6;
 #endif
@@ -219,7 +212,7 @@
 static int smctr_open_tr(struct net_device *dev);
 
 /* P */
-int __init smctr_probe (struct net_device *dev);
+struct net_device *smctr_probe(int unit);
 static int __init smctr_probe1(struct net_device *dev, int ioaddr);
 static int smctr_process_rx_packet(MAC_HEADER *rmf, __u16 size,
         struct net_device *dev, __u16 rx_status);
@@ -3583,71 +3576,72 @@
         return (err);
 }
 
-/* Check for a network adapter of this type, and return '0 if one exists.
- * If dev->base_addr == 0, probe all likely locations.
- * If dev->base_addr == 1, always return failure.
+/* Check for a network adapter of this type, 
+ * and return device structure if one exists.
  */
-int __init smctr_probe (struct net_device *dev)
+struct net_device __init *smctr_probe(int unit)
 {
-        int i;
-        int base_addr;
+	struct net_device *dev = alloc_trdev(sizeof(struct net_local));
+	static const unsigned ports[] = {
+		0x200, 0x220, 0x240, 0x260, 0x280, 0x2A0, 0x2C0, 0x2E0, 0x300,
+		0x320, 0x340, 0x360, 0x380, 0
+	};
+	const unsigned *port;
+        int err = 0;
 
-#ifndef MODULE
-	netdev_boot_setup_check(dev);
-	tr_setup(dev);
-#endif
+	if (!dev)
+		return ERR_PTR(-ENOMEM);
 
-        base_addr = dev->base_addr;
-        if(base_addr > 0x1ff)    /* Check a single specified location. */
-                return (smctr_probe1(dev, base_addr));
-        else if(base_addr != 0)  /* Don't probe at all. */
-                return (-ENXIO);
+	SET_MODULE_OWNER(dev);
 
-        for(i = 0; smctr_portlist[i]; i++)
-        {
-                int ioaddr = smctr_portlist[i];
-                if (!smctr_probe1(dev, ioaddr))
-                        return (0);
-        }
-
-        return (-ENODEV);
-}
+	if (unit >= 0) {
+		sprintf(dev->name, "tr%d", unit);
+		netdev_boot_setup_check(dev);
+	}
 
-static void cleanup_card(struct net_device *dev)
-{
+        if (dev->base_addr > 0x1ff)    /* Check a single specified location. */
+		err = smctr_probe1(dev, dev->base_addr);
+        else if(dev->base_addr != 0)  /* Don't probe at all. */
+                err =-ENXIO;
+	else {
+		for (port = ports; *port; port++) {
+			err = smctr_probe1(dev, *port);
+			if (!err)
+				break;
+		}
+	}
+	if (err)
+		goto out;
+	err = register_netdev(dev);
+	if (err)
+		goto out1;
+	return dev;
+out1:
 #ifdef CONFIG_MCA
-	struct net_local *tp = (struct net_local *)dev->priv;
-	if (tp->slot_num)
+	{ struct net_local *tp = (struct net_local *)dev->priv;
+	  if (tp->slot_num)
 		mca_mark_as_unused(tp->slot_num);
+	}
 #endif
 	release_region(dev->base_addr, SMCTR_IO_EXTENT);
-	if (dev->irq)
-		free_irq(dev->irq, dev);
-	if (dev->priv)
-		kfree(dev->priv);
+	free_irq(dev->irq, dev);
+out:
+	free_netdev(dev);
+	return ERR_PTR(err);
 }
 
+
 static int __init smctr_probe1(struct net_device *dev, int ioaddr)
 {
         static unsigned version_printed;
-        struct net_local *tp;
+        struct net_local *tp = dev->priv;
         int err;
         __u32 *ram;
 
         if(smctr_debug && version_printed++ == 0)
                 printk(version);
 
-        /* Setup this devices private information structure */
-        tp = (struct net_local *)kmalloc(sizeof(struct net_local),
-                GFP_KERNEL);
-        if(tp == NULL) {
-		err = -ENOMEM;
-		goto out;
-	}
-        memset(tp, 0, sizeof(struct net_local));
         spin_lock_init(&tp->lock);
-        
-        dev->priv = tp;
         dev->base_addr = ioaddr;
 
 	/* Actually detect an adapter now. */
@@ -3656,7 +3650,7 @@
         {
 		if ((err = smctr_chk_mca(dev)) < 0) {
 			err = -ENODEV;
-			goto out_tp;
+			goto out;
 		}
         }
 
@@ -3671,7 +3665,6 @@
         if(err != UCODE_PRESENT && err != SUCCESS)
         {
                 printk(KERN_ERR "%s: Firmware load failed (%d)\n", dev->name, err);
-		cleanup_card(dev);
 		err = -EIO;
 		goto out;
         }
@@ -3696,8 +3689,6 @@
         dev->set_multicast_list = &smctr_set_multicast_list;
         return (0);
 
-out_tp:
-	kfree(tp);
 out:
 	return err;
 }
@@ -5669,47 +5660,59 @@
 static struct net_device* dev_smctr[SMCTR_MAX_ADAPTERS];
 static int io[SMCTR_MAX_ADAPTERS];
 static int irq[SMCTR_MAX_ADAPTERS];
-static int mem[SMCTR_MAX_ADAPTERS];
 
 MODULE_LICENSE("GPL");
 
-MODULE_PARM(io,  "1-" __MODULE_STRING(SMCTR_MAX_ADAPTERS) "i");
+MODULE_PARM(io, "1-" __MODULE_STRING(SMCTR_MAX_ADAPTERS) "i");
 MODULE_PARM(irq, "1-" __MODULE_STRING(SMCTR_MAX_ADAPTERS) "i");
-MODULE_PARM(mem, "1-" __MODULE_STRING(SMCTR_MAX_ADAPTERS) "i");
-MODULE_PARM(ringspeed, "1-" __MODULE_STRING(SMCTR_MAX_ADAPTERS) "i");
+MODULE_PARM(ringspeed, "i");
+
+static struct net_device *setup_card(int n)
+{
+	struct net_device *dev = alloc_trdev(sizeof(struct net_local));
+	int err;
+	
+	if (!dev)
+		return ERR_PTR(-ENOMEM);
+
+	dev->irq = irq[n];
+	err = smctr_probe1(dev, io[n]);
+	if (err) 
+		goto out;
+		
+	err = register_netdev(dev);
+	if (err)
+		goto out1;
+	return dev;
+ out1:
+#ifdef CONFIG_MCA
+	{ struct net_local *tp = (struct net_local *)dev->priv;
+	  if (tp->slot_num)
+		mca_mark_as_unused(tp->slot_num);
+	}
+#endif
+	release_region(dev->base_addr, SMCTR_IO_EXTENT);
+	free_irq(dev->irq, dev);
+out:
+	free_netdev(dev);
+	return ERR_PTR(err);
+}
+			
 
 int init_module(void)
 {
-        int i;
+        int i, found = 0;
+	struct net_device *dev;
 
         for(i = 0; i < SMCTR_MAX_ADAPTERS; i++) {
-		struct net_device *dev = alloc_trdev(0);
-                irq[i] = 0;
-                mem[i] = 0;
-		if (!dev)
-			return -ENOMEM;
-                dev->base_addr = io[i];
-                dev->irq       = irq[i];
-                dev->mem_start = mem[i];
-
-		if (smctr_probe(dev) != 0) {
-                        kfree(dev);
-                        if (i == 0) {
-                                printk(KERN_ERR "%s: smctr_probe failed.\n",
-                                        cardname);
-                                return -EIO;
-                        }
-			return 0;
-                }
-		if (register_netdev(dev) != 0) {
-                        cleanup_card(dev);
-			kfree(dev);
-			continue;
-                }
-                dev_smctr[i] = dev;
+		dev = io[0]? setup_card(i) : smctr_probe(-1);
+		if (!IS_ERR(dev)) {
+			++found;
+			dev_smctr[i] = dev;
+		}
         }
 
-        return (0);
+        return found ? 0 : -ENODEV;
 }
 
 void cleanup_module(void)
@@ -5718,9 +5721,20 @@
 
         for(i = 0; i < SMCTR_MAX_ADAPTERS; i++) {
 		struct net_device *dev = dev_smctr[i];
+
 		if (dev) {
+
 			unregister_netdev(dev);
-			cleanup_card(dev);
+#ifdef CONFIG_MCA
+			{ struct net_local *tp = dev->priv;
+			if (tp->slot_num)
+				mca_mark_as_unused(tp->slot_num);
+			}
+#endif
+			release_region(dev->base_addr, SMCTR_IO_EXTENT);
+			if (dev->irq)
+				free_irq(dev->irq, dev);
+
 			free_netdev(dev);
 		}
         }
--- diff/drivers/net/tokenring/tms380tr.c	2003-09-30 15:46:16.000000000 +0100
+++ source/drivers/net/tokenring/tms380tr.c	2004-02-09 10:39:54.000000000 +0000
@@ -147,7 +147,6 @@
 			struct net_local* tp);
 /* "I" */
 static int 	tms380tr_init_adapter(struct net_device *dev);
-static int 	tms380tr_init_card(struct net_device *dev);
 static void 	tms380tr_init_ipb(struct net_local *tp);
 static void 	tms380tr_init_net_local(struct net_device *dev);
 static void 	tms380tr_init_opb(struct net_device *dev);
@@ -232,15 +231,6 @@
 }
 #endif
 
-/* Dummy function */
-static int tms380tr_init_card(struct net_device *dev)
-{
-	if(tms380tr_debug > 3)
-		printk(KERN_DEBUG "%s: tms380tr_init_card\n", dev->name);
-
-	return (0);
-}
-
 /*
  * Open/initialize the board. This is called sometime after
  * booting when the 'ifconfig' program is run.
@@ -2386,7 +2376,6 @@
 	}
 	
 	/* These can be overridden by the card driver if needed */
-	dev->init		= tms380tr_init_card;
 	dev->open		= tms380tr_open;
 	dev->stop		= tms380tr_close;
 	dev->do_ioctl		= NULL; 
--- diff/drivers/net/tokenring/tmspci.c	2003-09-30 15:46:16.000000000 +0100
+++ source/drivers/net/tokenring/tmspci.c	2004-02-09 10:39:54.000000000 +0000
@@ -179,7 +179,7 @@
 err_out_region:
 	release_region(pci_ioaddr, TMS_PCI_IO_EXTENT);
 err_out_trdev:
-	kfree(dev);
+	free_netdev(dev);
 	return ret;
 }
 
--- diff/drivers/net/tulip/Kconfig	2003-09-30 15:46:16.000000000 +0100
+++ source/drivers/net/tulip/Kconfig	2004-02-09 10:39:54.000000000 +0000
@@ -68,6 +68,26 @@
 	  obscure bugs if your mainboard has memory controller timing issues.
 	  If in doubt, say N.
 
+config TULIP_NAPI
+	bool "Use NAPI RX polling "
+	depends on TULIP
+	---help---
+	  This is of useful for servers and routers dealing with high network loads.
+ 
+	  See <file:Documentation/networking/NAPI_HOWTO.txt>.
+
+	  If in doubt, say N.
+
+config TULIP_NAPI_HW_MITIGATION
+	bool "Use Interrupt Mitigation "
+	depends on TULIP_NAPI
+	---help---
+	  Use HW to reduce RX interrupts. Not strict necessary since NAPI reduces
+	  RX interrupts but itself. Although this reduces RX interrupts even at
+	  low levels traffic at the cost of a small latency.
+
+	  If in doubt, say Y.
+
 config DE4X5
 	tristate "Generic DECchip & DIGITAL EtherWORKS PCI/EISA"
 	depends on NET_TULIP && (PCI || EISA)
--- diff/drivers/net/tulip/de2104x.c	2003-09-30 15:46:16.000000000 +0100
+++ source/drivers/net/tulip/de2104x.c	2004-02-09 10:39:54.000000000 +0000
@@ -2084,7 +2084,7 @@
 err_out_disable:
 	pci_disable_device(pdev);
 err_out_free:
-	kfree(dev);
+	free_netdev(dev);
 	return rc;
 }
 
--- diff/drivers/net/tulip/dmfe.c	2003-09-17 12:28:08.000000000 +0100
+++ source/drivers/net/tulip/dmfe.c	2004-02-09 10:39:54.000000000 +0000
@@ -457,7 +457,7 @@
 	pci_disable_device(pdev);
 err_out_free:
 	pci_set_drvdata(pdev, NULL);
-	kfree(dev);
+	free_netdev(dev);
 
 	return err;
 }
--- diff/drivers/net/tulip/interrupt.c	2003-06-09 14:18:19.000000000 +0100
+++ source/drivers/net/tulip/interrupt.c	2004-02-09 10:39:54.000000000 +0000
@@ -19,13 +19,13 @@
 #include <linux/etherdevice.h>
 #include <linux/pci.h>
 
-
 int tulip_rx_copybreak;
 unsigned int tulip_max_interrupt_work;
 
-#ifdef CONFIG_NET_HW_FLOWCONTROL
-
+#ifdef CONFIG_TULIP_NAPI_HW_MITIGATION
 #define MIT_SIZE 15
+#define MIT_TABLE 15 /* We use 0 or max */
+
 unsigned int mit_table[MIT_SIZE+1] =
 {
         /*  CRS11 21143 hardware Mitigation Control Interrupt
@@ -99,16 +99,28 @@
 	return refilled;
 }
 
+#ifdef CONFIG_TULIP_NAPI
 
-static int tulip_rx(struct net_device *dev)
+void oom_timer(unsigned long data)
+{
+        struct net_device *dev = (struct net_device *)data;
+	netif_rx_schedule(dev);
+}
+
+int tulip_poll(struct net_device *dev, int *budget)
 {
 	struct tulip_private *tp = (struct tulip_private *)dev->priv;
 	int entry = tp->cur_rx % RX_RING_SIZE;
-	int rx_work_limit = tp->dirty_rx + RX_RING_SIZE - tp->cur_rx;
+	int rx_work_limit = *budget;
 	int received = 0;
 
-#ifdef CONFIG_NET_HW_FLOWCONTROL
-        int drop = 0, mit_sel = 0;
+	if (!netif_running(dev))
+		goto done;
+
+	if (rx_work_limit > dev->quota)
+		rx_work_limit = dev->quota;
+
+#ifdef CONFIG_TULIP_NAPI_HW_MITIGATION
 
 /* that one buffer is needed for mit activation; or might be a
    bug in the ring buffer code; check later -- JHS*/
@@ -119,6 +131,237 @@
 	if (tulip_debug > 4)
 		printk(KERN_DEBUG " In tulip_rx(), entry %d %8.8x.\n", entry,
 			   tp->rx_ring[entry].status);
+
+       do {
+               /* Acknowledge current RX interrupt sources. */
+               outl((RxIntr | RxNoBuf), dev->base_addr + CSR5);
+ 
+ 
+               /* If we own the next entry, it is a new packet. Send it up. */
+               while ( ! (tp->rx_ring[entry].status & cpu_to_le32(DescOwned))) {
+                       s32 status = le32_to_cpu(tp->rx_ring[entry].status);
+ 
+ 
+                       if (tp->dirty_rx + RX_RING_SIZE == tp->cur_rx)
+                               break;
+ 
+                       if (tulip_debug > 5)
+                               printk(KERN_DEBUG "%s: In tulip_rx(), entry %d %8.8x.\n",
+                                      dev->name, entry, status);
+                       if (--rx_work_limit < 0)
+                               goto not_done;
+ 
+                       if ((status & 0x38008300) != 0x0300) {
+                               if ((status & 0x38000300) != 0x0300) {
+                                /* Ingore earlier buffers. */
+                                       if ((status & 0xffff) != 0x7fff) {
+                                               if (tulip_debug > 1)
+                                                       printk(KERN_WARNING "%s: Oversized Ethernet frame "
+                                                              "spanned multiple buffers, status %8.8x!\n",
+                                                              dev->name, status);
+                                               tp->stats.rx_length_errors++;
+                                       }
+                               } else if (status & RxDescFatalErr) {
+                                /* There was a fatal error. */
+                                       if (tulip_debug > 2)
+                                               printk(KERN_DEBUG "%s: Receive error, Rx status %8.8x.\n",
+                                                      dev->name, status);
+                                       tp->stats.rx_errors++; /* end of a packet.*/
+                                       if (status & 0x0890) tp->stats.rx_length_errors++;
+                                       if (status & 0x0004) tp->stats.rx_frame_errors++;
+                                       if (status & 0x0002) tp->stats.rx_crc_errors++;
+                                       if (status & 0x0001) tp->stats.rx_fifo_errors++;
+                               }
+                       } else {
+                               /* Omit the four octet CRC from the length. */
+                               short pkt_len = ((status >> 16) & 0x7ff) - 4;
+                               struct sk_buff *skb;
+  
+#ifndef final_version
+                               if (pkt_len > 1518) {
+                                       printk(KERN_WARNING "%s: Bogus packet size of %d (%#x).\n",
+                                              dev->name, pkt_len, pkt_len);
+                                       pkt_len = 1518;
+                                       tp->stats.rx_length_errors++;
+                               }
+#endif
+                               /* Check if the packet is long enough to accept without copying
+                                  to a minimally-sized skbuff. */
+                               if (pkt_len < tulip_rx_copybreak
+                                   && (skb = dev_alloc_skb(pkt_len + 2)) != NULL) {
+                                       skb->dev = dev;
+                                       skb_reserve(skb, 2);    /* 16 byte align the IP header */
+                                       pci_dma_sync_single(tp->pdev,
+                                                           tp->rx_buffers[entry].mapping,
+                                                           pkt_len, PCI_DMA_FROMDEVICE);
+#if ! defined(__alpha__)
+                                       eth_copy_and_sum(skb, tp->rx_buffers[entry].skb->tail,
+                                                        pkt_len, 0);
+                                       skb_put(skb, pkt_len);
+#else
+                                       memcpy(skb_put(skb, pkt_len),
+                                              tp->rx_buffers[entry].skb->tail,
+                                              pkt_len);
+#endif
+                               } else {        /* Pass up the skb already on the Rx ring. */
+                                       char *temp = skb_put(skb = tp->rx_buffers[entry].skb,
+                                                            pkt_len);
+  
+#ifndef final_version
+                                       if (tp->rx_buffers[entry].mapping !=
+                                           le32_to_cpu(tp->rx_ring[entry].buffer1)) {
+                                               printk(KERN_ERR "%s: Internal fault: The skbuff addresses "
+                                                      "do not match in tulip_rx: %08x vs. %08x %p / %p.\n",
+                                                      dev->name,
+                                                      le32_to_cpu(tp->rx_ring[entry].buffer1),
+                                                      tp->rx_buffers[entry].mapping,
+                                                      skb->head, temp);
+                                       }
+#endif
+  
+                                       pci_unmap_single(tp->pdev, tp->rx_buffers[entry].mapping,
+                                                        PKT_BUF_SZ, PCI_DMA_FROMDEVICE);
+  
+                                       tp->rx_buffers[entry].skb = NULL;
+                                       tp->rx_buffers[entry].mapping = 0;
+                               }
+                               skb->protocol = eth_type_trans(skb, dev);
+  
+                               netif_receive_skb(skb);
+ 
+                               dev->last_rx = jiffies;
+                               tp->stats.rx_packets++;
+                               tp->stats.rx_bytes += pkt_len;
+                       }
+                       received++;
+
+                       entry = (++tp->cur_rx) % RX_RING_SIZE;
+                       if (tp->cur_rx - tp->dirty_rx > RX_RING_SIZE/4)
+                               tulip_refill_rx(dev);
+ 
+                }
+ 
+               /* New ack strategy... irq does not ack Rx any longer
+                  hopefully this helps */
+ 
+               /* Really bad things can happen here... If new packet arrives
+                * and an irq arrives (tx or just due to occasionally unset
+                * mask), it will be acked by irq handler, but new thread
+                * is not scheduled. It is major hole in design.
+                * No idea how to fix this if "playing with fire" will fail
+                * tomorrow (night 011029). If it will not fail, we won
+                * finally: amount of IO did not increase at all. */
+       } while ((inl(dev->base_addr + CSR5) & RxIntr));
+ 
+done:
+ 
+ #ifdef CONFIG_TULIP_NAPI_HW_MITIGATION
+  
+          /* We use this simplistic scheme for IM. It's proven by
+             real life installations. We can have IM enabled
+            continuesly but this would cause unnecessary latency. 
+            Unfortunely we can't use all the NET_RX_* feedback here. 
+            This would turn on IM for devices that is not contributing 
+            to backlog congestion with unnecessary latency. 
+  
+             We monitor the the device RX-ring and have:
+  
+             HW Interrupt Mitigation either ON or OFF.
+  
+            ON:  More then 1 pkt received (per intr.) OR we are dropping 
+             OFF: Only 1 pkt received
+            
+             Note. We only use min and max (0, 15) settings from mit_table */
+  
+  
+          if( tp->flags &  HAS_INTR_MITIGATION) {
+                 if( received > 1 ) {
+                         if( ! tp->mit_on ) {
+                                 tp->mit_on = 1;
+                                 outl(mit_table[MIT_TABLE], dev->base_addr + CSR11);
+                         }
+                  }
+                 else {
+                         if( tp->mit_on ) {
+                                 tp->mit_on = 0;
+                                 outl(0, dev->base_addr + CSR11);
+                         }
+                  }
+          }
+
+#endif /* CONFIG_TULIP_NAPI_HW_MITIGATION */
+ 
+         dev->quota -= received;
+         *budget -= received;
+ 
+         tulip_refill_rx(dev);
+         
+         /* If RX ring is not full we are out of memory. */
+         if (tp->rx_buffers[tp->dirty_rx % RX_RING_SIZE].skb == NULL) goto oom;
+ 
+         /* Remove us from polling list and enable RX intr. */
+ 
+         netif_rx_complete(dev);
+         outl(tulip_tbl[tp->chip_id].valid_intrs, dev->base_addr+CSR7);
+ 
+         /* The last op happens after poll completion. Which means the following:
+          * 1. it can race with disabling irqs in irq handler
+          * 2. it can race with dise/enabling irqs in other poll threads
+          * 3. if an irq raised after beginning loop, it will be immediately
+          *    triggered here.
+          *
+          * Summarizing: the logic results in some redundant irqs both
+          * due to races in masking and due to too late acking of already
+          * processed irqs. But it must not result in losing events.
+          */
+ 
+         return 0;
+ 
+ not_done:
+         if (!received) {
+
+                 received = dev->quota; /* Not to happen */
+         }
+         dev->quota -= received;
+         *budget -= received;
+ 
+         if (tp->cur_rx - tp->dirty_rx > RX_RING_SIZE/2 ||
+             tp->rx_buffers[tp->dirty_rx % RX_RING_SIZE].skb == NULL)
+                 tulip_refill_rx(dev);
+ 
+         if (tp->rx_buffers[tp->dirty_rx % RX_RING_SIZE].skb == NULL) goto oom;
+ 
+         return 1;
+ 
+ 
+ oom:    /* Executed with RX ints disabled */
+ 
+         
+         /* Start timer, stop polling, but do not enable rx interrupts. */
+         mod_timer(&tp->oom_timer, jiffies+1);
+       
+         /* Think: timer_pending() was an explicit signature of bug.
+          * Timer can be pending now but fired and completed
+          * before we did netif_rx_complete(). See? We would lose it. */
+ 
+         /* remove ourselves from the polling list */
+         netif_rx_complete(dev);
+ 
+         return 0;
+}
+
+#else /* CONFIG_TULIP_NAPI */
+
+static int tulip_rx(struct net_device *dev)
+{
+	struct tulip_private *tp = (struct tulip_private *)dev->priv;
+	int entry = tp->cur_rx % RX_RING_SIZE;
+	int rx_work_limit = tp->dirty_rx + RX_RING_SIZE - tp->cur_rx;
+	int received = 0;
+
+	if (tulip_debug > 4)
+		printk(KERN_DEBUG " In tulip_rx(), entry %d %8.8x.\n", entry,
+			   tp->rx_ring[entry].status);
 	/* If we own the next entry, it is a new packet. Send it up. */
 	while ( ! (tp->rx_ring[entry].status & cpu_to_le32(DescOwned))) {
 		s32 status = le32_to_cpu(tp->rx_ring[entry].status);
@@ -163,11 +406,6 @@
 			}
 #endif
 
-#ifdef CONFIG_NET_HW_FLOWCONTROL
-                        drop = atomic_read(&netdev_dropping);
-                        if (drop)
-                                goto throttle;
-#endif
 			/* Check if the packet is long enough to accept without copying
 			   to a minimally-sized skbuff. */
 			if (pkt_len < tulip_rx_copybreak
@@ -209,44 +447,9 @@
 				tp->rx_buffers[entry].mapping = 0;
 			}
 			skb->protocol = eth_type_trans(skb, dev);
-#ifdef CONFIG_NET_HW_FLOWCONTROL
-                        mit_sel =
-#endif
-			netif_rx(skb);
 
-#ifdef CONFIG_NET_HW_FLOWCONTROL
-                        switch (mit_sel) {
-                        case NET_RX_SUCCESS:
-                        case NET_RX_CN_LOW:
-                        case NET_RX_CN_MOD:
-                                break;
-
-                        case NET_RX_CN_HIGH:
-                                rx_work_limit -= NET_RX_CN_HIGH; /* additional*/
-                                break;
-                        case NET_RX_DROP:
-                                rx_work_limit = -1;
-                                break;
-                        default:
-                                printk("unknown feedback return code %d\n", mit_sel);
-                                break;
-                        }
+			netif_rx(skb);
 
-                        drop = atomic_read(&netdev_dropping);
-                        if (drop) {
-throttle:
-                                rx_work_limit = -1;
-                                mit_sel = NET_RX_DROP;
-
-                                if (tp->fc_bit) {
-                                        long ioaddr = dev->base_addr;
-
-                                        /* disable Rx & RxNoBuf ints. */
-                                        outl(tulip_tbl[tp->chip_id].valid_intrs&RX_A_NBF_STOP, ioaddr + CSR7);
-                                        set_bit(tp->fc_bit, &netdev_fc_xoff);
-                                }
-                        }
-#endif
 			dev->last_rx = jiffies;
 			tp->stats.rx_packets++;
 			tp->stats.rx_bytes += pkt_len;
@@ -254,42 +457,9 @@
 		received++;
 		entry = (++tp->cur_rx) % RX_RING_SIZE;
 	}
-#ifdef CONFIG_NET_HW_FLOWCONTROL
-
-        /* We use this simplistic scheme for IM. It's proven by
-           real life installations. We can have IM enabled
-           continuesly but this would cause unnecessary latency.
-           Unfortunely we can't use all the NET_RX_* feedback here.
-           This would turn on IM for devices that is not contributing
-           to backlog congestion with unnecessary latency.
-
-           We monitor the device RX-ring and have:
-
-           HW Interrupt Mitigation either ON or OFF.
-
-           ON:  More then 1 pkt received (per intr.) OR we are dropping
-           OFF: Only 1 pkt received
-
-           Note. We only use min and max (0, 15) settings from mit_table */
-
-
-        if( tp->flags &  HAS_INTR_MITIGATION) {
-                if((received > 1 || mit_sel == NET_RX_DROP)
-                   && tp->mit_sel != 15 ) {
-                        tp->mit_sel = 15;
-                        tp->mit_change = 1; /* Force IM change */
-                }
-                if((received <= 1 && mit_sel != NET_RX_DROP) && tp->mit_sel != 0 ) {
-                        tp->mit_sel = 0;
-                        tp->mit_change = 1; /* Force IM change */
-                }
-        }
-
-        return RX_RING_SIZE+1; /* maxrx+1 */
-#else
 	return received;
-#endif
 }
+#endif  /* CONFIG_TULIP_NAPI */
 
 static inline unsigned int phy_interrupt (struct net_device *dev)
 {
@@ -323,7 +493,6 @@
 	struct tulip_private *tp = (struct tulip_private *)dev->priv;
 	long ioaddr = dev->base_addr;
 	int csr5;
-	int entry;
 	int missed;
 	int rx = 0;
 	int tx = 0;
@@ -331,6 +500,11 @@
 	int maxrx = RX_RING_SIZE;
 	int maxtx = TX_RING_SIZE;
 	int maxoi = TX_RING_SIZE;
+#ifdef CONFIG_TULIP_NAPI
+	int rxd = 0;
+#else
+	int entry;
+#endif
 	unsigned int work_count = tulip_max_interrupt_work;
 	unsigned int handled = 0;
 
@@ -346,22 +520,41 @@
 	tp->nir++;
 
 	do {
+
+#ifdef CONFIG_TULIP_NAPI
+
+		if (!rxd && (csr5 & (RxIntr | RxNoBuf))) {
+			rxd++;
+			/* Mask RX intrs and add the device to poll list. */
+			outl(tulip_tbl[tp->chip_id].valid_intrs&~RxPollInt, ioaddr + CSR7);
+			netif_rx_schedule(dev);
+			
+			if (!(csr5&~(AbnormalIntr|NormalIntr|RxPollInt|TPLnkPass)))
+                               break;
+		}
+		
+               /* Acknowledge the interrupt sources we handle here ASAP
+                  the poll function does Rx and RxNoBuf acking */
+		
+		outl(csr5 & 0x0001ff3f, ioaddr + CSR5);
+
+#else 
 		/* Acknowledge all of the current interrupt sources ASAP. */
 		outl(csr5 & 0x0001ffff, ioaddr + CSR5);
 
-		if (tulip_debug > 4)
-			printk(KERN_DEBUG "%s: interrupt  csr5=%#8.8x new csr5=%#8.8x.\n",
-				   dev->name, csr5, inl(dev->base_addr + CSR5));
 
 		if (csr5 & (RxIntr | RxNoBuf)) {
-#ifdef CONFIG_NET_HW_FLOWCONTROL
-                        if ((!tp->fc_bit) ||
-			    (!test_bit(tp->fc_bit, &netdev_fc_xoff)))
-#endif
 				rx += tulip_rx(dev);
 			tulip_refill_rx(dev);
 		}
 
+#endif /*  CONFIG_TULIP_NAPI */
+		
+		if (tulip_debug > 4)
+			printk(KERN_DEBUG "%s: interrupt  csr5=%#8.8x new csr5=%#8.8x.\n",
+			       dev->name, csr5, inl(dev->base_addr + CSR5));
+		
+
 		if (csr5 & (TxNoBuf | TxDied | TxIntr | TimerInt)) {
 			unsigned int dirty_tx;
 
@@ -462,15 +655,8 @@
 			}
 			if (csr5 & RxDied) {		/* Missed a Rx frame. */
                                 tp->stats.rx_missed_errors += inl(ioaddr + CSR8) & 0xffff;
-#ifdef CONFIG_NET_HW_FLOWCONTROL
-				if (tp->fc_bit && !test_bit(tp->fc_bit, &netdev_fc_xoff)) {
-					tp->stats.rx_errors++;
-					tulip_start_rxtx(tp);
-				}
-#else
 				tp->stats.rx_errors++;
 				tulip_start_rxtx(tp);
-#endif
 			}
 			/*
 			 * NB: t21142_lnk_change() does a del_timer_sync(), so be careful if this
@@ -504,10 +690,6 @@
 			if (tulip_debug > 2)
 				printk(KERN_ERR "%s: Re-enabling interrupts, %8.8x.\n",
 					   dev->name, csr5);
-#ifdef CONFIG_NET_HW_FLOWCONTROL
-                        if (tp->fc_bit && (test_bit(tp->fc_bit, &netdev_fc_xoff)))
-                          if (net_ratelimit()) printk("BUG!! enabling interrupt when FC off (timerintr.) \n");
-#endif
 			outl(tulip_tbl[tp->chip_id].valid_intrs, ioaddr + CSR7);
 			tp->ttimer = 0;
 			oi++;
@@ -520,16 +702,9 @@
                        /* Acknowledge all interrupt sources. */
                         outl(0x8001ffff, ioaddr + CSR5);
                         if (tp->flags & HAS_INTR_MITIGATION) {
-#ifdef CONFIG_NET_HW_FLOWCONTROL
-                                if(tp->mit_change) {
-                                        outl(mit_table[tp->mit_sel], ioaddr + CSR11);
-                                        tp->mit_change = 0;
-                                }
-#else
                      /* Josip Loncaric at ICASE did extensive experimentation
 			to develop a good interrupt mitigation setting.*/
                                 outl(0x8b240000, ioaddr + CSR11);
-#endif
                         } else if (tp->chip_id == LC82C168) {
 				/* the LC82C168 doesn't have a hw timer.*/
 				outl(0x00, ioaddr + CSR7);
@@ -537,10 +712,8 @@
 			} else {
                           /* Mask all interrupting sources, set timer to
 				re-enable. */
-#ifndef CONFIG_NET_HW_FLOWCONTROL
                                 outl(((~csr5) & 0x0001ebef) | AbnormalIntr | TimerInt, ioaddr + CSR7);
                                 outl(0x0012, ioaddr + CSR11);
-#endif
                         }
 			break;
 		}
@@ -550,6 +723,21 @@
 			break;
 
 		csr5 = inl(ioaddr + CSR5);
+
+#ifdef CONFIG_TULIP_NAPI
+		if (rxd)
+			csr5 &= ~RxPollInt;
+	} while ((csr5 & (TxNoBuf | 
+			  TxDied | 
+			  TxIntr | 
+			  TimerInt |
+			  /* Abnormal intr. */
+			  RxDied | 
+			  TxFIFOUnderflow | 
+			  TxJabber | 
+			  TPLnkFail |  
+			  SytemError )) != 0);
+#else 
 	} while ((csr5 & (NormalIntr|AbnormalIntr)) != 0);
 
 	tulip_refill_rx(dev);
@@ -574,6 +762,7 @@
 			}
 		}
 	}
+#endif /* CONFIG_TULIP_NAPI */
 
 	if ((missed = inl(ioaddr + CSR8) & 0x1ffff)) {
 		tp->stats.rx_dropped += missed & 0x10000 ? 0x10000 : missed;
--- diff/drivers/net/tulip/tulip.h	2003-06-09 14:18:19.000000000 +0100
+++ source/drivers/net/tulip/tulip.h	2004-02-09 10:39:54.000000000 +0000
@@ -126,6 +126,7 @@
 	CFDD_Snooze = (1 << 30),
 };
 
+#define RxPollInt (RxIntr|RxNoBuf|RxDied|RxJabber)
 
 /* The bits in the CSR5 status registers, mostly interrupt sources. */
 enum status_bits {
@@ -251,9 +252,9 @@
    Making the Tx ring too large decreases the effectiveness of channel
    bonding and packet priority.
    There are no ill effects from too-large receive rings. */
-#define TX_RING_SIZE	16
-#define RX_RING_SIZE	32
 
+#define TX_RING_SIZE	32
+#define RX_RING_SIZE	128 
 #define MEDIA_MASK     31
 
 #define PKT_BUF_SZ		1536	/* Size of each temporary Rx buffer. */
@@ -343,17 +344,15 @@
 	int flags;
 	struct net_device_stats stats;
 	struct timer_list timer;	/* Media selection timer. */
+	struct timer_list oom_timer;    /* Out of memory timer. */
 	u32 mc_filter[2];
 	spinlock_t lock;
 	spinlock_t mii_lock;
 	unsigned int cur_rx, cur_tx;	/* The next free ring entry */
 	unsigned int dirty_rx, dirty_tx;	/* The ring entries to be free()ed. */
 
-#ifdef CONFIG_NET_HW_FLOWCONTROL
-#define RX_A_NBF_STOP 0xffffff3f /* To disable RX and RX-NOBUF ints. */
-        int fc_bit;
-        int mit_sel;
-        int mit_change; /* Signal for Interrupt Mitigtion */
+#ifdef 	CONFIG_TULIP_NAPI_HW_MITIGATION
+        int mit_on;
 #endif
 	unsigned int full_duplex:1;	/* Full-duplex operation requested. */
 	unsigned int full_duplex_lock:1;
@@ -415,6 +414,10 @@
 extern int tulip_rx_copybreak;
 irqreturn_t tulip_interrupt(int irq, void *dev_instance, struct pt_regs *regs);
 int tulip_refill_rx(struct net_device *dev);
+#ifdef CONFIG_TULIP_NAPI
+int tulip_poll(struct net_device *dev, int *budget);
+#endif
+
 
 /* media.c */
 int tulip_mdio_read(struct net_device *dev, int phy_id, int location);
@@ -438,6 +441,7 @@
 extern const char * const medianame[];
 extern const char tulip_media_cap[];
 extern struct tulip_chip_table tulip_tbl[];
+void oom_timer(unsigned long data);
 extern u8 t21040_csr13[];
 
 #ifndef USE_IO_OPS
--- diff/drivers/net/tulip/tulip_core.c	2003-11-25 15:24:58.000000000 +0000
+++ source/drivers/net/tulip/tulip_core.c	2004-02-09 10:39:54.000000000 +0000
@@ -14,11 +14,17 @@
 
 */
 
+#include <linux/config.h>
+
 #define DRV_NAME	"tulip"
+#ifdef CONFIG_TULIP_NAPI
+#define DRV_VERSION    "1.1.13-NAPI" /* Keep at least for test */
+#else
 #define DRV_VERSION	"1.1.13"
+#endif
 #define DRV_RELDATE	"May 11, 2002"
 
-#include <linux/config.h>
+
 #include <linux/module.h>
 #include "tulip.h"
 #include <linux/pci.h>
@@ -247,7 +253,7 @@
 static struct net_device_stats *tulip_get_stats(struct net_device *dev);
 static int private_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
 static void set_rx_mode(struct net_device *dev);
-
+static void poll_tulip(struct net_device *dev);
 
 
 static void tulip_set_power_state (struct tulip_private *tp,
@@ -466,29 +472,16 @@
 	   to an alternate media type. */
 	tp->timer.expires = RUN_AT(next_tick);
 	add_timer(&tp->timer);
-}
-
-#ifdef CONFIG_NET_HW_FLOWCONTROL
-/* Enable receiver */
-void tulip_xon(struct net_device *dev)
-{
-        struct tulip_private *tp = (struct tulip_private *)dev->priv;
-
-        clear_bit(tp->fc_bit, &netdev_fc_xoff);
-        if (netif_running(dev)){
-
-                tulip_refill_rx(dev);
-                outl(tulip_tbl[tp->chip_id].valid_intrs,  dev->base_addr+CSR7);
-        }
-}
+#ifdef CONFIG_TULIP_NAPI
+	init_timer(&tp->oom_timer);
+        tp->oom_timer.data = (unsigned long)dev;
+        tp->oom_timer.function = oom_timer;
 #endif
+}
 
 static int
 tulip_open(struct net_device *dev)
 {
-#ifdef CONFIG_NET_HW_FLOWCONTROL
-        struct tulip_private *tp = (struct tulip_private *)dev->priv;
-#endif
 	int retval;
 
 	if ((retval = request_irq(dev->irq, &tulip_interrupt, SA_SHIRQ, dev->name, dev)))
@@ -498,10 +491,6 @@
 
 	tulip_up (dev);
 
-#ifdef CONFIG_NET_HW_FLOWCONTROL
-        tp->fc_bit = netdev_register_fc(dev, tulip_xon);
-#endif
-
 	netif_start_queue (dev);
 
 	return 0;
@@ -582,10 +571,7 @@
 #endif
 
 	/* Stop and restart the chip's Tx processes . */
-#ifdef CONFIG_NET_HW_FLOWCONTROL
-        if (tp->fc_bit && test_bit(tp->fc_bit,&netdev_fc_xoff))
-                printk("BUG tx_timeout restarting rx when fc on\n");
-#endif
+
 	tulip_restart_rxtx(tp);
 	/* Trigger an immediate transmit demand. */
 	outl(0, ioaddr + CSR1);
@@ -742,7 +728,9 @@
 	unsigned long flags;
 
 	del_timer_sync (&tp->timer);
-
+#ifdef CONFIG_TULIP_NAPI
+	del_timer_sync (&tp->oom_timer);
+#endif
 	spin_lock_irqsave (&tp->lock, flags);
 
 	/* Disable interrupts by clearing the interrupt mask. */
@@ -781,13 +769,6 @@
 
 	netif_stop_queue (dev);
 
-#ifdef CONFIG_NET_HW_FLOWCONTROL
-        if (tp->fc_bit) {
-                int bit = tp->fc_bit;
-                tp->fc_bit = 0;
-                netdev_unregister_fc(bit);
-        }
-#endif
 	tulip_down (dev);
 
 	if (tulip_debug > 1)
@@ -1531,7 +1512,7 @@
 		}
 	}
 	/* Lite-On boards have the address byte-swapped. */
-	if ((dev->dev_addr[0] == 0xA0  ||  dev->dev_addr[0] == 0xC0)
+	if ((dev->dev_addr[0] == 0xA0  ||  dev->dev_addr[0] == 0xC0 || dev->dev_addr[0] == 0x02)
 		&&  dev->dev_addr[1] == 0x00)
 		for (i = 0; i < 6; i+=2) {
 			char tmp = dev->dev_addr[i];
@@ -1629,10 +1610,17 @@
 	dev->hard_start_xmit = tulip_start_xmit;
 	dev->tx_timeout = tulip_tx_timeout;
 	dev->watchdog_timeo = TX_TIMEOUT;
+#ifdef CONFIG_TULIP_NAPI
+	dev->poll = tulip_poll;
+	dev->weight = 16;
+#endif
 	dev->stop = tulip_close;
 	dev->get_stats = tulip_get_stats;
 	dev->do_ioctl = private_ioctl;
 	dev->set_multicast_list = set_rx_mode;
+#ifdef CONFIG_NET_POLL_CONTROLLER
+	dev->poll_controller = &poll_tulip;
+#endif
 
 	if (register_netdev(dev))
 		goto err_out_free_ring;
@@ -1725,7 +1713,7 @@
 	pci_release_regions (pdev);
 
 err_out_free_netdev:
-	kfree (dev);
+	free_netdev (dev);
 	return -ENODEV;
 }
 
@@ -1789,6 +1777,22 @@
 	/* pci_power_off (pdev, -1); */
 }
 
+#ifdef CONFIG_NET_POLL_CONTROLLER
+/*
+ * Polling 'interrupt' - used by things like netconsole to send skbs
+ * without having to re-enable interrupts. It's not called while
+ * the interrupt routine is executing.
+ */
+
+static void poll_tulip (struct net_device *dev)
+{
+	/* disable_irq here is not very nice, but with the lockless
+	   interrupt handler we have no other choice. */
+	disable_irq(dev->irq);
+	tulip_interrupt (dev->irq, dev, NULL);
+	enable_irq(dev->irq);
+}
+#endif
 
 static struct pci_driver tulip_driver = {
 	.name		= DRV_NAME,
--- diff/drivers/net/tulip/winbond-840.c	2003-09-17 12:28:08.000000000 +0100
+++ source/drivers/net/tulip/winbond-840.c	2004-02-09 10:39:54.000000000 +0000
@@ -530,7 +530,7 @@
 #endif
 	pci_release_regions(pdev);
 err_out_netdev:
-	kfree (dev);
+	free_netdev (dev);
 	return -ENODEV;
 }
 
--- diff/drivers/net/tulip/xircom_tulip_cb.c	2003-08-26 10:00:53.000000000 +0100
+++ source/drivers/net/tulip/xircom_tulip_cb.c	2004-02-09 10:39:54.000000000 +0000
@@ -648,8 +648,7 @@
 	pci_set_drvdata(pdev, NULL);
 	pci_release_regions(pdev);
 err_out_free_netdev:
-	unregister_netdev(dev);
-	kfree(dev);
+	free_netdev(dev);
 	return -ENODEV;
 }
 
--- diff/drivers/net/tun.c	2003-10-09 09:47:16.000000000 +0100
+++ source/drivers/net/tun.c	2004-02-09 10:39:54.000000000 +0000
@@ -118,12 +118,10 @@
 }
 
 /* Initialize net device. */
-int tun_net_init(struct net_device *dev)
+static void tun_net_init(struct net_device *dev)
 {
 	struct tun_struct *tun = (struct tun_struct *)dev->priv;
    
-	DBG(KERN_INFO "%s: tun_net_init\n", tun->dev->name);
-
 	switch (tun->flags & TUN_TYPE_MASK) {
 	case TUN_TUN_DEV:
 		/* Point-to-Point TUN Device */
@@ -147,9 +145,7 @@
 
 		ether_setup(dev);
 		break;
-	};
-
-	return 0;
+	}
 }
 
 /* Character device part */
@@ -351,7 +347,6 @@
 	init_waitqueue_head(&tun->read_wait);
 
 	tun->owner = -1;
-	dev->init = tun_net_init;
 
 	SET_MODULE_OWNER(dev);
 	dev->open = tun_net_open;
@@ -377,6 +372,7 @@
 static int tun_set_iff(struct file *file, struct ifreq *ifr)
 {
 	struct tun_struct *tun;
+	struct net_device *dev;
 	int err;
 
 	tun = tun_get_by_name(ifr->ifr_name);
@@ -394,7 +390,6 @@
 	else {
 		char *name;
 		unsigned long flags = 0;
-		struct net_device *dev;
 
 		err = -EINVAL;
 
@@ -422,18 +417,17 @@
 		tun->dev = dev;
 		tun->flags = flags;
 
+		tun_net_init(dev);
+
 		if (strchr(dev->name, '%')) {
 			err = dev_alloc_name(dev, dev->name);
-			if (err < 0) {
-				kfree(dev);
-				goto failed;
-			}
+			if (err < 0)
+				goto err_free_dev;
 		}
 
-		if ((err = register_netdevice(tun->dev))) {
-			kfree(dev);
-			goto failed;
-		}
+		err = register_netdevice(tun->dev);
+		if (err < 0)
+			goto err_free_dev;
 	
 		list_add(&tun->list, &tun_dev_list);
 	}
@@ -451,6 +445,9 @@
 
 	strcpy(ifr->ifr_name, tun->dev->name);
 	return 0;
+
+ err_free_dev:
+	free_netdev(dev);
  failed:
 	return err;
 }
--- diff/drivers/net/via-rhine.c	2003-09-17 12:28:08.000000000 +0100
+++ source/drivers/net/via-rhine.c	2004-02-09 10:39:54.000000000 +0000
@@ -615,6 +615,15 @@
 			break;
 }
 
+#ifdef CONFIG_NET_POLL_CONTROLLER
+static void via_rhine_poll(struct net_device *dev)
+{
+	disable_irq(dev->irq);
+	via_rhine_interrupt(dev->irq, (void *)dev, NULL);
+	enable_irq(dev->irq);
+}
+#endif
+
 static int __devinit via_rhine_init_one (struct pci_dev *pdev,
 					 const struct pci_device_id *ent)
 {
@@ -784,6 +793,9 @@
 	dev->ethtool_ops = &netdev_ethtool_ops;
 	dev->tx_timeout = via_rhine_tx_timeout;
 	dev->watchdog_timeo = TX_TIMEOUT;
+#ifdef CONFIG_NET_POLL_CONTROLLER
+	dev->poll_controller = via_rhine_poll;
+#endif
 	if (np->drv_flags & ReqTxAlign)
 		dev->features |= NETIF_F_SG|NETIF_F_HW_CSUM;
 
--- diff/drivers/net/wan/Kconfig	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/net/wan/Kconfig	2004-02-09 10:39:54.000000000 +0000
@@ -434,8 +434,9 @@
 	  To compile this driver as a module, choose M here: the module will be
 	  called farsync.  If you want the module to be automatically loaded
 	  when the interface is referenced then you should add
-	  "alias hdlcX farsync" to /etc/modules.conf for each interface, where
-	  X is 0, 1, 2, ...
+	  "alias hdlcX farsync" to /etc/modprobe.conf for each interface, where
+	  X is 0, 1, 2, etc, or simply use "alias hdlc* farsync" to indicate
+	  all of them.
 
 config DLCI
 	tristate "Frame relay DLCI support"
--- diff/drivers/net/wan/c101.c	2003-08-20 14:16:10.000000000 +0100
+++ source/drivers/net/wan/c101.c	2004-02-09 10:39:54.000000000 +0000
@@ -54,7 +54,7 @@
 
 
 typedef struct card_s {
-	hdlc_device hdlc;	/* HDLC device struct - must be first */
+	struct net_device *dev;
 	spinlock_t lock;	/* TX lock */
 	u8 *win0base;		/* ISA window base address */
 	u32 phy_winbase;	/* ISA physical base address */
@@ -121,6 +121,7 @@
 
 static void sca_msci_intr(port_t *port)
 {
+	struct net_device *dev = port_to_dev(port);
 	card_t* card = port_to_card(port);
 	u8 stat = sca_in(MSCI1_OFFSET + ST1, card); /* read MSCI ST1 status */
 
@@ -128,8 +129,9 @@
 	sca_out(stat & ST1_UDRN, MSCI0_OFFSET + ST1, card);
 
 	if (stat & ST1_UDRN) {
-		port->hdlc.stats.tx_errors++; /* TX Underrun error detected */
-		port->hdlc.stats.tx_fifo_errors++;
+		struct net_device_stats *stats = hdlc_stats(dev);
+		stats->tx_errors++; /* TX Underrun error detected */
+		stats->tx_fifo_errors++;
 	}
 
 	/* Reset MSCI CDCD status bit - uses ch#2 DCD input */
@@ -137,7 +139,7 @@
 
 	if (stat & ST1_CDCD)
 		hdlc_set_carrier(!(sca_in(MSCI1_OFFSET + ST3, card) & ST3_DCD),
-				 &port->hdlc);
+				 dev);
 }
 
 
@@ -177,22 +179,21 @@
 
 static int c101_open(struct net_device *dev)
 {
-	hdlc_device *hdlc = dev_to_hdlc(dev);
-	port_t *port = hdlc_to_port(hdlc);
+	port_t *port = dev_to_port(dev);
 	int result;
 
-	result = hdlc_open(hdlc);
+	result = hdlc_open(dev);
 	if (result)
 		return result;
 
 	writeb(1, port->win0base + C101_DTR);
 	sca_out(0, MSCI1_OFFSET + CTL, port); /* RTS uses ch#2 output */
-	sca_open(hdlc);
+	sca_open(dev);
 	/* DCD is connected to port 2 !@#$%^& - disable MSCI0 CDCD interrupt */
 	sca_out(IE1_UDRN, MSCI0_OFFSET + IE1, port);
 	sca_out(IE0_TXINT, MSCI0_OFFSET + IE0, port);
 
-	hdlc_set_carrier(!(sca_in(MSCI1_OFFSET + ST3, port) & ST3_DCD), hdlc);
+	hdlc_set_carrier(!(sca_in(MSCI1_OFFSET + ST3, port) & ST3_DCD), dev);
 	printk(KERN_DEBUG "0x%X\n", sca_in(MSCI1_OFFSET + ST3, port));
 
 	/* enable MSCI1 CDCD interrupt */
@@ -206,13 +207,12 @@
 
 static int c101_close(struct net_device *dev)
 {
-	hdlc_device *hdlc = dev_to_hdlc(dev);
-	port_t *port = hdlc_to_port(hdlc);
+	port_t *port = dev_to_port(dev);
 
-	sca_close(hdlc);
+	sca_close(dev);
 	writeb(0, port->win0base + C101_DTR);
 	sca_out(CTL_NORTS, MSCI1_OFFSET + CTL, port);
-	hdlc_close(hdlc);
+	hdlc_close(dev);
 	return 0;
 }
 
@@ -221,12 +221,11 @@
 {
 	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);
+	port_t *port = dev_to_port(dev);
 
 #ifdef DEBUG_RINGS
 	if (cmd == SIOCDEVPRIVATE) {
-		sca_dump_rings(hdlc);
+		sca_dump_rings(dev);
 		printk(KERN_DEBUG "MSCI1: ST: %02x %02x %02x %02x\n",
 		       sca_in(MSCI1_OFFSET + ST0, port),
 		       sca_in(MSCI1_OFFSET + ST1, port),
@@ -288,6 +287,8 @@
 		release_mem_region(card->phy_winbase, C101_MAPPED_RAM_SIZE);
 	}
 
+	free_netdev(card->dev);
+
 	kfree(card);
 }
 
@@ -296,6 +297,7 @@
 static int __init c101_run(unsigned long irq, unsigned long winbase)
 {
 	struct net_device *dev;
+	hdlc_device *hdlc;
 	card_t *card;
 	int result;
 
@@ -316,6 +318,13 @@
 	}
 	memset(card, 0, sizeof(card_t));
 
+	card->dev = alloc_hdlcdev(card);
+	if (!card->dev) {
+		printk(KERN_ERR "c101: unable to allocate memory\n");
+		kfree(card);
+		return -ENOBUFS;
+	}
+
 	if (request_irq(irq, sca_intr, 0, devname, card)) {
 		printk(KERN_ERR "c101: could not allocate IRQ\n");
 		c101_destroy_card(card);
@@ -347,7 +356,8 @@
 
 	sca_init(card, 0);
 
-	dev = hdlc_to_dev(&card->hdlc);
+	dev = port_to_dev(card);
+	hdlc = dev_to_hdlc(dev);
 
 	spin_lock_init(&card->lock);
 	SET_MODULE_OWNER(dev);
@@ -358,24 +368,25 @@
 	dev->do_ioctl = c101_ioctl;
 	dev->open = c101_open;
 	dev->stop = c101_close;
-	card->hdlc.attach = sca_attach;
-	card->hdlc.xmit = sca_xmit;
+	hdlc->attach = sca_attach;
+	hdlc->xmit = sca_xmit;
 	card->settings.clock_type = CLOCK_EXT;
 
-	result = register_hdlc_device(&card->hdlc);
+	result = register_hdlc_device(dev);
 	if (result) {
 		printk(KERN_WARNING "c101: unable to register hdlc device\n");
 		c101_destroy_card(card);
 		return result;
 	}
 
+	/* XXX: are we OK with having that done when card is already up? */
+
 	sca_init_sync_port(card); /* Set up C101 memory */
-	hdlc_set_carrier(!(sca_in(MSCI1_OFFSET + ST3, card) & ST3_DCD),
-			 &card->hdlc);
+	hdlc_set_carrier(!(sca_in(MSCI1_OFFSET + ST3, card) & ST3_DCD), dev);
 
 	printk(KERN_INFO "%s: Moxa C101 on IRQ%u,"
 	       " using %u TX + %u RX packets rings\n",
-	       hdlc_to_name(&card->hdlc), card->irq,
+	       dev->name, card->irq,
 	       card->tx_ring_buffers, card->rx_ring_buffers);
 
 	*new_card = card;
@@ -424,7 +435,7 @@
 	while (card) {
 		card_t *ptr = card;
 		card = card->next_card;
-		unregister_hdlc_device(&ptr->hdlc);
+		unregister_hdlc_device(port_to_dev(ptr));
 		c101_destroy_card(ptr);
 	}
 }
--- diff/drivers/net/wan/comx-hw-munich.c	2003-10-09 09:47:34.000000000 +0100
+++ source/drivers/net/wan/comx-hw-munich.c	2004-02-09 10:39:54.000000000 +0000
@@ -2058,30 +2058,30 @@
     {
 	frs0 = readb(lbi + FRS0);
 	fmr2 = readb(lbi + FMR2);
-	len += snprintf(page + len, PAGE_SIZE - len, "Controller status:\n");
+	len += scnprintf(page + len, PAGE_SIZE - len, "Controller status:\n");
 	if (frs0 == 0)
-	    len += snprintf(page + len, PAGE_SIZE - len, "\tNo alarms\n");
+	    len += scnprintf(page + len, PAGE_SIZE - len, "\tNo alarms\n");
 	else
 	{
 	    if (frs0 & FRS0_LOS)
-	            len += snprintf(page + len, PAGE_SIZE - len, "\tLoss Of Signal\n");
+	            len += scnprintf(page + len, PAGE_SIZE - len, "\tLoss Of Signal\n");
 	    else
 	    {
 		if (frs0 & FRS0_AIS)
-		    len += snprintf(page + len, PAGE_SIZE - len,
+		    len += scnprintf(page + len, PAGE_SIZE - len,
 				 "\tAlarm Indication Signal\n");
 		else
 		{
 		    if (frs0 & FRS0_AUXP)
-			len += snprintf(page + len, PAGE_SIZE - len,
+			len += scnprintf(page + len, PAGE_SIZE - len,
 				     "\tAuxiliary Pattern Indication\n");
 		    if (frs0 & FRS0_LFA)
-			len += snprintf(page + len, PAGE_SIZE - len,
+			len += scnprintf(page + len, PAGE_SIZE - len,
 				     "\tLoss of Frame Alignment\n");
 		    else
 		    {
 			if (frs0 & FRS0_RRA)
-			    len += snprintf(page + len, PAGE_SIZE - len,
+			    len += scnprintf(page + len, PAGE_SIZE - len,
 					 "\tReceive Remote Alarm\n");
 
 			/* You can't set this framing with the /proc interface, but it  */
@@ -2089,11 +2089,11 @@
 
 			if ((board->framing == SLICECOM_FRAMING_CRC4) &&
 			    (frs0 & FRS0_LMFA))
-			    len += snprintf(page + len, PAGE_SIZE - len,
+			    len += scnprintf(page + len, PAGE_SIZE - len,
 					 "\tLoss of CRC4 Multiframe Alignment\n");
 
 			if (((fmr2 & 0xc0) == 0xc0) && (frs0 & FRS0_NMF))
-			    len += snprintf(page + len, PAGE_SIZE - len,
+			    len += scnprintf(page + len, PAGE_SIZE - len,
 				 "\tNo CRC4 Multiframe alignment Found after 400 msec\n");
 		    }
 		}
@@ -2102,27 +2102,27 @@
 
 	frs1 = readb(lbi + FRS1);
 	if (FRS1_XLS & frs1)
-	    len += snprintf(page + len, PAGE_SIZE - len,
+	    len += scnprintf(page + len, PAGE_SIZE - len,
 		 "\tTransmit Line Short\n");
 
 	/* debug Rx ring: DEL: - vagy meghagyni, de akkor legyen kicsit altalanosabb */
     }
 
-    len += snprintf(page + len, PAGE_SIZE - len, "Rx ring:\n");
-    len += snprintf(page + len, PAGE_SIZE - len, "\trafutott: %d\n", hw->rafutott);
-    len += snprintf(page + len, PAGE_SIZE - len,
+    len += scnprintf(page + len, PAGE_SIZE - len, "Rx ring:\n");
+    len += scnprintf(page + len, PAGE_SIZE - len, "\trafutott: %d\n", hw->rafutott);
+    len += scnprintf(page + len, PAGE_SIZE - len,
 		 "\tlastcheck: %ld, jiffies: %ld\n", board->lastcheck, jiffies);
-    len += snprintf(page + len, PAGE_SIZE - len, "\tbase: %08x\n",
+    len += scnprintf(page + len, PAGE_SIZE - len, "\tbase: %08x\n",
 	(u32) virt_to_phys(&hw->rx_desc[0]));
-    len += snprintf(page + len, PAGE_SIZE - len, "\trx_desc_ptr: %d\n",
+    len += scnprintf(page + len, PAGE_SIZE - len, "\trx_desc_ptr: %d\n",
 		 hw->rx_desc_ptr);
-    len += snprintf(page + len, PAGE_SIZE - len, "\trx_desc_ptr: %08x\n",
+    len += scnprintf(page + len, PAGE_SIZE - len, "\trx_desc_ptr: %08x\n",
 	(u32) virt_to_phys(&hw->rx_desc[hw->rx_desc_ptr]));
-    len += snprintf(page + len, PAGE_SIZE - len, "\thw_curr_ptr: %08x\n",
+    len += scnprintf(page + len, PAGE_SIZE - len, "\thw_curr_ptr: %08x\n",
 		 board->ccb->current_rx_desc[hw->channel]);
 
     for (i = 0; i < RX_DESC_MAX; i++)
-	len += snprintf(page + len, PAGE_SIZE - len, "\t%08x %08x %08x %08x\n",
+	len += scnprintf(page + len, PAGE_SIZE - len, "\t%08x %08x %08x %08x\n",
 		     *((u32 *) & hw->rx_desc[i] + 0),
 		     *((u32 *) & hw->rx_desc[i] + 1),
 		     *((u32 *) & hw->rx_desc[i] + 2),
@@ -2130,7 +2130,7 @@
 
     if (!board->isx21)
     {
-	len += snprintf(page + len, PAGE_SIZE - len,
+	len += scnprintf(page + len, PAGE_SIZE - len,
 		     "Interfaces using this board: (channel-group, interface, timeslots)\n");
 	for (i = 0; i < 32; i++)
 	{
@@ -2141,26 +2141,26 @@
 		    ((struct slicecom_privdata *)((struct comx_channel *)devp->
 						  priv)->HW_privdata)->
 		    timeslots;
-		len += snprintf(page + len, PAGE_SIZE - len, "\t%2d %s: ", i,
+		len += scnprintf(page + len, PAGE_SIZE - len, "\t%2d %s: ", i,
 			     devp->name);
 		for (j = 0; j < 32; j++)
 		    if ((1 << j) & timeslots)
-			len += snprintf(page + len, PAGE_SIZE - len, "%d ", j);
-		len += snprintf(page + len, PAGE_SIZE - len, "\n");
+			len += scnprintf(page + len, PAGE_SIZE - len, "%d ", j);
+		len += scnprintf(page + len, PAGE_SIZE - len, "\n");
 	    }
 	}
     }
 
-    len += snprintf(page + len, PAGE_SIZE - len, "Interrupt work histogram:\n");
+    len += scnprintf(page + len, PAGE_SIZE - len, "Interrupt work histogram:\n");
     for (i = 0; i < MAX_WORK; i++)
-	len += snprintf(page + len, PAGE_SIZE - len, "hist[%2d]: %8u%c", i,
+	len += scnprintf(page + len, PAGE_SIZE - len, "hist[%2d]: %8u%c", i,
 		     board->histogram[i], (i &&
 					   ((i + 1) % 4 == 0 ||
 					    i == MAX_WORK - 1)) ? '\n' : ' ');
 
-    len += snprintf(page + len, PAGE_SIZE - len, "Tx ring histogram:\n");
+    len += scnprintf(page + len, PAGE_SIZE - len, "Tx ring histogram:\n");
     for (i = 0; i < TX_DESC_MAX; i++)
-	len += snprintf(page + len, PAGE_SIZE - len, "hist[%2d]: %8u%c", i,
+	len += scnprintf(page + len, PAGE_SIZE - len, "hist[%2d]: %8u%c", i,
 		     hw->tx_ring_hist[i], (i &&
 					   ((i + 1) % 4 == 0 ||
 					    i ==
@@ -2196,72 +2196,72 @@
 		sump[j] += p[j];
 	}
 
-	len += snprintf(page + len, PAGE_SIZE - len,
+	len += scnprintf(page + len, PAGE_SIZE - len,
 		     "Data in current interval (%d seconds elapsed):\n",
 		     board->elapsed_seconds);
-	len += snprintf(page + len, PAGE_SIZE - len,
+	len += scnprintf(page + len, PAGE_SIZE - len,
 		     "   %d Line Code Violations, %d Path Code Violations, %d E-Bit Errors\n",
 		     curr_int->line_code_violations,
 		     curr_int->path_code_violations, curr_int->e_bit_errors);
-	len += snprintf(page + len, PAGE_SIZE - len,
+	len += scnprintf(page + len, PAGE_SIZE - len,
 		     "   %d Slip Secs, %d Fr Loss Secs, %d Line Err Secs, %d Degraded Mins\n",
 		     curr_int->slip_secs, curr_int->fr_loss_secs,
 		     curr_int->line_err_secs, curr_int->degraded_mins);
-	len += snprintf(page + len, PAGE_SIZE - len,
+	len += scnprintf(page + len, PAGE_SIZE - len,
 		     "   %d Errored Secs, %d Bursty Err Secs, %d Severely Err Secs, %d Unavail Secs\n",
 		     curr_int->errored_secs, curr_int->bursty_err_secs,
 		     curr_int->severely_err_secs, curr_int->unavail_secs);
 
-	len += snprintf(page + len, PAGE_SIZE - len,
+	len += scnprintf(page + len, PAGE_SIZE - len,
 		     "Data in Interval 1 (15 minutes):\n");
-	len += snprintf(page + len, PAGE_SIZE - len,
+	len += scnprintf(page + len, PAGE_SIZE - len,
 		     "   %d Line Code Violations, %d Path Code Violations, %d E-Bit Errors\n",
 		     prev_int->line_code_violations,
 		     prev_int->path_code_violations, prev_int->e_bit_errors);
-	len += snprintf(page + len, PAGE_SIZE - len,
+	len += scnprintf(page + len, PAGE_SIZE - len,
 		     "   %d Slip Secs, %d Fr Loss Secs, %d Line Err Secs, %d Degraded Mins\n",
 		     prev_int->slip_secs, prev_int->fr_loss_secs,
 		     prev_int->line_err_secs, prev_int->degraded_mins);
-	len += snprintf(page + len, PAGE_SIZE - len,
+	len += scnprintf(page + len, PAGE_SIZE - len,
 		     "   %d Errored Secs, %d Bursty Err Secs, %d Severely Err Secs, %d Unavail Secs\n",
 		     prev_int->errored_secs, prev_int->bursty_err_secs,
 		     prev_int->severely_err_secs, prev_int->unavail_secs);
 
-	len += snprintf(page + len, PAGE_SIZE - len,
+	len += scnprintf(page + len, PAGE_SIZE - len,
 		     "Data in last 4 intervals (1 hour):\n");
-	len += snprintf(page + len, PAGE_SIZE - len,
+	len += scnprintf(page + len, PAGE_SIZE - len,
 		     "   %d Line Code Violations, %d Path Code Violations, %d E-Bit Errors\n",
 		     last4.line_code_violations, last4.path_code_violations,
 		     last4.e_bit_errors);
-	len += snprintf(page + len, PAGE_SIZE - len,
+	len += scnprintf(page + len, PAGE_SIZE - len,
 		     "   %d Slip Secs, %d Fr Loss Secs, %d Line Err Secs, %d Degraded Mins\n",
 		     last4.slip_secs, last4.fr_loss_secs, last4.line_err_secs,
 		     last4.degraded_mins);
-	len += snprintf(page + len, PAGE_SIZE - len,
+	len += scnprintf(page + len, PAGE_SIZE - len,
 		     "   %d Errored Secs, %d Bursty Err Secs, %d Severely Err Secs, %d Unavail Secs\n",
 		     last4.errored_secs, last4.bursty_err_secs,
 		     last4.severely_err_secs, last4.unavail_secs);
 
-	len += snprintf(page + len, PAGE_SIZE - len,
+	len += scnprintf(page + len, PAGE_SIZE - len,
 		     "Data in last 96 intervals (24 hours):\n");
-	len += snprintf(page + len, PAGE_SIZE - len,
+	len += scnprintf(page + len, PAGE_SIZE - len,
 		     "   %d Line Code Violations, %d Path Code Violations, %d E-Bit Errors\n",
 		     last96.line_code_violations, last96.path_code_violations,
 		     last96.e_bit_errors);
-	len += snprintf(page + len, PAGE_SIZE - len,
+	len += scnprintf(page + len, PAGE_SIZE - len,
 		     "   %d Slip Secs, %d Fr Loss Secs, %d Line Err Secs, %d Degraded Mins\n",
 		     last96.slip_secs, last96.fr_loss_secs,
 		     last96.line_err_secs, last96.degraded_mins);
-	len += snprintf(page + len, PAGE_SIZE - len,
+	len += scnprintf(page + len, PAGE_SIZE - len,
 		     "   %d Errored Secs, %d Bursty Err Secs, %d Severely Err Secs, %d Unavail Secs\n",
 		     last96.errored_secs, last96.bursty_err_secs,
 		     last96.severely_err_secs, last96.unavail_secs);
 
     }
 
-//      len +=snprintf( page + len, PAGE_SIZE - len, "Special events:\n" );
-//      len +=snprintf( page + len, PAGE_SIZE - len, "\tstat_pri/missed: %u / %u\n", board->stat_pri_races, board->stat_pri_races_missed );
-//      len +=snprintf( page + len, PAGE_SIZE - len, "\tstat_pti/missed: %u / %u\n", board->stat_pti_races, board->stat_pti_races_missed );
+//      len +=scnprintf( page + len, PAGE_SIZE - len, "Special events:\n" );
+//      len +=scnprintf( page + len, PAGE_SIZE - len, "\tstat_pri/missed: %u / %u\n", board->stat_pri_races, board->stat_pri_races_missed );
+//      len +=scnprintf( page + len, PAGE_SIZE - len, "\tstat_pti/missed: %u / %u\n", board->stat_pti_races, board->stat_pti_races_missed );
     return len;
 }
 
@@ -2305,8 +2305,8 @@
     {
 	for (i = 0; i < 32; i++)
 	    if ((1 << i) & timeslots)
-		len += snprintf(page + len, PAGE_SIZE - len, "%d ", i);
-	len += snprintf(page + len, PAGE_SIZE - len, "\n");
+		len += scnprintf(page + len, PAGE_SIZE - len, "%d ", i);
+	len += scnprintf(page + len, PAGE_SIZE - len, "\n");
     }
     else if (!strcmp(file->name, FILENAME_FRAMING))
     {
@@ -2314,7 +2314,7 @@
 	while (slicecom_framings[i].value &&
 	       slicecom_framings[i].value != board->framing)
 	    i++;
-	len += snprintf(page + len, PAGE_SIZE - len, "%s\n",
+	len += scnprintf(page + len, PAGE_SIZE - len, "%s\n",
 		     slicecom_framings[i].name);
     }
     else if (!strcmp(file->name, FILENAME_LINECODE))
@@ -2323,7 +2323,7 @@
 	while (slicecom_linecodes[i].value &&
 	       slicecom_linecodes[i].value != board->linecode)
 	    i++;
-	len += snprintf(page + len, PAGE_SIZE - len, "%s\n",
+	len += scnprintf(page + len, PAGE_SIZE - len, "%s\n",
 		     slicecom_linecodes[i].name);
     }
     else if (!strcmp(file->name, FILENAME_CLOCK_SOURCE))
@@ -2333,7 +2333,7 @@
 	       slicecom_clock_sources[i].value != board->clock_source)
 	    i++;
 	len +=
-	    snprintf(page + len, PAGE_SIZE - len, "%s\n",
+	    scnprintf(page + len, PAGE_SIZE - len, "%s\n",
 		     slicecom_clock_sources[i].name);
     }
     else if (!strcmp(file->name, FILENAME_LOOPBACK))
@@ -2342,18 +2342,18 @@
 	while (slicecom_loopbacks[i].value &&
 	       slicecom_loopbacks[i].value != board->loopback)
 	    i++;
-	len += snprintf(page + len, PAGE_SIZE - len, "%s\n",
+	len += scnprintf(page + len, PAGE_SIZE - len, "%s\n",
 		     slicecom_loopbacks[i].name);
     }
     /* We set permissions to write-only for REG and LBIREG, but root can read them anyway: */
     else if (!strcmp(file->name, FILENAME_REG))
     {
-	len += snprintf(page + len, PAGE_SIZE - len,
+	len += scnprintf(page + len, PAGE_SIZE - len,
 		     "%s: " FILENAME_REG ": write-only file\n", dev->name);
     }
     else if (!strcmp(file->name, FILENAME_LBIREG))
     {
-	len += snprintf(page + len, PAGE_SIZE - len,
+	len += scnprintf(page + len, PAGE_SIZE - len,
 		     "%s: " FILENAME_LBIREG ": write-only file\n", dev->name);
     }
     else
--- diff/drivers/net/wan/comx-proto-lapb.c	2003-10-09 09:47:34.000000000 +0100
+++ source/drivers/net/wan/comx-proto-lapb.c	2004-02-09 10:39:54.000000000 +0000
@@ -44,7 +44,7 @@
 	if (!dev || !dev->priv) {
 		dev_kfree_skb(skb);
 	} else {
-		lapb_data_received(dev->priv, skb);
+		lapb_data_received(dev, skb);
 	}
 }
 
@@ -82,7 +82,7 @@
 		return -ENODEV;
 	}
 
-	err = lapb_connect_request(ch);
+	err = lapb_connect_request(dev);
 
 	if (ch->debug_flags & DEBUG_COMX_LAPB) {
 		comx_debug(dev, "%s: lapb opened, error code: %d\n", 
@@ -108,7 +108,7 @@
 		comx_debug(dev, "%s: lapb closed\n", dev->name);
 	}
 
-	lapb_disconnect_request(ch);
+	lapb_disconnect_request(dev);
 
 	ch->init_status &= ~LINE_OPEN;
 	ch->line_status &= ~PROTO_UP;
@@ -130,11 +130,11 @@
 			case 0x00:	
 				break;	// transmit
 			case 0x01:	
-				lapb_connect_request(ch);
+				lapb_connect_request(dev);
 				kfree_skb(skb);
 				return 0;
 			case 0x02:	
-				lapb_disconnect_request(ch);
+				lapb_disconnect_request(dev);
 			default:
 				kfree_skb(skb);
 				return 0;
@@ -145,7 +145,7 @@
 	netif_stop_queue(dev);
 	
 	if ((skb2 = skb_clone(skb, GFP_ATOMIC)) != NULL) {
-		lapb_data_request(ch, skb2);
+		lapb_data_request(dev, skb2);
 	}
 
 	return FRAME_ACCEPTED;
@@ -157,7 +157,7 @@
 	int len = 0;
 
 	len += sprintf(page + len, "Line status: ");
-	if (lapb_getparms(dev->priv, &parms) != LAPB_OK) {
+	if (lapb_getparms(dev, &parms) != LAPB_OK) {
 		len += sprintf(page + len, "not initialized\n");
 		return len;
 	}
@@ -178,7 +178,7 @@
 	struct lapb_parms_struct parms;
 	int len = 0;
 
-	if (lapb_getparms(dev->priv, &parms)) {
+	if (lapb_getparms(dev, &parms)) {
 		return -ENODEV;
 	}
 
@@ -223,7 +223,7 @@
 	unsigned long parm;
 	char *page;
 
-	if (lapb_getparms(dev->priv, &parms)) {
+	if (lapb_getparms(dev, &parms)) {
 		return -ENODEV;
 	}
 
@@ -243,23 +243,23 @@
 		parm=simple_strtoul(page,NULL,10);
 		if (parm > 0 && parm < 100) {
 			parms.t1=parm;
-			lapb_setparms(dev->priv, &parms);
+			lapb_setparms(dev, &parms);
 		}
 	} else if (strcmp(entry->name, FILENAME_T2) == 0) {
 		parm=simple_strtoul(page, NULL, 10);
 		if (parm > 0 && parm < 100) {
 			parms.t2=parm;
-			lapb_setparms(dev->priv, &parms);
+			lapb_setparms(dev, &parms);
 		}
 	} else if (strcmp(entry->name, FILENAME_N2) == 0) {
 		parm=simple_strtoul(page, NULL, 10);
 		if (parm > 0 && parm < 100) {
 			parms.n2=parm;
-			lapb_setparms(dev->priv, &parms);
+			lapb_setparms(dev, &parms);
 		}
 	} else if (strcmp(entry->name, FILENAME_WINDOW) == 0) {
 		parms.window = simple_strtoul(page, NULL, 10);
-		lapb_setparms(dev->priv, &parms);
+		lapb_setparms(dev, &parms);
 	} else if (strcmp(entry->name, FILENAME_MODE) == 0) {
 		if (comx_strcasecmp(page, "dte") == 0) {
 			parms.mode &= ~(LAPB_DCE | LAPB_DTE); 
@@ -276,7 +276,7 @@
 			parms.mode &= ~LAPB_STANDARD; 
 			parms.mode |= LAPB_EXTENDED;
 		}
-		lapb_setparms(dev->priv, &parms);
+		lapb_setparms(dev, &parms);
 	} else {
 		printk(KERN_ERR "comxlapb_write_proc: internal error, filename %s\n", 
 			entry->name);
@@ -287,9 +287,9 @@
 	return count;
 }
 
-static void comxlapb_connected(void *token, int reason)
+static void comxlapb_connected(struct net_device *dev, int reason)
 {
-	struct comx_channel *ch = token; 
+	struct comx_channel *ch = dev->priv; 
 	struct proc_dir_entry *comxdir = ch->procdir->subdir;
 
 	if (ch->debug_flags & DEBUG_COMX_LAPB) {
@@ -327,9 +327,9 @@
 	comx_status(ch->dev, ch->line_status);
 }
 
-static void comxlapb_disconnected(void *token, int reason)
+static void comxlapb_disconnected(struct net_device *dev, int reason)
 {
-	struct comx_channel *ch = token; 
+	struct comx_channel *ch = dev->priv; 
 	struct proc_dir_entry *comxdir = ch->procdir->subdir;
 
 	if (ch->debug_flags & DEBUG_COMX_LAPB) {
@@ -366,9 +366,9 @@
 	comx_status(ch->dev, ch->line_status);
 }
 
-static int comxlapb_data_indication(void *token, struct sk_buff *skb)
+static int comxlapb_data_indication(struct net_device *dev, struct sk_buff *skb)
 {
-	struct comx_channel *ch = token; 
+	struct comx_channel *ch = dev->priv; 
 
 	if (ch->dev->type == ARPHRD_X25) {
 		skb_push(skb, 1);
@@ -387,9 +387,9 @@
 	return comx_rx(ch->dev, skb);
 }
 
-static void comxlapb_data_transmit(void *token, struct sk_buff *skb)
+static void comxlapb_data_transmit(struct net_device *dev, struct sk_buff *skb)
 {
-	struct comx_channel *ch = token; 
+	struct comx_channel *ch = dev->priv; 
 
 	if (ch->HW_send_packet) {
 		ch->HW_send_packet(ch->dev, skb);
@@ -417,7 +417,7 @@
 	if (ch->debug_flags & DEBUG_COMX_LAPB) {
 		comx_debug(dev, "%s: unregistering lapb\n", dev->name);
 	}
-	lapb_unregister(dev->priv);
+	lapb_unregister(dev);
 
 	remove_proc_entry(FILENAME_T1, ch->procdir);
 	remove_proc_entry(FILENAME_T2, ch->procdir);
@@ -453,7 +453,7 @@
 	lapbreg.disconnect_indication = comxlapb_disconnected;
 	lapbreg.data_indication = comxlapb_data_indication;
 	lapbreg.data_transmit = comxlapb_data_transmit;
-	if (lapb_register(dev->priv, &lapbreg)) {
+	if (lapb_register(dev, &lapbreg)) {
 		return -ENOMEM;
 	}
 	if (ch->debug_flags & DEBUG_COMX_LAPB) {
--- diff/drivers/net/wan/cosa.c	2003-10-27 09:20:38.000000000 +0000
+++ source/drivers/net/wan/cosa.c	2004-02-09 10:39:54.000000000 +0000
@@ -594,40 +594,47 @@
 
 /*---------- SPPP/HDLC netdevice ---------- */
 
+static void cosa_setup(struct net_device *d)
+{
+	d->open = cosa_sppp_open;
+	d->stop = cosa_sppp_close;
+	d->hard_start_xmit = cosa_sppp_tx;
+	d->do_ioctl = cosa_sppp_ioctl;
+	d->get_stats = cosa_net_stats;
+	d->tx_timeout = cosa_sppp_timeout;
+	d->watchdog_timeo = TX_TIMEOUT;
+}
+
 static void sppp_channel_init(struct channel_data *chan)
 {
 	struct net_device *d;
 	chan->if_ptr = &chan->pppdev;
-	chan->pppdev.dev = kmalloc(sizeof(struct net_device), GFP_KERNEL);
-	memset(chan->pppdev.dev, 0, sizeof(struct net_device));
+	d = alloc_netdev(0, chan->name, cosa_setup);
+	if (!d) {
+		printk(KERN_WARNING "%s: alloc_netdev failed.\n", chan->name);
+		return;
+	}
+	chan->pppdev.dev = d;
 	sppp_attach(&chan->pppdev);
-	d=chan->pppdev.dev;
-	strcpy(d->name, chan->name);
 	d->base_addr = chan->cosa->datareg;
 	d->irq = chan->cosa->irq;
 	d->dma = chan->cosa->dma;
 	d->priv = chan;
-	d->init = NULL;
-	d->open = cosa_sppp_open;
-	d->stop = cosa_sppp_close;
-	d->hard_start_xmit = cosa_sppp_tx;
-	d->do_ioctl = cosa_sppp_ioctl;
-	d->get_stats = cosa_net_stats;
-	d->tx_timeout = cosa_sppp_timeout;
-	d->watchdog_timeo = TX_TIMEOUT;
 	if (register_netdev(d)) {
 		printk(KERN_WARNING "%s: register_netdev failed.\n", d->name);
-		sppp_detach(chan->pppdev.dev);
-		free_netdev(chan->pppdev.dev);
+		sppp_detach(d);
+		free_netdev(d);
+		chan->pppdev.dev = NULL;
 		return;
 	}
 }
 
 static void sppp_channel_delete(struct channel_data *chan)
 {
-	sppp_detach(chan->pppdev.dev);
 	unregister_netdev(chan->pppdev.dev);
+	sppp_detach(chan->pppdev.dev);
 	free_netdev(chan->pppdev.dev);
+	chan->pppdev.dev = NULL;
 }
 
 static int cosa_sppp_open(struct net_device *d)
--- diff/drivers/net/wan/dlci.c	2003-09-30 15:46:16.000000000 +0100
+++ source/drivers/net/wan/dlci.c	2004-02-09 10:39:54.000000000 +0000
@@ -414,7 +414,7 @@
 
  err2:
 	rtnl_unlock();
-	kfree(master);
+	free_netdev(master);
  err1:
 	dev_put(slave);
 	return(err);
--- diff/drivers/net/wan/dscc4.c	2003-10-09 09:47:34.000000000 +0100
+++ source/drivers/net/wan/dscc4.c	2004-02-09 10:39:54.000000000 +0000
@@ -228,7 +228,7 @@
 
 	unsigned short encoding;
 	unsigned short parity;
-	hdlc_device hdlc;
+	struct net_device *dev;
 	sync_serial_settings settings;
 	u32 __pad __attribute__ ((aligned (4)));
 };
@@ -364,7 +364,7 @@
 static void dscc4_timer(unsigned long);
 static void dscc4_tx_timeout(struct net_device *);
 static irqreturn_t dscc4_irq(int irq, void *dev_id, struct pt_regs *ptregs);
-static int dscc4_hdlc_attach(hdlc_device *, unsigned short, unsigned short);
+static int dscc4_hdlc_attach(struct net_device *, unsigned short, unsigned short);
 static int dscc4_set_iface(struct dscc4_dev_priv *, struct net_device *);
 static inline int dscc4_set_quartz(struct dscc4_dev_priv *, int);
 #ifdef DSCC4_POLLING
@@ -373,7 +373,12 @@
 
 static inline struct dscc4_dev_priv *dscc4_priv(struct net_device *dev)
 {
-	return list_entry(dev, struct dscc4_dev_priv, hdlc.netdev);
+	return dev_to_hdlc(dev)->priv;
+}
+
+static inline struct net_device *dscc4_to_dev(struct dscc4_dev_priv *p)
+{
+	return p->dev;
 }
 
 static void scc_patchl(u32 mask, u32 value, struct dscc4_dev_priv *dpriv,
@@ -636,7 +641,7 @@
 				struct net_device *dev)
 {
 	struct RxFD *rx_fd = dpriv->rx_fd + dpriv->rx_current%RX_RING_SIZE;
-	struct net_device_stats *stats = &dpriv->hdlc.stats;
+	struct net_device_stats *stats = hdlc_stats(dev);
 	struct pci_dev *pdev = dpriv->pci_priv->pdev;
 	struct sk_buff *skb;
 	int pkt_len;
@@ -689,10 +694,12 @@
 	root = ppriv->root;
 
 	for (i = 0; i < dev_per_card; i++)
-		unregister_hdlc_device(&root[i].hdlc);
+		unregister_hdlc_device(dscc4_to_dev(&root[i]));
 
 	pci_set_drvdata(pdev, NULL);
 
+	for (i = 0; i < dev_per_card; i++)
+		free_netdev(root[i].dev);
 	kfree(root);
 	kfree(ppriv);
 }
@@ -874,17 +881,31 @@
 	}
 	memset(root, 0, dev_per_card*sizeof(*root));
 
+	for (i = 0; i < dev_per_card; i++) {
+		root[i].dev = alloc_hdlcdev(root + i);
+		if (!root[i].dev) {
+			while (i--)
+				free_netdev(root[i].dev);
+			goto err_free_dev;
+		}
+	}
+
 	ppriv = (struct dscc4_pci_priv *) kmalloc(sizeof(*ppriv), GFP_KERNEL);
 	if (!ppriv) {
 		printk(KERN_ERR "%s: can't allocate private data\n", DRV_NAME);
-		goto err_free_dev;
+		goto err_free_dev2;
 	}
 	memset(ppriv, 0, sizeof(struct dscc4_pci_priv));
+	ret = dscc4_set_quartz(root, quartz);
+	if (ret < 0)
+		goto err_free_priv;
+	ppriv->root = root;
+	spin_lock_init(&ppriv->lock);
 
 	for (i = 0; i < dev_per_card; i++) {
 		struct dscc4_dev_priv *dpriv = root + i;
-		hdlc_device *hdlc = &dpriv->hdlc;
-		struct net_device *d = hdlc_to_dev(hdlc);
+		struct net_device *d = dscc4_to_dev(dpriv);
+		hdlc_device *hdlc = dev_to_hdlc(d);
 
 	        d->base_addr = ioaddr;
 		d->init = NULL;
@@ -905,36 +926,34 @@
 		hdlc->xmit = dscc4_start_xmit;
 		hdlc->attach = dscc4_hdlc_attach;
 
-		ret = register_hdlc_device(hdlc);
-		if (ret < 0) {
-			printk(KERN_ERR "%s: unable to register\n", DRV_NAME);
-			goto err_unregister;
-	        }
-
 		dscc4_init_registers(dpriv, d);
 		dpriv->parity = PARITY_CRC16_PR0_CCITT;
 		dpriv->encoding = ENCODING_NRZ;
-
+	
 		ret = dscc4_init_ring(d);
+		if (ret < 0)
+			goto err_unregister;
+
+		ret = register_hdlc_device(d);
 		if (ret < 0) {
-			unregister_hdlc_device(hdlc);
+			printk(KERN_ERR "%s: unable to register\n", DRV_NAME);
+			dscc4_release_ring(dpriv);
 			goto err_unregister;
-		}
+	        }
 	}
-	ret = dscc4_set_quartz(root, quartz);
-	if (ret < 0)
-		goto err_unregister;
-	ppriv->root = root;
-	spin_lock_init(&ppriv->lock);
 	pci_set_drvdata(pdev, ppriv);
 	return ret;
 
 err_unregister:
 	while (--i >= 0) {
 		dscc4_release_ring(root + i);
-		unregister_hdlc_device(&root[i].hdlc);
+		unregister_hdlc_device(dscc4_to_dev(&root[i]));
 	}
+err_free_priv:
 	kfree(ppriv);
+err_free_dev2:
+	for (i = 0; i < dev_per_card; i++)
+		free_netdev(root[i].dev);
 err_free_dev:
 	kfree(root);
 err_out:
@@ -964,7 +983,7 @@
 	sync_serial_settings *settings = &dpriv->settings;
 
 	if (settings->loopback && (settings->clock_type != CLOCK_INT)) {
-		struct net_device *dev = hdlc_to_dev(&dpriv->hdlc);
+		struct net_device *dev = dscc4_to_dev(dpriv);
 
 		printk(KERN_INFO "%s: loopback requires clock\n", dev->name);
 		return -1;
@@ -1015,14 +1034,13 @@
 static int dscc4_open(struct net_device *dev)
 {
 	struct dscc4_dev_priv *dpriv = dscc4_priv(dev);
-	hdlc_device *hdlc = &dpriv->hdlc;
 	struct dscc4_pci_priv *ppriv;
 	int ret = -EAGAIN;
 
 	if ((dscc4_loopback_check(dpriv) < 0) || !dev->hard_start_xmit)
 		goto err;
 
-	if ((ret = hdlc_open(hdlc)))
+	if ((ret = hdlc_open(dev)))
 		goto err;
 
 	ppriv = dpriv->pci_priv;
@@ -1103,7 +1121,7 @@
 	scc_writel(0xffffffff, dpriv, dev, IMR);
 	scc_patchl(PowerUp | Vis, 0, dpriv, dev, CCR0);
 err_out:
-	hdlc_close(hdlc);
+	hdlc_close(dev);
 err:
 	return ret;
 }
@@ -1155,7 +1173,6 @@
 static int dscc4_close(struct net_device *dev)
 {
 	struct dscc4_dev_priv *dpriv = dscc4_priv(dev);
-	hdlc_device *hdlc = dev_to_hdlc(dev);
 
 	del_timer_sync(&dpriv->timer);
 	netif_stop_queue(dev);
@@ -1166,7 +1183,7 @@
 
 	dpriv->flags |= FakeReset;
 
-	hdlc_close(hdlc);
+	hdlc_close(dev);
 
 	return 0;
 }
@@ -1467,7 +1484,7 @@
 	int i, handled = 1;
 
 	priv = root->pci_priv;
-	dev = hdlc_to_dev(&root->hdlc);
+	dev = dscc4_to_dev(root);
 
 	spin_lock_irqsave(&priv->lock, flags);
 
@@ -1518,7 +1535,7 @@
 static inline void dscc4_tx_irq(struct dscc4_pci_priv *ppriv,
 				struct dscc4_dev_priv *dpriv)
 {
-	struct net_device *dev = hdlc_to_dev(&dpriv->hdlc);
+	struct net_device *dev = dscc4_to_dev(dpriv);
 	u32 state;
 	int cur, loop = 0;
 
@@ -1549,7 +1566,7 @@
 
 	if (state & SccEvt) {
 		if (state & Alls) {
-			struct net_device_stats *stats = &dpriv->hdlc.stats;
+			struct net_device_stats *stats = hdlc_stats(dev);
 			struct sk_buff *skb;
 			struct TxFD *tx_fd;
 
@@ -1677,7 +1694,7 @@
 		}
 		if (state & Err) {
 			printk(KERN_INFO "%s: Tx ERR\n", dev->name);
-			dev_to_hdlc(dev)->stats.tx_errors++;
+			hdlc_stats(dev)->tx_errors++;
 			state &= ~Err;
 		}
 	}
@@ -1687,7 +1704,7 @@
 static inline void dscc4_rx_irq(struct dscc4_pci_priv *priv,
 				    struct dscc4_dev_priv *dpriv)
 {
-	struct net_device *dev = hdlc_to_dev(&dpriv->hdlc);
+	struct net_device *dev = dscc4_to_dev(dpriv);
 	u32 state;
 	int cur;
 
@@ -1813,7 +1830,7 @@
 				if (!(rx_fd->state2 & DataComplete))
 					break;
 				if (rx_fd->state2 & FrameAborted) {
-					dev_to_hdlc(dev)->stats.rx_over_errors++;
+					hdlc_stats(dev)->rx_over_errors++;
 					rx_fd->state1 |= Hold;
 					rx_fd->state2 = 0x00000000;
 					rx_fd->end = 0xbabeface;
@@ -1961,7 +1978,7 @@
 	ppriv = pci_get_drvdata(pdev);
 	root = ppriv->root;
 
-	ioaddr = hdlc_to_dev(&root->hdlc)->base_addr;
+	ioaddr = dscc4_to_dev(root)->base_addr;
 
 	dscc4_pci_reset(pdev, ioaddr);
 
@@ -1988,10 +2005,9 @@
 			   pci_resource_len(pdev, 0));
 }
 
-static int dscc4_hdlc_attach(hdlc_device *hdlc, unsigned short encoding,
+static int dscc4_hdlc_attach(struct net_device *dev, unsigned short encoding,
 	unsigned short parity)
 {
-	struct net_device *dev = hdlc_to_dev(hdlc);
 	struct dscc4_dev_priv *dpriv = dscc4_priv(dev);
 
 	if (encoding != ENCODING_NRZ &&
--- diff/drivers/net/wan/farsync.c	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/net/wan/farsync.c	2004-02-09 10:39:54.000000000 +0000
@@ -328,7 +328,7 @@
 /*      Per port (line or channel) information
  */
 struct fst_port_info {
-        hdlc_device             hdlc;   /* HDLC device struct - must be first */
+        struct net_device      *dev;
         struct fst_card_info   *card;   /* Card we're associated with */
         int                     index;  /* Port index on the card */
         int                     hwif;   /* Line hardware (lineInterface copy) */
@@ -357,9 +357,8 @@
 };
 
 /* Convert an HDLC device pointer into a port info pointer and similar */
-#define hdlc_to_port(H) ((struct fst_port_info *)(H))
-#define dev_to_port(D)  hdlc_to_port(dev_to_hdlc(D))
-#define port_to_dev(P)  hdlc_to_dev(&(P)->hdlc)
+#define dev_to_port(D)  (dev_to_hdlc(D)->priv)
+#define port_to_dev(P)  ((P)->dev)
 
 
 /*
@@ -651,6 +650,8 @@
         int rxp;
         unsigned short len;
         struct sk_buff *skb;
+	struct net_device *dev = port_to_dev(port);
+	struct net_device_stats *stats = hdlc_stats(dev);
         int i;
 
 
@@ -678,24 +679,24 @@
                                         len );
         if ( dmabits != ( RX_STP | RX_ENP ) || len > LEN_RX_BUFFER - 2 )
         {
-                port->hdlc.stats.rx_errors++;
+                stats->rx_errors++;
 
                 /* Update error stats and discard buffer */
                 if ( dmabits & RX_OFLO )
                 {
-                        port->hdlc.stats.rx_fifo_errors++;
+                        stats->rx_fifo_errors++;
                 }
                 if ( dmabits & RX_CRC )
                 {
-                        port->hdlc.stats.rx_crc_errors++;
+                        stats->rx_crc_errors++;
                 }
                 if ( dmabits & RX_FRAM )
                 {
-                        port->hdlc.stats.rx_frame_errors++;
+                        stats->rx_frame_errors++;
                 }
                 if ( dmabits == ( RX_STP | RX_ENP ))
                 {
-                        port->hdlc.stats.rx_length_errors++;
+                        stats->rx_length_errors++;
                 }
 
                 /* Discard buffer descriptors until we see the end of packet
@@ -732,7 +733,7 @@
         {
                 dbg ( DBG_RX,"intr_rx: can't allocate buffer\n");
 
-                port->hdlc.stats.rx_dropped++;
+                stats->rx_dropped++;
 
                 /* Return descriptor to card */
                 FST_WRB ( card, rxDescrRing[pi][rxp].bits, DMA_OWN );
@@ -756,16 +757,16 @@
                 port->rxpos = rxp;
 
         /* Update stats */
-        port->hdlc.stats.rx_packets++;
-        port->hdlc.stats.rx_bytes += len;
+        stats->rx_packets++;
+        stats->rx_bytes += len;
 
         /* Push upstream */
         skb->mac.raw = skb->data;
-        skb->dev = hdlc_to_dev ( &port->hdlc );
+        skb->dev = dev;
         skb->protocol = hdlc_type_trans(skb, skb->dev);
         netif_rx ( skb );
 
-        port_to_dev ( port )->last_rx = jiffies;
+        dev->last_rx = jiffies;
 }
 
 
@@ -835,8 +836,8 @@
                          * always load up the entire packet for DMA.
                          */
                         dbg ( DBG_TX,"Tx underflow port %d\n", event & 0x03 );
-                        port->hdlc.stats.tx_errors++;
-                        port->hdlc.stats.tx_fifo_errors++;
+                        hdlc_stats(port_to_dev(port))->tx_errors++;
+                        hdlc_stats(port_to_dev(port))->tx_fifo_errors++;
                         break;
 
                 case INIT_CPLT:
@@ -1309,7 +1310,7 @@
 {
         int err;
 
-        err = hdlc_open ( dev_to_hdlc ( dev ));
+        err = hdlc_open (dev);
         if ( err )
                 return err;
 
@@ -1323,12 +1324,12 @@
 {
         netif_stop_queue ( dev );
         fst_closeport ( dev_to_port ( dev ));
-        hdlc_close ( dev_to_hdlc  ( dev ));
+        hdlc_close ( dev );
         return 0;
 }
 
 static int
-fst_attach ( hdlc_device *hdlc, unsigned short encoding, unsigned short parity )
+fst_attach ( struct net_device *dev, unsigned short encoding, unsigned short parity )
 {
         /* Setting currently fixed in FarSync card so we check and forget */
         if ( encoding != ENCODING_NRZ || parity != PARITY_CRC16_PR1_CCITT )
@@ -1341,13 +1342,14 @@
 fst_tx_timeout ( struct net_device *dev )
 {
         struct fst_port_info *port;
+	struct net_device_stats *stats = hdlc_stats(dev);
 
         dbg ( DBG_INTR | DBG_TX,"tx_timeout\n");
 
         port = dev_to_port ( dev );
 
-        port->hdlc.stats.tx_errors++;
-        port->hdlc.stats.tx_aborted_errors++;
+        stats->tx_errors++;
+        stats->tx_aborted_errors++;
 
         if ( port->txcnt > 0 )
                 fst_issue_cmd ( port, ABORTTX );
@@ -1360,6 +1362,7 @@
 static int
 fst_start_xmit ( struct sk_buff *skb, struct net_device *dev )
 {
+	struct net_device_stats *stats = hdlc_stats(dev);
         struct fst_card_info *card;
         struct fst_port_info *port;
         unsigned char dmabits;
@@ -1374,8 +1377,8 @@
         if ( ! netif_carrier_ok ( dev ))
         {
                 dev_kfree_skb ( skb );
-                port->hdlc.stats.tx_errors++;
-                port->hdlc.stats.tx_carrier_errors++;
+                stats->tx_errors++;
+                stats->tx_carrier_errors++;
                 return 0;
         }
 
@@ -1385,7 +1388,7 @@
                 dbg ( DBG_TX,"Packet too large %d vs %d\n", skb->len,
                                                 LEN_TX_BUFFER );
                 dev_kfree_skb ( skb );
-                port->hdlc.stats.tx_errors++;
+                stats->tx_errors++;
                 return 0;
         }
 
@@ -1399,7 +1402,7 @@
                 spin_unlock_irqrestore ( &card->card_lock, flags );
                 dbg ( DBG_TX,"Out of Tx buffers\n");
                 dev_kfree_skb ( skb );
-                port->hdlc.stats.tx_errors++;
+                stats->tx_errors++;
                 return 0;
         }
         if ( ++port->txpos >= NUM_TX_BUFFER )
@@ -1419,8 +1422,8 @@
         FST_WRW ( card, txDescrRing[pi][txp].bcnt, cnv_bcnt ( skb->len ));
         FST_WRB ( card, txDescrRing[pi][txp].bits, DMA_OWN | TX_STP | TX_ENP );
 
-        port->hdlc.stats.tx_packets++;
-        port->hdlc.stats.tx_bytes += skb->len;
+        stats->tx_packets++;
+        stats->tx_bytes += skb->len;
 
         dev_kfree_skb ( skb );
 
@@ -1447,55 +1450,29 @@
 {
         int i;
         int err;
-        struct net_device *dev;
 
         /* We're working on a number of ports based on the card ID. If the
          * firmware detects something different later (should never happen)
          * we'll have to revise it in some way then.
          */
-        for ( i = 0 ; i < card->nports ; i++ )
-        {
-                card->ports[i].card   = card;
-                card->ports[i].index  = i;
-                card->ports[i].run    = 0;
-
-                dev = hdlc_to_dev ( &card->ports[i].hdlc );
-
-                /* Fill in the net device info */
-                                /* Since this is a PCI setup this is purely
-                                 * informational. Give them the buffer addresses
-                                 * and basic card I/O.
-                                 */
-                dev->mem_start   = card->phys_mem
-                                 + BUF_OFFSET ( txBuffer[i][0][0]);
-                dev->mem_end     = card->phys_mem
-                                 + BUF_OFFSET ( txBuffer[i][NUM_TX_BUFFER][0]);
-                dev->base_addr   = card->pci_conf;
-                dev->irq         = card->irq;
-
-                dev->tx_queue_len          = FST_TX_QUEUE_LEN;
-                dev->open                  = fst_open;
-                dev->stop                  = fst_close;
-                dev->do_ioctl              = fst_ioctl;
-                dev->watchdog_timeo        = FST_TX_TIMEOUT;
-                dev->tx_timeout            = fst_tx_timeout;
-                card->ports[i].hdlc.attach = fst_attach;
-                card->ports[i].hdlc.xmit   = fst_start_xmit;
-
-                if (( err = register_hdlc_device ( &card->ports[i].hdlc )) < 0 )
-                {
+        for ( i = 0 ; i < card->nports ; i++ ) {
+                err = register_hdlc_device(card->ports[i].dev);
+                if (err < 0) {
+			int j;
                         printk_err ("Cannot register HDLC device for port %d"
                                     " (errno %d)\n", i, -err );
+			for (j = i; j < card->nports; j++) {
+				free_netdev(card->ports[j].dev);
+				card->ports[j].dev = NULL;
+			}
                         card->nports = i;
                         break;
                 }
         }
 
-        spin_lock_init ( &card->card_lock );
-
         printk ( KERN_INFO "%s-%s: %s IRQ%d, %d ports\n",
-                        hdlc_to_dev(&card->ports[0].hdlc)->name,
-                        hdlc_to_dev(&card->ports[card->nports-1].hdlc)->name,
+                        port_to_dev(&card->ports[0])->name,
+                        port_to_dev(&card->ports[card->nports-1])->name,
                         type_strings[card->type], card->irq, card->nports );
 }
 
@@ -1510,6 +1487,7 @@
         static int firsttime_done = 0;
         struct fst_card_info *card;
         int err = 0;
+	int i;
 
         if ( ! firsttime_done )
         {
@@ -1546,6 +1524,46 @@
 
         card->state       = FST_UNINIT;
 
+        spin_lock_init ( &card->card_lock );
+
+        for ( i = 0 ; i < card->nports ; i++ ) {
+		struct net_device *dev = alloc_hdlcdev(&card->ports[i]);
+		hdlc_device *hdlc;
+		if (!dev) {
+			while (i--)
+				free_netdev(card->ports[i].dev);
+			printk_err ("FarSync: out of memory\n");
+			goto error_free_card;
+		}
+		card->ports[i].dev    = dev;
+                card->ports[i].card   = card;
+                card->ports[i].index  = i;
+                card->ports[i].run    = 0;
+
+		hdlc = dev_to_hdlc(dev);
+
+                /* Fill in the net device info */
+		/* Since this is a PCI setup this is purely
+		 * informational. Give them the buffer addresses
+		 * and basic card I/O.
+		 */
+                dev->mem_start   = card->phys_mem
+                                 + BUF_OFFSET ( txBuffer[i][0][0]);
+                dev->mem_end     = card->phys_mem
+                                 + BUF_OFFSET ( txBuffer[i][NUM_TX_BUFFER][0]);
+                dev->base_addr   = card->pci_conf;
+                dev->irq         = card->irq;
+
+                dev->tx_queue_len          = FST_TX_QUEUE_LEN;
+                dev->open                  = fst_open;
+                dev->stop                  = fst_close;
+                dev->do_ioctl              = fst_ioctl;
+                dev->watchdog_timeo        = FST_TX_TIMEOUT;
+                dev->tx_timeout            = fst_tx_timeout;
+                hdlc->attach = fst_attach;
+                hdlc->xmit   = fst_start_xmit;
+	}
+
         dbg ( DBG_PCI,"type %d nports %d irq %d\n", card->type,
                         card->nports, card->irq );
         dbg ( DBG_PCI,"conf %04x mem %08x ctlmem %08x\n",
@@ -1557,7 +1575,7 @@
                 printk_err ("Unable to get config I/O @ 0x%04X\n",
                                                 card->pci_conf );
                 err = -ENODEV;
-                goto error_free_card;
+                goto error_free_ports;
         }
         if ( ! request_mem_region ( card->phys_mem, FST_MEMSIZE,"Shared RAM"))
         {
@@ -1628,6 +1646,9 @@
 error_release_io:
         release_region ( card->pci_conf, 0x80 );
 
+error_free_ports:
+	for (i = 0; i < card->nports; i++)
+		free_netdev(card->ports[i].dev);
 error_free_card:
         kfree ( card );
         return err;
@@ -1647,7 +1668,8 @@
 
         for ( i = 0 ; i < card->nports ; i++ )
         {
-                unregister_hdlc_device ( &card->ports[i].hdlc );
+		struct net_device *dev = port_to_dev(&card->ports[i]);
+                unregister_hdlc_device(dev);
         }
 
         fst_disable_intr ( card );
@@ -1660,6 +1682,9 @@
         release_mem_region ( card->phys_mem, FST_MEMSIZE );
         release_region ( card->pci_conf, 0x80 );
 
+	for (i = 0; i < card->nports; i++)
+		free_netdev(card->ports[i].dev);
+
         kfree ( card );
 }
 
--- diff/drivers/net/wan/hd6457x.c	2003-08-20 14:16:10.000000000 +0100
+++ source/drivers/net/wan/hd6457x.c	2004-02-09 10:39:54.000000000 +0000
@@ -73,6 +73,11 @@
 #define writea(value, ptr)		writel(value, ptr)
 #endif
 
+static inline struct net_device *port_to_dev(port_t *port)
+{
+	return port->dev;
+}
+
 static inline int sca_intr_status(card_t *card)
 {
 	u8 result = 0;
@@ -110,22 +115,11 @@
 	return result;
 }
 
-
-
-static inline port_t* hdlc_to_port(hdlc_device *hdlc)
-{
-	return (port_t*)hdlc;
-}
-
-
-
 static inline port_t* dev_to_port(struct net_device *dev)
 {
-	return hdlc_to_port(dev_to_hdlc(dev));
+	return dev_to_hdlc(dev)->priv;
 }
 
-
-
 static inline u16 next_desc(port_t *port, u16 desc, int transmit)
 {
 	return (desc + 1) % (transmit ? port_to_card(port)->tx_ring_buffers
@@ -245,7 +239,7 @@
 	}
 
 	hdlc_set_carrier(!(sca_in(get_msci(port) + ST3, card) & ST3_DCD),
-			 &port->hdlc);
+			 port_to_dev(port));
 }
 
 
@@ -262,13 +256,14 @@
 	sca_out(stat & (ST1_UDRN | ST1_CDCD), msci + ST1, card);
 
 	if (stat & ST1_UDRN) {
-		port->hdlc.stats.tx_errors++; /* TX Underrun error detected */
-		port->hdlc.stats.tx_fifo_errors++;
+		struct net_device_stats *stats = hdlc_stats(port_to_dev(port));
+		stats->tx_errors++; /* TX Underrun error detected */
+		stats->tx_fifo_errors++;
 	}
 
 	if (stat & ST1_CDCD)
 		hdlc_set_carrier(!(sca_in(msci + ST3, card) & ST3_DCD),
-				 &port->hdlc);
+				 port_to_dev(port));
 }
 #endif
 
@@ -276,6 +271,8 @@
 
 static inline void sca_rx(card_t *card, port_t *port, pkt_desc *desc, u16 rxin)
 {
+	struct net_device *dev = port_to_dev(port);
+	struct net_device_stats *stats = hdlc_stats(dev);
 	struct sk_buff *skb;
 	u16 len;
 	u32 buff;
@@ -287,7 +284,7 @@
 	len = readw(&desc->len);
 	skb = dev_alloc_skb(len);
 	if (!skb) {
-		port->hdlc.stats.rx_dropped++;
+		stats->rx_dropped++;
 		return;
 	}
 
@@ -313,15 +310,15 @@
 #endif
 	skb_put(skb, len);
 #ifdef DEBUG_PKT
-	printk(KERN_DEBUG "%s RX(%i):", hdlc_to_name(&port->hdlc), skb->len);
+	printk(KERN_DEBUG "%s RX(%i):", dev->name, skb->len);
 	debug_frame(skb);
 #endif
-	port->hdlc.stats.rx_packets++;
-	port->hdlc.stats.rx_bytes += skb->len;
+	stats->rx_packets++;
+	stats->rx_bytes += skb->len;
 	skb->mac.raw = skb->data;
-	skb->dev = hdlc_to_dev(&port->hdlc);
+	skb->dev = dev;
 	skb->dev->last_rx = jiffies;
-	skb->protocol = hdlc_type_trans(skb, hdlc_to_dev(&port->hdlc));
+	skb->protocol = hdlc_type_trans(skb, dev);
 	netif_rx(skb);
 }
 
@@ -333,7 +330,7 @@
 	u16 dmac = get_dmac_rx(port);
 	card_t *card = port_to_card(port);
 	u8 stat = sca_in(DSR_RX(phy_node(port)), card); /* read DMA Status */
-	struct net_device_stats *stats = &port->hdlc.stats;
+	struct net_device_stats *stats = hdlc_stats(port_to_dev(port));
 
 	/* Reset DSR status bits */
 	sca_out((stat & (DSR_EOT | DSR_EOM | DSR_BOF | DSR_COF)) | DSR_DWE,
@@ -380,6 +377,8 @@
 /* Transmit DMA interrupt service */
 static inline void sca_tx_intr(port_t *port)
 {
+	struct net_device *dev = port_to_dev(port);
+	struct net_device_stats *stats = hdlc_stats(dev);
 	u16 dmac = get_dmac_tx(port);
 	card_t* card = port_to_card(port);
 	u8 stat;
@@ -401,13 +400,13 @@
 			break;	/* Transmitter is/will_be sending this frame */
 
 		desc = desc_address(port, port->txlast, 1);
-		port->hdlc.stats.tx_packets++;
-		port->hdlc.stats.tx_bytes += readw(&desc->len);
+		stats->tx_packets++;
+		stats->tx_bytes += readw(&desc->len);
 		writeb(0, &desc->stat);	/* Free descriptor */
 		port->txlast = next_desc(port, port->txlast, 1);
 	}
 
-	netif_wake_queue(hdlc_to_dev(&port->hdlc));
+	netif_wake_queue(dev);
 	spin_unlock(&port->lock);
 }
 
@@ -508,9 +507,9 @@
 
 
 
-static void sca_open(hdlc_device *hdlc)
+static void sca_open(struct net_device *dev)
 {
-	port_t *port = hdlc_to_port(hdlc);
+	port_t *port = dev_to_port(dev);
 	card_t* card = port_to_card(port);
 	u16 msci = get_msci(port);
 	u8 md0, md2;
@@ -569,7 +568,7 @@
    - all DMA interrupts
 */
 
-	hdlc_set_carrier(!(sca_in(msci + ST3, card) & ST3_DCD), hdlc);
+	hdlc_set_carrier(!(sca_in(msci + ST3, card) & ST3_DCD), dev);
 
 #ifdef __HD64570_H
 	/* MSCI TX INT and RX INT A IRQ enable */
@@ -600,18 +599,18 @@
 	sca_out(CMD_TX_ENABLE, msci + CMD, card);
 	sca_out(CMD_RX_ENABLE, msci + CMD, card);
 
-	netif_start_queue(hdlc_to_dev(hdlc));
+	netif_start_queue(dev);
 }
 
 
 
-static void sca_close(hdlc_device *hdlc)
+static void sca_close(struct net_device *dev)
 {
-	port_t *port = hdlc_to_port(hdlc);
+	port_t *port = dev_to_port(dev);
 	card_t* card = port_to_card(port);
 
 	/* reset channel */
-	netif_stop_queue(hdlc_to_dev(hdlc));
+	netif_stop_queue(dev);
 	sca_out(CMD_RESET, get_msci(port) + CMD, port_to_card(port));
 #ifdef __HD64570_H
 	/* disable MSCI interrupts */
@@ -629,7 +628,7 @@
 
 
 
-static int sca_attach(hdlc_device *hdlc, unsigned short encoding,
+static int sca_attach(struct net_device *dev, unsigned short encoding,
 		      unsigned short parity)
 {
 	if (encoding != ENCODING_NRZ &&
@@ -650,17 +649,17 @@
 	    parity != PARITY_CRC16_PR1_CCITT)
 		return -EINVAL;
 
-	hdlc_to_port(hdlc)->encoding = encoding;
-	hdlc_to_port(hdlc)->parity = parity;
+	dev_to_port(dev)->encoding = encoding;
+	dev_to_port(dev)->parity = parity;
 	return 0;
 }
 
 
 
 #ifdef DEBUG_RINGS
-static void sca_dump_rings(hdlc_device *hdlc)
+static void sca_dump_rings(struct net_device *dev)
 {
-	port_t *port = hdlc_to_port(hdlc);
+	port_t *port = dev_to_port(dev);
 	card_t *card = port_to_card(port);
 	u16 cnt;
 #if !defined(PAGE0_ALWAYS_MAPPED) && !defined(ALL_PAGES_ALWAYS_MAPPED)
@@ -729,8 +728,7 @@
 
 static int sca_xmit(struct sk_buff *skb, struct net_device *dev)
 {
-	hdlc_device *hdlc = dev_to_hdlc(dev);
-	port_t *port = hdlc_to_port(hdlc);
+	port_t *port = dev_to_port(dev);
 	card_t *card = port_to_card(port);
 	pkt_desc *desc;
 	u32 buff, len;
@@ -753,7 +751,7 @@
 	}
 
 #ifdef DEBUG_PKT
-	printk(KERN_DEBUG "%s TX(%i):", hdlc_to_name(hdlc), skb->len);
+	printk(KERN_DEBUG "%s TX(%i):", dev->name, skb->len);
 	debug_frame(skb);
 #endif
 
@@ -790,7 +788,7 @@
 
 	desc = desc_address(port, port->txin + 1, 1);
 	if (readb(&desc->stat)) /* allow 1 packet gap */
-		netif_stop_queue(hdlc_to_dev(&port->hdlc));
+		netif_stop_queue(dev);
 
 	spin_unlock_irq(&port->lock);
 
--- diff/drivers/net/wan/hdlc_cisco.c	2003-10-27 09:20:38.000000000 +0000
+++ source/drivers/net/wan/hdlc_cisco.c	2004-02-09 10:39:54.000000000 +0000
@@ -57,7 +57,7 @@
 
 
 
-static void cisco_keepalive_send(hdlc_device *hdlc, u32 type,
+static void cisco_keepalive_send(struct net_device *dev, u32 type,
 				 u32 par1, u32 par2)
 {
 	struct sk_buff *skb;
@@ -67,12 +67,11 @@
 	if (!skb) {
 		printk(KERN_WARNING
 		       "%s: Memory squeeze on cisco_keepalive_send()\n",
-		       hdlc_to_name(hdlc));
+		       dev->name);
 		return;
 	}
 	skb_reserve(skb, 4);
-	cisco_hard_header(skb, hdlc_to_dev(hdlc), CISCO_KEEPALIVE,
-			  NULL, NULL, 0);
+	cisco_hard_header(skb, dev, CISCO_KEEPALIVE, NULL, NULL, 0);
 	data = (cisco_packet*)skb->tail;
 
 	data->type = htonl(type);
@@ -84,7 +83,7 @@
 
 	skb_put(skb, sizeof(cisco_packet));
 	skb->priority = TC_PRIO_CONTROL;
-	skb->dev = hdlc_to_dev(hdlc);
+	skb->dev = dev;
 	skb->nh.raw = skb->data;
 
 	dev_queue_xmit(skb);
@@ -118,7 +117,8 @@
 
 static int cisco_rx(struct sk_buff *skb)
 {
-	hdlc_device *hdlc = dev_to_hdlc(skb->dev);
+	struct net_device *dev = skb->dev;
+	hdlc_device *hdlc = dev_to_hdlc(dev);
 	hdlc_header *data = (hdlc_header*)skb->data;
 	cisco_packet *cisco_data;
 	struct in_device *in_dev;
@@ -142,7 +142,7 @@
 		    skb->len != sizeof(hdlc_header) + CISCO_BIG_PACKET_LEN) {
 			printk(KERN_INFO "%s: Invalid length of Cisco "
 			       "control packet (%d bytes)\n",
-			       hdlc_to_name(hdlc), skb->len);
+			       dev->name, skb->len);
 			goto rx_error;
 		}
 
@@ -150,7 +150,7 @@
 
 		switch(ntohl (cisco_data->type)) {
 		case CISCO_ADDR_REQ: /* Stolen from syncppp.c :-) */
-			in_dev = hdlc_to_dev(hdlc)->ip_ptr;
+			in_dev = dev->ip_ptr;
 			addr = 0;
 			mask = ~0; /* is the mask correct? */
 
@@ -158,7 +158,7 @@
 				struct in_ifaddr **ifap = &in_dev->ifa_list;
 
 				while (*ifap != NULL) {
-					if (strcmp(hdlc_to_name(hdlc),
+					if (strcmp(dev->name,
 						   (*ifap)->ifa_label) == 0) {
 						addr = (*ifap)->ifa_local;
 						mask = (*ifap)->ifa_mask;
@@ -167,7 +167,7 @@
 					ifap = &(*ifap)->ifa_next;
 				}
 
-				cisco_keepalive_send(hdlc, CISCO_ADDR_REPLY,
+				cisco_keepalive_send(dev, CISCO_ADDR_REPLY,
 						     addr, mask);
 			}
 			dev_kfree_skb_any(skb);
@@ -175,7 +175,7 @@
 
 		case CISCO_ADDR_REPLY:
 			printk(KERN_INFO "%s: Unexpected Cisco IP address "
-			       "reply\n", hdlc_to_name(hdlc));
+			       "reply\n", dev->name);
 			goto rx_error;
 
 		case CISCO_KEEPALIVE_REQ:
@@ -190,7 +190,7 @@
 					days = hrs / 24; hrs -= days * 24;
 					printk(KERN_INFO "%s: Link up (peer "
 					       "uptime %ud%uh%um%us)\n",
-					       hdlc_to_name(hdlc), days, hrs,
+					       dev->name, days, hrs,
 					       min, sec);
 				}
 				hdlc->state.cisco.up = 1;
@@ -201,7 +201,7 @@
 		} /* switch(keepalive type) */
 	} /* switch(protocol) */
 
-	printk(KERN_INFO "%s: Unsupported protocol %x\n", hdlc_to_name(hdlc),
+	printk(KERN_INFO "%s: Unsupported protocol %x\n", dev->name,
 	       data->protocol);
 	dev_kfree_skb_any(skb);
 	return NET_RX_DROP;
@@ -216,17 +216,18 @@
 
 static void cisco_timer(unsigned long arg)
 {
-	hdlc_device *hdlc = (hdlc_device*)arg;
+	struct net_device *dev = (struct net_device *)arg;
+	hdlc_device *hdlc = dev_to_hdlc(dev);
 
 	if (hdlc->state.cisco.up && jiffies - hdlc->state.cisco.last_poll >=
 	    hdlc->state.cisco.settings.timeout * HZ) {
 		hdlc->state.cisco.up = 0;
-		printk(KERN_INFO "%s: Link down\n", hdlc_to_name(hdlc));
-		if (netif_carrier_ok(&hdlc->netdev))
-			netif_carrier_off(&hdlc->netdev);
+		printk(KERN_INFO "%s: Link down\n", dev->name);
+		if (netif_carrier_ok(dev))
+			netif_carrier_off(dev);
 	}
 
-	cisco_keepalive_send(hdlc, CISCO_KEEPALIVE_REQ,
+	cisco_keepalive_send(dev, CISCO_KEEPALIVE_REQ,
 			     ++hdlc->state.cisco.txseq,
 			     hdlc->state.cisco.rxseq);
 	hdlc->state.cisco.timer.expires = jiffies +
@@ -238,8 +239,9 @@
 
 
 
-static void cisco_start(hdlc_device *hdlc)
+static void cisco_start(struct net_device *dev)
 {
+	hdlc_device *hdlc = dev_to_hdlc(dev);
 	hdlc->state.cisco.last_poll = 0;
 	hdlc->state.cisco.up = 0;
 	hdlc->state.cisco.txseq = hdlc->state.cisco.rxseq = 0;
@@ -247,27 +249,27 @@
 	init_timer(&hdlc->state.cisco.timer);
 	hdlc->state.cisco.timer.expires = jiffies + HZ; /*First poll after 1s*/
 	hdlc->state.cisco.timer.function = cisco_timer;
-	hdlc->state.cisco.timer.data = (unsigned long)hdlc;
+	hdlc->state.cisco.timer.data = (unsigned long)dev;
 	add_timer(&hdlc->state.cisco.timer);
 }
 
 
 
-static void cisco_stop(hdlc_device *hdlc)
+static void cisco_stop(struct net_device *dev)
 {
-	del_timer_sync(&hdlc->state.cisco.timer);
-	if (netif_carrier_ok(&hdlc->netdev))
-		netif_carrier_off(&hdlc->netdev);
+	del_timer_sync(&dev_to_hdlc(dev)->state.cisco.timer);
+	if (netif_carrier_ok(dev))
+		netif_carrier_off(dev);
 }
 
 
 
-int hdlc_cisco_ioctl(hdlc_device *hdlc, struct ifreq *ifr)
+int hdlc_cisco_ioctl(struct net_device *dev, struct ifreq *ifr)
 {
 	cisco_proto *cisco_s = ifr->ifr_settings.ifs_ifsu.cisco;
 	const size_t size = sizeof(cisco_proto);
 	cisco_proto new_settings;
-	struct net_device *dev = hdlc_to_dev(hdlc);
+	hdlc_device *hdlc = dev_to_hdlc(dev);
 	int result;
 
 	switch (ifr->ifr_settings.type) {
@@ -295,7 +297,7 @@
 		    new_settings.timeout < 2)
 			return -EINVAL;
 
-		result=hdlc->attach(hdlc, ENCODING_NRZ,PARITY_CRC16_PR1_CCITT);
+		result=hdlc->attach(dev, ENCODING_NRZ,PARITY_CRC16_PR1_CCITT);
 
 		if (result)
 			return result;
--- diff/drivers/net/wan/hdlc_fr.c	2003-08-26 10:00:53.000000000 +0100
+++ source/drivers/net/wan/hdlc_fr.c	2004-02-09 10:39:54.000000000 +0000
@@ -146,8 +146,9 @@
 }
 
 
-static inline pvc_device* add_pvc(hdlc_device *hdlc, u16 dlci)
+static inline pvc_device* add_pvc(struct net_device *dev, u16 dlci)
 {
+	hdlc_device *hdlc = dev_to_hdlc(dev);
 	pvc_device *pvc, **pvc_p = &hdlc->state.fr.first_pvc;
 
 	while (*pvc_p) {
@@ -164,7 +165,7 @@
 
 	memset(pvc, 0, sizeof(pvc_device));
 	pvc->dlci = dlci;
-	pvc->master = hdlc;
+	pvc->master = dev;
 	pvc->next = *pvc_p;	/* Put it in the chain */
 	*pvc_p = pvc;
 	return pvc;
@@ -311,15 +312,16 @@
 {
 	pvc_device *pvc = dev_to_pvc(dev);
 
-	if ((hdlc_to_dev(pvc->master)->flags & IFF_UP) == 0)
+	if ((pvc->master->flags & IFF_UP) == 0)
 		return -EIO;  /* Master must be UP in order to activate PVC */
 
 	if (pvc->open_count++ == 0) {
-		if (pvc->master->state.fr.settings.lmi == LMI_NONE)
-			pvc->state.active = pvc->master->carrier;
+		hdlc_device *hdlc = dev_to_hdlc(pvc->master);
+		if (hdlc->state.fr.settings.lmi == LMI_NONE)
+			pvc->state.active = hdlc->carrier;
 
 		pvc_carrier(pvc->state.active, pvc);
-		pvc->master->state.fr.dce_changed = 1;
+		hdlc->state.fr.dce_changed = 1;
 	}
 	return 0;
 }
@@ -331,11 +333,12 @@
 	pvc_device *pvc = dev_to_pvc(dev);
 
 	if (--pvc->open_count == 0) {
-		if (pvc->master->state.fr.settings.lmi == LMI_NONE)
+		hdlc_device *hdlc = dev_to_hdlc(pvc->master);
+		if (hdlc->state.fr.settings.lmi == LMI_NONE)
 			pvc->state.active = 0;
 
-		if (pvc->master->state.fr.settings.dce) {
-			pvc->master->state.fr.dce_changed = 1;
+		if (hdlc->state.fr.settings.dce) {
+			hdlc->state.fr.dce_changed = 1;
 			pvc->state.active = 0;
 		}
 	}
@@ -362,7 +365,7 @@
 		}
 
 		info.dlci = pvc->dlci;
-		memcpy(info.master, hdlc_to_name(pvc->master), IFNAMSIZ);
+		memcpy(info.master, pvc->master->name, IFNAMSIZ);
 		if (copy_to_user(ifr->ifr_settings.ifs_ifsu.fr_pvc_info,
 				 &info, sizeof(info)))
 			return -EFAULT;
@@ -375,8 +378,7 @@
 
 static inline struct net_device_stats *pvc_get_stats(struct net_device *dev)
 {
-	return (struct net_device_stats *)
-		((char *)dev + sizeof(struct net_device));
+	return netdev_priv(dev);
 }
 
 
@@ -408,7 +410,7 @@
 			stats->tx_packets++;
 			if (pvc->state.fecn) /* TX Congestion counter */
 				stats->tx_compressed++;
-			skb->dev = hdlc_to_dev(pvc->master);
+			skb->dev = pvc->master;
 			dev_queue_xmit(skb);
 			return 0;
 		}
@@ -434,7 +436,7 @@
 static inline void fr_log_dlci_active(pvc_device *pvc)
 {
 	printk(KERN_INFO "%s: DLCI %d [%s%s%s]%s %s\n",
-	       hdlc_to_name(pvc->master),
+	       pvc->master->name,
 	       pvc->dlci,
 	       pvc->main ? pvc->main->name : "",
 	       pvc->main && pvc->ether ? " " : "",
@@ -454,8 +456,9 @@
 
 
 
-static void fr_lmi_send(hdlc_device *hdlc, int fullrep)
+static void fr_lmi_send(struct net_device *dev, int fullrep)
 {
+	hdlc_device *hdlc = dev_to_hdlc(dev);
 	struct sk_buff *skb;
 	pvc_device *pvc = hdlc->state.fr.first_pvc;
 	int len = (hdlc->state.fr.settings.lmi == LMI_ANSI) ? LMI_ANSI_LENGTH
@@ -468,7 +471,7 @@
 		len += hdlc->state.fr.dce_pvc_count * (2 + stat_len);
 		if (len > HDLC_MAX_MRU) {
 			printk(KERN_WARNING "%s: Too many PVCs while sending "
-			       "LMI full report\n", hdlc_to_name(hdlc));
+			       "LMI full report\n", dev->name);
 			return;
 		}
 	}
@@ -476,7 +479,7 @@
 	skb = dev_alloc_skb(len);
 	if (!skb) {
 		printk(KERN_WARNING "%s: Memory squeeze on fr_lmi_send()\n",
-		       hdlc_to_name(hdlc));
+		       dev->name);
 		return;
 	}
 	memset(skb->data, 0, len);
@@ -529,7 +532,7 @@
 
 	skb_put(skb, i);
 	skb->priority = TC_PRIO_CONTROL;
-	skb->dev = hdlc_to_dev(hdlc);
+	skb->dev = dev;
 	skb->nh.raw = skb->data;
 
 	dev_queue_xmit(skb);
@@ -537,14 +540,15 @@
 
 
 
-static void fr_set_link_state(int reliable, hdlc_device *hdlc)
+static void fr_set_link_state(int reliable, struct net_device *dev)
 {
+	hdlc_device *hdlc = dev_to_hdlc(dev);
 	pvc_device *pvc = hdlc->state.fr.first_pvc;
 
 	hdlc->state.fr.reliable = reliable;
 	if (reliable) {
-		if (!netif_carrier_ok(&hdlc->netdev))
-			netif_carrier_on(&hdlc->netdev);
+		if (!netif_carrier_ok(dev))
+			netif_carrier_on(dev);
 
 		hdlc->state.fr.n391cnt = 0; /* Request full status */
 		hdlc->state.fr.dce_changed = 1;
@@ -558,8 +562,8 @@
 			}
 		}
 	} else {
-		if (netif_carrier_ok(&hdlc->netdev))
-			netif_carrier_off(&hdlc->netdev);
+		if (netif_carrier_ok(dev))
+			netif_carrier_off(dev);
 
 		while (pvc) {		/* Deactivate all PVCs */
 			pvc_carrier(0, pvc);
@@ -574,7 +578,8 @@
 
 static void fr_timer(unsigned long arg)
 {
-	hdlc_device *hdlc = (hdlc_device*)arg;
+	struct net_device *dev = (struct net_device *)arg;
+	hdlc_device *hdlc = dev_to_hdlc(dev);
 	int i, cnt = 0, reliable;
 	u32 list;
 
@@ -586,7 +591,7 @@
 		if (hdlc->state.fr.request) {
 			if (hdlc->state.fr.reliable)
 				printk(KERN_INFO "%s: No LMI status reply "
-				       "received\n", hdlc_to_name(hdlc));
+				       "received\n", dev->name);
 			hdlc->state.fr.last_errors |= 1;
 		}
 
@@ -598,9 +603,9 @@
 	}
 
 	if (hdlc->state.fr.reliable != reliable) {
-		printk(KERN_INFO "%s: Link %sreliable\n", hdlc_to_name(hdlc),
+		printk(KERN_INFO "%s: Link %sreliable\n", dev->name,
 		       reliable ? "" : "un");
-		fr_set_link_state(reliable, hdlc);
+		fr_set_link_state(reliable, dev);
 	}
 
 	if (hdlc->state.fr.settings.dce)
@@ -610,7 +615,7 @@
 		if (hdlc->state.fr.n391cnt)
 			hdlc->state.fr.n391cnt--;
 
-		fr_lmi_send(hdlc, hdlc->state.fr.n391cnt == 0);
+		fr_lmi_send(dev, hdlc->state.fr.n391cnt == 0);
 
 		hdlc->state.fr.request = 1;
 		hdlc->state.fr.timer.expires = jiffies +
@@ -624,8 +629,9 @@
 
 
 
-static int fr_lmi_recv(hdlc_device *hdlc, struct sk_buff *skb)
+static int fr_lmi_recv(struct net_device *dev, struct sk_buff *skb)
 {
+	hdlc_device *hdlc = dev_to_hdlc(dev);
 	int stat_len;
 	pvc_device *pvc;
 	int reptype = -1, error, no_ram;
@@ -634,14 +640,14 @@
 
 	if (skb->len < ((hdlc->state.fr.settings.lmi == LMI_ANSI)
 			? LMI_ANSI_LENGTH : LMI_LENGTH)) {
-		printk(KERN_INFO "%s: Short LMI frame\n", hdlc_to_name(hdlc));
+		printk(KERN_INFO "%s: Short LMI frame\n", dev->name);
 		return 1;
 	}
 
 	if (skb->data[5] != (!hdlc->state.fr.settings.dce ?
 			     LMI_STATUS : LMI_STATUS_ENQUIRY)) {
 		printk(KERN_INFO "%s: LMI msgtype=%x, Not LMI status %s\n",
-		       hdlc_to_name(hdlc), skb->data[2],
+		       dev->name, skb->data[2],
 		       hdlc->state.fr.settings.dce ? "enquiry" : "reply");
 		return 1;
 	}
@@ -652,7 +658,7 @@
 	    ((hdlc->state.fr.settings.lmi == LMI_CCITT)
 	     ? LMI_CCITT_REPTYPE : LMI_REPTYPE)) {
 		printk(KERN_INFO "%s: Not a report type=%x\n",
-		       hdlc_to_name(hdlc), skb->data[i]);
+		       dev->name, skb->data[i]);
 		return 1;
 	}
 	i++;
@@ -665,7 +671,7 @@
 	    ((hdlc->state.fr.settings.lmi == LMI_CCITT)
 	     ? LMI_CCITT_ALIVE : LMI_ALIVE)) {
 		printk(KERN_INFO "%s: Unsupported status element=%x\n",
-		       hdlc_to_name(hdlc), skb->data[i]);
+		       dev->name, skb->data[i]);
 		return 1;
 	}
 	i++;
@@ -680,7 +686,7 @@
 	if (hdlc->state.fr.settings.dce) {
 		if (reptype != LMI_FULLREP && reptype != LMI_INTEGRITY) {
 			printk(KERN_INFO "%s: Unsupported report type=%x\n",
-			       hdlc_to_name(hdlc), reptype);
+			       dev->name, reptype);
 			return 1;
 		}
 	}
@@ -716,7 +722,7 @@
 			hdlc->state.fr.dce_changed = 0;
 		}
 
-		fr_lmi_send(hdlc, reptype == LMI_FULLREP ? 1 : 0);
+		fr_lmi_send(dev, reptype == LMI_FULLREP ? 1 : 0);
 		return 0;
 	}
 
@@ -741,26 +747,26 @@
 		if (skb->data[i] != ((hdlc->state.fr.settings.lmi == LMI_CCITT)
 				     ? LMI_CCITT_PVCSTAT : LMI_PVCSTAT)) {
 			printk(KERN_WARNING "%s: Invalid PVCSTAT ID: %x\n",
-			       hdlc_to_name(hdlc), skb->data[i]);
+			       dev->name, skb->data[i]);
 			return 1;
 		}
 		i++;
 
 		if (skb->data[i] != stat_len) {
 			printk(KERN_WARNING "%s: Invalid PVCSTAT length: %x\n",
-			       hdlc_to_name(hdlc), skb->data[i]);
+			       dev->name, skb->data[i]);
 			return 1;
 		}
 		i++;
 
 		dlci = status_to_dlci(skb->data + i, &active, &new);
 
-		pvc = add_pvc(hdlc, dlci);
+		pvc = add_pvc(dev, dlci);
 
 		if (!pvc && !no_ram) {
 			printk(KERN_WARNING
 			       "%s: Memory squeeze on fr_lmi_recv()\n",
-			       hdlc_to_name(hdlc));
+			       dev->name);
 			no_ram = 1;
 		}
 
@@ -802,7 +808,8 @@
 
 static int fr_rx(struct sk_buff *skb)
 {
-	hdlc_device *hdlc = dev_to_hdlc(skb->dev);
+	struct net_device *ndev = skb->dev;
+	hdlc_device *hdlc = dev_to_hdlc(ndev);
 	fr_hdr *fh = (fr_hdr*)skb->data;
 	u8 *data = skb->data;
 	u16 dlci;
@@ -819,7 +826,7 @@
 			goto rx_error; /* LMI packet with no LMI? */
 
 		if (data[3] == LMI_PROTO) {
-			if (fr_lmi_recv(hdlc, skb))
+			if (fr_lmi_recv(ndev, skb))
 				goto rx_error;
 			else {
 				/* No request pending */
@@ -831,7 +838,7 @@
 		}
 
 		printk(KERN_INFO "%s: Received non-LMI frame with LMI DLCI\n",
-		       hdlc_to_name(hdlc));
+		       ndev->name);
 		goto rx_error;
 	}
 
@@ -839,7 +846,7 @@
 	if (!pvc) {
 #ifdef DEBUG_PKT
 		printk(KERN_INFO "%s: No PVC for received frame's DLCI %d\n",
-		       hdlc_to_name(hdlc), dlci);
+		       ndev->name, dlci);
 #endif
 		dev_kfree_skb_any(skb);
 		return NET_RX_DROP;
@@ -847,7 +854,7 @@
 
 	if (pvc->state.fecn != fh->fecn) {
 #ifdef DEBUG_ECN
-		printk(KERN_DEBUG "%s: DLCI %d FECN O%s\n", hdlc_to_name(pvc),
+		printk(KERN_DEBUG "%s: DLCI %d FECN O%s\n", ndev->name,
 		       dlci, fh->fecn ? "N" : "FF");
 #endif
 		pvc->state.fecn ^= 1;
@@ -855,7 +862,7 @@
 
 	if (pvc->state.becn != fh->becn) {
 #ifdef DEBUG_ECN
-		printk(KERN_DEBUG "%s: DLCI %d BECN O%s\n", hdlc_to_name(pvc),
+		printk(KERN_DEBUG "%s: DLCI %d BECN O%s\n", ndev->name,
 		       dlci, fh->becn ? "N" : "FF");
 #endif
 		pvc->state.becn ^= 1;
@@ -899,13 +906,13 @@
 
 		default:
 			printk(KERN_INFO "%s: Unsupported protocol, OUI=%x "
-			       "PID=%x\n", hdlc_to_name(hdlc), oui, pid);
+			       "PID=%x\n", ndev->name, oui, pid);
 			dev_kfree_skb_any(skb);
 			return NET_RX_DROP;
 		}
 	} else {
 		printk(KERN_INFO "%s: Unsupported protocol, NLPID=%x "
-		       "length = %i\n", hdlc_to_name(hdlc), data[3], skb->len);
+		       "length = %i\n", ndev->name, data[3], skb->len);
 		dev_kfree_skb_any(skb);
 		return NET_RX_DROP;
 	}
@@ -932,14 +939,15 @@
 
 
 
-static void fr_start(hdlc_device *hdlc)
+static void fr_start(struct net_device *dev)
 {
+	hdlc_device *hdlc = dev_to_hdlc(dev);
 #ifdef DEBUG_LINK
 	printk(KERN_DEBUG "fr_start\n");
 #endif
 	if (hdlc->state.fr.settings.lmi != LMI_NONE) {
-		if (netif_carrier_ok(&hdlc->netdev))
-			netif_carrier_off(&hdlc->netdev);
+		if (netif_carrier_ok(dev))
+			netif_carrier_off(dev);
 		hdlc->state.fr.last_poll = 0;
 		hdlc->state.fr.reliable = 0;
 		hdlc->state.fr.dce_changed = 1;
@@ -953,28 +961,30 @@
 		/* First poll after 1 s */
 		hdlc->state.fr.timer.expires = jiffies + HZ;
 		hdlc->state.fr.timer.function = fr_timer;
-		hdlc->state.fr.timer.data = (unsigned long)hdlc;
+		hdlc->state.fr.timer.data = (unsigned long)dev;
 		add_timer(&hdlc->state.fr.timer);
 	} else
-		fr_set_link_state(1, hdlc);
+		fr_set_link_state(1, dev);
 }
 
 
 
-static void fr_stop(hdlc_device *hdlc)
+static void fr_stop(struct net_device *dev)
 {
+	hdlc_device *hdlc = dev_to_hdlc(dev);
 #ifdef DEBUG_LINK
 	printk(KERN_DEBUG "fr_stop\n");
 #endif
 	if (hdlc->state.fr.settings.lmi != LMI_NONE)
 		del_timer_sync(&hdlc->state.fr.timer);
-	fr_set_link_state(0, hdlc);
+	fr_set_link_state(0, dev);
 }
 
 
 
-static void fr_close(hdlc_device *hdlc)
+static void fr_close(struct net_device *dev)
 {
+	hdlc_device *hdlc = dev_to_hdlc(dev);
 	pvc_device *pvc = hdlc->state.fr.first_pvc;
 
 	while (pvc) {		/* Shutdown all PVCs for this FRAD */
@@ -986,10 +996,17 @@
 	}
 }
 
+static void dlci_setup(struct net_device *dev)
+{
+	dev->type = ARPHRD_DLCI;
+	dev->flags = IFF_POINTOPOINT;
+	dev->hard_header_len = 10;
+	dev->addr_len = 2;
+}
 
-
-static int fr_add_pvc(hdlc_device *hdlc, unsigned int dlci, int type)
+static int fr_add_pvc(struct net_device *master, unsigned int dlci, int type)
 {
+	hdlc_device *hdlc = dev_to_hdlc(master);
 	pvc_device *pvc = NULL;
 	struct net_device *dev;
 	int result, used;
@@ -998,9 +1015,9 @@
 	if (type == ARPHRD_ETHER)
 		prefix = "pvceth%d";
 
-	if ((pvc = add_pvc(hdlc, dlci)) == NULL) {
+	if ((pvc = add_pvc(master, dlci)) == NULL) {
 		printk(KERN_WARNING "%s: Memory squeeze on fr_add_pvc()\n",
-		       hdlc_to_name(hdlc));
+		       master->name);
 		return -ENOBUFS;
 	}
 
@@ -1009,26 +1026,24 @@
 
 	used = pvc_is_used(pvc);
 
-	dev = kmalloc(sizeof(struct net_device) +
-		      sizeof(struct net_device_stats), GFP_KERNEL);
+	if (type == ARPHRD_ETHER)
+		dev = alloc_netdev(sizeof(struct net_device_stats),
+				   "pvceth%d", ether_setup);
+	else
+		dev = alloc_netdev(sizeof(struct net_device_stats),
+				   "pvc%d", dlci_setup);
+
 	if (!dev) {
 		printk(KERN_WARNING "%s: Memory squeeze on fr_pvc()\n",
-		       hdlc_to_name(hdlc));
+		       master->name);
 		delete_unused_pvcs(hdlc);
 		return -ENOBUFS;
 	}
-	memset(dev, 0, sizeof(struct net_device) +
-	       sizeof(struct net_device_stats));
 
 	if (type == ARPHRD_ETHER) {
-		ether_setup(dev);
 		memcpy(dev->dev_addr, "\x00\x01", 2);
                 get_random_bytes(dev->dev_addr + 2, ETH_ALEN - 2);
 	} else {
-		dev->type = ARPHRD_DLCI;
-		dev->flags = IFF_POINTOPOINT;
-		dev->hard_header_len = 10;
-		dev->addr_len = 2;
 		*(u16*)dev->dev_addr = htons(dlci);
 		dlci_to_q922(dev->broadcast, dlci);
 	}
@@ -1042,15 +1057,15 @@
 	dev->tx_queue_len = 0;
 	dev->priv = pvc;
 
-	result = dev_alloc_name(dev, prefix);
+	result = dev_alloc_name(dev, dev->name);
 	if (result < 0) {
-		kfree(dev);
+		free_netdev(dev);
 		delete_unused_pvcs(hdlc);
 		return result;
 	}
 
 	if (register_netdevice(dev) != 0) {
-		kfree(dev);
+		free_netdev(dev);
 		delete_unused_pvcs(hdlc);
 		return -EIO;
 	}
@@ -1080,7 +1095,7 @@
 	if (dev->flags & IFF_UP)
 		return -EBUSY;		/* PVC in use */
 
-	unregister_netdevice(dev); /* the destructor will kfree(dev) */
+	unregister_netdevice(dev); /* the destructor will free_netdev(dev) */
 	*get_dev_p(pvc, type) = NULL;
 
 	if (!pvc_is_used(pvc)) {
@@ -1104,7 +1119,8 @@
 
 	while (pvc) {
 		pvc_device *next = pvc->next;
-		if (pvc->main)	/* the destructor will kfree(main + ether) */
+		/* destructors will free_netdev() main and ether */
+		if (pvc->main)
 			unregister_netdevice(pvc->main);
 
 		if (pvc->ether)
@@ -1117,12 +1133,12 @@
 
 
 
-int hdlc_fr_ioctl(hdlc_device *hdlc, struct ifreq *ifr)
+int hdlc_fr_ioctl(struct net_device *dev, struct ifreq *ifr)
 {
 	fr_proto *fr_s = ifr->ifr_settings.ifs_ifsu.fr;
 	const size_t size = sizeof(fr_proto);
 	fr_proto new_settings;
-	struct net_device *dev = hdlc_to_dev(hdlc);
+	hdlc_device *hdlc = dev_to_hdlc(dev);
 	fr_proto_pvc pvc;
 	int result;
 
@@ -1163,7 +1179,7 @@
 		     new_settings.dce != 1))
 			return -EINVAL;
 
-		result=hdlc->attach(hdlc, ENCODING_NRZ,PARITY_CRC16_PR1_CCITT);
+		result=hdlc->attach(dev, ENCODING_NRZ,PARITY_CRC16_PR1_CCITT);
 		if (result)
 			return result;
 
@@ -1210,7 +1226,7 @@
 
 		if (ifr->ifr_settings.type == IF_PROTO_FR_ADD_PVC ||
 		    ifr->ifr_settings.type == IF_PROTO_FR_ADD_ETH_PVC)
-			return fr_add_pvc(hdlc, pvc.dlci, result);
+			return fr_add_pvc(dev, pvc.dlci, result);
 		else
 			return fr_del_pvc(hdlc, pvc.dlci, result);
 	}
--- diff/drivers/net/wan/hdlc_generic.c	2003-10-09 09:47:34.000000000 +0100
+++ source/drivers/net/wan/hdlc_generic.c	2004-02-09 10:39:54.000000000 +0000
@@ -50,7 +50,7 @@
 
 static struct net_device_stats *hdlc_get_stats(struct net_device *dev)
 {
-	return &dev_to_hdlc(dev)->stats;
+	return hdlc_stats(dev);
 }
 
 
@@ -69,8 +69,9 @@
 
 
 
-void hdlc_set_carrier(int on, hdlc_device *hdlc)
+void hdlc_set_carrier(int on, struct net_device *dev)
 {
+	hdlc_device *hdlc = dev_to_hdlc(dev);
 	on = on ? 1 : 0;
 
 #ifdef DEBUG_LINK
@@ -82,7 +83,7 @@
 	if (hdlc->carrier == on)
 		goto carrier_exit; /* no change in DCD line level */
 
-	printk(KERN_INFO "%s: carrier %s\n", hdlc_to_name(hdlc),
+	printk(KERN_INFO "%s: carrier %s\n", dev->name,
 	       on ? "ON" : "off");
 	hdlc->carrier = on;
 
@@ -91,15 +92,15 @@
 
 	if (hdlc->carrier) {
 		if (hdlc->proto.start)
-			hdlc->proto.start(hdlc);
-		else if (!netif_carrier_ok(&hdlc->netdev))
-			netif_carrier_on(&hdlc->netdev);
+			hdlc->proto.start(dev);
+		else if (!netif_carrier_ok(dev))
+			netif_carrier_on(dev);
 
 	} else { /* no carrier */
 		if (hdlc->proto.stop)
-			hdlc->proto.stop(hdlc);
-		else if (netif_carrier_ok(&hdlc->netdev))
-			netif_carrier_off(&hdlc->netdev);
+			hdlc->proto.stop(dev);
+		else if (netif_carrier_ok(dev))
+			netif_carrier_off(dev);
 	}
 
  carrier_exit:
@@ -108,8 +109,9 @@
 
 
 /* Must be called by hardware driver when HDLC device is being opened */
-int hdlc_open(hdlc_device *hdlc)
+int hdlc_open(struct net_device *dev)
 {
+	hdlc_device *hdlc = dev_to_hdlc(dev);
 #ifdef DEBUG_LINK
 	printk(KERN_DEBUG "hdlc_open carrier %i open %i\n",
 	       hdlc->carrier, hdlc->open);
@@ -119,7 +121,7 @@
 		return -ENOSYS;	/* no protocol attached */
 
 	if (hdlc->proto.open) {
-		int result = hdlc->proto.open(hdlc);
+		int result = hdlc->proto.open(dev);
 		if (result)
 			return result;
 	}
@@ -128,12 +130,12 @@
 
 	if (hdlc->carrier) {
 		if (hdlc->proto.start)
-			hdlc->proto.start(hdlc);
-		else if (!netif_carrier_ok(&hdlc->netdev))
-			netif_carrier_on(&hdlc->netdev);
+			hdlc->proto.start(dev);
+		else if (!netif_carrier_ok(dev))
+			netif_carrier_on(dev);
 
-	} else if (netif_carrier_ok(&hdlc->netdev))
-		netif_carrier_off(&hdlc->netdev);
+	} else if (netif_carrier_ok(dev))
+		netif_carrier_off(dev);
 
 	hdlc->open = 1;
 
@@ -144,8 +146,9 @@
 
 
 /* Must be called by hardware driver when HDLC device is being closed */
-void hdlc_close(hdlc_device *hdlc)
+void hdlc_close(struct net_device *dev)
 {
+	hdlc_device *hdlc = dev_to_hdlc(dev);
 #ifdef DEBUG_LINK
 	printk(KERN_DEBUG "hdlc_close carrier %i open %i\n",
 	       hdlc->carrier, hdlc->open);
@@ -155,38 +158,38 @@
 
 	hdlc->open = 0;
 	if (hdlc->carrier && hdlc->proto.stop)
-		hdlc->proto.stop(hdlc);
+		hdlc->proto.stop(dev);
 
 	spin_unlock_irq(&hdlc->state_lock);
 
 	if (hdlc->proto.close)
-		hdlc->proto.close(hdlc);
+		hdlc->proto.close(dev);
 }
 
 
 
 #ifndef CONFIG_HDLC_RAW
-#define hdlc_raw_ioctl(hdlc, ifr)	-ENOSYS
+#define hdlc_raw_ioctl(dev, ifr)	-ENOSYS
 #endif
 
 #ifndef CONFIG_HDLC_RAW_ETH
-#define hdlc_raw_eth_ioctl(hdlc, ifr)	-ENOSYS
+#define hdlc_raw_eth_ioctl(dev, ifr)	-ENOSYS
 #endif
 
 #ifndef CONFIG_HDLC_PPP
-#define hdlc_ppp_ioctl(hdlc, ifr)	-ENOSYS
+#define hdlc_ppp_ioctl(dev, ifr)	-ENOSYS
 #endif
 
 #ifndef CONFIG_HDLC_CISCO
-#define hdlc_cisco_ioctl(hdlc, ifr)	-ENOSYS
+#define hdlc_cisco_ioctl(dev, ifr)	-ENOSYS
 #endif
 
 #ifndef CONFIG_HDLC_FR
-#define hdlc_fr_ioctl(hdlc, ifr)	-ENOSYS
+#define hdlc_fr_ioctl(dev, ifr)	-ENOSYS
 #endif
 
 #ifndef CONFIG_HDLC_X25
-#define hdlc_x25_ioctl(hdlc, ifr)	-ENOSYS
+#define hdlc_x25_ioctl(dev, ifr)	-ENOSYS
 #endif
 
 
@@ -213,22 +216,49 @@
 	}
 
 	switch(proto) {
-	case IF_PROTO_HDLC:	return hdlc_raw_ioctl(hdlc, ifr);
-	case IF_PROTO_HDLC_ETH:	return hdlc_raw_eth_ioctl(hdlc, ifr);
-	case IF_PROTO_PPP:	return hdlc_ppp_ioctl(hdlc, ifr);
-	case IF_PROTO_CISCO:	return hdlc_cisco_ioctl(hdlc, ifr);
-	case IF_PROTO_FR:	return hdlc_fr_ioctl(hdlc, ifr);
-	case IF_PROTO_X25:	return hdlc_x25_ioctl(hdlc, ifr);
+	case IF_PROTO_HDLC:	return hdlc_raw_ioctl(dev, ifr);
+	case IF_PROTO_HDLC_ETH:	return hdlc_raw_eth_ioctl(dev, ifr);
+	case IF_PROTO_PPP:	return hdlc_ppp_ioctl(dev, ifr);
+	case IF_PROTO_CISCO:	return hdlc_cisco_ioctl(dev, ifr);
+	case IF_PROTO_FR:	return hdlc_fr_ioctl(dev, ifr);
+	case IF_PROTO_X25:	return hdlc_x25_ioctl(dev, ifr);
 	default:		return -EINVAL;
 	}
 }
 
+static void hdlc_setup(struct net_device *dev)
+{
+	hdlc_device *hdlc = dev_to_hdlc(dev);
+
+	dev->get_stats = hdlc_get_stats;
+	dev->change_mtu = hdlc_change_mtu;
+	dev->mtu = HDLC_MAX_MTU;
+
+	dev->type = ARPHRD_RAWHDLC;
+	dev->hard_header_len = 16;
+
+	dev->flags = IFF_POINTOPOINT | IFF_NOARP;
+
+	hdlc->proto.id = -1;
+	hdlc->proto.detach = NULL;
+	hdlc->carrier = 1;
+	hdlc->open = 0;
+	spin_lock_init(&hdlc->state_lock);
+}
 
+struct net_device *alloc_hdlcdev(void *priv)
+{
+	struct net_device *dev;
+	dev = alloc_netdev(sizeof(hdlc_device), "hdlc%d", hdlc_setup);
+	if (dev)
+		dev_to_hdlc(dev)->priv = priv;
+	return dev;
+}
 
-int register_hdlc_device(hdlc_device *hdlc)
+int register_hdlc_device(struct net_device *dev)
 {
 	int result;
-	struct net_device *dev = hdlc_to_dev(hdlc);
+	hdlc_device *hdlc = dev_to_hdlc(dev);
 
 	dev->get_stats = hdlc_get_stats;
 	dev->change_mtu = hdlc_change_mtu;
@@ -258,11 +288,11 @@
 
 
 
-void unregister_hdlc_device(hdlc_device *hdlc)
+void unregister_hdlc_device(struct net_device *dev)
 {
 	rtnl_lock();
-	hdlc_proto_detach(hdlc);
-	unregister_netdevice(hdlc_to_dev(hdlc));
+	hdlc_proto_detach(dev_to_hdlc(dev));
+	unregister_netdevice(dev);
 	rtnl_unlock();
 }
 
@@ -276,6 +306,7 @@
 EXPORT_SYMBOL(hdlc_close);
 EXPORT_SYMBOL(hdlc_set_carrier);
 EXPORT_SYMBOL(hdlc_ioctl);
+EXPORT_SYMBOL(alloc_hdlcdev);
 EXPORT_SYMBOL(register_hdlc_device);
 EXPORT_SYMBOL(unregister_hdlc_device);
 
--- diff/drivers/net/wan/hdlc_ppp.c	2003-08-20 14:16:10.000000000 +0100
+++ source/drivers/net/wan/hdlc_ppp.c	2004-02-09 10:39:54.000000000 +0000
@@ -24,9 +24,9 @@
 #include <linux/hdlc.h>
 
 
-static int ppp_open(hdlc_device *hdlc)
+static int ppp_open(struct net_device *dev)
 {
-	struct net_device *dev = hdlc_to_dev(hdlc);
+	hdlc_device *hdlc = dev_to_hdlc(dev);
 	void *old_ioctl;
 	int result;
 
@@ -52,9 +52,9 @@
 
 
 
-static void ppp_close(hdlc_device *hdlc)
+static void ppp_close(struct net_device *dev)
 {
-	struct net_device *dev = hdlc_to_dev(hdlc);
+	hdlc_device *hdlc = dev_to_hdlc(dev);
 
 	sppp_close(dev);
 	sppp_detach(dev);
@@ -74,9 +74,9 @@
 
 
 
-int hdlc_ppp_ioctl(hdlc_device *hdlc, struct ifreq *ifr)
+int hdlc_ppp_ioctl(struct net_device *dev, struct ifreq *ifr)
 {
-	struct net_device *dev = hdlc_to_dev(hdlc);
+	hdlc_device *hdlc = dev_to_hdlc(dev);
 	int result;
 
 	switch (ifr->ifr_settings.type) {
@@ -93,7 +93,7 @@
 
 		/* no settable parameters */
 
-		result=hdlc->attach(hdlc, ENCODING_NRZ,PARITY_CRC16_PR1_CCITT);
+		result=hdlc->attach(dev, ENCODING_NRZ,PARITY_CRC16_PR1_CCITT);
 		if (result)
 			return result;
 
--- diff/drivers/net/wan/hdlc_raw.c	2003-08-20 14:16:10.000000000 +0100
+++ source/drivers/net/wan/hdlc_raw.c	2004-02-09 10:39:54.000000000 +0000
@@ -32,12 +32,12 @@
 
 
 
-int hdlc_raw_ioctl(hdlc_device *hdlc, struct ifreq *ifr)
+int hdlc_raw_ioctl(struct net_device *dev, struct ifreq *ifr)
 {
 	raw_hdlc_proto *raw_s = ifr->ifr_settings.ifs_ifsu.raw_hdlc;
 	const size_t size = sizeof(raw_hdlc_proto);
 	raw_hdlc_proto new_settings;
-	struct net_device *dev = hdlc_to_dev(hdlc);
+	hdlc_device *hdlc = dev_to_hdlc(dev);
 	int result;
 
 	switch (ifr->ifr_settings.type) {
@@ -67,7 +67,7 @@
 		if (new_settings.parity == PARITY_DEFAULT)
 			new_settings.parity = PARITY_CRC16_PR1_CCITT;
 
-		result = hdlc->attach(hdlc, new_settings.encoding,
+		result = hdlc->attach(dev, new_settings.encoding,
 				      new_settings.parity);
 		if (result)
 			return result;
--- diff/drivers/net/wan/hdlc_raw_eth.c	2003-08-20 14:16:10.000000000 +0100
+++ source/drivers/net/wan/hdlc_raw_eth.c	2004-02-09 10:39:54.000000000 +0000
@@ -33,7 +33,7 @@
 		int len = skb->len;
 		if (skb_tailroom(skb) < pad)
 			if (pskb_expand_head(skb, 0, pad, GFP_ATOMIC)) {
-				dev_to_hdlc(dev)->stats.tx_dropped++;
+				hdlc_stats(dev)->tx_dropped++;
 				dev_kfree_skb(skb);
 				return 0;
 			}
@@ -44,12 +44,12 @@
 }
 
 
-int hdlc_raw_eth_ioctl(hdlc_device *hdlc, struct ifreq *ifr)
+int hdlc_raw_eth_ioctl(struct net_device *dev, struct ifreq *ifr)
 {
 	raw_hdlc_proto *raw_s = ifr->ifr_settings.ifs_ifsu.raw_hdlc;
 	const size_t size = sizeof(raw_hdlc_proto);
 	raw_hdlc_proto new_settings;
-	struct net_device *dev = hdlc_to_dev(hdlc);
+	hdlc_device *hdlc = dev_to_hdlc(dev);
 	int result;
 	void *old_ch_mtu;
 	int old_qlen;
@@ -81,7 +81,7 @@
 		if (new_settings.parity == PARITY_DEFAULT)
 			new_settings.parity = PARITY_CRC16_PR1_CCITT;
 
-		result = hdlc->attach(hdlc, new_settings.encoding,
+		result = hdlc->attach(dev, new_settings.encoding,
 				      new_settings.parity);
 		if (result)
 			return result;
--- diff/drivers/net/wan/hdlc_x25.c	2003-10-09 09:47:34.000000000 +0100
+++ source/drivers/net/wan/hdlc_x25.c	2004-02-09 10:39:54.000000000 +0000
@@ -25,21 +25,20 @@
 
 /* These functions are callbacks called by LAPB layer */
 
-static void x25_connect_disconnect(void *token, int reason, int code)
+static void x25_connect_disconnect(struct net_device *dev, int reason, int code)
 {
-	hdlc_device *hdlc = token;
 	struct sk_buff *skb;
 	unsigned char *ptr;
 
 	if ((skb = dev_alloc_skb(1)) == NULL) {
-		printk(KERN_ERR "%s: out of memory\n", hdlc_to_name(hdlc));
+		printk(KERN_ERR "%s: out of memory\n", dev->name);
 		return;
 	}
 
 	ptr = skb_put(skb, 1);
 	*ptr = code;
 
-	skb->dev = hdlc_to_dev(hdlc);
+	skb->dev = dev;
 	skb->protocol = htons(ETH_P_X25);
 	skb->mac.raw = skb->data;
 	skb->pkt_type = PACKET_HOST;
@@ -49,23 +48,22 @@
 
 
 
-static void x25_connected(void *token, int reason)
+static void x25_connected(struct net_device *dev, int reason)
 {
-	x25_connect_disconnect(token, reason, 1);
+	x25_connect_disconnect(dev, reason, 1);
 }
 
 
 
-static void x25_disconnected(void *token, int reason)
+static void x25_disconnected(struct net_device *dev, int reason)
 {
-	x25_connect_disconnect(token, reason, 2);
+	x25_connect_disconnect(dev, reason, 2);
 }
 
 
 
-static int x25_data_indication(void *token, struct sk_buff *skb)
+static int x25_data_indication(struct net_device *dev, struct sk_buff *skb)
 {
-	hdlc_device *hdlc = token;
 	unsigned char *ptr;
 
 	skb_push(skb, 1);
@@ -76,7 +74,7 @@
 	ptr  = skb->data;
 	*ptr = 0;
 
-	skb->dev = hdlc_to_dev(hdlc);
+	skb->dev = dev;
 	skb->protocol = htons(ETH_P_X25);
 	skb->mac.raw = skb->data;
 	skb->pkt_type = PACKET_HOST;
@@ -86,17 +84,16 @@
 
 
 
-static void x25_data_transmit(void *token, struct sk_buff *skb)
+static void x25_data_transmit(struct net_device *dev, struct sk_buff *skb)
 {
-	hdlc_device *hdlc = token;
-	hdlc->xmit(skb, hdlc_to_dev(hdlc)); /* Ignore return value :-( */
+	hdlc_device *hdlc = dev_to_hdlc(dev);
+	hdlc->xmit(skb, dev); /* Ignore return value :-( */
 }
 
 
 
 static int x25_xmit(struct sk_buff *skb, struct net_device *dev)
 {
-	hdlc_device *hdlc = dev_to_hdlc(dev);
 	int result;
 
 
@@ -104,31 +101,31 @@
 	switch (skb->data[0]) {
 	case 0:		/* Data to be transmitted */
 		skb_pull(skb, 1);
-		if ((result = lapb_data_request(hdlc, skb)) != LAPB_OK)
+		if ((result = lapb_data_request(dev, skb)) != LAPB_OK)
 			dev_kfree_skb(skb);
 		return 0;
 
 	case 1:
-		if ((result = lapb_connect_request(hdlc))!= LAPB_OK) {
+		if ((result = lapb_connect_request(dev))!= LAPB_OK) {
 			if (result == LAPB_CONNECTED)
 				/* Send connect confirm. msg to level 3 */
-				x25_connected(hdlc, 0);
+				x25_connected(dev, 0);
 			else
 				printk(KERN_ERR "%s: LAPB connect request "
 				       "failed, error code = %i\n",
-				       hdlc_to_name(hdlc), result);
+				       dev->name, result);
 		}
 		break;
 
 	case 2:
-		if ((result = lapb_disconnect_request(hdlc)) != LAPB_OK) {
+		if ((result = lapb_disconnect_request(dev)) != LAPB_OK) {
 			if (result == LAPB_NOTCONNECTED)
 				/* Send disconnect confirm. msg to level 3 */
-				x25_disconnected(hdlc, 0);
+				x25_disconnected(dev, 0);
 			else
 				printk(KERN_ERR "%s: LAPB disconnect request "
 				       "failed, error code = %i\n",
-				       hdlc_to_name(hdlc), result);
+				       dev->name, result);
 		}
 		break;
 
@@ -142,7 +139,7 @@
 
 
 
-static int x25_open(hdlc_device *hdlc)
+static int x25_open(struct net_device *dev)
 {
 	struct lapb_register_struct cb;
 	int result;
@@ -154,7 +151,7 @@
 	cb.data_indication = x25_data_indication;
 	cb.data_transmit = x25_data_transmit;
 
-	result = lapb_register(hdlc, &cb);
+	result = lapb_register(dev, &cb);
 	if (result != LAPB_OK)
 		return result;
 	return 0;
@@ -162,9 +159,9 @@
 
 
 
-static void x25_close(hdlc_device *hdlc)
+static void x25_close(struct net_device *dev)
 {
-	lapb_unregister(hdlc);
+	lapb_unregister(dev);
 }
 
 
@@ -178,7 +175,7 @@
 		return NET_RX_DROP;
 	}
 
-	if (lapb_data_received(hdlc, skb) == LAPB_OK)
+	if (lapb_data_received(skb->dev, skb) == LAPB_OK)
 		return NET_RX_SUCCESS;
 
 	hdlc->stats.rx_errors++;
@@ -188,9 +185,9 @@
 
 
 
-int hdlc_x25_ioctl(hdlc_device *hdlc, struct ifreq *ifr)
+int hdlc_x25_ioctl(struct net_device *dev, struct ifreq *ifr)
 {
-	struct net_device *dev = hdlc_to_dev(hdlc);
+	hdlc_device *hdlc = dev_to_hdlc(dev);
 	int result;
 
 	switch (ifr->ifr_settings.type) {
@@ -205,7 +202,7 @@
 		if(dev->flags & IFF_UP)
 			return -EBUSY;
 
-		result=hdlc->attach(hdlc, ENCODING_NRZ,PARITY_CRC16_PR1_CCITT);
+		result=hdlc->attach(dev, ENCODING_NRZ,PARITY_CRC16_PR1_CCITT);
 		if (result)
 			return result;
 
--- diff/drivers/net/wan/hostess_sv11.c	2003-10-27 09:20:38.000000000 +0000
+++ source/drivers/net/wan/hostess_sv11.c	2004-02-09 10:39:54.000000000 +0000
@@ -122,7 +122,6 @@
 	 */
 
 	netif_start_queue(d);
-	MOD_INC_USE_COUNT;
 	return 0;
 }
 
@@ -154,7 +153,6 @@
 			z8530_sync_txdma_close(d, &sv11->sync.chanA);
 			break;
 	}
-	MOD_DEC_USE_COUNT;
 	return 0;
 }
 
@@ -203,6 +201,16 @@
 	return 0;
 }
 
+static void sv11_setup(struct net_device *dev)
+{	
+	dev->open = hostess_open;
+	dev->stop = hostess_close;
+	dev->hard_start_xmit = hostess_queue_xmit;
+	dev->get_stats = hostess_get_stats;
+	dev->do_ioctl = hostess_ioctl;
+	dev->neigh_setup = hostess_neigh_setup_dev;
+}
+
 /*
  *	Description block for a Comtrol Hostess SV11 card
  */
@@ -229,10 +237,12 @@
 	memset(sv, 0, sizeof(*sv));
 	sv->if_ptr=&sv->netdev;
 	
-	sv->netdev.dev=(struct net_device *)kmalloc(sizeof(struct net_device), GFP_KERNEL);
+	sv->netdev.dev = alloc_netdev(0, "hdlc%d", sv11_setup);
 	if(!sv->netdev.dev)
 		goto fail2;
 
+	SET_MODULE_OWNER(sv->netdev.dev);
+
 	dev=&sv->sync;
 	
 	/*
@@ -326,23 +336,14 @@
 		d->base_addr = iobase;
 		d->irq = irq;
 		d->priv = sv;
-		d->init = NULL;
-		
-		d->open = hostess_open;
-		d->stop = hostess_close;
-		d->hard_start_xmit = hostess_queue_xmit;
-		d->get_stats = hostess_get_stats;
-		d->set_multicast_list = NULL;
-		d->do_ioctl = hostess_ioctl;
-		d->neigh_setup = hostess_neigh_setup_dev;
-		d->set_mac_address = NULL;
 		
 		if(register_netdev(d))
 		{
 			printk(KERN_ERR "%s: unable to register device.\n",
 				d->name);
-			goto fail;
-		}				
+			sppp_detach(d);
+			goto dmafail2;
+		}
 
 		z8530_describe(dev, "I/O", iobase);
 		dev->active=1;
@@ -357,7 +358,7 @@
 fail:
 	free_irq(irq, dev);
 fail1:
-	kfree(sv->netdev.dev);
+	free_netdev(sv->netdev.dev);
 fail2:
 	kfree(sv);
 fail3:
@@ -368,8 +369,8 @@
 static void sv11_shutdown(struct sv11_device *dev)
 {
 	sppp_detach(dev->netdev.dev);
-	z8530_shutdown(&dev->sync);
 	unregister_netdev(dev->netdev.dev);
+	z8530_shutdown(&dev->sync);
 	free_irq(dev->sync.irq, dev);
 	if(dma)
 	{
@@ -378,6 +379,8 @@
 		free_dma(dev->sync.chanA.txdma);
 	}
 	release_region(dev->sync.chanA.ctrlio-1, 8);
+	free_netdev(dev->netdev.dev);
+	kfree(dev);
 }
 
 #ifdef MODULE
--- diff/drivers/net/wan/lapbether.c	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/net/wan/lapbether.c	2004-02-09 10:39:54.000000000 +0000
@@ -110,7 +110,7 @@
 	skb_pull(skb, 2);	/* Remove the length bytes */
 	skb_trim(skb, len);	/* Set the length of the data */
 
-	if ((err = lapb_data_received(lapbeth, skb)) != LAPB_OK) {
+	if ((err = lapb_data_received(lapbeth->axdev, skb)) != LAPB_OK) {
 		printk(KERN_DEBUG "lapbether: lapb_data_received err - %d\n", err);
 		goto drop_unlock;
 	}
@@ -125,9 +125,8 @@
 	return 0;
 }
 
-static int lapbeth_data_indication(void *token, struct sk_buff *skb)
+static int lapbeth_data_indication(struct net_device *dev, struct sk_buff *skb)
 {
-	struct lapbethdev *lapbeth = (struct lapbethdev *)token;
 	unsigned char *ptr;
 
 	skb_push(skb, 1);
@@ -138,7 +137,7 @@
 	ptr  = skb->data;
 	*ptr = 0x00;
 
-	skb->dev      = lapbeth->axdev;
+	skb->dev      = dev;
 	skb->protocol = htons(ETH_P_X25);
 	skb->mac.raw  = skb->data;
 	skb->pkt_type = PACKET_HOST;
@@ -152,7 +151,6 @@
  */
 static int lapbeth_xmit(struct sk_buff *skb, struct net_device *dev)
 {
-	struct lapbethdev *lapbeth = (struct lapbethdev *)dev->priv;
 	int err = -ENODEV;
 
 	/*
@@ -168,12 +166,12 @@
 		err = 0;
 		break;
 	case 0x01:
-		if ((err = lapb_connect_request(lapbeth)) != LAPB_OK)
+		if ((err = lapb_connect_request(dev)) != LAPB_OK)
 			printk(KERN_ERR "lapbeth: lapb_connect_request "
 			       "error: %d\n", err);
 		goto drop_ok;
 	case 0x02:
-		if ((err = lapb_disconnect_request(lapbeth)) != LAPB_OK)
+		if ((err = lapb_disconnect_request(dev)) != LAPB_OK)
 			printk(KERN_ERR "lapbeth: lapb_disconnect_request "
 			       "err: %d\n", err);
 		/* Fall thru */
@@ -183,7 +181,7 @@
 
 	skb_pull(skb, 1);
 
-	if ((err = lapb_data_request(lapbeth, skb)) != LAPB_OK) {
+	if ((err = lapb_data_request(dev, skb)) != LAPB_OK) {
 		printk(KERN_ERR "lapbeth: lapb_data_request error - %d\n", err);
 		err = -ENOMEM;
 		goto drop;
@@ -198,9 +196,9 @@
 	goto out;
 }
 
-static void lapbeth_data_transmit(void *token, struct sk_buff *skb)
+static void lapbeth_data_transmit(struct net_device *ndev, struct sk_buff *skb)
 {
-	struct lapbethdev *lapbeth = (struct lapbethdev *)token;
+	struct lapbethdev *lapbeth = ndev->priv;
 	unsigned char *ptr;
 	struct net_device *dev;
 	int size = skb->len;
@@ -222,9 +220,8 @@
 	dev_queue_xmit(skb);
 }
 
-static void lapbeth_connected(void *token, int reason)
+static void lapbeth_connected(struct net_device *dev, int reason)
 {
-	struct lapbethdev *lapbeth = (struct lapbethdev *)token;
 	unsigned char *ptr;
 	struct sk_buff *skb = dev_alloc_skb(1);
 
@@ -236,7 +233,7 @@
 	ptr  = skb_put(skb, 1);
 	*ptr = 0x01;
 
-	skb->dev      = lapbeth->axdev;
+	skb->dev      = dev;
 	skb->protocol = htons(ETH_P_X25);
 	skb->mac.raw  = skb->data;
 	skb->pkt_type = PACKET_HOST;
@@ -245,9 +242,8 @@
 	netif_rx(skb);
 }
 
-static void lapbeth_disconnected(void *token, int reason)
+static void lapbeth_disconnected(struct net_device *dev, int reason)
 {
-	struct lapbethdev *lapbeth = (struct lapbethdev *)token;
 	unsigned char *ptr;
 	struct sk_buff *skb = dev_alloc_skb(1);
 
@@ -259,7 +255,7 @@
 	ptr  = skb_put(skb, 1);
 	*ptr = 0x02;
 
-	skb->dev      = lapbeth->axdev;
+	skb->dev      = dev;
 	skb->protocol = htons(ETH_P_X25);
 	skb->mac.raw  = skb->data;
 	skb->pkt_type = PACKET_HOST;
@@ -303,11 +299,9 @@
  */
 static int lapbeth_open(struct net_device *dev)
 {
-	struct lapbethdev *lapbeth;
 	int err;
 
-	lapbeth = (struct lapbethdev *)dev->priv;
-	if ((err = lapb_register(lapbeth, &lapbeth_callbacks)) != LAPB_OK) {
+	if ((err = lapb_register(dev, &lapbeth_callbacks)) != LAPB_OK) {
 		printk(KERN_ERR "lapbeth: lapb_register error - %d\n", err);
 		return -ENODEV;
 	}
@@ -318,12 +312,11 @@
 
 static int lapbeth_close(struct net_device *dev)
 {
-	struct lapbethdev *lapbeth = (struct lapbethdev *)dev->priv;
 	int err;
 
 	netif_stop_queue(dev);
 
-	if ((err = lapb_unregister(lapbeth)) != LAPB_OK)
+	if ((err = lapb_unregister(dev)) != LAPB_OK)
 		printk(KERN_ERR "lapbeth: lapb_unregister error - %d\n", err);
 
 	return 0;
@@ -382,6 +375,7 @@
 	return rc;
 fail:
 	dev_put(dev);
+	free_netdev(ndev);
 	kfree(lapbeth);
 	goto out;
 }
--- diff/drivers/net/wan/lmc/lmc_debug.h	2002-10-16 04:27:08.000000000 +0100
+++ source/drivers/net/wan/lmc/lmc_debug.h	2004-02-09 10:39:54.000000000 +0000
@@ -47,6 +47,6 @@
 
 void lmcConsoleLog(char *type, unsigned char *ucData, int iLen);
 void lmcEventLog (u_int32_t EventNum, u_int32_t arg2, u_int32_t arg3);
-inline void lmc_trace(struct net_device *dev, char *msg);
+void lmc_trace(struct net_device *dev, char *msg);
 
 #endif
--- diff/drivers/net/wan/lmc/lmc_main.c	2003-08-26 10:00:53.000000000 +0100
+++ source/drivers/net/wan/lmc/lmc_main.c	2004-02-09 10:39:54.000000000 +0000
@@ -78,30 +78,22 @@
 #include "lmc_debug.h"
 #include "lmc_proto.h"
 
-
-static int Lmc_Count = 0;
-static struct net_device *Lmc_root_dev = NULL;
-static u8 cards_found = 0;
-
 static int lmc_first_load = 0;
 
-int LMC_PKT_BUF_SZ = 1542;
+static int LMC_PKT_BUF_SZ = 1542;
 
-#ifdef MODULE
 static struct pci_device_id lmc_pci_tbl[] = {
-    { 0x1011, 0x009, 0x1379, PCI_ANY_ID, 0, 0, 0},
-    { 0, }
+	{ PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_TULIP_FAST,
+	  PCI_VENDOR_ID_LMC, PCI_ANY_ID },
+	{ PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_TULIP_FAST,
+	  PCI_ANY_ID, PCI_VENDOR_ID_LMC },
+	{ 0 }
 };
 
 MODULE_DEVICE_TABLE(pci, lmc_pci_tbl);
-
 MODULE_LICENSE("GPL");
-#endif
 
 
-int lmc_probe_fake(struct net_device *dev);
-static struct net_device *lmc_probe1(struct net_device *dev, unsigned long ioaddr, unsigned int irq,
-				 int chip_id, int subdevice, int board_idx);
 static int lmc_start_xmit(struct sk_buff *skb, struct net_device *dev);
 static int lmc_start_xmit(struct sk_buff *skb, struct net_device *dev);
 static int lmc_rx (struct net_device *dev);
@@ -115,12 +107,9 @@
 static void lmc_running_reset(struct net_device *dev);
 static int lmc_ifdown(struct net_device * const);
 static void lmc_watchdog(unsigned long data);
-static int lmc_init(struct net_device * const);
 static void lmc_reset(lmc_softc_t * const sc);
 static void lmc_dec_reset(lmc_softc_t * const sc);
 static void lmc_driver_timeout(struct net_device *dev);
-int lmc_setup(void);
-
 
 /*
  * linux reserves 16 device specific IOCTLs.  We call them
@@ -815,67 +804,77 @@
 
 }
 
-static int lmc_init(struct net_device * const dev) /*fold00*/
+static void lmc_setup(struct net_device * const dev) /*fold00*/
 {
-    lmc_trace(dev, "lmc_init in");
-    lmc_trace(dev, "lmc_init out");
-	
-    return 0;
+    lmc_trace(dev, "lmc_setup in");
+
+    dev->type = ARPHRD_HDLC;
+    dev->hard_start_xmit = lmc_start_xmit;
+    dev->open = lmc_open;
+    dev->stop = lmc_close;
+    dev->get_stats = lmc_get_stats;
+    dev->do_ioctl = lmc_ioctl;
+    dev->set_config = lmc_set_config;
+    dev->tx_timeout = lmc_driver_timeout;
+    dev->watchdog_timeo = (HZ); /* 1 second */
+    
+    lmc_trace(dev, "lmc_setup out");
 }
 
-/* This initializes each card from lmc_probe() */
-static struct net_device *lmc_probe1 (struct net_device *dev, unsigned long ioaddr, unsigned int irq, /*fold00*/
-                                  int chip_id, int subdevice, int board_idx)
+
+static int __devinit lmc_init_one(struct pci_dev *pdev,
+				  const struct pci_device_id *ent)
 {
-    lmc_softc_t *sc = NULL;
+    struct net_device *dev;
+    lmc_softc_t *sc;
+    u16 subdevice;
     u_int16_t AdapModelNum;
-
-    /*
-     * Allocate our own device structure
-     */
-
-    dev = kmalloc (sizeof (struct net_device)+8, GFP_KERNEL);
-    if (dev == NULL){
-        printk (KERN_ERR "lmc: kmalloc for device failed\n");
-        return NULL;
-    }
-    memset (dev, 0, sizeof (struct net_device));
-
+    int err = -ENOMEM;
+    static int cards_found;
 #ifndef GCOM
-    /*
-     *	Switch to common hdlc%d naming. We name by type not by vendor
-     */
-    
-    dev_alloc_name(dev, "hdlc%d");
+    /* We name by type not by vendor */
+    static const char lmcname[] = "hdlc%d";
 #else
-    /*
+    /* 
      * GCOM uses LMC vendor name so that clients can know which card
      * to attach to.
      */
-    dev_alloc_name(dev, "lmc%d");
+    static const char lmcname[] = "lmc%d";
 #endif
 
-    lmc_trace(dev, "lmc_probe1 in");
+
+    /*
+     * Allocate our own device structure
+     */
+    dev = alloc_netdev(sizeof(lmc_softc_t), lmcname, lmc_setup);
+    if (!dev) {
+        printk (KERN_ERR "lmc:alloc_netdev for device failed\n");
+	goto out1;
+    }
+ 
+    lmc_trace(dev, "lmc_init_one in");
+
+    err = pci_enable_device(pdev);
+    if (err) {
+	    printk(KERN_ERR "lmc: pci enable failed:%d\n", err);
+	    goto out2;
+    }
     
-    Lmc_Count++;
+    if (pci_request_regions(pdev, "lmc")) {
+	    printk(KERN_ERR "lmc: pci_request_region failed\n");
+	    err = -EIO;
+	    goto out3;
+    }
+
+    pci_set_drvdata(pdev, dev);
 
     if(lmc_first_load == 0){
-        printk(KERN_INFO "Lan Media Corporation WAN Driver Version %d.%d.%d\n",DRIVER_MAJOR_VERSION, DRIVER_MINOR_VERSION,DRIVER_SUB_VERSION);
+        printk(KERN_INFO "Lan Media Corporation WAN Driver Version %d.%d.%d\n",
+	       DRIVER_MAJOR_VERSION, DRIVER_MINOR_VERSION,DRIVER_SUB_VERSION);
         lmc_first_load = 1;
     }
     
-    /*
-     * Allocate space for the private data structure
-     */
-
-    sc = kmalloc (sizeof (lmc_softc_t), GFP_KERNEL);
-    if (sc == NULL) {
-        printk (KERN_WARNING "%s: Cannot allocate memory for device state\n",
-                dev->name);
-        return (NULL);
-    }
-    memset (sc, 0, sizeof (lmc_softc_t));
-    dev->priv = sc;
+    sc = dev->priv;
     sc->lmc_device = dev;
     sc->name = dev->name;
 
@@ -883,8 +882,12 @@
     /* An ioctl can cause a subsequent detach for raw frame interface */
     sc->if_type = LMC_PPP;
     sc->check = 0xBEAFCAFE;
-    dev->base_addr = ioaddr;
-    dev->irq = irq;
+    dev->base_addr = pci_resource_start(pdev, 0);
+    dev->irq = pdev->irq;
+
+    SET_MODULE_OWNER(dev);
+    SET_NETDEV_DEV(dev, &pdev->dev);
+
     /*
      * This will get the protocol layer ready and do any 1 time init's
      * Must have a valid sc and dev structure
@@ -893,19 +896,6 @@
 
     lmc_proto_attach(sc);
 
-    /* Just fill in the entries for the device */
-
-    dev->init = lmc_init;
-    dev->type = ARPHRD_HDLC;
-    dev->hard_start_xmit = lmc_start_xmit;
-    dev->open = lmc_open;
-    dev->stop = lmc_close;
-    dev->get_stats = lmc_get_stats;
-    dev->do_ioctl = lmc_ioctl;
-    dev->set_config = lmc_set_config;
-    dev->tx_timeout = lmc_driver_timeout;
-    dev->watchdog_timeo = (HZ); /* 1 second */
-    
     /*
      * Why were we changing this???
      dev->tx_queue_len = 100;
@@ -914,44 +904,45 @@
     /* Init the spin lock so can call it latter */
 
     spin_lock_init(&sc->lmc_lock);
+    pci_set_master(pdev);
 
-    printk ("%s: detected at %lx, irq %d\n", dev->name, ioaddr, dev->irq);
+    printk ("%s: detected at %lx, irq %d\n", dev->name,
+	    dev->base_addr, dev->irq);
 
     if (register_netdev (dev) != 0) {
         printk (KERN_ERR "%s: register_netdev failed.\n", dev->name);
-        lmc_proto_detach(sc);
-        kfree (dev->priv);
-        kfree (dev);
-        return NULL;
+	goto out4;
     }
 
-    /*
-     * Request the region of registers we need, so that
-     * later on, no one else will take our card away from
-     * us.
-     */
-    request_region (ioaddr, LMC_REG_RANGE, dev->name);
-
     sc->lmc_cardtype = LMC_CARDTYPE_UNKNOWN;
     sc->lmc_timing = LMC_CTL_CLOCK_SOURCE_EXT;
 
+    /*
+     *
+     * Check either the subvendor or the subdevice, some systems reverse
+     * the setting in the bois, seems to be version and arch dependent?
+     * Fix the error, exchange the two values 
+     */
+    if ((subdevice = pdev->subsystem_device) == PCI_VENDOR_ID_LMC)
+	    subdevice = pdev->subsystem_vendor;
+
     switch (subdevice) {
-    case PCI_PRODUCT_LMC_HSSI:
+    case PCI_DEVICE_ID_LMC_HSSI:
         printk ("%s: LMC HSSI\n", dev->name);
         sc->lmc_cardtype = LMC_CARDTYPE_HSSI;
         sc->lmc_media = &lmc_hssi_media;
         break;
-    case PCI_PRODUCT_LMC_DS3:
+    case PCI_DEVICE_ID_LMC_DS3:
         printk ("%s: LMC DS3\n", dev->name);
         sc->lmc_cardtype = LMC_CARDTYPE_DS3;
         sc->lmc_media = &lmc_ds3_media;
         break;
-    case PCI_PRODUCT_LMC_SSI:
+    case PCI_DEVICE_ID_LMC_SSI:
         printk ("%s: LMC SSI\n", dev->name);
         sc->lmc_cardtype = LMC_CARDTYPE_SSI;
         sc->lmc_media = &lmc_ssi_media;
         break;
-    case PCI_PRODUCT_LMC_T1:
+    case PCI_DEVICE_ID_LMC_T1:
         printk ("%s: LMC T1\n", dev->name);
         sc->lmc_cardtype = LMC_CARDTYPE_T1;
         sc->lmc_media = &lmc_t1_media;
@@ -976,13 +967,13 @@
     AdapModelNum = (lmc_mii_readreg (sc, 0, 3) & 0x3f0) >> 4;
 
     if ((AdapModelNum == LMC_ADAP_T1
-         && subdevice == PCI_PRODUCT_LMC_T1) ||		/* detect LMC1200 */
+         && subdevice == PCI_DEVICE_ID_LMC_T1) ||	/* detect LMC1200 */
         (AdapModelNum == LMC_ADAP_SSI
-         && subdevice == PCI_PRODUCT_LMC_SSI) ||	/* detect LMC1000 */
+         && subdevice == PCI_DEVICE_ID_LMC_SSI) ||	/* detect LMC1000 */
         (AdapModelNum == LMC_ADAP_DS3
-         && subdevice == PCI_PRODUCT_LMC_DS3) ||	/* detect LMC5245 */
+         && subdevice == PCI_DEVICE_ID_LMC_DS3) ||	/* detect LMC5245 */
         (AdapModelNum == LMC_ADAP_HSSI
-         && subdevice == PCI_PRODUCT_LMC_HSSI))
+         && subdevice == PCI_DEVICE_ID_LMC_HSSI))
     {				/* detect LMC5200 */
 
     }
@@ -996,10 +987,7 @@
      */
     LMC_CSR_WRITE (sc, csr_gp_timer, 0xFFFFFFFFUL);
 
-    sc->board_idx = board_idx;
-
-    memset (&sc->stats, 0, sizeof (struct lmc_statistics));
-
+    sc->board_idx = cards_found++;
     sc->stats.check = STATCHECK;
     sc->stats.version_size = (DRIVER_VERSION << 16) +
         sizeof (struct lmc_statistics);
@@ -1008,105 +996,40 @@
     sc->lmc_ok = 0;
     sc->last_link_status = 0;
 
-    lmc_trace(dev, "lmc_probe1 out");
-
-    return dev;
-}
-
-
-/* This is the entry point.  This is what is called immediately. */
-/* This goes out and finds the card */
+    lmc_trace(dev, "lmc_init_one out");
+    return 0;
 
-int lmc_probe_fake(struct net_device *dev) /*fold00*/
-{
-    lmc_probe(NULL);
-    /* Return 1 to unloaded bogus device */
-    return 1;
+ out4:
+    lmc_proto_detach(sc);
+ out3:
+    if (pdev) {
+	    pci_release_regions(pdev);
+	    pci_set_drvdata(pdev, NULL);
+    }
+ out2:
+    free_netdev(dev);
+ out1:
+    return err;
 }
 
-int lmc_probe (struct net_device *dev) /*fold00*/
+/*
+ * Called from pci when removing module.
+ */
+static void __devexit lmc_remove_one (struct pci_dev *pdev)
 {
-    int pci_index = 0;
-    unsigned long pci_ioaddr;
-    unsigned int pci_irq_line;
-    u16 vendor, subvendor, device, subdevice;
-    u32 foundaddr = 0;
-    u8 intcf = 0;
-    struct pci_dev *pdev = NULL;
-
-    /* Loop basically until we don't find anymore. */
-    while ((pdev = pci_find_class (PCI_CLASS_NETWORK_ETHERNET << 8, pdev))) {
-	if (pci_enable_device(pdev))
-		break;
-
-        vendor = pdev->vendor;
-        device = pdev->device;
-        pci_irq_line = pdev->irq;
-        pci_ioaddr = pci_resource_start (pdev, 0);
-	subvendor = pdev->subsystem_vendor;
-	subdevice = pdev->subsystem_device;
-
-	pci_set_master (pdev);
-
-        /*
-         * Make sure it's the correct card.  CHECK SUBVENDOR ID!
-         * There are lots of tulip's out there.
-         * Also check the region of registers we will soon be
-         * poking, to make sure no one else has reserved them.
-         * This prevents taking someone else's device.
-         *
-         * Check either the subvendor or the subdevice, some systems reverse
-         * the setting in the bois, seems to be version and arch dependent?
-         * Fix the two variables
-         *
-         */
-        if (!(check_region (pci_ioaddr, LMC_REG_RANGE)) &&
-            (vendor == CORRECT_VENDOR_ID) &&
-            (device == CORRECT_DEV_ID) &&
-            ((subvendor == PCI_VENDOR_LMC)  || (subdevice == PCI_VENDOR_LMC))){
-            struct net_device *cur, *prev = NULL;
-
-            /* Fix the error, exchange the two values */
-            if(subdevice == PCI_VENDOR_LMC){
-                subdevice = subvendor;
-                subvendor = PCI_VENDOR_LMC ;
-            }
-
-            /* Make the call to actually setup this card */
-            dev = lmc_probe1 (dev, pci_ioaddr, pci_irq_line,
-                              device, subdevice, cards_found);
-            if (dev == NULL) {
-                printk ("lmc_probe: lmc_probe1 failed\n");
-                goto lmc_probe_next_card;
-            }
-            /* insert the device into the chain of lmc devices */
-            for (cur = Lmc_root_dev;
-                 cur != NULL;
-                 cur = ((lmc_softc_t *) cur->priv)->next_module) {
-                prev = cur;
-            }
-
-            if (prev == NULL)
-                Lmc_root_dev = dev;
-            else
-                ((lmc_softc_t *) prev->priv)->next_module = dev;
-
-            ((lmc_softc_t *) dev->priv)->next_module = NULL;
-            /* end insert */
-
-            foundaddr = dev->base_addr;
-
-            cards_found++;
-            intcf++;
-        }
-    lmc_probe_next_card:
-        pci_index++;
+    struct net_device *dev = pci_get_drvdata(pdev);
+    
+    if (dev) {
+	    lmc_softc_t *sc = dev->priv;
+	    
+	    printk("%s: removing...\n", dev->name);
+	    lmc_proto_detach(sc);
+	    unregister_netdev(dev);
+	    free_netdev(dev);
+	    pci_release_regions(pdev);
+	    pci_disable_device(pdev);
+	    pci_set_drvdata(pdev, NULL);
     }
-
-    if (cards_found < 1)
-        return -1;
-
-    return foundaddr;
 }
 
 /* After this is called, packets can be sent.
@@ -1181,8 +1104,6 @@
     
     sc->stats.tx_tbusy0++ ;
 
-    MOD_INC_USE_COUNT;
-
     /*
      * select what interrupts we want to get
      */
@@ -1352,7 +1273,6 @@
 
     lmc_trace(dev, "lmc_ifdown out");
 
-    MOD_DEC_USE_COUNT;
     return 0;
 }
 
@@ -1850,12 +1770,11 @@
 
 static struct net_device_stats *lmc_get_stats (struct net_device *dev) /*fold00*/
 {
-    lmc_softc_t *sc;
+    lmc_softc_t *sc = dev->priv;
     unsigned long flags;
 
     lmc_trace(dev, "lmc_get_stats in");
 
-    sc = dev->priv;
 
     spin_lock_irqsave(&sc->lmc_lock, flags);
 
@@ -1868,58 +1787,21 @@
     return (struct net_device_stats *) &sc->stats;
 }
 
+static struct pci_driver lmc_driver = {
+	.name		= "lmc",
+	.id_table	= lmc_pci_tbl,
+	.probe		= lmc_init_one,
+	.remove		= __devexit_p(lmc_remove_one),
+};
+
 static int __init init_lmc(void)
 {
-    printk ("lmc: module loaded\n");
-
-    /* Have lmc_probe search for all the cards, and allocate devices */
-    if (lmc_probe (NULL) < 0)
-        return -EIO;
-
-    return 0;
+    return pci_module_init(&lmc_driver);
 }
 
 static void __exit exit_lmc(void)
 {
-    struct net_device *dev, *next;
-    lmc_softc_t *sc;
-
-    /* we have no pointer to our devices, since they are all dynamically
-     * allocated.  So, here we loop through all the network devices
-     * looking for ours.  When found, dispose of them properly.
-     */
-
-    for (dev = Lmc_root_dev;
-         dev != NULL;
-         dev = next )
-    {
-
-        next = ((lmc_softc_t *) dev->priv)->next_module; /* get it now before we deallocate it */
-        printk ("%s: removing...\n", dev->name);
-
-        /* close the syncppp stuff, and release irq. Close is run on unreg net */
-        lmc_close (dev);
-	sc = dev->priv;
-        if (sc != NULL)
-            lmc_proto_detach(sc);
-
-        /* Remove the device from the linked list */
-        unregister_netdev (dev);
-
-        /* Let go of the io region */;
-        release_region (dev->base_addr, LMC_REG_RANGE);
-
-        /* free our allocated structures. */
-        kfree (dev->priv);
-        dev->priv = NULL;
-
-        free_netdev (dev);
-        dev = NULL;
-    }
-
-
-    Lmc_root_dev = NULL;
-    printk ("lmc module unloaded\n");
+    pci_unregister_driver(&lmc_driver);
 }
 
 module_init(init_lmc);
@@ -2326,8 +2208,3 @@
 
 
 }
-
-int lmc_setup(void) { /*FOLD00*/
-   return lmc_probe(NULL);
-}
-
--- diff/drivers/net/wan/lmc/lmc_var.h	2003-06-30 10:07:21.000000000 +0100
+++ source/drivers/net/wan/lmc/lmc_var.h	2004-02-09 10:39:54.000000000 +0000
@@ -390,7 +390,7 @@
 	struct timer_list	timer;
 	lmc_ctl_t		ictl;
 	u_int32_t		TxDescriptControlInit;  
-	struct net_device		*next_module;   /* Link to the next module  */
+
 	int                     tx_TimeoutInd; /* additional driver state */
 	int                     tx_TimeoutDisplay;
 	unsigned int		lastlmc_taint_tx;
@@ -519,18 +519,7 @@
 #define TULIP_CMD_RECEIVEALL 0x40000000L
 #endif
 
-
-/* PCI register values */
-#define CORRECT_VENDOR_ID    0x1011
-#define CORRECT_DEV_ID       9
-
-#define PCI_VENDOR_LMC		0x1376
-#define PCI_PRODUCT_LMC_HSSI	0x0003
-#define PCI_PRODUCT_LMC_DS3	0x0004
-#define PCI_PRODUCT_LMC_SSI	0x0005
-#define PCI_PRODUCT_LMC_T1      0x0006
-
-/* Adapcter module number */
+/* Adapter module number */
 #define LMC_ADAP_HSSI           2
 #define LMC_ADAP_DS3            3
 #define LMC_ADAP_SSI            4
--- diff/drivers/net/wan/n2.c	2003-08-20 14:16:10.000000000 +0100
+++ source/drivers/net/wan/n2.c	2004-02-09 10:39:54.000000000 +0000
@@ -92,7 +92,7 @@
 
 
 typedef struct port_s {
-	hdlc_device hdlc;	/* HDLC device struct - must be first */
+	struct net_device *dev;
 	struct card_s *card;
 	spinlock_t lock;	/* TX lock */
 	sync_serial_settings settings;
@@ -215,13 +215,12 @@
 
 static int n2_open(struct net_device *dev)
 {
-	hdlc_device *hdlc = dev_to_hdlc(dev);
-	port_t *port = hdlc_to_port(hdlc);
+	port_t *port = dev_to_port(dev);
 	int io = port->card->io;
 	u8 mcr = inb(io + N2_MCR) | (port->phy_node ? TX422_PORT1:TX422_PORT0);
 	int result;
 
-	result = hdlc_open(hdlc);
+	result = hdlc_open(dev);
 	if (result)
 		return result;
 
@@ -230,7 +229,7 @@
 
 	outb(inb(io + N2_PCR) | PCR_ENWIN, io + N2_PCR); /* open window */
 	outb(inb(io + N2_PSR) | PSR_DMAEN, io + N2_PSR); /* enable dma */
-	sca_open(hdlc);
+	sca_open(dev);
 	n2_set_iface(port);
 	return 0;
 }
@@ -239,15 +238,14 @@
 
 static int n2_close(struct net_device *dev)
 {
-	hdlc_device *hdlc = dev_to_hdlc(dev);
-	port_t *port = hdlc_to_port(hdlc);
+	port_t *port = dev_to_port(dev);
 	int io = port->card->io;
 	u8 mcr = inb(io+N2_MCR) | (port->phy_node ? TX422_PORT1 : TX422_PORT0);
 
-	sca_close(hdlc);
+	sca_close(dev);
 	mcr |= port->phy_node ? DTR_PORT1 : DTR_PORT0; /* set DTR OFF */
 	outb(mcr, io + N2_MCR);
-	hdlc_close(hdlc);
+	hdlc_close(dev);
 	return 0;
 }
 
@@ -257,12 +255,11 @@
 {
 	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);
+	port_t *port = dev_to_port(dev);
 
 #ifdef DEBUG_RINGS
 	if (cmd == SIOCDEVPRIVATE) {
-		sca_dump_rings(hdlc);
+		sca_dump_rings(dev);
 		return 0;
 	}
 #endif
@@ -312,8 +309,10 @@
 	int cnt;
 
 	for (cnt = 0; cnt < 2; cnt++)
-		if (card->ports[cnt].card)
-			unregister_hdlc_device(&card->ports[cnt].hdlc);
+		if (card->ports[cnt].card) {
+			struct net_device *dev = port_to_dev(&card->ports[cnt]);
+			unregister_hdlc_device(dev);
+		}
 
 	if (card->irq)
 		free_irq(card->irq, card);
@@ -325,6 +324,10 @@
 
 	if (card->io)
 		release_region(card->io, N2_IOPORTS);
+	if (card->ports[0].dev)
+		free_netdev(card->ports[0].dev);
+	if (card->ports[1].dev)
+		free_netdev(card->ports[1].dev);
 	kfree(card);
 }
 
@@ -359,6 +362,14 @@
 	}
 	memset(card, 0, sizeof(card_t));
 
+	card->ports[0].dev = alloc_hdlcdev(&card->ports[0]);
+	card->ports[1].dev = alloc_hdlcdev(&card->ports[1]);
+	if (!card->ports[0].dev || !card->ports[1].dev) {
+		printk(KERN_ERR "n2: unable to allocate memory\n");
+		n2_destroy_card(card);
+		return -ENOMEM;
+	}
+
 	if (!request_region(io, N2_IOPORTS, devname)) {
 		printk(KERN_ERR "n2: I/O port region in use\n");
 		n2_destroy_card(card);
@@ -435,7 +446,8 @@
 	sca_init(card, 0);
 	for (cnt = 0; cnt < 2; cnt++) {
 		port_t *port = &card->ports[cnt];
-		struct net_device *dev = hdlc_to_dev(&port->hdlc);
+		struct net_device *dev = port_to_dev(port);
+		hdlc_device *hdlc = dev_to_hdlc(dev);
 
 		if ((cnt == 0 && !valid0) || (cnt == 1 && !valid1))
 			continue;
@@ -455,21 +467,22 @@
 		dev->do_ioctl = n2_ioctl;
 		dev->open = n2_open;
 		dev->stop = n2_close;
-		port->hdlc.attach = sca_attach;
-		port->hdlc.xmit = sca_xmit;
+		hdlc->attach = sca_attach;
+		hdlc->xmit = sca_xmit;
 		port->settings.clock_type = CLOCK_EXT;
+		port->card = card;
 
-		if (register_hdlc_device(&port->hdlc)) {
+		if (register_hdlc_device(dev)) {
 			printk(KERN_WARNING "n2: unable to register hdlc "
 			       "device\n");
+			port->card = NULL;
 			n2_destroy_card(card);
 			return -ENOBUFS;
 		}
-		port->card = card;
 		sca_init_sync_port(port); /* Set up SCA memory */
 
 		printk(KERN_INFO "%s: RISCom/N2 node %d\n",
-		       hdlc_to_name(&port->hdlc), port->phy_node);
+		       dev->name, port->phy_node);
 	}
 
 	*new_card = card;
--- diff/drivers/net/wan/pc300.h	2002-10-16 04:27:49.000000000 +0100
+++ source/drivers/net/wan/pc300.h	2004-02-09 10:39:54.000000000 +0000
@@ -331,7 +331,7 @@
 	uclong line_off;
 #ifdef __KERNEL__
 	char name[16];
-	hdlc_device *hdlc;
+	struct net_device *dev;
 
 	void *private;
 	struct sk_buff *tx_skb;
@@ -483,7 +483,7 @@
 void tx_dma_stop(pc300_t *, int);
 void rx_dma_stop(pc300_t *, int);
 int cpc_queue_xmit(struct sk_buff *, struct net_device *);
-void cpc_net_rx(hdlc_device *);
+void cpc_net_rx(struct net_device *);
 void cpc_sca_status(pc300_t *, int);
 int cpc_change_mtu(struct net_device *, int);
 int cpc_ioctl(struct net_device *, struct ifreq *, int);
--- diff/drivers/net/wan/pc300_drv.c	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/net/wan/pc300_drv.c	2004-02-09 10:39:54.000000000 +0000
@@ -290,7 +290,7 @@
 static uclong detect_ram(pc300_t *);
 static void plx_init(pc300_t *);
 static void cpc_trace(struct net_device *, struct sk_buff *, char);
-static int cpc_attach(hdlc_device *, unsigned short, unsigned short);
+static int cpc_attach(struct net_device *, unsigned short, unsigned short);
 
 #ifdef CONFIG_PC300_MLPPP
 void cpc_tty_init(pc300dev_t * dev);
@@ -1774,7 +1774,7 @@
 	pc300dev_t *d = (pc300dev_t *) dev->priv;
 	pc300ch_t *chan = (pc300ch_t *) d->chan;
 	pc300_t *card = (pc300_t *) chan->card;
-	struct net_device_stats *stats = &d->hdlc->stats;
+	struct net_device_stats *stats = hdlc_stats(dev);
 	int ch = chan->channel;
 	uclong flags;
 	ucchar ilar;
@@ -1802,7 +1802,7 @@
 	pc300dev_t *d = (pc300dev_t *) dev->priv;
 	pc300ch_t *chan = (pc300ch_t *) d->chan;
 	pc300_t *card = (pc300_t *) chan->card;
-	struct net_device_stats *stats = &d->hdlc->stats;
+	struct net_device_stats *stats = hdlc_stats(dev);
 	int ch = chan->channel;
 	uclong flags;
 #ifdef PC300_DEBUG_TX
@@ -1880,13 +1880,12 @@
 	return 0;
 }
 
-void cpc_net_rx(hdlc_device * hdlc)
+void cpc_net_rx(struct net_device *dev)
 {
-	struct net_device *dev = hdlc_to_dev(hdlc);
 	pc300dev_t *d = (pc300dev_t *) dev->priv;
 	pc300ch_t *chan = (pc300ch_t *) d->chan;
 	pc300_t *card = (pc300_t *) chan->card;
-	struct net_device_stats *stats = &d->hdlc->stats;
+	struct net_device_stats *stats = hdlc_stats(dev);
 	int ch = chan->channel;
 #ifdef PC300_DEBUG_RX
 	int i;
@@ -1975,7 +1974,7 @@
 	pc300_t *card = (pc300_t *)chan->card; 
 	int ch = chan->channel; 
 	volatile pcsca_bd_t * ptdescr; 
-	struct net_device_stats *stats = &dev->hdlc->stats; 
+	struct net_device_stats *stats = hdlc_stats(dev->dev);
 
     /* Clean up descriptors from previous transmission */
 	ptdescr = (pcsca_bd_t *)(card->hw.rambase +
@@ -1999,7 +1998,7 @@
 	} else {
 #endif
 	/* Tell the upper layer we are ready to transmit more packets */
-		netif_wake_queue((struct net_device*)dev->hdlc);
+		netif_wake_queue(dev->dev);
 #ifdef CONFIG_PC300_MLPPP
 	}
 #endif
@@ -2017,8 +2016,8 @@
 		for (ch = 0; ch < card->hw.nchan; ch++) {
 			pc300ch_t *chan = &card->chan[ch];
 			pc300dev_t *d = &chan->d;
-			hdlc_device *hdlc = d->hdlc;
-			struct net_device *dev = hdlc_to_dev(hdlc);
+			struct net_device *dev = d->dev;
+			hdlc_device *hdlc = dev_to_hdlc(dev);
 
 			spin_lock(&card->card_lock);
 
@@ -2049,7 +2048,7 @@
 							if ((cpc_readb(scabase + DSR_RX(ch)) & DSR_DE)) {
 								rx_dma_stop(card, ch);
 							}
-							cpc_net_rx(hdlc);
+							cpc_net_rx(dev);
 							/* Discard invalid frames */
 							hdlc->stats.rx_errors++;
 							hdlc->stats.rx_over_errors++;
@@ -2073,10 +2072,10 @@
 							/* verify if driver is TTY */
 							cpc_tty_receive(d);
 						} else {
-							cpc_net_rx(hdlc);
+							cpc_net_rx(dev);
 						}
 #else
-						cpc_net_rx(hdlc);
+						cpc_net_rx(dev);
 #endif
 						if (card->hw.type == PC300_TE) {
 							cpc_writeb(card->hw.falcbase +
@@ -2829,12 +2828,7 @@
 
 static struct net_device_stats *cpc_get_stats(struct net_device *dev)
 {
-	pc300dev_t *d = (pc300dev_t *) dev->priv;
-
-	if (d)
-		return &d->hdlc->stats;
-	else
-		return NULL;
+	return hdlc_stats(dev);
 }
 
 static int clock_rate_calc(uclong rate, uclong clock, int *br_io)
@@ -3075,10 +3069,9 @@
 	return 0;
 }
 
-static int cpc_attach(hdlc_device * hdlc, unsigned short encoding,
+static int cpc_attach(struct net_device *dev, unsigned short encoding,
 		      unsigned short parity)
 {
-	struct net_device * dev = hdlc_to_dev(hdlc);
 	pc300dev_t *d = (pc300dev_t *)dev->priv;
 	pc300ch_t *chan = (pc300ch_t *)d->chan;
 	pc300_t *card = (pc300_t *)chan->card;
@@ -3168,7 +3161,7 @@
 		d->if_ptr = &hdlc->state.ppp.pppdev;
 	}
 
-	result = hdlc_open(hdlc);
+	result = hdlc_open(dev);
 	if (hdlc->proto.id == IF_PROTO_PPP) {
 		dev->priv = d;
 	}
@@ -3200,7 +3193,7 @@
 	cpc_closech(d);
 	CPC_UNLOCK(card, flags);
 
-	hdlc_close(hdlc);
+	hdlc_close(dev);
 	if (hdlc->proto.id == IF_PROTO_PPP) {
 		d->if_ptr = NULL;
 	}
@@ -3369,17 +3362,14 @@
 		d->line_on = 0;
 		d->line_off = 0;
 
-		d->hdlc = (hdlc_device *) kmalloc(sizeof(hdlc_device), GFP_KERNEL);
-		if (d->hdlc == NULL)
+		dev = alloc_hdlcdev(NULL);
+		if (dev == NULL)
 			continue;
-		memset(d->hdlc, 0, sizeof(hdlc_device));
 
-		hdlc = d->hdlc;
+		hdlc = dev_to_hdlc(dev);
 		hdlc->xmit = cpc_queue_xmit;
 		hdlc->attach = cpc_attach;
-
-		dev = hdlc_to_dev(hdlc);
-
+		d->dev = dev;
 		dev->mem_start = card->hw.ramphys;
 		dev->mem_end = card->hw.ramphys + card->hw.ramsize - 1;
 		dev->irq = card->hw.irq;
@@ -3397,7 +3387,7 @@
 		dev->change_mtu = cpc_change_mtu;
 		dev->do_ioctl = cpc_ioctl;
 
-		if (register_hdlc_device(hdlc) == 0) {
+		if (register_hdlc_device(dev) == 0) {
 			dev->priv = d;	/* We need 'priv', hdlc doesn't */
 			printk("%s: Cyclades-PC300/", dev->name);
 			switch (card->hw.type) {
@@ -3425,8 +3415,7 @@
 		} else {
 			printk ("Dev%d on card(0x%08lx): unable to allocate i/f name.\n",
 				 i + 1, card->hw.ramphys);
-			*(dev->name) = 0;
-			kfree(d->hdlc);
+			free_netdev(dev);
 			continue;
 		}
 	}
@@ -3658,7 +3647,7 @@
 			   cpc_readw(card->hw.plxbase + card->hw.intctl_reg) & ~(0x0040));
 
 		for (i = 0; i < card->hw.nchan; i++) {
-			unregister_hdlc_device(card->chan[i].d.hdlc);
+			unregister_hdlc_device(card->chan[i].d.dev);
 		}
 		iounmap((void *) card->hw.plxbase);
 		iounmap((void *) card->hw.scabase);
@@ -3671,6 +3660,9 @@
 			iounmap((void *) card->hw.falcbase);
 			release_mem_region(card->hw.falcphys, card->hw.falcsize);
 		}
+		for (i = 0; i < card->hw.nchan; i++)
+			if (card->chan[i].d.dev);
+				free_netdev(card->chan[i].d.dev);
 		if (card->hw.irq)
 			free_irq(card->hw.irq, card);
 		kfree(card);
--- diff/drivers/net/wan/pc300_tty.c	2003-09-30 15:46:16.000000000 +0100
+++ source/drivers/net/wan/pc300_tty.c	2004-02-09 10:39:54.000000000 +0000
@@ -152,8 +152,7 @@
 	int ch = pc300chan->channel; 
 	unsigned long flags; 
 
-	CPC_TTY_DBG("%s-tty: Clear signal DTR\n",
-		((struct net_device*)(pc300dev->hdlc))->name);
+	CPC_TTY_DBG("%s-tty: Clear signal DTR\n", pc300dev->dev->name);
 	CPC_TTY_LOCK(card, flags); 
 	cpc_writeb(card->hw.scabase + M_REG(CTL,ch), 
 		cpc_readb(card->hw.scabase+M_REG(CTL,ch))& CTL_DTR); 
@@ -170,8 +169,7 @@
 	int ch = pc300chan->channel; 
 	unsigned long flags; 
 
-	CPC_TTY_DBG("%s-tty: Set signal DTR\n",
-		((struct net_device*)(pc300dev->hdlc))->name);
+	CPC_TTY_DBG("%s-tty: Set signal DTR\n", pc300dev->dev->name);
 	CPC_TTY_LOCK(card, flags); 
 	cpc_writeb(card->hw.scabase + M_REG(CTL,ch), 
 		cpc_readb(card->hw.scabase+M_REG(CTL,ch))& ~CTL_DTR); 
@@ -194,17 +192,17 @@
 	st_cpc_tty_area * cpc_tty;
 
 	/* hdlcX - X=interface number */
-	port = ((struct net_device*)(pc300dev->hdlc))->name[4] - '0';
+	port = pc300dev->dev->name[4] - '0';
 	if (port >= CPC_TTY_NPORTS) {
 		printk("%s-tty: invalid interface selected (0-%i): %i", 
-			((struct net_device*)(pc300dev->hdlc))->name,
+			pc300dev->dev->name,
 			CPC_TTY_NPORTS-1,port);
 		return;
 	}
 
 	if (cpc_tty_cnt == 0) { /* first TTY connection -> register driver */
 		CPC_TTY_DBG("%s-tty: driver init, major:%i, minor range:%i=%i\n",
-			((struct net_device*)(pc300dev->hdlc))->name,
+			pc300dev->dev->name,
 			CPC_TTY_MAJOR, CPC_TTY_MINOR_START,
 			CPC_TTY_MINOR_START+CPC_TTY_NPORTS);
 		/* initialize tty driver struct */
@@ -236,7 +234,7 @@
 		/* register the TTY driver */
 		if (tty_register_driver(&serial_drv)) { 
 			printk("%s-tty: Failed to register serial driver! ",
-				((struct net_device*)(pc300dev->hdlc))->name);
+				pc300dev->dev->name);
 		   	return;
 		} 
 
@@ -248,7 +246,7 @@
 	
 	if (cpc_tty->state != CPC_TTY_ST_IDLE) {
 		CPC_TTY_DBG("%s-tty: TTY port %i, already in use.\n",
-					((struct net_device*)(pc300dev->hdlc))->name,port);
+				pc300dev->dev->name, port);
 		return;
 	}
 
@@ -265,11 +263,11 @@
 
 	pc300dev->cpc_tty = (void *)cpc_tty; 
 	
-	aux = strlen(((struct net_device*)(pc300dev->hdlc))->name);
-	memcpy(cpc_tty->name,((struct net_device*)(pc300dev->hdlc))->name,aux);
+	aux = strlen(pc300dev->dev->name);
+	memcpy(cpc_tty->name, pc300dev->dev->name, aux);
 	memcpy(&cpc_tty->name[aux], "-tty", 5);
 	
-	cpc_open((struct net_device *)pc300dev->hdlc);
+	cpc_open(pc300dev->dev);
 	cpc_tty_dtr_off(pc300dev);
 
 	CPC_TTY_DBG("%s: Initializing TTY Sync Driver, tty major#%d minor#%i\n",
@@ -454,7 +452,7 @@
 		(from_user)?"from user" : "from kernel",count);
 	
 	pc300chan = (pc300ch_t *)((pc300dev_t*)cpc_tty->pc300dev)->chan; 
-	stats = &((pc300dev_t*)cpc_tty->pc300dev)->hdlc->stats;
+	stats = hdlc_stats(((pc300dev_t*)cpc_tty->pc300dev)->dev);
 	card = (pc300_t *) pc300chan->card;
 	ch = pc300chan->channel; 
 
@@ -583,6 +581,14 @@
 	CPC_TTY_DBG("%s: IOCTL cmd %x\n",cpc_tty->name,cmd);
 	
 	switch (cmd) { 
+#warning This is broken.  See comments.
+/*
+ * TIOCMBIS/TIOCMBIC do not control only the DTR signal, but also
+ * the RTS, OUT1 and OUT2 signals, or even maybe nothing at all.
+ * Plus, these IOCTLs are no longer passed down to the driver.
+ * Instead, drivers should implement tiocmget and tiocmset driver
+ * methods.
+ */
 		case TIOCMBIS :    /* set DTR */
 			cpc_tty_dtr_on(cpc_tty->pc300dev);
 			break; 
@@ -740,7 +746,7 @@
 	pc300_t *card = (pc300_t *)pc300chan->card; 
 	int ch = pc300chan->channel; 
 	volatile pcsca_bd_t * ptdescr; 
-	struct net_device_stats *stats = &pc300dev->hdlc->stats; 
+	struct net_device_stats *stats = hdlc_stats(pc300dev->dev);
 	int rx_len, rx_aux; 
 	volatile unsigned char status; 
 	unsigned short first_bd = pc300chan->rx_first_bd;
@@ -916,7 +922,7 @@
 	pc300ch_t *chan = (pc300ch_t *)dev->chan; 
 	pc300_t *card = (pc300_t *)chan->card; 
 	int ch = chan->channel; 
-	struct net_device_stats *stats = &dev->hdlc->stats; 
+	struct net_device_stats *stats = hdlc_stats(dev->dev);
 	unsigned long flags; 
 	volatile pcsca_bd_t * ptdescr; 
 	int i, nchar;
@@ -1000,19 +1006,18 @@
 
 	if ((skb = dev_alloc_skb(10 + len)) == NULL) { 
 		/* out of memory */ 
-		CPC_TTY_DBG("%s: tty_trace - out of memory\n",
-			((struct net_device *)(dev->hdlc))->name);
+		CPC_TTY_DBG("%s: tty_trace - out of memory\n", dev->dev->name);
 		return; 
 	}
 
 	skb_put (skb, 10 + len); 
-	skb->dev = (struct net_device *) dev->hdlc; 
+	skb->dev = dev->dev; 
 	skb->protocol = htons(ETH_P_CUST); 
 	skb->mac.raw = skb->data; 
 	skb->pkt_type = PACKET_HOST; 
 	skb->len = 10 + len; 
 
-	memcpy(skb->data,((struct net_device *)(dev->hdlc))->name,5);
+	memcpy(skb->data,dev->dev->name,5);
 	skb->data[5] = '['; 
 	skb->data[6] = rxtx; 
 	skb->data[7] = ']'; 
@@ -1034,15 +1039,14 @@
 	int res;
 
 	if ((cpc_tty= (st_cpc_tty_area *) pc300dev->cpc_tty) == 0) { 
-		CPC_TTY_DBG("%s: interface is not TTY\n",
-			((struct net_device *)(pc300dev->hdlc))->name);
+		CPC_TTY_DBG("%s: interface is not TTY\n", pc300dev->dev->name);
 		return; 
 	}
 	CPC_TTY_DBG("%s: cpc_tty_unregister_service", cpc_tty->name);
 
 	if (cpc_tty->pc300dev != pc300dev) { 
 		CPC_TTY_DBG("%s: invalid tty ptr=%s\n", 
-		((struct net_device *)(pc300dev->hdlc))->name, cpc_tty->name);
+		pc300dev->dev->name, cpc_tty->name);
 		return; 
 	}
 
--- diff/drivers/net/wan/pci200syn.c	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/net/wan/pci200syn.c	2004-02-09 10:39:54.000000000 +0000
@@ -73,7 +73,7 @@
 
 
 typedef struct port_s {
-	hdlc_device hdlc;	/* HDLC device struct - must be first */
+	struct net_device *dev;
 	struct card_s *card;
 	spinlock_t lock;	/* TX lock */
 	sync_serial_settings settings;
@@ -177,14 +177,13 @@
 
 static int pci200_open(struct net_device *dev)
 {
-	hdlc_device *hdlc = dev_to_hdlc(dev);
-	port_t *port = hdlc_to_port(hdlc);
+	port_t *port = dev_to_port(dev);
 
-	int result = hdlc_open(hdlc);
+	int result = hdlc_open(dev);
 	if (result)
 		return result;
 
-	sca_open(hdlc);
+	sca_open(dev);
 	pci200_set_iface(port);
 	sca_flush(port_to_card(port));
 	return 0;
@@ -194,10 +193,9 @@
 
 static int pci200_close(struct net_device *dev)
 {
-	hdlc_device *hdlc = dev_to_hdlc(dev);
-	sca_close(hdlc);
+	sca_close(dev);
 	sca_flush(port_to_card(dev_to_port(dev)));
-	hdlc_close(hdlc);
+	hdlc_close(dev);
 	return 0;
 }
 
@@ -207,12 +205,11 @@
 {
 	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);
+	port_t *port = dev_to_port(dev);
 
 #ifdef DEBUG_RINGS
 	if (cmd == SIOCDEVPRIVATE) {
-		sca_dump_rings(hdlc);
+		sca_dump_rings(dev);
 		return 0;
 	}
 #endif
@@ -265,8 +262,10 @@
 	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->ports[i].card) {
+			struct net_device *dev = port_to_dev(&card->ports[i]);
+			unregister_hdlc_device(dev);
+		}
 
 	if (card->irq)
 		free_irq(card->irq, card);
@@ -281,6 +280,10 @@
 	pci_release_regions(pdev);
 	pci_disable_device(pdev);
 	pci_set_drvdata(pdev, NULL);
+	if (card->ports[0].dev)
+		free_netdev(card->ports[0].dev);
+	if (card->ports[1].dev)
+		free_netdev(card->ports[1].dev);
 	kfree(card);
 }
 
@@ -323,6 +326,13 @@
 	}
 	memset(card, 0, sizeof(card_t));
 	pci_set_drvdata(pdev, card);
+	card->ports[0].dev = alloc_hdlcdev(&card->ports[0]);
+	card->ports[1].dev = alloc_hdlcdev(&card->ports[1]);
+	if (!card->ports[0].dev || !card->ports[1].dev) {
+		printk(KERN_ERR "pci200syn: unable to allocate memory\n");
+		pci200_pci_remove_one(pdev);
+		return -ENOMEM;
+	}
 
 	pci_read_config_byte(pdev, PCI_REVISION_ID, &rev_id);
 	if (pci_resource_len(pdev, 0) != PCI200SYN_PLX_SIZE ||
@@ -397,7 +407,8 @@
 
 	for(i = 0; i < 2; i++) {
 		port_t *port = &card->ports[i];
-		struct net_device *dev = hdlc_to_dev(&port->hdlc);
+		struct net_device *dev = port_to_dev(port);
+		hdlc_device *hdlc = dev_to_hdlc(dev);
 		port->phy_node = i;
 
 		spin_lock_init(&port->lock);
@@ -409,20 +420,21 @@
 		dev->do_ioctl = pci200_ioctl;
 		dev->open = pci200_open;
 		dev->stop = pci200_close;
-		port->hdlc.attach = sca_attach;
-		port->hdlc.xmit = sca_xmit;
+		hdlc->attach = sca_attach;
+		hdlc->xmit = sca_xmit;
 		port->settings.clock_type = CLOCK_EXT;
-		if(register_hdlc_device(&port->hdlc)) {
+		port->card = card;
+		if(register_hdlc_device(dev)) {
 			printk(KERN_ERR "pci200syn: unable to register hdlc "
 			       "device\n");
+			port->card = NULL;
 			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);
+		       dev->name, port->phy_node);
 	}
 
 	sca_flush(card);
--- diff/drivers/net/wan/sbni.c	2003-10-09 09:47:34.000000000 +0100
+++ source/drivers/net/wan/sbni.c	2004-02-09 10:39:54.000000000 +0000
@@ -210,7 +210,6 @@
 static void __init sbni_devsetup(struct net_device *dev)
 {
 	ether_setup( dev );
-	dev->init 		= &sbni_init;
 	dev->open		= &sbni_open;
 	dev->stop		= &sbni_close;
 	dev->hard_start_xmit	= &sbni_start_xmit;
@@ -234,8 +233,15 @@
 	sprintf(dev->name, "sbni%d", unit);
 	netdev_boot_setup_check(dev);
 
+	err = sbni_init(dev);
+	if (err) {
+		free_netdev(dev);
+		return err;
+	}
+
 	err = register_netdev(dev);
 	if (err) {
+		release_region( dev->base_addr, SBNI_IO_EXTENT );
 		free_netdev(dev);
 		return err;
 	}
@@ -304,8 +310,13 @@
 		/* Avoid already found cards from previous calls */
 		if( !request_region( pci_ioaddr, SBNI_IO_EXTENT, dev->name ) ) {
 			pci_read_config_word( pdev, PCI_SUBSYSTEM_ID, &subsys );
-			if( subsys != 2  ||	/* Dual adapter is present */
-			    check_region( pci_ioaddr += 4, SBNI_IO_EXTENT ) )
+
+			if (subsys != 2)
+				continue;
+
+			/* Dual adapter is present */
+			if (!request_region(pci_ioaddr += 4, SBNI_IO_EXTENT,
+							dev->name ) )
 				continue;
 		}
 
@@ -318,8 +329,10 @@
 				pci_irq_line );
 
 		/* avoiding re-enable dual adapters */
-		if( (pci_ioaddr & 7) == 0  &&  pci_enable_device( pdev ) )
+		if( (pci_ioaddr & 7) == 0  &&  pci_enable_device( pdev ) ) {
+			release_region( pci_ioaddr, SBNI_IO_EXTENT );
 			return  -EIO;
+		}
 		if( sbni_probe1( dev, pci_ioaddr, pci_irq_line ) )
 			return  0;
 	}
@@ -1482,19 +1495,25 @@
 init_module( void )
 {
 	struct net_device  *dev;
+	int err;
 
 	while( num < SBNI_MAX_NUM_CARDS ) {
 		dev = alloc_netdev(sizeof(struct net_local), 
 				   "sbni%d", sbni_devsetup);
-		if( !dev) {
-			printk( KERN_ERR "sbni: unable to allocate device!\n" );
-			return  -ENOMEM;
-		}
+		if( !dev)
+			break;
 
 		sprintf( dev->name, "sbni%d", num );
 
+		err = sbni_init(dev);
+		if (err) {
+			free_netdev(dev);
+			break;
+		}
+
 		if( register_netdev( dev ) ) {
-			kfree( dev );
+			release_region( dev->base_addr, SBNI_IO_EXTENT );
+			free_netdev( dev );
 			break;
 		}
 	}
--- diff/drivers/net/wan/sdla.c	2003-09-30 15:46:16.000000000 +0100
+++ source/drivers/net/wan/sdla.c	2004-02-09 10:39:54.000000000 +0000
@@ -1339,6 +1339,8 @@
 	struct frad_local *flp;
 	int               i;
 	char              byte;
+	unsigned base;
+	int err = -EINVAL;
 
 	flp = dev->priv;
 
@@ -1352,108 +1354,90 @@
 	if (i == sizeof(valid_port) / sizeof(int))
 		return(-EINVAL);
 
-	dev->base_addr = map->base_addr;
-	if (!request_region(dev->base_addr, SDLA_IO_EXTENTS, dev->name)){
+	if (!request_region(map->base_addr, SDLA_IO_EXTENTS, dev->name)){
 		printk(KERN_WARNING "SDLA: io-port 0x%04lx in use \n", dev->base_addr);
 		return(-EINVAL);
 	}
+	base = map->base_addr;
+
 	/* test for card types, S502A, S502E, S507, S508                 */
 	/* these tests shut down the card completely, so clear the state */
 	flp->type = SDLA_UNKNOWN;
 	flp->state = 0;
    
 	for(i=1;i<SDLA_IO_EXTENTS;i++)
-		if (inb(dev->base_addr + i) != 0xFF)
+		if (inb(base + i) != 0xFF)
 			break;
 
-	if (i == SDLA_IO_EXTENTS)
-	{   
-		outb(SDLA_HALT, dev->base_addr + SDLA_REG_Z80_CONTROL);
-		if ((inb(dev->base_addr + SDLA_S502_STS) & 0x0F) == 0x08)
-		{
-			outb(SDLA_S502E_INTACK, dev->base_addr + SDLA_REG_CONTROL);
-			if ((inb(dev->base_addr + SDLA_S502_STS) & 0x0F) == 0x0C)
-			{
-				outb(SDLA_HALT, dev->base_addr + SDLA_REG_CONTROL);
+	if (i == SDLA_IO_EXTENTS) {   
+		outb(SDLA_HALT, base + SDLA_REG_Z80_CONTROL);
+		if ((inb(base + SDLA_S502_STS) & 0x0F) == 0x08) {
+			outb(SDLA_S502E_INTACK, base + SDLA_REG_CONTROL);
+			if ((inb(base + SDLA_S502_STS) & 0x0F) == 0x0C) {
+				outb(SDLA_HALT, base + SDLA_REG_CONTROL);
 				flp->type = SDLA_S502E;
+				goto got_type;
 			}
 		}
 	}
 
-	if (flp->type == SDLA_UNKNOWN)
-	{
-		for(byte=inb(dev->base_addr),i=0;i<SDLA_IO_EXTENTS;i++)
-			if (inb(dev->base_addr + i) != byte)
-				break;
+	for(byte=inb(base),i=0;i<SDLA_IO_EXTENTS;i++)
+		if (inb(base + i) != byte)
+			break;
 
-		if (i == SDLA_IO_EXTENTS)
-		{
-			outb(SDLA_HALT, dev->base_addr + SDLA_REG_CONTROL);
-			if ((inb(dev->base_addr + SDLA_S502_STS) & 0x7E) == 0x30)
-			{
-				outb(SDLA_S507_ENABLE, dev->base_addr + SDLA_REG_CONTROL);
-				if ((inb(dev->base_addr + SDLA_S502_STS) & 0x7E) == 0x32)
-				{
-					outb(SDLA_HALT, dev->base_addr + SDLA_REG_CONTROL);
-					flp->type = SDLA_S507;
-				}
+	if (i == SDLA_IO_EXTENTS) {
+		outb(SDLA_HALT, base + SDLA_REG_CONTROL);
+		if ((inb(base + SDLA_S502_STS) & 0x7E) == 0x30) {
+			outb(SDLA_S507_ENABLE, base + SDLA_REG_CONTROL);
+			if ((inb(base + SDLA_S502_STS) & 0x7E) == 0x32) {
+				outb(SDLA_HALT, base + SDLA_REG_CONTROL);
+				flp->type = SDLA_S507;
+				goto got_type;
 			}
 		}
 	}
 
-	if (flp->type == SDLA_UNKNOWN)
-	{
-		outb(SDLA_HALT, dev->base_addr + SDLA_REG_CONTROL);
-		if ((inb(dev->base_addr + SDLA_S508_STS) & 0x3F) == 0x00)
-		{
-			outb(SDLA_S508_INTEN, dev->base_addr + SDLA_REG_CONTROL);
-			if ((inb(dev->base_addr + SDLA_S508_STS) & 0x3F) == 0x10)
-			{
-				outb(SDLA_HALT, dev->base_addr + SDLA_REG_CONTROL);
-				flp->type = SDLA_S508;
-			}
+	outb(SDLA_HALT, base + SDLA_REG_CONTROL);
+	if ((inb(base + SDLA_S508_STS) & 0x3F) == 0x00) {
+		outb(SDLA_S508_INTEN, base + SDLA_REG_CONTROL);
+		if ((inb(base + SDLA_S508_STS) & 0x3F) == 0x10) {
+			outb(SDLA_HALT, base + SDLA_REG_CONTROL);
+			flp->type = SDLA_S508;
+			goto got_type;
 		}
 	}
 
-	if (flp->type == SDLA_UNKNOWN)
-	{
-		outb(SDLA_S502A_HALT, dev->base_addr + SDLA_REG_CONTROL);
-		if (inb(dev->base_addr + SDLA_S502_STS) == 0x40)
-		{
-			outb(SDLA_S502A_START, dev->base_addr + SDLA_REG_CONTROL);
-			if (inb(dev->base_addr + SDLA_S502_STS) == 0x40)
-			{
-				outb(SDLA_S502A_INTEN, dev->base_addr + SDLA_REG_CONTROL);
-				if (inb(dev->base_addr + SDLA_S502_STS) == 0x44)
-				{
-					outb(SDLA_S502A_START, dev->base_addr + SDLA_REG_CONTROL);
-					flp->type = SDLA_S502A;
-				}
+	outb(SDLA_S502A_HALT, base + SDLA_REG_CONTROL);
+	if (inb(base + SDLA_S502_STS) == 0x40) {
+		outb(SDLA_S502A_START, base + SDLA_REG_CONTROL);
+		if (inb(base + SDLA_S502_STS) == 0x40) {
+			outb(SDLA_S502A_INTEN, base + SDLA_REG_CONTROL);
+			if (inb(base + SDLA_S502_STS) == 0x44) {
+				outb(SDLA_S502A_START, base + SDLA_REG_CONTROL);
+				flp->type = SDLA_S502A;
+				goto got_type;
 			}
 		}
 	}
 
-	if (flp->type == SDLA_UNKNOWN)
-	{
-		printk(KERN_NOTICE "%s: Unknown card type\n", dev->name);
-		return(-ENODEV);
-	}
+	printk(KERN_NOTICE "%s: Unknown card type\n", dev->name);
+	err = -ENODEV;
+	goto fail;
 
-	switch(dev->base_addr)
-	{
+got_type:
+	switch(base) {
 		case 0x270:
 		case 0x280:
 		case 0x380: 
 		case 0x390:
-			if ((flp->type != SDLA_S508) && (flp->type != SDLA_S507))
-				return(-EINVAL);
+			if (flp->type != SDLA_S508 && flp->type != SDLA_S507)
+				goto fail;
 	}
 
-	switch (map->irq)
-	{
+	switch (map->irq) {
 		case 2:
 			if (flp->type != SDLA_S502E)
-				return(-EINVAL);
+				goto fail;
 			break;
 
 		case 10:
@@ -1461,28 +1445,26 @@
 		case 12:
 		case 15:
 		case 4:
-			if ((flp->type != SDLA_S508) && (flp->type != SDLA_S507))
-				return(-EINVAL);
-
+			if (flp->type != SDLA_S508 && flp->type != SDLA_S507)
+				goto fail;
+			break;
 		case 3:
 		case 5:
 		case 7:
 			if (flp->type == SDLA_S502A)
-				return(-EINVAL);
+				goto fail;
 			break;
 
 		default:
-			return(-EINVAL);
+			goto fail;
 	}
-	dev->irq = map->irq;
 
+	err = -EAGAIN;
 	if (request_irq(dev->irq, &sdla_isr, 0, dev->name, dev)) 
-		return(-EAGAIN);
+		goto fail;
 
-	if (flp->type == SDLA_S507)
-	{
-		switch(dev->irq)
-		{
+	if (flp->type == SDLA_S507) {
+		switch(dev->irq) {
 			case 3:
 				flp->state = SDLA_S507_IRQ3;
 				break;
@@ -1514,35 +1496,25 @@
 		if (valid_mem[i] == map->mem_start)
 			break;   
 
+	err = -EINVAL;
 	if (i == sizeof(valid_mem) / sizeof(int))
-	/*
-	 *	FIXME:
-	 *	BUG BUG BUG: MUST RELEASE THE IRQ WE ALLOCATED IN
-	 *	ALL THESE CASES
-	 *
-	 */
-		return(-EINVAL);
+		goto fail2;
 
-	if ((flp->type == SDLA_S502A) && (((map->mem_start & 0xF000) >> 12) == 0x0E))
-		return(-EINVAL);
-
-	if ((flp->type != SDLA_S507) && ((map->mem_start >> 16) == 0x0B))
-		return(-EINVAL);
+	if (flp->type == SDLA_S502A && (map->mem_start & 0xF000) >> 12 == 0x0E)
+		goto fail2;
 
-	if ((flp->type == SDLA_S507) && ((map->mem_start >> 16) == 0x0D))
-		return(-EINVAL);
+	if (flp->type != SDLA_S507 && map->mem_start >> 16 == 0x0B)
+		goto fail2;
 
-	dev->mem_start = map->mem_start;
-	dev->mem_end = dev->mem_start + 0x2000;
+	if (flp->type == SDLA_S507 && map->mem_start >> 16 == 0x0D)
+		goto fail2;
 
 	byte = flp->type != SDLA_S508 ? SDLA_8K_WINDOW : 0;
 	byte |= (map->mem_start & 0xF000) >> (12 + (flp->type == SDLA_S508 ? 1 : 0));
-	switch(flp->type)
-	{
+	switch(flp->type) {
 		case SDLA_S502A:
 		case SDLA_S502E:
-			switch (map->mem_start >> 16)
-			{
+			switch (map->mem_start >> 16) {
 				case 0x0A:
 					byte |= SDLA_S502_SEG_A;
 					break;
@@ -1558,8 +1530,7 @@
 			}
 			break;
 		case SDLA_S507:
-			switch (map->mem_start >> 16)
-			{
+			switch (map->mem_start >> 16) {
 				case 0x0A:
 					byte |= SDLA_S507_SEG_A;
 					break;
@@ -1575,8 +1546,7 @@
 			}
 			break;
 		case SDLA_S508:
-			switch (map->mem_start >> 16)
-			{
+			switch (map->mem_start >> 16) {
 				case 0x0A:
 					byte |= SDLA_S508_SEG_A;
 					break;
@@ -1594,7 +1564,7 @@
 	}
 
 	/* set the memory bits, and enable access */
-	outb(byte, dev->base_addr + SDLA_REG_PC_WINDOW);
+	outb(byte, base + SDLA_REG_PC_WINDOW);
 
 	switch(flp->type)
 	{
@@ -1608,10 +1578,20 @@
 			flp->state = SDLA_MEMEN;
 			break;
 	}
-	outb(flp->state, dev->base_addr + SDLA_REG_CONTROL);
+	outb(flp->state, base + SDLA_REG_CONTROL);
 
+	dev->irq = map->irq;
+	dev->base_addr = base;
+	dev->mem_start = map->mem_start;
+	dev->mem_end = dev->mem_start + 0x2000;
 	flp->initialized = 1;
-	return(0);
+	return 0;
+
+fail2:
+	free_irq(map->irq, dev);
+fail:
+	release_region(base, SDLA_IO_EXTENTS);
+	return err;
 }
  
 static struct net_device_stats *sdla_stats(struct net_device *dev)
@@ -1676,13 +1656,13 @@
 
 static void __exit exit_sdla(void)
 {
-	struct frad_local *flp;
+	struct frad_local *flp = sdla->priv;
 
 	unregister_netdev(sdla);
-	if (sdla->irq)
+	if (flp->initialized) {
 		free_irq(sdla->irq, sdla);
-
-	flp = sdla->priv;
+		release_region(sdla->base_addr, SDLA_IO_EXTENTS);
+	}
 	del_timer_sync(&flp->timer);
 	free_netdev(sdla);
 }
--- diff/drivers/net/wan/sealevel.c	2003-10-27 09:20:38.000000000 +0000
+++ source/drivers/net/wan/sealevel.c	2004-02-09 10:39:54.000000000 +0000
@@ -420,6 +420,7 @@
 	/* DMA off on the card, drop DTR */
 	outb(0, b->iobase);
 	release_region(b->iobase, 8);
+	kfree(b);
 }
 
 
--- diff/drivers/net/wan/wanxl.c	2003-09-30 15:46:16.000000000 +0100
+++ source/drivers/net/wan/wanxl.c	2004-02-09 10:39:54.000000000 +0000
@@ -51,7 +51,7 @@
 
 
 typedef struct {
-	hdlc_device hdlc;	/* HDLC device struct - must be first */
+	struct net_device *dev;
 	struct card_t *card;
 	spinlock_t lock;	/* for wanxl_xmit */
         int node;		/* physical port #0 - 3 */
@@ -78,31 +78,26 @@
 	struct sk_buff *rx_skbs[RX_QUEUE_LENGTH];
 	card_status_t *status;	/* shared between host and card */
 	dma_addr_t status_address;
+	port_t __ports[0];
 }card_t;
 
 
 
-static inline port_t* hdlc_to_port(hdlc_device *hdlc)
-{
-        return (port_t*)hdlc;
-}
-
-
 static inline port_t* dev_to_port(struct net_device *dev)
 {
-        return hdlc_to_port(dev_to_hdlc(dev));
+        return (port_t *)dev_to_hdlc(dev)->priv;
 }
 
 
 static inline struct net_device *port_to_dev(port_t* port)
 {
-        return hdlc_to_dev(&port->hdlc);
+        return port->dev;
 }
 
 
 static inline const char* port_name(port_t *port)
 {
-	return hdlc_to_name((hdlc_device*)port);
+	return port_to_dev(port)->name;
 }
 
 
@@ -172,7 +167,7 @@
 	printk(KERN_INFO "%s: %s%s module, %s cable%s%s\n",
 	       port_name(port), pm, dte, cable, dsr, dcd);
 
-	hdlc_set_carrier(value & STATUS_CABLE_DCD, &port->hdlc);
+	hdlc_set_carrier(value & STATUS_CABLE_DCD, port_to_dev(port));
 }
 
 
@@ -180,6 +175,8 @@
 /* Transmit complete interrupt service */
 static inline void wanxl_tx_intr(port_t *port)
 {
+	struct net_device *dev = port_to_dev(port);
+	struct net_device_stats *stats = hdlc_stats(dev);
 	while (1) {
                 desc_t *desc = &get_status(port)->tx_descs[port->tx_in];
 		struct sk_buff *skb = port->tx_skbs[port->tx_in];
@@ -187,17 +184,17 @@
 		switch (desc->stat) {
 		case PACKET_FULL:
 		case PACKET_EMPTY:
-			netif_wake_queue(port_to_dev(port));
+			netif_wake_queue(dev);
 			return;
 
 		case PACKET_UNDERRUN:
-			port->hdlc.stats.tx_errors++;
-			port->hdlc.stats.tx_fifo_errors++;
+			stats->tx_errors++;
+			stats->tx_fifo_errors++;
 			break;
 
 		default:
-			port->hdlc.stats.tx_packets++;
-			port->hdlc.stats.tx_bytes += skb->len;
+			stats->tx_packets++;
+			stats->tx_bytes += skb->len;
 		}
                 desc->stat = PACKET_EMPTY; /* Free descriptor */
 		pci_unmap_single(port->card->pdev, desc->address, skb->len,
@@ -218,13 +215,14 @@
 		struct sk_buff *skb = card->rx_skbs[card->rx_in];
 		port_t *port = card->ports[desc->stat & PACKET_PORT_MASK];
 		struct net_device *dev = port_to_dev(port);
+		struct net_device_stats *stats = hdlc_stats(dev);
 
 		if ((desc->stat & PACKET_PORT_MASK) > card->n_ports)
 			printk(KERN_CRIT "wanXL %s: received packet for"
 			       " nonexistent port\n", card_name(card->pdev));
 
 		else if (!skb)
-			port->hdlc.stats.rx_dropped++;
+			stats->rx_dropped++;
 
 		else {
 			pci_unmap_single(card->pdev, desc->address,
@@ -236,8 +234,8 @@
 			       skb->len);
 			debug_frame(skb);
 #endif
-			port->hdlc.stats.rx_packets++;
-			port->hdlc.stats.rx_bytes += skb->len;
+			stats->rx_packets++;
+			stats->rx_bytes += skb->len;
 			skb->mac.raw = skb->data;
 			skb->dev = dev;
 			dev->last_rx = jiffies;
@@ -290,8 +288,7 @@
 
 static int wanxl_xmit(struct sk_buff *skb, struct net_device *dev)
 {
-	hdlc_device *hdlc = dev_to_hdlc(dev);
-        port_t *port = hdlc_to_port(hdlc);
+        port_t *port = dev_to_port(dev);
 	desc_t *desc;
 
         spin_lock(&port->lock);
@@ -338,10 +335,10 @@
 
 
 
-static int wanxl_attach(hdlc_device *hdlc, unsigned short encoding,
+static int wanxl_attach(struct net_device *dev, unsigned short encoding,
 			unsigned short parity)
 {
-	port_t *port = hdlc_to_port(hdlc);
+	port_t *port = dev_to_port(dev);
 
 	if (encoding != ENCODING_NRZ &&
 	    encoding != ENCODING_NRZI)
@@ -365,8 +362,7 @@
 {
 	const size_t size = sizeof(sync_serial_settings);
 	sync_serial_settings line;
-	hdlc_device *hdlc = dev_to_hdlc(dev);
-	port_t *port = hdlc_to_port(hdlc);
+	port_t *port = dev_to_port(dev);
 
 	if (cmd != SIOCWANDEV)
 		return hdlc_ioctl(dev, ifr, cmd);
@@ -415,8 +411,7 @@
 
 static int wanxl_open(struct net_device *dev)
 {
-	hdlc_device *hdlc = dev_to_hdlc(dev);
-	port_t *port = hdlc_to_port(hdlc);
+	port_t *port = dev_to_port(dev);
 	u8 *dbr = port->card->plx + PLX_DOORBELL_TO_CARD;
 	unsigned long timeout;
 	int i;
@@ -425,7 +420,7 @@
 		printk(KERN_ERR "%s: port already open\n", port_name(port));
 		return -EIO;
 	}
-	if ((i = hdlc_open(hdlc)) != 0)
+	if ((i = hdlc_open(dev)) != 0)
 		return i;
 
 	port->tx_in = port->tx_out = 0;
@@ -450,12 +445,11 @@
 
 static int wanxl_close(struct net_device *dev)
 {
-	hdlc_device *hdlc = dev_to_hdlc(dev);
-	port_t *port = hdlc_to_port(hdlc);
+	port_t *port = dev_to_port(dev);
 	unsigned long timeout;
 	int i;
 
-	hdlc_close(hdlc);
+	hdlc_close(dev);
 	/* signal the card */
 	writel(1 << (DOORBELL_TO_CARD_CLOSE_0 + port->node),
 	       port->card->plx + PLX_DOORBELL_TO_CARD);
@@ -487,14 +481,13 @@
 
 static struct net_device_stats *wanxl_get_stats(struct net_device *dev)
 {
-	hdlc_device *hdlc = dev_to_hdlc(dev);
-	port_t *port = hdlc_to_port(hdlc);
+	struct net_device_stats *stats = hdlc_stats(dev);
+	port_t *port = dev_to_port(dev);
 
-	hdlc->stats.rx_over_errors = get_status(port)->rx_overruns;
-	hdlc->stats.rx_frame_errors = get_status(port)->rx_frame_errors;
-	hdlc->stats.rx_errors = hdlc->stats.rx_over_errors +
-		hdlc->stats.rx_frame_errors;
-        return &hdlc->stats;
+	stats->rx_over_errors = get_status(port)->rx_overruns;
+	stats->rx_frame_errors = get_status(port)->rx_frame_errors;
+	stats->rx_errors = stats->rx_over_errors + stats->rx_frame_errors;
+        return stats;
 }
 
 
@@ -535,14 +528,16 @@
 	card_t *card = pci_get_drvdata(pdev);
 	int i;
 
+	for (i = 0; i < 4; i++)
+		if (card->ports[i]) {
+			struct net_device *dev = port_to_dev(card->ports[i]);
+			unregister_hdlc_device(dev);
+		}
+
 	/* unregister and free all host resources */
 	if (card->irq)
 		free_irq(card->irq, card);
 
-	for (i = 0; i < 4; i++)
-		if (card->ports[i])
-			unregister_hdlc_device(&card->ports[i]->hdlc);
-
 	wanxl_reset(card);
 
 	for (i = 0; i < RX_QUEUE_LENGTH; i++)
@@ -560,6 +555,10 @@
 		pci_free_consistent(pdev, sizeof(card_status_t),
 				    card->status, card->status_address);
 
+	for (i = 0; i < card->n_ports; i++)
+		if (card->__ports[i].dev)
+			free_netdev(card->__ports[i].dev);
+
 	pci_set_drvdata(pdev, NULL);
 	kfree(card);
 	pci_release_regions(pdev);
@@ -628,6 +627,16 @@
 	card->pdev = pdev;
 	card->n_ports = ports;
 
+	for (i = 0; i < ports; i++) {
+		card->__ports[i].dev = alloc_hdlcdev(&card->__ports[i]);
+		if (!card->__ports[i].dev) {
+			printk(KERN_ERR "wanXL %s: unable to allocate memory\n",
+			       card_name(pdev));
+			wanxl_pci_remove_one(pdev);
+			return -ENOMEM;
+		}
+	}
+
 	card->status = pci_alloc_consistent(pdev, sizeof(card_status_t),
 					    &card->status_address);
 	if (card->status == NULL) {
@@ -708,31 +717,6 @@
 		return -ENODEV;
 	}
 
-	for (i = 0; i < ports; i++) {
-		port_t *port = (void *)card + sizeof(card_t) +
-			i * sizeof(port_t);
-		struct net_device *dev = hdlc_to_dev(&port->hdlc);
-		spin_lock_init(&port->lock);
-		SET_MODULE_OWNER(dev);
-		dev->tx_queue_len = 50;
-		dev->do_ioctl = wanxl_ioctl;
-		dev->open = wanxl_open;
-		dev->stop = wanxl_close;
-		port->hdlc.attach = wanxl_attach;
-		port->hdlc.xmit = wanxl_xmit;
-		if(register_hdlc_device(&port->hdlc)) {
-			printk(KERN_ERR "wanXL %s: unable to register hdlc"
-			       " device\n", card_name(pdev));
-			wanxl_pci_remove_one(pdev);
-			return -ENOBUFS;
-		}
-		card->ports[i] = port;
-		dev->get_stats = wanxl_get_stats;
-		port->card = card;
-		port->node = i;
-		get_status(port)->clocking = CLOCK_EXT;
-	}
-
 	for (i = 0; i < RX_QUEUE_LENGTH; i++) {
 		struct sk_buff *skb = dev_alloc_skb(BUFFER_LENGTH);
 		card->rx_skbs[i] = skb;
@@ -801,6 +785,32 @@
 	}
 	card->irq = pdev->irq;
 
+	for (i = 0; i < ports; i++) {
+		port_t *port = &card->__ports[i];
+		struct net_device *dev = port_to_dev(port);
+		hdlc_device *hdlc = dev_to_hdlc(dev);
+		spin_lock_init(&port->lock);
+		SET_MODULE_OWNER(dev);
+		dev->tx_queue_len = 50;
+		dev->do_ioctl = wanxl_ioctl;
+		dev->open = wanxl_open;
+		dev->stop = wanxl_close;
+		hdlc->attach = wanxl_attach;
+		hdlc->xmit = wanxl_xmit;
+		card->ports[i] = port;
+		dev->get_stats = wanxl_get_stats;
+		port->card = card;
+		port->node = i;
+		get_status(port)->clocking = CLOCK_EXT;
+		if (register_hdlc_device(dev)) {
+			printk(KERN_ERR "wanXL %s: unable to register hdlc"
+			       " device\n", card_name(pdev));
+			card->ports[i] = NULL;
+			wanxl_pci_remove_one(pdev);
+			return -ENOBUFS;
+		}
+	}
+
 	return 0;
 }
 
--- diff/drivers/net/wan/x25_asy.c	2003-08-26 10:00:53.000000000 +0100
+++ source/drivers/net/wan/x25_asy.c	2004-02-09 10:39:54.000000000 +0000
@@ -94,7 +94,7 @@
 			return sl;
 		} else {
 			printk("x25_asy_alloc() - register_netdev() failure.\n");
-			kfree(dev);
+			free_netdev(dev);
 		}
 	}
 	return NULL;
@@ -213,7 +213,7 @@
 	memcpy(skb_put(skb,count), sl->rbuff, count);
 	skb->mac.raw=skb->data;
 	skb->protocol=htons(ETH_P_X25);
-	if((err=lapb_data_received(sl,skb))!=LAPB_OK)
+	if((err=lapb_data_received(skb->dev, skb))!=LAPB_OK)
 	{
 		kfree_skb(skb);
 		printk(KERN_DEBUG "x25_asy: data received err - %d\n",err);
@@ -324,12 +324,12 @@
 	{
 		case 0x00:break;
 		case 0x01: /* Connection request .. do nothing */
-			if((err=lapb_connect_request(sl))!=LAPB_OK)
+			if((err=lapb_connect_request(dev))!=LAPB_OK)
 				printk(KERN_ERR "x25_asy: lapb_connect_request error - %d\n", err);
 			kfree_skb(skb);
 			return 0;
 		case 0x02: /* Disconnect request .. do nothing - hang up ?? */
-			if((err=lapb_disconnect_request(sl))!=LAPB_OK)
+			if((err=lapb_disconnect_request(dev))!=LAPB_OK)
 				printk(KERN_ERR "x25_asy: lapb_disconnect_request error - %d\n", err);
 		default:
 			kfree_skb(skb);
@@ -347,7 +347,7 @@
 	 *        14 Oct 1994  Dmitry Gorodchanin.
 	 */
 	
-	if((err=lapb_data_request(sl,skb))!=LAPB_OK)
+	if((err=lapb_data_request(dev,skb))!=LAPB_OK)
 	{
 		printk(KERN_ERR "lapbeth: lapb_data_request error - %d\n", err);
 		kfree_skb(skb);
@@ -366,7 +366,7 @@
  *	at the net layer.
  */
   
-static int x25_asy_data_indication(void *token, struct sk_buff *skb)
+static int x25_asy_data_indication(struct net_device *dev, struct sk_buff *skb)
 {
 	skb->dev->last_rx = jiffies;
 	return netif_rx(skb);
@@ -378,9 +378,9 @@
  *	perhaps lapb should allow us to bounce this ?
  */
  
-static void x25_asy_data_transmit(void *token, struct sk_buff *skb)
+static void x25_asy_data_transmit(struct net_device *dev, struct sk_buff *skb)
 {
-	struct x25_asy *sl=token;
+	struct x25_asy *sl=dev->priv;
 	
 	spin_lock(&sl->lock);
 	if (netif_queue_stopped(sl->dev) || sl->tty == NULL)
@@ -405,9 +405,9 @@
  *	LAPB connection establish/down information.
  */
  
-static void x25_asy_connected(void *token, int reason)
+static void x25_asy_connected(struct net_device *dev, int reason)
 {
-	struct x25_asy *sl = token;
+	struct x25_asy *sl = dev->priv;
 	struct sk_buff *skb;
 	unsigned char *ptr;
 
@@ -428,9 +428,9 @@
 	sl->dev->last_rx = jiffies;
 }
 
-static void x25_asy_disconnected(void *token, int reason)
+static void x25_asy_disconnected(struct net_device *dev, int reason)
 {
-	struct x25_asy *sl = token;
+	struct x25_asy *sl = dev->priv;
 	struct sk_buff *skb;
 	unsigned char *ptr;
 
@@ -500,7 +500,7 @@
 	/*
 	 *	Now attach LAPB
 	 */
-	if((err=lapb_register(sl, &x25_asy_callbacks))==LAPB_OK)
+	if((err=lapb_register(dev, &x25_asy_callbacks))==LAPB_OK)
 		return 0;
 
 	/* Cleanup */
@@ -525,7 +525,7 @@
 	netif_stop_queue(dev);
 	sl->rcount = 0;
 	sl->xleft  = 0;
-	if((err=lapb_unregister(sl))!=LAPB_OK)
+	if((err=lapb_unregister(dev))!=LAPB_OK)
 		printk(KERN_ERR "x25_asy_close: lapb_unregister error -%d\n",err);
 	spin_unlock(&sl->lock);
 	return 0;
--- diff/drivers/net/wd.c	2003-09-30 15:46:16.000000000 +0100
+++ source/drivers/net/wd.c	2004-02-09 10:39:54.000000000 +0000
@@ -47,7 +47,6 @@
 static unsigned int wd_portlist[] __initdata =
 {0x300, 0x280, 0x380, 0x240, 0};
 
-int wd_probe(struct net_device *dev);
 static int wd_probe1(struct net_device *dev, int ioaddr);
 
 static int wd_open(struct net_device *dev);
@@ -83,11 +82,14 @@
 	The wd_probe1() routine initializes the card and fills the
 	station address field. */
 
-int __init wd_probe(struct net_device *dev)
+static int __init do_wd_probe(struct net_device *dev)
 {
 	int i;
 	struct resource *r;
 	int base_addr = dev->base_addr;
+	int irq = dev->irq;
+	int mem_start = dev->mem_start;
+	int mem_end = dev->mem_end;
 
 	SET_MODULE_OWNER(dev);
 
@@ -115,11 +117,45 @@
 			return 0;
 		}
 		release_region(ioaddr, WD_IO_EXTENT);
+		dev->irq = irq;
+		dev->mem_start = mem_start;
+		dev->mem_end = mem_end;
 	}
 
 	return -ENODEV;
 }
 
+static void cleanup_card(struct net_device *dev)
+{
+	free_irq(dev->irq, dev);
+	release_region(dev->base_addr - WD_NIC_OFFSET, WD_IO_EXTENT);
+}
+
+struct net_device * __init wd_probe(int unit)
+{
+	struct net_device *dev = alloc_ei_netdev();
+	int err;
+
+	if (!dev)
+		return ERR_PTR(-ENOMEM);
+
+	sprintf(dev->name, "eth%d", unit);
+	netdev_boot_setup_check(dev);
+
+	err = do_wd_probe(dev);
+	if (err)
+		goto out;
+	err = register_netdev(dev);
+	if (err)
+		goto out1;
+	return dev;
+out1:
+	cleanup_card(dev);
+out:
+	free_netdev(dev);
+	return ERR_PTR(err);
+}
+
 static int __init wd_probe1(struct net_device *dev, int ioaddr)
 {
 	int i;
@@ -262,19 +298,11 @@
 	} else if (dev->irq == 2)		/* Fixup bogosity: IRQ2 is really IRQ9 */
 		dev->irq = 9;
 
-	/* Allocate dev->priv and fill in 8390 specific dev fields. */
-	if (ethdev_init(dev)) {
-		printk (" unable to get memory for dev->priv.\n");
-		return -ENOMEM;
-	}
-
 	/* Snarf the interrupt now.  There's no point in waiting since we cannot
 	   share and the board will usually be enabled. */
 	i = request_irq(dev->irq, ei_interrupt, 0, dev->name, dev);
 	if (i) {
 		printk (" unable to get IRQ %d.\n", dev->irq);
-		kfree(dev->priv);
-		dev->priv = NULL;
 		return i;
 	}
 
@@ -305,6 +333,9 @@
 	ei_status.get_8390_hdr = &wd_get_8390_hdr;
 	dev->open = &wd_open;
 	dev->stop = &wd_close;
+#ifdef CONFIG_NET_POLL_CONTROLLER
+	dev->poll_controller = ei_poll;
+#endif
 	NS8390_init(dev, 0);
 
 #if 1
@@ -446,7 +477,7 @@
 
 #ifdef MODULE
 #define MAX_WD_CARDS	4	/* Max number of wd cards per module */
-static struct net_device dev_wd[MAX_WD_CARDS];
+static struct net_device *dev_wd[MAX_WD_CARDS];
 static int io[MAX_WD_CARDS];
 static int irq[MAX_WD_CARDS];
 static int mem[MAX_WD_CARDS];
@@ -468,29 +499,35 @@
 int
 init_module(void)
 {
+	struct net_device *dev;
 	int this_dev, found = 0;
 
 	for (this_dev = 0; this_dev < MAX_WD_CARDS; this_dev++) {
-		struct net_device *dev = &dev_wd[this_dev];
-		dev->irq = irq[this_dev];
-		dev->base_addr = io[this_dev];
-		dev->mem_start = mem[this_dev];
-		dev->mem_end = mem_end[this_dev];
-		dev->init = wd_probe;
 		if (io[this_dev] == 0)  {
 			if (this_dev != 0) break; /* only autoprobe 1st one */
 			printk(KERN_NOTICE "wd.c: Presently autoprobing (not recommended) for a single card.\n");
 		}
-		if (register_netdev(dev) != 0) {
-			printk(KERN_WARNING "wd.c: No wd80x3 card found (i/o = 0x%x).\n", io[this_dev]);
-			if (found != 0) {	/* Got at least one. */
-				return 0;
+		dev = alloc_ei_netdev();
+		if (!dev)
+			break;
+		dev->irq = irq[this_dev];
+		dev->base_addr = io[this_dev];
+		dev->mem_start = mem[this_dev];
+		dev->mem_end = mem_end[this_dev];
+		if (do_wd_probe(dev) == 0) {
+			if (register_netdev(dev) == 0) {
+				dev_wd[found++] = dev;
+				continue;
 			}
-			return -ENXIO;
+			cleanup_card(dev);
 		}
-		found++;
-	}
-	return 0;
+		free_netdev(dev);
+		printk(KERN_WARNING "wd.c: No wd80x3 card found (i/o = 0x%x).\n", io[this_dev]);
+		break;
+	}
+	if (found)
+		return 0;
+	return -ENXIO;
 }
 
 void
@@ -499,14 +536,11 @@
 	int this_dev;
 
 	for (this_dev = 0; this_dev < MAX_WD_CARDS; this_dev++) {
-		struct net_device *dev = &dev_wd[this_dev];
-		if (dev->priv != NULL) {
-			void *priv = dev->priv;
-			int ioaddr = dev->base_addr - WD_NIC_OFFSET;
-			free_irq(dev->irq, dev);
-			release_region(ioaddr, WD_IO_EXTENT);
+		struct net_device *dev = dev_wd[this_dev];
+		if (dev) {
 			unregister_netdev(dev);
-			kfree(priv);
+			cleanup_card(dev);
+			free_netdev(dev);
 		}
 	}
 }
--- diff/drivers/net/wireless/Kconfig	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/net/wireless/Kconfig	2004-02-09 10:39:54.000000000 +0000
@@ -270,8 +270,8 @@
 config PCMCIA_ATMEL
       tristate "Atmel at76c502/at76c504 PCMCIA cards"
       depends on NET_RADIO && EXPERIMENTAL && PCMCIA
-      enable FW_LOADER
-      enable CRC32
+      select FW_LOADER
+      select CRC32
        ---help---
          A driver for PCMCIA 802.11 wireless cards based on the 
          Atmel fast-vnet chips. This driver supports standard
--- diff/drivers/net/wireless/airo.c	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/net/wireless/airo.c	2004-02-09 10:39:54.000000000 +0000
@@ -2104,10 +2104,8 @@
 	return ETH_ALEN;
 }
 
-static void wifi_setup(struct net_device *dev, struct net_device *ethdev)
+static void wifi_setup(struct net_device *dev)
 {
-	struct airo_info *ai = ethdev->priv;
-	dev->priv = ai;
 	dev->hard_header        = 0;
 	dev->rebuild_header     = 0;
 	dev->hard_header_cache  = 0;
@@ -2127,14 +2125,11 @@
 	dev->change_mtu = &airo_change_mtu;
 	dev->open = &airo_open;
 	dev->stop = &airo_close;
-	dev->irq = ethdev->irq;
-	dev->base_addr = ethdev->base_addr;
 
 	dev->type               = ARPHRD_IEEE80211;
 	dev->hard_header_len    = ETH_HLEN;
 	dev->mtu                = 2312;
 	dev->addr_len           = ETH_ALEN;
-	memcpy(dev->dev_addr, ethdev->dev_addr, dev->addr_len);
 	dev->tx_queue_len       = 100; 
 
 	memset(dev->broadcast,0xFF, ETH_ALEN);
@@ -2146,17 +2141,17 @@
 					struct net_device *ethdev)
 {
 	int err;
-	struct net_device *dev = (struct net_device*)kmalloc(sizeof *dev,GFP_KERNEL);
-	if (!dev) return 0;
-	memset(dev, 0, sizeof(*dev));
-
-	strcpy(dev->name, "wifi%d");
-	dev->priv = ai;
-	wifi_setup(dev, ethdev);
+	struct net_device *dev = alloc_netdev(0, "wifi%d", wifi_setup);
+	if (!dev)
+		return NULL;
+	dev->priv = ethdev->priv;
+	dev->irq = ethdev->irq;
+	dev->base_addr = ethdev->base_addr;
+	memcpy(dev->dev_addr, ethdev->dev_addr, dev->addr_len);
 	err = register_netdev(dev);
 	if (err<0) {
-		kfree(dev);
-		return 0;
+		free_netdev(dev);
+		return NULL;
 	}
 	return dev;
 }
@@ -2272,7 +2267,7 @@
 	kill_proc(ai->thr_pid, SIGTERM, 1);
 	wait_for_completion(&ai->thr_exited);
 err_out_free:
-	kfree(dev);
+	free_netdev(dev);
 	return NULL;
 }
 
--- diff/drivers/net/wireless/airport.c	2003-09-17 12:28:09.000000000 +0100
+++ source/drivers/net/wireless/airport.c	2004-02-09 10:39:54.000000000 +0000
@@ -40,7 +40,7 @@
 #define AIRPORT_IO_LEN	(0x1000)	/* one page */
 
 struct airport {
-	struct device_node *node;
+	struct macio_dev *mdev;
 	void *vaddr;
 	int irq_requested;
 	int ndev_registered;
@@ -51,7 +51,6 @@
 {
 	struct net_device *dev = dev_get_drvdata(&mdev->ofdev.dev);
 	struct orinoco_private *priv = dev->priv;
-	struct airport *card = priv->card;
 	unsigned long flags;
 	int err;
 
@@ -76,7 +75,7 @@
 	orinoco_unlock(priv, &flags);
 
 	disable_irq(dev->irq);
-	pmac_call_feature(PMAC_FTR_AIRPORT_ENABLE, card->node, 0, 0);
+	pmac_call_feature(PMAC_FTR_AIRPORT_ENABLE, macio_get_of_node(mdev), 0, 0);
 
 	return 0;
 }
@@ -86,14 +85,14 @@
 {
 	struct net_device *dev = dev_get_drvdata(&mdev->ofdev.dev);
 	struct orinoco_private *priv = dev->priv;
-	struct airport *card = priv->card;
 	unsigned long flags;
 	int err;
 
 	printk(KERN_DEBUG "%s: Airport waking up\n", dev->name);
 
-	pmac_call_feature(PMAC_FTR_AIRPORT_ENABLE, card->node, 0, 1);
-	mdelay(200);
+	pmac_call_feature(PMAC_FTR_AIRPORT_ENABLE, macio_get_of_node(mdev), 0, 1);
+	set_current_state(TASK_UNINTERRUPTIBLE);
+	schedule_timeout(HZ/5);
 
 	enable_irq(dev->irq);
 
@@ -142,15 +141,13 @@
 		iounmap(card->vaddr);
 	card->vaddr = 0;
 
-	dev->base_addr = 0;
+	macio_release_resource(mdev, 0);
 
-	release_OF_resource(card->node, 0);
-
-	pmac_call_feature(PMAC_FTR_AIRPORT_ENABLE, card->node, 0, 0);
-	current->state = TASK_UNINTERRUPTIBLE;
+	pmac_call_feature(PMAC_FTR_AIRPORT_ENABLE, macio_get_of_node(mdev), 0, 0);
+	set_current_state(TASK_UNINTERRUPTIBLE);
 	schedule_timeout(HZ);
 
-	dev_set_drvdata(&mdev->ofdev.dev, NULL);
+	macio_set_drvdata(mdev, NULL);
 	free_netdev(dev);
 
 	return 0;
@@ -173,11 +170,11 @@
 	 * off. */
 	disable_irq(dev->irq);
 
-	pmac_call_feature(PMAC_FTR_AIRPORT_ENABLE, card->node, 0, 0);
-	current->state = TASK_UNINTERRUPTIBLE;
+	pmac_call_feature(PMAC_FTR_AIRPORT_ENABLE, macio_get_of_node(card->mdev), 0, 0);
+	set_current_state(TASK_UNINTERRUPTIBLE);
 	schedule_timeout(HZ);
-	pmac_call_feature(PMAC_FTR_AIRPORT_ENABLE, card->node, 0, 1);
-	current->state = TASK_UNINTERRUPTIBLE;
+	pmac_call_feature(PMAC_FTR_AIRPORT_ENABLE, macio_get_of_node(card->mdev), 0, 1);
+	set_current_state(TASK_UNINTERRUPTIBLE);
 	schedule_timeout(HZ);
 
 	enable_irq(dev->irq);
@@ -194,10 +191,9 @@
 	struct net_device *dev;
 	struct airport *card;
 	unsigned long phys_addr;
-	struct device_node *of_node = mdev->ofdev.node;
 	hermes_t *hw;
 
-	if (of_node->n_addrs < 1 || of_node->n_intrs < 1) {
+	if (macio_resource_count(mdev) < 1 || macio_irq_count(mdev) < 1) {
 		printk(KERN_ERR "airport: wrong interrupt/addresses in OF tree\n");
 		return -ENODEV;
 	}
@@ -212,27 +208,26 @@
 	card = priv->card;
 
 	hw = &priv->hw;
-	card->node = of_node;
+	card->mdev = mdev;
 
-	if (! request_OF_resource(of_node, 0, " (airport)")) {
+	if (macio_request_resource(mdev, 0, "airport")) {
 		printk(KERN_ERR "airport: can't request IO resource !\n");
-		kfree(dev);
-		return -ENODEV;
+		free_netdev(dev);
+		return -EBUSY;
 	}
 
-	dev->name[0] = '\0';	/* register_netdev will give us an ethX name */
 	SET_MODULE_OWNER(dev);
 	SET_NETDEV_DEV(dev, &mdev->ofdev.dev);
 
-	dev_set_drvdata(&mdev->ofdev.dev, dev);
+	macio_set_drvdata(mdev, dev);
 
 	/* Setup interrupts & base address */
-	dev->irq = of_node->intrs[0].line;
-	phys_addr = of_node->addrs[0].address;  /* Physical address */
+	dev->irq = macio_irq(mdev, 0);
+	phys_addr = macio_resource_start(mdev, 0);  /* Physical address */
 	printk(KERN_DEBUG "Airport at physical address %lx\n", phys_addr);
 	dev->base_addr = phys_addr;
 	card->vaddr = ioremap(phys_addr, AIRPORT_IO_LEN);
-	if (! card->vaddr) {
+	if (!card->vaddr) {
 		printk("airport: ioremap() failed\n");
 		goto failed;
 	}
@@ -241,8 +236,8 @@
 			HERMES_MEM, HERMES_16BIT_REGSPACING);
 		
 	/* Power up card */
-	pmac_call_feature(PMAC_FTR_AIRPORT_ENABLE, card->node, 0, 1);
-	current->state = TASK_UNINTERRUPTIBLE;
+	pmac_call_feature(PMAC_FTR_AIRPORT_ENABLE, macio_get_of_node(mdev), 0, 1);
+	set_current_state(TASK_UNINTERRUPTIBLE);
 	schedule_timeout(HZ);
 
 	/* Reset it before we get the interrupt */
--- diff/drivers/net/wireless/arlan-main.c	2003-10-09 09:47:34.000000000 +0100
+++ source/drivers/net/wireless/arlan-main.c	2004-02-09 10:39:54.000000000 +0000
@@ -19,9 +19,7 @@
 static int SID = SIDUNKNOWN;
 static int radioNodeId = radioNodeIdUNKNOWN;
 static char encryptionKey[12] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'};
-static int mem = memUNKNOWN;
 int arlan_debug = debugUNKNOWN;
-static int numDevices = numDevicesUNKNOWN;
 static int spreadingCode = spreadingCodeUNKNOWN;
 static int channelNumber = channelNumberUNKNOWN;
 static int channelSet = channelSetUNKNOWN;
@@ -45,9 +43,7 @@
 
 MODULE_PARM(irq, "i");
 MODULE_PARM(mem, "i");
-MODULE_PARM(probe, "i");
 MODULE_PARM(arlan_debug, "i");
-MODULE_PARM(numDevices, "i");
 MODULE_PARM(testMemory, "i");
 MODULE_PARM(spreadingCode, "i");
 MODULE_PARM(channelNumber, "i");
@@ -69,9 +65,7 @@
 MODULE_PARM(arlan_EEPROM_bad, "i");
 MODULE_PARM_DESC(irq, "(unused)");
 MODULE_PARM_DESC(mem, "Arlan memory address for single device probing");
-MODULE_PARM_DESC(probe, "Arlan probe at initialization (0-1)");
 MODULE_PARM_DESC(arlan_debug, "Arlan debug enable (0-1)");
-MODULE_PARM_DESC(numDevices, "Number of Arlan devices; ignored if >1");
 MODULE_PARM_DESC(testMemory, "(unused)");
 MODULE_PARM_DESC(mdebug, "Arlan multicast debugging (0-1)");
 MODULE_PARM_DESC(retries, "Arlan maximum packet retransmisions");
@@ -88,7 +82,6 @@
 struct arlan_conf_stru arlan_conf[MAX_ARLANS];
 static int arlans_found;
 
-static  int 	arlan_probe_here(struct net_device *dev, int ioaddr);
 static  int 	arlan_open(struct net_device *dev);
 static  int 	arlan_tx(struct sk_buff *skb, struct net_device *dev);
 static  irqreturn_t arlan_interrupt(int irq, void *dev_id, struct pt_regs *regs);
@@ -975,24 +968,27 @@
  * probes on the ISA bus. A good device probes avoids doing writes, and
  * verifies that the correct device exists and functions.
  */
-
-static int __init arlan_check_fingerprint(int memaddr)
+#define ARLAN_SHMEM_SIZE	0x2000
+static int __init arlan_check_fingerprint(unsigned long memaddr)
 {
-	static char probeText[] = "TELESYSTEM SLW INC.    ARLAN \0";
-	char tempBuf[49];
+	static const char probeText[] = "TELESYSTEM SLW INC.    ARLAN \0";
 	volatile struct arlan_shmem *arlan = (struct arlan_shmem *) memaddr;
+	unsigned long paddr = virt_to_phys((void *) memaddr);
+	char tempBuf[49];
 
 	ARLAN_DEBUG_ENTRY("arlan_check_fingerprint");
-	if (check_mem_region(virt_to_phys((void *)memaddr),0x2000 )){
-		// printk(KERN_WARNING "arlan: memory region %lx excluded from probing \n",virt_to_phys((void*)memaddr));
+
+	if (!request_mem_region(paddr, ARLAN_SHMEM_SIZE, "arlan")) {
+		// printk(KERN_WARNING "arlan: memory region %lx excluded from probing \n",paddr);
 		return -ENODEV;
 	}
+
 	memcpy_fromio(tempBuf, arlan->textRegion, 29);
 	tempBuf[30] = 0;
 
 	/* check for card at this address */
 	if (0 != strncmp(tempBuf, probeText, 29)){
-// not 		release_mem_region(virt_to_phys((void*)memaddr),0x2000);
+ 		release_mem_region(paddr, ARLAN_SHMEM_SIZE);
 		return -ENODEV;
 	}
 
@@ -1000,51 +996,8 @@
 	ARLAN_DEBUG_EXIT("arlan_check_fingerprint");
 
 	return 0;
-
-
-}
-
-static int __init arlan_probe_everywhere(struct net_device *dev)
-{
-	int m;
-	int probed = 0;
-	int found = 0;
-
-	SET_MODULE_OWNER(dev);
-
-	ARLAN_DEBUG_ENTRY("arlan_probe_everywhere");
-	if (mem != 0 && numDevices == 1)	/* Check a single specified location. */
-	{
-		if (arlan_probe_here(dev, (int) phys_to_virt(  mem) ) == 0)
-			return 0;
-		else
-			return -ENODEV;
-	}
-	for (m = (int)phys_to_virt(lastFoundAt) + 0x2000; m <= (int)phys_to_virt(0xDE000); m += 0x2000)
-	{
-		if (arlan_probe_here(dev, m) == 0)
-		{
-			found++;
-			lastFoundAt = (int)virt_to_phys((void*)m);
-			break;
-		}
-		probed++;
-	}
-	if (found == 0 && probed != 0)
-	{
-		if (lastFoundAt == 0xbe000)
-			printk(KERN_ERR "arlan: No Arlan devices found \n");
-		return -ENODEV;
-	}
-	else
-		return 0;
-
-	ARLAN_DEBUG_EXIT("arlan_probe_everywhere");
-
-	return -ENODEV;
 }
 
-
 static int arlan_change_mtu(struct net_device *dev, int new_mtu)
 {
 	struct arlan_private *priv = dev->priv;
@@ -1085,47 +1038,15 @@
 
 
 
-
-static int __init
-	      arlan_allocate_device(int num, struct net_device *devs)
+static int __init arlan_setup_device(struct net_device *dev, int num)
 {
+	struct arlan_private *ap = dev->priv;
+	int err;
 
-	struct net_device *dev;
-	struct arlan_private *ap;
+	ARLAN_DEBUG_ENTRY("arlan_setup_device");
 
-	ARLAN_DEBUG_ENTRY("arlan_allocate_device");
+	ap->conf = (struct arlan_shmem *)(ap+1);
 
-	if (!devs) {
-		dev = init_etherdev(0, sizeof(struct arlan_private) + sizeof(struct arlan_shmem));
-		if (!dev) {
-			printk(KERN_ERR "ARLAN: init_etherdev failed\n");
-			return 0;
-		}
-		ap = dev->priv;
-		ap->conf = dev->priv + sizeof(struct arlan_private);
-		ap->init_etherdev_alloc = 1;
-	} else {
-		dev = devs;
-		dev->priv = kmalloc(sizeof(struct arlan_private) + sizeof(struct arlan_shmem), GFP_KERNEL);
-		if (!dev->priv) {
-			printk(KERN_ERR "ARLAN: kmalloc of dev->priv failed\n");
-			return 0;
-		}
-		ap = dev->priv;
-		ap->conf = dev->priv + sizeof(struct arlan_private);
-		memset(ap, 0, sizeof(*ap));
-	}
-
-	/* Fill in the 'dev' fields. */
-	dev->base_addr = 0;
-	dev->mem_start = 0;
-	dev->mem_end = 0;
-	dev->mtu = 1500;
-	dev->flags = 0;		/* IFF_BROADCAST & IFF_MULTICAST & IFF_PROMISC; */
-	dev->irq = 0;
-	dev->dma = 0;
-	dev->tx_queue_len = tx_queue_len;
-	ether_setup(dev);
 	dev->tx_queue_len = tx_queue_len;
 	dev->open = arlan_open;
 	dev->stop = arlan_close;
@@ -1138,41 +1059,45 @@
 	dev->watchdog_timeo = 3*HZ;
 	
 	ap->irq_test_done = 0;
-	arlan_device[num] = dev;
 	ap->Conf = &arlan_conf[num];
 
 	ap->Conf->pre_Command_Wait = 40;
 	ap->Conf->rx_tweak1 = 30;
 	ap->Conf->rx_tweak2 = 0;
 
-	ARLAN_DEBUG_EXIT("arlan_allocate_device");
-	return (int) dev;
-}
 
+	err = register_netdev(dev);
+	if (err) {
+		release_mem_region(virt_to_phys((void *) dev->mem_start), 
+			   ARLAN_SHMEM_SIZE);
+		free_netdev(dev);
+		return err;
+	}
+	arlan_device[num] = dev;
+	ARLAN_DEBUG_EXIT("arlan_setup_device");
+	return 0;
+}
 
-static int __init arlan_probe_here(struct net_device *dev, int memaddr)
+static int __init arlan_probe_here(struct net_device *dev, 
+				   unsigned long memaddr)
 {
-	volatile struct arlan_shmem *arlan;
+	struct arlan_private *ap = dev->priv;
 
 	ARLAN_DEBUG_ENTRY("arlan_probe_here");
 
 	if (arlan_check_fingerprint(memaddr))
 		return -ENODEV;
 
-	printk(KERN_NOTICE "%s: Arlan found at %x, \n ", dev->name, (int) virt_to_phys((void*)memaddr));
-
-	if (!arlan_allocate_device(arlans_found, dev))
-		return -1;
-
-	((struct arlan_private *) dev->priv)->card = (struct arlan_shmem *) memaddr;
-	arlan = (void *) memaddr;
+	printk(KERN_NOTICE "%s: Arlan found at %x, \n ", dev->name, 
+	       (int) virt_to_phys((void*)memaddr));
 
+	ap->card = (void *) memaddr;
 	dev->mem_start = memaddr;
-	dev->mem_end = memaddr + 0x1FFF;
+	dev->mem_end = memaddr + ARLAN_SHMEM_SIZE-1;
 
 	if (dev->irq < 2)
 	{
-		READSHM(dev->irq, arlan->irqLevel, u_char);
+		READSHM(dev->irq, ap->card->irqLevel, u_char);
 	} else if (dev->irq == 2)
 		dev->irq = 9;
 
@@ -1183,8 +1108,6 @@
 }
 
 
-
-
 static int arlan_open(struct net_device *dev)
 {
 	struct arlan_private *priv = dev->priv;
@@ -1193,12 +1116,6 @@
 
 	ARLAN_DEBUG_ENTRY("arlan_open");
 
-	if (dev->mem_start == 0)
-		ret = arlan_probe_everywhere(dev);
-	if (ret != 0)
-		return ret;
-
-	arlan = priv->card;
 	ret = request_irq(dev->irq, &arlan_interrupt, 0, dev->name, dev);
 	if (ret)
 	{
@@ -1768,14 +1685,9 @@
 {
 	struct arlan_private *priv = dev->priv;
 
-	if (!priv)
-	{
-		printk(KERN_CRIT "arlan: No Device priv \n");
-		return 0;
-	}
 	ARLAN_DEBUG_ENTRY("arlan_close");
 
-	del_timer(&priv->timer);
+	del_timer_sync(&priv->timer);
 
 	arlan_command(dev, ARLAN_COMMAND_POWERDOWN);
 
@@ -1867,39 +1779,70 @@
 }
 
 
-int __init arlan_probe(struct net_device *dev)
+struct net_device * __init arlan_probe(int unit)
 {
-	printk("Arlan driver %s\n", arlan_version);
+	struct net_device *dev;
+	int err;
+	int m;
 
-	if (arlan_probe_everywhere(dev))
-		return -ENODEV;
+	ARLAN_DEBUG_ENTRY("arlan_probe");
 
-	arlans_found++;
-	return 0;
-}
+	if (arlans_found == MAX_ARLANS)
+		return ERR_PTR(-ENODEV);
 
-#ifdef  MODULE
+	/* 
+	 * Reserve space for local data and a copy of the shared memory
+	 * that is used by the /proc interface.
+	 */
+	dev = alloc_etherdev(sizeof(struct arlan_private)
+			     + sizeof(struct arlan_shmem));
+	if (!dev)
+		return ERR_PTR(-ENOMEM);
 
-static int probe = probeUNKNOWN;
+	SET_MODULE_OWNER(dev);
 
-static int __init arlan_find_devices(void)
-{
-	int m;
-	int found = 0;
+	if (unit >= 0) {
+		sprintf(dev->name, "eth%d", unit);
+		netdev_boot_setup_check(dev);
+		
+		if (dev->mem_start) {
+			if (arlan_probe_here(dev, dev->mem_start) == 0)
+				goto found;
+			goto not_found;
+		}
+			
+	}
 
-	ARLAN_DEBUG_ENTRY("arlan_find_devices");
-	if (mem != 0 && numDevices == 1)	/* Check a single specified location. */
-		return 1;
-	for (m =(int) phys_to_virt(0xc0000); m <=(int) phys_to_virt(0xDE000); m += 0x2000)
+
+	for (m = (int)phys_to_virt(lastFoundAt) + ARLAN_SHMEM_SIZE; 
+	     m <= (int)phys_to_virt(0xDE000); 
+	     m += ARLAN_SHMEM_SIZE)
 	{
-		if (arlan_check_fingerprint(m) == 0)
-			found++;
+		if (arlan_probe_here(dev, m) == 0)
+		{
+			lastFoundAt = (int)virt_to_phys((void*)m);
+			goto found;
+		}
 	}
-	ARLAN_DEBUG_EXIT("arlan_find_devices");
 
-	return found;
+	if (lastFoundAt == 0xbe000)
+		printk(KERN_ERR "arlan: No Arlan devices found \n");
+
+ not_found:
+	free_netdev(dev);
+	return ERR_PTR(-ENODEV);
+
+ found:
+	err = arlan_setup_device(dev, arlans_found);
+	if (err)
+		dev = ERR_PTR(err);
+	else if (!arlans_found++)
+		printk(KERN_INFO "Arlan driver %s\n", arlan_version);
+
+	return dev;
 }
 
+#ifdef  MODULE
 int init_module(void)
 {
 	int i = 0;
@@ -1909,21 +1852,11 @@
 	if (channelSet != channelSetUNKNOWN || channelNumber != channelNumberUNKNOWN || systemId != systemIdUNKNOWN)
 		return -EINVAL;
 
-	numDevices = arlan_find_devices();
-	if (numDevices == 0)
-		return -ENODEV;
-
-	for (i = 0; i < numDevices && i < MAX_ARLANS; i++)
-	{
-		if (!arlan_allocate_device(i, NULL))
-			return -ENOMEM;
+	for (i = 0; i < MAX_ARLANS; i++) {
+		struct net_device *dev = arlan_probe(i);
 
-		if (arlan_device[i] == NULL)
-			return -ENOMEM;
-
-		if (probe)
-			arlan_probe_everywhere(arlan_device[i]);
-//		arlan_command(arlan_device[i], ARLAN_COMMAND_POWERDOWN );
+		if (IS_ERR(dev)) 
+			return PTR_ERR(dev);
 	}
 	init_arlan_proc();
 	printk(KERN_INFO "Arlan driver %s\n", arlan_version);
@@ -1935,7 +1868,7 @@
 void cleanup_module(void)
 {
 	int i = 0;
-	struct arlan_private *ap;
+	struct net_device *dev;
 
 	ARLAN_DEBUG_ENTRY("cleanup_module");
 
@@ -1946,22 +1879,18 @@
 
 	for (i = 0; i < MAX_ARLANS; i++)
 	{
-		if (arlan_device[i])
-		{
-			arlan_command(arlan_device[i], ARLAN_COMMAND_POWERDOWN );
-
-//			release_mem_region(virt_to_phys(arlan_device[i]->mem_start), 0x2000 );
-			unregister_netdev(arlan_device[i]);
-			ap = arlan_device[i]->priv;
-			if (ap->init_etherdev_alloc) {
-				free_netdev(arlan_device[i]);
-				arlan_device[i] = NULL;
-			} else {
-				kfree(ap);
-				ap = NULL;
-			}
+		dev = arlan_device[i];
+		if (dev) {
+			arlan_command(dev, ARLAN_COMMAND_POWERDOWN );
+
+			unregister_netdev(dev);
+			release_mem_region(virt_to_phys((void *) dev->mem_start), 
+					   ARLAN_SHMEM_SIZE);
+			free_netdev(dev);
+			arlan_device[i] = NULL;
 		}
 	}
+
 	ARLAN_DEBUG_EXIT("cleanup_module");
 }
 
--- diff/drivers/net/wireless/arlan.h	2003-09-30 15:46:16.000000000 +0100
+++ source/drivers/net/wireless/arlan.h	2004-02-09 10:39:54.000000000 +0000
@@ -57,12 +57,8 @@
  
 #define SIDUNKNOWN -1
 #define radioNodeIdUNKNOWN -1
-#define encryptionKeyUNKNOWN '\0';
 #define irqUNKNOWN 0
-#define memUNKNOWN 0
 #define debugUNKNOWN 0
-#define probeUNKNOWN 1
-#define numDevicesUNKNOWN 1
 #define testMemoryUNKNOWN 1
 #define spreadingCodeUNKNOWN 0
 #define channelNumberUNKNOWN 0
@@ -82,6 +78,8 @@
 	#define ARLAN_DEBUG(a,b) 
 #endif
 
+#define ARLAN_SHMEM_SIZE	0x2000
+
 struct arlan_shmem
 {
       /* Header Signature */ 
--- diff/drivers/net/wireless/orinoco.c	2003-09-30 15:46:16.000000000 +0100
+++ source/drivers/net/wireless/orinoco.c	2004-02-09 10:39:54.000000000 +0000
@@ -4129,6 +4129,8 @@
 	struct orinoco_private *priv;
 
 	dev = alloc_etherdev(sizeof(struct orinoco_private) + sizeof_card);
+	if (!dev)
+		return NULL;
 	priv = (struct orinoco_private *)dev->priv;
 	priv->ndev = dev;
 	if (sizeof_card)
--- diff/drivers/net/wireless/orinoco_pci.c	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/net/wireless/orinoco_pci.c	2004-02-09 10:39:54.000000000 +0000
@@ -261,7 +261,7 @@
 		if (dev->irq)
 			free_irq(dev->irq, dev);
 
-		kfree(dev);
+		free_netdev(dev);
 	}
 
 	if (pci_ioaddr)
--- diff/drivers/net/wireless/orinoco_plx.c	2003-08-26 10:00:53.000000000 +0100
+++ source/drivers/net/wireless/orinoco_plx.c	2004-02-09 10:39:54.000000000 +0000
@@ -263,7 +263,7 @@
 		if (dev->irq)
 			free_irq(dev->irq, dev);
 		
-		kfree(dev);
+		free_netdev(dev);
 	}
 
 	if (pccard_ioaddr)
--- diff/drivers/net/wireless/orinoco_tmd.c	2003-08-26 10:00:53.000000000 +0100
+++ source/drivers/net/wireless/orinoco_tmd.c	2004-02-09 10:39:54.000000000 +0000
@@ -157,7 +157,7 @@
 		if (dev->irq)
 			free_irq(dev->irq, dev);
 		
-		kfree(dev);
+		free_netdev(dev);
 	}
 
 	if (pccard_ioaddr)
--- diff/drivers/net/wireless/ray_cs.c	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/net/wireless/ray_cs.c	2004-02-09 10:39:54.000000000 +0000
@@ -344,19 +344,14 @@
 	    return NULL;
 
     /* Allocate space for private device-specific data */
-    dev = kmalloc(sizeof(struct net_device), GFP_KERNEL);
+    dev = alloc_etherdev(sizeof(ray_dev_t));
 
     if (!dev)
 	    goto fail_alloc_dev;
 
-    local = kmalloc(sizeof(ray_dev_t), GFP_KERNEL);
-
-    if (!local)
-	    goto fail_alloc_local;
+    local = dev->priv;
 
     memset(link, 0, sizeof(struct dev_link_t));
-    memset(dev, 0, sizeof(struct net_device));
-    memset(local, 0, sizeof(ray_dev_t));
 
     /* The io structure describes IO port mapping. None used here */
     link->io.NumPorts1 = 0;
@@ -379,7 +374,6 @@
     link->priv = dev;
     link->irq.Instance = dev;
     
-    dev->priv = local;
     local->finder = link;
     local->card_status = CARD_INSERTED;
     local->authentication_state = UNAUTHENTICATED;
@@ -401,7 +395,6 @@
 
     DEBUG(2,"ray_cs ray_attach calling ether_setup.)\n");
     SET_MODULE_OWNER(dev);
-    ether_setup(dev);
     dev->init = &ray_dev_init;
     dev->open = &ray_open;
     dev->stop = &ray_dev_close;
@@ -434,8 +427,6 @@
     DEBUG(2,"ray_cs ray_attach ending\n");
     return link;
 
-fail_alloc_local:
-    kfree(dev);
 fail_alloc_dev:
     kfree(link);
     return NULL;
@@ -478,9 +469,7 @@
     if (link->priv) {
         struct net_device *dev = link->priv;
 	if (link->dev) unregister_netdev(dev);
-        if (dev->priv)
-            kfree(dev->priv);
-        kfree(link->priv);
+        free_netdev(dev);
     }
     kfree(link);
     DEBUG(2,"ray_cs ray_detach ending\n");
--- diff/drivers/net/wireless/strip.c	2003-09-30 15:46:16.000000000 +0100
+++ source/drivers/net/wireless/strip.c	2004-02-09 10:39:54.000000000 +0000
@@ -2564,7 +2564,7 @@
 
 	strip_info->magic = 0;
 
-	kfree(strip_info->dev);
+	free_netdev(strip_info->dev);
 }
 
 
--- diff/drivers/net/wireless/wavelan.c	2003-08-26 10:00:53.000000000 +0100
+++ source/drivers/net/wireless/wavelan.c	2004-02-09 10:39:54.000000000 +0000
@@ -153,7 +153,7 @@
  * Disable interrupts on the WaveLAN hardware.
  * (called by wv_82586_stop())
  */
-static inline void wv_ints_off(device * dev)
+static inline void wv_ints_off(struct net_device * dev)
 {
 	net_local *lp = (net_local *) dev->priv;
 	unsigned long ioaddr = dev->base_addr;
@@ -167,7 +167,7 @@
  * Enable interrupts on the WaveLAN hardware.
  * (called by wv_hw_reset())
  */
-static inline void wv_ints_on(device * dev)
+static inline void wv_ints_on(struct net_device * dev)
 {
 	net_local *lp = (net_local *) dev->priv;
 	unsigned long ioaddr = dev->base_addr;
@@ -268,7 +268,7 @@
 /*
  * update the checksum field in the Wavelan's PSA
  */
-static void update_psa_checksum(device * dev, unsigned long ioaddr, u16 hacr)
+static void update_psa_checksum(struct net_device * dev, unsigned long ioaddr, u16 hacr)
 {
 #ifdef SET_PSA_CRC
 	psa_t psa;
@@ -547,7 +547,7 @@
 /*
  * Acknowledge the reading of the status issued by the i82586.
  */
-static void wv_ack(device * dev)
+static void wv_ack(struct net_device * dev)
 {
 	net_local *lp = (net_local *) dev->priv;
 	unsigned long ioaddr = dev->base_addr;
@@ -589,7 +589,7 @@
  * Set channel attention bit and busy wait until command has
  * completed, then acknowledge completion of the command.
  */
-static inline int wv_synchronous_cmd(device * dev, const char *str)
+static inline int wv_synchronous_cmd(struct net_device * dev, const char *str)
 {
 	net_local *lp = (net_local *) dev->priv;
 	unsigned long ioaddr = dev->base_addr;
@@ -636,7 +636,7 @@
  * Check if done, and if OK.
  */
 static inline int
-wv_config_complete(device * dev, unsigned long ioaddr, net_local * lp)
+wv_config_complete(struct net_device * dev, unsigned long ioaddr, net_local * lp)
 {
 	unsigned short mcs_addr;
 	unsigned short status;
@@ -703,7 +703,7 @@
  * (called in wavelan_interrupt()).
  * Note : the spinlock is already grabbed for us.
  */
-static int wv_complete(device * dev, unsigned long ioaddr, net_local * lp)
+static int wv_complete(struct net_device * dev, unsigned long ioaddr, net_local * lp)
 {
 	int nreaped = 0;
 
@@ -845,7 +845,7 @@
  * wavelan_interrupt is not an option), so you may experience
  * delays sometimes.
  */
-static inline void wv_82586_reconfig(device * dev)
+static inline void wv_82586_reconfig(struct net_device * dev)
 {
 	net_local *lp = (net_local *) dev->priv;
 	unsigned long flags;
@@ -954,7 +954,7 @@
  * Print the formatted status of the Modem Management Controller.
  * This function needs to be completed.
  */
-static void wv_mmc_show(device * dev)
+static void wv_mmc_show(struct net_device * dev)
 {
 	unsigned long ioaddr = dev->base_addr;
 	net_local *lp = (net_local *) dev->priv;
@@ -1137,7 +1137,7 @@
 /*
  * Print the formatted status of the i82586's receive unit.
  */
-static void wv_ru_show(device * dev)
+static void wv_ru_show(struct net_device * dev)
 {
 	/* net_local *lp = (net_local *) dev->priv; */
 
@@ -1154,7 +1154,7 @@
 /*
  * Display info about one control block of the i82586 memory.
  */
-static void wv_cu_show_one(device * dev, net_local * lp, int i, u16 p)
+static void wv_cu_show_one(struct net_device * dev, net_local * lp, int i, u16 p)
 {
 	unsigned long ioaddr;
 	ac_tx_t actx;
@@ -1183,7 +1183,7 @@
 /*
  * Print status of the command unit of the i82586.
  */
-static void wv_cu_show(device * dev)
+static void wv_cu_show(struct net_device * dev)
 {
 	net_local *lp = (net_local *) dev->priv;
 	unsigned int i;
@@ -1209,7 +1209,7 @@
 /*
  * Print the formatted status of the WaveLAN PCMCIA device driver.
  */
-static void wv_dev_show(device * dev)
+static void wv_dev_show(struct net_device * dev)
 {
 	printk(KERN_DEBUG "dev:");
 	printk(" state=%lX,", dev->state);
@@ -1223,7 +1223,7 @@
  * Print the formatted status of the WaveLAN PCMCIA device driver's
  * private information.
  */
-static void wv_local_show(device * dev)
+static void wv_local_show(struct net_device * dev)
 {
 	net_local *lp;
 
@@ -1285,7 +1285,7 @@
  * This is the information which is displayed by the driver at startup.
  * There are lots of flags for configuring it to your liking.
  */
-static inline void wv_init_info(device * dev)
+static inline void wv_init_info(struct net_device * dev)
 {
 	short ioaddr = dev->base_addr;
 	net_local *lp = (net_local *) dev->priv;
@@ -1395,7 +1395,7 @@
  * card open or closed.
  * Used when the user read /proc/net/dev
  */
-static en_stats *wavelan_get_stats(device * dev)
+static en_stats *wavelan_get_stats(struct net_device * dev)
 {
 #ifdef DEBUG_IOCTL_TRACE
 	printk(KERN_DEBUG "%s: <>wavelan_get_stats()\n", dev->name);
@@ -1412,7 +1412,7 @@
  * num_addrs > 0	Multicast mode, receive normal and MC packets,
  *			and do best-effort filtering.
  */
-static void wavelan_set_multicast_list(device * dev)
+static void wavelan_set_multicast_list(struct net_device * dev)
 {
 	net_local *lp = (net_local *) dev->priv;
 
@@ -1485,7 +1485,7 @@
  * (Note : it was a nice way to test the reconfigure stuff...)
  */
 #ifdef SET_MAC_ADDRESS
-static int wavelan_set_mac_address(device * dev, void *addr)
+static int wavelan_set_mac_address(struct net_device * dev, void *addr)
 {
 	struct sockaddr *mac = addr;
 
@@ -1724,7 +1724,7 @@
  * address with our list, and if they match, get the statistics.
  * Sorry, but this function really needs the wireless extensions.
  */
-static inline void wl_spy_gather(device * dev,
+static inline void wl_spy_gather(struct net_device * dev,
 				 u8 *	mac,	/* MAC address */
 				 u8 *	stats)	/* Statistics to gather */
 {
@@ -1750,7 +1750,7 @@
  * With this histogram you may detect if one WaveLAN is really weak,
  * or you may also calculate the mean and standard deviation of the level.
  */
-static inline void wl_his_gather(device * dev, u8 * stats)
+static inline void wl_his_gather(struct net_device * dev, u8 * stats)
 {				/* Statistics to gather */
 	net_local *lp = (net_local *) dev->priv;
 	u8 level = stats[0] & MMR_SIGNAL_LVL;
@@ -2415,7 +2415,7 @@
  * Get wireless statistics.
  * Called by /proc/net/wireless
  */
-static iw_stats *wavelan_get_wireless_stats(device * dev)
+static iw_stats *wavelan_get_wireless_stats(struct net_device * dev)
 {
 	unsigned long ioaddr = dev->base_addr;
 	net_local *lp = (net_local *) dev->priv;
@@ -2492,7 +2492,7 @@
  * (called by wv_packet_rcv())
  */
 static inline void
-wv_packet_read(device * dev, u16 buf_off, int sksize)
+wv_packet_read(struct net_device * dev, u16 buf_off, int sksize)
 {
 	net_local *lp = (net_local *) dev->priv;
 	unsigned long ioaddr = dev->base_addr;
@@ -2587,7 +2587,7 @@
  * (called in wavelan_interrupt()).
  * Note : the spinlock is already grabbed for us.
  */
-static inline void wv_receive(device * dev)
+static inline void wv_receive(struct net_device * dev)
 {
 	unsigned long ioaddr = dev->base_addr;
 	net_local *lp = (net_local *) dev->priv;
@@ -2770,7 +2770,7 @@
  *
  * (called in wavelan_packet_xmit())
  */
-static inline int wv_packet_write(device * dev, void *buf, short length)
+static inline int wv_packet_write(struct net_device * dev, void *buf, short length)
 {
 	net_local *lp = (net_local *) dev->priv;
 	unsigned long ioaddr = dev->base_addr;
@@ -2901,7 +2901,7 @@
  * the packet.  We also prevent reentrance.  Then we call the function
  * to send the packet.
  */
-static int wavelan_packet_xmit(struct sk_buff *skb, device * dev)
+static int wavelan_packet_xmit(struct sk_buff *skb, struct net_device * dev)
 {
 	net_local *lp = (net_local *) dev->priv;
 	unsigned long flags;
@@ -2966,7 +2966,7 @@
  * Routine to initialize the Modem Management Controller.
  * (called by wv_hw_reset())
  */
-static inline int wv_mmc_init(device * dev)
+static inline int wv_mmc_init(struct net_device * dev)
 {
 	unsigned long ioaddr = dev->base_addr;
 	net_local *lp = (net_local *) dev->priv;
@@ -3138,7 +3138,7 @@
  * Start the receive unit.
  * (called by wv_hw_reset())
  */
-static inline int wv_ru_start(device * dev)
+static inline int wv_ru_start(struct net_device * dev)
 {
 	net_local *lp = (net_local *) dev->priv;
 	unsigned long ioaddr = dev->base_addr;
@@ -3230,7 +3230,7 @@
  *
  * (called by wv_hw_reset())
  */
-static inline int wv_cu_start(device * dev)
+static inline int wv_cu_start(struct net_device * dev)
 {
 	net_local *lp = (net_local *) dev->priv;
 	unsigned long ioaddr = dev->base_addr;
@@ -3331,7 +3331,7 @@
  *
  * (called by wv_hw_reset())
  */
-static inline int wv_82586_start(device * dev)
+static inline int wv_82586_start(struct net_device * dev)
 {
 	net_local *lp = (net_local *) dev->priv;
 	unsigned long ioaddr = dev->base_addr;
@@ -3463,7 +3463,7 @@
  *
  * (called by wv_hw_reset(), wv_82586_reconfig(), wavelan_packet_xmit())
  */
-static void wv_82586_config(device * dev)
+static void wv_82586_config(struct net_device * dev)
 {
 	net_local *lp = (net_local *) dev->priv;
 	unsigned long ioaddr = dev->base_addr;
@@ -3643,7 +3643,7 @@
  * WaveLAN controller (i82586).
  * (called by wavelan_close())
  */
-static inline void wv_82586_stop(device * dev)
+static inline void wv_82586_stop(struct net_device * dev)
 {
 	net_local *lp = (net_local *) dev->priv;
 	unsigned long ioaddr = dev->base_addr;
@@ -3680,7 +3680,7 @@
  *	5. Start the LAN controller's receive unit
  * (called by wavelan_interrupt(), wavelan_watchdog() & wavelan_open())
  */
-static int wv_hw_reset(device * dev)
+static int wv_hw_reset(struct net_device * dev)
 {
 	net_local *lp = (net_local *) dev->priv;
 	unsigned long ioaddr = dev->base_addr;
@@ -3770,7 +3770,7 @@
  */
 static irqreturn_t wavelan_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
-	device *dev;
+	struct net_device *dev;
 	unsigned long ioaddr;
 	net_local *lp;
 	u16 hasr;
@@ -3923,7 +3923,7 @@
  * kernel.  If the transmission completes, this timer is disabled. If
  * the timer expires, we are called and we try to unlock the hardware.
  */
-static void wavelan_watchdog(device *	dev)
+static void wavelan_watchdog(struct net_device *	dev)
 {
 	net_local *	lp = (net_local *)dev->priv;
 	u_long		ioaddr = dev->base_addr;
@@ -4003,7 +4003,7 @@
  * Configure and start up the WaveLAN PCMCIA adaptor.
  * Called by NET3 when it "opens" the device.
  */
-static int wavelan_open(device * dev)
+static int wavelan_open(struct net_device * dev)
 {
 	net_local *	lp = (net_local *)dev->priv;
 	unsigned long	flags;
@@ -4058,7 +4058,7 @@
  * Shut down the WaveLAN ISA card.
  * Called by NET3 when it "closes" the device.
  */
-static int wavelan_close(device * dev)
+static int wavelan_close(struct net_device * dev)
 {
 	net_local *lp = (net_local *) dev->priv;
 	unsigned long flags;
@@ -4091,12 +4091,24 @@
  * device structure
  * (called by wavelan_probe() and via init_module()).
  */
-static int __init wavelan_config(device * dev)
+static int __init wavelan_config(struct net_device *dev, unsigned short ioaddr)
 {
-	unsigned long ioaddr = dev->base_addr;
 	u8 irq_mask;
 	int irq;
 	net_local *lp;
+	mac_addr mac;
+	int err;
+
+	if (!request_region(ioaddr, sizeof(ha_t), "wavelan"))
+		return -EADDRINUSE;
+
+	err = wv_check_ioaddr(ioaddr, mac);
+	if (err)
+		goto out;
+
+	memcpy(dev->dev_addr, mac, 6);
+
+	dev->base_addr = ioaddr;
 
 #ifdef DEBUG_CALLBACK_TRACE
 	printk(KERN_DEBUG "%s: ->wavelan_config(dev=0x%x, ioaddr=0x%lx)\n",
@@ -4136,25 +4148,18 @@
 		       "%s: wavelan_config(): could not wavelan_map_irq(%d).\n",
 		       dev->name, irq_mask);
 #endif
-		return -EAGAIN;
+		err = -EAGAIN;
+		goto out;
 	}
 
 	dev->irq = irq;
 
-	if (!request_region(ioaddr, sizeof(ha_t), "wavelan"))
-		return -EBUSY;
-
 	dev->mem_start = 0x0000;
 	dev->mem_end = 0x0000;
 	dev->if_port = 0;
 
 	/* Initialize device structures */
-	dev->priv = kmalloc(sizeof(net_local), GFP_KERNEL);
-	if (dev->priv == NULL) {
-		release_region(ioaddr, sizeof(ha_t));
-		return -ENOMEM;
-	}
-	memset(dev->priv, 0x00, sizeof(net_local));
+	memset(dev->priv, 0, sizeof(net_local));
 	lp = (net_local *) dev->priv;
 
 	/* Back link to the device structure. */
@@ -4172,12 +4177,6 @@
 	/* Init spinlock */
 	spin_lock_init(&lp->spinlock);
 
-	/*
-	 * Fill in the fields of the device structure
-	 * with generic Ethernet values.
-	 */
-	ether_setup(dev);
-
 	SET_MODULE_OWNER(dev);
 	dev->open = wavelan_open;
 	dev->stop = wavelan_close;
@@ -4204,6 +4203,9 @@
 	printk(KERN_DEBUG "%s: <-wavelan_config()\n", dev->name);
 #endif
 	return 0;
+out:
+	release_region(ioaddr, sizeof(ha_t));
+	return err;
 }
 
 /*------------------------------------------------------------------*/
@@ -4214,19 +4216,13 @@
  * We follow the example in drivers/net/ne.c.
  * (called in "Space.c")
  */
-int __init wavelan_probe(device * dev)
+struct net_device * __init wavelan_probe(int unit)
 {
+	struct net_device *dev;
 	short base_addr;
-	mac_addr mac;		/* MAC address (check existence of WaveLAN) */
+	int def_irq;
 	int i;
-	int r;
-
-#ifdef DEBUG_CALLBACK_TRACE
-	printk(KERN_DEBUG
-	       "%s: ->wavelan_probe(dev=0x%x (base_addr=0x%x))\n",
-	       dev->name, (unsigned int) dev,
-	       (unsigned int) dev->base_addr);
-#endif
+	int r = 0;
 
 #ifdef	STRUCT_CHECK
 	if (wv_struct_check() != (char *) NULL) {
@@ -4237,8 +4233,20 @@
 	}
 #endif				/* STRUCT_CHECK */
 
-	/* Check the value of the command line parameter for base address. */
+	dev = alloc_etherdev(sizeof(net_local));
+	if (!dev)
+		return ERR_PTR(-ENOMEM);
+
+	sprintf(dev->name, "eth%d", unit);
+	netdev_boot_setup_check(dev);
 	base_addr = dev->base_addr;
+	def_irq = dev->irq;
+
+#ifdef DEBUG_CALLBACK_TRACE
+	printk(KERN_DEBUG
+	       "%s: ->wavelan_probe(dev=%p (base_addr=0x%x))\n",
+	       dev->name, dev, (unsigned int) dev->base_addr);
+#endif
 
 	/* Don't probe at all. */
 	if (base_addr < 0) {
@@ -4247,16 +4255,9 @@
 		       "%s: wavelan_probe(): invalid base address\n",
 		       dev->name);
 #endif
-		return -ENXIO;
-	}
-
-	/* Check a single specified location. */
-	if (base_addr > 0x100) {
-		/* Check if there is something at this base address */
-		if ((r = wv_check_ioaddr(base_addr, mac)) == 0) {
-			memcpy(dev->dev_addr, mac, 6);	/* Copy MAC address. */
-			r = wavelan_config(dev);
-		}
+		r = -ENXIO;
+	} else if (base_addr > 0x100) { /* Check a single specified location. */
+		r = wavelan_config(dev, base_addr);
 #ifdef DEBUG_CONFIG_INFO
 		if (r != 0)
 			printk(KERN_DEBUG
@@ -4267,35 +4268,33 @@
 #ifdef DEBUG_CALLBACK_TRACE
 		printk(KERN_DEBUG "%s: <-wavelan_probe()\n", dev->name);
 #endif
-		return r;
-	}
-
-	/* Scan all possible addresses of the WaveLAN hardware. */
-	for (i = 0; i < NELS(iobase); i++) {
-		/* Check whether there is something at this base address. */
-		if (wv_check_ioaddr(iobase[i], mac) == 0) {
-			dev->base_addr = iobase[i];	/* Copy base address. */
-			memcpy(dev->dev_addr, mac, 6);	/* Copy MAC address. */
-			if (wavelan_config(dev) == 0) {
+	} else { /* Scan all possible addresses of the WaveLAN hardware. */
+		for (i = 0; i < NELS(iobase); i++) {
+			dev->irq = def_irq;
+			if (wavelan_config(dev, iobase[i]) == 0) {
 #ifdef DEBUG_CALLBACK_TRACE
 				printk(KERN_DEBUG
 				       "%s: <-wavelan_probe()\n",
 				       dev->name);
 #endif
-				return 0;
+				break;
 			}
 		}
+		if (i == NELS(iobase))
+			r = -ENODEV;
 	}
-
-	/* We may have touched base_addr.  Another driver may not like it. */
-	dev->base_addr = base_addr;
-
-#ifdef DEBUG_CONFIG_INFO
-	printk(KERN_DEBUG "%s: wavelan_probe(): no device found\n",
-	       dev->name);
-#endif
-
-	return -ENODEV;
+	if (r) 
+		goto out;
+	r = register_netdev(dev);
+	if (r)
+		goto out1;
+	return dev;
+out1:
+	release_region(dev->base_addr, sizeof(ha_t));
+	wavelan_list = wavelan_list->next;
+out:
+	free_netdev(dev);
+	return ERR_PTR(r);
 }
 
 /****************************** MODULE ******************************/
@@ -4311,7 +4310,6 @@
  */
 int init_module(void)
 {
-	mac_addr mac;		/* MAC address (check WaveLAN existence) */
 	int ret = -EIO;		/* Return error if no cards found */
 	int i;
 
@@ -4337,38 +4335,28 @@
 	/* Loop on all possible base addresses. */
 	i = -1;
 	while ((io[++i] != 0) && (i < NELS(io))) {
-		/* Check if there is something at this base address. */
-		if (wv_check_ioaddr(io[i], mac) == 0) {
-			device *dev;
-
-			/* Create device and set basic arguments. */
-			dev =
-			    kmalloc(sizeof(struct net_device), GFP_KERNEL);
-			if (dev == NULL) {
-				ret = -ENOMEM;
-				break;
-			}
-			memset(dev, 0x00, sizeof(struct net_device));
-			memcpy(dev->name, name[i], IFNAMSIZ);	/* Copy name */
-			dev->base_addr = io[i];
-			dev->irq = irq[i];
-			dev->init = &wavelan_config;
-			memcpy(dev->dev_addr, mac, 6);	/* Copy MAC address. */
+		struct net_device *dev = alloc_etherdev(sizeof(net_local));
+		if (!dev)
+			break;
+		memcpy(dev->name, name[i], IFNAMSIZ);	/* Copy name */
+		dev->base_addr = io[i];
+		dev->irq = irq[i];
 
-			/* Try to create the device. */
+		/* Check if there is something at this base address. */
+		if (wavelan_config(dev, io[i]) == 0) {
 			if (register_netdev(dev) != 0) {
-				/* Deallocate everything. */
-				/* Note: if dev->priv is mallocated, there is no way to fail. */
-				kfree(dev);
+				release_region(dev->base_addr, sizeof(ha_t));
+				wavelan_list = wavelan_list->next;
 			} else {
-				/* If at least one device OK, we do not fail */
 				ret = 0;
+				continue;
 			}
-		}		/* if there is something at the address */
-	}			/* Loop on all addresses. */
+		}
+		free_netdev(dev);
+	}
 
 #ifdef DEBUG_CONFIG_ERROR
-	if (wavelan_list == (net_local *) NULL)
+	if (!wavelan_list)
 		printk(KERN_WARNING
 		       "WaveLAN init_module(): no device found\n");
 #endif
@@ -4390,26 +4378,19 @@
 #endif
 
 	/* Loop on all devices and release them. */
-	while (wavelan_list != (net_local *) NULL) {
-		device *dev = wavelan_list->dev;
+	while (wavelan_list) {
+		struct net_device *dev = wavelan_list->dev;
 
 #ifdef DEBUG_CONFIG_INFO
 		printk(KERN_DEBUG
 		       "%s: cleanup_module(): removing device at 0x%x\n",
 		       dev->name, (unsigned int) dev);
 #endif
-
-		/* Release the ioport region. */
-		release_region(dev->base_addr, sizeof(ha_t));
-
-		/* Definitely remove the device. */
 		unregister_netdev(dev);
 
-		/* Unlink the device. */
+		release_region(dev->base_addr, sizeof(ha_t));
 		wavelan_list = wavelan_list->next;
 
-		/* Free pieces. */
-		kfree(dev->priv);
 		free_netdev(dev);
 	}
 
--- diff/drivers/net/wireless/wavelan.p.h	2003-06-09 14:18:19.000000000 +0100
+++ source/drivers/net/wireless/wavelan.p.h	2004-02-09 10:39:54.000000000 +0000
@@ -469,7 +469,6 @@
 /****************************** TYPES ******************************/
 
 /* Shortcuts */
-typedef struct net_device		device;
 typedef struct net_device_stats	en_stats;
 typedef struct iw_statistics	iw_stats;
 typedef struct iw_quality	iw_qual;
@@ -492,7 +491,7 @@
 struct net_local
 {
   net_local *	next;		/* linked list of the devices */
-  device *	dev;		/* reverse link */
+  struct net_device *	dev;		/* reverse link */
   spinlock_t	spinlock;	/* Serialize access to the hardware (SMP) */
   en_stats	stats;		/* Ethernet interface statistics */
   int		nresets;	/* number of hardware resets */
@@ -542,8 +541,8 @@
 		  u_short),	/* hacr   */
 	wv_16_on(u_long,	/* ioaddr */
 		 u_short),	/* hacr   */
-	wv_ints_off(device *),
-	wv_ints_on(device *);
+	wv_ints_off(struct net_device *),
+	wv_ints_on(struct net_device *);
 /* ----------------- MODEM MANAGEMENT SUBROUTINES ----------------- */
 static void
 	psa_read(u_long,	/* Read the Parameter Storage Area. */
@@ -592,57 +591,57 @@
 		    u_char *,	/* b */
 		    int);	/* n */
 static void
-	wv_ack(device *);
+	wv_ack(struct net_device *);
 static inline int
-	wv_synchronous_cmd(device *,
+	wv_synchronous_cmd(struct net_device *,
 			   const char *),
-	wv_config_complete(device *,
+	wv_config_complete(struct net_device *,
 			   u_long,
 			   net_local *);
 static int
-	wv_complete(device *,
+	wv_complete(struct net_device *,
 		    u_long,
 		    net_local *);
 static inline void
-	wv_82586_reconfig(device *);
+	wv_82586_reconfig(struct net_device *);
 /* ------------------- DEBUG & INFO SUBROUTINES ------------------- */
 #ifdef DEBUG_I82586_SHOW
 static void
 	wv_scb_show(unsigned short);
 #endif
 static inline void
-	wv_init_info(device *);	/* display startup info */
+	wv_init_info(struct net_device *);	/* display startup info */
 /* ------------------- IOCTL, STATS & RECONFIG ------------------- */
 static en_stats	*
-	wavelan_get_stats(device *);	/* Give stats /proc/net/dev */
+	wavelan_get_stats(struct net_device *);	/* Give stats /proc/net/dev */
 static void
-	wavelan_set_multicast_list(device *);
+	wavelan_set_multicast_list(struct net_device *);
 /* ----------------------- PACKET RECEPTION ----------------------- */
 static inline void
-	wv_packet_read(device *,	/* Read a packet from a frame. */
+	wv_packet_read(struct net_device *,	/* Read a packet from a frame. */
 		       u_short,
 		       int),
-	wv_receive(device *);	/* Read all packets waiting. */
+	wv_receive(struct net_device *);	/* Read all packets waiting. */
 /* --------------------- PACKET TRANSMISSION --------------------- */
 static inline int
-	wv_packet_write(device *,	/* Write a packet to the Tx buffer. */
+	wv_packet_write(struct net_device *,	/* Write a packet to the Tx buffer. */
 			void *,
 			short);
 static int
 	wavelan_packet_xmit(struct sk_buff *,	/* Send a packet. */
-			    device *);
+			    struct net_device *);
 /* -------------------- HARDWARE CONFIGURATION -------------------- */
 static inline int
-	wv_mmc_init(device *),		/* Initialize the modem. */
-	wv_ru_start(device *),		/* Start the i82586 receiver unit. */
-	wv_cu_start(device *),		/* Start the i82586 command unit. */
-	wv_82586_start(device *);	/* Start the i82586. */
+	wv_mmc_init(struct net_device *),	/* Initialize the modem. */
+	wv_ru_start(struct net_device *),	/* Start the i82586 receiver unit. */
+	wv_cu_start(struct net_device *),	/* Start the i82586 command unit. */
+	wv_82586_start(struct net_device *);	/* Start the i82586. */
 static void
-	wv_82586_config(device *);	/* Configure the i82586. */
+	wv_82586_config(struct net_device *);	/* Configure the i82586. */
 static inline void
-	wv_82586_stop(device *);
+	wv_82586_stop(struct net_device *);
 static int
-	wv_hw_reset(device *),		/* Reset the WaveLAN hardware. */
+	wv_hw_reset(struct net_device *),	/* Reset the WaveLAN hardware. */
 	wv_check_ioaddr(u_long,		/* ioaddr */
 			u_char *);	/* mac address (read) */
 /* ---------------------- INTERRUPT HANDLING ---------------------- */
@@ -651,14 +650,13 @@
 			  void *,
 			  struct pt_regs *);
 static void
-	wavelan_watchdog(device *);	/* transmission watchdog */
+	wavelan_watchdog(struct net_device *);	/* transmission watchdog */
 /* ------------------- CONFIGURATION CALLBACKS ------------------- */
 static int
-	wavelan_open(device *),		/* Open the device. */
-	wavelan_close(device *),	/* Close the device. */
-	wavelan_config(device *);	/* Configure one device. */
-extern int
-	wavelan_probe(device *);	/* See Space.c. */
+	wavelan_open(struct net_device *),	/* Open the device. */
+	wavelan_close(struct net_device *),	/* Close the device. */
+	wavelan_config(struct net_device *, unsigned short);/* Configure one device. */
+extern struct net_device *wavelan_probe(int unit);	/* See Space.c. */
 
 /**************************** VARIABLES ****************************/
 
--- diff/drivers/net/wireless/wavelan_cs.c	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/net/wireless/wavelan_cs.c	2004-02-09 10:39:54.000000000 +0000
@@ -131,7 +131,7 @@
  * Read the Parameter Storage Area from the WaveLAN card's memory
  */
 static void
-psa_read(device *	dev,
+psa_read(struct net_device *	dev,
 	 int		o,	/* offset in PSA */
 	 u_char *	b,	/* buffer to fill */
 	 int		n)	/* size to read */
@@ -155,7 +155,7 @@
  * Write the Paramter Storage Area to the WaveLAN card's memory
  */
 static void
-psa_write(device *	dev,
+psa_write(struct net_device *	dev,
 	  int		o,	/* Offset in psa */
 	  u_char *	b,	/* Buffer in memory */
 	  int		n)	/* Length of buffer */
@@ -229,7 +229,7 @@
  * update the checksum field in the Wavelan's PSA
  */
 static void
-update_psa_checksum(device *	dev)
+update_psa_checksum(struct net_device *	dev)
 {
 #ifdef SET_PSA_CRC
   psa_t		psa;
@@ -753,7 +753,7 @@
 }
 
 /* Called when a WavePoint beacon is received */
-static inline void wl_roam_gather(device *  dev,
+static inline void wl_roam_gather(struct net_device *  dev,
 				  u_char *  hdr,   /* Beacon header */
 				  u_char *  stats) /* SNR, Signal quality 
 						      of packet */
@@ -831,7 +831,7 @@
  *  wv_82593_config() & wv_diag())
  */
 static int
-wv_82593_cmd(device *	dev,
+wv_82593_cmd(struct net_device *	dev,
 	     char *	str,
 	     int	cmd,
 	     int	result)
@@ -942,7 +942,7 @@
  * status for the WaveLAN.
  */
 static inline int
-wv_diag(device *	dev)
+wv_diag(struct net_device *	dev)
 {
   int		ret = FALSE;
 
@@ -963,7 +963,7 @@
  * The return value is the address to use for next the call.
  */
 static int
-read_ringbuf(device *	dev,
+read_ringbuf(struct net_device *	dev,
 	     int	addr,
 	     char *	buf,
 	     int	len)
@@ -1004,10 +1004,10 @@
  * some delay sometime...
  */
 static inline void
-wv_82593_reconfig(device *	dev)
+wv_82593_reconfig(struct net_device *	dev)
 {
   net_local *		lp = (net_local *)dev->priv;
-  dev_link_t *		link = ((net_local *) dev->priv)->link;
+  dev_link_t *		link = lp->link;
   unsigned long		flags;
 
   /* Arm the flag, will be cleard in wv_82593_config() */
@@ -1132,7 +1132,7 @@
  * This function need to be completed...
  */
 static void
-wv_mmc_show(device *	dev)
+wv_mmc_show(struct net_device *	dev)
 {
   ioaddr_t	base = dev->base_addr;
   net_local *	lp = (net_local *)dev->priv;
@@ -1222,7 +1222,7 @@
  * Print the formatted status of the i82593's receive unit.
  */
 static void
-wv_ru_show(device *	dev)
+wv_ru_show(struct net_device *	dev)
 {
   net_local *lp = (net_local *) dev->priv;
 
@@ -1241,7 +1241,7 @@
  * Print the formatted status of the WaveLAN PCMCIA device driver.
  */
 static void
-wv_dev_show(device *	dev)
+wv_dev_show(struct net_device *	dev)
 {
   printk(KERN_DEBUG "dev:");
   printk(" state=%lX,", dev->state);
@@ -1256,7 +1256,7 @@
  * private information.
  */
 static void
-wv_local_show(device *	dev)
+wv_local_show(struct net_device *	dev)
 {
   net_local *lp;
 
@@ -1314,7 +1314,7 @@
  * There  is a lot of flag to configure it at your will...
  */
 static inline void
-wv_init_info(device *	dev)
+wv_init_info(struct net_device *	dev)
 {
   ioaddr_t	base = dev->base_addr;
   psa_t		psa;
@@ -1412,7 +1412,7 @@
  * Used when the user read /proc/net/dev
  */
 static en_stats	*
-wavelan_get_stats(device *	dev)
+wavelan_get_stats(struct net_device *	dev)
 {
 #ifdef DEBUG_IOCTL_TRACE
   printk(KERN_DEBUG "%s: <>wavelan_get_stats()\n", dev->name);
@@ -1431,7 +1431,7 @@
  */
 
 static void
-wavelan_set_multicast_list(device *	dev)
+wavelan_set_multicast_list(struct net_device *	dev)
 {
   net_local *	lp = (net_local *) dev->priv;
 
@@ -1529,7 +1529,7 @@
  */
 #ifdef SET_MAC_ADDRESS
 static int
-wavelan_set_mac_address(device *	dev,
+wavelan_set_mac_address(struct net_device *	dev,
 			void *		addr)
 {
   struct sockaddr *	mac = addr;
@@ -1796,7 +1796,7 @@
  * Sorry, but this function really need wireless extensions...
  */
 static inline void
-wl_spy_gather(device *	dev,
+wl_spy_gather(struct net_device *	dev,
 	      u_char *	mac,		/* MAC address */
 	      u_char *	stats)		/* Statistics to gather */
 {
@@ -1823,7 +1823,7 @@
  * or you may also calculate the mean and standard deviation of the level...
  */
 static inline void
-wl_his_gather(device *	dev,
+wl_his_gather(struct net_device *	dev,
 	      u_char *	stats)		/* Statistics to gather */
 {
   net_local *	lp = (net_local *) dev->priv;
@@ -2785,7 +2785,7 @@
  * Called by /proc/net/wireless...
  */
 static iw_stats *
-wavelan_get_wireless_stats(device *	dev)
+wavelan_get_wireless_stats(struct net_device *	dev)
 {
   ioaddr_t		base = dev->base_addr;
   net_local *		lp = (net_local *) dev->priv;
@@ -2847,7 +2847,7 @@
  * (called by wv_packet_rcv())
  */
 static inline int
-wv_start_of_frame(device *	dev,
+wv_start_of_frame(struct net_device *	dev,
 		  int		rfp,	/* end of frame */
 		  int		wrap)	/* start of buffer */
 {
@@ -2909,7 +2909,7 @@
  * (called by wv_packet_rcv())
  */
 static inline void
-wv_packet_read(device *		dev,
+wv_packet_read(struct net_device *		dev,
 	       int		fd_p,
 	       int		sksize)
 {
@@ -3012,7 +3012,7 @@
  * Note : the spinlock is already grabbed for us and irq are disabled.
  */
 static inline void
-wv_packet_rcv(device *	dev)
+wv_packet_rcv(struct net_device *	dev)
 {
   ioaddr_t	base = dev->base_addr;
   net_local *	lp = (net_local *) dev->priv;
@@ -3146,7 +3146,7 @@
  * (called in wavelan_packet_xmit())
  */
 static inline void
-wv_packet_write(device *	dev,
+wv_packet_write(struct net_device *	dev,
 		void *		buf,
 		short		length)
 {
@@ -3209,7 +3209,7 @@
  */
 static int
 wavelan_packet_xmit(struct sk_buff *	skb,
-		    device *		dev)
+		    struct net_device *		dev)
 {
   net_local *		lp = (net_local *)dev->priv;
   unsigned long		flags;
@@ -3273,7 +3273,7 @@
  * (called by wv_hw_config())
  */
 static inline int
-wv_mmc_init(device *	dev)
+wv_mmc_init(struct net_device *	dev)
 {
   ioaddr_t	base = dev->base_addr;
   psa_t		psa;
@@ -3467,7 +3467,7 @@
  * (called in wv_ru_start() and wavelan_close() and wavelan_event())
  */
 static int
-wv_ru_stop(device *	dev)
+wv_ru_stop(struct net_device *	dev)
 {
   ioaddr_t	base = dev->base_addr;
   net_local *	lp = (net_local *) dev->priv;
@@ -3530,7 +3530,7 @@
  * (called in wv_hw_reset() & wavelan_open())
  */
 static int
-wv_ru_start(device *	dev)
+wv_ru_start(struct net_device *	dev)
 {
   ioaddr_t	base = dev->base_addr;
   net_local *	lp = (net_local *) dev->priv;
@@ -3618,7 +3618,7 @@
  * (called by wv_hw_config(), wv_82593_reconfig() & wavelan_packet_xmit())
  */
 static int
-wv_82593_config(device *	dev)
+wv_82593_config(struct net_device *	dev)
 {
   ioaddr_t			base = dev->base_addr;
   net_local *			lp = (net_local *) dev->priv;
@@ -3792,7 +3792,7 @@
  * (called by wv_config())
  */
 static inline int
-wv_pcmcia_reset(device *	dev)
+wv_pcmcia_reset(struct net_device *	dev)
 {
   int		i;
   conf_reg_t	reg = { 0, CS_READ, CISREG_COR, 0 };
@@ -3854,7 +3854,7 @@
  * (called by wavelan_event() & wv_hw_reset())
  */
 static int
-wv_hw_config(device *	dev)
+wv_hw_config(struct net_device *	dev)
 {
   net_local *		lp = (net_local *) dev->priv;
   ioaddr_t		base = dev->base_addr;
@@ -3961,7 +3961,7 @@
  * (called by wavelan_event(), wavelan_watchdog() and wavelan_open())
  */
 static inline void
-wv_hw_reset(device *	dev)
+wv_hw_reset(struct net_device *	dev)
 {
   net_local *	lp = (net_local *) dev->priv;
 
@@ -4004,7 +4004,7 @@
   memreq_t		mem;
 
   handle = link->handle;
-  dev = (device *) link->priv;
+  dev = (struct net_device *) link->priv;
 
 #ifdef DEBUG_CONFIG_TRACE
   printk(KERN_DEBUG "->wv_pcmcia_config(0x%p)\n", link);
@@ -4149,7 +4149,7 @@
 static void
 wv_pcmcia_release(dev_link_t *link)
 {
-  device *	dev = (device *) link->priv;
+  struct net_device *	dev = (struct net_device *) link->priv;
 
 #ifdef DEBUG_CONFIG_TRACE
   printk(KERN_DEBUG "%s: -> wv_pcmcia_release(0x%p)\n", dev->name, link);
@@ -4199,13 +4199,13 @@
 		  void *	dev_id,
 		  struct pt_regs * regs)
 {
-  device *	dev;
+  struct net_device *	dev;
   net_local *	lp;
   ioaddr_t	base;
   int		status0;
   u_int		tx_status;
 
-  if((dev = (device *)dev_id) == (device *) NULL)
+  if ((dev = dev_id) == NULL)
     {
 #ifdef DEBUG_INTERRUPT_ERROR
       printk(KERN_WARNING "wavelan_interrupt(): irq %d for unknown device.\n",
@@ -4466,7 +4466,7 @@
  * deal with the multiple Tx buffers...
  */
 static void
-wavelan_watchdog(device *	dev)
+wavelan_watchdog(struct net_device *	dev)
 {
   net_local *		lp = (net_local *) dev->priv;
   ioaddr_t		base = dev->base_addr;
@@ -4541,7 +4541,7 @@
  * Called by NET3 when it "open" the device.
  */
 static int
-wavelan_open(device *	dev)
+wavelan_open(struct net_device *	dev)
 {
   dev_link_t *	link = ((net_local *) dev->priv)->link;
   net_local *	lp = (net_local *)dev->priv;
@@ -4596,7 +4596,7 @@
  * Called by NET3 when it "close" the device.
  */
 static int
-wavelan_close(device *	dev)
+wavelan_close(struct net_device *	dev)
 {
   dev_link_t *	link = ((net_local *) dev->priv)->link;
   ioaddr_t	base = dev->base_addr;
@@ -4660,7 +4660,7 @@
 {
   client_reg_t	client_reg;	/* Register with cardmgr */
   dev_link_t *	link;		/* Info for cardmgr */
-  device *	dev;		/* Interface generic data */
+  struct net_device *	dev;		/* Interface generic data */
   net_local *	lp;		/* Interface specific data */
   int		i, ret;
 
@@ -4698,22 +4698,14 @@
   dev_list = link;
 
   /* Allocate the generic data structure */
-  dev = kmalloc(sizeof(struct net_device), GFP_KERNEL);
+  dev = alloc_etherdev(sizeof(net_local));
   if (!dev) {
       kfree(link);
       return NULL;
   }
-  memset(dev, 0x00, sizeof(struct net_device));
   link->priv = link->irq.Instance = dev;
 
-  /* Allocate the wavelan-specific data structure. */
-  dev->priv = lp = (net_local *) kmalloc(sizeof(net_local), GFP_KERNEL);
-  if (!lp) {
-      kfree(link);
-      kfree(dev);
-      return NULL;
-  }
-  memset(lp, 0x00, sizeof(net_local));
+  lp = dev->priv;
 
   /* Init specific data */
   lp->configured = 0;
@@ -4731,9 +4723,6 @@
   lp->link = link;
   lp->dev = dev;
 
-  /* Standard setup for generic data */
-  ether_setup(dev);
-
   /* wavelan NET3 callbacks */
   SET_MODULE_OWNER(dev);
   dev->open = &wavelan_open;
@@ -4851,22 +4840,16 @@
   /* Free pieces */
   if(link->priv)
     {
-      device *	dev = (device *) link->priv;
+      struct net_device *	dev = (struct net_device *) link->priv;
 
       /* Remove ourselves from the kernel list of ethernet devices */
       /* Warning : can't be called from interrupt, timer or wavelan_close() */
-      if(link->dev != NULL)
+      if (link->dev)
 	unregister_netdev(dev);
       link->dev = NULL;
-
-      if(dev->priv)
-	{
-	  /* Sound strange, but safe... */
-	  ((net_local *) dev->priv)->link = (dev_link_t *) NULL;
-	  ((net_local *) dev->priv)->dev = (device *) NULL;
-	  kfree(dev->priv);
-	}
-      kfree(link->priv);
+      ((net_local *) dev->priv)->link = NULL;
+      ((net_local *) dev->priv)->dev = NULL;
+      free_netdev(dev);
     }
   kfree(link);
 
@@ -4888,7 +4871,7 @@
 	      event_callback_args_t *	args)
 {
   dev_link_t *	link = (dev_link_t *) args->client_data;
-  device *	dev = (device *) link->priv;
+  struct net_device *	dev = (struct net_device *) link->priv;
 
 #ifdef DEBUG_CALLBACK_TRACE
   printk(KERN_DEBUG "->wavelan_event(): %s\n",
--- diff/drivers/net/wireless/wavelan_cs.p.h	2003-09-30 15:46:16.000000000 +0100
+++ source/drivers/net/wireless/wavelan_cs.p.h	2004-02-09 10:39:54.000000000 +0000
@@ -588,7 +588,6 @@
 /****************************** TYPES ******************************/
 
 /* Shortcuts */
-typedef struct net_device	device;
 typedef struct net_device_stats	en_stats;
 typedef struct iw_statistics	iw_stats;
 typedef struct iw_quality	iw_qual;
@@ -611,7 +610,7 @@
 struct net_local
 {
   dev_node_t 	node;		/* ???? What is this stuff ???? */
-  device *	dev;		/* Reverse link... */
+  struct net_device *	dev;		/* Reverse link... */
   spinlock_t	spinlock;	/* Serialize access to the hardware (SMP) */
   dev_link_t *	link;		/* pcmcia structure */
   en_stats	stats;		/* Ethernet interface statistics */
@@ -673,11 +672,11 @@
 	hacr_write_slow(u_long,
 		   u_char);
 static void
-	psa_read(device *,	/* Read the Parameter Storage Area */
+	psa_read(struct net_device *,	/* Read the Parameter Storage Area */
 		 int,		/* offset in PSA */
 		 u_char *,	/* buffer to fill */
 		 int),		/* size to read */
-	psa_write(device *,	/* Write to the PSA */
+	psa_write(struct net_device *,	/* Write to the PSA */
 		  int,		/* Offset in psa */
 		  u_char *,	/* Buffer in memory */
 		  int);		/* Length of buffer */
@@ -707,57 +706,57 @@
 		 int);		/* number of registers */
 /* ---------------------- I82593 SUBROUTINES ----------------------- */
 static int
-	wv_82593_cmd(device *,	/* synchronously send a command to i82593 */ 
+	wv_82593_cmd(struct net_device *,	/* synchronously send a command to i82593 */ 
 		     char *,
 		     int,
 		     int);
 static inline int
-	wv_diag(device *);	/* Diagnostique the i82593 */
+	wv_diag(struct net_device *);	/* Diagnostique the i82593 */
 static int
-	read_ringbuf(device *,	/* Read a receive buffer */
+	read_ringbuf(struct net_device *,	/* Read a receive buffer */
 		     int,
 		     char *,
 		     int);
 static inline void
-	wv_82593_reconfig(device *);	/* Reconfigure the controller */
+	wv_82593_reconfig(struct net_device *);	/* Reconfigure the controller */
 /* ------------------- DEBUG & INFO SUBROUTINES ------------------- */
 static inline void
-	wv_init_info(device *);	/* display startup info */
+	wv_init_info(struct net_device *);	/* display startup info */
 /* ------------------- IOCTL, STATS & RECONFIG ------------------- */
 static en_stats	*
-	wavelan_get_stats(device *);	/* Give stats /proc/net/dev */
+	wavelan_get_stats(struct net_device *);	/* Give stats /proc/net/dev */
 /* ----------------------- PACKET RECEPTION ----------------------- */
 static inline int
-	wv_start_of_frame(device *,	/* Seek beggining of current frame */
+	wv_start_of_frame(struct net_device *,	/* Seek beggining of current frame */
 			  int,	/* end of frame */
 			  int);	/* start of buffer */
 static inline void
-	wv_packet_read(device *,	/* Read a packet from a frame */
+	wv_packet_read(struct net_device *,	/* Read a packet from a frame */
 		       int,
 		       int),
-	wv_packet_rcv(device *);	/* Read all packets waiting */
+	wv_packet_rcv(struct net_device *);	/* Read all packets waiting */
 /* --------------------- PACKET TRANSMISSION --------------------- */
 static inline void
-	wv_packet_write(device *,	/* Write a packet to the Tx buffer */
+	wv_packet_write(struct net_device *,	/* Write a packet to the Tx buffer */
 			void *,
 			short);
 static int
 	wavelan_packet_xmit(struct sk_buff *,	/* Send a packet */
-			    device *);
+			    struct net_device *);
 /* -------------------- HARDWARE CONFIGURATION -------------------- */
 static inline int
-	wv_mmc_init(device *);	/* Initialize the modem */
+	wv_mmc_init(struct net_device *);	/* Initialize the modem */
 static int
-	wv_ru_stop(device *),	/* Stop the i82593 receiver unit */
-	wv_ru_start(device *);	/* Start the i82593 receiver unit */
+	wv_ru_stop(struct net_device *),	/* Stop the i82593 receiver unit */
+	wv_ru_start(struct net_device *);	/* Start the i82593 receiver unit */
 static int
-	wv_82593_config(device *);	/* Configure the i82593 */
+	wv_82593_config(struct net_device *);	/* Configure the i82593 */
 static inline int
-	wv_pcmcia_reset(device *);	/* Reset the pcmcia interface */
+	wv_pcmcia_reset(struct net_device *);	/* Reset the pcmcia interface */
 static int
-	wv_hw_config(device *);	/* Reset & configure the whole hardware */
+	wv_hw_config(struct net_device *);	/* Reset & configure the whole hardware */
 static inline void
-	wv_hw_reset(device *);	/* Same, + start receiver unit */
+	wv_hw_reset(struct net_device *);	/* Same, + start receiver unit */
 static inline int
 	wv_pcmcia_config(dev_link_t *);	/* Configure the pcmcia interface */
 static void
@@ -768,11 +767,11 @@
 			  void *,
 			  struct pt_regs *);
 static void
-	wavelan_watchdog(device *);	/* Transmission watchdog */
+	wavelan_watchdog(struct net_device *);	/* Transmission watchdog */
 /* ------------------- CONFIGURATION CALLBACKS ------------------- */
 static int
-	wavelan_open(device *),		/* Open the device */
-	wavelan_close(device *);	/* Close the device */
+	wavelan_open(struct net_device *),		/* Open the device */
+	wavelan_close(struct net_device *);	/* Close the device */
 static dev_link_t *
 	wavelan_attach(void);		/* Create a new device */
 static void
--- diff/drivers/net/wireless/wl3501_cs.c	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/net/wireless/wl3501_cs.c	2004-02-09 10:39:54.000000000 +0000
@@ -1449,18 +1449,6 @@
 	goto out;
 }
 
-/**
- * wl3501_init - "initialize" board
- * @dev - network device
- *
- * We never need to do anything when a wl3501 device is "initialized" by the net
- * software, because we only register already-found cards.
- */
-static int wl3501_init(struct net_device *dev)
-{
-	return 0;
-}
-
 struct net_device_stats *wl3501_get_stats(struct net_device *dev)
 {
 	struct wl3501_card *this = dev->priv;
@@ -1592,7 +1580,7 @@
 	*linkp = link->next;
 
 	if (link->priv)
-		kfree(link->priv);
+		free_netdev(link->priv);
 	kfree(link);
 out:
 	return;
@@ -2056,7 +2044,6 @@
 	dev = alloc_etherdev(sizeof(struct wl3501_card));
 	if (!dev)
 		goto out_link;
-	dev->init		= wl3501_init;
 	dev->open		= wl3501_open;
 	dev->stop		= wl3501_close;
 	dev->hard_start_xmit	= wl3501_hard_start_xmit;
--- diff/drivers/net/yellowfin.c	2003-09-17 12:28:09.000000000 +0100
+++ source/drivers/net/yellowfin.c	2004-02-09 10:39:54.000000000 +0000
@@ -1286,7 +1286,8 @@
 
 #if defined(__i386__)
 	if (yellowfin_debug > 2) {
-		printk("\n"KERN_DEBUG"  Tx ring at %8.8x:\n", yp->tx_ring_dma);
+		printk("\n"KERN_DEBUG"  Tx ring at %8.8llx:\n",
+				(unsigned long long)yp->tx_ring_dma);
 		for (i = 0; i < TX_RING_SIZE*2; i++)
 			printk(" %c #%d desc. %8.8x %8.8x %8.8x %8.8x.\n",
 				   inl(ioaddr + TxPtr) == (long)&yp->tx_ring[i] ? '>' : ' ',
@@ -1298,7 +1299,8 @@
 				   i, yp->tx_status[i].tx_cnt, yp->tx_status[i].tx_errs,
 				   yp->tx_status[i].total_tx_cnt, yp->tx_status[i].paused);
 
-		printk("\n"KERN_DEBUG "  Rx ring %8.8x:\n", yp->rx_ring_dma);
+		printk("\n"KERN_DEBUG "  Rx ring %8.8llx:\n",
+				(unsigned long long)yp->rx_ring_dma);
 		for (i = 0; i < RX_RING_SIZE; i++) {
 			printk(KERN_DEBUG " %c #%d desc. %8.8x %8.8x %8.8x\n",
 				   inl(ioaddr + RxPtr) == (long)&yp->rx_ring[i] ? '>' : ' ',
--- diff/drivers/net/znet.c	2003-08-26 10:00:53.000000000 +0100
+++ source/drivers/net/znet.c	2004-02-09 10:39:54.000000000 +0000
@@ -372,10 +372,8 @@
 	struct znet_private *znet;
 	struct net_device *dev;
 	char *p;
+	int err = -ENOMEM;
 
-	if (znet_dev)				/* Only look for a single adaptor */
-		return -ENODEV;
-	
 	/* This code scans the region 0xf0000 to 0xfffff for a "NETIDBLK". */
 	for(p = (char *)phys_to_virt(0xf0000); p < (char *)phys_to_virt(0x100000); p++)
 		if (*p == 'N'  &&  strncmp(p, "NETIDBLK", 8) == 0)
@@ -387,12 +385,14 @@
 		return -ENODEV;
 	}
 
-	if (!(znet_dev = dev = init_etherdev(0, sizeof(struct znet_private))))
-			return -ENOMEM;
+	dev = alloc_etherdev(sizeof(struct znet_private));
+	if (!dev)
+		return -ENOMEM;
+
+	SET_MODULE_OWNER (dev);
 
 	znet = dev->priv;
 
-	SET_MODULE_OWNER (dev);
 	netinfo = (struct netidblk *)p;
 	dev->base_addr = netinfo->iobase1;
 	dev->irq = netinfo->irq1;
@@ -430,7 +430,7 @@
 	znet->io_size  = 2;
 
 	if (!(znet->rx_start = kmalloc (DMA_BUF_SIZE, GFP_KERNEL | GFP_DMA)))
-		goto free_netdev;
+		goto free_dev;
 	if (!(znet->tx_start = kmalloc (DMA_BUF_SIZE, GFP_KERNEL | GFP_DMA)))
 		goto free_rx;
 
@@ -452,19 +452,19 @@
 	dev->set_multicast_list = &znet_set_multicast_list;
 	dev->tx_timeout = znet_tx_timeout;
 	dev->watchdog_timeo = TX_TIMEOUT;
-
+	err = register_netdev(dev);
+	if (err)
+		goto free_tx;
+	znet_dev = dev;
 	return 0;
 
  free_tx:
-	kfree (znet->tx_start);
+	kfree(znet->tx_start);
  free_rx:
-	kfree (znet->rx_start);
- free_netdev:
-	unregister_netdev (dev);
-	kfree (dev);
-	znet_dev = NULL;
-
-	return -ENOMEM;
+	kfree(znet->rx_start);
+ free_dev:
+	free_netdev(dev);
+	return err;
 }
 
 
@@ -934,16 +934,14 @@
 
 static __exit void znet_cleanup (void)
 {
-#ifdef MODULE
 	if (znet_dev) {
 		struct znet_private *znet = znet_dev->priv;
 
+		unregister_netdev (znet_dev);
 		kfree (znet->rx_start);
 		kfree (znet->tx_start);
-		unregister_netdev (znet_dev);
 		free_netdev (znet_dev);
 	}
-#endif
 }
 
 module_init (znet_probe);
--- diff/drivers/net/zorro8390.c	2003-08-26 10:00:53.000000000 +0100
+++ source/drivers/net/zorro8390.c	2004-02-09 10:39:54.000000000 +0000
@@ -103,18 +103,18 @@
 	    continue;
 	board = z->resource.start;
 	ioaddr = board+cards[i].offset;
-	dev = init_etherdev(0, 0);
-	SET_MODULE_OWNER(dev);
+	dev = alloc_ei_netdev();
 	if (!dev)
 	    return -ENOMEM;
+	SET_MODULE_OWNER(dev);
 	if (!request_mem_region(ioaddr, NE_IO_EXTENT*2, dev->name)) {
-	    kfree(dev);
+	    free_netdev(dev);
 	    continue;
 	}
 	if ((err = zorro8390_init(dev, board, cards[i].name,
 				  ZTWO_VADDR(ioaddr)))) {
 	    release_mem_region(ioaddr, NE_IO_EXTENT*2);
-	    kfree(dev);
+	    free_netdev(dev);
 	    return err;
 	}
 	err = 0;
@@ -129,6 +129,7 @@
 				 const char *name, unsigned long ioaddr)
 {
     int i;
+    int err;
     unsigned char SA_prom[32];
     int start_page, stop_page;
     static u32 zorro8390_offsets[16] = {
@@ -195,12 +196,6 @@
     i = request_irq(IRQ_AMIGA_PORTS, ei_interrupt, SA_SHIRQ, dev->name, dev);
     if (i) return i;
 
-    /* Allocate dev->priv and fill in 8390 specific dev fields. */
-    if (ethdev_init(dev)) {
-	printk("Unable to get memory for dev->priv.\n");
-	return -ENOMEM;
-    }
-
     for(i = 0; i < ETHER_ADDR_LEN; i++) {
 #ifdef DEBUG
 	printk(" %2.2x", SA_prom[i]);
@@ -227,12 +222,18 @@
     ei_status.reg_offset = zorro8390_offsets;
     dev->open = &zorro8390_open;
     dev->stop = &zorro8390_close;
+#ifdef CONFIG_NET_POLL_CONTROLLER
+    dev->poll_controller = ei_poll;
+#endif
 #ifdef MODULE
     ei_status.priv = (unsigned long)root_zorro8390_dev;
     root_zorro8390_dev = dev;
 #endif
     NS8390_init(dev, 0);
-    return 0;
+    err = register_netdev(dev);
+    if (err)
+	free_irq(IRQ_AMIGA_PORTS, dev);
+    return err;
 }
 
 static int zorro8390_open(struct net_device *dev)
--- diff/drivers/oprofile/cpu_buffer.c	2003-06-09 14:18:19.000000000 +0100
+++ source/drivers/oprofile/cpu_buffer.c	2004-02-09 10:39:54.000000000 +0000
@@ -86,9 +86,9 @@
 	unsigned long tail = b->tail_pos;
 
 	if (tail > head)
-		return tail - head;
+		return (tail - head) - 1;
 
-	return tail + (b->buffer_size - head);
+	return tail + (b->buffer_size - head) - 1;
 }
 
 
--- diff/drivers/parisc/dino.c	2004-01-19 10:22:58.000000000 +0000
+++ source/drivers/parisc/dino.c	2004-02-09 10:39:54.000000000 +0000
@@ -475,7 +475,7 @@
 
 	res = &dino_dev->hba.lmmio_space;
 	res->flags = IORESOURCE_MEM;
-	size = snprintf(name, sizeof(name), "Dino LMMIO (%s)", bus->dev->bus_id);
+	size = scnprintf(name, sizeof(name), "Dino LMMIO (%s)", bus->dev->bus_id);
 	res->name = kmalloc(size+1, GFP_KERNEL);
 	if(res->name)
 		strcpy((char *)res->name, name);
--- diff/drivers/parport/daisy.c	2002-12-11 11:50:25.000000000 +0000
+++ source/drivers/parport/daisy.c	2004-02-09 10:39:54.000000000 +0000
@@ -40,6 +40,7 @@
 	int daisy;
 	int devnum;
 } *topology = NULL;
+static spinlock_t topology_lock = SPIN_LOCK_UNLOCKED;
 
 static int numdevs = 0;
 
@@ -52,22 +53,18 @@
 /* Add a device to the discovered topology. */
 static void add_dev (int devnum, struct parport *port, int daisy)
 {
-	struct daisydev *newdev;
+	struct daisydev *newdev, **p;
 	newdev = kmalloc (sizeof (struct daisydev), GFP_KERNEL);
 	if (newdev) {
 		newdev->port = port;
 		newdev->daisy = daisy;
 		newdev->devnum = devnum;
-		newdev->next = topology;
-		if (!topology || topology->devnum >= devnum)
-			topology = newdev;
-		else {
-			struct daisydev *prev = topology;
-			while (prev->next && prev->next->devnum < devnum)
-				prev = prev->next;
-			newdev->next = prev->next;
-			prev->next = newdev;
-		}
+		spin_lock(&topology_lock);
+		for (p = &topology; *p && (*p)->devnum<devnum; p = &(*p)->next)
+			;
+		newdev->next = *p;
+		*p = newdev;
+		spin_unlock(&topology_lock);
 	}
 }
 
@@ -157,26 +154,25 @@
 /* Forget about devices on a physical port. */
 void parport_daisy_fini (struct parport *port)
 {
-	struct daisydev *dev, *prev = topology;
-	while (prev && prev->port == port) {
-		topology = topology->next;
-		kfree (prev);
-		prev = topology;
-	}
+	struct daisydev **p;
 
-	while (prev) {
-		dev = prev->next;
-		if (dev && dev->port == port) {
-			prev->next = dev->next;
-			kfree (dev);
+	spin_lock(&topology_lock);
+	p = &topology;
+	while (*p) {
+		struct daisydev *dev = *p;
+		if (dev->port != port) {
+			p = &dev->next;
+			continue;
 		}
-		prev = prev->next;
+		*p = dev->next;
+		kfree(dev);
 	}
 
 	/* Gaps in the numbering could be handled better.  How should
            someone enumerate through all IEEE1284.3 devices in the
            topology?. */
 	if (!topology) numdevs = 0;
+	spin_unlock(&topology_lock);
 	return;
 }
 
@@ -205,30 +201,34 @@
 				void (*irqf) (int, void *, struct pt_regs *),
 				int flags, void *handle)
 {
-	struct parport *port = parport_enumerate ();
+	struct daisydev *p = topology;
+	struct parport *port;
 	struct pardevice *dev;
-	int portnum;
-	int muxnum;
-	int daisynum;
-
-	if (parport_device_coords (devnum,  &portnum, &muxnum, &daisynum))
-		return NULL;
+	int daisy;
 
-	while (port && ((port->portnum != portnum) ||
-			(port->muxport != muxnum)))
-		port = port->next;
+	spin_lock(&topology_lock);
+	while (p && p->devnum != devnum)
+		p = p->next;
 
-	if (!port)
-		/* No corresponding parport. */
+	if (!p) {
+		spin_unlock(&topology_lock);
 		return NULL;
+	}
+
+	daisy = p->daisy;
+	port = parport_get_port(p->port);
+	spin_unlock(&topology_lock);
 
 	dev = parport_register_device (port, name, pf, kf,
 				       irqf, flags, handle);
-	if (dev)
-		dev->daisy = daisynum;
+	parport_put_port(port);
+	if (!dev)
+		return NULL;
+
+	dev->daisy = daisy;
 
 	/* Check that there really is a device to select. */
-	if (daisynum >= 0) {
+	if (daisy >= 0) {
 		int selected;
 		parport_claim_or_block (dev);
 		selected = port->daisy;
@@ -271,16 +271,19 @@
 
 int parport_device_num (int parport, int mux, int daisy)
 {
-	struct daisydev *dev = topology;
+	int res = -ENXIO;
+	struct daisydev *dev;
 
+	spin_lock(&topology_lock);
+	dev = topology;
 	while (dev && dev->port->portnum != parport &&
 	       dev->port->muxport != mux && dev->daisy != daisy)
 		dev = dev->next;
+	if (dev)
+		res = dev->devnum;
+	spin_unlock(&topology_lock);
 
-	if (!dev)
-		return -ENXIO;
-
-	return dev->devnum;
+	return res;
 }
 
 /**
@@ -310,17 +313,23 @@
 
 int parport_device_coords (int devnum, int *parport, int *mux, int *daisy)
 {
-	struct daisydev *dev = topology;
+	struct daisydev *dev;
 
+	spin_lock(&topology_lock);
+
+	dev = topology;
 	while (dev && dev->devnum != devnum)
 		dev = dev->next;
 
-	if (!dev)
+	if (!dev) {
+		spin_unlock(&topology_lock);
 		return -ENXIO;
+	}
 
 	if (parport) *parport = dev->port->portnum;
 	if (mux) *mux = dev->port->muxport;
 	if (daisy) *daisy = dev->daisy;
+	spin_unlock(&topology_lock);
 	return 0;
 }
 
@@ -557,9 +566,13 @@
 
 int parport_find_device (const char *mfg, const char *mdl, int from)
 {
-	struct daisydev *d = topology; /* sorted by devnum */
+	struct daisydev *d;
+	int res = -1;
 
 	/* Find where to start. */
+
+	spin_lock(&topology_lock);
+	d = topology; /* sorted by devnum */
 	while (d && d->devnum <= from)
 		d = d->next;
 
@@ -575,9 +588,10 @@
 	}
 
 	if (d)
-		return d->devnum;
+		res = d->devnum;
 
-	return -1;
+	spin_unlock(&topology_lock);
+	return res;
 }
 
 /**
@@ -601,8 +615,11 @@
 
 int parport_find_class (parport_device_class cls, int from)
 {
-	struct daisydev *d = topology; /* sorted by devnum */
+	struct daisydev *d;
+	int res = -1;
 
+	spin_lock(&topology_lock);
+	d = topology; /* sorted by devnum */
 	/* Find where to start. */
 	while (d && d->devnum <= from)
 		d = d->next;
@@ -612,7 +629,8 @@
 		d = d->next;
 
 	if (d)
-		return d->devnum;
+		res = d->devnum;
 
-	return -1;
+	spin_unlock(&topology_lock);
+	return res;
 }
--- diff/drivers/parport/parport_gsc.c	2003-06-30 10:07:29.000000000 +0100
+++ source/drivers/parport/parport_gsc.c	2004-02-09 10:39:54.000000000 +0000
@@ -445,6 +445,7 @@
 
 static int __devinit parport_init_chip(struct parisc_device *dev)
 {
+	struct parport *p;
 	unsigned long port;
 
 	if (!dev->irq) {
@@ -467,13 +468,36 @@
 		printk("%s: enhanced parport-modes not supported.\n", __FUNCTION__);
 	}
 	
-	if (parport_gsc_probe_port(port, 0, dev->irq,
-			/* PARPORT_IRQ_NONE */ PARPORT_DMA_NONE, NULL))
+	p = parport_gsc_probe_port(port, 0, dev->irq,
+			/* PARPORT_IRQ_NONE */ PARPORT_DMA_NONE, NULL);
+	if (p)
 		parport_count++;
+	dev->dev.driver_data = p;
 
 	return 0;
 }
 
+static void __devexit parport_remove_chip(struct parisc_device *dev)
+{
+	struct parport *p = dev->dev.driver_data;
+	if (p) {
+		struct parport_gsc_private *priv = p->private_data;
+		struct parport_operations *ops = p->ops;
+		if (p->dma != PARPORT_DMA_NONE)
+			free_dma(p->dma);
+		if (p->irq != PARPORT_IRQ_NONE)
+			free_irq(p->irq, p);
+		parport_proc_unregister(p);
+		if (priv->dma_buf)
+			pci_free_consistent(priv->dev, PAGE_SIZE,
+					    priv->dma_buf,
+					    priv->dma_handle);
+		kfree (p->private_data);
+		parport_unregister_port(p);
+		kfree (ops); /* hope no-one cached it */
+	}
+}
+
 static struct parisc_device_id parport_tbl[] = {
 	{ HPHW_FIO, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x74 },
 	{ 0, }
@@ -485,6 +509,7 @@
 	.name		= "Parallel",
 	.id_table	= parport_tbl,
 	.probe		= parport_init_chip,
+	.remove		= parport_remove_chip,
 };
 
 int __devinit parport_gsc_init(void)
@@ -494,27 +519,6 @@
 
 static void __devexit parport_gsc_exit(void)
 {
-	struct parport *p = parport_enumerate(), *tmp;
-	while (p) {
-		tmp = p->next;
-		if (p->modes & PARPORT_MODE_PCSPP) { 
-			struct parport_gsc_private *priv = p->private_data;
-			struct parport_operations *ops = p->ops;
-			if (p->dma != PARPORT_DMA_NONE)
-				free_dma(p->dma);
-			if (p->irq != PARPORT_IRQ_NONE)
-				free_irq(p->irq, p);
-			parport_proc_unregister(p);
-			if (priv->dma_buf)
-				pci_free_consistent(priv->dev, PAGE_SIZE,
-						    priv->dma_buf,
-						    priv->dma_handle);
-			kfree (p->private_data);
-			parport_unregister_port(p);
-			kfree (ops); /* hope no-one cached it */
-		}
-		p = tmp;
-	}
 	unregister_parisc_driver(&parport_driver);
 }
 
--- diff/drivers/parport/parport_pc.c	2003-10-27 09:20:43.000000000 +0000
+++ source/drivers/parport/parport_pc.c	2004-02-09 10:39:54.000000000 +0000
@@ -270,95 +270,6 @@
 	return IRQ_HANDLED;
 }
 
-void parport_pc_write_data(struct parport *p, unsigned char d)
-{
-	outb (d, DATA (p));
-}
-
-unsigned char parport_pc_read_data(struct parport *p)
-{
-	return inb (DATA (p));
-}
-
-void parport_pc_write_control(struct parport *p, unsigned char d)
-{
-	const unsigned char wm = (PARPORT_CONTROL_STROBE |
-				  PARPORT_CONTROL_AUTOFD |
-				  PARPORT_CONTROL_INIT |
-				  PARPORT_CONTROL_SELECT);
-
-	/* Take this out when drivers have adapted to the newer interface. */
-	if (d & 0x20) {
-		printk (KERN_DEBUG "%s (%s): use data_reverse for this!\n",
-			p->name, p->cad->name);
-		parport_pc_data_reverse (p);
-	}
-
-	__parport_pc_frob_control (p, wm, d & wm);
-}
-
-unsigned char parport_pc_read_control(struct parport *p)
-{
-	const unsigned char wm = (PARPORT_CONTROL_STROBE |
-				  PARPORT_CONTROL_AUTOFD |
-				  PARPORT_CONTROL_INIT |
-				  PARPORT_CONTROL_SELECT);
-	const struct parport_pc_private *priv = p->physport->private_data;
-	return priv->ctr & wm; /* Use soft copy */
-}
-
-unsigned char parport_pc_frob_control (struct parport *p, unsigned char mask,
-				       unsigned char val)
-{
-	const unsigned char wm = (PARPORT_CONTROL_STROBE |
-				  PARPORT_CONTROL_AUTOFD |
-				  PARPORT_CONTROL_INIT |
-				  PARPORT_CONTROL_SELECT);
-
-	/* Take this out when drivers have adapted to the newer interface. */
-	if (mask & 0x20) {
-		printk (KERN_DEBUG "%s (%s): use data_%s for this!\n",
-			p->name, p->cad->name,
-			(val & 0x20) ? "reverse" : "forward");
-		if (val & 0x20)
-			parport_pc_data_reverse (p);
-		else
-			parport_pc_data_forward (p);
-	}
-
-	/* Restrict mask and val to control lines. */
-	mask &= wm;
-	val &= wm;
-
-	return __parport_pc_frob_control (p, mask, val);
-}
-
-unsigned char parport_pc_read_status(struct parport *p)
-{
-	return inb (STATUS (p));
-}
-
-void parport_pc_disable_irq(struct parport *p)
-{
-	__parport_pc_frob_control (p, 0x10, 0);
-}
-
-void parport_pc_enable_irq(struct parport *p)
-{
-	if (p->irq != PARPORT_IRQ_NONE)
-		__parport_pc_frob_control (p, 0x10, 0x10);
-}
-
-void parport_pc_data_forward (struct parport *p)
-{
-	__parport_pc_frob_control (p, 0x20, 0);
-}
-
-void parport_pc_data_reverse (struct parport *p)
-{
-	__parport_pc_frob_control (p, 0x20, 0x20);
-}
-
 void parport_pc_init_state(struct pardevice *dev, struct parport_state *s)
 {
 	s->u.pc.ctr = 0xc;
@@ -418,7 +329,8 @@
 				left -= 16;
 			} else {
 				/* grab single byte from the warp fifo */
-				*((char *)buf)++ = inb (EPPDATA (port));
+				*((char *)buf) = inb (EPPDATA (port));
+				buf++;
 				got++;
 				left--;
 			}
@@ -445,7 +357,8 @@
 		return length;
 	}
 	for (; got < length; got++) {
-		*((char*)buf)++ = inb (EPPDATA(port));
+		*((char*)buf) = inb (EPPDATA(port));
+		buf++;
 		if (inb (STATUS (port)) & 0x01) {
 			/* EPP timeout */
 			clear_epp_timeout (port);
@@ -474,7 +387,8 @@
 		return length;
 	}
 	for (; written < length; written++) {
-		outb (*((char*)buf)++, EPPDATA(port));
+		outb (*((char*)buf), EPPDATA(port));
+		buf++;
 		if (inb (STATUS(port)) & 0x01) {
 			clear_epp_timeout (port);
 			break;
@@ -498,7 +412,8 @@
 		return length;
 	}
 	for (; got < length; got++) {
-		*((char*)buf)++ = inb (EPPADDR (port));
+		*((char*)buf) = inb (EPPADDR (port));
+		buf++;
 		if (inb (STATUS (port)) & 0x01) {
 			clear_epp_timeout (port);
 			break;
@@ -523,7 +438,8 @@
 		return length;
 	}
 	for (; written < length; written++) {
-		outb (*((char*)buf)++, EPPADDR (port));
+		outb (*((char*)buf), EPPADDR (port));
+		buf++;
 		if (inb (STATUS (port)) & 0x01) {
 			clear_epp_timeout (port);
 			break;
@@ -1235,6 +1151,8 @@
  *	******************************************
  */
 
+/* GCC is not inlining extern inline function later overwriten to non-inline,
+   so we use outlined_ variants here.  */
 struct parport_operations parport_pc_ops = 
 {
 	.write_data	= parport_pc_write_data,
@@ -2686,25 +2604,10 @@
 
 
 enum parport_pc_pci_cards {
-	siig_1s1p_10x_550 = last_sio,
-	siig_1s1p_10x_650,
-	siig_1s1p_10x_850,
-	siig_1p_10x,
+	siig_1p_10x = last_sio,
 	siig_2p_10x,
-	siig_2s1p_10x_550,
-	siig_2s1p_10x_650,
-	siig_2s1p_10x_850,
 	siig_1p_20x,
 	siig_2p_20x,
-	siig_2p1s_20x_550,
-	siig_2p1s_20x_650,
-	siig_2p1s_20x_850,
-	siig_1s1p_20x_550,
-	siig_1s1p_20x_650,
-	siig_1s1p_20x_850,
-	siig_2s1p_20x_550,
-	siig_2s1p_20x_650,
-	siig_2s1p_20x_850,
 	lava_parallel,
 	lava_parallel_dual_a,
 	lava_parallel_dual_b,
@@ -2766,25 +2669,10 @@
 	 * is non-zero we couldn't use any of the ports. */
 	void (*postinit_hook) (struct pci_dev *pdev, int failed);
 } cards[] __devinitdata = {
-	/* siig_1s1p_10x_550 */		{ 1, { { 3, 4 }, } },
-	/* siig_1s1p_10x_650 */		{ 1, { { 3, 4 }, } },
-	/* siig_1s1p_10x_850 */		{ 1, { { 3, 4 }, } },
 	/* siig_1p_10x */		{ 1, { { 2, 3 }, } },
 	/* siig_2p_10x */		{ 2, { { 2, 3 }, { 4, 5 }, } },
-	/* siig_2s1p_10x_550 */		{ 1, { { 4, 5 }, } },
-	/* siig_2s1p_10x_650 */		{ 1, { { 4, 5 }, } },
-	/* siig_2s1p_10x_850 */		{ 1, { { 4, 5 }, } },
 	/* siig_1p_20x */		{ 1, { { 0, 1 }, } },
 	/* siig_2p_20x */		{ 2, { { 0, 1 }, { 2, 3 }, } },
-	/* siig_2p1s_20x_550 */		{ 2, { { 1, 2 }, { 3, 4 }, } },
-	/* siig_2p1s_20x_650 */		{ 2, { { 1, 2 }, { 3, 4 }, } },
-	/* siig_2p1s_20x_850 */		{ 2, { { 1, 2 }, { 3, 4 }, } },
-	/* siig_1s1p_20x_550 */		{ 1, { { 1, 2 }, } },
-	/* siig_1s1p_20x_650 */		{ 1, { { 1, 2 }, } },
-	/* siig_1s1p_20x_850 */		{ 1, { { 1, 2 }, } },
-	/* siig_2s1p_20x_550 */		{ 1, { { 2, 3 }, } },
-	/* siig_2s1p_20x_650 */		{ 1, { { 2, 3 }, } },
-	/* siig_2s1p_20x_850 */		{ 1, { { 2, 3 }, } },
 	/* lava_parallel */		{ 1, { { 0, -1 }, } },
 	/* lava_parallel_dual_a */	{ 1, { { 0, -1 }, } },
 	/* lava_parallel_dual_b */	{ 1, { { 0, -1 }, } },
@@ -2836,44 +2724,14 @@
 	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, sio_ite_8872 },
 
 	/* PCI cards */
-	{ PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S1P_10x_550,
-	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, siig_1s1p_10x_550 },
-	{ PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S1P_10x_650,
-	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, siig_1s1p_10x_650 },
-	{ PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S1P_10x_850,
-	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, siig_1s1p_10x_850 },
 	{ PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1P_10x,
 	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, siig_1p_10x },
 	{ PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2P_10x,
 	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, siig_2p_10x },
-	{ PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S1P_10x_550,
-	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, siig_2s1p_10x_550 },
-	{ PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S1P_10x_650,
-	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, siig_2s1p_10x_650 },
-	{ PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S1P_10x_850,
-	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, siig_2s1p_10x_850 },
 	{ PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1P_20x,
 	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, siig_1p_20x },
 	{ PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2P_20x,
 	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, siig_2p_20x },
-	{ PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2P1S_20x_550,
-	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, siig_2p1s_20x_550 },
-	{ PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2P1S_20x_650,
-	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, siig_2p1s_20x_650 },
-	{ PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2P1S_20x_850,
-	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, siig_2p1s_20x_850 },
-	{ PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S1P_20x_550,
-	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, siig_2s1p_20x_550 },
-	{ PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S1P_20x_650,
-	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, siig_1s1p_20x_650 },
-	{ PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S1P_20x_850,
-	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, siig_1s1p_20x_850 },
-	{ PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S1P_20x_550,
-	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, siig_2s1p_20x_550 },
-	{ PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S1P_20x_650,
-	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, siig_2s1p_20x_650 },
-	{ PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S1P_20x_850,
-	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, siig_2s1p_20x_850 },
 	{ PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_PARALLEL,
 	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, lava_parallel },
 	{ PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_DUAL_PAR_A,
--- diff/drivers/parport/share.c	2003-05-21 11:49:55.000000000 +0100
+++ source/drivers/parport/share.c	2004-02-09 10:39:54.000000000 +0000
@@ -44,8 +44,13 @@
 static struct parport *portlist = NULL, *portlist_tail = NULL;
 static spinlock_t parportlist_lock = SPIN_LOCK_UNLOCKED;
 
+/* list of all allocated ports, sorted by ->number */
+static LIST_HEAD(all_ports);
+static spinlock_t full_list_lock = SPIN_LOCK_UNLOCKED;
+
 static struct parport_driver *driver_chain = NULL;
-static spinlock_t driverlist_lock = SPIN_LOCK_UNLOCKED;
+
+static DECLARE_MUTEX(registration_lock);
 
 /* What you can do to a port that's gone away.. */
 static void dead_write_lines (struct parport *p, unsigned char b){}
@@ -98,55 +103,19 @@
 /* Call attach(port) for each registered driver. */
 static void attach_driver_chain(struct parport *port)
 {
+	/* caller has exclusive registration_lock */
 	struct parport_driver *drv;
-	void (**attach) (struct parport *);
-	int count = 0, i;
-
-	/* This is complicated because attach() must be able to block,
-	 * but we can't let it do that while we're holding a
-	 * spinlock. */
-
-	spin_lock (&driverlist_lock);
 	for (drv = driver_chain; drv; drv = drv->next)
-		count++;
-	spin_unlock (&driverlist_lock);
-
-	/* Drivers can unregister here; that's okay.  If they register
-	 * they'll be given an attach during parport_register_driver,
-	 * so that's okay too.  The only worry is that someone might
-	 * get given an attach twice if they registered just before
-	 * this function gets called. */
-
-	/* Hmm, this could be fixed with a generation number..
-	 * FIXME */
-
-	attach = kmalloc (sizeof (void(*)(struct parport *)) * count,
-			  GFP_KERNEL);
-	if (!attach) {
-		printk (KERN_WARNING "parport: not enough memory to attach\n");
-		return;
-	}
-
-	spin_lock (&driverlist_lock);
-	for (i = 0, drv = driver_chain; drv && i < count; drv = drv->next)
-		attach[i++] = drv->attach;
-	spin_unlock (&driverlist_lock);
-
-	for (count = 0; count < i; count++)
-		(*attach[count]) (port);
-
-	kfree (attach);
+		drv->attach(port);
 }
 
 /* Call detach(port) for each registered driver. */
 static void detach_driver_chain(struct parport *port)
 {
+	/* caller has exclusive registration_lock */
 	struct parport_driver *drv;
-
-	spin_lock (&driverlist_lock);
 	for (drv = driver_chain; drv; drv = drv->next)
 		drv->detach (port);
-	spin_unlock (&driverlist_lock);
 }
 
 /* Ask kmod for some lowlevel drivers. */
@@ -174,7 +143,7 @@
  *	pointer it must call parport_get_port() to do so.  Calling
  *	parport_register_device() on that port will do this for you.
  *
- *	The driver's detach() function may not block.  The port that
+ *	The driver's detach() function may block.  The port that
  *	detach() is given will be valid for the duration of the
  *	callback, but if the driver wants to take a copy of the
  *	pointer it must call parport_get_port() to do so.
@@ -185,8 +154,6 @@
 int parport_register_driver (struct parport_driver *drv)
 {
 	struct parport *port;
-	struct parport **ports;
-	int count = 0, i;
 
 	if (!portlist)
 		get_lowlevel_driver ();
@@ -199,31 +166,12 @@
 	 * it.  But we need to hold a spinlock to iterate over the
 	 * list of ports.. */
 
-	spin_lock (&parportlist_lock);
+	down(&registration_lock);
 	for (port = portlist; port; port = port->next)
-		count++;
-	spin_unlock (&parportlist_lock);
-
-	ports = kmalloc (sizeof (struct parport *) * count, GFP_KERNEL);
-	if (!ports)
-		printk (KERN_WARNING "parport: not enough memory to attach\n");
-	else {
-		spin_lock (&parportlist_lock);
-		for (i = 0, port = portlist; port && i < count;
-		     port = port->next)
-			ports[i++] = port;
-		spin_unlock (&parportlist_lock);
-
-		for (count = 0; count < i; count++)
-			drv->attach (ports[count]);
-
-		kfree (ports);
-	}
-
-	spin_lock (&driverlist_lock);
+		drv->attach(port);
 	drv->next = driver_chain;
 	driver_chain = drv;
-	spin_unlock (&driverlist_lock);
+	up(&registration_lock);
 
 	return 0;
 }
@@ -241,49 +189,46 @@
  *	be called, and for each port that attach() was called for, the
  *	detach() routine will have been called.
  *
- *	If the caller's attach() function can block, it is their
- *	responsibility to make sure to wait for it to exit before
- *	unloading.
- *
- *	All the driver's detach() calls are guaranteed to have
+ *	All the driver's attach() and detach() calls are guaranteed to have
  *	finished by the time this function returns.
- *
- *	The driver's detach() call is not allowed to block.
  **/
 
 void parport_unregister_driver (struct parport_driver *arg)
 {
-	struct parport_driver *drv = driver_chain, *olddrv = NULL;
+	struct parport_driver *drv, *olddrv = NULL;
 
+	down(&registration_lock);
+	drv = driver_chain;
 	while (drv) {
 		if (drv == arg) {
 			struct parport *port;
 
-			spin_lock (&driverlist_lock);
 			if (olddrv)
 				olddrv->next = drv->next;
 			else
 				driver_chain = drv->next;
-			spin_unlock (&driverlist_lock);
 
 			/* Call the driver's detach routine for each
 			 * port to clean up any resources that the
 			 * attach routine acquired. */
-			spin_lock (&parportlist_lock);
 			for (port = portlist; port; port = port->next)
 				drv->detach (port);
-			spin_unlock (&parportlist_lock);
+			up(&registration_lock);
 
 			return;
 		}
 		olddrv = drv;
 		drv = drv->next;
 	}
+	up(&registration_lock);
 }
 
 static void free_port (struct parport *port)
 {
 	int d;
+	spin_lock(&full_list_lock);
+	list_del(&port->full_list);
+	spin_unlock(&full_list_lock);
 	for (d = 0; d < 5; d++) {
 		if (port->probe_info[d].class_name)
 			kfree (port->probe_info[d].class_name);
@@ -386,8 +331,9 @@
 struct parport *parport_register_port(unsigned long base, int irq, int dma,
 				      struct parport_operations *ops)
 {
+	struct list_head *l;
 	struct parport *tmp;
-	int portnum;
+	int num;
 	int device;
 	char *name;
 
@@ -418,6 +364,7 @@
 	init_MUTEX_LOCKED (&tmp->ieee1284.irq); /* actually a semaphore at 0 */
 	tmp->spintime = parport_default_spintime;
 	atomic_set (&tmp->ref_count, 1);
+	INIT_LIST_HEAD(&tmp->full_list);
 
 	name = kmalloc(15, GFP_KERNEL);
 	if (!name) {
@@ -427,53 +374,22 @@
 	}
 	/* Search for the lowest free parport number. */
 
-	spin_lock_irq (&parportlist_lock);
-	for (portnum = 0; ; portnum++) {
-		struct parport *itr = portlist;
-		while (itr) {
-			if (itr->number == portnum)
-				/* No good, already used. */
-				break;
-			else
-				itr = itr->next;
-		}
-
-		if (itr == NULL)
-			/* Got to the end of the list. */
+	spin_lock(&full_list_lock);
+	for (l = all_ports.next, num = 0; l != &all_ports; l = l->next, num++) {
+		struct parport *p = list_entry(l, struct parport, full_list);
+		if (p->number != num)
 			break;
 	}
+	tmp->portnum = tmp->number = num;
+	list_add_tail(&tmp->full_list, l);
+	spin_unlock(&full_list_lock);
 
 	/*
 	 * Now that the portnum is known finish doing the Init.
 	 */
-	tmp->portnum = tmp->number = portnum;
-	sprintf(name, "parport%d", portnum);
+	sprintf(name, "parport%d", tmp->portnum = tmp->number);
 	tmp->name = name;
 
-	
-	/*
-	 * Chain the entry to our list.
-	 *
-	 * This function must not run from an irq handler so we don' t need
-	 * to clear irq on the local CPU. -arca
-	 */
-
-	/* We are locked against anyone else performing alterations, but
-	 * because of parport_enumerate people can still _read_ the list
-	 * while we are changing it; so be careful..
-	 *
-	 * It's okay to have portlist_tail a little bit out of sync
-	 * since it's only used for changing the list, not for reading
-	 * from it.
-	 */
-
-	if (portlist_tail)
-		portlist_tail->next = tmp;
-	portlist_tail = tmp;
-	if (!portlist)
-		portlist = tmp;
-	spin_unlock_irq(&parportlist_lock);
-
 	for (device = 0; device < 5; device++)
 		/* assume the worst */
 		tmp->probe_info[device].class = PARPORT_CLASS_LEGACY;
@@ -497,6 +413,7 @@
 
 void parport_announce_port (struct parport *port)
 {
+
 #ifdef CONFIG_PARPORT_1284
 	/* Analyse the IEEE1284.3 topology of the port. */
 	if (parport_daisy_init (port) == 0) {
@@ -514,8 +431,27 @@
 	}
 #endif
 
+	down(&registration_lock);
+	/* We are locked against anyone else performing alterations, but
+	 * because of parport_enumerate people can still _read_ the list
+	 * while we are changing it; so be careful..
+	 *
+	 * It's okay to have portlist_tail a little bit out of sync
+	 * since it's only used for changing the list, not for reading
+	 * from it.
+	 */
+
+	spin_lock_irq(&parportlist_lock);
+	if (portlist_tail)
+		portlist_tail->next = port;
+	portlist_tail = port;
+	if (!portlist)
+		portlist = port;
+	spin_unlock_irq(&parportlist_lock);
+
 	/* Let drivers know that a new port has arrived. */
 	attach_driver_chain (port);
+	up(&registration_lock);
 }
 
 /**
@@ -541,6 +477,7 @@
 {
 	struct parport *p;
 
+	down(&registration_lock);
 	port->ops = &dead_ops;
 
 	/* Spread the word. */
@@ -570,6 +507,7 @@
 			     "%s not found in port list!\n", port->name);
 	}
 	spin_unlock(&parportlist_lock);
+	up(&registration_lock);
 
 	/* Yes, parport_enumerate _is_ unsafe.  Don't use it. */
 	parport_put_port (port);
--- diff/drivers/pci/Makefile	2004-01-19 10:22:58.000000000 +0000
+++ source/drivers/pci/Makefile	2004-02-09 10:39:54.000000000 +0000
@@ -2,7 +2,7 @@
 # Makefile for the PCI bus specific drivers.
 #
 
-obj-y		+= access.o bus.o probe.o remove.o pci.o pool.o quirks.o \
+obj-y		+= access.o bus.o probe.o remove.o pci.o quirks.o \
 			names.o pci-driver.o search.o pci-sysfs.o
 obj-$(CONFIG_PROC_FS) += proc.o
 
--- diff/drivers/pci/hotplug.c	2003-08-20 14:16:11.000000000 +0100
+++ source/drivers/pci/hotplug.c	2004-02-09 10:39:54.000000000 +0000
@@ -29,7 +29,7 @@
 
 	/* stuff we want to pass to /sbin/hotplug */
 	envp[i++] = scratch;
-	length += snprintf (scratch, buffer_size - length, "PCI_CLASS=%04X",
+	length += scnprintf (scratch, buffer_size - length, "PCI_CLASS=%04X",
 			    pdev->class);
 	if ((buffer_size - length <= 0) || (i >= num_envp))
 		return -ENOMEM;
@@ -37,7 +37,7 @@
 	scratch += length;
 
 	envp[i++] = scratch;
-	length += snprintf (scratch, buffer_size - length, "PCI_ID=%04X:%04X",
+	length += scnprintf (scratch, buffer_size - length, "PCI_ID=%04X:%04X",
 			    pdev->vendor, pdev->device);
 	if ((buffer_size - length <= 0) || (i >= num_envp))
 		return -ENOMEM;
@@ -45,7 +45,7 @@
 	scratch += length;
 
 	envp[i++] = scratch;
-	length += snprintf (scratch, buffer_size - length,
+	length += scnprintf (scratch, buffer_size - length,
 			    "PCI_SUBSYS_ID=%04X:%04X", pdev->subsystem_vendor,
 			    pdev->subsystem_device);
 	if ((buffer_size - length <= 0) || (i >= num_envp))
@@ -54,7 +54,7 @@
 	scratch += length;
 
 	envp[i++] = scratch;
-	length += snprintf (scratch, buffer_size - length, "PCI_SLOT_NAME=%s",
+	length += scnprintf (scratch, buffer_size - length, "PCI_SLOT_NAME=%s",
 			    pci_name(pdev));
 	if ((buffer_size - length <= 0) || (i >= num_envp))
 		return -ENOMEM;
@@ -116,7 +116,7 @@
 	}
 
 	bus = wrapped_dev->dev->subordinate;
-	if(bus) {
+	if (bus) {
 		memset(&wrapped_bus, 0, sizeof(struct pci_bus_wrapped));
 		wrapped_bus.bus = bus;
 
@@ -130,8 +130,8 @@
  * Every bus and every function is presented to a custom
  * function that can act upon it.
  */
-int pci_visit_dev (struct pci_visit *fn, struct pci_dev_wrapped *wrapped_dev,
-		   struct pci_bus_wrapped *wrapped_parent)
+int pci_visit_dev(struct pci_visit *fn, struct pci_dev_wrapped *wrapped_dev,
+		  struct pci_bus_wrapped *wrapped_parent)
 {
 	struct pci_dev* dev = wrapped_dev ? wrapped_dev->dev : NULL;
 	int result = 0;
--- diff/drivers/pci/hotplug/acpiphp_glue.c	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/pci/hotplug/acpiphp_glue.c	2004-02-09 10:39:54.000000000 +0000
@@ -87,7 +87,7 @@
 
 /* callback routine to check the existence of ejectable slots */
 static acpi_status
-is_ejectable_slot (acpi_handle handle, u32 lvl,	void *context, void **rv)
+is_ejectable_slot(acpi_handle handle, u32 lvl, void *context, void **rv)
 {
 	int *count = (int *)context;
 
@@ -103,7 +103,7 @@
 
 /* callback routine to register each ACPI PCI slot object */
 static acpi_status
-register_slot (acpi_handle handle, u32 lvl, void *context, void **rv)
+register_slot(acpi_handle handle, u32 lvl, void *context, void **rv)
 {
 	struct acpiphp_bridge *bridge = (struct acpiphp_bridge *)context;
 	struct acpiphp_slot *slot;
@@ -212,7 +212,7 @@
 
 
 /* see if it's worth looking at this bridge */
-static int detect_ejectable_slots (acpi_handle *bridge_handle)
+static int detect_ejectable_slots(acpi_handle *bridge_handle)
 {
 	acpi_status status;
 	int count;
@@ -231,7 +231,7 @@
  * TBD: _TRA, etc.
  */
 static acpi_status
-decode_acpi_resource (struct acpi_resource *resource, void *context)
+decode_acpi_resource(struct acpi_resource *resource, void *context)
 {
 	struct acpiphp_bridge *bridge = (struct acpiphp_bridge *) context;
 	struct acpi_resource_address64 address;
@@ -339,7 +339,7 @@
 
 
 /* initialize miscellaneous stuff for both root and PCI-to-PCI bridge */
-static void init_bridge_misc (struct acpiphp_bridge *bridge)
+static void init_bridge_misc(struct acpiphp_bridge *bridge)
 {
 	acpi_status status;
 
@@ -371,7 +371,7 @@
 
 
 /* allocate and initialize host bridge data structure */
-static void add_host_bridge (acpi_handle *handle, int seg, int bus)
+static void add_host_bridge(acpi_handle *handle, int seg, int bus)
 {
 	acpi_status status;
 	struct acpiphp_bridge *bridge;
@@ -423,7 +423,7 @@
 
 
 /* allocate and initialize PCI-to-PCI bridge data structure */
-static void add_p2p_bridge (acpi_handle *handle, int seg, int bus, int dev, int fn)
+static void add_p2p_bridge(acpi_handle *handle, int seg, int bus, int dev, int fn)
 {
 	struct acpiphp_bridge *bridge;
 	u8 tmp8;
@@ -573,7 +573,7 @@
 
 /* callback routine to find P2P bridges */
 static acpi_status
-find_p2p_bridge (acpi_handle handle, u32 lvl, void *context, void **rv)
+find_p2p_bridge(acpi_handle handle, u32 lvl, void *context, void **rv)
 {
 	acpi_status status;
 	acpi_handle dummy_handle;
@@ -673,13 +673,13 @@
 }
 
 
-static void remove_bridge (acpi_handle handle)
+static void remove_bridge(acpi_handle handle)
 {
 	/* No-op for now .. */
 }
 
 
-static int power_on_slot (struct acpiphp_slot *slot)
+static int power_on_slot(struct acpiphp_slot *slot)
 {
 	acpi_status status;
 	struct acpiphp_func *func;
@@ -714,7 +714,7 @@
 }
 
 
-static int power_off_slot (struct acpiphp_slot *slot)
+static int power_off_slot(struct acpiphp_slot *slot)
 {
 	acpi_status status;
 	struct acpiphp_func *func;
@@ -778,7 +778,7 @@
  * not per each slot object in ACPI namespace.
  *
  */
-static int enable_device (struct acpiphp_slot *slot)
+static int enable_device(struct acpiphp_slot *slot)
 {
 	u8 bus;
 	struct pci_dev *dev;
@@ -852,7 +852,7 @@
 /**
  * disable_device - disable a slot
  */
-static int disable_device (struct acpiphp_slot *slot)
+static int disable_device(struct acpiphp_slot *slot)
 {
 	int retval = 0;
 	struct acpiphp_func *func;
@@ -894,7 +894,7 @@
  *
  * otherwise return 0
  */
-static unsigned int get_slot_status (struct acpiphp_slot *slot)
+static unsigned int get_slot_status(struct acpiphp_slot *slot)
 {
 	acpi_status status;
 	unsigned long sta = 0;
@@ -939,7 +939,7 @@
  * handles ACPI event notification on {host,p2p} bridges
  *
  */
-static void handle_hotplug_event_bridge (acpi_handle handle, u32 type, void *context)
+static void handle_hotplug_event_bridge(acpi_handle handle, u32 type, void *context)
 {
 	struct acpiphp_bridge *bridge;
 	char objname[64];
@@ -1005,7 +1005,7 @@
  * handles ACPI event notification on slots
  *
  */
-static void handle_hotplug_event_func (acpi_handle handle, u32 type, void *context)
+static void handle_hotplug_event_func(acpi_handle handle, u32 type, void *context)
 {
 	struct acpiphp_func *func;
 	char objname[64];
@@ -1171,7 +1171,7 @@
 
 
 /* search matching slot from id  */
-struct acpiphp_slot *get_slot_from_id (int id)
+struct acpiphp_slot *get_slot_from_id(int id)
 {
 	struct list_head *node;
 	struct acpiphp_bridge *bridge;
@@ -1193,7 +1193,7 @@
 /**
  * acpiphp_enable_slot - power on slot
  */
-int acpiphp_enable_slot (struct acpiphp_slot *slot)
+int acpiphp_enable_slot(struct acpiphp_slot *slot)
 {
 	int retval;
 
@@ -1217,7 +1217,7 @@
 /**
  * acpiphp_disable_slot - power off slot
  */
-int acpiphp_disable_slot (struct acpiphp_slot *slot)
+int acpiphp_disable_slot(struct acpiphp_slot *slot)
 {
 	int retval = 0;
 
@@ -1249,7 +1249,7 @@
 /**
  * acpiphp_check_bridge - re-enumerate devices
  */
-int acpiphp_check_bridge (struct acpiphp_bridge *bridge)
+int acpiphp_check_bridge(struct acpiphp_bridge *bridge)
 {
 	struct acpiphp_slot *slot;
 	unsigned int sta;
@@ -1296,7 +1296,7 @@
  * slot enabled:  1
  * slot disabled: 0
  */
-u8 acpiphp_get_power_status (struct acpiphp_slot *slot)
+u8 acpiphp_get_power_status(struct acpiphp_slot *slot)
 {
 	unsigned int sta;
 
@@ -1314,7 +1314,7 @@
  * no direct attention led status information via ACPI
  *
  */
-u8 acpiphp_get_attention_status (struct acpiphp_slot *slot)
+u8 acpiphp_get_attention_status(struct acpiphp_slot *slot)
 {
 	return 0;
 }
@@ -1324,7 +1324,7 @@
  * latch closed:  1
  * latch   open:  0
  */
-u8 acpiphp_get_latch_status (struct acpiphp_slot *slot)
+u8 acpiphp_get_latch_status(struct acpiphp_slot *slot)
 {
 	unsigned int sta;
 
@@ -1338,7 +1338,7 @@
  * adapter presence : 1
  *          absence : 0
  */
-u8 acpiphp_get_adapter_status (struct acpiphp_slot *slot)
+u8 acpiphp_get_adapter_status(struct acpiphp_slot *slot)
 {
 	unsigned int sta;
 
@@ -1351,7 +1351,7 @@
 /*
  * pci address (seg/bus/dev)
  */
-u32 acpiphp_get_address (struct acpiphp_slot *slot)
+u32 acpiphp_get_address(struct acpiphp_slot *slot)
 {
 	u32 address;
 
--- diff/drivers/pci/hotplug/cpqphp_ctrl.c	2003-09-30 15:46:16.000000000 +0100
+++ source/drivers/pci/hotplug/cpqphp_ctrl.c	2004-02-09 10:39:54.000000000 +0000
@@ -2446,7 +2446,7 @@
 				   u8 behind_bridge, struct resource_lists * resources)
 {
 	int cloop;
-	u8 IRQ;
+	u8 IRQ = 0;
 	u8 temp_byte;
 	u8 device;
 	u8 class_code;
@@ -3021,6 +3021,7 @@
 			}
 		}		// End of base register loop
 
+#if !defined(CONFIG_X86_IO_APIC)
 		// Figure out which interrupt pin this function uses
 		rc = pci_bus_read_config_byte (pci_bus, devfn, PCI_INTERRUPT_PIN, &temp_byte);
 
@@ -3045,6 +3046,7 @@
 
 		// IRQ Line
 		rc = pci_bus_write_config_byte (pci_bus, devfn, PCI_INTERRUPT_LINE, IRQ);
+#endif
 
 		if (!behind_bridge) {
 			rc = cpqhp_set_irq(func->bus, func->device, temp_byte + 0x09, IRQ);
--- diff/drivers/pci/hotplug/cpqphp_pci.c	2003-09-30 15:46:16.000000000 +0100
+++ source/drivers/pci/hotplug/cpqphp_pci.c	2004-02-09 10:39:54.000000000 +0000
@@ -123,7 +123,7 @@
 	dbg("%s: bus/dev/func = %x/%x/%x\n", __FUNCTION__, func->bus, func->device, func->function);
 
 	for (j=0; j<8 ; j++) {
-		struct pci_dev* temp = pci_find_slot(func->bus, (func->device << 3) | j);
+		struct pci_dev* temp = pci_find_slot(func->bus, PCI_DEVFN(func->device, j));
 		if (temp)
 			pci_remove_bus_device(temp);
 	}
@@ -151,6 +151,7 @@
  */
 int cpqhp_set_irq (u8 bus_num, u8 dev_num, u8 int_pin, u8 irq_num)
 {
+#if !defined(CONFIG_X86_IO_APIC)	
 	int rc;
 	u16 temp_word;
 	struct pci_dev fakedev;
@@ -175,6 +176,7 @@
 	// This should only be for x86 as it sets the Edge Level Control Register
 	outb((u8) (temp_word & 0xFF), 0x4d0);
 	outb((u8) ((temp_word & 0xFF00) >> 8), 0x4d1);
+#endif
 
 	return 0;
 }
@@ -545,10 +547,10 @@
 		} while (function < max_functions);
 	}			// End of IF (device in slot?)
 	else {
-		return(2);
+		return 2;
 	}
 
-	return(0);
+	return 0;
 }
 
 
@@ -594,9 +596,8 @@
 
 			while (next != NULL) {
 				rc = cpqhp_save_base_addr_length(ctrl, next);
-
 				if (rc)
-					return(rc);
+					return rc;
 
 				next = next->next;
 			}
@@ -979,7 +980,6 @@
 
 			while (next != NULL) {
 				rc = cpqhp_configure_board(ctrl, next);
-
 				if (rc)
 					return rc;
 
@@ -1076,9 +1076,8 @@
 
 			while (next != NULL) {
 				rc = cpqhp_valid_replace(ctrl, next);
-
 				if (rc)
-					return(rc);
+					return rc;
 
 				next = next->next;
 			}
@@ -1144,7 +1143,7 @@
 	}
 
 
-	return(0);
+	return 0;
 }
 
 
@@ -1229,9 +1228,8 @@
 	i = readb(rom_resource_table + NUMBER_OF_ENTRIES);
 	dbg("number_of_entries = %d\n", i);
 
-	if (!readb(one_slot + SECONDARY_BUS)) {
-		return(1);
-	}
+	if (!readb(one_slot + SECONDARY_BUS))
+		return 1;
 
 	dbg("dev|IO base|length|Mem base|length|Pre base|length|PB SB MB\n");
 
@@ -1391,7 +1389,7 @@
 	rc &= cpqhp_resource_sort_and_combine(&(ctrl->io_head));
 	rc &= cpqhp_resource_sort_and_combine(&(ctrl->bus_head));
 
-	return(rc);
+	return rc;
 }
 
 
@@ -1411,7 +1409,7 @@
 	dbg("%s\n", __FUNCTION__);
 
 	if (!func)
-		return(1);
+		return 1;
 
 	node = func->io_head;
 	func->io_head = NULL;
@@ -1450,7 +1448,7 @@
 	rc |= cpqhp_resource_sort_and_combine(&(resources->io_head));
 	rc |= cpqhp_resource_sort_and_combine(&(resources->bus_head));
 
-	return(rc);
+	return rc;
 }
 
 
--- diff/drivers/pci/hotplug/ibmphp_core.c	2003-09-30 15:46:16.000000000 +0100
+++ source/drivers/pci/hotplug/ibmphp_core.c	2004-02-09 10:39:54.000000000 +0000
@@ -104,7 +104,7 @@
 	if (rc) 
 		return rc;
 	if (!init_flag)
-		return get_cur_bus_info (sl);
+		rc = get_cur_bus_info(sl);
 	return rc;
 }
 
@@ -116,7 +116,7 @@
 
 	list_for_each (tmp, &ibmphp_slot_head) {
 		slot_cur = list_entry (tmp, struct slot, ibm_slot_list);
-		/* sometimes the hot-pluggable slots start with 4 (not always from 1 */
+		/* sometimes the hot-pluggable slots start with 4 (not always from 1) */
 		slot_count = max (slot_count, slot_cur->number);
 	}
 	return slot_count;
@@ -187,7 +187,7 @@
 		return retval;
 	}
 	if (CTLR_RESULT (slot_cur->ctrl->status)) {
-		err ("command not completed successfully in power_on \n");
+		err ("command not completed successfully in power_on\n");
 		return -EIO;
 	}
 	long_delay (3 * HZ); /* For ServeRAID cards, and some 66 PCI */
@@ -201,14 +201,14 @@
 
 	retval = ibmphp_hpc_writeslot (slot_cur, cmd);
 	if (retval) {
-		err ("power off failed \n");
+		err ("power off failed\n");
 		return retval;
 	}
 	if (CTLR_RESULT (slot_cur->ctrl->status)) {
-		err ("command not completed successfully in power_off \n");
-		return -EIO;
+		err ("command not completed successfully in power_off\n");
+		retval = -EIO;
 	}
-	return 0;
+	return retval;
 }
 
 static int set_attention_status (struct hotplug_slot *hotplug_slot, u8 value)
@@ -216,7 +216,6 @@
 	int rc = 0;
 	struct slot *pslot;
 	u8 cmd;
-	int hpcrc = 0;
 
 	debug ("set_attention_status - Entry hotplug_slot[%lx] value[%x]\n", (ulong) hotplug_slot, value);
 	ibmphp_lock_operations ();
@@ -241,16 +240,13 @@
 		if (rc == 0) {
 			pslot = (struct slot *) hotplug_slot->private;
 			if (pslot)
-				hpcrc = ibmphp_hpc_writeslot (pslot, cmd);
+				rc = ibmphp_hpc_writeslot(pslot, cmd);
 			else
 				rc = -ENODEV;
 		}
 	} else	
 		rc = -ENODEV;
 
-	if (hpcrc)
-		rc = hpcrc;
-
 	ibmphp_unlock_operations ();
 
 	debug ("set_attention_status - Exit rc[%d]\n", rc);
@@ -261,7 +257,6 @@
 {
 	int rc = -ENODEV;
 	struct slot *pslot;
-	int hpcrc = 0;
 	struct slot myslot;
 
 	debug ("get_attention_status - Entry hotplug_slot[%lx] pvalue[%lx]\n", (ulong) hotplug_slot, (ulong) value);
@@ -271,22 +266,16 @@
 		pslot = (struct slot *) hotplug_slot->private;
 		if (pslot) {
 			memcpy ((void *) &myslot, (void *) pslot, sizeof (struct slot));
-			hpcrc = ibmphp_hpc_readslot (pslot, READ_SLOTSTATUS, &(myslot.status));
-			if (!hpcrc)
-				hpcrc = ibmphp_hpc_readslot (pslot, READ_EXTSLOTSTATUS, &(myslot.ext_status));
-			if (!hpcrc) {
+			rc = ibmphp_hpc_readslot(pslot, READ_SLOTSTATUS, &(myslot.status));
+			if (!rc)
+				rc = ibmphp_hpc_readslot(pslot, READ_EXTSLOTSTATUS, &(myslot.ext_status));
+			if (!rc)
 				*value = SLOT_ATTN (myslot.status, myslot.ext_status);
-				rc = 0;
-			}
 		}
-	} else
-		rc = -ENODEV;
-
-	if (hpcrc)
-		rc = hpcrc;
+	}
 
 	ibmphp_unlock_operations ();
-	debug ("get_attention_status - Exit rc[%d] hpcrc[%x] value[%x]\n", rc, hpcrc, *value);
+	debug("get_attention_status - Exit rc[%d] value[%x]\n", rc, *value);
 	return rc;
 }
 
@@ -294,7 +283,6 @@
 {
 	int rc = -ENODEV;
 	struct slot *pslot;
-	int hpcrc = 0;
 	struct slot myslot;
 
 	debug ("get_latch_status - Entry hotplug_slot[%lx] pvalue[%lx]\n", (ulong) hotplug_slot, (ulong) value);
@@ -303,20 +291,14 @@
 		pslot = (struct slot *) hotplug_slot->private;
 		if (pslot) {
 			memcpy ((void *) &myslot, (void *) pslot, sizeof (struct slot));
-			hpcrc = ibmphp_hpc_readslot (pslot, READ_SLOTSTATUS, &(myslot.status));
-			if (!hpcrc) {
+			rc = ibmphp_hpc_readslot(pslot, READ_SLOTSTATUS, &(myslot.status));
+			if (!rc)
 				*value = SLOT_LATCH (myslot.status);
-				rc = 0;
-			}
 		}
-	} else
-		rc = -ENODEV;
-
-	if (hpcrc)
-		rc = hpcrc;
+	}
 
 	ibmphp_unlock_operations ();
-	debug ("get_latch_status - Exit rc[%d] hpcrc[%x] value[%x]\n", rc, hpcrc, *value);
+	debug("get_latch_status - Exit rc[%d] rc[%x] value[%x]\n", rc, rc, *value);
 	return rc;
 }
 
@@ -325,7 +307,6 @@
 {
 	int rc = -ENODEV;
 	struct slot *pslot;
-	int hpcrc = 0;
 	struct slot myslot;
 
 	debug ("get_power_status - Entry hotplug_slot[%lx] pvalue[%lx]\n", (ulong) hotplug_slot, (ulong) value);
@@ -334,20 +315,14 @@
 		pslot = (struct slot *) hotplug_slot->private;
 		if (pslot) {
 			memcpy ((void *) &myslot, (void *) pslot, sizeof (struct slot));
-			hpcrc = ibmphp_hpc_readslot (pslot, READ_SLOTSTATUS, &(myslot.status));
-			if (!hpcrc) {
+			rc = ibmphp_hpc_readslot(pslot, READ_SLOTSTATUS, &(myslot.status));
+			if (!rc)
 				*value = SLOT_PWRGD (myslot.status);
-				rc = 0;
-			}
 		}
-	} else
-		rc = -ENODEV;
-
-	if (hpcrc)
-		rc = hpcrc;
+	}
 
 	ibmphp_unlock_operations ();
-	debug ("get_power_status - Exit rc[%d] hpcrc[%x] value[%x]\n", rc, hpcrc, *value);
+	debug("get_power_status - Exit rc[%d] rc[%x] value[%x]\n", rc, rc, *value);
 	return rc;
 }
 
@@ -356,7 +331,6 @@
 	int rc = -ENODEV;
 	struct slot *pslot;
 	u8 present;
-	int hpcrc = 0;
 	struct slot myslot;
 
 	debug ("get_adapter_status - Entry hotplug_slot[%lx] pvalue[%lx]\n", (ulong) hotplug_slot, (ulong) value);
@@ -365,23 +339,19 @@
 		pslot = (struct slot *) hotplug_slot->private;
 		if (pslot) {
 			memcpy ((void *) &myslot, (void *) pslot, sizeof (struct slot));
-			hpcrc = ibmphp_hpc_readslot (pslot, READ_SLOTSTATUS, &(myslot.status));
-			if (!hpcrc) {
+			rc = ibmphp_hpc_readslot(pslot, READ_SLOTSTATUS, &(myslot.status));
+			if (!rc) {
 				present = SLOT_PRESENT (myslot.status);
 				if (present == HPC_SLOT_EMPTY)
 					*value = 0;
 				else
 					*value = 1;
-				rc = 0;
 			}
 		}
-	} else
-		rc = -ENODEV;
-	if (hpcrc)
-		rc = hpcrc;
+	}
 
 	ibmphp_unlock_operations ();
-	debug ("get_adapter_present - Exit rc[%d] hpcrc[%x] value[%x]\n", rc, hpcrc, *value);
+	debug("get_adapter_present - Exit rc[%d] value[%x]\n", rc, *value);
 	return rc;
 }
 
@@ -418,8 +388,7 @@
 				rc = -ENODEV;
 			}
 		}
-	} else
-		rc = -ENODEV;
+	}
 
 	ibmphp_unlock_operations ();
 	debug ("%s - Exit rc[%d] value[%x]\n", __FUNCTION__, rc, *value);
@@ -465,8 +434,7 @@
 				}
 			}
 		}
-	} else
-		rc = -ENODEV;
+	}
 
 	ibmphp_unlock_operations ();
 	debug ("%s - Exit rc[%d] value[%x]\n", __FUNCTION__, rc, *value);
@@ -477,7 +445,6 @@
 {
 	int rc = -ENODEV;
 	struct slot *pslot;
-	int hpcrc = 0;
 	struct slot myslot;
 
 	debug ("get_max_adapter_speed_1 - Entry hotplug_slot[%lx] pvalue[%lx]\n", (ulong)hotplug_slot, (ulong) value);
@@ -489,29 +456,21 @@
 		pslot = (struct slot *) hotplug_slot->private;
 		if (pslot) {
 			memcpy ((void *) &myslot, (void *) pslot, sizeof (struct slot));
-			hpcrc = ibmphp_hpc_readslot (pslot, READ_SLOTSTATUS, &(myslot.status));
+			rc = ibmphp_hpc_readslot(pslot, READ_SLOTSTATUS, &(myslot.status));
 
 			if (!(SLOT_LATCH (myslot.status)) && (SLOT_PRESENT (myslot.status))) {
-				hpcrc = ibmphp_hpc_readslot (pslot, READ_EXTSLOTSTATUS, &(myslot.ext_status));
-				if (!hpcrc) {
+				rc = ibmphp_hpc_readslot(pslot, READ_EXTSLOTSTATUS, &(myslot.ext_status));
+				if (!rc)
 					*value = SLOT_SPEED (myslot.ext_status);
-					rc = 0;
-				}
-			} else {
+			} else
 				*value = MAX_ADAPTER_NONE;
-				rc = 0;
-			}
                 }
-        } else
-		rc = -ENODEV;
-
-	if (hpcrc)
-		rc = hpcrc;
+	}
 
 	if (flag)
 		ibmphp_unlock_operations ();
 
-	debug ("get_max_adapter_speed_1 - Exit rc[%d] hpcrc[%x] value[%x]\n", rc, hpcrc, *value);
+	debug("get_max_adapter_speed_1 - Exit rc[%d] value[%x]\n", rc, *value);
 	return rc;
 }
 
@@ -520,7 +479,7 @@
 	int rc = -ENODEV;
 	struct slot *pslot = NULL;
 
-	debug ("get_bus_name - Entry hotplug_slot[%lx] \n", (ulong)hotplug_slot);
+	debug ("get_bus_name - Entry hotplug_slot[%lx]\n", (ulong)hotplug_slot);
 
 	ibmphp_lock_operations ();
 
@@ -654,7 +613,7 @@
 
 	info = kmalloc (sizeof (struct hotplug_slot_info), GFP_KERNEL);
 	if (!info) {
-		err ("out of system memory \n");
+		err ("out of system memory\n");
 		return -ENOMEM;
 	}
         
@@ -745,21 +704,20 @@
 	debug ("%s -- exit\n", __FUNCTION__);
 }
 
-static int ibm_unconfigure_device (struct pci_func *func)
+static void ibm_unconfigure_device(struct pci_func *func)
 {
 	struct pci_dev *temp;
 	u8 j;
 
-	debug ("inside %s\n", __FUNCTION__);
-	debug ("func->device = %x, func->function = %x\n", func->device, func->function);
-	debug ("func->device << 3 | 0x0  = %x\n", func->device << 3 | 0x0);
+	debug("inside %s\n", __FUNCTION__);
+	debug("func->device = %x, func->function = %x\n", func->device, func->function);
+	debug("func->device << 3 | 0x0  = %x\n", func->device << 3 | 0x0);
 
 	for (j = 0; j < 0x08; j++) {
-		temp = pci_find_slot (func->busno, (func->device << 3) | j);
+		temp = pci_find_slot(func->busno, (func->device << 3) | j);
 		if (temp)
 			pci_remove_bus_device(temp);
 	}
-	return 0;
 }
 
 /*
@@ -794,7 +752,7 @@
 	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) {
-			debug ("%s - Inside bus_struture_fixup() \n", __FUNCTION__);
+			debug ("%s - Inside bus_struture_fixup()\n", __FUNCTION__);
 			pci_scan_bus (busno, ibmphp_pci_bus->ops, NULL);
 			break;
 		}
@@ -829,7 +787,7 @@
 
 		func->dev = pci_find_slot(func->busno, PCI_DEVFN(func->device, func->function));
 		if (func->dev == NULL) {
-			err ("ERROR... : pci_dev still NULL \n");
+			err ("ERROR... : pci_dev still NULL\n");
 			return 0;
 		}
 	}
@@ -883,7 +841,7 @@
 	struct pci_dev *dev = NULL;
 	int retval;
 
-	debug ("%s - entry slot # %d \n", __FUNCTION__, slot_cur->number);
+	debug ("%s - entry slot # %d\n", __FUNCTION__, slot_cur->number);
 	if (SET_BUS_STATUS (slot_cur->ctrl) && is_bus_empty (slot_cur)) {
 		rc = slot_update (&slot_cur);
 		if (rc)
@@ -934,12 +892,12 @@
 				cmd = HPC_BUS_133PCIXMODE;
 				break;
 			default:
-				err ("Wrong bus speed \n");
+				err ("Wrong bus speed\n");
 				return -ENODEV;
 			}
 			break;
 		default:
-			err ("wrong slot speed \n");
+			err ("wrong slot speed\n");
 			return -ENODEV;
 		}
 		debug ("setting bus speed for slot %d, cmd %x\n", slot_cur->number, cmd);
@@ -949,14 +907,14 @@
 			return retval;
 		}
 		if (CTLR_RESULT (slot_cur->ctrl->status)) {
-			err ("command not completed successfully in set_bus \n");
+			err ("command not completed successfully in set_bus\n");
 			return -EIO;
 		}
 	}
 	/* This is for x440, once Brandon fixes the firmware, 
 	will not need this delay */
 	long_delay (1 * HZ);
-	debug ("%s -Exit \n", __FUNCTION__);
+	debug ("%s -Exit\n", __FUNCTION__);
 	return 0;
 }
 
@@ -1009,13 +967,13 @@
 {
 	info ("capability of the card is ");
 	if ((slot_cur->ext_status & CARD_INFO) == PCIX133) 
-		info ("   133 MHz PCI-X \n");
+		info ("   133 MHz PCI-X\n");
 	else if ((slot_cur->ext_status & CARD_INFO) == PCIX66)
-		info ("    66 MHz PCI-X \n");
+		info ("    66 MHz PCI-X\n");
 	else if ((slot_cur->ext_status & CARD_INFO) == PCI66)
-		info ("    66 MHz PCI \n");
+		info ("    66 MHz PCI\n");
 	else
-		info ("    33 MHz PCI \n");
+		info ("    33 MHz PCI\n");
 
 }
 
@@ -1033,11 +991,11 @@
 
 	ibmphp_lock_operations ();
 
-	debug ("ENABLING SLOT........ \n");
+	debug ("ENABLING SLOT........\n");
 	slot_cur = (struct slot *) hs->private;
 
 	if ((rc = validate (slot_cur, ENABLE))) {
-		err ("validate function failed \n");
+		err ("validate function failed\n");
 		goto error_nopower;
 	}
 
@@ -1045,13 +1003,13 @@
 	
 	rc = set_bus (slot_cur);
 	if (rc) {
-		err ("was not able to set the bus \n");
+		err ("was not able to set the bus\n");
 		goto error_nopower;
 	}
 
 	/*-----------------debugging------------------------------*/
 	get_cur_bus_info (&slot_cur);
-	debug ("the current bus speed right after set_bus = %x \n", slot_cur->bus_on->current_speed); 
+	debug ("the current bus speed right after set_bus = %x\n", slot_cur->bus_on->current_speed); 
 	/*----------------------------------------------------------*/
 
 	rc = check_limitations (slot_cur);
@@ -1059,7 +1017,7 @@
 		err ("Adding this card exceeds the limitations of this bus.\n");
 		err ("(i.e., >1 133MHz cards running on same bus, or "
 		     ">2 66 PCI cards running on same bus\n.");
-		err ("Try hot-adding into another bus \n");
+		err ("Try hot-adding into another bus\n");
 		rc = -EINVAL;
 		goto error_nopower;
 	}
@@ -1079,12 +1037,12 @@
 		}
 		/* Check to see the error of why it failed */
 		if ((SLOT_POWER (slot_cur->status)) && !(SLOT_PWRGD (slot_cur->status)))
-			err ("power fault occurred trying to power up \n");
+			err ("power fault occurred trying to power up\n");
 		else if (SLOT_BUS_SPEED (slot_cur->status)) {
-			err ("bus speed mismatch occurred.  please check current bus speed and card capability \n");
+			err ("bus speed mismatch occurred.  please check current bus speed and card capability\n");
 			print_card_capability (slot_cur);
 		} else if (SLOT_BUS_MODE (slot_cur->ext_status)) {
-			err ("bus mode mismatch occurred.  please check current bus mode and card capability \n");
+			err ("bus mode mismatch occurred.  please check current bus mode and card capability\n");
 			print_card_capability (slot_cur);
 		}
 		ibmphp_update_slot_info (slot_cur);
@@ -1093,7 +1051,7 @@
 	debug ("after power_on\n");
 	/*-----------------------debugging---------------------------*/
 	get_cur_bus_info (&slot_cur);
-	debug ("the current bus speed right after power_on = %x \n", slot_cur->bus_on->current_speed);
+	debug ("the current bus speed right after power_on = %x\n", slot_cur->bus_on->current_speed);
 	/*----------------------------------------------------------*/
 
 	rc = slot_update (&slot_cur);
@@ -1102,17 +1060,17 @@
 	
 	rc = -EINVAL;
 	if (SLOT_POWER (slot_cur->status) && !(SLOT_PWRGD (slot_cur->status))) {
-		err ("power fault occurred trying to power up... \n");
+		err ("power fault occurred trying to power up...\n");
 		goto error_power;
 	}
 	if (SLOT_POWER (slot_cur->status) && (SLOT_BUS_SPEED (slot_cur->status))) {
-		err ("bus speed mismatch occurred.  please check current bus speed and card capability \n");
+		err ("bus speed mismatch occurred.  please check current bus speed and card capability\n");
 		print_card_capability (slot_cur);
 		goto error_power;
 	} 
 	/* Don't think this case will happen after above checks... but just in case, for paranoia sake */
 	if (!(SLOT_POWER (slot_cur->status))) {
-		err ("power on failed... \n");
+		err ("power on failed...\n");
 		goto error_power;
 	}
 
@@ -1120,7 +1078,7 @@
 	if (!slot_cur->func) {
 		/* We cannot do update_slot_info here, since no memory for
 		 * kmalloc n.e.ways, and update_slot_info allocates some */
-		err ("out of system memory \n");
+		err ("out of system memory\n");
 		rc = -ENOMEM;
 		goto error_power;
 	}
@@ -1133,7 +1091,7 @@
 	debug ("b4 configure_card, slot_cur->bus = %x, slot_cur->device = %x\n", slot_cur->bus, slot_cur->device);
 
 	if (ibmphp_configure_card (slot_cur->func, slot_cur->number)) {
-		err ("configure_card was unsuccessful... \n");
+		err ("configure_card was unsuccessful...\n");
 		ibmphp_unconfigure_card (&slot_cur, 1); /* true because don't need to actually deallocate resources, just remove references */
 		debug ("after unconfigure_card\n");
 		slot_cur->func = NULL;
@@ -1204,7 +1162,7 @@
 	int rc;
 	u8 flag;
 
-	debug ("DISABLING SLOT... \n"); 
+	debug ("DISABLING SLOT...\n"); 
 		
 	if ((slot_cur == NULL) || (slot_cur->ctrl == NULL)) {
 		return -ENODEV;
@@ -1224,7 +1182,7 @@
 		/* We need this for fncs's that were there on bootup */
 		slot_cur->func = (struct pci_func *) kmalloc (sizeof (struct pci_func), GFP_KERNEL);
 		if (!slot_cur->func) {
-			err ("out of system memory \n");
+			err ("out of system memory\n");
 			rc = -ENOMEM;
 			goto error;
 		}
@@ -1233,12 +1191,7 @@
 		slot_cur->func->device = slot_cur->device;
 	}
 
-	if ((rc = ibm_unconfigure_device (slot_cur->func))) {
-		err ("removing from kernel failed... \n");
-		err ("Please check to see if it was statically linked or is "
-		     "in use otherwise. (perhaps the driver is not 'hot-removable')\n");
-		goto error;
-	}
+	ibm_unconfigure_device(slot_cur->func);
         
 	/* If we got here from latch suddenly opening on operating card or 
 	a power fault, there's no power to the card, so cannot
@@ -1306,15 +1259,15 @@
 static void ibmphp_unload (void)
 {
 	free_slots ();
-	debug ("after slots \n");
+	debug ("after slots\n");
 	ibmphp_free_resources ();
-	debug ("after resources \n");
+	debug ("after resources\n");
 	ibmphp_free_bus_info_queue ();
-	debug ("after bus info \n");
+	debug ("after bus info\n");
 	ibmphp_free_ebda_hpc_queue ();
-	debug ("after ebda hpc \n");
+	debug ("after ebda hpc\n");
 	ibmphp_free_ebda_pci_rsrc_queue ();
-	debug ("after ebda pci rsrc \n");
+	debug ("after ebda pci rsrc\n");
 	kfree (ibmphp_pci_bus);
 }
 
--- diff/drivers/pci/hotplug/ibmphp_ebda.c	2003-09-30 15:46:16.000000000 +0100
+++ source/drivers/pci/hotplug/ibmphp_ebda.c	2004-02-09 10:39:54.000000000 +0000
@@ -171,7 +171,7 @@
 {
 	struct rio_detail *ptr;
 	struct list_head *ptr1;
-	debug ("print_lo_info ---- \n");	
+	debug ("print_lo_info ----\n");	
 	list_for_each (ptr1, &rio_lo_head) {
 		ptr = list_entry (ptr1, struct rio_detail, rio_detail_list);
 		debug ("%s - rio_node_id = %x\n", __FUNCTION__, ptr->rio_node_id);
@@ -188,7 +188,7 @@
 {
 	struct rio_detail *ptr;
 	struct list_head *ptr1;
-	debug ("%s --- \n", __FUNCTION__);
+	debug ("%s ---\n", __FUNCTION__);
 	list_for_each (ptr1, &rio_vg_head) {
 		ptr = list_entry (ptr1, struct rio_detail, rio_detail_list);
 		debug ("%s - rio_node_id = %x\n", __FUNCTION__, ptr->rio_node_id);
@@ -220,7 +220,7 @@
 
 	list_for_each (ptr1, &ibmphp_slot_head) {
 		ptr = list_entry (ptr1, struct slot, ibm_slot_list);
-		debug ("%s - slot_number: %x \n", __FUNCTION__, ptr->number); 
+		debug ("%s - slot_number: %x\n", __FUNCTION__, ptr->number); 
 	}
 }
 
@@ -228,13 +228,13 @@
 {
 	struct opt_rio *ptr;
 	struct list_head *ptr1;
-	debug ("%s --- \n", __FUNCTION__);
+	debug ("%s ---\n", __FUNCTION__);
 	list_for_each (ptr1, &opt_vg_head) {
 		ptr = list_entry (ptr1, struct opt_rio, opt_rio_list);
-		debug ("%s - rio_type %x \n", __FUNCTION__, ptr->rio_type); 
-		debug ("%s - chassis_num: %x \n", __FUNCTION__, ptr->chassis_num); 
-		debug ("%s - first_slot_num: %x \n", __FUNCTION__, ptr->first_slot_num); 
-		debug ("%s - middle_num: %x \n", __FUNCTION__, ptr->middle_num); 
+		debug ("%s - rio_type %x\n", __FUNCTION__, ptr->rio_type); 
+		debug ("%s - chassis_num: %x\n", __FUNCTION__, ptr->chassis_num); 
+		debug ("%s - first_slot_num: %x\n", __FUNCTION__, ptr->first_slot_num); 
+		debug ("%s - middle_num: %x\n", __FUNCTION__, ptr->middle_num); 
 	}
 }
 
@@ -670,7 +670,7 @@
 	u8 flag = 0;
 
 	if (!slot_cur) {
-		err ("Structure passed is empty \n");
+		err ("Structure passed is empty\n");
 		return NULL;
 	}
 	
@@ -1269,14 +1269,14 @@
 	struct controller *ctrl;
 	struct list_head *tmp;
 
-	debug ("inside ibmphp_probe \n");
+	debug ("inside ibmphp_probe\n");
 	
 	list_for_each (tmp, &ebda_hpc_head) {
 		ctrl = list_entry (tmp, struct controller, ebda_hpc_list);
 		if (ctrl->ctlr_type == 1) {
 			if ((dev->devfn == ctrl->u.pci_ctlr.dev_fun) && (dev->bus->number == ctrl->u.pci_ctlr.bus)) {
 				ctrl->ctrl_dev = dev;
-				debug ("found device!!! \n");
+				debug ("found device!!!\n");
 				debug ("dev->device = %x, dev->subsystem_device = %x\n", dev->device, dev->subsystem_device);
 				return 0;
 			}
--- diff/drivers/pci/hotplug/ibmphp_pci.c	2003-09-30 15:46:16.000000000 +0100
+++ source/drivers/pci/hotplug/ibmphp_pci.c	2004-02-09 10:39:54.000000000 +0000
@@ -49,7 +49,7 @@
  */
 static void assign_alt_irq (struct pci_func * cur_func, u8 class_code)
 {
-	int j = 0;
+	int j;
 	for (j = 0; j < 4; j++) {
 		if (cur_func->irq[j] == 0xff) {
 			switch (class_code) {
@@ -92,7 +92,7 @@
 	u8 flag;
 	u8 valid_device = 0x00; /* to see if we are able to read from card any device info at all */
 
-	debug ("inside configure_card, func->busno = %x \n", func->busno);
+	debug ("inside configure_card, func->busno = %x\n", func->busno);
 
 	device = func->device;
 	cur_func = func;
@@ -130,7 +130,7 @@
 			pci_bus_read_config_dword (ibmphp_pci_bus, devfn, PCI_CLASS_REVISION, &class);
 
 			class_code = class >> 24;
-			debug ("hrd_type = %x, class = %x, class_code %x \n", hdr_type, class, class_code);
+			debug ("hrd_type = %x, class = %x, class_code %x\n", hdr_type, class, class_code);
 			class >>= 8;	/* to take revision out, class = class.subclass.prog i/f */
 			if (class == PCI_CLASS_NOT_DEFINED_VGA) {
 				err ("The device %x is VGA compatible and as is not supported for hot plugging. "
@@ -147,7 +147,7 @@
 					assign_alt_irq (cur_func, class_code);
 					if ((rc = configure_device (cur_func)) < 0) {
 						/* We need to do this in case some other BARs were properly inserted */
-						err ("was not able to configure devfunc %x on bus %x. \n",
+						err ("was not able to configure devfunc %x on bus %x.\n",
 						     cur_func->device, cur_func->busno);
 						cleanup_count = 6;
 						goto error;
@@ -166,7 +166,7 @@
 					}
 					newfunc = (struct pci_func *) kmalloc (sizeof (struct pci_func), GFP_KERNEL);
 					if (!newfunc) {
-						err ("out of system memory \n");
+						err ("out of system memory\n");
 						return -ENOMEM;
 					}
 					memset (newfunc, 0, sizeof (struct pci_func));
@@ -188,7 +188,7 @@
 					rc = configure_bridge (&cur_func, slotno);
 					if (rc == -ENODEV) {
 						err ("You chose to insert Single Bridge, or nested bridges, this is not supported...\n");
-						err ("Bus %x, devfunc %x \n", cur_func->busno, cur_func->device);
+						err ("Bus %x, devfunc %x\n", cur_func->busno, cur_func->device);
 						return rc;
 					}
 					if (rc) {
@@ -205,7 +205,7 @@
 						if (func->devices[i]) {
 							newfunc = (struct pci_func *) kmalloc (sizeof (struct pci_func), GFP_KERNEL);
 							if (!newfunc) {
-								err ("out of system memory \n");
+								err ("out of system memory\n");
 								return -ENOMEM;
 							}
 							memset (newfunc, 0, sizeof (struct pci_func));
@@ -234,7 +234,7 @@
 
 					newfunc = (struct pci_func *) kmalloc (sizeof (struct pci_func), GFP_KERNEL);
 					if (!newfunc) {
-						err ("out of system memory \n");
+						err ("out of system memory\n");
 						return -ENOMEM;
 					}
 					memset (newfunc, 0, sizeof (struct pci_func));
@@ -261,7 +261,7 @@
 					rc = configure_bridge (&cur_func, slotno);
 					if (rc == -ENODEV) {
 						err ("You chose to insert Single Bridge, or nested bridges, this is not supported...\n");
-						err ("Bus %x, devfunc %x \n", cur_func->busno, cur_func->device);
+						err ("Bus %x, devfunc %x\n", cur_func->busno, cur_func->device);
 						return rc;
 					}
 					if (rc) {
@@ -281,7 +281,7 @@
 							debug ("inside for loop, device is %x\n", i);
 							newfunc = (struct pci_func *) kmalloc (sizeof (struct pci_func), GFP_KERNEL);
 							if (!newfunc) {
-								err (" out of system memory \n");
+								err (" out of system memory\n");
 								return -ENOMEM;
 							}
 							memset (newfunc, 0, sizeof (struct pci_func));
@@ -408,7 +408,7 @@
 			io[count] = kmalloc (sizeof (struct resource_node), GFP_KERNEL);
 
 			if (!io[count]) {
-				err ("out of system memory \n");
+				err ("out of system memory\n");
 				return -ENOMEM;
 			}
 			memset (io[count], 0, sizeof (struct resource_node));
@@ -446,7 +446,7 @@
 
 				pfmem[count] = kmalloc (sizeof (struct resource_node), GFP_KERNEL);
 				if (!pfmem[count]) {
-					err ("out of system memory \n");
+					err ("out of system memory\n");
 					return -ENOMEM;
 				}
 				memset (pfmem[count], 0, sizeof (struct resource_node));
@@ -461,7 +461,7 @@
 				} else {
 					mem_tmp = kmalloc (sizeof (struct resource_node), GFP_KERNEL);
 					if (!mem_tmp) {
-						err ("out of system memory \n");
+						err ("out of system memory\n");
 						kfree (pfmem[count]);
 						return -ENOMEM;
 					}
@@ -513,7 +513,7 @@
 
 				mem[count] = kmalloc (sizeof (struct resource_node), GFP_KERNEL);
 				if (!mem[count]) {
-					err ("out of system memory \n");
+					err ("out of system memory\n");
 					return -ENOMEM;
 				}
 				memset (mem[count], 0, sizeof (struct resource_node));
@@ -620,7 +620,7 @@
 	/* in EBDA, only get allocated 1 additional bus # per slot */
 	sec_number = find_sec_number (func->busno, slotno);
 	if (sec_number == 0xff) {
-		err ("cannot allocate secondary bus number for the bridged device \n");
+		err ("cannot allocate secondary bus number for the bridged device\n");
 		return -EINVAL;
 	}
 
@@ -678,7 +678,7 @@
 			bus_io[count] = kmalloc (sizeof (struct resource_node), GFP_KERNEL);
 		
 			if (!bus_io[count]) {
-				err ("out of system memory \n");
+				err ("out of system memory\n");
 				retval = -ENOMEM;
 				goto error;
 			}
@@ -710,7 +710,7 @@
 
 				bus_pfmem[count] = kmalloc (sizeof (struct resource_node), GFP_KERNEL);
 				if (!bus_pfmem[count]) {
-					err ("out of system memory \n");
+					err ("out of system memory\n");
 					retval = -ENOMEM;
 					goto error;
 				}
@@ -726,7 +726,7 @@
 				} else {
 					mem_tmp = kmalloc (sizeof (struct resource_node), GFP_KERNEL);
 					if (!mem_tmp) {
-						err ("out of system memory \n");
+						err ("out of system memory\n");
 						retval = -ENOMEM;
 						goto error;
 					}
@@ -768,7 +768,7 @@
 
 				bus_mem[count] = kmalloc (sizeof (struct resource_node), GFP_KERNEL);
 				if (!bus_mem[count]) {
-					err ("out of system memory \n");
+					err ("out of system memory\n");
 					retval = -ENOMEM;
 					goto error;
 				}
@@ -813,7 +813,7 @@
 	debug ("amount_needed->pfmem =  %x\n", amount_needed->pfmem);
 
 	if (amount_needed->not_correct) {		
-		debug ("amount_needed is not correct \n");
+		debug ("amount_needed is not correct\n");
 		for (count = 0; address[count]; count++) {
 			/* for 2 BARs */
 			if (bus_io[count]) {
@@ -835,11 +835,11 @@
 		debug ("it doesn't want IO?\n");
 		flag_io = TRUE;
 	} else {
-		debug ("it wants %x IO behind the bridge \n", amount_needed->io);
+		debug ("it wants %x IO behind the bridge\n", amount_needed->io);
 		io = kmalloc (sizeof (struct resource_node), GFP_KERNEL);
 		
 		if (!io) {
-			err ("out of system memory \n");
+			err ("out of system memory\n");
 			retval = -ENOMEM;
 			goto error;
 		}
@@ -862,7 +862,7 @@
 		debug ("it wants %x memory behind the bridge\n", amount_needed->mem);
 		mem = kmalloc (sizeof (struct resource_node), GFP_KERNEL);
 		if (!mem) {
-			err ("out of system memory \n");
+			err ("out of system memory\n");
 			retval = -ENOMEM;
 			goto error;
 		}
@@ -885,7 +885,7 @@
 		debug ("it wants %x pfmemory behind the bridge\n", amount_needed->pfmem);
 		pfmem = kmalloc (sizeof (struct resource_node), GFP_KERNEL);
 		if (!pfmem) {
-			err ("out of system memory \n");
+			err ("out of system memory\n");
 			retval = -ENOMEM;
 			goto error;
 		}
@@ -901,7 +901,7 @@
 		} else {
 			mem_tmp = kmalloc (sizeof (struct resource_node), GFP_KERNEL);
 			if (!mem_tmp) {
-				err ("out of system memory \n");
+				err ("out of system memory\n");
 				retval = -ENOMEM;
 				goto error;
 			}
@@ -933,7 +933,7 @@
 		if (!bus) {
 			bus = kmalloc (sizeof (struct bus_node), GFP_KERNEL);
 			if (!bus) {
-				err ("out of system memory \n");
+				err ("out of system memory\n");
 				retval = -ENOMEM;
 				goto error;
 			}
@@ -944,7 +944,7 @@
 		} else if (!(bus->rangeIO) && !(bus->rangeMem) && !(bus->rangePFMem))
 			rc = add_new_bus (bus, io, mem, pfmem, 0xFF);
 		else {
-			err ("expected bus structure not empty? \n");
+			err ("expected bus structure not empty?\n");
 			retval = -EIO;
 			goto error;
 		}
@@ -1050,7 +1050,7 @@
 		kfree (amount_needed);
 		return 0;
 	} else {
-		err ("Configuring bridge was unsuccessful... \n");
+		err ("Configuring bridge was unsuccessful...\n");
 		mem_tmp = NULL;
 		retval = -EIO;
 		goto error;
@@ -1171,7 +1171,7 @@
 
 					//tmp_bar = bar[count];
 
-					debug ("count %d device %x function %x wants %x resources \n", count, device, function, bar[count]);
+					debug ("count %d device %x function %x wants %x resources\n", count, device, function, bar[count]);
 
 					if (bar[count] & PCI_BASE_ADDRESS_SPACE_IO) {
 						/* This is IO */
@@ -1522,7 +1522,7 @@
 				case PCI_HEADER_TYPE_NORMAL:
 					rc = unconfigure_boot_device (busno, device, function);
 					if (rc) {
-						err ("was not able to unconfigure device %x func %x on bus %x. bailing out... \n",
+						err ("was not able to unconfigure device %x func %x on bus %x. bailing out...\n",
 						     device, function, busno);
 						return rc;
 					}
@@ -1531,7 +1531,7 @@
 				case PCI_HEADER_TYPE_MULTIDEVICE:
 					rc = unconfigure_boot_device (busno, device, function);
 					if (rc) {
-						err ("was not able to unconfigure device %x func %x on bus %x. bailing out... \n",
+						err ("was not able to unconfigure device %x func %x on bus %x. bailing out...\n",
 						     device, function, busno);
 						return rc;
 					}
@@ -1567,7 +1567,7 @@
 					}
 					break;
 				default:
-					err ("MAJOR PROBLEM!!!! Cannot read device's header \n");
+					err ("MAJOR PROBLEM!!!! Cannot read device's header\n");
 					return -1;
 					break;
 			}	/* end of switch */
@@ -1575,7 +1575,7 @@
 	}	/* end of for */
 
 	if (!valid_device) {
-		err ("Could not find device to unconfigure.  Or could not read the card. \n");
+		err ("Could not find device to unconfigure.  Or could not read the card.\n");
 		return -1;
 	}
 	return 0;
@@ -1623,19 +1623,19 @@
 
 			for (i = 0; i < count; i++) {
 				if (cur_func->io[i]) {
-					debug ("io[%d] exists \n", i);
+					debug ("io[%d] exists\n", i);
 					if (the_end > 0)
 						ibmphp_remove_resource (cur_func->io[i]);
 					cur_func->io[i] = NULL;
 				}
 				if (cur_func->mem[i]) {
-					debug ("mem[%d] exists \n", i);
+					debug ("mem[%d] exists\n", i);
 					if (the_end > 0)
 						ibmphp_remove_resource (cur_func->mem[i]);
 					cur_func->mem[i] = NULL;
 				}
 				if (cur_func->pfmem[i]) {
-					debug ("pfmem[%d] exists \n", i);
+					debug ("pfmem[%d] exists\n", i);
 					if (the_end > 0)
 						ibmphp_remove_resource (cur_func->pfmem[i]);
 					cur_func->pfmem[i] = NULL;
@@ -1682,7 +1682,7 @@
 	if (io) {
 		io_range = kmalloc (sizeof (struct range_node), GFP_KERNEL);
 		if (!io_range) {
-			err ("out of system memory \n");
+			err ("out of system memory\n");
 			return -ENOMEM;
 		}
 		memset (io_range, 0, sizeof (struct range_node));
@@ -1695,7 +1695,7 @@
 	if (mem) {
 		mem_range = kmalloc (sizeof (struct range_node), GFP_KERNEL);
 		if (!mem_range) {
-			err ("out of system memory \n");
+			err ("out of system memory\n");
 			return -ENOMEM;
 		}
 		memset (mem_range, 0, sizeof (struct range_node));
@@ -1708,7 +1708,7 @@
 	if (pfmem) {
 		pfmem_range = kmalloc (sizeof (struct range_node), GFP_KERNEL);
 		if (!pfmem_range) {	
-			err ("out of system memory \n");
+			err ("out of system memory\n");
 			return -ENOMEM;
 		}
 		memset (pfmem_range, 0, sizeof (struct range_node));
--- diff/drivers/pci/hotplug/ibmphp_res.c	2003-09-30 15:46:16.000000000 +0100
+++ source/drivers/pci/hotplug/ibmphp_res.c	2004-02-09 10:39:54.000000000 +0000
@@ -52,13 +52,13 @@
 	struct bus_node * newbus;
 
 	if (!(curr) && !(flag)) {
-		err ("NULL pointer passed \n");
+		err ("NULL pointer passed\n");
 		return NULL;
 	}
 
 	newbus = kmalloc (sizeof (struct bus_node), GFP_KERNEL);
 	if (!newbus) {
-		err ("out of system memory \n");
+		err ("out of system memory\n");
 		return NULL;
 	}
 
@@ -76,13 +76,13 @@
 	struct resource_node *rs;
 	
 	if (!curr) {
-		err ("NULL passed to allocate \n");
+		err ("NULL passed to allocate\n");
 		return NULL;
 	}
 
 	rs = kmalloc (sizeof (struct resource_node), GFP_KERNEL);
 	if (!rs) {
-		err ("out of system memory \n");
+		err ("out of system memory\n");
 		return NULL;
 	}
 	memset (rs, 0, sizeof (struct resource_node));
@@ -103,7 +103,7 @@
 	if (first_bus) {
 		newbus = kmalloc (sizeof (struct bus_node), GFP_KERNEL);
 		if (!newbus) {
-			err ("out of system memory. \n");
+			err ("out of system memory.\n");
 			return -ENOMEM;
 		}
 		memset (newbus, 0, sizeof (struct bus_node));
@@ -127,7 +127,7 @@
 	if (!newrange) {
 		if (first_bus)
 			kfree (newbus);
-		err ("out of system memory \n");
+		err ("out of system memory\n");
 		return -ENOMEM;
 	}
 	memset (newrange, 0, sizeof (struct range_node));
@@ -607,7 +607,7 @@
 	debug ("%s - enter\n", __FUNCTION__);
 
 	if (!res) {
-		err ("NULL passed to add \n");
+		err ("NULL passed to add\n");
 		return -ENODEV;
 	}
 	
@@ -634,7 +634,7 @@
 			res_start = bus_cur->firstPFMem;
 			break;
 		default:
-			err ("cannot read the type of the resource to add... problem \n");
+			err ("cannot read the type of the resource to add... problem\n");
 			return -EINVAL;
 	}
 	while (range_cur) {
@@ -787,7 +787,7 @@
 	char * type = "";
 
 	if (!res)  {
-		err ("resource to remove is NULL \n");
+		err ("resource to remove is NULL\n");
 		return -ENODEV;
 	}
 
@@ -813,7 +813,7 @@
 			type = "pfmem";
 			break;
 		default:
-			err ("unknown type for resource to remove \n");
+			err ("unknown type for resource to remove\n");
 			return -EINVAL;
 	}
 	res_prev = NULL;
@@ -954,7 +954,7 @@
 			range = bus_cur->rangePFMem;
 			break;
 		default:
-			err ("cannot read resource type in find_range \n");
+			err ("cannot read resource type in find_range\n");
 	}
 
 	while (range) {
@@ -1002,7 +1002,7 @@
 
 	if (!bus_cur) {
 		/* didn't find a bus, smth's wrong!!! */
-		debug ("no bus in the system, either pci_dev's wrong or allocation failed \n");
+		debug ("no bus in the system, either pci_dev's wrong or allocation failed\n");
 		return -EINVAL;
 	}
 
@@ -1027,7 +1027,7 @@
 			noranges = bus_cur->noPFMemRanges;
 			break;
 		default:
-			err ("wrong type of resource to check \n");
+			err ("wrong type of resource to check\n");
 			return -EINVAL;
 	}
 	res_prev = NULL;
@@ -1496,7 +1496,7 @@
 	char * type = "";
 
 	if (!bus) {
-		err ("The bus passed in NULL to find resource \n");
+		err ("The bus passed in NULL to find resource\n");
 		return -ENODEV;
 	}
 
@@ -1514,7 +1514,7 @@
 			type = "pfmem";
 			break;
 		default:
-			err ("wrong type of flag \n");
+			err ("wrong type of flag\n");
 			return -EINVAL;
 	}
 	
@@ -1540,17 +1540,17 @@
 				res_cur = res_cur->next;
 			}
 			if (!res_cur) {
-				debug ("SOS...cannot find %s resource in the bus. \n", type);
+				debug ("SOS...cannot find %s resource in the bus.\n", type);
 				return -EINVAL;
 			}
 		} else {
-			debug ("SOS... cannot find %s resource in the bus. \n", type);
+			debug ("SOS... cannot find %s resource in the bus.\n", type);
 			return -EINVAL;
 		}
 	}
 
 	if (*res)
-		debug ("*res->start = %x \n", (*res)->start);
+		debug ("*res->start = %x\n", (*res)->start);
 
 	return 0;
 }
@@ -1708,7 +1708,7 @@
 
 				mem = kmalloc (sizeof (struct resource_node), GFP_KERNEL);		
 				if (!mem) {
-					err ("out of system memory \n");
+					err ("out of system memory\n");
 					return -ENOMEM;
 				}
 				memset (mem, 0, sizeof (struct resource_node));
@@ -1792,7 +1792,7 @@
 
 	list_for_each (tmp, &gbuses) {
 		bus_cur = list_entry (tmp, struct bus_node, bus_list);
-		debug_pci ("This is bus # %d.  There are \n", bus_cur->busno);
+		debug_pci ("This is bus # %d.  There are\n", bus_cur->busno);
 		debug_pci ("IORanges = %d\t", bus_cur->noIORanges);
 		debug_pci ("MemRanges = %d\t", bus_cur->noMemRanges);
 		debug_pci ("PFMemRanges = %d\n", bus_cur->noPFMemRanges);
@@ -1903,7 +1903,7 @@
 			range_cur = bus_cur->rangePFMem;
 			break;
 		default:
-			err ("wrong type passed to find out if range already exists \n");
+			err ("wrong type passed to find out if range already exists\n");
 			return -ENODEV;
 	}
 
@@ -1948,7 +1948,7 @@
 		return -ENODEV;
 	ibmphp_pci_bus->number = bus_cur->busno;
 
-	debug ("inside %s \n", __FUNCTION__);
+	debug ("inside %s\n", __FUNCTION__);
 	debug ("bus_cur->busno = %x\n", bus_cur->busno);
 
 	for (device = 0; device < 32; device++) {
@@ -1997,7 +1997,7 @@
 						if ((start_address) && (start_address <= end_address)) {
 							range = kmalloc (sizeof (struct range_node), GFP_KERNEL);
 							if (!range) {
-								err ("out of system memory \n");
+								err ("out of system memory\n");
 								return -ENOMEM;
 							}
 							memset (range, 0, sizeof (struct range_node));
@@ -2024,7 +2024,7 @@
 								io = kmalloc (sizeof (struct resource_node), GFP_KERNEL);							
 								if (!io) {
 									kfree (range);
-									err ("out of system memory \n");
+									err ("out of system memory\n");
 									return -ENOMEM;
 								}
 								memset (io, 0, sizeof (struct resource_node));
@@ -2048,7 +2048,7 @@
 
 							range = kmalloc (sizeof (struct range_node), GFP_KERNEL);
 							if (!range) {
-								err ("out of system memory \n");
+								err ("out of system memory\n");
 								return -ENOMEM;
 							}
 							memset (range, 0, sizeof (struct range_node));
@@ -2076,7 +2076,7 @@
 								mem = kmalloc (sizeof (struct resource_node), GFP_KERNEL);
 								if (!mem) {
 									kfree (range);
-									err ("out of system memory \n");
+									err ("out of system memory\n");
 									return -ENOMEM;
 								}
 								memset (mem, 0, sizeof (struct resource_node));
@@ -2104,7 +2104,7 @@
 
 							range = kmalloc (sizeof (struct range_node), GFP_KERNEL);
 							if (!range) {
-								err ("out of system memory \n");
+								err ("out of system memory\n");
 								return -ENOMEM;
 							}
 							memset (range, 0, sizeof (struct range_node));
@@ -2131,7 +2131,7 @@
 								pfmem = kmalloc (sizeof (struct resource_node), GFP_KERNEL);
 								if (!pfmem) {
 									kfree (range);
-									err ("out of system memory \n");
+									err ("out of system memory\n");
 									return -ENOMEM;
 								}
 								memset (pfmem, 0, sizeof (struct resource_node));
--- diff/drivers/pci/pci-driver.c	2003-09-30 15:46:16.000000000 +0100
+++ source/drivers/pci/pci-driver.c	2004-02-09 10:39:54.000000000 +0000
@@ -241,7 +241,7 @@
 		error = drv->probe(pci_dev, id);
 	if (error >= 0) {
 		pci_dev->driver = drv;
-		return 0;
+		error = 0;
 	}
 	return error;
 }
--- diff/drivers/pci/pci-sysfs.c	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/pci/pci-sysfs.c	2004-02-09 10:39:54.000000000 +0000
@@ -71,7 +71,7 @@
 
 	/* Several chips lock up trying to read undefined config space */
 	if (capable(CAP_SYS_ADMIN)) {
-		size = 256;
+		size = dev->cfg_size;
 	} else if (dev->hdr_type == PCI_HEADER_TYPE_CARDBUS) {
 		size = 128;
 	}
@@ -123,10 +123,10 @@
 	unsigned int size = count;
 	loff_t init_off = off;
 
-	if (off > 256)
+	if (off > dev->cfg_size)
 		return 0;
-	if (off + count > 256) {
-		size = 256 - off;
+	if (off + count > dev->cfg_size) {
+		size = dev->cfg_size - off;
 		count = size;
 	}
 
@@ -167,6 +167,16 @@
 	.write = pci_write_config,
 };
 
+static struct bin_attribute pcie_config_attr = {
+	.attr =	{
+		.name = "config",
+		.mode = S_IRUGO | S_IWUSR,
+	},
+	.size = 4096,
+	.read = pci_read_config,
+	.write = pci_write_config,
+};
+
 void pci_create_sysfs_dev_files (struct pci_dev *pdev)
 {
 	struct device *dev = &pdev->dev;
@@ -179,5 +189,9 @@
 	device_create_file (dev, &dev_attr_class);
 	device_create_file (dev, &dev_attr_irq);
 	device_create_file (dev, &dev_attr_resource);
-	sysfs_create_bin_file(&dev->kobj, &pci_config_attr);
+	if (pdev->cfg_size < 4096) {
+		sysfs_create_bin_file(&dev->kobj, &pci_config_attr);
+	} else {
+		sysfs_create_bin_file(&dev->kobj, &pcie_config_attr);
+	}
 }
--- diff/drivers/pci/pci.c	2003-10-09 09:47:34.000000000 +0100
+++ source/drivers/pci/pci.c	2004-02-09 10:39:54.000000000 +0000
@@ -90,6 +90,8 @@
  *  %PCI_CAP_ID_CHSWP        CompactPCI HotSwap 
  *
  *  %PCI_CAP_ID_PCIX         PCI-X
+ *
+ *  %PCI_CAP_ID_EXP          PCI Express
  */
 int
 pci_find_capability(struct pci_dev *dev, int cap)
@@ -223,6 +225,8 @@
 	int pm;
 	u16 pmcsr;
 
+	might_sleep();
+
 	/* bound the state we're entering */
 	if (state > 3) state = 3;
 
--- diff/drivers/pci/pci.ids	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/pci/pci.ids	2004-02-09 10:39:54.000000000 +0000
@@ -5871,6 +5871,11 @@
 		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
@@ -6667,6 +6672,9 @@
 	1040  536EP Data Fax Modem
 		16be 1040  V.9X DSP Data Fax Modem
 	1043  PRO/Wireless LAN 2100 3B Mini PCI Adapter
+	1048  82597EX 10GbE Ethernet Controller
+		8086 a01f  PRO/10GbE LR Server Adapter
+		8086 a11f  PRO/10GbE LR Server Adapter
 	1059  82551QM Ethernet Controller
 	1130  82815 815 Chipset Host Bridge and Memory Controller Hub
 		1025 1016  Travelmate 612 TX
--- diff/drivers/pci/probe.c	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/pci/probe.c	2004-02-09 10:39:54.000000000 +0000
@@ -18,6 +18,8 @@
 
 #define CARDBUS_LATENCY_TIMER	176	/* secondary latency timer */
 #define CARDBUS_RESERVE_BUSNR	3
+#define PCI_CFG_SPACE_SIZE	256
+#define PCI_CFG_SPACE_EXP_SIZE	4096
 
 /* Ugh.  Need to stop exporting this to modules. */
 LIST_HEAD(pci_root_buses);
@@ -214,7 +216,7 @@
 		limit |= (io_limit_hi << 16);
 	}
 
-	if (base && base <= limit) {
+	if (base <= limit) {
 		res->flags = (io_base_lo & PCI_IO_RANGE_TYPE_MASK) | IORESOURCE_IO;
 		res->start = base;
 		res->end = limit + 0xfff;
@@ -225,7 +227,7 @@
 	pci_read_config_word(dev, PCI_MEMORY_LIMIT, &mem_limit_lo);
 	base = (mem_base_lo & PCI_MEMORY_RANGE_MASK) << 16;
 	limit = (mem_limit_lo & PCI_MEMORY_RANGE_MASK) << 16;
-	if (base && base <= limit) {
+	if (base <= limit) {
 		res->flags = (mem_base_lo & PCI_MEMORY_RANGE_TYPE_MASK) | IORESOURCE_MEM;
 		res->start = base;
 		res->end = limit + 0xfffff;
@@ -251,7 +253,7 @@
 		}
 #endif
 	}
-	if (base && base <= limit) {
+	if (base <= limit) {
 		res->flags = (mem_base_lo & PCI_MEMORY_RANGE_TYPE_MASK) | IORESOURCE_MEM | IORESOURCE_PREFETCH;
 		res->start = base;
 		res->end = limit + 0xfffff;
@@ -456,8 +458,6 @@
 	sprintf(pci_name(dev), "%04x:%02x:%02x.%d", pci_domain_nr(dev->bus),
 		dev->bus->number, PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn));
 
-	INIT_LIST_HEAD(&dev->pools);
-
 	pci_read_config_dword(dev, PCI_CLASS_REVISION, &class);
 	class >>= 8;				    /* upper 3 bytes */
 	dev->class = class;
@@ -528,6 +528,20 @@
 	kfree(pci_dev);
 }
 
+/**
+ * pci_cfg_space_size - get the configuration space size of the PCI device
+ */
+static int pci_cfg_space_size(struct pci_dev *dev)
+{
+#ifdef CONFIG_PCI_MMCONFIG
+	/* Find whether the device is PCI Express */
+	int is_pci_express_dev = pci_find_capability(dev, PCI_CAP_ID_EXP);
+	if (is_pci_express_dev)
+		return PCI_CFG_SPACE_EXP_SIZE;
+#endif
+	return PCI_CFG_SPACE_SIZE;
+}
+
 /*
  * Read the config data for a PCI device, sanity-check it
  * and fill in the dev structure...
@@ -564,6 +578,7 @@
 	dev->multifunction = !!(hdr_type & 0x80);
 	dev->vendor = l & 0xffff;
 	dev->device = (l >> 16) & 0xffff;
+	dev->cfg_size = pci_cfg_space_size(dev);
 
 	/* Assume 32-bit PCI; let 64-bit PCI cards (which are far rarer)
 	   set this higher, assuming the system even supports it.  */
@@ -620,6 +635,9 @@
 int __devinit pci_scan_slot(struct pci_bus *bus, int devfn)
 {
 	int func, nr = 0;
+	int scan_all_fns;
+
+	scan_all_fns = pcibios_scan_all_fns(bus, devfn);
 
 	for (func = 0; func < 8; func++, devfn++) {
 		struct pci_dev *dev;
@@ -640,7 +658,7 @@
 				}
 			}
 		} else {
-			if (func == 0)
+			if (func == 0 && !scan_all_fns)
 				break;
 		}
 	}
--- diff/drivers/pci/proc.c	2004-01-19 10:22:58.000000000 +0000
+++ source/drivers/pci/proc.c	2004-02-09 10:39:54.000000000 +0000
@@ -16,16 +16,15 @@
 #include <asm/uaccess.h>
 #include <asm/byteorder.h>
 
-#define PCI_CFG_SPACE_SIZE 256
-
 static int proc_initialized;	/* = 0 */
 
 static loff_t
 proc_bus_pci_lseek(struct file *file, loff_t off, int whence)
 {
 	loff_t new = -1;
+	struct inode *inode = file->f_dentry->d_inode;
 
-	down(&file->f_dentry->d_inode->i_sem);
+	down(&inode->i_sem);
 	switch (whence) {
 	case 0:
 		new = off;
@@ -34,14 +33,14 @@
 		new = file->f_pos + off;
 		break;
 	case 2:
-		new = PCI_CFG_SPACE_SIZE + off;
+		new = inode->i_size + off;
 		break;
 	}
-	if (new < 0 || new > PCI_CFG_SPACE_SIZE)
+	if (new < 0 || new > inode->i_size)
 		new = -EINVAL;
 	else
 		file->f_pos = new;
-	up(&file->f_dentry->d_inode->i_sem);
+	up(&inode->i_sem);
 	return new;
 }
 
@@ -61,7 +60,7 @@
 	 */
 
 	if (capable(CAP_SYS_ADMIN))
-		size = PCI_CFG_SPACE_SIZE;
+		size = dev->cfg_size;
 	else if (dev->hdr_type == PCI_HEADER_TYPE_CARDBUS)
 		size = 128;
 	else
@@ -134,14 +133,15 @@
 	const struct proc_dir_entry *dp = PDE(ino);
 	struct pci_dev *dev = dp->data;
 	int pos = *ppos;
+	int size = dev->cfg_size;
 	int cnt;
 
-	if (pos >= PCI_CFG_SPACE_SIZE)
+	if (pos >= size)
 		return 0;
-	if (nbytes >= PCI_CFG_SPACE_SIZE)
-		nbytes = PCI_CFG_SPACE_SIZE;
-	if (pos + nbytes > PCI_CFG_SPACE_SIZE)
-		nbytes = PCI_CFG_SPACE_SIZE - pos;
+	if (nbytes >= size)
+		nbytes = size;
+	if (pos + nbytes > size)
+		nbytes = size - pos;
 	cnt = nbytes;
 
 	if (!access_ok(VERIFY_READ, buf, cnt))
@@ -403,7 +403,7 @@
 		return -ENOMEM;
 	e->proc_fops = &proc_bus_pci_operations;
 	e->data = dev;
-	e->size = PCI_CFG_SPACE_SIZE;
+	e->size = dev->cfg_size;
 
 	return 0;
 }
--- diff/drivers/pci/remove.c	2004-01-19 10:22:58.000000000 +0000
+++ source/drivers/pci/remove.c	2004-02-09 10:39:54.000000000 +0000
@@ -83,7 +83,7 @@
 		list_del(&b->node);
 		spin_unlock(&pci_bus_lock);
 
-		kfree(b);
+		class_device_unregister(&b->class_dev);
 		dev->subordinate = NULL;
 	}
 
--- diff/drivers/pcmcia/bulkmem.c	2003-07-22 18:54:27.000000000 +0100
+++ source/drivers/pcmcia/bulkmem.c	2004-02-09 10:39:54.000000000 +0000
@@ -298,7 +298,7 @@
     {
 	window_handle_t w;
         int ret = pcmcia_request_window(a1, a2, &w);
-        (window_handle_t *)a1 = w;
+        a1 = w;
 	return  ret;
     }
         break;
--- diff/drivers/pnp/Kconfig	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/pnp/Kconfig	2004-02-09 10:39:54.000000000 +0000
@@ -31,33 +31,9 @@
 comment "Protocols"
 	depends on PNP
 
-config ISAPNP
-	bool "ISA Plug and Play support (EXPERIMENTAL)"
-	depends on PNP && EXPERIMENTAL
-	help
-	  Say Y here if you would like support for ISA Plug and Play devices.
-	  Some information is in <file:Documentation/isapnp.txt>.
+source "drivers/pnp/isapnp/Kconfig"
 
-	  If unsure, say Y.
-
-config PNPBIOS
-	bool "Plug and Play BIOS support (EXPERIMENTAL)"
-	depends on PNP && EXPERIMENTAL
-	---help---
-	  Linux uses the PNPBIOS as defined in "Plug and Play BIOS
-	  Specification Version 1.0A May 5, 1994" to autodetect built-in
-	  mainboard resources (e.g. parallel port resources).
-
-	  Some features (e.g. event notification, docking station information,
-	  ISAPNP services) are not used.
-
-	  Note: ACPI is expected to supersede PNPBIOS some day, currently it
-	  co-exists nicely.
-
-	  See latest pcmcia-cs (stand-alone package) for a nice "lspnp" tools,
-	  or have a look at /proc/bus/pnp.
-
-	  If unsure, say Y.
+source "drivers/pnp/pnpbios/Kconfig"
 
 endmenu
 
--- diff/drivers/pnp/card.c	2003-09-30 15:46:16.000000000 +0100
+++ source/drivers/pnp/card.c	2004-02-09 10:39:54.000000000 +0000
@@ -26,8 +26,25 @@
 {
 	const struct pnp_card_device_id * drv_id = drv->id_table;
 	while (*drv_id->id){
-		if (compare_pnp_id(card->id,drv_id->id))
-			return drv_id;
+		if (compare_pnp_id(card->id,drv_id->id)) {
+			int i = 0;
+			for (;;) {
+				int found;
+				struct pnp_dev *dev;
+				if (i == PNP_MAX_DEVICES || ! *drv_id->devs[i].id)
+					return drv_id;
+				found = 0;
+				card_for_each_dev(card, dev) {
+					if (compare_pnp_id(dev->id, drv_id->devs[i].id)) {
+						found = 1;
+						break;
+					}
+				}
+				if (! found)
+					break;
+				i++;
+			}
+		}
 		drv_id++;
 	}
 	return NULL;
@@ -122,6 +139,39 @@
 	kfree(card);
 }
 
+
+static ssize_t pnp_show_card_name(struct device *dmdev, char *buf)
+{
+	char *str = buf;
+	struct pnp_card *card = to_pnp_card(dmdev);
+	str += sprintf(str,"%s\n", card->name);
+	return (str - buf);
+}
+
+static DEVICE_ATTR(name,S_IRUGO,pnp_show_card_name,NULL);
+
+static ssize_t pnp_show_card_ids(struct device *dmdev, char *buf)
+{
+	char *str = buf;
+	struct pnp_card *card = to_pnp_card(dmdev);
+	struct pnp_id * pos = card->id;
+
+	while (pos) {
+		str += sprintf(str,"%s\n", pos->id);
+		pos = pos->next;
+	}
+	return (str - buf);
+}
+
+static DEVICE_ATTR(card_id,S_IRUGO,pnp_show_card_ids,NULL);
+
+static int pnp_interface_attach_card(struct pnp_card *card)
+{
+	device_create_file(&card->dev,&dev_attr_name);
+	device_create_file(&card->dev,&dev_attr_card_id);
+	return 0;
+}
+
 /**
  * pnp_add_card - adds a PnP card to the PnP Layer
  * @card: pointer to the card to add
@@ -141,6 +191,7 @@
 	error = device_register(&card->dev);
 
 	if (error == 0) {
+		pnp_interface_attach_card(card);
 		spin_lock(&pnp_lock);
 		list_add_tail(&card->global_list, &pnp_cards);
 		list_add_tail(&card->protocol_list, &card->protocol->cards);
--- diff/drivers/pnp/isapnp/core.c	2003-09-30 15:46:16.000000000 +0100
+++ source/drivers/pnp/isapnp/core.c	2004-02-09 10:39:54.000000000 +0000
@@ -1039,17 +1039,17 @@
 
 	isapnp_cfg_begin(dev->card->number, dev->number);
 	dev->active = 1;
-	for (tmp = 0; tmp < PNP_MAX_PORT && res->port_resource[tmp].flags & IORESOURCE_IO; tmp++)
+	for (tmp = 0; tmp < PNP_MAX_PORT && (res->port_resource[tmp].flags & (IORESOURCE_IO | IORESOURCE_UNSET)) == IORESOURCE_IO; tmp++)
 		isapnp_write_word(ISAPNP_CFG_PORT+(tmp<<1), res->port_resource[tmp].start);
-	for (tmp = 0; tmp < PNP_MAX_IRQ && res->irq_resource[tmp].flags & IORESOURCE_IRQ; tmp++) {
+	for (tmp = 0; tmp < PNP_MAX_IRQ && (res->irq_resource[tmp].flags & (IORESOURCE_IRQ | IORESOURCE_UNSET)) == IORESOURCE_IRQ; tmp++) {
 		int irq = res->irq_resource[tmp].start;
 		if (irq == 2)
 			irq = 9;
 		isapnp_write_byte(ISAPNP_CFG_IRQ+(tmp<<1), irq);
 	}
-	for (tmp = 0; tmp < PNP_MAX_DMA && res->dma_resource[tmp].flags & IORESOURCE_DMA; tmp++)
+	for (tmp = 0; tmp < PNP_MAX_DMA && (res->dma_resource[tmp].flags & (IORESOURCE_DMA | IORESOURCE_UNSET)) == IORESOURCE_DMA; tmp++)
 		isapnp_write_byte(ISAPNP_CFG_DMA+tmp, res->dma_resource[tmp].start);
-	for (tmp = 0; tmp < PNP_MAX_MEM && res->mem_resource[tmp].flags & IORESOURCE_MEM; tmp++)
+	for (tmp = 0; tmp < PNP_MAX_MEM && (res->mem_resource[tmp].flags & (IORESOURCE_MEM | IORESOURCE_UNSET)) == IORESOURCE_MEM; tmp++)
 		isapnp_write_word(ISAPNP_CFG_MEM+(tmp<<2), (res->mem_resource[tmp].start >> 8) & 0xffff);
 	/* FIXME: We aren't handling 32bit mems properly here */
 	isapnp_activate(dev->number);
--- diff/drivers/pnp/manager.c	2003-08-20 14:16:31.000000000 +0100
+++ source/drivers/pnp/manager.c	2004-02-09 10:39:54.000000000 +0000
@@ -223,25 +223,25 @@
 		table->irq_resource[idx].name = NULL;
 		table->irq_resource[idx].start = -1;
 		table->irq_resource[idx].end = -1;
-		table->irq_resource[idx].flags = IORESOURCE_AUTO | IORESOURCE_UNSET;
+		table->irq_resource[idx].flags = IORESOURCE_IRQ | IORESOURCE_AUTO | IORESOURCE_UNSET;
 	}
 	for (idx = 0; idx < PNP_MAX_DMA; idx++) {
 		table->dma_resource[idx].name = NULL;
 		table->dma_resource[idx].start = -1;
 		table->dma_resource[idx].end = -1;
-		table->dma_resource[idx].flags = IORESOURCE_AUTO | IORESOURCE_UNSET;
+		table->dma_resource[idx].flags = IORESOURCE_DMA | IORESOURCE_AUTO | IORESOURCE_UNSET;
 	}
 	for (idx = 0; idx < PNP_MAX_PORT; idx++) {
 		table->port_resource[idx].name = NULL;
 		table->port_resource[idx].start = 0;
 		table->port_resource[idx].end = 0;
-		table->port_resource[idx].flags = IORESOURCE_AUTO | IORESOURCE_UNSET;
+		table->port_resource[idx].flags = IORESOURCE_IO | IORESOURCE_AUTO | IORESOURCE_UNSET;
 	}
 	for (idx = 0; idx < PNP_MAX_MEM; idx++) {
 		table->mem_resource[idx].name = NULL;
 		table->mem_resource[idx].start = 0;
 		table->mem_resource[idx].end = 0;
-		table->mem_resource[idx].flags = IORESOURCE_AUTO | IORESOURCE_UNSET;
+		table->mem_resource[idx].flags = IORESOURCE_MEM | IORESOURCE_AUTO | IORESOURCE_UNSET;
 	}
 }
 
@@ -258,28 +258,28 @@
 			continue;
 		res->irq_resource[idx].start = -1;
 		res->irq_resource[idx].end = -1;
-		res->irq_resource[idx].flags = IORESOURCE_AUTO | IORESOURCE_UNSET;
+		res->irq_resource[idx].flags = IORESOURCE_IRQ | IORESOURCE_AUTO | IORESOURCE_UNSET;
 	}
 	for (idx = 0; idx < PNP_MAX_DMA; idx++) {
 		if (!(res->dma_resource[idx].flags & IORESOURCE_AUTO))
 			continue;
 		res->dma_resource[idx].start = -1;
 		res->dma_resource[idx].end = -1;
-		res->dma_resource[idx].flags = IORESOURCE_AUTO | IORESOURCE_UNSET;
+		res->dma_resource[idx].flags = IORESOURCE_DMA | IORESOURCE_AUTO | IORESOURCE_UNSET;
 	}
 	for (idx = 0; idx < PNP_MAX_PORT; idx++) {
 		if (!(res->port_resource[idx].flags & IORESOURCE_AUTO))
 			continue;
 		res->port_resource[idx].start = 0;
 		res->port_resource[idx].end = 0;
-		res->port_resource[idx].flags = IORESOURCE_AUTO | IORESOURCE_UNSET;
+		res->port_resource[idx].flags = IORESOURCE_IO | IORESOURCE_AUTO | IORESOURCE_UNSET;
 	}
 	for (idx = 0; idx < PNP_MAX_MEM; idx++) {
 		if (!(res->mem_resource[idx].flags & IORESOURCE_AUTO))
 			continue;
 		res->mem_resource[idx].start = 0;
 		res->mem_resource[idx].end = 0;
-		res->mem_resource[idx].flags = IORESOURCE_AUTO | IORESOURCE_UNSET;
+		res->mem_resource[idx].flags = IORESOURCE_MEM | IORESOURCE_AUTO | IORESOURCE_UNSET;
 	}
 }
 
@@ -550,7 +550,7 @@
 {
 	if (resource == NULL)
 		return;
-	resource->flags &= ~IORESOURCE_AUTO;
+	resource->flags &= ~(IORESOURCE_AUTO | IORESOURCE_UNSET);
 	resource->start = start;
 	resource->end = start + size - 1;
 }
--- diff/drivers/pnp/pnpbios/Makefile	2003-08-20 14:16:31.000000000 +0100
+++ source/drivers/pnp/pnpbios/Makefile	2004-02-09 10:39:54.000000000 +0000
@@ -2,6 +2,6 @@
 # Makefile for the kernel PNPBIOS driver.
 #
 
-pnpbios-proc-$(CONFIG_PROC_FS) = proc.o
+pnpbios-proc-$(CONFIG_PNPBIOS_PROC_FS) = proc.o
 
 obj-y := core.o bioscalls.o rsparser.o $(pnpbios-proc-y)
--- diff/drivers/pnp/pnpbios/core.c	2003-09-30 15:46:16.000000000 +0100
+++ source/drivers/pnp/pnpbios/core.c	2004-02-09 10:39:54.000000000 +0000
@@ -251,7 +251,7 @@
 	node = pnpbios_kmalloc(node_info.max_node_size, GFP_KERNEL);
 	if (!node)
 		return -1;
-	if (pnp_bios_get_dev_node(&nodenum, (char )PNPMODE_STATIC, node))
+	if (pnp_bios_get_dev_node(&nodenum, (char )PNPMODE_DYNAMIC, node))
 		return -ENODEV;
 	if(pnpbios_write_resources_to_node(res, node)<0) {
 		kfree(node);
@@ -264,19 +264,49 @@
 	return ret;
 }
 
+static void pnpbios_zero_data_stream(struct pnp_bios_node * node)
+{
+	unsigned char * p = (char *)node->data;
+	unsigned char * end = (char *)(node->data + node->size);
+	unsigned int len;
+	int i;
+	while ((char *)p < (char *)end) {
+		if(p[0] & 0x80) { /* large tag */
+			len = (p[2] << 8) | p[1];
+			p += 3;
+		} else {
+			if (((p[0]>>3) & 0x0f) == 0x0f)
+				return;
+			len = p[0] & 0x07;
+			p += 1;
+		}
+		for (i = 0; i < len; i++)
+			p[i] = 0;
+		p += len;
+	}
+	printk(KERN_ERR "PnPBIOS: Resource structure did not contain an end tag.\n");
+}
+
 static int pnpbios_disable_resources(struct pnp_dev *dev)
 {
 	struct pnp_bios_node * node;
+	u8 nodenum = dev->number;
 	int ret;
 
 	/* just in case */
 	if(dev->flags & PNPBIOS_NO_DISABLE || !pnpbios_is_dynamic(dev))
 		return -EPERM;
 
-	/* the value of this will be zero */
 	node = pnpbios_kmalloc(node_info.max_node_size, GFP_KERNEL);
 	if (!node)
 		return -ENOMEM;
+
+	if (pnp_bios_get_dev_node(&nodenum, (char )PNPMODE_DYNAMIC, node)) {
+		kfree(node);
+		return -ENODEV;
+	}
+	pnpbios_zero_data_stream(node);
+
 	ret = pnp_bios_set_dev_node(dev->number, (char)PNPMODE_DYNAMIC, node);
 	kfree(node);
 	if (ret > 0)
@@ -435,7 +465,7 @@
 	 */
 	for (check = (union pnp_bios_install_struct *) __va(0xf0000);
 	     check < (union pnp_bios_install_struct *) __va(0xffff0);
-	     ((void *) (check)) += 16) {
+	     check = (void *)check + 16) {
 		if (check->fields.signature != PNP_SIGNATURE)
 			continue;
 		printk(KERN_INFO "PnPBIOS: Found PnP BIOS installation structure at 0x%p\n", check);
--- diff/drivers/pnp/pnpbios/pnpbios.h	2003-09-30 15:46:16.000000000 +0100
+++ source/drivers/pnp/pnpbios/pnpbios.h	2004-02-09 10:39:54.000000000 +0000
@@ -36,7 +36,7 @@
 extern void pnpbios_print_status(const char * module, u16 status);
 extern void pnpbios_calls_init(union pnp_bios_install_struct * header);
 
-#ifdef CONFIG_PROC_FS
+#ifdef CONFIG_PNPBIOS_PROC_FS
 extern int pnpbios_interface_attach_device(struct pnp_bios_node * node);
 extern int pnpbios_proc_init (void);
 extern void pnpbios_proc_exit (void);
@@ -44,4 +44,4 @@
 static inline int pnpbios_interface_attach_device(struct pnp_bios_node * node) { return 0; }
 static inline int pnpbios_proc_init (void) { return 0; }
 static inline void pnpbios_proc_exit (void) { ; }
-#endif /* CONFIG_PROC */
+#endif /* CONFIG_PNPBIOS_PROC_FS */
--- diff/drivers/pnp/pnpbios/rsparser.c	2003-08-20 14:16:36.000000000 +0100
+++ source/drivers/pnp/pnpbios/rsparser.c	2004-02-09 10:39:54.000000000 +0000
@@ -49,7 +49,7 @@
 pnpbios_parse_allocated_irqresource(struct pnp_resource_table * res, int irq)
 {
 	int i = 0;
-	while ((res->irq_resource[i].flags & IORESOURCE_IRQ) && i < PNP_MAX_IRQ) i++;
+	while (!(res->irq_resource[i].flags & IORESOURCE_UNSET) && i < PNP_MAX_IRQ) i++;
 	if (i < PNP_MAX_IRQ) {
 		res->irq_resource[i].flags = IORESOURCE_IRQ;  // Also clears _UNSET flag
 		if (irq == -1) {
@@ -65,7 +65,7 @@
 pnpbios_parse_allocated_dmaresource(struct pnp_resource_table * res, int dma)
 {
 	int i = 0;
-	while ((res->dma_resource[i].flags & IORESOURCE_DMA) && i < PNP_MAX_DMA) i++;
+	while (!(res->dma_resource[i].flags & IORESOURCE_UNSET) && i < PNP_MAX_DMA) i++;
 	if (i < PNP_MAX_DMA) {
 		res->dma_resource[i].flags = IORESOURCE_DMA;  // Also clears _UNSET flag
 		if (dma == -1) {
@@ -81,7 +81,7 @@
 pnpbios_parse_allocated_ioresource(struct pnp_resource_table * res, int io, int len)
 {
 	int i = 0;
-	while ((res->port_resource[i].flags & IORESOURCE_IO) && i < PNP_MAX_PORT) i++;
+	while (!(res->port_resource[i].flags & IORESOURCE_UNSET) && i < PNP_MAX_PORT) i++;
 	if (i < PNP_MAX_PORT) {
 		res->port_resource[i].flags = IORESOURCE_IO;  // Also clears _UNSET flag
 		if (len <= 0 || (io + len -1) >= 0x10003) {
@@ -97,7 +97,7 @@
 pnpbios_parse_allocated_memresource(struct pnp_resource_table * res, int mem, int len)
 {
 	int i = 0;
-	while ((res->mem_resource[i].flags & IORESOURCE_MEM) && i < PNP_MAX_MEM) i++;
+	while (!(res->mem_resource[i].flags & IORESOURCE_UNSET) && i < PNP_MAX_MEM) i++;
 	if (i < PNP_MAX_MEM) {
 		res->mem_resource[i].flags = IORESOURCE_MEM;  // Also clears _UNSET flag
 		if (len <= 0) {
--- diff/drivers/pnp/resource.c	2003-09-30 15:46:16.000000000 +0100
+++ source/drivers/pnp/resource.c	2004-02-09 10:39:54.000000000 +0000
@@ -241,6 +241,9 @@
  (*(enda) >= *(startb) && *(enda) <= *(endb)) || \
  (*(starta) < *(startb) && *(enda) > *(endb)))
 
+#define cannot_compare(flags) \
+((flags) & (IORESOURCE_UNSET | IORESOURCE_DISABLED))
+
 int pnp_check_port(struct pnp_dev * dev, int idx)
 {
 	int tmp;
@@ -250,7 +253,7 @@
 	end = &dev->res.port_resource[idx].end;
 
 	/* if the resource doesn't exist, don't complain about it */
-	if (dev->res.port_resource[idx].flags & IORESOURCE_UNSET)
+	if (cannot_compare(dev->res.port_resource[idx].flags))
 		return 1;
 
 	/* check if the resource is already in use, skip if the
@@ -284,7 +287,7 @@
 			continue;
 		for (tmp = 0; tmp < PNP_MAX_PORT; tmp++) {
 			if (tdev->res.port_resource[tmp].flags & IORESOURCE_IO) {
-				if (pnp_port_flags(dev, tmp) & IORESOURCE_DISABLED)
+				if (cannot_compare(tdev->res.port_resource[tmp].flags))
 					continue;
 				tport = &tdev->res.port_resource[tmp].start;
 				tend = &tdev->res.port_resource[tmp].end;
@@ -306,7 +309,7 @@
 	end = &dev->res.mem_resource[idx].end;
 
 	/* if the resource doesn't exist, don't complain about it */
-	if (dev->res.mem_resource[idx].flags & IORESOURCE_UNSET)
+	if (cannot_compare(dev->res.mem_resource[idx].flags))
 		return 1;
 
 	/* check if the resource is already in use, skip if the
@@ -340,7 +343,7 @@
 			continue;
 		for (tmp = 0; tmp < PNP_MAX_MEM; tmp++) {
 			if (tdev->res.mem_resource[tmp].flags & IORESOURCE_MEM) {
-				if (pnp_mem_flags(dev, tmp) & IORESOURCE_DISABLED)
+				if (cannot_compare(tdev->res.mem_resource[tmp].flags))
 					continue;
 				taddr = &tdev->res.mem_resource[tmp].start;
 				tend = &tdev->res.mem_resource[tmp].end;
@@ -365,7 +368,7 @@
 	unsigned long * irq = &dev->res.irq_resource[idx].start;
 
 	/* if the resource doesn't exist, don't complain about it */
-	if (dev->res.irq_resource[idx].flags & IORESOURCE_UNSET)
+	if (cannot_compare(dev->res.irq_resource[idx].flags))
 		return 1;
 
 	/* check if the resource is valid */
@@ -411,7 +414,7 @@
 			continue;
 		for (tmp = 0; tmp < PNP_MAX_IRQ; tmp++) {
 			if (tdev->res.irq_resource[tmp].flags & IORESOURCE_IRQ) {
-				if (pnp_irq_flags(dev, tmp) & IORESOURCE_DISABLED)
+				if (cannot_compare(tdev->res.irq_resource[tmp].flags))
 					continue;
 				if ((tdev->res.irq_resource[tmp].start == *irq))
 					return 0;
@@ -429,7 +432,7 @@
 	unsigned long * dma = &dev->res.dma_resource[idx].start;
 
 	/* if the resource doesn't exist, don't complain about it */
-	if (dev->res.dma_resource[idx].flags & IORESOURCE_UNSET)
+	if (cannot_compare(dev->res.dma_resource[idx].flags))
 		return 1;
 
 	/* check if the resource is valid */
@@ -464,7 +467,7 @@
 			continue;
 		for (tmp = 0; tmp < PNP_MAX_DMA; tmp++) {
 			if (tdev->res.dma_resource[tmp].flags & IORESOURCE_DMA) {
-				if (pnp_dma_flags(dev, tmp) & IORESOURCE_DISABLED)
+				if (cannot_compare(tdev->res.dma_resource[tmp].flags))
 					continue;
 				if ((tdev->res.dma_resource[tmp].start == *dma))
 					return 0;
--- diff/drivers/s390/char/tape_core.c	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/s390/char/tape_core.c	2004-02-09 10:39:54.000000000 +0000
@@ -81,7 +81,7 @@
 	struct tape_device *tdev;
 
 	tdev = (struct tape_device *) dev->driver_data;
-	return snprintf(buf, PAGE_SIZE, "%i\n", tdev->medium_state);
+	return scnprintf(buf, PAGE_SIZE, "%i\n", tdev->medium_state);
 }
 
 static
@@ -93,7 +93,7 @@
 	struct tape_device *tdev;
 
 	tdev = (struct tape_device *) dev->driver_data;
-	return snprintf(buf, PAGE_SIZE, "%i\n", tdev->first_minor);
+	return scnprintf(buf, PAGE_SIZE, "%i\n", tdev->first_minor);
 }
 
 static
@@ -105,7 +105,7 @@
 	struct tape_device *tdev;
 
 	tdev = (struct tape_device *) dev->driver_data;
-	return snprintf(buf, PAGE_SIZE, "%s\n", (tdev->first_minor < 0) ?
+	return scnprintf(buf, PAGE_SIZE, "%s\n", (tdev->first_minor < 0) ?
 		"OFFLINE" : tape_state_verbose[tdev->tape_state]);
 }
 
@@ -120,17 +120,17 @@
 
 	tdev = (struct tape_device *) dev->driver_data;
 	if (tdev->first_minor < 0)
-		return snprintf(buf, PAGE_SIZE, "N/A\n");
+		return scnprintf(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");
+		rc = scnprintf(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]);
+		rc = scnprintf(buf,PAGE_SIZE, "%s\n", tape_op_verbose[req->op]);
 	}
 	spin_unlock_irq(get_ccwdev_lock(tdev->cdev));
 	return rc;
@@ -146,7 +146,7 @@
 
 	tdev = (struct tape_device *) dev->driver_data;
 
-	return snprintf(buf, PAGE_SIZE, "%i\n", tdev->char_data.block_size);
+	return scnprintf(buf, PAGE_SIZE, "%i\n", tdev->char_data.block_size);
 }
 
 static
--- diff/drivers/s390/cio/device.c	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/s390/cio/device.c	2004-02-09 10:39:54.000000000 +0000
@@ -73,7 +73,7 @@
 	/* what we want to pass to /sbin/hotplug */
 
 	envp[i++] = buffer;
-	length += snprintf(buffer, buffer_size - length, "CU_TYPE=%04X",
+	length += scnprintf(buffer, buffer_size - length, "CU_TYPE=%04X",
 			   cdev->id.cu_type);
 	if ((buffer_size - length <= 0) || (i >= num_envp))
 		return -ENOMEM;
@@ -81,7 +81,7 @@
 	buffer += length;
 
 	envp[i++] = buffer;
-	length += snprintf(buffer, buffer_size - length, "CU_MODEL=%02X",
+	length += scnprintf(buffer, buffer_size - length, "CU_MODEL=%02X",
 			   cdev->id.cu_model);
 	if ((buffer_size - length <= 0) || (i >= num_envp))
 		return -ENOMEM;
@@ -90,7 +90,7 @@
 
 	/* The next two can be zero, that's ok for us */
 	envp[i++] = buffer;
-	length += snprintf(buffer, buffer_size - length, "DEV_TYPE=%04X",
+	length += scnprintf(buffer, buffer_size - length, "DEV_TYPE=%04X",
 			   cdev->id.dev_type);
 	if ((buffer_size - length <= 0) || (i >= num_envp))
 		return -ENOMEM;
@@ -98,7 +98,7 @@
 	buffer += length;
 
 	envp[i++] = buffer;
-	length += snprintf(buffer, buffer_size - length, "DEV_MODEL=%02X",
+	length += scnprintf(buffer, buffer_size - length, "DEV_MODEL=%02X",
 			   cdev->id.dev_model);
 	if ((buffer_size - length <= 0) || (i >= num_envp))
 		return -ENOMEM;
--- diff/drivers/s390/net/ctctty.c	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/s390/net/ctctty.c	2004-02-09 10:39:54.000000000 +0000
@@ -655,14 +655,19 @@
 }
 
 
-static int
-ctc_tty_get_ctc_tty_info(ctc_tty_info * info, uint * value)
+static int ctc_tty_tiocmget(struct tty_struct *tty, struct file *file)
 {
+	ctc_tty_info *info = (ctc_tty_info *) tty->driver_data;
 	u_char control,
 	 status;
 	uint result;
 	ulong flags;
 
+	if (ctc_tty_paranoia_check(info, tty->name, "ctc_tty_ioctl"))
+		return -ENODEV;
+	if (tty->flags & (1 << TTY_IO_ERROR))
+		return -EIO;
+
 	control = info->mcr;
 	spin_lock_irqsave(&ctc_tty_lock, flags);
 	status = info->msr;
@@ -673,51 +678,31 @@
 	    | ((status & UART_MSR_RI) ? TIOCM_RNG : 0)
 	    | ((status & UART_MSR_DSR) ? TIOCM_DSR : 0)
 	    | ((status & UART_MSR_CTS) ? TIOCM_CTS : 0);
-	put_user(result, (uint *) value);
-	return 0;
+	return result;
 }
 
 static int
-ctc_tty_set_ctc_tty_info(ctc_tty_info * info, uint cmd, uint * value)
+ctc_tty_tiocmset(struct tty_struct *tty, struct file *file,
+		 unsigned int set, unsigned int clear)
 {
-	uint arg;
-	int old_mcr = info->mcr & (UART_MCR_RTS | UART_MCR_DTR);
+	ctc_tty_info *info = (ctc_tty_info *) tty->driver_data;
 
-	get_user(arg, (uint *) value);
-	switch (cmd) {
-		case TIOCMBIS:
-#ifdef CTC_DEBUG_MODEM_IOCTL
-			printk(KERN_DEBUG "%s%d ioctl TIOCMBIS\n", CTC_TTY_NAME,
-			       info->line);
-#endif
-			if (arg & TIOCM_RTS)
-				info->mcr |= UART_MCR_RTS;
-			if (arg & TIOCM_DTR)
-				info->mcr |= UART_MCR_DTR;
-			break;
-		case TIOCMBIC:
-#ifdef CTC_DEBUG_MODEM_IOCTL
-			printk(KERN_DEBUG "%s%d ioctl TIOCMBIC\n", CTC_TTY_NAME,
-			       info->line);
-#endif
-			if (arg & TIOCM_RTS)
-				info->mcr &= ~UART_MCR_RTS;
-			if (arg & TIOCM_DTR)
-				info->mcr &= ~UART_MCR_DTR;
-			break;
-		case TIOCMSET:
-#ifdef CTC_DEBUG_MODEM_IOCTL
-			printk(KERN_DEBUG "%s%d ioctl TIOCMSET\n", CTC_TTY_NAME,
-			       info->line);
-#endif
-			info->mcr = ((info->mcr & ~(UART_MCR_RTS | UART_MCR_DTR))
-				 | ((arg & TIOCM_RTS) ? UART_MCR_RTS : 0)
-			       | ((arg & TIOCM_DTR) ? UART_MCR_DTR : 0));
-			break;
-		default:
-			return -EINVAL;
-	}
-	if ((info->mcr  & (UART_MCR_RTS | UART_MCR_DTR)) != old_mcr)
+	if (ctc_tty_paranoia_check(info, tty->name, "ctc_tty_ioctl"))
+		return -ENODEV;
+	if (tty->flags & (1 << TTY_IO_ERROR))
+		return -EIO;
+
+	if (set & TIOCM_RTS)
+		info->mcr |= UART_MCR_RTS;
+	if (set & TIOCM_DTR)
+		info->mcr |= UART_MCR_DTR;
+
+	if (clear & TIOCM_RTS)
+		info->mcr &= ~UART_MCR_RTS;
+	if (clear & TIOCM_DTR)
+		info->mcr &= ~UART_MCR_DTR;
+
+	if ((set | clear) & (TIOCM_RTS|TIOCM_DTR))
 		ctc_tty_transmit_status(info);
 	return 0;
 }
@@ -772,22 +757,6 @@
 			    ((tty->termios->c_cflag & ~CLOCAL) |
 			     (arg ? CLOCAL : 0));
 			return 0;
-		case TIOCMGET:
-#ifdef CTC_DEBUG_MODEM_IOCTL
-			printk(KERN_DEBUG "%s%d ioctl TIOCMGET\n", CTC_TTY_NAME,
-			       info->line);
-#endif
-			error = verify_area(VERIFY_WRITE, (void *) arg, sizeof(uint));
-			if (error)
-				return error;
-			return ctc_tty_get_ctc_tty_info(info, (uint *) arg);
-		case TIOCMBIS:
-		case TIOCMBIC:
-		case TIOCMSET:
-			error = verify_area(VERIFY_READ, (void *) arg, sizeof(uint));
-			if (error)
-				return error;
-			return ctc_tty_set_ctc_tty_info(info, cmd, (uint *) arg);
 		case TIOCSERGETLSR:	/* Get line status register */
 #ifdef CTC_DEBUG_MODEM_IOCTL
 			printk(KERN_DEBUG "%s%d ioctl TIOCSERGETLSR\n", CTC_TTY_NAME,
@@ -1139,6 +1108,8 @@
 	.unthrottle = ctc_tty_unthrottle,
 	.set_termios = ctc_tty_set_termios,
 	.hangup = ctc_tty_hangup,
+	.tiocmget = ctc_tty_tiocmget,
+	.tiocmset = ctc_tty_tiocmset,
 };
 
 int
--- diff/drivers/s390/net/lcs.c	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/s390/net/lcs.c	2004-02-09 10:39:54.000000000 +0000
@@ -360,7 +360,7 @@
 		kfree(ipm_list);
 	}
 #endif
-	kfree(card->dev);
+	free_netdev(card->dev);
 	/* Cleanup channels. */
 	lcs_cleanup_channel(&card->write);
 	lcs_cleanup_channel(&card->read);
@@ -1858,8 +1858,7 @@
 	lcs_stopcard(card);
 	return 0;
 out:
-	lcs_cleanup_channel(&card->read);
-	lcs_cleanup_channel(&card->write);
+	lcs_cleanup_card(card);
 	lcs_free_card(card);
 	return -ENODEV;
 }
--- diff/drivers/s390/net/netiucv.c	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/s390/net/netiucv.c	2004-02-09 10:39:54.000000000 +0000
@@ -1473,6 +1473,14 @@
 	sysfs_remove_group(&dev->kobj, &netiucv_attr_group);
 }
 
+/*
+ * XXX: Don't use sysfs unless you know WTF you are doing.
+ * This particular turd registers sysfs objects embedded into netiucv_priv
+ * which is kfreed without any regard to possible sysfs references.
+ * As the result, the wanker who'd decided that sysfs exports were too hip and
+ * cute to resist had generated a set of user-exploitable holes in this driver.
+ */
+
 static int
 netiucv_register_device(struct net_device *ndev, int ifno)
 {
@@ -1592,6 +1600,22 @@
 	}
 }
 
+static void setup_netiucv(struct net_device *dev)
+{
+	dev->mtu	         = NETIUCV_MTU_DEFAULT;
+	dev->hard_start_xmit     = netiucv_tx;
+	dev->open	         = netiucv_open;
+	dev->stop	         = netiucv_close;
+	dev->get_stats	         = netiucv_stats;
+	dev->change_mtu          = netiucv_change_mtu;
+	dev->hard_header_len     = NETIUCV_HDRLEN;
+	dev->addr_len            = 0;
+	dev->type                = ARPHRD_SLIP;
+	dev->tx_queue_len        = NETIUCV_QUEUELEN_DEFAULT;
+	dev->flags	         = IFF_POINTOPOINT | IFF_NOARP;
+	SET_MODULE_OWNER(dev);
+}
+
 /**
  * Allocate and initialize everything of a net device.
  */
@@ -1601,16 +1625,15 @@
 	struct netiucv_priv *privptr;
 	int          priv_size;
 
-	struct net_device *dev = kmalloc(sizeof(struct net_device), GFP_KERNEL);
+	struct net_device *dev = alloc_netdev(0, "", setup_netiucv);
 	if (!dev)
 		return NULL;
-	memset(dev, 0, sizeof(struct net_device));
 	sprintf(dev->name, "iucv%d", ifno);
 
 	priv_size = sizeof(struct netiucv_priv);
 	dev->priv = kmalloc(priv_size, GFP_KERNEL);
 	if (dev->priv == NULL) {
-		kfree(dev);
+		free_netdev(dev);
 		return NULL;
 	}
         memset(dev->priv, 0, priv_size);
@@ -1620,30 +1643,18 @@
 				dev_fsm, DEV_FSM_LEN, GFP_KERNEL);
 	if (privptr->fsm == NULL) {
 		kfree(privptr);
-		kfree(dev);
+		free_netdev(dev);
 		return NULL;
 	}
 	privptr->conn = netiucv_new_connection(dev, username);
 	if (!privptr->conn) {
 		kfree_fsm(privptr->fsm);
 		kfree(privptr);
-		kfree(dev);
+		free_netdev(dev);
 		return NULL;
 	}
 
 	fsm_newstate(privptr->fsm, DEV_STATE_STOPPED);
-	dev->mtu	         = NETIUCV_MTU_DEFAULT;
-	dev->hard_start_xmit     = netiucv_tx;
-	dev->open	         = netiucv_open;
-	dev->stop	         = netiucv_close;
-	dev->get_stats	         = netiucv_stats;
-	dev->change_mtu          = netiucv_change_mtu;
-	dev->hard_header_len     = NETIUCV_HDRLEN;
-	dev->addr_len            = 0;
-	dev->type                = ARPHRD_SLIP;
-	dev->tx_queue_len        = NETIUCV_QUEUELEN_DEFAULT;
-	dev->flags	         = IFF_POINTOPOINT | IFF_NOARP;
-	SET_MODULE_OWNER(dev);
 	return dev;
 }
 
--- diff/drivers/s390/net/qeth.c	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/s390/net/qeth.c	2004-02-09 10:39:54.000000000 +0000
@@ -6707,15 +6707,6 @@
 }
 
 static void
-qeth_destructor(struct net_device *dev)
-{
-	struct qeth_card *card;
-
-	card = (struct qeth_card *) (dev->priv);
-	QETH_DBF_CARD2(0, trace, "dstr", card);
-}
-
-static void
 qeth_set_multicast_list(struct net_device *dev)
 {
 	struct qeth_card *card = dev->priv;
@@ -7655,28 +7646,11 @@
 
 	QETH_DBF_CARD3(0, trace, "inid", card);
 
-	dev->tx_timeout = &qeth_tx_timeout;
-	dev->watchdog_timeo = QETH_TX_TIMEOUT;
-	dev->open = qeth_open;
-	dev->stop = qeth_stop;
-	dev->set_config = qeth_set_config;
-	dev->hard_start_xmit = qeth_hard_start_xmit;
-	dev->do_ioctl = qeth_do_ioctl;
-	dev->get_stats = qeth_get_stats;
-	dev->change_mtu = qeth_change_mtu;
-#ifdef QETH_VLAN
-	dev->vlan_rx_register = qeth_vlan_rx_register;
-	dev->vlan_rx_kill_vid = qeth_vlan_rx_kill_vid;
-#endif
 	dev->rebuild_header = __qeth_rebuild_header_func(card);
 	dev->hard_header = __qeth_hard_header_func(card);
 	dev->header_cache_update = __qeth_header_cache_update_func(card);
 	dev->hard_header_cache = __qeth_hard_header_cache_func(card);
 	dev->hard_header_parse = NULL;
-	dev->destructor = qeth_destructor;
-	dev->set_multicast_list = qeth_set_multicast_list;
-	dev->set_mac_address = qeth_set_mac_address;
-	dev->neigh_setup = qeth_neigh_setup;
 
 	dev->flags |= qeth_get_additional_dev_flags(card->type);
 
@@ -7694,8 +7668,6 @@
 	dev->tx_queue_len = qeth_get_device_tx_q_len(card->type);
 	dev->hard_header_len =
 		qeth_get_hlen(card->link_type) + card->options.add_hhlen;
-	dev->addr_len = OSA_ADDR_LEN;	/* is ok for eth, tr, atm lane */
-	SET_MODULE_OWNER(dev);
 	netif_start_queue(dev);
 
 	dev->mtu = card->initial_mtu;
@@ -8358,6 +8330,28 @@
 	card->options.fake_ll = DONT_FAKE_LL;
 }
 
+static void qeth_setup(struct net_device *dev)
+{
+	dev->tx_timeout = &qeth_tx_timeout;
+	dev->watchdog_timeo = QETH_TX_TIMEOUT;
+	dev->open = qeth_open;
+	dev->stop = qeth_stop;
+	dev->set_config = qeth_set_config;
+	dev->hard_start_xmit = qeth_hard_start_xmit;
+	dev->do_ioctl = qeth_do_ioctl;
+	dev->get_stats = qeth_get_stats;
+	dev->change_mtu = qeth_change_mtu;
+#ifdef QETH_VLAN
+	dev->vlan_rx_register = qeth_vlan_rx_register;
+	dev->vlan_rx_kill_vid = qeth_vlan_rx_kill_vid;
+#endif
+	dev->set_multicast_list = qeth_set_multicast_list;
+	dev->set_mac_address = qeth_set_mac_address;
+	dev->neigh_setup = qeth_neigh_setup;
+	dev->addr_len = OSA_ADDR_LEN;	/* is ok for eth, tr, atm lane */
+	SET_MODULE_OWNER(dev);
+}
+
 static int
 qeth_alloc_card_stuff(struct qeth_card *card)
 {
@@ -8385,11 +8379,9 @@
 		goto exit_dma2;
 	memset(card->dma_stuff->sendbuf, 0, QETH_BUFSIZE);
 
-	card->dev = (struct net_device *) kmalloc(sizeof (struct net_device),
-						  GFP_KERNEL);
+	card->dev = alloc_netdev(0, "", qeth_setup);
 	if (!card->dev)
 		goto exit_dev;
-	memset(card->dev, 0, sizeof (struct net_device));
 
 	card->stats =
 	    (struct net_device_stats *)
@@ -9802,28 +9794,28 @@
 qeth_get_internal_functions(void)
 {
 	struct net_device *dev;
-
-	dev = (struct net_device *) kmalloc(sizeof (struct net_device),
-					    GFP_KERNEL);
+#ifdef CONFIG_NET_ETHERNET
+	dev = alloc_etherdev(0);
 	if (!dev) {
 		PRINT_ERR("Not enough memory for internal functions.\n");
 		return -ENOMEM;
 	}
-#ifdef CONFIG_NET_ETHERNET
-	ether_setup(dev);
 	qeth_my_eth_header = dev->hard_header;
 	qeth_my_eth_rebuild_header = dev->rebuild_header;
 	qeth_my_eth_header_cache = dev->hard_header_cache;
 	qeth_my_eth_header_cache_update = dev->header_cache_update;
+	free_netdev(dev);
 #endif
 #ifdef CONFIG_TR
-	tr_setup(dev);
+	dev = alloc_trdev(0);
+	if (!dev) {
+		PRINT_ERR("Not enough memory for internal functions.\n");
+		return -ENOMEM;
+	}
 	qeth_my_tr_header = dev->hard_header;
 	qeth_my_tr_rebuild_header = dev->rebuild_header;
+	free_netdev(dev);
 #endif
-
-	kfree(dev);
-
 	return 0;
 }
 
--- diff/drivers/sbus/char/aurora.c	2003-06-30 10:07:22.000000000 +0100
+++ source/drivers/sbus/char/aurora.c	2004-02-09 10:39:54.000000000 +0000
@@ -1752,8 +1752,9 @@
 #endif
 }
 
-static int aurora_get_modem_info(struct Aurora_port * port, unsigned int *value)
+static int aurora_tiocmget(struct tty_struct *tty, struct file *file)
 {
+	struct Aurora_port *port = (struct Aurora_port *) tty->driver_data;
 	struct Aurora_board * bp;
 	unsigned char status,chip;
 	unsigned int result;
@@ -1762,6 +1763,9 @@
 #ifdef AURORA_DEBUG
 	printk("aurora_get_modem_info: start\n");
 #endif
+	if ((aurora_paranoia_check(port, tty->name, __FUNCTION__))
+		return -ENODEV;
+
 	chip = AURORA_CD180(port_No(port));
 
 	bp = port_Board(port);
@@ -1782,16 +1786,16 @@
 		| ((status & MSVR_DSR) ? TIOCM_DSR : 0)
 		| ((status & MSVR_CTS) ? TIOCM_CTS : 0);
 
-	put_user(result,(unsigned long *) value);
 #ifdef AURORA_DEBUG
 	printk("aurora_get_modem_info: end\n");
 #endif
-	return 0;
+	return result;
 }
 
-static int aurora_set_modem_info(struct Aurora_port * port, unsigned int cmd,
-				 unsigned int *value)
+static int aurora_tiocmset(struct tty_struct *tty, struct file *file,
+			   unsigned int set, unsigned int clear)
 {
+	struct Aurora_port *port = (struct Aurora_port *) tty->driver_data;
 	unsigned int arg;
 	unsigned long flags;
 	struct Aurora_board *bp = port_Board(port);
@@ -1800,33 +1804,20 @@
 #ifdef AURORA_DEBUG
 	printk("aurora_set_modem_info: start\n");
 #endif
-	if (get_user(arg, value))
-		return -EFAULT;
+	if ((aurora_paranoia_check(port, tty->name, __FUNCTION__))
+		return -ENODEV;
+
 	chip = AURORA_CD180(port_No(port));
-	switch (cmd) {
-	 case TIOCMBIS: 
-		if (arg & TIOCM_RTS) 
-			port->MSVR |= bp->RTS;
-		if (arg & TIOCM_DTR)
-			port->MSVR |= bp->DTR;
-		break;
-	case TIOCMBIC:
-		if (arg & TIOCM_RTS)
-			port->MSVR &= ~bp->RTS;
-		if (arg & TIOCM_DTR)
-			port->MSVR &= ~bp->DTR;
-		break;
-	case TIOCMSET:
-		port->MSVR = (arg & TIOCM_RTS) ? (port->MSVR | bp->RTS) : 
-					         (port->MSVR & ~bp->RTS);
-		port->MSVR = (arg & TIOCM_DTR) ? (port->MSVR | bp->RTS) :
-						 (port->MSVR & ~bp->RTS);
-		break;
-	 default:
-		return -EINVAL;
-	};
 
 	save_flags(flags); cli();
+	if (set & TIOCM_RTS)
+		port->MSVR |= bp->RTS;
+	if (set & TIOCM_DTR)
+		port->MSVR |= bp->DTR;
+	if (clear & TIOCM_RTS)
+		port->MSVR &= ~bp->RTS;
+	if (clear & TIOCM_DTR)
+		port->MSVR &= ~bp->DTR;
 
 	sbus_writeb(port_No(port) & 7, &bp->r[chip]->r[CD180_CAR]);
 	udelay(1);
@@ -1993,16 +1984,6 @@
 			((tty->termios->c_cflag & ~CLOCAL) |
 			 (arg ? CLOCAL : 0));
 		return 0;
-	case TIOCMGET:
-		retval = verify_area(VERIFY_WRITE, (void *) arg,
-				    sizeof(unsigned int));
-		if (retval)
-			return retval;
-		return aurora_get_modem_info(port, (unsigned int *) arg);
-	case TIOCMBIS:
-	case TIOCMBIC:
-	case TIOCMSET:
-		return aurora_set_modem_info(port, cmd, (unsigned int *) arg);
 	case TIOCGSERIAL:	
 		return aurora_get_serial_info(port, (struct serial_struct *) arg);
 	case TIOCSSERIAL:	
@@ -2268,6 +2249,8 @@
 	.stop = aurora_stop,
 	.start = aurora_start,
 	.hangup = aurora_hangup,
+	.tiocmget = aurora_tiocmget,
+	.tiocmset = aurora_tiocmset,
 };
 
 static int aurora_init_drivers(void)
--- diff/drivers/scsi/53c700.h	2003-06-30 10:07:34.000000000 +0100
+++ source/drivers/scsi/53c700.h	2004-02-09 10:39:54.000000000 +0000
@@ -103,8 +103,8 @@
 static inline void
 NCR_700_set_SXFER(Scsi_Device *SDp, __u8 sxfer)
 {
-	((unsigned long)SDp->hostdata) &= 0xffffff00;
-	((unsigned long)SDp->hostdata) |= sxfer & 0xff;
+	SDp->hostdata = (void *)(((long)SDp->hostdata & 0xffffff00) |
+				(sxfer & 0xff));
 }
 static inline __u8 NCR_700_get_SXFER(Scsi_Device *SDp)
 {
@@ -113,8 +113,11 @@
 static inline void
 NCR_700_set_depth(Scsi_Device *SDp, __u8 depth)
 {
-	((unsigned long)SDp->hostdata) &= 0xffff00ff;
-	((unsigned long)SDp->hostdata) |= (0xff00 & (depth << 8));
+	long l = (long)SDp->hostdata;
+
+	l &= 0xffff00ff;
+	l |= 0xff00 & (depth << 8);
+	SDp->hostdata = (void *)l;
 }
 static inline __u8
 NCR_700_get_depth(Scsi_Device *SDp)
@@ -134,12 +137,12 @@
 static inline void
 NCR_700_set_flag(Scsi_Device *SDp, __u32 flag)
 {
-	((unsigned long)SDp->hostdata) |= (flag & 0xffff0000);
+	SDp->hostdata = (void *)((long)SDp->hostdata | (flag & 0xffff0000));
 }
 static inline void
 NCR_700_clear_flag(Scsi_Device *SDp, __u32 flag)
 {
-	((unsigned long)SDp->hostdata) &= ~(flag & 0xffff0000);
+	SDp->hostdata = (void *)((long)SDp->hostdata & ~(flag & 0xffff0000));
 }
 
 struct NCR_700_command_slot {
--- diff/drivers/scsi/BusLogic.c	2004-01-19 10:22:58.000000000 +0000
+++ source/drivers/scsi/BusLogic.c	2004-02-09 10:39:54.000000000 +0000
@@ -26,7 +26,6 @@
 
 */
 
-
 #define BusLogic_DriverVersion		"2.1.16"
 #define BusLogic_DriverDate		"18 July 2002"
 
@@ -42,7 +41,7 @@
 #include <linux/stat.h>
 #include <linux/pci.h>
 #include <linux/spinlock.h>
-/* #include <scsi/scsicam.h> This include file is currently busted */
+#include <scsi/scsicam.h>
 
 #include <asm/dma.h>
 #include <asm/io.h>
@@ -53,6 +52,9 @@
 #include "BusLogic.h"
 #include "FlashPoint.c"
 
+#ifndef FAILURE
+#define FAILURE (-1)
+#endif
 
 /*
   BusLogic_DriverOptionsCount is a count of the number of BusLogic Driver
@@ -60,8 +62,7 @@
   the Loadable Kernel Module Installation Facility.
 */
 
-static int
-  BusLogic_DriverOptionsCount;
+static int BusLogic_DriverOptionsCount;
 
 
 /*
@@ -70,14 +71,14 @@
   Line or via the Loadable Kernel Module Installation Facility.
 */
 
-static BusLogic_DriverOptions_T
-  BusLogic_DriverOptions[BusLogic_MaxHostAdapters];
+static struct BusLogic_DriverOptions BusLogic_DriverOptions[BusLogic_MaxHostAdapters];
 
 
 /*
   BusLogic can be assigned a string by insmod.
 */
 
+MODULE_LICENSE("GPL");
 #ifdef MODULE
 static char *BusLogic;
 MODULE_PARM(BusLogic, "s");
@@ -89,8 +90,7 @@
   all BusLogic Host Adapters.
 */
 
-static BusLogic_ProbeOptions_T
-  BusLogic_ProbeOptions;
+static struct BusLogic_ProbeOptions BusLogic_ProbeOptions;
 
 
 /*
@@ -98,8 +98,7 @@
   all BusLogic Host Adapters.
 */
 
-static BusLogic_GlobalOptions_T
-  BusLogic_GlobalOptions;
+static struct BusLogic_GlobalOptions BusLogic_GlobalOptions;
 
 
 /*
@@ -107,17 +106,15 @@
   are pointers to the first and last registered BusLogic Host Adapters.
 */
 
-static BusLogic_HostAdapter_T
-  *BusLogic_FirstRegisteredHostAdapter,
-  *BusLogic_LastRegisteredHostAdapter;
+static struct BusLogic_HostAdapter *BusLogic_FirstRegisteredHostAdapter;
+static struct BusLogic_HostAdapter *BusLogic_LastRegisteredHostAdapter;
 
 
 /*
   BusLogic_ProbeInfoCount is the number of entries in BusLogic_ProbeInfoList.
 */
 
-static int
-  BusLogic_ProbeInfoCount;
+static int BusLogic_ProbeInfoCount;
 
 
 /*
@@ -127,8 +124,7 @@
   list of standard BusLogic I/O Addresses.
 */
 
-static BusLogic_ProbeInfo_T
-  *BusLogic_ProbeInfoList;
+static struct BusLogic_ProbeInfo *BusLogic_ProbeInfoList;
 
 
 /*
@@ -137,15 +133,14 @@
   returns a failure code.
 */
 
-static char
-  *BusLogic_CommandFailureReason;
+static char *BusLogic_CommandFailureReason;
 
 /*
   BusLogic_AnnounceDriver announces the Driver Version and Date, Author's
   Name, Copyright Notice, and Electronic Mail Address.
 */
 
-static void BusLogic_AnnounceDriver(BusLogic_HostAdapter_T *HostAdapter)
+static void __init BusLogic_AnnounceDriver(struct BusLogic_HostAdapter *HostAdapter)
 {
   BusLogic_Announce("***** BusLogic SCSI Driver Version "
 		    BusLogic_DriverVersion " of "
@@ -160,10 +155,10 @@
   Driver and Host Adapter.
 */
 
-const char *BusLogic_DriverInfo(SCSI_Host_T *Host)
+static const char *BusLogic_DriverInfo(struct Scsi_Host *Host)
 {
-  BusLogic_HostAdapter_T *HostAdapter =
-    (BusLogic_HostAdapter_T *) Host->hostdata;
+  struct BusLogic_HostAdapter *HostAdapter =
+    (struct BusLogic_HostAdapter *) Host->hostdata;
   return HostAdapter->FullModelName;
 }
 
@@ -173,7 +168,7 @@
   BusLogic Host Adapters.
 */
 
-static void BusLogic_RegisterHostAdapter(BusLogic_HostAdapter_T *HostAdapter)
+static void __init BusLogic_RegisterHostAdapter(struct BusLogic_HostAdapter *HostAdapter)
 {
   HostAdapter->Next = NULL;
   if (BusLogic_FirstRegisteredHostAdapter == NULL)
@@ -194,7 +189,7 @@
   registered BusLogic Host Adapters.
 */
 
-static void BusLogic_UnregisterHostAdapter(BusLogic_HostAdapter_T *HostAdapter)
+static void __init BusLogic_UnregisterHostAdapter(struct BusLogic_HostAdapter *HostAdapter)
 {
   if (HostAdapter == BusLogic_FirstRegisteredHostAdapter)
     {
@@ -205,7 +200,7 @@
     }
   else
     {
-      BusLogic_HostAdapter_T *PreviousHostAdapter =
+      struct BusLogic_HostAdapter *PreviousHostAdapter =
 	BusLogic_FirstRegisteredHostAdapter;
       while (PreviousHostAdapter != NULL &&
 	     PreviousHostAdapter->Next != HostAdapter)
@@ -223,20 +218,20 @@
   created CCBs are added to Host Adapter's free list.
 */
 
-static void BusLogic_InitializeCCBs(BusLogic_HostAdapter_T *HostAdapter,
+static void BusLogic_InitializeCCBs(struct BusLogic_HostAdapter *HostAdapter,
 				    void *BlockPointer, int BlockSize,
 				    dma_addr_t BlockPointerHandle)
 {
-  BusLogic_CCB_T *CCB = (BusLogic_CCB_T *) BlockPointer;
+  struct BusLogic_CCB *CCB = (struct BusLogic_CCB *) BlockPointer;
   unsigned int offset = 0;
   memset(BlockPointer, 0, BlockSize);
   CCB->AllocationGroupHead = BlockPointerHandle;
   CCB->AllocationGroupSize = BlockSize;
-  while ((BlockSize -= sizeof(BusLogic_CCB_T)) >= 0)
+  while ((BlockSize -= sizeof(struct BusLogic_CCB)) >= 0)
     {
       CCB->Status = BusLogic_CCB_Free;
       CCB->HostAdapter = HostAdapter;
-      CCB->DMA_Handle = (BusLogic_BusAddress_T)BlockPointerHandle + offset;
+      CCB->DMA_Handle = (u32)BlockPointerHandle + offset;
       if (BusLogic_FlashPointHostAdapterP(HostAdapter))
 	{
 	  CCB->CallbackFunction = BusLogic_QueueCompletedCCB;
@@ -248,7 +243,7 @@
       HostAdapter->All_CCBs = CCB;
       HostAdapter->AllocatedCCBs++;
       CCB++;
-      offset += sizeof(BusLogic_CCB_T);
+      offset += sizeof(struct BusLogic_CCB);
     }
 }
 
@@ -257,9 +252,9 @@
   BusLogic_CreateInitialCCBs allocates the initial CCBs for Host Adapter.
 */
 
-static boolean BusLogic_CreateInitialCCBs(BusLogic_HostAdapter_T *HostAdapter)
+static boolean __init BusLogic_CreateInitialCCBs(struct BusLogic_HostAdapter *HostAdapter)
 {
-  int BlockSize = BusLogic_CCB_AllocationGroupSize * sizeof(BusLogic_CCB_T);
+  int BlockSize = BusLogic_CCB_AllocationGroupSize * sizeof(struct BusLogic_CCB);
   void *BlockPointer;
   dma_addr_t BlockPointerHandle;
   while (HostAdapter->AllocatedCCBs < HostAdapter->InitialCCBs)
@@ -283,9 +278,9 @@
   BusLogic_DestroyCCBs deallocates the CCBs for Host Adapter.
 */
 
-static void BusLogic_DestroyCCBs(BusLogic_HostAdapter_T *HostAdapter)
+static void BusLogic_DestroyCCBs(struct BusLogic_HostAdapter *HostAdapter)
 {
-  BusLogic_CCB_T *NextCCB = HostAdapter->All_CCBs, *CCB, *Last_CCB = NULL;
+  struct BusLogic_CCB *NextCCB = HostAdapter->All_CCBs, *CCB, *Last_CCB = NULL;
   HostAdapter->All_CCBs = NULL;
   HostAdapter->Free_CCBs = NULL;
   while ((CCB = NextCCB) != NULL)
@@ -314,11 +309,11 @@
   multiple host adapters share the same IRQ Channel.
 */
 
-static void BusLogic_CreateAdditionalCCBs(BusLogic_HostAdapter_T *HostAdapter,
+static void BusLogic_CreateAdditionalCCBs(struct BusLogic_HostAdapter *HostAdapter,
 					  int AdditionalCCBs,
 					  boolean SuccessMessageP)
 {
-  int BlockSize = BusLogic_CCB_AllocationGroupSize * sizeof(BusLogic_CCB_T);
+  int BlockSize = BusLogic_CCB_AllocationGroupSize * sizeof(struct BusLogic_CCB);
   int PreviouslyAllocated = HostAdapter->AllocatedCCBs;
   void *BlockPointer;
   dma_addr_t BlockPointerHandle;
@@ -350,18 +345,17 @@
     }
 }
 
-
 /*
   BusLogic_AllocateCCB allocates a CCB from Host Adapter's free list,
   allocating more memory from the Kernel if necessary.  The Host Adapter's
   Lock should already have been acquired by the caller.
 */
 
-static BusLogic_CCB_T *BusLogic_AllocateCCB(BusLogic_HostAdapter_T
+static struct BusLogic_CCB *BusLogic_AllocateCCB(struct BusLogic_HostAdapter
 					    *HostAdapter)
 {
   static unsigned long SerialNumber = 0;
-  BusLogic_CCB_T *CCB;
+  struct BusLogic_CCB *CCB;
   CCB = HostAdapter->Free_CCBs;
   if (CCB != NULL)
     {
@@ -392,13 +386,13 @@
   caller.
 */
 
-static void BusLogic_DeallocateCCB(BusLogic_CCB_T *CCB)
+static void BusLogic_DeallocateCCB(struct BusLogic_CCB *CCB)
 {
-  BusLogic_HostAdapter_T *HostAdapter = CCB->HostAdapter;
+  struct BusLogic_HostAdapter *HostAdapter = CCB->HostAdapter;
   if (CCB->Command->use_sg != 0)
     {
       pci_unmap_sg(HostAdapter->PCI_Device,
-		   (SCSI_ScatterList_T *)CCB->Command->request_buffer,
+		   (struct scatterlist *)CCB->Command->request_buffer,
 		   CCB->Command->use_sg,
 		   scsi_to_pci_dma_dir(CCB->Command->sc_data_direction));
     }
@@ -435,8 +429,8 @@
   waiting for the Host Adapter Ready bit to be set in the Status Register.
 */
 
-static int BusLogic_Command(BusLogic_HostAdapter_T *HostAdapter,
-			    BusLogic_OperationCode_T OperationCode,
+static int BusLogic_Command(struct BusLogic_HostAdapter *HostAdapter,
+			    enum BusLogic_OperationCode OperationCode,
 			    void *ParameterData,
 			    int ParameterLength,
 			    void *ReplyData,
@@ -444,9 +438,9 @@
 {
   unsigned char *ParameterPointer = (unsigned char *) ParameterData;
   unsigned char *ReplyPointer = (unsigned char *) ReplyData;
-  BusLogic_StatusRegister_T StatusRegister;
-  BusLogic_InterruptRegister_T InterruptRegister;
-  ProcessorFlags_T ProcessorFlags = 0;
+  union BusLogic_StatusRegister StatusRegister;
+  union BusLogic_InterruptRegister InterruptRegister;
+  unsigned long ProcessorFlags = 0;
   int ReplyBytes = 0, Result;
   long TimeoutCounter;
   /*
@@ -473,8 +467,8 @@
   while (--TimeoutCounter >= 0)
     {
       StatusRegister.All = BusLogic_ReadStatusRegister(HostAdapter);
-      if (StatusRegister.Bits.HostAdapterReady &&
-	  !StatusRegister.Bits.CommandParameterRegisterBusy)
+      if (StatusRegister.HostAdapterReady &&
+	  !StatusRegister.CommandParameterRegisterBusy)
 	break;
       udelay(100);
     }
@@ -510,10 +504,10 @@
       udelay(100);
       InterruptRegister.All = BusLogic_ReadInterruptRegister(HostAdapter);
       StatusRegister.All = BusLogic_ReadStatusRegister(HostAdapter);
-      if (InterruptRegister.Bits.CommandComplete) break;
+      if (InterruptRegister.CommandComplete) break;
       if (HostAdapter->HostAdapterCommandCompleted) break;
-      if (StatusRegister.Bits.DataInRegisterReady) break;
-      if (StatusRegister.Bits.CommandParameterRegisterBusy) continue;
+      if (StatusRegister.DataInRegisterReady) break;
+      if (StatusRegister.CommandParameterRegisterBusy) continue;
       BusLogic_WriteCommandParameterRegister(HostAdapter, *ParameterPointer++);
       ParameterLength--;
     }
@@ -530,7 +524,7 @@
   if (OperationCode == BusLogic_ModifyIOAddress)
     {
       StatusRegister.All = BusLogic_ReadStatusRegister(HostAdapter);
-      if (StatusRegister.Bits.CommandInvalid)
+      if (StatusRegister.CommandInvalid)
 	{
 	  BusLogic_CommandFailureReason = "Modify I/O Address Invalid";
 	  Result = -1;
@@ -568,16 +562,16 @@
     {
       InterruptRegister.All = BusLogic_ReadInterruptRegister(HostAdapter);
       StatusRegister.All = BusLogic_ReadStatusRegister(HostAdapter);
-      if (InterruptRegister.Bits.CommandComplete) break;
+      if (InterruptRegister.CommandComplete) break;
       if (HostAdapter->HostAdapterCommandCompleted) break;
-      if (StatusRegister.Bits.DataInRegisterReady)
+      if (StatusRegister.DataInRegisterReady)
 	{
 	  if (++ReplyBytes <= ReplyLength)
 	    *ReplyPointer++ = BusLogic_ReadDataInRegister(HostAdapter);
 	  else BusLogic_ReadDataInRegister(HostAdapter);
 	}
       if (OperationCode == BusLogic_FetchHostAdapterLocalRAM &&
-	  StatusRegister.Bits.HostAdapterReady) break;
+	  StatusRegister.HostAdapterReady) break;
       udelay(100);
     }
   if (TimeoutCounter < 0)
@@ -608,7 +602,7 @@
   /*
     Process Command Invalid conditions.
   */
-  if (StatusRegister.Bits.CommandInvalid)
+  if (StatusRegister.CommandInvalid)
     {
       /*
 	Some early BusLogic Host Adapters may not recover properly from
@@ -620,14 +614,14 @@
       */
       udelay(1000);
       StatusRegister.All = BusLogic_ReadStatusRegister(HostAdapter);
-      if (StatusRegister.Bits.CommandInvalid ||
-	  StatusRegister.Bits.Reserved ||
-	  StatusRegister.Bits.DataInRegisterReady ||
-	  StatusRegister.Bits.CommandParameterRegisterBusy ||
-	  !StatusRegister.Bits.HostAdapterReady ||
-	  !StatusRegister.Bits.InitializationRequired ||
-	  StatusRegister.Bits.DiagnosticActive ||
-	  StatusRegister.Bits.DiagnosticFailure)
+      if (StatusRegister.CommandInvalid ||
+	  StatusRegister.Reserved ||
+	  StatusRegister.DataInRegisterReady ||
+	  StatusRegister.CommandParameterRegisterBusy ||
+	  !StatusRegister.HostAdapterReady ||
+	  !StatusRegister.InitializationRequired ||
+	  StatusRegister.DiagnosticActive ||
+	  StatusRegister.DiagnosticFailure)
 	{
 	  BusLogic_SoftReset(HostAdapter);
 	  udelay(1000);
@@ -666,9 +660,9 @@
   Host Adapters.
 */
 
-static void BusLogic_AppendProbeAddressISA(BusLogic_IO_Address_T IO_Address)
+static void __init BusLogic_AppendProbeAddressISA(unsigned long IO_Address)
 {
-  BusLogic_ProbeInfo_T *ProbeInfo;
+  struct BusLogic_ProbeInfo *ProbeInfo;
   if (BusLogic_ProbeInfoCount >= BusLogic_MaxHostAdapters) return;
   ProbeInfo = &BusLogic_ProbeInfoList[BusLogic_ProbeInfoCount++];
   ProbeInfo->HostAdapterType = BusLogic_MultiMaster;
@@ -684,8 +678,8 @@
   only from the list of standard BusLogic MultiMaster ISA I/O Addresses.
 */
 
-static void BusLogic_InitializeProbeInfoListISA(BusLogic_HostAdapter_T
-						*PrototypeHostAdapter)
+static void __init BusLogic_InitializeProbeInfoListISA(struct BusLogic_HostAdapter
+						       *PrototypeHostAdapter)
 {
   /*
     If BusLogic Driver Options specifications requested that ISA Bus Probes
@@ -730,8 +724,8 @@
   of increasing PCI Bus and Device Number.
 */
 
-static void BusLogic_SortProbeInfo(BusLogic_ProbeInfo_T *ProbeInfoList,
-				   int ProbeInfoCount)
+static void __init BusLogic_SortProbeInfo(struct BusLogic_ProbeInfo *ProbeInfoList,
+					  int ProbeInfoCount)
 {
   int LastInterchange = ProbeInfoCount-1, Bound, j;
   while (LastInterchange > 0)
@@ -740,16 +734,16 @@
       LastInterchange = 0;
       for (j = 0; j < Bound; j++)
 	{
-	  BusLogic_ProbeInfo_T *ProbeInfo1 = &ProbeInfoList[j];
-	  BusLogic_ProbeInfo_T *ProbeInfo2 = &ProbeInfoList[j+1];
+	  struct BusLogic_ProbeInfo *ProbeInfo1 = &ProbeInfoList[j];
+	  struct BusLogic_ProbeInfo *ProbeInfo2 = &ProbeInfoList[j+1];
 	  if (ProbeInfo1->Bus > ProbeInfo2->Bus ||
 	      (ProbeInfo1->Bus == ProbeInfo2->Bus &&
 	       (ProbeInfo1->Device > ProbeInfo2->Device)))
 	    {
-	      BusLogic_ProbeInfo_T TempProbeInfo;
-	      memcpy(&TempProbeInfo, ProbeInfo1, sizeof(BusLogic_ProbeInfo_T));
-	      memcpy(ProbeInfo1, ProbeInfo2, sizeof(BusLogic_ProbeInfo_T));
-	      memcpy(ProbeInfo2, &TempProbeInfo, sizeof(BusLogic_ProbeInfo_T));
+	      struct BusLogic_ProbeInfo TempProbeInfo;
+	      memcpy(&TempProbeInfo, ProbeInfo1, sizeof(struct BusLogic_ProbeInfo));
+	      memcpy(ProbeInfo1, ProbeInfo2, sizeof(struct BusLogic_ProbeInfo));
+	      memcpy(ProbeInfo2, &TempProbeInfo, sizeof(struct BusLogic_ProbeInfo));
 	      LastInterchange = j;
 	    }
 	}
@@ -765,17 +759,17 @@
   I/O Addresses.  It returns the number of PCI MultiMaster Host Adapters found.
 */
 
-static int BusLogic_InitializeMultiMasterProbeInfo(BusLogic_HostAdapter_T
-						   *PrototypeHostAdapter)
+static int __init BusLogic_InitializeMultiMasterProbeInfo(struct BusLogic_HostAdapter
+							  *PrototypeHostAdapter)
 {
-  BusLogic_ProbeInfo_T *PrimaryProbeInfo =
+  struct BusLogic_ProbeInfo *PrimaryProbeInfo =
     &BusLogic_ProbeInfoList[BusLogic_ProbeInfoCount];
   int NonPrimaryPCIMultiMasterIndex = BusLogic_ProbeInfoCount + 1;
   int NonPrimaryPCIMultiMasterCount = 0, PCIMultiMasterCount = 0;
   boolean ForceBusDeviceScanningOrder = false;
   boolean ForceBusDeviceScanningOrderChecked = false;
   boolean StandardAddressSeen[6];
-  PCI_Device_T *PCI_Device = NULL;
+  struct pci_dev *PCI_Device = NULL;
   int i;
   if (BusLogic_ProbeInfoCount >= BusLogic_MaxHostAdapters) return 0;
   BusLogic_ProbeInfoCount++;
@@ -798,16 +792,16 @@
 				       PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER,
 				       PCI_Device)) != NULL)
     {
-      BusLogic_HostAdapter_T *HostAdapter = PrototypeHostAdapter;
-      BusLogic_PCIHostAdapterInformation_T PCIHostAdapterInformation;
-      BusLogic_ModifyIOAddressRequest_T ModifyIOAddressRequest;
+      struct BusLogic_HostAdapter *HostAdapter = PrototypeHostAdapter;
+      struct BusLogic_PCIHostAdapterInformation PCIHostAdapterInformation;
+      enum BusLogic_ISACompatibleIOPort ModifyIOAddressRequest;
       unsigned char Bus;
       unsigned char Device;
       unsigned int IRQ_Channel;
       unsigned long BaseAddress0;
       unsigned long BaseAddress1;
-      BusLogic_IO_Address_T IO_Address;
-      BusLogic_PCI_Address_T PCI_Address;
+      unsigned long IO_Address;
+      unsigned long PCI_Address;
 
       if (pci_enable_device(PCI_Device))
       	continue;
@@ -874,9 +868,12 @@
       else PCIHostAdapterInformation.ISACompatibleIOPort =
 	     BusLogic_IO_Disable;
       /*
-	Issue the Modify I/O Address command to disable the ISA Compatible
-	I/O Port.
-      */
+       * Issue the Modify I/O Address command to disable the ISA Compatible
+       * I/O Port.  On PCI Host Adapters, the Modify I/O Address command
+       * allows modification of the ISA compatible I/O Address that the Host
+       * Adapter responds to; it does not affect the PCI compliant I/O Address
+       * assigned at system initialization.
+       */
       ModifyIOAddressRequest = BusLogic_IO_Disable;
       BusLogic_Command(HostAdapter, BusLogic_ModifyIOAddress,
 		       &ModifyIOAddressRequest,
@@ -890,10 +887,10 @@
       */
       if (!ForceBusDeviceScanningOrderChecked)
 	{
-	  BusLogic_FetchHostAdapterLocalRAMRequest_T
+	  struct BusLogic_FetchHostAdapterLocalRAMRequest
 	    FetchHostAdapterLocalRAMRequest;
-	  BusLogic_AutoSCSIByte45_T AutoSCSIByte45;
-	  BusLogic_BoardID_T BoardID;
+	  struct BusLogic_AutoSCSIByte45 AutoSCSIByte45;
+	  struct BusLogic_BoardID BoardID;
 	  FetchHostAdapterLocalRAMRequest.ByteOffset =
 	    BusLogic_AutoSCSI_BaseOffset + 45;
 	  FetchHostAdapterLocalRAMRequest.ByteCount =
@@ -931,7 +928,7 @@
 	}
       else if (BusLogic_ProbeInfoCount < BusLogic_MaxHostAdapters)
 	{
-	  BusLogic_ProbeInfo_T *ProbeInfo =
+	  struct BusLogic_ProbeInfo *ProbeInfo =
 	    &BusLogic_ProbeInfoList[BusLogic_ProbeInfoCount++];
 	  ProbeInfo->HostAdapterType = BusLogic_MultiMaster;
 	  ProbeInfo->HostAdapterBusType = BusLogic_PCI_Bus;
@@ -1020,7 +1017,7 @@
       unsigned char Bus;
       unsigned char Device;
       unsigned int IRQ_Channel;
-      BusLogic_IO_Address_T IO_Address;
+      unsigned long IO_Address;
 
       if (pci_enable_device(PCI_Device))
 	continue;
@@ -1036,7 +1033,7 @@
       if (IO_Address == 0 || IRQ_Channel == 0) continue;
       for (i = 0; i < BusLogic_ProbeInfoCount; i++)
 	{
-	  BusLogic_ProbeInfo_T *ProbeInfo = &BusLogic_ProbeInfoList[i];
+	  struct BusLogic_ProbeInfo *ProbeInfo = &BusLogic_ProbeInfoList[i];
 	  if (ProbeInfo->IO_Address == IO_Address &&
 	      ProbeInfo->HostAdapterType == BusLogic_MultiMaster)
 	    {
@@ -1061,11 +1058,11 @@
   number of FlashPoint Host Adapters found.
 */
 
-static int BusLogic_InitializeFlashPointProbeInfo(BusLogic_HostAdapter_T
-						  *PrototypeHostAdapter)
+static int __init BusLogic_InitializeFlashPointProbeInfo(struct BusLogic_HostAdapter
+							 *PrototypeHostAdapter)
 {
   int FlashPointIndex = BusLogic_ProbeInfoCount, FlashPointCount = 0;
-  PCI_Device_T *PCI_Device = NULL;
+  struct pci_dev *PCI_Device = NULL;
   /*
     Interrogate PCI Configuration Space for any FlashPoint Host Adapters.
   */
@@ -1078,8 +1075,8 @@
       unsigned int IRQ_Channel;
       unsigned long BaseAddress0;
       unsigned long BaseAddress1;
-      BusLogic_IO_Address_T IO_Address;
-      BusLogic_PCI_Address_T PCI_Address;
+      unsigned long IO_Address;
+      unsigned long PCI_Address;
 
       if (pci_enable_device(PCI_Device))
 	continue;
@@ -1127,7 +1124,7 @@
 	}
       if (BusLogic_ProbeInfoCount < BusLogic_MaxHostAdapters)
 	{
-	  BusLogic_ProbeInfo_T *ProbeInfo =
+	  struct BusLogic_ProbeInfo *ProbeInfo =
 	    &BusLogic_ProbeInfoList[BusLogic_ProbeInfoCount++];
 	  ProbeInfo->HostAdapterType = BusLogic_FlashPoint;
 	  ProbeInfo->HostAdapterBusType = BusLogic_PCI_Bus;
@@ -1174,8 +1171,8 @@
   a particular probe order.
 */
 
-static void BusLogic_InitializeProbeInfoList(BusLogic_HostAdapter_T
-					     *PrototypeHostAdapter)
+static void __init BusLogic_InitializeProbeInfoList(struct BusLogic_HostAdapter
+						    *PrototypeHostAdapter)
 {
   /*
     If a PCI BIOS is present, interrogate it for MultiMaster and FlashPoint
@@ -1201,12 +1198,12 @@
 	    BusLogic_InitializeMultiMasterProbeInfo(PrototypeHostAdapter);
 	  if (FlashPointCount > 0 && PCIMultiMasterCount > 0)
 	    {
-	      BusLogic_ProbeInfo_T *ProbeInfo =
+	      struct BusLogic_ProbeInfo *ProbeInfo =
 		&BusLogic_ProbeInfoList[FlashPointCount];
-	      BusLogic_HostAdapter_T *HostAdapter = PrototypeHostAdapter;
-	      BusLogic_FetchHostAdapterLocalRAMRequest_T
+	      struct BusLogic_HostAdapter *HostAdapter = PrototypeHostAdapter;
+	      struct BusLogic_FetchHostAdapterLocalRAMRequest
 		FetchHostAdapterLocalRAMRequest;
-	      BusLogic_BIOSDriveMapByte_T Drive0MapByte;
+	      struct BusLogic_BIOSDriveMapByte Drive0MapByte;
 	      while (ProbeInfo->HostAdapterBusType != BusLogic_PCI_Bus)
 		ProbeInfo++;
 	      HostAdapter->IO_Address = ProbeInfo->IO_Address;
@@ -1228,20 +1225,20 @@
 	      if (Drive0MapByte.DiskGeometry !=
 		  BusLogic_BIOS_Disk_Not_Installed)
 		{
-		  BusLogic_ProbeInfo_T
+		  struct BusLogic_ProbeInfo
 		    SavedProbeInfo[BusLogic_MaxHostAdapters];
 		  int MultiMasterCount =
 		    BusLogic_ProbeInfoCount - FlashPointCount;
 		  memcpy(SavedProbeInfo,
 			 BusLogic_ProbeInfoList,
 			 BusLogic_ProbeInfoCount
-			 * sizeof(BusLogic_ProbeInfo_T));
+			 * sizeof(struct BusLogic_ProbeInfo));
 		  memcpy(&BusLogic_ProbeInfoList[0],
 			 &SavedProbeInfo[FlashPointCount],
-			 MultiMasterCount * sizeof(BusLogic_ProbeInfo_T));
+			 MultiMasterCount * sizeof(struct BusLogic_ProbeInfo));
 		  memcpy(&BusLogic_ProbeInfoList[MultiMasterCount],
 			 &SavedProbeInfo[0],
-			 FlashPointCount * sizeof(BusLogic_ProbeInfo_T));
+			 FlashPointCount * sizeof(struct BusLogic_ProbeInfo));
 		}
 	    }
 	}
@@ -1257,7 +1254,7 @@
   BusLogic_Failure prints a standardized error message, and then returns false.
 */
 
-static boolean BusLogic_Failure(BusLogic_HostAdapter_T *HostAdapter,
+static boolean BusLogic_Failure(struct BusLogic_HostAdapter *HostAdapter,
 				char *ErrorMessage)
 {
   BusLogic_AnnounceDriver(HostAdapter);
@@ -1284,19 +1281,19 @@
   BusLogic_ProbeHostAdapter probes for a BusLogic Host Adapter.
 */
 
-static boolean BusLogic_ProbeHostAdapter(BusLogic_HostAdapter_T *HostAdapter)
+static boolean __init BusLogic_ProbeHostAdapter(struct BusLogic_HostAdapter *HostAdapter)
 {
-  BusLogic_StatusRegister_T StatusRegister;
-  BusLogic_InterruptRegister_T InterruptRegister;
-  BusLogic_GeometryRegister_T GeometryRegister;
+  union BusLogic_StatusRegister StatusRegister;
+  union BusLogic_InterruptRegister InterruptRegister;
+  union BusLogic_GeometryRegister GeometryRegister;
   /*
     FlashPoint Host Adapters are Probed by the FlashPoint SCCB Manager.
   */
   if (BusLogic_FlashPointHostAdapterP(HostAdapter))
     {
-      FlashPoint_Info_T *FlashPointInfo = &HostAdapter->FlashPointInfo;
+      struct FlashPoint_Info *FlashPointInfo = &HostAdapter->FlashPointInfo;
       FlashPointInfo->BaseAddress =
-	(BusLogic_Base_Address_T) HostAdapter->IO_Address;
+	(u32) HostAdapter->IO_Address;
       FlashPointInfo->IRQ_Channel = HostAdapter->IRQ_Channel;
       FlashPointInfo->Present = false;
       if (!(FlashPoint_ProbeHostAdapter(FlashPointInfo) == 0 &&
@@ -1336,11 +1333,11 @@
 		    HostAdapter->IO_Address, StatusRegister.All,
 		    InterruptRegister.All, GeometryRegister.All);
   if (StatusRegister.All == 0 ||
-      StatusRegister.Bits.DiagnosticActive ||
-      StatusRegister.Bits.CommandParameterRegisterBusy ||
-      StatusRegister.Bits.Reserved ||
-      StatusRegister.Bits.CommandInvalid ||
-      InterruptRegister.Bits.Reserved != 0)
+      StatusRegister.DiagnosticActive ||
+      StatusRegister.CommandParameterRegisterBusy ||
+      StatusRegister.Reserved ||
+      StatusRegister.CommandInvalid ||
+      InterruptRegister.Reserved != 0)
     return false;
   /*
     Check the undocumented Geometry Register to test if there is an I/O port
@@ -1372,18 +1369,18 @@
   SCSI Bus Reset.
 */
 
-static boolean BusLogic_HardwareResetHostAdapter(BusLogic_HostAdapter_T
+static boolean BusLogic_HardwareResetHostAdapter(struct BusLogic_HostAdapter
 						   *HostAdapter,
 						 boolean HardReset)
 {
-  BusLogic_StatusRegister_T StatusRegister;
+  union BusLogic_StatusRegister StatusRegister;
   int TimeoutCounter;
   /*
     FlashPoint Host Adapters are Hard Reset by the FlashPoint SCCB Manager.
   */
   if (BusLogic_FlashPointHostAdapterP(HostAdapter))
     {
-      FlashPoint_Info_T *FlashPointInfo = &HostAdapter->FlashPointInfo;
+      struct FlashPoint_Info *FlashPointInfo = &HostAdapter->FlashPointInfo;
       FlashPointInfo->HostSoftReset = !HardReset;
       FlashPointInfo->ReportDataUnderrun = true;
       HostAdapter->CardHandle =
@@ -1408,7 +1405,7 @@
   while (--TimeoutCounter >= 0)
     {
       StatusRegister.All = BusLogic_ReadStatusRegister(HostAdapter);
-      if (StatusRegister.Bits.DiagnosticActive) break;
+      if (StatusRegister.DiagnosticActive) break;
       udelay(100);
     }
   if (BusLogic_GlobalOptions.TraceHardwareReset)
@@ -1429,7 +1426,7 @@
   while (--TimeoutCounter >= 0)
     {
       StatusRegister.All = BusLogic_ReadStatusRegister(HostAdapter);
-      if (!StatusRegister.Bits.DiagnosticActive) break;
+      if (!StatusRegister.DiagnosticActive) break;
       udelay(100);
     }
   if (BusLogic_GlobalOptions.TraceHardwareReset)
@@ -1445,9 +1442,9 @@
   while (--TimeoutCounter >= 0)
     {
       StatusRegister.All = BusLogic_ReadStatusRegister(HostAdapter);
-      if (StatusRegister.Bits.DiagnosticFailure ||
-	  StatusRegister.Bits.HostAdapterReady ||
-	  StatusRegister.Bits.DataInRegisterReady)
+      if (StatusRegister.DiagnosticFailure ||
+	  StatusRegister.HostAdapterReady ||
+	  StatusRegister.DataInRegisterReady)
 	break;
       udelay(100);
     }
@@ -1461,14 +1458,14 @@
     error occurred during the Host Adapter diagnostics.  If Data In Register
     Ready is set, then there is an Error Code available.
   */
-  if (StatusRegister.Bits.DiagnosticFailure ||
-      !StatusRegister.Bits.HostAdapterReady)
+  if (StatusRegister.DiagnosticFailure ||
+      !StatusRegister.HostAdapterReady)
     {
       BusLogic_CommandFailureReason = NULL;
       BusLogic_Failure(HostAdapter, "HARD RESET DIAGNOSTICS");
       BusLogic_Error("HOST ADAPTER STATUS REGISTER = %02X\n",
 		     HostAdapter, StatusRegister.All);
-      if (StatusRegister.Bits.DataInRegisterReady)
+      if (StatusRegister.DataInRegisterReady)
 	{
 	  unsigned char ErrorCode = BusLogic_ReadDataInRegister(HostAdapter);
 	  BusLogic_Error("HOST ADAPTER ERROR CODE = %d\n",
@@ -1488,10 +1485,10 @@
   Host Adapter.
 */
 
-static boolean BusLogic_CheckHostAdapter(BusLogic_HostAdapter_T *HostAdapter)
+static boolean __init BusLogic_CheckHostAdapter(struct BusLogic_HostAdapter *HostAdapter)
 {
-  BusLogic_ExtendedSetupInformation_T ExtendedSetupInformation;
-  BusLogic_RequestedReplyLength_T RequestedReplyLength;
+  struct BusLogic_ExtendedSetupInformation ExtendedSetupInformation;
+  unsigned char RequestedReplyLength;
   boolean Result = true;
   /*
     FlashPoint Host Adapters do not require this protection.
@@ -1527,21 +1524,21 @@
   from Host Adapter and initializes the Host Adapter structure.
 */
 
-static boolean BusLogic_ReadHostAdapterConfiguration(BusLogic_HostAdapter_T
-						     *HostAdapter)
+static boolean __init BusLogic_ReadHostAdapterConfiguration(struct BusLogic_HostAdapter
+							    *HostAdapter)
 {
-  BusLogic_BoardID_T BoardID;
-  BusLogic_Configuration_T Configuration;
-  BusLogic_SetupInformation_T SetupInformation;
-  BusLogic_ExtendedSetupInformation_T ExtendedSetupInformation;
-  BusLogic_HostAdapterModelNumber_T HostAdapterModelNumber;
-  BusLogic_FirmwareVersion3rdDigit_T FirmwareVersion3rdDigit;
-  BusLogic_FirmwareVersionLetter_T FirmwareVersionLetter;
-  BusLogic_PCIHostAdapterInformation_T PCIHostAdapterInformation;
-  BusLogic_FetchHostAdapterLocalRAMRequest_T FetchHostAdapterLocalRAMRequest;
-  BusLogic_AutoSCSIData_T AutoSCSIData;
-  BusLogic_GeometryRegister_T GeometryRegister;
-  BusLogic_RequestedReplyLength_T RequestedReplyLength;
+  struct BusLogic_BoardID BoardID;
+  struct BusLogic_Configuration Configuration;
+  struct BusLogic_SetupInformation SetupInformation;
+  struct BusLogic_ExtendedSetupInformation ExtendedSetupInformation;
+  unsigned char HostAdapterModelNumber[5];
+  unsigned char FirmwareVersion3rdDigit;
+  unsigned char FirmwareVersionLetter;
+  struct BusLogic_PCIHostAdapterInformation PCIHostAdapterInformation;
+  struct BusLogic_FetchHostAdapterLocalRAMRequest FetchHostAdapterLocalRAMRequest;
+  struct BusLogic_AutoSCSIData AutoSCSIData;
+  union BusLogic_GeometryRegister GeometryRegister;
+  unsigned char RequestedReplyLength;
   unsigned char *TargetPointer, Character;
   int TargetID, i;
   /*
@@ -1552,7 +1549,7 @@
   */
   if (BusLogic_FlashPointHostAdapterP(HostAdapter))
     {
-      FlashPoint_Info_T *FlashPointInfo = &HostAdapter->FlashPointInfo;
+      struct FlashPoint_Info *FlashPointInfo = &HostAdapter->FlashPointInfo;
       TargetPointer = HostAdapter->ModelName;
       *TargetPointer++ = 'B';
       *TargetPointer++ = 'T';
@@ -1759,7 +1756,7 @@
   */
   GeometryRegister.All = BusLogic_ReadGeometryRegister(HostAdapter);
   HostAdapter->ExtendedTranslationEnabled =
-    GeometryRegister.Bits.ExtendedTranslationEnabled;
+    GeometryRegister.ExtendedTranslationEnabled;
   /*
     Save the Scatter Gather Limits, Level Sensitive Interrupt flag, Wide
     SCSI flag, Differential SCSI flag, SCAM Supported flag, and
@@ -2024,17 +2021,7 @@
        HostAdapter->DriverOptions->TaggedQueuingPermittedMask) |
       (HostAdapter->TaggedQueuingPermitted &
        ~HostAdapter->DriverOptions->TaggedQueuingPermittedMask);
-  /*
-    Select appropriate values for the Error Recovery Strategy array
-    either from a BusLogic Driver Options specification, or using
-    BusLogic_ErrorRecovery_Default.
-  */
-  for (TargetID = 0; TargetID < BusLogic_MaxTargetDevices; TargetID++)
-    if (HostAdapter->DriverOptions != NULL)
-      HostAdapter->ErrorRecoveryStrategy[TargetID] =
-	HostAdapter->DriverOptions->ErrorRecoveryStrategy[TargetID];
-    else HostAdapter->ErrorRecoveryStrategy[TargetID] =
-	   BusLogic_ErrorRecovery_Default;
+
   /*
     Select an appropriate value for Bus Settle Time either from a BusLogic
     Driver Options specification, or from BusLogic_DefaultBusSettleTime.
@@ -2055,25 +2042,22 @@
   Host Adapter.
 */
 
-static boolean BusLogic_ReportHostAdapterConfiguration(BusLogic_HostAdapter_T
-						       *HostAdapter)
+static boolean __init BusLogic_ReportHostAdapterConfiguration(struct BusLogic_HostAdapter
+							      *HostAdapter)
 {
   unsigned short AllTargetsMask = (1 << HostAdapter->MaxTargetDevices) - 1;
   unsigned short SynchronousPermitted, FastPermitted;
   unsigned short UltraPermitted, WidePermitted;
   unsigned short DisconnectPermitted, TaggedQueuingPermitted;
   boolean CommonSynchronousNegotiation, CommonTaggedQueueDepth;
-  boolean CommonErrorRecovery;
   char SynchronousString[BusLogic_MaxTargetDevices+1];
   char WideString[BusLogic_MaxTargetDevices+1];
   char DisconnectString[BusLogic_MaxTargetDevices+1];
   char TaggedQueuingString[BusLogic_MaxTargetDevices+1];
-  char ErrorRecoveryString[BusLogic_MaxTargetDevices+1];
   char *SynchronousMessage = SynchronousString;
   char *WideMessage = WideString;
   char *DisconnectMessage = DisconnectString;
   char *TaggedQueuingMessage = TaggedQueuingString;
-  char *ErrorRecoveryMessage = ErrorRecoveryString;
   int TargetID;
   BusLogic_Info("Configuring BusLogic Model %s %s%s%s%s SCSI Host Adapter\n",
 		HostAdapter, HostAdapter->ModelName,
@@ -2241,30 +2225,6 @@
   else BusLogic_Info("Individual", HostAdapter);
   BusLogic_Info(", Untagged Queue Depth: %d\n", HostAdapter,
 		HostAdapter->UntaggedQueueDepth);
-  CommonErrorRecovery = true;
-  for (TargetID = 1; TargetID < HostAdapter->MaxTargetDevices; TargetID++)
-    if (HostAdapter->ErrorRecoveryStrategy[TargetID] !=
-	HostAdapter->ErrorRecoveryStrategy[0])
-      {
-	CommonErrorRecovery = false;
-	break;
-      }
-  if (CommonErrorRecovery)
-    ErrorRecoveryMessage =
-      BusLogic_ErrorRecoveryStrategyNames[
-	HostAdapter->ErrorRecoveryStrategy[0]];
-  else
-    {
-      for (TargetID = 0; TargetID < HostAdapter->MaxTargetDevices; TargetID++)
-	ErrorRecoveryString[TargetID] =
-	  BusLogic_ErrorRecoveryStrategyLetters[
-	    HostAdapter->ErrorRecoveryStrategy[TargetID]];
-      ErrorRecoveryString[HostAdapter->SCSI_ID] = '#';
-      ErrorRecoveryString[HostAdapter->MaxTargetDevices] = '\0';
-    }
-  BusLogic_Info("  Error Recovery Strategy: %s, SCSI Bus Reset: %s\n",
-		HostAdapter, ErrorRecoveryMessage,
-		(HostAdapter->BusResetEnabled ? "Enabled" : "Disabled"));
   if (HostAdapter->TerminationInfoValid)
     {
       if (HostAdapter->HostWideSCSI)
@@ -2297,7 +2257,7 @@
   Host Adapter.
 */
 
-static boolean BusLogic_AcquireResources(BusLogic_HostAdapter_T *HostAdapter)
+static boolean __init BusLogic_AcquireResources(struct BusLogic_HostAdapter *HostAdapter)
 {
   if (HostAdapter->IRQ_Channel == 0)
     {
@@ -2344,7 +2304,7 @@
   by BusLogic_AcquireResources.
 */
 
-static void BusLogic_ReleaseResources(BusLogic_HostAdapter_T *HostAdapter)
+static void BusLogic_ReleaseResources(struct BusLogic_HostAdapter *HostAdapter)
 {
   /*
     Release shared access to the IRQ Channel.
@@ -2375,12 +2335,12 @@
   of the Host Adapter from its initial power on or hard reset state.
 */
 
-static boolean BusLogic_InitializeHostAdapter(BusLogic_HostAdapter_T
+static boolean BusLogic_InitializeHostAdapter(struct BusLogic_HostAdapter
 					      *HostAdapter)
 {
-  BusLogic_ExtendedMailboxRequest_T ExtendedMailboxRequest;
-  BusLogic_RoundRobinModeRequest_T RoundRobinModeRequest;
-  BusLogic_SetCCBFormatRequest_T SetCCBFormatRequest;
+  struct BusLogic_ExtendedMailboxRequest ExtendedMailboxRequest;
+  enum BusLogic_RoundRobinModeRequest RoundRobinModeRequest;
+  enum BusLogic_SetCCBFormatRequest SetCCBFormatRequest;
   int TargetID;
   /*
     Initialize the pointers to the first and last CCBs that are queued for
@@ -2409,18 +2369,18 @@
     Initialize the Outgoing and Incoming Mailbox pointers.
   */
   HostAdapter->MailboxSize = HostAdapter->MailboxCount *
-    (sizeof(BusLogic_OutgoingMailbox_T) + sizeof(BusLogic_IncomingMailbox_T));
+    (sizeof(struct BusLogic_OutgoingMailbox) + sizeof(struct BusLogic_IncomingMailbox));
   HostAdapter->MailboxSpace = pci_alloc_consistent(HostAdapter->PCI_Device,
     HostAdapter->MailboxSize, &HostAdapter->MailboxSpaceHandle);
   if (HostAdapter->MailboxSpace == NULL)
     return BusLogic_Failure(HostAdapter, "MAILBOX ALLOCATION");
   HostAdapter->FirstOutgoingMailbox =
-    (BusLogic_OutgoingMailbox_T *) HostAdapter->MailboxSpace;
+    (struct BusLogic_OutgoingMailbox *) HostAdapter->MailboxSpace;
   HostAdapter->LastOutgoingMailbox =
     HostAdapter->FirstOutgoingMailbox + HostAdapter->MailboxCount - 1;
   HostAdapter->NextOutgoingMailbox = HostAdapter->FirstOutgoingMailbox;
   HostAdapter->FirstIncomingMailbox =
-    (BusLogic_IncomingMailbox_T *) (HostAdapter->LastOutgoingMailbox + 1);
+    (struct BusLogic_IncomingMailbox *) (HostAdapter->LastOutgoingMailbox + 1);
   HostAdapter->LastIncomingMailbox =
     HostAdapter->FirstIncomingMailbox + HostAdapter->MailboxCount - 1;
   HostAdapter->NextIncomingMailbox = HostAdapter->FirstIncomingMailbox;
@@ -2429,15 +2389,15 @@
     Initialize the Outgoing and Incoming Mailbox structures.
   */
   memset(HostAdapter->FirstOutgoingMailbox, 0,
-	 HostAdapter->MailboxCount * sizeof(BusLogic_OutgoingMailbox_T));
+	 HostAdapter->MailboxCount * sizeof(struct BusLogic_OutgoingMailbox));
   memset(HostAdapter->FirstIncomingMailbox, 0,
-	 HostAdapter->MailboxCount * sizeof(BusLogic_IncomingMailbox_T));
+	 HostAdapter->MailboxCount * sizeof(struct BusLogic_IncomingMailbox));
   /*
     Initialize the Host Adapter's Pointer to the Outgoing/Incoming Mailboxes.
   */
   ExtendedMailboxRequest.MailboxCount = HostAdapter->MailboxCount;
   ExtendedMailboxRequest.BaseMailboxAddress =
-    (BusLogic_BusAddress_T) HostAdapter->MailboxSpaceHandle;
+    (u32) HostAdapter->MailboxSpaceHandle;
   if (BusLogic_Command(HostAdapter, BusLogic_InitializeExtendedMailbox,
 		       &ExtendedMailboxRequest,
 		       sizeof(ExtendedMailboxRequest), NULL, 0) < 0)
@@ -2494,14 +2454,14 @@
   through Host Adapter.
 */
 
-static boolean BusLogic_TargetDeviceInquiry(BusLogic_HostAdapter_T
-					    *HostAdapter)
+static boolean __init BusLogic_TargetDeviceInquiry(struct BusLogic_HostAdapter
+						   *HostAdapter)
 {
-  BusLogic_InstalledDevices_T InstalledDevices;
-  BusLogic_InstalledDevices8_T InstalledDevicesID0to7;
-  BusLogic_SetupInformation_T SetupInformation;
-  BusLogic_SynchronousPeriod_T SynchronousPeriod;
-  BusLogic_RequestedReplyLength_T RequestedReplyLength;
+  u16 InstalledDevices;
+  u8 InstalledDevicesID0to7[8];
+  struct BusLogic_SetupInformation SetupInformation;
+  u8 SynchronousPeriod[BusLogic_MaxTargetDevices];
+  unsigned char RequestedReplyLength;
   int TargetID;
   /*
     Wait a few seconds between the Host Adapter Hard Reset which initiates
@@ -2530,6 +2490,15 @@
   */
   if (strcmp(HostAdapter->FirmwareVersion, "4.25") >= 0)
     {
+
+      /*
+       * Issue a Inquire Target Devices command.  Inquire Target Devices only
+       * tests Logical Unit 0 of each Target Device unlike the Inquire Installed
+       * Devices commands which test Logical Units 0 - 7.  Two bytes are
+       * returned, where byte 0 bit 0 set indicates that Target Device 0 exists,
+       * and so on.
+       */
+
       if (BusLogic_Command(HostAdapter, BusLogic_InquireTargetDevices, NULL, 0,
 			   &InstalledDevices, sizeof(InstalledDevices))
 	  != sizeof(InstalledDevices))
@@ -2540,6 +2509,13 @@
     }
   else
     {
+
+      /*
+       * Issue an Inquire Installed Devices command.  For each Target Device,
+       * a byte is returned where bit 0 set indicates that Logical Unit 0
+       * exists, bit 1 set indicates that Logical Unit 1 exists, and so on.
+       */
+
       if (BusLogic_Command(HostAdapter, BusLogic_InquireInstalledDevicesID0to7,
 			   NULL, 0, &InstalledDevicesID0to7,
 			   sizeof(InstalledDevicesID0to7))
@@ -2577,6 +2553,12 @@
   */
   if (HostAdapter->FirmwareVersion[0] >= '3')
     {
+
+      /* Issue a Inquire Synchronous Period command.  For each Target Device,
+       * a byte is returned which represents the Synchronous Transfer Period
+       * in units of 10 nanoseconds.
+       */
+
       RequestedReplyLength = sizeof(SynchronousPeriod);
       if (BusLogic_Command(HostAdapter, BusLogic_InquireSynchronousPeriod,
 			   &RequestedReplyLength, sizeof(RequestedReplyLength),
@@ -2598,84 +2580,6 @@
   return true;
 }
 
-
-/*
-  BusLogic_ReportTargetDeviceInfo reports about the Target Devices accessible
-  through Host Adapter.
-*/
-
-/*static void BusLogic_ReportTargetDeviceInfo(BusLogic_HostAdapter_T
-					    *HostAdapter)
-{
-  int TargetID;
-*/  /*
-    Inhibit the Target Device Inquiry and Reporting if requested.
-  */
-/*  if (BusLogic_MultiMasterHostAdapterP(HostAdapter) &&
-      HostAdapter->DriverOptions != NULL &&
-      HostAdapter->DriverOptions->LocalOptions.InhibitTargetInquiry)
-    return;
-*/  /*
-    Report on the Target Devices found.
-  */
-/*  for (TargetID = 0; TargetID < HostAdapter->MaxTargetDevices; TargetID++)
-    {
-      BusLogic_TargetFlags_T *TargetFlags = &HostAdapter->TargetFlags[TargetID];
-      if (TargetFlags->TargetExists && !TargetFlags->TargetInfoReported)
-	{
-	  int SynchronousTransferRate = 0;
-	  if (BusLogic_FlashPointHostAdapterP(HostAdapter))
-	    {
-	      unsigned char WideTransfersActive;
-	      FlashPoint_InquireTargetInfo(
-		HostAdapter->CardHandle, TargetID,
-		&HostAdapter->SynchronousPeriod[TargetID],
-		&HostAdapter->SynchronousOffset[TargetID],
-		&WideTransfersActive);
-	      TargetFlags->WideTransfersActive = WideTransfersActive;
-	    }
-	  else if (TargetFlags->WideTransfersSupported &&
-		   (HostAdapter->WidePermitted & (1 << TargetID)) &&
-		   strcmp(HostAdapter->FirmwareVersion, "5.06L") < 0)
-	    TargetFlags->WideTransfersActive = true;
-	  if (HostAdapter->SynchronousPeriod[TargetID] > 0)
-	    SynchronousTransferRate =
-	      100000 / HostAdapter->SynchronousPeriod[TargetID];
-	  if (TargetFlags->WideTransfersActive)
-	    SynchronousTransferRate <<= 1;
-	  if (SynchronousTransferRate >= 9950)
-	    {
-	      SynchronousTransferRate = (SynchronousTransferRate + 50) / 100;
-	      BusLogic_Info("Target %d: Queue Depth %d, %sSynchronous at "
-			    "%d.%01d MB/sec, offset %d\n",
-			    HostAdapter, TargetID,
-			    HostAdapter->QueueDepth[TargetID],
-			    (TargetFlags->WideTransfersActive ? "Wide " : ""),
-			    SynchronousTransferRate / 10,
-			    SynchronousTransferRate % 10,
-			    HostAdapter->SynchronousOffset[TargetID]);
-	    }
-	  else if (SynchronousTransferRate > 0)
-	    {
-	      SynchronousTransferRate = (SynchronousTransferRate + 5) / 10;
-	      BusLogic_Info("Target %d: Queue Depth %d, %sSynchronous at "
-			    "%d.%02d MB/sec, offset %d\n",
-			    HostAdapter, TargetID,
-			    HostAdapter->QueueDepth[TargetID],
-			    (TargetFlags->WideTransfersActive ? "Wide " : ""),
-			    SynchronousTransferRate / 100,
-			    SynchronousTransferRate % 100,
-			    HostAdapter->SynchronousOffset[TargetID]);
-	    }
-	  else BusLogic_Info("Target %d: Queue Depth %d, Asynchronous\n",
-			     HostAdapter, TargetID,
-			     HostAdapter->QueueDepth[TargetID]);
-	  TargetFlags->TargetInfoReported = true;
-	}
-    }
-}
-*/
-
 /*
   BusLogic_InitializeHostStructure initializes the fields in the SCSI Host
   structure.  The base, io_port, n_io_ports, irq, and dma_channel fields in the
@@ -2685,9 +2589,9 @@
   through explicit acquisition and release of the Host Adapter's Lock.
 */
 
-static void BusLogic_InitializeHostStructure(BusLogic_HostAdapter_T
-					       *HostAdapter,
-					     SCSI_Host_T *Host)
+static void __init BusLogic_InitializeHostStructure(struct BusLogic_HostAdapter
+						    *HostAdapter,
+						    struct Scsi_Host *Host)
 {
   Host->max_id = HostAdapter->MaxTargetDevices;
   Host->max_lun = HostAdapter->MaxLogicalUnits;
@@ -2708,10 +2612,10 @@
   but instead get called for each device, we have to do things a bit
   differently.
 */
-int BusLogic_SlaveConfigure(SCSI_Device_T *Device)
+static int BusLogic_SlaveConfigure(struct scsi_device *Device)
 {
-  BusLogic_HostAdapter_T *HostAdapter =
-    (BusLogic_HostAdapter_T *) Device->host->hostdata;
+  struct BusLogic_HostAdapter *HostAdapter =
+    (struct BusLogic_HostAdapter *) Device->host->hostdata;
   int TargetID = Device->id;
   int QueueDepth = HostAdapter->QueueDepth[TargetID];
 
@@ -2745,85 +2649,6 @@
 }
 
 /*
-  BusLogic_SelectQueueDepths selects Queue Depths for each Target Device based
-  on the Host Adapter's Total Queue Depth and the number, type, speed, and
-  capabilities of the Target Devices.  When called for the last Host Adapter,
-  it reports on the Target Device Information for all BusLogic Host Adapters
-  since all the Target Devices have now been probed.
-*/
-
-/* static void BusLogic_SelectQueueDepths(SCSI_Host_T *Host,
-				       SCSI_Device_T *DeviceList)
-{
-  BusLogic_HostAdapter_T *HostAdapter =
-    (BusLogic_HostAdapter_T *) Host->hostdata;
-  int TaggedDeviceCount = 0, AutomaticTaggedDeviceCount = 0;
-  int UntaggedDeviceCount = 0, AutomaticTaggedQueueDepth = 0;
-  int AllocatedQueueDepth = 0;
-  SCSI_Device_T *Device;
-  int TargetID;
-  for (TargetID = 0; TargetID < HostAdapter->MaxTargetDevices; TargetID++)
-    if (HostAdapter->TargetFlags[TargetID].TargetExists)
-      {
-	int QueueDepth = HostAdapter->QueueDepth[TargetID];
-	if (HostAdapter->TargetFlags[TargetID].TaggedQueuingSupported &&
-	    (HostAdapter->TaggedQueuingPermitted & (1 << TargetID)))
-	  {
-	    TaggedDeviceCount++;
-	    if (QueueDepth == 0) AutomaticTaggedDeviceCount++;
-	  }
-	else
-	  {
-	    UntaggedDeviceCount++;
-	    if (QueueDepth == 0 ||
-		QueueDepth > HostAdapter->UntaggedQueueDepth)
-	      {
-		QueueDepth = HostAdapter->UntaggedQueueDepth;
-		HostAdapter->QueueDepth[TargetID] = QueueDepth;
-	      }
-	  }
-	AllocatedQueueDepth += QueueDepth;
-	if (QueueDepth == 1)
-	  HostAdapter->TaggedQueuingPermitted &= ~(1 << TargetID);
-      }
-  HostAdapter->TargetDeviceCount = TaggedDeviceCount + UntaggedDeviceCount;
-  if (AutomaticTaggedDeviceCount > 0)
-    {
-      AutomaticTaggedQueueDepth =
-	(HostAdapter->HostAdapterQueueDepth - AllocatedQueueDepth)
-	/ AutomaticTaggedDeviceCount;
-      if (AutomaticTaggedQueueDepth > BusLogic_MaxAutomaticTaggedQueueDepth)
-	AutomaticTaggedQueueDepth = BusLogic_MaxAutomaticTaggedQueueDepth;
-      if (AutomaticTaggedQueueDepth < BusLogic_MinAutomaticTaggedQueueDepth)
-	AutomaticTaggedQueueDepth = BusLogic_MinAutomaticTaggedQueueDepth;
-      for (TargetID = 0; TargetID < HostAdapter->MaxTargetDevices; TargetID++)
-	if (HostAdapter->TargetFlags[TargetID].TargetExists &&
-	    HostAdapter->QueueDepth[TargetID] == 0)
-	  {
-	    AllocatedQueueDepth += AutomaticTaggedQueueDepth;
-	    HostAdapter->QueueDepth[TargetID] = AutomaticTaggedQueueDepth;
-	  }
-    }
-  for (Device = DeviceList; Device != NULL; Device = Device->next)
-    if (Device->host == Host)
-      Device->queue_depth = HostAdapter->QueueDepth[Device->id];
-*/  /* Allocate an extra CCB for each Target Device for a Bus Device Reset. */
-/*  AllocatedQueueDepth += HostAdapter->TargetDeviceCount;
-  if (AllocatedQueueDepth > HostAdapter->DriverQueueDepth)
-    AllocatedQueueDepth = HostAdapter->DriverQueueDepth;
-  BusLogic_CreateAdditionalCCBs(HostAdapter,
-				AllocatedQueueDepth
-				- HostAdapter->AllocatedCCBs,
-				false);
-  if (HostAdapter == BusLogic_LastRegisteredHostAdapter)
-    for (HostAdapter = BusLogic_FirstRegisteredHostAdapter;
-	 HostAdapter != NULL;
-	 HostAdapter = HostAdapter->Next)
-      BusLogic_ReportTargetDeviceInfo(HostAdapter);
-}
-*/
-
-/*
   BusLogic_DetectHostAdapter probes for BusLogic Host Adapters at the standard
   I/O Addresses where they may be located, initializing, registering, and
   reporting the configuration of each BusLogic Host Adapter it finds.  It
@@ -2831,13 +2656,13 @@
   registered.
 */
 
-int BusLogic_DetectHostAdapter(SCSI_Host_Template_T *HostTemplate)
+static int __init BusLogic_DetectHostAdapter(struct scsi_host_template *HostTemplate)
 {
   int BusLogicHostAdapterCount = 0, DriverOptionsIndex = 0, ProbeIndex;
-  BusLogic_HostAdapter_T *PrototypeHostAdapter;
+  struct BusLogic_HostAdapter *PrototypeHostAdapter;
   if (BusLogic_ProbeOptions.NoProbe) return 0;
-  BusLogic_ProbeInfoList = (BusLogic_ProbeInfo_T *)
-    kmalloc(BusLogic_MaxHostAdapters * sizeof(BusLogic_ProbeInfo_T),
+  BusLogic_ProbeInfoList = (struct BusLogic_ProbeInfo *)
+    kmalloc(BusLogic_MaxHostAdapters * sizeof(struct BusLogic_ProbeInfo),
 	    GFP_ATOMIC);
   if (BusLogic_ProbeInfoList == NULL)
     {
@@ -2845,9 +2670,9 @@
       return 0;
     }
   memset(BusLogic_ProbeInfoList, 0,
-	 BusLogic_MaxHostAdapters * sizeof(BusLogic_ProbeInfo_T));
-  PrototypeHostAdapter = (BusLogic_HostAdapter_T *)
-    kmalloc(sizeof(BusLogic_HostAdapter_T), GFP_ATOMIC);
+	 BusLogic_MaxHostAdapters * sizeof(struct BusLogic_ProbeInfo));
+  PrototypeHostAdapter = (struct BusLogic_HostAdapter *)
+    kmalloc(sizeof(struct BusLogic_HostAdapter), GFP_ATOMIC);
   if (PrototypeHostAdapter == NULL)
     {
       kfree(BusLogic_ProbeInfoList);
@@ -2855,7 +2680,7 @@
 		     "Host Adapter\n", NULL);
       return 0;
     }
-  memset(PrototypeHostAdapter, 0, sizeof(BusLogic_HostAdapter_T));
+  memset(PrototypeHostAdapter, 0, sizeof(struct BusLogic_HostAdapter));
 #ifdef MODULE
   if (BusLogic != NULL)
     BusLogic_Setup(BusLogic);
@@ -2863,11 +2688,11 @@
   BusLogic_InitializeProbeInfoList(PrototypeHostAdapter);
   for (ProbeIndex = 0; ProbeIndex < BusLogic_ProbeInfoCount; ProbeIndex++)
     {
-      BusLogic_ProbeInfo_T *ProbeInfo = &BusLogic_ProbeInfoList[ProbeIndex];
-      BusLogic_HostAdapter_T *HostAdapter = PrototypeHostAdapter;
-      SCSI_Host_T *Host;
+      struct BusLogic_ProbeInfo *ProbeInfo = &BusLogic_ProbeInfoList[ProbeIndex];
+      struct BusLogic_HostAdapter *HostAdapter = PrototypeHostAdapter;
+      struct Scsi_Host *Host;
       if (ProbeInfo->IO_Address == 0) continue;
-      memset(HostAdapter, 0, sizeof(BusLogic_HostAdapter_T));
+      memset(HostAdapter, 0, sizeof(struct BusLogic_HostAdapter));
       HostAdapter->HostAdapterType = ProbeInfo->HostAdapterType;
       HostAdapter->HostAdapterBusType = ProbeInfo->HostAdapterBusType;
       HostAdapter->IO_Address = ProbeInfo->IO_Address;
@@ -2914,21 +2739,18 @@
       /*
 	Register the SCSI Host structure.
       */
-      Host = scsi_register(HostTemplate, sizeof(BusLogic_HostAdapter_T));
+
+      Host = scsi_host_alloc(HostTemplate, sizeof(struct BusLogic_HostAdapter));
       if(Host==NULL)
       {
       	release_region(HostAdapter->IO_Address, HostAdapter->AddressCount);
       	continue;
       }
-      HostAdapter = (BusLogic_HostAdapter_T *) Host->hostdata;
-      memcpy(HostAdapter, PrototypeHostAdapter, sizeof(BusLogic_HostAdapter_T));
+      HostAdapter = (struct BusLogic_HostAdapter *) Host->hostdata;
+      memcpy(HostAdapter, PrototypeHostAdapter, sizeof(struct BusLogic_HostAdapter));
       HostAdapter->SCSI_Host = Host;
       HostAdapter->HostNumber = Host->host_no;
       /*
-       * This function is deprecated
-      Host->select_queue_depths = BusLogic_SelectQueueDepths;
-       */
-      /*
 	Add Host Adapter to the end of the list of registered BusLogic
 	Host Adapters.
       */
@@ -2963,10 +2785,12 @@
 		  BusLogic_DestroyCCBs(HostAdapter);
 		  BusLogic_ReleaseResources(HostAdapter);
 		  BusLogic_UnregisterHostAdapter(HostAdapter);
-		  scsi_unregister(Host);
+		  scsi_host_put(Host);
 	  }
 	  else {
 		  BusLogic_InitializeHostStructure(HostAdapter, Host);
+	          scsi_add_host(Host, NULL);
+	          scsi_scan_host(Host);
 		  BusLogicHostAdapterCount++;
 	  }
 	}
@@ -2983,7 +2807,7 @@
 	  BusLogic_DestroyCCBs(HostAdapter);
 	  BusLogic_ReleaseResources(HostAdapter);
 	  BusLogic_UnregisterHostAdapter(HostAdapter);
-	  scsi_unregister(Host);
+	  scsi_host_put(Host);
 	}
     }
   kfree(PrototypeHostAdapter);
@@ -2999,10 +2823,10 @@
   unregisters the BusLogic Host Adapter.
 */
 
-int BusLogic_ReleaseHostAdapter(SCSI_Host_T *Host)
+static int __exit BusLogic_ReleaseHostAdapter(struct Scsi_Host *Host)
 {
-  BusLogic_HostAdapter_T *HostAdapter =
-    (BusLogic_HostAdapter_T *) Host->hostdata;
+  struct BusLogic_HostAdapter *HostAdapter =
+    (struct BusLogic_HostAdapter *) Host->hostdata;
   /*
     FlashPoint Host Adapters must first be released by the FlashPoint
     SCCB Manager.
@@ -3031,9 +2855,9 @@
   BusLogic_QueueCompletedCCB queues CCB for completion processing.
 */
 
-static void BusLogic_QueueCompletedCCB(BusLogic_CCB_T *CCB)
+static void BusLogic_QueueCompletedCCB(struct BusLogic_CCB *CCB)
 {
-  BusLogic_HostAdapter_T *HostAdapter = CCB->HostAdapter;
+  struct BusLogic_HostAdapter *HostAdapter = CCB->HostAdapter;
   CCB->Status = BusLogic_CCB_Completed;
   CCB->Next = NULL;
   if (HostAdapter->FirstCompletedCCB == NULL)
@@ -3055,10 +2879,10 @@
   the Host Adapter Status and Target Device Status.
 */
 
-static int BusLogic_ComputeResultCode(BusLogic_HostAdapter_T *HostAdapter,
-				      BusLogic_HostAdapterStatus_T
+static int BusLogic_ComputeResultCode(struct BusLogic_HostAdapter *HostAdapter,
+				      enum BusLogic_HostAdapterStatus
 					HostAdapterStatus,
-				      BusLogic_TargetDeviceStatus_T
+				      enum BusLogic_TargetDeviceStatus
 					TargetDeviceStatus)
 {
   int HostStatus;
@@ -3114,7 +2938,7 @@
   Incoming Mailbox entries for completion processing.
 */
 
-static void BusLogic_ScanIncomingMailboxes(BusLogic_HostAdapter_T *HostAdapter)
+static void BusLogic_ScanIncomingMailboxes(struct BusLogic_HostAdapter *HostAdapter)
 {
   /*
     Scan through the Incoming Mailboxes in Strict Round Robin fashion, saving
@@ -3128,9 +2952,9 @@
     was processed, and so completion processing has already occurred and no
     further action should be taken.
   */
-  BusLogic_IncomingMailbox_T *NextIncomingMailbox =
+  struct BusLogic_IncomingMailbox *NextIncomingMailbox =
     HostAdapter->NextIncomingMailbox;
-  BusLogic_CompletionCode_T CompletionCode;
+  enum BusLogic_CompletionCode CompletionCode;
   while ((CompletionCode = NextIncomingMailbox->CompletionCode) !=
 	 BusLogic_IncomingMailboxFree)
     {
@@ -3141,7 +2965,7 @@
         replace bus_to_virt() or else this code is going to become very
         innefficient.
       */
-      BusLogic_CCB_T *CCB = (BusLogic_CCB_T *)
+      struct BusLogic_CCB *CCB = (struct BusLogic_CCB *)
 	Bus_to_Virtual(NextIncomingMailbox->CCB);
       if (CompletionCode != BusLogic_AbortedCommandNotFound)
 	{
@@ -3182,14 +3006,14 @@
   should already have been acquired by the caller.
 */
 
-static void BusLogic_ProcessCompletedCCBs(BusLogic_HostAdapter_T *HostAdapter)
+static void BusLogic_ProcessCompletedCCBs(struct BusLogic_HostAdapter *HostAdapter)
 {
   if (HostAdapter->ProcessCompletedCCBsActive) return;
   HostAdapter->ProcessCompletedCCBsActive = true;
   while (HostAdapter->FirstCompletedCCB != NULL)
     {
-      BusLogic_CCB_T *CCB = HostAdapter->FirstCompletedCCB;
-      SCSI_Command_T *Command = CCB->Command;
+      struct BusLogic_CCB *CCB = HostAdapter->FirstCompletedCCB;
+      struct scsi_cmnd *Command = CCB->Command;
       HostAdapter->FirstCompletedCCB = CCB->Next;
       if (HostAdapter->FirstCompletedCCB == NULL)
 	HostAdapter->LastCompletedCCB = NULL;
@@ -3221,7 +3045,7 @@
 	  */
 	  while (Command != NULL)
 	    {
-	      SCSI_Command_T *NextCommand = Command->reset_chain;
+	      struct scsi_cmnd *NextCommand = Command->reset_chain;
 	      Command->reset_chain = NULL;
 	      Command->result = DID_RESET << 16;
 	      Command->scsi_done(Command);
@@ -3312,10 +3136,10 @@
 	  if (CCB->CDB[0] == INQUIRY && CCB->CDB[1] == 0 &&
 	      CCB->HostAdapterStatus == BusLogic_CommandCompletedNormally)
 	    {
-	      BusLogic_TargetFlags_T *TargetFlags =
+	      struct BusLogic_TargetFlags *TargetFlags =
 		&HostAdapter->TargetFlags[CCB->TargetID];
-	      SCSI_Inquiry_T *InquiryResult =
-		(SCSI_Inquiry_T *) Command->request_buffer;
+	      struct SCSI_Inquiry *InquiryResult =
+		(struct SCSI_Inquiry *) Command->request_buffer;
 	      TargetFlags->TargetExists = true;
 	      TargetFlags->TaggedQueuingSupported = InquiryResult->CmdQue;
 	      TargetFlags->WideTransfersSupported = InquiryResult->WBus16;
@@ -3341,11 +3165,11 @@
 
 static irqreturn_t BusLogic_InterruptHandler(int IRQ_Channel,
 				      void *DeviceIdentifier,
-				      Registers_T *InterruptRegisters)
+				      struct pt_regs *InterruptRegisters)
 {
-  BusLogic_HostAdapter_T *HostAdapter =
-    (BusLogic_HostAdapter_T *) DeviceIdentifier;
-  ProcessorFlags_T ProcessorFlags;
+  struct BusLogic_HostAdapter *HostAdapter =
+    (struct BusLogic_HostAdapter *) DeviceIdentifier;
+  unsigned long ProcessorFlags;
   /*
     Acquire exclusive access to Host Adapter.
   */
@@ -3355,12 +3179,12 @@
   */
   if (BusLogic_MultiMasterHostAdapterP(HostAdapter))
     {
-      BusLogic_InterruptRegister_T InterruptRegister;
+      union BusLogic_InterruptRegister InterruptRegister;
       /*
 	Read the Host Adapter Interrupt Register.
       */
       InterruptRegister.All = BusLogic_ReadInterruptRegister(HostAdapter);
-      if (InterruptRegister.Bits.InterruptValid)
+      if (InterruptRegister.InterruptValid)
 	{
 	  /*
 	    Acknowledge the interrupt and reset the Host Adapter
@@ -3373,11 +3197,11 @@
 	    and Outgoing Mailbox Available Interrupts are ignored, as
 	    they are never enabled.
 	  */
-	  if (InterruptRegister.Bits.ExternalBusReset)
+	  if (InterruptRegister.ExternalBusReset)
 	    HostAdapter->HostAdapterExternalReset = true;
-	  else if (InterruptRegister.Bits.IncomingMailboxLoaded)
+	  else if (InterruptRegister.IncomingMailboxLoaded)
 	    BusLogic_ScanIncomingMailboxes(HostAdapter);
-	  else if (InterruptRegister.Bits.CommandComplete)
+	  else if (InterruptRegister.CommandComplete)
 	    HostAdapter->HostAdapterCommandCompleted = true;
 	}
     }
@@ -3409,11 +3233,20 @@
   /*
     Reset the Host Adapter if requested.
   */
-  if (HostAdapter->HostAdapterExternalReset ||
-      HostAdapter->HostAdapterInternalError)
+  if (HostAdapter->HostAdapterExternalReset)
     {
-      BusLogic_ResetHostAdapter(HostAdapter, NULL, 0);
+      BusLogic_Warning("Resetting %s due to External SCSI Bus Reset\n",
+		       HostAdapter, HostAdapter->FullModelName);
+      BusLogic_IncrementErrorCounter(&HostAdapter->ExternalHostAdapterResets);
+      BusLogic_ResetHostAdapter(HostAdapter, false);
       HostAdapter->HostAdapterExternalReset = false;
+    }
+  else if (HostAdapter->HostAdapterInternalError)
+    {
+      BusLogic_Warning("Resetting %s due to Host Adapter Internal Error\n",
+		       HostAdapter, HostAdapter->FullModelName);
+      BusLogic_IncrementErrorCounter(&HostAdapter->HostAdapterInternalErrors);
+      BusLogic_ResetHostAdapter(HostAdapter, true);
       HostAdapter->HostAdapterInternalError = false;
     }
   /*
@@ -3430,12 +3263,12 @@
   already have been acquired by the caller.
 */
 
-static boolean BusLogic_WriteOutgoingMailbox(BusLogic_HostAdapter_T
+static boolean BusLogic_WriteOutgoingMailbox(struct BusLogic_HostAdapter
 					       *HostAdapter,
-					     BusLogic_ActionCode_T ActionCode,
-					     BusLogic_CCB_T *CCB)
+					     enum BusLogic_ActionCode ActionCode,
+					     struct BusLogic_CCB *CCB)
 {
-  BusLogic_OutgoingMailbox_T *NextOutgoingMailbox;
+  struct BusLogic_OutgoingMailbox *NextOutgoingMailbox;
   NextOutgoingMailbox = HostAdapter->NextOutgoingMailbox;
   if (NextOutgoingMailbox->ActionCode == BusLogic_OutgoingMailboxFree)
     {
@@ -3466,13 +3299,14 @@
 
 static int BusLogic_host_reset(Scsi_Cmnd *SCpnt)
 {
-	BusLogic_HostAdapter_T *HostAdapter =
-		(BusLogic_HostAdapter_T *) SCpnt->device->host->hostdata;
+	struct BusLogic_HostAdapter *HostAdapter =
+		(struct BusLogic_HostAdapter *) SCpnt->device->host->hostdata;
 
-	/* printk("BusLogic_host_reset\n"); */
-	HostAdapter->HostAdapterExternalReset = 1;
-	BusLogic_ResetHostAdapter(HostAdapter, NULL, 0);
-	return SUCCESS;
+	unsigned int id = SCpnt->device->id;
+	struct BusLogic_TargetStatistics *stats = &HostAdapter->TargetStatistics[id];
+	BusLogic_IncrementErrorCounter(&stats->HostAdapterResetsRequested);
+
+	return BusLogic_ResetHostAdapter(HostAdapter, false);
 }
 
 /*
@@ -3480,14 +3314,14 @@
   Outgoing Mailbox for execution by the associated Host Adapter.
 */
 
-int BusLogic_QueueCommand(SCSI_Command_T *Command,
-			  void (*CompletionRoutine)(SCSI_Command_T *))
+static int BusLogic_QueueCommand(struct scsi_cmnd *Command,
+				 void (*CompletionRoutine)(struct scsi_cmnd *))
 {
-  BusLogic_HostAdapter_T *HostAdapter =
-    (BusLogic_HostAdapter_T *) Command->device->host->hostdata;
-  BusLogic_TargetFlags_T *TargetFlags =
+  struct BusLogic_HostAdapter *HostAdapter =
+    (struct BusLogic_HostAdapter *) Command->device->host->hostdata;
+  struct BusLogic_TargetFlags *TargetFlags =
     &HostAdapter->TargetFlags[Command->device->id];
-  BusLogic_TargetStatistics_T *TargetStatistics =
+  struct BusLogic_TargetStatistics *TargetStatistics =
     HostAdapter->TargetStatistics;
   unsigned char *CDB = Command->cmnd;
   int CDB_Length = Command->cmd_len;
@@ -3496,7 +3330,7 @@
   void *BufferPointer = Command->request_buffer;
   int BufferLength = Command->request_bufflen;
   int SegmentCount = Command->use_sg;
-  BusLogic_CCB_T *CCB;
+  struct BusLogic_CCB *CCB;
   /*
     SCSI REQUEST_SENSE commands will be executed automatically by the Host
     Adapter for any errors, so they should not be executed explicitly unless
@@ -3541,13 +3375,13 @@
     }
   else if (SegmentCount != 0)
     {
-      SCSI_ScatterList_T *ScatterList = (SCSI_ScatterList_T *) BufferPointer;
+      struct scatterlist *ScatterList = (struct scatterlist *) BufferPointer;
       int Segment, Count;
 
       Count = pci_map_sg(HostAdapter->PCI_Device, ScatterList, SegmentCount,
 			 scsi_to_pci_dma_dir(Command->sc_data_direction));
       CCB->Opcode = BusLogic_InitiatorCCB_ScatterGather;
-      CCB->DataLength = Count * sizeof(BusLogic_ScatterGatherSegment_T);
+      CCB->DataLength = Count * sizeof(struct BusLogic_ScatterGatherSegment);
       if (BusLogic_MultiMasterHostAdapterP(HostAdapter))
 	CCB->DataPointer = (unsigned int)CCB->DMA_Handle +
 			    ((unsigned long)&CCB->ScatterGatherList - 
@@ -3625,7 +3459,7 @@
     }
   if (TargetFlags->TaggedQueuingActive)
     {
-      BusLogic_QueueTag_T QueueTag = BusLogic_SimpleQueueTag;
+      enum BusLogic_QueueTag QueueTag = BusLogic_SimpleQueueTag;
       /*
 	When using Tagged Queuing with Simple Queue Tags, it appears that disk
 	drive controllers do not guarantee that a queued command will not
@@ -3718,14 +3552,13 @@
   BusLogic_AbortCommand aborts Command if possible.
 */
 
-int BusLogic_AbortCommand(SCSI_Command_T *Command)
+static int BusLogic_AbortCommand(struct scsi_cmnd *Command)
 {
-  BusLogic_HostAdapter_T *HostAdapter =
-    (BusLogic_HostAdapter_T *) Command->device->host->hostdata;
+  struct BusLogic_HostAdapter *HostAdapter =
+    (struct BusLogic_HostAdapter *) Command->device->host->hostdata;
 
   int TargetID = Command->device->id;
-  BusLogic_CCB_T *CCB;
-  int Result;
+  struct BusLogic_CCB *CCB;
   BusLogic_IncrementErrorCounter(
     &HostAdapter->TargetStatistics[TargetID].CommandAbortsRequested);
   /*
@@ -3735,7 +3568,7 @@
     {
       BusLogic_Warning("Unable to Abort Command to Target %d - "
 		       "Already Completed\n", HostAdapter, TargetID);
-      return SCSI_ABORT_NOT_RUNNING;
+      return SUCCESS;
     }
   /*
     Attempt to find an Active CCB for this Command.  If no Active CCB for this
@@ -3747,19 +3580,19 @@
     {
       BusLogic_Warning("Unable to Abort Command to Target %d - "
 		       "No CCB Found\n", HostAdapter, TargetID);
-      return SCSI_ABORT_NOT_RUNNING;
+      return SUCCESS;
     }
   else if (CCB->Status == BusLogic_CCB_Completed)
     {
       BusLogic_Warning("Unable to Abort Command to Target %d - "
 		       "CCB Completed\n", HostAdapter, TargetID);
-      return SCSI_ABORT_NOT_RUNNING;
+      return SUCCESS;
     }
   else if (CCB->Status == BusLogic_CCB_Reset)
     {
       BusLogic_Warning("Unable to Abort Command to Target %d - "
 		       "CCB Reset\n", HostAdapter, TargetID);
-      return SCSI_ABORT_PENDING;
+      return SUCCESS;
     }
   if (BusLogic_MultiMasterHostAdapterP(HostAdapter))
     {
@@ -3779,7 +3612,7 @@
 	  BusLogic_Warning("Unable to Abort CCB #%ld to Target %d - "
 			   "Abort Tag Not Supported\n",
 			   HostAdapter, CCB->SerialNumber, TargetID);
-	  Result = SCSI_ABORT_SNOOZE;
+	  return FAILURE;
 	}
       else if (BusLogic_WriteOutgoingMailbox(
 		 HostAdapter, BusLogic_MailboxAbortCommand, CCB))
@@ -3788,14 +3621,14 @@
 			   HostAdapter, CCB->SerialNumber, TargetID);
 	  BusLogic_IncrementErrorCounter(
 	    &HostAdapter->TargetStatistics[TargetID].CommandAbortsAttempted);
-	  Result = SCSI_ABORT_PENDING;
+	  return SUCCESS;
 	}
       else
 	{
 	  BusLogic_Warning("Unable to Abort CCB #%ld to Target %d - "
 			   "No Outgoing Mailboxes\n",
 			    HostAdapter, CCB->SerialNumber, TargetID);
-	  Result = SCSI_ABORT_BUSY;
+	  return FAILURE;
 	}
     }
   else
@@ -3813,413 +3646,63 @@
 	BusLogic_QueueCompletedCCB been called, or it
 	may still be pending.
       */
-      Result = SCSI_ABORT_PENDING;
       if (CCB->Status == BusLogic_CCB_Completed)
 	{
 	  BusLogic_ProcessCompletedCCBs(HostAdapter);
-	  Result = SCSI_ABORT_SUCCESS;
 	}
+      return SUCCESS;
     }
-  return Result;
+  return SUCCESS;
 }
 
-
 /*
   BusLogic_ResetHostAdapter resets Host Adapter if possible, marking all
   currently executing SCSI Commands as having been Reset.
 */
 
-static int BusLogic_ResetHostAdapter(BusLogic_HostAdapter_T *HostAdapter,
-				     SCSI_Command_T *Command,
-				     unsigned int ResetFlags)
-{
-  BusLogic_CCB_T *CCB;
-  int TargetID, Result;
-  boolean HardReset;
-  if (HostAdapter->HostAdapterExternalReset)
-    {
-      BusLogic_IncrementErrorCounter(&HostAdapter->ExternalHostAdapterResets);
-      HardReset = false;
-    }
-  else if (HostAdapter->HostAdapterInternalError)
-    {
-      BusLogic_IncrementErrorCounter(&HostAdapter->HostAdapterInternalErrors);
-      HardReset = true;
-    }
-  else
-    {
-      BusLogic_IncrementErrorCounter(
-	&HostAdapter->TargetStatistics[Command->device->id]
-		      .HostAdapterResetsRequested);
-      HardReset = true;
-    }
-  /*
-    If this is an Asynchronous Reset and this Command has already completed,
-    then no Reset is necessary.
-  */
-  if (ResetFlags & SCSI_RESET_ASYNCHRONOUS)
-    {
-      TargetID = Command->device->id;
-      if (Command->serial_number != Command->serial_number_at_timeout)
-	{
-	  BusLogic_Warning("Unable to Reset Command to Target %d - "
-			   "Already Completed or Reset\n",
-			   HostAdapter, TargetID);
-	  Result = SCSI_RESET_NOT_RUNNING;
-	  goto Done;
-      }
-      for (CCB = HostAdapter->All_CCBs; CCB != NULL; CCB = CCB->NextAll)
-	if (CCB->Command == Command) break;
-      if (CCB == NULL)
-	{
-	  BusLogic_Warning("Unable to Reset Command to Target %d - "
-			   "No CCB Found\n", HostAdapter, TargetID);
-	  Result = SCSI_RESET_NOT_RUNNING;
-	  goto Done;
-	}
-      else if (CCB->Status == BusLogic_CCB_Completed)
-	{
-	  BusLogic_Warning("Unable to Reset Command to Target %d - "
-			   "CCB Completed\n", HostAdapter, TargetID);
-	  Result = SCSI_RESET_NOT_RUNNING;
-	  goto Done;
-	}
-      else if (CCB->Status == BusLogic_CCB_Reset &&
-	       HostAdapter->BusDeviceResetPendingCCB[TargetID] == NULL)
-	{
-	  BusLogic_Warning("Unable to Reset Command to Target %d - "
-			   "Reset Pending\n", HostAdapter, TargetID);
-	  Result = SCSI_RESET_PENDING;
-	  goto Done;
-	}
-    }
-  if (Command == NULL)
-    {
-      if (HostAdapter->HostAdapterInternalError)
-	BusLogic_Warning("Resetting %s due to Host Adapter Internal Error\n",
-			 HostAdapter, HostAdapter->FullModelName);
-      else BusLogic_Warning("Resetting %s due to External SCSI Bus Reset\n",
-			    HostAdapter, HostAdapter->FullModelName);
-    }
-  else
-    {
-      BusLogic_Warning("Resetting %s due to Target %d\n", HostAdapter,
-		       HostAdapter->FullModelName, Command->device->id);
-      BusLogic_IncrementErrorCounter(
-	&HostAdapter->TargetStatistics[Command->device->id]
-		      .HostAdapterResetsAttempted);
-    }
-  /*
-    Attempt to Reset and Reinitialize the Host Adapter.
-  */
-  if (!(BusLogic_HardwareResetHostAdapter(HostAdapter, HardReset) &&
-	BusLogic_InitializeHostAdapter(HostAdapter)))
-    {
-      BusLogic_Error("Resetting %s Failed\n", HostAdapter,
-		     HostAdapter->FullModelName);
-      Result = SCSI_RESET_ERROR;
-      goto Done;
-    }
-  if (Command != NULL)
-    BusLogic_IncrementErrorCounter(
-      &HostAdapter->TargetStatistics[Command->device->id]
-		    .HostAdapterResetsCompleted);
-  /*
-    Mark all currently executing CCBs as having been Reset.
-  */
-  for (CCB = HostAdapter->All_CCBs; CCB != NULL; CCB = CCB->NextAll)
-    if (CCB->Status == BusLogic_CCB_Active)
-      CCB->Status = BusLogic_CCB_Reset;
-  /*
-    Wait a few seconds between the Host Adapter Hard Reset which initiates
-    a SCSI Bus Reset and issuing any SCSI Commands.  Some SCSI devices get
-    confused if they receive SCSI Commands too soon after a SCSI Bus Reset.
-    Note that a timer interrupt may occur here, but all active CCBs have
-    already been marked Reset and so a reentrant call will return Pending.
-  */
-  if (HardReset)
-    {
-      BusLogic_ReleaseHostAdapterLock(HostAdapter);
-      BusLogic_Delay(HostAdapter->BusSettleTime);
-      BusLogic_AcquireHostAdapterLock(HostAdapter);
-    }
-  /*
-    If this is a Synchronous Reset, perform completion processing for
-    the Command being Reset.
-  */
-  if (ResetFlags & SCSI_RESET_SYNCHRONOUS)
-    {
-      Command->result = DID_RESET << 16;
-      Command->scsi_done(Command);
-    }
-  /*
-    Perform completion processing for all CCBs marked as Reset.
-  */
-  for (CCB = HostAdapter->All_CCBs; CCB != NULL; CCB = CCB->NextAll)
-    if (CCB->Status == BusLogic_CCB_Reset)
-      {
-	Command = CCB->Command;
-	BusLogic_DeallocateCCB(CCB);
-#if 0	/* this needs to be redone different for new EH */
-	while (Command != NULL)
-	  {
-	    SCSI_Command_T *NextCommand = Command->reset_chain;
-	    Command->reset_chain = NULL;
-	    Command->result = DID_RESET << 16;
-	    Command->scsi_done(Command);
-	    Command = NextCommand;
-	  }
-#endif
-      }
-  for (TargetID = 0; TargetID < HostAdapter->MaxTargetDevices; TargetID++)
-    {
-      HostAdapter->LastResetAttempted[TargetID] = jiffies;
-      HostAdapter->LastResetCompleted[TargetID] = jiffies;
-    }
-  Result = SCSI_RESET_SUCCESS | SCSI_RESET_HOST_RESET;
-Done:
-  return Result;
-}
-
-#if 0	/* old-style EH code references a dead struct scsi_cmnd member */
-/*
-  BusLogic_SendBusDeviceReset sends a Bus Device Reset to the Target
-  Device associated with Command.
-*/
-
-static int BusLogic_SendBusDeviceReset(BusLogic_HostAdapter_T *HostAdapter,
-				       SCSI_Command_T *Command,
-				       unsigned int ResetFlags)
+static int BusLogic_ResetHostAdapter(struct BusLogic_HostAdapter *HostAdapter,
+				     boolean HardReset)
 {
-  int TargetID = Command->device->id;
-  BusLogic_CCB_T *CCB, *XCCB;
-  int Result = -1;
-  BusLogic_IncrementErrorCounter(
-    &HostAdapter->TargetStatistics[TargetID].BusDeviceResetsRequested);
-  /*
-    If this is an Asynchronous Reset and this Command has already completed,
-    then no Reset is necessary.
-  */
-  if (ResetFlags & SCSI_RESET_ASYNCHRONOUS)
-    {
-      if (Command->serial_number != Command->serial_number_at_timeout)
-	{
-	  BusLogic_Warning("Unable to Reset Command to Target %d - "
-			   "Already Completed\n", HostAdapter, TargetID);
-	  Result = SCSI_RESET_NOT_RUNNING;
-	  goto Done;
-	}
-      for (CCB = HostAdapter->All_CCBs; CCB != NULL; CCB = CCB->NextAll)
-	if (CCB->Command == Command) break;
-      if (CCB == NULL)
-	{
-	  BusLogic_Warning("Unable to Reset Command to Target %d - "
-			   "No CCB Found\n", HostAdapter, TargetID);
-	  Result = SCSI_RESET_NOT_RUNNING;
-	  goto Done;
-	}
-      else if (CCB->Status == BusLogic_CCB_Completed)
-	{
-	  BusLogic_Warning("Unable to Reset Command to Target %d - "
-			   "CCB Completed\n", HostAdapter, TargetID);
-	  Result = SCSI_RESET_NOT_RUNNING;
-	  goto Done;
-	}
-      else if (CCB->Status == BusLogic_CCB_Reset)
-	{
-	  BusLogic_Warning("Unable to Reset Command to Target %d - "
-			   "Reset Pending\n", HostAdapter, TargetID);
-	  Result = SCSI_RESET_PENDING;
-	  goto Done;
-	}
-      else if (HostAdapter->BusDeviceResetPendingCCB[TargetID] != NULL)
-	{
-	  BusLogic_Warning("Bus Device Reset already pending to Target %d\n",
-			   HostAdapter, TargetID);
-	  goto Done;
-	}
-    }
-  /*
-    If this is a Synchronous Reset and a Bus Device Reset is already pending
-    for this Target Device, do not send a second one.  Add this Command to
-    the list of Commands for which completion processing must be performed
-    when the Bus Device Reset CCB completes.
-  */
-  if (ResetFlags & SCSI_RESET_SYNCHRONOUS)
-    if ((CCB = HostAdapter->BusDeviceResetPendingCCB[TargetID]) != NULL)
-      {
-	Command->reset_chain = CCB->Command;
-	CCB->Command = Command;
-	BusLogic_Warning("Unable to Reset Command to Target %d - "
-			 "Reset Pending\n", HostAdapter, TargetID);
-	Result = SCSI_RESET_PENDING;
-	goto Done;
-      }
-  if (BusLogic_MultiMasterHostAdapterP(HostAdapter))
-    {
-      /*
-	MultiMaster Firmware versions prior to 5.xx treat a Bus Device Reset as
-	a non-tagged command.  Since non-tagged commands are not sent by the
-	Host Adapter until the queue of outstanding tagged commands has
-	completed, it is effectively impossible to send a Bus Device Reset
-	while there are tagged commands outstanding.  Therefore, in that case a
-	full Host Adapter Hard Reset and SCSI Bus Reset must be done.
-      */
-      if (HostAdapter->TargetFlags[TargetID].TaggedQueuingActive &&
-	  HostAdapter->ActiveCommands[TargetID] > 0 &&
-	  HostAdapter->FirmwareVersion[0] < '5')
-	goto Done;
-    }
-  /*
-    Allocate a CCB from the Host Adapter's free list.  In the unlikely event
-    that there are none available and memory allocation fails, attempt a full
-    Host Adapter Hard Reset and SCSI Bus Reset.
-  */
-  CCB = BusLogic_AllocateCCB(HostAdapter);
-  if (CCB == NULL) goto Done;
-  BusLogic_Warning("Sending Bus Device Reset CCB #%ld to Target %d\n",
-		   HostAdapter, CCB->SerialNumber, TargetID);
-  CCB->Opcode = BusLogic_BusDeviceReset;
-  CCB->TargetID = TargetID;
-  /*
-    For Synchronous Resets, arrange for the interrupt handler to perform
-    completion processing for the Command being Reset.
-  */
-  if (ResetFlags & SCSI_RESET_SYNCHRONOUS)
-    {
-      Command->reset_chain = NULL;
-      CCB->Command = Command;
-    }
-  if (BusLogic_MultiMasterHostAdapterP(HostAdapter))
-    {
-      /*
-	Attempt to write an Outgoing Mailbox with the Bus Device Reset CCB.
-	If sending a Bus Device Reset is impossible, attempt a full Host
-	Adapter Hard Reset and SCSI Bus Reset.
-      */
-      if (!(BusLogic_WriteOutgoingMailbox(
-	      HostAdapter, BusLogic_MailboxStartCommand, CCB)))
-	{
-	  BusLogic_Warning("Unable to write Outgoing Mailbox for "
-			   "Bus Device Reset\n", HostAdapter);
-	  BusLogic_DeallocateCCB(CCB);
-	  goto Done;
-	}
-    }
-  else
-    {
-      /*
-	Call the FlashPoint SCCB Manager to start execution of the CCB.
-      */
-      CCB->Status = BusLogic_CCB_Active;
-      HostAdapter->ActiveCommands[TargetID]++;
-      FlashPoint_StartCCB(HostAdapter->CardHandle, CCB);
-    }
-  /*
-    If there is a currently executing CCB in the Host Adapter for this Command
-    (i.e. this is an Asynchronous Reset), then an Incoming Mailbox entry may be
-    made with a completion code of BusLogic_HostAdapterAssertedBusDeviceReset.
-    If there is no active CCB for this Command (i.e. this is a Synchronous
-    Reset), then the Bus Device Reset CCB's Command field will have been set
-    to the Command so that the interrupt for the completion of the Bus Device
-    Reset can call the Completion Routine for the Command.  On successful
-    execution of a Bus Device Reset, older firmware versions did return the
-    pending CCBs with the appropriate completion code, but more recent firmware
-    versions only return the Bus Device Reset CCB itself.  This driver handles
-    both cases by marking all the currently executing CCBs to this Target
-    Device as Reset.  When the Bus Device Reset CCB is processed by the
-    interrupt handler, any remaining CCBs marked as Reset will have completion
-    processing performed.
-  */
-  BusLogic_IncrementErrorCounter(
-    &HostAdapter->TargetStatistics[TargetID].BusDeviceResetsAttempted);
-  HostAdapter->BusDeviceResetPendingCCB[TargetID] = CCB;
-  HostAdapter->LastResetAttempted[TargetID] = jiffies;
-  for (XCCB = HostAdapter->All_CCBs; XCCB != NULL; XCCB = XCCB->NextAll)
-    if (XCCB->Status == BusLogic_CCB_Active && XCCB->TargetID == TargetID)
-      XCCB->Status = BusLogic_CCB_Reset;
-  /*
-    FlashPoint Host Adapters may have already completed the Bus Device
-    Reset and BusLogic_QueueCompletedCCB been called, or it may still be
-    pending.
-  */
-  Result = SCSI_RESET_PENDING;
-  if (BusLogic_FlashPointHostAdapterP(HostAdapter))
-    if (CCB->Status == BusLogic_CCB_Completed)
-      {
-	BusLogic_ProcessCompletedCCBs(HostAdapter);
-	Result = SCSI_RESET_SUCCESS;
-      }
-  /*
-    If a Bus Device Reset was not possible for some reason, force a full
-    Host Adapter Hard Reset and SCSI Bus Reset.
-  */
-Done:
-  if (Result < 0)
-    Result = BusLogic_ResetHostAdapter(HostAdapter, Command, ResetFlags);
-  return Result;
-}
-
-
-/*
-  BusLogic_ResetCommand takes appropriate action to reset Command.
-*/
+	struct BusLogic_CCB *CCB;
+	int TargetID;
 
-int BusLogic_ResetCommand(SCSI_Command_T *Command, unsigned int ResetFlags)
-{
-  BusLogic_HostAdapter_T *HostAdapter =
-    (BusLogic_HostAdapter_T *) Command->device->host->hostdata;
-  int TargetID = Command->device->id;
-  BusLogic_ErrorRecoveryStrategy_T
-    ErrorRecoveryStrategy = HostAdapter->ErrorRecoveryStrategy[TargetID];
-  /*
-    Disable Tagged Queuing if it is active for this Target Device and if
-    it has been less than 10 minutes since the last reset occurred, or since
-    the system was initialized if no prior resets have occurred.
-  */
-  if (HostAdapter->TargetFlags[TargetID].TaggedQueuingActive &&
-      jiffies - HostAdapter->LastResetCompleted[TargetID] < 10*60*HZ)
-    {
-      HostAdapter->TaggedQueuingPermitted &= ~(1 << TargetID);
-      HostAdapter->TargetFlags[TargetID].TaggedQueuingActive = false;
-      BusLogic_Warning("Tagged Queuing now disabled for Target %d\n",
-		       HostAdapter, TargetID);
-    }
-  switch (ErrorRecoveryStrategy)
-    {
-    case BusLogic_ErrorRecovery_Default:
-      if (ResetFlags & SCSI_RESET_SUGGEST_HOST_RESET)
-	return BusLogic_ResetHostAdapter(HostAdapter, Command, ResetFlags);
-      else if (ResetFlags & SCSI_RESET_SUGGEST_BUS_RESET)
-	return BusLogic_ResetHostAdapter(HostAdapter, Command, ResetFlags);
-      /* Fall through to Bus Device Reset case. */
-    case BusLogic_ErrorRecovery_BusDeviceReset:
-      /*
-	The Bus Device Reset Error Recovery Strategy only graduates to a Hard
-	Reset when no commands have completed successfully since the last Bus
-	Device Reset and it has been at least 100 milliseconds.  This prevents
-	a sequence of commands that all timeout together from immediately
-	forcing a Hard Reset before the Bus Device Reset has had a chance to
-	clear the error condition.
-      */
-      if (HostAdapter->TargetFlags[TargetID].CommandSuccessfulFlag ||
-	  jiffies - HostAdapter->LastResetAttempted[TargetID] < HZ/10)
-	{
-	  HostAdapter->TargetFlags[TargetID].CommandSuccessfulFlag = false;
-	  return BusLogic_SendBusDeviceReset(HostAdapter, Command, ResetFlags);
+	/*
+	 * Attempt to Reset and Reinitialize the Host Adapter.
+	 */
+
+	if (!(BusLogic_HardwareResetHostAdapter(HostAdapter, HardReset) &&
+		BusLogic_InitializeHostAdapter(HostAdapter))) {
+		BusLogic_Error("Resetting %s Failed\n", HostAdapter,
+			       HostAdapter->FullModelName);
+		return FAILURE;
+	}
+
+	/*
+	 * Deallocate all currently executing CCBs.
+	 */
+
+	for (CCB = HostAdapter->All_CCBs; CCB != NULL; CCB = CCB->NextAll)
+		if (CCB->Status == BusLogic_CCB_Active)
+			BusLogic_DeallocateCCB(CCB);
+	/*
+	 * Wait a few seconds between the Host Adapter Hard Reset which
+	 * initiates a SCSI Bus Reset and issuing any SCSI Commands.  Some
+	 * SCSI devices get confused if they receive SCSI Commands too soon
+	 * after a SCSI Bus Reset.
+	 */
+
+	if (HardReset) {
+		BusLogic_ReleaseHostAdapterLock(HostAdapter);
+		BusLogic_Delay(HostAdapter->BusSettleTime);
+		BusLogic_AcquireHostAdapterLock(HostAdapter);
+	}
+
+	for (TargetID = 0; TargetID < HostAdapter->MaxTargetDevices; TargetID++) {
+		HostAdapter->LastResetAttempted[TargetID] = jiffies;
+		HostAdapter->LastResetCompleted[TargetID] = jiffies;
 	}
-      /* Fall through to Hard Reset case. */
-    case BusLogic_ErrorRecovery_HardReset:
-      return BusLogic_ResetHostAdapter(HostAdapter, Command, ResetFlags);
-    case BusLogic_ErrorRecovery_None:
-      BusLogic_Warning("Error Recovery for Target %d Suppressed\n",
-		       HostAdapter, TargetID);
-      break;
-    }
-  return SCSI_RESET_PUNT;
+	return SUCCESS;
 }
-#endif
-
 
 /*
   BusLogic_BIOSDiskParameters returns the Heads/Sectors/Cylinders BIOS Disk
@@ -4237,12 +3720,12 @@
   table, then the translation inferred from the partition table will be used by
   the BIOS, and a warning may be displayed.
 */
-unsigned char *scsi_bios_ptable(struct block_device *);
-int BusLogic_BIOSDiskParameters(struct scsi_device *sdev, struct block_device *Device,
-				sector_t capacity, int *Parameters)
+
+static int BusLogic_BIOSDiskParameters(struct scsi_device *sdev, struct block_device *Device,
+				       sector_t capacity, int *Parameters)
 {
-  BusLogic_HostAdapter_T *HostAdapter = (BusLogic_HostAdapter_T *) sdev->host->hostdata;
-  BIOS_DiskParameters_T *DiskParameters = (BIOS_DiskParameters_T *) Parameters;
+  struct BusLogic_HostAdapter *HostAdapter = (struct BusLogic_HostAdapter *) sdev->host->hostdata;
+  struct BIOS_DiskParameters *DiskParameters = (struct BIOS_DiskParameters *) Parameters;
   unsigned char *buf;
   if (HostAdapter->ExtendedTranslationEnabled &&
       capacity >= 2*1024*1024 /* 1 GB in 512 byte sectors */)
@@ -4274,8 +3757,8 @@
   */
   if (*(unsigned short *) (buf+64) == 0xAA55)
     {
-      PartitionTable_T *FirstPartitionEntry = (PartitionTable_T *) buf;
-      PartitionTable_T *PartitionEntry = FirstPartitionEntry;
+      struct partition *FirstPartitionEntry = (struct partition *) buf;
+      struct partition *PartitionEntry = FirstPartitionEntry;
       int SavedCylinders = DiskParameters->Cylinders, PartitionNumber;
       unsigned char PartitionEntryEndHead=0, PartitionEntryEndSector=0;
       for (PartitionNumber = 0; PartitionNumber < 4; PartitionNumber++)
@@ -4337,12 +3820,12 @@
   BugLogic_ProcDirectoryInfo implements /proc/scsi/BusLogic/<N>.
 */
 
-int BusLogic_ProcDirectoryInfo(struct Scsi_Host *shost, char *ProcBuffer, char **StartPointer,
-			       off_t Offset, int BytesAvailable,
-			       int WriteFlag)
+static int BusLogic_ProcDirectoryInfo(struct Scsi_Host *shost, char *ProcBuffer,
+				      char **StartPointer, off_t Offset,
+				      int BytesAvailable, int WriteFlag)
 {
-  BusLogic_HostAdapter_T *HostAdapter;
-  BusLogic_TargetStatistics_T *TargetStatistics;
+  struct BusLogic_HostAdapter *HostAdapter;
+  struct BusLogic_TargetStatistics *TargetStatistics;
   int TargetID, Length;
   char *Buffer;
   for (HostAdapter = BusLogic_FirstRegisteredHostAdapter;
@@ -4361,7 +3844,7 @@
       HostAdapter->ExternalHostAdapterResets = 0;
       HostAdapter->HostAdapterInternalErrors = 0;
       memset(TargetStatistics, 0,
-	     BusLogic_MaxTargetDevices * sizeof(BusLogic_TargetStatistics_T));
+	     BusLogic_MaxTargetDevices * sizeof(struct BusLogic_TargetStatistics));
       return 0;
     }
   Buffer = HostAdapter->MessageBuffer;
@@ -4378,7 +3861,7 @@
 ======	==============	===========  ======  =========	=========\n");
   for (TargetID = 0; TargetID < HostAdapter->MaxTargetDevices; TargetID++)
     {
-      BusLogic_TargetFlags_T *TargetFlags = &HostAdapter->TargetFlags[TargetID];
+      struct BusLogic_TargetFlags *TargetFlags = &HostAdapter->TargetFlags[TargetID];
       if (!TargetFlags->TargetExists) continue;
       Length +=
 	sprintf(&Buffer[Length], "  %2d	%s", TargetID,
@@ -4400,7 +3883,7 @@
 ======  =============  ==============  ===================  ===================\n");
   for (TargetID = 0; TargetID < HostAdapter->MaxTargetDevices; TargetID++)
     {
-      BusLogic_TargetFlags_T *TargetFlags = &HostAdapter->TargetFlags[TargetID];
+      struct BusLogic_TargetFlags *TargetFlags = &HostAdapter->TargetFlags[TargetID];
       if (!TargetFlags->TargetExists) continue;
       Length +=
 	sprintf(&Buffer[Length], "  %2d	  %9u	 %9u", TargetID,
@@ -4430,7 +3913,7 @@
 ======  =======  =========  =========  =========  =========  =========\n");
   for (TargetID = 0; TargetID < HostAdapter->MaxTargetDevices; TargetID++)
     {
-      BusLogic_TargetFlags_T *TargetFlags = &HostAdapter->TargetFlags[TargetID];
+      struct BusLogic_TargetFlags *TargetFlags = &HostAdapter->TargetFlags[TargetID];
       if (!TargetFlags->TargetExists) continue;
       Length +=
 	sprintf(&Buffer[Length],
@@ -4454,7 +3937,7 @@
 ======  =======  =========  =========  =========  =========  =========\n");
   for (TargetID = 0; TargetID < HostAdapter->MaxTargetDevices; TargetID++)
     {
-      BusLogic_TargetFlags_T *TargetFlags = &HostAdapter->TargetFlags[TargetID];
+      struct BusLogic_TargetFlags *TargetFlags = &HostAdapter->TargetFlags[TargetID];
       if (!TargetFlags->TargetExists) continue;
       Length +=
 	sprintf(&Buffer[Length],
@@ -4482,7 +3965,7 @@
 ======	 ===== ===== =====    ===== ===== =====	   ===== ===== =====\n");
   for (TargetID = 0; TargetID < HostAdapter->MaxTargetDevices; TargetID++)
     {
-      BusLogic_TargetFlags_T *TargetFlags = &HostAdapter->TargetFlags[TargetID];
+      struct BusLogic_TargetFlags *TargetFlags = &HostAdapter->TargetFlags[TargetID];
       if (!TargetFlags->TargetExists) continue;
       Length +=
 	sprintf(&Buffer[Length], "\
@@ -4516,9 +3999,9 @@
   BusLogic_Message prints Driver Messages.
 */
 
-static void BusLogic_Message(BusLogic_MessageLevel_T MessageLevel,
+static void BusLogic_Message(enum BusLogic_MessageLevel MessageLevel,
 			     char *Format,
-			     BusLogic_HostAdapter_T *HostAdapter,
+			     struct BusLogic_HostAdapter *HostAdapter,
 			     ...)
 {
   static char Buffer[BusLogic_LineBufferSize];
@@ -4570,7 +4053,7 @@
   and updates the pointer if the keyword is recognized and false otherwise.
 */
 
-static boolean BusLogic_ParseKeyword(char **StringPointer, char *Keyword)
+static boolean __init BusLogic_ParseKeyword(char **StringPointer, char *Keyword)
 {
   char *Pointer = *StringPointer;
   while (*Keyword != '\0')
@@ -4609,19 +4092,16 @@
 {
   while (true)
     {
-      BusLogic_DriverOptions_T *DriverOptions =
+      struct BusLogic_DriverOptions *DriverOptions =
 	&BusLogic_DriverOptions[BusLogic_DriverOptionsCount++];
       int TargetID;
-      memset(DriverOptions, 0, sizeof(BusLogic_DriverOptions_T));
-      for (TargetID = 0; TargetID < BusLogic_MaxTargetDevices; TargetID++)
-	DriverOptions->ErrorRecoveryStrategy[TargetID] =
-	  BusLogic_ErrorRecovery_Default;
+      memset(DriverOptions, 0, sizeof(struct BusLogic_DriverOptions));
       while (*OptionsString != '\0' && *OptionsString != ';')
 	{
 	  /* Probing Options. */
 	  if (BusLogic_ParseKeyword(&OptionsString, "IO:"))
 	    {
-	      BusLogic_IO_Address_T IO_Address =
+	      unsigned long IO_Address =
 		simple_strtoul(OptionsString, &OptionsString, 0);
 	      BusLogic_ProbeOptions.LimitedProbeISA = true;
 	      switch (IO_Address)
@@ -4763,62 +4243,6 @@
 		      }
 		}
 	    }
-	  /* Error Recovery Option. */
-	  else if (BusLogic_ParseKeyword(&OptionsString, "ErrorRecovery:") ||
-		   BusLogic_ParseKeyword(&OptionsString, "ER:"))
-	    {
-	      if (BusLogic_ParseKeyword(&OptionsString, "Default"))
-		for (TargetID = 0;
-		     TargetID < BusLogic_MaxTargetDevices;
-		     TargetID++)
-		  DriverOptions->ErrorRecoveryStrategy[TargetID] =
-		    BusLogic_ErrorRecovery_Default;
-	      else if (BusLogic_ParseKeyword(&OptionsString, "HardReset"))
-		for (TargetID = 0;
-		     TargetID < BusLogic_MaxTargetDevices;
-		     TargetID++)
-		  DriverOptions->ErrorRecoveryStrategy[TargetID] =
-		    BusLogic_ErrorRecovery_HardReset;
-	      else if (BusLogic_ParseKeyword(&OptionsString, "BusDeviceReset"))
-		for (TargetID = 0;
-		     TargetID < BusLogic_MaxTargetDevices;
-		     TargetID++)
-		  DriverOptions->ErrorRecoveryStrategy[TargetID] =
-		    BusLogic_ErrorRecovery_BusDeviceReset;
-	      else if (BusLogic_ParseKeyword(&OptionsString, "None"))
-		for (TargetID = 0;
-		     TargetID < BusLogic_MaxTargetDevices;
-		     TargetID++)
-		  DriverOptions->ErrorRecoveryStrategy[TargetID] =
-		    BusLogic_ErrorRecovery_None;
-	      else
-		for (TargetID = 0;
-		     TargetID < BusLogic_MaxTargetDevices;
-		     TargetID++)
-		  switch (*OptionsString++)
-		    {
-		    case 'D':
-		      DriverOptions->ErrorRecoveryStrategy[TargetID] =
-			BusLogic_ErrorRecovery_Default;
-		      break;
-		    case 'H':
-		      DriverOptions->ErrorRecoveryStrategy[TargetID] =
-			BusLogic_ErrorRecovery_HardReset;
-		      break;
-		    case 'B':
-		      DriverOptions->ErrorRecoveryStrategy[TargetID] =
-			BusLogic_ErrorRecovery_BusDeviceReset;
-		      break;
-		    case 'N':
-		      DriverOptions->ErrorRecoveryStrategy[TargetID] =
-			BusLogic_ErrorRecovery_None;
-		      break;
-		    default:
-		      OptionsString--;
-		      TargetID = BusLogic_MaxTargetDevices;
-		      break;
-		    }
-	    }
 	  /* Miscellaneous Options. */
 	  else if (BusLogic_ParseKeyword(&OptionsString, "BusSettleTime:") ||
 		   BusLogic_ParseKeyword(&OptionsString, "BST:"))
@@ -4887,13 +4311,33 @@
     return 1;
 }
 
+/*
+  Get it all started
+*/
+
+static struct scsi_host_template driver_template = {
+	.module			= THIS_MODULE,
+	.proc_name		= "BusLogic",
+	.proc_info		= BusLogic_ProcDirectoryInfo,
+	.name			= "BusLogic",
+	.info			= BusLogic_DriverInfo,
+	.queuecommand		= BusLogic_QueueCommand,
+	.slave_configure	= BusLogic_SlaveConfigure,
+	.bios_param		= BusLogic_BIOSDiskParameters,
+	.eh_host_reset_handler	= BusLogic_host_reset,
+#if 0
+	.eh_abort_handler	= BusLogic_AbortCommand,
+#endif
+	.unchecked_isa_dma	= 1,
+	.max_sectors		= 128,
+	.use_clustering		= ENABLE_CLUSTERING,
+};
 
 /*
   BusLogic_Setup handles processing of Kernel Command Line Arguments.
 */
 
-static int __init 
-BusLogic_Setup(char *str)
+static int __init BusLogic_Setup(char *str)
 {
 	int ints[3];
 
@@ -4909,27 +4353,41 @@
 	return BusLogic_ParseDriverOptions(str);
 }
 
-__setup("BusLogic=", BusLogic_Setup);
+/*
+ * Initialization function
+ */
+
+static int __init BusLogic_init(void) {
+
+#ifdef MODULE
+	if (BusLogic)
+		BusLogic_Setup(BusLogic);
+#endif
+	 
+	return BusLogic_DetectHostAdapter(&driver_template) ? 0 : -ENODEV;
+}
 
 /*
-  Get it all started
-*/
-MODULE_LICENSE("GPL");
+ * Exit function.  Deletes all hosts associated with this driver.
+ */
 
-static SCSI_Host_Template_T driver_template = {
-	.proc_name		= "BusLogic",
-	.proc_info		= BusLogic_ProcDirectoryInfo,
-	.name			= "BusLogic",
-	.detect			= BusLogic_DetectHostAdapter,
-	.release		= BusLogic_ReleaseHostAdapter,
-	.info			= BusLogic_DriverInfo,
-	.queuecommand		= BusLogic_QueueCommand,
-	.slave_configure	= BusLogic_SlaveConfigure,
-	.bios_param		= BusLogic_BIOSDiskParameters,
-	.eh_host_reset_handler	= BusLogic_host_reset,
-	.unchecked_isa_dma	= 1,
-	.max_sectors		= 128,
-	.use_clustering		= ENABLE_CLUSTERING,
-};
-#include "scsi_module.c"
+static void __exit BusLogic_exit(void)
+{
+	struct BusLogic_HostAdapter *HostAdapter;
+	for (HostAdapter = BusLogic_FirstRegisteredHostAdapter;
+		HostAdapter != NULL; HostAdapter = HostAdapter->Next) {
+		struct Scsi_Host *host = HostAdapter->SCSI_Host;
+		scsi_remove_host(host);
+
+	}
+	for (HostAdapter = BusLogic_FirstRegisteredHostAdapter;
+		HostAdapter != NULL; HostAdapter = HostAdapter->Next) {
+		struct Scsi_Host *host = HostAdapter->SCSI_Host;
+		BusLogic_ReleaseHostAdapter(host);
+	}
+}
+
+__setup("BusLogic=", BusLogic_Setup);
 
+module_init(BusLogic_init);
+module_exit(BusLogic_exit);
--- diff/drivers/scsi/BusLogic.h	2003-06-30 10:07:22.000000000 +0100
+++ source/drivers/scsi/BusLogic.h	2004-02-09 10:39:55.000000000 +0000
@@ -25,42 +25,14 @@
 
 */
 
+#ifndef _BUSLOGIC_H
+#define _BUSLOGIC_H
 
 #include <linux/config.h>
 
-
-/*
-  Define types for some of the structures that interface with the rest
-  of the Linux Kernel and SCSI Subsystem.
-*/
-
-typedef unsigned long ProcessorFlags_T;
-typedef struct pt_regs Registers_T;
-typedef struct partition PartitionTable_T;
-typedef struct pci_dev PCI_Device_T;
-typedef Scsi_Host_Template SCSI_Host_Template_T;
-typedef struct Scsi_Host SCSI_Host_T;
-typedef struct scsi_device SCSI_Device_T;
-typedef struct scsi_cmnd SCSI_Command_T;
-typedef struct scatterlist SCSI_ScatterList_T;
-
-
-/*
-  Define prototypes for the BusLogic Driver Interface Functions.
-*/
-
-extern const char *BusLogic_DriverInfo(SCSI_Host_T *);
-extern int BusLogic_DetectHostAdapter(SCSI_Host_Template_T *);
-extern int BusLogic_ReleaseHostAdapter(SCSI_Host_T *);
-extern int BusLogic_QueueCommand(SCSI_Command_T *,
-				 void (*CompletionRoutine)(SCSI_Command_T *));
-extern int BusLogic_BIOSDiskParameters(struct scsi_device *,
-		struct block_device *, sector_t, int *);
-extern int BusLogic_ProcDirectoryInfo(struct Scsi_Host *, char *, char **, off_t, int, int);
-extern int BusLogic_SlaveConfigure(SCSI_Device_T *);
-
-#ifdef BusLogic_DriverVersion
-
+#ifndef PACKED
+#define PACKED __attribute__((packed))
+#endif
 
 /*
   FlashPoint support is only available for the Intel x86 Architecture with
@@ -75,8 +47,7 @@
 #ifndef CONFIG_PCI
 #undef CONFIG_SCSI_OMIT_FLASHPOINT
 #define CONFIG_SCSI_OMIT_FLASHPOINT
-#define BusLogic_InitializeProbeInfoListISA \
-  BusLogic_InitializeProbeInfoList
+#define BusLogic_InitializeProbeInfoListISA BusLogic_InitializeProbeInfoList
 #endif
 
 
@@ -157,18 +128,16 @@
   Define the Driver Message Levels.
 */
 
-typedef enum BusLogic_MessageLevel
+enum BusLogic_MessageLevel
 {
   BusLogic_AnnounceLevel =			0,
   BusLogic_InfoLevel =				1,
   BusLogic_NoticeLevel =			2,
   BusLogic_WarningLevel =			3,
   BusLogic_ErrorLevel =				4
-}
-BusLogic_MessageLevel_T;
+};
 
-static char
-  *BusLogic_MessageLevelMap[] =
+static char *BusLogic_MessageLevelMap[] =
     { KERN_NOTICE, KERN_NOTICE, KERN_NOTICE, KERN_WARNING, KERN_ERR };
 
 
@@ -197,19 +166,16 @@
   of I/O Addresses required by each type.
 */
 
-typedef enum
+enum BusLogic_HostAdapterType
 {
   BusLogic_MultiMaster =			1,
   BusLogic_FlashPoint =				2
-}
-__attribute__ ((packed))
-BusLogic_HostAdapterType_T;
+} PACKED;
 
 #define BusLogic_MultiMasterAddressCount	4
 #define BusLogic_FlashPointAddressCount		256
 
-static int
-  BusLogic_HostAdapterAddressCount[3] =
+static int BusLogic_HostAdapterAddressCount[3] =
     { 0, BusLogic_MultiMasterAddressCount, BusLogic_FlashPointAddressCount };
 
 
@@ -240,7 +206,7 @@
   Define the possible Host Adapter Bus Types.
 */
 
-typedef enum
+enum BusLogic_HostAdapterBusType
 {
   BusLogic_Unknown_Bus =			0,
   BusLogic_ISA_Bus =				1,
@@ -248,116 +214,75 @@
   BusLogic_PCI_Bus =				3,
   BusLogic_VESA_Bus =				4,
   BusLogic_MCA_Bus =				5
-}
-__attribute__ ((packed))
-BusLogic_HostAdapterBusType_T;
+} PACKED;
 
-static char
-  *BusLogic_HostAdapterBusNames[] =
+static char *BusLogic_HostAdapterBusNames[] =
     { "Unknown", "ISA", "EISA", "PCI", "VESA", "MCA" };
 
-static BusLogic_HostAdapterBusType_T
-  BusLogic_HostAdapterBusTypes[] =
-    { BusLogic_VESA_Bus,				/* BT-4xx */
-      BusLogic_ISA_Bus,					/* BT-5xx */
-      BusLogic_MCA_Bus,					/* BT-6xx */
-      BusLogic_EISA_Bus,				/* BT-7xx */
-      BusLogic_Unknown_Bus,				/* BT-8xx */
-      BusLogic_PCI_Bus };				/* BT-9xx */
-
+static enum BusLogic_HostAdapterBusType BusLogic_HostAdapterBusTypes[] =
+{
+  BusLogic_VESA_Bus,				/* BT-4xx */
+  BusLogic_ISA_Bus,				/* BT-5xx */
+  BusLogic_MCA_Bus,				/* BT-6xx */
+  BusLogic_EISA_Bus,				/* BT-7xx */
+  BusLogic_Unknown_Bus,				/* BT-8xx */
+  BusLogic_PCI_Bus				/* BT-9xx */
+};
 
 /*
   Define the possible Host Adapter BIOS Disk Geometry Translations.
 */
 
-typedef enum BusLogic_BIOS_DiskGeometryTranslation
+enum BusLogic_BIOS_DiskGeometryTranslation
 {
   BusLogic_BIOS_Disk_Not_Installed =		0,
   BusLogic_BIOS_Disk_Installed_64x32 =		1,
   BusLogic_BIOS_Disk_Installed_128x32 =		2,
   BusLogic_BIOS_Disk_Installed_255x63 =		3
-}
-__attribute__ ((packed))
-BusLogic_BIOS_DiskGeometryTranslation_T;
+} PACKED;
 
 
 /*
   Define a Boolean data type.
 */
 
-typedef enum { false, true } __attribute__ ((packed)) boolean;
-
-
-/*
-  Define a 32 bit I/O Address data type.
-*/
-
-typedef unsigned int BusLogic_IO_Address_T;
-
-
-/*
-  Define a 32 bit PCI Bus Address data type.
-*/
-
-typedef unsigned int BusLogic_PCI_Address_T;
-
-
-/*
-  Define a 32 bit Base Address data type.
-*/
-
-typedef unsigned int BusLogic_Base_Address_T;
-
-
-/*
-  Define a 32 bit Bus Address data type.
-*/
-
-typedef unsigned int BusLogic_BusAddress_T;
-
-
-/*
-  Define a 32 bit Byte Count data type.
-*/
-
-typedef unsigned int BusLogic_ByteCount_T;
-
+typedef enum {
+  false,
+  true
+} PACKED boolean;
 
 /*
   Define a 10^18 Statistics Byte Counter data type.
 */
 
-typedef struct BusLogic_ByteCounter
+struct BusLogic_ByteCounter
 {
   unsigned int Units;
   unsigned int Billions;
-}
-BusLogic_ByteCounter_T;
+};
 
 
 /*
   Define the structure for I/O Address and Bus Probing Information.
 */
 
-typedef struct BusLogic_ProbeInfo
+struct BusLogic_ProbeInfo
 {
-  BusLogic_HostAdapterType_T HostAdapterType;
-  BusLogic_HostAdapterBusType_T HostAdapterBusType;
-  BusLogic_IO_Address_T IO_Address;
-  BusLogic_PCI_Address_T PCI_Address;
-  PCI_Device_T *PCI_Device;
+  enum BusLogic_HostAdapterType HostAdapterType;
+  enum BusLogic_HostAdapterBusType HostAdapterBusType;
+  unsigned long IO_Address;
+  unsigned long PCI_Address;
+  struct pci_dev *PCI_Device;
   unsigned char Bus;
   unsigned char Device;
   unsigned char IRQ_Channel;
-}
-BusLogic_ProbeInfo_T;
-
+};
 
 /*
   Define the Probe Options.
 */
 
-typedef struct BusLogic_ProbeOptions
+struct BusLogic_ProbeOptions
 {
   boolean NoProbe:1;					/* Bit 0 */
   boolean NoProbeISA:1;					/* Bit 1 */
@@ -372,55 +297,28 @@
   boolean Probe234:1;					/* Bit 10 */
   boolean Probe130:1;					/* Bit 11 */
   boolean Probe134:1;					/* Bit 12 */
-}
-BusLogic_ProbeOptions_T;
-
+};
 
 /*
   Define the Global Options.
 */
 
-typedef struct BusLogic_GlobalOptions
+struct BusLogic_GlobalOptions
 {
   boolean TraceProbe:1;					/* Bit 0 */
   boolean TraceHardwareReset:1;				/* Bit 1 */
   boolean TraceConfiguration:1;				/* Bit 2 */
   boolean TraceErrors:1;				/* Bit 3 */
-}
-BusLogic_GlobalOptions_T;
-
+};
 
 /*
   Define the Local Options.
 */
 
-typedef struct BusLogic_LocalOptions
+struct BusLogic_LocalOptions
 {
   boolean InhibitTargetInquiry:1;			/* Bit 0 */
-}
-BusLogic_LocalOptions_T;
-
-
-/*
-  Define the Error Recovery Strategy Options.
-*/
-
-typedef enum
-{
-  BusLogic_ErrorRecovery_Default =		0,
-  BusLogic_ErrorRecovery_BusDeviceReset =	1,
-  BusLogic_ErrorRecovery_HardReset =		2,
-  BusLogic_ErrorRecovery_None =			3
-}
-__attribute__ ((packed))
-BusLogic_ErrorRecoveryStrategy_T;
-
-static char
-  *BusLogic_ErrorRecoveryStrategyNames[] =
-    { "Default", "Bus Device Reset", "Hard Reset", "None" },
-  BusLogic_ErrorRecoveryStrategyLetters[] =
-    { 'D', 'B', 'H', 'N' };
-
+};
 
 /*
   Define the BusLogic SCSI Host Adapter I/O Register Offsets.
@@ -433,12 +331,11 @@
 #define BusLogic_InterruptRegisterOffset	2	/* RO register */
 #define BusLogic_GeometryRegisterOffset		3	/* RO register */
 
-
 /*
   Define the structure of the write-only Control Register.
 */
 
-typedef union BusLogic_ControlRegister
+union BusLogic_ControlRegister
 {
   unsigned char All;
   struct {
@@ -447,16 +344,14 @@
     boolean InterruptReset:1;				/* Bit 5 */
     boolean SoftReset:1;				/* Bit 6 */
     boolean HardReset:1;				/* Bit 7 */
-  } Bits;
-}
-BusLogic_ControlRegister_T;
-
+  };
+};
 
 /*
   Define the structure of the read-only Status Register.
 */
 
-typedef union BusLogic_StatusRegister
+union BusLogic_StatusRegister
 {
   unsigned char All;
   struct {
@@ -468,16 +363,14 @@
     boolean InitializationRequired:1;			/* Bit 5 */
     boolean DiagnosticFailure:1;			/* Bit 6 */
     boolean DiagnosticActive:1;				/* Bit 7 */
-  } Bits;
-}
-BusLogic_StatusRegister_T;
-
+  };
+};
 
 /*
   Define the structure of the read-only Interrupt Register.
 */
 
-typedef union BusLogic_InterruptRegister
+union BusLogic_InterruptRegister
 {
   unsigned char All;
   struct {
@@ -487,121 +380,93 @@
     boolean ExternalBusReset:1;				/* Bit 3 */
     unsigned char Reserved:3;				/* Bits 4-6 */
     boolean InterruptValid:1;				/* Bit 7 */
-  } Bits;
-}
-BusLogic_InterruptRegister_T;
-
+  };
+};
 
 /*
   Define the structure of the read-only Geometry Register.
 */
 
-typedef union BusLogic_GeometryRegister
+union BusLogic_GeometryRegister
 {
   unsigned char All;
   struct {
-    BusLogic_BIOS_DiskGeometryTranslation_T Drive0Geometry:2; /* Bits 0-1 */
-    BusLogic_BIOS_DiskGeometryTranslation_T Drive1Geometry:2; /* Bits 2-3 */
-    unsigned char :3;					/* Bits 4-6 */
-    boolean ExtendedTranslationEnabled:1;		/* Bit 7 */
-  } Bits;
-}
-BusLogic_GeometryRegister_T;
-
+    enum BusLogic_BIOS_DiskGeometryTranslation Drive0Geometry:2;/* Bits 0-1 */
+    enum BusLogic_BIOS_DiskGeometryTranslation Drive1Geometry:2;/* Bits 2-3 */
+    unsigned char :3;						/* Bits 4-6 */
+    boolean ExtendedTranslationEnabled:1;			/* Bit 7 */
+  };
+};
 
 /*
   Define the BusLogic SCSI Host Adapter Command Register Operation Codes.
 */
 
-typedef enum
+enum BusLogic_OperationCode
 {
-  BusLogic_TestCommandCompleteInterrupt =	0x00,
-  BusLogic_InitializeMailbox =			0x01,
-  BusLogic_ExecuteMailboxCommand =		0x02,
-  BusLogic_ExecuteBIOSCommand =			0x03,
-  BusLogic_InquireBoardID =			0x04,
-  BusLogic_EnableOutgoingMailboxAvailableInt =	0x05,
-  BusLogic_SetSCSISelectionTimeout =		0x06,
-  BusLogic_SetPreemptTimeOnBus =		0x07,
-  BusLogic_SetTimeOffBus =			0x08,
-  BusLogic_SetBusTransferRate =			0x09,
-  BusLogic_InquireInstalledDevicesID0to7 =	0x0A,
-  BusLogic_InquireConfiguration =		0x0B,
-  BusLogic_EnableTargetMode =			0x0C,
-  BusLogic_InquireSetupInformation =		0x0D,
-  BusLogic_WriteAdapterLocalRAM =		0x1A,
-  BusLogic_ReadAdapterLocalRAM =		0x1B,
-  BusLogic_WriteBusMasterChipFIFO =		0x1C,
-  BusLogic_ReadBusMasterChipFIFO =		0x1D,
-  BusLogic_EchoCommandData =			0x1F,
-  BusLogic_HostAdapterDiagnostic =		0x20,
-  BusLogic_SetAdapterOptions =			0x21,
-  BusLogic_InquireInstalledDevicesID8to15 =	0x23,
-  BusLogic_InquireTargetDevices =		0x24,
-  BusLogic_DisableHostAdapterInterrupt =	0x25,
-  BusLogic_InitializeExtendedMailbox =		0x81,
-  BusLogic_ExecuteSCSICommand =			0x83,
-  BusLogic_InquireFirmwareVersion3rdDigit =	0x84,
-  BusLogic_InquireFirmwareVersionLetter =	0x85,
-  BusLogic_InquirePCIHostAdapterInformation =	0x86,
-  BusLogic_InquireHostAdapterModelNumber =	0x8B,
-  BusLogic_InquireSynchronousPeriod =		0x8C,
-  BusLogic_InquireExtendedSetupInformation =	0x8D,
-  BusLogic_EnableStrictRoundRobinMode =		0x8F,
-  BusLogic_StoreHostAdapterLocalRAM =		0x90,
-  BusLogic_FetchHostAdapterLocalRAM =		0x91,
-  BusLogic_StoreLocalDataInEEPROM =		0x92,
-  BusLogic_UploadAutoSCSICode =			0x94,
-  BusLogic_ModifyIOAddress =			0x95,
-  BusLogic_SetCCBFormat =			0x96,
-  BusLogic_WriteInquiryBuffer =			0x9A,
-  BusLogic_ReadInquiryBuffer =			0x9B,
-  BusLogic_FlashROMUploadDownload =		0xA7,
-  BusLogic_ReadSCAMData =			0xA8,
-  BusLogic_WriteSCAMData =			0xA9
-}
-BusLogic_OperationCode_T;
-
+  BusLogic_TestCommandCompleteInterrupt =		0x00,
+  BusLogic_InitializeMailbox =				0x01,
+  BusLogic_ExecuteMailboxCommand =			0x02,
+  BusLogic_ExecuteBIOSCommand =				0x03,
+  BusLogic_InquireBoardID =				0x04,
+  BusLogic_EnableOutgoingMailboxAvailableInt =		0x05,
+  BusLogic_SetSCSISelectionTimeout =			0x06,
+  BusLogic_SetPreemptTimeOnBus =			0x07,
+  BusLogic_SetTimeOffBus =				0x08,
+  BusLogic_SetBusTransferRate =				0x09,
+  BusLogic_InquireInstalledDevicesID0to7 =		0x0A,
+  BusLogic_InquireConfiguration =			0x0B,
+  BusLogic_EnableTargetMode =				0x0C,
+  BusLogic_InquireSetupInformation =			0x0D,
+  BusLogic_WriteAdapterLocalRAM =			0x1A,
+  BusLogic_ReadAdapterLocalRAM =			0x1B,
+  BusLogic_WriteBusMasterChipFIFO =			0x1C,
+  BusLogic_ReadBusMasterChipFIFO =			0x1D,
+  BusLogic_EchoCommandData =				0x1F,
+  BusLogic_HostAdapterDiagnostic =			0x20,
+  BusLogic_SetAdapterOptions =				0x21,
+  BusLogic_InquireInstalledDevicesID8to15 =		0x23,
+  BusLogic_InquireTargetDevices =			0x24,
+  BusLogic_DisableHostAdapterInterrupt =		0x25,
+  BusLogic_InitializeExtendedMailbox =			0x81,
+  BusLogic_ExecuteSCSICommand =				0x83,
+  BusLogic_InquireFirmwareVersion3rdDigit =		0x84,
+  BusLogic_InquireFirmwareVersionLetter =		0x85,
+  BusLogic_InquirePCIHostAdapterInformation =		0x86,
+  BusLogic_InquireHostAdapterModelNumber =		0x8B,
+  BusLogic_InquireSynchronousPeriod =			0x8C,
+  BusLogic_InquireExtendedSetupInformation =		0x8D,
+  BusLogic_EnableStrictRoundRobinMode =			0x8F,
+  BusLogic_StoreHostAdapterLocalRAM =			0x90,
+  BusLogic_FetchHostAdapterLocalRAM =			0x91,
+  BusLogic_StoreLocalDataInEEPROM =			0x92,
+  BusLogic_UploadAutoSCSICode =				0x94,
+  BusLogic_ModifyIOAddress =				0x95,
+  BusLogic_SetCCBFormat =				0x96,
+  BusLogic_WriteInquiryBuffer =				0x9A,
+  BusLogic_ReadInquiryBuffer =				0x9B,
+  BusLogic_FlashROMUploadDownload =			0xA7,
+  BusLogic_ReadSCAMData =				0xA8,
+  BusLogic_WriteSCAMData =				0xA9
+};
 
 /*
   Define the Inquire Board ID reply structure.
 */
 
-typedef struct BusLogic_BoardID
+struct BusLogic_BoardID
 {
   unsigned char BoardType;				/* Byte 0 */
   unsigned char CustomFeatures;				/* Byte 1 */
   unsigned char FirmwareVersion1stDigit;		/* Byte 2 */
   unsigned char FirmwareVersion2ndDigit;		/* Byte 3 */
-}
-BusLogic_BoardID_T;
-
-
-/*
-  Define the Inquire Installed Devices ID 0 to 7 and Inquire Installed
-  Devices ID 8 to 15 reply type.  For each Target Device, a byte is returned
-  where bit 0 set indicates that Logical Unit 0 exists, bit 1 set indicates
-  that Logical Unit 1 exists, and so on.
-*/
-
-typedef unsigned char BusLogic_InstalledDevices8_T[8];
-
-
-/*
-  Define the Inquire Target Devices reply type.  Inquire Target Devices only
-  tests Logical Unit 0 of each Target Device unlike the Inquire Installed
-  Devices commands which test Logical Units 0 - 7.  Two bytes are returned,
-  where byte 0 bit 0 set indicates that Target Device 0 exists, and so on.
-*/
-
-typedef unsigned short BusLogic_InstalledDevices_T;
-
+};
 
 /*
   Define the Inquire Configuration reply structure.
 */
 
-typedef struct BusLogic_Configuration
+struct BusLogic_Configuration
 {
   unsigned char :5;					/* Byte 0 Bits 0-4 */
   boolean DMA_Channel5:1;				/* Byte 0 Bit 5 */
@@ -617,29 +482,20 @@
   unsigned char :1;					/* Byte 1 Bit 7 */
   unsigned char HostAdapterID:4;			/* Byte 2 Bits 0-3 */
   unsigned char :4;					/* Byte 2 Bits 4-7 */
-}
-BusLogic_Configuration_T;
-
+};
 
 /*
   Define the Inquire Setup Information reply structure.
 */
 
-typedef struct BusLogic_SynchronousValue
+struct BusLogic_SynchronousValue
 {
   unsigned char Offset:4;				/* Bits 0-3 */
   unsigned char TransferPeriod:3;			/* Bits 4-6 */
   boolean Synchronous:1;				/* Bit 7 */
-}
-BusLogic_SynchronousValue_T;
+};
 
-typedef BusLogic_SynchronousValue_T
-  BusLogic_SynchronousValues8_T[8];
-
-typedef BusLogic_SynchronousValue_T
-  BusLogic_SynchronousValues_T[BusLogic_MaxTargetDevices];
-
-typedef struct BusLogic_SetupInformation
+struct BusLogic_SetupInformation
 {
   boolean SynchronousInitiationEnabled:1;		/* Byte 0 Bit 0 */
   boolean ParityCheckingEnabled:1;			/* Byte 0 Bit 1 */
@@ -649,47 +505,29 @@
   unsigned char TimeOffBus;				/* Byte 3 */
   unsigned char MailboxCount;				/* Byte 4 */
   unsigned char MailboxAddress[3];			/* Bytes 5-7 */
-  BusLogic_SynchronousValues8_T SynchronousValuesID0to7; /* Bytes 8-15 */
+  struct BusLogic_SynchronousValue SynchronousValuesID0to7[8];/* Bytes 8-15 */
   unsigned char DisconnectPermittedID0to7;		/* Byte 16 */
   unsigned char Signature;				/* Byte 17 */
   unsigned char CharacterD;				/* Byte 18 */
   unsigned char HostBusType;				/* Byte 19 */
   unsigned char WideTransfersPermittedID0to7;		/* Byte 20 */
   unsigned char WideTransfersActiveID0to7;		/* Byte 21 */
-  BusLogic_SynchronousValues8_T SynchronousValuesID8to15; /* Bytes 22-29 */
+  struct BusLogic_SynchronousValue SynchronousValuesID8to15[8]; /* Bytes 22-29 */
   unsigned char DisconnectPermittedID8to15;		/* Byte 30 */
   unsigned char :8;					/* Byte 31 */
   unsigned char WideTransfersPermittedID8to15;		/* Byte 32 */
   unsigned char WideTransfersActiveID8to15;		/* Byte 33 */
-}
-BusLogic_SetupInformation_T;
-
+};
 
 /*
   Define the Initialize Extended Mailbox request structure.
 */
 
-typedef struct BusLogic_ExtendedMailboxRequest
+struct BusLogic_ExtendedMailboxRequest
 {
   unsigned char MailboxCount;				/* Byte 0 */
-  BusLogic_BusAddress_T BaseMailboxAddress;		/* Bytes 1-4 */
-}
-__attribute__ ((packed))
-BusLogic_ExtendedMailboxRequest_T;
-
-
-/*
-  Define the Inquire Firmware Version 3rd Digit reply type.
-*/
-
-typedef unsigned char BusLogic_FirmwareVersion3rdDigit_T;
-
-
-/*
-  Define the Inquire Firmware Version Letter reply type.
-*/
-
-typedef unsigned char BusLogic_FirmwareVersionLetter_T;
+  u32 BaseMailboxAddress;				/* Bytes 1-4 */
+} PACKED;
 
 
 /*
@@ -698,7 +536,7 @@
   the Modify I/O Address command.
 */
 
-typedef enum BusLogic_ISACompatibleIOPort
+enum BusLogic_ISACompatibleIOPort
 {
   BusLogic_IO_330 =				0,
   BusLogic_IO_334 =				1,
@@ -708,13 +546,11 @@
   BusLogic_IO_134 =				5,
   BusLogic_IO_Disable =				6,
   BusLogic_IO_Disable2 =			7
-}
-__attribute__ ((packed))
-BusLogic_ISACompatibleIOPort_T;
+} PACKED;
 
-typedef struct BusLogic_PCIHostAdapterInformation
+struct BusLogic_PCIHostAdapterInformation
 {
-  BusLogic_ISACompatibleIOPort_T ISACompatibleIOPort;	/* Byte 0 */
+  enum BusLogic_ISACompatibleIOPort ISACompatibleIOPort;/* Byte 0 */
   unsigned char PCIAssignedIRQChannel;			/* Byte 1 */
   boolean LowByteTerminated:1;				/* Byte 2 Bit 0 */
   boolean HighByteTerminated:1;				/* Byte 2 Bit 1 */
@@ -724,42 +560,26 @@
   boolean JP3:1;					/* Byte 2 Bit 6 */
   boolean GenericInfoValid:1;				/* Byte 2 Bit 7 */
   unsigned char :8;					/* Byte 3 */
-}
-BusLogic_PCIHostAdapterInformation_T;
-
-
-/*
-  Define the Inquire Host Adapter Model Number reply type.
-*/
-
-typedef unsigned char BusLogic_HostAdapterModelNumber_T[5];
-
-
-/*
-  Define the Inquire Synchronous Period reply type.  For each Target Device,
-  a byte is returned which represents the Synchronous Transfer Period in units
-  of 10 nanoseconds.
-*/
-
-typedef unsigned char BusLogic_SynchronousPeriod_T[BusLogic_MaxTargetDevices];
-
+};
 
 /*
   Define the Inquire Extended Setup Information reply structure.
 */
 
-typedef struct BusLogic_ExtendedSetupInformation
+struct BusLogic_ExtendedSetupInformation
 {
   unsigned char BusType;				/* Byte 0 */
   unsigned char BIOS_Address;				/* Byte 1 */
   unsigned short ScatterGatherLimit;			/* Bytes 2-3 */
   unsigned char MailboxCount;				/* Byte 4 */
-  BusLogic_BusAddress_T BaseMailboxAddress;		/* Bytes 5-8 */
-  struct { unsigned char :2;				/* Byte 9 Bits 0-1 */
+  u32 BaseMailboxAddress;				/* Bytes 5-8 */
+  struct {
+           unsigned char :2;				/* Byte 9 Bits 0-1 */
 	   boolean FastOnEISA:1;			/* Byte 9 Bit 2 */
 	   unsigned char :3;				/* Byte 9 Bits 3-5 */
 	   boolean LevelSensitiveInterrupt:1;		/* Byte 9 Bit 6 */
-	   unsigned char :1; } Misc;			/* Byte 9 Bit 7 */
+	   unsigned char :1;				/* Byte 9 Bit 7 */
+  } Misc;
   unsigned char FirmwareRevision[3];			/* Bytes 10-12 */
   boolean HostWideSCSI:1;				/* Byte 13 Bit 0 */
   boolean HostDifferentialSCSI:1;			/* Byte 13 Bit 1 */
@@ -767,22 +587,17 @@
   boolean HostUltraSCSI:1;				/* Byte 13 Bit 3 */
   boolean HostSmartTermination:1;			/* Byte 13 Bit 4 */
   unsigned char :3;					/* Byte 13 Bits 5-7 */
-}
-__attribute__ ((packed))
-BusLogic_ExtendedSetupInformation_T;
-
+} PACKED;
 
 /*
   Define the Enable Strict Round Robin Mode request type.
 */
 
-typedef enum BusLogic_RoundRobinModeRequest
+enum BusLogic_RoundRobinModeRequest
 {
   BusLogic_AggressiveRoundRobinMode =		0,
   BusLogic_StrictRoundRobinMode =		1
-}
-__attribute__ ((packed))
-BusLogic_RoundRobinModeRequest_T;
+} PACKED;
 
 
 /*
@@ -792,19 +607,17 @@
 #define BusLogic_BIOS_BaseOffset		0
 #define BusLogic_AutoSCSI_BaseOffset		64
 
-typedef struct BusLogic_FetchHostAdapterLocalRAMRequest
+struct BusLogic_FetchHostAdapterLocalRAMRequest
 {
   unsigned char ByteOffset;				/* Byte 0 */
   unsigned char ByteCount;				/* Byte 1 */
-}
-BusLogic_FetchHostAdapterLocalRAMRequest_T;
-
+};
 
 /*
   Define the Host Adapter Local RAM AutoSCSI structure.
 */
 
-typedef struct BusLogic_AutoSCSIData
+struct BusLogic_AutoSCSIData
 {
   unsigned char InternalFactorySignature[2];		/* Bytes 0-1 */
   unsigned char InformationByteCount;			/* Byte 2 */
@@ -874,22 +687,17 @@
   unsigned char Reserved[10];				/* Bytes 50-59 */
   unsigned char ManufacturingDiagnostic[2];		/* Bytes 60-61 */
   unsigned short Checksum;				/* Bytes 62-63 */
-}
-__attribute__ ((packed))
-BusLogic_AutoSCSIData_T;
-
+} PACKED;
 
 /*
   Define the Host Adapter Local RAM Auto SCSI Byte 45 structure.
 */
 
-typedef struct BusLogic_AutoSCSIByte45
+struct BusLogic_AutoSCSIByte45
 {
   unsigned char ForceBusDeviceScanningOrder:1;		/* Bit 0 */
   unsigned char :7;					/* Bits 1-7 */
-}
-BusLogic_AutoSCSIByte45_T;
-
+};
 
 /*
   Define the Host Adapter Local RAM BIOS Drive Map Byte structure.
@@ -897,61 +705,35 @@
 
 #define BusLogic_BIOS_DriveMapOffset		17
 
-typedef struct BusLogic_BIOSDriveMapByte
+struct BusLogic_BIOSDriveMapByte
 {
   unsigned char TargetIDBit3:1;				/* Bit 0 */
   unsigned char :2;					/* Bits 1-2 */
-  BusLogic_BIOS_DiskGeometryTranslation_T DiskGeometry:2; /* Bits 3-4 */
+  enum BusLogic_BIOS_DiskGeometryTranslation DiskGeometry:2; /* Bits 3-4 */
   unsigned char TargetID:3;				/* Bits 5-7 */
-}
-BusLogic_BIOSDriveMapByte_T;
-
-
-/*
-  Define the Modify I/O Address request type.  On PCI Host Adapters, the
-  Modify I/O Address command allows modification of the ISA compatible I/O
-  Address that the Host Adapter responds to; it does not affect the PCI
-  compliant I/O Address assigned at system initialization.
-*/
-
-typedef BusLogic_ISACompatibleIOPort_T BusLogic_ModifyIOAddressRequest_T;
-
+};
 
 /*
   Define the Set CCB Format request type.  Extended LUN Format CCBs are
   necessary to support more than 8 Logical Units per Target Device.
 */
 
-typedef enum BusLogic_SetCCBFormatRequest
+enum BusLogic_SetCCBFormatRequest
 {
   BusLogic_LegacyLUNFormatCCB =			0,
   BusLogic_ExtendedLUNFormatCCB =		1
-}
-__attribute__ ((packed))
-BusLogic_SetCCBFormatRequest_T;
-
-
-/*
-  Define the Requested Reply Length type used by the Inquire Setup Information,
-  Inquire Host Adapter Model Number, Inquire Synchronous Period, and Inquire
-  Extended Setup Information commands.
-*/
-
-typedef unsigned char BusLogic_RequestedReplyLength_T;
-
+} PACKED;
 
 /*
   Define the Outgoing Mailbox Action Codes.
 */
 
-typedef enum
+enum BusLogic_ActionCode
 {
   BusLogic_OutgoingMailboxFree =		0x00,
   BusLogic_MailboxStartCommand =		0x01,
   BusLogic_MailboxAbortCommand =		0x02
-}
-__attribute__ ((packed))
-BusLogic_ActionCode_T;
+} PACKED;
 
 
 /*
@@ -960,7 +742,7 @@
   completion codes are stored in the CCB; it only uses codes 1, 2, 4, and 5.
 */
 
-typedef enum
+enum BusLogic_CompletionCode
 {
   BusLogic_IncomingMailboxFree =		0x00,
   BusLogic_CommandCompletedWithoutError =	0x01,
@@ -968,16 +750,13 @@
   BusLogic_AbortedCommandNotFound =		0x03,
   BusLogic_CommandCompletedWithError =		0x04,
   BusLogic_InvalidCCB =				0x05
-}
-__attribute__ ((packed))
-BusLogic_CompletionCode_T;
-
+} PACKED;
 
 /*
   Define the Command Control Block (CCB) Opcodes.
 */
 
-typedef enum
+enum BusLogic_CCB_Opcode
 {
   BusLogic_InitiatorCCB =			0x00,
   BusLogic_TargetCCB =				0x01,
@@ -985,23 +764,20 @@
   BusLogic_InitiatorCCB_ResidualDataLength =	0x03,
   BusLogic_InitiatorCCB_ScatterGatherResidual =	0x04,
   BusLogic_BusDeviceReset =			0x81
-}
-__attribute__ ((packed))
-BusLogic_CCB_Opcode_T;
+} PACKED;
 
 
 /*
   Define the CCB Data Direction Codes.
 */
 
-typedef enum
+enum BusLogic_DataDirection
 {
   BusLogic_UncheckedDataTransfer =		0,
   BusLogic_DataInLengthChecked =		1,
   BusLogic_DataOutLengthChecked =		2,
   BusLogic_NoDataTransfer =			3
-}
-BusLogic_DataDirection_T;
+};
 
 
 /*
@@ -1009,7 +785,7 @@
   return status code 0x0C; it uses 0x12 for both overruns and underruns.
 */
 
-typedef enum
+enum BusLogic_HostAdapterStatus
 {
   BusLogic_CommandCompletedNormally =		0x00,
   BusLogic_LinkedCommandCompleted =		0x0A,
@@ -1036,38 +812,31 @@
   BusLogic_HostAdapterSoftwareError =		0x27,
   BusLogic_HostAdapterHardwareTimeoutError =	0x30,
   BusLogic_SCSIParityErrorDetected =		0x34
-}
-__attribute__ ((packed))
-BusLogic_HostAdapterStatus_T;
+} PACKED;
 
 
 /*
   Define the SCSI Target Device Status Codes.
 */
 
-typedef enum
+enum BusLogic_TargetDeviceStatus
 {
   BusLogic_OperationGood =			0x00,
   BusLogic_CheckCondition =			0x02,
   BusLogic_DeviceBusy =				0x08
-}
-__attribute__ ((packed))
-BusLogic_TargetDeviceStatus_T;
-
+} PACKED;
 
 /*
   Define the Queue Tag Codes.
 */
 
-typedef enum
+enum BusLogic_QueueTag
 {
   BusLogic_SimpleQueueTag =			0,
   BusLogic_HeadOfQueueTag =			1,
   BusLogic_OrderedQueueTag =			2,
   BusLogic_ReservedQT =				3
-}
-BusLogic_QueueTag_T;
-
+};
 
 /*
   Define the SCSI Command Descriptor Block (CDB).
@@ -1083,27 +852,23 @@
   Firmware Interface and the FlashPoint SCCB Manager.
 */
 
-typedef struct BusLogic_ScatterGatherSegment
+struct BusLogic_ScatterGatherSegment
 {
-  BusLogic_ByteCount_T SegmentByteCount;		/* Bytes 0-3 */
-  BusLogic_BusAddress_T SegmentDataPointer;		/* Bytes 4-7 */
-}
-BusLogic_ScatterGatherSegment_T;
-
+  u32 SegmentByteCount;					/* Bytes 0-3 */
+  u32 SegmentDataPointer;				/* Bytes 4-7 */
+};
 
 /*
   Define the Driver CCB Status Codes.
 */
 
-typedef enum
+enum BusLogic_CCB_Status
 {
   BusLogic_CCB_Free =				0,
   BusLogic_CCB_Active =				1,
   BusLogic_CCB_Completed =			2,
   BusLogic_CCB_Reset =				3
-}
-__attribute__ ((packed))
-BusLogic_CCB_Status_T;
+} PACKED;
 
 
 /*
@@ -1125,39 +890,39 @@
   32 Logical Units per Target Device.
 */
 
-typedef struct BusLogic_CCB
+struct BusLogic_CCB
 {
   /*
     MultiMaster Firmware and FlashPoint SCCB Manager Common Portion.
   */
-  BusLogic_CCB_Opcode_T Opcode;				/* Byte 0 */
+  enum BusLogic_CCB_Opcode Opcode;			/* Byte 0 */
   unsigned char :3;					/* Byte 1 Bits 0-2 */
-  BusLogic_DataDirection_T DataDirection:2;		/* Byte 1 Bits 3-4 */
+  enum BusLogic_DataDirection DataDirection:2;		/* Byte 1 Bits 3-4 */
   boolean TagEnable:1;					/* Byte 1 Bit 5 */
-  BusLogic_QueueTag_T QueueTag:2;			/* Byte 1 Bits 6-7 */
+  enum BusLogic_QueueTag QueueTag:2;			/* Byte 1 Bits 6-7 */
   unsigned char CDB_Length;				/* Byte 2 */
   unsigned char SenseDataLength;			/* Byte 3 */
-  BusLogic_ByteCount_T DataLength;			/* Bytes 4-7 */
-  BusLogic_BusAddress_T DataPointer;			/* Bytes 8-11 */
+  u32 DataLength;					/* Bytes 4-7 */
+  u32 DataPointer;					/* Bytes 8-11 */
   unsigned char :8;					/* Byte 12 */
   unsigned char :8;					/* Byte 13 */
-  BusLogic_HostAdapterStatus_T HostAdapterStatus;	/* Byte 14 */
-  BusLogic_TargetDeviceStatus_T TargetDeviceStatus;	/* Byte 15 */
+  enum BusLogic_HostAdapterStatus HostAdapterStatus;	/* Byte 14 */
+  enum BusLogic_TargetDeviceStatus TargetDeviceStatus;	/* Byte 15 */
   unsigned char TargetID;				/* Byte 16 */
   unsigned char LogicalUnit:5;				/* Byte 17 Bits 0-4 */
   boolean LegacyTagEnable:1;				/* Byte 17 Bit 5 */
-  BusLogic_QueueTag_T LegacyQueueTag:2;			/* Byte 17 Bits 6-7 */
+  enum BusLogic_QueueTag LegacyQueueTag:2;		/* Byte 17 Bits 6-7 */
   SCSI_CDB_T CDB;					/* Bytes 18-29 */
   unsigned char :8;					/* Byte 30 */
   unsigned char :8;					/* Byte 31 */
   unsigned int :32;					/* Bytes 32-35 */
-  BusLogic_BusAddress_T SenseDataPointer;		/* Bytes 36-39 */
+  u32 SenseDataPointer;					/* Bytes 36-39 */
   /*
     FlashPoint SCCB Manager Defined Portion.
   */
   void (*CallbackFunction)(struct BusLogic_CCB *);	/* Bytes 40-43 */
-  BusLogic_Base_Address_T BaseAddress;			/* Bytes 44-47 */
-  BusLogic_CompletionCode_T CompletionCode;		/* Byte 48 */
+  u32 BaseAddress;					/* Bytes 44-47 */
+  enum BusLogic_CompletionCode CompletionCode;		/* Byte 48 */
 #ifndef CONFIG_SCSI_OMIT_FLASHPOINT
   unsigned char :8;					/* Byte 49 */
   unsigned short OS_Flags;				/* Bytes 50-51 */
@@ -1168,70 +933,61 @@
   */
   dma_addr_t AllocationGroupHead;
   unsigned int AllocationGroupSize;
-  BusLogic_BusAddress_T DMA_Handle;
-  BusLogic_CCB_Status_T Status;
+  u32 DMA_Handle;
+  enum BusLogic_CCB_Status Status;
   unsigned long SerialNumber;
-  SCSI_Command_T *Command;
+  struct scsi_cmnd *Command;
   struct BusLogic_HostAdapter *HostAdapter;
   struct BusLogic_CCB *Next;
   struct BusLogic_CCB *NextAll;
-  BusLogic_ScatterGatherSegment_T
+  struct BusLogic_ScatterGatherSegment
     ScatterGatherList[BusLogic_ScatterGatherLimit];
-}
-BusLogic_CCB_T;
-
+};
 
 /*
   Define the 32 Bit Mode Outgoing Mailbox structure.
 */
 
-typedef struct BusLogic_OutgoingMailbox
+struct BusLogic_OutgoingMailbox
 {
-  BusLogic_BusAddress_T CCB;				/* Bytes 0-3 */
+  u32 CCB;						/* Bytes 0-3 */
   unsigned int :24;					/* Bytes 4-6 */
-  BusLogic_ActionCode_T ActionCode;			/* Byte 7 */
-}
-BusLogic_OutgoingMailbox_T;
-
+  enum BusLogic_ActionCode ActionCode;			/* Byte 7 */
+};
 
 /*
   Define the 32 Bit Mode Incoming Mailbox structure.
 */
 
-typedef struct BusLogic_IncomingMailbox
+struct BusLogic_IncomingMailbox
 {
-  BusLogic_BusAddress_T CCB;				/* Bytes 0-3 */
-  BusLogic_HostAdapterStatus_T HostAdapterStatus;	/* Byte 4 */
-  BusLogic_TargetDeviceStatus_T TargetDeviceStatus;	/* Byte 5 */
+  u32 CCB;						/* Bytes 0-3 */
+  enum BusLogic_HostAdapterStatus HostAdapterStatus;	/* Byte 4 */
+  enum BusLogic_TargetDeviceStatus TargetDeviceStatus;	/* Byte 5 */
   unsigned char :8;					/* Byte 6 */
-  BusLogic_CompletionCode_T CompletionCode;		/* Byte 7 */
-}
-BusLogic_IncomingMailbox_T;
+  enum BusLogic_CompletionCode CompletionCode;		/* Byte 7 */
+};
 
 
 /*
   Define the BusLogic Driver Options structure.
 */
 
-typedef struct BusLogic_DriverOptions
+struct BusLogic_DriverOptions
 {
   unsigned short TaggedQueuingPermitted;
   unsigned short TaggedQueuingPermittedMask;
   unsigned short BusSettleTime;
-  BusLogic_LocalOptions_T LocalOptions;
+  struct BusLogic_LocalOptions LocalOptions;
   unsigned char CommonQueueDepth;
   unsigned char QueueDepth[BusLogic_MaxTargetDevices];
-  BusLogic_ErrorRecoveryStrategy_T
-    ErrorRecoveryStrategy[BusLogic_MaxTargetDevices];
-}
-BusLogic_DriverOptions_T;
-
+};
 
 /*
   Define the Host Adapter Target Flags structure.
 */
 
-typedef struct BusLogic_TargetFlags
+struct BusLogic_TargetFlags
 {
   boolean TargetExists:1;
   boolean TaggedQueuingSupported:1;
@@ -1240,9 +996,7 @@
   boolean WideTransfersActive:1;
   boolean CommandSuccessfulFlag:1;
   boolean TargetInfoReported:1;
-}
-BusLogic_TargetFlags_T;
-
+};
 
 /*
   Define the Host Adapter Target Statistics structure.
@@ -1252,14 +1006,14 @@
 
 typedef unsigned int BusLogic_CommandSizeBuckets_T[BusLogic_SizeBuckets];
 
-typedef struct BusLogic_TargetStatistics
+struct BusLogic_TargetStatistics
 {
   unsigned int CommandsAttempted;
   unsigned int CommandsCompleted;
   unsigned int ReadCommands;
   unsigned int WriteCommands;
-  BusLogic_ByteCounter_T TotalBytesRead;
-  BusLogic_ByteCounter_T TotalBytesWritten;
+  struct BusLogic_ByteCounter TotalBytesRead;
+  struct BusLogic_ByteCounter TotalBytesWritten;
   BusLogic_CommandSizeBuckets_T ReadCommandSizeBuckets;
   BusLogic_CommandSizeBuckets_T WriteCommandSizeBuckets;
   unsigned short CommandAbortsRequested;
@@ -1271,9 +1025,7 @@
   unsigned short HostAdapterResetsRequested;
   unsigned short HostAdapterResetsAttempted;
   unsigned short HostAdapterResetsCompleted;
-}
-BusLogic_TargetStatistics_T;
-
+};
 
 /*
   Define the FlashPoint Card Handle data type.
@@ -1289,9 +1041,9 @@
   by the FlashPoint SCCB Manager.
 */
 
-typedef struct FlashPoint_Info
+struct FlashPoint_Info
 {
-  BusLogic_Base_Address_T BaseAddress;			/* Bytes 0-3 */
+  u32 BaseAddress;					/* Bytes 0-3 */
   boolean Present;					/* Byte 4 */
   unsigned char IRQ_Channel;				/* Byte 5 */
   unsigned char SCSI_ID;				/* Byte 6 */
@@ -1321,22 +1073,20 @@
   unsigned char TranslationInfo[4];			/* Bytes 36-39 */
   unsigned int Reserved2[5];				/* Bytes 40-59 */
   unsigned int SecondaryRange;				/* Bytes 60-63 */
-}
-FlashPoint_Info_T;
-
+};
 
 /*
   Define the BusLogic Driver Host Adapter structure.
 */
 
-typedef struct BusLogic_HostAdapter
+struct BusLogic_HostAdapter
 {
-  SCSI_Host_T *SCSI_Host;
-  PCI_Device_T *PCI_Device;
-  BusLogic_HostAdapterType_T HostAdapterType;
-  BusLogic_HostAdapterBusType_T HostAdapterBusType;
-  BusLogic_IO_Address_T IO_Address;
-  BusLogic_PCI_Address_T PCI_Address;
+  struct Scsi_Host *SCSI_Host;
+  struct pci_dev *PCI_Device;
+  enum BusLogic_HostAdapterType HostAdapterType;
+  enum BusLogic_HostAdapterBusType HostAdapterBusType;
+  unsigned long IO_Address;
+  unsigned long PCI_Address;
   unsigned short AddressCount;
   unsigned char HostNumber;
   unsigned char ModelName[9];
@@ -1393,19 +1143,17 @@
   unsigned short HostAdapterInternalErrors;
   unsigned short TargetDeviceCount;
   unsigned short MessageBufferLength;
-  BusLogic_BusAddress_T BIOS_Address;
-  BusLogic_DriverOptions_T *DriverOptions;
-  FlashPoint_Info_T FlashPointInfo;
+  u32 BIOS_Address;
+  struct BusLogic_DriverOptions *DriverOptions;
+  struct FlashPoint_Info FlashPointInfo;
   FlashPoint_CardHandle_T CardHandle;
   struct BusLogic_HostAdapter *Next;
-  BusLogic_CCB_T *All_CCBs;
-  BusLogic_CCB_T *Free_CCBs;
-  BusLogic_CCB_T *FirstCompletedCCB;
-  BusLogic_CCB_T *LastCompletedCCB;
-  BusLogic_CCB_T *BusDeviceResetPendingCCB[BusLogic_MaxTargetDevices];
-  BusLogic_ErrorRecoveryStrategy_T
-    ErrorRecoveryStrategy[BusLogic_MaxTargetDevices];
-  BusLogic_TargetFlags_T TargetFlags[BusLogic_MaxTargetDevices];
+  struct BusLogic_CCB *All_CCBs;
+  struct BusLogic_CCB *Free_CCBs;
+  struct BusLogic_CCB *FirstCompletedCCB;
+  struct BusLogic_CCB *LastCompletedCCB;
+  struct BusLogic_CCB *BusDeviceResetPendingCCB[BusLogic_MaxTargetDevices];
+  struct BusLogic_TargetFlags TargetFlags[BusLogic_MaxTargetDevices];
   unsigned char QueueDepth[BusLogic_MaxTargetDevices];
   unsigned char SynchronousPeriod[BusLogic_MaxTargetDevices];
   unsigned char SynchronousOffset[BusLogic_MaxTargetDevices];
@@ -1414,43 +1162,36 @@
   unsigned long LastSequencePoint[BusLogic_MaxTargetDevices];
   unsigned long LastResetAttempted[BusLogic_MaxTargetDevices];
   unsigned long LastResetCompleted[BusLogic_MaxTargetDevices];
-  BusLogic_OutgoingMailbox_T *FirstOutgoingMailbox;
-  BusLogic_OutgoingMailbox_T *LastOutgoingMailbox;
-  BusLogic_OutgoingMailbox_T *NextOutgoingMailbox;
-  BusLogic_IncomingMailbox_T *FirstIncomingMailbox;
-  BusLogic_IncomingMailbox_T *LastIncomingMailbox;
-  BusLogic_IncomingMailbox_T *NextIncomingMailbox;
-  BusLogic_TargetStatistics_T TargetStatistics[BusLogic_MaxTargetDevices];
+  struct BusLogic_OutgoingMailbox *FirstOutgoingMailbox;
+  struct BusLogic_OutgoingMailbox *LastOutgoingMailbox;
+  struct BusLogic_OutgoingMailbox *NextOutgoingMailbox;
+  struct BusLogic_IncomingMailbox *FirstIncomingMailbox;
+  struct BusLogic_IncomingMailbox *LastIncomingMailbox;
+  struct BusLogic_IncomingMailbox *NextIncomingMailbox;
+  struct BusLogic_TargetStatistics TargetStatistics[BusLogic_MaxTargetDevices];
   unsigned char *MailboxSpace;
-  dma_addr_t	MailboxSpaceHandle;
+  dma_addr_t MailboxSpaceHandle;
   unsigned int MailboxSize;
   unsigned long CCB_Offset;
-/* [BusLogic_MaxMailboxes
-			     * (sizeof(BusLogic_OutgoingMailbox_T)
-				+ sizeof(BusLogic_IncomingMailbox_T))]; */
   char MessageBuffer[BusLogic_MessageBufferSize];
-}
-BusLogic_HostAdapter_T;
-
+};
 
 /*
   Define a structure for the BIOS Disk Parameters.
 */
 
-typedef struct BIOS_DiskParameters
+struct BIOS_DiskParameters
 {
   int Heads;
   int Sectors;
   int Cylinders;
-}
-BIOS_DiskParameters_T;
-
+};
 
 /*
   Define a structure for the SCSI Inquiry command results.
 */
 
-typedef struct SCSI_Inquiry
+struct SCSI_Inquiry
 {
   unsigned char PeripheralDeviceType:5;			/* Byte 0 Bits 0-4 */
   unsigned char PeripheralQualifier:3;			/* Byte 0 Bits 5-7 */
@@ -1477,27 +1218,22 @@
   unsigned char VendorIdentification[8];		/* Bytes 8-15 */
   unsigned char ProductIdentification[16];		/* Bytes 16-31 */
   unsigned char ProductRevisionLevel[4];		/* Bytes 32-35 */
-}
-SCSI_Inquiry_T;
-
+};
 
 /*
   BusLogic_AcquireHostAdapterLock acquires exclusive access to Host Adapter.
 */
 
-static inline
-void BusLogic_AcquireHostAdapterLock(BusLogic_HostAdapter_T *HostAdapter)
+static inline void BusLogic_AcquireHostAdapterLock(struct BusLogic_HostAdapter *HostAdapter)
 {
   spin_lock_irq(HostAdapter->SCSI_Host->host_lock);
 }
 
-
 /*
   BusLogic_ReleaseHostAdapterLock releases exclusive access to Host Adapter.
 */
 
-static inline
-void BusLogic_ReleaseHostAdapterLock(BusLogic_HostAdapter_T *HostAdapter)
+static inline void BusLogic_ReleaseHostAdapterLock(struct BusLogic_HostAdapter *HostAdapter)
 {
   spin_unlock_irq(HostAdapter->SCSI_Host->host_lock);
 }
@@ -1508,9 +1244,8 @@
   but is only called from the interrupt handler.
 */
 
-static inline
-void BusLogic_AcquireHostAdapterLockIH(BusLogic_HostAdapter_T *HostAdapter,
-				       ProcessorFlags_T *ProcessorFlags)
+static inline void BusLogic_AcquireHostAdapterLockIH(struct BusLogic_HostAdapter *HostAdapter,
+						     unsigned long *ProcessorFlags)
 {
   spin_lock_irqsave(HostAdapter->SCSI_Host->host_lock, *ProcessorFlags);
 }
@@ -1521,9 +1256,8 @@
   but is only called from the interrupt handler.
 */
 
-static inline
-void BusLogic_ReleaseHostAdapterLockIH(BusLogic_HostAdapter_T *HostAdapter,
-				       ProcessorFlags_T *ProcessorFlags)
+static inline void BusLogic_ReleaseHostAdapterLockIH(struct BusLogic_HostAdapter *HostAdapter,
+						     unsigned long *ProcessorFlags)
 {
   spin_unlock_irqrestore(HostAdapter->SCSI_Host->host_lock, *ProcessorFlags);
 }
@@ -1534,96 +1268,80 @@
   Host Adapter I/O Registers.
 */
 
-static inline
-void BusLogic_SCSIBusReset(BusLogic_HostAdapter_T *HostAdapter)
+static inline void BusLogic_SCSIBusReset(struct BusLogic_HostAdapter *HostAdapter)
 {
-  BusLogic_ControlRegister_T ControlRegister;
+  union BusLogic_ControlRegister ControlRegister;
   ControlRegister.All = 0;
-  ControlRegister.Bits.SCSIBusReset = true;
+  ControlRegister.SCSIBusReset = true;
   outb(ControlRegister.All,
        HostAdapter->IO_Address + BusLogic_ControlRegisterOffset);
 }
 
-static inline
-void BusLogic_InterruptReset(BusLogic_HostAdapter_T *HostAdapter)
+static inline void BusLogic_InterruptReset(struct BusLogic_HostAdapter *HostAdapter)
 {
-  BusLogic_ControlRegister_T ControlRegister;
+  union BusLogic_ControlRegister ControlRegister;
   ControlRegister.All = 0;
-  ControlRegister.Bits.InterruptReset = true;
+  ControlRegister.InterruptReset = true;
   outb(ControlRegister.All,
        HostAdapter->IO_Address + BusLogic_ControlRegisterOffset);
 }
 
-static inline
-void BusLogic_SoftReset(BusLogic_HostAdapter_T *HostAdapter)
+static inline void BusLogic_SoftReset(struct BusLogic_HostAdapter *HostAdapter)
 {
-  BusLogic_ControlRegister_T ControlRegister;
+  union BusLogic_ControlRegister ControlRegister;
   ControlRegister.All = 0;
-  ControlRegister.Bits.SoftReset = true;
+  ControlRegister.SoftReset = true;
   outb(ControlRegister.All,
        HostAdapter->IO_Address + BusLogic_ControlRegisterOffset);
 }
 
-static inline
-void BusLogic_HardReset(BusLogic_HostAdapter_T *HostAdapter)
+static inline void BusLogic_HardReset(struct BusLogic_HostAdapter *HostAdapter)
 {
-  BusLogic_ControlRegister_T ControlRegister;
+  union BusLogic_ControlRegister ControlRegister;
   ControlRegister.All = 0;
-  ControlRegister.Bits.HardReset = true;
+  ControlRegister.HardReset = true;
   outb(ControlRegister.All,
        HostAdapter->IO_Address + BusLogic_ControlRegisterOffset);
 }
 
-static inline
-unsigned char BusLogic_ReadStatusRegister(BusLogic_HostAdapter_T *HostAdapter)
+static inline unsigned char BusLogic_ReadStatusRegister(struct BusLogic_HostAdapter *HostAdapter)
 {
   return inb(HostAdapter->IO_Address + BusLogic_StatusRegisterOffset);
 }
 
-static inline
-void BusLogic_WriteCommandParameterRegister(BusLogic_HostAdapter_T
-					      *HostAdapter,
-					    unsigned char Value)
+static inline void BusLogic_WriteCommandParameterRegister(struct BusLogic_HostAdapter
+							  *HostAdapter,
+							  unsigned char Value)
 {
-  outb(Value,
-       HostAdapter->IO_Address + BusLogic_CommandParameterRegisterOffset);
+  outb(Value, HostAdapter->IO_Address + BusLogic_CommandParameterRegisterOffset);
 }
 
-static inline
-unsigned char BusLogic_ReadDataInRegister(BusLogic_HostAdapter_T *HostAdapter)
+static inline unsigned char BusLogic_ReadDataInRegister(struct BusLogic_HostAdapter *HostAdapter)
 {
   return inb(HostAdapter->IO_Address + BusLogic_DataInRegisterOffset);
 }
 
-static inline
-unsigned char BusLogic_ReadInterruptRegister(BusLogic_HostAdapter_T
-					     *HostAdapter)
+static inline unsigned char BusLogic_ReadInterruptRegister(struct BusLogic_HostAdapter *HostAdapter)
 {
   return inb(HostAdapter->IO_Address + BusLogic_InterruptRegisterOffset);
 }
 
-static inline
-unsigned char BusLogic_ReadGeometryRegister(BusLogic_HostAdapter_T
-					    *HostAdapter)
+static inline unsigned char BusLogic_ReadGeometryRegister(struct BusLogic_HostAdapter *HostAdapter)
 {
   return inb(HostAdapter->IO_Address + BusLogic_GeometryRegisterOffset);
 }
 
-
 /*
   BusLogic_StartMailboxCommand issues an Execute Mailbox Command, which
   notifies the Host Adapter that an entry has been made in an Outgoing
   Mailbox.
 */
 
-static inline
-void BusLogic_StartMailboxCommand(BusLogic_HostAdapter_T *HostAdapter)
+static inline void BusLogic_StartMailboxCommand(struct BusLogic_HostAdapter *HostAdapter)
 {
-  BusLogic_WriteCommandParameterRegister(HostAdapter,
-					 BusLogic_ExecuteMailboxCommand);
+  BusLogic_WriteCommandParameterRegister(HostAdapter, BusLogic_ExecuteMailboxCommand);
 }
 
-
 /*
   BusLogic_Delay waits for Seconds to elapse.
 */
@@ -1633,36 +1351,32 @@
   mdelay(1000 * Seconds);
 }
 
-
 /*
   Virtual_to_Bus and Bus_to_Virtual map between Kernel Virtual Addresses
   and PCI/VLB/EISA/ISA Bus Addresses.
 */
 
-static inline BusLogic_BusAddress_T Virtual_to_Bus(void *VirtualAddress)
+static inline u32 Virtual_to_Bus(void *VirtualAddress)
 {
-  return (BusLogic_BusAddress_T) virt_to_bus(VirtualAddress);
+  return (u32) virt_to_bus(VirtualAddress);
 }
 
-static inline void *Bus_to_Virtual(BusLogic_BusAddress_T BusAddress)
+static inline void *Bus_to_Virtual(u32 BusAddress)
 {
   return (void *) bus_to_virt(BusAddress);
 }
 
-
 /*
   Virtual_to_32Bit_Virtual maps between Kernel Virtual Addresses and
   32 bit Kernel Virtual Addresses.  This avoids compilation warnings
   on 64 bit architectures.
 */
 
-static inline
-BusLogic_BusAddress_T Virtual_to_32Bit_Virtual(void *VirtualAddress)
+static inline u32 Virtual_to_32Bit_Virtual(void *VirtualAddress)
 {
-  return (BusLogic_BusAddress_T) (unsigned long) VirtualAddress;
+  return (u32) (unsigned long) VirtualAddress;
 }
 
-
 /*
   BusLogic_IncrementErrorCounter increments Error Counter by 1, stopping at
   65535 rather than wrapping around to 0.
@@ -1673,13 +1387,12 @@
   if (*ErrorCounter < 65535) (*ErrorCounter)++;
 }
 
-
 /*
   BusLogic_IncrementByteCounter increments Byte Counter by Amount.
 */
 
-static inline void BusLogic_IncrementByteCounter(BusLogic_ByteCounter_T
-						   *ByteCounter,
+static inline void BusLogic_IncrementByteCounter(struct BusLogic_ByteCounter
+						 *ByteCounter,
 						 unsigned int Amount)
 {
   ByteCounter->Units += Amount;
@@ -1690,13 +1403,12 @@
     }
 }
 
-
 /*
   BusLogic_IncrementSizeBucket increments the Bucket for Amount.
 */
 
 static inline void BusLogic_IncrementSizeBucket(BusLogic_CommandSizeBuckets_T
-						  CommandSizeBuckets,
+						CommandSizeBuckets,
 						unsigned int Amount)
 {
   int Index = 0;
@@ -1716,14 +1428,12 @@
   CommandSizeBuckets[Index]++;
 }
 
-
 /*
   Define the version number of the FlashPoint Firmware (SCCB Manager).
 */
 
 #define FlashPoint_FirmwareVersion		"5.02"
 
-
 /*
   Define the possible return values from FlashPoint_HandleInterrupt.
 */
@@ -1732,54 +1442,28 @@
 #define FlashPoint_InternalError		0xFE
 #define FlashPoint_ExternalBusReset		0xFF
 
-
 /*
   Define prototypes for the forward referenced BusLogic Driver
   Internal Functions.
 */
 
-static void BusLogic_QueueCompletedCCB(BusLogic_CCB_T *);
-static irqreturn_t BusLogic_InterruptHandler(int, void *, Registers_T *);
-static int BusLogic_ResetHostAdapter(BusLogic_HostAdapter_T *,
-				     SCSI_Command_T *, unsigned int);
-static void BusLogic_Message(BusLogic_MessageLevel_T, char *,
-			     BusLogic_HostAdapter_T *, ...);
-
-/*
-  Declare the Initialization Functions.
-*/
-
-static void BusLogic_AnnounceDriver(BusLogic_HostAdapter_T *) __init;
-static void BusLogic_RegisterHostAdapter(BusLogic_HostAdapter_T *) __init;
-static void BusLogic_UnregisterHostAdapter(BusLogic_HostAdapter_T *) __init;
-static boolean BusLogic_CreateInitialCCBs(BusLogic_HostAdapter_T *) __init;
-static void BusLogic_DestroyCCBs(BusLogic_HostAdapter_T *) __init;
-static void BusLogic_AppendProbeAddressISA(BusLogic_IO_Address_T) __init;
-static void
-BusLogic_InitializeProbeInfoListISA(BusLogic_HostAdapter_T *) __init;
-static void BusLogic_SortProbeInfo(BusLogic_ProbeInfo_T *, int) __init;
-static int
-BusLogic_InitializeMultiMasterProbeInfo(BusLogic_HostAdapter_T *) __init;
-static int
-BusLogic_InitializeFlashPointProbeInfo(BusLogic_HostAdapter_T *) __init;
-static void BusLogic_InitializeProbeInfoList(BusLogic_HostAdapter_T *) __init;
-static boolean BusLogic_Failure(BusLogic_HostAdapter_T *, char *) __init;
-static boolean BusLogic_ProbeHostAdapter(BusLogic_HostAdapter_T *) __init;
-static boolean BusLogic_CheckHostAdapter(BusLogic_HostAdapter_T *) __init;
-static boolean
-BusLogic_ReadHostAdapterConfiguration(BusLogic_HostAdapter_T *) __init;
-static boolean
-BusLogic_ReportHostAdapterConfiguration(BusLogic_HostAdapter_T *) __init;
-static boolean BusLogic_AcquireResources(BusLogic_HostAdapter_T *) __init;
-static void BusLogic_ReleaseResources(BusLogic_HostAdapter_T *) __init;
-static boolean BusLogic_TargetDeviceInquiry(BusLogic_HostAdapter_T *) __init;
-static void BusLogic_InitializeHostStructure(BusLogic_HostAdapter_T *,
-					     SCSI_Host_T *) __init;
-int BusLogic_DetectHostAdapter(SCSI_Host_Template_T *) __init;
-int BusLogic_ReleaseHostAdapter(SCSI_Host_T *) __init;
-static boolean BusLogic_ParseKeyword(char **, char *) __init;
-static int BusLogic_ParseDriverOptions(char *) __init;
-static int BusLogic_Setup(char *) __init;
-
+static const char *BusLogic_DriverInfo(struct Scsi_Host *);
+static int BusLogic_DetectHostAdapter(struct scsi_host_template *);
+static int BusLogic_ReleaseHostAdapter(struct Scsi_Host *);
+static int BusLogic_QueueCommand(struct scsi_cmnd *,
+				 void (*CompletionRoutine)(struct scsi_cmnd *));
+static int BusLogic_BIOSDiskParameters(struct scsi_device *,
+				       struct block_device *,
+				       sector_t, int *);
+static int BusLogic_ProcDirectoryInfo(struct Scsi_Host *, char *,
+				      char **, off_t, int, int);
+static int BusLogic_SlaveConfigure(struct scsi_device *);
+static void BusLogic_QueueCompletedCCB(struct BusLogic_CCB *);
+static irqreturn_t BusLogic_InterruptHandler(int, void *, struct pt_regs *);
+static int BusLogic_ResetHostAdapter(struct BusLogic_HostAdapter *,
+				     boolean HardReset);
+static void BusLogic_Message(enum BusLogic_MessageLevel, char *,
+			     struct BusLogic_HostAdapter *, ...);
+static int __init BusLogic_Setup(char *);
 
-#endif /* BusLogic_DriverVersion */
+#endif /* _BUSLOGIC_H */
--- diff/drivers/scsi/FlashPoint.c	2003-05-21 11:49:46.000000000 +0100
+++ source/drivers/scsi/FlashPoint.c	2004-02-09 10:39:55.000000000 +0000
@@ -12053,14 +12053,14 @@
 */
 
 static inline unsigned char
-FlashPoint__ProbeHostAdapter(FlashPoint_Info_T *FlashPointInfo)
+FlashPoint__ProbeHostAdapter(struct FlashPoint_Info *FlashPointInfo)
 {
   return FlashPoint_ProbeHostAdapter((PSCCBMGR_INFO) FlashPointInfo);
 }
 
 
 static inline FlashPoint_CardHandle_T
-FlashPoint__HardwareResetHostAdapter(FlashPoint_Info_T *FlashPointInfo)
+FlashPoint__HardwareResetHostAdapter(struct FlashPoint_Info *FlashPointInfo)
 {
   return FlashPoint_HardwareResetHostAdapter((PSCCBMGR_INFO) FlashPointInfo);
 }
@@ -12073,14 +12073,14 @@
 
 
 static inline void
-FlashPoint__StartCCB(FlashPoint_CardHandle_T CardHandle, BusLogic_CCB_T *CCB)
+FlashPoint__StartCCB(FlashPoint_CardHandle_T CardHandle, struct BusLogic_CCB *CCB)
 {
   FlashPoint_StartCCB(CardHandle, (PSCCB) CCB);
 }
 
 
 static inline void
-FlashPoint__AbortCCB(FlashPoint_CardHandle_T CardHandle, BusLogic_CCB_T *CCB)
+FlashPoint__AbortCCB(FlashPoint_CardHandle_T CardHandle, struct BusLogic_CCB *CCB)
 {
   FlashPoint_AbortCCB(CardHandle, (PSCCB) CCB);
 }
@@ -12143,11 +12143,11 @@
   Define prototypes for the FlashPoint SCCB Manager Functions.
 */
 
-extern unsigned char FlashPoint_ProbeHostAdapter(FlashPoint_Info_T *);
+extern unsigned char FlashPoint_ProbeHostAdapter(struct FlashPoint_Info *);
 extern FlashPoint_CardHandle_T
-       FlashPoint_HardwareResetHostAdapter(FlashPoint_Info_T *);
-extern void FlashPoint_StartCCB(FlashPoint_CardHandle_T, BusLogic_CCB_T *);
-extern int FlashPoint_AbortCCB(FlashPoint_CardHandle_T, BusLogic_CCB_T *);
+       FlashPoint_HardwareResetHostAdapter(struct FlashPoint_Info *);
+extern void FlashPoint_StartCCB(FlashPoint_CardHandle_T, struct BusLogic_CCB *);
+extern int FlashPoint_AbortCCB(FlashPoint_CardHandle_T, struct BusLogic_CCB *);
 extern boolean FlashPoint_InterruptPending(FlashPoint_CardHandle_T);
 extern int FlashPoint_HandleInterrupt(FlashPoint_CardHandle_T);
 extern void FlashPoint_ReleaseHostAdapter(FlashPoint_CardHandle_T);
--- diff/drivers/scsi/Kconfig	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/scsi/Kconfig	2004-02-09 10:39:55.000000000 +0000
@@ -55,6 +55,14 @@
 	  In this case, do not compile the driver for your SCSI host adapter
 	  (below) as a module either.
 
+config MAX_SD_DISKS
+	int "Maximum number of SCSI disks to support (256-8192)"
+	depends on BLK_DEV_SD
+	default "256"
+	help
+	The maximum number SCSI disks to support. Default is 256.
+	Change this value if you want kernel to support lots of SCSI devices.
+
 config CHR_DEV_ST
 	tristate "SCSI tape support"
 	depends on SCSI
@@ -376,23 +384,6 @@
 	  To compile this driver as a module, choose M here: the
 	  module will be called in2000.
 
-# does not use pci dma and seems to be onboard only for old machines
-config SCSI_AM53C974
-	tristate "AM53/79C974 PCI SCSI support"
-	depends on X86 && PCI && SCSI && BROKEN
-	---help---
-	  This is support for the AM53/79C974 SCSI host adapters.  Please read
-	  <file:Documentation/scsi/AM53C974.txt> for details.  Also, the
-	  SCSI-HOWTO, available from
-	  <http://www.tldp.org/docs.html#howto>, is for you.
-
-	  Note that there is another driver for AM53C974 based adapters:
-	  "Tekram DC390(T) and Am53/79C974 (PCscsi) SCSI support", above.  You
-	  can pick either one.
-
-	  To compile this driver as a module, choose M here: the
-	  module will be called AM53C974.
-
 config SCSI_MEGARAID
 	tristate "AMI MegaRAID support"
 	depends on PCI && SCSI
@@ -903,7 +894,7 @@
 	  language.  It does not support LSI53C10XX Ultra-320 PCI-X SCSI
 	  controllers; you need to use the Fusion MPT driver for that.
 
-	  Please read <file:drivers/scsi/sym53c8xx_2/Documentation.txt> for more
+	  Please read <file:Documentation/scsi/sym53c8xx_2.txt> for more
 	  information.
 
 config SCSI_SYM53C8XX_DMA_ADDRESSING_MODE
@@ -1172,23 +1163,6 @@
 	  To compile this driver as a module, choose M here: the
 	  module will be called qlogicisp.
 
-config SCSI_QLOGIC_FC
-	tristate "Qlogic ISP FC SCSI support"
-	depends on PCI && SCSI
-	help
-	  This is a driver for the QLogic ISP2100 SCSI-FCP host adapter.
-
-	  To compile this driver as a module, choose M here: the
-	  module will be called qlogicfc.
-
-config SCSI_QLOGIC_FC_FIRMWARE
-	bool "Include loadable firmware in driver"
-	depends on SCSI_QLOGIC_FC
-  	help
-	  Say Y to include ISP2X00 Fabric Initiator/Target Firmware, with
-	  expanded LUN addressing and FcTape (FCP-2) support, in the
-	  qlogicfc driver. This is required on some platforms.
-
 config SCSI_QLOGIC_1280
 	tristate "Qlogic QLA 1280 SCSI support"
 	depends on PCI && SCSI
--- diff/drivers/scsi/Makefile	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/scsi/Makefile	2004-02-09 10:39:55.000000000 +0000
@@ -69,7 +69,6 @@
 obj-$(CONFIG_SCSI_SYM53C416)	+= sym53c416.o
 obj-$(CONFIG_SCSI_QLOGIC_FAS)	+= qlogicfas.o
 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
@@ -87,7 +86,6 @@
 obj-$(CONFIG_SCSI_EATA)		+= eata.o
 obj-$(CONFIG_SCSI_DC395x)	+= dc395x.o
 obj-$(CONFIG_SCSI_DC390T)	+= tmscsim.o
-obj-$(CONFIG_SCSI_AM53C974)	+= AM53C974.o
 obj-$(CONFIG_SCSI_MEGARAID)	+= megaraid.o
 obj-$(CONFIG_SCSI_ACARD)	+= atp870u.o
 obj-$(CONFIG_SCSI_SUNESP)	+= esp.o
--- diff/drivers/scsi/advansys.c	2003-09-17 12:28:09.000000000 +0100
+++ source/drivers/scsi/advansys.c	2004-02-09 10:39:54.000000000 +0000
@@ -6018,8 +6018,8 @@
     } else {
         /* Append to 'done_scp' at the end with 'last_scp'. */
         ASC_ASSERT(last_scp != NULL);
-        REQPNEXT(last_scp) = asc_dequeue_list(&boardp->active,
-            &new_last_scp, ASC_TID_ALL);
+        last_scp->host_scribble = (unsigned char *)asc_dequeue_list(
+			&boardp->active, &new_last_scp, ASC_TID_ALL);
         if (new_last_scp != NULL) {
             ASC_ASSERT(REQPNEXT(last_scp) != NULL);
             for (tscp = REQPNEXT(last_scp); tscp; tscp = REQPNEXT(tscp)) {
@@ -6041,8 +6041,8 @@
     } else {
         /* Append to 'done_scp' at the end with 'last_scp'. */
         ASC_ASSERT(last_scp != NULL);
-        REQPNEXT(last_scp) = asc_dequeue_list(&boardp->waiting,
-            &new_last_scp, ASC_TID_ALL);
+        last_scp->host_scribble = (unsigned char *)asc_dequeue_list(
+			&boardp->waiting, &new_last_scp, ASC_TID_ALL);
         if (new_last_scp != NULL) {
             ASC_ASSERT(REQPNEXT(last_scp) != NULL);
             for (tscp = REQPNEXT(last_scp); tscp; tscp = REQPNEXT(tscp)) {
@@ -6310,8 +6310,8 @@
                     ASC_TID_ALL);
             } else {
                 ASC_ASSERT(last_scp != NULL);
-                REQPNEXT(last_scp) = asc_dequeue_list(&boardp->done,
-                    &new_last_scp, ASC_TID_ALL);
+                last_scp->host_scribble = (unsigned char *)asc_dequeue_list(
+			&boardp->done, &new_last_scp, ASC_TID_ALL);
                 if (new_last_scp != NULL) {
                     ASC_ASSERT(REQPNEXT(last_scp) != NULL);
                     last_scp = new_last_scp;
@@ -6383,7 +6383,7 @@
     while (scp != NULL) {
         ASC_DBG1(3, "asc_scsi_done_list: scp 0x%lx\n", (ulong) scp);
         tscp = REQPNEXT(scp);
-        REQPNEXT(scp) = NULL;
+        scp->host_scribble = NULL;
         ASC_STATS(scp->device->host, done);
         ASC_ASSERT(scp->scsi_done != NULL);
 	if (from_isr)
@@ -7434,7 +7434,7 @@
     tid = REQPTID(reqp);
     ASC_ASSERT(tid >= 0 && tid <= ADV_MAX_TID);
     if (flag == ASC_FRONT) {
-        REQPNEXT(reqp) = ascq->q_first[tid];
+        reqp->host_scribble = (unsigned char *)ascq->q_first[tid];
         ascq->q_first[tid] = reqp;
         /* If the queue was empty, set the last pointer. */
         if (ascq->q_last[tid] == NULL) {
@@ -7442,10 +7442,10 @@
         }
     } else { /* ASC_BACK */
         if (ascq->q_last[tid] != NULL) {
-            REQPNEXT(ascq->q_last[tid]) = reqp;
+            ascq->q_last[tid]->host_scribble = (unsigned char *)reqp;
         }
         ascq->q_last[tid] = reqp;
-        REQPNEXT(reqp) = NULL;
+        reqp->host_scribble = NULL;
         /* If the queue was empty, set the first pointer. */
         if (ascq->q_first[tid] == NULL) {
             ascq->q_first[tid] = reqp;
@@ -7566,7 +7566,7 @@
                     lastp = ascq->q_last[i];
                 } else {
                     ASC_ASSERT(lastp != NULL);
-                    REQPNEXT(lastp) = ascq->q_first[i];
+                    lastp->host_scribble = (unsigned char *)ascq->q_first[i];
                     lastp = ascq->q_last[i];
                 }
                 ascq->q_first[i] = ascq->q_last[i] = NULL;
@@ -7644,8 +7644,8 @@
              currp; prevp = currp, currp = REQPNEXT(currp)) {
             if (currp == reqp) {
                 ret = ASC_TRUE;
-                REQPNEXT(prevp) = REQPNEXT(currp);
-                REQPNEXT(reqp) = NULL;
+                prevp->host_scribble = (unsigned char *)REQPNEXT(currp);
+                reqp->host_scribble = NULL;
                 if (ascq->q_last[tid] == reqp) {
                     ascq->q_last[tid] = prevp;
                 }
--- diff/drivers/scsi/aha152x.c	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/scsi/aha152x.c	2004-02-09 10:39:54.000000000 +0000
@@ -1,6 +1,6 @@
 /* aha152x.c -- Adaptec AHA-152x driver
  * Author: Jürgen E. Fischer, fischer@norbit.de
- * Copyright 1993-2000 Jürgen E. Fischer
+ * Copyright 1993-2004 Jürgen E. Fischer
  *
  * 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
@@ -13,9 +13,17 @@
  * General Public License for more details.
  *
  *
- * $Id: aha152x.c,v 2.6 2003/10/30 20:52:47 fischer Exp $
+ * $Id: aha152x.c,v 2.7 2004/01/24 11:42:59 fischer Exp $
  *
  * $Log: aha152x.c,v $
+ * Revision 2.7  2004/01/24 11:42:59  fischer
+ * - gather code that is not used by PCMCIA at the end
+ * - move request_region for !PCMCIA case to detection
+ * - migration to new scsi host api (remove legacy code)
+ * - free host scribble before scsi_done
+ * - fix error handling
+ * - one isapnp device added to id_table
+ *
  * Revision 2.6  2003/10/30 20:52:47  fischer
  * - interfaces changes for kernel 2.6
  * - aha152x_probe_one introduced for pcmcia stub
@@ -344,7 +352,8 @@
 MODULE_DESCRIPTION(AHA152X_REVID);
 MODULE_LICENSE("GPL");
 
-#if defined(MODULE) && !defined(PCMCIA)
+#if !defined(PCMCIA)
+#if defined(MODULE)
 MODULE_PARM(io, "1-2i");
 MODULE_PARM_DESC(io,"base io address of controller");
 static int io[] = {0, 0};
@@ -398,21 +407,23 @@
 MODULE_PARM_DESC(aha152x1, "parameters for second controller");
 static int aha152x1[]  = {0, 11, 7, 1, 1, 1, DELAY_DEFAULT, 0, DEBUG_DEFAULT};
 #endif /* !defined(AHA152X_DEBUG) */
-#endif /* MODULE && !PCMCIA */
+#endif /* MODULE */
 
 #ifdef __ISAPNP__
 static struct isapnp_device_id id_table[] __devinitdata = {
-	{ ISAPNP_DEVICE_SINGLE('A','D','P',0x1505, 'A','D','P',0x1505), },
+	{ ISAPNP_ANY_ID, ISAPNP_ANY_ID,
+		ISAPNP_VENDOR('A','D','P'), ISAPNP_FUNCTION(0x1505), 0 },
+	{ ISAPNP_ANY_ID, ISAPNP_ANY_ID,
+		ISAPNP_VENDOR('A','D','P'), ISAPNP_FUNCTION(0x1530), 0 },
 	{ ISAPNP_DEVICE_SINGLE_END, }
 };
 MODULE_DEVICE_TABLE(isapnp, id_table);
 #endif /* ISAPNP */
 
-/* set by aha152x_setup according to the command line */
-static int setup_count;
-static int registered_count;
-static struct aha152x_setup setup[2];
-static struct Scsi_Host *aha152x_host[2];
+#endif /* !PCMCIA */
+
+static int registered_count=0;
+static struct Scsi_Host *aha152x_host[2] = {0, 0};
 static Scsi_Host_Template aha152x_driver_template;
 
 /*
@@ -658,7 +669,6 @@
 static void reset_ports(struct Scsi_Host *shpnt);
 static void aha152x_error(struct Scsi_Host *shpnt, char *msg);
 static void done(struct Scsi_Host *shpnt, int error);
-static int checksetup(struct aha152x_setup *setup);
 
 /* diagnostics */
 static void disp_ports(struct Scsi_Host *shpnt);
@@ -666,66 +676,6 @@
 static void show_queues(struct Scsi_Host *shpnt);
 static void disp_enintr(struct Scsi_Host *shpnt);
 
-/* possible i/o addresses for the AIC-6260; default first */
-static unsigned short ports[] = { 0x340, 0x140 };
-
-#if !defined(SKIP_BIOSTEST)
-/* possible locations for the Adaptec BIOS; defaults first */
-static unsigned int addresses[] =
-{
-	0xdc000,		/* default first */
-	0xc8000,
-	0xcc000,
-	0xd0000,
-	0xd4000,
-	0xd8000,
-	0xe0000,
-	0xeb800,		/* VTech Platinum SMP */
-	0xf0000,
-};
-
-/* signatures for various AIC-6[23]60 based controllers.
-   The point in detecting signatures is to avoid useless and maybe
-   harmful probes on ports. I'm not sure that all listed boards pass
-   auto-configuration. For those which fail the BIOS signature is
-   obsolete, because user intervention to supply the configuration is
-   needed anyway.  May be an information whether or not the BIOS supports
-   extended translation could be also useful here. */
-static struct signature {
-	unsigned char *signature;
-	int sig_offset;
-	int sig_length;
-} signatures[] =
-{
-	{ "Adaptec AHA-1520 BIOS",	0x102e, 21 },
-		/* Adaptec 152x */
-	{ "Adaptec AHA-1520B",		0x000b, 17 },
-		/* Adaptec 152x rev B */
-	{ "Adaptec AHA-1520B",		0x0026, 17 },
-		/* Iomega Jaz Jet ISA (AIC6370Q) */
-	{ "Adaptec ASW-B626 BIOS",	0x1029, 21 },
-		/* on-board controller */
-	{ "Adaptec BIOS: ASW-B626",	0x000f, 22 },
-		/* on-board controller */
-	{ "Adaptec ASW-B626 S2",	0x2e6c, 19 },
-		/* on-board controller */
-	{ "Adaptec BIOS:AIC-6360",	0x000c, 21 },
-		/* on-board controller */
-	{ "ScsiPro SP-360 BIOS",	0x2873, 19 },
-		/* ScsiPro-Controller  */
-	{ "GA-400 LOCAL BUS SCSI BIOS", 0x102e, 26 },
-		/* Gigabyte Local-Bus-SCSI */
-	{ "Adaptec BIOS:AVA-282X",	0x000c, 21 },
-		/* Adaptec 282x */
-	{ "Adaptec IBM Dock II SCSI",	0x2edd, 24 },
-		/* IBM Thinkpad Dock II */
-	{ "Adaptec BIOS:AHA-1532P",	0x001c, 22 },
-		/* IBM Thinkpad Dock II SCSI */
-	{ "DTC3520A Host Adapter BIOS", 0x318a, 26 },
-		/* DTC 3520A ISA SCSI */
-};
-#endif
-
 
 /*
  *  queue services:
@@ -799,141 +749,6 @@
 	return ptr;
 }
 
-#if defined(PCMCIA) || !defined(MODULE)
-static void aha152x_setup(char *str, int *ints)
-{
-	if(setup_count>=ARRAY_SIZE(setup)) {
-		printk(KERN_ERR "aha152x: you can only configure up to two controllers\n");
-		return;
-	}
-
-	setup[setup_count].conf        = str;
-	setup[setup_count].io_port     = ints[0] >= 1 ? ints[1] : 0x340;
-	setup[setup_count].irq         = ints[0] >= 2 ? ints[2] : 11;
-	setup[setup_count].scsiid      = ints[0] >= 3 ? ints[3] : 7;
-	setup[setup_count].reconnect   = ints[0] >= 4 ? ints[4] : 1;
-	setup[setup_count].parity      = ints[0] >= 5 ? ints[5] : 1;
-	setup[setup_count].synchronous = ints[0] >= 6 ? ints[6] : 1;
-	setup[setup_count].delay       = ints[0] >= 7 ? ints[7] : DELAY_DEFAULT;
-	setup[setup_count].ext_trans   = ints[0] >= 8 ? ints[8] : 0;
-#if defined(AHA152X_DEBUG)
-	setup[setup_count].debug       = ints[0] >= 9 ? ints[9] : DEBUG_DEFAULT;
-	if (ints[0] > 9) {
-		printk(KERN_NOTICE "aha152x: usage: aha152x=<IOBASE>[,<IRQ>[,<SCSI ID>"
-		       "[,<RECONNECT>[,<PARITY>[,<SYNCHRONOUS>[,<DELAY>[,<EXT_TRANS>[,<DEBUG>]]]]]]]]\n");
-#else
-	if (ints[0] > 8) {                                                /*}*/
-		printk(KERN_NOTICE "aha152x: usage: aha152x=<IOBASE>[,<IRQ>[,<SCSI ID>"
-		       "[,<RECONNECT>[,<PARITY>[,<SYNCHRONOUS>[,<DELAY>[,<EXT_TRANS>]]]]]]]\n");
-#endif
-	} else {
-		setup_count++;
-	}
-}
-#endif
-
-#if !defined(MODULE)
-static int __init do_setup(char *str)
-{
-
-#if defined(AHA152X_DEBUG)
-	int ints[11];
-#else
-	int ints[10];
-#endif
-	int count=setup_count;
-
-	get_options(str, ARRAY_SIZE(ints), ints);
-	aha152x_setup(str,ints);
-
-	return count<setup_count;
-}
-
-__setup("aha152x=", do_setup);
-#endif
-
-/*
- * Test, if port_base is valid.
- *
- */
-static int aha152x_porttest(int io_port)
-{
-	int i;
-
-	SETPORT(io_port + O_DMACNTRL1, 0);	/* reset stack pointer */
-	for (i = 0; i < 16; i++)
-		SETPORT(io_port + O_STACK, i);
-
-	SETPORT(io_port + O_DMACNTRL1, 0);	/* reset stack pointer */
-	for (i = 0; i < 16 && GETPORT(io_port + O_STACK) == i; i++)
-		;
-
-	return (i == 16);
-}
-
-static int tc1550_porttest(int io_port)
-{
-	int i;
-
-	SETPORT(io_port + O_TC_DMACNTRL1, 0);	/* reset stack pointer */
-	for (i = 0; i < 16; i++)
-		SETPORT(io_port + O_STACK, i);
-
-	SETPORT(io_port + O_TC_DMACNTRL1, 0);	/* reset stack pointer */
-	for (i = 0; i < 16 && GETPORT(io_port + O_TC_STACK) == i; i++)
-		;
-
-	return (i == 16);
-}
-
-static int checksetup(struct aha152x_setup *setup)
-{
-
-#if !defined(PCMCIA)
-	int i;
-	for (i = 0; i < ARRAY_SIZE(ports) && (setup->io_port != ports[i]); i++)
-		;
-
-	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;
-        } else if(tc1550_porttest(setup->io_port)) {
-		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;
-
-	if ((setup->scsiid < 0) || (setup->scsiid > 7))
-		return 0;
-
-	if ((setup->reconnect < 0) || (setup->reconnect > 1))
-		return 0;
-
-	if ((setup->parity < 0) || (setup->parity > 1))
-		return 0;
-
-	if ((setup->synchronous < 0) || (setup->synchronous > 1))
-		return 0;
-
-	if ((setup->ext_trans < 0) || (setup->ext_trans > 1))
-		return 0;
-
-
-	return 1;
-}
-
 static inline struct Scsi_Host *lookup_irq(int irqno)
 {
 	int i;
@@ -950,7 +765,6 @@
 	struct Scsi_Host *shpnt = lookup_irq(irqno);
 
 	if (!shpnt) {
-		/* no point using HOSTNO here! */
         	printk(KERN_ERR "aha152x: catched software interrupt %d for unknown controller.\n", irqno);
 		return IRQ_NONE;
 	}
@@ -961,17 +775,19 @@
 	return IRQ_HANDLED;
 }
 
-
 struct Scsi_Host *aha152x_probe_one(struct aha152x_setup *setup)
 {
 	struct Scsi_Host *shpnt;
 
 	shpnt = scsi_host_alloc(&aha152x_driver_template, sizeof(struct aha152x_hostdata));
 	if (!shpnt) {
-		printk(KERN_ERR "aha152x: scsi_register failed\n");
+		printk(KERN_ERR "aha152x: scsi_host_alloc failed\n");
 		return NULL;
 	}
 
+	/* need to have host registered before triggering any interrupt */
+	aha152x_host[registered_count] = shpnt;
+
 	memset(HOSTDATA(shpnt), 0, sizeof *HOSTDATA(shpnt));
 
 	shpnt->io_port   = setup->io_port;
@@ -1034,24 +850,19 @@
 	       DELAY,
 	       EXT_TRANS ? "enabled" : "disabled");
 
-	if (!request_region(shpnt->io_port, IO_RANGE, "aha152x"))
-		goto out_unregister;
-
 	/* not expecting any interrupts */
 	SETPORT(SIMODE0, 0);
 	SETPORT(SIMODE1, 0);
 
-	if (request_irq(shpnt->irq, swintr, SA_INTERRUPT|SA_SHIRQ, "aha152x", shpnt) < 0) {
-		printk(KERN_ERR "aha152x%d: driver needs an IRQ.\n", shpnt->host_no);
-		goto out_release_region;
+	if( request_irq(shpnt->irq, swintr, SA_INTERRUPT|SA_SHIRQ, "aha152x", shpnt) ) {
+		printk(KERN_ERR "aha152x%d: irq %d busy.\n", shpnt->host_no, shpnt->irq);
+		goto out_host_put;
 	}
 
 	HOSTDATA(shpnt)->swint = 0;
 
 	printk(KERN_INFO "aha152x%d: trying software interrupt, ", shpnt->host_no);
 
-	/* need to have host registered before triggering any interrupt */
-	aha152x_host[registered_count] = shpnt;
 	mb();
 	SETPORT(DMACNTRL0, SWINT|INTEN);
 	mdelay(1000);
@@ -1066,9 +877,9 @@
 
 		SETPORT(DMACNTRL0, INTEN);
 
-		printk(KERN_ERR "aha152x%d: IRQ %d possibly wrong.  "
+		printk(KERN_ERR "aha152x%d: irq %d possibly wrong.  "
 				"Please verify.\n", shpnt->host_no, shpnt->irq);
-		goto out_unregister_host;
+		goto out_host_put;
 	}
 	printk("ok.\n");
 
@@ -1077,323 +888,51 @@
 	SETPORT(SSTAT0, 0x7f);
 	SETPORT(SSTAT1, 0xef);
 
-	if (request_irq(shpnt->irq, intr, SA_INTERRUPT|SA_SHIRQ, "aha152x", shpnt) < 0) {
-		printk(KERN_ERR "aha152x%d: failed to reassign interrupt.\n", shpnt->host_no);
-		goto out_unregister_host;
+	if ( request_irq(shpnt->irq, intr, SA_INTERRUPT|SA_SHIRQ, "aha152x", shpnt) ) {
+		printk(KERN_ERR "aha152x%d: failed to reassign irq %d.\n", shpnt->host_no, shpnt->irq);
+		goto out_host_put;
+	}
+
+	if( scsi_add_host(shpnt, 0) ) {
+		free_irq(shpnt->irq, shpnt);
+		printk(KERN_ERR "aha152x%d: failed to add host.\n", shpnt->host_no);
+		goto out_host_put;
 	}
 
-	scsi_add_host(shpnt, 0);
 	scsi_scan_host(shpnt);
-	return shpnt;	/* the pcmcia stub needs the return value; */
 
-out_unregister_host:
-	aha152x_host[registered_count] = NULL;
-out_release_region:
-	release_region(shpnt->io_port, IO_RANGE);
-out_unregister:
+	registered_count++;
+
+	return shpnt;
+
+out_host_put:
+	aha152x_host[registered_count]=0;
 	scsi_host_put(shpnt);
-	return NULL;
+
+	return 0;
 }
 
-static int __init aha152x_init(void)
+void aha152x_release(struct Scsi_Host *shpnt)
 {
-	int i, j, ok;
-#if defined(AUTOCONF)
-	aha152x_config conf;
-#endif
-#ifdef __ISAPNP__
-	struct pnp_dev *dev=0, *pnpdev[2] = {0, 0};
-#endif
-
-	if (setup_count) {
-		printk(KERN_INFO "aha152x: processing commandline: ");
+	if(!shpnt)
+		return;
 
-		for (i = 0; i < setup_count; i++)
-			if (!checksetup(&setup[i])) {
-				printk(KERN_ERR "\naha152x: %s\n", setup[i].conf);
-				printk(KERN_ERR "aha152x: invalid line\n");
-			}
-		printk("ok\n");
-	}
+	if (shpnt->irq)
+		free_irq(shpnt->irq, shpnt);
 
-#if defined(SETUP0)
-	if (setup_count < ARRAY_SIZE(setup)) {
-		struct aha152x_setup override = SETUP0;
+#if !defined(PCMCIA)
+	if (shpnt->io_port)
+		release_region(shpnt->io_port, IO_RANGE);
+#endif
 
-		if (setup_count == 0 || (override.io_port != setup[0].io_port)) {
-			if (!checksetup(&override)) {
-				printk(KERN_ERR "\naha152x: invalid override SETUP0={0x%x,%d,%d,%d,%d,%d,%d,%d}\n",
-				       override.io_port,
-				       override.irq,
-				       override.scsiid,
-				       override.reconnect,
-				       override.parity,
-				       override.synchronous,
-				       override.delay,
-				       override.ext_trans);
-			} else
-				setup[setup_count++] = override;
-		}
-	}
+#ifdef __ISAPNP__
+	if (HOSTDATA(shpnt)->pnpdev)
+		pnp_device_detach(HOSTDATA(shpnt)->pnpdev);
 #endif
 
-#if defined(SETUP1)
-	if (setup_count < ARRAY_SIZE(setup)) {
-		struct aha152x_setup override = SETUP1;
-
-		if (setup_count == 0 || (override.io_port != setup[0].io_port)) {
-			if (!checksetup(&override)) {
-				printk(KERN_ERR "\naha152x: invalid override SETUP1={0x%x,%d,%d,%d,%d,%d,%d,%d}\n",
-				       override.io_port,
-				       override.irq,
-				       override.scsiid,
-				       override.reconnect,
-				       override.parity,
-				       override.synchronous,
-				       override.delay,
-				       override.ext_trans);
-			} else
-				setup[setup_count++] = override;
-		}
-	}
-#endif
-
-#if defined(MODULE) && !defined(PCMCIA)
-	if (setup_count<ARRAY_SIZE(setup) && (aha152x[0]!=0 || io[0]!=0 || irq[0]!=0)) {
-		if(aha152x[0]!=0) {
-			setup[setup_count].conf        = "";
-			setup[setup_count].io_port     = aha152x[0];
-			setup[setup_count].irq         = aha152x[1];
-			setup[setup_count].scsiid      = aha152x[2];
-			setup[setup_count].reconnect   = aha152x[3];
-			setup[setup_count].parity      = aha152x[4];
-			setup[setup_count].synchronous = aha152x[5];
-			setup[setup_count].delay       = aha152x[6];
-			setup[setup_count].ext_trans   = aha152x[7];
-#if defined(AHA152X_DEBUG)
-			setup[setup_count].debug       = aha152x[8];
-#endif
-	  	} else if(io[0]!=0 || irq[0]!=0) {
-			if(io[0]!=0)  setup[setup_count].io_port = io[0];
-			if(irq[0]!=0) setup[setup_count].irq     = irq[0];
-
-	    		setup[setup_count].scsiid      = scsiid[0];
-	    		setup[setup_count].reconnect   = reconnect[0];
-	    		setup[setup_count].parity      = parity[0];
-	    		setup[setup_count].synchronous = sync[0];
-	    		setup[setup_count].delay       = delay[0];
-	    		setup[setup_count].ext_trans   = exttrans[0];
-#if defined(AHA152X_DEBUG)
-			setup[setup_count].debug       = debug[0];
-#endif
-		}
-
-          	if (checksetup(&setup[setup_count]))
-			setup_count++;
-		else
-			printk(KERN_ERR "aha152x: invalid module params io=0x%x, irq=%d,scsiid=%d,reconnect=%d,parity=%d,sync=%d,delay=%d,exttrans=%d\n",
-			       setup[setup_count].io_port,
-			       setup[setup_count].irq,
-			       setup[setup_count].scsiid,
-			       setup[setup_count].reconnect,
-			       setup[setup_count].parity,
-			       setup[setup_count].synchronous,
-			       setup[setup_count].delay,
-			       setup[setup_count].ext_trans);
-	}
-
-	if (setup_count<ARRAY_SIZE(setup) && (aha152x1[0]!=0 || io[1]!=0 || irq[1]!=0)) {
-		if(aha152x1[0]!=0) {
-			setup[setup_count].conf        = "";
-			setup[setup_count].io_port     = aha152x1[0];
-			setup[setup_count].irq         = aha152x1[1];
-			setup[setup_count].scsiid      = aha152x1[2];
-			setup[setup_count].reconnect   = aha152x1[3];
-			setup[setup_count].parity      = aha152x1[4];
-			setup[setup_count].synchronous = aha152x1[5];
-			setup[setup_count].delay       = aha152x1[6];
-			setup[setup_count].ext_trans   = aha152x1[7];
-#if defined(AHA152X_DEBUG)
-			setup[setup_count].debug       = aha152x1[8];
-#endif
-	  	} else if(io[1]!=0 || irq[1]!=0) {
-			if(io[1]!=0)  setup[setup_count].io_port = io[1];
-			if(irq[1]!=0) setup[setup_count].irq     = irq[1];
-
-	    		setup[setup_count].scsiid      = scsiid[1];
-	    		setup[setup_count].reconnect   = reconnect[1];
-	    		setup[setup_count].parity      = parity[1];
-	    		setup[setup_count].synchronous = sync[1];
-	    		setup[setup_count].delay       = delay[1];
-	    		setup[setup_count].ext_trans   = exttrans[1];
-#if defined(AHA152X_DEBUG)
-			setup[setup_count].debug       = debug[1];
-#endif
-		}
-		if (checksetup(&setup[setup_count]))
-			setup_count++;
-		else
-			printk(KERN_ERR "aha152x: invalid module params io=0x%x, irq=%d,scsiid=%d,reconnect=%d,parity=%d,sync=%d,delay=%d,exttrans=%d\n",
-			       setup[setup_count].io_port,
-			       setup[setup_count].irq,
-			       setup[setup_count].scsiid,
-			       setup[setup_count].reconnect,
-			       setup[setup_count].parity,
-			       setup[setup_count].synchronous,
-			       setup[setup_count].delay,
-			       setup[setup_count].ext_trans);
-	}
-#endif
-
-#ifdef __ISAPNP__
-	while ( setup_count<ARRAY_SIZE(setup) && (dev=pnp_find_dev(NULL, ISAPNP_VENDOR('A','D','P'), ISAPNP_FUNCTION(0x1505), dev)) ) {
-		if (pnp_device_attach(dev) < 0)
-			continue;
-		if (pnp_activate_dev(dev) < 0) {
-			pnp_device_detach(dev);
-			continue;
-		}
-		if (!pnp_port_valid(dev, 0)) {
-			pnp_device_detach(dev);
-			continue;
-		}
-		if (setup_count==1 && pnp_port_start(dev, 0)==setup[0].io_port) {
-			pnp_device_detach(dev);
-			continue;
-		}
-		setup[setup_count].io_port     = pnp_port_start(dev, 0);
-		setup[setup_count].irq         = pnp_irq(dev, 0);
-		setup[setup_count].scsiid      = 7;
-		setup[setup_count].reconnect   = 1;
-		setup[setup_count].parity      = 1;
-		setup[setup_count].synchronous = 1;
-		setup[setup_count].delay       = DELAY_DEFAULT;
-		setup[setup_count].ext_trans   = 0;
-#if defined(AHA152X_DEBUG)
-		setup[setup_count].debug       = DEBUG_DEFAULT;
-#endif
-		pnpdev[setup_count]            = dev;
-		printk (KERN_INFO
-			"aha152x: found ISAPnP AVA-1505A at io=0x%03x, irq=%d\n",
-			setup[setup_count].io_port, setup[setup_count].irq);
-		setup_count++;
-	}
-#endif
-
-#if defined(AUTOCONF)
-	if (setup_count<ARRAY_SIZE(setup)) {
-#if !defined(SKIP_BIOSTEST)
-		ok = 0;
-		for (i = 0; i < ARRAY_SIZE(addresses) && !ok; i++)
-			for (j = 0; j<ARRAY_SIZE(signatures) && !ok; j++)
-				ok = isa_check_signature(addresses[i] + signatures[j].sig_offset,
-								signatures[j].signature, signatures[j].sig_length);
-
-		if (!ok && setup_count == 0)
-			return 0;
-
-		printk(KERN_INFO "aha152x: BIOS test: passed, ");
-#else
-		printk(KERN_INFO "aha152x: ");
-#endif				/* !SKIP_BIOSTEST */
-
-		ok = 0;
-		for (i = 0; i < ARRAY_SIZE(ports) && setup_count < 2; i++) {
-			if ((setup_count == 1) && (setup[0].io_port == ports[i]))
-				continue;
-
-			if (aha152x_porttest(ports[i])) {
-				ok++;
-				setup[setup_count].io_port = ports[i];
-				setup[setup_count].tc1550  = 0;
-
-				conf.cf_port =
-				    (GETPORT(ports[i] + O_PORTA) << 8) + GETPORT(ports[i] + O_PORTB);
-
-				setup[setup_count].irq = IRQ_MIN + conf.cf_irq;
-				setup[setup_count].scsiid = conf.cf_id;
-				setup[setup_count].reconnect = conf.cf_tardisc;
-				setup[setup_count].parity = !conf.cf_parity;
-				setup[setup_count].synchronous = conf.cf_syncneg;
-				setup[setup_count].delay = DELAY_DEFAULT;
-				setup[setup_count].ext_trans = 0;
-#if defined(AHA152X_DEBUG)
-				setup[setup_count].debug = DEBUG_DEFAULT;
-#endif
-				setup_count++;
-			} else if (tc1550_porttest(ports[i])) {
-				ok++;
-				setup[setup_count].io_port = ports[i];
-				setup[setup_count].tc1550  = 1;
-
-				conf.cf_port =
-				    (GETPORT(ports[i] + O_PORTA) << 8) + GETPORT(ports[i] + O_PORTB);
-
-				setup[setup_count].irq = IRQ_MIN + conf.cf_irq;
-				setup[setup_count].scsiid = conf.cf_id;
-				setup[setup_count].reconnect = conf.cf_tardisc;
-				setup[setup_count].parity = !conf.cf_parity;
-				setup[setup_count].synchronous = conf.cf_syncneg;
-				setup[setup_count].delay = DELAY_DEFAULT;
-				setup[setup_count].ext_trans = 0;
-#if defined(AHA152X_DEBUG)
-				setup[setup_count].debug = DEBUG_DEFAULT;
-#endif
-				setup_count++;
-			}
-		}
-
-		if (ok)
-			printk("auto configuration: ok, ");
-	}
-#endif
-
-	printk("detected %d controller(s)\n", setup_count);
-
-	for (i=0; i<setup_count; i++) {
-		aha152x_probe_one(&setup[i]);
-		if (aha152x_host[registered_count]) {
-#ifdef __ISAPNP__
-			if(pnpdev[i])
-				HOSTDATA(aha152x_host[registered_count])->pnpdev=pnpdev[i];
-#endif
-			registered_count++;
-		}
-	}
-
-	return registered_count>0;
-}
-
-static int aha152x_release(struct Scsi_Host *shpnt)
-{
-	if (shpnt->irq)
-		free_irq(shpnt->irq, shpnt);
-
-	if (shpnt->io_port)
-		release_region(shpnt->io_port, IO_RANGE);
-
-#ifdef __ISAPNP__
-	if (HOSTDATA(shpnt)->pnpdev)
-		pnp_device_detach(HOSTDATA(shpnt)->pnpdev);
-#endif
-
-	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;
-		}
-	}
-}
+	scsi_remove_host(shpnt);
+	scsi_host_put(shpnt);
+}
 
 
 /*
@@ -1446,8 +985,8 @@
 
 #if defined(AHA152X_DEBUG)
 	if (HOSTDATA(shpnt)->debug & debug_queue) {
-		printk(INFO_LEAD "queue: cmd_len=%d pieces=%d size=%u cmnd=",
-		       CMDINFO(SCpnt), SCpnt->cmd_len, SCpnt->use_sg, SCpnt->request_bufflen);
+		printk(INFO_LEAD "queue: %p; cmd_len=%d pieces=%d size=%u cmnd=",
+		       CMDINFO(SCpnt), SCpnt, SCpnt->cmd_len, SCpnt->use_sg, SCpnt->request_bufflen);
 		print_command(SCpnt->cmnd);
 	}
 #endif
@@ -1466,7 +1005,7 @@
 			return FAILED;
 		}
 	} else {
-		SCpnt->host_scribble    = kmalloc(sizeof(struct aha152x_scdata), GFP_ATOMIC);
+		SCpnt->host_scribble = kmalloc(sizeof(struct aha152x_scdata), GFP_ATOMIC);
 		if(SCpnt->host_scribble==0) {
 			printk(ERR_LEAD "allocation failed\n", CMDINFO(SCpnt));
 			return FAILED;
@@ -1561,11 +1100,6 @@
 	Scsi_Cmnd *ptr;
 	unsigned long flags;
 
-	if(!shpnt) {
-		printk(ERR_LEAD "abort(%p): no host structure\n", CMDINFO(SCpnt), SCpnt);
-		return FAILED;
-	}
-
 #if defined(AHA152X_DEBUG)
 	if(HOSTDATA(shpnt)->debug & debug_eh) {
 		printk(DEBUG_LEAD "abort(%p)", CMDINFO(SCpnt), SCpnt);
@@ -1610,15 +1144,12 @@
 	Scsi_Cmnd	 *SCp   = (Scsi_Cmnd *)p;
 	struct semaphore *sem   = SCSEM(SCp);
 	struct Scsi_Host *shpnt = SCp->device->host;
+	unsigned long flags;
 
 	/* remove command from issue queue */
-	if(remove_SC(&ISSUE_SC, SCp)) {
-		printk(KERN_INFO "aha152x: ABORT timed out - removed from issue queue\n");
-		kfree(SCp->host_scribble);
-		SCp->host_scribble=0;
-	} else {
-		printk(KERN_INFO "aha152x: ABORT timed out - not on issue queue\n");
-	}
+	DO_LOCK(flags);
+	remove_SC(&ISSUE_SC, SCp);
+	DO_UNLOCK(flags);
 
 	up(sem);
 }
@@ -1626,15 +1157,14 @@
 /*
  * Reset a device
  *
- * FIXME: never seen this live. might lockup...
- *
  */
 static int aha152x_device_reset(Scsi_Cmnd * SCpnt)
 {
 	struct Scsi_Host *shpnt = SCpnt->device->host;
 	DECLARE_MUTEX_LOCKED(sem);
 	struct timer_list timer;
-	int ret;
+	int ret, issued, disconnected;
+	unsigned long flags;
 
 #if defined(AHA152X_DEBUG)
 	if(HOSTDATA(shpnt)->debug & debug_eh) {
@@ -1648,13 +1178,18 @@
 		return FAILED;
 	}
 
+	DO_LOCK(flags);
+	issued       = remove_SC(&ISSUE_SC, SCpnt)==0;
+	disconnected = issued && remove_SC(&DISCONNECTED_SC, SCpnt);
+	DO_UNLOCK(flags);
+
 	SCpnt->cmd_len         = 0;
 	SCpnt->use_sg          = 0;
 	SCpnt->request_buffer  = 0;
 	SCpnt->request_bufflen = 0;
 
 	init_timer(&timer);
-	timer.data     = (unsigned long) cmd;
+	timer.data     = (unsigned long) SCpnt;
 	timer.expires  = jiffies + 100*HZ;   /* 10s */
 	timer.function = (void (*)(unsigned long)) timer_expired;
 
@@ -1662,18 +1197,35 @@
 	add_timer(&timer);
 	down(&sem);
 	del_timer(&timer);
-
+	
 	SCpnt->cmd_len         = SCpnt->old_cmd_len;
 	SCpnt->use_sg          = SCpnt->old_use_sg;
   	SCpnt->request_buffer  = SCpnt->buffer;
        	SCpnt->request_bufflen = SCpnt->bufflen;
 
+	DO_LOCK(flags);
+
 	if(SCpnt->SCp.phase & resetted) {
+		HOSTDATA(shpnt)->commands--;
+		if (!HOSTDATA(shpnt)->commands)
+			SETPORT(PORTA, 0);
+		kfree(SCpnt->host_scribble);
+		SCpnt->host_scribble=0;
+
 		ret = SUCCESS;
 	} else {
+		/* requeue */
+		if(!issued) {
+			append_SC(&ISSUE_SC, SCpnt);
+		} else if(disconnected) {
+			append_SC(&DISCONNECTED_SC, SCpnt);
+		}
+	
 		ret = FAILED;
 	}
 
+	DO_UNLOCK(flags);
+
 	spin_lock_irq(shpnt->host_lock);
 	return ret;
 }
@@ -1681,13 +1233,17 @@
 static void free_hard_reset_SCs(struct Scsi_Host *shpnt, Scsi_Cmnd **SCs)
 {
 	Scsi_Cmnd *ptr;
-	unsigned long flags;
-
-	DO_LOCK(flags);
 
 	ptr=*SCs;
 	while(ptr) {
-		Scsi_Cmnd *next = SCNEXT(ptr);
+		Scsi_Cmnd *next;
+
+		if(SCDATA(ptr)) {
+			next = SCNEXT(ptr);
+		} else {
+			printk(DEBUG_LEAD "queue corrupted at %p\n", CMDINFO(ptr), ptr);
+			next = 0;
+		}
 
 		if (!ptr->device->soft_reset) {
 			DPRINTK(debug_eh, DEBUG_LEAD "disconnected command %p removed\n", CMDINFO(ptr), ptr);
@@ -1699,8 +1255,6 @@
 
 		ptr = next;
 	}
-
-	DO_UNLOCK(flags);
 }
 
 /*
@@ -1712,6 +1266,8 @@
 	struct Scsi_Host *shpnt = SCpnt->device->host;
 	unsigned long flags;
 
+	DO_LOCK(flags);
+
 #if defined(AHA152X_DEBUG)
 	if(HOSTDATA(shpnt)->debug & debug_eh) {
 		printk(DEBUG_LEAD "aha152x_bus_reset(%p)", CMDINFO(SCpnt), SCpnt);
@@ -1729,12 +1285,12 @@
 	SETPORT(SCSISEQ, 0);
 	mdelay(DELAY);
 
-	DPRINTK(debug_eh, DEBUG_LEAD "bus reset returns\n", CMDINFO(SCpnt));
+	DPRINTK(debug_eh, DEBUG_LEAD "bus resetted\n", CMDINFO(SCpnt));
 
-	DO_LOCK(flags);
 	setup_expected_interrupts(shpnt);
 	if(HOSTDATA(shpnt)->commands==0)
 		SETPORT(PORTA, 0);
+
 	DO_UNLOCK(flags);
 
 	return SUCCESS;
@@ -2000,6 +1556,7 @@
 #if defined(AHA152X_STAT)
 		action++;
 #endif
+
 		if(DONE_SC->SCp.phase & check_condition) {
 #if 0
 			if(HOSTDATA(shpnt)->debug & debug_eh) {
@@ -2029,47 +1586,57 @@
 #endif
 
 			if(!(DONE_SC->SCp.Status & not_issued)) {
+				Scsi_Cmnd *ptr = DONE_SC;
+				DONE_SC=0;
 #if 0
-				DPRINTK(debug_eh, ERR_LEAD "requesting sense\n", CMDINFO(DONE_SC));
+				DPRINTK(debug_eh, ERR_LEAD "requesting sense\n", CMDINFO(ptr));
 #endif
 
-				DONE_SC->cmnd[0]         = REQUEST_SENSE;
-				DONE_SC->cmnd[1]         = 0;
-				DONE_SC->cmnd[2]         = 0;
-				DONE_SC->cmnd[3]         = 0;
-				DONE_SC->cmnd[4]         = sizeof(DONE_SC->sense_buffer);
-				DONE_SC->cmnd[5]         = 0;
-				DONE_SC->cmd_len         = 6;
-				DONE_SC->use_sg          = 0; 
-				DONE_SC->request_buffer  = DONE_SC->sense_buffer;
-				DONE_SC->request_bufflen = sizeof(DONE_SC->sense_buffer);
+				ptr->cmnd[0]         = REQUEST_SENSE;
+				ptr->cmnd[1]         = 0;
+				ptr->cmnd[2]         = 0;
+				ptr->cmnd[3]         = 0;
+				ptr->cmnd[4]         = sizeof(ptr->sense_buffer);
+				ptr->cmnd[5]         = 0;
+				ptr->cmd_len         = 6;
+				ptr->use_sg          = 0; 
+				ptr->request_buffer  = ptr->sense_buffer;
+				ptr->request_bufflen = sizeof(ptr->sense_buffer);
 			
 				DO_UNLOCK(flags);
-				aha152x_internal_queue(DONE_SC, 0, check_condition, DONE_SC->scsi_done);
+				aha152x_internal_queue(ptr, 0, check_condition, ptr->scsi_done);
 				DO_LOCK(flags);
-
-				DONE_SC=0;
-			} else {
 #if 0
+			} else {
 				DPRINTK(debug_eh, ERR_LEAD "command not issued - CHECK CONDITION ignored\n", CMDINFO(DONE_SC));
 #endif
 			}
 		}
 
 		if(DONE_SC && DONE_SC->scsi_done) {
+#if defined(AHA152X_DEBUG)
+			int hostno=DONE_SC->device->host->host_no;
+			int id=DONE_SC->device->id & 0xf;
+			int lun=DONE_SC->device->lun & 0x7;
+#endif
+			Scsi_Cmnd *ptr = DONE_SC;
+			DONE_SC=0;
+
 			/* turn led off, when no commands are in the driver */
 			HOSTDATA(shpnt)->commands--;
 			if (!HOSTDATA(shpnt)->commands)
 				SETPORT(PORTA, 0);	/* turn led off */
 
+			if(ptr->scsi_done != reset_done) {
+				kfree(ptr->host_scribble);
+				ptr->host_scribble=0;
+			}
+
 			DO_UNLOCK(flags);
-			DPRINTK(debug_done, DEBUG_LEAD "calling scsi_done(%p)\n", CMDINFO(DONE_SC), DONE_SC);
-                	DONE_SC->scsi_done(DONE_SC);
-			DPRINTK(debug_done, DEBUG_LEAD "scsi_done(%p) returned\n", CMDINFO(DONE_SC), DONE_SC);
+			DPRINTK(debug_done, DEBUG_LEAD "calling scsi_done(%p)\n", hostno, id, lun, ptr);
+                	ptr->scsi_done(ptr);
+			DPRINTK(debug_done, DEBUG_LEAD "scsi_done(%p) returned\n", hostno, id, lun, ptr);
 			DO_LOCK(flags);
-
-			kfree(DONE_SC->host_scribble);
-			DONE_SC->host_scribble=0;
 		}
 
 		DONE_SC=0;
@@ -2936,11 +2503,11 @@
 		if (!ptr->device->soft_reset) {
 			remove_SC(&DISCONNECTED_SC, ptr);
 
-			ptr->result =  DID_RESET << 16;
-			ptr->scsi_done(ptr);
-
 			kfree(ptr->host_scribble);
 			ptr->host_scribble=0;
+
+			ptr->result =  DID_RESET << 16;
+			ptr->scsi_done(ptr);
 		}
 
 		ptr = next;
@@ -3382,7 +2949,11 @@
 		printk("aborted|");
 	if (ptr->SCp.phase & resetted)
 		printk("resetted|");
-	printk("; next=0x%p\n", SCNEXT(ptr));
+	if( SCDATA(ptr) ) {
+		printk("; next=0x%p\n", SCNEXT(ptr));
+	} else {
+		printk("; next=(host scribble NULL)\n");
+	}
 }
 
 /*
@@ -3406,7 +2977,7 @@
 		printk(KERN_DEBUG "none\n");
 
 	printk(KERN_DEBUG "disconnected_SC:\n");
-	for (ptr = DISCONNECTED_SC; ptr; ptr = SCNEXT(ptr))
+	for (ptr = DISCONNECTED_SC; ptr; ptr = SCDATA(ptr) ? SCNEXT(ptr) : 0)
 		show_command(ptr);
 
 	disp_ports(shpnt);
@@ -3914,7 +3485,494 @@
 	.use_clustering			= DISABLE_CLUSTERING,
 };
 
-#ifndef PCMCIA
-module_init(aha152x_init);
-module_exit(aha152x_exit);
-#endif
+#if !defined(PCMCIA)
+static int setup_count;
+static struct aha152x_setup setup[2];
+
+/* possible i/o addresses for the AIC-6260; default first */
+static unsigned short ports[] = { 0x340, 0x140 };
+
+#if !defined(SKIP_BIOSTEST)
+/* possible locations for the Adaptec BIOS; defaults first */
+static unsigned int addresses[] =
+{
+	0xdc000,		/* default first */
+	0xc8000,
+	0xcc000,
+	0xd0000,
+	0xd4000,
+	0xd8000,
+	0xe0000,
+	0xeb800,		/* VTech Platinum SMP */
+	0xf0000,
+};
+
+/* signatures for various AIC-6[23]60 based controllers.
+   The point in detecting signatures is to avoid useless and maybe
+   harmful probes on ports. I'm not sure that all listed boards pass
+   auto-configuration. For those which fail the BIOS signature is
+   obsolete, because user intervention to supply the configuration is
+   needed anyway.  May be an information whether or not the BIOS supports
+   extended translation could be also useful here. */
+static struct signature {
+	unsigned char *signature;
+	int sig_offset;
+	int sig_length;
+} signatures[] =
+{
+	{ "Adaptec AHA-1520 BIOS",	0x102e, 21 },
+		/* Adaptec 152x */
+	{ "Adaptec AHA-1520B",		0x000b, 17 },
+		/* Adaptec 152x rev B */
+	{ "Adaptec AHA-1520B",		0x0026, 17 },
+		/* Iomega Jaz Jet ISA (AIC6370Q) */
+	{ "Adaptec ASW-B626 BIOS",	0x1029, 21 },
+		/* on-board controller */
+	{ "Adaptec BIOS: ASW-B626",	0x000f, 22 },
+		/* on-board controller */
+	{ "Adaptec ASW-B626 S2",	0x2e6c, 19 },
+		/* on-board controller */
+	{ "Adaptec BIOS:AIC-6360",	0x000c, 21 },
+		/* on-board controller */
+	{ "ScsiPro SP-360 BIOS",	0x2873, 19 },
+		/* ScsiPro-Controller  */
+	{ "GA-400 LOCAL BUS SCSI BIOS", 0x102e, 26 },
+		/* Gigabyte Local-Bus-SCSI */
+	{ "Adaptec BIOS:AVA-282X",	0x000c, 21 },
+		/* Adaptec 282x */
+	{ "Adaptec IBM Dock II SCSI",   0x2edd, 24 },
+		/* IBM Thinkpad Dock II */
+	{ "Adaptec BIOS:AHA-1532P",     0x001c, 22 },
+		/* IBM Thinkpad Dock II SCSI */
+	{ "DTC3520A Host Adapter BIOS", 0x318a, 26 },
+		/* DTC 3520A ISA SCSI */
+};
+#endif /* !SKIP_BIOSTEST */
+
+/*
+ * Test, if port_base is valid.
+ *
+ */
+static int aha152x_porttest(int io_port)
+{
+	int i;
+
+	SETPORT(io_port + O_DMACNTRL1, 0);	/* reset stack pointer */
+	for (i = 0; i < 16; i++)
+		SETPORT(io_port + O_STACK, i);
+
+	SETPORT(io_port + O_DMACNTRL1, 0);	/* reset stack pointer */
+	for (i = 0; i < 16 && GETPORT(io_port + O_STACK) == i; i++)
+		;
+
+	return (i == 16);
+}
+
+static int tc1550_porttest(int io_port)
+{
+	int i;
+
+	SETPORT(io_port + O_TC_DMACNTRL1, 0);	/* reset stack pointer */
+	for (i = 0; i < 16; i++)
+		SETPORT(io_port + O_STACK, i);
+
+	SETPORT(io_port + O_TC_DMACNTRL1, 0);	/* reset stack pointer */
+	for (i = 0; i < 16 && GETPORT(io_port + O_TC_STACK) == i; i++)
+		;
+
+	return (i == 16);
+}
+
+
+static int checksetup(struct aha152x_setup *setup)
+{
+	int i;
+	for (i = 0; i < ARRAY_SIZE(ports) && (setup->io_port != ports[i]); i++)
+		;
+
+	if (i == ARRAY_SIZE(ports))
+		return 0;
+
+	if ( request_region(setup->io_port, IO_RANGE, "aha152x")==0 ) {
+		printk(KERN_ERR "aha152x: io port 0x%x busy.\n", setup->io_port);
+		return 0;
+	}
+
+	if( aha152x_porttest(setup->io_port) ) {
+		setup->tc1550=0;
+	} else if( tc1550_porttest(setup->io_port) ) {
+		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;
+
+	if ((setup->scsiid < 0) || (setup->scsiid > 7))
+		return 0;
+
+	if ((setup->reconnect < 0) || (setup->reconnect > 1))
+		return 0;
+
+	if ((setup->parity < 0) || (setup->parity > 1))
+		return 0;
+
+	if ((setup->synchronous < 0) || (setup->synchronous > 1))
+		return 0;
+
+	if ((setup->ext_trans < 0) || (setup->ext_trans > 1))
+		return 0;
+
+
+	return 1;
+}
+
+
+static int __init aha152x_init(void)
+{
+	int i, j, ok;
+#if defined(AUTOCONF)
+	aha152x_config conf;
+#endif
+#ifdef __ISAPNP__
+	struct pnp_dev *dev=0, *pnpdev[2] = {0, 0};
+#endif
+
+	if ( setup_count ) {
+		printk(KERN_INFO "aha152x: processing commandline: ");
+
+		for (i = 0; i<setup_count; i++) {
+			if (!checksetup(&setup[i])) {
+				printk(KERN_ERR "\naha152x: %s\n", setup[i].conf);
+				printk(KERN_ERR "aha152x: invalid line\n");
+			}
+		}
+		printk("ok\n");
+	}
+
+#if defined(SETUP0)
+	if (setup_count < ARRAY_SIZE(setup)) {
+		struct aha152x_setup override = SETUP0;
+
+		if (setup_count == 0 || (override.io_port != setup[0].io_port)) {
+			if (!checksetup(&override)) {
+				printk(KERN_ERR "\naha152x: invalid override SETUP0={0x%x,%d,%d,%d,%d,%d,%d,%d}\n",
+				       override.io_port,
+				       override.irq,
+				       override.scsiid,
+				       override.reconnect,
+				       override.parity,
+				       override.synchronous,
+				       override.delay,
+				       override.ext_trans);
+			} else
+				setup[setup_count++] = override;
+		}
+	}
+#endif
+
+#if defined(SETUP1)
+	if (setup_count < ARRAY_SIZE(setup)) {
+		struct aha152x_setup override = SETUP1;
+
+		if (setup_count == 0 || (override.io_port != setup[0].io_port)) {
+			if (!checksetup(&override)) {
+				printk(KERN_ERR "\naha152x: invalid override SETUP1={0x%x,%d,%d,%d,%d,%d,%d,%d}\n",
+				       override.io_port,
+				       override.irq,
+				       override.scsiid,
+				       override.reconnect,
+				       override.parity,
+				       override.synchronous,
+				       override.delay,
+				       override.ext_trans);
+			} else
+				setup[setup_count++] = override;
+		}
+	}
+#endif
+
+#if defined(MODULE)
+	if (setup_count<ARRAY_SIZE(setup) && (aha152x[0]!=0 || io[0]!=0 || irq[0]!=0)) {
+		if(aha152x[0]!=0) {
+			setup[setup_count].conf        = "";
+			setup[setup_count].io_port     = aha152x[0];
+			setup[setup_count].irq         = aha152x[1];
+			setup[setup_count].scsiid      = aha152x[2];
+			setup[setup_count].reconnect   = aha152x[3];
+			setup[setup_count].parity      = aha152x[4];
+			setup[setup_count].synchronous = aha152x[5];
+			setup[setup_count].delay       = aha152x[6];
+			setup[setup_count].ext_trans   = aha152x[7];
+#if defined(AHA152X_DEBUG)
+			setup[setup_count].debug       = aha152x[8];
+#endif
+	  	} else if(io[0]!=0 || irq[0]!=0) {
+			if(io[0]!=0)  setup[setup_count].io_port = io[0];
+			if(irq[0]!=0) setup[setup_count].irq     = irq[0];
+
+	    		setup[setup_count].scsiid      = scsiid[0];
+	    		setup[setup_count].reconnect   = reconnect[0];
+	    		setup[setup_count].parity      = parity[0];
+	    		setup[setup_count].synchronous = sync[0];
+	    		setup[setup_count].delay       = delay[0];
+	    		setup[setup_count].ext_trans   = exttrans[0];
+#if defined(AHA152X_DEBUG)
+			setup[setup_count].debug       = debug[0];
+#endif
+		}
+
+          	if (checksetup(&setup[setup_count]))
+			setup_count++;
+		else
+			printk(KERN_ERR "aha152x: invalid module params io=0x%x, irq=%d,scsiid=%d,reconnect=%d,parity=%d,sync=%d,delay=%d,exttrans=%d\n",
+			       setup[setup_count].io_port,
+			       setup[setup_count].irq,
+			       setup[setup_count].scsiid,
+			       setup[setup_count].reconnect,
+			       setup[setup_count].parity,
+			       setup[setup_count].synchronous,
+			       setup[setup_count].delay,
+			       setup[setup_count].ext_trans);
+	}
+
+	if (setup_count<ARRAY_SIZE(setup) && (aha152x1[0]!=0 || io[1]!=0 || irq[1]!=0)) {
+		if(aha152x1[0]!=0) {
+			setup[setup_count].conf        = "";
+			setup[setup_count].io_port     = aha152x1[0];
+			setup[setup_count].irq         = aha152x1[1];
+			setup[setup_count].scsiid      = aha152x1[2];
+			setup[setup_count].reconnect   = aha152x1[3];
+			setup[setup_count].parity      = aha152x1[4];
+			setup[setup_count].synchronous = aha152x1[5];
+			setup[setup_count].delay       = aha152x1[6];
+			setup[setup_count].ext_trans   = aha152x1[7];
+#if defined(AHA152X_DEBUG)
+			setup[setup_count].debug       = aha152x1[8];
+#endif
+	  	} else if(io[1]!=0 || irq[1]!=0) {
+			if(io[1]!=0)  setup[setup_count].io_port = io[1];
+			if(irq[1]!=0) setup[setup_count].irq     = irq[1];
+
+	    		setup[setup_count].scsiid      = scsiid[1];
+	    		setup[setup_count].reconnect   = reconnect[1];
+	    		setup[setup_count].parity      = parity[1];
+	    		setup[setup_count].synchronous = sync[1];
+	    		setup[setup_count].delay       = delay[1];
+	    		setup[setup_count].ext_trans   = exttrans[1];
+#if defined(AHA152X_DEBUG)
+			setup[setup_count].debug       = debug[1];
+#endif
+		}
+		if (checksetup(&setup[setup_count]))
+			setup_count++;
+		else
+			printk(KERN_ERR "aha152x: invalid module params io=0x%x, irq=%d,scsiid=%d,reconnect=%d,parity=%d,sync=%d,delay=%d,exttrans=%d\n",
+			       setup[setup_count].io_port,
+			       setup[setup_count].irq,
+			       setup[setup_count].scsiid,
+			       setup[setup_count].reconnect,
+			       setup[setup_count].parity,
+			       setup[setup_count].synchronous,
+			       setup[setup_count].delay,
+			       setup[setup_count].ext_trans);
+	}
+#endif
+
+#ifdef __ISAPNP__
+	for(i=0; setup_count<ARRAY_SIZE(setup) && id_table[i].vendor; i++) {
+		while ( setup_count<ARRAY_SIZE(setup) &&
+			(dev=pnp_find_dev(NULL, id_table[i].vendor, id_table[i].function, dev)) ) {
+			if (pnp_device_attach(dev) < 0)
+				continue;
+
+			if (pnp_activate_dev(dev) < 0) {
+				pnp_device_detach(dev);
+				continue;
+			}
+
+			if (!pnp_port_valid(dev, 0)) {
+				pnp_device_detach(dev);
+				continue;
+			}
+
+			if (setup_count==1 && pnp_port_start(dev, 0)==setup[0].io_port) {
+				pnp_device_detach(dev);
+				continue;
+			}
+
+			setup[setup_count].io_port     = pnp_port_start(dev, 0);
+			setup[setup_count].irq         = pnp_irq(dev, 0);
+			setup[setup_count].scsiid      = 7;
+			setup[setup_count].reconnect   = 1;
+			setup[setup_count].parity      = 1;
+			setup[setup_count].synchronous = 1;
+			setup[setup_count].delay       = DELAY_DEFAULT;
+			setup[setup_count].ext_trans   = 0;
+#if defined(AHA152X_DEBUG)
+			setup[setup_count].debug       = DEBUG_DEFAULT;
+#endif
+#if defined(__ISAPNP__)
+			pnpdev[setup_count]            = dev;
+#endif
+			printk (KERN_INFO
+				"aha152x: found ISAPnP adapter at io=0x%03x, irq=%d\n",
+				setup[setup_count].io_port, setup[setup_count].irq);
+			setup_count++;
+		}
+	}
+#endif
+
+#if defined(AUTOCONF)
+	if (setup_count<ARRAY_SIZE(setup)) {
+#if !defined(SKIP_BIOSTEST)
+		ok = 0;
+		for (i = 0; i < ARRAY_SIZE(addresses) && !ok; i++)
+			for (j = 0; j<ARRAY_SIZE(signatures) && !ok; j++)
+				ok = isa_check_signature(addresses[i] + signatures[j].sig_offset,
+								signatures[j].signature, signatures[j].sig_length);
+		if (!ok && setup_count == 0)
+			return 0;
+
+		printk(KERN_INFO "aha152x: BIOS test: passed, ");
+#else
+		printk(KERN_INFO "aha152x: ");
+#endif				/* !SKIP_BIOSTEST */
+
+		ok = 0;
+		for (i = 0; i < ARRAY_SIZE(ports) && setup_count < 2; i++) {
+			if ((setup_count == 1) && (setup[0].io_port == ports[i]))
+				continue;
+
+			if ( request_region(ports[i], IO_RANGE, "aha152x")==0 ) {
+				printk(KERN_ERR "aha152x: io port 0x%x busy.\n", ports[i]);
+				continue;
+			}
+
+			if (aha152x_porttest(ports[i])) {
+				setup[setup_count].tc1550  = 0;
+
+				conf.cf_port =
+				    (GETPORT(ports[i] + O_PORTA) << 8) + GETPORT(ports[i] + O_PORTB);
+			} else if (tc1550_porttest(ports[i])) {
+				setup[setup_count].tc1550  = 1;
+
+				conf.cf_port =
+				    (GETPORT(ports[i] + O_TC_PORTA) << 8) + GETPORT(ports[i] + O_TC_PORTB);
+			} else {
+				release_region(ports[i], IO_RANGE);
+				continue;
+			}
+
+			release_region(ports[i], IO_RANGE);
+
+			ok++;
+			setup[setup_count].io_port = ports[i];
+			setup[setup_count].irq = IRQ_MIN + conf.cf_irq;
+			setup[setup_count].scsiid = conf.cf_id;
+			setup[setup_count].reconnect = conf.cf_tardisc;
+			setup[setup_count].parity = !conf.cf_parity;
+			setup[setup_count].synchronous = conf.cf_syncneg;
+			setup[setup_count].delay = DELAY_DEFAULT;
+			setup[setup_count].ext_trans = 0;
+#if defined(AHA152X_DEBUG)
+			setup[setup_count].debug = DEBUG_DEFAULT;
+#endif
+			setup_count++;
+
+		}
+
+		if (ok)
+			printk("auto configuration: ok, ");
+	}
+#endif
+
+	printk("%d controller(s) configured\n", setup_count);
+
+	for (i=0; i<setup_count; i++) {
+		if ( request_region(setup[i].io_port, IO_RANGE, "aha152x") ) {
+			struct Scsi_Host *shpnt = aha152x_probe_one(&setup[i]);
+
+			if( !shpnt ) {
+				release_region(setup[i].io_port, IO_RANGE);
+#if defined(__ISAPNP__)
+			} else if( pnpdev[i] ) {
+				HOSTDATA(shpnt)->pnpdev=pnpdev[i];
+				pnpdev[i]=0;
+#endif
+			}
+		} else {
+			printk(KERN_ERR "aha152x: io port 0x%x busy.\n", setup[i].io_port);
+		}
+
+#if defined(__ISAPNP__)
+		if( pnpdev[i] )
+			pnp_device_detach(pnpdev[i]);
+#endif
+	}
+
+	return registered_count>0;
+}
+
+static void __exit aha152x_exit(void)
+{
+	int i;
+
+	for(i=0; i<ARRAY_SIZE(setup); i++) {
+		aha152x_release(aha152x_host[i]);
+		aha152x_host[i]=0;
+	}
+}
+
+module_init(aha152x_init);
+module_exit(aha152x_exit);
+
+#if !defined(MODULE)
+static int __init aha152x_setup(char *str)
+{
+#if defined(AHA152X_DEBUG)
+	int ints[11];
+#else
+	int ints[10];
+#endif
+	get_options(str, ARRAY_SIZE(ints), ints);
+
+	if(setup_count>=ARRAY_SIZE(setup)) {
+		printk(KERN_ERR "aha152x: you can only configure up to two controllers\n");
+		return 1;
+	}
+
+	setup[setup_count].conf        = str;
+	setup[setup_count].io_port     = ints[0] >= 1 ? ints[1] : 0x340;
+	setup[setup_count].irq         = ints[0] >= 2 ? ints[2] : 11;
+	setup[setup_count].scsiid      = ints[0] >= 3 ? ints[3] : 7;
+	setup[setup_count].reconnect   = ints[0] >= 4 ? ints[4] : 1;
+	setup[setup_count].parity      = ints[0] >= 5 ? ints[5] : 1;
+	setup[setup_count].synchronous = ints[0] >= 6 ? ints[6] : 1;
+	setup[setup_count].delay       = ints[0] >= 7 ? ints[7] : DELAY_DEFAULT;
+	setup[setup_count].ext_trans   = ints[0] >= 8 ? ints[8] : 0;
+#if defined(AHA152X_DEBUG)
+	setup[setup_count].debug       = ints[0] >= 9 ? ints[9] : DEBUG_DEFAULT;
+	if (ints[0] > 9) {
+		printk(KERN_NOTICE "aha152x: usage: aha152x=<IOBASE>[,<IRQ>[,<SCSI ID>"
+		       "[,<RECONNECT>[,<PARITY>[,<SYNCHRONOUS>[,<DELAY>[,<EXT_TRANS>[,<DEBUG>]]]]]]]]\n");
+#else
+	if (ints[0] > 8) {                                                /*}*/
+		printk(KERN_NOTICE "aha152x: usage: aha152x=<IOBASE>[,<IRQ>[,<SCSI ID>"
+		       "[,<RECONNECT>[,<PARITY>[,<SYNCHRONOUS>[,<DELAY>[,<EXT_TRANS>]]]]]]]\n");
+#endif
+	} else {
+		setup_count++;
+		return 0;
+	}
+
+	return 1;
+}
+__setup("aha152x=", aha152x_setup);
+#endif
+
+#endif /* !PCMCIA */
--- diff/drivers/scsi/aha152x.h	2003-05-21 11:50:00.000000000 +0100
+++ source/drivers/scsi/aha152x.h	2004-02-09 10:39:54.000000000 +0000
@@ -2,14 +2,14 @@
 #define _AHA152X_H
 
 /*
- * $Id: aha152x.h,v 2.5 2002/04/14 11:24:12 fischer Exp $
+ * $Id: aha152x.h,v 2.7 2004/01/24 11:39:03 fischer Exp $
  */
 
 /* number of queueable commands
    (unless we support more than 1 cmd_per_lun this should do) */
 #define AHA152X_MAXQUEUE 7
 
-#define AHA152X_REVID "Adaptec 152x SCSI driver; $Revision: 2.5 $"
+#define AHA152X_REVID "Adaptec 152x SCSI driver; $Revision: 2.7 $"
 
 /* port addresses */
 #define SCSISEQ      (HOSTIOPORT0+0x00)    /* SCSI sequence control */
@@ -331,6 +331,7 @@
 };
 
 struct Scsi_Host *aha152x_probe_one(struct aha152x_setup *);
-int aha152x_host_reset(struct scsi_cmnd *);
+void aha152x_release(struct Scsi_Host *);
+int aha152x_host_reset(Scsi_Cmnd *);
 
 #endif /* _AHA152X_H */
--- diff/drivers/scsi/aha1542.c	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/scsi/aha1542.c	2004-02-09 10:39:54.000000000 +0000
@@ -704,11 +704,14 @@
 #endif
 		int i;
 		ccb[mbo].op = 2;	/* SCSI Initiator Command  w/scatter-gather */
-		SCpnt->host_scribble = (unsigned char *) kmalloc(512, GFP_DMA);
+		SCpnt->host_scribble = (unsigned char *) kmalloc(512, GFP_KERNEL | GFP_DMA);
 		sgpnt = (struct scatterlist *) SCpnt->request_buffer;
 		cptr = (struct chain *) SCpnt->host_scribble;
-		if (cptr == NULL)
-			panic("aha1542.c: unable to allocate DMA memory\n");
+		if (cptr == NULL) {
+			/* free the claimed mailbox slot */
+			HOSTDATA(SCpnt->device->host)->SCint[mbo] = NULL;
+			return SCSI_MLQUEUE_HOST_BUSY;
+		}
 		for (i = 0; i < SCpnt->use_sg; i++) {
 			if (sgpnt[i].length == 0 || SCpnt->use_sg > 16 ||
 			    (((int) sgpnt[i].offset) & 1) || (sgpnt[i].length & 1)) {
--- diff/drivers/scsi/aic7xxx/aic79xx_osm.c	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/scsi/aic7xxx/aic79xx_osm.c	2004-02-09 10:39:54.000000000 +0000
@@ -452,14 +452,14 @@
 "	seltime:<int>		Selection Timeout:\n"
 "				(0/256ms,1/128ms,2/64ms,3/32ms)\n"
 "\n"
-"	Sample /etc/modules.conf line:\n"
+"	Sample /etc/modprobe.conf line:\n"
 "		Enable verbose logging\n"
 "		Set tag depth on Controller 2/Target 2 to 10 tags\n"
 "		Shorten the selection timeout to 128ms\n"
 "\n"
 "	options aic79xx 'aic79xx=verbose.tag_info:{{}.{}.{..10}}.seltime:1'\n"
 "\n"
-"	Sample /etc/modules.conf line:\n"
+"	Sample /etc/modprobe.conf line:\n"
 "		Change Read Streaming for Controller's 2 and 3\n"
 "\n"
 "	options aic79xx 'aic79xx=rd_strm:{..0xFFF0.0xC0F0}'");
--- diff/drivers/scsi/aic7xxx/aic7xxx_osm.c	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/scsi/aic7xxx/aic7xxx_osm.c	2004-02-09 10:39:54.000000000 +0000
@@ -472,7 +472,7 @@
 "	seltime:<int>		Selection Timeout\n"
 "				(0/256ms,1/128ms,2/64ms,3/32ms)\n"
 "\n"
-"	Sample /etc/modules.conf line:\n"
+"	Sample /etc/modprobe.conf line:\n"
 "		Toggle EISA/VLB probing\n"
 "		Set tag depth on Controller 1/Target 1 to 10 tags\n"
 "		Shorten the selection timeout to 128ms\n"
--- diff/drivers/scsi/atp870u.c	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/scsi/atp870u.c	2004-02-09 10:39:54.000000000 +0000
@@ -703,19 +703,19 @@
 			bttl = sg_dma_address(&sgpnt[j]);
 			l = sg_dma_len(&sgpnt[j]);
 			while (l > 0x10000) {
-				(u16) (((u16 *) (prd))[i + 3]) = 0x0000;
-				(u16) (((u16 *) (prd))[i + 2]) = 0x0000;
-				(u32) (((u32 *) (prd))[i >> 1]) = cpu_to_le32(bttl);
+				(((u16 *) (prd))[i + 3]) = 0x0000;
+				(((u16 *) (prd))[i + 2]) = 0x0000;
+				(((u32 *) (prd))[i >> 1]) = cpu_to_le32(bttl);
 				l -= 0x10000;
 				bttl += 0x10000;
 				i += 0x04;
 			}
-			(u32) (((u32 *) (prd))[i >> 1]) = cpu_to_le32(bttl);
-			(u16) (((u16 *) (prd))[i + 2]) = cpu_to_le16(l);
-			(u16) (((u16 *) (prd))[i + 3]) = 0;
+			(((u32 *) (prd))[i >> 1]) = cpu_to_le32(bttl);
+			(((u16 *) (prd))[i + 2]) = cpu_to_le16(l);
+			(((u16 *) (prd))[i + 3]) = 0;
 			i += 0x04;
 		}
-		(u16) (((u16 *) (prd))[i - 1]) = cpu_to_le16(0x8000);
+		(((u16 *) (prd))[i - 1]) = cpu_to_le16(0x8000);
 	} else {
 		/*
 		 *      For a linear request write a chain of blocks
@@ -724,16 +724,16 @@
 		l = workrequ->request_bufflen;
 		i = 0;
 		while (l > 0x10000) {
-			(u16) (((u16 *) (prd))[i + 3]) = 0x0000;
-			(u16) (((u16 *) (prd))[i + 2]) = 0x0000;
-			(u32) (((u32 *) (prd))[i >> 1]) = cpu_to_le32(bttl);
+			(((u16 *) (prd))[i + 3]) = 0x0000;
+			(((u16 *) (prd))[i + 2]) = 0x0000;
+			(((u32 *) (prd))[i >> 1]) = cpu_to_le32(bttl);
 			l -= 0x10000;
 			bttl += 0x10000;
 			i += 0x04;
 		}
-		(u16) (((u16 *) (prd))[i + 3]) = cpu_to_le16(0x8000);
-		(u16) (((u16 *) (prd))[i + 2]) = cpu_to_le16(l);
-		(u32) (((u32 *) (prd))[i >> 1]) = cpu_to_le32(bttl);
+		(((u16 *) (prd))[i + 3]) = cpu_to_le16(0x8000);
+		(((u16 *) (prd))[i + 2]) = cpu_to_le16(l);
+		(((u32 *) (prd))[i >> 1]) = cpu_to_le32(bttl);
 	}
 	tmpcip = tmpcip + 4;
 	dev->id[target_id].prdaddru = dev->id[target_id].prd_phys;
--- diff/drivers/scsi/gdth.c	2003-10-09 09:47:34.000000000 +0100
+++ source/drivers/scsi/gdth.c	2004-02-09 10:39:55.000000000 +0000
@@ -264,7 +264,6 @@
  * Initial revision
  *
  ************************************************************************/
-#ident "$Id: gdth.c,v 1.64 2003/09/17 08:30:26 achim Exp $" 
 
 /* All GDT Disk Array Controllers are fully supported by this driver.
  * This includes the PCI/EISA/ISA SCSI Disk Array Controllers and the
--- diff/drivers/scsi/imm.c	2003-09-17 12:28:09.000000000 +0100
+++ source/drivers/scsi/imm.c	2004-02-09 10:39:55.000000000 +0000
@@ -14,16 +14,15 @@
 #include <linux/config.h>
 
 /* The following #define is to avoid a clash with hosts.c */
-#define IMM_CODE 1
 #define IMM_PROBE_SPP   0x0001
 #define IMM_PROBE_PS2   0x0002
 #define IMM_PROBE_ECR   0x0010
 #define IMM_PROBE_EPP17 0x0100
 #define IMM_PROBE_EPP19 0x0200
 
-void imm_reset_pulse(unsigned int base);
-static int device_check(int host_no);
-
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
 #include <linux/blkdev.h>
 #include <asm/io.h>
 #include <linux/parport.h>
@@ -32,205 +31,86 @@
 #include "hosts.h"
 
 typedef struct {
-    struct pardevice *dev;	/* Parport device entry         */
-    int base;			/* Actual port address          */
-    int base_hi;		/* Hi Base address for ECP-ISA chipset */
-    int mode;			/* Transfer mode                */
-    int host;			/* Host number (for proc)       */
-    Scsi_Cmnd *cur_cmd;		/* Current queued command       */
-    struct work_struct imm_tq;		/* Polling interrupt stuff       */
-    unsigned long jstart;	/* Jiffies at start             */
-    unsigned failed:1;		/* Failure flag                 */
-    unsigned dp:1;		/* Data phase present           */
-    unsigned rd:1;		/* Read data in data phase      */
-    unsigned p_busy:1;		/* Parport sharing busy flag    */
+	struct pardevice *dev;	/* Parport device entry         */
+	int base;		/* Actual port address          */
+	int base_hi;		/* Hi Base address for ECP-ISA chipset */
+	int mode;		/* Transfer mode                */
+	Scsi_Cmnd *cur_cmd;	/* Current queued command       */
+	struct work_struct imm_tq;	/* Polling interrupt stuff       */
+	unsigned long jstart;	/* Jiffies at start             */
+	unsigned failed:1;	/* Failure flag                 */
+	unsigned dp:1;		/* Data phase present           */
+	unsigned rd:1;		/* Read data in data phase      */
+	unsigned wanted:1;	/* Parport sharing busy flag    */
+	wait_queue_head_t *waiting;
+	struct Scsi_Host *host;
+	struct list_head list;
 } imm_struct;
 
-#define IMM_EMPTY \
-{	.base		= -1,		\
-	.mode		= IMM_AUTODETECT,	\
-	.host		= -1,		\
-}
+static void imm_reset_pulse(unsigned int base);
+static int device_check(imm_struct *dev);
 
 #include "imm.h"
-#define NO_HOSTS 4
-static imm_struct imm_hosts[NO_HOSTS] =
-{IMM_EMPTY, IMM_EMPTY, IMM_EMPTY, IMM_EMPTY};
-
-#define IMM_BASE(x)	imm_hosts[(x)].base
-#define IMM_BASE_HI(x)     imm_hosts[(x)].base_hi
 
-int parbus_base[NO_HOSTS] =
-{0x03bc, 0x0378, 0x0278, 0x0000};
-
-void imm_wakeup(void *ref)
+static inline imm_struct *imm_dev(struct Scsi_Host *host)
 {
-    imm_struct *imm_dev = (imm_struct *) ref;
+	return *(imm_struct **)&host->hostdata;
+}
 
-    if (!imm_dev->p_busy)
-	return;
+static spinlock_t arbitration_lock = SPIN_LOCK_UNLOCKED;
 
-    if (parport_claim(imm_dev->dev)) {
-	printk("imm: bug in imm_wakeup\n");
-	return;
-    }
-    imm_dev->p_busy = 0;
-    imm_dev->base = imm_dev->dev->port->base;
-    if (imm_dev->cur_cmd)
-	imm_dev->cur_cmd->SCp.phase++;
-    return;
+static void got_it(imm_struct *dev)
+{
+	dev->base = dev->dev->port->base;
+	if (dev->cur_cmd)
+		dev->cur_cmd->SCp.phase = 1;
+	else
+		wake_up(dev->waiting);
 }
 
-int imm_release(struct Scsi_Host *host)
+static void imm_wakeup(void *ref)
 {
-    int host_no = host->unique_id;
+	imm_struct *dev = (imm_struct *) ref;
+	unsigned long flags;
 
-    printk("Releasing imm%i\n", host_no);
-    scsi_unregister(host);
-    parport_unregister_device(imm_hosts[host_no].dev);
-    return 0;
+	spin_lock_irqsave(&arbitration_lock, flags);
+	if (dev->wanted) {
+		parport_claim(dev->dev);
+		got_it(dev);
+		dev->wanted = 0;
+	}
+	spin_unlock_irqrestore(&arbitration_lock, flags);
 }
 
-static int imm_pb_claim(int host_no)
+static int imm_pb_claim(imm_struct *dev)
 {
-    if (parport_claim(imm_hosts[host_no].dev)) {
-	imm_hosts[host_no].p_busy = 1;
-	return 1;
-    }
-    if (imm_hosts[host_no].cur_cmd)
-	imm_hosts[host_no].cur_cmd->SCp.phase++;
-    return 0;
+	unsigned long flags;
+	int res = 1;
+	spin_lock_irqsave(&arbitration_lock, flags);
+	if (parport_claim(dev->dev) == 0) {
+		got_it(dev);
+		res = 0;
+	}
+	dev->wanted = res;
+	spin_unlock_irqrestore(&arbitration_lock, flags);
+	return res;
 }
 
-#define imm_pb_release(x) parport_release(imm_hosts[(x)].dev)
-
-/***************************************************************************
- *                   Parallel port probing routines                        *
- ***************************************************************************/
-
-static Scsi_Host_Template driver_template = {
-	.proc_name			= "imm",
-	.proc_info			= imm_proc_info,
-	.name				= "Iomega VPI2 (imm) interface",
-	.detect				= imm_detect,
-	.release			= imm_release,
-	.queuecommand			= imm_queuecommand,
-	.eh_abort_handler               = imm_abort,
-	.eh_bus_reset_handler           = imm_reset,
-	.eh_host_reset_handler          = imm_reset, 
-	.bios_param		        = imm_biosparam,
-	.this_id			= 7,
-	.sg_tablesize			= SG_ALL,
-	.cmd_per_lun			= 1,
-	.use_clustering			= ENABLE_CLUSTERING,
-};
-#include  "scsi_module.c"
-
-int imm_detect(Scsi_Host_Template * host)
+static void imm_pb_dismiss(imm_struct *dev)
 {
-    struct Scsi_Host *hreg;
-    int ports;
-    int i, nhosts, try_again;
-    struct parport *pb;
-
-    pb = parport_enumerate();
-
-    printk("imm: Version %s\n", IMM_VERSION);
-    nhosts = 0;
-    try_again = 0;
-
-    if (!pb) {
-	printk("imm: parport reports no devices.\n");
-	return 0;
-    }
-  retry_entry:
-    for (i = 0; pb; i++, pb = pb->next) {
-	int modes, ppb;
-
-	imm_hosts[i].dev =
-	    parport_register_device(pb, "imm", NULL, imm_wakeup,
-				    NULL, 0, (void *) &imm_hosts[i]);
-
-	if (!imm_hosts[i].dev)
-	    continue;
-
-	/* Claim the bus so it remembers what we do to the control
-	 * registers. [ CTR and ECP ]
-	 */
-	if (imm_pb_claim(i)) {
-	    unsigned long now = jiffies;
-	    while (imm_hosts[i].p_busy) {
-		schedule();	/* We are safe to schedule here */
-		if (time_after(jiffies, now + 3 * HZ)) {
-		    printk(KERN_ERR "imm%d: failed to claim parport because a "
-		      "pardevice is owning the port for too longtime!\n",
-			   i);
-		    parport_unregister_device (imm_hosts[i].dev);
-		    return 0;
-		}
-	    }
-	}
-	ppb = IMM_BASE(i) = imm_hosts[i].dev->port->base;
-	IMM_BASE_HI(i) = imm_hosts[i].dev->port->base_hi;
-	w_ctr(ppb, 0x0c);
-	modes = imm_hosts[i].dev->port->modes;
-
-	/* Mode detection works up the chain of speed
-	 * This avoids a nasty if-then-else-if-... tree
-	 */
-	imm_hosts[i].mode = IMM_NIBBLE;
-
-	if (modes & PARPORT_MODE_TRISTATE)
-	    imm_hosts[i].mode = IMM_PS2;
-
-	/* Done configuration */
-	imm_pb_release(i);
-
-	if (imm_init(i)) {
-	    parport_unregister_device(imm_hosts[i].dev);
-	    continue;
-	}
+	unsigned long flags;
+	int wanted;
+	spin_lock_irqsave(&arbitration_lock, flags);
+	wanted = dev->wanted;
+	dev->wanted = 0;
+	spin_unlock_irqrestore(&arbitration_lock, flags);
+	if (!wanted)
+		parport_release(dev->dev);
+}
 
-	/* now the glue ... */
-	switch (imm_hosts[i].mode) {
-	case IMM_NIBBLE:
-	    ports = 3;
-	    break;
-	case IMM_PS2:
-	    ports = 3;
-	    break;
-	case IMM_EPP_8:
-	case IMM_EPP_16:
-	case IMM_EPP_32:
-	    ports = 8;
-	    break;
-	default:		/* Never gets here */
-	    continue;
-	}
-
-	INIT_WORK(&imm_hosts[i].imm_tq, imm_interrupt, &imm_hosts[i]);
-	
-	host->can_queue = IMM_CAN_QUEUE;
-	host->sg_tablesize = imm_sg;
-	hreg = scsi_register(host, 0);
-	if(hreg == NULL)
-		continue;
-	hreg->io_port = pb->base;
-	hreg->n_io_port = ports;
-	hreg->dma_channel = -1;
-	hreg->unique_id = i;
-	imm_hosts[i].host = hreg->host_no;
-	nhosts++;
-    }
-    if (nhosts == 0) {
-	if (try_again == 1) {
-	    return 0;
-	}
-	try_again = 1;
-	goto retry_entry;
-    } else {
-	return 1;		/* return number of hosts detected */
-    }
+static inline void imm_pb_release(imm_struct *dev)
+{
+	parport_release(dev->dev);
 }
 
 /* This is to give the imm driver a way to modify the timings (and other
@@ -240,60 +120,62 @@
  * testing...
  * Also gives a method to use a script to obtain optimum timings (TODO)
  */
-static inline int imm_proc_write(int hostno, char *buffer, int length)
+static inline int imm_proc_write(imm_struct *dev, char *buffer, int length)
 {
-    unsigned long x;
+	unsigned long x;
 
-    if ((length > 5) && (strncmp(buffer, "mode=", 5) == 0)) {
-	x = simple_strtoul(buffer + 5, NULL, 0);
-	imm_hosts[hostno].mode = x;
-	return length;
-    }
-    printk("imm /proc: invalid variable\n");
-    return (-EINVAL);
+	if ((length > 5) && (strncmp(buffer, "mode=", 5) == 0)) {
+		x = simple_strtoul(buffer + 5, NULL, 0);
+		dev->mode = x;
+		return length;
+	}
+	printk("imm /proc: invalid variable\n");
+	return (-EINVAL);
 }
 
-int imm_proc_info(struct Scsi_Host *host, char *buffer, char **start, off_t offset,
-		  int length, int inout)
+static int imm_proc_info(struct Scsi_Host *host, char *buffer, char **start,
+			off_t offset, int length, int inout)
 {
-    int i;
-    int len = 0;
-
-    for (i = 0; i < 4; i++)
-	if (imm_hosts[i].host == host->host_no)
-	    break;
+	imm_struct *dev = imm_dev(host);
+	int len = 0;
 
-    if (inout)
-	return imm_proc_write(i, buffer, length);
+	if (inout)
+		return imm_proc_write(dev, buffer, length);
 
-    len += sprintf(buffer + len, "Version : %s\n", IMM_VERSION);
-    len += sprintf(buffer + len, "Parport : %s\n", imm_hosts[i].dev->port->name);
-    len += sprintf(buffer + len, "Mode    : %s\n", IMM_MODE_STRING[imm_hosts[i].mode]);
+	len += sprintf(buffer + len, "Version : %s\n", IMM_VERSION);
+	len +=
+	    sprintf(buffer + len, "Parport : %s\n",
+		    dev->dev->port->name);
+	len +=
+	    sprintf(buffer + len, "Mode    : %s\n",
+		    IMM_MODE_STRING[dev->mode]);
 
-    /* Request for beyond end of buffer */
-    if (offset > len)
-	return 0;
+	/* Request for beyond end of buffer */
+	if (offset > len)
+		return 0;
 
-    *start = buffer + offset;
-    len -= offset;
-    if (len > length)
-	len = length;
-    return len;
+	*start = buffer + offset;
+	len -= offset;
+	if (len > length)
+		len = length;
+	return len;
 }
 
 #if IMM_DEBUG > 0
 #define imm_fail(x,y) printk("imm: imm_fail(%i) from %s at line %d\n",\
 	   y, __FUNCTION__, __LINE__); imm_fail_func(x,y);
-static inline void imm_fail_func(int host_no, int error_code)
+static inline void
+imm_fail_func(imm_struct *dev, int error_code)
 #else
-static inline void imm_fail(int host_no, int error_code)
+static inline void
+imm_fail(imm_struct *dev, int error_code)
 #endif
 {
-    /* If we fail a device then we trash status / message bytes */
-    if (imm_hosts[host_no].cur_cmd) {
-	imm_hosts[host_no].cur_cmd->result = error_code << 16;
-	imm_hosts[host_no].failed = 1;
-    }
+	/* If we fail a device then we trash status / message bytes */
+	if (dev->cur_cmd) {
+		dev->cur_cmd->result = error_code << 16;
+		dev->failed = 1;
+	}
 }
 
 /*
@@ -303,96 +185,97 @@
  * doesn't appear to be designed to support interrupts.  We spin on
  * the 0x80 ready bit. 
  */
-static unsigned char imm_wait(int host_no)
+static unsigned char imm_wait(imm_struct *dev)
 {
-    int k;
-    unsigned short ppb = IMM_BASE(host_no);
-    unsigned char r;
-
-    w_ctr(ppb, 0x0c);
-
-    k = IMM_SPIN_TMO;
-    do {
-	r = r_str(ppb);
-	k--;
-	udelay(1);
-    }
-    while (!(r & 0x80) && (k));
+	int k;
+	unsigned short ppb = dev->base;
+	unsigned char r;
 
-    /*
-     * STR register (LPT base+1) to SCSI mapping:
-     *
-     * STR      imm     imm
-     * ===================================
-     * 0x80     S_REQ   S_REQ
-     * 0x40     !S_BSY  (????)
-     * 0x20     !S_CD   !S_CD
-     * 0x10     !S_IO   !S_IO
-     * 0x08     (????)  !S_BSY
-     *
-     * imm      imm     meaning
-     * ==================================
-     * 0xf0     0xb8    Bit mask
-     * 0xc0     0x88    ZIP wants more data
-     * 0xd0     0x98    ZIP wants to send more data
-     * 0xe0     0xa8    ZIP is expecting SCSI command data
-     * 0xf0     0xb8    end of transfer, ZIP is sending status
-     */
-    w_ctr(ppb, 0x04);
-    if (k)
-	return (r & 0xb8);
-
-    /* Counter expired - Time out occurred */
-    imm_fail(host_no, DID_TIME_OUT);
-    printk("imm timeout in imm_wait\n");
-    return 0;			/* command timed out */
+	w_ctr(ppb, 0x0c);
+
+	k = IMM_SPIN_TMO;
+	do {
+		r = r_str(ppb);
+		k--;
+		udelay(1);
+	}
+	while (!(r & 0x80) && (k));
+
+	/*
+	 * STR register (LPT base+1) to SCSI mapping:
+	 *
+	 * STR      imm     imm
+	 * ===================================
+	 * 0x80     S_REQ   S_REQ
+	 * 0x40     !S_BSY  (????)
+	 * 0x20     !S_CD   !S_CD
+	 * 0x10     !S_IO   !S_IO
+	 * 0x08     (????)  !S_BSY
+	 *
+	 * imm      imm     meaning
+	 * ==================================
+	 * 0xf0     0xb8    Bit mask
+	 * 0xc0     0x88    ZIP wants more data
+	 * 0xd0     0x98    ZIP wants to send more data
+	 * 0xe0     0xa8    ZIP is expecting SCSI command data
+	 * 0xf0     0xb8    end of transfer, ZIP is sending status
+	 */
+	w_ctr(ppb, 0x04);
+	if (k)
+		return (r & 0xb8);
+
+	/* Counter expired - Time out occurred */
+	imm_fail(dev, DID_TIME_OUT);
+	printk("imm timeout in imm_wait\n");
+	return 0;		/* command timed out */
 }
 
 static int imm_negotiate(imm_struct * tmp)
 {
-    /*
-     * The following is supposedly the IEEE 1284-1994 negotiate
-     * sequence. I have yet to obtain a copy of the above standard
-     * so this is a bit of a guess...
-     *
-     * A fair chunk of this is based on the Linux parport implementation
-     * of IEEE 1284.
-     *
-     * Return 0 if data available
-     *        1 if no data available
-     */
-
-    unsigned short base = tmp->base;
-    unsigned char a, mode;
-
-    switch (tmp->mode) {
-    case IMM_NIBBLE:
-	mode = 0x00;
-	break;
-    case IMM_PS2:
-	mode = 0x01;
-	break;
-    default:
-	return 0;
-    }
+	/*
+	 * The following is supposedly the IEEE 1284-1994 negotiate
+	 * sequence. I have yet to obtain a copy of the above standard
+	 * so this is a bit of a guess...
+	 *
+	 * A fair chunk of this is based on the Linux parport implementation
+	 * of IEEE 1284.
+	 *
+	 * Return 0 if data available
+	 *        1 if no data available
+	 */
 
-    w_ctr(base, 0x04);
-    udelay(5);
-    w_dtr(base, mode);
-    udelay(100);
-    w_ctr(base, 0x06);
-    udelay(5);
-    a = (r_str(base) & 0x20) ? 0 : 1;
-    udelay(5);
-    w_ctr(base, 0x07);
-    udelay(5);
-    w_ctr(base, 0x06);
-
-    if (a) {
-	printk("IMM: IEEE1284 negotiate indicates no data available.\n");
-	imm_fail(tmp->host, DID_ERROR);
-    }
-    return a;
+	unsigned short base = tmp->base;
+	unsigned char a, mode;
+
+	switch (tmp->mode) {
+	case IMM_NIBBLE:
+		mode = 0x00;
+		break;
+	case IMM_PS2:
+		mode = 0x01;
+		break;
+	default:
+		return 0;
+	}
+
+	w_ctr(base, 0x04);
+	udelay(5);
+	w_dtr(base, mode);
+	udelay(100);
+	w_ctr(base, 0x06);
+	udelay(5);
+	a = (r_str(base) & 0x20) ? 0 : 1;
+	udelay(5);
+	w_ctr(base, 0x07);
+	udelay(5);
+	w_ctr(base, 0x06);
+
+	if (a) {
+		printk
+		    ("IMM: IEEE1284 negotiate indicates no data available.\n");
+		imm_fail(tmp, DID_ERROR);
+	}
+	return a;
 }
 
 /* 
@@ -400,364 +283,346 @@
  */
 static inline void epp_reset(unsigned short ppb)
 {
-    int i;
+	int i;
 
-    i = r_str(ppb);
-    w_str(ppb, i);
-    w_str(ppb, i & 0xfe);
+	i = r_str(ppb);
+	w_str(ppb, i);
+	w_str(ppb, i & 0xfe);
 }
 
 /* 
  * Wait for empty ECP fifo (if we are in ECP fifo mode only)
  */
-static inline void ecp_sync(unsigned short hostno)
+static inline void ecp_sync(imm_struct *dev)
 {
-    int i, ppb_hi=IMM_BASE_HI(hostno);
+	int i, ppb_hi = dev->base_hi;
 
-    if (ppb_hi == 0) return;
+	if (ppb_hi == 0)
+		return;
 
-    if ((r_ecr(ppb_hi) & 0xe0) == 0x60) { /* mode 011 == ECP fifo mode */
-        for (i = 0; i < 100; i++) {
-	    if (r_ecr(ppb_hi) & 0x01)
-	        return;
-	    udelay(5);
+	if ((r_ecr(ppb_hi) & 0xe0) == 0x60) {	/* mode 011 == ECP fifo mode */
+		for (i = 0; i < 100; i++) {
+			if (r_ecr(ppb_hi) & 0x01)
+				return;
+			udelay(5);
+		}
+		printk("imm: ECP sync failed as data still present in FIFO.\n");
 	}
-        printk("imm: ECP sync failed as data still present in FIFO.\n");
-    }
 }
 
 static int imm_byte_out(unsigned short base, const char *buffer, int len)
 {
-    int i;
+	int i;
 
-    w_ctr(base, 0x4);		/* apparently a sane mode */
-    for (i = len >> 1; i; i--) {
-	w_dtr(base, *buffer++);
-	w_ctr(base, 0x5);	/* Drop STROBE low */
-	w_dtr(base, *buffer++);
-	w_ctr(base, 0x0);	/* STROBE high + INIT low */
-    }
-    w_ctr(base, 0x4);		/* apparently a sane mode */
-    return 1;			/* All went well - we hope! */
+	w_ctr(base, 0x4);	/* apparently a sane mode */
+	for (i = len >> 1; i; i--) {
+		w_dtr(base, *buffer++);
+		w_ctr(base, 0x5);	/* Drop STROBE low */
+		w_dtr(base, *buffer++);
+		w_ctr(base, 0x0);	/* STROBE high + INIT low */
+	}
+	w_ctr(base, 0x4);	/* apparently a sane mode */
+	return 1;		/* All went well - we hope! */
 }
 
 static int imm_nibble_in(unsigned short base, char *buffer, int len)
 {
-    unsigned char l;
-    int i;
+	unsigned char l;
+	int i;
 
-    /*
-     * The following is based on documented timing signals
-     */
-    w_ctr(base, 0x4);
-    for (i = len; i; i--) {
-	w_ctr(base, 0x6);
-	l = (r_str(base) & 0xf0) >> 4;
-	w_ctr(base, 0x5);
-	*buffer++ = (r_str(base) & 0xf0) | l;
+	/*
+	 * The following is based on documented timing signals
+	 */
 	w_ctr(base, 0x4);
-    }
-    return 1;			/* All went well - we hope! */
+	for (i = len; i; i--) {
+		w_ctr(base, 0x6);
+		l = (r_str(base) & 0xf0) >> 4;
+		w_ctr(base, 0x5);
+		*buffer++ = (r_str(base) & 0xf0) | l;
+		w_ctr(base, 0x4);
+	}
+	return 1;		/* All went well - we hope! */
 }
 
 static int imm_byte_in(unsigned short base, char *buffer, int len)
 {
-    int i;
+	int i;
 
-    /*
-     * The following is based on documented timing signals
-     */
-    w_ctr(base, 0x4);
-    for (i = len; i; i--) {
-	w_ctr(base, 0x26);
-	*buffer++ = r_dtr(base);
-	w_ctr(base, 0x25);
-    }
-    return 1;			/* All went well - we hope! */
-}
-
-static int imm_out(int host_no, char *buffer, int len)
-{
-    int r;
-    unsigned short ppb = IMM_BASE(host_no);
-
-    r = imm_wait(host_no);
-
-    /*
-     * Make sure that:
-     * a) the SCSI bus is BUSY (device still listening)
-     * b) the device is listening
-     */
-    if ((r & 0x18) != 0x08) {
-	imm_fail(host_no, DID_ERROR);
-	printk("IMM: returned SCSI status %2x\n", r);
-	return 0;
-    }
-    switch (imm_hosts[host_no].mode) {
-    case IMM_EPP_32:
-    case IMM_EPP_16:
-    case IMM_EPP_8:
-	epp_reset(ppb);
-	w_ctr(ppb, 0x4);
+	/*
+	 * The following is based on documented timing signals
+	 */
+	w_ctr(base, 0x4);
+	for (i = len; i; i--) {
+		w_ctr(base, 0x26);
+		*buffer++ = r_dtr(base);
+		w_ctr(base, 0x25);
+	}
+	return 1;		/* All went well - we hope! */
+}
+
+static int imm_out(imm_struct *dev, char *buffer, int len)
+{
+	unsigned short ppb = dev->base;
+	int r = imm_wait(dev);
+
+	/*
+	 * Make sure that:
+	 * a) the SCSI bus is BUSY (device still listening)
+	 * b) the device is listening
+	 */
+	if ((r & 0x18) != 0x08) {
+		imm_fail(dev, DID_ERROR);
+		printk("IMM: returned SCSI status %2x\n", r);
+		return 0;
+	}
+	switch (dev->mode) {
+	case IMM_EPP_32:
+	case IMM_EPP_16:
+	case IMM_EPP_8:
+		epp_reset(ppb);
+		w_ctr(ppb, 0x4);
 #ifdef CONFIG_SCSI_IZIP_EPP16
-	if (!(((long) buffer | len) & 0x01))
-	    outsw(ppb + 4, buffer, len >> 1);
+		if (!(((long) buffer | len) & 0x01))
+			outsw(ppb + 4, buffer, len >> 1);
 #else
-	if (!(((long) buffer | len) & 0x03))
-	    outsl(ppb + 4, buffer, len >> 2);
+		if (!(((long) buffer | len) & 0x03))
+			outsl(ppb + 4, buffer, len >> 2);
 #endif
-	else
-	    outsb(ppb + 4, buffer, len);
-	w_ctr(ppb, 0xc);
-	r = !(r_str(ppb) & 0x01);
-	w_ctr(ppb, 0xc);
-	ecp_sync(host_no);
-	break;
+		else
+			outsb(ppb + 4, buffer, len);
+		w_ctr(ppb, 0xc);
+		r = !(r_str(ppb) & 0x01);
+		w_ctr(ppb, 0xc);
+		ecp_sync(dev);
+		break;
 
-    case IMM_NIBBLE:
-    case IMM_PS2:
-	/* 8 bit output, with a loop */
-	r = imm_byte_out(ppb, buffer, len);
-	break;
-
-    default:
-	printk("IMM: bug in imm_out()\n");
-	r = 0;
-    }
-    return r;
-}
-
-static int imm_in(int host_no, char *buffer, int len)
-{
-    int r;
-    unsigned short ppb = IMM_BASE(host_no);
-
-    r = imm_wait(host_no);
-
-    /*
-     * Make sure that:
-     * a) the SCSI bus is BUSY (device still listening)
-     * b) the device is sending data
-     */
-    if ((r & 0x18) != 0x18) {
-	imm_fail(host_no, DID_ERROR);
-	return 0;
-    }
-    switch (imm_hosts[host_no].mode) {
-    case IMM_NIBBLE:
-	/* 4 bit input, with a loop */
-	r = imm_nibble_in(ppb, buffer, len);
-	w_ctr(ppb, 0xc);
-	break;
+	case IMM_NIBBLE:
+	case IMM_PS2:
+		/* 8 bit output, with a loop */
+		r = imm_byte_out(ppb, buffer, len);
+		break;
+
+	default:
+		printk("IMM: bug in imm_out()\n");
+		r = 0;
+	}
+	return r;
+}
 
-    case IMM_PS2:
-	/* 8 bit input, with a loop */
-	r = imm_byte_in(ppb, buffer, len);
-	w_ctr(ppb, 0xc);
-	break;
+static int imm_in(imm_struct *dev, char *buffer, int len)
+{
+	unsigned short ppb = dev->base;
+	int r = imm_wait(dev);
+
+	/*
+	 * Make sure that:
+	 * a) the SCSI bus is BUSY (device still listening)
+	 * b) the device is sending data
+	 */
+	if ((r & 0x18) != 0x18) {
+		imm_fail(dev, DID_ERROR);
+		return 0;
+	}
+	switch (dev->mode) {
+	case IMM_NIBBLE:
+		/* 4 bit input, with a loop */
+		r = imm_nibble_in(ppb, buffer, len);
+		w_ctr(ppb, 0xc);
+		break;
+
+	case IMM_PS2:
+		/* 8 bit input, with a loop */
+		r = imm_byte_in(ppb, buffer, len);
+		w_ctr(ppb, 0xc);
+		break;
 
-    case IMM_EPP_32:
-    case IMM_EPP_16:
-    case IMM_EPP_8:
-	epp_reset(ppb);
-	w_ctr(ppb, 0x24);
+	case IMM_EPP_32:
+	case IMM_EPP_16:
+	case IMM_EPP_8:
+		epp_reset(ppb);
+		w_ctr(ppb, 0x24);
 #ifdef CONFIG_SCSI_IZIP_EPP16
-	if (!(((long) buffer | len) & 0x01))
-	    insw(ppb + 4, buffer, len >> 1);
+		if (!(((long) buffer | len) & 0x01))
+			insw(ppb + 4, buffer, len >> 1);
 #else
-	if (!(((long) buffer | len) & 0x03))
-	    insl(ppb + 4, buffer, len >> 2);
+		if (!(((long) buffer | len) & 0x03))
+			insl(ppb + 4, buffer, len >> 2);
 #endif
-	else
-	    insb(ppb + 4, buffer, len);
-	w_ctr(ppb, 0x2c);
-	r = !(r_str(ppb) & 0x01);
-	w_ctr(ppb, 0x2c);
-	ecp_sync(host_no);
-	break;
-
-    default:
-	printk("IMM: bug in imm_ins()\n");
-	r = 0;
-	break;
-    }
-    return r;
+		else
+			insb(ppb + 4, buffer, len);
+		w_ctr(ppb, 0x2c);
+		r = !(r_str(ppb) & 0x01);
+		w_ctr(ppb, 0x2c);
+		ecp_sync(dev);
+		break;
+
+	default:
+		printk("IMM: bug in imm_ins()\n");
+		r = 0;
+		break;
+	}
+	return r;
 }
 
 static int imm_cpp(unsigned short ppb, unsigned char b)
 {
-    /*
-     * Comments on udelay values refer to the
-     * Command Packet Protocol (CPP) timing diagram.
-     */
-
-    unsigned char s1, s2, s3;
-    w_ctr(ppb, 0x0c);
-    udelay(2);			/* 1 usec - infinite */
-    w_dtr(ppb, 0xaa);
-    udelay(10);			/* 7 usec - infinite */
-    w_dtr(ppb, 0x55);
-    udelay(10);			/* 7 usec - infinite */
-    w_dtr(ppb, 0x00);
-    udelay(10);			/* 7 usec - infinite */
-    w_dtr(ppb, 0xff);
-    udelay(10);			/* 7 usec - infinite */
-    s1 = r_str(ppb) & 0xb8;
-    w_dtr(ppb, 0x87);
-    udelay(10);			/* 7 usec - infinite */
-    s2 = r_str(ppb) & 0xb8;
-    w_dtr(ppb, 0x78);
-    udelay(10);			/* 7 usec - infinite */
-    s3 = r_str(ppb) & 0x38;
-    /*
-     * Values for b are:
-     * 0000 00aa    Assign address aa to current device
-     * 0010 00aa    Select device aa in EPP Winbond mode
-     * 0010 10aa    Select device aa in EPP mode
-     * 0011 xxxx    Deselect all devices
-     * 0110 00aa    Test device aa
-     * 1101 00aa    Select device aa in ECP mode
-     * 1110 00aa    Select device aa in Compatible mode
-     */
-    w_dtr(ppb, b);
-    udelay(2);			/* 1 usec - infinite */
-    w_ctr(ppb, 0x0c);
-    udelay(10);			/* 7 usec - infinite */
-    w_ctr(ppb, 0x0d);
-    udelay(2);			/* 1 usec - infinite */
-    w_ctr(ppb, 0x0c);
-    udelay(10);			/* 7 usec - infinite */
-    w_dtr(ppb, 0xff);
-    udelay(10);			/* 7 usec - infinite */
-
-    /*
-     * The following table is electrical pin values.
-     * (BSY is inverted at the CTR register)
-     *
-     *       BSY  ACK  POut SEL  Fault
-     * S1    0    X    1    1    1
-     * S2    1    X    0    1    1
-     * S3    L    X    1    1    S
-     *
-     * L => Last device in chain
-     * S => Selected
-     *
-     * Observered values for S1,S2,S3 are:
-     * Disconnect => f8/58/78
-     * Connect    => f8/58/70
-     */
-    if ((s1 == 0xb8) && (s2 == 0x18) && (s3 == 0x30))
-	return 1;		/* Connected */
-    if ((s1 == 0xb8) && (s2 == 0x18) && (s3 == 0x38))
-	return 0;		/* Disconnected */
-
-    return -1;			/* No device present */
-}
-
-static inline int imm_connect(int host_no, int flag)
-{
-    unsigned short ppb = IMM_BASE(host_no);
-
-    imm_cpp(ppb, 0xe0);		/* Select device 0 in compatible mode */
-    imm_cpp(ppb, 0x30);		/* Disconnect all devices */
-
-    if ((imm_hosts[host_no].mode == IMM_EPP_8) ||
-	(imm_hosts[host_no].mode == IMM_EPP_16) ||
-	(imm_hosts[host_no].mode == IMM_EPP_32))
-	return imm_cpp(ppb, 0x28);	/* Select device 0 in EPP mode */
-    return imm_cpp(ppb, 0xe0);	/* Select device 0 in compatible mode */
-}
-
-static void imm_disconnect(int host_no)
-{
-    unsigned short ppb = IMM_BASE(host_no);
-
-    imm_cpp(ppb, 0x30);		/* Disconnect all devices */
-}
-
-static int imm_select(int host_no, int target)
-{
-    int k;
-    unsigned short ppb = IMM_BASE(host_no);
-
-    /*
-     * Firstly we want to make sure there is nothing
-     * holding onto the SCSI bus.
-     */
-    w_ctr(ppb, 0xc);
-
-    k = IMM_SELECT_TMO;
-    do {
-	k--;
-    } while ((r_str(ppb) & 0x08) && (k));
+	/*
+	 * Comments on udelay values refer to the
+	 * Command Packet Protocol (CPP) timing diagram.
+	 */
 
-    if (!k)
-	return 0;
+	unsigned char s1, s2, s3;
+	w_ctr(ppb, 0x0c);
+	udelay(2);		/* 1 usec - infinite */
+	w_dtr(ppb, 0xaa);
+	udelay(10);		/* 7 usec - infinite */
+	w_dtr(ppb, 0x55);
+	udelay(10);		/* 7 usec - infinite */
+	w_dtr(ppb, 0x00);
+	udelay(10);		/* 7 usec - infinite */
+	w_dtr(ppb, 0xff);
+	udelay(10);		/* 7 usec - infinite */
+	s1 = r_str(ppb) & 0xb8;
+	w_dtr(ppb, 0x87);
+	udelay(10);		/* 7 usec - infinite */
+	s2 = r_str(ppb) & 0xb8;
+	w_dtr(ppb, 0x78);
+	udelay(10);		/* 7 usec - infinite */
+	s3 = r_str(ppb) & 0x38;
+	/*
+	 * Values for b are:
+	 * 0000 00aa    Assign address aa to current device
+	 * 0010 00aa    Select device aa in EPP Winbond mode
+	 * 0010 10aa    Select device aa in EPP mode
+	 * 0011 xxxx    Deselect all devices
+	 * 0110 00aa    Test device aa
+	 * 1101 00aa    Select device aa in ECP mode
+	 * 1110 00aa    Select device aa in Compatible mode
+	 */
+	w_dtr(ppb, b);
+	udelay(2);		/* 1 usec - infinite */
+	w_ctr(ppb, 0x0c);
+	udelay(10);		/* 7 usec - infinite */
+	w_ctr(ppb, 0x0d);
+	udelay(2);		/* 1 usec - infinite */
+	w_ctr(ppb, 0x0c);
+	udelay(10);		/* 7 usec - infinite */
+	w_dtr(ppb, 0xff);
+	udelay(10);		/* 7 usec - infinite */
 
-    /*
-     * Now assert the SCSI ID (HOST and TARGET) on the data bus
-     */
-    w_ctr(ppb, 0x4);
-    w_dtr(ppb, 0x80 | (1 << target));
-    udelay(1);
-
-    /*
-     * Deassert SELIN first followed by STROBE
-     */
-    w_ctr(ppb, 0xc);
-    w_ctr(ppb, 0xd);
-
-    /*
-     * ACK should drop low while SELIN is deasserted.
-     * FAULT should drop low when the SCSI device latches the bus.
-     */
-    k = IMM_SELECT_TMO;
-    do {
-	k--;
-    }
-    while (!(r_str(ppb) & 0x08) && (k));
-
-    /*
-     * Place the interface back into a sane state (status mode)
-     */
-    w_ctr(ppb, 0xc);
-    return (k) ? 1 : 0;
-}
-
-static int imm_init(int host_no)
-{
-    int retv;
-
-#if defined(CONFIG_PARPORT) || defined(CONFIG_PARPORT_MODULE)
-    if (imm_pb_claim(host_no))
-	while (imm_hosts[host_no].p_busy)
-	    schedule();		/* We can safe schedule here */
-#endif
-    retv = imm_connect(host_no, 0);
+	/*
+	 * The following table is electrical pin values.
+	 * (BSY is inverted at the CTR register)
+	 *
+	 *       BSY  ACK  POut SEL  Fault
+	 * S1    0    X    1    1    1
+	 * S2    1    X    0    1    1
+	 * S3    L    X    1    1    S
+	 *
+	 * L => Last device in chain
+	 * S => Selected
+	 *
+	 * Observered values for S1,S2,S3 are:
+	 * Disconnect => f8/58/78
+	 * Connect    => f8/58/70
+	 */
+	if ((s1 == 0xb8) && (s2 == 0x18) && (s3 == 0x30))
+		return 1;	/* Connected */
+	if ((s1 == 0xb8) && (s2 == 0x18) && (s3 == 0x38))
+		return 0;	/* Disconnected */
+
+	return -1;		/* No device present */
+}
+
+static inline int imm_connect(imm_struct *dev, int flag)
+{
+	unsigned short ppb = dev->base;
+
+	imm_cpp(ppb, 0xe0);	/* Select device 0 in compatible mode */
+	imm_cpp(ppb, 0x30);	/* Disconnect all devices */
+
+	if ((dev->mode == IMM_EPP_8) ||
+	    (dev->mode == IMM_EPP_16) ||
+	    (dev->mode == IMM_EPP_32))
+		return imm_cpp(ppb, 0x28);	/* Select device 0 in EPP mode */
+	return imm_cpp(ppb, 0xe0);	/* Select device 0 in compatible mode */
+}
+
+static void imm_disconnect(imm_struct *dev)
+{
+	imm_cpp(dev->base, 0x30);	/* Disconnect all devices */
+}
+
+static int imm_select(imm_struct *dev, int target)
+{
+	int k;
+	unsigned short ppb = dev->base;
+
+	/*
+	 * Firstly we want to make sure there is nothing
+	 * holding onto the SCSI bus.
+	 */
+	w_ctr(ppb, 0xc);
 
-    if (retv == 1) {
-	imm_reset_pulse(IMM_BASE(host_no));
-	udelay(1000);		/* Delay to allow devices to settle */
-	imm_disconnect(host_no);
-	udelay(1000);		/* Another delay to allow devices to settle */
-	retv = device_check(host_no);
-	imm_pb_release(host_no);
-	return retv;
-    }
-    imm_pb_release(host_no);
-    return 1;
-}
-
-static inline int imm_send_command(Scsi_Cmnd * cmd)
-{
-    int host_no = cmd->device->host->unique_id;
-    int k;
-
-    /* NOTE: IMM uses byte pairs */
-    for (k = 0; k < cmd->cmd_len; k += 2)
-	if (!imm_out(host_no, &cmd->cmnd[k], 2))
-	    return 0;
-    return 1;
+	k = IMM_SELECT_TMO;
+	do {
+		k--;
+	} while ((r_str(ppb) & 0x08) && (k));
+
+	if (!k)
+		return 0;
+
+	/*
+	 * Now assert the SCSI ID (HOST and TARGET) on the data bus
+	 */
+	w_ctr(ppb, 0x4);
+	w_dtr(ppb, 0x80 | (1 << target));
+	udelay(1);
+
+	/*
+	 * Deassert SELIN first followed by STROBE
+	 */
+	w_ctr(ppb, 0xc);
+	w_ctr(ppb, 0xd);
+
+	/*
+	 * ACK should drop low while SELIN is deasserted.
+	 * FAULT should drop low when the SCSI device latches the bus.
+	 */
+	k = IMM_SELECT_TMO;
+	do {
+		k--;
+	}
+	while (!(r_str(ppb) & 0x08) && (k));
+
+	/*
+	 * Place the interface back into a sane state (status mode)
+	 */
+	w_ctr(ppb, 0xc);
+	return (k) ? 1 : 0;
+}
+
+static int imm_init(imm_struct *dev)
+{
+	if (imm_connect(dev, 0) != 1)
+		return -EIO;
+	imm_reset_pulse(dev->base);
+	udelay(1000);	/* Delay to allow devices to settle */
+	imm_disconnect(dev);
+	udelay(1000);	/* Another delay to allow devices to settle */
+	return device_check(dev);
+}
+
+static inline int imm_send_command(Scsi_Cmnd *cmd)
+{
+	imm_struct *dev = imm_dev(cmd->device->host);
+	int k;
+
+	/* NOTE: IMM uses byte pairs */
+	for (k = 0; k < cmd->cmd_len; k += 2)
+		if (!imm_out(dev, &cmd->cmnd[k], 2))
+			return 0;
+	return 1;
 }
 
 /*
@@ -768,94 +633,99 @@
  * The driver appears to remain stable if we speed up the parallel port
  * i/o in this function, but not elsewhere.
  */
-static int imm_completion(Scsi_Cmnd * cmd)
+static int imm_completion(Scsi_Cmnd *cmd)
 {
-    /* Return codes:
-     * -1     Error
-     *  0     Told to schedule
-     *  1     Finished data transfer
-     */
-    int host_no = cmd->device->host->unique_id;
-    unsigned short ppb = IMM_BASE(host_no);
-    unsigned long start_jiffies = jiffies;
-
-    unsigned char r, v;
-    int fast, bulk, status;
-
-    v = cmd->cmnd[0];
-    bulk = ((v == READ_6) ||
-	    (v == READ_10) ||
-	    (v == WRITE_6) ||
-	    (v == WRITE_10));
-
-    /*
-     * We only get here if the drive is ready to comunicate,
-     * hence no need for a full imm_wait.
-     */
-    w_ctr(ppb, 0x0c);
-    r = (r_str(ppb) & 0xb8);
-
-    /*
-     * while (device is not ready to send status byte)
-     *     loop;
-     */
-    while (r != (unsigned char) 0xb8) {
+	/* Return codes:
+	 * -1     Error
+	 *  0     Told to schedule
+	 *  1     Finished data transfer
+	 */
+	imm_struct *dev = imm_dev(cmd->device->host);
+	unsigned short ppb = dev->base;
+	unsigned long start_jiffies = jiffies;
+
+	unsigned char r, v;
+	int fast, bulk, status;
+
+	v = cmd->cmnd[0];
+	bulk = ((v == READ_6) ||
+		(v == READ_10) || (v == WRITE_6) || (v == WRITE_10));
+
 	/*
-	 * If we have been running for more than a full timer tick
-	 * then take a rest.
+	 * We only get here if the drive is ready to comunicate,
+	 * hence no need for a full imm_wait.
 	 */
-	if (time_after(jiffies, start_jiffies + 1))
-	    return 0;
+	w_ctr(ppb, 0x0c);
+	r = (r_str(ppb) & 0xb8);
 
 	/*
-	 * FAIL if:
-	 * a) Drive status is screwy (!ready && !present)
-	 * b) Drive is requesting/sending more data than expected
-	 */
-	if (((r & 0x88) != 0x88) || (cmd->SCp.this_residual <= 0)) {
-	    imm_fail(host_no, DID_ERROR);
-	    return -1;		/* ERROR_RETURN */
-	}
-	/* determine if we should use burst I/O */
-	if (imm_hosts[host_no].rd == 0) {
-	    fast = (bulk && (cmd->SCp.this_residual >= IMM_BURST_SIZE)) ? IMM_BURST_SIZE : 2;
-	    status = imm_out(host_no, cmd->SCp.ptr, fast);
-	} else {
-	    fast = (bulk && (cmd->SCp.this_residual >= IMM_BURST_SIZE)) ? IMM_BURST_SIZE : 1;
-	    status = imm_in(host_no, cmd->SCp.ptr, fast);
-	}
-
-	cmd->SCp.ptr += fast;
-	cmd->SCp.this_residual -= fast;
-
-	if (!status) {
-	    imm_fail(host_no, DID_BUS_BUSY);
-	    return -1;		/* ERROR_RETURN */
-	}
-	if (cmd->SCp.buffer && !cmd->SCp.this_residual) {
-	    /* if scatter/gather, advance to the next segment */
-	    if (cmd->SCp.buffers_residual--) {
-		cmd->SCp.buffer++;
-		cmd->SCp.this_residual = cmd->SCp.buffer->length;
-		cmd->SCp.ptr = page_address(cmd->SCp.buffer->page) + cmd->SCp.buffer->offset;
+	 * while (device is not ready to send status byte)
+	 *     loop;
+	 */
+	while (r != (unsigned char) 0xb8) {
+		/*
+		 * If we have been running for more than a full timer tick
+		 * then take a rest.
+		 */
+		if (time_after(jiffies, start_jiffies + 1))
+			return 0;
 
 		/*
-		 * Make sure that we transfer even number of bytes
-		 * otherwise it makes imm_byte_out() messy.
+		 * FAIL if:
+		 * a) Drive status is screwy (!ready && !present)
+		 * b) Drive is requesting/sending more data than expected
 		 */
-		if (cmd->SCp.this_residual & 0x01)
-		    cmd->SCp.this_residual++;
-	    }
-	}
-	/* Now check to see if the drive is ready to comunicate */
-	w_ctr(ppb, 0x0c);
-	r = (r_str(ppb) & 0xb8);
+		if (((r & 0x88) != 0x88) || (cmd->SCp.this_residual <= 0)) {
+			imm_fail(dev, DID_ERROR);
+			return -1;	/* ERROR_RETURN */
+		}
+		/* determine if we should use burst I/O */
+		if (dev->rd == 0) {
+			fast = (bulk
+				&& (cmd->SCp.this_residual >=
+				    IMM_BURST_SIZE)) ? IMM_BURST_SIZE : 2;
+			status = imm_out(dev, cmd->SCp.ptr, fast);
+		} else {
+			fast = (bulk
+				&& (cmd->SCp.this_residual >=
+				    IMM_BURST_SIZE)) ? IMM_BURST_SIZE : 1;
+			status = imm_in(dev, cmd->SCp.ptr, fast);
+		}
+
+		cmd->SCp.ptr += fast;
+		cmd->SCp.this_residual -= fast;
 
-	/* If not, drop back down to the scheduler and wait a timer tick */
-	if (!(r & 0x80))
-	    return 0;
-    }
-    return 1;			/* FINISH_RETURN */
+		if (!status) {
+			imm_fail(dev, DID_BUS_BUSY);
+			return -1;	/* ERROR_RETURN */
+		}
+		if (cmd->SCp.buffer && !cmd->SCp.this_residual) {
+			/* if scatter/gather, advance to the next segment */
+			if (cmd->SCp.buffers_residual--) {
+				cmd->SCp.buffer++;
+				cmd->SCp.this_residual =
+				    cmd->SCp.buffer->length;
+				cmd->SCp.ptr =
+				    page_address(cmd->SCp.buffer->page) +
+				    cmd->SCp.buffer->offset;
+
+				/*
+				 * Make sure that we transfer even number of bytes
+				 * otherwise it makes imm_byte_out() messy.
+				 */
+				if (cmd->SCp.this_residual & 0x01)
+					cmd->SCp.this_residual++;
+			}
+		}
+		/* Now check to see if the drive is ready to comunicate */
+		w_ctr(ppb, 0x0c);
+		r = (r_str(ppb) & 0xb8);
+
+		/* If not, drop back down to the scheduler and wait a timer tick */
+		if (!(r & 0x80))
+			return 0;
+	}
+	return 1;		/* FINISH_RETURN */
 }
 
 /*
@@ -865,226 +735,229 @@
  */
 static void imm_interrupt(void *data)
 {
-    imm_struct *tmp = (imm_struct *) data;
-    Scsi_Cmnd *cmd = tmp->cur_cmd;
-    struct Scsi_Host *host = cmd->device->host;
-    unsigned long flags;
-
-    if (!cmd) {
-	printk("IMM: bug in imm_interrupt\n");
-	return;
-    }
-    if (imm_engine(tmp, cmd)) {
-	INIT_WORK(&tmp->imm_tq, imm_interrupt, (void *)tmp);
-	schedule_delayed_work(&tmp->imm_tq, 1);
-	return;
-    }
-    /* Command must of completed hence it is safe to let go... */
+	imm_struct *dev = (imm_struct *) data;
+	Scsi_Cmnd *cmd = dev->cur_cmd;
+	struct Scsi_Host *host = cmd->device->host;
+	unsigned long flags;
+
+	if (!cmd) {
+		printk("IMM: bug in imm_interrupt\n");
+		return;
+	}
+	if (imm_engine(dev, cmd)) {
+		INIT_WORK(&dev->imm_tq, imm_interrupt, (void *) dev);
+		schedule_delayed_work(&dev->imm_tq, 1);
+		return;
+	}
+	/* Command must of completed hence it is safe to let go... */
 #if IMM_DEBUG > 0
-    switch ((cmd->result >> 16) & 0xff) {
-    case DID_OK:
-	break;
-    case DID_NO_CONNECT:
-	printk("imm: no device at SCSI ID %i\n", cmd->target);
-	break;
-    case DID_BUS_BUSY:
-	printk("imm: BUS BUSY - EPP timeout detected\n");
-	break;
-    case DID_TIME_OUT:
-	printk("imm: unknown timeout\n");
-	break;
-    case DID_ABORT:
-	printk("imm: told to abort\n");
-	break;
-    case DID_PARITY:
-	printk("imm: parity error (???)\n");
-	break;
-    case DID_ERROR:
-	printk("imm: internal driver error\n");
-	break;
-    case DID_RESET:
-	printk("imm: told to reset device\n");
-	break;
-    case DID_BAD_INTR:
-	printk("imm: bad interrupt (???)\n");
-	break;
-    default:
-	printk("imm: bad return code (%02x)\n", (cmd->result >> 16) & 0xff);
-    }
+	switch ((cmd->result >> 16) & 0xff) {
+	case DID_OK:
+		break;
+	case DID_NO_CONNECT:
+		printk("imm: no device at SCSI ID %i\n", cmd->target);
+		break;
+	case DID_BUS_BUSY:
+		printk("imm: BUS BUSY - EPP timeout detected\n");
+		break;
+	case DID_TIME_OUT:
+		printk("imm: unknown timeout\n");
+		break;
+	case DID_ABORT:
+		printk("imm: told to abort\n");
+		break;
+	case DID_PARITY:
+		printk("imm: parity error (???)\n");
+		break;
+	case DID_ERROR:
+		printk("imm: internal driver error\n");
+		break;
+	case DID_RESET:
+		printk("imm: told to reset device\n");
+		break;
+	case DID_BAD_INTR:
+		printk("imm: bad interrupt (???)\n");
+		break;
+	default:
+		printk("imm: bad return code (%02x)\n",
+		       (cmd->result >> 16) & 0xff);
+	}
 #endif
 
-    if (cmd->SCp.phase > 1)
-	imm_disconnect(cmd->device->host->unique_id);
-    if (cmd->SCp.phase > 0)
-	imm_pb_release(cmd->device->host->unique_id);
-
-    spin_lock_irqsave(host->host_lock, flags);
-    tmp->cur_cmd = 0;
-    cmd->scsi_done(cmd);
-    spin_unlock_irqrestore(host->host_lock, flags);
-    return;
-}
-
-static int imm_engine(imm_struct * tmp, Scsi_Cmnd * cmd)
-{
-    int host_no = cmd->device->host->unique_id;
-    unsigned short ppb = IMM_BASE(host_no);
-    unsigned char l = 0, h = 0;
-    int retv, x;
-
-    /* First check for any errors that may have occurred
-     * Here we check for internal errors
-     */
-    if (tmp->failed)
-	return 0;
+	if (cmd->SCp.phase > 1)
+		imm_disconnect(dev);
 
-    switch (cmd->SCp.phase) {
-    case 0:			/* Phase 0 - Waiting for parport */
-	if ((jiffies - tmp->jstart) > HZ) {
-	    /*
-	     * We waited more than a second
-	     * for parport to call us
-	     */
-	    imm_fail(host_no, DID_BUS_BUSY);
-	    return 0;
-	}
-	return 1;		/* wait until imm_wakeup claims parport */
-	/* Phase 1 - Connected */
-    case 1:
-	imm_connect(host_no, CONNECT_EPP_MAYBE);
-	cmd->SCp.phase++;
-
-	/* Phase 2 - We are now talking to the scsi bus */
-    case 2:
-	if (!imm_select(host_no, cmd->device->id)) {
-	    imm_fail(host_no, DID_NO_CONNECT);
-	    return 0;
-	}
-	cmd->SCp.phase++;
-
-	/* Phase 3 - Ready to accept a command */
-    case 3:
-	w_ctr(ppb, 0x0c);
-	if (!(r_str(ppb) & 0x80))
-	    return 1;
+	imm_pb_dismiss(dev);
 
-	if (!imm_send_command(cmd))
-	    return 0;
-	cmd->SCp.phase++;
-
-	/* Phase 4 - Setup scatter/gather buffers */
-    case 4:
-	if (cmd->use_sg) {
-	    /* if many buffers are available, start filling the first */
-	    cmd->SCp.buffer = (struct scatterlist *) cmd->request_buffer;
-	    cmd->SCp.this_residual = cmd->SCp.buffer->length;
-	    cmd->SCp.ptr = page_address(cmd->SCp.buffer->page) + cmd->SCp.buffer->offset;
-	} else {
-	    /* else fill the only available buffer */
-	    cmd->SCp.buffer = NULL;
-	    cmd->SCp.this_residual = cmd->request_bufflen;
-	    cmd->SCp.ptr = cmd->request_buffer;
-	}
-	cmd->SCp.buffers_residual = cmd->use_sg - 1;
-	cmd->SCp.phase++;
-	if (cmd->SCp.this_residual & 0x01)
-	    cmd->SCp.this_residual++;
-	/* Phase 5 - Pre-Data transfer stage */
-    case 5:
-	/* Spin lock for BUSY */
-	w_ctr(ppb, 0x0c);
-	if (!(r_str(ppb) & 0x80))
-	    return 1;
+	spin_lock_irqsave(host->host_lock, flags);
+	dev->cur_cmd = 0;
+	cmd->scsi_done(cmd);
+	spin_unlock_irqrestore(host->host_lock, flags);
+	return;
+}
 
-	/* Require negotiation for read requests */
-	x = (r_str(ppb) & 0xb8);
-	tmp->rd = (x & 0x10) ? 1 : 0;
-	tmp->dp = (x & 0x20) ? 0 : 1;
+static int imm_engine(imm_struct *dev, Scsi_Cmnd *cmd)
+{
+	unsigned short ppb = dev->base;
+	unsigned char l = 0, h = 0;
+	int retv, x;
 
-	if ((tmp->dp) && (tmp->rd))
-	    if (imm_negotiate(tmp))
+	/* First check for any errors that may have occurred
+	 * Here we check for internal errors
+	 */
+	if (dev->failed)
 		return 0;
-	cmd->SCp.phase++;
 
-	/* Phase 6 - Data transfer stage */
-    case 6:
-	/* Spin lock for BUSY */
-	w_ctr(ppb, 0x0c);
-	if (!(r_str(ppb) & 0x80))
-	    return 1;
+	switch (cmd->SCp.phase) {
+	case 0:		/* Phase 0 - Waiting for parport */
+		if (time_after(jiffies, dev->jstart + HZ)) {
+			/*
+			 * We waited more than a second
+			 * for parport to call us
+			 */
+			imm_fail(dev, DID_BUS_BUSY);
+			return 0;
+		}
+		return 1;	/* wait until imm_wakeup claims parport */
+		/* Phase 1 - Connected */
+	case 1:
+		imm_connect(dev, CONNECT_EPP_MAYBE);
+		cmd->SCp.phase++;
+
+		/* Phase 2 - We are now talking to the scsi bus */
+	case 2:
+		if (!imm_select(dev, cmd->device->id)) {
+			imm_fail(dev, DID_NO_CONNECT);
+			return 0;
+		}
+		cmd->SCp.phase++;
 
-	if (tmp->dp) {
-	    retv = imm_completion(cmd);
-	    if (retv == -1)
-		return 0;
-	    if (retv == 0)
-		return 1;
-	}
-	cmd->SCp.phase++;
+		/* Phase 3 - Ready to accept a command */
+	case 3:
+		w_ctr(ppb, 0x0c);
+		if (!(r_str(ppb) & 0x80))
+			return 1;
+
+		if (!imm_send_command(cmd))
+			return 0;
+		cmd->SCp.phase++;
+
+		/* Phase 4 - Setup scatter/gather buffers */
+	case 4:
+		if (cmd->use_sg) {
+			/* if many buffers are available, start filling the first */
+			cmd->SCp.buffer =
+			    (struct scatterlist *) cmd->request_buffer;
+			cmd->SCp.this_residual = cmd->SCp.buffer->length;
+			cmd->SCp.ptr =
+			    page_address(cmd->SCp.buffer->page) +
+			    cmd->SCp.buffer->offset;
+		} else {
+			/* else fill the only available buffer */
+			cmd->SCp.buffer = NULL;
+			cmd->SCp.this_residual = cmd->request_bufflen;
+			cmd->SCp.ptr = cmd->request_buffer;
+		}
+		cmd->SCp.buffers_residual = cmd->use_sg - 1;
+		cmd->SCp.phase++;
+		if (cmd->SCp.this_residual & 0x01)
+			cmd->SCp.this_residual++;
+		/* Phase 5 - Pre-Data transfer stage */
+	case 5:
+		/* Spin lock for BUSY */
+		w_ctr(ppb, 0x0c);
+		if (!(r_str(ppb) & 0x80))
+			return 1;
+
+		/* Require negotiation for read requests */
+		x = (r_str(ppb) & 0xb8);
+		dev->rd = (x & 0x10) ? 1 : 0;
+		dev->dp = (x & 0x20) ? 0 : 1;
+
+		if ((dev->dp) && (dev->rd))
+			if (imm_negotiate(dev))
+				return 0;
+		cmd->SCp.phase++;
+
+		/* Phase 6 - Data transfer stage */
+	case 6:
+		/* Spin lock for BUSY */
+		w_ctr(ppb, 0x0c);
+		if (!(r_str(ppb) & 0x80))
+			return 1;
+
+		if (dev->dp) {
+			retv = imm_completion(cmd);
+			if (retv == -1)
+				return 0;
+			if (retv == 0)
+				return 1;
+		}
+		cmd->SCp.phase++;
 
-	/* Phase 7 - Post data transfer stage */
-    case 7:
-	if ((tmp->dp) && (tmp->rd)) {
-	    if ((tmp->mode == IMM_NIBBLE) || (tmp->mode == IMM_PS2)) {
-		w_ctr(ppb, 0x4);
-		w_ctr(ppb, 0xc);
-		w_ctr(ppb, 0xe);
-		w_ctr(ppb, 0x4);
-	    }
-	}
-	cmd->SCp.phase++;
+		/* Phase 7 - Post data transfer stage */
+	case 7:
+		if ((dev->dp) && (dev->rd)) {
+			if ((dev->mode == IMM_NIBBLE) || (dev->mode == IMM_PS2)) {
+				w_ctr(ppb, 0x4);
+				w_ctr(ppb, 0xc);
+				w_ctr(ppb, 0xe);
+				w_ctr(ppb, 0x4);
+			}
+		}
+		cmd->SCp.phase++;
+
+		/* Phase 8 - Read status/message */
+	case 8:
+		/* Check for data overrun */
+		if (imm_wait(dev) != (unsigned char) 0xb8) {
+			imm_fail(dev, DID_ERROR);
+			return 0;
+		}
+		if (imm_negotiate(dev))
+			return 0;
+		if (imm_in(dev, &l, 1)) {	/* read status byte */
+			/* Check for optional message byte */
+			if (imm_wait(dev) == (unsigned char) 0xb8)
+				imm_in(dev, &h, 1);
+			cmd->result = (DID_OK << 16) + (l & STATUS_MASK);
+		}
+		if ((dev->mode == IMM_NIBBLE) || (dev->mode == IMM_PS2)) {
+			w_ctr(ppb, 0x4);
+			w_ctr(ppb, 0xc);
+			w_ctr(ppb, 0xe);
+			w_ctr(ppb, 0x4);
+		}
+		return 0;	/* Finished */
+		break;
 
-	/* Phase 8 - Read status/message */
-    case 8:
-	/* Check for data overrun */
-	if (imm_wait(host_no) != (unsigned char) 0xb8) {
-	    imm_fail(host_no, DID_ERROR);
-	    return 0;
-	}
-	if (imm_negotiate(tmp))
-	    return 0;
-	if (imm_in(host_no, &l, 1)) {	/* read status byte */
-	    /* Check for optional message byte */
-	    if (imm_wait(host_no) == (unsigned char) 0xb8)
-		imm_in(host_no, &h, 1);
-	    cmd->result = (DID_OK << 16) + (l & STATUS_MASK);
-	}
-	if ((tmp->mode == IMM_NIBBLE) || (tmp->mode == IMM_PS2)) {
-	    w_ctr(ppb, 0x4);
-	    w_ctr(ppb, 0xc);
-	    w_ctr(ppb, 0xe);
-	    w_ctr(ppb, 0x4);
-	}
-	return 0;		/* Finished */
-	break;
-
-    default:
-	printk("imm: Invalid scsi phase\n");
-    }
-    return 0;
+	default:
+		printk("imm: Invalid scsi phase\n");
+	}
+	return 0;
 }
 
-int imm_queuecommand(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *))
+static int imm_queuecommand(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *))
 {
-    int host_no = cmd->device->host->unique_id;
+	imm_struct *dev = imm_dev(cmd->device->host);
 
-    if (imm_hosts[host_no].cur_cmd) {
-	printk("IMM: bug in imm_queuecommand\n");
-	return 0;
-    }
-    imm_hosts[host_no].failed = 0;
-    imm_hosts[host_no].jstart = jiffies;
-    imm_hosts[host_no].cur_cmd = cmd;
-    cmd->scsi_done = done;
-    cmd->result = DID_ERROR << 16;	/* default return code */
-    cmd->SCp.phase = 0;		/* bus free */
+	if (dev->cur_cmd) {
+		printk("IMM: bug in imm_queuecommand\n");
+		return 0;
+	}
+	dev->failed = 0;
+	dev->jstart = jiffies;
+	dev->cur_cmd = cmd;
+	cmd->scsi_done = done;
+	cmd->result = DID_ERROR << 16;	/* default return code */
+	cmd->SCp.phase = 0;	/* bus free */
 
-    imm_pb_claim(host_no);
+	INIT_WORK(&dev->imm_tq, imm_interrupt, dev);
+	schedule_work(&dev->imm_tq);
 
-    INIT_WORK(&imm_hosts[host_no].imm_tq, imm_interrupt, imm_hosts + host_no);
-    schedule_work(&imm_hosts[host_no].imm_tq);
+	imm_pb_claim(dev);
 
-    return 0;
+	return 0;
 }
 
 /*
@@ -1093,150 +966,329 @@
  * be done in sd.c.  Even if it gets fixed there, this will still
  * work.
  */
-int imm_biosparam(struct scsi_device *sdev, struct block_device *dev,
-		sector_t capacity, int ip[])
+static int imm_biosparam(struct scsi_device *sdev, struct block_device *dev,
+			 sector_t capacity, int ip[])
 {
-    ip[0] = 0x40;
-    ip[1] = 0x20;
-    ip[2] = ((unsigned long)capacity + 1) / (ip[0] * ip[1]);
-    if (ip[2] > 1024) {
-	ip[0] = 0xff;
-	ip[1] = 0x3f;
-	ip[2] = ((unsigned long)capacity + 1) / (ip[0] * ip[1]);
-    }
-    return 0;
-}
-
-int imm_abort(Scsi_Cmnd * cmd)
-{
-    int host_no = cmd->device->host->unique_id;
-    /*
-     * There is no method for aborting commands since Iomega
-     * have tied the SCSI_MESSAGE line high in the interface
-     */
-
-    switch (cmd->SCp.phase) {
-    case 0:			/* Do not have access to parport */
-    case 1:			/* Have not connected to interface */
-	imm_hosts[host_no].cur_cmd = NULL;	/* Forget the problem */
-	return SUCCESS;
-	break;
-    default:			/* SCSI command sent, can not abort */
-	return FAILED;
-	break;
-    }
+	ip[0] = 0x40;
+	ip[1] = 0x20;
+	ip[2] = ((unsigned long) capacity + 1) / (ip[0] * ip[1]);
+	if (ip[2] > 1024) {
+		ip[0] = 0xff;
+		ip[1] = 0x3f;
+		ip[2] = ((unsigned long) capacity + 1) / (ip[0] * ip[1]);
+	}
+	return 0;
 }
 
-void imm_reset_pulse(unsigned int base)
+static int imm_abort(Scsi_Cmnd *cmd)
 {
-    w_ctr(base, 0x04);
-    w_dtr(base, 0x40);
-    udelay(1);
-    w_ctr(base, 0x0c);
-    w_ctr(base, 0x0d);
-    udelay(50);
-    w_ctr(base, 0x0c);
-    w_ctr(base, 0x04);
+	imm_struct *dev = imm_dev(cmd->device->host);
+	/*
+	 * There is no method for aborting commands since Iomega
+	 * have tied the SCSI_MESSAGE line high in the interface
+	 */
+
+	switch (cmd->SCp.phase) {
+	case 0:		/* Do not have access to parport */
+	case 1:		/* Have not connected to interface */
+		dev->cur_cmd = NULL;	/* Forget the problem */
+		return SUCCESS;
+		break;
+	default:		/* SCSI command sent, can not abort */
+		return FAILED;
+		break;
+	}
+}
+
+static void imm_reset_pulse(unsigned int base)
+{
+	w_ctr(base, 0x04);
+	w_dtr(base, 0x40);
+	udelay(1);
+	w_ctr(base, 0x0c);
+	w_ctr(base, 0x0d);
+	udelay(50);
+	w_ctr(base, 0x0c);
+	w_ctr(base, 0x04);
+}
+
+static int imm_reset(Scsi_Cmnd *cmd)
+{
+	imm_struct *dev = imm_dev(cmd->device->host);
+
+	if (cmd->SCp.phase)
+		imm_disconnect(dev);
+	dev->cur_cmd = NULL;	/* Forget the problem */
+
+	imm_connect(dev, CONNECT_NORMAL);
+	imm_reset_pulse(dev->base);
+	udelay(1000);		/* device settle delay */
+	imm_disconnect(dev);
+	udelay(1000);		/* device settle delay */
+	return SUCCESS;
 }
 
-int imm_reset(Scsi_Cmnd * cmd)
+static int device_check(imm_struct *dev)
 {
-    int host_no = cmd->device->host->unique_id;
+	/* This routine looks for a device and then attempts to use EPP
+	   to send a command. If all goes as planned then EPP is available. */
 
-    if (cmd->SCp.phase)
-	imm_disconnect(host_no);
-    imm_hosts[host_no].cur_cmd = NULL;	/* Forget the problem */
+	static char cmd[6] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
+	int loop, old_mode, status, k, ppb = dev->base;
+	unsigned char l;
+
+	old_mode = dev->mode;
+	for (loop = 0; loop < 8; loop++) {
+		/* Attempt to use EPP for Test Unit Ready */
+		if ((ppb & 0x0007) == 0x0000)
+			dev->mode = IMM_EPP_32;
+
+	      second_pass:
+		imm_connect(dev, CONNECT_EPP_MAYBE);
+		/* Select SCSI device */
+		if (!imm_select(dev, loop)) {
+			imm_disconnect(dev);
+			continue;
+		}
+		printk("imm: Found device at ID %i, Attempting to use %s\n",
+		       loop, IMM_MODE_STRING[dev->mode]);
 
-    imm_connect(host_no, CONNECT_NORMAL);
-    imm_reset_pulse(IMM_BASE(host_no));
-    udelay(1000);		/* device settle delay */
-    imm_disconnect(host_no);
-    udelay(1000);		/* device settle delay */
-    return SUCCESS;
+		/* Send SCSI command */
+		status = 1;
+		w_ctr(ppb, 0x0c);
+		for (l = 0; (l < 3) && (status); l++)
+			status = imm_out(dev, &cmd[l << 1], 2);
+
+		if (!status) {
+			imm_disconnect(dev);
+			imm_connect(dev, CONNECT_EPP_MAYBE);
+			imm_reset_pulse(dev->base);
+			udelay(1000);
+			imm_disconnect(dev);
+			udelay(1000);
+			if (dev->mode == IMM_EPP_32) {
+				dev->mode = old_mode;
+				goto second_pass;
+			}
+			printk("imm: Unable to establish communication\n");
+			return -EIO;
+		}
+		w_ctr(ppb, 0x0c);
+
+		k = 1000000;	/* 1 Second */
+		do {
+			l = r_str(ppb);
+			k--;
+			udelay(1);
+		} while (!(l & 0x80) && (k));
+
+		l &= 0xb8;
+
+		if (l != 0xb8) {
+			imm_disconnect(dev);
+			imm_connect(dev, CONNECT_EPP_MAYBE);
+			imm_reset_pulse(dev->base);
+			udelay(1000);
+			imm_disconnect(dev);
+			udelay(1000);
+			if (dev->mode == IMM_EPP_32) {
+				dev->mode = old_mode;
+				goto second_pass;
+			}
+			printk
+			    ("imm: Unable to establish communication\n");
+			return -EIO;
+		}
+		imm_disconnect(dev);
+		printk
+		    ("imm: Communication established at 0x%x with ID %i using %s\n",
+		     ppb, loop, IMM_MODE_STRING[dev->mode]);
+		imm_connect(dev, CONNECT_EPP_MAYBE);
+		imm_reset_pulse(dev->base);
+		udelay(1000);
+		imm_disconnect(dev);
+		udelay(1000);
+		return 0;
+	}
+	printk("imm: No devices found\n");
+	return -ENODEV;
 }
 
-static int device_check(int host_no)
+static Scsi_Host_Template imm_template = {
+	.module			= THIS_MODULE,
+	.proc_name		= "imm",
+	.proc_info		= imm_proc_info,
+	.name			= "Iomega VPI2 (imm) interface",
+	.queuecommand		= imm_queuecommand,
+	.eh_abort_handler	= imm_abort,
+	.eh_bus_reset_handler	= imm_reset,
+	.eh_host_reset_handler	= imm_reset,
+	.bios_param		= imm_biosparam,
+	.this_id		= 7,
+	.sg_tablesize		= SG_ALL,
+	.cmd_per_lun		= 1,
+	.use_clustering		= ENABLE_CLUSTERING,
+	.can_queue		= 1,
+};
+
+/***************************************************************************
+ *                   Parallel port probing routines                        *
+ ***************************************************************************/
+
+static LIST_HEAD(imm_hosts);
+
+static int __imm_attach(struct parport *pb)
 {
-    /* This routine looks for a device and then attempts to use EPP
-       to send a command. If all goes as planned then EPP is available. */
+	struct Scsi_Host *host;
+	imm_struct *dev;
+	DECLARE_WAIT_QUEUE_HEAD(waiting);
+	DEFINE_WAIT(wait);
+	int ports;
+	int modes, ppb;
+	int err = -ENOMEM;
 
-    static char cmd[6] =
-    {0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
-    int loop, old_mode, status, k, ppb = IMM_BASE(host_no);
-    unsigned char l;
+	init_waitqueue_head(&waiting);
 
-    old_mode = imm_hosts[host_no].mode;
-    for (loop = 0; loop < 8; loop++) {
-	/* Attempt to use EPP for Test Unit Ready */
-	if ((ppb & 0x0007) == 0x0000)
-	    imm_hosts[host_no].mode = IMM_EPP_32;
+	dev = kmalloc(sizeof(imm_struct), GFP_KERNEL);
+	if (!dev)
+		return -ENOMEM;
 
-      second_pass:
-	imm_connect(host_no, CONNECT_EPP_MAYBE);
-	/* Select SCSI device */
-	if (!imm_select(host_no, loop)) {
-	    imm_disconnect(host_no);
-	    continue;
-	}
-	printk("imm: Found device at ID %i, Attempting to use %s\n", loop,
-	       IMM_MODE_STRING[imm_hosts[host_no].mode]);
+	memset(dev, 0, sizeof(dev));
 
-	/* Send SCSI command */
-	status = 1;
-	w_ctr(ppb, 0x0c);
-	for (l = 0; (l < 3) && (status); l++)
-	    status = imm_out(host_no, &cmd[l << 1], 2);
+	dev->base = -1;
+	dev->mode = IMM_AUTODETECT;
+	INIT_LIST_HEAD(&dev->list);
+
+	dev->dev = parport_register_device(pb, "imm", NULL, imm_wakeup,
+						NULL, 0, dev);
+
+	if (!dev->dev)
+		goto out;
 
-	if (!status) {
-            imm_disconnect(host_no);
-            imm_connect(host_no, CONNECT_EPP_MAYBE);
-            imm_reset_pulse(IMM_BASE(host_no));
-            udelay(1000);
-            imm_disconnect(host_no);
-            udelay(1000);
-            if (imm_hosts[host_no].mode == IMM_EPP_32) {
-                imm_hosts[host_no].mode = old_mode;
-                goto second_pass;
-            }
-	    printk("imm: Unable to establish communication, aborting driver load.\n");
-	    return 1;
+
+	/* Claim the bus so it remembers what we do to the control
+	 * registers. [ CTR and ECP ]
+	 */
+	err = -EBUSY;
+	dev->waiting = &waiting;
+	prepare_to_wait(&waiting, &wait, TASK_UNINTERRUPTIBLE);
+	if (imm_pb_claim(dev))
+		schedule_timeout(3 * HZ);
+	if (dev->wanted) {
+		printk(KERN_ERR "imm%d: failed to claim parport because "
+			"a pardevice is owning the port for too long "
+			"time!\n", pb->number);
+		imm_pb_dismiss(dev);
+		dev->waiting = NULL;
+		finish_wait(&waiting, &wait);
+		goto out1;
 	}
+	dev->waiting = NULL;
+	finish_wait(&waiting, &wait);
+	ppb = dev->base = dev->dev->port->base;
+	dev->base_hi = dev->dev->port->base_hi;
 	w_ctr(ppb, 0x0c);
+	modes = dev->dev->port->modes;
 
-	k = 1000000;		/* 1 Second */
-	do {
-	    l = r_str(ppb);
-	    k--;
-	    udelay(1);
-	} while (!(l & 0x80) && (k));
-
-	l &= 0xb8;
-
-	if (l != 0xb8) {
-	    imm_disconnect(host_no);
-	    imm_connect(host_no, CONNECT_EPP_MAYBE);
-	    imm_reset_pulse(IMM_BASE(host_no));
-	    udelay(1000);
-	    imm_disconnect(host_no);
-	    udelay(1000);
-	    if (imm_hosts[host_no].mode == IMM_EPP_32) {
-		imm_hosts[host_no].mode = old_mode;
-		goto second_pass;
-	    }
-	    printk("imm: Unable to establish communication, aborting driver load.\n");
-	    return 1;
-	}
-	imm_disconnect(host_no);
-	printk("imm: Communication established at 0x%x with ID %i using %s\n", ppb, loop,
-	       IMM_MODE_STRING[imm_hosts[host_no].mode]);
-	imm_connect(host_no, CONNECT_EPP_MAYBE);
-	imm_reset_pulse(IMM_BASE(host_no));
-	udelay(1000);
-	imm_disconnect(host_no);
-	udelay(1000);
+	/* Mode detection works up the chain of speed
+	 * This avoids a nasty if-then-else-if-... tree
+	 */
+	dev->mode = IMM_NIBBLE;
+
+	if (modes & PARPORT_MODE_TRISTATE)
+		dev->mode = IMM_PS2;
+
+	/* Done configuration */
+
+	err = imm_init(dev);
+
+	imm_pb_release(dev);
+
+	if (err)
+		goto out1;
+
+	/* now the glue ... */
+	switch (dev->mode) {
+	case IMM_NIBBLE:
+	case IMM_PS2:
+		ports = 3;
+		break;
+	case IMM_EPP_8:
+	case IMM_EPP_16:
+	case IMM_EPP_32:
+		ports = 8;
+		break;
+	default:	/* Never gets here */
+		BUG();
+	}
+
+	INIT_WORK(&dev->imm_tq, imm_interrupt, dev);
+
+	err = -ENOMEM;
+	host = scsi_host_alloc(&imm_template, sizeof(imm_struct *));
+	if (!host)
+		goto out1;
+	host->io_port = pb->base;
+	host->n_io_port = ports;
+	host->dma_channel = -1;
+	host->unique_id = pb->number;
+	*(imm_struct **)&host->hostdata = dev;
+	dev->host = host;
+	list_add_tail(&dev->list, &imm_hosts);
+	err = scsi_add_host(host, NULL);
+	if (err)
+		goto out2;
+	scsi_scan_host(host);
 	return 0;
-    }
-    printk("imm: No devices found, aborting driver load.\n");
-    return 1;
+
+out2:
+	list_del_init(&dev->list);
+	scsi_host_put(host);
+out1:
+	parport_unregister_device(dev->dev);
+out:
+	kfree(dev);
+	return err;
+}
+
+static void imm_attach(struct parport *pb)
+{
+	__imm_attach(pb);
+}
+
+static void imm_detach(struct parport *pb)
+{
+	imm_struct *dev;
+	list_for_each_entry(dev, &imm_hosts, list) {
+		if (dev->dev->port == pb) {
+			list_del_init(&dev->list);
+			scsi_remove_host(dev->host);
+			scsi_host_put(dev->host);
+			parport_unregister_device(dev->dev);
+			kfree(dev);
+			break;
+		}
+	}
 }
+
+static struct parport_driver imm_driver = {
+	.name	= "imm",
+	.attach	= imm_attach,
+	.detach	= imm_detach,
+};
+
+static int __init imm_driver_init(void)
+{
+	printk("imm: Version %s\n", IMM_VERSION);
+	return parport_register_driver(&imm_driver);
+}
+
+static void __exit imm_driver_exit(void)
+{
+	parport_unregister_driver(&imm_driver);
+}
+
+module_init(imm_driver_init);
+module_exit(imm_driver_exit);
+
 MODULE_LICENSE("GPL");
--- diff/drivers/scsi/imm.h	2003-09-30 15:46:17.000000000 +0100
+++ source/drivers/scsi/imm.h	2004-02-09 10:39:55.000000000 +0000
@@ -66,7 +66,6 @@
  */
 /* ------ END OF USER CONFIGURABLE PARAMETERS ----- */
 
-#ifdef IMM_CODE
 #include  <linux/config.h>
 #include  <linux/stddef.h>
 #include  <linux/module.h>
@@ -109,11 +108,7 @@
 	[IMM_UNKNOWN]	 = "Unknown",
 };
 
-/* This is a global option */
-int imm_sg = SG_ALL;		/* enable/disable scatter-gather. */
-
 /* other options */
-#define IMM_CAN_QUEUE   1	/* use "queueing" interface */
 #define IMM_BURST_SIZE	512	/* data burst size */
 #define IMM_SELECT_TMO  500	/* 500 how long to wait for target ? */
 #define IMM_SPIN_TMO    5000	/* 50000 imm_wait loop limiter */
@@ -145,23 +140,5 @@
 #endif
 
 static int imm_engine(imm_struct *, Scsi_Cmnd *);
-static int imm_in(int, char *, int);
-static int imm_init(int);
-static void imm_interrupt(void *);
-static int imm_out(int, char *, int);
-
-#else
-#define imm_release 0
-#endif
-
-int imm_detect(Scsi_Host_Template *);
-const char *imm_info(struct Scsi_Host *);
-int imm_command(Scsi_Cmnd *);
-int imm_queuecommand(Scsi_Cmnd *, void (*done) (Scsi_Cmnd *));
-int imm_abort(Scsi_Cmnd *);
-int imm_reset(Scsi_Cmnd *);
-int imm_proc_info(struct Scsi_Host *, char *, char **, off_t, int, int);
-int imm_biosparam(struct scsi_device *, struct block_device *,
-		sector_t, int *);
 
 #endif				/* _IMM_H */
--- diff/drivers/scsi/mac53c94.c	2003-08-20 14:16:31.000000000 +0100
+++ source/drivers/scsi/mac53c94.c	2004-02-09 10:39:55.000000000 +0000
@@ -23,6 +23,7 @@
 #include <asm/prom.h>
 #include <asm/system.h>
 #include <asm/pci-bridge.h>
+#include <asm/macio.h>
 
 #include "scsi.h"
 #include "hosts.h"
@@ -37,13 +38,12 @@
 };
 
 struct fsc_state {
-	volatile struct	mac53c94_regs *regs;
+	struct	mac53c94_regs *regs;
 	int	intr;
-	volatile struct	dbdma_regs *dma;
+	struct	dbdma_regs *dma;
 	int	dmaintr;
 	int	clk_freq;
 	struct	Scsi_Host *host;
-	struct	fsc_state *next;
 	Scsi_Cmnd *request_q;
 	Scsi_Cmnd *request_qtail;
 	Scsi_Cmnd *current_req;		/* req we're currently working on */
@@ -52,151 +52,23 @@
 	void	*dma_cmd_space;
 	struct	pci_dev *pdev;
 	dma_addr_t dma_addr;
+	struct macio_dev *mdev;
 };
 
-static struct fsc_state *all_53c94s;
-
 static void mac53c94_init(struct fsc_state *);
 static void mac53c94_start(struct fsc_state *);
 static void mac53c94_interrupt(int, void *, struct pt_regs *);
 static irqreturn_t do_mac53c94_interrupt(int, void *, struct pt_regs *);
 static void cmd_done(struct fsc_state *, int result);
 static void set_dma_cmds(struct fsc_state *, Scsi_Cmnd *);
-static int data_goes_out(Scsi_Cmnd *);
-
-int
-mac53c94_detect(Scsi_Host_Template *tp)
-{
-	struct device_node *node;
-	int nfscs;
-	struct fsc_state *state, **prev_statep;
-	struct Scsi_Host *host;
-	void *dma_cmd_space;
-	unsigned char *clkprop;
-	int proplen;
-	struct pci_dev *pdev;
-	u8 pbus, devfn;
-
-	nfscs = 0;
-	prev_statep = &all_53c94s;
-	for (node = find_devices("53c94"); node != 0; node = node->next) {
-		if (node->n_addrs != 2 || node->n_intrs != 2) {
-			printk(KERN_ERR "mac53c94: expected 2 addrs and intrs"
-			       " (got %d/%d) for node %s\n",
-			       node->n_addrs, node->n_intrs, node->full_name);
-			continue;
-		}
-
-		pdev = NULL;
-		if (node->parent != NULL
-		    && !pci_device_from_OF_node(node->parent, &pbus, &devfn))
-			pdev = pci_find_slot(pbus, devfn);
-		if (pdev == NULL) {
-			printk(KERN_ERR "mac53c94: can't find PCI device "
-			       "for %s\n", node->full_name);
-			continue;
-		}
-
-		host = scsi_register(tp, sizeof(struct fsc_state));
-		if (host == NULL)
-			break;
-		host->unique_id = nfscs;
-
-		state = (struct fsc_state *) host->hostdata;
-		if (state == 0) {
-			/* "can't happen" */
-			printk(KERN_ERR "mac53c94: no state for %s?!\n",
-			       node->full_name);
-			scsi_unregister(host);
-			break;
-		}
-		state->host = host;
-		state->pdev = pdev;
-
-		state->regs = (volatile struct mac53c94_regs *)
-			ioremap(node->addrs[0].address, 0x1000);
-		state->intr = node->intrs[0].line;
-		state->dma = (volatile struct dbdma_regs *)
-			ioremap(node->addrs[1].address, 0x1000);
-		state->dmaintr = node->intrs[1].line;
-		if (state->regs == NULL || state->dma == NULL) {
-			printk(KERN_ERR "mac53c94: ioremap failed for %s\n",
-			       node->full_name);
-			if (state->dma != NULL)
-				iounmap(state->dma);
-			if (state->regs != NULL)
-				iounmap(state->regs);
-			scsi_unregister(host);
-			break;
-		}
-
-		clkprop = get_property(node, "clock-frequency", &proplen);
-		if (clkprop == NULL || proplen != sizeof(int)) {
-			printk(KERN_ERR "%s: can't get clock frequency, "
-			       "assuming 25MHz\n", node->full_name);
-			state->clk_freq = 25000000;
-		} else
-			state->clk_freq = *(int *)clkprop;
-
-		/* Space for dma command list: +1 for stop command,
-		   +1 to allow for aligning. */
-		dma_cmd_space = kmalloc((host->sg_tablesize + 2) *
-					sizeof(struct dbdma_cmd), GFP_KERNEL);
-		if (dma_cmd_space == 0) {
-			printk(KERN_ERR "mac53c94: couldn't allocate dma "
-			       "command space for %s\n", node->full_name);
-			goto err_cleanup;
-		}
-		state->dma_cmds = (struct dbdma_cmd *)
-			DBDMA_ALIGN(dma_cmd_space);
-		memset(state->dma_cmds, 0, (host->sg_tablesize + 1)
-		       * sizeof(struct dbdma_cmd));
-		state->dma_cmd_space = dma_cmd_space;
-
-		*prev_statep = state;
-		prev_statep = &state->next;
-
-		if (request_irq(state->intr, do_mac53c94_interrupt, 0,
-				"53C94", state)) {
-			printk(KERN_ERR "mac53C94: can't get irq %d for %s\n",
-			       state->intr, node->full_name);
-		err_cleanup:
-			iounmap(state->dma);
-			iounmap(state->regs);
-			scsi_unregister(host);
-			break;
-		}
-
-		mac53c94_init(state);
-
-		++nfscs;
-	}
-	return nfscs;
-}
-
-int
-mac53c94_release(struct Scsi_Host *host)
-{
-	struct fsc_state *fp = (struct fsc_state *) host->hostdata;
 
-	if (fp == 0)
-		return 0;
-	if (fp->regs)
-		iounmap((void *) fp->regs);
-	if (fp->dma)
-		iounmap((void *) fp->dma);
-	kfree(fp->dma_cmd_space);
-	free_irq(fp->intr, fp);
-	return 0;
-}
 
-int
-mac53c94_queue(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *))
+static int mac53c94_queue(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *))
 {
 	struct fsc_state *state;
 
 #if 0
-	if (data_goes_out(cmd)) {
+	if (cmd->sc_data_direction == SCSI_DATA_WRITE) {
 		int i;
 		printk(KERN_DEBUG "mac53c94_queue %p: command is", cmd);
 		for (i = 0; i < cmd->cmd_len; ++i)
@@ -223,60 +95,52 @@
 	return 0;
 }
 
-int
-mac53c94_abort(Scsi_Cmnd *cmd)
+static int mac53c94_abort(Scsi_Cmnd *cmd)
 {
 	return SCSI_ABORT_SNOOZE;
 }
 
-int
-mac53c94_host_reset(Scsi_Cmnd *cmd)
+static int mac53c94_host_reset(Scsi_Cmnd *cmd)
 {
 	struct fsc_state *state = (struct fsc_state *) cmd->device->host->hostdata;
-	volatile struct mac53c94_regs *regs = state->regs;
-	volatile struct dbdma_regs *dma = state->dma;
+	struct mac53c94_regs *regs = state->regs;
+	struct dbdma_regs *dma = state->dma;
 
 	st_le32(&dma->control, (RUN|PAUSE|FLUSH|WAKE) << 16);
-	regs->command = CMD_SCSI_RESET;	/* assert RST */
-	eieio();
+	writeb(CMD_SCSI_RESET, &regs->command);	/* assert RST */
 	udelay(100);			/* leave it on for a while (>= 25us) */
-	regs->command = CMD_RESET;
-	eieio();
+	writeb(CMD_RESET, &regs->command);
 	udelay(20);
 	mac53c94_init(state);
-	regs->command = CMD_NOP;
-	eieio();
+	writeb(CMD_NOP, &regs->command);
 	return SUCCESS;
 }
 
-static void
-mac53c94_init(struct fsc_state *state)
+static void mac53c94_init(struct fsc_state *state)
 {
-	volatile struct mac53c94_regs *regs = state->regs;
-	volatile struct dbdma_regs *dma = state->dma;
+	struct mac53c94_regs *regs = state->regs;
+	struct dbdma_regs *dma = state->dma;
 	int x;
 
-	regs->config1 = state->host->this_id | CF1_PAR_ENABLE;
-	regs->sel_timeout = TIMO_VAL(250);	/* 250ms */
-	regs->clk_factor = CLKF_VAL(state->clk_freq);
-	regs->config2 = CF2_FEATURE_EN;
-	regs->config3 = 0;
-	regs->sync_period = 0;
-	regs->sync_offset = 0;
-	eieio();
-	x = regs->interrupt;
-	st_le32(&dma->control, (RUN|PAUSE|FLUSH|WAKE) << 16);
+	writeb(state->host->this_id | CF1_PAR_ENABLE, &regs->config1);
+	writeb(TIMO_VAL(250), &regs->sel_timeout);	/* 250ms */
+	writeb(CLKF_VAL(state->clk_freq), &regs->clk_factor);
+	writeb(CF2_FEATURE_EN, &regs->config2);
+	writeb(0, &regs->config3);
+	writeb(0, &regs->sync_period);
+	writeb(0, &regs->sync_offset);
+	x = readb(&regs->interrupt);
+	writel((RUN|PAUSE|FLUSH|WAKE) << 16, &dma->control);
 }
 
 /*
  * Start the next command for a 53C94.
  * Should be called with interrupts disabled.
  */
-static void
-mac53c94_start(struct fsc_state *state)
+static void mac53c94_start(struct fsc_state *state)
 {
 	Scsi_Cmnd *cmd;
-	volatile struct mac53c94_regs *regs = state->regs;
+	struct mac53c94_regs *regs = state->regs;
 	int i;
 
 	if (state->phase != idle || state->current_req != NULL)
@@ -287,37 +151,30 @@
 	state->request_q = (Scsi_Cmnd *) cmd->host_scribble;
 
 	/* Off we go */
-	regs->count_lo = 0;
-	regs->count_mid = 0;
-	regs->count_hi = 0;
-	eieio();
-	regs->command = CMD_NOP + CMD_DMA_MODE;
+	writeb(0, &regs->count_lo);
+	writeb(0, &regs->count_mid);
+	writeb(0, &regs->count_hi);
+	writeb(CMD_NOP + CMD_DMA_MODE, &regs->command);
 	udelay(1);
-	eieio();
-	regs->command = CMD_FLUSH;
+	writeb(CMD_FLUSH, &regs->command);
 	udelay(1);
-	eieio();
-	regs->dest_id = cmd->device->id;
-	regs->sync_period = 0;
-	regs->sync_offset = 0;
-	eieio();
+	writeb(cmd->device->id, &regs->dest_id);
+	writeb(0, &regs->sync_period);
+	writeb(0, &regs->sync_offset);
 
 	/* load the command into the FIFO */
-	for (i = 0; i < cmd->cmd_len; ++i) {
-		regs->fifo = cmd->cmnd[i];
-		eieio();
-	}
+	for (i = 0; i < cmd->cmd_len; ++i)
+		writeb(cmd->cmnd[i], &regs->fifo);
 
 	/* do select without ATN XXX */
-	regs->command = CMD_SELECT;
+	writeb(CMD_SELECT, &regs->command);
 	state->phase = selecting;
 
 	if (cmd->use_sg > 0 || cmd->request_bufflen != 0)
 		set_dma_cmds(state, cmd);
 }
 
-static irqreturn_t
-do_mac53c94_interrupt(int irq, void *dev_id, struct pt_regs *ptregs)
+static irqreturn_t do_mac53c94_interrupt(int irq, void *dev_id, struct pt_regs *ptregs)
 {
 	unsigned long flags;
 	struct Scsi_Host *dev = ((struct fsc_state *) dev_id)->current_req->device->host;
@@ -328,12 +185,11 @@
 	return IRQ_HANDLED;
 }
 
-static void
-mac53c94_interrupt(int irq, void *dev_id, struct pt_regs *ptregs)
+static void mac53c94_interrupt(int irq, void *dev_id, struct pt_regs *ptregs)
 {
 	struct fsc_state *state = (struct fsc_state *) dev_id;
-	volatile struct mac53c94_regs *regs = state->regs;
-	volatile struct dbdma_regs *dma = state->dma;
+	struct mac53c94_regs *regs = state->regs;
+	struct dbdma_regs *dma = state->dma;
 	Scsi_Cmnd *cmd = state->current_req;
 	int nb, stat, seq, intr;
 	static int mac53c94_errors;
@@ -343,9 +199,9 @@
 	 * Apparently, reading the interrupt register unlatches
 	 * the status and sequence step registers.
 	 */
-	seq = regs->seqstep;
-	stat = regs->status;
-	intr = regs->interrupt;
+	seq = readb(&regs->seqstep);
+	stat = readb(&regs->status);
+	intr = readb(&regs->interrupt);
 
 #if 0
 	printk(KERN_DEBUG "mac53c94_intr, intr=%x stat=%x seq=%x phase=%d\n",
@@ -355,8 +211,8 @@
 	if (intr & INTR_RESET) {
 		/* SCSI bus was reset */
 		printk(KERN_INFO "external SCSI bus reset detected\n");
-		regs->command = CMD_NOP;
-		st_le32(&dma->control, RUN << 16);	/* stop dma */
+		writeb(CMD_NOP, &regs->command);
+		writel(RUN << 16, &dma->control);	/* stop dma */
 		cmd_done(state, DID_RESET << 16);
 		return;
 	}
@@ -373,8 +229,7 @@
 		       intr, stat, seq, state->phase);
 #endif
 		++mac53c94_errors;
-		regs->command = CMD_NOP + CMD_DMA_MODE;
-		eieio();
+		writeb(CMD_NOP + CMD_DMA_MODE, &regs->command);
 	}
 	if (cmd == 0) {
 		printk(KERN_DEBUG "53c94: interrupt with no command active?\n");
@@ -402,7 +257,7 @@
 			cmd_done(state, DID_ERROR << 16);
 			return;
 		}
-		regs->command = CMD_NOP;
+		writeb(CMD_NOP, &regs->command);
 		/* set DMA controller going if any data to transfer */
 		if ((stat & (STAT_MSG|STAT_CD)) == 0
 		    && (cmd->use_sg > 0 || cmd->request_bufflen != 0)) {
@@ -410,20 +265,17 @@
 			if (nb > 0xfff0)
 				nb = 0xfff0;
 			cmd->SCp.this_residual -= nb;
-			regs->count_lo = nb;
-			regs->count_mid = nb >> 8;
-			eieio();
-			regs->command = CMD_DMA_MODE + CMD_NOP;
-			eieio();
-			st_le32(&dma->cmdptr, virt_to_phys(state->dma_cmds));
-			st_le32(&dma->control, (RUN << 16) | RUN);
-			eieio();
-			regs->command = CMD_DMA_MODE + CMD_XFER_DATA;
+			writeb(nb, &regs->count_lo);
+			writeb(nb >> 8, &regs->count_mid);
+			writeb(CMD_DMA_MODE + CMD_NOP, &regs->command);
+			writel(virt_to_phys(state->dma_cmds), &dma->cmdptr);
+			writel((RUN << 16) | RUN, &dma->control);
+			writeb(CMD_DMA_MODE + CMD_XFER_DATA, &regs->command);
 			state->phase = dataing;
 			break;
 		} else if ((stat & STAT_PHASE) == STAT_CD + STAT_IO) {
 			/* up to status phase already */
-			regs->command = CMD_I_COMPLETE;
+			writeb(CMD_I_COMPLETE, &regs->command);
 			state->phase = completing;
 		} else {
 			printk(KERN_DEBUG "in unexpected phase %x after cmd\n",
@@ -446,18 +298,16 @@
 			if (nb > 0xfff0)
 				nb = 0xfff0;
 			cmd->SCp.this_residual -= nb;
-			regs->count_lo = nb;
-			regs->count_mid = nb >> 8;
-			eieio();
-			regs->command = CMD_DMA_MODE + CMD_NOP;
-			eieio();
-			regs->command = CMD_DMA_MODE + CMD_XFER_DATA;
+			writeb(nb, &regs->count_lo);
+			writeb(nb >> 8, &regs->count_mid);
+			writeb(CMD_DMA_MODE + CMD_NOP, &regs->command);
+			writeb(CMD_DMA_MODE + CMD_XFER_DATA, &regs->command);
 			break;
 		}
 		if ((stat & STAT_PHASE) != STAT_CD + STAT_IO) {
 			printk(KERN_DEBUG "intr %x before data xfer complete\n", intr);
 		}
-		out_le32(&dma->control, RUN << 16);	/* stop dma */
+		writel(RUN << 16, &dma->control);	/* stop dma */
 		dma_dir = scsi_to_pci_dma_dir(cmd->sc_data_direction);
 		if (cmd->use_sg != 0) {
 			pci_unmap_sg(state->pdev,
@@ -468,7 +318,7 @@
 				cmd->request_bufflen, dma_dir);
 		}
 		/* should check dma status */
-		regs->command = CMD_I_COMPLETE;
+		writeb(CMD_I_COMPLETE, &regs->command);
 		state->phase = completing;
 		break;
 	case completing:
@@ -477,10 +327,10 @@
 			cmd_done(state, DID_ERROR << 16);
 			return;
 		}
-		cmd->SCp.Status = regs->fifo; eieio();
-		cmd->SCp.Message = regs->fifo; eieio();
-		cmd->result = 
-		regs->command = CMD_ACCEPT_MSG;
+		cmd->SCp.Status = readb(&regs->fifo);
+		cmd->SCp.Message = readb(&regs->fifo);
+		cmd->result = CMD_ACCEPT_MSG;
+		writeb(CMD_ACCEPT_MSG, &regs->command);
 		state->phase = busfreeing;
 		break;
 	case busfreeing:
@@ -495,8 +345,7 @@
 	}
 }
 
-static void
-cmd_done(struct fsc_state *state, int result)
+static void cmd_done(struct fsc_state *state, int result)
 {
 	Scsi_Cmnd *cmd;
 
@@ -513,8 +362,7 @@
 /*
  * Set up DMA commands for transferring data.
  */
-static void
-set_dma_cmds(struct fsc_state *state, Scsi_Cmnd *cmd)
+static void set_dma_cmds(struct fsc_state *state, Scsi_Cmnd *cmd)
 {
 	int i, dma_cmd, total;
 	struct scatterlist *scl;
@@ -523,7 +371,8 @@
 	u32 dma_len;
 	int dma_dir = scsi_to_pci_dma_dir(cmd->sc_data_direction);
 
-	dma_cmd = data_goes_out(cmd)? OUTPUT_MORE: INPUT_MORE;
+	dma_cmd = cmd->sc_data_direction == SCSI_DATA_WRITE? OUTPUT_MORE:
+		INPUT_MORE;
 	dcmds = state->dma_cmds;
 	if (cmd->use_sg > 0) {
 		int nseg;
@@ -562,63 +411,9 @@
 	cmd->SCp.this_residual = total;
 }
 
-/*
- * Work out whether data will be going out from the host adaptor or into it.
- */
-static int
-data_goes_out(Scsi_Cmnd *cmd)
-{
-	switch (cmd->sc_data_direction) {
-	case SCSI_DATA_WRITE:
-		return 1;
-	case SCSI_DATA_READ:
-		return 0;
-	}
-
-	/* for SCSI_DATA_UNKNOWN or SCSI_DATA_NONE, fall back on the
-	   old method for now... */
-	switch (cmd->cmnd[0]) {
-	case CHANGE_DEFINITION: 
-	case COMPARE:	  
-	case COPY:
-	case COPY_VERIFY:	    
-	case FORMAT_UNIT:	 
-	case LOG_SELECT:
-	case MEDIUM_SCAN:	  
-	case MODE_SELECT:
-	case MODE_SELECT_10:
-	case REASSIGN_BLOCKS: 
-	case RESERVE:
-	case SEARCH_EQUAL:	  
-	case SEARCH_EQUAL_12: 
-	case SEARCH_HIGH:	 
-	case SEARCH_HIGH_12:  
-	case SEARCH_LOW:
-	case SEARCH_LOW_12:
-	case SEND_DIAGNOSTIC: 
-	case SEND_VOLUME_TAG:	     
-	case SET_WINDOW: 
-	case UPDATE_BLOCK:	
-	case WRITE_BUFFER:
- 	case WRITE_6:	
-	case WRITE_10:	
-	case WRITE_12:	  
-	case WRITE_LONG:	
-	case WRITE_LONG_2:      /* alternate code for WRITE_LONG */
-	case WRITE_SAME:	
-	case WRITE_VERIFY:
-	case WRITE_VERIFY_12:
-		return 1;
-	default:
-		return 0;
-	}
-}
-
-static Scsi_Host_Template driver_template = {
+static Scsi_Host_Template mac53c94_template = {
 	.proc_name	= "53c94",
 	.name		= "53C94",
-	.detect		= mac53c94_detect,
-	.release	= mac53c94_release,
 	.queuecommand	= mac53c94_queue,
 	.eh_abort_handler = mac53c94_abort,
 	.eh_host_reset_handler = mac53c94_host_reset,
@@ -629,4 +424,158 @@
 	.use_clustering	= DISABLE_CLUSTERING,
 };
 
-#include "scsi_module.c"
+static int mac53c94_probe(struct macio_dev *mdev, const struct of_match *match)
+{
+	struct device_node *node = macio_get_of_node(mdev);
+	struct pci_dev *pdev = macio_get_pci_dev(mdev);
+	struct fsc_state *state;
+	struct Scsi_Host *host;
+	void *dma_cmd_space;
+	unsigned char *clkprop;
+	int proplen;
+
+	if (macio_resource_count(mdev) != 2 || macio_irq_count(mdev) != 2) {
+		printk(KERN_ERR "mac53c94: expected 2 addrs and intrs (got %d/%d)\n",
+		       node->n_addrs, node->n_intrs);
+		return -ENODEV;
+	}
+
+	if (macio_request_resources(mdev, "mac53c94") != 0) {
+       		printk(KERN_ERR "mac53c94: unable to request memory resources");
+		return -EBUSY;
+	}
+
+       	host = scsi_host_alloc(&mac53c94_template, sizeof(struct fsc_state));
+	if (host == NULL) {
+		printk(KERN_ERR "mac53c94: couldn't register host");
+		goto out_release;
+	}
+
+	state = (struct fsc_state *) host->hostdata;
+	macio_set_drvdata(mdev, state);
+	state->host = host;
+	state->pdev = pdev;
+	state->mdev = mdev;
+
+	state->regs = (struct mac53c94_regs *)
+		ioremap(macio_resource_start(mdev, 0), 0x1000);
+	state->intr = macio_irq(mdev, 0);
+	state->dma = (struct dbdma_regs *)
+		ioremap(macio_resource_start(mdev, 1), 0x1000);
+	state->dmaintr = macio_irq(mdev, 1);
+	if (state->regs == NULL || state->dma == NULL) {
+		printk(KERN_ERR "mac53c94: ioremap failed for %s\n",
+		       node->full_name);
+		goto out_free;
+	}
+
+       	clkprop = get_property(node, "clock-frequency", &proplen);
+       	if (clkprop == NULL || proplen != sizeof(int)) {
+       		printk(KERN_ERR "%s: can't get clock frequency, "
+       		       "assuming 25MHz\n", node->full_name);
+       		state->clk_freq = 25000000;
+       	} else
+       		state->clk_freq = *(int *)clkprop;
+
+       	/* Space for dma command list: +1 for stop command,
+       	 * +1 to allow for aligning.
+	 * XXX FIXME: Use DMA consistent routines
+	 */
+       	dma_cmd_space = kmalloc((host->sg_tablesize + 2) *
+       				sizeof(struct dbdma_cmd), GFP_KERNEL);
+       	if (dma_cmd_space == 0) {
+       		printk(KERN_ERR "mac53c94: couldn't allocate dma "
+       		       "command space for %s\n", node->full_name);
+       		goto out_free;
+       	}
+	state->dma_cmds = (struct dbdma_cmd *)DBDMA_ALIGN(dma_cmd_space);
+	memset(state->dma_cmds, 0, (host->sg_tablesize + 1)
+	       * sizeof(struct dbdma_cmd));
+	state->dma_cmd_space = dma_cmd_space;
+
+	mac53c94_init(state);
+
+	if (request_irq(state->intr, do_mac53c94_interrupt, 0, "53C94", state)) {
+		printk(KERN_ERR "mac53C94: can't get irq %d for %s\n",
+		       state->intr, node->full_name);
+		goto out_free_dma;
+	}
+
+	/* XXX FIXME: handle failure */
+	scsi_add_host(host, &mdev->ofdev.dev);
+	scsi_scan_host(host);
+
+	return 0;
+
+ out_free_dma:
+	kfree(state->dma_cmd_space);
+ out_free:
+	if (state->dma != NULL)
+		iounmap(state->dma);
+	if (state->regs != NULL)
+		iounmap(state->regs);
+	scsi_host_put(host);
+ out_release:
+	macio_release_resources(mdev);
+
+	return  -ENODEV;
+}
+
+static int mac53c94_remove(struct macio_dev *mdev)
+{
+	struct fsc_state *fp = (struct fsc_state *)macio_get_drvdata(mdev);
+	struct Scsi_Host *host = fp->host;
+
+	scsi_remove_host(host);
+
+	free_irq(fp->intr, fp);
+
+	if (fp->regs)
+		iounmap((void *) fp->regs);
+	if (fp->dma)
+		iounmap((void *) fp->dma);
+	kfree(fp->dma_cmd_space);
+
+	scsi_host_put(host);
+
+	macio_release_resources(mdev);
+
+	return 0;
+}
+
+
+static struct of_match mac53c94_match[] = 
+{
+	{
+	.name 		= "53c94",
+	.type		= OF_ANY_MATCH,
+	.compatible	= OF_ANY_MATCH
+	},
+	{},
+};
+
+static struct macio_driver mac53c94_driver = 
+{
+	.name 		= "mac53c94",
+	.match_table	= mac53c94_match,
+	.probe		= mac53c94_probe,
+	.remove		= mac53c94_remove,
+};
+
+
+static int __init init_mac53c94(void)
+{
+	return macio_register_driver(&mac53c94_driver);
+}
+
+static void __exit exit_mac53c94(void)
+{
+	return macio_unregister_driver(&mac53c94_driver);
+}
+
+module_init(init_mac53c94);
+module_exit(exit_mac53c94);
+
+MODULE_DESCRIPTION("PowerMac 53c94 SCSI driver");
+MODULE_AUTHOR("Paul Mackerras <paulus@samba.org>");
+MODULE_LICENSE("GPL");
--- diff/drivers/scsi/mesh.c	2003-08-20 14:16:13.000000000 +0100
+++ source/drivers/scsi/mesh.c	2004-02-09 10:39:55.000000000 +0000
@@ -10,9 +10,13 @@
  * Apr. 21 2002  - BenH		Rework bus reset code for new error handler
  *                              Add delay after initial bus reset
  *                              Add module parameters
+ *
+ * Sep. 27 2003  - BenH		Move to new driver model, fix some write posting
+ *				issues
  * To do:
  * - handle aborts correctly
  * - retry arbitration if lost (unless higher levels do this for us)
+ * - power down the chip when no device is detected
  */
 #include <linux/config.h>
 #include <linux/module.h>
@@ -38,10 +42,7 @@
 #include <asm/machdep.h>
 #include <asm/pmac_feature.h>
 #include <asm/pci-bridge.h>
-#ifdef CONFIG_PMAC_PBOOK
-#include <linux/adb.h>
-#include <linux/pmu.h>
-#endif
+#include <asm/macio.h>
 
 #include "scsi.h"
 #include "hosts.h"
@@ -164,10 +165,12 @@
 	int	last_n_msgout;
 	u8	msgout[16];
 	struct dbdma_cmd *dma_cmds;	/* space for dbdma commands, aligned */
+	dma_addr_t dma_cmd_bus;
+	void	*dma_cmd_space;
+	int	dma_cmd_size;
 	int	clk_freq;
 	struct mesh_target tgts[8];
-	void	*dma_cmd_space;
-	struct device_node *ofnode;
+	struct macio_dev *mdev;
 	struct pci_dev* pdev;
 #ifdef MESH_DBG
 	int	log_ix;
@@ -176,324 +179,124 @@
 #endif
 };
 
-#ifdef MESH_DBG
-
-static void dlog(struct mesh_state *ms, char *fmt, int a);
-static void dumplog(struct mesh_state *ms, int tgt);
-static void dumpslog(struct mesh_state *ms);
-
-#else
-static inline void dlog(struct mesh_state *ms, char *fmt, int a)
-{}
-static inline void dumplog(struct mesh_state *ms, int tgt)
-{}
-static inline void dumpslog(struct mesh_state *ms)
-{}
-
-#endif /* MESH_DBG */
-#define MKWORD(a, b, c, d)	(((a) << 24) + ((b) << 16) + ((c) << 8) + (d))
+/*
+ * Driver is too messy, we need a few prototypes...
+ */
+static void mesh_done(struct mesh_state *ms, int start_next);
+static void mesh_interrupt(int irq, void *dev_id, struct pt_regs *ptregs);
+static void cmd_complete(struct mesh_state *ms);
+static void set_dma_cmds(struct mesh_state *ms, Scsi_Cmnd *cmd);
+static void halt_dma(struct mesh_state *ms);
+static void phase_mismatch(struct mesh_state *ms);
 
-static struct mesh_state *all_meshes;
 
-static void mesh_init(struct mesh_state *);
-static int mesh_notify_reboot(struct notifier_block *, unsigned long, void *);
-static void mesh_dump_regs(struct mesh_state *);
-static void mesh_start(struct mesh_state *);
-static void mesh_start_cmd(struct mesh_state *, Scsi_Cmnd *);
-static void add_sdtr_msg(struct mesh_state *);
-static void set_sdtr(struct mesh_state *, int, int);
-static void start_phase(struct mesh_state *);
-static void get_msgin(struct mesh_state *);
-static int msgin_length(struct mesh_state *);
-static void cmd_complete(struct mesh_state *);
-static void phase_mismatch(struct mesh_state *);
-static void reselected(struct mesh_state *);
-static void handle_reset(struct mesh_state *);
-static void handle_error(struct mesh_state *);
-static void handle_exception(struct mesh_state *);
-static void mesh_interrupt(int, void *, struct pt_regs *);
-static irqreturn_t do_mesh_interrupt(int, void *, struct pt_regs *);
-static void handle_msgin(struct mesh_state *);
-static void mesh_done(struct mesh_state *, int);
-static void mesh_completed(struct mesh_state *, Scsi_Cmnd *);
-static void set_dma_cmds(struct mesh_state *, Scsi_Cmnd *);
-static void halt_dma(struct mesh_state *);
-static int data_goes_out(Scsi_Cmnd *);
-static void do_abort(struct mesh_state *ms);
-static void set_mesh_power(struct mesh_state *ms, int state);
-
-#ifdef CONFIG_PMAC_PBOOK
-static int mesh_notify_sleep(struct pmu_sleep_notifier *self, int when);
-static struct pmu_sleep_notifier mesh_sleep_notifier = {
-	mesh_notify_sleep,
-	SLEEP_LEVEL_BLOCK,
-};
-#endif
+/*
+ * Some debugging & logging routines
+ */
 
-static struct notifier_block mesh_notifier = {
-	mesh_notify_reboot,
-	NULL,
-	0
-};
+#ifdef MESH_DBG
 
-int
-mesh_detect(Scsi_Host_Template *tp)
+static inline u32 readtb(void)
 {
-	struct device_node *mesh;
-	int nmeshes, tgt, *cfp, minper;
-	struct mesh_state *ms, **prev_statep;
-	struct Scsi_Host *mesh_host;
-	void *dma_cmd_space;
-
-	if (_machine == _MACH_Pmac) {
-	    use_active_neg = (find_devices("mac-io") ? 0 : SEQ_ACTIVE_NEG);
-	} else {
-	    /* CHRP mac-io */
-	    use_active_neg = SEQ_ACTIVE_NEG;
-	}
-
-	/* Calculate sync rate from module parameters */
-	if (sync_rate > 10)
-		sync_rate = 10;
-	if (sync_rate > 0) {
-		printk(KERN_INFO "mesh: configured for synchronous %d MB/s\n", sync_rate);
-		mesh_sync_period = 1000 / sync_rate;	/* ns */
-		mesh_sync_offset = 15;
-	} else
-		printk(KERN_INFO "mesh: configured for asynchronous\n");
-
-	nmeshes = 0;
-	prev_statep = &all_meshes;
-	/*
-	 * On powermacs, the MESH node has device_type "mesh".
-	 * On chrp machines, its device_type is "scsi" with
-	 * "chrp,mesh0" as its `compatible' property.
-	 */
-	mesh = find_devices("mesh");
-	if (mesh == 0)
-		mesh = find_compatible_devices("scsi", "chrp,mesh0");
-	for (; mesh != 0; mesh = mesh->next) {
-		u8 pci_bus, pci_devfn;
-		struct pci_dev* pdev = NULL;
-		
-		if (mesh->n_addrs != 2 || mesh->n_intrs != 2) {
-			printk(KERN_ERR "mesh: expected 2 addrs and 2 intrs"
-			       " (got %d,%d)\n", mesh->n_addrs, mesh->n_intrs);
-			continue;
-		}
-		if (mesh->parent != NULL
-		    && pci_device_from_OF_node(mesh->parent, &pci_bus,
-					       &pci_devfn) == 0)
-			pdev = pci_find_slot(pci_bus, pci_devfn);
-		if (pdev == NULL) {
-			printk(KERN_ERR "mesh: Can't locate PCI entry\n");
-			continue;
-		}
+	u32 tb;
 
-		mesh_host = scsi_register(tp, sizeof(struct mesh_state));
-		if (mesh_host == 0) {
-			printk(KERN_ERR "mesh: couldn't register host");
-			continue;
-		}
-		mesh_host->unique_id = nmeshes;
-#if !defined(MODULE)
-		note_scsi_host(mesh, mesh_host);
+#ifdef DBG_USE_TB
+	/* Beware: if you enable this, it will crash on 601s. */
+	asm ("mftb %0" : "=r" (tb) : );
+#else
+	tb = 0;
 #endif
-
-		ms = (struct mesh_state *) mesh_host->hostdata;
-		if (ms == 0)
-			panic("no mesh state");
-		memset(ms, 0, sizeof(*ms));
-		ms->host = mesh_host;
-		ms->ofnode = mesh;
-		ms->pdev = pdev;
-		ms->mesh = (volatile struct mesh_regs *)
-			ioremap(mesh->addrs[0].address, 0x1000);
-		ms->dma = (volatile struct dbdma_regs *)
-			ioremap(mesh->addrs[1].address, 0x1000);
-		ms->meshintr = mesh->intrs[0].line;
-		ms->dmaintr = mesh->intrs[1].line;
-
-		/* Space for dma command list: +1 for stop command,
-		   +1 to allow for aligning. */
-		dma_cmd_space = kmalloc((mesh_host->sg_tablesize + 2) *
-					sizeof(struct dbdma_cmd), GFP_KERNEL);
-		if (dma_cmd_space == 0)
-			panic("mesh: couldn't allocate dma command space");
-		ms->dma_cmds = (struct dbdma_cmd *) DBDMA_ALIGN(dma_cmd_space);
-		memset(ms->dma_cmds, 0, (mesh_host->sg_tablesize + 1)
-		       * sizeof(struct dbdma_cmd));
-		ms->dma_cmd_space = dma_cmd_space;
-
-		ms->current_req = 0;
-		for (tgt = 0; tgt < 8; ++tgt) {
-			ms->tgts[tgt].sdtr_state = do_sdtr;
-			ms->tgts[tgt].sync_params = ASYNC_PARAMS;
-			ms->tgts[tgt].current_req = 0;
-		}
-		*prev_statep = ms;
-		prev_statep = &ms->next;
-
-		if ((cfp = (int *) get_property(mesh, "clock-frequency",
-						NULL))) {
-			ms->clk_freq = *cfp;
-		} else {
-			printk(KERN_INFO "mesh: assuming 50MHz clock frequency\n");
-			ms->clk_freq = 50000000;
-		}
-		/* The maximum sync rate is clock / 5; increase
-		   mesh_sync_period if necessary. */
-		minper = 1000000000 / (ms->clk_freq / 5);	/* ns */
-		if (mesh_sync_period < minper)
-			mesh_sync_period = minper;
-
-		set_mesh_power(ms, 1);
-
-		mesh_init(ms);
-
-		if (request_irq(ms->meshintr, do_mesh_interrupt, 0, "MESH", ms)) {
-			printk(KERN_ERR "MESH: can't get irq %d\n", ms->meshintr);
-		}
-
-		++nmeshes;
-	}
-
-	if ((_machine == _MACH_Pmac) && (nmeshes > 0)) {
-#ifdef CONFIG_PMAC_PBOOK
-		pmu_register_sleep_notifier(&mesh_sleep_notifier);
-#endif /* CONFIG_PMAC_PBOOK */
-		register_reboot_notifier(&mesh_notifier);
-	}
-
-	return nmeshes;
+	return tb;
 }
 
-int
-mesh_release(struct Scsi_Host *host)
+static void dlog(struct mesh_state *ms, char *fmt, int a)
 {
-	struct mesh_state *ms = (struct mesh_state *) host->hostdata;
+	struct mesh_target *tp = &ms->tgts[ms->conn_tgt];
+	struct dbglog *tlp, *slp;
 
-	if (ms == 0)
-		return 0;
-	if (ms->mesh)
-		iounmap((void *) ms->mesh);
-	if (ms->dma)
-		iounmap((void *) ms->dma);
-	kfree(ms->dma_cmd_space);
-	free_irq(ms->meshintr, ms);
-	pmac_call_feature(PMAC_FTR_MESH_ENABLE, ms->ofnode, 0, 0);
-	return 0;
+	tlp = &tp->log[tp->log_ix];
+	slp = &ms->log[ms->log_ix];
+	tlp->fmt = fmt;
+	tlp->tb = readtb();
+	tlp->phase = (ms->msgphase << 4) + ms->phase;
+	tlp->bs0 = ms->mesh->bus_status0;
+	tlp->bs1 = ms->mesh->bus_status1;
+	tlp->tgt = ms->conn_tgt;
+	tlp->d = a;
+	*slp = *tlp;
+	if (++tp->log_ix >= N_DBG_LOG)
+		tp->log_ix = 0;
+	if (tp->n_log < N_DBG_LOG)
+		++tp->n_log;
+	if (++ms->log_ix >= N_DBG_SLOG)
+		ms->log_ix = 0;
+	if (ms->n_log < N_DBG_SLOG)
+		++ms->n_log;
 }
 
-static void
-set_mesh_power(struct mesh_state *ms, int state)
+static void dumplog(struct mesh_state *ms, int t)
 {
-	if (_machine != _MACH_Pmac)
-		return;
-	if (state) {
-		pmac_call_feature(PMAC_FTR_MESH_ENABLE, ms->ofnode, 0, 1);
-		mdelay(200);
-	} else {
-		pmac_call_feature(PMAC_FTR_MESH_ENABLE, ms->ofnode, 0, 0);
-		mdelay(10);
-	}
-}			
+	struct mesh_target *tp = &ms->tgts[t];
+	struct dbglog *lp;
+	int i;
 
-#ifdef CONFIG_PMAC_PBOOK
-/*
- * notify clients before sleep and reset bus afterwards
- */
-int
-mesh_notify_sleep(struct pmu_sleep_notifier *self, int when)
-{
-	struct mesh_state *ms;
-	
-	switch (when) {
-	case PBOOK_SLEEP_REQUEST:
-		/* XXX We should wait for current transactions and queue
-		 * new ones that would be posted beyond this point 
-		 */ 
-		break;
-	case PBOOK_SLEEP_REJECT:
-		break;
-		
-	case PBOOK_SLEEP_NOW:
-		for (ms = all_meshes; ms != 0; ms = ms->next) {
-			unsigned long flags;
-
-			scsi_block_requests(ms->host);
-			spin_lock_irqsave(ms->host->host_lock, flags);
-			while(ms->phase != idle) {
-				spin_unlock_irqrestore(ms->host->host_lock, flags);
-				current->state = TASK_UNINTERRUPTIBLE;
-				schedule_timeout(1);
-				spin_lock_irqsave(ms->host->host_lock, flags);
-			}
-			ms->phase = sleeping;
-			spin_unlock_irqrestore(ms->host->host_lock, flags);
-			disable_irq(ms->meshintr);
-			set_mesh_power(ms, 0);
-		}
-		break;
-	case PBOOK_WAKE:
-		for (ms = all_meshes; ms != 0; ms = ms->next) {
-			unsigned long flags;
-			
-			set_mesh_power(ms, 1);
-			mesh_init(ms);
-			spin_lock_irqsave(ms->host->host_lock, flags);
-			mesh_start(ms);
-			spin_unlock_irqrestore(ms->host->host_lock, flags);
-			enable_irq(ms->meshintr);
-			scsi_unblock_requests(ms->host);
-		}
-		break;
-	}
-	return PBOOK_SLEEP_OK;
+	if (tp->n_log == 0)
+		return;
+	i = tp->log_ix - tp->n_log;
+	if (i < 0)
+		i += N_DBG_LOG;
+	tp->n_log = 0;
+	do {
+		lp = &tp->log[i];
+		printk(KERN_DEBUG "mesh log %d: bs=%.2x%.2x ph=%.2x ",
+		       t, lp->bs1, lp->bs0, lp->phase);
+#ifdef DBG_USE_TB
+		printk("tb=%10u ", lp->tb);
+#endif
+		printk(lp->fmt, lp->d);
+		printk("\n");
+		if (++i >= N_DBG_LOG)
+			i = 0;
+	} while (i != tp->log_ix);
 }
-#endif /* CONFIG_PMAC_PBOOK */
 
-/*
- * Called by midlayer with host locked to queue a new
- * request
- */
-int
-mesh_queue(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *))
+static void dumpslog(struct mesh_state *ms)
 {
-	struct mesh_state *ms;
-
-	cmd->scsi_done = done;
-	cmd->host_scribble = NULL;
-
-	ms = (struct mesh_state *) cmd->device->host->hostdata;
+	struct dbglog *lp;
+	int i;
 
-	if (ms->request_q == NULL)
-		ms->request_q = cmd;
-	else
-		ms->request_qtail->host_scribble = (void *) cmd;
-	ms->request_qtail = cmd;
+	if (ms->n_log == 0)
+		return;
+	i = ms->log_ix - ms->n_log;
+	if (i < 0)
+		i += N_DBG_SLOG;
+	ms->n_log = 0;
+	do {
+		lp = &ms->log[i];
+		printk(KERN_DEBUG "mesh log: bs=%.2x%.2x ph=%.2x t%d ",
+		       lp->bs1, lp->bs0, lp->phase, lp->tgt);
+#ifdef DBG_USE_TB
+		printk("tb=%10u ", lp->tb);
+#endif
+		printk(lp->fmt, lp->d);
+		printk("\n");
+		if (++i >= N_DBG_SLOG)
+			i = 0;
+	} while (i != ms->log_ix);
+}
 
-	if (ms->phase == idle)
-		mesh_start(ms);
+#else
 
-	return 0;
-}
+static inline void dlog(struct mesh_state *ms, char *fmt, int a)
+{}
+static inline void dumplog(struct mesh_state *ms, int tgt)
+{}
+static inline void dumpslog(struct mesh_state *ms)
+{}
 
-/* Todo: here we can at least try to remove the command from the
- * queue if it isn't connected yet, and for pending command, assert
- * ATN until the bus gets freed.
- */
-int
-mesh_abort(Scsi_Cmnd *cmd)
-{
-	struct mesh_state *ms = (struct mesh_state *) cmd->device->host->hostdata;
+#endif /* MESH_DBG */
 
-	printk(KERN_DEBUG "mesh_abort(%p)\n", cmd);
-	mesh_dump_regs(ms);
-	dumplog(ms, cmd->device->id);
-	dumpslog(ms);
-	return SCSI_ABORT_SNOOZE;
-}
+#define MKWORD(a, b, c, d)	(((a) << 24) + ((b) << 16) + ((c) << 8) + (d))
 
 static void
 mesh_dump_regs(struct mesh_state *ms)
@@ -528,79 +331,35 @@
 	}
 }
 
+
 /*
- * Called by the midlayer with the lock held to reset the
- * SCSI host and bus.
- * The midlayer will wait for devices to come back, we don't need
- * to do that ourselves
+ * Flush write buffers on the bus path to the mesh
  */
-int
-mesh_host_reset(Scsi_Cmnd *cmd)
+static inline void mesh_flush_io(volatile struct mesh_regs *mr)
 {
-	struct mesh_state *ms = (struct mesh_state *) cmd->device->host->hostdata;
-	volatile struct mesh_regs *mr = ms->mesh;
-	volatile struct dbdma_regs *md = ms->dma;
-
-	printk(KERN_DEBUG "mesh_host_reset\n");
-
-	/* Reset the controller & dbdma channel */
-	out_le32(&md->control, (RUN|PAUSE|FLUSH|WAKE) << 16);	/* stop dma */
-	out_8(&mr->exception, 0xff);	/* clear all exception bits */
-	out_8(&mr->error, 0xff);	/* clear all error bits */
-	out_8(&mr->sequence, SEQ_RESETMESH);
-	udelay(1);
-	out_8(&mr->intr_mask, INT_ERROR | INT_EXCEPTION | INT_CMDDONE);
-	out_8(&mr->source_id, ms->host->this_id);
-	out_8(&mr->sel_timeout, 25);	/* 250ms */
-	out_8(&mr->sync_params, ASYNC_PARAMS);
-
-	/* Reset the bus */
-	out_8(&mr->bus_status1, BS1_RST);	/* assert RST */
-	udelay(30);			/* leave it on for >= 25us */
-	out_8(&mr->bus_status1, 0);	/* negate RST */
-
-	/* Complete pending commands */
-	handle_reset(ms);
-	
-	return SUCCESS;
+	(void)in_8(&mr->mesh_id);
 }
 
+
 /*
- * If we leave drives set for synchronous transfers (especially
- * CDROMs), and reboot to MacOS, it gets confused, poor thing.
- * So, on reboot we reset the SCSI bus.
+ * Complete a SCSI command
  */
-static int
-mesh_notify_reboot(struct notifier_block *this, unsigned long code, void *x)
+static void mesh_completed(struct mesh_state *ms, Scsi_Cmnd *cmd)
 {
-	struct mesh_state *ms;
-	volatile struct mesh_regs *mr;
-
-	if (code == SYS_DOWN) {
-		printk(KERN_INFO "resetting MESH scsi bus(es)\n");
-		for (ms = all_meshes; ms != 0; ms = ms->next) {
-			mr = ms->mesh;
-			out_8(&mr->intr_mask, 0);
-			out_8(&mr->interrupt,
-			      INT_ERROR | INT_EXCEPTION | INT_CMDDONE);
-			out_8(&mr->bus_status1, BS1_RST);
-			udelay(30);
-			out_8(&mr->bus_status1, 0);
-		}
-	}
-	return NOTIFY_DONE;
+	(*cmd->scsi_done)(cmd);
 }
 
+
 /* Called with  meshinterrupt disabled, initialize the chipset
  * and eventually do the initial bus reset. The lock must not be
  * held since we can schedule.
  */
-static void
-mesh_init(struct mesh_state *ms)
+static void mesh_init(struct mesh_state *ms)
 {
 	volatile struct mesh_regs *mr = ms->mesh;
 	volatile struct dbdma_regs *md = ms->dma;
 
+	mesh_flush_io(mr);
 	udelay(100);
 
 	/* Reset controller */
@@ -608,6 +367,7 @@
 	out_8(&mr->exception, 0xff);	/* clear all exception bits */
 	out_8(&mr->error, 0xff);	/* clear all error bits */
 	out_8(&mr->sequence, SEQ_RESETMESH);
+	mesh_flush_io(mr);
 	udelay(10);
 	out_8(&mr->intr_mask, INT_ERROR | INT_EXCEPTION | INT_CMDDONE);
 	out_8(&mr->source_id, ms->host->this_id);
@@ -619,8 +379,10 @@
 		
 		/* Reset bus */
 		out_8(&mr->bus_status1, BS1_RST);	/* assert RST */
+		mesh_flush_io(mr);
 		udelay(30);			/* leave it on for >= 25us */
 		out_8(&mr->bus_status1, 0);	/* negate RST */
+		mesh_flush_io(mr);
 
 		/* Wait for bus to come back */
 		current->state = TASK_UNINTERRUPTIBLE;
@@ -630,6 +392,7 @@
 	/* Reconfigure controller */
 	out_8(&mr->interrupt, 0xff);	/* clear all interrupt bits */
 	out_8(&mr->sequence, SEQ_FLUSHFIFO);
+	mesh_flush_io(mr);
 	udelay(1);
 	out_8(&mr->sync_params, ASYNC_PARAMS);
 	out_8(&mr->sequence, SEQ_ENBRESEL);
@@ -638,51 +401,15 @@
 	ms->msgphase = msg_none;
 }
 
-/*
- * Start the next command for a MESH.
- * Should be called with interrupts disabled.
- */
-static void
-mesh_start(struct mesh_state *ms)
+
+static void mesh_start_cmd(struct mesh_state *ms, Scsi_Cmnd *cmd)
 {
-	Scsi_Cmnd *cmd, *prev, *next;
-
-	if (ms->phase != idle || ms->current_req != NULL) {
-		printk(KERN_ERR "inappropriate mesh_start (phase=%d, ms=%p)",
-		       ms->phase, ms);
-		return;
-	}
-
-	while (ms->phase == idle) {
-		prev = NULL;
-		for (cmd = ms->request_q; ; cmd = (Scsi_Cmnd *) cmd->host_scribble) {
-			if (cmd == NULL)
-				return;
-			if (ms->tgts[cmd->device->id].current_req == NULL)
-				break;
-			prev = cmd;
-		}
-		next = (Scsi_Cmnd *) cmd->host_scribble;
-		if (prev == NULL)
-			ms->request_q = next;
-		else
-			prev->host_scribble = (void *) next;
-		if (next == NULL)
-			ms->request_qtail = prev;
-
-		mesh_start_cmd(ms, cmd);
-	}
-}
-
-static void
-mesh_start_cmd(struct mesh_state *ms, Scsi_Cmnd *cmd)
-{
-	volatile struct mesh_regs *mr = ms->mesh;
-	int t, id;
+	volatile struct mesh_regs *mr = ms->mesh;
+	int t, id;
 
 	id = cmd->device->id;
 	ms->current_req = cmd;
-	ms->tgts[id].data_goes_out = data_goes_out(cmd);
+	ms->tgts[id].data_goes_out = cmd->sc_data_direction == SCSI_DATA_WRITE;
 	ms->tgts[id].current_req = cmd;
 
 #if 1
@@ -720,9 +447,10 @@
 	     MKWORD(mr->interrupt, mr->exception, mr->error, mr->fifo_count));
 	out_8(&mr->interrupt, INT_CMDDONE);
 	out_8(&mr->sequence, SEQ_ENBRESEL);
+	mesh_flush_io(mr);
 	udelay(1);
 
-	if (mr->bus_status1 & (BS1_BSY | BS1_SEL)) {
+	if (in_8(&mr->bus_status1) & (BS1_BSY | BS1_SEL)) {
 		/*
 		 * Some other device has the bus or is arbitrating for it -
 		 * probably a target which is about to reselect us.
@@ -731,7 +459,7 @@
 		     MKWORD(mr->interrupt, mr->exception,
 			    mr->error, mr->fifo_count));
 		for (t = 100; t > 0; --t) {
-			if ((mr->bus_status1 & (BS1_BSY | BS1_SEL)) == 0)
+			if ((in_8(&mr->bus_status1) & (BS1_BSY | BS1_SEL)) == 0)
 				break;
 			if (in_8(&mr->interrupt) != 0) {
 				dlog(ms, "intr b4 arb, intr/exc/err/fc=%.8x",
@@ -743,7 +471,7 @@
 			}
 			udelay(1);
 		}
-		if (mr->bus_status1 & (BS1_BSY | BS1_SEL)) {
+		if (in_8(&mr->bus_status1) & (BS1_BSY | BS1_SEL)) {
 			/* XXX should try again in a little while */
 			ms->stat = DID_BUS_BUSY;
 			ms->phase = idle;
@@ -792,23 +520,25 @@
 	}
 	dlog(ms, "after arb, intr/exc/err/fc=%.8x",
 	     MKWORD(mr->interrupt, mr->exception, mr->error, mr->fifo_count));
-	if (mr->interrupt == 0 && (mr->bus_status1 & BS1_SEL)
-	    && (mr->bus_status0 & BS0_IO)) {
+	if (in_8(&mr->interrupt) == 0 && (in_8(&mr->bus_status1) & BS1_SEL)
+	    && (in_8(&mr->bus_status0) & BS0_IO)) {
 		/* looks like a reselection - try resetting the mesh */
 		dlog(ms, "resel? after arb, intr/exc/err/fc=%.8x",
 		     MKWORD(mr->interrupt, mr->exception, mr->error, mr->fifo_count));
 		out_8(&mr->sequence, SEQ_RESETMESH);
+		mesh_flush_io(mr);
 		udelay(10);
 		out_8(&mr->interrupt, INT_ERROR | INT_EXCEPTION | INT_CMDDONE);
 		out_8(&mr->intr_mask, INT_ERROR | INT_EXCEPTION | INT_CMDDONE);
 		out_8(&mr->sequence, SEQ_ENBRESEL);
-		for (t = 10; t > 0 && mr->interrupt == 0; --t)
+		mesh_flush_io(mr);
+		for (t = 10; t > 0 && in_8(&mr->interrupt) == 0; --t)
 			udelay(1);
 		dlog(ms, "tried reset after arb, intr/exc/err/fc=%.8x",
 		     MKWORD(mr->interrupt, mr->exception, mr->error, mr->fifo_count));
 #ifndef MESH_MULTIPLE_HOSTS
-		if (mr->interrupt == 0 && (mr->bus_status1 & BS1_SEL)
-		    && (mr->bus_status0 & BS0_IO)) {
+		if (in_8(&mr->interrupt) == 0 && (in_8(&mr->bus_status1) & BS1_SEL)
+		    && (in_8(&mr->bus_status0) & BS0_IO)) {
 			printk(KERN_ERR "mesh: controller not responding"
 			       " to reselection!\n");
 			/*
@@ -822,8 +552,76 @@
 	}
 }
 
-static inline void
-add_sdtr_msg(struct mesh_state *ms)
+/*
+ * Start the next command for a MESH.
+ * Should be called with interrupts disabled.
+ */
+static void mesh_start(struct mesh_state *ms)
+{
+	Scsi_Cmnd *cmd, *prev, *next;
+
+	if (ms->phase != idle || ms->current_req != NULL) {
+		printk(KERN_ERR "inappropriate mesh_start (phase=%d, ms=%p)",
+		       ms->phase, ms);
+		return;
+	}
+
+	while (ms->phase == idle) {
+		prev = NULL;
+		for (cmd = ms->request_q; ; cmd = (Scsi_Cmnd *) cmd->host_scribble) {
+			if (cmd == NULL)
+				return;
+			if (ms->tgts[cmd->device->id].current_req == NULL)
+				break;
+			prev = cmd;
+		}
+		next = (Scsi_Cmnd *) cmd->host_scribble;
+		if (prev == NULL)
+			ms->request_q = next;
+		else
+			prev->host_scribble = (void *) next;
+		if (next == NULL)
+			ms->request_qtail = prev;
+
+		mesh_start_cmd(ms, cmd);
+	}
+}
+
+static void mesh_done(struct mesh_state *ms, int start_next)
+{
+	Scsi_Cmnd *cmd;
+	struct mesh_target *tp = &ms->tgts[ms->conn_tgt];
+
+	cmd = ms->current_req;
+	ms->current_req = 0;
+	tp->current_req = 0;
+	if (cmd) {
+		cmd->result = (ms->stat << 16) + cmd->SCp.Status;
+		if (ms->stat == DID_OK)
+			cmd->result += (cmd->SCp.Message << 8);
+		if (DEBUG_TARGET(cmd)) {
+			printk(KERN_DEBUG "mesh_done: result = %x, data_ptr=%d, buflen=%d\n",
+			       cmd->result, ms->data_ptr, cmd->request_bufflen);
+			if ((cmd->cmnd[0] == 0 || cmd->cmnd[0] == 0x12 || cmd->cmnd[0] == 3)
+			    && cmd->request_buffer != 0) {
+				unsigned char *b = cmd->request_buffer;
+				printk(KERN_DEBUG "buffer = %x %x %x %x %x %x %x %x\n",
+				       b[0], b[1], b[2], b[3], b[4], b[5], b[6], b[7]);
+			}
+		}
+		cmd->SCp.this_residual -= ms->data_ptr;
+		mesh_completed(ms, cmd);
+	}
+	if (start_next) {
+		out_8(&ms->mesh->sequence, SEQ_ENBRESEL);
+		mesh_flush_io(ms->mesh);
+		udelay(1);
+		ms->phase = idle;
+		mesh_start(ms);
+	}
+}
+
+static inline void add_sdtr_msg(struct mesh_state *ms)
 {
 	int i = ms->n_msgout;
 
@@ -835,8 +633,7 @@
 	ms->n_msgout = i + 5;
 }
 
-static void
-set_sdtr(struct mesh_state *ms, int period, int offset)
+static void set_sdtr(struct mesh_state *ms, int period, int offset)
 {
 	struct mesh_target *tp = &ms->tgts[ms->conn_tgt];
 	volatile struct mesh_regs *mr = ms->mesh;
@@ -877,8 +674,7 @@
 	       ms->conn_tgt, tr/10, tr%10);
 }
 
-static void
-start_phase(struct mesh_state *ms)
+static void start_phase(struct mesh_state *ms)
 {
 	int i, seq, nb;
 	volatile struct mesh_regs *mr = ms->mesh;
@@ -925,14 +721,16 @@
 						ms->msgout[1], ms->msgout[2]));
 		out_8(&mr->count_hi, 0);
 		out_8(&mr->sequence, SEQ_FLUSHFIFO);
+		mesh_flush_io(mr);
 		udelay(1);
 		/*
 		 * If ATN is not already asserted, we assert it, then
 		 * issue a SEQ_MSGOUT to get the mesh to drop ACK.
 		 */
-		if ((mr->bus_status0 & BS0_ATN) == 0) {
+		if ((in_8(&mr->bus_status0) & BS0_ATN) == 0) {
 			dlog(ms, "bus0 was %.2x explictly asserting ATN", mr->bus_status0);
 			out_8(&mr->bus_status0, BS0_ATN); /* explicit ATN */
+			mesh_flush_io(mr);
 			udelay(1);
 			out_8(&mr->count_lo, 1);
 			out_8(&mr->sequence, SEQ_MSGOUT + seq);
@@ -1006,6 +804,7 @@
 	case busfreeing:
 	case disconnecting:
 		out_8(&mr->sequence, SEQ_ENBRESEL);
+		mesh_flush_io(mr);
 		udelay(1);
 		dlog(ms, "enbresel intr/exc/err/fc=%.8x",
 		     MKWORD(mr->interrupt, mr->exception, mr->error,
@@ -1020,8 +819,7 @@
 
 }
 
-static inline void
-get_msgin(struct mesh_state *ms)
+static inline void get_msgin(struct mesh_state *ms)
 {
 	volatile struct mesh_regs *mr = ms->mesh;
 	int i, n;
@@ -1035,8 +833,7 @@
 	}
 }
 
-static inline int
-msgin_length(struct mesh_state *ms)
+static inline int msgin_length(struct mesh_state *ms)
 {
 	int b, n;
 
@@ -1054,349 +851,95 @@
 	return n;
 }
 
-static void
-cmd_complete(struct mesh_state *ms)
+static void reselected(struct mesh_state *ms)
 {
 	volatile struct mesh_regs *mr = ms->mesh;
-	Scsi_Cmnd *cmd = ms->current_req;
-	struct mesh_target *tp = &ms->tgts[ms->conn_tgt];
-	int seq, n, t;
-
-	dlog(ms, "cmd_complete fc=%x", mr->fifo_count);
-	seq = use_active_neg + (ms->n_msgout? SEQ_ATN: 0);
-	switch (ms->msgphase) {
-	case msg_out_xxx:
-		/* huh?  we expected a phase mismatch */
-		ms->n_msgin = 0;
-		ms->msgphase = msg_in;
-		/* fall through */
+	Scsi_Cmnd *cmd;
+	struct mesh_target *tp;
+	int b, t, prev;
 
-	case msg_in:
-		/* should have some message bytes in fifo */
-		get_msgin(ms);
-		n = msgin_length(ms);
-		if (ms->n_msgin < n) {
-			out_8(&mr->count_lo, n - ms->n_msgin);
-			out_8(&mr->sequence, SEQ_MSGIN + seq);
-		} else {
-			ms->msgphase = msg_none;
-			handle_msgin(ms);
-			start_phase(ms);
+	switch (ms->phase) {
+	case idle:
+		break;
+	case arbitrating:
+		if ((cmd = ms->current_req) != NULL) {
+			/* put the command back on the queue */
+			cmd->host_scribble = (void *) ms->request_q;
+			if (ms->request_q == NULL)
+				ms->request_qtail = cmd;
+			ms->request_q = cmd;
+			tp = &ms->tgts[cmd->device->id];
+			tp->current_req = NULL;
 		}
 		break;
+	case busfreeing:
+		ms->phase = reselecting;
+		mesh_done(ms, 0);
+		break;
+	case disconnecting:
+		break;
+	default:
+		printk(KERN_ERR "mesh: reselected in phase %d/%d tgt %d\n",
+		       ms->msgphase, ms->phase, ms->conn_tgt);
+		dumplog(ms, ms->conn_tgt);
+		dumpslog(ms);
+	}
 
-	case msg_in_bad:
-		out_8(&mr->sequence, SEQ_FLUSHFIFO);
+	if (ms->dma_started) {
+		printk(KERN_ERR "mesh: reselected with DMA started !\n");
+		halt_dma(ms);
+	}
+	ms->current_req = NULL;
+	ms->phase = dataing;
+	ms->msgphase = msg_in;
+	ms->n_msgout = 0;
+	ms->last_n_msgout = 0;
+	prev = ms->conn_tgt;
+
+	/*
+	 * We seem to get abortive reselections sometimes.
+	 */
+	while ((in_8(&mr->bus_status1) & BS1_BSY) == 0) {
+		static int mesh_aborted_resels;
+		mesh_aborted_resels++;
+		out_8(&mr->interrupt, INT_ERROR | INT_EXCEPTION | INT_CMDDONE);
+		mesh_flush_io(mr);
 		udelay(1);
-		out_8(&mr->count_lo, 1);
-		out_8(&mr->sequence, SEQ_MSGIN + SEQ_ATN + use_active_neg);
-		break;
+		out_8(&mr->sequence, SEQ_ENBRESEL);
+		mesh_flush_io(mr);
+		udelay(5);
+		dlog(ms, "extra resel err/exc/fc = %.6x",
+		     MKWORD(0, mr->error, mr->exception, mr->fifo_count));
+	}
+	out_8(&mr->interrupt, INT_ERROR | INT_EXCEPTION | INT_CMDDONE);
+       	mesh_flush_io(mr);
+	udelay(1);
+	out_8(&mr->sequence, SEQ_ENBRESEL);
+       	mesh_flush_io(mr);
+	udelay(1);
+	out_8(&mr->sync_params, ASYNC_PARAMS);
 
-	case msg_out:
-		/*
-		 * To get the right timing on ATN wrt ACK, we have
-		 * to get the MESH to drop ACK, wait until REQ gets
-		 * asserted, then drop ATN.  To do this we first
-		 * issue a SEQ_MSGOUT with ATN and wait for REQ,
-		 * then change the command to a SEQ_MSGOUT w/o ATN.
-		 * If we don't see REQ in a reasonable time, we
-		 * change the command to SEQ_MSGIN with ATN,
-		 * wait for the phase mismatch interrupt, then
-		 * issue the SEQ_MSGOUT without ATN.
-		 */
-		out_8(&mr->count_lo, 1);
-		out_8(&mr->sequence, SEQ_MSGOUT + use_active_neg + SEQ_ATN);
-		t = 30;		/* wait up to 30us */
-		while ((mr->bus_status0 & BS0_REQ) == 0 && --t >= 0)
-			udelay(1);
-		dlog(ms, "last_mbyte err/exc/fc/cl=%.8x",
-		     MKWORD(mr->error, mr->exception,
-			    mr->fifo_count, mr->count_lo));
-		if (in_8(&mr->interrupt) & (INT_ERROR | INT_EXCEPTION)) {
-			/* whoops, target didn't do what we expected */
-			ms->last_n_msgout = ms->n_msgout;
-			ms->n_msgout = 0;
-			if (in_8(&mr->interrupt) & INT_ERROR) {
-				printk(KERN_ERR "mesh: error %x in msg_out\n",
-				       in_8(&mr->error));
-				handle_error(ms);
-				return;
-			}
-			if (in_8(&mr->exception) != EXC_PHASEMM)
-				printk(KERN_ERR "mesh: exc %x in msg_out\n",
-				       in_8(&mr->exception));
-			else
-				printk(KERN_DEBUG "mesh: bs0=%x in msg_out\n",
-				       in_8(&mr->bus_status0));
-			handle_exception(ms);
-			return;
-		}
-		if (mr->bus_status0 & BS0_REQ) {
-			out_8(&mr->sequence, SEQ_MSGOUT + use_active_neg);
-			udelay(1);
-			out_8(&mr->fifo, ms->msgout[ms->n_msgout-1]);
-			ms->msgphase = msg_out_last;
-		} else {
-			out_8(&mr->sequence, SEQ_MSGIN + use_active_neg + SEQ_ATN);
-			ms->msgphase = msg_out_xxx;
-		}
-		break;
-
-	case msg_out_last:
-		ms->last_n_msgout = ms->n_msgout;
-		ms->n_msgout = 0;
-		ms->msgphase = ms->expect_reply? msg_in: msg_none;
-		start_phase(ms);
-		break;
-
-	case msg_none:
-		switch (ms->phase) {
-		case idle:
-			printk(KERN_ERR "mesh: interrupt in idle phase?\n");
-			dumpslog(ms);
-			return;
-		case selecting:
-			dlog(ms, "Selecting phase at command completion",0);
-			ms->msgout[0] = IDENTIFY(ALLOW_RESEL(ms->conn_tgt),
-						 (cmd? cmd->device->lun: 0));
-			ms->n_msgout = 1;
-			ms->expect_reply = 0;
-			if (ms->aborting) {
-				ms->msgout[0] = ABORT;
-				ms->n_msgout++;
-			} else if (tp->sdtr_state == do_sdtr) {
-				/* add SDTR message */
-				add_sdtr_msg(ms);
-				ms->expect_reply = 1;
-				tp->sdtr_state = sdtr_sent;
-			}
-			ms->msgphase = msg_out;
-			/*
-			 * We need to wait for REQ before dropping ATN.
-			 * We wait for at most 30us, then fall back to
-			 * a scheme where we issue a SEQ_COMMAND with ATN,
-			 * which will give us a phase mismatch interrupt
-			 * when REQ does come, and then we send the message.
-			 */
-			t = 230;		/* wait up to 230us */
-			while ((mr->bus_status0 & BS0_REQ) == 0) {
-				if (--t < 0) {
-					dlog(ms, "impatient for req", ms->n_msgout);
-					ms->msgphase = msg_none;
-					break;
-				}
-				udelay(1);
-			}
-			break;
-		case dataing:
-			if (ms->dma_count != 0) {
-				start_phase(ms);
-				return;
-			}
-			/*
-			 * We can get a phase mismatch here if the target
-			 * changes to the status phase, even though we have
-			 * had a command complete interrupt.  Then, if we
-			 * issue the SEQ_STATUS command, we'll get a sequence
-			 * error interrupt.  Which isn't so bad except that
-			 * occasionally the mesh actually executes the
-			 * SEQ_STATUS *as well as* giving us the sequence
-			 * error and phase mismatch exception.
-			 */
-			out_8(&mr->sequence, 0);
-			out_8(&mr->interrupt,
-			      INT_ERROR | INT_EXCEPTION | INT_CMDDONE);
-			halt_dma(ms);
-			break;
-		case statusing:
-			if (cmd) {
-				cmd->SCp.Status = mr->fifo;
-				if (DEBUG_TARGET(cmd))
-					printk(KERN_DEBUG "mesh: status is %x\n",
-					       cmd->SCp.Status);
-			}
-			ms->msgphase = msg_in;
-			break;
-		case busfreeing:
-			mesh_done(ms, 1);
-			return;
-		case disconnecting:
-			ms->current_req = 0;
-			ms->phase = idle;
-			mesh_start(ms);
-			return;
-		default:
-			break;
-		}
-		++ms->phase;
-		start_phase(ms);
-		break;
-	}
-}
-
-static void phase_mismatch(struct mesh_state *ms)
-{
-	volatile struct mesh_regs *mr = ms->mesh;
-	int phase;
-
-	dlog(ms, "phasemm ch/cl/seq/fc=%.8x",
-	     MKWORD(mr->count_hi, mr->count_lo, mr->sequence, mr->fifo_count));
-	phase = mr->bus_status0 & BS0_PHASE;
-	if (ms->msgphase == msg_out_xxx && phase == BP_MSGOUT) {
-		/* output the last byte of the message, without ATN */
-		out_8(&mr->count_lo, 1);
-		out_8(&mr->sequence, SEQ_MSGOUT + use_active_neg);
-		udelay(1);
-		out_8(&mr->fifo, ms->msgout[ms->n_msgout-1]);
-		ms->msgphase = msg_out_last;
-		return;
-	}
-
-	if (ms->msgphase == msg_in) {
-		get_msgin(ms);
-		if (ms->n_msgin)
-			handle_msgin(ms);
-	}
-
-	if (ms->dma_started)
-		halt_dma(ms);
-	if (mr->fifo_count) {
-		out_8(&mr->sequence, SEQ_FLUSHFIFO);
-		udelay(1);
-	}
-
-	ms->msgphase = msg_none;
-	switch (phase) {
-	case BP_DATAIN:
-		ms->tgts[ms->conn_tgt].data_goes_out = 0;
-		ms->phase = dataing;
-		break;
-	case BP_DATAOUT:
-		ms->tgts[ms->conn_tgt].data_goes_out = 1;
-		ms->phase = dataing;
-		break;
-	case BP_COMMAND:
-		ms->phase = commanding;
-		break;
-	case BP_STATUS:
-		ms->phase = statusing;
-		break;
-	case BP_MSGIN:
-		ms->msgphase = msg_in;
-		ms->n_msgin = 0;
-		break;
-	case BP_MSGOUT:
-		ms->msgphase = msg_out;
-		if (ms->n_msgout == 0) {
-			if (ms->aborting) {
-				do_abort(ms);
-			} else {
-				if (ms->last_n_msgout == 0) {
-					printk(KERN_DEBUG
-					       "mesh: no msg to repeat\n");
-					ms->msgout[0] = NOP;
-					ms->last_n_msgout = 1;
-				}
-				ms->n_msgout = ms->last_n_msgout;
-			}
-		}
-		break;
-	default:
-		printk(KERN_DEBUG "mesh: unknown scsi phase %x\n", phase);
-		ms->stat = DID_ERROR;
-		mesh_done(ms, 1);
-		return;
-	}
-
-	start_phase(ms);
-}
-
-static void
-reselected(struct mesh_state *ms)
-{
-	volatile struct mesh_regs *mr = ms->mesh;
-	Scsi_Cmnd *cmd;
-	struct mesh_target *tp;
-	int b, t, prev;
-
-	switch (ms->phase) {
-	case idle:
-		break;
-	case arbitrating:
-		if ((cmd = ms->current_req) != NULL) {
-			/* put the command back on the queue */
-			cmd->host_scribble = (void *) ms->request_q;
-			if (ms->request_q == NULL)
-				ms->request_qtail = cmd;
-			ms->request_q = cmd;
-			tp = &ms->tgts[cmd->device->id];
-			tp->current_req = NULL;
-		}
-		break;
-	case busfreeing:
-		ms->phase = reselecting;
-		mesh_done(ms, 0);
-		break;
-	case disconnecting:
-		break;
-	default:
-		printk(KERN_ERR "mesh: reselected in phase %d/%d tgt %d\n",
-		       ms->msgphase, ms->phase, ms->conn_tgt);
-		dumplog(ms, ms->conn_tgt);
-		dumpslog(ms);
-	}
-
-	if (ms->dma_started) {
-		printk(KERN_ERR "mesh: reselected with DMA started !\n");
-		halt_dma(ms);
-	}
-	ms->current_req = NULL;
-	ms->phase = dataing;
-	ms->msgphase = msg_in;
-	ms->n_msgout = 0;
-	ms->last_n_msgout = 0;
-	prev = ms->conn_tgt;
-
-	/*
-	 * We seem to get abortive reselections sometimes.
-	 */
-	while ((mr->bus_status1 & BS1_BSY) == 0) {
-		static int mesh_aborted_resels;
-		mesh_aborted_resels++;
-		out_8(&mr->interrupt, INT_ERROR | INT_EXCEPTION | INT_CMDDONE);
-		udelay(1);
-		out_8(&mr->sequence, SEQ_ENBRESEL);
-		udelay(5);
-		dlog(ms, "extra resel err/exc/fc = %.6x",
-		     MKWORD(0, mr->error, mr->exception, mr->fifo_count));
-	}
-	out_8(&mr->interrupt, INT_ERROR | INT_EXCEPTION | INT_CMDDONE);
-	udelay(1);
-	out_8(&mr->sequence, SEQ_ENBRESEL);
-	udelay(1);
-	out_8(&mr->sync_params, ASYNC_PARAMS);
-
-	/*
-	 * Find out who reselected us.
-	 */
-	if (mr->fifo_count == 0) {
-		printk(KERN_ERR "mesh: reselection but nothing in fifo?\n");
-		ms->conn_tgt = ms->host->this_id;
-		goto bogus;
-	}
-	/* get the last byte in the fifo */
-	do {
-		b = in_8(&mr->fifo);
-		dlog(ms, "reseldata %x", b);
-	} while (in_8(&mr->fifo_count));
-	for (t = 0; t < 8; ++t)
-		if ((b & (1 << t)) != 0 && t != ms->host->this_id)
-			break;
-	if (b != (1 << t) + (1 << ms->host->this_id)) {
-		printk(KERN_ERR "mesh: bad reselection data %x\n", b);
-		ms->conn_tgt = ms->host->this_id;
-		goto bogus;
-	}
+	/*
+	 * Find out who reselected us.
+	 */
+	if (in_8(&mr->fifo_count) == 0) {
+		printk(KERN_ERR "mesh: reselection but nothing in fifo?\n");
+		ms->conn_tgt = ms->host->this_id;
+		goto bogus;
+	}
+	/* get the last byte in the fifo */
+	do {
+		b = in_8(&mr->fifo);
+		dlog(ms, "reseldata %x", b);
+	} while (in_8(&mr->fifo_count));
+	for (t = 0; t < 8; ++t)
+		if ((b & (1 << t)) != 0 && t != ms->host->this_id)
+			break;
+	if (b != (1 << t) + (1 << ms->host->this_id)) {
+		printk(KERN_ERR "mesh: bad reselection data %x\n", b);
+		ms->conn_tgt = ms->host->this_id;
+		goto bogus;
+	}
 
 
 	/*
@@ -1438,8 +981,7 @@
 	dlog(ms, "abort", 0);
 }
 
-static void
-handle_reset(struct mesh_state *ms)
+static void handle_reset(struct mesh_state *ms)
 {
 	int tgt;
 	struct mesh_target *tp;
@@ -1466,13 +1008,13 @@
 	ms->msgphase = msg_none;
 	out_8(&mr->interrupt, INT_ERROR | INT_EXCEPTION | INT_CMDDONE);
 	out_8(&mr->sequence, SEQ_FLUSHFIFO);
+       	mesh_flush_io(mr);
 	udelay(1);
 	out_8(&mr->sync_params, ASYNC_PARAMS);
 	out_8(&mr->sequence, SEQ_ENBRESEL);
 }
 
-static irqreturn_t
-do_mesh_interrupt(int irq, void *dev_id, struct pt_regs *ptregs)
+static irqreturn_t do_mesh_interrupt(int irq, void *dev_id, struct pt_regs *ptregs)
 {
 	unsigned long flags;
 	struct Scsi_Host *dev = ((struct mesh_state *)dev_id)->host;
@@ -1497,7 +1039,7 @@
 		/* SCSI bus was reset */
 		printk(KERN_INFO "mesh: SCSI bus reset detected: "
 		       "waiting for end...");
-		while ((mr->bus_status1 & BS1_RST) != 0)
+		while ((in_8(&mr->bus_status1) & BS1_RST) != 0)
 			udelay(1);
 		printk("done\n");
 		handle_reset(ms);
@@ -1567,7 +1109,7 @@
 	}
 	mesh_dump_regs(ms);
 	dumplog(ms, ms->conn_tgt);
-	if (ms->phase > selecting && (mr->bus_status1 & BS1_BSY)) {
+	if (ms->phase > selecting && (in_8(&mr->bus_status1) & BS1_BSY)) {
 		/* try to do what the target wants */
 		do_abort(ms);
 		phase_mismatch(ms);
@@ -1609,40 +1151,11 @@
 	}
 }
 
-static void
-mesh_interrupt(int irq, void *dev_id, struct pt_regs *ptregs)
+static void handle_msgin(struct mesh_state *ms)
 {
-	struct mesh_state *ms = (struct mesh_state *) dev_id;
-	volatile struct mesh_regs *mr = ms->mesh;
-	int intr;
-
-#if 0
-	if (ALLOW_DEBUG(ms->conn_tgt))
-		printk(KERN_DEBUG "mesh_intr, bs0=%x int=%x exc=%x err=%x "
-		       "phase=%d msgphase=%d\n", mr->bus_status0,
-		       mr->interrupt, mr->exception, mr->error,
-		       ms->phase, ms->msgphase);
-#endif
-	while ((intr = in_8(&mr->interrupt)) != 0) {
-		dlog(ms, "interrupt intr/err/exc/seq=%.8x", 
-		     MKWORD(intr, mr->error, mr->exception, mr->sequence));
-		if (intr & INT_ERROR) {
-			handle_error(ms);
-		} else if (intr & INT_EXCEPTION) {
-			handle_exception(ms);
-		} else if (intr & INT_CMDDONE) {
-			out_8(&mr->interrupt, INT_CMDDONE);
-			cmd_complete(ms);
-		}
-	}
-}
-
-static void
-handle_msgin(struct mesh_state *ms)
-{
-	int i, code;
-	Scsi_Cmnd *cmd = ms->current_req;
-	struct mesh_target *tp = &ms->tgts[ms->conn_tgt];
+	int i, code;
+	Scsi_Cmnd *cmd = ms->current_req;
+	struct mesh_target *tp = &ms->tgts[ms->conn_tgt];
 
 	if (ms->n_msgin == 0)
 		return;
@@ -1736,51 +1249,10 @@
 	ms->msgphase = msg_out;
 }
 
-static void
-mesh_done(struct mesh_state *ms, int start_next)
-{
-	Scsi_Cmnd *cmd;
-	struct mesh_target *tp = &ms->tgts[ms->conn_tgt];
-
-	cmd = ms->current_req;
-	ms->current_req = 0;
-	tp->current_req = 0;
-	if (cmd) {
-		cmd->result = (ms->stat << 16) + cmd->SCp.Status;
-		if (ms->stat == DID_OK)
-			cmd->result += (cmd->SCp.Message << 8);
-		if (DEBUG_TARGET(cmd)) {
-			printk(KERN_DEBUG "mesh_done: result = %x, data_ptr=%d, buflen=%d\n",
-			       cmd->result, ms->data_ptr, cmd->request_bufflen);
-			if ((cmd->cmnd[0] == 0 || cmd->cmnd[0] == 0x12 || cmd->cmnd[0] == 3)
-			    && cmd->request_buffer != 0) {
-				unsigned char *b = cmd->request_buffer;
-				printk(KERN_DEBUG "buffer = %x %x %x %x %x %x %x %x\n",
-				       b[0], b[1], b[2], b[3], b[4], b[5], b[6], b[7]);
-			}
-		}
-		cmd->SCp.this_residual -= ms->data_ptr;
-		mesh_completed(ms, cmd);
-	}
-	if (start_next) {
-		out_8(&ms->mesh->sequence, SEQ_ENBRESEL);
-		udelay(1);
-		ms->phase = idle;
-		mesh_start(ms);
-	}
-}
-
-static void
-mesh_completed(struct mesh_state *ms, Scsi_Cmnd *cmd)
-{
-	(*cmd->scsi_done)(cmd);
-}
-
 /*
  * Set up DMA commands for transferring data.
  */
-static void
-set_dma_cmds(struct mesh_state *ms, Scsi_Cmnd *cmd)
+static void set_dma_cmds(struct mesh_state *ms, Scsi_Cmnd *cmd)
 {
 	int i, dma_cmd, total, off, dtot;
 	struct scatterlist *scl;
@@ -1848,8 +1320,7 @@
 	ms->dma_count = dtot;
 }
 
-static void
-halt_dma(struct mesh_state *ms)
+static void halt_dma(struct mesh_state *ms)
 {
 	volatile struct dbdma_regs *md = ms->dma;
 	volatile struct mesh_regs *mr = ms->mesh;
@@ -1859,7 +1330,7 @@
 	if (!ms->tgts[ms->conn_tgt].data_goes_out) {
 		/* wait a little while until the fifo drains */
 		t = 50;
-		while (t > 0 && mr->fifo_count != 0
+		while (t > 0 && in_8(&mr->fifo_count) != 0
 		       && (in_le32(&md->status) & ACTIVE) != 0) {
 			--t;
 			udelay(1);
@@ -1899,162 +1370,697 @@
 	ms->dma_started = 0;
 }
 
-/*
- * Work out whether we expect data to go out from the host adaptor or into it.
- */
-static int
-data_goes_out(Scsi_Cmnd *cmd)
+static void phase_mismatch(struct mesh_state *ms)
 {
-	switch (cmd->sc_data_direction) {
-	case SCSI_DATA_WRITE:
-		return 1;
-	case SCSI_DATA_READ:
-		return 0;
-	}
+	volatile struct mesh_regs *mr = ms->mesh;
+	int phase;
 
-	/* for SCSI_DATA_UNKNOWN or SCSI_DATA_NONE, fall back on the
-	   old method for now... */
-	switch (cmd->cmnd[0]) {
-	case CHANGE_DEFINITION: 
-	case COMPARE:	  
-	case COPY:
-	case COPY_VERIFY:	    
-	case FORMAT_UNIT:	 
-	case LOG_SELECT:
-	case MEDIUM_SCAN:	  
-	case MODE_SELECT:
-	case MODE_SELECT_10:
-	case REASSIGN_BLOCKS: 
-	case RESERVE:
-	case SEARCH_EQUAL:	  
-	case SEARCH_EQUAL_12: 
-	case SEARCH_HIGH:	 
-	case SEARCH_HIGH_12:  
-	case SEARCH_LOW:
-	case SEARCH_LOW_12:
-	case SEND_DIAGNOSTIC: 
-	case SEND_VOLUME_TAG:	     
-	case SET_WINDOW: 
-	case UPDATE_BLOCK:	
-	case WRITE_BUFFER:
- 	case WRITE_6:	
-	case WRITE_10:	
-	case WRITE_12:	  
-	case WRITE_LONG:	
-	case WRITE_LONG_2:      /* alternate code for WRITE_LONG */
-	case WRITE_SAME:	
-	case WRITE_VERIFY:
-	case WRITE_VERIFY_12:
-		return 1;
-	default:
-		return 0;
+	dlog(ms, "phasemm ch/cl/seq/fc=%.8x",
+	     MKWORD(mr->count_hi, mr->count_lo, mr->sequence, mr->fifo_count));
+	phase = in_8(&mr->bus_status0) & BS0_PHASE;
+	if (ms->msgphase == msg_out_xxx && phase == BP_MSGOUT) {
+		/* output the last byte of the message, without ATN */
+		out_8(&mr->count_lo, 1);
+		out_8(&mr->sequence, SEQ_MSGOUT + use_active_neg);
+		mesh_flush_io(mr);
+		udelay(1);
+		out_8(&mr->fifo, ms->msgout[ms->n_msgout-1]);
+		ms->msgphase = msg_out_last;
+		return;
 	}
-}
 
-#ifdef MESH_DBG
-static inline u32 readtb(void)
-{
-	u32 tb;
+	if (ms->msgphase == msg_in) {
+		get_msgin(ms);
+		if (ms->n_msgin)
+			handle_msgin(ms);
+	}
 
-#ifdef DBG_USE_TB
-	/* Beware: if you enable this, it will crash on 601s. */
-	asm ("mftb %0" : "=r" (tb) : );
-#else
-	tb = 0;
-#endif
-	return tb;
-}
+	if (ms->dma_started)
+		halt_dma(ms);
+	if (mr->fifo_count) {
+		out_8(&mr->sequence, SEQ_FLUSHFIFO);
+		mesh_flush_io(mr);
+		udelay(1);
+	}
 
-static void dlog(struct mesh_state *ms, char *fmt, int a)
-{
-	struct mesh_target *tp = &ms->tgts[ms->conn_tgt];
-	struct dbglog *tlp, *slp;
+	ms->msgphase = msg_none;
+	switch (phase) {
+	case BP_DATAIN:
+		ms->tgts[ms->conn_tgt].data_goes_out = 0;
+		ms->phase = dataing;
+		break;
+	case BP_DATAOUT:
+		ms->tgts[ms->conn_tgt].data_goes_out = 1;
+		ms->phase = dataing;
+		break;
+	case BP_COMMAND:
+		ms->phase = commanding;
+		break;
+	case BP_STATUS:
+		ms->phase = statusing;
+		break;
+	case BP_MSGIN:
+		ms->msgphase = msg_in;
+		ms->n_msgin = 0;
+		break;
+	case BP_MSGOUT:
+		ms->msgphase = msg_out;
+		if (ms->n_msgout == 0) {
+			if (ms->aborting) {
+				do_abort(ms);
+			} else {
+				if (ms->last_n_msgout == 0) {
+					printk(KERN_DEBUG
+					       "mesh: no msg to repeat\n");
+					ms->msgout[0] = NOP;
+					ms->last_n_msgout = 1;
+				}
+				ms->n_msgout = ms->last_n_msgout;
+			}
+		}
+		break;
+	default:
+		printk(KERN_DEBUG "mesh: unknown scsi phase %x\n", phase);
+		ms->stat = DID_ERROR;
+		mesh_done(ms, 1);
+		return;
+	}
 
-	tlp = &tp->log[tp->log_ix];
-	slp = &ms->log[ms->log_ix];
-	tlp->fmt = fmt;
-	tlp->tb = readtb();
-	tlp->phase = (ms->msgphase << 4) + ms->phase;
-	tlp->bs0 = ms->mesh->bus_status0;
-	tlp->bs1 = ms->mesh->bus_status1;
-	tlp->tgt = ms->conn_tgt;
-	tlp->d = a;
-	*slp = *tlp;
-	if (++tp->log_ix >= N_DBG_LOG)
-		tp->log_ix = 0;
-	if (tp->n_log < N_DBG_LOG)
-		++tp->n_log;
-	if (++ms->log_ix >= N_DBG_SLOG)
-		ms->log_ix = 0;
-	if (ms->n_log < N_DBG_SLOG)
-		++ms->n_log;
+	start_phase(ms);
 }
 
-static void dumplog(struct mesh_state *ms, int t)
+static void cmd_complete(struct mesh_state *ms)
 {
-	struct mesh_target *tp = &ms->tgts[t];
-	struct dbglog *lp;
-	int i;
+	volatile struct mesh_regs *mr = ms->mesh;
+	Scsi_Cmnd *cmd = ms->current_req;
+	struct mesh_target *tp = &ms->tgts[ms->conn_tgt];
+	int seq, n, t;
 
-	if (tp->n_log == 0)
-		return;
-	i = tp->log_ix - tp->n_log;
-	if (i < 0)
-		i += N_DBG_LOG;
-	tp->n_log = 0;
-	do {
-		lp = &tp->log[i];
-		printk(KERN_DEBUG "mesh log %d: bs=%.2x%.2x ph=%.2x ",
-		       t, lp->bs1, lp->bs0, lp->phase);
-#ifdef DBG_USE_TB
-		printk("tb=%10u ", lp->tb);
-#endif
-		printk(lp->fmt, lp->d);
-		printk("\n");
-		if (++i >= N_DBG_LOG)
-			i = 0;
-	} while (i != tp->log_ix);
-}
+	dlog(ms, "cmd_complete fc=%x", mr->fifo_count);
+	seq = use_active_neg + (ms->n_msgout? SEQ_ATN: 0);
+	switch (ms->msgphase) {
+	case msg_out_xxx:
+		/* huh?  we expected a phase mismatch */
+		ms->n_msgin = 0;
+		ms->msgphase = msg_in;
+		/* fall through */
 
-static void dumpslog(struct mesh_state *ms)
-{
-	struct dbglog *lp;
-	int i;
+	case msg_in:
+		/* should have some message bytes in fifo */
+		get_msgin(ms);
+		n = msgin_length(ms);
+		if (ms->n_msgin < n) {
+			out_8(&mr->count_lo, n - ms->n_msgin);
+			out_8(&mr->sequence, SEQ_MSGIN + seq);
+		} else {
+			ms->msgphase = msg_none;
+			handle_msgin(ms);
+			start_phase(ms);
+		}
+		break;
 
-	if (ms->n_log == 0)
-		return;
-	i = ms->log_ix - ms->n_log;
-	if (i < 0)
-		i += N_DBG_SLOG;
-	ms->n_log = 0;
-	do {
-		lp = &ms->log[i];
-		printk(KERN_DEBUG "mesh log: bs=%.2x%.2x ph=%.2x t%d ",
-		       lp->bs1, lp->bs0, lp->phase, lp->tgt);
-#ifdef DBG_USE_TB
-		printk("tb=%10u ", lp->tb);
-#endif
-		printk(lp->fmt, lp->d);
-		printk("\n");
-		if (++i >= N_DBG_SLOG)
-			i = 0;
-	} while (i != ms->log_ix);
-}
-#endif /* MESH_DBG */
+	case msg_in_bad:
+		out_8(&mr->sequence, SEQ_FLUSHFIFO);
+		mesh_flush_io(mr);
+		udelay(1);
+		out_8(&mr->count_lo, 1);
+		out_8(&mr->sequence, SEQ_MSGIN + SEQ_ATN + use_active_neg);
+		break;
 
-static Scsi_Host_Template driver_template = {
-	.proc_name			= "mesh",
-	.name				= "MESH",
-	.detect				= mesh_detect,
-	.release			= mesh_release,
-	.queuecommand			= mesh_queue,
-	.eh_abort_handler		= mesh_abort,
-	.eh_host_reset_handler		= mesh_host_reset,
-	.can_queue			= 20,
-	.this_id			= 7,
-	.sg_tablesize			= SG_ALL,
+	case msg_out:
+		/*
+		 * To get the right timing on ATN wrt ACK, we have
+		 * to get the MESH to drop ACK, wait until REQ gets
+		 * asserted, then drop ATN.  To do this we first
+		 * issue a SEQ_MSGOUT with ATN and wait for REQ,
+		 * then change the command to a SEQ_MSGOUT w/o ATN.
+		 * If we don't see REQ in a reasonable time, we
+		 * change the command to SEQ_MSGIN with ATN,
+		 * wait for the phase mismatch interrupt, then
+		 * issue the SEQ_MSGOUT without ATN.
+		 */
+		out_8(&mr->count_lo, 1);
+		out_8(&mr->sequence, SEQ_MSGOUT + use_active_neg + SEQ_ATN);
+		t = 30;		/* wait up to 30us */
+		while ((in_8(&mr->bus_status0) & BS0_REQ) == 0 && --t >= 0)
+			udelay(1);
+		dlog(ms, "last_mbyte err/exc/fc/cl=%.8x",
+		     MKWORD(mr->error, mr->exception,
+			    mr->fifo_count, mr->count_lo));
+		if (in_8(&mr->interrupt) & (INT_ERROR | INT_EXCEPTION)) {
+			/* whoops, target didn't do what we expected */
+			ms->last_n_msgout = ms->n_msgout;
+			ms->n_msgout = 0;
+			if (in_8(&mr->interrupt) & INT_ERROR) {
+				printk(KERN_ERR "mesh: error %x in msg_out\n",
+				       in_8(&mr->error));
+				handle_error(ms);
+				return;
+			}
+			if (in_8(&mr->exception) != EXC_PHASEMM)
+				printk(KERN_ERR "mesh: exc %x in msg_out\n",
+				       in_8(&mr->exception));
+			else
+				printk(KERN_DEBUG "mesh: bs0=%x in msg_out\n",
+				       in_8(&mr->bus_status0));
+			handle_exception(ms);
+			return;
+		}
+		if (in_8(&mr->bus_status0) & BS0_REQ) {
+			out_8(&mr->sequence, SEQ_MSGOUT + use_active_neg);
+			mesh_flush_io(mr);
+			udelay(1);
+			out_8(&mr->fifo, ms->msgout[ms->n_msgout-1]);
+			ms->msgphase = msg_out_last;
+		} else {
+			out_8(&mr->sequence, SEQ_MSGIN + use_active_neg + SEQ_ATN);
+			ms->msgphase = msg_out_xxx;
+		}
+		break;
+
+	case msg_out_last:
+		ms->last_n_msgout = ms->n_msgout;
+		ms->n_msgout = 0;
+		ms->msgphase = ms->expect_reply? msg_in: msg_none;
+		start_phase(ms);
+		break;
+
+	case msg_none:
+		switch (ms->phase) {
+		case idle:
+			printk(KERN_ERR "mesh: interrupt in idle phase?\n");
+			dumpslog(ms);
+			return;
+		case selecting:
+			dlog(ms, "Selecting phase at command completion",0);
+			ms->msgout[0] = IDENTIFY(ALLOW_RESEL(ms->conn_tgt),
+						 (cmd? cmd->device->lun: 0));
+			ms->n_msgout = 1;
+			ms->expect_reply = 0;
+			if (ms->aborting) {
+				ms->msgout[0] = ABORT;
+				ms->n_msgout++;
+			} else if (tp->sdtr_state == do_sdtr) {
+				/* add SDTR message */
+				add_sdtr_msg(ms);
+				ms->expect_reply = 1;
+				tp->sdtr_state = sdtr_sent;
+			}
+			ms->msgphase = msg_out;
+			/*
+			 * We need to wait for REQ before dropping ATN.
+			 * We wait for at most 30us, then fall back to
+			 * a scheme where we issue a SEQ_COMMAND with ATN,
+			 * which will give us a phase mismatch interrupt
+			 * when REQ does come, and then we send the message.
+			 */
+			t = 230;		/* wait up to 230us */
+			while ((in_8(&mr->bus_status0) & BS0_REQ) == 0) {
+				if (--t < 0) {
+					dlog(ms, "impatient for req", ms->n_msgout);
+					ms->msgphase = msg_none;
+					break;
+				}
+				udelay(1);
+			}
+			break;
+		case dataing:
+			if (ms->dma_count != 0) {
+				start_phase(ms);
+				return;
+			}
+			/*
+			 * We can get a phase mismatch here if the target
+			 * changes to the status phase, even though we have
+			 * had a command complete interrupt.  Then, if we
+			 * issue the SEQ_STATUS command, we'll get a sequence
+			 * error interrupt.  Which isn't so bad except that
+			 * occasionally the mesh actually executes the
+			 * SEQ_STATUS *as well as* giving us the sequence
+			 * error and phase mismatch exception.
+			 */
+			out_8(&mr->sequence, 0);
+			out_8(&mr->interrupt,
+			      INT_ERROR | INT_EXCEPTION | INT_CMDDONE);
+			halt_dma(ms);
+			break;
+		case statusing:
+			if (cmd) {
+				cmd->SCp.Status = mr->fifo;
+				if (DEBUG_TARGET(cmd))
+					printk(KERN_DEBUG "mesh: status is %x\n",
+					       cmd->SCp.Status);
+			}
+			ms->msgphase = msg_in;
+			break;
+		case busfreeing:
+			mesh_done(ms, 1);
+			return;
+		case disconnecting:
+			ms->current_req = 0;
+			ms->phase = idle;
+			mesh_start(ms);
+			return;
+		default:
+			break;
+		}
+		++ms->phase;
+		start_phase(ms);
+		break;
+	}
+}
+
+
+/*
+ * Called by midlayer with host locked to queue a new
+ * request
+ */
+static int mesh_queue(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *))
+{
+	struct mesh_state *ms;
+
+	cmd->scsi_done = done;
+	cmd->host_scribble = NULL;
+
+	ms = (struct mesh_state *) cmd->device->host->hostdata;
+
+	if (ms->request_q == NULL)
+		ms->request_q = cmd;
+	else
+		ms->request_qtail->host_scribble = (void *) cmd;
+	ms->request_qtail = cmd;
+
+	if (ms->phase == idle)
+		mesh_start(ms);
+
+	return 0;
+}
+
+/*
+ * Called to handle interrupts, either call by the interrupt
+ * handler (do_mesh_interrupt) or by other functions in
+ * exceptional circumstances
+ */
+static void mesh_interrupt(int irq, void *dev_id, struct pt_regs *ptregs)
+{
+	struct mesh_state *ms = (struct mesh_state *) dev_id;
+	volatile struct mesh_regs *mr = ms->mesh;
+	int intr;
+
+#if 0
+	if (ALLOW_DEBUG(ms->conn_tgt))
+		printk(KERN_DEBUG "mesh_intr, bs0=%x int=%x exc=%x err=%x "
+		       "phase=%d msgphase=%d\n", mr->bus_status0,
+		       mr->interrupt, mr->exception, mr->error,
+		       ms->phase, ms->msgphase);
+#endif
+	while ((intr = in_8(&mr->interrupt)) != 0) {
+		dlog(ms, "interrupt intr/err/exc/seq=%.8x", 
+		     MKWORD(intr, mr->error, mr->exception, mr->sequence));
+		if (intr & INT_ERROR) {
+			handle_error(ms);
+		} else if (intr & INT_EXCEPTION) {
+			handle_exception(ms);
+		} else if (intr & INT_CMDDONE) {
+			out_8(&mr->interrupt, INT_CMDDONE);
+			cmd_complete(ms);
+		}
+	}
+}
+
+/* Todo: here we can at least try to remove the command from the
+ * queue if it isn't connected yet, and for pending command, assert
+ * ATN until the bus gets freed.
+ */
+static int mesh_abort(Scsi_Cmnd *cmd)
+{
+	struct mesh_state *ms = (struct mesh_state *) cmd->device->host->hostdata;
+
+	printk(KERN_DEBUG "mesh_abort(%p)\n", cmd);
+	mesh_dump_regs(ms);
+	dumplog(ms, cmd->device->id);
+	dumpslog(ms);
+	return SCSI_ABORT_SNOOZE;
+}
+
+/*
+ * Called by the midlayer with the lock held to reset the
+ * SCSI host and bus.
+ * The midlayer will wait for devices to come back, we don't need
+ * to do that ourselves
+ */
+static int mesh_host_reset(Scsi_Cmnd *cmd)
+{
+	struct mesh_state *ms = (struct mesh_state *) cmd->device->host->hostdata;
+	volatile struct mesh_regs *mr = ms->mesh;
+	volatile struct dbdma_regs *md = ms->dma;
+
+	printk(KERN_DEBUG "mesh_host_reset\n");
+
+	/* Reset the controller & dbdma channel */
+	out_le32(&md->control, (RUN|PAUSE|FLUSH|WAKE) << 16);	/* stop dma */
+	out_8(&mr->exception, 0xff);	/* clear all exception bits */
+	out_8(&mr->error, 0xff);	/* clear all error bits */
+	out_8(&mr->sequence, SEQ_RESETMESH);
+       	mesh_flush_io(mr);
+	udelay(1);
+	out_8(&mr->intr_mask, INT_ERROR | INT_EXCEPTION | INT_CMDDONE);
+	out_8(&mr->source_id, ms->host->this_id);
+	out_8(&mr->sel_timeout, 25);	/* 250ms */
+	out_8(&mr->sync_params, ASYNC_PARAMS);
+
+	/* Reset the bus */
+	out_8(&mr->bus_status1, BS1_RST);	/* assert RST */
+       	mesh_flush_io(mr);
+	udelay(30);			/* leave it on for >= 25us */
+	out_8(&mr->bus_status1, 0);	/* negate RST */
+
+	/* Complete pending commands */
+	handle_reset(ms);
+	
+	return SUCCESS;
+}
+
+static void set_mesh_power(struct mesh_state *ms, int state)
+{
+	if (_machine != _MACH_Pmac)
+		return;
+	if (state) {
+		pmac_call_feature(PMAC_FTR_MESH_ENABLE, macio_get_of_node(ms->mdev), 0, 1);
+		set_current_state(TASK_UNINTERRUPTIBLE);
+		schedule_timeout(HZ/5);
+	} else {
+		pmac_call_feature(PMAC_FTR_MESH_ENABLE, macio_get_of_node(ms->mdev), 0, 0);
+		set_current_state(TASK_UNINTERRUPTIBLE);
+		schedule_timeout(HZ/100);
+	}
+}			
+
+
+#ifdef CONFIG_PM
+static int mesh_suspend(struct macio_dev *mdev, u32 state)
+{
+	struct mesh_state *ms = (struct mesh_state *)macio_get_drvdata(mdev);
+	unsigned long flags;
+
+	if (state == mdev->ofdev.dev.power_state || state < 2)
+		return 0;
+
+	scsi_block_requests(ms->host);
+	spin_lock_irqsave(ms->host->host_lock, flags);
+	while(ms->phase != idle) {
+		spin_unlock_irqrestore(ms->host->host_lock, flags);
+		current->state = TASK_UNINTERRUPTIBLE;
+		schedule_timeout(HZ/100);
+		spin_lock_irqsave(ms->host->host_lock, flags);
+	}
+	ms->phase = sleeping;
+	spin_unlock_irqrestore(ms->host->host_lock, flags);
+	disable_irq(ms->meshintr);
+	set_mesh_power(ms, 0);
+
+	mdev->ofdev.dev.power_state = state;
+
+	return 0;
+}
+
+static int mesh_resume(struct macio_dev *mdev)
+{
+	struct mesh_state *ms = (struct mesh_state *)macio_get_drvdata(mdev);
+	unsigned long flags;
+
+	if (mdev->ofdev.dev.power_state == 0)
+		return 0;
+
+	set_mesh_power(ms, 1);
+	mesh_init(ms);
+	spin_lock_irqsave(ms->host->host_lock, flags);
+	mesh_start(ms);
+	spin_unlock_irqrestore(ms->host->host_lock, flags);
+	enable_irq(ms->meshintr);
+	scsi_unblock_requests(ms->host);
+
+	mdev->ofdev.dev.power_state = 0;
+
+	return 0;
+}
+
+#endif /* CONFIG_PM */
+
+/*
+ * If we leave drives set for synchronous transfers (especially
+ * CDROMs), and reboot to MacOS, it gets confused, poor thing.
+ * So, on reboot we reset the SCSI bus.
+ */
+static int mesh_shutdown(struct macio_dev *mdev)
+{
+	struct mesh_state *ms = (struct mesh_state *)macio_get_drvdata(mdev);
+	volatile struct mesh_regs *mr;
+	unsigned long flags;
+
+       	printk(KERN_INFO "resetting MESH scsi bus(es)\n");
+	spin_lock_irqsave(ms->host->host_lock, flags);
+       	mr = ms->mesh;
+	out_8(&mr->intr_mask, 0);
+	out_8(&mr->interrupt, INT_ERROR | INT_EXCEPTION | INT_CMDDONE);
+	out_8(&mr->bus_status1, BS1_RST);
+	mesh_flush_io(mr);
+	udelay(30);
+	out_8(&mr->bus_status1, 0);
+	spin_unlock_irqrestore(ms->host->host_lock, flags);
+
+	return 0;
+}
+
+static Scsi_Host_Template mesh_template = {
+	.proc_name			= "mesh",
+	.name				= "MESH",
+	.queuecommand			= mesh_queue,
+	.eh_abort_handler		= mesh_abort,
+	.eh_host_reset_handler		= mesh_host_reset,
+	.can_queue			= 20,
+	.this_id			= 7,
+	.sg_tablesize			= SG_ALL,
 	.cmd_per_lun			= 2,
 	.use_clustering			= DISABLE_CLUSTERING,
 };
 
-#include "scsi_module.c"
+static int mesh_probe(struct macio_dev *mdev, const struct of_match *match)
+{
+	struct device_node *mesh = macio_get_of_node(mdev);
+	struct pci_dev* pdev = macio_get_pci_dev(mdev);
+	int tgt, *cfp, minper;
+	struct mesh_state *ms;
+	struct Scsi_Host *mesh_host;
+	void *dma_cmd_space;
+	dma_addr_t dma_cmd_bus;
+
+	switch (mdev->bus->chip->type) {
+	case macio_heathrow:
+	case macio_gatwick:
+	case macio_paddington:
+		use_active_neg = 0;
+		break;
+	default:
+		use_active_neg = SEQ_ACTIVE_NEG;
+	}
+
+	if (macio_resource_count(mdev) != 2 || macio_irq_count(mdev) != 2) {
+       		printk(KERN_ERR "mesh: expected 2 addrs and 2 intrs"
+	       	       " (got %d,%d)\n", mesh->n_addrs, mesh->n_intrs);
+		return -ENODEV;
+	}
+
+	if (macio_request_resources(mdev, "mesh") != 0) {
+       		printk(KERN_ERR "mesh: unable to request memory resources");
+		return -EBUSY;
+	}
+       	mesh_host = scsi_host_alloc(&mesh_template, sizeof(struct mesh_state));
+	if (mesh_host == NULL) {
+		printk(KERN_ERR "mesh: couldn't register host");
+		goto out_release;
+	}
+	
+	/* Old junk for root discovery, that will die ultimately */
+#if !defined(MODULE)
+       	note_scsi_host(mesh, mesh_host);
+#endif
+
+	mesh_host->base = macio_resource_start(mdev, 0);
+	mesh_host->irq = macio_irq(mdev, 0);
+       	ms = (struct mesh_state *) mesh_host->hostdata;
+	macio_set_drvdata(mdev, ms);
+	ms->host = mesh_host;
+	ms->mdev = mdev;
+	ms->pdev = pdev;
+	
+	ms->mesh = (volatile struct mesh_regs *)
+		ioremap(macio_resource_start(mdev, 0), 0x1000);
+	if (ms->mesh == NULL) {
+		printk(KERN_ERR "mesh: can't map registers\n");
+		goto out_free;
+	}		
+	ms->dma = (volatile struct dbdma_regs *)
+	       	ioremap(macio_resource_start(mdev, 1), 0x1000);
+	if (ms->dma == NULL) {
+		printk(KERN_ERR "mesh: can't map registers\n");
+		iounmap((void *)ms->mesh);
+		goto out_free;
+	}
+
+       	ms->meshintr = macio_irq(mdev, 0);
+       	ms->dmaintr = macio_irq(mdev, 1);
+
+       	/* Space for dma command list: +1 for stop command,
+       	 * +1 to allow for aligning.
+	 */
+	ms->dma_cmd_size = (mesh_host->sg_tablesize + 2) * sizeof(struct dbdma_cmd);
+
+	/* We use the PCI APIs for now until the generic one gets fixed
+	 * enough or until we get some macio-specific versions
+	 */
+	dma_cmd_space = pci_alloc_consistent(macio_get_pci_dev(mdev),
+					     ms->dma_cmd_size,
+					     &dma_cmd_bus);
+	if (dma_cmd_space == NULL) {
+		printk(KERN_ERR "mesh: can't allocate DMA table\n");
+		goto out_unmap;
+	}
+	memset(dma_cmd_space, 0, ms->dma_cmd_size);
+
+	ms->dma_cmds = (struct dbdma_cmd *) DBDMA_ALIGN(dma_cmd_space);
+       	ms->dma_cmd_space = dma_cmd_space;
+	ms->dma_cmd_bus = dma_cmd_bus + ((unsigned long)ms->dma_cmds)
+		- (unsigned long)dma_cmd_space;
+	ms->current_req = NULL;
+       	for (tgt = 0; tgt < 8; ++tgt) {
+	       	ms->tgts[tgt].sdtr_state = do_sdtr;
+	       	ms->tgts[tgt].sync_params = ASYNC_PARAMS;
+	       	ms->tgts[tgt].current_req = 0;
+       	}
+
+	if ((cfp = (int *) get_property(mesh, "clock-frequency", NULL)))
+       		ms->clk_freq = *cfp;
+	else {
+       		printk(KERN_INFO "mesh: assuming 50MHz clock frequency\n");
+	       	ms->clk_freq = 50000000;
+       	}
+
+       	/* The maximum sync rate is clock / 5; increase
+       	 * mesh_sync_period if necessary.
+	 */
+	minper = 1000000000 / (ms->clk_freq / 5); /* ns */
+	if (mesh_sync_period < minper)
+		mesh_sync_period = minper;
+
+	/* Power up the chip */
+	set_mesh_power(ms, 1);
+
+	/* Set it up */
+       	mesh_init(ms);
+
+	/* XXX FIXME: error should be fatal */
+       	if (request_irq(ms->meshintr, do_mesh_interrupt, 0, "MESH", ms))
+	       	printk(KERN_ERR "MESH: can't get irq %d\n", ms->meshintr);
+
+	/* XXX FIXME: handle failure */
+	scsi_add_host(mesh_host, &mdev->ofdev.dev);
+	scsi_scan_host(mesh_host);
+
+	return 0;
+
+out_unmap:
+	iounmap((void *)ms->dma);
+	iounmap((void *)ms->mesh);
+out_free:
+	scsi_host_put(mesh_host);
+out_release:
+	macio_release_resources(mdev);
+
+	return -ENODEV;
+}
+
+static int mesh_remove(struct macio_dev *mdev)
+{
+	struct mesh_state *ms = (struct mesh_state *)macio_get_drvdata(mdev);
+	struct Scsi_Host *mesh_host = ms->host;
+
+	scsi_remove_host(mesh_host);
+
+	free_irq(ms->meshintr, ms);
+
+	/* Reset scsi bus */
+	mesh_shutdown(mdev);
+
+	/* Shut down chip & termination */
+	set_mesh_power(ms, 0);
+
+	/* Unmap registers & dma controller */
+	iounmap((void *) ms->mesh);
+       	iounmap((void *) ms->dma);
+
+	/* Free DMA commands memory */
+	pci_free_consistent(macio_get_pci_dev(mdev), ms->dma_cmd_size,
+			  ms->dma_cmd_space, ms->dma_cmd_bus);
+
+	/* Release memory resources */
+	macio_release_resources(mdev);
+
+	scsi_host_put(mesh_host);
+
+	return 0;
+}
+
+
+static struct of_match mesh_match[] = 
+{
+	{
+	.name 		= "mesh",
+	.type		= OF_ANY_MATCH,
+	.compatible	= OF_ANY_MATCH
+	},
+	{
+	.name 		= OF_ANY_MATCH,
+	.type		= "scsi",
+	.compatible	= "chrp,mesh0"
+	},
+	{},
+};
+
+static struct macio_driver mesh_driver = 
+{
+	.name 		= "mesh",
+	.match_table	= mesh_match,
+	.probe		= mesh_probe,
+	.remove		= mesh_remove,
+	.shutdown	= mesh_shutdown,
+#ifdef CONFIG_PM
+	.suspend	= mesh_suspend,
+	.resume		= mesh_resume,
+#endif
+};
+
+
+static int __init init_mesh(void)
+{
+
+	/* Calculate sync rate from module parameters */
+	if (sync_rate > 10)
+		sync_rate = 10;
+	if (sync_rate > 0) {
+		printk(KERN_INFO "mesh: configured for synchronous %d MB/s\n", sync_rate);
+		mesh_sync_period = 1000 / sync_rate;	/* ns */
+		mesh_sync_offset = 15;
+	} else
+		printk(KERN_INFO "mesh: configured for asynchronous\n");
+
+	return macio_register_driver(&mesh_driver);
+}
+
+static void __exit exit_mesh(void)
+{
+	return macio_unregister_driver(&mesh_driver);
+}
+
+module_init(init_mesh);
+module_exit(exit_mesh);
--- diff/drivers/scsi/osst.c	2004-01-19 10:22:58.000000000 +0000
+++ source/drivers/scsi/osst.c	2004-02-09 10:39:55.000000000 +0000
@@ -5106,6 +5106,8 @@
 	if (need_dma)
 		priority |= GFP_DMA;
 
+	priority |= __GFP_NOWARN;
+
 	/* Try to allocate the first segment up to OS_DATA_SIZE and the others
 	   big enough to reach the goal (code assumes no segments in place) */
 	for (b_size = OS_DATA_SIZE, order = OSST_FIRST_ORDER; b_size >= PAGE_SIZE; order--, b_size /= 2) {
--- diff/drivers/scsi/pcmcia/aha152x_stub.c	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/scsi/pcmcia/aha152x_stub.c	2004-02-09 10:39:55.000000000 +0000
@@ -78,7 +78,7 @@
 static int host_id = 7;
 static int reconnect = 1;
 static int parity = 1;
-static int synchronous = 0;
+static int synchronous = 1;
 static int reset_delay = 100;
 static int ext_trans = 0;
 
@@ -244,9 +244,6 @@
     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);
-
     /* Set configuration options for the aha152x driver */
     memset(&s, 0, sizeof(s));
     s.conf        = "PCMCIA setup";
@@ -266,9 +263,6 @@
 	goto cs_failed;
     }
 
-    scsi_add_host(host, NULL); /* XXX handle failure */
-    scsi_scan_host(host);
-
     sprintf(info->node.dev_name, "scsi%d", host->host_no);
     link->dev = &info->node;
     info->host = host;
@@ -286,7 +280,7 @@
 {
 	scsi_info_t *info = link->priv;
 
-	scsi_remove_host(info->host);
+	aha152x_release(info->host);
 	link->dev = NULL;
     
 	pcmcia_release_configuration(link->handle);
@@ -294,7 +288,6 @@
 	pcmcia_release_irq(link->handle, &link->irq);
     
 	link->state &= ~DEV_CONFIG;
-	scsi_unregister(info->host);
 }
 
 static int aha152x_event(event_t event, int priority,
--- diff/drivers/scsi/ppa.c	2003-08-26 10:00:54.000000000 +0100
+++ source/drivers/scsi/ppa.c	2004-02-09 10:39:55.000000000 +0000
@@ -11,238 +11,100 @@
  */
 
 #include <linux/config.h>
-
-/* The following #define is to avoid a clash with hosts.c */
-#define PPA_CODE 1
-
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
 #include <linux/blkdev.h>
 #include <asm/io.h>
 #include <linux/parport.h>
 #include <linux/workqueue.h>
 #include "scsi.h"
 #include "hosts.h"
-int ppa_release(struct Scsi_Host *);
 static void ppa_reset_pulse(unsigned int base);
 
 typedef struct {
-    struct pardevice *dev;	/* Parport device entry         */
-    int base;			/* Actual port address          */
-    int mode;			/* Transfer mode                */
-    int host;			/* Host number (for proc)       */
-    Scsi_Cmnd *cur_cmd;		/* Current queued command       */
-    struct work_struct ppa_tq;	/* Polling interrupt stuff       */
-    unsigned long jstart;	/* Jiffies at start             */
-    unsigned long recon_tmo;    /* How many usecs to wait for reconnection (6th bit) */
-    unsigned int failed:1;	/* Failure flag                 */
-    unsigned int p_busy:1;	/* Parport sharing busy flag    */
+	struct pardevice *dev;	/* Parport device entry         */
+	int base;		/* Actual port address          */
+	int mode;		/* Transfer mode                */
+	Scsi_Cmnd *cur_cmd;	/* Current queued command       */
+	struct work_struct ppa_tq;	/* Polling interrupt stuff       */
+	unsigned long jstart;	/* Jiffies at start             */
+	unsigned long recon_tmo;	/* How many usecs to wait for reconnection (6th bit) */
+	unsigned int failed:1;	/* Failure flag                 */
+	unsigned wanted:1;	/* Parport sharing busy flag    */
+	wait_queue_head_t *waiting;
+	struct Scsi_Host *host;
+	struct list_head list;
 } ppa_struct;
 
-#define PPA_EMPTY	\
-{	.base		= -1,		\
-	.mode		= PPA_AUTODETECT,	\
-	.host		= -1,		\
-	.ppa_tq		= { .func = ppa_interrupt },	\
-	.recon_tmo      = PPA_RECON_TMO,	\
-}
-
 #include  "ppa.h"
 
-#define NO_HOSTS 4
-static ppa_struct ppa_hosts[NO_HOSTS] =
-{PPA_EMPTY, PPA_EMPTY, PPA_EMPTY, PPA_EMPTY};
+static inline ppa_struct *ppa_dev(struct Scsi_Host *host)
+{
+	return *(ppa_struct **)&host->hostdata;
+}
 
-#define PPA_BASE(x)	ppa_hosts[(x)].base
+static spinlock_t arbitration_lock = SPIN_LOCK_UNLOCKED;
 
-void ppa_wakeup(void *ref)
+static void got_it(ppa_struct *dev)
 {
-    ppa_struct *ppa_dev = (ppa_struct *) ref;
+	dev->base = dev->dev->port->base;
+	if (dev->cur_cmd)
+		dev->cur_cmd->SCp.phase = 1;
+	else
+		wake_up(dev->waiting);
+}
 
-    if (!ppa_dev->p_busy)
-	return;
+static void ppa_wakeup(void *ref)
+{
+	ppa_struct *dev = (ppa_struct *) ref;
+	unsigned long flags;
 
-    if (parport_claim(ppa_dev->dev)) {
-	printk("ppa: bug in ppa_wakeup\n");
+	spin_lock_irqsave(&arbitration_lock, flags);
+	if (dev->wanted) {
+		parport_claim(dev->dev);
+		got_it(dev);
+		dev->wanted = 0;
+	}
+	spin_unlock_irqrestore(&arbitration_lock, flags);
 	return;
-    }
-    ppa_dev->p_busy = 0;
-    ppa_dev->base = ppa_dev->dev->port->base;
-    if (ppa_dev->cur_cmd)
-	ppa_dev->cur_cmd->SCp.phase++;
-    return;
 }
 
-int ppa_release(struct Scsi_Host *host)
+static int ppa_pb_claim(ppa_struct *dev)
 {
-    int host_no = host->unique_id;
-
-    printk("Releasing ppa%i\n", host_no);
-    scsi_unregister(host);
-    parport_unregister_device(ppa_hosts[host_no].dev);
-    return 0;
+	unsigned long flags;
+	int res = 1;
+	spin_lock_irqsave(&arbitration_lock, flags);
+	if (parport_claim(dev->dev) == 0) {
+		got_it(dev);
+		res = 0;
+	}
+	dev->wanted = res;
+	spin_unlock_irqrestore(&arbitration_lock, flags);
+	return res;
 }
 
-static int ppa_pb_claim(int host_no)
+static void ppa_pb_dismiss(ppa_struct *dev)
 {
-    if (parport_claim(ppa_hosts[host_no].dev)) {
-	ppa_hosts[host_no].p_busy = 1;
-	return 1;
-    }
-    if (ppa_hosts[host_no].cur_cmd)
-	ppa_hosts[host_no].cur_cmd->SCp.phase++;
-    return 0;
+	unsigned long flags;
+	int wanted;
+	spin_lock_irqsave(&arbitration_lock, flags);
+	wanted = dev->wanted;
+	dev->wanted = 0;
+	spin_unlock_irqrestore(&arbitration_lock, flags);
+	if (!wanted)
+		parport_release(dev->dev);
 }
 
-#define ppa_pb_release(x) parport_release(ppa_hosts[(x)].dev)
-
-/***************************************************************************
- *                   Parallel port probing routines                        *
- ***************************************************************************/
-
-static Scsi_Host_Template driver_template = {
-	.proc_name			= "ppa",
-	.proc_info			= ppa_proc_info,
-	.name				= "Iomega VPI0 (ppa) interface",
-	.detect				= ppa_detect,
-	.release			= ppa_release,
-	.queuecommand			= ppa_queuecommand,
-	.eh_abort_handler		= ppa_abort,
-	.eh_bus_reset_handler		= ppa_reset,
-	.eh_host_reset_handler		= ppa_reset,
-	.bios_param			= ppa_biosparam,
-	.this_id			= -1,
-	.sg_tablesize			= SG_ALL,
-	.cmd_per_lun			= 1,
-	.use_clustering			= ENABLE_CLUSTERING,
-};
-#include  "scsi_module.c"
+static inline void ppa_pb_release(ppa_struct *dev)
+{
+	parport_release(dev->dev);
+}
 
 /*
  * Start of Chipset kludges
  */
 
-int ppa_detect(Scsi_Host_Template * host)
-{
-    struct Scsi_Host *hreg = NULL;
-    int ports;
-    int i, nhosts, try_again;
-    struct parport *pb;
-
-    /*
-     * unlock to allow the lowlevel parport driver to probe
-     * the irqs
-     */
-    pb = parport_enumerate();
-
-    printk("ppa: Version %s\n", PPA_VERSION);
-    nhosts = 0;
-    try_again = 0;
-
-    if (!pb) {
-	printk("ppa: parport reports no devices.\n");
-	return 0;
-    }
-  retry_entry:
-    for (i = 0; pb; i++, pb = pb->next) {
-	int modes, ppb, ppb_hi;
-
-	ppa_hosts[i].dev =
-	    parport_register_device(pb, "ppa", NULL, ppa_wakeup,
-				    NULL, 0, (void *) &ppa_hosts[i]);
-
-	if (!ppa_hosts[i].dev)
-	    continue;
-
-	/* Claim the bus so it remembers what we do to the control
-	 * registers. [ CTR and ECP ]
-	 */
-	if (ppa_pb_claim(i)) {
-	    unsigned long now = jiffies;
-	    while (ppa_hosts[i].p_busy) {
-		schedule();	/* We are safe to schedule here */
-		if (time_after(jiffies, now + 3 * HZ)) {
-		    printk(KERN_ERR "ppa%d: failed to claim parport because a "
-		      "pardevice is owning the port for too longtime!\n",
-			   i);
-		    parport_unregister_device(ppa_hosts[i].dev);
-		    spin_lock_irq(ppa_hosts[i].cur_cmd->device->host->host_lock);
-		    return 0;
-		}
-	    }
-	}
-	ppb = PPA_BASE(i) = ppa_hosts[i].dev->port->base;
-	ppb_hi =  ppa_hosts[i].dev->port->base_hi;
-	w_ctr(ppb, 0x0c);
-	modes = ppa_hosts[i].dev->port->modes;
-
-	/* Mode detection works up the chain of speed
-	 * This avoids a nasty if-then-else-if-... tree
-	 */
-	ppa_hosts[i].mode = PPA_NIBBLE;
-
-	if (modes & PARPORT_MODE_TRISTATE)
-	    ppa_hosts[i].mode = PPA_PS2;
-
-	if (modes & PARPORT_MODE_ECP) {
-	    w_ecr(ppb_hi, 0x20);
-	    ppa_hosts[i].mode = PPA_PS2;
-	}
-	if ((modes & PARPORT_MODE_EPP) && (modes & PARPORT_MODE_ECP))
-	    w_ecr(ppb_hi, 0x80);
-
-	/* Done configuration */
-	ppa_pb_release(i);
-
-	if (ppa_init(i)) {
-	    parport_unregister_device(ppa_hosts[i].dev);
-	    continue;
-	}
-	/* now the glue ... */
-	switch (ppa_hosts[i].mode) {
-	case PPA_NIBBLE:
-	    ports = 3;
-	    break;
-	case PPA_PS2:
-	    ports = 3;
-	    break;
-	case PPA_EPP_8:
-	case PPA_EPP_16:
-	case PPA_EPP_32:
-	    ports = 8;
-	    break;
-	default:		/* Never gets here */
-	    continue;
-	}
-	
-	INIT_WORK(&ppa_hosts[i].ppa_tq, ppa_interrupt, &ppa_hosts[i]);
-
-	host->can_queue = PPA_CAN_QUEUE;
-	host->sg_tablesize = ppa_sg;
-	hreg = scsi_register(host, 0);
-	if(hreg == NULL)
-		continue;
-	hreg->io_port = pb->base;
-	hreg->n_io_port = ports;
-	hreg->dma_channel = -1;
-	hreg->unique_id = i;
-	ppa_hosts[i].host = hreg->host_no;
-	nhosts++;
-    }
-    if (nhosts == 0) {
-	if (try_again == 1) {
-	    printk("WARNING - no ppa compatible devices found.\n");
-	    printk("  As of 31/Aug/1998 Iomega started shipping parallel\n");
-	    printk("  port ZIP drives with a different interface which is\n");
-	    printk("  supported by the imm (ZIP Plus) driver. If the\n");
-	    printk("  cable is marked with \"AutoDetect\", this is what has\n");
-	    printk("  happened.\n");
-	    return 0;
-	}
-	try_again = 1;
-	goto retry_entry;
-    } else
-	return 1;		/* return number of hosts detected */
-}
-
 /* This is to give the ppa driver a way to modify the timings (and other
  * parameters) by writing to the /proc/scsi/ppa/0 file.
  * Very simple method really... (To simple, no error checking :( )
@@ -251,71 +113,71 @@
  * Also gives a method to use a script to obtain optimum timings (TODO)
  */
 
-static inline int ppa_proc_write(int hostno, char *buffer, int length)
+static inline int ppa_proc_write(ppa_struct *dev, char *buffer, int length)
 {
-    unsigned long x;
+	unsigned long x;
 
-    if ((length > 5) && (strncmp(buffer, "mode=", 5) == 0)) {
-	x = simple_strtoul(buffer + 5, NULL, 0);
-	ppa_hosts[hostno].mode = x;
-	return length;
-    }
-    if ((length > 10) && (strncmp(buffer, "recon_tmo=", 10) == 0)) {
-	x = simple_strtoul(buffer + 10, NULL, 0);
-	ppa_hosts[hostno].recon_tmo = x;
-        printk("ppa: recon_tmo set to %ld\n", x);
-	return length;
-    }
-    printk("ppa /proc: invalid variable\n");
-    return (-EINVAL);
-}
-
-int ppa_proc_info(struct Scsi_Host *host, char *buffer, char **start, off_t offset,
-		  int length, int inout)
-{
-    int i;
-    int len = 0;
-
-    for (i = 0; i < 4; i++)
-	if (ppa_hosts[i].host == host->host_no)
-	    break;
-
-    if (inout)
-	return ppa_proc_write(i, buffer, length);
-
-    len += sprintf(buffer + len, "Version : %s\n", PPA_VERSION);
-    len += sprintf(buffer + len, "Parport : %s\n", ppa_hosts[i].dev->port->name);
-    len += sprintf(buffer + len, "Mode    : %s\n", PPA_MODE_STRING[ppa_hosts[i].mode]);
+	if ((length > 5) && (strncmp(buffer, "mode=", 5) == 0)) {
+		x = simple_strtoul(buffer + 5, NULL, 0);
+		dev->mode = x;
+		return length;
+	}
+	if ((length > 10) && (strncmp(buffer, "recon_tmo=", 10) == 0)) {
+		x = simple_strtoul(buffer + 10, NULL, 0);
+		dev->recon_tmo = x;
+		printk("ppa: recon_tmo set to %ld\n", x);
+		return length;
+	}
+	printk("ppa /proc: invalid variable\n");
+	return (-EINVAL);
+}
+
+static int ppa_proc_info(struct Scsi_Host *host, char *buffer, char **start, off_t offset, int length, int inout)
+{
+	int len = 0;
+	ppa_struct *dev = ppa_dev(host);
+
+	if (inout)
+		return ppa_proc_write(dev, buffer, length);
+
+	len += sprintf(buffer + len, "Version : %s\n", PPA_VERSION);
+	len +=
+	    sprintf(buffer + len, "Parport : %s\n",
+		    dev->dev->port->name);
+	len +=
+	    sprintf(buffer + len, "Mode    : %s\n",
+		    PPA_MODE_STRING[dev->mode]);
 #if PPA_DEBUG > 0
-    len += sprintf(buffer + len, "recon_tmo : %lu\n", ppa_hosts[i].recon_tmo);
+	len +=
+	    sprintf(buffer + len, "recon_tmo : %lu\n", dev->recon_tmo);
 #endif
 
-    /* Request for beyond end of buffer */
-    if (offset > length)
-	return 0;
-
-    *start = buffer + offset;
-    len -= offset;
-    if (len > length)
-	len = length;
-    return len;
+	/* Request for beyond end of buffer */
+	if (offset > length)
+		return 0;
+
+	*start = buffer + offset;
+	len -= offset;
+	if (len > length)
+		len = length;
+	return len;
 }
 
-static int device_check(int host_no);
+static int device_check(ppa_struct *dev);
 
 #if PPA_DEBUG > 0
 #define ppa_fail(x,y) printk("ppa: ppa_fail(%i) from %s at line %d\n",\
 	   y, __FUNCTION__, __LINE__); ppa_fail_func(x,y);
-static inline void ppa_fail_func(int host_no, int error_code)
+static inline void ppa_fail_func(ppa_struct *dev, int error_code)
 #else
-static inline void ppa_fail(int host_no, int error_code)
+static inline void ppa_fail(ppa_struct *dev, int error_code)
 #endif
 {
-    /* If we fail a device then we trash status / message bytes */
-    if (ppa_hosts[host_no].cur_cmd) {
-	ppa_hosts[host_no].cur_cmd->result = error_code << 16;
-	ppa_hosts[host_no].failed = 1;
-    }
+	/* If we fail a device then we trash status / message bytes */
+	if (dev->cur_cmd) {
+		dev->cur_cmd->result = error_code << 16;
+		dev->failed = 1;
+	}
 }
 
 /*
@@ -325,33 +187,33 @@
  * doesn't appear to be designed to support interrupts.  We spin on
  * the 0x80 ready bit. 
  */
-static unsigned char ppa_wait(int host_no)
+static unsigned char ppa_wait(ppa_struct *dev)
 {
-    int k;
-    unsigned short ppb = PPA_BASE(host_no);
-    unsigned char r;
-
-    k = PPA_SPIN_TMO;
-    /* Wait for bit 6 and 7 - PJC */
-    for (r = r_str (ppb); ((r & 0xc0)!=0xc0) && (k); k--) {
-	    udelay (1);
-	    r = r_str (ppb);
-    }
-
-    /*
-     * return some status information.
-     * Semantics: 0xc0 = ZIP wants more data
-     *            0xd0 = ZIP wants to send more data
-     *            0xe0 = ZIP is expecting SCSI command data
-     *            0xf0 = end of transfer, ZIP is sending status
-     */
-    if (k)
-	return (r & 0xf0);
-
-    /* Counter expired - Time out occurred */
-    ppa_fail(host_no, DID_TIME_OUT);
-    printk("ppa timeout in ppa_wait\n");
-    return 0;			/* command timed out */
+	int k;
+	unsigned short ppb = dev->base;
+	unsigned char r;
+
+	k = PPA_SPIN_TMO;
+	/* Wait for bit 6 and 7 - PJC */
+	for (r = r_str(ppb); ((r & 0xc0) != 0xc0) && (k); k--) {
+		udelay(1);
+		r = r_str(ppb);
+	}
+
+	/*
+	 * return some status information.
+	 * Semantics: 0xc0 = ZIP wants more data
+	 *            0xd0 = ZIP wants to send more data
+	 *            0xe0 = ZIP is expecting SCSI command data
+	 *            0xf0 = end of transfer, ZIP is sending status
+	 */
+	if (k)
+		return (r & 0xf0);
+
+	/* Counter expired - Time out occurred */
+	ppa_fail(dev, DID_TIME_OUT);
+	printk("ppa timeout in ppa_wait\n");
+	return 0;		/* command timed out */
 }
 
 /*
@@ -359,245 +221,245 @@
  */
 static inline void epp_reset(unsigned short ppb)
 {
-    int i;
+	int i;
 
-    i = r_str(ppb);
-    w_str(ppb, i);
-    w_str(ppb, i & 0xfe);
+	i = r_str(ppb);
+	w_str(ppb, i);
+	w_str(ppb, i & 0xfe);
 }
 
 /* 
  * Wait for empty ECP fifo (if we are in ECP fifo mode only)
  */
-static inline void ecp_sync(unsigned short hostno)
+static inline void ecp_sync(ppa_struct *dev)
 {
-    int i, ppb_hi=ppa_hosts[hostno].dev->port->base_hi;
+	int i, ppb_hi = dev->dev->port->base_hi;
 
-    if (ppb_hi == 0) return;
+	if (ppb_hi == 0)
+		return;
 
-    if ((r_ecr(ppb_hi) & 0xe0) == 0x60) { /* mode 011 == ECP fifo mode */
-        for (i = 0; i < 100; i++) {
-            if (r_ecr(ppb_hi) & 0x01)
-                return;
-            udelay(5);
-        }
-        printk("ppa: ECP sync failed as data still present in FIFO.\n");
-    }
+	if ((r_ecr(ppb_hi) & 0xe0) == 0x60) {	/* mode 011 == ECP fifo mode */
+		for (i = 0; i < 100; i++) {
+			if (r_ecr(ppb_hi) & 0x01)
+				return;
+			udelay(5);
+		}
+		printk("ppa: ECP sync failed as data still present in FIFO.\n");
+	}
 }
 
 static int ppa_byte_out(unsigned short base, const char *buffer, int len)
 {
-    int i;
+	int i;
 
-    for (i = len; i; i--) {
-	w_dtr(base, *buffer++);
-	w_ctr(base, 0xe);
-	w_ctr(base, 0xc);
-    }
-    return 1;			/* All went well - we hope! */
+	for (i = len; i; i--) {
+		w_dtr(base, *buffer++);
+		w_ctr(base, 0xe);
+		w_ctr(base, 0xc);
+	}
+	return 1;		/* All went well - we hope! */
 }
 
 static int ppa_byte_in(unsigned short base, char *buffer, int len)
 {
-    int i;
+	int i;
 
-    for (i = len; i; i--) {
-	*buffer++ = r_dtr(base);
-	w_ctr(base, 0x27);
-	w_ctr(base, 0x25);
-    }
-    return 1;			/* All went well - we hope! */
+	for (i = len; i; i--) {
+		*buffer++ = r_dtr(base);
+		w_ctr(base, 0x27);
+		w_ctr(base, 0x25);
+	}
+	return 1;		/* All went well - we hope! */
 }
 
 static int ppa_nibble_in(unsigned short base, char *buffer, int len)
 {
-    for (; len; len--) {
-	unsigned char h;
+	for (; len; len--) {
+		unsigned char h;
 
-	w_ctr(base, 0x4);
-	h = r_str(base) & 0xf0;
-	w_ctr(base, 0x6);
-	*buffer++ = h | ((r_str(base) & 0xf0) >> 4);
-    }
-    return 1;			/* All went well - we hope! */
+		w_ctr(base, 0x4);
+		h = r_str(base) & 0xf0;
+		w_ctr(base, 0x6);
+		*buffer++ = h | ((r_str(base) & 0xf0) >> 4);
+	}
+	return 1;		/* All went well - we hope! */
 }
 
-static int ppa_out(int host_no, char *buffer, int len)
+static int ppa_out(ppa_struct *dev, char *buffer, int len)
 {
-    int r;
-    unsigned short ppb = PPA_BASE(host_no);
+	int r;
+	unsigned short ppb = dev->base;
 
-    r = ppa_wait(host_no);
+	r = ppa_wait(dev);
 
-    if ((r & 0x50) != 0x40) {
-	ppa_fail(host_no, DID_ERROR);
-	return 0;
-    }
-    switch (ppa_hosts[host_no].mode) {
-    case PPA_NIBBLE:
-    case PPA_PS2:
-	/* 8 bit output, with a loop */
-	r = ppa_byte_out(ppb, buffer, len);
-	break;
-
-    case PPA_EPP_32:
-    case PPA_EPP_16:
-    case PPA_EPP_8:
-	epp_reset(ppb);
-	w_ctr(ppb, 0x4);
+	if ((r & 0x50) != 0x40) {
+		ppa_fail(dev, DID_ERROR);
+		return 0;
+	}
+	switch (dev->mode) {
+	case PPA_NIBBLE:
+	case PPA_PS2:
+		/* 8 bit output, with a loop */
+		r = ppa_byte_out(ppb, buffer, len);
+		break;
+
+	case PPA_EPP_32:
+	case PPA_EPP_16:
+	case PPA_EPP_8:
+		epp_reset(ppb);
+		w_ctr(ppb, 0x4);
 #ifdef CONFIG_SCSI_IZIP_EPP16
-	if (!(((long) buffer | len) & 0x01))
-	    outsw(ppb + 4, buffer, len >> 1);
+		if (!(((long) buffer | len) & 0x01))
+			outsw(ppb + 4, buffer, len >> 1);
 #else
-	if (!(((long) buffer | len) & 0x03))
-	    outsl(ppb + 4, buffer, len >> 2);
+		if (!(((long) buffer | len) & 0x03))
+			outsl(ppb + 4, buffer, len >> 2);
 #endif
-	else
-	    outsb(ppb + 4, buffer, len);
-	w_ctr(ppb, 0xc);
-	r = !(r_str(ppb) & 0x01);
-	w_ctr(ppb, 0xc);
-	ecp_sync(host_no);
-	break;
-
-    default:
-	printk("PPA: bug in ppa_out()\n");
-	r = 0;
-    }
-    return r;
+		else
+			outsb(ppb + 4, buffer, len);
+		w_ctr(ppb, 0xc);
+		r = !(r_str(ppb) & 0x01);
+		w_ctr(ppb, 0xc);
+		ecp_sync(dev);
+		break;
+
+	default:
+		printk("PPA: bug in ppa_out()\n");
+		r = 0;
+	}
+	return r;
 }
 
-static int ppa_in(int host_no, char *buffer, int len)
+static int ppa_in(ppa_struct *dev, char *buffer, int len)
 {
-    int r;
-    unsigned short ppb = PPA_BASE(host_no);
+	int r;
+	unsigned short ppb = dev->base;
 
-    r = ppa_wait(host_no);
+	r = ppa_wait(dev);
 
-    if ((r & 0x50) != 0x50) {
-	ppa_fail(host_no, DID_ERROR);
-	return 0;
-    }
-    switch (ppa_hosts[host_no].mode) {
-    case PPA_NIBBLE:
-	/* 4 bit input, with a loop */
-	r = ppa_nibble_in(ppb, buffer, len);
-	w_ctr(ppb, 0xc);
-	break;
+	if ((r & 0x50) != 0x50) {
+		ppa_fail(dev, DID_ERROR);
+		return 0;
+	}
+	switch (dev->mode) {
+	case PPA_NIBBLE:
+		/* 4 bit input, with a loop */
+		r = ppa_nibble_in(ppb, buffer, len);
+		w_ctr(ppb, 0xc);
+		break;
 
-    case PPA_PS2:
-	/* 8 bit input, with a loop */
-	w_ctr(ppb, 0x25);
-	r = ppa_byte_in(ppb, buffer, len);
-	w_ctr(ppb, 0x4);
-	w_ctr(ppb, 0xc);
-	break;
+	case PPA_PS2:
+		/* 8 bit input, with a loop */
+		w_ctr(ppb, 0x25);
+		r = ppa_byte_in(ppb, buffer, len);
+		w_ctr(ppb, 0x4);
+		w_ctr(ppb, 0xc);
+		break;
 
-    case PPA_EPP_32:
-    case PPA_EPP_16:
-    case PPA_EPP_8:
-	epp_reset(ppb);
-	w_ctr(ppb, 0x24);
+	case PPA_EPP_32:
+	case PPA_EPP_16:
+	case PPA_EPP_8:
+		epp_reset(ppb);
+		w_ctr(ppb, 0x24);
 #ifdef CONFIG_SCSI_IZIP_EPP16
-	if (!(((long) buffer | len) & 0x01))
-	    insw(ppb + 4, buffer, len >> 1);
+		if (!(((long) buffer | len) & 0x01))
+			insw(ppb + 4, buffer, len >> 1);
 #else
-	if (!(((long) buffer | len) & 0x03))
-	    insl(ppb + 4, buffer, len >> 2);
+		if (!(((long) buffer | len) & 0x03))
+			insl(ppb + 4, buffer, len >> 2);
 #endif
-	else
-	    insb(ppb + 4, buffer, len);
-	w_ctr(ppb, 0x2c);
-	r = !(r_str(ppb) & 0x01);
-	w_ctr(ppb, 0x2c);
-	ecp_sync(host_no);
-	break;
-
-    default:
-	printk("PPA: bug in ppa_ins()\n");
-	r = 0;
-	break;
-    }
-    return r;
+		else
+			insb(ppb + 4, buffer, len);
+		w_ctr(ppb, 0x2c);
+		r = !(r_str(ppb) & 0x01);
+		w_ctr(ppb, 0x2c);
+		ecp_sync(dev);
+		break;
+
+	default:
+		printk("PPA: bug in ppa_ins()\n");
+		r = 0;
+		break;
+	}
+	return r;
 }
 
 /* end of ppa_io.h */
 static inline void ppa_d_pulse(unsigned short ppb, unsigned char b)
 {
-    w_dtr(ppb, b);
-    w_ctr(ppb, 0xc);
-    w_ctr(ppb, 0xe);
-    w_ctr(ppb, 0xc);
-    w_ctr(ppb, 0x4);
-    w_ctr(ppb, 0xc);
-}
-
-static void ppa_disconnect(int host_no)
-{
-    unsigned short ppb = PPA_BASE(host_no);
-
-    ppa_d_pulse(ppb, 0);
-    ppa_d_pulse(ppb, 0x3c);
-    ppa_d_pulse(ppb, 0x20);
-    ppa_d_pulse(ppb, 0xf);
+	w_dtr(ppb, b);
+	w_ctr(ppb, 0xc);
+	w_ctr(ppb, 0xe);
+	w_ctr(ppb, 0xc);
+	w_ctr(ppb, 0x4);
+	w_ctr(ppb, 0xc);
+}
+
+static void ppa_disconnect(ppa_struct *dev)
+{
+	unsigned short ppb = dev->base;
+
+	ppa_d_pulse(ppb, 0);
+	ppa_d_pulse(ppb, 0x3c);
+	ppa_d_pulse(ppb, 0x20);
+	ppa_d_pulse(ppb, 0xf);
 }
 
 static inline void ppa_c_pulse(unsigned short ppb, unsigned char b)
 {
-    w_dtr(ppb, b);
-    w_ctr(ppb, 0x4);
-    w_ctr(ppb, 0x6);
-    w_ctr(ppb, 0x4);
-    w_ctr(ppb, 0xc);
-}
-
-static inline void ppa_connect(int host_no, int flag)
-{
-    unsigned short ppb = PPA_BASE(host_no);
-
-    ppa_c_pulse(ppb, 0);
-    ppa_c_pulse(ppb, 0x3c);
-    ppa_c_pulse(ppb, 0x20);
-    if ((flag == CONNECT_EPP_MAYBE) &&
-	IN_EPP_MODE(ppa_hosts[host_no].mode))
-	ppa_c_pulse(ppb, 0xcf);
-    else
-	ppa_c_pulse(ppb, 0x8f);
-}
-
-static int ppa_select(int host_no, int target)
-{
-    int k;
-    unsigned short ppb = PPA_BASE(host_no);
-
-    /*
-     * Bit 6 (0x40) is the device selected bit.
-     * First we must wait till the current device goes off line...
-     */
-    k = PPA_SELECT_TMO;
-    do {
-	k--;
-	udelay(1);
-    } while ((r_str(ppb) & 0x40) && (k));
-    if (!k)
-	return 0;
+	w_dtr(ppb, b);
+	w_ctr(ppb, 0x4);
+	w_ctr(ppb, 0x6);
+	w_ctr(ppb, 0x4);
+	w_ctr(ppb, 0xc);
+}
 
-    w_dtr(ppb, (1 << target));
-    w_ctr(ppb, 0xe);
-    w_ctr(ppb, 0xc);
-    w_dtr(ppb, 0x80);		/* This is NOT the initator */
-    w_ctr(ppb, 0x8);
-
-    k = PPA_SELECT_TMO;
-    do {
-	k--;
-	udelay(1);
-    }
-    while (!(r_str(ppb) & 0x40) && (k));
-    if (!k)
-	return 0;
+static inline void ppa_connect(ppa_struct *dev, int flag)
+{
+	unsigned short ppb = dev->base;
+
+	ppa_c_pulse(ppb, 0);
+	ppa_c_pulse(ppb, 0x3c);
+	ppa_c_pulse(ppb, 0x20);
+	if ((flag == CONNECT_EPP_MAYBE) && IN_EPP_MODE(dev->mode))
+		ppa_c_pulse(ppb, 0xcf);
+	else
+		ppa_c_pulse(ppb, 0x8f);
+}
+
+static int ppa_select(ppa_struct *dev, int target)
+{
+	int k;
+	unsigned short ppb = dev->base;
+
+	/*
+	 * Bit 6 (0x40) is the device selected bit.
+	 * First we must wait till the current device goes off line...
+	 */
+	k = PPA_SELECT_TMO;
+	do {
+		k--;
+		udelay(1);
+	} while ((r_str(ppb) & 0x40) && (k));
+	if (!k)
+		return 0;
+
+	w_dtr(ppb, (1 << target));
+	w_ctr(ppb, 0xe);
+	w_ctr(ppb, 0xc);
+	w_dtr(ppb, 0x80);	/* This is NOT the initator */
+	w_ctr(ppb, 0x8);
+
+	k = PPA_SELECT_TMO;
+	do {
+		k--;
+		udelay(1);
+	}
+	while (!(r_str(ppb) & 0x40) && (k));
+	if (!k)
+		return 0;
 
-    return 1;
+	return 1;
 }
 
 /* 
@@ -609,54 +471,47 @@
  * handshaking failed.
  * 
  */
-static int ppa_init(int host_no)
+static int ppa_init(ppa_struct *dev)
 {
-    int retv;
-    unsigned short ppb = PPA_BASE(host_no);
-
-#if defined(CONFIG_PARPORT) || defined(CONFIG_PARPORT_MODULE)
-    if (ppa_pb_claim(host_no))
-	while (ppa_hosts[host_no].p_busy)
-	    schedule();		/* We can safe schedule here */
-#endif
+	int retv;
+	unsigned short ppb = dev->base;
 
-    ppa_disconnect(host_no);
-    ppa_connect(host_no, CONNECT_NORMAL);
+	ppa_disconnect(dev);
+	ppa_connect(dev, CONNECT_NORMAL);
 
-    retv = 2;			/* Failed */
+	retv = 2;		/* Failed */
 
-    w_ctr(ppb, 0xe);
-    if ((r_str(ppb) & 0x08) == 0x08)
-	retv--;
+	w_ctr(ppb, 0xe);
+	if ((r_str(ppb) & 0x08) == 0x08)
+		retv--;
 
-    w_ctr(ppb, 0xc);
-    if ((r_str(ppb) & 0x08) == 0x00)
-	retv--;
+	w_ctr(ppb, 0xc);
+	if ((r_str(ppb) & 0x08) == 0x00)
+		retv--;
 
-    if (!retv)
-	ppa_reset_pulse(ppb);
-    udelay(1000);		/* Allow devices to settle down */
-    ppa_disconnect(host_no);
-    udelay(1000);		/* Another delay to allow devices to settle */
+	if (!retv)
+		ppa_reset_pulse(ppb);
+	udelay(1000);		/* Allow devices to settle down */
+	ppa_disconnect(dev);
+	udelay(1000);		/* Another delay to allow devices to settle */
 
-    if (!retv)
-	retv = device_check(host_no);
+	if (retv)
+		return -EIO;
 
-    ppa_pb_release(host_no);
-    return retv;
+	return device_check(dev);
 }
 
-static inline int ppa_send_command(Scsi_Cmnd * cmd)
+static inline int ppa_send_command(Scsi_Cmnd *cmd)
 {
-    int host_no = cmd->device->host->unique_id;
-    int k;
+	ppa_struct *dev = ppa_dev(cmd->device->host);
+	int k;
 
-    w_ctr(PPA_BASE(host_no), 0x0c);
+	w_ctr(dev->base, 0x0c);
 
-    for (k = 0; k < cmd->cmd_len; k++)
-	if (!ppa_out(host_no, &cmd->cmnd[k], 1))
-	    return 0;
-    return 1;
+	for (k = 0; k < cmd->cmd_len; k++)
+		if (!ppa_out(dev, &cmd->cmnd[k], 1))
+			return 0;
+	return 1;
 }
 
 /*
@@ -667,98 +522,100 @@
  * The driver appears to remain stable if we speed up the parallel port
  * i/o in this function, but not elsewhere.
  */
-static int ppa_completion(Scsi_Cmnd * cmd)
+static int ppa_completion(Scsi_Cmnd *cmd)
 {
-    /* Return codes:
-     * -1     Error
-     *  0     Told to schedule
-     *  1     Finished data transfer
-     */
-    int host_no = cmd->device->host->unique_id;
-    unsigned short ppb = PPA_BASE(host_no);
-    unsigned long start_jiffies = jiffies;
-
-    unsigned char r, v;
-    int fast, bulk, status;
-
-    v = cmd->cmnd[0];
-    bulk = ((v == READ_6) ||
-	    (v == READ_10) ||
-	    (v == WRITE_6) ||
-	    (v == WRITE_10));
-
-    /*
-     * We only get here if the drive is ready to comunicate,
-     * hence no need for a full ppa_wait.
-     */
-    r = (r_str(ppb) & 0xf0);
+	/* Return codes:
+	 * -1     Error
+	 *  0     Told to schedule
+	 *  1     Finished data transfer
+	 */
+	ppa_struct *dev = ppa_dev(cmd->device->host);
+	unsigned short ppb = dev->base;
+	unsigned long start_jiffies = jiffies;
+
+	unsigned char r, v;
+	int fast, bulk, status;
+
+	v = cmd->cmnd[0];
+	bulk = ((v == READ_6) ||
+		(v == READ_10) || (v == WRITE_6) || (v == WRITE_10));
 
-    while (r != (unsigned char) 0xf0) {
 	/*
-	 * If we have been running for more than a full timer tick
-	 * then take a rest.
+	 * We only get here if the drive is ready to comunicate,
+	 * hence no need for a full ppa_wait.
 	 */
-	if (time_after(jiffies, start_jiffies + 1))
-	    return 0;
+	r = (r_str(ppb) & 0xf0);
 
-	if ((cmd->SCp.this_residual <= 0)) {
-	    ppa_fail(host_no, DID_ERROR);
-	    return -1;		/* ERROR_RETURN */
-	}
-
-	/* On some hardware we have SCSI disconnected (6th bit low)
-	 * for about 100usecs. It is too expensive to wait a 
-	 * tick on every loop so we busy wait for no more than
-	 * 500usecs to give the drive a chance first. We do not 
-	 * change things for "normal" hardware since generally 
-	 * the 6th bit is always high.
-	 * This makes the CPU load higher on some hardware 
-	 * but otherwise we can not get more than 50K/secs 
-	 * on this problem hardware.
-	 */
-	if ((r & 0xc0) != 0xc0) {
-	   /* Wait for reconnection should be no more than 
-	    * jiffy/2 = 5ms = 5000 loops
-	    */
-	   unsigned long k = ppa_hosts[host_no].recon_tmo; 
-	   for (; k && ((r = (r_str(ppb) & 0xf0)) & 0xc0) != 0xc0; k--)
-	     udelay(1);
-
-	   if(!k) 
-	     return 0;
-	}	   
-
-	/* determine if we should use burst I/O */ 
-	fast = (bulk && (cmd->SCp.this_residual >= PPA_BURST_SIZE)) 
-	     ? PPA_BURST_SIZE : 1;
+	while (r != (unsigned char) 0xf0) {
+		/*
+		 * If we have been running for more than a full timer tick
+		 * then take a rest.
+		 */
+		if (time_after(jiffies, start_jiffies + 1))
+			return 0;
+
+		if ((cmd->SCp.this_residual <= 0)) {
+			ppa_fail(dev, DID_ERROR);
+			return -1;	/* ERROR_RETURN */
+		}
 
-	if (r == (unsigned char) 0xc0)
-	    status = ppa_out(host_no, cmd->SCp.ptr, fast);
-	else
-	    status = ppa_in(host_no, cmd->SCp.ptr, fast);
+		/* On some hardware we have SCSI disconnected (6th bit low)
+		 * for about 100usecs. It is too expensive to wait a 
+		 * tick on every loop so we busy wait for no more than
+		 * 500usecs to give the drive a chance first. We do not 
+		 * change things for "normal" hardware since generally 
+		 * the 6th bit is always high.
+		 * This makes the CPU load higher on some hardware 
+		 * but otherwise we can not get more than 50K/secs 
+		 * on this problem hardware.
+		 */
+		if ((r & 0xc0) != 0xc0) {
+			/* Wait for reconnection should be no more than 
+			 * jiffy/2 = 5ms = 5000 loops
+			 */
+			unsigned long k = dev->recon_tmo;
+			for (; k && ((r = (r_str(ppb) & 0xf0)) & 0xc0) != 0xc0;
+			     k--)
+				udelay(1);
 
-	cmd->SCp.ptr += fast;
-	cmd->SCp.this_residual -= fast;
+			if (!k)
+				return 0;
+		}
 
-	if (!status) {
-	    ppa_fail(host_no, DID_BUS_BUSY);
-	    return -1;		/* ERROR_RETURN */
-	}
-	if (cmd->SCp.buffer && !cmd->SCp.this_residual) {
-	    /* if scatter/gather, advance to the next segment */
-	    if (cmd->SCp.buffers_residual--) {
-		cmd->SCp.buffer++;
-		cmd->SCp.this_residual = cmd->SCp.buffer->length;
-		cmd->SCp.ptr = page_address(cmd->SCp.buffer->page) + cmd->SCp.buffer->offset;
-	    }
+		/* determine if we should use burst I/O */
+		fast = (bulk && (cmd->SCp.this_residual >= PPA_BURST_SIZE))
+		    ? PPA_BURST_SIZE : 1;
+
+		if (r == (unsigned char) 0xc0)
+			status = ppa_out(dev, cmd->SCp.ptr, fast);
+		else
+			status = ppa_in(dev, cmd->SCp.ptr, fast);
+
+		cmd->SCp.ptr += fast;
+		cmd->SCp.this_residual -= fast;
+
+		if (!status) {
+			ppa_fail(dev, DID_BUS_BUSY);
+			return -1;	/* ERROR_RETURN */
+		}
+		if (cmd->SCp.buffer && !cmd->SCp.this_residual) {
+			/* if scatter/gather, advance to the next segment */
+			if (cmd->SCp.buffers_residual--) {
+				cmd->SCp.buffer++;
+				cmd->SCp.this_residual =
+				    cmd->SCp.buffer->length;
+				cmd->SCp.ptr =
+				    page_address(cmd->SCp.buffer->page) +
+				    cmd->SCp.buffer->offset;
+			}
+		}
+		/* Now check to see if the drive is ready to comunicate */
+		r = (r_str(ppb) & 0xf0);
+		/* If not, drop back down to the scheduler and wait a timer tick */
+		if (!(r & 0x80))
+			return 0;
 	}
-	/* Now check to see if the drive is ready to comunicate */
-	r = (r_str(ppb) & 0xf0);
-	/* If not, drop back down to the scheduler and wait a timer tick */
-	if (!(r & 0x80))
-	    return 0;
-    }
-    return 1;			/* FINISH_RETURN */
+	return 1;		/* FINISH_RETURN */
 }
 
 /*
@@ -768,203 +625,204 @@
  */
 static void ppa_interrupt(void *data)
 {
-    ppa_struct *tmp = (ppa_struct *) data;
-    Scsi_Cmnd *cmd = tmp->cur_cmd;
-    unsigned long flags;
+	ppa_struct *dev = (ppa_struct *) data;
+	Scsi_Cmnd *cmd = dev->cur_cmd;
 
-    if (!cmd) {
-	printk("PPA: bug in ppa_interrupt\n");
-	return;
-    }
-    if (ppa_engine(tmp, cmd)) {
-	tmp->ppa_tq.data = (void *) tmp;
-	schedule_delayed_work(&tmp->ppa_tq, 1);
-	return;
-    }
-    /* Command must of completed hence it is safe to let go... */
+	if (!cmd) {
+		printk("PPA: bug in ppa_interrupt\n");
+		return;
+	}
+	if (ppa_engine(dev, cmd)) {
+		dev->ppa_tq.data = (void *) dev;
+		schedule_delayed_work(&dev->ppa_tq, 1);
+		return;
+	}
+	/* Command must of completed hence it is safe to let go... */
 #if PPA_DEBUG > 0
-    switch ((cmd->result >> 16) & 0xff) {
-    case DID_OK:
-	break;
-    case DID_NO_CONNECT:
-	printk("ppa: no device at SCSI ID %i\n", cmd->device->target);
-	break;
-    case DID_BUS_BUSY:
-	printk("ppa: BUS BUSY - EPP timeout detected\n");
-	break;
-    case DID_TIME_OUT:
-	printk("ppa: unknown timeout\n");
-	break;
-    case DID_ABORT:
-	printk("ppa: told to abort\n");
-	break;
-    case DID_PARITY:
-	printk("ppa: parity error (???)\n");
-	break;
-    case DID_ERROR:
-	printk("ppa: internal driver error\n");
-	break;
-    case DID_RESET:
-	printk("ppa: told to reset device\n");
-	break;
-    case DID_BAD_INTR:
-	printk("ppa: bad interrupt (???)\n");
-	break;
-    default:
-	printk("ppa: bad return code (%02x)\n", (cmd->result >> 16) & 0xff);
-    }
+	switch ((cmd->result >> 16) & 0xff) {
+	case DID_OK:
+		break;
+	case DID_NO_CONNECT:
+		printk("ppa: no device at SCSI ID %i\n", cmd->device->target);
+		break;
+	case DID_BUS_BUSY:
+		printk("ppa: BUS BUSY - EPP timeout detected\n");
+		break;
+	case DID_TIME_OUT:
+		printk("ppa: unknown timeout\n");
+		break;
+	case DID_ABORT:
+		printk("ppa: told to abort\n");
+		break;
+	case DID_PARITY:
+		printk("ppa: parity error (???)\n");
+		break;
+	case DID_ERROR:
+		printk("ppa: internal driver error\n");
+		break;
+	case DID_RESET:
+		printk("ppa: told to reset device\n");
+		break;
+	case DID_BAD_INTR:
+		printk("ppa: bad interrupt (???)\n");
+		break;
+	default:
+		printk("ppa: bad return code (%02x)\n",
+		       (cmd->result >> 16) & 0xff);
+	}
 #endif
 
-    if (cmd->SCp.phase > 1)
-	ppa_disconnect(cmd->device->host->unique_id);
-    if (cmd->SCp.phase > 0)
-	ppa_pb_release(cmd->device->host->unique_id);
-
-    tmp->cur_cmd = 0;
-    
-    spin_lock_irqsave(cmd->device->host->host_lock, flags);
-    cmd->scsi_done(cmd);
-    spin_unlock_irqrestore(cmd->device->host->host_lock, flags);
-    return;
-}
-
-static int ppa_engine(ppa_struct * tmp, Scsi_Cmnd * cmd)
-{
-    int host_no = cmd->device->host->unique_id;
-    unsigned short ppb = PPA_BASE(host_no);
-    unsigned char l = 0, h = 0;
-    int retv;
-
-    /* First check for any errors that may of occurred
-     * Here we check for internal errors
-     */
-    if (tmp->failed)
-	return 0;
+	if (cmd->SCp.phase > 1)
+		ppa_disconnect(dev);
 
-    switch (cmd->SCp.phase) {
-    case 0:			/* Phase 0 - Waiting for parport */
-	if ((jiffies - tmp->jstart) > HZ) {
-	    /*
-	     * We waited more than a second
-	     * for parport to call us
-	     */
-	    ppa_fail(host_no, DID_BUS_BUSY);
-	    return 0;
-	}
-	return 1;		/* wait until ppa_wakeup claims parport */
-    case 1:			/* Phase 1 - Connected */
-	{			/* Perform a sanity check for cable unplugged */
-	    int retv = 2;	/* Failed */
+	ppa_pb_dismiss(dev);
 
-	    ppa_connect(host_no, CONNECT_EPP_MAYBE);
+	dev->cur_cmd = 0;
 
-	    w_ctr(ppb, 0xe);
-	    if ((r_str(ppb) & 0x08) == 0x08)
-		retv--;
+	cmd->scsi_done(cmd);
+}
 
-	    w_ctr(ppb, 0xc);
-	    if ((r_str(ppb) & 0x08) == 0x00)
-		retv--;
+static int ppa_engine(ppa_struct *dev, Scsi_Cmnd *cmd)
+{
+	unsigned short ppb = dev->base;
+	unsigned char l = 0, h = 0;
+	int retv;
 
-	    if (retv) {
-		if ((jiffies - tmp->jstart) > (1 * HZ)) {
-		    printk("ppa: Parallel port cable is unplugged!!\n");
-		    ppa_fail(host_no, DID_BUS_BUSY);
-		    return 0;
-		} else {
-		    ppa_disconnect(host_no);
-		    return 1;	/* Try again in a jiffy */
-		}
-	    }
-	    cmd->SCp.phase++;
-	}
+	/* First check for any errors that may of occurred
+	 * Here we check for internal errors
+	 */
+	if (dev->failed)
+		return 0;
 
-    case 2:			/* Phase 2 - We are now talking to the scsi bus */
-	if (!ppa_select(host_no, cmd->device->id)) {
-	    ppa_fail(host_no, DID_NO_CONNECT);
-	    return 0;
-	}
-	cmd->SCp.phase++;
+	switch (cmd->SCp.phase) {
+	case 0:		/* Phase 0 - Waiting for parport */
+		if (time_after(jiffies, dev->jstart + HZ)) {
+			/*
+			 * We waited more than a second
+			 * for parport to call us
+			 */
+			ppa_fail(dev, DID_BUS_BUSY);
+			return 0;
+		}
+		return 1;	/* wait until ppa_wakeup claims parport */
+	case 1:		/* Phase 1 - Connected */
+		{		/* Perform a sanity check for cable unplugged */
+			int retv = 2;	/* Failed */
+
+			ppa_connect(dev, CONNECT_EPP_MAYBE);
+
+			w_ctr(ppb, 0xe);
+			if ((r_str(ppb) & 0x08) == 0x08)
+				retv--;
+
+			w_ctr(ppb, 0xc);
+			if ((r_str(ppb) & 0x08) == 0x00)
+				retv--;
+
+			if (retv) {
+				if ((jiffies - dev->jstart) > (1 * HZ)) {
+					printk
+					    ("ppa: Parallel port cable is unplugged!!\n");
+					ppa_fail(dev, DID_BUS_BUSY);
+					return 0;
+				} else {
+					ppa_disconnect(dev);
+					return 1;	/* Try again in a jiffy */
+				}
+			}
+			cmd->SCp.phase++;
+		}
 
-    case 3:			/* Phase 3 - Ready to accept a command */
-	w_ctr(ppb, 0x0c);
-	if (!(r_str(ppb) & 0x80))
-	    return 1;
+	case 2:		/* Phase 2 - We are now talking to the scsi bus */
+		if (!ppa_select(dev, cmd->device->id)) {
+			ppa_fail(dev, DID_NO_CONNECT);
+			return 0;
+		}
+		cmd->SCp.phase++;
 
-	if (!ppa_send_command(cmd))
-	    return 0;
-	cmd->SCp.phase++;
-
-    case 4:			/* Phase 4 - Setup scatter/gather buffers */
-	if (cmd->use_sg) {
-	    /* if many buffers are available, start filling the first */
-	    cmd->SCp.buffer = (struct scatterlist *) cmd->request_buffer;
-	    cmd->SCp.this_residual = cmd->SCp.buffer->length;
-	    cmd->SCp.ptr = page_address(cmd->SCp.buffer->page) + cmd->SCp.buffer->offset;
-	} else {
-	    /* else fill the only available buffer */
-	    cmd->SCp.buffer = NULL;
-	    cmd->SCp.this_residual = cmd->request_bufflen;
-	    cmd->SCp.ptr = cmd->request_buffer;
-	}
-	cmd->SCp.buffers_residual = cmd->use_sg - 1;
-	cmd->SCp.phase++;
+	case 3:		/* Phase 3 - Ready to accept a command */
+		w_ctr(ppb, 0x0c);
+		if (!(r_str(ppb) & 0x80))
+			return 1;
+
+		if (!ppa_send_command(cmd))
+			return 0;
+		cmd->SCp.phase++;
+
+	case 4:		/* Phase 4 - Setup scatter/gather buffers */
+		if (cmd->use_sg) {
+			/* if many buffers are available, start filling the first */
+			cmd->SCp.buffer =
+			    (struct scatterlist *) cmd->request_buffer;
+			cmd->SCp.this_residual = cmd->SCp.buffer->length;
+			cmd->SCp.ptr =
+			    page_address(cmd->SCp.buffer->page) +
+			    cmd->SCp.buffer->offset;
+		} else {
+			/* else fill the only available buffer */
+			cmd->SCp.buffer = NULL;
+			cmd->SCp.this_residual = cmd->request_bufflen;
+			cmd->SCp.ptr = cmd->request_buffer;
+		}
+		cmd->SCp.buffers_residual = cmd->use_sg - 1;
+		cmd->SCp.phase++;
 
-    case 5:			/* Phase 5 - Data transfer stage */
-	w_ctr(ppb, 0x0c);
-	if (!(r_str(ppb) & 0x80))
-	    return 1;
+	case 5:		/* Phase 5 - Data transfer stage */
+		w_ctr(ppb, 0x0c);
+		if (!(r_str(ppb) & 0x80))
+			return 1;
+
+		retv = ppa_completion(cmd);
+		if (retv == -1)
+			return 0;
+		if (retv == 0)
+			return 1;
+		cmd->SCp.phase++;
+
+	case 6:		/* Phase 6 - Read status/message */
+		cmd->result = DID_OK << 16;
+		/* Check for data overrun */
+		if (ppa_wait(dev) != (unsigned char) 0xf0) {
+			ppa_fail(dev, DID_ERROR);
+			return 0;
+		}
+		if (ppa_in(dev, &l, 1)) {	/* read status byte */
+			/* Check for optional message byte */
+			if (ppa_wait(dev) == (unsigned char) 0xf0)
+				ppa_in(dev, &h, 1);
+			cmd->result =
+			    (DID_OK << 16) + (h << 8) + (l & STATUS_MASK);
+		}
+		return 0;	/* Finished */
+		break;
 
-	retv = ppa_completion(cmd);
-	if (retv == -1)
-	    return 0;
-	if (retv == 0)
-	    return 1;
-	cmd->SCp.phase++;
-
-    case 6:			/* Phase 6 - Read status/message */
-	cmd->result = DID_OK << 16;
-	/* Check for data overrun */
-	if (ppa_wait(host_no) != (unsigned char) 0xf0) {
-	    ppa_fail(host_no, DID_ERROR);
-	    return 0;
-	}
-	if (ppa_in(host_no, &l, 1)) {	/* read status byte */
-	    /* Check for optional message byte */
-	    if (ppa_wait(host_no) == (unsigned char) 0xf0)
-		ppa_in(host_no, &h, 1);
-	    cmd->result = (DID_OK << 16) + (h << 8) + (l & STATUS_MASK);
-	}
-	return 0;		/* Finished */
-	break;
-
-    default:
-	printk("ppa: Invalid scsi phase\n");
-    }
-    return 0;
+	default:
+		printk("ppa: Invalid scsi phase\n");
+	}
+	return 0;
 }
 
-int ppa_queuecommand(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *))
+static int ppa_queuecommand(Scsi_Cmnd *cmd, void (*done) (Scsi_Cmnd *))
 {
-    int host_no = cmd->device->host->unique_id;
+	ppa_struct *dev = ppa_dev(cmd->device->host);
 
-    if (ppa_hosts[host_no].cur_cmd) {
-	printk("PPA: bug in ppa_queuecommand\n");
-	return 0;
-    }
-    ppa_hosts[host_no].failed = 0;
-    ppa_hosts[host_no].jstart = jiffies;
-    ppa_hosts[host_no].cur_cmd = cmd;
-    cmd->scsi_done = done;
-    cmd->result = DID_ERROR << 16;	/* default return code */
-    cmd->SCp.phase = 0;		/* bus free */
+	if (dev->cur_cmd) {
+		printk("PPA: bug in ppa_queuecommand\n");
+		return 0;
+	}
+	dev->failed = 0;
+	dev->jstart = jiffies;
+	dev->cur_cmd = cmd;
+	cmd->scsi_done = done;
+	cmd->result = DID_ERROR << 16;	/* default return code */
+	cmd->SCp.phase = 0;	/* bus free */
 
-    ppa_pb_claim(host_no);
+	dev->ppa_tq.data = dev;
+	schedule_work(&dev->ppa_tq);
 
-    ppa_hosts[host_no].ppa_tq.data = ppa_hosts + host_no;
-    schedule_work(&ppa_hosts[host_no].ppa_tq);
+	ppa_pb_claim(dev);
 
-    return 0;
+	return 0;
 }
 
 /*
@@ -973,150 +831,325 @@
  * be done in sd.c.  Even if it gets fixed there, this will still
  * work.
  */
-int ppa_biosparam(struct scsi_device *sdev, struct block_device *dev,
-		sector_t capacity, int ip[])
+static int ppa_biosparam(struct scsi_device *sdev, struct block_device *dev,
+	      sector_t capacity, int ip[])
 {
-    ip[0] = 0x40;
-    ip[1] = 0x20;
-    ip[2] = ((unsigned long)capacity + 1) / (ip[0] * ip[1]);
-    if (ip[2] > 1024) {
-	ip[0] = 0xff;
-	ip[1] = 0x3f;
-	ip[2] = ((unsigned long)capacity + 1) / (ip[0] * ip[1]);
-	if (ip[2] > 1023)
-	    ip[2] = 1023;
-    }
-    return 0;
-}
-
-int ppa_abort(Scsi_Cmnd * cmd)
-{
-    int host_no = cmd->device->host->unique_id;
-    /*
-     * There is no method for aborting commands since Iomega
-     * have tied the SCSI_MESSAGE line high in the interface
-     */
-
-    switch (cmd->SCp.phase) {
-    case 0:			/* Do not have access to parport */
-    case 1:			/* Have not connected to interface */
-	ppa_hosts[host_no].cur_cmd = NULL;	/* Forget the problem */
-	return SUCCESS;
-	break;
-    default:			/* SCSI command sent, can not abort */
-	return FAILED;
-	break;
-    }
+	ip[0] = 0x40;
+	ip[1] = 0x20;
+	ip[2] = ((unsigned long) capacity + 1) / (ip[0] * ip[1]);
+	if (ip[2] > 1024) {
+		ip[0] = 0xff;
+		ip[1] = 0x3f;
+		ip[2] = ((unsigned long) capacity + 1) / (ip[0] * ip[1]);
+		if (ip[2] > 1023)
+			ip[2] = 1023;
+	}
+	return 0;
+}
+
+static int ppa_abort(Scsi_Cmnd *cmd)
+{
+	ppa_struct *dev = ppa_dev(cmd->device->host);
+	/*
+	 * There is no method for aborting commands since Iomega
+	 * have tied the SCSI_MESSAGE line high in the interface
+	 */
+
+	switch (cmd->SCp.phase) {
+	case 0:		/* Do not have access to parport */
+	case 1:		/* Have not connected to interface */
+		dev->cur_cmd = NULL;	/* Forget the problem */
+		return SUCCESS;
+		break;
+	default:		/* SCSI command sent, can not abort */
+		return FAILED;
+		break;
+	}
 }
 
 static void ppa_reset_pulse(unsigned int base)
 {
-    w_dtr(base, 0x40);
-    w_ctr(base, 0x8);
-    udelay(30);
-    w_ctr(base, 0xc);
+	w_dtr(base, 0x40);
+	w_ctr(base, 0x8);
+	udelay(30);
+	w_ctr(base, 0xc);
+}
+
+static int ppa_reset(Scsi_Cmnd *cmd)
+{
+	ppa_struct *dev = ppa_dev(cmd->device->host);
+
+	if (cmd->SCp.phase)
+		ppa_disconnect(dev);
+	dev->cur_cmd = NULL;	/* Forget the problem */
+
+	ppa_connect(dev, CONNECT_NORMAL);
+	ppa_reset_pulse(dev->base);
+	udelay(1000);		/* device settle delay */
+	ppa_disconnect(dev);
+	udelay(1000);		/* device settle delay */
+	return SUCCESS;
 }
 
-int ppa_reset(Scsi_Cmnd * cmd)
+static int device_check(ppa_struct *dev)
 {
-    int host_no = cmd->device->host->unique_id;
+	/* This routine looks for a device and then attempts to use EPP
+	   to send a command. If all goes as planned then EPP is available. */
 
-    if (cmd->SCp.phase)
-	ppa_disconnect(host_no);
-    ppa_hosts[host_no].cur_cmd = NULL;	/* Forget the problem */
+	static char cmd[6] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
+	int loop, old_mode, status, k, ppb = dev->base;
+	unsigned char l;
+
+	old_mode = dev->mode;
+	for (loop = 0; loop < 8; loop++) {
+		/* Attempt to use EPP for Test Unit Ready */
+		if ((ppb & 0x0007) == 0x0000)
+			dev->mode = PPA_EPP_32;
+
+	      second_pass:
+		ppa_connect(dev, CONNECT_EPP_MAYBE);
+		/* Select SCSI device */
+		if (!ppa_select(dev, loop)) {
+			ppa_disconnect(dev);
+			continue;
+		}
+		printk("ppa: Found device at ID %i, Attempting to use %s\n",
+		       loop, PPA_MODE_STRING[dev->mode]);
 
-    ppa_connect(host_no, CONNECT_NORMAL);
-    ppa_reset_pulse(PPA_BASE(host_no));
-    udelay(1000);		/* device settle delay */
-    ppa_disconnect(host_no);
-    udelay(1000);		/* device settle delay */
-    return SUCCESS;
+		/* Send SCSI command */
+		status = 1;
+		w_ctr(ppb, 0x0c);
+		for (l = 0; (l < 6) && (status); l++)
+			status = ppa_out(dev, cmd, 1);
+
+		if (!status) {
+			ppa_disconnect(dev);
+			ppa_connect(dev, CONNECT_EPP_MAYBE);
+			w_dtr(ppb, 0x40);
+			w_ctr(ppb, 0x08);
+			udelay(30);
+			w_ctr(ppb, 0x0c);
+			udelay(1000);
+			ppa_disconnect(dev);
+			udelay(1000);
+			if (dev->mode == PPA_EPP_32) {
+				dev->mode = old_mode;
+				goto second_pass;
+			}
+			return -EIO;
+		}
+		w_ctr(ppb, 0x0c);
+		k = 1000000;	/* 1 Second */
+		do {
+			l = r_str(ppb);
+			k--;
+			udelay(1);
+		} while (!(l & 0x80) && (k));
+
+		l &= 0xf0;
+
+		if (l != 0xf0) {
+			ppa_disconnect(dev);
+			ppa_connect(dev, CONNECT_EPP_MAYBE);
+			ppa_reset_pulse(ppb);
+			udelay(1000);
+			ppa_disconnect(dev);
+			udelay(1000);
+			if (dev->mode == PPA_EPP_32) {
+				dev->mode = old_mode;
+				goto second_pass;
+			}
+			return -EIO;
+		}
+		ppa_disconnect(dev);
+		printk("ppa: Communication established with ID %i using %s\n",
+		       loop, PPA_MODE_STRING[dev->mode]);
+		ppa_connect(dev, CONNECT_EPP_MAYBE);
+		ppa_reset_pulse(ppb);
+		udelay(1000);
+		ppa_disconnect(dev);
+		udelay(1000);
+		return 0;
+	}
+	return -ENODEV;
 }
 
-static int device_check(int host_no)
+static Scsi_Host_Template ppa_template = {
+	.module			= THIS_MODULE,
+	.proc_name		= "ppa",
+	.proc_info		= ppa_proc_info,
+	.name			= "Iomega VPI0 (ppa) interface",
+	.queuecommand		= ppa_queuecommand,
+	.eh_abort_handler	= ppa_abort,
+	.eh_bus_reset_handler	= ppa_reset,
+	.eh_host_reset_handler	= ppa_reset,
+	.bios_param		= ppa_biosparam,
+	.this_id		= -1,
+	.sg_tablesize		= SG_ALL,
+	.cmd_per_lun		= 1,
+	.use_clustering		= ENABLE_CLUSTERING,
+	.can_queue		= 1,
+};
+
+/***************************************************************************
+ *                   Parallel port probing routines                        *
+ ***************************************************************************/
+
+static LIST_HEAD(ppa_hosts);
+
+static int __ppa_attach(struct parport *pb)
 {
-    /* This routine looks for a device and then attempts to use EPP
-       to send a command. If all goes as planned then EPP is available. */
+	struct Scsi_Host *host;
+	DECLARE_WAIT_QUEUE_HEAD(waiting);
+	DEFINE_WAIT(wait);
+	ppa_struct *dev;
+	int ports;
+	int modes, ppb, ppb_hi;
+	int err = -ENOMEM;
 
-    static char cmd[6] =
-    {0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
-    int loop, old_mode, status, k, ppb = PPA_BASE(host_no);
-    unsigned char l;
+	dev = kmalloc(sizeof(ppa_struct), GFP_KERNEL);
+	if (!dev)
+		return -ENOMEM;
+	memset(dev, 0, sizeof(dev));
+	dev->base = -1;
+	dev->mode = PPA_AUTODETECT;
+	dev->recon_tmo = PPA_RECON_TMO;
+	init_waitqueue_head(&waiting);
+	dev->dev = parport_register_device(pb, "ppa", NULL, ppa_wakeup,
+					    NULL, 0, dev);
 
-    old_mode = ppa_hosts[host_no].mode;
-    for (loop = 0; loop < 8; loop++) {
-	/* Attempt to use EPP for Test Unit Ready */
-	if ((ppb & 0x0007) == 0x0000)
-	    ppa_hosts[host_no].mode = PPA_EPP_32;
+	if (!dev->dev)
+		goto out;
 
-      second_pass:
-	ppa_connect(host_no, CONNECT_EPP_MAYBE);
-	/* Select SCSI device */
-	if (!ppa_select(host_no, loop)) {
-	    ppa_disconnect(host_no);
-	    continue;
+	/* Claim the bus so it remembers what we do to the control
+	 * registers. [ CTR and ECP ]
+	 */
+	err = -EBUSY;
+	dev->waiting = &waiting;
+	prepare_to_wait(&waiting, &wait, TASK_UNINTERRUPTIBLE);
+	if (ppa_pb_claim(dev))
+		schedule_timeout(3 * HZ);
+	if (dev->wanted) {
+		printk(KERN_ERR "ppa%d: failed to claim parport because "
+				"a pardevice is owning the port for too long "
+				"time!\n", pb->number);
+		ppa_pb_dismiss(dev);
+		dev->waiting = NULL;
+		finish_wait(&waiting, &wait);
+		goto out1;
 	}
-	printk("ppa: Found device at ID %i, Attempting to use %s\n", loop,
-	       PPA_MODE_STRING[ppa_hosts[host_no].mode]);
-
-	/* Send SCSI command */
-	status = 1;
+	dev->waiting = NULL;
+	finish_wait(&waiting, &wait);
+	ppb = dev->base = dev->dev->port->base;
+	ppb_hi = dev->dev->port->base_hi;
 	w_ctr(ppb, 0x0c);
-	for (l = 0; (l < 6) && (status); l++)
-	    status = ppa_out(host_no, cmd, 1);
+	modes = dev->dev->port->modes;
 
-	if (!status) {
-	    ppa_disconnect(host_no);
-	    ppa_connect(host_no, CONNECT_EPP_MAYBE);
-	    w_dtr(ppb, 0x40);
-	    w_ctr(ppb, 0x08);
-	    udelay(30);
-	    w_ctr(ppb, 0x0c);
-	    udelay(1000);
-	    ppa_disconnect(host_no);
-	    udelay(1000);
-	    if (ppa_hosts[host_no].mode == PPA_EPP_32) {
-		ppa_hosts[host_no].mode = old_mode;
-		goto second_pass;
-	    }
-	    printk("ppa: Unable to establish communication, aborting driver load.\n");
-	    return 1;
+	/* Mode detection works up the chain of speed
+	 * This avoids a nasty if-then-else-if-... tree
+	 */
+	dev->mode = PPA_NIBBLE;
+
+	if (modes & PARPORT_MODE_TRISTATE)
+		dev->mode = PPA_PS2;
+
+	if (modes & PARPORT_MODE_ECP) {
+		w_ecr(ppb_hi, 0x20);
+		dev->mode = PPA_PS2;
 	}
-	w_ctr(ppb, 0x0c);
-	k = 1000000;		/* 1 Second */
-	do {
-	    l = r_str(ppb);
-	    k--;
-	    udelay(1);
-	} while (!(l & 0x80) && (k));
-
-	l &= 0xf0;
-
-	if (l != 0xf0) {
-	    ppa_disconnect(host_no);
-	    ppa_connect(host_no, CONNECT_EPP_MAYBE);
-	    ppa_reset_pulse(ppb);
-	    udelay(1000);
-	    ppa_disconnect(host_no);
-	    udelay(1000);
-	    if (ppa_hosts[host_no].mode == PPA_EPP_32) {
-		ppa_hosts[host_no].mode = old_mode;
-		goto second_pass;
-	    }
-	    printk("ppa: Unable to establish communication, aborting driver load.\n");
-	    return 1;
-	}
-	ppa_disconnect(host_no);
-	printk("ppa: Communication established with ID %i using %s\n", loop,
-	       PPA_MODE_STRING[ppa_hosts[host_no].mode]);
-	ppa_connect(host_no, CONNECT_EPP_MAYBE);
-	ppa_reset_pulse(ppb);
-	udelay(1000);
-	ppa_disconnect(host_no);
-	udelay(1000);
+	if ((modes & PARPORT_MODE_EPP) && (modes & PARPORT_MODE_ECP))
+		w_ecr(ppb_hi, 0x80);
+
+	/* Done configuration */
+
+	err = ppa_init(dev);
+	ppa_pb_release(dev);
+
+	if (err)
+		goto out1;
+
+	/* now the glue ... */
+	switch (dev->mode) {
+	case PPA_NIBBLE:
+		ports = 3;
+		break;
+	case PPA_PS2:
+		ports = 3;
+		break;
+	case PPA_EPP_8:
+	case PPA_EPP_16:
+	case PPA_EPP_32:
+		ports = 8;
+		break;
+	default:	/* Never gets here */
+		BUG();
+	}
+
+	INIT_WORK(&dev->ppa_tq, ppa_interrupt, dev);
+
+	err = -ENOMEM;
+	host = scsi_host_alloc(&ppa_template, sizeof(ppa_struct *));
+	if (!host)
+		goto out1;
+	host->io_port = pb->base;
+	host->n_io_port = ports;
+	host->dma_channel = -1;
+	host->unique_id = pb->number;
+	*(ppa_struct **)&host->hostdata = dev;
+	dev->host = host;
+	list_add_tail(&dev->list, &ppa_hosts);
+	err = scsi_add_host(host, NULL);
+	if (err)
+		goto out2;
+	scsi_scan_host(host);
 	return 0;
-    }
-    printk("ppa: No devices found, aborting driver load.\n");
-    return 1;
+out2:
+	list_del_init(&dev->list);
+	scsi_host_put(host);
+out1:
+	parport_unregister_device(dev->dev);
+out:
+	kfree(dev);
+	return err;
+}
+
+static void ppa_attach(struct parport *pb)
+{
+	__ppa_attach(pb);
+}
+
+static void ppa_detach(struct parport *pb)
+{
+	ppa_struct *dev;
+	list_for_each_entry(dev, &ppa_hosts, list) {
+		if (dev->dev->port == pb) {
+			list_del_init(&dev->list);
+			scsi_remove_host(dev->host);
+			scsi_host_put(dev->host);
+			parport_unregister_device(dev->dev);
+			kfree(dev);
+			break;
+		}
+	}
 }
+
+static struct parport_driver ppa_driver = {
+	.name	= "ppa",
+	.attach	= ppa_attach,
+	.detach	= ppa_detach,
+};
+
+static int __init ppa_driver_init(void)
+{
+	printk("ppa: Version %s\n", PPA_VERSION);
+	return parport_register_driver(&ppa_driver);
+}
+
+static void __exit ppa_driver_exit(void)
+{
+	parport_unregister_driver(&ppa_driver);
+}
+
+module_init(ppa_driver_init);
+module_exit(ppa_driver_exit);
 MODULE_LICENSE("GPL");
--- diff/drivers/scsi/ppa.h	2003-08-20 14:16:13.000000000 +0100
+++ source/drivers/scsi/ppa.h	2004-02-09 10:39:55.000000000 +0000
@@ -73,7 +73,6 @@
  */
 /* ------ END OF USER CONFIGURABLE PARAMETERS ----- */
 
-#ifdef PPA_CODE
 #include  <linux/config.h>
 #include  <linux/stddef.h>
 #include  <linux/module.h>
@@ -115,11 +114,7 @@
 #endif
     "Unknown"};
 
-/* This is a global option */
-int ppa_sg = SG_ALL;		/* enable/disable scatter-gather. */
-
 /* other options */
-#define PPA_CAN_QUEUE   1	/* use "queueing" interface */
 #define PPA_BURST_SIZE	512	/* data burst size */
 #define PPA_SELECT_TMO  5000	/* how long to wait for target ? */
 #define PPA_SPIN_TMO    50000	/* ppa_wait loop limiter */
@@ -152,23 +147,5 @@
 #endif
 
 static int ppa_engine(ppa_struct *, Scsi_Cmnd *);
-static int ppa_in(int, char *, int);
-static int ppa_init(int);
-static void ppa_interrupt(void *);
-static int ppa_out(int, char *, int);
-
-#else
-#define ppa_release 0
-#endif
-
-int ppa_detect(Scsi_Host_Template *);
-const char *ppa_info(struct Scsi_Host *);
-int ppa_command(Scsi_Cmnd *);
-int ppa_queuecommand(Scsi_Cmnd *, void (*done) (Scsi_Cmnd *));
-int ppa_abort(Scsi_Cmnd *);
-int ppa_reset(Scsi_Cmnd *);
-int ppa_proc_info(struct Scsi_Host *host, char *, char **, off_t, int, int);
-int ppa_biosparam(struct scsi_device *, struct block_device *,
-		sector_t, int *);
 
 #endif				/* _PPA_H */
--- diff/drivers/scsi/qla2xxx/Kconfig	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/scsi/qla2xxx/Kconfig	2004-02-09 10:39:55.000000000 +0000
@@ -1,29 +1,41 @@
-config SCSI_QLA2XXX_CONFIG
+config SCSI_QLA2XXX
 	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
+	tristate "QLogic ISP2100 host adapter family support"
+	depends on SCSI_QLA2XXX
 	---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
+	tristate "QLogic ISP2200 host adapter family support"
+	depends on SCSI_QLA2XXX
 	---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
+config SCSI_QLA2300
+	tristate "QLogic ISP2300 host adapter family support"
+	depends on SCSI_QLA2XXX
+	---help---
+	This driver supports the QLogic 2300 (ISP2300, and ISP2312) host
+	adapter family.
+
+config SCSI_QLA2322
+	tristate "QLogic ISP2322 host adapter family support"
+	depends on SCSI_QLA2XXX
+	---help---
+	This driver supports the QLogic 2322 (ISP2322) host adapter family.
+
+config SCSI_QLA6312
+	tristate "QLogic ISP6312 host adapter family support"
+	depends on SCSI_QLA2XXX
+	---help---
+	This driver supports the QLogic 6312 (ISP6312) host adapter family.
+
+config SCSI_QLA6322
+	tristate "QLogic ISP6322 host adapter family support"
+	depends on SCSI_QLA2XXX
 	---help---
-	This driver supports the QLogic 23xx (ISP2300, ISP2312, and ISP2322)
-	host adapter family.
+	This driver supports the QLogic 6322 (ISP6322) host adapter family.
--- diff/drivers/scsi/qla2xxx/Makefile	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/scsi/qla2xxx/Makefile	2004-02-09 10:39:55.000000000 +0000
@@ -1,12 +1,18 @@
-EXTRA_CFLAGS += -g -Idrivers/scsi -DUNIQUE_FW_NAME
+EXTRA_CFLAGS += -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
+qla2300-y := ql2300.o ql2300_fw.o
+qla2322-y := ql2322.o ql2322_fw.o
+qla6312-y := ql6312.o ql6312_fw.o
+qla6322-y := ql6322.o ql6322_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
+obj-$(CONFIG_SCSI_QLA2300) += qla2xxx.o qla2300.o
+obj-$(CONFIG_SCSI_QLA2322) += qla2xxx.o qla2322.o
+obj-$(CONFIG_SCSI_QLA6312) += qla2xxx.o qla6312.o
+obj-$(CONFIG_SCSI_QLA6322) += qla2xxx.o qla6322.o
--- diff/drivers/scsi/qla2xxx/ql2300.c	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/scsi/qla2xxx/ql2300.c	2004-02-09 10:39:55.000000000 +0000
@@ -1,5 +1,5 @@
 /*
- * QLogic ISP23XX device driver for Linux 2.6.x
+ * QLogic ISP2300 device driver for Linux 2.6.x
  * Copyright (C) 2003 Christoph Hellwig.
  * Copyright (C) 2003 QLogic Corporation (www.qlogic.com)
  *
@@ -15,80 +15,33 @@
 
 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;
+extern unsigned char  fw2300ipx_version[];
+extern unsigned char  fw2300ipx_version_str[];
+extern unsigned short fw2300ipx_addr01;
+extern unsigned short fw2300ipx_code01[];
+extern unsigned short fw2300ipx_length01;
 
 static struct qla_fw_info qla_fw_tbl[] = {
 	{
 		.addressing	= FW_INFO_ADDR_NORMAL,
-		.fwcode		= &fw2300tpx_code01[0],
-		.fwlen		= &fw2300tpx_length01,
-		.fwstart	= &fw2300tpx_addr01,
+		.fwcode		= &fw2300ipx_code01[0],
+		.fwlen		= &fw2300ipx_length01,
+		.fwstart	= &fw2300ipx_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[] = {
@@ -99,7 +52,6 @@
 		.subdevice	= PCI_ANY_ID,
 		.driver_data	= (unsigned long)&qla_board_tbl[0],
 	},
-
 	{
 		.vendor		= PCI_VENDOR_ID_QLOGIC,
 		.device		= PCI_DEVICE_ID_QLOGIC_ISP2312,
@@ -107,16 +59,6 @@
 		.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);
@@ -157,5 +99,5 @@
 module_exit(qla2300_exit);
 
 MODULE_AUTHOR("QLogic Corporation");
-MODULE_DESCRIPTION("QLogic ISP23xx FC-SCSI Host Bus Adapter driver");
+MODULE_DESCRIPTION("QLogic ISP2300 FC-SCSI Host Bus Adapter driver");
 MODULE_LICENSE("GPL");
--- diff/drivers/scsi/qla2xxx/ql2300_fw.c	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/scsi/qla2xxx/ql2300_fw.c	2004-02-09 10:39:55.000000000 +0000
@@ -18,44 +18,44 @@
  *************************************************************************/
 
 /*
- *	Firmware Version 3.02.18 (10:33 Nov 03, 2003)
+ *	Firmware Version 3.02.21 (16:31 Jan 19, 2004)
  */
 
 #ifdef UNIQUE_FW_NAME
-unsigned short fw2300tpx_version = 3*1024+2;
+unsigned short fw2300ipx_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};
+unsigned char fw2300ipx_version_str[] = {3, 2,21};
 #else
-unsigned char firmware_version[] = {3, 2,18};
+unsigned char firmware_version[] = {3, 2,21};
 #endif
 
 #ifdef UNIQUE_FW_NAME
-#define fw2300tpx_VERSION_STRING "3.02.18"
+#define fw2300ipx_VERSION_STRING "3.02.21"
 #else
-#define FW_VERSION_STRING "3.02.18"
+#define FW_VERSION_STRING "3.02.21"
 #endif
 
 #ifdef UNIQUE_FW_NAME
-unsigned short fw2300tpx_addr01 = 0x0800 ;
+unsigned short fw2300ipx_addr01 = 0x0800 ;
 #else
 unsigned short risc_code_addr01 = 0x0800 ;
 #endif
 
 #ifdef UNIQUE_FW_NAME
-unsigned short fw2300tpx_code01[] = { 
+unsigned short fw2300ipx_code01[] = { 
 #else
 unsigned short risc_code01[] = { 
 #endif
-	0x0470, 0x0000, 0x0000, 0xcf5b, 0x0000, 0x0003, 0x0002, 0x0012,
-	0x0117, 0x2043, 0x4f50, 0x5952, 0x4947, 0x4854, 0x2032, 0x3030,
+	0x0470, 0x0000, 0x0000, 0xe666, 0x0000, 0x0003, 0x0002, 0x0015,
+	0x0137, 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,
+	0x332e, 0x3032, 0x2e32, 0x3120, 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,
@@ -63,3375 +63,3545 @@
 	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,
+	0x0000, 0x20c1, 0x0004, 0x20c9, 0x1bff, 0x2059, 0x0000, 0x2b78,
+	0x7883, 0x0004, 0x2089, 0x2bdb, 0x2051, 0x1800, 0x2a70, 0x20e1,
+	0x0001, 0x20e9, 0x0001, 0x2009, 0x0000, 0x080c, 0x0e51, 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,
+	0x4104, 0x8001, 0x1de0, 0x756e, 0x7672, 0x776a, 0x7476, 0x747a,
+	0x00e6, 0x2071, 0x1abf, 0x2472, 0x00ee, 0x20a1, 0x1cd0, 0x7170,
 	0x810d, 0x810d, 0x810d, 0x810d, 0x918c, 0x000f, 0x2001, 0x0001,
-	0x9112, 0x900e, 0x21a8, 0x4104, 0x8211, 0x1de0, 0x7168, 0x3400,
+	0x9112, 0x900e, 0x21a8, 0x4104, 0x8211, 0x1de0, 0x7170, 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,
+	0x20a9, 0x0800, 0x4104, 0x8211, 0x1dd8, 0x080c, 0x0f18, 0x080c,
+	0x5e06, 0x080c, 0xab01, 0x080c, 0x10cf, 0x080c, 0x12e4, 0x080c,
+	0x1afa, 0x080c, 0x0d69, 0x080c, 0x1054, 0x080c, 0x32d0, 0x080c,
+	0x7479, 0x080c, 0x675b, 0x080c, 0x8485, 0x080c, 0x81bc, 0x080c,
+	0x232a, 0x080c, 0x8d27, 0x080c, 0x7b3e, 0x080c, 0x2163, 0x080c,
+	0x2297, 0x080c, 0x231f, 0x2091, 0x3009, 0x7883, 0x0000, 0x1004,
+	0x091f, 0x7880, 0x9086, 0x0002, 0x1190, 0x7883, 0x4000, 0x7837,
+	0x4000, 0x7833, 0x0010, 0x0e04, 0x0913, 0x2091, 0x5000, 0x2091,
+	0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x1192, 0x2071,
+	0x1800, 0x7003, 0x0000, 0x2071, 0x1800, 0x7000, 0x908e, 0x0003,
+	0x1178, 0x080c, 0x49c0, 0x080c, 0x32f7, 0x080c, 0x74ea, 0x080c,
+	0x6c9c, 0x080c, 0x8563, 0x080c, 0x81e5, 0x080c, 0x2b45, 0x0c58,
+	0x000b, 0x0c78, 0x0944, 0x0945, 0x0ae7, 0x0942, 0x0bae, 0x0d68,
+	0x0d68, 0x0d68, 0x080c, 0x0dd5, 0x0005, 0x0126, 0x00f6, 0x2091,
+	0x8000, 0x7000, 0x9086, 0x0001, 0x1904, 0x0aba, 0x080c, 0x54c6,
+	0x1130, 0x0026, 0x2011, 0x0080, 0x080c, 0x0edf, 0x002e, 0x080c,
+	0x717d, 0x0150, 0x080c, 0x71a0, 0x15a0, 0x2079, 0x0100, 0x7828,
+	0x9085, 0x1800, 0x782a, 0x0468, 0x080c, 0x70af, 0x7000, 0x9086,
+	0x0001, 0x1904, 0x0aba, 0x7098, 0x9086, 0x0028, 0x1904, 0x0aba,
+	0x080c, 0x81b4, 0x080c, 0x81a6, 0x2001, 0x0161, 0x2003, 0x0001,
+	0x2079, 0x0100, 0x7827, 0xffff, 0x7a28, 0x9295, 0x5e2f, 0x7a2a,
+	0x2011, 0x7013, 0x080c, 0x8285, 0x2011, 0x7006, 0x080c, 0x835c,
+	0x2011, 0x5c61, 0x080c, 0x8285, 0x2011, 0x8030, 0x901e, 0x7396,
+	0x04d0, 0x080c, 0x550e, 0x2079, 0x0100, 0x7844, 0x9005, 0x1904,
+	0x0aba, 0x2011, 0x5c61, 0x080c, 0x8285, 0x2011, 0x7013, 0x080c,
+	0x8285, 0x2011, 0x7006, 0x080c, 0x835c, 0x2001, 0x0265, 0x2001,
+	0x0205, 0x2003, 0x0000, 0x7840, 0x9084, 0xfffb, 0x7842, 0x2001,
+	0x19a4, 0x2004, 0x9005, 0x1140, 0x00c6, 0x2061, 0x0100, 0x080c,
+	0x5dae, 0x00ce, 0x0804, 0x0aba, 0x780f, 0x006b, 0x7a28, 0x080c,
+	0x7185, 0x0118, 0x9295, 0x5e2f, 0x0010, 0x9295, 0x402f, 0x7a2a,
+	0x2011, 0x8010, 0x73d8, 0x2001, 0x19a5, 0x2003, 0x0001, 0x080c,
+	0x2a0b, 0x080c, 0x48fb, 0x7248, 0xc284, 0x724a, 0x2001, 0x180c,
+	0x200c, 0xc1ac, 0xc1cc, 0x2102, 0x080c, 0xa213, 0x2011, 0x0004,
+	0x080c, 0xc835, 0x080c, 0x65f0, 0x080c, 0x717d, 0x1120, 0x080c,
+	0x2a4f, 0x02e0, 0x0400, 0x080c, 0x5db5, 0x0140, 0x7097, 0x0001,
+	0x70d3, 0x0000, 0x080c, 0x56db, 0x0804, 0x0aba, 0x080c, 0x54b7,
+	0xd094, 0x0188, 0x2011, 0x180c, 0x2204, 0xc0cd, 0x2012, 0x080c,
+	0x54bb, 0xd0d4, 0x1118, 0x080c, 0x2a4f, 0x1270, 0x2011, 0x180c,
+	0x2204, 0xc0bc, 0x00a8, 0x080c, 0x54bb, 0xd0d4, 0x1db8, 0x2011,
+	0x180c, 0x2204, 0xc0bd, 0x0060, 0x2011, 0x180c, 0x2204, 0xc0bd,
+	0x2012, 0x080c, 0x672f, 0x1128, 0xd0a4, 0x0118, 0x2204, 0xc0fd,
+	0x2012, 0x080c, 0x66f5, 0x0120, 0x7a0c, 0xc2b4, 0x7a0e, 0x00a8,
+	0x707f, 0x0000, 0x080c, 0x717d, 0x1130, 0x70b0, 0x9005, 0x1168,
+	0x080c, 0xcc6a, 0x0050, 0x080c, 0xcc6a, 0x70dc, 0xd09c, 0x1128,
+	0x70b0, 0x9005, 0x0110, 0x080c, 0x5d8b, 0x70e7, 0x0000, 0x70e3,
+	0x0000, 0x70a7, 0x0000, 0x080c, 0x2a57, 0x0228, 0x2011, 0x0101,
+	0x2204, 0xc0c4, 0x2012, 0x72dc, 0x080c, 0x717d, 0x1178, 0x9016,
+	0x0016, 0x080c, 0x2808, 0x2019, 0x196d, 0x211a, 0x001e, 0x705f,
+	0xffff, 0x7063, 0x00ef, 0x7083, 0x0000, 0x0020, 0x2019, 0x196d,
+	0x201b, 0x0000, 0x2079, 0x1847, 0x7804, 0xd0ac, 0x0108, 0xc295,
+	0x72de, 0x080c, 0x717d, 0x0118, 0x9296, 0x0004, 0x0548, 0x2011,
+	0x0001, 0x080c, 0xc835, 0x70ab, 0x0000, 0x70af, 0xffff, 0x7003,
+	0x0002, 0x2079, 0x0100, 0x7827, 0x0003, 0x7828, 0x9085, 0x0003,
+	0x782a, 0x00fe, 0x080c, 0x2e48, 0x2011, 0x0005, 0x080c, 0xa349,
+	0x080c, 0x941c, 0x080c, 0x717d, 0x0148, 0x00c6, 0x2061, 0x0100,
+	0x0016, 0x080c, 0x2808, 0x61e2, 0x001e, 0x00ce, 0x012e, 0x0420,
+	0x70ab, 0x0000, 0x70af, 0xffff, 0x7003, 0x0002, 0x00f6, 0x2079,
+	0x0100, 0x7827, 0x0003, 0x7828, 0x9085, 0x0003, 0x782a, 0x00fe,
+	0x2011, 0x0005, 0x080c, 0xa349, 0x080c, 0x941c, 0x080c, 0x717d,
+	0x0148, 0x00c6, 0x2061, 0x0100, 0x0016, 0x080c, 0x2808, 0x61e2,
+	0x001e, 0x00ce, 0x00fe, 0x012e, 0x0005, 0x00c6, 0x00b6, 0x080c,
+	0x717d, 0x1118, 0x20a9, 0x0800, 0x0010, 0x20a9, 0x0782, 0x080c,
+	0x717d, 0x1110, 0x900e, 0x0010, 0x2009, 0x007e, 0x86ff, 0x0138,
+	0x9180, 0x1000, 0x2004, 0x905d, 0x0110, 0xb800, 0xd0bc, 0x090c,
+	0x3166, 0x8108, 0x1f04, 0x0ace, 0x707f, 0x0000, 0x7080, 0x9084,
+	0x00ff, 0x7082, 0x70b3, 0x0000, 0x00be, 0x00ce, 0x0005, 0x00b6,
+	0x0126, 0x2091, 0x8000, 0x7000, 0x9086, 0x0002, 0x1904, 0x0bab,
+	0x70ac, 0x9086, 0xffff, 0x0130, 0x080c, 0x2e48, 0x080c, 0x941c,
+	0x0804, 0x0bab, 0x70dc, 0xd0ac, 0x1110, 0xd09c, 0x0558, 0xd084,
+	0x0548, 0x0006, 0x2001, 0x0103, 0x2003, 0x002b, 0x000e, 0xd08c,
+	0x0508, 0x080c, 0x31c9, 0x11d0, 0x70e0, 0x9086, 0xffff, 0x01b0,
+	0x080c, 0x2fda, 0x080c, 0x941c, 0x70dc, 0xd094, 0x1904, 0x0bab,
+	0x2011, 0x0001, 0x080c, 0xcf18, 0x0110, 0x2011, 0x0003, 0x901e,
+	0x080c, 0x3014, 0x080c, 0x941c, 0x0804, 0x0bab, 0x70e4, 0x9005,
+	0x1904, 0x0bab, 0x70a8, 0x9005, 0x1904, 0x0bab, 0x70dc, 0xd0a4,
+	0x0118, 0xd0b4, 0x0904, 0x0bab, 0x080c, 0x66f5, 0x1904, 0x0bab,
+	0x080c, 0x6748, 0x1904, 0x0bab, 0x080c, 0x672f, 0x01c0, 0x0156,
+	0x00c6, 0x20a9, 0x007f, 0x900e, 0x0016, 0x080c, 0x63cd, 0x1118,
+	0xb800, 0xd0ec, 0x1138, 0x001e, 0x8108, 0x1f04, 0x0b44, 0x00ce,
+	0x015e, 0x0028, 0x001e, 0x00ce, 0x015e, 0x0804, 0x0bab, 0x0006,
+	0x2001, 0x0103, 0x2003, 0x002b, 0x000e, 0x2011, 0x19b1, 0x080c,
+	0x0f88, 0x2011, 0x19cb, 0x080c, 0x0f88, 0x7030, 0xc08c, 0x7032,
+	0x7003, 0x0003, 0x70af, 0xffff, 0x080c, 0x54c6, 0x1130, 0x0026,
+	0x2011, 0x0040, 0x080c, 0x0edf, 0x002e, 0x9006, 0x080c, 0x269c,
+	0x080c, 0x31c9, 0x0118, 0x080c, 0x4a98, 0x0050, 0x0036, 0x0046,
+	0x2019, 0xffff, 0x2021, 0x0006, 0x080c, 0x4ab2, 0x004e, 0x003e,
+	0x00f6, 0x2079, 0x0100, 0x080c, 0x71a0, 0x0150, 0x080c, 0x717d,
+	0x7828, 0x0118, 0x9084, 0xe1ff, 0x0010, 0x9084, 0xffdf, 0x782a,
+	0x00fe, 0x2001, 0x19e6, 0x2004, 0x9086, 0x0005, 0x1120, 0x2011,
+	0x0000, 0x080c, 0xa349, 0x2011, 0x0000, 0x080c, 0xa353, 0x080c,
+	0x941c, 0x080c, 0x9548, 0x012e, 0x00be, 0x0005, 0x0016, 0x0046,
+	0x00f6, 0x0126, 0x2091, 0x8000, 0x2079, 0x0100, 0x7904, 0x918c,
+	0xfffd, 0x7906, 0x2009, 0x00f7, 0x080c, 0x5d74, 0x7940, 0x918c,
+	0x0010, 0x7942, 0x7924, 0xd1b4, 0x0110, 0x7827, 0x0040, 0xd19c,
+	0x0110, 0x7827, 0x0008, 0x0006, 0x0036, 0x0156, 0x7954, 0xd1ac,
+	0x1904, 0x0c3b, 0x2001, 0x19a5, 0x2004, 0x9005, 0x1518, 0x080c,
+	0x2ad2, 0x1148, 0x2001, 0x0001, 0x080c, 0x2a3a, 0x2001, 0x0001,
+	0x080c, 0x2a1d, 0x00b8, 0x080c, 0x2ada, 0x1138, 0x9006, 0x080c,
+	0x2a3a, 0x9006, 0x080c, 0x2a1d, 0x0068, 0x080c, 0x2ae2, 0x1d50,
+	0x2001, 0x1996, 0x2004, 0xd0fc, 0x0108, 0x0020, 0x080c, 0x2834,
+	0x0804, 0x0d1a, 0x080c, 0x718e, 0x0148, 0x080c, 0x71a0, 0x1118,
+	0x080c, 0x7474, 0x0050, 0x080c, 0x7185, 0x0dd0, 0x080c, 0x746f,
+	0x080c, 0x7465, 0x080c, 0x70af, 0x0058, 0x080c, 0x717d, 0x0140,
+	0x2009, 0x00f8, 0x080c, 0x5d74, 0x7843, 0x0090, 0x7843, 0x0010,
+	0x20a9, 0x09c4, 0x7820, 0xd09c, 0x1138, 0x080c, 0x717d, 0x0138,
+	0x7824, 0xd0ac, 0x1904, 0x0d1f, 0x1f04, 0x0c1a, 0x0070, 0x7824,
+	0x080c, 0x7197, 0x0118, 0xd0ac, 0x1904, 0x0d1f, 0x9084, 0x1800,
+	0x0d98, 0x7003, 0x0001, 0x0804, 0x0d1f, 0x2001, 0x0001, 0x080c,
+	0x269c, 0x0804, 0x0d32, 0x2001, 0x19a5, 0x2004, 0x9005, 0x1518,
+	0x080c, 0x2ad2, 0x1148, 0x2001, 0x0001, 0x080c, 0x2a3a, 0x2001,
+	0x0001, 0x080c, 0x2a1d, 0x00b8, 0x080c, 0x2ada, 0x1138, 0x9006,
+	0x080c, 0x2a3a, 0x9006, 0x080c, 0x2a1d, 0x0068, 0x080c, 0x2ae2,
+	0x1d50, 0x2001, 0x1996, 0x2004, 0xd0fc, 0x0108, 0x0020, 0x080c,
+	0x2834, 0x0804, 0x0d1a, 0x7850, 0x9085, 0x0040, 0x7852, 0x7938,
+	0x7850, 0x9084, 0xfbcf, 0x7852, 0x080c, 0x2aea, 0x9085, 0x2000,
+	0x7852, 0x793a, 0x20a9, 0x0046, 0x1d04, 0x0c74, 0x080c, 0x833c,
+	0x1f04, 0x0c74, 0x7850, 0x9085, 0x0400, 0x9084, 0xdfbf, 0x7852,
+	0x793a, 0x080c, 0x718e, 0x0148, 0x080c, 0x71a0, 0x1118, 0x080c,
+	0x7474, 0x0050, 0x080c, 0x7185, 0x0dd0, 0x080c, 0x746f, 0x080c,
+	0x7465, 0x080c, 0x70af, 0x0020, 0x2009, 0x00f8, 0x080c, 0x5d74,
+	0x20a9, 0x0028, 0xa001, 0x1f04, 0x0c9a, 0x7850, 0x9085, 0x1400,
+	0x7852, 0x080c, 0x717d, 0x0120, 0x7843, 0x0090, 0x7843, 0x0010,
+	0x2021, 0xe678, 0x2019, 0xea60, 0x0d0c, 0x833c, 0x7820, 0xd09c,
+	0x1580, 0x080c, 0x717d, 0x0904, 0x0cff, 0x7824, 0xd0ac, 0x1904,
+	0x0d1f, 0x080c, 0x71a0, 0x1528, 0x0046, 0x2021, 0x0320, 0x8421,
+	0x1df0, 0x004e, 0x7827, 0x1800, 0x080c, 0x2aea, 0x7824, 0x9084,
+	0x1800, 0x1160, 0x9484, 0x0fff, 0x1138, 0x2001, 0x1810, 0x2004,
+	0xd0fc, 0x0110, 0x080c, 0x0d45, 0x8421, 0x1158, 0x1d04, 0x0cda,
+	0x080c, 0x833c, 0x080c, 0x746f, 0x080c, 0x7465, 0x7003, 0x0001,
+	0x04f0, 0x8319, 0x1948, 0x1d04, 0x0ce7, 0x080c, 0x833c, 0x2009,
+	0x1999, 0x2104, 0x9005, 0x0118, 0x8001, 0x200a, 0x1178, 0x200b,
+	0x000a, 0x7827, 0x0048, 0x20a9, 0x0002, 0x080c, 0x2acb, 0x7924,
+	0x080c, 0x2aea, 0xd19c, 0x0110, 0x080c, 0x2a0b, 0x00d8, 0x080c,
+	0x718e, 0x1140, 0x94a2, 0x03e8, 0x1128, 0x080c, 0x7155, 0x7003,
+	0x0001, 0x00a8, 0x7827, 0x1800, 0x080c, 0x2aea, 0x7824, 0x080c,
+	0x7197, 0x0110, 0xd0ac, 0x1158, 0x9084, 0x1800, 0x0950, 0x7003,
+	0x0001, 0x0028, 0x2001, 0x0001, 0x080c, 0x269c, 0x0078, 0x2009,
+	0x180c, 0x210c, 0xd19c, 0x1120, 0x7904, 0x918d, 0x0002, 0x7906,
+	0x7827, 0x0048, 0x7828, 0x9085, 0x0028, 0x782a, 0x7850, 0x9085,
+	0x0400, 0x7852, 0x2001, 0x19a5, 0x2003, 0x0000, 0x9006, 0x78f2,
+	0x015e, 0x003e, 0x000e, 0x080c, 0x54c6, 0x1110, 0x080c, 0x0e62,
+	0x012e, 0x00fe, 0x004e, 0x001e, 0x0005, 0x0006, 0x0016, 0x0036,
+	0x0046, 0x00b6, 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x0156, 0x0069,
+	0x0d0c, 0x833c, 0x015e, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be,
+	0x004e, 0x003e, 0x001e, 0x000e, 0x0005, 0x00e6, 0x2071, 0x189e,
+	0x7004, 0x9086, 0x0001, 0x1110, 0x080c, 0x32f7, 0x00ee, 0x0005,
+	0x0005, 0x2a70, 0x2061, 0x19a9, 0x2063, 0x0003, 0x6007, 0x0002,
+	0x600b, 0x0015, 0x600f, 0x0137, 0x2001, 0x197c, 0x900e, 0x2102,
+	0x7196, 0x2001, 0x0100, 0x2004, 0x9082, 0x0002, 0x0218, 0x705f,
+	0xffff, 0x0008, 0x715e, 0x7067, 0xffff, 0x717e, 0x7182, 0x080c,
+	0xcc6a, 0x2061, 0x196c, 0x6003, 0x0909, 0x6106, 0x600b, 0x8800,
+	0x600f, 0x0200, 0x6013, 0x00ff, 0x6017, 0x001f, 0x611a, 0x601f,
+	0x07d0, 0x2061, 0x1974, 0x6003, 0x8000, 0x6106, 0x610a, 0x600f,
+	0x0200, 0x6013, 0x00ff, 0x6116, 0x601b, 0x0001, 0x611e, 0x2061,
+	0x1987, 0x6003, 0x514c, 0x6007, 0x4f47, 0x600b, 0x4943, 0x600f,
+	0x2020, 0x2001, 0x182c, 0x2102, 0x0005, 0x9016, 0x080c, 0x63cd,
+	0x1178, 0xb804, 0x90c4, 0x00ff, 0x98c6, 0x0006, 0x0128, 0x90c4,
+	0xff00, 0x98c6, 0x0600, 0x1120, 0x9186, 0x0080, 0x0108, 0x8210,
+	0x8108, 0x9186, 0x0800, 0x1d50, 0x2208, 0x0005, 0x2091, 0x8000,
+	0x2079, 0x0000, 0x000e, 0x00f6, 0x0010, 0x2091, 0x8000, 0x0e04,
+	0x0dd7, 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, 0x1a99, 0x7a08,
+	0x226a, 0x2069, 0x1a9a, 0x7a18, 0x226a, 0x8d68, 0x7a1c, 0x226a,
+	0x782c, 0x2019, 0x1aa7, 0x201a, 0x2019, 0x1aaa, 0x9016, 0x7808,
+	0xd09c, 0x0168, 0x7820, 0x201a, 0x8210, 0x8318, 0x9386, 0x1abf,
+	0x0108, 0x0ca8, 0x7808, 0xd09c, 0x0110, 0x2011, 0xdead, 0x2019,
+	0x1aa8, 0x782c, 0x201a, 0x8318, 0x221a, 0x7803, 0x0000, 0x2069,
+	0x1a79, 0x901e, 0x20a9, 0x0020, 0x7b26, 0x7a28, 0x226a, 0x8d68,
+	0x8318, 0x1f04, 0x0e24, 0x002e, 0x003e, 0x00de, 0x015e, 0x2079,
+	0x1800, 0x7803, 0x0005, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004,
+	0xd084, 0x0180, 0x2001, 0x1a17, 0x2004, 0x9005, 0x0128, 0x2001,
+	0x008b, 0x2004, 0xd0fc, 0x0dd8, 0x2001, 0x008a, 0x2003, 0x0002,
+	0x2003, 0x1001, 0x080c, 0x54c6, 0x1110, 0x080c, 0x0e99, 0x0cd0,
+	0x0005, 0x918c, 0x03ff, 0x2001, 0x0003, 0x2004, 0x9084, 0x0600,
+	0x1118, 0x918d, 0x2800, 0x0010, 0x918d, 0x2000, 0x2001, 0x017f,
+	0x2102, 0x0005, 0x00f6, 0x0006, 0x2079, 0x1827, 0x2f04, 0x8000,
+	0x207a, 0x080c, 0x2ae2, 0x1150, 0x0006, 0x2001, 0x1996, 0x2004,
+	0xd0fc, 0x000e, 0x1118, 0x9082, 0x7530, 0x0010, 0x9082, 0x000f,
+	0x0258, 0x9006, 0x207a, 0x2079, 0x182a, 0x2f04, 0x9084, 0x0001,
+	0x9086, 0x0001, 0x207a, 0x0090, 0x2079, 0x182a, 0x2f7c, 0x8fff,
+	0x1138, 0x0026, 0x2011, 0x0080, 0x080c, 0x0edf, 0x002e, 0x0030,
+	0x0026, 0x2011, 0x0000, 0x080c, 0x0edf, 0x002e, 0x000e, 0x00fe,
+	0x0005, 0x0026, 0x0126, 0x2011, 0x0080, 0x080c, 0x0edf, 0x20a9,
+	0x0fff, 0x080c, 0x0f00, 0x2011, 0x0040, 0x04c9, 0x20a9, 0x0fff,
+	0x080c, 0x0f00, 0x0c80, 0x7038, 0xd0b4, 0x1128, 0x0026, 0x2011,
+	0x0040, 0x0469, 0x002e, 0x0005, 0x7038, 0xd0b4, 0x1128, 0x0026,
+	0x2011, 0x0080, 0x0421, 0x002e, 0x0005, 0x0026, 0x70ef, 0x0000,
+	0x0459, 0x1148, 0x080c, 0x2ae2, 0x1118, 0x2011, 0x8484, 0x0058,
+	0x2011, 0x8282, 0x0040, 0x080c, 0x2ae2, 0x1118, 0x2011, 0xcdc5,
+	0x0010, 0x2011, 0xcac2, 0x00e9, 0x002e, 0x0005, 0xd0b4, 0x0130,
+	0x0006, 0x3b00, 0x9084, 0xff3f, 0x20d8, 0x000e, 0x0005, 0x0016,
+	0x3b08, 0x3a00, 0x9104, 0x918d, 0x00c0, 0x21d8, 0x9084, 0xff3f,
+	0x9205, 0x20d0, 0x001e, 0x0005, 0x2001, 0x183a, 0x2004, 0xd0dc,
+	0x0005, 0x9e86, 0x1800, 0x190c, 0x0dd5, 0x70e8, 0xd0e4, 0x0108,
+	0xc2e5, 0x72ea, 0xd0e4, 0x1118, 0x9294, 0x00c0, 0x0c01, 0x0005,
+	0x1d04, 0x0f00, 0x2091, 0x6000, 0x1f04, 0x0f00, 0x0005, 0x890e,
+	0x810e, 0x810f, 0x9194, 0x003f, 0x918c, 0xffc0, 0x0005, 0x0006,
+	0x2200, 0x914d, 0x894f, 0x894d, 0x894d, 0x000e, 0x000e, 0x0005,
+	0x01d6, 0x0146, 0x0036, 0x0096, 0x2061, 0x188d, 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, 0x189d, 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, 0x0f07, 0x2100, 0x9300,
+	0x2098, 0x22e0, 0x009e, 0x002e, 0x001e, 0x0036, 0x3518, 0x20a9,
+	0x0001, 0x4002, 0x8007, 0x4004, 0x8319, 0x1dd8, 0x003e, 0x0005,
+	0x20e9, 0x0001, 0x71b8, 0x81ff, 0x11c0, 0x9006, 0x2009, 0x0200,
+	0x20a9, 0x0002, 0x9298, 0x0018, 0x23a0, 0x4001, 0x2009, 0x0700,
+	0x20a9, 0x0002, 0x9298, 0x0008, 0x23a0, 0x4001, 0x707c, 0x8007,
+	0x7180, 0x810f, 0x20a9, 0x0002, 0x4001, 0x9298, 0x000c, 0x23a0,
+	0x900e, 0x080c, 0x0db5, 0x2001, 0x0000, 0x810f, 0x20a9, 0x0002,
+	0x4001, 0x0005, 0x89ff, 0x0140, 0xa804, 0xa807, 0x0000, 0x0006,
+	0x080c, 0x1032, 0x009e, 0x0cb0, 0x0005, 0x00e6, 0x2071, 0x1800,
+	0x080c, 0x10ab, 0x090c, 0x0dd5, 0x00ee, 0x0005, 0x0086, 0x00e6,
+	0x0006, 0x0026, 0x0036, 0x0126, 0x2091, 0x8000, 0x00c9, 0x2071,
+	0x1800, 0x73c0, 0x702c, 0x9016, 0x9045, 0x0158, 0x8210, 0x9906,
+	0x090c, 0x0dd5, 0x2300, 0x9202, 0x0120, 0x1a0c, 0x0dd5, 0xa000,
+	0x0c98, 0x012e, 0x003e, 0x002e, 0x000e, 0x00ee, 0x008e, 0x0005,
+	0x0086, 0x00e6, 0x0006, 0x0126, 0x2091, 0x8000, 0x2071, 0x1910,
+	0x7010, 0x9005, 0x0140, 0x7018, 0x9045, 0x0128, 0x9906, 0x090c,
+	0x0dd5, 0xa000, 0x0cc8, 0x012e, 0x000e, 0x00ee, 0x008e, 0x0005,
+	0x00e6, 0x2071, 0x1800, 0x0126, 0x2091, 0x8000, 0x70c0, 0x8001,
+	0x0270, 0x70c2, 0x702c, 0x2048, 0x9085, 0x0001, 0xa800, 0x702e,
+	0xa803, 0x0000, 0xa807, 0x0000, 0x012e, 0x00ee, 0x0005, 0x904e,
+	0x0cd8, 0x00e6, 0x0126, 0x2091, 0x8000, 0x2071, 0x1800, 0x70c0,
+	0x90ca, 0x0020, 0x0268, 0x8001, 0x70c2, 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, 0x70c0, 0x8000, 0x70c2, 0x080c,
+	0x81a6, 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, 0x188d, 0x7000, 0x9005, 0x11a0,
+	0x2001, 0x0534, 0xa802, 0x2048, 0x2009, 0x4d00, 0x8940, 0x2800,
+	0xa802, 0xa95e, 0xa863, 0x0001, 0x8420, 0x9886, 0x0800, 0x0120,
+	0x2848, 0x9188, 0x0040, 0x0c90, 0x2071, 0x188d, 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,
+	0x74be, 0x74c2, 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, 0x188d, 0x7010, 0x9902, 0x1228,
+	0x9085, 0x0001, 0x001e, 0x00ee, 0x0005, 0x9006, 0x0cd8, 0x00e6,
+	0x2071, 0x1a16, 0x7007, 0x0000, 0x9006, 0x701e, 0x7022, 0x7002,
+	0x2071, 0x0000, 0x7010, 0x9085, 0x8044, 0x7012, 0x00ee, 0x0005,
+	0x0126, 0x2091, 0x8000, 0x00e6, 0xa06f, 0x0000, 0x2071, 0x1a16,
+	0x701c, 0x9088, 0x1a20, 0x280a, 0x8000, 0x9084, 0x003f, 0x701e,
+	0x7120, 0x9106, 0x090c, 0x0dd5, 0x7004, 0x9005, 0x1128, 0x00f6,
+	0x2079, 0x0080, 0x00a9, 0x00fe, 0x00ee, 0x012e, 0x0005, 0x0126,
+	0x2091, 0x8000, 0x00e6, 0x2071, 0x1a16, 0x7004, 0x9005, 0x1128,
+	0x00f6, 0x2079, 0x0080, 0x0021, 0x00fe, 0x00ee, 0x012e, 0x0005,
+	0x7004, 0x9086, 0x0000, 0x1110, 0x7007, 0x0006, 0x7000, 0x0002,
+	0x1122, 0x12a5, 0x1120, 0x1120, 0x1299, 0x1299, 0x1299, 0x1299,
+	0x080c, 0x0dd5, 0x701c, 0x7120, 0x9106, 0x1148, 0x792c, 0x9184,
+	0x0001, 0x1120, 0xd1fc, 0x1110, 0x7007, 0x0000, 0x0005, 0x0096,
+	0x9180, 0x1a20, 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, 0x1a16, 0x2104, 0xc095, 0x200a, 0x080c,
+	0x10ff, 0x0005, 0x0016, 0x00e6, 0x2071, 0x1a16, 0x00f6, 0x2079,
+	0x0080, 0x792c, 0xd1bc, 0x190c, 0x0dce, 0x782b, 0x0002, 0xd1fc,
+	0x0120, 0x918c, 0x0700, 0x7004, 0x0023, 0x00fe, 0x00ee, 0x001e,
+	0x0005, 0x1110, 0x11b8, 0x11ec, 0x12c4, 0x0dd5, 0x12df, 0x0dd5,
+	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,
+	0x1155, 0x0005, 0x7008, 0x0096, 0x2048, 0xa86f, 0x0100, 0x009e,
+	0x7007, 0x0000, 0x080c, 0x1110, 0x0005, 0x7008, 0x0096, 0x2048,
+	0xa86f, 0x0200, 0x009e, 0x0ca0, 0x918c, 0x0700, 0x1150, 0x700c,
+	0x9005, 0x0180, 0x7800, 0x7802, 0x7804, 0x7806, 0x080c, 0x116a,
+	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, 0x18b9,
+	0x2004, 0x9906, 0x1128, 0xa89c, 0x080f, 0x00de, 0x009e, 0x00a0,
+	0x00de, 0x009e, 0x0096, 0x00d6, 0x7008, 0x2048, 0x0081, 0x0150,
+	0xa89c, 0x0086, 0x2940, 0x080f, 0x008e, 0x00de, 0x009e, 0x080c,
+	0x10ff, 0x0005, 0x00de, 0x009e, 0x080c, 0x10ff, 0x0005, 0xa8a8,
+	0xd08c, 0x0005, 0x0096, 0xa0a0, 0x904d, 0x090c, 0x0dd5, 0xa06c,
+	0x908e, 0x0100, 0x0130, 0xa87b, 0x0030, 0xa883, 0x0000, 0xa897,
+	0x4002, 0x080c, 0x6a3a, 0xa09f, 0x0000, 0xa0a3, 0x0000, 0x2848,
+	0x080c, 0x1032, 0x009e, 0x0005, 0x00a6, 0xa0a0, 0x904d, 0x090c,
+	0x0dd5, 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,
+	0x10e0, 0x00e8, 0xa97c, 0xa894, 0x0016, 0x0006, 0x080c, 0x6a3a,
+	0x000e, 0x001e, 0xd1fc, 0x1138, 0xd1f4, 0x0128, 0x00c6, 0x2060,
+	0x080c, 0xab6b, 0x00ce, 0x7008, 0x2048, 0xa89f, 0x0000, 0xa8a3,
+	0x0000, 0x080c, 0x1032, 0x7007, 0x0000, 0x080c, 0x10ff, 0x00ae,
+	0x0005, 0x0126, 0x2091, 0x8000, 0x782b, 0x1001, 0x7007, 0x0005,
+	0x7000, 0xc094, 0x7002, 0x012e, 0x0005, 0x0096, 0x2001, 0x192e,
+	0x204c, 0xa87c, 0x7812, 0xa88c, 0x7802, 0xa890, 0x7806, 0xa894,
+	0x780a, 0xa898, 0x780e, 0x782b, 0x0020, 0x0126, 0x2091, 0x8000,
+	0x782b, 0x0041, 0x7007, 0x0003, 0x7000, 0xc084, 0x7002, 0x2900,
+	0x700a, 0x012e, 0x009e, 0x0005, 0x20e1, 0x0000, 0x2099, 0x0088,
+	0x782b, 0x0040, 0x0096, 0x2001, 0x192e, 0x204c, 0xaa7c, 0x009e,
+	0x080c, 0x879b, 0x2009, 0x188c, 0x2104, 0x9084, 0xfffc, 0x200a,
+	0x080c, 0x860e, 0x7007, 0x0000, 0x080c, 0x1110, 0x0005, 0x7007,
+	0x0000, 0x080c, 0x1110, 0x0005, 0x0126, 0x2091, 0x2200, 0x2079,
+	0x0300, 0x2071, 0x1a60, 0x7003, 0x0000, 0x78bf, 0x00f6, 0x00c1,
+	0x7803, 0x0003, 0x780f, 0x0000, 0x20a9, 0x03ce, 0x2061, 0xe6bb,
+	0x2c0d, 0x7912, 0xe104, 0x9ce0, 0x0002, 0x7916, 0x1f04, 0x12f8,
+	0x7807, 0x0007, 0x7803, 0x0000, 0x7803, 0x0001, 0x012e, 0x0005,
+	0x00c6, 0x7803, 0x0000, 0x7808, 0xd09c, 0x0118, 0x7820, 0x04a9,
+	0x0cd0, 0x2001, 0x1a61, 0x2003, 0x0000, 0x78ab, 0x0004, 0x78ac,
+	0xd0ac, 0x1de8, 0x78ab, 0x0002, 0x7807, 0x0007, 0x7827, 0x0030,
+	0x782b, 0x0400, 0x7827, 0x0031, 0x782b, 0x1a79, 0x781f, 0xff00,
+	0x781b, 0xff00, 0x2001, 0x0200, 0x2004, 0xd0dc, 0x0110, 0x781f,
+	0x0303, 0x2061, 0x1a79, 0x602f, 0x1cd0, 0x2001, 0x181a, 0x2004,
+	0x9082, 0x1cd0, 0x6032, 0x603b, 0x1f4a, 0x604f, 0x193c, 0x2001,
+	0x1927, 0x2004, 0x6042, 0x00ce, 0x0005, 0x9086, 0x000d, 0x11d0,
+	0x7808, 0xd09c, 0x01b8, 0x7820, 0x0026, 0x2010, 0x080c, 0xc813,
+	0x0180, 0x2260, 0x6000, 0x9086, 0x0004, 0x1158, 0x0016, 0x6120,
+	0x9186, 0x0009, 0x0108, 0x0020, 0x2009, 0x004c, 0x080c, 0xabe6,
+	0x001e, 0x002e, 0x0005, 0x0126, 0x2091, 0x2200, 0x7908, 0x9184,
+	0x0070, 0x190c, 0x0dce, 0xd19c, 0x0158, 0x7820, 0x908c, 0xf000,
+	0x15e8, 0x908a, 0x0024, 0x1a0c, 0x0dd5, 0x0023, 0x012e, 0x0005,
+	0x012e, 0x0005, 0x139e, 0x139e, 0x13b5, 0x13ba, 0x13be, 0x13c3,
+	0x13eb, 0x13ef, 0x13fd, 0x1401, 0x139e, 0x14cc, 0x14d0, 0x1535,
+	0x153c, 0x139e, 0x153d, 0x153e, 0x1549, 0x1550, 0x139e, 0x139e,
+	0x139e, 0x139e, 0x139e, 0x139e, 0x139e, 0x13c5, 0x139e, 0x139e,
+	0x139e, 0x139e, 0x139e, 0x139e, 0x13a2, 0x13a0, 0x080c, 0x0dd5,
+	0x080c, 0x0dce, 0x080c, 0x155b, 0x2009, 0x1a78, 0x2104, 0x8000,
+	0x200a, 0x080c, 0x7c01, 0x080c, 0x19ff, 0x0005, 0x2009, 0x0048,
+	0x2060, 0x080c, 0xabe6, 0x012e, 0x0005, 0x7004, 0xc085, 0xc0b5,
+	0x7006, 0x0005, 0x7004, 0xc085, 0x7006, 0x0005, 0x080c, 0x155b,
+	0x080c, 0x161f, 0x0005, 0x080c, 0x0dd5, 0x080c, 0x155b, 0x2060,
+	0x6014, 0x0096, 0x2048, 0xa83b, 0xffff, 0x009e, 0x2009, 0x0048,
+	0x080c, 0xabe6, 0x2001, 0x015d, 0x2003, 0x0000, 0x2009, 0x03e8,
+	0x8109, 0x0160, 0x2001, 0x0201, 0x2004, 0x9005, 0x0dc8, 0x2001,
+	0x0218, 0x2004, 0xd0ec, 0x1110, 0x080c, 0x1560, 0x2001, 0x0307,
+	0x2003, 0x8000, 0x0005, 0x7004, 0xc095, 0x7006, 0x0005, 0x080c,
+	0x155b, 0x2060, 0x6014, 0x0096, 0x2048, 0xa83b, 0xffff, 0x009e,
+	0x2009, 0x0048, 0x080c, 0xabe6, 0x0005, 0x080c, 0x155b, 0x080c,
+	0x0dd5, 0x080c, 0x155b, 0x080c, 0x14b7, 0x7827, 0x0018, 0x79ac,
+	0xd1dc, 0x0904, 0x146a, 0x7827, 0x0015, 0x7828, 0x782b, 0x0000,
+	0x9065, 0x0140, 0x2001, 0x020d, 0x2003, 0x0050, 0x2003, 0x0020,
+	0x0804, 0x1470, 0x7004, 0x9005, 0x01c8, 0x1188, 0x78ab, 0x0004,
+	0x7827, 0x0018, 0x782b, 0x0000, 0xd1bc, 0x090c, 0x0dd5, 0x2001,
+	0x020d, 0x2003, 0x0050, 0x2003, 0x0020, 0x0804, 0x149c, 0x78ab,
+	0x0004, 0x7803, 0x0001, 0x080c, 0x14d0, 0x0005, 0x7827, 0x0018,
+	0xa001, 0x7828, 0x7827, 0x0011, 0xa001, 0x7928, 0x9106, 0x0110,
+	0x79ac, 0x08e0, 0x00e6, 0x2071, 0x0200, 0x702c, 0xd0c4, 0x0140,
+	0x00ee, 0x080c, 0x19ff, 0x080c, 0x1308, 0x7803, 0x0001, 0x0005,
+	0x7037, 0x0001, 0xa001, 0x7150, 0x00ee, 0x918c, 0xff00, 0x9186,
+	0x0500, 0x0110, 0x79ac, 0x0810, 0x7004, 0xc09d, 0x7006, 0x78ab,
+	0x0004, 0x7803, 0x0001, 0x080c, 0x14d0, 0x2001, 0x020d, 0x2003,
+	0x0020, 0x0005, 0x7828, 0x782b, 0x0000, 0x9065, 0x090c, 0x0dd5,
+	0x6014, 0x2048, 0x78ab, 0x0004, 0x918c, 0x0700, 0x0198, 0x080c,
+	0x7c01, 0x080c, 0x19ff, 0x080c, 0xc825, 0x0158, 0xa9ac, 0xa936,
+	0xa9b0, 0xa93a, 0xa83f, 0xffff, 0xa843, 0xffff, 0xa880, 0xc0bd,
+	0xa882, 0x0005, 0x6020, 0x9086, 0x0009, 0x1128, 0x2009, 0x004c,
+	0x080c, 0xabe6, 0x0048, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be,
+	0xd0bc, 0x6024, 0x190c, 0xcc03, 0x2029, 0x00c8, 0x8529, 0x0128,
+	0x2001, 0x0201, 0x2004, 0x9005, 0x0dc8, 0x7dbc, 0x080c, 0xe664,
+	0xd5a4, 0x1118, 0x080c, 0x1560, 0x0005, 0x080c, 0x7c01, 0x080c,
+	0x19ff, 0x0005, 0x781f, 0x0300, 0x7803, 0x0001, 0x0005, 0x0016,
+	0x0066, 0x0076, 0x00f6, 0x2079, 0x0300, 0x7908, 0x918c, 0x0007,
+	0x9186, 0x0003, 0x0120, 0x2001, 0x0016, 0x080c, 0x15d1, 0x00fe,
+	0x007e, 0x006e, 0x001e, 0x0005, 0x7004, 0xc09d, 0x7006, 0x0005,
+	0x7104, 0x9184, 0x0004, 0x190c, 0x0dd5, 0xd184, 0x1189, 0xd19c,
+	0x0158, 0xc19c, 0x7106, 0x2001, 0x020d, 0x2003, 0x0050, 0x2003,
+	0x0020, 0x080c, 0x1560, 0x0005, 0x81ff, 0x190c, 0x0dd5, 0x0005,
+	0xc184, 0xd1b4, 0xc1b4, 0x7106, 0x0016, 0x00e6, 0x15f0, 0x2071,
+	0x0200, 0x080c, 0x160c, 0x05c8, 0x6014, 0x9005, 0x05b0, 0x0096,
+	0x2048, 0xa864, 0x009e, 0x9084, 0x00ff, 0x908e, 0x0029, 0x0160,
+	0x908e, 0x0048, 0x1550, 0x601c, 0xd084, 0x11e0, 0x00f6, 0x2c78,
+	0x080c, 0x1689, 0x00fe, 0x00b0, 0x00f6, 0x2c78, 0x080c, 0x180e,
+	0x00fe, 0x2009, 0x01f4, 0x8109, 0x0168, 0x2001, 0x0201, 0x2004,
+	0x9005, 0x0dc8, 0x2001, 0x0218, 0x2004, 0xd0ec, 0x1118, 0x080c,
+	0x1560, 0x0040, 0x2001, 0x020d, 0x2003, 0x0020, 0x080c, 0x1308,
 	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,
+	0x0050, 0x2003, 0x0020, 0x0461, 0x0ca8, 0x0429, 0x2060, 0x2009,
+	0x0053, 0x080c, 0xabe6, 0x0005, 0x0005, 0x0005, 0x00e1, 0x2008,
+	0x00d1, 0x0006, 0x7004, 0xc09d, 0x7006, 0x000e, 0x080c, 0x8af8,
+	0x0005, 0x0089, 0x9005, 0x0118, 0x080c, 0x86fb, 0x0cd0, 0x0005,
+	0x2001, 0x0036, 0x2009, 0x1820, 0x210c, 0x2011, 0x181f, 0x2214,
+	0x080c, 0x15d1, 0x0005, 0x7808, 0xd09c, 0x0de8, 0x7820, 0x0005,
+	0x080c, 0x14b7, 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, 0x15c3, 0x6827, 0x0001, 0x8109, 0x1dd0, 0x04d9,
+	0x6827, 0x0002, 0x04c1, 0x6804, 0x9005, 0x1130, 0x682c, 0xd0e4,
+	0x1500, 0x6804, 0x9005, 0x0de8, 0x79b8, 0xd1ec, 0x1130, 0x08c0,
+	0x080c, 0x7c01, 0x080c, 0x19ff, 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, 0x1363, 0x00ce, 0x002e, 0x001e,
+	0x000e, 0x0006, 0x7832, 0x7936, 0x7a3a, 0x781b, 0x8080, 0x0059,
+	0x1118, 0x000e, 0x00fe, 0x0005, 0x000e, 0x792c, 0x3900, 0x8000,
+	0x2004, 0x080c, 0x0dd5, 0x2009, 0xff00, 0x8109, 0x0120, 0x7818,
+	0xd0bc, 0x1dd8, 0x0005, 0x9085, 0x0001, 0x0005, 0x7832, 0x7936,
+	0x7a3a, 0x781b, 0x8080, 0x0c79, 0x1108, 0x0005, 0x792c, 0x3900,
+	0x8000, 0x2004, 0x080c, 0x0dd5, 0x7037, 0x0001, 0x7150, 0x7037,
+	0x0002, 0x7050, 0x2060, 0xd1bc, 0x1110, 0x7054, 0x2060, 0x918c,
+	0xff00, 0x9186, 0x0500, 0x0110, 0x9085, 0x0001, 0x0005, 0x00e6,
+	0x0016, 0x2071, 0x0200, 0x0c41, 0x6124, 0xd1dc, 0x01f8, 0x701c,
+	0xd08c, 0x0904, 0x167e, 0x7017, 0x0000, 0x2001, 0x0264, 0x2004,
+	0xd0bc, 0x0904, 0x167e, 0x2001, 0x0268, 0x00c6, 0x2064, 0x6104,
+	0x6038, 0x00ce, 0x918e, 0x0039, 0x1904, 0x167e, 0x9c06, 0x15f0,
+	0x0126, 0x2091, 0x2600, 0x080c, 0x7b59, 0x012e, 0x7358, 0x745c,
+	0x6014, 0x905d, 0x0598, 0x2b48, 0x6010, 0x00b6, 0x2058, 0xb800,
+	0x00be, 0xd0bc, 0x190c, 0xcbde, 0xab42, 0xac3e, 0x2001, 0x1869,
+	0x2004, 0xd0b4, 0x1170, 0x601c, 0xd0e4, 0x1158, 0x6010, 0x00b6,
+	0x2058, 0xb800, 0x00be, 0xd0bc, 0x1120, 0xa83b, 0x7fff, 0xa837,
+	0xffff, 0x080c, 0x1f6a, 0x1190, 0x080c, 0x185d, 0x2a00, 0xa816,
+	0x0130, 0x2800, 0xa80e, 0x2c05, 0xa80a, 0x2c00, 0xa812, 0x7037,
+	0x0020, 0x781f, 0x0300, 0x001e, 0x00ee, 0x0005, 0x7037, 0x0050,
+	0x7037, 0x0020, 0x001e, 0x00ee, 0x080c, 0x1560, 0x0005, 0x080c,
+	0x0dd5, 0x2ff0, 0x0126, 0x2091, 0x2200, 0x3e60, 0x6014, 0x2048,
+	0x2940, 0x903e, 0x2730, 0xa864, 0x2068, 0xa81a, 0x9d84, 0x000f,
+	0x9088, 0x1f4a, 0x2165, 0x0002, 0x16b3, 0x1721, 0x16b3, 0x16b3,
+	0x16b7, 0x1702, 0x16b3, 0x16d7, 0x16ac, 0x1718, 0x16b3, 0x16b3,
+	0x16bc, 0x180c, 0x16eb, 0x16e1, 0xa964, 0x918c, 0x00ff, 0x918e,
+	0x0048, 0x0904, 0x1718, 0x9085, 0x0001, 0x0804, 0x1804, 0xa87c,
+	0xd0ac, 0x0dc8, 0x0804, 0x1728, 0xa87c, 0xd0ac, 0x0da0, 0x0804,
+	0x1793, 0xa898, 0x901d, 0x1108, 0xab9c, 0x9016, 0xaab2, 0xaa3e,
+	0xaa42, 0x3e00, 0x9080, 0x0008, 0x2004, 0x9080, 0x8cbf, 0x2005,
+	0x9005, 0x090c, 0x0dd5, 0x2004, 0xa8ae, 0x0804, 0x17ec, 0xa87c,
+	0xd0bc, 0x09c8, 0xa890, 0xa842, 0xa88c, 0xa83e, 0xa888, 0x0804,
+	0x1728, 0xa87c, 0xd0bc, 0x0978, 0xa890, 0xa842, 0xa88c, 0xa83e,
+	0xa888, 0x0804, 0x1793, 0xa87c, 0xd0bc, 0x0928, 0xa890, 0xa842,
+	0xa88c, 0xa83e, 0xa804, 0x9045, 0x090c, 0x0dd5, 0xa164, 0xa91a,
+	0x91ec, 0x000f, 0x9d80, 0x1f4a, 0x2065, 0xa888, 0xd19c, 0x1904,
+	0x1793, 0x0430, 0xa87c, 0xd0ac, 0x0904, 0x16b3, 0xa804, 0x9045,
+	0x090c, 0x0dd5, 0xa164, 0xa91a, 0x91ec, 0x000f, 0x9d80, 0x1f4a,
+	0x2065, 0x9006, 0xa842, 0xa83e, 0xd19c, 0x1904, 0x1793, 0x0080,
+	0xa87c, 0xd0ac, 0x0904, 0x16b3, 0x9006, 0xa842, 0xa83e, 0x0804,
+	0x1793, 0xa87c, 0xd0ac, 0x0904, 0x16b3, 0x9006, 0xa842, 0xa83e,
+	0x2c05, 0x908a, 0x0036, 0x1a0c, 0x0dd5, 0x9082, 0x001b, 0x0002,
+	0x174b, 0x174b, 0x174d, 0x174b, 0x174b, 0x174b, 0x1757, 0x174b,
+	0x174b, 0x174b, 0x1761, 0x174b, 0x174b, 0x174b, 0x176b, 0x174b,
+	0x174b, 0x174b, 0x1775, 0x174b, 0x174b, 0x174b, 0x177f, 0x174b,
+	0x174b, 0x174b, 0x1789, 0x080c, 0x0dd5, 0xa574, 0xa478, 0x9d86,
+	0x0024, 0x0904, 0x16c1, 0xa37c, 0xa280, 0x0804, 0x17ec, 0xa584,
+	0xa488, 0x9d86, 0x0024, 0x0904, 0x16c1, 0xa38c, 0xa290, 0x0804,
+	0x17ec, 0xa594, 0xa498, 0x9d86, 0x0024, 0x0904, 0x16c1, 0xa39c,
+	0xa2a0, 0x0804, 0x17ec, 0xa5a4, 0xa4a8, 0x9d86, 0x0024, 0x0904,
+	0x16c1, 0xa3ac, 0xa2b0, 0x0804, 0x17ec, 0xa5b4, 0xa4b8, 0x9d86,
+	0x0024, 0x0904, 0x16c1, 0xa3bc, 0xa2c0, 0x0804, 0x17ec, 0xa5c4,
+	0xa4c8, 0x9d86, 0x0024, 0x0904, 0x16c1, 0xa3cc, 0xa2d0, 0x0804,
+	0x17ec, 0xa5d4, 0xa4d8, 0x9d86, 0x0024, 0x0904, 0x16c1, 0xa3dc,
+	0xa2e0, 0x0804, 0x17ec, 0x2c05, 0x908a, 0x0034, 0x1a0c, 0x0dd5,
+	0x9082, 0x001b, 0x0002, 0x17b6, 0x17b4, 0x17b4, 0x17b4, 0x17b4,
+	0x17b4, 0x17c1, 0x17b4, 0x17b4, 0x17b4, 0x17b4, 0x17b4, 0x17cc,
+	0x17b4, 0x17b4, 0x17b4, 0x17b4, 0x17b4, 0x17d7, 0x17b4, 0x17b4,
+	0x17b4, 0x17b4, 0x17b4, 0x17e2, 0x080c, 0x0dd5, 0xa56c, 0xa470,
+	0xa774, 0xa678, 0x9d86, 0x002c, 0x0904, 0x16c1, 0xa37c, 0xa280,
+	0x0458, 0xa584, 0xa488, 0xa78c, 0xa690, 0x9d86, 0x002c, 0x0904,
+	0x16c1, 0xa394, 0xa298, 0x0400, 0xa59c, 0xa4a0, 0xa7a4, 0xa6a8,
+	0x9d86, 0x002c, 0x0904, 0x16c1, 0xa3ac, 0xa2b0, 0x00a8, 0xa5b4,
+	0xa4b8, 0xa7bc, 0xa6c0, 0x9d86, 0x002c, 0x0904, 0x16c1, 0xa3c4,
+	0xa2c8, 0x0050, 0xa5cc, 0xa4d0, 0xa7d4, 0xa6d8, 0x9d86, 0x002c,
+	0x0904, 0x16c1, 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,
+	0xab0a, 0x2c00, 0xa812, 0x0c80, 0x0804, 0x16b3, 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,
+	0x1f45, 0xa813, 0x1f45, 0x2c05, 0xa80a, 0xa964, 0xa91a, 0xa87c,
+	0xd0ac, 0x090c, 0x0dd5, 0x9006, 0xa842, 0xa83e, 0x2c05, 0x908a,
+	0x0034, 0x1a0c, 0x0dd5, 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,
+	0x012e, 0x0005, 0xa804, 0x9045, 0x090c, 0x0dd5, 0xa80e, 0xa064,
+	0xa81a, 0x9084, 0x000f, 0x9080, 0x1f4a, 0x2015, 0x82ff, 0x090c,
+	0x0dd5, 0xaa12, 0x2205, 0xa80a, 0x0c18, 0x903e, 0x2730, 0xa880,
+	0xd0fc, 0x1190, 0x2d00, 0x0002, 0x1987, 0x18b4, 0x18b4, 0x1987,
+	0x18b4, 0x1981, 0x1987, 0x18b4, 0x1987, 0x1924, 0x1924, 0x1987,
+	0x1924, 0x1987, 0x197e, 0x1924, 0xc0fc, 0xa882, 0xab2c, 0xaa30,
+	0xad1c, 0xac20, 0xdd9c, 0x0904, 0x1989, 0x2c05, 0x908a, 0x0034,
+	0x1a0c, 0x0dd5, 0x9082, 0x001b, 0x0002, 0x18a0, 0x189e, 0x189e,
+	0x189e, 0x189e, 0x189e, 0x18a4, 0x189e, 0x189e, 0x189e, 0x189e,
+	0x189e, 0x18a8, 0x189e, 0x189e, 0x189e, 0x189e, 0x189e, 0x18ac,
+	0x189e, 0x189e, 0x189e, 0x189e, 0x189e, 0x18b0, 0x080c, 0x0dd5,
+	0xa774, 0xa678, 0x0804, 0x1989, 0xa78c, 0xa690, 0x0804, 0x1989,
+	0xa7a4, 0xa6a8, 0x0804, 0x1989, 0xa7bc, 0xa6c0, 0x0804, 0x1989,
+	0xa7d4, 0xa6d8, 0x0804, 0x1989, 0xa898, 0x901d, 0x1108, 0xab9c,
+	0x9016, 0x2c05, 0x908a, 0x0036, 0x1a0c, 0x0dd5, 0x9082, 0x001b,
+	0x0002, 0x18dc, 0x18dc, 0x18de, 0x18dc, 0x18dc, 0x18dc, 0x18e8,
+	0x18dc, 0x18dc, 0x18dc, 0x18f2, 0x18dc, 0x18dc, 0x18dc, 0x18fc,
+	0x18dc, 0x18dc, 0x18dc, 0x1906, 0x18dc, 0x18dc, 0x18dc, 0x1910,
+	0x18dc, 0x18dc, 0x18dc, 0x191a, 0x080c, 0x0dd5, 0xa574, 0xa478,
+	0x9d86, 0x0004, 0x0904, 0x1989, 0xa37c, 0xa280, 0x0804, 0x1989,
+	0xa584, 0xa488, 0x9d86, 0x0004, 0x0904, 0x1989, 0xa38c, 0xa290,
+	0x0804, 0x1989, 0xa594, 0xa498, 0x9d86, 0x0004, 0x0904, 0x1989,
+	0xa39c, 0xa2a0, 0x0804, 0x1989, 0xa5a4, 0xa4a8, 0x9d86, 0x0004,
+	0x0904, 0x1989, 0xa3ac, 0xa2b0, 0x0804, 0x1989, 0xa5b4, 0xa4b8,
+	0x9d86, 0x0004, 0x0904, 0x1989, 0xa3bc, 0xa2c0, 0x0804, 0x1989,
+	0xa5c4, 0xa4c8, 0x9d86, 0x0004, 0x0904, 0x1989, 0xa3cc, 0xa2d0,
+	0x0804, 0x1989, 0xa5d4, 0xa4d8, 0x9d86, 0x0004, 0x0904, 0x1989,
+	0xa3dc, 0xa2e0, 0x0804, 0x1989, 0xa898, 0x901d, 0x1108, 0xab9c,
+	0x9016, 0x2c05, 0x908a, 0x0034, 0x1a0c, 0x0dd5, 0x9082, 0x001b,
+	0x0002, 0x194c, 0x194a, 0x194a, 0x194a, 0x194a, 0x194a, 0x1956,
+	0x194a, 0x194a, 0x194a, 0x194a, 0x194a, 0x1960, 0x194a, 0x194a,
+	0x194a, 0x194a, 0x194a, 0x196a, 0x194a, 0x194a, 0x194a, 0x194a,
+	0x194a, 0x1974, 0x080c, 0x0dd5, 0xa56c, 0xa470, 0xa774, 0xa678,
+	0x9d86, 0x000c, 0x05b0, 0xa37c, 0xa280, 0x0498, 0xa584, 0xa488,
+	0xa78c, 0xa690, 0x9d86, 0x000c, 0x0560, 0xa394, 0xa298, 0x0448,
+	0xa59c, 0xa4a0, 0xa7a4, 0xa6a8, 0x9d86, 0x000c, 0x0510, 0xa3ac,
+	0xa2b0, 0x00f8, 0xa5b4, 0xa4b8, 0xa7bc, 0xa6c0, 0x9d86, 0x000c,
+	0x01c0, 0xa3c4, 0xa2c8, 0x00a8, 0xa5cc, 0xa4d0, 0xa7d4, 0xa6d8,
+	0x9d86, 0x000c, 0x0170, 0xa3dc, 0xa2e0, 0x0058, 0x9d86, 0x000e,
+	0x1130, 0x080c, 0x1f08, 0x1904, 0x185d, 0x900e, 0x0050, 0x080c,
+	0x0dd5, 0xab2e, 0xaa32, 0xad1e, 0xac22, 0xaf26, 0xae2a, 0x080c,
+	0x1f08, 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, 0xabe6, 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, 0x1363,
+	0x8631, 0x1db8, 0x00ce, 0x781f, 0x0800, 0x2031, 0x0168, 0x00c6,
+	0x7808, 0xd09c, 0x190c, 0x1363, 0x00ce, 0x2001, 0x0038, 0x080c,
+	0x1a8c, 0x7930, 0x9186, 0x0040, 0x0160, 0x9186, 0x0042, 0x190c,
+	0x0dd5, 0x2001, 0x001e, 0x8001, 0x1df0, 0x8631, 0x1d40, 0x080c,
+	0x1a9b, 0x000e, 0x6022, 0x012e, 0x0005, 0x080c, 0x1a88, 0x7827,
+	0x0015, 0x7828, 0x9c06, 0x1db8, 0x782b, 0x0000, 0x0ca0, 0x00f6,
+	0x2079, 0x0300, 0x7803, 0x0000, 0x78ab, 0x0004, 0x00fe, 0x080c,
+	0x717d, 0x11b0, 0x2001, 0x0138, 0x2003, 0x0000, 0x2001, 0x0160,
+	0x2003, 0x0000, 0x2011, 0x012c, 0xa001, 0xa001, 0x8211, 0x1de0,
+	0x0081, 0x0066, 0x2031, 0x0000, 0x080c, 0x722d, 0x006e, 0x0005,
+	0x0479, 0x0039, 0x2001, 0x0160, 0x2502, 0x2001, 0x0138, 0x2202,
+	0x0005, 0x00e6, 0x2071, 0x0200, 0x080c, 0x2af6, 0x2009, 0x003c,
+	0x080c, 0x2284, 0x2001, 0x015d, 0x2003, 0x0000, 0x7000, 0x9084,
+	0x003c, 0x1de0, 0x080c, 0x81a6, 0x70a0, 0x70a2, 0x7098, 0x709a,
+	0x709c, 0x709e, 0x2001, 0x020d, 0x2003, 0x0020, 0x00f6, 0x2079,
+	0x0300, 0x080c, 0x1308, 0x7803, 0x0001, 0x00fe, 0x00ee, 0x0005,
+	0x2001, 0x0138, 0x2014, 0x2003, 0x0000, 0x2001, 0x0160, 0x202c,
+	0x2003, 0x0000, 0x080c, 0x717d, 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, 0x15d1,
+	0x7930, 0x0005, 0x2c08, 0x621c, 0x080c, 0x15fe, 0x7930, 0x0005,
+	0x8001, 0x1df0, 0x0005, 0x2031, 0x0005, 0x781c, 0x9084, 0x0007,
+	0x0170, 0x2001, 0x0038, 0x0c41, 0x9186, 0x0040, 0x0904, 0x1af9,
+	0x2001, 0x001e, 0x0c69, 0x8631, 0x1d80, 0x080c, 0x0dd5, 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, 0x1a92, 0x9186, 0x0040, 0x190c,
+	0x0dd5, 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, 0x0dd5, 0xa001, 0xa001, 0x781f,
+	0x0200, 0x0005, 0x0126, 0x2091, 0x2400, 0x2071, 0x1a64, 0x2079,
+	0x0090, 0x012e, 0x0005, 0x9280, 0x0005, 0x2004, 0x2048, 0xa97c,
+	0xd1dc, 0x1904, 0x1b8b, 0xa964, 0x9184, 0x0007, 0x0002, 0x1b17,
+	0x1b76, 0x1b1e, 0x1b20, 0x1b1e, 0x1b5e, 0x1b3e, 0x1b2d, 0x2100,
+	0x9084, 0x00ff, 0x9086, 0x0048, 0x0904, 0x1b76, 0x080c, 0x0dd5,
+	0x9184, 0x00ff, 0x9086, 0x0013, 0x0904, 0x1b76, 0x9184, 0x00ff,
+	0x9086, 0x001b, 0x0904, 0x1b76, 0x0c88, 0xa87c, 0xd0b4, 0x0904,
+	0x1d4b, 0xa890, 0xa842, 0xa83a, 0xa88c, 0xa83e, 0xa836, 0xa8ac,
+	0xa846, 0xa8b0, 0xa84a, 0xa988, 0x0804, 0x1b7e, 0xa864, 0x9084,
+	0x00ff, 0x9086, 0x001e, 0x19d0, 0xa87c, 0xd0b4, 0x0904, 0x1d4b,
+	0xa890, 0xa842, 0xa83a, 0xa88c, 0xa83e, 0xa836, 0xa8ac, 0xa846,
+	0xa8b0, 0xa84a, 0xa804, 0xa85a, 0x2040, 0xa064, 0x9084, 0x000f,
+	0x9080, 0x1f4a, 0x2005, 0xa812, 0xa988, 0x0448, 0x918c, 0x00ff,
+	0x9186, 0x0015, 0x1540, 0xa87c, 0xd0b4, 0x0904, 0x1d4b, 0xa804,
+	0xa85a, 0x2040, 0xa064, 0x9084, 0x000f, 0x9080, 0x1f4a, 0x2005,
+	0xa812, 0xa988, 0x9006, 0xa842, 0xa83e, 0x0088, 0xa87c, 0xd0b4,
+	0x0904, 0x1d4b, 0xa988, 0x9006, 0xa842, 0xa83e, 0x2900, 0xa85a,
+	0xa864, 0x9084, 0x000f, 0x9080, 0x1f4a, 0x2005, 0xa812, 0xa916,
+	0xa87c, 0xc0dd, 0xa87e, 0x0005, 0x00f6, 0x2079, 0x0090, 0x782c,
+	0xd0fc, 0x190c, 0x1d8c, 0x00e6, 0x2071, 0x1a64, 0x7000, 0x9005,
+	0x1904, 0x1be5, 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, 0x1f6a, 0x004e, 0x003e,
+	0x0d50, 0x0c98, 0x9085, 0x0001, 0x0c80, 0x0076, 0x0066, 0x0056,
+	0x0046, 0x0036, 0x0026, 0x8aff, 0x0904, 0x1d44, 0x700c, 0x7214,
+	0x923a, 0x7010, 0x7218, 0x9203, 0x0a04, 0x1d43, 0x9705, 0x0904,
+	0x1d43, 0x903e, 0x2730, 0xa880, 0xd0fc, 0x1190, 0x2d00, 0x0002,
+	0x1d1c, 0x1c60, 0x1c60, 0x1d1c, 0x1d1c, 0x1cfe, 0x1d1c, 0x1c60,
+	0x1d05, 0x1caf, 0x1caf, 0x1d1c, 0x1d1c, 0x1d1c, 0x1cf8, 0x1caf,
+	0xc0fc, 0xa882, 0xab2c, 0xaa30, 0xad1c, 0xac20, 0xdd9c, 0x0904,
+	0x1d29, 0x2c05, 0x908a, 0x0034, 0x1a0c, 0x0dd5, 0x9082, 0x001b,
+	0x0002, 0x1c4c, 0x1c4a, 0x1c4a, 0x1c4a, 0x1c4a, 0x1c4a, 0x1c50,
+	0x1c4a, 0x1c4a, 0x1c4a, 0x1c4a, 0x1c4a, 0x1c54, 0x1c4a, 0x1c4a,
+	0x1c4a, 0x1c4a, 0x1c4a, 0x1c58, 0x1c4a, 0x1c4a, 0x1c4a, 0x1c4a,
+	0x1c4a, 0x1c5c, 0x080c, 0x0dd5, 0xa774, 0xa678, 0x0804, 0x1d29,
+	0xa78c, 0xa690, 0x0804, 0x1d29, 0xa7a4, 0xa6a8, 0x0804, 0x1d29,
+	0xa7bc, 0xa6c0, 0x0804, 0x1d29, 0xa7d4, 0xa6d8, 0x0804, 0x1d29,
+	0x2c05, 0x908a, 0x0036, 0x1a0c, 0x0dd5, 0x9082, 0x001b, 0x0002,
+	0x1c83, 0x1c83, 0x1c85, 0x1c83, 0x1c83, 0x1c83, 0x1c8b, 0x1c83,
+	0x1c83, 0x1c83, 0x1c91, 0x1c83, 0x1c83, 0x1c83, 0x1c97, 0x1c83,
+	0x1c83, 0x1c83, 0x1c9d, 0x1c83, 0x1c83, 0x1c83, 0x1ca3, 0x1c83,
+	0x1c83, 0x1c83, 0x1ca9, 0x080c, 0x0dd5, 0xa574, 0xa478, 0xa37c,
+	0xa280, 0x0804, 0x1d29, 0xa584, 0xa488, 0xa38c, 0xa290, 0x0804,
+	0x1d29, 0xa594, 0xa498, 0xa39c, 0xa2a0, 0x0804, 0x1d29, 0xa5a4,
+	0xa4a8, 0xa3ac, 0xa2b0, 0x0804, 0x1d29, 0xa5b4, 0xa4b8, 0xa3bc,
+	0xa2c0, 0x0804, 0x1d29, 0xa5c4, 0xa4c8, 0xa3cc, 0xa2d0, 0x0804,
+	0x1d29, 0xa5d4, 0xa4d8, 0xa3dc, 0xa2e0, 0x0804, 0x1d29, 0x2c05,
+	0x908a, 0x0034, 0x1a0c, 0x0dd5, 0x9082, 0x001b, 0x0002, 0x1cd2,
+	0x1cd0, 0x1cd0, 0x1cd0, 0x1cd0, 0x1cd0, 0x1cda, 0x1cd0, 0x1cd0,
+	0x1cd0, 0x1cd0, 0x1cd0, 0x1ce2, 0x1cd0, 0x1cd0, 0x1cd0, 0x1cd0,
+	0x1cd0, 0x1cea, 0x1cd0, 0x1cd0, 0x1cd0, 0x1cd0, 0x1cd0, 0x1cf1,
+	0x080c, 0x0dd5, 0xa56c, 0xa470, 0xa774, 0xa678, 0xa37c, 0xa280,
+	0x0804, 0x1d29, 0xa584, 0xa488, 0xa78c, 0xa690, 0xa394, 0xa298,
+	0x0804, 0x1d29, 0xa59c, 0xa4a0, 0xa7a4, 0xa6a8, 0xa3ac, 0xa2b0,
+	0x0804, 0x1d29, 0xa5b4, 0xa4b8, 0xa7bc, 0xa6c0, 0xa3c4, 0xa2c8,
+	0x04c0, 0xa5cc, 0xa4d0, 0xa7d4, 0xa6d8, 0xa3dc, 0xa2e0, 0x0488,
+	0xa864, 0x9084, 0x00ff, 0x9086, 0x001e, 0x11f0, 0x080c, 0x1f08,
+	0x1904, 0x1bfb, 0x900e, 0x0804, 0x1d44, 0xa864, 0x9084, 0x00ff,
+	0x9086, 0x0048, 0x190c, 0x0dd5, 0x00c6, 0x7004, 0x2060, 0x6004,
+	0x9086, 0x0043, 0x00ce, 0x0904, 0x1caf, 0xab9c, 0x9016, 0xad8c,
+	0xac90, 0xaf94, 0xae98, 0x0068, 0xa964, 0x918c, 0x00ff, 0x9186,
+	0x0013, 0x0904, 0x1c60, 0x9186, 0x001b, 0x0904, 0x1caf, 0x080c,
+	0x0dd5, 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,
+	0x080c, 0x1f08, 0x0008, 0x9006, 0x002e, 0x003e, 0x004e, 0x005e,
+	0x006e, 0x007e, 0x0005, 0x080c, 0x0dd5, 0x0026, 0x2001, 0x0105,
 	0x2003, 0x0010, 0x782b, 0x0004, 0x7003, 0x0000, 0x7004, 0x2060,
-	0x6014, 0x2048, 0x080c, 0xb5fb, 0x0118, 0xa880, 0xc0bd, 0xa882,
+	0x6014, 0x2048, 0x080c, 0xc825, 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,
+	0x60c8, 0xa896, 0x7004, 0x2060, 0x00c6, 0x080c, 0xc472, 0x00ce,
+	0x2001, 0x19f4, 0x2004, 0x9c06, 0x1160, 0x2009, 0x0040, 0x080c,
+	0x2284, 0x080c, 0xa4d6, 0x2011, 0x0000, 0x080c, 0xa353, 0x080c,
+	0x9548, 0x002e, 0x0804, 0x1eba, 0x0126, 0x2091, 0x2400, 0xa858,
+	0x2040, 0x792c, 0x782b, 0x0002, 0x9184, 0x0700, 0x1904, 0x1d4d,
+	0x7000, 0x0002, 0x1eba, 0x1d9e, 0x1e0b, 0x1eb8, 0x8001, 0x7002,
+	0xd19c, 0x1150, 0x8aff, 0x05b0, 0x080c, 0x1bf5, 0x0904, 0x1eba,
+	0x080c, 0x1bf5, 0x0804, 0x1eba, 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,
+	0xaa42, 0x003e, 0x002e, 0x080c, 0x1f20, 0xa880, 0xc0fd, 0xa882,
 	0x2a00, 0xa816, 0x2800, 0xa85a, 0x2c00, 0xa812, 0x7003, 0x0000,
-	0x0804, 0x1d12, 0x00f6, 0x0026, 0x781c, 0x0006, 0x7818, 0x0006,
+	0x0804, 0x1eba, 0x00f6, 0x0026, 0x781c, 0x0006, 0x7818, 0x0006,
 	0x2079, 0x0100, 0x7a14, 0x9284, 0x1984, 0x9085, 0x0012, 0x7816,
-	0x0036, 0x2019, 0x1000, 0x8319, 0x090c, 0x0db2, 0x7820, 0xd0bc,
+	0x0036, 0x2019, 0x1000, 0x8319, 0x090c, 0x0dd5, 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,
+	0x0000, 0x0804, 0x1eba, 0x8001, 0x7002, 0xd194, 0x0170, 0x782c,
+	0xd0fc, 0x1904, 0x1d91, 0xd19c, 0x1904, 0x1eb6, 0x8aff, 0x0904,
+	0x1eba, 0x080c, 0x1bf5, 0x0804, 0x1eba, 0x0026, 0x0036, 0xab3c,
+	0xaa40, 0x080c, 0x1f20, 0xdd9c, 0x1904, 0x1e75, 0x2c05, 0x908a,
+	0x0036, 0x1a0c, 0x0dd5, 0x9082, 0x001b, 0x0002, 0x1e49, 0x1e49,
+	0x1e4b, 0x1e49, 0x1e49, 0x1e49, 0x1e51, 0x1e49, 0x1e49, 0x1e49,
+	0x1e57, 0x1e49, 0x1e49, 0x1e49, 0x1e5d, 0x1e49, 0x1e49, 0x1e49,
+	0x1e63, 0x1e49, 0x1e49, 0x1e49, 0x1e69, 0x1e49, 0x1e49, 0x1e49,
+	0x1e6f, 0x080c, 0x0dd5, 0xa07c, 0x931a, 0xa080, 0x9213, 0x0804,
+	0x1dbd, 0xa08c, 0x931a, 0xa090, 0x9213, 0x0804, 0x1dbd, 0xa09c,
+	0x931a, 0xa0a0, 0x9213, 0x0804, 0x1dbd, 0xa0ac, 0x931a, 0xa0b0,
+	0x9213, 0x0804, 0x1dbd, 0xa0bc, 0x931a, 0xa0c0, 0x9213, 0x0804,
+	0x1dbd, 0xa0cc, 0x931a, 0xa0d0, 0x9213, 0x0804, 0x1dbd, 0xa0dc,
+	0x931a, 0xa0e0, 0x9213, 0x0804, 0x1dbd, 0x2c05, 0x908a, 0x0034,
+	0x1a0c, 0x0dd5, 0x9082, 0x001b, 0x0002, 0x1e98, 0x1e96, 0x1e96,
+	0x1e96, 0x1e96, 0x1e96, 0x1e9e, 0x1e96, 0x1e96, 0x1e96, 0x1e96,
+	0x1e96, 0x1ea4, 0x1e96, 0x1e96, 0x1e96, 0x1e96, 0x1e96, 0x1eaa,
+	0x1e96, 0x1e96, 0x1e96, 0x1e96, 0x1e96, 0x1eb0, 0x080c, 0x0dd5,
+	0xa07c, 0x931a, 0xa080, 0x9213, 0x0804, 0x1dbd, 0xa094, 0x931a,
+	0xa098, 0x9213, 0x0804, 0x1dbd, 0xa0ac, 0x931a, 0xa0b0, 0x9213,
+	0x0804, 0x1dbd, 0xa0c4, 0x931a, 0xa0c8, 0x9213, 0x0804, 0x1dbd,
+	0xa0dc, 0x931a, 0xa0e0, 0x9213, 0x0804, 0x1dbd, 0x0804, 0x1db9,
+	0x080c, 0x0dd5, 0x012e, 0x0005, 0x00f6, 0x00e6, 0x2071, 0x1a64,
+	0x7000, 0x9086, 0x0000, 0x0904, 0x1f05, 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,
+	0x0003, 0x0188, 0x080c, 0xe6ad, 0x2001, 0x0133, 0x2004, 0x9005,
+	0x090c, 0x0dd5, 0x0016, 0x2009, 0x0040, 0x080c, 0x2284, 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,
+	0x210c, 0x9106, 0x1120, 0x2009, 0x0040, 0x080c, 0x2284, 0x782c,
+	0xd0fc, 0x09a8, 0x080c, 0x1d8c, 0x7000, 0x9086, 0x0000, 0x1978,
 	0x782b, 0x0004, 0x782c, 0xd0ac, 0x1de8, 0x2009, 0x0040, 0x080c,
-	0x20d9, 0x782b, 0x0002, 0x7003, 0x0000, 0x00ee, 0x00fe, 0x0005,
+	0x2284, 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,
+	0x0168, 0xa85a, 0x2040, 0xa064, 0x9084, 0x000f, 0x9080, 0x1f4a,
+	0x2065, 0x8cff, 0x090c, 0x0dd5, 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,
+	0x000f, 0x9080, 0x1f5a, 0x2065, 0x8cff, 0x090c, 0x0dd5, 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,
+	0x0023, 0x0000, 0x0000, 0x1f3d, 0x1f39, 0x1f3d, 0x1f3d, 0x1f47,
+	0x0000, 0x1f3d, 0x1f44, 0x1f44, 0x1f41, 0x1f44, 0x1f44, 0x0000,
+	0x1f47, 0x1f44, 0x0000, 0x1f3f, 0x1f3f, 0x0000, 0x1f3f, 0x1f47,
+	0x0000, 0x1f3f, 0x1f45, 0x1f45, 0x1f45, 0x0000, 0x1f45, 0x0000,
+	0x1f47, 0x1f45, 0x00c6, 0x00d6, 0x0086, 0xab42, 0xac3e, 0xa888,
+	0x9055, 0x0904, 0x2141, 0x2940, 0xa064, 0x90ec, 0x000f, 0x9de0,
+	0x1f4a, 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,
+	0x1140, 0x0310, 0x0804, 0x2141, 0xa004, 0x9045, 0x0904, 0x2141,
+	0x0c18, 0x2c05, 0x9005, 0x0904, 0x2029, 0xdd9c, 0x1904, 0x1fe5,
+	0x908a, 0x0036, 0x1a0c, 0x0dd5, 0x9082, 0x001b, 0x0002, 0x1fba,
+	0x1fba, 0x1fbc, 0x1fba, 0x1fba, 0x1fba, 0x1fc2, 0x1fba, 0x1fba,
+	0x1fba, 0x1fc8, 0x1fba, 0x1fba, 0x1fba, 0x1fce, 0x1fba, 0x1fba,
+	0x1fba, 0x1fd4, 0x1fba, 0x1fba, 0x1fba, 0x1fda, 0x1fba, 0x1fba,
+	0x1fba, 0x1fe0, 0x080c, 0x0dd5, 0xa07c, 0x9422, 0xa080, 0x931b,
+	0x0804, 0x201f, 0xa08c, 0x9422, 0xa090, 0x931b, 0x0804, 0x201f,
+	0xa09c, 0x9422, 0xa0a0, 0x931b, 0x0804, 0x201f, 0xa0ac, 0x9422,
+	0xa0b0, 0x931b, 0x0804, 0x201f, 0xa0bc, 0x9422, 0xa0c0, 0x931b,
+	0x0804, 0x201f, 0xa0cc, 0x9422, 0xa0d0, 0x931b, 0x0804, 0x201f,
 	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,
+	0x0dd5, 0x9082, 0x001b, 0x0002, 0x2007, 0x2005, 0x2005, 0x2005,
+	0x2005, 0x2005, 0x200c, 0x2005, 0x2005, 0x2005, 0x2005, 0x2005,
+	0x2011, 0x2005, 0x2005, 0x2005, 0x2005, 0x2005, 0x2016, 0x2005,
+	0x2005, 0x2005, 0x2005, 0x2005, 0x201b, 0x080c, 0x0dd5, 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,
+	0x2300, 0x9405, 0x0160, 0x8a51, 0x0904, 0x2141, 0x8c60, 0x0804,
+	0x1f91, 0xa004, 0x9045, 0x0904, 0x2141, 0x0804, 0x1f74, 0x8a51,
+	0x0904, 0x2141, 0x8c60, 0x2c05, 0x9005, 0x1158, 0xa004, 0x9045,
+	0x0904, 0x2141, 0xa064, 0x90ec, 0x000f, 0x9de0, 0x1f4a, 0x2c05,
+	0x2060, 0xa880, 0xc0fc, 0xa882, 0x0804, 0x2136, 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,
+	0x20d3, 0x9082, 0x001b, 0x0002, 0x206f, 0x206f, 0x2071, 0x206f,
+	0x206f, 0x206f, 0x207f, 0x206f, 0x206f, 0x206f, 0x208d, 0x206f,
+	0x206f, 0x206f, 0x209b, 0x206f, 0x206f, 0x206f, 0x20a9, 0x206f,
+	0x206f, 0x206f, 0x20b7, 0x206f, 0x206f, 0x206f, 0x20c5, 0x080c,
+	0x0dd5, 0xa17c, 0x2400, 0x9122, 0xa180, 0x2300, 0x911b, 0x0a0c,
+	0x0dd5, 0xa074, 0x9420, 0xa078, 0x9319, 0x0804, 0x2131, 0xa18c,
+	0x2400, 0x9122, 0xa190, 0x2300, 0x911b, 0x0a0c, 0x0dd5, 0xa084,
+	0x9420, 0xa088, 0x9319, 0x0804, 0x2131, 0xa19c, 0x2400, 0x9122,
+	0xa1a0, 0x2300, 0x911b, 0x0a0c, 0x0dd5, 0xa094, 0x9420, 0xa098,
+	0x9319, 0x0804, 0x2131, 0xa1ac, 0x2400, 0x9122, 0xa1b0, 0x2300,
+	0x911b, 0x0a0c, 0x0dd5, 0xa0a4, 0x9420, 0xa0a8, 0x9319, 0x0804,
+	0x2131, 0xa1bc, 0x2400, 0x9122, 0xa1c0, 0x2300, 0x911b, 0x0a0c,
+	0x0dd5, 0xa0b4, 0x9420, 0xa0b8, 0x9319, 0x0804, 0x2131, 0xa1cc,
+	0x2400, 0x9122, 0xa1d0, 0x2300, 0x911b, 0x0a0c, 0x0dd5, 0xa0c4,
+	0x9420, 0xa0c8, 0x9319, 0x0804, 0x2131, 0xa1dc, 0x2400, 0x9122,
+	0xa1e0, 0x2300, 0x911b, 0x0a0c, 0x0dd5, 0xa0d4, 0x9420, 0xa0d8,
+	0x9319, 0x0804, 0x2131, 0x9082, 0x001b, 0x0002, 0x20f1, 0x20ef,
+	0x20ef, 0x20ef, 0x20ef, 0x20ef, 0x20fe, 0x20ef, 0x20ef, 0x20ef,
+	0x20ef, 0x20ef, 0x210b, 0x20ef, 0x20ef, 0x20ef, 0x20ef, 0x20ef,
+	0x2118, 0x20ef, 0x20ef, 0x20ef, 0x20ef, 0x20ef, 0x2125, 0x080c,
+	0x0dd5, 0xa17c, 0x2400, 0x9122, 0xa180, 0x2300, 0x911b, 0x0a0c,
+	0x0dd5, 0xa06c, 0x9420, 0xa070, 0x9319, 0x0498, 0xa194, 0x2400,
+	0x9122, 0xa198, 0x2300, 0x911b, 0x0a0c, 0x0dd5, 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,
+	0x911b, 0x0a0c, 0x0dd5, 0xa09c, 0x9420, 0xa0a0, 0x9319, 0x00c8,
+	0xa1c4, 0x2400, 0x9122, 0xa1c8, 0x2300, 0x911b, 0x0a0c, 0x0dd5,
 	0xa0b4, 0x9420, 0xa0b8, 0x9319, 0x0060, 0xa1dc, 0x2400, 0x9122,
-	0xa1e0, 0x2300, 0x911b, 0x0a0c, 0x0db2, 0xa0cc, 0x9420, 0xa0d0,
+	0xa1e0, 0x2300, 0x911b, 0x0a0c, 0x0dd5, 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,
+	0x0005, 0x2004, 0xd0bc, 0x190c, 0x0dce, 0x9084, 0x0007, 0x0002,
+	0x2162, 0x1d8c, 0x2162, 0x2158, 0x215b, 0x215e, 0x215b, 0x215e,
+	0x080c, 0x1d8c, 0x0005, 0x080c, 0x119a, 0x0005, 0x080c, 0x1d8c,
+	0x080c, 0x119a, 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, 0x2281,
+	0x7900, 0xd1dc, 0x1118, 0x9084, 0x0006, 0x001a, 0x9084, 0x000e,
+	0x0002, 0x21a9, 0x21a1, 0x7b59, 0x21a1, 0x21a3, 0x21a3, 0x21a3,
+	0x21a3, 0x7b3f, 0x21a1, 0x21a5, 0x21a1, 0x21a3, 0x21a1, 0x21a3,
+	0x21a1, 0x080c, 0x0dd5, 0x0031, 0x0020, 0x080c, 0x7b3f, 0x080c,
+	0x7b59, 0x0005, 0x0006, 0x0016, 0x0026, 0x080c, 0xe6ad, 0x7930,
+	0x9184, 0x0003, 0x01c0, 0x2001, 0x19f4, 0x2004, 0x9005, 0x0170,
+	0x2001, 0x0133, 0x2004, 0x9005, 0x090c, 0x0dd5, 0x00c6, 0x2001,
+	0x19f4, 0x2064, 0x080c, 0xc472, 0x00ce, 0x00f8, 0x2009, 0x0040,
+	0x080c, 0x2284, 0x00d0, 0x9184, 0x0014, 0x01a0, 0x6a00, 0x9286,
+	0x0003, 0x0160, 0x080c, 0x717d, 0x1138, 0x080c, 0x7465, 0x080c,
+	0x5df8, 0x080c, 0x70af, 0x0010, 0x080c, 0x5cb7, 0x080c, 0x7bf7,
+	0x0041, 0x0018, 0x9184, 0x9540, 0x1dc8, 0x002e, 0x001e, 0x000e,
+	0x0005, 0x00e6, 0x0036, 0x0046, 0x0056, 0x2071, 0x1a60, 0x080c,
+	0x19ff, 0x005e, 0x004e, 0x003e, 0x00ee, 0x0005, 0x0126, 0x2091,
+	0x2e00, 0x2071, 0x1800, 0x7128, 0x2001, 0x196f, 0x2102, 0x2001,
+	0x1977, 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, 0x0dce, 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, 0x2af0, 0x080c, 0x2a0b, 0x6054, 0x8004, 0x8004, 0x8004,
+	0x8004, 0x9084, 0x000c, 0x6150, 0x918c, 0xfff3, 0x9105, 0x6052,
+	0x6050, 0x9084, 0xb17f, 0x9085, 0x2000, 0x6052, 0x2009, 0x199b,
+	0x2011, 0x199c, 0x6358, 0x939c, 0x38f0, 0x2320, 0x080c, 0x2a4f,
+	0x1238, 0x939d, 0x4003, 0x94a5, 0x8603, 0x230a, 0x2412, 0x0030,
+	0x939d, 0x0203, 0x94a5, 0x8603, 0x230a, 0x2412, 0x9006, 0x080c,
+	0x2a3a, 0x9006, 0x080c, 0x2a1d, 0x20a9, 0x0012, 0x1d04, 0x22d6,
+	0x2091, 0x6000, 0x1f04, 0x22d6, 0x602f, 0x0100, 0x602f, 0x0000,
+	0x6050, 0x9085, 0x0400, 0x9084, 0xdfff, 0x6052, 0x6024, 0x6026,
+	0x080c, 0x2729, 0x2009, 0x00ef, 0x6132, 0x6136, 0x080c, 0x2739,
+	0x60e7, 0x0000, 0x61ea, 0x60e3, 0x0008, 0x604b, 0xf7f7, 0x6043,
+	0x0000, 0x602f, 0x0080, 0x602f, 0x0000, 0x6007, 0x349f, 0x60bb,
+	0x0000, 0x20a9, 0x0018, 0x60bf, 0x0000, 0x1f04, 0x2303, 0x60bb,
+	0x0000, 0x60bf, 0x0108, 0x60bf, 0x0012, 0x60bf, 0x0405, 0x60bf,
+	0x0014, 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, 0x1835, 0x2003, 0x0000, 0x2001, 0x1834,
+	0x2003, 0x0001, 0x0005, 0x0126, 0x2091, 0x2800, 0x0006, 0x0016,
+	0x0026, 0x6124, 0x0066, 0x2031, 0x1837, 0x2634, 0x96b4, 0x0028,
+	0x006e, 0x1138, 0x6020, 0xd1bc, 0x0120, 0xd0bc, 0x1168, 0xd0b4,
+	0x1198, 0x9184, 0x5e2c, 0x1118, 0x9184, 0x0007, 0x00aa, 0x9195,
+	0x0004, 0x9284, 0x0007, 0x0082, 0x0016, 0x2001, 0x188b, 0x200c,
+	0xd184, 0x001e, 0x0d70, 0x0c98, 0x0016, 0x2001, 0x188b, 0x200c,
+	0xd194, 0x001e, 0x0d30, 0x0c58, 0x2386, 0x236c, 0x236f, 0x2372,
+	0x2377, 0x2379, 0x237d, 0x2381, 0x080c, 0x8d64, 0x00b8, 0x080c,
+	0x8e31, 0x00a0, 0x080c, 0x8e31, 0x080c, 0x8d64, 0x0078, 0x0099,
+	0x0068, 0x080c, 0x8d64, 0x0079, 0x0048, 0x080c, 0x8e31, 0x0059,
+	0x0028, 0x080c, 0x8e31, 0x080c, 0x8d64, 0x0029, 0x002e, 0x001e,
+	0x000e, 0x012e, 0x0005, 0x00a6, 0x6124, 0x6028, 0xd09c, 0x0118,
+	0xd19c, 0x1904, 0x25ee, 0xd1f4, 0x190c, 0x0dce, 0x080c, 0x717d,
+	0x0904, 0x23e1, 0x080c, 0xcf18, 0x1120, 0x7000, 0x9086, 0x0003,
+	0x0570, 0x6024, 0x9084, 0x1800, 0x0550, 0x080c, 0x71a0, 0x0118,
+	0x080c, 0x718e, 0x1520, 0x6027, 0x0020, 0x6043, 0x0000, 0x080c,
+	0xcf18, 0x0168, 0x080c, 0x71a0, 0x1150, 0x2001, 0x19a5, 0x2003,
+	0x0001, 0x6027, 0x1800, 0x080c, 0x7013, 0x0804, 0x25f1, 0x70a4,
+	0x9005, 0x1150, 0x70a7, 0x0001, 0x00d6, 0x2069, 0x0140, 0x080c,
+	0x71d4, 0x00de, 0x1904, 0x25f1, 0x080c, 0x746f, 0x0428, 0x080c,
+	0x71a0, 0x1590, 0x6024, 0x9084, 0x1800, 0x1108, 0x0468, 0x080c,
+	0x746f, 0x080c, 0x7465, 0x080c, 0x5df8, 0x080c, 0x70af, 0x0804,
+	0x25ee, 0xd1ac, 0x1508, 0x6024, 0xd0dc, 0x1170, 0xd0e4, 0x1178,
+	0xd0d4, 0x1190, 0xd0cc, 0x0130, 0x7098, 0x9086, 0x0028, 0x1110,
+	0x080c, 0x7352, 0x0804, 0x25ee, 0x080c, 0x746a, 0x0048, 0x2001,
+	0x197d, 0x2003, 0x0002, 0x0020, 0x080c, 0x72b7, 0x0804, 0x25ee,
+	0x080c, 0x73ed, 0x0804, 0x25ee, 0x6220, 0xd1bc, 0x0138, 0xd2bc,
+	0x1904, 0x2661, 0xd2b4, 0x1904, 0x2674, 0x0000, 0xd1ac, 0x0904,
+	0x2503, 0x0036, 0x6328, 0xc3bc, 0x632a, 0x003e, 0x080c, 0x717d,
+	0x11c0, 0x6027, 0x0020, 0x0006, 0x0026, 0x0036, 0x080c, 0x7197,
+	0x1158, 0x080c, 0x7465, 0x080c, 0x5df8, 0x080c, 0x70af, 0x003e,
+	0x002e, 0x000e, 0x00ae, 0x0005, 0x003e, 0x002e, 0x000e, 0x080c,
+	0x7155, 0x0016, 0x0046, 0x00c6, 0x644c, 0x9486, 0xf0f0, 0x1138,
+	0x2061, 0x0100, 0x644a, 0x6043, 0x0090, 0x6043, 0x0010, 0x74da,
+	0x948c, 0xff00, 0x7038, 0xd084, 0x0178, 0x9186, 0xf800, 0x1160,
+	0x7048, 0xd084, 0x1148, 0xc085, 0x704a, 0x0036, 0x2418, 0x2011,
+	0x8016, 0x080c, 0x48fb, 0x003e, 0x080c, 0xcf11, 0x1904, 0x24e0,
+	0x9196, 0xff00, 0x05a8, 0x7060, 0x9084, 0x00ff, 0x810f, 0x81ff,
+	0x0110, 0x9116, 0x0568, 0x7130, 0xd184, 0x1550, 0x080c, 0x31c4,
+	0x0128, 0xc18d, 0x7132, 0x080c, 0x672f, 0x1510, 0x6240, 0x9294,
+	0x0010, 0x0130, 0x6248, 0x9294, 0xff00, 0x9296, 0xff00, 0x01c0,
+	0x7030, 0xd08c, 0x0904, 0x24e0, 0x7038, 0xd08c, 0x1140, 0x2001,
+	0x180c, 0x200c, 0xd1ac, 0x1904, 0x24e0, 0xc1ad, 0x2102, 0x0036,
+	0x73d8, 0x2011, 0x8013, 0x080c, 0x48fb, 0x003e, 0x0804, 0x24e0,
+	0x7038, 0xd08c, 0x1140, 0x2001, 0x180c, 0x200c, 0xd1ac, 0x1904,
+	0x24e0, 0xc1ad, 0x2102, 0x0036, 0x73d8, 0x2011, 0x8013, 0x080c,
+	0x48fb, 0x003e, 0x7130, 0xc185, 0x7132, 0x2011, 0x1848, 0x220c,
+	0xd1a4, 0x01f0, 0x0016, 0x2009, 0x0001, 0x2011, 0x0100, 0x080c,
+	0x846c, 0x2019, 0x000e, 0x00c6, 0x2061, 0x0000, 0x080c, 0xe1f4,
+	0x00ce, 0x9484, 0x00ff, 0x9080, 0x31d0, 0x200d, 0x918c, 0xff00,
+	0x810f, 0x2120, 0x9006, 0x2009, 0x000e, 0x080c, 0xe280, 0x001e,
+	0x0016, 0x2009, 0x0002, 0x2019, 0x0004, 0x080c, 0x3039, 0x001e,
+	0x0078, 0x0156, 0x00b6, 0x20a9, 0x007f, 0x900e, 0x080c, 0x63cd,
+	0x1110, 0x080c, 0x5e12, 0x8108, 0x1f04, 0x24d6, 0x00be, 0x015e,
+	0x00ce, 0x004e, 0x080c, 0xaadc, 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, 0x1826, 0x2003,
+	0x0000, 0x6027, 0x0020, 0xd194, 0x0904, 0x25ee, 0x0016, 0x6220,
+	0xd2b4, 0x0904, 0x258b, 0x080c, 0x8308, 0x080c, 0x9ffc, 0x6027,
+	0x0004, 0x00f6, 0x2019, 0x19ee, 0x2304, 0x907d, 0x0904, 0x255a,
+	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, 0x2bb1, 0x2001, 0x001e, 0x8001, 0x0240,
+	0x20a9, 0x0009, 0x080c, 0x2acb, 0x6904, 0xd1dc, 0x1140, 0x0cb0,
+	0x2001, 0x0100, 0x080c, 0x2ba1, 0x9006, 0x080c, 0x2ba1, 0x080c,
+	0x9317, 0x080c, 0x941c, 0x7814, 0x2048, 0xa867, 0x0103, 0x2f60,
+	0x080c, 0xab6b, 0x009e, 0x00ee, 0x00ce, 0x00de, 0x00fe, 0x001e,
+	0x00ae, 0x0005, 0x00fe, 0x00d6, 0x2069, 0x0140, 0x6804, 0x9084,
+	0x4000, 0x0110, 0x080c, 0x2bb1, 0x00de, 0x00c6, 0x2061, 0x19e5,
+	0x6028, 0x080c, 0xcf18, 0x0120, 0x909a, 0x0003, 0x1258, 0x0018,
+	0x909a, 0x00c8, 0x1238, 0x8000, 0x602a, 0x00ce, 0x080c, 0x9fd8,
+	0x0804, 0x25ed, 0x2061, 0x0100, 0x62c0, 0x080c, 0xa967, 0x2019,
+	0x19ee, 0x2304, 0x9065, 0x0120, 0x2009, 0x0027, 0x080c, 0xabe6,
+	0x00ce, 0x0804, 0x25ed, 0xd2bc, 0x0904, 0x25d4, 0x080c, 0x8315,
+	0x6014, 0x9084, 0x1984, 0x9085, 0x0010, 0x6016, 0x6027, 0x0004,
+	0x00d6, 0x2069, 0x0140, 0x6804, 0x9084, 0x4000, 0x0110, 0x080c,
+	0x2bb1, 0x00de, 0x00c6, 0x2061, 0x19e5, 0x6044, 0x080c, 0xcf18,
+	0x0120, 0x909a, 0x0003, 0x1658, 0x0018, 0x909a, 0x00c8, 0x1638,
+	0x8000, 0x6046, 0x603c, 0x00ce, 0x9005, 0x05b8, 0x2009, 0x07d0,
+	0x080c, 0x830d, 0x9080, 0x0008, 0x2004, 0x9086, 0x0006, 0x1138,
+	0x6114, 0x918c, 0x1984, 0x918d, 0x0012, 0x6116, 0x0430, 0x9080,
+	0x0008, 0x2004, 0x9086, 0x0009, 0x0d98, 0x6114, 0x918c, 0x1984,
+	0x918d, 0x0016, 0x6116, 0x00c8, 0x6027, 0x0004, 0x00b0, 0x0036,
+	0x2019, 0x0001, 0x080c, 0xa2ac, 0x003e, 0x2019, 0x19f4, 0x2304,
+	0x9065, 0x0150, 0x2009, 0x004f, 0x6020, 0x9086, 0x0009, 0x1110,
+	0x2009, 0x004f, 0x080c, 0xabe6, 0x00ce, 0x001e, 0xd19c, 0x0904,
+	0x265c, 0x7038, 0xd0ac, 0x1904, 0x2635, 0x0016, 0x0156, 0x6027,
+	0x0008, 0x6050, 0x9085, 0x0040, 0x6052, 0x6050, 0x9084, 0xfbcf,
+	0x6052, 0x080c, 0x2aea, 0x9085, 0x2000, 0x6052, 0x20a9, 0x0012,
+	0x1d04, 0x2608, 0x080c, 0x833c, 0x1f04, 0x2608, 0x6050, 0x9085,
+	0x0400, 0x9084, 0xdfbf, 0x6052, 0x20a9, 0x0028, 0xa001, 0x1f04,
+	0x2616, 0x6150, 0x9185, 0x1400, 0x6052, 0x20a9, 0x0366, 0x1d04,
+	0x261f, 0x080c, 0x833c, 0x6020, 0xd09c, 0x1130, 0x015e, 0x6152,
+	0x001e, 0x6027, 0x0008, 0x0480, 0x080c, 0x2ab2, 0x1f04, 0x261f,
+	0x015e, 0x6152, 0x001e, 0x6027, 0x0008, 0x0016, 0x6028, 0xc09c,
+	0x602a, 0x080c, 0xaadc, 0x60e3, 0x0000, 0x080c, 0xe68c, 0x080c,
+	0xe6a7, 0x080c, 0x54bb, 0xd0fc, 0x1138, 0x080c, 0xcf11, 0x1120,
+	0x9085, 0x0001, 0x080c, 0x71c4, 0x9006, 0x080c, 0x2ba1, 0x2009,
+	0x0002, 0x080c, 0x2af0, 0x2001, 0x1800, 0x2003, 0x0004, 0x6027,
+	0x0008, 0x080c, 0x0bae, 0x001e, 0x918c, 0xffd0, 0x6126, 0x00ae,
+	0x0005, 0x0016, 0x2001, 0x188b, 0x200c, 0xd184, 0x001e, 0x0904,
+	0x240e, 0x0016, 0x2009, 0x266d, 0x00d0, 0x2001, 0x188b, 0x200c,
+	0xc184, 0x2102, 0x001e, 0x0c40, 0x0016, 0x2001, 0x188b, 0x200c,
+	0xd194, 0x001e, 0x0904, 0x240e, 0x0016, 0x2009, 0x2680, 0x0038,
+	0x2001, 0x188b, 0x200c, 0xc194, 0x2102, 0x001e, 0x08a8, 0x6028,
+	0xc0bc, 0x602a, 0x2001, 0x0156, 0x2003, 0xbc91, 0x8000, 0x2003,
+	0xffff, 0x6043, 0x0001, 0x080c, 0x2aea, 0x6027, 0x0080, 0x6017,
+	0x0000, 0x6043, 0x0000, 0x0817, 0x0006, 0x0016, 0x0026, 0x0036,
+	0x00e6, 0x00f6, 0x0126, 0x2091, 0x8000, 0x2071, 0x1800, 0x71d0,
+	0x70d2, 0x9116, 0x05e8, 0x81ff, 0x01a0, 0x2009, 0x0000, 0x080c,
+	0x2af0, 0x2011, 0x8011, 0x2019, 0x010e, 0x231c, 0x939e, 0x0007,
+	0x1118, 0x2019, 0x0001, 0x0010, 0x2019, 0x0000, 0x080c, 0x48fb,
+	0x0438, 0x2001, 0x19a6, 0x200c, 0x81ff, 0x1140, 0x2001, 0x0109,
+	0x2004, 0xd0b4, 0x0118, 0x2019, 0x0003, 0x0008, 0x2118, 0x2011,
+	0x8012, 0x080c, 0x48fb, 0x080c, 0x54bb, 0xd0fc, 0x1188, 0x080c,
+	0xcf11, 0x1170, 0x00c6, 0x080c, 0x2784, 0x080c, 0xa213, 0x2061,
+	0x0100, 0x2019, 0x0028, 0x2009, 0x0002, 0x080c, 0x3039, 0x00ce,
+	0x012e, 0x00fe, 0x00ee, 0x003e, 0x002e, 0x001e, 0x000e, 0x0005,
+	0x2028, 0x918c, 0x00ff, 0x2130, 0x9094, 0xff00, 0x11f0, 0x2011,
+	0x1837, 0x2214, 0xd2ac, 0x11c8, 0x81ff, 0x01e8, 0x2011, 0x181f,
+	0x2204, 0x9106, 0x1190, 0x2011, 0x1820, 0x2214, 0x9294, 0xff00,
+	0x9584, 0xff00, 0x9206, 0x1148, 0x2011, 0x1820, 0x2214, 0x9294,
+	0x00ff, 0x9584, 0x00ff, 0x9206, 0x1120, 0x2500, 0x080c, 0x7e50,
+	0x0048, 0x9584, 0x00ff, 0x9080, 0x31d0, 0x200d, 0x918c, 0xff00,
+	0x810f, 0x9006, 0x0005, 0x9080, 0x31d0, 0x200d, 0x918c, 0x00ff,
+	0x0005, 0x00d6, 0x2069, 0x0140, 0x2001, 0x1818, 0x2003, 0x00ef,
+	0x20a9, 0x0010, 0x9006, 0x6852, 0x6856, 0x1f04, 0x2734, 0x00de,
+	0x0005, 0x0006, 0x00d6, 0x0026, 0x2069, 0x0140, 0x2001, 0x1818,
+	0x2102, 0x8114, 0x8214, 0x8214, 0x8214, 0x20a9, 0x0010, 0x6853,
+	0x0000, 0x9006, 0x82ff, 0x1128, 0x9184, 0x000f, 0x9080, 0xee55,
+	0x2005, 0x6856, 0x8211, 0x1f04, 0x2749, 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, 0x2779, 0x680f, 0x0000, 0x000e, 0x001e,
+	0x002e, 0x00de, 0x015e, 0x0005, 0x080c, 0x54b7, 0xd0c4, 0x0150,
+	0xd0a4, 0x0140, 0x9006, 0x0046, 0x2020, 0x2009, 0x002e, 0x080c,
+	0xe280, 0x004e, 0x0005, 0x00f6, 0x0016, 0x0026, 0x2079, 0x0140,
+	0x78c4, 0xd0dc, 0x0904, 0x27f0, 0x080c, 0x2a4f, 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,
+	0x8cf7, 0x928c, 0xff00, 0x0110, 0x2011, 0x00ff, 0x2200, 0x8007,
+	0x9085, 0x004c, 0x78c2, 0x2009, 0x0138, 0x220a, 0x080c, 0x717d,
+	0x1118, 0x2009, 0x196d, 0x220a, 0x002e, 0x001e, 0x00fe, 0x0005,
+	0x78c3, 0x0000, 0x0cc8, 0x0126, 0x2091, 0x2800, 0x0006, 0x0016,
+	0x0026, 0x2001, 0x0170, 0x200c, 0x8000, 0x2014, 0x9184, 0x0003,
+	0x0110, 0x080c, 0x0dce, 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, 0x198e, 0x2004, 0x908a, 0x0007, 0x1a0c, 0x0dd5,
+	0x0033, 0x00ee, 0x002e, 0x001e, 0x000e, 0x015e, 0x0005, 0x284e,
+	0x286c, 0x2890, 0x2892, 0x28bb, 0x28bd, 0x28bf, 0x2001, 0x0001,
+	0x080c, 0x269c, 0x080c, 0x2aad, 0x2001, 0x1990, 0x2003, 0x0000,
+	0x7828, 0x9084, 0xe1d7, 0x782a, 0x9006, 0x20a9, 0x0009, 0x080c,
+	0x2a6b, 0x2001, 0x198e, 0x2003, 0x0006, 0x2009, 0x001e, 0x2011,
+	0x28c0, 0x080c, 0x831a, 0x0005, 0x2009, 0x1993, 0x200b, 0x0000,
+	0x2001, 0x1998, 0x2003, 0x0036, 0x2001, 0x1997, 0x2003, 0x002a,
+	0x2001, 0x1990, 0x2003, 0x0001, 0x9006, 0x080c, 0x2a1d, 0x2001,
+	0xffff, 0x20a9, 0x0009, 0x080c, 0x2a6b, 0x2001, 0x198e, 0x2003,
+	0x0006, 0x2009, 0x001e, 0x2011, 0x28c0, 0x080c, 0x831a, 0x0005,
+	0x080c, 0x0dd5, 0x2001, 0x1998, 0x2003, 0x0036, 0x2001, 0x1990,
+	0x2003, 0x0003, 0x7a38, 0x9294, 0x0005, 0x9296, 0x0004, 0x0110,
+	0x9006, 0x0010, 0x2001, 0x0001, 0x080c, 0x2a1d, 0x2001, 0x1994,
+	0x2003, 0x0000, 0x2001, 0xffff, 0x20a9, 0x0009, 0x080c, 0x2a6b,
+	0x2001, 0x198e, 0x2003, 0x0006, 0x2009, 0x001e, 0x2011, 0x28c0,
+	0x080c, 0x831a, 0x0005, 0x080c, 0x0dd5, 0x080c, 0x0dd5, 0x0005,
+	0x0006, 0x0016, 0x0026, 0x00e6, 0x00f6, 0x0156, 0x0126, 0x2091,
+	0x8000, 0x2079, 0x0100, 0x2001, 0x1990, 0x2004, 0x908a, 0x0007,
+	0x1a0c, 0x0dd5, 0x0043, 0x012e, 0x015e, 0x00fe, 0x00ee, 0x002e,
+	0x001e, 0x000e, 0x0005, 0x28e2, 0x2902, 0x2942, 0x2972, 0x2996,
+	0x29a6, 0x29a8, 0x080c, 0x2a5f, 0x11b0, 0x7850, 0x9084, 0xefff,
+	0x7852, 0x2009, 0x1996, 0x2104, 0x7a38, 0x9294, 0x0005, 0x9296,
+	0x0004, 0x0110, 0xc08d, 0x0008, 0xc085, 0x200a, 0x2001, 0x198e,
+	0x2003, 0x0001, 0x0030, 0x080c, 0x29cc, 0x2001, 0xffff, 0x080c,
+	0x285d, 0x0005, 0x080c, 0x29aa, 0x05e0, 0x2009, 0x1997, 0x2104,
+	0x8001, 0x200a, 0x080c, 0x2a5f, 0x1178, 0x7850, 0x9084, 0xefff,
+	0x7852, 0x7a38, 0x9294, 0x0005, 0x9296, 0x0005, 0x0518, 0x2009,
+	0x1996, 0x2104, 0xc085, 0x200a, 0x2009, 0x1993, 0x2104, 0x8000,
+	0x200a, 0x9086, 0x0005, 0x0118, 0x080c, 0x29b2, 0x00c0, 0x200b,
+	0x0000, 0x7a38, 0x9294, 0x0006, 0x9296, 0x0004, 0x0110, 0x9006,
+	0x0010, 0x2001, 0x0001, 0x080c, 0x2a3a, 0x2001, 0x1990, 0x2003,
+	0x0002, 0x0028, 0x2001, 0x198e, 0x2003, 0x0003, 0x0010, 0x080c,
+	0x287f, 0x0005, 0x080c, 0x29aa, 0x0560, 0x2009, 0x1997, 0x2104,
+	0x8001, 0x200a, 0x080c, 0x2a5f, 0x1168, 0x7850, 0x9084, 0xefff,
+	0x7852, 0x2001, 0x198e, 0x2003, 0x0003, 0x2001, 0x198f, 0x2003,
+	0x0000, 0x00b8, 0x2009, 0x1997, 0x2104, 0x9005, 0x1118, 0x080c,
+	0x29ef, 0x0010, 0x080c, 0x29bf, 0x080c, 0x29b2, 0x2009, 0x1993,
+	0x200b, 0x0000, 0x2001, 0x1990, 0x2003, 0x0001, 0x080c, 0x287f,
+	0x0000, 0x0005, 0x04b9, 0x0508, 0x080c, 0x2a5f, 0x11b8, 0x7850,
+	0x9084, 0xefff, 0x7852, 0x2009, 0x1994, 0x2104, 0x8000, 0x200a,
+	0x9086, 0x0007, 0x0108, 0x0078, 0x2001, 0x1999, 0x2003, 0x000a,
+	0x2009, 0x1996, 0x2104, 0xc0fd, 0x200a, 0x0038, 0x0419, 0x2001,
+	0x1990, 0x2003, 0x0004, 0x080c, 0x28aa, 0x0005, 0x0099, 0x0168,
+	0x080c, 0x2a5f, 0x1138, 0x7850, 0x9084, 0xefff, 0x7852, 0x080c,
+	0x2896, 0x0018, 0x0079, 0x080c, 0x28aa, 0x0005, 0x080c, 0x0dd5,
+	0x080c, 0x0dd5, 0x2009, 0x1998, 0x2104, 0x8001, 0x200a, 0x090c,
+	0x2a0b, 0x0005, 0x7a38, 0x9294, 0x0005, 0x9296, 0x0005, 0x0110,
+	0x9006, 0x0010, 0x2001, 0x0001, 0x080c, 0x2a3a, 0x0005, 0x7a38,
+	0x9294, 0x0006, 0x9296, 0x0006, 0x0110, 0x9006, 0x0010, 0x2001,
+	0x0001, 0x080c, 0x2a1d, 0x0005, 0x2009, 0x1993, 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, 0x2a3a, 0x0005, 0x0086,
+	0x2001, 0x1996, 0x2004, 0x9084, 0x7fff, 0x090c, 0x0dd5, 0x2009,
+	0x1995, 0x2144, 0x8846, 0x280a, 0x9844, 0x0dd8, 0xd08c, 0x1120,
+	0xd084, 0x1120, 0x080c, 0x0dd5, 0x9006, 0x0010, 0x2001, 0x0001,
+	0x00a1, 0x008e, 0x0005, 0x0006, 0x0156, 0x2001, 0x198e, 0x20a9,
+	0x0009, 0x2003, 0x0000, 0x8000, 0x1f04, 0x2a11, 0x2001, 0x1995,
+	0x2003, 0x8000, 0x015e, 0x000e, 0x0005, 0x00f6, 0x2079, 0x0100,
+	0x9085, 0x0000, 0x0158, 0x7838, 0x9084, 0xfff9, 0x9085, 0x0004,
+	0x783a, 0x2009, 0x199b, 0x210c, 0x795a, 0x0050, 0x7838, 0x9084,
+	0xfffb, 0x9085, 0x0006, 0x783a, 0x2009, 0x199c, 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, 0x2aea, 0xd09c, 0x1110, 0x1f04,
+	0x2a62, 0x015e, 0x0005, 0x0126, 0x0016, 0x0006, 0x2091, 0x8000,
+	0x7850, 0x9085, 0x0040, 0x7852, 0x7850, 0x9084, 0xfbcf, 0x7852,
+	0x080c, 0x2aea, 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, 0x2a98, 0x080c, 0x833c, 0x1f04, 0x2a98, 0x7850, 0x9085,
+	0x0400, 0x9084, 0xdfbf, 0x7852, 0x080c, 0x2aea, 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,
+	0x2abc, 0x0028, 0x7854, 0xd08c, 0x1110, 0x1f04, 0x2ac2, 0x00fe,
+	0x015e, 0x000e, 0x0005, 0x1d04, 0x2acb, 0x080c, 0x833c, 0x1f04,
+	0x2acb, 0x0005, 0x0006, 0x2001, 0x199a, 0x2004, 0x9086, 0x0000,
+	0x000e, 0x0005, 0x0006, 0x2001, 0x199a, 0x2004, 0x9086, 0x0001,
+	0x000e, 0x0005, 0x0006, 0x2001, 0x199a, 0x2004, 0x9086, 0x0002,
+	0x000e, 0x0005, 0xa001, 0xa001, 0xa001, 0xa001, 0xa001, 0x0005,
+	0x0006, 0x2001, 0x19a6, 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, 0x00a2, 0x080c, 0x0e51, 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, 0x2009, 0x0000,
+	0x080c, 0x0e51, 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, 0x7197, 0x0108, 0xc0bc, 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,
+	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,
+	0x1128, 0x080c, 0x7197, 0x0110, 0xc0bc, 0x0008, 0xc0bd, 0x200a,
+	0x001e, 0x000e, 0x0005, 0x2e47, 0x2e47, 0x2c6b, 0x2c6b, 0x2c77,
+	0x2c77, 0x2c83, 0x2c83, 0x2c91, 0x2c91, 0x2c9d, 0x2c9d, 0x2cab,
+	0x2cab, 0x2cb9, 0x2cb9, 0x2ccb, 0x2ccb, 0x2cd7, 0x2cd7, 0x2ce5,
+	0x2ce5, 0x2d03, 0x2d03, 0x2d23, 0x2d23, 0x2cf3, 0x2cf3, 0x2d13,
+	0x2d13, 0x2d31, 0x2d31, 0x2cc9, 0x2cc9, 0x2cc9, 0x2cc9, 0x2cc9,
+	0x2cc9, 0x2cc9, 0x2cc9, 0x2cc9, 0x2cc9, 0x2cc9, 0x2cc9, 0x2cc9,
+	0x2cc9, 0x2cc9, 0x2cc9, 0x2cc9, 0x2cc9, 0x2cc9, 0x2cc9, 0x2cc9,
+	0x2cc9, 0x2cc9, 0x2cc9, 0x2cc9, 0x2cc9, 0x2cc9, 0x2cc9, 0x2cc9,
+	0x2cc9, 0x2cc9, 0x2cc9, 0x2d43, 0x2d43, 0x2d4f, 0x2d4f, 0x2d5d,
+	0x2d5d, 0x2d6b, 0x2d6b, 0x2d7b, 0x2d7b, 0x2d89, 0x2d89, 0x2d99,
+	0x2d99, 0x2da9, 0x2da9, 0x2dbb, 0x2dbb, 0x2dc9, 0x2dc9, 0x2dd9,
+	0x2dd9, 0x2dfb, 0x2dfb, 0x2e1d, 0x2e1d, 0x2de9, 0x2de9, 0x2e0c,
+	0x2e0c, 0x2e2c, 0x2e2c, 0x2cc9, 0x2cc9, 0x2cc9, 0x2cc9, 0x2cc9,
+	0x2cc9, 0x2cc9, 0x2cc9, 0x2cc9, 0x2cc9, 0x2cc9, 0x2cc9, 0x2cc9,
+	0x2cc9, 0x2cc9, 0x2cc9, 0x2cc9, 0x2cc9, 0x2cc9, 0x2cc9, 0x2cc9,
+	0x2cc9, 0x2cc9, 0x2cc9, 0x2cc9, 0x2cc9, 0x2cc9, 0x2cc9, 0x2cc9,
+	0x2cc9, 0x2cc9, 0x2cc9, 0x2cc9, 0x2cc9, 0x2cc9, 0x2cc9, 0x2cc9,
+	0x2cc9, 0x2cc9, 0x2cc9, 0x2cc9, 0x2cc9, 0x2cc9, 0x2cc9, 0x2cc9,
+	0x2cc9, 0x2cc9, 0x2cc9, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
+	0x0136, 0x0146, 0x0156, 0x080c, 0x2333, 0x0804, 0x2e3f, 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,
+	0x2147, 0x0804, 0x2e3f, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
+	0x0136, 0x0146, 0x0156, 0x080c, 0x2147, 0x080c, 0x2333, 0x0804,
+	0x2e3f, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146,
+	0x0156, 0x080c, 0x2182, 0x0804, 0x2e3f, 0x0106, 0x0006, 0x0126,
+	0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2333, 0x080c,
+	0x2182, 0x0804, 0x2e3f, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
+	0x0136, 0x0146, 0x0156, 0x080c, 0x2147, 0x080c, 0x2182, 0x0804,
+	0x2e3f, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146,
+	0x0156, 0x080c, 0x2147, 0x080c, 0x2333, 0x080c, 0x2182, 0x0804,
+	0x2e3f, 0xa001, 0x0cf0, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
+	0x0136, 0x0146, 0x0156, 0x080c, 0x1363, 0x0804, 0x2e3f, 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,
+	0x2333, 0x080c, 0x1363, 0x0804, 0x2e3f, 0x0106, 0x0006, 0x0126,
+	0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2147, 0x080c,
+	0x1363, 0x0804, 0x2e3f, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
+	0x0136, 0x0146, 0x0156, 0x080c, 0x2333, 0x080c, 0x1363, 0x080c,
+	0x2182, 0x0804, 0x2e3f, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
+	0x0136, 0x0146, 0x0156, 0x080c, 0x2147, 0x080c, 0x2333, 0x080c,
+	0x1363, 0x0804, 0x2e3f, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
+	0x0136, 0x0146, 0x0156, 0x080c, 0x2147, 0x080c, 0x1363, 0x080c,
+	0x2182, 0x0804, 0x2e3f, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
+	0x0136, 0x0146, 0x0156, 0x080c, 0x1363, 0x080c, 0x2182, 0x0804,
+	0x2e3f, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146,
+	0x0156, 0x080c, 0x2147, 0x080c, 0x2333, 0x080c, 0x1363, 0x080c,
+	0x2182, 0x0804, 0x2e3f, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
+	0x0136, 0x0146, 0x0156, 0x080c, 0x27f3, 0x0804, 0x2e3f, 0x0106,
+	0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c,
+	0x27f3, 0x080c, 0x2333, 0x0804, 0x2e3f, 0x0106, 0x0006, 0x0126,
+	0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x27f3, 0x080c,
+	0x2147, 0x0804, 0x2e3f, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
+	0x0136, 0x0146, 0x0156, 0x080c, 0x27f3, 0x080c, 0x2147, 0x080c,
+	0x2333, 0x0804, 0x2e3f, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
+	0x0136, 0x0146, 0x0156, 0x080c, 0x27f3, 0x080c, 0x2182, 0x0804,
+	0x2e3f, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146,
+	0x0156, 0x080c, 0x27f3, 0x080c, 0x2333, 0x080c, 0x2182, 0x0804,
+	0x2e3f, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146,
+	0x0156, 0x080c, 0x27f3, 0x080c, 0x2147, 0x080c, 0x2182, 0x0804,
+	0x2e3f, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146,
+	0x0156, 0x080c, 0x27f3, 0x080c, 0x2147, 0x080c, 0x2333, 0x080c,
+	0x2182, 0x0804, 0x2e3f, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
+	0x0136, 0x0146, 0x0156, 0x080c, 0x27f3, 0x080c, 0x1363, 0x0804,
+	0x2e3f, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146,
+	0x0156, 0x080c, 0x27f3, 0x080c, 0x2333, 0x080c, 0x1363, 0x0804,
+	0x2e3f, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146,
+	0x0156, 0x080c, 0x27f3, 0x080c, 0x2147, 0x080c, 0x1363, 0x0804,
+	0x2e3f, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146,
+	0x0156, 0x080c, 0x27f3, 0x080c, 0x2333, 0x080c, 0x1363, 0x080c,
+	0x2182, 0x0804, 0x2e3f, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
+	0x0136, 0x0146, 0x0156, 0x080c, 0x27f3, 0x080c, 0x2147, 0x080c,
+	0x2333, 0x080c, 0x1363, 0x0498, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x27f3, 0x080c, 0x2147,
+	0x080c, 0x1363, 0x080c, 0x2182, 0x0410, 0x0106, 0x0006, 0x0126,
+	0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x27f3, 0x080c,
+	0x1363, 0x080c, 0x2182, 0x0098, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x27f3, 0x080c, 0x2147,
+	0x080c, 0x2333, 0x080c, 0x1363, 0x080c, 0x2182, 0x0000, 0x015e,
+	0x014e, 0x013e, 0x01de, 0x01ce, 0x012e, 0x000e, 0x010e, 0x000d,
+	0x00b6, 0x00c6, 0x0026, 0x0046, 0x9026, 0x080c, 0x66f5, 0x1904,
+	0x2f55, 0x72dc, 0x2001, 0x197c, 0x2004, 0x9005, 0x1110, 0xd29c,
+	0x0148, 0xd284, 0x1138, 0xd2bc, 0x1904, 0x2f55, 0x080c, 0x2f5a,
+	0x0804, 0x2f55, 0xd2cc, 0x1904, 0x2f55, 0x080c, 0x717d, 0x1120,
+	0x70af, 0xffff, 0x0804, 0x2f55, 0xd294, 0x0120, 0x70af, 0xffff,
+	0x0804, 0x2f55, 0x080c, 0x31bf, 0x0160, 0x080c, 0xcf18, 0x0128,
+	0x2001, 0x1818, 0x203c, 0x0804, 0x2ee2, 0x70af, 0xffff, 0x0804,
+	0x2f55, 0x2001, 0x1818, 0x203c, 0x7294, 0xd284, 0x0904, 0x2ee2,
+	0xd28c, 0x1904, 0x2ee2, 0x0036, 0x73ac, 0x938e, 0xffff, 0x1110,
+	0x2019, 0x0001, 0x8314, 0x92e0, 0x1c80, 0x2c04, 0x938c, 0x0001,
+	0x0120, 0x9084, 0xff00, 0x8007, 0x0010, 0x9084, 0x00ff, 0x970e,
+	0x05b8, 0x908e, 0x0000, 0x05a0, 0x908e, 0x00ff, 0x1150, 0x7230,
+	0xd284, 0x1598, 0x7294, 0xc28d, 0x7296, 0x70af, 0xffff, 0x003e,
+	0x0488, 0x900e, 0x080c, 0x26f0, 0x080c, 0x636c, 0x1520, 0x9006,
+	0xb8bb, 0x0520, 0xb8ac, 0x9005, 0x0148, 0x00c6, 0x2060, 0x080c,
+	0x8710, 0x00ce, 0x090c, 0x8ab4, 0xb8af, 0x0000, 0x080c, 0x6737,
+	0x1150, 0x7030, 0xd08c, 0x0118, 0xb800, 0xd0bc, 0x0120, 0x080c,
+	0x2f73, 0x0148, 0x0028, 0x080c, 0x30af, 0x080c, 0x2f9f, 0x0118,
+	0x8318, 0x0804, 0x2e92, 0x73ae, 0x0010, 0x70af, 0xffff, 0x003e,
+	0x0804, 0x2f55, 0x9780, 0x31d0, 0x203d, 0x97bc, 0xff00, 0x873f,
+	0x2041, 0x007e, 0x70ac, 0x9096, 0xffff, 0x1118, 0x900e, 0x28a8,
+	0x0050, 0x9812, 0x0220, 0x2008, 0x9802, 0x20a8, 0x0020, 0x70af,
+	0xffff, 0x0804, 0x2f55, 0x2700, 0x0156, 0x0016, 0x9106, 0x0904,
+	0x2f4a, 0xc484, 0x080c, 0x63cd, 0x0148, 0x080c, 0xcf18, 0x1904,
+	0x2f4a, 0x080c, 0x636c, 0x1904, 0x2f52, 0x0008, 0xc485, 0xb8bb,
+	0x0520, 0xb8ac, 0x9005, 0x0148, 0x00c6, 0x2060, 0x080c, 0x8710,
+	0x00ce, 0x090c, 0x8ab4, 0xb8af, 0x0000, 0x080c, 0x6737, 0x1130,
+	0x7030, 0xd08c, 0x01f8, 0xb800, 0xd0bc, 0x11e0, 0x7294, 0xd28c,
+	0x0180, 0x080c, 0x6737, 0x9082, 0x0006, 0x02e0, 0xd484, 0x1118,
+	0x080c, 0x6391, 0x0028, 0x080c, 0x313b, 0x01a0, 0x080c, 0x3166,
+	0x0088, 0x080c, 0x30af, 0x080c, 0xcf18, 0x1160, 0x080c, 0x2f9f,
+	0x0188, 0x0040, 0x080c, 0xcf18, 0x1118, 0x080c, 0x313b, 0x0110,
+	0x0451, 0x0140, 0x001e, 0x8108, 0x015e, 0x1f04, 0x2efb, 0x70af,
+	0xffff, 0x0018, 0x001e, 0x015e, 0x71ae, 0x004e, 0x002e, 0x00ce,
+	0x00be, 0x0005, 0x00c6, 0x0016, 0x70af, 0x0001, 0x2009, 0x007e,
+	0x080c, 0x636c, 0x1168, 0xb813, 0x00ff, 0xb817, 0xfffe, 0x080c,
+	0x30af, 0x04a9, 0x0128, 0x70dc, 0xc0bd, 0x70de, 0x080c, 0xcc6a,
+	0x001e, 0x00ce, 0x0005, 0x0016, 0x0076, 0x00d6, 0x00c6, 0x2001,
+	0x184c, 0x2004, 0x9084, 0x00ff, 0xb842, 0x080c, 0xabb9, 0x01d0,
+	0x2b00, 0x6012, 0x080c, 0xcc93, 0x6023, 0x0001, 0x9006, 0x080c,
+	0x6309, 0x2001, 0x0000, 0x080c, 0x631d, 0x0126, 0x2091, 0x8000,
+	0x70a8, 0x8000, 0x70aa, 0x012e, 0x2009, 0x0004, 0x080c, 0xabe6,
+	0x9085, 0x0001, 0x00ce, 0x00de, 0x007e, 0x001e, 0x0005, 0x0016,
+	0x0076, 0x00d6, 0x00c6, 0x2001, 0x184c, 0x2004, 0x9084, 0x00ff,
+	0xb842, 0x080c, 0xabb9, 0x0548, 0x2b00, 0x6012, 0xb800, 0xc0c4,
+	0xb802, 0xb8a0, 0x9086, 0x007e, 0x0140, 0xb804, 0x9084, 0x00ff,
+	0x9086, 0x0006, 0x1110, 0x080c, 0x306e, 0x080c, 0xcc93, 0x6023,
+	0x0001, 0x9006, 0x080c, 0x6309, 0x2001, 0x0002, 0x080c, 0x631d,
+	0x0126, 0x2091, 0x8000, 0x70a8, 0x8000, 0x70aa, 0x012e, 0x2009,
+	0x0002, 0x080c, 0xabe6, 0x9085, 0x0001, 0x00ce, 0x00de, 0x007e,
+	0x001e, 0x0005, 0x00b6, 0x00c6, 0x0026, 0x2009, 0x0080, 0x080c,
+	0x636c, 0x1140, 0xb813, 0x00ff, 0xb817, 0xfffc, 0x0039, 0x0110,
+	0x70e3, 0xffff, 0x002e, 0x00ce, 0x00be, 0x0005, 0x0016, 0x0076,
+	0x00d6, 0x00c6, 0x080c, 0xab15, 0x01d0, 0x2b00, 0x6012, 0x080c,
+	0xcc93, 0x6023, 0x0001, 0x9006, 0x080c, 0x6309, 0x2001, 0x0002,
+	0x080c, 0x631d, 0x0126, 0x2091, 0x8000, 0x70e4, 0x8000, 0x70e6,
+	0x012e, 0x2009, 0x0002, 0x080c, 0xabe6, 0x9085, 0x0001, 0x00ce,
+	0x00de, 0x007e, 0x001e, 0x0005, 0x00c6, 0x00d6, 0x0126, 0x2091,
+	0x8000, 0x2009, 0x007f, 0x080c, 0x636c, 0x11b8, 0xb813, 0x00ff,
+	0xb817, 0xfffd, 0xb8cf, 0x0004, 0x080c, 0xab15, 0x0170, 0x2b00,
+	0x6012, 0x6316, 0x6023, 0x0001, 0x620a, 0x080c, 0xcc93, 0x2009,
+	0x0022, 0x080c, 0xabe6, 0x9085, 0x0001, 0x012e, 0x00de, 0x00ce,
+	0x0005, 0x00e6, 0x00c6, 0x0066, 0x0036, 0x0026, 0x00b6, 0x21f0,
+	0x080c, 0x9025, 0x080c, 0x8faa, 0x080c, 0xa9ae, 0x080c, 0xba81,
+	0x3e08, 0x2130, 0x81ff, 0x0120, 0x20a9, 0x007e, 0x900e, 0x0018,
+	0x20a9, 0x007f, 0x900e, 0x0016, 0x080c, 0x63cd, 0x1140, 0x9686,
+	0x0002, 0x1118, 0xb800, 0xd0bc, 0x1110, 0x080c, 0x5e12, 0x001e,
+	0x8108, 0x1f04, 0x3053, 0x9686, 0x0001, 0x190c, 0x3193, 0x00be,
+	0x002e, 0x003e, 0x006e, 0x00ce, 0x00ee, 0x0005, 0x00e6, 0x00c6,
+	0x0036, 0x0026, 0x0016, 0x00b6, 0x6210, 0x2258, 0xbaa0, 0x0026,
+	0x2019, 0x0029, 0x080c, 0x901a, 0x0076, 0x2039, 0x0000, 0x080c,
+	0x8ef7, 0x2c08, 0x080c, 0xdfbd, 0x007e, 0x001e, 0xba10, 0xbb14,
+	0x080c, 0x5e12, 0xba12, 0xbb16, 0x00be, 0x001e, 0x002e, 0x003e,
+	0x00ce, 0x00ee, 0x0005, 0x00e6, 0x0006, 0x00b6, 0x6010, 0x2058,
+	0xb8a0, 0x00be, 0x9086, 0x0080, 0x0150, 0x2071, 0x1800, 0x70a8,
+	0x9005, 0x0110, 0x8001, 0x70aa, 0x000e, 0x00ee, 0x0005, 0x2071,
+	0x1800, 0x70e4, 0x9005, 0x0dc0, 0x8001, 0x70e6, 0x0ca8, 0xb800,
+	0xc08c, 0xb802, 0x0005, 0x00f6, 0x00e6, 0x00c6, 0x00b6, 0x0036,
+	0x0026, 0x0016, 0x0156, 0x2178, 0x81ff, 0x1118, 0x20a9, 0x0001,
+	0x0088, 0x080c, 0x54b7, 0xd0c4, 0x0150, 0xd0a4, 0x0140, 0x9006,
+	0x0046, 0x2020, 0x2009, 0x002d, 0x080c, 0xe280, 0x004e, 0x20a9,
+	0x0800, 0x9016, 0x0026, 0x928e, 0x007e, 0x0904, 0x311b, 0x928e,
+	0x007f, 0x0904, 0x311b, 0x928e, 0x0080, 0x05e8, 0x9288, 0x1000,
+	0x210c, 0x81ff, 0x05c0, 0x8fff, 0x1148, 0x2001, 0x198c, 0x0006,
+	0x2003, 0x0001, 0x04e9, 0x000e, 0x2003, 0x0000, 0x00b6, 0x00c6,
+	0x2158, 0x2001, 0x0001, 0x080c, 0x6701, 0x00ce, 0x00be, 0x2019,
+	0x0029, 0x080c, 0x901a, 0x0076, 0x2039, 0x0000, 0x080c, 0x8ef7,
+	0x00b6, 0x00c6, 0x0026, 0x2158, 0xba04, 0x9294, 0x00ff, 0x9286,
+	0x0006, 0x1118, 0xb807, 0x0404, 0x0028, 0x2001, 0x0004, 0x8007,
+	0x9215, 0xba06, 0x002e, 0x00ce, 0x00be, 0x0016, 0x2c08, 0x080c,
+	0xdfbd, 0x001e, 0x007e, 0x002e, 0x8210, 0x1f04, 0x30d2, 0x015e,
+	0x001e, 0x002e, 0x003e, 0x00be, 0x00ce, 0x00ee, 0x00fe, 0x0005,
+	0x0046, 0x0026, 0x0016, 0x080c, 0x54b7, 0xd0c4, 0x0140, 0xd0a4,
+	0x0130, 0x9006, 0x2220, 0x2009, 0x0029, 0x080c, 0xe280, 0x001e,
+	0x002e, 0x004e, 0x0005, 0x0016, 0x0026, 0x0036, 0x00c6, 0x7294,
+	0x82ff, 0x01e8, 0x080c, 0x672f, 0x11d0, 0x2100, 0x080c, 0x2723,
+	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,
+	0x1aa7, 0x001e, 0x6112, 0x080c, 0x306e, 0x001e, 0x080c, 0x6391,
+	0x012e, 0x00ce, 0x001e, 0x0005, 0x0016, 0x0026, 0x2110, 0x080c,
+	0xa512, 0x080c, 0xe5e4, 0x002e, 0x001e, 0x0005, 0x2001, 0x1837,
+	0x2004, 0xd0cc, 0x0005, 0x00c6, 0x00b6, 0x080c, 0x717d, 0x1118,
+	0x20a9, 0x0800, 0x0010, 0x20a9, 0x0782, 0x080c, 0x717d, 0x1110,
+	0x900e, 0x0010, 0x2009, 0x007e, 0x9180, 0x1000, 0x2004, 0x905d,
+	0x0130, 0x86ff, 0x0110, 0xb800, 0xd0bc, 0x090c, 0x6391, 0x8108,
+	0x1f04, 0x31a4, 0x2061, 0x1800, 0x607f, 0x0000, 0x6080, 0x9084,
+	0x00ff, 0x6082, 0x60b3, 0x0000, 0x00be, 0x00ce, 0x0005, 0x2001,
+	0x1869, 0x2004, 0xd0bc, 0x0005, 0x2011, 0x1848, 0x2214, 0xd2ec,
+	0x0005, 0x0026, 0x2011, 0x1867, 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,
-	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,
+	0x2071, 0x189e, 0x7003, 0x0002, 0x9006, 0x7016, 0x701a, 0x704a,
+	0x704e, 0x700e, 0x7042, 0x7046, 0x703b, 0x18ba, 0x703f, 0x18ba,
+	0x7007, 0x0001, 0x080c, 0x1019, 0x090c, 0x0dd5, 0x2900, 0x706a,
+	0xa867, 0x0002, 0xa8ab, 0xdcb0, 0x080c, 0x1019, 0x090c, 0x0dd5,
+	0x2900, 0x706e, 0xa867, 0x0002, 0xa8ab, 0xdcb0, 0x0005, 0x2071,
+	0x189e, 0x7004, 0x0002, 0x32ff, 0x3300, 0x3313, 0x3327, 0x0005,
+	0x1004, 0x3310, 0x0e04, 0x3310, 0x2079, 0x0000, 0x0126, 0x2091,
+	0x8000, 0x700c, 0x9005, 0x1128, 0x700f, 0x0001, 0x012e, 0x0468,
+	0x0005, 0x012e, 0x0ce8, 0x2079, 0x0000, 0x2061, 0x18b8, 0x2c4c,
+	0xa86c, 0x908e, 0x0100, 0x0128, 0x9086, 0x0200, 0x0904, 0x33fb,
+	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, 0x61d0, 0x0042, 0x2100, 0x908a, 0x003f,
+	0x1a04, 0x33f8, 0x61d0, 0x0804, 0x338d, 0x33cf, 0x3407, 0x3411,
+	0x3415, 0x341f, 0x3425, 0x3429, 0x3439, 0x343c, 0x3446, 0x344b,
+	0x3450, 0x345b, 0x3466, 0x3475, 0x3484, 0x3492, 0x34a9, 0x34c4,
+	0x33f8, 0x356d, 0x35ab, 0x3651, 0x3662, 0x3685, 0x33f8, 0x33f8,
+	0x33f8, 0x36bd, 0x36d9, 0x36e2, 0x3711, 0x3717, 0x33f8, 0x375d,
+	0x33f8, 0x33f8, 0x33f8, 0x33f8, 0x33f8, 0x3768, 0x3771, 0x3779,
+	0x377b, 0x33f8, 0x33f8, 0x33f8, 0x33f8, 0x33f8, 0x33f8, 0x37a7,
+	0x33f8, 0x33f8, 0x33f8, 0x33f8, 0x33f8, 0x37c4, 0x3825, 0x33f8,
+	0x33f8, 0x33f8, 0x33f8, 0x33f8, 0x33f8, 0x0002, 0x384f, 0x3852,
+	0x38b1, 0x38ca, 0x38fa, 0x3b98, 0x33f8, 0x5090, 0x33f8, 0x33f8,
+	0x33f8, 0x33f8, 0x33f8, 0x33f8, 0x33f8, 0x33f8, 0x3446, 0x344b,
+	0x40b9, 0x54db, 0x40d7, 0x511f, 0x5170, 0x5273, 0x33f8, 0x52d5,
+	0x5311, 0x5342, 0x5446, 0x536f, 0x53c6, 0x33f8, 0x40db, 0x42a4,
+	0x42ba, 0x42df, 0x4344, 0x43b8, 0x43d8, 0x444f, 0x4460, 0x4478,
+	0x447b, 0x44a0, 0x4510, 0x4576, 0x457e, 0x46b0, 0x4825, 0x4859,
+	0x4abd, 0x33f8, 0x4adb, 0x4b87, 0x4c69, 0x4cc3, 0x33f8, 0x4d78,
+	0x33f8, 0x4dde, 0x4df9, 0x457e, 0x503f, 0x714c, 0x0000, 0x2021,
+	0x4000, 0x080c, 0x48d7, 0x0126, 0x2091, 0x8000, 0x0e04, 0x33d9,
+	0x0010, 0x012e, 0x0cc0, 0x7c36, 0x9486, 0x4000, 0x0118, 0x7833,
+	0x0011, 0x0010, 0x7833, 0x0010, 0x7c82, 0x7986, 0x7a8a, 0x7b8e,
+	0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x1192,
+	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,
-	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,
+	0x48e4, 0x7883, 0x0004, 0x7884, 0x0807, 0x2039, 0x0001, 0x902e,
+	0x2520, 0x7b88, 0x7a8c, 0x7884, 0x7990, 0x0804, 0x48e7, 0x7984,
+	0x7888, 0x2114, 0x200a, 0x0804, 0x33cf, 0x7984, 0x2114, 0x0804,
+	0x33cf, 0x20e1, 0x0000, 0x2099, 0x0021, 0x20e9, 0x0000, 0x20a1,
+	0x0021, 0x20a9, 0x001f, 0x4003, 0x7984, 0x7a88, 0x7b8c, 0x0804,
+	0x33cf, 0x7884, 0x2060, 0x04d8, 0x2009, 0x0003, 0x2011, 0x0002,
+	0x2019, 0x0015, 0x789b, 0x0137, 0x0804, 0x33cf, 0x2039, 0x0001,
+	0x7d98, 0x7c9c, 0x0800, 0x2039, 0x0001, 0x7d98, 0x7c9c, 0x0848,
+	0x79a0, 0x9182, 0x0040, 0x0210, 0x0804, 0x3404, 0x2138, 0x7d98,
+	0x7c9c, 0x0804, 0x340b, 0x79a0, 0x9182, 0x0040, 0x0210, 0x0804,
+	0x3404, 0x2138, 0x7d98, 0x7c9c, 0x0804, 0x3419, 0x79a0, 0x9182,
+	0x0040, 0x0210, 0x0804, 0x3404, 0x21e8, 0x7984, 0x7888, 0x20a9,
+	0x0001, 0x21a0, 0x4004, 0x0804, 0x33cf, 0x2061, 0x0800, 0xe10c,
+	0x9006, 0x2c15, 0x9200, 0x8c60, 0x8109, 0x1dd8, 0x2010, 0x9005,
+	0x0904, 0x33cf, 0x0804, 0x33fe, 0x79a0, 0x9182, 0x0040, 0x0210,
+	0x0804, 0x3404, 0x21e0, 0x20a9, 0x0001, 0x7984, 0x2198, 0x4012,
+	0x0804, 0x33cf, 0x2069, 0x1847, 0x7884, 0x7990, 0x911a, 0x1a04,
+	0x3404, 0x8019, 0x0904, 0x3404, 0x684a, 0x6942, 0x788c, 0x6852,
+	0x7888, 0x6856, 0x9006, 0x685a, 0x685e, 0x080c, 0x7496, 0x0804,
+	0x33cf, 0x2069, 0x1847, 0x7884, 0x7994, 0x911a, 0x1a04, 0x3404,
+	0x8019, 0x0904, 0x3404, 0x684e, 0x6946, 0x788c, 0x6862, 0x7888,
+	0x6866, 0x9006, 0x686a, 0x686e, 0x0126, 0x2091, 0x8000, 0x080c,
+	0x67a1, 0x012e, 0x0804, 0x33cf, 0x902e, 0x2520, 0x81ff, 0x0120,
+	0x2009, 0x0001, 0x0804, 0x3401, 0x7984, 0x7b88, 0x7a8c, 0x20a9,
+	0x0005, 0x20e9, 0x0001, 0x20a1, 0x18a6, 0x4101, 0x080c, 0x489b,
+	0x1120, 0x2009, 0x0002, 0x0804, 0x3401, 0x2009, 0x0020, 0xa85c,
+	0x9080, 0x0019, 0xaf60, 0x080c, 0x48e4, 0x701f, 0x34e8, 0x0005,
+	0xa864, 0x2008, 0x9084, 0x00ff, 0x9096, 0x0011, 0x0168, 0x9096,
+	0x0019, 0x0150, 0x9096, 0x0015, 0x0138, 0x9096, 0x0048, 0x0120,
+	0x9096, 0x0029, 0x1904, 0x3401, 0x810f, 0x918c, 0x00ff, 0x0904,
+	0x3401, 0x7112, 0x7010, 0x8001, 0x0560, 0x7012, 0x080c, 0x489b,
+	0x1120, 0x2009, 0x0002, 0x0804, 0x3401, 0x2009, 0x0020, 0x7068,
+	0x2040, 0xa28c, 0xa390, 0xa494, 0xa598, 0x9290, 0x0040, 0x9399,
+	0x0000, 0x94a1, 0x0000, 0x95a9, 0x0000, 0xa85c, 0x9080, 0x0019,
+	0xaf60, 0x080c, 0x48e4, 0x701f, 0x3526, 0x0005, 0xa864, 0x9084,
+	0x00ff, 0x9096, 0x0002, 0x0120, 0x9096, 0x000a, 0x1904, 0x3401,
+	0x0888, 0x7014, 0x2048, 0xa868, 0xc0fd, 0xa86a, 0xa864, 0x9084,
+	0x00ff, 0x9096, 0x0029, 0x1160, 0xc2fd, 0xaa7a, 0x080c, 0x5f69,
+	0x0150, 0x0126, 0x2091, 0x8000, 0xa87a, 0xa982, 0x012e, 0x0050,
+	0x080c, 0x6282, 0x1128, 0x7007, 0x0003, 0x701f, 0x3552, 0x0005,
+	0x080c, 0x6c85, 0x0126, 0x2091, 0x8000, 0x20a9, 0x0005, 0x20e1,
+	0x0001, 0x2099, 0x18a6, 0x400a, 0x2100, 0x9210, 0x9399, 0x0000,
+	0x94a1, 0x0000, 0x95a9, 0x0000, 0xa85c, 0x9080, 0x0019, 0x2009,
+	0x0020, 0x012e, 0xaf60, 0x0804, 0x48e7, 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,
+	0x1a17, 0x2004, 0x9005, 0x0128, 0x2001, 0x008b, 0x2004, 0xd0fc,
+	0x0dd8, 0x2001, 0x008a, 0x2003, 0x0002, 0x2003, 0x1001, 0x2071,
+	0x0080, 0x0804, 0x0427, 0x81ff, 0x1904, 0x3401, 0x7984, 0x080c,
+	0x63cd, 0x1904, 0x3404, 0x7e98, 0x9684, 0x3fff, 0x9082, 0x4000,
+	0x1a04, 0x3404, 0x7c88, 0x7d8c, 0x080c, 0x6530, 0x080c, 0x64ff,
+	0x0000, 0x1518, 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,
+	0x1118, 0xa870, 0x9506, 0x0150, 0x012e, 0x9ce0, 0x0018, 0x2001,
+	0x181a, 0x2004, 0x9c02, 0x1a04, 0x3401, 0x0c30, 0x080c, 0xc472,
+	0x012e, 0x0904, 0x3401, 0x0804, 0x33cf, 0x900e, 0x2001, 0x0005,
+	0x080c, 0x6c85, 0x0126, 0x2091, 0x8000, 0x080c, 0xcb13, 0x080c,
+	0x6a46, 0x012e, 0x0804, 0x33cf, 0x00a6, 0x2950, 0xb198, 0x080c,
+	0x63cd, 0x1904, 0x363e, 0xb6a4, 0x9684, 0x3fff, 0x9082, 0x4000,
+	0x16e8, 0xb49c, 0xb5a0, 0x080c, 0x6530, 0x080c, 0x64ff, 0x1520,
+	0x2061, 0x1cd0, 0x0126, 0x2091, 0x8000, 0x6000, 0x9086, 0x0000,
+	0x0148, 0x6014, 0x904d, 0x0130, 0xa86c, 0x9406, 0x1118, 0xa870,
+	0x9506, 0x0158, 0x012e, 0x9ce0, 0x0018, 0x2001, 0x181a, 0x2004,
+	0x9c02, 0x2009, 0x000d, 0x12b0, 0x0c28, 0x080c, 0xc472, 0x012e,
+	0x2009, 0x0003, 0x0178, 0x00e0, 0x900e, 0x2001, 0x0005, 0x080c,
+	0x6c85, 0x0126, 0x2091, 0x8000, 0x080c, 0xcb13, 0x080c, 0x6a3a,
+	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, 0x3401, 0x080c, 0x48b2, 0x0904, 0x3404,
+	0x080c, 0x6494, 0x0904, 0x3401, 0x080c, 0x6536, 0x0904, 0x3401,
+	0x0804, 0x43cf, 0x81ff, 0x1904, 0x3401, 0x080c, 0x48ce, 0x0904,
+	0x3404, 0x080c, 0x65c4, 0x0904, 0x3401, 0x2019, 0x0005, 0x79a8,
+	0x080c, 0x6551, 0x0904, 0x3401, 0x7888, 0x908a, 0x1000, 0x1a04,
+	0x3404, 0x8003, 0x800b, 0x810b, 0x9108, 0x080c, 0x8293, 0x7984,
+	0xd184, 0x1904, 0x33cf, 0x0804, 0x43cf, 0x0126, 0x2091, 0x8000,
+	0x81ff, 0x0118, 0x2009, 0x0001, 0x0450, 0x2029, 0x07ff, 0x645c,
+	0x2400, 0x9506, 0x01f8, 0x2508, 0x080c, 0x63cd, 0x11d8, 0x080c,
+	0x65c4, 0x1128, 0x2009, 0x0002, 0x62c0, 0x2518, 0x00c0, 0x2019,
+	0x0004, 0x900e, 0x080c, 0x6551, 0x1118, 0x2009, 0x0006, 0x0078,
+	0x7884, 0x908a, 0x1000, 0x1270, 0x8003, 0x800b, 0x810b, 0x9108,
+	0x080c, 0x8293, 0x8529, 0x1ae0, 0x012e, 0x0804, 0x33cf, 0x012e,
+	0x0804, 0x3401, 0x012e, 0x0804, 0x3404, 0x080c, 0x48b2, 0x0904,
+	0x3404, 0x080c, 0x6494, 0x0904, 0x3401, 0xbaa0, 0x2019, 0x0005,
+	0x00c6, 0x9066, 0x080c, 0x901a, 0x0076, 0x903e, 0x080c, 0x8ef7,
+	0x900e, 0x080c, 0xdfbd, 0x007e, 0x00ce, 0x080c, 0x6530, 0x0804,
+	0x33cf, 0x080c, 0x48b2, 0x0904, 0x3404, 0x080c, 0x6530, 0x2208,
+	0x0804, 0x33cf, 0x0156, 0x00d6, 0x00e6, 0x2069, 0x1910, 0x6810,
+	0x6914, 0x910a, 0x1208, 0x900e, 0x6816, 0x9016, 0x901e, 0x20a9,
+	0x007e, 0x2069, 0x1000, 0x2d04, 0x905d, 0x0118, 0xb84c, 0x0059,
+	0x9210, 0x8d68, 0x1f04, 0x36f3, 0x2300, 0x9218, 0x00ee, 0x00de,
+	0x015e, 0x0804, 0x33cf, 0x00f6, 0x0016, 0x907d, 0x0138, 0x9006,
+	0x8000, 0x2f0c, 0x81ff, 0x0110, 0x2178, 0x0cd0, 0x001e, 0x00fe,
+	0x0005, 0x2069, 0x1910, 0x6910, 0x62bc, 0x0804, 0x33cf, 0x81ff,
+	0x0120, 0x2009, 0x0001, 0x0804, 0x3401, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x54cb, 0x0128, 0x2009, 0x0007, 0x012e, 0x0804, 0x3401,
+	0x012e, 0x615c, 0x9190, 0x31d0, 0x2215, 0x9294, 0x00ff, 0x637c,
+	0x83ff, 0x0108, 0x6280, 0x67dc, 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, 0x717d, 0x1118, 0x2031,
+	0x0004, 0x0038, 0xd79c, 0x0120, 0x2009, 0x0005, 0x0804, 0x3401,
+	0x9036, 0x7e9a, 0x7f9e, 0x0804, 0x33cf, 0x614c, 0x6250, 0x2019,
+	0x1984, 0x231c, 0x2001, 0x1985, 0x2004, 0x789a, 0x0804, 0x33cf,
+	0x0126, 0x2091, 0x8000, 0x6138, 0x623c, 0x6340, 0x012e, 0x0804,
+	0x33cf, 0x080c, 0x48ce, 0x0904, 0x3404, 0xba44, 0xbb38, 0x0804,
+	0x33cf, 0x080c, 0x0dd5, 0x080c, 0x48ce, 0x2110, 0x0904, 0x3404,
+	0xb804, 0x908c, 0x00ff, 0x918e, 0x0006, 0x0140, 0x9084, 0xff00,
+	0x9086, 0x0600, 0x2009, 0x0009, 0x1904, 0x3401, 0x0126, 0x2091,
+	0x8000, 0x2019, 0x0005, 0x00c6, 0x9066, 0x080c, 0xa512, 0x080c,
+	0x901a, 0x0076, 0x903e, 0x080c, 0x8ef7, 0x900e, 0x080c, 0xdfbd,
+	0x007e, 0x00ce, 0xb807, 0x0407, 0x012e, 0x0804, 0x33cf, 0x614c,
+	0x6250, 0x7884, 0x604e, 0x7b88, 0x6352, 0x2069, 0x1847, 0x831f,
+	0x9305, 0x6816, 0x788c, 0x2069, 0x1984, 0x2d1c, 0x206a, 0x7e98,
+	0x9682, 0x0014, 0x1210, 0x2031, 0x07d0, 0x2069, 0x1985, 0x2d04,
+	0x266a, 0x789a, 0x0804, 0x33cf, 0x0126, 0x2091, 0x8000, 0x7884,
+	0x603a, 0xd0c4, 0x01a8, 0x00d6, 0x78a8, 0x2009, 0x199b, 0x200a,
+	0x78ac, 0x2011, 0x199c, 0x2012, 0x2069, 0x0100, 0x6838, 0x9086,
+	0x0007, 0x1118, 0x2214, 0x6a5a, 0x0010, 0x210c, 0x695a, 0x00de,
+	0x7884, 0xd0b4, 0x0120, 0x3b00, 0x9084, 0xff3f, 0x20d8, 0x7888,
+	0x603e, 0x2011, 0x0114, 0x220c, 0x7888, 0xd08c, 0x0118, 0x918d,
+	0x0080, 0x0010, 0x918c, 0xff7f, 0x2112, 0x788c, 0x6042, 0x9084,
+	0x0020, 0x0130, 0x78b4, 0x6046, 0x9084, 0x0001, 0x090c, 0x40b9,
+	0x6040, 0xd0cc, 0x0120, 0x78b0, 0x2011, 0x0114, 0x2012, 0x012e,
+	0x0804, 0x33cf, 0x00f6, 0x2079, 0x1800, 0x7a38, 0xa898, 0x9084,
+	0xfebf, 0x9215, 0xa89c, 0x9084, 0xfebf, 0x8002, 0x9214, 0x7838,
+	0x9084, 0x0140, 0x9215, 0x7a3a, 0xa897, 0x4000, 0x900e, 0x9085,
+	0x0001, 0x2001, 0x0000, 0x00fe, 0x0005, 0x7898, 0x9005, 0x01a8,
+	0x7888, 0x9025, 0x0904, 0x3404, 0x788c, 0x902d, 0x0904, 0x3404,
+	0x900e, 0x080c, 0x63cd, 0x1120, 0xba44, 0xbb38, 0xbc46, 0xbd3a,
+	0x9186, 0x07ff, 0x0190, 0x8108, 0x0ca0, 0x080c, 0x48ce, 0x0904,
+	0x3404, 0x7888, 0x900d, 0x0904, 0x3404, 0x788c, 0x9005, 0x0904,
+	0x3404, 0xba44, 0xb946, 0xbb38, 0xb83a, 0x0804, 0x33cf, 0x2011,
+	0xbc09, 0x0010, 0x2011, 0xbc05, 0x080c, 0x54cb, 0x1904, 0x3401,
+	0x00c6, 0x2061, 0x0100, 0x7984, 0x9186, 0x00ff, 0x1130, 0x2001,
+	0x1818, 0x2004, 0x9085, 0xff00, 0x0088, 0x9182, 0x007f, 0x16e0,
+	0x9188, 0x31d0, 0x210d, 0x918c, 0x00ff, 0x2001, 0x1818, 0x2004,
+	0x0026, 0x9116, 0x002e, 0x0580, 0x810f, 0x9105, 0x0126, 0x2091,
+	0x8000, 0x0006, 0x080c, 0xab15, 0x000e, 0x0510, 0x602e, 0x620a,
+	0x7984, 0x00b6, 0x080c, 0x6372, 0x2b08, 0x00be, 0x1500, 0x6112,
+	0x6023, 0x0001, 0x080c, 0x489b, 0x01d0, 0x9006, 0xa866, 0x7007,
+	0x0003, 0xa832, 0xa868, 0xc0fd, 0xa86a, 0x701f, 0x38aa, 0x2900,
+	0x6016, 0x2009, 0x0032, 0x080c, 0xabe6, 0x012e, 0x00ce, 0x0005,
+	0x012e, 0x00ce, 0x0804, 0x3401, 0x00ce, 0x0804, 0x3404, 0x080c,
+	0xab6b, 0x0cb0, 0xa830, 0x9086, 0x0100, 0x0904, 0x3401, 0x0804,
+	0x33cf, 0x2061, 0x1a6e, 0x0126, 0x2091, 0x8000, 0x6000, 0xd084,
+	0x0170, 0x6104, 0x6208, 0x2061, 0x1800, 0x6354, 0x6074, 0x789a,
+	0x60c0, 0x789e, 0x60bc, 0x78aa, 0x012e, 0x0804, 0x33cf, 0x900e,
+	0x2110, 0x0c88, 0x81ff, 0x1904, 0x3401, 0x080c, 0x717d, 0x0904,
+	0x3401, 0x0126, 0x2091, 0x8000, 0x6254, 0x6074, 0x9202, 0x0248,
+	0x9085, 0x0001, 0x080c, 0x2759, 0x080c, 0x56db, 0x012e, 0x0804,
+	0x33cf, 0x012e, 0x0804, 0x3404, 0x0006, 0x0016, 0x00c6, 0x00e6,
+	0x2001, 0x19a7, 0x2070, 0x2061, 0x1847, 0x6008, 0x2072, 0x900e,
+	0x2011, 0x1400, 0x080c, 0x8cf7, 0x7206, 0x00ee, 0x00ce, 0x001e,
+	0x000e, 0x0005, 0x0126, 0x2091, 0x8000, 0x81ff, 0x0128, 0x012e,
+	0x2021, 0x400b, 0x0804, 0x33d1, 0x7884, 0xd0fc, 0x0148, 0x2001,
+	0x002a, 0x2004, 0x9082, 0x00e1, 0x0288, 0x012e, 0x0804, 0x3404,
+	0x2001, 0x002a, 0x2004, 0x2069, 0x1847, 0x6908, 0x9102, 0x1230,
+	0x012e, 0x0804, 0x3404, 0x012e, 0x0804, 0x3401, 0x080c, 0xaad5,
+	0x0dd0, 0x7884, 0xd0fc, 0x0904, 0x3975, 0x00c6, 0x080c, 0x489b,
+	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, 0x3afb, 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, 0x48e4, 0x701f,
+	0x3a38, 0x7023, 0x0001, 0x012e, 0x0005, 0x0046, 0x0086, 0x0096,
+	0x00a6, 0x00b6, 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x080c, 0x38e4,
+	0x2001, 0x199d, 0x2003, 0x0000, 0x2021, 0x000a, 0x2061, 0x0100,
+	0x6104, 0x0016, 0x60bb, 0x0000, 0x60bf, 0x32e1, 0x60bf, 0x0012,
+	0x080c, 0x3b6a, 0x080c, 0x3b29, 0x00f6, 0x00e6, 0x0086, 0x2940,
+	0x2071, 0x1a64, 0x2079, 0x0090, 0x00d6, 0x2069, 0x0000, 0x6884,
+	0xd0b4, 0x0140, 0x2001, 0x0035, 0x2004, 0x780e, 0x2001, 0x0034,
+	0x2004, 0x780a, 0x00de, 0x2011, 0x0001, 0x080c, 0x3efd, 0x008e,
+	0x00ee, 0x00fe, 0x080c, 0x3e2a, 0x080c, 0x3d2f, 0x05b8, 0x2001,
+	0x020b, 0x2004, 0x9084, 0x0140, 0x1db8, 0x080c, 0x3f71, 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, 0x1820, 0x2004, 0x9106, 0x1168, 0x00c6, 0x2061,
+	0x0100, 0x6024, 0x9084, 0x1e00, 0x00ce, 0x0138, 0x080c, 0x3d39,
+	0x080c, 0x3b24, 0x0058, 0x080c, 0x3b24, 0x080c, 0x3e95, 0x080c,
+	0x3e20, 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, 0x12e4, 0x2009, 0x0028, 0x080c, 0x2284, 0x2001, 0x0227,
+	0x200c, 0x2102, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x00ae,
+	0x009e, 0x008e, 0x004e, 0x2001, 0x199d, 0x2004, 0x9005, 0x1118,
+	0x012e, 0x0804, 0x33cf, 0x012e, 0x2021, 0x400c, 0x0804, 0x33d1,
+	0x0016, 0x0026, 0x0036, 0x0046, 0x0056, 0x0076, 0x0086, 0x0096,
+	0x00d6, 0x0156, 0x7014, 0x2048, 0x7020, 0x20a8, 0x8000, 0x7022,
+	0xa804, 0x9005, 0x0904, 0x3a94, 0x2048, 0x1f04, 0x3a48, 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, 0x48e4,
+	0x701f, 0x3a38, 0x00b0, 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,
+	0x20a0, 0x0006, 0x080c, 0x0f7d, 0x000e, 0x080c, 0x48e7, 0x701f,
+	0x3a38, 0x015e, 0x00de, 0x009e, 0x008e, 0x007e, 0x005e, 0x004e,
+	0x003e, 0x002e, 0x001e, 0x0005, 0x7014, 0x2048, 0xa864, 0x9086,
+	0x0103, 0x1118, 0x701f, 0x3af9, 0x0450, 0x7014, 0x2048, 0xa868,
+	0xc0fd, 0xa86a, 0x2009, 0x007f, 0x080c, 0x636c, 0x0110, 0x9006,
+	0x0030, 0xb813, 0x00ff, 0xb817, 0xfffd, 0x080c, 0xcce2, 0x015e,
+	0x00de, 0x009e, 0x008e, 0x007e, 0x005e, 0x004e, 0x003e, 0x002e,
+	0x001e, 0x0904, 0x3401, 0x0016, 0x0026, 0x0036, 0x0046, 0x0056,
+	0x0076, 0x0086, 0x0096, 0x00d6, 0x0156, 0x701f, 0x3acb, 0x7007,
+	0x0003, 0x0804, 0x3a89, 0xa830, 0x9086, 0x0100, 0x2021, 0x400c,
+	0x0904, 0x33d1, 0x0076, 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, 0x0f7d,
+	0x000e, 0x080c, 0x48e7, 0x007e, 0x701f, 0x3a38, 0x7023, 0x0001,
+	0x0005, 0x0804, 0x33cf, 0x0156, 0x00c6, 0xa814, 0x908a, 0x001e,
+	0x0218, 0xa833, 0x001e, 0x0010, 0xa832, 0x0078, 0x81ff, 0x0168,
+	0x0016, 0x080c, 0x489b, 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, 0x199d, 0x2003, 0x0001,
+	0x0005, 0x00f6, 0x00e6, 0x00c6, 0x2061, 0x0200, 0x2001, 0x19a8,
+	0x2004, 0x601a, 0x2061, 0x0100, 0x2001, 0x19a7, 0x2004, 0x60ce,
+	0x6104, 0xc1ac, 0x6106, 0x080c, 0x489b, 0xa813, 0x0019, 0xa817,
+	0x0001, 0x2900, 0xa85a, 0x2001, 0x002e, 0x2004, 0xa866, 0x2001,
+	0x002f, 0x2004, 0xa86a, 0x2061, 0x0090, 0x2079, 0x0100, 0x2001,
+	0x19a7, 0x2004, 0x6036, 0x2009, 0x0040, 0x080c, 0x2284, 0x2001,
+	0x002a, 0x2004, 0x9084, 0xfff8, 0xa86e, 0x601a, 0xa873, 0x0000,
+	0x601f, 0x0000, 0x78ca, 0x9006, 0x600a, 0x600e, 0x00ce, 0x00ee,
+	0x00fe, 0x0005, 0x00e6, 0x080c, 0x489b, 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, 0x2ae2, 0x1130,
+	0x9006, 0x080c, 0x2a3a, 0x9006, 0x080c, 0x2a1d, 0x7884, 0x9084,
+	0x0007, 0x0002, 0x3bb5, 0x3bbe, 0x3bc7, 0x3bb2, 0x3bb2, 0x3bb2,
+	0x3bb2, 0x3bb2, 0x012e, 0x0804, 0x3404, 0x2009, 0x0114, 0x2104,
+	0x9085, 0x0800, 0x200a, 0x080c, 0x3d83, 0x00c0, 0x2009, 0x0114,
+	0x2104, 0x9085, 0x4000, 0x200a, 0x080c, 0x3d83, 0x0078, 0x080c,
+	0x717d, 0x1128, 0x012e, 0x2009, 0x0016, 0x0804, 0x3401, 0x81ff,
+	0x0128, 0x012e, 0x2021, 0x400b, 0x0804, 0x33d1, 0x0086, 0x0096,
+	0x00a6, 0x00b6, 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x080c, 0x38e4,
+	0x2009, 0x0101, 0x210c, 0x0016, 0x7ec8, 0x7dcc, 0x9006, 0x2068,
+	0x2060, 0x2058, 0x080c, 0x404c, 0x080c, 0x3f9c, 0x903e, 0x2720,
+	0x00f6, 0x00e6, 0x0086, 0x2940, 0x2071, 0x1a64, 0x2079, 0x0090,
+	0x00d6, 0x2069, 0x0000, 0x6884, 0xd0b4, 0x0120, 0x68d4, 0x780e,
+	0x68d0, 0x780a, 0x00de, 0x2011, 0x0001, 0x080c, 0x3efd, 0x080c,
+	0x2aea, 0x080c, 0x2aea, 0x080c, 0x2aea, 0x080c, 0x2aea, 0x080c,
+	0x3efd, 0x008e, 0x00ee, 0x00fe, 0x080c, 0x3e2a, 0x2009, 0x9c40,
+	0x8109, 0x11b0, 0x080c, 0x3d39, 0x2001, 0x0004, 0x200c, 0x918c,
+	0xfffd, 0x2102, 0x001e, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be,
+	0x00ae, 0x009e, 0x008e, 0x2009, 0x0017, 0x080c, 0x3401, 0x0cf8,
+	0x2001, 0x020b, 0x2004, 0x9084, 0x0140, 0x1d10, 0x00f6, 0x2079,
+	0x0000, 0x7884, 0x00fe, 0xd0bc, 0x0178, 0x2001, 0x0201, 0x200c,
+	0x81ff, 0x0150, 0x080c, 0x3e08, 0x2d00, 0x9c05, 0x9b05, 0x0120,
+	0x080c, 0x3d39, 0x0804, 0x3ce6, 0x080c, 0x3f71, 0x080c, 0x3e95,
+	0x080c, 0x3deb, 0x080c, 0x3e20, 0x00f6, 0x2079, 0x0100, 0x7824,
+	0xd0ac, 0x0130, 0x8b58, 0x080c, 0x3d39, 0x00fe, 0x0804, 0x3ce6,
+	0x00fe, 0x080c, 0x3d2f, 0x1150, 0x8d68, 0x2001, 0x0032, 0x2602,
+	0x2001, 0x0033, 0x2502, 0x080c, 0x3d39, 0x0080, 0x87ff, 0x0138,
+	0x2001, 0x0201, 0x2004, 0x9005, 0x1908, 0x8739, 0x0038, 0x2001,
+	0x1a60, 0x2004, 0x9086, 0x0000, 0x1904, 0x3c36, 0x2001, 0x032f,
+	0x2003, 0x00f6, 0x8631, 0x1208, 0x8529, 0x2500, 0x9605, 0x0904,
+	0x3ce6, 0x7884, 0xd0bc, 0x0128, 0x2d00, 0x9c05, 0x9b05, 0x1904,
+	0x3ce6, 0xa013, 0x0019, 0x2001, 0x032a, 0x2003, 0x0004, 0x7884,
+	0xd0ac, 0x1148, 0x2001, 0x1a60, 0x2003, 0x0003, 0x2001, 0x032a,
+	0x2003, 0x0009, 0x0030, 0xa017, 0x0001, 0x78b4, 0x9005, 0x0108,
+	0xa016, 0x2800, 0xa05a, 0x2009, 0x0040, 0x080c, 0x2284, 0x2900,
+	0xa85a, 0xa813, 0x0019, 0x7884, 0xd0a4, 0x1180, 0xa817, 0x0000,
+	0x00c6, 0x20a9, 0x0004, 0x2061, 0x0090, 0x602b, 0x0008, 0x2001,
+	0x0203, 0x2004, 0x1f04, 0x3cbd, 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, 0x3bf0, 0x001e, 0x00c6,
+	0x2001, 0x032a, 0x2003, 0x0004, 0x2061, 0x0100, 0x6027, 0x0002,
+	0x6106, 0x2011, 0x020d, 0x2013, 0x0020, 0x2001, 0x0004, 0x200c,
+	0x918c, 0xfffd, 0x2102, 0x080c, 0x12e4, 0x7884, 0x9084, 0x0003,
+	0x9086, 0x0002, 0x01a0, 0x2009, 0x0028, 0x080c, 0x2284, 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, 0x33cf, 0x012e, 0x2021, 0x400c, 0x0804, 0x33d1, 0x9085,
+	0x0001, 0x1d04, 0x3d38, 0x2091, 0x6000, 0x8420, 0x9486, 0x0064,
+	0x0005, 0x2001, 0x0105, 0x2003, 0x0010, 0x2001, 0x032a, 0x2003,
+	0x0004, 0x2001, 0x1a60, 0x2003, 0x0000, 0x0071, 0x2009, 0x0048,
+	0x080c, 0x2284, 0x2001, 0x0227, 0x2024, 0x2402, 0x2001, 0x0109,
+	0x2003, 0x4000, 0x9026, 0x0005, 0x00f6, 0x00e6, 0x2071, 0x1a64,
+	0x7000, 0x9086, 0x0000, 0x0520, 0x2079, 0x0090, 0x2009, 0x0206,
+	0x2104, 0x2009, 0x0203, 0x210c, 0x9106, 0x1120, 0x2009, 0x0040,
+	0x080c, 0x2284, 0x782c, 0xd0fc, 0x0d88, 0x080c, 0x3f71, 0x7000,
+	0x9086, 0x0000, 0x1d58, 0x782b, 0x0004, 0x782c, 0xd0ac, 0x1de8,
+	0x2009, 0x0040, 0x080c, 0x2284, 0x782b, 0x0002, 0x7003, 0x0000,
+	0x00ee, 0x00fe, 0x0005, 0x00f6, 0x2079, 0x0100, 0x2001, 0x1818,
+	0x200c, 0x7932, 0x7936, 0x080c, 0x2739, 0x7850, 0x9084, 0xfbff,
+	0x9085, 0x0030, 0x7852, 0x2019, 0x01f4, 0x8319, 0x1df0, 0x9084,
+	0xffcf, 0x9085, 0x2000, 0x7852, 0x20a9, 0x0046, 0x1d04, 0x3d9e,
+	0x2091, 0x6000, 0x1f04, 0x3d9e, 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,
+	0x3dbe, 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, 0x2ba1,
+	0x7827, 0x0020, 0x7843, 0x0000, 0x9006, 0x080c, 0x2ba1, 0x7827,
+	0x0048, 0x00fe, 0x0005, 0x7884, 0xd0ac, 0x11c8, 0x00f6, 0x00e6,
+	0x2071, 0x1a60, 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, 0x19a8, 0x2004,
+	0x70e2, 0x080c, 0x3b1a, 0x1188, 0x2001, 0x1820, 0x2004, 0x2009,
+	0x181f, 0x210c, 0x918c, 0x00ff, 0x706e, 0x716a, 0x7066, 0x918d,
+	0x3200, 0x7162, 0x7073, 0xe109, 0x0080, 0x702c, 0x9085, 0x0002,
+	0x702e, 0x2009, 0x1818, 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,
+	0x3f71, 0x00f6, 0x2071, 0x1a60, 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, 0x3efd, 0x2011, 0x0001,
+	0x080c, 0x3efd, 0x00fe, 0x00ee, 0x0005, 0x00f6, 0x00e6, 0x2071,
+	0x1a60, 0x2079, 0x0320, 0x792c, 0xd1fc, 0x0904, 0x3efa, 0x782b,
+	0x0002, 0x9026, 0xd19c, 0x1904, 0x3ef6, 0x7000, 0x0002, 0x3efa,
+	0x3eab, 0x3edb, 0x3ef6, 0xd1bc, 0x1170, 0xd1dc, 0x1190, 0x8001,
+	0x7002, 0x2011, 0x0001, 0x080c, 0x3efd, 0x0904, 0x3efa, 0x080c,
+	0x3efd, 0x0804, 0x3efa, 0x00f6, 0x2079, 0x0300, 0x78bf, 0x0000,
+	0x00fe, 0x7810, 0x7914, 0x782b, 0x0004, 0x7812, 0x7916, 0x2001,
+	0x0201, 0x200c, 0x81ff, 0x0de8, 0x080c, 0x3e08, 0x2009, 0x0001,
+	0x00f6, 0x2079, 0x0300, 0x78b8, 0x00fe, 0xd0ec, 0x0110, 0x2009,
+	0x0011, 0x792a, 0x00f8, 0x8001, 0x7002, 0x9184, 0x0880, 0x1140,
+	0x782c, 0xd0fc, 0x1904, 0x3e9f, 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, 0x0dd5,
+	0x9398, 0x3f2b, 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, 0x3f68, 0x3f5f, 0x3f56, 0x3f4d, 0x3f44,
+	0x3f3b, 0x3f32, 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, 0x1a64, 0x2079, 0x0090,
+	0x792c, 0xd1fc, 0x01e8, 0x782b, 0x0002, 0x2940, 0x9026, 0x7000,
+	0x0002, 0x3f98, 0x3f84, 0x3f8f, 0x8001, 0x7002, 0xd19c, 0x1180,
+	0x2011, 0x0001, 0x080c, 0x3efd, 0x190c, 0x3efd, 0x0048, 0x8001,
+	0x7002, 0x782c, 0xd0fc, 0x1d38, 0x2011, 0x0001, 0x080c, 0x3efd,
+	0x008e, 0x00ee, 0x00fe, 0x0005, 0x00f6, 0x00e6, 0x00c6, 0x0086,
+	0x2061, 0x0200, 0x2001, 0x19a8, 0x2004, 0x601a, 0x2061, 0x0100,
+	0x2001, 0x19a7, 0x2004, 0x60ce, 0x6104, 0xc1ac, 0x6106, 0x2001,
+	0x002c, 0x2004, 0x9005, 0x0520, 0x2038, 0x2001, 0x002e, 0x2024,
+	0x2001, 0x002f, 0x201c, 0x080c, 0x489b, 0xa813, 0x0019, 0xaf16,
+	0x2900, 0xa85a, 0x978a, 0x0007, 0x0220, 0x2138, 0x2009, 0x0007,
+	0x0010, 0x2708, 0x903e, 0x0096, 0xa858, 0x2048, 0xa85c, 0x9080,
+	0x0019, 0x009e, 0x080c, 0x4014, 0x1d68, 0x2900, 0xa85a, 0x00d0,
+	0x080c, 0x489b, 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, 0x19a7,
+	0x2004, 0x6036, 0x2009, 0x0040, 0x080c, 0x2284, 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, 0x489b, 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, 0x489b, 0x2940, 0xa813, 0x0019, 0xaf16, 0x2900,
+	0xa85a, 0x978a, 0x0007, 0x0220, 0x2138, 0x2009, 0x0007, 0x0010,
+	0x2708, 0x903e, 0x0096, 0xa858, 0x2048, 0xa85c, 0x9080, 0x0019,
+	0x009e, 0x080c, 0x4014, 0x1d68, 0x2900, 0xa85a, 0x00d8, 0x080c,
+	0x489b, 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, 0x1a60, 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, 0x0007, 0x20a1, 0x1840,
+	0x20e9, 0x0001, 0x9006, 0x4004, 0x20a9, 0x000c, 0x20a1, 0xfff4,
+	0x20e9, 0x0000, 0x9006, 0x4004, 0x2009, 0x013c, 0x200a, 0x012e,
+	0x7880, 0x9086, 0x0052, 0x0108, 0x0005, 0x0804, 0x33cf, 0x7d98,
+	0x7c9c, 0x0804, 0x34c6, 0x080c, 0x54c6, 0x1128, 0x3a00, 0x9084,
+	0x0010, 0x0904, 0x3404, 0x080c, 0x717d, 0x190c, 0x5dbd, 0x6040,
+	0x9084, 0x0020, 0x0971, 0x2069, 0x1847, 0x2d00, 0x2009, 0x0030,
+	0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x2039, 0x0001, 0x080c, 0x48e4,
+	0x701f, 0x40fb, 0x0005, 0x080c, 0x54c6, 0x1130, 0x3b00, 0x3a08,
+	0xc194, 0xc095, 0x20d8, 0x21d0, 0x2069, 0x1847, 0x6800, 0x9005,
+	0x0904, 0x3404, 0x6804, 0xd0ac, 0x0118, 0xd0a4, 0x0904, 0x3404,
 	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,
+	0x6a28, 0x928a, 0x007f, 0x1a04, 0x3404, 0x9288, 0x31d0, 0x210d,
+	0x918c, 0x00ff, 0x6166, 0xd0dc, 0x0130, 0x6828, 0x908a, 0x007f,
+	0x1a04, 0x3404, 0x605e, 0x6888, 0x9084, 0x0030, 0x8004, 0x8004,
+	0x8004, 0x8004, 0x0006, 0x2009, 0x19af, 0x9080, 0x282c, 0x2005,
+	0x200a, 0x000e, 0x2009, 0x19b0, 0x9080, 0x2830, 0x2005, 0x200a,
+	0x6808, 0x908a, 0x0100, 0x0a04, 0x3404, 0x908a, 0x0841, 0x1a04,
+	0x3404, 0x9084, 0x0007, 0x1904, 0x3404, 0x680c, 0x9005, 0x0904,
+	0x3404, 0x6810, 0x9005, 0x0904, 0x3404, 0x6848, 0x6940, 0x910a,
+	0x1a04, 0x3404, 0x8001, 0x0904, 0x3404, 0x684c, 0x6944, 0x910a,
+	0x1a04, 0x3404, 0x8001, 0x0904, 0x3404, 0x2009, 0x197f, 0x200b,
+	0x0000, 0x2001, 0x1869, 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,
+	0x00ff, 0x614e, 0x8007, 0x9084, 0x00ff, 0x6052, 0x080c, 0x7496,
+	0x080c, 0x676d, 0x080c, 0x67a1, 0x6808, 0x602a, 0x080c, 0x21f6,
 	0x2009, 0x0170, 0x200b, 0x0080, 0xa001, 0xa001, 0x200b, 0x0000,
-	0x0036, 0x6b08, 0x080c, 0x2579, 0x003e, 0x6000, 0x9086, 0x0000,
-	0x1904, 0x403f, 0x6818, 0x691c, 0x6a20, 0x6b24, 0x8007, 0x810f,
+	0x0036, 0x6b08, 0x080c, 0x2793, 0x003e, 0x6000, 0x9086, 0x0000,
+	0x1904, 0x4292, 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,
+	0x8007, 0x810f, 0x8217, 0x831f, 0x20a9, 0x0004, 0x20a1, 0x19b1,
+	0x20e9, 0x0001, 0x4001, 0x20a9, 0x0004, 0x20a1, 0x19cb, 0x20e9,
+	0x0001, 0x4001, 0x080c, 0x837e, 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,
+	0x8109, 0x080c, 0x7a4c, 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,
+	0x6003, 0x0003, 0x0010, 0x6003, 0x0001, 0x1f04, 0x41ec, 0x00ce,
+	0x00c6, 0x2061, 0x199a, 0x6a88, 0x9284, 0xc000, 0x2010, 0x9286,
+	0x0000, 0x1158, 0x2063, 0x0000, 0x2001, 0x0001, 0x080c, 0x2a3a,
+	0x2001, 0x0001, 0x080c, 0x2a1d, 0x0088, 0x9286, 0x4000, 0x1148,
+	0x2063, 0x0001, 0x9006, 0x080c, 0x2a3a, 0x9006, 0x080c, 0x2a1d,
+	0x0028, 0x9286, 0x8000, 0x1d30, 0x2063, 0x0002, 0x00ce, 0x6888,
+	0xd0ec, 0x0130, 0x2011, 0x0114, 0x2204, 0x9085, 0x0100, 0x2012,
+	0x6a80, 0x9284, 0x0030, 0x9086, 0x0030, 0x1128, 0x9294, 0xffcf,
+	0x9295, 0x0020, 0x6a82, 0x2001, 0x197c, 0x6a80, 0x9294, 0x0030,
+	0x928e, 0x0000, 0x0170, 0x928e, 0x0010, 0x0118, 0x928e, 0x0020,
+	0x0140, 0x2003, 0xaaaa, 0x080c, 0x2808, 0x2001, 0x196d, 0x2102,
+	0x0008, 0x2102, 0x00c6, 0x2061, 0x0100, 0x602f, 0x0040, 0x602f,
+	0x0000, 0x00ce, 0x080c, 0x717d, 0x0128, 0x080c, 0x4dd2, 0x0110,
+	0x080c, 0x2759, 0x60d4, 0x9005, 0x01c0, 0x6003, 0x0001, 0x2009,
+	0x427a, 0x00e0, 0x080c, 0x717d, 0x1168, 0x2011, 0x7013, 0x080c,
+	0x8285, 0x2011, 0x7006, 0x080c, 0x835c, 0x080c, 0x746a, 0x080c,
+	0x70af, 0x0040, 0x080c, 0x5cb7, 0x0028, 0x6003, 0x0004, 0x2009,
+	0x4292, 0x0020, 0x080c, 0x66a2, 0x0804, 0x33cf, 0x2001, 0x0170,
+	0x2004, 0x9084, 0x00ff, 0x9086, 0x004c, 0x1118, 0x2091, 0x30bd,
+	0x0817, 0x2091, 0x303d, 0x0817, 0x6000, 0x9086, 0x0000, 0x0904,
+	0x3401, 0x2069, 0x1847, 0x7890, 0x6842, 0x7894, 0x6846, 0x2d00,
+	0x2009, 0x0030, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x2039, 0x0001,
+	0x0804, 0x48e7, 0x9006, 0x080c, 0x2759, 0x81ff, 0x1904, 0x3401,
+	0x080c, 0x717d, 0x11b0, 0x080c, 0x7465, 0x080c, 0x5df8, 0x080c,
+	0x31c4, 0x0118, 0x6130, 0xc18d, 0x6132, 0x080c, 0xcf18, 0x0130,
+	0x080c, 0x71a0, 0x1118, 0x080c, 0x7155, 0x0038, 0x080c, 0x70af,
+	0x0020, 0x080c, 0x5dbd, 0x080c, 0x5cb7, 0x0804, 0x33cf, 0x81ff,
+	0x1904, 0x3401, 0x080c, 0x717d, 0x1110, 0x0804, 0x3401, 0x6194,
+	0x81ff, 0x01a8, 0x704f, 0x0000, 0x2001, 0x1c80, 0x2009, 0x0040,
+	0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x0126, 0x2091, 0x8000, 0x2039,
+	0x0001, 0x080c, 0x48e7, 0x701f, 0x33cd, 0x012e, 0x0005, 0x704f,
+	0x0001, 0x00d6, 0x2069, 0x1c80, 0x20a9, 0x0040, 0x20e9, 0x0001,
+	0x20a1, 0x1c80, 0x2019, 0xffff, 0x4304, 0x655c, 0x9588, 0x31d0,
+	0x210d, 0x918c, 0x00ff, 0x216a, 0x900e, 0x2011, 0x0002, 0x2100,
+	0x9506, 0x01a8, 0x080c, 0x63cd, 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, 0x5d48, 0x0804, 0x42ec, 0x080c, 0x48ce, 0x0904, 0x3404,
+	0x080c, 0x489b, 0x1120, 0x2009, 0x0002, 0x0804, 0x3401, 0x080c,
+	0x54b7, 0xd0b4, 0x0558, 0x7884, 0x908e, 0x007e, 0x0538, 0x908e,
+	0x007f, 0x0520, 0x908e, 0x0080, 0x0508, 0x080c, 0x31bf, 0x1148,
+	0xb800, 0xd08c, 0x11d8, 0xb804, 0x9084, 0x00ff, 0x9086, 0x0006,
+	0x11a8, 0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a, 0x080c, 0xc9e7,
+	0x1120, 0x2009, 0x0003, 0x0804, 0x3401, 0x7007, 0x0003, 0x701f,
+	0x437a, 0x0005, 0x080c, 0x48ce, 0x0904, 0x3404, 0x20a9, 0x002b,
+	0xb8c4, 0x20e0, 0xb8c8, 0x2098, 0xa860, 0x20e8, 0xa85c, 0x9080,
+	0x0002, 0x20a0, 0x4003, 0x20a9, 0x0008, 0x9080, 0x0006, 0x20a0,
+	0xb8c4, 0x20e0, 0xb8c8, 0x9080, 0x0006, 0x2098, 0x080c, 0x0f7d,
+	0x0070, 0x20a9, 0x0004, 0xa85c, 0x9080, 0x000a, 0x20a0, 0xb8c4,
+	0x20e0, 0xb8c8, 0x9080, 0x000a, 0x2098, 0x080c, 0x0f7d, 0x8906,
+	0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x0002,
+	0x2009, 0x002b, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x0804, 0x48e7,
+	0x81ff, 0x1904, 0x3401, 0x080c, 0x48b2, 0x0904, 0x3404, 0x080c,
+	0x653f, 0x0904, 0x3401, 0x0058, 0xa878, 0x9005, 0x0120, 0x2009,
+	0x0004, 0x0804, 0x3401, 0xa974, 0xaa94, 0x0804, 0x33cf, 0x080c,
+	0x54bf, 0x0904, 0x33cf, 0x701f, 0x43c4, 0x7007, 0x0003, 0x0005,
+	0x81ff, 0x1904, 0x3401, 0x7888, 0x908a, 0x1000, 0x1a04, 0x3404,
+	0x080c, 0x48ce, 0x0904, 0x3404, 0x080c, 0x6737, 0x0120, 0x080c,
+	0x673f, 0x1904, 0x3404, 0x080c, 0x65c4, 0x0904, 0x3401, 0x2019,
+	0x0004, 0x900e, 0x080c, 0x6551, 0x0904, 0x3401, 0x7984, 0x7a88,
+	0x04c9, 0x08a8, 0xa89c, 0x908a, 0x1000, 0x12f8, 0x080c, 0x48cc,
+	0x01e0, 0x080c, 0x6737, 0x0118, 0x080c, 0x673f, 0x11b0, 0x080c,
+	0x65c4, 0x2009, 0x0002, 0x0168, 0x2009, 0x0002, 0x2019, 0x0004,
+	0x080c, 0x6551, 0x2009, 0x0003, 0x0120, 0xa998, 0xaa9c, 0x00d1,
+	0x0060, 0xa897, 0x4005, 0xa99a, 0x0010, 0xa897, 0x4006, 0x900e,
+	0x9085, 0x0001, 0x2001, 0x0030, 0x0005, 0xa897, 0x4000, 0x080c,
+	0x54bf, 0x0110, 0x9006, 0x0018, 0x900e, 0x9085, 0x0001, 0x2001,
+	0x0000, 0x0005, 0x9186, 0x00ff, 0x0110, 0x0071, 0x0060, 0x2029,
+	0x007e, 0x2061, 0x1800, 0x645c, 0x2400, 0x9506, 0x0110, 0x2508,
+	0x0019, 0x8529, 0x1ec8, 0x0005, 0x080c, 0x63cd, 0x1138, 0x2200,
+	0x8003, 0x800b, 0x810b, 0x9108, 0x080c, 0x8293, 0x0005, 0x81ff,
+	0x1904, 0x3401, 0x080c, 0x48b2, 0x0904, 0x3404, 0x080c, 0x6494,
+	0x0904, 0x3401, 0x080c, 0x6548, 0x0904, 0x3401, 0x0804, 0x43cf,
+	0x81ff, 0x1904, 0x3401, 0x080c, 0x48b2, 0x0904, 0x3404, 0x080c,
+	0x6737, 0x0120, 0x080c, 0x673f, 0x1904, 0x3404, 0x080c, 0x6494,
+	0x0904, 0x3401, 0x080c, 0x6536, 0x0904, 0x3401, 0x0804, 0x43cf,
+	0x6100, 0x0804, 0x33cf, 0x080c, 0x48ce, 0x0904, 0x3404, 0x080c,
+	0x54cb, 0x1904, 0x3401, 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, 0x33cf,
+	0x78a8, 0x909c, 0x0003, 0xd0b4, 0x1140, 0x939a, 0x0003, 0x1a04,
+	0x3401, 0x625c, 0x7884, 0x9206, 0x1548, 0x080c, 0x8368, 0x2001,
+	0xfff4, 0x2009, 0x000c, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x2039,
+	0x0000, 0x0006, 0x78a8, 0x9084, 0x0080, 0x1118, 0x000e, 0x0804,
+	0x48e7, 0x000e, 0x2031, 0x0000, 0x2061, 0x18b8, 0x2c44, 0xa66a,
+	0xa17a, 0xa772, 0xa076, 0xa28e, 0xa392, 0xa496, 0xa59a, 0x080c,
+	0x10e0, 0x7007, 0x0002, 0x701f, 0x44f6, 0x0005, 0x81ff, 0x1904,
+	0x3401, 0x080c, 0x48ce, 0x0904, 0x3404, 0x080c, 0x6737, 0x1904,
+	0x3401, 0x00c6, 0x080c, 0x489b, 0x00ce, 0x0904, 0x3401, 0xa867,
+	0x0000, 0xa868, 0xc0fd, 0xa86a, 0x7ea8, 0x080c, 0xc98d, 0x0904,
+	0x3401, 0x7007, 0x0003, 0x701f, 0x44fa, 0x0005, 0x080c, 0x40b9,
+	0x0804, 0x33cf, 0xa830, 0x9086, 0x0100, 0x0904, 0x3401, 0x8906,
+	0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x001b,
+	0x2009, 0x000c, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x0804, 0x48e7,
+	0x9006, 0x080c, 0x2759, 0x78a8, 0x9084, 0x00ff, 0x9086, 0x00ff,
+	0x0118, 0x81ff, 0x1904, 0x3401, 0x080c, 0x717d, 0x0110, 0x080c,
+	0x5dbd, 0x7888, 0x908a, 0x1000, 0x1a04, 0x3404, 0x7984, 0x9186,
+	0x00ff, 0x0138, 0x9182, 0x007f, 0x1a04, 0x3404, 0x2100, 0x080c,
+	0x2723, 0x0026, 0x00c6, 0x0126, 0x2091, 0x8000, 0x2061, 0x19f8,
+	0x601b, 0x0000, 0x601f, 0x0000, 0x6073, 0x0000, 0x6077, 0x0000,
+	0x080c, 0x717d, 0x1158, 0x080c, 0x7465, 0x080c, 0x5df8, 0x9085,
+	0x0001, 0x080c, 0x71c4, 0x080c, 0x70af, 0x00d0, 0x080c, 0xaadc,
+	0x2061, 0x0100, 0x2001, 0x1818, 0x2004, 0x9084, 0x00ff, 0x810f,
+	0x9105, 0x604a, 0x6043, 0x0090, 0x6043, 0x0010, 0x2009, 0x1997,
+	0x200b, 0x0000, 0x2009, 0x002d, 0x2011, 0x5ce3, 0x080c, 0x831a,
+	0x7984, 0x080c, 0x717d, 0x1110, 0x2009, 0x00ff, 0x7a88, 0x080c,
+	0x4432, 0x012e, 0x00ce, 0x002e, 0x0804, 0x33cf, 0x7984, 0x080c,
+	0x636c, 0x2b08, 0x1904, 0x3404, 0x0804, 0x33cf, 0x81ff, 0x0120,
+	0x2009, 0x0001, 0x0804, 0x3401, 0x60dc, 0xd0ac, 0x1130, 0xd09c,
+	0x1120, 0x2009, 0x0005, 0x0804, 0x3401, 0x080c, 0x489b, 0x1120,
+	0x2009, 0x0002, 0x0804, 0x3401, 0x7984, 0x9192, 0x0021, 0x1a04,
+	0x3404, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0xa85c, 0x9080, 0x0019,
+	0x702a, 0xaf60, 0x7736, 0x080c, 0x48e4, 0x701f, 0x45ae, 0x7880,
+	0x9086, 0x006e, 0x0110, 0x701f, 0x4f84, 0x0005, 0x2009, 0x0080,
+	0x080c, 0x63cd, 0x1118, 0x080c, 0x6737, 0x0120, 0x2021, 0x400a,
+	0x0804, 0x33d1, 0x00d6, 0x0096, 0xa964, 0xaa6c, 0xab70, 0xac74,
+	0xad78, 0xae7c, 0xa884, 0x90be, 0x0100, 0x0904, 0x4647, 0x90be,
+	0x0112, 0x0904, 0x4647, 0x90be, 0x0113, 0x0904, 0x4647, 0x90be,
+	0x0114, 0x0904, 0x4647, 0x90be, 0x0117, 0x0904, 0x4647, 0x90be,
+	0x011a, 0x0904, 0x4647, 0x90be, 0x011c, 0x0904, 0x4647, 0x90be,
+	0x0121, 0x0904, 0x462e, 0x90be, 0x0131, 0x0904, 0x462e, 0x90be,
+	0x0171, 0x0904, 0x4647, 0x90be, 0x0173, 0x0904, 0x4647, 0x90be,
+	0x01a1, 0x1128, 0xa894, 0x8007, 0xa896, 0x0804, 0x4652, 0x90be,
+	0x0212, 0x0904, 0x463b, 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, 0x3404, 0x7028, 0x9080, 0x0010,
+	0x2098, 0x20a0, 0x7034, 0x20e0, 0x20e8, 0x20a9, 0x0007, 0x080c,
+	0x4690, 0x7028, 0x9080, 0x000e, 0x2098, 0x20a0, 0x7034, 0x20e0,
+	0x20e8, 0x20a9, 0x0001, 0x080c, 0x4690, 0x00c8, 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,
+	0x080c, 0x469d, 0x00b8, 0x7028, 0x9080, 0x000e, 0x2098, 0x20a0,
+	0x7034, 0x20e0, 0x20e8, 0x20a9, 0x0001, 0x080c, 0x469d, 0x7028,
+	0x9080, 0x000c, 0x2098, 0x20a0, 0x7034, 0x20e0, 0x20e8, 0x20a9,
+	0x0001, 0x04f1, 0x00c6, 0x080c, 0x489b, 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, 0xc9a8, 0x1120, 0x2009,
+	0x0003, 0x0804, 0x3401, 0x7007, 0x0003, 0x701f, 0x4687, 0x0005,
+	0x00ce, 0x009e, 0x00de, 0x2009, 0x0002, 0x0804, 0x3401, 0xa820,
+	0x9086, 0x8001, 0x1904, 0x33cf, 0x2009, 0x0004, 0x0804, 0x3401,
+	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, 0x3401, 0x60dc, 0xd0ac,
+	0x1130, 0xd09c, 0x1120, 0x2009, 0x0005, 0x0804, 0x3401, 0x7984,
+	0x78a8, 0x2040, 0x080c, 0xaad5, 0x1120, 0x9182, 0x007f, 0x0a04,
+	0x3404, 0x9186, 0x00ff, 0x0904, 0x3404, 0x9182, 0x0800, 0x1a04,
+	0x3404, 0x7a8c, 0x7b88, 0x607c, 0x9306, 0x1140, 0x6080, 0x924e,
+	0x0904, 0x3404, 0x99cc, 0xff00, 0x0904, 0x3404, 0x0126, 0x2091,
+	0x8000, 0x080c, 0x47ae, 0x0904, 0x472e, 0x0086, 0x90c6, 0x4000,
+	0x008e, 0x1538, 0x00c6, 0x0006, 0x0036, 0xb818, 0xbb1c, 0x9305,
+	0xbb20, 0x9305, 0xbb24, 0x9305, 0xbb28, 0x9305, 0xbb2c, 0x9305,
+	0xbb30, 0x9305, 0xbb34, 0x9305, 0x003e, 0x0570, 0xd88c, 0x1128,
+	0x080c, 0x6737, 0x0110, 0xc89d, 0x0438, 0x900e, 0x080c, 0x65ed,
+	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, 0x33d1, 0x000e, 0x00ce, 0x2b00, 0x7026,
+	0x0016, 0x00b6, 0x00c6, 0x00e6, 0x2c70, 0x080c, 0xabb9, 0x0904,
+	0x4783, 0x2b00, 0x6012, 0x080c, 0xcc93, 0x2e58, 0x00ee, 0x00e6,
+	0x00c6, 0x080c, 0x489b, 0x00ce, 0x2b70, 0x1158, 0x080c, 0xab6b,
+	0x00ee, 0x00ce, 0x00be, 0x001e, 0x012e, 0x2009, 0x0002, 0x0804,
+	0x3401, 0x900e, 0xa966, 0xa96a, 0x2900, 0x6016, 0xa932, 0xa868,
+	0xc0fd, 0xd88c, 0x0108, 0xc0f5, 0xa86a, 0xd89c, 0x1110, 0x080c,
+	0x306e, 0x6023, 0x0001, 0x9006, 0x080c, 0x6309, 0xd89c, 0x0138,
+	0x2001, 0x0004, 0x080c, 0x631d, 0x2009, 0x0003, 0x0030, 0x2001,
+	0x0002, 0x080c, 0x631d, 0x2009, 0x0002, 0x080c, 0xabe6, 0x78a8,
+	0xd094, 0x0138, 0x00ee, 0x7024, 0x00e6, 0x2058, 0xb8cc, 0xc08d,
+	0xb8ce, 0x9085, 0x0001, 0x00ee, 0x00ce, 0x00be, 0x001e, 0x012e,
+	0x1120, 0x2009, 0x0003, 0x0804, 0x3401, 0x7007, 0x0003, 0x701f,
+	0x4792, 0x0005, 0xa830, 0x9086, 0x0100, 0x7024, 0x2058, 0x1138,
+	0x2009, 0x0004, 0xba04, 0x9294, 0x00ff, 0x0804, 0x5414, 0x900e,
+	0xa868, 0xd0f4, 0x1904, 0x33cf, 0x080c, 0x65ed, 0x1108, 0xc185,
+	0xb800, 0xd0bc, 0x0108, 0xc18d, 0x0804, 0x33cf, 0x00e6, 0x00d6,
+	0x0096, 0x83ff, 0x0904, 0x47fd, 0x902e, 0x080c, 0xaad5, 0x0130,
+	0x9026, 0x20a9, 0x0800, 0x2071, 0x1000, 0x0030, 0x2021, 0x007f,
+	0x20a9, 0x0781, 0x2071, 0x107f, 0x2e04, 0x9005, 0x11b8, 0x2100,
+	0x9406, 0x1904, 0x480e, 0x2428, 0x94ce, 0x007f, 0x1120, 0x92ce,
+	0xfffd, 0x1558, 0x0030, 0x94ce, 0x0080, 0x1130, 0x92ce, 0xfffc,
+	0x1520, 0x93ce, 0x00ff, 0x1508, 0xc5fd, 0x0480, 0x2058, 0xbf10,
+	0x2700, 0x9306, 0x11e8, 0xbe14, 0x2600, 0x9206, 0x11c8, 0x2400,
+	0x9106, 0x1180, 0xd884, 0x0598, 0xd894, 0x1588, 0x080c, 0x66d7,
+	0x1570, 0x2001, 0x4000, 0x0460, 0x080c, 0x6737, 0x1540, 0x2001,
+	0x4000, 0x0430, 0x2001, 0x4007, 0x0418, 0x2001, 0x4006, 0x0400,
+	0x2400, 0x9106, 0x1158, 0xbe14, 0x87ff, 0x1128, 0x86ff, 0x0918,
+	0x080c, 0xaad5, 0x1900, 0x2001, 0x4008, 0x0090, 0x8420, 0x8e70,
+	0x1f04, 0x47c4, 0x85ff, 0x1130, 0x2001, 0x4009, 0x0048, 0x2001,
+	0x0001, 0x0030, 0x080c, 0x636c, 0x1dd0, 0xbb12, 0xba16, 0x9006,
+	0x9005, 0x009e, 0x00de, 0x00ee, 0x0005, 0x81ff, 0x0120, 0x2009,
+	0x0001, 0x0804, 0x3401, 0x080c, 0x489b, 0x1120, 0x2009, 0x0002,
+	0x0804, 0x3401, 0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a, 0x7884,
+	0x9005, 0x0904, 0x3404, 0x9096, 0x00ff, 0x0120, 0x9092, 0x0004,
+	0x1a04, 0x3404, 0x2010, 0x2918, 0x080c, 0x3014, 0x1120, 0x2009,
+	0x0003, 0x0804, 0x3401, 0x7007, 0x0003, 0x701f, 0x4850, 0x0005,
+	0xa830, 0x9086, 0x0100, 0x1904, 0x33cf, 0x2009, 0x0004, 0x0804,
+	0x3401, 0x7984, 0x080c, 0xaad5, 0x1120, 0x9182, 0x007f, 0x0a04,
+	0x3404, 0x9186, 0x00ff, 0x0904, 0x3404, 0x9182, 0x0800, 0x1a04,
+	0x3404, 0x2001, 0x9000, 0x080c, 0x546f, 0x1904, 0x3401, 0x0804,
+	0x33cf, 0xa998, 0x080c, 0xaad5, 0x1118, 0x9182, 0x007f, 0x0280,
+	0x9186, 0x00ff, 0x0168, 0x9182, 0x0800, 0x1250, 0x2001, 0x9000,
+	0x080c, 0x546f, 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, 0x1000, 0x0198, 0x9006, 0xa802,
+	0x7014, 0x9005, 0x1120, 0x2900, 0x7016, 0x701a, 0x0040, 0x7018,
+	0xa802, 0x0086, 0x2040, 0x2900, 0xa006, 0x701a, 0x008e, 0x9085,
+	0x0001, 0x0005, 0x7984, 0x080c, 0x63cd, 0x1130, 0x7e88, 0x9684,
+	0x3fff, 0x9082, 0x4000, 0x0208, 0x905e, 0x8bff, 0x0005, 0xa998,
+	0x080c, 0x63cd, 0x1130, 0xae9c, 0x9684, 0x3fff, 0x9082, 0x4000,
+	0x0208, 0x905e, 0x8bff, 0x0005, 0xae98, 0x0008, 0x7e84, 0x2608,
+	0x080c, 0x63cd, 0x1108, 0x0008, 0x905e, 0x8bff, 0x0005, 0x0016,
+	0x7114, 0x81ff, 0x0128, 0x2148, 0xa904, 0x080c, 0x1032, 0x0cc8,
+	0x7116, 0x711a, 0x001e, 0x0005, 0x2031, 0x0001, 0x0010, 0x2031,
+	0x0000, 0x2061, 0x18b8, 0x2c44, 0xa66a, 0xa17a, 0xa772, 0xa076,
+	0xa28e, 0xa392, 0xa496, 0xa59a, 0x080c, 0x10e0, 0x7007, 0x0002,
+	0x701f, 0x33cf, 0x0005, 0x00f6, 0x0126, 0x2091, 0x8000, 0x2079,
+	0x0000, 0x2001, 0x18b0, 0x2004, 0x9005, 0x1190, 0x0e04, 0x4918,
+	0x7a36, 0x7833, 0x0012, 0x7a82, 0x7b86, 0x7c8a, 0x2091, 0x4080,
+	0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x1192, 0x0804, 0x497e,
+	0x0016, 0x0086, 0x0096, 0x00c6, 0x00e6, 0x2071, 0x189e, 0x7044,
+	0x9005, 0x1540, 0x7148, 0x9182, 0x0010, 0x0288, 0x7038, 0x2060,
+	0x080c, 0x1000, 0x0904, 0x4976, 0xa84b, 0x0000, 0x2900, 0x7046,
+	0x2001, 0x0002, 0x9080, 0x1f4a, 0x2005, 0xa846, 0x0098, 0x7038,
+	0x90e0, 0x0004, 0x2001, 0x18ba, 0x9c82, 0x18fa, 0x0210, 0x2061,
+	0x18ba, 0x2c00, 0x703a, 0x7148, 0x81ff, 0x1108, 0x703e, 0x8108,
+	0x714a, 0x0460, 0x7148, 0x8108, 0x714a, 0x7044, 0x2040, 0xa144,
+	0x2105, 0x0016, 0x908a, 0x0036, 0x1a0c, 0x0dd5, 0x2060, 0x001e,
+	0x8108, 0x2105, 0x9005, 0xa146, 0x1520, 0x080c, 0x1000, 0x1130,
+	0x8109, 0xa946, 0x7148, 0x8109, 0x714a, 0x00d8, 0x9006, 0xa806,
+	0xa84a, 0xa046, 0x2800, 0xa802, 0x2900, 0xa006, 0x7046, 0x2001,
+	0x0002, 0x9080, 0x1f4a, 0x2005, 0xa846, 0x0058, 0x2262, 0x6306,
+	0x640a, 0x00ee, 0x00ce, 0x009e, 0x008e, 0x001e, 0x012e, 0x00fe,
+	0x0005, 0x2c00, 0x9082, 0x001b, 0x0002, 0x49a0, 0x49a0, 0x49a2,
+	0x49a0, 0x49a0, 0x49a0, 0x49a6, 0x49a0, 0x49a0, 0x49a0, 0x49aa,
+	0x49a0, 0x49a0, 0x49a0, 0x49ae, 0x49a0, 0x49a0, 0x49a0, 0x49b2,
+	0x49a0, 0x49a0, 0x49a0, 0x49b6, 0x49a0, 0x49a0, 0x49a0, 0x49bb,
+	0x080c, 0x0dd5, 0xa276, 0xa37a, 0xa47e, 0x0898, 0xa286, 0xa38a,
+	0xa48e, 0x0878, 0xa296, 0xa39a, 0xa49e, 0x0858, 0xa2a6, 0xa3aa,
+	0xa4ae, 0x0838, 0xa2b6, 0xa3ba, 0xa4be, 0x0818, 0xa2c6, 0xa3ca,
+	0xa4ce, 0x0804, 0x4979, 0xa2d6, 0xa3da, 0xa4de, 0x0804, 0x4979,
+	0x00e6, 0x2071, 0x189e, 0x7048, 0x9005, 0x0904, 0x4a52, 0x0126,
+	0x2091, 0x8000, 0x0e04, 0x4a51, 0x00f6, 0x2079, 0x0000, 0x00c6,
+	0x0096, 0x0086, 0x0076, 0x9006, 0x2038, 0x7040, 0x2048, 0x9005,
+	0x0500, 0xa948, 0x2105, 0x0016, 0x908a, 0x0036, 0x1a0c, 0x0dd5,
+	0x2060, 0x001e, 0x8108, 0x2105, 0x9005, 0xa94a, 0x1904, 0x4a54,
+	0xa804, 0x9005, 0x090c, 0x0dd5, 0x7042, 0x2938, 0x2040, 0xa003,
+	0x0000, 0x2001, 0x0002, 0x9080, 0x1f4a, 0x2005, 0xa04a, 0x0804,
+	0x4a54, 0x703c, 0x2060, 0x2c14, 0x6304, 0x6408, 0x650c, 0x2200,
+	0x7836, 0x7833, 0x0012, 0x7882, 0x2300, 0x7886, 0x2400, 0x788a,
+	0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x1192,
+	0x87ff, 0x0118, 0x2748, 0x080c, 0x1032, 0x7048, 0x8001, 0x704a,
+	0x9005, 0x1170, 0x7040, 0x2048, 0x9005, 0x0128, 0x080c, 0x1032,
+	0x9006, 0x7042, 0x7046, 0x703b, 0x18ba, 0x703f, 0x18ba, 0x0420,
+	0x7040, 0x9005, 0x1508, 0x7238, 0x2c00, 0x9206, 0x0148, 0x9c80,
+	0x0004, 0x90fa, 0x18fa, 0x0210, 0x2001, 0x18ba, 0x703e, 0x00a0,
+	0x9006, 0x703e, 0x703a, 0x7044, 0x9005, 0x090c, 0x0dd5, 0x2048,
+	0xa800, 0x9005, 0x1de0, 0x2900, 0x7042, 0x2001, 0x0002, 0x9080,
+	0x1f4a, 0x2005, 0xa84a, 0x0000, 0x007e, 0x008e, 0x009e, 0x00ce,
+	0x00fe, 0x012e, 0x00ee, 0x0005, 0x2c00, 0x9082, 0x001b, 0x0002,
+	0x4a73, 0x4a73, 0x4a75, 0x4a73, 0x4a73, 0x4a73, 0x4a7a, 0x4a73,
+	0x4a73, 0x4a73, 0x4a7f, 0x4a73, 0x4a73, 0x4a73, 0x4a84, 0x4a73,
+	0x4a73, 0x4a73, 0x4a89, 0x4a73, 0x4a73, 0x4a73, 0x4a8e, 0x4a73,
+	0x4a73, 0x4a73, 0x4a93, 0x080c, 0x0dd5, 0xaa74, 0xab78, 0xac7c,
+	0x0804, 0x49ff, 0xaa84, 0xab88, 0xac8c, 0x0804, 0x49ff, 0xaa94,
+	0xab98, 0xac9c, 0x0804, 0x49ff, 0xaaa4, 0xaba8, 0xacac, 0x0804,
+	0x49ff, 0xaab4, 0xabb8, 0xacbc, 0x0804, 0x49ff, 0xaac4, 0xabc8,
+	0xaccc, 0x0804, 0x49ff, 0xaad4, 0xabd8, 0xacdc, 0x0804, 0x49ff,
+	0x0016, 0x0026, 0x0036, 0x00b6, 0x00c6, 0x2009, 0x007e, 0x080c,
+	0x63cd, 0x2019, 0x0001, 0xb85c, 0xd0ac, 0x0110, 0x2019, 0x0000,
+	0x2011, 0x801b, 0x080c, 0x48fb, 0x00ce, 0x00be, 0x003e, 0x002e,
+	0x001e, 0x0005, 0x0026, 0x080c, 0x54b7, 0xd0c4, 0x0120, 0x2011,
+	0x8014, 0x080c, 0x48fb, 0x002e, 0x0005, 0x81ff, 0x1904, 0x3401,
+	0x0126, 0x2091, 0x8000, 0x6030, 0xc08d, 0xc085, 0xc0ac, 0x6032,
+	0x080c, 0x717d, 0x1158, 0x080c, 0x7465, 0x080c, 0x5df8, 0x9085,
+	0x0001, 0x080c, 0x71c4, 0x080c, 0x70af, 0x0010, 0x080c, 0x5cb7,
+	0x012e, 0x0804, 0x33cf, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804,
+	0x3401, 0x080c, 0x54cb, 0x0120, 0x2009, 0x0007, 0x0804, 0x3401,
+	0x080c, 0x672f, 0x0120, 0x2009, 0x0008, 0x0804, 0x3401, 0x080c,
+	0x31bf, 0x0128, 0x7984, 0x080c, 0x636c, 0x1904, 0x3404, 0x080c,
+	0x48ce, 0x0904, 0x3404, 0x2b00, 0x7026, 0x080c, 0x6737, 0x7888,
+	0x1170, 0x9084, 0x0005, 0x1158, 0x900e, 0x080c, 0x65ed, 0x1108,
+	0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d, 0x0804, 0x33cf, 0x080c,
+	0x489b, 0x0904, 0x3401, 0x9006, 0xa866, 0xa832, 0xa868, 0xc0fd,
+	0xa86a, 0x080c, 0xca41, 0x0904, 0x3401, 0x7888, 0xd094, 0x0118,
+	0xb8cc, 0xc08d, 0xb8ce, 0x7007, 0x0003, 0x701f, 0x4b74, 0x0005,
+	0x2061, 0x1800, 0x080c, 0x54cb, 0x2009, 0x0007, 0x1578, 0x080c,
+	0x672f, 0x0118, 0x2009, 0x0008, 0x0448, 0x080c, 0x31bf, 0x0120,
+	0xa998, 0x080c, 0x636c, 0x1530, 0x080c, 0x48cc, 0x0518, 0x080c,
+	0x6737, 0xa89c, 0x1168, 0x9084, 0x0005, 0x1150, 0x900e, 0x080c,
+	0x65ed, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d, 0x00d0,
+	0xa868, 0xc0fc, 0xa86a, 0x080c, 0xca41, 0x11e0, 0xa89c, 0xd094,
+	0x0118, 0xb8cc, 0xc08d, 0xb8ce, 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, 0x5414, 0x900e, 0x080c, 0x65ed, 0x1108,
+	0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d, 0x0804, 0x33cf, 0x080c,
+	0x54cb, 0x0120, 0x2009, 0x0007, 0x0804, 0x3401, 0x7f84, 0x7a8c,
+	0x7b88, 0x7c9c, 0x7d98, 0x080c, 0x489b, 0x1120, 0x2009, 0x0002,
+	0x0804, 0x3401, 0x900e, 0x2130, 0x7126, 0x7132, 0xa860, 0x20e8,
+	0x7036, 0xa85c, 0x9080, 0x0005, 0x702a, 0x20a0, 0x080c, 0x63cd,
+	0x1904, 0x4c16, 0x080c, 0x6737, 0x0138, 0x080c, 0x673f, 0x0120,
+	0x080c, 0x66d7, 0x1904, 0x4c16, 0xd794, 0x1110, 0xd784, 0x01a8,
+	0xb8c4, 0x20e0, 0xb8c8, 0x9080, 0x0006, 0x2098, 0x3400, 0xd794,
+	0x0160, 0x20a9, 0x0008, 0x4003, 0x2098, 0x20a0, 0x3d00, 0x20e0,
+	0x20a9, 0x0002, 0x080c, 0x469d, 0x0048, 0x20a9, 0x0004, 0x4003,
+	0x2098, 0x20a0, 0x3d00, 0x20e0, 0x080c, 0x469d, 0x9186, 0x007e,
+	0x0170, 0x9186, 0x0080, 0x0158, 0x080c, 0x6737, 0x90c2, 0x0006,
+	0x1210, 0xc1fd, 0x0020, 0x080c, 0x65ed, 0x1108, 0xc1fd, 0x4104,
+	0xc1fc, 0xd794, 0x0528, 0xb8c4, 0x20e0, 0xb8c8, 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, 0x4690,
+	0x9c80, 0x0026, 0x2098, 0xb8c4, 0x20e0, 0x20a9, 0x0002, 0x4003,
+	0xd794, 0x0110, 0x96b0, 0x000b, 0x96b0, 0x0005, 0x8108, 0x080c,
+	0xaad5, 0x0118, 0x9186, 0x0800, 0x0040, 0xd78c, 0x0120, 0x9186,
+	0x0800, 0x0170, 0x0018, 0x9186, 0x007e, 0x0150, 0xd794, 0x0118,
+	0x9686, 0x0020, 0x0010, 0x9686, 0x0028, 0x0150, 0x0804, 0x4ba6,
+	0x86ff, 0x1120, 0x7124, 0x810b, 0x0804, 0x33cf, 0x7033, 0x0001,
+	0x7122, 0x7024, 0x9600, 0x7026, 0x772e, 0x2061, 0x18b8, 0x2c44,
+	0xa06b, 0x0000, 0xa67a, 0x7034, 0xa072, 0x7028, 0xa076, 0xa28e,
+	0xa392, 0xa496, 0xa59a, 0x080c, 0x10e0, 0x7007, 0x0002, 0x701f,
+	0x4c52, 0x0005, 0x7030, 0x9005, 0x1180, 0x7120, 0x7028, 0x20a0,
+	0x772c, 0x9036, 0x7034, 0x20e8, 0x2061, 0x18b8, 0x2c44, 0xa28c,
+	0xa390, 0xa494, 0xa598, 0x0804, 0x4ba6, 0x7124, 0x810b, 0x0804,
+	0x33cf, 0x2029, 0x007e, 0x7984, 0x7a88, 0x7b8c, 0x7c98, 0x9184,
+	0xff00, 0x8007, 0x90e2, 0x0020, 0x0a04, 0x3404, 0x9502, 0x0a04,
+	0x3404, 0x9184, 0x00ff, 0x90e2, 0x0020, 0x0a04, 0x3404, 0x9502,
+	0x0a04, 0x3404, 0x9284, 0xff00, 0x8007, 0x90e2, 0x0020, 0x0a04,
+	0x3404, 0x9502, 0x0a04, 0x3404, 0x9284, 0x00ff, 0x90e2, 0x0020,
+	0x0a04, 0x3404, 0x9502, 0x0a04, 0x3404, 0x9384, 0xff00, 0x8007,
+	0x90e2, 0x0020, 0x0a04, 0x3404, 0x9502, 0x0a04, 0x3404, 0x9384,
+	0x00ff, 0x90e2, 0x0020, 0x0a04, 0x3404, 0x9502, 0x0a04, 0x3404,
+	0x9484, 0xff00, 0x8007, 0x90e2, 0x0020, 0x0a04, 0x3404, 0x9502,
+	0x0a04, 0x3404, 0x9484, 0x00ff, 0x90e2, 0x0020, 0x0a04, 0x3404,
+	0x9502, 0x0a04, 0x3404, 0x2061, 0x1987, 0x6102, 0x6206, 0x630a,
+	0x640e, 0x0804, 0x33cf, 0x080c, 0x489b, 0x0904, 0x3401, 0x2009,
+	0x0016, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0xa85c, 0x9080, 0x0019,
+	0xaf60, 0x080c, 0x48e4, 0x701f, 0x4cd6, 0x0005, 0x2001, 0x0138,
+	0x2003, 0x0000, 0x00e6, 0x2071, 0x0300, 0x701c, 0xd0a4, 0x1de8,
+	0x00ee, 0x20a9, 0x0016, 0x896e, 0x8d6e, 0x8d6f, 0x9d84, 0xffc0,
+	0x9080, 0x0019, 0x2098, 0x9d84, 0x003f, 0x20e0, 0x2069, 0x1877,
+	0x20e9, 0x0001, 0x2da0, 0x4003, 0x6800, 0x9005, 0x0904, 0x4d57,
+	0x6804, 0x2008, 0x918c, 0xfff8, 0x1904, 0x4d57, 0x680c, 0x9005,
+	0x0904, 0x4d57, 0x9082, 0xff01, 0x1a04, 0x4d57, 0x6810, 0x9082,
+	0x005c, 0x0a04, 0x4d57, 0x6824, 0x2008, 0x9082, 0x0008, 0x0a04,
+	0x4d57, 0x9182, 0x0400, 0x1a04, 0x4d57, 0x0056, 0x2029, 0x0000,
+	0x080c, 0x888a, 0x005e, 0x6944, 0x6820, 0x9102, 0x06c0, 0x6820,
+	0x9082, 0x0019, 0x16a0, 0x6828, 0x6944, 0x810c, 0x9102, 0x0678,
+	0x6840, 0x9082, 0x000f, 0x1658, 0x080c, 0x1019, 0x2900, 0x0904,
+	0x4d71, 0x684e, 0x00e6, 0x2071, 0x1930, 0x00b6, 0x2059, 0x0000,
+	0x080c, 0x8746, 0x00be, 0x00ee, 0x0558, 0x080c, 0x84a0, 0x080c,
+	0x84e6, 0x11e0, 0x6857, 0x0000, 0x00c6, 0x2061, 0x0100, 0x6104,
+	0x918d, 0x2000, 0x6106, 0x6b10, 0x2061, 0x1a60, 0x630a, 0x00ce,
+	0x080c, 0x2808, 0x2001, 0x0138, 0x2102, 0x0804, 0x33cf, 0x080c,
+	0x2808, 0x2001, 0x0138, 0x2102, 0x0804, 0x3404, 0x00e6, 0x2071,
+	0x1930, 0x080c, 0x891b, 0x080c, 0x892a, 0x080c, 0x8735, 0x00ee,
+	0x2001, 0x188a, 0x204c, 0x080c, 0x1032, 0x2001, 0x188a, 0x2003,
+	0x0000, 0x080c, 0x2808, 0x2001, 0x0138, 0x2102, 0x0804, 0x3401,
+	0x2001, 0x1924, 0x200c, 0x918e, 0x0000, 0x0904, 0x4dd0, 0x080c,
+	0x8730, 0x0904, 0x4dd0, 0x2001, 0x0101, 0x200c, 0x918c, 0xdfff,
+	0x2102, 0x2001, 0x0138, 0x2003, 0x0000, 0x00e6, 0x2071, 0x0300,
+	0x701c, 0xd0a4, 0x1de8, 0x00ee, 0x080c, 0x8735, 0x2001, 0x0035,
+	0x080c, 0x15d1, 0x00c6, 0x2061, 0x193c, 0x6004, 0x6100, 0x9106,
+	0x1de0, 0x00ce, 0x080c, 0x2808, 0x2001, 0x0138, 0x2102, 0x00e6,
+	0x00f6, 0x2071, 0x1923, 0x080c, 0x8671, 0x0120, 0x2f00, 0x080c,
+	0x86fb, 0x0cc8, 0x00fe, 0x00ee, 0x0126, 0x2091, 0x8000, 0x2001,
+	0x188a, 0x200c, 0x81ff, 0x0138, 0x2148, 0x080c, 0x1032, 0x2001,
+	0x188a, 0x2003, 0x0000, 0x2001, 0x183c, 0x2003, 0x0020, 0x00e6,
+	0x2071, 0x1930, 0x080c, 0x891b, 0x080c, 0x892a, 0x00ee, 0x012e,
+	0x0804, 0x33cf, 0x0006, 0x080c, 0x54b7, 0xd0cc, 0x000e, 0x0005,
+	0x0006, 0x080c, 0x54bb, 0xd0bc, 0x000e, 0x0005, 0x6174, 0x7a84,
+	0x6300, 0x82ff, 0x1118, 0x7986, 0x0804, 0x33cf, 0x83ff, 0x1904,
+	0x3404, 0x2001, 0xfff0, 0x9200, 0x1a04, 0x3404, 0x2019, 0xffff,
+	0x6078, 0x9302, 0x9200, 0x0a04, 0x3404, 0x7986, 0x6276, 0x0804,
+	0x33cf, 0x080c, 0x54cb, 0x1904, 0x3401, 0x7c88, 0x7d84, 0x7e98,
+	0x7f8c, 0x080c, 0x489b, 0x0904, 0x3401, 0x900e, 0x901e, 0x7326,
+	0x7332, 0xa860, 0x20e8, 0x7036, 0xa85c, 0x9080, 0x0003, 0x702a,
+	0x20a0, 0x91d8, 0x1000, 0x2b5c, 0x8bff, 0x0178, 0x080c, 0x6737,
+	0x0118, 0x080c, 0x673f, 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, 0x8cf7, 0x2208, 0x0804, 0x33cf,
+	0x7033, 0x0001, 0x7122, 0x7024, 0x9300, 0x7026, 0x2061, 0x18b8,
+	0x2c44, 0xa06b, 0x0000, 0xa37a, 0x7028, 0xa076, 0x7034, 0xa072,
+	0xa48e, 0xa592, 0xa696, 0xa79a, 0x080c, 0x10e0, 0x7007, 0x0002,
+	0x701f, 0x4e53, 0x0005, 0x7030, 0x9005, 0x1178, 0x7120, 0x7028,
+	0x20a0, 0x901e, 0x7034, 0x20e8, 0x2061, 0x18b8, 0x2c44, 0xa48c,
+	0xa590, 0xa694, 0xa798, 0x0804, 0x4e11, 0x7224, 0x900e, 0x2001,
+	0x0003, 0x080c, 0x8cf7, 0x2208, 0x0804, 0x33cf, 0x00f6, 0x00e6,
+	0x080c, 0x54cb, 0x2009, 0x0007, 0x1904, 0x4ee6, 0x2071, 0x189e,
+	0x745c, 0x84ff, 0x2009, 0x000e, 0x1904, 0x4ee6, 0xac9c, 0xad98,
+	0xaea4, 0xafa0, 0x0096, 0x080c, 0x1019, 0x2009, 0x0002, 0x0904,
+	0x4ee6, 0x2900, 0x705e, 0x900e, 0x901e, 0x7356, 0x7362, 0xa860,
+	0x7066, 0xa85c, 0x9080, 0x0003, 0x705a, 0x20a0, 0x91d8, 0x1000,
+	0x2b5c, 0x8bff, 0x0178, 0x080c, 0x6737, 0x0118, 0x080c, 0x673f,
+	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, 0x8cf7, 0x2208, 0x009e, 0xa897, 0x4000, 0xa99a, 0x715c,
+	0x81ff, 0x090c, 0x0dd5, 0x2148, 0x080c, 0x1032, 0x9006, 0x705e,
+	0x918d, 0x0001, 0x2008, 0x0418, 0x7063, 0x0001, 0x7152, 0x7054,
+	0x9300, 0x7056, 0x2061, 0x18b9, 0x2c44, 0xa37a, 0x7058, 0xa076,
+	0x7064, 0xa072, 0xa48e, 0xa592, 0xa696, 0xa79a, 0xa09f, 0x4ef2,
+	0x000e, 0xa0a2, 0x080c, 0x10e0, 0x9006, 0x0048, 0x009e, 0xa897,
+	0x4005, 0xa99a, 0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x00ee,
+	0x00fe, 0x0005, 0x00f6, 0xa0a0, 0x904d, 0x090c, 0x0dd5, 0x00e6,
+	0x2071, 0x189e, 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, 0x8cf7, 0xaa9a,
+	0x715c, 0x81ff, 0x090c, 0x0dd5, 0x2148, 0x080c, 0x1032, 0x705f,
+	0x0000, 0xa0a0, 0x2048, 0x0126, 0x2091, 0x8000, 0x080c, 0x6a46,
+	0x012e, 0xa09f, 0x0000, 0xa0a3, 0x0000, 0x00ee, 0x00fe, 0x0005,
+	0x91d8, 0x1000, 0x2b5c, 0x8bff, 0x0178, 0x080c, 0x6737, 0x0118,
+	0x080c, 0x673f, 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, 0x0dd5, 0x2148,
+	0x080c, 0x1032, 0x9006, 0x705e, 0x918d, 0x0001, 0x2008, 0xa0a0,
+	0x2048, 0x0126, 0x2091, 0x8000, 0x080c, 0x6a46, 0x012e, 0xa09f,
+	0x0000, 0xa0a3, 0x0000, 0x0070, 0x7063, 0x0001, 0x7152, 0x7054,
+	0x9300, 0x7056, 0xa37a, 0xa48e, 0xa592, 0xa696, 0xa79a, 0x080c,
+	0x10e0, 0x9006, 0x00ee, 0x0005, 0x0096, 0xa88c, 0x90be, 0x7000,
+	0x0148, 0x90be, 0x7100, 0x0130, 0x90be, 0x7200, 0x0118, 0x009e,
+	0x0804, 0x3404, 0xa884, 0xa988, 0x080c, 0x26f0, 0x1518, 0x080c,
+	0x636c, 0x1500, 0x7126, 0xbe12, 0xbd16, 0xae7c, 0x080c, 0x489b,
+	0x01c8, 0x080c, 0x489b, 0x01b0, 0x009e, 0xa867, 0x0000, 0xa868,
+	0xc0fd, 0xa86a, 0xa823, 0x0000, 0xa804, 0x2048, 0x080c, 0xc9c8,
+	0x1120, 0x2009, 0x0003, 0x0804, 0x3401, 0x7007, 0x0003, 0x701f,
+	0x4fbf, 0x0005, 0x009e, 0x2009, 0x0002, 0x0804, 0x3401, 0x7124,
+	0x080c, 0x3166, 0xa820, 0x9086, 0x8001, 0x1120, 0x2009, 0x0004,
+	0x0804, 0x3401, 0x2900, 0x7022, 0xa804, 0x0096, 0x2048, 0x8906,
+	0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x009e, 0x9080,
+	0x0002, 0x0076, 0x0006, 0x2098, 0x20a0, 0x27e0, 0x27e8, 0x20a9,
+	0x002a, 0x080c, 0x0f7d, 0xaa6c, 0xab70, 0xac74, 0xad78, 0x2061,
+	0x18b8, 0x2c44, 0xa06b, 0x0000, 0xae64, 0xaf8c, 0x97c6, 0x7000,
+	0x0118, 0x97c6, 0x7100, 0x1148, 0x96c2, 0x0004, 0x0600, 0x2009,
+	0x0004, 0x000e, 0x007e, 0x0804, 0x48e7, 0x97c6, 0x7200, 0x11b8,
+	0x96c2, 0x0054, 0x02a0, 0x000e, 0x007e, 0x2061, 0x18b8, 0x2c44,
+	0xa076, 0xa772, 0xa07b, 0x002a, 0xa28e, 0xa392, 0xa496, 0xa59a,
+	0x080c, 0x10e0, 0x7007, 0x0002, 0x701f, 0x501b, 0x0005, 0x000e,
+	0x007e, 0x0804, 0x3404, 0x7020, 0x2048, 0xa804, 0x2048, 0xa804,
+	0x2048, 0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0,
+	0x9080, 0x0002, 0x2098, 0x20a0, 0x27e0, 0x27e8, 0x20a9, 0x002a,
+	0x080c, 0x0f7d, 0x2100, 0x2238, 0x2061, 0x18b8, 0x2c44, 0xa28c,
+	0xa390, 0xa494, 0xa598, 0x2009, 0x002a, 0x0804, 0x48e7, 0x81ff,
+	0x1904, 0x3401, 0x798c, 0x2001, 0x197e, 0x2102, 0x080c, 0x48b2,
+	0x0904, 0x3404, 0x080c, 0x6737, 0x0120, 0x080c, 0x673f, 0x1904,
+	0x3404, 0x080c, 0x6494, 0x0904, 0x3401, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x655a, 0x012e, 0x0904, 0x3401, 0x0804, 0x43cf, 0xa9a0,
+	0x2001, 0x197e, 0xc18d, 0x2102, 0x080c, 0x48bf, 0x01a0, 0x080c,
+	0x6737, 0x0118, 0x080c, 0x673f, 0x1170, 0x080c, 0x6494, 0x2009,
+	0x0002, 0x0128, 0x080c, 0x655a, 0x1170, 0x2009, 0x0003, 0xa897,
+	0x4005, 0xa99a, 0x0010, 0xa897, 0x4006, 0x900e, 0x9085, 0x0001,
+	0x2001, 0x0030, 0x0005, 0xa897, 0x4000, 0x080c, 0x54bf, 0x0110,
+	0x9006, 0x0018, 0x900e, 0x9085, 0x0001, 0x2001, 0x0000, 0x0005,
+	0x78a8, 0xd08c, 0x1118, 0xd084, 0x0904, 0x4344, 0x080c, 0x48ce,
+	0x0904, 0x3404, 0x080c, 0x489b, 0x1120, 0x2009, 0x0002, 0x0804,
+	0x3401, 0x080c, 0x6737, 0x0130, 0x908e, 0x0004, 0x0118, 0x908e,
+	0x0005, 0x15a0, 0x78a8, 0xd08c, 0x0120, 0xb800, 0xc08c, 0xb802,
+	0x0028, 0x080c, 0x54b7, 0xd0b4, 0x0904, 0x437e, 0x7884, 0x908e,
+	0x007e, 0x0904, 0x437e, 0x908e, 0x007f, 0x0904, 0x437e, 0x908e,
+	0x0080, 0x0904, 0x437e, 0xb800, 0xd08c, 0x1904, 0x437e, 0xa867,
+	0x0000, 0xa868, 0xc0fd, 0xa86a, 0x080c, 0xc9e7, 0x1120, 0x2009,
+	0x0003, 0x0804, 0x3401, 0x7007, 0x0003, 0x701f, 0x50d8, 0x0005,
+	0x080c, 0x48ce, 0x0904, 0x3404, 0x0804, 0x437e, 0x080c, 0x31bf,
+	0x0108, 0x0005, 0x2009, 0x1834, 0x210c, 0x81ff, 0x0120, 0x2009,
+	0x0001, 0x0804, 0x3401, 0x080c, 0x54cb, 0x0120, 0x2009, 0x0007,
+	0x0804, 0x3401, 0x080c, 0x672f, 0x0120, 0x2009, 0x0008, 0x0804,
+	0x3401, 0xb89c, 0xd0a4, 0x1118, 0xd0ac, 0x1904, 0x437e, 0x9006,
+	0xa866, 0xa832, 0xa868, 0xc0fd, 0xa86a, 0x080c, 0xca41, 0x1120,
+	0x2009, 0x0003, 0x0804, 0x3401, 0x7007, 0x0003, 0x701f, 0x5111,
 	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,
+	0x5414, 0x080c, 0x48ce, 0x0904, 0x3404, 0x0804, 0x50aa, 0x81ff,
+	0x2009, 0x0001, 0x1904, 0x3401, 0x080c, 0x54cb, 0x2009, 0x0007,
+	0x1904, 0x3401, 0x080c, 0x672f, 0x0120, 0x2009, 0x0008, 0x0804,
+	0x3401, 0x080c, 0x48ce, 0x0904, 0x3404, 0x080c, 0x6737, 0x2009,
+	0x0009, 0x1904, 0x3401, 0x080c, 0x489b, 0x2009, 0x0002, 0x0904,
+	0x3401, 0x9006, 0xa866, 0xa832, 0xa868, 0xc0fd, 0xa86a, 0x7988,
+	0x9194, 0xff00, 0x918c, 0x00ff, 0x9006, 0x82ff, 0x1128, 0xc0ed,
+	0xa952, 0x798c, 0xa956, 0x0038, 0x928e, 0x0100, 0x1904, 0x3404,
+	0xc0e5, 0xa952, 0xa956, 0xa83e, 0x080c, 0xcc94, 0x2009, 0x0003,
+	0x0904, 0x3401, 0x7007, 0x0003, 0x701f, 0x5167, 0x0005, 0xa830,
+	0x9086, 0x0100, 0x2009, 0x0004, 0x0904, 0x3401, 0x0804, 0x33cf,
+	0x7aa8, 0x9284, 0xc000, 0x0148, 0xd2ec, 0x01a0, 0x080c, 0x54cb,
+	0x1188, 0x2009, 0x0014, 0x0804, 0x3401, 0xd2dc, 0x1568, 0x81ff,
+	0x2009, 0x0001, 0x1904, 0x3401, 0x080c, 0x54cb, 0x2009, 0x0007,
+	0x1904, 0x3401, 0xd2f4, 0x0130, 0x9284, 0x5000, 0x080c, 0x5492,
+	0x0804, 0x33cf, 0xd2fc, 0x0158, 0x080c, 0x48ce, 0x0904, 0x3404,
+	0x7984, 0x9284, 0x9000, 0x080c, 0x546f, 0x0804, 0x33cf, 0x080c,
+	0x48ce, 0x0904, 0x3404, 0xb804, 0x9084, 0x00ff, 0x9086, 0x0006,
+	0x2009, 0x0009, 0x1904, 0x5250, 0x080c, 0x489b, 0x2009, 0x0002,
+	0x0904, 0x5250, 0xa85c, 0x9080, 0x001b, 0xaf60, 0x2009, 0x0008,
+	0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x080c, 0x48e4, 0x701f, 0x51c1,
+	0x0005, 0xa86c, 0x9086, 0x0500, 0x1138, 0xa870, 0x9005, 0x1120,
+	0xa874, 0x9084, 0xff00, 0x0110, 0x1904, 0x3404, 0xa866, 0xa832,
+	0xa868, 0xc0fd, 0xa86a, 0x080c, 0x48ce, 0x1110, 0x0804, 0x3404,
+	0x2009, 0x0043, 0x080c, 0xccfc, 0x2009, 0x0003, 0x0904, 0x5250,
+	0x7007, 0x0003, 0x701f, 0x51e5, 0x0005, 0xa830, 0x9086, 0x0100,
+	0x2009, 0x0004, 0x0904, 0x5250, 0x7984, 0x7aa8, 0x9284, 0x1000,
+	0x080c, 0x546f, 0x0804, 0x33cf, 0x00c6, 0xaab0, 0x9284, 0xc000,
+	0x0140, 0xd2ec, 0x0168, 0x080c, 0x54cb, 0x1150, 0x2009, 0x0014,
+	0x04f0, 0x2061, 0x1800, 0x080c, 0x54cb, 0x2009, 0x0007, 0x15b8,
+	0xd2f4, 0x0128, 0x9284, 0x5000, 0x080c, 0x5492, 0x0050, 0xd2fc,
+	0x0178, 0x080c, 0x48cc, 0x0588, 0xa998, 0x9284, 0x9000, 0x080c,
+	0x546f, 0xa87b, 0x0000, 0xa883, 0x0000, 0xa897, 0x4000, 0x0438,
+	0x080c, 0x48cc, 0x0510, 0x080c, 0x6737, 0x2009, 0x0009, 0x11b8,
+	0xa8c4, 0x9086, 0x0500, 0x11c8, 0xa8c8, 0x9005, 0x11b0, 0xa8cc,
+	0x9084, 0xff00, 0x1190, 0x080c, 0x48cc, 0x1108, 0x0070, 0x2009,
+	0x004b, 0x080c, 0xccfc, 0x2009, 0x0003, 0x0108, 0x0078, 0x0429,
+	0x19c0, 0xa897, 0x4005, 0xa99a, 0x0010, 0xa897, 0x4006, 0x900e,
+	0x9085, 0x0001, 0x2001, 0x0030, 0x00ce, 0x0005, 0x9006, 0x0ce0,
+	0x7aa8, 0xd2dc, 0x0904, 0x3401, 0x0016, 0x7984, 0x9284, 0x1000,
+	0xc0fd, 0x080c, 0x546f, 0x001e, 0x1904, 0x3401, 0x0804, 0x33cf,
+	0x00f6, 0x2d78, 0x0011, 0x00fe, 0x0005, 0xaab0, 0xd2dc, 0x0150,
+	0x0016, 0xa998, 0x9284, 0x1000, 0xc0fd, 0x080c, 0x546f, 0x001e,
+	0x9085, 0x0001, 0x0005, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804,
+	0x3401, 0x080c, 0x54cb, 0x0120, 0x2009, 0x0007, 0x0804, 0x3401,
+	0x7984, 0x7ea8, 0x96b4, 0x00ff, 0x080c, 0x63cd, 0x1904, 0x3404,
+	0x9186, 0x007f, 0x0138, 0x080c, 0x6737, 0x0120, 0x2009, 0x0009,
+	0x0804, 0x3401, 0x080c, 0x489b, 0x1120, 0x2009, 0x0002, 0x0804,
+	0x3401, 0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a, 0x2001, 0x0100,
+	0x8007, 0xa80a, 0x080c, 0xca01, 0x1120, 0x2009, 0x0003, 0x0804,
+	0x3401, 0x7007, 0x0003, 0x701f, 0x52ae, 0x0005, 0xa808, 0x8007,
+	0x9086, 0x0100, 0x1120, 0x2009, 0x0004, 0x0804, 0x3401, 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, 0x48e7, 0x080c, 0x489b, 0x1120,
+	0x2009, 0x0002, 0x0804, 0x3401, 0x7984, 0x9194, 0xff00, 0x918c,
+	0x00ff, 0x8217, 0x82ff, 0x1118, 0x7023, 0x19b1, 0x0040, 0x92c6,
+	0x0001, 0x1118, 0x7023, 0x19cb, 0x0010, 0x0804, 0x3404, 0x2009,
+	0x001a, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0xa85c, 0x9080, 0x0019,
+	0xaf60, 0x080c, 0x48e4, 0x701f, 0x52fe, 0x0005, 0x2001, 0x182e,
+	0x2003, 0x0001, 0xa85c, 0x9080, 0x0019, 0x2098, 0xa860, 0x20e0,
+	0x20a9, 0x001a, 0x7020, 0x20a0, 0x20e9, 0x0001, 0x4003, 0x0804,
+	0x33cf, 0x080c, 0x489b, 0x1120, 0x2009, 0x0002, 0x0804, 0x3401,
+	0x7984, 0x9194, 0xff00, 0x918c, 0x00ff, 0x8217, 0x82ff, 0x1118,
+	0x2099, 0x19b1, 0x0040, 0x92c6, 0x0001, 0x1118, 0x2099, 0x19cb,
+	0x0010, 0x0804, 0x3404, 0xa85c, 0x9080, 0x0019, 0x20a0, 0xa860,
+	0x20e8, 0x20a9, 0x001a, 0x20e1, 0x0001, 0x4003, 0x2009, 0x001a,
+	0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0xa85c, 0x9080, 0x0019, 0xaf60,
+	0x0804, 0x48e7, 0x7884, 0x908a, 0x1000, 0x1a04, 0x3404, 0x0126,
+	0x2091, 0x8000, 0x8003, 0x800b, 0x810b, 0x9108, 0x00c6, 0x2061,
+	0x19f8, 0x6142, 0x00ce, 0x012e, 0x0804, 0x33cf, 0x00c6, 0x080c,
+	0x717d, 0x1160, 0x080c, 0x7465, 0x080c, 0x5df8, 0x9085, 0x0001,
+	0x080c, 0x71c4, 0x080c, 0x70af, 0x080c, 0x0dd5, 0x2061, 0x1800,
+	0x6030, 0xc09d, 0x6032, 0x080c, 0x5cb7, 0x00ce, 0x0005, 0x00c6,
+	0x2001, 0x1800, 0x2004, 0x908e, 0x0000, 0x0904, 0x3401, 0x7884,
+	0x9005, 0x0188, 0x7888, 0x2061, 0x199a, 0x2c0c, 0x2062, 0x080c,
+	0x2ad2, 0x01a0, 0x080c, 0x2ada, 0x0188, 0x080c, 0x2ae2, 0x0170,
+	0x2162, 0x0804, 0x3404, 0x2061, 0x0100, 0x6038, 0x9086, 0x0007,
+	0x1118, 0x2009, 0x0001, 0x0010, 0x2009, 0x0000, 0x7884, 0x9086,
+	0x0002, 0x1548, 0x2061, 0x0100, 0x6028, 0xc09c, 0x602a, 0x0026,
+	0x2011, 0x0003, 0x080c, 0xa349, 0x2011, 0x0002, 0x080c, 0xa353,
+	0x002e, 0x080c, 0xa236, 0x0036, 0x901e, 0x080c, 0xa2ac, 0x003e,
+	0x60e3, 0x0000, 0x080c, 0xe68c, 0x080c, 0xe6a7, 0x9085, 0x0001,
+	0x080c, 0x71c4, 0x9006, 0x080c, 0x2ba1, 0x2001, 0x1800, 0x2003,
+	0x0004, 0x6027, 0x0008, 0x00ce, 0x0804, 0x33cf, 0x81ff, 0x0120,
+	0x2009, 0x0001, 0x0804, 0x3401, 0x080c, 0x54cb, 0x0120, 0x2009,
+	0x0007, 0x0804, 0x3401, 0x7984, 0x7ea8, 0x96b4, 0x00ff, 0x080c,
+	0x63cd, 0x1904, 0x3404, 0x9186, 0x007f, 0x0138, 0x080c, 0x6737,
+	0x0120, 0x2009, 0x0009, 0x0804, 0x3401, 0x080c, 0x489b, 0x1120,
+	0x2009, 0x0002, 0x0804, 0x3401, 0xa867, 0x0000, 0xa868, 0xc0fd,
+	0xa86a, 0x080c, 0xca04, 0x1120, 0x2009, 0x0003, 0x0804, 0x3401,
+	0x7007, 0x0003, 0x701f, 0x53fd, 0x0005, 0xa830, 0x9086, 0x0100,
+	0x1120, 0x2009, 0x0004, 0x0804, 0x3401, 0xa8e0, 0xa866, 0xa834,
+	0x8007, 0x800c, 0xa85c, 0x9080, 0x000c, 0x7a8c, 0x7b88, 0x7c9c,
+	0x7d98, 0xaf60, 0x0804, 0x48e7, 0xa898, 0x9086, 0x000d, 0x1904,
+	0x3401, 0x2021, 0x4005, 0x0126, 0x2091, 0x8000, 0x0e04, 0x5421,
+	0x0010, 0x012e, 0x0cc0, 0x7c36, 0x9486, 0x4000, 0x0118, 0x7833,
+	0x0011, 0x0010, 0x7833, 0x0010, 0x7883, 0x4005, 0xa998, 0x7986,
+	0xa9a4, 0x799a, 0xa9a8, 0x799e, 0x080c, 0x48d7, 0x2091, 0x4080,
+	0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x1192, 0x7007, 0x0001,
+	0x2091, 0x5000, 0x700f, 0x0000, 0x012e, 0x0005, 0x0126, 0x2091,
+	0x8000, 0x00c6, 0x2061, 0x19f8, 0x7984, 0x6152, 0x614e, 0x6057,
+	0x0000, 0x604b, 0x0009, 0x7898, 0x606a, 0x789c, 0x6066, 0x7888,
+	0x6062, 0x788c, 0x605e, 0x2001, 0x1a06, 0x2044, 0x2001, 0x1a0d,
+	0xa076, 0xa060, 0xa072, 0xa07b, 0x0001, 0xa07f, 0x0002, 0xa06b,
+	0x0000, 0xa09f, 0x0000, 0x00ce, 0x012e, 0x0804, 0x33cf, 0x0126,
+	0x2091, 0x8000, 0x00b6, 0x00c6, 0x90e4, 0xc000, 0x0128, 0x0006,
+	0x080c, 0xc872, 0x000e, 0x1198, 0xd0e4, 0x0160, 0x9180, 0x1000,
+	0x2004, 0x905d, 0x0160, 0x080c, 0x5e12, 0x080c, 0xaad5, 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, 0x549a, 0x015e, 0x012e, 0x0005, 0x2001,
+	0x1848, 0x2004, 0x0005, 0x2001, 0x1867, 0x2004, 0x0005, 0x0006,
+	0x2001, 0x1810, 0x2004, 0xd0d4, 0x000e, 0x0005, 0x2001, 0x180e,
+	0x2004, 0xd0b4, 0x0005, 0x2001, 0x1800, 0x2004, 0x9086, 0x0003,
+	0x0005, 0x0016, 0x00e6, 0x2071, 0x189e, 0x7108, 0x910d, 0x710a,
+	0x00ee, 0x001e, 0x0005, 0x080c, 0x489b, 0x080c, 0x0f07, 0x2100,
+	0x2238, 0x7d84, 0x7c88, 0x7b8c, 0x7a90, 0x79a4, 0x9182, 0x0081,
+	0x1a04, 0x3404, 0x810c, 0x080c, 0x48e4, 0x701f, 0x54f0, 0x0005,
+	0x2079, 0x0000, 0x7d94, 0x7c98, 0x7ba8, 0x7aac, 0x79a4, 0x810c,
+	0x2061, 0x18b8, 0x2c44, 0xa770, 0xa074, 0x2071, 0x189e, 0x080c,
+	0x48e7, 0x701f, 0x5504, 0x0005, 0x2061, 0x18b8, 0x2c44, 0xa074,
+	0x2048, 0x9006, 0xa802, 0xa806, 0x0804, 0x33cf, 0x0126, 0x0156,
+	0x0136, 0x0146, 0x01c6, 0x01d6, 0x00c6, 0x00d6, 0x00e6, 0x00f6,
+	0x2061, 0x0100, 0x2069, 0x0200, 0x2071, 0x1800, 0x6044, 0xd0a4,
+	0x11e8, 0xd084, 0x0118, 0x080c, 0x56b7, 0x0068, 0xd08c, 0x0118,
+	0x080c, 0x55c0, 0x0040, 0xd094, 0x0118, 0x080c, 0x5590, 0x0018,
+	0xd09c, 0x0108, 0x0099, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x01de,
+	0x01ce, 0x014e, 0x013e, 0x015e, 0x012e, 0x0005, 0x0016, 0x6128,
+	0xd19c, 0x1110, 0xc19d, 0x612a, 0x001e, 0x0c68, 0x0006, 0x7098,
+	0x9005, 0x000e, 0x0120, 0x709b, 0x0000, 0x7093, 0x0000, 0x624c,
+	0x9286, 0xf0f0, 0x1150, 0x6048, 0x9086, 0xf0f0, 0x0130, 0x624a,
+	0x6043, 0x0090, 0x6043, 0x0010, 0x0490, 0x9294, 0xff00, 0x9296,
+	0xf700, 0x0178, 0x7138, 0xd1a4, 0x1160, 0x6240, 0x9295, 0x0100,
+	0x6242, 0x9294, 0x0010, 0x0128, 0x2009, 0x00f7, 0x080c, 0x5d74,
+	0x00f0, 0x6040, 0x9084, 0x0010, 0x9085, 0x0140, 0x6042, 0x6043,
+	0x0000, 0x7087, 0x0000, 0x70a3, 0x0001, 0x70c7, 0x0000, 0x70df,
+	0x0000, 0x2009, 0x1c80, 0x200b, 0x0000, 0x7097, 0x0000, 0x708b,
+	0x000f, 0x2009, 0x000f, 0x2011, 0x5c5a, 0x080c, 0x831a, 0x0005,
+	0x2001, 0x1869, 0x2004, 0xd08c, 0x0110, 0x705f, 0xffff, 0x7088,
+	0x9005, 0x1528, 0x2011, 0x5c5a, 0x080c, 0x8285, 0x6040, 0x9094,
+	0x0010, 0x9285, 0x0020, 0x6042, 0x20a9, 0x00c8, 0x6044, 0xd08c,
+	0x1168, 0x1f04, 0x55a6, 0x6242, 0x709b, 0x0000, 0x6040, 0x9094,
+	0x0010, 0x9285, 0x0080, 0x6042, 0x6242, 0x0048, 0x6242, 0x709b,
+	0x0000, 0x708f, 0x0000, 0x9006, 0x080c, 0x5dfd, 0x0000, 0x0005,
+	0x708c, 0x908a, 0x0003, 0x1a0c, 0x0dd5, 0x000b, 0x0005, 0x55ca,
+	0x561b, 0x56b6, 0x00f6, 0x0016, 0x6900, 0x918c, 0x0800, 0x708f,
+	0x0001, 0x2001, 0x015d, 0x2003, 0x0000, 0x6803, 0x00fc, 0x20a9,
+	0x0004, 0x6800, 0x9084, 0x00fc, 0x0120, 0x1f04, 0x55d9, 0x080c,
+	0x0dd5, 0x68a0, 0x68a2, 0x689c, 0x689e, 0x6898, 0x689a, 0xa001,
+	0x918d, 0x1600, 0x6902, 0x001e, 0x6837, 0x0020, 0x080c, 0x5dd9,
+	0x2079, 0x1c00, 0x7833, 0x1101, 0x7837, 0x0000, 0x20e1, 0x0001,
+	0x2099, 0x1805, 0x20e9, 0x0001, 0x20a1, 0x1c0e, 0x20a9, 0x0004,
+	0x4003, 0x080c, 0xa82b, 0x20e1, 0x0001, 0x2099, 0x1c00, 0x20e9,
+	0x0000, 0x20a1, 0x0240, 0x20a9, 0x0014, 0x4003, 0x60c3, 0x000c,
+	0x600f, 0x0000, 0x080c, 0x5c8b, 0x00fe, 0x9006, 0x7092, 0x6043,
+	0x0008, 0x6042, 0x0005, 0x00f6, 0x7090, 0x7093, 0x0000, 0x9025,
+	0x0904, 0x5693, 0x6020, 0xd0b4, 0x1904, 0x5691, 0x71a0, 0x81ff,
+	0x0904, 0x567f, 0x9486, 0x000c, 0x1904, 0x568c, 0x9480, 0x0018,
+	0x8004, 0x20a8, 0x080c, 0x5dd2, 0x2011, 0x0260, 0x2019, 0x1c00,
+	0x220c, 0x2304, 0x9106, 0x11e8, 0x8210, 0x8318, 0x1f04, 0x5638,
+	0x6043, 0x0004, 0x2061, 0x0140, 0x605b, 0xbc94, 0x605f, 0xf0f0,
+	0x2061, 0x0100, 0x6043, 0x0006, 0x708f, 0x0002, 0x709b, 0x0002,
+	0x2009, 0x07d0, 0x2011, 0x5c61, 0x080c, 0x831a, 0x080c, 0x5dd9,
+	0x04c0, 0x080c, 0x5dd2, 0x2079, 0x0260, 0x7930, 0x918e, 0x1101,
+	0x1558, 0x7834, 0x9005, 0x1540, 0x7900, 0x918c, 0x00ff, 0x1118,
+	0x7804, 0x9005, 0x0190, 0x080c, 0x5dd2, 0x2011, 0x026e, 0x2019,
+	0x1805, 0x20a9, 0x0004, 0x220c, 0x2304, 0x9102, 0x0230, 0x11a0,
+	0x8210, 0x8318, 0x1f04, 0x5673, 0x0078, 0x70a3, 0x0000, 0x080c,
+	0x5dd2, 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, 0xa82b, 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,
+	0x000c, 0x2011, 0x19ef, 0x2013, 0x0000, 0x7093, 0x0000, 0x60a3,
+	0x0056, 0x60a7, 0x9575, 0x080c, 0x9ff3, 0x08d8, 0x0005, 0x7098,
+	0x908a, 0x001d, 0x1a0c, 0x0dd5, 0x000b, 0x0005, 0x56e8, 0x56fb,
+	0x5724, 0x5744, 0x576a, 0x5799, 0x57bf, 0x57f7, 0x581d, 0x584b,
+	0x5886, 0x58be, 0x58dc, 0x5907, 0x5929, 0x5944, 0x594e, 0x5982,
+	0x59a8, 0x59d7, 0x59fd, 0x5a35, 0x5a79, 0x5ab6, 0x5ad7, 0x5b30,
+	0x5b52, 0x5b80, 0x5b80, 0x00c6, 0x2061, 0x1800, 0x6003, 0x0007,
+	0x2061, 0x0100, 0x6004, 0x9084, 0xfff9, 0x6006, 0x00ce, 0x0005,
+	0x2061, 0x0140, 0x605b, 0xbc94, 0x605f, 0xf0f0, 0x2061, 0x0100,
+	0x6043, 0x0002, 0x709b, 0x0001, 0x2009, 0x07d0, 0x2011, 0x5c61,
+	0x080c, 0x831a, 0x0005, 0x00f6, 0x7090, 0x9086, 0x0014, 0x1510,
+	0x6042, 0x6020, 0xd0b4, 0x11f0, 0x080c, 0x5dd2, 0x2079, 0x0260,
+	0x7a30, 0x9296, 0x1102, 0x11a0, 0x7834, 0x9005, 0x1188, 0x7a38,
+	0xd2fc, 0x0128, 0x70c4, 0x9005, 0x1110, 0x70c7, 0x0001, 0x2011,
+	0x5c61, 0x080c, 0x8285, 0x709b, 0x0010, 0x080c, 0x594e, 0x0010,
+	0x7093, 0x0000, 0x00fe, 0x0005, 0x00f6, 0x709b, 0x0003, 0x6043,
+	0x0004, 0x2011, 0x5c61, 0x080c, 0x8285, 0x080c, 0x5d56, 0x2079,
+	0x0240, 0x7833, 0x1102, 0x7837, 0x0000, 0x20a9, 0x0008, 0x9f88,
+	0x000e, 0x200b, 0x0000, 0x8108, 0x1f04, 0x5739, 0x60c3, 0x0014,
+	0x080c, 0x5c8b, 0x00fe, 0x0005, 0x00f6, 0x7090, 0x9005, 0x0500,
+	0x2011, 0x5c61, 0x080c, 0x8285, 0x9086, 0x0014, 0x11b8, 0x080c,
+	0x5dd2, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1102, 0x1178, 0x7834,
+	0x9005, 0x1160, 0x7a38, 0xd2fc, 0x0128, 0x70c4, 0x9005, 0x1110,
+	0x70c7, 0x0001, 0x709b, 0x0004, 0x0029, 0x0010, 0x080c, 0x5dae,
+	0x00fe, 0x0005, 0x00f6, 0x709b, 0x0005, 0x080c, 0x5d56, 0x2079,
+	0x0240, 0x7833, 0x1103, 0x7837, 0x0000, 0x080c, 0x5dd2, 0x080c,
+	0x5db5, 0x1170, 0x7084, 0x9005, 0x1158, 0x715c, 0x9186, 0xffff,
+	0x0138, 0x2011, 0x0008, 0x080c, 0x5c0e, 0x0168, 0x080c, 0x5d8b,
+	0x20a9, 0x0008, 0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9, 0x0000,
+	0x20a1, 0x024e, 0x4003, 0x60c3, 0x0014, 0x080c, 0x5c8b, 0x00fe,
+	0x0005, 0x00f6, 0x7090, 0x9005, 0x0500, 0x2011, 0x5c61, 0x080c,
+	0x8285, 0x9086, 0x0014, 0x11b8, 0x080c, 0x5dd2, 0x2079, 0x0260,
+	0x7a30, 0x9296, 0x1103, 0x1178, 0x7834, 0x9005, 0x1160, 0x7a38,
+	0xd2fc, 0x0128, 0x70c4, 0x9005, 0x1110, 0x70c7, 0x0001, 0x709b,
+	0x0006, 0x0029, 0x0010, 0x080c, 0x5dae, 0x00fe, 0x0005, 0x00f6,
+	0x709b, 0x0007, 0x080c, 0x5d56, 0x2079, 0x0240, 0x7833, 0x1104,
+	0x7837, 0x0000, 0x080c, 0x5dd2, 0x080c, 0x5db5, 0x11b8, 0x7084,
+	0x9005, 0x11a0, 0x7164, 0x9186, 0xffff, 0x0180, 0x9180, 0x31d0,
+	0x200d, 0x918c, 0xff00, 0x810f, 0x2011, 0x0008, 0x080c, 0x5c0e,
+	0x0180, 0x080c, 0x4dd8, 0x0110, 0x080c, 0x2759, 0x20a9, 0x0008,
+	0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9, 0x0000, 0x20a1, 0x024e,
+	0x4003, 0x60c3, 0x0014, 0x080c, 0x5c8b, 0x00fe, 0x0005, 0x00f6,
+	0x7090, 0x9005, 0x0500, 0x2011, 0x5c61, 0x080c, 0x8285, 0x9086,
+	0x0014, 0x11b8, 0x080c, 0x5dd2, 0x2079, 0x0260, 0x7a30, 0x9296,
+	0x1104, 0x1178, 0x7834, 0x9005, 0x1160, 0x7a38, 0xd2fc, 0x0128,
+	0x70c4, 0x9005, 0x1110, 0x70c7, 0x0001, 0x709b, 0x0008, 0x0029,
+	0x0010, 0x080c, 0x5dae, 0x00fe, 0x0005, 0x00f6, 0x709b, 0x0009,
+	0x080c, 0x5d56, 0x2079, 0x0240, 0x7833, 0x1105, 0x7837, 0x0100,
+	0x080c, 0x5db5, 0x1150, 0x7084, 0x9005, 0x1138, 0x080c, 0x5b81,
+	0x1188, 0x9085, 0x0001, 0x080c, 0x2759, 0x20a9, 0x0008, 0x080c,
+	0x5dd2, 0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9, 0x0000, 0x20a1,
+	0x024e, 0x4003, 0x60c3, 0x0014, 0x080c, 0x5c8b, 0x0010, 0x080c,
+	0x56db, 0x00fe, 0x0005, 0x00f6, 0x7090, 0x9005, 0x05a8, 0x2011,
+	0x5c61, 0x080c, 0x8285, 0x9086, 0x0014, 0x1560, 0x080c, 0x5dd2,
+	0x2079, 0x0260, 0x7a30, 0x9296, 0x1105, 0x1520, 0x7834, 0x9084,
+	0x0100, 0x2011, 0x0100, 0x921e, 0x1160, 0x7a38, 0xd2fc, 0x0128,
+	0x70c4, 0x9005, 0x1110, 0x70c7, 0x0001, 0x709b, 0x000a, 0x00b1,
+	0x0098, 0x9005, 0x1178, 0x7a38, 0xd2fc, 0x0128, 0x70c4, 0x9005,
+	0x1110, 0x70c7, 0x0001, 0x7097, 0x0000, 0x709b, 0x000e, 0x080c,
+	0x5929, 0x0010, 0x080c, 0x5dae, 0x00fe, 0x0005, 0x00f6, 0x709b,
+	0x000b, 0x2011, 0x1c0e, 0x20e9, 0x0001, 0x22a0, 0x20a9, 0x0040,
+	0x2019, 0xffff, 0x4304, 0x080c, 0x5d56, 0x2079, 0x0240, 0x7833,
+	0x1106, 0x7837, 0x0000, 0x080c, 0x5db5, 0x0118, 0x2013, 0x0000,
+	0x0020, 0x7060, 0x9085, 0x0100, 0x2012, 0x20a9, 0x0040, 0x2009,
+	0x024e, 0x2011, 0x1c0e, 0x220e, 0x8210, 0x8108, 0x9186, 0x0260,
+	0x1128, 0x6810, 0x8000, 0x6812, 0x2009, 0x0240, 0x1f04, 0x58ab,
+	0x60c3, 0x0084, 0x080c, 0x5c8b, 0x00fe, 0x0005, 0x00f6, 0x7090,
+	0x9005, 0x01c0, 0x2011, 0x5c61, 0x080c, 0x8285, 0x9086, 0x0084,
+	0x1178, 0x080c, 0x5dd2, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1106,
+	0x1138, 0x7834, 0x9005, 0x1120, 0x709b, 0x000c, 0x0029, 0x0010,
+	0x080c, 0x5dae, 0x00fe, 0x0005, 0x00f6, 0x709b, 0x000d, 0x080c,
+	0x5d56, 0x2079, 0x0240, 0x7833, 0x1107, 0x7837, 0x0000, 0x080c,
+	0x5dd2, 0x20a9, 0x0040, 0x2011, 0x026e, 0x2009, 0x024e, 0x220e,
+	0x8210, 0x8108, 0x9186, 0x0260, 0x1150, 0x6810, 0x8000, 0x6812,
+	0x2009, 0x0240, 0x6814, 0x8000, 0x6816, 0x2011, 0x0260, 0x1f04,
+	0x58ef, 0x60c3, 0x0084, 0x080c, 0x5c8b, 0x00fe, 0x0005, 0x00f6,
+	0x7090, 0x9005, 0x01e0, 0x2011, 0x5c61, 0x080c, 0x8285, 0x9086,
+	0x0084, 0x1198, 0x080c, 0x5dd2, 0x2079, 0x0260, 0x7a30, 0x9296,
+	0x1107, 0x1158, 0x7834, 0x9005, 0x1140, 0x7097, 0x0001, 0x080c,
+	0x5d28, 0x709b, 0x000e, 0x0029, 0x0010, 0x080c, 0x5dae, 0x00fe,
+	0x0005, 0x918d, 0x0001, 0x080c, 0x5dfd, 0x709b, 0x000f, 0x7093,
+	0x0000, 0x2061, 0x0140, 0x605b, 0xbc85, 0x605f, 0xb5b5, 0x2061,
+	0x0100, 0x6043, 0x0005, 0x6043, 0x0004, 0x2009, 0x07d0, 0x2011,
+	0x5c61, 0x080c, 0x8279, 0x0005, 0x7090, 0x9005, 0x0130, 0x2011,
+	0x5c61, 0x080c, 0x8285, 0x709b, 0x0000, 0x0005, 0x709b, 0x0011,
+	0x080c, 0xa82b, 0x080c, 0x5dd2, 0x20e1, 0x0000, 0x2099, 0x0260,
+	0x20e9, 0x0000, 0x20a1, 0x0240, 0x7490, 0x9480, 0x0018, 0x9080,
+	0x0007, 0x9084, 0x03f8, 0x8004, 0x20a8, 0x4003, 0x080c, 0x5db5,
+	0x11a0, 0x717c, 0x81ff, 0x0188, 0x900e, 0x7080, 0x9084, 0x00ff,
+	0x0160, 0x080c, 0x26f0, 0x9186, 0x007e, 0x0138, 0x9186, 0x0080,
+	0x0120, 0x2011, 0x0008, 0x080c, 0x5c0e, 0x60c3, 0x0014, 0x080c,
+	0x5c8b, 0x0005, 0x00f6, 0x7090, 0x9005, 0x0500, 0x2011, 0x5c61,
+	0x080c, 0x8285, 0x9086, 0x0014, 0x11b8, 0x080c, 0x5dd2, 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,
+	0x7a38, 0xd2fc, 0x0128, 0x70c4, 0x9005, 0x1110, 0x70c7, 0x0001,
+	0x709b, 0x0012, 0x0029, 0x0010, 0x7093, 0x0000, 0x00fe, 0x0005,
+	0x00f6, 0x709b, 0x0013, 0x080c, 0x5d64, 0x2079, 0x0240, 0x7833,
+	0x1103, 0x7837, 0x0000, 0x080c, 0x5dd2, 0x080c, 0x5db5, 0x1170,
+	0x7084, 0x9005, 0x1158, 0x715c, 0x9186, 0xffff, 0x0138, 0x2011,
+	0x0008, 0x080c, 0x5c0e, 0x0168, 0x080c, 0x5d8b, 0x20a9, 0x0008,
+	0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9, 0x0000, 0x20a1, 0x024e,
+	0x4003, 0x60c3, 0x0014, 0x080c, 0x5c8b, 0x00fe, 0x0005, 0x00f6,
+	0x7090, 0x9005, 0x0500, 0x2011, 0x5c61, 0x080c, 0x8285, 0x9086,
+	0x0014, 0x11b8, 0x080c, 0x5dd2, 0x2079, 0x0260, 0x7a30, 0x9296,
+	0x1104, 0x1178, 0x7834, 0x9005, 0x1160, 0x7a38, 0xd2fc, 0x0128,
+	0x70c4, 0x9005, 0x1110, 0x70c7, 0x0001, 0x709b, 0x0014, 0x0029,
+	0x0010, 0x7093, 0x0000, 0x00fe, 0x0005, 0x00f6, 0x709b, 0x0015,
+	0x080c, 0x5d64, 0x2079, 0x0240, 0x7833, 0x1104, 0x7837, 0x0000,
+	0x080c, 0x5dd2, 0x080c, 0x5db5, 0x11b8, 0x7084, 0x9005, 0x11a0,
+	0x7164, 0x9186, 0xffff, 0x0180, 0x9180, 0x31d0, 0x200d, 0x918c,
+	0xff00, 0x810f, 0x2011, 0x0008, 0x080c, 0x5c0e, 0x0180, 0x080c,
+	0x4dd8, 0x0110, 0x080c, 0x2759, 0x20a9, 0x0008, 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,
+	0x0014, 0x080c, 0x5c8b, 0x00fe, 0x0005, 0x00f6, 0x7090, 0x9005,
+	0x05f0, 0x2011, 0x5c61, 0x080c, 0x8285, 0x9086, 0x0014, 0x15a8,
+	0x080c, 0x5dd2, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1105, 0x1568,
+	0x7834, 0x9084, 0x0100, 0x2011, 0x0100, 0x921e, 0x1168, 0x9085,
+	0x0001, 0x080c, 0x5dfd, 0x7a38, 0xd2fc, 0x0128, 0x70c4, 0x9005,
+	0x1110, 0x70c7, 0x0001, 0x0080, 0x9005, 0x11b8, 0x7a38, 0xd2fc,
+	0x0128, 0x70c4, 0x9005, 0x1110, 0x70c7, 0x0001, 0x9085, 0x0001,
+	0x080c, 0x5dfd, 0x7097, 0x0000, 0x7a38, 0xd2f4, 0x0110, 0x70df,
+	0x0008, 0x709b, 0x0016, 0x0029, 0x0010, 0x7093, 0x0000, 0x00fe,
+	0x0005, 0x080c, 0xa82b, 0x080c, 0x5dd2, 0x20e1, 0x0000, 0x2099,
+	0x0260, 0x20e9, 0x0000, 0x20a1, 0x0240, 0x20a9, 0x000e, 0x4003,
+	0x2011, 0x026d, 0x2204, 0x9084, 0x0100, 0x2011, 0x024d, 0x2012,
+	0x2011, 0x026e, 0x709b, 0x0017, 0x080c, 0x5db5, 0x1150, 0x7084,
+	0x9005, 0x1138, 0x080c, 0x5b81, 0x1188, 0x9085, 0x0001, 0x080c,
+	0x2759, 0x20a9, 0x0008, 0x080c, 0x5dd2, 0x20e1, 0x0000, 0x2099,
+	0x026e, 0x20e9, 0x0000, 0x20a1, 0x024e, 0x4003, 0x60c3, 0x0014,
+	0x080c, 0x5c8b, 0x0010, 0x080c, 0x56db, 0x0005, 0x00f6, 0x7090,
+	0x9005, 0x01d8, 0x2011, 0x5c61, 0x080c, 0x8285, 0x9086, 0x0084,
+	0x1190, 0x080c, 0x5dd2, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1106,
+	0x1150, 0x7834, 0x9005, 0x1138, 0x9006, 0x080c, 0x5dfd, 0x709b,
+	0x0018, 0x0029, 0x0010, 0x7093, 0x0000, 0x00fe, 0x0005, 0x00f6,
+	0x709b, 0x0019, 0x080c, 0x5d64, 0x2079, 0x0240, 0x7833, 0x1106,
+	0x7837, 0x0000, 0x080c, 0x5dd2, 0x2009, 0x026e, 0x2039, 0x1c0e,
+	0x20a9, 0x0040, 0x213e, 0x8738, 0x8108, 0x9186, 0x0280, 0x1128,
+	0x6814, 0x8000, 0x6816, 0x2009, 0x0260, 0x1f04, 0x5aea, 0x2039,
+	0x1c0e, 0x080c, 0x5db5, 0x11e8, 0x2728, 0x2514, 0x8207, 0x9084,
+	0x00ff, 0x8000, 0x2018, 0x9294, 0x00ff, 0x8007, 0x9205, 0x202a,
+	0x7060, 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, 0x5b1d, 0x60c3, 0x0084, 0x080c, 0x5c8b, 0x00fe, 0x0005,
+	0x00f6, 0x7090, 0x9005, 0x01e0, 0x2011, 0x5c61, 0x080c, 0x8285,
+	0x9086, 0x0084, 0x1198, 0x080c, 0x5dd2, 0x2079, 0x0260, 0x7a30,
+	0x9296, 0x1107, 0x1158, 0x7834, 0x9005, 0x1140, 0x7097, 0x0001,
+	0x080c, 0x5d28, 0x709b, 0x001a, 0x0029, 0x0010, 0x7093, 0x0000,
+	0x00fe, 0x0005, 0x9085, 0x0001, 0x080c, 0x5dfd, 0x709b, 0x001b,
+	0x080c, 0xa82b, 0x080c, 0x5dd2, 0x2011, 0x0260, 0x2009, 0x0240,
+	0x7490, 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, 0x5b69, 0x60c3, 0x0084, 0x080c, 0x5c8b, 0x0005,
+	0x0005, 0x0086, 0x0096, 0x2029, 0x1848, 0x252c, 0x20a9, 0x0008,
+	0x2041, 0x1c0e, 0x20e9, 0x0001, 0x28a0, 0x080c, 0x5dd2, 0x20e1,
+	0x0000, 0x2099, 0x026e, 0x4003, 0x20a9, 0x0008, 0x2011, 0x0007,
+	0xd5d4, 0x0108, 0x9016, 0x2800, 0x9200, 0x200c, 0x91a6, 0xffff,
+	0x1148, 0xd5d4, 0x0110, 0x8210, 0x0008, 0x8211, 0x1f04, 0x5b9b,
+	0x0804, 0x5c0a, 0x82ff, 0x1160, 0xd5d4, 0x0120, 0x91a6, 0x3fff,
+	0x0d90, 0x0020, 0x91a6, 0x3fff, 0x0904, 0x5c0a, 0x918d, 0xc000,
+	0x20a9, 0x0010, 0x2019, 0x0001, 0xd5d4, 0x0110, 0x2019, 0x0010,
+	0x2120, 0xd5d4, 0x0110, 0x8423, 0x0008, 0x8424, 0x1240, 0xd5d4,
+	0x0110, 0x8319, 0x0008, 0x8318, 0x1f04, 0x5bc1, 0x04d8, 0x23a8,
+	0x2021, 0x0001, 0x8426, 0x8425, 0x1f04, 0x5bd3, 0x2328, 0x8529,
+	0x92be, 0x0007, 0x0158, 0x0006, 0x2039, 0x0007, 0x2200, 0x973a,
+	0x000e, 0x27a8, 0x95a8, 0x0010, 0x1f04, 0x5be2, 0x755e, 0x95c8,
+	0x31d0, 0x292d, 0x95ac, 0x00ff, 0x7582, 0x6532, 0x6536, 0x0016,
+	0x2508, 0x080c, 0x2739, 0x001e, 0x60e7, 0x0000, 0x65ea, 0x2018,
+	0x2304, 0x9405, 0x201a, 0x7087, 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, 0x715e, 0x91a0, 0x31d0, 0x242d,
+	0x95ac, 0x00ff, 0x7582, 0x6532, 0x6536, 0x0016, 0x2508, 0x080c,
+	0x2739, 0x001e, 0x60e7, 0x0000, 0x65ea, 0x7087, 0x0001, 0x9084,
+	0x0000, 0x0005, 0x00e6, 0x2071, 0x1800, 0x708b, 0x0000, 0x00ee,
+	0x0005, 0x00e6, 0x00f6, 0x2079, 0x0100, 0x2071, 0x0140, 0x080c,
+	0x5d17, 0x080c, 0x9ffc, 0x7004, 0x9084, 0x4000, 0x0110, 0x080c,
+	0x2bb1, 0x0126, 0x2091, 0x8000, 0x2071, 0x1826, 0x2073, 0x0000,
+	0x7840, 0x0026, 0x0016, 0x2009, 0x00f7, 0x080c, 0x5d74, 0x001e,
+	0x9094, 0x0010, 0x9285, 0x0080, 0x7842, 0x7a42, 0x002e, 0x012e,
+	0x00fe, 0x00ee, 0x0005, 0x0126, 0x2091, 0x8000, 0x080c, 0x2a57,
+	0x0228, 0x2011, 0x0101, 0x2204, 0xc0c5, 0x2012, 0x2011, 0x19ef,
+	0x2013, 0x0000, 0x7093, 0x0000, 0x012e, 0x60a3, 0x0056, 0x60a7,
+	0x9575, 0x080c, 0x9ff3, 0x6144, 0xd184, 0x0120, 0x7198, 0x918d,
+	0x2000, 0x0018, 0x718c, 0x918d, 0x1000, 0x2011, 0x1997, 0x2112,
+	0x2009, 0x07d0, 0x2011, 0x5c61, 0x080c, 0x831a, 0x0005, 0x0016,
+	0x0026, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c, 0xaadc, 0x2009,
+	0x00f7, 0x080c, 0x5d74, 0x2061, 0x19f8, 0x900e, 0x611a, 0x611e,
+	0x6172, 0x6176, 0x2061, 0x1800, 0x6003, 0x0001, 0x2061, 0x0100,
+	0x6043, 0x0090, 0x6043, 0x0010, 0x2009, 0x1997, 0x200b, 0x0000,
+	0x2009, 0x002d, 0x2011, 0x5ce3, 0x080c, 0x8279, 0x012e, 0x00ce,
+	0x002e, 0x001e, 0x0005, 0x00e6, 0x0006, 0x0126, 0x2091, 0x8000,
+	0x0471, 0x2071, 0x0100, 0x080c, 0x9ffc, 0x2071, 0x0140, 0x7004,
+	0x9084, 0x4000, 0x0110, 0x080c, 0x2bb1, 0x080c, 0x7185, 0x0188,
+	0x080c, 0x71a0, 0x1170, 0x080c, 0x746f, 0x0016, 0x080c, 0x2808,
+	0x2001, 0x196d, 0x2102, 0x001e, 0x080c, 0x746a, 0x080c, 0x70af,
+	0x0050, 0x2009, 0x0001, 0x080c, 0x2af0, 0x2001, 0x0001, 0x080c,
+	0x269c, 0x080c, 0x5cb7, 0x012e, 0x000e, 0x00ee, 0x0005, 0x2001,
+	0x180e, 0x2004, 0xd0bc, 0x0158, 0x0026, 0x0036, 0x2011, 0x8017,
+	0x2001, 0x1997, 0x201c, 0x080c, 0x48fb, 0x003e, 0x002e, 0x0005,
+	0x20a9, 0x0012, 0x20e9, 0x0001, 0x20a1, 0x1c80, 0x080c, 0x5dd2,
+	0x20e9, 0x0000, 0x2099, 0x026e, 0x0099, 0x20a9, 0x0020, 0x080c,
+	0x5dcc, 0x2099, 0x0260, 0x20a1, 0x1c92, 0x0051, 0x20a9, 0x000e,
+	0x080c, 0x5dcf, 0x2099, 0x0260, 0x20a1, 0x1cb2, 0x0009, 0x0005,
+	0x0016, 0x0026, 0x3410, 0x3308, 0x2104, 0x8007, 0x2012, 0x8108,
+	0x8210, 0x1f04, 0x5d4c, 0x002e, 0x001e, 0x0005, 0x080c, 0xa82b,
+	0x20e1, 0x0001, 0x2099, 0x1c00, 0x20e9, 0x0000, 0x20a1, 0x0240,
+	0x20a9, 0x000c, 0x4003, 0x0005, 0x080c, 0xa82b, 0x080c, 0x5dd2,
+	0x20e1, 0x0000, 0x2099, 0x0260, 0x20e9, 0x0000, 0x20a1, 0x0240,
+	0x20a9, 0x000c, 0x4003, 0x0005, 0x00c6, 0x0006, 0x2061, 0x0100,
+	0x810f, 0x2001, 0x1834, 0x2004, 0x9005, 0x1138, 0x2001, 0x1818,
+	0x2004, 0x9084, 0x00ff, 0x9105, 0x0010, 0x9185, 0x00f7, 0x604a,
+	0x000e, 0x00ce, 0x0005, 0x0016, 0x0046, 0x080c, 0x6733, 0x0158,
+	0x9006, 0x2020, 0x2009, 0x002a, 0x080c, 0xe280, 0x2001, 0x180c,
+	0x200c, 0xc195, 0x2102, 0x2019, 0x002a, 0x900e, 0x080c, 0x3039,
+	0x080c, 0xcf18, 0x0140, 0x0036, 0x2019, 0xffff, 0x2021, 0x0007,
+	0x080c, 0x4ab2, 0x003e, 0x004e, 0x001e, 0x0005, 0x080c, 0x5cb7,
+	0x709b, 0x0000, 0x7093, 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, 0x19a4, 0x0118,
+	0x2003, 0x0001, 0x0010, 0x2003, 0x0000, 0x0005, 0x0156, 0x20a9,
+	0x0800, 0x2009, 0x1000, 0x9006, 0x200a, 0x8108, 0x1f04, 0x5e0c,
+	0x015e, 0x0005, 0x00d6, 0x0036, 0x0156, 0x0136, 0x0146, 0x2069,
+	0x1847, 0x9006, 0xb802, 0xb8ce, 0xb807, 0x0707, 0xb80a, 0xb80e,
+	0xb812, 0x9198, 0x31d0, 0x231d, 0x939c, 0x00ff, 0xbb16, 0x0016,
+	0x0026, 0xb8c2, 0x080c, 0xaad5, 0x1120, 0x9192, 0x007e, 0x1208,
+	0xbbc2, 0x20a9, 0x0004, 0xb8c4, 0x20e8, 0xb9c8, 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, 0xb8be, 0xb9a2, 0x0096, 0xb8a4, 0x904d, 0x0110, 0x080c,
+	0x1032, 0xb8a7, 0x0000, 0x009e, 0x9006, 0xb84a, 0x6810, 0xb83a,
+	0x680c, 0xb846, 0xb8bb, 0x0520, 0xb8ac, 0x9005, 0x0198, 0x00c6,
+	0x2060, 0x9c82, 0x1cd0, 0x0a0c, 0x0dd5, 0x2001, 0x181a, 0x2004,
+	0x9c02, 0x1a0c, 0x0dd5, 0x080c, 0x8710, 0x00ce, 0x090c, 0x8ab4,
+	0xb8af, 0x0000, 0x6814, 0x9084, 0x00ff, 0xb842, 0x014e, 0x013e,
+	0x015e, 0x003e, 0x00de, 0x0005, 0x0126, 0x2091, 0x8000, 0xa974,
+	0xae78, 0x9684, 0x3fff, 0x9082, 0x4000, 0x1a04, 0x5efa, 0x9182,
+	0x0800, 0x1a04, 0x5efe, 0x2001, 0x180c, 0x2004, 0x9084, 0x0003,
+	0x1904, 0x5f04, 0x9188, 0x1000, 0x2104, 0x905d, 0x0518, 0xb804,
+	0x9084, 0x00ff, 0x908e, 0x0006, 0x1508, 0xb8a4, 0x900d, 0x1904,
+	0x5f16, 0xb850, 0x900d, 0x1148, 0xa802, 0x2900, 0xb852, 0xb84e,
+	0x080c, 0x8e9c, 0x9006, 0x012e, 0x0005, 0x00a6, 0x2150, 0x2900,
+	0xb002, 0xa803, 0x0000, 0x00ae, 0xb852, 0x0c90, 0x2001, 0x0005,
+	0x900e, 0x04b8, 0x2001, 0x0028, 0x900e, 0x0498, 0x9082, 0x0006,
+	0x1290, 0x080c, 0xaad5, 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, 0x6737,
+	0x1990, 0xb800, 0xd0bc, 0x0978, 0x0804, 0x5ead, 0x080c, 0x6569,
+	0x0904, 0x5ec6, 0x0804, 0x5eb1, 0x00b6, 0x00e6, 0x0126, 0x2091,
+	0x8000, 0xa874, 0x908e, 0x00ff, 0x1120, 0x2001, 0x196b, 0x205c,
+	0x0060, 0xa974, 0x9182, 0x0800, 0x1690, 0x9188, 0x1000, 0x2104,
+	0x905d, 0x01d0, 0x080c, 0x66d7, 0x11d0, 0x080c, 0xab15, 0x0570,
+	0x2b00, 0x6012, 0x2900, 0x6016, 0x6023, 0x0009, 0x600b, 0x0000,
+	0xa874, 0x908e, 0x00ff, 0x1110, 0x600b, 0x8000, 0x2009, 0x0043,
+	0x080c, 0xabe6, 0x9006, 0x00b0, 0x2001, 0x0028, 0x0090, 0x2009,
+	0x180c, 0x210c, 0xd18c, 0x0118, 0x2001, 0x0004, 0x0038, 0xd184,
+	0x0118, 0x2001, 0x0004, 0x0010, 0x2001, 0x0029, 0x0010, 0x2001,
+	0x0029, 0x9005, 0x012e, 0x00ee, 0x00be, 0x0005, 0x2001, 0x002c,
+	0x0cc0, 0x00b6, 0x00e6, 0x0126, 0x2091, 0x8000, 0xa974, 0x9182,
+	0x0800, 0x1a04, 0x5fe4, 0x9188, 0x1000, 0x2104, 0x905d, 0x0904,
+	0x5fbc, 0xb8a0, 0x9086, 0x007f, 0x0178, 0x080c, 0x673f, 0x0160,
+	0xa994, 0x81ff, 0x0130, 0x908e, 0x0004, 0x0130, 0x908e, 0x0005,
+	0x0118, 0x080c, 0x6737, 0x1598, 0xa87c, 0xd0fc, 0x01e0, 0xa894,
+	0x9005, 0x01c8, 0x2060, 0x0026, 0x2010, 0x080c, 0xc813, 0x002e,
+	0x1120, 0x2001, 0x0008, 0x0804, 0x5fe6, 0x6020, 0x9086, 0x000a,
+	0x0120, 0x2001, 0x0008, 0x0804, 0x5fe6, 0x601a, 0x6003, 0x0008,
+	0x2900, 0x6016, 0x0058, 0x080c, 0xab15, 0x05e8, 0x2b00, 0x6012,
+	0x2900, 0x6016, 0x600b, 0xffff, 0x6023, 0x000a, 0x2009, 0x0003,
+	0x080c, 0xabe6, 0x9006, 0x0458, 0x2001, 0x0028, 0x0438, 0x9082,
+	0x0006, 0x1290, 0x080c, 0xaad5, 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, 0x607b, 0x6036,
+	0x604d, 0x607b, 0x607b, 0x607b, 0x607b, 0x607b, 0x2100, 0x9082,
+	0x007e, 0x1278, 0x080c, 0x636c, 0x0148, 0x9046, 0xb810, 0x9306,
+	0x1904, 0x6083, 0xb814, 0x9206, 0x15f0, 0x0028, 0xbb12, 0xba16,
+	0x0010, 0x080c, 0x47ae, 0x0150, 0x04b0, 0x080c, 0x63cd, 0x1598,
+	0xb810, 0x9306, 0x1580, 0xb814, 0x9206, 0x1568, 0x080c, 0xab15,
+	0x0530, 0x2b00, 0x6012, 0x080c, 0xcc93, 0x2900, 0x6016, 0x600b,
+	0xffff, 0x6023, 0x000a, 0xa878, 0x9086, 0x0001, 0x1170, 0x080c,
+	0x306e, 0x9006, 0x080c, 0x6309, 0x2001, 0x0002, 0x080c, 0x631d,
+	0x2001, 0x0200, 0xb86e, 0xb893, 0x0002, 0x2009, 0x0003, 0x080c,
+	0xabe6, 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, 0x6262, 0x90c6,
+	0x0056, 0x0904, 0x6266, 0x90c6, 0x0066, 0x0904, 0x626a, 0x90c6,
+	0x0071, 0x0904, 0x626e, 0x90c6, 0x0074, 0x0904, 0x6272, 0x90c6,
+	0x007c, 0x0904, 0x6276, 0x90c6, 0x007e, 0x0904, 0x627a, 0x90c6,
+	0x0037, 0x0904, 0x627e, 0x9016, 0x2079, 0x1800, 0xa974, 0x9186,
+	0x00ff, 0x0904, 0x625d, 0x9182, 0x0800, 0x1a04, 0x625d, 0x080c,
+	0x63cd, 0x1198, 0xb804, 0x9084, 0x00ff, 0x9082, 0x0006, 0x1268,
+	0xa894, 0x90c6, 0x006f, 0x0148, 0x080c, 0xaad5, 0x1904, 0x6246,
+	0xb8a0, 0x9084, 0xff80, 0x1904, 0x6246, 0xa894, 0x90c6, 0x006f,
+	0x0158, 0x90c6, 0x005e, 0x0904, 0x61a6, 0x90c6, 0x0064, 0x0904,
+	0x61cf, 0x2008, 0x0804, 0x6168, 0xa998, 0xa8b0, 0x2040, 0x080c,
+	0xaad5, 0x1120, 0x9182, 0x007f, 0x0a04, 0x6168, 0x9186, 0x00ff,
+	0x0904, 0x6168, 0x9182, 0x0800, 0x1a04, 0x6168, 0xaaa0, 0xab9c,
+	0x787c, 0x9306, 0x1188, 0x7880, 0x0096, 0x924e, 0x1128, 0x2208,
+	0x2310, 0x009e, 0x0804, 0x6168, 0x99cc, 0xff00, 0x009e, 0x1120,
+	0x2208, 0x2310, 0x0804, 0x6168, 0x080c, 0x47ae, 0x0904, 0x6172,
+	0x900e, 0x9016, 0x90c6, 0x4000, 0x15e0, 0x0006, 0x080c, 0x65ed,
+	0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d, 0x20a9, 0x0004,
+	0xa860, 0x20e8, 0xa85c, 0x9080, 0x0031, 0x20a0, 0xb8c4, 0x20e0,
+	0xb8c8, 0x9080, 0x0006, 0x2098, 0x080c, 0x0f7d, 0x20a9, 0x0004,
+	0xa860, 0x20e8, 0xa85c, 0x9080, 0x0035, 0x20a0, 0xb8c4, 0x20e0,
+	0xb8c8, 0x9080, 0x000a, 0x2098, 0x080c, 0x0f7d, 0xa8c4, 0xabc8,
+	0x9305, 0xabcc, 0x9305, 0xabd0, 0x9305, 0xabd4, 0x9305, 0xabd8,
+	0x9305, 0xabdc, 0x9305, 0xabe0, 0x9305, 0x9005, 0x0510, 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,
+	0x0478, 0x000e, 0x080c, 0xab15, 0x1130, 0x2001, 0x4005, 0x2009,
+	0x0003, 0x9016, 0x0c78, 0x2b00, 0x6012, 0x080c, 0xcc93, 0x2900,
+	0x6016, 0x6023, 0x0001, 0xa868, 0xd88c, 0x0108, 0xc0f5, 0xa86a,
+	0x0126, 0x2091, 0x8000, 0x080c, 0x306e, 0x012e, 0x9006, 0x080c,
+	0x6309, 0x2001, 0x0002, 0x080c, 0x631d, 0x2009, 0x0002, 0x080c,
+	0xabe6, 0xa8b0, 0xd094, 0x0118, 0xb8cc, 0xc08d, 0xb8ce, 0x9006,
+	0x9005, 0x012e, 0x00ee, 0x00fe, 0x00be, 0x0005, 0x080c, 0x54cb,
+	0x0118, 0x2009, 0x0007, 0x00f8, 0xa998, 0xaeb0, 0x080c, 0x63cd,
+	0x1904, 0x6163, 0x9186, 0x007f, 0x0130, 0x080c, 0x6737, 0x0118,
+	0x2009, 0x0009, 0x0080, 0x0096, 0x080c, 0x1000, 0x1120, 0x009e,
+	0x2009, 0x0002, 0x0040, 0x2900, 0x009e, 0xa806, 0x080c, 0xca04,
+	0x19b0, 0x2009, 0x0003, 0x2001, 0x4005, 0x0804, 0x616a, 0xa998,
+	0xaeb0, 0x080c, 0x63cd, 0x1904, 0x6163, 0x0096, 0x080c, 0x1000,
+	0x1128, 0x009e, 0x2009, 0x0002, 0x0804, 0x6223, 0x2900, 0x009e,
+	0xa806, 0x0096, 0x2048, 0x20a9, 0x002b, 0xb8c4, 0x20e0, 0xb8c8,
+	0x2098, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0002, 0x20a0, 0x4003,
+	0x20a9, 0x0008, 0x9080, 0x0006, 0x20a0, 0xbbc8, 0x9398, 0x0006,
+	0x2398, 0x080c, 0x0f7d, 0x009e, 0xa87b, 0x0000, 0xa883, 0x0000,
+	0xa897, 0x4000, 0xd684, 0x1168, 0x080c, 0x54b7, 0xd0b4, 0x1118,
+	0xa89b, 0x000b, 0x00e0, 0xb800, 0xd08c, 0x0118, 0xa89b, 0x000c,
+	0x00b0, 0x080c, 0x6737, 0x0118, 0xa89b, 0x0009, 0x0080, 0x080c,
+	0x54cb, 0x0118, 0xa89b, 0x0007, 0x0050, 0x080c, 0xc9e7, 0x1904,
+	0x619f, 0x2009, 0x0003, 0x2001, 0x4005, 0x0804, 0x616a, 0xa87b,
+	0x0030, 0xa897, 0x4005, 0xa804, 0x8006, 0x8006, 0x8007, 0x90bc,
+	0x003f, 0x9084, 0xffc0, 0x9080, 0x0002, 0x2009, 0x002b, 0xaaa0,
+	0xab9c, 0xaca8, 0xada4, 0x2031, 0x0000, 0x2041, 0x123a, 0x080c,
+	0xb084, 0x1904, 0x619f, 0x2009, 0x0002, 0x08e8, 0x2001, 0x0028,
+	0x900e, 0x0804, 0x61a0, 0x2009, 0x180c, 0x210c, 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,
+	0x2001, 0x0029, 0x900e, 0x0804, 0x61a0, 0x2001, 0x0029, 0x900e,
+	0x0804, 0x61a0, 0x080c, 0x35f4, 0x0804, 0x61a1, 0x080c, 0x51f4,
+	0x0804, 0x61a1, 0x080c, 0x43fa, 0x0804, 0x61a1, 0x080c, 0x4871,
+	0x0804, 0x61a1, 0x080c, 0x4b28, 0x0804, 0x61a1, 0x080c, 0x4e6e,
+	0x0804, 0x61a1, 0x080c, 0x505f, 0x0804, 0x61a1, 0x080c, 0x380a,
+	0x0804, 0x61a1, 0x00b6, 0xa974, 0xae78, 0x9684, 0x3fff, 0x9082,
+	0x4000, 0x1618, 0x9182, 0x0800, 0x1268, 0x9188, 0x1000, 0x2104,
+	0x905d, 0x0140, 0x080c, 0x6737, 0x1148, 0x00e9, 0x080c, 0x64f8,
+	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, 0x19e5, 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, 0x6733, 0x0140, 0x9284,
+	0xff00, 0x8007, 0x9086, 0x0007, 0x1110, 0x2011, 0x0600, 0x000e,
+	0x9294, 0xff00, 0x9215, 0xba06, 0x0006, 0x9086, 0x0006, 0x1120,
+	0xba90, 0x82ff, 0x090c, 0x0dd5, 0x000e, 0x00ce, 0x012e, 0x00be,
+	0x0005, 0x00b6, 0x0126, 0x00c6, 0x2091, 0x8000, 0x6210, 0x2258,
+	0xba04, 0x0006, 0x9086, 0x0006, 0x1168, 0xb89c, 0xd0a4, 0x0150,
+	0x080c, 0x672f, 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,
+	0x1188, 0x0096, 0x080c, 0x1000, 0x2958, 0x009e, 0x0168, 0x2b00,
+	0x2012, 0xb85c, 0xb8ca, 0xb860, 0xb8c6, 0x9006, 0xb8a6, 0xb8ae,
+	0x080c, 0x5e12, 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, 0x1032, 0x00d6, 0x00c6, 0xb8bc, 0x2060, 0x8cff, 0x0168,
+	0x600c, 0x0006, 0x6014, 0x2048, 0x080c, 0xc825, 0x0110, 0x080c,
+	0x0fb2, 0x080c, 0xab6b, 0x00ce, 0x0c88, 0x00ce, 0x00de, 0x2b48,
+	0xb8c8, 0xb85e, 0xb8c4, 0xb862, 0x080c, 0x1042, 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, 0x717d,
+	0x1510, 0xb8a0, 0x9086, 0x007e, 0x0120, 0x080c, 0xaad5, 0x11d8,
+	0x0078, 0x7040, 0xd0e4, 0x01b8, 0x00c6, 0x2061, 0x1980, 0x7048,
+	0x2062, 0x704c, 0x6006, 0x7050, 0x600a, 0x7054, 0x600e, 0x00ce,
+	0x703c, 0x2069, 0x0140, 0x9005, 0x1110, 0x2001, 0x0001, 0x6886,
+	0x2069, 0x1800, 0x68b6, 0x7040, 0xb85e, 0x7048, 0xb862, 0x704c,
+	0xb866, 0x20e1, 0x0000, 0x2099, 0x0276, 0xb8c4, 0x20e8, 0xb8c8,
+	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, 0xbbcc, 0xc384, 0xba00, 0x2009,
+	0x1867, 0x210c, 0xd0bc, 0x0120, 0xd1ec, 0x0110, 0xc2ad, 0x0008,
+	0xc2ac, 0xd0c4, 0x0148, 0xd1e4, 0x0138, 0xc2bd, 0xd0cc, 0x0128,
+	0xd38c, 0x1108, 0xc385, 0x0008, 0xc2bc, 0xba02, 0xbbce, 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, 0x0dd5, 0x3c00, 0x20e8, 0x3300,
+	0x8001, 0x20a0, 0x4604, 0x8210, 0xaa06, 0x01de, 0x01ce, 0x014e,
+	0x013e, 0x0060, 0x080c, 0x1000, 0x0170, 0x2900, 0xb8a6, 0xa803,
+	0x0000, 0x080c, 0x6589, 0xa807, 0x0001, 0xae12, 0x9085, 0x0001,
+	0x012e, 0x009e, 0x0005, 0x9006, 0x0cd8, 0x0126, 0x2091, 0x8000,
+	0x0096, 0xb8a4, 0x904d, 0x0188, 0xa800, 0x9005, 0x1150, 0x080c,
+	0x6598, 0x1158, 0xa804, 0x908a, 0x0002, 0x0218, 0x8001, 0xa806,
+	0x0020, 0x080c, 0x1032, 0xb8a7, 0x0000, 0x009e, 0x012e, 0x0005,
+	0x0126, 0x2091, 0x8000, 0x080c, 0x8e9c, 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, 0xa39c,
+	0xaa00, 0xb84c, 0x9906, 0x1110, 0xba4e, 0x0020, 0x00a6, 0x2150,
+	0xb202, 0x00ae, 0x82ff, 0x1110, 0xb952, 0x89ff, 0x012e, 0x0005,
+	0x9016, 0x0489, 0x1110, 0x2011, 0x0001, 0x0005, 0x080c, 0x65ed,
+	0x0128, 0x080c, 0xc8ed, 0x0010, 0x9085, 0x0001, 0x0005, 0x080c,
+	0x65ed, 0x0128, 0x080c, 0xc887, 0x0010, 0x9085, 0x0001, 0x0005,
+	0x080c, 0x65ed, 0x0128, 0x080c, 0xc8ea, 0x0010, 0x9085, 0x0001,
+	0x0005, 0x080c, 0x65ed, 0x0128, 0x080c, 0xc8ab, 0x0010, 0x9085,
+	0x0001, 0x0005, 0x080c, 0x65ed, 0x0128, 0x080c, 0xc917, 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, 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,
+	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, 0x1000, 0x0168, 0x2900, 0xb8a6,
+	0x080c, 0x6589, 0xa803, 0x0001, 0xa807, 0x0000, 0x9085, 0x0001,
+	0x012e, 0x009e, 0x0005, 0x9006, 0x0cd8, 0x0096, 0x0126, 0x2091,
+	0x8000, 0xb8a4, 0x904d, 0x0130, 0xb8a7, 0x0000, 0x080c, 0x1032,
+	0x9085, 0x0001, 0x012e, 0x009e, 0x0005, 0xb89c, 0xd0a4, 0x0005,
+	0x00b6, 0x00f6, 0x080c, 0x717d, 0x01b0, 0x71c4, 0x81ff, 0x1198,
+	0x71dc, 0xd19c, 0x0180, 0x2001, 0x007e, 0x9080, 0x1000, 0x2004,
+	0x905d, 0x0148, 0xb804, 0x9084, 0x00ff, 0x9086, 0x0006, 0x1118,
+	0xb800, 0xc0ed, 0xb802, 0x2079, 0x1847, 0x7804, 0xd0a4, 0x01d0,
+	0x0156, 0x20a9, 0x007f, 0x900e, 0x0016, 0x080c, 0x63cd, 0x1168,
+	0xb804, 0x9084, 0xff00, 0x8007, 0x9096, 0x0004, 0x0118, 0x9086,
+	0x0006, 0x1118, 0xb800, 0xc0ed, 0xb802, 0x001e, 0x8108, 0x1f04,
+	0x6614, 0x015e, 0x080c, 0x66f5, 0x0120, 0x2001, 0x1983, 0x200c,
+	0x0038, 0x2079, 0x1847, 0x7804, 0xd0a4, 0x0130, 0x2009, 0x07d0,
+	0x2011, 0x663f, 0x080c, 0x831a, 0x00fe, 0x00be, 0x0005, 0x00b6,
+	0x2011, 0x663f, 0x080c, 0x8285, 0x080c, 0x66f5, 0x01d8, 0x2001,
+	0x107e, 0x2004, 0x2058, 0xb900, 0xc1ec, 0xb902, 0x080c, 0x6733,
+	0x0130, 0x2009, 0x07d0, 0x2011, 0x663f, 0x080c, 0x831a, 0x00e6,
+	0x2071, 0x1800, 0x9006, 0x707e, 0x7060, 0x7082, 0x080c, 0x2e48,
+	0x00ee, 0x04b0, 0x0156, 0x00c6, 0x20a9, 0x007f, 0x900e, 0x0016,
+	0x080c, 0x63cd, 0x1538, 0xb800, 0xd0ec, 0x0520, 0x0046, 0xbaa0,
+	0x2220, 0x9006, 0x2009, 0x0029, 0x080c, 0xe280, 0xb800, 0xc0e5,
+	0xc0ec, 0xb802, 0x080c, 0x672f, 0x2001, 0x0707, 0x1128, 0xb804,
+	0x9084, 0x00ff, 0x9085, 0x0700, 0xb806, 0x2019, 0x0029, 0x080c,
+	0x901a, 0x0076, 0x903e, 0x080c, 0x8ef7, 0x900e, 0x080c, 0xdfbd,
+	0x007e, 0x004e, 0x001e, 0x8108, 0x1f04, 0x6667, 0x00ce, 0x015e,
+	0x00be, 0x0005, 0x00b6, 0x6010, 0x2058, 0xb800, 0xc0ec, 0xb802,
+	0x00be, 0x0005, 0x00b6, 0x00c6, 0x0096, 0x080c, 0x1019, 0x090c,
+	0x0dd5, 0x2958, 0x009e, 0x2001, 0x196b, 0x2b02, 0xb8af, 0x0000,
+	0x2009, 0x00ff, 0x080c, 0x5e12, 0xb807, 0x0006, 0xb813, 0x00ff,
+	0xb817, 0xffff, 0xb86f, 0x0200, 0xb86c, 0xb893, 0x0002, 0xb8bb,
+	0x0520, 0xb8a3, 0x00ff, 0xb8af, 0x0000, 0x00ce, 0x00be, 0x0005,
+	0x7810, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0ac, 0x0005, 0x6010,
+	0x00b6, 0x905d, 0x0108, 0xb800, 0x00be, 0xd0bc, 0x0005, 0x0006,
+	0x0016, 0x0026, 0xb804, 0x908c, 0x00ff, 0x9196, 0x0006, 0x0188,
+	0x9196, 0x0004, 0x0170, 0x9196, 0x0005, 0x0158, 0x908c, 0xff00,
+	0x810f, 0x9196, 0x0006, 0x0128, 0x9196, 0x0004, 0x0110, 0x9196,
+	0x0005, 0x002e, 0x001e, 0x000e, 0x0005, 0x00b6, 0x00f6, 0x2001,
+	0x107e, 0x2004, 0x905d, 0x0110, 0xb800, 0xd0ec, 0x00fe, 0x00be,
+	0x0005, 0x0126, 0x0026, 0x2091, 0x8000, 0x0006, 0xbaa0, 0x9290,
+	0x1000, 0x2204, 0x9b06, 0x190c, 0x0dd5, 0x000e, 0xba00, 0x9005,
+	0x0110, 0xc2fd, 0x0008, 0xc2fc, 0xba02, 0x002e, 0x012e, 0x0005,
+	0x2011, 0x1837, 0x2204, 0xd0cc, 0x0138, 0x2001, 0x1981, 0x200c,
+	0x2011, 0x6725, 0x080c, 0x831a, 0x0005, 0x2011, 0x6725, 0x080c,
+	0x8285, 0x2011, 0x1837, 0x2204, 0xc0cc, 0x2012, 0x0005, 0x080c,
+	0x54b7, 0xd0ac, 0x0005, 0x080c, 0x54b7, 0xd0a4, 0x0005, 0x0016,
+	0xb904, 0x9184, 0x00ff, 0x908e, 0x0006, 0x001e, 0x0005, 0x0016,
+	0xb904, 0x9184, 0xff00, 0x8007, 0x908e, 0x0006, 0x001e, 0x0005,
+	0x00b6, 0x00f6, 0x080c, 0xcf18, 0x0158, 0x70dc, 0x9084, 0x0028,
+	0x0138, 0x2001, 0x107f, 0x2004, 0x905d, 0x0110, 0xb8cc, 0xd094,
+	0x00fe, 0x00be, 0x0005, 0x2071, 0x1910, 0x7003, 0x0001, 0x7007,
+	0x0000, 0x9006, 0x7012, 0x7016, 0x701a, 0x701e, 0x700a, 0x7046,
+	0x2001, 0x1947, 0x2003, 0x0000, 0x0005, 0x0016, 0x00e6, 0x2071,
+	0x1948, 0x900e, 0x710a, 0x080c, 0x54b7, 0xd0fc, 0x1140, 0x080c,
+	0x54b7, 0x900e, 0xd09c, 0x0108, 0x8108, 0x7102, 0x00f8, 0x2001,
+	0x1867, 0x200c, 0x9184, 0x0007, 0x0002, 0x6777, 0x6777, 0x6777,
+	0x6777, 0x6777, 0x678d, 0x679b, 0x6777, 0x7003, 0x0003, 0x2009,
+	0x1868, 0x210c, 0x9184, 0xff00, 0x8007, 0x9005, 0x1110, 0x2001,
+	0x0002, 0x7006, 0x0018, 0x7003, 0x0005, 0x0c88, 0x00ee, 0x001e,
+	0x0005, 0x00e6, 0x2071, 0x0050, 0x684c, 0x9005, 0x1150, 0x00e6,
+	0x2071, 0x1910, 0x7028, 0xc085, 0x702a, 0x00ee, 0x9085, 0x0001,
+	0x0488, 0x6844, 0x9005, 0x0158, 0x080c, 0x74d7, 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,
+	0x1910, 0x7028, 0xc084, 0x702a, 0x7007, 0x0001, 0x700b, 0x0000,
+	0x00ee, 0x9006, 0x00ee, 0x0005, 0x00e6, 0x0026, 0x2071, 0x1948,
+	0x7000, 0x9015, 0x0904, 0x6a4b, 0x9286, 0x0003, 0x0904, 0x68e1,
+	0x9286, 0x0005, 0x0904, 0x68e1, 0x2071, 0x1877, 0xa87c, 0x9005,
+	0x0904, 0x6842, 0x7140, 0xa868, 0x9102, 0x0a04, 0x6a4b, 0xa878,
+	0xd084, 0x15d8, 0xa853, 0x0019, 0x2001, 0x8023, 0xa84e, 0x2071,
+	0x1910, 0x701c, 0x9005, 0x1904, 0x6bed, 0x0e04, 0x6c5b, 0x2071,
+	0x0000, 0xa850, 0x7032, 0xa84c, 0x7082, 0xa870, 0x7086, 0xa86c,
+	0x708a, 0xa880, 0x708e, 0x7036, 0x0146, 0x01d6, 0x0136, 0x01c6,
+	0x0156, 0x20e9, 0x0000, 0x20a1, 0x002a, 0xa868, 0x20a8, 0xa860,
+	0x20e0, 0xa85c, 0x9080, 0x0021, 0x2098, 0x4003, 0x015e, 0x01ce,
+	0x013e, 0x01de, 0x014e, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004,
+	0xd084, 0x190c, 0x1192, 0x0804, 0x68c4, 0xa853, 0x001b, 0x2001,
+	0x8027, 0x0820, 0x7004, 0xd08c, 0x1904, 0x6a4b, 0xa853, 0x001a,
+	0x2001, 0x8024, 0x0804, 0x6806, 0x00e6, 0x0026, 0x2071, 0x1948,
+	0x7000, 0x9015, 0x0904, 0x6a4b, 0x9286, 0x0003, 0x0904, 0x68e1,
+	0x9286, 0x0005, 0x0904, 0x68e1, 0xa84f, 0x8022, 0xa853, 0x0018,
+	0x0804, 0x68a9, 0xa868, 0xd0fc, 0x11d8, 0x00e6, 0x0026, 0x2001,
+	0x1948, 0x2004, 0x9005, 0x0904, 0x6a4b, 0xa87c, 0xd0bc, 0x1904,
+	0x6a4b, 0xa978, 0xa874, 0x9105, 0x1904, 0x6a4b, 0x2001, 0x1948,
+	0x2004, 0x0002, 0x6a4b, 0x68a5, 0x68e1, 0x68e1, 0x6a4b, 0x68e1,
+	0x0005, 0xa868, 0xd0fc, 0x1500, 0x00e6, 0x0026, 0x2009, 0x1948,
+	0x210c, 0x81ff, 0x0904, 0x6a4b, 0xa87c, 0xd0cc, 0x0904, 0x6a4b,
+	0xa880, 0x9084, 0x00ff, 0x9086, 0x0001, 0x1904, 0x6a4b, 0x9186,
+	0x0003, 0x0904, 0x68e1, 0x9186, 0x0005, 0x0904, 0x68e1, 0xa84f,
+	0x8021, 0xa853, 0x0017, 0x0028, 0x0005, 0xa84f, 0x8020, 0xa853,
+	0x0016, 0x2071, 0x1910, 0x701c, 0x9005, 0x1904, 0x6bed, 0x0e04,
+	0x6c5b, 0x2071, 0x0000, 0xa84c, 0x7082, 0xa850, 0x7032, 0xa86c,
+	0x7086, 0x7036, 0xa870, 0x708a, 0x2091, 0x4080, 0x2001, 0x0089,
+	0x2004, 0xd084, 0x190c, 0x1192, 0x2071, 0x1800, 0x2011, 0x0001,
+	0xa804, 0x900d, 0x702c, 0x1158, 0xa802, 0x2900, 0x702e, 0x70c0,
+	0x9200, 0x70c2, 0x080c, 0x81a6, 0x002e, 0x00ee, 0x0005, 0x0096,
+	0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8, 0x009e,
+	0x0c58, 0xa84f, 0x0000, 0x00f6, 0x2079, 0x0050, 0x2071, 0x1910,
+	0xa803, 0x0000, 0x7010, 0x9005, 0x1904, 0x69d0, 0x782c, 0x908c,
+	0x0780, 0x190c, 0x6da7, 0x8004, 0x8004, 0x8004, 0x9084, 0x0003,
+	0x0002, 0x68ff, 0x69d0, 0x6924, 0x696b, 0x080c, 0x0dd5, 0x2071,
+	0x1800, 0x2900, 0x7822, 0xa804, 0x900d, 0x1170, 0x2071, 0x19f8,
+	0x703c, 0x9005, 0x1328, 0x2001, 0x1949, 0x2004, 0x8005, 0x703e,
+	0x00fe, 0x002e, 0x00ee, 0x0005, 0x9016, 0x702c, 0x2148, 0xa904,
+	0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e, 0x70c0, 0x9200,
+	0x70c2, 0x080c, 0x81a6, 0x0c10, 0x2071, 0x1800, 0x2900, 0x7822,
+	0xa804, 0x900d, 0x1580, 0x7824, 0x00e6, 0x2071, 0x0040, 0x712c,
+	0xd19c, 0x1148, 0x2009, 0x1830, 0x210c, 0x918a, 0x0020, 0x0218,
+	0x7022, 0x00ee, 0x0058, 0x00ee, 0x2048, 0x702c, 0xa802, 0x2900,
+	0x702e, 0x70c0, 0x8000, 0x70c2, 0x080c, 0x81a6, 0x782c, 0x9094,
+	0x0780, 0x190c, 0x6da7, 0xd0a4, 0x19f0, 0x2071, 0x19f8, 0x703c,
+	0x9005, 0x1328, 0x2001, 0x1949, 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,
+	0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e, 0x70c0, 0x9200, 0x70c2,
+	0x080c, 0x81a6, 0x0800, 0x0096, 0x00e6, 0x7824, 0x2048, 0x2071,
+	0x1800, 0x702c, 0xa802, 0x2900, 0x702e, 0x70c0, 0x8000, 0x70c2,
+	0x080c, 0x81a6, 0x782c, 0x9094, 0x0780, 0x190c, 0x6da7, 0xd0a4,
+	0x1d60, 0x00ee, 0x782c, 0x9094, 0x0780, 0x190c, 0x6da7, 0xd09c,
+	0x11a0, 0x009e, 0x2900, 0x7822, 0xa804, 0x900d, 0x1560, 0x2071,
+	0x19f8, 0x703c, 0x9005, 0x1328, 0x2001, 0x1949, 0x2004, 0x8005,
+	0x703e, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x009e, 0x2908, 0x7010,
+	0x8000, 0x7012, 0x7018, 0x904d, 0x711a, 0x0110, 0xa902, 0x0008,
+	0x711e, 0x2148, 0xa804, 0x900d, 0x1170, 0x2071, 0x19f8, 0x703c,
+	0x9005, 0x1328, 0x2001, 0x1949, 0x2004, 0x8005, 0x703e, 0x00fe,
+	0x002e, 0x00ee, 0x0005, 0x2071, 0x1800, 0x9016, 0x702c, 0x2148,
+	0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e, 0x70c0,
+	0x9200, 0x70c2, 0x080c, 0x81a6, 0x00fe, 0x002e, 0x00ee, 0x0005,
+	0x2908, 0x7010, 0x8000, 0x7012, 0x7018, 0x904d, 0x711a, 0x0110,
+	0xa902, 0x0008, 0x711e, 0x2148, 0xa804, 0x900d, 0x1904, 0x6a25,
+	0x782c, 0x9094, 0x0780, 0x190c, 0x6da7, 0xd09c, 0x1198, 0x701c,
+	0x904d, 0x0180, 0x7010, 0x8001, 0x7012, 0x1108, 0x701a, 0xa800,
+	0x701e, 0x2900, 0x7822, 0x782c, 0x9094, 0x0780, 0x190c, 0x6da7,
+	0xd09c, 0x0d68, 0x782c, 0x9094, 0x0780, 0x190c, 0x6da7, 0xd0a4,
+	0x01b0, 0x00e6, 0x7824, 0x2048, 0x2071, 0x1800, 0x702c, 0xa802,
+	0x2900, 0x702e, 0x70c0, 0x8000, 0x70c2, 0x080c, 0x81a6, 0x782c,
+	0x9094, 0x0780, 0x190c, 0x6da7, 0xd0a4, 0x1d60, 0x00ee, 0x2071,
+	0x19f8, 0x703c, 0x9005, 0x1328, 0x2001, 0x1949, 0x2004, 0x8005,
+	0x703e, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x00e6, 0x2071, 0x1800,
+	0x9016, 0x702c, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff,
+	0x1dc8, 0x702e, 0x70c0, 0x9200, 0x70c2, 0x080c, 0x81a6, 0x00ee,
+	0x0804, 0x69e0, 0xa868, 0xd0fc, 0x1560, 0x0096, 0xa804, 0xa807,
+	0x0000, 0x904d, 0x190c, 0x0fb2, 0x009e, 0x0018, 0xa868, 0xd0fc,
+	0x1500, 0x00e6, 0x0026, 0xa84f, 0x0000, 0x00f6, 0x2079, 0x0050,
+	0x2071, 0x1910, 0xa803, 0x0000, 0x7010, 0x9005, 0x1904, 0x6b67,
+	0x782c, 0x908c, 0x0780, 0x190c, 0x6da7, 0x8004, 0x8004, 0x8004,
+	0x9084, 0x0003, 0x0002, 0x6a6a, 0x6b67, 0x6a85, 0x6af6, 0x080c,
+	0x0dd5, 0x0005, 0x2071, 0x1800, 0x2900, 0x7822, 0xa804, 0x900d,
+	0x1120, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x9016, 0x702c, 0x2148,
+	0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e, 0x70c0,
+	0x9200, 0x70c2, 0x080c, 0x81a6, 0x0c60, 0x2071, 0x1800, 0x2900,
+	0x7822, 0xa804, 0x900d, 0x1904, 0x6ae5, 0x7830, 0x8007, 0x9084,
+	0x001f, 0x9082, 0x0005, 0x1220, 0x00fe, 0x002e, 0x00ee, 0x0005,
+	0x7824, 0x00e6, 0x2071, 0x0040, 0x712c, 0xd19c, 0x1148, 0x2009,
+	0x1830, 0x210c, 0x918a, 0x0020, 0x0218, 0x7022, 0x00ee, 0x0058,
+	0x00ee, 0x2048, 0x702c, 0xa802, 0x2900, 0x702e, 0x70c0, 0x8000,
+	0x70c2, 0x080c, 0x81a6, 0x782c, 0x9094, 0x0780, 0x190c, 0x6da7,
+	0xd0a4, 0x19f0, 0x0e04, 0x6adc, 0x7838, 0x7938, 0x910e, 0x1de0,
+	0x00d6, 0x2069, 0x0000, 0x6836, 0x6833, 0x0013, 0x00de, 0x2001,
+	0x1921, 0x200c, 0xc184, 0x2102, 0x2091, 0x4080, 0x2001, 0x0089,
+	0x2004, 0xd084, 0x190c, 0x1192, 0x2009, 0x1947, 0x200b, 0x0000,
+	0x00fe, 0x002e, 0x00ee, 0x0005, 0x2001, 0x1921, 0x200c, 0xc185,
+	0x2102, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x9016, 0x702c, 0x2148,
+	0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e, 0x70c0,
+	0x9200, 0x70c2, 0x080c, 0x81a6, 0x0804, 0x6a98, 0x0096, 0x00e6,
+	0x7824, 0x2048, 0x2071, 0x1800, 0x702c, 0xa802, 0x2900, 0x702e,
+	0x70c0, 0x8000, 0x70c2, 0x080c, 0x81a6, 0x782c, 0x9094, 0x0780,
+	0x190c, 0x6da7, 0xd0a4, 0x1d60, 0x00ee, 0x0e04, 0x6b3a, 0x7838,
+	0x7938, 0x910e, 0x1de0, 0x00d6, 0x2069, 0x0000, 0x6836, 0x6833,
+	0x0013, 0x00de, 0x7044, 0xc084, 0x7046, 0x2091, 0x4080, 0x2001,
+	0x0089, 0x2004, 0xd084, 0x190c, 0x1192, 0x2009, 0x1947, 0x200b,
+	0x0000, 0x782c, 0x9094, 0x0780, 0x190c, 0x6da7, 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,
+	0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e, 0x70c0, 0x9200,
+	0x70c2, 0x080c, 0x81a6, 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,
+	0x0008, 0x711e, 0x2148, 0xa804, 0x900d, 0x1904, 0x6bd8, 0x782c,
+	0x9094, 0x0780, 0x190c, 0x6da7, 0xd09c, 0x11b0, 0x701c, 0x904d,
+	0x0198, 0xa84c, 0x9005, 0x1180, 0x7010, 0x8001, 0x7012, 0x1108,
+	0x701a, 0xa800, 0x701e, 0x2900, 0x7822, 0x782c, 0x9094, 0x0780,
+	0x190c, 0x6da7, 0xd09c, 0x0d50, 0x782c, 0x9094, 0x0780, 0x190c,
+	0x6da7, 0xd0a4, 0x05c8, 0x00e6, 0x7824, 0x2048, 0x2071, 0x1800,
+	0x702c, 0xa802, 0x2900, 0x702e, 0x70c0, 0x8000, 0x70c2, 0x080c,
+	0x81a6, 0x782c, 0x9094, 0x0780, 0x190c, 0x6da7, 0xd0a4, 0x1d60,
+	0x00ee, 0x0e04, 0x6bd1, 0x7838, 0x7938, 0x910e, 0x1de0, 0x00d6,
+	0x2069, 0x0000, 0x6836, 0x6833, 0x0013, 0x00de, 0x7044, 0xc084,
+	0x7046, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c,
+	0x1192, 0x2009, 0x1947, 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, 0x70c0, 0x9200, 0x70c2,
+	0x080c, 0x81a6, 0x00ee, 0x0804, 0x6b77, 0x2071, 0x1910, 0xa803,
+	0x0000, 0x2908, 0x7010, 0x8000, 0x7012, 0x7018, 0x904d, 0x711a,
+	0x0110, 0xa902, 0x0008, 0x711e, 0x2148, 0xa804, 0x900d, 0x1128,
+	0x1e04, 0x6c18, 0x002e, 0x00ee, 0x0005, 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,
+	0x702e, 0x70c0, 0x9200, 0x70c2, 0x080c, 0x81a6, 0x0e04, 0x6c02,
+	0x2071, 0x1910, 0x701c, 0x2048, 0xa84c, 0x900d, 0x0d18, 0x2071,
+	0x0000, 0x7182, 0xa850, 0x7032, 0xa86c, 0x7086, 0x7036, 0xa870,
+	0x708a, 0xa850, 0x9082, 0x0019, 0x1278, 0x2091, 0x4080, 0x2001,
+	0x0089, 0x2004, 0xd084, 0x190c, 0x1192, 0x2071, 0x1910, 0x080c,
+	0x6d93, 0x002e, 0x00ee, 0x0005, 0xa850, 0x9082, 0x001c, 0x1e68,
+	0xa880, 0x708e, 0x7036, 0x0146, 0x01d6, 0x0136, 0x01c6, 0x0156,
+	0x20e9, 0x0000, 0x20a1, 0x002a, 0xa868, 0x20a8, 0xa860, 0x20e0,
+	0xa85c, 0x9080, 0x0021, 0x2098, 0x4003, 0x015e, 0x01ce, 0x013e,
+	0x01de, 0x014e, 0x0890, 0x2071, 0x1910, 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,
+	0x0008, 0x711e, 0x2148, 0xa804, 0x900d, 0x1118, 0x002e, 0x00ee,
+	0x0005, 0x2071, 0x1800, 0x9016, 0x702c, 0x2148, 0xa904, 0xa802,
+	0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e, 0x70c0, 0x9200, 0x70c2,
+	0x080c, 0x81a6, 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, 0x1910, 0x7004, 0x0002,
+	0x6ca6, 0x6ca7, 0x6d92, 0x6ca7, 0x0dd5, 0x6d92, 0x0005, 0x2001,
+	0x1948, 0x2004, 0x0002, 0x6cb1, 0x6cb1, 0x6d2b, 0x6d2c, 0x6cb1,
+	0x6d2c, 0x0126, 0x2091, 0x8000, 0x1e0c, 0x6db2, 0x701c, 0x904d,
+	0x0508, 0xa84c, 0x9005, 0x0904, 0x6cfc, 0x0e04, 0x6cda, 0xa94c,
+	0x2071, 0x0000, 0x7182, 0xa850, 0x7032, 0xa86c, 0x7086, 0x7036,
+	0xa870, 0x708a, 0xa850, 0x9082, 0x0019, 0x1278, 0x2091, 0x4080,
+	0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x1192, 0x2071, 0x1910,
+	0x080c, 0x6d93, 0x012e, 0x0804, 0x6d2a, 0xa850, 0x9082, 0x001c,
+	0x1e68, 0xa880, 0x708e, 0x7036, 0x0146, 0x01d6, 0x0136, 0x01c6,
+	0x0156, 0x20e9, 0x0000, 0x20a1, 0x002a, 0xa868, 0x20a8, 0xa860,
+	0x20e0, 0xa85c, 0x9080, 0x0021, 0x2098, 0x4003, 0x015e, 0x01ce,
+	0x013e, 0x01de, 0x014e, 0x0890, 0x2001, 0x005b, 0x2004, 0x9094,
+	0x0780, 0x190c, 0x6da7, 0xd09c, 0x2071, 0x1910, 0x1510, 0x2071,
+	0x1910, 0x700f, 0x0001, 0xa964, 0x9184, 0x00ff, 0x9086, 0x0003,
+	0x1130, 0x810f, 0x918c, 0x00ff, 0x8101, 0x0108, 0x710e, 0x2900,
+	0x00d6, 0x2069, 0x0050, 0x6822, 0x00de, 0x2071, 0x1910, 0x701c,
+	0x2048, 0x7010, 0x8001, 0x7012, 0xa800, 0x701e, 0x9005, 0x1108,
+	0x701a, 0x012e, 0x0005, 0x0005, 0x00d6, 0x2008, 0x2069, 0x19f8,
+	0x683c, 0x9005, 0x0760, 0x0158, 0x9186, 0x0003, 0x0540, 0x2001,
+	0x1815, 0x2004, 0x2009, 0x1abf, 0x210c, 0x9102, 0x1500, 0x0126,
+	0x2091, 0x8000, 0x2069, 0x0050, 0x693c, 0x6838, 0x9106, 0x0190,
+	0x0e04, 0x6d5e, 0x2069, 0x0000, 0x6837, 0x8040, 0x6833, 0x0012,
+	0x6883, 0x8040, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084,
+	0x190c, 0x1192, 0x2069, 0x19f8, 0x683f, 0xffff, 0x012e, 0x00de,
+	0x0126, 0x2091, 0x8000, 0x1e0c, 0x6e23, 0x701c, 0x904d, 0x0540,
+	0x2001, 0x005b, 0x2004, 0x9094, 0x0780, 0x15c9, 0xd09c, 0x1500,
+	0x2071, 0x1910, 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, 0x1032, 0x0005, 0x012e, 0x0005, 0x2091,
+	0x8000, 0x0e04, 0x6da9, 0x0006, 0x0016, 0x2001, 0x8004, 0x0006,
+	0x0804, 0x0dde, 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, 0x1192, 0x2009, 0x1947,
+	0x200b, 0x0000, 0x00fe, 0x009e, 0x0005, 0x782c, 0x9094, 0x0780,
+	0x1971, 0xd0a4, 0x0db8, 0x2009, 0x1947, 0x2104, 0x8000, 0x200a,
+	0x9082, 0x000f, 0x0e78, 0x00e6, 0x2071, 0x1800, 0x7824, 0x00e6,
+	0x2071, 0x0040, 0x712c, 0xd19c, 0x1148, 0x2009, 0x1830, 0x210c,
+	0x918a, 0x0020, 0x0218, 0x7022, 0x00ee, 0x0058, 0x00ee, 0x2048,
+	0x702c, 0xa802, 0x2900, 0x702e, 0x70c0, 0x8000, 0x70c2, 0x080c,
+	0x81a6, 0x782c, 0x9094, 0x0780, 0x190c, 0x6da7, 0xd0a4, 0x19f0,
+	0x7838, 0x7938, 0x910e, 0x1de0, 0x00d6, 0x2069, 0x0000, 0x6836,
+	0x6833, 0x0013, 0x00de, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004,
+	0xd084, 0x190c, 0x1192, 0x2009, 0x1947, 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, 0x1192, 0x00fe, 0x0005,
+	0x782c, 0x9094, 0x0780, 0x190c, 0x6da7, 0xd0a4, 0x0db8, 0x00e6,
+	0x2071, 0x1800, 0x7824, 0x2048, 0x702c, 0xa802, 0x2900, 0x702e,
+	0x70c0, 0x8000, 0x70c2, 0x080c, 0x81a6, 0x782c, 0x9094, 0x0780,
+	0x190c, 0x6da7, 0xd0a4, 0x1d70, 0x00d6, 0x2069, 0x0050, 0x693c,
+	0x2069, 0x1948, 0x6808, 0x690a, 0x2069, 0x19f8, 0x9102, 0x1118,
+	0x683c, 0x9005, 0x1328, 0x2001, 0x1949, 0x200c, 0x810d, 0x693e,
+	0x00de, 0x00ee, 0x00fe, 0x0005, 0x7098, 0x908a, 0x0029, 0x1a0c,
+	0x0dd5, 0x9082, 0x001d, 0x001b, 0x6027, 0x1e00, 0x0005, 0x6f47,
+	0x6ed1, 0x6eed, 0x6f15, 0x6f36, 0x6f76, 0x6f88, 0x6eed, 0x6f5e,
+	0x6e8c, 0x6eba, 0x6e8b, 0x0005, 0x00d6, 0x2069, 0x0200, 0x6804,
+	0x9005, 0x1180, 0x6808, 0x9005, 0x1518, 0x709b, 0x0028, 0x2069,
+	0x198d, 0x2d04, 0x7002, 0x080c, 0x72b7, 0x6028, 0x9085, 0x0600,
+	0x602a, 0x00b0, 0x709b, 0x0028, 0x2069, 0x198d, 0x2d04, 0x7002,
+	0x6028, 0x9085, 0x0600, 0x602a, 0x00e6, 0x0036, 0x0046, 0x0056,
+	0x2071, 0x1a60, 0x080c, 0x19ff, 0x005e, 0x004e, 0x003e, 0x00ee,
+	0x00de, 0x0005, 0x00d6, 0x2069, 0x0200, 0x6804, 0x9005, 0x1178,
+	0x6808, 0x9005, 0x1160, 0x709b, 0x0028, 0x2069, 0x198d, 0x2d04,
+	0x7002, 0x080c, 0x7352, 0x6028, 0x9085, 0x0600, 0x602a, 0x00de,
+	0x0005, 0x0006, 0x2001, 0x0090, 0x080c, 0x2ba1, 0x000e, 0x6124,
+	0xd1e4, 0x1190, 0x080c, 0x6ff5, 0xd1d4, 0x1160, 0xd1dc, 0x1138,
+	0xd1cc, 0x0150, 0x709b, 0x0020, 0x080c, 0x6ff5, 0x0028, 0x709b,
+	0x001d, 0x0010, 0x709b, 0x001f, 0x0005, 0x2001, 0x0088, 0x080c,
+	0x2ba1, 0x6124, 0xd1cc, 0x11d8, 0xd1dc, 0x11b0, 0xd1e4, 0x1188,
+	0x9184, 0x1e00, 0x11c8, 0x60e3, 0x0001, 0x600c, 0xc0b4, 0x600e,
+	0x080c, 0x71a9, 0x2001, 0x0080, 0x080c, 0x2ba1, 0x709b, 0x0028,
+	0x0058, 0x709b, 0x001e, 0x0040, 0x709b, 0x001d, 0x0028, 0x709b,
+	0x0020, 0x0010, 0x709b, 0x001f, 0x0005, 0x60e3, 0x0001, 0x600c,
+	0xc0b4, 0x600e, 0x080c, 0x71a9, 0x2001, 0x0080, 0x080c, 0x2ba1,
+	0x6124, 0xd1d4, 0x1180, 0xd1dc, 0x1158, 0xd1e4, 0x1130, 0x9184,
+	0x1e00, 0x1158, 0x709b, 0x0028, 0x0040, 0x709b, 0x001e, 0x0028,
+	0x709b, 0x001d, 0x0010, 0x709b, 0x001f, 0x0005, 0x2001, 0x00a0,
+	0x080c, 0x2ba1, 0x6124, 0xd1dc, 0x1138, 0xd1e4, 0x0138, 0x080c,
+	0x1a29, 0x709b, 0x001e, 0x0010, 0x709b, 0x001d, 0x0005, 0x080c,
+	0x7078, 0x6124, 0xd1dc, 0x1188, 0x080c, 0x6ff5, 0x0016, 0x080c,
+	0x1a29, 0x001e, 0xd1d4, 0x1128, 0xd1e4, 0x0138, 0x709b, 0x001e,
+	0x0020, 0x709b, 0x001f, 0x080c, 0x6ff5, 0x0005, 0x0006, 0x2001,
+	0x00a0, 0x080c, 0x2ba1, 0x000e, 0x6124, 0xd1d4, 0x1160, 0xd1cc,
+	0x1150, 0xd1dc, 0x1128, 0xd1e4, 0x0140, 0x709b, 0x001e, 0x0028,
+	0x709b, 0x001d, 0x0010, 0x709b, 0x0021, 0x0005, 0x080c, 0x7078,
+	0x6124, 0xd1d4, 0x1150, 0xd1dc, 0x1128, 0xd1e4, 0x0140, 0x709b,
+	0x001e, 0x0028, 0x709b, 0x001d, 0x0010, 0x709b, 0x001f, 0x0005,
+	0x0006, 0x2001, 0x0090, 0x080c, 0x2ba1, 0x000e, 0x6124, 0xd1d4,
+	0x1178, 0xd1cc, 0x1150, 0xd1dc, 0x1128, 0xd1e4, 0x0158, 0x709b,
+	0x001e, 0x0040, 0x709b, 0x001d, 0x0028, 0x709b, 0x0020, 0x0010,
+	0x709b, 0x001f, 0x0005, 0x0016, 0x00c6, 0x00d6, 0x00e6, 0x0126,
+	0x2061, 0x0100, 0x2069, 0x0140, 0x2071, 0x1800, 0x2091, 0x8000,
+	0x080c, 0x717d, 0x11d8, 0x2001, 0x180c, 0x200c, 0xd1b4, 0x01b0,
+	0xc1b4, 0x2102, 0x6027, 0x0200, 0x080c, 0x2aea, 0x6024, 0xd0cc,
+	0x0148, 0x2001, 0x00a0, 0x080c, 0x2ba1, 0x080c, 0x7465, 0x080c,
+	0x5df8, 0x0428, 0x6028, 0xc0cd, 0x602a, 0x0408, 0x080c, 0x7197,
+	0x0150, 0x080c, 0x718e, 0x1138, 0x2001, 0x0001, 0x080c, 0x269c,
+	0x080c, 0x7155, 0x00a0, 0x080c, 0x7075, 0x0178, 0x2001, 0x0001,
+	0x080c, 0x269c, 0x7098, 0x9086, 0x001e, 0x0120, 0x7098, 0x9086,
+	0x0022, 0x1118, 0x709b, 0x0025, 0x0010, 0x709b, 0x0021, 0x012e,
+	0x00ee, 0x00de, 0x00ce, 0x001e, 0x0005, 0x0026, 0x2011, 0x7006,
+	0x080c, 0x835c, 0x002e, 0x0016, 0x0026, 0x2009, 0x0064, 0x2011,
+	0x7006, 0x080c, 0x8353, 0x002e, 0x001e, 0x0005, 0x00e6, 0x00f6,
+	0x0016, 0x080c, 0x9ffc, 0x2071, 0x1800, 0x080c, 0x6fa3, 0x001e,
+	0x00fe, 0x00ee, 0x0005, 0x0016, 0x0026, 0x0036, 0x00c6, 0x00d6,
+	0x00e6, 0x00f6, 0x0126, 0x080c, 0x9ffc, 0x2061, 0x0100, 0x2069,
+	0x0140, 0x2071, 0x1800, 0x2091, 0x8000, 0x6028, 0xc09c, 0x602a,
+	0x2011, 0x0003, 0x080c, 0xa349, 0x2011, 0x0002, 0x080c, 0xa353,
+	0x080c, 0xa236, 0x080c, 0x8308, 0x0036, 0x901e, 0x080c, 0xa2ac,
+	0x003e, 0x60e3, 0x0000, 0x080c, 0xe68c, 0x080c, 0xe6a7, 0x2009,
+	0x0004, 0x080c, 0x2af0, 0x080c, 0x2a0b, 0x2001, 0x1800, 0x2003,
+	0x0004, 0x6027, 0x0008, 0x2011, 0x7006, 0x080c, 0x835c, 0x080c,
+	0x7197, 0x0118, 0x9006, 0x080c, 0x2ba1, 0x080c, 0x0bae, 0x2001,
+	0x0001, 0x080c, 0x269c, 0x012e, 0x00fe, 0x00ee, 0x00de, 0x00ce,
+	0x003e, 0x002e, 0x001e, 0x0005, 0x0026, 0x00e6, 0x2011, 0x7013,
+	0x2071, 0x19f8, 0x701c, 0x9206, 0x1118, 0x7018, 0x9005, 0x0110,
+	0x9085, 0x0001, 0x00ee, 0x002e, 0x0005, 0x6020, 0xd09c, 0x0005,
+	0x6800, 0x9084, 0xfffe, 0x9086, 0x00c0, 0x0170, 0x2001, 0x00c0,
+	0x080c, 0x2ba1, 0x0156, 0x20a9, 0x002d, 0x1d04, 0x7085, 0x2091,
+	0x6000, 0x1f04, 0x7085, 0x015e, 0x0005, 0x00c6, 0x00d6, 0x00e6,
+	0x2061, 0x0100, 0x2069, 0x0140, 0x2071, 0x1800, 0x080c, 0x7474,
+	0x2001, 0x196d, 0x2003, 0x0000, 0x9006, 0x709a, 0x60e2, 0x6886,
+	0x080c, 0x2764, 0x9006, 0x080c, 0x2ba1, 0x080c, 0x5cb7, 0x6027,
+	0xffff, 0x602b, 0x182f, 0x00ee, 0x00de, 0x00ce, 0x0005, 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,
+	0x2001, 0x197d, 0x200c, 0x9186, 0x0000, 0x0158, 0x9186, 0x0001,
+	0x0158, 0x9186, 0x0002, 0x0158, 0x9186, 0x0003, 0x0158, 0x0804,
+	0x7145, 0x709b, 0x0022, 0x0040, 0x709b, 0x0021, 0x0028, 0x709b,
+	0x0023, 0x0010, 0x709b, 0x0024, 0x60e3, 0x0000, 0x6887, 0x0001,
+	0x2001, 0x0001, 0x080c, 0x2764, 0x0026, 0x080c, 0xaadc, 0x002e,
+	0x7000, 0x908e, 0x0004, 0x0118, 0x602b, 0x0028, 0x0010, 0x602b,
+	0x0020, 0x0156, 0x0126, 0x2091, 0x8000, 0x20a9, 0x0005, 0x6024,
+	0xd0ac, 0x0150, 0x012e, 0x015e, 0x080c, 0xcf18, 0x0118, 0x9006,
+	0x080c, 0x2bcb, 0x0804, 0x7151, 0x6800, 0x9084, 0x00a1, 0xc0bd,
+	0x6802, 0x080c, 0x2aea, 0x6904, 0xd1d4, 0x1140, 0x2001, 0x0100,
+	0x080c, 0x2ba1, 0x1f04, 0x70ef, 0x080c, 0x71d4, 0x012e, 0x015e,
+	0x080c, 0x718e, 0x01a8, 0x6044, 0x9005, 0x0168, 0x6050, 0x0006,
+	0x9085, 0x0020, 0x6052, 0x080c, 0x71d4, 0x9006, 0x8001, 0x1df0,
+	0x000e, 0x6052, 0x0028, 0x6804, 0xd0d4, 0x1110, 0x080c, 0x71d4,
+	0x080c, 0xcf18, 0x0118, 0x9006, 0x080c, 0x2bcb, 0x0016, 0x0026,
+	0x7000, 0x908e, 0x0004, 0x0130, 0x2009, 0x00c8, 0x2011, 0x7013,
+	0x080c, 0x831a, 0x002e, 0x001e, 0x080c, 0x819d, 0x7034, 0xc085,
+	0x7036, 0x2001, 0x197d, 0x2003, 0x0004, 0x080c, 0x6e74, 0x080c,
+	0x718e, 0x0138, 0x6804, 0xd0d4, 0x1120, 0xd0dc, 0x1100, 0x080c,
+	0x746a, 0x00ee, 0x00de, 0x00ce, 0x0005, 0x00c6, 0x00d6, 0x00e6,
+	0x2061, 0x0100, 0x2069, 0x0140, 0x2071, 0x1800, 0x080c, 0x81b4,
+	0x080c, 0x81a6, 0x080c, 0x7474, 0x2001, 0x196d, 0x2003, 0x0000,
+	0x9006, 0x709a, 0x60e2, 0x6886, 0x080c, 0x2764, 0x9006, 0x080c,
+	0x2ba1, 0x6043, 0x0090, 0x6043, 0x0010, 0x6027, 0xffff, 0x602b,
+	0x182f, 0x00ee, 0x00de, 0x00ce, 0x0005, 0x0006, 0x2001, 0x197c,
+	0x2004, 0x9086, 0xaaaa, 0x000e, 0x0005, 0x0006, 0x080c, 0x54bb,
+	0x9084, 0x0030, 0x9086, 0x0000, 0x000e, 0x0005, 0x0006, 0x080c,
+	0x54bb, 0x9084, 0x0030, 0x9086, 0x0030, 0x000e, 0x0005, 0x0006,
+	0x080c, 0x54bb, 0x9084, 0x0030, 0x9086, 0x0010, 0x000e, 0x0005,
+	0x0006, 0x080c, 0x54bb, 0x9084, 0x0030, 0x9086, 0x0020, 0x000e,
+	0x0005, 0x0036, 0x0016, 0x2001, 0x180c, 0x2004, 0x908c, 0x0013,
+	0x0180, 0x0020, 0x080c, 0x2784, 0x900e, 0x0028, 0x080c, 0x672f,
+	0x1dc8, 0x2009, 0x0002, 0x2019, 0x0028, 0x080c, 0x3039, 0x9006,
+	0x0019, 0x001e, 0x003e, 0x0005, 0x00e6, 0x2071, 0x180c, 0x2e04,
+	0x0130, 0x080c, 0xcf11, 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, 0x71e9, 0x2091, 0x6000, 0x1f04, 0x71e9, 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, 0x2764, 0x2001,
+	0x00a0, 0x0006, 0x080c, 0xcf18, 0x000e, 0x0130, 0x080c, 0x2bbf,
+	0x9006, 0x080c, 0x2bcb, 0x0010, 0x080c, 0x2ba1, 0x000e, 0x6052,
+	0x6050, 0x0006, 0xc0e5, 0x6052, 0x00f6, 0x2079, 0x0100, 0x080c,
+	0x2a5f, 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, 0x72a9, 0x2001, 0x180c, 0x200c,
+	0xc1c4, 0x2102, 0x6028, 0x9084, 0xe1ff, 0x602a, 0x6027, 0x0200,
+	0x2001, 0x0090, 0x080c, 0x2ba1, 0x20a9, 0x0366, 0x6024, 0xd0cc,
+	0x1518, 0x1d04, 0x7256, 0x2091, 0x6000, 0x1f04, 0x7256, 0x2011,
+	0x0003, 0x080c, 0xa349, 0x2011, 0x0002, 0x080c, 0xa353, 0x080c,
+	0xa236, 0x901e, 0x080c, 0xa2ac, 0x2001, 0x00a0, 0x080c, 0x2ba1,
+	0x080c, 0x7465, 0x080c, 0x5df8, 0x080c, 0xcf18, 0x0110, 0x080c,
+	0x0d45, 0x9085, 0x0001, 0x0498, 0x86ff, 0x1110, 0x080c, 0x1a29,
+	0x60e3, 0x0000, 0x2001, 0x196d, 0x2004, 0x080c, 0x2764, 0x60e2,
+	0x2001, 0x0080, 0x080c, 0x2ba1, 0x20a9, 0x0366, 0x6027, 0x1e00,
+	0x2009, 0x1e00, 0x080c, 0x2aea, 0x6024, 0x910c, 0x0138, 0x1d04,
+	0x728e, 0x2091, 0x6000, 0x1f04, 0x728e, 0x0808, 0x6028, 0x9085,
+	0x1e00, 0x602a, 0x70b4, 0x9005, 0x1118, 0x6887, 0x0001, 0x0008,
+	0x6886, 0x080c, 0xcf18, 0x0110, 0x080c, 0x0d45, 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,
+	0x2071, 0x1800, 0x7000, 0x9086, 0x0003, 0x1168, 0x2001, 0x020b,
+	0x2004, 0x9084, 0x5540, 0x9086, 0x5540, 0x1128, 0x2069, 0x1a76,
+	0x2d04, 0x8000, 0x206a, 0x2069, 0x0140, 0x6020, 0x9084, 0x00c0,
+	0x0120, 0x6884, 0x9005, 0x1904, 0x731c, 0x2001, 0x0088, 0x080c,
+	0x2ba1, 0x9006, 0x60e2, 0x6886, 0x080c, 0x2764, 0x2069, 0x0200,
+	0x6804, 0x9005, 0x1118, 0x6808, 0x9005, 0x01c0, 0x6028, 0x9084,
+	0xfbff, 0x602a, 0x6027, 0x0400, 0x2069, 0x198d, 0x7000, 0x206a,
+	0x709b, 0x0026, 0x7003, 0x0001, 0x20a9, 0x0002, 0x1d04, 0x72fe,
+	0x2091, 0x6000, 0x1f04, 0x72fe, 0x0804, 0x734a, 0x2069, 0x0140,
+	0x20a9, 0x0384, 0x6027, 0x1e00, 0x2009, 0x1e00, 0x080c, 0x2aea,
+	0x6024, 0x910c, 0x0508, 0x9084, 0x1a00, 0x11f0, 0x1d04, 0x730a,
+	0x2091, 0x6000, 0x1f04, 0x730a, 0x2011, 0x0003, 0x080c, 0xa349,
+	0x2011, 0x0002, 0x080c, 0xa353, 0x080c, 0xa236, 0x901e, 0x080c,
+	0xa2ac, 0x2001, 0x00a0, 0x080c, 0x2ba1, 0x080c, 0x7465, 0x080c,
+	0x5df8, 0x9085, 0x0001, 0x00b0, 0x2001, 0x0080, 0x080c, 0x2ba1,
+	0x2069, 0x0140, 0x60e3, 0x0000, 0x70b4, 0x9005, 0x1118, 0x6887,
+	0x0001, 0x0008, 0x6886, 0x2001, 0x196d, 0x2004, 0x080c, 0x2764,
+	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, 0xa349, 0x2011, 0x0002, 0x080c,
+	0xa353, 0x080c, 0xa236, 0x901e, 0x080c, 0xa2ac, 0x2069, 0x0140,
+	0x2001, 0x00a0, 0x080c, 0x2ba1, 0x080c, 0x7465, 0x080c, 0x5df8,
+	0x0804, 0x73e5, 0x2001, 0x180c, 0x200c, 0xd1b4, 0x1160, 0xc1b5,
+	0x2102, 0x080c, 0x6ffb, 0x2069, 0x0140, 0x2001, 0x0080, 0x080c,
+	0x2ba1, 0x60e3, 0x0000, 0x2069, 0x0200, 0x6804, 0x9005, 0x1118,
+	0x6808, 0x9005, 0x0180, 0x6028, 0x9084, 0xfdff, 0x602a, 0x6027,
+	0x0200, 0x2069, 0x198d, 0x7000, 0x206a, 0x709b, 0x0027, 0x7003,
+	0x0001, 0x0804, 0x73e5, 0x6027, 0x1e00, 0x2009, 0x1e00, 0x080c,
+	0x2aea, 0x6024, 0x910c, 0x01c8, 0x9084, 0x1c00, 0x11b0, 0x1d04,
+	0x73a3, 0x0006, 0x0016, 0x00c6, 0x00d6, 0x00e6, 0x080c, 0x81e5,
+	0x00ee, 0x00de, 0x00ce, 0x001e, 0x000e, 0x00e6, 0x2071, 0x19f8,
+	0x7018, 0x00ee, 0x9005, 0x19f8, 0x0500, 0x0026, 0x2011, 0x7013,
+	0x080c, 0x8285, 0x2011, 0x7006, 0x080c, 0x835c, 0x002e, 0x2069,
+	0x0140, 0x60e3, 0x0000, 0x70b4, 0x9005, 0x1118, 0x6887, 0x0001,
+	0x0008, 0x6886, 0x2001, 0x196d, 0x2004, 0x080c, 0x2764, 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, 0xcf11, 0x1904, 0x7453, 0x7130, 0xd184, 0x1170, 0x080c,
+	0x31c4, 0x0138, 0xc18d, 0x7132, 0x2011, 0x1848, 0x2214, 0xd2ac,
+	0x1120, 0x7030, 0xd08c, 0x0904, 0x7453, 0x2011, 0x1848, 0x220c,
+	0xd1a4, 0x0538, 0x0016, 0x2019, 0x000e, 0x080c, 0xe1f4, 0x0156,
+	0x00b6, 0x20a9, 0x007f, 0x900e, 0x9186, 0x007e, 0x01a0, 0x9186,
+	0x0080, 0x0188, 0x080c, 0x63cd, 0x1170, 0x2120, 0x9006, 0x0016,
+	0x2009, 0x000e, 0x080c, 0xe280, 0x2009, 0x0001, 0x2011, 0x0100,
+	0x080c, 0x846c, 0x001e, 0x8108, 0x1f04, 0x741c, 0x00be, 0x015e,
+	0x001e, 0xd1ac, 0x1148, 0x0016, 0x2009, 0x0002, 0x2019, 0x0004,
+	0x080c, 0x3039, 0x001e, 0x0078, 0x0156, 0x00b6, 0x20a9, 0x007f,
+	0x900e, 0x080c, 0x63cd, 0x1110, 0x080c, 0x5e12, 0x8108, 0x1f04,
+	0x7449, 0x00be, 0x015e, 0x080c, 0x1a29, 0x080c, 0xaadc, 0x60e3,
+	0x0000, 0x080c, 0x5df8, 0x080c, 0x70af, 0x00ee, 0x00ce, 0x004e,
+	0x003e, 0x002e, 0x001e, 0x015e, 0x0005, 0x2001, 0x197d, 0x2003,
+	0x0001, 0x0005, 0x2001, 0x197d, 0x2003, 0x0000, 0x0005, 0x2001,
+	0x197c, 0x2003, 0xaaaa, 0x0005, 0x2001, 0x197c, 0x2003, 0x0000,
+	0x0005, 0x2071, 0x18fa, 0x7003, 0x0000, 0x7007, 0x0000, 0x080c,
+	0x1019, 0x090c, 0x0dd5, 0xa8ab, 0xdcb0, 0x2900, 0x704e, 0x080c,
+	0x1019, 0x090c, 0x0dd5, 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, 0x18fa, 0x6807,
+	0x0001, 0x00de, 0x080c, 0x7a51, 0x9006, 0x00ee, 0x0005, 0x900e,
+	0x0156, 0x20a9, 0x0006, 0x8003, 0x2011, 0x0100, 0x2214, 0x9296,
+	0x0008, 0x1110, 0x818d, 0x0010, 0x81f5, 0x3e08, 0x1f04, 0x74db,
+	0x015e, 0x0005, 0x2079, 0x0040, 0x2071, 0x18fa, 0x7004, 0x0002,
+	0x74fa, 0x74fb, 0x7532, 0x758d, 0x769d, 0x74f8, 0x74f8, 0x76c7,
+	0x080c, 0x0dd5, 0x0005, 0x2079, 0x0040, 0x782c, 0x908c, 0x0780,
+	0x190c, 0x7b33, 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, 0x758d, 0x782c, 0xd09c, 0x090c, 0x7a51, 0x0005, 0x9082,
+	0x005a, 0x1218, 0x2100, 0x003b, 0x0c18, 0x080c, 0x75c3, 0x0c90,
+	0x00e3, 0x08f0, 0x0005, 0x75c3, 0x75c3, 0x75c3, 0x75c3, 0x75c3,
+	0x75c3, 0x75c3, 0x75c3, 0x75e5, 0x75c3, 0x75c3, 0x75c3, 0x75c3,
+	0x75c3, 0x75c3, 0x75c3, 0x75c3, 0x75c3, 0x75c3, 0x75c3, 0x75c3,
+	0x75c3, 0x75c3, 0x75c3, 0x75c3, 0x75c3, 0x75c3, 0x75c3, 0x75cf,
+	0x75c3, 0x77b8, 0x75c3, 0x75c3, 0x75c3, 0x75c3, 0x75c3, 0x75cf,
+	0x77f9, 0x783a, 0x7881, 0x7895, 0x75c3, 0x75c3, 0x75e5, 0x75cf,
+	0x75f9, 0x75c3, 0x7671, 0x7940, 0x795b, 0x75c3, 0x75e5, 0x75c3,
+	0x75f9, 0x75c3, 0x75c3, 0x7667, 0x795b, 0x75c3, 0x75c3, 0x75c3,
+	0x75c3, 0x75c3, 0x75c3, 0x75c3, 0x75c3, 0x75c3, 0x760d, 0x75c3,
+	0x75c3, 0x75c3, 0x75c3, 0x75c3, 0x75c3, 0x75c3, 0x75c3, 0x75c3,
+	0x7ad7, 0x75c3, 0x7a81, 0x75c3, 0x7a81, 0x75c3, 0x7622, 0x75c3,
+	0x75c3, 0x75c3, 0x75c3, 0x75c3, 0x75c3, 0x2079, 0x0040, 0x7004,
+	0x9086, 0x0003, 0x1198, 0x782c, 0x080c, 0x7a7a, 0xd0a4, 0x0170,
+	0x7824, 0x2048, 0x9006, 0xa802, 0xa806, 0xa864, 0x9084, 0x00ff,
+	0x908a, 0x001a, 0x1210, 0x002b, 0x0c50, 0x00e9, 0x080c, 0x7a51,
+	0x0005, 0x75c3, 0x75cf, 0x77a4, 0x75c3, 0x75cf, 0x75c3, 0x75cf,
+	0x75cf, 0x75c3, 0x75cf, 0x77a4, 0x75cf, 0x75cf, 0x75cf, 0x75cf,
+	0x75cf, 0x75c3, 0x75cf, 0x77a4, 0x75c3, 0x75c3, 0x75cf, 0x75c3,
+	0x75c3, 0x75c3, 0x75cf, 0x00e6, 0x2071, 0x18fa, 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, 0x6a46, 0x012e, 0x0005, 0xa864, 0x8007, 0x9084,
+	0x00ff, 0x0d08, 0x8001, 0x1120, 0x7007, 0x0001, 0x0804, 0x7746,
+	0x7007, 0x0003, 0x7012, 0x2900, 0x7016, 0x701a, 0x704b, 0x7746,
+	0x0005, 0xa864, 0x8007, 0x9084, 0x00ff, 0x0968, 0x8001, 0x1120,
+	0x7007, 0x0001, 0x0804, 0x7761, 0x7007, 0x0003, 0x7012, 0x2900,
+	0x7016, 0x701a, 0x704b, 0x7761, 0x0005, 0xa864, 0x8007, 0x9084,
+	0x00ff, 0x0904, 0x75cb, 0x8001, 0x1120, 0x7007, 0x0001, 0x0804,
+	0x777d, 0x7007, 0x0003, 0x7012, 0x2900, 0x7016, 0x701a, 0x704b,
+	0x777d, 0x0005, 0xa864, 0x8007, 0x9084, 0x00ff, 0x9086, 0x0001,
+	0x1904, 0x75cb, 0x7007, 0x0001, 0x2009, 0x1834, 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,
+	0x608c, 0x1108, 0x0005, 0x0126, 0x2091, 0x8000, 0xa867, 0x0139,
+	0xa87a, 0xa982, 0x080c, 0x6a46, 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,
+	0x7972, 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,
+	0x0401, 0x1a04, 0x75d3, 0xaab4, 0x928a, 0x0002, 0x1a04, 0x75d3,
+	0x82ff, 0x1138, 0xa8b8, 0xa9bc, 0x9105, 0x0118, 0x2001, 0x7704,
+	0x0018, 0x9280, 0x76fa, 0x2005, 0x7056, 0x7010, 0x9015, 0x0904,
+	0x76e5, 0x080c, 0x1019, 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,
+	0x0108, 0x9108, 0xa17a, 0x810b, 0xa17e, 0x080c, 0x10e0, 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,
+	0x0005, 0x7020, 0x2048, 0x080c, 0x1032, 0x7014, 0x2048, 0x0804,
+	0x75d3, 0x7020, 0x2048, 0x7018, 0xa802, 0xa807, 0x0000, 0x2908,
+	0x2048, 0xa906, 0x711a, 0x0804, 0x769d, 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,
+	0x00b9, 0xa864, 0x9084, 0x00ff, 0x9086, 0x001e, 0x0904, 0x7972,
+	0x0804, 0x7746, 0x76fc, 0x7700, 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,
@@ -3440,1419 +3610,1812 @@
 	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,
+	0xb004, 0x9055, 0x1958, 0x006e, 0x007e, 0x0005, 0x2009, 0x1834,
+	0x210c, 0x81ff, 0x1178, 0x080c, 0x5e8c, 0x1108, 0x0005, 0x080c,
+	0x6c85, 0x0126, 0x2091, 0x8000, 0x080c, 0xcb0d, 0x080c, 0x6a46,
+	0x012e, 0x0ca0, 0x080c, 0xcf11, 0x1d70, 0x2001, 0x0028, 0x900e,
+	0x0c70, 0x2009, 0x1834, 0x210c, 0x81ff, 0x1188, 0xa888, 0x9005,
+	0x0188, 0xa883, 0x0000, 0x080c, 0x5f1c, 0x1108, 0x0005, 0xa87a,
+	0x0126, 0x2091, 0x8000, 0x080c, 0x6a46, 0x012e, 0x0cb8, 0x2001,
+	0x0028, 0x0ca8, 0x2001, 0x0000, 0x0c90, 0x2009, 0x1834, 0x210c,
+	0x81ff, 0x11d8, 0xa888, 0x9005, 0x01e0, 0xa883, 0x0000, 0xa87c,
+	0xd0f4, 0x0120, 0x080c, 0x5fee, 0x1138, 0x0005, 0x9006, 0xa87a,
+	0x080c, 0x5f69, 0x1108, 0x0005, 0x0126, 0x2091, 0x8000, 0xa87a,
+	0xa982, 0x080c, 0x6a46, 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, 0x63cd, 0x11b8, 0x0066, 0xae80, 0x080c, 0x64dd, 0x006e,
+	0x0088, 0x0046, 0x2011, 0x180c, 0x2224, 0xc484, 0x2412, 0x004e,
+	0x00c6, 0x080c, 0x63cd, 0x1110, 0x080c, 0x65dd, 0x8108, 0x1f04,
+	0x77e1, 0x00ce, 0xa87c, 0xd084, 0x1120, 0x080c, 0x1032, 0x00be,
+	0x0005, 0x0126, 0x2091, 0x8000, 0x080c, 0x6a46, 0x012e, 0x00be,
+	0x0005, 0x0126, 0x2091, 0x8000, 0x7007, 0x0001, 0x080c, 0x6733,
+	0x0580, 0x2061, 0x1a6e, 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,
+	0x7a3b, 0x012e, 0x0804, 0x7a35, 0x012e, 0x0804, 0x7a2f, 0x012e,
+	0x0804, 0x7a32, 0x0126, 0x2091, 0x8000, 0x7007, 0x0001, 0x080c,
+	0x6733, 0x05e0, 0x2061, 0x1a6e, 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, 0x7a3b, 0x012e, 0x0804, 0x7a38, 0x012e, 0x0804,
+	0x7a35, 0x0126, 0x2091, 0x8000, 0x7007, 0x0001, 0x2061, 0x1a6e,
+	0x6300, 0xd38c, 0x1120, 0x6308, 0x8318, 0x0220, 0x630a, 0x012e,
+	0x0804, 0x7a49, 0x012e, 0x0804, 0x7a38, 0x00b6, 0x0126, 0x00c6,
+	0x2091, 0x8000, 0x7007, 0x0001, 0xa87c, 0xd0ac, 0x0148, 0x00c6,
+	0x2061, 0x1a6e, 0x6000, 0x9084, 0xfcff, 0x6002, 0x00ce, 0x0440,
+	0xa888, 0x9005, 0x05d8, 0xa88c, 0x9065, 0x0598, 0x2001, 0x1834,
+	0x2004, 0x9005, 0x0118, 0x080c, 0xab9c, 0x0068, 0x6017, 0xf400,
+	0x605b, 0x0000, 0xa97c, 0xd1a4, 0x0110, 0xa980, 0x615a, 0x2009,
+	0x0041, 0x080c, 0xabe6, 0xa988, 0x918c, 0xff00, 0x9186, 0x2000,
+	0x1138, 0x0026, 0x900e, 0x2011, 0xfdff, 0x080c, 0x846c, 0x002e,
+	0xa87c, 0xd0c4, 0x0148, 0x2061, 0x1a6e, 0x6000, 0xd08c, 0x1120,
+	0x6008, 0x8000, 0x0208, 0x600a, 0x00ce, 0x012e, 0x00be, 0x0804,
+	0x7a3b, 0x00ce, 0x012e, 0x00be, 0x0804, 0x7a35, 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, 0x63cd, 0x1968, 0xb800, 0xc0e4, 0xb802, 0x0848, 0xa88c,
+	0x9065, 0x09b8, 0x6007, 0x0024, 0x2001, 0x1984, 0x2004, 0x601a,
+	0x0804, 0x78d0, 0xa88c, 0x9065, 0x0960, 0x00e6, 0xa890, 0x9075,
+	0x2001, 0x1834, 0x2004, 0x9005, 0x0150, 0x080c, 0xab9c, 0x8eff,
+	0x0118, 0x2e60, 0x080c, 0xab9c, 0x00ee, 0x0804, 0x78d0, 0x6024,
+	0xc0dc, 0xc0d5, 0x6026, 0x2e60, 0x6007, 0x003a, 0xa8a0, 0x9005,
+	0x0130, 0x6007, 0x003b, 0xa8a4, 0x602e, 0xa8a8, 0x6016, 0x6003,
+	0x0001, 0x080c, 0x8e7f, 0x080c, 0x941c, 0x00ee, 0x0804, 0x78d0,
+	0x2061, 0x1a6e, 0x6000, 0xd084, 0x0190, 0xd08c, 0x1904, 0x7a49,
+	0x0126, 0x2091, 0x8000, 0x6204, 0x8210, 0x0220, 0x6206, 0x012e,
+	0x0804, 0x7a49, 0x012e, 0xa883, 0x0016, 0x0804, 0x7a42, 0xa883,
+	0x0007, 0x0804, 0x7a42, 0xa864, 0x8007, 0x9084, 0x00ff, 0x0130,
+	0x8001, 0x1138, 0x7007, 0x0001, 0x0069, 0x0005, 0x080c, 0x75cb,
+	0x0040, 0x7007, 0x0003, 0x7012, 0x2900, 0x7016, 0x701a, 0x704b,
+	0x7972, 0x0005, 0x00b6, 0x00e6, 0x0126, 0x2091, 0x8000, 0x903e,
+	0x2061, 0x1800, 0x61d0, 0x81ff, 0x1904, 0x79f4, 0x6130, 0xd194,
+	0x1904, 0x7a1e, 0xa878, 0x2070, 0x9e82, 0x1cd0, 0x0a04, 0x79e8,
+	0x6068, 0x9e02, 0x1a04, 0x79e8, 0x7120, 0x9186, 0x0006, 0x1904,
+	0x79da, 0x7010, 0x905d, 0x0904, 0x79f4, 0xb800, 0xd0e4, 0x1904,
+	0x7a18, 0x2061, 0x1a6e, 0x6100, 0x9184, 0x0301, 0x9086, 0x0001,
+	0x15a0, 0x7024, 0xd0dc, 0x1904, 0x7a21, 0xa883, 0x0000, 0xa803,
+	0x0000, 0x2908, 0x7014, 0x9005, 0x1198, 0x7116, 0xa87c, 0xd0f4,
+	0x1904, 0x7a24, 0x080c, 0x54b7, 0xd09c, 0x1118, 0xa87c, 0xc0cc,
+	0xa87e, 0x2e60, 0x080c, 0x838c, 0x012e, 0x00ee, 0x00be, 0x0005,
+	0x2048, 0xa800, 0x9005, 0x1de0, 0xa902, 0x2148, 0xa87c, 0xd0f4,
+	0x1904, 0x7a24, 0x012e, 0x00ee, 0x00be, 0x0005, 0x012e, 0x00ee,
+	0xa883, 0x0006, 0x00be, 0x0804, 0x7a42, 0xd184, 0x0db8, 0xd1c4,
+	0x1190, 0x00a0, 0xa974, 0x080c, 0x63cd, 0x15d0, 0xb800, 0xd0e4,
+	0x15b8, 0x7120, 0x9186, 0x0007, 0x1118, 0xa883, 0x0002, 0x0490,
+	0xa883, 0x0008, 0x0478, 0xa883, 0x000e, 0x0460, 0xa883, 0x0017,
+	0x0448, 0xa883, 0x0035, 0x0430, 0x080c, 0x54bb, 0xd0fc, 0x01e8,
+	0xa878, 0x2070, 0x9e82, 0x1cd0, 0x02c0, 0x6068, 0x9e02, 0x12a8,
+	0x7120, 0x9186, 0x0006, 0x1188, 0x7010, 0x905d, 0x0170, 0xb800,
+	0xd0bc, 0x0158, 0x2039, 0x0001, 0x7000, 0x9086, 0x0007, 0x1904,
+	0x797e, 0x7003, 0x0002, 0x0804, 0x797e, 0xa883, 0x0028, 0x0010,
+	0xa883, 0x0029, 0x012e, 0x00ee, 0x00be, 0x0420, 0xa883, 0x002a,
+	0x0cc8, 0xa883, 0x0045, 0x0cb0, 0x2e60, 0x2019, 0x0002, 0x601b,
+	0x0014, 0x080c, 0xde08, 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, 0x6a46, 0x012e,
+	0x0005, 0x080c, 0x1032, 0x0005, 0x00d6, 0x080c, 0x8383, 0x00de,
+	0x0005, 0x00d6, 0x00e6, 0x0126, 0x2091, 0x8000, 0x2071, 0x0040,
+	0x702c, 0xd084, 0x01d8, 0x908c, 0x0780, 0x190c, 0x7b33, 0xd09c,
+	0x11a8, 0x2071, 0x1800, 0x70c0, 0x90ea, 0x0020, 0x0278, 0x8001,
+	0x70c2, 0x702c, 0x2048, 0xa800, 0x702e, 0x9006, 0xa802, 0xa806,
+	0x2071, 0x0040, 0x2900, 0x7022, 0x702c, 0x0c28, 0x012e, 0x00ee,
+	0x00de, 0x0005, 0x0006, 0x9084, 0x0780, 0x190c, 0x7b33, 0x000e,
+	0x0005, 0xa898, 0x9084, 0x0003, 0x05a8, 0x080c, 0xab15, 0x05d8,
+	0x2900, 0x6016, 0xa864, 0x9084, 0x00ff, 0x9086, 0x0035, 0x1138,
+	0x6008, 0xc0fd, 0x600a, 0x2001, 0x196b, 0x2004, 0x0098, 0xa8a0,
+	0x9084, 0x00ff, 0xa99c, 0x918c, 0xff00, 0x9105, 0xa99c, 0x918c,
+	0x00ff, 0x080c, 0x26f0, 0x1540, 0x00b6, 0x080c, 0x63cd, 0x2b00,
+	0x00be, 0x1510, 0x6012, 0x6023, 0x0001, 0x2009, 0x0040, 0xa864,
+	0x9084, 0x00ff, 0x9086, 0x0035, 0x0110, 0x2009, 0x0041, 0x080c,
+	0xabe6, 0x0005, 0xa87b, 0x0101, 0x0126, 0x2091, 0x8000, 0x080c,
+	0x6a46, 0x012e, 0x0005, 0xa87b, 0x002c, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x6a46, 0x012e, 0x0005, 0xa87b, 0x0028, 0x0126, 0x2091,
+	0x8000, 0x080c, 0x6a46, 0x012e, 0x080c, 0xab6b, 0x0005, 0x00d6,
+	0x00c6, 0x0036, 0x0026, 0x0016, 0x00b6, 0x7007, 0x0001, 0xaa74,
+	0x9282, 0x0004, 0x1a04, 0x7b24, 0xa97c, 0x9188, 0x1000, 0x2104,
+	0x905d, 0xb804, 0xd284, 0x0140, 0x05e8, 0x8007, 0x9084, 0x00ff,
+	0x9084, 0x0006, 0x1108, 0x04b0, 0x2b10, 0x080c, 0xab15, 0x1118,
+	0x080c, 0xabb9, 0x05a8, 0x6212, 0xa874, 0x0002, 0x7b02, 0x7b07,
+	0x7b0a, 0x7b10, 0x2019, 0x0002, 0x080c, 0xe1f4, 0x0060, 0x080c,
+	0xe190, 0x0048, 0x2019, 0x0002, 0xa980, 0x080c, 0xe1ab, 0x0018,
+	0xa980, 0x080c, 0xe190, 0x080c, 0xab6b, 0xa887, 0x0000, 0x0126,
+	0x2091, 0x8000, 0x080c, 0x6a46, 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, 0x7b35, 0x0006,
+	0x0016, 0x2001, 0x8003, 0x0006, 0x0804, 0x0dde, 0x0005, 0x00f6,
+	0x2079, 0x0300, 0x2001, 0x0200, 0x200c, 0xc1e5, 0xc1dc, 0x2102,
+	0x2009, 0x0218, 0x210c, 0xd1ec, 0x1120, 0x080c, 0x1560, 0x00fe,
+	0x0005, 0x2001, 0x020d, 0x2003, 0x0020, 0x781f, 0x0300, 0x00fe,
+	0x0005, 0x781c, 0xd08c, 0x0904, 0x7b9f, 0x68c0, 0x90aa, 0x0005,
+	0x0a04, 0x819d, 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, 0xe664, 0x080c, 0x8092, 0x7817, 0x0140, 0x00a8,
+	0x9584, 0x0076, 0x1118, 0x080c, 0x80f0, 0x19c8, 0xd5a4, 0x0148,
+	0x0046, 0x0056, 0x080c, 0x7c01, 0x080c, 0x21e9, 0x005e, 0x004e,
+	0x0020, 0x080c, 0xe664, 0x7817, 0x0140, 0x080c, 0x7be2, 0x2001,
+	0x19ee, 0x2004, 0x9005, 0x090c, 0x941c, 0x0005, 0x0002, 0x7bb8,
+	0x7eb4, 0x7baf, 0x7baf, 0x7baf, 0x7baf, 0x7baf, 0x7baf, 0x7817,
+	0x0140, 0x2001, 0x19ee, 0x2004, 0x9005, 0x090c, 0x941c, 0x0005,
+	0x7000, 0x908c, 0xff00, 0x9194, 0xf000, 0x810f, 0x9484, 0x0fff,
+	0x6892, 0x9286, 0x2000, 0x1150, 0x6800, 0x9086, 0x0001, 0x1118,
+	0x080c, 0x550e, 0x0070, 0x080c, 0x7c21, 0x0058, 0x9286, 0x3000,
+	0x1118, 0x080c, 0x7def, 0x0028, 0x9286, 0x8000, 0x1110, 0x080c,
+	0x7fc2, 0x7817, 0x0140, 0x2001, 0x19ee, 0x2004, 0x9005, 0x090c,
+	0x941c, 0x0005, 0x2001, 0x1810, 0x2004, 0xd08c, 0x0178, 0x2001,
+	0x1800, 0x2004, 0x9086, 0x0003, 0x1148, 0x0026, 0x0036, 0x2011,
+	0x8048, 0x2518, 0x080c, 0x48fb, 0x003e, 0x002e, 0x0005, 0x0036,
+	0x0046, 0x0056, 0x00f6, 0x2079, 0x0200, 0x2019, 0xfffe, 0x7c30,
+	0x0050, 0x0036, 0x0046, 0x0056, 0x00f6, 0x2079, 0x0200, 0x7d44,
+	0x7c40, 0x2019, 0xffff, 0x2001, 0x1810, 0x2004, 0xd08c, 0x0160,
+	0x2001, 0x1800, 0x2004, 0x9086, 0x0003, 0x1130, 0x0026, 0x2011,
+	0x8048, 0x080c, 0x48fb, 0x002e, 0x00fe, 0x005e, 0x004e, 0x003e,
+	0x0005, 0x00b6, 0x00c6, 0x7010, 0x9084, 0xff00, 0x8007, 0x9096,
+	0x0001, 0x0120, 0x9096, 0x0023, 0x1904, 0x7dc0, 0x9186, 0x0023,
+	0x15c0, 0x080c, 0x8057, 0x0904, 0x7dc0, 0x6120, 0x9186, 0x0001,
+	0x0150, 0x9186, 0x0004, 0x0138, 0x9186, 0x0008, 0x0120, 0x9186,
+	0x000a, 0x1904, 0x7dc0, 0x7124, 0x610a, 0x7030, 0x908e, 0x0200,
+	0x1130, 0x2009, 0x0015, 0x080c, 0xabe6, 0x0804, 0x7dc0, 0x908e,
+	0x0214, 0x0118, 0x908e, 0x0210, 0x1130, 0x2009, 0x0015, 0x080c,
+	0xabe6, 0x0804, 0x7dc0, 0x908e, 0x0100, 0x1904, 0x7dc0, 0x7034,
+	0x9005, 0x1904, 0x7dc0, 0x2009, 0x0016, 0x080c, 0xabe6, 0x0804,
+	0x7dc0, 0x9186, 0x0022, 0x1904, 0x7dc0, 0x7030, 0x908e, 0x0300,
+	0x1580, 0x68dc, 0xd0a4, 0x0528, 0xc0b5, 0x68de, 0x7100, 0x918c,
+	0x00ff, 0x697e, 0x7004, 0x6882, 0x00f6, 0x2079, 0x0100, 0x79e6,
+	0x78ea, 0x0006, 0x9084, 0x00ff, 0x0016, 0x2008, 0x080c, 0x2739,
+	0x7932, 0x7936, 0x001e, 0x000e, 0x00fe, 0x080c, 0x26f0, 0x695e,
+	0x703c, 0x00e6, 0x2071, 0x0140, 0x7086, 0x2071, 0x1800, 0x70b6,
+	0x00ee, 0x7034, 0x9005, 0x1904, 0x7dc0, 0x2009, 0x0017, 0x0804,
+	0x7d8d, 0x908e, 0x0400, 0x1190, 0x7034, 0x9005, 0x1904, 0x7dc0,
+	0x080c, 0x717d, 0x0120, 0x2009, 0x001d, 0x0804, 0x7d8d, 0x68dc,
+	0xc0a5, 0x68de, 0x2009, 0x0030, 0x0804, 0x7d8d, 0x908e, 0x0500,
+	0x1140, 0x7034, 0x9005, 0x1904, 0x7dc0, 0x2009, 0x0018, 0x0804,
+	0x7d8d, 0x908e, 0x2010, 0x1120, 0x2009, 0x0019, 0x0804, 0x7d8d,
+	0x908e, 0x2110, 0x1120, 0x2009, 0x001a, 0x0804, 0x7d8d, 0x908e,
+	0x5200, 0x1140, 0x7034, 0x9005, 0x1904, 0x7dc0, 0x2009, 0x001b,
+	0x0804, 0x7d8d, 0x908e, 0x5000, 0x1140, 0x7034, 0x9005, 0x1904,
+	0x7dc0, 0x2009, 0x001c, 0x0804, 0x7d8d, 0x908e, 0x1300, 0x1120,
+	0x2009, 0x0034, 0x0804, 0x7d8d, 0x908e, 0x1200, 0x1140, 0x7034,
+	0x9005, 0x1904, 0x7dc0, 0x2009, 0x0024, 0x0804, 0x7d8d, 0x908c,
+	0xff00, 0x918e, 0x2400, 0x1170, 0x2009, 0x002d, 0x2001, 0x1810,
+	0x2004, 0xd09c, 0x0904, 0x7d8d, 0x080c, 0xd5dd, 0x1904, 0x7dc0,
+	0x0804, 0x7d8b, 0x908c, 0xff00, 0x918e, 0x5300, 0x1120, 0x2009,
+	0x002a, 0x0804, 0x7d8d, 0x908e, 0x0f00, 0x1120, 0x2009, 0x0020,
+	0x0804, 0x7d8d, 0x908e, 0x5300, 0x1108, 0x0448, 0x908e, 0x6104,
+	0x1530, 0x2029, 0x0205, 0x2011, 0x026d, 0x8208, 0x2204, 0x9082,
+	0x0004, 0x8004, 0x8004, 0x20a8, 0x2011, 0x8015, 0x211c, 0x8108,
+	0x0046, 0x2124, 0x080c, 0x48fb, 0x004e, 0x8108, 0x0f04, 0x7d41,
+	0x9186, 0x0280, 0x1d88, 0x2504, 0x8000, 0x202a, 0x2009, 0x0260,
+	0x0c58, 0x202b, 0x0000, 0x2009, 0x0023, 0x0804, 0x7d8d, 0x908e,
+	0x6000, 0x1120, 0x2009, 0x003f, 0x0804, 0x7d8d, 0x908e, 0x5400,
+	0x1138, 0x080c, 0x814d, 0x1904, 0x7dc0, 0x2009, 0x0046, 0x04a8,
+	0x908e, 0x5500, 0x1148, 0x080c, 0x8175, 0x1118, 0x2009, 0x0041,
+	0x0460, 0x2009, 0x0042, 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,
+	0x6838, 0xd0d4, 0x0110, 0x2009, 0x004c, 0x0016, 0x2011, 0x0263,
+	0x2204, 0x8211, 0x220c, 0x080c, 0x26f0, 0x1568, 0x080c, 0x636c,
+	0x1550, 0xbe12, 0xbd16, 0x001e, 0x0016, 0xb8c0, 0x9005, 0x1168,
+	0x9186, 0x0046, 0x1150, 0x687c, 0x9606, 0x1138, 0x6880, 0x9506,
+	0x9084, 0xff00, 0x1110, 0x001e, 0x0098, 0x080c, 0xab15, 0x01a8,
+	0x2b08, 0x6112, 0x6023, 0x0004, 0x7120, 0x610a, 0x001e, 0x9186,
+	0x004c, 0x1110, 0x6023, 0x000a, 0x0016, 0x001e, 0x080c, 0xabe6,
+	0x00ce, 0x00be, 0x0005, 0x001e, 0x0cd8, 0x2001, 0x180e, 0x2004,
+	0xd0ec, 0x0120, 0x2011, 0x8049, 0x080c, 0x48fb, 0x080c, 0xabb9,
+	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, 0x8ec7, 0x08a0, 0x080c,
+	0x318e, 0x1140, 0x7010, 0x9084, 0xff00, 0x8007, 0x908e, 0x0008,
+	0x1108, 0x0009, 0x0005, 0x00b6, 0x00c6, 0x0046, 0x7000, 0x908c,
+	0xff00, 0x810f, 0x9186, 0x0033, 0x11e8, 0x080c, 0x8057, 0x0904,
+	0x7e4c, 0x7124, 0x610a, 0x7030, 0x908e, 0x0200, 0x1140, 0x7034,
+	0x9005, 0x15d0, 0x2009, 0x0015, 0x080c, 0xabe6, 0x04a8, 0x908e,
+	0x0100, 0x1590, 0x7034, 0x9005, 0x1578, 0x2009, 0x0016, 0x080c,
+	0xabe6, 0x0450, 0x9186, 0x0032, 0x1538, 0x7030, 0x908e, 0x1400,
+	0x1518, 0x2009, 0x0038, 0x0016, 0x2011, 0x0263, 0x2204, 0x8211,
+	0x220c, 0x080c, 0x26f0, 0x11b8, 0x080c, 0x636c, 0x11a0, 0xbe12,
+	0xbd16, 0x080c, 0xab15, 0x0178, 0x2b08, 0x6112, 0x080c, 0xcc93,
+	0x6023, 0x0004, 0x7120, 0x610a, 0x001e, 0x080c, 0xabe6, 0x080c,
+	0x941c, 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, 0x7eae, 0x9596, 0xfffe, 0x1120, 0x2009, 0x007e,
+	0x0804, 0x7eae, 0x9596, 0xfffc, 0x1118, 0x2009, 0x0080, 0x04f0,
+	0x2011, 0x0000, 0x2019, 0x1837, 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, 0x7e83, 0x82ff,
+	0x1118, 0x9085, 0x0001, 0x0018, 0xc2fc, 0x2208, 0x9006, 0x00de,
+	0x00ee, 0x004e, 0x00be, 0x0005, 0x7000, 0x908c, 0xff00, 0x810f,
+	0x9184, 0x000f, 0x0002, 0x7ecb, 0x7ecb, 0x7ecb, 0x8069, 0x7ecb,
+	0x7ed4, 0x7eff, 0x7f8d, 0x7ecb, 0x7ecb, 0x7ecb, 0x7ecb, 0x7ecb,
+	0x7ecb, 0x7ecb, 0x7ecb, 0x7817, 0x0140, 0x2001, 0x19ee, 0x2004,
+	0x9005, 0x090c, 0x941c, 0x0005, 0x00b6, 0x7110, 0xd1bc, 0x01e8,
+	0x7120, 0x2160, 0x9c8c, 0x0007, 0x11c0, 0x9c8a, 0x1cd0, 0x02a8,
+	0x6868, 0x9c02, 0x1290, 0x7008, 0x9084, 0x00ff, 0x6110, 0x2158,
+	0xb910, 0x9106, 0x1150, 0x700c, 0xb914, 0x9106, 0x1130, 0x7124,
+	0x610a, 0x2009, 0x0046, 0x080c, 0xabe6, 0x7817, 0x0140, 0x2001,
+	0x19ee, 0x2004, 0x9005, 0x090c, 0x941c, 0x00be, 0x0005, 0x00b6,
+	0x00c6, 0x9484, 0x0fff, 0x0904, 0x7f63, 0x7110, 0xd1bc, 0x1904,
+	0x7f63, 0x7108, 0x700c, 0x2028, 0x918c, 0x00ff, 0x2130, 0x9094,
+	0xff00, 0x15b0, 0x81ff, 0x15a0, 0x9080, 0x31d0, 0x200d, 0x918c,
+	0xff00, 0x810f, 0x2001, 0x0080, 0x9106, 0x0904, 0x7f63, 0x080c,
+	0x636c, 0x1904, 0x7f63, 0xbe12, 0xbd16, 0xb800, 0xd0ec, 0x15d8,
+	0xba04, 0x9294, 0xff00, 0x9286, 0x0600, 0x11a0, 0x080c, 0xab15,
+	0x05e8, 0x2b08, 0x7028, 0x604a, 0x702c, 0x6046, 0x6112, 0x6023,
+	0x0006, 0x7120, 0x610a, 0x7130, 0x6156, 0x2009, 0x0044, 0x080c,
+	0xd837, 0x0408, 0x080c, 0x6737, 0x1138, 0xb807, 0x0606, 0x0c30,
+	0x190c, 0x7e50, 0x11c0, 0x0898, 0x080c, 0xab15, 0x2b08, 0x0198,
+	0x6112, 0x6023, 0x0004, 0x7120, 0x610a, 0x9286, 0x0400, 0x1118,
+	0x6007, 0x0005, 0x0010, 0x6007, 0x0001, 0x6003, 0x0001, 0x080c,
+	0x8ec7, 0x080c, 0x941c, 0x7817, 0x0140, 0x2001, 0x19ee, 0x2004,
+	0x9005, 0x090c, 0x941c, 0x00ce, 0x00be, 0x0005, 0x2001, 0x180e,
+	0x2004, 0xd0ec, 0x0120, 0x2011, 0x8049, 0x080c, 0x48fb, 0x080c,
+	0xabb9, 0x0d48, 0x2b08, 0x6112, 0x6023, 0x0006, 0x7120, 0x610a,
+	0x7130, 0x6156, 0x6017, 0xf300, 0x6003, 0x0001, 0x6007, 0x0041,
+	0x080c, 0x8e7f, 0x080c, 0x941c, 0x08b0, 0x00b6, 0x7110, 0xd1bc,
+	0x01e8, 0x7020, 0x2060, 0x9c84, 0x0007, 0x11c0, 0x9c82, 0x1cd0,
+	0x02a8, 0x6868, 0x9c02, 0x1290, 0x7008, 0x9084, 0x00ff, 0x6110,
+	0x2158, 0xb910, 0x9106, 0x1150, 0x700c, 0xb914, 0x9106, 0x1130,
+	0x7124, 0x610a, 0x2009, 0x0045, 0x080c, 0xabe6, 0x7817, 0x0140,
+	0x2001, 0x19ee, 0x2004, 0x9005, 0x090c, 0x941c, 0x00be, 0x0005,
+	0x6120, 0x9186, 0x0002, 0x0128, 0x9186, 0x0005, 0x0110, 0x9085,
+	0x0001, 0x0005, 0x080c, 0x318e, 0x1168, 0x7010, 0x9084, 0xff00,
+	0x8007, 0x9086, 0x0000, 0x1130, 0x9184, 0x000f, 0x908a, 0x0006,
+	0x1208, 0x000b, 0x0005, 0x7fd9, 0x7fda, 0x7fd9, 0x7fd9, 0x8039,
+	0x8048, 0x0005, 0x00b6, 0x7110, 0xd1bc, 0x0120, 0x702c, 0xd084,
+	0x0904, 0x8037, 0x700c, 0x7108, 0x080c, 0x26f0, 0x1904, 0x8037,
+	0x080c, 0x636c, 0x1904, 0x8037, 0xbe12, 0xbd16, 0x7110, 0xd1bc,
+	0x01d8, 0x080c, 0x6737, 0x0118, 0x9086, 0x0004, 0x1588, 0x00c6,
+	0x080c, 0x8057, 0x00ce, 0x05d8, 0x080c, 0xab15, 0x2b08, 0x05b8,
+	0x6112, 0x080c, 0xcc93, 0x6023, 0x0002, 0x7120, 0x610a, 0x2009,
+	0x0088, 0x080c, 0xabe6, 0x0458, 0x080c, 0x6737, 0x0148, 0x9086,
+	0x0004, 0x0130, 0x080c, 0x673f, 0x0118, 0x9086, 0x0004, 0x1180,
+	0x080c, 0xab15, 0x2b08, 0x01d8, 0x6112, 0x080c, 0xcc93, 0x6023,
+	0x0005, 0x7120, 0x610a, 0x2009, 0x0088, 0x080c, 0xabe6, 0x0078,
+	0x080c, 0xab15, 0x2b08, 0x0158, 0x6112, 0x080c, 0xcc93, 0x6023,
+	0x0004, 0x7120, 0x610a, 0x2009, 0x0001, 0x080c, 0xabe6, 0x00be,
+	0x0005, 0x7110, 0xd1bc, 0x0158, 0x00d1, 0x0148, 0x080c, 0x7fb8,
+	0x1130, 0x7124, 0x610a, 0x2009, 0x0089, 0x080c, 0xabe6, 0x0005,
+	0x7110, 0xd1bc, 0x0158, 0x0059, 0x0148, 0x080c, 0x7fb8, 0x1130,
+	0x7124, 0x610a, 0x2009, 0x008a, 0x080c, 0xabe6, 0x0005, 0x7020,
+	0x2060, 0x9c84, 0x0007, 0x1158, 0x9c82, 0x1cd0, 0x0240, 0x2001,
+	0x181a, 0x2004, 0x9c02, 0x1218, 0x9085, 0x0001, 0x0005, 0x9006,
+	0x0ce8, 0x00b6, 0x7110, 0xd1bc, 0x11d8, 0x7024, 0x2060, 0x9c84,
+	0x0007, 0x11b0, 0x9c82, 0x1cd0, 0x0298, 0x6868, 0x9c02, 0x1280,
+	0x7008, 0x9084, 0x00ff, 0x6110, 0x2158, 0xb910, 0x9106, 0x1140,
+	0x700c, 0xb914, 0x9106, 0x1120, 0x2009, 0x0051, 0x080c, 0xabe6,
+	0x7817, 0x0140, 0x2001, 0x19ee, 0x2004, 0x9005, 0x090c, 0x941c,
+	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, 0xab15, 0x05b8, 0x0066, 0x00c6,
+	0x0046, 0x2011, 0x0263, 0x2204, 0x8211, 0x220c, 0x080c, 0x26f0,
+	0x15a0, 0x080c, 0x636c, 0x1588, 0xbe12, 0xbd16, 0x2b00, 0x004e,
+	0x00ce, 0x6012, 0x080c, 0xcc93, 0x080c, 0x1000, 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, 0x8ec7, 0x080c, 0x941c, 0x00fe, 0x009e, 0x00ce,
+	0x0005, 0x080c, 0xab6b, 0x006e, 0x0cc0, 0x004e, 0x00ce, 0x0cc8,
+	0x00c6, 0x7000, 0x908c, 0xff00, 0x9184, 0xf000, 0x810f, 0x9086,
+	0x2000, 0x1904, 0x8147, 0x9186, 0x0022, 0x15f0, 0x2001, 0x0111,
+	0x2004, 0x9005, 0x1904, 0x8149, 0x7030, 0x908e, 0x0400, 0x0904,
+	0x8149, 0x908e, 0x6000, 0x05e8, 0x908e, 0x5400, 0x05d0, 0x908e,
+	0x0300, 0x11d8, 0x2009, 0x1837, 0x210c, 0xd18c, 0x1590, 0xd1a4,
+	0x1580, 0x080c, 0x66f5, 0x0558, 0x68b0, 0x9084, 0x00ff, 0x7100,
+	0x918c, 0x00ff, 0x9106, 0x1518, 0x6880, 0x69b0, 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,
+	0x8057, 0x0128, 0x6004, 0x9086, 0x0002, 0x0118, 0x0000, 0x9006,
+	0x0010, 0x9085, 0x0001, 0x00ce, 0x0005, 0x0156, 0x0046, 0x0016,
+	0x0036, 0x7038, 0x2020, 0x8427, 0x94a4, 0x0007, 0xd484, 0x0148,
+	0x20a9, 0x0004, 0x2019, 0x1805, 0x2011, 0x027a, 0x080c, 0xbb13,
+	0x1178, 0xd48c, 0x0148, 0x20a9, 0x0004, 0x2019, 0x1801, 0x2011,
+	0x027e, 0x080c, 0xbb13, 0x1120, 0xd494, 0x0110, 0x9085, 0x0001,
+	0x003e, 0x001e, 0x004e, 0x015e, 0x0005, 0x0156, 0x0046, 0x0016,
+	0x0036, 0x7038, 0x2020, 0x8427, 0x94a4, 0x0007, 0xd484, 0x0148,
+	0x20a9, 0x0004, 0x2019, 0x1805, 0x2011, 0x0272, 0x080c, 0xbb13,
+	0x1178, 0xd48c, 0x0148, 0x20a9, 0x0004, 0x2019, 0x1801, 0x2011,
+	0x0276, 0x080c, 0xbb13, 0x1120, 0xd494, 0x0110, 0x9085, 0x0001,
+	0x003e, 0x001e, 0x004e, 0x015e, 0x0005, 0x00f6, 0x2079, 0x0200,
+	0x7800, 0xc0e5, 0xc0cc, 0x7802, 0x00fe, 0x0005, 0x00f6, 0x2079,
+	0x1800, 0x7834, 0xd084, 0x1130, 0x2079, 0x0200, 0x7800, 0x9085,
+	0x1200, 0x7802, 0x00fe, 0x0005, 0x00e6, 0x2071, 0x1800, 0x7034,
+	0xc084, 0x7036, 0x00ee, 0x0005, 0x2071, 0x19f8, 0x7003, 0x0003,
+	0x700f, 0x0361, 0x9006, 0x701a, 0x7072, 0x7012, 0x7017, 0x1cd0,
+	0x7007, 0x0000, 0x7026, 0x702b, 0xa012, 0x7032, 0x7037, 0xa080,
+	0x703f, 0xffff, 0x7042, 0x7047, 0x5356, 0x704a, 0x705b, 0x8323,
+	0x080c, 0x1019, 0x090c, 0x0dd5, 0x2900, 0x703a, 0xa867, 0x0003,
+	0xa86f, 0x0100, 0xa8ab, 0xdcb0, 0x0005, 0x2071, 0x19f8, 0x1d04,
+	0x8274, 0x2091, 0x6000, 0x700c, 0x8001, 0x700e, 0x1530, 0x2001,
+	0x013c, 0x2004, 0x9005, 0x190c, 0x8368, 0x2001, 0x1869, 0x2004,
+	0xd0c4, 0x0158, 0x3a00, 0xd08c, 0x1140, 0x20d1, 0x0000, 0x20d1,
+	0x0001, 0x20d1, 0x0000, 0x080c, 0x0dd5, 0x700f, 0x0361, 0x7007,
+	0x0001, 0x0126, 0x2091, 0x8000, 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, 0xa10e, 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, 0x829c, 0x829d,
+	0x82b9, 0x00e6, 0x2071, 0x19f8, 0x7018, 0x9005, 0x1120, 0x711a,
+	0x721e, 0x700b, 0x0009, 0x00ee, 0x0005, 0x00e6, 0x0006, 0x2071,
+	0x19f8, 0x701c, 0x9206, 0x1120, 0x701a, 0x701e, 0x7072, 0x7076,
+	0x000e, 0x00ee, 0x0005, 0x00e6, 0x2071, 0x19f8, 0xb888, 0x9102,
+	0x0208, 0xb98a, 0x00ee, 0x0005, 0x0005, 0x00b6, 0x7110, 0x080c,
+	0x63cd, 0x1168, 0xb888, 0x8001, 0x0250, 0xb88a, 0x1140, 0x0126,
+	0x2091, 0x8000, 0x0016, 0x080c, 0x941c, 0x001e, 0x012e, 0x8108,
+	0x9182, 0x0800, 0x0218, 0x900e, 0x7007, 0x0002, 0x7112, 0x00be,
+	0x0005, 0x7014, 0x2060, 0x0126, 0x2091, 0x8000, 0x6040, 0x9005,
+	0x0128, 0x8001, 0x6042, 0x1110, 0x080c, 0xcb24, 0x6018, 0x9005,
+	0x0540, 0x8001, 0x601a, 0x1528, 0x6120, 0x9186, 0x0003, 0x0148,
+	0x9186, 0x0006, 0x0130, 0x9186, 0x0009, 0x11c8, 0x611c, 0xd1c4,
+	0x1100, 0x6014, 0x2048, 0xa884, 0x908a, 0x199a, 0x0280, 0x9082,
+	0x1999, 0xa886, 0x908a, 0x199a, 0x0210, 0x2001, 0x1999, 0x8003,
+	0x800b, 0x810b, 0x9108, 0x611a, 0xa87c, 0xd0e4, 0x0110, 0x080c,
+	0xc53d, 0x012e, 0x9c88, 0x0018, 0x7116, 0x2001, 0x181a, 0x2004,
+	0x9102, 0x0220, 0x7017, 0x1cd0, 0x7007, 0x0000, 0x0005, 0x00e6,
+	0x2071, 0x19f8, 0x7027, 0x07d0, 0x7023, 0x0009, 0x00ee, 0x0005,
+	0x2001, 0x1a01, 0x2003, 0x0000, 0x0005, 0x00e6, 0x2071, 0x19f8,
+	0x7132, 0x702f, 0x0009, 0x00ee, 0x0005, 0x2011, 0x1a04, 0x2013,
+	0x0000, 0x0005, 0x00e6, 0x2071, 0x19f8, 0x711a, 0x721e, 0x700b,
+	0x0009, 0x00ee, 0x0005, 0x0086, 0x0026, 0x7054, 0x8000, 0x7056,
+	0x2001, 0x1a06, 0x2044, 0xa06c, 0x9086, 0x0000, 0x0150, 0x7068,
+	0xa09a, 0x7064, 0xa096, 0x7060, 0xa092, 0x705c, 0xa08e, 0x080c,
+	0x10e0, 0x002e, 0x008e, 0x0005, 0x0006, 0x0016, 0x0096, 0x00a6,
+	0x00b6, 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x0156, 0x080c, 0x81e5,
+	0x015e, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x00ae, 0x009e,
+	0x001e, 0x000e, 0x0005, 0x00e6, 0x2071, 0x19f8, 0x7172, 0x7276,
+	0x706f, 0x0009, 0x00ee, 0x0005, 0x00e6, 0x0006, 0x2071, 0x19f8,
+	0x7074, 0x9206, 0x1110, 0x7072, 0x7076, 0x000e, 0x00ee, 0x0005,
+	0x0016, 0x00c6, 0x2009, 0xfffc, 0x210d, 0x2061, 0x0100, 0x60f0,
+	0x9100, 0x60f3, 0x0000, 0x2009, 0xfffc, 0x200f, 0x1220, 0x8108,
+	0x2105, 0x8000, 0x200f, 0x00ce, 0x001e, 0x0005, 0x00c6, 0x2061,
+	0x1a6e, 0x00ce, 0x0005, 0x9184, 0x000f, 0x8003, 0x8003, 0x8003,
+	0x9080, 0x1a6e, 0x2060, 0x0005, 0xa884, 0x908a, 0x199a, 0x1638,
+	0x9005, 0x1150, 0x00c6, 0x2061, 0x1a6e, 0x6014, 0x00ce, 0x9005,
+	0x1130, 0x2001, 0x001e, 0x0018, 0x908e, 0xffff, 0x01b0, 0x8003,
+	0x800b, 0x810b, 0x9108, 0x611a, 0xa87c, 0x908c, 0x00c0, 0x918e,
+	0x00c0, 0x0904, 0x8416, 0xd0b4, 0x1168, 0xd0bc, 0x1904, 0x83ef,
+	0x2009, 0x0006, 0x080c, 0x8443, 0x0005, 0x900e, 0x0c60, 0x2001,
+	0x1999, 0x08b0, 0xd0fc, 0x0160, 0x908c, 0x0003, 0x0120, 0x918e,
+	0x0003, 0x1904, 0x843d, 0x908c, 0x2020, 0x918e, 0x2020, 0x01a8,
+	0x6024, 0xd0d4, 0x11e8, 0x2009, 0x1869, 0x2104, 0xd084, 0x1138,
+	0x87ff, 0x1120, 0x2009, 0x0043, 0x0804, 0xabe6, 0x0005, 0x87ff,
+	0x1de8, 0x2009, 0x0042, 0x0804, 0xabe6, 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, 0x843d,
+	0x908c, 0x2020, 0x918e, 0x2020, 0x0170, 0x0076, 0x00f6, 0x2c78,
+	0x080c, 0x1689, 0x00fe, 0x007e, 0x87ff, 0x1120, 0x2009, 0x0042,
+	0x080c, 0xabe6, 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, 0xabe6,
+	0x0005, 0x00b9, 0x0ce8, 0x87ff, 0x1dd8, 0x2009, 0x0043, 0x080c,
+	0xabe6, 0x0cb0, 0x6110, 0x00b6, 0x2158, 0xb900, 0x00be, 0xd1ac,
+	0x0d20, 0x6124, 0xc1cd, 0x6126, 0x0c00, 0x2009, 0x0004, 0x0019,
+	0x0005, 0x2009, 0x0001, 0x0096, 0x080c, 0xc825, 0x0518, 0x6014,
+	0x2048, 0xa982, 0xa800, 0x6016, 0x9186, 0x0001, 0x1188, 0xa97c,
+	0x918c, 0x8100, 0x918e, 0x8100, 0x1158, 0x00c6, 0x2061, 0x1a6e,
+	0x6200, 0xd28c, 0x1120, 0x6204, 0x8210, 0x0208, 0x6206, 0x00ce,
+	0x080c, 0x6881, 0x6014, 0x904d, 0x0076, 0x2039, 0x0000, 0x190c,
+	0x838c, 0x007e, 0x009e, 0x0005, 0x0156, 0x00c6, 0x2061, 0x1a6e,
+	0x6000, 0x81ff, 0x0110, 0x9205, 0x0008, 0x9204, 0x6002, 0x00ce,
+	0x015e, 0x0005, 0x6800, 0xd08c, 0x1138, 0x6808, 0x9005, 0x0120,
+	0x8001, 0x680a, 0x9085, 0x0001, 0x0005, 0x2071, 0x1923, 0x7003,
+	0x0006, 0x7007, 0x0000, 0x700f, 0x0000, 0x7013, 0x0001, 0x080c,
+	0x1019, 0x090c, 0x0dd5, 0xa867, 0x0006, 0xa86b, 0x0001, 0xa8ab,
+	0xdcb0, 0xa89f, 0x0000, 0x2900, 0x702e, 0x7033, 0x0000, 0x0005,
+	0x0096, 0x00e6, 0x2071, 0x1923, 0x702c, 0x2048, 0x6a2c, 0x721e,
+	0x6b30, 0x7322, 0x6834, 0x7026, 0xa896, 0x6838, 0x702a, 0xa89a,
+	0x6824, 0x7016, 0x683c, 0x701a, 0x2009, 0x0028, 0x200a, 0x9005,
+	0x0148, 0x900e, 0x9188, 0x000c, 0x8001, 0x1de0, 0x2100, 0x9210,
+	0x1208, 0x8318, 0xaa8e, 0xab92, 0x7010, 0xd084, 0x0178, 0xc084,
+	0x7007, 0x0001, 0x700f, 0x0000, 0x0006, 0x2009, 0x181d, 0x2104,
+	0x9082, 0x0007, 0x2009, 0x1abf, 0x200a, 0x000e, 0xc095, 0x7012,
+	0x2008, 0x2001, 0x003b, 0x080c, 0x15d1, 0x9006, 0x2071, 0x193c,
+	0x7002, 0x7006, 0x702a, 0x00ee, 0x009e, 0x0005, 0x00e6, 0x0126,
+	0x0156, 0x2091, 0x8000, 0x2071, 0x1800, 0x7154, 0x2001, 0x0008,
+	0x910a, 0x0638, 0x2001, 0x187d, 0x20ac, 0x9006, 0x9080, 0x0008,
+	0x1f04, 0x84f6, 0x71c0, 0x9102, 0x02e0, 0x2071, 0x1877, 0x20a9,
+	0x0007, 0x00c6, 0x080c, 0xab15, 0x6023, 0x0009, 0x6003, 0x0004,
+	0x601f, 0x0101, 0x0089, 0x0126, 0x2091, 0x8000, 0x080c, 0x867c,
+	0x012e, 0x1f04, 0x8502, 0x9006, 0x00ce, 0x015e, 0x012e, 0x00ee,
+	0x0005, 0x9085, 0x0001, 0x0cc8, 0x00e6, 0x00b6, 0x0096, 0x0086,
+	0x0056, 0x0046, 0x0026, 0x7118, 0x720c, 0x7620, 0x7004, 0xd084,
+	0x1128, 0x2021, 0x0024, 0x2029, 0x0002, 0x0020, 0x2021, 0x002c,
+	0x2029, 0x000a, 0x080c, 0x1000, 0x090c, 0x0dd5, 0x2900, 0x6016,
+	0x2058, 0xac66, 0x9006, 0xa802, 0xa806, 0xa86a, 0xa87a, 0xa8aa,
+	0xa887, 0x0005, 0xa87f, 0x0020, 0x7008, 0xa89a, 0x7010, 0xa89e,
+	0xae8a, 0xa8af, 0xffff, 0xa8b3, 0x0000, 0x8109, 0x0160, 0x080c,
+	0x1000, 0x090c, 0x0dd5, 0xad66, 0x2b00, 0xa802, 0x2900, 0xb806,
+	0x2058, 0x8109, 0x1da0, 0x002e, 0x004e, 0x005e, 0x008e, 0x009e,
+	0x00be, 0x00ee, 0x0005, 0x2079, 0x0000, 0x2071, 0x1923, 0x7004,
+	0x004b, 0x700c, 0x0002, 0x856e, 0x8567, 0x8567, 0x0005, 0x8578,
+	0x85d9, 0x85d9, 0x85d9, 0x85da, 0x85eb, 0x85eb, 0x700c, 0x0cba,
+	0x0126, 0x2091, 0x8000, 0x78a0, 0x79a0, 0x9106, 0x0128, 0x78a0,
+	0x79a0, 0x9106, 0x1904, 0x85cc, 0x2001, 0x0005, 0x2004, 0xd0bc,
+	0x0130, 0x2011, 0x0004, 0x2204, 0xc0c5, 0x2012, 0x0ca8, 0x012e,
+	0x7018, 0x910a, 0x1130, 0x7030, 0x9005, 0x05a8, 0x080c, 0x861a,
+	0x0490, 0x1210, 0x7114, 0x910a, 0x9192, 0x000a, 0x0210, 0x2009,
+	0x000a, 0x2001, 0x1888, 0x2014, 0x2001, 0x1935, 0x2004, 0x9100,
+	0x9202, 0x0e48, 0x080c, 0x8766, 0x2200, 0x9102, 0x0208, 0x2208,
+	0x0096, 0x702c, 0x2048, 0xa873, 0x0001, 0xa976, 0x080c, 0x886f,
+	0x2100, 0xa87e, 0xa86f, 0x0000, 0x009e, 0x0126, 0x2091, 0x8000,
+	0x2009, 0x1a16, 0x2104, 0xc085, 0x200a, 0x700f, 0x0002, 0x012e,
+	0x080c, 0x10ff, 0x1de8, 0x0005, 0x2001, 0x0005, 0x2004, 0xd0bc,
+	0x0130, 0x2011, 0x0004, 0x2204, 0xc0c5, 0x2012, 0x0ca8, 0x012e,
+	0x0005, 0x0005, 0x700c, 0x0002, 0x85df, 0x85e2, 0x85e1, 0x080c,
+	0x8576, 0x0005, 0x8001, 0x700e, 0x0096, 0x702c, 0x2048, 0xa974,
+	0x009e, 0x0011, 0x0ca0, 0x0005, 0x0096, 0x702c, 0x2048, 0x7018,
+	0x9100, 0x7214, 0x921a, 0x1130, 0x701c, 0xa88e, 0x7020, 0xa892,
+	0x9006, 0x0068, 0x0006, 0x080c, 0x886f, 0x2100, 0xaa8c, 0x9210,
+	0xaa8e, 0x1220, 0xa890, 0x9081, 0x0000, 0xa892, 0x000e, 0x009e,
+	0x2f08, 0x9188, 0x0028, 0x200a, 0x701a, 0x0005, 0x00e6, 0x2071,
+	0x1923, 0x700c, 0x0002, 0x8618, 0x8618, 0x8616, 0x700f, 0x0001,
+	0x00ee, 0x0005, 0x0126, 0x2091, 0x8000, 0x7030, 0x9005, 0x0508,
+	0x2078, 0x7814, 0x2048, 0xae88, 0x00b6, 0x2059, 0x0000, 0x080c,
+	0x8685, 0x00be, 0x01b0, 0x00e6, 0x2071, 0x193c, 0x080c, 0x86cc,
+	0x00ee, 0x0178, 0x0096, 0x080c, 0x1019, 0x2900, 0x009e, 0x0148,
+	0xa8aa, 0x04b9, 0x0041, 0x2001, 0x1946, 0x2003, 0x0000, 0x012e,
+	0x08c8, 0x012e, 0x0005, 0x00d6, 0x00c6, 0x0086, 0x00a6, 0x2940,
+	0x2650, 0x2600, 0x9005, 0x0180, 0xa864, 0x9084, 0x000f, 0x2068,
+	0x9d88, 0x1f4a, 0x2165, 0x0056, 0x2029, 0x0000, 0x080c, 0x87f4,
+	0x080c, 0x1f08, 0x1dd8, 0x005e, 0x00ae, 0x2001, 0x187f, 0x2004,
+	0xa88a, 0x080c, 0x1689, 0x781f, 0x0101, 0x7813, 0x0000, 0x0126,
+	0x2091, 0x8000, 0x080c, 0x86db, 0x012e, 0x008e, 0x00ce, 0x00de,
+	0x0005, 0x7030, 0x9005, 0x0138, 0x2078, 0x780c, 0x7032, 0x2001,
+	0x1946, 0x2003, 0x0001, 0x0005, 0x00e6, 0x2071, 0x1923, 0x7030,
+	0x600e, 0x2c00, 0x7032, 0x00ee, 0x0005, 0x00d6, 0x00c6, 0x0026,
+	0x9b80, 0x894e, 0x2005, 0x906d, 0x090c, 0x0dd5, 0x9b80, 0x8946,
+	0x2005, 0x9065, 0x090c, 0x0dd5, 0x6114, 0x2600, 0x9102, 0x0248,
+	0x6828, 0x9102, 0x02f0, 0x9085, 0x0001, 0x002e, 0x00ce, 0x00de,
+	0x0005, 0x6804, 0xd094, 0x0148, 0x6854, 0xd084, 0x1178, 0xc085,
+	0x6856, 0x2011, 0x8026, 0x080c, 0x48fb, 0x684c, 0x0096, 0x904d,
+	0x090c, 0x0dd5, 0xa804, 0x8000, 0xa806, 0x009e, 0x9006, 0x2030,
+	0x0c20, 0x6854, 0xd08c, 0x1d08, 0xc08d, 0x6856, 0x2011, 0x8025,
+	0x080c, 0x48fb, 0x684c, 0x0096, 0x904d, 0x090c, 0x0dd5, 0xa800,
+	0x8000, 0xa802, 0x009e, 0x0888, 0x7000, 0x2019, 0x0008, 0x8319,
+	0x7104, 0x9102, 0x1118, 0x2300, 0x9005, 0x0020, 0x0210, 0x9302,
+	0x0008, 0x8002, 0x0005, 0x00d6, 0x7814, 0x9005, 0x090c, 0x0dd5,
+	0x781c, 0x9084, 0x0101, 0x9086, 0x0101, 0x190c, 0x0dd5, 0x2069,
+	0x193c, 0x6804, 0x9080, 0x193e, 0x2f08, 0x2102, 0x6904, 0x8108,
+	0x9182, 0x0008, 0x0208, 0x900e, 0x6906, 0x9180, 0x193e, 0x2003,
+	0x0000, 0x00de, 0x0005, 0x0096, 0x00c6, 0x2060, 0x6014, 0x2048,
+	0xa8a8, 0x0096, 0x2048, 0x9005, 0x190c, 0x1032, 0x009e, 0xa8ab,
+	0x0000, 0x080c, 0x0fb2, 0x080c, 0xab6b, 0x00ce, 0x009e, 0x0005,
+	0x6020, 0x9086, 0x0009, 0x1128, 0x601c, 0xd0c4, 0x0110, 0x9006,
+	0x0005, 0x9085, 0x0001, 0x0005, 0x6000, 0x9086, 0x0000, 0x0178,
+	0x6010, 0x9005, 0x0150, 0x00b6, 0x2058, 0x080c, 0x8a81, 0x00be,
+	0x6013, 0x0000, 0x601b, 0x0000, 0x0010, 0x2c00, 0x0861, 0x0005,
+	0x2009, 0x1927, 0x210c, 0xd194, 0x0005, 0x00e6, 0x2071, 0x1923,
+	0x7110, 0xc194, 0xd19c, 0x1118, 0xc185, 0x7007, 0x0000, 0x7112,
+	0x2001, 0x003b, 0x080c, 0x15d1, 0x00ee, 0x0005, 0x0096, 0x00d6,
+	0x9006, 0x7006, 0x700e, 0x701a, 0x701e, 0x7022, 0x7016, 0x702a,
+	0x7026, 0x702f, 0x0000, 0x080c, 0x88ce, 0x0170, 0x080c, 0x8903,
+	0x0158, 0x2900, 0x7002, 0x700a, 0x701a, 0x7013, 0x0001, 0x701f,
+	0x000a, 0x00de, 0x009e, 0x0005, 0x900e, 0x0cd8, 0x00e6, 0x0096,
+	0x0086, 0x00d6, 0x00c6, 0x2071, 0x1930, 0x721c, 0x2100, 0x9202,
+	0x1618, 0x080c, 0x8903, 0x090c, 0x0dd5, 0x7018, 0x9005, 0x1160,
+	0x2900, 0x7002, 0x700a, 0x701a, 0x9006, 0x7006, 0x700e, 0xa806,
+	0xa802, 0x7012, 0x701e, 0x0038, 0x2040, 0xa806, 0x2900, 0xa002,
+	0x701a, 0xa803, 0x0000, 0x7010, 0x8000, 0x7012, 0x701c, 0x9080,
+	0x000a, 0x701e, 0x721c, 0x08d0, 0x721c, 0x00ce, 0x00de, 0x008e,
+	0x009e, 0x00ee, 0x0005, 0x0096, 0x0156, 0x0136, 0x0146, 0x00e6,
+	0x0126, 0x2091, 0x8000, 0x2071, 0x1930, 0x7300, 0x831f, 0x831e,
+	0x831e, 0x9384, 0x003f, 0x20e8, 0x939c, 0xffc0, 0x9398, 0x0003,
+	0x7104, 0x080c, 0x886f, 0x810c, 0x2100, 0x9318, 0x8003, 0x2228,
+	0x2021, 0x0078, 0x9402, 0x9532, 0x0208, 0x2028, 0x2500, 0x8004,
+	0x20a8, 0x23a0, 0xa001, 0xa001, 0x4005, 0x2508, 0x080c, 0x8878,
+	0x2130, 0x7014, 0x9600, 0x7016, 0x2600, 0x711c, 0x9102, 0x701e,
+	0x7004, 0x9600, 0x2008, 0x9082, 0x000a, 0x1190, 0x7000, 0x2048,
+	0xa800, 0x9005, 0x1148, 0x2009, 0x0001, 0x0026, 0x080c, 0x8766,
+	0x002e, 0x7000, 0x2048, 0xa800, 0x7002, 0x7007, 0x0000, 0x0008,
+	0x7106, 0x2500, 0x9212, 0x1904, 0x87a5, 0x012e, 0x00ee, 0x014e,
+	0x013e, 0x015e, 0x009e, 0x0005, 0x0016, 0x0026, 0x00e6, 0x0126,
+	0x2091, 0x8000, 0x9580, 0x8946, 0x2005, 0x9075, 0x090c, 0x0dd5,
+	0x080c, 0x884a, 0x012e, 0x9580, 0x8942, 0x2005, 0x9075, 0x090c,
+	0x0dd5, 0x0156, 0x0136, 0x01c6, 0x0146, 0x01d6, 0x831f, 0x831e,
+	0x831e, 0x9384, 0x003f, 0x20e0, 0x9384, 0xffc0, 0x9100, 0x2098,
+	0xa860, 0x20e8, 0xa95c, 0x2c05, 0x9100, 0x20a0, 0x20a9, 0x0002,
+	0x4003, 0x2e0c, 0x2d00, 0x0002, 0x8834, 0x8834, 0x8836, 0x8834,
+	0x8836, 0x8834, 0x8834, 0x8834, 0x8834, 0x8834, 0x883c, 0x8834,
+	0x883c, 0x8834, 0x8834, 0x8834, 0x080c, 0x0dd5, 0x4104, 0x20a9,
+	0x0002, 0x4002, 0x4003, 0x0028, 0x20a9, 0x0002, 0x4003, 0x4104,
+	0x4003, 0x01de, 0x014e, 0x01ce, 0x013e, 0x015e, 0x00ee, 0x002e,
+	0x001e, 0x0005, 0x0096, 0x7014, 0x8001, 0x7016, 0x710c, 0x2110,
+	0x00f1, 0x810c, 0x9188, 0x0003, 0x7308, 0x8210, 0x9282, 0x000a,
+	0x1198, 0x7008, 0x2048, 0xa800, 0x9005, 0x0158, 0x0006, 0x080c,
+	0x8912, 0x009e, 0xa807, 0x0000, 0x2900, 0x700a, 0x7010, 0x8001,
+	0x7012, 0x700f, 0x0000, 0x0008, 0x720e, 0x009e, 0x0005, 0x0006,
+	0x810b, 0x810b, 0x2100, 0x810b, 0x9100, 0x2008, 0x000e, 0x0005,
+	0x0006, 0x0026, 0x2100, 0x9005, 0x0158, 0x9092, 0x000c, 0x0240,
+	0x900e, 0x8108, 0x9082, 0x000c, 0x1de0, 0x002e, 0x000e, 0x0005,
+	0x900e, 0x0cd8, 0x2d00, 0x90b8, 0x0008, 0x690c, 0x6810, 0x2019,
+	0x0001, 0x2031, 0x88b8, 0x9112, 0x0220, 0x0118, 0x8318, 0x2208,
+	0x0cd0, 0x6808, 0x9005, 0x0108, 0x8318, 0x233a, 0x6804, 0xd084,
+	0x2300, 0x2021, 0x0001, 0x1150, 0x9082, 0x0003, 0x0967, 0x0a67,
+	0x8420, 0x9082, 0x0007, 0x0967, 0x0a67, 0x0cd0, 0x9082, 0x0002,
+	0x0967, 0x0a67, 0x8420, 0x9082, 0x0005, 0x0967, 0x0a67, 0x0cd0,
+	0x6c1a, 0x2d00, 0x90b8, 0x0007, 0x00e6, 0x2071, 0x1800, 0x7128,
+	0x6810, 0x2019, 0x0001, 0x910a, 0x0118, 0x0210, 0x8318, 0x0cd8,
+	0x2031, 0x88cb, 0x0870, 0x6c16, 0x00ee, 0x0005, 0x0096, 0x0046,
+	0x0126, 0x2091, 0x8000, 0x2b00, 0x9080, 0x894a, 0x2005, 0x9005,
+	0x090c, 0x0dd5, 0x2004, 0x90a0, 0x000a, 0x080c, 0x1019, 0x01d0,
+	0x2900, 0x7026, 0xa803, 0x0000, 0xa807, 0x0000, 0x080c, 0x1019,
+	0x0188, 0x7024, 0xa802, 0xa807, 0x0000, 0x2900, 0x7026, 0x94a2,
+	0x000a, 0x0110, 0x0208, 0x0c90, 0x9085, 0x0001, 0x012e, 0x004e,
+	0x009e, 0x0005, 0x7024, 0x9005, 0x0dc8, 0x2048, 0xac00, 0x080c,
+	0x1032, 0x2400, 0x0cc0, 0x0126, 0x2091, 0x8000, 0x7024, 0x2048,
+	0x9005, 0x0130, 0xa800, 0x7026, 0xa803, 0x0000, 0xa807, 0x0000,
+	0x012e, 0x0005, 0x0126, 0x2091, 0x8000, 0x7024, 0xa802, 0x2900,
+	0x7026, 0x012e, 0x0005, 0x0096, 0x9e80, 0x0009, 0x2004, 0x9005,
+	0x0138, 0x2048, 0xa800, 0x0006, 0x080c, 0x1032, 0x000e, 0x0cb8,
+	0x009e, 0x0005, 0x0096, 0x7008, 0x9005, 0x0138, 0x2048, 0xa800,
+	0x0006, 0x080c, 0x1032, 0x000e, 0x0cb8, 0x9006, 0x7002, 0x700a,
+	0x7006, 0x700e, 0x701a, 0x701e, 0x7022, 0x702a, 0x7026, 0x702e,
+	0x009e, 0x0005, 0x1a62, 0x0000, 0x0000, 0x0000, 0x1930, 0x0000,
+	0x0000, 0x0000, 0x1888, 0x0000, 0x0000, 0x0000, 0x1877, 0x0000,
+	0x0000, 0x0000, 0x00e6, 0x00c6, 0x00b6, 0x00a6, 0xa8a8, 0x2040,
+	0x2071, 0x1877, 0x080c, 0x8a6c, 0xa067, 0x0023, 0x6010, 0x905d,
+	0x0904, 0x8a41, 0xb814, 0xa06e, 0xb910, 0xa172, 0xb9a0, 0xa176,
+	0x2001, 0x0003, 0xa07e, 0xa834, 0xa082, 0xa07b, 0x0000, 0xa898,
+	0x9005, 0x0118, 0xa078, 0xc085, 0xa07a, 0x2858, 0x2031, 0x0018,
+	0xa068, 0x908a, 0x0019, 0x1a0c, 0x0dd5, 0x2020, 0x2050, 0x2940,
+	0xa864, 0x90bc, 0x00ff, 0x908c, 0x000f, 0x91e0, 0x1f4a, 0x2c65,
+	0x9786, 0x0024, 0x2c05, 0x1590, 0x908a, 0x0036, 0x1a0c, 0x0dd5,
+	0x9082, 0x001b, 0x0002, 0x89ae, 0x89ae, 0x89b0, 0x89ae, 0x89ae,
+	0x89ae, 0x89b2, 0x89ae, 0x89ae, 0x89ae, 0x89b4, 0x89ae, 0x89ae,
+	0x89ae, 0x89b6, 0x89ae, 0x89ae, 0x89ae, 0x89b8, 0x89ae, 0x89ae,
+	0x89ae, 0x89ba, 0x89ae, 0x89ae, 0x89ae, 0x89bc, 0x080c, 0x0dd5,
+	0xa180, 0x04b8, 0xa190, 0x04a8, 0xa1a0, 0x0498, 0xa1b0, 0x0488,
+	0xa1c0, 0x0478, 0xa1d0, 0x0468, 0xa1e0, 0x0458, 0x908a, 0x0034,
+	0x1a0c, 0x0dd5, 0x9082, 0x001b, 0x0002, 0x89e0, 0x89de, 0x89de,
+	0x89de, 0x89de, 0x89de, 0x89e2, 0x89de, 0x89de, 0x89de, 0x89de,
+	0x89de, 0x89e4, 0x89de, 0x89de, 0x89de, 0x89de, 0x89de, 0x89e6,
+	0x89de, 0x89de, 0x89de, 0x89de, 0x89de, 0x89e8, 0x080c, 0x0dd5,
+	0xa180, 0x0038, 0xa198, 0x0028, 0xa1b0, 0x0018, 0xa1c8, 0x0008,
+	0xa1e0, 0x2600, 0x0002, 0x8a04, 0x8a06, 0x8a08, 0x8a0a, 0x8a0c,
+	0x8a0e, 0x8a10, 0x8a12, 0x8a14, 0x8a16, 0x8a18, 0x8a1a, 0x8a1c,
+	0x8a1e, 0x8a20, 0x8a22, 0x8a24, 0x8a26, 0x8a28, 0x8a2a, 0x8a2c,
+	0x8a2e, 0x8a30, 0x8a32, 0x8a34, 0x080c, 0x0dd5, 0xb9e2, 0x0468,
+	0xb9de, 0x0458, 0xb9da, 0x0448, 0xb9d6, 0x0438, 0xb9d2, 0x0428,
+	0xb9ce, 0x0418, 0xb9ca, 0x0408, 0xb9c6, 0x00f8, 0xb9c2, 0x00e8,
+	0xb9be, 0x00d8, 0xb9ba, 0x00c8, 0xb9b6, 0x00b8, 0xb9b2, 0x00a8,
+	0xb9ae, 0x0098, 0xb9aa, 0x0088, 0xb9a6, 0x0078, 0xb9a2, 0x0068,
+	0xb99e, 0x0058, 0xb99a, 0x0048, 0xb996, 0x0038, 0xb992, 0x0028,
+	0xb98e, 0x0018, 0xb98a, 0x0008, 0xb986, 0x8631, 0x8421, 0x0120,
+	0x080c, 0x1f08, 0x0804, 0x8988, 0x00ae, 0x00be, 0x00ce, 0x00ee,
+	0x0005, 0xa86c, 0xa06e, 0xa870, 0xa072, 0xa077, 0x00ff, 0x9006,
+	0x0804, 0x896a, 0x0006, 0x0016, 0x00b6, 0x6010, 0x2058, 0xb810,
+	0x9005, 0x01b0, 0x2001, 0x1924, 0x2004, 0x9005, 0x0188, 0x2001,
+	0x1800, 0x2004, 0x9086, 0x0003, 0x1158, 0x0036, 0x0046, 0xbba0,
+	0x2021, 0x0004, 0x2011, 0x8014, 0x080c, 0x48fb, 0x004e, 0x003e,
+	0x00be, 0x001e, 0x000e, 0x0005, 0x9016, 0x710c, 0xa834, 0x910a,
+	0xa936, 0x7008, 0x9005, 0x0120, 0x8210, 0x910a, 0x0238, 0x0130,
+	0x7010, 0x8210, 0x910a, 0x0210, 0x0108, 0x0cd8, 0xaa8a, 0xa26a,
+	0x0005, 0x00f6, 0x00d6, 0x0036, 0x2079, 0x0300, 0x781b, 0x0200,
+	0x7818, 0xd094, 0x1dd8, 0x781b, 0x0202, 0xa001, 0xa001, 0x7818,
+	0xd094, 0x1da0, 0xb8ac, 0x9005, 0x01b8, 0x2068, 0x2079, 0x0000,
+	0x2c08, 0x911e, 0x1118, 0x680c, 0xb8ae, 0x0060, 0x9106, 0x0140,
+	0x2d00, 0x2078, 0x680c, 0x9005, 0x090c, 0x0dd5, 0x2068, 0x0cb0,
+	0x6b0c, 0x7b0e, 0x600f, 0x0000, 0x2079, 0x0300, 0x781b, 0x0200,
+	0x003e, 0x00de, 0x00fe, 0x0005, 0x00e6, 0x00d6, 0x0096, 0x00c6,
+	0x0036, 0x0126, 0x2091, 0x8000, 0x0156, 0x20a9, 0x01ff, 0x2071,
+	0x0300, 0x701b, 0x0200, 0x7018, 0xd094, 0x0110, 0x1f04, 0x8ac1,
+	0x701b, 0x0202, 0xa001, 0xa001, 0x7018, 0xd094, 0x1d90, 0xb8ac,
+	0x9005, 0x01d0, 0x2060, 0x600c, 0xb8ae, 0x6003, 0x0004, 0x601b,
+	0x0000, 0x6013, 0x0000, 0x601f, 0x0101, 0x6014, 0x2048, 0xa88b,
+	0x0000, 0xa8a8, 0xa8ab, 0x0000, 0x904d, 0x090c, 0x0dd5, 0x080c,
+	0x1032, 0x080c, 0x867c, 0x0c18, 0x2071, 0x0300, 0x701b, 0x0200,
+	0x015e, 0x012e, 0x003e, 0x00ce, 0x009e, 0x00de, 0x00ee, 0x0005,
+	0x00c6, 0x00b6, 0x0016, 0x0006, 0x0156, 0x080c, 0x26f0, 0x015e,
+	0x11b0, 0x080c, 0x636c, 0x190c, 0x0dd5, 0x000e, 0x001e, 0xb912,
+	0xb816, 0x080c, 0xab15, 0x0140, 0x2b00, 0x6012, 0x6023, 0x0001,
+	0x2009, 0x0001, 0x080c, 0xabe6, 0x00be, 0x00ce, 0x0005, 0x000e,
+	0x001e, 0x0cd0, 0x0066, 0x6000, 0x90b2, 0x0016, 0x1a0c, 0x0dd5,
+	0x0013, 0x006e, 0x0005, 0x8b33, 0x8b33, 0x8b33, 0x8b35, 0x8b86,
+	0x8b33, 0x8b33, 0x8b33, 0x8be9, 0x8b33, 0x8c26, 0x8b33, 0x8b33,
+	0x8b33, 0x8b33, 0x8b33, 0x080c, 0x0dd5, 0x9182, 0x0040, 0x0002,
+	0x8b48, 0x8b48, 0x8b48, 0x8b48, 0x8b48, 0x8b48, 0x8b48, 0x8b48,
+	0x8b48, 0x8b4a, 0x8b5f, 0x8b48, 0x8b48, 0x8b48, 0x8b48, 0x8b72,
+	0x080c, 0x0dd5, 0x0096, 0x080c, 0x93cc, 0x080c, 0x9548, 0x6114,
+	0x2148, 0xa87b, 0x0000, 0x6010, 0x00b6, 0x2058, 0xb8bb, 0x0500,
+	0x00be, 0x080c, 0x684c, 0x080c, 0xab6b, 0x009e, 0x0005, 0x080c,
+	0x93cc, 0x00d6, 0x6114, 0x080c, 0xc825, 0x0130, 0x0096, 0x6114,
+	0x2148, 0x080c, 0x6a46, 0x009e, 0x00de, 0x080c, 0xab6b, 0x080c,
+	0x9548, 0x0005, 0x080c, 0x93cc, 0x080c, 0x306e, 0x6114, 0x0096,
+	0x2148, 0x080c, 0xc825, 0x0120, 0xa87b, 0x0029, 0x080c, 0x6a46,
+	0x009e, 0x080c, 0xab6b, 0x080c, 0x9548, 0x0005, 0x601b, 0x0000,
+	0x9182, 0x0040, 0x0096, 0x0002, 0x8ba1, 0x8ba1, 0x8ba1, 0x8ba1,
+	0x8ba1, 0x8ba1, 0x8ba1, 0x8ba1, 0x8ba3, 0x8ba1, 0x8ba1, 0x8ba1,
+	0x8be5, 0x8ba1, 0x8ba1, 0x8ba1, 0x8ba1, 0x8ba1, 0x8ba1, 0x8ba9,
+	0x8ba1, 0x080c, 0x0dd5, 0x6114, 0x2148, 0xa938, 0x918e, 0xffff,
+	0x05e0, 0x00e6, 0x6114, 0x2148, 0x080c, 0x8952, 0x0096, 0xa8a8,
+	0x2048, 0x080c, 0x67e4, 0x009e, 0xa8ab, 0x0000, 0x6010, 0x9005,
+	0x0128, 0x00b6, 0x2058, 0x080c, 0x8a81, 0x00be, 0xae88, 0x00b6,
+	0x2059, 0x0000, 0x080c, 0x8685, 0x00be, 0x01e0, 0x2071, 0x193c,
+	0x080c, 0x86cc, 0x01b8, 0x9086, 0x0001, 0x1128, 0x2001, 0x1946,
+	0x2004, 0x9005, 0x1178, 0x0096, 0x080c, 0x1000, 0x2900, 0x009e,
+	0x0148, 0xa8aa, 0x00f6, 0x2c78, 0x080c, 0x8643, 0x00fe, 0x00ee,
+	0x009e, 0x0005, 0x080c, 0x867c, 0x0cd0, 0x080c, 0x8c93, 0x009e,
+	0x0005, 0x9182, 0x0040, 0x0096, 0x0002, 0x8bfd, 0x8bfd, 0x8bfd,
+	0x8bff, 0x8bfd, 0x8bfd, 0x8bfd, 0x8c24, 0x8bfd, 0x8bfd, 0x8bfd,
+	0x8bfd, 0x8bfd, 0x8bfd, 0x8bfd, 0x8bfd, 0x080c, 0x0dd5, 0x6003,
+	0x0003, 0x6106, 0x6014, 0x2048, 0xa8ac, 0xa846, 0xa8b0, 0xa84a,
+	0xa837, 0x0000, 0xa83b, 0x0000, 0xa884, 0x9092, 0x199a, 0x0210,
+	0x2001, 0x1999, 0x8003, 0x8013, 0x8213, 0x9210, 0x621a, 0x2c10,
+	0x080c, 0x1b03, 0x080c, 0x8ee4, 0x0126, 0x2091, 0x8000, 0x080c,
+	0x9548, 0x012e, 0x009e, 0x0005, 0x080c, 0x0dd5, 0x080c, 0x93cc,
+	0x080c, 0x9548, 0x6114, 0x2148, 0xa87b, 0x0000, 0x6010, 0x00b6,
+	0x2058, 0xb8bb, 0x0500, 0x00be, 0x080c, 0x6a46, 0x080c, 0xab6b,
+	0x009e, 0x0005, 0x6000, 0x908a, 0x0016, 0x1a0c, 0x0dd5, 0x0096,
+	0x0013, 0x009e, 0x0005, 0x8c53, 0x8c53, 0x8c53, 0x8c55, 0x8c66,
+	0x8c53, 0x8c53, 0x8c53, 0x8c53, 0x8c53, 0x8c53, 0x8c53, 0x8c53,
+	0x8c53, 0x8c53, 0x8c53, 0x080c, 0x0dd5, 0x080c, 0xa4d6, 0x6114,
+	0x2148, 0xa87b, 0x0006, 0x6010, 0x00b6, 0x2058, 0xb8bb, 0x0500,
+	0x00be, 0x080c, 0x6a46, 0x080c, 0xab6b, 0x0005, 0x0461, 0x0005,
+	0x6000, 0x908a, 0x0016, 0x1a0c, 0x0dd5, 0x0096, 0x0013, 0x009e,
+	0x0005, 0x8c81, 0x8c81, 0x8c81, 0x8c83, 0x8c93, 0x8c81, 0x8c81,
+	0x8c81, 0x8c81, 0x8c81, 0x8c81, 0x8c81, 0x8c81, 0x8c81, 0x8c81,
+	0x8c81, 0x080c, 0x0dd5, 0x0036, 0x00e6, 0x2071, 0x19e5, 0x703c,
+	0x9c06, 0x1120, 0x2019, 0x0000, 0x080c, 0xa2ac, 0x080c, 0xa4d6,
+	0x00ee, 0x003e, 0x0005, 0x00f6, 0x00e6, 0x601b, 0x0000, 0x6014,
+	0x2048, 0x6010, 0x9005, 0x0128, 0x00b6, 0x2058, 0x080c, 0x8a81,
+	0x00be, 0x2071, 0x193c, 0x080c, 0x86cc, 0x0160, 0x2001, 0x187f,
+	0x2004, 0xa88a, 0x2031, 0x0000, 0x2c78, 0x080c, 0x8643, 0x00ee,
+	0x00fe, 0x0005, 0x0096, 0xa88b, 0x0000, 0xa8a8, 0x2048, 0x080c,
+	0x1032, 0x009e, 0xa8ab, 0x0000, 0x080c, 0x867c, 0x0c80, 0x0000,
+	0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+	0x187a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 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,
+	0x8cd8, 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,
+	0x1f04, 0x8d02, 0x0028, 0x911a, 0x2308, 0x8210, 0x1f04, 0x8d02,
 	0x0006, 0x3200, 0x9084, 0xefff, 0x2080, 0x000e, 0x015e, 0x007e,
 	0x012e, 0x0005, 0x0006, 0x3200, 0x9085, 0x1000, 0x0ca8, 0x0126,
-	0x2091, 0x2800, 0x2079, 0x19b6, 0x012e, 0x00d6, 0x2069, 0x19b6,
+	0x2091, 0x2800, 0x2079, 0x19e5, 0x012e, 0x00d6, 0x2069, 0x19e5,
 	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,
+	0x0200, 0x080c, 0xa82b, 0x0401, 0x080c, 0xa816, 0x00e9, 0x080c,
+	0xa819, 0x00d1, 0x080c, 0xa81c, 0x00b9, 0x080c, 0xa81f, 0x00a1,
+	0x080c, 0xa822, 0x0089, 0x080c, 0xa825, 0x0071, 0x080c, 0xa828,
 	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,
+	0x9084, 0x0007, 0x0002, 0x8d75, 0x8d99, 0x8dd8, 0x8d7b, 0x8d99,
+	0x8d75, 0x8d73, 0x8d73, 0x080c, 0x0dd5, 0x080c, 0x8308, 0x080c,
+	0x941c, 0x00ce, 0x0005, 0x62c0, 0x82ff, 0x1110, 0x00ce, 0x0005,
+	0x2011, 0x5c61, 0x080c, 0x8285, 0x7828, 0x9092, 0x00c8, 0x1228,
+	0x8000, 0x782a, 0x080c, 0x5ca1, 0x0c88, 0x62c0, 0x080c, 0xa967,
+	0x080c, 0x5c61, 0x7807, 0x0003, 0x7827, 0x0000, 0x782b, 0x0000,
+	0x0c28, 0x080c, 0x8308, 0x6220, 0xd2a4, 0x0160, 0x782b, 0x0000,
+	0x7824, 0x9065, 0x090c, 0x0dd5, 0x2009, 0x0013, 0x080c, 0xabe6,
+	0x00ce, 0x0005, 0x00c6, 0x7824, 0x9065, 0x090c, 0x0dd5, 0x7828,
+	0x9092, 0xc350, 0x12c0, 0x8000, 0x782a, 0x00ce, 0x080c, 0x2a57,
+	0x0278, 0x00c6, 0x7924, 0x2160, 0x6010, 0x906d, 0x090c, 0x0dd5,
+	0x7807, 0x0000, 0x7827, 0x0000, 0x00ce, 0x080c, 0x941c, 0x0c00,
+	0x080c, 0x9fd8, 0x08e8, 0x2011, 0x0130, 0x2214, 0x080c, 0xa967,
+	0x080c, 0xe6a1, 0x2009, 0x0014, 0x080c, 0xabe6, 0x00ce, 0x0880,
+	0x2001, 0x1a01, 0x2003, 0x0000, 0x62c0, 0x82ff, 0x1160, 0x782b,
+	0x0000, 0x7824, 0x9065, 0x090c, 0x0dd5, 0x2009, 0x0013, 0x080c,
+	0xac38, 0x00ce, 0x0005, 0x00b6, 0x00c6, 0x00d6, 0x7824, 0x9005,
+	0x090c, 0x0dd5, 0x7828, 0x9092, 0xc350, 0x1648, 0x8000, 0x782a,
+	0x00de, 0x00ce, 0x00be, 0x080c, 0x2a57, 0x02f0, 0x00b6, 0x00c6,
+	0x00d6, 0x781c, 0x905d, 0x090c, 0x0dd5, 0xb800, 0xc0dc, 0xb802,
+	0x7924, 0x2160, 0x080c, 0xab6b, 0xb93c, 0x81ff, 0x090c, 0x0dd5,
 	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,
+	0x00be, 0x080c, 0x941c, 0x0868, 0x080c, 0x9fd8, 0x0850, 0x2011,
+	0x0130, 0x2214, 0x080c, 0xa967, 0x080c, 0xe6a1, 0x7824, 0x9065,
+	0x2009, 0x0014, 0x080c, 0xabe6, 0x00de, 0x00ce, 0x00be, 0x0804,
+	0x8de9, 0x00c6, 0x2001, 0x009b, 0x2004, 0xd0fc, 0x190c, 0x1d8c,
+	0x6024, 0x6027, 0x0002, 0xd0f4, 0x15b8, 0x62c8, 0x60c4, 0x9205,
+	0x1170, 0x783c, 0x9065, 0x0130, 0x2009, 0x0049, 0x080c, 0xabe6,
+	0x00ce, 0x0005, 0x2011, 0x1a04, 0x2013, 0x0000, 0x0cc8, 0x793c,
+	0x81ff, 0x0dc0, 0x7944, 0x9192, 0x7530, 0x1628, 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,
+	0x9084, 0x1984, 0x9085, 0x0012, 0x6016, 0x0c10, 0x793c, 0x9188,
+	0x0008, 0x210c, 0x918e, 0x0009, 0x0d90, 0x6014, 0x9084, 0x1984,
+	0x9085, 0x0016, 0x6016, 0x08a0, 0x793c, 0x2160, 0x2009, 0x004a,
+	0x080c, 0xabe6, 0x0868, 0x7848, 0xc085, 0x784a, 0x0848, 0x0006,
+	0x0016, 0x00c6, 0x0126, 0x2091, 0x8000, 0x600f, 0x0000, 0x2c08,
+	0x2061, 0x19e5, 0x6020, 0x8000, 0x6022, 0x6010, 0x9005, 0x0148,
+	0x9080, 0x0003, 0x2102, 0x6112, 0x012e, 0x00ce, 0x001e, 0x000e,
+	0x0005, 0x6116, 0x6112, 0x0cc0, 0x00d6, 0x2069, 0x19e5, 0xb800,
+	0xd0d4, 0x0168, 0x6820, 0x8000, 0x6822, 0x9086, 0x0001, 0x1110,
+	0x2b00, 0x681e, 0x00de, 0x0804, 0x941c, 0x00de, 0x0005, 0xc0d5,
+	0xb802, 0x6818, 0x9005, 0x0168, 0xb856, 0xb85b, 0x0000, 0x0086,
+	0x0006, 0x2b00, 0x681a, 0x008e, 0xa05a, 0x008e, 0x2069, 0x19e5,
+	0x0c08, 0xb856, 0xb85a, 0x2b00, 0x681a, 0x681e, 0x08d8, 0x0006,
+	0x0016, 0x00c6, 0x0126, 0x2091, 0x8000, 0x600f, 0x0000, 0x2c08,
+	0x2061, 0x19e5, 0x6020, 0x8000, 0x6022, 0x6008, 0x9005, 0x0148,
+	0x9080, 0x0003, 0x2102, 0x610a, 0x012e, 0x00ce, 0x001e, 0x000e,
+	0x0005, 0x610e, 0x610a, 0x0cc0, 0x00c6, 0x600f, 0x0000, 0x2c08,
+	0x2061, 0x19e5, 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, 0x19e5,
+	0x7638, 0x2660, 0x2678, 0x2091, 0x8000, 0x8cff, 0x0904, 0x8f6e,
+	0x6010, 0x2058, 0xb8a0, 0x9206, 0x1904, 0x8f69, 0x87ff, 0x0120,
+	0x6054, 0x9106, 0x1904, 0x8f69, 0x703c, 0x9c06, 0x1178, 0x0036,
+	0x2019, 0x0001, 0x080c, 0xa2ac, 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, 0xc825, 0x01c8, 0x6014, 0x2048, 0x6020, 0x9086, 0x0003,
+	0x1590, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x0016, 0x0036,
+	0x0076, 0x080c, 0xcb0d, 0x080c, 0xe5d5, 0x080c, 0x6a46, 0x007e,
+	0x003e, 0x001e, 0x080c, 0xca07, 0x080c, 0xab9c, 0x00ce, 0x0804,
+	0x8f0d, 0x2c78, 0x600c, 0x2060, 0x0804, 0x8f0d, 0x85ff, 0x0120,
+	0x0036, 0x080c, 0x9548, 0x003e, 0x012e, 0x000e, 0x001e, 0x002e,
+	0x003e, 0x005e, 0x006e, 0x007e, 0x009e, 0x00be, 0x00ce, 0x00de,
+	0x00ee, 0x00fe, 0x0005, 0x6020, 0x9086, 0x0006, 0x1158, 0x0016,
+	0x0036, 0x0076, 0x080c, 0xe5d5, 0x080c, 0xe223, 0x007e, 0x003e,
+	0x001e, 0x0890, 0x6020, 0x9086, 0x0009, 0x1168, 0xa87b, 0x0006,
+	0x0016, 0x0036, 0x0076, 0x080c, 0x6a46, 0x080c, 0xab6b, 0x007e,
+	0x003e, 0x001e, 0x0818, 0x6020, 0x9086, 0x000a, 0x0904, 0x8f53,
+	0x0804, 0x8f51, 0x0006, 0x0066, 0x0096, 0x00c6, 0x00d6, 0x00f6,
+	0x9036, 0x0126, 0x2091, 0x8000, 0x2079, 0x19e5, 0x7838, 0x9065,
+	0x0904, 0x8ffa, 0x600c, 0x0006, 0x600f, 0x0000, 0x783c, 0x9c06,
+	0x1168, 0x0036, 0x2019, 0x0001, 0x080c, 0xa2ac, 0x7833, 0x0000,
+	0x901e, 0x7b3e, 0x7b42, 0x7b46, 0x7b4a, 0x003e, 0x080c, 0xc825,
 	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,
+	0x1986, 0x2004, 0x6042, 0x0058, 0xa867, 0x0103, 0xab7a, 0xa877,
+	0x0000, 0x080c, 0x6a3a, 0x080c, 0xca07, 0x080c, 0xab9c, 0x000e,
+	0x0804, 0x8fb7, 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,
+	0x080c, 0xe223, 0x0c50, 0x6020, 0x9086, 0x0009, 0x1130, 0xab7a,
+	0x080c, 0x6a46, 0x080c, 0xab6b, 0x0c10, 0x6020, 0x9086, 0x000a,
+	0x09a8, 0x0890, 0x0016, 0x0026, 0x0086, 0x9046, 0x0099, 0x080c,
+	0x9103, 0x008e, 0x002e, 0x001e, 0x0005, 0x00f6, 0x0126, 0x2079,
+	0x19e5, 0x2091, 0x8000, 0x080c, 0x919a, 0x080c, 0x9228, 0x012e,
+	0x00fe, 0x0005, 0x00b6, 0x0096, 0x00f6, 0x00e6, 0x00d6, 0x00c6,
+	0x0066, 0x0016, 0x0006, 0x0126, 0x2091, 0x8000, 0x2071, 0x19e5,
+	0x7614, 0x2660, 0x2678, 0x8cff, 0x0904, 0x90c8, 0x6010, 0x2058,
+	0xb8a0, 0x9206, 0x1904, 0x90c3, 0x88ff, 0x0120, 0x6054, 0x9106,
+	0x1904, 0x90c3, 0x7024, 0x9c06, 0x1558, 0x2069, 0x0100, 0x6820,
+	0xd0a4, 0x1508, 0x080c, 0x8308, 0x080c, 0x9ffc, 0x68c3, 0x0000,
+	0x080c, 0xa4c6, 0x7027, 0x0000, 0x0036, 0x2069, 0x0140, 0x6b04,
+	0x9384, 0x1000, 0x0138, 0x2001, 0x0100, 0x080c, 0x2ba1, 0x9006,
+	0x080c, 0x2ba1, 0x2069, 0x0100, 0x6824, 0xd084, 0x0110, 0x6827,
+	0x0001, 0x003e, 0x0028, 0x6003, 0x0009, 0x630a, 0x0804, 0x90c3,
+	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, 0xc825, 0x01e8, 0x6020,
+	0x9086, 0x0003, 0x1580, 0x080c, 0xca24, 0x1118, 0x080c, 0xb51d,
+	0x0098, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x0016, 0x0036,
+	0x0086, 0x080c, 0xcb0d, 0x080c, 0xe5d5, 0x080c, 0x6a46, 0x008e,
+	0x003e, 0x001e, 0x080c, 0xca07, 0x080c, 0xab9c, 0x080c, 0xa39c,
+	0x00ce, 0x0804, 0x9043, 0x2c78, 0x600c, 0x2060, 0x0804, 0x9043,
+	0x012e, 0x000e, 0x001e, 0x006e, 0x00ce, 0x00de, 0x00ee, 0x00fe,
+	0x009e, 0x00be, 0x0005, 0x6020, 0x9086, 0x0006, 0x1158, 0x0016,
+	0x0036, 0x0086, 0x080c, 0xe5d5, 0x080c, 0xe223, 0x008e, 0x003e,
+	0x001e, 0x08d0, 0x080c, 0xb51d, 0x6020, 0x9086, 0x0002, 0x1160,
+	0x6004, 0x0006, 0x9086, 0x0085, 0x000e, 0x0904, 0x90a9, 0x9086,
+	0x008b, 0x0904, 0x90a9, 0x0840, 0x6020, 0x9086, 0x0005, 0x1920,
+	0x6004, 0x0006, 0x9086, 0x0085, 0x000e, 0x09c8, 0x9086, 0x008b,
+	0x09b0, 0x0804, 0x90bc, 0x00b6, 0x00a6, 0x0096, 0x00c6, 0x0006,
+	0x0126, 0x2091, 0x8000, 0x9280, 0x1000, 0x2004, 0x905d, 0x0904,
+	0x9193, 0x00f6, 0x00e6, 0x00d6, 0x0066, 0x2071, 0x19e5, 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, 0x62ff,
+	0x0904, 0x918f, 0x7624, 0x86ff, 0x0904, 0x917e, 0x9680, 0x0005,
+	0x2004, 0x9906, 0x15d8, 0x00d6, 0x2069, 0x0100, 0x68c0, 0x9005,
+	0x0560, 0x080c, 0x8308, 0x080c, 0x9ffc, 0x68c3, 0x0000, 0x080c,
+	0xa4c6, 0x7027, 0x0000, 0x0036, 0x2069, 0x0140, 0x6b04, 0x9384,
+	0x1000, 0x0138, 0x2001, 0x0100, 0x080c, 0x2ba1, 0x9006, 0x080c,
+	0x2ba1, 0x2069, 0x0100, 0x6824, 0xd084, 0x0110, 0x6827, 0x0001,
+	0x003e, 0x00de, 0x00c6, 0xb83c, 0x9005, 0x0110, 0x8001, 0xb83e,
+	0x2660, 0x080c, 0xab9c, 0x00ce, 0x0048, 0x00de, 0x00c6, 0x2660,
+	0x6003, 0x0009, 0x630a, 0x00ce, 0x0804, 0x9136, 0x89ff, 0x0158,
+	0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x080c, 0xcb0d, 0x080c,
+	0xe5d5, 0x080c, 0x6a46, 0x080c, 0xa39c, 0x0804, 0x9136, 0x006e,
+	0x00de, 0x00ee, 0x00fe, 0x012e, 0x000e, 0x00ce, 0x009e, 0x00ae,
+	0x00be, 0x0005, 0x0096, 0x0006, 0x0066, 0x00c6, 0x00d6, 0x9036,
+	0x7814, 0x9065, 0x0904, 0x91fb, 0x600c, 0x0006, 0x600f, 0x0000,
+	0x7824, 0x9c06, 0x1570, 0x2069, 0x0100, 0x6820, 0xd0a4, 0x1508,
+	0x080c, 0x8308, 0x080c, 0x9ffc, 0x68c3, 0x0000, 0x080c, 0xa4c6,
+	0x7827, 0x0000, 0x0036, 0x2069, 0x0140, 0x6b04, 0x9384, 0x1000,
+	0x0138, 0x2001, 0x0100, 0x080c, 0x2ba1, 0x9006, 0x080c, 0x2ba1,
 	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,
+	0x0040, 0x080c, 0x66cf, 0x1520, 0x6003, 0x0009, 0x630a, 0x2c30,
+	0x00f8, 0x6014, 0x2048, 0x080c, 0xc823, 0x01b0, 0x6020, 0x9086,
+	0x0003, 0x1508, 0x080c, 0xca24, 0x1118, 0x080c, 0xb51d, 0x0060,
+	0x080c, 0x66cf, 0x1168, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000,
+	0x080c, 0x6a46, 0x080c, 0xca07, 0x080c, 0xab9c, 0x080c, 0xa39c,
+	0x000e, 0x0804, 0x91a1, 0x7e16, 0x7e12, 0x00de, 0x00ce, 0x006e,
+	0x000e, 0x009e, 0x0005, 0x6020, 0x9086, 0x0006, 0x1118, 0x080c,
+	0xe223, 0x0c50, 0x080c, 0xb51d, 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, 0x92a8, 0xb854, 0x0006, 0x9006, 0xb856, 0xb85a, 0xb800,
+	0xc0d4, 0xc0dc, 0xb802, 0x080c, 0x62ff, 0x0904, 0x92a5, 0x7e24,
+	0x86ff, 0x0904, 0x9298, 0x9680, 0x0005, 0x2004, 0x9906, 0x1904,
+	0x9298, 0x00d6, 0x2069, 0x0100, 0x68c0, 0x9005, 0x0904, 0x928f,
+	0x080c, 0x8308, 0x080c, 0x9ffc, 0x68c3, 0x0000, 0x080c, 0xa4c6,
+	0x7827, 0x0000, 0x0036, 0x2069, 0x0140, 0x6b04, 0x9384, 0x1000,
+	0x0138, 0x2001, 0x0100, 0x080c, 0x2ba1, 0x9006, 0x080c, 0x2ba1,
+	0x2069, 0x0100, 0x6824, 0xd084, 0x0110, 0x6827, 0x0001, 0x003e,
+	0x00de, 0x00c6, 0x3e08, 0x918e, 0x0002, 0x1168, 0xb800, 0xd0bc,
+	0x0150, 0x9680, 0x0010, 0x200c, 0x81ff, 0x1518, 0x2009, 0x1986,
+	0x210c, 0x2102, 0x00f0, 0xb83c, 0x9005, 0x0110, 0x8001, 0xb83e,
+	0x2660, 0x600f, 0x0000, 0x080c, 0xab9c, 0x00ce, 0x0048, 0x00de,
+	0x00c6, 0x2660, 0x6003, 0x0009, 0x630a, 0x00ce, 0x0804, 0x923b,
+	0x89ff, 0x0138, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x080c,
+	0x6a46, 0x080c, 0xa39c, 0x0804, 0x923b, 0x000e, 0x0804, 0x922f,
+	0x781e, 0x781a, 0x00de, 0x00ce, 0x00be, 0x009e, 0x006e, 0x000e,
+	0x0005, 0x00e6, 0x00d6, 0x0096, 0x0066, 0xb800, 0xd0dc, 0x01a0,
+	0xb84c, 0x904d, 0x0188, 0xa878, 0x9606, 0x1170, 0x2071, 0x19e5,
+	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, 0x9ffc,
+	0x78c3, 0x0000, 0x080c, 0xa4c6, 0x7027, 0x0000, 0x0036, 0x2079,
+	0x0140, 0x7b04, 0x9384, 0x1000, 0x0138, 0x2001, 0x0100, 0x080c,
+	0x2ba1, 0x9006, 0x080c, 0x2ba1, 0x2079, 0x0100, 0x7824, 0xd084,
+	0x0110, 0x7827, 0x0001, 0x080c, 0xa4c6, 0x003e, 0x080c, 0x62ff,
 	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,
+	0xab6b, 0x00ce, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x080c,
+	0xcb0d, 0x080c, 0x6a46, 0x080c, 0xa39c, 0x00fe, 0x0005, 0x00b6,
+	0x00e6, 0x00c6, 0x2011, 0x0101, 0x2204, 0xc0c4, 0x2012, 0x2001,
+	0x180c, 0x2014, 0xc2e4, 0x2202, 0x2071, 0x19e5, 0x7004, 0x9084,
+	0x0007, 0x0002, 0x9334, 0x9338, 0x934f, 0x9378, 0x93b6, 0x9334,
+	0x934f, 0x9332, 0x080c, 0x0dd5, 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, 0x62ff, 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, 0x941c, 0x0ca8, 0x7218, 0x721e,
+	0x080c, 0x941c, 0x0c80, 0xc2ec, 0x2202, 0x080c, 0x9548, 0x0c58,
+	0x7024, 0x9065, 0x05b8, 0x700c, 0x9c06, 0x1160, 0x080c, 0xa39c,
+	0x600c, 0x9015, 0x0120, 0x720e, 0x600f, 0x0000, 0x0448, 0x720e,
+	0x720a, 0x0430, 0x7014, 0x9c06, 0x1160, 0x080c, 0xa39c, 0x600c,
+	0x9015, 0x0120, 0x7216, 0x600f, 0x0000, 0x00d0, 0x7216, 0x7212,
+	0x00b8, 0x6020, 0x9086, 0x0003, 0x1198, 0x6010, 0x2058, 0x080c,
+	0x62ff, 0xb800, 0xc0dc, 0xb802, 0x080c, 0xa39c, 0x701c, 0x9065,
+	0x0138, 0xb854, 0x9015, 0x0110, 0x721e, 0x0010, 0x7218, 0x721e,
+	0x7027, 0x0000, 0x00ce, 0x00ee, 0x00be, 0x0005, 0x7024, 0x9065,
+	0x0140, 0x080c, 0xa39c, 0x600c, 0x9015, 0x0158, 0x720e, 0x600f,
+	0x0000, 0x080c, 0xa4c6, 0x7027, 0x0000, 0x00ce, 0x00ee, 0x00be,
+	0x0005, 0x720e, 0x720a, 0x0ca8, 0x00d6, 0x2069, 0x19e5, 0x6830,
+	0x9084, 0x0003, 0x0002, 0x93d9, 0x93db, 0x93ff, 0x93d7, 0x080c,
+	0x0dd5, 0x00de, 0x0005, 0x00c6, 0x6840, 0x9086, 0x0001, 0x01b8,
+	0x683c, 0x9065, 0x0130, 0x600c, 0x9015, 0x0170, 0x6a3a, 0x600f,
+	0x0000, 0x6833, 0x0000, 0x683f, 0x0000, 0x2011, 0x1a04, 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, 0x9548, 0x2001, 0x19f1, 0x2004,
+	0x9086, 0x0001, 0x0d58, 0x00d6, 0x2069, 0x19e5, 0x6804, 0x9084,
+	0x0007, 0x0006, 0x9005, 0x11c8, 0x2001, 0x1837, 0x2004, 0x9084,
+	0x0028, 0x1198, 0x2001, 0x197c, 0x2004, 0x9086, 0xaaaa, 0x0168,
+	0x2001, 0x188b, 0x2004, 0xd08c, 0x1118, 0xd084, 0x1118, 0x0028,
+	0x080c, 0x9548, 0x000e, 0x00de, 0x0005, 0x000e, 0x0002, 0x9459,
+	0x9516, 0x9516, 0x9516, 0x9516, 0x9518, 0x9516, 0x9457, 0x080c,
+	0x0dd5, 0x6820, 0x9005, 0x1110, 0x00de, 0x0005, 0x00c6, 0x680c,
+	0x9065, 0x0520, 0x6114, 0x0096, 0x2148, 0xa964, 0x009e, 0x918c,
+	0x00ff, 0x918e, 0x0035, 0x1180, 0x2009, 0x1837, 0x210c, 0x918c,
+	0x0028, 0x1150, 0x080c, 0x717d, 0x0138, 0x0006, 0x2009, 0x188b,
+	0x2104, 0xc095, 0x200a, 0x000e, 0x6807, 0x0004, 0x6826, 0x682b,
+	0x0000, 0x080c, 0x95f0, 0x00ce, 0x00de, 0x0005, 0x6814, 0x9065,
+	0x0150, 0x6807, 0x0001, 0x6826, 0x682b, 0x0000, 0x080c, 0x95f0,
+	0x00ce, 0x00de, 0x0005, 0x00b6, 0x00e6, 0x6a1c, 0x92dd, 0x0000,
+	0x0904, 0x9502, 0xb84c, 0x900d, 0x0118, 0xb888, 0x9005, 0x01a0,
+	0xb854, 0x905d, 0x0120, 0x920e, 0x0904, 0x9502, 0x0028, 0x6818,
+	0x920e, 0x0904, 0x9502, 0x2058, 0xb84c, 0x900d, 0x0d88, 0xb888,
+	0x9005, 0x1d70, 0x2b00, 0x681e, 0xbb3c, 0xb838, 0x9302, 0x1e40,
+	0x080c, 0xab42, 0x0904, 0x9502, 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, 0xbac0, 0x629a, 0x2069, 0x0200, 0x2071,
+	0x0240, 0x080c, 0x9b3d, 0x2069, 0x19e5, 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,
+	0xa987, 0x00ee, 0x00be, 0x00ce, 0x00de, 0x0005, 0x00de, 0x0005,
+	0x00c6, 0x680c, 0x9065, 0x0508, 0x6114, 0x0096, 0x2148, 0xa964,
+	0x009e, 0x918c, 0x00ff, 0x918e, 0x0035, 0x1180, 0x2009, 0x1837,
+	0x210c, 0x918c, 0x0028, 0x1150, 0x080c, 0x717d, 0x0138, 0x0006,
+	0x2009, 0x188b, 0x2104, 0xc095, 0x200a, 0x000e, 0x6807, 0x0004,
+	0x6826, 0x682b, 0x0000, 0x080c, 0x95f0, 0x00ce, 0x00de, 0x0005,
+	0x2001, 0x180c, 0x2014, 0xc2ed, 0x2202, 0x00de, 0x00fe, 0x0005,
+	0x00f6, 0x00d6, 0x2069, 0x19e5, 0x6830, 0x9086, 0x0000, 0x1570,
+	0x2001, 0x180c, 0x2014, 0xd2e4, 0x0130, 0xc2e4, 0x2202, 0x080c,
+	0x942b, 0x2069, 0x19e5, 0x2001, 0x180c, 0x200c, 0xd1c4, 0x1508,
+	0x6838, 0x907d, 0x01d8, 0x6a04, 0x9296, 0x0000, 0x1904, 0x95e9,
+	0x7920, 0x918e, 0x0009, 0x0588, 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,
+	0x080c, 0x1b8c, 0x1178, 0x012e, 0x080c, 0x9e4a, 0x00de, 0x00fe,
+	0x0005, 0xc1c4, 0x2102, 0x0066, 0x2031, 0x0001, 0x080c, 0x722d,
+	0x006e, 0x08b0, 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,
+	0x0000, 0x0c20, 0x683a, 0x6836, 0x0cc0, 0x7908, 0xd1fc, 0x1198,
+	0x6833, 0x0001, 0x683e, 0x6847, 0x0000, 0x684b, 0x0000, 0x0126,
+	0x00f6, 0x2091, 0x2400, 0x002e, 0x080c, 0x1b8c, 0x19d8, 0x012e,
+	0x080c, 0x9dcb, 0x0858, 0x2001, 0x1837, 0x2004, 0x9084, 0x0028,
+	0x1188, 0x2001, 0x197c, 0x2004, 0x9086, 0xaaaa, 0x0158, 0x2001,
+	0x19e6, 0x2004, 0x9005, 0x11f0, 0x2001, 0x188b, 0x200c, 0xc185,
+	0xc18c, 0x2102, 0x2f00, 0x6833, 0x0001, 0x683e, 0x6847, 0x0000,
+	0x684b, 0x0000, 0x0126, 0x00f6, 0x2091, 0x2400, 0x002e, 0x080c,
+	0x1b8c, 0x1904, 0x958a, 0x012e, 0x6a3c, 0x2278, 0x080c, 0x9d55,
+	0x0804, 0x957e, 0x2011, 0x188b, 0x2204, 0xc08d, 0x2012, 0x0804,
+	0x957e, 0x6a04, 0x9296, 0x0006, 0x0904, 0x9568, 0x0804, 0x9540,
+	0x6020, 0x9084, 0x000f, 0x000b, 0x0005, 0x9604, 0x9609, 0x9a77,
+	0x9b06, 0x9609, 0x9a77, 0x9b06, 0x9604, 0x9609, 0x9604, 0x9604,
+	0x9604, 0x9604, 0x9604, 0x9604, 0x080c, 0x9317, 0x080c, 0x941c,
+	0x0005, 0x00b6, 0x0156, 0x0136, 0x0146, 0x01c6, 0x01d6, 0x00c6,
+	0x00d6, 0x00e6, 0x00f6, 0x2069, 0x0200, 0x2071, 0x0240, 0x6004,
+	0x908a, 0x0053, 0x1a0c, 0x0dd5, 0x6110, 0x2158, 0xb9c0, 0x2c78,
+	0x2061, 0x0100, 0x619a, 0x908a, 0x0040, 0x1a04, 0x9675, 0x005b,
+	0x00fe, 0x00ee, 0x00de, 0x00ce, 0x01de, 0x01ce, 0x014e, 0x013e,
+	0x015e, 0x00be, 0x0005, 0x97fa, 0x9835, 0x985e, 0x9906, 0x9928,
+	0x992e, 0x993b, 0x9943, 0x994f, 0x9955, 0x9966, 0x9955, 0x99be,
+	0x9943, 0x99ca, 0x99d0, 0x994f, 0x99d0, 0x99dc, 0x9673, 0x9673,
+	0x9673, 0x9673, 0x9673, 0x9673, 0x9673, 0x9673, 0x9673, 0x9673,
+	0x9673, 0xa163, 0xa186, 0xa197, 0xa1b7, 0xa1e9, 0x993b, 0x9673,
+	0x993b, 0x9955, 0x9673, 0x985e, 0x9906, 0x9673, 0xa5b3, 0x9955,
+	0x9673, 0xa5cf, 0x9955, 0x9673, 0x994f, 0x97f4, 0x9696, 0x9673,
+	0xa5eb, 0xa658, 0xa72f, 0x9673, 0xa73c, 0x9938, 0xa767, 0x9673,
+	0xa1f3, 0xa794, 0x9673, 0x080c, 0x0dd5, 0x2100, 0x005b, 0x00fe,
+	0x00ee, 0x00de, 0x00ce, 0x01de, 0x01ce, 0x014e, 0x013e, 0x015e,
+	0x00be, 0x0005, 0xa82f, 0xa8e1, 0x9694, 0x96bd, 0x9769, 0x9774,
+	0x9694, 0x993b, 0x9694, 0x97bb, 0x97c7, 0x96d8, 0x9694, 0x96f3,
+	0x9727, 0xaa49, 0xaa8e, 0x9955, 0x080c, 0x0dd5, 0x00d6, 0x0096,
+	0x080c, 0x99ef, 0x7003, 0x2414, 0x7007, 0x0018, 0x700b, 0x0800,
+	0x7814, 0x2048, 0xa83c, 0x700e, 0xa850, 0x7022, 0xa854, 0x7026,
+	0x60c3, 0x0018, 0x080c, 0x9fd0, 0x009e, 0x00de, 0x0005, 0x7810,
+	0x00b6, 0x2058, 0xb8a0, 0x00be, 0x080c, 0xaad5, 0x1118, 0x9084,
+	0xff80, 0x0110, 0x9085, 0x0001, 0x0005, 0x00d6, 0x0096, 0x080c,
+	0x99ef, 0x7003, 0x0500, 0x7814, 0x2048, 0xa874, 0x700a, 0xa878,
+	0x700e, 0xa87c, 0x7012, 0xa880, 0x7016, 0xa884, 0x701a, 0xa888,
+	0x701e, 0x60c3, 0x0010, 0x080c, 0x9fd0, 0x009e, 0x00de, 0x0005,
+	0x00d6, 0x0096, 0x080c, 0x99ef, 0x7003, 0x0500, 0x7814, 0x2048,
+	0xa8cc, 0x700a, 0xa8d0, 0x700e, 0xa8d4, 0x7012, 0xa8d8, 0x7016,
+	0xa8dc, 0x701a, 0xa8e0, 0x701e, 0x60c3, 0x0010, 0x080c, 0x9fd0,
+	0x009e, 0x00de, 0x0005, 0x00d6, 0x0096, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x99ef, 0x20e9, 0x0000, 0x2001, 0x19a1, 0x2003, 0x0000,
+	0x7814, 0x2048, 0xa814, 0x8003, 0x60c2, 0xa830, 0x20a8, 0xa860,
+	0x20e0, 0xa85c, 0x9080, 0x001b, 0x2098, 0x2001, 0x19a1, 0x0016,
+	0x200c, 0x2001, 0x0001, 0x080c, 0x2269, 0x080c, 0xd53f, 0x9006,
+	0x080c, 0x2269, 0x001e, 0xa804, 0x9005, 0x0110, 0x2048, 0x0c28,
+	0x04d9, 0x080c, 0x9fd0, 0x012e, 0x009e, 0x00de, 0x0005, 0x00d6,
+	0x0096, 0x0126, 0x2091, 0x8000, 0x080c, 0x9a3a, 0x20e9, 0x0000,
+	0x2001, 0x19a1, 0x2003, 0x0000, 0x7814, 0x2048, 0xa86f, 0x0200,
+	0xa873, 0x0000, 0xa814, 0x8003, 0x60c2, 0xa830, 0x20a8, 0xa860,
+	0x20e0, 0xa85c, 0x9080, 0x001b, 0x2098, 0x2001, 0x19a1, 0x0016,
+	0x200c, 0x080c, 0xd53f, 0x001e, 0xa804, 0x9005, 0x0110, 0x2048,
+	0x0c60, 0x0051, 0x7814, 0x2048, 0x080c, 0x0fb2, 0x080c, 0x9fd0,
+	0x012e, 0x009e, 0x00de, 0x0005, 0x60c0, 0x8004, 0x9084, 0x0003,
+	0x9005, 0x0130, 0x9082, 0x0004, 0x20a3, 0x0000, 0x8000, 0x1de0,
+	0x0005, 0x080c, 0x99ef, 0x7003, 0x7800, 0x7808, 0x8007, 0x700a,
+	0x60c3, 0x0008, 0x0804, 0x9fd0, 0x00d6, 0x00e6, 0x080c, 0x9a3a,
+	0x7814, 0x9084, 0xff00, 0x2073, 0x0200, 0x8e70, 0x8e70, 0x9095,
+	0x0010, 0x2272, 0x8e70, 0x2073, 0x0034, 0x8e70, 0x2069, 0x1805,
+	0x20a9, 0x0004, 0x2d76, 0x8d68, 0x8e70, 0x1f04, 0x978a, 0x2069,
+	0x1801, 0x20a9, 0x0004, 0x2d76, 0x8d68, 0x8e70, 0x1f04, 0x9793,
+	0x2069, 0x19b1, 0x9086, 0xdf00, 0x0110, 0x2069, 0x19cb, 0x20a9,
+	0x001a, 0x9e86, 0x0260, 0x1148, 0x00c6, 0x2061, 0x0200, 0x6010,
+	0x8000, 0x6012, 0x00ce, 0x2071, 0x0240, 0x2d04, 0x8007, 0x2072,
+	0x8d68, 0x8e70, 0x1f04, 0x97a1, 0x60c3, 0x004c, 0x080c, 0x9fd0,
+	0x00ee, 0x00de, 0x0005, 0x080c, 0x99ef, 0x7003, 0x6300, 0x7007,
+	0x0028, 0x7808, 0x700e, 0x60c3, 0x0008, 0x0804, 0x9fd0, 0x00d6,
+	0x0026, 0x0016, 0x080c, 0x9a3a, 0x7003, 0x0200, 0x7814, 0x700e,
+	0x00e6, 0x9ef0, 0x0004, 0x2009, 0x0001, 0x2011, 0x000c, 0x2069,
+	0x1923, 0x6810, 0xd084, 0x1148, 0x2073, 0x0500, 0x8e70, 0x2073,
+	0x0000, 0x8e70, 0x8108, 0x9290, 0x0004, 0x2073, 0x0800, 0x8e70,
+	0x2073, 0x0000, 0x00ee, 0x7206, 0x710a, 0x62c2, 0x080c, 0x9fd0,
+	0x001e, 0x002e, 0x00de, 0x0005, 0x2001, 0x1818, 0x2004, 0x609a,
+	0x0804, 0x9fd0, 0x080c, 0x99ef, 0x7003, 0x5200, 0x2069, 0x1847,
+	0x6804, 0xd084, 0x0130, 0x6828, 0x0016, 0x080c, 0x2723, 0x710e,
+	0x001e, 0x20a9, 0x0004, 0x20e1, 0x0001, 0x2099, 0x1805, 0x20e9,
+	0x0000, 0x20a1, 0x0250, 0x4003, 0x20a9, 0x0004, 0x2099, 0x1801,
+	0x20a1, 0x0254, 0x4003, 0x080c, 0xaad5, 0x1120, 0xb8a0, 0x9082,
+	0x007f, 0x0248, 0x2001, 0x181f, 0x2004, 0x7032, 0x2001, 0x1820,
+	0x2004, 0x7036, 0x0030, 0x2001, 0x1818, 0x2004, 0x9084, 0x00ff,
+	0x7036, 0x60c3, 0x001c, 0x0804, 0x9fd0, 0x080c, 0x99ef, 0x7003,
+	0x0500, 0x080c, 0xaad5, 0x1120, 0xb8a0, 0x9082, 0x007f, 0x0248,
+	0x2001, 0x181f, 0x2004, 0x700a, 0x2001, 0x1820, 0x2004, 0x700e,
+	0x0030, 0x2001, 0x1818, 0x2004, 0x9084, 0x00ff, 0x700e, 0x20a9,
+	0x0004, 0x20e1, 0x0001, 0x2099, 0x1805, 0x20e9, 0x0000, 0x20a1,
+	0x0250, 0x4003, 0x60c3, 0x0010, 0x0804, 0x9fd0, 0x080c, 0x99ef,
+	0x9006, 0x080c, 0x6701, 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, 0x98cd, 0x00d6, 0x2069, 0x196c,
+	0x2001, 0x1837, 0x2004, 0xd0a4, 0x0188, 0x6800, 0x700a, 0x6808,
+	0x9084, 0x2000, 0x7012, 0x080c, 0xaaec, 0x680c, 0x7016, 0x701f,
+	0x2710, 0x6818, 0x7022, 0x681c, 0x7026, 0x0090, 0x6800, 0x700a,
+	0x6804, 0x700e, 0x6808, 0x080c, 0x717d, 0x1118, 0x9084, 0x37ff,
+	0x0010, 0x9084, 0x3fff, 0x7012, 0x080c, 0xaaec, 0x680c, 0x7016,
+	0x00de, 0x20a9, 0x0004, 0x20e1, 0x0001, 0x2099, 0x1805, 0x20e9,
+	0x0000, 0x20a1, 0x0256, 0x4003, 0x20a9, 0x0004, 0x2099, 0x1801,
+	0x20a1, 0x025a, 0x4003, 0x00d6, 0x080c, 0xa816, 0x2069, 0x1974,
+	0x2071, 0x024e, 0x6800, 0xc0dd, 0x7002, 0x080c, 0x54bb, 0xd0e4,
+	0x0110, 0x680c, 0x700e, 0x00de, 0x04a8, 0x2001, 0x1837, 0x2004,
+	0xd0a4, 0x0170, 0x0016, 0x2001, 0x196d, 0x200c, 0x60e0, 0x9106,
+	0x0130, 0x2100, 0x60e3, 0x0000, 0x080c, 0x2764, 0x61e2, 0x001e,
+	0x20e1, 0x0001, 0x2099, 0x196c, 0x20e9, 0x0000, 0x20a1, 0x024e,
+	0x20a9, 0x0008, 0x4003, 0x20a9, 0x0004, 0x2099, 0x1805, 0x20a1,
+	0x0256, 0x4003, 0x20a9, 0x0004, 0x2099, 0x1801, 0x20a1, 0x025a,
+	0x4003, 0x080c, 0xa816, 0x20a1, 0x024e, 0x20a9, 0x0008, 0x2099,
+	0x1974, 0x4003, 0x60c3, 0x0074, 0x0804, 0x9fd0, 0x080c, 0x99ef,
+	0x7003, 0x2010, 0x7007, 0x0014, 0x700b, 0x0800, 0x700f, 0x2000,
+	0x9006, 0x00f6, 0x2079, 0x1847, 0x7904, 0x00fe, 0xd1ac, 0x1110,
+	0x9085, 0x0020, 0xd1a4, 0x0110, 0x9085, 0x0010, 0x9085, 0x0002,
+	0x00d6, 0x0804, 0x999f, 0x7026, 0x60c3, 0x0014, 0x0804, 0x9fd0,
+	0x080c, 0x99ef, 0x7003, 0x5000, 0x0804, 0x9878, 0x080c, 0x99ef,
+	0x7003, 0x2110, 0x7007, 0x0014, 0x60c3, 0x0014, 0x0804, 0x9fd0,
+	0x080c, 0x9a31, 0x0010, 0x080c, 0x9a3a, 0x7003, 0x0200, 0x60c3,
+	0x0004, 0x0804, 0x9fd0, 0x080c, 0x9a3a, 0x7003, 0x0100, 0x700b,
+	0x0003, 0x700f, 0x2a00, 0x60c3, 0x0008, 0x0804, 0x9fd0, 0x080c,
+	0x9a3a, 0x7003, 0x0200, 0x0804, 0x9878, 0x080c, 0x9a3a, 0x7003,
+	0x0100, 0x782c, 0x9005, 0x0110, 0x700a, 0x0010, 0x700b, 0x0003,
+	0x7814, 0x700e, 0x60c3, 0x0008, 0x0804, 0x9fd0, 0x00d6, 0x080c,
+	0x9a3a, 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, 0x1847, 0x7904, 0x00fe,
+	0xd1ac, 0x1110, 0x9085, 0x0020, 0xd1a4, 0x0110, 0x9085, 0x0010,
+	0x2009, 0x1869, 0x210c, 0xd184, 0x1110, 0x9085, 0x0002, 0x0026,
+	0x2009, 0x1867, 0x210c, 0xd1e4, 0x0150, 0xc0c5, 0xbacc, 0xd28c,
+	0x1108, 0xc0cd, 0x9094, 0x0030, 0x9296, 0x0010, 0x0140, 0xd1ec,
+	0x0130, 0x9094, 0x0030, 0x9296, 0x0010, 0x0108, 0xc0bd, 0x002e,
+	0x7026, 0x60c3, 0x0014, 0x00de, 0x0804, 0x9fd0, 0x080c, 0x9a3a,
+	0x7003, 0x0210, 0x7007, 0x0014, 0x700f, 0x0100, 0x60c3, 0x0014,
+	0x0804, 0x9fd0, 0x080c, 0x9a3a, 0x7003, 0x0200, 0x0804, 0x97fe,
+	0x080c, 0x9a3a, 0x7003, 0x0100, 0x700b, 0x0003, 0x700f, 0x2a00,
+	0x60c3, 0x0008, 0x0804, 0x9fd0, 0x080c, 0x9a3a, 0x7003, 0x0100,
+	0x700b, 0x000b, 0x60c3, 0x0008, 0x0804, 0x9fd0, 0x0026, 0x00d6,
+	0x0036, 0x0046, 0x2019, 0x3200, 0x2021, 0x0800, 0x0040, 0x0026,
+	0x00d6, 0x0036, 0x0046, 0x2019, 0x2200, 0x2021, 0x0100, 0x080c,
+	0xa82b, 0xb810, 0x9305, 0x7002, 0xb814, 0x7006, 0x2069, 0x1800,
+	0x687c, 0x700a, 0x6880, 0x700e, 0x9485, 0x0029, 0x7012, 0x004e,
+	0x003e, 0x00de, 0x080c, 0x9fbe, 0x721a, 0x9f95, 0x0000, 0x7222,
+	0x7027, 0xffff, 0x2071, 0x024c, 0x002e, 0x0005, 0x0026, 0x080c,
+	0xa82b, 0x7003, 0x02ff, 0x7007, 0xfffc, 0x00d6, 0x2069, 0x1800,
+	0x687c, 0x700a, 0x6880, 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, 0xa82b, 0xb810, 0x9305, 0x7002, 0xb814,
+	0x7006, 0x2069, 0x1800, 0xb810, 0x9005, 0x1140, 0xb814, 0x9005,
+	0x1128, 0x700b, 0x00ff, 0x700f, 0xfffe, 0x0020, 0x687c, 0x700a,
+	0x6880, 0x700e, 0x0000, 0x9485, 0x0098, 0x7012, 0x004e, 0x003e,
+	0x00de, 0x080c, 0x9fbe, 0x721a, 0x7a08, 0x7222, 0x2f10, 0x7226,
+	0x2071, 0x024c, 0x002e, 0x0005, 0x080c, 0x9fbe, 0x721a, 0x7a08,
+	0x7222, 0x7814, 0x7026, 0x2071, 0x024c, 0x002e, 0x0005, 0x00b6,
+	0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x2069, 0x0200, 0x2071, 0x0240,
+	0x6004, 0x908a, 0x0085, 0x0a0c, 0x0dd5, 0x908a, 0x0092, 0x1a0c,
+	0x0dd5, 0x6110, 0x2158, 0xb9c0, 0x2c78, 0x2061, 0x0100, 0x619a,
+	0x9082, 0x0085, 0x0033, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be,
+	0x0005, 0x9aa8, 0x9ab7, 0x9ac2, 0x9aa6, 0x9aa6, 0x9aa6, 0x9aa8,
+	0x9aa6, 0x9aa6, 0x9aa6, 0x9aa6, 0x9aa6, 0x9aa6, 0x080c, 0x0dd5,
+	0x0411, 0x60c3, 0x0000, 0x0026, 0x080c, 0x2a57, 0x0228, 0x2011,
+	0x0101, 0x2204, 0xc0c5, 0x2012, 0x002e, 0x0804, 0x9fd0, 0x0431,
+	0x7808, 0x700a, 0x7814, 0x700e, 0x7017, 0xffff, 0x60c3, 0x000c,
+	0x0804, 0x9fd0, 0x0479, 0x7003, 0x0003, 0x7007, 0x0300, 0x60c3,
+	0x0004, 0x0804, 0x9fd0, 0x0026, 0x080c, 0xa82b, 0xb810, 0x9085,
+	0x8100, 0x7002, 0xb814, 0x7006, 0x2069, 0x1800, 0x687c, 0x700a,
+	0x6880, 0x700e, 0x7013, 0x0009, 0x0804, 0x9a0a, 0x0026, 0x080c,
+	0xa82b, 0xb810, 0x9085, 0x8400, 0x7002, 0xb814, 0x7006, 0x2069,
+	0x1800, 0x687c, 0x700a, 0x6880, 0x700e, 0x2001, 0x0099, 0x7012,
+	0x0804, 0x9a6c, 0x0026, 0x080c, 0xa82b, 0xb810, 0x9085, 0x8500,
+	0x7002, 0xb814, 0x7006, 0x2069, 0x1800, 0x687c, 0x700a, 0x6880,
+	0x700e, 0x2001, 0x0099, 0x7012, 0x0804, 0x9a6c, 0x00b6, 0x00c6,
+	0x00d6, 0x00e6, 0x00f6, 0x2c78, 0x2069, 0x0200, 0x2071, 0x0240,
+	0x7804, 0x908a, 0x0040, 0x0a0c, 0x0dd5, 0x908a, 0x0054, 0x1a0c,
+	0x0dd5, 0x7910, 0x2158, 0xb9c0, 0x2061, 0x0100, 0x619a, 0x9082,
+	0x0040, 0x0033, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x0005,
+	0x9b3d, 0x9be4, 0x9bb7, 0x9d06, 0x9b3b, 0x9b3b, 0x9b3b, 0x9b3b,
+	0x9b3b, 0x9b3b, 0x9b3b, 0xa369, 0xa375, 0xa381, 0xa38d, 0x9b3b,
+	0xa773, 0x9b3b, 0xa35d, 0x080c, 0x0dd5, 0x0096, 0x780b, 0xffff,
+	0x080c, 0x9b93, 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, 0x1689, 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, 0x1a01, 0x2003, 0x07d0, 0x2001, 0x1a00, 0x2003,
+	0x0009, 0x009e, 0x0005, 0x6813, 0x0008, 0xba8c, 0x8210, 0xb8cc,
+	0xd084, 0x0128, 0x7a46, 0x7b14, 0x7b4a, 0x722e, 0x732a, 0x9294,
+	0x00ff, 0xba8e, 0x8217, 0x721a, 0xba10, 0x9295, 0x0600, 0x7202,
+	0xba14, 0x7206, 0x2069, 0x1800, 0x6a7c, 0x720a, 0x6a80, 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, 0x9fd0, 0x6813, 0x0008, 0xb810, 0x9085, 0x0500, 0x7002,
+	0xb814, 0x7006, 0x2069, 0x1800, 0x687c, 0x700a, 0x6880, 0x700e,
+	0x7013, 0x0889, 0x080c, 0x9fbe, 0x721a, 0x7a08, 0x7222, 0x2f10,
+	0x7226, 0x2071, 0x024c, 0x0005, 0x00d6, 0x0096, 0x080c, 0x9ce4,
+	0x7814, 0x2048, 0x080c, 0xc823, 0x1130, 0x7814, 0x9084, 0x0700,
+	0x8007, 0x0033, 0x0010, 0x9006, 0x001b, 0x009e, 0x00de, 0x0005,
+	0x9c02, 0x9c6b, 0x9c7b, 0x9ca1, 0x9cad, 0x9cbe, 0x9cc6, 0x9c00,
+	0x080c, 0x0dd5, 0x0016, 0x0036, 0xa97c, 0x918c, 0x0003, 0x0118,
+	0x9186, 0x0003, 0x1198, 0xaba8, 0x7824, 0xd0cc, 0x1168, 0x7316,
+	0xa898, 0x701a, 0xa894, 0x701e, 0x003e, 0x001e, 0x2001, 0x19af,
+	0x2004, 0x60c2, 0x0804, 0x9fd0, 0xc3e5, 0x0c88, 0x9186, 0x0001,
+	0x190c, 0x0dd5, 0xaba8, 0x7824, 0xd0cc, 0x1904, 0x9c68, 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, 0x9fd0,
+	0xc3e5, 0x0804, 0x9c27, 0x2011, 0x0008, 0x2001, 0x180f, 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,
+	0x9fd0, 0x2011, 0x0028, 0x7824, 0xd0cc, 0x1128, 0x7216, 0x60c3,
+	0x0018, 0x0804, 0x9fd0, 0x0cd0, 0xc2e5, 0x2011, 0x0100, 0x7824,
+	0xd0cc, 0x0108, 0xc2e5, 0x7216, 0x702f, 0x0008, 0x7858, 0x9084,
+	0x00ff, 0x7036, 0x60c3, 0x0020, 0x0804, 0x9fd0, 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, 0x687c,
+	0x700a, 0x6880, 0x700e, 0x7824, 0xd0cc, 0x1168, 0x7013, 0x0898,
+	0x080c, 0x9fbe, 0x721a, 0x7a08, 0x7222, 0x2f10, 0x7226, 0x2071,
+	0x024c, 0x00de, 0x0005, 0x7013, 0x0889, 0x0c90, 0x0016, 0x7814,
+	0x9084, 0x0700, 0x8007, 0x0013, 0x001e, 0x0005, 0x9d16, 0x9d16,
+	0x9d18, 0x9d16, 0x9d16, 0x9d16, 0x9d32, 0x9d16, 0x080c, 0x0dd5,
+	0x7914, 0x918c, 0x08ff, 0x918d, 0xf600, 0x7916, 0x2009, 0x0003,
+	0x00b9, 0x2069, 0x1847, 0x6804, 0xd0bc, 0x0130, 0x682c, 0x9084,
+	0x00ff, 0x8007, 0x7032, 0x0010, 0x7033, 0x3f00, 0x60c3, 0x0001,
+	0x0804, 0x9fd0, 0x2009, 0x0003, 0x0019, 0x7033, 0x7f00, 0x0cb0,
+	0x0016, 0x080c, 0xa82b, 0x001e, 0xb810, 0x9085, 0x0100, 0x7002,
+	0xb814, 0x7006, 0x2069, 0x1800, 0x6a7c, 0x720a, 0x6a80, 0x720e,
+	0x7013, 0x0888, 0x918d, 0x0008, 0x7116, 0x080c, 0x9fbe, 0x721a,
+	0x7a08, 0x7222, 0x2f10, 0x7226, 0x0005, 0x00b6, 0x00e6, 0x00d6,
+	0x00c6, 0x0066, 0x0056, 0x0046, 0x0036, 0x2061, 0x0100, 0x2071,
+	0x1800, 0x7160, 0x7810, 0x2058, 0x76dc, 0x96b4, 0x0028, 0x0110,
+	0x737c, 0x7480, 0x2500, 0x76dc, 0x96b4, 0x0028, 0x0140, 0x2001,
+	0x04ff, 0x6062, 0x6067, 0xffff, 0x636a, 0x646e, 0x0050, 0x2001,
+	0x00ff, 0x9085, 0x0400, 0x6062, 0x6067, 0xffff, 0x606b, 0x0000,
+	0x616e, 0xb8b8, 0x6073, 0x0530, 0x6077, 0x0008, 0xb88c, 0x8000,
+	0x9084, 0x00ff, 0xb88e, 0x8007, 0x9085, 0x0020, 0x607a, 0x607f,
+	0x0000, 0x2b00, 0x6082, 0x6087, 0xffff, 0x7814, 0x0096, 0x2048,
+	0xa838, 0x608a, 0xa834, 0x608e, 0xa848, 0x60c6, 0xa844, 0x60ca,
+	0x009e, 0xb86c, 0x60ce, 0x60ab, 0x0036, 0x60af, 0x95d5, 0x60d7,
+	0x0000, 0x2001, 0x1837, 0x2004, 0x9084, 0x0028, 0x0128, 0x609f,
+	0x0000, 0x2001, 0x0092, 0x0048, 0x6028, 0xc0bd, 0x602a, 0x609f,
+	0x00ff, 0x6027, 0xffff, 0x2001, 0x00b2, 0x6016, 0x2009, 0x07d0,
+	0x080c, 0x830d, 0x003e, 0x004e, 0x005e, 0x006e, 0x00ce, 0x00de,
+	0x00ee, 0x00be, 0x0005, 0x00b6, 0x00e6, 0x00d6, 0x00c6, 0x0066,
+	0x0056, 0x0046, 0x0036, 0x2061, 0x0100, 0x2071, 0x1800, 0x7160,
+	0x7810, 0x2058, 0xb8a0, 0x2028, 0x76dc, 0xd6ac, 0x1168, 0x9582,
+	0x007e, 0x1250, 0x2500, 0x9094, 0xff80, 0x1130, 0x9080, 0x31d0,
+	0x2015, 0x9294, 0x00ff, 0x0020, 0xb910, 0xba14, 0x737c, 0x7480,
+	0x70dc, 0xd0ac, 0x1130, 0x9582, 0x007e, 0x1218, 0x9584, 0xff80,
+	0x0138, 0x9185, 0x0400, 0x6062, 0x6266, 0x636a, 0x646e, 0x0030,
+	0x6063, 0x0400, 0x6266, 0x606b, 0x0000, 0x616e, 0xb8b8, 0x6072,
+	0x6077, 0x0000, 0xb864, 0xd0a4, 0x0110, 0x6077, 0x0008, 0xb88c,
+	0x8000, 0x9084, 0x00ff, 0xb88e, 0x8007, 0x9085, 0x0020, 0x607a,
+	0x607f, 0x0000, 0x2b00, 0x6082, 0x6087, 0xffff, 0x7814, 0x0096,
+	0x2048, 0xa838, 0x608a, 0xa834, 0x608e, 0xa848, 0x60c6, 0xa844,
+	0x60ca, 0x009e, 0xb86c, 0x60ce, 0x60ab, 0x0036, 0x60af, 0x95d5,
+	0x60d7, 0x0000, 0xbac0, 0x629e, 0x00f6, 0x2079, 0x0140, 0x7803,
+	0x0000, 0x00fe, 0x2009, 0x0092, 0x6116, 0x2009, 0x07d0, 0x080c,
+	0x830d, 0x003e, 0x004e, 0x005e, 0x006e, 0x00ce, 0x00de, 0x00ee,
+	0x00be, 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,
+	0xb8a0, 0x2028, 0xb910, 0xba14, 0x737c, 0x7480, 0x7820, 0x90be,
+	0x0006, 0x0904, 0x9f2d, 0x90be, 0x000a, 0x1904, 0x9ee9, 0x609f,
+	0x0000, 0x7814, 0x2048, 0xa87c, 0xd0fc, 0x05d0, 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,
+	0x2048, 0xa878, 0xc0fc, 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, 0x1837, 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, 0xa810, 0x2009, 0x07d0, 0x60c4,
+	0x9084, 0xfff0, 0x9005, 0x0110, 0x2009, 0x1b58, 0x080c, 0x830d,
+	0x003e, 0x004e, 0x005e, 0x00ce, 0x00de, 0x00ee, 0x009e, 0x00be,
+	0x0005, 0x7804, 0x9086, 0x0040, 0x0904, 0x9f69, 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, 0xbac0, 0x629e, 0x080c,
+	0xa810, 0x2009, 0x07d0, 0x60c4, 0x9084, 0xfff0, 0x9005, 0x0110,
+	0x2009, 0x1b58, 0x080c, 0x830d, 0x003e, 0x004e, 0x005e, 0x00ce,
+	0x00de, 0x00ee, 0x009e, 0x00be, 0x0005, 0x7814, 0x2048, 0xa87c,
+	0x9084, 0x0003, 0x9086, 0x0002, 0x0904, 0x9f85, 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, 0xbac0, 0x629e, 0x080c, 0xa7ed, 0x0804,
+	0x9f19, 0xb8cc, 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, 0x9efc, 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, 0xbac0, 0x629e, 0x7824, 0xd0cc, 0x0120, 0x080c, 0xa810,
+	0x0804, 0x9f19, 0x080c, 0xa7ed, 0x0804, 0x9f19, 0x7a10, 0x00b6,
+	0x2258, 0xba8c, 0x8210, 0x9294, 0x00ff, 0xba8e, 0x00be, 0x8217,
+	0x0005, 0x00d6, 0x2069, 0x19e5, 0x6843, 0x0001, 0x00de, 0x0005,
+	0x60a3, 0x0056, 0x60a7, 0x9575, 0x00f1, 0x080c, 0x82ff, 0x0005,
+	0x0016, 0x2001, 0x180c, 0x200c, 0x9184, 0x0600, 0x9086, 0x0600,
+	0x0128, 0x0089, 0x080c, 0x82ff, 0x001e, 0x0005, 0xc1e5, 0x2001,
+	0x180c, 0x2102, 0x2001, 0x19e6, 0x2003, 0x0000, 0x2001, 0x19ee,
+	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, 0x717d, 0x11e8, 0x2001, 0x1a01, 0x2004,
+	0x9005, 0x1904, 0xa062, 0x0066, 0x2031, 0x0001, 0x080c, 0x722d,
+	0x006e, 0x1160, 0x2061, 0x0100, 0x6020, 0xd0b4, 0x1120, 0x6024,
+	0xd084, 0x090c, 0x0dd5, 0x080c, 0x82ff, 0x0460, 0x00c6, 0x2061,
+	0x19e5, 0x00d0, 0x6904, 0x9194, 0x4000, 0x0548, 0x080c, 0x9ffc,
+	0x080c, 0x2bb1, 0x00c6, 0x2061, 0x19e5, 0x6128, 0x9192, 0x0008,
+	0x1258, 0x8108, 0x612a, 0x6124, 0x00ce, 0x81ff, 0x0198, 0x080c,
+	0x82ff, 0x080c, 0x9ff3, 0x0070, 0x6124, 0x91e5, 0x0000, 0x0140,
+	0x080c, 0xe6a1, 0x080c, 0x8308, 0x2009, 0x0014, 0x080c, 0xabe6,
+	0x00ce, 0x0000, 0x002e, 0x001e, 0x00de, 0x00ce, 0x0005, 0x2001,
+	0x1a01, 0x2004, 0x9005, 0x1db0, 0x00c6, 0x2061, 0x19e5, 0x6128,
+	0x9192, 0x0003, 0x1e08, 0x8108, 0x612a, 0x00ce, 0x080c, 0x82ff,
+	0x080c, 0x5cb7, 0x2009, 0x1846, 0x2114, 0x8210, 0x220a, 0x0c10,
+	0x0096, 0x00c6, 0x00d6, 0x00e6, 0x0016, 0x0026, 0x080c, 0x8315,
+	0x2071, 0x19e5, 0x713c, 0x81ff, 0x0904, 0xa102, 0x2061, 0x0100,
+	0x2069, 0x0140, 0x080c, 0x717d, 0x1500, 0x0036, 0x2019, 0x0002,
+	0x080c, 0xa2ac, 0x003e, 0x713c, 0x2160, 0x080c, 0xe6a1, 0x2009,
+	0x004a, 0x6220, 0x9296, 0x0009, 0x1130, 0x6114, 0x2148, 0xa87b,
+	0x0006, 0x2009, 0x004a, 0x080c, 0xabe6, 0x0066, 0x2031, 0x0001,
+	0x080c, 0x722d, 0x006e, 0x0804, 0xa102, 0x6904, 0xd1f4, 0x0904,
+	0xa109, 0x080c, 0x2bb1, 0x00c6, 0x703c, 0x9065, 0x090c, 0x0dd5,
+	0x6020, 0x00ce, 0x9086, 0x0006, 0x1528, 0x61c8, 0x60c4, 0x9105,
+	0x1508, 0x2009, 0x180c, 0x2104, 0xd0d4, 0x01e0, 0x6214, 0x9294,
+	0x1800, 0x1128, 0x6224, 0x9294, 0x0002, 0x1560, 0x0030, 0xc0d4,
+	0x200a, 0xd0cc, 0x0110, 0x080c, 0x2b04, 0x6014, 0x9084, 0xe7fd,
+	0x9085, 0x0010, 0x6016, 0x703c, 0x2060, 0x2009, 0x0049, 0x080c,
+	0xabe6, 0x00c0, 0x0036, 0x2019, 0x0001, 0x080c, 0xa2ac, 0x003e,
+	0x713c, 0x2160, 0x080c, 0xe6a1, 0x2009, 0x004a, 0x6220, 0x9296,
+	0x0009, 0x1130, 0x6114, 0x2148, 0xa87b, 0x0006, 0x2009, 0x004a,
+	0x080c, 0xabe6, 0x002e, 0x001e, 0x00ee, 0x00de, 0x00ce, 0x009e,
+	0x0005, 0xd1ec, 0x1904, 0xa0b9, 0x0804, 0xa0bb, 0x0026, 0x00e6,
+	0x2071, 0x19e5, 0x7048, 0xd084, 0x01d8, 0x713c, 0x81ff, 0x01c0,
+	0x2071, 0x0100, 0x9188, 0x0008, 0x2114, 0x928e, 0x0006, 0x1138,
+	0x7014, 0x9084, 0x1984, 0x9085, 0x0012, 0x7016, 0x0048, 0x928e,
+	0x0009, 0x0db0, 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,
+	0xbca0, 0x2071, 0x19e5, 0x7018, 0x2058, 0x8bff, 0x0190, 0xb8a0,
 	0x9406, 0x0118, 0xb854, 0x2058, 0x0cc0, 0x6014, 0x0096, 0x2048,
-	0xac6c, 0xad70, 0xae78, 0x009e, 0x080c, 0x60b0, 0x0110, 0x9085,
+	0xac6c, 0xad70, 0xae78, 0x009e, 0x080c, 0x64ff, 0x0110, 0x9085,
 	0x0001, 0x012e, 0x000e, 0x004e, 0x005e, 0x006e, 0x00ce, 0x00de,
-	0x00ee, 0x00be, 0x0005, 0x080c, 0x8aa4, 0x7003, 0x1200, 0x7838,
+	0x00ee, 0x00be, 0x0005, 0x080c, 0x99ef, 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,
+	0x0020, 0x2061, 0x1800, 0x607c, 0x6180, 0x9084, 0x00ff, 0x700a,
+	0x710e, 0x00ce, 0x60c3, 0x002c, 0x0804, 0x9fd0, 0x080c, 0x99ef,
 	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,
+	0x700a, 0xb814, 0x700e, 0x60c3, 0x0008, 0x0804, 0x9fd0, 0x0156,
+	0x080c, 0x9a3a, 0x7003, 0x0200, 0x080c, 0x8368, 0x20a9, 0x0006,
+	0x2011, 0xfff4, 0x2019, 0xfff5, 0x9ef0, 0x0002, 0x2305, 0x2072,
+	0x8e70, 0x2205, 0x2072, 0x8e70, 0x9398, 0x0002, 0x9290, 0x0002,
+	0x1f04, 0xa1a6, 0x60c3, 0x001c, 0x015e, 0x0804, 0x9fd0, 0x0016,
+	0x0026, 0x080c, 0x9a16, 0x080c, 0x9a28, 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,
+	0x8003, 0x60c2, 0x080c, 0x9fd0, 0x002e, 0x001e, 0x0005, 0x20a9,
+	0x0010, 0x4003, 0x080c, 0xa816, 0x20a1, 0x0240, 0x22a8, 0x4003,
+	0x0c68, 0x080c, 0x99ef, 0x7003, 0x6200, 0x7808, 0x700e, 0x60c3,
+	0x0008, 0x0804, 0x9fd0, 0x0016, 0x0026, 0x080c, 0x99ef, 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,
+	0x9088, 0x0002, 0x21a8, 0x4003, 0x8003, 0x60c2, 0x080c, 0x9fd0,
 	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,
+	0x8000, 0x2071, 0x19e5, 0x700c, 0x2060, 0x8cff, 0x0178, 0x080c,
+	0xca24, 0x1110, 0x080c, 0xb51d, 0x600c, 0x0006, 0x080c, 0xcc8b,
+	0x080c, 0xab6b, 0x080c, 0xa39c, 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,
+	0x2069, 0x0100, 0x2079, 0x0140, 0x2071, 0x19e5, 0x7024, 0x2060,
+	0x8cff, 0x01f8, 0x080c, 0x9ffc, 0x6ac0, 0x68c3, 0x0000, 0x080c,
+	0x8308, 0x00c6, 0x2061, 0x0100, 0x080c, 0xa967, 0x00ce, 0x20a9,
+	0x01f4, 0x0461, 0x2009, 0x0013, 0x080c, 0xabe6, 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,
+	0x0004, 0x0d60, 0x080c, 0x8308, 0x6814, 0x9084, 0x0001, 0x0110,
+	0x68a7, 0x95f5, 0x6817, 0x0008, 0x68c3, 0x0000, 0x2011, 0x5c61,
+	0x080c, 0x8285, 0x20a9, 0x01f4, 0x0009, 0x08c0, 0x6824, 0xd094,
+	0x0140, 0x6827, 0x0004, 0x7804, 0x9084, 0x4000, 0x190c, 0x2bb1,
+	0x0090, 0xd084, 0x0118, 0x6827, 0x0001, 0x0010, 0x1f04, 0xa28e,
+	0x7804, 0x9084, 0x1000, 0x0138, 0x2001, 0x0100, 0x080c, 0x2ba1,
+	0x9006, 0x080c, 0x2ba1, 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,
+	0x2079, 0x0140, 0x2071, 0x19e5, 0x703c, 0x2060, 0x8cff, 0x0904,
+	0xa33e, 0x9386, 0x0002, 0x1128, 0x6814, 0x9084, 0x0002, 0x0904,
+	0xa33e, 0x68af, 0x95f5, 0x6817, 0x0010, 0x2009, 0x00fa, 0x8109,
+	0x1df0, 0x69c6, 0x68cb, 0x0008, 0x080c, 0x8315, 0x080c, 0x1ebc,
+	0x0046, 0x2009, 0x00a5, 0x080c, 0x0e51, 0x2021, 0x0169, 0x2404,
 	0x9084, 0x000f, 0x9086, 0x0004, 0x11f8, 0x68af, 0x95f5, 0x68c6,
-	0x68cb, 0x0008, 0x00e6, 0x00f6, 0x2079, 0x0090, 0x2071, 0x1a34,
+	0x68cb, 0x0008, 0x00e6, 0x00f6, 0x2079, 0x0090, 0x2071, 0x1a64,
 	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,
+	0x9005, 0x1110, 0x7887, 0x0001, 0x2001, 0x197f, 0x200c, 0x080c,
+	0x0e51, 0x004e, 0x20a9, 0x03e8, 0x6824, 0xd094, 0x0140, 0x6827,
+	0x0004, 0x7804, 0x9084, 0x4000, 0x190c, 0x2bb1, 0x0090, 0xd08c,
+	0x0118, 0x6827, 0x0002, 0x0010, 0x1f04, 0xa314, 0x7804, 0x9084,
+	0x1000, 0x0138, 0x2001, 0x0100, 0x080c, 0x2ba1, 0x9006, 0x080c,
+	0x2ba1, 0x6827, 0x4000, 0x6824, 0x83ff, 0x1140, 0x2009, 0x0049,
+	0x6020, 0x9086, 0x0009, 0x0110, 0x080c, 0xabe6, 0x000e, 0x001e,
+	0x002e, 0x006e, 0x00ce, 0x00de, 0x00ee, 0x00fe, 0x015e, 0x012e,
+	0x0005, 0x00d6, 0x0126, 0x2091, 0x8000, 0x2069, 0x19e5, 0x6a06,
+	0x012e, 0x00de, 0x0005, 0x00d6, 0x0126, 0x2091, 0x8000, 0x2069,
+	0x19e5, 0x6a32, 0x012e, 0x00de, 0x0005, 0x080c, 0x9b93, 0x7814,
+	0x080c, 0x54bf, 0x0108, 0x782c, 0x7032, 0x7042, 0x7047, 0x1000,
+	0x0478, 0x080c, 0x9b93, 0x7814, 0x080c, 0x54bf, 0x0108, 0x782c,
+	0x7032, 0x7042, 0x7047, 0x4000, 0x0418, 0x080c, 0x9b93, 0x7814,
+	0x080c, 0x54bf, 0x0108, 0x782c, 0x7032, 0x7042, 0x7047, 0x2000,
+	0x00b8, 0x080c, 0x9b93, 0x7814, 0x080c, 0x54bf, 0x0108, 0x782c,
+	0x7032, 0x7042, 0x7047, 0x0400, 0x0058, 0x080c, 0x9b93, 0x7814,
+	0x080c, 0x54bf, 0x0108, 0x782c, 0x7032, 0x7042, 0x7047, 0x0200,
+	0x60c3, 0x0020, 0x0804, 0x9fd0, 0x00e6, 0x2071, 0x19e5, 0x7020,
+	0x9005, 0x0110, 0x8001, 0x7022, 0x00ee, 0x0005, 0x00f6, 0x00e6,
+	0x00d6, 0x00c6, 0x0076, 0x0066, 0x0006, 0x0126, 0x2091, 0x8000,
+	0x2071, 0x19e5, 0x7614, 0x2660, 0x2678, 0x2039, 0x0001, 0x87ff,
+	0x0904, 0xa441, 0x8cff, 0x0904, 0xa441, 0x6020, 0x9086, 0x0006,
+	0x1904, 0xa43c, 0x88ff, 0x0138, 0x2800, 0x9c06, 0x1904, 0xa43c,
+	0x2039, 0x0000, 0x0050, 0x6010, 0x9b06, 0x1904, 0xa43c, 0x85ff,
+	0x0120, 0x6054, 0x9106, 0x1904, 0xa43c, 0x7024, 0x9c06, 0x15b0,
+	0x2069, 0x0100, 0x68c0, 0x9005, 0x1160, 0x6824, 0xd084, 0x0148,
+	0x6827, 0x0001, 0x080c, 0x8308, 0x080c, 0xa4c6, 0x7027, 0x0000,
+	0x0428, 0x080c, 0x8308, 0x6820, 0xd0b4, 0x0110, 0x68a7, 0x95f5,
+	0x6817, 0x0008, 0x68c3, 0x0000, 0x080c, 0xa4c6, 0x7027, 0x0000,
+	0x0036, 0x2069, 0x0140, 0x6b04, 0x9384, 0x1000, 0x0138, 0x2001,
+	0x0100, 0x080c, 0x2ba1, 0x9006, 0x080c, 0x2ba1, 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, 0xc823, 0x0110,
+	0x080c, 0xe223, 0x009e, 0x080c, 0xab9c, 0x080c, 0xa39c, 0x88ff,
+	0x1190, 0x00ce, 0x0804, 0xa3b7, 0x2c78, 0x600c, 0x2060, 0x0804,
+	0xa3b7, 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, 0x19e5, 0x7638, 0x2660,
+	0x2678, 0x8cff, 0x0904, 0xa4b5, 0x6020, 0x9086, 0x0006, 0x1904,
+	0xa4b0, 0x87ff, 0x0128, 0x2700, 0x9c06, 0x1904, 0xa4b0, 0x0040,
+	0x6010, 0x9b06, 0x15e8, 0x85ff, 0x0118, 0x6054, 0x9106, 0x15c0,
+	0x703c, 0x9c06, 0x1168, 0x0036, 0x2019, 0x0001, 0x080c, 0xa2ac,
+	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, 0xc823, 0x0110, 0x080c,
+	0xe223, 0x080c, 0xab9c, 0x87ff, 0x1198, 0x00ce, 0x0804, 0xa461,
+	0x2c78, 0x600c, 0x2060, 0x0804, 0xa461, 0x9006, 0x012e, 0x000e,
+	0x002e, 0x006e, 0x00ce, 0x009e, 0x00de, 0x00ee, 0x00fe, 0x0005,
+	0x601b, 0x0000, 0x00ce, 0x97bd, 0x0001, 0x0c80, 0x00e6, 0x2071,
+	0x19e5, 0x2001, 0x1800, 0x2004, 0x9086, 0x0002, 0x1118, 0x7007,
+	0x0005, 0x0010, 0x7007, 0x0000, 0x00ee, 0x0005, 0x00f6, 0x00e6,
 	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,
+	0x19e5, 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, 0x19e5, 0x760c,
+	0x2660, 0x2678, 0x8cff, 0x0904, 0xa5a2, 0x6010, 0x00b6, 0x2058,
+	0xb8a0, 0x00be, 0x9206, 0x1904, 0xa59d, 0x7024, 0x9c06, 0x1520,
+	0x2069, 0x0100, 0x68c0, 0x9005, 0x0904, 0xa579, 0x080c, 0x9ffc,
+	0x68c3, 0x0000, 0x080c, 0xa4c6, 0x7027, 0x0000, 0x0036, 0x2069,
+	0x0140, 0x6b04, 0x9384, 0x1000, 0x0138, 0x2001, 0x0100, 0x080c,
+	0x2ba1, 0x9006, 0x080c, 0x2ba1, 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, 0xca13,
+	0x1158, 0x080c, 0x3093, 0x080c, 0xca24, 0x11f0, 0x080c, 0xb51d,
+	0x00d8, 0x080c, 0xa4c6, 0x08c0, 0x080c, 0xca24, 0x1118, 0x080c,
+	0xb51d, 0x0090, 0x6014, 0x2048, 0x080c, 0xc823, 0x0168, 0x6020,
+	0x9086, 0x0003, 0x1508, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000,
+	0x080c, 0x6a3a, 0x080c, 0xca07, 0x080c, 0xcc8b, 0x080c, 0xab9c,
+	0x080c, 0xa39c, 0x00ce, 0x0804, 0xa522, 0x2c78, 0x600c, 0x2060,
+	0x0804, 0xa522, 0x012e, 0x000e, 0x002e, 0x006e, 0x00ce, 0x00de,
+	0x00ee, 0x00fe, 0x009e, 0x0005, 0x6020, 0x9086, 0x0006, 0x1d20,
+	0x080c, 0xe223, 0x0c08, 0x00d6, 0x080c, 0x9a3a, 0x7003, 0x0200,
+	0x7007, 0x0014, 0x60c3, 0x0014, 0x20e1, 0x0001, 0x2099, 0x1987,
+	0x20e9, 0x0000, 0x20a1, 0x0250, 0x20a9, 0x0004, 0x4003, 0x7023,
+	0x0004, 0x7027, 0x7878, 0x080c, 0x9fd0, 0x00de, 0x0005, 0x080c,
+	0x9a3a, 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, 0x9fd0, 0x00b6, 0x00d6, 0x0016, 0x00d6, 0x2f68,
+	0x2009, 0x0035, 0x080c, 0xce90, 0x00de, 0x1904, 0xa650, 0x080c,
+	0x99ef, 0x7003, 0x1300, 0x782c, 0x080c, 0xa752, 0x2068, 0x6820,
+	0x9086, 0x0003, 0x0560, 0x7810, 0x2058, 0xbaa0, 0x080c, 0xaad5,
+	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,
+	0xaad5, 0x1130, 0x7810, 0x2058, 0xb8a0, 0x9082, 0x007e, 0x0250,
+	0x00d6, 0x2069, 0x181f, 0x2d04, 0x700a, 0x8d68, 0x2d04, 0x700e,
+	0x00de, 0x0010, 0x6034, 0x700e, 0x7838, 0x7012, 0x783c, 0x7016,
+	0x60c3, 0x000c, 0x001e, 0x00de, 0x080c, 0x9fd0, 0x00be, 0x0005,
+	0x781b, 0x0001, 0x7803, 0x0006, 0x001e, 0x00de, 0x00be, 0x0005,
+	0x792c, 0x9180, 0x0008, 0x200c, 0x9186, 0x0006, 0x01c0, 0x9186,
+	0x0003, 0x0904, 0xa6ca, 0x9186, 0x0005, 0x0904, 0xa6b3, 0x9186,
+	0x0004, 0x05d8, 0x9186, 0x0008, 0x0904, 0xa6bb, 0x7807, 0x0037,
+	0x782f, 0x0003, 0x7817, 0x1700, 0x080c, 0xa72f, 0x0005, 0x080c,
+	0xa6f0, 0x00d6, 0x0026, 0x792c, 0x2168, 0x2009, 0x4000, 0x6800,
+	0x0002, 0xa694, 0xa69f, 0xa696, 0xa69f, 0xa69b, 0xa694, 0xa694,
+	0xa69f, 0xa69f, 0xa69f, 0xa69f, 0xa694, 0xa694, 0xa694, 0xa694,
+	0xa694, 0xa69f, 0xa694, 0xa69f, 0x080c, 0x0dd5, 0x6824, 0xd0e4,
+	0x0110, 0xd0cc, 0x0110, 0x900e, 0x0010, 0x2009, 0x2000, 0x682c,
+	0x7022, 0x6830, 0x7026, 0x0804, 0xa6e9, 0x080c, 0xa6f0, 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, 0x9fd0,
+	0x00b6, 0x0036, 0x0046, 0x0056, 0x0066, 0x080c, 0x9a3a, 0x9006,
+	0x7003, 0x0200, 0x7938, 0x710a, 0x793c, 0x710e, 0x7810, 0x2058,
+	0xb8a0, 0x080c, 0xaad5, 0x1118, 0x9092, 0x007e, 0x0268, 0x00d6,
+	0x2069, 0x181f, 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,
+	0x9a3a, 0x7003, 0x0100, 0x782c, 0x700a, 0x7814, 0x700e, 0x700e,
+	0x60c3, 0x0008, 0x0804, 0x9fd0, 0x080c, 0x99e6, 0x7003, 0x1400,
+	0x7838, 0x700a, 0x0079, 0x783c, 0x700e, 0x782c, 0x7012, 0x7830,
+	0x7016, 0x7834, 0x9084, 0x00ff, 0x8007, 0x701a, 0x60c3, 0x0010,
+	0x0804, 0x9fd0, 0x00e6, 0x2071, 0x0240, 0x0006, 0x00f6, 0x2078,
+	0x7810, 0x00b6, 0x2058, 0xb8cc, 0xd084, 0x0120, 0x7848, 0x702a,
+	0x7844, 0x702e, 0x00be, 0x00fe, 0x000e, 0x00ee, 0x0005, 0x080c,
+	0x9a31, 0x7003, 0x0100, 0x782c, 0x700a, 0x7814, 0x700e, 0x60c3,
+	0x0008, 0x0804, 0x9fd0, 0x0021, 0x60c3, 0x0000, 0x0804, 0x9fd0,
+	0x00d6, 0x080c, 0xa82b, 0xb810, 0x9085, 0x0300, 0x7002, 0xb814,
+	0x7006, 0x2069, 0x1800, 0x687c, 0x700a, 0x6880, 0x700e, 0x7013,
+	0x0819, 0x080c, 0x9fbe, 0x721a, 0x2f10, 0x7222, 0x7a08, 0x7226,
+	0x2071, 0x024c, 0x00de, 0x0005, 0x00a9, 0x7914, 0x712a, 0x60c3,
+	0x0000, 0x60a7, 0x9575, 0x0026, 0x080c, 0x2a57, 0x0228, 0x2011,
+	0x0101, 0x2204, 0xc0c5, 0x2012, 0x002e, 0x080c, 0x9ff3, 0x080c,
+	0x82ff, 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, 0xa82b,
+	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, 0x19b0, 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, 0x080c,
+	0x99ef, 0x0016, 0x0026, 0x0096, 0x00d6, 0x7814, 0x2048, 0x7013,
+	0x0138, 0x2001, 0x1837, 0x2004, 0x9084, 0x0028, 0x1138, 0x2001,
+	0x197c, 0x2004, 0x9086, 0xaaaa, 0x1904, 0xa8d0, 0x7003, 0x5400,
+	0x00c6, 0x2061, 0x1800, 0x607c, 0x9084, 0x00ff, 0xa998, 0x810f,
+	0x918c, 0xff00, 0x9105, 0x700a, 0x6080, 0x700e, 0xa998, 0x918c,
+	0xff00, 0x7112, 0x20a9, 0x0004, 0x2009, 0x1805, 0x2e10, 0x9290,
+	0x0006, 0x2104, 0x2012, 0x8108, 0x8210, 0x1f04, 0xa861, 0x20a9,
+	0x0004, 0x2009, 0x1801, 0x2104, 0x2012, 0x8108, 0x8210, 0x1f04,
+	0xa86b, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x0029, 0x2098, 0x2009,
+	0x0006, 0x20a9, 0x0001, 0x4002, 0x8007, 0x2012, 0x8210, 0x8109,
+	0x1dc0, 0x00d6, 0x2069, 0x0200, 0x080c, 0xa816, 0x00de, 0x2071,
+	0x0240, 0x2011, 0x0240, 0x2009, 0x0002, 0x20a9, 0x0001, 0x4002,
+	0x8007, 0x2012, 0x8210, 0x8109, 0x1dc0, 0x2009, 0x0008, 0x20a9,
+	0x0001, 0x4002, 0x8007, 0x2012, 0x8210, 0x8109, 0x1dc0, 0xa85c,
+	0x9080, 0x0031, 0x2098, 0x2009, 0x0008, 0x20a9, 0x0001, 0x4002,
+	0x8007, 0x2012, 0x8210, 0x8109, 0x1dc0, 0x00ce, 0x60c3, 0x004c,
+	0x60a3, 0x0056, 0x60a7, 0x9575, 0x2001, 0x1837, 0x2004, 0x9084,
+	0x0028, 0x1168, 0x080c, 0x717d, 0x0150, 0x6028, 0xc0bd, 0x602a,
+	0x6014, 0x9084, 0x1804, 0x9085, 0x0029, 0x6016, 0x0010, 0x080c,
+	0x9fd0, 0x080c, 0x82ff, 0x00de, 0x009e, 0x002e, 0x001e, 0x0005,
+	0x00e6, 0x2071, 0x0240, 0x2001, 0x2200, 0x9085, 0x00ff, 0x7002,
+	0x7007, 0xffff, 0x2071, 0x0100, 0x709b, 0x00ff, 0x00ee, 0x0804,
+	0xa846, 0x080c, 0x99ef, 0x0016, 0x0026, 0x0096, 0x00d6, 0x7814,
+	0x2048, 0x7013, 0x0138, 0x7003, 0x5500, 0x00c6, 0xa89c, 0x9084,
+	0x00ff, 0xa998, 0x810f, 0x918c, 0xff00, 0x9105, 0x700a, 0xa99c,
+	0x918c, 0xff00, 0xa8a0, 0x9084, 0x00ff, 0x9105, 0x700e, 0xa998,
+	0x918c, 0xff00, 0x2061, 0x1800, 0x607c, 0x9084, 0x00ff, 0x910d,
+	0x7112, 0x6180, 0x7116, 0x2009, 0x0008, 0xa860, 0x20e0, 0xa85c,
+	0x9080, 0x0029, 0x2098, 0x2e10, 0x9290, 0x0006, 0x20a9, 0x0001,
+	0x4002, 0x8007, 0x2012, 0x8210, 0x8109, 0x1dc0, 0x20a9, 0x0004,
+	0x2009, 0x1805, 0x2104, 0x2012, 0x8108, 0x8210, 0x1f04, 0xa922,
+	0x20a9, 0x0002, 0x2009, 0x1801, 0x2104, 0x2012, 0x8108, 0x8210,
+	0x1f04, 0xa92c, 0x00d6, 0x0016, 0x2069, 0x0200, 0x080c, 0xa816,
+	0x001e, 0x00de, 0x2071, 0x0240, 0x20a9, 0x0002, 0x2009, 0x1803,
+	0x2011, 0x0240, 0x2104, 0x2012, 0x8108, 0x8210, 0x1f04, 0xa942,
+	0x2009, 0x0008, 0x4002, 0x8007, 0x2012, 0x8210, 0x8109, 0x1dd0,
+	0x9006, 0x20a9, 0x0008, 0x2012, 0x8210, 0x1f04, 0xa953, 0x00ce,
+	0x60c3, 0x004c, 0x60a3, 0x0056, 0x60a7, 0x9575, 0x080c, 0x9fd0,
+	0x080c, 0x82ff, 0x00de, 0x009e, 0x002e, 0x001e, 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, 0x1f48, 0x080c, 0x8ee4, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x9548, 0x012e, 0x009e, 0x00de, 0x0005, 0x00f6, 0x00e6,
+	0x00d6, 0x00c6, 0x00a6, 0x0096, 0x0066, 0x0126, 0x2091, 0x8000,
+	0x2071, 0x19e5, 0x760c, 0x2660, 0x2678, 0x8cff, 0x0904, 0xaa35,
 	0x7024, 0x9c06, 0x1520, 0x2069, 0x0100, 0x68c0, 0x9005, 0x0904,
-	0x951c, 0x080c, 0x8fbb, 0x68c3, 0x0000, 0x080c, 0x9469, 0x7027,
+	0xaa0c, 0x080c, 0x9ffc, 0x68c3, 0x0000, 0x080c, 0xa4c6, 0x7027,
 	0x0000, 0x0036, 0x2069, 0x0140, 0x6b04, 0x9384, 0x1000, 0x0138,
-	0x2001, 0x0100, 0x080c, 0x2987, 0x9006, 0x080c, 0x2987, 0x2069,
+	0x2001, 0x0100, 0x080c, 0x2ba1, 0x9006, 0x080c, 0x2ba1, 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,
+	0x0000, 0x080c, 0xca13, 0x1158, 0x080c, 0x3093, 0x080c, 0xca24,
+	0x11f0, 0x080c, 0xb51d, 0x00d8, 0x080c, 0xa4c6, 0x08c0, 0x080c,
+	0xca24, 0x1118, 0x080c, 0xb51d, 0x0090, 0x6014, 0x2048, 0x080c,
+	0xc823, 0x0168, 0x6020, 0x9086, 0x0003, 0x1520, 0xa867, 0x0103,
+	0xab7a, 0xa877, 0x0000, 0x080c, 0x6a46, 0x080c, 0xca07, 0x080c,
+	0xcc8b, 0x080c, 0xab9c, 0x080c, 0xa39c, 0x00ce, 0x0804, 0xa9bd,
+	0x2c78, 0x600c, 0x2060, 0x0804, 0xa9bd, 0x700f, 0x0000, 0x700b,
+	0x0000, 0x012e, 0x006e, 0x009e, 0x00ae, 0x00ce, 0x00de, 0x00ee,
+	0x00fe, 0x0005, 0x6020, 0x9086, 0x0006, 0x1d08, 0x080c, 0xe223,
+	0x08f0, 0x00d6, 0x0156, 0x080c, 0x9a3a, 0x7a14, 0x82ff, 0x0138,
+	0x7003, 0x0100, 0x700b, 0x0003, 0x60c3, 0x0008, 0x0490, 0x7003,
+	0x0200, 0x7007, 0x0000, 0x2069, 0x1800, 0x901e, 0x6800, 0x9086,
+	0x0004, 0x1110, 0xc38d, 0x0060, 0x080c, 0x717d, 0x1110, 0xc3ad,
+	0x0008, 0xc3a5, 0x6adc, 0xd29c, 0x1110, 0xd2ac, 0x0108, 0xc39d,
+	0x730e, 0x080c, 0x8368, 0x20a9, 0x0006, 0x2011, 0xfff4, 0x2019,
+	0xfff5, 0x2071, 0x0250, 0x2305, 0x2072, 0x8e70, 0x2205, 0x2072,
+	0x8e70, 0x9398, 0x0002, 0x9290, 0x0002, 0x1f04, 0xaa7b, 0x60c3,
+	0x0020, 0x080c, 0x9fd0, 0x015e, 0x00de, 0x0005, 0x0156, 0x080c,
+	0x9a3a, 0x7a14, 0x82ff, 0x0168, 0x9286, 0xffff, 0x0118, 0x9282,
+	0x000e, 0x1238, 0x7003, 0x0100, 0x700b, 0x0003, 0x60c3, 0x0008,
+	0x0488, 0x7003, 0x0200, 0x7007, 0x001c, 0x700f, 0x0001, 0x2011,
+	0x19bb, 0x2204, 0x8007, 0x701a, 0x8210, 0x2204, 0x8007, 0x701e,
+	0x0421, 0x1120, 0xb8a0, 0x9082, 0x007f, 0x0248, 0x2001, 0x181f,
+	0x2004, 0x7022, 0x2001, 0x1820, 0x2004, 0x7026, 0x0030, 0x2001,
+	0x1818, 0x2004, 0x9084, 0x00ff, 0x7026, 0x20a9, 0x0004, 0x20e1,
+	0x0001, 0x2099, 0x1805, 0x20e9, 0x0000, 0x20a1, 0x0256, 0x4003,
+	0x60c3, 0x001c, 0x015e, 0x0804, 0x9fd0, 0x0006, 0x2001, 0x1837,
+	0x2004, 0xd0ac, 0x000e, 0x0005, 0x2011, 0x0003, 0x080c, 0xa349,
+	0x2011, 0x0002, 0x080c, 0xa353, 0x080c, 0xa236, 0x0036, 0x901e,
+	0x080c, 0xa2ac, 0x003e, 0x0005, 0x080c, 0x31c9, 0x0188, 0x0016,
+	0x00b6, 0x00c6, 0x7010, 0x9085, 0x0020, 0x7012, 0x2009, 0x007e,
+	0x080c, 0x63cd, 0xb85c, 0xc0ac, 0xb85e, 0x00ce, 0x00be, 0x001e,
+	0x0005, 0x2071, 0x188d, 0x7000, 0x9005, 0x0140, 0x2001, 0x0976,
+	0x2071, 0x1800, 0x7076, 0x707a, 0x706b, 0xffe0, 0x2071, 0x1800,
+	0x7074, 0x7056, 0x705b, 0x1cd0, 0x0005, 0x00e6, 0x0126, 0x2071,
+	0x1800, 0x2091, 0x8000, 0x7554, 0x9582, 0x0010, 0x0608, 0x7058,
+	0x2060, 0x6000, 0x9086, 0x0000, 0x0148, 0x9ce0, 0x0018, 0x7068,
+	0x9c02, 0x1208, 0x0cb0, 0x2061, 0x1cd0, 0x0c98, 0x6003, 0x0008,
+	0x8529, 0x7556, 0x9ca8, 0x0018, 0x7068, 0x9502, 0x1230, 0x755a,
+	0x9085, 0x0001, 0x012e, 0x00ee, 0x0005, 0x705b, 0x1cd0, 0x0cc0,
+	0x9006, 0x0cc0, 0x00e6, 0x2071, 0x1800, 0x7554, 0x9582, 0x0010,
+	0x0600, 0x7058, 0x2060, 0x6000, 0x9086, 0x0000, 0x0148, 0x9ce0,
+	0x0018, 0x7068, 0x9c02, 0x1208, 0x0cb0, 0x2061, 0x1cd0, 0x0c98,
+	0x6003, 0x0008, 0x8529, 0x7556, 0x9ca8, 0x0018, 0x7068, 0x9502,
+	0x1228, 0x755a, 0x9085, 0x0001, 0x00ee, 0x0005, 0x705b, 0x1cd0,
+	0x0cc8, 0x9006, 0x0cc8, 0x9c82, 0x1cd0, 0x0a0c, 0x0dd5, 0x2001,
+	0x181a, 0x2004, 0x9c02, 0x1a0c, 0x0dd5, 0x9006, 0x6006, 0x600a,
+	0x600e, 0x6016, 0x601a, 0x6012, 0x6023, 0x0000, 0x6003, 0x0000,
+	0x601e, 0x6056, 0x605a, 0x6026, 0x602a, 0x602e, 0x6032, 0x6036,
+	0x603a, 0x603e, 0x6042, 0x602a, 0x2061, 0x1800, 0x6054, 0x8000,
+	0x6056, 0x9086, 0x0001, 0x0108, 0x0005, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x941c, 0x012e, 0x0cc0, 0x0006, 0x6000, 0x9086, 0x0000,
+	0x01b0, 0x601c, 0xd084, 0x190c, 0x19b4, 0x6017, 0x0000, 0x6023,
+	0x0007, 0x2001, 0x1984, 0x2004, 0x0006, 0x9082, 0x0051, 0x000e,
+	0x0208, 0x8004, 0x601a, 0x080c, 0xe4d8, 0x6043, 0x0000, 0x000e,
+	0x0005, 0x00e6, 0x0126, 0x2071, 0x1800, 0x2091, 0x8000, 0x7554,
+	0x9582, 0x0001, 0x0608, 0x7058, 0x2060, 0x6000, 0x9086, 0x0000,
+	0x0148, 0x9ce0, 0x0018, 0x7068, 0x9c02, 0x1208, 0x0cb0, 0x2061,
+	0x1cd0, 0x0c98, 0x6003, 0x0008, 0x8529, 0x7556, 0x9ca8, 0x0018,
+	0x7068, 0x9502, 0x1230, 0x755a, 0x9085, 0x0001, 0x012e, 0x00ee,
+	0x0005, 0x705b, 0x1cd0, 0x0cc0, 0x9006, 0x0cc0, 0x6020, 0x9084,
+	0x000f, 0x0002, 0xabf9, 0xac02, 0xac1d, 0xac38, 0xcf3e, 0xcf5b,
+	0xcf76, 0xabf9, 0xac02, 0x8b1a, 0xac54, 0xabf9, 0xabf9, 0xabf9,
+	0xabf9, 0x9186, 0x0013, 0x1128, 0x080c, 0x9317, 0x080c, 0x941c,
+	0x0005, 0x0005, 0x0066, 0x6000, 0x90b2, 0x0016, 0x1a0c, 0x0dd5,
+	0x0013, 0x006e, 0x0005, 0xac1b, 0xb389, 0xb564, 0xac1b, 0xb5fa,
+	0xaf37, 0xac1b, 0xac1b, 0xb30b, 0xbb5f, 0xac1b, 0xac1b, 0xac1b,
+	0xac1b, 0xac1b, 0xac1b, 0x080c, 0x0dd5, 0x0066, 0x6000, 0x90b2,
+	0x0016, 0x1a0c, 0x0dd5, 0x0013, 0x006e, 0x0005, 0xac36, 0xc233,
+	0xac36, 0xac36, 0xac36, 0xac36, 0xac36, 0xac36, 0xc1d8, 0xc3b5,
+	0xac36, 0xc274, 0xc2f3, 0xc274, 0xc2f3, 0xac36, 0x080c, 0x0dd5,
+	0x6000, 0x9082, 0x0016, 0x1a0c, 0x0dd5, 0x6000, 0x0002, 0xac52,
+	0xbba6, 0xbc8b, 0xbdbb, 0xbf66, 0xac52, 0xac52, 0xac52, 0xbb7a,
+	0xc164, 0xc167, 0xac52, 0xac52, 0xac52, 0xac52, 0xc196, 0xac52,
+	0xac52, 0xac52, 0x080c, 0x0dd5, 0x0066, 0x6000, 0x90b2, 0x0016,
+	0x1a0c, 0x0dd5, 0x0013, 0x006e, 0x0005, 0xac6d, 0xac6d, 0xacb0,
+	0xad4f, 0xade4, 0xac6d, 0xac6d, 0xac6d, 0xac6f, 0xac6d, 0xac6d,
+	0xac6d, 0xac6d, 0xac6d, 0xac6d, 0xac6d, 0x080c, 0x0dd5, 0x9186,
+	0x004c, 0x0588, 0x9186, 0x0003, 0x190c, 0x0dd5, 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, 0x1b03, 0x080c, 0x8ee4, 0x0126, 0x2091, 0x8000, 0x080c,
+	0x9548, 0x012e, 0x0005, 0x6010, 0x00b6, 0x2058, 0xbca0, 0x00be,
+	0x2c00, 0x080c, 0xae06, 0x080c, 0xcf30, 0x6003, 0x0007, 0x0005,
+	0x00d6, 0x0096, 0x00f6, 0x2079, 0x1800, 0x7a90, 0x6014, 0x2048,
+	0xa87c, 0xd0ec, 0x1110, 0x9290, 0x0018, 0xac78, 0xc4fc, 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, 0xad17, 0xad17, 0xad12, 0xad15, 0xad17, 0xad0f,
+	0xad02, 0xad02, 0xad02, 0xad02, 0xad02, 0xad02, 0xad02, 0xad02,
+	0xad02, 0xad02, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x002e, 0x001e,
+	0x000e, 0x004e, 0x00fe, 0x009e, 0x00de, 0x080c, 0x0dd5, 0x080c,
+	0xb7b7, 0x0028, 0x080c, 0xb89c, 0x0010, 0x080c, 0xb992, 0x00fe,
+	0x00ee, 0x00de, 0x00ce, 0x002e, 0x001e, 0x2c00, 0xa896, 0x000e,
+	0x080c, 0xaec4, 0x0530, 0xa804, 0xa80e, 0x00a6, 0x2050, 0xb100,
+	0x00ae, 0x8006, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0,
+	0x9080, 0x0002, 0xaacc, 0xabd0, 0xacd4, 0xadd8, 0x2031, 0x0000,
+	0x2041, 0x1254, 0x080c, 0xb084, 0x0160, 0x000e, 0x9005, 0x0120,
+	0x00fe, 0x009e, 0x00de, 0x0005, 0x00fe, 0x009e, 0x00de, 0x0804,
+	0xab6b, 0x2001, 0x002c, 0x900e, 0x080c, 0xaf2a, 0x0c70, 0x91b6,
+	0x0015, 0x0170, 0x91b6, 0x0016, 0x0158, 0x91b2, 0x0047, 0x0a0c,
+	0x0dd5, 0x91b2, 0x0050, 0x1a0c, 0x0dd5, 0x9182, 0x0047, 0x00ca,
+	0x2001, 0x0109, 0x2004, 0xd08c, 0x0198, 0x0126, 0x2091, 0x2800,
+	0x0006, 0x0016, 0x0026, 0x080c, 0x8e31, 0x002e, 0x001e, 0x000e,
+	0x012e, 0xa001, 0x6000, 0x9086, 0x0002, 0x1110, 0x0804, 0xacb0,
+	0x0005, 0xad82, 0xad82, 0xad84, 0xadba, 0xad82, 0xad82, 0xad82,
+	0xad82, 0xadcd, 0x080c, 0x0dd5, 0x00d6, 0x0016, 0x0096, 0x080c,
+	0x93cc, 0x080c, 0x9548, 0x6003, 0x0004, 0x6114, 0x2148, 0xa87c,
+	0xd0fc, 0x01c0, 0xa878, 0xc0fc, 0x9005, 0x1158, 0xa894, 0x9005,
+	0x0140, 0x2001, 0x0000, 0x900e, 0x080c, 0xaf2a, 0x080c, 0xab6b,
 	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,
+	0x00de, 0x0005, 0x080c, 0x93cc, 0x00d6, 0x0096, 0x6114, 0x2148,
+	0x080c, 0xc825, 0x0120, 0xa87b, 0x0006, 0x080c, 0x6a46, 0x009e,
+	0x00de, 0x080c, 0xab6b, 0x0804, 0x9548, 0x080c, 0x93cc, 0x080c,
+	0x306e, 0x080c, 0xcf2d, 0x00d6, 0x0096, 0x6114, 0x2148, 0x080c,
+	0xc825, 0x0120, 0xa87b, 0x0029, 0x080c, 0x6a46, 0x009e, 0x00de,
+	0x080c, 0xab6b, 0x0804, 0x9548, 0x9182, 0x0047, 0x0002, 0xadf4,
+	0xadf6, 0xadf4, 0xadf4, 0xadf4, 0xadf4, 0xadf4, 0xadf4, 0xadf4,
+	0xadf4, 0xadf4, 0xadf4, 0xadf6, 0x080c, 0x0dd5, 0x00d6, 0x0096,
+	0x601f, 0x0000, 0x6114, 0x2148, 0xa87b, 0x0000, 0xa883, 0x0000,
+	0x080c, 0x6a46, 0x009e, 0x00de, 0x0804, 0xab6b, 0x0026, 0x0036,
+	0x0056, 0x0066, 0x0096, 0x00a6, 0x00f6, 0x0006, 0x080c, 0x1000,
+	0x000e, 0x090c, 0x0dd5, 0xa960, 0x21e8, 0xa95c, 0x9188, 0x0019,
 	0x21a0, 0x900e, 0x20a9, 0x0020, 0x4104, 0xa87a, 0x2079, 0x1800,
-	0x7988, 0x9188, 0x0018, 0x918c, 0x0fff, 0xa972, 0xac76, 0x2950,
+	0x7990, 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,
+	0x9182, 0x0034, 0x1228, 0x2011, 0x001f, 0x080c, 0xc43a, 0x04c0,
+	0x2130, 0x2009, 0x0034, 0x2011, 0x001f, 0x080c, 0xc43a, 0x96b2,
+	0x0034, 0xb004, 0x904d, 0x0110, 0x080c, 0x0fb2, 0x080c, 0x1000,
 	0x01d0, 0x8528, 0xa867, 0x0110, 0xa86b, 0x0000, 0x2920, 0xb406,
-	0x968a, 0x003d, 0x1230, 0x2608, 0x2011, 0x001b, 0x080c, 0xb219,
+	0x968a, 0x003d, 0x1230, 0x2608, 0x2011, 0x001b, 0x080c, 0xc43a,
 	0x00b8, 0x96b2, 0x003c, 0x2009, 0x003c, 0x2950, 0x2011, 0x001b,
-	0x080c, 0xb219, 0x0c18, 0x2001, 0x0205, 0x2003, 0x0000, 0x00ae,
+	0x080c, 0xc43a, 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,
+	0xb566, 0x2a48, 0xa804, 0xa807, 0x0000, 0x0006, 0x080c, 0x6a46,
 	0x000e, 0x2048, 0x9005, 0x1db0, 0x00fe, 0x00ae, 0x009e, 0x006e,
 	0x005e, 0x003e, 0x002e, 0x0005, 0x00d6, 0x00f6, 0x0096, 0x0006,
-	0x080c, 0x0fd5, 0x000e, 0x090c, 0x0db2, 0xa960, 0x21e8, 0xa95c,
+	0x080c, 0x1000, 0x000e, 0x090c, 0x0dd5, 0xa960, 0x21e8, 0xa95c,
 	0x9188, 0x0019, 0x21a0, 0x900e, 0x20a9, 0x0020, 0x4104, 0xaa66,
-	0xa87a, 0x2079, 0x1800, 0x7988, 0x810c, 0x9188, 0x000c, 0x9182,
+	0xa87a, 0x2079, 0x1800, 0x7990, 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,
+	0x918d, 0x0080, 0x2102, 0x4003, 0x2003, 0x0000, 0x080c, 0x6a46,
 	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,
+	0x0020, 0x2018, 0x9486, 0x003e, 0x1170, 0x0096, 0x080c, 0x1000,
 	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,
+	0x0080, 0x7816, 0x2e98, 0x2310, 0x84ff, 0x0904, 0xaed9, 0x0804,
+	0xaedb, 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,
+	0xa982, 0x080c, 0x6a3a, 0x009e, 0x003e, 0x00de, 0x0005, 0x91b6,
+	0x0015, 0x1118, 0x080c, 0xab6b, 0x0030, 0x91b6, 0x0016, 0x190c,
+	0x0dd5, 0x080c, 0xab6b, 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,
+	0x080c, 0xc825, 0x0130, 0x6014, 0x2048, 0xa807, 0x0000, 0xa867,
+	0x0103, 0x009e, 0x0804, 0xab6b, 0x0096, 0x00d6, 0x0036, 0x7330,
+	0x9386, 0x0200, 0x11a8, 0x6010, 0x00b6, 0x2058, 0xb8cf, 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,
+	0x0103, 0xab32, 0x080c, 0xab6b, 0x003e, 0x00de, 0x009e, 0x0005,
+	0x0011, 0x1d48, 0x0cc8, 0x0006, 0x0016, 0x080c, 0xcf18, 0x0188,
 	0x6014, 0x9005, 0x1170, 0x600b, 0x0003, 0x601b, 0x0000, 0x6043,
-	0x0000, 0x2009, 0x0022, 0x080c, 0xa1b5, 0x9006, 0x001e, 0x000e,
+	0x0000, 0x2009, 0x0022, 0x080c, 0xb361, 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,
@@ -4860,405 +5423,421 @@
 	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,
+	0x2048, 0xa867, 0x0103, 0x080c, 0xab6b, 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,
+	0x2048, 0x080c, 0xc43a, 0x080c, 0xc825, 0x0140, 0x6014, 0x2048,
+	0xa807, 0x0000, 0xa864, 0xa8e2, 0xa867, 0x0103, 0x080c, 0xab6b,
+	0x001e, 0x009e, 0x0005, 0x0016, 0x2009, 0x0000, 0x7030, 0x9086,
+	0x0200, 0x0110, 0x2009, 0x0001, 0x0096, 0x6014, 0x904d, 0x090c,
+	0x0dd5, 0xa97a, 0x080c, 0x6a46, 0x009e, 0x080c, 0xab6b, 0x001e,
+	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, 0xc43a, 0x009e, 0x080c, 0xc825, 0x0148, 0xa804, 0x9005,
+	0x1158, 0xa807, 0x0000, 0xa864, 0xa8e2, 0xa867, 0x0103, 0x080c,
+	0xab6b, 0x009e, 0x001e, 0x0005, 0x0086, 0x2040, 0xa030, 0x8007,
+	0x9086, 0x0100, 0x1118, 0x080c, 0xb51d, 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, 0x123a,
+	0x0019, 0x0d08, 0x008e, 0x0898, 0x0096, 0x0006, 0x080c, 0x1000,
+	0x000e, 0x01b0, 0xa8ab, 0x0dcb, 0xa876, 0x000e, 0xa8a2, 0x0006,
+	0xae6a, 0x2800, 0xa89e, 0xa97a, 0xaf72, 0xaa8e, 0xab92, 0xac96,
+	0xad9a, 0x0086, 0x2940, 0x080c, 0x10e0, 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, 0xce90, 0x001e,
+	0x1158, 0x622c, 0x2268, 0x2071, 0x026c, 0x6b20, 0x9386, 0x0003,
+	0x0130, 0x9386, 0x0006, 0x0128, 0x080c, 0xab6b, 0x0020, 0x0039,
+	0x0010, 0x080c, 0xb196, 0x002e, 0x00de, 0x00ee, 0x0005, 0x0096,
+	0x6814, 0x2048, 0x9186, 0x0015, 0x0904, 0xb17e, 0x918e, 0x0016,
+	0x1904, 0xb194, 0x700c, 0x908c, 0xff00, 0x9186, 0x1700, 0x0120,
+	0x9186, 0x0300, 0x1904, 0xb158, 0x89ff, 0x1138, 0x6800, 0x9086,
+	0x000f, 0x0904, 0xb13b, 0x0804, 0xb192, 0x6808, 0x9086, 0xffff,
+	0x1904, 0xb180, 0xa87c, 0x9084, 0x0060, 0x9086, 0x0020, 0x1128,
+	0xa83c, 0xa940, 0x9105, 0x1904, 0xb180, 0x6824, 0xd0b4, 0x1904,
+	0xb180, 0x080c, 0xca07, 0x685c, 0xa882, 0xa87c, 0xc0dc, 0xc0f4,
+	0xc0d4, 0xa87e, 0x0026, 0x900e, 0x6a18, 0x2001, 0x000a, 0x080c,
+	0x8cf7, 0xa884, 0x920a, 0x0208, 0x8011, 0xaa86, 0x82ff, 0x002e,
+	0x1138, 0x00c6, 0x2d60, 0x080c, 0xc564, 0x00ce, 0x0804, 0xb192,
+	0x00c6, 0xa868, 0xd0fc, 0x1118, 0x080c, 0x5e8c, 0x0010, 0x080c,
+	0x6282, 0x00ce, 0x1904, 0xb180, 0x00c6, 0x2d60, 0x080c, 0xab6b,
+	0x00ce, 0x0804, 0xb192, 0x00c6, 0x080c, 0xabb9, 0x0198, 0x6017,
+	0x0000, 0x6810, 0x6012, 0x080c, 0xcc93, 0x6023, 0x0003, 0x6904,
+	0x00c6, 0x2d60, 0x080c, 0xab6b, 0x00ce, 0x080c, 0xabe6, 0x00ce,
+	0x0804, 0xb192, 0x2001, 0x1986, 0x2004, 0x6842, 0x00ce, 0x04d0,
+	0x7008, 0x9086, 0x000b, 0x11c8, 0x6010, 0x00b6, 0x2058, 0xb900,
+	0xc1bc, 0xb902, 0x00be, 0x00c6, 0x2d60, 0xa87b, 0x0003, 0x080c,
+	0xced2, 0x6007, 0x0085, 0x6003, 0x000b, 0x6023, 0x0002, 0x080c,
+	0x8e7f, 0x080c, 0x941c, 0x00ce, 0x00e8, 0x700c, 0x9086, 0x2a00,
+	0x1138, 0x2001, 0x1986, 0x2004, 0x6842, 0x00a0, 0x0479, 0x00a0,
+	0x89ff, 0x090c, 0x0dd5, 0x00c6, 0x00d6, 0x2d60, 0xa867, 0x0103,
+	0xa87b, 0x0003, 0x080c, 0x6862, 0x080c, 0xca07, 0x080c, 0xab9c,
+	0x00de, 0x00ce, 0x080c, 0xab6b, 0x009e, 0x0005, 0x9186, 0x0015,
+	0x1128, 0x2001, 0x1986, 0x2004, 0x6842, 0x0068, 0x918e, 0x0016,
+	0x1160, 0x00c6, 0x2d00, 0x2060, 0x080c, 0xe4d8, 0x080c, 0x8441,
+	0x080c, 0xab6b, 0x00ce, 0x080c, 0xab6b, 0x0005, 0x0026, 0x0036,
+	0x0046, 0x7228, 0xacb0, 0xabac, 0xd2f4, 0x0130, 0x2001, 0x1986,
+	0x2004, 0x6842, 0x0804, 0xb210, 0x00c6, 0x2d60, 0x080c, 0xc465,
+	0x00ce, 0x6804, 0x9086, 0x0050, 0x1168, 0x00c6, 0x2d00, 0x2060,
+	0x6003, 0x0001, 0x6007, 0x0050, 0x080c, 0x8e7f, 0x080c, 0x941c,
+	0x00ce, 0x04f0, 0x6800, 0x9086, 0x000f, 0x01a8, 0x89ff, 0x090c,
+	0x0dd5, 0x6800, 0x9086, 0x0004, 0x1190, 0xa87c, 0xd0ac, 0x0178,
+	0xa843, 0x0fff, 0xa83f, 0x0fff, 0xa880, 0xc0fc, 0xa882, 0x2001,
+	0x0001, 0x6832, 0x0400, 0x2001, 0x0007, 0x6832, 0x00e0, 0xa87c,
+	0xd0b4, 0x1150, 0xd0ac, 0x0db8, 0x6824, 0xd0f4, 0x1d48, 0xa838,
+	0xa934, 0x9105, 0x0d80, 0x0c20, 0xd2ec, 0x1d68, 0x7024, 0x9306,
+	0x1118, 0x7020, 0x9406, 0x0d38, 0x7020, 0x683e, 0x7024, 0x683a,
+	0x2001, 0x0005, 0x6832, 0x080c, 0xcb8a, 0x080c, 0x941c, 0x0010,
+	0x080c, 0xab6b, 0x004e, 0x003e, 0x002e, 0x0005, 0x00e6, 0x00d6,
+	0x0026, 0x7008, 0x9084, 0x00ff, 0x6210, 0x00b6, 0x2258, 0xba10,
+	0x00be, 0x9206, 0x1904, 0xb27b, 0x700c, 0x6210, 0x00b6, 0x2258,
+	0xba14, 0x00be, 0x9206, 0x1904, 0xb27b, 0x6038, 0x2068, 0x6824,
+	0xc0dc, 0x6826, 0x6a20, 0x9286, 0x0007, 0x0904, 0xb27b, 0x9286,
+	0x0002, 0x0904, 0xb27b, 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, 0xc825, 0x090c, 0x0dd5, 0xa87b, 0x0003, 0x009e, 0x080c,
+	0xced2, 0x6007, 0x0085, 0x6003, 0x000b, 0x6023, 0x0002, 0x080c,
+	0x8e7f, 0x080c, 0x941c, 0x00ce, 0x0030, 0x6038, 0x2070, 0x2001,
+	0x1986, 0x2004, 0x7042, 0x080c, 0xab6b, 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, 0xbb27, 0x002e, 0x003e,
+	0x015e, 0x009e, 0x1904, 0xb2ea, 0x0096, 0x0156, 0x0036, 0x0026,
+	0x2b48, 0x9e90, 0x0014, 0x2019, 0x0006, 0x20a9, 0x0004, 0x080c,
+	0xbb27, 0x002e, 0x003e, 0x015e, 0x009e, 0x15a0, 0x7238, 0xba0a,
+	0x733c, 0xbb0e, 0xbc00, 0xc48d, 0xbc02, 0xa804, 0x9005, 0x1128,
+	0x00fe, 0x009e, 0x00be, 0x0804, 0xaf6f, 0x0096, 0x2048, 0xaa12,
+	0xab16, 0xac0a, 0x009e, 0x8006, 0x8006, 0x8007, 0x90bc, 0x003f,
+	0x9084, 0xffc0, 0x9080, 0x0002, 0x2009, 0x002b, 0xaaa0, 0xab9c,
+	0xaca8, 0xada4, 0x2031, 0x0000, 0x2041, 0x123a, 0x080c, 0xb084,
+	0x0130, 0x00fe, 0x009e, 0x080c, 0xab6b, 0x00be, 0x0005, 0x080c,
+	0xb51d, 0x0cb8, 0x2b78, 0x00f6, 0x080c, 0x306e, 0x080c, 0xcf2d,
+	0x00fe, 0x00c6, 0x080c, 0xab15, 0x2f00, 0x6012, 0x6017, 0x0000,
+	0x6023, 0x0001, 0x6007, 0x0001, 0x6003, 0x0001, 0x2001, 0x0007,
+	0x080c, 0x631d, 0x080c, 0x6349, 0x080c, 0x8ec7, 0x080c, 0x941c,
+	0x00ce, 0x0804, 0xb2bd, 0x2100, 0x91b2, 0x0053, 0x1a0c, 0x0dd5,
+	0x91b2, 0x0040, 0x1a04, 0xb373, 0x0002, 0xb361, 0xb361, 0xb357,
+	0xb361, 0xb361, 0xb361, 0xb355, 0xb355, 0xb355, 0xb355, 0xb355,
+	0xb355, 0xb355, 0xb355, 0xb355, 0xb355, 0xb355, 0xb355, 0xb355,
+	0xb355, 0xb355, 0xb355, 0xb355, 0xb355, 0xb355, 0xb355, 0xb355,
+	0xb355, 0xb355, 0xb355, 0xb355, 0xb361, 0xb355, 0xb361, 0xb361,
+	0xb355, 0xb355, 0xb355, 0xb355, 0xb355, 0xb357, 0xb355, 0xb355,
+	0xb355, 0xb355, 0xb355, 0xb355, 0xb355, 0xb355, 0xb355, 0xb361,
+	0xb361, 0xb355, 0xb355, 0xb355, 0xb355, 0xb355, 0xb355, 0xb355,
+	0xb355, 0xb355, 0xb361, 0xb355, 0xb355, 0x080c, 0x0dd5, 0x0066,
+	0x00b6, 0x6610, 0x2658, 0xb8cc, 0xc08c, 0xb8ce, 0x00be, 0x006e,
+	0x0000, 0x6003, 0x0001, 0x6106, 0x9186, 0x0032, 0x0118, 0x080c,
+	0x8ec7, 0x0010, 0x080c, 0x8e7f, 0x0126, 0x2091, 0x8000, 0x080c,
+	0x941c, 0x012e, 0x0005, 0x2600, 0x0002, 0xb361, 0xb361, 0xb387,
+	0xb361, 0xb361, 0xb387, 0xb387, 0xb387, 0xb387, 0xb361, 0xb387,
+	0xb361, 0xb387, 0xb361, 0xb387, 0xb387, 0xb387, 0xb387, 0x080c,
+	0x0dd5, 0x6004, 0x90b2, 0x0053, 0x1a0c, 0x0dd5, 0x91b6, 0x0013,
+	0x0904, 0xb44b, 0x91b6, 0x0027, 0x1904, 0xb406, 0x080c, 0x9317,
+	0x6004, 0x080c, 0xca13, 0x01b0, 0x080c, 0xca24, 0x01a8, 0x908e,
+	0x0021, 0x0904, 0xb403, 0x908e, 0x0022, 0x1130, 0x080c, 0xaf9b,
+	0x0904, 0xb3ff, 0x0804, 0xb400, 0x908e, 0x003d, 0x0904, 0xb403,
+	0x0804, 0xb3f9, 0x080c, 0x3093, 0x2001, 0x0007, 0x080c, 0x631d,
+	0x6010, 0x00b6, 0x2058, 0xb9a0, 0x00be, 0x080c, 0xb51d, 0x9186,
+	0x007e, 0x1148, 0x2001, 0x1837, 0x2014, 0xc285, 0x080c, 0x717d,
+	0x1108, 0xc2ad, 0x2202, 0x0036, 0x0026, 0x2019, 0x0028, 0x2110,
+	0x080c, 0xe5e4, 0x002e, 0x003e, 0x0016, 0x0026, 0x0036, 0x2110,
+	0x2019, 0x0028, 0x080c, 0x901a, 0x0076, 0x903e, 0x080c, 0x8ef7,
+	0x6010, 0x00b6, 0x905d, 0x0100, 0x00be, 0x2c08, 0x080c, 0xdfbd,
+	0x007e, 0x003e, 0x002e, 0x001e, 0x080c, 0xcf2d, 0x0016, 0x080c,
+	0xcc8b, 0x080c, 0xab6b, 0x001e, 0x080c, 0x3166, 0x080c, 0x941c,
+	0x0030, 0x080c, 0xcc8b, 0x080c, 0xab6b, 0x080c, 0x941c, 0x0005,
+	0x080c, 0xb51d, 0x0cb0, 0x080c, 0xb559, 0x0c98, 0x9186, 0x0014,
+	0x1db0, 0x080c, 0x9317, 0x6004, 0x908e, 0x0022, 0x1118, 0x080c,
+	0xaf9b, 0x0d68, 0x080c, 0x306e, 0x080c, 0xcf2d, 0x080c, 0xca13,
+	0x1190, 0x080c, 0x3093, 0x6010, 0x00b6, 0x2058, 0xb9a0, 0x00be,
+	0x080c, 0xb51d, 0x9186, 0x007e, 0x1128, 0x2001, 0x1837, 0x200c,
+	0xc185, 0x2102, 0x0870, 0x080c, 0xca24, 0x1118, 0x080c, 0xb51d,
+	0x0840, 0x6004, 0x908e, 0x0032, 0x1160, 0x00e6, 0x00f6, 0x2071,
+	0x189e, 0x2079, 0x0000, 0x080c, 0x3401, 0x00fe, 0x00ee, 0x0804,
+	0xb3f9, 0x6004, 0x908e, 0x0021, 0x0d48, 0x908e, 0x0022, 0x090c,
+	0xb51d, 0x0804, 0xb3f9, 0x90b2, 0x0040, 0x1a04, 0xb4f9, 0x2008,
+	0x0002, 0xb493, 0xb494, 0xb497, 0xb49a, 0xb49d, 0xb4a0, 0xb491,
+	0xb491, 0xb491, 0xb491, 0xb491, 0xb491, 0xb491, 0xb491, 0xb491,
+	0xb491, 0xb491, 0xb491, 0xb491, 0xb491, 0xb491, 0xb491, 0xb491,
+	0xb491, 0xb491, 0xb491, 0xb491, 0xb491, 0xb491, 0xb491, 0xb4a3,
+	0xb4ae, 0xb491, 0xb4b0, 0xb4ae, 0xb491, 0xb491, 0xb491, 0xb491,
+	0xb491, 0xb4ae, 0xb4ae, 0xb491, 0xb491, 0xb491, 0xb491, 0xb491,
+	0xb491, 0xb491, 0xb491, 0xb4e0, 0xb4ae, 0xb491, 0xb4aa, 0xb491,
+	0xb491, 0xb491, 0xb4ab, 0xb491, 0xb491, 0xb491, 0xb4ae, 0xb4d7,
+	0xb491, 0x080c, 0x0dd5, 0x00d0, 0x2001, 0x000b, 0x0410, 0x2001,
+	0x0003, 0x00f8, 0x2001, 0x0005, 0x00e0, 0x2001, 0x0001, 0x00c8,
+	0x2001, 0x0009, 0x00b0, 0x080c, 0x9317, 0x6003, 0x0005, 0x080c,
+	0x941c, 0x0070, 0x0018, 0x0010, 0x080c, 0x631d, 0x0804, 0xb4f1,
+	0x080c, 0x9317, 0x080c, 0xcf30, 0x6003, 0x0004, 0x080c, 0x941c,
+	0x0005, 0x080c, 0x631d, 0x080c, 0x9317, 0x6003, 0x0002, 0x0036,
+	0x2019, 0x1852, 0x2304, 0x9084, 0xff00, 0x1120, 0x2001, 0x1984,
+	0x201c, 0x0040, 0x8007, 0x909a, 0x0004, 0x0ec0, 0x8003, 0x801b,
+	0x831b, 0x9318, 0x631a, 0x003e, 0x080c, 0x941c, 0x0c08, 0x080c,
+	0x9317, 0x080c, 0xcc8b, 0x080c, 0xab6b, 0x080c, 0x941c, 0x08c0,
+	0x00e6, 0x00f6, 0x2071, 0x189e, 0x2079, 0x0000, 0x080c, 0x3401,
+	0x00fe, 0x00ee, 0x080c, 0x9317, 0x080c, 0xab6b, 0x080c, 0x941c,
+	0x0838, 0x080c, 0x9317, 0x6003, 0x0002, 0x080c, 0xcf30, 0x0804,
+	0x941c, 0x2600, 0x2008, 0x0002, 0xb510, 0xb4f1, 0xb50e, 0xb4f1,
+	0xb4f1, 0xb50e, 0xb50e, 0xb50e, 0xb50e, 0xb4f1, 0xb50e, 0xb4f1,
+	0xb50e, 0xb4f1, 0xb50e, 0xb50e, 0xb50e, 0xb50e, 0x080c, 0x0dd5,
+	0x080c, 0x9317, 0x0096, 0x6014, 0x2048, 0x080c, 0x6a46, 0x009e,
+	0x080c, 0xab6b, 0x080c, 0x941c, 0x0005, 0x00e6, 0x0096, 0x0026,
+	0x0016, 0x080c, 0xc825, 0x0568, 0x6014, 0x2048, 0xa864, 0x9086,
+	0x0139, 0x11a8, 0xa894, 0x9086, 0x0056, 0x1148, 0x080c, 0x5260,
+	0x0130, 0x2001, 0x0000, 0x900e, 0x2011, 0x4000, 0x0028, 0x2001,
+	0x0030, 0x900e, 0x2011, 0x4005, 0x080c, 0xcdf7, 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, 0x0dd5, 0x6604, 0x96b6,
+	0x004d, 0x1120, 0x080c, 0xcd17, 0x0804, 0xb5e9, 0x6604, 0x96b6,
+	0x0043, 0x1120, 0x080c, 0xcd60, 0x0804, 0xb5e9, 0x6604, 0x96b6,
+	0x004b, 0x1120, 0x080c, 0xcd8c, 0x0804, 0xb5e9, 0x6604, 0x96b6,
+	0x0033, 0x1120, 0x080c, 0xccad, 0x0804, 0xb5e9, 0x6604, 0x96b6,
+	0x0028, 0x1120, 0x080c, 0xca5d, 0x0804, 0xb5e9, 0x6604, 0x96b6,
+	0x0029, 0x1120, 0x080c, 0xca9e, 0x0804, 0xb5e9, 0x6604, 0x96b6,
+	0x001f, 0x1120, 0x080c, 0xaf44, 0x0804, 0xb5e9, 0x6604, 0x96b6,
+	0x0000, 0x1118, 0x080c, 0xb281, 0x04e0, 0x6604, 0x96b6, 0x0022,
+	0x1118, 0x080c, 0xaf7c, 0x04a8, 0x6604, 0x96b6, 0x0035, 0x1118,
+	0x080c, 0xb0a2, 0x0470, 0x6604, 0x96b6, 0x0039, 0x1118, 0x080c,
+	0xb216, 0x0438, 0x6604, 0x96b6, 0x003d, 0x1118, 0x080c, 0xafb4,
+	0x0400, 0x6604, 0x96b6, 0x0044, 0x1118, 0x080c, 0xaff0, 0x00c8,
+	0x6604, 0x96b6, 0x0049, 0x1118, 0x080c, 0xb031, 0x0090, 0x6604,
+	0x96b6, 0x0041, 0x1118, 0x080c, 0xb01b, 0x0058, 0x91b6, 0x0015,
+	0x1110, 0x0063, 0x0030, 0x91b6, 0x0016, 0x1128, 0x00be, 0x0804,
+	0xb843, 0x00be, 0x0005, 0x080c, 0xac01, 0x0cd8, 0xb606, 0xb609,
+	0xb606, 0xb650, 0xb606, 0xb7b7, 0xb850, 0xb606, 0xb606, 0xb819,
+	0xb606, 0xb82f, 0x0096, 0x601f, 0x0000, 0x6014, 0x2048, 0xa800,
+	0x2048, 0xa867, 0x0103, 0x009e, 0x0804, 0xab6b, 0xa001, 0xa001,
+	0x0005, 0x00e6, 0x2071, 0x1800, 0x7090, 0x9086, 0x0074, 0x1540,
+	0x080c, 0xdf8e, 0x11b0, 0x6010, 0x00b6, 0x2058, 0x7030, 0xd08c,
+	0x0128, 0xb800, 0xd0bc, 0x0110, 0xc0c5, 0xb802, 0x00f9, 0x00be,
+	0x2001, 0x0006, 0x080c, 0x631d, 0x080c, 0x3093, 0x080c, 0xab6b,
+	0x0098, 0x2001, 0x000a, 0x080c, 0x631d, 0x080c, 0x3093, 0x6003,
+	0x0001, 0x6007, 0x0001, 0x080c, 0x8ec7, 0x080c, 0x941c, 0x0020,
+	0x2001, 0x0001, 0x080c, 0xb787, 0x00ee, 0x0005, 0x00d6, 0xb800,
+	0xd084, 0x0160, 0x9006, 0x080c, 0x6309, 0x2069, 0x1847, 0x6804,
+	0xd0a4, 0x0120, 0x2001, 0x0006, 0x080c, 0x6349, 0x00de, 0x0005,
+	0x00b6, 0x0096, 0x00d6, 0x2011, 0x1824, 0x2204, 0x9086, 0x0074,
+	0x1904, 0xb75e, 0x6010, 0x2058, 0xbaa0, 0x9286, 0x007e, 0x1120,
+	0x080c, 0xb99d, 0x0804, 0xb6c2, 0x080c, 0xb992, 0x6010, 0x2058,
+	0xbaa0, 0x9286, 0x0080, 0x1510, 0x6014, 0x9005, 0x01a8, 0x2048,
+	0xa864, 0x9084, 0x00ff, 0x9086, 0x0039, 0x1140, 0x2001, 0x0000,
+	0x900e, 0x2011, 0x4000, 0x080c, 0xcdf7, 0x0030, 0xa807, 0x0000,
+	0xa867, 0x0103, 0xa833, 0x0200, 0x2001, 0x0006, 0x080c, 0x631d,
+	0x080c, 0x3093, 0x080c, 0xab6b, 0x0804, 0xb761, 0x080c, 0xb76f,
+	0x6014, 0x9005, 0x0190, 0x2048, 0xa868, 0xd0f4, 0x01e8, 0xa864,
+	0x9084, 0x00ff, 0x9086, 0x0039, 0x1d08, 0x2001, 0x0000, 0x900e,
+	0x2011, 0x4000, 0x080c, 0xcdf7, 0x08f8, 0x080c, 0xb765, 0x0160,
+	0x9006, 0x080c, 0x6309, 0x2001, 0x0004, 0x080c, 0x6349, 0x2001,
+	0x0007, 0x080c, 0x631d, 0x08a0, 0x2001, 0x0004, 0x080c, 0x631d,
+	0x6003, 0x0001, 0x6007, 0x0003, 0x080c, 0x8ec7, 0x080c, 0x941c,
+	0x0804, 0xb761, 0xb85c, 0xd0e4, 0x01d8, 0x080c, 0xcc2d, 0x080c,
+	0x717d, 0x0118, 0xd0dc, 0x1904, 0xb684, 0x2011, 0x1837, 0x2204,
+	0xc0ad, 0x2012, 0x2001, 0x196d, 0x2004, 0x00f6, 0x2079, 0x0100,
+	0x78e3, 0x0000, 0x080c, 0x2764, 0x78e2, 0x00fe, 0x0804, 0xb684,
+	0x080c, 0xcc6a, 0x2011, 0x1837, 0x2204, 0xc0a5, 0x2012, 0x0006,
+	0x080c, 0xe113, 0x000e, 0x1904, 0xb684, 0xc0b5, 0x2012, 0x2001,
+	0x0006, 0x080c, 0x631d, 0x9006, 0x080c, 0x6309, 0x00c6, 0x2001,
+	0x180f, 0x2004, 0xd09c, 0x0520, 0x00f6, 0x2079, 0x0100, 0x00e6,
+	0x2071, 0x1800, 0x700c, 0x9084, 0x00ff, 0x78e6, 0x707e, 0x7010,
+	0x78ea, 0x7082, 0x908c, 0x00ff, 0x00ee, 0x780c, 0xc0b5, 0x780e,
+	0x00fe, 0x080c, 0x2739, 0x00f6, 0x2100, 0x900e, 0x080c, 0x26f0,
+	0x795e, 0x00fe, 0x9186, 0x0081, 0x01d8, 0x2009, 0x0081, 0x00c8,
+	0x2009, 0x00ef, 0x00f6, 0x2079, 0x0100, 0x79ea, 0x7932, 0x7936,
+	0x780c, 0xc0b5, 0x780e, 0x00fe, 0x080c, 0x2739, 0x00f6, 0x2079,
+	0x1800, 0x7982, 0x2100, 0x900e, 0x080c, 0x26f0, 0x795e, 0x00fe,
+	0x8108, 0x080c, 0x636c, 0x2b00, 0x00ce, 0x1904, 0xb684, 0x6012,
+	0x2009, 0x180f, 0x210c, 0xd19c, 0x0150, 0x2009, 0x027c, 0x210c,
+	0x918c, 0x00ff, 0xb912, 0x2009, 0x027d, 0x210c, 0xb916, 0x2001,
+	0x0002, 0x080c, 0x631d, 0x6023, 0x0001, 0x6003, 0x0001, 0x6007,
+	0x0002, 0x080c, 0x8ec7, 0x080c, 0x941c, 0x0018, 0x2001, 0x0001,
+	0x0431, 0x00de, 0x009e, 0x00be, 0x0005, 0x2001, 0x1810, 0x2004,
+	0xd0a4, 0x0120, 0x2001, 0x1848, 0x2004, 0xd0ac, 0x0005, 0x00e6,
+	0x080c, 0xe63d, 0x0190, 0x2071, 0x0260, 0x7108, 0x720c, 0x918c,
+	0x00ff, 0x1118, 0x9284, 0xff00, 0x0140, 0x6010, 0x2058, 0xb8a0,
+	0x9084, 0xff80, 0x1110, 0xb912, 0xba16, 0x00ee, 0x0005, 0x2030,
+	0x9005, 0x0158, 0x2001, 0x0007, 0x080c, 0x631d, 0x080c, 0x54cb,
+	0x1120, 0x2001, 0x0007, 0x080c, 0x6349, 0x2600, 0x9005, 0x11b0,
+	0x6014, 0x0096, 0x2048, 0xa868, 0x009e, 0xd0fc, 0x1178, 0x0036,
+	0x0046, 0x6010, 0x00b6, 0x2058, 0xbba0, 0x00be, 0x2021, 0x0004,
+	0x2011, 0x8014, 0x080c, 0x48fb, 0x004e, 0x003e, 0x080c, 0x3093,
+	0x6020, 0x9086, 0x000a, 0x1108, 0x0005, 0x0804, 0xab6b, 0x00b6,
+	0x00e6, 0x0026, 0x0016, 0x2071, 0x1800, 0x7090, 0x9086, 0x0014,
+	0x1904, 0xb80f, 0x080c, 0x54cb, 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,
+	0x4ab2, 0x004e, 0x003e, 0x00d6, 0x6010, 0x2058, 0x080c, 0x6468,
+	0x080c, 0xb63e, 0x00de, 0x080c, 0xba63, 0x1588, 0x6010, 0x2058,
+	0xb890, 0x9005, 0x0560, 0x2001, 0x0006, 0x080c, 0x631d, 0x0096,
 	0x6014, 0x904d, 0x01d0, 0xa864, 0x9084, 0x00ff, 0x9086, 0x0039,
-	0x1140, 0x2001, 0x0000, 0x900e, 0x2011, 0x4000, 0x080c, 0xbbcd,
+	0x1140, 0x2001, 0x0000, 0x900e, 0x2011, 0x4000, 0x080c, 0xcdf7,
 	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,
+	0x0000, 0xa867, 0x0103, 0xa833, 0x0200, 0x009e, 0x080c, 0x3093,
+	0x6020, 0x9086, 0x000a, 0x0140, 0x080c, 0xab6b, 0x0028, 0x080c,
+	0xb51d, 0x9006, 0x080c, 0xb787, 0x001e, 0x002e, 0x00ee, 0x00be,
+	0x0005, 0x2011, 0x1824, 0x2204, 0x9086, 0x0014, 0x1160, 0x2001,
+	0x0002, 0x080c, 0x631d, 0x6003, 0x0001, 0x6007, 0x0001, 0x080c,
+	0x8ec7, 0x0804, 0x941c, 0x2001, 0x0001, 0x0804, 0xb787, 0x2030,
+	0x2011, 0x1824, 0x2204, 0x9086, 0x0004, 0x1148, 0x96b6, 0x000b,
+	0x1120, 0x2001, 0x0007, 0x080c, 0x631d, 0x0804, 0xab6b, 0x2001,
+	0x0001, 0x0804, 0xb787, 0x0002, 0xb606, 0xb85b, 0xb606, 0xb89c,
+	0xb606, 0xb949, 0xb850, 0xb606, 0xb606, 0xb95d, 0xb606, 0xb96f,
+	0x6604, 0x9686, 0x0003, 0x0904, 0xb7b7, 0x96b6, 0x001e, 0x1110,
+	0x080c, 0xab6b, 0x0005, 0x00b6, 0x00d6, 0x00c6, 0x080c, 0xb981,
+	0x11a0, 0x9006, 0x080c, 0x6309, 0x080c, 0x306e, 0x080c, 0xcf2d,
+	0x2001, 0x0002, 0x080c, 0x631d, 0x6003, 0x0001, 0x6007, 0x0002,
+	0x080c, 0x8ec7, 0x080c, 0x941c, 0x0418, 0x2009, 0x026e, 0x2104,
+	0x9086, 0x0009, 0x1160, 0x6010, 0x2058, 0xb840, 0x9084, 0x00ff,
+	0x9005, 0x0170, 0x8001, 0xb842, 0x601b, 0x000a, 0x0088, 0x2009,
+	0x026f, 0x2104, 0x9084, 0xff00, 0x9086, 0x1900, 0x1108, 0x08a0,
+	0x080c, 0x306e, 0x080c, 0xcf2d, 0x2001, 0x0001, 0x080c, 0xb787,
+	0x00ce, 0x00de, 0x00be, 0x0005, 0x0096, 0x00b6, 0x0026, 0x9016,
+	0x080c, 0xb98f, 0x00d6, 0x2069, 0x197c, 0x2d04, 0x9005, 0x0168,
+	0x6010, 0x2058, 0xb8a0, 0x9086, 0x007e, 0x1138, 0x2069, 0x1820,
+	0x2d04, 0x8000, 0x206a, 0x00de, 0x0010, 0x00de, 0x0088, 0x9006,
+	0x080c, 0x6309, 0x2001, 0x0002, 0x080c, 0x631d, 0x6003, 0x0001,
+	0x6007, 0x0002, 0x080c, 0x8ec7, 0x080c, 0x941c, 0x0804, 0xb919,
+	0x080c, 0xc825, 0x01b0, 0x6014, 0x2048, 0xa864, 0x2010, 0x9086,
+	0x0139, 0x1138, 0x6007, 0x0016, 0x2001, 0x0002, 0x080c, 0xce51,
+	0x00b0, 0x6014, 0x2048, 0xa864, 0xd0fc, 0x0118, 0x2001, 0x0001,
+	0x0ca8, 0x2001, 0x180e, 0x2004, 0xd0dc, 0x0148, 0x6010, 0x2058,
+	0xb840, 0x9084, 0x00ff, 0x9005, 0x1110, 0x9006, 0x0c38, 0x080c,
+	0xb51d, 0x2009, 0x026e, 0x2134, 0x96b4, 0x00ff, 0x9686, 0x0005,
+	0x0520, 0x9686, 0x000b, 0x01c8, 0x2009, 0x026f, 0x2104, 0x9084,
+	0xff00, 0x1118, 0x9686, 0x0009, 0x01c0, 0x9086, 0x1900, 0x1168,
+	0x9686, 0x0009, 0x0190, 0x2001, 0x0004, 0x080c, 0x631d, 0x2001,
+	0x0028, 0x601a, 0x6007, 0x0052, 0x0020, 0x2001, 0x0001, 0x080c,
+	0xb787, 0x002e, 0x00be, 0x009e, 0x0005, 0x9286, 0x0139, 0x0160,
+	0x6014, 0x2048, 0x080c, 0xc825, 0x0140, 0xa864, 0x9086, 0x0139,
+	0x0118, 0xa868, 0xd0fc, 0x0108, 0x0c40, 0x6010, 0x2058, 0xb840,
+	0x9084, 0x00ff, 0x9005, 0x0138, 0x8001, 0xb842, 0x601b, 0x000a,
+	0x6007, 0x0016, 0x08f0, 0xb8a0, 0x9086, 0x007e, 0x1138, 0x00e6,
+	0x2071, 0x1800, 0x080c, 0x5d8b, 0x00ee, 0x0010, 0x080c, 0x306e,
+	0x0860, 0x080c, 0xb98f, 0x1160, 0x2001, 0x0004, 0x080c, 0x631d,
+	0x6003, 0x0001, 0x6007, 0x0003, 0x080c, 0x8ec7, 0x0804, 0x941c,
+	0x080c, 0xb51d, 0x9006, 0x0804, 0xb787, 0x0489, 0x1160, 0x2001,
+	0x0008, 0x080c, 0x631d, 0x6003, 0x0001, 0x6007, 0x0005, 0x080c,
+	0x8ec7, 0x0804, 0x941c, 0x2001, 0x0001, 0x0804, 0xb787, 0x00f9,
+	0x1160, 0x2001, 0x000a, 0x080c, 0x631d, 0x6003, 0x0001, 0x6007,
+	0x0001, 0x080c, 0x8ec7, 0x0804, 0x941c, 0x2001, 0x0001, 0x0804,
+	0xb787, 0x2009, 0x026e, 0x2104, 0x9086, 0x0003, 0x1138, 0x2009,
+	0x026f, 0x2104, 0x9084, 0xff00, 0x9086, 0x2a00, 0x0005, 0x9085,
+	0x0001, 0x0005, 0x00b6, 0x00c6, 0x0016, 0x6110, 0x2158, 0x080c,
+	0x63dc, 0x001e, 0x00ce, 0x00be, 0x0005, 0x00b6, 0x00f6, 0x00e6,
+	0x00d6, 0x0036, 0x0016, 0x6010, 0x2058, 0x2009, 0x1837, 0x2104,
+	0x9085, 0x0003, 0x200a, 0x080c, 0xba35, 0x0560, 0x2009, 0x1837,
+	0x2104, 0xc0cd, 0x200a, 0x080c, 0x6733, 0x0158, 0x9006, 0x2020,
+	0x2009, 0x002a, 0x080c, 0xe280, 0x2001, 0x180c, 0x200c, 0xc195,
+	0x2102, 0x2019, 0x002a, 0x2009, 0x0001, 0x080c, 0x3039, 0x00e6,
+	0x2071, 0x1800, 0x080c, 0x2e48, 0x00ee, 0x00c6, 0x0156, 0x20a9,
+	0x0781, 0x2009, 0x007f, 0x080c, 0x3166, 0x8108, 0x1f04, 0xb9d3,
+	0x015e, 0x00ce, 0x080c, 0xb992, 0x2071, 0x0260, 0x2079, 0x0200,
+	0x7817, 0x0001, 0x2001, 0x1837, 0x200c, 0xc1c5, 0x7018, 0xd0fc,
+	0x0110, 0xd0dc, 0x0118, 0x7038, 0xd0dc, 0x1108, 0xc1c4, 0x7817,
+	0x0000, 0x2001, 0x1837, 0x2102, 0x2079, 0x0100, 0x2e04, 0x9084,
+	0x00ff, 0x2069, 0x181f, 0x206a, 0x78e6, 0x0006, 0x8e70, 0x2e04,
+	0x2069, 0x1820, 0x206a, 0x78ea, 0x7832, 0x7836, 0x2010, 0x9084,
+	0xff00, 0x001e, 0x9105, 0x2009, 0x182c, 0x200a, 0x2200, 0x9084,
+	0x00ff, 0x2008, 0x080c, 0x2739, 0x080c, 0x717d, 0x0170, 0x2071,
+	0x0260, 0x2069, 0x1980, 0x7048, 0x206a, 0x704c, 0x6806, 0x7050,
+	0x680a, 0x7054, 0x680e, 0x080c, 0xcc2d, 0x0040, 0x2001, 0x0006,
+	0x080c, 0x631d, 0x080c, 0x3093, 0x080c, 0xab6b, 0x001e, 0x003e,
+	0x00de, 0x00ee, 0x00fe, 0x00be, 0x0005, 0x0096, 0x0026, 0x0036,
+	0x00e6, 0x0156, 0x2019, 0x182c, 0x231c, 0x83ff, 0x01f0, 0x2071,
+	0x0260, 0x7200, 0x9294, 0x00ff, 0x7004, 0x9084, 0xff00, 0x9205,
+	0x9306, 0x1198, 0x2011, 0x0276, 0x20a9, 0x0004, 0x2b48, 0x2019,
+	0x000a, 0x080c, 0xbb27, 0x1148, 0x2011, 0x027a, 0x20a9, 0x0004,
+	0x2019, 0x0006, 0x080c, 0xbb27, 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, 0x19ee, 0x252c, 0x2021,
+	0x19f4, 0x2424, 0x2061, 0x1cd0, 0x2071, 0x1800, 0x7254, 0x7074,
+	0x9202, 0x1a04, 0xbaf3, 0x080c, 0x8710, 0x0904, 0xbaec, 0x080c,
+	0xe2ac, 0x0904, 0xbaec, 0x6720, 0x9786, 0x0007, 0x0904, 0xbaec,
+	0x2500, 0x9c06, 0x0904, 0xbaec, 0x2400, 0x9c06, 0x05e8, 0x3e08,
+	0x9186, 0x0002, 0x1148, 0x6010, 0x9005, 0x0130, 0x00b6, 0x2058,
+	0xb800, 0x00be, 0xd0bc, 0x1580, 0x00c6, 0x6000, 0x9086, 0x0004,
+	0x1110, 0x080c, 0x19b4, 0x9786, 0x000a, 0x0148, 0x080c, 0xca24,
+	0x1130, 0x00ce, 0x080c, 0xb51d, 0x080c, 0xab9c, 0x00e8, 0x6014,
+	0x2048, 0x080c, 0xc825, 0x01a8, 0x9786, 0x0003, 0x1530, 0xa867,
+	0x0103, 0xab7a, 0xa877, 0x0000, 0xa87c, 0xd0cc, 0x0130, 0x0096,
+	0xa878, 0x2048, 0x080c, 0x0fb2, 0x009e, 0x080c, 0x6a3a, 0x080c,
+	0xca07, 0x080c, 0xab9c, 0x00ce, 0x9ce0, 0x0018, 0x7068, 0x9c02,
+	0x1210, 0x0804, 0xba96, 0x012e, 0x000e, 0x002e, 0x004e, 0x005e,
+	0x007e, 0x00ce, 0x009e, 0x00ee, 0x0005, 0x9786, 0x0006, 0x1118,
+	0x080c, 0xe223, 0x0c30, 0x9786, 0x0009, 0x1148, 0x6000, 0x9086,
+	0x0004, 0x0d08, 0x2009, 0x004c, 0x080c, 0xabe6, 0x08e0, 0x9786,
+	0x000a, 0x0938, 0x0820, 0x220c, 0x2304, 0x9106, 0x1130, 0x8210,
+	0x8318, 0x1f04, 0xbb13, 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, 0x220c, 0x810f, 0x2304, 0x9106, 0x1130, 0x8210, 0x8318,
+	0x1f04, 0xbb51, 0x9006, 0x0005, 0x918d, 0x0001, 0x0005, 0x6004,
+	0x908a, 0x0053, 0x1a0c, 0x0dd5, 0x080c, 0xca13, 0x0120, 0x080c,
+	0xca24, 0x0168, 0x0028, 0x080c, 0x3093, 0x080c, 0xca24, 0x0138,
+	0x080c, 0x9317, 0x080c, 0xab6b, 0x080c, 0x941c, 0x0005, 0x080c,
+	0xb51d, 0x0cb0, 0x9182, 0x0054, 0x1220, 0x9182, 0x0040, 0x0208,
+	0x000a, 0x0005, 0xbb96, 0xbb96, 0xbb96, 0xbb96, 0xbb96, 0xbb96,
+	0xbb96, 0xbb96, 0xbb96, 0xbb96, 0xbb96, 0xbb98, 0xbb98, 0xbb98,
+	0xbb98, 0xbb96, 0xbb96, 0xbb96, 0xbb98, 0xbb96, 0x080c, 0x0dd5,
+	0x600b, 0xffff, 0x6003, 0x0001, 0x6106, 0x080c, 0x8e7f, 0x0126,
+	0x2091, 0x8000, 0x080c, 0x941c, 0x012e, 0x0005, 0x9186, 0x0013,
+	0x1128, 0x6004, 0x9082, 0x0040, 0x0804, 0xbc4d, 0x9186, 0x0027,
+	0x1520, 0x080c, 0x9317, 0x080c, 0x306e, 0x080c, 0xcf2d, 0x0096,
+	0x6114, 0x2148, 0x080c, 0xc825, 0x0198, 0x080c, 0xca24, 0x1118,
+	0x080c, 0xb51d, 0x0068, 0xa867, 0x0103, 0xa87b, 0x0029, 0xa877,
+	0x0000, 0xa97c, 0xc1c5, 0xa97e, 0x080c, 0x6a46, 0x080c, 0xca07,
+	0x009e, 0x080c, 0xab6b, 0x0804, 0x941c, 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,
+	0x0dd5, 0x2001, 0x0109, 0x2004, 0xd084, 0x0508, 0x0126, 0x2091,
 	0x2800, 0x0006, 0x0016, 0x0026, 0x0036, 0x00f6, 0x00e6, 0x00c6,
-	0x2079, 0x19b6, 0x2071, 0x1800, 0x2061, 0x0100, 0x080c, 0x7eec,
+	0x2079, 0x19e5, 0x2071, 0x1800, 0x2061, 0x0100, 0x080c, 0x8d64,
 	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,
+	0xa001, 0x6000, 0x9086, 0x0002, 0x1110, 0x0804, 0xbc8b, 0x0005,
+	0x0002, 0xbc27, 0xbc25, 0xbc25, 0xbc25, 0xbc25, 0xbc25, 0xbc25,
+	0xbc25, 0xbc25, 0xbc25, 0xbc25, 0xbc42, 0xbc42, 0xbc42, 0xbc42,
+	0xbc25, 0xbc42, 0xbc25, 0xbc42, 0xbc25, 0x080c, 0x0dd5, 0x080c,
+	0x9317, 0x0096, 0x6114, 0x2148, 0x080c, 0xc825, 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,
+	0x080c, 0x6a46, 0x080c, 0xca07, 0x009e, 0x080c, 0xab6b, 0x080c,
+	0x941c, 0x0005, 0x080c, 0x9317, 0x080c, 0xca24, 0x090c, 0xb51d,
+	0x080c, 0xab6b, 0x080c, 0x941c, 0x0005, 0x0002, 0xbc64, 0xbc62,
+	0xbc62, 0xbc62, 0xbc62, 0xbc62, 0xbc62, 0xbc62, 0xbc62, 0xbc62,
+	0xbc62, 0xbc7b, 0xbc7b, 0xbc7b, 0xbc7b, 0xbc62, 0xbc85, 0xbc62,
+	0xbc7b, 0xbc62, 0x080c, 0x0dd5, 0x0096, 0x080c, 0x9317, 0x6014,
+	0x2048, 0x2001, 0x1986, 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,
+	0x6003, 0x0002, 0x0cb8, 0x080c, 0x9317, 0x080c, 0xcf30, 0x080c,
+	0xcf35, 0x6003, 0x000f, 0x0804, 0x941c, 0x080c, 0x9317, 0x080c,
+	0xab6b, 0x0804, 0x941c, 0x9182, 0x0054, 0x1220, 0x9182, 0x0040,
+	0x0208, 0x000a, 0x0005, 0xbca7, 0xbca7, 0xbca7, 0xbca7, 0xbca7,
+	0xbca9, 0xbd86, 0xbca7, 0xbdba, 0xbca7, 0xbca7, 0xbca7, 0xbca7,
+	0xbca7, 0xbca7, 0xbca7, 0xbca7, 0xbca7, 0xbca7, 0xbdba, 0x080c,
+	0x0dd5, 0x00b6, 0x0096, 0x6114, 0x2148, 0x7644, 0x96b4, 0x0fff,
+	0x86ff, 0x1528, 0x6010, 0x2058, 0xb800, 0xd0bc, 0x1904, 0xbd75,
 	0xa87b, 0x0000, 0xa867, 0x0103, 0xae76, 0xa87c, 0xd0ac, 0x0128,
-	0xa834, 0xa938, 0x9115, 0x190c, 0xad37, 0x080c, 0x6351, 0x6210,
+	0xa834, 0xa938, 0x9115, 0x190c, 0xbf4f, 0x080c, 0x6862, 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,
+	0x1904, 0xbd59, 0x080c, 0xab6b, 0x009e, 0x00be, 0x0005, 0x968c,
+	0x0c00, 0x0150, 0x6010, 0x2058, 0xb800, 0xd0bc, 0x1904, 0xbd5d,
 	0x7348, 0xab92, 0x734c, 0xab8e, 0x968c, 0x00ff, 0x9186, 0x0002,
 	0x0508, 0x9186, 0x0028, 0x1118, 0xa87b, 0x001c, 0x00e8, 0xd6dc,
 	0x01a0, 0xa87b, 0x0015, 0xa87c, 0xd0ac, 0x0170, 0xa938, 0xaa34,
@@ -5266,36 +5845,36 @@
 	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,
+	0xc6c4, 0x0804, 0xbcb0, 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,
+	0x2011, 0x0025, 0x080c, 0xc43a, 0x003e, 0xd6cc, 0x0904, 0xbcc5,
+	0x7154, 0xa98a, 0x81ff, 0x0904, 0xbcc5, 0x9192, 0x0021, 0x1278,
+	0x8304, 0x9098, 0x0018, 0x2011, 0x0029, 0x080c, 0xc43a, 0x2011,
+	0x0205, 0x2013, 0x0000, 0x080c, 0xcebd, 0x0804, 0xbcc5, 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,
+	0x080c, 0xc3d9, 0x00ae, 0x080c, 0xcebd, 0x080c, 0xc42a, 0x0804,
+	0xbcc7, 0x080c, 0xcb17, 0x0804, 0xbcd4, 0xa87c, 0xd0ac, 0x0904,
+	0xbce0, 0xa880, 0xd0bc, 0x1904, 0xbce0, 0x7348, 0xa838, 0x9306,
+	0x11c8, 0x734c, 0xa834, 0x931e, 0x0904, 0xbce0, 0xd6d4, 0x0190,
+	0xab38, 0x9305, 0x0904, 0xbce0, 0x0068, 0xa87c, 0xd0ac, 0x0904,
+	0xbcb8, 0xa838, 0xa934, 0x9105, 0x0904, 0xbcb8, 0xa880, 0xd0bc,
+	0x1904, 0xbcb8, 0x080c, 0xcb51, 0x0804, 0xbcd4, 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,
+	0x0000, 0x2c10, 0x080c, 0x1b03, 0x080c, 0x8ee4, 0x080c, 0x9548,
 	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,
+	0x0208, 0x000a, 0x0005, 0xbdd7, 0xbdd7, 0xbdd7, 0xbdd7, 0xbdd7,
+	0xbdd9, 0xbe6f, 0xbdd7, 0xbdd7, 0xbe86, 0xbf12, 0xbdd7, 0xbdd7,
+	0xbdd7, 0xbdd7, 0xbf27, 0xbdd7, 0xbdd7, 0xbdd7, 0xbdd7, 0x080c,
+	0x0dd5, 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,
+	0x00be, 0x86ff, 0x0904, 0xbe6a, 0x9694, 0xff00, 0x9284, 0x0c00,
 	0x0120, 0x7048, 0xb092, 0x704c, 0xb08e, 0x9284, 0x0300, 0x0904,
-	0xac52, 0x080c, 0x0fd5, 0x090c, 0x0db2, 0x2900, 0xb07a, 0xb77c,
+	0xbe6a, 0x080c, 0x1000, 0x090c, 0x0dd5, 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,
@@ -5304,1392 +5883,1550 @@
 	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,
+	0x080c, 0xc43a, 0x003e, 0xd6cc, 0x01e8, 0x7154, 0xa98a, 0x81ff,
 	0x01c8, 0x9192, 0x0021, 0x1260, 0x8304, 0x9098, 0x0018, 0x2011,
-	0x0029, 0x080c, 0xb219, 0x2011, 0x0205, 0x2013, 0x0000, 0x0050,
+	0x0029, 0x080c, 0xc43a, 0x2011, 0x0205, 0x2013, 0x0000, 0x0050,
 	0xb068, 0xd0fc, 0x0120, 0x2009, 0x0020, 0xa98a, 0x0c68, 0x2950,
-	0x080c, 0xb1b8, 0x009e, 0x00ee, 0x00ae, 0x007e, 0x0005, 0x00f6,
+	0x080c, 0xc3d9, 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,
+	0x00fe, 0x2c10, 0x080c, 0x1b03, 0x0804, 0x9fc9, 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,
+	0x080c, 0x1689, 0x00fe, 0x6003, 0x0004, 0x0010, 0x6003, 0x0002,
+	0x009e, 0x080c, 0x9317, 0x080c, 0x941c, 0x0096, 0x2001, 0x1986,
+	0x2004, 0x6042, 0x080c, 0x93cc, 0x080c, 0x9548, 0x6114, 0x2148,
+	0xa97c, 0xd1e4, 0x0904, 0xbf0d, 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,
+	0xa87e, 0x001e, 0xa874, 0x0006, 0x2148, 0x080c, 0x0fb2, 0x001e,
+	0x0440, 0x0016, 0x080c, 0x0fb2, 0x009e, 0xa974, 0x0016, 0x080c,
+	0xc42a, 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,
+	0xa87b, 0x0007, 0x0010, 0xa87b, 0x0000, 0x0016, 0x080c, 0x6862,
+	0x001e, 0xd1e4, 0x1120, 0x080c, 0xab6b, 0x009e, 0x0005, 0x080c,
+	0xcb17, 0x0cd8, 0x6004, 0x9086, 0x0040, 0x1120, 0x080c, 0x9317,
+	0x080c, 0x941c, 0x2019, 0x0001, 0x080c, 0xa2ac, 0x6003, 0x0002,
+	0x080c, 0xcf35, 0x080c, 0x93cc, 0x080c, 0x9548, 0x0005, 0x6004,
+	0x9086, 0x0040, 0x1120, 0x080c, 0x9317, 0x080c, 0x941c, 0x2019,
+	0x0001, 0x080c, 0xa2ac, 0x080c, 0x93cc, 0x080c, 0x306e, 0x080c,
+	0xcf2d, 0x0096, 0x6114, 0x2148, 0x080c, 0xc825, 0x0150, 0xa867,
+	0x0103, 0xa87b, 0x0029, 0xa877, 0x0000, 0x080c, 0x6a46, 0x080c,
+	0xca07, 0x009e, 0x080c, 0xab6b, 0x080c, 0x9548, 0x0005, 0xa87b,
+	0x0015, 0xd1fc, 0x0180, 0xa87b, 0x0007, 0x8002, 0x8000, 0x810a,
+	0x9189, 0x0000, 0x0006, 0x0016, 0x2009, 0x1a77, 0x2104, 0x8000,
+	0x200a, 0x001e, 0x000e, 0xa992, 0xa88e, 0x0005, 0x9182, 0x0054,
+	0x1220, 0x9182, 0x0040, 0x0208, 0x000a, 0x0005, 0xbf82, 0xbf82,
+	0xbf82, 0xbf82, 0xbf82, 0xbf84, 0xbf82, 0xbf82, 0xc02a, 0xbf82,
+	0xbf82, 0xbf82, 0xbf82, 0xbf82, 0xbf82, 0xbf82, 0xbf82, 0xbf82,
+	0xbf82, 0xc15b, 0x080c, 0x0dd5, 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, 0xc023, 0x9694,
+	0xff00, 0x9284, 0x0c00, 0x0120, 0x7048, 0xb092, 0x704c, 0xb08e,
+	0x9284, 0x0300, 0x0904, 0xc023, 0x9686, 0x0100, 0x1130, 0x7064,
+	0x9005, 0x1118, 0xc6c4, 0xb676, 0x0c38, 0x080c, 0x1000, 0x090c,
+	0x0dd5, 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, 0xc43a, 0x003e, 0xd6cc, 0x01e8, 0x7154, 0xa98a,
+	0x81ff, 0x01c8, 0x9192, 0x0021, 0x1260, 0x8304, 0x9098, 0x0018,
+	0x2011, 0x0029, 0x080c, 0xc43a, 0x2011, 0x0205, 0x2013, 0x0000,
+	0x0050, 0xb068, 0xd0fc, 0x0120, 0x2009, 0x0020, 0xa98a, 0x0c68,
+	0x2950, 0x080c, 0xc3d9, 0x080c, 0x1992, 0x009e, 0x00ee, 0x00ae,
+	0x007e, 0x0005, 0x2001, 0x1986, 0x2004, 0x6042, 0x0096, 0x6114,
+	0x2148, 0xa83c, 0xa940, 0x9105, 0x1118, 0xa87c, 0xc0dc, 0xa87e,
+	0x6003, 0x0002, 0xa97c, 0xd1e4, 0x0904, 0xc156, 0x6043, 0x0000,
+	0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x1500, 0xd1cc,
+	0x0904, 0xc125, 0xa978, 0xa868, 0xd0fc, 0x0904, 0xc0e6, 0x0016,
+	0xa87c, 0x0006, 0xa880, 0x0006, 0x00a6, 0x2150, 0xb174, 0x9184,
+	0x00ff, 0x90b6, 0x0002, 0x0904, 0xc0b4, 0x9086, 0x0028, 0x1904,
+	0xc0a0, 0xa87b, 0x001c, 0xb07b, 0x001c, 0x0804, 0xc0bc, 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, 0x0fb2, 0x009e, 0x080c, 0xcb51, 0x0804, 0xc156,
+	0xd1dc, 0x0158, 0xa87b, 0x0015, 0xb07b, 0x0015, 0x080c, 0xcde0,
+	0x0118, 0xb174, 0xc1dc, 0xb176, 0x0078, 0xd1d4, 0x0128, 0xa87b,
+	0x0007, 0xb07b, 0x0007, 0x0040, 0xa87c, 0xd0ac, 0x0128, 0xa834,
+	0xa938, 0x9115, 0x190c, 0xbf4f, 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, 0xcebd, 0x001e, 0xa874, 0x0006,
+	0x2148, 0x080c, 0x0fb2, 0x001e, 0x0804, 0xc152, 0x0016, 0x00a6,
+	0x2150, 0xb174, 0x9184, 0x00ff, 0x90b6, 0x0002, 0x01e0, 0x9086,
+	0x0028, 0x1128, 0xa87b, 0x001c, 0xb07b, 0x001c, 0x00e0, 0xd1dc,
+	0x0158, 0xa87b, 0x0015, 0xb07b, 0x0015, 0x080c, 0xcde0, 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,
+	0x9115, 0x190c, 0xbf4f, 0xa890, 0xb092, 0xa88c, 0xb08e, 0xa87c,
+	0xb07e, 0x00ae, 0x080c, 0x0fb2, 0x009e, 0x080c, 0xcebd, 0xa974,
+	0x0016, 0x080c, 0xc42a, 0x001e, 0x0468, 0xa867, 0x0103, 0xa974,
+	0x9184, 0x00ff, 0x90b6, 0x0002, 0x01b0, 0x9086, 0x0028, 0x1118,
+	0xa87b, 0x001c, 0x00d0, 0xd1dc, 0x0148, 0xa87b, 0x0015, 0x080c,
+	0xcde0, 0x0118, 0xa974, 0xc1dc, 0xa976, 0x0078, 0xd1d4, 0x0118,
+	0xa87b, 0x0007, 0x0050, 0xa87b, 0x0000, 0xa87c, 0xd0ac, 0x0128,
+	0xa834, 0xa938, 0x9115, 0x190c, 0xbf4f, 0xa974, 0x0016, 0x080c,
+	0x6862, 0x001e, 0xd1e4, 0x1120, 0x080c, 0xab6b, 0x009e, 0x0005,
+	0x080c, 0xcb17, 0x0cd8, 0x6114, 0x0096, 0x2148, 0xa97c, 0xd1e4,
+	0x190c, 0x19a0, 0x009e, 0x0005, 0x080c, 0x9317, 0x0010, 0x080c,
+	0x93cc, 0x080c, 0xc825, 0x01f0, 0x0096, 0x6114, 0x2148, 0x080c,
+	0xca24, 0x1118, 0x080c, 0xb51d, 0x00a0, 0xa867, 0x0103, 0x2009,
+	0x180c, 0x210c, 0xd18c, 0x11b8, 0xd184, 0x1190, 0x6108, 0xa97a,
+	0x918e, 0x0029, 0x1110, 0x080c, 0xe5d5, 0xa877, 0x0000, 0x080c,
+	0x6a46, 0x009e, 0x080c, 0xab6b, 0x080c, 0x941c, 0x0804, 0x9548,
+	0xa87b, 0x0004, 0x0c90, 0xa87b, 0x0004, 0x0c78, 0x9182, 0x0054,
+	0x1220, 0x9182, 0x0040, 0x0208, 0x000a, 0x0005, 0xc1b2, 0xc1b2,
+	0xc1b2, 0xc1b2, 0xc1b2, 0xc1b4, 0xc1b2, 0xc1b2, 0xc1b2, 0xc1b2,
+	0xc1b2, 0xc1b2, 0xc1b2, 0xc1b2, 0xc1b2, 0xc1b2, 0xc1b2, 0xc1b2,
+	0xc1b2, 0xc1b2, 0x080c, 0x0dd5, 0x080c, 0x54bf, 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, 0x6a46, 0x009e, 0x0804, 0xab6b,
+	0x9182, 0x0085, 0x0002, 0xc1ea, 0xc1e8, 0xc1e8, 0xc1f6, 0xc1e8,
+	0xc1e8, 0xc1e8, 0xc1e8, 0xc1e8, 0xc1e8, 0xc1e8, 0xc1e8, 0xc1e8,
+	0x080c, 0x0dd5, 0x6003, 0x0001, 0x6106, 0x080c, 0x8e7f, 0x0126,
+	0x2091, 0x8000, 0x080c, 0x941c, 0x012e, 0x0005, 0x0026, 0x0056,
+	0x00d6, 0x00e6, 0x2071, 0x0260, 0x7224, 0x6216, 0x7220, 0x080c,
+	0xc813, 0x01a0, 0x2268, 0x6800, 0x9086, 0x0000, 0x0178, 0x6010,
+	0x6d10, 0x952e, 0x1158, 0x00c6, 0x2d60, 0x080c, 0xc465, 0x00ce,
+	0x0128, 0x6803, 0x0002, 0x6007, 0x0086, 0x0010, 0x6007, 0x0087,
+	0x6003, 0x0001, 0x080c, 0x8e7f, 0x080c, 0x941c, 0x9280, 0x0004,
+	0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x0140, 0x6824, 0xd0ec,
+	0x0128, 0x00c6, 0x2260, 0x080c, 0xcb51, 0x00ce, 0x00ee, 0x00de,
+	0x005e, 0x002e, 0x0005, 0x9186, 0x0013, 0x1160, 0x6004, 0x908a,
+	0x0085, 0x0a0c, 0x0dd5, 0x908a, 0x0092, 0x1a0c, 0x0dd5, 0x9082,
+	0x0085, 0x00e2, 0x9186, 0x0027, 0x0120, 0x9186, 0x0014, 0x190c,
+	0x0dd5, 0x080c, 0x9317, 0x0096, 0x6014, 0x2048, 0x080c, 0xc825,
+	0x0140, 0xa867, 0x0103, 0xa877, 0x0000, 0xa87b, 0x0029, 0x080c,
+	0x6a46, 0x009e, 0x080c, 0xab9c, 0x0804, 0x941c, 0xc26b, 0xc26d,
+	0xc26d, 0xc26b, 0xc26b, 0xc26b, 0xc26b, 0xc26b, 0xc26b, 0xc26b,
+	0xc26b, 0xc26b, 0xc26b, 0x080c, 0x0dd5, 0x080c, 0x9317, 0x080c,
+	0xab9c, 0x080c, 0x941c, 0x0005, 0x9186, 0x0013, 0x1128, 0x6004,
+	0x9082, 0x0085, 0x2008, 0x04b8, 0x9186, 0x0027, 0x11f8, 0x080c,
+	0x9317, 0x080c, 0x306e, 0x080c, 0xcf2d, 0x0096, 0x6014, 0x2048,
+	0x080c, 0xc825, 0x0150, 0xa867, 0x0103, 0xa877, 0x0000, 0xa87b,
+	0x0029, 0x080c, 0x6a46, 0x080c, 0xca07, 0x009e, 0x080c, 0xab6b,
+	0x080c, 0x941c, 0x0005, 0x080c, 0xac01, 0x0ce0, 0x9186, 0x0014,
+	0x1dd0, 0x080c, 0x9317, 0x0096, 0x6014, 0x2048, 0x080c, 0xc825,
+	0x0d60, 0xa867, 0x0103, 0xa877, 0x0000, 0xa87b, 0x0006, 0xa880,
+	0xc0ec, 0xa882, 0x08f0, 0x0002, 0xc2c3, 0xc2c1, 0xc2c1, 0xc2c1,
+	0xc2c1, 0xc2c1, 0xc2db, 0xc2c1, 0xc2c1, 0xc2c1, 0xc2c1, 0xc2c1,
+	0xc2c1, 0x080c, 0x0dd5, 0x080c, 0x9317, 0x6034, 0x908c, 0xff00,
+	0x810f, 0x9186, 0x0039, 0x0118, 0x9186, 0x0035, 0x1118, 0x2001,
+	0x1984, 0x0010, 0x2001, 0x1985, 0x2004, 0x601a, 0x6003, 0x000c,
+	0x080c, 0x941c, 0x0005, 0x080c, 0x9317, 0x6034, 0x908c, 0xff00,
+	0x810f, 0x9186, 0x0039, 0x0118, 0x9186, 0x0035, 0x1118, 0x2001,
+	0x1984, 0x0010, 0x2001, 0x1985, 0x2004, 0x601a, 0x6003, 0x000e,
+	0x080c, 0x941c, 0x0005, 0x9182, 0x0092, 0x1220, 0x9182, 0x0085,
+	0x0208, 0x0012, 0x0804, 0xac01, 0xc309, 0xc309, 0xc309, 0xc309,
+	0xc30b, 0xc358, 0xc309, 0xc309, 0xc309, 0xc309, 0xc309, 0xc309,
+	0xc309, 0x080c, 0x0dd5, 0x0096, 0x6010, 0x00b6, 0x2058, 0xb800,
+	0x00be, 0xd0bc, 0x0168, 0x6034, 0x908c, 0xff00, 0x810f, 0x9186,
+	0x0039, 0x0118, 0x9186, 0x0035, 0x1118, 0x009e, 0x0804, 0xc36c,
+	0x080c, 0xc825, 0x1118, 0x080c, 0xca07, 0x0068, 0x6014, 0x2048,
+	0xa87c, 0xd0e4, 0x1110, 0x080c, 0xca07, 0xa867, 0x0103, 0x080c,
+	0xcef8, 0x080c, 0x6a46, 0x00d6, 0x2c68, 0x080c, 0xab15, 0x01d0,
+	0x6003, 0x0001, 0x6007, 0x001e, 0x600b, 0xffff, 0x2009, 0x026e,
+	0x210c, 0x613a, 0x2009, 0x026f, 0x210c, 0x613e, 0x6910, 0x6112,
+	0x080c, 0xcc93, 0x6954, 0x6156, 0x6023, 0x0001, 0x080c, 0x8e7f,
+	0x080c, 0x941c, 0x2d60, 0x00de, 0x080c, 0xab6b, 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, 0xce90,
+	0x11f0, 0x080c, 0xab15, 0x01d8, 0x6106, 0x6003, 0x0001, 0x6023,
+	0x0001, 0x6910, 0x6112, 0x692c, 0x612e, 0x6930, 0x6132, 0x6934,
+	0x918c, 0x00ff, 0x6136, 0x6938, 0x613a, 0x693c, 0x613e, 0x6954,
+	0x6156, 0x080c, 0xcc93, 0x080c, 0x8e7f, 0x080c, 0x941c, 0x2d60,
+	0x00de, 0x0804, 0xab6b, 0x0096, 0x6014, 0x2048, 0x080c, 0xc825,
+	0x01c8, 0xa867, 0x0103, 0xa880, 0xd0b4, 0x0128, 0xc0ec, 0xa882,
+	0xa87b, 0x0006, 0x0048, 0xd0bc, 0x0118, 0xa87b, 0x0002, 0x0020,
+	0xa87b, 0x0005, 0x080c, 0xcb13, 0xa877, 0x0000, 0x080c, 0x6a46,
+	0x080c, 0xca07, 0x009e, 0x0804, 0xab6b, 0x0016, 0x0096, 0x6014,
+	0x2048, 0x080c, 0xc825, 0x0140, 0xa867, 0x0103, 0xa87b, 0x0028,
+	0xa877, 0x0000, 0x080c, 0x6a46, 0x009e, 0x001e, 0x9186, 0x0013,
+	0x0148, 0x9186, 0x0014, 0x0130, 0x9186, 0x0027, 0x0118, 0x080c,
+	0xac01, 0x0030, 0x080c, 0x9317, 0x080c, 0xab9c, 0x080c, 0x941c,
+	0x0005, 0x0056, 0x0066, 0x0096, 0x00a6, 0x2029, 0x0001, 0x9182,
+	0x0101, 0x1208, 0x0010, 0x2009, 0x0100, 0x2130, 0x8304, 0x9098,
+	0x0018, 0x2009, 0x0020, 0x2011, 0x0029, 0x080c, 0xc43a, 0x96b2,
+	0x0020, 0xb004, 0x904d, 0x0110, 0x080c, 0x0fb2, 0x080c, 0x1000,
+	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, 0x6a46, 0x2a48, 0x0cb8, 0x080c, 0x6a46,
+	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, 0xc4a0,
+	0xc4a0, 0xc49b, 0xc4c2, 0xc48e, 0xc49b, 0xc4c2, 0xc49b, 0xc48e,
+	0x8c68, 0xc49b, 0xc49b, 0xc49b, 0xc48e, 0xc48e, 0x080c, 0x0dd5,
+	0x0036, 0x2019, 0x0010, 0x080c, 0xde08, 0x6023, 0x0006, 0x6003,
+	0x0007, 0x003e, 0x0005, 0x9006, 0x0005, 0x9085, 0x0001, 0x0005,
+	0x0096, 0x86ff, 0x11d8, 0x6014, 0x2048, 0x080c, 0xc825, 0x01c0,
+	0xa864, 0x9086, 0x0139, 0x1128, 0xa87b, 0x0005, 0xa883, 0x0000,
+	0x0028, 0x900e, 0x2001, 0x0005, 0x080c, 0x6c85, 0x080c, 0xcb13,
+	0x080c, 0x6a3a, 0x080c, 0xab9c, 0x9085, 0x0001, 0x009e, 0x0005,
+	0x9006, 0x0ce0, 0x6000, 0x908a, 0x0016, 0x1a0c, 0x0dd5, 0x0002,
+	0xc4d8, 0xc506, 0xc4da, 0xc527, 0xc501, 0xc4d8, 0xc49b, 0xc4a0,
+	0xc4a0, 0xc49b, 0xc49b, 0xc49b, 0xc49b, 0xc49b, 0xc49b, 0xc49b,
+	0x080c, 0x0dd5, 0x86ff, 0x1510, 0x6020, 0x9086, 0x0006, 0x01f0,
+	0x0096, 0x6014, 0x2048, 0x080c, 0xc825, 0x0158, 0xa87c, 0xd0cc,
+	0x0130, 0x0096, 0xa878, 0x2048, 0x080c, 0x0fb2, 0x009e, 0x080c,
+	0xcb13, 0x009e, 0x080c, 0xced2, 0x6007, 0x0085, 0x6003, 0x000b,
+	0x6023, 0x0002, 0x080c, 0x8e7f, 0x080c, 0x941c, 0x9085, 0x0001,
+	0x0005, 0x0066, 0x080c, 0x19b4, 0x006e, 0x08a0, 0x00e6, 0x2071,
+	0x19e5, 0x7024, 0x9c06, 0x1120, 0x080c, 0xa236, 0x00ee, 0x0850,
+	0x6020, 0x9084, 0x000f, 0x9086, 0x0006, 0x1150, 0x0086, 0x0096,
+	0x2049, 0x0001, 0x2c40, 0x080c, 0xa3a6, 0x009e, 0x008e, 0x0010,
+	0x080c, 0xa133, 0x00ee, 0x1904, 0xc4da, 0x0804, 0xc49b, 0x0036,
+	0x00e6, 0x2071, 0x19e5, 0x703c, 0x9c06, 0x1138, 0x901e, 0x080c,
+	0xa2ac, 0x00ee, 0x003e, 0x0804, 0xc4da, 0x080c, 0xa4d6, 0x00ee,
+	0x003e, 0x1904, 0xc4da, 0x0804, 0xc49b, 0x00c6, 0x6020, 0x9084,
+	0x000f, 0x0013, 0x00ce, 0x0005, 0xc55a, 0xc609, 0xc770, 0xc564,
+	0xab9c, 0xc55a, 0xddfa, 0xcf3a, 0xc609, 0x8c3a, 0xc7ef, 0xc553,
+	0xc553, 0xc553, 0xc553, 0x080c, 0x0dd5, 0x080c, 0xca24, 0x1110,
+	0x080c, 0xb51d, 0x0005, 0x080c, 0x9317, 0x080c, 0x941c, 0x0804,
+	0xab6b, 0x601b, 0x0001, 0x0005, 0x080c, 0xc825, 0x0130, 0x6014,
+	0x0096, 0x2048, 0x2c00, 0xa896, 0x009e, 0x6000, 0x908a, 0x0016,
+	0x1a0c, 0x0dd5, 0x0002, 0xc583, 0xc585, 0xc5a9, 0xc5bd, 0xc5e1,
+	0xc583, 0xc55a, 0xc55a, 0xc55a, 0xc5bd, 0xc5bd, 0xc583, 0xc583,
+	0xc583, 0xc583, 0xc5c7, 0x080c, 0x0dd5, 0x00e6, 0x6014, 0x0096,
+	0x2048, 0xa880, 0xc0b5, 0xa882, 0x009e, 0x2071, 0x19e5, 0x7024,
+	0x9c06, 0x01a0, 0x080c, 0xa133, 0x080c, 0xced2, 0x6007, 0x0085,
+	0x6003, 0x000b, 0x6023, 0x0002, 0x2001, 0x1985, 0x2004, 0x601a,
+	0x080c, 0x8e7f, 0x080c, 0x941c, 0x00ee, 0x0005, 0x601b, 0x0001,
+	0x0cd8, 0x0096, 0x6014, 0x2048, 0xa880, 0xc0b5, 0xa882, 0x009e,
+	0x080c, 0xced2, 0x6007, 0x0085, 0x6003, 0x000b, 0x6023, 0x0002,
+	0x080c, 0x8e7f, 0x080c, 0x941c, 0x0005, 0x0096, 0x601b, 0x0001,
+	0x6014, 0x2048, 0xa880, 0xc0b5, 0xa882, 0x009e, 0x0005, 0x080c,
+	0x54bf, 0x01a8, 0x6014, 0x0096, 0x904d, 0x0180, 0xa864, 0xa867,
+	0x0103, 0xa87b, 0x0006, 0x9086, 0x0139, 0x1140, 0xa867, 0x0139,
+	0xa897, 0x4005, 0xa89b, 0x0004, 0x080c, 0x6a46, 0x009e, 0x0804,
+	0xab6b, 0x6014, 0x0096, 0x904d, 0x01f8, 0xa97c, 0xd1e4, 0x01e0,
+	0x2001, 0x180f, 0x2004, 0xd0c4, 0x0110, 0x009e, 0x0005, 0xa884,
+	0x009e, 0x8003, 0x800b, 0x810b, 0x9108, 0x611a, 0x2001, 0x0037,
+	0x2c08, 0x080c, 0x15d1, 0x6000, 0x9086, 0x0004, 0x1120, 0x2009,
+	0x0048, 0x080c, 0xabe6, 0x0005, 0x009e, 0x080c, 0x19b4, 0x0804,
+	0xc5a9, 0x6000, 0x908a, 0x0016, 0x1a0c, 0x0dd5, 0x000b, 0x0005,
+	0xc620, 0xc561, 0xc622, 0xc620, 0xc622, 0xc622, 0xc55b, 0xc620,
+	0xc555, 0xc555, 0xc620, 0xc620, 0xc620, 0xc620, 0xc620, 0xc620,
+	0x080c, 0x0dd5, 0x6010, 0x00b6, 0x2058, 0xb804, 0x9084, 0x00ff,
+	0x00be, 0x908a, 0x000c, 0x1a0c, 0x0dd5, 0x00b6, 0x0013, 0x00be,
+	0x0005, 0xc63d, 0xc70a, 0xc63f, 0xc67f, 0xc63f, 0xc67f, 0xc63f,
+	0xc64d, 0xc63d, 0xc67f, 0xc63d, 0xc66e, 0x080c, 0x0dd5, 0x6004,
+	0x908e, 0x0016, 0x05c0, 0x908e, 0x0004, 0x05a8, 0x908e, 0x0002,
+	0x0590, 0x908e, 0x0052, 0x0904, 0xc706, 0x6004, 0x080c, 0xca24,
+	0x0904, 0xc723, 0x908e, 0x0004, 0x1110, 0x080c, 0x3093, 0x908e,
+	0x0021, 0x0904, 0xc727, 0x908e, 0x0022, 0x0904, 0xc76b, 0x908e,
+	0x003d, 0x0904, 0xc727, 0x908e, 0x0039, 0x0904, 0xc72b, 0x908e,
+	0x0035, 0x0904, 0xc72b, 0x908e, 0x001e, 0x0178, 0x908e, 0x0001,
+	0x1140, 0x6010, 0x2058, 0xb804, 0x9084, 0x00ff, 0x9086, 0x0006,
+	0x0110, 0x080c, 0x306e, 0x080c, 0xb51d, 0x0804, 0xab9c, 0x00c6,
+	0x00d6, 0x6104, 0x9186, 0x0016, 0x0904, 0xc6f7, 0x9186, 0x0002,
+	0x1904, 0xc6cc, 0x2001, 0x1837, 0x2004, 0xd08c, 0x11c8, 0x080c,
+	0x717d, 0x11b0, 0x080c, 0xcf18, 0x0138, 0x080c, 0x71a0, 0x1120,
+	0x080c, 0x708d, 0x0804, 0xc754, 0x2001, 0x197d, 0x2003, 0x0001,
+	0x2001, 0x1800, 0x2003, 0x0001, 0x080c, 0x70af, 0x0804, 0xc754,
+	0x6010, 0x2058, 0x2001, 0x1837, 0x2004, 0xd0ac, 0x1904, 0xc754,
+	0xb8a0, 0x9084, 0xff80, 0x1904, 0xc754, 0xb840, 0x9084, 0x00ff,
+	0x9005, 0x0190, 0x8001, 0xb842, 0x6017, 0x0000, 0x6023, 0x0007,
+	0x601b, 0x0398, 0x6043, 0x0000, 0x080c, 0xab15, 0x0128, 0x2b00,
+	0x6012, 0x6023, 0x0001, 0x0458, 0x00de, 0x00ce, 0x6004, 0x908e,
+	0x0002, 0x11a0, 0x6010, 0x2058, 0xb8a0, 0x9086, 0x007e, 0x1170,
+	0x2009, 0x1837, 0x2104, 0xc085, 0x200a, 0x00e6, 0x2071, 0x1800,
+	0x080c, 0x5d8b, 0x00ee, 0x080c, 0xb51d, 0x0030, 0x080c, 0xb51d,
+	0x080c, 0x306e, 0x080c, 0xcf2d, 0x00e6, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x3093, 0x012e, 0x00ee, 0x080c, 0xab9c, 0x0005, 0x2001,
+	0x0002, 0x080c, 0x631d, 0x6003, 0x0001, 0x6007, 0x0002, 0x080c,
+	0x8ec7, 0x080c, 0x941c, 0x00de, 0x00ce, 0x0c80, 0x080c, 0x3093,
+	0x0804, 0xc67b, 0x00c6, 0x00d6, 0x6104, 0x9186, 0x0016, 0x0d38,
+	0x6010, 0x2058, 0xb840, 0x9084, 0x00ff, 0x9005, 0x0904, 0xc6cc,
+	0x8001, 0xb842, 0x6003, 0x0001, 0x080c, 0x8ec7, 0x080c, 0x941c,
+	0x00de, 0x00ce, 0x0898, 0x080c, 0xb51d, 0x0804, 0xc67d, 0x080c,
+	0xb559, 0x0804, 0xc67d, 0x00d6, 0x2c68, 0x6104, 0x080c, 0xce90,
+	0x00de, 0x0118, 0x080c, 0xab6b, 0x00f0, 0x6004, 0x8007, 0x6134,
+	0x918c, 0x00ff, 0x9105, 0x6036, 0x6007, 0x0085, 0x6003, 0x000b,
+	0x6023, 0x0002, 0x603c, 0x600a, 0x2001, 0x1985, 0x2004, 0x601a,
+	0x602c, 0x2c08, 0x2060, 0x6024, 0xc0b5, 0x6026, 0x2160, 0x080c,
+	0x8e7f, 0x080c, 0x941c, 0x0005, 0x00de, 0x00ce, 0x080c, 0xb51d,
+	0x080c, 0x306e, 0x00e6, 0x0126, 0x2091, 0x8000, 0x080c, 0x3093,
+	0x6017, 0x0000, 0x6023, 0x0007, 0x601b, 0x0398, 0x6043, 0x0000,
+	0x012e, 0x00ee, 0x0005, 0x080c, 0xaf9b, 0x1904, 0xc723, 0x0005,
+	0x6000, 0x908a, 0x0016, 0x1a0c, 0x0dd5, 0x0096, 0x00d6, 0x001b,
+	0x00de, 0x009e, 0x0005, 0xc78b, 0xc78b, 0xc78b, 0xc78b, 0xc78b,
+	0xc78b, 0xc78b, 0xc78b, 0xc78b, 0xc55a, 0xc78b, 0xc561, 0xc78d,
+	0xc561, 0xc79a, 0xc78b, 0x080c, 0x0dd5, 0x6004, 0x9086, 0x008b,
+	0x0148, 0x6007, 0x008b, 0x6003, 0x000d, 0x080c, 0x8e7f, 0x080c,
+	0x941c, 0x0005, 0x080c, 0xcf0c, 0x0118, 0x080c, 0xcf1f, 0x0010,
+	0x080c, 0xcf2d, 0x080c, 0xca07, 0x080c, 0xc825, 0x0570, 0x080c,
+	0x306e, 0x080c, 0xc825, 0x0168, 0x6014, 0x2048, 0xa867, 0x0103,
+	0xa87b, 0x0006, 0xa877, 0x0000, 0xa880, 0xc0ed, 0xa882, 0x080c,
+	0x6a46, 0x2c68, 0x080c, 0xab15, 0x0150, 0x6810, 0x6012, 0x080c,
+	0xcc93, 0x00c6, 0x2d60, 0x080c, 0xab9c, 0x00ce, 0x0008, 0x2d60,
+	0x6017, 0x0000, 0x6023, 0x0001, 0x6007, 0x0001, 0x6003, 0x0001,
+	0x080c, 0x8ec7, 0x080c, 0x941c, 0x00c8, 0x080c, 0xcf0c, 0x0138,
+	0x6034, 0x9086, 0x4000, 0x1118, 0x080c, 0x306e, 0x08d0, 0x6034,
+	0x908c, 0xff00, 0x810f, 0x9186, 0x0039, 0x0118, 0x9186, 0x0035,
+	0x1118, 0x080c, 0x306e, 0x0868, 0x080c, 0xab9c, 0x0005, 0x6000,
+	0x908a, 0x0016, 0x1a0c, 0x0dd5, 0x0002, 0xc805, 0xc805, 0xc807,
+	0xc807, 0xc807, 0xc805, 0xc805, 0xab9c, 0xc805, 0xc805, 0xc805,
+	0xc805, 0xc805, 0xc805, 0xc805, 0xc805, 0x080c, 0x0dd5, 0x080c,
+	0xa4d6, 0x6114, 0x0096, 0x2148, 0xa87b, 0x0006, 0x080c, 0x6a46,
+	0x009e, 0x0804, 0xab6b, 0x9284, 0x0007, 0x1158, 0x9282, 0x1cd0,
+	0x0240, 0x2001, 0x181a, 0x2004, 0x9202, 0x1218, 0x9085, 0x0001,
+	0x0005, 0x9006, 0x0ce8, 0x0096, 0x0028, 0x0096, 0x0006, 0x6014,
+	0x2048, 0x000e, 0x0006, 0x9984, 0xf000, 0x9086, 0xf000, 0x0110,
+	0x080c, 0x10ab, 0x000e, 0x009e, 0x0005, 0x00e6, 0x00c6, 0x0036,
+	0x0006, 0x0126, 0x2091, 0x8000, 0x2061, 0x1cd0, 0x2071, 0x1800,
+	0x7354, 0x7074, 0x9302, 0x1640, 0x6020, 0x9206, 0x11f8, 0x080c,
+	0xcf18, 0x0180, 0x9286, 0x0001, 0x1168, 0x6004, 0x9086, 0x0004,
+	0x1148, 0x080c, 0x306e, 0x080c, 0xcf2d, 0x00c6, 0x080c, 0xab9c,
+	0x00ce, 0x0060, 0x080c, 0xcc0d, 0x0148, 0x080c, 0xca24, 0x1110,
+	0x080c, 0xb51d, 0x00c6, 0x080c, 0xab6b, 0x00ce, 0x9ce0, 0x0018,
+	0x7068, 0x9c02, 0x1208, 0x08a0, 0x012e, 0x000e, 0x003e, 0x00ce,
+	0x00ee, 0x0005, 0x00e6, 0x00c6, 0x0016, 0x9188, 0x1000, 0x210c,
+	0x81ff, 0x0128, 0x2061, 0x1aa7, 0x6112, 0x080c, 0x306e, 0x9006,
+	0x0010, 0x9085, 0x0001, 0x001e, 0x00ce, 0x00ee, 0x0005, 0x00c6,
+	0x0126, 0x2091, 0x8000, 0x080c, 0xab15, 0x01d8, 0x080c, 0x54bf,
+	0x0110, 0x662e, 0x0008, 0x6616, 0x2b00, 0x6012, 0x080c, 0x54bf,
+	0x0118, 0x080c, 0xc94b, 0x0168, 0x080c, 0xcc93, 0x6023, 0x0003,
+	0x2009, 0x004b, 0x080c, 0xabe6, 0x9085, 0x0001, 0x012e, 0x00ce,
+	0x0005, 0x9006, 0x0cd8, 0x00c6, 0x0126, 0x2091, 0x8000, 0xbaa0,
+	0x080c, 0xabb9, 0x0590, 0x080c, 0x54bf, 0x0118, 0x602f, 0x0000,
+	0x0010, 0x6017, 0x0000, 0x2b00, 0x6012, 0x080c, 0xcc93, 0x6023,
+	0x0003, 0x0016, 0x080c, 0x901a, 0x0076, 0x903e, 0x080c, 0x8ef7,
+	0x2c08, 0x080c, 0xdfbd, 0x007e, 0x001e, 0xd184, 0x0128, 0x080c,
+	0xab6b, 0x9085, 0x0001, 0x0070, 0x080c, 0x54bf, 0x0128, 0xd18c,
+	0x1170, 0x080c, 0xc94b, 0x0148, 0x2009, 0x004c, 0x080c, 0xabe6,
+	0x9085, 0x0001, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x2900,
+	0x6016, 0x0c90, 0x2009, 0x004d, 0x0010, 0x2009, 0x004e, 0x00f6,
+	0x00c6, 0x0046, 0x0016, 0x080c, 0xab15, 0x2c78, 0x01d8, 0x080c,
+	0x54bf, 0x0110, 0x7e2e, 0x0008, 0x7e16, 0x2b00, 0x7812, 0x7823,
+	0x0003, 0x2021, 0x0005, 0x080c, 0xc95d, 0x2f60, 0x080c, 0x54bf,
+	0x0118, 0x080c, 0xc94b, 0x0130, 0x001e, 0x0016, 0x080c, 0xabe6,
+	0x9085, 0x0001, 0x001e, 0x004e, 0x00ce, 0x00fe, 0x0005, 0x00f6,
+	0x00c6, 0x0046, 0x080c, 0xab15, 0x2c78, 0x0530, 0x080c, 0x54bf,
+	0x0110, 0x7e2e, 0x0008, 0x7e16, 0x2b00, 0x7812, 0x7823, 0x0003,
+	0x0096, 0x2021, 0x0004, 0x0489, 0x009e, 0x2001, 0x197e, 0x200c,
+	0xd1fc, 0x0120, 0x2f60, 0x080c, 0xab6b, 0x0060, 0x2f60, 0x080c,
+	0x54bf, 0x0120, 0xd18c, 0x1160, 0x0071, 0x0130, 0x2009, 0x0052,
+	0x080c, 0xabe6, 0x9085, 0x0001, 0x004e, 0x00ce, 0x00fe, 0x0005,
+	0x2900, 0x7816, 0x0c98, 0x00c6, 0x080c, 0x489b, 0x00ce, 0x1120,
+	0x080c, 0xab6b, 0x9006, 0x0005, 0xa867, 0x0000, 0xa86b, 0x8000,
+	0x2900, 0x6016, 0x9085, 0x0001, 0x0005, 0x0096, 0x0076, 0x0126,
+	0x2091, 0x8000, 0x080c, 0x6501, 0x0158, 0x2001, 0xc962, 0x0006,
+	0x900e, 0x2400, 0x080c, 0x6c85, 0x080c, 0x6a46, 0x000e, 0x0807,
+	0x2418, 0x080c, 0x92b1, 0xbaa0, 0x0086, 0x2041, 0x0001, 0x2039,
+	0x0001, 0x2608, 0x080c, 0x9032, 0x008e, 0x080c, 0x8ef7, 0x2f08,
+	0x2648, 0x080c, 0xdfbd, 0xb93c, 0x81ff, 0x090c, 0x9103, 0x080c,
+	0x941c, 0x012e, 0x007e, 0x009e, 0x0005, 0x00c6, 0x0126, 0x2091,
+	0x8000, 0x080c, 0xab15, 0x0190, 0x660a, 0x2b08, 0x6112, 0x080c,
+	0xcc93, 0x6023, 0x0001, 0x2900, 0x6016, 0x2009, 0x001f, 0x080c,
+	0xabe6, 0x9085, 0x0001, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8,
+	0x00c6, 0x0126, 0x2091, 0x8000, 0x080c, 0xabb9, 0x01b8, 0x660a,
+	0x2b08, 0x6112, 0x080c, 0xcc93, 0x6023, 0x0008, 0x2900, 0x6016,
+	0x00f6, 0x2c78, 0x080c, 0x1689, 0x00fe, 0x2009, 0x0021, 0x080c,
+	0xabe6, 0x9085, 0x0001, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8,
+	0x2009, 0x003d, 0x00c6, 0x0126, 0x0016, 0x2091, 0x8000, 0x080c,
+	0xab15, 0x0198, 0x660a, 0x2b08, 0x6112, 0x080c, 0xcc93, 0x6023,
+	0x0001, 0x2900, 0x6016, 0x001e, 0x0016, 0x080c, 0xabe6, 0x9085,
+	0x0001, 0x001e, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd0, 0x00c6,
+	0x0126, 0x2091, 0x8000, 0x080c, 0xabb9, 0x0188, 0x2b08, 0x6112,
+	0x080c, 0xcc93, 0x6023, 0x0001, 0x2900, 0x6016, 0x2009, 0x0000,
+	0x080c, 0xabe6, 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, 0xc825, 0x0168, 0xa864,
+	0x9086, 0x0139, 0x0158, 0x6020, 0x9086, 0x0003, 0x0128, 0xa868,
+	0xd0fc, 0x0110, 0x9006, 0x0010, 0x9085, 0x0001, 0x009e, 0x000e,
+	0x0005, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c, 0xabb9, 0x0198,
+	0x2b08, 0x6112, 0x080c, 0xcc93, 0x6023, 0x0001, 0x2900, 0x6016,
+	0x080c, 0x306e, 0x2009, 0x0028, 0x080c, 0xabe6, 0x9085, 0x0001,
+	0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x9186, 0x0015, 0x11a8,
+	0x2011, 0x1824, 0x2204, 0x9086, 0x0074, 0x1178, 0x00b6, 0x080c,
+	0xb76f, 0x00be, 0x080c, 0xb992, 0x6003, 0x0001, 0x6007, 0x0029,
+	0x080c, 0x8ec7, 0x080c, 0x941c, 0x0078, 0x6014, 0x0096, 0x2048,
+	0xa868, 0x009e, 0xd0fc, 0x0148, 0x2001, 0x0001, 0x080c, 0xce51,
+	0x080c, 0xb51d, 0x080c, 0xab6b, 0x0005, 0x0096, 0x6014, 0x904d,
+	0x090c, 0x0dd5, 0xa87b, 0x0030, 0xa883, 0x0000, 0xa897, 0x4005,
+	0xa89b, 0x0004, 0xa867, 0x0139, 0x0126, 0x2091, 0x8000, 0x080c,
+	0x6a46, 0x012e, 0x009e, 0x080c, 0xab6b, 0x0c30, 0x0096, 0x9186,
+	0x0016, 0x1128, 0x2001, 0x0004, 0x080c, 0x631d, 0x00e8, 0x9186,
+	0x0015, 0x1510, 0x2011, 0x1824, 0x2204, 0x9086, 0x0014, 0x11e0,
+	0x6010, 0x00b6, 0x2058, 0x080c, 0x6468, 0x00be, 0x080c, 0xba63,
+	0x1198, 0x6010, 0x00b6, 0x2058, 0xb890, 0x00be, 0x9005, 0x0160,
+	0x2001, 0x0006, 0x080c, 0x631d, 0x6014, 0x2048, 0xa868, 0xd0fc,
+	0x0170, 0x080c, 0xaf6f, 0x0048, 0x6014, 0x2048, 0xa868, 0xd0fc,
+	0x0528, 0x080c, 0xb51d, 0x080c, 0xab6b, 0x009e, 0x0005, 0x6014,
+	0x6310, 0x2358, 0x904d, 0x090c, 0x0dd5, 0xa87b, 0x0000, 0xa883,
+	0x0000, 0xa897, 0x4000, 0x900e, 0x080c, 0x65ed, 0x1108, 0xc185,
+	0xb800, 0xd0bc, 0x0108, 0xc18d, 0xa99a, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x6a46, 0x012e, 0x080c, 0xab6b, 0x08f8, 0x6014, 0x904d,
+	0x090c, 0x0dd5, 0xa87b, 0x0030, 0xa883, 0x0000, 0xa897, 0x4005,
+	0xa89b, 0x0004, 0xa867, 0x0139, 0x0126, 0x2091, 0x8000, 0x080c,
+	0x6a46, 0x012e, 0x080c, 0xab6b, 0x0840, 0xa878, 0x9086, 0x0005,
+	0x1108, 0x0009, 0x0005, 0xa880, 0xc0ad, 0xa882, 0x0005, 0x6043,
+	0x0000, 0x6017, 0x0000, 0x6003, 0x0001, 0x6007, 0x0050, 0x080c,
+	0x8e7f, 0x080c, 0x941c, 0x0005, 0x00c6, 0x6010, 0x00b6, 0x2058,
+	0xb800, 0x00be, 0xd0bc, 0x0120, 0x6020, 0x9084, 0x000f, 0x0013,
+	0x00ce, 0x0005, 0xc55a, 0xcb43, 0xcb43, 0xcb46, 0xe2ca, 0xe2e5,
+	0xe2e8, 0xc55a, 0xc55a, 0xc55a, 0xc55a, 0xc55a, 0xc55a, 0xc55a,
+	0xc55a, 0x080c, 0x0dd5, 0xa001, 0xa001, 0x0005, 0x0096, 0x6014,
+	0x904d, 0x0118, 0xa87c, 0xd0e4, 0x1110, 0x009e, 0x0010, 0x009e,
+	0x0005, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x0550,
+	0x2001, 0x1834, 0x2004, 0x9005, 0x1540, 0x00f6, 0x2c78, 0x080c,
+	0xab15, 0x0508, 0x7810, 0x6012, 0x080c, 0xcc93, 0x7820, 0x9086,
+	0x0003, 0x0128, 0x7808, 0x603a, 0x2f00, 0x603e, 0x0020, 0x7808,
+	0x603e, 0x2f00, 0x603a, 0x602e, 0x6023, 0x0001, 0x6007, 0x0035,
+	0x6003, 0x0001, 0x7954, 0x6156, 0x080c, 0x8e7f, 0x080c, 0x941c,
+	0x2f60, 0x00fe, 0x0005, 0x2f60, 0x00fe, 0x2001, 0x1986, 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,
+	0x0fb2, 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,
+	0x8e7f, 0x080c, 0x941c, 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, 0x1980, 0x200c, 0x8000, 0x2014, 0x2001,
+	0x0032, 0x080c, 0x8cf7, 0x2001, 0x1984, 0x82ff, 0x1110, 0x2011,
+	0x0014, 0x2202, 0x2001, 0x1982, 0x200c, 0x8000, 0x2014, 0x2071,
+	0x196c, 0x711a, 0x721e, 0x2001, 0x0064, 0x080c, 0x8cf7, 0x2001,
+	0x1985, 0x82ff, 0x1110, 0x2011, 0x0014, 0x2202, 0x2001, 0x1986,
+	0x9288, 0x000a, 0x2102, 0x2001, 0x1a88, 0x2102, 0x2001, 0x0032,
+	0x080c, 0x15d1, 0x080c, 0x6718, 0x00ee, 0x003e, 0x002e, 0x001e,
+	0x000e, 0x0005, 0x0006, 0x0016, 0x00e6, 0x2001, 0x1984, 0x2003,
+	0x0028, 0x2001, 0x1985, 0x2003, 0x0014, 0x2071, 0x196c, 0x701b,
+	0x0000, 0x701f, 0x07d0, 0x2001, 0x1986, 0x2009, 0x001e, 0x2102,
+	0x2001, 0x1a88, 0x2102, 0x2001, 0x0032, 0x080c, 0x15d1, 0x00ee,
+	0x001e, 0x000e, 0x0005, 0x0096, 0x6058, 0x904d, 0x0110, 0x080c,
+	0x1032, 0x009e, 0x0005, 0x0005, 0x00c6, 0x0126, 0x2091, 0x8000,
+	0x080c, 0xab15, 0x0180, 0x2b08, 0x6112, 0x0ca9, 0x6023, 0x0001,
+	0x2900, 0x6016, 0x2009, 0x0033, 0x080c, 0xabe6, 0x9085, 0x0001,
+	0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x0096, 0x00e6, 0x00f6,
+	0x2071, 0x1800, 0x9186, 0x0015, 0x1500, 0x7090, 0x9086, 0x0018,
+	0x11e0, 0x6014, 0x2048, 0xaa3c, 0xd2e4, 0x1160, 0x2c78, 0x080c,
+	0x96af, 0x01d8, 0x707c, 0xaa50, 0x9206, 0x1160, 0x7080, 0xaa54,
+	0x9206, 0x1140, 0x6210, 0x00b6, 0x2258, 0xbaa0, 0x00be, 0x900e,
+	0x080c, 0x30b3, 0x080c, 0xaf6f, 0x0020, 0x080c, 0xb51d, 0x080c,
+	0xab6b, 0x00fe, 0x00ee, 0x009e, 0x0005, 0x7060, 0xaa54, 0x9206,
+	0x0d48, 0x0c80, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c, 0xab15,
+	0x0188, 0x2b08, 0x6112, 0x080c, 0xcc93, 0x6023, 0x0001, 0x2900,
+	0x6016, 0x2009, 0x004d, 0x080c, 0xabe6, 0x9085, 0x0001, 0x012e,
+	0x00ce, 0x0005, 0x9006, 0x0cd8, 0x00c6, 0x0126, 0x2091, 0x8000,
+	0x0016, 0x080c, 0xab15, 0x0180, 0x2b08, 0x6112, 0x080c, 0xcc93,
+	0x6023, 0x0001, 0x2900, 0x6016, 0x001e, 0x080c, 0xabe6, 0x9085,
+	0x0001, 0x012e, 0x00ce, 0x0005, 0x001e, 0x9006, 0x0cd0, 0x0016,
+	0x0026, 0x0036, 0x0046, 0x0056, 0x0066, 0x0096, 0x00e6, 0x00f6,
+	0x2071, 0x1800, 0x9186, 0x0015, 0x1568, 0x7190, 0x6014, 0x2048,
+	0xa814, 0x8003, 0x9106, 0x1530, 0x20e1, 0x0000, 0x2001, 0x199e,
+	0x2003, 0x0000, 0x6014, 0x2048, 0xa830, 0x20a8, 0x8906, 0x8006,
+	0x8007, 0x9094, 0x003f, 0x22e8, 0x9084, 0xffc0, 0x9080, 0x001b,
+	0x20a0, 0x2001, 0x199e, 0x0016, 0x200c, 0x080c, 0xd4f3, 0x001e,
+	0xa804, 0x9005, 0x0110, 0x2048, 0x0c38, 0x6014, 0x2048, 0xa867,
+	0x0103, 0x0010, 0x080c, 0xb51d, 0x080c, 0xab6b, 0x00fe, 0x00ee,
+	0x009e, 0x006e, 0x005e, 0x004e, 0x003e, 0x002e, 0x001e, 0x0005,
+	0x0096, 0x00e6, 0x00f6, 0x2071, 0x1800, 0x9186, 0x0015, 0x11b8,
+	0x7090, 0x9086, 0x0004, 0x1198, 0x6014, 0x2048, 0x2c78, 0x080c,
+	0x96af, 0x01a8, 0x707c, 0xaa74, 0x9206, 0x1130, 0x7080, 0xaa78,
+	0x9206, 0x1110, 0x080c, 0x306e, 0x080c, 0xaf6f, 0x0020, 0x080c,
+	0xb51d, 0x080c, 0xab6b, 0x00fe, 0x00ee, 0x009e, 0x0005, 0x7060,
+	0xaa78, 0x9206, 0x0d78, 0x0c80, 0x0096, 0x00e6, 0x00f6, 0x2071,
+	0x1800, 0x9186, 0x0015, 0x1550, 0x7090, 0x9086, 0x0004, 0x1530,
+	0x6014, 0x2048, 0x2c78, 0x080c, 0x96af, 0x05e8, 0x707c, 0xaacc,
+	0x9206, 0x1180, 0x7080, 0xaad0, 0x9206, 0x1160, 0x080c, 0x306e,
+	0x0016, 0xa998, 0xaab0, 0x9284, 0x1000, 0xc0fd, 0x080c, 0x546f,
+	0x001e, 0x0010, 0x080c, 0x5260, 0x080c, 0xc825, 0x0500, 0xa87b,
+	0x0000, 0xa883, 0x0000, 0xa897, 0x4000, 0x0078, 0x080c, 0x5260,
+	0x080c, 0xc825, 0x01a0, 0x6014, 0x2048, 0xa87b, 0x0030, 0xa883,
+	0x0000, 0xa897, 0x4005, 0xa89b, 0x0004, 0x0126, 0x2091, 0x8000,
+	0xa867, 0x0139, 0x080c, 0x6a46, 0x012e, 0x080c, 0xab6b, 0x00fe,
+	0x00ee, 0x009e, 0x0005, 0x7060, 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, 0xc825, 0x0904, 0xce4d, 0x0096, 0x6314,
+	0x2348, 0xa87a, 0xa982, 0x929e, 0x4000, 0x1580, 0x6310, 0x00c6,
+	0x2358, 0x2009, 0x0000, 0xa868, 0xd0f4, 0x1140, 0x080c, 0x65ed,
+	0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d, 0xaa96, 0xa99a,
+	0x20a9, 0x0004, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0031, 0x20a0,
+	0xb8c4, 0x20e0, 0xb8c8, 0x9080, 0x0006, 0x2098, 0x080c, 0x0f7d,
+	0x20a9, 0x0004, 0xa85c, 0x9080, 0x0035, 0x20a0, 0xb8c8, 0x9080,
+	0x000a, 0x2098, 0x080c, 0x0f7d, 0x00ce, 0x0090, 0xaa96, 0x3918,
+	0x9398, 0x0007, 0x231c, 0x6004, 0x9086, 0x0016, 0x0110, 0xa89b,
+	0x0004, 0xaba2, 0x6310, 0x2358, 0xb804, 0x9084, 0x00ff, 0xa89e,
+	0x080c, 0x6a3a, 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, 0x26f0, 0x2118, 0x831f,
+	0x939c, 0xff00, 0x7838, 0x9084, 0x00ff, 0x931d, 0x7c3c, 0x2011,
+	0x8018, 0x080c, 0x48fb, 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, 0xc813, 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,
+	0xbf4f, 0x0005, 0x0036, 0x2019, 0x0001, 0x0010, 0x0036, 0x901e,
+	0x0499, 0x01e0, 0x080c, 0xc825, 0x01c8, 0x080c, 0xca07, 0x6037,
+	0x4000, 0x6014, 0x6017, 0x0000, 0x0096, 0x2048, 0xa87c, 0x080c,
+	0xca24, 0x1118, 0x080c, 0xb51d, 0x0040, 0xa867, 0x0103, 0xa877,
+	0x0000, 0x83ff, 0x1129, 0x080c, 0x6a46, 0x009e, 0x003e, 0x0005,
+	0xa880, 0xd0b4, 0x0128, 0xa87b, 0x0006, 0xc0ec, 0xa882, 0x0048,
+	0xd0bc, 0x0118, 0xa87b, 0x0002, 0x0020, 0xa87b, 0x0005, 0x080c,
+	0xcb13, 0xa877, 0x0000, 0x0005, 0x2001, 0x1810, 0x2004, 0xd0ec,
+	0x0005, 0x0006, 0x2001, 0x1810, 0x2004, 0xd0f4, 0x000e, 0x0005,
+	0x0006, 0x2001, 0x1810, 0x2004, 0xd0e4, 0x000e, 0x0005, 0x0036,
+	0x0046, 0x6010, 0x00b6, 0x2058, 0xbba0, 0x00be, 0x2021, 0x0007,
+	0x080c, 0x4ab2, 0x004e, 0x003e, 0x0005, 0x0c51, 0x1d81, 0x0005,
+	0x2001, 0x1984, 0x2004, 0x601a, 0x0005, 0x2001, 0x1986, 0x2004,
+	0x6042, 0x0005, 0x080c, 0xab6b, 0x0804, 0x941c, 0x00b6, 0x0066,
+	0x6000, 0x90b2, 0x0016, 0x1a0c, 0x0dd5, 0x001b, 0x006e, 0x00be,
+	0x0005, 0xcf59, 0xd650, 0xd7ad, 0xcf59, 0xcf59, 0xcf59, 0xcf59,
+	0xcf59, 0xcf90, 0xd82b, 0xcf59, 0xcf59, 0xcf59, 0xcf59, 0xcf59,
+	0xcf59, 0x080c, 0x0dd5, 0x0066, 0x6000, 0x90b2, 0x0016, 0x1a0c,
+	0x0dd5, 0x0013, 0x006e, 0x0005, 0xcf74, 0xdd93, 0xcf74, 0xcf74,
+	0xcf74, 0xcf74, 0xcf74, 0xcf74, 0xdd40, 0xdde7, 0xcf74, 0xe405,
+	0xe43b, 0xe405, 0xe43b, 0xcf74, 0x080c, 0x0dd5, 0x6000, 0x9082,
+	0x0016, 0x1a0c, 0x0dd5, 0x6000, 0x000a, 0x0005, 0xcf8e, 0xda08,
+	0xdaf8, 0xdb1a, 0xdbd9, 0xcf8e, 0xdcb7, 0xdc61, 0xd837, 0xdd16,
+	0xdd2b, 0xcf8e, 0xcf8e, 0xcf8e, 0xcf8e, 0xcf8e, 0x080c, 0x0dd5,
+	0x91b2, 0x0053, 0x1a0c, 0x0dd5, 0x2100, 0x91b2, 0x0040, 0x1a04,
+	0xd3c6, 0x0002, 0xcfda, 0xd1b7, 0xcfda, 0xcfda, 0xcfda, 0xd1c0,
+	0xcfda, 0xcfda, 0xcfda, 0xcfda, 0xcfda, 0xcfda, 0xcfda, 0xcfda,
+	0xcfda, 0xcfda, 0xcfda, 0xcfda, 0xcfda, 0xcfda, 0xcfda, 0xcfda,
+	0xcfda, 0xcfdc, 0xd032, 0xd041, 0xd0a5, 0xd0d0, 0xd149, 0xd1a2,
+	0xcfda, 0xcfda, 0xd1c3, 0xcfda, 0xcfda, 0xd1d8, 0xd1e5, 0xcfda,
+	0xcfda, 0xcfda, 0xcfda, 0xcfda, 0xd268, 0xcfda, 0xcfda, 0xd27c,
+	0xcfda, 0xcfda, 0xd237, 0xcfda, 0xcfda, 0xcfda, 0xd294, 0xcfda,
+	0xcfda, 0xcfda, 0xd311, 0xcfda, 0xcfda, 0xcfda, 0xcfda, 0xcfda,
+	0xcfda, 0xd38e, 0x080c, 0x0dd5, 0x080c, 0x66f5, 0x1150, 0x2001,
+	0x1837, 0x2004, 0xd0cc, 0x1128, 0x9084, 0x0009, 0x9086, 0x0008,
+	0x1140, 0x6007, 0x0009, 0x602f, 0x0009, 0x6017, 0x0000, 0x0804,
+	0xd1b0, 0x080c, 0x669a, 0x00e6, 0x00c6, 0x0036, 0x0026, 0x0016,
+	0x6210, 0x2258, 0xbaa0, 0x0026, 0x2019, 0x0029, 0x080c, 0x901a,
+	0x0076, 0x903e, 0x080c, 0x8ef7, 0x2c08, 0x080c, 0xdfbd, 0x007e,
+	0x001e, 0x001e, 0x002e, 0x003e, 0x00ce, 0x00ee, 0x6610, 0x2658,
+	0x080c, 0x63dc, 0xbe04, 0x9684, 0x00ff, 0x9082, 0x0006, 0x0278,
+	0x080c, 0xdeef, 0x1904, 0xd09d, 0x080c, 0xde8b, 0x1120, 0x6007,
+	0x0008, 0x0804, 0xd1b0, 0x6007, 0x0009, 0x0804, 0xd1b0, 0x080c,
+	0xe113, 0x0128, 0x080c, 0xdeef, 0x0d78, 0x0804, 0xd09d, 0x6017,
+	0x1900, 0x0c88, 0x080c, 0x318e, 0x1904, 0xd3c3, 0x6106, 0x080c,
+	0xde42, 0x6007, 0x0006, 0x0804, 0xd1b0, 0x6007, 0x0007, 0x0804,
+	0xd1b0, 0x080c, 0xe477, 0x1904, 0xd3c3, 0x080c, 0x318e, 0x1904,
+	0xd3c3, 0x00d6, 0x6610, 0x2658, 0xbe04, 0x9684, 0x00ff, 0x9082,
+	0x0006, 0x1220, 0x2001, 0x0001, 0x080c, 0x6309, 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, 0xdf53, 0x1190, 0x9686, 0x0006,
+	0x1140, 0x0026, 0x6210, 0x2258, 0xbaa0, 0x900e, 0x080c, 0x30b3,
+	0x002e, 0x080c, 0x6468, 0x6007, 0x000a, 0x00de, 0x0804, 0xd1b0,
+	0x6007, 0x000b, 0x00de, 0x0804, 0xd1b0, 0x080c, 0x306e, 0x080c,
+	0xcf2d, 0x6007, 0x0001, 0x0804, 0xd1b0, 0x080c, 0xe477, 0x1904,
+	0xd3c3, 0x080c, 0x318e, 0x1904, 0xd3c3, 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, 0x30b3, 0x002e,
+	0x6007, 0x000c, 0x2001, 0x0001, 0x080c, 0xe644, 0x0804, 0xd1b0,
+	0x080c, 0x66f5, 0x1140, 0x2001, 0x1837, 0x2004, 0x9084, 0x0009,
+	0x9086, 0x0008, 0x1110, 0x0804, 0xcfe9, 0x080c, 0x669a, 0x6610,
+	0x2658, 0xbe04, 0x9684, 0x00ff, 0x9082, 0x0006, 0x06c8, 0x1138,
+	0x0026, 0x2001, 0x0006, 0x080c, 0x6349, 0x002e, 0x0050, 0x96b4,
+	0xff00, 0x8637, 0x9686, 0x0004, 0x0120, 0x9686, 0x0006, 0x1904,
+	0xd09d, 0x080c, 0xdf60, 0x1120, 0x6007, 0x000e, 0x0804, 0xd1b0,
+	0x0046, 0x6410, 0x2458, 0xbca0, 0x0046, 0x080c, 0x306e, 0x080c,
+	0xcf2d, 0x004e, 0x0016, 0x9006, 0x2009, 0x1848, 0x210c, 0xd1a4,
+	0x0148, 0x2009, 0x0029, 0x080c, 0xe280, 0x6010, 0x2058, 0xb800,
+	0xc0e5, 0xb802, 0x001e, 0x004e, 0x6007, 0x0001, 0x0804, 0xd1b0,
+	0x2001, 0x0001, 0x080c, 0x6309, 0x0156, 0x0016, 0x0026, 0x0036,
+	0x20a9, 0x0004, 0x2019, 0x1805, 0x2011, 0x0270, 0x080c, 0xbb13,
+	0x003e, 0x002e, 0x001e, 0x015e, 0x9005, 0x0168, 0x96b4, 0xff00,
+	0x8637, 0x9682, 0x0004, 0x0a04, 0xd09d, 0x9682, 0x0007, 0x0a04,
+	0xd0f9, 0x0804, 0xd09d, 0x6017, 0x1900, 0x6007, 0x0009, 0x0804,
+	0xd1b0, 0x080c, 0x66f5, 0x1140, 0x2001, 0x1837, 0x2004, 0x9084,
+	0x0009, 0x9086, 0x0008, 0x1110, 0x0804, 0xcfe9, 0x080c, 0x669a,
+	0x6610, 0x2658, 0xbe04, 0x9684, 0x00ff, 0x9082, 0x0006, 0x0690,
+	0x96b4, 0xff00, 0x8637, 0x9686, 0x0004, 0x0120, 0x9686, 0x0006,
+	0x1904, 0xd09d, 0x080c, 0xdf8e, 0x1130, 0x080c, 0xde8b, 0x1118,
+	0x6007, 0x0010, 0x04e8, 0x0046, 0x6410, 0x2458, 0xbca0, 0x0046,
+	0x080c, 0x306e, 0x080c, 0xcf2d, 0x004e, 0x0016, 0x9006, 0x2009,
+	0x1848, 0x210c, 0xd1a4, 0x0148, 0x2009, 0x0029, 0x080c, 0xe280,
+	0x6010, 0x2058, 0xb800, 0xc0e5, 0xb802, 0x001e, 0x004e, 0x6007,
+	0x0001, 0x00f0, 0x080c, 0xe113, 0x0140, 0x96b4, 0xff00, 0x8637,
+	0x9686, 0x0006, 0x0978, 0x0804, 0xd09d, 0x6017, 0x1900, 0x6007,
+	0x0009, 0x0070, 0x080c, 0x318e, 0x1904, 0xd3c3, 0x080c, 0xe477,
+	0x1904, 0xd3c3, 0x080c, 0xd58e, 0x1904, 0xd09d, 0x6007, 0x0012,
+	0x6003, 0x0001, 0x080c, 0x8ec7, 0x080c, 0x941c, 0x0005, 0x6007,
+	0x0001, 0x6003, 0x0001, 0x080c, 0x8ec7, 0x080c, 0x941c, 0x0cb0,
+	0x6007, 0x0005, 0x0c68, 0x080c, 0xe477, 0x1904, 0xd3c3, 0x080c,
+	0x318e, 0x1904, 0xd3c3, 0x080c, 0xd58e, 0x1904, 0xd09d, 0x6007,
+	0x0020, 0x6003, 0x0001, 0x080c, 0x8ec7, 0x080c, 0x941c, 0x0005,
+	0x080c, 0x318e, 0x1904, 0xd3c3, 0x6007, 0x0023, 0x6003, 0x0001,
+	0x080c, 0x8ec7, 0x080c, 0x941c, 0x0005, 0x080c, 0xe477, 0x1904,
+	0xd3c3, 0x080c, 0x318e, 0x1904, 0xd3c3, 0x080c, 0xd58e, 0x1904,
+	0xd09d, 0x0016, 0x0026, 0x00e6, 0x2071, 0x0260, 0x7244, 0x9286,
+	0xffff, 0x0180, 0x2c08, 0x080c, 0xc813, 0x01b0, 0x2260, 0x7240,
+	0x6008, 0x9206, 0x1188, 0x6010, 0x9190, 0x0004, 0x2214, 0x9206,
+	0x01b8, 0x0050, 0x7240, 0x2c08, 0x9006, 0x080c, 0xe24a, 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, 0xab6b, 0x2160, 0x6007, 0x0025, 0x6003, 0x0001, 0x080c,
+	0x8ec7, 0x080c, 0x941c, 0x00ee, 0x002e, 0x001e, 0x0005, 0x2001,
+	0x0001, 0x080c, 0x6309, 0x0156, 0x0016, 0x0026, 0x0036, 0x20a9,
+	0x0004, 0x2019, 0x1805, 0x2011, 0x0276, 0x080c, 0xbb13, 0x003e,
+	0x002e, 0x001e, 0x015e, 0x0120, 0x6007, 0x0031, 0x0804, 0xd1b0,
+	0x080c, 0xb787, 0x080c, 0x717d, 0x1190, 0x0006, 0x0026, 0x0036,
+	0x080c, 0x7197, 0x1138, 0x080c, 0x7465, 0x080c, 0x5df8, 0x080c,
+	0x70af, 0x0010, 0x080c, 0x7155, 0x003e, 0x002e, 0x000e, 0x0005,
+	0x080c, 0x318e, 0x1904, 0xd3c3, 0x080c, 0xd58e, 0x1904, 0xd09d,
+	0x6106, 0x080c, 0xd5aa, 0x1120, 0x6007, 0x002b, 0x0804, 0xd1b0,
+	0x6007, 0x002c, 0x0804, 0xd1b0, 0x080c, 0xe477, 0x1904, 0xd3c3,
+	0x080c, 0x318e, 0x1904, 0xd3c3, 0x080c, 0xd58e, 0x1904, 0xd09d,
+	0x6106, 0x080c, 0xd5af, 0x1120, 0x6007, 0x002e, 0x0804, 0xd1b0,
+	0x6007, 0x002f, 0x0804, 0xd1b0, 0x080c, 0x318e, 0x1904, 0xd3c3,
+	0x00e6, 0x00d6, 0x00c6, 0x6010, 0x2058, 0xb904, 0x9184, 0x00ff,
+	0x9086, 0x0006, 0x0158, 0x9184, 0xff00, 0x8007, 0x9086, 0x0006,
+	0x0128, 0x00ce, 0x00de, 0x00ee, 0x0804, 0xd1b7, 0x080c, 0x54bb,
+	0xd0e4, 0x0904, 0xd30e, 0x2071, 0x026c, 0x7010, 0x603a, 0x7014,
+	0x603e, 0x7108, 0x720c, 0x080c, 0x6733, 0x0140, 0x6010, 0x2058,
+	0xb810, 0x9106, 0x1118, 0xb814, 0x9206, 0x0510, 0x080c, 0x672f,
+	0x15b8, 0x2069, 0x1800, 0x6880, 0x9206, 0x1590, 0x687c, 0x9106,
+	0x1578, 0x7210, 0x080c, 0xc813, 0x0590, 0x080c, 0xd47b, 0x0578,
+	0x080c, 0xe2f7, 0x0560, 0x622e, 0x6007, 0x0036, 0x6003, 0x0001,
+	0x080c, 0x8e7f, 0x080c, 0x941c, 0x00ce, 0x00de, 0x00ee, 0x0005,
+	0x7214, 0x9286, 0xffff, 0x0150, 0x080c, 0xc813, 0x01c0, 0x9280,
+	0x0002, 0x2004, 0x7110, 0x9106, 0x1190, 0x08e0, 0x7210, 0x2c08,
+	0x9085, 0x0001, 0x080c, 0xe24a, 0x2c10, 0x2160, 0x0140, 0x0890,
+	0x6007, 0x0037, 0x602f, 0x0009, 0x6017, 0x1500, 0x08b8, 0x6007,
+	0x0037, 0x602f, 0x0003, 0x6017, 0x1700, 0x0880, 0x6007, 0x0012,
+	0x0868, 0x080c, 0x318e, 0x1904, 0xd3c3, 0x6010, 0x2058, 0xb804,
+	0x9084, 0xff00, 0x8007, 0x9086, 0x0006, 0x1904, 0xd1b7, 0x00e6,
+	0x00d6, 0x00c6, 0x080c, 0x54bb, 0xd0e4, 0x0904, 0xd386, 0x2069,
+	0x1800, 0x2071, 0x026c, 0x7008, 0x603a, 0x720c, 0x623e, 0x9286,
+	0xffff, 0x1150, 0x7208, 0x00c6, 0x2c08, 0x9085, 0x0001, 0x080c,
+	0xe24a, 0x2c10, 0x00ce, 0x05e8, 0x080c, 0xc813, 0x05d0, 0x7108,
+	0x9280, 0x0002, 0x2004, 0x9106, 0x15a0, 0x00c6, 0x0026, 0x2260,
+	0x080c, 0xc465, 0x002e, 0x00ce, 0x7118, 0x918c, 0xff00, 0x810f,
+	0x9186, 0x0001, 0x0178, 0x9186, 0x0005, 0x0118, 0x9186, 0x0007,
+	0x1198, 0x9280, 0x0005, 0x2004, 0x9005, 0x0170, 0x080c, 0xd47b,
+	0x0904, 0xd307, 0x0056, 0x7510, 0x7614, 0x080c, 0xe310, 0x005e,
+	0x00ce, 0x00de, 0x00ee, 0x0005, 0x6007, 0x003b, 0x602f, 0x0009,
+	0x6017, 0x2a00, 0x6003, 0x0001, 0x080c, 0x8e7f, 0x080c, 0x941c,
+	0x0c78, 0x6007, 0x003b, 0x602f, 0x0003, 0x6017, 0x0300, 0x6003,
+	0x0001, 0x080c, 0x8e7f, 0x080c, 0x941c, 0x0c10, 0x6007, 0x003b,
+	0x602f, 0x000b, 0x6017, 0x0000, 0x0804, 0xd2de, 0x00e6, 0x0026,
+	0x080c, 0x66f5, 0x0550, 0x080c, 0x669a, 0x080c, 0xe4e9, 0x1518,
+	0x2071, 0x1800, 0x70dc, 0x9085, 0x0003, 0x70de, 0x00f6, 0x2079,
+	0x0100, 0x72b0, 0x9284, 0x00ff, 0x707e, 0x78e6, 0x9284, 0xff00,
+	0x7280, 0x9205, 0x7082, 0x78ea, 0x00fe, 0x70e7, 0x0000, 0x080c,
+	0x6733, 0x0120, 0x2011, 0x19fe, 0x2013, 0x07d0, 0xd0ac, 0x1128,
+	0x080c, 0x2e48, 0x0010, 0x080c, 0xe51b, 0x002e, 0x00ee, 0x080c,
+	0xab6b, 0x0804, 0xd1b6, 0x080c, 0xab6b, 0x0005, 0x2600, 0x0002,
+	0xd3da, 0xd40b, 0xd41c, 0xd3da, 0xd3da, 0xd3dc, 0xd42d, 0xd3da,
+	0xd3da, 0xd3da, 0xd3f9, 0xd3da, 0xd3da, 0xd3da, 0xd438, 0xd445,
+	0xd476, 0xd3da, 0x080c, 0x0dd5, 0x080c, 0xe477, 0x1d20, 0x080c,
+	0x318e, 0x1d08, 0x080c, 0xd58e, 0x1148, 0x7038, 0x6016, 0x6007,
+	0x0045, 0x6003, 0x0001, 0x080c, 0x8ec7, 0x0005, 0x080c, 0x306e,
+	0x080c, 0xcf2d, 0x6007, 0x0001, 0x6003, 0x0001, 0x080c, 0x8ec7,
+	0x0005, 0x080c, 0xe477, 0x1938, 0x080c, 0x318e, 0x1920, 0x080c,
+	0xd58e, 0x1d60, 0x703c, 0x6016, 0x6007, 0x004a, 0x6003, 0x0001,
+	0x080c, 0x8ec7, 0x0005, 0x080c, 0x318e, 0x1904, 0xd3c3, 0x2009,
+	0x0041, 0x080c, 0xe524, 0x6007, 0x0047, 0x6003, 0x0001, 0x080c,
+	0x8ec7, 0x080c, 0x941c, 0x0005, 0x080c, 0x318e, 0x1904, 0xd3c3,
+	0x2009, 0x0042, 0x080c, 0xe524, 0x6007, 0x0047, 0x6003, 0x0001,
+	0x080c, 0x8ec7, 0x080c, 0x941c, 0x0005, 0x080c, 0x318e, 0x1904,
+	0xd3c3, 0x2009, 0x0046, 0x080c, 0xe524, 0x080c, 0xab6b, 0x0005,
+	0x080c, 0xd496, 0x0904, 0xd3c3, 0x6007, 0x004e, 0x6003, 0x0001,
+	0x080c, 0x8ec7, 0x080c, 0x941c, 0x0005, 0x6007, 0x004f, 0x6017,
+	0x0000, 0x7134, 0x918c, 0x00ff, 0x81ff, 0x0508, 0x9186, 0x0001,
+	0x1160, 0x7140, 0x2001, 0x19bb, 0x2004, 0x9106, 0x11b0, 0x7144,
+	0x2001, 0x19bc, 0x2004, 0x9106, 0x0190, 0x9186, 0x0002, 0x1168,
+	0x2011, 0x0276, 0x20a9, 0x0004, 0x6010, 0x0096, 0x2048, 0x2019,
+	0x000a, 0x080c, 0xbb27, 0x009e, 0x0110, 0x6017, 0x0001, 0x6003,
+	0x0001, 0x080c, 0x8ec7, 0x080c, 0x941c, 0x0005, 0x6007, 0x0050,
+	0x703c, 0x6016, 0x0ca0, 0x00e6, 0x2071, 0x0260, 0x00b6, 0x00c6,
+	0x2260, 0x6010, 0x2058, 0xb8cc, 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, 0x7090, 0x908a, 0x00f9, 0x16e8, 0x20e1, 0x0000, 0x2001,
+	0x199e, 0x2003, 0x0000, 0x080c, 0x1019, 0x05a0, 0x2900, 0x6016,
+	0x7090, 0x8004, 0xa816, 0x908a, 0x001e, 0x02d0, 0xa833, 0x001e,
+	0x20a9, 0x001e, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x001b, 0x20a0,
+	0x2001, 0x199e, 0x0016, 0x200c, 0x0471, 0x001e, 0x2940, 0x080c,
+	0x1019, 0x01c0, 0x2900, 0xa006, 0x2100, 0x81ff, 0x0180, 0x0c18,
+	0xa832, 0x20a8, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x001b, 0x20a0,
+	0x2001, 0x199e, 0x0016, 0x200c, 0x00b1, 0x001e, 0x0000, 0x9085,
+	0x0001, 0x0048, 0x2071, 0x1800, 0x7093, 0x0000, 0x6014, 0x2048,
+	0x080c, 0x0fb2, 0x9006, 0x012e, 0x01de, 0x01ce, 0x00ee, 0x008e,
+	0x009e, 0x001e, 0x0005, 0x0006, 0x0016, 0x0026, 0x0036, 0x00c6,
+	0x918c, 0xffff, 0x11a8, 0x080c, 0x225d, 0x2099, 0x026c, 0x2001,
+	0x0014, 0x3518, 0x9312, 0x1218, 0x23a8, 0x4003, 0x00f8, 0x20a8,
+	0x4003, 0x22a8, 0x8108, 0x080c, 0x225d, 0x2099, 0x0260, 0x0ca8,
+	0x080c, 0x225d, 0x2061, 0x199e, 0x6004, 0x2098, 0x6008, 0x3518,
+	0x9312, 0x1218, 0x23a8, 0x4003, 0x0048, 0x20a8, 0x4003, 0x22a8,
+	0x8108, 0x080c, 0x225d, 0x2099, 0x0260, 0x0ca8, 0x2061, 0x199e,
+	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, 0x2275,
+	0x20a1, 0x024c, 0x2001, 0x0014, 0x3518, 0x9312, 0x1218, 0x23a8,
+	0x4003, 0x0418, 0x20a8, 0x4003, 0x82ff, 0x01f8, 0x22a8, 0x8108,
+	0x080c, 0x2275, 0x20a1, 0x0240, 0x0c98, 0x080c, 0x2275, 0x2061,
+	0x19a1, 0x6004, 0x20a0, 0x6008, 0x3518, 0x9312, 0x1218, 0x23a8,
+	0x4003, 0x0058, 0x20a8, 0x4003, 0x82ff, 0x0138, 0x22a8, 0x8108,
+	0x080c, 0x2275, 0x20a1, 0x0240, 0x0c98, 0x2061, 0x19a1, 0x2019,
+	0x0260, 0x3400, 0x931e, 0x0110, 0x6006, 0x0020, 0x2001, 0x0240,
 	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,
+	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, 0xd626, 0x00de, 0x0005, 0x00d6,
+	0x080c, 0xd633, 0x1520, 0x680c, 0x908c, 0xff00, 0x6820, 0x9084,
+	0x00ff, 0x9115, 0x6216, 0x6824, 0x602e, 0xd1e4, 0x0130, 0x9006,
+	0x080c, 0xe644, 0x2009, 0x0001, 0x0078, 0xd1ec, 0x0180, 0x6920,
+	0x918c, 0x00ff, 0x6824, 0x080c, 0x26f0, 0x1148, 0x2001, 0x0001,
+	0x080c, 0xe644, 0x2110, 0x900e, 0x080c, 0x30b3, 0x0018, 0x9085,
+	0x0001, 0x0008, 0x9006, 0x00de, 0x0005, 0x00b6, 0x00c6, 0x080c,
+	0xabb9, 0x05a8, 0x0016, 0x0026, 0x00c6, 0x2011, 0x0263, 0x2204,
+	0x8211, 0x220c, 0x080c, 0x26f0, 0x1578, 0x080c, 0x636c, 0x1560,
+	0xbe12, 0xbd16, 0x00ce, 0x002e, 0x001e, 0x2b00, 0x6012, 0x080c,
+	0xe477, 0x11d8, 0x080c, 0x318e, 0x11c0, 0x080c, 0xd58e, 0x0510,
+	0x2001, 0x0007, 0x080c, 0x631d, 0x2001, 0x0007, 0x080c, 0x6349,
+	0x6017, 0x0000, 0x6023, 0x0001, 0x6007, 0x0001, 0x6003, 0x0001,
+	0x080c, 0x8ec7, 0x080c, 0x941c, 0x0010, 0x080c, 0xab6b, 0x9085,
+	0x0001, 0x00ce, 0x00be, 0x0005, 0x080c, 0xab6b, 0x00ce, 0x002e,
+	0x001e, 0x0ca8, 0x080c, 0xab6b, 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, 0x0dd5, 0x91b6, 0x0013, 0x1130,
+	0x2008, 0x91b2, 0x0040, 0x1a04, 0xd77d, 0x0092, 0x91b6, 0x0027,
+	0x0120, 0x91b6, 0x0014, 0x190c, 0x0dd5, 0x2001, 0x0007, 0x080c,
+	0x6349, 0x080c, 0x9317, 0x080c, 0xab9c, 0x080c, 0x941c, 0x0005,
+	0xd6b0, 0xd6b2, 0xd6b0, 0xd6b0, 0xd6b0, 0xd6b2, 0xd6c1, 0xd776,
+	0xd713, 0xd776, 0xd727, 0xd776, 0xd6c1, 0xd776, 0xd76e, 0xd776,
+	0xd76e, 0xd776, 0xd776, 0xd6b0, 0xd6b0, 0xd6b0, 0xd6b0, 0xd6b0,
+	0xd6b0, 0xd6b0, 0xd6b0, 0xd6b0, 0xd6b0, 0xd6b0, 0xd6b2, 0xd6b0,
+	0xd776, 0xd6b0, 0xd6b0, 0xd776, 0xd6b0, 0xd773, 0xd776, 0xd6b0,
+	0xd6b0, 0xd6b0, 0xd6b0, 0xd776, 0xd776, 0xd6b0, 0xd776, 0xd776,
+	0xd6b0, 0xd6bc, 0xd6b0, 0xd6b0, 0xd6b0, 0xd6b0, 0xd772, 0xd776,
+	0xd6b0, 0xd6b0, 0xd776, 0xd776, 0xd6b0, 0xd6b0, 0xd6b0, 0xd6b0,
+	0x080c, 0x0dd5, 0x080c, 0x9317, 0x080c, 0xcf30, 0x6003, 0x0002,
+	0x080c, 0x941c, 0x0804, 0xd77c, 0x9006, 0x080c, 0x6309, 0x0804,
+	0xd776, 0x080c, 0x672f, 0x1904, 0xd776, 0x9006, 0x080c, 0x6309,
+	0x6010, 0x2058, 0xb810, 0x9086, 0x00ff, 0x1140, 0x00f6, 0x2079,
+	0x1800, 0x78a8, 0x8000, 0x78aa, 0x00fe, 0x0428, 0x6010, 0x2058,
+	0xb8c0, 0x9005, 0x1178, 0x080c, 0xcf18, 0x1904, 0xd776, 0x0036,
+	0x0046, 0xbba0, 0x2021, 0x0007, 0x080c, 0x4ab2, 0x004e, 0x003e,
+	0x0804, 0xd776, 0x080c, 0x31bf, 0x1904, 0xd776, 0x2001, 0x1800,
+	0x2004, 0x9086, 0x0002, 0x1138, 0x00f6, 0x2079, 0x1800, 0x78a8,
+	0x8000, 0x78aa, 0x00fe, 0x2001, 0x0002, 0x080c, 0x631d, 0x080c,
+	0x9317, 0x6023, 0x0001, 0x6003, 0x0001, 0x6007, 0x0002, 0x080c,
+	0x8ec7, 0x080c, 0x941c, 0x6110, 0x2158, 0x2009, 0x0001, 0x080c,
+	0x8293, 0x0804, 0xd77c, 0x6610, 0x2658, 0xbe04, 0x96b4, 0xff00,
+	0x8637, 0x9686, 0x0006, 0x0904, 0xd776, 0x9686, 0x0004, 0x0904,
+	0xd776, 0x080c, 0x8a4a, 0x2001, 0x0004, 0x0804, 0xd774, 0x2001,
+	0x1800, 0x2004, 0x9086, 0x0003, 0x1158, 0x0036, 0x0046, 0x6010,
+	0x2058, 0xbba0, 0x2021, 0x0006, 0x080c, 0x4ab2, 0x004e, 0x003e,
+	0x2001, 0x0006, 0x080c, 0xd79a, 0x6610, 0x2658, 0xbe04, 0x0066,
+	0x96b4, 0xff00, 0x8637, 0x9686, 0x0006, 0x006e, 0x0168, 0x2001,
+	0x0006, 0x080c, 0x6349, 0x9284, 0x00ff, 0x908e, 0x0007, 0x1120,
+	0x2001, 0x0006, 0x080c, 0x631d, 0x080c, 0x672f, 0x11f8, 0x2001,
+	0x1837, 0x2004, 0xd0a4, 0x01d0, 0xbe04, 0x96b4, 0x00ff, 0x9686,
+	0x0006, 0x01a0, 0x00f6, 0x2079, 0x1800, 0x78a8, 0x8000, 0x78aa,
+	0x00fe, 0x0804, 0xd6fb, 0x2001, 0x0004, 0x0030, 0x2001, 0x0006,
+	0x0449, 0x0020, 0x0018, 0x0010, 0x080c, 0x6349, 0x080c, 0x9317,
+	0x080c, 0xab6b, 0x080c, 0x941c, 0x0005, 0x2600, 0x0002, 0xd791,
+	0xd791, 0xd791, 0xd791, 0xd791, 0xd793, 0xd791, 0xd793, 0xd791,
+	0xd791, 0xd793, 0xd791, 0xd791, 0xd791, 0xd793, 0xd793, 0xd793,
+	0xd793, 0x080c, 0x0dd5, 0x080c, 0x9317, 0x080c, 0xab6b, 0x080c,
+	0x941c, 0x0005, 0x0016, 0x00b6, 0x00d6, 0x6110, 0x2158, 0xb900,
+	0xd184, 0x0138, 0x080c, 0x631d, 0x9006, 0x080c, 0x6309, 0x080c,
+	0x3093, 0x00de, 0x00be, 0x001e, 0x0005, 0x6610, 0x2658, 0xb804,
+	0x9084, 0xff00, 0x8007, 0x90b2, 0x000c, 0x1a0c, 0x0dd5, 0x91b6,
+	0x0015, 0x1110, 0x003b, 0x0028, 0x91b6, 0x0016, 0x190c, 0x0dd5,
+	0x006b, 0x0005, 0xb606, 0xb606, 0xb606, 0xb606, 0xb606, 0xb606,
+	0xd815, 0xd7da, 0xb606, 0xb606, 0xb606, 0xb606, 0xb606, 0xb606,
+	0xb606, 0xb606, 0xb606, 0xb606, 0xd815, 0xd81c, 0xb606, 0xb606,
+	0xb606, 0xb606, 0x00f6, 0x080c, 0x672f, 0x11d8, 0x080c, 0xcf18,
+	0x11c0, 0x6010, 0x905d, 0x01a8, 0xb8c0, 0x9005, 0x0190, 0x9006,
+	0x080c, 0x6309, 0x2001, 0x0002, 0x080c, 0x631d, 0x6023, 0x0001,
+	0x6003, 0x0001, 0x6007, 0x0002, 0x080c, 0x8ec7, 0x080c, 0x941c,
+	0x00d0, 0x2011, 0x0263, 0x2204, 0x8211, 0x220c, 0x080c, 0x26f0,
+	0x1190, 0x080c, 0x63cd, 0x0118, 0x080c, 0xab6b, 0x0060, 0xb810,
+	0x0006, 0xb814, 0x0006, 0x080c, 0x5e12, 0x000e, 0xb816, 0x000e,
+	0xb812, 0x080c, 0xab6b, 0x00fe, 0x0005, 0x6604, 0x96b6, 0x001e,
+	0x1110, 0x080c, 0xab6b, 0x0005, 0x080c, 0xb98f, 0x1148, 0x6003,
+	0x0001, 0x6007, 0x0001, 0x080c, 0x8ec7, 0x080c, 0x941c, 0x0010,
+	0x080c, 0xab6b, 0x0005, 0x6004, 0x908a, 0x0053, 0x1a0c, 0x0dd5,
+	0x080c, 0x9317, 0x080c, 0xab9c, 0x080c, 0x941c, 0x0005, 0x9182,
+	0x0040, 0x0002, 0xd84d, 0xd84d, 0xd84d, 0xd84d, 0xd84f, 0xd84d,
+	0xd84d, 0xd84d, 0xd84d, 0xd84d, 0xd84d, 0xd84d, 0xd84d, 0xd84d,
+	0xd84d, 0xd84d, 0xd84d, 0xd84d, 0xd84d, 0x080c, 0x0dd5, 0x0096,
+	0x00b6, 0x00d6, 0x00e6, 0x00f6, 0x0046, 0x0026, 0x6210, 0x2258,
+	0xb8bc, 0x9005, 0x11a8, 0x6106, 0x2071, 0x0260, 0x7444, 0x94a4,
+	0xff00, 0x0904, 0xd8b5, 0x080c, 0xe638, 0x1170, 0x9486, 0x2000,
+	0x1158, 0x2009, 0x0001, 0x2011, 0x0200, 0x080c, 0x846c, 0x0020,
+	0x9026, 0x080c, 0xe4bc, 0x0c38, 0x080c, 0x1000, 0x090c, 0x0dd5,
+	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, 0x6a46, 0x001e, 0x080c, 0xe638, 0x1904, 0xd915,
+	0x9486, 0x2000, 0x1130, 0x2019, 0x0017, 0x080c, 0xe1f4, 0x0804,
+	0xd915, 0x9486, 0x0200, 0x1120, 0x080c, 0xe190, 0x0804, 0xd915,
+	0x9486, 0x0400, 0x0120, 0x9486, 0x1000, 0x1904, 0xd915, 0x2019,
+	0x0002, 0x080c, 0xe1ab, 0x0804, 0xd915, 0x2069, 0x1a6e, 0x6a00,
+	0xd284, 0x0904, 0xd97f, 0x9284, 0x0300, 0x1904, 0xd978, 0x6804,
+	0x9005, 0x0904, 0xd960, 0x2d78, 0x6003, 0x0007, 0x080c, 0x1019,
+	0x0904, 0xd921, 0x7800, 0xd08c, 0x1118, 0x7804, 0x8001, 0x7806,
+	0x6017, 0x0000, 0x2001, 0x180f, 0x2004, 0xd084, 0x1904, 0xd983,
+	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, 0xd91d, 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, 0x6a46, 0x002e, 0x004e, 0x00fe,
+	0x00ee, 0x00de, 0x00be, 0x009e, 0x0005, 0x0000, 0x0080, 0x0040,
+	0x0000, 0x2001, 0x1810, 0x2004, 0xd084, 0x0120, 0x080c, 0x1000,
+	0x1904, 0xd8ca, 0x6017, 0xf100, 0x6003, 0x0001, 0x6007, 0x0041,
+	0x080c, 0x8e7f, 0x080c, 0x941c, 0x0c00, 0x2069, 0x0260, 0x6848,
+	0x9084, 0xff00, 0x9086, 0x1200, 0x1198, 0x686c, 0x9084, 0x00ff,
+	0x0016, 0x6114, 0x918c, 0xf700, 0x910d, 0x6116, 0x001e, 0x6003,
+	0x0001, 0x6007, 0x0043, 0x080c, 0x8e7f, 0x080c, 0x941c, 0x0828,
+	0x6868, 0x602e, 0x686c, 0x6032, 0x6017, 0xf200, 0x6003, 0x0001,
+	0x6007, 0x0041, 0x080c, 0x8e7f, 0x080c, 0x941c, 0x0804, 0xd915,
+	0x2001, 0x180e, 0x2004, 0xd0ec, 0x0120, 0x2011, 0x8049, 0x080c,
+	0x48fb, 0x6017, 0xf300, 0x0010, 0x6017, 0xf100, 0x6003, 0x0001,
+	0x6007, 0x0041, 0x080c, 0x8e7f, 0x080c, 0x941c, 0x0804, 0xd915,
+	0x6017, 0xf500, 0x0c98, 0x6017, 0xf600, 0x0804, 0xd935, 0x6017,
+	0xf200, 0x0804, 0xd935, 0xa867, 0x0146, 0xa86b, 0x0000, 0x6008,
+	0xa886, 0x2c00, 0xa87a, 0x7044, 0x9084, 0x0003, 0x9080, 0xd91d,
+	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, 0x0dd5, 0x8210, 0x821c, 0x2001, 0x026c, 0x2098,
+	0xa860, 0x20e8, 0xa85c, 0x9080, 0x0029, 0x20a0, 0x2011, 0xd9ff,
+	0x2041, 0x0001, 0x223d, 0x9784, 0x00ff, 0x9322, 0x1208, 0x2300,
+	0x20a8, 0x4003, 0x931a, 0x0530, 0x8210, 0xd7fc, 0x1130, 0x8d68,
+	0x2d0a, 0x2001, 0x0260, 0x2098, 0x0c68, 0x2950, 0x080c, 0x1019,
+	0x0170, 0x2900, 0xb002, 0xa867, 0x0147, 0xa86b, 0x0000, 0xa860,
+	0x20e8, 0xa85c, 0x9080, 0x001b, 0x20a0, 0x8840, 0x08d8, 0x2548,
+	0xa800, 0x902d, 0x0118, 0x080c, 0x1032, 0x0cc8, 0x080c, 0x1032,
+	0x0804, 0xd921, 0x2548, 0x8847, 0x9885, 0x0046, 0xa866, 0x2009,
+	0x0205, 0x200b, 0x0000, 0x080c, 0xe223, 0x0804, 0xd915, 0x8010,
+	0x0004, 0x801a, 0x0006, 0x8018, 0x0008, 0x8016, 0x000a, 0x8014,
+	0x9186, 0x0013, 0x1160, 0x6004, 0x908a, 0x0054, 0x1a0c, 0x0dd5,
+	0x9082, 0x0040, 0x0a0c, 0x0dd5, 0x2008, 0x0804, 0xdab0, 0x9186,
+	0x0051, 0x0108, 0x00c0, 0x2001, 0x0109, 0x2004, 0xd084, 0x0904,
+	0xda61, 0x0126, 0x2091, 0x2800, 0x0006, 0x0016, 0x0026, 0x080c,
+	0x8d64, 0x002e, 0x001e, 0x000e, 0x012e, 0x6000, 0x9086, 0x0002,
+	0x1580, 0x0804, 0xdaf8, 0x9186, 0x0027, 0x0530, 0x9186, 0x0048,
+	0x0128, 0x9186, 0x0014, 0x0500, 0x190c, 0x0dd5, 0x2001, 0x0109,
+	0x2004, 0xd084, 0x01f0, 0x00c6, 0x0126, 0x2091, 0x2800, 0x00c6,
+	0x2061, 0x0100, 0x0006, 0x0016, 0x0026, 0x080c, 0x8d64, 0x002e,
+	0x001e, 0x000e, 0x00ce, 0x012e, 0x00ce, 0x6000, 0x9086, 0x0004,
+	0x190c, 0x0dd5, 0x0804, 0xdbd9, 0x6004, 0x9082, 0x0040, 0x2008,
+	0x001a, 0x080c, 0xac01, 0x0005, 0xda77, 0xda79, 0xda79, 0xdaa0,
+	0xda77, 0xda77, 0xda77, 0xda77, 0xda77, 0xda77, 0xda77, 0xda77,
+	0xda77, 0xda77, 0xda77, 0xda77, 0xda77, 0xda77, 0xda77, 0x080c,
+	0x0dd5, 0x080c, 0x9317, 0x080c, 0x941c, 0x0036, 0x0096, 0x6014,
+	0x904d, 0x01d8, 0x080c, 0xc825, 0x01c0, 0x6003, 0x0002, 0x6010,
+	0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x1178, 0x2019, 0x0004,
+	0x080c, 0xe223, 0x6017, 0x0000, 0x6018, 0x9005, 0x1120, 0x2001,
+	0x1985, 0x2004, 0x601a, 0x6003, 0x0007, 0x009e, 0x003e, 0x0005,
+	0x0096, 0x080c, 0x9317, 0x080c, 0x941c, 0x080c, 0xc825, 0x0120,
+	0x6014, 0x2048, 0x080c, 0x1032, 0x080c, 0xab9c, 0x009e, 0x0005,
+	0x0002, 0xdac4, 0xdadb, 0xdac6, 0xdaf2, 0xdac4, 0xdac4, 0xdac4,
+	0xdac4, 0xdac4, 0xdac4, 0xdac4, 0xdac4, 0xdac4, 0xdac4, 0xdac4,
+	0xdac4, 0xdac4, 0xdac4, 0xdac4, 0x080c, 0x0dd5, 0x0096, 0x080c,
+	0x9317, 0x6014, 0x2048, 0xa87c, 0xd0b4, 0x0138, 0x6003, 0x0007,
+	0x2009, 0x0043, 0x080c, 0xabe6, 0x0010, 0x6003, 0x0004, 0x080c,
+	0x941c, 0x009e, 0x0005, 0x080c, 0x9317, 0x080c, 0xc825, 0x0138,
+	0x6114, 0x0096, 0x2148, 0xa97c, 0x009e, 0xd1ec, 0x1138, 0x080c,
+	0x8441, 0x080c, 0xab6b, 0x080c, 0x941c, 0x0005, 0x080c, 0xe480,
+	0x0db0, 0x0cc8, 0x080c, 0x9317, 0x2009, 0x0041, 0x0804, 0xdc61,
+	0x9182, 0x0040, 0x0002, 0xdb0e, 0xdb10, 0xdb0e, 0xdb0e, 0xdb0e,
+	0xdb0e, 0xdb0e, 0xdb0e, 0xdb0e, 0xdb0e, 0xdb0e, 0xdb0e, 0xdb0e,
+	0xdb0e, 0xdb0e, 0xdb0e, 0xdb0e, 0xdb11, 0xdb0e, 0x080c, 0x0dd5,
+	0x0005, 0x00d6, 0x080c, 0x8441, 0x00de, 0x080c, 0xe4d8, 0x080c,
+	0xab6b, 0x0005, 0x9182, 0x0040, 0x0002, 0xdb30, 0xdb30, 0xdb30,
+	0xdb30, 0xdb30, 0xdb30, 0xdb30, 0xdb30, 0xdb30, 0xdb32, 0xdba1,
+	0xdb30, 0xdb30, 0xdb30, 0xdb30, 0xdba1, 0xdb30, 0xdb30, 0xdb30,
+	0x080c, 0x0dd5, 0x2001, 0x0105, 0x2004, 0x9084, 0x1800, 0x01c8,
+	0x2001, 0x0132, 0x200c, 0x2001, 0x0131, 0x2004, 0x9105, 0x1904,
+	0xdba1, 0x2009, 0x180c, 0x2104, 0xd0d4, 0x0904, 0xdba1, 0xc0d4,
+	0x200a, 0x2009, 0x0105, 0x2104, 0x9084, 0xe7fd, 0x9085, 0x0010,
+	0x200a, 0x2001, 0x1867, 0x2004, 0xd0e4, 0x1528, 0x603b, 0x0000,
+	0x080c, 0x93cc, 0x6014, 0x0096, 0x2048, 0xa87c, 0xd0fc, 0x0188,
+	0x908c, 0x0003, 0x918e, 0x0002, 0x0508, 0x2001, 0x180c, 0x2004,
+	0xd0d4, 0x11e0, 0x080c, 0x9548, 0x2009, 0x0041, 0x009e, 0x0804,
+	0xdc61, 0x080c, 0x9548, 0x6003, 0x0007, 0x601b, 0x0000, 0x080c,
+	0x8441, 0x009e, 0x0005, 0x2001, 0x0100, 0x2004, 0x9082, 0x0005,
+	0x0aa8, 0x2001, 0x011f, 0x2004, 0x603a, 0x0890, 0x2001, 0x180c,
+	0x200c, 0xc1d4, 0x2102, 0xd1cc, 0x0110, 0x080c, 0x2b04, 0x080c,
+	0x9548, 0x6014, 0x2048, 0xa97c, 0xd1ec, 0x1130, 0x080c, 0x8441,
+	0x080c, 0xab6b, 0x009e, 0x0005, 0x080c, 0xe480, 0x0db8, 0x009e,
+	0x0005, 0x2001, 0x180c, 0x200c, 0xc1d4, 0x2102, 0x0036, 0x080c,
+	0x93cc, 0x080c, 0x9548, 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, 0xe223, 0x6018, 0x9005, 0x1128, 0x2001, 0x1985, 0x2004,
+	0x8003, 0x601a, 0x6017, 0x0000, 0x6003, 0x0007, 0x009e, 0x003e,
+	0x0005, 0x9182, 0x0040, 0x0002, 0xdbf0, 0xdbf0, 0xdbf0, 0xdbf0,
+	0xdbf0, 0xdbf0, 0xdbf0, 0xdbf0, 0xdbf2, 0xdbf0, 0xdbf0, 0xdbf0,
+	0xdbf0, 0xdbf0, 0xdbf0, 0xdbf0, 0xdbf0, 0xdbf0, 0xdbf0, 0xdc3d,
+	0x080c, 0x0dd5, 0x6014, 0x0096, 0x2048, 0xa834, 0xaa38, 0x6110,
+	0x00b6, 0x2058, 0xb900, 0x00be, 0xd1bc, 0x1190, 0x920d, 0x1518,
+	0xa87c, 0xd0fc, 0x0128, 0x2009, 0x0041, 0x009e, 0x0804, 0xdc61,
+	0x6003, 0x0007, 0x601b, 0x0000, 0x080c, 0x8441, 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, 0x180e, 0x210c, 0xd19c, 0x0118, 0x6003,
+	0x0007, 0x0010, 0x6003, 0x0006, 0x00e9, 0x080c, 0x8443, 0x009e,
+	0x0005, 0x6003, 0x0002, 0x009e, 0x0005, 0x6024, 0xd0f4, 0x0128,
+	0x080c, 0x15c8, 0x1904, 0xdbf2, 0x0005, 0x6014, 0x0096, 0x2048,
+	0xa834, 0xa938, 0x009e, 0x9105, 0x1120, 0x080c, 0x15c8, 0x1904,
+	0xdbf2, 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, 0x0dd5, 0x6024, 0xd0dc, 0x090c, 0x0dd5,
+	0x0005, 0xdc84, 0xdc90, 0xdc9c, 0xdca8, 0xdc84, 0xdc84, 0xdc84,
+	0xdc84, 0xdc8b, 0xdc86, 0xdc86, 0xdc84, 0xdc84, 0xdc84, 0xdc84,
+	0xdc86, 0xdc84, 0xdc86, 0xdc84, 0x080c, 0x0dd5, 0x6024, 0xd0dc,
+	0x090c, 0x0dd5, 0x0005, 0x6014, 0x9005, 0x190c, 0x0dd5, 0x0005,
+	0x6003, 0x0001, 0x6106, 0x080c, 0x8e7f, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x941c, 0x012e, 0x0005, 0x6003, 0x0001, 0x6106, 0x080c,
+	0x8e7f, 0x0126, 0x2091, 0x8000, 0x080c, 0x941c, 0x012e, 0x0005,
+	0x6003, 0x0003, 0x6106, 0x2c10, 0x080c, 0x1b03, 0x0126, 0x2091,
+	0x8000, 0x080c, 0x8ee4, 0x080c, 0x9548, 0x012e, 0x0005, 0x0126,
+	0x2091, 0x8000, 0x0036, 0x0096, 0x9182, 0x0040, 0x0023, 0x009e,
+	0x003e, 0x012e, 0x0005, 0xdcd3, 0xdcd5, 0xdce7, 0xdd01, 0xdcd3,
+	0xdcd3, 0xdcd3, 0xdcd3, 0xdcd3, 0xdcd3, 0xdcd3, 0xdcd3, 0xdcd3,
+	0xdcd3, 0xdcd3, 0xdcd3, 0x080c, 0x0dd5, 0x6014, 0x2048, 0xa87c,
+	0xd0fc, 0x01f8, 0x909c, 0x0003, 0x939e, 0x0003, 0x01d0, 0x6003,
+	0x0001, 0x6106, 0x080c, 0x8e7f, 0x080c, 0x941c, 0x0470, 0x6014,
+	0x2048, 0xa87c, 0xd0fc, 0x0168, 0x909c, 0x0003, 0x939e, 0x0003,
+	0x0140, 0x6003, 0x0001, 0x6106, 0x080c, 0x8e7f, 0x080c, 0x941c,
+	0x00e0, 0x901e, 0x6316, 0x631a, 0x2019, 0x0004, 0x080c, 0xe223,
+	0x00a0, 0x6014, 0x2048, 0xa87c, 0xd0fc, 0x0d98, 0x909c, 0x0003,
+	0x939e, 0x0003, 0x0d70, 0x6003, 0x0003, 0x6106, 0x2c10, 0x080c,
+	0x1b03, 0x080c, 0x8ee4, 0x080c, 0x9548, 0x0005, 0x080c, 0x9317,
+	0x6114, 0x81ff, 0x0158, 0x0096, 0x2148, 0x080c, 0xe5d5, 0x0036,
+	0x2019, 0x0029, 0x080c, 0xe223, 0x003e, 0x009e, 0x080c, 0xab9c,
+	0x080c, 0x941c, 0x0005, 0x080c, 0x93cc, 0x6114, 0x81ff, 0x0158,
+	0x0096, 0x2148, 0x080c, 0xe5d5, 0x0036, 0x2019, 0x0029, 0x080c,
+	0xe223, 0x003e, 0x009e, 0x080c, 0xab9c, 0x080c, 0x9548, 0x0005,
+	0x9182, 0x0085, 0x0002, 0xdd52, 0xdd50, 0xdd50, 0xdd5e, 0xdd50,
+	0xdd50, 0xdd50, 0xdd50, 0xdd50, 0xdd50, 0xdd50, 0xdd50, 0xdd50,
+	0x080c, 0x0dd5, 0x6003, 0x000b, 0x6106, 0x080c, 0x8e7f, 0x0126,
+	0x2091, 0x8000, 0x080c, 0x941c, 0x012e, 0x0005, 0x0026, 0x00e6,
+	0x080c, 0xe477, 0x0118, 0x080c, 0xab6b, 0x0450, 0x2071, 0x0260,
+	0x7224, 0x6216, 0x2001, 0x180e, 0x2004, 0xd0e4, 0x0150, 0x6010,
+	0x00b6, 0x2058, 0xbca0, 0x00be, 0x2c00, 0x2011, 0x014e, 0x080c,
+	0xae8c, 0x7220, 0x080c, 0xe0c9, 0x0118, 0x6007, 0x0086, 0x0040,
+	0x6007, 0x0087, 0x7224, 0x9296, 0xffff, 0x1110, 0x6007, 0x0086,
+	0x6003, 0x0001, 0x080c, 0x8e7f, 0x080c, 0x941c, 0x080c, 0x9548,
+	0x00ee, 0x002e, 0x0005, 0x9186, 0x0013, 0x1160, 0x6004, 0x908a,
+	0x0085, 0x0a0c, 0x0dd5, 0x908a, 0x0092, 0x1a0c, 0x0dd5, 0x9082,
+	0x0085, 0x00a2, 0x9186, 0x0027, 0x0130, 0x9186, 0x0014, 0x0118,
+	0x080c, 0xac01, 0x0050, 0x2001, 0x0007, 0x080c, 0x6349, 0x080c,
+	0x9317, 0x080c, 0xab9c, 0x080c, 0x941c, 0x0005, 0xddc3, 0xddc5,
+	0xddc5, 0xddc3, 0xddc3, 0xddc3, 0xddc3, 0xddc3, 0xddc3, 0xddc3,
+	0xddc3, 0xddc3, 0xddc3, 0x080c, 0x0dd5, 0x080c, 0x9317, 0x080c,
+	0xab9c, 0x080c, 0x941c, 0x0005, 0x9182, 0x0085, 0x0a0c, 0x0dd5,
+	0x9182, 0x0092, 0x1a0c, 0x0dd5, 0x9182, 0x0085, 0x0002, 0xdde4,
+	0xdde4, 0xdde4, 0xdde6, 0xdde4, 0xdde4, 0xdde4, 0xdde4, 0xdde4,
+	0xdde4, 0xdde4, 0xdde4, 0xdde4, 0x080c, 0x0dd5, 0x0005, 0x9186,
+	0x0013, 0x0148, 0x9186, 0x0014, 0x0130, 0x9186, 0x0027, 0x0118,
+	0x080c, 0xac01, 0x0030, 0x080c, 0x9317, 0x080c, 0xab9c, 0x080c,
+	0x941c, 0x0005, 0x0036, 0x080c, 0xe4d8, 0x6043, 0x0000, 0x2019,
+	0x000b, 0x0031, 0x6023, 0x0006, 0x6003, 0x0007, 0x003e, 0x0005,
+	0x0126, 0x0036, 0x2091, 0x8000, 0x0086, 0x2c40, 0x0096, 0x904e,
+	0x080c, 0xa3a6, 0x009e, 0x008e, 0x1550, 0x0076, 0x2c38, 0x080c,
+	0xa451, 0x007e, 0x1520, 0x6000, 0x9086, 0x0000, 0x0500, 0x6020,
+	0x9086, 0x0007, 0x01e0, 0x0096, 0x601c, 0xd084, 0x0140, 0x080c,
+	0xe4d8, 0x080c, 0xcf30, 0x080c, 0x19b4, 0x6023, 0x0007, 0x6014,
+	0x2048, 0x080c, 0xc825, 0x0110, 0x080c, 0xe223, 0x009e, 0x6017,
+	0x0000, 0x080c, 0xe4d8, 0x6023, 0x0007, 0x080c, 0xcf30, 0x003e,
+	0x012e, 0x0005, 0x00f6, 0x00c6, 0x00b6, 0x0036, 0x0156, 0x2079,
+	0x0260, 0x7938, 0x783c, 0x080c, 0x26f0, 0x15b8, 0x0016, 0x00c6,
+	0x080c, 0x63cd, 0x1580, 0x001e, 0x00c6, 0x2160, 0x080c, 0xcf2d,
+	0x00ce, 0x002e, 0x0026, 0x0016, 0x2019, 0x0029, 0x080c, 0xa512,
+	0x080c, 0x901a, 0x0076, 0x903e, 0x080c, 0x8ef7, 0x007e, 0x001e,
+	0x0076, 0x903e, 0x080c, 0xdfbd, 0x007e, 0x0026, 0xba04, 0x9294,
+	0xff00, 0x8217, 0x9286, 0x0006, 0x0118, 0x9286, 0x0004, 0x1118,
+	0xbaa0, 0x080c, 0x3128, 0x002e, 0x001e, 0x080c, 0x5e12, 0xbe12,
+	0xbd16, 0x9006, 0x0010, 0x00ce, 0x001e, 0x015e, 0x003e, 0x00be,
+	0x00ce, 0x00fe, 0x0005, 0x00c6, 0x00d6, 0x00b6, 0x0016, 0x2009,
+	0x1824, 0x2104, 0x9086, 0x0074, 0x1904, 0xdee4, 0x2069, 0x0260,
+	0x6944, 0x9182, 0x0100, 0x06e0, 0x6940, 0x9184, 0x8000, 0x0904,
+	0xdee1, 0x2001, 0x197c, 0x2004, 0x9005, 0x1140, 0x6010, 0x2058,
+	0xb8c0, 0x9005, 0x0118, 0x9184, 0x0800, 0x0598, 0x6948, 0x918a,
+	0x0001, 0x0648, 0x080c, 0xe63d, 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, 0x63dc, 0x0804, 0xdf4c, 0x2011, 0x0276, 0x20a9, 0x0004,
+	0x0096, 0x2b48, 0x2019, 0x000a, 0x080c, 0xbb27, 0x009e, 0x15a8,
 	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,
+	0x080c, 0xbb27, 0x009e, 0x1548, 0x0046, 0x0016, 0xbaa0, 0x2220,
+	0x9006, 0x2009, 0x1848, 0x210c, 0xd1a4, 0x0138, 0x2009, 0x0029,
+	0x080c, 0xe280, 0xb800, 0xc0e5, 0xb802, 0x2019, 0x0029, 0x080c,
+	0x901a, 0x0076, 0x2039, 0x0000, 0x080c, 0x8ef7, 0x2c08, 0x080c,
+	0xdfbd, 0x007e, 0x2001, 0x0007, 0x080c, 0x6349, 0x2001, 0x0007,
+	0x080c, 0x631d, 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, 0x26f0, 0x11d0, 0x080c, 0x63cd, 0x11b8,
+	0x2011, 0x0270, 0x20a9, 0x0004, 0x0096, 0x2b48, 0x2019, 0x000a,
+	0x080c, 0xbb27, 0x009e, 0x1158, 0x2011, 0x0274, 0x20a9, 0x0004,
+	0x0096, 0x2b48, 0x2019, 0x0006, 0x080c, 0xbb27, 0x009e, 0x015e,
+	0x003e, 0x002e, 0x001e, 0x00fe, 0x00be, 0x0005, 0x00b6, 0x0006,
+	0x0016, 0x0026, 0x0036, 0x0156, 0x2011, 0x0263, 0x2204, 0x8211,
+	0x220c, 0x080c, 0x26f0, 0x11d0, 0x080c, 0x63cd, 0x11b8, 0x2011,
+	0x0276, 0x20a9, 0x0004, 0x0096, 0x2b48, 0x2019, 0x000a, 0x080c,
+	0xbb27, 0x009e, 0x1158, 0x2011, 0x027a, 0x20a9, 0x0004, 0x0096,
+	0x2b48, 0x2019, 0x0006, 0x080c, 0xbb27, 0x009e, 0x015e, 0x003e,
+	0x002e, 0x001e, 0x000e, 0x00be, 0x0005, 0x00e6, 0x00c6, 0x0086,
+	0x0076, 0x0066, 0x0056, 0x0046, 0x0026, 0x0126, 0x2091, 0x8000,
+	0x2740, 0x2029, 0x19ee, 0x252c, 0x2021, 0x19f4, 0x2424, 0x2061,
+	0x1cd0, 0x2071, 0x1800, 0x7654, 0x7074, 0x81ff, 0x0150, 0x0006,
+	0x9186, 0x1aa7, 0x000e, 0x0128, 0x8001, 0x9602, 0x1a04, 0xe05a,
+	0x0018, 0x9606, 0x0904, 0xe05a, 0x080c, 0x8710, 0x0904, 0xe051,
+	0x2100, 0x9c06, 0x0904, 0xe051, 0x080c, 0xe2bc, 0x1904, 0xe051,
+	0x080c, 0xe65a, 0x0904, 0xe051, 0x080c, 0xe2ac, 0x0904, 0xe051,
+	0x6720, 0x9786, 0x0001, 0x1148, 0x080c, 0x31bf, 0x0904, 0xe099,
+	0x6004, 0x9086, 0x0000, 0x1904, 0xe099, 0x9786, 0x0004, 0x0904,
+	0xe099, 0x9786, 0x0007, 0x0904, 0xe051, 0x2500, 0x9c06, 0x0904,
+	0xe051, 0x2400, 0x9c06, 0x05e8, 0x88ff, 0x0118, 0x6054, 0x9906,
+	0x15c0, 0x0096, 0x6000, 0x9086, 0x0004, 0x1120, 0x0016, 0x080c,
+	0x19b4, 0x001e, 0x9786, 0x000a, 0x0148, 0x080c, 0xca24, 0x1130,
+	0x080c, 0xb51d, 0x009e, 0x080c, 0xab9c, 0x0418, 0x6014, 0x2048,
+	0x080c, 0xc825, 0x01d8, 0x9786, 0x0003, 0x1570, 0xa867, 0x0103,
+	0xab7a, 0xa877, 0x0000, 0xa87c, 0xd0cc, 0x0130, 0x0096, 0xa878,
+	0x2048, 0x080c, 0x0fb2, 0x009e, 0x080c, 0xe5d5, 0x0016, 0x080c,
+	0xcb0d, 0x080c, 0x6a3a, 0x001e, 0x080c, 0xca07, 0x009e, 0x080c,
+	0xab9c, 0x9ce0, 0x0018, 0x2001, 0x181a, 0x2004, 0x9c02, 0x1210,
+	0x0804, 0xdfd1, 0x012e, 0x002e, 0x004e, 0x005e, 0x006e, 0x007e,
+	0x008e, 0x00ce, 0x00ee, 0x0005, 0x9786, 0x0006, 0x1150, 0x9386,
+	0x0005, 0x0128, 0x080c, 0xe5d5, 0x080c, 0xe223, 0x08f8, 0x009e,
+	0x0c00, 0x9786, 0x0009, 0x11f8, 0x6000, 0x9086, 0x0004, 0x01c0,
+	0x6000, 0x9086, 0x0003, 0x11a0, 0x080c, 0x93cc, 0x0096, 0x6114,
+	0x2148, 0x080c, 0xc825, 0x0118, 0x6010, 0x080c, 0x6a46, 0x009e,
+	0x00c6, 0x080c, 0xab6b, 0x00ce, 0x0036, 0x080c, 0x9548, 0x003e,
+	0x009e, 0x0804, 0xe051, 0x9786, 0x000a, 0x0904, 0xe038, 0x0804,
+	0xe036, 0x81ff, 0x0904, 0xe051, 0x9180, 0x0001, 0x2004, 0x9086,
+	0x0018, 0x0138, 0x9180, 0x0001, 0x2004, 0x9086, 0x002d, 0x1904,
+	0xe051, 0x6000, 0x9086, 0x0002, 0x1904, 0xe051, 0x080c, 0xca13,
+	0x0138, 0x080c, 0xca24, 0x1904, 0xe051, 0x080c, 0xb51d, 0x0038,
+	0x080c, 0x3093, 0x080c, 0xca24, 0x1110, 0x080c, 0xb51d, 0x080c,
+	0xab9c, 0x0804, 0xe051, 0xa864, 0x9084, 0x00ff, 0x9086, 0x0039,
+	0x0005, 0x00c6, 0x00e6, 0x0016, 0x2c08, 0x2170, 0x9006, 0x080c,
+	0xe24a, 0x001e, 0x0120, 0x6020, 0x9084, 0x000f, 0x001b, 0x00ee,
+	0x00ce, 0x0005, 0xe0e8, 0xe0e8, 0xe0e8, 0xe0e8, 0xe0e8, 0xe0e8,
+	0xe0ea, 0xe0e8, 0xe0e8, 0xe0e8, 0xe0e8, 0xab9c, 0xab9c, 0xe0e8,
+	0x9006, 0x0005, 0x0036, 0x0046, 0x0016, 0x7010, 0x00b6, 0x2058,
+	0xbca0, 0x00be, 0x2c00, 0x2009, 0x0020, 0x080c, 0xe280, 0x001e,
+	0x004e, 0x2019, 0x0002, 0x080c, 0xde08, 0x003e, 0x9085, 0x0001,
+	0x0005, 0x0096, 0x080c, 0xc825, 0x0140, 0x6014, 0x904d, 0x080c,
+	0xc472, 0x687b, 0x0005, 0x080c, 0x6a46, 0x009e, 0x080c, 0xab9c,
+	0x9085, 0x0001, 0x0005, 0x2001, 0x0001, 0x080c, 0x6309, 0x0156,
+	0x0016, 0x0026, 0x0036, 0x20a9, 0x0004, 0x2019, 0x1805, 0x2011,
+	0x0276, 0x080c, 0xbb13, 0x003e, 0x002e, 0x001e, 0x015e, 0x9005,
+	0x0005, 0x00f6, 0x00e6, 0x00c6, 0x0086, 0x0076, 0x0066, 0x00b6,
+	0x0126, 0x2091, 0x8000, 0x2740, 0x2061, 0x1cd0, 0x2079, 0x0001,
+	0x8fff, 0x0904, 0xe183, 0x2071, 0x1800, 0x7654, 0x7074, 0x8001,
+	0x9602, 0x1a04, 0xe183, 0x88ff, 0x0120, 0x2800, 0x9c06, 0x1590,
+	0x2078, 0x080c, 0xe2ac, 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, 0xe4d8, 0x080c, 0xcf30,
+	0x080c, 0x19b4, 0x6023, 0x0007, 0x6014, 0x2048, 0x080c, 0xc825,
+	0x0120, 0x0046, 0x080c, 0xe223, 0x004e, 0x009e, 0x080c, 0xab9c,
+	0x88ff, 0x1198, 0x9ce0, 0x0018, 0x2001, 0x181a, 0x2004, 0x9c02,
+	0x1210, 0x0804, 0xe138, 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, 0xa3a6,
+	0x009e, 0x008e, 0x903e, 0x080c, 0xa451, 0x080c, 0xe129, 0x005e,
+	0x007e, 0x00be, 0x0005, 0x00b6, 0x0046, 0x0056, 0x0076, 0x00c6,
+	0x0156, 0x2c20, 0x2128, 0x20a9, 0x007f, 0x900e, 0x0016, 0x0036,
+	0x080c, 0x63cd, 0x1190, 0x0056, 0x0086, 0x9046, 0x2508, 0x2029,
+	0x0001, 0x0096, 0x904e, 0x080c, 0xa3a6, 0x009e, 0x008e, 0x903e,
+	0x080c, 0xa451, 0x080c, 0xe129, 0x005e, 0x003e, 0x001e, 0x8108,
+	0x1f04, 0xe1b6, 0x015e, 0x00ce, 0x007e, 0x005e, 0x004e, 0x00be,
+	0x0005, 0x00b6, 0x0076, 0x0056, 0x6210, 0x2258, 0x0086, 0x9046,
+	0x2029, 0x0001, 0x2019, 0x0048, 0x0096, 0x904e, 0x080c, 0xa3a6,
+	0x009e, 0x008e, 0x903e, 0x080c, 0xa451, 0x2c20, 0x080c, 0xe129,
+	0x005e, 0x007e, 0x00be, 0x0005, 0x00b6, 0x0046, 0x0056, 0x0076,
+	0x00c6, 0x0156, 0x2c20, 0x20a9, 0x0800, 0x900e, 0x0016, 0x0036,
+	0x080c, 0x63cd, 0x11a0, 0x0086, 0x9046, 0x2828, 0x0046, 0x2021,
+	0x0001, 0x080c, 0xe4bc, 0x004e, 0x0096, 0x904e, 0x080c, 0xa3a6,
+	0x009e, 0x008e, 0x903e, 0x080c, 0xa451, 0x080c, 0xe129, 0x003e,
+	0x001e, 0x8108, 0x1f04, 0xe1fe, 0x015e, 0x00ce, 0x007e, 0x005e,
+	0x004e, 0x00be, 0x0005, 0x0016, 0x00f6, 0x080c, 0xc823, 0x0198,
+	0xa864, 0x9084, 0x00ff, 0x9086, 0x0046, 0x0180, 0xa800, 0x907d,
+	0x0138, 0xa803, 0x0000, 0xab82, 0x080c, 0x6a46, 0x2f48, 0x0cb0,
+	0xab82, 0x080c, 0x6a46, 0x00fe, 0x001e, 0x0005, 0xa800, 0x907d,
+	0x0130, 0xa803, 0x0000, 0x080c, 0x6a46, 0x2f48, 0x0cb8, 0x080c,
+	0x6a46, 0x0c88, 0x00e6, 0x0046, 0x0036, 0x2061, 0x1cd0, 0x9005,
+	0x1138, 0x2071, 0x1800, 0x7454, 0x7074, 0x8001, 0x9402, 0x12f8,
+	0x2100, 0x9c06, 0x0188, 0x6000, 0x9086, 0x0000, 0x0168, 0x6008,
+	0x9206, 0x1150, 0x6320, 0x9386, 0x0009, 0x01b0, 0x6010, 0x91a0,
+	0x0004, 0x2424, 0x9406, 0x0140, 0x9ce0, 0x0018, 0x2001, 0x181a,
+	0x2004, 0x9c02, 0x1220, 0x0c20, 0x9085, 0x0001, 0x0008, 0x9006,
+	0x003e, 0x004e, 0x00ee, 0x0005, 0x631c, 0xd3c4, 0x1d68, 0x0c30,
+	0x0096, 0x0006, 0x080c, 0x1000, 0x000e, 0x090c, 0x0dd5, 0xa867,
+	0x010d, 0xa88e, 0x0026, 0x2010, 0x080c, 0xc813, 0x2001, 0x0000,
+	0x0120, 0x2200, 0x9080, 0x0015, 0x2004, 0x002e, 0xa87a, 0xa986,
+	0xac76, 0xa87f, 0x0000, 0x2001, 0x198c, 0x2004, 0xa882, 0x9006,
+	0xa8e2, 0xa802, 0xa86a, 0xa88a, 0x0126, 0x2091, 0x8000, 0x080c,
+	0x6a46, 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, 0x1985, 0x2004, 0x601a, 0x080c,
+	0x8e7f, 0x080c, 0x941c, 0x001e, 0x0005, 0xa001, 0xa001, 0x0005,
+	0x6024, 0xd0e4, 0x0158, 0xd0cc, 0x0118, 0x080c, 0xcb51, 0x0030,
+	0x080c, 0xe4d8, 0x080c, 0x8441, 0x080c, 0xab6b, 0x0005, 0x9280,
+	0x0008, 0x2004, 0x9084, 0x000f, 0x0002, 0xe30b, 0xe30b, 0xe30b,
+	0xe30d, 0xe30b, 0xe30d, 0xe30d, 0xe30b, 0xe30d, 0xe30b, 0xe30b,
+	0xe30b, 0xe30b, 0xe30b, 0x9006, 0x0005, 0x9085, 0x0001, 0x0005,
+	0x9280, 0x0008, 0x2004, 0x9084, 0x000f, 0x0002, 0xe324, 0xe324,
+	0xe324, 0xe324, 0xe324, 0xe324, 0xe331, 0xe324, 0xe324, 0xe324,
+	0xe324, 0xe324, 0xe324, 0xe324, 0x6007, 0x003b, 0x602f, 0x0009,
+	0x6017, 0x2a00, 0x6003, 0x0001, 0x080c, 0x8e7f, 0x080c, 0x941c,
+	0x0005, 0x0096, 0x00c6, 0x2260, 0x080c, 0xe4d8, 0x6043, 0x0000,
+	0x6024, 0xc0f4, 0xc0e4, 0x6026, 0x603b, 0x0000, 0x00ce, 0x00d6,
+	0x2268, 0x9186, 0x0007, 0x1904, 0xe38a, 0x6814, 0x9005, 0x0138,
+	0x2048, 0xa87c, 0xd0fc, 0x1118, 0x00de, 0x009e, 0x08a8, 0x6007,
+	0x003a, 0x6003, 0x0001, 0x080c, 0x8e7f, 0x080c, 0x941c, 0x00c6,
+	0x2d60, 0x6100, 0x9186, 0x0002, 0x1904, 0xe401, 0x6014, 0x9005,
+	0x1138, 0x6000, 0x9086, 0x0007, 0x190c, 0x0dd5, 0x0804, 0xe401,
+	0x2048, 0x080c, 0xc825, 0x1130, 0x0028, 0x2048, 0xa800, 0x9005,
+	0x1de0, 0x2900, 0x2048, 0xa87c, 0x9084, 0x0003, 0x9086, 0x0002,
+	0x1168, 0xa87c, 0xc0dc, 0xc0f4, 0xa87e, 0xa880, 0xc0fc, 0xa882,
+	0x2009, 0x0043, 0x080c, 0xdc61, 0x0804, 0xe401, 0x2009, 0x0041,
+	0x0804, 0xe3fb, 0x9186, 0x0005, 0x15a0, 0x6814, 0x2048, 0xa87c,
+	0xd0bc, 0x1120, 0x00de, 0x009e, 0x0804, 0xe324, 0xd0b4, 0x0128,
+	0xd0fc, 0x090c, 0x0dd5, 0x0804, 0xe345, 0x6007, 0x003a, 0x6003,
+	0x0001, 0x080c, 0x8e7f, 0x080c, 0x941c, 0x00c6, 0x2d60, 0x6100,
+	0x9186, 0x0002, 0x0120, 0x9186, 0x0004, 0x1904, 0xe401, 0x6814,
+	0x2048, 0xa97c, 0xc1f4, 0xc1dc, 0xa97e, 0xa980, 0xc1fc, 0xc1bc,
+	0xa982, 0x00f6, 0x2c78, 0x080c, 0x1689, 0x00fe, 0x2009, 0x0042,
+	0x04d0, 0x0036, 0x080c, 0x1000, 0x090c, 0x0dd5, 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,
+	0x080c, 0x6a46, 0x2019, 0x0045, 0x6008, 0x2068, 0x080c, 0xde08,
 	0x2d00, 0x600a, 0x6023, 0x0006, 0x6003, 0x0007, 0x901e, 0x631a,
 	0x6342, 0x003e, 0x0038, 0x6043, 0x0000, 0x6003, 0x0007, 0x080c,
-	0xca06, 0x00ce, 0x00de, 0x009e, 0x0005, 0x9186, 0x0013, 0x1128,
+	0xdc61, 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,
+	0x080c, 0x9317, 0x0036, 0x0096, 0x6014, 0x2048, 0x2019, 0x0004,
+	0x080c, 0xe223, 0x009e, 0x003e, 0x080c, 0x941c, 0x0005, 0x9186,
+	0x0014, 0x0d70, 0x080c, 0xac01, 0x0005, 0xe434, 0xe432, 0xe432,
+	0xe432, 0xe432, 0xe432, 0xe434, 0xe432, 0xe432, 0xe432, 0xe432,
+	0xe432, 0xe432, 0x080c, 0x0dd5, 0x080c, 0x9317, 0x6003, 0x000c,
+	0x080c, 0x941c, 0x0005, 0x9182, 0x0092, 0x1220, 0x9182, 0x0085,
+	0x0208, 0x001a, 0x080c, 0xac01, 0x0005, 0xe452, 0xe452, 0xe452,
+	0xe452, 0xe454, 0xe474, 0xe452, 0xe452, 0xe452, 0xe452, 0xe452,
+	0xe452, 0xe452, 0x080c, 0x0dd5, 0x00d6, 0x2c68, 0x080c, 0xab15,
 	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,
+	0x6112, 0x6023, 0x0004, 0x080c, 0x8e7f, 0x080c, 0x941c, 0x2d60,
+	0x080c, 0xab6b, 0x00de, 0x0005, 0x080c, 0xab6b, 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,
+	0x2009, 0x1867, 0x210c, 0xd1ec, 0x05b0, 0x6003, 0x0002, 0x6024,
+	0xc0e5, 0x6026, 0xd0cc, 0x0150, 0x2001, 0x1986, 0x2004, 0x6042,
+	0x2009, 0x1867, 0x210c, 0xd1f4, 0x1520, 0x00a0, 0x2009, 0x1867,
 	0x210c, 0xd1f4, 0x0128, 0x6024, 0xc0e4, 0x6026, 0x9006, 0x00d8,
-	0x2001, 0x1957, 0x200c, 0x2001, 0x1955, 0x2004, 0x9100, 0x9080,
-	0x000a, 0x6042, 0x6010, 0x00b6, 0x2058, 0xb8ac, 0x00be, 0x0008,
+	0x2001, 0x1986, 0x200c, 0x2001, 0x1984, 0x2004, 0x9100, 0x9080,
+	0x000a, 0x6042, 0x6010, 0x00b6, 0x2058, 0xb8bc, 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,
+	0xb8bc, 0x2060, 0x8cff, 0x0180, 0x84ff, 0x1118, 0x6054, 0x9106,
+	0x1138, 0x600c, 0x2072, 0x080c, 0x8441, 0x080c, 0xab6b, 0x0010,
 	0x9cf0, 0x0003, 0x2e64, 0x0c70, 0x00ee, 0x00ce, 0x001e, 0x0005,
-	0x00d6, 0x00b6, 0x6010, 0x2058, 0xb8ac, 0x2068, 0x9005, 0x0130,
+	0x00d6, 0x00b6, 0x6010, 0x2058, 0xb8bc, 0x2068, 0x9005, 0x0130,
 	0x9c06, 0x0110, 0x680c, 0x0cd0, 0x600c, 0x680e, 0x00be, 0x00de,
-	0x0005, 0x0026, 0x0036, 0x0156, 0x2011, 0x182a, 0x2204, 0x9084,
+	0x0005, 0x0026, 0x0036, 0x0156, 0x2011, 0x182c, 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,
+	0x0004, 0x6010, 0x0096, 0x2048, 0x2019, 0x000a, 0x080c, 0xbb27,
 	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
+	0x2048, 0x2019, 0x0006, 0x080c, 0xbb27, 0x009e, 0x1100, 0x015e,
+	0x003e, 0x002e, 0x0005, 0x00e6, 0x2071, 0x1800, 0x080c, 0x5d8b,
+	0x080c, 0x2e48, 0x00ee, 0x0005, 0x0096, 0x0026, 0x080c, 0x1000,
+	0x090c, 0x0dd5, 0xa85c, 0x9080, 0x001a, 0x20a0, 0x20a9, 0x000c,
+	0xa860, 0x20e8, 0x9006, 0x4004, 0x9186, 0x0046, 0x1118, 0xa867,
+	0x0136, 0x0038, 0xa867, 0x0138, 0x9186, 0x0041, 0x0110, 0xa87b,
+	0x0001, 0x7038, 0x9084, 0xff00, 0x7240, 0x9294, 0xff00, 0x8007,
+	0x9215, 0xaa9a, 0x9186, 0x0046, 0x1168, 0x7038, 0x9084, 0x00ff,
+	0x723c, 0x9294, 0xff00, 0x9215, 0xaa9e, 0x723c, 0x9294, 0x00ff,
+	0xaaa2, 0x0060, 0x7040, 0x9084, 0x00ff, 0x7244, 0x9294, 0xff00,
+	0x9215, 0xaa9e, 0x7244, 0x9294, 0x00ff, 0xaaa2, 0x9186, 0x0046,
+	0x1118, 0x9e90, 0x0012, 0x0010, 0x9e90, 0x001a, 0x2204, 0x8007,
+	0xa8a6, 0x8210, 0x2204, 0x8007, 0xa8aa, 0x8210, 0x2204, 0x8007,
+	0xa8ae, 0x8210, 0x2204, 0x8007, 0xa8b2, 0x8210, 0x9186, 0x0046,
+	0x11b8, 0x9e90, 0x0016, 0x2204, 0x8007, 0xa8b6, 0x8210, 0x2204,
+	0x8007, 0xa8ba, 0x8210, 0x2204, 0x8007, 0xa8be, 0x8210, 0x2204,
+	0x8007, 0xa8c2, 0x8210, 0x2011, 0x0205, 0x2013, 0x0001, 0x00b0,
+	0x9e90, 0x001e, 0x2204, 0x8007, 0xa8b6, 0x8210, 0x2204, 0x8007,
+	0xa8ba, 0x2011, 0x0205, 0x2013, 0x0001, 0x2011, 0x0260, 0x2204,
+	0x8007, 0xa8be, 0x8210, 0x2204, 0x8007, 0xa8c2, 0x9186, 0x0046,
+	0x1118, 0x2011, 0x0262, 0x0010, 0x2011, 0x026a, 0x0146, 0x01d6,
+	0x0036, 0x20a9, 0x0001, 0x2019, 0x0008, 0xa860, 0x20e8, 0xa85c,
+	0x9080, 0x0031, 0x20a0, 0x2204, 0x8007, 0x4004, 0x8210, 0x8319,
+	0x1dd0, 0x003e, 0x01ce, 0x013e, 0x2011, 0x0205, 0x2013, 0x0000,
+	0x002e, 0x080c, 0x6a46, 0x009e, 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, 0x19ee, 0x252c, 0x2021, 0x19f4, 0x2424, 0x2061, 0x1cd0,
+	0x2071, 0x1800, 0x7654, 0x7074, 0x9606, 0x0578, 0x6720, 0x9786,
+	0x0001, 0x0118, 0x9786, 0x0008, 0x1500, 0x2500, 0x9c06, 0x01e8,
+	0x2400, 0x9c06, 0x01d0, 0x080c, 0xe2ac, 0x01b8, 0x080c, 0xe2bc,
+	0x11a0, 0x6000, 0x9086, 0x0004, 0x1120, 0x0016, 0x080c, 0x19b4,
+	0x001e, 0x080c, 0xca13, 0x1110, 0x080c, 0x3093, 0x080c, 0xca24,
+	0x1110, 0x080c, 0xb51d, 0x080c, 0xab9c, 0x9ce0, 0x0018, 0x2001,
+	0x181a, 0x2004, 0x9c02, 0x1208, 0x0858, 0x012e, 0x001e, 0x002e,
+	0x004e, 0x005e, 0x006e, 0x007e, 0x00ce, 0x00de, 0x00ee, 0x0005,
+	0x2001, 0x1810, 0x2004, 0xd0dc, 0x0005, 0x0006, 0x2001, 0x1837,
+	0x2004, 0xd09c, 0x000e, 0x0005, 0x0006, 0x0036, 0x0046, 0x080c,
+	0xcf18, 0x0168, 0x2019, 0xffff, 0x9005, 0x0128, 0x6010, 0x00b6,
+	0x2058, 0xbba0, 0x00be, 0x2021, 0x0004, 0x080c, 0x4ab2, 0x004e,
+	0x003e, 0x000e, 0x6004, 0x9086, 0x0001, 0x1128, 0x080c, 0xa512,
+	0x080c, 0xab9c, 0x9006, 0x0005, 0x0126, 0x0006, 0x00e6, 0x0016,
+	0x2091, 0x8000, 0x2071, 0x1840, 0xd5a4, 0x0118, 0x7004, 0x8000,
+	0x7006, 0xd5b4, 0x0118, 0x7000, 0x8000, 0x7002, 0xd5ac, 0x0178,
+	0x2500, 0x9084, 0x0007, 0x908e, 0x0003, 0x0148, 0x908e, 0x0004,
+	0x0130, 0x908e, 0x0005, 0x0118, 0x2071, 0xfffe, 0x0089, 0x001e,
+	0x00ee, 0x000e, 0x012e, 0x0005, 0x0126, 0x0006, 0x00e6, 0x2091,
+	0x8000, 0x2071, 0xfff6, 0x0021, 0x00ee, 0x000e, 0x012e, 0x0005,
+	0x2e05, 0x8000, 0x2077, 0x1220, 0x8e70, 0x2e05, 0x8000, 0x2077,
+	0x0005, 0x00e6, 0x2071, 0xfff4, 0x0c99, 0x00ee, 0x0005, 0x00e6,
+	0x2071, 0xfff8, 0x0c69, 0x00ee, 0x0005, 0x0126, 0x0006, 0x00e6,
+	0x2091, 0x8000, 0x2071, 0x1840, 0x7014, 0x8000, 0x7016, 0x00ee,
+	0x000e, 0x012e, 0x0005, 0x0003, 0x000b, 0x079a, 0x0000, 0xc000,
+	0x0001, 0x8064, 0x0008, 0x0010, 0x0000, 0x8066, 0x0000, 0x0101,
+	0x0008, 0x4407, 0x0003, 0x8060, 0x0000, 0x0400, 0x0000, 0x580d,
+	0x000b, 0x79a8, 0x000b, 0x50ee, 0x000b, 0x4c0a, 0x0003, 0xbac0,
+	0x0009, 0x008a, 0x0000, 0x0c0a, 0x000b, 0x15fe, 0x0008, 0x340a,
+	0x0003, 0xc4c0, 0x0009, 0x7000, 0x0000, 0xffa0, 0x0001, 0x2000,
+	0x0000, 0x1668, 0x000b, 0x808c, 0x0008, 0x0001, 0x0000, 0x0000,
+	0x0007, 0x4028, 0x0000, 0x4047, 0x000a, 0x808c, 0x0008, 0x0002,
+	0x0000, 0x0822, 0x0003, 0x4022, 0x0000, 0x0028, 0x000b, 0x4122,
+	0x0008, 0x94c0, 0x0009, 0xff00, 0x0008, 0xffe0, 0x0009, 0x0500,
+	0x0008, 0x0a93, 0x000b, 0x4447, 0x0002, 0x0e90, 0x0003, 0x0bfe,
+	0x0008, 0x11a0, 0x0001, 0x126e, 0x0003, 0x0ca0, 0x0001, 0x126e,
+	0x0003, 0x9180, 0x0001, 0x0004, 0x0000, 0x8060, 0x0000, 0x0400,
+	0x0000, 0x7f62, 0x0008, 0x8066, 0x0000, 0x0009, 0x0008, 0x4436,
+	0x000b, 0x808c, 0x0008, 0x0000, 0x0008, 0x0060, 0x0008, 0x8062,
+	0x0008, 0x0004, 0x0000, 0x8066, 0x0000, 0x0411, 0x0000, 0x443e,
+	0x0003, 0x03fe, 0x0000, 0x43e0, 0x0001, 0x0e6b, 0x000b, 0xc2c0,
+	0x0009, 0x00ff, 0x0008, 0x02e0, 0x0001, 0x0e6b, 0x000b, 0x9180,
+	0x0001, 0x0005, 0x0008, 0x8060, 0x0000, 0x0400, 0x0000, 0x7f62,
+	0x0008, 0x8066, 0x0000, 0x0019, 0x0000, 0x444d, 0x000b, 0x0240,
+	0x0002, 0x0a68, 0x0003, 0x00fe, 0x0000, 0x326b, 0x000b, 0x0248,
+	0x000a, 0x085c, 0x0003, 0x9180, 0x0001, 0x0006, 0x0008, 0x7f62,
+	0x0008, 0x8002, 0x0008, 0x0003, 0x0008, 0x8066, 0x0000, 0x020a,
+	0x0000, 0x445b, 0x0003, 0x112a, 0x0000, 0x002e, 0x0008, 0x022c,
+	0x0008, 0x3a44, 0x0002, 0x0c0a, 0x000b, 0x808c, 0x0008, 0x0002,
+	0x0000, 0x1760, 0x0008, 0x8062, 0x0008, 0x000f, 0x0008, 0x8066,
+	0x0000, 0x0011, 0x0008, 0x4468, 0x0003, 0x01fe, 0x0008, 0x42e0,
+	0x0009, 0x0e5c, 0x0003, 0x00fe, 0x0000, 0x43e0, 0x0001, 0x0e5c,
+	0x0003, 0x1734, 0x0000, 0x1530, 0x0000, 0x1632, 0x0008, 0x0d2a,
+	0x0008, 0x9880, 0x0001, 0x0010, 0x0000, 0x8060, 0x0000, 0x0400,
+	0x0000, 0x7f62, 0x0008, 0x8066, 0x0000, 0x1e0a, 0x0008, 0x447a,
+	0x0003, 0x808a, 0x0008, 0x0003, 0x0008, 0x1a60, 0x0000, 0x8062,
+	0x0008, 0x0002, 0x0000, 0x5880, 0x000b, 0x8066, 0x0000, 0x3679,
+	0x0000, 0x4483, 0x0003, 0x5884, 0x0003, 0x3efe, 0x0008, 0x7f4f,
+	0x0002, 0x088a, 0x000b, 0x0d00, 0x0000, 0x0092, 0x000c, 0x8054,
+	0x0008, 0x0011, 0x0008, 0x8074, 0x0000, 0x1010, 0x0008, 0x1efe,
+	0x0000, 0x300a, 0x000b, 0x00c8, 0x000c, 0x000a, 0x000b, 0x00fe,
+	0x0000, 0x349a, 0x0003, 0x1a60, 0x0000, 0x8062, 0x0008, 0x0007,
+	0x0000, 0x8066, 0x0000, 0x0231, 0x0008, 0x4499, 0x000b, 0x03fe,
+	0x0000, 0x04d0, 0x0001, 0x0cc0, 0x000b, 0x82c0, 0x0001, 0x1f00,
+	0x0000, 0xffa0, 0x0001, 0x0400, 0x0000, 0x08af, 0x0003, 0x14c0,
+	0x000b, 0x01fe, 0x0008, 0x0580, 0x0009, 0x7f06, 0x0000, 0x02fe,
+	0x0008, 0xffc0, 0x0001, 0x00ff, 0x0008, 0x0690, 0x0001, 0x10af,
+	0x0003, 0x7f08, 0x0008, 0x84c0, 0x0001, 0xff00, 0x0008, 0x08c0,
+	0x0003, 0x00fe, 0x0000, 0x34b6, 0x000b, 0x8072, 0x0000, 0x1010,
+	0x0008, 0x3944, 0x0002, 0x08b1, 0x0003, 0x00ba, 0x0003, 0x8072,
+	0x0000, 0x2020, 0x0008, 0x3945, 0x000a, 0x08b6, 0x000b, 0x3946,
+	0x000a, 0x0cc7, 0x0003, 0x0000, 0x0007, 0x3943, 0x000a, 0x08c7,
+	0x000b, 0x00ba, 0x0003, 0x00fe, 0x0000, 0x34c5, 0x0003, 0x8072,
+	0x0000, 0x1000, 0x0000, 0x00c7, 0x0003, 0x8072, 0x0000, 0x2000,
+	0x0000, 0x4000, 0x000f, 0x1c60, 0x0000, 0x1b62, 0x0000, 0x8066,
+	0x0000, 0x0231, 0x0008, 0x44cc, 0x000b, 0x58cd, 0x000b, 0x0140,
+	0x0008, 0x0242, 0x0000, 0x1f43, 0x0002, 0x0cdb, 0x000b, 0x0d44,
+	0x0000, 0x0d46, 0x0008, 0x0348, 0x0008, 0x044a, 0x0008, 0x030a,
+	0x0008, 0x040c, 0x0000, 0x0d06, 0x0000, 0x0d08, 0x0008, 0x00df,
+	0x0003, 0x0344, 0x0008, 0x0446, 0x0008, 0x0548, 0x0008, 0x064a,
+	0x0000, 0x1948, 0x000a, 0x08e2, 0x0003, 0x0d4a, 0x0008, 0x58e2,
+	0x0003, 0x3efe, 0x0008, 0x7f4f, 0x0002, 0x08e9, 0x000b, 0x8000,
+	0x0000, 0x0001, 0x0000, 0x0092, 0x000c, 0x8054, 0x0008, 0x0001,
+	0x0000, 0x8074, 0x0000, 0x2020, 0x0008, 0x4000, 0x000f, 0x3a40,
+	0x000a, 0x0c0d, 0x0003, 0x2b24, 0x0008, 0x2b24, 0x0008, 0x58f2,
+	0x000b, 0x8054, 0x0008, 0x0002, 0x0000, 0x1242, 0x0002, 0x0940,
+	0x0003, 0x3a45, 0x000a, 0x092f, 0x0003, 0x8072, 0x0000, 0x1000,
+	0x0000, 0x3945, 0x000a, 0x08ff, 0x0003, 0x8072, 0x0000, 0x3010,
+	0x0000, 0x1e10, 0x000a, 0x7f3c, 0x0000, 0x092a, 0x0003, 0x1d00,
+	0x0002, 0x7f3a, 0x0000, 0x0d60, 0x0000, 0x7f62, 0x0008, 0x8066,
+	0x0000, 0x0009, 0x0008, 0x4508, 0x000b, 0x00fe, 0x0000, 0x3527,
+	0x000b, 0x1c60, 0x0000, 0x8062, 0x0008, 0x0001, 0x0000, 0x8066,
+	0x0000, 0x0009, 0x0008, 0x4510, 0x000b, 0x00fe, 0x0000, 0x3243,
+	0x000b, 0x0038, 0x0000, 0x0060, 0x0008, 0x8062, 0x0008, 0x0019,
+	0x0000, 0x8066, 0x0000, 0x0009, 0x0008, 0x4519, 0x000b, 0x80c0,
+	0x0009, 0x00ff, 0x0008, 0x7f3e, 0x0008, 0x0d60, 0x0000, 0x0efe,
+	0x0008, 0x1f80, 0x0001, 0x7f62, 0x0008, 0x8066, 0x0000, 0x0009,
+	0x0008, 0x4523, 0x000b, 0x003a, 0x0008, 0x1dfe, 0x0000, 0x0104,
+	0x000b, 0x0036, 0x0008, 0x00c8, 0x000c, 0x0140, 0x000b, 0x8074,
+	0x0000, 0x2000, 0x0000, 0x8072, 0x0000, 0x2000, 0x0000, 0x0140,
+	0x000b, 0x3a44, 0x0002, 0x0a71, 0x000b, 0x8074, 0x0000, 0x1000,
+	0x0000, 0x8072, 0x0000, 0x1000, 0x0000, 0x2d0e, 0x0000, 0x2d0e,
+	0x0000, 0x3640, 0x0003, 0x26fe, 0x0008, 0x26fe, 0x0008, 0x2700,
+	0x0008, 0x2700, 0x0008, 0x00d0, 0x0009, 0x0d52, 0x000b, 0x8074,
+	0x0000, 0x4040, 0x0008, 0x5940, 0x0003, 0x50ee, 0x000b, 0x3a46,
+	0x000a, 0x0d52, 0x000b, 0x3a47, 0x0002, 0x094d, 0x000b, 0x8054,
+	0x0008, 0x0004, 0x0000, 0x8074, 0x0000, 0x8000, 0x0000, 0x8072,
+	0x0000, 0x3000, 0x0008, 0x019c, 0x0003, 0x92c0, 0x0009, 0x0fc8,
+	0x0000, 0x080a, 0x0003, 0x1246, 0x000a, 0x0e3a, 0x0003, 0x1a60,
+	0x0000, 0x8062, 0x0008, 0x0002, 0x0000, 0x8066, 0x0000, 0x362a,
+	0x0000, 0x4557, 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, 0x4571, 0x0003, 0x92c0,
+	0x0009, 0x0780, 0x0008, 0x0e56, 0x0003, 0x124b, 0x0002, 0x097a,
+	0x0003, 0x2e4d, 0x0002, 0x2e4d, 0x0002, 0x0a40, 0x0003, 0x3a46,
+	0x000a, 0x0d8a, 0x000b, 0x597c, 0x0003, 0x8054, 0x0008, 0x0004,
+	0x0000, 0x1243, 0x000a, 0x0998, 0x0003, 0x8010, 0x0008, 0x000d,
+	0x0000, 0x021b, 0x000c, 0x1948, 0x000a, 0x0987, 0x000b, 0x0210,
+	0x0004, 0x1810, 0x0000, 0x021b, 0x000c, 0x0198, 0x000b, 0x1948,
+	0x000a, 0x098e, 0x000b, 0x1243, 0x000a, 0x0a43, 0x0003, 0x194d,
+	0x000a, 0x0992, 0x0003, 0x1243, 0x000a, 0x0a4a, 0x0003, 0x5992,
+	0x0003, 0x8054, 0x0008, 0x0004, 0x0000, 0x0210, 0x0004, 0x1810,
+	0x0000, 0x021b, 0x000c, 0x8074, 0x0000, 0xf000, 0x0008, 0x8072,
+	0x0000, 0x3000, 0x0008, 0x0d30, 0x0000, 0x3a42, 0x0002, 0x0da2,
+	0x000b, 0x15fe, 0x0008, 0x3461, 0x000b, 0x000a, 0x000b, 0x8074,
+	0x0000, 0x0501, 0x0000, 0x8010, 0x0008, 0x000c, 0x0008, 0x021b,
+	0x000c, 0x000a, 0x000b, 0xbbe0, 0x0009, 0x0030, 0x0008, 0x0db8,
+	0x0003, 0x18fe, 0x0000, 0x3ce0, 0x0009, 0x09b5, 0x0003, 0x15fe,
+	0x0008, 0x3ce0, 0x0009, 0x09b5, 0x0003, 0x020b, 0x0004, 0x8076,
+	0x0008, 0x0040, 0x0000, 0x0208, 0x000b, 0x8076, 0x0008, 0x0041,
+	0x0008, 0x0208, 0x000b, 0xbbe0, 0x0009, 0x0032, 0x0000, 0x0dbd,
+	0x0003, 0x3c1e, 0x0008, 0x0208, 0x000b, 0xbbe0, 0x0009, 0x003b,
+	0x0000, 0x0dc2, 0x000b, 0x3c20, 0x0000, 0x0208, 0x000b, 0xbbe0,
+	0x0009, 0x0035, 0x0008, 0x0dc8, 0x000b, 0x8072, 0x0000, 0x8000,
+	0x0000, 0x0384, 0x000b, 0xbbe0, 0x0009, 0x0036, 0x0008, 0x0aa5,
+	0x000b, 0xbbe0, 0x0009, 0x0037, 0x0000, 0x0de9, 0x000b, 0x18fe,
+	0x0000, 0x3ce0, 0x0009, 0x0db5, 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, 0x45e0, 0x000b, 0x0210, 0x0004, 0x8054,
+	0x0008, 0x0004, 0x0000, 0x8074, 0x0000, 0xf000, 0x0008, 0x8072,
+	0x0000, 0xb000, 0x0000, 0x019c, 0x0003, 0xbbe0, 0x0009, 0x0038,
+	0x0000, 0x0dfb, 0x000b, 0x18fe, 0x0000, 0x3ce0, 0x0009, 0x09f8,
+	0x0003, 0x15fe, 0x0008, 0x3ce0, 0x0009, 0x0db1, 0x0003, 0x020b,
+	0x0004, 0x8076, 0x0008, 0x0040, 0x0000, 0x8072, 0x0000, 0x8000,
+	0x0000, 0x0268, 0x000b, 0x8076, 0x0008, 0x0042, 0x0008, 0x0208,
+	0x000b, 0xbbe0, 0x0009, 0x0016, 0x0000, 0x0e08, 0x000b, 0x8074,
+	0x0000, 0x0808, 0x0008, 0x3a44, 0x0002, 0x0c0c, 0x000b, 0x8074,
+	0x0000, 0x0800, 0x0000, 0x8072, 0x0000, 0x8000, 0x0000, 0x8000,
+	0x000f, 0x000a, 0x000b, 0x8072, 0x0000, 0x8000, 0x0000, 0x000a,
+	0x000b, 0x3d30, 0x000a, 0x7f00, 0x0000, 0xbc80, 0x0001, 0x0007,
+	0x0000, 0x0214, 0x0003, 0x1930, 0x000a, 0x7f00, 0x0000, 0x9880,
+	0x0001, 0x0007, 0x0000, 0x8060, 0x0000, 0x0400, 0x0000, 0x7f62,
+	0x0008, 0x8066, 0x0000, 0x000a, 0x0008, 0x4619, 0x000b, 0x4000,
+	0x000f, 0x221e, 0x000b, 0x0870, 0x0008, 0x4000, 0x000f, 0x7e1b,
+	0x000b, 0xbbe0, 0x0009, 0x0030, 0x0008, 0x0e1b, 0x0003, 0x18fe,
+	0x0000, 0x3ce0, 0x0009, 0x0a2c, 0x0003, 0x15fe, 0x0008, 0x3ce0,
+	0x0009, 0x0a2c, 0x0003, 0x020b, 0x0004, 0x8076, 0x0008, 0x0040,
+	0x0000, 0x022e, 0x0003, 0x8076, 0x0008, 0x0041, 0x0008, 0x8072,
+	0x0000, 0x8000, 0x0000, 0x021b, 0x0003, 0xbac0, 0x0009, 0x0090,
+	0x0008, 0x0a37, 0x0003, 0x8074, 0x0000, 0x0706, 0x0000, 0x0239,
+	0x0003, 0x8074, 0x0000, 0x0703, 0x0000, 0x4000, 0x000f, 0x8010,
+	0x0008, 0x0023, 0x0000, 0x0276, 0x000b, 0x8010, 0x0008, 0x0008,
+	0x0000, 0x0276, 0x000b, 0x8010, 0x0008, 0x0022, 0x0008, 0x0276,
+	0x000b, 0x0210, 0x0004, 0x8010, 0x0008, 0x0007, 0x0000, 0x021b,
+	0x000c, 0x1810, 0x0000, 0x021b, 0x000c, 0x0282, 0x0003, 0x0210,
+	0x0004, 0x8010, 0x0008, 0x001b, 0x0008, 0x021b, 0x000c, 0x1810,
+	0x0000, 0x021b, 0x000c, 0x8074, 0x0000, 0xf080, 0x0000, 0x8072,
+	0x0000, 0x3000, 0x0008, 0x0d30, 0x0000, 0x000a, 0x000b, 0x8010,
+	0x0008, 0x0009, 0x0008, 0x0276, 0x000b, 0x8010, 0x0008, 0x0005,
+	0x0008, 0x0276, 0x000b, 0x1648, 0x000a, 0x0c6f, 0x000b, 0x808c,
+	0x0008, 0x0001, 0x0000, 0x8010, 0x0008, 0x0004, 0x0000, 0x4143,
+	0x000a, 0x086f, 0x0003, 0x3a44, 0x0002, 0x0c0a, 0x000b, 0x0d2a,
+	0x0008, 0x0276, 0x000b, 0x8010, 0x0008, 0x0003, 0x0008, 0x027a,
+	0x000b, 0x8010, 0x0008, 0x000b, 0x0000, 0x027a, 0x000b, 0x8010,
+	0x0008, 0x0002, 0x0000, 0x027a, 0x000b, 0x3a47, 0x0002, 0x0d40,
+	0x000b, 0x8010, 0x0008, 0x0006, 0x0008, 0x027a, 0x000b, 0x8074,
+	0x0000, 0xf000, 0x0008, 0x8072, 0x0000, 0x3000, 0x0008, 0x021b,
+	0x000c, 0x0231, 0x0004, 0x3a40, 0x000a, 0x080a, 0x0003, 0x8010,
+	0x0008, 0x000c, 0x0008, 0x021b, 0x000c, 0x000a, 0x000b, 0x8074,
+	0x0000, 0xf080, 0x0000, 0x8072, 0x0000, 0x3000, 0x0008, 0x0d30,
+	0x0000, 0x2e4d, 0x0002, 0x2e4d, 0x0002, 0x0a8d, 0x000b, 0x8054,
+	0x0008, 0x0019, 0x0000, 0x000a, 0x000b, 0x8054, 0x0008, 0x0009,
+	0x0008, 0x000a, 0x000b, 0x3a44, 0x0002, 0x0c0a, 0x000b, 0x026b,
+	0x000b, 0x808c, 0x0008, 0x0000, 0x0008, 0x4447, 0x0002, 0x0ab9,
+	0x0003, 0xc0c0, 0x0001, 0x00ff, 0x0008, 0xffe0, 0x0009, 0x00ff,
+	0x0008, 0x0e90, 0x0003, 0xc1e0, 0x0001, 0xffff, 0x0008, 0x0e90,
+	0x0003, 0x8010, 0x0008, 0x0013, 0x0000, 0x021b, 0x000c, 0x8074,
+	0x0000, 0x0202, 0x0008, 0x000a, 0x000b, 0x3a40, 0x000a, 0x0eb6,
+	0x000b, 0x8074, 0x0000, 0x0200, 0x0000, 0x3d00, 0x0000, 0x3cfe,
+	0x0000, 0x8072, 0x0000, 0x8000, 0x0000, 0x43e0, 0x0001, 0x0eb4,
+	0x0003, 0x42fe, 0x0000, 0xffc0, 0x0001, 0x00ff, 0x0008, 0x00e0,
+	0x0009, 0x0a90, 0x000b, 0x0d08, 0x0008, 0x0309, 0x000b, 0x8072,
+	0x0000, 0x8000, 0x0000, 0x000a, 0x000b, 0x038d, 0x0004, 0x808c,
+	0x0008, 0x0001, 0x0000, 0x04fe, 0x0008, 0x3370, 0x0003, 0x0460,
+	0x0000, 0x8062, 0x0008, 0x0001, 0x0000, 0x8066, 0x0000, 0x0009,
+	0x0008, 0x46c3, 0x0003, 0x0004, 0x0000, 0x80c0, 0x0009, 0x00ff,
+	0x0008, 0x7f00, 0x0000, 0x80e0, 0x0001, 0x0004, 0x0000, 0x0add,
+	0x000b, 0x80e0, 0x0001, 0x0005, 0x0008, 0x0add, 0x000b, 0x80e0,
+	0x0001, 0x0006, 0x0008, 0x0add, 0x000b, 0x82c0, 0x0001, 0xff00,
+	0x0008, 0x7f04, 0x0008, 0x82e0, 0x0009, 0x0600, 0x0008, 0x0add,
+	0x000b, 0x82e0, 0x0009, 0x0500, 0x0008, 0x0add, 0x000b, 0x82e0,
+	0x0009, 0x0400, 0x0000, 0x0f70, 0x0003, 0xc4c0, 0x0009, 0x7000,
+	0x0000, 0xffe0, 0x0009, 0x1000, 0x0000, 0x0b09, 0x0003, 0x037e,
+	0x0004, 0x3941, 0x0002, 0x0ae8, 0x000b, 0x8072, 0x0000, 0x0400,
+	0x0000, 0x000a, 0x000b, 0x0460, 0x0000, 0x80fe, 0x0008, 0x002b,
+	0x0008, 0x7f62, 0x0008, 0x8066, 0x0000, 0x2209, 0x0008, 0x46ee,
+	0x0003, 0x11fe, 0x0000, 0x3304, 0x0003, 0x9180, 0x0001, 0x0002,
+	0x0000, 0x8060, 0x0000, 0x0400, 0x0000, 0x7f62, 0x0008, 0x8066,
+	0x0000, 0x0609, 0x0008, 0x46f8, 0x000b, 0x42fe, 0x0000, 0xffc0,
+	0x0001, 0xff00, 0x0008, 0x03e0, 0x0009, 0x0f01, 0x0003, 0x8072,
+	0x0000, 0x0400, 0x0000, 0x0046, 0x0003, 0x9180, 0x0001, 0x0003,
+	0x0008, 0x02eb, 0x0003, 0x8072, 0x0000, 0x0400, 0x0000, 0x8010,
+	0x0008, 0x0010, 0x0000, 0x0361, 0x0003, 0x037e, 0x0004, 0x3941,
+	0x0002, 0x0b0f, 0x0003, 0x8072, 0x0000, 0x0400, 0x0000, 0x000a,
+	0x000b, 0x0346, 0x000c, 0x11fe, 0x0000, 0x0f17, 0x000b, 0x8072,
+	0x0000, 0x0400, 0x0000, 0x8010, 0x0008, 0x000e, 0x0000, 0x0361,
+	0x0003, 0x8060, 0x0000, 0x0400, 0x0000, 0x04fe, 0x0008, 0x0f2c,
+	0x0003, 0x808c, 0x0008, 0x0000, 0x0008, 0x9180, 0x0001, 0x0005,
+	0x0008, 0x7f62, 0x0008, 0x8066, 0x0000, 0x0009, 0x0008, 0x4722,
+	0x000b, 0x0060, 0x0008, 0x8062, 0x0008, 0x001b, 0x0008, 0x4304,
+	0x0008, 0x4206, 0x0008, 0x8066, 0x0000, 0x0412, 0x0000, 0x472a,
+	0x0003, 0x0343, 0x0003, 0x808c, 0x0008, 0x0001, 0x0000, 0x0460,
+	0x0000, 0x8062, 0x0008, 0x002b, 0x0008, 0x8066, 0x0000, 0x0609,
+	0x0008, 0x4733, 0x000b, 0x8066, 0x0000, 0x220a, 0x0008, 0x4736,
+	0x000b, 0x42fe, 0x0000, 0xffc0, 0x0001, 0xff00, 0x0008, 0x7f04,
+	0x0008, 0x8060, 0x0000, 0x0400, 0x0000, 0x9180, 0x0001, 0x0002,
+	0x0000, 0x7f62, 0x0008, 0x8066, 0x0000, 0x041a, 0x0008, 0x4742,
+	0x000b, 0x8072, 0x0000, 0x0400, 0x0000, 0x0046, 0x0003, 0x8060,
+	0x0000, 0x0400, 0x0000, 0x1362, 0x0008, 0x8066, 0x0000, 0x0411,
+	0x0000, 0x474b, 0x000b, 0x02fe, 0x0008, 0x03e0, 0x0009, 0x0f51,
+	0x0003, 0x0d22, 0x0000, 0x4000, 0x000f, 0x8280, 0x0009, 0x0002,
+	0x0000, 0x1380, 0x0001, 0x7f62, 0x0008, 0x8066, 0x0000, 0x2209,
+	0x0008, 0x4757, 0x0003, 0x0200, 0x000a, 0xffc0, 0x0001, 0x0007,
+	0x0000, 0x7f06, 0x0000, 0x1362, 0x0008, 0x8066, 0x0000, 0x060a,
+	0x0008, 0x475f, 0x000b, 0x4000, 0x000f, 0x3a44, 0x0002, 0x0c0a,
+	0x000b, 0x2f44, 0x000a, 0x2f44, 0x000a, 0x0e6b, 0x000b, 0x808a,
+	0x0008, 0x0003, 0x0008, 0x8074, 0x0000, 0xf080, 0x0000, 0x8072,
+	0x0000, 0x3000, 0x0008, 0x5b6c, 0x0003, 0x8054, 0x0008, 0x0019,
+	0x0000, 0x000a, 0x000b, 0x3a44, 0x0002, 0x0c0a, 0x000b, 0x808c,
+	0x0008, 0x0000, 0x0008, 0x8010, 0x0008, 0x0011, 0x0008, 0x021b,
+	0x000c, 0x42fe, 0x0000, 0xffc0, 0x0001, 0x00ff, 0x0008, 0x7f10,
+	0x0008, 0x021b, 0x000c, 0x4310, 0x0008, 0x027a, 0x000b, 0x3941,
+	0x0002, 0x0b81, 0x0003, 0x4000, 0x000f, 0x8072, 0x0000, 0x0404,
+	0x0008, 0x4000, 0x000f, 0x8010, 0x0008, 0x0012, 0x0008, 0x021b,
+	0x000c, 0x0346, 0x000c, 0x1110, 0x0000, 0x021b, 0x000c, 0x11fe,
+	0x0000, 0x0f87, 0x000b, 0x000a, 0x000b, 0xc2c0, 0x0009, 0x00ff,
+	0x0008, 0x7f00, 0x0000, 0xc3c0, 0x0001, 0xff00, 0x0008, 0x00d0,
+	0x0009, 0x0bb2, 0x0003, 0x0d0a, 0x0000, 0x8580, 0x0001, 0x1000,
+	0x0000, 0x7f62, 0x0008, 0x8060, 0x0000, 0x0400, 0x0000, 0x8066,
+	0x0000, 0x0809, 0x0000, 0x479c, 0x000b, 0x04fe, 0x0008, 0x33ab,
+	0x0003, 0x0460, 0x0000, 0x8062, 0x0008, 0x0004, 0x0000, 0x8066,
+	0x0000, 0x0211, 0x0000, 0x47a4, 0x0003, 0x01fe, 0x0008, 0x00e0,
+	0x0009, 0x0fab, 0x0003, 0x02fe, 0x0008, 0x43e0, 0x0001, 0x0bb1,
+	0x0003, 0x0500, 0x0002, 0x7f0a, 0x0000, 0xffe0, 0x0009, 0x0800,
+	0x0000, 0x0f95, 0x000b, 0x0d08, 0x0008, 0x4000, 0x000f, 0x43fe,
+	0x0008, 0x3e80, 0x0001, 0x0d60, 0x0000, 0x7f62, 0x0008, 0x8066,
+	0x0000, 0x0809, 0x0000, 0x47b8, 0x000b, 0x8060, 0x0000, 0x0400,
+	0x0000, 0x84c0, 0x0001, 0xff00, 0x0008, 0x7f60, 0x000a, 0x7f60,
+	0x000a, 0x7f60, 0x000a, 0x7f60, 0x000a, 0x7f60, 0x000a, 0x7f60,
+	0x000a, 0x7f60, 0x000a, 0x7f60, 0x000a, 0xff80, 0x0009, 0x1000,
+	0x0000, 0x7f62, 0x0008, 0x8066, 0x0000, 0x0809, 0x0000, 0x47ca,
+	0x000b, 0x4000, 0x000f, 0x57bb, 0xebe0, 0x0001, 0x0002, 0x0004,
+	0x0008, 0x0010, 0x0020, 0x0040, 0x0080, 0x0100, 0x0200, 0x0400,
+	0x0800, 0x1000, 0x2000, 0x4000, 0x8000, 0x2df1
 };
 #ifdef UNIQUE_FW_NAME
-unsigned short fw2300tpx_length01 = 0xcf5b;
+unsigned short fw2300ipx_length01 = 0xe666;
 #else
-unsigned short risc_code_length01 = 0xcf5b;
+unsigned short risc_code_length01 = 0xe666;
 #endif
 
--- diff/drivers/scsi/qla2xxx/qla_dbg.c	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/scsi/qla2xxx/qla_dbg.c	2004-02-09 10:39:55.000000000 +0000
@@ -73,7 +73,7 @@
 
 	/* Pause RISC. */
 	WRT_REG_WORD(&reg->hccr, HCCR_PAUSE_RISC); 
-	if (!IS_QLA2312(ha) && !IS_QLA2322(ha)) {
+	if (IS_QLA2300(ha)) {
 		for (cnt = 30000;
 		    (RD_REG_WORD(&reg->hccr) & HCCR_RISC_PAUSE) == 0 &&
 			rval == QLA_SUCCESS; cnt--) {
@@ -180,7 +180,7 @@
 		}
 	}
 
-	if (IS_QLA2312(ha) || IS_QLA2322(ha)) {
+	if (!IS_QLA2300(ha)) {
 		for (cnt = 30000; RD_MAILBOX_REG(ha, reg, 0) != 0 &&
 		    rval == QLA_SUCCESS; cnt--) {
 			if (cnt)
@@ -1070,18 +1070,6 @@
 	    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
@@ -1163,67 +1151,4 @@
 			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/drivers/scsi/qla2xxx/qla_dbg.h	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/scsi/qla2xxx/qla_dbg.h	2004-02-09 10:39:55.000000000 +0000
@@ -18,55 +18,6 @@
  ******************************************************************************/
 
 /*
- * 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 */
@@ -227,3 +178,54 @@
 #else
 #define DEBUG14(x)	do {} while (0)
 #endif
+
+/*
+ * 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];
+};
+
+
--- diff/drivers/scsi/qla2xxx/qla_def.h	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/scsi/qla2xxx/qla_def.h	2004-02-09 10:39:55.000000000 +0000
@@ -33,6 +33,14 @@
 #define PCI_DEVICE_ID_QLOGIC_ISP2322	0x2322
 #endif
 
+#ifndef PCI_DEVICE_ID_QLOGIC_ISP6312
+#define PCI_DEVICE_ID_QLOGIC_ISP6312	0x6312
+#endif
+
+#ifndef PCI_DEVICE_ID_QLOGIC_ISP6322
+#define PCI_DEVICE_ID_QLOGIC_ISP6322	0x6322
+#endif
+
 #if defined(CONFIG_SCSI_QLA21XX) || defined(CONFIG_SCSI_QLA21XX_MODULE)
 #define IS_QLA2100(ha)	((ha)->pdev->device == PCI_DEVICE_ID_QLOGIC_ISP2100)
 #else
@@ -45,22 +53,39 @@
 #define IS_QLA2200(ha)	0
 #endif
 
-#if defined(CONFIG_SCSI_QLA23XX) || defined(CONFIG_SCSI_QLA23XX_MODULE)
+#if defined(CONFIG_SCSI_QLA2300) || defined(CONFIG_SCSI_QLA2300_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
+#endif
+
+#if defined(CONFIG_SCSI_QLA2322) || defined(CONFIG_SCSI_QLA2322_MODULE)
+#define IS_QLA2322(ha)	((ha)->pdev->device == PCI_DEVICE_ID_QLOGIC_ISP2322)
+#else
 #define IS_QLA2322(ha)	0
-#define IS_QLA23XX(ha)	0
 #endif
 
+#if defined(CONFIG_SCSI_QLA6312) || defined(CONFIG_SCSI_QLA6312_MODULE)
+#define IS_QLA6312(ha)	((ha)->pdev->device == PCI_DEVICE_ID_QLOGIC_ISP6312)
+#else
+#define IS_QLA6312(ha)	0
+#endif
+
+#if defined(CONFIG_SCSI_QLA6322) || defined(CONFIG_SCSI_QLA6322_MODULE)
+#define IS_QLA6322(ha)	((ha)->pdev->device == PCI_DEVICE_ID_QLOGIC_ISP6322)
+#else
+#define IS_QLA6322(ha)	0
+#endif
+
+#define IS_QLA23XX(ha)	(IS_QLA2300(ha) || IS_QLA2312(ha) || IS_QLA2322(ha) || \
+    			 IS_QLA6312(ha) || IS_QLA6322(ha))
+
 /*
- * Only ISP23XX has extended addressing support in the firmware.
+ * Only non-ISP2[12]00 have extended addressing support in the firmware.
  */
-#define HAS_EXTENDED_IDS(ha)	IS_QLA23XX(ha)
+#define HAS_EXTENDED_IDS(ha)	(!IS_QLA2100(ha) && !IS_QLA2200(ha))
 
 /*
  * We have MAILBOX_REGISTER_COUNT sized arrays in a few places,
@@ -126,21 +151,12 @@
  * 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.
@@ -433,42 +449,43 @@
 	} 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 ISP_REQ_Q_IN(ha, reg) \
+	(IS_QLA2100(ha) || IS_QLA2200(ha) ? \
+	 &(reg)->u.isp2100.mailbox4 : \
+	 &(reg)->u.isp2300.req_q_in)
+#define ISP_REQ_Q_OUT(ha, reg) \
+	(IS_QLA2100(ha) || IS_QLA2200(ha) ? \
+	 &(reg)->u.isp2100.mailbox4 : \
+	 &(reg)->u.isp2300.req_q_out)
+#define ISP_RSP_Q_IN(ha, reg) \
+	(IS_QLA2100(ha) || IS_QLA2200(ha) ? \
+	 &(reg)->u.isp2100.mailbox5 : \
+	 &(reg)->u.isp2300.rsp_q_in)
+#define ISP_RSP_Q_OUT(ha, reg) \
+	(IS_QLA2100(ha) || IS_QLA2200(ha) ? \
+	 &(reg)->u.isp2100.mailbox5 : \
+	 &(reg)->u.isp2300.rsp_q_out)
 
 #define MAILBOX_REG(ha, reg, num) \
-	(IS_QLA23XX(ha) ? \
-	 &(reg)->u.isp2300.mailbox0 + (num) : \
-	 ((num < 8) ? \
+	(IS_QLA2100(ha) || IS_QLA2200(ha) ? \
+	 (num < 8 ? \
 	  &(reg)->u.isp2100.mailbox0 + (num) : \
-	  &(reg)->u_end.isp2200.mailbox8 + (num) - 8))	/* only for isp2200 */
+	  &(reg)->u_end.isp2200.mailbox8 + (num) - 8) : \
+	 &(reg)->u.isp2300.mailbox0 + (num))
 #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)
+	(IS_QLA2100(ha) || IS_QLA2200(ha) ? \
+	 &(reg)->fb_cmd_2100 : \
+	 &(reg)->u.isp2300.fb_cmd)
 #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 */
@@ -716,8 +733,8 @@
 	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. */
+	uint8_t node_name[WWN_SIZE];
+	uint8_t port_name[WWN_SIZE];
 	uint16_t execution_throttle;
 	uint16_t execution_count;
 	uint8_t reset_count;
@@ -1890,6 +1907,60 @@
 	} p;
 };
 
+/*
+ * SNS command structures -- for 2200 compatability.
+ */
+#define	RFT_ID_SNS_SCMD_LEN	22
+#define	RFT_ID_SNS_CMD_SIZE	60
+#define	RFT_ID_SNS_DATA_SIZE	16
+
+#define	RFF_ID_SNS_SCMD_LEN	8
+#define	RFF_ID_SNS_CMD_SIZE	32
+#define	RFF_ID_SNS_DATA_SIZE	16
+
+#define	RNN_ID_SNS_SCMD_LEN	10
+#define	RNN_ID_SNS_CMD_SIZE	36
+#define	RNN_ID_SNS_DATA_SIZE	16
+
+#define	GA_NXT_SNS_SCMD_LEN	6
+#define	GA_NXT_SNS_CMD_SIZE	28
+#define	GA_NXT_SNS_DATA_SIZE	(620 + 16)
+
+#define	GID_PT_SNS_SCMD_LEN	6
+#define	GID_PT_SNS_CMD_SIZE	28
+#define	GID_PT_SNS_DATA_SIZE	(MAX_FIBRE_DEVICES * 4 + 16)
+
+#define	GPN_ID_SNS_SCMD_LEN	6
+#define	GPN_ID_SNS_CMD_SIZE	28
+#define	GPN_ID_SNS_DATA_SIZE	(8 + 16)
+
+#define	GNN_ID_SNS_SCMD_LEN	6
+#define	GNN_ID_SNS_CMD_SIZE	28
+#define	GNN_ID_SNS_DATA_SIZE	(8 + 16)
+
+struct sns_cmd_pkt {
+	union {
+		struct {
+			uint16_t buffer_length;
+			uint16_t reserved_1;
+			uint32_t buffer_address[2];
+			uint16_t subcommand_length;
+			uint16_t reserved_2;
+			uint16_t subcommand;
+			uint16_t size;
+			uint32_t reserved_3;
+			uint8_t param[36];
+		} cmd;
+
+		uint8_t rft_data[RFT_ID_SNS_DATA_SIZE];
+		uint8_t rff_data[RFF_ID_SNS_DATA_SIZE];
+		uint8_t rnn_data[RNN_ID_SNS_DATA_SIZE];
+		uint8_t gan_data[GA_NXT_SNS_DATA_SIZE];
+		uint8_t gid_data[GID_PT_SNS_DATA_SIZE];
+		uint8_t gpn_data[GPN_ID_SNS_DATA_SIZE];
+		uint8_t gnn_data[GNN_ID_SNS_DATA_SIZE];
+	} p;
+};
 
 /* IO descriptors */
 #define MAX_IO_DESCRIPTORS	32
@@ -1919,12 +1990,6 @@
 	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
@@ -2102,6 +2167,8 @@
 	uint16_t	max_public_loop_ids;
 	uint16_t	min_external_loopid;	/* First external loop Id */
 
+	uint16_t	link_data_rate;		/* F/W operating speed */
+
 	uint8_t		current_topology;
 	uint8_t		prev_topology;
 #define ISP_CFG_NL	1
@@ -2115,9 +2182,6 @@
 #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;
@@ -2164,10 +2228,14 @@
 	uint8_t rscn_in_ptr;
 	uint8_t rscn_out_ptr;
 
+	/* SNS command interfaces. */
 	ms_iocb_entry_t		*ms_iocb;
 	dma_addr_t		ms_iocb_dma;
 	struct ct_sns_pkt	*ct_sns;
 	dma_addr_t		ct_sns_dma;
+	/* SNS command interfaces for 2200. */
+	struct sns_cmd_pkt	*sns_cmd;
+	dma_addr_t		sns_cmd_dma;
 
 	pid_t			dpc_pid;
 	int			dpc_should_die;
@@ -2194,26 +2262,13 @@
 
 	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
+#define MBX_INTERRUPT	1
+#define MBX_INTR_WAIT   2
 
 	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 */
+	struct semaphore mbx_cmd_sem;	/* Serialialize mbx access */
+	struct semaphore mbx_intr_sem;  /* Used for completion notification */
 
 	uint32_t	mbx_flags;
 #define  MBX_IN_PROGRESS	BIT_0
@@ -2257,21 +2312,14 @@
 
 	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];
+	uint16_t	product_id[4];
+
+	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;
+	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; 
--- diff/drivers/scsi/qla2xxx/qla_gbl.h	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/scsi/qla2xxx/qla_gbl.h	2004-02-09 10:39:55.000000000 +0000
@@ -103,6 +103,8 @@
 
 extern void qla2x00_blink_led(scsi_qla_host_t *);
 
+extern int qla2x00_down_timeout(struct semaphore *, unsigned long);
+
 /*
  * Global Function Prototypes in qla_iocb.c source file.
  */
@@ -217,11 +219,6 @@
 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);
 
@@ -239,10 +236,8 @@
 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.
@@ -275,17 +270,6 @@
 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.
@@ -294,7 +278,6 @@
 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 *);
--- diff/drivers/scsi/qla2xxx/qla_gs.c	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/scsi/qla2xxx/qla_gs.c	2004-02-09 10:39:55.000000000 +0000
@@ -20,17 +20,23 @@
 
 #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);
 
+static inline struct sns_cmd_pkt *
+qla2x00_prep_sns_cmd(scsi_qla_host_t *, uint16_t, uint16_t, uint16_t);
+
+static int qla2x00_sns_ga_nxt(scsi_qla_host_t *, fc_port_t *);
+static int qla2x00_sns_gid_pt(scsi_qla_host_t *, sw_info_t *);
+static int qla2x00_sns_gpn_id(scsi_qla_host_t *, sw_info_t *);
+static int qla2x00_sns_gnn_id(scsi_qla_host_t *, sw_info_t *);
+static int qla2x00_sns_rft_id(scsi_qla_host_t *);
+static int qla2x00_sns_rff_id(scsi_qla_host_t *);
+static int qla2x00_sns_rnn_id(scsi_qla_host_t *);
+
 /**
  * qla2x00_prep_ms_iocb() - Prepare common MS IOCB fields for SNS CT query.
  * @ha: HA context
@@ -90,6 +96,7 @@
 	return (ct_req);
 }
 
+
 /**
  * qla2x00_ga_nxt() - SNS scan for fabric devices via GA_NXT command.
  * @ha: HA context
@@ -106,6 +113,10 @@
 	struct ct_sns_req	*ct_req;
 	struct ct_sns_rsp	*ct_rsp;
 
+	if (IS_QLA2200(ha)) {
+		return (qla2x00_sns_ga_nxt(ha, fcport));
+	}
+
 	/* Issue GA_NXT */
 	/* Prepare common MS IOCB */
 	ms_pkt = qla2x00_prep_ms_iocb(ha, GA_NXT_REQ_SIZE, GA_NXT_RSP_SIZE);
@@ -190,6 +201,10 @@
 
 	struct ct_sns_gid_pt_data *gid_data;
 
+	if (IS_QLA2200(ha)) {
+		return (qla2x00_sns_gid_pt(ha, list));
+	}
+
 	gid_data = NULL;
 
 	/* Issue GID_PT */
@@ -235,7 +250,7 @@
 
 		/*
 		 * If we've used all available slots, then the switch is
-		 * reporting back more devices that we can handle with this
+		 * reporting back more devices than we can handle with this
 		 * single call.  Return a failed status, and let GA_NXT handle
 		 * the overload.
 		 */
@@ -263,6 +278,10 @@
 	struct ct_sns_req	*ct_req;
 	struct ct_sns_rsp	*ct_rsp;
 
+	if (IS_QLA2200(ha)) {
+		return (qla2x00_sns_gpn_id(ha, list));
+	}
+
 	for (i = 0; i < MAX_FIBRE_DEVICES; i++) {
 		/* Issue GPN_ID */
 		/* Prepare common MS IOCB */
@@ -308,7 +327,7 @@
 }
 
 /**
- * qla2x00_gnn_id() - SNS Get Node Name (GPN_ID) query.
+ * qla2x00_gnn_id() - SNS Get Node Name (GNN_ID) query.
  * @ha: HA context
  * @list: switch info entries to populate
  *
@@ -324,6 +343,10 @@
 	struct ct_sns_req	*ct_req;
 	struct ct_sns_rsp	*ct_rsp;
 
+	if (IS_QLA2200(ha)) {
+		return (qla2x00_sns_gnn_id(ha, list));
+	}
+
 	for (i = 0; i < MAX_FIBRE_DEVICES; i++) {
 		/* Issue GNN_ID */
 		/* Prepare common MS IOCB */
@@ -385,69 +408,6 @@
 }
 
 /**
- * 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
  *
@@ -462,6 +422,10 @@
 	struct ct_sns_req	*ct_req;
 	struct ct_sns_rsp	*ct_rsp;
 
+	if (IS_QLA2200(ha)) {
+		return (qla2x00_sns_rft_id(ha));
+	}
+
 	/* Issue RFT_ID */
 	/* Prepare common MS IOCB */
 	ms_pkt = qla2x00_prep_ms_iocb(ha, RFT_ID_REQ_SIZE, RFT_ID_RSP_SIZE);
@@ -477,7 +441,6 @@
 	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,
@@ -516,6 +479,10 @@
 	struct ct_sns_req	*ct_req;
 	struct ct_sns_rsp	*ct_rsp;
 
+	if (IS_QLA2200(ha)) {
+		return (qla2x00_sns_rff_id(ha));
+	}
+
 	/* Issue RFF_ID */
 	/* Prepare common MS IOCB */
 	ms_pkt = qla2x00_prep_ms_iocb(ha, RFF_ID_REQ_SIZE, RFF_ID_RSP_SIZE);
@@ -569,6 +536,10 @@
 	struct ct_sns_req	*ct_req;
 	struct ct_sns_rsp	*ct_rsp;
 
+	if (IS_QLA2200(ha)) {
+		return (qla2x00_sns_rnn_id(ha));
+	}
+
 	/* Issue RNN_ID */
 	/* Prepare common MS IOCB */
 	ms_pkt = qla2x00_prep_ms_iocb(ha, RNN_ID_REQ_SIZE, RNN_ID_RSP_SIZE);
@@ -624,6 +595,12 @@
 	struct ct_sns_req	*ct_req;
 	struct ct_sns_rsp	*ct_rsp;
 
+	if (IS_QLA2200(ha)) {
+		DEBUG2(printk("scsi(%ld): RSNN_ID call unsupported on "
+		    "ISP2200.\n", ha->host_no));
+		return (QLA_SUCCESS);
+	}
+
 	/* Issue RSNN_NN */
 	/* Prepare common MS IOCB */
 	/*   Request size adjusted after CT preparation */
@@ -679,3 +656,454 @@
 
 	return (rval);
 }
+
+
+/**
+ * qla2x00_prep_sns_cmd() - Prepare common SNS command request fields for query.
+ * @ha: HA context
+ * @cmd: GS command
+ * @scmd_len: Subcommand length
+ * @data_size: response size in bytes
+ *
+ * Returns a pointer to the @ha's sns_cmd.
+ */
+static inline struct sns_cmd_pkt *
+qla2x00_prep_sns_cmd(scsi_qla_host_t *ha, uint16_t cmd, uint16_t scmd_len,
+    uint16_t data_size)
+{
+	uint16_t		wc;
+	struct sns_cmd_pkt	*sns_cmd;
+
+	sns_cmd = ha->sns_cmd;
+	memset(sns_cmd, 0, sizeof(struct sns_cmd_pkt));
+	wc = data_size / 2;			/* Size in 16bit words. */
+	sns_cmd->p.cmd.buffer_length = cpu_to_le16(wc);
+	sns_cmd->p.cmd.buffer_address[0] = cpu_to_le32(LSD(ha->sns_cmd_dma));
+	sns_cmd->p.cmd.buffer_address[1] = cpu_to_le32(MSD(ha->sns_cmd_dma));
+	sns_cmd->p.cmd.subcommand_length = cpu_to_le16(scmd_len);
+	sns_cmd->p.cmd.subcommand = cpu_to_le16(cmd);
+	wc = (data_size - 16) / 4;		/* Size in 32bit words. */
+	sns_cmd->p.cmd.size = cpu_to_le16(wc);
+
+	return (sns_cmd);
+}
+
+/**
+ * qla2x00_sns_ga_nxt() - SNS scan for fabric devices via GA_NXT command.
+ * @ha: HA context
+ * @fcport: fcport entry to updated
+ *
+ * This command uses the old Exectute SNS Command mailbox routine.
+ *
+ * Returns 0 on success.
+ */
+static int
+qla2x00_sns_ga_nxt(scsi_qla_host_t *ha, fc_port_t *fcport)
+{
+	int		rval;
+
+	struct sns_cmd_pkt	*sns_cmd;
+
+	/* Issue GA_NXT. */
+	/* Prepare SNS command request. */
+	sns_cmd = qla2x00_prep_sns_cmd(ha, GA_NXT_CMD, GA_NXT_SNS_SCMD_LEN,
+	    GA_NXT_SNS_DATA_SIZE);
+
+	/* Prepare SNS command arguments -- port_id. */
+	sns_cmd->p.cmd.param[0] = fcport->d_id.b.al_pa;
+	sns_cmd->p.cmd.param[1] = fcport->d_id.b.area;
+	sns_cmd->p.cmd.param[2] = fcport->d_id.b.domain;
+
+	/* Execute SNS command. */
+	rval = qla2x00_send_sns(ha, ha->sns_cmd_dma, GA_NXT_SNS_CMD_SIZE / 2,
+	    sizeof(struct sns_cmd_pkt));
+	if (rval != QLA_SUCCESS) {
+		/*EMPTY*/
+		DEBUG2_3(printk("scsi(%ld): GA_NXT Send SNS failed (%d).\n",
+		    ha->host_no, rval));
+	} else if (sns_cmd->p.gan_data[8] != 0x80 ||
+	    sns_cmd->p.gan_data[9] != 0x02) {
+		DEBUG2_3(printk("scsi(%ld): GA_NXT failed, rejected request, "
+		    "ga_nxt_rsp:\n", ha->host_no));
+		DEBUG2_3(qla2x00_dump_buffer(sns_cmd->p.gan_data, 16));
+		rval = QLA_FUNCTION_FAILED;
+	} else {
+		/* Populate fc_port_t entry. */
+		fcport->d_id.b.domain = sns_cmd->p.gan_data[17];
+		fcport->d_id.b.area = sns_cmd->p.gan_data[18];
+		fcport->d_id.b.al_pa = sns_cmd->p.gan_data[19];
+
+		memcpy(fcport->node_name, &sns_cmd->p.gan_data[284], WWN_SIZE);
+		memcpy(fcport->port_name, &sns_cmd->p.gan_data[20], WWN_SIZE);
+
+		if (sns_cmd->p.gan_data[16] != NS_N_PORT_TYPE &&
+		    sns_cmd->p.gan_data[16] != 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_sns_gid_pt() - SNS scan for fabric devices via GID_PT command.
+ * @ha: HA context
+ * @list: switch info entries to populate
+ *
+ * This command uses the old Exectute SNS Command mailbox routine.
+ *
+ * NOTE: Non-Nx_Ports are not requested.
+ *
+ * Returns 0 on success.
+ */
+static int
+qla2x00_sns_gid_pt(scsi_qla_host_t *ha, sw_info_t *list)
+{
+	int		rval;
+
+	uint16_t	i;
+	uint8_t		*entry;
+	struct sns_cmd_pkt	*sns_cmd;
+
+	/* Issue GID_PT. */
+	/* Prepare SNS command request. */
+	sns_cmd = qla2x00_prep_sns_cmd(ha, GID_PT_CMD, GID_PT_SNS_SCMD_LEN,
+	    GID_PT_SNS_DATA_SIZE);
+
+	/* Prepare SNS command arguments -- port_type. */
+	sns_cmd->p.cmd.param[0] = NS_NX_PORT_TYPE;
+
+	/* Execute SNS command. */
+	rval = qla2x00_send_sns(ha, ha->sns_cmd_dma, GID_PT_SNS_CMD_SIZE / 2,
+	    sizeof(struct sns_cmd_pkt));
+	if (rval != QLA_SUCCESS) {
+		/*EMPTY*/
+		DEBUG2_3(printk("scsi(%ld): GID_PT Send SNS failed (%d).\n",
+		    ha->host_no, rval));
+	} else if (sns_cmd->p.gid_data[8] != 0x80 ||
+	    sns_cmd->p.gid_data[9] != 0x02) {
+		DEBUG2_3(printk("scsi(%ld): GID_PT failed, rejected request, "
+		    "gid_rsp:\n", ha->host_no));
+		DEBUG2_3(qla2x00_dump_buffer(sns_cmd->p.gid_data, 16));
+		rval = QLA_FUNCTION_FAILED;
+	} else {
+		/* Set port IDs in switch info list. */
+		for (i = 0; i < MAX_FIBRE_DEVICES; i++) {
+			entry = &sns_cmd->p.gid_data[(i * 4) + 16];
+			list[i].d_id.b.domain = entry[1];
+			list[i].d_id.b.area = entry[2];
+			list[i].d_id.b.al_pa = entry[3];
+
+			/* Last one exit. */
+			if (entry[0] & BIT_7) {
+				list[i].d_id.b.rsvd_1 = entry[0];
+				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_sns_gpn_id() - SNS Get Port Name (GPN_ID) query.
+ * @ha: HA context
+ * @list: switch info entries to populate
+ *
+ * This command uses the old Exectute SNS Command mailbox routine.
+ *
+ * Returns 0 on success.
+ */
+static int
+qla2x00_sns_gpn_id(scsi_qla_host_t *ha, sw_info_t *list)
+{
+	int		rval;
+
+	uint16_t	i;
+	struct sns_cmd_pkt	*sns_cmd;
+
+	for (i = 0; i < MAX_FIBRE_DEVICES; i++) {
+		/* Issue GPN_ID */
+		/* Prepare SNS command request. */
+		sns_cmd = qla2x00_prep_sns_cmd(ha, GPN_ID_CMD,
+		    GPN_ID_SNS_SCMD_LEN, GPN_ID_SNS_DATA_SIZE);
+
+		/* Prepare SNS command arguments -- port_id. */
+		sns_cmd->p.cmd.param[0] = list[i].d_id.b.al_pa;
+		sns_cmd->p.cmd.param[1] = list[i].d_id.b.area;
+		sns_cmd->p.cmd.param[2] = list[i].d_id.b.domain;
+
+		/* Execute SNS command. */
+		rval = qla2x00_send_sns(ha, ha->sns_cmd_dma,
+		    GPN_ID_SNS_CMD_SIZE / 2, sizeof(struct sns_cmd_pkt));
+		if (rval != QLA_SUCCESS) {
+			/*EMPTY*/
+			DEBUG2_3(printk("scsi(%ld): GPN_ID Send SNS failed "
+			    "(%d).\n", ha->host_no, rval));
+		} else if (sns_cmd->p.gpn_data[8] != 0x80 ||
+		    sns_cmd->p.gpn_data[9] != 0x02) {
+			DEBUG2_3(printk("scsi(%ld): GPN_ID failed, rejected "
+			    "request, gpn_rsp:\n", ha->host_no));
+			DEBUG2_3(qla2x00_dump_buffer(sns_cmd->p.gpn_data, 16));
+			rval = QLA_FUNCTION_FAILED;
+		} else {
+			/* Save portname */
+			memcpy(list[i].port_name, &sns_cmd->p.gpn_data[16],
+			    WWN_SIZE);
+		}
+
+		/* Last device exit. */
+		if (list[i].d_id.b.rsvd_1 != 0)
+			break;
+	}
+
+	return (rval);
+}
+
+/**
+ * qla2x00_sns_gnn_id() - SNS Get Node Name (GNN_ID) query.
+ * @ha: HA context
+ * @list: switch info entries to populate
+ *
+ * This command uses the old Exectute SNS Command mailbox routine.
+ *
+ * Returns 0 on success.
+ */
+static int
+qla2x00_sns_gnn_id(scsi_qla_host_t *ha, sw_info_t *list)
+{
+	int		rval;
+
+	uint16_t	i;
+	struct sns_cmd_pkt	*sns_cmd;
+
+	for (i = 0; i < MAX_FIBRE_DEVICES; i++) {
+		/* Issue GNN_ID */
+		/* Prepare SNS command request. */
+		sns_cmd = qla2x00_prep_sns_cmd(ha, GNN_ID_CMD,
+		    GNN_ID_SNS_SCMD_LEN, GNN_ID_SNS_DATA_SIZE);
+
+		/* Prepare SNS command arguments -- port_id. */
+		sns_cmd->p.cmd.param[0] = list[i].d_id.b.al_pa;
+		sns_cmd->p.cmd.param[1] = list[i].d_id.b.area;
+		sns_cmd->p.cmd.param[2] = list[i].d_id.b.domain;
+
+		/* Execute SNS command. */
+		rval = qla2x00_send_sns(ha, ha->sns_cmd_dma,
+		    GNN_ID_SNS_CMD_SIZE / 2, sizeof(struct sns_cmd_pkt));
+		if (rval != QLA_SUCCESS) {
+			/*EMPTY*/
+			DEBUG2_3(printk("scsi(%ld): GNN_ID Send SNS failed "
+			    "(%d).\n", ha->host_no, rval));
+		} else if (sns_cmd->p.gnn_data[8] != 0x80 ||
+		    sns_cmd->p.gnn_data[9] != 0x02) {
+			DEBUG2_3(printk("scsi(%ld): GNN_ID failed, rejected "
+			    "request, gnn_rsp:\n", ha->host_no));
+			DEBUG2_3(qla2x00_dump_buffer(sns_cmd->p.gnn_data, 16));
+			rval = QLA_FUNCTION_FAILED;
+		} else {
+			/* Save nodename */
+			memcpy(list[i].node_name, &sns_cmd->p.gnn_data[16],
+			    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_snd_rft_id() - SNS Register FC-4 TYPEs (RFT_ID) supported by the HBA.
+ * @ha: HA context
+ *
+ * This command uses the old Exectute SNS Command mailbox routine.
+ *
+ * Returns 0 on success.
+ */
+static int
+qla2x00_sns_rft_id(scsi_qla_host_t *ha)
+{
+	int		rval;
+
+	struct sns_cmd_pkt	*sns_cmd;
+
+	/* Issue RFT_ID. */
+	/* Prepare SNS command request. */
+	sns_cmd = qla2x00_prep_sns_cmd(ha, RFT_ID_CMD, RFT_ID_SNS_SCMD_LEN,
+	    RFT_ID_SNS_DATA_SIZE);
+
+	/* Prepare SNS command arguments -- port_id, FC-4 types */
+	sns_cmd->p.cmd.param[0] = ha->d_id.b.al_pa;
+	sns_cmd->p.cmd.param[1] = ha->d_id.b.area;
+	sns_cmd->p.cmd.param[2] = ha->d_id.b.domain;
+
+	sns_cmd->p.cmd.param[5] = 0x01;			/* FCP-3 */
+
+	/* Execute SNS command. */
+	rval = qla2x00_send_sns(ha, ha->sns_cmd_dma, RFT_ID_SNS_CMD_SIZE / 2,
+	    sizeof(struct sns_cmd_pkt));
+	if (rval != QLA_SUCCESS) {
+		/*EMPTY*/
+		DEBUG2_3(printk("scsi(%ld): RFT_ID Send SNS failed (%d).\n",
+		    ha->host_no, rval));
+	} else if (sns_cmd->p.rft_data[8] != 0x80 ||
+	    sns_cmd->p.rft_data[9] != 0x02) {
+		DEBUG2_3(printk("scsi(%ld): RFT_ID failed, rejected request, "
+		    "rft_rsp:\n", ha->host_no));
+		DEBUG2_3(qla2x00_dump_buffer(sns_cmd->p.rft_data, 16));
+		rval = QLA_FUNCTION_FAILED;
+	} else {
+		DEBUG2(printk("scsi(%ld): RFT_ID exiting normally.\n",
+		    ha->host_no));
+	}
+
+	return (rval);
+}
+
+/**
+ * qla2x00_sns_rff_id() - SNS Register FC-4 Features (RFF_ID) supported by the
+ * HBA.
+ * @ha: HA context
+ *
+ * This command uses the old Exectute SNS Command mailbox routine.
+ *
+ * Returns 0 on success.
+ */
+static int
+qla2x00_sns_rff_id(scsi_qla_host_t *ha)
+{
+	int		rval;
+
+	struct sns_cmd_pkt	*sns_cmd;
+
+	/* Issue RFF_ID. */
+	/* Prepare SNS command request. */
+	sns_cmd = qla2x00_prep_sns_cmd(ha, RFF_ID_CMD, RFF_ID_SNS_SCMD_LEN,
+	    RFF_ID_SNS_DATA_SIZE);
+
+	/* Prepare SNS command arguments -- port_id, FC-4 feature, FC-4 type */
+	sns_cmd->p.cmd.param[0] = ha->d_id.b.al_pa;
+	sns_cmd->p.cmd.param[1] = ha->d_id.b.area;
+	sns_cmd->p.cmd.param[2] = ha->d_id.b.domain;
+
+	sns_cmd->p.cmd.param[6] = 0x08;			/* SCSI - FCP */
+
+	/* Execute SNS command. */
+	rval = qla2x00_send_sns(ha, ha->sns_cmd_dma, RFF_ID_SNS_CMD_SIZE / 2,
+	    sizeof(struct sns_cmd_pkt));
+	if (rval != QLA_SUCCESS) {
+		/*EMPTY*/
+		DEBUG2_3(printk("scsi(%ld): RFF_ID Send SNS failed (%d).\n",
+		    ha->host_no, rval));
+	} else if (sns_cmd->p.rff_data[8] != 0x80 ||
+	    sns_cmd->p.rff_data[9] != 0x02) {
+		DEBUG2_3(printk("scsi(%ld): RFF_ID failed, rejected request, "
+		    "rff_rsp:\n", ha->host_no));
+		DEBUG2_3(qla2x00_dump_buffer(sns_cmd->p.rff_data, 16));
+		rval = QLA_FUNCTION_FAILED;
+	} else {
+		DEBUG2(printk("scsi(%ld): RFF_ID exiting normally.\n",
+		    ha->host_no));
+	}
+
+	return (rval);
+}
+
+/**
+ * qla2x00_sns_rnn_id() - SNS Register Node Name (RNN_ID) of the HBA.
+ * HBA.
+ * @ha: HA context
+ *
+ * This command uses the old Exectute SNS Command mailbox routine.
+ *
+ * Returns 0 on success.
+ */
+static int
+qla2x00_sns_rnn_id(scsi_qla_host_t *ha)
+{
+	int		rval;
+
+	struct sns_cmd_pkt	*sns_cmd;
+
+	/* Issue RNN_ID. */
+	/* Prepare SNS command request. */
+	sns_cmd = qla2x00_prep_sns_cmd(ha, RNN_ID_CMD, RNN_ID_SNS_SCMD_LEN,
+	    RNN_ID_SNS_DATA_SIZE);
+
+	/* Prepare SNS command arguments -- port_id, nodename. */
+	sns_cmd->p.cmd.param[0] = ha->d_id.b.al_pa;
+	sns_cmd->p.cmd.param[1] = ha->d_id.b.area;
+	sns_cmd->p.cmd.param[2] = ha->d_id.b.domain;
+
+	sns_cmd->p.cmd.param[4] = ha->init_cb->node_name[7];
+	sns_cmd->p.cmd.param[5] = ha->init_cb->node_name[6];
+	sns_cmd->p.cmd.param[6] = ha->init_cb->node_name[5];
+	sns_cmd->p.cmd.param[7] = ha->init_cb->node_name[4];
+	sns_cmd->p.cmd.param[8] = ha->init_cb->node_name[3];
+	sns_cmd->p.cmd.param[9] = ha->init_cb->node_name[2];
+	sns_cmd->p.cmd.param[10] = ha->init_cb->node_name[1];
+	sns_cmd->p.cmd.param[11] = ha->init_cb->node_name[0];
+
+	/* Execute SNS command. */
+	rval = qla2x00_send_sns(ha, ha->sns_cmd_dma, RNN_ID_SNS_CMD_SIZE / 2,
+	    sizeof(struct sns_cmd_pkt));
+	if (rval != QLA_SUCCESS) {
+		/*EMPTY*/
+		DEBUG2_3(printk("scsi(%ld): RNN_ID Send SNS failed (%d).\n",
+		    ha->host_no, rval));
+	} else if (sns_cmd->p.rnn_data[8] != 0x80 ||
+	    sns_cmd->p.rnn_data[9] != 0x02) {
+		DEBUG2_3(printk("scsi(%ld): RNN_ID failed, rejected request, "
+		    "rnn_rsp:\n", ha->host_no));
+		DEBUG2_3(qla2x00_dump_buffer(sns_cmd->p.rnn_data, 16));
+		rval = QLA_FUNCTION_FAILED;
+	} else {
+		DEBUG2(printk("scsi(%ld): RNN_ID exiting normally.\n",
+		    ha->host_no));
+	}
+
+	return (rval);
+}
--- diff/drivers/scsi/qla2xxx/qla_init.c	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/scsi/qla2xxx/qla_init.c	2004-02-09 10:39:55.000000000 +0000
@@ -65,10 +65,13 @@
 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 void qla2x00_get_lun_mask_from_config(scsi_qla_host_t *, fc_port_t *,
+    uint16_t, uint16_t);
 static int qla2x00_get_prop_16chars(scsi_qla_host_t *,
     char *, char *, char *);
 static void qla2x00_get_properties(scsi_qla_host_t *, char *);
@@ -148,6 +151,7 @@
 	 */
 	if (ql2xdevconf) {
 		ha->cmdline = ql2xdevconf;
+		qla2x00_get_properties(ha, ql2xdevconf);
 	}
 #endif
 
@@ -166,13 +170,6 @@
 			}
 		}
 
-		/* 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:
@@ -226,6 +223,11 @@
 	} while (restart_risc && retry--);
 
 	if (isp_init) {
+		/* Retrieve firmware information */
+		qla2x00_get_fw_version(ha, &ha->fw_major_version,
+		    &ha->fw_minor_version, &ha->fw_subminor_version,
+		    &ha->fw_attributes);
+
 		clear_bit(RESET_MARKER_NEEDED, &ha->dpc_flags);
 		ha->marker_needed = 1;
 		qla2x00_marker(ha, 0, 0, MK_SYNC_ALL);
@@ -282,11 +284,11 @@
 	ha->pci_attr = RD_REG_WORD(&ha->iobase->ctrl_status);
 	spin_unlock_irqrestore(&ha->hardware_lock, flags);
 
-	if (IS_QLA23XX(ha)) {
+	if (!IS_QLA2100(ha) && !IS_QLA2200(ha)) {
 		pci_write_config_byte(ha->pdev, PCI_LATENCY_TIMER, 0x80);
 
 		/* PCI Specification Revision 2.3 changes */
-		if (IS_QLA2322(ha))
+		if (IS_QLA2322(ha) || IS_QLA6322(ha))
 			/* Command Register - Reset Interrupt Disable. */
 			w &= ~BIT_10;
 
@@ -406,7 +408,7 @@
 	if (!IS_QLA2100(ha)) {
 		/* Pause RISC. */
 		WRT_REG_WORD(&reg->hccr, HCCR_PAUSE_RISC);
-		if (!IS_QLA2312(ha) && !IS_QLA2322(ha)) {
+		if (IS_QLA2200(ha) || IS_QLA2300(ha)) {
 			for (cnt = 0; cnt < 30000; cnt++) {
 				if ((RD_REG_WORD(&reg->hccr) &
 				    HCCR_RISC_PAUSE) != 0)
@@ -424,7 +426,7 @@
 		WRT_REG_WORD(&reg->fpm_diag_config, 0x100);
 
 		/* Toggle Fpm Reset. */
-		if (IS_QLA23XX(ha))
+		if (!IS_QLA2200(ha))
 			WRT_REG_WORD(&reg->fpm_diag_config, 0x0);
 
 		/* Select frame buffer registers. */
@@ -461,9 +463,7 @@
 	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 {
+	if (IS_QLA2100(ha) || IS_QLA2200(ha) || IS_QLA2300(ha)) {
 		/*
 		 * It is necessary to for a delay here since the card doesn't
 		 * respond to PCI reads during a reset. On some architectures
@@ -476,7 +476,8 @@
 				break;
 			udelay(100);
 		}
-	}
+	} else
+		udelay(10);
 
 	/* Reset RISC processor. */
 	WRT_REG_WORD(&reg->hccr, HCCR_RESET_RISC);
@@ -487,9 +488,7 @@
 	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 {
+	if (IS_QLA2100(ha) || IS_QLA2200(ha) || IS_QLA2300(ha)) {
 		for (cnt = 0; cnt < 30000; cnt++) {
 			if (!(test_bit(ABORT_ISP_ACTIVE, &ha->dpc_flags)))
 				spin_lock_irqsave(&ha->mbx_reg_lock, mbx_flags);
@@ -508,7 +507,8 @@
 
 			udelay(100);
 		}
-	}
+	} else
+		udelay(100);
 
 	/* Turn on master enable */
 	cmd |= PCI_COMMAND_MASTER;
@@ -570,16 +570,15 @@
 	WRT_REG_WORD(&reg->hccr, HCCR_RELEASE_RISC);
 
 	/* Workaround for QLA2312 PCI parity error */
-	if (IS_QLA2312(ha) || IS_QLA2322(ha))
-		udelay(10);
-	else {
+	if (IS_QLA2100(ha) || IS_QLA2200(ha) || IS_QLA2300(ha)) {
 		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(); 
 		}
-	}
+	} else
+		udelay(10);
 
 	if (!cnt)
 		goto chip_diag_failed;
@@ -590,7 +589,7 @@
 	mb[1] = RD_MAILBOX_REG(ha, reg, 1);
 	mb[2] = RD_MAILBOX_REG(ha, reg, 2);
 	mb[3] = RD_MAILBOX_REG(ha, reg, 3);
-
+	mb[4] = qla2x00_debounce_register(MAILBOX_REG(ha, reg, 4));
 	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,
@@ -598,6 +597,10 @@
 
 		goto chip_diag_failed;
 	}
+	ha->product_id[0] = mb[1];
+	ha->product_id[1] = mb[2];
+	ha->product_id[2] = mb[3];
+	ha->product_id[3] = mb[4];
 
 	/* Adjust fw RISC transfer size */
 	ha->fw_transfer_size = REQUEST_ENTRY_SIZE * REQUEST_ENTRY_CNT;
@@ -687,12 +690,6 @@
 			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);
@@ -1106,7 +1103,7 @@
 
 	/* Determine NVRAM starting address. */
 	ha->nvram_base = 0;
-	if (IS_QLA2312(ha) || IS_QLA2322(ha))
+	if (!IS_QLA2100(ha) && !IS_QLA2200(ha) && !IS_QLA2300(ha))
 		if ((RD_REG_WORD(&reg->ctrl_status) >> 14) == 1)
 			ha->nvram_base = 0x80;
 
@@ -1218,7 +1215,7 @@
 			} else {
 				strcpy(ha->model_number, "QLA2300");
 			}
-		} else if (IS_QLA2312(ha) || IS_QLA2322(ha)) {
+		} else {
 			if (rval == 0 &&
 			    memcmp(nv->model_number, BINZERO,
 				    sizeof(nv->model_number)) != 0) {
@@ -1229,7 +1226,7 @@
 				st = en = ha->model_number;
 				en += sizeof(nv->model_number) - 1;
 				while (en > st) {
-					if (*en != 0x20)
+					if (*en != 0x20 && *en != 0x00)
 						break;
 					*en-- = '\0';
 				}
@@ -1246,8 +1243,6 @@
 					strcpy(ha->model_number, "QLA23xx");
 				}
 			}
-		} else {
-			strcpy(ha->model_number, "QLA23xx");
 		}
 	} else if (IS_QLA2200(ha)) {
 		nv->firmware_options[0] |= BIT_2;
@@ -1287,6 +1282,9 @@
 	ha->nvram_version = nv->nvram_version;
 
 	ha->flags.disable_risc_code_load = ((nv->host_p[0] & BIT_4) ? 1 : 0);
+	/* Always load RISC code on non ISP2[12]00 chips. */
+	if (!IS_QLA2100(ha) && !IS_QLA2200(ha))
+		ha->flags.disable_risc_code_load = 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);
@@ -1318,14 +1316,8 @@
 	/* 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->login_timeout * ha->retry_count) + nv->port_down_retry_count;
 	ha->loop_reset_delay = nv->reset_delay;
 
 	/* Will get the value from NVRAM. */
@@ -1350,28 +1342,15 @@
 		    (LOOP_DOWN_TIME - ha->link_down_timeout);
 	} 
 
+	ha->max_luns = MAX_LUNS;
 	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.
 	 */
+	ha->port_down_retry_count = nv->port_down_retry_count;
 	if (qlport_down_retry)
 		ha->port_down_retry_count = qlport_down_retry;
 	/* Set login_retry_count */
@@ -1414,7 +1393,7 @@
 		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->add_firmware_options[0] |= BIT_2;
 		icb->response_accumulation_timer = 3;
 		icb->interrupt_delay_timer = 5;
 
@@ -1426,7 +1405,7 @@
 		 *    ~(BIT_3 | BIT_2 | BIT_1 | BIT_0);
 		 * icb->add_firmware_options[0] |= (BIT_2 | BIT_0);
 		 */
-		timer_mode  = icb->add_firmware_options[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 "
@@ -1445,9 +1424,6 @@
 		DEBUG2_3(printk(KERN_WARNING
 		    "scsi(%ld): NVRAM configuration failed!\n", ha->host_no));
 	}
-
-	LEAVE(__func__);
-
 	return (rval);
 }
 
@@ -1466,12 +1442,8 @@
 {
 	uint32_t t;
 
-	ENTER(__func__);
-
 	for (t = 0; t < MAX_TARGETS; t++)
 		TGT_Q(ha, t) = (os_tgt_t *)NULL;
-
-	LEAVE(__func__);
 }
 
 /**
@@ -1856,7 +1828,7 @@
 	    PORT_RETRY_TIME;
 	atomic_set(&fcport->port_down_timer, ha->port_down_retry_count *
 	    PORT_RETRY_TIME);
-	fcport->flags &= ~(FCF_LOGIN_NEEDED);
+	fcport->flags &= ~FCF_LOGIN_NEEDED;
 
 	/*
 	 * Check for outstanding cmd on tape Bypass LUN discovery if active
@@ -2323,6 +2295,7 @@
 	int	rval, rval2;
 	fc_port_t	*fcport, *fcptemp;
 	uint16_t	next_loopid;
+	uint16_t	mb[MAILBOX_REGISTER_COUNT];
 	LIST_HEAD(new_fcports);
 
 	/* If FL port exists, then SNS is present */
@@ -2342,6 +2315,17 @@
 		return (QLA_SUCCESS);
 	}
 	do {
+		/* Ensure we are logged into the SNS. */
+		qla2x00_login_fabric(ha, SIMPLE_NAME_SERVER, 0xff, 0xff, 0xfc,
+		    mb, BIT_0);
+		if (mb[0] != MBS_COMMAND_COMPLETE) {
+			qla_printk(KERN_INFO, ha,
+			    "Failed SNS login: loop_id=%x mb[0]=%x mb[1]=%x "
+			    "mb[2]=%x mb[6]=%x mb[7]=%x\n", SIMPLE_NAME_SERVER,
+			    mb[0], mb[1], mb[2], mb[6], mb[7]);
+			return (QLA_FUNCTION_FAILED);
+		}
+
 		if (test_and_clear_bit(REGISTER_FC4_NEEDED, &ha->dpc_flags)) {
 			if (qla2x00_rft_id(ha)) {
 				/* EMPTY */
@@ -2811,7 +2795,9 @@
 
 		switch (format) {
 		case 0:
-			if (IS_QLA23XX(ha) && ha->flags.init_done) {
+			if (!IS_QLA2100(ha) && !IS_QLA2200(ha) &&
+			    !IS_QLA6312(ha) && !IS_QLA6322(ha) &&
+			    ha->flags.init_done) {
 				/* Handle port RSCN via asyncronous IOCBs */
 				rval2 = qla2x00_handle_port_rscn(ha, rscn_entry,
 				    NULL, 0);
@@ -2836,7 +2822,7 @@
 		rval = QLA_SUCCESS;
 
 		/* Abort any outstanding IO descriptors. */
-		if (IS_QLA23XX(ha))
+		if (!IS_QLA2100(ha) && !IS_QLA2200(ha))
 			qla2x00_cancel_io_descriptors(ha);
 
 		list_for_each_entry(fcport, &ha->fcports, list) {
@@ -3128,13 +3114,9 @@
 	struct list_head *list, *temp;
 	unsigned long flags = 0;
 
-	ENTER(__func__);
-
 	clear_bit(RESTART_QUEUES_NEEDED, &ha->dpc_flags);
 
-	/*
-	 * start pending queue
-	 */
+	/* start pending queue */
 	pending_q_cnt = ha->qthreads;
 	if (flush) {
 		spin_lock_irqsave(&ha->list_lock,flags);
@@ -3188,8 +3170,6 @@
 
 	if (!list_empty(&ha->done_queue))
 		qla2x00_done(ha);
-
-	LEAVE(__func__);
 }
 
 //FIXME - Document
@@ -3307,12 +3287,12 @@
 
 	/* TODO: honor the ConfigRequired flag */
 	if (tgt == MAX_TARGETS) {
-		/* Check if targetID 0 available. */
-		tgt = 0;
+		/* Check if targetID 1 available. */
+		tgt = 1;
 
 		if (TGT_Q(ha, tgt) != NULL) {
 			/* Locate first free target for device. */
-			for (tgt = 0; tgt < MAX_TARGETS; tgt++) {
+			for (tgt = 1; tgt < MAX_TARGETS; tgt++) {
 				if (TGT_Q(ha, tgt) == NULL) {
 					break;
 				}
@@ -3344,6 +3324,9 @@
 		tq->flags |= TQF_ONLINE;
 		tq->port_down_retry_count = ha->port_down_retry_count;
 
+#if 0
+		qla2x00_get_lun_mask_from_config(ha, fcport, tgt, 0);
+#endif
 	}
 
 	if (tgt == MAX_TARGETS) {
@@ -3587,6 +3570,52 @@
 }
 
 
+#if 0
+/*
+ * qla2x00_get_lun_mask_from_config
+ *      Get lun mask from the configuration parameters.
+ *      Bit order is little endian.
+ *
+ * Input:
+ * ha  -- Host adapter
+ * tgt  -- target/device number
+ * port -- pointer to port
+ */
+static void
+qla2x00_get_lun_mask_from_config(scsi_qla_host_t *ha,
+    fc_port_t *fcport, uint16_t tgt, uint16_t dev_no) 
+{
+	char		propbuf[60]; /* size of search string */
+	int		rval, lun, bit;
+	lun_bit_mask_t	lun_mask, *mask_ptr = &lun_mask;
+
+	/* Get "target-N-device-N-lun-mask" as a 256 bit lun_mask*/
+	sprintf(propbuf, "scsi-qla%ld-tgt-%d-di-%d-lun-disabled",
+	    ha->instance, tgt, dev_no);
+
+	rval = qla2x00_get_prop_xstr(ha, propbuf,
+	    (uint8_t *)&lun_mask, sizeof(lun_bit_mask_t));
+	if (rval == sizeof(lun_bit_mask_t)) {
+		memset(&fcport->lun_mask, 0, sizeof(lun_bit_mask_t));
+		for (lun = 8 * sizeof(lun_bit_mask_t) - 1, bit = 0;
+		    lun >= 0; lun--, bit++) {
+			if (EXT_IS_LUN_BIT_SET(mask_ptr, lun))
+				EXT_SET_LUN_BIT((&fcport->lun_mask), bit);
+		}
+
+		DEBUG3(printk("scsi(%ld): returning lun mask for fcport "
+		    "%02x%02x%02x%02x%02x%02x%02x%02x:\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]));
+		DEBUG3(qla2x00_dump_buffer((uint8_t *)&fcport->lun_mask,
+		    sizeof(lun_bit_mask_t));)
+	}
+}
+#endif
+
 /*
  * qla2x00_bstr_to_hex
  *	Convert hex byte string to number.
@@ -3670,7 +3699,6 @@
 		propstr++;   /* ignore equal sign */
 
 	if (rval == 0) {  /* not found */
-		LEAVE(__func__);
 		return (-1);
 	}
 
@@ -4035,8 +4063,6 @@
 	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);
@@ -4176,7 +4202,7 @@
 	if (qla2x00_isp_firmware(ha)) {
 		ha->flags.online = FALSE;
 		if (!(status = qla2x00_chip_diag(ha))) {
-			if (!IS_QLA23XX(ha)) {
+			if (IS_QLA2100(ha) || IS_QLA2200(ha)) {
 				status = qla2x00_setup_chip(ha);
 				goto done;
 			}
@@ -4192,14 +4218,14 @@
 			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
+ 			if (IS_QLA2300(ha))
  				/* SRAM parity */
  				WRT_REG_WORD(&reg->hccr,
  				    (HCCR_ENABLE_PARITY + 0x1));
+ 			else
+ 				/* SRAM, Instruction RAM and GP RAM parity */
+ 				WRT_REG_WORD(&reg->hccr,
+ 				    (HCCR_ENABLE_PARITY + 0x7));
 
 			spin_unlock_irqrestore(&ha->hardware_lock, flags);
 		}
@@ -4246,8 +4272,6 @@
 	unsigned long flags = 0;
 	device_reg_t *reg = ha->iobase;
 
-	ENTER(__func__);
-
 	ha->flags.online = FALSE;
 	qla2x00_disable_intrs(ha);
 	/* Reset RISC processor. */
@@ -4255,6 +4279,4 @@
 	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/drivers/scsi/qla2xxx/qla_iocb.c	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/scsi/qla2xxx/qla_iocb.c	2004-02-09 10:39:55.000000000 +0000
@@ -527,8 +527,6 @@
 {
 	mrk_entry_t	*pkt;
 
-	ENTER(__func__);
-
 	pkt = (mrk_entry_t *)qla2x00_req_pkt(ha);
 	if (pkt == NULL) {
 		DEBUG2_3(printk("%s(): **** FAILED ****\n", __func__));
@@ -547,8 +545,6 @@
 	/* Issue command to ISP */
 	qla2x00_isp_cmd(ha);
 
-	LEAVE(__func__);
-
 	return (QLA_SUCCESS);
 }
 
@@ -584,8 +580,6 @@
 	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) {
@@ -632,8 +626,6 @@
 		DEBUG2_3(printk("%s(): **** FAILED ****\n", __func__));
 	}
 
-	LEAVE(__func__);
-
 	return (pkt);
 }
 
@@ -658,8 +650,6 @@
 	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) {
@@ -730,8 +720,6 @@
 		DEBUG2_3(printk("%s(): **** FAILED ****\n", __func__));
 	}
 
-	LEAVE(__func__);
-
 	return (pkt);
 }
 
--- diff/drivers/scsi/qla2xxx/qla_isr.c	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/scsi/qla2xxx/qla_isr.c	2004-02-09 10:39:55.000000000 +0000
@@ -21,12 +21,6 @@
 
 #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);
@@ -289,10 +283,13 @@
 	switch (mb[0]) {
 	case MBA_SCSI_COMPLETION:
 		if (IS_QLA2100(ha) || IS_QLA2200(ha))
-			handles[0] = RD_MAILBOX_REG(ha, reg, 1);
+			handles[0] = le32_to_cpu(
+			    ((uint32_t)(RD_MAILBOX_REG(ha, reg, 2) << 16)) |
+			    RD_MAILBOX_REG(ha, reg, 1));
 		else
-			handles[0] = MSW(mbx);
-		handles[0] |= (uint32_t)(RD_MAILBOX_REG(ha, reg, 2) << 16);
+			handles[0] = le32_to_cpu(
+			    ((uint32_t)(RD_MAILBOX_REG(ha, reg, 2) << 16)) |
+			    MSW(mbx));
 		handle_cnt = 1;
 		break;
 	case MBA_CMPLT_1_16BIT:
@@ -334,9 +331,11 @@
 		mb[0] = MBA_SCSI_COMPLETION;
 		break;
 	case MBA_CMPLT_2_32BIT:
-		handles[0] = (uint32_t)((RD_MAILBOX_REG(ha, reg, 2) << 16) |
+		handles[0] = le32_to_cpu(
+		    ((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) |
+		handles[1] = le32_to_cpu(
+		    ((uint32_t)(RD_MAILBOX_REG(ha, reg, 7) << 16)) |
 		    RD_MAILBOX_REG(ha, reg, 6));
 		handle_cnt = 2;
 		mb[0] = MBA_SCSI_COMPLETION;
@@ -424,15 +423,14 @@
 	case MBA_LOOP_UP:		/* Loop Up Event */
 		mb[1] = RD_MAILBOX_REG(ha, reg, 1);
 
-		ha->current_speed = EXT_DEF_PORTSPEED_1GBIT;
+		ha->link_data_rate = 0;
 		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;
+			ha->link_data_rate = mb[1];
 		}
 
 		DEBUG2(printk("scsi(%ld): Asynchronous LOOP UP (%s Gbps).\n",
@@ -458,7 +456,7 @@
 		}
 
 		ha->flags.management_server_logged_in = 0;
-		ha->current_speed = 0; /* reset value */
+		ha->link_data_rate = 0;
 
 		/* Update AEN queue. */
 		qla2x00_enqueue_aen(ha, MBA_LOOP_DOWN, NULL);
@@ -547,7 +545,8 @@
 		 * 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 &&
+		if (!IS_QLA2100(ha) && !IS_QLA2200(ha) && !IS_QLA6312(ha) &&
+		    !IS_QLA6322(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)) {
@@ -775,7 +774,8 @@
 			qla2x00_ms_entry(ha, (ms_iocb_entry_t *)pkt);
 			break;
 		case MBX_IOCB_TYPE:
-			if (IS_QLA23XX(ha)) {
+			if (!IS_QLA2100(ha) && !IS_QLA2200(ha) &&
+			    !IS_QLA6312(ha) && !IS_QLA6322(ha)) {
 				if (pkt->sys_define == SOURCE_ASYNC_IOCB) {
 					qla2x00_process_iodesc(ha,
 					    (struct mbx_entry *)pkt);
--- diff/drivers/scsi/qla2xxx/qla_mbx.c	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/scsi/qla2xxx/qla_mbx.c	2004-02-09 10:39:55.000000000 +0000
@@ -21,33 +21,6 @@
 
 #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)
@@ -64,281 +37,6 @@
 }
 
 /*
- *  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.
  *
@@ -366,7 +64,6 @@
 	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;
@@ -384,8 +81,7 @@
 	 * during non ISP abort time.
 	 */
 	if (!abort_active) {
-		tmp_stat = qla2x00_get_mbx_access(ha, mcp->tov);
-		if (tmp_stat != QLA_SUCCESS) {
+		if (qla2x00_down_timeout(&ha->mbx_cmd_sem, mcp->tov * HZ)) {
 			/* Timeout occurred. Return error. */
 			DEBUG2_3_11(printk("qla2x00_mailbox_command(%ld): cmd "
 			    "access timeout. Exiting.\n", ha->host_no);)
@@ -611,12 +307,8 @@
 	}
 
 	/* 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 (!abort_active)
+		up(&ha->mbx_cmd_sem);
 
 	if (rval) {
 		DEBUG2_3_11(printk("qla2x00_mailbox_command(%ld): **** FAILED. "
@@ -815,7 +507,7 @@
 	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)) {
+	if (IS_QLA2322(ha) || IS_QLA6322(ha)) {
 		mcp->mb[2] = 0;
 		mcp->out_mb |= MBX_2;
 	}
@@ -1234,8 +926,6 @@
 	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);
@@ -1256,7 +946,6 @@
 		    ha->host_no,rval);)
 	} else {
 		/*EMPTY*/
-		LEAVE("qla2x00_issue_iocb: exiting normally");
 	}
 
 	return rval;
@@ -2408,32 +2097,6 @@
 	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.
@@ -2458,8 +2121,6 @@
 	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;
@@ -2478,7 +2139,6 @@
 		    (int)ha->instance, rval);
 	} else {
 		/*EMPTY*/
-		LEAVE("qla2x00_lun_reset: exiting normally");
 	}
 
 	return rval;
--- diff/drivers/scsi/qla2xxx/qla_os.c	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/scsi/qla2xxx/qla_os.c	2004-02-09 10:39:55.000000000 +0000
@@ -70,7 +70,7 @@
 int displayConfig;
 module_param(displayConfig, int, 0);
 MODULE_PARM_DESC(displayConfig,
-		"If 1 then display the configuration used in /etc/modules.conf.");
+		"If 1 then display the configuration used in /etc/modprobe.conf.");
 
 int ql2xplogiabsentdevice;
 module_param(ql2xplogiabsentdevice, int, 0);
@@ -138,7 +138,6 @@
  * 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 *);
@@ -357,8 +356,6 @@
 	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;
 
@@ -404,8 +401,6 @@
 
 	/* Call the mid-level driver interrupt handler */
 	(*(cmd)->scsi_done)(cmd);
-
-	LEAVE(__func__);
 }
 
 static inline void 
@@ -648,6 +643,11 @@
 	    ha->fw_minor_version,
 	    ha->fw_subminor_version);
 
+	if (ha->fw_attributes & BIT_9) {
+		strcat(str, "FLX");
+		return (str);
+	}
+
 	switch (ha->fw_attributes & 0xFF) {
 	case 0x7:
 		strcat(str, "EF");
@@ -910,8 +910,6 @@
 	u_long		cpu_flags = 0;
 	u_long		max_wait_time = ABORT_WAIT_TIME;
 
-	ENTER(__func__);
-
 	do {
 		/* Check on done queue */
 		if (!found) {
@@ -958,8 +956,6 @@
 		done++;
 	}
 
-	LEAVE(__func__);
-
 	return (done);
 }
 
@@ -983,14 +979,17 @@
 static inline int 
 qla2x00_wait_for_hba_online(scsi_qla_host_t *ha)
 {
-	int 	 return_status ;
+	int 	 return_status;
+	unsigned long wait_online;
 
-	while ((test_bit(ISP_ABORT_NEEDED, &ha->dpc_flags)) ||
+	wait_online = jiffies + (MAX_LOOP_TIMEOUT * HZ); 
+	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)) {
+	    test_bit(ISP_ABORT_RETRY, &ha->dpc_flags)) &&
+		time_before(jiffies, wait_online)) {
 
 		set_current_state(TASK_INTERRUPTIBLE);
-		schedule_timeout(3 * HZ);
+		schedule_timeout(HZ);
 	}
 	if (ha->flags.online == TRUE) 
 		return_status = QLA_SUCCESS; 
@@ -1033,7 +1032,7 @@
 	    test_bit(CFG_ACTIVE, &ha->cfg_flags) ||
 	    atomic_read(&ha->loop_state) != LOOP_READY) {
 		set_current_state(TASK_INTERRUPTIBLE);
-		schedule_timeout(3 * HZ);
+		schedule_timeout(HZ);
 		if (time_after_eq(jiffies, loop_timeout)) {
 			return_status = QLA_FUNCTION_FAILED;
 			break;
@@ -1072,9 +1071,6 @@
 	unsigned int	b, t, l;
 	unsigned long	flags;
 
-
-	ENTER(__func__);
-
 	/* Get the SCSI request ptr */
 	sp = (srb_t *) CMD_SP(cmd);
 
@@ -1123,11 +1119,10 @@
 	}
 
 	DEBUG2(printk("scsi(%ld): ABORTing cmd=%p sp=%p jiffies = 0x%lx, "
-	    "timeout=%x, dpc_flags=%lx, vis_ha->dpc_flags=%lx\n",
+	    "timeout=%x, dpc_flags=%lx, vis_ha->dpc_flags=%lx q->flag=%lx\n",
 	    ha->host_no, cmd, sp, jiffies, cmd->timeout_per_command / HZ,
-	    ha->dpc_flags, vis_ha->dpc_flags));
+	    ha->dpc_flags, vis_ha->dpc_flags, q->q_flag));
 	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 */  
@@ -1200,6 +1195,7 @@
 	} 
 	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.
@@ -1250,11 +1246,10 @@
 				continue;
 
 			DEBUG2(printk("qla2xxx_eh_abort(%ld): aborting sp %p "
-			    "from RISC. pid=%ld sp->state=%x\n",
+			    "from RISC. pid=%ld sp->state=%x q->q_flag=%lx\n",
 			    ha->host_no, sp, sp->cmd->serial_number,
-			    sp->state);)
+			    sp->state, q->q_flag);)
 			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);
@@ -1303,8 +1298,6 @@
 	DEBUG2(printk("qla2xxx_eh_abort: Exiting. return_status=0x%x.\n",
 	    return_status));
 
-	LEAVE("qla2xxx_eh_abort");
-
 	return(return_status);
 }
 
@@ -1417,10 +1410,6 @@
 	}
 	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);
 
@@ -1570,18 +1559,9 @@
 	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);
@@ -1618,7 +1598,6 @@
 	qla_printk(KERN_INFO, ha, "%s: reset %s\n", __func__,
 			(rval == FAILED) ? "failed" : "succeded");
 
-	LEAVE("qla2xxx_eh_bus_reset");
 	return rval;
 }
 
@@ -1643,18 +1622,10 @@
 	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.
 	 */
@@ -1702,7 +1673,6 @@
 	qla_printk(KERN_INFO, ha, "%s: reset %s\n", __func__,
 			(rval == FAILED) ? "failed" : "succeded");
 
-	LEAVE("qla2xxx_eh_host_reset");
 	return rval;
 
  board_disabled:
@@ -1730,8 +1700,6 @@
 	uint16_t t;
 	os_tgt_t        *tq;
 
-	ENTER(__func__);
-
 	if (ha->flags.enable_lip_reset) {
 		status = qla2x00_lip_reset(ha);
 	}
@@ -1774,8 +1742,6 @@
 				ha->host_no);)
 	}
 
-	LEAVE(__func__);
-
 	return(status);
 }
 
@@ -1888,15 +1854,29 @@
 	unsigned long	pio, pio_len, pio_flags;
 	unsigned long	mmio, mmio_len, mmio_flags;
 
+	/* We only need PIO for Flash operations on ISP2312 v2 chips. */
 	pio = pci_resource_start(ha->pdev, 0);
 	pio_len = pci_resource_len(ha->pdev, 0);
 	pio_flags = pci_resource_flags(ha->pdev, 0);
+	if (pio_flags & IORESOURCE_IO) {
+		if (pio_len < MIN_IOBASE_LEN) {
+			qla_printk(KERN_WARNING, ha,
+			    "Invalid PCI I/O region size (%s)...\n",
+			    ha->pdev->slot_name);
+			pio = 0;
+		}
+	} else {
+		qla_printk(KERN_WARNING, ha,
+		    "region #0 not a PIO resource (%s)...\n",
+		    ha->pdev->slot_name);
+		pio = 0;
+	}
 
+	/* Use MMIO operations for all accesses. */
 	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",
@@ -1909,20 +1889,6 @@
 		    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,
@@ -1932,12 +1898,8 @@
 		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,
@@ -1945,9 +1907,8 @@
 
 		goto iospace_error_exit;
 	}
-	ha->iobase = (device_reg_t *) ha->mmio_address;
 	ha->mmio_length = mmio_len;
-#endif
+	ha->iobase = (device_reg_t *) ha->mmio_address;
 
 	return (0);
 
@@ -2038,6 +1999,7 @@
 	/* load the F/W, read paramaters, and init the H/W */
 	ha->instance = num_hosts;
 
+	init_MUTEX(&ha->mbx_cmd_sem);
 	init_MUTEX_LOCKED(&ha->mbx_intr_sem);
 
 	INIT_LIST_HEAD(&ha->list);
@@ -2054,9 +2016,7 @@
 	 * 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);
@@ -2130,16 +2090,17 @@
 	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
+	if (!IS_QLA2100(ha) && !IS_QLA2200(ha)) {
+		if (IS_QLA2300(ha))
 			/* SRAM parity */
 			WRT_REG_WORD(&reg->hccr, (HCCR_ENABLE_PARITY + 0x1));
+		else
+			/* SRAM, Instruction RAM and GP RAM parity */
+			WRT_REG_WORD(&reg->hccr, (HCCR_ENABLE_PARITY + 0x7));
 	}
 	spin_unlock_irqrestore(&ha->hardware_lock, flags);
 
+
 	/* Enable chip interrupts. */
 	qla2x00_enable_intrs(ha);
 
@@ -2181,7 +2142,7 @@
 	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 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: "",
@@ -2233,7 +2194,7 @@
 	int ret;
 
 	/* Abort any outstanding IO descriptors. */
-	if (IS_QLA23XX(ha))
+	if (!IS_QLA2100(ha) && !IS_QLA2200(ha))
 		qla2x00_cancel_io_descriptors(ha);
 
 	/* turn-off interrupts on the card */
@@ -2261,6 +2222,7 @@
 
 	qla2x00_mem_free(ha);
 
+
 	ha->flags.online = FALSE;
 
 	/* Detach interrupts */
@@ -2461,6 +2423,7 @@
 	    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) {
@@ -2499,8 +2462,8 @@
 	    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);
+	    "Product ID = %04x %04x %04x %04x\n", ha->product_id[0],
+	    ha->product_id[1], ha->product_id[2], ha->product_id[3]);
 
 	copy_info(&info, "\n");
 
@@ -2540,13 +2503,14 @@
 			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]);
+		    "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");
@@ -2880,13 +2844,7 @@
 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 {
 		/*
@@ -2962,73 +2920,59 @@
 			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");
+		/* Allocate memory for SNS commands */
+		if (IS_QLA2200(ha)) {
+			/* Get consistent memory allocated for SNS commands */
+			ha->sns_cmd = pci_alloc_consistent(ha->pdev,
+			    sizeof(struct sns_cmd_pkt), &ha->sns_cmd_dma);
+			if (ha->sns_cmd == NULL) {
+				/* error */
+				qla_printk(KERN_WARNING, ha,
+				    "Memory Allocation failed - sns_cmd\n");
 
-			qla2x00_mem_free(ha);
-			set_current_state(TASK_INTERRUPTIBLE);
-			schedule_timeout(HZ/10);
+				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;
+				continue;
 			}
-			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");
+			memset(ha->sns_cmd, 0, sizeof(struct sns_cmd_pkt));
+		} else if (!IS_QLA2100(ha)) {
+			/* 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);
+				qla2x00_mem_free(ha);
+				set_current_state(TASK_INTERRUPTIBLE);
+				schedule_timeout(HZ/10);
 
-			continue;
-		}
-		memset(ha->ms_iocb, 0, sizeof(ms_iocb_entry_t));
+				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");
+			/*
+			 * 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);
+				qla2x00_mem_free(ha);
+				set_current_state(TASK_INTERRUPTIBLE);
+				schedule_timeout(HZ/10);
 
-			continue;
+				continue;
+			}
+			memset(ha->ct_sns, 0, sizeof(struct ct_sns_pkt));
 		}
-		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,
@@ -3056,8 +3000,6 @@
 			"%s(): **** FAILED ****\n", __func__);
 	}
 
-	LEAVE(__func__);
-
 	return(status);
 }
 
@@ -3076,12 +3018,8 @@
 	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__));
@@ -3095,20 +3033,11 @@
 
 	/* Make sure all other threads are stopped. */
 	wtime = 60 * HZ;
-	while ((ha->dpc_wait != NULL || ha->mbx_q_head != NULL) && wtime) {
+	while (ha->dpc_wait && 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);
 
@@ -3119,6 +3048,12 @@
 		pci_free_consistent(ha->pdev, PORT_DATABASE_SIZE,
 		    ha->iodesc_pd, ha->iodesc_pd_dma);
 	}
+
+	if (ha->sns_cmd) {
+		pci_free_consistent(ha->pdev,
+		    sizeof(struct sns_cmd_pkt), ha->sns_cmd, ha->sns_cmd_dma);
+	}
+
 	if (ha->ct_sns) {
 		pci_free_consistent(ha->pdev,
 		    sizeof(struct ct_sns_pkt), ha->ct_sns, ha->ct_sns_dma);
@@ -3183,8 +3118,6 @@
 		ha->fw_dump_reading = 0;
 		ha->fw_dump_buffer = NULL;
 	}
-
-	LEAVE(__func__);
 }
 
 /*
@@ -3519,6 +3452,7 @@
 			    ha->host_no));
 		}
 
+
 		if (test_bit(RESTART_QUEUES_NEEDED, &ha->dpc_flags)) {
 			DEBUG(printk("scsi(%ld): qla2x00_restart_queues()\n",
 			    ha->host_no));
@@ -3591,8 +3525,6 @@
 	struct list_head *list, *temp;
 	unsigned long flags;
 
-	ENTER(__func__);
-
 	clear_bit(ABORT_QUEUES_NEEDED, &ha->dpc_flags);
 
 	/* Return all commands device queues. */
@@ -3612,8 +3544,6 @@
 		__add_to_done_queue(ha, sp);
 	}
 	spin_unlock_irqrestore(&ha->list_lock, flags);
-
-	LEAVE(__func__);
 }
 
 /*
@@ -3626,8 +3556,6 @@
 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))) {
@@ -3646,8 +3574,6 @@
 
 		/* 10/15 ha->flags.reset_active = FALSE; */
 	}
-
-	LEAVE(__func__);
 }
 
 
@@ -3692,8 +3618,6 @@
 	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);
@@ -3737,8 +3661,6 @@
 	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__);
 }
 
 /**************************************************************************
@@ -3777,9 +3699,10 @@
 	}
 
 	/* Check if beacon LED needs to be blinked */
-	if (IS_QLA23XX(ha) && ha->beacon_blink_led)
+	if (!IS_QLA2100(ha) && !IS_QLA2200(ha) && ha->beacon_blink_led)
 		qla2x00_blink_led(ha);
 
+
 	/*
 	 * Ports - Port down timer.
 	 *
@@ -3889,6 +3812,13 @@
 			set_bit(RESTART_QUEUES_NEEDED, &ha->dpc_flags);
 			start_dpc++;
 
+			if (!(ha->device_flags & DFLG_NO_CABLE)) {
+				DEBUG(printk("scsi(%ld): Loop down - "
+				    "aborting ISP.\n",
+				    ha->host_no));
+
+				set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags);
+			}
 		}
 		DEBUG3(printk("scsi(%ld): Loop Down - seconds remainning %d\n",
 		    ha->host_no,
@@ -3902,6 +3832,7 @@
 	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) ||
@@ -4034,14 +3965,13 @@
 			__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);
@@ -4172,6 +4102,7 @@
 			}
 		}
 
+
 		switch (host_byte(cmd->result)) {
 			case DID_OK:
 			case DID_ERROR:
@@ -4393,7 +4324,7 @@
 		}
 	}
 
-	if (IS_QLA23XX(vis_ha)) {
+	if (!IS_QLA2100(vis_ha) && !IS_QLA2200(vis_ha)) {
 		/* Process response_queue if ZIO support is enabled*/ 
 		qla2x00_process_response_queue_in_zio_mode(vis_ha);
 
@@ -4401,56 +4332,6 @@
 }
 
 
-/*
- * 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
 *
@@ -4549,6 +4430,23 @@
 	return (QLA_SUCCESS);
 }
 
+/* XXX(hch): crude hack to emulate a down_timeout() */
+int
+qla2x00_down_timeout(struct semaphore *sema, unsigned long timeout)
+{
+	const unsigned int step = HZ/10;
+
+	do {
+		if (!down_trylock(sema))
+			return 0;
+		set_current_state(TASK_INTERRUPTIBLE);
+		if (schedule_timeout(step))
+			break;
+	} while ((timeout -= step) > 0);
+
+	return -ETIMEDOUT;
+}
+
 /**
  * qla2x00_module_init - Module initialization.
  **/
@@ -4560,6 +4458,7 @@
 #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,
@@ -4571,8 +4470,7 @@
 	}
 
 	printk(KERN_INFO
-	    "QLogic ISP2xxx PCI/PCI-X Fibre Channel HBA Driver (%p)\n",
-	    qla2x00_set_info);
+	    "QLogic Fibre Channel HBA Driver (%p)\n", qla2x00_set_info);
 
 	return 0;
 }
@@ -4598,5 +4496,5 @@
 module_exit(qla2x00_module_exit);
 
 MODULE_AUTHOR("QLogic Corporation");
-MODULE_DESCRIPTION("QLogic ISP2xxx FC-SCSI Host Bus Adapter driver");
+MODULE_DESCRIPTION("QLogic Fibre Channel HBA Driver");
 MODULE_LICENSE("GPL");
--- diff/drivers/scsi/qla2xxx/qla_settings.h	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/scsi/qla2xxx/qla_settings.h	2004-02-09 10:39:55.000000000 +0000
@@ -22,8 +22,6 @@
  */
 #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 */
 
--- diff/drivers/scsi/qla2xxx/qla_sup.c	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/scsi/qla2xxx/qla_sup.c	2004-02-09 10:39:55.000000000 +0000
@@ -55,7 +55,7 @@
 
 	reg = ha->iobase;
 
-	if (IS_QLA2312(ha) || IS_QLA2322(ha)) {
+	if (!IS_QLA2100(ha) && !IS_QLA2200(ha) && !IS_QLA2300(ha)) {
 		data = RD_REG_WORD(&reg->nvram);
 		while (data & NVR_BUSY) {
 			udelay(100);
@@ -87,7 +87,7 @@
 
 	reg = ha->iobase;
 
-	if (IS_QLA2312(ha) || IS_QLA2322(ha)) 
+	if (!IS_QLA2100(ha) && !IS_QLA2200(ha) && !IS_QLA2300(ha))
 		WRT_REG_WORD(&reg->u.isp2300.host_semaphore, 0);
 }
 
@@ -296,6 +296,7 @@
 	data = RD_REG_WORD(&reg->ctrl_status);
 	data |= CSR_FLASH_ENABLE;
 	WRT_REG_WORD(&reg->ctrl_status, data);
+	RD_REG_WORD(&reg->ctrl_status);		/* PCI Posting. */
 }
 
 /**
@@ -311,6 +312,7 @@
 	data = RD_REG_WORD(&reg->ctrl_status);
 	data &= ~(CSR_FLASH_ENABLE);
 	WRT_REG_WORD(&reg->ctrl_status, data);
+	RD_REG_WORD(&reg->ctrl_status);		/* PCI Posting. */
 }
 
 /**
@@ -334,13 +336,30 @@
 	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);
+		RD_REG_WORD(&reg->ctrl_status);	/* PCI Posting. */
 	} 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);
+		RD_REG_WORD(&reg->ctrl_status);	/* PCI Posting. */
+	}
+
+	/* The ISP2312 v2 chip cannot access the FLASH registers via MMIO. */
+	if (IS_QLA2312(ha) && ha->product_id[3] == 0x2 && ha->pio_address) {
+		uint16_t data2;
+
+		reg = (device_reg_t *)ha->pio_address;
+		outw((uint16_t)addr, (unsigned long)(&reg->flash_address));
+		do {
+			data = inw((unsigned long)(&reg->flash_data));
+			barrier();
+			cpu_relax();
+			data2 = inw((unsigned long)(&reg->flash_data));
+		} while (data != data2);
+	} else {
+		WRT_REG_WORD(&reg->flash_address, (uint16_t)addr);
+		data = qla2x00_debounce_register(&reg->flash_data);
 	}
-	WRT_REG_WORD(&reg->flash_address, (uint16_t)addr);
-	data = qla2x00_debounce_register(&reg->flash_data);
 
 	return ((uint8_t)data);
 }
@@ -362,13 +381,25 @@
 	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);
+		RD_REG_WORD(&reg->ctrl_status);	/* PCI Posting. */
 	} 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);
+		RD_REG_WORD(&reg->ctrl_status);	/* PCI Posting. */
+	}
+
+	/* The ISP2312 v2 chip cannot access the FLASH registers via MMIO. */
+	if (IS_QLA2312(ha) && ha->product_id[3] == 0x2 && ha->pio_address) {
+		reg = (device_reg_t *)ha->pio_address;
+		outw((uint16_t)addr, (unsigned long)(&reg->flash_address));
+		outw((uint16_t)data, (unsigned long)(&reg->flash_data));
+	} else {
+		WRT_REG_WORD(&reg->flash_address, (uint16_t)addr);
+		RD_REG_WORD(&reg->ctrl_status);		/* PCI Posting. */
+		WRT_REG_WORD(&reg->flash_data, (uint16_t)data);
+		RD_REG_WORD(&reg->ctrl_status);		/* PCI Posting. */
 	}
-	WRT_REG_WORD(&reg->flash_address, (uint16_t)addr);
-	WRT_REG_WORD(&reg->flash_data, (uint16_t)data);
 }
 
 /**
@@ -504,7 +535,9 @@
 	uint32_t	loop_cnt = 1;  /* this is for error exit only */
 	uint32_t	pcir_adr;
 
-	ENTER(__func__);
+	/* The ISP2312 v2 chip cannot access the FLASH registers via MMIO. */
+	if (IS_QLA2312(ha) && ha->product_id[3] == 0x2 && !ha->pio_address)
+		ret = QLA_FUNCTION_FAILED;
 
 	qla2x00_flash_enable(ha);
 	do {	/* Loop once to provide quick error exit */
@@ -545,8 +578,6 @@
 	} while (--loop_cnt);
 	qla2x00_flash_disable(ha);
 
-	LEAVE(__func__);
-
 	return (ret);
 }
 
@@ -569,6 +600,7 @@
 
 	qla2x00_flash_enable(ha);
 	WRT_REG_WORD(&reg->nvram, 0);
+	RD_REG_WORD(&reg->nvram);		/* PCI Posting. */
 	for (addr = 0, data = image; addr < FLASH_IMAGE_SIZE; addr++, data++) {
 		if (addr == midpoint)
 			WRT_REG_WORD(&reg->nvram, NVR_SELECT);
@@ -605,6 +637,7 @@
 
 	/* Reset ISP chip. */
 	WRT_REG_WORD(&reg->ctrl_status, CSR_ISP_SOFT_RESET);
+	RD_REG_WORD(&reg->ctrl_status);		/* PCI Posting. */
 
 	qla2x00_flash_enable(ha);
 	do {	/* Loop once to provide quick error exit */
--- diff/drivers/scsi/qla2xxx/qla_version.h	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/scsi/qla2xxx/qla_version.h	2004-02-09 10:39:55.000000000 +0000
@@ -19,9 +19,9 @@
 /*
  * Driver version 
  */
-#define QLA2XXX_VERSION      "8.00.00b8"
+#define QLA2XXX_VERSION      "8.00.00b10"
 
 #define QLA_DRIVER_MAJOR_VER	8
 #define QLA_DRIVER_MINOR_VER	0
 #define QLA_DRIVER_PATCH_VER	0
-#define QLA_DRIVER_BETA_VER	8
+#define QLA_DRIVER_BETA_VER	10
--- diff/drivers/scsi/scsi.c	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/scsi/scsi.c	2004-02-09 10:39:55.000000000 +0000
@@ -22,7 +22,7 @@
  *  support added by Michael Neuffer <mike@i-connect.net>
  *
  *  Added request_module("scsi_hostadapter") for kerneld:
- *  (Put an "alias scsi_hostadapter your_hostadapter" in /etc/modules.conf)
+ *  (Put an "alias scsi_hostadapter your_hostadapter" in /etc/modprobe.conf)
  *  Bjorn Ekwall  <bj0rn@blox.se>
  *  (changed to kmod)
  *
@@ -53,6 +53,8 @@
 #include <linux/spinlock.h>
 #include <linux/kmod.h>
 #include <linux/interrupt.h>
+#include <linux/notifier.h>
+#include <linux/cpu.h>
 
 #include <scsi/scsi_host.h>
 #include "scsi.h"
@@ -1129,6 +1131,38 @@
 	return 0;
 }
 
+#ifdef CONFIG_HOTPLUG_CPU
+static int scsi_cpu_notify(struct notifier_block *self,
+			   unsigned long action, void *hcpu)
+{
+	int cpu = (unsigned long)hcpu;
+
+	switch(action) {
+	case CPU_DEAD:
+		/* Drain scsi_done_q. */
+		local_irq_disable();
+		list_splice_init(&per_cpu(scsi_done_q, cpu),
+				 &__get_cpu_var(scsi_done_q));
+		raise_softirq_irqoff(SCSI_SOFTIRQ);
+		local_irq_enable();
+		break;
+	default:
+		break;
+	}
+	return NOTIFY_OK;
+}
+
+static struct notifier_block __devinitdata scsi_cpu_nb = {
+	.notifier_call	= scsi_cpu_notify,
+};
+
+#define register_scsi_cpu() register_cpu_notifier(&scsi_cpu_nb)
+#define unregister_scsi_cpu() unregister_cpu_notifier(&scsi_cpu_nb)
+#else
+#define register_scsi_cpu()
+#define unregister_scsi_cpu()
+#endif /* CONFIG_HOTPLUG_CPU */
+
 MODULE_DESCRIPTION("SCSI core");
 MODULE_LICENSE("GPL");
 
@@ -1163,6 +1197,7 @@
 
 	devfs_mk_dir("scsi");
 	open_softirq(SCSI_SOFTIRQ, scsi_softirq, NULL);
+	register_scsi_cpu();
 	printk(KERN_NOTICE "SCSI subsystem initialized\n");
 	return 0;
 
@@ -1190,6 +1225,7 @@
 	devfs_remove("scsi");
 	scsi_exit_procfs();
 	scsi_exit_queue();
+	unregister_scsi_cpu();
 }
 
 subsys_initcall(init_scsi);
--- diff/drivers/scsi/scsi_debug.c	2004-01-19 10:22:58.000000000 +0000
+++ source/drivers/scsi/scsi_debug.c	2004-02-09 10:39:55.000000000 +0000
@@ -557,8 +557,7 @@
 		
 		dev_id_num = ((devip->sdbg_host->shost->host_no + 1) * 2000) +
 			     (devip->target * 1000) + devip->lun;
-		len = snprintf(dev_id_str, 6, "%d", dev_id_num);
-		len = (len > 6) ? 6 : len;
+		len = scnprintf(dev_id_str, 6, "%d", dev_id_num);
 		if (0 == cmd[2]) { /* supported vital product data pages */
 			arr[3] = 3;
 			arr[4] = 0x0; /* this page */
@@ -1309,7 +1308,7 @@
 
 static ssize_t sdebug_delay_show(struct device_driver * ddp, char * buf) 
 {
-        return snprintf(buf, PAGE_SIZE, "%d\n", scsi_debug_delay);
+        return scnprintf(buf, PAGE_SIZE, "%d\n", scsi_debug_delay);
 }
 
 static ssize_t sdebug_delay_store(struct device_driver * ddp, 
@@ -1331,7 +1330,7 @@
 
 static ssize_t sdebug_opts_show(struct device_driver * ddp, char * buf) 
 {
-        return snprintf(buf, PAGE_SIZE, "0x%x\n", scsi_debug_opts);
+        return scnprintf(buf, PAGE_SIZE, "0x%x\n", scsi_debug_opts);
 }
 
 static ssize_t sdebug_opts_store(struct device_driver * ddp, 
@@ -1360,7 +1359,7 @@
 
 static ssize_t sdebug_num_tgts_show(struct device_driver * ddp, char * buf) 
 {
-        return snprintf(buf, PAGE_SIZE, "%d\n", scsi_debug_num_tgts);
+        return scnprintf(buf, PAGE_SIZE, "%d\n", scsi_debug_num_tgts);
 }
 static ssize_t sdebug_num_tgts_store(struct device_driver * ddp, 
 				     const char * buf, size_t count)
@@ -1378,13 +1377,13 @@
 
 static ssize_t sdebug_dev_size_mb_show(struct device_driver * ddp, char * buf) 
 {
-        return snprintf(buf, PAGE_SIZE, "%d\n", scsi_debug_dev_size_mb);
+        return scnprintf(buf, PAGE_SIZE, "%d\n", scsi_debug_dev_size_mb);
 }
 DRIVER_ATTR(dev_size_mb, S_IRUGO, sdebug_dev_size_mb_show, NULL) 
 
 static ssize_t sdebug_every_nth_show(struct device_driver * ddp, char * buf) 
 {
-        return snprintf(buf, PAGE_SIZE, "%d\n", scsi_debug_every_nth);
+        return scnprintf(buf, PAGE_SIZE, "%d\n", scsi_debug_every_nth);
 }
 static ssize_t sdebug_every_nth_store(struct device_driver * ddp, 
 				      const char * buf, size_t count)
@@ -1403,7 +1402,7 @@
 
 static ssize_t sdebug_max_luns_show(struct device_driver * ddp, char * buf) 
 {
-        return snprintf(buf, PAGE_SIZE, "%d\n", scsi_debug_max_luns);
+        return scnprintf(buf, PAGE_SIZE, "%d\n", scsi_debug_max_luns);
 }
 static ssize_t sdebug_max_luns_store(struct device_driver * ddp, 
 				     const char * buf, size_t count)
@@ -1421,13 +1420,13 @@
 
 static ssize_t sdebug_scsi_level_show(struct device_driver * ddp, char * buf) 
 {
-        return snprintf(buf, PAGE_SIZE, "%d\n", scsi_debug_scsi_level);
+        return scnprintf(buf, PAGE_SIZE, "%d\n", scsi_debug_scsi_level);
 }
 DRIVER_ATTR(scsi_level, S_IRUGO, sdebug_scsi_level_show, NULL) 
 
 static ssize_t sdebug_add_host_show(struct device_driver * ddp, char * buf) 
 {
-        return snprintf(buf, PAGE_SIZE, "%d\n", scsi_debug_add_host);
+        return scnprintf(buf, PAGE_SIZE, "%d\n", scsi_debug_add_host);
 }
 
 static ssize_t sdebug_add_host_store(struct device_driver * ddp, 
--- diff/drivers/scsi/scsi_lib.c	2003-12-19 09:51:02.000000000 +0000
+++ source/drivers/scsi/scsi_lib.c	2004-02-09 10:39:55.000000000 +0000
@@ -238,6 +238,8 @@
 	generic_unplug_device(sreq->sr_device->request_queue);
 	wait_for_completion(&wait);
 	sreq->sr_request->waiting = NULL;
+	if (sreq->sr_request->rq_status != RQ_SCSI_DONE)
+		sreq->sr_result |= (DRIVER_ERROR << 24);
 
 	__scsi_release_request(sreq);
 }
@@ -340,7 +342,6 @@
 	unsigned long flags;
 
 	spin_lock_irqsave(shost->host_lock, flags);
-	WARN_ON(!current_sdev->sdev_target->starget_sdev_user);
 	current_sdev->sdev_target->starget_sdev_user = NULL;
 	spin_unlock_irqrestore(shost->host_lock, flags);
 
@@ -352,10 +353,6 @@
 	 */
 	blk_run_queue(current_sdev->request_queue);
 
-	/*
-	 * After unlock, this races with anyone clearing starget_sdev_user,
-	 * but we always enter this function again, avoiding any problems.
-	 */
 	spin_lock_irqsave(shost->host_lock, flags);
 	if (current_sdev->sdev_target->starget_sdev_user)
 		goto out;
@@ -1287,6 +1284,15 @@
 	blk_queue_max_sectors(q, shost->max_sectors);
 	blk_queue_bounce_limit(q, scsi_calculate_bounce_limit(shost));
 	blk_queue_segment_boundary(q, shost->dma_boundary);
+ 
+	/*
+	 * Set the queue's mask to require a mere 8-byte alignment for
+	 * DMA buffers, rather than the default 512.  This shouldn't
+	 * inconvenience any user programs and should be okay for most
+	 * host adapters.  A host driver can alter this mask in its
+	 * slave_alloc() or slave_configure() callback if necessary.
+	 */
+	blk_queue_dma_alignment(q, (8 - 1));
 
 	if (!shost->use_clustering)
 		clear_bit(QUEUE_FLAG_CLUSTER, &q->queue_flags);
--- diff/drivers/scsi/sd.c	2003-10-27 09:20:43.000000000 +0000
+++ source/drivers/scsi/sd.c	2004-02-09 10:39:55.000000000 +0000
@@ -62,6 +62,7 @@
  */
 #define SD_MAJORS	16
 #define SD_DISKS	(SD_MAJORS << 4)
+#define TOTAL_SD_DISKS	CONFIG_MAX_SD_DISKS
 
 /*
  * Time out in seconds for disks and Magneto-opticals (which are slower).
@@ -95,7 +96,7 @@
 };
 
 
-static unsigned long sd_index_bits[SD_DISKS / BITS_PER_LONG];
+static unsigned long sd_index_bits[TOTAL_SD_DISKS / BITS_PER_LONG];
 static spinlock_t sd_index_lock = SPIN_LOCK_UNLOCKED;
 
 static int sd_revalidate_disk(struct gendisk *disk);
@@ -130,6 +131,9 @@
 		return SCSI_DISK1_MAJOR + major_idx - 1;
 	case 8 ... 15:
 		return SCSI_DISK8_MAJOR + major_idx - 8;
+#define MAX_IDX        (TOTAL_SD_DISKS >> 4)
+	case 16 ... MAX_IDX:
+		return SCSI_DISK15_MAJOR;
 	default:
 		BUG();
 		return 0;	/* shut up gcc */
@@ -554,7 +558,7 @@
 		case SCSI_IOCTL_GET_BUS_NUMBER:
 			return scsi_ioctl(sdp, cmd, (void *)arg);
 		default:
-			error = scsi_cmd_ioctl(bdev, cmd, arg);
+			error = scsi_cmd_ioctl(disk, cmd, arg);
 			if (error != -ENOTTY)
 				return error;
 	}
@@ -1089,6 +1093,7 @@
 	int res;
 	struct scsi_mode_data data;
 
+	set_disk_ro(sdkp->disk, 0);
 	if (sdkp->device->skip_ms_page_3f) {
 		printk(KERN_NOTICE "%s: assuming Write Enabled\n", diskname);
 		return;
@@ -1120,6 +1125,7 @@
 		       "%s: test WP failed, assume Write Enabled\n", diskname);
 	} else {
 		sdkp->write_prot = ((data.device_specific & 0x80) != 0);
+		set_disk_ro(sdkp->disk, sdkp->write_prot);
 		printk(KERN_NOTICE "%s: Write Protect is %s\n", diskname,
 		       sdkp->write_prot ? "on" : "off");
 		printk(KERN_DEBUG "%s: Mode Sense: %02x %02x %02x %02x\n",
@@ -1320,8 +1326,8 @@
 		goto out_free;
 
 	spin_lock(&sd_index_lock);
-	index = find_first_zero_bit(sd_index_bits, SD_DISKS);
-	if (index == SD_DISKS) {
+	index = find_first_zero_bit(sd_index_bits, TOTAL_SD_DISKS);
+	if (index == TOTAL_SD_DISKS) {
 		spin_unlock(&sd_index_lock);
 		error = -EBUSY;
 		goto out_put;
@@ -1336,15 +1342,24 @@
 	sdkp->openers = 0;
 
 	gd->major = sd_major(index >> 4);
-	gd->first_minor = (index & 15) << 4;
+	if (index > SD_DISKS)
+		gd->first_minor = ((index - SD_DISKS) & 15) << 4;
+	else
+		gd->first_minor = (index & 15) << 4;
 	gd->minors = 16;
 	gd->fops = &sd_fops;
 
-	if (index >= 26) {
+	if (index < 26) {
+		sprintf(gd->disk_name, "sd%c", 'a' + index % 26);
+	} else if (index < (26*27)) {
 		sprintf(gd->disk_name, "sd%c%c",
 			'a' + index/26-1,'a' + index % 26);
 	} else {
-		sprintf(gd->disk_name, "sd%c", 'a' + index % 26);
+		const unsigned int m1 = (index/ 26 - 1) / 26 - 1;
+		const unsigned int m2 = (index / 26 - 1) % 26;
+		const unsigned int m3 = index % 26;
+		sprintf(gd->disk_name, "sd%c%c%c",
+			'a' + m1, 'a' + m2, 'a' + m3);
 	}
 
 	strcpy(gd->devfs_name, sdp->devfs_name);
--- diff/drivers/scsi/sg.c	2004-01-19 10:22:58.000000000 +0000
+++ source/drivers/scsi/sg.c	2004-02-09 10:39:55.000000000 +0000
@@ -58,10 +58,6 @@
 #include <linux/cdev.h>
 #include <linux/seq_file.h>
 
-#include <asm/io.h>
-#include <asm/uaccess.h>
-#include <asm/system.h>
-
 #include <linux/blkdev.h>
 #include "scsi.h"
 #include "hosts.h"
@@ -73,7 +69,7 @@
 
 #ifdef CONFIG_SCSI_PROC_FS
 #include <linux/proc_fs.h>
-static char *sg_version_str = "3.5.30 [20031010]";
+static char *sg_version_str = "3.5.30 [20040124]";
 
 static int sg_proc_init(void);
 static void sg_proc_cleanup(void);
@@ -1333,6 +1329,10 @@
 	.fasync = sg_fasync,
 };
 
+static struct class_simple * sg_sysfs_class;
+
+static int sg_sysfs_valid = 0;
+
 static int
 sg_add(struct class_device *cl_dev)
 {
@@ -1360,7 +1360,7 @@
 				tmp_dev_max * sizeof(Sg_device *));
 		if (NULL == tmp_da) {
 			printk(KERN_ERR
-			       "sg_attach: device array cannot be resized\n");
+			       "sg_add: device array cannot be resized\n");
 			error = -ENOMEM;
 			goto out;
 		}
@@ -1401,12 +1401,12 @@
 		sdp = NULL;
 	if (NULL == sdp) {
 		write_unlock_irqrestore(&sg_dev_arr_lock, iflags);
-		printk(KERN_ERR "sg_attach: Sg_device cannot be allocated\n");
+		printk(KERN_ERR "sg_add: Sg_device cannot be allocated\n");
 		error = -ENOMEM;
 		goto out;
 	}
 
-	SCSI_LOG_TIMEOUT(3, printk("sg_attach: dev=%d \n", k));
+	SCSI_LOG_TIMEOUT(3, printk("sg_add: dev=%d \n", k));
 	memset(sdp, 0, sizeof(*sdp));
 	sprintf(disk->disk_name, "sg%d", k);
 	strncpy(cdev->kobj.name, disk->disk_name, KOBJ_NAME_LEN);
@@ -1432,16 +1432,24 @@
 		goto out;
 	}
 	sdp->cdev = cdev;
-	error = sysfs_create_link(&cdev->kobj, &scsidp->sdev_gendev.kobj, 
-				  "device");
-	if (error)
-		printk(KERN_ERR "sg_attach: unable to make symlink 'device'"
-		       " for sg%d\n", k);
-	error = sysfs_create_link(&scsidp->sdev_gendev.kobj, &cdev->kobj, 
-				  "generic");
-	if (error)
-		printk(KERN_ERR "sg_attach: unable to make symlink 'generic'"
-		       " back to sg%d\n", k);
+	if (sg_sysfs_valid) {
+		struct class_device * sg_class_member;
+
+		sg_class_member = class_simple_device_add(sg_sysfs_class, 
+				MKDEV(SCSI_GENERIC_MAJOR, k), 
+				cl_dev->dev, "%s", 
+				disk->disk_name);
+		if (NULL == sg_class_member)
+			printk(KERN_WARNING "sg_add: "
+				"class_simple_device_add failed\n");
+		class_set_devdata(sg_class_member, sdp);
+		error = sysfs_create_link(&scsidp->sdev_gendev.kobj, 
+					  &sg_class_member->kobj, "generic");
+		if (error)
+			printk(KERN_ERR "sg_add: unable to make symlink "
+					"'generic' back to sg%d\n", k);
+	} else
+		printk(KERN_WARNING "sg_add: sg_sys INvalid\n");
 
 	printk(KERN_NOTICE
 	       "Attached scsi generic sg%d at scsi%d, channel"
@@ -1512,7 +1520,8 @@
 
 	if (sdp) {
 		sysfs_remove_link(&scsidp->sdev_gendev.kobj, "generic");
-		sysfs_remove_link(&sdp->cdev->kobj, "device");
+		class_simple_device_remove(MKDEV(SCSI_GENERIC_MAJOR, k));
+		cdev_unmap(MKDEV(SCSI_GENERIC_MAJOR, k), 1);
 		cdev_del(sdp->cdev);
 		sdp->cdev = NULL;
 		devfs_remove("%s/generic", scsidp->devfs_name);
@@ -1538,6 +1547,7 @@
 MODULE_LICENSE("GPL");
 
 MODULE_PARM_DESC(def_reserved_size, "size of buffer reserved for each fd");
+MODULE_PARM_DESC(allow_dio, "allow direct I/O (default: 0 (disallow))");
 
 static int __init
 init_sg(void)
@@ -1551,16 +1561,23 @@
 				    SG_MAX_DEVS, "sg");
 	if (rc)
 		return rc;
+        sg_sysfs_class = class_simple_create(THIS_MODULE, "scsi_generic");
+        if ( IS_ERR(sg_sysfs_class) ) {
+		rc = PTR_ERR(sg_sysfs_class);
+		goto err_out;
+        }
+	sg_sysfs_valid = 1;
 	rc = scsi_register_interface(&sg_interface);
-	if (rc) {
-		unregister_chrdev_region(MKDEV(SCSI_GENERIC_MAJOR, 0),
-				         SG_MAX_DEVS);
-		return rc;
-	}
+	if (0 == rc) {
 #ifdef CONFIG_SCSI_PROC_FS
-	sg_proc_init();
+		sg_proc_init();
 #endif				/* CONFIG_SCSI_PROC_FS */
-	return 0;
+		return 0;
+	}
+	class_simple_destroy(sg_sysfs_class);
+err_out:
+	unregister_chrdev_region(MKDEV(SCSI_GENERIC_MAJOR, 0), SG_MAX_DEVS);
+	return rc;
 }
 
 static void __exit
@@ -1570,6 +1587,8 @@
 	sg_proc_cleanup();
 #endif				/* CONFIG_SCSI_PROC_FS */
 	scsi_unregister_interface(&sg_interface);
+	class_simple_destroy(sg_sysfs_class);
+	sg_sysfs_valid = 0;
 	unregister_chrdev_region(MKDEV(SCSI_GENERIC_MAJOR, 0),
 				 SG_MAX_DEVS);
 	if (sg_dev_arr != NULL) {
@@ -1778,7 +1797,11 @@
 	int sg_tablesize = sfp->parentdp->sg_tablesize;
 	struct scatterlist *sgl;
 	int mx_sc_elems, res;
+	struct scsi_device *sdev = sfp->parentdp->device;
 
+	if (((unsigned long)hp->dxferp &
+			queue_dma_alignment(sdev->request_queue)) != 0)
+		return 1;
 	mx_sc_elems = sg_build_sgat(schp, sfp, sg_tablesize);
         if (mx_sc_elems <= 0) {
                 return 1;
@@ -2509,13 +2532,18 @@
 sg_page_malloc(int rqSz, int lowDma, int *retSzp)
 {
 	char *resp = NULL;
-	int page_mask = lowDma ? (GFP_ATOMIC | GFP_DMA) : GFP_ATOMIC;
+	int page_mask;
 	int order, a_size;
 	int resSz = rqSz;
 
 	if (rqSz <= 0)
 		return resp;
 
+	if (lowDma)
+		page_mask = GFP_ATOMIC | GFP_DMA | __GFP_NOWARN;
+	else
+		page_mask = GFP_ATOMIC | __GFP_NOWARN;
+
 	for (order = 0, a_size = PAGE_SIZE; a_size < rqSz;
 	     order++, a_size <<= 1) ;
 	resp = (char *) __get_free_pages(page_mask, order);
--- diff/drivers/scsi/sr.c	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/scsi/sr.c	2004-02-09 10:39:55.000000000 +0000
@@ -712,6 +712,9 @@
 		""
 	};
 
+	/* Set read only initially */
+	set_disk_ro(cd->disk, 1);
+
 	/* allocate a request for the TEST_UNIT_READY */
 	SRpnt = scsi_allocate_request(cd->device, GFP_KERNEL);
 	if (!SRpnt) {
@@ -825,8 +828,11 @@
 	/*
 	 * 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))
+	if ((cd->cdi.mask & (CDC_DVD_RAM | CDC_MRW_W)) !=
+			(CDC_DVD_RAM | CDC_MRW_W)) {
 		cd->device->writeable = 1;
+		set_disk_ro(cd->disk, 0);
+	}
 
 	scsi_release_request(SRpnt);
 	kfree(buffer);
--- diff/drivers/scsi/st.c	2004-01-19 10:22:58.000000000 +0000
+++ source/drivers/scsi/st.c	2004-02-09 10:39:55.000000000 +0000
@@ -9,7 +9,7 @@
    Steve Hirsch, Andreas Koppenh"ofer, Michael Leodolter, Eyal Lebedinsky,
    Michael Schaefer, J"org Weule, and Eric Youngdale.
 
-   Copyright 1992 - 2003 Kai Makisara
+   Copyright 1992 - 2004 Kai Makisara
    email Kai.Makisara@kolumbus.fi
 
    Some small formal changes - aeb, 950809
@@ -17,7 +17,7 @@
    Last modified: 18-JAN-1998 Richard Gooch <rgooch@atnf.csiro.au> Devfs support
  */
 
-static char *verstr = "20031228";
+static char *verstr = "20040122";
 
 #include <linux/module.h>
 
@@ -179,6 +179,7 @@
 
 static int st_probe(struct device *);
 static int st_remove(struct device *);
+static int st_init_command(struct scsi_cmnd *);
 
 static void do_create_driverfs_files(void);
 static void do_remove_driverfs_files(void);
@@ -191,6 +192,7 @@
 		.probe		= st_probe,
 		.remove		= st_remove,
 	},
+	.init_command		= st_init_command,
 };
 
 static int st_compression(Scsi_Tape *, int);
@@ -1272,7 +1274,8 @@
 		i = STp->try_dio && try_rdio;
 	else
 		i = STp->try_dio && try_wdio;
-	if (i) {
+	if (i && ((unsigned long)buf & queue_dma_alignment(
+					STp->device->request_queue)) == 0) {
 		i = st_map_user_pages(&(STbp->sg[0]), STbp->use_sg,
 				      (unsigned long)buf, count, (is_read ? READ : WRITE),
 				      STp->max_pfn);
@@ -3389,7 +3392,11 @@
 		goto out;
 	}
 	up(&STp->lock);
-	return scsi_ioctl(STp->device, cmd_in, (void *) arg);
+	i = scsi_cmd_ioctl(STp->disk, cmd_in, arg);
+	if (i != -ENOTTY)
+		return i;
+	else
+		return scsi_ioctl(STp->device, cmd_in, (void *) arg);
 
  out:
 	up(&STp->lock);
@@ -3796,6 +3803,7 @@
 	tpnt->disk = disk;
 	sprintf(disk->disk_name, "st%d", i);
 	disk->private_data = &tpnt->driver;
+	disk->queue = SDp->request_queue;
 	tpnt->driver = &st_template;
 	scsi_tapes[i] = tpnt;
 	dev_num = i;
@@ -3846,27 +3854,53 @@
 		STm->default_compression = ST_DONT_TOUCH;
 		STm->default_blksize = (-1);	/* No forced size */
 		STm->default_density = (-1);	/* No forced density */
+	}
+
+	for (i = 0; i < ST_NBR_PARTITIONS; i++) {
+		STps = &(tpnt->ps[i]);
+		STps->rw = ST_IDLE;
+		STps->eof = ST_NOEOF;
+		STps->at_sm = 0;
+		STps->last_block_valid = FALSE;
+		STps->drv_block = (-1);
+		STps->drv_file = (-1);
+	}
+
+	tpnt->current_mode = 0;
+	tpnt->modes[0].defined = TRUE;
+
+	tpnt->density_changed = tpnt->compression_changed =
+	    tpnt->blksize_changed = FALSE;
+	init_MUTEX(&tpnt->lock);
+
+	st_nr_dev++;
+	write_unlock(&st_dev_arr_lock);
 
+	for (mode = 0; mode < ST_NBR_MODES; ++mode) {
+		STm = &(tpnt->modes[mode]);
 		for (j=0; j < 2; j++) {
 			cdev = cdev_alloc();
 			if (!cdev) {
 				printk(KERN_ERR
-				       "st: out of memory. Device not attached.\n");
-				goto out_put_disk;
+				       "st%d: out of memory. Device not attached.\n",
+				       dev_num);
+				goto out_free_tape;
 			}
 			snprintf(cdev->kobj.name, KOBJ_NAME_LEN, "%sm%d%s", disk->disk_name,
-				 i, j ? "n" : "");
+				 mode, j ? "n" : "");
 			cdev->owner = THIS_MODULE;
 			cdev->ops = &st_fops;
-			STm->cdevs[j] = cdev;
 
-			error = cdev_add(STm->cdevs[j],
-					 MKDEV(SCSI_TAPE_MAJOR, TAPE_MINOR(dev_num, i, j)),
+			error = cdev_add(cdev,
+					 MKDEV(SCSI_TAPE_MAJOR, TAPE_MINOR(dev_num, mode, j)),
 					 1);
 			if (error) {
 				printk(KERN_ERR "st%d: Can't add %s-rewind mode %d\n",
-				       dev_num, j ? "non" : "auto", i);
+				       dev_num, j ? "non" : "auto", mode);
+				printk(KERN_ERR "st%d: Device not attached.\n", dev_num);
+				goto out_free_tape;
 			}
+			STm->cdevs[j] = cdev;
 
 			error = sysfs_create_link(&STm->cdevs[j]->kobj, &SDp->sdev_gendev.kobj,
 						  "device");
@@ -3884,35 +3918,15 @@
 		       dev_num);
 	}
 
-	for (i = 0; i < ST_NBR_PARTITIONS; i++) {
-		STps = &(tpnt->ps[i]);
-		STps->rw = ST_IDLE;
-		STps->eof = ST_NOEOF;
-		STps->at_sm = 0;
-		STps->last_block_valid = FALSE;
-		STps->drv_block = (-1);
-		STps->drv_file = (-1);
-	}
-
-	tpnt->current_mode = 0;
-	tpnt->modes[0].defined = TRUE;
-
-	tpnt->density_changed = tpnt->compression_changed =
-	    tpnt->blksize_changed = FALSE;
-	init_MUTEX(&tpnt->lock);
-
-	st_nr_dev++;
-	write_unlock(&st_dev_arr_lock);
-
 	for (mode = 0; mode < ST_NBR_MODES; ++mode) {
-	    /*  Rewind entry  */
-	    devfs_mk_cdev(MKDEV(SCSI_TAPE_MAJOR, dev_num + (mode << 5)),
-				S_IFCHR | S_IRUGO | S_IWUGO,
-				"%s/mt%s", SDp->devfs_name, st_formats[mode]);
-	    /*  No-rewind entry  */
-	    devfs_mk_cdev(MKDEV(SCSI_TAPE_MAJOR, dev_num + (mode << 5) + 128),
-				S_IFCHR | S_IRUGO | S_IWUGO,
-				"%s/mt%sn", SDp->devfs_name, st_formats[mode]);
+		/*  Rewind entry  */
+		devfs_mk_cdev(MKDEV(SCSI_TAPE_MAJOR, dev_num + (mode << 5)),
+			      S_IFCHR | S_IRUGO | S_IWUGO,
+			      "%s/mt%s", SDp->devfs_name, st_formats[mode]);
+		/*  No-rewind entry  */
+		devfs_mk_cdev(MKDEV(SCSI_TAPE_MAJOR, dev_num + (mode << 5) + 128),
+			      S_IFCHR | S_IRUGO | S_IWUGO,
+			      "%s/mt%sn", SDp->devfs_name, st_formats[mode]);
 	}
 	disk->number = devfs_register_tape(SDp->devfs_name);
 
@@ -3924,18 +3938,30 @@
 
 	return 0;
 
+out_free_tape:
+	for (mode=0; mode < ST_NBR_MODES; mode++) {
+		STm = &(tpnt->modes[mode]);
+		for (j=0; j < 2; j++) {
+			if (STm->cdevs[j]) {
+				if (cdev == STm->cdevs[j])
+					cdev = NULL;
+				sysfs_remove_link(&STm->cdevs[j]->kobj, "device");
+				cdev_unmap(MKDEV(SCSI_TAPE_MAJOR,
+						 TAPE_MINOR(dev_num, mode, j)), 1);
+				cdev_del(STm->cdevs[j]);
+			}
+		}
+	}
+	if (cdev)
+		kobject_put(&cdev->kobj);
+	write_lock(&st_dev_arr_lock);
+	scsi_tapes[dev_num] = NULL;
+	st_nr_dev--;
+	write_unlock(&st_dev_arr_lock);
 out_put_disk:
 	put_disk(disk);
-	if (tpnt) {
-		for (i=0; i < ST_NBR_MODES; i++) {
-			STm = &(tpnt->modes[i]);
-			if (STm->cdevs[0])
-				kobject_put(&STm->cdevs[0]->kobj);
-			if (STm->cdevs[1])
-				kobject_put(&STm->cdevs[1]->kobj);
-		}
+	if (tpnt)
 		kfree(tpnt);
-	}
 out_buffer_free:
 	kfree(buffer);
 out:
@@ -3964,6 +3990,8 @@
 				for (j=0; j < 2; j++) {
 					sysfs_remove_link(&tpnt->modes[mode].cdevs[j]->kobj,
 							  "device");
+					cdev_unmap(MKDEV(SCSI_TAPE_MAJOR,
+							 TAPE_MINOR(i, mode, j)), 1);
 					cdev_del(tpnt->modes[mode].cdevs[j]);
 					tpnt->modes[mode].cdevs[j] = NULL;
 				}
@@ -3985,6 +4013,41 @@
 	return 0;
 }
 
+static void st_intr(struct scsi_cmnd *SCpnt)
+{
+	scsi_io_completion(SCpnt, (SCpnt->result ? 0: SCpnt->bufflen >> 9), 1);
+}
+
+/*
+ * st_init_command: only called via the scsi_cmd_ioctl (block SG_IO)
+ * interface for REQ_BLOCK_PC commands.
+ */
+static int st_init_command(struct scsi_cmnd *SCpnt)
+{
+	struct request *rq;
+
+	if (!(SCpnt->request->flags & REQ_BLOCK_PC))
+		return 0;
+
+	rq = SCpnt->request;
+	if (sizeof(rq->cmd) > sizeof(SCpnt->cmnd))
+		return 0;
+
+	memcpy(SCpnt->cmnd, rq->cmd, sizeof(SCpnt->cmnd));
+
+	if (rq_data_dir(rq) == WRITE)
+		SCpnt->sc_data_direction = DMA_TO_DEVICE;
+	else if (rq->data_len)
+		SCpnt->sc_data_direction = DMA_FROM_DEVICE;
+	else
+		SCpnt->sc_data_direction = DMA_NONE;
+
+	SCpnt->timeout_per_command = rq->timeout;
+	SCpnt->transfersize = rq->data_len;
+	SCpnt->done = st_intr;
+	return 1;
+}
+
 static int __init init_st(void)
 {
 	validate_options();
--- diff/drivers/serial/68360serial.c	2003-06-30 10:07:23.000000000 +0100
+++ source/drivers/serial/68360serial.c	2004-02-09 10:39:55.000000000 +0000
@@ -1282,12 +1282,19 @@
 }
 #endif
 
-static int get_modem_info(ser_info_t *info, unsigned int *value)
+static int rs_360_tiocmget(struct tty_struct *tty, struct file *file)
 {
+	ser_info_t *info = (ser_info_t *)tty->driver_data;
 	unsigned int result = 0;
 #ifdef modem_control
 	unsigned char control, status;
 
+	if (serial_paranoia_check(info, tty->name, __FUNCTION__))
+		return -ENODEV;
+
+	if (tty->flags & (1 << TTY_IO_ERROR))
+		return -EIO;
+
 	control = info->MCR;
 	local_irq_disable();
 	status = serial_in(info, UART_MSR);
@@ -1303,63 +1310,42 @@
 		| ((status  & UART_MSR_DSR) ? TIOCM_DSR : 0)
 		| ((status  & UART_MSR_CTS) ? TIOCM_CTS : 0);
 #endif
-	/* return put_user(result,value); */
-	put_user(result,value);
-	return (0);
+	return result;
 }
 
-static int set_modem_info(ser_info_t *info, unsigned int cmd,
-			  unsigned int *value)
+static int rs_360_tiocmset(struct tty_struct *tty, struct file *file,
+			   unsigned int set, unsigned int clear)
 {
-	int error;
- 	unsigned int arg; 
-
-	error = get_user(arg,value);
-	if (error)
-		return error;
 #ifdef modem_control
-	switch (cmd) {
-	case TIOCMBIS: 
-		if (arg & TIOCM_RTS)
-			info->MCR |= UART_MCR_RTS;
-		if (arg & TIOCM_DTR)
-			info->MCR |= UART_MCR_DTR;
-#ifdef TIOCM_OUT1
-		if (arg & TIOCM_OUT1)
-			info->MCR |= UART_MCR_OUT1;
-		if (arg & TIOCM_OUT2)
-			info->MCR |= UART_MCR_OUT2;
-#endif
-		break;
-	case TIOCMBIC:
-		if (arg & TIOCM_RTS)
-			info->MCR &= ~UART_MCR_RTS;
-		if (arg & TIOCM_DTR)
-			info->MCR &= ~UART_MCR_DTR;
-#ifdef TIOCM_OUT1
-		if (arg & TIOCM_OUT1)
-			info->MCR &= ~UART_MCR_OUT1;
-		if (arg & TIOCM_OUT2)
-			info->MCR &= ~UART_MCR_OUT2;
-#endif
-		break;
-	case TIOCMSET:
-		info->MCR = ((info->MCR & ~(UART_MCR_RTS |
-#ifdef TIOCM_OUT1
-					    UART_MCR_OUT1 |
-					    UART_MCR_OUT2 |
-#endif
-					    UART_MCR_DTR))
-			     | ((arg & TIOCM_RTS) ? UART_MCR_RTS : 0)
+	ser_info_t *info = (ser_info_t *)tty->driver_data;
+ 	unsigned int arg;
+
+	if (serial_paranoia_check(info, tty->name, __FUNCTION__))
+		return -ENODEV;
+
+	if (tty->flags & (1 << TTY_IO_ERROR))
+		return -EIO;
+
+ 	if (set & TIOCM_RTS)
+ 		info->mcr |= UART_MCR_RTS;
+ 	if (set & TIOCM_DTR)
+ 		info->mcr |= UART_MCR_DTR;
+	if (clear & TIOCM_RTS)
+		info->MCR &= ~UART_MCR_RTS;
+	if (clear & TIOCM_DTR)
+		info->MCR &= ~UART_MCR_DTR;
+
 #ifdef TIOCM_OUT1
-			     | ((arg & TIOCM_OUT1) ? UART_MCR_OUT1 : 0)
-			     | ((arg & TIOCM_OUT2) ? UART_MCR_OUT2 : 0)
+	if (set & TIOCM_OUT1)
+		info->MCR |= UART_MCR_OUT1;
+	if (set & TIOCM_OUT2)
+		info->MCR |= UART_MCR_OUT2;
+	if (clear & TIOCM_OUT1)
+		info->MCR &= ~UART_MCR_OUT1;
+	if (clear & TIOCM_OUT2)
+		info->MCR &= ~UART_MCR_OUT2;
 #endif
-			     | ((arg & TIOCM_DTR) ? UART_MCR_DTR : 0));
-		break;
-	default:
-		return -EINVAL;
-	}
+
 	local_irq_disable();
 	serial_out(info, UART_MCR, info->MCR);
 	local_irq_enable();
@@ -1506,12 +1492,6 @@
 				((tty->termios->c_cflag & ~CLOCAL) |
 				 (arg ? CLOCAL : 0));
 			return 0;
-		case TIOCMGET:
-			return get_modem_info(info, (unsigned int *) arg);
-		case TIOCMBIS:
-		case TIOCMBIC:
-		case TIOCMSET:
-			return set_modem_info(info, cmd, (unsigned int *) arg);
 #ifdef maybe
 		case TIOCSERGETLSR: /* Get line status register */
 			return get_lsr_info(info, (unsigned int *) arg);
@@ -2513,6 +2493,8 @@
 	.hangup = rs_360_hangup,
 	/* .wait_until_sent = rs_360_wait_until_sent, */
 	/* .read_proc = rs_360_read_proc, */
+	.tiocmget = rs_360_tiocmget,
+	.tiocmset = rs_360_tiocmset,
 };
 
 /* int __init rs_360_init(void) */
--- diff/drivers/serial/8250.c	2004-01-19 10:22:58.000000000 +0000
+++ source/drivers/serial/8250.c	2004-02-09 10:39:55.000000000 +0000
@@ -837,7 +837,7 @@
 		if (unlikely(tty->flip.count >= TTY_FLIPBUF_SIZE)) {
 			tty->flip.work.func((void *)tty);
 			if (tty->flip.count >= TTY_FLIPBUF_SIZE)
-				return; // if TTY_DONT_FLIP is set
+				return;	/* if TTY_DONT_FLIP is set */
 		}
 		ch = serial_inp(up, UART_RX);
 		*tty->flip.char_buf_ptr = ch;
@@ -1198,12 +1198,21 @@
 	spin_unlock_irqrestore(&up->port.lock, flags);
 }
 
+#ifdef CONFIG_KGDB
+static int kgdb_irq = -1;
+#endif
+
 static int serial8250_startup(struct uart_port *port)
 {
 	struct uart_8250_port *up = (struct uart_8250_port *)port;
 	unsigned long flags;
 	int retval;
 
+#ifdef CONFIG_KGDB
+	if (up->port.irq == kgdb_irq)
+		return -EBUSY;
+#endif
+
 	up->capabilities = uart_config[up->port.type].flags;
 
 	if (up->port.type == PORT_16C950) {
@@ -1869,6 +1878,10 @@
 	for (i = 0; i < UART_NR; i++) {
 		struct uart_8250_port *up = &serial8250_ports[i];
 
+#ifdef CONFIG_KGDB
+		if (up->port.irq == kgdb_irq)
+			up->port.kgdb = 1;
+#endif
 		up->port.line = i;
 		up->port.ops = &serial8250_pops;
 		init_timer(&up->timer);
@@ -2138,6 +2151,31 @@
 	uart_resume_port(&serial8250_reg, &serial8250_ports[line].port);
 }
 
+#ifdef CONFIG_KGDB
+/*
+ * Find all the ports using the given irq and shut them down.
+ * Result should be that the irq will be released.
+ */
+void shutdown_for_kgdb(struct async_struct * info)
+{
+        int irq = info->state->irq;
+        struct uart_8250_port *up;
+	int ttyS;
+
+	kgdb_irq = irq;			/* save for later init */
+	for (ttyS = 0; ttyS < UART_NR; ttyS++){
+		up =  &serial8250_ports[ttyS];
+		if (up->port.irq == irq && (irq_lists + irq)->head) {
+#ifdef CONFIG_DEBUG_SPINLOCK   /* ugly business... */
+			if(up->port.lock.magic != SPINLOCK_MAGIC)
+				spin_lock_init(&up->port.lock);
+#endif
+			serial8250_shutdown(&up->port);
+		}
+        }
+}
+#endif	/* CONFIG_KGDB */
+
 static int __init serial8250_init(void)
 {
 	int ret, i;
--- diff/drivers/serial/8250.h	2003-09-30 15:46:17.000000000 +0100
+++ source/drivers/serial/8250.h	2004-02-09 10:39:55.000000000 +0000
@@ -44,7 +44,7 @@
 
 #undef SERIAL_DEBUG_PCI
 
-#if defined(__i386__) && (defined(CONFIG_M386) || defined(CONFIG_M486))
+#if defined(__i386__) && (defined(CONFIG_CPU_386) || defined(CONFIG_CPU_486))
 #define SERIAL_INLINE
 #endif
   
--- diff/drivers/serial/8250_pci.c	2003-10-09 09:47:34.000000000 +0100
+++ source/drivers/serial/8250_pci.c	2004-02-09 10:39:55.000000000 +0000
@@ -43,20 +43,12 @@
 #define FL_BASE4		0x0004
 #define FL_GET_BASE(x)		(x & FL_BASE_MASK)
 
-#define FL_IRQ_MASK		(0x0007 << 4)
-#define FL_IRQBASE0		(0x0000 << 4)
-#define FL_IRQBASE1		(0x0001 << 4)
-#define FL_IRQBASE2		(0x0002 << 4)
-#define FL_IRQBASE3		(0x0003 << 4)
-#define FL_IRQBASE4		(0x0004 << 4)
-#define FL_GET_IRQBASE(x)	((x & FL_IRQ_MASK) >> 4)
-
 /* Use successive BARs (PCI base address registers),
    else use offset into some specified BAR */
 #define FL_BASE_BARS		0x0008
 
-/* Use the irq resource table instead of dev->irq */
-#define FL_IRQRESOURCE		0x0080
+/* do not assign an irq */
+#define FL_NOIRQ		0x0080
 
 /* Use the Base address register size to cap number of ports */
 #define FL_REGION_SZ_CAP	0x0100
@@ -850,17 +842,10 @@
 static _INLINE_ int
 get_pci_irq(struct pci_dev *dev, struct pci_board *board, int idx)
 {
-	int base_idx;
-
-	if ((board->flags & FL_IRQRESOURCE) == 0)
-		return dev->irq;
-
-	base_idx = FL_GET_IRQBASE(board->flags);
-
-	if (base_idx > DEVICE_COUNT_IRQ)
+	if (board->flags & FL_NOIRQ)
 		return 0;
-	
-	return dev->irq_resource[base_idx].start;
+	else
+		return dev->irq;
 }
 
 /*
@@ -1314,7 +1299,7 @@
 		.first_offset	= 0x10000,
 	},
 	[pbn_sgi_ioc3] = {
-		.flags		= FL_BASE0|FL_IRQRESOURCE,
+		.flags		= FL_BASE0|FL_NOIRQ,
 		.num_ports	= 1,
 		.base_baud	= 458333,
 		.uart_offset	= 8,
--- diff/drivers/serial/8250_pnp.c	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/serial/8250_pnp.c	2004-02-09 10:39:55.000000000 +0000
@@ -420,7 +420,9 @@
 
 static void serial_pnp_remove(struct pnp_dev * dev)
 {
-	return;
+	int line = (int)pnp_get_drvdata(dev);
+	if (line)
+		unregister_serial(line - 1);
 }
 
 static struct pnp_driver serial_pnp_driver = {
@@ -437,7 +439,7 @@
 
 static void __exit serial8250_pnp_exit(void)
 {
-	/* FIXME */
+	pnp_unregister_driver(&serial_pnp_driver);
 }
 
 module_init(serial8250_pnp_init);
--- diff/drivers/serial/mcfserial.c	2003-07-11 09:39:50.000000000 +0100
+++ source/drivers/serial/mcfserial.c	2004-02-09 10:39:55.000000000 +0000
@@ -985,6 +985,43 @@
 	local_irq_restore(flags);
 }
 
+static int mcfrs_tiocmget(struct tty_struct *tty, struct file *file)
+{
+	struct mcf_serial * info = (struct mcf_serial *)tty->driver_data;
+
+	if (serial_paranoia_check(info, tty->name, "mcfrs_ioctl"))
+		return -ENODEV;
+	if (tty->flags & (1 << TTY_IO_ERROR))
+		return -EIO;
+
+	return mcfrs_getsignals(info);
+}
+
+static int mcfrs_tiocmset(struct tty_struct *tty, struct file *file,
+			  unsigned int set, unsigned int clear)
+{
+	struct mcf_serial * info = (struct mcf_serial *)tty->driver_data;
+	int rts = -1, dtr = -1;
+
+	if (serial_paranoia_check(info, tty->name, "mcfrs_ioctl"))
+		return -ENODEV;
+	if (tty->flags & (1 << TTY_IO_ERROR))
+		return -EIO;
+
+	if (set & TIOCM_RTS)
+		rts = 1;
+	if (set & TIOCM_DTR)
+		dtr = 1;
+	if (clear & TIOCM_RTS)
+		rts = 0;
+	if (clear & TIOCM_DTR)
+		dtr = 0;
+
+	mcfrs_setsignals(info, dtr, rts);
+
+	return 0;
+}
+
 static int mcfrs_ioctl(struct tty_struct *tty, struct file * file,
 		    unsigned int cmd, unsigned long arg)
 {
@@ -1059,45 +1096,6 @@
 				    info, sizeof(struct mcf_serial));
 			return 0;
 			
-		case TIOCMGET:
-			if ((error = verify_area(VERIFY_WRITE, (void *) arg,
-                            sizeof(unsigned int))))
-                                return(error);
-			val = mcfrs_getsignals(info);
-			put_user(val, (unsigned int *) arg);
-			break;
-
-                case TIOCMBIS:
-			if ((error = verify_area(VERIFY_WRITE, (void *) arg,
-                            sizeof(unsigned int))))
-				return(error);
-
-			get_user(val, (unsigned int *) arg);
-			rts = (val & TIOCM_RTS) ? 1 : -1;
-			dtr = (val & TIOCM_DTR) ? 1 : -1;
-			mcfrs_setsignals(info, dtr, rts);
-			break;
-
-                case TIOCMBIC:
-			if ((error = verify_area(VERIFY_WRITE, (void *) arg,
-                            sizeof(unsigned int))))
-				return(error);
-			get_user(val, (unsigned int *) arg);
-			rts = (val & TIOCM_RTS) ? 0 : -1;
-			dtr = (val & TIOCM_DTR) ? 0 : -1;
-			mcfrs_setsignals(info, dtr, rts);
-			break;
-
-                case TIOCMSET:
-			if ((error = verify_area(VERIFY_WRITE, (void *) arg,
-                            sizeof(unsigned int))))
-				return(error);
-			get_user(val, (unsigned int *) arg);
-			rts = (val & TIOCM_RTS) ? 1 : 0;
-			dtr = (val & TIOCM_DTR) ? 1 : 0;
-			mcfrs_setsignals(info, dtr, rts);
-			break;
-
 #ifdef TIOCSET422
 		case TIOCSET422:
 			get_user(val, (unsigned int *) arg);
@@ -1563,6 +1561,8 @@
 	.start = mcfrs_start,
 	.hangup = mcfrs_hangup,
 	.read_proc = mcfrs_readproc,
+	.tiocmget = mcfrs_tiocmget,
+	.tiocmset = mcfrs_tiocmset,
 };
 
 /* mcfrs_init inits the driver */
--- diff/drivers/serial/pmac_zilog.c	2003-09-17 12:28:10.000000000 +0100
+++ source/drivers/serial/pmac_zilog.c	2004-02-09 10:39:55.000000000 +0000
@@ -1120,7 +1120,7 @@
  * Unlike sunzilog, we don't need to pre-init the spinlock as we don't
  * register our console before uart_add_one_port() is called
  */
-static int __init pmz_setup_port(struct uart_pmac_port *up, int early)
+static int __init pmz_setup_port(struct uart_pmac_port *up)
 {
 	struct device_node *np = up->node;
 	char *conn;
@@ -1133,11 +1133,6 @@
 	/*
 	 * Request & map chip registers
 	 */
-	if (!early && request_OF_resource(np, 0, NULL) == NULL) {
-		printk("pmac_zilog: failed to request resources for %s\n",
-			np->full_name);
-		return -EBUSY;
-	}
 	up->port.mapbase = np->addrs[0].address;
 	up->port.membase = ioremap(up->port.mapbase, 0x1000);
       
@@ -1152,27 +1147,23 @@
 		up->flags |= PMACZILOG_FLAG_HAS_DMA;
 #endif	
 	if (ZS_HAS_DMA(up)) {
-		if (!early && request_OF_resource(np, np->n_addrs - 2, " (tx dma)") == NULL) {
-			printk(KERN_ERR "pmac_zilog: can't request TX DMA resource !\n");
+		up->tx_dma_regs = (volatile struct dbdma_regs *)
+			ioremap(np->addrs[np->n_addrs - 2].address, 0x1000);
+		if (up->tx_dma_regs == NULL) {	
 			up->flags &= ~PMACZILOG_FLAG_HAS_DMA;
 			goto no_dma;
 		}
-		if (!early && request_OF_resource(np, np->n_addrs - 1, " (rx dma)") == NULL) {
-			release_OF_resource(np, np->n_addrs - 2);
-			printk(KERN_ERR "pmac_zilog: can't request RX DMA resource !\n");
+		up->rx_dma_regs = (volatile struct dbdma_regs *)
+			ioremap(np->addrs[np->n_addrs - 1].address, 0x1000);
+		if (up->rx_dma_regs == NULL) {	
+			iounmap((void *)up->tx_dma_regs);
 			up->flags &= ~PMACZILOG_FLAG_HAS_DMA;
 			goto no_dma;
 		}
-		up->tx_dma_regs = (volatile struct dbdma_regs *)
-			ioremap(np->addrs[np->n_addrs - 2].address, 0x1000);
-		up->rx_dma_regs = (volatile struct dbdma_regs *)
-			ioremap(np->addrs[np->n_addrs - 1].address, 0x1000);
 		up->tx_dma_irq = np->intrs[1].line;
 		up->rx_dma_irq = np->intrs[2].line;
 	}
 no_dma:
-	if (!early)
-		up->flags |= PMACZILOG_FLAG_RSRC_REQUESTED;
 
 	/*
 	 * Detect port type
@@ -1258,8 +1249,15 @@
 	 */
 	for (i = 0; i < MAX_ZS_PORTS; i++)
 		if (pmz_ports[i].node == mdev->ofdev.node) {
-			pmz_ports[i].dev = mdev;
-			dev_set_drvdata(&mdev->ofdev.dev, &pmz_ports[i]);
+			struct uart_pmac_port *up = &pmz_ports[i];
+
+			up->dev = mdev;
+			dev_set_drvdata(&mdev->ofdev.dev, up);
+			if (macio_request_resources(up->dev, "pmac_zilog"))
+				printk(KERN_WARNING "%s: Failed to request resource, port still active\n",
+				       up->node->name);
+			else
+				up->flags |= PMACZILOG_FLAG_RSRC_REQUESTED;				
 			return 0;
 		}
 	return -ENODEV;
@@ -1271,13 +1269,17 @@
  */
 static int pmz_detach(struct macio_dev *mdev)
 {
-	struct uart_pmac_port	*port = dev_get_drvdata(&mdev->ofdev.dev);
+	struct uart_pmac_port	*up = dev_get_drvdata(&mdev->ofdev.dev);
 	
-	if (!port)
+	if (!up)
 		return -ENODEV;
 
+	if (up->flags & PMACZILOG_FLAG_RSRC_REQUESTED) {
+		macio_release_resources(up->dev);
+		up->flags &= ~PMACZILOG_FLAG_RSRC_REQUESTED;
+	}
 	dev_set_drvdata(&mdev->ofdev.dev, NULL);
-	port->dev = NULL;
+	up->dev = NULL;
 	
 	return 0;
 }
@@ -1288,7 +1290,7 @@
  * used later to "attach" to the sysfs tree so we get power management
  * events
  */
-static int __init pmz_probe(int early)
+static int __init pmz_probe(void)
 {
 	struct device_node	*node_p, *node_a, *node_b, *np;
 	int			count = 0;
@@ -1333,9 +1335,9 @@
 		/*
 		 * Setup the ports for real
 		 */
-		rc = pmz_setup_port(&pmz_ports[count], early);
+		rc = pmz_setup_port(&pmz_ports[count]);
 		if (rc == 0)
-			rc = pmz_setup_port(&pmz_ports[count+1], early);
+			rc = pmz_setup_port(&pmz_ports[count+1]);
 		if (rc != 0) {
 			of_node_put(node_a);
 			of_node_put(node_b);
@@ -1436,43 +1438,10 @@
 //	.resume		= pmz_resume,  *** NYI
 };
 
-static void pmz_fixup_resources(void)
-{
-	int i;
-       	for (i=0; i<pmz_ports_count; i++) {
-       		struct uart_pmac_port *up = &pmz_ports[i];
-
-		if (up->node == NULL)
-			continue;
-       		if (up->flags & PMACZILOG_FLAG_RSRC_REQUESTED)
-			continue;
-		if (request_OF_resource(up->node, 0, NULL) == NULL)
-			printk(KERN_WARNING "%s: Failed to do late IO resource request, port still active\n",
-			       up->node->name);
-		up->flags |= PMACZILOG_FLAG_RSRC_REQUESTED;
-		if (!ZS_HAS_DMA(up))
-			continue;
-		if (request_OF_resource(up->node, up->node->n_addrs - 2, NULL) == NULL)
-			printk(KERN_WARNING "%s: Failed to do late DMA resource request, port still active\n",
-			       up->node->name);
-		if (request_OF_resource(up->node, up->node->n_addrs - 1, NULL) == NULL)
-			printk(KERN_WARNING "%s: Failed to do late DMA resource request, port still active\n",
-			       up->node->name);
-       	}
-
-}
-
 static int __init init_pmz(void)
 {
 	printk(KERN_DEBUG "%s\n", version);
 
-	/*
-	 * If we had serial console, then we didn't request
-	 * resources yet. We fix that up now
-	 */
-	if (pmz_ports_count > 0)
-		pmz_fixup_resources();
-
 	/* 
 	 * First, we need to do a direct OF-based probe pass. We
 	 * do that because we want serial console up before the
@@ -1481,7 +1450,7 @@
 	 * uart_register_driver()
 	 */
 	if (pmz_ports_count == 0)
-		pmz_probe(0);
+		pmz_probe();
 
 	/*
 	 * Bail early if no port found
@@ -1610,7 +1579,7 @@
 static int __init pmz_console_init(void)
 {
 	/* Probe ports */
-	pmz_probe(1);
+	pmz_probe();
 
 	/* TODO: Autoprobe console based on OF */
 	/* pmz_console.index = i; */
--- diff/drivers/serial/serial_core.c	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/serial/serial_core.c	2004-02-09 10:39:55.000000000 +0000
@@ -1987,6 +1987,11 @@
 {
 	unsigned int flags;
 
+#ifdef CONFIG_KGDB
+	if (port->kgdb)
+		return;
+#endif
+
 	/*
 	 * If there isn't a port here, don't do anything further.
 	 */
--- diff/drivers/tc/zs.c	2003-09-30 15:46:17.000000000 +0100
+++ source/drivers/tc/zs.c	2004-02-09 10:39:55.000000000 +0000
@@ -1176,11 +1176,21 @@
 	return 0;
 }
 
-static int get_modem_info(struct dec_serial *info, unsigned int *value)
+static int rs_tiocmget(struct tty_struct *tty, struct file *file)
 {
+	struct dec_serial * info = (struct dec_serial *)tty->driver_data;
 	unsigned char control, status_a, status_b;
 	unsigned int result;
 
+	if (info->hook)
+		return -ENODEV;
+
+	if (serial_paranoia_check(info, tty->name, __FUNCTION__))
+		return -ENODEV;
+
+	if (tty->flags & (1 << TTY_IO_ERROR))
+		return -EIO;
+
 	if (info->zs_channel == info->zs_chan_a)
 		result = 0;
 	else {
@@ -1196,41 +1206,37 @@
 			| ((status_a & SYNC_HUNT) ? TIOCM_DSR: 0)
 			| ((status_b & CTS) ? TIOCM_CTS: 0);
 	}
-	put_user(result, value);
-	return 0;
+	return result;
 }
 
-static int set_modem_info(struct dec_serial *info, unsigned int cmd,
-			  unsigned int *value)
+static int rs_tiocmset(struct tty_struct *tty, struct file *file,
+		       unsigned int set, unsigned int clear)
 {
+	struct dec_serial * info = (struct dec_serial *)tty->driver_data;
 	int error;
 	unsigned int arg, bits;
 
-	error = verify_area(VERIFY_READ, value, sizeof(int));
-	if (error)
-		return error;
+	if (info->hook)
+		return -ENODEV;
+
+	if (serial_paranoia_check(info, tty->name, __FUNCTION__))
+		return -ENODEV;
+
+	if (tty->flags & (1 << TTY_IO_ERROR))
+		return -EIO;
 
 	if (info->zs_channel == info->zs_chan_a)
 		return 0;
 
-	get_user(arg, value);
-	bits = (arg & TIOCM_RTS? RTS: 0) + (arg & TIOCM_DTR? DTR: 0);
 	cli();
-	switch (cmd) {
-	case TIOCMBIS:
-		info->zs_chan_a->curregs[5] |= bits;
-		break;
-	case TIOCMBIC:
-		info->zs_chan_a->curregs[5] &= ~bits;
-		break;
-	case TIOCMSET:
-		info->zs_chan_a->curregs[5] = 
-			(info->zs_chan_a->curregs[5] & ~(DTR | RTS)) | bits;
-		break;
-	default:
-		sti();
-		return -EINVAL;
-	}
+	if (set & TIOCM_RTS)
+		info->zs_chan_a->curregs[5] |= RTS;
+	if (set & TIOCM_DTR)
+		info->zs_chan_a->curregs[5] |= DTR;
+	if (clear & TIOCM_RTS)
+		info->zs_chan_a->curregs[5] &= ~RTS;
+	if (clear & TIOCM_DTR)
+		info->zs_chan_a->curregs[5] &= ~DTR;
 	write_zsreg(info->zs_chan_a, 5, info->zs_chan_a->curregs[5]);
 	sti();
 	return 0;
@@ -1278,16 +1284,6 @@
 	}
 	
 	switch (cmd) {
-		case TIOCMGET:
-			error = verify_area(VERIFY_WRITE, (void *) arg,
-				sizeof(unsigned int));
-			if (error)
-				return error;
-			return get_modem_info(info, (unsigned int *) arg);
-		case TIOCMBIS:
-		case TIOCMBIC:
-		case TIOCMSET:
-			return set_modem_info(info, cmd, (unsigned int *) arg);
 		case TIOCGSERIAL:
 			error = verify_area(VERIFY_WRITE, (void *) arg,
 						sizeof(struct serial_struct));
@@ -1816,6 +1812,8 @@
 	.hangup = rs_hangup,
 	.break_ctl = rs_break,
 	.wait_until_sent = rs_wait_until_sent,
+	.tiocmget = rs_tiocmget,
+	.tiocmset = rs_tiocmset,
 };
 
 /* zs_init inits the driver */
--- diff/drivers/usb/class/audio.c	2003-10-27 09:20:44.000000000 +0000
+++ source/drivers/usb/class/audio.c	2004-02-09 10:39:55.000000000 +0000
@@ -203,12 +203,12 @@
 
 #define AUDIO_DEBUG 1
 
-#define SND_DEV_DSP16   5 
+#define SND_DEV_DSP16   5
 
 #define dprintk(x)
 
 #undef abs
-extern int abs(int __x) __attribute__ ((__const__)); /* Shut up warning */
+extern int abs(int __x) __attribute_const__; /* Shut up warning */
 
 /* --------------------------------------------------------------------- */
 
--- diff/drivers/usb/class/cdc-acm.c	2004-01-19 10:22:58.000000000 +0000
+++ source/drivers/usb/class/cdc-acm.c	2004-02-09 10:39:55.000000000 +0000
@@ -399,6 +399,7 @@
 static int acm_tty_write(struct tty_struct *tty, int from_user, const unsigned char *buf, int count)
 {
 	struct acm *acm = tty->driver_data;
+	int stat;
 
 	if (!ACM_READY(acm))
 		return -EINVAL;
@@ -418,8 +419,12 @@
 	acm->writeurb->transfer_buffer_length = count;
 	acm->writeurb->dev = acm->dev;
 
-	if (usb_submit_urb(acm->writeurb, GFP_KERNEL))
+	/* GFP_KERNEL probably works if from_user */
+	stat = usb_submit_urb(acm->writeurb, GFP_ATOMIC);
+	if (stat < 0) {
 		dbg("usb_submit_urb(write bulk) failed");
+		return stat;
+	}
 
 	return count;
 }
--- diff/drivers/usb/core/Makefile	2003-02-13 11:46:54.000000000 +0000
+++ source/drivers/usb/core/Makefile	2004-02-09 10:39:55.000000000 +0000
@@ -2,7 +2,7 @@
 # Makefile for USB Core files and filesystem
 #
 
-usbcore-objs	:= usb.o usb-debug.o hub.o hcd.o urb.o message.o \
+usbcore-objs	:= usb.o hub.o hcd.o urb.o message.o \
 			config.o file.o buffer.o driverfs.o
 
 ifeq ($(CONFIG_PCI),y)
--- diff/drivers/usb/core/hcd.c	2004-01-19 10:22:58.000000000 +0000
+++ source/drivers/usb/core/hcd.c	2004-02-09 10:39:55.000000000 +0000
@@ -34,7 +34,10 @@
 #include <linux/slab.h>
 #include <linux/completion.h>
 #include <linux/uts.h>			/* for UTS_SYSNAME */
-#include <linux/pci.h>			/* for hcd->pdev and dma addressing */
+#include <linux/mm.h>
+#include <asm/io.h>
+#include <asm/scatterlist.h>
+#include <linux/device.h>
 #include <linux/dma-mapping.h>
 #include <asm/byteorder.h>
 
@@ -1474,16 +1477,16 @@
 	if (hcd->controller->dma_mask) {
 		if (usb_pipecontrol (urb->pipe)
 			&& !(urb->transfer_flags & URB_NO_SETUP_DMA_MAP))
-			pci_unmap_single (hcd->pdev, urb->setup_dma,
+			dma_unmap_single (hcd->controller, urb->setup_dma,
 					sizeof (struct usb_ctrlrequest),
-					PCI_DMA_TODEVICE);
+					DMA_TO_DEVICE);
 		if (urb->transfer_buffer_length != 0
 			&& !(urb->transfer_flags & URB_NO_TRANSFER_DMA_MAP))
-			pci_unmap_single (hcd->pdev, urb->transfer_dma,
+			dma_unmap_single (hcd->controller, urb->transfer_dma,
 					urb->transfer_buffer_length,
 					usb_pipein (urb->pipe)
-					    ? PCI_DMA_FROMDEVICE
-					    : PCI_DMA_TODEVICE);
+					    ? DMA_FROM_DEVICE
+					    : DMA_TO_DEVICE);
 	}
 
 	/* pass ownership to the completion handler */
@@ -1513,7 +1516,9 @@
 		return IRQ_NONE;
 
 	hcd->saw_irq = 1;
-	hcd->driver->irq (hcd, r);
+	if (hcd->driver->irq (hcd, r) == IRQ_NONE)
+		return IRQ_NONE;
+
 	if (hcd->state != start && hcd->state == USB_STATE_HALT)
 		usb_hc_died (hcd);
 	return IRQ_HANDLED;
--- diff/drivers/usb/core/hcd.h	2003-09-17 12:28:10.000000000 +0100
+++ source/drivers/usb/core/hcd.h	2004-02-09 10:39:55.000000000 +0000
@@ -163,7 +163,7 @@
 	const char	*description;	/* "ehci-hcd" etc */
 
 	/* irq handler */
-	void	(*irq) (struct usb_hcd *hcd, struct pt_regs *regs);
+	irqreturn_t	(*irq) (struct usb_hcd *hcd, struct pt_regs *regs);
 
 	int	flags;
 #define	HCD_MEMORY	0x0001		/* HC regs use memory (else I/O) */
--- diff/drivers/usb/core/hub.c	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/usb/core/hub.c	2004-02-09 10:39:55.000000000 +0000
@@ -179,7 +179,7 @@
 hub_clear_tt_buffer (struct usb_device *hub, u16 devinfo, u16 tt)
 {
 	return usb_control_msg (hub, usb_rcvctrlpipe (hub, 0),
-		HUB_CLEAR_TT_BUFFER, USB_DIR_IN | USB_RECIP_OTHER,
+		HUB_CLEAR_TT_BUFFER, USB_RT_PORT,
 		devinfo, tt, 0, 0, HZ);
 }
 
--- diff/drivers/usb/core/usb.c	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/usb/core/usb.c	2004-02-09 10:39:55.000000000 +0000
@@ -984,6 +984,19 @@
 	return retval;
 }
 
+static inline void usb_show_string(struct usb_device *dev, char *id, int index)
+{
+	char *buf;
+
+	if (!index)
+		return;
+	if (!(buf = kmalloc(256, GFP_KERNEL)))
+		return;
+	if (usb_string(dev, index, buf, 256) > 0)
+		dev_printk(KERN_INFO, &dev->dev, "%s: %s\n", id, buf);
+	kfree(buf);
+}
+
 /*
  * By the time we get here, we chose a new device address
  * and is in the default state. We need to identify the thing and
--- diff/drivers/usb/gadget/ether.c	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/usb/gadget/ether.c	2004-02-09 10:39:55.000000000 +0000
@@ -1798,9 +1798,7 @@
 	/* network device setup */
 	dev->net = net;
 	SET_MODULE_OWNER (net);
-	net->priv = dev;
 	strcpy (net->name, "usb%d");
-	ether_setup (net);
 
 	/* one random address for the gadget device ... both of these could
 	 * reasonably come from an id prom or a module parameter.
--- diff/drivers/usb/gadget/file_storage.c	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/usb/gadget/file_storage.c	2004-02-09 10:39:55.000000000 +0000
@@ -1,7 +1,7 @@
 /*
  * file_storage.c -- File-backed USB Storage Gadget, for USB development
  *
- * Copyright (C) 2003 Alan Stern
+ * Copyright (C) 2003, 2004 Alan Stern
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -244,7 +244,7 @@
 
 #define DRIVER_DESC		"File-backed Storage Gadget"
 #define DRIVER_NAME		"g_file_storage"
-#define DRIVER_VERSION		"14 January 2004"
+#define DRIVER_VERSION		"26 January 2004"
 
 static const char longname[] = DRIVER_DESC;
 static const char shortname[] = DRIVER_NAME;
@@ -435,7 +435,7 @@
 #define LDBG(lun,fmt,args...) \
 	yprintk(lun , KERN_DEBUG , fmt , ## args)
 #define MDBG(fmt,args...) \
-	printk(KERN_DEBUG DRIVER_NAME ": " fmt, ## args)
+	printk(KERN_DEBUG DRIVER_NAME ": " fmt , ## args)
 #else
 #define DBG(fsg,fmt,args...) \
 	do { } while (0)
@@ -473,7 +473,7 @@
 	yprintk(lun , KERN_INFO , fmt , ## args)
 
 #define MINFO(fmt,args...) \
-	printk(KERN_INFO DRIVER_NAME ": " fmt, ## args)
+	printk(KERN_INFO DRIVER_NAME ": " fmt , ## args)
 
 
 /*-------------------------------------------------------------------------*/
@@ -848,6 +848,7 @@
 	unsigned int		nluns;
 	struct lun		*luns;
 	struct lun		*curlun;
+	struct completion	lun_released;
 };
 
 typedef void (*fsg_routine_t)(struct fsg_dev *);
@@ -3771,6 +3772,13 @@
 
 /*-------------------------------------------------------------------------*/
 
+static void lun_release(struct device *dev)
+{
+	struct fsg_dev	*fsg = (struct fsg_dev *) dev_get_drvdata(dev);
+
+	complete(&fsg->lun_released);
+}
+
 static void fsg_unbind(struct usb_gadget *gadget)
 {
 	struct fsg_dev		*fsg = get_gadget_data(gadget);
@@ -3782,12 +3790,14 @@
 	clear_bit(REGISTERED, &fsg->atomic_bitflags);
 
 	/* Unregister the sysfs attribute files and the LUNs */
+	init_completion(&fsg->lun_released);
 	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);
+			device_unregister(&curlun->dev);
+			wait_for_completion(&fsg->lun_released);
 			curlun->registered = 0;
 		}
 	}
@@ -4140,6 +4150,7 @@
 			INFO(fsg, "failed to register LUN%d: %d\n", i, rc);
 		else {
 			curlun->registered = 1;
+			curlun->dev.release = lun_release;
 			device_create_file(&curlun->dev, &dev_attr_ro);
 			device_create_file(&curlun->dev, &dev_attr_file);
 		}
--- diff/drivers/usb/gadget/goku_udc.c	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/usb/gadget/goku_udc.c	2004-02-09 10:39:55.000000000 +0000
@@ -1111,7 +1111,7 @@
 	int t;
 
 	/* int_status is the same format ... */
-	t = snprintf(*next, *size,
+	t = scnprintf(*next, *size,
 		"%s %05X =" FOURBITS EIGHTBITS EIGHTBITS "\n",
 		label, mask,
 		(mask & INT_PWRDETECT) ? " power" : "",
@@ -1164,7 +1164,7 @@
 	/* basic device status */
 	tmp = readl(&regs->power_detect);
 	is_usb_connected = tmp & PW_DETECT;
-	t = snprintf(next, size,
+	t = scnprintf(next, size,
 		"%s - %s\n"
 		"%s version: %s %s\n"
 		"Gadget driver: %s\n"
@@ -1198,7 +1198,7 @@
 		goto done;
 
 	/* registers for (active) device and ep0 */
-	t = snprintf(next, size, "\nirqs %lu\ndataset %02x "
+	t = scnprintf(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),
@@ -1208,7 +1208,7 @@
 	next += t;
 
 	tmp = readl(&regs->dma_master);
-	t = snprintf(next, size,
+	t = scnprintf(next, size,
 		"dma %03X =" EIGHTBITS "%s %s\n", tmp,
 		(tmp & MST_EOPB_DIS) ? " eopb-" : "",
 		(tmp & MST_EOPB_ENA) ? " eopb+" : "",
@@ -1237,7 +1237,7 @@
 			continue;
 
 		tmp = readl(ep->reg_status);
-		t = snprintf(next, size,
+		t = scnprintf(next, size,
 			"%s %s max %u %s, irqs %lu, "
 			"status %02x (%s) " FOURBITS "\n",
 			ep->ep.name,
@@ -1277,7 +1277,7 @@
 		next += t;
 
 		if (list_empty(&ep->queue)) {
-			t = snprintf(next, size, "\t(nothing queued)\n");
+			t = scnprintf(next, size, "\t(nothing queued)\n");
 			if (t <= 0 || t > size)
 				goto done;
 			size -= t;
@@ -1295,7 +1295,7 @@
 			} else
 				tmp = req->req.actual;
 
-			t = snprintf(next, size,
+			t = scnprintf(next, size,
 				"\treq %p len %u/%u buf %p\n",
 				&req->req, tmp, req->req.length,
 				req->req.buf);
@@ -1913,7 +1913,7 @@
 	INFO(dev, "%s\n", driver_desc);
 	INFO(dev, "version: " DRIVER_VERSION " %s\n", dmastr());
 #ifndef __sparc__
-	snprintf(buf, sizeof buf, "%d", pdev->irq);
+	scnprintf(buf, sizeof buf, "%d", pdev->irq);
 	bufp = buf;
 #else
 	bufp = __irq_itoa(pdev->irq);
--- diff/drivers/usb/gadget/net2280.c	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/usb/gadget/net2280.c	2004-02-09 10:39:55.000000000 +0000
@@ -534,7 +534,10 @@
 	}
 
 	/* write just one packet at a time */
-	count = min (ep->ep.maxpacket, total);
+	count = ep->ep.maxpacket;
+	if (count > total)	/* min() cannot be used on a bitfield */
+		count = total;
+
 	VDEBUG (ep->dev, "write %s fifo (IN) %d bytes%s req %p\n",
 			ep->ep.name, count,
 			(count != ep->ep.maxpacket) ? " (short)" : "",
@@ -1436,7 +1439,7 @@
 			|| !dev->driver->function
 			|| strlen (dev->driver->function) > PAGE_SIZE)
 		return 0;
-	return snprintf (buf, PAGE_SIZE, "%s\n", dev->driver->function);
+	return scnprintf (buf, PAGE_SIZE, "%s\n", dev->driver->function);
 }
 static DEVICE_ATTR (function, S_IRUGO, show_function, NULL);
 
@@ -1462,7 +1465,7 @@
 		s = "(none)";
 
 	/* Main Control Registers */
-	t = snprintf (next, size, "%s version " DRIVER_VERSION
+	t = scnprintf (next, size, "%s version " DRIVER_VERSION
 			", chiprev %04x, dma %s\n\n"
 			"devinit %03x fifoctl %08x gadget '%s'\n"
 			"pci irqenb0 %02x irqenb1 %08x "
@@ -1494,7 +1497,7 @@
 		/* full speed bit (6) not working?? */
 	} else
 			s = "not attached";
-	t = snprintf (next, size,
+	t = scnprintf (next, size,
 			"stdrsp %08x usbctl %08x usbstat %08x "
 				"addr 0x%02x (%s)\n",
 			readl (&dev->usb->stdrsp), t1, t2,
@@ -1516,7 +1519,7 @@
 
 		t1 = readl (&ep->regs->ep_cfg);
 		t2 = readl (&ep->regs->ep_rsp) & 0xff;
-		t = snprintf (next, size,
+		t = scnprintf (next, size,
 				"\n%s\tcfg %05x rsp (%02x) %s%s%s%s%s%s%s%s"
 					"irqenb %02x\n",
 				ep->ep.name, t1, t2,
@@ -1540,7 +1543,7 @@
 		size -= t;
 		next += t;
 
-		t = snprintf (next, size,
+		t = scnprintf (next, size,
 				"\tstat %08x avail %04x "
 				"(ep%d%s-%s)%s\n",
 				readl (&ep->regs->ep_stat),
@@ -1554,7 +1557,7 @@
 		if (!ep->dma)
 			continue;
 
-		t = snprintf (next, size,
+		t = scnprintf (next, size,
 				"  dma\tctl %08x stat %08x count %08x\n"
 				"\taddr %08x desc %08x\n",
 				readl (&ep->dma->dmactl),
@@ -1571,7 +1574,7 @@
 		// none yet 
 
 	/* Statistics */
-	t = snprintf (next, size, "\nirqs:  ");
+	t = scnprintf (next, size, "\nirqs:  ");
 	size -= t;
 	next += t;
 	for (i = 0; i < 7; i++) {
@@ -1580,12 +1583,12 @@
 		ep = &dev->ep [i];
 		if (i && !ep->irqs)
 			continue;
-		t = snprintf (next, size, " %s/%lu", ep->ep.name, ep->irqs);
+		t = scnprintf (next, size, " %s/%lu", ep->ep.name, ep->irqs);
 		size -= t;
 		next += t;
 
 	}
-	t = snprintf (next, size, "\n");
+	t = scnprintf (next, size, "\n");
 	size -= t;
 	next += t;
 
@@ -1621,7 +1624,7 @@
 			if (!d)
 				continue;
 			t = d->bEndpointAddress;
-			t = snprintf (next, size,
+			t = scnprintf (next, size,
 				"\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",
@@ -1638,7 +1641,7 @@
 				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",
+			t = scnprintf (next, size, "ep0 max 64 pio %s\n",
 					ep->is_in ? "in" : "out");
 		if (t <= 0 || t > size)
 			goto done;
@@ -1646,7 +1649,7 @@
 		next += t;
 
 		if (list_empty (&ep->queue)) {
-			t = snprintf (next, size, "\t(nothing queued)\n");
+			t = scnprintf (next, size, "\t(nothing queued)\n");
 			if (t <= 0 || t > size)
 				goto done;
 			size -= t;
@@ -1655,14 +1658,14 @@
 		}
 		list_for_each_entry (req, &ep->queue, queue) {
 			if (ep->dma && req->td_dma == readl (&ep->dma->dmadesc))
-				t = snprintf (next, size,
+				t = scnprintf (next, size,
 					"\treq %p len %d/%d "
 					"buf %p (dmacount %08x)\n",
 					&req->req, req->req.actual,
 					req->req.length, req->req.buf,
 					readl (&ep->dma->dmacount));
 			else
-				t = snprintf (next, size,
+				t = scnprintf (next, size,
 					"\treq %p len %d/%d buf %p\n",
 					&req->req, req->req.actual,
 					req->req.length, req->req.buf);
@@ -1675,7 +1678,7 @@
 				struct net2280_dma	*td;
 
 				td = req->td;
-				t = snprintf (next, size, "\t    td %08x "
+				t = scnprintf (next, size, "\t    td %08x "
 					" count %08x buf %08x desc %08x\n",
 					req->td_dma, td->dmacount,
 					td->dmaaddr, td->dmadesc);
@@ -2197,7 +2200,8 @@
 		unsigned	len;
 
 		len = req->req.length - req->req.actual;
-		len = min (ep->ep.maxpacket, len);
+		if (len > ep->ep.maxpacket)
+			len = ep->ep.maxpacket;
 		req->req.actual += len;
 
 		/* if we wrote it all, we're usually done */
@@ -2784,7 +2788,7 @@
 		goto done;
 	}
 #ifndef __sparc__
-	snprintf (buf, sizeof buf, "%d", pdev->irq);
+	scnprintf (buf, sizeof buf, "%d", pdev->irq);
 	bufp = buf;
 #else
 	bufp = __irq_itoa(pdev->irq);
--- diff/drivers/usb/gadget/pxa2xx_udc.c	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/usb/gadget/pxa2xx_udc.c	2004-02-09 10:39:55.000000000 +0000
@@ -1215,7 +1215,7 @@
 	local_irq_save(flags);
 
 	/* basic device status */
-	t = snprintf(next, size, DRIVER_DESC "\n"
+	t = scnprintf(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)",
@@ -1224,14 +1224,14 @@
 	next += t;
 
 	/* registers for device and ep0 */
-	t = snprintf(next, size,
+	t = scnprintf(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,
+	t = scnprintf(next, size,
 		"udccr %02X =%s%s%s%s%s%s%s%s\n", tmp,
 		(tmp & UDCCR_REM) ? " rem" : "",
 		(tmp & UDCCR_RSTIR) ? " rstir" : "",
@@ -1245,7 +1245,7 @@
 	next += t;
 
 	tmp = UDCCS0;
-	t = snprintf(next, size,
+	t = scnprintf(next, size,
 		"udccs0 %02X =%s%s%s%s%s%s%s%s\n", tmp,
 		(tmp & UDCCS0_SA) ? " sa" : "",
 		(tmp & UDCCS0_RNE) ? " rne" : "",
@@ -1260,7 +1260,7 @@
 
 	if (dev->has_cfr) {
 		tmp = UDCCFR;
-		t = snprintf(next, size,
+		t = scnprintf(next, size,
 			"udccfr %02X =%s%s\n", tmp,
 			(tmp & UDCCFR_AREN) ? " aren" : "",
 			(tmp & UDCCFR_ACM) ? " acm" : "");
@@ -1271,7 +1271,7 @@
 	if (!is_usb_connected() || !dev->driver)
 		goto done;
 
-	t = snprintf(next, size, "ep0 IN %lu/%lu, OUT %lu/%lu\nirqs %lu\n\n",
+	t = scnprintf(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);
@@ -1291,7 +1291,7 @@
 			if (!d)
 				continue;
 			tmp = *dev->ep [i].reg_udccs;
-			t = snprintf(next, size,
+			t = scnprintf(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,
@@ -1299,7 +1299,7 @@
 			/* 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",
+			t = scnprintf(next, size, "ep0 max 16 pio irqs %lu\n",
 				ep->pio_irqs);
 		if (t <= 0 || t > size)
 			goto done;
@@ -1307,7 +1307,7 @@
 		next += t;
 
 		if (list_empty(&ep->queue)) {
-			t = snprintf(next, size, "\t(nothing queued)\n");
+			t = scnprintf(next, size, "\t(nothing queued)\n");
 			if (t <= 0 || t > size)
 				goto done;
 			size -= t;
@@ -1317,7 +1317,7 @@
 		list_for_each_entry(req, &ep->queue, queue) {
 #ifdef	USE_DMA
 			if (ep->dma >= 0 && req->queue.prev == &ep->queue)
-				t = snprintf(next, size,
+				t = scnprintf(next, size,
 					"\treq %p len %d/%d "
 					"buf %p (dma%d dcmd %08x)\n",
 					&req->req, req->req.actual,
@@ -1327,7 +1327,7 @@
 					);
 			else
 #endif
-				t = snprintf(next, size,
+				t = scnprintf(next, size,
 					"\treq %p len %d/%d buf %p\n",
 					&req->req, req->req.actual,
 					req->req.length, req->req.buf);
@@ -1365,7 +1365,7 @@
 			|| !dev->driver->function
 			|| strlen (dev->driver->function) > PAGE_SIZE)
 		return 0;
-	return snprintf (buf, PAGE_SIZE, "%s\n", dev->driver->function);
+	return scnprintf (buf, PAGE_SIZE, "%s\n", dev->driver->function);
 }
 static DEVICE_ATTR (function, S_IRUGO, show_function, NULL);
 
--- diff/drivers/usb/host/ehci-dbg.c	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/usb/host/ehci-dbg.c	2004-02-09 10:39:55.000000000 +0000
@@ -173,7 +173,7 @@
 static int __attribute__((__unused__))
 dbg_status_buf (char *buf, unsigned len, char *label, u32 status)
 {
-	return snprintf (buf, len,
+	return scnprintf (buf, len,
 		"%s%sstatus %04x%s%s%s%s%s%s%s%s%s%s",
 		label, label [0] ? " " : "", status,
 		(status & STS_ASS) ? " Async" : "",
@@ -192,7 +192,7 @@
 static int __attribute__((__unused__))
 dbg_intr_buf (char *buf, unsigned len, char *label, u32 enable)
 {
-	return snprintf (buf, len,
+	return scnprintf (buf, len,
 		"%s%sintrenable %02x%s%s%s%s%s%s",
 		label, label [0] ? " " : "", enable,
 		(enable & STS_IAA) ? " IAA" : "",
@@ -209,7 +209,7 @@
 
 static int dbg_command_buf (char *buf, unsigned len, char *label, u32 command)
 {
-	return snprintf (buf, len,
+	return scnprintf (buf, len,
 		"%s%scommand %06x %s=%d ithresh=%d%s%s%s%s period=%s%s %s",
 		label, label [0] ? " " : "", command,
 		(command & CMD_PARK) ? "park" : "(park)",
@@ -238,7 +238,7 @@
 	default: sig = "?"; break;
 	}
 
-	return snprintf (buf, len,
+	return scnprintf (buf, len,
 		"%s%sport %d status %06x%s%s sig=%s %s%s%s%s%s%s%s%s%s",
 		label, label [0] ? " " : "", port, status,
 		(status & PORT_POWER) ? " POWER" : "",
@@ -359,7 +359,7 @@
 	}
 	scratch = cpu_to_le32p (&qh->hw_info1);
 	hw_curr = (mark == '*') ? cpu_to_le32p (&qh->hw_current) : 0;
-	temp = snprintf (next, size,
+	temp = scnprintf (next, size,
 			"qh/%p dev%d %cs ep%d %08x %08x (%08x%c %s nak%d)",
 			qh, scratch & 0x007f,
 			speed_char (scratch),
@@ -449,7 +449,7 @@
 	for (qh = ehci->async->qh_next.qh; size > 0 && qh; qh = qh->qh_next.qh)
 		qh_lines (ehci, qh, &next, &size);
 	if (ehci->reclaim && size > 0) {
-		temp = snprintf (next, size, "\nreclaim =\n");
+		temp = scnprintf (next, size, "\nreclaim =\n");
 		size -= temp;
 		next += temp;
 
@@ -486,7 +486,7 @@
 	next = buf;
 	size = PAGE_SIZE;
 
-	temp = snprintf (next, size, "size = %d\n", ehci->periodic_size);
+	temp = scnprintf (next, size, "size = %d\n", ehci->periodic_size);
 	size -= temp;
 	next += temp;
 
@@ -500,14 +500,14 @@
 			continue;
 		tag = Q_NEXT_TYPE (ehci->periodic [i]);
 
-		temp = snprintf (next, size, "%4d: ", i);
+		temp = scnprintf (next, size, "%4d: ", i);
 		size -= temp;
 		next += temp;
 
 		do {
 			switch (tag) {
 			case Q_TYPE_QH:
-				temp = snprintf (next, size, " qh%d-%04x/%p",
+				temp = scnprintf (next, size, " qh%d-%04x/%p",
 						p.qh->period,
 						le32_to_cpup (&p.qh->hw_info2)
 							/* uframe masks */
@@ -520,7 +520,7 @@
 					if (seen [temp].ptr != p.ptr)
 						continue;
 					if (p.qh->qh_next.ptr)
-						temp = snprintf (next, size,
+						temp = scnprintf (next, size,
 							" ...");
 					p.ptr = 0;
 					break;
@@ -545,7 +545,7 @@
 						}
 					}
 
-					temp = snprintf (next, size,
+					temp = scnprintf (next, size,
 						" (%c%d ep%d%s "
 						"[%d/%d] q%d p%d)",
 						speed_char (scratch),
@@ -565,20 +565,20 @@
 				}
 				break;
 			case Q_TYPE_FSTN:
-				temp = snprintf (next, size,
+				temp = scnprintf (next, size,
 					" fstn-%8x/%p", p.fstn->hw_prev,
 					p.fstn);
 				tag = Q_NEXT_TYPE (p.fstn->hw_next);
 				p = p.fstn->fstn_next;
 				break;
 			case Q_TYPE_ITD:
-				temp = snprintf (next, size,
+				temp = scnprintf (next, size,
 					" itd/%p", p.itd);
 				tag = Q_NEXT_TYPE (p.itd->hw_next);
 				p = p.itd->itd_next;
 				break;
 			case Q_TYPE_SITD:
-				temp = snprintf (next, size,
+				temp = scnprintf (next, size,
 					" sitd/%p", p.sitd);
 				tag = Q_NEXT_TYPE (p.sitd->hw_next);
 				p = p.sitd->sitd_next;
@@ -588,7 +588,7 @@
 			next += temp;
 		} while (p.ptr);
 
-		temp = snprintf (next, size, "\n");
+		temp = scnprintf (next, size, "\n");
 		size -= temp;
 		next += temp;
 	}
@@ -623,7 +623,7 @@
 
 	/* Capability Registers */
 	i = HC_VERSION(readl (&ehci->caps->hc_capbase));
-	temp = snprintf (next, size,
+	temp = scnprintf (next, size,
 		"PCI device %s\nEHCI %x.%02x, hcd state %d (driver " DRIVER_VERSION ")\n",
 		pci_name(hcd->pdev),
 		i >> 8, i & 0x0ff, ehci->hcd.state);
@@ -632,35 +632,35 @@
 
 	// FIXME interpret both types of params
 	i = readl (&ehci->caps->hcs_params);
-	temp = snprintf (next, size, "structural params 0x%08x\n", i);
+	temp = scnprintf (next, size, "structural params 0x%08x\n", i);
 	size -= temp;
 	next += temp;
 
 	i = readl (&ehci->caps->hcc_params);
-	temp = snprintf (next, size, "capability params 0x%08x\n", i);
+	temp = scnprintf (next, size, "capability params 0x%08x\n", i);
 	size -= temp;
 	next += temp;
 
 	/* Operational Registers */
 	temp = dbg_status_buf (scratch, sizeof scratch, label,
 			readl (&ehci->regs->status));
-	temp = snprintf (next, size, fmt, temp, scratch);
+	temp = scnprintf (next, size, fmt, temp, scratch);
 	size -= temp;
 	next += temp;
 
 	temp = dbg_command_buf (scratch, sizeof scratch, label,
 			readl (&ehci->regs->command));
-	temp = snprintf (next, size, fmt, temp, scratch);
+	temp = scnprintf (next, size, fmt, temp, scratch);
 	size -= temp;
 	next += temp;
 
 	temp = dbg_intr_buf (scratch, sizeof scratch, label,
 			readl (&ehci->regs->intr_enable));
-	temp = snprintf (next, size, fmt, temp, scratch);
+	temp = scnprintf (next, size, fmt, temp, scratch);
 	size -= temp;
 	next += temp;
 
-	temp = snprintf (next, size, "uframe %04x\n",
+	temp = scnprintf (next, size, "uframe %04x\n",
 			readl (&ehci->regs->frame_index));
 	size -= temp;
 	next += temp;
@@ -668,13 +668,13 @@
 	for (i = 0; i < HCS_N_PORTS (ehci->hcs_params); i++) {
 		temp = dbg_port_buf (scratch, sizeof scratch, label, i,
 				readl (&ehci->regs->port_status [i]));
-		temp = snprintf (next, size, fmt, temp, scratch);
+		temp = scnprintf (next, size, fmt, temp, scratch);
 		size -= temp;
 		next += temp;
 	}
 
 	if (ehci->reclaim) {
-		temp = snprintf (next, size, "reclaim qh %p%s\n",
+		temp = scnprintf (next, size, "reclaim qh %p%s\n",
 				ehci->reclaim,
 				ehci->reclaim_ready ? " ready" : "");
 		size -= temp;
@@ -682,14 +682,14 @@
 	}
 
 #ifdef EHCI_STATS
-	temp = snprintf (next, size,
+	temp = scnprintf (next, size,
 		"irq normal %ld err %ld reclaim %ld (lost %ld)\n",
 		ehci->stats.normal, ehci->stats.error, ehci->stats.reclaim,
 		ehci->stats.lost_iaa);
 	size -= temp;
 	next += temp;
 
-	temp = snprintf (next, size, "complete %ld unlink %ld\n",
+	temp = scnprintf (next, size, "complete %ld unlink %ld\n",
 		ehci->stats.complete, ehci->stats.unlink);
 	size -= temp;
 	next += temp;
--- diff/drivers/usb/host/ehci-hcd.c	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/usb/host/ehci-hcd.c	2004-02-09 10:39:55.000000000 +0000
@@ -680,7 +680,7 @@
 
 /*-------------------------------------------------------------------------*/
 
-static void ehci_irq (struct usb_hcd *hcd, struct pt_regs *regs)
+static irqreturn_t ehci_irq (struct usb_hcd *hcd, struct pt_regs *regs)
 {
 	struct ehci_hcd		*ehci = hcd_to_ehci (hcd);
 	u32			status;
@@ -690,6 +690,12 @@
 
 	status = readl (&ehci->regs->status);
 
+	/* shared irq */
+	if (status == 0) {
+		spin_unlock (&ehci->lock);
+		return IRQ_NONE;
+	}
+
 	/* e.g. cardbus physical eject */
 	if (status == ~(u32) 0) {
 		ehci_dbg (ehci, "device removed\n");
@@ -743,6 +749,7 @@
 		ehci_work (ehci, regs);
 done:
 	spin_unlock (&ehci->lock);
+	return IRQ_HANDLED;
 }
 
 /*-------------------------------------------------------------------------*/
--- diff/drivers/usb/host/ohci-dbg.c	2004-01-19 10:22:58.000000000 +0000
+++ source/drivers/usb/host/ohci-dbg.c	2004-02-09 10:39:55.000000000 +0000
@@ -76,7 +76,7 @@
 	do { \
 	if (next) { \
 		unsigned s_len; \
-		s_len = snprintf (*next, *size, format, ## arg ); \
+		s_len = scnprintf (*next, *size, format, ## arg ); \
 		*size -= s_len; *next += s_len; \
 	} else \
 		ohci_dbg(ohci,format, ## arg ); \
@@ -420,7 +420,7 @@
 		struct list_head	*entry;
 		struct td		*td;
 
-		temp = snprintf (buf, size,
+		temp = scnprintf (buf, size,
 			"ed/%p %cs dev%d ep%d%s max %d %08x%s%s %s",
 			ed,
 			(info & ED_LOWSPEED) ? 'l' : 'f',
@@ -442,7 +442,7 @@
 			scratch = cpu_to_le32p (&td->hwINFO);
 			cbp = le32_to_cpup (&td->hwCBP);
 			be = le32_to_cpup (&td->hwBE);
-			temp = snprintf (buf, size,
+			temp = scnprintf (buf, size,
 					"\n\ttd %p %s %d cc=%x urb %p (%08x)",
 					td,
 					({ char *pid;
@@ -458,7 +458,7 @@
 			buf += temp;
 		}
 
-		temp = snprintf (buf, size, "\n");
+		temp = scnprintf (buf, size, "\n");
 		size -= temp;
 		buf += temp;
 
@@ -515,7 +515,7 @@
 	next = buf;
 	size = PAGE_SIZE;
 
-	temp = snprintf (next, size, "size = %d\n", NUM_INTS);
+	temp = scnprintf (next, size, "size = %d\n", NUM_INTS);
 	size -= temp;
 	next += temp;
 
@@ -525,12 +525,12 @@
 		if (!(ed = ohci->periodic [i]))
 			continue;
 
-		temp = snprintf (next, size, "%2d [%3d]:", i, ohci->load [i]);
+		temp = scnprintf (next, size, "%2d [%3d]:", i, ohci->load [i]);
 		size -= temp;
 		next += temp;
 
 		do {
-			temp = snprintf (next, size, " ed%d/%p",
+			temp = scnprintf (next, size, " ed%d/%p",
 				ed->interval, ed);
 			size -= temp;
 			next += temp;
@@ -550,7 +550,7 @@
 				list_for_each (entry, &ed->td_list)
 					qlen++;
 
-				temp = snprintf (next, size,
+				temp = scnprintf (next, size,
 					" (%cs dev%d ep%d%s-%s qlen %u"
 					" max %d %08x%s%s)",
 					(info & ED_LOWSPEED) ? 'l' : 'f',
@@ -579,7 +579,7 @@
 
 		} while (ed);
 
-		temp = snprintf (next, size, "\n");
+		temp = scnprintf (next, size, "\n");
 		size -= temp;
 		next += temp;
 	}
@@ -628,7 +628,7 @@
 
 	/* other registers mostly affect frame timings */
 	rdata = readl (&regs->fminterval);
-	temp = snprintf (next, size,
+	temp = scnprintf (next, size,
 			"fmintvl 0x%08x %sFSMPS=0x%04x FI=0x%04x\n",
 			rdata, (rdata >> 31) ? " FIT" : "",
 			(rdata >> 16) & 0xefff, rdata & 0xffff);
@@ -636,20 +636,20 @@
 	next += temp;
 
 	rdata = readl (&regs->fmremaining);
-	temp = snprintf (next, size, "fmremaining 0x%08x %sFR=0x%04x\n",
+	temp = scnprintf (next, size, "fmremaining 0x%08x %sFR=0x%04x\n",
 			rdata, (rdata >> 31) ? " FRT" : "",
 			rdata & 0x3fff);
 	size -= temp;
 	next += temp;
 
 	rdata = readl (&regs->periodicstart);
-	temp = snprintf (next, size, "periodicstart 0x%04x\n",
+	temp = scnprintf (next, size, "periodicstart 0x%04x\n",
 			rdata & 0x3fff);
 	size -= temp;
 	next += temp;
 
 	rdata = readl (&regs->lsthresh);
-	temp = snprintf (next, size, "lsthresh 0x%04x\n",
+	temp = scnprintf (next, size, "lsthresh 0x%04x\n",
 			rdata & 0x3fff);
 	size -= temp;
 	next += temp;
--- diff/drivers/usb/host/ohci-hcd.c	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/usb/host/ohci-hcd.c	2004-02-09 10:39:55.000000000 +0000
@@ -545,7 +545,7 @@
 
 /* an interrupt happens */
 
-static void ohci_irq (struct usb_hcd *hcd, struct pt_regs *ptregs)
+static irqreturn_t ohci_irq (struct usb_hcd *hcd, struct pt_regs *ptregs)
 {
 	struct ohci_hcd		*ohci = hcd_to_ohci (hcd);
 	struct ohci_regs	*regs = ohci->regs;
@@ -560,11 +560,11 @@
 	} else if ((ints = readl (&regs->intrstatus)) == ~(u32)0) {
 		disable (ohci);
 		ohci_dbg (ohci, "device removed!\n");
-		return;
+		return IRQ_HANDLED;
 
 	/* interrupt for some other device? */
 	} else if ((ints &= readl (&regs->intrenable)) == 0) {
-		return;
+		return IRQ_NONE;
 	} 
 
 	if (ints & OHCI_INTR_UE) {
@@ -604,6 +604,8 @@
 		// flush those pci writes
 		(void) readl (&ohci->regs->control);
 	}
+
+	return IRQ_HANDLED;
 }
 
 /*-------------------------------------------------------------------------*/
--- diff/drivers/usb/host/ohci-sa1111.c	2003-09-17 12:28:10.000000000 +0100
+++ source/drivers/usb/host/ohci-sa1111.c	2004-02-09 10:39:55.000000000 +0000
@@ -254,8 +254,6 @@
 	hcd_buffer_destroy (hcd);
 
 	usb_deregister_bus (&hcd->self);
-	if (atomic_read (&hcd->self.refcnt) != 1)
-		err ("%s: %s, count != 1", __FUNCTION__, hcd->self.bus_name);
 
 	base = hcd->regs;
 	hcd->driver->hcd_free (hcd);
--- diff/drivers/usb/host/uhci-hcd.c	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/usb/host/uhci-hcd.c	2004-02-09 10:39:55.000000000 +0000
@@ -1909,7 +1909,7 @@
 	spin_unlock_irqrestore(&uhci->urb_remove_list_lock, flags);
 }
 
-static void uhci_irq(struct usb_hcd *hcd, struct pt_regs *regs)
+static irqreturn_t uhci_irq(struct usb_hcd *hcd, struct pt_regs *regs)
 {
 	struct uhci_hcd *uhci = hcd_to_uhci(hcd);
 	unsigned int io_addr = uhci->io_addr;
@@ -1922,7 +1922,7 @@
 	 */
 	status = inw(io_addr + USBSTS);
 	if (!status)	/* shared interrupt, not mine */
-		return;
+		return IRQ_NONE;
 	outw(status, io_addr + USBSTS);		/* Clear it */
 
 	if (status & ~(USBSTS_USBINT | USBSTS_ERROR | USBSTS_RD)) {
@@ -1963,6 +1963,7 @@
 	spin_unlock(&uhci->urb_list_lock);
 
 	uhci_finish_completion(hcd, regs);
+	return IRQ_HANDLED;
 }
 
 static void reset_hc(struct uhci_hcd *uhci)
--- diff/drivers/usb/image/Kconfig	2003-12-19 09:51:11.000000000 +0000
+++ source/drivers/usb/image/Kconfig	2004-02-09 10:39:55.000000000 +0000
@@ -19,7 +19,7 @@
 
 config USB_SCANNER
 	tristate "USB Scanner support (OBSOLETE)"
-	depends on USB
+	depends on USB && BROKEN
 	help
 	  Say Y here if you want to connect a USB scanner to your computer's
 	  USB port. Please read <file:Documentation/usb/scanner.txt> for more
--- diff/drivers/usb/input/hid-core.c	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/usb/input/hid-core.c	2004-02-09 10:39:55.000000000 +0000
@@ -224,6 +224,9 @@
 	offset = report->size;
 	report->size += parser->global.report_size * parser->global.report_count;
 
+	if (usages < parser->global.report_count)
+		usages = parser->global.report_count;
+
 	if (usages == 0)
 		return 0; /* ignore padding fields */
 
@@ -235,9 +238,13 @@
 	field->application = hid_lookup_collection(parser, HID_COLLECTION_APPLICATION);
 
 	for (i = 0; i < usages; i++) {
-		field->usage[i].hid = parser->local.usage[i];
+		int j = i;
+		/* Duplicate the last usage we parsed if we have excess values */
+		if (i >= parser->local.usage_index)
+			j = parser->local.usage_index - 1;
+		field->usage[i].hid = parser->local.usage[j];
 		field->usage[i].collection_index =
-			parser->local.collection_index[i];
+			parser->local.collection_index[j];
 	}
 
 	field->maxusage = usages;
@@ -602,14 +609,16 @@
 		case 2:
 			if ((end - start) < 2) 
 				return NULL;
-			item->data.u16 = le16_to_cpu(get_unaligned(((__u16*)start)++));
+			item->data.u16 = le16_to_cpu(get_unaligned((__u16*)start));
+			start = (__u8 *)((__u16 *)start + 1);
 			return start;
 
 		case 3:
 			item->size++;
 			if ((end - start) < 4)
 				return NULL;
-			item->data.u32 = le32_to_cpu(get_unaligned(((__u32*)start)++));
+			item->data.u32 = le32_to_cpu(get_unaligned((__u32*)start));
+			start = (__u8 *)((__u32 *)start + 1);
 			return start;
 	}
 
@@ -1315,7 +1324,6 @@
 #define USB_VENDOR_ID_KBGEAR            0x084e
 #define USB_DEVICE_ID_KBGEAR_JAMSTUDIO  0x1001
 
-
 #define USB_VENDOR_ID_AIPTEK		0x08ca
 #define USB_DEVICE_ID_AIPTEK_6000	0x0020
 
@@ -1354,17 +1362,40 @@
 #define USB_VENDOR_ID_A4TECH		0x09DA
 #define USB_DEVICE_ID_A4TECH_WCP32PU	0x0006
 
+#define USB_VENDOR_ID_CYPRESS		0x04b4
+#define USB_DEVICE_ID_CYPRESS_MOUSE	0x0001
+
 #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
 
+#define USB_VENDOR_ID_SAITEK		0x06a3
+#define USB_DEVICE_ID_SAITEK_RUMBLEPAD	0xff17
+
 struct hid_blacklist {
 	__u16 idVendor;
 	__u16 idProduct;
 	unsigned quirks;
 } hid_blacklist[] = {
+
+	{ USB_VENDOR_ID_AIPTEK, USB_DEVICE_ID_AIPTEK_6000, HID_QUIRK_IGNORE },
+	{ USB_VENDOR_ID_BERKSHIRE, USB_DEVICE_ID_BERKSHIRE_PCWD, HID_QUIRK_IGNORE },
+	{ USB_VENDOR_ID_ESSENTIAL_REALITY, USB_DEVICE_ID_ESSENTIAL_REALITY_P5, HID_QUIRK_IGNORE },
+	{ USB_VENDOR_ID_KBGEAR, USB_DEVICE_ID_KBGEAR_JAMSTUDIO, HID_QUIRK_IGNORE },
+	{ USB_VENDOR_ID_GRIFFIN, USB_DEVICE_ID_POWERMATE, HID_QUIRK_IGNORE },
+	{ USB_VENDOR_ID_GRIFFIN, USB_DEVICE_ID_SOUNDKNOB, HID_QUIRK_IGNORE },
+	{ USB_VENDOR_ID_MGE, USB_DEVICE_ID_MGE_UPS, HID_QUIRK_IGNORE },
+	{ USB_VENDOR_ID_MGE, USB_DEVICE_ID_MGE_UPS1, HID_QUIRK_IGNORE },
+
+	{ USB_VENDOR_ID_ONTRAK, USB_DEVICE_ID_ONTRAK_ADU100, HID_QUIRK_IGNORE },
+	{ USB_VENDOR_ID_ONTRAK, USB_DEVICE_ID_ONTRAK_ADU100 + 100, HID_QUIRK_IGNORE },
+	{ USB_VENDOR_ID_ONTRAK, USB_DEVICE_ID_ONTRAK_ADU100 + 200, HID_QUIRK_IGNORE },
+	{ USB_VENDOR_ID_ONTRAK, USB_DEVICE_ID_ONTRAK_ADU100 + 300, HID_QUIRK_IGNORE },
+	{ USB_VENDOR_ID_ONTRAK, USB_DEVICE_ID_ONTRAK_ADU100 + 400, HID_QUIRK_IGNORE },
+	{ USB_VENDOR_ID_ONTRAK, USB_DEVICE_ID_ONTRAK_ADU100 + 500, HID_QUIRK_IGNORE },
+
 	{ USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_PENPARTNER, HID_QUIRK_IGNORE },
 	{ 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 },
@@ -1386,32 +1417,24 @@
 	{ USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS2 + 2, HID_QUIRK_IGNORE },
 	{ USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS2 + 3, HID_QUIRK_IGNORE },
 	{ USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS2 + 4, HID_QUIRK_IGNORE },
-	{ USB_VENDOR_ID_KBGEAR, USB_DEVICE_ID_KBGEAR_JAMSTUDIO, HID_QUIRK_IGNORE },
-	{ USB_VENDOR_ID_AIPTEK, USB_DEVICE_ID_AIPTEK_6000, HID_QUIRK_IGNORE },
-	{ USB_VENDOR_ID_GRIFFIN, USB_DEVICE_ID_POWERMATE, HID_QUIRK_IGNORE },
-	{ USB_VENDOR_ID_GRIFFIN, USB_DEVICE_ID_SOUNDKNOB, HID_QUIRK_IGNORE },
+
 	{ USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_UC100KM, HID_QUIRK_NOGET },
 	{ USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_CS124U, HID_QUIRK_NOGET },
 	{ USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_2PORTKVM, HID_QUIRK_NOGET },
 	{ USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_4PORTKVM, HID_QUIRK_NOGET },
 	{ USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_4PORTKVMC, HID_QUIRK_NOGET },
-	{ USB_VENDOR_ID_MGE, USB_DEVICE_ID_MGE_UPS, HID_QUIRK_IGNORE },
-	{ USB_VENDOR_ID_MGE, USB_DEVICE_ID_MGE_UPS1, HID_QUIRK_IGNORE },
-	{ USB_VENDOR_ID_TOPMAX, USB_DEVICE_ID_TOPMAX_COBRAPAD, HID_QUIRK_BADPAD },
-	{ USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_DRIVING, HID_QUIRK_BADPAD|HID_QUIRK_MULTI_INPUT },
-	{ USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_FLYING, HID_QUIRK_BADPAD|HID_QUIRK_MULTI_INPUT },
-	{ USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_FIGHTING, HID_QUIRK_BADPAD|HID_QUIRK_MULTI_INPUT },
-	{ USB_VENDOR_ID_ONTRAK, USB_DEVICE_ID_ONTRAK_ADU100, HID_QUIRK_IGNORE },
-	{ USB_VENDOR_ID_ONTRAK, USB_DEVICE_ID_ONTRAK_ADU100 + 100, HID_QUIRK_IGNORE },
-	{ USB_VENDOR_ID_ONTRAK, USB_DEVICE_ID_ONTRAK_ADU100 + 200, HID_QUIRK_IGNORE },
-	{ USB_VENDOR_ID_ONTRAK, USB_DEVICE_ID_ONTRAK_ADU100 + 300, HID_QUIRK_IGNORE },
-	{ USB_VENDOR_ID_ONTRAK, USB_DEVICE_ID_ONTRAK_ADU100 + 400, HID_QUIRK_IGNORE },
-	{ USB_VENDOR_ID_ONTRAK, USB_DEVICE_ID_ONTRAK_ADU100 + 500, HID_QUIRK_IGNORE },
 	{ USB_VENDOR_ID_TANGTOP, USB_DEVICE_ID_TANGTOP_USBPS2, HID_QUIRK_NOGET },
-	{ 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_A4TECH, USB_DEVICE_ID_A4TECH_WCP32PU, HID_QUIRK_2WHEEL_MOUSE_HACK_BACK },
+	{ USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_MOUSE, HID_QUIRK_2WHEEL_MOUSE_HACK_EXTRA },
+
 	{ USB_VENDOR_ID_ALPS, USB_DEVICE_ID_IBM_GAMEPAD, HID_QUIRK_BADPAD },
+	{ USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_DRIVING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT },
+	{ USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_FLYING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT },
+	{ USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_FIGHTING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT },
+	{ USB_VENDOR_ID_SAITEK, USB_DEVICE_ID_SAITEK_RUMBLEPAD, HID_QUIRK_BADPAD },
+	{ USB_VENDOR_ID_TOPMAX, USB_DEVICE_ID_TOPMAX_COBRAPAD, HID_QUIRK_BADPAD },
+
 	{ 0, 0 }
 };
 
--- diff/drivers/usb/input/hid-input.c	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/usb/input/hid-input.c	2004-02-09 10:39:55.000000000 +0000
@@ -377,7 +377,8 @@
 
 	set_bit(usage->type, input->evbit);
 	if ((usage->type == EV_REL)
-			&& (device->quirks & HID_QUIRK_2WHEEL_MOUSE_HACK)
+			&& (device->quirks & (HID_QUIRK_2WHEEL_MOUSE_HACK_BACK
+				| HID_QUIRK_2WHEEL_MOUSE_HACK_EXTRA))
 			&& (usage->code == REL_WHEEL)) {
 		set_bit(REL_HWHEEL, bit);
 	}
@@ -431,21 +432,22 @@
 
 	input_regs(input, regs);
 
-	if ((hid->quirks & HID_QUIRK_2WHEEL_MOUSE_HACK)
-			&& (usage->code == BTN_BACK)) {
+	if (((hid->quirks & HID_QUIRK_2WHEEL_MOUSE_HACK_EXTRA) && (usage->code == BTN_EXTRA))
+		|| (hid->quirks & HID_QUIRK_2WHEEL_MOUSE_HACK_BACK) && (usage->code == BTN_BACK)) {
 		if (value)
 			hid->quirks |= HID_QUIRK_2WHEEL_MOUSE_HACK_ON;
 		else
 			hid->quirks &= ~HID_QUIRK_2WHEEL_MOUSE_HACK_ON;
 		return;
 	}
+
 	if ((hid->quirks & HID_QUIRK_2WHEEL_MOUSE_HACK_ON)
 			&& (usage->code == REL_WHEEL)) {
 		input_event(input, usage->type, REL_HWHEEL, value);
 		return;
 	}
 
-	if (usage->hat_min != usage->hat_max) {
+	if (usage->hat_min != usage->hat_max ) { /* FIXME: hat_max can be 0 and hat_min 1 */
 		value = (value - usage->hat_min) * 8 / (usage->hat_max - usage->hat_min + 1) + 1;
 		if (value < 0 || value > 8) value = 0;
 		input_event(input, usage->type, usage->code    , hid_hat_to_axis[value].x);
@@ -484,7 +486,7 @@
 		return;
 	}
 
-	if((usage->type == EV_KEY) && (usage->code == 0)) /* Key 0 is "unassigned", not KEY_UKNOWN */
+	if((usage->type == EV_KEY) && (usage->code == 0)) /* Key 0 is "unassigned", not KEY_UNKNOWN */
 		return;
 
 	input_event(input, usage->type, usage->code, value);
--- diff/drivers/usb/input/hid.h	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/usb/input/hid.h	2004-02-09 10:39:55.000000000 +0000
@@ -201,15 +201,16 @@
  * HID device quirks.
  */
 
-#define HID_QUIRK_INVERT		0x001
-#define HID_QUIRK_NOTOUCH		0x002
-#define HID_QUIRK_IGNORE		0x004
-#define HID_QUIRK_NOGET			0x008
-#define HID_QUIRK_HIDDEV		0x010
-#define HID_QUIRK_BADPAD		0x020
-#define HID_QUIRK_MULTI_INPUT		0x040
-#define HID_QUIRK_2WHEEL_MOUSE_HACK	0x080
-#define HID_QUIRK_2WHEEL_MOUSE_HACK_ON	0x100
+#define HID_QUIRK_INVERT			0x001
+#define HID_QUIRK_NOTOUCH			0x002
+#define HID_QUIRK_IGNORE			0x004
+#define HID_QUIRK_NOGET				0x008
+#define HID_QUIRK_HIDDEV			0x010
+#define HID_QUIRK_BADPAD			0x020
+#define HID_QUIRK_MULTI_INPUT			0x040
+#define HID_QUIRK_2WHEEL_MOUSE_HACK_BACK	0x080
+#define HID_QUIRK_2WHEEL_MOUSE_HACK_EXTRA	0x100
+#define HID_QUIRK_2WHEEL_MOUSE_HACK_ON		0x200
 
 /*
  * This is the global environment of the parser. This information is
--- diff/drivers/usb/input/hiddev.c	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/usb/input/hiddev.c	2004-02-09 10:39:55.000000000 +0000
@@ -403,7 +403,8 @@
 	struct hiddev_collection_info cinfo;
 	struct hiddev_report_info rinfo;
 	struct hiddev_field_info finfo;
-	struct hiddev_usage_ref uref;
+	struct hiddev_usage_ref_multi uref_multi;
+	struct hiddev_usage_ref *uref = &uref_multi.uref;
 	struct hiddev_devinfo dinfo;
 	struct hid_report *report;
 	struct hid_field *field;
@@ -575,68 +576,98 @@
 		return 0;
 
 	case HIDIOCGUCODE:
-		if (copy_from_user(&uref, (void *) arg, sizeof(uref)))
+		if (copy_from_user(uref, (void *) arg, sizeof(*uref)))
 			return -EFAULT;
 
-		rinfo.report_type = uref.report_type;
-		rinfo.report_id = uref.report_id;
+		rinfo.report_type = uref->report_type;
+		rinfo.report_id = uref->report_id;
 		if ((report = hiddev_lookup_report(hid, &rinfo)) == NULL)
 			return -EINVAL;
 
-		if (uref.field_index >= report->maxfield)
+		if (uref->field_index >= report->maxfield)
 			return -EINVAL;
 
-		field = report->field[uref.field_index];
-		if (uref.usage_index >= field->maxusage)
+		field = report->field[uref->field_index];
+		if (uref->usage_index >= field->maxusage)
 			return -EINVAL;
 
-		uref.usage_code = field->usage[uref.usage_index].hid;
+		uref->usage_code = field->usage[uref->usage_index].hid;
 
-		if (copy_to_user((void *) arg, &uref, sizeof(uref)))
+		if (copy_to_user((void *) arg, uref, sizeof(*uref)))
 			return -EFAULT;
 
 		return 0;
 
 	case HIDIOCGUSAGE:
 	case HIDIOCSUSAGE:
+	case HIDIOCGUSAGES:
+	case HIDIOCSUSAGES:
 	case HIDIOCGCOLLECTIONINDEX:
-		if (copy_from_user(&uref, (void *) arg, sizeof(uref)))
-			return -EFAULT;
+		if (cmd == HIDIOCGUSAGES || cmd == HIDIOCSUSAGES) {
+			if (copy_from_user(&uref_multi, (void *) arg, 
+					   sizeof(uref_multi)))
+				return -EFAULT;
+		} else {
+			if (copy_from_user(uref, (void *) arg, sizeof(*uref)))
+				return -EFAULT;
+		}
 
-		if (cmd != HIDIOCGUSAGE && uref.report_type == HID_REPORT_TYPE_INPUT)
-				return -EINVAL;
+		if (cmd != HIDIOCGUSAGE && 
+		    cmd != HIDIOCGUSAGES &&
+		    uref->report_type == HID_REPORT_TYPE_INPUT)
+			return -EINVAL;
 
-		if (uref.report_id == HID_REPORT_ID_UNKNOWN) {
-			field = hiddev_lookup_usage(hid, &uref);
+		if (uref->report_id == HID_REPORT_ID_UNKNOWN) {
+			field = hiddev_lookup_usage(hid, uref);
 			if (field == NULL)
 				return -EINVAL;
 		} else {
-			rinfo.report_type = uref.report_type;
-			rinfo.report_id = uref.report_id;
+			rinfo.report_type = uref->report_type;
+			rinfo.report_id = uref->report_id;
 			if ((report = hiddev_lookup_report(hid, &rinfo)) == NULL)
 				return -EINVAL;
 
-			if (uref.field_index >= report->maxfield)
+			if (uref->field_index >= report->maxfield)
 				return -EINVAL;
 
-			field = report->field[uref.field_index];
-			if (uref.usage_index >= field->maxusage)
+			field = report->field[uref->field_index];
+			if (uref->usage_index >= field->maxusage)
 				return -EINVAL;
+
+			if (cmd == HIDIOCGUSAGES || cmd == HIDIOCSUSAGES) {
+				if (uref_multi.num_values >= HID_MAX_USAGES || 
+				    uref->usage_index >= field->maxusage || 
+				   (uref->usage_index + uref_multi.num_values) >= field->maxusage)
+					return -EINVAL;
+			}
 		}
 
 		switch (cmd) {
 			case HIDIOCGUSAGE:
-				uref.value = field->value[uref.usage_index];
-				if (copy_to_user((void *) arg, &uref, sizeof(uref)))
+				uref->value = field->value[uref->usage_index];
+				if (copy_to_user((void *) arg, uref, sizeof(*uref)))
 					return -EFAULT;
 				return 0;
 
 			case HIDIOCSUSAGE:
-				field->value[uref.usage_index] = uref.value;
+				field->value[uref->usage_index] = uref->value;
 				return 0;
 
 			case HIDIOCGCOLLECTIONINDEX:
-				return field->usage[uref.usage_index].collection_index;
+				return field->usage[uref->usage_index].collection_index;
+			case HIDIOCGUSAGES:
+				for (i = 0; i < uref_multi.num_values; i++)
+					uref_multi.values[i] = 
+					    field->value[uref->usage_index + i];
+				if (copy_to_user((void *) arg, &uref_multi, 
+						 sizeof(uref_multi)))
+					return -EFAULT;
+				return 0;
+			case HIDIOCSUSAGES:
+				for (i = 0; i < uref_multi.num_values; i++)
+					field->value[uref->usage_index + i] = 
+				  	    uref_multi.values[i];
+				return 0;
 		}
 
 		return 0;
--- diff/drivers/usb/input/wacom.c	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/usb/input/wacom.c	2004-02-09 10:39:55.000000000 +0000
@@ -1,7 +1,7 @@
 /*
  *  USB Wacom Graphire and Wacom Intuos tablet support
  *
- *  Copyright (c) 2000-2002 Vojtech Pavlik	<vojtech@ucw.cz>
+ *  Copyright (c) 2000-2004 Vojtech Pavlik	<vojtech@ucw.cz>
  *  Copyright (c) 2000 Andreas Bach Aaen	<abach@stofanet.dk>
  *  Copyright (c) 2000 Clifford Wolf		<clifford@clifford.at>
  *  Copyright (c) 2000 Sam Mosel		<sam.mosel@computer.org>
@@ -9,6 +9,7 @@
  *  Copyright (c) 2000 Daniel Egger		<egger@suse.de>
  *  Copyright (c) 2001 Frederic Lepied		<flepied@mandrakesoft.com>
  *  Copyright (c) 2002 Ping Cheng		<pingc@wacom.com>
+ *  Copyright (c) 2004 Panagiotis Issaris	<panagiotis.issaris@mech.kuleuven.ac.be>
  *
  *  ChangeLog:
  *      v0.1 (vp)  - Initial release
@@ -48,6 +49,7 @@
  *	v1.30 (vp) - Merge 2.4 and 2.5 drivers
  *		   - Since 2.5 now has input_sync(), remove MSC_SERIAL abuse
  *		   - Cleanups here and there
+ *    v1.30.1 (pi) - Added Graphire3 support
  */
 
 /*
--- diff/drivers/usb/misc/speedtch.c	2003-10-09 09:47:34.000000000 +0100
+++ source/drivers/usb/misc/speedtch.c	2004-02-09 10:39:55.000000000 +0000
@@ -1161,7 +1161,7 @@
 	buf += i;
 	length -= i;
 
-	i = snprintf (buf, length, " (");
+	i = scnprintf (buf, length, " (");
 	buf += i;
 	length -= i;
 
--- diff/drivers/usb/misc/uss720.c	2003-09-17 12:28:10.000000000 +0100
+++ source/drivers/usb/misc/uss720.c	2004-02-09 10:39:55.000000000 +0000
@@ -333,7 +333,7 @@
 	for (; got < length; got++) {
 		if (get_1284_register(pp, 4, (char *)buf))
 			break;
-		((char*)buf)++;
+		buf++;
 		if (priv->reg[0] & 0x01) {
 			clear_epp_timeout(pp);
 			break;
@@ -392,7 +392,7 @@
 	for (; got < length; got++) {
 		if (get_1284_register(pp, 3, (char *)buf))
 			break;
-		((char*)buf)++;
+		buf++;
 		if (priv->reg[0] & 0x01) {
 			clear_epp_timeout(pp);
 			break;
@@ -412,7 +412,7 @@
 	for (; written < length; written++) {
 		if (set_1284_register(pp, 3, *(char *)buf))
 			break;
-		((char*)buf)++;
+		buf++;
 		if (get_1284_register(pp, 1, NULL))
 			break;
 		if (priv->reg[0] & 0x01) {
@@ -469,7 +469,7 @@
 	for (; written < len; written++) {
 		if (set_1284_register(pp, 5, *(char *)buffer))
 			break;
-		((char*)buffer)++;
+		buffer++;
 	}
 	change_mode(pp, ECR_PS2);
 	return written;
--- diff/drivers/usb/net/catc.c	2003-08-26 10:00:54.000000000 +0100
+++ source/drivers/usb/net/catc.c	2004-02-09 10:39:55.000000000 +0000
@@ -838,7 +838,7 @@
 			usb_free_urb(catc->rx_urb);
 		if (catc->irq_urb)
 			usb_free_urb(catc->irq_urb);
-		kfree(netdev);
+		free_netdev(netdev);
 		kfree(catc);
 		return -ENOMEM;
 	}
@@ -943,7 +943,7 @@
 		usb_free_urb(catc->tx_urb);
 		usb_free_urb(catc->rx_urb);
 		usb_free_urb(catc->irq_urb);
-		kfree(netdev);
+		free_netdev(netdev);
 		kfree(catc);
 		return -EIO;
 	}
--- diff/drivers/usb/net/kaweth.c	2003-11-25 15:24:58.000000000 +0000
+++ source/drivers/usb/net/kaweth.c	2004-02-09 10:39:55.000000000 +0000
@@ -1150,7 +1150,7 @@
 err_only_tx:
 	usb_free_urb(kaweth->tx_urb);
 err_no_urb:
-	kfree(netdev);
+	free_netdev(netdev);
 err_no_netdev:
 	kfree(kaweth);
 	return -EIO;
--- diff/drivers/usb/net/pegasus.c	2003-08-26 10:00:54.000000000 +0100
+++ source/drivers/usb/net/pegasus.c	2004-02-09 10:39:55.000000000 +0000
@@ -1283,7 +1283,7 @@
 	usb_set_intfdata(intf, NULL);
 	free_skb_pool(pegasus);
 out3:
-	kfree(net);
+	free_netdev(net);
 out2:
 	free_all_urbs(pegasus);
 out1:
--- diff/drivers/usb/net/rtl8150.c	2003-08-26 10:00:54.000000000 +0100
+++ source/drivers/usb/net/rtl8150.c	2004-02-09 10:39:55.000000000 +0000
@@ -852,7 +852,7 @@
 	free_all_urbs(dev);
 out:
 	kfree(dev->intr_buff);
-	kfree(netdev);
+	free_netdev(netdev);
 	kfree(dev);
 	return -EIO;
 }
--- diff/drivers/usb/net/usbnet.c	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/usb/net/usbnet.c	2004-02-09 10:39:55.000000000 +0000
@@ -2933,7 +2933,7 @@
 	if (dev->driver_info->unbind)
 		dev->driver_info->unbind (dev, intf);
 
-	kfree(dev->net);
+	free_netdev(dev->net);
 	kfree (dev);
 	usb_put_dev (xdev);
 }
@@ -3061,7 +3061,7 @@
 	if (info->unbind)
 		info->unbind (dev, udev);
 out2:
-	kfree(net);
+	free_netdev(net);
 out1:
 	kfree(dev);
 out:
--- diff/drivers/usb/serial/belkin_sa.c	2003-09-17 12:28:10.000000000 +0100
+++ source/drivers/usb/serial/belkin_sa.c	2004-02-09 10:39:55.000000000 +0000
@@ -232,8 +232,10 @@
 
 	port->interrupt_in_urb->dev = port->serial->dev;
 	retval = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL);
-	if (retval)
+	if (retval) {
+		usb_unlink_urb(port->read_urb);
 		err(" usb_submit_urb(read int) failed");
+	}
 
 exit:
 	return retval;
--- diff/drivers/usb/serial/kobil_sct.c	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/usb/serial/kobil_sct.c	2004-02-09 10:39:55.000000000 +0000
@@ -409,8 +409,6 @@
 	// someone sets the dev to 0 if the close method has been called
 	port->interrupt_in_urb->dev = port->serial->dev;
 
-	// usb_dump_urb(port->interrupt_in_urb);
-
 	result = usb_submit_urb( port->interrupt_in_urb, GFP_ATOMIC ); 
 	dbg("%s - port %d Send read URB returns: %i", __FUNCTION__, port->number, result);
 }
@@ -496,8 +494,6 @@
 		port->interrupt_in_urb->dev = port->serial->dev;
 		
 		// start reading
-		//usb_dump_urb(port->interrupt_in_urb);
-
 		result = usb_submit_urb( port->interrupt_in_urb, GFP_ATOMIC ); 
 		dbg("%s - port %d Send read URB returns: %i", __FUNCTION__, port->number, result);
 	}
--- diff/drivers/usb/serial/visor.c	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/usb/serial/visor.c	2004-02-09 10:39:55.000000000 +0000
@@ -241,6 +241,8 @@
 		.driver_info = (kernel_ulong_t)&palm_os_4_probe },
 	{ USB_DEVICE(GARMIN_VENDOR_ID, GARMIN_IQUE_3600_ID), 
 		.driver_info = (kernel_ulong_t)&palm_os_4_probe },
+	{ USB_DEVICE(ACEECA_VENDOR_ID, ACEECA_MEZ1000_ID),
+		.driver_info = (kernel_ulong_t)&palm_os_4_probe },
 	{ },					/* optional parameter entry */
 	{ }					/* Terminating entry */
 };
@@ -274,6 +276,7 @@
 	{ 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) },
+	{ USB_DEVICE(ACEECA_VENDOR_ID, ACEECA_MEZ1000_ID) },
 	{ },					/* optional parameter entry */
 	{ }					/* Terminating entry */
 };
--- diff/drivers/usb/serial/visor.h	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/usb/serial/visor.h	2004-02-09 10:39:55.000000000 +0000
@@ -50,6 +50,9 @@
 #define GARMIN_VENDOR_ID		0x091E
 #define GARMIN_IQUE_3600_ID		0x0004
 
+#define ACEECA_VENDOR_ID		0x4766
+#define ACEECA_MEZ1000_ID		0x0001
+
 /****************************************************************************
  * Handspring Visor Vendor specific request codes (bRequest values)
  * A big thank you to Handspring for providing the following information.
--- diff/drivers/usb/storage/datafab.h	2003-02-13 11:46:54.000000000 +0000
+++ source/drivers/usb/storage/datafab.h	2004-02-09 10:39:55.000000000 +0000
@@ -29,7 +29,7 @@
 struct datafab_info {
 	unsigned long   sectors;	// total sector count
 	unsigned long   ssize;		// sector size in bytes
-	char		lun;		// used for dual-slot readers
+	signed char	lun;		// used for dual-slot readers
 	
 	// the following aren't used yet
 	unsigned char   sense_key;
--- diff/drivers/usb/storage/sddr09.c	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/usb/storage/sddr09.c	2004-02-09 10:39:55.000000000 +0000
@@ -27,6 +27,20 @@
  * 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+/*
+ * Known vendor commands: 12 bytes, first byte is opcode
+ *
+ * E7: read scatter gather
+ * E8: read
+ * E9: write
+ * EA: erase
+ * EB: reset
+ * EC: read status
+ * ED: read ID
+ * EE: write CIS (?)
+ * EF: compute checksum (?)
+ */
+
 #include "transport.h"
 #include "protocol.h"
 #include "usb.h"
@@ -461,6 +475,7 @@
  * 
  * Always precisely one block is erased; bytes 2-5 and 10-11 are ignored.
  * The byte address being erased is 2*Eaddress.
+ * The CIS cannot be erased.
  */
 static int
 sddr09_erase(struct us_data *us, unsigned long Eaddress) {
@@ -487,6 +502,20 @@
 }
 
 /*
+ * Write CIS Command: 12 bytes.
+ * byte 0: opcode: EE
+ * bytes 2-5: write address in shorts
+ * bytes 10-11: sector count
+ *
+ * This writes at the indicated address. Don't know how it differs
+ * from E9. Maybe it does not erase? However, it will also write to
+ * the CIS.
+ *
+ * When two such commands on the same page follow each other directly,
+ * the second one is not done.
+ */
+
+/*
  * Write Command: 12 bytes.
  * byte 0: opcode: E9
  * bytes 2-5: write address (big-endian, counting shorts, sector aligned).
--- diff/drivers/usb/storage/usb.c	2004-01-19 10:22:59.000000000 +0000
+++ source/drivers/usb/storage/usb.c	2004-02-09 10:39:55.000000000 +0000
@@ -834,7 +834,7 @@
 
 	/* Finish the SCSI host removal sequence */
 	if (us->host) {
-		(struct us_data *) us->host->hostdata[0] = NULL;
+		us->host->hostdata[0] = 0;
 		scsi_host_put(us->host);
 	}
 
--- diff/drivers/video/Kconfig	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/video/Kconfig	2004-02-09 10:39:55.000000000 +0000
@@ -673,26 +673,27 @@
 	  Say Y here to support booting a Rage XL without BIOS support.
 
 config FB_SIS
-	tristate "SIS acceleration"
+	tristate "SiS acceleration"
 	depends on FB && PCI
 	help
-	  This is the frame buffer device driver for the SiS 630 and 640 Super
-	  Socket 7 UMA cards.  Specs available at <http://www.sis.com.tw/>.
+	  This is the frame buffer device driver for the SiS 300, 315 and
+	  330 series VGA chipsets. Specs available at http://www.sis.com
+
+	  To compile this driver as a module, choose M here; the module
+	  will be called sisfb.
 
 config FB_SIS_300
-	bool "SIS 630/540/730 support"
+	bool "SiS 300 series support"
 	depends on FB_SIS
 	help
-	  This is the frame buffer device driver for the SiS 630 and related
-	  Super Socket 7 UMA cards.  Specs available at
-	  <http://www.sis.com.tw/>.
+	  Say Y here to support use of the SiS 300/305, 540, 630 and 730.
 
 config FB_SIS_315
-	bool "SIS 315H/315 support"
+	bool "SiS 315/330 series support"
 	depends on FB_SIS
 	help
-	  This is the frame buffer device driver for the SiS 315 graphics
-	  card.  Specs available at <http://www.sis.com.tw/>.
+	  Say Y here to support use of the SiS 315 and 330 series
+	  (315/H/PRO, 55x, 650, 651, 740, 330, 661, 741, 760).
 
 config FB_NEOMAGIC
 	tristate "NeoMagic display support"
--- diff/drivers/video/cfbimgblt.c	2003-08-26 10:00:54.000000000 +0100
+++ source/drivers/video/cfbimgblt.c	2004-02-09 10:39:55.000000000 +0000
@@ -136,8 +136,7 @@
 		dst1 += p->fix.line_length;
 		if (pitch_index) {
 			dst2 += p->fix.line_length;
-			dst1 = (char *) dst2;
-			(unsigned long) dst1 &= ~(sizeof(u32) - 1);
+			dst1 = (u8 *)((long)dst2 & ~(sizeof(u32) - 1));
 
 			start_index += pitch_index;
 			start_index &= 32 - 1;
@@ -202,9 +201,7 @@
 		src += spitch;	
 		if (pitch_index) {
 			dst2 += pitch;
-			dst1 = (char *) dst2;
-			(unsigned long) dst1 &= ~(sizeof(u32) - 1);
-
+			dst1 = (u8 *)((long)dst2 & ~(sizeof(u32) - 1));
 			start_index += pitch_index;
 			start_index &= 32 - 1;
 		}
--- diff/drivers/video/console/Makefile	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/video/console/Makefile	2004-02-09 10:39:55.000000000 +0000
@@ -28,11 +28,11 @@
 
 obj-$(CONFIG_FB_STI)              += sticore.o
 
-# Files generated that shall be removed upon make clean
+# Targets that kbuild needs to know about
 targets := promcon_tbl.c
 
 quiet_cmd_conmakehash = CNMKHSH $@
-      cmd_conmakehash = $(objtree)/scripts/conmakehash $< | \
+      cmd_conmakehash = scripts/conmakehash $< | \
 		sed -e '/\#include <[^>]*>/p' -e 's/types/init/' \
 		-e 's/dfont\(_uni.*\]\)/promfont\1 __initdata/' > $@
 
--- diff/drivers/video/console/fbcon.c	2004-02-09 10:36:11.000000000 +0000
+++ source/drivers/video/console/fbcon.c	2004-02-09 10:39:55.000000000 +0000
@@ -1996,8 +1996,10 @@
 	   font length must be multiple of 256, at least. And 256 is multiple
 	   of 4 */
 	k = 0;
-	while (p > new_data)
-		k += *--(u32 *) p;
+	while (p > new_data) {
+		p = (u8 *)((u32 *)p - 1);
+		k += *(u32 *) p;
+	}
 	FNTSUM(new_data) = k;
 	/* Check if the same font is on some other console already */
 	for (i = 0; i < MAX_NR_CONSOLES; i++) {
--- diff/drivers/video/fbcmap.c	2003-05-21 11:50:09.000000000 +0100
+++ source/drivers/video/fbcmap.c	2004-02-09 10:39:55.000000000 +0000
@@ -98,14 +98,14 @@
 	if (!len)
 	    return 0;
 	if (!(cmap->red = kmalloc(size, GFP_ATOMIC)))
-	    return -1;
+	    goto fail;
 	if (!(cmap->green = kmalloc(size, GFP_ATOMIC)))
-	    return -1;
+	    goto fail;
 	if (!(cmap->blue = kmalloc(size, GFP_ATOMIC)))
-	    return -1;
+	    goto fail;
 	if (transp) {
 	    if (!(cmap->transp = kmalloc(size, GFP_ATOMIC)))
-		return -1;
+		goto fail;
 	} else
 	    cmap->transp = NULL;
     }
@@ -113,6 +113,14 @@
     cmap->len = len;
     fb_copy_cmap(fb_default_cmap(len), cmap, 0);
     return 0;
+
+fail:
+    kfree(cmap->blue);
+    kfree(cmap->green);
+    kfree(cmap->red);
+    cmap->red = cmap->green = cmap->blue = cmap->transp = NULL;
+    cmap->len = 0;
+    return -1;
 }
 
 /**
@@ -126,14 +134,10 @@
 
 void fb_dealloc_cmap(struct fb_cmap *cmap)
 {
-	if (cmap->red)
-		kfree(cmap->red);
-	if (cmap->green)
-		kfree(cmap->green);
-	if (cmap->blue)
-		kfree(cmap->blue);
-	if (cmap->transp)
-		kfree(cmap->transp);
+	kfree(cmap->red);
+	kfree(cmap->green);
+	kfree(cmap->blue);
+	kfree(cmap->transp);
 
 	cmap->red = cmap->green = cmap->blue = cmap->transp = NULL;
 	cmap->len = 0;
--- diff/drivers/video/i810/i810_accel.c	2003-05-21 11:50:09.000000000 +0100
+++ source/drivers/video/i810/i810_accel.c	2004-02-09 10:39:55.000000000 +0000
@@ -27,7 +27,7 @@
         par->cur_tail &= RING_SIZE_MASK;                     \
 }                                                                      
 
-extern inline void flush_cache(void);
+extern void flush_cache(void);
 
 /************************************************************/
 
--- diff/drivers/video/logo/Makefile	2004-02-09 10:36:12.000000000 +0000
+++ source/drivers/video/logo/Makefile	2004-02-09 10:39:55.000000000 +0000
@@ -13,43 +13,45 @@
 obj-$(CONFIG_LOGO_SUPERH_VGA16)		+= logo_superh_vga16.o
 obj-$(CONFIG_LOGO_SUPERH_CLUT224)	+= logo_superh_clut224.o
 
-# Dependencies on generated files need to be listed explicitly
+# How to generate logo's
 
-$(obj)/%_mono.o: $(src)/%_mono.c
+# Use logo-cfiles to retreive list of .c files to be built
+logo-cfiles = $(notdir $(patsubst %.$(2), %.c, \
+              $(wildcard $(srctree)/$(src)/*$(1).$(2))))
 
-$(obj)/%_vga16.o: $(src)/%_vga16.c
 
-$(obj)/%_clut224.o: $(src)/%_clut224.c
-
-$(obj)/%_gray256.o: $(src)/%_gray256.c
-
-# How to generate them
+# Mono logos
+extra-y += $(call logo-cfiles,_mono,pbm)
 
 quiet_cmd_logo_mono    = MONO    $@
-      cmd_logo_mono    = $(objtree)/scripts/pnmtologo -t mono -n $*_mono -o $@ $<
-
-quiet_cmd_logo_vga16   = VGA16   $@
-      cmd_logo_vga16   = $(objtree)/scripts/pnmtologo -t vga16 -n $*_vga16 -o $@ $<
-
-quiet_cmd_logo_clut224 = CLUT224 $@
-      cmd_logo_clut224 = $(objtree)/scripts/pnmtologo -t clut224 -n $*_clut224 -o $@ $<
-
-quiet_cmd_logo_gray256 = GRAY256 $@
-      cmd_logo_gray256 = $(objtree)/scripts/pnmtologo -t gray256 -n $*_gray256 -o $@ $<
-
+      cmd_logo_mono    = scripts/pnmtologo -t mono -n $*_mono -o $@ $<
 
 $(obj)/%_mono.c: $(src)/%_mono.pbm FORCE
 	$(call if_changed,logo_mono)
 
+# VGA16 logos
+extra-y += $(call logo-cfiles,_vga16,ppm)
+
+quiet_cmd_logo_vga16   = VGA16   $@
+      cmd_logo_vga16   = scripts/pnmtologo -t vga16 -n $*_vga16 -o $@ $<
+
 $(obj)/%_vga16.c: $(src)/%_vga16.ppm FORCE
 	$(call if_changed,logo_vga16)
 
+#224 Logos
+extra-y += $(call logo-cfiles,_clut224,ppm)
+
+quiet_cmd_logo_clut224 = CLUT224 $@
+      cmd_logo_clut224 = scripts/pnmtologo -t clut224 -n $*_clut224 -o $@ $<
+
 $(obj)/%_clut224.c: $(src)/%_clut224.ppm FORCE
 	$(call if_changed,logo_clut224)
 
-$(obj)/%_gray256.c: $(src)/%_gray256.pgm FORCE
-	$(call if_changed,logo_gray256)
+# Gray 256
+extra-y += $(call logo-cfiles,_gray256,pgm)
 
+quiet_cmd_logo_gray256 = GRAY256 $@
+      cmd_logo_gray256 = scripts/pnmtologo -t gray256 -n $*_gray256 -o $@ $<
 
-# Files generated that shall be removed upon make clean
-targets := *_mono.c *_vga16.c *_clut224.c *_gray256.c
+$(obj)/%_gray256.c: $(src)/%_gray256.pgm FORCE
+	$(call if_changed,logo_gray256)
--- diff/drivers/video/neofb.c	2003-10-09 09:47:16.000000000 +0100
+++ source/drivers/video/neofb.c	2004-02-09 10:39:55.000000000 +0000
@@ -1649,8 +1649,6 @@
 static int __devinit neo_map_video(struct fb_info *info,
 				   struct pci_dev *dev, int video_len)
 {
-	struct neofb_par *par = (struct neofb_par *) info->par;
-
 	DBG("neo_map_video");
 
 	info->fix.smem_start = pci_resource_start(dev, 0);
@@ -1674,7 +1672,7 @@
 		       info->screen_base);
 
 #ifdef CONFIG_MTRR
-	par->mtrr =
+	((struct neofb_par *)(info->par))->mtrr =
 	    mtrr_add(info->fix.smem_start, pci_resource_len(dev, 0),
 		     MTRR_TYPE_WRCOMB, 1);
 #endif
@@ -1686,12 +1684,12 @@
 
 static void __devinit neo_unmap_video(struct fb_info *info)
 {
-	struct neofb_par *par = (struct neofb_par *) info->par;
 
 	DBG("neo_unmap_video");
 
 	if (info->screen_base) {
 #ifdef CONFIG_MTRR
+		struct neofb_par *par = (struct neofb_par *) info->par;
 		mtrr_del(par->mtrr, info->fix.smem_start,
 			 info->fix.smem_len);
 #endif
--- diff/drivers/video/riva/fbdev.c	2003-10-09 09:47:16.000000000 +0100
+++ source/drivers/video/riva/fbdev.c	2004-02-09 10:39:55.000000000 +0000
@@ -495,8 +495,10 @@
 	u32 b, m, tmp;
 
 	for (i = 0; i < h; i++) {
-		b = *((u32 *)data)++;
-		m = *((u32 *)mask)++;
+		b = *((u32 *)data);
+		b = (u32)((u32 *)b + 1);
+		m = *((u32 *)mask);
+		m = (u32)((u32 *)m + 1);
 		reverse_order(&b);
 		
 		for (j = 0; j < w/2; j++) {
@@ -1437,7 +1439,8 @@
 	while (size >= 16) {
 		RIVA_FIFO_FREE(par->riva, Bitmap, 16);
 		for (i = 0; i < 16; i++) {
-			tmp = *((u32 *)cdat)++;
+			tmp = *((u32 *)cdat);
+			cdat = (u8 *)((u32 *)cdat + 1);
 			reverse_order(&tmp);
 			d[i] = tmp;
 		}
@@ -1446,7 +1449,8 @@
 	if (size) {
 		RIVA_FIFO_FREE(par->riva, Bitmap, size);
 		for (i = 0; i < size; i++) {
-			tmp = *((u32 *) cdat)++;
+			tmp = *((u32 *) cdat);
+			cdat = (u8 *)((u32 *)cdat + 1);
 			reverse_order(&tmp);
 			d[i] = tmp;
 		}
--- diff/drivers/video/sis/300vtbl.h	2003-10-09 09:47:16.000000000 +0100
+++ source/drivers/video/sis/300vtbl.h	2004-02-09 10:39:55.000000000 +0000
@@ -1,7 +1,56 @@
-
-
-/* Register settings for SiS 300 series */
-
+/* $XFree86$ */
+/*
+ * Register settings for SiS 300 series
+ *
+ * Copyright (C) 2001-2004 by Thomas Winischhofer, Vienna, Austria
+ *
+ * If distributed as part of the Linux kernel, the following license terms
+ * apply:
+ *
+ * * 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 named License,
+ * * or 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
+ *
+ * Otherwise, the following license terms apply:
+ *
+ * * 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) All advertising materials mentioning features or use of this software
+ * *    must display the following acknowledgement: "This product includes
+ * *    software developed by Thomas Winischhofer, Vienna, Austria."
+ * * 4) The name of the author may not be used to endorse or promote products
+ * *    derived from this software without specific prior written permission.
+ * *
+ * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
+ *
+ * Author: 	Thomas Winischhofer <thomas@winischhofer.net>
+ *
+ */
 
 typedef struct _SiS300_StStruct
 {
@@ -13,577 +62,220 @@
 	UCHAR VB_StTVFlickerIndex;
 	UCHAR VB_StTVEdgeIndex;
 	UCHAR VB_StTVYFilterIndex;
+	UCHAR St_PDC;
 } SiS300_StStruct;
 
 static const SiS300_StStruct  SiS300_SModeIDTable[] =
 {
-	{0x01,0x9208,0x01,0x00,0x00,0x00,0x00,0x00},
-	{0x01,0x1210,0x14,0x01,0x01,0x00,0x00,0x00},
-	{0x01,0x1010,0x17,0x02,0x02,0x00,0x00,0x00},
-	{0x03,0x8208,0x03,0x00,0x00,0x00,0x00,0x00},
-	{0x03,0x0210,0x16,0x01,0x01,0x00,0x00,0x00},
-	{0x03,0x0010,0x18,0x02,0x02,0x00,0x00,0x00},
-	{0x05,0x9209,0x05,0x00,0x00,0x00,0x00,0x00},
-	{0x06,0x8209,0x06,0x00,0x00,0x00,0x00,0x00},
-	{0x07,0x0000,0x07,0x03,0x03,0x00,0x00,0x00},
-	{0x07,0x0000,0x19,0x02,0x02,0x00,0x00,0x00},
-	{0x0d,0x920a,0x0d,0x00,0x00,0x00,0x00,0x00},
-	{0x0e,0x820a,0x0e,0x00,0x00,0x00,0x00,0x00},
-	{0x0f,0x0202,0x11,0x01,0x01,0x00,0x00,0x00},
-	{0x10,0x0212,0x12,0x01,0x01,0x00,0x00,0x00},
-	{0x11,0x0212,0x1a,0x04,0x04,0x00,0x00,0x00},
-	{0x12,0x0212,0x1b,0x04,0x04,0x00,0x00,0x00},
-	{0x13,0x021b,0x1c,0x00,0x00,0x00,0x00,0x00},
-	{0x12,0x0010,0x18,0x02,0x02,0x00,0x00,0x00},
-	{0x12,0x0210,0x18,0x01,0x01,0x00,0x00,0x00},
-	{0xff,     0,   0,   0,   0,   0,   0,   0}
-};
-
-typedef struct _SiS300_StandTableStruct
-{
-	UCHAR CRT_COLS;
-	UCHAR ROWS;
-	UCHAR CHAR_HEIGHT;
-	USHORT CRT_LEN;
-	UCHAR SR[4];
-	UCHAR MISC;
-	UCHAR CRTC[0x19];
-	UCHAR ATTR[0x14];
-	UCHAR GRC[9];
-} SiS300_StandTableStruct;
-
-static const SiS300_StandTableStruct  SiS300_StandTable[] =
-{
- {0x28,0x18,0x08,0x0800,			/* 0x00 */
-  {0x09,0x03,0x00,0x02},
-  0x63,
-  {0x2d,0x27,0x28,0x90,0x2b,0xa0,0xbf,0x1f,
-   0x00,0xc7,0x06,0x07,0x00,0x00,0x00,0x00,
-   0x9c,0x8e,0x8f,0x14,0x1f,0x96,0xb9,0xa3,
-   0xff},
-  {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
-   0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,
-   0x08,0x00,0x0f,0x00},
-  {0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
-   0xff} },
- {0x28,0x18,0x08,0x0800,			/* 0x01 */
-  {0x09,0x03,0x00,0x02},
-  0x63,
-  {0x2d,0x27,0x28,0x90,0x2b,0xa0,0xbf,0x1f,
-   0x00,0xc7,0x06,0x07,0x00,0x00,0x00,0x00,
-   0x9c,0x8e,0x8f,0x14,0x1f,0x96,0xb9,0xa3,
-   0xff},
-  {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
-   0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,
-   0x08,0x00,0x0f,0x00},
-  {0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
-   0xff} },
- {0x50,0x18,0x08,0x1000,			/* 0x02 */
-  {0x01,0x03,0x00,0x02},
-  0x63,
-  {0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f,
-   0x00,0xc7,0x06,0x07,0x00,0x00,0x00,0x00,
-   0x9c,0x8e,0x8f,0x28,0x1f,0x96,0xb9,0xa3,
-   0xff},
-  {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
-   0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,
-   0x08,0x00,0x0f,0x00},
-  {0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
-   0xff} },
- {0x50,0x18,0x08,0x1000,			/* 0x03 */
-  {0x01,0x03,0x00,0x02},
-  0x63,
-  {0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f,
-   0x00,0xc7,0x06,0x07,0x00,0x00,0x00,0x00,
-   0x9c,0x8e,0x8f,0x28,0x1f,0x96,0xb9,0xa3,
-   0xff},
-  {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
-   0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,
-   0x08,0x00,0x0f,0x00},
-  {0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
-   0xff} },
- {0x28,0x18,0x08,0x4000,			/* 0x04 */
-  {0x09,0x03,0x00,0x02},
-  0x63,
-  {0x2d,0x27,0x28,0x90,0x2b,0x80,0xbf,0x1f,
-   0x00,0xc1,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x9c,0x8e,0x8f,0x14,0x00,0x96,0xb9,0xa2,
-   0xff},
-  {0x00,0x13,0x15,0x17,0x02,0x04,0x06,0x07,
-   0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,
-   0x01,0x00,0x03,0x00},
-  {0x00,0x00,0x00,0x00,0x00,0x30,0x0f,0x00,
-   0xff} },
- {0x28,0x18,0x08,0x4000,			/* 0x05 */
-  {0x09,0x03,0x00,0x02},
-  0x63,
-  {0x2d,0x27,0x28,0x90,0x2b,0x80,0xbf,0x1f,
-   0x00,0xc1,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x9c,0x8e,0x8f,0x14,0x00,0x96,0xb9,0xa2,
-   0xff},
-  {0x00,0x13,0x15,0x17,0x02,0x04,0x06,0x07,
-   0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,
-   0x01,0x00,0x03,0x00},
-  {0x00,0x00,0x00,0x00,0x00,0x30,0x0f,0x00,
-   0xff} },
- {0x50,0x18,0x08,0x4000,			/* 0x06 */
-  {0x01,0x01,0x00,0x06},
-  0x63,
-  {0x5f,0x4f,0x50,0x82,0x54,0x80,0xbf,0x1f,
-   0x00,0xc1,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x9c,0x8e,0x8f,0x28,0x00,0x96,0xb9,0xc2,
-   0xff},
-  {0x00,0x17,0x17,0x17,0x17,0x17,0x17,0x17,
-   0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,
-   0x01,0x00,0x01,0x00},
-  {0x00,0x00,0x00,0x00,0x00,0x00,0x0d,0x00,
-   0xff} },
- {0x50,0x18,0x0e,0x1000,			/* 0x07 */
-  {0x00,0x03,0x00,0x03},
-  0xa6,
-  {0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f,
-   0x00,0x4d,0x0b,0x0c,0x00,0x00,0x00,0x00,
-   0x83,0x85,0x5d,0x28,0x0d,0x63,0xba,0xa3,
-   0xff},
-  {0x00,0x08,0x08,0x08,0x08,0x08,0x08,0x08,
-   0x10,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
-   0x0e,0x00,0x0f,0x08},
-  {0x00,0x00,0x00,0x00,0x00,0x10,0x0a,0x00,
-   0xff} },
-/* MDA_DAC*/
- {0x00,0x00,0x00,0x0000,			/* 0x08 */
-  {0x00,0x00,0x00,0x15},
-  0x15,
-  {0x15,0x15,0x15,0x15,0x15,0x15,0x15,0x15,
-   0x15,0x15,0x15,0x15,0x15,0x15,0x3f,0x3f,
-   0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x00,0x00,
-   0x00},
-  {0x00,0x00,0x00,0x00,0x00,0x15,0x15,0x15,
-   0x15,0x15,0x15,0x15,0x15,0x15,0x15,0x15,
-   0x15,0x15,0x15,0x15},
-  {0x15,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,
-   0x3f} },
-/* CGA_DAC*/
- {0x00,0x10,0x04,0x0114,			/* 0x09 */
-  {0x11,0x09,0x15,0x00},
-  0x10,
-  {0x04,0x14,0x01,0x11,0x09,0x15,0x2a,0x3a,
-   0x2e,0x3e,0x2b,0x3b,0x2f,0x3f,0x2a,0x3a,
-   0x2e,0x3e,0x2b,0x3b,0x2f,0x3f,0x00,0x10,
-   0x04},
-  {0x14,0x01,0x11,0x09,0x15,0x00,0x10,0x04,
-   0x14,0x01,0x11,0x09,0x15,0x2a,0x3a,0x2e,
-   0x3e,0x2b,0x3b,0x2f},
-  {0x3f,0x2a,0x3a,0x2e,0x3e,0x2b,0x3b,0x2f,
-   0x3f} },
-/* EGA_DAC*/
- {0x00,0x10,0x04,0x0114,			/* 0x0a */
-  {0x11,0x05,0x15,0x20},
-  0x30,
-  {0x24,0x34,0x21,0x31,0x25,0x35,0x08,0x18,
-   0x0c,0x1c,0x09,0x19,0x0d,0x1d,0x28,0x38,
-   0x2c,0x3c,0x29,0x39,0x2d,0x3d,0x02,0x12,
-   0x06},
-  {0x16,0x03,0x13,0x07,0x17,0x22,0x32,0x26,
-   0x36,0x23,0x33,0x27,0x37,0x0a,0x1a,0x0e,
-   0x1e,0x0b,0x1b,0x0f},
-  {0x1f,0x2a,0x3a,0x2e,0x3e,0x2b,0x3b,0x2f,
-   0x3f} },
-/* VGA_DAC*/
- {0x00,0x10,0x04,0x0114,			/* 0x0b */
-  {0x11,0x09,0x15,0x2a},
-  0x3a,
-  {0x2e,0x3e,0x2b,0x3b,0x2f,0x3f,0x00,0x05,
-   0x08,0x0b,0x0e,0x11,0x14,0x18,0x1c,0x20,
-   0x24,0x28,0x2d,0x32,0x38,0x3f,0x00,0x10,
-   0x1f},
-  {0x2f,0x3f,0x1f,0x27,0x2f,0x37,0x3f,0x2d,
-   0x31,0x36,0x3a,0x3f,0x00,0x07,0x0e,0x15,
-   0x1c,0x0e,0x11,0x15},
-  {0x18,0x1c,0x14,0x16,0x18,0x1a,0x1c,0x00,
-   0x04} },
- {0x08,0x0c,0x10,0x0a08,			/* 0x0c */
-  {0x0c,0x0e,0x10,0x0b},
-  0x0c,
-  {0x0d,0x0f,0x10,0x10,0x01,0x08,0x00,0x00,
-   0x00,0x00,0x01,0x00,0x02,0x02,0x01,0x00,
-   0x04,0x04,0x01,0x00,0x05,0x02,0x05,0x00,
-   0x06},
-  {0x01,0x06,0x05,0x06,0x00,0x08,0x01,0x08,
-   0x00,0x07,0x02,0x07,0x06,0x07,0x00,0x00,
-   0x00,0x00,0x00,0x00},
-  {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00} },
- {0x28,0x18,0x08,0x2000,			/* 0x0d */
-  {0x09,0x0f,0x00,0x06},
-  0x63,
-  {0x2d,0x27,0x28,0x90,0x2b,0x80,0xbf,0x1f,
-   0x00,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x9c,0x8e,0x8f,0x14,0x00,0x96,0xb9,0xe3,
-   0xff},
-  {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
-   0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,
-   0x01,0x00,0x0f,0x00},
-  {0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x0f,
-   0xff} },
- {0x50,0x18,0x08,0x4000,			/* 0x0e */
-  {0x01,0x0f,0x00,0x06},
-  0x63,
-  {0x5f,0x4f,0x50,0x82,0x54,0x80,0xbf,0x1f,
-   0x00,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x9c,0x8e,0x8f,0x28,0x00,0x96,0xb9,0xe3,
-   0xff},
-  {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
-   0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,
-   0x01,0x00,0x0f,0x00},
-  {0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x0f,
-   0xff} },
- {0x00,0x00,0x00,0x0000,			/* 0x0f */	/* TW: Standtable for VGA modes */
-  {0x01,0x0f,0x00,0x0e},
-  0x23,
-  {0x5f,0x4f,0x50,0x82,0x54,0x80,0x0b,0x3e,
-   0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,
-   0xea,0x8c,0xdf,0x28,0x40,0xe7,0x04,0xa3,
-   0xff},
-  {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
-   0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,
-   0x01,0x00,0x00,0x00},
-  {0x00,0x00,0x00,0x00,0x00,0x40,0x05,0x0f,
-   0xff} },
- {0x4a,0x36,0x00,0x00c0,			/* 0x10 */
-  {0x00,0x00,0x00,0x00},
-  0x00,
-  {0x00,0x00,0x00,0x00,0x00,0x00,0x66,0x3a,
-   0x00,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x1a,0x00,0x57,0x39,0x00,0xc0,
-   0x00},
-  {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00},
-  {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00} },
- {0x50,0x18,0x0e,0x8000,			/* 0x11 */
-  {0x01,0x0f,0x00,0x06},
-  0xa2,
-  {0x5f,0x4f,0x50,0x82,0x54,0x80,0xbf,0x1f,
-   0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x83,0x85,0x5d,0x28,0x0f,0x63,0xba,0xe3,
-   0xff},
-  {0x00,0x08,0x00,0x00,0x18,0x18,0x00,0x00,
-   0x00,0x08,0x00,0x00,0x00,0x18,0x00,0x00,
-   0x0b,0x00,0x05,0x00},
-  {0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x05,
-   0xff} },
- {0x50,0x18,0x0e,0x8000,			/* 0x12 */
-  {0x01,0x0f,0x00,0x06},
-  0xa3,
-  {0x5f,0x4f,0x50,0x82,0x54,0x80,0xbf,0x1f,
-   0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x83,0x85,0x5d,0x28,0x0f,0x63,0xba,0xe3,
-   0xff},
-  {0x00,0x01,0x02,0x03,0x04,0x05,0x14,0x07,
-   0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,
-   0x01,0x00,0x0f,0x00},
-  {0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x0f,
-   0xff} },
- {0x28,0x18,0x0e,0x0800,			/* 0x13 */
-  {0x09,0x03,0x00,0x02},
-  0xa3,
-  {0x2d,0x27,0x28,0x90,0x2b,0xa0,0xbf,0x1f,
-   0x00,0x4d,0x0b,0x0c,0x00,0x00,0x00,0x00,
-   0x83,0x85,0x5d,0x14,0x1f,0x63,0xba,0xa3,
-   0xff},
-  {0x00,0x01,0x02,0x03,0x04,0x05,0x14,0x07,
-   0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,
-   0x08,0x00,0x0f,0x00},
-  {0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
-   0xff} },
- {0x28,0x18,0x0e,0x0800,			/* 0x14 */
-  {0x09,0x03,0x00,0x02},
-  0xa3,
-  {0x2d,0x27,0x28,0x90,0x2b,0xa0,0xbf,0x1f,
-   0x00,0x4d,0x0b,0x0c,0x00,0x00,0x00,0x00,
-   0x83,0x85,0x5d,0x14,0x1f,0x63,0xba,0xa3,
-   0xff},
-  {0x00,0x01,0x02,0x03,0x04,0x05,0x14,0x07,
-   0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,
-   0x08,0x00,0x0f,0x00},
-  {0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
-   0xff} },
- {0x50,0x18,0x0e,0x1000,			/* 0x15 */
-  {0x01,0x03,0x00,0x02},
-  0xa3,
-  {0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f,
-   0x00,0x4d,0x0b,0x0c,0x00,0x00,0x00,0x00,
-   0x83,0x85,0x5d,0x28,0x1f,0x63,0xba,0xa3,
-   0xff},
-  {0x00,0x01,0x02,0x03,0x04,0x05,0x14,0x07,
-   0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,
-   0x08,0x00,0x0f,0x00},
-  {0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
-   0xff} },
- {0x50,0x18,0x0e,0x1000,			/* 0x16 */
-  {0x01,0x03,0x00,0x02},
-  0xa3,
-  {0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f,
-   0x00,0x4d,0x0b,0x0c,0x00,0x00,0x00,0x00,
-   0x83,0x85,0x5d,0x28,0x1f,0x63,0xba,0xa3,
-   0xff},
-  {0x00,0x01,0x02,0x03,0x04,0x05,0x14,0x07,
-   0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,
-   0x08,0x00,0x0f,0x00},
-  {0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
-   0xff} },
- {0x28,0x18,0x10,0x0800,			/* 0x17 */
-  {0x08,0x03,0x00,0x02},
-  0x67,
-  {0x2d,0x27,0x28,0x90,0x2b,0xa0,0xbf,0x1f,
-   0x00,0x4f,0x0d,0x0e,0x00,0x00,0x00,0x00,
-   0x9c,0x8e,0x8f,0x14,0x1f,0x96,0xb9,0xa3,
-   0xff},
-  {0x00,0x01,0x02,0x03,0x04,0x05,0x14,0x07,
-   0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,
-   0x0c,0x00,0x0f,0x08},
-  {0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
-   0xff} },
- {0x50,0x18,0x10,0x1000,			/* 0x18 */
-  {0x00,0x03,0x00,0x02},
-  0x67,
-  {0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f,
-   0x00,0x4f,0x0d,0x0e,0x00,0x00,0x00,0x00,
-   0x9c,0x8e,0x8f,0x28,0x1f,0x96,0xb9,0xa3,
-   0xff},
-  {0x00,0x01,0x02,0x03,0x04,0x05,0x14,0x07,
-   0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,
-   0x0c,0x00,0x0f,0x08},
-  {0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
-   0xff} },
- {0x50,0x18,0x10,0x1000,			/* 0x19 */
-  {0x00,0x03,0x00,0x02},
-  0x66,
-  {0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f,
-   0x00,0x4f,0x0d,0x0e,0x00,0x00,0x00,0x00,
-   0x9c,0x8e,0x8f,0x28,0x0f,0x96,0xb9,0xa3,
-   0xff},
-  {0x00,0x08,0x08,0x08,0x08,0x08,0x08,0x08,
-   0x10,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
-   0x0e,0x00,0x0f,0x08},
-  {0x00,0x00,0x00,0x00,0x00,0x10,0x0a,0x00,
-   0xff} },
- {0x50,0x1d,0x10,0xa000,			/* 0x1a */
-  {0x01,0x0f,0x00,0x06},
-  0xe3,
-  {0x5f,0x4f,0x50,0x82,0x54,0x80,0x0b,0x3e,
-   0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,
-   0xea,0x8c,0xdf,0x28,0x00,0xe7,0x04,0xc3,
-   0xff},
-  {0x00,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,
-   0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,
-   0x01,0x00,0x0f,0x00},
-  {0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x01,
-   0xff} },
- {0x50,0x1d,0x10,0xa000,			/* 0x1b */
-  {0x01,0x0f,0x00,0x06},
-  0xe3,
-  {0x5f,0x4f,0x50,0x82,0x54,0x80,0x0b,0x3e,
-   0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,
-   0xea,0x8c,0xdf,0x28,0x00,0xe7,0x04,0xe3,
-   0xff},
-  {0x00,0x01,0x02,0x03,0x04,0x05,0x14,0x07,
-   0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,
-   0x01,0x00,0x0f,0x00},
-  {0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x0f,
-   0xff} },
- {0x28,0x18,0x08,0x2000,			/* 0x1c */
-  {0x01,0x0f,0x00,0x0e},
-  0x63,
-  {0x5f,0x4f,0x50,0x82,0x54,0x80,0xbf,0x1f,
-   0x00,0x41,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x9c,0x8e,0x8f,0x28,0x40,0x96,0xb9,0xa3,
-   0xff},
-  {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
-   0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,
-   0x41,0x00,0x0f,0x00},
-  {0x00,0x00,0x00,0x00,0x00,0x40,0x05,0x0f,
-   0xff} }
+	{0x01,0x9208,0x01,0x00,0x00,0x00,0x00,0x00, 0},
+	{0x01,0x1210,0x14,0x01,0x01,0x00,0x00,0x00, 0},
+	{0x01,0x1010,0x17,0x02,0x02,0x00,0x00,0x00, 0},
+	{0x03,0x8208,0x03,0x00,0x00,0x00,0x00,0x00, 0},
+	{0x03,0x0210,0x16,0x01,0x01,0x00,0x00,0x00, 0},
+	{0x03,0x0010,0x18,0x02,0x02,0x00,0x00,0x00, 0},
+	{0x05,0x9209,0x05,0x00,0x00,0x00,0x00,0x00, 0},
+	{0x06,0x8209,0x06,0x00,0x00,0x00,0x00,0x00, 0},
+	{0x07,0x0000,0x07,0x03,0x03,0x00,0x00,0x00, 0},
+	{0x07,0x0000,0x19,0x02,0x02,0x00,0x00,0x00, 0},
+	{0x0d,0x920a,0x0d,0x00,0x00,0x00,0x00,0x00, 0},
+	{0x0e,0x820a,0x0e,0x00,0x00,0x00,0x00,0x00, 0},
+	{0x0f,0x0202,0x11,0x01,0x01,0x00,0x00,0x00, 0},
+	{0x10,0x0212,0x12,0x01,0x01,0x00,0x00,0x00, 0},
+	{0x11,0x0212,0x1a,0x04,0x04,0x00,0x00,0x00, 0},
+	{0x12,0x0212,0x1b,0x04,0x04,0x00,0x00,0x00, 0},
+	{0x13,0x021b,0x1c,0x00,0x00,0x00,0x00,0x00, 0},
+	{0x12,0x0010,0x18,0x02,0x02,0x00,0x00,0x00, 0},
+	{0x12,0x0210,0x18,0x01,0x01,0x00,0x00,0x00, 0},
+	{0xff,     0,   0,   0,   0,   0,   0,   0, 0}
 };
 
 typedef struct _SiS300_ExtStruct
 {
-	UCHAR Ext_ModeID;
+	UCHAR  Ext_ModeID;
 	USHORT Ext_ModeFlag;
-	USHORT Ext_ModeInfo;
-	USHORT Ext_Point;
+	UCHAR  Ext_ModeOffset;
 	USHORT Ext_VESAID;
-	UCHAR Ext_VESAMEMSize;
-	UCHAR Ext_RESINFO;
-	UCHAR VB_ExtTVFlickerIndex;
-	UCHAR VB_ExtTVEdgeIndex;
-	UCHAR VB_ExtTVYFilterIndex;
-	UCHAR REFindex;
+	UCHAR  Ext_RESINFO;
+	UCHAR  VB_ExtTVFlickerIndex;
+	UCHAR  VB_ExtTVEdgeIndex;
+	UCHAR  VB_ExtTVYFilterIndex;
+	UCHAR  VB_ExtTVYFilterIndexROM661;
+	UCHAR  REFindex;
 } SiS300_ExtStruct;
 
 static const SiS300_ExtStruct  SiS300_EModeIDTable[] =
 {
-	{0x6a,0x2212,0x47,0x3563,0x0102,0x08,0x07,0x00,0x00,0x00,0x00},  /* 800x600x? */
-	{0x2e,0x0a1b,0x36,0x3539,0x0101,0x08,0x06,0x00,0x00,0x00,0x08},
-	{0x2f,0x021b,0x35,0x3532,0x0100,0x08,0x05,0x00,0x00,0x00,0x10},  /* 640x400x8 */
-	{0x30,0x2a1b,0x47,0x3563,0x0103,0x08,0x07,0x00,0x00,0x00,0x00},
-	{0x31,0x0a1b,0xad,0x3630,0x0000,0x08,0x0c,0x00,0x00,0x00,0x11},  /* 720x480x8 */
-	{0x32,0x2a1b,0xae,0x3637,0x0000,0x08,0x0d,0x00,0x00,0x00,0x12},  /* 720x576x8 */
-	{0x33,0x0a1d,0xad,0x3630,0x0000,0x08,0x0c,0x00,0x00,0x00,0x11},  /* 720x480x16 */
-	{0x34,0x2a1d,0xae,0x3637,0x0000,0x08,0x0d,0x00,0x00,0x00,0x12},  /* 720x576x16 */
-	{0x35,0x0a1f,0xad,0x3630,0x0000,0x08,0x0c,0x00,0x00,0x00,0x11},  /* 720x480x32 */
-	{0x36,0x2a1f,0xae,0x3637,0x0000,0x08,0x0d,0x00,0x00,0x00,0x12},  /* 720x576x32 */
-	{0x37,0x0212,0x58,0x358d,0x0104,0x08,0x08,0x00,0x00,0x00,0x13},  /* 1024x768x? */
-	{0x38,0x0a1b,0x58,0x358d,0x0105,0x08,0x08,0x00,0x00,0x00,0x13},  /* 1024x768x8 */
-	{0x3a,0x0e3b,0x69,0x35be,0x0107,0x08,0x09,0x00,0x00,0x00,0x1a},  /* 1280x1024x8 */
-	{0x3c,0x063b,0x7a,0x35d4,0x0130,0x08,0x0a,0x00,0x00,0x00,0x1e},
-	{0x3d,0x067d,0x7a,0x35d4,0x0131,0x08,0x0a,0x00,0x00,0x00,0x1e},
-	{0x40,0x921c,0x00,0x3516,0x010d,0x08,0x00,0x00,0x00,0x00,0x23},
-	{0x41,0x921d,0x00,0x3516,0x010e,0x08,0x00,0x00,0x00,0x00,0x23},
-	{0x43,0x0a1c,0x36,0x3539,0x0110,0x08,0x06,0x00,0x00,0x00,0x08},
-	{0x44,0x0a1d,0x36,0x3539,0x0111,0x08,0x06,0x00,0x00,0x00,0x08},
-	{0x46,0x2a1c,0x47,0x3563,0x0113,0x08,0x07,0x00,0x00,0x00,0x00},  /* 800x600 */
-	{0x47,0x2a1d,0x47,0x3563,0x0114,0x08,0x07,0x00,0x00,0x00,0x00},  /* 800x600 */
-	{0x49,0x0a3c,0x58,0x358d,0x0116,0x08,0x08,0x00,0x00,0x00,0x13},
-	{0x4a,0x0a3d,0x58,0x358d,0x0117,0x08,0x08,0x00,0x00,0x00,0x13},
-	{0x4c,0x0e7c,0x69,0x35be,0x0119,0x08,0x09,0x00,0x00,0x00,0x1a},
-	{0x4d,0x0e7d,0x69,0x35be,0x011a,0x08,0x09,0x00,0x00,0x00,0x1a},
-	{0x50,0x921b,0x01,0x351d,0x0132,0x08,0x01,0x00,0x00,0x00,0x24},
-	{0x51,0xb21b,0x13,0x3524,0x0133,0x08,0x03,0x00,0x00,0x00,0x25},  /* 400x300 */
-	{0x52,0x921b,0x24,0x352b,0x0134,0x08,0x04,0x00,0x00,0x00,0x26},
-	{0x56,0x921d,0x01,0x351d,0x0135,0x08,0x01,0x00,0x00,0x00,0x24},
-	{0x57,0xb21d,0x13,0x3524,0x0136,0x08,0x03,0x00,0x00,0x00,0x25},  /* 400x300 */
-	{0x58,0x921d,0x24,0x352b,0x0137,0x08,0x04,0x00,0x00,0x00,0x26},  
-	{0x59,0x921b,0x00,0x3516,0x0138,0x08,0x00,0x00,0x00,0x00,0x23}, 
-	{0x5c,0x921f,0x24,0x352b,0x0000,0x08,0x04,0x00,0x00,0x00,0x26},  /* TW: inserted 512x384x32 */
-	{0x5d,0x021d,0x35,0x3532,0x0139,0x08,0x05,0x00,0x00,0x00,0x10},  /* 640x400x16 */
- 	{0x5e,0x021f,0x35,0x3532,0x0000,0x08,0x05,0x00,0x00,0x00,0x10},  /* TW: inserted 640x400x32 */
-	{0x62,0x0a3f,0x36,0x3539,0x013a,0x08,0x06,0x00,0x00,0x00,0x08},
-	{0x63,0x2a3f,0x47,0x3563,0x013b,0x08,0x07,0x00,0x00,0x00,0x00},  /* 800x600 */
-	{0x64,0x0a7f,0x58,0x358d,0x013c,0x08,0x08,0x00,0x00,0x00,0x13},
-	{0x65,0x0eff,0x69,0x35be,0x013d,0x08,0x09,0x00,0x00,0x00,0x1a},
-	{0x66,0x06ff,0x7a,0x35d4,0x013e,0x08,0x0a,0x00,0x00,0x00,0x1e},
-	{0x68,0x067b,0x8b,0x35ef,0x013f,0x08,0x0b,0x00,0x00,0x00,0x27},
-	{0x69,0x06fd,0x8b,0x35ef,0x0140,0x08,0x0b,0x00,0x00,0x00,0x27},
-	{0x6b,0x07ff,0x8b,0x35ef,0x0000,0x10,0x0b,0x00,0x00,0x00,0x27},
-	{0x6c,0x067b,0x9c,0x35f6,0x0000,0x08,0x11,0x00,0x00,0x00,0x28},  /* TW: 2048x1536x8 - not in BIOS! */
-	{0x6d,0x06fd,0x9c,0x35f6,0x0000,0x10,0x11,0x00,0x00,0x00,0x28},  /* TW: 2048x1536x16 - not in BIOS! */
-	{0x6e,0x0a3b,0x6f,0x35b2,0x0000,0x08,0x0e,0x00,0x00,0x00,0x29},  /* 1280x960x8 */
-	{0x6f,0x0a7d,0x6f,0x35b2,0x0000,0x08,0x0e,0x00,0x00,0x00,0x29},  /* 1280x960x16 */
-	/* TW: 16:9 modes copied from 310/325 series - not in ANY BIOS */
-	{0x70,0x2a1b,0x40,0x3b52,0x0000,0x08,0x12,0x00,0x00,0x07,0x2d},    /* 800x480x8 */
-	{0x71,0x0a1b,0x51,0x3b63,0x0000,0x08,0x13,0x00,0x00,0x00,0x30},    /* 1024x576x8 */
-	{0x74,0x0a1d,0x51,0x3b63,0x0000,0x08,0x13,0x00,0x00,0x00,0x30},    /* 1024x576x16 */
-	{0x75,0x0e3d,0x62,0x3b74,0x0000,0x08,0x14,0x00,0x00,0x00,0x33},	   /* 1280x720x16 */
-	{0x76,0x2a1f,0x40,0x3b52,0x0000,0x08,0x12,0x00,0x00,0x07,0x2d},    /* 800x480x32 */
-	{0x77,0x0a3f,0x51,0x3b63,0x0000,0x08,0x13,0x00,0x00,0x00,0x30},	   /* 1024x576x32 */
-	{0x78,0x0eff,0x62,0x3b74,0x0000,0x08,0x14,0x00,0x00,0x00,0x33},	   /* 1280x720x32 */
-	{0x79,0x0e3b,0x62,0x3b74,0x0000,0x08,0x14,0x00,0x00,0x00,0x33},	   /* 1280x720x8 */
-	{0x7a,0x2a1d,0x40,0x3b52,0x0000,0x08,0x12,0x00,0x00,0x07,0x2d},    /* 800x480x16 */
-	/* TW: End of new 16:9 modes */
-	{0x7b,0x0aff,0x6f,0x35b2,0x0000,0x08,0x0e,0x00,0x00,0x00,0x29},    /* 1280x960x32 */
-	{0x20,0x0a1b,0x54,0x0000,0x0000,0x08,0x0f,0x00,0x00,0x00,0x2b},    /* 1024x600 */
-	{0x21,0x0a3d,0x54,0x0000,0x0000,0x08,0x0f,0x00,0x00,0x00,0x2b},
-	{0x22,0x0a7f,0x54,0x0000,0x0000,0x08,0x0f,0x00,0x00,0x00,0x2b},
-	{0x23,0x0a1b,0xc5,0x0000,0x0000,0x08,0x10,0x00,0x00,0x00,0x2c},    /* 1152x768 */
-	{0x24,0x0a3d,0xc5,0x431d,0x0000,0x08,0x10,0x00,0x00,0x00,0x2c},
-	{0x25,0x0a7f,0xc5,0x431d,0x0000,0x08,0x10,0x00,0x00,0x00,0x2c},
-	{0x29,0x0e1b,0xc5,0x0000,0x0000,0x08,0x15,0x00,0x00,0x00,0x36},    /* TW: NEW 1152x864 - not in BIOS */
-	{0x2a,0x0e3d,0xc5,0x0000,0x0000,0x08,0x15,0x00,0x00,0x00,0x36},
-	{0x2b,0x0e7f,0xc5,0x0000,0x0000,0x08,0x15,0x00,0x00,0x00,0x36},
-	{0x39,0x2a1b,0xd6,0x0000,0x0000,0x08,0x16,0x00,0x00,0x00,0x38},    /* TW: NEW 848x480 - not in BIOS */
-	{0x3b,0x2a3d,0xd6,0x0000,0x0000,0x08,0x16,0x00,0x00,0x00,0x38},
-	{0x3e,0x2a7f,0xd6,0x0000,0x0000,0x08,0x16,0x00,0x00,0x00,0x38},
-	{0x3f,0x2a1b,0xd7,0x0000,0x0000,0x08,0x17,0x00,0x00,0x00,0x3a},    /* TW: NEW 856x480 - not in BIOS */
-	{0x42,0x2a3d,0xd7,0x0000,0x0000,0x08,0x17,0x00,0x00,0x00,0x3a},
-	{0x45,0x2a7f,0xd7,0x0000,0x0000,0x08,0x17,0x00,0x00,0x00,0x3a},
-	{0x48,0x223b,0xe8,0x0000,0x0000,0x08,0x18,0x00,0x00,0x00,0x3c},    /* TW: NEW 1360x768 - not in BIOS */
-	{0x4b,0x227d,0xe8,0x0000,0x0000,0x08,0x18,0x00,0x00,0x00,0x3c},
-	{0x4e,0x22ff,0xe8,0x0000,0x0000,0x08,0x18,0x00,0x00,0x00,0x3c},
-	{0xff,0x0000,0x00,0x0000,0xffff,0x00,0x00,0x00,0x00,0x00,0x00}
+	{0x6a,0x2212,0x04,0x0102,SIS_RI_800x600,  0x00,0x00,0x00,0x00,0x00},  /* 800x600x? */
+	{0x2e,0x0a1b,0x03,0x0101,SIS_RI_640x480,  0x00,0x00,0x00,0x00,0x08},
+	{0x2f,0x021b,0x03,0x0100,SIS_RI_640x400,  0x00,0x00,0x00,0x00,0x10},  /* 640x400x8 */
+	{0x30,0x2a1b,0x04,0x0103,SIS_RI_800x600,  0x00,0x00,0x00,0x00,0x00},
+	{0x31,0x0a1b,0x0a,0x0000,SIS_RI_720x480,  0x00,0x00,0x00,0x00,0x11},  /* 720x480x8 */
+	{0x32,0x2a1b,0x0a,0x0000,SIS_RI_720x576,  0x00,0x00,0x00,0x00,0x12},  /* 720x576x8 */
+	{0x33,0x0a1d,0x0a,0x0000,SIS_RI_720x480,  0x00,0x00,0x00,0x00,0x11},  /* 720x480x16 */
+	{0x34,0x2a1d,0x0a,0x0000,SIS_RI_720x576,  0x00,0x00,0x00,0x00,0x12},  /* 720x576x16 */
+	{0x35,0x0a1f,0x0a,0x0000,SIS_RI_720x480,  0x00,0x00,0x00,0x00,0x11},  /* 720x480x32 */
+	{0x36,0x2a1f,0x0a,0x0000,SIS_RI_720x576,  0x00,0x00,0x00,0x00,0x12},  /* 720x576x32 */
+	{0x37,0x0212,0x05,0x0104,SIS_RI_1024x768, 0x00,0x00,0x00,0x00,0x13},  /* 1024x768x? */
+	{0x38,0x0a1b,0x05,0x0105,SIS_RI_1024x768, 0x00,0x00,0x00,0x00,0x13},  /* 1024x768x8 */
+	{0x3a,0x0e3b,0x06,0x0107,SIS_RI_1280x1024,0x00,0x00,0x00,0x00,0x1a},  /* 1280x1024x8 */
+	{0x3c,0x063b,0x07,0x0130,SIS_RI_1600x1200,0x00,0x00,0x00,0x00,0x1e},
+	{0x3d,0x067d,0x07,0x0131,SIS_RI_1600x1200,0x00,0x00,0x00,0x00,0x1e},
+	{0x40,0x921c,0x00,0x010d,SIS_RI_320x200,  0x00,0x00,0x00,0x00,0x23},  /* 320x200x15 */
+	{0x41,0x921d,0x00,0x010e,SIS_RI_320x200,  0x00,0x00,0x00,0x00,0x23},  /* 320x200x16 */
+	{0x43,0x0a1c,0x03,0x0110,SIS_RI_640x480,  0x00,0x00,0x00,0x00,0x08},
+	{0x44,0x0a1d,0x03,0x0111,SIS_RI_640x480,  0x00,0x00,0x00,0x00,0x08},
+	{0x46,0x2a1c,0x04,0x0113,SIS_RI_800x600,  0x00,0x00,0x00,0x00,0x00},  /* 800x600x15 */
+	{0x47,0x2a1d,0x04,0x0114,SIS_RI_800x600,  0x00,0x00,0x00,0x00,0x00},  /* 800x600x16 */
+	{0x49,0x0a3c,0x05,0x0116,SIS_RI_1024x768, 0x00,0x00,0x00,0x00,0x13},
+	{0x4a,0x0a3d,0x05,0x0117,SIS_RI_1024x768, 0x00,0x00,0x00,0x00,0x13},
+	{0x4c,0x0e7c,0x06,0x0119,SIS_RI_1280x1024,0x00,0x00,0x00,0x00,0x1a},
+	{0x4d,0x0e7d,0x06,0x011a,SIS_RI_1280x1024,0x00,0x00,0x00,0x00,0x1a},
+	{0x50,0x921b,0x00,0x0132,SIS_RI_320x240,  0x00,0x00,0x00,0x00,0x24},  /* 320x240x8  */
+	{0x51,0xb21b,0x01,0x0133,SIS_RI_400x300,  0x00,0x00,0x00,0x00,0x25},  /* 400x300x8  */
+	{0x52,0x921b,0x02,0x0134,SIS_RI_512x384,  0x00,0x00,0x00,0x00,0x26},  /* 512x384x8  */
+	{0x56,0x921d,0x00,0x0135,SIS_RI_320x240,  0x00,0x00,0x00,0x00,0x24},  /* 320x240x16 */
+	{0x57,0xb21d,0x01,0x0136,SIS_RI_400x300,  0x00,0x00,0x00,0x00,0x25},  /* 400x300x16 */
+	{0x58,0x921d,0x02,0x0137,SIS_RI_512x384,  0x00,0x00,0x00,0x00,0x26},  /* 512x384x16 */
+	{0x59,0x921b,0x00,0x0138,SIS_RI_320x200,  0x00,0x00,0x00,0x00,0x23},  /* 320x200x8  */
+	{0x5c,0x921f,0x02,0x0000,SIS_RI_512x384,  0x00,0x00,0x00,0x00,0x26},  /* 512x384x32 */
+	{0x5d,0x021d,0x03,0x0139,SIS_RI_640x400,  0x00,0x00,0x00,0x00,0x10},  /* 640x400x16 */
+ 	{0x5e,0x021f,0x03,0x0000,SIS_RI_640x400,  0x00,0x00,0x00,0x00,0x10},  /* 640x400x32 */
+	{0x62,0x0a3f,0x03,0x013a,SIS_RI_640x480,  0x00,0x00,0x00,0x00,0x08},
+	{0x63,0x2a3f,0x04,0x013b,SIS_RI_800x600,  0x00,0x00,0x00,0x00,0x00},  /* 800x600x32 */
+	{0x64,0x0a7f,0x05,0x013c,SIS_RI_1024x768, 0x00,0x00,0x00,0x00,0x13},
+	{0x65,0x0eff,0x06,0x013d,SIS_RI_1280x1024,0x00,0x00,0x00,0x00,0x1a},
+	{0x66,0x06ff,0x07,0x013e,SIS_RI_1600x1200,0x00,0x00,0x00,0x00,0x1e},
+	{0x68,0x067b,0x08,0x013f,SIS_RI_1920x1440,0x00,0x00,0x00,0x00,0x27},
+	{0x69,0x06fd,0x08,0x0140,SIS_RI_1920x1440,0x00,0x00,0x00,0x00,0x27},
+	{0x6b,0x07ff,0x08,0x0000,SIS_RI_1920x1440,0x00,0x00,0x00,0x00,0x27},
+	{0x6c,0x067b,0x09,0x0000,SIS_RI_2048x1536,0x00,0x00,0x00,0x00,0x28},  /* 2048x1536x8 - not in BIOS! */
+	{0x6d,0x06fd,0x09,0x0000,SIS_RI_2048x1536,0x00,0x00,0x00,0x00,0x28},  /* 2048x1536x16 - not in BIOS! */
+	{0x70,0x2a1b,0x04,0x0000,SIS_RI_800x480,  0x00,0x00,0x07,0x00,0x2d},  /* 800x480x8 */
+	{0x71,0x0a1b,0x05,0x0000,SIS_RI_1024x576, 0x00,0x00,0x00,0x00,0x30},  /* 1024x576x8 */
+	{0x74,0x0a1d,0x05,0x0000,SIS_RI_1024x576, 0x00,0x00,0x00,0x00,0x30},  /* 1024x576x16 */
+	{0x75,0x0e3d,0x06,0x0000,SIS_RI_1280x720, 0x00,0x00,0x00,0x00,0x33},  /* 1280x720x16 */
+	{0x76,0x2a1f,0x04,0x0000,SIS_RI_800x480,  0x00,0x00,0x07,0x00,0x2d},  /* 800x480x32 */
+	{0x77,0x0a3f,0x05,0x0000,SIS_RI_1024x576, 0x00,0x00,0x00,0x00,0x30},  /* 1024x576x32 */
+	{0x78,0x0eff,0x06,0x0000,SIS_RI_1280x720, 0x00,0x00,0x00,0x00,0x33},  /* 1280x720x32 */
+	{0x79,0x0e3b,0x06,0x0000,SIS_RI_1280x720, 0x00,0x00,0x00,0x00,0x33},  /* 1280x720x8 */
+	{0x7a,0x2a1d,0x04,0x0000,SIS_RI_800x480,  0x00,0x00,0x07,0x00,0x2d},  /* 800x480x16 */
+	{0x7c,0x0a3b,0x06,0x0000,SIS_RI_1280x960, 0x00,0x00,0x00,0x00,0x29},  /* 1280x960x8 */
+	{0x7d,0x0a7d,0x06,0x0000,SIS_RI_1280x960, 0x00,0x00,0x00,0x00,0x29},  /* 1280x960x16 */
+	{0x7e,0x0aff,0x06,0x0000,SIS_RI_1280x960, 0x00,0x00,0x00,0x00,0x29},  /* 1280x960x32 */
+	{0x20,0x0a1b,0x05,0x0000,SIS_RI_1024x600, 0x00,0x00,0x00,0x00,0x2b},  /* 1024x600 */
+	{0x21,0x0a3d,0x05,0x0000,SIS_RI_1024x600, 0x00,0x00,0x00,0x00,0x2b},
+	{0x22,0x0a7f,0x05,0x0000,SIS_RI_1024x600, 0x00,0x00,0x00,0x00,0x2b},
+	{0x23,0x0a1b,0x0c,0x0000,SIS_RI_1152x768, 0x00,0x00,0x00,0x00,0x2c},  /* 1152x768 */
+	{0x24,0x0a3d,0x0c,0x0000,SIS_RI_1152x768, 0x00,0x00,0x00,0x00,0x2c},
+	{0x25,0x0a7f,0x0c,0x0000,SIS_RI_1152x768, 0x00,0x00,0x00,0x00,0x2c},
+	{0x29,0x0e1b,0x0c,0x0000,SIS_RI_1152x864, 0x00,0x00,0x00,0x00,0x36},  /* 1152x864 */
+	{0x2a,0x0e3d,0x0c,0x0000,SIS_RI_1152x864, 0x00,0x00,0x00,0x00,0x36},
+	{0x2b,0x0e7f,0x0c,0x0000,SIS_RI_1152x864, 0x00,0x00,0x00,0x00,0x36},
+	{0x39,0x2a1b,0x0d,0x0000,SIS_RI_848x480,  0x00,0x00,0x00,0x00,0x38},  /* 848x480 */
+	{0x3b,0x2a3d,0x0d,0x0000,SIS_RI_848x480,  0x00,0x00,0x00,0x00,0x38},
+	{0x3e,0x2a7f,0x0d,0x0000,SIS_RI_848x480,  0x00,0x00,0x00,0x00,0x38},
+	{0x3f,0x2a1b,0x0d,0x0000,SIS_RI_856x480,  0x00,0x00,0x00,0x00,0x3a},  /* 856x480 */
+	{0x42,0x2a3d,0x0d,0x0000,SIS_RI_856x480,  0x00,0x00,0x00,0x00,0x3a},
+	{0x45,0x2a7f,0x0d,0x0000,SIS_RI_856x480,  0x00,0x00,0x00,0x00,0x3a},
+	{0x48,0x223b,0x0e,0x0000,SIS_RI_1360x768, 0x00,0x00,0x00,0x00,0x3c},  /* 1360x768 */
+	{0x4b,0x227d,0x0e,0x0000,SIS_RI_1360x768, 0x00,0x00,0x00,0x00,0x3c},
+	{0x4e,0x22ff,0x0e,0x0000,SIS_RI_1360x768, 0x00,0x00,0x00,0x00,0x3c},
+	{0x4f,0x921f,0x00,0x0000,SIS_RI_320x200,  0x00,0x00,0x00,0x00,0x23},  /* 320x200x32 */
+	{0x53,0x921f,0x00,0x0000,SIS_RI_320x240,  0x00,0x00,0x00,0x00,0x24},  /* 320x240x32 */
+	{0x54,0xb21f,0x01,0x0000,SIS_RI_400x300,  0x00,0x00,0x00,0x00,0x25},  /* 400x300x32 */
+	{0x55,0x2e3b,0x06,0x0000,SIS_RI_1280x768, 0x00,0x00,0x00,0x00,0x3d},  /* 1280x768   */
+	{0x5a,0x2e7d,0x06,0x0000,SIS_RI_1280x768, 0x00,0x00,0x00,0x00,0x3d},
+	{0x5b,0x2eff,0x06,0x0000,SIS_RI_1280x768, 0x00,0x00,0x00,0x00,0x3d},
+	{0x5f,0x2a1b,0x0f,0x0000,SIS_RI_768x576,  0x00,0x00,0x00,0x00,0x3e},  /* 768x576x8 */
+	{0x60,0x2a1d,0x0f,0x0000,SIS_RI_768x576,  0x00,0x00,0x00,0x00,0x3e},  /* 768x576x16 */
+	{0x61,0x2a1f,0x0f,0x0000,SIS_RI_768x576,  0x00,0x00,0x00,0x00,0x3e},  /* 768x576x32 */
+	{0x67,0x2e3b,0x0e,0x0000,SIS_RI_1360x1024,0x00,0x00,0x00,0x00,0x3f},  /* 1360x1024x8 (BARCO) */
+	{0x6f,0x2e7d,0x0e,0x0000,SIS_RI_1360x1024,0x00,0x00,0x00,0x00,0x3f},  /* 1360x1024x16 (BARCO) */
+	{0x72,0x2eff,0x0e,0x0000,SIS_RI_1360x1024,0x00,0x00,0x00,0x00,0x3f},  /* 1360x1024x32 (BARCO) */
+	{0xff,0x0000,0x00,0xffff,0,               0x00,0x00,0x00,0x00,0x00}
 };
 
 typedef struct _SiS300_Ext2Struct
 {
 	USHORT Ext_InfoFlag;
-	UCHAR Ext_CRT1CRTC;  /* TW: Index in SiS300_CRT1Table */
-	UCHAR Ext_CRTVCLK;   /* TW: Index in VCLK array */
-	UCHAR Ext_CRT2CRTC;  /* TW: Index in LCD Paneltype arrays (&3f) */
+	UCHAR  Ext_CRT1CRTC;  /* Index in SiS300_CRT1Table */
+	UCHAR  Ext_CRTVCLK;   /* Index in VCLK array */
+	UCHAR  Ext_CRT2CRTC;  /* Index in LCD Paneltype arrays (&3f) */
 	UCHAR  ModeID;
 	USHORT XRes;
 	USHORT YRes;
-	USHORT ROM_OFFSET;
+	UCHAR  Ext_PDC;
 } SiS300_Ext2Struct;
 
 static const SiS300_Ext2Struct  SiS300_RefIndex[] =
-{ /* TW: Don't ever insert anything here, table is indexed */
-	{0x085f,0x0d,0x03,0x05,0x6a, 800, 600,0x3563}, /* 00 */
-	{0x0467,0x0e,0x44,0x05,0x6a, 800, 600,0x3568}, /* 01 */
-	{0x0067,0x0f,0x07,0x48,0x6a, 800, 600,0x356d}, /* 02 - CRT1CRTC was 0x4f */
-	{0x0067,0x10,0x06,0x8b,0x6a, 800, 600,0x3572}, /* 03 */
-	{0x0147,0x11,0x08,0x00,0x6a, 800, 600,0x3577}, /* 04 */
-	{0x0147,0x12,0x0c,0x00,0x6a, 800, 600,0x357c}, /* 05 */
-	{0x0047,0x11,0x4e,0x00,0x6a, 800, 600,0x3581}, /* 06 - CRT1CRTC was 0x51 */
-	{0x0047,0x11,0x13,0x00,0x6a, 800, 600,0x3586}, /* 07 */
-	{0xc85f,0x05,0x00,0x04,0x2e, 640, 480,0x3539}, /* 08 */
-	{0xc067,0x06,0x02,0x04,0x2e, 640, 480,0x353e}, /* 09 */
-	{0xc067,0x07,0x02,0x47,0x2e, 640, 480,0x3543}, /* 0a */
-	{0xc067,0x08,0x03,0x8a,0x2e, 640, 480,0x3548}, /* 0b */
-	{0xc047,0x09,0x05,0x00,0x2e, 640, 480,0x354d}, /* 0c */
-	{0xc047,0x0a,0x08,0x00,0x2e, 640, 480,0x3552}, /* 0d */
-	{0xc047,0x0b,0x0a,0x00,0x2e, 640, 480,0x3557}, /* 0e */
-	{0xc047,0x0c,0x10,0x00,0x2e, 640, 480,0x355c}, /* 0f */
-	{0x487f,0x04,0x00,0x00,0x2f, 640, 400,0x3532}, /* 10 */
-	{0xc00f,0x31,0x01,0x06,0x31, 720, 480,0x3630}, /* 11 */
-	{0x000f,0x32,0x03,0x06,0x32, 720, 576,0x3637}, /* 12 */
-	{0x0187,0x15,0x05,0x00,0x37,1024, 768,0x358d}, /* 13 */
-        {0xc877,0x16,0x09,0x06,0x37,1024, 768,0x3592}, /* 14 */
-	{0xc067,0x17,0x0b,0x49,0x37,1024, 768,0x3597}, /* 15 - CRT1CRTC was 0x97 */
-	{0x0267,0x18,0x0d,0x00,0x37,1024, 768,0x359c}, /* 16 */
-	{0x0047,0x19,0x11,0x8c,0x37,1024, 768,0x35a1}, /* 17 - CRT1CRTC was 0x59 */
-	{0x0047,0x1a,0x52,0x00,0x37,1024, 768,0x35a6}, /* 18 */
-	{0x0007,0x1b,0x16,0x00,0x37,1024, 768,0x35ab}, /* 19 - CRT1CRTC was 0x5b */
-	{0x0387,0x1c,0x4d,0x00,0x3a,1280,1024,0x35be}, /* 1a - CRT1CRTC was 0x5c */
-	{0x0077,0x1d,0x14,0x07,0x3a,1280,1024,0x35c3}, /* 1b */
-	{0x0047,0x1e,0x17,0x00,0x3a,1280,1024,0x35c8}, /* 1c */
-	{0x0007,0x1f,0x98,0x00,0x3a,1280,1024,0x35cd}, /* 1d */
-	{0x0007,0x20,0x59,0x00,0x3c,1600,1200,0x35d4}, /* 1e - CRT1CRTC was 0x60 */
-	{0x0007,0x21,0x5a,0x00,0x3c,1600,1200,0x35d9}, /* 1f */
-	{0x0007,0x22,0x1b,0x00,0x3c,1600,1200,0x35de}, /* 20 */
-	{0x0007,0x23,0x1d,0x00,0x3c,1600,1200,0x35e3}, /* 21 - CRT1CRTC was 0x63 */
-	{0x0007,0x24,0x1e,0x00,0x3c,1600,1200,0x35e8}, /* 22 */
-	{0x407f,0x00,0x00,0x00,0x40, 320, 200,0x3516}, /* 23 */
-	{0xc07f,0x01,0x00,0x04,0x50, 320, 240,0x351d}, /* 24 */
-	{0x0077,0x02,0x04,0x05,0x51, 400, 300,0x3524}, /* 25 */
-	{0xc877,0x03,0x09,0x06,0x52, 512, 384,0x352b}, /* 26 */  /* was c077 */
-	{0x8207,0x25,0x1f,0x00,0x68,1920,1440,0x35ef}, /* 27 */
-	{0x0007,0x26,0x20,0x00,0x6c,2048,1536,0x35f6}, /* 28 */
-	{0x0067,0x27,0x14,0x08,0x6e,1280, 960,0x35b7}, /* 29 - TW: 1280x960-60 */
-	{0x0027,0x45,0x3c,0x08,0x6e,1280, 960,0x35b7}, /* 2a - TW: 1280x960-85 */
-	{0xc077,0x33,0x09,0x06,0x20,1024, 600,0x0000}, /* 2b */
-	{0xc077,0x34,0x0b,0x06,0x23,1152, 768,0x0000}, /* 2c */	/* VCLK 0x09 */
-	{0x0057,0x35,0x27,0x08,0x70, 800, 480,0x3b52}, /* 2d - TW: 16:9 modes */
-	{0x0047,0x36,0x37,0x08,0x70, 800, 480,0x3b57}, /* 2e */
-	{0x0047,0x37,0x08,0x08,0x70, 800, 480,0x3b5c}, /* 2f */
-	{0x0057,0x38,0x09,0x09,0x71,1024, 576,0x3b63}, /* 30 */
-	{0x0047,0x39,0x38,0x09,0x71,1024, 576,0x3b68}, /* 31 */
-	{0x0047,0x3a,0x11,0x09,0x71,1024, 576,0x3b6d}, /* 32 */
-	{0x0057,0x3b,0x39,0x0a,0x75,1280, 720,0x3b74}, /* 33 */
-	{0x0047,0x3c,0x3a,0x0a,0x75,1280, 720,0x3b79}, /* 34 */
-	{0x0007,0x3d,0x3b,0x0a,0x75,1280, 720,0x3b7e}, /* 35 - TW: END of 16:9 modes */
-	{0x0047,0x3e,0x34,0x06,0x29,1152, 864,0x0000}, /* 36 TW: 1152x864-75Hz - Non-BIOS, new */
-	{0x0047,0x44,0x3a,0x06,0x29,1152, 864,0x0000}, /* 37 TW: 1152x864-85Hz - Non-BIOS, new */
-	{0x00c7,0x3f,0x28,0x00,0x39, 848, 480,0x0000}, /* 38 TW: 848x480-38Hzi - Non-BIOS, new */
-	{0xc047,0x40,0x3d,0x00,0x39, 848, 480,0x0000}, /* 39 TW: 848x480-60Hz  - Non-BIOS, new */
-	{0x00c7,0x41,0x28,0x00,0x3f, 856, 480,0x0000}, /* 3a TW: 856x480-38Hzi - Non-BIOS, new */
-	{0xc047,0x42,0x28,0x00,0x3f, 856, 480,0x0000}, /* 3b TW: 856x480-60Hz  - Non-BIOS, new */
-	{0x0047,0x43,0x3e,0x00,0x48,1360, 768,0x0000}, /* 3c TW: 1360x768-60Hz - Non-BIOS, new */
-	{0xffff,0,0,0,0,0,0,0}
+{
+	{0x085f,0x0d,0x03,0x05,0x6a, 800, 600, 0}, /* 00 */
+	{0x0467,0x0e,0x44,0x05,0x6a, 800, 600, 0}, /* 01 */
+	{0x0067,0x0f,0x07,0x48,0x6a, 800, 600, 0}, /* 02 - CRT1CRTC was 0x4f */
+	{0x0067,0x10,0x06,0x8b,0x6a, 800, 600, 0}, /* 03 */
+	{0x0147,0x11,0x08,0x00,0x6a, 800, 600, 0}, /* 04 */
+	{0x0147,0x12,0x0c,0x00,0x6a, 800, 600, 0}, /* 05 */
+	{0x0047,0x11,0x4e,0x00,0x6a, 800, 600, 0}, /* 06 - CRT1CRTC was 0x51 */
+	{0x0047,0x11,0x13,0x00,0x6a, 800, 600, 0}, /* 07 */
+	{0xc85f,0x05,0x00,0x04,0x2e, 640, 480, 0}, /* 08 */
+	{0xc067,0x06,0x02,0x04,0x2e, 640, 480, 0}, /* 09 */
+	{0xc067,0x07,0x02,0x47,0x2e, 640, 480, 0}, /* 0a */
+	{0xc067,0x08,0x03,0x8a,0x2e, 640, 480, 0}, /* 0b */
+	{0xc047,0x09,0x05,0x00,0x2e, 640, 480, 0}, /* 0c */
+	{0xc047,0x0a,0x08,0x00,0x2e, 640, 480, 0}, /* 0d */
+	{0xc047,0x0b,0x0a,0x00,0x2e, 640, 480, 0}, /* 0e */
+	{0xc047,0x0c,0x10,0x00,0x2e, 640, 480, 0}, /* 0f */
+	{0x487f,0x04,0x00,0x00,0x2f, 640, 400, 0}, /* 10 */
+	{0xc04f,0x31,0x01,0x06,0x31, 720, 480, 0}, /* 11 */
+	{0x004f,0x32,0x03,0x06,0x32, 720, 576, 0}, /* 12 */
+	{0x0187,0x15,0x05,0x00,0x37,1024, 768, 0}, /* 13 */
+        {0xc877,0x16,0x09,0x06,0x37,1024, 768, 0}, /* 14 */
+	{0xc067,0x17,0x0b,0x49,0x37,1024, 768, 0}, /* 15 - CRT1CRTC was 0x97 */
+	{0x0267,0x18,0x0d,0x00,0x37,1024, 768, 0}, /* 16 */
+	{0x0047,0x19,0x11,0x8c,0x37,1024, 768, 0}, /* 17 - CRT1CRTC was 0x59 */
+	{0x0047,0x1a,0x52,0x00,0x37,1024, 768, 0}, /* 18 */
+	{0x0007,0x1b,0x16,0x00,0x37,1024, 768, 0}, /* 19 - CRT1CRTC was 0x5b */
+	{0x0387,0x1c,0x4d,0x00,0x3a,1280,1024, 0}, /* 1a - CRT1CRTC was 0x5c */
+	{0x0077,0x1d,0x14,0x07,0x3a,1280,1024, 0}, /* 1b */
+	{0x0047,0x1e,0x17,0x00,0x3a,1280,1024, 0}, /* 1c */
+	{0x0007,0x1f,0x98,0x00,0x3a,1280,1024, 0}, /* 1d */
+	{0x0007,0x20,0x59,0x00,0x3c,1600,1200, 0}, /* 1e - CRT1CRTC was 0x60 */
+	{0x0007,0x21,0x5a,0x00,0x3c,1600,1200, 0}, /* 1f */
+	{0x0007,0x22,0x1b,0x00,0x3c,1600,1200, 0}, /* 20 */
+	{0x0007,0x23,0x1d,0x00,0x3c,1600,1200, 0}, /* 21 - CRT1CRTC was 0x63 */
+	{0x0007,0x24,0x1e,0x00,0x3c,1600,1200, 0}, /* 22 */
+	{0x407f,0x00,0x00,0x00,0x40, 320, 200, 0}, /* 23 */
+	{0xc07f,0x01,0x00,0x04,0x50, 320, 240, 0}, /* 24 */
+	{0x0077,0x02,0x04,0x05,0x51, 400, 300, 0}, /* 25 */
+	{0xc877,0x03,0x09,0x06,0x52, 512, 384, 0}, /* 26 */  /* was c077 */
+	{0x8207,0x25,0x1f,0x00,0x68,1920,1440, 0}, /* 27 */
+	{0x0007,0x26,0x20,0x00,0x6c,2048,1536, 0}, /* 28 */
+	{0x0067,0x27,0x14,0x08,0x6e,1280, 960, 0}, /* 29 - TW: 1280x960-60 */
+	{0x0027,0x45,0x3c,0x08,0x6e,1280, 960, 0}, /* 2a - TW: 1280x960-85 */
+	{0xc077,0x33,0x09,0x06,0x20,1024, 600, 0}, /* 2b */
+	{0xc077,0x34,0x0b,0x06,0x23,1152, 768, 0}, /* 2c */	/* VCLK 0x09 */
+	{0x0057,0x35,0x27,0x08,0x70, 800, 480, 0}, /* 2d */
+	{0x0047,0x36,0x37,0x08,0x70, 800, 480, 0}, /* 2e */
+	{0x0047,0x37,0x08,0x08,0x70, 800, 480, 0}, /* 2f */
+	{0x0057,0x38,0x09,0x09,0x71,1024, 576, 0}, /* 30 */
+	{0x0047,0x39,0x38,0x09,0x71,1024, 576, 0}, /* 31 */
+	{0x0047,0x3a,0x11,0x09,0x71,1024, 576, 0}, /* 32 */
+	{0x0057,0x3b,0x39,0x0a,0x75,1280, 720, 0}, /* 33 */
+	{0x0047,0x3c,0x3a,0x0a,0x75,1280, 720, 0}, /* 34 */
+	{0x0007,0x3d,0x3b,0x0a,0x75,1280, 720, 0}, /* 35 */
+	{0x0047,0x3e,0x34,0x06,0x29,1152, 864, 0}, /* 36 1152x864-75Hz */
+	{0x0047,0x44,0x3a,0x06,0x29,1152, 864, 0}, /* 37 1152x864-85Hz */
+	{0x00c7,0x3f,0x28,0x00,0x39, 848, 480, 0}, /* 38 848x480-38Hzi */
+	{0xc067,0x40,0x3d,0x0b,0x39, 848, 480, 0}, /* 39 848x480-60Hz  */
+	{0x00c7,0x41,0x28,0x00,0x3f, 856, 480, 0}, /* 3a 856x480-38Hzi */
+	{0xc047,0x42,0x28,0x00,0x3f, 856, 480, 0}, /* 3b 856x480-60Hz  */
+	{0x0067,0x43,0x3e,0x0c,0x48,1360, 768, 0}, /* 3c 1360x768-60Hz */
+	{0x0077,0x46,0x3f,0x08,0x55,1280, 768, 0}, /* 3d 1280x768-60Hz */
+	{0x004f,0x47,0x03,0x06,0x5f, 768, 576, 0}, /* 3e 768x576 */
+	{0x0027,0x48,0x13,0x08,0x67,1360,1024, 0}, /* 3f 1360x1024-59Hz (BARCO1366 only) */
+	{0xffff,   0,   0,   0,   0,   0,   0, 0}
 };
 
-/*add for 300 oem util*/
 typedef struct _SiS_VBModeIDTableStruct
 {
 	UCHAR  ModeID;
@@ -621,6 +313,10 @@
 	{0x30,0x00,0x00,0x01,0x07,0x00,0x08,0x0a},
 	{0x31,0x00,0x00,0x01,0x06,0x00,0x00,0x00},
 	{0x32,0x00,0x00,0x01,0x06,0x00,0x00,0x00},
+	{0x33,0x00,0x00,0x01,0x06,0x00,0x00,0x00},
+	{0x34,0x00,0x00,0x01,0x06,0x00,0x00,0x00},
+	{0x35,0x00,0x00,0x01,0x06,0x00,0x00,0x00},
+	{0x36,0x00,0x00,0x01,0x06,0x00,0x00,0x00},
 	{0x37,0x00,0x00,0x01,0x00,0x00,0x0a,0x0c},
 	{0x38,0x00,0x00,0x01,0x00,0x00,0x0a,0x0c},
 	{0x3a,0x00,0x00,0x01,0x00,0x00,0x0b,0x0d},
@@ -634,24 +330,30 @@
 	{0x4a,0x00,0x00,0x01,0x00,0x00,0x0a,0x0c},
 	{0x4c,0x00,0x00,0x01,0x00,0x00,0x0b,0x0d},
 	{0x4d,0x00,0x00,0x01,0x00,0x00,0x0b,0x0d},
+	{0x4f,0x00,0x00,0x01,0x04,0x00,0x05,0x05},
 	{0x50,0x00,0x00,0x01,0x04,0x00,0x05,0x07},
 	{0x51,0x00,0x00,0x01,0x07,0x00,0x07,0x09},
 	{0x52,0x00,0x00,0x01,0x00,0x00,0x09,0x0b},
+	{0x53,0x00,0x00,0x01,0x04,0x00,0x05,0x07},
+	{0x54,0x00,0x00,0x01,0x07,0x00,0x07,0x09},
 	{0x56,0x00,0x00,0x01,0x04,0x00,0x05,0x07},
 	{0x57,0x00,0x00,0x01,0x07,0x00,0x07,0x09},
 	{0x58,0x00,0x00,0x01,0x00,0x00,0x09,0x0b},
 	{0x59,0x00,0x00,0x01,0x04,0x00,0x05,0x05},
-	{0x5d,0x00,0x00,0x01,0x07,0x00,0x06,0x06},
+	{0x5c,0x00,0x00,0x01,0x00,0x00,0x09,0x0b},
+	{0x5d,0x00,0x00,0x01,0x05,0x00,0x06,0x06},
+	{0x5e,0x00,0x00,0x01,0x05,0x00,0x06,0x06},
+	{0x5f,0x00,0x00,0x01,0x06,0x00,0x00,0x00},
+	{0x60,0x00,0x00,0x01,0x06,0x00,0x00,0x00},
+	{0x61,0x00,0x00,0x01,0x06,0x00,0x00,0x00},
 	{0x62,0x00,0x00,0x01,0x05,0x00,0x06,0x08},
 	{0x63,0x00,0x00,0x01,0x07,0x00,0x08,0x0a},
 	{0x64,0x00,0x00,0x01,0x00,0x00,0x0a,0x0c},
 	{0x65,0x00,0x00,0x01,0x00,0x00,0x0b,0x0d},
-	{0x6e,0x00,0x00,0x01,0x00,0x00,0x0b,0x0d},
-	{0x6f,0x00,0x00,0x01,0x00,0x00,0x0b,0x0d},
-	{0x7b,0x00,0x00,0x01,0x00,0x00,0x0b,0x0d},
-	{0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00}  /* TW: added! */
+	{0x6c,0x00,0x00,0x01,0x00,0x00,0x0b,0x0d},
+	{0x6d,0x00,0x00,0x01,0x00,0x00,0x0b,0x0d},
+	{0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00}
 };
-/*end*/
 
 typedef struct _SiS300_CRT1TableStruct
 {
@@ -660,15 +362,32 @@
 
 static const SiS300_CRT1TableStruct  SiS300_CRT1Table[] =
 {
- {{0x2d,0x27,0x28,0x90,0x2c,0x80,0xbf,0x1f,    /* 0x00 */
-  0x9c,0x8e,0x8f,0x96,0xb9,0x30,0x00,0x00,
+#if 1
+ {{0x2d,0x27,0x28,0x90,0x2c,0x80,0xbf,0x1f,    /* 0x00 - 320x200 */
+  0x9c,0x8e,0x8f,0x96,0xb9,0x30,0x00,0x00,     /* HRE [4],[15] is invalid - but correcting it does not work */
+  0x00}},
+#endif
+#if 0
+ {{0x2d,0x27,0x27,0x91,0x2c,0x92,0xbf,0x1f,    /* 0x00 - corrected 320x200-72 - does not work */
+  0x9c,0x8e,0x8f,0x96,0xb9,0x30,0x00,0x04,
+  0x00}},
+#endif
+ {{0x2d,0x27,0x28,0x90,0x2c,0x80,0x0b,0x3e,    /* 0x01 */
+  0xe9,0x8b,0xdf,0xe7,0x04,0x00,0x00,0x00,     /* HRE [4],[15] is invalid - but correcting it does not work */
   0x00}},
- {{0x2d,0x27,0x28,0x90,0x2c,0x80,0x0b,0x3e,
-  0xe9,0x8b,0xdf,0xe7,0x04,0x00,0x00,0x00,
+#if 0
+ {{0x2d,0x27,0x27,0x91,0x2c,0x92,0x0b,0x3e,    /* 0x01 - corrected 320x240-60 - does not work */
+  0xe9,0x8b,0xdf,0xe7,0x04,0x00,0x00,0x04,
   0x00}},
- {{0x3d,0x31,0x31,0x81,0x37,0x1f,0x72,0xf0,
+#endif
+ {{0x3d,0x31,0x31,0x81,0x37,0x1f,0x72,0xf0,    /* 0x02 */
+  0x58,0x8c,0x57,0x57,0x73,0x20,0x00,0x05,
+  0x01}},
+#if 0
+ {{0x3d,0x31,0x31,0x81,0x37,0x1f,0x72,0xf0,    /* 0x02 - corrected 400x300-60 */
   0x58,0x8c,0x57,0x57,0x73,0x20,0x00,0x05,
   0x01}},
+#endif
  {{0x4f,0x3f,0x3f,0x93,0x45,0x0d,0x24,0xf5,
   0x02,0x88,0xff,0xff,0x25,0x10,0x00,0x01,
   0x01}},
@@ -683,7 +402,7 @@
  {{0x5f,0x4f,0x4f,0x83,0x55,0x81,0x0b,0x3e,    /* 0x05 - corrected 640x480-60 */
   0xe9,0x8b,0xdf,0xe8,0x0c,0x00,0x00,0x05,
   0x00}},
- #if 0  
+#if 0
  {{0x63,0x4f,0x50,0x86,0x56,0x9b,0x06,0x3e,    /* 0x06 */
   0xe8,0x8b,0xdf,0xe7,0xff,0x10,0x00,0x01,
   0x00}},
@@ -841,15 +560,10 @@
  {{0xa3,0x7f,0x7f,0x87,0x86,0x97,0x1e,0xf1,  /* 0x33 - 1024x600 */
   0xae,0x85,0x57,0x57,0x1f,0x30,0x00,0x02,
   0x01}},
-#if 0
- {{0xa3,0x7f,0x7f,0x87,0x86,0x97,0x24,0xf5,  /* 0x34 - 1152x768 */
-  0x02,0x88,0xff,0xff,0x25,0x10,0x00,0x02,
-  0x01}},
-#endif
- {{0xa3,0x8f,0x8f,0x97,0x96,0x97,0x24,0xf5,  /* 0x34 - 1152x768 - TW: corrected */
+ {{0xa3,0x8f,0x8f,0x97,0x96,0x97,0x24,0xf5,  /* 0x34 - 1152x768 - corrected */
   0x02,0x88,0xff,0xff,0x25,0x10,0x00,0x02,
   0x01}},
- {{0x7f,0x63,0x63,0x83,0x6c,0x1c,0x72,0xba,  /* 0x35 - NEW 16:9 modes, not in BIOS ------ */
+ {{0x7f,0x63,0x63,0x83,0x6c,0x1c,0x72,0xba,  /* 0x35 */
    0x27,0x8b,0xdf,0xdf,0x73,0x00,0x00,0x06,
    0x01}}, /* 0x35 */
  {{0x7f,0x63,0x63,0x83,0x69,0x13,0x6f,0xba,
@@ -864,7 +578,7 @@
  {{0x9f,0x7f,0x7f,0x83,0x85,0x91,0x1e,0xf1,
    0xad,0x81,0x3f,0x3f,0x1f,0x30,0x00,0x02,
    0x01}}, /* 0x39 */
- {{0xa7,0x7f,0x7f,0x88,0x89,0x95,0x26,0xf1,   	/* TW: 95 was 15 - illegal HBE! */
+ {{0xa7,0x7f,0x7f,0x88,0x89,0x95,0x26,0xf1,  /* 95 was 15 - illegal HBE! */
    0xb1,0x85,0x3f,0x3f,0x27,0x30,0x00,0x02,
    0x01}}, /* 0x3a */
  {{0xce,0x9f,0x9f,0x92,0xa9,0x17,0x28,0xc4,
@@ -875,36 +589,40 @@
    0x01}}, /* 0x3c */
  {{0xd3,0x9f,0x9f,0x97,0xab,0x1f,0x2e,0xd4,
    0x7d,0x81,0xcf,0xcf,0x2f,0x21,0x00,0x07,
-   0x01}}, /* 0x3d */			     /* TW: End of 16:9 modes --------------- */
- {{0xc3,0x8f,0x8f,0x87,0x9b,0x0b,0x82,0xef,  /* TW: New, 1152x864-75 (not in any BIOS)   */
+   0x01}}, /* 0x3d */
+ {{0xc3,0x8f,0x8f,0x87,0x9b,0x0b,0x82,0xef,  /* 1152x864-75 */
    0x60,0x83,0x5f,0x5f,0x83,0x10,0x00,0x07,
    0x01}},  /* 0x3e */
- {{0x86,0x69,0x69,0x8A,0x74,0x06,0x8C,0x15,  /* TW: New, 848x480-38i, not in BIOS */
+ {{0x86,0x69,0x69,0x8A,0x74,0x06,0x8C,0x15,  /* 848x480-38i */
    0x4F,0x83,0xEF,0xEF,0x8D,0x30,0x00,0x02,
    0x00}}, /* 0x3f */
-#if 0
- {{0x81,0x69,0x69,0x85,0x70,0x00,0x0F,0x3E,  /* TW: New, 848x480-60, not in BIOS - incorrect for Philips panel */
-   0xEB,0x8E,0xDF,0xDF,0x10,0x00,0x00,0x02,
-   0x00}}, /* 0x40 */
-#endif
- {{0x83,0x69,0x69,0x87,0x6f,0x1d,0x03,0x3E,  /* TW: New, 848x480-60, not in BIOS */
+ {{0x83,0x69,0x69,0x87,0x6f,0x1d,0x03,0x3E,  /* 848x480-60  */
    0xE5,0x8d,0xDF,0xe4,0x04,0x00,0x00,0x06,
    0x00}}, /* 0x40 */
- {{0x86,0x6A,0x6A,0x8A,0x74,0x06,0x8C,0x15,  /* TW: New, 856x480-38i, not in BIOS */
+ {{0x86,0x6A,0x6A,0x8A,0x74,0x06,0x8C,0x15,  /* 856x480-38i */
    0x4F,0x83,0xEF,0xEF,0x8D,0x30,0x00,0x02,
    0x00}}, /* 0x41 */
- {{0x81,0x6A,0x6A,0x85,0x70,0x00,0x0F,0x3E,  /* TW: New, 856x480-60, not in BIOS */
+ {{0x81,0x6A,0x6A,0x85,0x70,0x00,0x0F,0x3E,  /* 856x480-60  */
    0xEB,0x8E,0xDF,0xDF,0x10,0x00,0x00,0x02,
    0x00}}, /* 0x42 */
- {{0xdd,0xa9,0xa9,0x81,0xb4,0x97,0x26,0xfd,  /* TW: New, 1360x768-60, not in BIOS */
+ {{0xdd,0xa9,0xa9,0x81,0xb4,0x97,0x26,0xfd,  /* 1360x768-60 */
    0x01,0x8d,0xff,0x00,0x27,0x10,0x00,0x03,
    0x01}}, /* 0x43 */
- {{0xd9,0x8f,0x8f,0x9d,0xba,0x0a,0x8a,0xff,  /* TW: New, 1152x864-84 (not in any BIOS)   */
+ {{0xd9,0x8f,0x8f,0x9d,0xba,0x0a,0x8a,0xff,  /* 1152x864-84 */
    0x60,0x8b,0x5f,0x5f,0x8b,0x10,0x00,0x03,
-   0x01}}, /* 0x44 */   
- {{0xd3,0x9f,0x9f,0x97,0xab,0x1f,0xf1,0xff,  /* TW: New, 1280x960-85 (not in any BIOS)   */
+   0x01}}, /* 0x44 */
+ {{0xd3,0x9f,0x9f,0x97,0xab,0x1f,0xf1,0xff,  /* 1280x960-85 */
    0xc0,0x83,0xbf,0xbf,0xf2,0x10,0x00,0x07,
-   0x01}}  /* 0x45 */
+   0x01}}, /* 0x45 */
+ {{0xce,0x9f,0x9f,0x92,0xa9,0x17,0x20,0xf5,  /* 1280x768-60 */
+   0x03,0x88,0xff,0xff,0x21,0x10,0x00,0x07,
+   0x01}},  /* 0x46 */
+ {{0x7b,0x5f,0x63,0x9f,0x6a,0x93,0x6f,0xf0,  /* 768x576 */
+   0x58,0x8a,0x3f,0x57,0x70,0x20,0x00,0x05,
+   0x01}},  /* 0x47 */
+ {{0xce,0xa9,0xa9,0x92,0xb1,0x07,0x28,0x52,  /* 1360x1024 (Barco iQ Pro R300) */
+   0x02,0x8e,0xff,0x00,0x29,0x0d,0x00,0x03,
+   0x00}}   /* 0x48 */
 };
 
 typedef struct _SiS300_MCLKDataStruct
@@ -913,8 +631,8 @@
 	USHORT CLOCK;
 } SiS300_MCLKDataStruct;
 
-static const SiS300_MCLKDataStruct  SiS300_MCLKData_630[] =	/* 630 */
-{ /* TW: at 0x54 in BIOS */
+static const SiS300_MCLKDataStruct  SiS300_MCLKData_630[] =
+{
 	{ 0x5a,0x64,0x80, 66},
 	{ 0xb3,0x45,0x80, 83},
 	{ 0x37,0x61,0x80,100},
@@ -925,8 +643,8 @@
 	{ 0x37,0x61,0x80,100}
 };
 
-static const SiS300_MCLKDataStruct  SiS300_MCLKData_300[] =  /* 300 */
-{ /* TW: at 0x54 in BIOS */
+static const SiS300_MCLKDataStruct  SiS300_MCLKData_300[] =
+{
 	{ 0x68,0x43,0x80,125},
 	{ 0x68,0x43,0x80,125},
 	{ 0x68,0x43,0x80,125},
@@ -937,24 +655,6 @@
 	{ 0x37,0x61,0x80,100}
 };
 
-typedef struct _SiS300_ECLKDataStruct
-{
-	UCHAR SR2E,SR2F,SR30;
-	USHORT CLOCK;
-} SiS300_ECLKDataStruct;
-
-static const SiS300_ECLKDataStruct  SiS300_ECLKData[] =
-{
-	{ 0x54,0x43,0x80,100},
-	{ 0x53,0x43,0x80,100},
-	{ 0x55,0x43,0x80,100},
-	{ 0x52,0x43,0x80,100},
-	{ 0x3f,0x42,0x80,100},
-	{ 0x54,0x43,0x80,100},
-	{ 0x54,0x43,0x80,100},
-	{ 0x54,0x43,0x80,100}
-};
-
 typedef struct _SiS300_VCLKDataStruct
 {
 	UCHAR SR2B,SR2C;
@@ -964,196 +664,93 @@
 static const SiS300_VCLKDataStruct  SiS300_VCLKData[] =
 {
 	{ 0x1b,0xe1, 25}, /* 0x00 */
-	{ 0x4e,0xe4, 28},
+	{ 0x4e,0xe4, 28}, /* 0x01 */
 	{ 0x57,0xe4, 32}, /* 0x02 */
-	{ 0xc3,0xc8, 36},
+	{ 0xc3,0xc8, 36}, /* 0x03 */
 	{ 0x42,0xc3, 40}, /* 0x04 */
-	{ 0x5d,0xc4, 45},
+	{ 0x5d,0xc4, 45}, /* 0x05 */
 	{ 0x52,0x65, 50}, /* 0x06 */
-	{ 0x53,0x65, 50},
+	{ 0x53,0x65, 50}, /* 0x07 */
 	{ 0x6d,0x66, 56}, /* 0x08 */
-	{ 0x5a,0x64, 65},
+	{ 0x5a,0x64, 65}, /* 0x09 */
 	{ 0x46,0x44, 68}, /* 0x0a */
-	{ 0x3e,0x43, 75},
-	{ 0x6d,0x46, 76}, /* 0x0c: 800x600 | LVDS_2(CH), MITAC(CH);  - 730, A901(301B): 0xb1,0x46, 76 */
-	{ 0x41,0x43, 79},
+	{ 0x3e,0x43, 75}, /* 0x0b */
+	{ 0x6d,0x46, 76}, /* 0x0c */  /* 800x600 | LVDS_2(CH), MITAC(CH);  - 730, A901(301B): 0xb1,0x46, 76 */
+	{ 0x41,0x43, 79}, /* 0x0d */
 	{ 0x31,0x42, 79}, /* 0x0e */
-	{ 0x46,0x25, 85},
+	{ 0x46,0x25, 85}, /* 0x0f */
 	{ 0x78,0x29, 87}, /* 0x10 */
-	{ 0x62,0x44, 95},
+	{ 0x62,0x44, 95}, /* 0x11 */
 	{ 0x2b,0x22,105}, /* 0x12 */
-	{ 0x49,0x24,106},
+	{ 0x49,0x24,106}, /* 0x13 */
 	{ 0xc3,0x28,108}, /* 0x14 */
-	{ 0x3c,0x23,109},
+	{ 0x3c,0x23,109}, /* 0x15 */
 	{ 0xf7,0x2c,132}, /* 0x16 */
-	{ 0xd4,0x28,136},
+	{ 0xd4,0x28,136}, /* 0x17 */
 	{ 0x41,0x05,158}, /* 0x18 */
-	{ 0x43,0x05,162},
+	{ 0x43,0x05,162}, /* 0x19 */
 	{ 0xe1,0x0f,175}, /* 0x1a */
 	{ 0xfc,0x12,189}, /* 0x1b */
 	{ 0xde,0x26,194}, /* 0x1c */
-	{ 0x54,0x05,203},
+	{ 0x54,0x05,203}, /* 0x1d */
 	{ 0x3f,0x03,230}, /* 0x1e */
-	{ 0x30,0x02,234},
+	{ 0x30,0x02,234}, /* 0x1f */
 	{ 0x24,0x01,266}, /* 0x20 */
-	{ 0x52,0x2a, 54}, /* 301 TV */
-	{ 0x52,0x6a, 27}, /* 301 TV */
-	{ 0x62,0x24, 70}, /* 301 TV */
-	{ 0x62,0x64, 70}, /* 301 TV */
-	{ 0xa8,0x4c, 30}, /* 301 TV */
-	{ 0x20,0x26, 33}, /* 301 TV */
-	{ 0x31,0xc2, 39},
-	{ 0xbf,0xc8, 35}, /* 0x28 - 856x480 */
-	{ 0x60,0x36, 30}, /* 0x29  CH/UNTSC TEXT | LVDS_2(CH) - 730, A901(301B), Mitac(CH): 0xe0, 0xb6, 30 */
-	{ 0x40,0x4a, 28},
-	{ 0x9f,0x46, 44},
-	{ 0x97,0x2c, 26},
-	{ 0x44,0xe4, 25},
-	{ 0x7e,0x32, 47},
-	{ 0x8a,0x24, 31}, /* 0x2f  CH/PAL TEXT | LVDS_2(CH), Mitac(CH) -  730, A901(301B): 0x57, 0xe4, 31 */
-	{ 0x97,0x2c, 26},
-	{ 0xce,0x3c, 39},
-	{ 0x52,0x4a, 36}, /* 0x32  CH/PAL 800x600 5/6 */
-	{ 0x34,0x61, 95},
-	{ 0x78,0x27,108},
-	{ 0xce,0x25,189}, /* 0x35 */
-	{ 0x45,0x6b, 21}, /* 0x36 */  /* TW: Added from Mitac */
-	{ 0x52,0xe2, 49}, /* 0x37 - added for 16:9 modes (not in any BIOS) */
-	{ 0x2b,0x61, 78}, /* 0x38 - added for 16:9 modes (not in any BIOS) */
-	{ 0x70,0x44,108}, /* 0x39 - added for 16:9 modes (not in any BIOS) */
-	{ 0x54,0x42,135}, /* 0x3a - added for 16:9 modes (not in any BIOS) */
-	{ 0x41,0x22,157}, /* 0x3b - added for 16:9 modes (not in any BIOS) */
-	{ 0x52,0x07,149}, /* 0x3c - added for 1280x960-85 (not in any BIOS)*/
-	{ 0x62,0xc6, 34}, /* 0x3d - added for 848x480-60 (not in any BIOS) */
-	{ 0x30,0x23, 88}, /* 0x3e - added for 1360x768-60 (not in any BIOS)*/
-	{ 0x3f,0x64, 46}, /* 0x3f - added for 640x480-100 (not in any BIOS)*/
-	{ 0x72,0x2a, 76}, /* 0x40 - test for SiS730 */
-	{ 0x15,0x21, 79}, /* 0x41 - test for SiS730 */
-	{ 0xff,0x00,  0}   
-};
-
-#if 0 /* TW: This table is in all BIOSes, but not used */
-static const SiS300_VCLKDataStruct  SiS300_VBVCLKData[] =
-{
-	{ 0x1b,0xe1, 25},
-	{ 0x4e,0xe4, 28},
-	{ 0x57,0xe4, 31},
-	{ 0xc3,0xc8, 36},
-	{ 0x42,0x47, 40},
-	{ 0x5d,0xc4, 44},
-	{ 0x52,0x47, 49},
-	{ 0x53,0x47, 50},
-	{ 0x6d,0x66, 56},
-	{ 0x5a,0x64, 65},
-	{ 0x46,0x44, 67},
-	{ 0x29,0x61, 75},
-	{ 0x6d,0x46, 75},
-	{ 0x41,0x43, 78},
-	{ 0x31,0x42, 79},
-	{ 0x46,0x25, 84},
-	{ 0x78,0x29, 86}, /* 0x10 */
-	{ 0x62,0x44, 94},
-	{ 0x2b,0x22,104},
-	{ 0x49,0x24,105},
-	{ 0x43,0x42,108},
-	{ 0x3c,0x23,109},
-	{ 0xe0,0x46,132},
-	{ 0x70,0x25,135},
-	{ 0x41,0x22,157},
-	{ 0x43,0x22,162},
-	{ 0x30,0x21,175},
-	{ 0xc1,0x24,189},
-	{ 0xde,0x26,194},
-	{ 0x70,0x07,202},
-	{ 0x3f,0x03,229},
-	{ 0x30,0x02,234},  /* 0x1f */
-	{ 0x24,0x01,265},  /* 0x20 */
-	{ 0x52,0x2a, 54},
-	{ 0x52,0x6a, 27},
-	{ 0x62,0x24, 70},
-	{ 0x62,0x64, 70},
-	{ 0xa8,0x4c, 30},
-	{ 0x20,0x26, 33},
-	{ 0x31,0xc2, 39},
-	{ 0x2e,0x48, 25},  /* 0x28 */
-	{ 0x24,0x46, 25},  /* 0x29 */
-	{ 0x26,0x64, 28},
-	{ 0x37,0x64, 40},
-	{ 0xa1,0x42,108},
-	{ 0x37,0x61,100},
-	{ 0x78,0x27,108},
+	{ 0x52,0x2a, 54}, /* 0x21 */  /* 301 TV */
+	{ 0x52,0x6a, 27}, /* 0x22 */  /* 301 TV */
+	{ 0x62,0x24, 70}, /* 0x23 */  /* 301 TV */
+	{ 0x62,0x64, 70}, /* 0x24 */  /* 301 TV */
+	{ 0xa8,0x4c, 30}, /* 0x25 */  /* 301 TV */
+	{ 0x20,0x26, 33}, /* 0x26 */  /* 301 TV */
+	{ 0x31,0xc2, 39}, /* 0x27 */
+	{ 0xbf,0xc8, 35}, /* 0x28 */  /* 856x480 */
+	{ 0x60,0x36, 30}, /* 0x29 */  /* CH/UNTSC TEXT | LVDS_2(CH) - 730, A901(301B), Mitac(CH): 0xe0, 0xb6, 30 */
+	{ 0x40,0x4a, 28}, /* 0x2a */  /* CH-TV */
+	{ 0x9f,0x46, 44}, /* 0x2b */  /* CH-TV */
+	{ 0x97,0x2c, 26}, /* 0x2c */  /* CH-TV */
+	{ 0x44,0xe4, 25}, /* 0x2d */  /* CH-TV */
+	{ 0x7e,0x32, 47}, /* 0x2e */  /* CH-TV */
+	{ 0x8a,0x24, 31}, /* 0x2f */  /* CH/PAL TEXT | LVDS_2(CH), Mitac(CH) -  730, A901(301B): 0x57, 0xe4, 31 */
+	{ 0x97,0x2c, 26}, /* 0x30 */  /* CH-TV */
+	{ 0xce,0x3c, 39}, /* 0x31 */  /* CH-TV */
+	{ 0x52,0x4a, 36}, /* 0x32 */  /* CH/PAL 800x600 5/6 */
+	{ 0x34,0x61, 95}, /* 0x33 */
+	{ 0x78,0x27,108}, /* 0x34 */  /* Replacement for index 0x14 for 630 (?) */
+	{ 0xce,0x25,189}, /* 0x35 */  /* Replacement for index 0x1b for 730 (and 540?) */
+	{ 0x45,0x6b, 21}, /* 0x36 */  /* Chrontel SuperOverscan */
+	{ 0x52,0xe2, 49}, /* 0x37 */  /* 16:9 modes  */
+	{ 0x2b,0x61, 78}, /* 0x38 */  /* 16:9 modes  */
+	{ 0x70,0x44,108}, /* 0x39 */  /* 16:9 modes  */
+	{ 0x54,0x42,135}, /* 0x3a */  /* 16:9 modes  */
+	{ 0x41,0x22,157}, /* 0x3b */  /* 16:9 modes  */
+	{ 0x52,0x07,149}, /* 0x3c */  /* 1280x960-85 */
+	{ 0x62,0xc6, 34}, /* 0x3d */  /* 848x480-60  */
+	{ 0x30,0x23, 88}, /* 0x3e */  /* 1360x768-60 */
+#if 0
+	{ 0x3f,0x64, 46}, /* 0x3f */  /* 640x480-100 */
+#endif
+        { 0x70,0x29, 81}, /* 0x3f */  /* 1280x768-60 */
+	{ 0x72,0x2a, 76}, /* 0x40 */  /* test for SiS730 */
+	{ 0x15,0x21, 79}, /* 0x41 */  /* test for SiS730 */
+	{ 0xa1,0x42,108}, /* 0x42 */  /* 1280x960 LCD */
+	{ 0x37,0x61,100}, /* 0x43 */  /* 1280x960 LCD */
+	{ 0xe3,0x9a,106}, /* 0x44 */  /* 1360x1024 - special for Barco iQ R300 */
+	{ 0xe2,0x46,135}, /* 0x45 */  /* 1280x1024-75, better clock for VGA2 */
 	{ 0xff,0x00,  0}
 };
-#endif
 
 static const UCHAR  SiS300_ScreenOffset[] =
 {
 	0x14,0x19,0x20,0x28,0x32,0x40,0x50,
-        0x64,0x78,0x80,0x2d,0x35,0x48,0x35,  /* 0x35 for 848 and 856 */
-	0x55,0xff			     /* 0x55 for 1360 */	
-};
-
-typedef struct _SiS300_StResInfoStruct
-{
-	USHORT HTotal;
-	USHORT VTotal;
-} SiS300_StResInfoStruct;
-
-static const SiS300_StResInfoStruct  SiS300_StResInfo[] =
-{
-	{ 640,400},
-	{ 640,350},
-	{ 720,400},
-	{ 720,350},
-	{ 640,480}
-};
-
-typedef struct _SiS300_ModeResInfoStruct
-{
-	USHORT HTotal;
-	USHORT VTotal;
-	UCHAR  XChar;
-	UCHAR  YChar;
-} SiS300_ModeResInfoStruct;
-
-static const SiS300_ModeResInfoStruct  SiS300_ModeResInfo[] =
-{
-	{  320, 200, 8, 8},  /* 0x00 */
-	{  320, 240, 8, 8},  /* 0x01 */
-	{  320, 400, 8, 8},  /* 0x02 */
-	{  400, 300, 8, 8},  /* 0x03 */
-	{  512, 384, 8, 8},  /* 0x04 */
-	{  640, 400, 8,16},  /* 0x05 */
-	{  640, 480, 8,16},  /* 0x06 */
-	{  800, 600, 8,16},  /* 0x07 */
-	{ 1024, 768, 8,16},  /* 0x08 */
-	{ 1280,1024, 8,16},  /* 0x09 */
-	{ 1600,1200, 8,16},  /* 0x0a */
-	{ 1920,1440, 8,16},  /* 0x0b */
-	{  720, 480, 8,16},  /* 0x0c */
-	{  720, 576, 8,16},  /* 0x0d */
-	{ 1280, 960, 8,16},  /* 0x0e */
-	{ 1024, 600, 8,16},  /* 0x0f */
-	{ 1152, 768, 8,16},  /* 0x10 */
-	{ 2048,1536, 8,16},  /* 0x11 - TW: Not in BIOS! */
-	{  800, 480, 8,16},  /* 0x12 - TW: New, not in any BIOS */
-	{ 1024, 576, 8,16},  /* 0x13 - TW: New, not in any BIOS */
-	{ 1280, 720, 8,16},  /* 0x14 - TW: New, not in any BIOS */
-	{ 1152, 864, 8,16},  /* 0x15 - TW: New, not in any BIOS */
-	{  848, 480, 8,16},  /* 0x16 - TW: New, not in any BIOS */
-	{  856, 480, 8,16},  /* 0x17 - TW: New, not in any BIOS */
-	{ 1360, 768, 8,16}   /* 0x18 - TW: New, not in any BIOS */
+        0x64,0x78,0x80,0x2d,0x35,0x48,0x35,
+	0x55,0x30,0xff
 };
 
-static const UCHAR SiS300_OutputSelect = 0x40;
-
-static const UCHAR SiS300_SoftSetting  = 0x30;
-
 #ifndef LINUX_XF86
 static UCHAR SiS300_SR07 = 0x10;
 #endif
 
-static const UCHAR  SiS300_SR15[8][4] =
+static const DRAM4Type SiS300_SR15[8] =
 {
 	{0x01,0x09,0xa3,0x00},
 	{0x43,0x43,0x43,0x00},
@@ -1183,24 +780,15 @@
 static const USHORT SiS300_RGBSenseData = 0xd1;
 static const USHORT SiS300_VideoSenseData = 0xb3;
 static const USHORT SiS300_YCSenseData = 0xb9;
-static const USHORT SiS300_RGBSenseData2 = 0x0190;     /*301b*/
+static const USHORT SiS300_RGBSenseData2 = 0x0190;
 static const USHORT SiS300_VideoSenseData2 = 0x0174;
 static const USHORT SiS300_YCSenseData2 = 0x016b;
 
-static const UCHAR SiS300_CR40[5][4];
+static const DRAM4Type SiS300_CR40[5];
 
 static UCHAR SiS300_CR49[2];
 #endif
 
-static const UCHAR SiS300_NTSCPhase[]  = {0x21,0xed,0xba,0x08};  /* TW: Was {0x21,0xed,0x8a,0x08}; */
-static const UCHAR SiS300_PALPhase[]   = {0x2a,0x05,0xe3,0x00};  /* TW: Was {0x2a,0x05,0xd3,0x00};  */
-static const UCHAR SiS300_PALMPhase[]  = {0x21,0xE4,0x2E,0x9B};  /* palmn */
-static const UCHAR SiS300_PALNPhase[]  = {0x21,0xF4,0x3E,0xBA};
-static const UCHAR SiS300_NTSCPhase2[] = {0x21,0xF0,0x7B,0xD6};  /* 301b */
-static const UCHAR SiS300_PALPhase2[]  = {0x2a,0x09,0x86,0xe9};  /* 301b */
-static const UCHAR SiS300_PALMPhase2[] = {0x21,0xE6,0xEF,0xA4}; /* TW: palm 301b*/
-static const UCHAR SiS300_PALNPhase2[] = {0x21,0xF6,0x94,0x46}; /* TW: paln 301b*/
-
 typedef struct _SiS300_PanelDelayTblStruct
 {
 	UCHAR timer[2];
@@ -1208,7 +796,7 @@
 
 static const SiS300_PanelDelayTblStruct  SiS300_PanelDelayTbl[] =
 {
-	{{0x05,0xaa}}, /* TW: From 2.04.5a */
+	{{0x05,0xaa}},
 	{{0x05,0x14}},
 	{{0x05,0x36}},
 	{{0x05,0x14}},
@@ -1226,6 +814,7 @@
 	{{0x05,0x60}}
 };
 
+#if 0
 static const SiS300_PanelDelayTblStruct  SiS300_PanelDelayTblLVDS[] =
 {
 	{{0x05,0xaa}},
@@ -1245,6 +834,11 @@
 	{{0x05,0x14}},  /* Some BIOSes: 05, 40 */
 	{{0x05,0x60}}
 };
+#endif
+
+/**************************************************************/
+/* SIS VIDEO BRIDGE ----------------------------------------- */
+/**************************************************************/
 
 typedef struct _SiS300_LCDDataStruct
 {
@@ -1355,309 +949,87 @@
 	{    1,   1,1688,1066,1688,1066}
 };
 
-static const SiS300_LCDDataStruct  SiS300_LCD1280x960Data[] =
+typedef struct _SiS300_Part2PortTblStruct
 {
-	{    9,   2, 800, 500,1800,1000},
-	{    9,   2, 800, 500,1800,1000},
-	{    4,   1, 900, 500,1800,1000},
-	{    4,   1, 900, 500,1800,1000},
-	{    9,   2, 800, 500,1800,1000},
-	{   30,  11,1056, 625,1800,1000},
-	{    5,   3,1350, 800,1800,1000},
-	{    1,   1,1576,1050,1576,1050},
-	{    1,   1,1800,1000,1800,1000}
-};
-
-static const SiS300_LCDDataStruct  SiS300_ExtLCD1400x1050Data[] =  /* TW: New */
-{
-	{    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,   0}
-};
-
-static const SiS300_LCDDataStruct  SiS300_ExtLCD1600x1200Data[] =  /* TW: New */
-{
-	{    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,   0}
-};
-
-static const SiS300_LCDDataStruct  SiS300_StLCD1400x1050Data[] =  /* TW: New */
-{
-	{    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,   0}
-};
-
-static const SiS300_LCDDataStruct  SiS300_StLCD1600x1200Data[] =  /* TW: New */
-{
-	{    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,   0}
-};
-
-static const SiS300_LCDDataStruct  SiS300_NoScaleData1400x1050[] =  /* TW: New */
-{
-	{    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,   0}
-};
-
-static const SiS300_LCDDataStruct  SiS300_NoScaleData1600x1200[] =  /* TW: New */
-{
-	{    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,   0}
+ 	UCHAR CR[12];
+} SiS300_Part2PortTblStruct;
+
+static const SiS300_Part2PortTblStruct SiS300_CRT2Part2_1024x768_1[] =
+{ /* VESA Timing */
+ {{0x21,0x12,0xbf,0xe4,0xc0,0x21,0x45,0x09,0x00,0xa9,0x09,0x04}},
+ {{0x2c,0x12,0x9a,0xae,0x88,0x21,0x45,0x09,0x00,0xa9,0x09,0x04}},
+ {{0x21,0x12,0xbf,0xe4,0xc0,0x21,0x45,0x09,0x00,0xa9,0x09,0x04}},
+ {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {{0x22,0x13,0xfe,0x25,0xff,0x21,0x45,0x0a,0x00,0xa9,0x0d,0x04}},
+ {{0x22,0x13,0xfe,0x25,0xff,0x21,0x45,0x0a,0x00,0xa9,0x0d,0x04}},
+ {{0x22,0x13,0xfe,0x25,0xff,0x21,0x45,0x0a,0x00,0xa9,0x0d,0x04}}
 };
 
+static const SiS300_Part2PortTblStruct SiS300_CRT2Part2_1280x1024_1[] =
+{	/* TW: Temporary data, invalid */
+ {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}
+};
 
-typedef struct _SiS300_TVDataStruct
-{
-	USHORT RVBHCMAX;
-	USHORT RVBHCFACT;
-	USHORT VGAHT;
-	USHORT VGAVT;
-	USHORT TVHDE;
-	USHORT TVVDE;
-	USHORT RVBHRS;
-	UCHAR FlickerMode;
-	USHORT HALFRVBHRS;
-	UCHAR RY1COE;
-	UCHAR RY2COE;
-	UCHAR RY3COE;
-	UCHAR RY4COE;
-} SiS300_TVDataStruct;
-
-static const SiS300_TVDataStruct  SiS300_StPALData[] =
-{
-	{    1,   1, 864, 525,1270, 400, 100,   0, 760,0xf4,0xff,0x1c,0x22},
-	{    1,   1, 864, 525,1270, 350, 100,   0, 760,0xf4,0xff,0x1c,0x22},
-	{    1,   1, 864, 525,1270, 400,   0,   0, 720,0xf1,0x04,0x1f,0x18},
-	{    1,   1, 864, 525,1270, 350,   0,   0, 720,0xf4,0x0b,0x1c,0x0a},
-	{    1,   1, 864, 525,1270, 480,  50,   0, 760,0xf4,0xff,0x1c,0x22},
-	{    1,   1, 864, 525,1270, 600,  50,   0,   0,0xf4,0xff,0x1c,0x22}
-};
-
-static const SiS300_TVDataStruct  SiS300_ExtPALData[] =
-{
-	{   27,  10, 848, 448,1270, 530,  50,   0,  50,0xf4,0xff,0x1c,0x22},
-	{  108,  35, 848, 398,1270, 530,  50,   0,  50,0xf4,0xff,0x1c,0x22},
-	{   12,   5, 954, 448,1270, 530,  50,   0,  50,0xf1,0x04,0x1f,0x18},
-	{    9,   4, 960, 463,1644, 438,  50,   0,  50,0xf4,0x0b,0x1c,0x0a},
-	{    9,   4, 848, 528,1270, 530,   0,   0,  50,0xf5,0xfb,0x1b,0x2a},
-	{   36,  25,1060, 648,1316, 530, 438,   0, 438,0xeb,0x05,0x25,0x16},
-	{    3,   2,1080, 619,1270, 540, 438,   0, 438,0xf3,0x00,0x1d,0x20},
-	{    1,   1,1170, 821,1270, 520, 686,   0, 686,0xF3,0x00,0x1D,0x20}
+static const SiS300_Part2PortTblStruct SiS300_CRT2Part2_1400x1050_1[] =
+{	/* TW: Temporary data, invalid */
+ {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}
+};
 
+static const SiS300_Part2PortTblStruct SiS300_CRT2Part2_1600x1200_1[] =
+{	/* TW: Temporary data, invalid */
+ {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}
 };
 
-static const SiS300_TVDataStruct  SiS300_StNTSCData[] =
-{
-	{    1,   1, 858, 525,1270, 400,  50,   0, 760,0xf1,0x04,0x1f,0x18},
-	{    1,   1, 858, 525,1270, 350,  50,   0, 640,0xf1,0x04,0x1f,0x18},
-	{    1,   1, 858, 525,1270, 400,   0,   0, 720,0xf1,0x04,0x1f,0x18},
-	{    1,   1, 858, 525,1270, 350,   0,   0, 720,0xf4,0x0b,0x1c,0x0a},
-	{    1,   1, 858, 525,1270, 480,   0,   0, 760,0xf1,0x04,0x1f,0x18}
-};
-
-static const SiS300_TVDataStruct  SiS300_ExtNTSCData[] =
-{
-	{  143,  65, 858, 443,1270, 440, 171,   0, 171,0xf1,0x04,0x1f,0x18},
-	{   88,  35, 858, 393,1270, 440, 171,   0, 171,0xf1,0x04,0x1f,0x18},
-	{  143,  70, 924, 443,1270, 440,  92,   0,  92,0xf1,0x04,0x1f,0x18},
-	{  143,  70, 924, 393,1270, 440,  92,   0,  92,0xf4,0x0b,0x1c,0x0a},
-	{  143,  76, 836, 523,1270, 440, 224,   0,   0,0xf1,0x05,0x1f,0x16},
-	{  143, 120,1056, 643,1270, 440,   0, 128,   0,0xf4,0x10,0x1c,0x00},
-	{  143,  76, 836, 523,1270, 440,   0, 128,   0,0xee,0x0c,0x22,0x08},
-	{   65,  64,1056, 791,1270, 480, 638,   0,   0,0xf1,0x04,0x1f,0x18}
+static const SiS300_Part2PortTblStruct SiS300_CRT2Part2_1024x768_2[] =
+{  /* Non-VESA */
+ {{0x28,0x12,0xa3,0xd0,0xaa,0x5a,0x45,0x0a,0x07,0xfa,0x0a,0x24}},
+ {{0x2c,0x12,0x9a,0xae,0x88,0x5a,0x45,0x0a,0x07,0xfa,0x0a,0x24}},
+ {{0x28,0x12,0xa3,0xd0,0xaa,0x5a,0x45,0x0a,0x07,0xfa,0x0a,0x24}},
+ {{0x2c,0x12,0x9a,0xae,0x88,0x5a,0x45,0x0a,0x07,0xfa,0x0a,0x24}},
+ {{0x28,0x13,0xe7,0x0b,0xe8,0x5a,0x45,0x0a,0x07,0xfa,0x0a,0x24}},
+ {{0x38,0x18,0x16,0x00,0x00,0x5a,0x45,0x0a,0x07,0xfa,0x0a,0x24}},
+ {{0x36,0x13,0x13,0x25,0xff,0x5a,0x45,0x0a,0x07,0xfa,0x0a,0x24}}
 };
 
-#if 0
-static const SiS300_TVDataStruct  SiS300_St1HiTVData[]=
+static const SiS300_Part2PortTblStruct SiS300_CRT2Part2_1280x1024_2[] =
 {
-  
+ {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}
 };
-#endif
 
-static const SiS300_TVDataStruct  SiS300_St2HiTVData[]=
+static const SiS300_Part2PortTblStruct SiS300_CRT2Part2_1400x1050_2[] =
 {
- {    3,   1, 0x348,0x1e3,0x670,0x3c0,0x032,  0, 0, 0x00,0x00,0x00,0x00},
- {    1,   1, 0x37c,0x233,0x2b2,0x2bc, 	  0,  0, 0, 0x00,0x00,0x00,0x00},
- {    3,   1, 0x348,0x1e3,0x670,0x3c0,0x032,  0, 0, 0x00,0x00,0x00,0x00},
- {    1,   1, 0x3e8,0x233,0x311,0x2bc,    0,  0, 0, 0x00,0x00,0x00,0x00},
- {    5,   2, 0x348,0x233,0x670,0x3c0,0x08d,128, 0, 0x00,0x00,0x00,0x00},
- {    8,   5, 0x41a,0x2ab,0x670,0x3c0,0x17c,128, 0, 0x00,0x00,0x00,0x00}
-};
-
-static const SiS300_TVDataStruct  SiS300_ExtHiTVData[]=
-{
- {    6,   1, 0x348,0x233,0x660,0x3c0,    0,  0, 0, 0x00,0x00,0x00,0x00},
- {    3,   1, 0x3c0,0x233,0x660,0x3c0,    0,  0, 0, 0x00,0x00,0x00,0x00},
- {    3,   1, 0x348,0x1e3,0x660,0x3c0,    0,  0, 0, 0x00,0x00,0x00,0x00},
- {    3,   1, 0x3c0,0x233,0x660,0x3c0,    0,  0, 0, 0x00,0x00,0x00,0x00},
- {    5,   1, 0x348,0x233,0x670,0x3c0,0x166,128, 0, 0x00,0x00,0x00,0x00},
- {   16,   5, 0x41a,0x2ab,0x670,0x3c0,0x143,128, 0, 0x00,0x00,0x00,0x00},
- {   25,  12, 0x4ec,0x353,0x670,0x3c0,0x032,  0, 0, 0x00,0x00,0x00,0x00},
- {    5,   4, 0x627,0x464,0x670,0x3c0,0x128,  0, 0, 0x00,0x00,0x00,0x00},
- {    4,   1, 0x41a,0x233,0x670,0x3c0,0x143,128, 0, 0x00,0x00,0x00,0x00},
- {    5,   2, 0x578,0x293,0x670,0x3c0,0x032,  0, 0, 0x00,0x00,0x00,0x00},
- {    8,   5, 0x6d6,0x323,0x670,0x3c0,0x128,  0, 0, 0x00,0x00,0x00,0x00}
-};
-
-static const UCHAR SiS300_NTSCTiming[] =
-{
-	0x17,0x1d,0x03,0x09,0x05,0x06,0x0c,0x0c,
-	0x94,0x49,0x01,0x0a,0x06,0x0d,0x04,0x0a,
-	0x06,0x14,0x0d,0x04,0x0a,0x00,0x85,0x1b,
-	0x0c,0x50,0x00,0x97,0x00,0xda,0x4a,0x17,  /* (in 2.06.50) */
-/*	0x0c,0x50,0x00,0x99,0x00,0xec,0x4a,0x17,     (in 2.04.5a) */
-	0x7d,0x05,0x4b,0x00,0x00,0xe2,0x00,0x02,  /* (in 2.06.50) */
-/*	0x88,0x00,0x4b,0x00,0x00,0xe2,0x00,0x02,     (in 2.04.5a) */
-	0x03,0x0a,0x65,0x9d,0x08,0x92,0x8f,0x40,
-	0x60,0x80,0x14,0x90,0x8c,0x60,0x14,0x50,
-	0x00,0x40,0x44,0x00,0xdb,0x02,0x3b,0x00
-};
-
-static const UCHAR SiS300_PALTiming[] =
-{
-	0x19,0x52,0x35,0x6e,0x04,0x38,0x3d,0x70,
-	0x94,0x49,0x01,0x12,0x06,0x3e,0x35,0x6d,
-	0x06,0x14,0x3e,0x35,0x6d,0x00,0x45,0x2b,
-        0x70,0x50,0x00,0x9b,0x00,0xd9,0x5d,0x17,  /* (in 2.06.50) */
-/*	0x70,0x50,0x00,0x97,0x00,0xd7,0x5d,0x17,     (in 2.04.5a) */
-	0x7d,0x05,0x45,0x00,0x00,0xe8,0x00,0x02,  /* (in 2.06.50) */
-/*	0x88,0x00,0x45,0x00,0x00,0xe8,0x00,0x02,     (in 2.04.5a) */
-	0x0d,0x00,0x68,0xb0,0x0b,0x92,0x8f,0x40,
-	0x60,0x80,0x14,0x90,0x8c,0x60,0x14,0x63,
-	0x00,0x40,0x3e,0x00,0xe1,0x02,0x28,0x00
-};
-
-static const UCHAR SiS300_HiTVExtTiming[] =	 /* TW: New */
-{
-        0x32,0x65,0x2c,0x5f,0x08,0x31,0x3a,0x64,
-	0x28,0x02,0x01,0x3d,0x06,0x3e,0x35,0x6d,
-	0x06,0x14,0x3e,0x35,0x6d,0x00,0xc5,0x3f,
-	0x64,0x90,0x33,0x8c,0x18,0x36,0x3e,0x13,
-	0x2a,0xde,0x2a,0x44,0x40,0x2a,0x44,0x40,
-	0x8e,0x8e,0x82,0x07,0x0b,0x92,0x0f,0x40,
-	0x60,0x80,0x14,0x90,0x8c,0x60,0x14,0x3d,
-	0x63,0x4f,0x27,0x00,0xfc,0xff,0x6a,0x00
-};
-
-static const UCHAR SiS300_HiTVSt1Timing[] =   	/* TW: New */
-{
-        0x32,0x65,0x2c,0x5f,0x08,0x31,0x3a,0x65,
-	0x28,0x02,0x01,0x3d,0x06,0x3e,0x35,0x6d,
-	0x06,0x14,0x3e,0x35,0x6d,0x00,0xc5,0x3f,
-	0x65,0x90,0x7b,0xa8,0x03,0xf0,0x87,0x03,
-	0x11,0x15,0x11,0xcf,0x10,0x11,0xcf,0x10,
-	0x35,0x35,0x3b,0x69,0x1d,0x92,0x0f,0x40,
-	0x60,0x80,0x14,0x90,0x8c,0x60,0x04,0x86,
-	0xaf,0x5d,0x0e,0x00,0xfc,0xff,0x2d,0x00
-};
-
-static const UCHAR SiS300_HiTVSt2Timing[] =	/* TW: New */
-{
-        0x32,0x65,0x2c,0x5f,0x08,0x31,0x3a,0x64,
-	0x28,0x02,0x01,0x3d,0x06,0x3e,0x35,0x6d,
-	0x06,0x14,0x3e,0x35,0x6d,0x00,0xc5,0x3f,
-	0x64,0x90,0x33,0x8c,0x18,0x36,0x3e,0x13,
-	0x2a,0xde,0x2a,0x44,0x40,0x2a,0x44,0x40,
-	0x8e,0x8e,0x82,0x07,0x0b,0x92,0x0f,0x40,
-	0x60,0x80,0x14,0x90,0x8c,0x60,0x14,0x3d,
-	0x63,0x4f,0x27,0x00,0xfc,0xff,0x6a,0x00
-};
-
-static const UCHAR SiS300_HiTVTextTiming[] =   	/* TW: New */
-{
-        0x32,0x65,0x2c,0x5f,0x08,0x31,0x3a,0x65,
-	0x28,0x02,0x01,0x3d,0x06,0x3e,0x35,0x6d,
-	0x06,0x14,0x3e,0x35,0x6d,0x00,0xc5,0x3f,
-	0x65,0x90,0xe7,0xbc,0x03,0x0c,0x97,0x03,
-	0x14,0x78,0x14,0x08,0x20,0x14,0x08,0x20,
-	0xc8,0xc8,0x3b,0xd2,0x26,0x92,0x0f,0x40,
-        0x60,0x80,0x14,0x90,0x8c,0x60,0x04,0x96,
-	0x72,0x5c,0x11,0x00,0xfc,0xff,0x32,0x00
-};
-
-static const UCHAR SiS300_HiTVGroup3Data[] =   	/* TW: New */
-{
-        0x00,0x1a,0x22,0x63,0x62,0x22,0x08,0x5f,
-	0x05,0x21,0xb2,0xb2,0x55,0x77,0x2a,0xa6,
-	0x25,0x2f,0x47,0xfa,0xc8,0xff,0x8e,0x20,
-	0x8c,0x6e,0x60,0x2e,0x58,0x48,0x72,0x44,
-	0x56,0x36,0x4f,0x6e,0x3f,0x80,0x00,0x80,
-	0x4f,0x7f,0x03,0xa8,0x7d,0x20,0x1a,0xa9,
-	0x14,0x05,0x03,0x7e,0x64,0x31,0x14,0x75,
-	0x18,0x05,0x18,0x05,0x4c,0xa8,0x01
-};
-
-static const UCHAR SiS300_HiTVGroup3Simu[] =   	/* TW: New */
-{
-        0x00,0x1a,0x22,0x63,0x62,0x22,0x08,0x95,
-	0xdb,0x20,0xb8,0xb8,0x55,0x47,0x2a,0xa6,
-	0x25,0x2f,0x47,0xfa,0xc8,0xff,0x8e,0x20,
-	0x8c,0x6e,0x60,0x15,0x26,0xd3,0xe4,0x11,
-	0x56,0x36,0x4f,0x6e,0x3f,0x80,0x00,0x80,
-	0x67,0x36,0x01,0x47,0x0e,0x10,0xbe,0xb4,
-	0x01,0x05,0x03,0x7e,0x65,0x31,0x14,0x75,
-	0x18,0x05,0x18,0x05,0x4c,0xa8,0x01
-};
-
-static const UCHAR SiS300_HiTVGroup3Text[] =   	/* TW: New */
-{
-        0x00,0x1a,0x22,0x63,0x62,0x22,0x08,0xa7,
-	0xf5,0x20,0xce,0xce,0x55,0x47,0x2a,0xa6,
-	0x25,0x2f,0x47,0xfa,0xc8,0xff,0x8e,0x20,
-	0x8c,0x6e,0x60,0x18,0x2c,0x0c,0x20,0x22,
-	0x56,0x36,0x4f,0x6e,0x3f,0x80,0x00,0x80,
-	0x93,0x3c,0x01,0x50,0x2f,0x10,0xf4,0xca,
-	0x01,0x05,0x03,0x7e,0x65,0x31,0x14,0x75,
-	0x18,0x05,0x18,0x05,0x4c,0xa8,0x01
+ {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}
+};
+
+static const SiS300_Part2PortTblStruct SiS300_CRT2Part2_1600x1200_2[] =
+{	/* TW: Temporary data, invalid */
+ {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}
+};
+
+static const SiS300_Part2PortTblStruct SiS300_CRT2Part2_1024x768_3[] =
+{	/* TW: Temporary data, invalid */
+ {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}
+};
+
+static const SiS300_Part2PortTblStruct SiS300_CRT2Part2_1280x1024_3[] =
+{	/* TW: Temporary data, invalid */
+  {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}
+};
+
+static const SiS300_Part2PortTblStruct SiS300_CRT2Part2_1400x1050_3[] =
+{	/* TW: Temporary data, invalid */
+  {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}
+};
+
+static const SiS300_Part2PortTblStruct SiS300_CRT2Part2_1600x1200_3[] =
+{	/* TW: Temporary data, invalid */
+  {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}
 };
 
+/**************************************************************/
+/* LVDS/Chrontel -------------------------------------------- */
+/**************************************************************/
+
 typedef struct _SiS300_LVDSDataStruct
 {
 	USHORT VGAHT;
@@ -1666,366 +1038,14 @@
 	USHORT LCDVT;
 } SiS300_LVDSDataStruct;
 
-static const SiS300_LVDSDataStruct  SiS300_LVDS320x480Data_1[] =
-{
-	{848, 433,400, 525},
-	{848, 389,400, 525},
-	{848, 433,400, 525},
-	{848, 389,400, 525},
-	{848, 518,400, 525},
-	{1056,628,400, 525},
-	{400, 525,400, 525},
-	{800, 449,1000, 644},
-	{800, 525,1000, 635}
-};
-
-static const SiS300_LVDSDataStruct  SiS300_LVDS800x600Data_1[] =
-{
-	{848, 433,1060, 629},
-	{848, 389,1060, 629},
-	{848, 433,1060, 629},
-	{848, 389,1060, 629},
-	{848, 518,1060, 629},
-	{1056, 628,1056, 628},
-	{1056, 628,1056, 628},
-	{800, 449,1000, 644},
-	{800, 525,1000, 635}
-};
-
-static const SiS300_LVDSDataStruct  SiS300_LVDS800x600Data_2[] =
-{
-	{1056, 628,1056, 628},
-	{1056, 628,1056, 628},
-	{1056, 628,1056, 628},
-	{1056, 628,1056, 628},
-	{1056, 628,1056, 628},
-	{1056, 628,1056, 628},
-	{1056, 628,1056, 628},
-	{800, 449,1000, 644},
-	{800, 525,1000, 635}
-};
-
-static const SiS300_LVDSDataStruct  SiS300_LVDS1024x768Data_1[] =
-{
-	{840, 438,1344, 806},
-	{840, 409,1344, 806},
-	{840, 438,1344, 806},
-	{840, 409,1344, 806},
-	{840, 518,1344, 806},
-	{1050, 638,1344, 806},
-	{1344, 806,1344, 806},
-	{800, 449,1280, 801},
-	{800, 525,1280, 813}
-};
-
-static const SiS300_LVDSDataStruct  SiS300_LVDS1024x768Data_2[] =
-{
-	{1344, 806,1344, 806},
-	{1344, 806,1344, 806},
-	{1344, 806,1344, 806},
-	{1344, 806,1344, 806},
-	{1344, 806,1344, 806},
-	{1344, 806,1344, 806},
-	{1344, 806,1344, 806},
-	{800, 449,1280, 801},
-	{800, 525,1280, 813}
-};
-
-static const SiS300_LVDSDataStruct  SiS300_LVDS1280x1024Data_1[]=  
-{	
-	{1048, 442,1688,1066},
-	{1048, 392,1688,1066},
-	{1048, 442,1688,1066},
-	{1048, 392,1688,1066},
-	{1048, 522,1688,1066},
-	{1208, 642,1688,1066},
-	{1432, 810,1688,1066},
-	{1688,1066,1688,1066}
-};
-
-static const SiS300_LVDSDataStruct  SiS300_LVDS1280x1024Data_2[]=  
-{	
-	{1688,1066,1688,1066},
-	{1688,1066,1688,1066},
-	{1688,1066,1688,1066},
-	{1688,1066,1688,1066},
-	{1688,1066,1688,1066},
-	{1688,1066,1688,1066},
-	{1688,1066,1688,1066},
-	{1688,1066,1688,1066}
-};
-
-static const SiS300_LVDSDataStruct  SiS300_LVDS1400x1050Data_1[] =   
-{
-        {928, 416, 1688, 1066},
-	{928, 366, 1688, 1066},
-	{928, 416, 1688, 1066},
-	{928, 366, 1688, 1066},
-	{928, 496, 1688, 1066},
-	{1088, 616, 1688, 1066},
-	{1312, 784, 1688, 1066},
-	{1568, 1040, 1688, 1066},
-	{1688, 1066, 1688, 1066}
-};
-
-static const SiS300_LVDSDataStruct  SiS300_LVDS1400x1050Data_2[] =  
-{
-        {1688,1066, 1688,1066},
-	{1688,1066, 1688,1066},
-	{1688,1066, 1688,1066},
-	{1688,1066, 1688,1066},
-	{1688,1066, 1688,1066},
-	{1688,1066, 1688,1066},
-	{1688,1066, 1688,1066},
-	{1688,1066, 1688,1066},
-	{1688,1066, 1688,1066},
-};
-
-static const SiS300_LVDSDataStruct  SiS300_LVDS1600x1200Data_1[]=  
-{
-        {1088, 450, 2048,1250},
-	{1088, 400, 2048,1250},
-	{1088, 450, 2048,1250},
-	{1088, 400, 2048,1250},
-	{1088, 530, 2048,1250},
-	{1248, 650, 2048,1250},
-	{1472, 818, 2048,1250},
-	{1728,1066, 2048,1250},
-	{1848,1066, 2048,1250},
-	{2048,1250, 2048,1250}
-};
-
-static const SiS300_LVDSDataStruct  SiS300_LVDS1600x1200Data_2[]= 
-{
-        {2048,1250, 2048,1250},
-	{2048,1250, 2048,1250},
-	{2048,1250, 2048,1250},
-	{2048,1250, 2048,1250},
-	{2048,1250, 2048,1250},
-	{2048,1250, 2048,1250},
-	{2048,1250, 2048,1250},
-	{2048,1250, 2048,1250},
-	{2048,1250, 2048,1250},
-	{2048,1250, 2048,1250}
-};
-
-static const SiS300_LVDSDataStruct  SiS300_LVDS1280x768Data_1[]= 
-{	
-	{ 768, 438, 1408, 806},
-	{ 768, 388, 1408, 806},
-	{ 768, 438, 1408, 806},
-	{ 768, 388, 1408, 806},
-	{ 768, 518, 1408, 806},
-	{ 928, 638, 1408, 806},
-	{1152, 806, 1408, 806},
-	{1408, 806, 1408, 806},
-	{1408, 806, 1408, 806}
-};
-
-static const SiS300_LVDSDataStruct  SiS300_LVDS1280x768Data_2[]=  
-{	
-	{1408, 806, 1408, 806},
-	{1408, 806, 1408, 806},
-	{1408, 806, 1408, 806},
-	{1408, 806, 1408, 806},
-	{1408, 806, 1408, 806},
-	{1408, 806, 1408, 806},
-	{1408, 806, 1408, 806},
-	{1408, 806, 1408, 806},
-	{1408, 806, 1408, 806}
-};
-
-static const SiS300_LVDSDataStruct  SiS300_LVDS1024x600Data_1[] =
-{
-	{840, 604,1344, 800},
-	{840, 560,1344, 800},
-	{840, 604,1344, 800},
-	{840, 560,1344, 800},
-	{840, 689,1344, 800},
-	{1050, 800,1344, 800},
-	{1344, 800,1344, 800},
-	{800, 449,1280, 789},
-	{800, 525,1280, 785}
-};
-
-static const SiS300_LVDSDataStruct  SiS300_LVDS1024x600Data_2[] =
-{
-	{1344, 800,1344, 800},
-	{1344, 800,1344, 800},
-	{1344, 800,1344, 800},
-	{1344, 800,1344, 800},
-	{1344, 800,1344, 800},
-	{1344, 800,1344, 800},
-	{1344, 800,1344, 800},
-	{800, 449,1280, 801},
-	{800, 525,1280, 813}
-};
-
-static const SiS300_LVDSDataStruct  SiS300_LVDS1152x768Data_1[] =
-{
-	{840, 438,1344, 806},
-	{840, 409,1344, 806},
-	{840, 438,1344, 806},
-	{840, 409,1344, 806},
-	{840, 518,1344, 806},
-	{1050, 638,1344, 806},
-	{1344, 806,1344, 806},
-	{800, 449,1280, 801},
-	{800, 525,1280, 813}
-};
-
-static const SiS300_LVDSDataStruct  SiS300_LVDS1152x768Data_2[] =
-{
-	{1344, 806,1344, 806},
-	{1344, 806,1344, 806},
-	{1344, 806,1344, 806},
-	{1344, 806,1344, 806},
-	{1344, 806,1344, 806},
-	{1344, 806,1344, 806},
-	{1344, 806,1344, 806},
-	{800, 449,1280, 801},
-	{800, 525,1280, 813}
-};
-
-/* TW: pass 1:1 data */
-static const SiS300_LVDSDataStruct  SiS300_LVDSXXXxXXXData_1[]=  
-{
-        { 800, 449,  800, 449},
-	{ 800, 449,  800, 449},
-	{ 900, 449,  900, 449},
-	{ 900, 449,  900, 449},
-	{ 800, 525,  800, 525},  /*  640x480   */
-	{1056, 628, 1056, 628},  /*  800x600   */
-	{1344, 806, 1344, 806},  /* 1024x768   */
-	{1344,1066, 1344,1066},  /* 1280x1024  */  /* INSERTED ! */
- 	{1688, 806, 1688, 806},  /* 1280x768 ! */
-	/* No other panels ! */
-};
-
-static const SiS300_LVDSDataStruct  SiS300_LVDS640x480Data_1[] =
-{
-	{800, 449, 800, 449},
-	{800, 449, 800, 449},
-	{800, 449, 800, 449},
-	{800, 449, 800, 449},
-	{800, 525, 800, 525},
-	{1056, 628,1056, 628},
-	{1056, 628,1056, 628},
-	{1056, 628,1056, 628},
-	{1056, 628,1056, 628}
-};
-
-static const SiS300_LVDSDataStruct  SiS300_LVDS1280x960Data_1[] =   /* TW: New */
-{
-	{840, 438,1344, 806},
-	{840, 409,1344, 806},
-	{840, 438,1344, 806},
-	{840, 409,1344, 806},
-	{840, 518,1344, 806},
-	{1050, 638,1344, 806},
-	{1344, 806,1344, 806},
-	{800, 449,1280, 801},
-	{800, 525,1280, 813}
-};
-
-static const SiS300_LVDSDataStruct  SiS300_LVDS1280x960Data_2[] =   /* TW: New */
-{
-	{1344, 806,1344, 806},
-	{1344, 806,1344, 806},
-	{1344, 806,1344, 806},
-	{1344, 806,1344, 806},
-	{1344, 806,1344, 806},
-	{1344, 806,1344, 806},
-	{1344, 806,1344, 806},
-	{800, 449,1280, 801},
-	{800, 525,1280, 813}
-};
-
-static const SiS300_LVDSDataStruct  SiS300_LCDA1400x1050Data_1[] =   /* TW: New */
-{	/* TW: Might be temporary (invalid) data */
-        {928, 416, 1688, 1066},
-	{928, 366, 1688, 1066},
-	{1008, 416, 1688, 1066},
-	{1008, 366, 1688, 1066},
-	{1200, 530, 1688, 1066},
-	{1088, 616, 1688, 1066},
-	{1312, 784, 1688, 1066},
-	{1568, 1040, 1688, 1066},
-	{1688, 1066, 1688, 1066}
-};
-
-static const SiS300_LVDSDataStruct  SiS300_LCDA1400x1050Data_2[] =   /* TW: New */
-{	/* TW: Temporary data. Not valid */
-	{1344, 806,1344, 806},
-	{1344, 806,1344, 806},
-	{1344, 806,1344, 806},
-	{1344, 806,1344, 806},
-	{1344, 806,1344, 806},
-	{1344, 806,1344, 806},
-	{1344, 806,1344, 806},
-	{800, 449,1280, 801},
-	{800, 525,1280, 813}
-};
-
-static const SiS300_LVDSDataStruct  SiS300_LCDA1600x1200Data_1[] =   /* TW: New */
-{	/* TW: Temporary data. Not valid */
-	{1344, 806,1344, 806},
-	{1344, 806,1344, 806},
-	{1344, 806,1344, 806},
-	{1344, 806,1344, 806},
-	{1344, 806,1344, 806},
-	{1344, 806,1344, 806},
-	{1344, 806,1344, 806},
-	{800, 449,1280, 801},
-	{800, 525,1280, 813}
-};
-
-static const SiS300_LVDSDataStruct  SiS300_LCDA1600x1200Data_2[] =   /* TW: New */
-{	/* TW: Temporary data. Not valid */
-	{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}
-};
-
-
-/* TW: New: */
-static const SiS300_LVDSDataStruct  SiS300_CHTVUNTSCData[] =
-{
-	{840, 600, 840, 600},
-	{840, 600, 840, 600},
-	{840, 600, 840, 600},
-	{840, 600, 840, 600},
-	{784, 600, 784, 600},
-	{1064, 750,1064, 750}
-};
-
-static const SiS300_LVDSDataStruct  SiS300_CHTVONTSCData[] =
-{
-	{840, 525, 840, 525},
-	{840, 525, 840, 525},
-	{840, 525, 840, 525},
-	{840, 525, 840, 525},
-	{784, 525, 784, 525},
-	{1040, 700,1040, 700}
-};
-
 static const SiS300_LVDSDataStruct  SiS300_CHTVUPALData[] =
 {
 	{1008, 625,1008, 625},
 	{1008, 625,1008, 625},
 	{1008, 625,1008, 625},
 	{1008, 625,1008, 625},
-	{840, 750, 840, 750},
-	{936, 836, 936, 836}
+	{ 840, 750, 840, 750},
+	{ 936, 836, 936, 836}
 };
 
 static const SiS300_LVDSDataStruct  SiS300_CHTVOPALData[] =
@@ -2034,8 +1054,8 @@
 	{1008, 625,1008, 625},
 	{1008, 625,1008, 625},
 	{1008, 625,1008, 625},
-	{840, 625, 840, 625},
-	{960, 750, 960, 750}
+	{ 840, 625, 840, 625},
+	{ 960, 750, 960, 750}
 };
 
 static const SiS300_LVDSDataStruct  SiS300_CHTVSOPALData[] =
@@ -2044,12 +1064,10 @@
 	{1008, 625,1008, 625},
 	{1008, 625,1008, 625},
 	{1008, 625,1008, 625},
-	{840, 500, 840, 500},
-	{944, 625, 944, 625}
+	{ 840, 500, 840, 500},
+	{ 944, 625, 944, 625}
 };
 
-/* TW: new end */
-
 typedef struct _SiS300_LVDSDesStruct
 {
 	USHORT LCDHDES;
@@ -2058,57 +1076,90 @@
 
 static const SiS300_LVDSDesStruct  SiS300_PanelType00_1[] =
 {
+	{ 1059, 626 },   /* 2.08 */
+	{ 1059, 624 },
+	{ 1059, 626 },
+	{ 1059, 624 },
+	{ 1059, 624 },
+	{    0, 627 },
+	{    0, 627 },
+	{    0,   0 },
+	{    0,   0 }
+#if 0
 	{0, 626},
 	{0, 624},
 	{0, 626},
 	{0, 624},
 	{0, 624},
-	{ 0, 627},
-	{ 0, 627},
-	{ 0,   0},
-	{ 0,   0}
+	{0, 627},
+	{0, 627},
+	{0,   0},
+	{0,   0}
+#endif
 };
 
 static const SiS300_LVDSDesStruct  SiS300_PanelType01_1[] =
 {
+	{   0,   0 },  /* 2.08 */
+	{   0,   0 },
+	{   0,   0 },
+	{   0,   0 },
+	{   0,   0 },
+	{   0,   0 },
+	{   0,   0 },
+	{   0,   0 },
+	{   0,   0 }
+#if 0
 	{1343, 798},
 	{1343, 794},
 	{1343, 798},
 	{1343, 794},
 	{1343,   0},
 	{1343,   0},
-	{ 0, 805},
-	{ 0, 794},
-	{ 0,   0}
+	{   0, 805},
+	{   0, 794},
+	{   0,   0}
+#endif
 };
 
 static const SiS300_LVDSDesStruct  SiS300_PanelType02_1[] =
 {
+	{ 1059, 626 },  /* 2.08 */
+	{ 1059, 624 },
+	{ 1059, 626 },
+	{ 1059, 624 },
+	{ 1059, 624 },
+	{    0, 627 },
+	{    0, 627 },
+	{    0,   0 },
+	{    0,   0 }
+#if 0
 	{0, 626},
 	{0, 624},
 	{0, 626},
 	{0, 624},
 	{0, 624},
-	{ 0, 627},
-	{ 0, 627},
-	{ 0,   0},
-	{ 0,   0}
+	{0, 627},
+	{0, 627},
+	{0,   0},
+	{0,   0}
+#endif
 };
 
 static const SiS300_LVDSDesStruct  SiS300_PanelType03_1[] =
 {
-	{ 8, 436},
-	{ 8, 440},
-	{ 8, 436},
-	{ 8, 440},
-	{ 8, 512},
+	{   8, 436},
+	{   8, 440},
+	{   8, 436},
+	{   8, 440},
+	{   8, 512},
 	{1343, 798},
 	{1343, 794},
 	{1343, 798},
 	{1343, 794}
 };
 
-static const SiS300_LVDSDesStruct  SiS300_PanelType04_1[] =
+static const SiS300_LVDSDesStruct  SiS300_PanelType04_1[] =	/* 1280x1024 */
 {
 	{1343, 798},
 	{1343, 794},
@@ -2116,9 +1167,9 @@
 	{1343, 794},
 	{1343,   0},
 	{1343,   0},
-	{ 0, 805},
-	{ 0, 794},
-	{ 0,   0}
+	{   0, 805},
+	{   0, 794},
+	{   0,   0}
 };
 
 static const SiS300_LVDSDesStruct  SiS300_PanelType05_1[] =
@@ -2129,9 +1180,9 @@
 	{1343, 794},
 	{1343,   0},
 	{1343,   0},
-	{ 0, 805},
-	{ 0, 794},
-	{ 0,   0}
+	{   0, 805},
+	{   0, 794},
+	{   0,   0}
 };
 
 static const SiS300_LVDSDesStruct  SiS300_PanelType06_1[] =
@@ -2142,9 +1193,9 @@
 	{1343, 794},
 	{1343,   0},
 	{1343,   0},
-	{ 0, 805},
-	{ 0, 794},
-	{ 0,   0}
+	{   0, 805},
+	{   0, 794},
+	{   0,   0}
 };
 
 static const SiS300_LVDSDesStruct  SiS300_PanelType07_1[] =
@@ -2155,9 +1206,9 @@
 	{1343, 794},
 	{1343,   0},
 	{1343,   0},
-	{ 0, 805},
-	{ 0, 794},
-	{ 0,   0}
+	{   0, 805},
+	{   0, 794},
+	{   0,   0}
 };
 
 static const SiS300_LVDSDesStruct  SiS300_PanelType08_1[] =
@@ -2167,10 +1218,10 @@
 	{1059, 626},
 	{1059, 624},
 	{1059, 624},
-	{ 0, 627},
-	{ 0, 627},
-	{ 0,   0},
-	{ 0,   0}
+	{   0, 627},
+	{   0, 627},
+	{   0,   0},
+	{   0,   0}
 };
 
 static const SiS300_LVDSDesStruct  SiS300_PanelType09_1[] =
@@ -2181,9 +1232,9 @@
 	{1343, 794},
 	{1343,   0},
 	{1343,   0},
-	{ 0, 805},
-	{ 0, 794},
-	{ 0,   0}
+	{   0, 805},
+	{   0, 794},
+	{   0,   0}
 };
 
 static const SiS300_LVDSDesStruct  SiS300_PanelType0a_1[] =
@@ -2193,23 +1244,23 @@
 	{1059, 626},
 	{1059, 624},
 	{1059, 624},
-	{ 0, 627},
-	{ 0, 627},
-	{ 0,   0},
-	{ 0,   0}
+	{   0, 627},
+	{   0, 627},
+	{   0,   0},
+	{   0,   0}
 };
 
 static const SiS300_LVDSDesStruct  SiS300_PanelType0b_1[] =
 {
-	{1343, 0},
-	{1343, 0},
-	{1343, 0},
-	{1343, 0},
-	{1343, 0},   /* 640x480 - BIOS 1343, 0 */
-	{1343, 0},
-	{ 0, 799},
-	{ 0, 0},
-	{ 0, 0}
+	{1343,   0},
+	{1343,   0},
+	{1343,   0},
+	{1343,   0},
+	{1343,   0},
+	{1343,   0},
+	{   0, 799},
+	{   0,   0},
+	{   0,   0}
 };
 
 static const SiS300_LVDSDesStruct  SiS300_PanelType0c_1[] =
@@ -2220,9 +1271,9 @@
 	{1343, 794},
 	{1343,   0},
 	{1343,   0},
-	{ 0, 805},
-	{ 0, 794},
-	{ 0,   0}
+	{   0, 805},
+	{   0, 794},
+	{   0,   0}
 };
 
 static const SiS300_LVDSDesStruct  SiS300_PanelType0d_1[] =
@@ -2233,9 +1284,9 @@
 	{1343, 794},
 	{1343,   0},
 	{1343,   0},
-	{ 0, 805},
-	{ 0, 794},
-	{ 0,   0}
+	{   0, 805},
+	{   0, 794},
+	{   0,   0}
 };
 
 static const SiS300_LVDSDesStruct  SiS300_PanelType0e_1[] =
@@ -2244,11 +1295,11 @@
 	{1343, 794},
 	{1343, 798},
 	{1343, 794},
-	{1343,   0},  /* 640x480 */
-	{1343,   0},  /* 800x600 */
-	{ 0, 805},    /* 1024x768 */
-	{ 0, 794},    /* 1280x1024 */
-	{ 0,   0}     /* 1280x960 - not applicable */
+	{1343,   0},    /* 640x480 */
+	{1343,   0},    /* 800x600 */
+	{   0, 805},    /* 1024x768 */
+	{   0, 794},    /* 1280x1024 */
+	{   0,   0}     /* 1280x960 - not applicable */
 };
 
 static const SiS300_LVDSDesStruct  SiS300_PanelType0f_1[] =
@@ -2259,9 +1310,9 @@
 	{1343, 794},
 	{1343,   0},
 	{1343,   0},
-	{ 0, 805},
-	{ 0, 794},
-	{ 0,   0}
+	{   0, 805},
+	{   0, 794},
+	{   0,   0}
 };
 
 static const SiS300_LVDSDesStruct  SiS300_PanelType00_2[] =
@@ -2271,10 +1322,10 @@
 	{976, 527},
 	{976, 502},
 	{976, 567},
-	{ 0, 627},
-	{ 0, 627},
-	{ 0,   0},
-	{ 0,   0}
+	{  0, 627},
+	{  0, 627},
+	{  0,   0},
+	{  0,   0}
 };
 
 static const SiS300_LVDSDesStruct  SiS300_PanelType01_2[] =
@@ -2285,9 +1336,9 @@
 	{1152, 597},
 	{1152, 662},
 	{1232, 722},
-	{ 0, 805},
-	{ 0, 794},
-	{ 0,   0}
+	{   0, 805},
+	{   0, 794},
+	{   0,   0}
 };
 
 static const SiS300_LVDSDesStruct  SiS300_PanelType02_2[] =
@@ -2297,10 +1348,10 @@
 	{976, 527},
 	{976, 502},
 	{976, 567},
-	{ 0, 627},
-	{ 0, 627},
-	{ 0,   0},
-	{ 0,   0}
+	{  0, 627},
+	{  0, 627},
+	{  0,   0},
+	{  0,   0}
 };
 
 static const SiS300_LVDSDesStruct  SiS300_PanelType03_2[] =
@@ -2472,232 +1523,57 @@
  	{   0,   0}
 };
 
-static const SiS300_LVDSDesStruct  SiS300_PanelTypeNS_1[]= 
-{
-	{ 8,   0},
-	{ 8,   0},
-	{ 8,   0},
-	{ 8,   0},
-	{ 8,   0},
-	{ 0,   0},
-	{ 0,   0},
-	{ 0,   0},
-	{ 0, 806},
-	{ 0, 0 }
-};
-
-static const SiS300_LVDSDesStruct  SiS300_PanelTypeNS_2[] = 
-{
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0}
-};
-
-static const SiS300_LVDSDesStruct SiS300_PanelType1076_1[] =   /* TW: New */
-{
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0}
-};
-
-static const SiS300_LVDSDesStruct SiS300_PanelType1076_2[] =   /* TW: New */
-{
-	{ 1152, 622 },
-	{ 1152, 597 },
-	{ 1152, 622 },
-	{ 1152, 597 },
-	{ 1152, 622 },
-	{ 1232, 722 },
-	{    0, 0   },
-	{    0, 794 },
-	{    0, 0   }
-};
-
-static const SiS300_LVDSDesStruct SiS300_PanelType1210_1[] =   /* TW: New */
-{
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0}
-};
-
-static const SiS300_LVDSDesStruct SiS300_PanelType1210_2[] =   /* TW: New */
-{
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0}
-};
-
-static const SiS300_LVDSDesStruct SiS300_PanelType1296_1[] =   /* TW: New */
-{
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0}
-};
-
-static const SiS300_LVDSDesStruct SiS300_PanelType1296_2[] =   /* TW: New */
-{
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0}
-};
-
-
-/* TW: New */
-static const SiS300_LVDSDesStruct  SiS300_CHTVUNTSCDesData[] =
-{
- 	{ 0,   0},
- 	{ 0,   0},
- 	{ 0,   0},
- 	{ 0,   0},
- 	{ 0,   0},
- 	{ 0,   0}
-};
-
-static const SiS300_LVDSDesStruct  SiS300_CHTVONTSCDesData[] =
-{
- 	{ 0,   0},
- 	{ 0,   0},
- 	{ 0,   0},
- 	{ 0,   0},
- 	{ 0,   0},
- 	{ 0,   0}
-};
-
-static const SiS300_LVDSDesStruct  SiS300_CHTVUPALDesData[] =
-{
- 	{256,   0},
- 	{256,   0},
- 	{256,   0},
- 	{256,   0},
- 	{  0,   0},
- 	{  0,   0}
-};
-
-static const SiS300_LVDSDesStruct  SiS300_CHTVOPALDesData[] =
+/* Custom data for Barco iQ R200/300/400 (BIOS 2.00.07) */
+static const SiS300_LVDSDesStruct  SiS300_PanelType04_1a[] =	/* 1280x1024 (1366x1024) */
 {
- 	{256,   0},
- 	{256,   0},
- 	{256,   0},
- 	{256,   0},
- 	{  0,   0},
- 	{  0,   0}
+	{1330, 798},  /* 320x200 */
+	{1330, 794},
+	{1330, 798},
+	{1330, 794},
+	{1330,   0},  /* 640x480 / 320x240  */
+	{1343,   0},  /* 800x600 / 400x300  */
+	{   0, 805},  /* 1024x768 / 512x384 */
+	{1688,1066},  /* 1280x1024          */
+	{   0,   0}   /* 1360x1024          */
 };
-/* TW: New end */
 
-/* TW: New for SiS300+301LV */
-typedef struct _SiS300_Part2PortTblStruct
+static const SiS300_LVDSDesStruct  SiS300_PanelType04_2a[] =
 {
- 	UCHAR CR[12];
-} SiS300_Part2PortTblStruct;
-
-static const SiS300_Part2PortTblStruct SiS300_CRT2Part2_1024x768_1[] =
-{ /* VESA Timing */
- {{0x21,0x12,0xbf,0xe4,0xc0,0x21,0x45,0x09,0x00,0xa9,0x09,0x04}},
- {{0x2c,0x12,0x9a,0xae,0x88,0x21,0x45,0x09,0x00,0xa9,0x09,0x04}},
- {{0x21,0x12,0xbf,0xe4,0xc0,0x21,0x45,0x09,0x00,0xa9,0x09,0x04}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
- {{0x22,0x13,0xfe,0x25,0xff,0x21,0x45,0x0a,0x00,0xa9,0x0d,0x04}},
- {{0x22,0x13,0xfe,0x25,0xff,0x21,0x45,0x0a,0x00,0xa9,0x0d,0x04}},
- {{0x22,0x13,0xfe,0x25,0xff,0x21,0x45,0x0a,0x00,0xa9,0x0d,0x04}}
-};
-
-static const SiS300_Part2PortTblStruct SiS300_CRT2Part2_1280x1024_1[] =
-{	/* TW: Temporary data, invalid */
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}
-};
-
-static const SiS300_Part2PortTblStruct SiS300_CRT2Part2_1400x1050_1[] =
-{	/* TW: Temporary data, invalid */
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}
-};
-
-static const SiS300_Part2PortTblStruct SiS300_CRT2Part2_1600x1200_1[] =
-{	/* TW: Temporary data, invalid */
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}
-};
-
-static const SiS300_Part2PortTblStruct SiS300_CRT2Part2_1024x768_2[] =
-{  /* Non-VESA */
- {{0x28,0x12,0xa3,0xd0,0xaa,0x5a,0x45,0x0a,0x07,0xfa,0x0a,0x24}},
- {{0x2c,0x12,0x9a,0xae,0x88,0x5a,0x45,0x0a,0x07,0xfa,0x0a,0x24}},
- {{0x28,0x12,0xa3,0xd0,0xaa,0x5a,0x45,0x0a,0x07,0xfa,0x0a,0x24}},
- {{0x2c,0x12,0x9a,0xae,0x88,0x5a,0x45,0x0a,0x07,0xfa,0x0a,0x24}},
- {{0x28,0x13,0xe7,0x0b,0xe8,0x5a,0x45,0x0a,0x07,0xfa,0x0a,0x24}},
- {{0x38,0x18,0x16,0x00,0x00,0x5a,0x45,0x0a,0x07,0xfa,0x0a,0x24}},
- {{0x36,0x13,0x13,0x25,0xff,0x5a,0x45,0x0a,0x07,0xfa,0x0a,0x24}}
+	{1152, 622},
+	{1152, 597},
+	{1152, 622},
+	{1152, 597},
+	{1152, 662},
+	{1232, 722},
+	{   0, 805},
+	{1688,1066},
+	{   0,   0}
 };
 
-static const SiS300_Part2PortTblStruct SiS300_CRT2Part2_1280x1024_2[] =
+/* Custom data for Barco iQ G200/300/400 (BIOS 2.00.07) */
+static const SiS300_LVDSDesStruct  SiS300_PanelType04_1b[] =	/* 1024x768 */
 {
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}
+	{1330, 798},  /* 320x200 */
+	{1330, 794},
+	{1330, 798},
+	{1330, 794},
+	{1330,   0},  /* 640x480 / 320x240  */
+	{1343,   0},  /* 800x600 / 400x300  */
+	{   0, 805}   /* 1024x768 / 512x384 */
 };
 
-static const SiS300_Part2PortTblStruct SiS300_CRT2Part2_1400x1050_2[] =
+static const SiS300_LVDSDesStruct  SiS300_PanelType04_2b[] =
 {
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}
-};
-
-static const SiS300_Part2PortTblStruct SiS300_CRT2Part2_1600x1200_2[] =
-{	/* TW: Temporary data, invalid */
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}
-};
-
-static const SiS300_Part2PortTblStruct SiS300_CRT2Part2_1024x768_3[] =
-{	/* TW: Temporary data, invalid */
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}
-};
-
-static const SiS300_Part2PortTblStruct SiS300_CRT2Part2_1280x1024_3[] =
-{	/* TW: Temporary data, invalid */
-  {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}
-};
-
-static const SiS300_Part2PortTblStruct SiS300_CRT2Part2_1400x1050_3[] =
-{	/* TW: Temporary data, invalid */
-  {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}
+	{1152, 622},
+	{1152, 597},
+	{1152, 622},
+	{1152, 597},
+	{1152, 662},
+	{1232, 722},
+	{   0, 805}
 };
 
-static const SiS300_Part2PortTblStruct SiS300_CRT2Part2_1600x1200_3[] =
-{	/* TW: Temporary data, invalid */
-  {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}
-};
+/* CRT1 CRTC for slave modes */
 
 typedef struct _SiS300_LVDSCRT1DataStruct
 {
@@ -2726,56 +1602,6 @@
 	  0x01 }}
 };
 
-static const SiS300_LVDSCRT1DataStruct  SiS300_LVDSCRT11024x768_1[] =
-{ 
-	{{0x64,0x4f,0x88,0x54,0x9f,0xc4,0x1f,
-	  0x92,0x89,0x8f,0xb5,0x30,0x00,0x01,
-	  0x00}},
-	{{0x64,0x4f,0x88,0x54,0x9f,0x97,0x1f,
-	  0x60,0x87,0x5d,0x83,0x10,0x00,0x01,
-	  0x00}},
-	{{0x64,0x4f,0x88,0x54,0x9f,0xc4,0x1f,
-	  0x92,0x89,0x8f,0xb5,0x30,0x00,0x01,
-	  0x00}},
-	{{0x64,0x4f,0x88,0x54,0x9f,0x97,0x1f,
-	  0x60,0x87,0x5d,0x83,0x10,0x00,0x01,
-	  0x00}},
-	{{0x64,0x4f,0x88,0x54,0x9f,0x04,0x3e,
-	  0xe2,0x89,0xdf,0x05,0x00,0x00,0x01,
-	  0x00}},
-	{{0x7e,0x63,0x82,0x68,0x15,0x7c,0xf0,
-	  0x5a,0x8f,0x57,0x7d,0x20,0x00,0x26,
-	  0x01}},
-	{{0xa3,0x7f,0x87,0x86,0x97,0x24,0xf5,
-	  0x02,0x88,0xff,0x25,0x10,0x00,0x02,
-	  0x01}}
-};
-
-static const SiS300_LVDSCRT1DataStruct  SiS300_LVDSCRT11280x1024_1[] =
-{
-	{{0x63,0x4f,0x87,0x54,0x9f,0xb4,0x1f,
-	  0x92,0x89,0x8f,0xb5,0x30,0x00,0x01,
-	  0x00 }},
-	{{0x63,0x4f,0x87,0x54,0x9f,0x82,0x1f,
-	  0x60,0x87,0x5d,0x83,0x10,0x00,0x01,
-	  0x00 }},
-	{{0x63,0x4f,0x87,0x54,0x9f,0xb4,0x1f,
-	  0x92,0x89,0x8f,0xb5,0x30,0x00,0x01,
-	  0x00 }},
-	{{0x63,0x4f,0x87,0x54,0x9f,0x82,0x1f,
-	  0x60,0x87,0x5d,0x83,0x10,0x00,0x01,
-	  0x00 }},
-	{{0x63,0x4f,0x87,0x54,0x9f,0x04,0x3e,
-	  0xe2,0x89,0xdf,0x05,0x00,0x00,0x01,
-	  0x00 }},
-	{{0x7e,0x63,0x82,0x68,0x15,0x7c,0xf0,
-	  0x5a,0x8f,0x57,0x7d,0x20,0x00,0x26,
-	  0x01 }},
-	{{0xa3,0x7f,0x87,0x86,0x97,0x24,0xf5,
-	  0x02,0x88,0xff,0x25,0x10,0x00,0x02,
-	  0x01 }}
-};
-
 static const SiS300_LVDSCRT1DataStruct  SiS300_LVDSCRT1800x600_1_H[] =
 {
 	{{0x30,0x27,0x94,0x2c,0x92,0xaf,0x1f,
@@ -2798,8 +1624,56 @@
 	  0x01 }}
 };
 
+static const SiS300_LVDSCRT1DataStruct  SiS300_LVDSCRT11024x768_1[] =
+{
+	{{0x64,0x4f,0x88,0x54,0x9f,0xc4,0x1f,
+	  0x92,0x89,0x8f,0xb5,0x30,0x00,0x01,
+	  0x00}},
+	{{0x64,0x4f,0x88,0x54,0x9f,0x97,0x1f,
+	  0x60,0x87,0x5d,0x83,0x10,0x00,0x01,
+	  0x00}},
+	{{0x64,0x4f,0x88,0x54,0x9f,0xc4,0x1f,
+	  0x92,0x89,0x8f,0xb5,0x30,0x00,0x01,
+	  0x00}},
+	{{0x64,0x4f,0x88,0x54,0x9f,0x97,0x1f,
+	  0x60,0x87,0x5d,0x83,0x10,0x00,0x01,
+	  0x00}},
+	{{0x64,0x4f,0x88,0x54,0x9f,0x04,0x3e,
+	  0xe2,0x89,0xdf,0x05,0x00,0x00,0x01,
+	  0x00}},
+	{{0x7e,0x63,0x82,0x68,0x15,0x7c,0xf0,
+	  0x5a,0x8f,0x57,0x7d,0x20,0x00,0x26,
+	  0x01}},
+	{{0xa3,0x7f,0x87,0x86,0x97,0x24,0xf5,
+	  0x02,0x88,0xff,0x25,0x10,0x00,0x02,
+	  0x01}}
+};
+
 static const SiS300_LVDSCRT1DataStruct  SiS300_LVDSCRT11024x768_1_H[] =
 {
+	{{0x2f,0x27,0x93,0x2b,0x90,0xc4,0x1f,
+	  0x92,0x89,0x8f,0xb5,0x30,0x00,0x44,
+	  0x00 }},
+	{{0x2f,0x27,0x93,0x2b,0x90,0x97,0x1f,
+	  0x60,0x87,0x5D,0x83,0x10,0x00,0x44,
+	  0x00}},
+	{{0x2f,0x27,0x93,0x2b,0x90,0xc4,0x1f,
+	  0x92,0x89,0x8f,0xb5,0x30,0x00,0x44,
+	  0x00}},
+	{{0x2f,0x27,0x93,0x2b,0x90,0x97,0x1f,
+	  0x60,0x87,0x5D,0x83,0x10,0x00,0x44,
+	  0x00}},
+	{{0x2f,0x27,0x93,0x2b,0x90,0x04,0x3e,
+	  0xE2,0x89,0xdf,0x05,0x00,0x00,0x44,
+	  0x00}},
+	{{0x3c,0x31,0x80,0x35,0x1c,0x7c,0xf0,
+	  0x5A,0x8F,0x57,0x7D,0x20,0x00,0x55,
+	  0x01}},
+	{{0x4f,0x3F,0x93,0x45,0x0D,0x24,0xf5,
+	  0x02,0x88,0xff,0x25,0x10,0x00,0x01,
+	  0x01 }}
+
+#if 0
 	{{0x37,0x27,0x9B,0x2b,0x94,0xc4,0x1f,
 	  0x92,0x89,0x8f,0xb5,0x30,0x00,0x44,
 	  0x00 }},
@@ -2821,6 +1695,32 @@
 	{{0x4f,0x3F,0x93,0x45,0x0D,0x24,0xf5,
 	  0x02,0x88,0xFf,0x25,0x10,0x00,0x01,
 	  0x01 }}
+#endif
+};
+
+static const SiS300_LVDSCRT1DataStruct  SiS300_LVDSCRT11280x1024_1[] =
+{
+	{{0x63,0x4f,0x87,0x54,0x9f,0xb4,0x1f,
+	  0x92,0x89,0x8f,0xb5,0x30,0x00,0x01,
+	  0x00 }},
+	{{0x63,0x4f,0x87,0x54,0x9f,0x82,0x1f,
+	  0x60,0x87,0x5d,0x83,0x10,0x00,0x01,
+	  0x00 }},
+	{{0x63,0x4f,0x87,0x54,0x9f,0xb4,0x1f,
+	  0x92,0x89,0x8f,0xb5,0x30,0x00,0x01,
+	  0x00 }},
+	{{0x63,0x4f,0x87,0x54,0x9f,0x82,0x1f,
+	  0x60,0x87,0x5d,0x83,0x10,0x00,0x01,
+	  0x00 }},
+	{{0x63,0x4f,0x87,0x54,0x9f,0x04,0x3e,
+	  0xe2,0x89,0xdf,0x05,0x00,0x00,0x01,
+	  0x00 }},
+	{{0x7e,0x63,0x82,0x68,0x15,0x7c,0xf0,
+	  0x5a,0x8f,0x57,0x7d,0x20,0x00,0x26,
+	  0x01 }},
+	{{0xa3,0x7f,0x87,0x86,0x97,0x24,0xf5,
+	  0x02,0x88,0xff,0x25,0x10,0x00,0x02,
+	  0x01 }}
 };
 
 static const SiS300_LVDSCRT1DataStruct  SiS300_LVDSCRT11280x1024_1_H[] =
@@ -2870,32 +1770,29 @@
 	  0x01 }}
 };
 
-static const SiS300_LVDSCRT1DataStruct  SiS300_LVDSCRT11024x768_2[] =
+static const SiS300_LVDSCRT1DataStruct  SiS300_LVDSCRT1800x600_2_H[] =
 {
-	{{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
-	  0x4a,0x80,0x8f,0x25,0x30,0x00,0x06,
+	{{0x3d,0x27,0x81,0x32,0x1a,0x72,0x3e,
+	  0xf4,0x88,0x8f,0x73,0x20,0x00,0x05,
 	  0x00 }},
-	{{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
-	  0x31,0x87,0x5d,0x25,0x30,0x00,0x06,
+	{{0x3d,0x27,0x81,0x32,0x1a,0x72,0x3e,
+	  0xdb,0x8f,0x5d,0x73,0x20,0x00,0x05,
 	  0x00 }},
-	{{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
-	  0x4a,0x80,0x8f,0x25,0x30,0x00,0x06,
+	{{0x3d,0x27,0x81,0x32,0x1a,0x72,0x3e,
+	  0xf4,0x88,0x8f,0x73,0x20,0x00,0x05,
 	  0x00 }},
-	{{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
-	  0x31,0x87,0x5d,0x25,0x30,0x00,0x06,
+	{{0x3d,0x27,0x81,0x3a,0x1a,0x72,0x3e,
+	  0xdb,0x8f,0x5d,0x73,0x20,0x00,0x05,
 	  0x00 }},
-	{{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
-	  0x72,0x88,0xdf,0x25,0x30,0x00,0x06,
+	{{0x3d,0x27,0x81,0x32,0x1a,0x72,0xba,
+	  0x1c,0x80,0xdf,0x73,0x00,0x00,0x05,
 	  0x00 }},
-	{{0xa3,0x63,0x87,0x78,0x89,0x24,0xf1,
-	  0xae,0x84,0x57,0x25,0x30,0x00,0x02,
-	  0x01 }},
-	{{0xa3,0x7f,0x87,0x86,0x97,0x24,0xf5,
-	  0x02,0x88,0xff,0x25,0x10,0x00,0x02,
+	{{0x3d,0x31,0x81,0x37,0x1f,0x72,0xf0,
+	  0x58,0x8c,0x57,0x73,0x20,0x00,0x05,
 	  0x01 }}
 };
 
-static const SiS300_LVDSCRT1DataStruct  SiS300_LVDSCRT11280x1024_2[] =
+static const SiS300_LVDSCRT1DataStruct  SiS300_LVDSCRT11024x768_2[] =
 {
 	{{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
 	  0x4a,0x80,0x8f,0x25,0x30,0x00,0x06,
@@ -2920,28 +1817,6 @@
 	  0x01 }}
 };
 
-static const SiS300_LVDSCRT1DataStruct  SiS300_LVDSCRT1800x600_2_H[] =
-{
-	{{0x3d,0x27,0x81,0x32,0x1a,0x72,0x3e,
-	  0xf4,0x88,0x8f,0x73,0x20,0x00,0x05,
-	  0x00 }},
-	{{0x3d,0x27,0x81,0x32,0x1a,0x72,0x3e,
-	  0xdb,0x8f,0x5d,0x73,0x20,0x00,0x05,
-	  0x00 }},
-	{{0x3d,0x27,0x81,0x32,0x1a,0x72,0x3e,
-	  0xf4,0x88,0x8f,0x73,0x20,0x00,0x05,
-	  0x00 }},
-	{{0x3d,0x27,0x81,0x3a,0x1a,0x72,0x3e,
-	  0xdb,0x8f,0x5d,0x73,0x20,0x00,0x05,
-	  0x00 }},
-	{{0x3d,0x27,0x81,0x32,0x1a,0x72,0xba,
-	  0x1c,0x80,0xdf,0x73,0x00,0x00,0x05,
-	  0x00 }},
-	{{0x3d,0x31,0x81,0x37,0x1f,0x72,0xf0,
-	  0x58,0x8c,0x57,0x73,0x20,0x00,0x05,
-	  0x01 }}
-};
-
 static const SiS300_LVDSCRT1DataStruct  SiS300_LVDSCRT11024x768_2_H[] =
 {
 	{{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb,
@@ -2967,6 +1842,31 @@
 	  0x01 }}
 };
 
+static const SiS300_LVDSCRT1DataStruct  SiS300_LVDSCRT11280x1024_2[] =
+{
+	{{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
+	  0x4a,0x80,0x8f,0x25,0x30,0x00,0x06,
+	  0x00 }},
+	{{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
+	  0x31,0x87,0x5d,0x25,0x30,0x00,0x06,
+	  0x00 }},
+	{{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
+	  0x4a,0x80,0x8f,0x25,0x30,0x00,0x06,
+	  0x00 }},
+	{{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
+	  0x31,0x87,0x5d,0x25,0x30,0x00,0x06,
+	  0x00 }},
+	{{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
+	  0x72,0x88,0xdf,0x25,0x30,0x00,0x06,
+	  0x00 }},
+	{{0xa3,0x63,0x87,0x78,0x89,0x24,0xf1,
+	  0xae,0x84,0x57,0x25,0x30,0x00,0x02,
+	  0x01 }},
+	{{0xa3,0x7f,0x87,0x86,0x97,0x24,0xf5,
+	  0x02,0x88,0xff,0x25,0x10,0x00,0x02,
+	  0x01 }}
+};
+
 static const SiS300_LVDSCRT1DataStruct  SiS300_LVDSCRT11280x1024_2_H[] =
 {
 	{{0x4f,0x27,0x93,0x39,0x81,0x24,0xbb,
@@ -2992,207 +1892,6 @@
 	  0x01}}
 };
 
-static const SiS300_LVDSCRT1DataStruct  SiS300_LVDSCRT11024x600_1[] =
-{
-        {{0x64,0x4f,0x88,0x54,0x9f,0x5a,0x3e,
-	  0xe8,0x8f,0x8f,0x5b,0x00,0x00,0x01,
-	  0x00}},
-        {{0x64,0x4f,0x88,0x54,0x9f,0x2e,0x3e,
-	  0xb9,0x80,0x5d,0x2f,0x00,0x00,0x01,
-	  0x00}},
-        {{0x64,0x4f,0x88,0x54,0x9f,0x5a,0x3e,
-	  0xe8,0x8f,0x8f,0x5b,0x00,0x00,0x01,
-	  0x00}},
-        {{0x64,0x4f,0x88,0x54,0x9f,0x2e,0x3e,
-	  0xb9,0x80,0x5d,0x2f,0x00,0x00,0x01,
-	  0x00}},
-        {{0x64,0x4f,0x88,0x54,0x9f,0xaf,0xba,
-	  0x3b,0x82,0xdf,0xb0,0x00,0x00,0x01,
-	  0x00}},
-        {{0x7e,0x63,0x82,0x68,0x15,0x1e,0xf1,
-	  0xae,0x85,0x57,0x1f,0x30,0x00,0x26,
-	  0x01}},
-        {{0xa3,0x7f,0x87,0x86,0x97,0x1e,0xf1,
-	  0xae,0x85,0x57,0x1f,0x30,0x00,0x02,
-	  0x01}}
-};
-
-static const SiS300_LVDSCRT1DataStruct  SiS300_LVDSCRT11024x600_1_H[] =
-{
-        {{0x2f,0x27,0x93,0x2b,0x90,0xc4,0x1f,
-	  0x92,0x89,0x8f,0xb5,0x30,0x00,0x44,
-	  0x00}},
-        {{0x2f,0x27,0x93,0x2b,0x90,0x97,0x1f,
-	  0x60,0x87,0x5d,0x83,0x10,0x00,0x44,
-          0x00}},
-        {{0x2f,0x27,0x93,0x2b,0x90,0xc4,0x1f,
-	  0x92,0x89,0x8f,0xb5,0x30,0x00,0x44,
-	  0x00}},
-        {{0x2f,0x27,0x93,0x2b,0x90,0x97,0x1f,
-	  0x60,0x87,0x5d,0x83,0x10,0x00,0x44,
-	  0x00}},
-        {{0x2f,0x27,0x93,0x2b,0x90,0x04,0x3e,
-	  0xe2,0x89,0xdf,0x05,0x00,0x00,0x44,
-	  0x00}},
-        {{0x3c,0x31,0x80,0x35,0x1c,0x7c,0xf0,
-	  0x5a,0x8f,0x57,0x7d,0x20,0x00,0x55,
-	  0x01}},
-        {{0x4f,0x3f,0x93,0x45,0x0d,0x24,0xf5,
-	  0x02,0x88,0xff,0x25,0x10,0x00,0x01,
-	  0x01}}
-};
-
-static const SiS300_LVDSCRT1DataStruct  SiS300_LVDSCRT11024x600_2[] =
-{
-        {{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
-	  0x4a,0x80,0x8f,0x25,0x30,0x00,0x06,
-	  0x00}},
-        {{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
-	  0x31,0x87,0x5d,0x25,0x30,0x00,0x06,
-	  0x00}},
-        {{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
-	  0x4a,0x80,0x8f,0x25,0x30,0x00,0x06,
-	  0x00}},
-        {{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
-          0x31,0x87,0x5d,0x25,0x30,0x00,0x06,
-	  0x00}},
-        {{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
-	  0x72,0x88,0xdf,0x25,0x30,0x00,0x06,
-	  0x00}},
-        {{0xa3,0x63,0x87,0x78,0x89,0x24,0xf1,
-	  0xae,0x84,0x57,0x25,0x30,0x00,0x02,
-	  0x01}},
-        {{0xa3,0x7f,0x87,0x86,0x97,0x24,0xf5,
-	  0x02,0x88,0xff,0x25,0x10,0x00,0x02,
-	  0x01}}
-};
-
-static const SiS300_LVDSCRT1DataStruct  SiS300_LVDSCRT11024x600_2_H[] =
-{
-        {{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb,
-	  0x4a,0x80,0x8f,0x25,0x30,0x00,0x01,
-	  0x00}},
-        {{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb,
-	  0x31,0x87,0x5d,0x25,0x30,0x00,0x01,
-	  0x00}},
-        {{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb,
-	  0x4a,0x80,0x8f,0x25,0x30,0x00,0x01,
-	  0x00}},
-        {{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb,
-	  0x31,0x87,0x5d,0x25,0x30,0x00,0x01,
-	  0x00}},
-        {{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb,
-	  0x72,0x88,0xdf,0x25,0x30,0x00,0x01,
-	  0x00}},
-        {{0x4f,0x31,0x93,0x3e,0x06,0x24,0xf1,
-	  0xae,0x84,0x57,0x25,0x30,0x00,0x01,
-	  0x01}},
-        {{0x4f,0x3f,0x93,0x45,0x0d,0x24,0xf5,
-	  0x02,0x88,0xff,0x25,0x10,0x00,0x01,
-	  0x01}}
-};
-
-static const SiS300_LVDSCRT1DataStruct  SiS300_LVDSCRT11152x768_1[] =
-{
-        {{0x64,0x4f,0x88,0x54,0x9f,0xc4,0x1f,
-	  0x92,0x89,0x8f,0xb5,0x30,0x00,0x01,
-	  0x00}},
-        {{0x64,0x4f,0x88,0x54,0x9f,0x97,0x1f,
-	  0x60,0x87,0x5d,0x83,0x10,0x00,0x01,
-	  0x00}},
-        {{0x64,0x4f,0x88,0x54,0x9f,0xc4,0x1f,
-	  0x92,0x89,0x8f,0xb5,0x30,0x00,0x01,
-	  0x00}},
-        {{0x64,0x4f,0x88,0x54,0x9f,0x97,0x1f,
-	  0x60,0x87,0x5d,0x83,0x10,0x00,0x01,
-	  0x00}},
-        {{0x64,0x4f,0x88,0x54,0x9f,0x04,0x3e,
-	  0xe2,0x89,0xdf,0x05,0x00,0x00,0x01,
-	  0x00}},
-        {{0x7e,0x63,0x82,0x68,0x15,0x7c,0xf0,
-	  0x5a,0x8f,0x57,0x7d,0x20,0x00,0x26,
-	  0x01}},
-        {{0xa3,0x7f,0x87,0x86,0x97,0x24,0xf5,
-	  0x02,0x88,0xff,0x25,0x10,0x00,0x02,
-	  0x01}}
-};
-
-static const SiS300_LVDSCRT1DataStruct  SiS300_LVDSCRT11152x768_1_H[] =
-{
-        {{0x2f,0x27,0x93,0x2b,0x90,0xc4,0x1f,
-	  0x92,0x89,0x8f,0xb5,0x30,0x00,0x44,
-	  0x00}},
-        {{0x2f,0x27,0x93,0x2b,0x90,0x97,0x1f,
-	  0x60,0x87,0x5d,0x83,0x10,0x00,0x44,
-	  0x00}},
-        {{0x2f,0x27,0x93,0x2b,0x90,0xc4,0x1f,
-	  0x92,0x89,0x8f,0xb5,0x30,0x00,0x44,
-	  0x00}},
-        {{0x2f,0x27,0x93,0x2b,0x90,0x97,0x1f,
-	  0x60,0x87,0x5d,0x83,0x10,0x00,0x44,
-	  0x00}},
-        {{0x2f,0x27,0x93,0x2b,0x90,0x04,0x3e,
-	  0xe2,0x89,0xdf,0x05,0x00,0x00,0x44,
-	  0x00}},
-        {{0x3c,0x31,0x80,0x35,0x1c,0x7c,0xf0,
-	  0x5a,0x8f,0x57,0x7d,0x20,0x00,0x55,
-	  0x01}},
-        {{0x4f,0x3f,0x93,0x45,0x0d,0x24,0xf5,
-	  0x02,0x88,0xff,0x25,0x10,0x00,0x01,
-	  0x01}}
-};
-
-static const SiS300_LVDSCRT1DataStruct  SiS300_LVDSCRT11152x768_2[] =
-{
-        {{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
-	  0x4a,0x80,0x8f,0x25,0x30,0x00,0x06,
-	  0x00}},
-        {{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
-	  0x31,0x87,0x5d,0x25,0x30,0x00,0x06,
-	  0x00}},
-        {{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
-	  0x4a,0x80,0x8f,0x25,0x30,0x00,0x06,
-	  0x00}},
-        {{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
-	  0x31,0x87,0x5d,0x25,0x30,0x00,0x06,
-	  0x00}},
-        {{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
-	  0x72,0x88,0xdf,0x25,0x30,0x00,0x06,
-	  0x00}},
-        {{0xa3,0x63,0x87,0x78,0x89,0x24,0xf1,
-	  0xae,0x84,0x57,0x25,0x30,0x00,0x02,
-	  0x01}},
-        {{0xa3,0x7f,0x87,0x86,0x97,0x24,0xf5,
-	  0x02,0x88,0xff,0x25,0x10,0x00,0x02,
-	  0x01}}
-};
-
-static const SiS300_LVDSCRT1DataStruct  SiS300_LVDSCRT11152x768_2_H[] =
-{
-        {{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb,
-	  0x4a,0x80,0x8f,0x25,0x30,0x00,0x01,
-	  0x00}},
-        {{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb,
-	  0x31,0x87,0x5d,0x25,0x30,0x00,0x01,
-	  0x00}},
-        {{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb,
-	  0x4a,0x80,0x8f,0x25,0x30,0x00,0x01,
-	  0x00}},
-        {{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb,
-	  0x31,0x87,0x5d,0x25,0x30,0x00,0x01,
-	  0x00}},
-        {{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb,
-	  0x72,0x88,0xdf,0x25,0x30,0x00,0x01,
-	  0x00}},
-        {{0x4f,0x31,0x93,0x3e,0x06,0x24,0xf1,
-	  0xae,0x84,0x57,0x25,0x30,0x00,0x01,
-	  0x01}},
-        {{0x4f,0x3f,0x93,0x45,0x0d,0x24,0xf5,
-	  0x02,0x88,0xff,0x25,0x10,0x00,0x01,
-	  0x01}}
-};
-
-/* TW: New */
 static const SiS300_LVDSCRT1DataStruct  SiS300_CHTVCRT1UNTSC[] =
 {
 	{{0x64,0x4f,0x88,0x56,0x9f,0x56,0x3e,
@@ -3302,9 +2001,7 @@
 	  0x90,0x8c,0x57,0xed,0x20,0x00,0x05,
 	  0x01 }}
 };
-/* TW: New end */
 
-/* TW: New */
 typedef struct _SiS300_CHTVRegDataStruct
 {
 	UCHAR Reg[16];
@@ -3354,16 +2051,14 @@
 
 static const SiS300_CHTVRegDataStruct SiS300_CHTVReg_SOPAL[] =
 {
-	{{0x41,0x12,0x01,0x50,0x34,0,0,0,0,0,0,0,0,0,0,0}}, /* Mode 9: 640x400 PAL 5/4 */
+	{{0x41,0x12,0x01,0x50,0x34,0,0,0,0,0,0,0,0,0,0,0}}, /* Mode 9: 640x400 PAL 1/1 */
 	{{0x41,0x12,0x00,0x50,0x00,0,0,0,0,0,0,0,0,0,0,0}},
 	{{0x41,0x12,0x01,0x50,0x34,0,0,0,0,0,0,0,0,0,0,0}},
 	{{0x41,0x12,0x00,0x50,0x00,0,0,0,0,0,0,0,0,0,0,0}},
 	{{0x60,0x30,0x00,0x10,0x00,0,0,0,0,0,0,0,0,0,0,0}}, /* TW: Mode 13: 640x480 PAL 5/4 */
 	{{0x81,0x50,0x00,0x1b,0x00,0,0,0,0,0,0,0,0,0,0,0}}  /* TW: Mode 19: 800x600 PAL 1/1 */
 };
-/* TW: New end */
 
-/* TW: New */
 static const UCHAR SiS300_CHTVVCLKUNTSC[]  = {0x29,0x29,0x29,0x29,0x2a,0x2e};
 
 static const UCHAR SiS300_CHTVVCLKONTSC[]  = {0x2c,0x2c,0x2c,0x2c,0x2d,0x2b};
@@ -3375,6 +2070,5 @@
 static const UCHAR SiS300_CHTVVCLKOPAL[]   = {0x2f,0x2f,0x2f,0x2f,0x30,0x32};
 
 static const UCHAR SiS300_CHTVVCLKSOPAL[]  = {0x2f,0x2f,0x2f,0x2f,0x36,0x29};
-/* TW: New end */
 
 
--- diff/drivers/video/sis/310vtbl.h	2003-10-09 09:47:16.000000000 +0100
+++ source/drivers/video/sis/310vtbl.h	2004-02-09 10:39:55.000000000 +0000
@@ -1,7 +1,56 @@
-
-
-/* Register settings for SiS 310/325/330 series */
-
+/* $XFree86$ */
+/*
+ * Register settings for SiS 315/330 series
+ *
+ * Copyright (C) 2001-2004 by Thomas Winischhofer, Vienna, Austria
+ *
+ * If distributed as part of the Linux kernel, the following license terms
+ * apply:
+ *
+ * * 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 named License,
+ * * or 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
+ *
+ * Otherwise, the following license terms apply:
+ *
+ * * 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) All advertising materials mentioning features or use of this software
+ * *    must display the following acknowledgement: "This product includes
+ * *    software developed by Thomas Winischhofer, Vienna, Austria."
+ * * 4) The name of the author may not be used to endorse or promote products
+ * *    derived from this software without specific prior written permission.
+ * *
+ * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
+ *
+ * Author: 	Thomas Winischhofer <thomas@winischhofer.net>
+ *
+ */
 
 typedef struct _SiS310_StStruct
 {
@@ -13,680 +62,227 @@
 	UCHAR VB_StTVFlickerIndex;
 	UCHAR VB_StTVEdgeIndex;
 	UCHAR VB_StTVYFilterIndex;
+	UCHAR St_PDC;
 } SiS310_StStruct;
 
 static const SiS310_StStruct SiS310_SModeIDTable[]=
 {
-	{0x01,0x9208,0x01,0x00,0x00,0x00,0x01,0x00},
-	{0x01,0x1210,0x14,0x01,0x01,0x00,0x01,0x00},
-	{0x01,0x1010,0x17,0x02,0x02,0x00,0x01,0x01},
-	{0x03,0x8208,0x03,0x00,0x00,0x00,0x01,0x02},
-	{0x03,0x0210,0x16,0x01,0x01,0x00,0x01,0x02},
-	{0x03,0x0010,0x18,0x02,0x02,0x00,0x01,0x03},
-	{0x05,0x9209,0x05,0x00,0x00,0x00,0x00,0x04},
-	{0x06,0x8209,0x06,0x00,0x00,0x00,0x00,0x05},
-	{0x07,0x0000,0x07,0x03,0x03,0x00,0x01,0x03},
-	{0x07,0x0000,0x19,0x02,0x02,0x00,0x01,0x03},
-	{0x0d,0x920a,0x0d,0x00,0x00,0x00,0x00,0x04},
-	{0x0e,0x820a,0x0e,0x00,0x00,0x00,0x00,0x05},
-	{0x0f,0x0202,0x11,0x01,0x01,0x00,0x00,0x05},
-	{0x10,0x0212,0x12,0x01,0x01,0x00,0x00,0x05},
-	{0x11,0x0212,0x1a,0x04,0x04,0x00,0x00,0x05},
-	{0x12,0x0212,0x1b,0x04,0x04,0x00,0x00,0x05},
-	{0x13,0x021b,0x1c,0x00,0x00,0x00,0x00,0x04},
-	{0x12,0x0010,0x18,0x02,0x02,0x00,0x00,0x05},
-	{0x12,0x0210,0x18,0x01,0x01,0x00,0x00,0x05},
-	{0xff,0x0000,0x00,0x00,0x00,0x00,0x00,0x00}
-};
-
-typedef struct _SiS310_StandTableStruct
-{
-	UCHAR CRT_COLS;
-	UCHAR ROWS;
-	UCHAR CHAR_HEIGHT;
-	USHORT CRT_LEN;
-	UCHAR SR[4];
-	UCHAR MISC;
-	UCHAR CRTC[0x19];
-	UCHAR ATTR[0x14];
-	UCHAR GRC[9];
-} SiS310_StandTableStruct;
-
-static const SiS310_StandTableStruct SiS310_StandTable[]=
-{
-/* 0x00: MD_0_200 */
- {
-  0x28,0x18,0x08,0x0800,
-  {0x09,0x03,0x00,0x02},
-  0x63,
-  {0x2d,0x27,0x28,0x90,0x2b,0xa0,0xbf,0x1f,
-   0x00,0xc7,0x06,0x07,0x00,0x00,0x00,0x00,
-   0x9c,0x8e,0x8f,0x14,0x1f,0x96,0xb9,0xa3,
-   0xff},
-  {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
-   0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,
-   0x08,0x00,0x0f,0x00},
-  {0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
-   0xff}
- },
-/* 0x01: MD_1_200 */
- {
-  0x28,0x18,0x08,0x0800,
-  {0x09,0x03,0x00,0x02},
-  0x63,
-  {0x2d,0x27,0x28,0x90,0x2b,0xa0,0xbf,0x1f,
-   0x00,0xc7,0x06,0x07,0x00,0x00,0x00,0x00,
-   0x9c,0x8e,0x8f,0x14,0x1f,0x96,0xb9,0xa3,
-   0xff},
-  {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
-   0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,
-   0x08,0x00,0x0f,0x00},
-  {0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
-   0xff}
- },
-/* 0x02: MD_2_200 */
- {
-  0x50,0x18,0x08,0x1000,
-  {0x01,0x03,0x00,0x02},
-  0x63,
-  {0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f,
-   0x00,0xc7,0x06,0x07,0x00,0x00,0x00,0x00,
-   0x9c,0x8e,0x8f,0x28,0x1f,0x96,0xb9,0xa3,
-   0xff},
-  {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
-   0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,
-   0x08,0x00,0x0f,0x00},
-  {0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
-   0xff}
- },
-/* 0x03: MD_3_200 - mode 0x03 - 0 */
- {
-  0x50,0x18,0x08,0x1000,
-  {0x01,0x03,0x00,0x02},
-  0x63,
-  {0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f,
-   0x00,0xc7,0x06,0x07,0x00,0x00,0x00,0x00,
-   0x9c,0x8e,0x8f,0x28,0x1f,0x96,0xb9,0xa3,
-   0xff},
-  {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
-   0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,
-   0x08,0x00,0x0f,0x00},
-  {0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
-   0xff}
- },
-/* 0x04: MD_4 */
- {
-  0x28,0x18,0x08,0x4000,
-  {0x09,0x03,0x00,0x02},
-  0x63,
-  {0x2d,0x27,0x28,0x90,0x2c,0x80,0xbf,0x1f,
-   0x00,0xc1,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x9c,0x8e,0x8f,0x14,0x00,0x96,0xb9,0xa2,
-   0xff},
-  {0x00,0x13,0x15,0x17,0x02,0x04,0x06,0x07,
-   0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,
-   0x01,0x00,0x03,0x00},
-  {0x00,0x00,0x00,0x00,0x00,0x30,0x0f,0x00,
-   0xff}
- },
-/* 0x05: MD_5 */
- {
-  0x28,0x18,0x08,0x4000,
-  {0x09,0x03,0x00,0x02},
-  0x63,
-  {0x2d,0x27,0x28,0x90,0x2c,0x80,0xbf,0x1f,
-   0x00,0xc1,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x9c,0x8e,0x8f,0x14,0x00,0x96,0xb9,0xa2,
-   0xff},
-  {0x00,0x13,0x15,0x17,0x02,0x04,0x06,0x07,
-   0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,
-   0x01,0x00,0x03,0x00},
-  {0x00,0x00,0x00,0x00,0x00,0x30,0x0f,0x00,
-   0xff}
- },
-/* 0x06: MD_6 */
- {
-  0x50,0x18,0x08,0x4000,
-  {0x01,0x01,0x00,0x06},
-  0x63,
-  {0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f,
-   0x00,0xc1,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x9c,0x8e,0x8f,0x28,0x00,0x96,0xb9,0xc2,
-   0xff},
-  {0x00,0x17,0x17,0x17,0x17,0x17,0x17,0x17,
-   0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,
-   0x01,0x00,0x01,0x00},
-  {0x00,0x00,0x00,0x00,0x00,0x00,0x0d,0x00,
-   0xff}
- },
-/* 0x07: MD_7 */
- {
-  0x50,0x18,0x0e,0x1000,
-  {0x00,0x03,0x00,0x03},
-  0xa6,
-  {0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f,
-   0x00,0x4d,0x0b,0x0c,0x00,0x00,0x00,0x00,
-   0x83,0x85,0x5d,0x28,0x0d,0x63,0xba,0xa3,
-   0xff},
-  {0x00,0x08,0x08,0x08,0x08,0x08,0x08,0x08,
-   0x10,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
-   0x0e,0x00,0x0f,0x08},
-  {0x00,0x00,0x00,0x00,0x00,0x10,0x0a,0x00,
-   0xff}
- },
-/* 0x08: MDA_DAC */
- {
-  0x00,0x00,0x00,0x0000,
-  {0x00,0x00,0x00,0x15},
-  0x15,
-  {0x15,0x15,0x15,0x15,0x15,0x15,0x15,0x15,
-   0x15,0x15,0x15,0x15,0x15,0x15,0x3f,0x3f,
-   0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x00,0x00,
-   0x00},
-  {0x00,0x00,0x00,0x00,0x00,0x15,0x15,0x15,
-   0x15,0x15,0x15,0x15,0x15,0x15,0x15,0x15,
-   0x15,0x15,0x15,0x15},
-  {0x15,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,
-   0x3f}
- },
-/* 0x09: CGA_DAC */
- {
-  0x00,0x10,0x04,0x0114,
-  {0x11,0x09,0x15,0x00},
-  0x10,
-  {0x04,0x14,0x01,0x11,0x09,0x15,0x2a,0x3a,
-   0x2e,0x3e,0x2b,0x3b,0x2f,0x3f,0x2a,0x3a,
-   0x2e,0x3e,0x2b,0x3b,0x2f,0x3f,0x00,0x10,
-   0x04},
-  {0x14,0x01,0x11,0x09,0x15,0x00,0x10,0x04,
-   0x14,0x01,0x11,0x09,0x15,0x2a,0x3a,0x2e,
-   0x3e,0x2b,0x3b,0x2f},
-  {0x3f,0x2a,0x3a,0x2e,0x3e,0x2b,0x3b,0x2f,
-   0x3f}
- },
-/* 0x0a: EGA_DAC */
- {
-  0x00,0x10,0x04,0x0114,
-  {0x11,0x05,0x15,0x20},
-  0x30,
-  {0x24,0x34,0x21,0x31,0x25,0x35,0x08,0x18,
-   0x0c,0x1c,0x09,0x19,0x0d,0x1d,0x28,0x38,
-   0x2c,0x3c,0x29,0x39,0x2d,0x3d,0x02,0x12,
-   0x06},
-  {0x16,0x03,0x13,0x07,0x17,0x22,0x32,0x26,
-   0x36,0x23,0x33,0x27,0x37,0x0a,0x1a,0x0e,
-   0x1e,0x0b,0x1b,0x0f},
-  {0x1f,0x2a,0x3a,0x2e,0x3e,0x2b,0x3b,0x2f,
-   0x3f}
- },
-/* 0x0b: VGA_DAC */
- {
-  0x00,0x10,0x04,0x0114,
-  {0x11,0x09,0x15,0x2a},
-  0x3a,
-  {0x2e,0x3e,0x2b,0x3b,0x2f,0x3f,0x00,0x05,
-   0x08,0x0b,0x0e,0x11,0x14,0x18,0x1c,0x20,
-   0x24,0x28,0x2d,0x32,0x38,0x3f,0x00,0x10,
-   0x1f},
-  {0x2f,0x3f,0x1f,0x27,0x2f,0x37,0x3f,0x2d,
-   0x31,0x36,0x3a,0x3f,0x00,0x07,0x0e,0x15,
-   0x1c,0x0e,0x11,0x15},
-  {0x18,0x1c,0x14,0x16,0x18,0x1a,0x1c,0x00,
-   0x04}
- },
-/* 0x0c */ 
- {
-  0x08,0x0c,0x10,0x0a08,
-  {0x0c,0x0e,0x10,0x0b},
-  0x0c,
-  {0x0d,0x0f,0x10,0x10,0x01,0x08,0x00,0x00,
-   0x00,0x00,0x01,0x00,0x02,0x02,0x01,0x00,
-   0x04,0x04,0x01,0x00,0x05,0x02,0x05,0x00,
-   0x06},
-  {0x01,0x06,0x05,0x06,0x00,0x08,0x01,0x08,
-   0x00,0x07,0x02,0x07,0x06,0x07,0x00,0x00,
-   0x00,0x00,0x00,0x00},
-  {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}
- },
-/* 0x0d: MD_D */
- {
-  0x28,0x18,0x08,0x2000,
-  {0x09,0x0f,0x00,0x06},
-  0x63,
-  {0x2d,0x27,0x28,0x90,0x2c,0x80,0xbf,0x1f,
-   0x00,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x9c,0x8e,0x8f,0x14,0x00,0x96,0xb9,0xe3,
-   0xff},
-  {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
-   0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,
-   0x01,0x00,0x0f,0x00},
-  {0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x0f,
-   0xff}
- },
-/* 0x0e: MD_E */
- {
-  0x50,0x18,0x08,0x4000,
-  {0x01,0x0f,0x00,0x06},
-  0x63,
-  {0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f,
-   0x00,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x9c,0x8e,0x8f,0x28,0x00,0x96,0xb9,0xe3,
-   0xff},
-  {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
-   0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,
-   0x01,0x00,0x0f,0x00},
-  {0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x0f,
-   0xff}
- },
-/* 0x0f: ExtVGATable - modes > 0x13 */
- {
-  0x00,0x00,0x00,0x0000,
-  {0x01,0x0f,0x00,0x0e},
-  0x23,
-  {0x5f,0x4f,0x50,0x82,0x54,0x80,0x0b,0x3e,
-   0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,
-   0xea,0x8c,0xdf,0x28,0x40,0xe7,0x04,0xa3,
-   0xff},
-  {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
-   0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,
-   0x01,0x00,0x00,0x00},
-  {0x00,0x00,0x00,0x00,0x00,0x40,0x05,0x0f,
-   0xff}
- },
-/* 0x10: ROM_SAVEPTR */
- {
-  0x9f,0x3b,0x00,0x00c0,
-  {0x00,0x00,0x00,0x00},
-  0x00,
-  {0x00,0x00,0x00,0x00,0x00,0x00,0xbb,0x3f,
-   0x00,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x1a,0x00,0xac,0x3e,0x00,0xc0,
-   0x00},
-  {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00},
-  {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}
- },
-/* 0x11: MD_F */
- {
-  0x50,0x18,0x0e,0x8000,
-  {0x01,0x0f,0x00,0x06},
-  0xa2,
-  {0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f,
-   0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x82,0x84,0x5d,0x28,0x0f,0x63,0xba,0xe3,
-   0xff},
-  {0x00,0x08,0x00,0x00,0x18,0x18,0x00,0x00,
-   0x00,0x08,0x00,0x00,0x00,0x18,0x00,0x00,
-   0x0b,0x00,0x05,0x00},
-  {0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x05,
-   0xff}
- },
-/* 0x12: MD_10 */
- {
-  0x50,0x18,0x0e,0x8000,
-  {0x01,0x0f,0x00,0x06},
-  0xa3,
-  {0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f,
-   0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x82,0x84,0x5d,0x28,0x0f,0x63,0xba,0xe3,
-   0xff},
-  {0x00,0x01,0x02,0x03,0x04,0x05,0x14,0x07,
-   0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,
-   0x01,0x00,0x0f,0x00},
-  {0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x0f,
-   0xff}
- },
-/* 0x13: MD_0_350 */
- {
-  0x28,0x18,0x0e,0x0800,
-  {0x09,0x03,0x00,0x02},
-  0xa3,
-  {0x2d,0x27,0x28,0x90,0x2b,0xb1,0xbf,0x1f,
-   0x00,0x4d,0x0b,0x0c,0x00,0x00,0x00,0x00,
-   0x83,0x85,0x5d,0x14,0x1f,0x63,0xba,0xa3,
-   0xff},
-  {0x00,0x01,0x02,0x03,0x04,0x05,0x14,0x07,
-   0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,
-   0x08,0x00,0x0f,0x00},
-  {0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
-   0xff}
- },
-/* 0x14: MD_1_350 */
- {
-  0x28,0x18,0x0e,0x0800,
-  {0x09,0x03,0x00,0x02},
-  0xa3,
-  {0x2d,0x27,0x28,0x90,0x2b,0xa0,0xbf,0x1f,
-   0x00,0x4d,0x0b,0x0c,0x00,0x00,0x00,0x00,
-   0x83,0x85,0x5d,0x14,0x1f,0x63,0xba,0xa3,
-   0xff},
-  {0x00,0x01,0x02,0x03,0x04,0x05,0x14,0x07,
-   0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,
-   0x08,0x00,0x0f,0x00},
-  {0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
-   0xff}
- },
-/* 0x15: MD_2_350 */
- {
-  0x50,0x18,0x0e,0x1000,
-  {0x01,0x03,0x00,0x02},
-  0xa3,
-  {0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f,
-   0x00,0x4d,0x0b,0x0c,0x00,0x00,0x00,0x00,
-   0x83,0x85,0x5d,0x28,0x1f,0x63,0xba,0xa3,
-   0xff},
-  {0x00,0x01,0x02,0x03,0x04,0x05,0x14,0x07,
-   0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,
-   0x08,0x00,0x0f,0x00},
-  {0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
-   0xff}
- },
-/* 0x16: MD_3_350 - mode 0x03 - 1 */
- {
-  0x50,0x18,0x0e,0x1000,
-  {0x01,0x03,0x00,0x02},
-  0xa3,
-  {0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f,
-   0x00,0x4d,0x0b,0x0c,0x00,0x00,0x00,0x00,
-   0x83,0x85,0x5d,0x28,0x1f,0x63,0xba,0xa3,
-   0xff},
-  {0x00,0x01,0x02,0x03,0x04,0x05,0x14,0x07,
-   0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,
-   0x08,0x00,0x0f,0x00},
-  {0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
-   0xff}
- },
-/* 0x17: MD_0_1_400 */
- {
-  0x28,0x18,0x10,0x0800,
-  {0x08,0x03,0x00,0x02},
-  0x67,
-  {0x2d,0x27,0x28,0x90,0x2b,0xb1,0xbf,0x1f,
-   0x00,0x4f,0x0d,0x0e,0x00,0x00,0x00,0x00,
-   0x9c,0x8e,0x8f,0x14,0x1f,0x96,0xb9,0xa3,
-   0xff},
-  {0x00,0x01,0x02,0x03,0x04,0x05,0x14,0x07,
-   0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,
-   0x0c,0x00,0x0f,0x08},
-  {0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
-   0xff}
- },
-/* 0x18: MD_2_3_400 - mode 0x03 - 2 */
- {
-  0x50,0x18,0x10,0x1000,
-  {0x00,0x03,0x00,0x02},
-  0x67,
-  {0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f,
-   0x00,0x4f,0x0d,0x0e,0x00,0x00,0x00,0x00,
-   0x9c,0x8e,0x8f,0x28,0x1f,0x96,0xb9,0xa3,
-   0xff},
-  {0x00,0x01,0x02,0x03,0x04,0x05,0x14,0x07,
-   0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,
-   0x0c,0x00,0x0f,0x08},
-  {0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
-   0xff}
- },
-/* 0x19: MD_7_400 */
- {
-  0x50,0x18,0x10,0x1000,
-  {0x00,0x03,0x00,0x02},
-  0x66,
-  {0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f,
-   0x00,0x4f,0x0d,0x0e,0x00,0x00,0x00,0x00,
-   0x9c,0x8e,0x8f,0x28,0x0f,0x96,0xb9,0xa3,
-   0xff},
-  {0x00,0x08,0x08,0x08,0x08,0x08,0x08,0x08,
-   0x10,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
-   0x0e,0x00,0x0f,0x08},
-  {0x00,0x00,0x00,0x00,0x00,0x10,0x0a,0x00,
-   0xff}
- },
-/* 0x1a: MD_11 */
- {
-  0x50,0x1d,0x10,0xa000,
-  {0x01,0x0f,0x00,0x06},
-  0xe3,
-  {0x5f,0x4f,0x50,0x82,0x55,0x81,0x0b,0x3e,
-   0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,
-   0xe9,0x8b,0xdf,0x28,0x00,0xe7,0x04,0xc3,
-   0xff},
-  {0x00,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,
-   0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,
-   0x01,0x00,0x0f,0x00},
-  {0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x01,
-   0xff}
- },
-/* 0x1b: ExtEGATable - Modes <= 0x02 */
- {
-  0x50,0x1d,0x10,0xa000,
-  {0x01,0x0f,0x00,0x06},
-  0xe3,
-  {0x5f,0x4f,0x50,0x82,0x55,0x81,0x0b,0x3e,
-   0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,
-   0xe9,0x8b,0xdf,0x28,0x00,0xe7,0x04,0xe3,
-   0xff},
-  {0x00,0x01,0x02,0x03,0x04,0x05,0x14,0x07,
-   0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,
-   0x01,0x00,0x0f,0x00},
-  {0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x0f,
-   0xff}
- },
-/* 0x1c: MD_13 */
- {
-  0x28,0x18,0x08,0x2000,
-  {0x01,0x0f,0x00,0x0e},
-  0x63,
-  {0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f,
-   0x00,0x41,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x9c,0x8e,0x8f,0x28,0x40,0x96,0xb9,0xa3,
-   0xff},
-  {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
-   0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,
-   0x41,0x00,0x0f,0x00},
-  {0x00,0x00,0x00,0x00,0x00,0x40,0x05,0x0f,
-   0xff}
- }
+	{0x01,0x9208,0x01,0x00,0x00,0x00,0x01,0x00, 0x40},
+	{0x01,0x1210,0x14,0x01,0x01,0x00,0x01,0x00, 0x40},
+	{0x01,0x1010,0x17,0x02,0x02,0x00,0x01,0x01, 0x40},
+	{0x03,0x8208,0x03,0x00,0x00,0x00,0x01,0x02, 0x40},
+	{0x03,0x0210,0x16,0x01,0x01,0x00,0x01,0x02, 0x40},
+	{0x03,0x0010,0x18,0x02,0x02,0x00,0x01,0x03, 0x40},
+	{0x05,0x9209,0x05,0x00,0x00,0x00,0x00,0x04, 0x40},
+	{0x06,0x8209,0x06,0x00,0x00,0x00,0x00,0x05, 0x40},
+	{0x07,0x0000,0x07,0x03,0x03,0x00,0x01,0x03, 0x40},
+	{0x07,0x0000,0x19,0x02,0x02,0x00,0x01,0x03, 0x40},
+	{0x0d,0x920a,0x0d,0x00,0x00,0x00,0x00,0x04, 0x40},
+	{0x0e,0x820a,0x0e,0x00,0x00,0x00,0x00,0x05, 0x40},
+	{0x0f,0x0202,0x11,0x01,0x01,0x00,0x00,0x05, 0x40},
+	{0x10,0x0212,0x12,0x01,0x01,0x00,0x00,0x05, 0x40},
+	{0x11,0x0212,0x1a,0x04,0x04,0x00,0x00,0x05, 0x40},
+	{0x12,0x0212,0x1b,0x04,0x04,0x00,0x00,0x05, 0x40},
+	{0x13,0x021b,0x1c,0x00,0x00,0x00,0x00,0x04, 0x40},
+	{0x12,0x0010,0x18,0x02,0x02,0x00,0x00,0x05, 0x40},
+	{0x12,0x0210,0x18,0x01,0x01,0x00,0x00,0x05, 0x40},
+	{0xff,0x0000,0x00,0x00,0x00,0x00,0x00,0x00, 0x40}
 };
 
 typedef struct _SiS310_ExtStruct
 {
-	UCHAR Ext_ModeID;
+	UCHAR  Ext_ModeID;
 	USHORT Ext_ModeFlag;
-	USHORT Ext_ModeInfo;
-	USHORT Ext_Point;    /* TW: Address of table entry in (older) BIOS image */
+	UCHAR  Ext_ModeOffset;
 	USHORT Ext_VESAID;
-	UCHAR Ext_VESAMEMSize;
-	UCHAR Ext_RESINFO;
-	UCHAR VB_ExtTVFlickerIndex;
-	UCHAR VB_ExtTVEdgeIndex;
-	UCHAR VB_ExtTVYFilterIndex;
-	UCHAR REFindex;
+	UCHAR  Ext_RESINFO;
+	UCHAR  VB_ExtTVFlickerIndex;
+	UCHAR  VB_ExtTVEdgeIndex;
+	UCHAR  VB_ExtTVYFilterIndex;
+	UCHAR  VB_ExtTVYFilterIndexROM661;
+	UCHAR  REFindex;
 } SiS310_ExtStruct;
 
-/* TW: Checked with 650/LVDS and 650/301LVx 1.10.6s */
 static const SiS310_ExtStruct  SiS310_EModeIDTable[]=
 {
-	{0x6a,0x2212,0x0407,0x3a81,0x0102,0x08,0x07,0x00,0x00,0x07,0x00},          /* 800x600x? */
-	{0x2e,0x0a1b,0x0306,0x3a57,0x0101,0x08,0x06,0x00,0x00,0x05,0x08},          /* 640x480x8 */
-/*	{0x2e,0x021b,0x0306,0x3a57,0x0101,0x08,0x06,0x00,0x00,0x05,0x08},    */    /* 640x480x8 - 650/LVDS BIOS (no CRt2Mode) */
-	{0x2f,0x0a1b,0x0305,0x3a50,0x0100,0x08,0x05,0x00,0x00,0x05,0x10},          /* 640x400x8 */
-/*	{0x2f,0x021b,0x0305,0x3a50,0x0100,0x08,0x05,0x00,0x00,0x05,0x10},    */    /* 640x400x8 - 650/LVDS BIOS (no CRt2Mode) */
-	{0x30,0x2a1b,0x0407,0x3a81,0x0103,0x08,0x07,0x00,0x00,0x07,0x00},          /* 800x600x8 */
-/*	{0x30,0x221b,0x0407,0x3a81,0x0103,0x08,0x07,0x00,0x00,0x07,0x00},    */    /* 800x600x8 - 650/LVDS BIOS (no CRt2Mode) */
-/*      {0x31,0x0a1b,0x030d,0x3b85,0x0000,0x08,0x0d,0x00,0x00,0x06,0x11},    */    /* 720x480x8 */
-        {0x31,0x0a1b,0x0a0d,0x3b85,0x0000,0x08,0x0d,0x00,0x00,0x06,0x11},          /* 720x480x8 BIOS (301/LVDS) */
-	{0x32,0x0a1b,0x0a0e,0x3b8c,0x0000,0x08,0x0e,0x00,0x00,0x06,0x12},          /* 720x576x8 */
-	{0x33,0x0a1d,0x0a0d,0x3b85,0x0000,0x08,0x0d,0x00,0x00,0x06,0x11},          /* 720x480x16 */
-	{0x34,0x2a1d,0x0a0e,0x3b8c,0x0000,0x08,0x0e,0x00,0x00,0x06,0x12},          /* 720x576x16 */
-	{0x35,0x0a1f,0x0a0d,0x3b85,0x0000,0x08,0x0d,0x00,0x00,0x06,0x11},          /* 720x480x32 */
-	{0x36,0x2a1f,0x0a0e,0x3b8c,0x0000,0x08,0x0e,0x00,0x00,0x06,0x12},          /* 720x576x32 */
-	{0x37,0x0212,0x0508,0x3aab,0x0104,0x08,0x08,0x00,0x00,0x08,0x13},          /* 1024x768x? */
-	{0x38,0x0a1b,0x0508,0x3aab,0x0105,0x08,0x08,0x00,0x00,0x08,0x13},          /* 1024x768x8 */
-	{0x3a,0x0e3b,0x0609,0x3adc,0x0107,0x08,0x09,0x00,0x00,0x00,0x1a},          /* 1280x1024x8 */
-	{0x3c,0x0e3b,0x070a,0x3af2,0x0130,0x08,0x0a,0x00,0x00,0x00,0x1e},          /* 1600x1200x8 */
-	{0x3d,0x0e7d,0x070a,0x3af2,0x0131,0x08,0x0a,0x00,0x00,0x00,0x1e},          /* 1600x1200x16 - 650/301LVx - no CRT2Mode? */
-	{0x40,0x9a1c,0x0000,0x3a34,0x010d,0x08,0x00,0x00,0x00,0x04,0x25},
-	{0x41,0x9a1d,0x0000,0x3a34,0x010e,0x08,0x00,0x00,0x00,0x04,0x25},
-	{0x43,0x0a1c,0x0306,0x3a57,0x0110,0x08,0x06,0x00,0x00,0x05,0x08},
-	{0x44,0x0a1d,0x0306,0x3a57,0x0111,0x08,0x06,0x00,0x00,0x05,0x08},          /* 640x480x16 */
-	{0x46,0x2a1c,0x0407,0x3a81,0x0113,0x08,0x07,0x00,0x00,0x07,0x00},
-	{0x47,0x2a1d,0x0407,0x3a81,0x0114,0x08,0x07,0x00,0x00,0x07,0x00},          /* 800x600x16 */
-	{0x49,0x0a3c,0x0508,0x3aab,0x0116,0x08,0x08,0x00,0x00,0x00,0x13},
-	{0x4a,0x0a3d,0x0508,0x3aab,0x0117,0x08,0x08,0x00,0x00,0x08,0x13},          /* 1024x768x16 */
-	{0x4c,0x0e7c,0x0609,0x3adc,0x0119,0x08,0x09,0x00,0x00,0x00,0x1a},
-	{0x4d,0x0e7d,0x0609,0x3adc,0x011a,0x08,0x09,0x00,0x00,0x00,0x1a},          /* 1280x1024x16 */
-	{0x50,0x9a1b,0x0001,0x3a3b,0x0132,0x08,0x01,0x00,0x00,0x04,0x26},	   /* 320x240 */
-	{0x51,0xba1b,0x0103,0x3a42,0x0133,0x08,0x03,0x00,0x00,0x07,0x27},
-  	{0x52,0xba1b,0x0204,0x3a49,0x0134,0x08,0x04,0x00,0x00,0x00,0x28},          /* 650/301 BIOS */
-	{0x56,0x9a1d,0x0001,0x3a3b,0x0135,0x08,0x01,0x00,0x00,0x04,0x26},
-	{0x57,0xba1d,0x0103,0x3a42,0x0136,0x08,0x03,0x00,0x00,0x07,0x27},
- 	{0x58,0xba1d,0x0204,0x3a49,0x0137,0x08,0x04,0x00,0x00,0x00,0x28},          /* BIOS (301+LVDS) */
-	{0x59,0x9a1b,0x0000,0x3a34,0x0138,0x08,0x00,0x00,0x00,0x04,0x25},	   /* 320x200 */
-	{0x5A,0x021b,0x0014,0x3b83,0x0138,0x08,0x01,0x00,0x00,0x04,0x3f},          /* 320x480x8 fstn add new mode*/
-	{0x5B,0x0a1d,0x0014,0x3b83,0x0135,0x08,0x01,0x00,0x00,0x04,0x3f},          /* 320x480x16 fstn add new mode*/
-	{0x5c,0xba1f,0x0204,0x3a49,0x0000,0x08,0x04,0x00,0x00,0x00,0x28},          /* TW: inserted 512x384x32 */
-	{0x5d,0x0a1d,0x0305,0x3a50,0x0139,0x08,0x05,0x00,0x00,0x07,0x10},
-	{0x5e,0x0a1f,0x0305,0x3a50,0x0000,0x08,0x05,0x00,0x00,0x07,0x10},          /* TW: Inserted 640x400x32 */
-	{0x62,0x0a3f,0x0306,0x3a57,0x013a,0x08,0x06,0x00,0x00,0x05,0x08},          /* 640x480x32 */
-	{0x63,0x2a3f,0x0407,0x3a81,0x013b,0x08,0x07,0x00,0x00,0x07,0x00},          /* 800x600x32 */
-	{0x64,0x0a7f,0x0508,0x3aab,0x013c,0x08,0x08,0x00,0x00,0x08,0x13},          /* 1024x768x32 */
-	{0x65,0x0eff,0x0609,0x3adc,0x013d,0x08,0x09,0x00,0x00,0x00,0x1a},          /* 1280x1024x32 */
-	{0x66,0x0eff,0x070a,0x3af2,0x013e,0x08,0x0a,0x00,0x00,0x00,0x1e},          /* 1600x1200x32 */
-	{0x68,0x067b,0x080b,0x3b17,0x013f,0x08,0x0b,0x00,0x00,0x00,0x29},          /* 1920x1440x8 */
-	{0x69,0x06fd,0x080b,0x3b17,0x0140,0x08,0x0b,0x00,0x00,0x00,0x29},          /* 1920x1440x16 */
-	{0x6b,0x07ff,0x080b,0x3b17,0x0141,0x10,0x0b,0x00,0x00,0x00,0x29},          /* 1920x1440x32 */
-	{0x6c,0x067b,0x090c,0x3b37,0x0000,0x08,0x0c,0x00,0x00,0x00,0x2f},          /* 2048x1536x8 */
-	{0x6d,0x06fd,0x090c,0x3b37,0x0000,0x10,0x0c,0x00,0x00,0x00,0x2f},          /* 2048x1536x16 */
-	{0x6e,0x07ff,0x090c,0x3b37,0x0000,0x10,0x0c,0x00,0x00,0x00,0x2f},          /* 2048x1536x32 */
-	{0x70,0x2a1b,0x0410,0x3b52,0x0000,0x08,0x10,0x00,0x00,0x07,0x34},          /* 800x480x8 */
-	{0x71,0x0a1b,0x0511,0x3b63,0x0000,0x08,0x11,0x00,0x00,0x00,0x37},          /* 1024x576x8 */
-	{0x74,0x0a1d,0x0511,0x3b63,0x0000,0x08,0x11,0x00,0x00,0x00,0x37},          /* 1024x576x16 */
-	{0x75,0x0a3d,0x0612,0x3b74,0x0000,0x08,0x12,0x00,0x00,0x00,0x3a},	   /* 1280x720x16 */
-	{0x76,0x2a1f,0x0410,0x3b52,0x0000,0x08,0x10,0x00,0x00,0x07,0x34},          /* 800x480x32 */
-	{0x77,0x0a1f,0x0511,0x3b63,0x0000,0x08,0x11,0x00,0x00,0x00,0x37},	   /* 1024x576x32 */
-	{0x78,0x0a3f,0x0612,0x3b74,0x0000,0x08,0x12,0x00,0x00,0x00,0x3a},	   /* 1280x720x32 */
-	{0x79,0x0a3b,0x0612,0x3b74,0x0000,0x08,0x12,0x00,0x00,0x00,0x3a},	   /* 1280x720x8 */
-	{0x7a,0x2a1d,0x0410,0x3b52,0x0000,0x08,0x10,0x00,0x00,0x07,0x34},          /* 800x480x16 */
-	{0x7c,0x0e3b,0x060f,0x3ad0,0x0000,0x08,0x0f,0x00,0x00,0x00,0x3d},          /* 1280x960x8 - TW */
-	{0x7d,0x0e7d,0x060f,0x3ad0,0x0000,0x08,0x0f,0x00,0x00,0x00,0x3d},          /* 1280x960x16 - TW */
-	{0x7e,0x0eff,0x060f,0x3ad0,0x0000,0x08,0x0f,0x00,0x00,0x00,0x3d},          /* 1280x960x32 - TW */
-        /* TW: 650/LVDS BIOS new modes */
-	{0x23,0x0e3b,0x0614,0x36f7,0x0000,0x08,0x14,0x00,0x00,0x00,0x40},          /* 1280x768x8 */
-	{0x24,0x0e7d,0x0614,0x36f7,0x0000,0x08,0x14,0x00,0x00,0x00,0x40},          /* 1280x768x16 */
-	{0x25,0x0eff,0x0614,0x36f7,0x0000,0x08,0x14,0x00,0x00,0x00,0x40},          /* 1280x768x32 */
-	{0x26,0x0e3b,0x0c15,0x36fe,0x0000,0x08,0x15,0x00,0x00,0x00,0x41},          /* 1400x1050x8 */
-	{0x27,0x0e7d,0x0c15,0x36fe,0x0000,0x08,0x15,0x00,0x00,0x00,0x41},          /* 1400x1050x16 */
-	{0x28,0x0eff,0x0c15,0x36fe,0x0000,0x08,0x15,0x00,0x00,0x00,0x41},          /* 1400x1050x32*/
-	{0x29,0x0e1b,0x0d16,0x0000,0x0000,0x08,0x16,0x00,0x00,0x00,0x43},    /* TW: NEW 1152x864 - not in BIOS */
-	{0x2a,0x0e3d,0x0d16,0x0000,0x0000,0x08,0x16,0x00,0x00,0x00,0x43},
-	{0x2b,0x0e7f,0x0d16,0x0000,0x0000,0x08,0x16,0x00,0x00,0x00,0x43},
-	{0x39,0x2a1b,0x0b17,0x0000,0x0000,0x08,0x17,0x00,0x00,0x00,0x45},    /* TW: NEW 848x480 - not in BIOS */
-	{0x3b,0x2a3d,0x0b17,0x0000,0x0000,0x08,0x17,0x00,0x00,0x00,0x45},
-	{0x3e,0x2a7f,0x0b17,0x0000,0x0000,0x08,0x17,0x00,0x00,0x00,0x45},
-	{0x3f,0x2a1b,0x0b13,0x0000,0x0000,0x08,0x13,0x00,0x00,0x00,0x47},    /* TW: NEW 856x480 - not in BIOS */
-	{0x42,0x2a3d,0x0b13,0x0000,0x0000,0x08,0x13,0x00,0x00,0x00,0x47},
-	{0x45,0x2a7f,0x0b13,0x0000,0x0000,0x08,0x13,0x00,0x00,0x00,0x47},
-	{0x48,0x2a1b,0x0e18,0x0000,0x0000,0x08,0x18,0x00,0x00,0x00,0x49},    /* TW: NEW 1360x768 - not in BIOS */
-	{0x4b,0x2a3d,0x0e18,0x0000,0x0000,0x08,0x18,0x00,0x00,0x00,0x49},
-	{0x4e,0x2a7f,0x0e18,0x0000,0x0000,0x08,0x18,0x00,0x00,0x00,0x49},
-	{0xff,0x0000,0x0000,0x0000,0x0000,0x00,0x00,0x00,0x00,0x00,0x00}
+	{0x6a,0x2212,0x04,0x0102,SIS_RI_800x600,  0x00,0x00,0x07,0x06,0x00}, /* 800x600x? */
+	{0x2e,0x0a1b,0x03,0x0101,SIS_RI_640x480,  0x00,0x00,0x05,0x05,0x08}, /* 640x480x8 */
+        {0x2f,0x0a1b,0x03,0x0100,SIS_RI_640x400,  0x00,0x00,0x05,0x05,0x10}, /* 640x400x8 */
+	{0x30,0x2a1b,0x04,0x0103,SIS_RI_800x600,  0x00,0x00,0x07,0x06,0x00}, /* 800x600x8 */
+        {0x31,0x0a1b,0x0a,0x0000,SIS_RI_720x480,  0x00,0x00,0x06,0x06,0x11}, /* 720x480x8 */
+	{0x32,0x0a1b,0x0a,0x0000,SIS_RI_720x576,  0x00,0x00,0x06,0x06,0x12}, /* 720x576x8 */
+	{0x33,0x0a1d,0x0a,0x0000,SIS_RI_720x480,  0x00,0x00,0x06,0x06,0x11}, /* 720x480x16 */
+	{0x34,0x2a1d,0x0a,0x0000,SIS_RI_720x576,  0x00,0x00,0x06,0x06,0x12}, /* 720x576x16 */
+	{0x35,0x0a1f,0x0a,0x0000,SIS_RI_720x480,  0x00,0x00,0x06,0x06,0x11}, /* 720x480x32 */
+	{0x36,0x2a1f,0x0a,0x0000,SIS_RI_720x576,  0x00,0x00,0x06,0x06,0x12}, /* 720x576x32 */
+	{0x37,0x0212,0x05,0x0104,SIS_RI_1024x768, 0x00,0x00,0x08,0x07,0x13}, /* 1024x768x? */
+	{0x38,0x0a1b,0x05,0x0105,SIS_RI_1024x768, 0x00,0x00,0x08,0x07,0x13}, /* 1024x768x8 */
+	{0x3a,0x0e3b,0x06,0x0107,SIS_RI_1280x1024,0x00,0x00,0x00,0x00,0x1a}, /* 1280x1024x8 */
+	{0x3c,0x0e3b,0x07,0x0130,SIS_RI_1600x1200,0x00,0x00,0x00,0x00,0x1e}, /* 1600x1200x8 */
+	{0x3d,0x0e7d,0x07,0x0131,SIS_RI_1600x1200,0x00,0x00,0x00,0x00,0x1e}, /* 1600x1200x16 */
+	{0x40,0x9a1c,0x00,0x010d,SIS_RI_320x200,  0x00,0x00,0x04,0x04,0x25}, /* 320x200x15 */
+	{0x41,0x9a1d,0x00,0x010e,SIS_RI_320x200,  0x00,0x00,0x04,0x04,0x25}, /* 320x200x16 */
+	{0x43,0x0a1c,0x03,0x0110,SIS_RI_640x480,  0x00,0x00,0x05,0x05,0x08},
+	{0x44,0x0a1d,0x03,0x0111,SIS_RI_640x480,  0x00,0x00,0x05,0x05,0x08}, /* 640x480x16 */
+	{0x46,0x2a1c,0x04,0x0113,SIS_RI_800x600,  0x00,0x00,0x07,0x06,0x00},
+	{0x47,0x2a1d,0x04,0x0114,SIS_RI_800x600,  0x00,0x00,0x07,0x06,0x00}, /* 800x600x16 */
+	{0x49,0x0a3c,0x05,0x0116,SIS_RI_1024x768, 0x00,0x00,0x00,0x07,0x13},
+	{0x4a,0x0a3d,0x05,0x0117,SIS_RI_1024x768, 0x00,0x00,0x08,0x07,0x13}, /* 1024x768x16 */
+	{0x4c,0x0e7c,0x06,0x0119,SIS_RI_1280x1024,0x00,0x00,0x00,0x00,0x1a},
+	{0x4d,0x0e7d,0x06,0x011a,SIS_RI_1280x1024,0x00,0x00,0x00,0x00,0x1a}, /* 1280x1024x16 */
+	{0x50,0x9a1b,0x00,0x0132,SIS_RI_320x240,  0x00,0x00,0x04,0x04,0x26}, /* 320x240x8  */
+	{0x51,0xba1b,0x01,0x0133,SIS_RI_400x300,  0x00,0x00,0x07,0x07,0x27}, /* 400x300x8  */
+  	{0x52,0xba1b,0x02,0x0134,SIS_RI_512x384,  0x00,0x00,0x00,0x00,0x28}, /* 512x384x8  */
+	{0x56,0x9a1d,0x00,0x0135,SIS_RI_320x240,  0x00,0x00,0x04,0x04,0x26}, /* 320x240x16 */
+	{0x57,0xba1d,0x01,0x0136,SIS_RI_400x300,  0x00,0x00,0x07,0x07,0x27}, /* 400x300x16 */
+ 	{0x58,0xba1d,0x02,0x0137,SIS_RI_512x384,  0x00,0x00,0x00,0x00,0x28}, /* 512x384x16 */
+	{0x59,0x9a1b,0x00,0x0138,SIS_RI_320x200,  0x00,0x00,0x04,0x04,0x25}, /* 320x200x8  */
+	{0x5a,0x021b,0x00,0x0138,SIS_RI_320x240,  0x00,0x00,0x00,0x00,0x3f}, /* 320x240x8  fstn */
+	{0x5b,0x0a1d,0x00,0x0135,SIS_RI_320x240,  0x00,0x00,0x00,0x00,0x3f}, /* 320x240x16 fstn */
+	{0x5c,0xba1f,0x02,0x0000,SIS_RI_512x384,  0x00,0x00,0x00,0x00,0x28}, /* 512x384x32 */
+	{0x5d,0x0a1d,0x03,0x0139,SIS_RI_640x400,  0x00,0x00,0x05,0x07,0x10},
+	{0x5e,0x0a1f,0x03,0x0000,SIS_RI_640x400,  0x00,0x00,0x05,0x07,0x10}, /* 640x400x32 */
+	{0x62,0x0a3f,0x03,0x013a,SIS_RI_640x480,  0x00,0x00,0x05,0x05,0x08}, /* 640x480x32 */
+	{0x63,0x2a3f,0x04,0x013b,SIS_RI_800x600,  0x00,0x00,0x07,0x06,0x00}, /* 800x600x32 */
+	{0x64,0x0a7f,0x05,0x013c,SIS_RI_1024x768, 0x00,0x00,0x08,0x07,0x13}, /* 1024x768x32 */
+	{0x65,0x0eff,0x06,0x013d,SIS_RI_1280x1024,0x00,0x00,0x00,0x00,0x1a}, /* 1280x1024x32 */
+	{0x66,0x0eff,0x07,0x013e,SIS_RI_1600x1200,0x00,0x00,0x00,0x00,0x1e}, /* 1600x1200x32 */
+	{0x68,0x067b,0x08,0x013f,SIS_RI_1920x1440,0x00,0x00,0x00,0x00,0x29}, /* 1920x1440x8 */
+	{0x69,0x06fd,0x08,0x0140,SIS_RI_1920x1440,0x00,0x00,0x00,0x00,0x29}, /* 1920x1440x16 */
+	{0x6b,0x07ff,0x08,0x0141,SIS_RI_1920x1440,0x00,0x00,0x00,0x00,0x29}, /* 1920x1440x32 */
+	{0x6c,0x067b,0x09,0x0000,SIS_RI_2048x1536,0x00,0x00,0x00,0x00,0x2f}, /* 2048x1536x8 */
+	{0x6d,0x06fd,0x09,0x0000,SIS_RI_2048x1536,0x00,0x00,0x00,0x00,0x2f}, /* 2048x1536x16 */
+	{0x6e,0x07ff,0x09,0x0000,SIS_RI_2048x1536,0x00,0x00,0x00,0x00,0x2f}, /* 2048x1536x32 */
+	{0x70,0x2a1b,0x04,0x0000,SIS_RI_800x480,  0x00,0x00,0x07,0x07,0x34}, /* 800x480x8 */
+	{0x71,0x0a1b,0x05,0x0000,SIS_RI_1024x576, 0x00,0x00,0x00,0x00,0x37}, /* 1024x576x8 */
+	{0x74,0x0a1d,0x05,0x0000,SIS_RI_1024x576, 0x00,0x00,0x00,0x00,0x37}, /* 1024x576x16 */
+	{0x75,0x0a3d,0x06,0x0000,SIS_RI_1280x720, 0x00,0x00,0x00,0x00,0x3a}, /* 1280x720x16 */
+	{0x76,0x2a1f,0x04,0x0000,SIS_RI_800x480,  0x00,0x00,0x07,0x07,0x34}, /* 800x480x32 */
+	{0x77,0x0a1f,0x05,0x0000,SIS_RI_1024x576, 0x00,0x00,0x00,0x00,0x37}, /* 1024x576x32 */
+	{0x78,0x0a3f,0x06,0x0000,SIS_RI_1280x720, 0x00,0x00,0x00,0x00,0x3a}, /* 1280x720x32 */
+	{0x79,0x0a3b,0x06,0x0000,SIS_RI_1280x720, 0x00,0x00,0x00,0x00,0x3a}, /* 1280x720x8 */
+	{0x7a,0x2a1d,0x04,0x0000,SIS_RI_800x480,  0x00,0x00,0x07,0x07,0x34}, /* 800x480x16 */
+	{0x7c,0x0e3b,0x06,0x0000,SIS_RI_1280x960, 0x00,0x00,0x00,0x00,0x3d}, /* 1280x960x8 */
+	{0x7d,0x0e7d,0x06,0x0000,SIS_RI_1280x960, 0x00,0x00,0x00,0x00,0x3d}, /* 1280x960x16 */
+	{0x7e,0x0eff,0x06,0x0000,SIS_RI_1280x960, 0x00,0x00,0x00,0x00,0x3d}, /* 1280x960x32 */
+	{0x23,0x0e3b,0x06,0x0000,SIS_RI_1280x768, 0x00,0x00,0x00,0x00,0x40}, /* 1280x768x8 */
+	{0x24,0x0e7d,0x06,0x0000,SIS_RI_1280x768, 0x00,0x00,0x00,0x00,0x40}, /* 1280x768x16 */
+	{0x25,0x0eff,0x06,0x0000,SIS_RI_1280x768, 0x00,0x00,0x00,0x00,0x40}, /* 1280x768x32 */
+	{0x26,0x0e3b,0x0c,0x0000,SIS_RI_1400x1050,0x00,0x00,0x00,0x00,0x41}, /* 1400x1050x8 */
+	{0x27,0x0e7d,0x0c,0x0000,SIS_RI_1400x1050,0x00,0x00,0x00,0x00,0x41}, /* 1400x1050x16 */
+	{0x28,0x0eff,0x0c,0x0000,SIS_RI_1400x1050,0x00,0x00,0x00,0x00,0x41}, /* 1400x1050x32*/
+	{0x29,0x0e1b,0x0d,0x0000,SIS_RI_1152x864, 0x00,0x00,0x00,0x00,0x43}, /* 1152x864 */
+	{0x2a,0x0e3d,0x0d,0x0000,SIS_RI_1152x864, 0x00,0x00,0x00,0x00,0x43},
+	{0x2b,0x0e7f,0x0d,0x0000,SIS_RI_1152x864, 0x00,0x00,0x00,0x00,0x43},
+	{0x39,0x2a1b,0x0b,0x0000,SIS_RI_848x480,  0x00,0x00,0x00,0x00,0x45}, /* 848x480 */
+	{0x3b,0x2a3d,0x0b,0x0000,SIS_RI_848x480,  0x00,0x00,0x00,0x00,0x45},
+	{0x3e,0x2a7f,0x0b,0x0000,SIS_RI_848x480,  0x00,0x00,0x00,0x00,0x45},
+	{0x3f,0x2a1b,0x0b,0x0000,SIS_RI_856x480,  0x00,0x00,0x00,0x00,0x47}, /* 856x480 */
+	{0x42,0x2a3d,0x0b,0x0000,SIS_RI_856x480,  0x00,0x00,0x00,0x00,0x47},
+	{0x45,0x2a7f,0x0b,0x0000,SIS_RI_856x480,  0x00,0x00,0x00,0x00,0x47},
+	{0x48,0x2a1b,0x0e,0x0000,SIS_RI_1360x768, 0x00,0x00,0x00,0x00,0x49}, /* 1360x768 */
+	{0x4b,0x2a3d,0x0e,0x0000,SIS_RI_1360x768, 0x00,0x00,0x00,0x00,0x49},
+	{0x4e,0x2a7f,0x0e,0x0000,SIS_RI_1360x768, 0x00,0x00,0x00,0x00,0x49},
+	{0x4f,0x9a1f,0x00,0x0000,SIS_RI_320x200,  0x00,0x00,0x04,0x04,0x25}, /* 320x200x32 */
+	{0x53,0x9a1f,0x00,0x0000,SIS_RI_320x240,  0x00,0x00,0x04,0x04,0x26}, /* 320x240x32 */
+	{0x54,0xba1f,0x01,0x0000,SIS_RI_400x300,  0x00,0x00,0x07,0x07,0x27}, /* 400x300x32 */
+	{0x5f,0x2a1b,0x0f,0x0000,SIS_RI_768x576,  0x00,0x00,0x06,0x06,0x4a}, /* 768x576x8 */
+	{0x60,0x2a1d,0x0f,0x0000,SIS_RI_768x576,  0x00,0x00,0x06,0x06,0x4a}, /* 768x576x16 */
+	{0x61,0x2a1f,0x0f,0x0000,SIS_RI_768x576,  0x00,0x00,0x06,0x06,0x4a}, /* 768x576x32 */
+	{0xff,0x0000,0x00,0x0000,0,               0x00,0x00,0x00,0x00,0x00}
 };
 
 typedef struct _SiS310_Ext2Struct
 {
 	USHORT Ext_InfoFlag;
-	UCHAR Ext_CRT1CRTC;
-	UCHAR Ext_CRTVCLK;
-	UCHAR Ext_CRT2CRTC;
+	UCHAR  Ext_CRT1CRTC;
+	UCHAR  Ext_CRTVCLK;
+	UCHAR  Ext_CRT2CRTC;
 	UCHAR  ModeID;
 	USHORT XRes;
 	USHORT YRes;
-	USHORT ROM_OFFSET;
+	UCHAR  Ext_PDC;
 } SiS310_Ext2Struct;
 
 static const SiS310_Ext2Struct SiS310_RefIndex[]=
 {
-/*	{0x005f,0x0d,0x03,0x05,0x6a, 800, 600,0x3a81},    0x0 - TW: Patch for Chrontel 7019  */
-	{0x085f,0x0d,0x03,0x05,0x6a, 800, 600,0x3a81}, /* 0x0 */
-	{0x0467,0x0e,0x04,0x05,0x6a, 800, 600,0x3a86}, /* 0x1 */
-	{0x0067,0x0f,0x08,0x48,0x6a, 800, 600,0x3a8b}, /* 0x2 */
-	{0x0067,0x10,0x07,0x8b,0x6a, 800, 600,0x3a90}, /* 0x3 */
-	{0x0147,0x11,0x0a,0x00,0x6a, 800, 600,0x3a95}, /* 0x4 */
-	{0x0147,0x12,0x0d,0x00,0x6a, 800, 600,0x3a9a}, /* 0x5 - 4147 TW: Test sync change */
-	{0x0047,0x13,0x13,0x00,0x6a, 800, 600,0x3a9f}, /* 0x6 - 4047 */
-	{0x0047,0x14,0x1c,0x00,0x6a, 800, 600,0x3aa4}, /* 0x7 - 4047 */
-/*	{0xc05f,0x05,0x00,0x04,0x2e, 640, 480,0x3a57},    0x8 - TW: Patch for Chrontel 7019  */
-	{0xc85f,0x05,0x00,0x04,0x2e, 640, 480,0x3a57}, /* 0x8 */
-	{0xc067,0x06,0x02,0x04,0x2e, 640, 480,0x3a5c}, /* 0x9 */
-	{0xc067,0x07,0x02,0x47,0x2e, 640, 480,0x3a61}, /* 0xa */
-	{0xc067,0x08,0x03,0x8a,0x2e, 640, 480,0x3a66}, /* 0xb */
-	{0xc047,0x09,0x05,0x00,0x2e, 640, 480,0x3a6b}, /* 0xc - 4047 */
-	{0xc047,0x0a,0x09,0x00,0x2e, 640, 480,0x3a70}, /* 0xd - 4047 */
-	{0xc047,0x0b,0x0e,0x00,0x2e, 640, 480,0x3a75}, /* 0xe - 4047 */
-	{0xc047,0x0c,0x15,0x00,0x2e, 640, 480,0x3a7a}, /* 0xf */
-	{0x407f,0x04,0x00,0x00,0x2f, 640, 400,0x3a50}, /* 0x10 */
-	{0xc00f,0x3c,0x01,0x06,0x31, 720, 480,0x3b85}, /* 0x11 */
-	{0x000f,0x3d,0x03,0x06,0x32, 720, 576,0x3b8c}, /* 0x12 */
-	{0x0187,0x15,0x06,0x00,0x37,1024, 768,0x3aab}, /* 0x13 */
-	{0xc877,0x16,0x0b,0x06,0x37,1024, 768,0x3ab0}, /* 0x14 */
-	{0xc067,0x17,0x0f,0x49,0x37,1024, 768,0x3ab5}, /* 0x15 */
-	{0x0267,0x18,0x11,0x00,0x37,1024, 768,0x3aba}, /* 0x16 */
-	{0x0047,0x19,0x16,0x8c,0x37,1024, 768,0x3abf}, /* 0x17 */
-	{0x0047,0x1a,0x1b,0x00,0x37,1024, 768,0x3ac4}, /* 0x18 - 4047 */
-	{0x0007,0x1b,0x1f,0x00,0x37,1024, 768,0x3ac9}, /* 0x19 - 4047 */
-	{0x0387,0x1c,0x11,0x00,0x3a,1280,1024,0x3adc}, /* 0x1a */
-	{0x0077,0x1d,0x19,0x07,0x3a,1280,1024,0x3ae1}, /* 0x1b */
-	{0x0047,0x1e,0x1e,0x00,0x3a,1280,1024,0x3ae6}, /* 0x1c */
-	{0x0007,0x1f,0x20,0x00,0x3a,1280,1024,0x3aeb}, /* 0x1d */
-	{0x0027,0x20,0x21,0x09,0x3c,1600,1200,0x3af2}, /* 0x1e */
-	{0x0007,0x21,0x22,0x00,0x3c,1600,1200,0x3af7}, /* 0x1f */
-	{0x0007,0x22,0x23,0x00,0x3c,1600,1200,0x3afc}, /* 0x20 */
-	{0x0007,0x23,0x25,0x00,0x3c,1600,1200,0x3b01}, /* 0x21 */
-	{0x0007,0x24,0x26,0x00,0x3c,1600,1200,0x3b06}, /* 0x22 */
-	{0x0007,0x25,0x2c,0x00,0x3c,1600,1200,0x3b0b}, /* 0x23 */
-	{0x0007,0x26,0x34,0x00,0x3c,1600,1200,0x3b10}, /* 0x24 */
-	{0x407f,0x00,0x00,0x00,0x40, 320, 200,0x3a34}, /* 0x25 */
-	{0xc07f,0x01,0x00,0x04,0x50, 320, 240,0x3a3b}, /* 0x26 */
-	{0x007f,0x02,0x04,0x05,0x51, 400, 300,0x3a42}, /* 0x27 */
-	{0xc077,0x03,0x0b,0x06,0x52, 512, 384,0x3a49}, /* 0x28 */
-	{0x8007,0x27,0x27,0x00,0x68,1920,1440,0x3b17}, /* 0x29 */
-	{0x4007,0x28,0x29,0x00,0x68,1920,1440,0x3b1c}, /* 0x2a */
-	{0x4007,0x29,0x2e,0x00,0x68,1920,1440,0x3b21}, /* 0x2b */
-	{0x4007,0x2a,0x30,0x00,0x68,1920,1440,0x3b26}, /* 0x2c */
-	{0x4007,0x2b,0x35,0x00,0x68,1920,1440,0x3b2b}, /* 0x2d */
-	{0x4005,0x2c,0x39,0x00,0x68,1920,1440,0x3b30}, /* 0x2e */
-	{0x4007,0x2d,0x2b,0x00,0x6c,2048,1536,0x3b37}, /* 0x2f */
-	{0x4007,0x2e,0x31,0x00,0x6c,2048,1536,0x3b3c}, /* 0x30 */
-	{0x4007,0x2f,0x33,0x00,0x6c,2048,1536,0x3b41}, /* 0x31 */
-	{0x4007,0x30,0x37,0x00,0x6c,2048,1536,0x3b46}, /* 0x32 */
-	{0x4005,0x31,0x38,0x00,0x6c,2048,1536,0x3b4b}, /* 0x33 */
-	{0x0057,0x32,0x40,0x08,0x70, 800, 480,0x3b52}, /* 0x34 */
-	{0x0047,0x33,0x07,0x08,0x70, 800, 480,0x3b57}, /* 0x35 */
-	{0x0047,0x34,0x0a,0x08,0x70, 800, 480,0x3b5c}, /* 0x36 */
-	{0x0057,0x35,0x0b,0x09,0x71,1024, 576,0x3b63}, /* 0x37 */
-	{0x0047,0x36,0x11,0x09,0x71,1024, 576,0x3b68}, /* 0x38 */
-	{0x0047,0x37,0x16,0x09,0x71,1024, 576,0x3b6d}, /* 0x39 */
-	{0x0057,0x38,0x19,0x0a,0x75,1280, 720,0x3b74}, /* 0x3a */
-	{0x0047,0x39,0x1e,0x0a,0x75,1280, 720,0x3b79}, /* 0x3b */
-	{0x0007,0x3a,0x20,0x0a,0x75,1280, 720,0x3b7e}, /* 0x3c */
-	{0x0067,0x3b,0x19,0x08,0x7c,1280, 960,0x3ad0}, /* 0x3d */
-	{0x0027,0x4c,0x59,0x08,0x7c,1280, 960,0x3ad0}, /* 0x3e */
-	{0xc07f,0x01,0x00,0x06,0x5a, 320, 480,0x3b83}, /* 0x3f */    /* FSTN mode */
-        {0x0077,0x42,0x12,0x08,0x23,1280, 768,0x0000}, /* 0x40 */  
-	{0x0067,0x43,0x4d,0x08,0x26,1400,1050,0x0000}, /* 0x41 */  
-	{0x0007,0x4b,0x5a,0x08,0x26,1400,1050,0x0000}, /* 0x42 */    /* TW: new, not in any BIOS */
-	{0x0047,0x44,0x19,0x00,0x29,1152, 864,0x0000}, /* 0x43 TW: Non-BIOS, new */
-	{0x0047,0x4a,0x1e,0x00,0x29,1152, 864,0x0000}, /* 0x44 TW: Non-BIOS, new */
-	{0x00c7,0x45,0x57,0x00,0x39, 848, 480,0x0000}, /* 0x45 TW: 848x480-38Hzi - Non-BIOS, new */
-	{0xc047,0x46,0x55,0x00,0x39, 848, 480,0x0000}, /* 0x46 TW: 848x480-60Hz  - Non-BIOS, new */
-	{0x00c7,0x47,0x57,0x00,0x3f, 856, 480,0x0000}, /* 0x47 TW: 856x480-38Hzi - Non-BIOS, new */
-	{0xc047,0x48,0x57,0x00,0x3f, 856, 480,0x0000}, /* 0x48 TW: 856x480-60Hz  - Non-BIOS, new */
-	{0x0047,0x49,0x58,0x00,0x48,1360, 768,0x0000}, /* 0x49 TW: 1360x768-60Hz - Non-BIOS, new */
-	{0xffff,0x00,0x00,0x00,0x00,   0,   0,0x0000}
-}; 
+	{0x085f,0x0d,0x03,0x05,0x6a, 800, 600, 0x40}, /* 0x0 */
+	{0x0067,0x0e,0x04,0x05,0x6a, 800, 600, 0x40}, /* 0x1 */
+	{0x0067,0x0f,0x08,0x48,0x6a, 800, 600, 0x40}, /* 0x2 */
+	{0x0067,0x10,0x07,0x8b,0x6a, 800, 600, 0x40}, /* 0x3 */
+	{0x0047,0x11,0x0a,0x00,0x6a, 800, 600, 0x40}, /* 0x4 */
+	{0x0047,0x12,0x0d,0x00,0x6a, 800, 600, 0x40}, /* 0x5 */
+	{0x0047,0x13,0x13,0x00,0x6a, 800, 600, 0x20}, /* 0x6 */
+	{0x0107,0x14,0x1c,0x00,0x6a, 800, 600, 0x20}, /* 0x7 */
+	{0xc85f,0x05,0x00,0x04,0x2e, 640, 480, 0x40}, /* 0x8 */
+	{0xc067,0x06,0x02,0x04,0x2e, 640, 480, 0x40}, /* 0x9 */
+	{0xc067,0x07,0x02,0x47,0x2e, 640, 480, 0x40}, /* 0xa */
+	{0xc067,0x08,0x03,0x8a,0x2e, 640, 480, 0x40}, /* 0xb */
+	{0xc047,0x09,0x05,0x00,0x2e, 640, 480, 0x40}, /* 0xc */
+	{0xc047,0x0a,0x09,0x00,0x2e, 640, 480, 0x40}, /* 0xd */
+	{0xc047,0x0b,0x0e,0x00,0x2e, 640, 480, 0x40}, /* 0xe */
+	{0xc047,0x0c,0x15,0x00,0x2e, 640, 480, 0x40}, /* 0xf */
+	{0x487f,0x04,0x00,0x00,0x2f, 640, 400, 0x30}, /* 0x10 */
+	{0xc04f,0x3c,0x01,0x06,0x31, 720, 480, 0x30}, /* 0x11 */
+	{0x004f,0x3d,0x03,0x06,0x32, 720, 576, 0x30}, /* 0x12 */
+	{0x0087,0x15,0x06,0x00,0x37,1024, 768, 0x30}, /* 0x13 */
+	{0xc877,0x16,0x0b,0x06,0x37,1024, 768, 0x20}, /* 0x14 */
+	{0xc067,0x17,0x0f,0x49,0x37,1024, 768, 0x20}, /* 0x15 */
+	{0x0067,0x18,0x11,0x00,0x37,1024, 768, 0x20}, /* 0x16 */
+	{0x0047,0x19,0x16,0x8c,0x37,1024, 768, 0x20}, /* 0x17 */
+	{0x0107,0x1a,0x1b,0x00,0x37,1024, 768, 0x10}, /* 0x18 */
+	{0x0107,0x1b,0x1f,0x00,0x37,1024, 768, 0x10}, /* 0x19 */
+	{0x0087,0x1c,0x11,0x00,0x3a,1280,1024, 0x30}, /* 0x1a */
+	{0x0137,0x1d,0x19,0x07,0x3a,1280,1024, 0x00}, /* 0x1b */
+	{0x0107,0x1e,0x1e,0x00,0x3a,1280,1024, 0x00}, /* 0x1c */
+	{0x0207,0x1f,0x20,0x00,0x3a,1280,1024, 0x00}, /* 0x1d */
+	{0x0227,0x20,0x21,0x09,0x3c,1600,1200, 0x00}, /* 0x1e */
+	{0x0407,0x21,0x22,0x00,0x3c,1600,1200, 0x00}, /* 0x1f */
+	{0x0407,0x22,0x23,0x00,0x3c,1600,1200, 0x00}, /* 0x20 */
+	{0x0407,0x23,0x25,0x00,0x3c,1600,1200, 0x00}, /* 0x21 */
+	{0x0007,0x24,0x26,0x00,0x3c,1600,1200, 0x00}, /* 0x22 */
+	{0x0007,0x25,0x2c,0x00,0x3c,1600,1200, 0x00}, /* 0x23 */
+	{0x0007,0x26,0x34,0x00,0x3c,1600,1200, 0x00}, /* 0x24 */
+	{0x407f,0x00,0x00,0x00,0x40, 320, 200, 0x30}, /* 0x25 */
+	{0xc07f,0x01,0x00,0x04,0x50, 320, 240, 0x30}, /* 0x26 */
+	{0x007f,0x02,0x04,0x05,0x51, 400, 300, 0x30}, /* 0x27 */
+	{0xc077,0x03,0x0b,0x06,0x52, 512, 384, 0x30}, /* 0x28 */
+	{0x8007,0x27,0x27,0x00,0x68,1920,1440, 0x00}, /* 0x29 */
+	{0x4007,0x28,0x29,0x00,0x68,1920,1440, 0x00}, /* 0x2a */
+	{0x4007,0x29,0x2e,0x00,0x68,1920,1440, 0x00}, /* 0x2b */
+	{0x4007,0x2a,0x30,0x00,0x68,1920,1440, 0x00}, /* 0x2c */
+	{0x4007,0x2b,0x35,0x00,0x68,1920,1440, 0x00}, /* 0x2d */
+	{0x4005,0x2c,0x39,0x00,0x68,1920,1440, 0x00}, /* 0x2e */
+	{0x4007,0x2d,0x2b,0x00,0x6c,2048,1536, 0x00}, /* 0x2f */
+	{0x4007,0x2e,0x31,0x00,0x6c,2048,1536, 0x00}, /* 0x30 */
+	{0x4007,0x2f,0x33,0x00,0x6c,2048,1536, 0x00}, /* 0x31 */
+	{0x4007,0x30,0x37,0x00,0x6c,2048,1536, 0x00}, /* 0x32 */
+	{0x4005,0x31,0x38,0x00,0x6c,2048,1536, 0x00}, /* 0x33 */
+	{0x0057,0x32,0x40,0x08,0x70, 800, 480, 0x30}, /* 0x34 */
+	{0x0047,0x33,0x07,0x08,0x70, 800, 480, 0x30}, /* 0x35 */
+	{0x0047,0x34,0x0a,0x08,0x70, 800, 480, 0x30}, /* 0x36 */
+	{0x0057,0x35,0x0b,0x09,0x71,1024, 576, 0x30}, /* 0x37 */
+	{0x0047,0x36,0x11,0x09,0x71,1024, 576, 0x30}, /* 0x38 */
+	{0x0047,0x37,0x16,0x09,0x71,1024, 576, 0x30}, /* 0x39 */
+	{0x0117,0x38,0x19,0x0a,0x75,1280, 720, 0x30}, /* 0x3a */
+	{0x0107,0x39,0x1e,0x0a,0x75,1280, 720, 0x30}, /* 0x3b */
+	{0x0207,0x3a,0x20,0x0a,0x75,1280, 720, 0x30}, /* 0x3c */
+	{0x0127,0x3b,0x19,0x08,0x7c,1280, 960, 0x30}, /* 0x3d */
+	{0x0227,0x4c,0x59,0x08,0x7c,1280, 960, 0x20}, /* 0x3e */
+	{0xc07f,0x4e,0x00,0x06,0x5a, 320, 240, 0x30}, /* 0x3f */    /* FSTN 320x240 */
+        {0x0077,0x42,0x5b,0x08,0x23,1280, 768, 0x30}, /* 0x40 */    /* TW: 0x5b was 0x12 */
+	{0x0127,0x43,0x4d,0x08,0x26,1400,1050, 0x30}, /* 0x41 */
+	{0x0207,0x4b,0x5a,0x08,0x26,1400,1050, 0x30}, /* 0x42 Non-BIOS, new */
+	{0x0107,0x44,0x19,0x00,0x29,1152, 864, 0x30}, /* 0x43 Non-BIOS, new */
+	{0x0107,0x4a,0x1e,0x00,0x29,1152, 864, 0x30}, /* 0x44 Non-BIOS, new */
+	{0x0087,0x45,0x57,0x00,0x39, 848, 480, 0x30}, /* 0x45 848x480-38Hzi - Non-BIOS, new */
+	{0xc067,0x46,0x55,0x0b,0x39, 848, 480, 0x30}, /* 0x46 848x480-60Hz  - Non-BIOS, new */
+	{0x0087,0x47,0x57,0x00,0x3f, 856, 480, 0x30}, /* 0x47 856x480-38Hzi - Non-BIOS, new */
+	{0xc047,0x48,0x57,0x00,0x3f, 856, 480, 0x30}, /* 0x48 856x480-60Hz  - Non-BIOS, new */
+	{0x0067,0x49,0x58,0x0c,0x48,1360, 768, 0x30}, /* 0x49 1360x768-60Hz - Non-BIOS, new */
+	{0x004f,0x4d,0x03,0x06,0x5f, 768, 576, 0x30}, /* 0x4a 768x576 */
+	{0xffff,0x00,0x00,0x00,0x00,   0,   0, 0}
+};
 
 typedef struct _SiS310_CRT1TableStruct
 {
@@ -710,7 +306,7 @@
  {{0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f,
    0x9c,0x8e,0x8f,0x96,0xb9,0x30,0x00,0x05,
    0x00}}, /* 0x4 */
-#if 0   
+#if 0
  {{0x5f,0x4f,0x50,0x82,0x55,0x81,0x0b,0x3e,
    0xe9,0x8b,0xdf,0xe7,0x04,0x00,0x00,0x05,
    0x00}}, /* 0x5 */
@@ -914,36 +510,41 @@
  {{0xe6,0xae,0xae,0x8a,0xbd,0x90,0x3d,0x10,
    0x1a,0x8d,0x19,0x19,0x3e,0x2f,0x00,0x03,
    0x00}},  /* 0x43 */
- {{0xc3,0x8f,0x8f,0x87,0x9b,0x0b,0x82,0xef, /* TW: New, 1152x864-75, not in any BIOS */
+ {{0xc3,0x8f,0x8f,0x87,0x9b,0x0b,0x82,0xef, /* New, 1152x864-75, not in BIOS */
    0x60,0x83,0x5f,0x5f,0x83,0x10,0x00,0x07,
    0x01}},  /* 0x44 */
- {{0x86,0x69,0x69,0x8A,0x74,0x06,0x8C,0x15, /* TW: New, 848x480-38i, not in BIOS */
+ {{0x86,0x69,0x69,0x8A,0x74,0x06,0x8C,0x15, /* New, 848x480-38i, not in BIOS */
    0x4F,0x83,0xEF,0xEF,0x8D,0x30,0x00,0x02,
    0x00}},  /* 0x45 */
- {{0x83,0x69,0x69,0x87,0x6f,0x1d,0x03,0x3E, /* TW: New, 848x480-60, not in BIOS */
+ {{0x83,0x69,0x69,0x87,0x6f,0x1d,0x03,0x3E, /* New, 848x480-60, not in BIOS */
    0xE5,0x8d,0xDF,0xe4,0x04,0x00,0x00,0x06,
    0x00}},  /* 0x46 */
- {{0x86,0x6A,0x6A,0x8A,0x74,0x06,0x8C,0x15, /* TW: New, 856x480-38i, not in BIOS */
+ {{0x86,0x6A,0x6A,0x8A,0x74,0x06,0x8C,0x15, /* New, 856x480-38i, not in BIOS */
    0x4F,0x83,0xEF,0xEF,0x8D,0x30,0x00,0x02,
    0x00}},  /* 0x47 */
- {{0x81,0x6A,0x6A,0x85,0x70,0x00,0x0F,0x3E, /* TW: New, 856x480-60, not in BIOS */
+ {{0x81,0x6A,0x6A,0x85,0x70,0x00,0x0F,0x3E, /* New, 856x480-60, not in BIOS */
    0xEB,0x8E,0xDF,0xDF,0x10,0x00,0x00,0x02,
    0x00}},  /* 0x48 */
- {{0xdd,0xa9,0xa9,0x81,0xb4,0x97,0x26,0xfd, /* TW: New, 1360x768-60, not in BIOS */
+ {{0xdd,0xa9,0xa9,0x81,0xb4,0x97,0x26,0xfd, /* New, 1360x768-60, not in BIOS */
    0x01,0x8d,0xff,0x00,0x27,0x10,0x00,0x03,
    0x01}},  /* 0x49 */
- {{0xd9,0x8f,0x8f,0x9d,0xba,0x0a,0x8a,0xff, /* TW: New, 1152x864-84, not in any BIOS   */
+ {{0xd9,0x8f,0x8f,0x9d,0xba,0x0a,0x8a,0xff, /* New, 1152x864-84, not in any BIOS   */
    0x60,0x8b,0x5f,0x5f,0x8b,0x10,0x00,0x03,
    0x01}},  /* 0x4a */
- {{0xea,0xae,0xae,0x8e,0xba,0x82,0x40,0x10, /* TW: New, 1400x1050-75, not in any BIOS  */
+ {{0xea,0xae,0xae,0x8e,0xba,0x82,0x40,0x10, /* New, 1400x1050-75, not in any BIOS  */
    0x1b,0x87,0x19,0x1a,0x41,0x0f,0x00,0x03,
-   0x00}},  /* 0x4b */ 
- {{0xd3,0x9f,0x9f,0x97,0xab,0x1f,0xf1,0xff, /* TW: New, 1280x960-85, not in any BIOS */
+   0x00}},  /* 0x4b */
+ {{0xd3,0x9f,0x9f,0x97,0xab,0x1f,0xf1,0xff, /* New, 1280x960-85, not in any BIOS */
    0xc0,0x83,0xbf,0xbf,0xf2,0x10,0x00,0x07,
-   0x01}}   /* 0x4c */
+   0x01}},  /* 0x4c */
+ {{0x7b,0x5f,0x63,0x9f,0x6a,0x93,0x6f,0xf0, /* 768x576 */
+   0x58,0x8a,0x3f,0x57,0x70,0x20,0x00,0x05,
+   0x01}},  /* 0x4d */
+ {{0x2d,0x27,0x28,0x90,0x2c,0x80,0x0b,0x3e, /* FSTN 320x480, TEMP - possibly invalid */
+   0xe9,0x8b,0xdf,0xe7,0x04,0x00,0x00,0x00,
+   0x00}}   /* 0x4e */
 };
 
-
 typedef struct _SiS310_MCLKDataStruct
 {
 	UCHAR SR28,SR29,SR2A;
@@ -952,7 +553,7 @@
 
 static const SiS310_MCLKDataStruct SiS310_MCLKData_0_315[] =
 {
-	{ 0x3b,0x22,0x01,143},   /* TW: Was { 0x5c,0x23,0x01,166}, */
+	{ 0x3b,0x22,0x01,143},
 	{ 0x5c,0x23,0x01,166},
 	{ 0x5c,0x23,0x01,166},
 	{ 0x5c,0x23,0x01,166},
@@ -962,7 +563,7 @@
 	{ 0x5c,0x23,0x01,166}
 };
 
-static const SiS310_MCLKDataStruct SiS310_MCLKData_0_650[] =	/* @ 0x54 */
+static const SiS310_MCLKDataStruct SiS310_MCLKData_0_650[] =
 {
 	{ 0x5a,0x64,0x82, 66},
 	{ 0xb3,0x45,0x82, 83},
@@ -974,7 +575,7 @@
 	{ 0x37,0x22,0x82,133}
 };
 
-static const SiS310_MCLKDataStruct SiS310_MCLKData_0_330[] =   /* @ 0x54 */
+static const SiS310_MCLKDataStruct SiS310_MCLKData_0_330[] =
 {
 	{ 0x5c,0x23,0x01,166},
 	{ 0x5c,0x23,0x01,166},
@@ -986,7 +587,19 @@
 	{ 0x79,0x06,0x01,250}
 };
 
-static const SiS310_MCLKDataStruct SiS310_MCLKData_1[] =	/* @ 0x155 */
+static const SiS310_MCLKDataStruct SiS310_MCLKData_0_660[] =  /* TODO */
+{
+	{ 0x5c,0x23,0x82,166},
+	{ 0x5c,0x23,0x82,166},
+	{ 0x37,0x21,0x82,200},
+	{ 0x37,0x22,0x82,133},
+	{ 0x29,0x21,0x82,150},
+	{ 0x5c,0x23,0x82,166},
+	{ 0x65,0x23,0x82,183},
+	{ 0x37,0x21,0x82,200}
+};
+
+static const SiS310_MCLKDataStruct SiS310_MCLKData_1[] =
 {
         { 0x29,0x21,0x82,150},
 	{ 0x5c,0x23,0x82,166},
@@ -998,20 +611,6 @@
 	{ 0x37,0x22,0x82,133}
 };
 
-typedef struct _SiS310_ECLKDataStruct
-{
- 	UCHAR SR2E,SR2F,SR30;
- 	USHORT CLOCK;
-} SiS310_ECLKDataStruct;
-
-static const SiS310_ECLKDataStruct SiS310_ECLKData[]=
-{
-	{ 0x5c,0x23,0x01,166},
-	{ 0x5c,0x23,0x01,166},
-	{ 0x5c,0x23,0x01,166},
-	{ 0x5c,0x23,0x01,166}
-};
-
 typedef struct _SiS310_VCLKDataStruct
 {
 	UCHAR SR2B,SR2C;
@@ -1020,22 +619,22 @@
 
 static const SiS310_VCLKDataStruct SiS310_VCLKData[]=
 {
-	{ 0x1b,0xe1, 25}, /* 0x0 */   /* 650/LVDS BIOS: @ 0x5647 */
-	{ 0x4e,0xe4, 28}, /* 0x1 */
-	{ 0x57,0xe4, 31}, /* 0x2 */
-	{ 0xc3,0xc8, 36}, /* 0x3 */
-	{ 0x42,0xe2, 40}, /* 0x4 */
-	{ 0xfe,0xcd, 43}, /* 0x5 */
-	{ 0x5d,0xc4, 44}, /* 0x6 */
-	{ 0x52,0xe2, 49}, /* 0x7 */
-	{ 0x53,0xe2, 50}, /* 0x8 */
-	{ 0x74,0x67, 52}, /* 0x9 */
-	{ 0x6d,0x66, 56}, /* 0xa */
-	{ 0x5a,0x64, 65}, /* 0xb */   /* TW: was 6c c3 - WRONG */
-	{ 0x46,0x44, 67}, /* 0xc */
-	{ 0xb1,0x46, 68}, /* 0xd */
-	{ 0xd3,0x4a, 72}, /* 0xe */
-	{ 0x29,0x61, 75}, /* 0xf */
+	{ 0x1b,0xe1, 25}, /* 0x00 */
+	{ 0x4e,0xe4, 28}, /* 0x01 */
+	{ 0x57,0xe4, 31}, /* 0x02 */
+	{ 0xc3,0xc8, 36}, /* 0x03 */
+	{ 0x42,0xe2, 40}, /* 0x04 */
+	{ 0xfe,0xcd, 43}, /* 0x05 */
+	{ 0x5d,0xc4, 44}, /* 0x06 */
+	{ 0x52,0xe2, 49}, /* 0x07 */
+	{ 0x53,0xe2, 50}, /* 0x08 */
+	{ 0x74,0x67, 52}, /* 0x09 */
+	{ 0x6d,0x66, 56}, /* 0x0a */
+	{ 0x5a,0x64, 65}, /* 0x0b */  /* TW: was 6c c3 - WRONG */
+	{ 0x46,0x44, 67}, /* 0x0c */
+	{ 0xb1,0x46, 68}, /* 0x0d */
+	{ 0xd3,0x4a, 72}, /* 0x0e */
+	{ 0x29,0x61, 75}, /* 0x0f */
 	{ 0x6e,0x46, 76}, /* 0x10 */
 	{ 0x2b,0x61, 78}, /* 0x11 */
 	{ 0x31,0x42, 79}, /* 0x12 */
@@ -1078,12 +677,12 @@
 	{ 0xea,0x08,340}, /* 0x37 */
 	{ 0xe8,0x07,376}, /* 0x38 */
 	{ 0xde,0x06,389}, /* 0x39 */
-	{ 0x52,0x2a, 54}, /* 0x3a */
-	{ 0x52,0x6a, 27}, /* 0x3b */
-	{ 0x62,0x24, 70}, /* 0x3c */
-	{ 0x62,0x64, 70}, /* 0x3d */
-	{ 0xa8,0x4c, 30}, /* 0x3e */
-	{ 0x20,0x26, 33}, /* 0x3f */
+	{ 0x52,0x2a, 54}, /* 0x3a */  /* 301 TV */
+	{ 0x52,0x6a, 27}, /* 0x3b */  /* 301 TV */
+	{ 0x62,0x24, 70}, /* 0x3c */  /* 301 TV */
+	{ 0x62,0x64, 70}, /* 0x3d */  /* 301 TV */
+	{ 0xa8,0x4c, 30}, /* 0x3e */  /* 301 TV */
+	{ 0x20,0x26, 33}, /* 0x3f */  /* 301 TV */
 	{ 0x31,0xc2, 39}, /* 0x40 */
 	{ 0x60,0x36, 30}, /* 0x41 */  /* Chrontel */
 	{ 0x40,0x4a, 28}, /* 0x42 */  /* Chrontel */
@@ -1096,7 +695,7 @@
 	{ 0xce,0x3c, 39}, /* 0x49 */
 	{ 0x52,0x4a, 36}, /* 0x4a */  /* Chrontel */
 	{ 0x34,0x61, 95}, /* 0x4b */
-	{ 0x78,0x27,108}, /* 0x4c - was 102 */  /* TW: Last entry in 650/301 BIOS */
+	{ 0x78,0x27,108}, /* 0x4c - was 102 */
 	{ 0x66,0x43,123}, /* 0x4d */  /* Modes 0x26-0x28 (1400x1050) */
 	{ 0x41,0x4e, 21}, /* 0x4e */
 	{ 0xa1,0x4a, 29}, /* 0x4f */  /* Chrontel */
@@ -1110,7 +709,8 @@
 	{ 0xbf,0xc8, 35}, /* 0x57 - added for 856x480-38i,60 (not in any BIOS) */
 	{ 0x30,0x23, 88}, /* 0x58 - added for 1360x768-62 (is 60Hz!) (not in any BIOS) */
 	{ 0x52,0x07,149}, /* 0x59 - added for 1280x960-85 (Not in any BIOS) */
-	{ 0x56,0x07,156}  /* 0x5a - added for 1400x1050-75 */
+	{ 0x56,0x07,156}, /* 0x5a - added for 1400x1050-75 */
+   	{ 0x70,0x29, 81}  /* 0x5b - added for 1280x768 LCD */
 };
 
 typedef struct _SiS310_VBVCLKDataStruct
@@ -1121,22 +721,22 @@
 
 static const SiS310_VBVCLKDataStruct SiS310_VBVCLKData[]=
 {
-	{ 0x1b,0xe1, 25}, /* 0x0 */   /* 650/LVDS BIOS: @ 0x579c */
-	{ 0x4e,0xe4, 28}, /* 0x1 */
-	{ 0x57,0xe4, 31}, /* 0x2 */
-	{ 0xc3,0xc8, 36}, /* 0x3 */
-	{ 0x42,0x47, 40}, /* 0x4 */
-	{ 0xfe,0xcd, 43}, /* 0x5 */
-	{ 0x5d,0xc4, 44}, /* 0x6 */
-	{ 0x52,0x47, 49}, /* 0x7 */
-	{ 0x53,0x47, 50}, /* 0x8 */
-	{ 0x74,0x67, 52}, /* 0x9 */
-	{ 0x6d,0x66, 56}, /* 0xa */
-	{ 0x35,0x62, 65}, /* 0xb */  /* Was 0x5a,0x64 - 650/LVDS+301 bios: 35,62  */
-	{ 0x46,0x44, 67}, /* 0xc */
-	{ 0xb1,0x46, 68}, /* 0xd */
-	{ 0xd3,0x4a, 72}, /* 0xe */
-	{ 0x29,0x61, 75}, /* 0xf */
+	{ 0x1b,0xe1, 25}, /* 0x00 */
+	{ 0x4e,0xe4, 28}, /* 0x01 */
+	{ 0x57,0xe4, 31}, /* 0x02 */
+	{ 0xc3,0xc8, 36}, /* 0x03 */
+	{ 0x42,0x47, 40}, /* 0x04 */
+	{ 0xfe,0xcd, 43}, /* 0x05 */
+	{ 0x5d,0xc4, 44}, /* 0x06 */
+	{ 0x52,0x47, 49}, /* 0x07 */
+	{ 0x53,0x47, 50}, /* 0x08 */
+	{ 0x74,0x67, 52}, /* 0x09 */
+	{ 0x6d,0x66, 56}, /* 0x0a */
+	{ 0x35,0x62, 65}, /* 0x0b */  /* Was 0x5a,0x64 - 650/LVDS+301 bios: 35,62  */
+	{ 0x46,0x44, 67}, /* 0x0c */
+	{ 0xb1,0x46, 68}, /* 0x0d */
+	{ 0xd3,0x4a, 72}, /* 0x0e */
+	{ 0x29,0x61, 75}, /* 0x0f */
 	{ 0x6d,0x46, 75}, /* 0x10 */
 	{ 0x41,0x43, 78}, /* 0x11 */
 	{ 0x31,0x42, 79}, /* 0x12 */
@@ -1146,15 +746,21 @@
 	{ 0x62,0x44, 94}, /* 0x16 */
 	{ 0x2b,0x22,104}, /* 0x17 */
 	{ 0x49,0x24,105}, /* 0x18 */
-	{ 0xf8,0x2f,108}, /* 0x19 */
+	{ 0xf8,0x2f,108}, /* 0x19 */  /* 1400x1050 LCD */
 	{ 0x3c,0x23,109}, /* 0x1a */
 	{ 0x5e,0x43,113}, /* 0x1b */
 	{ 0xbc,0x44,116}, /* 0x1c */
 	{ 0xe0,0x46,132}, /* 0x1d */
+#if 0
 	{ 0xd4,0x28,135}, /* 0x1e */
 	{ 0xea,0x2a,139}, /* 0x1f */
 	{ 0x41,0x22,157}, /* 0x20 */
 	{ 0x70,0x24,162}, /* 0x21 */
+#endif
+	{ 0xe2,0x46,135}, /* 0x1e */  /* 1280x1024-75, better clock for VGA2 */
+	{ 0xe5,0x46,139}, /* 0x1f */  /* 1024x768-120, better clock for VGA2 */
+	{ 0x15,0x01,157}, /* 0x20 */  /* 1280x1024-85, better clock for VGA2 */
+	{ 0x70,0x09,162}, /* 0x21 */  /* 1600x1200-60, better clock for VGA2 */
 	{ 0x30,0x21,175}, /* 0x22 */
 	{ 0x4e,0x22,189}, /* 0x23 */
 	{ 0xde,0x26,194}, /* 0x24 */
@@ -1179,19 +785,19 @@
 	{ 0xea,0x08,340}, /* 0x37 */
 	{ 0xe8,0x07,376}, /* 0x38 */
 	{ 0xde,0x06,389}, /* 0x39 */
-	{ 0x52,0x2a, 54}, /* 0x3a */
-	{ 0x52,0x6a, 27}, /* 0x3b */
-	{ 0x62,0x24, 70}, /* 0x3c */
-	{ 0x62,0x64, 70}, /* 0x3d */
-	{ 0xa8,0x4c, 30}, /* 0x3e */
-	{ 0x20,0x26, 33}, /* 0x3f */
+	{ 0x52,0x2a, 54}, /* 0x3a */  /* 301 TV */
+	{ 0x52,0x6a, 27}, /* 0x3b */  /* 301 TV */
+	{ 0x62,0x24, 70}, /* 0x3c */  /* 301 TV */
+	{ 0x62,0x64, 70}, /* 0x3d */  /* 301 TV */
+	{ 0xa8,0x4c, 30}, /* 0x3e */  /* 301 TV */
+	{ 0x20,0x26, 33}, /* 0x3f */  /* 301 TV */
 	{ 0x31,0xc2, 39}, /* 0x40 */
-	{ 0x2e,0x48, 25}, /* 0x41 */
-	{ 0x24,0x46, 25}, /* 0x42 */
-	{ 0x26,0x64, 28}, /* 0x43 */
-	{ 0x37,0x64, 40}, /* 0x44 */
-	{ 0xa1,0x42,108}, /* 0x45 */
-	{ 0x37,0x61,100}, /* 0x46 */
+	{ 0x2e,0x48, 25}, /* 0x41 */  /* Replacement for LCD on 315 for index 0 */
+	{ 0x24,0x46, 25}, /* 0x42 */  /* Replacement for LCD on 315 for modes 0x01, 0x03, 0x0f, 0x10, 0x12 */
+	{ 0x26,0x64, 28}, /* 0x43 */  /* Replacement for LCD on 315 for index 1 */
+	{ 0x37,0x64, 40}, /* 0x44 */  /* Replacement for LCD on 315 for index 4 */
+	{ 0xa1,0x42,108}, /* 0x45 */  /* 1280x960 LCD */
+	{ 0x37,0x61,100}, /* 0x46 */  /* 1280x960 LCD */
 	{ 0x78,0x27,108}, /* 0x47 */
 	{ 0x97,0x2c, 26}, /* 0x48 */  /* UNUSED - Entries from here new, not in any BIOS */
 	{ 0xce,0x3c, 39}, /* 0x49 */  /* UNUSED */
@@ -1210,74 +816,19 @@
 	{ 0x6a,0xc6, 37}, /* 0x56 */  /* 848x480-75 - TEMP, UNUSED */
 	{ 0xbf,0xc8, 35}, /* 0x57 */  /* 856x480-38i,60  */
 	{ 0x30,0x23, 88}, /* 0x58 */  /* 1360x768-62 (is 60Hz!) TEMP, UNUSED */
-	{ 0x52,0x07,149}, /* 0x59 */  /* 1280x960-85  - UNUSED */
-	{ 0x56,0x07,156}  /* 0x5a */  /* 1400x1050-75 - UNUSED */
+	{ 0x52,0x07,149}, /* 0x59 */  /* 1280x960-85  */
+	{ 0x56,0x07,156}, /* 0x5a */  /* 1400x1050-75 */
+   	{ 0x70,0x29, 81}  /* 0x5b */  /* 1280x768 LCD */
 };
 
-static const UCHAR SiS310_ScreenOffset[] = 
+static const UCHAR SiS310_ScreenOffset[] =
 {
         0x14,0x19,0x20,0x28,0x32,0x40,0x50,0x64,
-	0x78,0x80,0x2d,0x35,0x57,0x48,0x55,
+	0x78,0x80,0x2d,0x35,0x57,0x48,0x55,0x30,
 	0xff
-};      /* TW: Added 1400x1050, 1152x864, 848/856x480, 1360x768 */
-
-typedef struct _SiS310_StResInfoStruct
-{
-	USHORT HTotal;
-	USHORT VTotal;
-} SiS310_StResInfoStruct;
-
-static const SiS310_StResInfoStruct SiS310_StResInfo[]=
-{
-	{ 640,400},
-	{ 640,350},
-	{ 720,400},
-	{ 720,350},
-	{ 640,480}
-};
-
-typedef struct _SiS310_ModeResInfoStruct
-{
-	USHORT HTotal;
-	USHORT VTotal;
-	UCHAR  XChar;
-	UCHAR  YChar;
-} SiS310_ModeResInfoStruct;
-
-static const SiS310_ModeResInfoStruct SiS310_ModeResInfo[] =
-{
-	{  320, 200, 8, 8},   /* 0x00 */
-	{  320, 240, 8, 8},   /* 0x01 */
-	{  320, 400, 8, 8},   /* 0x02 */
-	{  400, 300, 8, 8},   /* 0x03 */
-	{  512, 384, 8, 8},   /* 0x04 */
-	{  640, 400, 8,16},   /* 0x05 */
-	{  640, 480, 8,16},   /* 0x06 */
-	{  800, 600, 8,16},   /* 0x07 */
-	{ 1024, 768, 8,16},   /* 0x08 */
-	{ 1280,1024, 8,16},   /* 0x09 */
-	{ 1600,1200, 8,16},   /* 0x0a */
-	{ 1920,1440, 8,16},   /* 0x0b */
-	{ 2048,1536, 8,16},   /* 0x0c */
-	{  720, 480, 8,16},   /* 0x0d */
-	{  720, 576, 8,16},   /* 0x0e */
-	{ 1280, 960, 8,16},   /* 0x0f */
-	{  800, 480, 8,16},   /* 0x10 */
-	{ 1024, 576, 8,16},   /* 0x11 */
-	{ 1280, 720, 8,16},   /* 0x12 */
-	{  856, 480, 8,16},   /* 0x13 - TW: New, not in any BIOS */
-	{ 1280, 768, 8,16},   /* 0x14 20; TW: New */
-	{ 1400,1050, 8,16},   /* 0x15 21; TW: New */
-	{ 1152, 864, 8,16},   /* 0x16 - TW: New, not in any BIOS */
-	{  848, 480, 8,16},   /* 0x17 - TW: New, not in any BIOS */
-	{ 1360, 768, 8,16}    /* 0x18 - TW: New, not in any BIOS */
 };
 
-static const UCHAR SiS310_OutputSelect = 0x40;
-
-static const UCHAR SiS310_SoftSetting  = 0x30;   /* TW: RAM setting */
-
-static const UCHAR SiS310_SR15[8][4]={
+static const DRAM4Type SiS310_SR15[8] = {
 	{0x00,0x04,0x60,0x60},
 	{0x0f,0x0f,0x0f,0x0f},
 	{0xba,0xba,0xba,0xba},
@@ -1292,7 +843,7 @@
 
 static UCHAR SiS310_SR07 = 0x18;
 
-static const UCHAR SiS310_CR40[5][4]={
+static const DRAM4Type SiS310_CR40[5] = {
 	{0x77,0x77,0x33,0x33},
 	{0x77,0x77,0x33,0x33},
 	{0x00,0x00,0x00,0x00},
@@ -1322,15 +873,54 @@
 static const USHORT SiS310_YCSenseData2    = 0x016b;
 #endif
 
-static const UCHAR SiS310_NTSCPhase[]    = {0x21,0xed,0xba,0x08};  /* TW: Was {0x21,0xed,0x8a,0x08}; */
-static const UCHAR SiS310_PALPhase[]     = {0x2a,0x05,0xe3,0x00};  /* TW: Was {0x2a,0x05,0xd3,0x00}; */
-static const UCHAR SiS310_PALMPhase[]    = {0x21,0xE4,0x2E,0x9B};  /* TW: palm*/
-static const UCHAR SiS310_PALNPhase[]    = {0x21,0xF4,0x3E,0xBA};  /* TW: paln*/
-static const UCHAR SiS310_NTSCPhase2[]   = {0x21,0xF0,0x7B,0xD6};
-static const UCHAR SiS310_PALPhase2[]    = {0x2a,0x09,0x86,0xe9};
-static const UCHAR SiS310_PALMPhase2[]   = {0x21,0xE6,0xEF,0xA4};  /* TW: palm 301b*/
-static const UCHAR SiS310_PALNPhase2[]   = {0x21,0xF6,0x94,0x46};  /* TW: paln 301b*/
-static const UCHAR SiS310_SpecialPhase[] = {0x1e,0x8c,0x5c,0x7a};
+typedef struct _SiS310_PanelDelayTblStruct
+{
+ 	UCHAR timer[2];
+} SiS310_PanelDelayTblStruct;
+
+static const SiS310_PanelDelayTblStruct SiS310_PanelDelayTbl[]=
+{
+        {{0x10,0x40}},
+	{{0x10,0x40}},
+	{{0x10,0x40}},
+	{{0x10,0x40}},
+	{{0x10,0x40}},
+	{{0x10,0x40}},
+	{{0x10,0x40}},
+	{{0x10,0x40}},
+	{{0x10,0x40}},
+	{{0x10,0x40}},
+	{{0x10,0x40}},
+	{{0x10,0x40}},
+	{{0x10,0x40}},
+	{{0x10,0x40}},
+	{{0x10,0x40}},
+	{{0x10,0x40}}
+};
+
+static const SiS310_PanelDelayTblStruct SiS310_PanelDelayTblLVDS[]=
+{
+	{{0x28,0xc8}},
+	{{0x28,0xc8}},
+	{{0x28,0xc8}},
+	{{0x28,0xc8}},
+	{{0x28,0xc8}},
+	{{0x28,0xc8}},
+	{{0x28,0xc8}},
+	{{0x28,0xc8}},
+	{{0x28,0xc8}},
+	{{0x28,0xc8}},
+	{{0x28,0xc8}},
+	{{0x28,0xc8}},
+	{{0x28,0xc8}},
+	{{0x28,0xc8}},
+	{{0x28,0xc8}},
+	{{0x28,0xc8}}
+};
+
+/**************************************************************/
+/* SIS VIDEO BRIDGE ----------------------------------------- */
+/**************************************************************/
 
 typedef struct _SiS310_LCDDataStruct
 {
@@ -1353,25 +943,6 @@
 	{    1,   1,1344, 806,1344, 806}
 };
 
-#if 0   /* Seems out-dated, all BIOSes since 03/27/2002 have the other version */
-static const SiS310_LCDDataStruct  SiS310_ExtLCD1024x768Data[] = 
-{
-	{   12,   5, 896, 512,1344, 806},
-	{   12,   5, 896, 510,1344, 806},
-	{   32,  15,1008, 505,1344, 806},
-	{   32,  15,1008, 514,1344, 806},
-	{   12,   5, 896, 500,1344, 806},
-	{   42,  25,1024, 625,1344, 806},
-	{    1,   1,1344, 806,1344, 806},
-	{   12,   5, 896, 500,1344, 806},
-	{   42,  25,1024, 625,1344, 806},
-	{    1,   1,1344, 806,1344, 806},
-	{   12,   5, 896, 500,1344, 806},
-	{   42,  25,1024, 625,1344, 806},
-	{    1,   1,1344, 806,1344, 806}
-};
-#endif
-
 static const SiS310_LCDDataStruct  SiS310_ExtLCD1024x768Data[] =   
 {
 	{   42,  25,1536, 419,1344, 806},
@@ -1413,7 +984,7 @@
 	{    1,   1,1688,1066,1688,1066}
 };
 
-static const SiS310_LCDDataStruct  SiS310_ExtLCD1280x1024Data[] = 
+static const SiS310_LCDDataStruct  SiS310_ExtLCD1280x1024Data[] =
 {
 	{  211,  60,1024, 501,1688,1066},
 	{  211,  60,1024, 508,1688,1066},
@@ -1450,7 +1021,7 @@
 	{    1,   1,1344, 806,1344, 806}
 };
 
-static const SiS310_LCDDataStruct  SiS310_NoScaleData1280x1024[] =  
+static const SiS310_LCDDataStruct  SiS310_NoScaleData1280x1024[] =
 {
         {    1,   1,1688,1066,1688,1066},
 	{    1,   1,1688,1066,1688,1066},
@@ -1463,829 +1034,796 @@
 	{    1,   1,1688,1066,1688,1066}
 };
 
-static const SiS310_LCDDataStruct  SiS310_LCD1280x960Data[] =
+typedef struct _SiS310_Part2PortTblStruct
 {
-	{    9,   2, 800, 500,1800,1000},
-	{    9,   2, 800, 500,1800,1000},
-	{    4,   1, 900, 500,1800,1000},
-	{    4,   1, 900, 500,1800,1000},
-	{    9,   2, 800, 500,1800,1000},
-	{   30,  11,1056, 625,1800,1000},
-	{    5,   3,1350, 800,1800,1000},
-	{    1,   1,1576,1050,1576,1050},
-	{    1,   1,1800,1000,1800,1000}
-};
-
-static const SiS310_LCDDataStruct  SiS310_StLCD1400x1050Data[] = 
-{  /* TW: New from 1.11.6s */
-	{ 211,  100, 2100,  408, 1688, 1066 },
-	{ 211,   64, 1536,  358, 1688, 1066 },
-	{ 211,  100, 2100,  408, 1688, 1066 },
-	{ 211,   64, 1536,  358, 1688, 1066 },
-	{ 211,   48,  840,  488, 1688, 1066 },
-	{ 211,   72, 1008,  609, 1688, 1066 },
-	{ 211,  128, 1400,  776, 1688, 1066 },
-	{ 211,  205, 1680, 1041, 1688, 1066 },
-	{   1,    1, 1688, 1066, 1688, 1066 }
-};
-
-static const SiS310_LCDDataStruct  SiS310_ExtLCD1400x1050Data[] = 
-{  /* TW: New from 1.11.6s */
-	{ 211,  100, 2100,  408, 1688, 1066 },
-	{ 211,   64, 1536,  358, 1688, 1066 },
-	{ 211,  100, 2100,  408, 1688, 1066 },
-	{ 211,   64, 1536,  358, 1688, 1066 },
-	{ 211,   48,  840,  488, 1688, 1066 },
-	{ 211,   72, 1008,  609, 1688, 1066 },
-	{ 211,  128, 1400,  776, 1688, 1066 },
-	{ 211,  205, 1680, 1041, 1688, 1066 },
-	{   1,    1, 1688, 1066, 1688, 1066 }
-};
-
-static const SiS310_LCDDataStruct  SiS310_NoScaleData1400x1050[] = 
-{  /* TW: To be checked (BIOS uses 1280x1024 data, one line too short) */
-	{ 1, 1, 1688, 1066, 1688, 1066 },
-	{ 1, 1, 1688, 1066, 1688, 1066 },
-	{ 1, 1, 1688, 1066, 1688, 1066 },
-	{ 1, 1, 1688, 1066, 1688, 1066 },
-	{ 1, 1, 1688, 1066, 1688, 1066 },
-	{ 1, 1, 1688, 1066, 1688, 1066 },
-	{ 1, 1, 1688, 1066, 1688, 1066 },
-	{ 1, 1, 1688, 1066, 1688, 1066 },
-	{ 1, 1, 1688, 1066, 1688, 1066 }
-};
-
-static const SiS310_LCDDataStruct  SiS310_StLCD1600x1200Data[] = 
-{  /* TODO */
-	{    0,   0,   0,   0,   0,   0}
-};
-
-static const SiS310_LCDDataStruct  SiS310_ExtLCD1600x1200Data[] = 
-{  /* TODO */
-	{    0,   0,   0,   0,   0,   0}
-};
-
-static const SiS310_LCDDataStruct  SiS310_NoScaleData1600x1200[] = 
-{  /* TODO */
-	{    0,   0,   0,   0,   0,   0}
-};
+ 	UCHAR CR[12];
+} SiS310_Part2PortTblStruct;
 
-typedef struct _SiS310_TVDataStruct
+static const SiS310_Part2PortTblStruct SiS310_CRT2Part2_1024x768_1[] =
 {
-	USHORT RVBHCMAX;
-	USHORT RVBHCFACT;
-	USHORT VGAHT;
-	USHORT VGAVT;
-	USHORT TVHDE;
-	USHORT TVVDE;
-	USHORT RVBHRS;
-	UCHAR FlickerMode;
-	USHORT HALFRVBHRS;
-	UCHAR RY1COE;
-	UCHAR RY2COE;
-	UCHAR RY3COE;
-	UCHAR RY4COE;
-} SiS310_TVDataStruct;
-
-static const SiS310_TVDataStruct  SiS310_StPALData[]=
-{
- {    1,   1, 864, 525,1270, 400, 100,   0, 760,0xf4,0xff,0x1c,0x22},
- {    1,   1, 864, 525,1270, 350, 100,   0, 760,0xf4,0xff,0x1c,0x22},
- {    1,   1, 864, 525,1270, 400,   0,   0, 720,0xf1,0x04,0x1f,0x18},
- {    1,   1, 864, 525,1270, 350,   0,   0, 720,0xf4,0x0b,0x1c,0x0a},
- {    1,   1, 864, 525,1270, 480,  50,   0, 760,0xf4,0xff,0x1c,0x22},
- {    1,   1, 864, 525,1270, 600,  50,   0,   0,0xf4,0xff,0x1c,0x22}
-};
-
-static const SiS310_TVDataStruct  SiS310_ExtPALData[] =   
-{
- {   27,  10, 848, 448,1270, 530,  50,   0,  50,0xf4,0xff,0x1c,0x22},
- {  108,  35, 848, 398,1270, 530,  50,   0,  50,0xf4,0xff,0x1c,0x22},
- {   12,   5, 954, 448,1270, 530,  50,   0,  50,0xf1,0x04,0x1f,0x18},
- {    9,   4, 960, 463,1644, 438,  50,   0,  50,0xf4,0x0b,0x1c,0x0a},
- {    9,   4, 848, 528,1270, 530,   0,   0,  50,0xf5,0xfb,0x1b,0x2a},  /* 640x480 */
- {   36,  25,1060, 648,1316, 530, 438,   0, 438,0xeb,0x05,0x25,0x16},  /* 800x600 */
- {    3,   2,1080, 619,1270, 540, 438,   0, 438,0xf3,0x00,0x1d,0x20},  /* 720x480/576 */
- {    1,   1,1170, 821,1270, 520, 686,   0, 686,0xF3,0x00,0x1D,0x20}   /* 1024x768 */
-};
-
-static const SiS310_TVDataStruct  SiS310_StNTSCData[]=
-{
- {    1,   1, 858, 525,1270, 400,  50,   0, 760,0xf1,0x04,0x1f,0x18},
- {    1,   1, 858, 525,1270, 350,  50,   0, 640,0xf1,0x04,0x1f,0x18},
- {    1,   1, 858, 525,1270, 400,   0,   0, 720,0xf1,0x04,0x1f,0x18},
- {    1,   1, 858, 525,1270, 350,   0,   0, 720,0xf4,0x0b,0x1c,0x0a},
- {    1,   1, 858, 525,1270, 480,   0,   0, 760,0xf1,0x04,0x1f,0x18}
-};
-
-static const SiS310_TVDataStruct  SiS310_ExtNTSCData[]=
-{
- {  143,  65, 858, 443,1270, 440, 171,   0, 171,0xf1,0x04,0x1f,0x18},
- {   88,  35, 858, 393,1270, 440, 171,   0, 171,0xf1,0x04,0x1f,0x18},
- {  143,  70, 924, 443,1270, 440,  92,   0,  92,0xf1,0x04,0x1f,0x18},
- {  143,  70, 924, 393,1270, 440,  92,   0,  92,0xf4,0x0b,0x1c,0x0a},
- {  143,  76, 836, 523,1270, 440, 224,   0,   0,0xf1,0x05,0x1f,0x16},  /* 640x480 */
- {  143, 120,1056, 643,1270, 440,   0, 128,   0,0xf4,0x10,0x1c,0x00},  /* 800x600  */
- {    2,   1, 858, 503,1270, 480,   0, 128,   0,0xee,0x0c,0x22,0x08},  /* 720x480/576 */
- {   65,  64,1056, 791,1270, 480, 638,   0,   0,0xEE,0x0C,0x22,0x08}   /* 1024x768 */
+ {{0x25,0x12,0xc9,0xdc,0xb6,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}},
+ {{0x2c,0x12,0x9a,0xae,0x88,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}},
+ {{0x25,0x12,0xc9,0xdc,0xb6,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}},
+ {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {{0x38,0x13,0x16,0x0c,0xe6,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}},
+ {{0x38,0x18,0x16,0x00,0x00,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}},
+ {{0x36,0x13,0x13,0x25,0xff,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}},
+ {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {{0x25,0x12,0xc9,0xdc,0xb6,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}}
 };
 
-#if 0
-static const SiS310_TVDataStruct  SiS310_St1HiTVData[]=
+static const SiS310_Part2PortTblStruct SiS310_CRT2Part2_1024x768_2[] =
 {
-  
+ {{0x25,0x12,0x51,0x6e,0x48,0x99,0x35,0x89,0x47,0xc1,0x49,0x33}},
+ {{0x2c,0x12,0x38,0x55,0x2f,0x99,0x35,0x89,0x47,0xc1,0x49,0x33}},
+ {{0x25,0x12,0x51,0x6e,0x48,0x99,0x35,0x89,0x47,0xc1,0x49,0x33}},
+ {{0x2c,0x12,0x38,0x55,0x2f,0xc1,0x35,0xb1,0x47,0xe9,0x71,0x33}},
+ {{0x2d,0x12,0x79,0x96,0x70,0x99,0x35,0x89,0x47,0xc1,0x49,0x33}},
+ {{0x29,0x12,0xb5,0xd2,0xac,0xe9,0x35,0xd9,0x47,0x11,0x99,0x33}},
+ {{0x36,0x13,0x13,0x25,0xff,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}},  /* others  */
+/* 0x36,0x13,0x02,0x25,0xff,0x03,0x45,0x09,0x07,0xf9,0x00,0x24        my      */
+ {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}
 };
-#endif
 
-static const SiS310_TVDataStruct  SiS310_St2HiTVData[]=
+static const SiS310_Part2PortTblStruct SiS310_CRT2Part2_1024x768_3[] =
 {
- {    3,   1, 0x348,0x1e3,0x670,0x3c0,0x032,  0, 0, 0x00,0x00,0x00,0x00},
- {    1,   1, 0x37c,0x233,0x2b2,0x2bc, 	  0,  0, 0, 0x00,0x00,0x00,0x00},
- {    3,   1, 0x348,0x1e3,0x670,0x3c0,0x032,  0, 0, 0x00,0x00,0x00,0x00},
- {    1,   1, 0x3e8,0x233,0x311,0x2bc,    0,  0, 0, 0x00,0x00,0x00,0x00},
- {    5,   2, 0x348,0x233,0x670,0x3c0,0x08d,128, 0, 0x00,0x00,0x00,0x00},
- {    8,   5, 0x41a,0x2ab,0x670,0x3c0,0x17c,128, 0, 0x00,0x00,0x00,0x00}
-};
-
-static const SiS310_TVDataStruct  SiS310_ExtHiTVData[]=
-{
- {    6,   1, 0x348,0x233,0x660,0x3c0,    0,  0, 0, 0x00,0x00,0x00,0x00},
- {    3,   1, 0x3c0,0x233,0x660,0x3c0,    0,  0, 0, 0x00,0x00,0x00,0x00},
- {    3,   1, 0x348,0x1e3,0x660,0x3c0,    0,  0, 0, 0x00,0x00,0x00,0x00},
- {    3,   1, 0x3c0,0x233,0x660,0x3c0,    0,  0, 0, 0x00,0x00,0x00,0x00},
- {    5,   1, 0x348,0x233,0x670,0x3c0,0x166,128, 0, 0x00,0x00,0x00,0x00},
- {   16,   5, 0x41a,0x2ab,0x670,0x3c0,0x143,128, 0, 0x00,0x00,0x00,0x00},
- {   25,  12, 0x4ec,0x353,0x670,0x3c0,0x032,  0, 0, 0x00,0x00,0x00,0x00},
- {    5,   4, 0x627,0x464,0x670,0x3c0,0x128,  0, 0, 0x00,0x00,0x00,0x00},
- {    4,   1, 0x41a,0x233,0x670,0x3c0,0x143,128, 0, 0x00,0x00,0x00,0x00},
- {    5,   2, 0x578,0x293,0x670,0x3c0,0x032,  0, 0, 0x00,0x00,0x00,0x00},
- {    8,   5, 0x6d6,0x323,0x670,0x3c0,0x128,  0, 0, 0x00,0x00,0x00,0x00}
-};
-
-static const UCHAR SiS310_NTSCTiming[] = { 
-	0x17,0x1d,0x03,0x09,0x05,0x06,0x0c,0x0c,
-	0x94,0x49,0x01,0x0a,0x06,0x0d,0x04,0x0a,
-	0x06,0x14,0x0d,0x04,0x0a,0x00,0x85,0x1b,
-	0x0c,0x50,0x00,0x97,0x00,0xda,0x4a,0x17,
-	0x7d,0x05,0x4b,0x00,0x00,0xe2,0x00,0x02,
-	0x03,0x0a,0x65,0x9d,0x08,0x92,0x8f,0x40,
-	0x60,0x80,0x14,0x90,0x8c,0x60,0x14,0x50,
-	0x00,0x40,0x44,0x00,0xdb,0x02,0x3b,0x00
-};
-
-static const UCHAR SiS310_PALTiming[] = {  
-	0x19,0x52,0x35,0x6e,0x04,0x38,0x3d,0x70,
-	0x94,0x49,0x01,0x12,0x06,0x3e,0x35,0x6d,
-	0x06,0x14,0x3e,0x35,0x6d,0x00,0x45,0x2b,
-	0x70,0x50,0x00,0x9b,0x00,0xd9,0x5d,0x17,
-	0x7d,0x05,0x45,0x00,0x00,0xe8,0x00,0x02,
-	0x0d,0x00,0x68,0xb0,0x0b,0x92,0x8f,0x40,
-	0x60,0x80,0x14,0x90,0x8c,0x60,0x14,0x63,
-	0x00,0x40,0x3e,0x00,0xe1,0x02,0x28,0x00
-};
-
-static const UCHAR SiS310_HiTVExtTiming[] = {  
-        0x32,0x65,0x2c,0x5f,0x08,0x31,0x3a,0x64,
-	0x28,0x02,0x01,0x3d,0x06,0x3e,0x35,0x6d,
-	0x06,0x14,0x3e,0x35,0x6d,0x00,0xc5,0x3f,
-	0x64,0x90,0x33,0x8c,0x18,0x36,0x3e,0x13,
-	0x2a,0xde,0x2a,0x44,0x40,0x2a,0x44,0x40,
-	0x8e,0x8e,0x82,0x07,0x0b,0x92,0x0f,0x40,
-	0x60,0x80,0x14,0x90,0x8c,0x60,0x14,0x3d,
-	0x63,0x4f,0x27,0x00,0xfc,0xff,0x6a,0x00
-};
-
-static const UCHAR SiS310_HiTVSt1Timing[] = {  
-        0x32,0x65,0x2c,0x5f,0x08,0x31,0x3a,0x65,
-	0x28,0x02,0x01,0x3d,0x06,0x3e,0x35,0x6d,
-	0x06,0x14,0x3e,0x35,0x6d,0x00,0xc5,0x3f,
-	0x65,0x90,0x7b,0xa8,0x03,0xf0,0x87,0x03,
-	0x11,0x15,0x11,0xcf,0x10,0x11,0xcf,0x10,
-	0x35,0x35,0x3b,0x69,0x1d,0x92,0x0f,0x40,
-	0x60,0x80,0x14,0x90,0x8c,0x60,0x04,0x86,
-	0xaf,0x5d,0x0e,0x00,0xfc,0xff,0x2d,0x00
-};
-
-static const UCHAR SiS310_HiTVSt2Timing[] = {  
-        0x32,0x65,0x2c,0x5f,0x08,0x31,0x3a,0x64,
-	0x28,0x02,0x01,0x3d,0x06,0x3e,0x35,0x6d,
-	0x06,0x14,0x3e,0x35,0x6d,0x00,0xc5,0x3f,
-	0x64,0x90,0x33,0x8c,0x18,0x36,0x3e,0x13,
-	0x2a,0xde,0x2a,0x44,0x40,0x2a,0x44,0x40,
-	0x8e,0x8e,0x82,0x07,0x0b,0x92,0x0f,0x40,
-	0x60,0x80,0x14,0x90,0x8c,0x60,0x14,0x3d,
-	0x63,0x4f,0x27,0x00,0xfc,0xff,0x6a,0x00
-};
-
-static const UCHAR SiS310_HiTVTextTiming[] = {  
-        0x32,0x65,0x2c,0x5f,0x08,0x31,0x3a,0x65,
-	0x28,0x02,0x01,0x3d,0x06,0x3e,0x35,0x6d,
-	0x06,0x14,0x3e,0x35,0x6d,0x00,0xc5,0x3f,
-	0x65,0x90,0xe7,0xbc,0x03,0x0c,0x97,0x03,
-	0x14,0x78,0x14,0x08,0x20,0x14,0x08,0x20,
-	0xc8,0xc8,0x3b,0xd2,0x26,0x92,0x0f,0x40,
-        0x60,0x80,0x14,0x90,0x8c,0x60,0x04,0x96,
-	0x72,0x5c,0x11,0x00,0xfc,0xff,0x32,0x00
-};
-
-static const UCHAR SiS310_HiTVGroup3Data[] = {  
-        0x00,0x1a,0x22,0x63,0x62,0x22,0x08,0x5f,
-	0x05,0x21,0xb2,0xb2,0x55,0x77,0x2a,0xa6,
-	0x25,0x2f,0x47,0xfa,0xc8,0xff,0x8e,0x20,
-	0x8c,0x6e,0x60,0x2e,0x58,0x48,0x72,0x44,
-	0x56,0x36,0x4f,0x6e,0x3f,0x80,0x00,0x80,
-	0x4f,0x7f,0x03,0xa8,0x7d,0x20,0x1a,0xa9,
-	0x14,0x05,0x03,0x7e,0x64,0x31,0x14,0x75,
-	0x18,0x05,0x18,0x05,0x4c,0xa8,0x01
-};
-
-static const UCHAR SiS310_HiTVGroup3Simu[] = {  
-        0x00,0x1a,0x22,0x63,0x62,0x22,0x08,0x95,
-	0xdb,0x20,0xb8,0xb8,0x55,0x47,0x2a,0xa6,
-	0x25,0x2f,0x47,0xfa,0xc8,0xff,0x8e,0x20,
-	0x8c,0x6e,0x60,0x15,0x26,0xd3,0xe4,0x11,
-	0x56,0x36,0x4f,0x6e,0x3f,0x80,0x00,0x80,
-	0x67,0x36,0x01,0x47,0x0e,0x10,0xbe,0xb4,
-	0x01,0x05,0x03,0x7e,0x65,0x31,0x14,0x75,
-	0x18,0x05,0x18,0x05,0x4c,0xa8,0x01
-};
-
-static const UCHAR SiS310_HiTVGroup3Text[] = {  
-        0x00,0x1a,0x22,0x63,0x62,0x22,0x08,0xa7,
-	0xf5,0x20,0xce,0xce,0x55,0x47,0x2a,0xa6,
-	0x25,0x2f,0x47,0xfa,0xc8,0xff,0x8e,0x20,
-	0x8c,0x6e,0x60,0x18,0x2c,0x0c,0x20,0x22,
-	0x56,0x36,0x4f,0x6e,0x3f,0x80,0x00,0x80,
-	0x93,0x3c,0x01,0x50,0x2f,0x10,0xf4,0xca,
-	0x01,0x05,0x03,0x7e,0x65,0x31,0x14,0x75,
-	0x18,0x05,0x18,0x05,0x4c,0xa8,0x01
+#if 1   /* Data from 650/301LVx 1.10.6s and others */
+ {{0x25,0x13,0xc9,0x25,0xff,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}},
+ {{0x2c,0x13,0x9a,0x25,0xff,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}},
+ {{0x25,0x13,0xc9,0x24,0xff,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}},
+ {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {{0x38,0x13,0x13,0x25,0xff,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}},
+ {{0x38,0x18,0x16,0x00,0x00,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}},
+ {{0x36,0x13,0x13,0x25,0xff,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}},
+ {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {{0x25,0x13,0xc9,0x25,0xff,0xf9,0x45,0x09,0x07,0xf9,0x09,0x24}}
+#endif
+#if 0    /* Data from my 301LV */
+ {{0x36,0x13,0x02,0x25,0xff,0x21,0x45,0x09,0x07,0x88,0x09,0x24}},   /* TEST */
+ {{0x36,0x13,0x02,0x25,0xff,0x21,0x45,0x09,0x07,0x88,0x09,0x24}},
+ {{0x36,0x13,0x02,0x25,0xff,0x21,0x45,0x09,0x07,0x88,0x09,0x24}},
+ {{0x36,0x13,0x02,0x25,0xff,0x21,0x45,0x09,0x07,0x88,0x09,0x24}},
+ {{0x36,0x13,0x02,0x25,0xff,0x21,0x45,0x09,0x07,0x88,0x09,0x24}},
+ {{0x36,0x13,0x02,0x25,0xff,0x21,0x45,0x09,0x07,0x88,0x09,0x24}},
+ {{0x36,0x13,0x02,0x25,0xff,0x21,0x45,0x09,0x07,0x88,0x09,0x24}},
+ {{0x36,0x13,0x02,0x25,0xff,0x21,0x45,0x09,0x07,0x88,0x09,0x24}},
+ {{0x36,0x13,0x02,0x25,0xff,0x21,0x45,0x09,0x07,0x88,0x09,0x24}}
+#endif
 };
 
-typedef struct _SiS310_PanelDelayTblStruct
-{
- 	UCHAR timer[2];
-} SiS310_PanelDelayTblStruct;
+static const SiS310_Part2PortTblStruct SiS310_CRT2Part2_1280x1024_1[] =
+{ /* Acer; BIOS data invalid, last row taken from _3 */
+ {{0x25,0x12,0x51,0x6E,0x48,0x99,0x35,0x89,0x47,0xC1,0x49,0x33}},
+ {{0x2C,0x12,0x38,0x55,0x2F,0x99,0x35,0x89,0x47,0xC1,0x49,0x33}},
+ {{0x25,0x12,0x51,0x6E,0x48,0x99,0x35,0x89,0x47,0xC1,0x49,0x33}},
+ {{0x2C,0x12,0x38,0x55,0x2F,0xC1,0x35,0xB1,0x47,0xE9,0x71,0x33}},
+ {{0x2D,0x12,0x79,0x96,0x70,0x99,0x35,0x89,0x47,0xC1,0x49,0x33}},
+ {{0x29,0x12,0xB5,0xD2,0xAC,0xE9,0x35,0xD9,0x47,0x11,0x99,0x33}},
+ {{0x36,0x13,0x02,0x25,0xFF,0x03,0x45,0x09,0x07,0xF9,0x00,0x24}},
+ {{0x47,0x1C,0x14,0x29,0xFF,0xBD,0x23,0x0A,0x07,0x23,0x8A,0x12}}
+};
 
-static const SiS310_PanelDelayTblStruct SiS310_PanelDelayTbl[]=  
-{
-        {{0x10,0x40}},		/* TW: from 650/301LVx 1.10.6s BIOS */
-	{{0x10,0x40}},
-	{{0x10,0x40}},
-	{{0x10,0x40}},
-	{{0x10,0x40}},
-	{{0x10,0x40}},
-	{{0x10,0x40}},
-	{{0x10,0x40}},
-	{{0x10,0x40}},
-	{{0x10,0x40}},
-	{{0x10,0x40}},
-	{{0x10,0x40}},
-	{{0x10,0x40}},
-	{{0x10,0x40}},
-	{{0x10,0x40}},
-	{{0x10,0x40}}
-#if 0
-	{{0x28,0xc8}},		/* TW: from 650/301LV BIOS */
-	{{0x28,0xc8}},
-	{{0x28,0xc8}},
-	{{0x28,0xc8}},
-	{{0x28,0xc8}},
-	{{0x28,0xc8}},
-	{{0x28,0xc8}},
-	{{0x28,0xc8}},
-	{{0x28,0xc8}},
-	{{0x28,0xc8}},
-	{{0x28,0xc8}},
-	{{0x28,0xc8}},
-	{{0x28,0xc8}},
-	{{0x28,0xc8}},
-	{{0x28,0xc8}},
-	{{0x28,0xc8}}
-#endif
+static const SiS310_Part2PortTblStruct SiS310_CRT2Part2_1280x1024_2[] =
+{ /* Acer */
+ {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}
 };
 
-static const SiS310_PanelDelayTblStruct SiS310_PanelDelayTblLVDS[]=
-{
-	{{0x28,0xc8}},
-	{{0x28,0xc8}},
-	{{0x28,0xc8}},
-	{{0x28,0xc8}},
-	{{0x28,0xc8}},
-	{{0x28,0xc8}},
-	{{0x28,0xc8}},
-	{{0x28,0xc8}},
-	{{0x28,0xc8}},
-	{{0x28,0xc8}},
-	{{0x28,0xc8}},
-	{{0x28,0xc8}},
-	{{0x28,0xc8}},
-	{{0x28,0xc8}},
-	{{0x28,0xc8}},
-	{{0x28,0xc8}}
+/*   1     2    4    5    6   1c   1d   1f   20   21   23   25   */
+static const SiS310_Part2PortTblStruct SiS310_CRT2Part2_1280x1024_3[] =
+{ /* Acer */
+ {{0x31,0x1B,0xC4,0xDA,0xB0,0xBD,0x23,0x0A,0x07,0x23,0x8A,0x12}},
+ {{0x34,0x1B,0x9F,0xC0,0x80,0xB8,0x23,0x0A,0x07,0x14,0x8A,0x12}},
+ {{0x3E,0x1B,0xCF,0xF0,0xB0,0xB8,0x23,0x0A,0x07,0x14,0x8A,0x12}},
+ {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {{0x48,0x1C,0x15,0x29,0xFF,0xBD,0x23,0x0A,0x07,0x23,0x8A,0x12}},
+ {{0x48,0x1C,0x15,0x29,0xFF,0xBD,0x23,0x0A,0x07,0x23,0x8A,0x12}},
+ {{0x48,0x1C,0x15,0x29,0xFF,0xBD,0x23,0x0A,0x07,0x23,0x8A,0x12}},
+ {{0x47,0x1C,0x14,0x29,0xFF,0xBD,0x23,0x0A,0x07,0x23,0x8A,0x12}}
 };
 
-typedef struct _SiS310_LVDSDataStruct
+static const SiS310_Part2PortTblStruct SiS310_CRT2Part2_1400x1050_1[] =
 {
-	USHORT VGAHT;
-	USHORT VGAVT;
-	USHORT LCDHT;
-	USHORT LCDVT;
-} SiS310_LVDSDataStruct;
+ {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x42}},
+ {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x42}},
+ {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x42}},
+ {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x42}},
+ {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x32}},
+ {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x32}},
+ {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x32}},
+ {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x32}},
+ {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x42}}
+};
 
-static const SiS310_LVDSDataStruct  SiS310_LVDS320x480Data_1[]=
+static const SiS310_Part2PortTblStruct SiS310_CRT2Part2_1400x1050_2[] =
 {
-	{ 848, 433, 400, 525},
-	{ 848, 389, 400, 525},
-	{ 848, 433, 400, 525},
-	{ 848, 389, 400, 525},
-	{ 848, 518, 400, 525},
-	{1056, 628, 400, 525},
-	{ 400, 525, 400, 525},
-	{ 800, 449,1000, 644},
-	{ 800, 525,1000, 635}
-};
-
-static const SiS310_LVDSDataStruct  SiS310_LVDS800x600Data_1[]= 
-{
-	{ 848, 433,1060, 629},
-	{ 848, 389,1060, 629},
-	{ 848, 433,1060, 629},
-	{ 848, 389,1060, 629},
-	{ 848, 518,1060, 629},
-	{1056, 628,1056, 628},
-	{1056, 628,1056, 628},
-	{ 800, 449,1000, 644},
-	{ 800, 525,1000, 635}
-};
-
-static const SiS310_LVDSDataStruct  SiS310_LVDS800x600Data_2[]=  
-{
-	{1056, 628,1056, 628},
-	{1056, 628,1056, 628},
-	{1056, 628,1056, 628},
-	{1056, 628,1056, 628},
-	{1056, 628,1056, 628},
-	{1056, 628,1056, 628},
-	{1056, 628,1056, 628},
-	{ 800, 449,1000, 644},
-	{ 800, 525,1000, 635}
-};
-
-static const SiS310_LVDSDataStruct  SiS310_LVDS1024x768Data_1[]=  
-{
-	{ 840, 438,1344, 806},
-	{ 840, 409,1344, 806},
-	{ 840, 438,1344, 806},
-	{ 840, 409,1344, 806},
-	{ 840, 518,1344, 806},   /* 640x480 */
-	{1050, 638,1344, 806},   /* 800x600 */
-	{1344, 806,1344, 806},   /* 1024x768 */
-	{ 800, 449,1280, 801},
-	{ 800, 525,1280, 813}
-};
-
-static const SiS310_LVDSDataStruct  SiS310_LVDS1024x768Data_2[]= 
-{
-	{1344, 806,1344, 806},
-	{1344, 806,1344, 806},
-	{1344, 806,1344, 806},
-	{1344, 806,1344, 806},
-	{1344, 806,1344, 806},
-	{1344, 806,1344, 806},
-	{1344, 806,1344, 806},
-	{ 800, 449,1280, 801},
-	{ 800, 525,1280, 813}
-};
-
-static const SiS310_LVDSDataStruct  SiS310_LVDS1280x1024Data_1[]=  
-{	
-	{1048, 442,1688,1066},
-	{1048, 392,1688,1066},
-	{1048, 442,1688,1066},
-	{1048, 392,1688,1066},
-	{1048, 522,1688,1066},
-	{1208, 642,1688,1066},
-	{1432, 810,1688,1066},
-	{1688,1066,1688,1066}
-};
-
-static const SiS310_LVDSDataStruct  SiS310_LVDS1280x1024Data_2[]=  
-{	
-	{1688,1066,1688,1066},
-	{1688,1066,1688,1066},
-	{1688,1066,1688,1066},
-	{1688,1066,1688,1066},
-	{1688,1066,1688,1066},
-	{1688,1066,1688,1066},
-	{1688,1066,1688,1066},
-	{1688,1066,1688,1066}
-};
-
-static const SiS310_LVDSDataStruct  SiS310_LVDS1400x1050Data_1[]=  
-{
-        { 928, 416, 1688,1066},
-	{ 928, 366, 1688,1066},
-	{ 928, 416, 1688,1066},
-	{ 928, 366, 1688,1066},
-	{ 928, 496, 1688,1066},
-	{1088, 616, 1688,1066},
-	{1312, 784, 1688,1066},
-	{1568,1040, 1688,1066},
-	{1688,1066, 1688,1066}
-};
-
-static const SiS310_LVDSDataStruct  SiS310_LVDS1400x1050Data_2[]= 
-{
-        {1688,1066, 1688,1066},
-	{1688,1066, 1688,1066},
-	{1688,1066, 1688,1066},
-	{1688,1066, 1688,1066},
-	{1688,1066, 1688,1066},
-	{1688,1066, 1688,1066},
-	{1688,1066, 1688,1066},
-	{1688,1066, 1688,1066},
-	{1688,1066, 1688,1066},
-};
-
-static const SiS310_LVDSDataStruct  SiS310_LVDS1600x1200Data_1[]=  
-{
-        {1088, 450, 2048,1250},
-	{1088, 400, 2048,1250},
-	{1088, 450, 2048,1250},
-	{1088, 400, 2048,1250},
-	{1088, 530, 2048,1250},
-	{1248, 650, 2048,1250},
-	{1472, 818, 2048,1250},
-	{1728,1066, 2048,1250},
-	{1848,1066, 2048,1250},
-	{2048,1250, 2048,1250}
-};
-
-static const SiS310_LVDSDataStruct  SiS310_LVDS1600x1200Data_2[]= 
-{
-        {2048,1250, 2048,1250},
-	{2048,1250, 2048,1250},
-	{2048,1250, 2048,1250},
-	{2048,1250, 2048,1250},
-	{2048,1250, 2048,1250},
-	{2048,1250, 2048,1250},
-	{2048,1250, 2048,1250},
-	{2048,1250, 2048,1250},
-	{2048,1250, 2048,1250},
-	{2048,1250, 2048,1250}
-};
-
-static const SiS310_LVDSDataStruct  SiS310_LVDS1280x768Data_1[]= 
-{	
-	{ 768, 438, 1408, 806},
-	{ 768, 388, 1408, 806},
-	{ 768, 438, 1408, 806},
-	{ 768, 388, 1408, 806},
-	{ 768, 518, 1408, 806},
-	{ 928, 638, 1408, 806},
-	{1152, 806, 1408, 806},
-	{1408, 806, 1408, 806},
-	{1408, 806, 1408, 806}
-};
-
-static const SiS310_LVDSDataStruct  SiS310_LVDS1280x768Data_2[]=  
-{	
-	{1408, 806, 1408, 806},
-	{1408, 806, 1408, 806},
-	{1408, 806, 1408, 806},
-	{1408, 806, 1408, 806},
-	{1408, 806, 1408, 806},
-	{1408, 806, 1408, 806},
-	{1408, 806, 1408, 806},
-	{1408, 806, 1408, 806},
-	{1408, 806, 1408, 806}
-};
-
-static const SiS310_LVDSDataStruct  SiS310_LVDS1024x600Data_1[]=
-{
-	{ 840, 604, 1344, 800},
-	{ 840, 560, 1344, 800},
-	{ 840, 604, 1344, 800},
-	{ 840, 560, 1344, 800},
-	{ 840, 689, 1344, 800},
-	{1050, 800, 1344, 800},
-	{1344, 800, 1344, 800},
-	{ 800, 449, 1280, 801},
-	{ 800, 525, 1280, 813}
-};
-
-static const SiS310_LVDSDataStruct  SiS310_LVDS1024x600Data_2[]=
-{
-	{1344, 800, 1344, 800},
-	{1344, 800, 1344, 800},
-	{1344, 800, 1344, 800},
-	{1344, 800, 1344, 800},
-	{1344, 800, 1344, 800},
-	{1344, 800, 1344, 800},
-	{1344, 800, 1344, 800},
-	{ 800, 449, 1280, 801},
-	{ 800, 525, 1280, 813}
-};
-
-static const SiS310_LVDSDataStruct  SiS310_LVDS1152x768Data_1[]=
-{
-	{ 840, 438, 1344, 806},
-	{ 840, 409, 1344, 806},
-	{ 840, 438, 1344, 806},
-	{ 840, 409, 1344, 806},
-	{ 840, 518, 1344, 806},
-	{1050, 638, 1344, 806},
-	{1344, 806, 1344, 806},
-	{ 800, 449, 1280, 801},
-	{ 800, 525, 1280, 813}
-};
-
-static const SiS310_LVDSDataStruct  SiS310_LVDS1152x768Data_2[]=
-{
-	{1344, 806, 1344, 806},
-	{1344, 806, 1344, 806},
-	{1344, 806, 1344, 806},
-	{1344, 806, 1344, 806},
-	{1344, 806, 1344, 806},
-	{1344, 806, 1344, 806},
-	{1344, 806, 1344, 806},
-	{ 800, 449, 1280, 801},
-	{ 800, 525, 1280, 813}
-};
-
-/* TW: Pass 1:1 data */
-static const SiS310_LVDSDataStruct  SiS310_LVDSXXXxXXXData_1[]=  
-{
-        { 800, 449,  800, 449},
-	{ 800, 449,  800, 449},
-	{ 900, 449,  900, 449},
-	{ 900, 449,  900, 449},
-	{ 800, 525,  800, 525},  /*  640x480   */
-	{1056, 628, 1056, 628},  /*  800x600   */
-	{1344, 806, 1344, 806},  /* 1024x768   */
-	{1344,1066, 1344,1066},  /* 1280x1024  */  /* INSERTED ! */
- 	{1688, 806, 1688, 806},  /* 1280x768 ! */
-	/* No other panels ! */
-};
-
-static const SiS310_LVDSDataStruct  SiS310_LVDS640x480Data_1[]=  
-{
-	{ 800, 449, 800, 449},
-	{ 800, 449, 800, 449},
-	{ 800, 449, 800, 449},
-	{ 800, 449, 800, 449},
-	{ 800, 525, 800, 525},
-	{1056, 628,1056, 628},
-	{1056, 628,1056, 628},
-	{1056, 628,1056, 628},
-	{1056, 628,1056, 628}
-};
-
-static const SiS310_LVDSDataStruct  SiS310_LVDS1280x960Data_1[]=   
-{
-	{ 840, 438,1344, 806},
-	{ 840, 409,1344, 806},
-	{ 840, 438,1344, 806},
-	{ 840, 409,1344, 806},
-	{ 840, 518,1344, 806},
-	{1050, 638,1344, 806},
-	{1344, 806,1344, 806},
-	{ 800, 449,1280, 801},
-	{ 800, 525,1280, 813}
-};
-
-static const SiS310_LVDSDataStruct  SiS310_LVDS1280x960Data_2[]=  
-{
-	{1344, 806,1344, 806},
-	{1344, 806,1344, 806},
-	{1344, 806,1344, 806},
-	{1344, 806,1344, 806},
-	{1344, 806,1344, 806},
-	{1344, 806,1344, 806},
-	{1344, 806,1344, 806},
-	{ 800, 449,1280, 801},
-	{ 800, 525,1280, 813}
-};
-
-/* LCDA */
-
-static const SiS310_LVDSDataStruct  SiS310_LCDA1400x1050Data_1[]=   
-{	/* TW: Might be temporary (invalid) data */
-        { 928, 416, 1688,1066},
-	{ 928, 366, 1688,1066},
-	{1008, 416, 1688,1066},
-	{1008, 366, 1688,1066},
-	{1200, 530, 1688,1066},
-	{1088, 616, 1688,1066},
-	{1312, 784, 1688,1066},
-	{1568,1040, 1688,1066},
-	{1688,1066, 1688,1066}
-};
-
-static const SiS310_LVDSDataStruct  SiS310_LCDA1400x1050Data_2[]=   
-{	/* TW: Temporary data. Not valid */
-	{1344, 806,1344, 806},
-	{1344, 806,1344, 806},
-	{1344, 806,1344, 806},
-	{1344, 806,1344, 806},
-	{1344, 806,1344, 806},
-	{1344, 806,1344, 806},
-	{1344, 806,1344, 806},
-	{ 800, 449,1280, 801},
-	{ 800, 525,1280, 813}
-};
-
-static const SiS310_LVDSDataStruct  SiS310_LCDA1600x1200Data_1[]=  
-{	/* TW: Temporary data. Not valid */
-	{1344, 806,1344, 806},
-	{1344, 806,1344, 806},
-	{1344, 806,1344, 806},
-	{1344, 806,1344, 806},
-	{1344, 806,1344, 806},
-	{1344, 806,1344, 806},
-	{1344, 806,1344, 806},
-	{ 800, 449,1280, 801},
-	{ 800, 525,1280, 813}
-};
-
-static const SiS310_LVDSDataStruct  SiS310_LCDA1600x1200Data_2[]=  
-{	/* TW: Temporary data. Not valid */
-	{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}
+ {{0x2b,0x12,0xd9,0xe5,0xd5,0x2c,0x23,0x98,0x27,0x3e,0x08,0x42}},
+ {{0x22,0x12,0xc0,0xcc,0xbc,0x2c,0x23,0x98,0x27,0x3e,0x08,0x42}},
+ {{0x2b,0x12,0xd9,0xe5,0xd5,0x2c,0x23,0x98,0x27,0x3e,0x08,0x42}},
+ {{0x22,0x12,0xc0,0xcc,0xbc,0x2c,0x23,0x98,0x27,0x3e,0x08,0x42}},
+ {{0x33,0x13,0x01,0x0d,0xfd,0x2c,0x23,0x98,0x27,0x3e,0x08,0x42}},
+ {{0x3f,0x1b,0x3d,0x49,0x39,0x54,0x23,0xc0,0x27,0x66,0x30,0x42}},
+ {{0x33,0x1b,0x91,0x9d,0x8d,0x8c,0x23,0xf8,0x27,0x9e,0x68,0x42}},
+ {{0x43,0x24,0x11,0x1d,0x0d,0xcc,0x23,0x38,0x37,0xde,0xa8,0x42}},
+ {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x42}}
 };
 
-/* Chrontel TV */
+static const SiS310_Part2PortTblStruct SiS310_CRT2Part2_1400x1050_3[] =
+{
+ {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x42}},
+ {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x42}},
+ {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x42}},
+ {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x42}},
+ {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x32}},
+ {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x32}},
+ {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x32}},
+ {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x32}},
+ {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x32}}
+};
 
-static const SiS310_LVDSDataStruct  SiS310_CHTVUNTSCData[]=   
+static const SiS310_Part2PortTblStruct SiS310_CRT2Part2_1600x1200_1[] =
 {
-	{ 840, 600, 840, 600},
-	{ 840, 600, 840, 600},
-	{ 840, 600, 840, 600},
-	{ 840, 600, 840, 600},
-	{ 784, 600, 784, 600},
-	{1064, 750,1064, 750},
-        {1160, 945,1160, 945}           /* TW: For Ch7019 1024 */
+ {{0x4C,0x24,0xC8,0xE1,0xAF,0x70,0x34,0x0A,0x07,0xFC,0x2A,0x53}},
+ {{0x4C,0x24,0xC8,0xE1,0xAF,0x70,0x34,0x0A,0x07,0xFC,0x2A,0x53}},
+ {{0x4C,0x24,0xC8,0xE1,0xAF,0x70,0x34,0x0A,0x07,0xFC,0x2A,0x53}},
+ {{0x4C,0x24,0xC8,0xE1,0xAF,0x70,0x34,0x0A,0x07,0xFC,0x2A,0x53}},
+ {{0x4C,0x24,0xC8,0xE1,0xAF,0x70,0x34,0x0A,0x07,0xFC,0x2A,0x53}},
+ {{0x4C,0x24,0xC8,0xE1,0xAF,0x70,0x34,0x0A,0x07,0xFC,0x2A,0x53}},
+ {{0x4C,0x24,0xC8,0xE1,0xAF,0x70,0x34,0x0A,0x07,0xFC,0x2A,0x53}},
+ {{0x4C,0x24,0xC8,0xE1,0xAF,0x70,0x34,0x0A,0x07,0xFC,0x2A,0x53}},
+ {{0x4C,0x24,0xC8,0xE1,0xAF,0x70,0x34,0x0A,0x07,0xFC,0x2A,0x53}},
+ {{0x4C,0x24,0xC8,0xE1,0xAF,0x70,0x34,0x0A,0x07,0xFC,0x2A,0x53}}
 };
 
-static const SiS310_LVDSDataStruct  SiS310_CHTVONTSCData[]=   
+static const SiS310_Part2PortTblStruct SiS310_CRT2Part2_1600x1200_2[] =
 {
-	{ 840, 525, 840, 525},
-	{ 840, 525, 840, 525},
-	{ 840, 525, 840, 525},
-	{ 840, 525, 840, 525},
-	{ 784, 525, 784, 525},
-	{1040, 700,1040, 700},
-        {1160, 840,1160, 840}          	/* TW: For Ch7019 1024 */
+ {{0x32,0x1B,0x2C,0x52,0x20,0x80,0x20,0x52,0x30,0xA3,0x3A,0x02}},
+ {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {{0x32,0x1B,0x2C,0x52,0x20,0x80,0x20,0x52,0x30,0xA3,0x3A,0x02}},
+ {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {{0x3A,0x1B,0x54,0x7A,0x48,0x80,0x24,0x52,0x30,0xA3,0x3A,0x02}},
+ {{0x36,0x1B,0x90,0xB6,0x84,0xA8,0x24,0x7A,0x30,0xCB,0x62,0x02}},
+ {{0x3A,0x1C,0xE4,0x0A,0xD8,0xE0,0x24,0xB2,0x30,0x03,0x9A,0x02}},
+ {{0x4A,0x24,0x64,0x8A,0x58,0x20,0x34,0xF2,0x30,0x43,0xDA,0x52}},
+ {{0x47,0x24,0x71,0x97,0x65,0x3E,0x34,0x10,0x40,0x61,0xF8,0x02}},
+ {{0x4C,0x24,0xC8,0xE1,0xAF,0x70,0x34,0x0A,0x07,0xFC,0x2A,0x53}}
 };
 
-static const SiS310_LVDSDataStruct  SiS310_CHTVUPALData[]=   
+static const SiS310_Part2PortTblStruct SiS310_CRT2Part2_1600x1200_3[] =
 {
-	{1008, 625,1008, 625},
-	{1008, 625,1008, 625},
-	{1008, 625,1008, 625},
-	{1008, 625,1008, 625},
-	{ 840, 625, 840, 625},
-	{ 960, 750, 960, 750},
-	{1400,1000,1400,1000}   	/*  TW: For Ch7019 1024 */
+ {{0x4C,0x24,0xC8,0xE1,0xAF,0x70,0x34,0x0A,0x07,0xFC,0x2A,0x53}},
+ {{0x4C,0x24,0xC8,0xE1,0xAF,0x70,0x34,0x0A,0x07,0xFC,0x2A,0x53}},
+ {{0x4C,0x24,0xC8,0xE1,0xAF,0x70,0x34,0x0A,0x07,0xFC,0x2A,0x53}},
+ {{0x4C,0x24,0xC8,0xE1,0xAF,0x70,0x34,0x0A,0x07,0xFC,0x2A,0x53}},
+ {{0x4C,0x24,0xC8,0xE1,0xAF,0x70,0x34,0x0A,0x07,0xFC,0x2A,0x53}},
+ {{0x4C,0x24,0xC8,0xE1,0xAF,0x70,0x34,0x0A,0x07,0xFC,0x2A,0x53}},
+ {{0x4C,0x24,0xC8,0xE1,0xAF,0x70,0x34,0x0A,0x07,0xFC,0x2A,0x53}},
+ {{0x4C,0x24,0xC8,0xE1,0xAF,0x70,0x34,0x0A,0x07,0xFC,0x2A,0x53}},
+ {{0x4C,0x24,0xC8,0xE1,0xAF,0x70,0x34,0x0A,0x07,0xFC,0x2A,0x53}},
+ {{0x4C,0x24,0xC8,0xE1,0xAF,0x70,0x34,0x0A,0x07,0xFC,0x2A,0x53}}
 };
 
-static const SiS310_LVDSDataStruct  SiS310_CHTVOPALData[]= 
+/* CRT1 CRTC for LCDA */
+
+typedef struct _SiS310_LCDACRT1DataStruct
 {
-	{1008, 625,1008, 625},
-	{1008, 625,1008, 625},
-	{1008, 625,1008, 625},
-	{1008, 625,1008, 625},
-	{ 840, 625, 840, 625},
-	{ 944, 625, 944, 625},
-        {1400, 875,1400, 875}       	/*  TW: For Ch7019 1024 */
-};
+ 	UCHAR CR[17];
+}SiS310_LCDACRT1DataStruct;
 
-static const SiS310_LVDSDataStruct  SiS310_CHTVUPALMData[]=  
+static const SiS310_LCDACRT1DataStruct  SiS310_LCDACRT11024x768_1[]=
 {
-	{ 840, 600, 840, 600},
-	{ 840, 600, 840, 600},
-	{ 840, 600, 840, 600},
-	{ 840, 600, 840, 600},
-	{ 784, 600, 784, 600},
-	{1064, 750,1064, 750},
-        {1160, 945,1160, 945}           /* TW: For Ch7019 1024 */
+ {{0x73,0x4f,0x4f,0x97,0x59,0x84,0xb4,0x1f,
+   0x92,0x89,0x8f,0x8f,0xb5,0x30,0x00,0x05,
+   0x00}},
+ {{0x73,0x4f,0x4f,0x97,0x59,0x84,0x82,0x1f,
+   0x60,0x87,0x5d,0x5d,0x83,0x10,0x00,0x05,
+   0x00}},
+ {{0x73,0x4f,0x4f,0x97,0x59,0x84,0xb4,0x1f,
+   0x92,0x89,0x8f,0x8f,0xb5,0x30,0x00,0x05,
+   0x00}},
+ {{0x73,0x4f,0x4f,0x97,0x59,0x84,0x82,0x1f,
+   0x60,0x87,0x5d,0x5d,0x83,0x10,0x00,0x05,
+   0x00}},
+ {{0x73,0x4f,0x4f,0x97,0x59,0x84,0x04,0x3e,
+   0xE2,0x89,0xdf,0xdf,0x05,0x00,0x00,0x05,
+   0x00}},
+ {{0x87,0x63,0x63,0x8B,0x6D,0x18,0x7c,0xf0,
+   0x5A,0x81,0x57,0x57,0x7D,0x00,0x00,0x06,
+   0x01}},
+ {{0xA3,0x7f,0x7f,0x87,0x89,0x94,0x24,0xf5,
+   0x02,0x89,0xff,0xff,0x25,0x10,0x00,0x02,
+   0x01}}
 };
 
-static const SiS310_LVDSDataStruct  SiS310_CHTVOPALMData[]=  
+static const SiS310_LCDACRT1DataStruct  SiS310_LCDACRT11024x768_1_H[]=
 {
-	{ 840, 525, 840, 525},
-	{ 840, 525, 840, 525},
-	{ 840, 525, 840, 525},
-	{ 840, 525, 840, 525},
-	{ 784, 525, 784, 525},
-	{1040, 700,1040, 700},
-        {1160, 840,1160, 840}          	/* TW: For Ch7019 1024 */
+ {{0x4b,0x27,0x27,0x8f,0x31,0x1c,0xb4,0x1f,
+   0x92,0x89,0x8f,0x8f,0xb5,0x30,0x00,0x05,
+   0x00}},
+ {{0x4b,0x27,0x27,0x8f,0x31,0x1c,0x82,0x1f,
+   0x60,0x87,0x5D,0x5D,0x83,0x10,0x00,0x05,
+   0x00}},
+ {{0x4b,0x27,0x27,0x8f,0x31,0x1c,0xb4,0x1f,
+   0x92,0x89,0x8f,0x8f,0xb5,0x30,0x00,0x05,
+   0x00}},
+ {{0x4b,0x27,0x27,0x8f,0x31,0x1c,0x82,0x1f,
+   0x60,0x87,0x5D,0x5D,0x83,0x10,0x00,0x05,
+   0x00}},
+ {{0x4b,0x27,0x27,0x8f,0x31,0x1c,0x04,0x3e,
+   0xE2,0x89,0xDf,0xDf,0x05,0x00,0x00,0x05,
+   0x00}},
+ {{0x55,0x31,0x31,0x99,0x3b,0x06,0x7c,0xf0,
+   0x5A,0x81,0x57,0x57,0x7D,0x00,0x00,0x01,
+   0x01}},
+ {{0x63,0x3F,0x3F,0x87,0x49,0x94,0x24,0xF5,
+   0x02,0x89,0xFF,0xFF,0x25,0x10,0x00,0x01,
+   0x01}}
 };
 
-static const SiS310_LVDSDataStruct  SiS310_CHTVUPALNData[]=  
+static const SiS310_LCDACRT1DataStruct  SiS310_LCDACRT11024x768_2[]=
 {
-	{1008, 625,1008, 625},
-	{1008, 625,1008, 625},
-	{1008, 625,1008, 625},
-	{1008, 625,1008, 625},
-	{ 840, 625, 840, 625},
-	{ 960, 750, 960, 750},
-	{1400,1000,1400,1000}   	/*  TW: For Ch7019 1024 */
+ {{0xa3,0x4f,0x4f,0x0f,0x6e,0x1f,0x24,0xbb,
+   0x4a,0x81,0x8f,0xdb,0xda,0x20,0x00,0x06,
+   0x00}},
+ {{0xa3,0x4f,0x4f,0x0f,0x6e,0x1f,0x24,0xbb,
+   0x31,0x88,0x5d,0xc2,0xc1,0x20,0x00,0x06,
+   0x00}},
+ {{0xa3,0x4f,0x4f,0x0f,0x6e,0x1f,0x24,0xbb,
+   0x4a,0x81,0x8f,0xdb,0xda,0x20,0x00,0x06,
+   0x00}},
+ {{0xa3,0x4f,0x4f,0x0f,0x6e,0x1f,0x24,0xbb,
+   0x31,0x88,0x5d,0xc2,0xc1,0x20,0x00,0x06,
+   0x01}},
+ {{0xa3,0x4f,0x4f,0x0f,0x6e,0x1f,0x24,0xb3,
+   0x72,0x89,0xdf,0x03,0x02,0x30,0x00,0x06,
+   0x01}},
+ {{0xa3,0x63,0x63,0x98,0x78,0x19,0x24,0xf1,
+   0xbb,0x82,0x57,0x57,0x25,0x10,0x00,0x02,
+   0x01}},
+ {{0xa3,0x7f,0x7f,0x87,0x89,0x94,0x24,0xf5,
+   0x02,0x89,0xff,0xff,0x25,0x10,0x00,0x02,
+   0x01}}
 };
 
-static const SiS310_LVDSDataStruct  SiS310_CHTVOPALNData[]= 
+static const SiS310_LCDACRT1DataStruct  SiS310_LCDACRT11024x768_2_H[]=
 {
-	{1008, 625,1008, 625},
-	{1008, 625,1008, 625},
-	{1008, 625,1008, 625},
-	{1008, 625,1008, 625},
-	{ 840, 625, 840, 625},
-	{ 944, 625, 944, 625},
-        {1400, 875,1400, 875}       	/*  TW: For Ch7019 1024 */
+ {{0x7b,0x27,0x27,0x0f,0x46,0x97,0x24,0xbb,
+   0x4a,0x81,0x8f,0xdb,0xda,0x20,0x00,0x01,
+   0x00 }},
+ {{0x7b,0x27,0x27,0x0f,0x46,0x97,0x24,0xbb,
+   0x31,0x88,0x5d,0xc2,0xc1,0x20,0x00,0x01,
+   0x00 }},
+ {{0x7b,0x27,0x27,0x0f,0x46,0x97,0x24,0xbb,
+   0x4a,0x81,0x8f,0xdb,0xda,0x20,0x00,0x01,
+   0x00 }},
+ {{0x7b,0x27,0x27,0x0f,0x46,0x97,0x24,0xbb,
+   0x31,0x88,0x5d,0xc2,0xc1,0x20,0x00,0x01,
+   0x00 }},
+ {{0x7b,0x27,0x27,0x0f,0x46,0x97,0x24,0xb3,
+   0x72,0x89,0xdf,0x03,0x02,0x30,0x00,0x01,
+   0x01 }},
+ {{0x71,0x31,0x31,0x98,0x46,0x17,0x24,0xf1,
+   0xbb,0x82,0x57,0x57,0x25,0x10,0x00,0x02,
+   0x01 }},
+ {{0x63,0x3f,0x3f,0x87,0x4c,0x97,0x24,0xf5,
+   0x0f,0x86,0xff,0xff,0x25,0x30,0x00,0x01,
+   0x01 }}
 };
 
-static const SiS310_LVDSDataStruct  SiS310_CHTVSOPALData[]=   /* TW: (super overscan - no effect on 7019) */
-{
-	{1008, 625,1008, 625},
-	{1008, 625,1008, 625},
-	{1008, 625,1008, 625},
-	{1008, 625,1008, 625},
-	{ 840, 625, 840, 625},
-	{ 944, 625, 944, 625},
-        {1400, 875,1400, 875}       	
+static const SiS310_LCDACRT1DataStruct  SiS310_LCDACRT11280x1024_1[]=
+{ /* Acer */
+ {{0x7e,0x4f,0x4f,0x82,0x58,0x04,0xb8,0x1f,
+   0x90,0x84,0x8f,0x8f,0xb9,0x30,0x00,0x06,
+   0x00}},
+ {{0x7e,0x4f,0x4f,0x82,0x58,0x04,0x86,0x1f,
+   0x5e,0x82,0x5d,0x5d,0x87,0x10,0x00,0x06,
+   0x00}},
+ {{0x7e,0x4f,0x4f,0x82,0x58,0x04,0xb8,0x1f,
+   0x90,0x84,0x8f,0x8f,0xb9,0x30,0x00,0x06,
+   0x00}},
+ {{0x7e,0x4f,0x4f,0x82,0x58,0x04,0x86,0x1f,
+   0x5e,0x82,0x5d,0x5d,0x87,0x10,0x00,0x06,
+   0x00}},
+ {{0x7e,0x4f,0x4f,0x82,0x58,0x04,0x08,0x3e,
+   0xe0,0x84,0xdf,0xdf,0x09,0x00,0x00,0x06,
+   0x00}},
+ {{0x92,0x63,0x63,0x96,0x6c,0x18,0x80,0xf0,
+   0x58,0x8c,0x57,0x57,0x81,0x20,0x00,0x06,
+   0x01}},
+ {{0xae,0x7f,0x7f,0x92,0x88,0x94,0x28,0xf5,
+   0x00,0x84,0xff,0xff,0x29,0x10,0x00,0x02,
+   0x01}},
+ {{0xce,0x9f,0x9f,0x92,0xa8,0x14,0x28,0x5a,
+   0x00,0x84,0xff,0xff,0x29,0x01,0x00,0x07,
+   0x01}}
 };
 
-typedef struct _SiS310_LVDSDesStruct
-{
-	USHORT LCDHDES;
-	USHORT LCDVDES;
-} SiS310_LVDSDesStruct;
+static const SiS310_LCDACRT1DataStruct  SiS310_LCDACRT11280x1024_1_H[]=
+{  /* Acer */
+ {{0x56,0x27,0x27,0x9a,0x31,0x1c,0xb8,0x1f,
+   0x90,0x84,0x8f,0x8f,0xb9,0x30,0x00,0x05,
+   0x00}},
+ {{0x56,0x27,0x27,0x9a,0x31,0x1c,0x86,0x1f,
+   0x5e,0x82,0x5d,0x5d,0x87,0x10,0x00,0x05,
+   0x00}},
+ {{0x56,0x27,0x27,0x9a,0x31,0x1c,0xb8,0x1f,
+   0x90,0x84,0x8f,0x8f,0xb9,0x30,0x00,0x05,
+   0x00}},
+ {{0x56,0x27,0x27,0x9a,0x31,0x1c,0x86,0x1f,
+   0x5e,0x82,0x5d,0x5d,0x87,0x10,0x00,0x05,
+   0x01}},
+ {{0x56,0x27,0x27,0x9a,0x31,0x1c,0x08,0x3e,
+   0xe0,0x84,0xdf,0xdf,0x09,0x00,0x00,0x05,
+   0x00}},
+ {{0x60,0x31,0x31,0x84,0x3a,0x86,0x80,0xf0,
+   0x58,0x8c,0x57,0x57,0x81,0x20,0x00,0x01,
+   0x01}},
+ {{0x6e,0x3f,0x3f,0x92,0x48,0x94,0x28,0xf5,
+   0x00,0x84,0xff,0xff,0x29,0x10,0x00,0x01,
+   0x01}}
+};
 
-static const SiS310_LVDSDesStruct  SiS310_PanelType00_1[]=  
-{
-	{ 0, 0},
-	{ 0, 0},
-	{ 0, 0},
-	{ 0, 0},
-	{ 0, 0},
-	{ 0, 0},
-	{ 0, 0},
-	{ 0, 0},
-	{ 0, 0}
+static const SiS310_LCDACRT1DataStruct  SiS310_LCDACRT11280x1024_2[]=
+{  /* Illegal data in BIOS (Acer, Compaq) */
+ {{0xa3,0x4f,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
+   0x4a,0x80,0x8f,0x8f,0x25,0x30,0x00,0x06,
+   0x00}},
+ {{0xa3,0x4f,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
+   0x31,0x87,0x5d,0x5d,0x25,0x30,0x00,0x06,
+   0x00}},
+ {{0xa3,0x4f,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
+   0x4a,0x80,0x8f,0x8f,0x25,0x30,0x00,0x06,
+   0x00}},
+ {{0xa3,0x4f,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
+   0x31,0x87,0x5d,0x5d,0x25,0x30,0x00,0x06,
+   0x00}},
+ {{0xa3,0x4f,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
+   0x72,0x88,0xdf,0xdf,0x25,0x30,0x00,0x06,
+   0x00}},
+ {{0xa3,0x63,0x63,0x87,0x78,0x89,0x24,0xf1,
+   0xae,0x84,0x57,0x57,0x25,0x30,0x00,0x02,
+   0x01}},
+ {{0xa3,0x7f,0x7f,0x87,0x86,0x97,0x24,0xf5,
+   0x02,0x88,0xff,0xff,0x25,0x10,0x00,0x02,
+   0x01}}
 };
 
-static const SiS310_LVDSDesStruct  SiS310_PanelType01_1[]=   
-{
-	{ 0, 0},
-	{ 0, 0},
-	{ 0, 0},
-	{ 0, 0},
-	{ 0, 0},
-	{ 0, 0},
-	{ 0, 805},
-	{ 0, 0},
-	{ 0, 0}
+static const SiS310_LCDACRT1DataStruct  SiS310_LCDACRT11280x1024_2_H[]=
+{  /* Illegal data in BIOS (Acer, Compaq) */
+ {{0x4f,0x27,0x27,0x93,0x39,0x81,0x24,0xbb,
+   0x4a,0x80,0x8f,0x8f,0x25,0x30,0x00,0x01,
+   0x00 }},
+ {{0x4f,0x27,0x27,0x93,0x39,0x81,0x24,0xbb,
+   0x31,0x87,0x5d,0x5d,0x25,0x30,0x00,0x01,
+   0x00 }},
+ {{0x4f,0x27,0x27,0x93,0x39,0x81,0x24,0xbb,
+   0x4a,0x80,0x8f,0x8f,0x25,0x30,0x00,0x01,
+   0x00 }},
+ {{0x4f,0x27,0x27,0x93,0x39,0x81,0x24,0xbb,
+   0x31,0x87,0x5d,0x5d,0x25,0x30,0x00,0x01,
+   0x00 }},
+ {{0x4f,0x27,0x27,0x93,0x39,0x81,0x24,0xbb,
+   0x72,0x88,0xdf,0xdf,0x25,0x30,0x00,0x01,
+   0x00 }},
+ {{0x4f,0x31,0x31,0x93,0x3e,0x86,0x24,0xf1,
+   0xae,0x84,0x57,0x57,0x25,0x30,0x00,0x01,
+   0x01 }},
+ {{0x4f,0x3f,0x3f,0x93,0x45,0x0d,0x24,0xf5,
+   0x02,0x88,0xff,0xff,0x25,0x10,0x00,0x01,
+   0x01 }}
 };
 
-static const SiS310_LVDSDesStruct  SiS310_PanelType02_1[]=  
+static const SiS310_LCDACRT1DataStruct  SiS310_LCDACRT11400x1050_1[]=
 {
-	{ 0, 0},
-	{ 0, 0},
-	{ 0, 0},
-	{ 0, 0},
-	{ 0, 0},
-	{ 0, 0},
-	{ 0, 0},
-	{ 0, 1065},
-	{ 0, 0},
-	{ 0, 0}
+ {{0x6f,0x4f,0x4f,0x93,0x54,0x82,0x9e,0x1f,
+   0x93,0x86,0x8f,0x8f,0x9f,0x30,0x00,0x05,
+   0x00}},
+ {{0x6f,0x4f,0x4f,0x93,0x54,0x82,0x6c,0x1f,
+   0x60,0x84,0x5d,0x5d,0x6d,0x10,0x00,0x05,
+   0x00}},
+ {{0x6f,0x4f,0x4f,0x93,0x54,0x82,0x9e,0x1f,
+   0x93,0x86,0x8f,0x8f,0x9f,0x30,0x00,0x05,
+   0x00}},
+ {{0x6f,0x4f,0x4f,0x93,0x54,0x82,0x6c,0x1f,
+   0x60,0x84,0x5d,0x5d,0x6d,0x10,0x00,0x05,
+   0x00}},
+ {{0x6f,0x4f,0x4f,0x93,0x54,0x82,0xee,0x1f,
+   0xe2,0x86,0xdf,0xdf,0xef,0x10,0x00,0x05,
+   0x00}},
+ {{0x83,0x63,0x63,0x87,0x68,0x16,0x66,0xf0,
+   0x5a,0x8e,0x57,0x57,0x67,0x20,0x00,0x06,
+   0x01}},
+ {{0x9f,0x7f,0x7f,0x83,0x84,0x92,0x0e,0xf5,
+   0x02,0x86,0xff,0xff,0x0f,0x10,0x00,0x02,
+   0x01}},
+ {{0xbf,0x9f,0x9f,0x83,0xa4,0x12,0x0e,0x5a,
+   0x02,0x86,0xff,0xff,0x0f,0x09,0x00,0x07,
+   0x01}},
+ {{0xce,0xae,0xae,0x92,0xb3,0x01,0x28,0x10,
+   0x1a,0x80,0x19,0x19,0x29,0x0f,0x00,0x03,
+   0x00}}
 };
 
-
-static const SiS310_LVDSDesStruct  SiS310_PanelType03_1[]= 
+static const SiS310_LCDACRT1DataStruct  SiS310_LCDACRT11400x1050_1_H[]=
 {
-	{ 0, 0},
-	{ 0, 0},
-	{ 0, 0},
-	{ 0, 0},
-	{ 0, 0},
-	{ 0, 0},
-	{ 0, 0},
-	{ 0, 0},
-	{ 0, 0}
+  {{0x47,0x27,0x27,0x8b,0x2c,0x1a,0x9e,0x1f,
+    0x93,0x86,0x8f,0x8f,0x9f,0x30,0x00,0x05,
+    0x00}},
+  {{0x47,0x27,0x27,0x8b,0x2c,0x1a,0x6c,0x1f,
+    0x60,0x84,0x5d,0x5d,0x6d,0x10,0x00,0x05,
+    0x00}},
+  {{0x47,0x27,0x27,0x8b,0x30,0x1e,0x9e,0x1f,
+    0x92,0x86,0x8f,0x8f,0x9f,0x30,0x00,0x05,
+    0x00}},
+  {{0x47,0x27,0x27,0x8b,0x2c,0x1a,0x6c,0x1f,
+    0x60,0x84,0x5d,0x5d,0x6d,0x10,0x00,0x05,
+    0x00}},
+  {{0x47,0x27,0x27,0x8b,0x2c,0x1a,0xee,0x1f,
+    0xe2,0x86,0xdf,0xdf,0xef,0x10,0x00,0x05,
+    0x00}},
+  {{0x51,0x31,0x31,0x95,0x36,0x04,0x66,0xf0,
+    0x5a,0x8e,0x57,0x57,0x67,0x20,0x00,0x01,
+    0x01}},
+  {{0x5f,0x3f,0x3f,0x83,0x44,0x92,0x0e,0xf5,
+    0x02,0x86,0xff,0xff,0x0f,0x10,0x00,0x01,
+    0x01}},
+  {{0x6f,0x4f,0x4f,0x93,0x54,0x82,0x0e,0x5a,
+    0x02,0x86,0xff,0xff,0x0f,0x09,0x00,0x05,
+    0x01}},
+  {{0x76,0x56,0x56,0x9a,0x5b,0x89,0x28,0x10,
+    0x1c,0x80,0x19,0x19,0x29,0x0b,0x00,0x05,
+    0x00}}
 };
 
-static const SiS310_LVDSDesStruct  SiS310_PanelType04_1[]=  
+static const SiS310_LCDACRT1DataStruct  SiS310_LCDACRT11400x1050_2[]=
+{
+ {{0xce,0x4f,0x4f,0x92,0x8c,0x1a,0x28,0x9a,
+   0xdb,0x8f,0x8f,0x8f,0x29,0x21,0x00,0x03,
+   0x00}},
+ {{0xce,0x4f,0x4f,0x92,0x8c,0x1a,0x28,0x9a,
+   0xc2,0x86,0x5d,0x5d,0x29,0x01,0x00,0x03,
+   0x01}},
+ {{0xce,0x4f,0x4f,0x92,0x8c,0x1a,0x28,0x9a,
+   0xdb,0x8f,0x8f,0x8f,0x29,0x21,0x00,0x03,
+   0x00}},
+ {{0xce,0x4f,0x4f,0x92,0x8c,0x1a,0x28,0x9a,
+   0xc2,0x86,0x5d,0x5d,0x29,0x01,0x00,0x03,
+   0x00}},
+ {{0xce,0x4f,0x4f,0x92,0x8c,0x1a,0x28,0x9e,
+   0x03,0x87,0xdf,0xdf,0x29,0x01,0x00,0x03,
+   0x00}},
+ {{0xce,0x63,0x63,0x92,0x96,0x04,0x28,0xd4,
+   0x3f,0x83,0x57,0x57,0x29,0x01,0x00,0x07,
+   0x01}},
+ {{0xce,0x7f,0x7f,0x92,0xa4,0x12,0x28,0xd4,
+   0x93,0x87,0xff,0xff,0x29,0x21,0x00,0x07,
+   0x01}},
+ {{0xce,0x9f,0x9f,0x92,0xb4,0x02,0x28,0x5a,
+   0x13,0x87,0xff,0xff,0x29,0x29,0x00,0x03,
+   0x01}},
+ {{0xce,0xae,0xae,0x92,0xbc,0x0a,0x28,0x10,
+   0x20,0x84,0x19,0x19,0x29,0x0f,0x00,0x03,
+   0x00}}
+};
+
+static const SiS310_LCDACRT1DataStruct  SiS310_LCDACRT11400x1050_2_H[]=
+{
+ {{0xa6,0x27,0x27,0x8a,0x64,0x92,0x28,0x9a,
+   0xdb,0x8f,0x8f,0x8f,0x29,0x21,0x00,0x06,
+   0x00}},
+ {{0xa6,0x27,0x27,0x8a,0x64,0x92,0x28,0x9a,
+   0xc2,0x86,0x5d,0x5d,0x29,0x01,0x00,0x06,
+   0x00}},
+ {{0xa6,0x27,0x27,0x8a,0x64,0x92,0x28,0x9a,
+   0xdb,0x8f,0x8f,0x8f,0x29,0x21,0x00,0x06,
+   0x00}},
+ {{0xa6,0x27,0x27,0x8a,0x64,0x92,0x28,0x9a,
+   0xc2,0x86,0x5d,0x5d,0x29,0x01,0x00,0x06,
+   0x00}},
+ {{0xa6,0x27,0x27,0x8a,0x64,0x92,0x28,0x9e,
+   0x03,0x87,0xdf,0xdf,0x29,0x01,0x00,0x06,
+   0x00}},
+ {{0x9c,0x31,0x31,0x80,0x64,0x92,0x28,0xd4,
+   0x3f,0x83,0x57,0x57,0x29,0x01,0x00,0x06,
+   0x01}},
+ {{0x8e,0x3f,0x3f,0x92,0x64,0x12,0x28,0xd4,
+   0x93,0x87,0xff,0xff,0x29,0x21,0x00,0x06,
+   0x01}},
+ {{0x7e,0x4f,0x4f,0x82,0x64,0x12,0x28,0x5a,
+   0x13,0x87,0xff,0xff,0x29,0x29,0x00,0x06,
+   0x01}},
+ {{0x76,0x56,0x56,0x9a,0x64,0x92,0x28,0x10,
+   0x20,0x84,0x19,0x19,0x29,0x0f,0x00,0x05,
+   0x00}}
+};
+
+static const SiS310_LCDACRT1DataStruct  SiS310_LCDACRT11600x1200_1[]=
+{
+ {{0x83,0x4F,0x4F,0x87,0x51,0x09,0xC0,0x1F,
+   0x90,0x84,0x8F,0x8F,0xC1,0x30,0x00,0x06,
+   0x00}},
+ {{0x83,0x4F,0x4F,0x87,0x51,0x09,0x8E,0x1F,
+   0x5E,0x82,0x5D,0x5D,0x8F,0x10,0x00,0x06,
+   0x00}},
+ {{0x83,0x4F,0x4F,0x87,0x51,0x09,0xC0,0x1F,
+   0x90,0x84,0x8F,0x8F,0xC1,0x30,0x00,0x06,
+   0x00}},
+ {{0x83,0x4F,0x4F,0x87,0x51,0x09,0x8E,0x1F,
+   0x5E,0x82,0x5D,0x5D,0x8F,0x10,0x00,0x06,
+   0x00}},
+ {{0x83,0x4F,0x4F,0x87,0x51,0x09,0x10,0x3E,
+   0xE0,0x84,0xDF,0xDF,0x11,0x00,0x00,0x06,
+   0x00}},
+ {{0x97,0x63,0x63,0x9B,0x65,0x1D,0x88,0xF0,
+   0x58,0x8C,0x57,0x57,0x89,0x20,0x00,0x06,
+   0x01}},
+ {{0xB3,0x7F,0x7F,0x97,0x81,0x99,0x30,0xF5,
+   0x00,0x84,0xFF,0xFF,0x31,0x10,0x00,0x02,
+   0x01}},
+ {{0xD3,0x9F,0x9F,0x97,0xA1,0x19,0x30,0x5A,
+   0x00,0x84,0xFF,0xFF,0x31,0x09,0x00,0x07,
+   0x01}},
+ {{0xE2,0xAE,0xAE,0x86,0xB0,0x88,0x4A,0x10,
+   0x1A,0x8E,0x19,0x19,0x4B,0x2F,0x00,0x03,
+   0x00}},
+ {{0xFB,0xC7,0xC7,0x9F,0xC9,0x81,0xE0,0x10,
+   0xB0,0x84,0xAF,0xAF,0xE1,0x2F,0x00,0x07,
+   0x00}}
+};
+
+static const SiS310_LCDACRT1DataStruct  SiS310_LCDACRT11600x1200_1_H[]=
+{
+ {{0x69,0x27,0x27,0x8D,0x30,0x88,0xC0,0x1F,
+   0x90,0x84,0x8F,0x8F,0xC1,0x30,0x00,0x01,
+   0x00}},
+ {{0x69,0x27,0x27,0x8D,0x30,0x88,0x8E,0x1F,
+   0x5E,0x82,0x5D,0x5D,0x87,0x10,0x00,0x01,
+   0x00}},
+ {{0x69,0x27,0x27,0x8D,0x30,0x88,0xC0,0x1F,
+   0x90,0x84,0x8F,0x8F,0xC1,0x30,0x00,0x01,
+   0x00}},
+ {{0x69,0x27,0x27,0x8D,0x30,0x88,0x8E,0x1F,
+   0x5E,0x82,0x5D,0x5D,0x87,0x10,0x00,0x01,
+   0x00}},
+ {{0x69,0x27,0x27,0x8D,0x30,0x88,0x10,0x3E,
+   0xE0,0x84,0xDF,0xDF,0x11,0x00,0x00,0x01,
+   0x00}},
+ {{0x73,0x31,0x31,0x97,0x3A,0x92,0x88,0xF0,
+   0x58,0x8C,0x57,0x57,0x89,0x20,0x00,0x01,
+   0x01}},
+ {{0x81,0x3F,0x3F,0x85,0x48,0x00,0x30,0xF5,
+   0x00,0x84,0xFF,0xFF,0x31,0x10,0x00,0x06,
+   0x01}},
+ {{0x91,0x4F,0x4F,0x95,0x58,0x10,0x30,0x5A,
+   0x00,0x84,0xFF,0xFF,0x31,0x09,0x00,0x06,
+   0x01}},
+ {{0xD4,0x9F,0x9F,0x98,0xA8,0x00,0x30,0x5A,
+   0x00,0x84,0xFF,0xFF,0x31,0x09,0x00,0x03,
+   0x01}},
+ {{0xA5,0x63,0x63,0x89,0x6C,0x84,0xE0,0x10,
+   0xB0,0x84,0xAF,0xAF,0xE1,0x2F,0x00,0x02,
+   0x00}}
+};
+
+static const SiS310_LCDACRT1DataStruct  SiS310_LCDACRT11600x1200_2[]=
+{
+ {{0x09,0x4F,0x4F,0x8D,0xA3,0x1B,0xE0,0x9E,
+   0x37,0x8B,0x8F,0x8F,0xE1,0x21,0x01,0x04,
+   0x00}},
+ {{0x09,0x4F,0x4F,0x8D,0xA3,0x1B,0xE0,0x9E,
+   0x1E,0x82,0x5D,0x5D,0xE1,0x01,0x01,0x04,
+   0x00}},
+ {{0x09,0x4F,0x4F,0x8D,0xA3,0x1B,0xE0,0x9E,
+   0x37,0x8B,0x8F,0x8F,0xE1,0x21,0x01,0x04,
+   0x00}},
+ {{0x09,0x4F,0x4F,0x8D,0xA3,0x1B,0xE0,0x9E,
+   0x1E,0x82,0x5D,0x5D,0xE1,0x01,0x01,0x04,
+   0x00}},
+ {{0x09,0x4F,0x4F,0x8D,0xA3,0x1B,0xE0,0x9E,
+   0x5F,0x83,0xDF,0xDF,0xE1,0x01,0x01,0x04,
+   0x00}},
+ {{0x09,0x63,0x63,0x8D,0xAD,0x05,0xE0,0xD4,
+   0x9B,0x8F,0x57,0x57,0xE1,0x21,0x01,0x00,
+   0x01}},
+ {{0x09,0x7F,0x7F,0x8D,0xBB,0x13,0xE0,0xD4,
+   0xEF,0x83,0xFF,0xFF,0xE1,0x21,0x01,0x00,
+   0x01}},
+ {{0x09,0x9F,0x9F,0x8D,0xCB,0x03,0xE0,0x5A,
+   0x6F,0x83,0xFF,0xFF,0xE1,0x29,0x01,0x04,
+   0x01}},
+ {{0xD4,0x9F,0x9F,0x98,0xA8,0x00,0x30,0x5A,
+   0x00,0x84,0xFF,0xFF,0x31,0x09,0x00,0x03,
+   0x01}},
+ {{0x09,0xC7,0xC7,0x8D,0xDF,0x17,0xE0,0x10,
+   0xC7,0x8B,0xAF,0xAF,0xE1,0x0F,0x01,0x04,
+   0x00}}
+};
+
+static const SiS310_LCDACRT1DataStruct  SiS310_LCDACRT11600x1200_2_H[]=
+{
+ {{0xE1,0x27,0x27,0x85,0x7B,0x93,0xE0,0x9E,
+   0x37,0x8B,0x8F,0x8F,0xE1,0x21,0x00,0x03,
+   0x00}},
+ {{0xE1,0x27,0x27,0x85,0x7B,0x93,0xE0,0x9E,
+   0x1E,0x82,0x5D,0x5D,0xE1,0x01,0x00,0x03,
+   0x00}},
+ {{0xE1,0x27,0x27,0x85,0x7B,0x93,0xE0,0x9E,
+   0x37,0x8B,0x8F,0x8F,0xE1,0x21,0x00,0x03,
+   0x00}},
+ {{0xE1,0x27,0x27,0x85,0x7B,0x93,0xE0,0x9E,
+   0x1E,0x82,0x5D,0x5D,0xE1,0x01,0x00,0x03,
+   0x00}},
+ {{0xE1,0x27,0x27,0x85,0x7B,0x93,0xE0,0x9E,
+   0x5F,0x83,0xDF,0xDF,0xE1,0x01,0x00,0x03,
+   0x00}},
+ {{0xD7,0x31,0x31,0x9B,0x7B,0x13,0xE0,0xD4,
+   0x9B,0x8F,0x57,0x57,0xE1,0x21,0x00,0x03,
+   0x01}},
+ {{0xC9,0x3F,0x3F,0x8D,0x7B,0x13,0xE0,0xD4,
+   0xEF,0x83,0xFF,0xFF,0xE1,0x21,0x00,0x03,
+   0x01}},
+ {{0xB9,0x4F,0x4F,0x9D,0x7B,0x93,0xE0,0x5A,
+   0x6F,0x83,0xFF,0xFF,0xE1,0x29,0x00,0x02,
+   0x01}},
+ {{0xD4,0x9F,0x9F,0x98,0xA8,0x00,0x30,0x5A,
+   0x00,0x84,0xFF,0xFF,0x31,0x09,0x00,0x03,
+   0x01}},
+ {{0xA5,0x63,0x63,0x89,0x7B,0x93,0xE0,0x10,
+   0xC7,0x8B,0xAF,0xAF,0xE1,0x0F,0x00,0x02,
+   0x00}}
+};
+
+
+/**************************************************************/
+/* LVDS, CHRONTEL ------------------------------------------- */
+/**************************************************************/
+
+typedef struct _SiS310_LVDSDataStruct
+{
+	USHORT VGAHT;
+	USHORT VGAVT;
+	USHORT LCDHT;
+	USHORT LCDVT;
+} SiS310_LVDSDataStruct;
+
+static const SiS310_LVDSDataStruct  SiS310_CHTVUPALData[]=
+{
+	{1008, 625,1008, 625},
+	{1008, 625,1008, 625},
+	{1008, 625,1008, 625},
+	{1008, 625,1008, 625},
+	{ 840, 625, 840, 625},
+	{ 960, 750, 960, 750},
+	{1400,1000,1400,1000}
+};
+
+static const SiS310_LVDSDataStruct  SiS310_CHTVOPALData[]=
+{
+	{1008, 625,1008, 625},
+	{1008, 625,1008, 625},
+	{1008, 625,1008, 625},
+	{1008, 625,1008, 625},
+	{ 840, 625, 840, 625},
+	{ 944, 625, 944, 625},
+        {1400, 875,1400, 875}
+};
+
+static const SiS310_LVDSDataStruct  SiS310_CHTVUPALMData[]=
+{
+	{ 840, 600, 840, 600},
+	{ 840, 600, 840, 600},
+	{ 840, 600, 840, 600},
+	{ 840, 600, 840, 600},
+	{ 784, 600, 784, 600},
+	{1064, 750,1064, 750},
+        {1160, 945,1160, 945}
+};
+
+static const SiS310_LVDSDataStruct  SiS310_CHTVOPALMData[]=
+{
+	{ 840, 525, 840, 525},
+	{ 840, 525, 840, 525},
+	{ 840, 525, 840, 525},
+	{ 840, 525, 840, 525},
+	{ 784, 525, 784, 525},
+	{1040, 700,1040, 700},
+        {1160, 840,1160, 840}
+};
+
+static const SiS310_LVDSDataStruct  SiS310_CHTVUPALNData[]=
+{
+	{1008, 625,1008, 625},
+	{1008, 625,1008, 625},
+	{1008, 625,1008, 625},
+	{1008, 625,1008, 625},
+	{ 840, 625, 840, 625},
+	{ 960, 750, 960, 750},
+	{1400,1000,1400,1000}
+};
+
+static const SiS310_LVDSDataStruct  SiS310_CHTVOPALNData[]=
+{
+	{1008, 625,1008, 625},
+	{1008, 625,1008, 625},
+	{1008, 625,1008, 625},
+	{1008, 625,1008, 625},
+	{ 840, 625, 840, 625},
+	{ 944, 625, 944, 625},
+        {1400, 875,1400, 875}
+};
+
+static const SiS310_LVDSDataStruct  SiS310_CHTVSOPALData[]=   /* TW: (super overscan - no effect on 7019) */
+{
+	{1008, 625,1008, 625},
+	{1008, 625,1008, 625},
+	{1008, 625,1008, 625},
+	{1008, 625,1008, 625},
+	{ 840, 625, 840, 625},
+	{ 944, 625, 944, 625},
+        {1400, 875,1400, 875}
+};
+
+typedef struct _SiS310_LVDSDesStruct
+{
+	USHORT LCDHDES;
+	USHORT LCDVDES;
+} SiS310_LVDSDesStruct;
+
+static const SiS310_LVDSDesStruct  SiS310_PanelType00_1[]=  /* 800x600 */
+{
+	{ 0, 0},
+	{ 0, 0},
+	{ 0, 0},
+	{ 0, 0},
+	{ 0, 0},
+	{ 0, 0},
+	{ 0, 0},
+	{ 0, 0},
+	{ 0, 0}
+};
+
+static const SiS310_LVDSDesStruct  SiS310_PanelType01_1[]=  /* 1024x768 */
+{
+	{ 0, 0},
+	{ 0, 0},
+	{ 0, 0},
+	{ 0, 0},
+	{ 0, 0},
+	{ 0, 0},
+	{ 0, 805},
+	{ 0, 0},
+	{ 0, 0}
+};
+
+static const SiS310_LVDSDesStruct  SiS310_PanelType02_1[]=  /* 1280x1024 */
+{
+	{ 0, 0},
+	{ 0, 0},
+	{ 0, 0},
+	{ 0, 0},
+	{ 0, 0},
+	{ 0, 0},
+	{ 0, 0},
+	{ 0, 1065},
+	{ 0, 0},
+	{ 0, 0}
+};
+
+
+static const SiS310_LVDSDesStruct  SiS310_PanelType03_1[]=
+{
+	{ 0, 0},
+	{ 0, 0},
+	{ 0, 0},
+	{ 0, 0},
+	{ 0, 0},
+	{ 0, 0},
+	{ 0, 0},
+	{ 0, 0},
+	{ 0, 0}
+};
+
+static const SiS310_LVDSDesStruct  SiS310_PanelType04_1[]=
 {
 	{1343, 798},
 	{1343, 794},
@@ -2298,7 +1836,7 @@
 	{ 0,   0}
 };
 
-static const SiS310_LVDSDesStruct  SiS310_PanelType05_1[]= 
+static const SiS310_LVDSDesStruct  SiS310_PanelType05_1[]=
 {
 	{1343, 798},
 	{1343, 794},
@@ -2311,7 +1849,7 @@
 	{ 0,   0}
 };
 
-static const SiS310_LVDSDesStruct  SiS310_PanelType06_1[]=  
+static const SiS310_LVDSDesStruct  SiS310_PanelType06_1[]=
 {
 	{1343, 798},
 	{1343, 794},
@@ -2324,7 +1862,7 @@
 	{ 0,   0}
 };
 
-static const SiS310_LVDSDesStruct  SiS310_PanelType07_1[]= 
+static const SiS310_LVDSDesStruct  SiS310_PanelType07_1[]=
 {
 	{1343, 798},
 	{1343, 794},
@@ -2382,20 +1920,31 @@
 	{ 0, 0}
 };
 
-static const SiS310_LVDSDesStruct  SiS310_PanelType0b_1[]= 
+static const SiS310_LVDSDesStruct  SiS310_PanelType0b_1[]=  /* 640x480_2 */
 {
-	{1343, 798},
-	{1343, 794},
-	{1343, 798},
-	{1343, 794},
-	{1343,   0},
-	{1343,   0},
-	{ 0, 805},
-	{ 0, 794},
-	{ 0,   0}
+	{ 0, 524},
+	{ 0, 524},
+	{ 0, 524},
+	{ 0, 524},
+	{ 0, 524},
+	{ 0, 524},
+	{ 8, 524},
+	{ 0, 524}
+};
+
+static const SiS310_LVDSDesStruct  SiS310_PanelType0c_1[]=  /* 640x480_3 */
+{
+	{ 0, 524},
+	{ 0, 524},
+	{ 0, 524},
+	{ 0, 524},
+	{ 0, 524},
+	{ 0, 524},
+	{ 8, 524},
+	{ 0, 524}
 };
 
-static const SiS310_LVDSDesStruct  SiS310_PanelType0c_1[]=  
+static const SiS310_LVDSDesStruct  SiS310_PanelType0d_1[]=
 {
 	{1343, 798},
 	{1343, 794},
@@ -2408,7 +1957,7 @@
 	{ 0,   0}
 };
 
-static const SiS310_LVDSDesStruct  SiS310_PanelType0d_1[]= 
+static const SiS310_LVDSDesStruct  SiS310_PanelType0e_1[]=
 {
 	{1343, 798},
 	{1343, 794},
@@ -2421,7 +1970,7 @@
 	{ 0,   0}
 };
 
-static const SiS310_LVDSDesStruct  SiS310_PanelType0e_1[]=  
+static const SiS310_LVDSDesStruct  SiS310_PanelType0f_1[]=
 {
 	{1343, 798},
 	{1343, 794},
@@ -2434,20 +1983,7 @@
 	{ 0,   0}
 };
 
-static const SiS310_LVDSDesStruct  SiS310_PanelType0f_1[]=  
-{
-	{1343, 798},
-	{1343, 794},
-	{1343, 798},
-	{1343, 794},
-	{1343,   0},
-	{1343,   0},
-	{ 0, 805},
-	{ 0, 794},
-	{ 0,   0}
-};
-
-static const SiS310_LVDSDesStruct  SiS310_PanelType00_2[]=  
+static const SiS310_LVDSDesStruct  SiS310_PanelType00_2[]=
 {
 	{980, 528},
 	{980, 503},
@@ -2564,17 +2100,6 @@
 	{   0,1065},
 	{   0,   0},
 	{   0,   0}
-#if 0
-	{976, 527},
-	{976, 502},
-	{976, 527},
-	{976, 502},
-	{976, 567},
-	{ 0, 627},
-	{ 0, 627},
-	{ 0,   0},
-	{ 0,   0}
-#endif	
 };
 
 static const SiS310_LVDSDesStruct  SiS310_PanelType09_2[]= /* 1280x768 */
@@ -2592,6 +2117,17 @@
 
 static const SiS310_LVDSDesStruct  SiS310_PanelType0a_2[]=  /* 1600x1200 */
 {
+	{1568, 920},
+	{1568, 895},
+	{1568, 920},
+	{1568, 895},
+	{1568, 960},
+	{1648,1020},
+	{1760,1104},
+	{1888,1232},
+	{1948,1245},
+	{   0,   0}
+#if 0
 	{1568, 850},
 	{1568, 825},
 	{1568, 850},
@@ -2602,9 +2138,10 @@
 	{1888,1162},
 	{1948,1175},
 	{   0,   0}
+#endif
 };
 
-static const SiS310_LVDSDesStruct  SiS310_PanelType0b_2[]=  
+static const SiS310_LVDSDesStruct  SiS310_PanelType0b_2[]=  /* 640x480_2 */
 {
 	{1152, 622},
 	{1152, 597},
@@ -2617,7 +2154,7 @@
 	{ 0,   0}
 };
 
-static const SiS310_LVDSDesStruct  SiS310_PanelType0c_2[]= 
+static const SiS310_LVDSDesStruct  SiS310_PanelType0c_2[]=  /* 640x480_3 */
 {
 	{1152, 622},
 	{1152, 597},
@@ -2637,1022 +2174,134 @@
 	{1152, 622},
 	{1152, 597},
 	{1152, 662},
-	{1232, 722},
-	{ 0, 805},
-	{ 0, 794},
-	{ 0,   0}
-};
-
-static const SiS310_LVDSDesStruct  SiS310_PanelType0e_2[]= 
-{
-	{1152, 622},
-	{1152, 597},
-	{1152, 622},
-	{1152, 597},
-	{1152, 662},
-	{1232, 722},
-	{ 0, 805},
-	{ 0, 794},
-	{ 0,   0}
-};
-
-static const SiS310_LVDSDesStruct  SiS310_PanelType0f_2[] = 
-{
-	{1152, 622},
-	{1152, 597},
-	{1152, 622},
-	{1152, 597},
-	{1152, 662},
-	{1232, 722},
-	{ 0, 805},
-	{ 0, 794},
-	{ 0,   0}
-};
-
-static const SiS310_LVDSDesStruct  SiS310_PanelTypeNS_1[]= 
-{
-	{ 8,   0},
-	{ 8,   0},
-	{ 8,   0},
-	{ 8,   0},
-	{ 8,   0},
-	{ 0,   0},
-	{ 0,   0},
-	{ 0,   0},
-	{ 0, 806},
-	{ 0, 0 }
-};
-
-static const SiS310_LVDSDesStruct  SiS310_PanelTypeNS_2[] = 
-{
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0}
-};
-
-static const SiS310_LVDSDesStruct SiS310_PanelType1076_1[]=  
-{  /* 1024x768 - Checked (1.10.6s) */
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0}
-};
-
-static const SiS310_LVDSDesStruct SiS310_PanelType1076_2[]=  
-{  /* 1024x768 - Checked (1.10.6s) */
-	{ 1184, 622 },
-	{ 1184, 597 },
-	{ 1184, 622 },
-	{ 1184, 597 },
-	{ 1152, 622 },
-	{ 1232, 722 },
-	{    0, 0   },
-	{    0, 794 },
-	{    0, 0   }
-};
-
-static const SiS310_LVDSDesStruct SiS310_PanelType1210_1[]=  
-{  /* 1280x1024 - Checked (1.10.6s) */
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0}
-};
-
-static const SiS310_LVDSDesStruct SiS310_PanelType1210_2[]=  
-{  /* 1280x1024 - Checked (1.10.6s) */
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0}
-};
-
-static const SiS310_LVDSDesStruct SiS310_PanelType1296_1[]=  
-{  /* 1400x1050 - Checked (1.10.6s) */
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0}
-};
-
-static const SiS310_LVDSDesStruct SiS310_PanelType1296_2[]=  
-{  /* 1400x1050 - Checked (1.10.6s) - looks heavily invalid */
-	{ 808 , 740},
-	{ 0   , 715},
-	{ 632 , 740},
-	{ 632 , 715},
-	{ 1307, 780},
-	{ 1387,1157},
-	{ 1499, 924},
-	{ 1627,1052},
-	{ 0 , 0}
-};
-
-static const SiS310_LVDSDesStruct SiS310_PanelType1600_1[]= 
-{  /* 1600x1200 - Checked (1.10.6s) */
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0}
-};
-
-static const SiS310_LVDSDesStruct SiS310_PanelType1600_2[]= 
-{  /* 1600x1200 - Checked (1.10.6s) - looks heavily invalid, not copied */
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0}
-};
-
-static const SiS310_LVDSDesStruct  SiS310_CHTVUNTSCDesData[]=
-{
-	{ 0,   0},
-	{ 0,   0},
-	{ 0,   0},
-	{ 0,   0},
-	{ 0,   0},
-	{ 0,   0},
-	{ 0,   0}
-};
-
-static const SiS310_LVDSDesStruct  SiS310_CHTVONTSCDesData[]=
-{
-	{ 0,   0},
-	{ 0,   0},
-	{ 0,   0},
-	{ 0,   0},
-	{ 0,   0},
-	{ 0,   0},
-	{ 0,   0}
-};
-
-static const SiS310_LVDSDesStruct  SiS310_CHTVUPALDesData[]=
-{
-	{256,   0},
-	{256,   0},
-	{256,   0},
-	{256,   0},
-	{ 0,   0},
-	{ 0,   0},
-	{ 0,   0}
-};
-
-static const SiS310_LVDSDesStruct  SiS310_CHTVOPALDesData[]=
-{
-	{256,   0},
-	{256,   0},
-	{256,   0},
-	{256,   0},
-	{ 0,   0},
-	{ 0,   0},
-	{ 0,   0}
-};
-
-typedef struct _SiS310_Part2PortTblStruct
-{
- 	UCHAR CR[12];
-} SiS310_Part2PortTblStruct;
-
-static const SiS310_Part2PortTblStruct SiS310_CRT2Part2_1024x768_1[] =
-{
- {{0x25,0x12,0xc9,0xdc,0xb6,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}},
- {{0x2c,0x12,0x9a,0xae,0x88,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}},
- {{0x25,0x12,0xc9,0xdc,0xb6,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
- {{0x38,0x13,0x16,0x0c,0xe6,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}},
- {{0x38,0x18,0x16,0x00,0x00,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}},
- {{0x36,0x13,0x13,0x25,0xff,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
- {{0x25,0x12,0xc9,0xdc,0xb6,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}}
-};
-
-static const SiS310_Part2PortTblStruct SiS310_CRT2Part2_1280x1024_1[] =
-{	/* TW: Temporary data, invalid */
- {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x42}},
- {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x42}},
- {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x42}},
- {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x42}},
- {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x32}},
- {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x32}},
- {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x32}},
- {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x32}},
- {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x42}}
-};
-
-static const SiS310_Part2PortTblStruct SiS310_CRT2Part2_1400x1050_1[] =
-{	/* TW: Temporary data, invalid */
- {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x42}},
- {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x42}},
- {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x42}},
- {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x42}},
- {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x32}},
- {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x32}},
- {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x32}},
- {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x32}},
- {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x42}}
-};
-
-static const SiS310_Part2PortTblStruct SiS310_CRT2Part2_1600x1200_1[] =
-{	/* TW: Temporary data, invalid */
- {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x42}},
- {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x42}},
- {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x42}},
- {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x42}},
- {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x32}},
- {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x32}},
- {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x32}},
- {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x32}},
- {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x42}}
-};
-
-static const SiS310_Part2PortTblStruct SiS310_CRT2Part2_1024x768_2[] =
-{
- {{0x25,0x12,0x51,0x6e,0x48,0x99,0x35,0x89,0x47,0xc1,0x49,0x33}},
- {{0x2c,0x12,0x38,0x55,0x2f,0x99,0x35,0x89,0x47,0xc1,0x49,0x33}},
- {{0x25,0x12,0x51,0x6e,0x48,0x99,0x35,0x89,0x47,0xc1,0x49,0x33}},
- {{0x2c,0x12,0x38,0x55,0x2f,0xc1,0x35,0xb1,0x47,0xe9,0x71,0x33}},
- {{0x2d,0x12,0x79,0x96,0x70,0x99,0x35,0x89,0x47,0xc1,0x49,0x33}},
- {{0x29,0x12,0xb5,0xd2,0xac,0xe9,0x35,0xd9,0x47,0x11,0x99,0x33}},
- {{0x36,0x13,0x13,0x25,0xff,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}
-};
-
-static const SiS310_Part2PortTblStruct SiS310_CRT2Part2_1280x1024_2[] =
-{
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}
-};
-
-static const SiS310_Part2PortTblStruct SiS310_CRT2Part2_1400x1050_2[] =
-{
- {{0x2b,0x12,0xd9,0xe5,0xd5,0x2c,0x23,0x98,0x27,0x3e,0x08,0x42}},
- {{0x22,0x12,0xc0,0xcc,0xbc,0x2c,0x23,0x98,0x27,0x3e,0x08,0x42}},
- {{0x2b,0x12,0xd9,0xe5,0xd5,0x2c,0x23,0x98,0x27,0x3e,0x08,0x42}},
- {{0x22,0x12,0xc0,0xcc,0xbc,0x2c,0x23,0x98,0x27,0x3e,0x08,0x42}},
- {{0x33,0x13,0x01,0x0d,0xfd,0x2c,0x23,0x98,0x27,0x3e,0x08,0x42}},
- {{0x3f,0x1b,0x3d,0x49,0x39,0x54,0x23,0xc0,0x27,0x66,0x30,0x42}},
- {{0x33,0x1b,0x91,0x9d,0x8d,0x8c,0x23,0xf8,0x27,0x9e,0x68,0x42}},
- {{0x43,0x24,0x11,0x1d,0x0d,0xcc,0x23,0x38,0x37,0xde,0xa8,0x42}},
- {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x42}}
-};
-
-static const SiS310_Part2PortTblStruct SiS310_CRT2Part2_1600x1200_2[] =
-{	/* TW: Temporary data, invalid */
- {{0x2b,0x12,0xd9,0xe5,0xd5,0x2c,0x23,0x98,0x27,0x3e,0x08,0x42}},
- {{0x22,0x12,0xc0,0xcc,0xbc,0x2c,0x23,0x98,0x27,0x3e,0x08,0x42}},
- {{0x2b,0x12,0xd9,0xe5,0xd5,0x2c,0x23,0x98,0x27,0x3e,0x08,0x42}},
- {{0x22,0x12,0xc0,0xcc,0xbc,0x2c,0x23,0x98,0x27,0x3e,0x08,0x42}},
- {{0x33,0x13,0x01,0x0d,0xfd,0x2c,0x23,0x98,0x27,0x3e,0x08,0x42}},
- {{0x3f,0x1b,0x3d,0x49,0x39,0x54,0x23,0xc0,0x27,0x66,0x30,0x42}},
- {{0x33,0x1b,0x91,0x9d,0x8d,0x8c,0x23,0xf8,0x27,0x9e,0x68,0x42}},
- {{0x43,0x24,0x11,0x1d,0x0d,0xcc,0x23,0x38,0x37,0xde,0xa8,0x42}},
- {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x42}}
-};
-
-
-static const SiS310_Part2PortTblStruct SiS310_CRT2Part2_1024x768_3[] =
-{	/* TW: Data from 650/301LVx 1.10.6s */
- {{0x25,0x13,0xc9,0x25,0xff,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}},
- {{0x2c,0x13,0x9a,0x25,0xff,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}},
- {{0x25,0x13,0xc9,0x24,0xff,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
- {{0x38,0x13,0x13,0x25,0xff,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}},
- {{0x38,0x18,0x16,0x00,0x00,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}},
- {{0x36,0x13,0x13,0x25,0xff,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
- {{0x25,0x13,0xc9,0x25,0xff,0xf9,0x45,0x09,0x07,0xf9,0x09,0x24}}
-#if 0	/* TW: Data from 650/301LV */
- {{0x25,0x12,0xc9,0xdc,0xb6,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}},
- {{0x2c,0x12,0x9a,0xae,0x88,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}},
- {{0x25,0x12,0xc9,0xdc,0xb6,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
- {{0x38,0x13,0x13,0x25,0xff,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}},
- {{0x38,0x18,0x16,0x00,0x00,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}},
- {{0x36,0x13,0x13,0x25,0xff,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}
-#endif
-};
-
-/*   1     2    4    5    6   1c   1d   1f   20   21   23   25   */
-static const SiS310_Part2PortTblStruct SiS310_CRT2Part2_1280x1024_3[] =
-{	/* TW: Temporary data, invalid */
-  {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x42}},
-  {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x42}},
-  {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x42}},
-  {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x42}},
-  {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x32}},
-  {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x32}},
-  {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x32}},
-  {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x32}},
-  {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x32}}
-};
-
-static const SiS310_Part2PortTblStruct SiS310_CRT2Part2_1400x1050_3[] =
-{	
-  {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x42}},
-  {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x42}},
-  {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x42}},
-  {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x42}},
-  {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x32}},
-  {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x32}},
-  {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x32}},
-  {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x32}},
-  {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x32}}
-};
-
-static const SiS310_Part2PortTblStruct SiS310_CRT2Part2_1600x1200_3[] =
-{	/* TW: Temporary data, invalid */
-  {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x42}},
-  {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x42}},
-  {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x42}},
-  {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x42}},
-  {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x32}},
-  {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x32}},
-  {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x32}},
-  {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x32}},
-  {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x32}}
-};
-
-typedef struct _SiS310_LCDACRT1DataStruct
-{
- 	UCHAR CR[17];
-}SiS310_LCDACRT1DataStruct;
-
-static const SiS310_LCDACRT1DataStruct  SiS310_LCDACRT1800x600_1[] =
-{
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}}
-};
-
-static const SiS310_LCDACRT1DataStruct  SiS310_LCDACRT11024x768_1[]=
-{  /* TW: Checked (1.10.6s) */
- {{0x73,0x4f,0x4f,0x97,0x55,0x86,0xc4,0x1f,
-   0x92,0x89,0x8f,0x8f,0xb5,0x30,0x00,0x05,
-   0x00}},
- {{0x73,0x4f,0x4f,0x97,0x55,0x86,0x97,0x1f,
-   0x60,0x87,0x5d,0x5d,0x83,0x10,0x00,0x05,
-   0x00}},
- {{0x73,0x4f,0x4f,0x97,0x55,0x86,0xc4,0x1f,
-   0x92,0x89,0x8f,0x8f,0xb5,0x30,0x00,0x05,
-   0x00}},
- {{0x73,0x4f,0x4f,0x97,0x55,0x86,0x97,0x1f,
-   0x60,0x87,0x5d,0x5d,0x83,0x10,0x00,0x05,
-   0x00}},
- {{0x73,0x4f,0x4f,0x97,0x55,0x86,0x04,0x3e,
-   0xE2,0x89,0xDf,0xDf,0x05,0x00,0x00,0x05,
-   0x00}},
- {{0x87,0x63,0x63,0x8B,0x69,0x1A,0x7c,0xf0,
-   0x5A,0x8F,0x57,0x57,0x7D,0x20,0x00,0x26,
-   0x01}},
- {{0xA3,0x7f,0x7f,0x87,0x86,0x97,0x24,0xf5,
-   0x02,0x88,0xFf,0xFf,0x25,0x10,0x00,0x02,
-   0x01}}
-};
-
-static const SiS310_LCDACRT1DataStruct  SiS310_LCDACRT11280x1024_1[]=
-{  /* Checked (1.10.6s) */
- {{0x7e,0x4f,0x4f,0x82,0x58,0x06,0xb8,0x1f,
-   0x90,0x84,0x8f,0x8f,0xb9,0x30,0x00,0x06,
-   0x00}},
- {{0x7e,0x4f,0x4f,0x82,0x58,0x06,0x86,0x1f,
-   0x5e,0x82,0x5d,0x5d,0x87,0x10,0x00,0x06,
-   0x00}},
- {{0x7e,0x4f,0x4f,0x82,0x58,0x06,0xb8,0x1f,
-   0x90,0x84,0x8f,0x8f,0xb9,0x30,0x00,0x06,
-   0x00}},
- {{0x7e,0x4f,0x4f,0x82,0x58,0x06,0x86,0x1f,
-   0x5e,0x82,0x5d,0x5d,0x87,0x10,0x00,0x06,
-   0x00}},
- {{0x7e,0x4f,0x4f,0x82,0x58,0x06,0x08,0x3e,
-   0xe0,0x84,0xdf,0xdf,0x09,0x00,0x00,0x06,
-   0x00}},
- {{0x92,0x63,0x63,0x96,0x6c,0x1a,0x80,0xf0,
-   0x58,0x8c,0x57,0x57,0x81,0x20,0x00,0x06,
-   0x01}},
- {{0xae,0x7f,0x7f,0x92,0x88,0x96,0x28,0xf5,
-   0x00,0x84,0xff,0xff,0x29,0x10,0x00,0x02,
-   0x01}},
- {{0xce,0x9f,0x9f,0x92,0xa8,0x16,0x28,0x5a,
-   0x00,0x84,0xff,0xff,0x29,0x01,0x00,0x07,
-   0x01}}
-};
-
-static const SiS310_LCDACRT1DataStruct  SiS310_LCDACRT11400x1050_1[]=
-{    /* Checked (1.10.6s) */
- {{0x6f,0x4f,0x4f,0x93,0x54,0x82,0x9e,0x1f,
-   0x93,0x86,0x8f,0x8f,0x9f,0x30,0x00,0x05,
-   0x00}},
- {{0x6f,0x4f,0x4f,0x93,0x54,0x82,0x6c,0x1f,
-   0x60,0x84,0x5d,0x5d,0x6d,0x10,0x00,0x05,
-   0x00}},
- {{0x6f,0x4f,0x4f,0x93,0x54,0x82,0x9e,0x1f,
-   0x93,0x86,0x8f,0x8f,0x9f,0x30,0x00,0x05,
-   0x00}},
- {{0x6f,0x4f,0x4f,0x93,0x54,0x82,0x6c,0x1f,
-   0x60,0x84,0x5d,0x5d,0x6d,0x10,0x00,0x05,
-   0x00}},
- {{0x6f,0x4f,0x4f,0x93,0x54,0x82,0xee,0x1f,
-   0xe2,0x86,0xdf,0xdf,0xef,0x10,0x00,0x05,
-   0x00}},
- {{0x83,0x63,0x63,0x87,0x68,0x16,0x66,0xf0,
-   0x5a,0x8e,0x57,0x57,0x67,0x20,0x00,0x06,
-   0x01}},
- {{0x9f,0x7f,0x7f,0x83,0x84,0x92,0x0e,0xf5,
-   0x02,0x86,0xff,0xff,0x0f,0x10,0x00,0x02,
-   0x01}},
- {{0xbf,0x9f,0x9f,0x83,0xa4,0x12,0x0e,0x5a,
-   0x02,0x86,0xff,0xff,0x0f,0x09,0x00,0x07,
-   0x01}},
- {{0xce,0xae,0xae,0x92,0xb3,0x01,0x28,0x10,
-   0x1a,0x80,0x19,0x19,0x29,0x0f,0x00,0x03,
-   0x00}}
-};
-
-static const SiS310_LCDACRT1DataStruct  SiS310_LCDACRT11600x1200_1[]=
-{   /* MISSING */
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}}
-};
-
-static const SiS310_LCDACRT1DataStruct  SiS310_LCDACRT1800x600_1_H[]=
-{
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}}
-};
-
-static const SiS310_LCDACRT1DataStruct  SiS310_LCDACRT11024x768_1_H[]=
-{  /* TW: Checked (1.10.6s) */
- {{0x4b,0x27,0x27,0x8f,0x2b,0x03,0xc4,0x1f,
-   0x92,0x89,0x8f,0x8f,0xb5,0x30,0x00,0x44,
-   0x00}},
- {{0x4b,0x27,0x27,0x8f,0x2b,0x03,0x97,0x1f,
-   0x60,0x87,0x5D,0x5D,0x83,0x01,0x00,0x44,
-   0x00}},
- {{0x4b,0x27,0x27,0x8f,0x2b,0x03,0xc4,0x1f,
-   0x92,0x89,0x8f,0x8f,0xb5,0x30,0x00,0x44,
-   0x00}},
- {{0x4b,0x27,0x27,0x8f,0x2b,0x03,0x97,0x1f,
-   0x60,0x87,0x5D,0x5D,0x83,0x01,0x00,0x44,
-   0x00}},
- {{0x4b,0x27,0x27,0x8f,0x32,0x1b,0x04,0x3e,
-   0xE2,0x89,0xDf,0xDf,0x05,0x00,0x00,0x45,
-   0x00}},
- {{0x55,0x31,0x31,0x99,0x46,0x1d,0x7c,0xf0,
-   0x5A,0x8F,0x57,0x57,0x7D,0x20,0x00,0x55,
-   0x01}},
- {{0x63,0x3F,0x3F,0x87,0x4a,0x93,0x24,0xf5,
-   0x02,0x88,0xFf,0xFf,0x25,0x10,0x00,0x01,
-   0x01}}
-};
-
-static const SiS310_LCDACRT1DataStruct  SiS310_LCDACRT11280x1024_1_H[]=
-{   /* Checked (1.10.6s) */
- {{0x56,0x27,0x27,0x9a,0x30,0x1e,0xb8,0x1f,
-   0x90,0x84,0x8f,0x8f,0xb9,0x30,0x00,0x05,
-   0x00}},
- {{0x3c,0x4f,0x4f,0x82,0x58,0x06,0x86,0xd1,    /* <-- Invalid data - one byte missing in BIOS */
-   0xbc,0x80,0xbb,0xbb,0xe5,0x00,0x00,0x06,
-   0x01}},
- {{0x56,0x27,0x27,0x9a,0x30,0x1e,0xb8,0x1f,
-   0x90,0x84,0x8f,0x8f,0xb9,0x30,0x00,0x05,
-   0x00}},
- {{0x3c,0x4f,0x4f,0x82,0x58,0x06,0x86,0xd1,
-   0xbc,0x80,0xbb,0xbb,0xe5,0x00,0x00,0x06,
-   0x01}},
- {{0x56,0x27,0x27,0x9a,0x30,0x1e,0x08,0x3e,
-   0xe0,0x84,0xdf,0xdf,0x09,0x00,0x00,0x05,
-   0x00}},
- {{0x60,0x31,0x31,0x84,0x3a,0x88,0x80,0xf0,
-   0x58,0x8c,0x57,0x57,0x81,0x20,0x00,0x01,
-   0x01}},
- {{0x6e,0x3f,0x3f,0x92,0x48,0x96,0x28,0xf5,
-   0x00,0x84,0xff,0xff,0x29,0x10,0x00,0x01,
-   0x01}}
-};
-
-static const SiS310_LCDACRT1DataStruct  SiS310_LCDACRT11400x1050_1_H[]=
-{   /* Checked (1.10.6s) */
-  {{0x47,0x27,0x27,0x8b,0x2c,0x1a,0x9e,0x1f,
-    0x93,0x86,0x8f,0x8f,0x9f,0x30,0x00,0x05,
-    0x00}},
-  {{0x47,0x27,0x27,0x8b,0x2c,0x1a,0x6c,0x1f,
-    0x60,0x84,0x5d,0x5d,0x6d,0x10,0x00,0x05,
-    0x00}},
-  {{0x47,0x27,0x27,0x8b,0x30,0x1e,0x9e,0x1f,
-    0x92,0x86,0x8f,0x8f,0x9f,0x30,0x00,0x05,
-    0x00}},
-  {{0x47,0x27,0x27,0x8b,0x2c,0x1a,0x6c,0x1f,
-    0x60,0x84,0x5d,0x5d,0x6d,0x10,0x00,0x05,
-    0x00}},
-  {{0x47,0x27,0x27,0x8b,0x2c,0x1a,0xee,0x1f,
-    0xe2,0x86,0xdf,0xdf,0xef,0x10,0x00,0x05,
-    0x00}},
-  {{0x51,0x31,0x31,0x95,0x36,0x04,0x66,0xf0,
-    0x5a,0x8e,0x57,0x57,0x67,0x20,0x00,0x01,
-    0x01}},
-  {{0x5f,0x3f,0x3f,0x83,0x44,0x92,0x0e,0xf5,
-    0x02,0x86,0xff,0xff,0x0f,0x10,0x00,0x01,
-    0x01}},
-  {{0x6f,0x4f,0x4f,0x93,0x54,0x82,0x0e,0x5a,
-    0x02,0x86,0xff,0xff,0x0f,0x09,0x00,0x05,
-    0x01}},
-  {{0x76,0x56,0x56,0x9a,0x5b,0x89,0x28,0x10,
-    0x1c,0x80,0x19,0x19,0x29,0x0b,0x00,0x05,
-    0x00}}
-};
-
-static const SiS310_LCDACRT1DataStruct  SiS310_LCDACRT11600x1200_1_H[]=
-{   /* MISSING */
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}}
-};
-
-static const SiS310_LCDACRT1DataStruct  SiS310_LCDACRT1800x600_2[]=
-{
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}}
-};
-
-static const SiS310_LCDACRT1DataStruct  SiS310_LCDACRT11024x768_2[]=
-{   /* Checked (1.10.6s) */
- {{0xa3,0x4f,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
-   0x4a,0x80,0x8f,0x8f,0x25,0x30,0x00,0x06,
-   0x00}},
- {{0xa3,0x4f,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
-   0x31,0x87,0x5d,0x5d,0x25,0x30,0x00,0x06,
-   0x00}},
- {{0xa3,0x4f,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
-   0x4a,0x80,0x8f,0x8f,0x25,0x30,0x00,0x06,
-   0x00}},
- {{0xa3,0x4f,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
-   0x31,0x87,0x5d,0x5d,0x25,0x30,0x00,0x06,
-   0x00}},
- {{0xa3,0x4f,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
-   0x72,0x88,0xdf,0xdf,0x25,0x30,0x00,0x06,
-   0x00}},
- {{0xa3,0x63,0x63,0x87,0x78,0x89,0x24,0xf1,
-   0xae,0x84,0x57,0x57,0x25,0x30,0x00,0x02,
-   0x01}},
- {{0xa3,0x7f,0x7f,0x87,0x86,0x97,0x24,0xf5,
-   0x02,0x88,0xff,0xff,0x25,0x10,0x00,0x02,
-   0x01}}
-};
-
-static const SiS310_LCDACRT1DataStruct  SiS310_LCDACRT11280x1024_2[]=
-{   /* Checked (1.10.6s) */
- {{0xa3,0x4f,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
-   0x4a,0x80,0x8f,0x8f,0x25,0x30,0x00,0x06,
-   0x00}},
- {{0xa3,0x4f,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
-   0x31,0x87,0x5d,0x5d,0x25,0x30,0x00,0x06,
-   0x00}},
- {{0xa3,0x4f,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
-   0x4a,0x80,0x8f,0x8f,0x25,0x30,0x00,0x06,
-   0x00}},
- {{0xa3,0x4f,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
-   0x31,0x87,0x5d,0x5d,0x25,0x30,0x00,0x06,
-   0x00}},
- {{0xa3,0x4f,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
-   0x72,0x88,0xdf,0xdf,0x25,0x30,0x00,0x06,
-   0x00}},
- {{0xa3,0x63,0x63,0x87,0x78,0x89,0x24,0xf1,
-   0xae,0x84,0x57,0x57,0x25,0x30,0x00,0x02,
-   0x01}},
- {{0xa3,0x7f,0x7f,0x87,0x86,0x97,0x24,0xf5,
-   0x02,0x88,0xff,0xff,0x25,0x10,0x00,0x02,
-   0x01}}
-};
-
-static const SiS310_LCDACRT1DataStruct  SiS310_LCDACRT11400x1050_2[]=
-{    /* Checked (1.10.6s) */
- {{0xce,0x4f,0x4f,0x92,0x8c,0x1a,0x28,0x9a,
-   0xdb,0x8f,0x8f,0x8f,0x29,0x21,0x00,0x03,
-   0x00}},
- {{0xce,0x4f,0x4f,0x92,0x8c,0x1a,0x28,0x9a,
-   0xc2,0x86,0x5d,0x5d,0x29,0x01,0x00,0x03,
-   0x01}},
- {{0xce,0x4f,0x4f,0x92,0x8c,0x1a,0x28,0x9a,
-   0xdb,0x8f,0x8f,0x8f,0x29,0x21,0x00,0x03,
-   0x00}},
- {{0xce,0x4f,0x4f,0x92,0x8c,0x1a,0x28,0x9a,
-   0xc2,0x86,0x5d,0x5d,0x29,0x01,0x00,0x03,
-   0x00}},
- {{0xce,0x4f,0x4f,0x92,0x8c,0x1a,0x28,0x9e,
-   0x03,0x87,0xdf,0xdf,0x29,0x01,0x00,0x03,
-   0x00}},
- {{0xce,0x63,0x63,0x92,0x96,0x04,0x28,0xd4,
-   0x3f,0x83,0x57,0x57,0x29,0x01,0x00,0x07,
-   0x01}},
- {{0xce,0x7f,0x7f,0x92,0xa4,0x12,0x28,0xd4,
-   0x93,0x87,0xff,0xff,0x29,0x21,0x00,0x07,
-   0x01}},
- {{0xce,0x9f,0x9f,0x92,0xb4,0x02,0x28,0x5a,
-   0x13,0x87,0xff,0xff,0x29,0x29,0x00,0x03,
-   0x01}},
- {{0xce,0xae,0xae,0x92,0xbc,0x0a,0x28,0x10,
-   0x20,0x84,0x19,0x19,0x29,0x0f,0x00,0x03,
-   0x00}}
-};
-
-static const SiS310_LCDACRT1DataStruct  SiS310_LCDACRT11600x1200_2[]=
-{    /* MISSING */
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}}
-};
-
-static const SiS310_LCDACRT1DataStruct  SiS310_LCDACRT1800x600_2_H[]=
-{
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}}
-};
-
-static const SiS310_LCDACRT1DataStruct  SiS310_LCDACRT11024x768_2_H[]=
-{   /* Checked (1.10.6s) */
- {{0x4f,0x27,0x27,0x93,0x39,0x01,0x24,0xbb,
-   0x4a,0x80,0x8f,0x8f,0x25,0x30,0x00,0x01,
-   0x00 }},
- {{0x4f,0x27,0x27,0x93,0x39,0x01,0x24,0xbb,
-   0x31,0x87,0x8d,0x5d,0x25,0x30,0x00,0x01,   /* <-- invalid data */
-   0x00 }},
- {{0x4f,0x27,0x27,0x93,0x39,0x01,0x24,0xbb,
-   0x4a,0x80,0x8f,0x8f,0x25,0x30,0x00,0x01,
-   0x00 }},
- {{0x4f,0x27,0x27,0x93,0x39,0x01,0x24,0xbb,
-   0x31,0x87,0x5d,0x5d,0x25,0x30,0x00,0x01,
-   0x00 }},
- {{0x4f,0x27,0x27,0x93,0x39,0x01,0x24,0xbb,
-   0x72,0x88,0xdf,0xdf,0x25,0x30,0x00,0x01,
-   0x00 }},
- {{0x4f,0x31,0x31,0x93,0x3e,0x06,0x24,0xf1,
-   0xae,0x84,0x57,0x57,0x25,0x30,0x00,0x01,  /* <-- invalid data */
-   0x01 }},
- {{0x4f,0x3f,0x3f,0x93,0x45,0x0d,0x24,0xf5,
-   0x02,0x88,0xff,0xff,0x25,0x10,0x00,0x01,
-   0x01 }}
-};
-
-static const SiS310_LCDACRT1DataStruct  SiS310_LCDACRT11280x1024_2_H[]=
-{   /* Checked (1.10.6s) */
- {{0x4f,0x27,0x27,0x93,0x39,0x81,0x24,0xbb,
-   0x4a,0x80,0x8f,0x8f,0x25,0x30,0x00,0x01,
-   0x00 }},
- {{0x4f,0x27,0x27,0x93,0x39,0x81,0x24,0xbb,
-   0x31,0x87,0x5d,0x5d,0x25,0x30,0x00,0x01,
-   0x00 }},
- {{0x4f,0x27,0x27,0x93,0x39,0x81,0x24,0xbb,
-   0x4a,0x80,0x8f,0x8f,0x25,0x30,0x00,0x01,
-   0x00 }},
- {{0x4f,0x27,0x27,0x93,0x39,0x81,0x24,0xbb,
-   0x31,0x87,0x5d,0x5d,0x25,0x30,0x00,0x01,
-   0x00 }},
- {{0x4f,0x27,0x27,0x93,0x39,0x81,0x24,0xbb,
-   0x72,0x88,0xdf,0xdf,0x25,0x30,0x00,0x01,
-   0x00 }},
- {{0x4f,0x31,0x31,0x93,0x3e,0x86,0x24,0xf1,
-   0xae,0x84,0x57,0x57,0x25,0x30,0x00,0x01,
-   0x01 }},
- {{0x4f,0x3f,0x3f,0x93,0x45,0x0d,0x24,0xf5,
-   0x02,0x88,0xff,0xff,0x25,0x10,0x00,0x01,
-   0x01 }}
+	{1232, 722},
+	{ 0, 805},
+	{ 0, 794},
+	{ 0,   0}
 };
 
-static const SiS310_LCDACRT1DataStruct  SiS310_LCDACRT11400x1050_2_H[]=
-{  /* Checked (1.10.6s) */
- {{0xa6,0x27,0x27,0x8a,0x64,0x92,0x28,0x9a,
-   0xdb,0x8f,0x8f,0x8f,0x29,0x21,0x00,0x06,
-   0x00}},
- {{0xa6,0x27,0x27,0x8a,0x64,0x92,0x28,0x9a,
-   0xc2,0x86,0x5d,0x5d,0x29,0x01,0x00,0x06,
-   0x00}},
- {{0xa6,0x27,0x27,0x8a,0x64,0x92,0x28,0x9a,
-   0xdb,0x8f,0x8f,0x8f,0x29,0x21,0x00,0x06,
-   0x00}},
- {{0xa6,0x27,0x27,0x8a,0x64,0x92,0x28,0x9a,
-   0xc2,0x86,0x5d,0x5d,0x29,0x01,0x00,0x06,
-   0x00}},
- {{0xa6,0x27,0x27,0x8a,0x64,0x92,0x28,0x9e,
-   0x03,0x87,0xdf,0xdf,0x29,0x01,0x00,0x06,
-   0x00}},
- {{0x9c,0x31,0x31,0x80,0x64,0x92,0x28,0xd4,
-   0x3f,0x83,0x57,0x57,0x29,0x01,0x00,0x06,
-   0x01}},
- {{0x8e,0x3f,0x3f,0x92,0x64,0x12,0x28,0xd4,
-   0x93,0x87,0xff,0xff,0x29,0x21,0x00,0x06,
-   0x01}},
- {{0x7e,0x4f,0x4f,0x82,0x64,0x12,0x28,0x5a,
-   0x13,0x87,0xff,0xff,0x29,0x29,0x00,0x06,
-   0x01}},
- {{0x76,0x56,0x56,0x9a,0x64,0x92,0x28,0x10,
-   0x20,0x84,0x19,0x19,0x29,0x0f,0x00,0x05,
-   0x00}}
+static const SiS310_LVDSDesStruct  SiS310_PanelType0e_2[]=
+{
+	{1152, 622},
+	{1152, 597},
+	{1152, 622},
+	{1152, 597},
+	{1152, 662},
+	{1232, 722},
+	{ 0, 805},
+	{ 0, 794},
+	{ 0,   0}
 };
 
-static const SiS310_LCDACRT1DataStruct  SiS310_LCDACRT11600x1200_2_H[]=
-{  /* MISSING */
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-   0x00}}
+static const SiS310_LVDSDesStruct  SiS310_PanelType0f_2[] =
+{
+	{1152, 622},
+	{1152, 597},
+	{1152, 622},
+	{1152, 597},
+	{1152, 662},
+	{1232, 722},
+	{ 0, 805},
+	{ 0, 794},
+	{ 0,   0}
 };
 
+/* CRT1 CRTC for SlaveModes and LCDA */
+
 typedef struct _SiS310_LVDSCRT1DataStruct
 {
  	UCHAR CR[15];
 } SiS310_LVDSCRT1DataStruct;
 
-static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT1320x480_1[] =
+static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT1800x600_1[] =
 {
- {{0x65,0x4f,0x89,0x56,0x83,0xaa,0x1f,
+ {{0x6b,0x4f,0x8f,0x55,0x85,0xaa,0x1f,
    0x90,0x85,0x8f,0xab,0x30,0x00,0x05,
    0x00 }},
- {{0x65,0x4f,0x89,0x56,0x83,0x83,0x1f,
+ {{0x6b,0x4f,0x8f,0x55,0x85,0x78,0x1f,
    0x5e,0x83,0x5d,0x79,0x10,0x00,0x05,
    0x00 }},
- {{0x65,0x4f,0x89,0x54,0x9f,0xc4,0x1f,
-   0x92,0x89,0x8f,0xb5,0x30,0x00,0x01,
+ {{0x6b,0x4f,0x8f,0x55,0x85,0xaa,0x1f,
+   0x90,0x85,0x8f,0xab,0x30,0x00,0x05,
    0x00 }},
- {{0x65,0x4f,0x89,0x56,0x83,0x83,0x1f,
+ {{0x6b,0x4f,0x8f,0x55,0x85,0x78,0x1f,
    0x5e,0x83,0x5d,0x79,0x10,0x00,0x05,
    0x00 }},
- {{0x65,0x4f,0x89,0x56,0x83,0x04,0x3e,
+ {{0x6b,0x4f,0x8f,0x55,0x85,0xfa,0x1f,
    0xe0,0x85,0xdf,0xfb,0x10,0x00,0x05,
    0x00 }},
- {{0x7f,0x63,0x83,0x6c,0x1c,0x72,0xf0,
+ {{0x7f,0x63,0x83,0x69,0x19,0x72,0xf0,
    0x58,0x8c,0x57,0x73,0x20,0x00,0x06,
-   0x01 }},
- {{0x2d,0x27,0x90,0x2c,0x80,0x0b,0x3e,
-   0xe9,0x8b,0xe7,0x04,0x00,0x00,0x00,
-   0x00 }}
+   0x01 }}
 };
 
-static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT1800x600_1[] =   
+static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT1800x600_1_H[] =
 {
- {{0x6b,0x4f,0x8f,0x55,0x85,0xaa,0x1f,
+ {{0x43,0x27,0x87,0x2d,0x1d,0xaa,0x1f,
    0x90,0x85,0x8f,0xab,0x30,0x00,0x05,
    0x00 }},
- {{0x6b,0x4f,0x8f,0x55,0x85,0x78,0x1f,
+ {{0x43,0x27,0x87,0x2d,0x1d,0x78,0x1f,
    0x5e,0x83,0x5d,0x79,0x10,0x00,0x05,
    0x00 }},
- {{0x6b,0x4f,0x8f,0x55,0x85,0xaa,0x1f,
-   0x90,0x85,0x8f,0xab,0x30,0x00,0x05,
+ {{0x43,0x27,0x87,0x2d,0x1d,0xfa,0x1f,
+   0xe0,0x85,0xdf,0xfb,0x10,0x00,0x05,
    0x00 }},
- {{0x6b,0x4f,0x8f,0x55,0x85,0x78,0x1f,
+ {{0x43,0x27,0x87,0x2d,0x1d,0x78,0x1f,
    0x5e,0x83,0x5d,0x79,0x10,0x00,0x05,
    0x00 }},
- {{0x6b,0x4f,0x8f,0x55,0x85,0xfa,0x1f,
+ {{0x43,0x27,0x87,0x2d,0x1d,0xfa,0x1f,
    0xe0,0x85,0xdf,0xfb,0x10,0x00,0x05,
    0x00 }},
+ {{0x4d,0x31,0x91,0x37,0x07,0x72,0xf0,
+   0x58,0x8d,0x57,0x73,0x20,0x00,0x01,
+   0x01 }}
+};
+
+static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT1800x600_2[]=
+{
+ {{0x7f,0x4f,0x83,0x62,0x12,0x72,0x3e,
+   0xff,0x84,0x8f,0x73,0x00,0x00,0x06,
+   0x00 }},
+ {{0x7f,0x4f,0x83,0x62,0x12,0x72,0x3e,
+   0xe6,0x8b,0x5d,0x73,0x00,0x00,0x06,
+   0x00 }},
+ {{0x7f,0x4f,0x83,0x62,0x12,0x72,0x3e,
+   0xff,0x84,0x8f,0x73,0x00,0x00,0x06,
+   0x00 }},
+ {{0x7f,0x4f,0x83,0x62,0x12,0x72,0x3e,
+   0xe6,0x8b,0x5d,0x73,0x00,0x00,0x06,
+   0x00 }},
+ {{0x7f,0x4f,0x83,0x62,0x12,0x72,0xba,
+   0x27,0x8c,0xdf,0x73,0x00,0x00,0x06,
+   0x00 }},
  {{0x7f,0x63,0x83,0x69,0x19,0x72,0xf0,
-   0x58,0x8c,0x57,0x73,0x20,0x00,0x06,
+   0x58,0x8d,0x57,0x73,0x20,0x00,0x06,
+   0x01 }}
+};
+
+static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT1800x600_2_H[] =
+{
+ {{0x57,0x27,0x9b,0x3a,0x0a,0x72,0x3e,
+   0xff,0x84,0x8f,0x73,0x00,0x00,0x01,
+   0x00 }},
+ {{0x57,0x27,0x9b,0x3a,0x0a,0x72,0x3e,
+   0xd6,0x8b,0x5d,0x73,0x00,0x00,0x01,
+   0x00 }},
+ {{0x57,0x27,0x9b,0x3a,0x0a,0x72,0x3e,
+   0xff,0x84,0x8f,0x73,0x00,0x00,0x01,
+   0x00 }},
+ {{0x57,0x27,0x9b,0x3a,0x0a,0x72,0x3e,
+   0xd6,0x8b,0x5d,0x73,0x00,0x00,0x01,
+   0x00 }},
+ {{0x57,0x27,0x9b,0x3a,0x0a,0x72,0xba,
+   0x27,0x8c,0xdf,0x73,0x00,0x00,0x01,
+   0x00 }},
+ {{0x4d,0x31,0x91,0x3a,0x0a,0x72,0xf0,
+   0x63,0x88,0x57,0x73,0x00,0x00,0x01,
    0x01 }}
 };
 
-static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT11024x768_1[] =    
+static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT11024x768_1[] =
 {
  {{0x73,0x4f,0x97,0x53,0x84,0xb4,0x1f,
    0x92,0x89,0x8f,0xb5,0x30,0x00,0x05,
@@ -3677,57 +2326,7 @@
    0x01}}
 };
 
-static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT11280x1024_1[] =   
-{
- {{0x7e,0x4f,0x82,0x58,0x04,0xb8,0x1f,
-   0x90,0x84,0x8f,0xb9,0x30,0x00,0x06,
-   0x00}},
- {{0x7e,0x4f,0x82,0x58,0x04,0x86,0x1f,
-   0x5e,0x82,0x5d,0x87,0x10,0x00,0x06,
-   0x00}},
- {{0x7e,0x4f,0x82,0x58,0x04,0xb8,0x1f,
-   0x90,0x84,0x8f,0xb9,0x30,0x00,0x06,
-   0x00}},
- {{0x7e,0x4f,0x82,0x58,0x04,0x86,0x1f,
-   0x5e,0x82,0x5d,0x87,0x10,0x00,0x06,
-   0x00}},
- {{0x7e,0x4f,0x82,0x58,0x04,0x08,0x3e,
-   0xe0,0x84,0xdf,0x09,0x00,0x00,0x06,
-   0x00}},
- {{0x92,0x63,0x96,0x6c,0x18,0x80,0xf0,
-   0x58,0x8c,0x57,0x81,0x20,0x00,0x06,
-   0x01}},
- {{0xae,0x7f,0x92,0x88,0x94,0x28,0xf5,
-   0x00,0x84,0xff,0x29,0x10,0x00,0x02,
-   0x01}},
- {{0xce,0x9f,0x92,0xa8,0x14,0x28,0x5a,
-   0x00,0x84,0xff,0x29,0x09,0x00,0x07,
-   0x01}}
-};
-
-static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT1800x600_1_H[] =   
-{
- {{0x43,0x27,0x87,0x2d,0x1d,0xaa,0x1f,
-   0x90,0x85,0x8f,0xab,0x30,0x00,0x05,
-   0x00 }},
- {{0x43,0x27,0x87,0x2d,0x1d,0x78,0x1f,
-   0x5e,0x83,0x5d,0x79,0x10,0x00,0x05,
-   0x00 }},
- {{0x43,0x27,0x87,0x2d,0x1d,0xfa,0x1f,
-   0xe0,0x85,0xdf,0xfb,0x10,0x00,0x05,
-   0x00 }},
- {{0x43,0x27,0x87,0x2d,0x1d,0x78,0x1f,
-   0x5e,0x83,0x5d,0x79,0x10,0x00,0x05,
-   0x00 }},
- {{0x43,0x27,0x87,0x2d,0x1d,0xfa,0x1f,
-   0xe0,0x85,0xdf,0xfb,0x10,0x00,0x05,
-   0x00 }},
- {{0x4d,0x31,0x91,0x37,0x07,0x72,0xf0,
-   0x58,0x8d,0x57,0x73,0x20,0x00,0x01,
-   0x01 }}
-};
-
-static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT11024x768_1_H[] = 
+static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT11024x768_1_H[] =
 {
  {{0x4b,0x27,0x8f,0x2b,0x1c,0xb4,0x1f,
    0x92,0x89,0x8f,0xb5,0x30,0x00,0x05,
@@ -3752,55 +2351,8 @@
    0x01 }}
 };
 
-static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT11280x1024_1_H[] =  
-{
- {{0x56,0x27,0x9a,0x31,0x1c,0xb8,0x1f,
-   0x90,0x84,0x8f,0xb9,0x30,0x00,0x05,
-   0x00}},
- {{0x56,0x27,0x9a,0x31,0x1c,0x86,0x1f,
-   0x5e,0x82,0x5d,0x87,0x10,0x00,0x05,
-   0x00}},
- {{0x56,0x27,0x9a,0x31,0x1c,0xb8,0x1f,
-   0x90,0x84,0x8f,0xb9,0x30,0x00,0x05,
-   0x00}},
- {{0x56,0x27,0x9a,0x31,0x1c,0x86,0x1f,
-   0x5e,0x82,0x5d,0x87,0x10,0x00,0x05,
-   0x01}},
- {{0x56,0x27,0x9a,0x31,0x1c,0x08,0x3e,
-   0xe0,0x84,0xdf,0x09,0x00,0x00,0x05,
-   0x00}},
- {{0x60,0x31,0x84,0x3a,0x86,0x80,0xf0,
-   0x58,0x8c,0x57,0x81,0x20,0x00,0x01,
-   0x01}},
- {{0x6e,0x3f,0x92,0x48,0x94,0x28,0xf5,
-   0x00,0x84,0xff,0x29,0x10,0x00,0x01,
-   0x01}}
-};
-
-static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT1800x600_2[]=  
+static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT11024x768_2[] =
 {
- {{0x7f,0x4f,0x83,0x62,0x12,0x72,0x3e,
-   0xff,0x84,0x8f,0x73,0x00,0x00,0x06,
-   0x00 }},
- {{0x7f,0x4f,0x83,0x62,0x12,0x72,0x3e,
-   0xe6,0x8b,0x5d,0x73,0x00,0x00,0x06,
-   0x00 }},
- {{0x7f,0x4f,0x83,0x62,0x12,0x72,0x3e,
-   0xff,0x84,0x8f,0x73,0x00,0x00,0x06,
-   0x00 }},
- {{0x7f,0x4f,0x83,0x62,0x12,0x72,0x3e,
-   0xe6,0x8b,0x5d,0x73,0x00,0x00,0x06,
-   0x00 }},
- {{0x7f,0x4f,0x83,0x62,0x12,0x72,0xba,
-   0x27,0x8c,0xdf,0x73,0x00,0x00,0x06,
-   0x00 }},
- {{0x7f,0x63,0x83,0x69,0x19,0x72,0xf0,
-   0x58,0x8d,0x57,0x73,0x20,0x00,0x06,
-   0x01 }}
-};
-
-static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT11024x768_2[] = 
-{ 
  {{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
    0x57,0x8e,0x8f,0x25,0x30,0x00,0x06,
    0x00 }},
@@ -3824,6 +2376,84 @@
    0x01 }}
 };
 
+static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT11024x768_2_H[] =
+{
+ {{0x7b,0x27,0x9f,0x46,0x97,0x24,0xbb,
+   0x57,0x8e,0x8f,0x25,0x30,0x00,0x01,
+   0x00 }},
+ {{0x7b,0x27,0x9f,0x46,0x97,0x24,0xbb,
+   0x3e,0x85,0x5d,0x25,0x10,0x00,0x01,
+   0x00 }},
+ {{0x7b,0x27,0x9f,0x46,0x97,0x24,0xbb,
+   0x57,0x8e,0x8f,0x25,0x30,0x00,0x01,
+   0x00 }},
+ {{0x7b,0x27,0x9f,0x46,0x97,0x24,0xbb,
+   0x3e,0x85,0x5d,0x25,0x10,0x00,0x01,
+   0x00 }},
+ {{0x7b,0x27,0x9f,0x46,0x97,0x24,0xbb,
+   0x7f,0x86,0xdf,0x25,0x10,0x00,0x01,
+   0x00 }},
+ {{0x71,0x31,0x95,0x46,0x97,0x24,0xf1,
+   0xbb,0x82,0x57,0x25,0x10,0x00,0x01,
+   0x01 }},
+ {{0x63,0x3f,0x87,0x46,0x97,0x24,0xf5,
+   0x0f,0x86,0xff,0x25,0x30,0x00,0x01,
+   0x01 }}
+};
+
+static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT11280x1024_1[] =
+{
+ {{0x7e,0x4f,0x82,0x58,0x04,0xb8,0x1f,
+   0x90,0x84,0x8f,0xb9,0x30,0x00,0x06,
+   0x00}},
+ {{0x7e,0x4f,0x82,0x58,0x04,0x86,0x1f,
+   0x5e,0x82,0x5d,0x87,0x10,0x00,0x06,
+   0x00}},
+ {{0x7e,0x4f,0x82,0x58,0x04,0xb8,0x1f,
+   0x90,0x84,0x8f,0xb9,0x30,0x00,0x06,
+   0x00}},
+ {{0x7e,0x4f,0x82,0x58,0x04,0x86,0x1f,
+   0x5e,0x82,0x5d,0x87,0x10,0x00,0x06,
+   0x00}},
+ {{0x7e,0x4f,0x82,0x58,0x04,0x08,0x3e,
+   0xe0,0x84,0xdf,0x09,0x00,0x00,0x06,
+   0x00}},
+ {{0x92,0x63,0x96,0x6c,0x18,0x80,0xf0,
+   0x58,0x8c,0x57,0x81,0x20,0x00,0x06,
+   0x01}},
+ {{0xae,0x7f,0x92,0x88,0x94,0x28,0xf5,
+   0x00,0x84,0xff,0x29,0x10,0x00,0x02,
+   0x01}},
+ {{0xce,0x9f,0x92,0xa8,0x14,0x28,0x5a,
+   0x00,0x84,0xff,0x29,0x09,0x00,0x07,
+   0x01}}
+};
+
+static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT11280x1024_1_H[] =
+{
+ {{0x56,0x27,0x9a,0x31,0x1c,0xb8,0x1f,
+   0x90,0x84,0x8f,0xb9,0x30,0x00,0x05,
+   0x00}},
+ {{0x56,0x27,0x9a,0x31,0x1c,0x86,0x1f,
+   0x5e,0x82,0x5d,0x87,0x10,0x00,0x05,
+   0x00}},
+ {{0x56,0x27,0x9a,0x31,0x1c,0xb8,0x1f,
+   0x90,0x84,0x8f,0xb9,0x30,0x00,0x05,
+   0x00}},
+ {{0x56,0x27,0x9a,0x31,0x1c,0x86,0x1f,
+   0x5e,0x82,0x5d,0x87,0x10,0x00,0x05,
+   0x01}},
+ {{0x56,0x27,0x9a,0x31,0x1c,0x08,0x3e,
+   0xe0,0x84,0xdf,0x09,0x00,0x00,0x05,
+   0x00}},
+ {{0x60,0x31,0x84,0x3a,0x86,0x80,0xf0,
+   0x58,0x8c,0x57,0x81,0x20,0x00,0x01,
+   0x01}},
+ {{0x6e,0x3f,0x92,0x48,0x94,0x28,0xf5,
+   0x00,0x84,0xff,0x29,0x10,0x00,0x01,
+   0x01}}
+};
+
 static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT11280x1024_2[] =  
 {
  {{0xce,0x72,0x91,0x81,0x8f,0x28,0x92,
@@ -3852,53 +2482,6 @@
    0x01}}
 };
 
-static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT1800x600_2_H[] =  
-{
- {{0x57,0x27,0x9b,0x3a,0x0a,0x72,0x3e,
-   0xff,0x84,0x8f,0x73,0x00,0x00,0x01,
-   0x00 }},
- {{0x57,0x27,0x9b,0x3a,0x0a,0x72,0x3e,
-   0xd6,0x8b,0x5d,0x73,0x00,0x00,0x01,
-   0x00 }},
- {{0x57,0x27,0x9b,0x3a,0x0a,0x72,0x3e,
-   0xff,0x84,0x8f,0x73,0x00,0x00,0x01,
-   0x00 }},
- {{0x57,0x27,0x9b,0x3a,0x0a,0x72,0x3e,
-   0xd6,0x8b,0x5d,0x73,0x00,0x00,0x01,
-   0x00 }},
- {{0x57,0x27,0x9b,0x3a,0x0a,0x72,0xba,
-   0x27,0x8c,0xdf,0x73,0x00,0x00,0x01,
-   0x00 }},
- {{0x4d,0x31,0x91,0x3a,0x0a,0x72,0xf0,
-   0x63,0x88,0x57,0x73,0x00,0x00,0x01,
-   0x01 }}
-};
-
-static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT11024x768_2_H[] =  
-{ 
- {{0x7b,0x27,0x9f,0x46,0x97,0x24,0xbb,
-   0x57,0x8e,0x8f,0x25,0x30,0x00,0x01,
-   0x00 }},
- {{0x7b,0x27,0x9f,0x46,0x97,0x24,0xbb,
-   0x3e,0x85,0x5d,0x25,0x10,0x00,0x01,
-   0x00 }},
- {{0x7b,0x27,0x9f,0x46,0x97,0x24,0xbb,
-   0x57,0x8e,0x8f,0x25,0x30,0x00,0x01,
-   0x00 }},
- {{0x7b,0x27,0x9f,0x46,0x97,0x24,0xbb,
-   0x3e,0x85,0x5d,0x25,0x10,0x00,0x01,
-   0x00 }},
- {{0x7b,0x27,0x9f,0x46,0x97,0x24,0xbb,
-   0x7f,0x86,0xdf,0x25,0x10,0x00,0x01,
-   0x00 }},
- {{0x71,0x31,0x95,0x46,0x97,0x24,0xf1,
-   0xbb,0x82,0x57,0x25,0x10,0x00,0x01,
-   0x01 }},
- {{0x63,0x3f,0x87,0x46,0x97,0x24,0xf5,
-   0x0f,0x86,0xff,0x25,0x30,0x00,0x01,
-   0x01 }}
-};
-
 static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT11280x1024_2_H[] = 
 {
  {{0xa6,0x4a,0x89,0x59,0x07,0x28,0x92,
@@ -3924,63 +2507,7 @@
    0x01}}
 };
 
-static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT1XXXxXXX_1[] =  
-{
- {{0x5f,0x4f,0x82,0x55,0x81,0xbf,0x1f,
-   0x9c,0x8e,0x96,0xb9,0x30,0x00,0x05,
-   0x00}},
- {{0x5f,0x4f,0x82,0x55,0x81,0xbf,0x1f,
-   0x9c,0x8e,0x96,0xb9,0x30,0x00,0x05,
-   0x00}},
- {{0x5f,0x4f,0x82,0x55,0x81,0xbf,0x1f,
-   0x9c,0x8e,0x96,0xb9,0x30,0x00,0x05,
-   0x00}},
- {{0x5f,0x4f,0x82,0x55,0x81,0xbf,0x1f,
-   0x9c,0x8e,0x96,0xb9,0x30,0x00,0x05,
-   0x00}},
- {{0x5f,0x4f,0x82,0x55,0x81,0x0b,0x3e,
-   0xe9,0x8b,0xe7,0x04,0x00,0x00,0x05,
-   0x00}},
- {{0x7f,0x63,0x83,0x6c,0x1c,0x72,0xf0,
-   0x58,0x8c,0x57,0x73,0x20,0x00,0x06,
-   0x01}},
- {{0xa3,0x7f,0x87,0x86,0x97,0x24,0xf5,
-   0x02,0x88,0xff,0x25,0x10,0x00,0x02,
-   0x01}},
- {{0xce,0x9f,0x92,0xa8,0x14,0x28,0x5a,
-   0x00,0x84,0xff,0x29,0x09,0x00,0x07,
-   0x01}},
- {{0xce,0x9f,0x92,0xa9,0x17,0x24,0xf5,
-   0x02,0x88,0xff,0x25,0x10,0x00,0x07,
-   0x01}}
-};
-
-static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT1XXXxXXX_1_H[] = 
-{
- {{0x38,0x27,0x9c,0x2c,0x80,0xbf,0x1f,
-   0x9c,0x8e,0x96,0xb9,0x30,0x00,0x00,
-   0x00}},
- {{0x38,0x27,0x9c,0x2c,0x80,0xbf,0x1f,
-   0x9c,0x8e,0x96,0xb9,0x30,0x00,0x00,
-   0x00}},
- {{0x38,0x27,0x9c,0x2c,0x80,0xbf,0x1f,
-   0x9c,0x8e,0x96,0xb9,0x30,0x00,0x00,
-   0x00}},
- {{0x38,0x27,0x9c,0x2c,0x80,0xbf,0x1f,
-   0x9c,0x8e,0x96,0xb9,0x30,0x00,0x00,
-   0x00}},
- {{0x38,0x27,0x9c,0x2c,0x80,0x0b,0x3e,
-   0xe9,0x8b,0xe7,0x04,0x00,0x00,0x00,
-   0x00}},
- {{0x4d,0x31,0x91,0x3b,0x03,0x72,0xf0,
-   0x58,0x8c,0x57,0x73,0x20,0x00,0x01,
-   0x01}},
- {{0x63,0x3f,0x87,0x4a,0x92,0x24,0xf5,
-   0x02,0x88,0xff,0x25,0x10,0x00,0x01,
-   0x01}}
-};
-
-static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT11400x1050_1[] =  
+static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT11400x1050_1[] =
 {
   {{0x6f,0x4f,0x93,0x54,0x82,0x9e,0x1f,
     0x8f,0x81,0x8f,0x9f,0x30,0x00,0x05,
@@ -4220,332 +2747,39 @@
 #endif   
 };
 
-static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT11280x768_1[] =  
-{	
- {{0x5b,0x4f,0x9f,0x55,0x19,0xb4,0x1f,
-   0x9c,0x8e,0x8f,0xb5,0x10,0x00,0x01,
-   0x00}},
- {{0x5b,0x4f,0x9f,0x55,0x19,0x82,0x1f,
-   0x6a,0x8c,0x5d,0x83,0x30,0x00,0x01,
-   0x00}},
- {{0x5b,0x4f,0x9f,0x55,0x19,0xb4,0x1f,
-   0x9c,0x8e,0x8f,0xb5,0x10,0x00,0x01,
-   0x00}},
- {{0x5b,0x4f,0x9f,0x55,0x19,0x82,0x1f,
-   0x6a,0x8c,0x5d,0x83,0x30,0x00,0x01,
-   0x00}},
- {{0x5b,0x4f,0x9f,0x55,0x19,0x04,0x3e,
-   0xec,0x8e,0xdf,0x05,0x20,0x00,0x01,
-   0x00}},
- {{0x6f,0x63,0x93,0x69,0x8d,0x7c,0xf0,
-   0x64,0x86,0x57,0x7d,0x20,0x00,0x05,
-   0x01}},
- {{0x8b,0x7f,0x8f,0x85,0x09,0x24,0xf5,
-   0x0c,0x8e,0xff,0x25,0x30,0x00,0x02,
-   0x01}},
- {{0xab,0x9f,0x8f,0xa5,0x89,0x24,0xf5,
-   0x0c,0x8e,0xff,0x25,0x30,0x00,0x06,
-   0x01}},
- {{0xab,0x9f,0x8f,0xa5,0x89,0x24,0xf5,
-   0x0c,0x8e,0xff,0x25,0x30,0x00,0x06,
-   0x01}}
-};
-
-static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT11280x768_1_H[] = 
+static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT11600x1200_1[] =
 {
- {{0x47,0x27,0x8b,0x2c,0x1a,0x9e,0x1f,
-   0x93,0x86,0x8f,0x9f,0x30,0x00,0x05,
-   0x00}},
- {{0x47,0x27,0x8b,0x2c,0x1a,0x6c,0x1f,
-   0x60,0x84,0x5d,0x6d,0x10,0x00,0x05,
-   0x00}},
- {{0x47,0x27,0x8b,0x30,0x1e,0x9e,0x1f,
-   0x92,0x86,0x8f,0x9f,0x30,0x00,0x05,
-   0x00}},
- {{0x47,0x27,0x8b,0x2c,0x1a,0x6c,0x1f,
-   0x60,0x84,0x5d,0x6d,0x10,0x00,0x05,
-   0x00}},
- {{0x47,0x27,0x8b,0x2c,0x1a,0xee,0x1f,
-   0xe2,0x86,0xdf,0xef,0x10,0x00,0x05,
+ {{0x83,0x4F,0x87,0x5B,0x13,0x06,0x3E,
+   0xB3,0x86,0x8F,0x07,0x20,0x00,0x06,
    0x00}},
- {{0x51,0x31,0x95,0x36,0x04,0x66,0xf0,
-   0x5a,0x8e,0x57,0x67,0x20,0x00,0x01,
-   0x01}},
- {{0x5f,0x3f,0x83,0x44,0x92,0x0e,0xf5,
-   0x02,0x86,0xff,0x0f,0x10,0x00,0x01,
-   0x01}},
- {{0x6f,0x4f,0x93,0x54,0x82,0x0e,0x5a,
-   0x02,0x86,0xff,0x0f,0x09,0x00,0x05,
-   0x01}},
- {{0x6f,0x4f,0x93,0x54,0x82,0x0e,0x5a,
-   0x02,0x86,0xff,0x0f,0x09,0x00,0x05,
-   0x01}}
-};
-
-static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT11280x768_2[] = 
-{
- {{0xab,0x60,0x9f,0x80,0x04,0x24,0xbb,
-   0x54,0x86,0xdb,0xda,0x00,0x00,0x02,
+ {{0x83,0x4F,0x87,0x5B,0x13,0xD4,0x1F,
+   0x81,0x84,0x5D,0xD5,0x10,0x00,0x06,
    0x00}},
- {{0xab,0x60,0x9f,0x80,0x04,0x24,0xbb,
-   0x3b,0x8d,0xc2,0xc1,0x00,0x00,0x02,
+ {{0x83,0x4F,0x87,0x5B,0x13,0x06,0x3E,
+   0xB3,0x86,0x8F,0x07,0x20,0x00,0x06,
    0x00}},
- {{0xab,0x60,0x9f,0x80,0x04,0x24,0xbb,
-   0x54,0x86,0xdb,0xda,0x00,0x00,0x02,
+ {{0x83,0x4F,0x87,0x5B,0x13,0xD4,0x1F,
+   0x81,0x84,0x5D,0xD5,0x10,0x00,0x06,
    0x00}},
- {{0xab,0x60,0x9f,0x80,0x04,0x24,0xbb,
-   0x3b,0x8d,0xc2,0xc1,0x00,0x00,0x02,
+ {{0x83,0x4F,0x87,0x5B,0x13,0x56,0xBA,
+   0x03,0x86,0xDF,0x57,0x00,0x00,0x06,
    0x00}},
- {{0xab,0x60,0x9f,0x80,0x04,0x24,0xb3,
-   0x7c,0x8e,0x03,0x02,0x10,0x00,0x02,
-   0x01}},
- {{0xab,0x63,0x8f,0x8a,0x8e,0x24,0xf1,
-   0xb6,0x88,0x57,0x25,0x10,0x00,0x02,
+ {{0x97,0x63,0x9B,0x6F,0x07,0xCE,0xF0,
+   0x7B,0x8E,0x57,0xCF,0x20,0x00,0x02,
    0x01}},
- {{0xab,0x7f,0x8f,0x98,0x9c,0x24,0xf5,
-   0x0a,0x8c,0xff,0x25,0x30,0x00,0x02,
+ {{0xB3,0x7F,0x97,0x8B,0x83,0x76,0xF5,
+   0x23,0x86,0xFF,0x77,0x10,0x00,0x06,
    0x01}},
- {{0xab,0x9f,0x8f,0xa8,0x8c,0x24,0xf5,
-   0x0a,0x8c,0xff,0x25,0x30,0x00,0x06,
+ {{0xD3,0x9F,0x97,0xAB,0x03,0x76,0x5A,
+   0x23,0x86,0xFF,0x77,0x09,0x00,0x03,
    0x01}},
- {{0xab,0x9f,0x8f,0xa8,0x8c,0x24,0xf5,
-   0x0a,0x8c,0xff,0x25,0x30,0x00,0x06,
-   0x01}}
-};
-
-static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT11280x768_2_H[] =
-{
- {{0x83,0x38,0x97,0x58,0x9c,0x24,0xbb,
-   0x54,0x86,0xdb,0xda,0x00,0x00,0x01,
+ {{0xE2,0xAE,0x86,0xBA,0x92,0x90,0x10,
+   0x3D,0x80,0x19,0x91,0x0F,0x00,0x03,
    0x00}},
- {{0x83,0x38,0x97,0x58,0x9c,0x24,0xbb,
-   0x3b,0x8d,0xc2,0xc1,0x00,0x00,0x01,
-   0x00}},
- {{0x83,0x38,0x97,0x58,0x9c,0x24,0xbb,
-   0x54,0x86,0xdb,0xda,0x00,0x00,0x01,
-   0x00}},
- {{0x83,0x38,0x97,0x58,0x9c,0x24,0xbb,
-   0x3b,0x8d,0xc2,0xc1,0x00,0x00,0x01,
-   0x00}},
- {{0x83,0x38,0x97,0x58,0x9c,0x24,0xb3,
-   0x7c,0x8e,0x03,0x02,0x10,0x00,0x01,
-   0x01}},
- {{0x79,0x31,0x9d,0x58,0x9c,0x24,0xf1,
-   0xb6,0x88,0x57,0x25,0x10,0x00,0x01,
-   0x01}},
- {{0x6b,0x3f,0x8f,0x58,0x9c,0x24,0xf5,
-   0x0a,0x8c,0xff,0x25,0x30,0x00,0x01,
-   0x01}},
- {{0xab,0x9f,0x8f,0xa8,0x8c,0x24,0xf5,
-   0x0a,0x8c,0xff,0x25,0x30,0x00,0x06,
-   0x01}},
- {{0xab,0x9f,0x8f,0xa8,0x8c,0x24,0xf5,
-   0x0a,0x8c,0xff,0x25,0x30,0x00,0x06,
-   0x01}}
-};
-
-static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT11024x600_1[] =
-{
-        {{0x64,0x4f,0x88,0x54,0x9f,0x5a,0x3e,
-	  0xe8,0x8f,0x8f,0x5b,0x00,0x00,0x01,
-	  0x00}},
-        {{0x64,0x4f,0x88,0x54,0x9f,0x2e,0x3e,
-	  0xb9,0x80,0x5d,0x2f,0x00,0x00,0x01,
-	  0x00}},
-        {{0x64,0x4f,0x88,0x54,0x9f,0x5a,0x3e,
-	  0xe8,0x8f,0x8f,0x5b,0x00,0x00,0x01,
-	  0x00}},
-        {{0x64,0x4f,0x88,0x54,0x9f,0x2e,0x3e,
-	  0xb9,0x80,0x5d,0x2f,0x00,0x00,0x01,
-	  0x00}},
-        {{0x64,0x4f,0x88,0x54,0x9f,0xaf,0xba,
-	  0x3b,0x82,0xdf,0xb0,0x00,0x00,0x01,
-	  0x00}},
-        {{0x7e,0x63,0x82,0x68,0x15,0x1e,0xf1,
-	  0xae,0x85,0x57,0x1f,0x30,0x00,0x26,
-	  0x01}},
-        {{0xa3,0x7f,0x87,0x86,0x97,0x1e,0xf1,
-	  0xae,0x85,0x57,0x1f,0x30,0x00,0x02,
-	  0x01}}
-};
-
-static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT11024x600_1_H[] =
-{
-        {{0x2f,0x27,0x93,0x2b,0x90,0xc4,0x1f,
-	  0x92,0x89,0x8f,0xb5,0x30,0x00,0x44,
-	  0x00}},
-        {{0x2f,0x27,0x93,0x2b,0x90,0x97,0x1f,
-	  0x60,0x87,0x5d,0x83,0x10,0x00,0x44,
-          0x00}},
-        {{0x2f,0x27,0x93,0x2b,0x90,0xc4,0x1f,
-	  0x92,0x89,0x8f,0xb5,0x30,0x00,0x44,
-	  0x00}},
-        {{0x2f,0x27,0x93,0x2b,0x90,0x97,0x1f,
-	  0x60,0x87,0x5d,0x83,0x10,0x00,0x44,
-	  0x00}},
-        {{0x2f,0x27,0x93,0x2b,0x90,0x04,0x3e,
-	  0xe2,0x89,0xdf,0x05,0x00,0x00,0x44,
-	  0x00}},
-        {{0x3c,0x31,0x80,0x35,0x1c,0x7c,0xf0,
-	  0x5a,0x8f,0x57,0x7d,0x20,0x00,0x55,
-	  0x01}},
-        {{0x4f,0x3f,0x93,0x45,0x0d,0x24,0xf5,
-	  0x02,0x88,0xff,0x25,0x10,0x00,0x01,
-	  0x01}}
-};
-
-static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT11024x600_2[] =
-{
-        {{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
-	  0x4a,0x80,0x8f,0x25,0x30,0x00,0x06,
-	  0x00}},
-        {{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
-	  0x31,0x87,0x5d,0x25,0x30,0x00,0x06,
-	  0x00}},
-        {{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
-	  0x4a,0x80,0x8f,0x25,0x30,0x00,0x06,
-	  0x00}},
-        {{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
-          0x31,0x87,0x5d,0x25,0x30,0x00,0x06,
-	  0x00}},
-        {{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
-	  0x72,0x88,0xdf,0x25,0x30,0x00,0x06,
-	  0x00}},
-        {{0xa3,0x63,0x87,0x78,0x89,0x24,0xf1,
-	  0xae,0x84,0x57,0x25,0x30,0x00,0x02,
-	  0x01}},
-        {{0xa3,0x7f,0x87,0x86,0x97,0x24,0xf5,
-	  0x02,0x88,0xff,0x25,0x10,0x00,0x02,
-	  0x01}}
-};
-
-static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT11024x600_2_H[] =
-{
-        {{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb,
-	  0x4a,0x80,0x8f,0x25,0x30,0x00,0x01,
-	  0x00}},
-        {{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb,
-	  0x31,0x87,0x5d,0x25,0x30,0x00,0x01,
-	  0x00}},
-        {{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb,
-	  0x4a,0x80,0x8f,0x25,0x30,0x00,0x01,
-	  0x00}},
-        {{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb,
-	  0x31,0x87,0x5d,0x25,0x30,0x00,0x01,
-	  0x00}},
-        {{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb,
-	  0x72,0x88,0xdf,0x25,0x30,0x00,0x01,
-	  0x00}},
-        {{0x4f,0x31,0x93,0x3e,0x06,0x24,0xf1,
-	  0xae,0x84,0x57,0x25,0x30,0x00,0x01,
-	  0x01}},
-        {{0x4f,0x3f,0x93,0x45,0x0d,0x24,0xf5,
-	  0x02,0x88,0xff,0x25,0x10,0x00,0x01,
-	  0x01}}
-};
-
-static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT11152x768_1[] =
-{
-        {{0x64,0x4f,0x88,0x54,0x9f,0xc4,0x1f,
-	  0x92,0x89,0x8f,0xb5,0x30,0x00,0x01,
-	  0x00}},
-        {{0x64,0x4f,0x88,0x54,0x9f,0x97,0x1f,
-	  0x60,0x87,0x5d,0x83,0x10,0x00,0x01,
-	  0x00}},
-        {{0x64,0x4f,0x88,0x54,0x9f,0xc4,0x1f,
-	  0x92,0x89,0x8f,0xb5,0x30,0x00,0x01,
-	  0x00}},
-        {{0x64,0x4f,0x88,0x54,0x9f,0x97,0x1f,
-	  0x60,0x87,0x5d,0x83,0x10,0x00,0x01,
-	  0x00}},
-        {{0x64,0x4f,0x88,0x54,0x9f,0x04,0x3e,
-	  0xe2,0x89,0xdf,0x05,0x00,0x00,0x01,
-	  0x00}},
-        {{0x7e,0x63,0x82,0x68,0x15,0x7c,0xf0,
-	  0x5a,0x8f,0x57,0x7d,0x20,0x00,0x26,
-	  0x01}},
-        {{0xa3,0x7f,0x87,0x86,0x97,0x24,0xf5,
-	  0x02,0x88,0xff,0x25,0x10,0x00,0x02,
-	  0x01}}
-};
-
-static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT11152x768_1_H[] =
-{
-        {{0x2f,0x27,0x93,0x2b,0x90,0xc4,0x1f,
-	  0x92,0x89,0x8f,0xb5,0x30,0x00,0x44,
-	  0x00}},
-        {{0x2f,0x27,0x93,0x2b,0x90,0x97,0x1f,
-	  0x60,0x87,0x5d,0x83,0x10,0x00,0x44,
-	  0x00}},
-        {{0x2f,0x27,0x93,0x2b,0x90,0xc4,0x1f,
-	  0x92,0x89,0x8f,0xb5,0x30,0x00,0x44,
-	  0x00}},
-        {{0x2f,0x27,0x93,0x2b,0x90,0x97,0x1f,
-	  0x60,0x87,0x5d,0x83,0x10,0x00,0x44,
-	  0x00}},
-        {{0x2f,0x27,0x93,0x2b,0x90,0x04,0x3e,
-	  0xe2,0x89,0xdf,0x05,0x00,0x00,0x44,
-	  0x00}},
-        {{0x3c,0x31,0x80,0x35,0x1c,0x7c,0xf0,
-	  0x5a,0x8f,0x57,0x7d,0x20,0x00,0x55,
-	  0x01}},
-        {{0x4f,0x3f,0x93,0x45,0x0d,0x24,0xf5,
-	  0x02,0x88,0xff,0x25,0x10,0x00,0x01,
-	  0x01}}
-};
-
-static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT11152x768_2[] =
-{
-        {{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
-	  0x4a,0x80,0x8f,0x25,0x30,0x00,0x06,
-	  0x00}},
-        {{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
-	  0x31,0x87,0x5d,0x25,0x30,0x00,0x06,
-	  0x00}},
-        {{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
-	  0x4a,0x80,0x8f,0x25,0x30,0x00,0x06,
-	  0x00}},
-        {{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
-	  0x31,0x87,0x5d,0x25,0x30,0x00,0x06,
-	  0x00}},
-        {{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
-	  0x72,0x88,0xdf,0x25,0x30,0x00,0x06,
-	  0x00}},
-        {{0xa3,0x63,0x87,0x78,0x89,0x24,0xf1,
-	  0xae,0x84,0x57,0x25,0x30,0x00,0x02,
-	  0x01}},
-        {{0xa3,0x7f,0x87,0x86,0x97,0x24,0xf5,
-	  0x02,0x88,0xff,0x25,0x10,0x00,0x02,
-	  0x01}}
-};
-
-static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT11152x768_2_H[] =
-{
-        {{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb,
-	  0x4a,0x80,0x8f,0x25,0x30,0x00,0x01,
-	  0x00}},
-        {{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb,
-	  0x31,0x87,0x5d,0x25,0x30,0x00,0x01,
-	  0x00}},
-        {{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb,
-	  0x4a,0x80,0x8f,0x25,0x30,0x00,0x01,
-	  0x00}},
-        {{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb,
-	  0x31,0x87,0x5d,0x25,0x30,0x00,0x01,
-	  0x00}},
-        {{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb,
-	  0x72,0x88,0xdf,0x25,0x30,0x00,0x01,
-	  0x00}},
-        {{0x4f,0x31,0x93,0x3e,0x06,0x24,0xf1,
-	  0xae,0x84,0x57,0x25,0x30,0x00,0x01,
-	  0x01}},
-        {{0x4f,0x3f,0x93,0x45,0x0d,0x24,0xf5,
-	  0x02,0x88,0xff,0x25,0x10,0x00,0x01,
-	  0x01}}
-};
-
-static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT11600x1200_1[] =  
-{    
+ {{0xFB,0xC7,0x9F,0xD3,0x8B,0x26,0x11,
+   0xD3,0x86,0xAF,0x27,0x3F,0x00,0x07,
+   0x00}}
+#if 0
  {{0x83,0x4f,0x87,0x51,0x09,0xc0,0x1f,
    0x90,0x84,0x8f,0xc1,0x30,0x00,0x06,
    0x00}},
@@ -4576,10 +2810,42 @@
  {{0xfb,0xc7,0x9f,0xc9,0x81,0xe0,0x10,
    0xb0,0x84,0xaf,0xe1,0x2f,0x00,0x07,
    0x00}}
+#endif
 };
 
 static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT11600x1200_1_H[] =
-{ 
+{
+ {{0x5B,0x27,0x9F,0x33,0x0B,0x06,0x2E,
+   0xB3,0x86,0x8F,0x07,0x20,0x00,0x01,
+   0x00}},
+ {{0x5B,0x27,0x9F,0x29,0x01,0x8E,0x1F,
+   0x81,0x84,0x5D,0xD5,0x10,0x00,0x06,
+   0x00}},
+ {{0x5B,0x27,0x9F,0x33,0x0B,0x06,0x2E,
+   0xB3,0x86,0x8F,0x07,0x20,0x00,0x01,
+   0x00}},
+ {{0x83,0x4F,0x87,0x5B,0x13,0xD4,0x1F,
+   0x81,0x84,0x5D,0xD5,0x10,0x00,0x06,
+   0x00}},
+ {{0x5B,0x27,0x9F,0x33,0x0B,0x56,0xBA,
+   0x03,0x86,0xDF,0x57,0x00,0x00,0x01,
+   0x00}},
+ {{0x65,0x31,0x89,0x3D,0x95,0xCE,0xF0,
+   0x7B,0x8E,0x57,0xCF,0x20,0x00,0x01,
+   0x01}},
+ {{0x73,0x3F,0x97,0x4B,0x83,0x76,0xF5,
+   0x23,0x86,0xFF,0x77,0x10,0x00,0x05,
+   0x01}},
+ {{0xD3,0x9F,0x97,0xAB,0x03,0x76,0x5A,
+   0x23,0x86,0xFF,0x77,0x09,0x00,0x03,
+   0x01}},
+ {{0xE2,0xAE,0x86,0xBA,0x92,0x90,0x10,
+   0x3D,0x80,0x19,0x91,0x0F,0x00,0x03,
+   0x00}},
+ {{0x97,0x63,0x9B,0x6F,0x07,0xE0,0x10,
+   0xB0,0x84,0xAF,0xE1,0x2F,0x00,0x06,
+   0x00}}
+#if 0
  {{0x5b,0x27,0x9f,0x29,0x01,0xc0,0x1f,
    0x90,0x84,0x8f,0xc1,0x30,0x00,0x01,
    0x00}},
@@ -4610,10 +2876,42 @@
  {{0x97,0x63,0x9b,0x65,0x1d,0xe0,0x10,
    0xb0,0x84,0xaf,0xe1,0x2f,0x00,0x06,
    0x00}}
+#endif
 };
 
 static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT11600x1200_2[] =
-{    
+{
+ {{0xFB,0x87,0x86,0x97,0x0F,0x26,0x97,
+   0x43,0x86,0xDB,0xDA,0x11,0x00,0x07,
+   0x01}},
+ {{0xFB,0x87,0x86,0x97,0x0F,0x26,0x97,
+   0x2A,0x8D,0xC2,0xC1,0x11,0x00,0x07,
+   0x01}},
+ {{0xFB,0x87,0x86,0x97,0x0F,0x26,0x97,
+   0x43,0x86,0xDB,0xDA,0x11,0x00,0x07,
+   0x01}},
+ {{0xFB,0x87,0x86,0x97,0x0F,0x26,0x97,
+   0x2A,0x8D,0xC2,0xC1,0x11,0x00,0x07,
+   0x01}},
+ {{0xFB,0x87,0x86,0x97,0x0F,0x26,0x9F,
+   0x6B,0x8E,0x03,0x02,0x01,0x00,0x07,
+   0x01}},
+ {{0xFB,0x63,0x9F,0xA1,0x99,0x26,0xD5,
+   0xA7,0x8A,0xBF,0xBE,0x01,0x00,0x07,
+   0x01}},
+ {{0xFB,0x7F,0x9F,0xAF,0x87,0x26,0xDD,
+   0xFB,0x8E,0x13,0x12,0x31,0x00,0x03,
+   0x01}},
+ {{0xFB,0x9F,0x9F,0xBF,0x97,0x26,0x5B,
+   0x7B,0x8E,0xFF,0x27,0x39,0x00,0x03,
+   0x01}},
+ {{0xFB,0xAE,0x9F,0xC6,0x9E,0x26,0x11,
+   0x88,0x8B,0x19,0x27,0x1F,0x00,0x03,
+   0x00}},
+ {{0xFB,0xC7,0x9F,0xD3,0x8B,0x26,0x11,
+   0xD3,0x86,0xAF,0x27,0x3F,0x00,0x07,
+   0x00}}
+#if 0
  {{0xfb,0x88,0x87,0x90,0x08,0xe0,0x96,
    0x20,0x84,0xb9,0xb8,0x01,0x00,0x07,
    0x01}},
@@ -4644,10 +2942,42 @@
  {{0xfb,0xc7,0x9f,0xc9,0x84,0xe0,0x10,
    0xc7,0x8b,0xaf,0xe1,0x0f,0x00,0x07,
    0x00}}
+#endif
 };
 
 static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT11600x1200_2_H[] = 
-{    
+{
+ {{0xD3,0x5F,0x9E,0x6F,0x07,0x26,0x97,
+   0x43,0x86,0xDB,0xDA,0x11,0x00,0x02,
+   0x01}},
+ {{0xD3,0x27,0x97,0x6F,0x07,0x26,0x97,
+   0x6B,0x8E,0x83,0x82,0x01,0x00,0x03,
+   0x01}},
+ {{0xD3,0x5F,0x9E,0x6F,0x07,0x26,0x97,
+   0x43,0x86,0xDB,0xDA,0x11,0x00,0x02,
+   0x01}},
+ {{0xD3,0x27,0x97,0x6F,0x07,0x26,0x97,
+   0x07,0x8B,0xA0,0x9F,0x01,0x00,0x02,
+   0x01}},
+ {{0xD3,0x27,0x97,0x6F,0x07,0x26,0x97,
+   0x6B,0x8E,0x83,0x82,0x01,0x00,0x03,
+   0x01}},
+ {{0xC9,0x31,0x8D,0x6F,0x07,0x26,0xD5,
+   0xA7,0x8A,0xBF,0xBE,0x01,0x00,0x03,
+   0x01}},
+ {{0xBB,0x3F,0x9F,0x6F,0x87,0x26,0xDD,
+   0xFB,0x8E,0x13,0x12,0x31,0x00,0x02,
+   0x01}},
+ {{0xAB,0x4F,0x8F,0x68,0x80,0xE0,0x5A,
+   0x6F,0x83,0xFF,0xE1,0x29,0x00,0x02,
+   0x01}},
+ {{0xA3,0x56,0x87,0x67,0x9F,0xE0,0x10,
+   0x7C,0x80,0x19,0xE1,0x0F,0x00,0x06,
+   0x00}},
+ {{0x97,0x63,0x9B,0x68,0x00,0xE0,0x10,
+   0xC7,0x8B,0xAF,0xE1,0x0F,0x00,0x02,
+   0x00}}
+#if 0
  {{0xd3,0x60,0x9f,0x68,0x00,0xe0,0x96,
    0x20,0x84,0xb9,0xb8,0x01,0x00,0x02,
    0x01}},
@@ -4678,135 +3008,111 @@
  {{0x97,0x63,0x9b,0x68,0x00,0xe0,0x10,
    0xc7,0x8b,0xaf,0xe1,0x0f,0x00,0x02,
    0x00}}
+#endif
 };
 
+/* CRT1 CRTC for Chrontel TV slave modes */
 
 static const SiS310_LVDSCRT1DataStruct  SiS310_CHTVCRT1UNTSC[] =  
 { 
-	{{0x64,0x4f,0x88,0x56,0x9f,0x56,0x3e,
-	  0xe8,0x84,0x8f,0x57,0x20,0x00,0x01,
-	  0x00 }},
-	{{0x64,0x4f,0x88,0x56,0x9f,0x56,0x3e,
-	  0xd0,0x82,0x5d,0x57,0x00,0x00,0x01,
-	  0x00 }},
-	{{0x64,0x4f,0x88,0x56,0x9f,0x56,0x3e,
-	  0xe8,0x84,0x8f,0x57,0x20,0x00,0x01,
-	  0x00 }},
-	{{0x64,0x4f,0x88,0x56,0x9f,0x56,0x3e,
-	  0xd0,0x82,0x5d,0x57,0x00,0x00,0x01,
-	  0x00 }},
-	{{0x5d,0x4f,0x81,0x56,0x99,0x56,0xba,
-	  0x0a,0x84,0xdf,0x57,0x00,0x00,0x01,
-	  0x00 }},
-	{{0x80,0x63,0x84,0x6d,0x0f,0xec,0xf0,
-	  0x7a,0x8f,0x57,0xed,0x20,0x00,0x06,
-	  0x01 }},
-	{{0x8c,0x7f,0x90,0x86,0x09,0xaf,0xf5,  /* TW: 1024x768 */
-	  0x36,0x88,0xff,0xb0,0x10,0x00,0x02,
-	  0x01}}
+ {{0x64,0x4f,0x88,0x56,0x9f,0x56,0x3e,
+   0xe8,0x84,0x8f,0x57,0x20,0x00,0x01,
+   0x00 }},
+ {{0x64,0x4f,0x88,0x56,0x9f,0x56,0x3e,
+   0xd0,0x82,0x5d,0x57,0x00,0x00,0x01,
+   0x00 }},
+ {{0x64,0x4f,0x88,0x56,0x9f,0x56,0x3e,
+   0xe8,0x84,0x8f,0x57,0x20,0x00,0x01,
+   0x00 }},
+ {{0x64,0x4f,0x88,0x56,0x9f,0x56,0x3e,
+   0xd0,0x82,0x5d,0x57,0x00,0x00,0x01,
+   0x00 }},
+ {{0x5d,0x4f,0x81,0x56,0x99,0x56,0xba,
+   0x0a,0x84,0xdf,0x57,0x00,0x00,0x01,
+   0x00 }},
+ {{0x80,0x63,0x84,0x6d,0x0f,0xec,0xf0,
+   0x7a,0x8f,0x57,0xed,0x20,0x00,0x06,
+   0x01 }},
+ {{0x8c,0x7f,0x90,0x86,0x09,0xaf,0xf5,
+   0x36,0x88,0xff,0xb0,0x10,0x00,0x02,
+   0x01}}
 };
 
-static const SiS310_LVDSCRT1DataStruct  SiS310_CHTVCRT1ONTSC[] =   
-{ 
-	{{0x63,0x4f,0x87,0x5a,0x9f,0x0b,0x3e,
-	  0xc0,0x84,0x8f,0x0c,0x20,0x00,0x01,
-	  0x00 }},
-	{{0x63,0x4f,0x87,0x5a,0x9f,0x0b,0x3e,
-	  0xb0,0x8d,0x5d,0x0c,0x00,0x00,0x01,
-	  0x00 }},
-	{{0x63,0x4f,0x87,0x5a,0x9f,0x0b,0x3e,
-	  0xc0,0x84,0x8f,0x0c,0x20,0x00,0x01,
-	  0x00 }},
-	{{0x63,0x4f,0x87,0x5a,0x9f,0x0b,0x3e,
-	  0xb0,0x8d,0x5d,0x0c,0x00,0x00,0x01,
-	  0x00 }},
-	{{0x5d,0x4f,0x81,0x58,0x9d,0x0b,0x3e,
-	  0xe8,0x84,0xdf,0x0c,0x00,0x00,0x01,
-	  0x00 }},
-	{{0x7d,0x63,0x81,0x68,0x0e,0xba,0xf0,
-	  0x78,0x8a,0x57,0xbb,0x20,0x00,0x06,
-	  0x01 }},
-	{{0x8c,0x7f,0x90,0x82,0x06,0x46,0xf5,   /* TW: 1024x768 */
-	  0x15,0x88,0xff,0x47,0x70,0x00,0x02,
-	  0x01 }}
+static const SiS310_LVDSCRT1DataStruct  SiS310_CHTVCRT1ONTSC[] =
+{
+ {{0x63,0x4f,0x87,0x5a,0x9f,0x0b,0x3e,
+   0xc0,0x84,0x8f,0x0c,0x20,0x00,0x01,
+   0x00 }},
+ {{0x63,0x4f,0x87,0x5a,0x9f,0x0b,0x3e,
+   0xb0,0x8d,0x5d,0x0c,0x00,0x00,0x01,
+   0x00 }},
+ {{0x63,0x4f,0x87,0x5a,0x9f,0x0b,0x3e,
+   0xc0,0x84,0x8f,0x0c,0x20,0x00,0x01,
+   0x00 }},
+ {{0x63,0x4f,0x87,0x5a,0x9f,0x0b,0x3e,
+   0xb0,0x8d,0x5d,0x0c,0x00,0x00,0x01,
+   0x00 }},
+ {{0x5d,0x4f,0x81,0x58,0x9d,0x0b,0x3e,
+   0xe8,0x84,0xdf,0x0c,0x00,0x00,0x01,
+   0x00 }},
+ {{0x7d,0x63,0x81,0x68,0x0e,0xba,0xf0,
+   0x78,0x8a,0x57,0xbb,0x20,0x00,0x06,
+   0x01 }},
+ {{0x8c,0x7f,0x90,0x82,0x06,0x46,0xf5,
+   0x15,0x88,0xff,0x47,0x70,0x00,0x02,
+   0x01 }}
 };
 
 static const SiS310_LVDSCRT1DataStruct  SiS310_CHTVCRT1UPAL[] =    
 { 
-	{{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e,
-	  0xf8,0x83,0x8f,0x70,0x20,0x00,0x05,
-	  0x00 }},
-	{{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e,
-	  0xde,0x81,0x5d,0x70,0x00,0x00,0x05,
-	  0x00 }},
-	{{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e,
-	  0xf8,0x83,0x8f,0x70,0x20,0x00,0x05,
-	  0x00 }},
-	{{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e,
-	  0xde,0x81,0x5d,0x70,0x00,0x00,0x05,
-	  0x00 }},
-	{{0x64,0x4f,0x88,0x5a,0x9f,0x6f,0xba,
-	  0x15,0x83,0xdf,0x70,0x00,0x00,0x01,
-	  0x00 }},
-	{{0x73,0x63,0x97,0x69,0x8b,0xec,0xf0,
-	  0x90,0x8c,0x57,0xed,0x20,0x00,0x05,
-	  0x01 }},
-	{{0xaa,0x7f,0x8e,0x8e,0x96,0xe6,0xf5,   /* TW: 1024x768 */
-	  0x50,0x88,0xff,0xe7,0x10,0x00,0x02,
-	  0x01}}
-};
-
-static const SiS310_LVDSCRT1DataStruct  SiS310_CHTVCRT1OPAL[] = 
-{
-	{{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e,
-	  0xf0,0x83,0x8f,0x70,0x20,0x00,0x05,
-	  0x00 }},
-	{{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e,
-	  0xde,0x81,0x5d,0x70,0x00,0x00,0x05,
-	  0x00 }},
-	{{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e,
-	  0xf0,0x83,0x8f,0x70,0x20,0x00,0x05,
-	  0x00 }},
-	{{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e,
-	  0xde,0x81,0x5d,0x70,0x00,0x00,0x05,
-	  0x00 }},
-	{{0x64,0x4f,0x88,0x58,0x9d,0x6f,0xba,
-	  0x15,0x83,0xdf,0x70,0x00,0x00,0x01,
-	  0x00 }},
-	{{0x71,0x63,0x95,0x69,0x8c,0x6f,0xf0,
-	  0x5a,0x8b,0x57,0x70,0x20,0x00,0x05,
-	  0x01 }},
-	{{0xaa,0x7f,0x8e,0x8f,0x96,0x69,0xf5,   /* TW:  1024x768 */
-	  0x28,0x88,0xff,0x6a,0x10,0x00,0x02,
-	  0x01 }}
-};
-
-static const SiS310_LVDSCRT1DataStruct  SiS310_CHTVCRT1SOPAL[] =
-{
-	{{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e,
-	  0xf0,0x83,0x8f,0x70,0x20,0x00,0x05,
-	  0x00 }},
-	{{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e,
-	  0xde,0x81,0x5d,0x70,0x00,0x00,0x05,
-	  0x00 }},
-	{{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e,
-	  0xf0,0x83,0x8f,0x70,0x20,0x00,0x05,
-	  0x00 }},
-	{{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e,
-	  0xde,0x81,0x5d,0x70,0x00,0x00,0x05,
-	  0x00 }},
-	{{0x64,0x4f,0x88,0x58,0x9d,0x6f,0xba,
-	  0x15,0x83,0xdf,0x70,0x00,0x00,0x01,
-	  0x00 }},
-	{{0x71,0x63,0x95,0x69,0x8c,0x6f,0xf0,
-	  0x5a,0x8b,0x57,0x70,0x20,0x00,0x05,
-	  0x01 }},
-	{{0xaa,0x7f,0x8e,0x8f,0x96,0x69,0xf5,   /* TW:  1024x768 */
-	  0x28,0x88,0xff,0x6a,0x10,0x00,0x02,
-	  0x01 }}
+ {{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e,
+   0xf8,0x83,0x8f,0x70,0x20,0x00,0x05,
+   0x00 }},
+ {{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e,
+   0xde,0x81,0x5d,0x70,0x00,0x00,0x05,
+   0x00 }},
+ {{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e,
+   0xf8,0x83,0x8f,0x70,0x20,0x00,0x05,
+   0x00 }},
+ {{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e,
+   0xde,0x81,0x5d,0x70,0x00,0x00,0x05,
+   0x00 }},
+ {{0x64,0x4f,0x88,0x5a,0x9f,0x6f,0xba,
+   0x15,0x83,0xdf,0x70,0x00,0x00,0x01,
+   0x00 }},
+ {{0x73,0x63,0x97,0x69,0x8b,0xec,0xf0,
+   0x90,0x8c,0x57,0xed,0x20,0x00,0x05,
+   0x01 }},
+ {{0xaa,0x7f,0x8e,0x8e,0x96,0xe6,0xf5,
+   0x50,0x88,0xff,0xe7,0x10,0x00,0x02,
+   0x01}}
+};
+
+static const SiS310_LVDSCRT1DataStruct  SiS310_CHTVCRT1OPAL[] =
+{
+ {{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e,
+   0xf0,0x83,0x8f,0x70,0x20,0x00,0x05,
+   0x00 }},
+ {{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e,
+   0xde,0x81,0x5d,0x70,0x00,0x00,0x05,
+   0x00 }},
+ {{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e,
+   0xf0,0x83,0x8f,0x70,0x20,0x00,0x05,
+   0x00 }},
+ {{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e,
+   0xde,0x81,0x5d,0x70,0x00,0x00,0x05,
+   0x00 }},
+ {{0x64,0x4f,0x88,0x58,0x9d,0x6f,0xba,
+   0x15,0x83,0xdf,0x70,0x00,0x00,0x01,
+   0x00 }},
+ {{0x71,0x63,0x95,0x69,0x8c,0x6f,0xf0,
+   0x5a,0x8b,0x57,0x70,0x20,0x00,0x05,
+   0x01 }},
+ {{0xaa,0x7f,0x8e,0x8f,0x96,0x69,0xf5,
+   0x28,0x88,0xff,0x6a,0x10,0x00,0x02,
+   0x01 }}
 };
 
-/* TW: Data for Chrontel 7019  */
 typedef struct _SiS310_CHTVRegDataStruct
 {
  	UCHAR Reg[16];
@@ -4814,118 +3120,131 @@
 
 static const SiS310_CHTVRegDataStruct SiS310_CHTVReg_UNTSC[] =
 {
-	{{0x4a,0x77,0xbb,0x94,0x84,0x48,0xfe,0x50,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
-	{{0x4a,0x77,0xbb,0x94,0x84,0x48,0xfe,0x50,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
-	{{0x4a,0x77,0xbb,0x94,0x84,0x48,0xfe,0x50,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
-	{{0x4a,0x77,0xbb,0x94,0x84,0x48,0xfe,0x50,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
-	{{0x6a,0x77,0xbb,0x6e,0x84,0x2e,0x02,0x5a,0x04,0x00,0x80,0x20,0x7e,0x80,0x98,0x00}},
-	{{0xcf,0x77,0xb7,0xc8,0x84,0x3b,0x02,0x5a,0x04,0x00,0x80,0x19,0x88,0x30,0x7f,0x00}},
-	{{0xee,0x77,0xbb,0x66,0x87,0x32,0x01,0x5a,0x04,0x00,0x80,0x1b,0xd3,0xf2,0x36,0x00}}
-};
+ {{0x4a,0x77,0xbb,0x94,0x84,0x48,0xfe,0x50,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
+ {{0x4a,0x77,0xbb,0x94,0x84,0x48,0xfe,0x50,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
+ {{0x4a,0x77,0xbb,0x94,0x84,0x48,0xfe,0x50,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
+ {{0x4a,0x77,0xbb,0x94,0x84,0x48,0xfe,0x50,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
+ {{0x6a,0x77,0xbb,0x6e,0x84,0x2e,0x02,0x5a,0x04,0x00,0x80,0x20,0x7e,0x80,0x98,0x00}},
+ {{0xcf,0x77,0xb7,0xc8,0x84,0x3b,0x02,0x5a,0x04,0x00,0x80,0x19,0x88,0x30,0x7f,0x00}},
+ {{0xee,0x77,0xbb,0x66,0x87,0x32,0x01,0x5a,0x04,0x00,0x80,0x1b,0xd3,0xf2,0x36,0x00}}
+}; /* WRONG: 0x02: should be 0xfx, because if CIVEnable is clear, this should be set;
+             0x07: Blacklevel: NTSC/PAL-M: Should be 131 (0x83), and not 0x50/0x5a
+	                       PAL/PAL-N:  110 (0x6e)
+			       NTSC-J:     102 (0x66)
+	     0x0c-0x0f: CIV is not default as in datasheet
+      MISSING: 0x21: Should set D1 to ZERO (for NTSC, PAL-M) or ONE (PAL, NTSC-J)
+      Most of this is wrong in all NTSC and PAL register arrays. But I won't correct
+      it as long as it works. For NTSC-J, the blacklevel is corrected in init301.c;
+      for PAL-M and PAL-N all above is corrected.
+    */
 
 static const SiS310_CHTVRegDataStruct SiS310_CHTVReg_ONTSC[] =
 {
-	{{0x49,0x77,0xbb,0x7b,0x84,0x34,0x00,0x50,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
-	{{0x49,0x77,0xbb,0x7b,0x84,0x34,0x00,0x50,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
-	{{0x49,0x77,0xbb,0x7b,0x84,0x34,0x00,0x50,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
-	{{0x49,0x77,0xbb,0x7b,0x84,0x34,0x00,0x50,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
-	{{0x69,0x77,0xbb,0x6e,0x84,0x1e,0x00,0x5a,0x04,0x00,0x80,0x25,0x1a,0x43,0x04,0x00}},
-	{{0xce,0x77,0xb7,0xb6,0x83,0x2c,0x02,0x5a,0x04,0x00,0x80,0x1c,0x00,0x82,0x97,0x00}},
-	{{0xed,0x77,0xbb,0x66,0x8c,0x21,0x02,0x5a,0x04,0x00,0x80,0x1f,0x9f,0xc1,0x0c,0x00}}
+ {{0x49,0x77,0xbb,0x7b,0x84,0x34,0x00,0x50,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
+ {{0x49,0x77,0xbb,0x7b,0x84,0x34,0x00,0x50,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
+ {{0x49,0x77,0xbb,0x7b,0x84,0x34,0x00,0x50,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
+ {{0x49,0x77,0xbb,0x7b,0x84,0x34,0x00,0x50,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
+ {{0x69,0x77,0xbb,0x6e,0x84,0x1e,0x00,0x5a,0x04,0x00,0x80,0x25,0x1a,0x43,0x04,0x00}},
+ {{0xce,0x77,0xb7,0xb6,0x83,0x2c,0x02,0x5a,0x04,0x00,0x80,0x1c,0x00,0x82,0x97,0x00}},
+ {{0xed,0x77,0xbb,0x66,0x8c,0x21,0x02,0x5a,0x04,0x00,0x80,0x1f,0x9f,0xc1,0x0c,0x00}}
 };
 
 static const SiS310_CHTVRegDataStruct SiS310_CHTVReg_UPAL[] =
 {
-	{{0x41,0x7f,0xb7,0x34,0xad,0x50,0x34,0x83,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
-	{{0x41,0x7f,0xb7,0x80,0x85,0x50,0x00,0x83,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
-	{{0x41,0x7f,0xb7,0x34,0xad,0x50,0x34,0x83,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
-	{{0x41,0x7f,0xb7,0x12,0x85,0x50,0x00,0x83,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
-	{{0x61,0x7f,0xb7,0x99,0x84,0x35,0x04,0x5a,0x05,0x00,0x80,0x26,0x2a,0x55,0x5d,0x00}},
-	{{0xc3,0x7f,0xb7,0x7a,0x84,0x40,0x02,0x5a,0x05,0x00,0x80,0x1f,0x84,0x3d,0x28,0x00}},
-	{{0xe5,0x7f,0xb7,0x1d,0xa7,0x3e,0x04,0x5a,0x05,0x00,0x80,0x20,0x3e,0xe4,0x22,0x00}}
+ {{0x41,0x7f,0xb7,0x34,0xad,0x50,0x34,0x83,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
+ {{0x41,0x7f,0xb7,0x80,0x85,0x50,0x00,0x83,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
+ {{0x41,0x7f,0xb7,0x34,0xad,0x50,0x34,0x83,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
+ {{0x41,0x7f,0xb7,0x12,0x85,0x50,0x00,0x83,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
+ {{0x61,0x7f,0xb7,0x99,0x84,0x35,0x04,0x5a,0x05,0x00,0x80,0x26,0x2a,0x55,0x5d,0x00}},
+ {{0xc3,0x7f,0xb7,0x7a,0x84,0x40,0x02,0x5a,0x05,0x00,0x80,0x1f,0x84,0x3d,0x28,0x00}},
+ {{0xe5,0x7f,0xb7,0x1d,0xa7,0x3e,0x04,0x5a,0x05,0x00,0x80,0x20,0x3e,0xe4,0x22,0x00}}
 };
 
 static const SiS310_CHTVRegDataStruct SiS310_CHTVReg_OPAL[] =
 {
-	{{0x41,0x7f,0xb7,0x36,0xad,0x50,0x34,0x83,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
-	{{0x41,0x7f,0xb7,0x86,0x85,0x50,0x00,0x83,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
-	{{0x41,0x7f,0xb7,0x36,0xad,0x50,0x34,0x83,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
-	{{0x41,0x7f,0xb7,0x86,0x85,0x50,0x00,0x83,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
-	{{0x61,0x7f,0xb7,0x99,0x84,0x35,0x04,0x5a,0x05,0x00,0x80,0x26,0x2a,0x55,0x5d,0x00}},
-	{{0xc1,0x7f,0xb7,0x4d,0x8c,0x1e,0x31,0x5a,0x05,0x00,0x80,0x26,0x78,0x19,0x34,0x00}},
-	{{0xe4,0x7f,0xb7,0x1e,0xaf,0x29,0x37,0x5a,0x05,0x00,0x80,0x25,0x8c,0xb2,0x2a,0x00}}
-};
-
-static const SiS310_CHTVRegDataStruct SiS310_CHTVReg_SOPAL[] =
-{
-	{{0x41,0x7f,0xb7,0x36,0xad,0x50,0x34,0x83,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
-	{{0x41,0x7f,0xb7,0x86,0x85,0x50,0x00,0x83,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
-	{{0x41,0x7f,0xb7,0x36,0xad,0x50,0x34,0x83,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
-	{{0x41,0x7f,0xb7,0x86,0x85,0x50,0x00,0x83,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
-	{{0x61,0x7f,0xb7,0x99,0x84,0x35,0x04,0x5a,0x05,0x00,0x80,0x26,0x2a,0x55,0x5d,0x00}},
-	{{0xc1,0x7f,0xb7,0x4d,0x8c,0x1e,0x31,0x5a,0x05,0x00,0x80,0x26,0x78,0x19,0x34,0x00}},
-	{{0xe4,0x7f,0xb7,0x1e,0xaf,0x29,0x37,0x5a,0x05,0x00,0x80,0x25,0x8c,0xb2,0x2a,0x00}}
+ {{0x41,0x7f,0xb7,0x36,0xad,0x50,0x34,0x83,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
+ {{0x41,0x7f,0xb7,0x86,0x85,0x50,0x00,0x83,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
+ {{0x41,0x7f,0xb7,0x36,0xad,0x50,0x34,0x83,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
+ {{0x41,0x7f,0xb7,0x86,0x85,0x50,0x00,0x83,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
+ {{0x61,0x7f,0xb7,0x99,0x84,0x35,0x04,0x5a,0x05,0x00,0x80,0x26,0x2a,0x55,0x5d,0x00}},
+ {{0xc1,0x7f,0xb7,0x4d,0x8c,0x1e,0x31,0x5a,0x05,0x00,0x80,0x26,0x78,0x19,0x34,0x00}},
+ {{0xe4,0x7f,0xb7,0x1e,0xaf,0x29,0x37,0x5a,0x05,0x00,0x80,0x25,0x8c,0xb2,0x2a,0x00}}
 };
 
 static const SiS310_CHTVRegDataStruct SiS310_CHTVReg_UPALM[] =
 {
-	{{0x52,0x77,0xbb,0x94,0x84,0x48,0xfe,0x50,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
-	{{0x52,0x77,0xbb,0x94,0x84,0x48,0xfe,0x50,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
-	{{0x52,0x77,0xbb,0x94,0x84,0x48,0xfe,0x50,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
-	{{0x52,0x77,0xbb,0x94,0x84,0x48,0xfe,0x50,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
-	{{0x72,0x77,0xbb,0x6e,0x84,0x2e,0x02,0x5a,0x04,0x00,0x80,0x20,0x76,0xdb,0x6e,0x00}},
-	{{0xd7,0x77,0xb7,0xc8,0x84,0x3b,0x02,0x5a,0x04,0x00,0x80,0x19,0x84,0x0a,0xc7,0x00}},
-	{{0xf6,0x77,0xbb,0x66,0x87,0x32,0x01,0x5a,0x04,0x00,0x80,0x1b,0xdc,0xb0,0x8d,0x00}}
+ {{0x52,0x77,0xbb,0x94,0x84,0x48,0xfe,0x83,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
+ {{0x52,0x77,0xbb,0x94,0x84,0x48,0xfe,0x83,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
+ {{0x52,0x77,0xbb,0x94,0x84,0x48,0xfe,0x83,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
+ {{0x52,0x77,0xbb,0x94,0x84,0x48,0xfe,0x83,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
+ {{0x72,0x77,0xfb,0x6e,0x84,0x2e,0x02,0x83,0x04,0x00,0x80,0x20,0x76,0xdb,0x6e,0x00}},
+ {{0xd7,0x77,0xf7,0xc8,0x84,0x3b,0x02,0x83,0x04,0x00,0x80,0x19,0x84,0x0a,0xc7,0x00}},
+ {{0xf6,0x77,0xfb,0x66,0x87,0x32,0x01,0x83,0x04,0x00,0x80,0x1b,0xdc,0xb0,0x8d,0x00}}
+#if 0 /* Correct blacklevel and CFRB */
+ {{0x72,0x77,0xbb,0x6e,0x84,0x2e,0x02,0x5a,0x04,0x00,0x80,0x20,0x76,0xdb,0x6e,0x00}},
+ {{0xd7,0x77,0xb7,0xc8,0x84,0x3b,0x02,0x5a,0x04,0x00,0x80,0x19,0x84,0x0a,0xc7,0x00}},
+ {{0xf6,0x77,0xbb,0x66,0x87,0x32,0x01,0x5a,0x04,0x00,0x80,0x1b,0xdc,0xb0,0x8d,0x00}}
+#endif
 };
 
 static const SiS310_CHTVRegDataStruct SiS310_CHTVReg_OPALM[] =
 {
-	{{0x51,0x77,0xbb,0x7b,0x84,0x34,0x00,0x50,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
-	{{0x51,0x77,0xbb,0x7b,0x84,0x34,0x00,0x50,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
-	{{0x51,0x77,0xbb,0x7b,0x84,0x34,0x00,0x50,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
-	{{0x51,0x77,0xbb,0x7b,0x84,0x34,0x00,0x50,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
-	{{0x71,0x77,0xbb,0x6e,0x84,0x1e,0x00,0x5a,0x04,0x00,0x80,0x25,0x1a,0x1f,0x59,0x00}},
-	{{0xd6,0x77,0xb7,0xb6,0x83,0x2c,0x02,0x5a,0x04,0x00,0x80,0x1b,0xf8,0x1f,0x82,0x00}},
-	{{0xf5,0x77,0xbb,0x66,0x8c,0x21,0x02,0x5a,0x04,0x00,0x80,0x1f,0x58,0x46,0x9f,0x00}}
+ {{0x51,0x77,0xbb,0x7b,0x84,0x34,0x00,0x83,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
+ {{0x51,0x77,0xbb,0x7b,0x84,0x34,0x00,0x83,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
+ {{0x51,0x77,0xbb,0x7b,0x84,0x34,0x00,0x83,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
+ {{0x51,0x77,0xbb,0x7b,0x84,0x34,0x00,0x83,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
+ {{0x71,0x77,0xfb,0x6e,0x84,0x1e,0x00,0x83,0x04,0x00,0x80,0x25,0x1a,0x1f,0x59,0x00}},
+ {{0xd6,0x77,0xf7,0xb6,0x83,0x2c,0x02,0x83,0x04,0x00,0x80,0x1b,0xf8,0x1f,0x82,0x00}},
+ {{0xf5,0x77,0xfb,0x66,0x8c,0x21,0x02,0x83,0x04,0x00,0x80,0x1f,0x58,0x46,0x9f,0x00}}
+#if 0 /* Correct blacklevel and CFRB */
+ {{0x71,0x77,0xbb,0x6e,0x84,0x1e,0x00,0x5a,0x04,0x00,0x80,0x25,0x1a,0x1f,0x59,0x00}},
+ {{0xd6,0x77,0xb7,0xb6,0x83,0x2c,0x02,0x5a,0x04,0x00,0x80,0x1b,0xf8,0x1f,0x82,0x00}},
+ {{0xf5,0x77,0xbb,0x66,0x8c,0x21,0x02,0x5a,0x04,0x00,0x80,0x1f,0x58,0x46,0x9f,0x00}}
+#endif
 };
 
 static const SiS310_CHTVRegDataStruct SiS310_CHTVReg_UPALN[] =
 {
-	{{0x41,0x7f,0xb7,0x34,0xad,0x50,0x34,0x83,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
-	{{0x41,0x7f,0xb7,0x80,0x85,0x50,0x00,0x83,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
-	{{0x41,0x7f,0xb7,0x34,0xad,0x50,0x34,0x83,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
-	{{0x41,0x7f,0xb7,0x12,0x85,0x50,0x00,0x83,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
-	{{0x61,0x7f,0xb7,0x99,0x84,0x35,0x04,0x5a,0x05,0x00,0x80,0x1f,0x0d,0x54,0x5e,0x00}},
-	{{0xc3,0x7f,0xb7,0x7a,0x84,0x40,0x02,0x5a,0x05,0x00,0x80,0x19,0x78,0xef,0x35,0x00}},
-	{{0xe5,0x7f,0xb7,0x1d,0xa7,0x3e,0x04,0x5a,0x05,0x00,0x80,0x1a,0x33,0x3f,0x2f,0x00}}
+ {{0x41,0x7f,0xb7,0x34,0xad,0x50,0x34,0x6e,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x03}},
+ {{0x41,0x7f,0xb7,0x80,0x85,0x50,0x00,0x6e,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x03}},
+ {{0x41,0x7f,0xb7,0x34,0xad,0x50,0x34,0x6e,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x03}},
+ {{0x41,0x7f,0xb7,0x12,0x85,0x50,0x00,0x6e,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x03}},
+ {{0x61,0x7f,0xb7,0x99,0x84,0x35,0x04,0x6e,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x03}},
+ {{0xc3,0x7f,0xb7,0x7a,0x84,0x40,0x02,0x6e,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x03}},
+ {{0xe5,0x7f,0xb7,0x1d,0xa7,0x3e,0x04,0x6e,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x03}}
+#if 0 /* Correct blacklevel, CIV and CFRB */
+ {{0x61,0x7f,0xb7,0x99,0x84,0x35,0x04,0x5a,0x05,0x00,0x80,0x1f,0x0d,0x54,0x5e,0x00}},
+ {{0xc3,0x7f,0xb7,0x7a,0x84,0x40,0x02,0x5a,0x05,0x00,0x80,0x19,0x78,0xef,0x35,0x00}},
+ {{0xe5,0x7f,0xb7,0x1d,0xa7,0x3e,0x04,0x5a,0x05,0x00,0x80,0x1a,0x33,0x3f,0x2f,0x00}}
+#endif
 };
 
 static const SiS310_CHTVRegDataStruct SiS310_CHTVReg_OPALN[] =
 {
-	{{0x41,0x7f,0xb7,0x36,0xad,0x50,0x34,0x83,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
-	{{0x41,0x7f,0xb7,0x86,0x85,0x50,0x00,0x83,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
-	{{0x41,0x7f,0xb7,0x36,0xad,0x50,0x34,0x83,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
-	{{0x41,0x7f,0xb7,0x86,0x85,0x50,0x00,0x83,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
-	{{0x61,0x7f,0xb7,0x99,0x84,0x35,0x04,0x5a,0x05,0x00,0x80,0x1f,0x0d,0x54,0x5e,0x00}},
-	{{0xc1,0x7f,0xb7,0x4d,0x8c,0x1e,0x31,0x5a,0x05,0x00,0x80,0x1f,0x15,0xc0,0x1e,0x00}},
-	{{0xe4,0x7f,0xb7,0x1e,0xaf,0x29,0x37,0x5a,0x05,0x00,0x80,0x1d,0xf1,0x6c,0xcb,0x00}}
+ {{0x41,0x7f,0xb7,0x36,0xad,0x50,0x34,0x6e,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x03}},
+ {{0x41,0x7f,0xb7,0x86,0x85,0x50,0x00,0x6e,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x03}},
+ {{0x41,0x7f,0xb7,0x36,0xad,0x50,0x34,0x6e,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x03}},
+ {{0x41,0x7f,0xb7,0x86,0x85,0x50,0x00,0x6e,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x03}},
+ {{0x61,0x7f,0xb7,0x99,0x84,0x35,0x04,0x6e,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x03}},
+ {{0xc1,0x7f,0xb7,0x4d,0x8c,0x1e,0x31,0x6e,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x03}},
+ {{0xe4,0x7f,0xb7,0x1e,0xaf,0x29,0x37,0x6e,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x03}}
+#if 0 /* Correct blacklevel, CIV and CFRB */
+ {{0x61,0x7f,0xb7,0x99,0x84,0x35,0x04,0x5a,0x05,0x00,0x80,0x1f,0x0d,0x54,0x5e,0x00}},
+ {{0xc1,0x7f,0xb7,0x4d,0x8c,0x1e,0x31,0x5a,0x05,0x00,0x80,0x1f,0x15,0xc0,0x1e,0x00}},
+ {{0xe4,0x7f,0xb7,0x1e,0xaf,0x29,0x37,0x5a,0x05,0x00,0x80,0x1d,0xf1,0x6c,0xcb,0x00}}
+#endif
 };
 
 static const UCHAR SiS310_CHTVVCLKUNTSC[] = {0x41,0x41,0x41,0x41,0x42,0x46,0x53};
-
 static const UCHAR SiS310_CHTVVCLKONTSC[] = {0x48,0x48,0x48,0x48,0x45,0x43,0x51};
 
 static const UCHAR SiS310_CHTVVCLKUPAL[]  = {0x47,0x47,0x47,0x47,0x48,0x4a,0x54};
-
 static const UCHAR SiS310_CHTVVCLKOPAL[]  = {0x47,0x47,0x47,0x47,0x48,0x4f,0x52};
 
-static const UCHAR SiS310_CHTVVCLKSOPAL[] = {0x47,0x47,0x47,0x47,0x48,0x4f,0x52};
-
 static const UCHAR SiS310_CHTVVCLKUPALM[] = {0x41,0x41,0x41,0x41,0x42,0x46,0x53};
-
 static const UCHAR SiS310_CHTVVCLKOPALM[] = {0x48,0x48,0x48,0x48,0x45,0x43,0x51};
 
 static const UCHAR SiS310_CHTVVCLKUPALN[] = {0x47,0x47,0x47,0x47,0x48,0x4a,0x54};
-
 static const UCHAR SiS310_CHTVVCLKOPALN[] = {0x47,0x47,0x47,0x47,0x48,0x4f,0x52};
 
+
--- diff/drivers/video/sis/init.c	2003-10-09 09:47:17.000000000 +0100
+++ source/drivers/video/sis/init.c	2004-02-09 10:39:55.000000000 +0000
@@ -1,42 +1,60 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/init.c,v 1.3 2002/24/04 01:16:16 dawes Exp $ */
+/* $XFree86$ */
 /*
- * Mode switching code (CRT1 section) for SiS 300/540/630/730/315/550/650/740/330
+ * Mode initializing code (CRT1 section) for
+ * for SiS 300/305/540/630/730 and
+ *     SiS 315/550/650/M650/651/661FX/M661FX/740/741/M741/330/660/M660/760/M760
  * (Universal module for Linux kernel framebuffer and XFree86 4.x)
  *
- * Assembler-To-C translation
- * Copyright 2002 by Thomas Winischhofer <thomas@winischhofer.net>
- * Minor parts Copyright SiS, Inc.
+ * Copyright (C) 2001-2004 by Thomas Winischhofer, Vienna, Austria
  *
- * Based on BIOS
- *     1.10.07, 1.10a for 650/CH7019
- *     1.11.21a for 740/CH7019
- *     1.11.05 for 650/LVDS (w/o Chrontel)
- *     1.07.1b, 1.11.6s, 1.11.6w, 1.11.7w, 1.11.8r for 650/301(B/LV)
- *     2.04.50 (I) and 2.04.5c (II) for 630/301(B)
- *     2.06.50 for 630/301B (dual VGA)
- *     2.02.3b, 2.03.02, 2.04.5c, 2.07a and 2.08.b3 for 630/LVDS/LVDS+CH7005
- *     2.04.5c, 2.04.6c for 730+LVDS+CH7005
- *     1.09b for 315/301(B)
- *     1.16.51 for 300+301LV (ECS A907)
- *     1.01.03 for 330 (Xabre 400)
+ * If distributed as part of the Linux kernel, the following license terms
+ * apply:
  *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of the copyright holder not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission.  The copyright holder makes no representations
- * about the suitability of this software for any purpose.  It is provided
- * "as is" without express or implied warranty.
+ * * 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 named License,
+ * * or any later version.
+ * *
+ * * This program is distributed in the hope that it will be useful,
+ * * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * * GNU General Public License for more details.
+ * *
+ * * You should have received a copy of the GNU General Public License
+ * * along with this program; if not, write to the Free Software
+ * * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
  *
- * THE COPYRIGHT HOLDER DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR 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.
+ * Otherwise, the following license terms apply:
+ *
+ * * 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) All advertising materials mentioning features or use of this software
+ * *    must display the following acknowledgement: "This product includes
+ * *    software developed by Thomas Winischhofer, Vienna, Austria."
+ * * 4) The name of the author may not be used to endorse or promote products
+ * *    derived from this software without specific prior written permission.
+ * *
+ * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
+ *
+ * Author: 	Thomas Winischhofer <thomas@winischhofer.net>
+ *
+ * Formerly based on non-functional code-fragements for 300 series by SiS, Inc.
+ * Used by permission.
  *
  * TW says: This code looks awful, I know. But please don't do anything about
  * this otherwise debugging will be hell.
@@ -58,98 +76,208 @@
 #include "310vtbl.h"
 #endif
 
-#ifdef LINUX_XF86
-BOOLEAN SiSBIOSSetMode(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,
-                       ScrnInfoPtr pScrn, DisplayModePtr mode, BOOLEAN IsCustom);
-DisplayModePtr SiSBuildBuiltInModeList(ScrnInfoPtr pScrn);
-#ifdef SISDUALHEAD /* TW: For dual head */
-BOOLEAN SiSBIOSSetModeCRT1(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,
-                       ScrnInfoPtr pScrn, DisplayModePtr mode, BOOLEAN IsCustom);
-BOOLEAN SiSBIOSSetModeCRT2(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,
-                       ScrnInfoPtr pScrn, DisplayModePtr mode);
-#endif /* dual head */
-#endif /* linux_xf86 */
-
-#ifdef LINUXBIOS
-BOOLEAN SiSInit(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension);
-#endif
-
-#ifdef LINUX_XF86
-BOOLEAN SiSSetMode(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,
-                   ScrnInfoPtr pScrn,USHORT ModeNo, BOOLEAN dosetpitch);
-#else
-BOOLEAN SiSSetMode(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,
-                   USHORT ModeNo);
-#endif
-
 #if defined(ALLOC_PRAGMA)
 #pragma alloc_text(PAGE,SiSSetMode)
 #pragma alloc_text(PAGE,SiSInit)
 #endif
 
-static ULONG GetDRAMSize(SiS_Private *SiS_Pr,
-                         PSIS_HW_DEVICE_INFO HwDeviceExtension);
-
-static void DelaySeconds(int seconds);
-void SiS_DebugCode(SiS_Private *SiS_Pr, UCHAR code);
+/*********************************************/
+/*         POINTER INITIALIZATION            */
+/*********************************************/
 
 static void
-DelaySeconds(int seconds)
+InitCommonPointer(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
 {
-  int i;
-#ifdef WIN2000
-  int j;
-#endif
-
-  for (i=0;i<seconds;i++) {
-#ifdef TC
-    delay(1000);
-#endif
-
-#ifdef WIN2000
-    for (j=0;j<20000;j++)
-      VideoPortStallExecution(50);
-#endif
-
-#ifdef WINCE_HEADER
-#endif
-
-#ifdef LINUX_KERNEL
+   SiS_Pr->SiS_StResInfo     = SiS_StResInfo;
+   SiS_Pr->SiS_ModeResInfo   = SiS_ModeResInfo;
+   SiS_Pr->SiS_StandTable    = SiS_StandTable;
+
+   SiS_Pr->SiS_NTSCPhase     = SiS_NTSCPhase;
+   SiS_Pr->SiS_PALPhase      = SiS_PALPhase;
+   SiS_Pr->SiS_NTSCPhase2    = SiS_NTSCPhase2;
+   SiS_Pr->SiS_PALPhase2     = SiS_PALPhase2;
+   SiS_Pr->SiS_PALMPhase     = SiS_PALMPhase;
+   SiS_Pr->SiS_PALNPhase     = SiS_PALNPhase;
+   SiS_Pr->SiS_PALMPhase2    = SiS_PALMPhase2;
+   SiS_Pr->SiS_PALNPhase2    = SiS_PALNPhase2;
+   SiS_Pr->SiS_SpecialPhase  = SiS_SpecialPhase;
+   SiS_Pr->SiS_SpecialPhaseM = SiS_SpecialPhaseM;
+   SiS_Pr->SiS_SpecialPhaseJ = SiS_SpecialPhaseJ;
+
+   SiS_Pr->SiS_NTSCTiming     = SiS_NTSCTiming;
+   SiS_Pr->SiS_PALTiming      = SiS_PALTiming;
+   SiS_Pr->SiS_HiTVSt1Timing  = SiS_HiTVSt1Timing;
+   SiS_Pr->SiS_HiTVSt2Timing  = SiS_HiTVSt2Timing;
+
+   SiS_Pr->SiS_HiTVExtTiming  = SiS_HiTVExtTiming;
+   SiS_Pr->SiS_HiTVGroup3Data = SiS_HiTVGroup3Data;
+   SiS_Pr->SiS_HiTVGroup3Simu = SiS_HiTVGroup3Simu;
+#if 0
+   SiS_Pr->SiS_HiTVTextTiming = SiS_HiTVTextTiming;
+   SiS_Pr->SiS_HiTVGroup3Text = SiS_HiTVGroup3Text;
 #endif
-  }
-}
 
-void
-SiS_DebugCode(SiS_Private *SiS_Pr, UCHAR code)
-{
-  OutPortByte(0x80, code);
-  DelaySeconds(0x3);
+   SiS_Pr->SiS_StPALData   = SiS_StPALData;
+   SiS_Pr->SiS_ExtPALData  = SiS_ExtPALData;
+   SiS_Pr->SiS_StNTSCData  = SiS_StNTSCData;
+   SiS_Pr->SiS_ExtNTSCData = SiS_ExtNTSCData;
+   SiS_Pr->SiS_St1HiTVData = SiS_StHiTVData;
+   SiS_Pr->SiS_St2HiTVData = SiS_St2HiTVData;
+   SiS_Pr->SiS_ExtHiTVData = SiS_ExtHiTVData;
+   SiS_Pr->SiS_St525iData  = SiS_StNTSCData;
+   SiS_Pr->SiS_St525pData  = SiS_St525pData;
+   SiS_Pr->SiS_St750pData  = SiS_St750pData;
+   SiS_Pr->SiS_Ext525iData = SiS_ExtNTSCData;
+   SiS_Pr->SiS_Ext525pData = SiS_ExtNTSCData;
+   SiS_Pr->SiS_Ext750pData = SiS_Ext750pData;
+
+   SiS_Pr->pSiS_OutputSelect = &SiS_OutputSelect;
+   SiS_Pr->pSiS_SoftSetting  = &SiS_SoftSetting;
+
+   SiS_Pr->SiS_LCD1280x960Data      = SiS_LCD1280x960Data;
+   SiS_Pr->SiS_ExtLCD1400x1050Data  = SiS_ExtLCD1400x1050Data;
+   SiS_Pr->SiS_ExtLCD1600x1200Data  = SiS_ExtLCD1600x1200Data;
+   SiS_Pr->SiS_StLCD1400x1050Data   = SiS_StLCD1400x1050Data;
+   SiS_Pr->SiS_StLCD1600x1200Data   = SiS_StLCD1600x1200Data;
+   SiS_Pr->SiS_NoScaleData1400x1050 = SiS_NoScaleData1400x1050;
+   SiS_Pr->SiS_NoScaleData1600x1200 = SiS_NoScaleData1600x1200;
+   SiS_Pr->SiS_ExtLCD1280x768Data   = SiS_ExtLCD1280x768Data;
+   SiS_Pr->SiS_StLCD1280x768Data    = SiS_StLCD1280x768Data;
+   SiS_Pr->SiS_NoScaleData1280x768  = SiS_NoScaleData1280x768;
+   SiS_Pr->SiS_NoScaleData          = SiS_NoScaleData;
+
+   SiS_Pr->SiS_LVDS320x480Data_1   = SiS_LVDS320x480Data_1;
+   SiS_Pr->SiS_LVDS800x600Data_1   = SiS_LVDS800x600Data_1;
+   SiS_Pr->SiS_LVDS800x600Data_2   = SiS_LVDS800x600Data_2;
+   SiS_Pr->SiS_LVDS1024x768Data_1  = SiS_LVDS1024x768Data_1;
+   SiS_Pr->SiS_LVDS1024x768Data_2  = SiS_LVDS1024x768Data_2;
+   SiS_Pr->SiS_LVDS1280x1024Data_1 = SiS_LVDS1280x1024Data_1;
+   SiS_Pr->SiS_LVDS1280x1024Data_2 = SiS_LVDS1280x1024Data_2;
+   SiS_Pr->SiS_LVDS1400x1050Data_1 = SiS_LVDS1400x1050Data_1;
+   SiS_Pr->SiS_LVDS1400x1050Data_2 = SiS_LVDS1400x1050Data_2;
+   SiS_Pr->SiS_LVDS1600x1200Data_1 = SiS_LVDS1600x1200Data_1;
+   SiS_Pr->SiS_LVDS1600x1200Data_2 = SiS_LVDS1600x1200Data_2;
+   SiS_Pr->SiS_LVDS1280x768Data_1  = SiS_LVDS1280x768Data_1;
+   SiS_Pr->SiS_LVDS1280x768Data_2  = SiS_LVDS1280x768Data_2;
+   SiS_Pr->SiS_LVDS1024x600Data_1  = SiS_LVDS1024x600Data_1;
+   SiS_Pr->SiS_LVDS1024x600Data_2  = SiS_LVDS1024x600Data_2;
+   SiS_Pr->SiS_LVDS1152x768Data_1  = SiS_LVDS1152x768Data_1;
+   SiS_Pr->SiS_LVDS1152x768Data_2  = SiS_LVDS1152x768Data_2;
+   SiS_Pr->SiS_LVDSXXXxXXXData_1   = SiS_LVDSXXXxXXXData_1;
+   SiS_Pr->SiS_LVDS1280x960Data_1  = SiS_LVDS1280x960Data_1;
+   SiS_Pr->SiS_LVDS1280x960Data_2  = SiS_LVDS1280x960Data_2;
+   SiS_Pr->SiS_LVDS640x480Data_1   = SiS_LVDS640x480Data_1;
+   SiS_Pr->SiS_LVDS1280x960Data_1  = SiS_LVDS1280x1024Data_1;
+   SiS_Pr->SiS_LVDS1280x960Data_2  = SiS_LVDS1280x1024Data_2;
+   SiS_Pr->SiS_LVDS640x480Data_1   = SiS_LVDS640x480Data_1;
+   SiS_Pr->SiS_LVDS640x480Data_2   = SiS_LVDS640x480Data_2;
+
+   SiS_Pr->SiS_LVDSBARCO1366Data_1 = SiS_LVDSBARCO1366Data_1;
+   SiS_Pr->SiS_LVDSBARCO1366Data_2 = SiS_LVDSBARCO1366Data_2;
+   SiS_Pr->SiS_LVDSBARCO1024Data_1 = SiS_LVDSBARCO1024Data_1;
+   SiS_Pr->SiS_LVDSBARCO1024Data_2 = SiS_LVDSBARCO1024Data_2;
+   SiS_Pr->SiS_LVDS848x480Data_1   = SiS_LVDS848x480Data_1;
+   SiS_Pr->SiS_LVDS848x480Data_2   = SiS_LVDS848x480Data_2;
+
+   SiS_Pr->SiS_CHTVUNTSCData = SiS_CHTVUNTSCData;
+   SiS_Pr->SiS_CHTVONTSCData = SiS_CHTVONTSCData;
+
+   SiS_Pr->SiS_LCDA1024x768Data_1  = SiS_LCDA1024x768Data_1;
+   SiS_Pr->SiS_LCDA1024x768Data_2  = SiS_LCDA1024x768Data_2;
+   SiS_Pr->SiS_LCDA1280x1024Data_1 = SiS_LCDA1280x1024Data_1;
+   SiS_Pr->SiS_LCDA1280x1024Data_2 = SiS_LCDA1280x1024Data_2;
+   SiS_Pr->SiS_LCDA1400x1050Data_1 = SiS_LCDA1400x1050Data_1;
+   SiS_Pr->SiS_LCDA1400x1050Data_2 = SiS_LCDA1400x1050Data_2;
+   SiS_Pr->SiS_LCDA1600x1200Data_1 = SiS_LCDA1600x1200Data_1;
+   SiS_Pr->SiS_LCDA1600x1200Data_2 = SiS_LCDA1600x1200Data_2;
+
+   SiS_Pr->LVDS1024x768Des_1  = SiS_PanelType1076_1;
+   SiS_Pr->LVDS1280x1024Des_1 = SiS_PanelType1210_1;
+   SiS_Pr->LVDS1400x1050Des_1 = SiS_PanelType1296_1;
+   SiS_Pr->LVDS1600x1200Des_1 = SiS_PanelType1600_1;
+   SiS_Pr->LVDS1024x768Des_2  = SiS_PanelType1076_2;
+   SiS_Pr->LVDS1280x1024Des_2 = SiS_PanelType1210_2;
+   SiS_Pr->LVDS1400x1050Des_2 = SiS_PanelType1296_2;
+   SiS_Pr->LVDS1600x1200Des_2 = SiS_PanelType1600_2;
+
+   SiS_Pr->SiS_PanelTypeNS_1 = SiS_PanelTypeNS_1;
+   SiS_Pr->SiS_PanelTypeNS_2 = SiS_PanelTypeNS_2;
+
+   SiS_Pr->SiS_CHTVUNTSCDesData = SiS_CHTVUNTSCDesData;
+   SiS_Pr->SiS_CHTVONTSCDesData = SiS_CHTVONTSCDesData;
+   SiS_Pr->SiS_CHTVUPALDesData  = SiS_CHTVUPALDesData;
+   SiS_Pr->SiS_CHTVOPALDesData  = SiS_CHTVOPALDesData;
+
+   SiS_Pr->SiS_LVDSCRT11280x768_1    = SiS_LVDSCRT11280x768_1;
+   SiS_Pr->SiS_LVDSCRT11024x600_1    = SiS_LVDSCRT11024x600_1;
+   SiS_Pr->SiS_LVDSCRT11152x768_1    = SiS_LVDSCRT11152x768_1;
+   SiS_Pr->SiS_LVDSCRT11280x768_1_H  = SiS_LVDSCRT11280x768_1_H;
+   SiS_Pr->SiS_LVDSCRT11024x600_1_H  = SiS_LVDSCRT11024x600_1_H;
+   SiS_Pr->SiS_LVDSCRT11152x768_1_H  = SiS_LVDSCRT11152x768_1_H;
+   SiS_Pr->SiS_LVDSCRT11280x768_2    = SiS_LVDSCRT11280x768_2;
+   SiS_Pr->SiS_LVDSCRT11024x600_2    = SiS_LVDSCRT11024x600_2;
+   SiS_Pr->SiS_LVDSCRT11152x768_2    = SiS_LVDSCRT11152x768_2;
+   SiS_Pr->SiS_LVDSCRT11280x768_2_H  = SiS_LVDSCRT11280x768_2_H;
+   SiS_Pr->SiS_LVDSCRT11024x600_2_H  = SiS_LVDSCRT11024x600_2_H;
+   SiS_Pr->SiS_LVDSCRT11152x768_2_H  = SiS_LVDSCRT11152x768_2_H;
+   SiS_Pr->SiS_LVDSCRT1320x480_1     = SiS_LVDSCRT1320x480_1;
+   SiS_Pr->SiS_LVDSCRT1XXXxXXX_1     = SiS_LVDSCRT1XXXxXXX_1;
+   SiS_Pr->SiS_LVDSCRT1XXXxXXX_1_H   = SiS_LVDSCRT1XXXxXXX_1_H;
+   SiS_Pr->SiS_LVDSCRT1640x480_1     = SiS_LVDSCRT1640x480_1;
+   SiS_Pr->SiS_LVDSCRT1640x480_1_H   = SiS_LVDSCRT1640x480_1_H;
+   SiS_Pr->SiS_LVDSCRT1640x480_2     = SiS_LVDSCRT1640x480_2;
+   SiS_Pr->SiS_LVDSCRT1640x480_2_H   = SiS_LVDSCRT1640x480_2_H;
+   SiS_Pr->SiS_LVDSCRT1640x480_3     = SiS_LVDSCRT1640x480_3;
+   SiS_Pr->SiS_LVDSCRT1640x480_3_H   = SiS_LVDSCRT1640x480_3_H;
 }
 
 #ifdef SIS300
 static void
-InitTo300Pointer(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension)
+InitTo300Pointer(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
 {
+   InitCommonPointer(SiS_Pr, HwInfo);
+
+   SiS_StandTable[0x04].CRTC[4] = 0x2b;
+   SiS_StandTable[0x05].CRTC[4] = 0x2b;
+   SiS_StandTable[0x06].CRTC[4] = 0x54;
+   SiS_StandTable[0x06].CRTC[5] = 0x80;
+   SiS_StandTable[0x0d].CRTC[4] = 0x2b;
+   SiS_StandTable[0x0e].CRTC[4] = 0x54;
+   SiS_StandTable[0x0e].CRTC[5] = 0x80;
+   SiS_StandTable[0x11].CRTC[4] = 0x54;
+   SiS_StandTable[0x11].CRTC[5] = 0x80;
+   SiS_StandTable[0x11].CRTC[16] = 0x83;
+   SiS_StandTable[0x11].CRTC[17] = 0x85;
+   SiS_StandTable[0x12].CRTC[4] = 0x54;
+   SiS_StandTable[0x12].CRTC[5] = 0x80;
+   SiS_StandTable[0x12].CRTC[16] = 0x83;
+   SiS_StandTable[0x12].CRTC[17] = 0x85;
+   SiS_StandTable[0x13].CRTC[5] = 0xa0;
+   SiS_StandTable[0x17].CRTC[5] = 0xa0;
+   SiS_StandTable[0x1a].CRTC[4] = 0x54;
+   SiS_StandTable[0x1a].CRTC[5] = 0x80;
+   SiS_StandTable[0x1a].CRTC[16] = 0xea;
+   SiS_StandTable[0x1a].CRTC[17] = 0x8c;
+   SiS_StandTable[0x1b].CRTC[4] = 0x54;
+   SiS_StandTable[0x1b].CRTC[5] = 0x80;
+   SiS_StandTable[0x1b].CRTC[16] = 0xea;
+   SiS_StandTable[0x1b].CRTC[17] = 0x8c;
+   SiS_StandTable[0x1c].CRTC[4] = 0x54;
+   SiS_StandTable[0x1c].CRTC[5] = 0x80;
+
    SiS_Pr->SiS_SModeIDTable  = (SiS_StStruct *)SiS300_SModeIDTable;
    SiS_Pr->SiS_VBModeIDTable = (SiS_VBModeStruct *)SiS300_VBModeIDTable;
-   SiS_Pr->SiS_StandTable    = (SiS_StandTableStruct *)SiS300_StandTable;
    SiS_Pr->SiS_EModeIDTable  = (SiS_ExtStruct *)SiS300_EModeIDTable;
    SiS_Pr->SiS_RefIndex      = (SiS_Ext2Struct *)SiS300_RefIndex;
    SiS_Pr->SiS_CRT1Table     = (SiS_CRT1TableStruct *)SiS300_CRT1Table;
-   if(HwDeviceExtension->jChipType == SIS_300) {
+   if(HwInfo->jChipType == SIS_300) {
       SiS_Pr->SiS_MCLKData_0    = (SiS_MCLKDataStruct *)SiS300_MCLKData_300; /* 300 */
    } else {
       SiS_Pr->SiS_MCLKData_0    = (SiS_MCLKDataStruct *)SiS300_MCLKData_630; /* 630, 730 */
    }
-   SiS_Pr->SiS_ECLKData      = (SiS_ECLKDataStruct *)SiS300_ECLKData;
    SiS_Pr->SiS_VCLKData      = (SiS_VCLKDataStruct *)SiS300_VCLKData;
    SiS_Pr->SiS_VBVCLKData    = (SiS_VBVCLKDataStruct *)SiS300_VCLKData;
    SiS_Pr->SiS_ScreenOffset  = SiS300_ScreenOffset;
-   SiS_Pr->SiS_StResInfo     = (SiS_StResInfoStruct *)SiS300_StResInfo;
-   SiS_Pr->SiS_ModeResInfo   = (SiS_ModeResInfoStruct *)SiS300_ModeResInfo;
-
-   SiS_Pr->pSiS_OutputSelect = &SiS300_OutputSelect;
-   SiS_Pr->pSiS_SoftSetting  = &SiS300_SoftSetting;
 
    SiS_Pr->SiS_SR15  = SiS300_SR15;
 
@@ -178,15 +306,6 @@
    SiS_Pr->pSiS_YCSenseData2    = &SiS300_YCSenseData2;
 #endif
 
-   SiS_Pr->SiS_NTSCPhase  = SiS300_NTSCPhase;
-   SiS_Pr->SiS_PALPhase   = SiS300_PALPhase;
-   SiS_Pr->SiS_NTSCPhase2 = SiS300_NTSCPhase2;
-   SiS_Pr->SiS_PALPhase2  = SiS300_PALPhase2;
-   SiS_Pr->SiS_PALMPhase  = SiS300_PALMPhase;
-   SiS_Pr->SiS_PALNPhase  = SiS300_PALNPhase;
-   SiS_Pr->SiS_PALMPhase2 = SiS300_PALMPhase2;
-   SiS_Pr->SiS_PALNPhase2 = SiS300_PALNPhase2;
-
    SiS_Pr->SiS_StLCD1024x768Data    = (SiS_LCDDataStruct *)SiS300_StLCD1024x768Data;
    SiS_Pr->SiS_ExtLCD1024x768Data   = (SiS_LCDDataStruct *)SiS300_ExtLCD1024x768Data;
    SiS_Pr->SiS_St2LCD1024x768Data   = (SiS_LCDDataStruct *)SiS300_St2LCD1024x768Data;
@@ -195,68 +314,21 @@
    SiS_Pr->SiS_St2LCD1280x1024Data  = (SiS_LCDDataStruct *)SiS300_St2LCD1280x1024Data;
    SiS_Pr->SiS_NoScaleData1024x768  = (SiS_LCDDataStruct *)SiS300_NoScaleData1024x768;
    SiS_Pr->SiS_NoScaleData1280x1024 = (SiS_LCDDataStruct *)SiS300_NoScaleData1280x1024;
-   SiS_Pr->SiS_LCD1280x960Data      = (SiS_LCDDataStruct *)SiS300_LCD1280x960Data;
-   SiS_Pr->SiS_ExtLCD1400x1050Data  = (SiS_LCDDataStruct *)SiS300_ExtLCD1400x1050Data;
-   SiS_Pr->SiS_ExtLCD1600x1200Data  = (SiS_LCDDataStruct *)SiS300_ExtLCD1600x1200Data;
-   SiS_Pr->SiS_StLCD1400x1050Data   = (SiS_LCDDataStruct *)SiS300_StLCD1400x1050Data;
-   SiS_Pr->SiS_StLCD1600x1200Data   = (SiS_LCDDataStruct *)SiS300_StLCD1600x1200Data;
-   SiS_Pr->SiS_NoScaleData1400x1050 = (SiS_LCDDataStruct *)SiS300_NoScaleData1400x1050;
-   SiS_Pr->SiS_NoScaleData1600x1200 = (SiS_LCDDataStruct *)SiS300_NoScaleData1600x1200;
-
-   SiS_Pr->SiS_StPALData   = (SiS_TVDataStruct *)SiS300_StPALData;
-   SiS_Pr->SiS_ExtPALData  = (SiS_TVDataStruct *)SiS300_ExtPALData;
-   SiS_Pr->SiS_StNTSCData  = (SiS_TVDataStruct *)SiS300_StNTSCData;
-   SiS_Pr->SiS_ExtNTSCData = (SiS_TVDataStruct *)SiS300_ExtNTSCData;
-/* SiS_Pr->SiS_St1HiTVData = (SiS_TVDataStruct *)SiS300_St1HiTVData;  */
-   SiS_Pr->SiS_St2HiTVData = (SiS_TVDataStruct *)SiS300_St2HiTVData;
-   SiS_Pr->SiS_ExtHiTVData = (SiS_TVDataStruct *)SiS300_ExtHiTVData;
-
-   SiS_Pr->SiS_NTSCTiming     = SiS300_NTSCTiming;
-   SiS_Pr->SiS_PALTiming      = SiS300_PALTiming;
-   SiS_Pr->SiS_HiTVSt1Timing  = SiS300_HiTVSt1Timing;
-   SiS_Pr->SiS_HiTVSt2Timing  = SiS300_HiTVSt2Timing;
-   SiS_Pr->SiS_HiTVTextTiming = SiS300_HiTVTextTiming;
-   SiS_Pr->SiS_HiTVGroup3Data = SiS300_HiTVGroup3Data;
-   SiS_Pr->SiS_HiTVGroup3Simu = SiS300_HiTVGroup3Simu;
-   SiS_Pr->SiS_HiTVGroup3Text = SiS300_HiTVGroup3Text;
 
    SiS_Pr->SiS_PanelDelayTbl     = (SiS_PanelDelayTblStruct *)SiS300_PanelDelayTbl;
+   SiS_Pr->SiS_PanelDelayTblLVDS = (SiS_PanelDelayTblStruct *)SiS300_PanelDelayTbl;
+#if 0
    SiS_Pr->SiS_PanelDelayTblLVDS = (SiS_PanelDelayTblStruct *)SiS300_PanelDelayTblLVDS;
+#endif
 
-   SiS_Pr->SiS_LVDS800x600Data_1   = (SiS_LVDSDataStruct *)SiS300_LVDS800x600Data_1;
-   SiS_Pr->SiS_LVDS800x600Data_2   = (SiS_LVDSDataStruct *)SiS300_LVDS800x600Data_2;
-   SiS_Pr->SiS_LVDS1024x768Data_1  = (SiS_LVDSDataStruct *)SiS300_LVDS1024x768Data_1;
-   SiS_Pr->SiS_LVDS1024x768Data_2  = (SiS_LVDSDataStruct *)SiS300_LVDS1024x768Data_2;
-   SiS_Pr->SiS_LVDS1280x1024Data_1 = (SiS_LVDSDataStruct *)SiS300_LVDS1280x1024Data_1;
-   SiS_Pr->SiS_LVDS1280x1024Data_2 = (SiS_LVDSDataStruct *)SiS300_LVDS1280x1024Data_2;
-   SiS_Pr->SiS_LVDS1280x960Data_1  = (SiS_LVDSDataStruct *)SiS300_LVDS1280x1024Data_1;
-   SiS_Pr->SiS_LVDS1280x960Data_2  = (SiS_LVDSDataStruct *)SiS300_LVDS1280x1024Data_2;
-   SiS_Pr->SiS_LVDS1400x1050Data_1 = (SiS_LVDSDataStruct *)SiS300_LVDS1400x1050Data_1;
-   SiS_Pr->SiS_LVDS1400x1050Data_2 = (SiS_LVDSDataStruct *)SiS300_LVDS1400x1050Data_2;
-   SiS_Pr->SiS_LVDS1600x1200Data_1 = (SiS_LVDSDataStruct *)SiS300_LVDS1600x1200Data_1;
-   SiS_Pr->SiS_LVDS1600x1200Data_2 = (SiS_LVDSDataStruct *)SiS300_LVDS1600x1200Data_2;
-   SiS_Pr->SiS_LVDS1280x768Data_1  = (SiS_LVDSDataStruct *)SiS300_LVDS1280x768Data_1;
-   SiS_Pr->SiS_LVDS1280x768Data_2  = (SiS_LVDSDataStruct *)SiS300_LVDS1280x768Data_2;
-   SiS_Pr->SiS_LVDS1024x600Data_1  = (SiS_LVDSDataStruct *)SiS300_LVDS1024x600Data_1;
-   SiS_Pr->SiS_LVDS1024x600Data_2  = (SiS_LVDSDataStruct *)SiS300_LVDS1024x600Data_2;
-   SiS_Pr->SiS_LVDS1152x768Data_1  = (SiS_LVDSDataStruct *)SiS300_LVDS1152x768Data_1;
-   SiS_Pr->SiS_LVDS1152x768Data_2  = (SiS_LVDSDataStruct *)SiS300_LVDS1152x768Data_2;
-   SiS_Pr->SiS_LVDSXXXxXXXData_1   = (SiS_LVDSDataStruct *)SiS300_LVDSXXXxXXXData_1;
-   SiS_Pr->SiS_LVDS320x480Data_1   = (SiS_LVDSDataStruct *)SiS300_LVDS320x480Data_1;
-   SiS_Pr->SiS_LVDS640x480Data_1   = (SiS_LVDSDataStruct *)SiS300_LVDS640x480Data_1;
-   SiS_Pr->SiS_LCDA1400x1050Data_1 = (SiS_LVDSDataStruct *)SiS300_LCDA1400x1050Data_1;
-   SiS_Pr->SiS_LCDA1400x1050Data_2 = (SiS_LVDSDataStruct *)SiS300_LCDA1400x1050Data_2;
-   SiS_Pr->SiS_LCDA1600x1200Data_1 = (SiS_LVDSDataStruct *)SiS300_LCDA1600x1200Data_1;
-   SiS_Pr->SiS_LCDA1600x1200Data_2 = (SiS_LVDSDataStruct *)SiS300_LCDA1600x1200Data_2;
-   SiS_Pr->SiS_CHTVUNTSCData = (SiS_LVDSDataStruct *)SiS300_CHTVUNTSCData;
-   SiS_Pr->SiS_CHTVONTSCData = (SiS_LVDSDataStruct *)SiS300_CHTVONTSCData;
    SiS_Pr->SiS_CHTVUPALData  = (SiS_LVDSDataStruct *)SiS300_CHTVUPALData;
    SiS_Pr->SiS_CHTVOPALData  = (SiS_LVDSDataStruct *)SiS300_CHTVOPALData;
-   SiS_Pr->SiS_CHTVUPALMData = (SiS_LVDSDataStruct *)SiS300_CHTVUNTSCData; /* not supported on 300 series */
-   SiS_Pr->SiS_CHTVOPALMData = (SiS_LVDSDataStruct *)SiS300_CHTVONTSCData; /* not supported on 300 series */
+   SiS_Pr->SiS_CHTVUPALMData = SiS_CHTVUNTSCData; 			   /* not supported on 300 series */
+   SiS_Pr->SiS_CHTVOPALMData = SiS_CHTVONTSCData; 			   /* not supported on 300 series */
    SiS_Pr->SiS_CHTVUPALNData = (SiS_LVDSDataStruct *)SiS300_CHTVUPALData;  /* not supported on 300 series */
    SiS_Pr->SiS_CHTVOPALNData = (SiS_LVDSDataStruct *)SiS300_CHTVOPALData;  /* not supported on 300 series */
    SiS_Pr->SiS_CHTVSOPALData = (SiS_LVDSDataStruct *)SiS300_CHTVSOPALData;
+
    SiS_Pr->SiS_PanelType00_1 = (SiS_LVDSDesStruct *)SiS300_PanelType00_1;
    SiS_Pr->SiS_PanelType01_1 = (SiS_LVDSDesStruct *)SiS300_PanelType01_1;
    SiS_Pr->SiS_PanelType02_1 = (SiS_LVDSDesStruct *)SiS300_PanelType02_1;
@@ -289,32 +361,28 @@
    SiS_Pr->SiS_PanelType0d_2 = (SiS_LVDSDesStruct *)SiS300_PanelType0d_2;
    SiS_Pr->SiS_PanelType0e_2 = (SiS_LVDSDesStruct *)SiS300_PanelType0e_2;
    SiS_Pr->SiS_PanelType0f_2 = (SiS_LVDSDesStruct *)SiS300_PanelType0f_2;
-   SiS_Pr->SiS_PanelTypeNS_1 = (SiS_LVDSDesStruct *)SiS300_PanelTypeNS_1;
-   SiS_Pr->SiS_PanelTypeNS_2 = (SiS_LVDSDesStruct *)SiS300_PanelTypeNS_2;
-   SiS_Pr->SiS_CHTVUNTSCDesData = (SiS_LVDSDesStruct *)SiS300_CHTVUNTSCDesData;
-   SiS_Pr->SiS_CHTVONTSCDesData = (SiS_LVDSDesStruct *)SiS300_CHTVONTSCDesData;
-   SiS_Pr->SiS_CHTVUPALDesData  = (SiS_LVDSDesStruct *)SiS300_CHTVUPALDesData;
-   SiS_Pr->SiS_CHTVOPALDesData  = (SiS_LVDSDesStruct *)SiS300_CHTVOPALDesData;
+
+   if(SiS_Pr->SiS_CustomT == CUT_BARCO1366) {
+      SiS_Pr->SiS_PanelType04_1 = (SiS_LVDSDesStruct *)SiS300_PanelType04_1a;
+      SiS_Pr->SiS_PanelType04_2 = (SiS_LVDSDesStruct *)SiS300_PanelType04_2a;
+   }
+   if(SiS_Pr->SiS_CustomT == CUT_BARCO1024) {
+      SiS_Pr->SiS_PanelType04_1 = (SiS_LVDSDesStruct *)SiS300_PanelType04_1b;
+      SiS_Pr->SiS_PanelType04_2 = (SiS_LVDSDesStruct *)SiS300_PanelType04_2b;
+   }
+
    SiS_Pr->SiS_LVDSCRT1800x600_1     = (SiS_LVDSCRT1DataStruct *)SiS300_LVDSCRT1800x600_1;
    SiS_Pr->SiS_LVDSCRT11024x768_1    = (SiS_LVDSCRT1DataStruct *)SiS300_LVDSCRT11024x768_1;
    SiS_Pr->SiS_LVDSCRT11280x1024_1   = (SiS_LVDSCRT1DataStruct *)SiS300_LVDSCRT11280x1024_1;
-   SiS_Pr->SiS_LVDSCRT11024x600_1    = (SiS_LVDSCRT1DataStruct *)SiS300_LVDSCRT11024x600_1;
-   SiS_Pr->SiS_LVDSCRT11152x768_1    = (SiS_LVDSCRT1DataStruct *)SiS300_LVDSCRT11152x768_1;
    SiS_Pr->SiS_LVDSCRT1800x600_1_H   = (SiS_LVDSCRT1DataStruct *)SiS300_LVDSCRT1800x600_1_H;
    SiS_Pr->SiS_LVDSCRT11024x768_1_H  = (SiS_LVDSCRT1DataStruct *)SiS300_LVDSCRT11024x768_1_H;
    SiS_Pr->SiS_LVDSCRT11280x1024_1_H = (SiS_LVDSCRT1DataStruct *)SiS300_LVDSCRT11280x1024_1_H;
-   SiS_Pr->SiS_LVDSCRT11024x600_1_H  = (SiS_LVDSCRT1DataStruct *)SiS300_LVDSCRT11024x600_1_H;
-   SiS_Pr->SiS_LVDSCRT11152x768_1_H  = (SiS_LVDSCRT1DataStruct *)SiS300_LVDSCRT11152x768_1_H;
    SiS_Pr->SiS_LVDSCRT1800x600_2     = (SiS_LVDSCRT1DataStruct *)SiS300_LVDSCRT1800x600_2;
    SiS_Pr->SiS_LVDSCRT11024x768_2    = (SiS_LVDSCRT1DataStruct *)SiS300_LVDSCRT11024x768_2;
    SiS_Pr->SiS_LVDSCRT11280x1024_2   = (SiS_LVDSCRT1DataStruct *)SiS300_LVDSCRT11280x1024_2;
-   SiS_Pr->SiS_LVDSCRT11024x600_2    = (SiS_LVDSCRT1DataStruct *)SiS300_LVDSCRT11024x600_2;
-   SiS_Pr->SiS_LVDSCRT11152x768_2    = (SiS_LVDSCRT1DataStruct *)SiS300_LVDSCRT11152x768_2;
    SiS_Pr->SiS_LVDSCRT1800x600_2_H   = (SiS_LVDSCRT1DataStruct *)SiS300_LVDSCRT1800x600_2_H;
    SiS_Pr->SiS_LVDSCRT11024x768_2_H  = (SiS_LVDSCRT1DataStruct *)SiS300_LVDSCRT11024x768_2_H;
    SiS_Pr->SiS_LVDSCRT11280x1024_2_H = (SiS_LVDSCRT1DataStruct *)SiS300_LVDSCRT11280x1024_2_H;
-   SiS_Pr->SiS_LVDSCRT11024x600_2_H  = (SiS_LVDSCRT1DataStruct *)SiS300_LVDSCRT11024x600_2_H;
-   SiS_Pr->SiS_LVDSCRT11152x768_2_H  = (SiS_LVDSCRT1DataStruct *)SiS300_LVDSCRT11152x768_2_H;
    SiS_Pr->SiS_CHTVCRT1UNTSC = (SiS_LVDSCRT1DataStruct *)SiS300_CHTVCRT1UNTSC;
    SiS_Pr->SiS_CHTVCRT1ONTSC = (SiS_LVDSCRT1DataStruct *)SiS300_CHTVCRT1ONTSC;
    SiS_Pr->SiS_CHTVCRT1UPAL  = (SiS_LVDSCRT1DataStruct *)SiS300_CHTVCRT1UPAL;
@@ -339,7 +407,6 @@
    SiS_Pr->SiS_CHTVVCLKOPALN = SiS300_CHTVVCLKOPAL;   /* not supported on 300 series */
    SiS_Pr->SiS_CHTVVCLKSOPAL = SiS300_CHTVVCLKSOPAL;
 
-   /* TW: New from 300/301LV BIOS */
    SiS_Pr->SiS_CRT2Part2_1024x768_1  = (SiS_Part2PortTblStruct *)SiS300_CRT2Part2_1024x768_1;
    SiS_Pr->SiS_CRT2Part2_1280x1024_1 = (SiS_Part2PortTblStruct *)SiS300_CRT2Part2_1280x1024_1;
    SiS_Pr->SiS_CRT2Part2_1400x1050_1 = (SiS_Part2PortTblStruct *)SiS300_CRT2Part2_1400x1050_1;
@@ -353,7 +420,7 @@
    SiS_Pr->SiS_CRT2Part2_1400x1050_3 = (SiS_Part2PortTblStruct *)SiS300_CRT2Part2_1400x1050_3;
    SiS_Pr->SiS_CRT2Part2_1600x1200_3 = (SiS_Part2PortTblStruct *)SiS300_CRT2Part2_1600x1200_3;
 
-   /* TW: LCDResInfo will on 300 series be translated to 310/325 series definitions */
+   /* LCDResInfo will on 300 series be translated to 315 series definitions */
    SiS_Pr->SiS_Panel320x480   = Panel_320x480;
    SiS_Pr->SiS_Panel640x480   = Panel_640x480;
    SiS_Pr->SiS_Panel800x600   = Panel_800x600;
@@ -362,43 +429,71 @@
    SiS_Pr->SiS_Panel1280x960  = Panel_1280x960;
    SiS_Pr->SiS_Panel1024x600  = Panel_1024x600;
    SiS_Pr->SiS_Panel1152x768  = Panel_1152x768;
-   SiS_Pr->SiS_Panel1600x1200 = 16;  		/* TW: Something illegal */
-   SiS_Pr->SiS_Panel1400x1050 = 16;  		/* TW: Something illegal */
-   SiS_Pr->SiS_Panel1152x864  = 16;   		/* TW: Something illegal */
-   SiS_Pr->SiS_Panel1280x768  = 16;   		/* TW: Something illegal */
-   SiS_Pr->SiS_PanelMax       = Panel_320x480;     /* TW: highest value */
-   SiS_Pr->SiS_PanelMinLVDS   = Panel_800x600;     /* TW: Lowest value LVDS */
-   SiS_Pr->SiS_PanelMin301    = Panel_1024x768;    /* TW: lowest value 301 */
+   SiS_Pr->SiS_Panel1280x768  = Panel_1280x768;
+   SiS_Pr->SiS_Panel1600x1200 = 255;  		   /* Something illegal */
+   SiS_Pr->SiS_Panel1400x1050 = 255;
+   SiS_Pr->SiS_Panel640x480_2 = 255;
+   SiS_Pr->SiS_Panel640x480_3 = 255;
+   SiS_Pr->SiS_Panel1152x864  = 255;
+   SiS_Pr->SiS_PanelMax       = Panel_320x480;     /* highest value */
+   SiS_Pr->SiS_PanelMinLVDS   = Panel_800x600;     /* Lowest value LVDS */
+   SiS_Pr->SiS_PanelMin301    = Panel_1024x768;    /* lowest value 301 */
+   SiS_Pr->SiS_PanelCustom    = Panel_Custom;
+   SiS_Pr->SiS_PanelBarco1366 = Panel_Barco1366;
 }
 #endif
 
 #ifdef SIS315H
 static void
-InitTo310Pointer(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension)
+InitTo310Pointer(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
 {
+   InitCommonPointer(SiS_Pr, HwInfo);
+
+   SiS_StandTable[0x04].CRTC[4] = 0x2c;
+   SiS_StandTable[0x05].CRTC[4] = 0x2c;
+   SiS_StandTable[0x06].CRTC[4] = 0x55;
+   SiS_StandTable[0x06].CRTC[5] = 0x81;
+   SiS_StandTable[0x0d].CRTC[4] = 0x2c;
+   SiS_StandTable[0x0e].CRTC[4] = 0x55;
+   SiS_StandTable[0x0e].CRTC[5] = 0x81;
+   SiS_StandTable[0x11].CRTC[4] = 0x55;
+   SiS_StandTable[0x11].CRTC[5] = 0x81;
+   SiS_StandTable[0x11].CRTC[16] = 0x82;
+   SiS_StandTable[0x11].CRTC[17] = 0x84;
+   SiS_StandTable[0x12].CRTC[4] = 0x55;
+   SiS_StandTable[0x12].CRTC[5] = 0x81;
+   SiS_StandTable[0x12].CRTC[16] = 0x82;
+   SiS_StandTable[0x12].CRTC[17] = 0x84;
+   SiS_StandTable[0x13].CRTC[5] = 0xb1;
+   SiS_StandTable[0x17].CRTC[5] = 0xb1;
+   SiS_StandTable[0x1a].CRTC[4] = 0x55;
+   SiS_StandTable[0x1a].CRTC[5] = 0x81;
+   SiS_StandTable[0x1a].CRTC[16] = 0xe9;
+   SiS_StandTable[0x1a].CRTC[17] = 0x8b;
+   SiS_StandTable[0x1b].CRTC[4] = 0x55;
+   SiS_StandTable[0x1b].CRTC[5] = 0x81;
+   SiS_StandTable[0x1b].CRTC[16] = 0xe9;
+   SiS_StandTable[0x1b].CRTC[17] = 0x8b;
+   SiS_StandTable[0x1c].CRTC[4] = 0x55;
+   SiS_StandTable[0x1c].CRTC[5] = 0x81;
+
    SiS_Pr->SiS_SModeIDTable  = (SiS_StStruct *)SiS310_SModeIDTable;
-   SiS_Pr->SiS_StandTable    = (SiS_StandTableStruct *)SiS310_StandTable;
    SiS_Pr->SiS_EModeIDTable  = (SiS_ExtStruct *)SiS310_EModeIDTable;
    SiS_Pr->SiS_RefIndex      = (SiS_Ext2Struct *)SiS310_RefIndex;
    SiS_Pr->SiS_CRT1Table     = (SiS_CRT1TableStruct *)SiS310_CRT1Table;
-   /* TW: MCLK is different */
-   if(HwDeviceExtension->jChipType == SIS_330) {
+   if(HwInfo->jChipType >= SIS_661) {
+      SiS_Pr->SiS_MCLKData_0 = (SiS_MCLKDataStruct *)SiS310_MCLKData_0_660;  /* 661/741/760 */
+   } else if(HwInfo->jChipType == SIS_330) {
       SiS_Pr->SiS_MCLKData_0 = (SiS_MCLKDataStruct *)SiS310_MCLKData_0_330;  /* 330 */
-   } else if(HwDeviceExtension->jChipType > SIS_315PRO) {
+   } else if(HwInfo->jChipType > SIS_315PRO) {
       SiS_Pr->SiS_MCLKData_0 = (SiS_MCLKDataStruct *)SiS310_MCLKData_0_650;  /* 550, 650, 740 */
    } else {
       SiS_Pr->SiS_MCLKData_0 = (SiS_MCLKDataStruct *)SiS310_MCLKData_0_315;  /* 315 */
    }
    SiS_Pr->SiS_MCLKData_1    = (SiS_MCLKDataStruct *)SiS310_MCLKData_1;
-   SiS_Pr->SiS_ECLKData      = (SiS_ECLKDataStruct *)SiS310_ECLKData;
    SiS_Pr->SiS_VCLKData      = (SiS_VCLKDataStruct *)SiS310_VCLKData;
    SiS_Pr->SiS_VBVCLKData    = (SiS_VBVCLKDataStruct *)SiS310_VBVCLKData;
    SiS_Pr->SiS_ScreenOffset  = SiS310_ScreenOffset;
-   SiS_Pr->SiS_StResInfo     = (SiS_StResInfoStruct *)SiS310_StResInfo;
-   SiS_Pr->SiS_ModeResInfo   = (SiS_ModeResInfoStruct *)SiS310_ModeResInfo;
-
-   SiS_Pr->pSiS_OutputSelect = &SiS310_OutputSelect;
-   SiS_Pr->pSiS_SoftSetting  = &SiS310_SoftSetting;
 
    SiS_Pr->SiS_SR15  = SiS310_SR15;
 
@@ -427,16 +522,6 @@
    SiS_Pr->pSiS_YCSenseData2    = &SiS310_YCSenseData2;
 #endif
 
-   SiS_Pr->SiS_NTSCPhase    = SiS310_NTSCPhase;
-   SiS_Pr->SiS_PALPhase     = SiS310_PALPhase;
-   SiS_Pr->SiS_NTSCPhase2   = SiS310_NTSCPhase2;
-   SiS_Pr->SiS_PALPhase2    = SiS310_PALPhase2;
-   SiS_Pr->SiS_PALMPhase    = SiS310_PALMPhase;
-   SiS_Pr->SiS_PALNPhase    = SiS310_PALNPhase;
-   SiS_Pr->SiS_PALMPhase2   = SiS310_PALMPhase2;
-   SiS_Pr->SiS_PALNPhase2   = SiS310_PALNPhase2;
-   SiS_Pr->SiS_SpecialPhase = SiS310_SpecialPhase;
-
    SiS_Pr->SiS_StLCD1024x768Data    = (SiS_LCDDataStruct *)SiS310_StLCD1024x768Data;
    SiS_Pr->SiS_ExtLCD1024x768Data   = (SiS_LCDDataStruct *)SiS310_ExtLCD1024x768Data;
    SiS_Pr->SiS_St2LCD1024x768Data   = (SiS_LCDDataStruct *)SiS310_St2LCD1024x768Data;
@@ -445,62 +530,10 @@
    SiS_Pr->SiS_St2LCD1280x1024Data  = (SiS_LCDDataStruct *)SiS310_St2LCD1280x1024Data;
    SiS_Pr->SiS_NoScaleData1024x768  = (SiS_LCDDataStruct *)SiS310_NoScaleData1024x768;
    SiS_Pr->SiS_NoScaleData1280x1024 = (SiS_LCDDataStruct *)SiS310_NoScaleData1280x1024;
-   SiS_Pr->SiS_LCD1280x960Data      = (SiS_LCDDataStruct *)SiS310_LCD1280x960Data;
-   SiS_Pr->SiS_ExtLCD1400x1050Data  = (SiS_LCDDataStruct *)SiS310_ExtLCD1400x1050Data;
-   SiS_Pr->SiS_ExtLCD1600x1200Data  = (SiS_LCDDataStruct *)SiS310_ExtLCD1600x1200Data;
-   SiS_Pr->SiS_StLCD1400x1050Data   = (SiS_LCDDataStruct *)SiS310_StLCD1400x1050Data;
-   SiS_Pr->SiS_StLCD1600x1200Data   = (SiS_LCDDataStruct *)SiS310_StLCD1600x1200Data;
-   SiS_Pr->SiS_NoScaleData1400x1050 = (SiS_LCDDataStruct *)SiS310_NoScaleData1400x1050;
-   SiS_Pr->SiS_NoScaleData1600x1200 = (SiS_LCDDataStruct *)SiS310_NoScaleData1600x1200;
-
-   SiS_Pr->SiS_StPALData   = (SiS_TVDataStruct *)SiS310_StPALData;
-   SiS_Pr->SiS_ExtPALData  = (SiS_TVDataStruct *)SiS310_ExtPALData;
-   SiS_Pr->SiS_StNTSCData  = (SiS_TVDataStruct *)SiS310_StNTSCData;
-   SiS_Pr->SiS_ExtNTSCData = (SiS_TVDataStruct *)SiS310_ExtNTSCData;
-/* SiS_Pr->SiS_St1HiTVData = (SiS_TVDataStruct *)SiS310_St1HiTVData;  */
-   SiS_Pr->SiS_St2HiTVData = (SiS_TVDataStruct *)SiS310_St2HiTVData;
-   SiS_Pr->SiS_ExtHiTVData = (SiS_TVDataStruct *)SiS310_ExtHiTVData;
-
-   SiS_Pr->SiS_NTSCTiming     = SiS310_NTSCTiming;
-   SiS_Pr->SiS_PALTiming      = SiS310_PALTiming;
-   SiS_Pr->SiS_HiTVSt1Timing  = SiS310_HiTVSt1Timing;
-   SiS_Pr->SiS_HiTVSt2Timing  = SiS310_HiTVSt2Timing;
-   SiS_Pr->SiS_HiTVTextTiming = SiS310_HiTVTextTiming;
-   SiS_Pr->SiS_HiTVExtTiming  = SiS310_HiTVExtTiming;
-   SiS_Pr->SiS_HiTVGroup3Data = SiS310_HiTVGroup3Data;
-   SiS_Pr->SiS_HiTVGroup3Simu = SiS310_HiTVGroup3Simu;
-   SiS_Pr->SiS_HiTVGroup3Text = SiS310_HiTVGroup3Text;
 
-   SiS_Pr->SiS_PanelDelayTbl = (SiS_PanelDelayTblStruct *)SiS310_PanelDelayTbl;
+   SiS_Pr->SiS_PanelDelayTbl     = (SiS_PanelDelayTblStruct *)SiS310_PanelDelayTbl;
    SiS_Pr->SiS_PanelDelayTblLVDS = (SiS_PanelDelayTblStruct *)SiS310_PanelDelayTblLVDS;
 
-   SiS_Pr->SiS_LVDS800x600Data_1   = (SiS_LVDSDataStruct *)SiS310_LVDS800x600Data_1;
-   SiS_Pr->SiS_LVDS800x600Data_2   = (SiS_LVDSDataStruct *)SiS310_LVDS800x600Data_2;
-   SiS_Pr->SiS_LVDS1024x768Data_1  = (SiS_LVDSDataStruct *)SiS310_LVDS1024x768Data_1;
-   SiS_Pr->SiS_LVDS1024x768Data_2  = (SiS_LVDSDataStruct *)SiS310_LVDS1024x768Data_2;
-   SiS_Pr->SiS_LVDS1280x1024Data_1 = (SiS_LVDSDataStruct *)SiS310_LVDS1280x1024Data_1;
-   SiS_Pr->SiS_LVDS1280x1024Data_2 = (SiS_LVDSDataStruct *)SiS310_LVDS1280x1024Data_2;
-   SiS_Pr->SiS_LVDS1280x960Data_1  = (SiS_LVDSDataStruct *)SiS310_LVDS1280x960Data_1;
-   SiS_Pr->SiS_LVDS1280x960Data_2  = (SiS_LVDSDataStruct *)SiS310_LVDS1280x960Data_2;
-   SiS_Pr->SiS_LVDS1400x1050Data_1 = (SiS_LVDSDataStruct *)SiS310_LVDS1400x1050Data_1;
-   SiS_Pr->SiS_LVDS1400x1050Data_2 = (SiS_LVDSDataStruct *)SiS310_LVDS1400x1050Data_2;
-   SiS_Pr->SiS_LVDS1600x1200Data_1 = (SiS_LVDSDataStruct *)SiS310_LVDS1600x1200Data_1;
-   SiS_Pr->SiS_LVDS1600x1200Data_2 = (SiS_LVDSDataStruct *)SiS310_LVDS1600x1200Data_2;
-   SiS_Pr->SiS_LVDS1280x768Data_1  = (SiS_LVDSDataStruct *)SiS310_LVDS1280x768Data_1;
-   SiS_Pr->SiS_LVDS1280x768Data_2  = (SiS_LVDSDataStruct *)SiS310_LVDS1280x768Data_2;
-   SiS_Pr->SiS_LVDS1024x600Data_1  = (SiS_LVDSDataStruct *)SiS310_LVDS1024x600Data_1;
-   SiS_Pr->SiS_LVDS1024x600Data_2  = (SiS_LVDSDataStruct *)SiS310_LVDS1024x600Data_2;
-   SiS_Pr->SiS_LVDS1152x768Data_1  = (SiS_LVDSDataStruct *)SiS310_LVDS1152x768Data_1;
-   SiS_Pr->SiS_LVDS1152x768Data_2  = (SiS_LVDSDataStruct *)SiS310_LVDS1152x768Data_2;
-   SiS_Pr->SiS_LVDSXXXxXXXData_1   = (SiS_LVDSDataStruct *)SiS310_LVDSXXXxXXXData_1;
-   SiS_Pr->SiS_LVDS320x480Data_1   = (SiS_LVDSDataStruct *)SiS310_LVDS320x480Data_1;
-   SiS_Pr->SiS_LVDS640x480Data_1   = (SiS_LVDSDataStruct *)SiS310_LVDS640x480Data_1;
-   SiS_Pr->SiS_LCDA1400x1050Data_1  = (SiS_LVDSDataStruct *)SiS310_LCDA1400x1050Data_1;
-   SiS_Pr->SiS_LCDA1400x1050Data_2  = (SiS_LVDSDataStruct *)SiS310_LCDA1400x1050Data_2;
-   SiS_Pr->SiS_LCDA1600x1200Data_1  = (SiS_LVDSDataStruct *)SiS310_LCDA1600x1200Data_1;
-   SiS_Pr->SiS_LCDA1600x1200Data_2  = (SiS_LVDSDataStruct *)SiS310_LCDA1600x1200Data_2;
-   SiS_Pr->SiS_CHTVUNTSCData = (SiS_LVDSDataStruct *)SiS310_CHTVUNTSCData;
-   SiS_Pr->SiS_CHTVONTSCData = (SiS_LVDSDataStruct *)SiS310_CHTVONTSCData;
    SiS_Pr->SiS_CHTVUPALData  = (SiS_LVDSDataStruct *)SiS310_CHTVUPALData;
    SiS_Pr->SiS_CHTVOPALData  = (SiS_LVDSDataStruct *)SiS310_CHTVOPALData;
    SiS_Pr->SiS_CHTVUPALMData = (SiS_LVDSDataStruct *)SiS310_CHTVUPALMData;
@@ -508,6 +541,7 @@
    SiS_Pr->SiS_CHTVUPALNData = (SiS_LVDSDataStruct *)SiS310_CHTVUPALNData;
    SiS_Pr->SiS_CHTVOPALNData = (SiS_LVDSDataStruct *)SiS310_CHTVOPALNData;
    SiS_Pr->SiS_CHTVSOPALData = (SiS_LVDSDataStruct *)SiS310_CHTVSOPALData;
+
    SiS_Pr->SiS_PanelType00_1 = (SiS_LVDSDesStruct *)SiS310_PanelType00_1;
    SiS_Pr->SiS_PanelType01_1 = (SiS_LVDSDesStruct *)SiS310_PanelType01_1;
    SiS_Pr->SiS_PanelType02_1 = (SiS_LVDSDesStruct *)SiS310_PanelType02_1;
@@ -540,19 +574,7 @@
    SiS_Pr->SiS_PanelType0d_2 = (SiS_LVDSDesStruct *)SiS310_PanelType0d_2;
    SiS_Pr->SiS_PanelType0e_2 = (SiS_LVDSDesStruct *)SiS310_PanelType0e_2;
    SiS_Pr->SiS_PanelType0f_2 = (SiS_LVDSDesStruct *)SiS310_PanelType0f_2;
-   SiS_Pr->SiS_PanelTypeNS_1 = (SiS_LVDSDesStruct *)SiS310_PanelTypeNS_1;
-   SiS_Pr->SiS_PanelTypeNS_2 = (SiS_LVDSDesStruct *)SiS310_PanelTypeNS_2;
-
-   SiS_Pr->LVDS1024x768Des_1  = (SiS_LVDSDesStruct *)SiS310_PanelType1076_1;
-   SiS_Pr->LVDS1280x1024Des_1 = (SiS_LVDSDesStruct *)SiS310_PanelType1210_1;
-   SiS_Pr->LVDS1400x1050Des_1 = (SiS_LVDSDesStruct *)SiS310_PanelType1296_1 ;
-   SiS_Pr->LVDS1600x1200Des_1 = (SiS_LVDSDesStruct *)SiS310_PanelType1600_1 ;
-   SiS_Pr->LVDS1024x768Des_2  = (SiS_LVDSDesStruct *)SiS310_PanelType1076_2;
-   SiS_Pr->LVDS1280x1024Des_2 = (SiS_LVDSDesStruct *)SiS310_PanelType1210_2;
-   SiS_Pr->LVDS1400x1050Des_2 = (SiS_LVDSDesStruct *)SiS310_PanelType1296_2;
-   SiS_Pr->LVDS1600x1200Des_2 = (SiS_LVDSDesStruct *)SiS310_PanelType1600_2 ;
 
-   /* TW: New from 650/301LV BIOS */
    SiS_Pr->SiS_CRT2Part2_1024x768_1  = (SiS_Part2PortTblStruct *)SiS310_CRT2Part2_1024x768_1;
    SiS_Pr->SiS_CRT2Part2_1280x1024_1 = (SiS_Part2PortTblStruct *)SiS310_CRT2Part2_1280x1024_1;
    SiS_Pr->SiS_CRT2Part2_1400x1050_1 = (SiS_Part2PortTblStruct *)SiS310_CRT2Part2_1400x1050_1;
@@ -566,51 +588,32 @@
    SiS_Pr->SiS_CRT2Part2_1400x1050_3 = (SiS_Part2PortTblStruct *)SiS310_CRT2Part2_1400x1050_3;
    SiS_Pr->SiS_CRT2Part2_1600x1200_3 = (SiS_Part2PortTblStruct *)SiS310_CRT2Part2_1600x1200_3;
 
-   SiS_Pr->SiS_CHTVUNTSCDesData = (SiS_LVDSDesStruct *)SiS310_CHTVUNTSCDesData;
-   SiS_Pr->SiS_CHTVONTSCDesData = (SiS_LVDSDesStruct *)SiS310_CHTVONTSCDesData;
-   SiS_Pr->SiS_CHTVUPALDesData  = (SiS_LVDSDesStruct *)SiS310_CHTVUPALDesData;
-   SiS_Pr->SiS_CHTVOPALDesData  = (SiS_LVDSDesStruct *)SiS310_CHTVOPALDesData;
-
    SiS_Pr->SiS_LVDSCRT1800x600_1     = (SiS_LVDSCRT1DataStruct *)SiS310_LVDSCRT1800x600_1;
    SiS_Pr->SiS_LVDSCRT11024x768_1    = (SiS_LVDSCRT1DataStruct *)SiS310_LVDSCRT11024x768_1;
    SiS_Pr->SiS_LVDSCRT11280x1024_1   = (SiS_LVDSCRT1DataStruct *)SiS310_LVDSCRT11280x1024_1;
    SiS_Pr->SiS_LVDSCRT11400x1050_1   = (SiS_LVDSCRT1DataStruct *)SiS310_LVDSCRT11400x1050_1;
-   SiS_Pr->SiS_LVDSCRT11280x768_1    = (SiS_LVDSCRT1DataStruct *)SiS310_LVDSCRT11280x768_1;
-   SiS_Pr->SiS_LVDSCRT11024x600_1    = (SiS_LVDSCRT1DataStruct *)SiS310_LVDSCRT11024x600_1;
-   SiS_Pr->SiS_LVDSCRT11152x768_1    = (SiS_LVDSCRT1DataStruct *)SiS310_LVDSCRT11152x768_1;
    SiS_Pr->SiS_LVDSCRT11600x1200_1   = (SiS_LVDSCRT1DataStruct *)SiS310_LVDSCRT11600x1200_1;
    SiS_Pr->SiS_LVDSCRT1800x600_1_H   = (SiS_LVDSCRT1DataStruct *)SiS310_LVDSCRT1800x600_1_H;
    SiS_Pr->SiS_LVDSCRT11024x768_1_H  = (SiS_LVDSCRT1DataStruct *)SiS310_LVDSCRT11024x768_1_H;
    SiS_Pr->SiS_LVDSCRT11280x1024_1_H = (SiS_LVDSCRT1DataStruct *)SiS310_LVDSCRT11280x1024_1_H;
    SiS_Pr->SiS_LVDSCRT11400x1050_1_H = (SiS_LVDSCRT1DataStruct *)SiS310_LVDSCRT11400x1050_1_H;
-   SiS_Pr->SiS_LVDSCRT11280x768_1_H  = (SiS_LVDSCRT1DataStruct *)SiS310_LVDSCRT11280x768_1_H;
-   SiS_Pr->SiS_LVDSCRT11024x600_1_H  = (SiS_LVDSCRT1DataStruct *)SiS310_LVDSCRT11024x600_1_H;
-   SiS_Pr->SiS_LVDSCRT11152x768_1_H  = (SiS_LVDSCRT1DataStruct *)SiS310_LVDSCRT11152x768_1_H;
    SiS_Pr->SiS_LVDSCRT11600x1200_1_H = (SiS_LVDSCRT1DataStruct *)SiS310_LVDSCRT11600x1200_1_H;
    SiS_Pr->SiS_LVDSCRT1800x600_2     = (SiS_LVDSCRT1DataStruct *)SiS310_LVDSCRT1800x600_2;
    SiS_Pr->SiS_LVDSCRT11024x768_2    = (SiS_LVDSCRT1DataStruct *)SiS310_LVDSCRT11024x768_2;
    SiS_Pr->SiS_LVDSCRT11280x1024_2   = (SiS_LVDSCRT1DataStruct *)SiS310_LVDSCRT11280x1024_2;
    SiS_Pr->SiS_LVDSCRT11400x1050_2   = (SiS_LVDSCRT1DataStruct *)SiS310_LVDSCRT11400x1050_2;
-   SiS_Pr->SiS_LVDSCRT11280x768_2    = (SiS_LVDSCRT1DataStruct *)SiS310_LVDSCRT11280x768_2;
-   SiS_Pr->SiS_LVDSCRT11024x600_2    = (SiS_LVDSCRT1DataStruct *)SiS310_LVDSCRT11024x600_2;
-   SiS_Pr->SiS_LVDSCRT11152x768_2    = (SiS_LVDSCRT1DataStruct *)SiS310_LVDSCRT11152x768_2;
    SiS_Pr->SiS_LVDSCRT11600x1200_2   = (SiS_LVDSCRT1DataStruct *)SiS310_LVDSCRT11600x1200_2;
    SiS_Pr->SiS_LVDSCRT1800x600_2_H   = (SiS_LVDSCRT1DataStruct *)SiS310_LVDSCRT1800x600_2_H;
    SiS_Pr->SiS_LVDSCRT11024x768_2_H  = (SiS_LVDSCRT1DataStruct *)SiS310_LVDSCRT11024x768_2_H;
    SiS_Pr->SiS_LVDSCRT11280x1024_2_H = (SiS_LVDSCRT1DataStruct *)SiS310_LVDSCRT11280x1024_2_H;
    SiS_Pr->SiS_LVDSCRT11400x1050_2_H = (SiS_LVDSCRT1DataStruct *)SiS310_LVDSCRT11400x1050_2_H;
-   SiS_Pr->SiS_LVDSCRT11280x768_2_H  = (SiS_LVDSCRT1DataStruct *)SiS310_LVDSCRT11280x768_2_H;
-   SiS_Pr->SiS_LVDSCRT11024x600_2_H  = (SiS_LVDSCRT1DataStruct *)SiS310_LVDSCRT11024x600_2_H;
-   SiS_Pr->SiS_LVDSCRT11152x768_2_H  = (SiS_LVDSCRT1DataStruct *)SiS310_LVDSCRT11152x768_2_H;
    SiS_Pr->SiS_LVDSCRT11600x1200_2_H = (SiS_LVDSCRT1DataStruct *)SiS310_LVDSCRT11600x1200_2_H;
-   SiS_Pr->SiS_LVDSCRT1XXXxXXX_1     = (SiS_LVDSCRT1DataStruct *)SiS310_LVDSCRT1XXXxXXX_1;
-   SiS_Pr->SiS_LVDSCRT1XXXxXXX_1_H   = (SiS_LVDSCRT1DataStruct *)SiS310_LVDSCRT1XXXxXXX_1_H;
-   SiS_Pr->SiS_LVDSCRT1320x480_1     = (SiS_LVDSCRT1DataStruct *)SiS310_LVDSCRT1320x480_1;
-   SiS_Pr->SiS_CHTVCRT1UNTSC = (SiS_LVDSCRT1DataStruct *)SiS310_CHTVCRT1UNTSC;
-   SiS_Pr->SiS_CHTVCRT1ONTSC = (SiS_LVDSCRT1DataStruct *)SiS310_CHTVCRT1ONTSC;
-   SiS_Pr->SiS_CHTVCRT1UPAL  = (SiS_LVDSCRT1DataStruct *)SiS310_CHTVCRT1UPAL;
-   SiS_Pr->SiS_CHTVCRT1OPAL  = (SiS_LVDSCRT1DataStruct *)SiS310_CHTVCRT1OPAL;
-   SiS_Pr->SiS_CHTVCRT1SOPAL = (SiS_LVDSCRT1DataStruct *)SiS310_CHTVCRT1SOPAL;
+   SiS_Pr->SiS_CHTVCRT1UNTSC         = (SiS_LVDSCRT1DataStruct *)SiS310_CHTVCRT1UNTSC;
+   SiS_Pr->SiS_CHTVCRT1ONTSC         = (SiS_LVDSCRT1DataStruct *)SiS310_CHTVCRT1ONTSC;
+   SiS_Pr->SiS_CHTVCRT1UPAL          = (SiS_LVDSCRT1DataStruct *)SiS310_CHTVCRT1UPAL;
+   SiS_Pr->SiS_CHTVCRT1OPAL          = (SiS_LVDSCRT1DataStruct *)SiS310_CHTVCRT1OPAL;
+   SiS_Pr->SiS_CHTVCRT1SOPAL         = (SiS_LVDSCRT1DataStruct *)SiS310_CHTVCRT1OPAL;
+
    SiS_Pr->SiS_CHTVReg_UNTSC = (SiS_CHTVRegDataStruct *)SiS310_CHTVReg_UNTSC;
    SiS_Pr->SiS_CHTVReg_ONTSC = (SiS_CHTVRegDataStruct *)SiS310_CHTVReg_ONTSC;
    SiS_Pr->SiS_CHTVReg_UPAL  = (SiS_CHTVRegDataStruct *)SiS310_CHTVReg_UPAL;
@@ -619,27 +622,25 @@
    SiS_Pr->SiS_CHTVReg_OPALM = (SiS_CHTVRegDataStruct *)SiS310_CHTVReg_OPALM;
    SiS_Pr->SiS_CHTVReg_UPALN = (SiS_CHTVRegDataStruct *)SiS310_CHTVReg_UPALN;
    SiS_Pr->SiS_CHTVReg_OPALN = (SiS_CHTVRegDataStruct *)SiS310_CHTVReg_OPALN;
-   SiS_Pr->SiS_CHTVReg_SOPAL = (SiS_CHTVRegDataStruct *)SiS310_CHTVReg_SOPAL;
-   SiS_Pr->SiS_LCDACRT1800x600_1     = (SiS_LCDACRT1DataStruct *)SiS310_LCDACRT1800x600_1;
+   SiS_Pr->SiS_CHTVReg_SOPAL = (SiS_CHTVRegDataStruct *)SiS310_CHTVReg_OPAL;
+
    SiS_Pr->SiS_LCDACRT11024x768_1    = (SiS_LCDACRT1DataStruct *)SiS310_LCDACRT11024x768_1;
    SiS_Pr->SiS_LCDACRT11280x1024_1   = (SiS_LCDACRT1DataStruct *)SiS310_LCDACRT11280x1024_1;
    SiS_Pr->SiS_LCDACRT11400x1050_1   = (SiS_LCDACRT1DataStruct *)SiS310_LCDACRT11400x1050_1;
    SiS_Pr->SiS_LCDACRT11600x1200_1   = (SiS_LCDACRT1DataStruct *)SiS310_LCDACRT11600x1200_1;
-   SiS_Pr->SiS_LCDACRT1800x600_1_H   = (SiS_LCDACRT1DataStruct *)SiS310_LCDACRT1800x600_1_H;
    SiS_Pr->SiS_LCDACRT11024x768_1_H  = (SiS_LCDACRT1DataStruct *)SiS310_LCDACRT11024x768_1_H;
    SiS_Pr->SiS_LCDACRT11280x1024_1_H = (SiS_LCDACRT1DataStruct *)SiS310_LCDACRT11280x1024_1_H;
    SiS_Pr->SiS_LCDACRT11400x1050_1_H = (SiS_LCDACRT1DataStruct *)SiS310_LCDACRT11400x1050_1_H;
    SiS_Pr->SiS_LCDACRT11600x1200_1_H = (SiS_LCDACRT1DataStruct *)SiS310_LCDACRT11600x1200_1_H;
-   SiS_Pr->SiS_LCDACRT1800x600_2     = (SiS_LCDACRT1DataStruct *)SiS310_LCDACRT1800x600_2;
    SiS_Pr->SiS_LCDACRT11024x768_2    = (SiS_LCDACRT1DataStruct *)SiS310_LCDACRT11024x768_2;
    SiS_Pr->SiS_LCDACRT11280x1024_2   = (SiS_LCDACRT1DataStruct *)SiS310_LCDACRT11280x1024_2;
    SiS_Pr->SiS_LCDACRT11400x1050_2   = (SiS_LCDACRT1DataStruct *)SiS310_LCDACRT11400x1050_2;
    SiS_Pr->SiS_LCDACRT11600x1200_2   = (SiS_LCDACRT1DataStruct *)SiS310_LCDACRT11600x1200_2;
-   SiS_Pr->SiS_LCDACRT1800x600_2_H   = (SiS_LCDACRT1DataStruct *)SiS310_LCDACRT1800x600_2_H;
    SiS_Pr->SiS_LCDACRT11024x768_2_H  = (SiS_LCDACRT1DataStruct *)SiS310_LCDACRT11024x768_2_H;
    SiS_Pr->SiS_LCDACRT11280x1024_2_H = (SiS_LCDACRT1DataStruct *)SiS310_LCDACRT11280x1024_2_H;
    SiS_Pr->SiS_LCDACRT11400x1050_2_H = (SiS_LCDACRT1DataStruct *)SiS310_LCDACRT11400x1050_2_H;
    SiS_Pr->SiS_LCDACRT11600x1200_2_H = (SiS_LCDACRT1DataStruct *)SiS310_LCDACRT11600x1200_2_H;
+
    SiS_Pr->SiS_CHTVVCLKUNTSC = SiS310_CHTVVCLKUNTSC;
    SiS_Pr->SiS_CHTVVCLKONTSC = SiS310_CHTVVCLKONTSC;
    SiS_Pr->SiS_CHTVVCLKUPAL  = SiS310_CHTVVCLKUPAL;
@@ -648,7 +649,7 @@
    SiS_Pr->SiS_CHTVVCLKOPALM = SiS310_CHTVVCLKOPALM;
    SiS_Pr->SiS_CHTVVCLKUPALN = SiS310_CHTVVCLKUPALN;
    SiS_Pr->SiS_CHTVVCLKOPALN = SiS310_CHTVVCLKOPALN;   
-   SiS_Pr->SiS_CHTVVCLKSOPAL = SiS310_CHTVVCLKSOPAL;
+   SiS_Pr->SiS_CHTVVCLKSOPAL = SiS310_CHTVVCLKOPAL;
 
    SiS_Pr->SiS_Panel320x480   = Panel_320x480;
    SiS_Pr->SiS_Panel640x480   = Panel_640x480;
@@ -662,1245 +663,1122 @@
    SiS_Pr->SiS_Panel1152x864  = Panel_1152x864;
    SiS_Pr->SiS_Panel1280x768  = Panel_1280x768;
    SiS_Pr->SiS_Panel1024x600  = Panel_1024x600;
-   SiS_Pr->SiS_PanelMax       = Panel_320x480;    /* TW: highest value */
-   SiS_Pr->SiS_PanelMinLVDS   = Panel_800x600;    /* TW: lowest value LVDS/LCDA */
-   SiS_Pr->SiS_PanelMin301    = Panel_1024x768;   /* TW: lowest value 301 */
+   SiS_Pr->SiS_Panel640x480_2 = Panel_640x480_2;
+   SiS_Pr->SiS_Panel640x480_3 = Panel_640x480_3;
+   SiS_Pr->SiS_PanelMax       = Panel_320x480;    /* highest value */
+   SiS_Pr->SiS_PanelMinLVDS   = Panel_800x600;    /* lowest value LVDS/LCDA */
+   SiS_Pr->SiS_PanelMin301    = Panel_1024x768;   /* lowest value 301 */
+   SiS_Pr->SiS_PanelCustom    = Panel_Custom;
+   SiS_Pr->SiS_PanelBarco1366 = 255;
 }
 #endif
 
-#ifdef LINUXBIOS
-/* -------------- SiSInit -----------------*/
-/* TW: I degraded this for LINUXBIOS only, because we
- *     don't need this otherwise. Under normal
- *     circumstances, the video BIOS has initialized
- *     the adapter for us. BTW, this code is incomplete
- *     and very possibly not working on newer chipsets.
- */
-BOOLEAN
-SiSInit(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension)
+static void
+SiSInitPtr(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
 {
-   UCHAR  *ROMAddr  = HwDeviceExtension->pjVirtualRomBase;
-   ULONG   FBAddr   = (ULONG)HwDeviceExtension->pjVideoMemoryAddress;
-   USHORT  BaseAddr = (USHORT)HwDeviceExtension->ulIOAddress;
-   UCHAR   i, temp=0;
-   UCHAR   SR11;
-#ifdef LINUX_KERNEL
-   UCHAR   temp1;
-   ULONG   base;
-#endif
-   UCHAR   SR13=0, SR14=0, SR16=0
-   UCHAR   SR17=0, SR19=0, SR1A=0;
-#ifdef SIS300
-   UCHAR   SR18=0, SR12=0;
-#endif
-#ifdef SIS315H
-   UCHAR   CR37=0, CR38=0, CR79=0,
-   UCHAR   CR7A=0, CR7B=0, CR7C=0;
-   UCHAR   SR1B=0, SR15=0;
-   PSIS_DSReg pSR;
-   ULONG   Temp;
-#endif
-   UCHAR   VBIOSVersion[5];
-
-   if(FBAddr==0)    return (FALSE);
-   if(BaseAddr==0)  return (FALSE);
-
-   SiS_SetReg3((USHORT)(BaseAddr+0x12),  0x67);  /* Misc */
-
-#ifdef SIS315H
-   if(HwDeviceExtension->jChipType > SIS_315PRO) {
-     if(!HwDeviceExtension->bIntegratedMMEnabled)
-     	return (FALSE);
-   }
-#endif
-
-   SiS_MemoryCopy(VBIOSVersion,HwDeviceExtension->szVBIOSVer,4);
-   VBIOSVersion[4]= 0x00;
-
-   SiSDetermineROMUsage(SiS_Pr, HwDeviceExtension, ROMAddr);
-
-   /* TW: Init pointers */
-#ifdef SIS315H
-   if((HwDeviceExtension->jChipType == SIS_315H) ||
-      (HwDeviceExtension->jChipType == SIS_315) ||
-      (HwDeviceExtension->jChipType == SIS_315PRO) ||
-      (HwDeviceExtension->jChipType == SIS_550) ||
-      (HwDeviceExtension->jChipType == SIS_650) ||
-      (HwDeviceExtension->jChipType == SIS_740) ||
-      (HwDeviceExtension->jChipType == SIS_330))
-     InitTo310Pointer(SiS_Pr, HwDeviceExtension);
-#endif
-
-#ifdef SIS300
-   if((HwDeviceExtension->jChipType == SIS_540) ||
-      (HwDeviceExtension->jChipType == SIS_630) ||
-      (HwDeviceExtension->jChipType == SIS_730) ||
-      (HwDeviceExtension->jChipType == SIS_300))
-     InitTo300Pointer(SiS_Pr, HwDeviceExtension);
-#endif
-
-   /* TW: Set SiS Register definitions */
-   SiSRegInit(SiS_Pr, BaseAddr);
-
-   /* TW: Determine LVDS/CH70xx/TRUMPION */
-   SiS_Set_LVDS_TRUMPION(SiS_Pr, HwDeviceExtension);
-
-   /* TW: Unlock registers */
-   SiS_SetReg1(SiS_Pr->SiS_P3c4,0x05,0x86);
-
-#ifdef LINUX_KERNEL
-
-#ifdef SIS300                                         	/* Set SR14 */
-   if((HwDeviceExtension->jChipType==SIS_540) ||
-      (HwDeviceExtension->jChipType==SIS_630) ||
-      (HwDeviceExtension->jChipType==SIS_730)) {
-     base=0x80000060;
-     OutPortLong(base,0xcf8);
-     temp1 = InPortLong(0xcfc);
-     temp1 >>= (16+8+4);
-     temp1 &= 0x07;
-     temp1++;
-     temp1 = 1 << temp1;
-     SR14 = temp1 - 1;
-     base = 0x80000064;
-     OutPortLong(base,0xcf8);
-     temp1 = InPortLong(0xcfc);
-     temp1 &= 0x00000020;
-     if(temp1) 	SR14 |= 0x80;
-     else      	SR14 |= 0x40;
-   }
-#endif
-
-#ifdef SIS315H                                          /* Set SR14 */
-   if(HwDeviceExtension->jChipType == SIS_550) {
-     base = 0x80000060;
-     OutPortLong(base,0xcf8);
-     temp1 = InPortLong(0xcfc);
-     temp1 >>= (16+8+4);
-     temp1 &= 0x07;
-     temp1++;
-     temp1 = 1 << temp1;
-     SR14 = temp1 - 1;
-     base = 0x80000064;
-     OutPortLong(base,0xcf8);
-     temp1 = InPortLong(0xcfc);
-     temp1 &= 0x00000020;
-     if(temp1)  SR14 |= 0x80;
-     else       SR14 |= 0x40;
-   }
-
-   if((HwDeviceExtension->jChipType == SIS_740) ||     /* Set SR14 */
-      (HwDeviceExtension->jChipType == SIS_650))  {
-     base = 0x80000064;
-     OutPortLong(base,0xcf8);
-     temp1=InPortLong(0xcfc);
-     temp1 >>= 4;
-     temp1 &= 0x07;
-     if(temp1 > 2) {
-       temp = temp1;
-       switch(temp) {
-        case 3: temp1 = 0x07;  break;
-        case 4: temp1 = 0x0F;  break;
-        case 5: temp1 = 0x1F;  break;
-        case 6: temp1 = 0x05;  break;
-        case 7: temp1 = 0x17;  break;
-        case 8: break;
-        case 9: break;
-       }
-     }
-     SR14 = temp1;
-     base = 0x8000007C;
-     OutPortLong(base,0xcf8);
-     temp1 = InPortLong(0xcfc);
-     temp1 &= 0x00000020;
-     if(temp1)  SR14 |= 0x80;
-   }
-#endif
-
-#endif  /* Linux kernel */
-
-#ifdef SIS300
-   if((HwDeviceExtension->jChipType == SIS_540)||
-      (HwDeviceExtension->jChipType == SIS_630)||
-      (HwDeviceExtension->jChipType == SIS_730)) {
-     SR12 = (UCHAR)SiS_GetReg1(SiS_Pr->SiS_P3c4,0x12);
-     SR13 = (UCHAR)SiS_GetReg1(SiS_Pr->SiS_P3c4,0x13);
-     SR14 = (UCHAR)SiS_GetReg1(SiS_Pr->SiS_P3c4,0x14);
-     SR16 = (UCHAR)SiS_GetReg1(SiS_Pr->SiS_P3c4,0x16);
-     SR17 = (UCHAR)SiS_GetReg1(SiS_Pr->SiS_P3c4,0x17);
-     SR18 = (UCHAR)SiS_GetReg1(SiS_Pr->SiS_P3c4,0x18);
-     SR19 = (UCHAR)SiS_GetReg1(SiS_Pr->SiS_P3c4,0x19);
-     SR1A = (UCHAR)SiS_GetReg1(SiS_Pr->SiS_P3c4,0x1A);
-   } else if(HwDeviceExtension->jChipType == SIS_300){
-     SR13 = (UCHAR)SiS_GetReg1(SiS_Pr->SiS_P3c4,0x13);
-     SR14 = (UCHAR)SiS_GetReg1(SiS_Pr->SiS_P3c4,0x14);
-   }
-#endif
+   switch(HwInfo->jChipType) {
 #ifdef SIS315H
-   if((HwDeviceExtension->jChipType == SIS_550) ||
-      (HwDeviceExtension->jChipType == SIS_740) ||
-      (HwDeviceExtension->jChipType == SIS_650)) {
-     SR19 = (UCHAR)SiS_GetReg1(SiS_Pr->SiS_P3c4,0x19);
-     SR19 = (SR19)||0x01;  /* TW: ??? || ??? */
-     if(SR19==0x00) {
-     	SR13 = 0x22;
-     	SR14 = 0x00;
-    	SR15 = 0x01;
-     	SR16 = 0x00;
-     	SR17 = 0x00;
-     	SR1A = 0x00;
-     	SR1B = 0x00;
-     	CR37 = 0x00;
-     	CR38 = 0x00;
-     	CR79 = 0x00;
-     	CR7A = 0x00;
-     	CR7B = 0x00;
-     	CR7C = 0x00;
-     } else {
-     	SR13 = (UCHAR)SiS_GetReg1(SiS_Pr->SiS_P3c4,0x13);
-     	SR14 = (UCHAR)SiS_GetReg1(SiS_Pr->SiS_P3c4,0x14);
-     	SR15 = (UCHAR)SiS_GetReg1(SiS_Pr->SiS_P3c4,0x15);
-     	SR16 = (UCHAR)SiS_GetReg1(SiS_Pr->SiS_P3c4,0x16);
-     	SR17 = (UCHAR)SiS_GetReg1(SiS_Pr->SiS_P3c4,0x17);
-     	SR1A = (UCHAR)SiS_GetReg1(SiS_Pr->SiS_P3c4,0x1A);
-     	SR1B = (UCHAR)SiS_GetReg1(SiS_Pr->SiS_P3c4,0x1B);
-     	CR37 = (UCHAR)SiS_GetReg1(SiS_Pr->SiS_P3d4,0x37);  /* TW: Was 0x02 - why? */
-     	CR38 = (UCHAR)SiS_GetReg1(SiS_Pr->SiS_P3d4,0x38);
-     	CR79 = (UCHAR)SiS_GetReg1(SiS_Pr->SiS_P3d4,0x79);
-     	CR7A = (UCHAR)SiS_GetReg1(SiS_Pr->SiS_P3d4,0x7A);
-     	CR7B = (UCHAR)SiS_GetReg1(SiS_Pr->SiS_P3d4,0x7B);
-     	CR7C = (UCHAR)SiS_GetReg1(SiS_Pr->SiS_P3d4,0x7C);
-     }
-   }
+   case SIS_315H:
+   case SIS_315:
+   case SIS_315PRO:
+   case SIS_550:
+   case SIS_650:
+   case SIS_740:
+   case SIS_330:
+   case SIS_661:
+   case SIS_741:
+   case SIS_660:
+   case SIS_760:
+      InitTo310Pointer(SiS_Pr, HwInfo);
+      break;
 #endif
-
-   /* Reset extended registers */
-
-   for(i=0x06; i< 0x20; i++) SiS_SetReg1(SiS_Pr->SiS_P3c4,i,0);
-   for(i=0x21; i<=0x27; i++) SiS_SetReg1(SiS_Pr->SiS_P3c4,i,0);
-   for(i=0x31; i<=0x3D; i++) SiS_SetReg1(SiS_Pr->SiS_P3c4,i,0);
-
 #ifdef SIS300
-   if((HwDeviceExtension->jChipType == SIS_540) ||
-      (HwDeviceExtension->jChipType == SIS_630) ||
-      (HwDeviceExtension->jChipType == SIS_730) ||
-      (HwDeviceExtension->jChipType == SIS_300)) {
-     	for(i=0x38; i<=0x3F; i++) SiS_SetReg1(SiS_Pr->SiS_P3d4,i,0);
-   }
+   case SIS_300:
+   case SIS_540:
+   case SIS_630:
+   case SIS_730:
+      InitTo300Pointer(SiS_Pr, HwInfo);
+      break;
 #endif
-
-#ifdef SIS315H
-   if((HwDeviceExtension->jChipType == SIS_315H) ||
-      (HwDeviceExtension->jChipType == SIS_315) ||
-      (HwDeviceExtension->jChipType == SIS_315PRO) ||
-      (HwDeviceExtension->jChipType == SIS_550) ||
-      (HwDeviceExtension->jChipType == SIS_650) ||
-      (HwDeviceExtension->jChipType == SIS_740) ||
-      (HwDeviceExtension->jChipType == SIS_330)) {
-   	for(i=0x12; i<=0x1B; i++) SiS_SetReg1(SiS_Pr->SiS_P3c4,i,0);
-   	for(i=0x79; i<=0x7C; i++) SiS_SetReg1(SiS_Pr->SiS_P3d4,i,0);
+   default:
+      break;
    }
-#endif
-
-   /* Restore Extended Registers */
+}
 
-#ifdef SIS300
-   if((HwDeviceExtension->jChipType == SIS_540) ||
-      (HwDeviceExtension->jChipType == SIS_630) ||
-      (HwDeviceExtension->jChipType == SIS_730)) {
-     SiS_SetReg1(SiS_Pr->SiS_P3c4,0x12,SR12);
-     SiS_SetReg1(SiS_Pr->SiS_P3c4,0x13,SR13);
-     SiS_SetReg1(SiS_Pr->SiS_P3c4,0x14,SR14);
-     SiS_SetReg1(SiS_Pr->SiS_P3c4,0x16,SR16);
-     SiS_SetReg1(SiS_Pr->SiS_P3c4,0x17,SR17);
-     SiS_SetReg1(SiS_Pr->SiS_P3c4,0x18,SR18);
-     SiS_SetReg1(SiS_Pr->SiS_P3c4,0x19,SR19);
-     SiS_SetReg1(SiS_Pr->SiS_P3c4,0x1A,SR1A);
-   }
-#endif
+/*********************************************/
+/*            HELPER: Get ModeID             */
+/*********************************************/
 
-#ifdef SIS315H
-   if((HwDeviceExtension->jChipType == SIS_550) ||
-      (HwDeviceExtension->jChipType == SIS_740) ||
-      (HwDeviceExtension->jChipType == SIS_650)) {
-     SiS_SetReg1(SiS_Pr->SiS_P3c4,0x13,SR13);
-     SiS_SetReg1(SiS_Pr->SiS_P3c4,0x14,SR14);
-     SiS_SetReg1(SiS_Pr->SiS_P3c4,0x15,SR15);
-     SiS_SetReg1(SiS_Pr->SiS_P3c4,0x16,SR16);
-     SiS_SetReg1(SiS_Pr->SiS_P3c4,0x17,SR17);
-     SiS_SetReg1(SiS_Pr->SiS_P3c4,0x19,SR19);
-     SiS_SetReg1(SiS_Pr->SiS_P3c4,0x1A,SR1A);
-     SiS_SetReg1(SiS_Pr->SiS_P3c4,0x1B,SR1B);
-     SiS_SetReg1(SiS_Pr->SiS_P3d4,0x37,CR37);
-     SiS_SetReg1(SiS_Pr->SiS_P3d4,0x38,CR38);
-     SiS_SetReg1(SiS_Pr->SiS_P3d4,0x79,CR79);
-     SiS_SetReg1(SiS_Pr->SiS_P3d4,0x7A,CR7A);
-     SiS_SetReg1(SiS_Pr->SiS_P3d4,0x7B,CR7B);
-     SiS_SetReg1(SiS_Pr->SiS_P3d4,0x7C,CR7C);
-   }
-#endif
+USHORT
+SiS_GetModeID(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay, int Depth, BOOLEAN FSTN)
+{
+   USHORT ModeIndex = 0;
 
-#ifdef SIS300
-   if((HwDeviceExtension->jChipType==SIS_540) ||
-      (HwDeviceExtension->jChipType==SIS_630) ||
-      (HwDeviceExtension->jChipType==SIS_730)) {
-     	temp = (UCHAR)SR1A & 0x03;
-   } else if(HwDeviceExtension->jChipType == SIS_300) {
-        /* TW: Nothing */
-   }
-#endif
-#ifdef SIS315H
-   if((HwDeviceExtension->jChipType == SIS_315H)   ||
-      (HwDeviceExtension->jChipType == SIS_315)    ||
-      (HwDeviceExtension->jChipType == SIS_315PRO) ||
-      (HwDeviceExtension->jChipType == SIS_330) ) {
-      	if((*SiS_Pr->pSiS_SoftSetting & SoftDRAMType) == 0) {
-          	temp = (UCHAR)SiS_GetReg1(SiS_Pr->SiS_P3c4,0x3A) & 0x03;
-        }
-   }
-   if((HwDeviceExtension->jChipType == SIS_550) ||
-      (HwDeviceExtension->jChipType == SIS_740) ||
-      (HwDeviceExtension->jChipType == SIS_650)) {
-        if((*SiS_Pr->pSiS_SoftSetting & SoftDRAMType) == 0) {
-          	temp = (UCHAR)SiS_GetReg1(SiS_Pr->SiS_P3c4,0x13) & 0x07;
-        }
+   switch(HDisplay)
+   {
+     case 320:
+     	  if(VDisplay == 200)     ModeIndex = ModeIndex_320x200[Depth];
+	  else if(VDisplay == 240) {
+	     if(FSTN) ModeIndex = ModeIndex_320x240_FSTN[Depth];
+	     else     ModeIndex = ModeIndex_320x240[Depth];
+          }
+          break;
+     case 400:
+          if(VDisplay == 300) ModeIndex = ModeIndex_400x300[Depth];
+          break;
+     case 512:
+          if(VDisplay == 384) ModeIndex = ModeIndex_512x384[Depth];
+          break;
+     case 640:
+          if(VDisplay == 480)      ModeIndex = ModeIndex_640x480[Depth];
+	  else if(VDisplay == 400) ModeIndex = ModeIndex_640x400[Depth];
+          break;
+     case 720:
+          if(!(VBFlags & CRT1_LCDA)) {
+             if(VDisplay == 480)      ModeIndex = ModeIndex_720x480[Depth];
+             else if(VDisplay == 576) ModeIndex = ModeIndex_720x576[Depth];
+          }
+          break;
+     case 768:
+          if(!(VBFlags & CRT1_LCDA)) {
+             if(VDisplay == 576) ModeIndex = ModeIndex_768x576[Depth];
+          }
+	  break;
+     case 800:
+	  if(VDisplay == 600)    ModeIndex = ModeIndex_800x600[Depth];
+	  else if(!(VBFlags & CRT1_LCDA)) {
+	     if(VDisplay == 480) ModeIndex = ModeIndex_800x480[Depth];
+	  }
+          break;
+     case 848:
+          if(!(VBFlags & CRT1_LCDA)) {
+	     if(VDisplay == 480) ModeIndex = ModeIndex_848x480[Depth];
+	  }
+	  break;
+     case 856:
+          if(!(VBFlags & CRT1_LCDA)) {
+	     if(VDisplay == 480) ModeIndex = ModeIndex_856x480[Depth];
+	  }
+	  break;
+     case 1024:
+          if(VDisplay == 768) ModeIndex = ModeIndex_1024x768[Depth];
+	  else if(!(VBFlags & CRT1_LCDA)) {
+	     if(VDisplay == 576)    ModeIndex = ModeIndex_1024x576[Depth];
+	     else if(VGAEngine == SIS_300_VGA) {
+	        if(VDisplay == 600) ModeIndex = ModeIndex_1024x600[Depth];
+             }
+	  }
+          break;
+     case 1152:
+          if(!(VBFlags & CRT1_LCDA)) {
+             if(VDisplay == 864)    ModeIndex = ModeIndex_1152x864[Depth];
+             else if(VGAEngine == SIS_300_VGA) {
+	        if(VDisplay == 768) ModeIndex = ModeIndex_1152x768[Depth];
+             }
+	  }
+	  break;
+     case 1280:
+          if(VDisplay == 1024)        ModeIndex = ModeIndex_1280x1024[Depth];
+	  else if(!(VBFlags & CRT1_LCDA)) {
+             if(VDisplay == 960)      ModeIndex = ModeIndex_1280x960[Depth];
+	     else if(VDisplay == 720) ModeIndex = ModeIndex_1280x720[Depth];
+	     else if(VDisplay == 768) {
+	        if(VGAEngine == SIS_300_VGA) {
+	           ModeIndex = ModeIndex_300_1280x768[Depth];
+	        } else {
+	           ModeIndex = ModeIndex_310_1280x768[Depth];
+	        }
+	     }
+	  }
+          break;
+     case 1360:
+          if(!(VBFlags & CRT1_LCDA)) {
+	     if(VDisplay == 768)     ModeIndex = ModeIndex_1360x768[Depth];
+	     else if(VGAEngine == SIS_300_VGA) {
+	        if(VDisplay == 1024) ModeIndex = ModeIndex_300_1360x1024[Depth];
+             }
+	  }
+          break;
+     case 1400:
+          if(VGAEngine == SIS_315_VGA) {
+	     if(VDisplay == 1050) ModeIndex = ModeIndex_1400x1050[Depth];
+	  }
+          break;
+     case 1600:
+          if(VDisplay == 1200) ModeIndex = ModeIndex_1600x1200[Depth];
+          break;
+     case 1920:
+          if(!(VBFlags & CRT1_LCDA)) {
+             if(VDisplay == 1440) ModeIndex = ModeIndex_1920x1440[Depth];
+	  }
+          break;
+     case 2048:
+          if(!(VBFlags & CRT1_LCDA)) {
+             if(VDisplay == 1536) {
+                if(VGAEngine == SIS_300_VGA) {
+	            ModeIndex = ModeIndex_300_2048x1536[Depth];
+  	        } else {
+	            ModeIndex = ModeIndex_310_2048x1536[Depth];
+                }
+	     }
+	  }
+          break;
    }
-#endif
-
-   SiS_Pr->SiS_RAMType = temp;
-   SiS_SetMemoryClock(SiS_Pr, ROMAddr, HwDeviceExtension);
-
-   /* Set default register contents */
 
-   SiS_SetReg1(SiS_Pr->SiS_P3c4,0x07,*SiS_Pr->pSiS_SR07); 		/* DAC speed */
-
-   if((HwDeviceExtension->jChipType != SIS_540) &&
-      (HwDeviceExtension->jChipType != SIS_630) &&
-      (HwDeviceExtension->jChipType != SIS_730)){
-     	for(i=0x15;i<0x1C;i++) {
-       	    SiS_SetReg1(SiS_Pr->SiS_P3c4,i,SiS_Pr->SiS_SR15[i-0x15][SiS_Pr->SiS_RAMType]);
-     	}
-   }
+   return(ModeIndex);
+}
 
-#ifdef SIS315H
-   if((HwDeviceExtension->jChipType == SIS_315H) ||
-      (HwDeviceExtension->jChipType == SIS_315)  ||
-      (HwDeviceExtension->jChipType == SIS_315PRO) ||
-      (HwDeviceExtension->jChipType == SIS_330)) {
-     	for(i=0x40;i<=0x44;i++) {
-       	    SiS_SetReg1(SiS_Pr->SiS_P3d4,i,SiS_Pr->SiS_CR40[i-0x40][SiS_Pr->SiS_RAMType]);
-     	}
-     	SiS_SetReg1(SiS_Pr->SiS_P3d4,0x48,0x23);
-     	SiS_SetReg1(SiS_Pr->SiS_P3d4,0x49,SiS_Pr->SiS_CR49[0]);
-    /*  SiS_SetReg1(SiS_Pr->SiS_P3c4,0x25,SiS_Pr->SiS_SR25[0]);  */
-   }
-#endif
+USHORT
+SiS_GetModeID_LCD(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay,
+                  int Depth, BOOLEAN FSTN, USHORT CustomT, int LCDwidth, int LCDheight)
+{
+   USHORT ModeIndex = 0;
 
-   SiS_SetReg1(SiS_Pr->SiS_P3c4,0x1F,*SiS_Pr->pSiS_SR1F); 	/* DAC pedestal */
-   SiS_SetReg1(SiS_Pr->SiS_P3c4,0x20,0xA0);
-   SiS_SetReg1(SiS_Pr->SiS_P3c4,0x23,*SiS_Pr->pSiS_SR23);
-   SiS_SetReg1(SiS_Pr->SiS_P3c4,0x24,*SiS_Pr->pSiS_SR24);
-   SiS_SetReg1(SiS_Pr->SiS_P3c4,0x25,SiS_Pr->SiS_SR25[0]);
+   if(VBFlags & (VB_LVDS | VB_30xBDH)) {
 
-#ifdef SIS300
-   if(HwDeviceExtension->jChipType == SIS_300) {
-     	SiS_SetReg1(SiS_Pr->SiS_P3c4,0x21,0x84);
-     	SiS_SetReg1(SiS_Pr->SiS_P3c4,0x22,0x00);
+      switch(HDisplay)
+      {
+	case 320:
+	     if(CustomT != CUT_PANEL848) {
+     	  	if(VDisplay == 200) ModeIndex = ModeIndex_320x200[Depth];
+	  	else if(VDisplay == 240) {
+		   if(!FSTN) ModeIndex = ModeIndex_320x240[Depth];
+          	   else if(VGAEngine == SIS_315_VGA) {
+                      ModeIndex = ModeIndex_320x240_FSTN[Depth];
+		   }
+		}
+	     }
+             break;
+     	case 400:
+	     if(CustomT != CUT_PANEL848) {
+          	if(VDisplay == 300) ModeIndex = ModeIndex_400x300[Depth];
+	     }
+             break;
+	case 512:
+	     if(CustomT != CUT_PANEL848) {
+		if(VDisplay == 384) {
+		   if(LCDwidth != 1024 || LCDheight != 600) {
+		      ModeIndex = ModeIndex_512x384[Depth];
+		   }
+		}
+	     }
+	     break;
+	case 640:
+	     if(VDisplay == 480)            ModeIndex = ModeIndex_640x480[Depth];
+	     else if(VDisplay == 400) {
+	        if(CustomT != CUT_PANEL848) ModeIndex = ModeIndex_640x400[Depth];
+	     }
+	     break;
+	case 800:
+	     if(VDisplay == 600) ModeIndex = ModeIndex_800x600[Depth];
+	     break;
+	case 848:
+	     if(CustomT == CUT_PANEL848) {
+	        if(VDisplay == 480) ModeIndex = ModeIndex_848x480[Depth];
+	     }
+	     break;
+	case 1024:
+	     if(VDisplay == 768) ModeIndex = ModeIndex_1024x768[Depth];
+	     else if(VGAEngine == SIS_300_VGA) {
+		if((VDisplay == 600) && (LCDheight == 600)) {
+		   ModeIndex = ModeIndex_1024x600[Depth];
+		}
+	     }
+	     break;
+	case 1152:
+	     if(VGAEngine == SIS_300_VGA) {
+	        if((VDisplay == 768) && (LCDheight == 768)) {
+		   ModeIndex = ModeIndex_1152x768[Depth];
+		}
+	     }
+	     break;
+        case 1280:
+	     if(VDisplay == 1024) ModeIndex = ModeIndex_1280x1024[Depth];
+	     else if(VGAEngine == SIS_315_VGA) {
+	        if((VDisplay == 768) && (LCDheight == 768)) {
+		   ModeIndex = ModeIndex_310_1280x768[Depth];
+		}
+	     }
+	     break;
+	case 1360:
+	     if(VGAEngine == SIS_300_VGA) {
+	        if(CustomT == CUT_BARCO1366) {
+		   if(VDisplay == 1024) ModeIndex = ModeIndex_300_1360x1024[Depth];
+		}
+	     }
+	     if(CustomT == CUT_PANEL848) {
+	        if(VDisplay == 768) ModeIndex = ModeIndex_1360x768[Depth];
+	     }
+	     break;
+	case 1400:
+	     if(VGAEngine == SIS_315_VGA) {
+	        if(VDisplay == 1050) ModeIndex = ModeIndex_1400x1050[Depth];
+	     }
+	     break;
+	case 1600:
+	     if(VGAEngine == SIS_315_VGA) {
+	        if(VDisplay == 1200) ModeIndex = ModeIndex_1600x1200[Depth];
+	     }
+	     break;
+      }
+
+   } else if(VBFlags & VB_SISBRIDGE) {
+
+      switch(HDisplay)
+      {
+	case 320:
+     	     if(VDisplay == 200)      ModeIndex = ModeIndex_320x200[Depth];
+	     else if(VDisplay == 240) ModeIndex = ModeIndex_320x240[Depth];
+             break;
+     	case 400:
+             if(VDisplay == 300) ModeIndex = ModeIndex_400x300[Depth];
+             break;
+	case 512:
+	     if(VDisplay == 384) ModeIndex = ModeIndex_512x384[Depth];
+	     break;
+	case 640:
+	     if(VDisplay == 480)      ModeIndex = ModeIndex_640x480[Depth];
+	     else if(VDisplay == 400) ModeIndex = ModeIndex_640x400[Depth];
+	     break;
+	case 800:
+	     if(VDisplay == 600) ModeIndex = ModeIndex_800x600[Depth];
+	     break;
+	case 1024:
+	     if(VDisplay == 768) ModeIndex = ModeIndex_1024x768[Depth];
+	     break;
+	case 1280:
+	     if(VDisplay == 1024) ModeIndex = ModeIndex_1280x1024[Depth];
+	     else if(VDisplay == 768) {
+		if((LCDheight == 768) ||
+		   ((LCDheight == 1024) && (VBFlags & (VB_301|VB_301B|VB_301C|VB_302B)))) {
+		   if(VGAEngine == SIS_300_VGA) {
+		      ModeIndex = ModeIndex_300_1280x768[Depth];
+		   } else {
+		      ModeIndex = ModeIndex_310_1280x768[Depth];
+		   }
+		}
+	     } else if(VDisplay == 960) {
+	        if((LCDheight == 960) ||
+		   ((LCDheight == 1024) && (VBFlags & (VB_301|VB_301B|VB_301C|VB_302B)))) {
+		   ModeIndex = ModeIndex_1280x960[Depth];
+		}
+	     }
+	     break;
+	case 1400:
+	     if(VGAEngine == SIS_315_VGA) {
+	        if(VBFlags & (VB_301B | VB_301C | VB_302B | VB_302LV | VB_302ELV)) {
+		   if(LCDheight != 1200) {
+	              if(VDisplay == 1050) ModeIndex = ModeIndex_1400x1050[Depth];
+		   }
+		}
+	     }
+	     break;
+	case 1600:
+	     if(VBFlags & (VB_301C | VB_302B | VB_302LV | VB_302ELV)) {
+	        if(VDisplay == 1200) ModeIndex = ModeIndex_1600x1200[Depth];
+	     }
+	     break;
+      }
    }
-#endif
 
-   SR11 = 0x0F;
-   SiS_SetReg1(SiS_Pr->SiS_P3c4,0x11,SR11);		/* Power Management & DDC port */
-
-   SiS_UnLockCRT2(SiS_Pr, HwDeviceExtension, BaseAddr);
-   SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x00,0x00);
-   SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x02,*SiS_Pr->pSiS_CRT2Data_1_2);
-
-#ifdef SIS315H
-   if((HwDeviceExtension->jChipType == SIS_315H) ||
-      (HwDeviceExtension->jChipType == SIS_315) ||
-      (HwDeviceExtension->jChipType == SIS_315PRO) ||
-      (HwDeviceExtension->jChipType == SIS_550) ||
-      (HwDeviceExtension->jChipType == SIS_650) ||
-      (HwDeviceExtension->jChipType == SIS_740) ||
-      (HwDeviceExtension->jChipType == SIS_330))
-     	SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x2E,0x08);    /* use VB */
-#endif
+   return ModeIndex;
+}
 
-   temp = *SiS_Pr->pSiS_SR32;
-   if(SiS_BridgeIsOn(SiS_Pr, BaseAddr)) {
-     	temp &= 0xEF;
-   }
-   SiS_SetReg1(SiS_Pr->SiS_P3c4,0x32,temp);
+USHORT
+SiS_GetModeID_TV(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay, int Depth)
+{
+   USHORT ModeIndex = 0;
 
-#ifdef SIS315H
-   if((HwDeviceExtension->jChipType == SIS_315H)   ||
-      (HwDeviceExtension->jChipType == SIS_315)    ||
-      (HwDeviceExtension->jChipType == SIS_315PRO) ||
-      (HwDeviceExtension->jChipType == SIS_330)) {
-     HwDeviceExtension->pQueryVGAConfigSpace(HwDeviceExtension,0x50,0,&Temp);
-     Temp >>= 20;
-     Temp &= 0xF;
-     if (Temp != 1) {
-     	SiS_SetReg1(SiS_Pr->SiS_P3c4,0x25,SiS_Pr->SiS_SR25[1]);
-     	SiS_SetReg1(SiS_Pr->SiS_P3d4,0x49,SiS_Pr->SiS_CR49[1]);
-     }
-
-     SiS_SetReg1(SiS_Pr->SiS_P3c4,0x27,0x1F);
-
-     SiS_SetReg1(SiS_Pr->SiS_P3c4,0x31,*SiS_Pr->pSiS_SR31);
-     SiS_SetReg1(SiS_Pr->SiS_P3c4,0x32,*SiS_Pr->pSiS_SR32);
-     SiS_SetReg1(SiS_Pr->SiS_P3c4,0x33,*SiS_Pr->pSiS_SR33);
-   }
-#endif
+   if(VBFlags & VB_CHRONTEL) {
 
-   if (SiS_BridgeIsOn(SiS_Pr, BaseAddr) == 0) {
-     	if(SiS_Pr->SiS_IF_DEF_LVDS == 0) {
-       		SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x00,0x1C);
-       		SiS_SetReg1(SiS_Pr->SiS_Part4Port,0x0D,*SiS_Pr->pSiS_CRT2Data_4_D);
-       		SiS_SetReg1(SiS_Pr->SiS_Part4Port,0x0E,*SiS_Pr->pSiS_CRT2Data_4_E);
-       		SiS_SetReg1(SiS_Pr->SiS_Part4Port,0x10,*SiS_Pr->pSiS_CRT2Data_4_10);
-       		SiS_SetReg1(SiS_Pr->SiS_Part4Port,0x0F,0x3F);
-     	}
-     	SiS_LockCRT2(SiS_Pr, HwDeviceExtension, BaseAddr);
+      switch(HDisplay)
+      {
+      	case 512:
+	     if(VGAEngine == SIS_315_VGA) {
+		if(VDisplay == 384) ModeIndex = ModeIndex_512x384[Depth];
+	     }
+	     break;
+	case 640:
+	     if(VDisplay == 480)      ModeIndex = ModeIndex_640x480[Depth];
+	     else if(VDisplay == 400) ModeIndex = ModeIndex_640x400[Depth];
+	     break;
+	case 800:
+	     if(VDisplay == 600) ModeIndex = ModeIndex_800x600[Depth];
+	     break;
+	case 1024:
+	     if(VGAEngine == SIS_315_VGA) {
+	        if(VDisplay == 768) ModeIndex = ModeIndex_1024x768[Depth];
+	     }
+	     break;
+      }
+
+   } else if(VBFlags & VB_SISTVBRIDGE) {
+
+      switch(HDisplay)
+      {
+	case 320:
+     	     if(VDisplay == 200)      ModeIndex = ModeIndex_320x200[Depth];
+	     else if(VDisplay == 240) ModeIndex = ModeIndex_320x240[Depth];
+             break;
+        case 400:
+             if(VDisplay == 300) ModeIndex = ModeIndex_400x300[Depth];
+             break;
+      	case 512:
+	     if( ((VBFlags & TV_YPBPR) && (VBFlags & (TV_YPBPR525P | TV_YPBPR750P | TV_YPBPR1080I))) ||
+	         (VBFlags & TV_HIVISION) 					    		     ||
+	         ((!(VBFlags & (TV_YPBPR | TV_PALM))) && (VBFlags & TV_PAL)) ) {
+	        if(VDisplay == 384) ModeIndex = ModeIndex_512x384[Depth];
+	     }
+	     break;
+	case 640:
+	     if(VDisplay == 480)      ModeIndex = ModeIndex_640x480[Depth];
+	     else if(VDisplay == 400) ModeIndex = ModeIndex_640x400[Depth];
+	     break;
+	case 720:
+	     if((!(VBFlags & TV_HIVISION)) && (!((VBFlags & TV_YPBPR) && (VBFlags & TV_YPBPR1080I)))) {
+                if(VDisplay == 480) {
+		   if((VBFlags & TV_YPBPR) || (VBFlags & (TV_NTSC | TV_PALM)))
+                      ModeIndex = ModeIndex_720x480[Depth];
+                } else if(VDisplay == 576) {
+		   if((!(VBFlags & (TV_YPBPR | TV_PALM))) && (VBFlags & TV_PAL))
+                      ModeIndex = ModeIndex_720x576[Depth];
+                }
+	     }
+             break;
+	case 768:
+	     if((!(VBFlags & TV_HIVISION)) && (!((VBFlags & TV_YPBPR) && (VBFlags & TV_YPBPR1080I)))) {
+	        if((!(VBFlags & (TV_YPBPR | TV_PALM))) && (VBFlags & TV_PAL)) {
+          	   if(VDisplay == 576) ModeIndex = ModeIndex_768x576[Depth];
+		}
+             }
+	     break;
+	case 800:
+	     if(VDisplay == 600) ModeIndex = ModeIndex_800x600[Depth];
+	     else if(VDisplay == 480) {
+	        if((VBFlags & TV_HIVISION) || ((VBFlags & TV_YPBPR) && (VBFlags & TV_YPBPR1080I))) {
+		   ModeIndex = ModeIndex_800x480[Depth];
+		}
+	     }
+	     break;
+	case 1024:
+	     if(VDisplay == 768) {
+		if(VBFlags & (VB_301B|VB_301C|VB_302B|VB_301LV|VB_302LV|VB_302ELV)) {
+		   ModeIndex = ModeIndex_1024x768[Depth];
+		}
+	     } else if(VDisplay == 576) {
+	        if((VBFlags & TV_HIVISION) || ((VBFlags & TV_YPBPR) && (VBFlags & TV_YPBPR1080I))) {
+		   ModeIndex = ModeIndex_1024x576[Depth];
+		}
+	     }
+	     break;
+	case 1280:
+	     if((VBFlags & TV_HIVISION) || ((VBFlags & TV_YPBPR) && (VBFlags & TV_YPBPR1080I))) {
+	        if(VDisplay == 720)       ModeIndex = ModeIndex_1280x720[Depth];
+		else if(VDisplay == 1024) ModeIndex = ModeIndex_1280x1024[Depth];
+	     }
+	     break;
+      }
    }
-   SiS_SetReg1(SiS_Pr->SiS_P3d4,0x83,0x00);
+   return ModeIndex;
+}
 
-#ifdef SIS315H
-   if((HwDeviceExtension->jChipType == SIS_315H)   ||
-      (HwDeviceExtension->jChipType == SIS_315)    ||
-      (HwDeviceExtension->jChipType == SIS_315PRO) ||
-      (HwDeviceExtension->jChipType == SIS_330)) {
-       	if(HwDeviceExtension->bSkipDramSizing==TRUE) {
-         	SiS_SetDRAMModeRegister(SiS_Pr, ROMAddr,HwDeviceExtension);
-         	pSR = HwDeviceExtension->pSR;
-         	if(pSR != NULL) {
-           		while(pSR->jIdx != 0xFF) {
-             			SiS_SetReg1(SiS_Pr->SiS_P3c4,pSR->jIdx,pSR->jVal);
-             			pSR++;
-           		}
-         	}
-       } else SiS_SetDRAMSize_310(SiS_Pr, HwDeviceExtension);
-   }
-#endif
+USHORT
+SiS_GetModeID_VGA2(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay, int Depth)
+{
+   USHORT ModeIndex = 0;
 
-#ifdef SIS315H
-   if(HwDeviceExtension->jChipType == SIS_550) {
-       /* SetDRAMConfig begin */
-/*     SiS_SetReg1(SiS_Pr->SiS_P3c4,0x12,SR12);
-       SiS_SetReg1(SiS_Pr->SiS_P3c4,0x13,SR13);
-       SiS_SetReg1(SiS_Pr->SiS_P3c4,0x14,SR14);
-       SiS_SetReg1(SiS_Pr->SiS_P3c4,0x16,SR16);
-       SiS_SetReg1(SiS_Pr->SiS_P3c4,0x17,SR17);
-       SiS_SetReg1(SiS_Pr->SiS_P3c4,0x18,SR18);
-       SiS_SetReg1(SiS_Pr->SiS_P3c4,0x19,SR19);
-       SiS_SetReg1(SiS_Pr->SiS_P3c4,0x1A,SR1A);   */
-       /* SetDRAMConfig end */
-   }
-#endif
+   if(!(VBFlags & (VB_301|VB_301B|VB_301C|VB_302B))) return 0;
 
-#ifdef SIS300
-   if(HwDeviceExtension->jChipType == SIS_300) {
-       	if (HwDeviceExtension->bSkipDramSizing == TRUE) {
-/*       	SiS_SetDRAMModeRegister(ROMAddr,HwDeviceExtension);
-         	temp = (HwDeviceExtension->pSR)->jVal;
-         	SiS_SetReg1(SiS_Pr->SiS_P3c4,0x13,temp);
-         	temp = (HwDeviceExtension->pSR)->jVal;
-         	SiS_SetReg1(SiS_Pr->SiS_P3c4,0x14,temp);   */
-       } else {
-#ifdef TC
-         	SiS_SetReg1(SiS_Pr->SiS_P3c4,0x13,SR13);
-         	SiS_SetReg1(SiS_Pr->SiS_P3c4,0x14,SR14);
-         	SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x15,0xFF,0x04);
-#else
-         	SiS_SetDRAMSize_300(SiS_Pr, HwDeviceExtension);
-         	SiS_SetDRAMSize_300(SiS_Pr, HwDeviceExtension);
-#endif
-       }
-   }
-   if((HwDeviceExtension->jChipType==SIS_540)||
-      (HwDeviceExtension->jChipType==SIS_630)||
-      (HwDeviceExtension->jChipType==SIS_730)) {
-#if 0
-     	SiS_SetReg1(SiS_Pr->SiS_P3c4,0x12,SR12);
-       	SiS_SetReg1(SiS_Pr->SiS_P3c4,0x13,SR13);
-       	SiS_SetReg1(SiS_Pr->SiS_P3c4,0x14,SR14);
-       	SiS_SetReg1(SiS_Pr->SiS_P3c4,0x16,SR16);
-       	SiS_SetReg1(SiS_Pr->SiS_P3c4,0x17,SR17);
-       	SiS_SetReg1(SiS_Pr->SiS_P3c4,0x18,SR18);
-       	SiS_SetReg1(SiS_Pr->SiS_P3c4,0x19,SR19);
-       	SiS_SetReg1(SiS_Pr->SiS_P3c4,0x1A,SR1A);
-#endif
+   switch(HDisplay)
+   {
+	case 320:
+     	  	if(VDisplay == 200)      ModeIndex = ModeIndex_320x200[Depth];
+	  	else if(VDisplay == 240) ModeIndex = ModeIndex_320x240[Depth];
+          	break;
+     	case 400:
+          	if(VDisplay == 300) ModeIndex = ModeIndex_400x300[Depth];
+          	break;
+  	case 512:
+		if(VDisplay == 384) ModeIndex = ModeIndex_512x384[Depth];
+		break;
+	case 640:
+		if(VDisplay == 480)      ModeIndex = ModeIndex_640x480[Depth];
+		else if(VDisplay == 400) ModeIndex = ModeIndex_640x400[Depth];
+		break;
+	case 720:
+		if(VDisplay == 480)      ModeIndex = ModeIndex_720x480[Depth];
+		else if(VDisplay == 576) ModeIndex = ModeIndex_720x576[Depth];
+		break;
+	case 768:
+          	if(VDisplay == 576) ModeIndex = ModeIndex_768x576[Depth];
+	  	break;
+	case 800:
+		if(VDisplay == 600)      ModeIndex = ModeIndex_800x600[Depth];
+   	        else if(VDisplay == 480) ModeIndex = ModeIndex_800x480[Depth];
+		break;
+	case 848:
+		if(VDisplay == 480) ModeIndex = ModeIndex_848x480[Depth];
+		break;
+	case 856:
+		if(VDisplay == 480) ModeIndex = ModeIndex_856x480[Depth];
+		break;
+	case 1024:
+		if(VDisplay == 768)      ModeIndex = ModeIndex_1024x768[Depth];
+		else if(VDisplay == 576) ModeIndex = ModeIndex_1024x576[Depth];
+		break;
+	case 1152:
+	        if(VDisplay == 864)    ModeIndex = ModeIndex_1152x864[Depth];
+		else if(VGAEngine == SIS_300_VGA) {
+		   if(VDisplay == 768) ModeIndex = ModeIndex_1152x768[Depth];
+		}
+		break;
+	case 1280:
+	        if(VDisplay == 768) {
+		   if(VGAEngine == SIS_300_VGA) {
+		      ModeIndex = ModeIndex_300_1280x768[Depth];
+		   } else {
+		      ModeIndex = ModeIndex_310_1280x768[Depth];
+		   }
+		} else if(VDisplay == 1024) ModeIndex = ModeIndex_1280x1024[Depth];
+		else if(VDisplay == 720)    ModeIndex = ModeIndex_1280x720[Depth];
+		else if(VDisplay == 960)    ModeIndex = ModeIndex_1280x960[Depth];
+		break;
+        case 1360:
+	        if(VDisplay == 768) ModeIndex = ModeIndex_1360x768[Depth];
+                break;
+        case 1400:
+		if(VGAEngine == SIS_315_VGA) {
+	           if(VDisplay == 1050) ModeIndex = ModeIndex_1400x1050[Depth];
+		}
+		break;
+	case 1600:
+		if(VGAEngine == SIS_315_VGA) {
+		   if(VBFlags & (VB_301B|VB_301C|VB_302B)) {
+	              if(VDisplay == 1200) ModeIndex = ModeIndex_1600x1200[Depth];
+		   }
+		}
+		break;
    }
-/* SetDRAMSize end */
-#endif /* SIS300 */
-
-   /* Set default Ext2Regs */
-#if 0
-   AGP=1;
-   temp=(UCHAR)SiS_GetReg1(SiS_Pr->SiS_P3c4,0x3A);
-   temp &= 0x30;
-   if(temp == 0x30) AGP=0;
-   if(AGP == 0) *SiS_Pr->pSiS_SR21 &= 0xEF;
-   SiS_SetReg1(SiS_Pr->SiS_P3c4,0x21,*SiS_Pr->pSiS_SR21);
-   if(AGP == 1) *SiS_Pr->pSiS_SR22 &= 0x20;
-   SiS_SetReg1(SiS_Pr->SiS_P3c4,0x22,*SiS_Pr->pSiS_SR22);
-#endif
-   SiS_SetReg1(SiS_Pr->SiS_P3c4,0x21,*SiS_Pr->pSiS_SR21);
-   SiS_SetReg1(SiS_Pr->SiS_P3c4,0x22,*SiS_Pr->pSiS_SR22);
 
-#if 0
-   SiS_SetReg3(SiS_Pr->SiS_P3c6,0xff);
-   SiS_ClearDAC(SiS_Pr, SiS_Pr->SiS_P3c8);
-#endif
+   return ModeIndex;
+}
 
-#ifdef LINUXBIOS   /* TW: This is not needed for our purposes */
-   SiS_DetectMonitor(SiS_Pr, HwDeviceExtension,BaseAddr);    /* Sense CRT1 */
-   SiS_GetSenseStatus(SiS_Pr, HwDeviceExtension,ROMAddr);    /* Sense CRT2 */
-#endif
 
-   return(TRUE);
-}
+/*********************************************/
+/*          HELPER: SetReg, GetReg           */
+/*********************************************/
 
 void
-SiS_Set_LVDS_TRUMPION(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension)
+SiS_SetReg(SISIOADDRESS port, USHORT index, USHORT data)
 {
-  USHORT temp = 0;
-
-#ifdef SiS300
-  if((HwDeviceExtension->jChipType == SIS_540) ||
-     (HwDeviceExtension->jChipType == SIS_630) ||
-     (HwDeviceExtension->jChipType == SIS_730)) {
-        /* TW: Read POWER_ON_TRAP and copy to CR37 */
-    	temp = (UCHAR)SiS_GetReg1(SiS_Pr->SiS_P3c4,0x1A);
-    	temp = (temp & 0xE0) >> 4;
-   	SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x37,0xF1,temp);
-  }
-#endif
-#ifdef SIS315H
-  if((HwDeviceExtension->jChipType == SIS_650) ||
-     (HwDeviceExtension->jChipType == SIS_740) ||
-     (HwDeviceExtension->jChipType == SIS_330)) {
-#if 0 /* TW: This is not required */
-        /* TW: Read POWER_ON_TRAP and copy to CR37 */
-    	temp = (UCHAR)SiS_GetReg1(SiS_Pr->SiS_P3c4,0x1A);
-    	temp = (temp & 0xE0) >> 4;
-   	SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x37,0xF1,temp);
-#endif
-  }
-#endif
-
-   SiSSetLVDSetc(SiS_Pr, HwDeviceExtension, 0);
+   OutPortByte(port,index);
+   OutPortByte(port + 1,data);
 }
 
-/* ===============  SiS 300 dram sizing begin  =============== */
-#ifdef SIS300
 void
-SiS_SetDRAMSize_300(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension)
+SiS_SetRegByte(SISIOADDRESS port, USHORT data)
 {
-   ULONG   FBAddr = (ULONG)HwDeviceExtension->pjVideoMemoryAddress;
-   USHORT  SR13, SR14=0, buswidth, Done;
-   SHORT   i, j, k;
-   USHORT  data, TotalCapacity, PhysicalAdrOtherPage=0;
-   ULONG   Addr;
-   UCHAR   temp;
-   int     PseudoRankCapacity, PseudoTotalCapacity, PseudoAdrPinCount;
-   int     RankCapacity, AdrPinCount, BankNumHigh, BankNumMid, MB2Bank;
-   int     PageCapacity, PhysicalAdrHigh, PhysicalAdrHalfPage;
-
-   SiSSetMode(SiS_Pr, HwDeviceExtension, 0x2e);
-
-   SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x01,0x20);        /* Turn OFF Display  */
-
-   SiS_SetReg1(SiS_Pr->SiS_P3c4,0x13,0x00);
-   SiS_SetReg1(SiS_Pr->SiS_P3c4,0x14,0xBF);
-
-   buswidth = SiS_ChkBUSWidth_300(SiS_Pr, FBAddr);
-
-   MB2Bank = 16;
-   Done = 0;
-   for(i=6; i>=0; i--) {
-      if(Done == 1) break;
-      PseudoRankCapacity = 1 << i;
-      for(j=4; j>=1; j--) {
-         if(Done == 1) break;
-         PseudoTotalCapacity = PseudoRankCapacity * j;
-         PseudoAdrPinCount = 15 - j;
-         if(PseudoTotalCapacity <= 64) {
-            for(k=0; k<=16; k++) {
-               if(Done == 1) break;
-               RankCapacity = buswidth * SiS_DRAMType[k][3];
-               AdrPinCount = SiS_DRAMType[k][2] + SiS_DRAMType[k][0];
-               if(RankCapacity == PseudoRankCapacity)
-                 if(AdrPinCount <= PseudoAdrPinCount) {
-                    if(j == 3) {             /* Rank No */
-                       BankNumHigh = RankCapacity * MB2Bank * 3 - 1;
-                       BankNumMid = RankCapacity * MB2Bank * 1 - 1;
-                    } else {
-                       BankNumHigh = RankCapacity * MB2Bank * j - 1;
-                       BankNumMid = RankCapacity * MB2Bank * j / 2 - 1;
-                    }
-                    PageCapacity = (1 << SiS_DRAMType[k][1]) * buswidth * 4;
-                    PhysicalAdrHigh = BankNumHigh;
-                    PhysicalAdrHalfPage = (PageCapacity / 2 + PhysicalAdrHigh) % PageCapacity;
-                    PhysicalAdrOtherPage = PageCapacity * SiS_DRAMType[k][2] + PhysicalAdrHigh;
-                    /* Write data */
-                    /*Test*/
-                    SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x15,0xFB);
-                    SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x15,0x04);
-                    /*/Test*/
-                    TotalCapacity = SiS_DRAMType[k][3] * buswidth;
-                    SR13 = SiS_DRAMType[k][4];
-                    if(buswidth == 4) SR14 = (TotalCapacity - 1) | 0x80;
-                    if(buswidth == 2) SR14 = (TotalCapacity - 1) | 0x40;
-                    if(buswidth == 1) SR14 = (TotalCapacity - 1) | 0x00;
-                    SiS_SetReg1(SiS_Pr->SiS_P3c4,0x13,SR13);
-                    SiS_SetReg1(SiS_Pr->SiS_P3c4,0x14,SR14);
-
-                    Addr = FBAddr + (BankNumHigh) * 64 * 1024 + PhysicalAdrHigh;
-                    *((USHORT *)(Addr)) = (USHORT)PhysicalAdrHigh;
-                    Addr = FBAddr + (BankNumMid) * 64 * 1024 + PhysicalAdrHigh;
-                    *((USHORT *)(Addr)) = (USHORT)BankNumMid;
-                    Addr = FBAddr + (BankNumHigh) * 64 * 1024 + PhysicalAdrHalfPage;
-                    *((USHORT *)(Addr)) = (USHORT)PhysicalAdrHalfPage;
-                    Addr = FBAddr + (BankNumHigh) * 64 * 1024 + PhysicalAdrOtherPage;
-                    *((USHORT *)(Addr)) = PhysicalAdrOtherPage;
-
-                    /* Read data */
-                    Addr = FBAddr + (BankNumHigh) * 64 * 1024 + PhysicalAdrHigh;
-                    data = *((USHORT *)(Addr));
-                    if(data == PhysicalAdrHigh) Done = 1;
-                 }  /* if struct */
-            }  /* for loop (k) */
-         }  /* if struct */
-      }  /* for loop (j) */
-   }  /* for loop (i) */
+   OutPortByte(port,data);
 }
 
-USHORT
-SiS_ChkBUSWidth_300(SiS_Private *SiS_Pr, ULONG FBAddress)
+void
+SiS_SetRegShort(SISIOADDRESS port, USHORT data)
 {
-   PULONG  pVideoMemory;
-
-   pVideoMemory = (PULONG)FBAddress;
-
-   pVideoMemory[0] = 0x01234567L;
-   pVideoMemory[1] = 0x456789ABL;
-   pVideoMemory[2] = 0x89ABCDEFL;
-   pVideoMemory[3] = 0xCDEF0123L;
-   if (pVideoMemory[3]==0xCDEF0123L) {  /* Channel A 128bit */
-     return(4);
-   }
-   if (pVideoMemory[1]==0x456789ABL) {  /* Channel B 64bit */
-     return(2);
-   }
-   return(1);
+   OutPortWord(port,data);
 }
-#endif
-/* ===============  SiS 300 dram sizing end    =============== */
-
-/* ============  SiS 310/325 dram sizing begin  ============== */
-#ifdef SIS315H
-
-/* TW: Moved Get310DRAMType further down */
 
 void
-SiS_Delay15us(SiS_Private *SiS_Pr, ULONG ulMicrsoSec)
+SiS_SetRegLong(SISIOADDRESS port, ULONG data)
 {
+   OutPortLong(port,data);
 }
 
-void
-SiS_SDR_MRS(SiS_Private *SiS_Pr, )
+UCHAR
+SiS_GetReg(SISIOADDRESS port, USHORT index)
 {
-   USHORT  data;
-
-   data = SiS_GetReg1(SiS_Pr->SiS_P3c4,0x16);
-   data &= 0x3F;          		        /* SR16 D7=0, D6=0 */
-   SiS_SetReg1(SiS_Pr->SiS_P3c4,0x16,data);   	/* enable mode register set(MRS) low */
-   SiS_Delay15us(SiS_Pr, 0x100);
-   data |= 0x80;          		        /* SR16 D7=1, D6=0 */
-   SiS_SetReg1(SiS_Pr->SiS_P3c4,0x16,data);   	/* enable mode register set(MRS) high */
-   SiS_Delay15us(SiS_Pr, 0x100);
+   OutPortByte(port,index);
+   return(InPortByte(port + 1));
 }
 
-void
-SiS_DDR_MRS(SiS_Private *SiS_Pr)
+UCHAR
+SiS_GetRegByte(SISIOADDRESS port)
 {
-   USHORT  data;
-
-   /* SR16 <- 1F,DF,2F,AF */
-
-   /* enable DLL of DDR SD/SGRAM , SR16 D4=1 */
-   data=SiS_GetReg1(SiS_Pr->SiS_P3c4,0x16);
-   data &= 0x0F;
-   data |= 0x10;
-   SiS_SetReg1(SiS_Pr->SiS_P3c4,0x16,data);
-
-   if (!(SiS_Pr->SiS_SR15[1][SiS_Pr->SiS_RAMType] & 0x10))
-     data &= 0x0F;
-
-   /* SR16 D7=1,D6=1 */
-   data |= 0xC0;
-   SiS_SetReg1(SiS_Pr->SiS_P3c4,0x16,data);
-   
-   /* SR16 D7=1,D6=0,D5=1,D4=0 */
-   data &= 0x0F;
-   data |= 0x20;
-   SiS_SetReg1(SiS_Pr->SiS_P3c4,0x16,data);
-   if (!(SiS_Pr->SiS_SR15[1][SiS_Pr->SiS_RAMType] & 0x10))
-     data &= 0x0F;
-
-   /* SR16 D7=1 */
-   data |= 0x80;
-   SiS_SetReg1(SiS_Pr->SiS_P3c4,0x16,data);
+   return(InPortByte(port));
 }
 
-void
-SiS_SetDRAMModeRegister(SiS_Private *SiS_Pr, UCHAR *ROMAddr, PSIS_HW_DEVICE_INFO HwDeviceExtension)
+USHORT
+SiS_GetRegShort(SISIOADDRESS port)
 {
-    if (SiS_Get310DRAMType(ROMAddr,HwDeviceExtension) < 2)
-        SiS_SDR_MRS(SiS_Pr);
-    else
-        /* SR16 <- 0F,CF,0F,8F */
-        SiS_DDR_MRS(SiS_Pr);
+   return(InPortWord(port));
 }
 
-void
-SiS_DisableRefresh(SiS_Private *SiS_Pr)
+ULONG
+SiS_GetRegLong(SISIOADDRESS port)
 {
-   SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x17,0xF8);
-   SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x19,0x03);
+   return(InPortLong(port));
 }
 
 void
-SiS_EnableRefresh(SiS_Private *SiS_Pr, UCHAR *ROMAddr)
+SiS_SetRegANDOR(SISIOADDRESS Port,USHORT Index,USHORT DataAND,USHORT DataOR)
 {
-   SiS_SetReg1(SiS_Pr->SiS_P3c4,0x17,SiS_Pr->SiS_SR15[2][SiS_Pr->SiS_RAMType]);
-   SiS_SetReg1(SiS_Pr->SiS_P3c4,0x19,SiS_Pr->SiS_SR15[4][SiS_Pr->SiS_RAMType]);
+  USHORT temp;
+
+  temp = SiS_GetReg(Port,Index);
+  temp = (temp & (DataAND)) | DataOR;
+  SiS_SetReg(Port,Index,temp);
 }
 
 void
-SiS_DisableChannelInterleaving(SiS_Private *SiS_Pr, int index,
-                               USHORT SiS_DDRDRAM_TYPE[][5])
+SiS_SetRegAND(SISIOADDRESS Port,USHORT Index,USHORT DataAND)
 {
-   USHORT  data;
+  USHORT temp;
 
-   data=SiS_GetReg1(SiS_Pr->SiS_P3c4,0x15);
-   data &= 0x1F;
-   switch (SiS_DDRDRAM_TYPE[index][3])
-   {
-     case 64: data |= 0; 	break;
-     case 32: data |= 0x20;	break;
-     case 16: data |= 0x40;     break;
-     case 4:  data |= 0x60;     break;
-   }
-   SiS_SetReg1(SiS_Pr->SiS_P3c4,0x15,data);
+  temp = SiS_GetReg(Port,Index);
+  temp &= DataAND;
+  SiS_SetReg(Port,Index,temp);
 }
 
 void
-SiS_SetDRAMSizingType(SiS_Private *SiS_Pr, int index, USHORT DRAMTYPE_TABLE[][5])
+SiS_SetRegOR(SISIOADDRESS Port,USHORT Index,USHORT DataOR)
 {
-   SiS_SetReg1(SiS_Pr->SiS_P3c4,0x13,DRAMTYPE_TABLE[index][4]);
-   /* should delay 50 ns */
+  USHORT temp;
+
+  temp = SiS_GetReg(Port,Index);
+  temp |= DataOR;
+  SiS_SetReg(Port,Index,temp);
 }
 
+/*********************************************/
+/*      HELPER: DisplayOn, DisplayOff        */
+/*********************************************/
+
 void
-SiS_CheckBusWidth_310(SiS_Private *SiS_Pr, UCHAR *ROMAddress,ULONG FBAddress,
-                      PSIS_HW_DEVICE_INFO HwDeviceExtension)
+SiS_DisplayOn(SiS_Private *SiS_Pr)
 {
-   USHORT  data, temp;
-   PULONG  volatile pVideoMemory;
-
-   pVideoMemory = (PULONG)FBAddress;
+   SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x01,0xDF,0x00);
+}
 
-   if(HwDeviceExtension->jChipType == SIS_330) temp = 1;
-   else temp = 2;
+void
+SiS_DisplayOff(SiS_Private *SiS_Pr)
+{
+   SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x01,0xDF,0x20);
+}
 
-   if(SiS_Get310DRAMType(ROMAddress,HwDeviceExtension) < temp) {
 
-     SiS_SetReg1(SiS_Pr->SiS_P3c4,0x13,0x00);
-     if(HwDeviceExtension->jChipType != SIS_330) {
-        SiS_SetReg1(SiS_Pr->SiS_P3c4,0x14,0x12);
-     } else {
-        SiS_SetReg1(SiS_Pr->SiS_P3c4,0x14,0x02);
-     }
-     /* should delay */
-     SiS_SDR_MRS(SiS_Pr);
+/*********************************************/
+/*        HELPER: Init Port Addresses        */
+/*********************************************/
 
-     SiS_Pr->SiS_ChannelAB = 0;
-     SiS_Pr->SiS_DataBusWidth = 128;
-     pVideoMemory[0] = 0x01234567L;
-     pVideoMemory[1] = 0x456789ABL;
-     pVideoMemory[2] = 0x89ABCDEFL;
-     pVideoMemory[3] = 0xCDEF0123L;
-     pVideoMemory[4] = 0x55555555L;
-     pVideoMemory[5] = 0x55555555L;
-     pVideoMemory[6] = 0xFFFFFFFFL;
-     pVideoMemory[7] = 0xFFFFFFFFL;
-     if((pVideoMemory[3] != 0xCDEF0123L) || (pVideoMemory[2] != 0x89ABCDEFL)) {
-       /* Channel A 64Bit */
-       SiS_Pr->SiS_DataBusWidth = 64;
-       SiS_Pr->SiS_ChannelAB = 0;
-       SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x14, 0xFD);
-     }
-     if((pVideoMemory[1] != 0x456789ABL) || (pVideoMemory[0] != 0x01234567L)) {
-       /* Channel B 64Bit */
-       SiS_Pr->SiS_DataBusWidth = 64;
-       SiS_Pr->SiS_ChannelAB = 1;
-       SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x14,0xfd,0x01);
-     }
-     return;
+void
+SiSRegInit(SiS_Private *SiS_Pr, SISIOADDRESS BaseAddr)
+{
+   SiS_Pr->SiS_P3c4 = BaseAddr + 0x14;
+   SiS_Pr->SiS_P3d4 = BaseAddr + 0x24;
+   SiS_Pr->SiS_P3c0 = BaseAddr + 0x10;
+   SiS_Pr->SiS_P3ce = BaseAddr + 0x1e;
+   SiS_Pr->SiS_P3c2 = BaseAddr + 0x12;
+   SiS_Pr->SiS_P3ca = BaseAddr + 0x1a;
+   SiS_Pr->SiS_P3c6 = BaseAddr + 0x16;
+   SiS_Pr->SiS_P3c7 = BaseAddr + 0x17;
+   SiS_Pr->SiS_P3c8 = BaseAddr + 0x18;
+   SiS_Pr->SiS_P3c9 = BaseAddr + 0x19;
+   SiS_Pr->SiS_P3cb = BaseAddr + 0x1b;
+   SiS_Pr->SiS_P3cd = BaseAddr + 0x1d;
+   SiS_Pr->SiS_P3da = BaseAddr + 0x2a;
+   SiS_Pr->SiS_Part1Port = BaseAddr + SIS_CRT2_PORT_04;     /* Digital video interface registers (LCD) */
+   SiS_Pr->SiS_Part2Port = BaseAddr + SIS_CRT2_PORT_10;     /* 301 TV Encoder registers */
+   SiS_Pr->SiS_Part3Port = BaseAddr + SIS_CRT2_PORT_12;     /* 301 Macrovision registers */
+   SiS_Pr->SiS_Part4Port = BaseAddr + SIS_CRT2_PORT_14;     /* 301 VGA2 (and LCD) registers */
+   SiS_Pr->SiS_Part5Port = BaseAddr + SIS_CRT2_PORT_14 + 2; /* 301 palette address port registers */
+   SiS_Pr->SiS_DDC_Port = BaseAddr + 0x14;                  /* DDC Port ( = P3C4, SR11/0A) */
+   SiS_Pr->SiS_VidCapt = BaseAddr + SIS_VIDEO_CAPTURE;
+   SiS_Pr->SiS_VidPlay = BaseAddr + SIS_VIDEO_PLAYBACK;
+}
+
+/*********************************************/
+/*             HELPER: GetSysFlags           */
+/*********************************************/
 
-   } else {
+static void
+SiS_GetSysFlags(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
+{
+   unsigned char cr5f, temp1, temp2;
 
-     /* DDR Dual channel */
-     SiS_SetReg1(SiS_Pr->SiS_P3c4,0x13,0x00);
-     SiS_SetReg1(SiS_Pr->SiS_P3c4,0x14,0x02); /* Channel A, 64bit */
-     /* should delay */
-     SiS_DDR_MRS(SiS_Pr);
-
-     SiS_Pr->SiS_ChannelAB = 0;
-     SiS_Pr->SiS_DataBusWidth = 64;
-     pVideoMemory[0] = 0x01234567L;
-     pVideoMemory[1] = 0x456789ABL;
-     pVideoMemory[2] = 0x89ABCDEFL;
-     pVideoMemory[3] = 0xCDEF0123L;
-     pVideoMemory[4] = 0x55555555L;
-     pVideoMemory[5] = 0x55555555L;
-     pVideoMemory[6] = 0xAAAAAAAAL;
-     pVideoMemory[7] = 0xAAAAAAAAL;
-
-     if (pVideoMemory[1] == 0x456789ABL) {
-       if (pVideoMemory[0] == 0x01234567L) {
-         /* Channel A 64bit */
-         return;
-       }
-     } else {
-       if (pVideoMemory[0] == 0x01234567L) {
-         /* Channel A 32bit */
-         SiS_Pr->SiS_DataBusWidth = 32;
-         SiS_SetReg1(SiS_Pr->SiS_P3c4,0x14,0x00);
-         return;
-       }
-     }
+   /* 661 and newer: NEVER write non-zero to SR11[7:4] */
+   /* (SR11 is used for DDC and in enable/disablebridge) */
+   SiS_Pr->SiS_SensibleSR11 = FALSE;
+   SiS_Pr->SiS_MyCR63 = 0x63;
+   if(HwInfo->jChipType >= SIS_661) {
+      SiS_Pr->SiS_SensibleSR11 = TRUE;
+      SiS_Pr->SiS_MyCR63 = 0x53;
+   }
+
+   /* You should use the macros, not these flags directly */
+
+   SiS_Pr->SiS_SysFlags = 0;
+   if(HwInfo->jChipType == SIS_650) {
+      cr5f = SiS_GetReg(SiS_Pr->SiS_P3d4,0x5f) & 0xf0;
+      SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x5c,0x07);
+      temp1 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x5c) & 0xf8;
+      SiS_SetRegOR(SiS_Pr->SiS_P3d4,0x5c,0xf8);
+      temp2 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x5c) & 0xf8;
+      if((!temp1) || (temp2)) {
+         switch(cr5f) {
+	    case 0x80:
+	    case 0x90:
+	    case 0xc0:
+	       SiS_Pr->SiS_SysFlags |= SF_IsM650;  break;
+	    case 0xa0:
+	    case 0xb0:
+	    case 0xe0:
+	       SiS_Pr->SiS_SysFlags |= SF_Is651;   break;
+	 }
+      } else {
+         switch(cr5f) {
+	    case 0x90:
+	       temp1 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x5c) & 0xf8;
+	       switch(temp1) {
+	          case 0x00: SiS_Pr->SiS_SysFlags |= SF_IsM652; break;
+		  case 0x40: SiS_Pr->SiS_SysFlags |= SF_IsM653; break;
+		  default:   SiS_Pr->SiS_SysFlags |= SF_IsM650; break;
+	       }
+	       break;
+	    case 0xb0:
+	       SiS_Pr->SiS_SysFlags |= SF_Is652;  break;
+	    default:
+	       SiS_Pr->SiS_SysFlags |= SF_IsM650; break;
+	 }
+      }
+   }
+}
 
-     SiS_SetReg1(SiS_Pr->SiS_P3c4,0x14,0x03); /* Channel B, 64bit */
-     SiS_DDR_MRS(SiS_Pr);
+/*********************************************/
+/*         HELPER: Init PCI & Engines        */
+/*********************************************/
 
-     SiS_Pr->SiS_ChannelAB = 1;
-     SiS_Pr->SiS_DataBusWidth = 64;
-     pVideoMemory[0] = 0x01234567L;
-     pVideoMemory[1] = 0x456789ABL;
-     pVideoMemory[2] = 0x89ABCDEFL;
-     pVideoMemory[3] = 0xCDEF0123L;
-     pVideoMemory[4] = 0x55555555L;
-     pVideoMemory[5] = 0x55555555L;
-     pVideoMemory[6] = 0xAAAAAAAAL;
-     pVideoMemory[7] = 0xAAAAAAAAL;
-     if(pVideoMemory[1] == 0x456789ABL) {
-       /* Channel B 64 */
-       if(pVideoMemory[0] == 0x01234567L) {
-         /* Channel B 64bit */
-         return;
-       } else {
-         /* error */
-       }
-     } else {
-       if(pVideoMemory[0] == 0x01234567L) {
-         /* Channel B 32 */
-         SiS_Pr->SiS_DataBusWidth = 32;
-         SiS_SetReg1(SiS_Pr->SiS_P3c4,0x14,0x01);
-       } else {
-         /* error */
-       }
-     }
+static void
+SiSInitPCIetc(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
+{
+   switch(HwInfo->jChipType) {
+   case SIS_300:
+   case SIS_540:
+   case SIS_630:
+   case SIS_730:
+      /* Set - PCI LINEAR ADDRESSING ENABLE (0x80)
+       *     - RELOCATED VGA IO  (0x20)
+       *     - MMIO ENABLE (0x1)
+       */
+      SiS_SetReg(SiS_Pr->SiS_P3c4,0x20,0xa1);
+      /*  - Enable 2D (0x40)
+       *  - Enable 3D (0x02)
+       *  - Enable 3D Vertex command fetch (0x10) ?
+       *  - Enable 3D command parser (0x08) ?
+       */
+      SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x5A);
+      break;
+   case SIS_315H:
+   case SIS_315:
+   case SIS_315PRO:
+   case SIS_650:
+   case SIS_740:
+   case SIS_330:
+   case SIS_661:
+   case SIS_741:
+   case SIS_660:
+   case SIS_760:
+      SiS_SetReg(SiS_Pr->SiS_P3c4,0x20,0xa1);
+      /*  - Enable 2D (0x40)
+       *  - Enable 3D (0x02)
+       *  - Enable 3D vertex command fetch (0x10)
+       *  - Enable 3D command parser (0x08)
+       *  - Enable 3D G/L transformation engine (0x80)
+       */
+      SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0xDA);
+      break;
+   case SIS_550:
+      SiS_SetReg(SiS_Pr->SiS_P3c4,0x20,0xa1);
+      /* No 3D engine ! */
+      /*  - Enable 2D (0x40)
+       */
+      SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x40);
    }
 }
 
-int
-SiS_SetRank(SiS_Private *SiS_Pr, int index,UCHAR RankNo,USHORT DRAMTYPE_TABLE[][5])
+/*********************************************/
+/*             HELPER: SetLVDSetc            */
+/*********************************************/
+
+void
+SiSSetLVDSetc(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
 {
-  USHORT  data;
-  int RankSize;
+   ULONG   temp;
 
-  if ((RankNo==2)&&(DRAMTYPE_TABLE[index][0]==2))
-         return 0;
+   SiS_Pr->SiS_IF_DEF_LVDS = 0;
+   SiS_Pr->SiS_IF_DEF_TRUMPION = 0;
+   SiS_Pr->SiS_IF_DEF_CH70xx = 0;
+   SiS_Pr->SiS_IF_DEF_DSTN = 0;
+   SiS_Pr->SiS_IF_DEF_FSTN = 0;
+   SiS_Pr->SiS_IF_DEF_CONEX = 0;
 
-  RankSize = DRAMTYPE_TABLE[index][3]/2 * SiS_Pr->SiS_DataBusWidth / 32;
+   SiS_Pr->SiS_ChrontelInit = 0;
 
-  if (RankNo * RankSize <= 128) {
-    data = 0;
-    while((RankSize >>= 1) > 0) {
-      data += 0x10;
-    }
-    data |= (RankNo - 1) << 2;
-    data |= (SiS_Pr->SiS_DataBusWidth / 64) & 2;
-    data |= SiS_Pr->SiS_ChannelAB;
-    SiS_SetReg1(SiS_Pr->SiS_P3c4,0x14,data);
-    /* should delay */
-    SiS_SDR_MRS(SiS_Pr);
-    return 1;
-  } else
-    return 0;
+   switch(HwInfo->jChipType) {
+#ifdef SIS300
+   case SIS_540:
+   case SIS_630:
+   case SIS_730:
+        /* Check for SiS30x first */
+        temp = SiS_GetReg(SiS_Pr->SiS_Part4Port,0x00);
+	if((temp == 1) || (temp == 2)) return;
+      	temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x37);
+      	temp = (temp & 0x0E) >> 1;
+      	if((temp >= 2) && (temp <= 5)) SiS_Pr->SiS_IF_DEF_LVDS = 1;
+      	if(temp == 3)   SiS_Pr->SiS_IF_DEF_TRUMPION = 1;
+      	if((temp == 4) || (temp == 5)) {
+		/* Save power status (and error check) - UNUSED */
+		SiS_Pr->SiS_Backup70xx = SiS_GetCH700x(SiS_Pr, 0x0e);
+		SiS_Pr->SiS_IF_DEF_CH70xx = 1;
+        }
+	break;
+#endif
+#ifdef SIS315H
+   case SIS_550:
+   case SIS_650:
+   case SIS_740:
+   case SIS_330:
+        temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x37);
+      	temp = (temp & 0x0E) >> 1;
+      	if((temp >= 2) && (temp <= 3)) SiS_Pr->SiS_IF_DEF_LVDS = 1;
+      	if(temp == 3)  SiS_Pr->SiS_IF_DEF_CH70xx = 2;
+        break;
+   case SIS_661:
+   case SIS_741:
+   case SIS_660:
+   case SIS_760:
+        temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38);
+      	temp = (temp & 0xe0) >> 5;
+      	if((temp >= 2) && (temp <= 3)) SiS_Pr->SiS_IF_DEF_LVDS = 1;
+      	if(temp == 3)  SiS_Pr->SiS_IF_DEF_CH70xx = 2;
+	if(temp == 4)  SiS_Pr->SiS_IF_DEF_CONEX = 1;  /* Not yet supported */
+        break;
+#endif
+   default:
+        break;
+   }
 }
 
-int
-SiS_SetDDRChannel(SiS_Private *SiS_Pr, int index,UCHAR ChannelNo,
-                  USHORT DRAMTYPE_TABLE[][5])
-{
-  USHORT  data;
-  int RankSize;
+/*********************************************/
+/*          HELPER: Enable DSTN/FSTN         */
+/*********************************************/
 
-  RankSize = DRAMTYPE_TABLE[index][3]/2 * SiS_Pr->SiS_DataBusWidth / 32;
-  /* RankSize = DRAMTYPE_TABLE[index][3]; */
-  if (ChannelNo * RankSize <= 128) {
-    data = 0;
-    while((RankSize >>= 1) > 0) {
-      data += 0x10;
-    }
-    if(ChannelNo == 2) data |= 0x0C;
-    data |= (SiS_Pr->SiS_DataBusWidth / 32) & 2;
-    data |= SiS_Pr->SiS_ChannelAB;
-    SiS_SetReg1(SiS_Pr->SiS_P3c4,0x14,data);
-    /* should delay */
-    SiS_DDR_MRS(SiS_Pr);
-    return 1;
-  } else
-    return 0;
+void
+SiS_SetEnableDstn(SiS_Private *SiS_Pr, int enable)
+{
+   SiS_Pr->SiS_IF_DEF_DSTN = enable ? 1 : 0;
 }
 
-int
-SiS_CheckColumn(SiS_Private *SiS_Pr, int index,USHORT DRAMTYPE_TABLE[][5],ULONG FBAddress)
+void
+SiS_SetEnableFstn(SiS_Private *SiS_Pr, int enable)
 {
-  int i;
-  ULONG Increment,Position;
-
-  /*Increment = 1<<(DRAMTYPE_TABLE[index][2] + SiS_Pr->SiS_DataBusWidth / 64 + 1); */
-  Increment = 1 << (10 + SiS_Pr->SiS_DataBusWidth / 64);
-
-  for (i=0,Position=0;i<2;i++) {
-         *((PULONG)(FBAddress + Position)) = Position;
-         Position += Increment;
-  }
-
-  for (i=0,Position=0;i<2;i++) {
-/*    if (FBAddress[Position]!=Position) */
-         if((*(PULONG)(FBAddress + Position)) != Position)
-                return 0;
-         Position += Increment;
-  }
-  return 1;
+   SiS_Pr->SiS_IF_DEF_FSTN = enable ? 1 : 0;
 }
 
-int
-SiS_CheckBanks(SiS_Private *SiS_Pr, int index,USHORT DRAMTYPE_TABLE[][5],ULONG FBAddress)
+/*********************************************/
+/*        HELPER: Determine ROM usage        */
+/*********************************************/
+
+static void
+SiSDetermineROMUsage(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
 {
-  int i;
-  ULONG Increment,Position;
-  Increment = 1 << (DRAMTYPE_TABLE[index][2] + SiS_Pr->SiS_DataBusWidth / 64 + 2);
+   UCHAR  *ROMAddr  = HwInfo->pjVirtualRomBase;
 
-  for (i=0,Position=0;i<4;i++) {
-/*    FBAddress[Position]=Position; */
-    *((PULONG)(FBAddress + Position)) = Position;
-    Position += Increment;
-  }
+   if((ROMAddr) && (HwInfo->UseROM)) {
+      if((ROMAddr[0x00] != 0x55) || (ROMAddr[0x01] != 0xAA)) {
+         SiS_Pr->SiS_UseROM = FALSE;
+      } else if(HwInfo->jChipType == SIS_300) {
+        /* 300: We check if the code starts below 0x220 by
+	 * checking the jmp instruction at the beginning
+	 * of the BIOS image.
+	 */
+	 if((ROMAddr[3] == 0xe9) &&
+	    ((ROMAddr[5] << 8) | ROMAddr[4]) > 0x21a)
+	    SiS_Pr->SiS_UseROM = TRUE;
+	 else
+	    SiS_Pr->SiS_UseROM = FALSE;
+      } else if(HwInfo->jChipType < SIS_315H) {
+#if 0
+        /* Rest of 300 series: We don't use the ROM image if
+	 * the BIOS version < 2.0.0 as such old BIOSes don't
+	 * have the needed data at the expected locations.
+	 */
+         if(ROMAddr[0x06] < '2')  SiS_Pr->SiS_UseROM = FALSE;
+	 else                     SiS_Pr->SiS_UseROM = TRUE;
+#else
+	/* Sony's VAIO BIOS 1.09 follows the standard, so perhaps
+	 * the others do as well
+	 */
+	 SiS_Pr->SiS_UseROM = TRUE;
+#endif
+      } else {
+         /* 315/330 series stick to the standard */
+	 SiS_Pr->SiS_UseROM = TRUE;
+      }
+   } else SiS_Pr->SiS_UseROM = FALSE;
 
-  for (i=0,Position=0;i<4;i++) {
-/*    if (FBAddress[Position]!=Position) */
-    if((*(PULONG)(FBAddress + Position)) != Position)
-      return 0;
-    Position += Increment;
-  }
-  return 1;
 }
 
-int
-SiS_CheckRank(SiS_Private *SiS_Pr, int RankNo,int index,USHORT DRAMTYPE_TABLE[][5],ULONG FBAddress)
-{
-  int i;
-  ULONG Increment,Position;
-  Increment = 1<<(DRAMTYPE_TABLE[index][2] + DRAMTYPE_TABLE[index][1] +
-                  DRAMTYPE_TABLE[index][0] + SiS_Pr->SiS_DataBusWidth / 64 + RankNo);
-
-  for (i=0,Position=0;i<2;i++) {
-/*    FBAddress[Position]=Position; */
-    *((PULONG)(FBAddress+Position))=Position;
-    /* *((PULONG)(FBAddress))=Position; */
-    Position += Increment;
-  }
-
-  for (i=0,Position=0;i<2;i++) {
-/*    if (FBAddress[Position]!=Position) */
-         if ( (*(PULONG) (FBAddress + Position)) !=Position)
-    /*if ( (*(PULONG) (FBAddress )) !=Position) */
-      return 0;
-    Position += Increment;
-  }
-  return 1;
-}
+/*********************************************/
+/*        HELPER: SET SEGMENT REGISTERS      */
+/*********************************************/
 
-int
-SiS_CheckDDRRank(SiS_Private *SiS_Pr, int RankNo,int index,USHORT DRAMTYPE_TABLE[][5],ULONG FBAddress)
+static void
+SiS_SetSegRegLower(SiS_Private *SiS_Pr, USHORT value)
 {
-  ULONG Increment,Position;
-  USHORT  data;
-
-  Increment = 1<<(DRAMTYPE_TABLE[index][2] + DRAMTYPE_TABLE[index][1] +
-                  DRAMTYPE_TABLE[index][0] + SiS_Pr->SiS_DataBusWidth / 64 + RankNo);
+   USHORT temp;
 
-  Increment += Increment/2;
-
-  Position =0;
-  *((PULONG)(FBAddress+Position + 0)) = 0x01234567;
-  *((PULONG)(FBAddress+Position + 1)) = 0x456789AB;
-  *((PULONG)(FBAddress+Position + 2)) = 0x55555555;
-  *((PULONG)(FBAddress+Position + 3)) = 0x55555555;
-  *((PULONG)(FBAddress+Position + 4)) = 0xAAAAAAAA;
-  *((PULONG)(FBAddress+Position + 5)) = 0xAAAAAAAA;
-
-  if ( (*(PULONG) (FBAddress + 1)) == 0x456789AB)
-    return 1;
-
-  if ( (*(PULONG) (FBAddress + 0)) == 0x01234567)
-    return 0;
-
-  data=SiS_GetReg1(SiS_Pr->SiS_P3c4,0x14);
-  data &= 0xF3;
-  data |= 0x08;
-  SiS_SetReg1(SiS_Pr->SiS_P3c4,0x14,data);
-  data=SiS_GetReg1(SiS_Pr->SiS_P3c4,0x15);
-  data += 0x20;
-  SiS_SetReg1(SiS_Pr->SiS_P3c4,0x15,data);
-
-  return 1;
+   value &= 0x00ff;
+   temp = SiS_GetRegByte(SiS_Pr->SiS_P3cb) & 0xf0;
+   temp |= (value >> 4);
+   SiS_SetRegByte(SiS_Pr->SiS_P3cb, temp);
+   temp = SiS_GetRegByte(SiS_Pr->SiS_P3cd) & 0xf0;
+   temp |= (value & 0x0f);
+   SiS_SetRegByte(SiS_Pr->SiS_P3cd, temp);
 }
 
-int
-SiS_CheckRanks(SiS_Private *SiS_Pr, int RankNo,int index,USHORT DRAMTYPE_TABLE[][5],ULONG FBAddress)
+static void
+SiS_SetSegRegUpper(SiS_Private *SiS_Pr, USHORT value)
 {
-  int r;
+   USHORT temp;
 
-  for (r=RankNo;r>=1;r--) {
-    if (!SiS_CheckRank(SiS_Pr, r, index, DRAMTYPE_TABLE, FBAddress))
-      return 0;
-  }
-  if (!SiS_CheckBanks(SiS_Pr, index, DRAMTYPE_TABLE, FBAddress))
-    return 0;
-
-  if (!SiS_CheckColumn(SiS_Pr, index, DRAMTYPE_TABLE, FBAddress))
-    return 0;
-
-  return 1;
+   value &= 0x00ff;
+   temp = SiS_GetRegByte(SiS_Pr->SiS_P3cb) & 0x0f;
+   temp |= (value & 0xf0);
+   SiS_SetRegByte(SiS_Pr->SiS_P3cb, temp);
+   temp = SiS_GetRegByte(SiS_Pr->SiS_P3cd) & 0x0f;
+   temp |= (value << 4);
+   SiS_SetRegByte(SiS_Pr->SiS_P3cd, temp);
 }
 
-int
-SiS_CheckDDRRanks(SiS_Private *SiS_Pr, int RankNo,int index,USHORT DRAMTYPE_TABLE[][5],
-                  ULONG FBAddress)
+static void
+SiS_SetSegmentReg(SiS_Private *SiS_Pr, USHORT value)
 {
-  int r;
-
-  for (r=RankNo;r>=1;r--) {
-    if (!SiS_CheckDDRRank(SiS_Pr, r,index,DRAMTYPE_TABLE,FBAddress))
-      return 0;
-  }
-  if (!SiS_CheckBanks(SiS_Pr, index,DRAMTYPE_TABLE,FBAddress))
-    return 0;
-
-  if (!SiS_CheckColumn(SiS_Pr, index,DRAMTYPE_TABLE,FBAddress))
-    return 0;
-
-  return 1;
+   SiS_SetSegRegLower(SiS_Pr, value);
+   SiS_SetSegRegUpper(SiS_Pr, value);
 }
 
-int
-SiS_SDRSizing(SiS_Private *SiS_Pr, ULONG FBAddress)
+static void
+SiS_ResetSegmentReg(SiS_Private *SiS_Pr)
 {
-  int    i;
-  UCHAR  j;
-
-  for (i=0;i<13;i++) {
-    SiS_SetDRAMSizingType(SiS_Pr, i, SiS_SDRDRAM_TYPE);
-    for (j=2;j>0;j--) {
-      if (!SiS_SetRank(SiS_Pr, i,(UCHAR) j, SiS_SDRDRAM_TYPE))
-        continue;
-      else {
-        if (SiS_CheckRanks(SiS_Pr, j,i,SiS_SDRDRAM_TYPE, FBAddress))
-          return 1;
-      }
-    }
-  }
-  return 0;
+   SiS_SetSegmentReg(SiS_Pr, 0);
 }
 
-int
-SiS_DDRSizing(SiS_Private *SiS_Pr, ULONG FBAddress)
+static void
+SiS_SetSegmentRegOver(SiS_Private *SiS_Pr, USHORT value)
 {
+   USHORT temp = value >> 8;
 
-  int    i;
-  UCHAR  j;
-
-  for (i=0; i<4; i++){
-    SiS_SetDRAMSizingType(SiS_Pr, i, SiS_DDRDRAM_TYPE);
-    SiS_DisableChannelInterleaving(SiS_Pr, i, SiS_DDRDRAM_TYPE);
-    for (j=2; j>0; j--) {
-      SiS_SetDDRChannel(SiS_Pr, i, j, SiS_DDRDRAM_TYPE);
-      if (!SiS_SetRank(SiS_Pr, i, (UCHAR) j, SiS_DDRDRAM_TYPE))
-        continue;
-      else {
-        if (SiS_CheckDDRRanks(SiS_Pr, j, i, SiS_DDRDRAM_TYPE, FBAddress))
-          return 1;
-      }
-    }
-  }
-  return 0;
+   temp &= 0x07;
+   temp |= (temp << 4);
+   SiS_SetReg(SiS_Pr->SiS_P3c4,0x1d,temp);
+   SiS_SetSegmentReg(SiS_Pr, value);
 }
 
-/*
- check if read cache pointer is correct
-*/
-void
-SiS_VerifyMclk(SiS_Private *SiS_Pr, ULONG FBAddr)
+static void
+SiS_ResetSegmentRegOver(SiS_Private *SiS_Pr)
 {
-   PUCHAR  pVideoMemory = (PUCHAR) FBAddr;
-   UCHAR   i, j;
-   USHORT  Temp,SR21;
-
-   pVideoMemory[0] = 0xaa;  /* alan */
-   pVideoMemory[16] = 0x55; /* note: PCI read cache is off */
-
-   if((pVideoMemory[0] != 0xaa) || (pVideoMemory[16] != 0x55)) {
-     for (i=0,j=16; i<2; i++,j+=16)  {
-       SR21 = SiS_GetReg1(SiS_Pr->SiS_P3c4,0x21);
-       Temp = SR21 & 0xFB;           /* disable PCI post write buffer empty gating */
-       SiS_SetReg1(SiS_Pr->SiS_P3c4,0x21,Temp);
-
-       Temp = SiS_GetReg1(SiS_Pr->SiS_P3c4, 0x3C);
-       Temp |= 0x01;                 /* MCLK reset */
-       SiS_SetReg1(SiS_Pr->SiS_P3c4,0x3C,Temp);
-       Temp = SiS_GetReg1(SiS_Pr->SiS_P3c4,0x3C);
-       Temp &= 0xFE;                 /* MCLK normal operation */
-       SiS_SetReg1(SiS_Pr->SiS_P3c4,0x3C,Temp);
-       SiS_SetReg1(SiS_Pr->SiS_P3c4,0x21,SR21);
-
-       pVideoMemory[16+j] = j;
-       if(pVideoMemory[16+j] == j) {
-         pVideoMemory[j] = j;
-         break;
-       }
-     }
-   }
+   SiS_SetSegmentRegOver(SiS_Pr, 0);
 }
 
-/* TW: Is this a 315E? */
-int
-Is315E(SiS_Private *SiS_Pr)
+static void
+SiS_ResetSegmentRegisters(SiS_Private *SiS_Pr,PSIS_HW_INFO HwInfo)
 {
-   USHORT  data;
-
-   data = SiS_GetReg1(SiS_Pr->SiS_P3d4,0x5F);
-   if(data & 0x10) return 1;
-   else return 0;
+   if((IS_SIS65x) || (HwInfo->jChipType >= SIS_661)) {
+      SiS_ResetSegmentReg(SiS_Pr);
+      SiS_ResetSegmentRegOver(SiS_Pr);
+   }
 }
 
-/* TW: For 315 only */
+/*********************************************/
+/*             HELPER: GetVBType             */
+/*********************************************/
+
 void
-SiS_SetDRAMSize_310(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension)
+SiS_GetVBType(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
 {
-   UCHAR  *ROMAddr  = HwDeviceExtension->pjVirtualRomBase;
-   ULONG   FBAddr   = (ULONG)HwDeviceExtension->pjVideoMemoryAddress;
-   USHORT  data;
+  USHORT flag=0, rev=0, nolcd=0;
 
-#ifdef SIS301	/* TW: SIS301 ??? */
-   /*SiS_SetReg1(SiS_Pr->SiS_P3d4,0x30,0x40);   */
-#endif
-#ifdef SIS302   /* TW: SIS302 ??? */
-   SiS_SetReg1(SiS_Pr->SiS_P3d4,0x30,0x4D);  /* alan,should change value */
-   SiS_SetReg1(SiS_Pr->SiS_P3d4,0x31,0xc0);  /* alan,should change value */
-   SiS_SetReg1(SiS_Pr->SiS_P3d4,0x34,0x3F);  /* alan,should change value */
-#endif
+  SiS_Pr->SiS_VBType = 0;
 
-   SiSSetMode(SiS_Pr, HwDeviceExtension, 0x2e);
+  if(SiS_Pr->SiS_IF_DEF_LVDS == 1) return;
 
-   data = SiS_GetReg1(SiS_Pr->SiS_P3c4,0x21);
-   SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x21,0xDF);                 /* disable read cache */
+  flag = SiS_GetReg(SiS_Pr->SiS_Part4Port,0x00);
 
-   SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x01,0x20);                  /* Turn OFF Display */
+  if(flag > 3) return;
 
-   SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x16,0x0F);                  /* assume lowest speed DRAM */
+  rev = SiS_GetReg(SiS_Pr->SiS_Part4Port,0x01);
 
-   SiS_SetDRAMModeRegister(SiS_Pr, ROMAddr, HwDeviceExtension);
-   SiS_DisableRefresh(SiS_Pr);
-   SiS_CheckBusWidth_310(SiS_Pr, ROMAddr, FBAddr, HwDeviceExtension);
+  if(flag >= 2) {
+     SiS_Pr->SiS_VBType = VB_SIS302B;
+  } else if(flag == 1) {
+     SiS_Pr->SiS_VBType = VB_SIS301;
+     if(rev >= 0xC0) {
+       	SiS_Pr->SiS_VBType = VB_SIS301C;
+     } else if(rev >= 0xB0) {
+       	SiS_Pr->SiS_VBType = VB_SIS301B;
+	/* Check if 30xB DH version (no LCD support, use Panel Link instead) */
+    	nolcd = SiS_GetReg(SiS_Pr->SiS_Part4Port,0x23);
+        if(!(nolcd & 0x02)) SiS_Pr->SiS_VBType |= VB_NoLCD;
+     }
+  }
+  if(SiS_Pr->SiS_VBType & (VB_SIS301B | VB_SIS301C | VB_SIS302B)) {
+     if(rev >= 0xD0) {
+	SiS_Pr->SiS_VBType &= ~(VB_SIS301B | VB_SIS301C | VB_SIS302B | VB_NoLCD);
+	if(rev >= 0xE0) {
+	   flag = SiS_GetReg(SiS_Pr->SiS_Part4Port,0x39);
+	   if(flag == 0xff)
+	      SiS_Pr->SiS_VBType |= VB_SIS302LV;
+	   else
+	      SiS_Pr->SiS_VBType |= VB_SIS302ELV;
+	} else {
+	   SiS_Pr->SiS_VBType |= VB_SIS301LV;
+	}
+     }
+  }
+}
 
-   SiS_VerifyMclk(SiS_Pr, FBAddr);
+/*********************************************/
+/*            HELPER: GetDRAMSize            */
+/*********************************************/
 
-   if(HwDeviceExtension->jChipType == SIS_330) temp = 1;
-   else temp = 2;
+#ifndef LINUX_XF86
+static ULONG
+GetDRAMSize(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
+{
+  ULONG   AdapterMemorySize = 0;
+#ifdef SIS315H
+  USHORT  counter;
+#endif
 
-   if(SiS_Get310DRAMType(SiS_Pr, ROMAddr, HwDeviceExtension) < temp)
-     SiS_SDRSizing(SiS_Pr, FBAddr);
-   else
-     SiS_DDRSizing(SiS_Pr, FBAddr);
+  switch(HwInfo->jChipType) {
+#ifdef SIS315H
+  case SIS_315H:
+  case SIS_315:
+  case SIS_315PRO:
+    	counter = SiS_GetReg(SiS_Pr->SiS_P3c4,0x14);
+	AdapterMemorySize = 1 << ((counter & 0xF0) >> 4);
+	counter >>= 2;
+	counter &= 0x03;
+	if(counter == 0x02) {
+		AdapterMemorySize += (AdapterMemorySize / 2);      /* DDR asymetric */
+	} else if(counter != 0) {
+		AdapterMemorySize <<= 1;                           /* SINGLE_CHANNEL_2_RANK or DUAL_CHANNEL_1_RANK */
+	}
+	AdapterMemorySize *= (1024*1024);
+        break;
 
-   if(HwDeviceExtension->jChipType != SIS_330) {
-     if(Is315E(SiS_Pr)) {
-       data = SiS_GetReg1(SiS_Pr->SiS_P3c4,0x14);
-       if((data & 0x0C) == 0x0C) { 	/* dual channel */
-     	 if((data & 0xF0) > 0x40)
-     	   data = (data & 0x0F) | 0x40;
-       } else { 				/* single channel */
-     	 if((data & 0xF0) > 0x50)
-     	   data = (data & 0x0F) | 0x50;
-       }
-     }
-   }
+  case SIS_330:
+    	counter = SiS_GetReg(SiS_Pr->SiS_P3c4,0x14);
+	AdapterMemorySize = 1 << ((counter & 0xF0) >> 4);
+	counter &= 0x0c;
+	if(counter != 0) {
+		AdapterMemorySize <<= 1;
+	}
+	AdapterMemorySize *= (1024*1024);
+	break;
+
+  case SIS_550:
+  case SIS_650:
+  case SIS_740:
+  	counter = SiS_GetReg(SiS_Pr->SiS_P3c4,0x14) & 0x3F;
+      	counter++;
+      	AdapterMemorySize = counter * 4;
+      	AdapterMemorySize *= (1024*1024);
+	break;
+
+  case SIS_661:
+  case SIS_741:
+  case SIS_660:
+  case SIS_760:
+        counter = (SiS_GetReg(SiS_Pr->SiS_P3c4,0x79) & 0xf0) >> 4;
+	AdapterMemorySize = 1 << counter;
+      	AdapterMemorySize *= (1024*1024);
+        break;
+#endif
 
-   SiS_SetReg1(SiS_Pr->SiS_P3c4,0x16,SiS_Pr->SiS_SR15[1][SiS_Pr->SiS_RAMType]);  /* restore SR16 */
+#ifdef SIS300
+  case SIS_300:
+  case SIS_540:
+  case SIS_630:
+  case SIS_730:
+      	AdapterMemorySize = SiS_GetReg(SiS_Pr->SiS_P3c4,0x14) & 0x3F;
+      	AdapterMemorySize++;
+      	AdapterMemorySize *= (1024*1024);
+	break;
+#endif
+  default:
+        break;
+  }
 
-   SiS_EnableRefresh(SiS_Pr, ROMAddr);
-   SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x21,0x20);      	/* enable read cache */
+  return AdapterMemorySize;
 }
 #endif
 
-void
-SiS_SetMemoryClock(SiS_Private *SiS_Pr, UCHAR *ROMAddr,PSIS_HW_DEVICE_INFO HwDeviceExtension)
+/*********************************************/
+/*           HELPER: Check RAM size          */
+/*********************************************/
+
+#ifndef LINUX_XF86
+static BOOLEAN
+SiS_CheckMemorySize(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
+                    USHORT ModeNo, USHORT ModeIdIndex)
 {
-   SiS_SetReg1(SiS_Pr->SiS_P3c4,0x28,SiS_Pr->SiS_MCLKData_0[SiS_Pr->SiS_RAMType].SR28);
-   SiS_SetReg1(SiS_Pr->SiS_P3c4,0x29,SiS_Pr->SiS_MCLKData_0[SiS_Pr->SiS_RAMType].SR29);
-   SiS_SetReg1(SiS_Pr->SiS_P3c4,0x2A,SiS_Pr->SiS_MCLKData_0[SiS_Pr->SiS_RAMType].SR2A);
-   SiS_SetReg1(SiS_Pr->SiS_P3c4,0x2E,SiS_Pr->SiS_ECLKData[SiS_Pr->SiS_RAMType].SR2E);
-   SiS_SetReg1(SiS_Pr->SiS_P3c4,0x2F,SiS_Pr->SiS_ECLKData[SiS_Pr->SiS_RAMType].SR2F);
-   SiS_SetReg1(SiS_Pr->SiS_P3c4,0x30,SiS_Pr->SiS_ECLKData[SiS_Pr->SiS_RAMType].SR30);
+  USHORT memorysize,modeflag;
+  ULONG  temp;
 
-#ifdef SIS315H
-   if (Is315E(SiS_Pr)) {
-     SiS_SetReg1(SiS_Pr->SiS_P3c4,0x28,0x3B); /* 143 */
-     SiS_SetReg1(SiS_Pr->SiS_P3c4,0x29,0x22);
-     SiS_SetReg1(SiS_Pr->SiS_P3c4,0x2E,0x3B); /* 143 */
-     SiS_SetReg1(SiS_Pr->SiS_P3c4,0x2F,0x22);
-   }
-#endif
+  if(SiS_Pr->UseCustomMode) {
+     modeflag = SiS_Pr->CModeFlag;
+  } else {
+     if(ModeNo <= 0x13) {
+        modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
+     } else {
+        modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
+     }
+  }
+
+  memorysize = modeflag & MemoryInfoFlag;
+  memorysize >>= MemorySizeShift;		/* Get required memory size */
+  memorysize++;
+
+  temp = GetDRAMSize(SiS_Pr, HwInfo);       	/* Get adapter memory size (in MB) */
+  temp /= (1024*1024);
+
+  if(temp < memorysize) return(FALSE);
+  else return(TRUE);
 }
+#endif
 
-#endif /* ifdef LINUXBIOS */
+/*********************************************/
+/*           HELPER: Get DRAM type           */
+/*********************************************/
 
 #ifdef SIS315H
-UCHAR
-SiS_Get310DRAMType(SiS_Private *SiS_Pr, UCHAR *ROMAddr,PSIS_HW_DEVICE_INFO HwDeviceExtension)
+static UCHAR
+SiS_Get310DRAMType(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
 {
    UCHAR data, temp;
 
    if(*SiS_Pr->pSiS_SoftSetting & SoftDRAMType) {
      data = *SiS_Pr->pSiS_SoftSetting & 0x03;
    } else {
-     if((HwDeviceExtension->jChipType > SIS_315PRO) &&
-        (HwDeviceExtension->jChipType < SIS_330)) {
-        data = SiS_GetReg1(SiS_Pr->SiS_P3c4,0x13) & 0x07;
-     } else {	/* TW: 315, 330 */
-        data = SiS_GetReg1(SiS_Pr->SiS_P3c4,0x3a) & 0x03;
-        if(HwDeviceExtension->jChipType == SIS_330) {
+     if(HwInfo->jChipType >= SIS_661) {
+        data = SiS_GetReg(SiS_Pr->SiS_P3d4,0x78) & 0x07;
+     } else if(IS_SIS550650740) {
+        data = SiS_GetReg(SiS_Pr->SiS_P3c4,0x13) & 0x07;
+     } else {	/* 315, 330 */
+        data = SiS_GetReg(SiS_Pr->SiS_P3c4,0x3a) & 0x03;
+        if(HwInfo->jChipType == SIS_330) {
 	   if(data > 1) {
-	      temp = SiS_GetReg1(SiS_Pr->SiS_P3d4,0x5f) & 0x30;
+	      temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x5f) & 0x30;
 	      switch(temp) {
 	      case 0x00: data = 1; break;
 	      case 0x10: data = 3; break;
@@ -1916,1560 +1794,1244 @@
 
    return data;
 }
-#endif
 
-/* SiSInit END */
+USHORT
+SiS_GetMCLK(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
+{
+  USHORT index;
+
+  index = SiS_Get310DRAMType(SiS_Pr, HwInfo);
+  if(HwInfo->jChipType >= SIS_661) {
+     return(SiS_Pr->SiS_MCLKData_0[index].CLOCK);
+  } else if(index >= 4) {
+     index -= 4;
+     return(SiS_Pr->SiS_MCLKData_1[index].CLOCK);
+  } else {
+     return(SiS_Pr->SiS_MCLKData_0[index].CLOCK);
+  }
+}
+#endif
 
-/* ----------------------------------------- */
+/*********************************************/
+/*           HELPER: ClearBuffer             */
+/*********************************************/
 
-void SiSRegInit(SiS_Private *SiS_Pr, USHORT BaseAddr)
+#ifndef LINUX_XF86
+static void
+SiS_ClearBuffer(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, USHORT ModeNo)
 {
-   SiS_Pr->SiS_P3c4 = BaseAddr + 0x14;
-   SiS_Pr->SiS_P3d4 = BaseAddr + 0x24;
-   SiS_Pr->SiS_P3c0 = BaseAddr + 0x10;
-   SiS_Pr->SiS_P3ce = BaseAddr + 0x1e;
-   SiS_Pr->SiS_P3c2 = BaseAddr + 0x12;
-   SiS_Pr->SiS_P3ca = BaseAddr + 0x1a;
-   SiS_Pr->SiS_P3c6 = BaseAddr + 0x16;
-   SiS_Pr->SiS_P3c7 = BaseAddr + 0x17;
-   SiS_Pr->SiS_P3c8 = BaseAddr + 0x18;
-   SiS_Pr->SiS_P3c9 = BaseAddr + 0x19;
-   SiS_Pr->SiS_P3da = BaseAddr + 0x2A;
-   SiS_Pr->SiS_Part1Port = BaseAddr + SIS_CRT2_PORT_04;   /* Digital video interface registers (LCD) */
-   SiS_Pr->SiS_Part2Port = BaseAddr + SIS_CRT2_PORT_10;   /* 301 TV Encoder registers */
-   SiS_Pr->SiS_Part3Port = BaseAddr + SIS_CRT2_PORT_12;   /* 301 Macrovision registers */
-   SiS_Pr->SiS_Part4Port = BaseAddr + SIS_CRT2_PORT_14;   /* 301 VGA2 (and LCD) registers */
-   SiS_Pr->SiS_Part5Port = BaseAddr + SIS_CRT2_PORT_14+2; /* 301 palette address port registers */
-   SiS_Pr->SiS_DDC_Port = BaseAddr + 0x14;                /* DDC Port ( = P3C4, SR11/0A) */
-}
+  UCHAR   *VideoMemoryAddress = HwInfo->pjVideoMemoryAddress;
+  ULONG   AdapterMemorySize  = (ULONG)HwInfo->ulVideoMemorySize;
+  USHORT  *pBuffer;
+  int i;
 
-void
-SiSInitPCIetc(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension)
-{
-/* #ifdef LINUX_XF86 */
-   if ((HwDeviceExtension->jChipType == SIS_540)||
-       (HwDeviceExtension->jChipType == SIS_630)||
-       (HwDeviceExtension->jChipType == SIS_730)||
-       (HwDeviceExtension->jChipType == SIS_300)) {
-       /* TW: Set - PCI LINEAR ADDRESSING ENABLE (0x80)
-		  - PCI IO ENABLE  (0x20)
-		  - MMIO ENABLE (0x1)
-  	*/
-       SiS_SetReg1(SiS_Pr->SiS_P3c4,0x20,0xa1);
-       /* TW: Enable 2D (0x42) & 3D accelerator (0x18) */
-       SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x1E,0xFF,0x5A);
-   }
-   if((HwDeviceExtension->jChipType == SIS_315H)||
-      (HwDeviceExtension->jChipType == SIS_315) ||
-      (HwDeviceExtension->jChipType == SIS_315PRO)||
-      (HwDeviceExtension->jChipType == SIS_550) ||
-      (HwDeviceExtension->jChipType == SIS_650) ||
-      (HwDeviceExtension->jChipType == SIS_740) ||
-      (HwDeviceExtension->jChipType == SIS_330)) {
-      /* TW: This seems to be done the same way on these chipsets */
-      SiS_SetReg1(SiS_Pr->SiS_P3c4,0x20,0xa1);
-      SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x1E,0xFF,0x5A);
-   }
-/* #endif */
+  if(SiS_Pr->SiS_ModeType >= ModeEGA) {
+     if(ModeNo > 0x13) {
+        AdapterMemorySize = GetDRAMSize(SiS_Pr, HwInfo);
+        SiS_SetMemory(VideoMemoryAddress,AdapterMemorySize,0);
+     } else {
+        pBuffer = (USHORT *)VideoMemoryAddress;
+        for(i=0; i<0x4000; i++)
+           pBuffer[i] = 0x0000;
+     }
+  } else {
+     pBuffer = (USHORT *)VideoMemoryAddress;
+     if(SiS_Pr->SiS_ModeType < ModeCGA) {
+        for(i=0; i<0x4000; i++)
+           pBuffer[i] = 0x0720;
+     } else {
+        SiS_SetMemory(VideoMemoryAddress,0x8000,0);
+     }
+  }
 }
+#endif
 
-void
-SiSSetLVDSetc(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT ModeNo)
+/*********************************************/
+/*           HELPER: SearchModeID            */
+/*********************************************/
+
+BOOLEAN
+SiS_SearchModeID(SiS_Private *SiS_Pr, USHORT *ModeNo, USHORT *ModeIdIndex)
 {
-   ULONG   temp;
+   UCHAR VGAINFO = SiS_Pr->SiS_VGAINFO;
 
-   SiS_Pr->SiS_IF_DEF_LVDS = 0;
-   SiS_Pr->SiS_IF_DEF_TRUMPION = 0;
-   SiS_Pr->SiS_IF_DEF_CH70xx = 0;
-   SiS_Pr->SiS_IF_DEF_HiVision = 0;
-   SiS_Pr->SiS_IF_DEF_DSTN = 0;
-   SiS_Pr->SiS_IF_DEF_FSTN = 0;
+   if(*ModeNo <= 0x13) {
 
-   SiS_Pr->SiS_ChrontelInit = 0;
+      if((*ModeNo) <= 0x05) (*ModeNo) |= 0x01;
 
-   if((ModeNo == 0x5a) || (ModeNo == 0x5b)) {
-   	SiS_Pr->SiS_IF_DEF_DSTN = 1;   /* for 550 dstn */
-   	SiS_Pr->SiS_IF_DEF_FSTN = 1;   /* for fstn */
-   }
+      for(*ModeIdIndex = 0; ;(*ModeIdIndex)++) {
+         if(SiS_Pr->SiS_SModeIDTable[*ModeIdIndex].St_ModeID == (*ModeNo)) break;
+         if(SiS_Pr->SiS_SModeIDTable[*ModeIdIndex].St_ModeID == 0xFF)   return FALSE;
+      }
 
-#ifdef SIS300
-   if((HwDeviceExtension->jChipType == SIS_540) ||
-      (HwDeviceExtension->jChipType == SIS_630) ||
-      (HwDeviceExtension->jChipType == SIS_730))
-    {
-        /* TW: Check for SiS30x first */
-        temp = SiS_GetReg1(SiS_Pr->SiS_Part4Port,0x00);
-	if((temp == 1) || (temp == 2)) return;
-      	temp = SiS_GetReg1(SiS_Pr->SiS_P3d4,0x37);
-      	temp = (temp & 0x0E) >> 1;
-      	if((temp >= 2) && (temp <= 5)) SiS_Pr->SiS_IF_DEF_LVDS = 1;
-      	if(temp == 3)   SiS_Pr->SiS_IF_DEF_TRUMPION = 1;
-      	if((temp == 4) || (temp == 5)) {
-		/* TW: Save power status (and error check) - UNUSED */
-		SiS_Pr->SiS_Backup70xx = SiS_GetCH700x(SiS_Pr, 0x0e);
-		SiS_Pr->SiS_IF_DEF_CH70xx = 1;
-        }
-   }
-#endif
-#ifdef SIS315H
-   if((HwDeviceExtension->jChipType == SIS_550) ||
-      (HwDeviceExtension->jChipType == SIS_650) ||
-      (HwDeviceExtension->jChipType == SIS_740) ||
-      (HwDeviceExtension->jChipType == SIS_330))
-    {
-        /* TW: CR37 is different on 310/325 series */
-        if(SiS_Pr->SiS_IF_DEF_FSTN)                       /* fstn: set CR37=0x04 */
-             SiS_SetReg1(SiS_Pr->SiS_P3d4,0x37,0x04);      /* (fake LVDS bridge) */
+      if(*ModeNo == 0x07) {
+          if(VGAINFO & 0x10) (*ModeIdIndex)++;   /* 400 lines */
+          /* else 350 lines */
+      }
+      if(*ModeNo <= 0x03) {
+         if(!(VGAINFO & 0x80)) (*ModeIdIndex)++;
+         if(VGAINFO & 0x10)    (*ModeIdIndex)++; /* 400 lines  */
+         /* else 350 lines  */
+      }
+      /* else 200 lines  */
 
-	temp=SiS_GetReg1(SiS_Pr->SiS_P3d4,0x37);
-      	temp = (temp & 0x0E) >> 1;
-      	if((temp >= 2) && (temp <= 3)) SiS_Pr->SiS_IF_DEF_LVDS = 1;
-      	if(temp == 3)  {
-			SiS_Pr->SiS_IF_DEF_CH70xx = 2;
-        }
-	
-	/* HiVision (HDTV) is done differently now. */
-	/* SiS_Pr->SiS_IF_DEF_HiVision = 1; */
-    }
-#endif
-}
+   } else {
 
-void
-SiSInitPtr(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension)
-{
-#ifdef SIS315H
-   if((HwDeviceExtension->jChipType == SIS_315H) ||
-      (HwDeviceExtension->jChipType == SIS_315) ||
-      (HwDeviceExtension->jChipType == SIS_315PRO) ||
-      (HwDeviceExtension->jChipType == SIS_550) ||
-      (HwDeviceExtension->jChipType == SIS_650) ||
-      (HwDeviceExtension->jChipType == SIS_740) ||
-      (HwDeviceExtension->jChipType == SIS_330))
-     InitTo310Pointer(SiS_Pr, HwDeviceExtension);
-#endif
+      for(*ModeIdIndex = 0; ;(*ModeIdIndex)++) {
+         if(SiS_Pr->SiS_EModeIDTable[*ModeIdIndex].Ext_ModeID == (*ModeNo)) break;
+         if(SiS_Pr->SiS_EModeIDTable[*ModeIdIndex].Ext_ModeID == 0xFF)      return FALSE;
+      }
 
-#ifdef SIS300
-   if ((HwDeviceExtension->jChipType == SIS_540) ||
-       (HwDeviceExtension->jChipType == SIS_630) ||
-       (HwDeviceExtension->jChipType == SIS_730) ||
-       (HwDeviceExtension->jChipType == SIS_300))
-     InitTo300Pointer(SiS_Pr, HwDeviceExtension);
-#endif
+   }
+   return TRUE;
 }
 
-void
-SiSDetermineROMUsage(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, UCHAR *ROMAddr)
-{
-   if((ROMAddr) && (HwDeviceExtension->UseROM)) {
-     if((ROMAddr[0x00] != 0x55) || (ROMAddr[0x01] != 0xAA)) {
-        SiS_Pr->SiS_UseROM = FALSE;
-     } else if(HwDeviceExtension->jChipType == SIS_300) {
-        /* TW: 300: We check if the code starts below 0x220 by
-	 *     checking the jmp instruction at the beginning
-	 *     of the BIOS image.
-	 */
-	 if((ROMAddr[3] == 0xe9) &&
-	    ((ROMAddr[5] << 8) | ROMAddr[4]) > 0x21a)
-	      SiS_Pr->SiS_UseROM = TRUE;
-	 else SiS_Pr->SiS_UseROM = FALSE;
-     } else if(HwDeviceExtension->jChipType < SIS_315H) {
-        /* TW: Rest of 300 series: We don't use the ROM image if
-	 *     the BIOS version < 2.0.0 as such old BIOSes don't
-	 *     have the needed data at the expected locations.
-	 */
-        if(ROMAddr[0x06] < '2')  SiS_Pr->SiS_UseROM = FALSE;
-	else                     SiS_Pr->SiS_UseROM = TRUE;
-     } else {
-        /* TW: 310/325/330 series stick to the standard */
-	SiS_Pr->SiS_UseROM = TRUE;
-     }
-   } else SiS_Pr->SiS_UseROM = FALSE;
-
-}
+/*********************************************/
+/*            HELPER: GetModePtr             */
+/*********************************************/
 
-/*
- 	=========================================
- 	======== SiS SetMode Functions ==========
- 	=========================================
-*/
-#ifdef LINUX_XF86
-/* TW: This is used for non-Dual-Head mode from X */
-BOOLEAN
-SiSBIOSSetMode(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, ScrnInfoPtr pScrn,
-               DisplayModePtr mode, BOOLEAN IsCustom)
+UCHAR
+SiS_GetModePtr(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex)
 {
-   SISPtr  pSiS = SISPTR(pScrn);
-   UShort  ModeNo=0;
-   
-   SiS_Pr->UseCustomMode = FALSE;
+   UCHAR index;
 
-   if((IsCustom) && (SiS_CheckBuildCustomMode(pScrn, mode, pSiS->VBFlags))) {
-   
-         xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, "Setting custom mode %dx%d\n", 
-	 	SiS_Pr->CHDisplay, SiS_Pr->CVDisplay);
-		
-	 return(SiSSetMode(SiS_Pr, HwDeviceExtension, pScrn, ModeNo, TRUE));
-   
+   if(ModeNo <= 0x13) {
+     	index = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_StTableIndex;
+   } else {
+     	if(SiS_Pr->SiS_ModeType <= 0x02) index = 0x1B;    /* 02 -> ModeEGA  */
+     	else index = 0x0F;
    }
-   
-   ModeNo = SiS_CalcModeIndex(pScrn, mode);
-   if(!ModeNo) return FALSE;
+   return index;
+}
 
-   xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, "Setting mode 0x%x\n", ModeNo);
+/*********************************************/
+/*           HELPER: LowModeTests            */
+/*********************************************/
+
+static BOOLEAN
+SiS_DoLowModeTest(SiS_Private *SiS_Pr, USHORT ModeNo, PSIS_HW_INFO HwInfo)
+{
+    USHORT temp,temp1,temp2;
+
+    if((ModeNo != 0x03) && (ModeNo != 0x10) && (ModeNo != 0x12))
+       return(1);
+    temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x11);
+    SiS_SetRegOR(SiS_Pr->SiS_P3d4,0x11,0x80);
+    temp1 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x00);
+    SiS_SetReg(SiS_Pr->SiS_P3d4,0x00,0x55);
+    temp2 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x00);
+    SiS_SetReg(SiS_Pr->SiS_P3d4,0x00,temp1);
+    SiS_SetReg(SiS_Pr->SiS_P3d4,0x11,temp);
+    if((HwInfo->jChipType >= SIS_315H) ||
+       (HwInfo->jChipType == SIS_300)) {
+       if(temp2 == 0x55) return(0);
+       else return(1);
+    } else {
+       if(temp2 != 0x55) return(1);
+       else {
+          SiS_SetRegOR(SiS_Pr->SiS_P3d4,0x35,0x01);
+          return(0);
+       }
+    }
+}
 
-   return(SiSSetMode(SiS_Pr, HwDeviceExtension, pScrn, ModeNo, TRUE));   
+static void
+SiS_SetLowModeTest(SiS_Private *SiS_Pr, USHORT ModeNo, PSIS_HW_INFO HwInfo)
+{
+    if(SiS_DoLowModeTest(SiS_Pr, ModeNo, HwInfo)) {
+       SiS_Pr->SiS_SetFlag |= LowModeTests;
+    }
 }
 
-#ifdef SISDUALHEAD
-/* TW: Set CRT1 mode (used for dual head) */
-BOOLEAN
-SiSBIOSSetModeCRT1(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, ScrnInfoPtr pScrn,
-               DisplayModePtr mode, BOOLEAN IsCustom)
+/*********************************************/
+/*           HELPER: GetColorDepth           */
+/*********************************************/
+
+USHORT
+SiS_GetColorDepth(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex)
 {
-   ULONG   temp;
-   USHORT  ModeIdIndex;
-   UCHAR  *ROMAddr  = HwDeviceExtension->pjVirtualRomBase;
-   USHORT  BaseAddr = (USHORT)HwDeviceExtension->ulIOAddress;
-   SISPtr  pSiS = SISPTR(pScrn);
-   SISEntPtr pSiSEnt = pSiS->entityPrivate;
-   unsigned char backupreg=0;
-   BOOLEAN backupcustom;
+  USHORT ColorDepth[6] = { 1, 2, 4, 4, 6, 8};
+  SHORT  index;
+  USHORT modeflag;
 
-   UShort  ModeNo=0;
-   
-   SiS_Pr->UseCustomMode = FALSE;
-   
-   if((IsCustom) && (SiS_CheckBuildCustomMode(pScrn, mode, pSiS->VBFlags))) {
-   
-         xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3,
-	 	"Setting custom mode %dx%d in CRT1\n", 
-	 	SiS_Pr->CHDisplay, SiS_Pr->CVDisplay);
-	 ModeNo = 0xfe;
-	 
-   } else {
+  /* Do NOT check UseCustomMode, will skrew up FIFO */
+  if(ModeNo == 0xfe) {
+     modeflag = SiS_Pr->CModeFlag;
+  } else {
+     if(ModeNo <= 0x13)
+    	modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
+     else
+    	modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
+  }
 
-         ModeNo = SiS_CalcModeIndex(pScrn, mode);
-         if(!ModeNo) return FALSE;
+  index = (modeflag & ModeInfoFlag) - ModeEGA;
+  if(index < 0) index = 0;
+  return(ColorDepth[index]);
+}
 
-         xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3,
-	 	"Setting mode 0x%x on CRT1\n", ModeNo);
-   }
+/*********************************************/
+/*             HELPER: GetOffset             */
+/*********************************************/
 
-   SiSInitPtr(SiS_Pr, HwDeviceExtension);
+USHORT
+SiS_GetOffset(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdIndex,
+              USHORT RefreshRateTableIndex,PSIS_HW_INFO HwInfo)
+{
+  USHORT temp,colordepth,infoflag;
 
-   SiSRegInit(SiS_Pr, BaseAddr);
+  if(SiS_Pr->UseCustomMode) {
+     infoflag = SiS_Pr->CInfoFlag;
+     temp = SiS_Pr->CHDisplay / 16;
+  } else {
+     infoflag = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_InfoFlag;
+     temp = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeOffset;
+     temp = SiS_Pr->SiS_ScreenOffset[temp];
+  }
 
-   SiS_Pr->SiS_VGAINFO = SiS_GetSetBIOSScratch(pScrn, 0x489, 0xff);
+  colordepth = SiS_GetColorDepth(SiS_Pr,ModeNo,ModeIdIndex);
 
-   SiSInitPCIetc(SiS_Pr, HwDeviceExtension);
+  if(infoflag & InterlaceMode) temp <<= 1;
 
-   SiSSetLVDSetc(SiS_Pr, HwDeviceExtension, ModeNo);
+  temp *= colordepth;
 
-   SiSDetermineROMUsage(SiS_Pr, HwDeviceExtension, ROMAddr);
+  if( ( ((ModeNo >= 0x26) && (ModeNo <= 0x28)) ||
+        ModeNo == 0x3f ||
+	ModeNo == 0x42 ||
+	ModeNo == 0x45 ) ||
+      (SiS_Pr->UseCustomMode && (SiS_Pr->CHDisplay % 16)) ) {
+     colordepth >>= 1;
+     temp += colordepth;
+  }
 
-   /* TW: We don't clear the buffer under X */
-   SiS_Pr->SiS_flag_clearbuffer = 0;
+  return(temp);
+}
 
-   /* 1.Openkey */
-   SiS_SetReg1(SiS_Pr->SiS_P3c4,0x05,0x86);
+/*********************************************/
+/*                   SEQ                     */
+/*********************************************/
 
-   SiS_UnLockCRT2(SiS_Pr, HwDeviceExtension, BaseAddr);
+static void
+SiS_SetSeqRegs(SiS_Private *SiS_Pr, USHORT StandTableIndex, PSIS_HW_INFO HwInfo)
+{
+   UCHAR SRdata;
+   USHORT i;
 
-   if(!SiS_Pr->UseCustomMode) {
-      /* 2.Get ModeID Table  */
-      temp = SiS_SearchModeID(SiS_Pr, ROMAddr,&ModeNo,&ModeIdIndex);
-      if(temp == 0)  return(0);
-   } else {
-      ModeIdIndex = 0;
-   }
+   SiS_SetReg(SiS_Pr->SiS_P3c4,0x00,0x03);           	/* Set SR0  */
 
-   /* TW: Determine VBType (301,301B,301LV,302B,302LV) */
-   SiS_GetVBType(SiS_Pr, BaseAddr,HwDeviceExtension);
+   SRdata = SiS_Pr->SiS_StandTable[StandTableIndex].SR[0];
 
    if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
-      if(HwDeviceExtension->jChipType >= SIS_315H) {
-         backupreg = SiS_GetReg1(SiS_Pr->SiS_P3d4,0x38);
-      } else {
-         backupreg = SiS_GetReg1(SiS_Pr->SiS_P3d4,0x35);
+      if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) {
+         SRdata |= 0x01;
+      }
+      if(HwInfo->jChipType >= SIS_661) {
+         if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToTV)) {
+	    if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) {
+               SRdata |= 0x01;          		/* 8 dot clock  */
+            }
+	 }
+      } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
+         if(SiS_Pr->SiS_VBType & VB_NoLCD) {
+	    if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) {
+               SRdata |= 0x01;          		/* 8 dot clock  */
+            }
+	 }
       }
    }
 
-   /* TW: Get VB information (connectors, connected devices) */
-   /* (We don't care if the current mode is a CRT2 mode) */
-   SiS_GetVBInfo(SiS_Pr, BaseAddr,ROMAddr,ModeNo,ModeIdIndex,HwDeviceExtension,0);
-   SiS_SetHiVision(SiS_Pr, BaseAddr,HwDeviceExtension);
-   SiS_GetLCDResInfo(SiS_Pr, ROMAddr,ModeNo,ModeIdIndex,HwDeviceExtension);
-
-   if(HwDeviceExtension->jChipType >= SIS_315H) {
-      if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
-         if(SiS_GetReg1(SiS_Pr->SiS_P3c4,0x17) & 0x08)  {
-            if(ModeNo != 0x10)  SiS_Pr->SiS_SetFlag |= SetDOSMode;
+   if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
+      if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) {
+         if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
+            if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) {
+               SRdata |= 0x01;        			/* 8 dot clock  */
+            }
          }
       }
-
-      /* TW: New from 650/LV 1.10.6x */
-      if(IS_SIS650) {
-          if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
-	      SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x51,0x1f);
-	      SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x56,0xe7);
-	  }
+      if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
+         if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) {
+            SRdata |= 0x01;          			/* 8 dot clock  */
+         }
       }
    }
 
-   /* TW: Set mode on CRT1 */
-   SiS_SetCRT1Group(SiS_Pr, ROMAddr,HwDeviceExtension,ModeNo,ModeIdIndex,BaseAddr);
-
-   pSiSEnt->CRT1ModeNo = ModeNo;
-   pSiSEnt->CRT1DMode = mode;
-
-   /* TW: SetPitch: Adapt to virtual size & position */
-   SiS_SetPitchCRT1(SiS_Pr, pScrn, BaseAddr);
-
-   /* We have to reset CRT2 if changing mode on CRT1 */
-   if(pSiSEnt->CRT2ModeNo != -1) {
-        xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3,
-				"(Re-)Setting mode 0x%x on CRT2\n",
-				pSiSEnt->CRT2ModeNo);
-	backupcustom = SiS_Pr->UseCustomMode;
-	if(SiS_Pr->UseCustomMode) {
-	   SiS_Pr->CRT1UsesCustomMode = TRUE;
-	} else {
-	   SiS_Pr->CRT1UsesCustomMode = FALSE;
-	}
-	SiSBIOSSetModeCRT2(SiS_Pr, HwDeviceExtension, pSiSEnt->pScrn_1,
-				pSiSEnt->CRT2DMode);
-	SiS_Pr->UseCustomMode = backupcustom;
-	SiS_Pr->CRT1UsesCustomMode = FALSE;
-   }
-   
-   SiS_HandleCRT1(SiS_Pr);
+   SRdata |= 0x20;                			/* screen off  */
 
-   SiS_DisplayOn(SiS_Pr);
-   SiS_SetReg3(SiS_Pr->SiS_P3c6,0xFF);
+   SiS_SetReg(SiS_Pr->SiS_P3c4,0x01,SRdata);
 
-   /* TW: New from 650/LV 1.10.6x and 1.10.7w, 630/301B 2.06.50 */
-   if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
-      if(HwDeviceExtension->jChipType >= SIS_315H) {
-	 SiS_SetReg1(SiS_Pr->SiS_P3d4,0x38,backupreg);
-      } else if((HwDeviceExtension->jChipType == SIS_630) ||
-                (HwDeviceExtension->jChipType == SIS_730)) {
-         SiS_SetReg1(SiS_Pr->SiS_P3d4,0x35,backupreg);
-      }
+   for(i = 2; i <= 4; i++) {
+      SRdata = SiS_Pr->SiS_StandTable[StandTableIndex].SR[i-1];
+      SiS_SetReg(SiS_Pr->SiS_P3c4,i,SRdata);
    }
-
-   /* Backup/Set ModeNo in BIOS scratch area */
-   SiS_GetSetModeID(pScrn,ModeNo);
-
-   return TRUE;
 }
 
-/* TW: Set CRT2 mode (used for dual head) */
-BOOLEAN
-SiSBIOSSetModeCRT2(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, ScrnInfoPtr pScrn,
-               DisplayModePtr mode)
+/*********************************************/
+/*                  MISC                     */
+/*********************************************/
+
+static void
+SiS_SetMiscRegs(SiS_Private *SiS_Pr, USHORT StandTableIndex, PSIS_HW_INFO HwInfo)
 {
-   ULONG   temp;
-   USHORT  ModeIdIndex;
-   UCHAR  *ROMAddr  = HwDeviceExtension->pjVirtualRomBase;
-   USHORT  BaseAddr = (USHORT)HwDeviceExtension->ulIOAddress;
-   UShort  ModeNo   = 0;
-   SISPtr  pSiS     = SISPTR(pScrn);
-   SISEntPtr pSiSEnt = pSiS->entityPrivate;
-   unsigned char tempr1, tempr2, backupreg=0;
-   
-   SiS_Pr->UseCustomMode = FALSE;
-   
-   ModeNo = SiS_CalcModeIndex(pScrn, mode);
-   if(!ModeNo) return FALSE;
+   UCHAR Miscdata;
 
-   SiSInitPtr(SiS_Pr, HwDeviceExtension);
+   Miscdata = SiS_Pr->SiS_StandTable[StandTableIndex].MISC;
 
-   SiSRegInit(SiS_Pr, BaseAddr);
+   if(HwInfo->jChipType < SIS_661) {
+      if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
+         if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) {
+            Miscdata |= 0x0C;
+         }
+      }
+   }
 
-   SiS_Pr->SiS_VGAINFO = SiS_GetSetBIOSScratch(pScrn, 0x489, 0xff);
+   SiS_SetRegByte(SiS_Pr->SiS_P3c2,Miscdata);
+}
 
-   SiSInitPCIetc(SiS_Pr, HwDeviceExtension);
+/*********************************************/
+/*                  CRTC                     */
+/*********************************************/
 
-   SiSSetLVDSetc(SiS_Pr, HwDeviceExtension, ModeNo);
+static void
+SiS_SetCRTCRegs(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
+                USHORT StandTableIndex)
+{
+  UCHAR CRTCdata;
+  USHORT i;
 
-   SiSDetermineROMUsage(SiS_Pr, HwDeviceExtension, ROMAddr);
+  SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x11,0x7f);                       /* Unlock CRTC */
 
-   /* TW: We don't clear the buffer under X */
-   SiS_Pr->SiS_flag_clearbuffer=0;
+  for(i = 0; i <= 0x18; i++) {
+     CRTCdata = SiS_Pr->SiS_StandTable[StandTableIndex].CRTC[i];
+     SiS_SetReg(SiS_Pr->SiS_P3d4,i,CRTCdata);                     /* Set CRTC(3d4) */
+  }
+  if( ( (HwInfo->jChipType == SIS_630) ||
+        (HwInfo->jChipType == SIS_730) )  &&
+      (HwInfo->jChipRevision >= 0x30) ) {       	   /* for 630S0 */
+     if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) {
+        if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToTV)) {
+           SiS_SetReg(SiS_Pr->SiS_P3d4,0x18,0xFE);
+        }
+     }
+  }
+}
 
-   /* TW: Save ModeNo so we can set it from within SetMode for CRT1 */
-   pSiSEnt->CRT2ModeNo = ModeNo;
-   pSiSEnt->CRT2DMode = mode;
-
-   /* TW: We can't set CRT2 mode before CRT1 mode is set */
-   if(pSiSEnt->CRT1ModeNo == -1) {
-   	xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3,
-		"Setting CRT2 mode delayed until after setting CRT1 mode\n");
-   	return TRUE;
-   }
+/*********************************************/
+/*                   ATT                     */
+/*********************************************/
 
-   xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3,
-   		"Setting mode 0x%x on CRT2\n", ModeNo);
+static void
+SiS_SetATTRegs(SiS_Private *SiS_Pr, USHORT StandTableIndex,
+               PSIS_HW_INFO HwInfo)
+{
+   UCHAR ARdata;
+   USHORT i;
 
-   /* 1.Openkey */
-   SiS_SetReg1(SiS_Pr->SiS_P3c4,0x05,0x86);
+   for(i = 0; i <= 0x13; i++) {
+      ARdata = SiS_Pr->SiS_StandTable[StandTableIndex].ATTR[i];
+#if 0
+      if((i <= 0x0f) || (i == 0x11)) {
+         if(ds:489 & 0x08) {
+	    continue;
+         }
+      }
+#endif
+      if(i == 0x13) {
+         /* Pixel shift. If screen on LCD or TV is shifted left or right,
+          * this might be the cause.
+          */
+         if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
+            if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)  ARdata=0;
+         }
+         if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
+            if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) {
+               if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
+                  if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) ARdata=0;
+               }
+            }
+         }
+	 if(HwInfo->jChipType >= SIS_661) {
+	    if(SiS_Pr->SiS_VBInfo & (SetCRT2ToTV | SetCRT2ToLCD)) {
+	       if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) ARdata=0;
+	    }
+	 } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
+            if(HwInfo->jChipType >= SIS_315H) {
+	       if(IS_SIS550650740660) {
+	          /* 315, 330 don't do this */
+	          if(SiS_Pr->SiS_VBType & VB_SIS301B302B) {
+	             if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) ARdata=0;
+	          } else {
+	             ARdata = 0;
+	          }
+	       }
+	    } else {
+               if(SiS_Pr->SiS_VBInfo & SetInSlaveMode)  ARdata=0;
+	    }
+         }
+      }
+      SiS_GetRegByte(SiS_Pr->SiS_P3da);                         /* reset 3da  */
+      SiS_SetRegByte(SiS_Pr->SiS_P3c0,i);                       /* set index  */
+      SiS_SetRegByte(SiS_Pr->SiS_P3c0,ARdata);                  /* set data   */
+   }
+   SiS_GetRegByte(SiS_Pr->SiS_P3da);                            /* reset 3da  */
+   SiS_SetRegByte(SiS_Pr->SiS_P3c0,0x14);                       /* set index  */
+   SiS_SetRegByte(SiS_Pr->SiS_P3c0,0x00);                       /* set data   */
+
+   SiS_GetRegByte(SiS_Pr->SiS_P3da);
+   SiS_SetRegByte(SiS_Pr->SiS_P3c0,0x20);			/* Enable Attribute  */
+   SiS_GetRegByte(SiS_Pr->SiS_P3da);
+}
+
+/*********************************************/
+/*                   GRC                     */
+/*********************************************/
 
-   SiS_UnLockCRT2(SiS_Pr, HwDeviceExtension, BaseAddr);
+static void
+SiS_SetGRCRegs(SiS_Private *SiS_Pr, USHORT StandTableIndex)
+{
+   UCHAR GRdata;
+   USHORT i;
 
-   /* 2.Get ModeID */
-   temp = SiS_SearchModeID(SiS_Pr, ROMAddr,&ModeNo,&ModeIdIndex);
-   if(temp == 0)  return(0);
+   for(i = 0; i <= 0x08; i++) {
+      GRdata = SiS_Pr->SiS_StandTable[StandTableIndex].GRC[i];
+      SiS_SetReg(SiS_Pr->SiS_P3ce,i,GRdata);
+   }
 
-   /* TW: Determine VBType (301,301B,301LV,302B,302LV) */
-   SiS_GetVBType(SiS_Pr, BaseAddr,HwDeviceExtension);
+   if(SiS_Pr->SiS_ModeType > ModeVGA) {
+      /* 256 color disable */
+      SiS_SetRegAND(SiS_Pr->SiS_P3ce,0x05,0xBF);
+   }
+}
 
-   if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
-      if(HwDeviceExtension->jChipType >= SIS_315H) {
-         SiS_UnLockCRT2(SiS_Pr,HwDeviceExtension,BaseAddr);
-	 if(HwDeviceExtension->jChipType < SIS_330) {
-           if(ROMAddr && SiS_Pr->SiS_UseROM) {
-             temp = ROMAddr[VB310Data_1_2_Offset];
-	     temp |= 0x40;
-             SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x02,temp);
-           }
-	 }
-	 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x32,0x10);
+/*********************************************/
+/*          CLEAR EXTENDED REGISTERS         */
+/*********************************************/
 
-	 SiS_SetRegOR(SiS_Pr->SiS_Part2Port,0x02,0x0c);
+static void
+SiS_ClearExt1Regs(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
+{
+  USHORT i;
 
-         backupreg = SiS_GetReg1(SiS_Pr->SiS_P3d4,0x38);
-      } else {
-         backupreg = SiS_GetReg1(SiS_Pr->SiS_P3d4,0x35);
-      }
-   }
+  for(i = 0x0A; i <= 0x0E; i++) {
+     SiS_SetReg(SiS_Pr->SiS_P3c4,i,0x00);
+  }
+
+  if(HwInfo->jChipType >= SIS_315H) {
+     SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x37,0xFE);
+  }
+}
 
-   /* TW: Get VB information (connectors, connected devices) */
-   SiS_GetVBInfo(SiS_Pr, BaseAddr,ROMAddr,ModeNo,ModeIdIndex,HwDeviceExtension,1);
-   SiS_SetHiVision(SiS_Pr, BaseAddr,HwDeviceExtension);
-   SiS_GetLCDResInfo(SiS_Pr, ROMAddr,ModeNo,ModeIdIndex,HwDeviceExtension);
+/*********************************************/
+/*                 RESET VCLK                */
+/*********************************************/
 
-   if(HwDeviceExtension->jChipType >= SIS_315H) {
-      if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
-         if(SiS_GetReg1(SiS_Pr->SiS_P3c4,0x17) & 0x08)  {
-            if(ModeNo != 0x10)  SiS_Pr->SiS_SetFlag |= SetDOSMode;
-         }
+static void
+SiS_ResetCRT1VCLK(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
+{
+   if(HwInfo->jChipType >= SIS_315H) {
+      if(HwInfo->jChipType < SIS_661) {
+         if(SiS_Pr->SiS_IF_DEF_LVDS == 0) return;
+      }
+   } else {
+      if((SiS_Pr->SiS_IF_DEF_LVDS == 0) &&
+         (!(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV)) ) {
+	 return;
       }
    }
 
-   /* Set mode on CRT2 */
-   switch (HwDeviceExtension->ujVBChipID) {
-     case VB_CHIP_301:
-     case VB_CHIP_301B:
-     case VB_CHIP_301LV:
-     case VB_CHIP_302:
-     case VB_CHIP_302B:
-     case VB_CHIP_302LV:
-        SiS_SetCRT2Group301(SiS_Pr, BaseAddr,ROMAddr,ModeNo,HwDeviceExtension);
-        break;
-     case VB_CHIP_UNKNOWN:
-        if (SiS_Pr->SiS_IF_DEF_LVDS     == 1 ||
-	    SiS_Pr->SiS_IF_DEF_CH70xx   != 0 ||
-	    SiS_Pr->SiS_IF_DEF_TRUMPION != 0) {
-             	SiS_SetCRT2Group301(SiS_Pr,BaseAddr,ROMAddr,ModeNo,HwDeviceExtension);
-  	}
-        break;
+   if(HwInfo->jChipType >= SIS_315H) {
+      SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x31,0xCF,0x20);
+   } else {
+      SiS_SetReg(SiS_Pr->SiS_P3c4,0x31,0x20);
+   }
+   SiS_SetReg(SiS_Pr->SiS_P3c4,0x2B,SiS_Pr->SiS_VCLKData[1].SR2B);
+   SiS_SetReg(SiS_Pr->SiS_P3c4,0x2C,SiS_Pr->SiS_VCLKData[1].SR2C);
+   SiS_SetReg(SiS_Pr->SiS_P3c4,0x2D,0x80);
+   if(HwInfo->jChipType >= SIS_315H) {
+      SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x31,0xcf,0x10);
+   } else {
+      SiS_SetReg(SiS_Pr->SiS_P3c4,0x31,0x10);
    }
+   SiS_SetReg(SiS_Pr->SiS_P3c4,0x2B,SiS_Pr->SiS_VCLKData[0].SR2B);
+   SiS_SetReg(SiS_Pr->SiS_P3c4,0x2C,SiS_Pr->SiS_VCLKData[0].SR2C);
+   SiS_SetReg(SiS_Pr->SiS_P3c4,0x2D,0x80);
+}
 
-   SiS_DisplayOn(SiS_Pr);
-   SiS_SetReg3(SiS_Pr->SiS_P3c6,0xFF);
+/*********************************************/
+/*                  SYNC                     */
+/*********************************************/
 
-   if(HwDeviceExtension->jChipType >= SIS_315H) {
-      if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
-         if(!(SiS_IsDualEdge(SiS_Pr, HwDeviceExtension, BaseAddr))) {
-	     SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x13,0xfb);
-	 }
-      }
-   }
+static void
+SiS_SetCRT1Sync(SiS_Private *SiS_Pr, USHORT RefreshRateTableIndex)
+{
+  USHORT sync;
 
-   /* TW: New from 650/LV 1.10.6x and 1.10.7w, 630 2.06.50 */
-   if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
-      if(HwDeviceExtension->jChipType >= SIS_315H) {
-	 if(SiS_IsVAMode(SiS_Pr,HwDeviceExtension, BaseAddr)) {
-	     SiS_SetRegOR(SiS_Pr->SiS_P3d4,0x35,0x01);
-	 } else {
-	     SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x35,0xFE);
-	 }
+  if(SiS_Pr->UseCustomMode) {
+     sync = SiS_Pr->CInfoFlag >> 8;
+  } else {
+     sync = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_InfoFlag >> 8;
+  }
 
-	 SiS_SetReg1(SiS_Pr->SiS_P3d4,0x38,backupreg);
+  sync &= 0xC0;
+  sync |= 0x2f;
+  SiS_SetRegByte(SiS_Pr->SiS_P3c2,sync);
+}
 
-	 tempr1 = SiS_GetReg1(SiS_Pr->SiS_P3d4,0x30);
-	 tempr2 = SiS_GetReg1(SiS_Pr->SiS_Part2Port,0x00);
-	 if(tempr1 & SetCRT2ToAVIDEO) tempr2 &= 0xF7;
-	 if(tempr1 & SetCRT2ToSVIDEO) tempr2 &= 0xFB;
-	 SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x00,tempr2);
+/*********************************************/
+/*                  CRTC/2                   */
+/*********************************************/
 
-	 if(tempr1 & SetCRT2ToLCD) {
-	       SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x38,0xfc);
-	 }
-      } else if((HwDeviceExtension->jChipType == SIS_630) ||
-                (HwDeviceExtension->jChipType == SIS_730)) {
-         SiS_SetReg1(SiS_Pr->SiS_P3d4,0x35,backupreg);
-      }
-   }
+#ifdef SIS315H
+static void
+SiS_GetLCDACRT1Ptr(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
+		   USHORT RefreshRateTableIndex, USHORT *ResIndex,
+		   USHORT *DisplayType)
+ {
+  USHORT modeflag = 0;
+
+  if(ModeNo <= 0x13) {
+     modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
+     *ResIndex = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC;
+  } else {
+     modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
+     *ResIndex = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC;
+  }
 
-   /* TW: SetPitch: Adapt to virtual size & position */
-   SiS_SetPitchCRT2(SiS_Pr, pScrn, BaseAddr);
+  *ResIndex &= 0x3F;
 
-   return TRUE;
-}
-#endif /* Dualhead */
-#endif /* Linux_XF86 */
+  *DisplayType = SiS_Pr->SiS_LCDResInfo;
+  if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) *DisplayType += 32;
+  if(modeflag & HalfDCLK)                 *DisplayType += 16;
 
-#ifdef LINUX_XF86
-/* TW: We need pScrn for setting the pitch correctly */
-BOOLEAN
-SiSSetMode(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,ScrnInfoPtr pScrn,USHORT ModeNo, BOOLEAN dosetpitch)
-#else
-BOOLEAN
-SiSSetMode(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT ModeNo)
+  if(SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) {
+     if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) {
+        *DisplayType = 100;
+	if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) *DisplayType += 2;
+        if(modeflag & HalfDCLK)                 *DisplayType += 1;
+     }
+  } else if(SiS_Pr->SiS_CustomT == CUT_CLEVO1024) {
+     if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) {
+        *DisplayType = 104;
+	if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) *DisplayType += 2;
+        if(modeflag & HalfDCLK)                 *DisplayType += 1;
+     }
+  }
+
+}
 #endif
-{
-   ULONG   temp;
-   USHORT  ModeIdIndex,KeepLockReg;
-   UCHAR  *ROMAddr  = HwDeviceExtension->pjVirtualRomBase;
-   USHORT  BaseAddr = (USHORT)HwDeviceExtension->ulIOAddress;
-   unsigned char backupreg=0, tempr1, tempr2;
 
-#ifndef LINUX_XF86
-   SiS_Pr->UseCustomMode = FALSE;
-   SiS_Pr->CRT1UsesCustomMode = FALSE;
+static void
+SiS_SetCRT1CRTC(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
+                USHORT RefreshRateTableIndex,
+		PSIS_HW_INFO HwInfo)
+{
+  UCHAR  index;
+  USHORT temp,i,j,modeflag;
+#ifdef SIS315H
+  USHORT ResIndex,DisplayType;
+  const SiS_LCDACRT1DataStruct *LCDACRT1Ptr = NULL;
 #endif
-   
-   if(SiS_Pr->UseCustomMode) {
-      ModeNo = 0xfe;
-   }      
-   
-   SiSInitPtr(SiS_Pr, HwDeviceExtension);
 
-   SiSRegInit(SiS_Pr, BaseAddr);
+  SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x11,0x7f);		/* unlock cr0-7 */
 
-#ifdef LINUX_XF86
-   if(pScrn) SiS_Pr->SiS_VGAINFO = SiS_GetSetBIOSScratch(pScrn, 0x489, 0xff);
-   else
-#endif
-         SiS_Pr->SiS_VGAINFO = 0x11;
+  if(SiS_Pr->UseCustomMode) {
 
-#ifdef LINUX_XF86
-#ifdef TWDEBUG
-   xf86DrvMsg(0, X_INFO, "VGAInfo 0x%02x\n", SiS_Pr->SiS_VGAINFO);
-#endif
-#endif	 	 
+     modeflag = SiS_Pr->CModeFlag;
 
-   SiSInitPCIetc(SiS_Pr, HwDeviceExtension);
+     for(i=0,j=0;i<=07;i++,j++) {
+        SiS_SetReg(SiS_Pr->SiS_P3d4,j,SiS_Pr->CCRT1CRTC[i]);
+     }
+     for(j=0x10;i<=10;i++,j++) {
+        SiS_SetReg(SiS_Pr->SiS_P3d4,j,SiS_Pr->CCRT1CRTC[i]);
+     }
+     for(j=0x15;i<=12;i++,j++) {
+        SiS_SetReg(SiS_Pr->SiS_P3d4,j,SiS_Pr->CCRT1CRTC[i]);
+     }
+     for(j=0x0A;i<=15;i++,j++) {
+        SiS_SetReg(SiS_Pr->SiS_P3c4,j,SiS_Pr->CCRT1CRTC[i]);
+     }
 
-   SiSSetLVDSetc(SiS_Pr, HwDeviceExtension, ModeNo);
+     temp = SiS_Pr->CCRT1CRTC[16] & 0xE0;
+     SiS_SetReg(SiS_Pr->SiS_P3c4,0x0E,temp);
 
-   SiSDetermineROMUsage(SiS_Pr, HwDeviceExtension, ROMAddr);
+     temp = (SiS_Pr->CCRT1CRTC[16] & 0x01) << 5;
+     if(modeflag & DoubleScanMode) temp |= 0x80;
+     SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x09,0xDF,temp);
 
-   if(!SiS_Pr->UseCustomMode) {
-      /* TW: Shift the clear-buffer-bit away */
-      ModeNo = ((ModeNo & 0x80) << 8) | (ModeNo & 0x7f);
-   }      
+  } else {
 
-#ifdef LINUX_XF86
-   /* TW: We never clear the buffer in X */
-   ModeNo |= 0x8000;
-#endif
+     if(ModeNo <= 0x13) {
+        modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
+     } else {
+        modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
+     }
 
-   if(ModeNo & 0x8000) {
-     	ModeNo &= 0x7fff;
-     	SiS_Pr->SiS_flag_clearbuffer = 0;
-   } else {
-     	SiS_Pr->SiS_flag_clearbuffer = 1;
-   }
+     if((SiS_Pr->SiS_VBType & VB_SISVB) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) {
 
-   /* 1.Openkey */
-   KeepLockReg = SiS_GetReg1(SiS_Pr->SiS_P3c4,0x05);
-   SiS_SetReg1(SiS_Pr->SiS_P3c4,0x05,0x86);
+#ifdef SIS315H
 
-   SiS_UnLockCRT2(SiS_Pr, HwDeviceExtension, BaseAddr);
+        SiS_GetLCDACRT1Ptr(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, &ResIndex, &DisplayType);
 
-   if(!SiS_Pr->UseCustomMode) {
-   
-      /* 2.Get ModeID Table  */
-      temp = SiS_SearchModeID(SiS_Pr,ROMAddr,&ModeNo,&ModeIdIndex);
-      if(temp == 0) return(0);
-      
-   } else {
-   
-      ModeIdIndex = 0;
-      
-   }
-    
-   /* TW: Determine VBType (301,301B,301LV,302B,302LV) */
-   SiS_GetVBType(SiS_Pr,BaseAddr,HwDeviceExtension);
+        switch(DisplayType) {
+        case Panel_1024x768      : LCDACRT1Ptr = SiS_Pr->SiS_LCDACRT11024x768_1;     break;
+        case Panel_1280x1024     : LCDACRT1Ptr = SiS_Pr->SiS_LCDACRT11280x1024_1;    break;
+        case Panel_1400x1050     : LCDACRT1Ptr = SiS_Pr->SiS_LCDACRT11400x1050_1;    break;
+        case Panel_1600x1200     : LCDACRT1Ptr = SiS_Pr->SiS_LCDACRT11600x1200_1;    break;
+        case Panel_1024x768  + 16: LCDACRT1Ptr = SiS_Pr->SiS_LCDACRT11024x768_1_H;   break;
+        case Panel_1280x1024 + 16: LCDACRT1Ptr = SiS_Pr->SiS_LCDACRT11280x1024_1_H;  break;
+        case Panel_1400x1050 + 16: LCDACRT1Ptr = SiS_Pr->SiS_LCDACRT11400x1050_1_H;  break;
+        case Panel_1600x1200 + 16: LCDACRT1Ptr = SiS_Pr->SiS_LCDACRT11600x1200_1_H;  break;
+        case Panel_1024x768  + 32: LCDACRT1Ptr = SiS_Pr->SiS_LCDACRT11024x768_2;     break;
+        case Panel_1280x1024 + 32: LCDACRT1Ptr = SiS_Pr->SiS_LCDACRT11280x1024_2;    break;
+        case Panel_1400x1050 + 32: LCDACRT1Ptr = SiS_Pr->SiS_LCDACRT11400x1050_2;    break;
+        case Panel_1600x1200 + 32: LCDACRT1Ptr = SiS_Pr->SiS_LCDACRT11600x1200_2;    break;
+        case Panel_1024x768  + 48: LCDACRT1Ptr = SiS_Pr->SiS_LCDACRT11024x768_2_H;   break;
+        case Panel_1280x1024 + 48: LCDACRT1Ptr = SiS_Pr->SiS_LCDACRT11280x1024_2_H;  break;
+        case Panel_1400x1050 + 48: LCDACRT1Ptr = SiS_Pr->SiS_LCDACRT11400x1050_2_H;  break;
+        case Panel_1600x1200 + 48: LCDACRT1Ptr = SiS_Pr->SiS_LCDACRT11600x1200_2_H;  break;
+        case 100:	  	   LCDACRT1Ptr = Compaq1280x1024_LCDACRT1_1;         break;
+        case 101:		   LCDACRT1Ptr = Compaq1280x1024_LCDACRT1_1_H;       break;
+        case 102:		   LCDACRT1Ptr = SiS_Pr->SiS_LCDACRT11280x1024_2;    break;
+        case 103:		   LCDACRT1Ptr = SiS_Pr->SiS_LCDACRT11280x1024_2_H;  break;
+        case 104:		   LCDACRT1Ptr = Clevo1024x768_LCDACRT1_1;           break;
+        case 105:		   LCDACRT1Ptr = Clevo1024x768_LCDACRT1_1_H;         break;
+        case 106:		   LCDACRT1Ptr = Clevo1024x768_LCDACRT1_2;           break;
+        case 107:		   LCDACRT1Ptr = Clevo1024x768_LCDACRT1_2_H;         break;
+        default:                   LCDACRT1Ptr = SiS_Pr->SiS_LCDACRT11024x768_1;     break;
+        }
 
-   /* TW: Init/restore some VB registers */
-   if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
-       if(HwDeviceExtension->jChipType >= SIS_315H) {
-         SiS_UnLockCRT2(SiS_Pr,HwDeviceExtension,BaseAddr);
-	 if(HwDeviceExtension->jChipType < SIS_330) {
-           if(ROMAddr && SiS_Pr->SiS_UseROM) {
-             temp = ROMAddr[VB310Data_1_2_Offset];
-	     temp |= 0x40;
-             SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x02,temp);
-           }
-	 }
-	 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x32,0x10);
+        for(i=0, j=0; i<=0x07; i++, j++) {
+           SiS_SetReg(SiS_Pr->SiS_P3d4,i,(LCDACRT1Ptr+ResIndex)->CR[j]);
+        }
+        for(i=0x10, j=8; i<=0x12; i++, j++) {
+           SiS_SetReg(SiS_Pr->SiS_P3d4,i,(LCDACRT1Ptr+ResIndex)->CR[j]);
+        }
+        for(i=0x15, j=11; i<=0x16; i++, j++) {
+           SiS_SetReg(SiS_Pr->SiS_P3d4,i,(LCDACRT1Ptr+ResIndex)->CR[j]);
+        }
+        for(i=0x0A, j=13; i<=0x0C; i++, j++) {
+           SiS_SetReg(SiS_Pr->SiS_P3c4,i,(LCDACRT1Ptr+ResIndex)->CR[j]);
+        }
 
-	 SiS_SetRegOR(SiS_Pr->SiS_Part2Port,0x02,0x0c);
+        temp = (LCDACRT1Ptr+ResIndex)->CR[16] & 0xE0;
+        SiS_SetReg(SiS_Pr->SiS_P3c4,0x0E,temp);
 
-         backupreg = SiS_GetReg1(SiS_Pr->SiS_P3d4,0x38);
-       } else {
-         backupreg = SiS_GetReg1(SiS_Pr->SiS_P3d4,0x35);
-       }
-   }
-   
-   /* TW: Get VB information (connectors, connected devices) */
-   SiS_GetVBInfo(SiS_Pr,BaseAddr,ROMAddr,ModeNo,ModeIdIndex,HwDeviceExtension,1);
-   SiS_SetHiVision(SiS_Pr,BaseAddr,HwDeviceExtension);
-   SiS_GetLCDResInfo(SiS_Pr,ROMAddr,ModeNo,ModeIdIndex,HwDeviceExtension);
+        temp = ((LCDACRT1Ptr+ResIndex)->CR[16] & 0x01) << 5;
+        if(modeflag & DoubleScanMode) temp |= 0x80;
+        SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x09,0xDF,temp);
 
-   /* 3. Check memory size */
-   temp = SiS_CheckMemorySize(SiS_Pr,ROMAddr,HwDeviceExtension,ModeNo,ModeIdIndex);
-   if(!temp) return(0);
+#endif
 
-   if(HwDeviceExtension->jChipType >= SIS_315H) {
-      if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
-         if(SiS_GetReg1(SiS_Pr->SiS_P3c4,0x17) & 0x08)  {
-            if(ModeNo != 0x10)  SiS_Pr->SiS_SetFlag |= SetDOSMode;
-         }
-      }
+     } else {
 
-      /* TW: New from 650/LV 1.10.6x; not in any BIOS for other chipsets */
-      if(IS_SIS650) {
-          if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
-	      SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x51,0x1f);
-	      SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x56,0xe7);
-	  }
-      }
-   }
+        index = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT1CRTC;
 
-   /* TW: Set mode on CRT1 */
-   if(SiS_Pr->SiS_VBInfo & (SetSimuScanMode | SetCRT2ToLCDA)) {
-   	SiS_SetCRT1Group(SiS_Pr,ROMAddr,HwDeviceExtension,ModeNo,ModeIdIndex,BaseAddr);
-   } else {
-     if(!(SiS_Pr->SiS_VBInfo & SwitchToCRT2)) {
-       	SiS_SetCRT1Group(SiS_Pr,ROMAddr,HwDeviceExtension,ModeNo,ModeIdIndex,BaseAddr);
-     }
-   }
+        for(i=0,j=0;i<=07;i++,j++) {
+          SiS_SetReg(SiS_Pr->SiS_P3d4,j,SiS_Pr->SiS_CRT1Table[index].CR[i]);
+        }
+        for(j=0x10;i<=10;i++,j++) {
+          SiS_SetReg(SiS_Pr->SiS_P3d4,j,SiS_Pr->SiS_CRT1Table[index].CR[i]);
+        }
+        for(j=0x15;i<=12;i++,j++) {
+          SiS_SetReg(SiS_Pr->SiS_P3d4,j,SiS_Pr->SiS_CRT1Table[index].CR[i]);
+        }
+        for(j=0x0A;i<=15;i++,j++) {
+          SiS_SetReg(SiS_Pr->SiS_P3c4,j,SiS_Pr->SiS_CRT1Table[index].CR[i]);
+        }
 
-   /* TW: Set mode on CRT2 */
-   if(SiS_Pr->SiS_VBInfo & (SetSimuScanMode | SwitchToCRT2 | SetCRT2ToLCDA)) {
-     switch (HwDeviceExtension->ujVBChipID) {
-     case VB_CHIP_301:
-     case VB_CHIP_301B:
-     case VB_CHIP_301LV:
-     case VB_CHIP_302:
-     case VB_CHIP_302B:
-     case VB_CHIP_302LV:
-        SiS_SetCRT2Group301(SiS_Pr,BaseAddr,ROMAddr,ModeNo,HwDeviceExtension);
-        break;
-     case VB_CHIP_UNKNOWN:
-	if(SiS_Pr->SiS_IF_DEF_LVDS     == 1 ||
-	   SiS_Pr->SiS_IF_DEF_CH70xx   != 0 ||
-	   SiS_Pr->SiS_IF_DEF_TRUMPION != 0)
-             	SiS_SetCRT2Group301(SiS_Pr,BaseAddr,ROMAddr,ModeNo,HwDeviceExtension);
-        break;
-     }
-   }
-   
-   SiS_HandleCRT1(SiS_Pr);
-   
-   SiS_DisplayOn(SiS_Pr);
-   SiS_SetReg3(SiS_Pr->SiS_P3c6,0xFF);
+        temp = SiS_Pr->SiS_CRT1Table[index].CR[16] & 0xE0;
+        SiS_SetReg(SiS_Pr->SiS_P3c4,0x0E,temp);
 
-   if(HwDeviceExtension->jChipType >= SIS_315H) {
-      if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
-         if(!(SiS_IsDualEdge(SiS_Pr, HwDeviceExtension, BaseAddr))) {
-	     SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x13,0xfb);
-	 }
-      }
-   }
+        temp = ((SiS_Pr->SiS_CRT1Table[index].CR[16]) & 0x01) << 5;
+        if(modeflag & DoubleScanMode)  temp |= 0x80;
+        SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x09,0xDF,temp);
 
-   /* TW: New from 650/LV 1.10.6x and 1.10.7w */
-   if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
-      if(HwDeviceExtension->jChipType >= SIS_315H) {
-	 if(SiS_IsVAMode(SiS_Pr,HwDeviceExtension, BaseAddr)) {
-	     SiS_SetRegOR(SiS_Pr->SiS_P3d4,0x35,0x01);
-	 } else {
-	     SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x35,0xFE);
-	 }
+     }
+  }
 
-	 SiS_SetReg1(SiS_Pr->SiS_P3d4,0x38,backupreg);
+  if(SiS_Pr->SiS_ModeType > ModeVGA) SiS_SetReg(SiS_Pr->SiS_P3d4,0x14,0x4F);
+}
 
-	 tempr1 = SiS_GetReg1(SiS_Pr->SiS_P3d4,0x30);
-	 tempr2 = SiS_GetReg1(SiS_Pr->SiS_Part2Port,0x00);
-	 if(tempr1 & SetCRT2ToAVIDEO) tempr2 &= 0xF7;
-	 if(tempr1 & SetCRT2ToSVIDEO) tempr2 &= 0xFB;
-	 SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x00,tempr2);
+/*********************************************/
+/*               OFFSET & PITCH              */
+/*********************************************/
+/*  (partly overruled by SetPitch() in XF86) */
+/*********************************************/
 
-	 if((IS_SIS650) && (SiS_GetReg1(SiS_Pr->SiS_P3d4,0x30) & 0xfc)) {
-	    if((ModeNo == 0x03) || (ModeNo == 0x10)) {
-	        SiS_SetRegOR(SiS_Pr->SiS_P3d4,0x51,0x80);
-	        SiS_SetRegOR(SiS_Pr->SiS_P3d4,0x56,0x08);
-            }
-	 }
+static void
+SiS_SetCRT1Offset(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
+                  USHORT RefreshRateTableIndex,
+		  PSIS_HW_INFO HwInfo)
+{
+   USHORT temp, DisplayUnit, infoflag;
 
-	 if(tempr1 & SetCRT2ToLCD) {
-	       SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x38,0xfc);
-	 }
-      } else if((HwDeviceExtension->jChipType == SIS_630) ||
-                (HwDeviceExtension->jChipType == SIS_730)) {
-         SiS_SetReg1(SiS_Pr->SiS_P3d4,0x35,backupreg);
-      }
+   if(SiS_Pr->UseCustomMode) {
+      infoflag = SiS_Pr->CInfoFlag;
+   } else {
+      infoflag = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_InfoFlag;
    }
 
-#ifdef LINUX_XF86
-   if(pScrn) {
-      /* TW: SetPitch: Adapt to virtual size & position */
-      if((ModeNo > 0x13) && (dosetpitch)) {
-         SiS_SetPitch(SiS_Pr, pScrn, BaseAddr);
-      }
+   DisplayUnit = SiS_GetOffset(SiS_Pr,ModeNo,ModeIdIndex,
+                     	       RefreshRateTableIndex,HwInfo);
 
-      /* Backup/Set ModeNo in BIOS scratch area */
-      SiS_GetSetModeID(pScrn, ModeNo);
-   }
-#endif
+   temp = (DisplayUnit >> 8) & 0x0f;
+   SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x0E,0xF0,temp);
 
-#ifndef LINUX_XF86  /* TW: We never lock registers in XF86 */
-   if(KeepLockReg == 0xA1) SiS_SetReg1(SiS_Pr->SiS_P3c4,0x05,0x86);
-   else SiS_SetReg1(SiS_Pr->SiS_P3c4,0x05,0x00);
-#endif
+   temp = DisplayUnit & 0xFF;
+   SiS_SetReg(SiS_Pr->SiS_P3d4,0x13,temp);
 
-   return TRUE;
-}
+   if(infoflag & InterlaceMode) DisplayUnit >>= 1;
 
-void
-SiS_SetEnableDstn(SiS_Private *SiS_Pr)	/* TW: Called from sis_main.c */
-{
-   /* For 550 dstn */
-   SiS_Pr->SiS_IF_DEF_DSTN = 1;
+   DisplayUnit <<= 5;
+   temp = (DisplayUnit & 0xff00) >> 8;
+   if (DisplayUnit & 0xff) temp++;
+   temp++;
+   SiS_SetReg(SiS_Pr->SiS_P3c4,0x10,temp);
 }
 
-void
-SiS_HandleCRT1(SiS_Private *SiS_Pr)
+/*********************************************/
+/*                  VCLK                     */
+/*********************************************/
+
+static void
+SiS_SetCRT1VCLK(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
+                PSIS_HW_INFO HwInfo, USHORT RefreshRateTableIndex)
 {
-  /* TW: We don't do this at all. There is a new
-   * CRT1-is-connected-at-boot-time logic in the 650 BIOS, which
-   * confuses our own. So just clear the bit and skip the rest.
-   */
+  USHORT  index=0, clka, clkb;
 
-  SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x63,0xbf);
+  if(SiS_Pr->UseCustomMode) {
+     clka = SiS_Pr->CSR2B;
+     clkb = SiS_Pr->CSR2C;
+  } else {
+     index = SiS_GetVCLK2Ptr(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, HwInfo);
+     if((SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) {
+        clka = SiS_Pr->SiS_VBVCLKData[index].Part4_A;
+	clkb = SiS_Pr->SiS_VBVCLKData[index].Part4_B;
+     } else {
+        clka = SiS_Pr->SiS_VCLKData[index].SR2B;
+	clkb = SiS_Pr->SiS_VCLKData[index].SR2C;
+     }
+  }
 
-#if 0
-  if(!(SiS_GetReg1(SiS_Pr->SiS_P3c4,0x15) & 0x01))
-     SiS_SetRegOR(SiS_Pr->SiS_P3d4,0x63,0x40);
+  if(HwInfo->jChipType >= SIS_315H) {
+     SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x31,0xCF);
+  } else {
+     SiS_SetReg(SiS_Pr->SiS_P3c4,0x31,0x00);
   }
-#endif
-}
 
-void
-SiS_SetCRT1Group(SiS_Private *SiS_Pr, UCHAR *ROMAddr,PSIS_HW_DEVICE_INFO HwDeviceExtension,
-                 USHORT ModeNo,USHORT ModeIdIndex,USHORT BaseAddr)
-{
-  USHORT  StandTableIndex,RefreshRateTableIndex;
+  SiS_SetReg(SiS_Pr->SiS_P3c4,0x2B,clka);
+  SiS_SetReg(SiS_Pr->SiS_P3c4,0x2C,clkb);
 
-  SiS_Pr->SiS_CRT1Mode = ModeNo;
-  StandTableIndex = SiS_GetModePtr(SiS_Pr,ROMAddr,ModeNo,ModeIdIndex);
-  if(SiS_LowModeStuff(SiS_Pr,ModeNo,HwDeviceExtension)) {
-    if(SiS_Pr->SiS_VBInfo & (SetSimuScanMode | SwitchToCRT2)) {
-       SiS_DisableBridge(SiS_Pr,HwDeviceExtension,BaseAddr);
-    }
+  if(HwInfo->jChipType >= SIS_315H) {
+     SiS_SetReg(SiS_Pr->SiS_P3c4,0x2D,0x01);
+  } else {
+     SiS_SetReg(SiS_Pr->SiS_P3c4,0x2D,0x80);
   }
+}
 
-  SiS_SetSeqRegs(SiS_Pr,ROMAddr,StandTableIndex);
-  SiS_SetMiscRegs(SiS_Pr,ROMAddr,StandTableIndex);
-  SiS_SetCRTCRegs(SiS_Pr,ROMAddr,HwDeviceExtension,StandTableIndex);
-  SiS_SetATTRegs(SiS_Pr,ROMAddr,StandTableIndex,HwDeviceExtension);
-  SiS_SetGRCRegs(SiS_Pr,ROMAddr,StandTableIndex);
-  SiS_ClearExt1Regs(SiS_Pr,HwDeviceExtension);
-  SiS_ResetCRT1VCLK(SiS_Pr,ROMAddr,HwDeviceExtension);
-
-  SiS_Pr->SiS_SelectCRT2Rate = 0;
-  SiS_Pr->SiS_SetFlag &= (~ProgrammingCRT2);
-
-#ifdef LINUX_XF86
-  xf86DrvMsgVerb(0, X_PROBED, 3, "(init: VBType=0x%04x, VBInfo=0x%04x)\n",
-                    SiS_Pr->SiS_VBType, SiS_Pr->SiS_VBInfo);
-#endif
-
-  if(SiS_Pr->SiS_VBInfo & SetSimuScanMode) {
-     if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) {
-        SiS_Pr->SiS_SetFlag |= ProgrammingCRT2;
-     }
-  }
-
-  if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) {
-	SiS_Pr->SiS_SetFlag |= ProgrammingCRT2;
-  }
-
-  RefreshRateTableIndex = SiS_GetRatePtrCRT2(SiS_Pr,ROMAddr,ModeNo,ModeIdIndex,HwDeviceExtension);
-
-  if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) {
-	SiS_Pr->SiS_SetFlag &= ~ProgrammingCRT2;
-  }
-
-  if(RefreshRateTableIndex != 0xFFFF) {
-    	SiS_SetSync(SiS_Pr,ROMAddr,RefreshRateTableIndex);
-    	SiS_SetCRT1CRTC(SiS_Pr,ROMAddr,ModeNo,ModeIdIndex,RefreshRateTableIndex,HwDeviceExtension);
-    	SiS_SetCRT1Offset(SiS_Pr,ROMAddr,ModeNo,ModeIdIndex,RefreshRateTableIndex,HwDeviceExtension);
-    	SiS_SetCRT1VCLK(SiS_Pr,ROMAddr,ModeNo,ModeIdIndex,HwDeviceExtension,RefreshRateTableIndex);
-  }
+/*********************************************/
+/*                  FIFO                     */
+/*********************************************/
 
 #ifdef SIS300
-  if(HwDeviceExtension->jChipType == SIS_300) {
-     	SiS_SetCRT1FIFO_300(SiS_Pr,ROMAddr,ModeNo,HwDeviceExtension,RefreshRateTableIndex);
-  }
-  if((HwDeviceExtension->jChipType == SIS_630) ||
-     (HwDeviceExtension->jChipType == SIS_730) ||
-     (HwDeviceExtension->jChipType == SIS_540)) {
-     	SiS_SetCRT1FIFO_630(SiS_Pr,ROMAddr,ModeNo,HwDeviceExtension,RefreshRateTableIndex);
-  }
-#endif
-#ifdef SIS315H
-  if(HwDeviceExtension->jChipType >= SIS_315H) {
-     	SiS_SetCRT1FIFO_310(SiS_Pr,ROMAddr,ModeNo,ModeIdIndex,HwDeviceExtension);
-  }
-#endif
+static USHORT
+SiS_DoCalcDelay(SiS_Private *SiS_Pr, USHORT MCLK, USHORT VCLK, USHORT colordepth, USHORT key)
+{
+  const UCHAR ThLowA[]   = { 61, 3,52, 5,68, 7,100,11,
+                             43, 3,42, 5,54, 7, 78,11,
+                             34, 3,37, 5,47, 7, 67,11 };
 
-  SiS_SetCRT1ModeRegs(SiS_Pr,ROMAddr,HwDeviceExtension,ModeNo,ModeIdIndex,RefreshRateTableIndex);
+  const UCHAR ThLowB[]   = { 81, 4,72, 6,88, 8,120,12,
+                             55, 4,54, 6,66, 8, 90,12,
+                             42, 4,45, 6,55, 8, 75,12 };
 
-  SiS_LoadDAC(SiS_Pr,HwDeviceExtension,ROMAddr,ModeNo,ModeIdIndex);
+  const UCHAR ThTiming[] = {  1, 2, 2, 3, 0, 1,  1, 2 };
 
-#ifndef LINUX_XF86
-  if(SiS_Pr->SiS_flag_clearbuffer) {
-        SiS_ClearBuffer(SiS_Pr,HwDeviceExtension,ModeNo);
-  }
-#endif
+  USHORT tempah, tempal, tempcl, tempbx, temp;
+  ULONG  longtemp;
 
-  if(!(SiS_Pr->SiS_VBInfo & (SetSimuScanMode | SwitchToCRT2 | SetCRT2ToLCDA))) {
-        SiS_LongWait(SiS_Pr);
-        SiS_DisplayOn(SiS_Pr);
+  tempah = SiS_GetReg(SiS_Pr->SiS_P3c4,0x18);
+  tempah &= 0x62;
+  tempah >>= 1;
+  tempal = tempah;
+  tempah >>= 3;
+  tempal |= tempah;
+  tempal &= 0x07;
+  tempcl = ThTiming[tempal];
+  tempbx = SiS_GetReg(SiS_Pr->SiS_P3c4,0x16);
+  tempbx >>= 6;
+  tempah = SiS_GetReg(SiS_Pr->SiS_P3c4,0x14);
+  tempah >>= 4;
+  tempah &= 0x0c;
+  tempbx |= tempah;
+  tempbx <<= 1;
+  if(key == 0) {
+     tempal = ThLowA[tempbx + 1];
+     tempal *= tempcl;
+     tempal += ThLowA[tempbx];
+  } else {
+     tempal = ThLowB[tempbx + 1];
+     tempal *= tempcl;
+     tempal += ThLowB[tempbx];
   }
+  longtemp = tempal * VCLK * colordepth;
+  temp = longtemp % (MCLK * 16);
+  longtemp /= (MCLK * 16);
+  if(temp) longtemp++;
+  return((USHORT)longtemp);
 }
 
-#ifdef LINUX_XF86
-void
-SiS_SetPitch(SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, UShort BaseAddr)
+static USHORT
+SiS_CalcDelay(SiS_Private *SiS_Pr, USHORT VCLK, USHORT colordepth, USHORT MCLK)
 {
-   SISPtr pSiS = SISPTR(pScrn);
+  USHORT tempax, tempbx;
 
-   /* TW: We need to set pitch for CRT1 if bridge is in SlaveMode, too */
-   if( (pSiS->VBFlags & DISPTYPE_DISP1) ||
-       ( (pSiS->VBFlags & VB_VIDEOBRIDGE) &&
-         ( ((pSiS->VGAEngine == SIS_300_VGA) && (SiS_GetReg1(SiS_Pr->SiS_Part1Port,0x00) & 0xa0) == 0x20) ||
-           ((pSiS->VGAEngine == SIS_315_VGA) && (SiS_GetReg1(SiS_Pr->SiS_Part1Port,0x00) & 0x50) == 0x10) ) ) ) {
-   	SiS_SetPitchCRT1(SiS_Pr, pScrn, BaseAddr);
-   }
-   if (pSiS->VBFlags & DISPTYPE_DISP2) {
-   	SiS_SetPitchCRT2(SiS_Pr, pScrn, BaseAddr);
-   }
+  tempbx = SiS_DoCalcDelay(SiS_Pr, MCLK, VCLK, colordepth, 0);
+  tempax = SiS_DoCalcDelay(SiS_Pr, MCLK, VCLK, colordepth, 1);
+  if(tempax < 4) tempax = 4;
+  tempax -= 4;
+  if(tempbx < tempax) tempbx = tempax;
+  return(tempbx);
 }
 
-void
-SiS_SetPitchCRT1(SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, UShort BaseAddr)
+static void
+SiS_SetCRT1FIFO_300(SiS_Private *SiS_Pr, USHORT ModeNo, PSIS_HW_INFO HwInfo,
+                    USHORT RefreshRateTableIndex)
 {
-    SISPtr pSiS = SISPTR(pScrn);
-    ULong  HDisplay,temp;
+  USHORT  ThresholdLow = 0;
+  USHORT  index, VCLK, MCLK, colorth=0;
+  USHORT  tempah, temp;
 
-    HDisplay = pSiS->scrnPitch / 8;
-    SiS_SetReg1(SiS_Pr->SiS_P3d4, 0x13, (HDisplay & 0xFF));
-    temp = (SiS_GetReg1(SiS_Pr->SiS_P3c4, 0x0E) & 0xF0) | (HDisplay>>8);
-    SiS_SetReg1(SiS_Pr->SiS_P3c4, 0x0E, temp);
-}
+  if(ModeNo > 0x13) {
 
-void
-SiS_SetPitchCRT2(SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, UShort BaseAddr)
-{
-    SISPtr pSiS = SISPTR(pScrn);
-    ULong  HDisplay,temp;
+     if(SiS_Pr->UseCustomMode) {
+        VCLK = SiS_Pr->CSRClock;
+     } else {
+        index = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRTVCLK;
+        index &= 0x3F;
+        VCLK = SiS_Pr->SiS_VCLKData[index].CLOCK;             /* Get VCLK  */
+     }
 
-    HDisplay = pSiS->scrnPitch / 8;
+     switch (SiS_Pr->SiS_ModeType - ModeEGA) {     /* Get half colordepth */
+        case 0 : colorth = 1; break;
+        case 1 : colorth = 1; break;
+        case 2 : colorth = 2; break;
+        case 3 : colorth = 2; break;
+        case 4 : colorth = 3; break;
+        case 5 : colorth = 4; break;
+     }
 
-    /* Unlock CRT2 */
-    if (pSiS->VGAEngine == SIS_315_VGA)
-        SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2F, 0x01);
-    else
-        SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x24, 0x01);
+     index = SiS_GetReg(SiS_Pr->SiS_P3c4,0x3A);
+     index &= 0x07;
+     MCLK = SiS_Pr->SiS_MCLKData_0[index].CLOCK;           /* Get MCLK  */
 
-    SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x07, (HDisplay & 0xFF));
-    temp = (SiS_GetReg1(SiS_Pr->SiS_Part1Port,0x09) & 0xF0) | ((HDisplay >> 8) & 0xFF);
-    SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x09, temp);
-}
-#endif
+     tempah = SiS_GetReg(SiS_Pr->SiS_P3d4,0x35);
+     tempah &= 0xc3;
+     SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x16,0x3c,tempah);
 
-void
-SiS_GetVBType(SiS_Private *SiS_Pr, USHORT BaseAddr,PSIS_HW_DEVICE_INFO HwDeviceExtension)
-{
-  USHORT flag=0, rev=0, nolcd=0;
+     do {
+        ThresholdLow = SiS_CalcDelay(SiS_Pr, VCLK, colorth, MCLK);
+        ThresholdLow++;
+        if(ThresholdLow < 0x13) break;
+        SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x16,0xfc);
+        ThresholdLow = 0x13;
+        tempah = SiS_GetReg(SiS_Pr->SiS_P3c4,0x16);
+        tempah >>= 6;
+        if(!(tempah)) break;
+        tempah--;
+        tempah <<= 6;
+        SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x16,0x3f,tempah);
+     } while(0);
 
-  SiS_Pr->SiS_VBType = 0;
+  } else ThresholdLow = 2;
 
-  if(SiS_Pr->SiS_IF_DEF_LVDS == 1) return;
+  /* Write CRT/CPU threshold low, CRT/Engine threshold high */
+  temp = (ThresholdLow << 4) | 0x0f;
+  SiS_SetReg(SiS_Pr->SiS_P3c4,0x08,temp);
 
-  flag = SiS_GetReg1(SiS_Pr->SiS_Part4Port,0x00);
+  temp = (ThresholdLow & 0x10) << 1;
+  if(ModeNo > 0x13) temp |= 0x40;
+  SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x0f,0x9f,temp);
 
-  /* TW: Illegal values not welcome... */
-  if(flag > 3) return;
+  /* What is this? */
+  SiS_SetReg(SiS_Pr->SiS_P3c4,0x3B,0x09);
 
-  rev = SiS_GetReg1(SiS_Pr->SiS_Part4Port,0x01);
+  /* Write CRT/CPU threshold high */
+  temp = ThresholdLow + 3;
+  if(temp > 0x0f) temp = 0x0f;
+  SiS_SetReg(SiS_Pr->SiS_P3c4,0x09,temp);
+}
 
-  if (flag >= 2) {
-        SiS_Pr->SiS_VBType = VB_SIS302B;
-  } else if (flag == 1) {
-        SiS_Pr->SiS_VBType = VB_SIS301;
-        if(rev >= 0xB0) {
-            	SiS_Pr->SiS_VBType = VB_SIS301B;
-		/* Check if 30xB DH version (no LCD support, use Panel Link instead) */
-    		nolcd = SiS_GetReg1(SiS_Pr->SiS_Part4Port,0x23);
-                if(!(nolcd & 0x02)) SiS_Pr->SiS_VBType |= VB_NoLCD;
-        }
-  }
-  if(SiS_Pr->SiS_VBType & (VB_SIS301B | VB_SIS302B)) {
-        if(rev >= 0xD0) {
-	        SiS_Pr->SiS_VBType &= ~(VB_SIS301B | VB_SIS302B);
-          	SiS_Pr->SiS_VBType |= VB_SIS301LV;
-		SiS_Pr->SiS_VBType &= ~(VB_NoLCD);
-		if(rev >= 0xE0) {
-		    SiS_Pr->SiS_VBType &= ~(VB_SIS301LV);
-		    SiS_Pr->SiS_VBType |= VB_SIS302LV;
-		}
-        }
+static USHORT
+SiS_CalcDelay2(SiS_Private *SiS_Pr, UCHAR key, PSIS_HW_INFO HwInfo)
+{
+  USHORT data,index;
+  const UCHAR  LatencyFactor[] = {
+   	97, 88, 86, 79, 77, 00,       /*; 64  bit    BQ=2   */
+        00, 87, 85, 78, 76, 54,       /*; 64  bit    BQ=1   */
+        97, 88, 86, 79, 77, 00,       /*; 128 bit    BQ=2   */
+        00, 79, 77, 70, 68, 48,       /*; 128 bit    BQ=1   */
+        80, 72, 69, 63, 61, 00,       /*; 64  bit    BQ=2   */
+        00, 70, 68, 61, 59, 37,       /*; 64  bit    BQ=1   */
+        86, 77, 75, 68, 66, 00,       /*; 128 bit    BQ=2   */
+        00, 68, 66, 59, 57, 37        /*; 128 bit    BQ=1   */
+  };
+  const UCHAR  LatencyFactor730[] = {
+         69, 63, 61,
+	 86, 79, 77,
+	103, 96, 94,
+	120,113,111,
+	137,130,128,    /* --- Table ends with this entry, data below */
+	137,130,128,	/* to avoid using illegal values              */
+	137,130,128,
+	137,130,128,
+	137,130,128,
+	137,130,128,
+	137,130,128,
+	137,130,128,
+	137,130,128,
+	137,130,128,
+	137,130,128,
+	137,130,128,
+  };
+
+  if(HwInfo->jChipType == SIS_730) {
+     index = ((key & 0x0f) * 3) + ((key & 0xC0) >> 6);
+     data = LatencyFactor730[index];
+  } else {
+     index = (key & 0xE0) >> 5;
+     if(key & 0x10) index +=6;
+     if(!(key & 0x01)) index += 24;
+     data = SiS_GetReg(SiS_Pr->SiS_P3c4,0x14);
+     if(data & 0x0080) index += 12;
+     data = LatencyFactor[index];
   }
+  return(data);
 }
 
-BOOLEAN
-SiS_SearchModeID(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT *ModeNo,USHORT *ModeIdIndex)
+static void
+SiS_SetCRT1FIFO_630(SiS_Private *SiS_Pr, USHORT ModeNo,
+ 		    PSIS_HW_INFO HwInfo,
+                    USHORT RefreshRateTableIndex)
 {
-   UCHAR VGAINFO = SiS_Pr->SiS_VGAINFO;
-
-   if(*ModeNo <= 0x13) {
+  USHORT  i,index,data,VCLK,MCLK,colorth=0;
+  ULONG   B,eax,bl,data2;
+  USHORT  ThresholdLow=0;
+  UCHAR   FQBQData[]= {
+  	0x01,0x21,0x41,0x61,0x81,
+        0x31,0x51,0x71,0x91,0xb1,
+        0x00,0x20,0x40,0x60,0x80,
+        0x30,0x50,0x70,0x90,0xb0,
+	0xFF
+  };
+  UCHAR   FQBQData730[]= {
+        0x34,0x74,0xb4,
+	0x23,0x63,0xa3,
+	0x12,0x52,0x92,
+	0x01,0x41,0x81,
+	0x00,0x40,0x80,
+	0xff
+  };
 
-      if((*ModeNo) <= 0x05) (*ModeNo) |= 0x01;
+  i=0;
+  if(ModeNo > 0x13) {
+    if(SiS_Pr->UseCustomMode) {
+       VCLK = SiS_Pr->CSRClock;
+    } else {
+       index = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRTVCLK;
+       index &= 0x3F;
+       VCLK = SiS_Pr->SiS_VCLKData[index].CLOCK;          /* Get VCLK  */
+    }
 
-      for(*ModeIdIndex = 0; ;(*ModeIdIndex)++) {
-         if(SiS_Pr->SiS_SModeIDTable[*ModeIdIndex].St_ModeID == (*ModeNo)) break;
-         if(SiS_Pr->SiS_SModeIDTable[*ModeIdIndex].St_ModeID == 0xFF)   return FALSE;
-      }
+    index = SiS_GetReg(SiS_Pr->SiS_P3c4,0x1A);
+    index &= 0x07;
+    MCLK = SiS_Pr->SiS_MCLKData_0[index].CLOCK;           /* Get MCLK  */
 
-      if(*ModeNo == 0x07) {
-          if(VGAINFO & 0x10) (*ModeIdIndex)++;   /* 400 lines */
-          /* else 350 lines */
-      }
-      if(*ModeNo <= 0x03) {
-         if(!(VGAINFO & 0x80)) (*ModeIdIndex)++;
-         if(VGAINFO & 0x10)    (*ModeIdIndex)++; /* 400 lines  */
-         /* else 350 lines  */
-      }
-      /* else 200 lines  */
+    data2 = SiS_Pr->SiS_ModeType - ModeEGA;	  /* Get half colordepth */
+    switch (data2) {
+        case 0 : colorth = 1; break;
+        case 1 : colorth = 1; break;
+        case 2 : colorth = 2; break;
+        case 3 : colorth = 2; break;
+        case 4 : colorth = 3; break;
+        case 5 : colorth = 4; break;
+    }
 
-   } else {
+    if(HwInfo->jChipType == SIS_730) {
 
-      for(*ModeIdIndex = 0; ;(*ModeIdIndex)++) {
-         if(SiS_Pr->SiS_EModeIDTable[*ModeIdIndex].Ext_ModeID == (*ModeNo)) break;
-         if(SiS_Pr->SiS_EModeIDTable[*ModeIdIndex].Ext_ModeID == 0xFF)      return FALSE;
-      }
+       do {
+          B = SiS_CalcDelay2(SiS_Pr, FQBQData730[i], HwInfo) * VCLK * colorth;
+	  bl = B / (MCLK * 16);
 
-   }
-   return TRUE;
-}
+          if(B == bl * 16 * MCLK) {
+             bl = bl + 1;
+          } else {
+             bl = bl + 2;
+          }
 
-/* For SiS 300 oem util: Search VBModeID */
-BOOLEAN
-SiS_SearchVBModeID(SiS_Private *SiS_Pr, UCHAR *ROMAddr, USHORT *ModeNo)
-{
-   USHORT ModeIdIndex;
-   UCHAR VGAINFO = SiS_Pr->SiS_VGAINFO;
-
-   if(*ModeNo <= 5) *ModeNo |= 1;
-
-   for(ModeIdIndex=0; ; ModeIdIndex++) {
-        if(SiS_Pr->SiS_VBModeIDTable[ModeIdIndex].ModeID == *ModeNo) break;
-        if(SiS_Pr->SiS_VBModeIDTable[ModeIdIndex].ModeID == 0xFF)    return FALSE;
-   }
-
-   if(*ModeNo != 0x07) {
-        if(*ModeNo > 0x03) return ((BOOLEAN)ModeIdIndex);
-	if(VGAINFO & 0x80) return ((BOOLEAN)ModeIdIndex);
-	ModeIdIndex++;
-   }
-   if(VGAINFO & 0x10) ModeIdIndex++;   /* 400 lines */
-	                               /* else 350 lines */
-   return ((BOOLEAN)ModeIdIndex);
-}
-
-BOOLEAN
-SiS_CheckMemorySize(SiS_Private *SiS_Pr, UCHAR *ROMAddr,PSIS_HW_DEVICE_INFO HwDeviceExtension,
-                    USHORT ModeNo,USHORT ModeIdIndex)
-{
-  USHORT memorysize,modeflag;
-  ULONG  temp;
-
-  if(SiS_Pr->UseCustomMode) {
-     modeflag = SiS_Pr->CModeFlag;
-  } else {
-     if(ModeNo <= 0x13) {
-        modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
-     } else {
-        modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
-     }
-  }
-
-  memorysize = modeflag & MemoryInfoFlag;
-  memorysize >>= MemorySizeShift;			/* Get required memory size */
-  memorysize++;
-
-  temp = GetDRAMSize(SiS_Pr, HwDeviceExtension);       	/* Get adapter memory size */
-  temp /= (1024*1024);   				/* (in MB) */
-
-  if(temp < memorysize) return(FALSE);
-  else return(TRUE);
-}
-
-UCHAR
-SiS_GetModePtr(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex)
-{
-   UCHAR index;
-
-   if(ModeNo <= 0x13) {
-     	index = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_StTableIndex;
-   } else {
-     	if(SiS_Pr->SiS_ModeType <= 0x02) index = 0x1B;    /* 02 -> ModeEGA  */
-     	else index = 0x0F;
-   }
-   return index;
-}
-
-void
-SiS_SetSeqRegs(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT StandTableIndex)
-{
-   UCHAR SRdata;
-   USHORT i;
-
-   SiS_SetReg1(SiS_Pr->SiS_P3c4,0x00,0x03);           	/* Set SR0  */
-
-   SRdata = SiS_Pr->SiS_StandTable[StandTableIndex].SR[0];
-
-   if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
-      if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) {
-         SRdata |= 0x01;
-      }
-      if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
-         if(SiS_Pr->SiS_VBType & VB_NoLCD) {
-	    if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) {
-               SRdata |= 0x01;          		/* 8 dot clock  */
-            }
-	 }
-      }
-   }
-   if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
-     if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) {
-       if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
-         if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) {
-           SRdata |= 0x01;        			/* 8 dot clock  */
-         }
-       }
-     }
-     if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
-       if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) {
-         SRdata |= 0x01;          			/* 8 dot clock  */
-       }
-     }
-   }
-
-   SRdata |= 0x20;                			/* screen off  */
-
-   SiS_SetReg1(SiS_Pr->SiS_P3c4,0x01,SRdata);
-
-   for(i = 2; i <= 4; i++) {
-       	SRdata = SiS_Pr->SiS_StandTable[StandTableIndex].SR[i-1];
-     	SiS_SetReg1(SiS_Pr->SiS_P3c4,i,SRdata);
-   }
-}
-
-void
-SiS_SetMiscRegs(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT StandTableIndex)
-{
-   UCHAR Miscdata;
-
-   Miscdata = SiS_Pr->SiS_StandTable[StandTableIndex].MISC;
-
-   if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
-      if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) {
-        Miscdata |= 0x0C;
-      }
-   }
+          if(bl > 0x13) {
+             if(FQBQData730[i+1] == 0xFF) {
+                ThresholdLow = 0x13;
+                break;
+             }
+             i++;
+          } else {
+             ThresholdLow = bl;
+             break;
+          }
+       } while(FQBQData730[i] != 0xFF);
 
-   SiS_SetReg3(SiS_Pr->SiS_P3c2,Miscdata);
-}
+    } else {
 
-void
-SiS_SetCRTCRegs(SiS_Private *SiS_Pr, UCHAR *ROMAddr,PSIS_HW_DEVICE_INFO HwDeviceExtension,
-                USHORT StandTableIndex)
-{
-  UCHAR CRTCdata;
-  USHORT i;
+       do {
+          B = SiS_CalcDelay2(SiS_Pr, FQBQData[i], HwInfo) * VCLK * colorth;
+          bl = B / (MCLK * 16);
 
-  SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x11,0x7f);                       /* Unlock CRTC */
+          if(B == bl * 16 * MCLK) {
+             bl = bl + 1;
+          } else {
+             bl = bl + 2;
+          }
 
-  for(i = 0; i <= 0x18; i++) {
-     CRTCdata = SiS_Pr->SiS_StandTable[StandTableIndex].CRTC[i];
-     SiS_SetReg1(SiS_Pr->SiS_P3d4,i,CRTCdata);                     /* Set CRTC(3d4) */
-  }
-  if( ( (HwDeviceExtension->jChipType == SIS_630) ||
-        (HwDeviceExtension->jChipType == SIS_730) )  &&
-      (HwDeviceExtension->jChipRevision >= 0x30) ) {       	   /* for 630S0 */
-    if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) {
-      if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToTV)) {
-        SiS_SetReg1(SiS_Pr->SiS_P3d4,0x18,0xFE);
-      }
+          if(bl > 0x13) {
+             if(FQBQData[i+1] == 0xFF) {
+                ThresholdLow = 0x13;
+                break;
+             }
+             i++;
+          } else {
+             ThresholdLow = bl;
+             break;
+          }
+       } while(FQBQData[i] != 0xFF);
     }
   }
-}
-
-void
-SiS_SetATTRegs(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT StandTableIndex,
-               PSIS_HW_DEVICE_INFO HwDeviceExtension)
-{
-   UCHAR ARdata;
-   USHORT i;
-
-   for(i = 0; i <= 0x13; i++) {
-    ARdata = SiS_Pr->SiS_StandTable[StandTableIndex].ATTR[i];
-#if 0
-    if((i <= 0x0f) || (i == 0x11)) {
-        if(ds:489 & 0x08) {
-	   continue;
-        }
-    }
-#endif
-    if(i == 0x13) {
-      /* Pixel shift. If screen on LCD or TV is shifted left or right, 
-       * this might be the cause. 
-       */
-      if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
-         if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)  ARdata=0;
-      }
-      if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
-         if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) {
-            if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
-               if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) ARdata=0;
-            }
-         }
-      }
-      if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
-         if(HwDeviceExtension->jChipType >= SIS_315H) {
-	    if(IS_SIS650740 || IS_SIS550) {  
-	       /* 315, 330 don't do this */
-	       if(SiS_Pr->SiS_VBType & VB_SIS301B302B) { 
-	          if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) ARdata=0;
-	       } else {
-	          ARdata = 0;
-	       }
-	    }
-	 } else {
-           if(SiS_Pr->SiS_VBInfo & SetInSlaveMode)  ARdata=0;
-	}
-      }
+  else {
+    if(HwInfo->jChipType == SIS_730) {
+    } else {
+      i = 9;
     }
-    SiS_GetReg2(SiS_Pr->SiS_P3da);                              /* reset 3da  */
-    SiS_SetReg3(SiS_Pr->SiS_P3c0,i);                            /* set index  */
-    SiS_SetReg3(SiS_Pr->SiS_P3c0,ARdata);                       /* set data   */
-   }
-   SiS_GetReg2(SiS_Pr->SiS_P3da);                               /* reset 3da  */
-   SiS_SetReg3(SiS_Pr->SiS_P3c0,0x14);                          /* set index  */
-   SiS_SetReg3(SiS_Pr->SiS_P3c0,0x00);                          /* set data   */
-
-   SiS_GetReg2(SiS_Pr->SiS_P3da);
-   SiS_SetReg3(SiS_Pr->SiS_P3c0,0x20);				/* Enable Attribute  */
-   SiS_GetReg2(SiS_Pr->SiS_P3da);
-}
-
-void
-SiS_SetGRCRegs(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT StandTableIndex)
-{
-   UCHAR GRdata;
-   USHORT i;
-
-   for(i = 0; i <= 0x08; i++) {
-     GRdata = SiS_Pr->SiS_StandTable[StandTableIndex].GRC[i];
-     SiS_SetReg1(SiS_Pr->SiS_P3ce,i,GRdata);                    /* Set GR(3ce) */
-   }
-
-   if(SiS_Pr->SiS_ModeType > ModeVGA) {
-     SiS_SetRegAND(SiS_Pr->SiS_P3ce,0x05,0xBF);			/* 256 color disable */
-   }
-}
-
-void
-SiS_ClearExt1Regs(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension)
-{
-  USHORT i;
-
-  for(i = 0x0A; i <= 0x0E; i++) {
-      SiS_SetReg1(SiS_Pr->SiS_P3c4,i,0x00);      /* Clear SR0A-SR0E */
-  }
-
-  /* TW: 330, 650/LVDS/301LV, 740/LVDS */
-  if(HwDeviceExtension->jChipType >= SIS_315H) {
-     SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x37,0xFE);
+    ThresholdLow = 0x02;
   }
-}
-
-void
-SiS_SetSync(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT RefreshRateTableIndex)
-{
-  USHORT sync;
-  USHORT temp;
-
-  if(SiS_Pr->UseCustomMode) {
-     sync = SiS_Pr->CInfoFlag >> 8;
-  } else {
-     sync = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_InfoFlag >> 8;
-  }     
-
-  sync &= 0xC0;
-  temp = 0x2F | sync;
-  SiS_SetReg3(SiS_Pr->SiS_P3c2,temp);           /* Set Misc(3c2) */
-}
-
-void
-SiS_SetCRT1CRTC(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
-                USHORT RefreshRateTableIndex,
-		PSIS_HW_DEVICE_INFO HwDeviceExtension)
-{
-  UCHAR  index;
-  USHORT tempah,i,modeflag,j;
-#ifdef SIS315H
-  USHORT temp;
-  USHORT ResInfo,DisplayType;
-  const SiS_LCDACRT1DataStruct *LCDACRT1Ptr = NULL;
-#endif
-
-  SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x11,0x7f);		/*unlock cr0-7  */
 
-  if(SiS_Pr->UseCustomMode) {
-     modeflag = SiS_Pr->CModeFlag;
-  } else {
-     if(ModeNo <= 0x13) {
-        modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
-     } else {
-        modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
-     }
-  }     
-
-  if((SiS_Pr->SiS_IF_DEF_LVDS == 0) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) {
-
-#ifdef SIS315H
-
-     /* LCDA */
-
-     temp = SiS_GetLCDACRT1Ptr(SiS_Pr,ROMAddr,ModeNo,ModeIdIndex,
-                       RefreshRateTableIndex,&ResInfo,&DisplayType);
+  /* Write foreground and background queue */
+  if(HwInfo->jChipType == SIS_730) {
 
-     switch(DisplayType) {
-      case Panel_800x600       : LCDACRT1Ptr = SiS_Pr->SiS_LCDACRT1800x600_1;      break;
-      case Panel_1024x768      : LCDACRT1Ptr = SiS_Pr->SiS_LCDACRT11024x768_1;     break;
-      case Panel_1280x1024     : LCDACRT1Ptr = SiS_Pr->SiS_LCDACRT11280x1024_1;    break;
-      case Panel_1400x1050     : LCDACRT1Ptr = SiS_Pr->SiS_LCDACRT11400x1050_1;    break;
-      case Panel_1600x1200     : LCDACRT1Ptr = SiS_Pr->SiS_LCDACRT11600x1200_1;    break;
-      case Panel_800x600   + 16: LCDACRT1Ptr = SiS_Pr->SiS_LCDACRT1800x600_1_H;    break;
-      case Panel_1024x768  + 16: LCDACRT1Ptr = SiS_Pr->SiS_LCDACRT11024x768_1_H;   break;
-      case Panel_1280x1024 + 16: LCDACRT1Ptr = SiS_Pr->SiS_LCDACRT11280x1024_1_H;  break;
-      case Panel_1400x1050 + 16: LCDACRT1Ptr = SiS_Pr->SiS_LCDACRT11400x1050_1_H;  break;
-      case Panel_1600x1200 + 16: LCDACRT1Ptr = SiS_Pr->SiS_LCDACRT11600x1200_1_H;  break;
-      case Panel_800x600   + 32: LCDACRT1Ptr = SiS_Pr->SiS_LCDACRT1800x600_2;      break;
-      case Panel_1024x768  + 32: LCDACRT1Ptr = SiS_Pr->SiS_LCDACRT11024x768_2;     break;
-      case Panel_1280x1024 + 32: LCDACRT1Ptr = SiS_Pr->SiS_LCDACRT11280x1024_2;    break;
-      case Panel_1400x1050 + 32: LCDACRT1Ptr = SiS_Pr->SiS_LCDACRT11400x1050_2;    break;
-      case Panel_1600x1200 + 32: LCDACRT1Ptr = SiS_Pr->SiS_LCDACRT11600x1200_2;    break;
-      case Panel_800x600   + 48: LCDACRT1Ptr = SiS_Pr->SiS_LCDACRT1800x600_2_H;    break;
-      case Panel_1024x768  + 48: LCDACRT1Ptr = SiS_Pr->SiS_LCDACRT11024x768_2_H;   break;
-      case Panel_1280x1024 + 48: LCDACRT1Ptr = SiS_Pr->SiS_LCDACRT11280x1024_2_H;  break;
-      case Panel_1400x1050 + 48: LCDACRT1Ptr = SiS_Pr->SiS_LCDACRT11400x1050_2_H;  break;
-      case Panel_1600x1200 + 48: LCDACRT1Ptr = SiS_Pr->SiS_LCDACRT11600x1200_2_H;  break;
-      default:                   LCDACRT1Ptr = SiS_Pr->SiS_LCDACRT11024x768_1;     break;
-     }
-
-     tempah = (LCDACRT1Ptr+ResInfo)->CR[0];
-     SiS_SetReg1(SiS_Pr->SiS_P3d4,0x00,tempah);
-     for(i=0x01,j=1;i<=0x07;i++,j++){
-       tempah = (LCDACRT1Ptr+ResInfo)->CR[j];
-       SiS_SetReg1(SiS_Pr->SiS_P3d4,i,tempah);
-     }
-     for(i=0x10,j=8;i<=0x12;i++,j++){
-       tempah = (LCDACRT1Ptr+ResInfo)->CR[j];
-       SiS_SetReg1(SiS_Pr->SiS_P3d4,i,tempah);
-     }
-     for(i=0x15,j=11;i<=0x16;i++,j++){
-       tempah =(LCDACRT1Ptr+ResInfo)->CR[j];
-       SiS_SetReg1(SiS_Pr->SiS_P3d4,i,tempah);
-     }
-     for(i=0x0A,j=13;i<=0x0C;i++,j++){
-       tempah = (LCDACRT1Ptr+ResInfo)->CR[j];
-       SiS_SetReg1(SiS_Pr->SiS_P3c4,i,tempah);
-     }
-
-     tempah = (LCDACRT1Ptr+ResInfo)->CR[16];
-     tempah &= 0x0E0;
-     SiS_SetReg1(SiS_Pr->SiS_P3c4,0x0E,tempah);
-
-     tempah = (LCDACRT1Ptr+ResInfo)->CR[16];
-     tempah &= 0x01;
-     tempah <<= 5;
-     if(modeflag & DoubleScanMode)  tempah |= 0x080;
-     SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x09,~0x020,tempah);
+     data2 = FQBQData730[i];
+     data2 = (data2 & 0xC0) >> 5;
+     data2 <<= 8;
 
+#ifndef LINUX_XF86
+     SiS_SetRegLong(0xcf8,0x80000050);
+     eax = SiS_GetRegLong(0xcfc);
+     eax &= 0xfffff9ff;
+     eax |= data2;
+     SiS_SetRegLong(0xcfc,eax);
+#else
+     /* We use pci functions X offers. We use pcitag 0, because
+      * we want to read/write to the host bridge (which is always
+      * 00:00.0 on 630, 730 and 540), not the VGA device.
+      */
+     eax = pciReadLong(0x00000000, 0x50);
+     eax &= 0xfffff9ff;
+     eax |= data2;
+     pciWriteLong(0x00000000, 0x50, eax);
 #endif
 
-  } else {
-
-     /* LVDS, 301, 301B, 301LV, 302LV, ... (non-LCDA) */
-
-     if(SiS_Pr->UseCustomMode) {
-     
-        for(i=0,j=0;i<=07;i++,j++) {
-          SiS_SetReg1(SiS_Pr->SiS_P3d4,j,SiS_Pr->CCRT1CRTC[i]);
-        }
-        for(j=0x10;i<=10;i++,j++) {
-          SiS_SetReg1(SiS_Pr->SiS_P3d4,j,SiS_Pr->CCRT1CRTC[i]);
-        }
-        for(j=0x15;i<=12;i++,j++) {
-          SiS_SetReg1(SiS_Pr->SiS_P3d4,j,SiS_Pr->CCRT1CRTC[i]);
-        }
-        for(j=0x0A;i<=15;i++,j++) {
-          SiS_SetReg1(SiS_Pr->SiS_P3c4,j,SiS_Pr->CCRT1CRTC[i]);
-        }
-
-        tempah = SiS_Pr->CCRT1CRTC[16] & 0xE0;
-        SiS_SetReg1(SiS_Pr->SiS_P3c4,0x0E,tempah);
+     /* Write GUI grant timer (PCI config 0xA3) */
+     data2 = FQBQData730[i] << 8;
+     data2 = (data2 & 0x0f00) | ((data2 & 0x3000) >> 8);
+     data2 <<= 20;
 
-        tempah = SiS_Pr->CCRT1CRTC[16];
-        tempah &= 0x01;
-        tempah <<= 5;
-        if(modeflag & DoubleScanMode)  tempah |= 0x80;
-        SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x09,0xDF,tempah);
-     
-     
-     } else {
-     
-        index = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT1CRTC;  	/* Get index */
-#if 0   /* Not any longer... */     
-        if(HwDeviceExtension->jChipType < SIS_315H) {
-           index &= 0x3F;
-        }
+#ifndef LINUX_XF86
+     SiS_SetRegLong(0xcf8,0x800000A0);
+     eax = SiS_GetRegLong(0xcfc);
+     eax &= 0x00ffffff;
+     eax |= data2;
+     SiS_SetRegLong(0xcfc,eax);
+#else
+     eax = pciReadLong(0x00000000, 0xA0);
+     eax &= 0x00ffffff;
+     eax |= data2;
+     pciWriteLong(0x00000000, 0xA0, eax);
 #endif
 
-        for(i=0,j=0;i<=07;i++,j++) {
-          tempah=SiS_Pr->SiS_CRT1Table[index].CR[i];
-          SiS_SetReg1(SiS_Pr->SiS_P3d4,j,tempah);
-        }
-        for(j=0x10;i<=10;i++,j++) {
-          tempah=SiS_Pr->SiS_CRT1Table[index].CR[i];
-          SiS_SetReg1(SiS_Pr->SiS_P3d4,j,tempah);
-        }
-        for(j=0x15;i<=12;i++,j++) {
-          tempah=SiS_Pr->SiS_CRT1Table[index].CR[i];
-          SiS_SetReg1(SiS_Pr->SiS_P3d4,j,tempah);
-        }
-        for(j=0x0A;i<=15;i++,j++) {
-          tempah=SiS_Pr->SiS_CRT1Table[index].CR[i];
-          SiS_SetReg1(SiS_Pr->SiS_P3c4,j,tempah);
-        }
-
-        tempah = SiS_Pr->SiS_CRT1Table[index].CR[16];
-        tempah &= 0xE0;
-        SiS_SetReg1(SiS_Pr->SiS_P3c4,0x0E,tempah);
+  } else {
 
-        tempah = SiS_Pr->SiS_CRT1Table[index].CR[16];
-        tempah &= 0x01;
-        tempah <<= 5;
-        if(modeflag & DoubleScanMode)  tempah |= 0x80;
-        SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x09,0xDF,tempah);
+     data2 = FQBQData[i];
+     data2 = (data2 & 0xf0) >> 4;
+     data2 <<= 24;
 
-     }
-  }
+#ifndef LINUX_XF86
+     SiS_SetRegLong(0xcf8,0x80000050);
+     eax = SiS_GetRegLong(0xcfc);
+     eax &= 0xf0ffffff;
+     eax |= data2;
+     SiS_SetRegLong(0xcfc,eax);
+#else
+     eax = pciReadLong(0x00000000, 0x50);
+     eax &= 0xf0ffffff;
+     eax |= data2;
+     pciWriteLong(0x00000000, 0x50, eax);
+#endif
 
-  if(SiS_Pr->SiS_ModeType > ModeVGA) SiS_SetReg1(SiS_Pr->SiS_P3d4,0x14,0x4F);
-}
+     /* Write GUI grant timer (PCI config 0xA3) */
+     data2 = FQBQData[i];
+     data2 &= 0x0f;
+     data2 <<= 24;
 
-BOOLEAN
-SiS_GetLCDACRT1Ptr(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
-		   USHORT RefreshRateTableIndex,USHORT *ResInfo,
-		   USHORT *DisplayType)
- {
-  USHORT tempbx=0,modeflag=0;
-  USHORT CRT2CRTC=0;
+#ifndef LINUX_XF86
+     SiS_SetRegLong(0xcf8,0x800000A0);
+     eax = SiS_GetRegLong(0xcfc);
+     eax &= 0xf0ffffff;
+     eax |= data2;
+     SiS_SetRegLong(0xcfc,eax);
+#else
+     eax = pciReadLong(0x00000000, 0xA0);
+     eax &= 0xf0ffffff;
+     eax |= data2;
+     pciWriteLong(0x00000000, 0xA0, eax);
+#endif
 
-  if(ModeNo <= 0x13) {
-  	modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
-  	CRT2CRTC = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC;
-  } else {
-  	modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
-  	CRT2CRTC = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC;
   }
 
-  tempbx = SiS_Pr->SiS_LCDResInfo;
+  /* Write CRT/CPU threshold low, CRT/Engine threshold high */
+  data = ((ThresholdLow & 0x0f) << 4) | 0x0f;
+  SiS_SetReg(SiS_Pr->SiS_P3c4,0x08,data);
 
-  if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx += 32;
-  if(modeflag & HalfDCLK)                 tempbx += 16;
+  data = (ThresholdLow & 0x10) << 1;
+  SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x0F,0xDF,data);
 
-  *ResInfo = CRT2CRTC & 0x3F;
-  *DisplayType = tempbx;
+  /* What is this? */
+  SiS_SetReg(SiS_Pr->SiS_P3c4,0x3B,0x09);
 
-  return 1;
+  /* Write CRT/CPU threshold high (gap = 3) */
+  data = ThresholdLow + 3;
+  if(data > 0x0f) data = 0x0f;
+  SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x09,0x80,data);
 }
+#endif
 
-/* TW: Set offset and pitch - partly overruled by SetPitch() in XF86 */
-void
-SiS_SetCRT1Offset(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
-                  USHORT RefreshRateTableIndex,
-		  PSIS_HW_DEVICE_INFO HwDeviceExtension)
+#ifdef SIS315H
+static void
+SiS_SetCRT1FIFO_310(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
+                    PSIS_HW_INFO HwInfo)
 {
-   USHORT temp, DisplayUnit, infoflag;
-
-   if(SiS_Pr->UseCustomMode) {
-      infoflag = SiS_Pr->CInfoFlag;
-   } else {
-      infoflag = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_InfoFlag;
-   }
-   
-   DisplayUnit = SiS_GetOffset(SiS_Pr,ROMAddr,ModeNo,ModeIdIndex,
-                     RefreshRateTableIndex,HwDeviceExtension);		     
-
-   temp = (DisplayUnit >> 8) & 0x0f;
-   SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x0E,0xF0,temp);
+  USHORT modeflag;
 
-   temp = DisplayUnit & 0xFF;
-   SiS_SetReg1(SiS_Pr->SiS_P3d4,0x13,temp);
+  SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x3D,0xFE);  /* disable auto-threshold */
 
-   if(infoflag & InterlaceMode) DisplayUnit >>= 1;
+  if(SiS_Pr->UseCustomMode) {
+     modeflag = SiS_Pr->CModeFlag;
+  } else {
+     modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
+  }
 
-   DisplayUnit <<= 5;
-   temp = (DisplayUnit & 0xff00) >> 8;
-   if (DisplayUnit & 0xff) temp++;
-   temp++;
-   SiS_SetReg1(SiS_Pr->SiS_P3c4,0x10,temp);
+  if(HwInfo->jChipType >= SIS_661) {
+     SiS_SetReg(SiS_Pr->SiS_P3c4,0x08,0xAE);
+     SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x09,0xF0);
+     if(ModeNo > 0x13) {
+        if(!(modeflag & HalfDCLK)) {
+	   SiS_SetReg(SiS_Pr->SiS_P3c4,0x08,0x34);
+	   if(ModeNo != 0x38) {
+	      SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x3D,0x01);
+	   }
+	}
+     }
+  } else {
+     if(ModeNo > 0x13) {
+        if( (!(modeflag & DoubleScanMode)) || (!(modeflag & HalfDCLK))) {
+           SiS_SetReg(SiS_Pr->SiS_P3c4,0x08,0x34);
+           SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x09,0xF0);
+           SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x3D,0x01);
+        } else {
+           SiS_SetReg(SiS_Pr->SiS_P3c4,0x08,0xAE);
+           SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x09,0xF0);
+        }
+     } else {
+        SiS_SetReg(SiS_Pr->SiS_P3c4,0x08,0xAE);
+        SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x09,0xF0);
+     }
+  }
 }
+#endif
 
-/* TW: New from 650/LVDS 1.10.07, 630/301B and 630/LVDS BIOS */
-void
-SiS_ResetCRT1VCLK(SiS_Private *SiS_Pr, UCHAR *ROMAddr,PSIS_HW_DEVICE_INFO HwDeviceExtension)
-{
-   USHORT index;
-
-   /* TW: We only need to do this if Panel Link is to be
-    *     initialized, thus on 630/LVDS/301BDH, and 650/LVDS
-    */
-   if(HwDeviceExtension->jChipType >= SIS_315H) {
-      if(SiS_Pr->SiS_IF_DEF_LVDS == 0)  return;
-   } else {
-      if( (SiS_Pr->SiS_IF_DEF_LVDS == 0) &&
-          (!(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV)) ) {
-	 return;
-      }
-   }
-
-   if(HwDeviceExtension->jChipType >= SIS_315H) {
-   	SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x31,0xCF,0x20);
-   } else {
-   	SiS_SetReg1(SiS_Pr->SiS_P3c4,0x31,0x20);
-   }
-   index = 1;
-   SiS_SetReg1(SiS_Pr->SiS_P3c4,0x2B,SiS_Pr->SiS_VCLKData[index].SR2B);
-   SiS_SetReg1(SiS_Pr->SiS_P3c4,0x2C,SiS_Pr->SiS_VCLKData[index].SR2C);
-   SiS_SetReg1(SiS_Pr->SiS_P3c4,0x2D,0x80);
-   if(HwDeviceExtension->jChipType >= SIS_315H) {
-   	SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x31,0xcf,0x10);
-   } else {
-   	SiS_SetReg1(SiS_Pr->SiS_P3c4,0x31,0x10);
-   }
-   index = 0;
-   SiS_SetReg1(SiS_Pr->SiS_P3c4,0x2B,SiS_Pr->SiS_VCLKData[index].SR2B);
-   SiS_SetReg1(SiS_Pr->SiS_P3c4,0x2C,SiS_Pr->SiS_VCLKData[index].SR2C);
-   SiS_SetReg1(SiS_Pr->SiS_P3c4,0x2D,0x80);
-}
+/*********************************************/
+/*              MODE REGISTERS               */
+/*********************************************/
 
-void
-SiS_SetCRT1VCLK(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
-                PSIS_HW_DEVICE_INFO HwDeviceExtension,
-		USHORT RefreshRateTableIndex)
+static void
+SiS_SetVCLKState(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
+                 USHORT ModeNo, USHORT RefreshRateTableIndex,
+                 USHORT ModeIdIndex)
 {
-  USHORT  index=0;
-
-  if(!SiS_Pr->UseCustomMode) {
-     index = SiS_GetVCLK2Ptr(SiS_Pr,ROMAddr,ModeNo,ModeIdIndex,
-	                  RefreshRateTableIndex,HwDeviceExtension);
-  }			  
-
-  if( (SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) ){
+  USHORT data, data2=0;
+  USHORT VCLK, index=0;
 
-    	SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x31,0xCF);
+  if(ModeNo <= 0x13) VCLK = 0;
+  else {
+     if(SiS_Pr->UseCustomMode) {
+        VCLK = SiS_Pr->CSRClock;
+     } else {
+        index = SiS_GetVCLK2Ptr(SiS_Pr,ModeNo,ModeIdIndex,
+	               RefreshRateTableIndex,HwInfo);
+        VCLK = SiS_Pr->SiS_VCLKData[index].CLOCK;
+     }
+  }
 
-    	SiS_SetReg1(SiS_Pr->SiS_P3c4,0x2B,SiS_Pr->SiS_VBVCLKData[index].Part4_A);
-    	SiS_SetReg1(SiS_Pr->SiS_P3c4,0x2C,SiS_Pr->SiS_VBVCLKData[index].Part4_B);
+  if(HwInfo->jChipType < SIS_315H) {		/* 300 series */
 
-    	if(HwDeviceExtension->jChipType >= SIS_315H) {
-		SiS_SetReg1(SiS_Pr->SiS_P3c4,0x2D,0x01);
-   	} else {
-    		SiS_SetReg1(SiS_Pr->SiS_P3c4,0x2D,0x80);
-    	}
+     data2 = 0x00;
+     if(VCLK > 150) data2 |= 0x80;
+     SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x07,0x7B,data2);
 
-  } else {
+     data2 = 0x00;
+     if(VCLK >= 150) data2 |= 0x08;
+     SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x32,0xF7,data2);
 
-	if(HwDeviceExtension->jChipType >= SIS_315H) {
-	    SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x31,0xCF);
-	} else {
-	    SiS_SetReg1(SiS_Pr->SiS_P3c4,0x31,0x00);
-	}
+  } else { 					/* 315 series */
 
-	if(SiS_Pr->UseCustomMode) {
-	   SiS_SetReg1(SiS_Pr->SiS_P3c4,0x2B,SiS_Pr->CSR2B);
-	   SiS_SetReg1(SiS_Pr->SiS_P3c4,0x2C,SiS_Pr->CSR2C);
-	} else {
-    	   SiS_SetReg1(SiS_Pr->SiS_P3c4,0x2B,SiS_Pr->SiS_VCLKData[index].SR2B);
-    	   SiS_SetReg1(SiS_Pr->SiS_P3c4,0x2C,SiS_Pr->SiS_VCLKData[index].SR2C);
-  	}	   
+     data = 0;
+     if(VCLK >= 166) data |= 0x0c;
+     SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x32,0xf3,data);
 
-    	if(HwDeviceExtension->jChipType >= SIS_315H) {
-	    SiS_SetReg1(SiS_Pr->SiS_P3c4,0x2D,0x01);
-	} else {
-      	    SiS_SetReg1(SiS_Pr->SiS_P3c4,0x2D,0x80);
-        }
+     if(VCLK >= 166) {
+        SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1f,0xe7);
+     }
   }
-}
 
-#if 0  /* TW: Not used */
-void
-SiS_IsLowResolution(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex)
-{
-  USHORT ModeFlag;
+  data2 = 0x03;
+  if((VCLK >= 135) && (VCLK < 160))      data2 = 0x02;
+  else if((VCLK >= 160) && (VCLK < 260)) data2 = 0x01;
+  else if(VCLK >= 260)                   data2 = 0x00;
 
-  SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x0F,0x7F);
+  if(HwInfo->jChipType == SIS_540) {
+     if((VCLK == 203) || (VCLK < 234)) data2 = 0x02;
+  }
 
-  if(ModeNo > 0x13) {
-    ModeFlag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
-    if ((ModeFlag & HalfDCLK) && (ModeFlag & DoubleScanMode)) {
-      SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x0F,0x80);
-      SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x01,0xF7);
-    }
+  if(HwInfo->jChipType < SIS_315H) {
+     SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x07,0xFC,data2);  	/* DAC speed */
+  } else {
+     if(HwInfo->jChipType > SIS_315PRO) {
+        /* This "if" is done in 330 and 650/LVDS/301LV BIOSes; Not in 315 BIOS */
+        if(ModeNo > 0x13) data2 &= 0xfc;
+     }
+     SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x07,0xF8,data2);  	/* DAC speed */
   }
 }
-#endif
 
-void
-SiS_SetCRT1ModeRegs(SiS_Private *SiS_Pr, UCHAR *ROMAddr,PSIS_HW_DEVICE_INFO HwDeviceExtension,
+static void
+SiS_SetCRT1ModeRegs(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
                     USHORT ModeNo,USHORT ModeIdIndex,USHORT RefreshRateTableIndex)
 {
-  USHORT data,data2,data3;
+  USHORT data,data2;
   USHORT infoflag=0,modeflag;
   USHORT resindex,xres;
+#ifdef SIS315H
+  USHORT data3;
+  ULONG  longdata;
+#if 0
+  resinfo = 0;
+#endif
+#endif
 
   if(SiS_Pr->UseCustomMode) {
      modeflag = SiS_Pr->CModeFlag;
@@ -3478,35 +3040,42 @@
      if(ModeNo > 0x13) {
     	modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
     	infoflag = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_InfoFlag;
+#ifdef SIS315H
+#if 0
+	resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO;
+#endif
+#endif
      } else {
     	modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
      }
   }
 
-  SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1F,0x3F); 		/* DAC pedestal */
+  /* Disable DPMS */
+  SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1F,0x3F);
 
   if(ModeNo > 0x13) data = infoflag;
   else data = 0;
 
   data2 = 0;
   if(ModeNo > 0x13) {
-    if(SiS_Pr->SiS_ModeType > 0x02) {
-       data2 |= 0x02;
-       data3 = (SiS_Pr->SiS_ModeType - ModeVGA) << 2;
-       data2 |= data3;
-    }
+     if(SiS_Pr->SiS_ModeType > 0x02) {
+        data2 |= 0x02;
+        data2 |= ((SiS_Pr->SiS_ModeType - ModeVGA) << 2);
+     }
   }
+
 #ifdef TWDEBUG
-  xf86DrvMsg(0, X_INFO, "Debug: Mode infoflag = %x, Chiptype %d\n", 
-  	data, HwDeviceExtension->jChipType);
-#endif  
+  xf86DrvMsg(0, X_INFO, "Debug: Mode infoflag = %x, Chiptype %d\n",
+  	data, HwInfo->jChipType);
+#endif
+
   if(data & InterlaceMode) data2 |= 0x20;
   SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x06,0xC0,data2);
 
   if(SiS_Pr->UseCustomMode) {
      xres = SiS_Pr->CHDisplay;
   } else {
-     resindex = SiS_GetResInfo(SiS_Pr,ROMAddr,ModeNo,ModeIdIndex);
+     resindex = SiS_GetResInfo(SiS_Pr,ModeNo,ModeIdIndex);
      if(ModeNo <= 0x13) {
       	xres = SiS_Pr->SiS_StResInfo[resindex].HTotal;
      } else {
@@ -3514,44 +3083,33 @@
      }
   }
 
-  if(HwDeviceExtension->jChipType != SIS_300) {
+  if(HwInfo->jChipType != SIS_300) {
      data = 0x0000;
      if(infoflag & InterlaceMode) {
-        if(xres == 1024) data = 0x0035;
+        if(xres <= 800) data = 0x0020;
+        else if(xres <= 1024) data = 0x0035;
         else data = 0x0048;
      }
-     data2 = data & 0x00FF;
-     SiS_SetReg1(SiS_Pr->SiS_P3d4,0x19,data2);
-     data2 = (data & 0xFF00) >> 8;
-     SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x1a,0xFC,data2);
+     SiS_SetReg(SiS_Pr->SiS_P3d4,0x19,(data & 0x00FF));
+     SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x1a,0xFC,(data >> 8));
   }
 
   if(modeflag & HalfDCLK) {
      SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x01,0x08);
   }
 
-  if(HwDeviceExtension->jChipType == SIS_300) {
+  if(HwInfo->jChipType == SIS_300) {
      if(modeflag & LineCompareOff) {
         SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x0F,0x08);
      } else {
         SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x0F,0xF7);
      }
-  } else if(HwDeviceExtension->jChipType < SIS_315H) {
-     if(modeflag & LineCompareOff) {
-        SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x0F,0xB7,0x08);
-     } else {
-        SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x0F,0xB7);
-     }
-     /* 630 BIOS does something for mode 0x12 here */
   } else {
      if(modeflag & LineCompareOff) {
         SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x0F,0xB7,0x08);
      } else {
         SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x0F,0xB7);
      }
-  }
-
-  if(HwDeviceExtension->jChipType != SIS_300) {
      if(SiS_Pr->SiS_ModeType == ModeEGA) {
         if(ModeNo > 0x13) {
   	   SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x0F,0x40);
@@ -3560,1434 +3118,1184 @@
   }
 
 #ifdef SIS315H
-  /* TW: 315 BIOS sets SR17 at this point */
-  if(HwDeviceExtension->jChipType == SIS_315PRO) {
-      data = SiS_Get310DRAMType(SiS_Pr,ROMAddr,HwDeviceExtension);
-      data = SiS_Pr->SiS_SR15[2][data];
-      if(SiS_Pr->SiS_ModeType == ModeText) {
-          data &= 0xc7;
-      } else {
-          data2 = SiS_GetOffset(SiS_Pr,ROMAddr,ModeNo,ModeIdIndex,
-                                RefreshRateTableIndex,HwDeviceExtension);
-	  data2 >>= 1;
-	  if(infoflag & InterlaceMode) data2 >>= 1;
-	  data3 = SiS_GetColorDepth(SiS_Pr,ROMAddr,ModeNo,ModeIdIndex);
-	  data3 >>= 1;
-	  if(data3 == 0) data3++;
-	  data2 /= data3;
-	  if(data2 >= 0x50) {
-	      data &= 0x0f;
-	      data |= 0x50;
-	  }
-      }
-      SiS_SetReg1(SiS_Pr->SiS_P3c4,0x17,data);
+  /* 315 BIOS sets SR17 at this point */
+  if(HwInfo->jChipType == SIS_315PRO) {
+     data = SiS_Get310DRAMType(SiS_Pr, HwInfo);
+     data = SiS_Pr->SiS_SR15[2][data];
+     if(SiS_Pr->SiS_ModeType == ModeText) {
+        data &= 0xc7;
+     } else {
+        data2 = SiS_GetOffset(SiS_Pr,ModeNo,ModeIdIndex,
+                              RefreshRateTableIndex,HwInfo);
+	data2 >>= 1;
+	if(infoflag & InterlaceMode) data2 >>= 1;
+	data3 = SiS_GetColorDepth(SiS_Pr,ModeNo,ModeIdIndex) >> 1;
+	if(!data3) data3++;
+	data2 /= data3;
+	if(data2 >= 0x50) {
+	   data &= 0x0f;
+	   data |= 0x50;
+	}
+     }
+     SiS_SetReg(SiS_Pr->SiS_P3c4,0x17,data);
   }
 
-  /* TW: 330 BIOS sets SR17 at this point */
-  if(HwDeviceExtension->jChipType == SIS_330) {
-      data = SiS_Get310DRAMType(SiS_Pr,ROMAddr,HwDeviceExtension);
-      data = SiS_Pr->SiS_SR15[2][data];
-      if(SiS_Pr->SiS_ModeType <= ModeEGA) {
-          data &= 0xc7;
-      } else {
-          if(SiS_Pr->UseCustomMode) {
-	     data2 = SiS_Pr->CSRClock;
-	  } else {
-             data2 = SiS_GetVCLK2Ptr(SiS_Pr,ROMAddr,ModeNo,ModeIdIndex,
-                               RefreshRateTableIndex,HwDeviceExtension);
-             data2 = SiS_Pr->SiS_VCLKData[data2].CLOCK;
-	  }
+  /* 330 BIOS sets SR17 at this point */
+  if(HwInfo->jChipType == SIS_330) {
+     data = SiS_Get310DRAMType(SiS_Pr, HwInfo);
+     data = SiS_Pr->SiS_SR15[2][data];
+     if(SiS_Pr->SiS_ModeType <= ModeEGA) {
+        data &= 0xc7;
+     } else {
+        if(SiS_Pr->UseCustomMode) {
+	   data2 = SiS_Pr->CSRClock;
+	} else {
+           data2 = SiS_GetVCLK2Ptr(SiS_Pr,ModeNo,ModeIdIndex,
+                                   RefreshRateTableIndex,HwInfo);
+           data2 = SiS_Pr->SiS_VCLKData[data2].CLOCK;
+	}
 
-	  data3 = SiS_GetColorDepth(SiS_Pr,ROMAddr,ModeNo,ModeIdIndex);
-	  data3 >>= 1;
+	data3 = SiS_GetColorDepth(SiS_Pr,ModeNo,ModeIdIndex) >> 1;
+	if(!data3) data3++;
 
-	  data2 *= data3;
+	data2 *= data3;
 
-	  data3 = SiS_GetMCLK(SiS_Pr,ROMAddr, HwDeviceExtension);
-	  data3 *= 1024;
+	longdata = SiS_GetMCLK(SiS_Pr, HwInfo) * 1024;
 
-	  data2 = data3 / data2;
-
-	  if(SiS_Pr->SiS_ModeType != Mode16Bpp) {
-            if(data2 >= 0x19c)      data = 0xba;
-	    else if(data2 >= 0x140) data = 0x7a;
-	    else if(data2 >= 0x101) data = 0x3a;
-	    else if(data2 >= 0xf5)  data = 0x32;
-	    else if(data2 >= 0xe2)  data = 0x2a;
-	    else if(data2 >= 0xc4)  data = 0x22;
-	    else if(data2 >= 0xac)  data = 0x1a;
-	    else if(data2 >= 0x9e)  data = 0x12;
-	    else if(data2 >= 0x8e)  data = 0x0a;
-	    else                    data = 0x02;
-	  } else {
-	    if(data2 >= 0x127)      data = 0xba;
-	    else                    data = 0x7a;
-	  }
+	data2 = longdata / data2;
+
+	if(SiS_Pr->SiS_ModeType != Mode16Bpp) {
+           if(data2 >= 0x19c)      data = 0xba;
+	   else if(data2 >= 0x140) data = 0x7a;
+	   else if(data2 >= 0x101) data = 0x3a;
+	   else if(data2 >= 0xf5)  data = 0x32;
+	   else if(data2 >= 0xe2)  data = 0x2a;
+	   else if(data2 >= 0xc4)  data = 0x22;
+	   else if(data2 >= 0xac)  data = 0x1a;
+	   else if(data2 >= 0x9e)  data = 0x12;
+	   else if(data2 >= 0x8e)  data = 0x0a;
+	   else                    data = 0x02;
+	 } else {
+	   if(data2 >= 0x127)      data = 0xba;
+	   else                    data = 0x7a;
+	 }
       }
-      SiS_SetReg1(SiS_Pr->SiS_P3c4,0x17,data);
+      SiS_SetReg(SiS_Pr->SiS_P3c4,0x17,data);
   }
 #endif
 
   data = 0x60;
   if(SiS_Pr->SiS_ModeType != ModeText) {
-      data ^= 0x60;
-      if(SiS_Pr->SiS_ModeType != ModeEGA) {
-          data ^= 0xA0;
-      }
+     data ^= 0x60;
+     if(SiS_Pr->SiS_ModeType != ModeEGA) {
+        data ^= 0xA0;
+     }
   }
   SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x21,0x1F,data);
 
-  SiS_SetVCLKState(SiS_Pr,ROMAddr,HwDeviceExtension,ModeNo,RefreshRateTableIndex,ModeIdIndex);
+  SiS_SetVCLKState(SiS_Pr, HwInfo, ModeNo, RefreshRateTableIndex, ModeIdIndex);
 
 #ifdef SIS315H
-  if(HwDeviceExtension->jChipType >= SIS_315H) {
-    if(SiS_GetReg1(SiS_Pr->SiS_P3d4,0x31) & 0x40) {
-        SiS_SetReg1(SiS_Pr->SiS_P3d4,0x52,0x2c);
-    } else {
-        SiS_SetReg1(SiS_Pr->SiS_P3d4,0x52,0x6c);
-    }
-  }
-#endif
-}
-
-void
-SiS_SetVCLKState(SiS_Private *SiS_Pr, UCHAR *ROMAddr,PSIS_HW_DEVICE_INFO HwDeviceExtension,
-                 USHORT ModeNo,USHORT RefreshRateTableIndex,
-                 USHORT ModeIdIndex)
-{
-  USHORT data, data2=0;
-  USHORT VCLK, index=0;
-
-  if (ModeNo <= 0x13) VCLK = 0;
-  else {
-     if(SiS_Pr->UseCustomMode) {
-        VCLK = SiS_Pr->CSRClock;
+  if(HwInfo->jChipType >= SIS_315H) {
+     if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x31) & 0x40) {
+        SiS_SetReg(SiS_Pr->SiS_P3d4,0x52,0x2c);
      } else {
-        index = SiS_GetVCLK2Ptr(SiS_Pr,ROMAddr,ModeNo,ModeIdIndex,
-	               RefreshRateTableIndex,HwDeviceExtension);
-        VCLK = SiS_Pr->SiS_VCLKData[index].CLOCK;
-     }	
-  }
-
-  if(HwDeviceExtension->jChipType < SIS_315H) {		/* 300 series */
-
-    data2 = 0x00;
-    if(VCLK > 150) data2 |= 0x80;
-    SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x07,0x7B,data2); 	/* DAC speed */
-
-    data2 = 0x00;
-    if(VCLK >= 150) data2 |= 0x08;       	/* VCLK > 150 */
-    SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x32,0xF7,data2);
-
-  } else { 						/* 310/325 series */
-
-    data = 0;
-    if(VCLK >= 166) data |= 0x0c;         	/* TW: Was 200; is 166 in 650, 315 and 330 BIOSes */
-    SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x32,0xf3,data);
-
-    if(VCLK >= 166) {				/* TW: Was 200, is 166 in 650, 315 and 330 BIOSes */
-       SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1f,0xe7);
-    }
-#if 0 /* Not done in 315 and 650/301LV/LVDS BIOSes: */
-    data = SiS_GetReg1(SiS_Pr->SiS_P3c4,0x1F);	  	/* DAC pedestal */
-    data &= 0xE7;
-    if(VCLK<200) data |= 0x10;
-    SiS_SetReg1(SiS_Pr->SiS_P3c4,0x1F,data);	  	/* DAC pedestal */
-#endif
-  }
-
-  data2 = 0x03;
-  if((VCLK >= 135) && (VCLK < 160)) data2 = 0x02;
-  if((VCLK >= 160) && (VCLK < 260)) data2 = 0x01;
-  if(VCLK >= 260) data2 = 0x00;
-
-  if(HwDeviceExtension->jChipType == SIS_540) {
-    	if((VCLK == 203) || (VCLK < 234)) data2 = 0x02;
-  }
-  
-  if(HwDeviceExtension->jChipType < SIS_315H) {
-      SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x07,0xFC,data2);  	/* DAC speed */
-  } else {
-      if(HwDeviceExtension->jChipType > SIS_315PRO) {
-         /* TW: This "if" is done in 330 and 650/LVDS/301LV BIOSes; Not in 315 BIOS */
-         if(ModeNo > 0x13) data2 &= 0xfc;
-      }
-      SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x07,0xF8,data2);  	/* DAC speed */
-  }
-}
-
-void
-SiS_LoadDAC(SiS_Private *SiS_Pr,PSIS_HW_DEVICE_INFO HwDeviceExtension,
-            UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex)
-{
-   USHORT data,data2;
-   USHORT time,i,j,k;
-   USHORT m,n,o;
-   USHORT si,di,bx,dl;
-   USHORT al,ah,dh;
-   USHORT DACAddr, DACData, shiftflag;
-   const USHORT *table = NULL;
-#if 0
-   USHORT tempah,tempch,tempcl,tempdh,tempal,tempbx;
-#endif
-
-   if(ModeNo <= 0x13) {
-        data = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
-   } else {
-        if(SiS_Pr->UseCustomMode) {
-	   data = SiS_Pr->CModeFlag;
-	} else {
-           data = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
- 	}	   
-   }
-
-#if 0
-   if(!(ds:489 & 0x08)) {
-#endif
-
-	data &= DACInfoFlag;
-	time = 64;
-	if(data == 0x00) table = SiS_MDA_DAC;
-	if(data == 0x08) table = SiS_CGA_DAC;
-	if(data == 0x10) table = SiS_EGA_DAC;
-	if(data == 0x18) {
-	   time = 256;
-	   table = SiS_VGA_DAC;
-	}
-	if(time == 256) j = 16;
-	else            j = time;
-
-	if( ( (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) &&        /* 301B-DH LCD */
-	      (SiS_Pr->SiS_VBType & VB_NoLCD) )        ||
-	    (SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)       ||   /* LCDA */
-	    (!(SiS_Pr->SiS_SetFlag & ProgrammingCRT2)) ) {  /* Programming CRT1 */
-	   DACAddr = SiS_Pr->SiS_P3c8;
-	   DACData = SiS_Pr->SiS_P3c9;
-	   shiftflag = 0;
-	   SiS_SetReg3(SiS_Pr->SiS_P3c6,0xFF);
-	} else {
-	   shiftflag = 1;
-	   DACAddr = SiS_Pr->SiS_Part5Port;
-	   DACData = SiS_Pr->SiS_Part5Port + 1;
-	}
-
-	SiS_SetReg3(DACAddr,0x00);
-
-	for(i=0; i<j; i++) {
-	   data = table[i];
-	   for(k=0; k<3; k++) {
-		data2 = 0;
-		if(data & 0x01) data2 = 0x2A;
-		if(data & 0x02) data2 += 0x15;
-		if(shiftflag) data2 <<= 2;
-		SiS_SetReg3(DACData,data2);
-		data >>= 2;
-	   }
+        SiS_SetReg(SiS_Pr->SiS_P3d4,0x52,0x6c);
+     }
+#if 0   /* What is SR0E[D5:6]? */
+     if(HwInfo->jChipType >= SIS_661) {
+        data = 0;
+        if((ModeNo == 6) || ((ModeNo >= 0x0e) && (ModeNo <= 0x13))) {
+	   data |= 0x20;
 	}
-
-	if(time == 256) {
-	   for(i = 16; i < 32; i++) {
-		data = table[i];
-		if(shiftflag) data <<= 2;
-		for(k=0; k<3; k++) SiS_SetReg3(DACData,data);
+	if(SiS_Pr->SiS_ModeType != ModeVGA) {
+	   if(SiS_Pr->UseCustomMode) {
+              if((xres >= 640) && (SiS_Pr->CVDisplay >= 480)) {
+	         data |= 0x40;
+	      }
+	      if((xres > 1280) && (SiS_Pr->CVDisplay > 1024)) {
+	         data |= 0x60;
+	      }
 	   }
-	   si = 32;
-	   for(m = 0; m < 9; m++) {
-	      di = si;
-	      bx = si + 4;
-	      dl = 0;
-	      for(n = 0; n < 3; n++) {
-		 for(o = 0; o < 5; o++) {
-		    dh = table[si];
-		    ah = table[di];
-		    al = table[bx];
-		    si++;
-		    SiS_WriteDAC(SiS_Pr,DACData,shiftflag,dl,ah,al,dh);
-		 }
-		 si -= 2;
-		 for(o = 0; o < 3; o++) {
-		    dh = table[bx];
-		    ah = table[di];
-		    al = table[si];
-		    si--;
-		    SiS_WriteDAC(SiS_Pr,DACData,shiftflag,dl,ah,al,dh);
+	} else if(ModeNo > 0x13) {   /* These are in the CRT1 table, and set by CRT1CRTC */
+	   if(resinfo >= SIS_RI_640x480) {
+	      if(resinfo <= SIS_RI_2048x1536) {
+	         data |= 0x40;
+		 if(resinfo > SIS_RI_1280x1024) {
+		    data |= 0x60;
+		    if(resinfo != SIS_RI_1600x1200) {
+		       data = SiS_GetReg(SiS_Pr->SiS_P3c4,0x0e);
+		       data += 0x60;
+		       SiS_SetReg(SiS_Pr->SiS_P3c4,0x0e);
+		       data = 0;
+		    }
 		 }
-		 dl++;
-	      }            /* for n < 3 */
-	      si += 5;
-	   }               /* for m < 9 */
+	      }
+	      if(resinfo == SIS_RI_1152x864) {
+		 data = 0x40;
+	      }
+	      if(resinfo == SIS_RI_1400x1050) { /* TW */
+		 data = 0x60;
+	      }
+	   }
 	}
-#if 0
-    }  /* ds:489 & 0x08 */
+	SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x0e,data);
+     }
 #endif
+  }
+#endif
+}
+
+/*********************************************/
+/*                 LOAD DAC                  */
+/*********************************************/
 
 #if 0
-    if((!(ds:489 & 0x08)) && (ds:489 & 0x06)) {
-           tempbx = 0;
-	   for(i=0; i< 256; i++) {
-               SiS_SetReg3(SiS_Pr->SiS_P3c8-1,tempbx);    	/* 7f87 */
-               tempah = SiS_GetReg3(SiS_Pr->SiS_P3c8+1);  	/* 7f83 */
-	       tempch = SiS_GetReg3(SiS_Pr->SiS_P3c8+1);
-	       tempcl = SiS_GetReg3(SiS_Pr->SiS_P3c8+1);
-	       tempdh = tempah;
-	       tempal = 0x4d * tempdh;          	/* 7fb8 */
-	       tempbx += tempal;
-	       tempal = 0x97 * tempch;
-	       tempbx += tempal;
-	       tempal = 0x1c * tempcl;
-	       tempbx += tempal;
-	       if((tempbx & 0x00ff) > 0x80) tempbx += 0x100;
-	       tempdh = (tempbx & 0x00ff) >> 8;
-	       tempch = tempdh;
-	       tempcl = tempdh;
-	       SiS_SetReg3(SiS_Pr->SiS_P3c8,(tempbx & 0xff));  	/* 7f7c */
-	       SiS_SetReg3(SiS_Pr->SiS_P3c8+1,tempdh);          /* 7f92 */
-	       SiS_SetReg3(SiS_Pr->SiS_P3c8+1,tempch);
-	       SiS_SetReg3(SiS_Pr->SiS_P3c8+1,tempcl);
-           }
-    }
-#endif
+static void
+SiS_ClearDAC(SiS_Private *SiS_Pr, ULONG port)
+{
+   int i;
+
+   OutPortByte(port, 0);
+   port++;
+   for (i=0; i < (256 * 3); i++) {
+      OutPortByte(port, 0);
+   }
 }
+#endif
 
-void
-SiS_WriteDAC(SiS_Private *SiS_Pr, USHORT DACData, USHORT shiftflag,
+static void
+SiS_WriteDAC(SiS_Private *SiS_Pr, SISIOADDRESS DACData, USHORT shiftflag,
              USHORT dl, USHORT ah, USHORT al, USHORT dh)
 {
-  USHORT temp;
-  USHORT bh,bl;
+  USHORT temp,bh,bl;
 
   bh = ah;
   bl = al;
   if(dl != 0) {
-    temp = bh;
-    bh = dh;
-    dh = temp;
-    if(dl == 1) {
-       temp = bl;
-       bl = dh;
-       dh = temp;
-    } else {
-       temp = bl;
-       bl = bh;
-       bh = temp;
-    }
+     temp = bh;
+     bh = dh;
+     dh = temp;
+     if(dl == 1) {
+        temp = bl;
+        bl = dh;
+        dh = temp;
+     } else {
+        temp = bl;
+        bl = bh;
+        bh = temp;
+     }
   }
   if(shiftflag) {
      dh <<= 2;
      bh <<= 2;
      bl <<= 2;
   }
-  SiS_SetReg3(DACData,(USHORT)dh);
-  SiS_SetReg3(DACData,(USHORT)bh);
-  SiS_SetReg3(DACData,(USHORT)bl);
+  SiS_SetRegByte(DACData,(USHORT)dh);
+  SiS_SetRegByte(DACData,(USHORT)bh);
+  SiS_SetRegByte(DACData,(USHORT)bl);
 }
 
-static ULONG
-GetDRAMSize(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension)
+void
+SiS_LoadDAC(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
+            USHORT ModeNo, USHORT ModeIdIndex)
 {
-  ULONG   AdapterMemorySize = 0;
-#ifdef SIS315H
-  USHORT  counter;
-#endif
+   USHORT data,data2;
+   USHORT time,i,j,k,m,n,o;
+   USHORT si,di,bx,dl,al,ah,dh;
+   USHORT shiftflag;
+   SISIOADDRESS DACAddr, DACData;
+   const USHORT *table = NULL;
 
-#ifdef SIS315H
-  if ((HwDeviceExtension->jChipType == SIS_315H) ||
-      (HwDeviceExtension->jChipType == SIS_315)  ||
-      (HwDeviceExtension->jChipType == SIS_315PRO)) {
+   if(ModeNo <= 0x13) {
+      data = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
+   } else {
+      if(SiS_Pr->UseCustomMode) {
+	 data = SiS_Pr->CModeFlag;
+      } else {
+         data = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
+      }
+   }
 
-    	counter = SiS_GetReg1(SiS_Pr->SiS_P3c4,0x14);
-	AdapterMemorySize = 1 << ((counter & 0xF0) >> 4);
-	counter >>= 2;
-	counter &= 0x03;
-	if(counter == 0x02) {
-		AdapterMemorySize += (AdapterMemorySize / 2);      /* DDR asymetric */
-	} else if(counter != 0) {
-		AdapterMemorySize <<= 1;                           /* SINGLE_CHANNEL_2_RANK or DUAL_CHANNEL_1_RANK */
-	}
-	AdapterMemorySize *= (1024*1024);
+   data &= DACInfoFlag;
+   time = 64;
+   if(data == 0x00) table = SiS_MDA_DAC;
+   if(data == 0x08) table = SiS_CGA_DAC;
+   if(data == 0x10) table = SiS_EGA_DAC;
+   if(data == 0x18) {
+      time = 256;
+      table = SiS_VGA_DAC;
+   }
+   if(time == 256) j = 16;
+   else            j = time;
+
+   if( ( (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) &&        /* 301B-DH LCD */
+         (SiS_Pr->SiS_VBType & VB_NoLCD) )        ||
+       (SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)       ||   /* LCDA */
+       (!(SiS_Pr->SiS_SetFlag & ProgrammingCRT2)) ) {  /* Programming CRT1 */
+      DACAddr = SiS_Pr->SiS_P3c8;
+      DACData = SiS_Pr->SiS_P3c9;
+      shiftflag = 0;
+      SiS_SetRegByte(SiS_Pr->SiS_P3c6,0xFF);
+   } else {
+      shiftflag = 1;
+      DACAddr = SiS_Pr->SiS_Part5Port;
+      DACData = SiS_Pr->SiS_Part5Port + 1;
+   }
+
+   SiS_SetRegByte(DACAddr,0x00);
+
+   for(i=0; i<j; i++) {
+      data = table[i];
+      for(k=0; k<3; k++) {
+	data2 = 0;
+	if(data & 0x01) data2 = 0x2A;
+	if(data & 0x02) data2 += 0x15;
+	if(shiftflag) data2 <<= 2;
+	SiS_SetRegByte(DACData, data2);
+	data >>= 2;
+      }
+   }
 
-  } else if(HwDeviceExtension->jChipType == SIS_330) {
+   if(time == 256) {
+      for(i = 16; i < 32; i++) {
+   	 data = table[i];
+	 if(shiftflag) data <<= 2;
+	 for(k = 0; k < 3; k++) SiS_SetRegByte(DACData, data);
+      }
+      si = 32;
+      for(m = 0; m < 9; m++) {
+         di = si;
+         bx = si + 4;
+         dl = 0;
+         for(n = 0; n < 3; n++) {
+  	    for(o = 0; o < 5; o++) {
+	       dh = table[si];
+	       ah = table[di];
+	       al = table[bx];
+	       si++;
+	       SiS_WriteDAC(SiS_Pr, DACData, shiftflag, dl, ah, al, dh);
+	    }
+	    si -= 2;
+	    for(o = 0; o < 3; o++) {
+	       dh = table[bx];
+	       ah = table[di];
+	       al = table[si];
+	       si--;
+	       SiS_WriteDAC(SiS_Pr, DACData, shiftflag, dl, ah, al, dh);
+	    }
+	    dl++;
+	 }            /* for n < 3 */
+	 si += 5;
+      }               /* for m < 9 */
+   }
+}
 
-    	counter = SiS_GetReg1(SiS_Pr->SiS_P3c4,0x14);
-	AdapterMemorySize = 1 << ((counter & 0xF0) >> 4);
-	counter &= 0x0c;
-	if(counter != 0) {
-		AdapterMemorySize <<= 1;
-	}
-	AdapterMemorySize *= (1024*1024);
+/*********************************************/
+/*         SET CRT1 REGISTER GROUP           */
+/*********************************************/
 
-  } else if((HwDeviceExtension->jChipType == SIS_550) ||
-            (HwDeviceExtension->jChipType == SIS_740) ||
-            (HwDeviceExtension->jChipType == SIS_650)) {
+static void
+SiS_SetCRT1Group(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
+                 USHORT ModeNo, USHORT ModeIdIndex)
+{
+  USHORT  StandTableIndex,RefreshRateTableIndex;
 
-  	counter = SiS_GetReg1(SiS_Pr->SiS_P3c4,0x14) & 0x3F;
-      	counter++;
-      	AdapterMemorySize = counter * 4;
-      	AdapterMemorySize *= (1024*1024);
+  SiS_Pr->SiS_CRT1Mode = ModeNo;
+  StandTableIndex = SiS_GetModePtr(SiS_Pr, ModeNo, ModeIdIndex);
+  if(SiS_Pr->SiS_SetFlag & LowModeTests) {
+     if(SiS_Pr->SiS_VBInfo & (SetSimuScanMode | SwitchCRT2)) {
+        SiS_DisableBridge(SiS_Pr, HwInfo);
+     }
   }
+
+  SiS_ResetSegmentRegisters(SiS_Pr, HwInfo);
+
+  SiS_SetSeqRegs(SiS_Pr, StandTableIndex, HwInfo);
+  SiS_SetMiscRegs(SiS_Pr, StandTableIndex, HwInfo);
+  SiS_SetCRTCRegs(SiS_Pr, HwInfo, StandTableIndex);
+  SiS_SetATTRegs(SiS_Pr, StandTableIndex, HwInfo);
+  SiS_SetGRCRegs(SiS_Pr, StandTableIndex);
+  SiS_ClearExt1Regs(SiS_Pr,HwInfo);
+  SiS_ResetCRT1VCLK(SiS_Pr, HwInfo);
+
+  SiS_Pr->SiS_SelectCRT2Rate = 0;
+  SiS_Pr->SiS_SetFlag &= (~ProgrammingCRT2);
+
+#ifdef LINUX_XF86
+  xf86DrvMsgVerb(0, X_PROBED, 4, "(init: VBType=0x%04x, VBInfo=0x%04x)\n",
+                    SiS_Pr->SiS_VBType, SiS_Pr->SiS_VBInfo);
 #endif
 
-#ifdef SIS300
-  if ((HwDeviceExtension->jChipType==SIS_300) ||
-      (HwDeviceExtension->jChipType==SIS_540) ||
-      (HwDeviceExtension->jChipType==SIS_630) ||
-      (HwDeviceExtension->jChipType==SIS_730)) {
+  if(SiS_Pr->SiS_VBInfo & SetSimuScanMode) {
+     if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) {
+        SiS_Pr->SiS_SetFlag |= ProgrammingCRT2;
+     }
+  }
 
-      	AdapterMemorySize = SiS_GetReg1(SiS_Pr->SiS_P3c4,0x14) & 0x3F;
-      	AdapterMemorySize++;
-      	AdapterMemorySize *= (1024*1024);
+  if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) {
+     SiS_Pr->SiS_SetFlag |= ProgrammingCRT2;
+  }
+
+  RefreshRateTableIndex = SiS_GetRatePtr(SiS_Pr, ModeNo, ModeIdIndex, HwInfo);
+
+  if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) {
+     SiS_Pr->SiS_SetFlag &= ~ProgrammingCRT2;
+  }
+
+  if(RefreshRateTableIndex != 0xFFFF) {
+     SiS_SetCRT1Sync(SiS_Pr, RefreshRateTableIndex);
+     SiS_SetCRT1CRTC(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, HwInfo);
+     SiS_SetCRT1Offset(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, HwInfo);
+     SiS_SetCRT1VCLK(SiS_Pr, ModeNo, ModeIdIndex, HwInfo, RefreshRateTableIndex);
+  }
 
+#ifdef SIS300
+  if(HwInfo->jChipType == SIS_300) {
+     SiS_SetCRT1FIFO_300(SiS_Pr, ModeNo,HwInfo,RefreshRateTableIndex);
+  } else if((HwInfo->jChipType == SIS_630) ||
+            (HwInfo->jChipType == SIS_730) ||
+            (HwInfo->jChipType == SIS_540)) {
+     SiS_SetCRT1FIFO_630(SiS_Pr, ModeNo, HwInfo, RefreshRateTableIndex);
+  }
+#endif
+#ifdef SIS315H
+  if(HwInfo->jChipType >= SIS_315H) {
+     SiS_SetCRT1FIFO_310(SiS_Pr, ModeNo, ModeIdIndex, HwInfo);
   }
 #endif
 
-  return AdapterMemorySize;
-}
+  SiS_SetCRT1ModeRegs(SiS_Pr, HwInfo, ModeNo, ModeIdIndex, RefreshRateTableIndex);
 
-#ifndef LINUX_XF86
-void
-SiS_ClearBuffer(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT ModeNo)
-{
-  PVOID   VideoMemoryAddress = (PVOID)HwDeviceExtension->pjVideoMemoryAddress;
-  ULONG   AdapterMemorySize  = (ULONG)HwDeviceExtension->ulVideoMemorySize;
-  PUSHORT pBuffer;
-  int i;
+  SiS_LoadDAC(SiS_Pr, HwInfo, ModeNo, ModeIdIndex);
 
-  if (SiS_Pr->SiS_ModeType>=ModeEGA) {
-    if(ModeNo > 0x13) {
-      AdapterMemorySize = GetDRAMSize(SiS_Pr, HwDeviceExtension);
-      SiS_SetMemory(VideoMemoryAddress,AdapterMemorySize,0);
-    } else {
-      pBuffer = VideoMemoryAddress;
-      for(i=0; i<0x4000; i++)
-         pBuffer[i] = 0x0000;
-    }
-  } else {
-    pBuffer = VideoMemoryAddress;
-    if (SiS_Pr->SiS_ModeType < ModeCGA) {
-      for(i=0; i<0x4000; i++)
-         pBuffer[i] = 0x0720;
-    } else {
-      SiS_SetMemory(VideoMemoryAddress,0x8000,0);
-    }
+#ifndef LINUX_XF86
+  if(SiS_Pr->SiS_flag_clearbuffer) {
+     SiS_ClearBuffer(SiS_Pr,HwInfo,ModeNo);
   }
-}
 #endif
 
-void
-SiS_DisplayOn(SiS_Private *SiS_Pr)
-{
-   SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x01,0xDF,0x00);
-}
-
-void
-SiS_DisplayOff(SiS_Private *SiS_Pr)
-{
-   SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x01,0xDF,0x20);
+  if(!(SiS_Pr->SiS_VBInfo & (SetSimuScanMode | SwitchCRT2 | SetCRT2ToLCDA))) {
+     SiS_WaitRetrace1(SiS_Pr);
+     SiS_DisplayOn(SiS_Pr);
+  }
 }
 
+/*********************************************/
+/*            HELPER: ENABLE CRT1            */
+/*********************************************/
 
-/* ========================================== */
-/*  SR CRTC GR */
-void
-SiS_SetReg1(USHORT port, USHORT index, USHORT data)
+static void
+SiS_HandleCRT1(SiS_Private *SiS_Pr)
 {
-   OutPortByte(port,index);
-   OutPortByte(port+1,data);
+  SiS_SetRegAND(SiS_Pr->SiS_P3d4,SiS_Pr->SiS_MyCR63,0xbf);
+#if 0
+  if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x15) & 0x01)) {
+     if((SiS_GetReg(SiS_Pr->SiS_P3c4,0x15) & 0x0a) ||
+        (SiS_GetReg(SiS_Pr->SiS_P3c4,0x16) & 0x01)) {
+        SiS_SetRegOR(SiS_Pr->SiS_P3d4,SiS_Pr->SiS_MyCR63,0x40);
+     }
+  }
+#endif
 }
 
-/* ========================================== */
-/*  AR(3C0) */
-void
-SiS_SetReg2(SiS_Private *SiS_Pr, USHORT port, USHORT index, USHORT data)
-{
-   InPortByte(port+0x3da-0x3c0);
-   OutPortByte(SiS_Pr->SiS_P3c0,index);
-   OutPortByte(SiS_Pr->SiS_P3c0,data);
-   OutPortByte(SiS_Pr->SiS_P3c0,0x20);
-}
+/*********************************************/
+/*         HELPER: SET VIDEO REGISTERS       */
+/*********************************************/
 
-void
-SiS_SetReg3(USHORT port, USHORT data)
+static void
+SiS_StrangeStuff(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
 {
-   OutPortByte(port,data);
+   if((IS_SIS651) || (IS_SISM650)) {
+      SiS_SetReg(SiS_Pr->SiS_VidCapt, 0x3f, 0x00);   /* Fiddle with capture regs */
+      SiS_SetReg(SiS_Pr->SiS_VidCapt, 0x00, 0x00);
+      SiS_SetReg(SiS_Pr->SiS_VidPlay, 0x00, 0x86);   /* (BIOS does NOT unlock) */
+      SiS_SetRegAND(SiS_Pr->SiS_VidPlay, 0x30, 0xfe); /* Fiddle with video regs */
+      SiS_SetRegAND(SiS_Pr->SiS_VidPlay, 0x3f, 0xef);
+   }
+   /* !!! This does not support modes < 0x13 !!! */
 }
 
-void
-SiS_SetReg4(USHORT port, ULONG data)
-{
-   OutPortLong(port,data);
-}
+/*********************************************/
+/*         XFree86: SET SCREEN PITCH         */
+/*********************************************/
 
-void
-SiS_SetReg5(USHORT port, USHORT data)
+#ifdef LINUX_XF86
+static void
+SiS_SetPitchCRT1(SiS_Private *SiS_Pr, ScrnInfoPtr pScrn)
 {
-   OutPortWord(port,data);
+   SISPtr pSiS = SISPTR(pScrn);
+   UShort HDisplay = pSiS->scrnPitch >> 3;
+
+   SiS_SetReg(SiS_Pr->SiS_P3d4,0x13,(HDisplay & 0xFF));
+   SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x0E,0xF0,(HDisplay>>8));
 }
 
-UCHAR SiS_GetReg1(USHORT port, USHORT index)
+static void
+SiS_SetPitchCRT2(SiS_Private *SiS_Pr, ScrnInfoPtr pScrn)
 {
-   UCHAR   data;
+   SISPtr pSiS = SISPTR(pScrn);
+   UShort HDisplay = pSiS->scrnPitch2 >> 3;
 
-   OutPortByte(port,index);
-   data = InPortByte(port+1);
+    /* Unlock CRT2 */
+   if(pSiS->VGAEngine == SIS_315_VGA)
+     SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2F, 0x01);
+   else
+     SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x24, 0x01);
 
-   return(data);
+   SiS_SetReg(SiS_Pr->SiS_Part1Port,0x07,(HDisplay & 0xFF));
+   SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x09,0xF0,(HDisplay >> 8));
 }
 
-UCHAR
-SiS_GetReg2(USHORT port)
+static void
+SiS_SetPitch(SiS_Private *SiS_Pr, ScrnInfoPtr pScrn)
 {
-   UCHAR   data;
+   SISPtr pSiS = SISPTR(pScrn);
+   BOOLEAN isslavemode = FALSE;
 
-   data= InPortByte(port);
+   if( (pSiS->VBFlags & VB_VIDEOBRIDGE) &&
+       ( ((pSiS->VGAEngine == SIS_300_VGA) &&
+          (SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0xa0) == 0x20) ||
+         ((pSiS->VGAEngine == SIS_315_VGA) &&
+	  (SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0x50) == 0x10) ) ) {
+      isslavemode = TRUE;
+   }
 
-   return(data);
+   /* We need to set pitch for CRT1 if bridge is in slave mode, too */
+   if((pSiS->VBFlags & DISPTYPE_DISP1) || (isslavemode)) {
+      SiS_SetPitchCRT1(SiS_Pr, pScrn);
+   }
+   /* We must not set the pitch for CRT2 if bridge is in slave mode */
+   if((pSiS->VBFlags & DISPTYPE_DISP2) && (!isslavemode)) {
+      SiS_SetPitchCRT2(SiS_Pr, pScrn);
+   }
 }
+#endif
 
-ULONG
-SiS_GetReg3(USHORT port)
+/*********************************************/
+/*                 SiSSetMode()              */
+/*********************************************/
+
+#ifdef LINUX_XF86
+/* We need pScrn for setting the pitch correctly */
+BOOLEAN
+SiSSetMode(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,ScrnInfoPtr pScrn,USHORT ModeNo, BOOLEAN dosetpitch)
+#else
+BOOLEAN
+SiSSetMode(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,USHORT ModeNo)
+#endif
 {
-   ULONG   data;
+   ULONG   temp;
+   USHORT  ModeIdIndex;
+   UCHAR  *ROMAddr  = HwInfo->pjVirtualRomBase;
+   SISIOADDRESS BaseAddr = HwInfo->ulIOAddress;
+   unsigned char backupreg=0;
+#ifndef LINUX_XF86
+   USHORT  KeepLockReg;
 
-   data = InPortLong(port);
+   SiS_Pr->UseCustomMode = FALSE;
+   SiS_Pr->CRT1UsesCustomMode = FALSE;
+#endif
 
-   return(data);
-}
+   if(SiS_Pr->UseCustomMode) {
+      ModeNo = 0xfe;
+   }
 
-USHORT
-SiS_GetReg4(USHORT port)
-{
-   ULONG   data;
+   SiSInitPtr(SiS_Pr, HwInfo);
+   SiSRegInit(SiS_Pr, BaseAddr);
+   SiS_GetSysFlags(SiS_Pr, HwInfo);
 
-   data = InPortWord(port);
+#ifdef LINUX_XF86
+   if(pScrn) SiS_Pr->SiS_VGAINFO = SiS_GetSetBIOSScratch(pScrn, 0x489, 0xff);
+   else
+#endif
+         SiS_Pr->SiS_VGAINFO = 0x11;
 
-   return(data);
-}
+   SiSInitPCIetc(SiS_Pr, HwInfo);
+   SiSSetLVDSetc(SiS_Pr, HwInfo);
+   SiSDetermineROMUsage(SiS_Pr, HwInfo);
 
-void
-SiS_ClearDAC(SiS_Private *SiS_Pr, ULONG port)
-{
-   int i;
+   if(!SiS_Pr->UseCustomMode) {
+      ModeNo = ((ModeNo & 0x80) << 8) | (ModeNo & 0x7f);
+   }
 
-   OutPortByte(port, 0);
-   port++;
-   for (i=0; i < (256 * 3); i++) {
-      OutPortByte(port, 0);
+#ifdef LINUX_XF86
+   /* We never clear the buffer in X */
+   ModeNo |= 0x8000;
+#endif
+
+   if(ModeNo & 0x8000) {
+     	ModeNo &= 0x7fff;
+     	SiS_Pr->SiS_flag_clearbuffer = 0;
+   } else {
+     	SiS_Pr->SiS_flag_clearbuffer = 1;
    }
 
-}
+#ifndef LINUX_XF86
+   KeepLockReg = SiS_GetReg(SiS_Pr->SiS_P3c4,0x05);
+#endif
+   SiS_SetReg(SiS_Pr->SiS_P3c4,0x05,0x86);
 
-#if 0  /* TW: Unused */
-void
-SiS_SetInterlace(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT RefreshRateTableIndex)
-{
-  ULONG Temp;
-  USHORT data,Temp2;
+   SiS_UnLockCRT2(SiS_Pr, HwInfo);
 
-  if (ModeNo<=0x13) return;
+   if(!SiS_Pr->UseCustomMode) {
+      if(!(SiS_SearchModeID(SiS_Pr, &ModeNo, &ModeIdIndex))) return FALSE;
+   } else {
+      ModeIdIndex = 0;
+   }
 
-  Temp = (ULONG)SiS_GetReg1(SiS_Pr->SiS_P3d4,0x01);
-  Temp++;
-  Temp <<= 3;
+   SiS_GetVBType(SiS_Pr, HwInfo);
 
-  if(Temp == 1024) data = 0x0035;
-  else if(Temp == 1280) data = 0x0048;
-  else data = 0x0000;
+   /* Init/restore some VB registers */
+
+   if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
+      if(HwInfo->jChipType >= SIS_315H) {
+         SiS_UnLockCRT2(SiS_Pr,HwInfo);
+	 if(ROMAddr && SiS_Pr->SiS_UseROM) {
+	    if(HwInfo->jChipType < SIS_330) {
+               temp = ROMAddr[VB310Data_1_2_Offset];
+	       temp |= 0x40;
+	       SiS_SetReg(SiS_Pr->SiS_Part1Port,0x02,temp);
+            }
+	    if(HwInfo->jChipType > SIS_330) {
+	       temp = ROMAddr[0x7e];
+	       if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x7b) >= 100) temp |= 0x40;
+	       SiS_SetReg(SiS_Pr->SiS_Part1Port,0x02,temp);
+	    }
+	 }
+	 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x32,0x10);
 
-  Temp2 = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_InfoFlag;
-  Temp2 &= InterlaceMode;
-  if(Temp2 == 0) data=0x0000;
+	 SiS_SetRegOR(SiS_Pr->SiS_Part2Port,0x00,0x0c);
 
-  SiS_SetReg1(SiS_Pr->SiS_P3d4,0x19,data);
+         backupreg = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38);
+      } else {
+         backupreg = SiS_GetReg(SiS_Pr->SiS_P3d4,0x35);
+      }
+   }
 
-  Temp = (ULONG)SiS_GetReg1(SiS_Pr->SiS_P3d4,0x1A);
-  Temp = (USHORT)(Temp & 0xFC);
-  SiS_SetReg1(SiS_Pr->SiS_P3d4,0x1A,(USHORT)Temp);
+   /* Get VB information (connectors, connected devices) */
+   SiS_GetVBInfo(SiS_Pr, ModeNo, ModeIdIndex, HwInfo, (SiS_Pr->UseCustomMode) ? 0 : 1);
+   SiS_SetYPbPr(SiS_Pr, HwInfo);
+   SiS_SetTVMode(SiS_Pr, ModeNo, ModeIdIndex, HwInfo);
+   SiS_GetLCDResInfo(SiS_Pr, ModeNo, ModeIdIndex, HwInfo);
+   SiS_SetLowModeTest(SiS_Pr, ModeNo, HwInfo);
 
-  Temp = (ULONG)SiS_GetReg1(SiS_Pr->SiS_P3c4,0x0f);
-  Temp2 = (USHORT)Temp & 0xBF;
-  if(ModeNo==0x37) Temp2 |= 0x40;
-  SiS_SetReg1(SiS_Pr->SiS_P3d4,0x1A,(USHORT)Temp2);
-}
+#ifndef LINUX_XF86
+   /* 3. Check memory size (Kernel framebuffer driver only) */
+   temp = SiS_CheckMemorySize(SiS_Pr, HwInfo, ModeNo, ModeIdIndex);
+   if(!temp) return(0);
 #endif
 
-#ifdef SIS315H
-void
-SiS_SetCRT1FIFO_310(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
-                PSIS_HW_DEVICE_INFO HwDeviceExtension)
-{
-  USHORT modeflag;
+   if(HwInfo->jChipType >= SIS_315H) {
+#if 0
+      if(SiS_GetReg(SiS_Pr->SiS_P3c4,0x17) & 0x08)  {
+         if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
+            if(ModeNo != 0x10)  SiS_Pr->SiS_SetFlag |= SetDOSMode;
+         } else if((IS_SIS651) && (SiS_Pr->SiS_VBType & VB_NoLCD)) {
+            SiS_Pr->SiS_SetFlag |= SetDOSMode;
+         }
+      }
+#endif
 
-  SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x3D,0xFE);  /* disable auto-threshold */
+      if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
+         if(IS_SIS650) {
+	    SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x51,0x1f);
+	    if(IS_SIS651) SiS_SetRegOR(SiS_Pr->SiS_P3d4,0x51,0x20);
+	    SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x56,0xe7);
+	 } else if(IS_SIS661741660760) {
+	    SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x51,0x1f);
+	    SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x56,0xe7);
+	    SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x3a,0xef);
+	 }
+      }
+   }
+
+   if(SiS_Pr->UseCustomMode) {
+      SiS_Pr->CRT1UsesCustomMode = TRUE;
+      SiS_Pr->CSRClock_CRT1 = SiS_Pr->CSRClock;
+      SiS_Pr->CModeFlag_CRT1 = SiS_Pr->CModeFlag;
+   } else {
+      SiS_Pr->CRT1UsesCustomMode = FALSE;
+   }
+
+   /* Set mode on CRT1 */
+   if( (SiS_Pr->SiS_VBInfo & (SetSimuScanMode | SetCRT2ToLCDA)) ||
+       (!(SiS_Pr->SiS_VBInfo & SwitchCRT2)) ) {
+      SiS_SetCRT1Group(SiS_Pr, HwInfo, ModeNo, ModeIdIndex);
+   }
+
+   /* Set mode on CRT2 */
+   if(SiS_Pr->SiS_VBInfo & (SetSimuScanMode | SwitchCRT2 | SetCRT2ToLCDA)) {
+      if( (SiS_Pr->SiS_VBType & VB_SISVB)    ||
+          (SiS_Pr->SiS_IF_DEF_LVDS     == 1) ||
+          (SiS_Pr->SiS_IF_DEF_CH70xx   != 0) ||
+          (SiS_Pr->SiS_IF_DEF_TRUMPION != 0) ) {
+         SiS_SetCRT2Group(SiS_Pr, HwInfo, ModeNo);
+      }
+   }
+
+   SiS_HandleCRT1(SiS_Pr);
+
+   SiS_StrangeStuff(SiS_Pr, HwInfo);
+
+   SiS_DisplayOn(SiS_Pr);
+   SiS_SetRegByte(SiS_Pr->SiS_P3c6,0xFF);
+
+   if(HwInfo->jChipType >= SIS_315H) {
+      if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
+         if(!(SiS_IsDualEdge(SiS_Pr, HwInfo))) {
+	    SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x13,0xfb);
+	 }
+      }
+   }
+
+   if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
+      if(HwInfo->jChipType >= SIS_315H) {
+         if(HwInfo->jChipType < SIS_661) {
+	    if(SiS_IsVAMode(SiS_Pr,HwInfo)) {
+	       SiS_SetRegOR(SiS_Pr->SiS_P3d4,0x35,0x01);
+	    } else {
+	       SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x35,0xFE);
+	    }
+	 }
+
+	 SiS_SetReg(SiS_Pr->SiS_P3d4,0x38,backupreg);
+
+	 if((IS_SIS650) && (SiS_GetReg(SiS_Pr->SiS_P3d4,0x30) & 0xfc)) {
+	    if((ModeNo == 0x03) || (ModeNo == 0x10)) {
+	       SiS_SetRegOR(SiS_Pr->SiS_P3d4,0x51,0x80);
+	       SiS_SetRegOR(SiS_Pr->SiS_P3d4,0x56,0x08);
+            }
+	 }
+
+	 if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x30) & SetCRT2ToLCD) {
+	    SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x38,0xfc);
+	 }
+      } else if((HwInfo->jChipType == SIS_630) ||
+                (HwInfo->jChipType == SIS_730)) {
+         SiS_SetReg(SiS_Pr->SiS_P3d4,0x35,backupreg);
+      }
+   }
+
+#ifdef LINUX_XF86
+   if(pScrn) {
+      /* SetPitch: Adapt to virtual size & position */
+      if((ModeNo > 0x13) && (dosetpitch)) {
+         SiS_SetPitch(SiS_Pr, pScrn);
+      }
 
-  if(ModeNo > 0x13) {
-    if(SiS_Pr->UseCustomMode) {
-       modeflag = SiS_Pr->CModeFlag;
-    } else {
-       modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
-    }       
-    if( (!(modeflag & DoubleScanMode)) || (!(modeflag & HalfDCLK))) {
-       SiS_SetReg1(SiS_Pr->SiS_P3c4,0x08,0x34);
-       SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x09,0xF0);
-       SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x3D,0x01);
-    } else {
-       SiS_SetReg1(SiS_Pr->SiS_P3c4,0x08,0xAE);
-       SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x09,0xF0);
-    }
-  } else {
-    SiS_SetReg1(SiS_Pr->SiS_P3c4,0x08,0xAE);
-    SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x09,0xF0);
-  }
-}
+      /* Backup/Set ModeNo in BIOS scratch area */
+      SiS_GetSetModeID(pScrn, ModeNo);
+   }
 #endif
 
-#ifdef SIS300
-void
-SiS_SetCRT1FIFO_300(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,PSIS_HW_DEVICE_INFO HwDeviceExtension,
-                    USHORT RefreshRateTableIndex)
-{
-  USHORT  ThresholdLow = 0;
-  USHORT  index, VCLK, MCLK, colorth=0;
-  USHORT  tempah, temp;
+#ifndef LINUX_XF86  /* We never lock registers in XF86 */
+   if(KeepLockReg == 0xA1) SiS_SetReg(SiS_Pr->SiS_P3c4,0x05,0x86);
+   else SiS_SetReg(SiS_Pr->SiS_P3c4,0x05,0x00);
+#endif
 
-  if(ModeNo > 0x13) {
+   return TRUE;
+}
 
-     if(SiS_Pr->UseCustomMode) {
-        VCLK = SiS_Pr->CSRClock;
-     } else {
-        index = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRTVCLK;
-        index &= 0x3F;
-        VCLK = SiS_Pr->SiS_VCLKData[index].CLOCK;             /* Get VCLK  */
-     }
+/*********************************************/
+/*          XFree86: SiSBIOSSetMode()        */
+/*           for non-Dual-Head mode          */
+/*********************************************/
 
-     switch (SiS_Pr->SiS_ModeType - ModeEGA) {     /* Get half colordepth */
-        case 0 : colorth = 1; break;
-        case 1 : colorth = 1; break;
-        case 2 : colorth = 2; break;
-        case 3 : colorth = 2; break;
-        case 4 : colorth = 3; break;
-        case 5 : colorth = 4; break;
-     }
+#ifdef LINUX_XF86
+BOOLEAN
+SiSBIOSSetMode(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, ScrnInfoPtr pScrn,
+               DisplayModePtr mode, BOOLEAN IsCustom)
+{
+   SISPtr  pSiS = SISPTR(pScrn);
+   UShort  ModeNo=0;
 
-     index = SiS_GetReg1(SiS_Pr->SiS_P3c4,0x3A);
-     index &= 0x07;
-     MCLK = SiS_Pr->SiS_MCLKData_0[index].CLOCK;           /* Get MCLK  */
+   SiS_Pr->UseCustomMode = FALSE;
 
-     tempah = SiS_GetReg1(SiS_Pr->SiS_P3d4,0x35);
-     tempah &= 0xc3;
-     SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x16,0x3c,tempah);
+   if((IsCustom) && (SiS_CheckBuildCustomMode(pScrn, mode, pSiS->VBFlags))) {
 
-     do {
-        ThresholdLow = SiS_CalcDelay(SiS_Pr, ROMAddr, VCLK, colorth, MCLK);
-        ThresholdLow++;
-        if(ThresholdLow < 0x13) break;
-        SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x16,0xfc);
-        ThresholdLow = 0x13;
-        tempah = SiS_GetReg1(SiS_Pr->SiS_P3c4,0x16);
-        tempah >>= 6;
-        if(!(tempah)) break;
-        tempah--;
-        tempah <<= 6;
-        SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x16,0x3f,tempah);
-     } while(0);
+         xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, "Setting custom mode %dx%d\n",
+	 	SiS_Pr->CHDisplay,
+		(mode->Flags & V_INTERLACE ? SiS_Pr->CVDisplay * 2 :
+		   (mode->Flags & V_DBLSCAN ? SiS_Pr->CVDisplay / 2 :
+		      SiS_Pr->CVDisplay)));
 
-  } else ThresholdLow = 2;
+	 return(SiSSetMode(SiS_Pr, HwInfo, pScrn, ModeNo, TRUE));
 
-  /* Write CRT/CPU threshold low, CRT/Engine threshold high */
-  temp = (ThresholdLow << 4) | 0x0f;
-  SiS_SetReg1(SiS_Pr->SiS_P3c4,0x08,temp);
+   }
 
-  temp = (ThresholdLow & 0x10) << 1;
-  if(ModeNo > 0x13) temp |= 0x40;
-  SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x0f,0x9f,temp);
+   ModeNo = SiS_CalcModeIndex(pScrn, mode, pSiS->VBFlags, pSiS->HaveCustomModes);
+   if(!ModeNo) return FALSE;
 
-  /* What is this? */
-  SiS_SetReg1(SiS_Pr->SiS_P3c4,0x3B,0x09);
+   xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, "Setting standard mode 0x%x\n", ModeNo);
 
-  /* Write CRT/CPU threshold high */
-  temp = ThresholdLow + 3;
-  if(temp > 0x0f) temp = 0x0f;
-  SiS_SetReg1(SiS_Pr->SiS_P3c4,0x09,temp);
+   return(SiSSetMode(SiS_Pr, HwInfo, pScrn, ModeNo, TRUE));
 }
 
-USHORT
-SiS_CalcDelay(SiS_Private *SiS_Pr, UCHAR *ROMAddr, USHORT VCLK, USHORT colordepth, USHORT MCLK)
+/*********************************************/
+/*       XFree86: SiSBIOSSetModeCRT2()       */
+/*           for Dual-Head modes             */
+/*********************************************/
+BOOLEAN
+SiSBIOSSetModeCRT2(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, ScrnInfoPtr pScrn,
+               DisplayModePtr mode, BOOLEAN IsCustom)
 {
-  USHORT tempax, tempbx;
+   ULONG   temp;
+   USHORT  ModeIdIndex;
+   UCHAR  *ROMAddr  = HwInfo->pjVirtualRomBase;
+   SISIOADDRESS BaseAddr = HwInfo->ulIOAddress;
+   UShort  ModeNo   = 0;
+   unsigned char backupreg=0;
+   SISPtr  pSiS     = SISPTR(pScrn);
+#ifdef SISDUALHEAD
+   SISEntPtr pSiSEnt = pSiS->entityPrivate;
+#endif
 
-  tempbx = SiS_DoCalcDelay(SiS_Pr, MCLK, VCLK, colordepth, 0);
-  tempax = SiS_DoCalcDelay(SiS_Pr, MCLK, VCLK, colordepth, 1);
-  if(tempax < 4) tempax = 4;
-  tempax -= 4;
-  if(tempbx < tempax) tempbx = tempax;
-  return(tempbx);
-}
+   SiS_Pr->UseCustomMode = FALSE;
 
-USHORT
-SiS_DoCalcDelay(SiS_Private *SiS_Pr, USHORT MCLK, USHORT VCLK, USHORT colordepth, USHORT key)
-{
-  const UCHAR ThLowA[]   = { 61, 3,52, 5,68, 7,100,11,
-                             43, 3,42, 5,54, 7, 78,11,
-                             34, 3,37, 5,47, 7, 67,11 };
+   /* Remember: Custom modes for CRT2 are ONLY supported
+    * 		-) on 315/330 series,
+    *           -) on the 30x/B/C, and
+    *           -) if CRT2 is LCD or VGA
+    */
 
-  const UCHAR ThLowB[]   = { 81, 4,72, 6,88, 8,120,12,
-                             55, 4,54, 6,66, 8, 90,12,
-                             42, 4,45, 6,55, 8, 75,12 };
+   if((IsCustom) && (SiS_CheckBuildCustomMode(pScrn, mode, pSiS->VBFlags))) {
 
-  const UCHAR ThTiming[] = {  1, 2, 2, 3, 0, 1,  1, 2 };
+	 ModeNo = 0xfe;
 
-  USHORT tempah, tempal, tempcl, tempbx, temp;
-  ULONG  longtemp;
+   } else {
 
-  tempah = SiS_GetReg1(SiS_Pr->SiS_P3c4,0x18);
-  tempah &= 0x62;
-  tempah >>= 1;
-  tempal = tempah;
-  tempah >>= 3;
-  tempal |= tempah;
-  tempal &= 0x07;
-  tempcl = ThTiming[tempal];
-  tempbx = SiS_GetReg1(SiS_Pr->SiS_P3c4,0x16);
-  tempbx >>= 6;
-  tempah = SiS_GetReg1(SiS_Pr->SiS_P3c4,0x14);
-  tempah >>= 4;
-  tempah &= 0x0c;
-  tempbx |= tempah;
-  tempbx <<= 1;
-  if(key == 0) {
-     tempal = ThLowA[tempbx + 1];
-     tempal *= tempcl;
-     tempal += ThLowA[tempbx];
-  } else {
-     tempal = ThLowB[tempbx + 1];
-     tempal *= tempcl;
-     tempal += ThLowB[tempbx];
-  }
-  longtemp = tempal * VCLK * colordepth;
-  temp = longtemp % (MCLK * 16);
-  longtemp /= (MCLK * 16);
-  if(temp) longtemp++;
-  return((USHORT)longtemp);
-}
+         BOOLEAN havecustommodes = pSiS->HaveCustomModes;
 
-#if 0  /* TW: Old fragment, unused */
-USHORT
-SiS_CalcDelay(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT key)
-{
-  USHORT data,data2,temp0,temp1;
-  UCHAR   ThLowA[]=   {61,3,52,5,68,7,100,11,
-                       43,3,42,5,54,7, 78,11,
-                       34,3,37,5,47,7, 67,11};
-
-  UCHAR   ThLowB[]=   {81,4,72,6,88,8,120,12,
-                       55,4,54,6,66,8, 90,12,
-                       42,4,45,6,55,8, 75,12};
-
-  UCHAR   ThTiming[]= {1,2,2,3,0,1,1,2};
-
-  data=SiS_GetReg1(SiS_Pr->SiS_P3c4,0x16);
-  data=data>>6;
-  data2=SiS_GetReg1(SiS_Pr->SiS_P3c4,0x14);
-  data2=(data2>>4)&0x0C;
-  data=data|data2;
-  data=data<1;
-  if(key==0) {
-    temp0=(USHORT)ThLowA[data];
-    temp1=(USHORT)ThLowA[data+1];
-  } else {
-    temp0=(USHORT)ThLowB[data];
-    temp1=(USHORT)ThLowB[data+1];
-  }
+#ifdef SISMERGED
+	 if(pSiS->MergedFB) havecustommodes = pSiS->HaveCustomModes2;
+#endif
 
-  data2=0;
-  data=SiS_GetReg1(SiS_Pr->SiS_P3c4,0x18);
-  if(data&0x02) data2=data2|0x01;
-  if(data&0x20) data2=data2|0x02;
-  if(data&0x40) data2=data2|0x04;
+         ModeNo = SiS_CalcModeIndex(pScrn, mode, pSiS->VBFlags, havecustommodes);
+         if(!ModeNo) return FALSE;
 
-  data=temp1*ThTiming[data2]+temp0;
-  return(data);
-}
+   }
+
+   SiSRegInit(SiS_Pr, BaseAddr);
+   SiSInitPtr(SiS_Pr, HwInfo);
+   SiS_GetSysFlags(SiS_Pr, HwInfo);
+   SiS_Pr->SiS_VGAINFO = SiS_GetSetBIOSScratch(pScrn, 0x489, 0xff);
+   SiSInitPCIetc(SiS_Pr, HwInfo);
+   SiSSetLVDSetc(SiS_Pr, HwInfo);
+   SiSDetermineROMUsage(SiS_Pr, HwInfo);
+
+   /* Save mode info so we can set it from within SetMode for CRT1 */
+#ifdef SISDUALHEAD
+   if(pSiS->DualHeadMode) {
+      pSiSEnt->CRT2ModeNo = ModeNo;
+      pSiSEnt->CRT2DMode = mode;
+      pSiSEnt->CRT2IsCustom = IsCustom;
+      pSiSEnt->CRT2CR30 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30);
+      pSiSEnt->CRT2CR31 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x31);
+      pSiSEnt->CRT2CR35 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x35);
+      pSiSEnt->CRT2CR38 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38);
+#if 0
+      /* We can't set CRT2 mode before CRT1 mode is set */
+      if(pSiSEnt->CRT1ModeNo == -1) {
+    	 xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3,
+		"Setting CRT2 mode delayed until after setting CRT1 mode\n");
+   	 return TRUE;
+      }
+#endif
+      pSiSEnt->CRT2ModeSet = TRUE;
+   }
 #endif
 
-void
-SiS_SetCRT1FIFO_630(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,
- 		    PSIS_HW_DEVICE_INFO HwDeviceExtension,
-                    USHORT RefreshRateTableIndex)
-{
-  USHORT  i,index,data,VCLK,MCLK,colorth=0;
-  ULONG   B,eax,bl,data2;
-  USHORT  ThresholdLow=0;
-  UCHAR   FQBQData[]= { 
-  	0x01,0x21,0x41,0x61,0x81,
-        0x31,0x51,0x71,0x91,0xb1,
-        0x00,0x20,0x40,0x60,0x80,
-        0x30,0x50,0x70,0x90,0xb0,
-	0xFF
-  };
-  UCHAR   FQBQData730[]= {
-        0x34,0x74,0xb4,
-	0x23,0x63,0xa3,
-	0x12,0x52,0x92,
-	0x01,0x41,0x81,
-	0x00,0x40,0x80,
-	0xff
-  };
+   /* We don't clear the buffer under X */
+   SiS_Pr->SiS_flag_clearbuffer=0;
 
-  i=0;
-  if(ModeNo > 0x13) {
-    if(SiS_Pr->UseCustomMode) {
-       VCLK = SiS_Pr->CSRClock;
-    } else {
-       index = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRTVCLK;
-       index &= 0x3F;
-       VCLK = SiS_Pr->SiS_VCLKData[index].CLOCK;          /* Get VCLK  */
-    }       
+   if(SiS_Pr->UseCustomMode) {
 
-    index = SiS_GetReg1(SiS_Pr->SiS_P3c4,0x1A);
-    index &= 0x07;
-    MCLK = SiS_Pr->SiS_MCLKData_0[index].CLOCK;           /* Get MCLK  */
+      USHORT temptemp = SiS_Pr->CVDisplay;
 
-    data2 = SiS_Pr->SiS_ModeType - ModeEGA;	  /* Get half colordepth */
-    switch (data2) {
-        case 0 : colorth = 1; break;
-        case 1 : colorth = 1; break;
-        case 2 : colorth = 2; break;
-        case 3 : colorth = 2; break;
-        case 4 : colorth = 3; break;
-        case 5 : colorth = 4; break;
-    }
+      if(SiS_Pr->CModeFlag & DoubleScanMode)     temptemp >>= 1;
+      else if(SiS_Pr->CInfoFlag & InterlaceMode) temptemp <<= 1;
 
-    if(HwDeviceExtension->jChipType == SIS_730) {
-    
-       do {
-          B = SiS_CalcDelay2(SiS_Pr, ROMAddr, FQBQData730[i], HwDeviceExtension) * VCLK * colorth;
-	  bl = B / (MCLK * 16);
+      xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3,
+	  "Setting custom mode %dx%d on CRT2\n",
+	  SiS_Pr->CHDisplay, temptemp);
 
-          if(B == bl * 16 * MCLK) {
-             bl = bl + 1;
-          } else {
-             bl = bl + 2;
-          }
+   } else {
 
-          if(bl > 0x13) {
-             if(FQBQData730[i+1] == 0xFF) {
-                ThresholdLow = 0x13;
-                break;
-             }
-             i++;
-          } else {
-             ThresholdLow = bl;
-             break;
-          }
-       } while(FQBQData730[i] != 0xFF);
-       
-    } else {
-    
-       do {
-          B = SiS_CalcDelay2(SiS_Pr, ROMAddr, FQBQData[i], HwDeviceExtension) * VCLK * colorth;
-          bl = B / (MCLK * 16);
+      xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3,
+   	  "Setting standard mode 0x%x on CRT2\n", ModeNo);
 
-          if(B == bl * 16 * MCLK) {
-             bl = bl + 1;
-          } else {
-             bl = bl + 2;
-          }
+   }
 
-          if(bl > 0x13) {
-             if(FQBQData[i+1] == 0xFF) {
-                ThresholdLow = 0x13;
-                break;
-             }
-             i++;
-          } else {
-             ThresholdLow = bl;
-             break;
-          }
-       } while(FQBQData[i] != 0xFF);
-    }
-  }
-  else {
-    if(HwDeviceExtension->jChipType == SIS_730) { 
-    } else {
-      i = 9;
-    }
-    ThresholdLow = 0x02;
-  }
+   SiS_SetReg(SiS_Pr->SiS_P3c4,0x05,0x86);
+
+   SiS_UnLockCRT2(SiS_Pr, HwInfo);
+
+   if(!SiS_Pr->UseCustomMode) {
+      if(!(SiS_SearchModeID(SiS_Pr, &ModeNo, &ModeIdIndex))) return FALSE;
+   } else {
+      ModeIdIndex = 0;
+   }
 
-  /* Write foreground and background queue */
-  if(HwDeviceExtension->jChipType == SIS_730) {  
-   
-     data2 = FQBQData730[i];
-     data2 = (data2 & 0xC0) >> 5;
-     data2 <<= 8;
+   SiS_GetVBType(SiS_Pr, HwInfo);
 
-#ifndef LINUX_XF86
-     SiS_SetReg4(0xcf8,0x80000050);
-     eax = SiS_GetReg3(0xcfc);
-     eax &= 0xfffff9ff;
-     eax |= data2;
-     SiS_SetReg4(0xcfc,eax);
-#else
-     /* We use pci functions X offers. We use pcitag 0, because
-      * we want to read/write to the host bridge (which is always
-      * 00:00.0 on 630, 730 and 540), not the VGA device.
-      */
-     eax = pciReadLong(0x00000000, 0x50);
-     eax &= 0xfffff9ff;
-     eax |= data2;
-     pciWriteLong(0x00000000, 0x50, eax);
-#endif
+   if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
+      if(HwInfo->jChipType >= SIS_315H) {
+         SiS_UnLockCRT2(SiS_Pr,HwInfo);
+         if(ROMAddr && SiS_Pr->SiS_UseROM) {
+	    if(HwInfo->jChipType < SIS_330) {
+               temp = ROMAddr[VB310Data_1_2_Offset];
+	       temp |= 0x40;
+               SiS_SetReg(SiS_Pr->SiS_Part1Port,0x02,temp);
+            }
+	    if(HwInfo->jChipType > SIS_330) {
+	       temp = ROMAddr[0x7e];
+	       if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x7b) >= 100) temp |= 0x40;
+	       SiS_SetReg(SiS_Pr->SiS_Part1Port,0x02,temp);
+	    }
+	 }
+	 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x32,0x10);
 
-     /* Write GUI grant timer (PCI config 0xA3) */
-     data2 = FQBQData730[i] << 8;
-     data2 = (data2 & 0x0f00) | ((data2 & 0x3000) >> 8);
-     data2 <<= 20;
-     
-#ifndef LINUX_XF86
-     SiS_SetReg4(0xcf8,0x800000A0);
-     eax = SiS_GetReg3(0xcfc);
-     eax &= 0x00ffffff;
-     eax |= data2;
-     SiS_SetReg4(0xcfc,eax);
-#else
-     eax = pciReadLong(0x00000000, 0xA0);
-     eax &= 0x00ffffff;
-     eax |= data2;
-     pciWriteLong(0x00000000, 0xA0, eax);
-#endif          
+	 SiS_SetRegOR(SiS_Pr->SiS_Part2Port,0x00,0x0c);
 
-  } else {
-  
-     data2 = FQBQData[i];
-     data2 = (data2 & 0xf0) >> 4;
-     data2 <<= 24;
+         backupreg = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38);
+      } else {
+         backupreg = SiS_GetReg(SiS_Pr->SiS_P3d4,0x35);
+      }
+   }
 
-#ifndef LINUX_XF86
-     SiS_SetReg4(0xcf8,0x80000050);
-     eax = SiS_GetReg3(0xcfc);
-     eax &= 0xf0ffffff;
-     eax |= data2;
-     SiS_SetReg4(0xcfc,eax);
-#else
-     eax = pciReadLong(0x00000000, 0x50);
-     eax &= 0xf0ffffff;
-     eax |= data2;
-     pciWriteLong(0x00000000, 0x50, eax);
-#endif
+   /* Get VB information (connectors, connected devices) */
+   if(!SiS_Pr->UseCustomMode) {
+      SiS_GetVBInfo(SiS_Pr, ModeNo, ModeIdIndex, HwInfo, 1);
+   } else {
+      /* If this is a custom mode, we don't check the modeflag for CRT2Mode */
+      SiS_GetVBInfo(SiS_Pr, ModeNo, ModeIdIndex, HwInfo, 0);
+   }
+   SiS_SetYPbPr(SiS_Pr, HwInfo);
+   SiS_SetTVMode(SiS_Pr, ModeNo, ModeIdIndex, HwInfo);
+   SiS_GetLCDResInfo(SiS_Pr, ModeNo, ModeIdIndex, HwInfo);
+   SiS_SetLowModeTest(SiS_Pr, ModeNo, HwInfo);
 
-     /* Write GUI grant timer (PCI config 0xA3) */
-     data2 = FQBQData[i];
-     data2 &= 0x0f;
-     data2 <<= 24;
+   /* Set mode on CRT2 */
+   if( (SiS_Pr->SiS_VBType & VB_SISVB)    ||
+       (SiS_Pr->SiS_IF_DEF_LVDS     == 1) ||
+       (SiS_Pr->SiS_IF_DEF_CH70xx   != 0) ||
+       (SiS_Pr->SiS_IF_DEF_TRUMPION != 0) ) {
+      SiS_SetCRT2Group(SiS_Pr, HwInfo, ModeNo);
+   }
 
-#ifndef LINUX_XF86
-     SiS_SetReg4(0xcf8,0x800000A0);
-     eax = SiS_GetReg3(0xcfc);
-     eax &= 0xf0ffffff;
-     eax |= data2;
-     SiS_SetReg4(0xcfc,eax);
-#else
-     eax = pciReadLong(0x00000000, 0xA0);
-     eax &= 0xf0ffffff;
-     eax |= data2;
-     pciWriteLong(0x00000000, 0xA0, eax);
-#endif
-     
-  }
+   SiS_StrangeStuff(SiS_Pr, HwInfo);
 
-  /* Write CRT/CPU threshold low, CRT/Engine threshold high */
-  data = ((ThresholdLow & 0x0f) << 4) | 0x0f;
-  SiS_SetReg1(SiS_Pr->SiS_P3c4,0x08,data);
+   SiS_DisplayOn(SiS_Pr);
+   SiS_SetRegByte(SiS_Pr->SiS_P3c6,0xFF);
 
-  data = (ThresholdLow & 0x10) << 1;
-  SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x0F,0xDF,data);
+   if(HwInfo->jChipType >= SIS_315H) {
+      if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
+         if(!(SiS_IsDualEdge(SiS_Pr, HwInfo))) {
+	    SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x13,0xfb);
+	 }
+      }
+   }
 
-  /* What is this? */
-  SiS_SetReg1(SiS_Pr->SiS_P3c4,0x3B,0x09);
+   if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
+      if(HwInfo->jChipType >= SIS_315H) {
+         if(HwInfo->jChipType < SIS_661) {
+	    if(SiS_IsVAMode(SiS_Pr,HwInfo)) {
+	       SiS_SetRegOR(SiS_Pr->SiS_P3d4,0x35,0x01);
+	    } else {
+	       SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x35,0xFE);
+	    }
+	 }
 
-  /* Write CRT/CPU threshold high (gap = 3) */
-  data = ThresholdLow + 3;
-  if(data > 0x0f) data = 0x0f;
-  SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x09,0x80,data);
-}
+	 SiS_SetReg(SiS_Pr->SiS_P3d4,0x38,backupreg);
 
-USHORT
-SiS_CalcDelay2(SiS_Private *SiS_Pr, UCHAR *ROMAddr,UCHAR key, PSIS_HW_DEVICE_INFO HwDeviceExtension)
-{
-  USHORT data,index;
-  const UCHAR  LatencyFactor[] = { 
-   	97, 88, 86, 79, 77, 00,       /*; 64  bit    BQ=2   */
-        00, 87, 85, 78, 76, 54,       /*; 64  bit    BQ=1   */
-        97, 88, 86, 79, 77, 00,       /*; 128 bit    BQ=2   */
-        00, 79, 77, 70, 68, 48,       /*; 128 bit    BQ=1   */
-        80, 72, 69, 63, 61, 00,       /*; 64  bit    BQ=2   */
-        00, 70, 68, 61, 59, 37,       /*; 64  bit    BQ=1   */
-        86, 77, 75, 68, 66, 00,       /*; 128 bit    BQ=2   */
-        00, 68, 66, 59, 57, 37        /*; 128 bit    BQ=1   */
-  };
-  const UCHAR  LatencyFactor730[] = {
-         69, 63, 61, 
-	 86, 79, 77,
-	103, 96, 94,
-	120,113,111,
-	137,130,128,    /* --- Table ends with this entry, data below */
-	137,130,128,	/* to avoid using illegal values              */
-	137,130,128,
-	137,130,128,
-	137,130,128,
-	137,130,128,
-	137,130,128,
-	137,130,128,
-	137,130,128,
-	137,130,128,
-	137,130,128,
-	137,130,128,
-  };
+	 if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x30) & SetCRT2ToLCD) {
+	    SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x38,0xfc);
+	 }
+      } else if((HwInfo->jChipType == SIS_630) ||
+                (HwInfo->jChipType == SIS_730)) {
+         SiS_SetReg(SiS_Pr->SiS_P3d4,0x35,backupreg);
+      }
+   }
 
-  if(HwDeviceExtension->jChipType == SIS_730) {
-     index = ((key & 0x0f) * 3) + ((key & 0xC0) >> 6);
-     data = LatencyFactor730[index];
-  } else {			    
-     index = (key & 0xE0) >> 5;
-     if(key & 0x10) index +=6;
-     if(!(key & 0x01)) index += 24;
-     data = SiS_GetReg1(SiS_Pr->SiS_P3c4,0x14);
-     if(data & 0x0080) index += 12;
-     data = LatencyFactor[index];
-  }
-  return(data);
+   /* SetPitch: Adapt to virtual size & position */
+   SiS_SetPitchCRT2(SiS_Pr, pScrn);
+
+   return TRUE;
 }
-#endif
 
-/* =============== Autodetection ================ */
-/*             I N C O M P L E T E                */
+/*********************************************/
+/*       XFree86: SiSBIOSSetModeCRT1()       */
+/*           for Dual-Head modes             */
+/*********************************************/
 
 BOOLEAN
-SiS_GetPanelID(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension)
+SiSBIOSSetModeCRT1(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, ScrnInfoPtr pScrn,
+                   DisplayModePtr mode, BOOLEAN IsCustom)
 {
-  const USHORT PanelTypeTable300[16] = {
-      0xc101, 0xc117, 0x0121, 0xc135, 0xc142, 0xc152, 0xc162, 0xc072,
-      0xc181, 0xc192, 0xc1a1, 0xc1b6, 0xc1c2, 0xc0d2, 0xc1e2, 0xc1f2
-  };
-  const USHORT PanelTypeTable31030x[16] = {
-      0xc102, 0xc112, 0x0122, 0xc132, 0xc142, 0xc152, 0xc169, 0xc179,
-      0x0189, 0xc192, 0xc1a2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
-  };
-  const USHORT PanelTypeTable310LVDS[16] = {
-      0xc111, 0xc122, 0xc133, 0xc144, 0xc155, 0xc166, 0xc177, 0xc188,
-      0xc199, 0xc0aa, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
-  };
-  USHORT tempax,tempbx,tempah,temp;
+   SISPtr  pSiS = SISPTR(pScrn);
+   SISIOADDRESS BaseAddr = HwInfo->ulIOAddress;
+   USHORT  ModeIdIndex, ModeNo=0;
+   UCHAR backupreg=0;
+#ifdef SISDUALHEAD
+   SISEntPtr pSiSEnt = pSiS->entityPrivate;
+   UCHAR backupcr30, backupcr31, backupcr38, backupcr35, backupp40d=0;
+   BOOLEAN backupcustom;
+#endif
 
-  if(HwDeviceExtension->jChipType < SIS_315H) {
+   SiS_Pr->UseCustomMode = FALSE;
 
-    tempax = SiS_GetReg1(SiS_Pr->SiS_P3c4,0x18);
-    tempbx = tempax & 0x0F;
-    if(!(tempax & 0x10)){
-      if(SiS_Pr->SiS_IF_DEF_LVDS == 1){
-        tempbx = 0;
-        temp = SiS_GetReg1(SiS_Pr->SiS_P3c4,0x38);
-        if(temp & 0x40) tempbx |= 0x08;
-        if(temp & 0x20) tempbx |= 0x02;
-        if(temp & 0x01) tempbx |= 0x01;
-        temp = SiS_GetReg1(SiS_Pr->SiS_P3c4,0x39);
-        if(temp & 0x80) tempbx |= 0x04;
-      } else {
-        return 0;
-      }
-    }
-    tempbx = PanelTypeTable300[tempbx];
-    tempbx |= LCDSync;
-    temp = tempbx & 0x00FF;
-    SiS_SetReg1(SiS_Pr->SiS_P3d4,0x36,temp);
-    temp = (tempbx & 0xFF00) >> 8;
-    SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x37,~(LCDSyncBit|LCDRGB18Bit),temp);
+   if((IsCustom) && (SiS_CheckBuildCustomMode(pScrn, mode, pSiS->VBFlags))) {
 
-  } else {
+         USHORT temptemp = SiS_Pr->CVDisplay;
 
-    tempax = tempah = SiS_GetReg1(SiS_Pr->SiS_P3c4,0x1a);
-    tempax &= 0x1e;
-    tempax >>= 1;
-    if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
-       if(tempax == 0) {
-           /* TODO: Include HUGE detection routine
-	            (Probably not worth bothering)
-	    */
-           return 0;
-       }
-       temp = tempax & 0xff;
-       tempax--;
-       tempbx = PanelTypeTable310LVDS[tempax];
-    } else {
-       tempbx = PanelTypeTable31030x[tempax];
-       temp = tempbx & 0xff;
-    }
-    SiS_SetReg1(SiS_Pr->SiS_P3d4,0x36,temp);
-    tempbx = (tempbx & 0xff00) >> 8;
-    temp = tempbx & 0xc1;
-    SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x37,~(LCDSyncBit|LCDRGB18Bit),temp);
-    if(SiS_Pr->SiS_IF_DEF_LVDS == 0) {
-       temp = tempbx & 0x04;
-       SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x39,0xfb,temp);
-    }
+         if(SiS_Pr->CModeFlag & DoubleScanMode)     temptemp >>= 1;
+         else if(SiS_Pr->CInfoFlag & InterlaceMode) temptemp <<= 1;
 
-  }
-  return 1;
-}
+         xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3,
+	 	"Setting custom mode %dx%d on CRT1\n",
+	 	SiS_Pr->CHDisplay, temptemp);
+	 ModeNo = 0xfe;
 
+   } else {
 
-#ifdef LINUXBIOS
+         ModeNo = SiS_CalcModeIndex(pScrn, mode, pSiS->VBFlags, pSiS->HaveCustomModes);
+         if(!ModeNo) return FALSE;
 
-void
-SiS_DetectMonitor(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT BaseAddr)
-{
-  UCHAR  DAC_TEST_PARMS[] = {0x0F,0x0F,0x0F};
-  UCHAR  DAC_CLR_PARMS[]  = {0x00,0x00,0x00};
-  USHORT SR1F;
-
-  SR1F = SiS_GetReg1(SiS_Pr->SiS_P3c4,0x1F);		/* backup DAC pedestal */
-  SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1F,0x04);
-
-  if(SiS_Pr->SiS_IF_DEF_LVDS == 0) {
-    if(!(SiS_BridgeIsOn(SiS_Pr, BaseAddr))) {
-      SiS_SetReg1(SiS_Pr->SiS_P3d4,0x30,0x41);
-    }
-  }
+         xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3,
+	 	"Setting standard mode 0x%x on CRT1\n", ModeNo);
+   }
 
-  SiSSetMode(SiS_Pr,HwDeviceExtension,0x2E);
-  if(HwDeviceExtension->jChipType >= SIS_650) {
-     /* TW: On 650 only - enable CRT1 */
-     SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x63,0xbf);
-  }
-  SiS_SetReg3(SiS_Pr->SiS_P3c6,0xff);
-  SiS_ClearDAC(SiS_Pr, SiS_Pr->SiS_P3c8);
-  SiS_LongWait(SiS_Pr);
-  SiS_LongWait(SiS_Pr);
-  SiS_LongWait(SiS_Pr);
-  SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x32,0xDF,0x00);
-  if(SiS_TestMonitorType(SiS_Pr, DAC_TEST_PARMS[0],DAC_TEST_PARMS[1],DAC_TEST_PARMS[2])) {
-    SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x32,0xDF,0x20);
-  } else if(SiS_TestMonitorType(SiS_Pr, DAC_TEST_PARMS[0],DAC_TEST_PARMS[1],DAC_TEST_PARMS[2])) {
-    SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x32,0xDF,0x20);
-  }
-  SiS_TestMonitorType(SiS_Pr, DAC_CLR_PARMS[0],DAC_CLR_PARMS[1],DAC_CLR_PARMS[2]);
+   SiSInitPtr(SiS_Pr, HwInfo);
+   SiSRegInit(SiS_Pr, BaseAddr);
+   SiS_GetSysFlags(SiS_Pr, HwInfo);
+   SiS_Pr->SiS_VGAINFO = SiS_GetSetBIOSScratch(pScrn, 0x489, 0xff);
+   SiSInitPCIetc(SiS_Pr, HwInfo);
+   SiSSetLVDSetc(SiS_Pr, HwInfo);
+   SiSDetermineROMUsage(SiS_Pr, HwInfo);
 
-  SiS_SetReg1(SiS_Pr->SiS_P3c4,0x1F,SR1F);
-}
+   /* We don't clear the buffer under X */
+   SiS_Pr->SiS_flag_clearbuffer = 0;
 
-USHORT
-SiS_TestMonitorType(SiS_Private *SiS_Pr, UCHAR R_DAC,UCHAR G_DAC,UCHAR B_DAC)
-{
-   USHORT temp,tempbx;
+   SiS_SetReg(SiS_Pr->SiS_P3c4,0x05,0x86);
 
-   tempbx = R_DAC * 0x4d + G_DAC * 0x97 + B_DAC * 0x1c;
-   if((tempbx & 0x00ff) > 0x80) tempbx += 0x100;
-   tempbx = (tempbx & 0xFF00) >> 8;
-   R_DAC = (UCHAR) tempbx;
-   G_DAC = (UCHAR) tempbx;
-   B_DAC = (UCHAR) tempbx;
-
-   SiS_SetReg3(SiS_Pr->SiS_P3c8,0x00);
-   SiS_SetReg3(SiS_Pr->SiS_P3c9,R_DAC);
-   SiS_SetReg3(SiS_Pr->SiS_P3c9,G_DAC);
-   SiS_SetReg3(SiS_Pr->SiS_P3c9,B_DAC);
-   SiS_LongWait(SiS_Pr);
-   temp=SiS_GetReg2(SiS_Pr->SiS_P3c2);
-   if(temp & 0x10) return(1);
-   else return(0);
-}
+   SiS_UnLockCRT2(SiS_Pr, HwInfo);
 
-void
-SiS_GetSenseStatus(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,UCHAR *ROMAddr)
-{
-  USHORT tempax=0,tempbx,tempcx,temp;
-  USHORT P2reg0=0,SenseModeNo=0,OutputSelect=*SiS_Pr->pSiS_OutputSelect;
-  USHORT ModeIdIndex,i;
-  USHORT BaseAddr = (USHORT)HwDeviceExtension->ulIOAddress;
-
-  if(SiS_Pr->SiS_IF_DEF_LVDS == 1){
-    SiS_GetPanelID(SiS_Pr);
-    temp=LCDSense;
-    temp=temp|SiS_SenseCHTV(SiS_Pr);
-    tempbx=~(LCDSense|AVIDEOSense|SVIDEOSense);
-    SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x32,tempbx,temp);
-  } else {       /* for 301 */
-    if(SiS_Pr->SiS_IF_DEF_HiVision==1) {  /* for HiVision */
-      tempax=SiS_GetReg1(SiS_Pr->SiS_P3c4,0x38);
-      temp=tempax&0x01;
-      tempax=SiS_GetReg1(SiS_Pr->SiS_P3c4,0x3A);
-      temp=temp|(tempax&0x02);
-      SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x32,0xA0,temp);
-    } else {
-      if(SiS_BridgeIsOn(SiS_Pr, BaseAddr)==0) {    /* TW: Inserted "==0" */
-        P2reg0 = SiS_GetReg1(SiS_Pr->SiS_Part2Port,0x00);
-        if(!(SiS_BridgeIsEnable(SiS_Pr, BaseAddr,HwDeviceExtension))) {
-          SenseModeNo=0x2e;
-          temp = SiS_SearchModeID(SiS_Pr, ROMAddr,&SenseModeNo,&ModeIdIndex);
-          SiS_Pr->SiS_SetFlag = 0x00;
-          SiS_Pr->SiS_ModeType = ModeVGA;
-          SiS_Pr->SiS_VBInfo = SetCRT2ToRAMDAC |LoadDACFlag |SetInSlaveMode;
-          SiS_SetCRT2Group301(SiS_Pr, BaseAddr,ROMAddr,SenseModeNo,HwDeviceExtension);
-          for(i=0;i<20;i++) {
-            SiS_LongWait(SiS_Pr);
-          }
-        }
-        SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x00,0x1c);
-        tempax=0;
-        tempbx=*SiS_Pr->pSiS_RGBSenseData;
-	if(SiS_Is301B(SiS_Pr, BaseAddr)){
-                tempbx=*SiS_Pr->pSiS_RGBSenseData2;
-        }
-        tempcx=0x0E08;
-        if(SiS_Sense(SiS_Pr, tempbx,tempcx)){
-          if(SiS_Sense(SiS_Pr, tempbx,tempcx)){
-            tempax=tempax|Monitor2Sense;
-          }
-        }
-        tempbx=*SiS_Pr->pSiS_YCSenseData;
-        if(SiS_Is301B(SiS_Pr, BaseAddr)){
-               tempbx=*SiS_Pr->pSiS_YCSenseData2;
-        }
-        tempcx=0x0604;
-        if(SiS_Sense(SiS_Pr, tempbx,tempcx)){
-          if(SiS_Sense(SiS_Pr,tempbx,tempcx)){
-            tempax=tempax|SVIDEOSense;
-          }
-        }
+   if(!SiS_Pr->UseCustomMode) {
+      if(!(SiS_SearchModeID(SiS_Pr, &ModeNo, &ModeIdIndex))) return FALSE;
+   } else {
+      ModeIdIndex = 0;
+   }
 
-	if(ROMAddr && SiS_Pr->SiS_UseROM) {
-#ifdef SIS300
-	   if((HwDeviceExtension->jChipType==SIS_630)||
-              (HwDeviceExtension->jChipType==SIS_730)) {
-		OutputSelect = ROMAddr[0xfe];
-	   }
-#endif
-#ifdef SIS315H
-	   if(HwDeviceExtension->jChipType >= SIS_315H) {
-	        OutputSelect = ROMAddr[0xf3];
-		if(HwDeviceExtension->jChipType == SIS_330) {
-		     OutputSelect = ROMAddr[0x11b];
-		}
-	   }
-#endif
-        }
-        if(OutputSelect & BoardTVType){
-          tempbx = *SiS_Pr->pSiS_VideoSenseData;
-          if(SiS_Is301B(SiS_Pr, BaseAddr)){
-             tempbx = *SiS_Pr->pSiS_VideoSenseData2;
-          }
-          tempcx = 0x0804;
-          if(SiS_Sense(SiS_Pr, tempbx,tempcx)){
-            if(SiS_Sense(SiS_Pr, tempbx,tempcx)){
-              tempax |= AVIDEOSense;
-            }
-          }
-        } else {
-          if(!(tempax & SVIDEOSense)){
-            tempbx = *SiS_Pr->pSiS_VideoSenseData;
-            if(SiS_Is301B(SiS_Pr, BaseAddr)){
-              tempbx = *SiS_Pr->pSiS_VideoSenseData2;
-            }
-            tempcx = 0x0804;
-            if(SiS_Sense(SiS_Pr,tempbx,tempcx)){
-              if(SiS_Sense(SiS_Pr, tempbx,tempcx)){
-                tempax |= AVIDEOSense;
-              }
-            }
-          }
-        }
+   /* Determine VBType */
+   SiS_GetVBType(SiS_Pr, HwInfo);
+
+   if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
+      if(HwInfo->jChipType >= SIS_315H) {
+         backupreg = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38);
+      } else {
+         backupreg = SiS_GetReg(SiS_Pr->SiS_P3d4,0x35);
       }
+   }
 
-      if(SiS_SenseLCD(SiS_Pr, HwDeviceExtension)){
-        tempax |= LCDSense;
+   /* Get VB information (connectors, connected devices) */
+   /* (We don't care if the current mode is a CRT2 mode) */
+   SiS_GetVBInfo(SiS_Pr, ModeNo, ModeIdIndex, HwInfo, 0);
+   SiS_SetYPbPr(SiS_Pr, HwInfo);
+   SiS_SetTVMode(SiS_Pr, ModeNo, ModeIdIndex, HwInfo);
+   SiS_GetLCDResInfo(SiS_Pr, ModeNo, ModeIdIndex, HwInfo);
+   SiS_SetLowModeTest(SiS_Pr, ModeNo, HwInfo);
+
+   if(HwInfo->jChipType >= SIS_315H) {
+#if 0
+      if(SiS_GetReg(SiS_Pr->SiS_P3c4,0x17) & 0x08)  {
+         if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
+            if(ModeNo != 0x10)  SiS_Pr->SiS_SetFlag |= SetDOSMode;
+         } else if((IS_SIS651) && (SiS_Pr->SiS_VBType & VB_NoLCD)) {
+            SiS_Pr->SiS_SetFlag |= SetDOSMode;
+         }
       }
+#endif
 
-      tempbx=0;
-      tempcx=0;
-      SiS_Sense(SiS_Pr, tempbx,tempcx);
-
-      if(SiS_Pr->SiS_VBType & (VB_SIS301LV302LV)) {
-         tempax &= 0x00ef;   /* 30xlv have no VGA2*/
-      }
-      SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x32,~0xDF,tempax);
-      SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x00,P2reg0);
-      if(!(P2reg0 & 0x20)) {
-        SiS_Pr->SiS_VBInfo = DisableCRT2Display;
-        SiS_SetCRT2Group301(SiS_Pr,BaseAddr,ROMAddr,SenseModeNo,HwDeviceExtension);
+      if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
+         if(IS_SIS650) {
+	    SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x51,0x1f);
+	    if(IS_SIS651) SiS_SetRegOR(SiS_Pr->SiS_P3d4,0x51,0x20);
+	    SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x56,0xe7);
+	 } else if(IS_SIS661741660760) {
+	    SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x51,0x1f);
+	    SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x56,0xe7);
+	    SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x3a,0xef);
+	 }
       }
-    }
-  }
-}
+   }
 
-BOOLEAN
-SiS_Sense(SiS_Private *SiS_Pr, USHORT tempbx,USHORT tempcx)
-{
-  USHORT temp,i,tempch;
+   /* Set mode on CRT1 */
+   SiS_SetCRT1Group(SiS_Pr, HwInfo, ModeNo, ModeIdIndex);
+   if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) {
+      SiS_SetCRT2Group(SiS_Pr, HwInfo, ModeNo);
+   }
 
-  temp = tempbx & 0xFF;
-  SiS_SetReg1(SiS_Pr->SiS_Part4Port,0x11,temp);
-  temp = (tempbx & 0xFF00) >> 8;
-  temp |= (tempcx & 0x00FF);
-  SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x10,~0x1F,temp);
-
-  for(i=0; i<10; i++) SiS_LongWait(SiS_Pr);
-
-  tempch = (tempcx & 0x7F00) >> 8;
-  temp = SiS_GetReg1(SiS_Pr->SiS_Part4Port,0x03);
-  temp ^= 0x0E;
-  temp &= tempch;
-  if(temp>0) return 1;
-  else return 0;
-}
+   /* SetPitch: Adapt to virtual size & position */
+   SiS_SetPitchCRT1(SiS_Pr, pScrn);
 
-USHORT
-SiS_SenseLCD(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension)
-{
-  USHORT temp;
+#ifdef SISDUALHEAD
+   if(pSiS->DualHeadMode) {
+      pSiSEnt->CRT1ModeNo = ModeNo;
+      pSiSEnt->CRT1DMode = mode;
+   }
+#endif
 
-  temp=SiS_GetPanelID(SiS_Pr);
-  if(!temp)  temp=SiS_GetLCDDDCInfo(SiS_Pr, HwDeviceExtension);
-  return(temp);
-}
+   if(SiS_Pr->UseCustomMode) {
+      SiS_Pr->CRT1UsesCustomMode = TRUE;
+      SiS_Pr->CSRClock_CRT1 = SiS_Pr->CSRClock;
+      SiS_Pr->CModeFlag_CRT1 = SiS_Pr->CModeFlag;
+   } else {
+      SiS_Pr->CRT1UsesCustomMode = FALSE;
+   }
 
-BOOLEAN
-SiS_GetLCDDDCInfo(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension)
-{
-  USHORT temp;
-  /*add lcd sense*/
-  if(HwDeviceExtension->ulCRT2LCDType==LCD_UNKNOWN)
-    	return 0;
-  else{
-     	temp=(USHORT)HwDeviceExtension->ulCRT2LCDType;
-     	SiS_SetReg1(SiS_Pr->SiS_P3d4,0x36,temp);
-  	return 1;
-  }
-}
+   /* Reset CRT2 if changing mode on CRT1 */
+#ifdef SISDUALHEAD
+   if(pSiS->DualHeadMode) {
+      if(pSiSEnt->CRT2ModeNo != -1) {
+         xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3,
+				"(Re-)Setting mode for CRT2\n");
+	 backupcustom = SiS_Pr->UseCustomMode;
+	 backupcr30 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30);
+	 backupcr31 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x31);
+	 backupcr35 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x35);
+	 backupcr38 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38);
+	 if(SiS_Pr->SiS_VBType & VB_SISVB) {
+	    /* Backup LUT-enable */
+	    if(pSiSEnt->CRT2ModeSet) {
+	       backupp40d = SiS_GetReg(SiS_Pr->SiS_Part4Port,0x0d) & 0x08;
+	    }
+	 }
+	 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) {
+	    SiS_SetReg(SiS_Pr->SiS_P3d4,0x30,pSiSEnt->CRT2CR30);
+	    SiS_SetReg(SiS_Pr->SiS_P3d4,0x31,pSiSEnt->CRT2CR31);
+	    SiS_SetReg(SiS_Pr->SiS_P3d4,0x35,pSiSEnt->CRT2CR35);
+	    SiS_SetReg(SiS_Pr->SiS_P3d4,0x38,pSiSEnt->CRT2CR38);
+	 }
+	 SiSBIOSSetModeCRT2(SiS_Pr, HwInfo, pSiSEnt->pScrn_1,
+			    pSiSEnt->CRT2DMode, pSiSEnt->CRT2IsCustom);
+         SiS_SetReg(SiS_Pr->SiS_P3d4,0x30,backupcr30);
+	 SiS_SetReg(SiS_Pr->SiS_P3d4,0x31,backupcr31);
+	 SiS_SetReg(SiS_Pr->SiS_P3d4,0x35,backupcr35);
+	 SiS_SetReg(SiS_Pr->SiS_P3d4,0x38,backupcr38);
+	 if(SiS_Pr->SiS_VBType & VB_SISVB) {
+	    SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x0d, ~0x08, backupp40d);
+	 }
+	 SiS_Pr->UseCustomMode = backupcustom;
+      }
+   }
+#endif
 
-USHORT
-SiS_SenseCHTV(SiS_Private *SiS_Pr)
-{
-  USHORT temp,push0e,status;
+   /* Warning: From here, the custom mode entries in SiS_Pr are
+    * possibly overwritten
+    */
 
-  status=0;
-  push0e = SiS_GetCH700x(SiS_Pr, 0x0e);
-  push0e = (push0e << 8) | 0x0e;
-  SiS_SetCH700x(SiS_Pr, 0x0b0e);
-  SiS_SetCH700x(SiS_Pr, 0x0110);
-  SiS_SetCH700x(SiS_Pr, 0x0010);
-  temp = SiS_GetCH700x(SiS_Pr, 0x10);
-  if(temp & 0x08) status |= SVIDEOSense;
-  if(temp & 0x02) status |= AVIDEOSense;
-  SiS_SetCH700x(SiS_Pr, push0e);
-  return(status);
-}
-#endif /* LINUXBIOS */
+   SiS_HandleCRT1(SiS_Pr);
 
-/*  ================ for TC only =================  */
+   SiS_StrangeStuff(SiS_Pr, HwInfo);
 
-#ifdef TC
+   SiS_DisplayOn(SiS_Pr);
+   SiS_SetRegByte(SiS_Pr->SiS_P3c6,0xFF);
 
-int
-INT1AReturnCode(union REGS regs)
-{
-  if (regs.x.cflag)
-  {
-    /*printf("Error to find pci device!\n"); */
-    return 1;
-  }
-
-  switch(regs.h.ah)
-  {
-    case 0: return 0;
-            break;
-    case 0x81: printf("Function not support\n");
-               break;
-    case 0x83: printf("bad vendor id\n");
-               break;
-    case 0x86: printf("device not found\n");
-               break;
-    case 0x87: printf("bad register number\n");
-               break;
-    case 0x88: printf("set failed\n");
-               break;
-    case 0x89: printf("buffer too small");
-               break;
-  }
-  return 1;
-}
+   if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
+      if(HwInfo->jChipType >= SIS_315H) {
+	 SiS_SetReg(SiS_Pr->SiS_P3d4,0x38,backupreg);
+      } else if((HwInfo->jChipType == SIS_630) ||
+                (HwInfo->jChipType == SIS_730)) {
+         SiS_SetReg(SiS_Pr->SiS_P3d4,0x35,backupreg);
+      }
+   }
 
-unsigned
-FindPCIIOBase(unsigned index,unsigned deviceid)
-{
-  union REGS regs;
+   /* Backup/Set ModeNo in BIOS scratch area */
+   SiS_GetSetModeID(pScrn,ModeNo);
 
-  regs.h.ah = 0xb1;  /*PCI_FUNCTION_ID */
-  regs.h.al = 0x02;  /*FIND_PCI_DEVICE */
-  regs.x.cx = deviceid;
-  regs.x.dx = 0x1039;
-  regs.x.si = index;  /* find n-th device */
-
-  int86(0x1A, &regs, &regs);
-
-  if (INT1AReturnCode(regs)!=0)
-    return 0;
-
-  /* regs.h.bh *//* bus number */
-  /* regs.h.bl *//* device number */
-  regs.h.ah = 0xb1;  /*PCI_FUNCTION_ID */
-  regs.h.al = 0x09;  /*READ_CONFIG_WORD */
-  regs.x.cx = deviceid;
-  regs.x.dx = 0x1039;
-  regs.x.di = 0x18;  /* register number */
-  int86(0x1A, &regs, &regs);
-
-  if (INT1AReturnCode(regs)!=0)
-    return 0;
-  return regs.x.cx;
+   return TRUE;
 }
+#endif /* Linux_XF86 */
 
 
-void
-main(int argc, char *argv[])
+#ifdef LINUX_XF86
+BOOLEAN
+SiS_GetPanelID(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
 {
-  SIS_HW_DEVICE_INFO  HwDeviceExtension;
-  USHORT temp;
-  USHORT ModeNo;
+  const USHORT PanelTypeTable300[16] = {
+      0xc101, 0xc117, 0x0121, 0xc135, 0xc142, 0xc152, 0xc162, 0xc072,
+      0xc181, 0xc192, 0xc1a1, 0xc1b6, 0xc1c2, 0xc0d2, 0xc1e2, 0xc1f2
+  };
+  const USHORT PanelTypeTable31030x[16] = {
+      0xc102, 0xc112, 0x0122, 0xc132, 0xc142, 0xc152, 0xc169, 0xc179,
+      0x0189, 0xc192, 0xc1a2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
+  };
+  const USHORT PanelTypeTable310LVDS[16] = {
+      0xc111, 0xc122, 0xc133, 0xc144, 0xc155, 0xc166, 0xc177, 0xc188,
+      0xc199, 0xc0aa, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
+  };
+  USHORT tempax,tempbx,temp;
 
-  /*HwDeviceExtension.pjVirtualRomBase =(PUCHAR) MK_FP(0xC000,0); */
-  /*HwDeviceExtension.pjVideoMemoryAddress = (PUCHAR)MK_FP(0xA000,0);*/
+  if(HwInfo->jChipType < SIS_315H) {
 
-#ifdef SIS300  
-  HwDeviceExtension.ulIOAddress = (FindPCIIOBase(0,0x6300)&0xFF80) + 0x30;
-  HwDeviceExtension.jChipType = SIS_630;
-#endif
+     tempax = SiS_GetReg(SiS_Pr->SiS_P3c4,0x18);
+     tempbx = tempax & 0x0F;
+     if(!(tempax & 0x10)){
+        if(SiS_Pr->SiS_IF_DEF_LVDS == 1){
+           tempbx = 0;
+           temp = SiS_GetReg(SiS_Pr->SiS_P3c4,0x38);
+           if(temp & 0x40) tempbx |= 0x08;
+           if(temp & 0x20) tempbx |= 0x02;
+           if(temp & 0x01) tempbx |= 0x01;
+           temp = SiS_GetReg(SiS_Pr->SiS_P3c4,0x39);
+           if(temp & 0x80) tempbx |= 0x04;
+        } else {
+           return 0;
+        }
+     }
+     tempbx = PanelTypeTable300[tempbx];
+     tempbx |= LCDSync;
+     temp = tempbx & 0x00FF;
+     SiS_SetReg(SiS_Pr->SiS_P3d4,0x36,temp);
+     temp = (tempbx & 0xFF00) >> 8;
+     SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x37,~(LCDSyncBit|LCDRGB18Bit),temp);
 
-#ifdef SIS315H  
-//  HwDeviceExtension.ulIOAddress = (FindPCIIOBase(0,0x5315)&0xFF80) + 0x30;
-//  HwDeviceExtension.jChipType = SIS_550;
-  HwDeviceExtension.ulIOAddress = (FindPCIIOBase(0,0x325)&0xFF80) + 0x30;
-  HwDeviceExtension.jChipType = SIS_315H;
-#endif
+  } else {
+
+     if(HwInfo->jChipType >= SIS_661) return 0;
+
+     tempax = SiS_GetReg(SiS_Pr->SiS_P3c4,0x1a);
+     tempax &= 0x1e;
+     tempax >>= 1;
+     if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
+        if(tempax == 0) {
+           /* TODO: Include HUGE detection routine
+	            (Probably not worth bothering)
+	    */
+           return 0;
+        }
+        temp = tempax & 0xff;
+        tempax--;
+        tempbx = PanelTypeTable310LVDS[tempax];
+     } else {
+        tempbx = PanelTypeTable31030x[tempax];
+        temp = tempbx & 0xff;
+     }
+     SiS_SetReg(SiS_Pr->SiS_P3d4,0x36,temp);
+     tempbx = (tempbx & 0xff00) >> 8;
+     temp = tempbx & 0xc1;
+     SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x37,~(LCDSyncBit|LCDRGB18Bit),temp);
+     if(SiS_Pr->SiS_VBType & VB_SISVB) {
+        temp = tempbx & 0x04;
+        SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x39,0xfb,temp);
+     }
 
-  HwDeviceExtension.ujVBChipID = VB_CHIP_301;
-  strcpy(HwDeviceExtension.szVBIOSVer,"0.84");
-  HwDeviceExtension.bSkipDramSizing = FALSE;
-  HwDeviceExtension.ulVideoMemorySize = 0;
-  if(argc==2) {
-    ModeNo=atoi(argv[1]);
-  }
-  else {
-    ModeNo=0x2e;
-    /*ModeNo=0x37; */ /* 1024x768x 4bpp */
-    /*ModeNo=0x38; *//* 1024x768x 8bpp */
-    /*ModeNo=0x4A; *//* 1024x768x 16bpp */
-    /*ModeNo=0x47;*/ /* 800x600x 16bpp */
   }
- /* SiSInit(SiS_Pr, &HwDeviceExtension);*/
-  SiSSetMode(SiS_Pr, &HwDeviceExtension, ModeNo);
+  return 1;
 }
-#endif /* TC END */
+#endif
+
 
 /* ================ XFREE86 ================= */
 
@@ -5000,44 +4308,78 @@
    SISPtr pSiS = SISPTR(pScrn);
    int    out_n, out_dn, out_div, out_sbit, out_scale;
    int    depth = pSiS->CurrentLayout.bitsPerPixel;
-   
-#ifdef SISDUALHEAD
-   if( ((!pSiS->DualHeadMode) && (VBFlags & DISPTYPE_DISP2)) ||
-       ((pSiS->DualHeadMode) && (!pSiS->SecondHead)) ) return 0;
-#else      
-   if(VBFlags & DISPTYPE_DISP2) return 0; 
-#endif   
+   unsigned int vclk[5];
+
+#define Midx         0
+#define Nidx         1
+#define VLDidx       2
+#define Pidx         3
+#define PSNidx       4
+
+   pSiS->SiS_Pr->CModeFlag = 0;
    
    pSiS->SiS_Pr->CDClock = mode->Clock;
-   
+
    pSiS->SiS_Pr->CHDisplay = mode->HDisplay;
    pSiS->SiS_Pr->CHSyncStart = mode->HSyncStart;
    pSiS->SiS_Pr->CHSyncEnd = mode->HSyncEnd;
    pSiS->SiS_Pr->CHTotal = mode->HTotal;
-   pSiS->SiS_Pr->CHBlankStart = pSiS->SiS_Pr->CHDisplay;
-   pSiS->SiS_Pr->CHBlankEnd = pSiS->SiS_Pr->CHTotal;
-   
+
    pSiS->SiS_Pr->CVDisplay = mode->VDisplay;
    pSiS->SiS_Pr->CVSyncStart = mode->VSyncStart;
    pSiS->SiS_Pr->CVSyncEnd = mode->VSyncEnd;
    pSiS->SiS_Pr->CVTotal = mode->VTotal;
+
+   pSiS->SiS_Pr->CFlags = mode->Flags;
+
+   if(pSiS->SiS_Pr->CFlags & V_INTERLACE) {
+      pSiS->SiS_Pr->CVDisplay >>= 1;
+      pSiS->SiS_Pr->CVSyncStart >>= 1;
+      pSiS->SiS_Pr->CVSyncEnd >>= 1;
+      pSiS->SiS_Pr->CVTotal >>= 1;
+   }
+   if(pSiS->SiS_Pr->CFlags & V_DBLSCAN) {
+      /* pSiS->SiS_Pr->CDClock <<= 1; */
+      pSiS->SiS_Pr->CVDisplay <<= 1;
+      pSiS->SiS_Pr->CVSyncStart <<= 1;
+      pSiS->SiS_Pr->CVSyncEnd <<= 1;
+      pSiS->SiS_Pr->CVTotal <<= 1;
+   }
+
+   pSiS->SiS_Pr->CHBlankStart = pSiS->SiS_Pr->CHDisplay;
+   pSiS->SiS_Pr->CHBlankEnd = pSiS->SiS_Pr->CHTotal;
    pSiS->SiS_Pr->CVBlankStart = pSiS->SiS_Pr->CVSyncStart - 1;
    pSiS->SiS_Pr->CVBlankEnd = pSiS->SiS_Pr->CVTotal;
-   
-   pSiS->SiS_Pr->CFlags = mode->Flags;
 
-   SiS_compute_vclk(pSiS->SiS_Pr->CDClock, &out_n, &out_dn, &out_div, &out_sbit, &out_scale);
-   
+   if(SiS_compute_vclk(pSiS->SiS_Pr->CDClock, &out_n, &out_dn, &out_div, &out_sbit, &out_scale)) {
+      pSiS->SiS_Pr->CSR2B = (out_div == 2) ? 0x80 : 0x00;
+      pSiS->SiS_Pr->CSR2B |= ((out_n - 1) & 0x7f);
+      pSiS->SiS_Pr->CSR2C = (out_dn - 1) & 0x1f;
+      pSiS->SiS_Pr->CSR2C |= (((out_scale - 1) & 3) << 5);
+      pSiS->SiS_Pr->CSR2C |= ((out_sbit & 0x01) << 7);
+#ifdef TWDEBUG
+      xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Clock %d: n %d dn %d div %d sb %d sc %d\n",
+        	pSiS->SiS_Pr->CDClock, out_n, out_dn, out_div, out_sbit, out_scale);
+#endif
+   } else {
+      SiSCalcClock(pScrn, pSiS->SiS_Pr->CDClock, 2, vclk);
+      pSiS->SiS_Pr->CSR2B = (vclk[VLDidx] == 2) ? 0x80 : 0x00;
+      pSiS->SiS_Pr->CSR2B |= (vclk[Midx] - 1) & 0x7f;
+      pSiS->SiS_Pr->CSR2C = (vclk[Nidx] - 1) & 0x1f;
+      if(vclk[Pidx] <= 4) {
+         /* postscale 1,2,3,4 */
+         pSiS->SiS_Pr->CSR2C |= ((vclk[Pidx] - 1) & 3) << 5;
+      } else {
+         /* postscale 6,8 */
+         pSiS->SiS_Pr->CSR2C |= (((vclk[Pidx] / 2) - 1) & 3) << 5;
+	 pSiS->SiS_Pr->CSR2C |= 0x80;
+      }
 #ifdef TWDEBUG
-   xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Clock %d: n %d dn %d div %d sb %d sc %d\n",
-      	pSiS->SiS_Pr->CDClock, out_n, out_dn, out_div, out_sbit, out_scale);
-#endif	
-
-   pSiS->SiS_Pr->CSR2B = (out_div == 2) ? 0x80 : 0x00;
-   pSiS->SiS_Pr->CSR2B |= ((out_n - 1) & 0x7f);
-   pSiS->SiS_Pr->CSR2C = (out_dn - 1) & 0x1f;
-   pSiS->SiS_Pr->CSR2C |= (((out_scale - 1) & 3) << 5);
-   pSiS->SiS_Pr->CSR2C |= ((out_sbit & 0x01) << 7);
+      xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Clock %d: n %d dn %d div %d sc %d\n",
+        	pSiS->SiS_Pr->CDClock, vclk[Midx], vclk[Nidx], vclk[VLDidx], vclk[Pidx]);
+#endif
+   }
+
    pSiS->SiS_Pr->CSRClock = (pSiS->SiS_Pr->CDClock / 1000) + 1;
 
    pSiS->SiS_Pr->CCRT1CRTC[0]  =  ((pSiS->SiS_Pr->CHTotal >> 3) - 5) & 0xff;
@@ -5045,9 +4387,9 @@
    pSiS->SiS_Pr->CCRT1CRTC[2]  =  (pSiS->SiS_Pr->CHBlankStart >> 3) - 1;
    pSiS->SiS_Pr->CCRT1CRTC[3]  =  (((pSiS->SiS_Pr->CHBlankEnd >> 3) - 1) & 0x1F) | 0x80;
    pSiS->SiS_Pr->CCRT1CRTC[4]  =  (pSiS->SiS_Pr->CHSyncStart >> 3) + 3;
-   pSiS->SiS_Pr->CCRT1CRTC[5]  =  ((((pSiS->SiS_Pr->CHBlankEnd >> 3) - 1) & 0x20) << 2) | 
+   pSiS->SiS_Pr->CCRT1CRTC[5]  =  ((((pSiS->SiS_Pr->CHBlankEnd >> 3) - 1) & 0x20) << 2) |
        				  (((pSiS->SiS_Pr->CHSyncEnd >> 3) + 3) & 0x1F);
-   
+
    pSiS->SiS_Pr->CCRT1CRTC[6]  =  (pSiS->SiS_Pr->CVTotal - 2) & 0xFF;
    pSiS->SiS_Pr->CCRT1CRTC[7]  =  (((pSiS->SiS_Pr->CVTotal - 2) & 0x100) >> 8)
  	 			| (((pSiS->SiS_Pr->CVDisplay - 1) & 0x100) >> 7)
@@ -5057,71 +4399,76 @@
 	 			| (((pSiS->SiS_Pr->CVTotal - 2) & 0x200)   >> 4)
 	 			| (((pSiS->SiS_Pr->CVDisplay - 1) & 0x200) >> 3)
 	 			| ((pSiS->SiS_Pr->CVSyncStart & 0x200) >> 2);
-    
+
    pSiS->SiS_Pr->CCRT1CRTC[16] = ((((pSiS->SiS_Pr->CVBlankStart - 1) & 0x200) >> 4) >> 5); 	/* cr9 */
-    
-#if 0    
+
+#if 0
    if (mode->VScan >= 32)
 	regp->CRTC[9] |= 0x1F;
    else if (mode->VScan > 1)
 	regp->CRTC[9] |= mode->VScan - 1;
-#endif	
+#endif
 
-   pSiS->SiS_Pr->CCRT1CRTC[8] =  (pSiS->SiS_Pr->CVSyncStart - 1) & 0xFF;	/* cr10 */
-   pSiS->SiS_Pr->CCRT1CRTC[9] =  ((pSiS->SiS_Pr->CVSyncEnd - 1) & 0x0F) | 0x80;	/* cr11 */
-   pSiS->SiS_Pr->CCRT1CRTC[10] = (pSiS->SiS_Pr->CVDisplay - 1) & 0xFF;		/* cr12 */
-   pSiS->SiS_Pr->CCRT1CRTC[11] = (pSiS->SiS_Pr->CVBlankStart - 1) & 0xFF;	/* cr15 */
-   pSiS->SiS_Pr->CCRT1CRTC[12] = (pSiS->SiS_Pr->CVBlankEnd - 1) & 0xFF;		/* cr16 */
-   
-   pSiS->SiS_Pr->CCRT1CRTC[13] = 
+   pSiS->SiS_Pr->CCRT1CRTC[8] =  (pSiS->SiS_Pr->CVSyncStart     ) & 0xFF;		/* cr10 */
+   pSiS->SiS_Pr->CCRT1CRTC[9] =  ((pSiS->SiS_Pr->CVSyncEnd      ) & 0x0F) | 0x80;	/* cr11 */
+   pSiS->SiS_Pr->CCRT1CRTC[10] = (pSiS->SiS_Pr->CVDisplay    - 1) & 0xFF;		/* cr12 */
+   pSiS->SiS_Pr->CCRT1CRTC[11] = (pSiS->SiS_Pr->CVBlankStart - 1) & 0xFF;		/* cr15 */
+   pSiS->SiS_Pr->CCRT1CRTC[12] = (pSiS->SiS_Pr->CVBlankEnd   - 1) & 0xFF;		/* cr16 */
+
+   pSiS->SiS_Pr->CCRT1CRTC[13] =
                         GETBITSTR((pSiS->SiS_Pr->CVTotal     -2), 10:10, 0:0) |
                         GETBITSTR((pSiS->SiS_Pr->CVDisplay   -1), 10:10, 1:1) |
                         GETBITSTR((pSiS->SiS_Pr->CVBlankStart-1), 10:10, 2:2) |
                         GETBITSTR((pSiS->SiS_Pr->CVSyncStart   ), 10:10, 3:3) |
                         GETBITSTR((pSiS->SiS_Pr->CVBlankEnd  -1),   8:8, 4:4) |
-                        GETBITSTR((pSiS->SiS_Pr->CVSyncEnd   -1),   4:4, 5:5) ;  
+                        GETBITSTR((pSiS->SiS_Pr->CVSyncEnd     ),   4:4, 5:5) ;
 
-   pSiS->SiS_Pr->CCRT1CRTC[14] = 
+   pSiS->SiS_Pr->CCRT1CRTC[14] =
                         GETBITSTR((pSiS->SiS_Pr->CHTotal      >> 3) - 5, 9:8, 1:0) |
                         GETBITSTR((pSiS->SiS_Pr->CHDisplay    >> 3) - 1, 9:8, 3:2) |
                         GETBITSTR((pSiS->SiS_Pr->CHBlankStart >> 3) - 1, 9:8, 5:4) |
                         GETBITSTR((pSiS->SiS_Pr->CHSyncStart  >> 3) + 3, 9:8, 7:6) ;
 
-        
+
    pSiS->SiS_Pr->CCRT1CRTC[15] =
                         GETBITSTR((pSiS->SiS_Pr->CHBlankEnd >> 3) - 1, 7:6, 1:0) |
-                        GETBITSTR((pSiS->SiS_Pr->CHSyncEnd  >> 3) + 3, 5:5, 2:2) ; 
-			
+                        GETBITSTR((pSiS->SiS_Pr->CHSyncEnd  >> 3) + 3, 5:5, 2:2) ;
+
    switch(depth) {
-   case 8: 			
-      	pSiS->SiS_Pr->CModeFlag = 0x223b;
+   case 8:
+      	pSiS->SiS_Pr->CModeFlag |= 0x223b;
 	break;
-   case 16: 			
-      	pSiS->SiS_Pr->CModeFlag = 0x227d;
+   case 16:
+      	pSiS->SiS_Pr->CModeFlag |= 0x227d;
 	break;
-   case 32: 			
-      	pSiS->SiS_Pr->CModeFlag = 0x22ff;
+   case 32:
+      	pSiS->SiS_Pr->CModeFlag |= 0x22ff;
 	break;		
    default: 
    	return 0;	
    }	
    
    if(pSiS->SiS_Pr->CFlags & V_DBLSCAN) 
-   	pSiS->SiS_Pr->CModeFlag |= DoubleScanMode;
-   if((pSiS->SiS_Pr->CVDisplay >= 1024)	|| 
-      (pSiS->SiS_Pr->CVTotal >= 1024)   || 
+      pSiS->SiS_Pr->CModeFlag |= DoubleScanMode;
+
+   if((pSiS->SiS_Pr->CVDisplay >= 1024)	||
+      (pSiS->SiS_Pr->CVTotal >= 1024)   ||
       (pSiS->SiS_Pr->CHDisplay >= 1024))
-	pSiS->SiS_Pr->CModeFlag |= LineCompareOff;
+      pSiS->SiS_Pr->CModeFlag |= LineCompareOff;
+
    if(pSiS->SiS_Pr->CFlags & V_CLKDIV2)
-        pSiS->SiS_Pr->CModeFlag |= HalfDCLK;
-   
+      pSiS->SiS_Pr->CModeFlag |= HalfDCLK;
+
    pSiS->SiS_Pr->CInfoFlag = 0x0007;
-   if(pSiS->SiS_Pr->CFlags & V_NHSYNC) 
-   	pSiS->SiS_Pr->CInfoFlag |= 0x4000;
-   if(pSiS->SiS_Pr->CFlags & V_NVSYNC) 
-   	pSiS->SiS_Pr->CInfoFlag |= 0x8000;
-   if(pSiS->SiS_Pr->CFlags & V_INTERLACE)	
-	pSiS->SiS_Pr->CInfoFlag |= InterlaceMode;
+
+   if(pSiS->SiS_Pr->CFlags & V_NHSYNC)
+      pSiS->SiS_Pr->CInfoFlag |= 0x4000;
+
+   if(pSiS->SiS_Pr->CFlags & V_NVSYNC)
+      pSiS->SiS_Pr->CInfoFlag |= 0x8000;
+
+   if(pSiS->SiS_Pr->CFlags & V_INTERLACE)
+      pSiS->SiS_Pr->CInfoFlag |= InterlaceMode;
 
    pSiS->SiS_Pr->UseCustomMode = TRUE;
 #ifdef TWDEBUG
@@ -5152,13 +4499,13 @@
    	pSiS->SiS_Pr->CSR2B,
 	pSiS->SiS_Pr->CSR2C,
 	pSiS->SiS_Pr->CSRClock);
-#endif   	
+#endif
    return 1;
 }
 
-/* TW: Build a list of supported modes */
+/* Build a list of supported modes */
 DisplayModePtr
-SiSBuildBuiltInModeList(ScrnInfoPtr pScrn)
+SiSBuildBuiltInModeList(ScrnInfoPtr pScrn, BOOLEAN includelcdmodes, BOOLEAN isfordvi)
 {
    SISPtr         pSiS = SISPTR(pScrn);
    unsigned short VRE, VBE, VRS, VBS, VDE, VT;
@@ -5166,23 +4513,28 @@
    unsigned char  sr_data, cr_data, cr_data2, cr_data3;
    unsigned char  sr2b, sr2c;
    float          num, denum, postscalar, divider;
-   int            A, B, C, D, E, F, temp, i, j, index, vclkindex;
-   DisplayModePtr new = NULL, current = NULL, first = NULL, backup = NULL;
+   int            A, B, C, D, E, F, temp, i, j, k, l, index, vclkindex;
+   DisplayModePtr new = NULL, current = NULL, first = NULL;
+   BOOLEAN        done = FALSE;
+#if 0
+   DisplayModePtr backup = NULL;
+#endif
 
    pSiS->backupmodelist = NULL;
-   
+   pSiS->AddedPlasmaModes = FALSE;
+
    /* Initialize our pointers */
    if(pSiS->VGAEngine == SIS_300_VGA) {
 #ifdef SIS300
-	InitTo300Pointer(pSiS->SiS_Pr, &pSiS->sishw_ext);
+      InitTo300Pointer(pSiS->SiS_Pr, &pSiS->sishw_ext);
 #else
-	return NULL;
+      return NULL;
 #endif
    } else if(pSiS->VGAEngine == SIS_315_VGA) {
 #ifdef SIS315H
-       	InitTo310Pointer(pSiS->SiS_Pr, &pSiS->sishw_ext);
+      InitTo310Pointer(pSiS->SiS_Pr, &pSiS->sishw_ext);
 #else
-	return NULL;
+      return NULL;
 #endif
    } else return NULL;
 
@@ -5190,19 +4542,21 @@
    while(pSiS->SiS_Pr->SiS_RefIndex[i].Ext_InfoFlag != 0xFFFF) {
 
       index = pSiS->SiS_Pr->SiS_RefIndex[i].Ext_CRT1CRTC;
-#if 0 /* Not any longer */    
-      if(pSiS->VGAEngine == SIS_300_VGA) index &= 0x3F;
-#endif      
-
-      if(((pSiS->SiS_Pr->SiS_RefIndex[i].XRes < 512) && (!pSiS->DSTN)) ||
-      	 ((pSiS->DSTN) &&
-	  (pSiS->SiS_Pr->SiS_RefIndex[i].XRes < 512) &&
-	  (pSiS->SiS_Pr->SiS_RefIndex[i].XRes != 320) &&
-	  (pSiS->SiS_Pr->SiS_RefIndex[i].YRes != 480)))  {
+
+      /* 0x5a (320x240) is a pure FTSN mode, not DSTN! */
+      if((!pSiS->FSTN) &&
+	 (pSiS->SiS_Pr->SiS_RefIndex[i].ModeID == 0x5a))  {
            i++;
       	   continue;
       }
-      
+      if((pSiS->FSTN) &&
+         (pSiS->SiS_Pr->SiS_RefIndex[i].XRes == 320) &&
+	 (pSiS->SiS_Pr->SiS_RefIndex[i].YRes == 240) &&
+	 (pSiS->SiS_Pr->SiS_RefIndex[i].ModeID != 0x5a)) {
+	   i++;
+	   continue;
+      }
+
       if(!(new = xalloc(sizeof(DisplayModeRec)))) return first;
       memset(new, 0, sizeof(DisplayModeRec));
       if(!(new->name = xalloc(10))) {
@@ -5216,13 +4570,13 @@
       }
 
       current = new;
-      
+
       sprintf(current->name, "%dx%d", pSiS->SiS_Pr->SiS_RefIndex[i].XRes,
                                       pSiS->SiS_Pr->SiS_RefIndex[i].YRes);
 
       current->status = MODE_OK;
 
-      current->type = M_T_DEFAULT; 
+      current->type = M_T_DEFAULT;
 
       vclkindex = pSiS->SiS_Pr->SiS_RefIndex[i].Ext_CRTVCLK;
       if(pSiS->VGAEngine == SIS_300_VGA) vclkindex &= 0x3F;
@@ -5235,7 +4589,7 @@
               ( (((sr2c >> 5) & 0x03) == 0x02) ? 6.0 : 8.0) : (((sr2c >> 5) & 0x03) + 1.0);
       num = (sr2b & 0x7f) + 1.0;
       denum = (sr2c & 0x1f) + 1.0;
-      
+
 #ifdef TWDEBUG
       xf86DrvMsg(0, X_INFO, "------------\n");
       xf86DrvMsg(0, X_INFO, "sr2b: %x sr2c %x div %f ps %f num %f denum %f\n",
@@ -5303,10 +4657,29 @@
 
       D = B - F - C;
 
-      current->HDisplay   = (E * 8);
-      current->HSyncStart = (E * 8) + (F * 8);
-      current->HSyncEnd   = (E * 8) + (F * 8) + (C * 8);
-      current->HTotal     = (E * 8) + (F * 8) + (C * 8) + (D * 8);
+      if((pSiS->SiS_Pr->SiS_RefIndex[i].XRes == 320) &&
+	 ((pSiS->SiS_Pr->SiS_RefIndex[i].YRes == 200) ||
+	  (pSiS->SiS_Pr->SiS_RefIndex[i].YRes == 240))) {
+
+	 /* Terrible hack, but correct CRTC data for
+	  * these modes only produces a black screen...
+	  * (HRE is 0, leading into a too large C and
+	  * a negative D. The CRT controller does not
+	  * seem to like correcting HRE to 50
+	  */
+	 current->HDisplay   = 320;
+         current->HSyncStart = 328;
+         current->HSyncEnd   = 376;
+         current->HTotal     = 400;
+
+      } else {
+
+         current->HDisplay   = (E * 8);
+         current->HSyncStart = (E * 8) + (F * 8);
+         current->HSyncEnd   = (E * 8) + (F * 8) + (C * 8);
+         current->HTotal     = (E * 8) + (F * 8) + (C * 8) + (D * 8);
+
+      }
 
 #ifdef TWDEBUG
       xf86DrvMsg(0, X_INFO,
@@ -5430,7 +4803,7 @@
 	 current->VSyncStart <<= 1;
 	 current->VSyncEnd <<= 1;
 	 current->VTotal <<= 1;
-	 current->VTotal |= 1; 
+	 current->VTotal |= 1;
       }
       if(current->Flags & V_DBLSCAN) {
          current->Clock >>= 1;
@@ -5440,6 +4813,7 @@
 	 current->VTotal >>= 1;
       }
 
+#if 0
       if((backup = xalloc(sizeof(DisplayModeRec)))) {
          if(!pSiS->backupmodelist) pSiS->backupmodelist = backup;
 	 else {
@@ -5458,6 +4832,7 @@
 	 backup->Flags = current->Flags;
 	 backup->Clock = current->Clock;
       }
+#endif
 
 #ifdef TWDEBUG
       xf86DrvMsg(pScrn->scrnIndex, X_INFO,
@@ -5465,61 +4840,324 @@
 	current->name, (float)current->Clock / 1000,
 	current->HDisplay, current->HSyncStart, current->HSyncEnd, current->HTotal,
 	current->VDisplay, current->VSyncStart, current->VSyncEnd, current->VTotal);
+#else
+        (void)VBS;  (void)HBS;  (void)A;
 #endif
 
       i++;
    }
 
+   /* Add non-standard LCD modes for panel's detailed timings */
+
+   if(!includelcdmodes) return first;
+
+   if(pSiS->SiS_Pr->CP_Vendor) {
+      xf86DrvMsg(0, X_INFO, "Checking database for vendor %x, product %x\n",
+         pSiS->SiS_Pr->CP_Vendor, pSiS->SiS_Pr->CP_Product);
+   }
+
+   i = 0;
+   while((!done) && (SiS_PlasmaTable[i].vendor) && (pSiS->SiS_Pr->CP_Vendor)) {
+
+     if(SiS_PlasmaTable[i].vendor == pSiS->SiS_Pr->CP_Vendor) {
+
+        for(j=0; j<SiS_PlasmaTable[i].productnum; j++) {
+
+	    if(SiS_PlasmaTable[i].product[j] == pSiS->SiS_Pr->CP_Product) {
+
+	       xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
+	       	  "Identified %s panel, adding specific modes\n",
+		  SiS_PlasmaTable[i].plasmaname);
+
+	       for(k=0; k<SiS_PlasmaTable[i].modenum; k++) {
+
+	          if(isfordvi) {
+		     if(!(SiS_PlasmaTable[i].plasmamodes[k] & 0x80)) continue;
+		  } else {
+		     if(!(SiS_PlasmaTable[i].plasmamodes[k] & 0x40)) continue;
+		  }
+
+	          if(!(new = xalloc(sizeof(DisplayModeRec)))) return first;
+
+                  memset(new, 0, sizeof(DisplayModeRec));
+                  if(!(new->name = xalloc(10))) {
+      		     xfree(new);
+		     return first;
+                  }
+                  if(!first) first = new;
+                  if(current) {
+                     current->next = new;
+	             new->prev = current;
+                  }
+
+                  current = new;
+
+		  pSiS->AddedPlasmaModes = TRUE;
+
+		  l = SiS_PlasmaTable[i].plasmamodes[k] & 0x3f;
+
+	          sprintf(current->name, "%dx%d", SiS_PlasmaMode[l].HDisplay,
+                                                  SiS_PlasmaMode[l].VDisplay);
+
+                  current->status = MODE_OK;
+
+                  current->type = M_T_BUILTIN;
+
+		  current->Clock = SiS_PlasmaMode[l].clock;
+            	  current->SynthClock = current->Clock;
+
+                  current->HDisplay   = SiS_PlasmaMode[l].HDisplay;
+                  current->HSyncStart = current->HDisplay + SiS_PlasmaMode[l].HFrontPorch;
+                  current->HSyncEnd   = current->HSyncStart + SiS_PlasmaMode[l].HSyncWidth;
+                  current->HTotal     = SiS_PlasmaMode[l].HTotal;
+
+		  current->VDisplay   = SiS_PlasmaMode[l].VDisplay;
+                  current->VSyncStart = current->VDisplay + SiS_PlasmaMode[l].VFrontPorch;
+                  current->VSyncEnd   = current->VSyncStart + SiS_PlasmaMode[l].VSyncWidth;
+                  current->VTotal     = SiS_PlasmaMode[l].VTotal;
+
+                  current->CrtcHDisplay = current->HDisplay;
+                  current->CrtcHBlankStart = current->HSyncStart;
+                  current->CrtcHSyncStart = current->HSyncStart;
+                  current->CrtcHSyncEnd = current->HSyncEnd;
+                  current->CrtcHBlankEnd = current->HSyncEnd;
+                  current->CrtcHTotal = current->HTotal;
+
+                  current->CrtcVDisplay = current->VDisplay;
+                  current->CrtcVBlankStart = current->VSyncStart;
+                  current->CrtcVSyncStart = current->VSyncStart;
+                  current->CrtcVSyncEnd = current->VSyncEnd;
+                  current->CrtcVBlankEnd = current->VSyncEnd;
+                  current->CrtcVTotal = current->VTotal;
+
+                  if(SiS_PlasmaMode[l].SyncFlags & SIS_PL_HSYNCP)
+                     current->Flags |= V_PHSYNC;
+                  else
+                     current->Flags |= V_NHSYNC;
+
+                  if(SiS_PlasmaMode[l].SyncFlags & SIS_PL_VSYNCP)
+                     current->Flags |= V_PVSYNC;
+                  else
+                     current->Flags |= V_NVSYNC;
+
+		  if(current->HDisplay > pSiS->LCDwidth)
+		     pSiS->LCDwidth = pSiS->SiS_Pr->CP_MaxX = current->HDisplay;
+	          if(current->VDisplay > pSiS->LCDheight)
+		     pSiS->LCDheight = pSiS->SiS_Pr->CP_MaxY = current->VDisplay;
+
+               }
+	       done = TRUE;
+	       break;
+	    }
+	}
+     }
+
+     i++;
+
+   }
+
+   if(pSiS->SiS_Pr->CP_HaveCustomData) {
+
+      for(i=0; i<7; i++) {
+
+         if(pSiS->SiS_Pr->CP_DataValid[i]) {
+
+            if(!(new = xalloc(sizeof(DisplayModeRec)))) return first;
+
+            memset(new, 0, sizeof(DisplayModeRec));
+            if(!(new->name = xalloc(10))) {
+      		xfree(new);
+		return first;
+            }
+            if(!first) first = new;
+            if(current) {
+               current->next = new;
+	       new->prev = current;
+            }
+
+            current = new;
+
+            sprintf(current->name, "%dx%d", pSiS->SiS_Pr->CP_HDisplay[i],
+                                            pSiS->SiS_Pr->CP_VDisplay[i]);
+
+            current->status = MODE_OK;
+
+            current->type = M_T_BUILTIN;
+
+            current->Clock = pSiS->SiS_Pr->CP_Clock[i];
+            current->SynthClock = current->Clock;
+
+            current->HDisplay   = pSiS->SiS_Pr->CP_HDisplay[i];
+            current->HSyncStart = pSiS->SiS_Pr->CP_HSyncStart[i];
+            current->HSyncEnd   = pSiS->SiS_Pr->CP_HSyncEnd[i];
+            current->HTotal     = pSiS->SiS_Pr->CP_HTotal[i];
+
+            current->VDisplay   = pSiS->SiS_Pr->CP_VDisplay[i];
+            current->VSyncStart = pSiS->SiS_Pr->CP_VSyncStart[i];
+            current->VSyncEnd   = pSiS->SiS_Pr->CP_VSyncEnd[i];
+            current->VTotal     = pSiS->SiS_Pr->CP_VTotal[i];
+
+            current->CrtcHDisplay = current->HDisplay;
+            current->CrtcHBlankStart = pSiS->SiS_Pr->CP_HBlankStart[i];
+            current->CrtcHSyncStart = current->HSyncStart;
+            current->CrtcHSyncEnd = current->HSyncEnd;
+            current->CrtcHBlankEnd = pSiS->SiS_Pr->CP_HBlankEnd[i];
+            current->CrtcHTotal = current->HTotal;
+
+            current->CrtcVDisplay = current->VDisplay;
+            current->CrtcVBlankStart = pSiS->SiS_Pr->CP_VBlankStart[i];
+            current->CrtcVSyncStart = current->VSyncStart;
+            current->CrtcVSyncEnd = current->VSyncEnd;
+            current->CrtcVBlankEnd = pSiS->SiS_Pr->CP_VBlankEnd[i];
+            current->CrtcVTotal = current->VTotal;
+
+	    if(pSiS->SiS_Pr->CP_SyncValid[i]) {
+               if(pSiS->SiS_Pr->CP_HSync_P[i])
+                  current->Flags |= V_PHSYNC;
+               else
+                  current->Flags |= V_NHSYNC;
+
+               if(pSiS->SiS_Pr->CP_VSync_P[i])
+                  current->Flags |= V_PVSYNC;
+               else
+                  current->Flags |= V_NVSYNC;
+	    } else {
+	       /* No sync data? Use positive sync... */
+	       current->Flags |= V_PHSYNC;
+	       current->Flags |= V_PVSYNC;
+	    }
+         }
+      }
+   }
+
    return first;
 
 }
+
+/* Build a list of supported modes */
+int
+SiSTranslateToVESA(ScrnInfoPtr pScrn, int modenumber)
+{
+   SISPtr         pSiS = SISPTR(pScrn);
+   int i;
+
+   /* Initialize our pointers */
+   if(pSiS->VGAEngine == SIS_300_VGA) {
+#ifdef SIS300
+	InitTo300Pointer(pSiS->SiS_Pr, &pSiS->sishw_ext);
+#else
+	return -1;
+#endif
+   } else if(pSiS->VGAEngine == SIS_315_VGA) {
+#ifdef SIS315H
+       	InitTo310Pointer(pSiS->SiS_Pr, &pSiS->sishw_ext);
+#else
+	return -1;
 #endif
+   } else return -1;
+
+   if(modenumber <= 0x13) return modenumber;
+
+   i = 0;
+   while(pSiS->SiS_Pr->SiS_EModeIDTable[i].Ext_ModeID != 0xff) {
+      if(pSiS->SiS_Pr->SiS_EModeIDTable[i].Ext_ModeID == modenumber) {
+         return (int)pSiS->SiS_Pr->SiS_EModeIDTable[i].Ext_VESAID;
+      }
+      i++;
+   }
+   return -1;
+}
+#endif  /* Xfree86 */
 
 #ifdef LINUX_KERNEL
 int
-sisfb_mode_rate_to_dclock(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,
+sisfb_mode_rate_to_dclock(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
 			  unsigned char modeno, unsigned char rateindex)
 {
     USHORT ModeNo = modeno;
     USHORT ModeIdIndex = 0, ClockIndex = 0;
     USHORT RefreshRateTableIndex = 0;
-    UCHAR  *ROMAddr  = HwDeviceExtension->pjVirtualRomBase;
-    ULONG  temp = 0;
     int    Clock;
-    
-    if(HwDeviceExtension->jChipType < SIS_315H) {
+
+    if(HwInfo->jChipType < SIS_315H) {
 #ifdef SIS300
-       InitTo300Pointer(SiS_Pr, HwDeviceExtension);
+       InitTo300Pointer(SiS_Pr, HwInfo);
 #else
-       return 65;
+       return 65 * 1000;
 #endif
     } else {
 #ifdef SIS315H
-       InitTo310Pointer(SiS_Pr, HwDeviceExtension);
+       InitTo310Pointer(SiS_Pr, HwInfo);
 #else
-       return 65;
+       return 65 * 1000;
 #endif
     }
-    
-    temp = SiS_SearchModeID(SiS_Pr, ROMAddr, &ModeNo, &ModeIdIndex);
-    if(!temp) {
+
+    if(!(SiS_SearchModeID(SiS_Pr, &ModeNo, &ModeIdIndex))) {;
     	printk(KERN_ERR "Could not find mode %x\n", ModeNo);
-    	return 65;
+    	return 65 * 1000;
     }
-    
+
     RefreshRateTableIndex = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].REFindex;
     RefreshRateTableIndex += (rateindex - 1);
     ClockIndex = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRTVCLK;
-    if(HwDeviceExtension->jChipType < SIS_315H) {
+    if(HwInfo->jChipType < SIS_315H) {
        ClockIndex &= 0x3F;
     }
-    Clock = SiS_Pr->SiS_VCLKData[ClockIndex].CLOCK * 1000 * 1000;
+    Clock = SiS_Pr->SiS_VCLKData[ClockIndex].CLOCK * 1000;
     
     return(Clock);
 }
 
+BOOLEAN
+sisfb_gettotalfrommode(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
+		       unsigned char modeno, int *htotal, int *vtotal, unsigned char rateindex)
+{
+    USHORT ModeNo = modeno;
+    USHORT ModeIdIndex = 0, CRT1Index = 0;
+    USHORT RefreshRateTableIndex = 0;
+    unsigned char  sr_data, cr_data, cr_data2;
+
+    if(HwInfo->jChipType < SIS_315H) {
+#ifdef SIS300
+       InitTo300Pointer(SiS_Pr, HwInfo);
+#else
+       return FALSE;
+#endif
+    } else {
+#ifdef SIS315H
+       InitTo310Pointer(SiS_Pr, HwInfo);
+#else
+       return FALSE;
+#endif
+    }
+
+    if(!(SiS_SearchModeID(SiS_Pr, &ModeNo, &ModeIdIndex))) return FALSE;
+
+    RefreshRateTableIndex = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].REFindex;
+    RefreshRateTableIndex += (rateindex - 1);
+    CRT1Index = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT1CRTC;
+
+    sr_data = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[14];
+    cr_data = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[0];
+    *htotal = (((cr_data & 0xff) | ((unsigned short) (sr_data & 0x03) << 8)) + 5) * 8;
+
+    sr_data = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[13];
+    cr_data = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[6];
+    cr_data2 = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[7];
+    *vtotal = ((cr_data & 0xFF) |
+               ((unsigned short)(cr_data2 & 0x01) <<  8) |
+	       ((unsigned short)(cr_data2 & 0x20) <<  4) |
+	       ((unsigned short)(sr_data  & 0x01) << 10)) + 2;
+
+    if(SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_InfoFlag & InterlaceMode)
+       *vtotal *= 2;
+
+    return TRUE;
+}
+
 int
-sisfb_mode_rate_to_ddata(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,
+sisfb_mode_rate_to_ddata(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
 			 unsigned char modeno, unsigned char rateindex,
 			 ULONG *left_margin, ULONG *right_margin, 
 			 ULONG *upper_margin, ULONG *lower_margin,
@@ -5529,29 +5167,27 @@
     USHORT ModeNo = modeno;
     USHORT ModeIdIndex = 0, index = 0;
     USHORT RefreshRateTableIndex = 0;
-    UCHAR  *ROMAddr  = HwDeviceExtension->pjVirtualRomBase;
     unsigned short VRE, VBE, VRS, VBS, VDE, VT;
     unsigned short HRE, HBE, HRS, HBS, HDE, HT;
     unsigned char  sr_data, cr_data, cr_data2, cr_data3;
     int            A, B, C, D, E, F, temp, j;
    
-    if(HwDeviceExtension->jChipType < SIS_315H) {
+    if(HwInfo->jChipType < SIS_315H) {
 #ifdef SIS300
-       InitTo300Pointer(SiS_Pr, HwDeviceExtension);
+       InitTo300Pointer(SiS_Pr, HwInfo);
 #else
        return 0;
 #endif
     } else {
 #ifdef SIS315H
-       InitTo310Pointer(SiS_Pr, HwDeviceExtension);
+       InitTo310Pointer(SiS_Pr, HwInfo);
 #else
        return 0;
 #endif
     }
     
-    temp = SiS_SearchModeID(SiS_Pr, ROMAddr, &ModeNo, &ModeIdIndex);
-    if(!temp) return 0;
-    
+    if(!(SiS_SearchModeID(SiS_Pr, &ModeNo, &ModeIdIndex))) return 0;
+
     RefreshRateTableIndex = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].REFindex;
     RefreshRateTableIndex += (rateindex - 1);
     index = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT1CRTC;
@@ -5606,17 +5242,32 @@
     C = (temp > 0) ? temp : (temp + 64);
 
     D = B - F - C;
-    
-    *left_margin = D * 8;
-    *right_margin = F * 8;
-    *hsync_len = C * 8;
+
+    if((SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].XRes == 320) &&
+       ((SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].YRes == 200) ||
+	(SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].YRes == 240))) {
+
+	 /* Terrible hack, but the correct CRTC data for
+	  * these modes only produces a black screen...
+	  */
+       *left_margin = (400 - 376);
+       *right_margin = (328 - 320);
+       *hsync_len = (376 - 328);
+
+    } else {
+
+       *left_margin = D * 8;
+       *right_margin = F * 8;
+       *hsync_len = C * 8;
+
+    }
 
     sr_data = SiS_Pr->SiS_CRT1Table[index].CR[13];
 
     cr_data = SiS_Pr->SiS_CRT1Table[index].CR[6];
-    
+
     cr_data2 = SiS_Pr->SiS_CRT1Table[index].CR[7];
-    
+
     /* Vertical total */
     VT = (cr_data & 0xFF) |
          ((unsigned short) (cr_data2 & 0x01) << 8) |
@@ -5683,7 +5334,7 @@
     else
        *sync |= FB_SYNC_HOR_HIGH_ACT;
 		
-    *vmode = FB_VMODE_NONINTERLACED;       
+    *vmode = FB_VMODE_NONINTERLACED;
     if(SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_InfoFlag & 0x0080)
        *vmode = FB_VMODE_INTERLACED;
     else {
@@ -5699,19 +5350,19 @@
 	  j++;
       }
     }       
-       
-#if 0  /* That's bullshit, only the resolution needs to be shifted */    
+
     if((*vmode & FB_VMODE_MASK) == FB_VMODE_INTERLACED) {
+#if 0  /* Do this? */
        *upper_margin <<= 1;
        *lower_margin <<= 1;
        *vsync_len <<= 1;
+#endif
     } else if((*vmode & FB_VMODE_MASK) == FB_VMODE_DOUBLE) {
        *upper_margin >>= 1;
        *lower_margin >>= 1;
        *vsync_len >>= 1;
-    }  
-#endif
-          
+    }
+
     return 1;       
 }			  
 
--- diff/drivers/video/sis/init.h	2003-10-09 09:47:17.000000000 +0100
+++ source/drivers/video/sis/init.h	2004-02-09 10:39:55.000000000 +0000
@@ -1,19 +1,66 @@
+/* $XFree86$ */
+/*
+ * Data and prototypes for init.c
+ *
+ * Copyright (C) 2001-2004 by Thomas Winischhofer, Vienna, Austria
+ *
+ * If distributed as part of the Linux kernel, the following license terms
+ * apply:
+ *
+ * * 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 named License,
+ * * or 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
+ *
+ * Otherwise, the following license terms apply:
+ *
+ * * 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) All advertising materials mentioning features or use of this software
+ * *    must display the following acknowledgement: "This product includes
+ * *    software developed by Thomas Winischhofer, Vienna, Austria."
+ * * 4) The name of the author may not be used to endorse or promote products
+ * *    derived from this software without specific prior written permission.
+ * *
+ * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
+ *
+ * Author: 	Thomas Winischhofer <thomas@winischhofer.net>
+ *
+ */
+
 #ifndef _INIT_
 #define _INIT_
 
 #include "osdef.h"
+
 #include "initdef.h"
 #include "vgatypes.h"
 #include "vstruct.h"
 
-#ifdef TC
-#include <stdio.h>
-#include <string.h>
-#include <conio.h>
-#include <dos.h>
-#include <stdlib.h>
-#endif
-
 #ifdef LINUX_XF86
 #include "xf86.h"
 #include "xf86Pci.h"
@@ -24,6 +71,9 @@
 #endif
 
 #ifdef LINUX_KERNEL
+#ifdef SIS_CP
+#undef SIS_CP
+#endif
 #include <linux/config.h>
 #include <linux/version.h>
 #include <linux/types.h>
@@ -36,18 +86,38 @@
 #endif
 #endif
 
-#ifdef WIN2000
-#include <stdio.h>
-#include <string.h>
-#include <miniport.h>
-#include "dderror.h"
-#include "devioctl.h"
-#include "miniport.h"
-#include "ntddvdeo.h"
-#include "video.h"
-#include "sisv.h"
-#include "tools.h"
-#endif
+/* Mode numbers */
+const USHORT  ModeIndex_320x200[]      = {0x59, 0x41, 0x00, 0x4f};
+const USHORT  ModeIndex_320x240[]      = {0x50, 0x56, 0x00, 0x53};
+const USHORT  ModeIndex_320x240_FSTN[] = {0x5a, 0x5b, 0x00, 0x00};  /* FSTN */
+const USHORT  ModeIndex_400x300[]      = {0x51, 0x57, 0x00, 0x54};
+const USHORT  ModeIndex_512x384[]      = {0x52, 0x58, 0x00, 0x5c};
+const USHORT  ModeIndex_640x400[]      = {0x2f, 0x5d, 0x00, 0x5e};
+const USHORT  ModeIndex_640x480[]      = {0x2e, 0x44, 0x00, 0x62};
+const USHORT  ModeIndex_720x480[]      = {0x31, 0x33, 0x00, 0x35};
+const USHORT  ModeIndex_720x576[]      = {0x32, 0x34, 0x00, 0x36};
+const USHORT  ModeIndex_768x576[]      = {0x5f, 0x60, 0x00, 0x61};
+const USHORT  ModeIndex_800x480[]      = {0x70, 0x7a, 0x00, 0x76};
+const USHORT  ModeIndex_800x600[]      = {0x30, 0x47, 0x00, 0x63};
+const USHORT  ModeIndex_848x480[]      = {0x39, 0x3b, 0x00, 0x3e};
+const USHORT  ModeIndex_856x480[]      = {0x3f, 0x42, 0x00, 0x45};
+const USHORT  ModeIndex_1024x768[]     = {0x38, 0x4a, 0x00, 0x64};
+const USHORT  ModeIndex_1024x576[]     = {0x71, 0x74, 0x00, 0x77};
+const USHORT  ModeIndex_1024x600[]     = {0x20, 0x21, 0x00, 0x22};  /* 300 series only */
+const USHORT  ModeIndex_1280x1024[]    = {0x3a, 0x4d, 0x00, 0x65};
+const USHORT  ModeIndex_1280x960[]     = {0x7c, 0x7d, 0x00, 0x7e};
+const USHORT  ModeIndex_1152x768[]     = {0x23, 0x24, 0x00, 0x25};  /* 300 series only */
+const USHORT  ModeIndex_1152x864[]     = {0x29, 0x2a, 0x00, 0x2b};
+const USHORT  ModeIndex_300_1280x768[] = {0x55, 0x5a, 0x00, 0x5b};
+const USHORT  ModeIndex_310_1280x768[] = {0x23, 0x24, 0x00, 0x25};
+const USHORT  ModeIndex_1280x720[]     = {0x79, 0x75, 0x00, 0x78};
+const USHORT  ModeIndex_1360x768[]     = {0x48, 0x4b, 0x00, 0x4e};
+const USHORT  ModeIndex_300_1360x1024[]= {0x67, 0x6f, 0x00, 0x72};  /* 300 series, BARCO only */
+const USHORT  ModeIndex_1400x1050[]    = {0x26, 0x27, 0x00, 0x28};  /* 315 series only */
+const USHORT  ModeIndex_1600x1200[]    = {0x3c, 0x3d, 0x00, 0x66};
+const USHORT  ModeIndex_1920x1440[]    = {0x68, 0x69, 0x00, 0x6b};
+const USHORT  ModeIndex_300_2048x1536[]= {0x6c, 0x6d, 0x00, 0x00};
+const USHORT  ModeIndex_310_2048x1536[]= {0x6c, 0x6d, 0x00, 0x6e};
 
 const USHORT SiS_DRAMType[17][5]={
 	{0x0C,0x0A,0x02,0x40,0x39},
@@ -144,187 +214,2650 @@
 	0x0B,0x0C,0x0D,0x0F,0x10
 };
 
-void     SiS_SetReg1(USHORT, USHORT, USHORT);
-void     SiS_SetReg2(SiS_Private *, USHORT, USHORT, USHORT);
-void     SiS_SetReg3(USHORT, USHORT);
-void     SiS_SetReg4(USHORT, ULONG);
-void     SiS_SetReg5(USHORT, USHORT);
-UCHAR    SiS_GetReg1(USHORT, USHORT);
-UCHAR    SiS_GetReg2(USHORT);
-ULONG    SiS_GetReg3(USHORT);
-USHORT   SiS_GetReg4(USHORT);
-void     SiS_ClearDAC(SiS_Private *SiS_Pr, ULONG);
-void     SiS_SetMemoryClock(SiS_Private *SiS_Pr, UCHAR *ROMAddr,PSIS_HW_DEVICE_INFO HwDeviceExtension);
-void     SiS_SetDRAMModeRegister(SiS_Private *SiS_Pr, UCHAR *ROMAddr,PSIS_HW_DEVICE_INFO HwDeviceExtension);
-BOOLEAN  SiS_SearchVBModeID(SiS_Private *SiS_Pr, UCHAR *ROMAddr, USHORT *ModeNo);
-void     SiS_IsLowResolution(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex);
-
-#ifdef SIS300
-void     SiS_SetDRAMSize_300(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension);
-USHORT   SiS_ChkBUSWidth_300(SiS_Private *SiS_Pr, ULONG FBAddress);
+static const SiS_StResInfoStruct SiS_StResInfo[]=
+{
+	{ 640,400},
+	{ 640,350},
+	{ 720,400},
+	{ 720,350},
+	{ 640,480}
+};
+
+static const SiS_ModeResInfoStruct SiS_ModeResInfo[] =
+{
+	{  320, 200, 8, 8},   /* 0x00 */
+	{  320, 240, 8, 8},   /* 0x01 */
+	{  320, 400, 8, 8},   /* 0x02 */
+	{  400, 300, 8, 8},   /* 0x03 */
+	{  512, 384, 8, 8},   /* 0x04 */
+	{  640, 400, 8,16},   /* 0x05 */
+	{  640, 480, 8,16},   /* 0x06 */
+	{  800, 600, 8,16},   /* 0x07 */
+	{ 1024, 768, 8,16},   /* 0x08 */
+	{ 1280,1024, 8,16},   /* 0x09 */
+	{ 1600,1200, 8,16},   /* 0x0a */
+	{ 1920,1440, 8,16},   /* 0x0b */
+	{ 2048,1536, 8,16},   /* 0x0c */
+	{  720, 480, 8,16},   /* 0x0d */
+	{  720, 576, 8,16},   /* 0x0e */
+	{ 1280, 960, 8,16},   /* 0x0f */
+	{  800, 480, 8,16},   /* 0x10 */
+	{ 1024, 576, 8,16},   /* 0x11 */
+	{ 1280, 720, 8,16},   /* 0x12 */
+	{  856, 480, 8,16},   /* 0x13 */
+	{ 1280, 768, 8,16},   /* 0x14 */
+	{ 1400,1050, 8,16},   /* 0x15 */
+	{ 1152, 864, 8,16},   /* 0x16 */
+	{  848, 480, 8,16},   /* 0x17 */
+	{ 1360, 768, 8,16},   /* 0x18 */
+	{ 1024, 600, 8,16},   /* 0x19 */
+	{ 1152, 768, 8,16},   /* 0x1a */
+	{  768, 576, 8,16},   /* 0x1b */
+	{ 1360,1024, 8,16}    /* 0x1c */
+};
+
+static SiS_StandTableStruct SiS_StandTable[]=
+{
+/* 0x00: MD_0_200 */
+ {
+  0x28,0x18,0x08,0x0800,
+  {0x09,0x03,0x00,0x02},
+  0x63,
+  {0x2d,0x27,0x28,0x90,0x2b,0xa0,0xbf,0x1f,
+   0x00,0xc7,0x06,0x07,0x00,0x00,0x00,0x00,
+   0x9c,0x8e,0x8f,0x14,0x1f,0x96,0xb9,0xa3,
+   0xff},
+  {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
+   0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,
+   0x08,0x00,0x0f,0x00},
+  {0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
+   0xff}
+ },
+/* 0x01: MD_1_200 */
+ {
+  0x28,0x18,0x08,0x0800,
+  {0x09,0x03,0x00,0x02},
+  0x63,
+  {0x2d,0x27,0x28,0x90,0x2b,0xa0,0xbf,0x1f,
+   0x00,0xc7,0x06,0x07,0x00,0x00,0x00,0x00,
+   0x9c,0x8e,0x8f,0x14,0x1f,0x96,0xb9,0xa3,
+   0xff},
+  {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
+   0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,
+   0x08,0x00,0x0f,0x00},
+  {0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
+   0xff}
+ },
+/* 0x02: MD_2_200 */
+ {
+  0x50,0x18,0x08,0x1000,
+  {0x01,0x03,0x00,0x02},
+  0x63,
+  {0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f,
+   0x00,0xc7,0x06,0x07,0x00,0x00,0x00,0x00,
+   0x9c,0x8e,0x8f,0x28,0x1f,0x96,0xb9,0xa3,
+   0xff},
+  {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
+   0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,
+   0x08,0x00,0x0f,0x00},
+  {0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
+   0xff}
+ },
+/* 0x03: MD_3_200 - mode 0x03 - 0 */
+ {
+  0x50,0x18,0x08,0x1000,
+  {0x01,0x03,0x00,0x02},
+  0x63,
+  {0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f,
+   0x00,0xc7,0x06,0x07,0x00,0x00,0x00,0x00,
+   0x9c,0x8e,0x8f,0x28,0x1f,0x96,0xb9,0xa3,
+   0xff},
+  {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
+   0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,
+   0x08,0x00,0x0f,0x00},
+  {0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
+   0xff}
+ },
+/* 0x04: MD_4 */
+ {
+  0x28,0x18,0x08,0x4000,
+  {0x09,0x03,0x00,0x02},
+  0x63,
+  {0x2d,0x27,0x28,0x90,0x2c,0x80,0xbf,0x1f,   /* 0x2c is 2b for 300 */
+   0x00,0xc1,0x00,0x00,0x00,0x00,0x00,0x00,
+   0x9c,0x8e,0x8f,0x14,0x00,0x96,0xb9,0xa2,
+   0xff},
+  {0x00,0x13,0x15,0x17,0x02,0x04,0x06,0x07,
+   0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,
+   0x01,0x00,0x03,0x00},
+  {0x00,0x00,0x00,0x00,0x00,0x30,0x0f,0x00,
+   0xff}
+ },
+/* 0x05: MD_5 */
+ {
+  0x28,0x18,0x08,0x4000,
+  {0x09,0x03,0x00,0x02},
+  0x63,
+  {0x2d,0x27,0x28,0x90,0x2c,0x80,0xbf,0x1f,   /* 0x2c is 2b for 300 */
+   0x00,0xc1,0x00,0x00,0x00,0x00,0x00,0x00,
+   0x9c,0x8e,0x8f,0x14,0x00,0x96,0xb9,0xa2,
+   0xff},
+  {0x00,0x13,0x15,0x17,0x02,0x04,0x06,0x07,
+   0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,
+   0x01,0x00,0x03,0x00},
+  {0x00,0x00,0x00,0x00,0x00,0x30,0x0f,0x00,
+   0xff}
+ },
+/* 0x06: MD_6 */
+ {
+  0x50,0x18,0x08,0x4000,
+  {0x01,0x01,0x00,0x06},
+  0x63,
+  {0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f,   /* 55,81 is 54,80 for 300 */
+   0x00,0xc1,0x00,0x00,0x00,0x00,0x00,0x00,
+   0x9c,0x8e,0x8f,0x28,0x00,0x96,0xb9,0xc2,
+   0xff},
+  {0x00,0x17,0x17,0x17,0x17,0x17,0x17,0x17,
+   0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,
+   0x01,0x00,0x01,0x00},
+  {0x00,0x00,0x00,0x00,0x00,0x00,0x0d,0x00,
+   0xff}
+ },
+/* 0x07: MD_7 */
+ {
+  0x50,0x18,0x0e,0x1000,
+  {0x00,0x03,0x00,0x03},
+  0xa6,
+  {0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f,
+   0x00,0x4d,0x0b,0x0c,0x00,0x00,0x00,0x00,
+   0x83,0x85,0x5d,0x28,0x0d,0x63,0xba,0xa3,
+   0xff},
+  {0x00,0x08,0x08,0x08,0x08,0x08,0x08,0x08,
+   0x10,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
+   0x0e,0x00,0x0f,0x08},
+  {0x00,0x00,0x00,0x00,0x00,0x10,0x0a,0x00,
+   0xff}
+ },
+/* 0x08: MDA_DAC */
+ {
+  0x00,0x00,0x00,0x0000,
+  {0x00,0x00,0x00,0x15},
+  0x15,
+  {0x15,0x15,0x15,0x15,0x15,0x15,0x15,0x15,
+   0x15,0x15,0x15,0x15,0x15,0x15,0x3f,0x3f,
+   0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x00,0x00,
+   0x00},
+  {0x00,0x00,0x00,0x00,0x00,0x15,0x15,0x15,
+   0x15,0x15,0x15,0x15,0x15,0x15,0x15,0x15,
+   0x15,0x15,0x15,0x15},
+  {0x15,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,
+   0x3f}
+ },
+/* 0x09: CGA_DAC */
+ {
+  0x00,0x10,0x04,0x0114,
+  {0x11,0x09,0x15,0x00},
+  0x10,
+  {0x04,0x14,0x01,0x11,0x09,0x15,0x2a,0x3a,
+   0x2e,0x3e,0x2b,0x3b,0x2f,0x3f,0x2a,0x3a,
+   0x2e,0x3e,0x2b,0x3b,0x2f,0x3f,0x00,0x10,
+   0x04},
+  {0x14,0x01,0x11,0x09,0x15,0x00,0x10,0x04,
+   0x14,0x01,0x11,0x09,0x15,0x2a,0x3a,0x2e,
+   0x3e,0x2b,0x3b,0x2f},
+  {0x3f,0x2a,0x3a,0x2e,0x3e,0x2b,0x3b,0x2f,
+   0x3f}
+ },
+/* 0x0a: EGA_DAC */
+ {
+  0x00,0x10,0x04,0x0114,
+  {0x11,0x05,0x15,0x20},
+  0x30,
+  {0x24,0x34,0x21,0x31,0x25,0x35,0x08,0x18,
+   0x0c,0x1c,0x09,0x19,0x0d,0x1d,0x28,0x38,
+   0x2c,0x3c,0x29,0x39,0x2d,0x3d,0x02,0x12,
+   0x06},
+  {0x16,0x03,0x13,0x07,0x17,0x22,0x32,0x26,
+   0x36,0x23,0x33,0x27,0x37,0x0a,0x1a,0x0e,
+   0x1e,0x0b,0x1b,0x0f},
+  {0x1f,0x2a,0x3a,0x2e,0x3e,0x2b,0x3b,0x2f,
+   0x3f}
+ },
+/* 0x0b: VGA_DAC */
+ {
+  0x00,0x10,0x04,0x0114,
+  {0x11,0x09,0x15,0x2a},
+  0x3a,
+  {0x2e,0x3e,0x2b,0x3b,0x2f,0x3f,0x00,0x05,
+   0x08,0x0b,0x0e,0x11,0x14,0x18,0x1c,0x20,
+   0x24,0x28,0x2d,0x32,0x38,0x3f,0x00,0x10,
+   0x1f},
+  {0x2f,0x3f,0x1f,0x27,0x2f,0x37,0x3f,0x2d,
+   0x31,0x36,0x3a,0x3f,0x00,0x07,0x0e,0x15,
+   0x1c,0x0e,0x11,0x15},
+  {0x18,0x1c,0x14,0x16,0x18,0x1a,0x1c,0x00,
+   0x04}
+ },
+/* 0x0c */
+ {
+  0x08,0x0c,0x10,0x0a08,
+  {0x0c,0x0e,0x10,0x0b},
+  0x0c,
+  {0x0d,0x0f,0x10,0x10,0x01,0x08,0x00,0x00,
+   0x00,0x00,0x01,0x00,0x02,0x02,0x01,0x00,
+   0x04,0x04,0x01,0x00,0x05,0x02,0x05,0x00,
+   0x06},
+  {0x01,0x06,0x05,0x06,0x00,0x08,0x01,0x08,
+   0x00,0x07,0x02,0x07,0x06,0x07,0x00,0x00,
+   0x00,0x00,0x00,0x00},
+  {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+   0x00}
+ },
+/* 0x0d: MD_D */
+ {
+  0x28,0x18,0x08,0x2000,
+  {0x09,0x0f,0x00,0x06},
+  0x63,
+  {0x2d,0x27,0x28,0x90,0x2c,0x80,0xbf,0x1f,     /* 2c is 2b for 300 */
+   0x00,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,
+   0x9c,0x8e,0x8f,0x14,0x00,0x96,0xb9,0xe3,
+   0xff},
+  {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
+   0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,
+   0x01,0x00,0x0f,0x00},
+  {0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x0f,
+   0xff}
+ },
+/* 0x0e: MD_E */
+ {
+  0x50,0x18,0x08,0x4000,
+  {0x01,0x0f,0x00,0x06},
+  0x63,
+  {0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f,     /* 55,81 is 54,80 for 300 */
+   0x00,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,
+   0x9c,0x8e,0x8f,0x28,0x00,0x96,0xb9,0xe3,
+   0xff},
+  {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
+   0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,
+   0x01,0x00,0x0f,0x00},
+  {0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x0f,
+   0xff}
+ },
+/* 0x0f: ExtVGATable - modes > 0x13 */
+ {
+  0x00,0x00,0x00,0x0000,
+  {0x01,0x0f,0x00,0x0e},
+  0x23,
+  {0x5f,0x4f,0x50,0x82,0x54,0x80,0x0b,0x3e,
+   0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,
+   0xea,0x8c,0xdf,0x28,0x40,0xe7,0x04,0xa3,
+   0xff},
+  {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
+   0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,
+   0x01,0x00,0x00,0x00},
+  {0x00,0x00,0x00,0x00,0x00,0x40,0x05,0x0f,
+   0xff}
+ },
+/* 0x10: ROM_SAVEPTR - totally different for 300 */
+ {
+  0x9f,0x3b,0x00,0x00c0,
+  {0x00,0x00,0x00,0x00},
+  0x00,
+  {0x00,0x00,0x00,0x00,0x00,0x00,0xbb,0x3f,
+   0x00,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,
+   0x00,0x00,0x1a,0x00,0xac,0x3e,0x00,0xc0,
+   0x00},
+  {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+   0x00,0x00,0x00,0x00},
+  {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+   0x00}
+ },
+/* 0x11: MD_F */
+ {
+  0x50,0x18,0x0e,0x8000,
+  {0x01,0x0f,0x00,0x06},
+  0xa2,
+  {0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f,    /* 55,81 is 54,80 on 300 */
+   0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,
+   0x82,0x84,0x5d,0x28,0x0f,0x63,0xba,0xe3,    /* 82,84 is 83,85 on 300 */
+   0xff},
+  {0x00,0x08,0x00,0x00,0x18,0x18,0x00,0x00,
+   0x00,0x08,0x00,0x00,0x00,0x18,0x00,0x00,
+   0x0b,0x00,0x05,0x00},
+  {0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x05,
+   0xff}
+ },
+/* 0x12: MD_10 */
+ {
+  0x50,0x18,0x0e,0x8000,
+  {0x01,0x0f,0x00,0x06},
+  0xa3,
+  {0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f,    /* 55,81 is 54,80 on 300 */
+   0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,
+   0x82,0x84,0x5d,0x28,0x0f,0x63,0xba,0xe3,    /* 82,84 is 83,85 on 300 */
+   0xff},
+  {0x00,0x01,0x02,0x03,0x04,0x05,0x14,0x07,
+   0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,
+   0x01,0x00,0x0f,0x00},
+  {0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x0f,
+   0xff}
+ },
+/* 0x13: MD_0_350 */
+ {
+  0x28,0x18,0x0e,0x0800,
+  {0x09,0x03,0x00,0x02},
+  0xa3,
+  {0x2d,0x27,0x28,0x90,0x2b,0xb1,0xbf,0x1f,    /* b1 is a0 on 300 */
+   0x00,0x4d,0x0b,0x0c,0x00,0x00,0x00,0x00,
+   0x83,0x85,0x5d,0x14,0x1f,0x63,0xba,0xa3,
+   0xff},
+  {0x00,0x01,0x02,0x03,0x04,0x05,0x14,0x07,
+   0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,
+   0x08,0x00,0x0f,0x00},
+  {0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
+   0xff}
+ },
+/* 0x14: MD_1_350 */
+ {
+  0x28,0x18,0x0e,0x0800,
+  {0x09,0x03,0x00,0x02},
+  0xa3,
+  {0x2d,0x27,0x28,0x90,0x2b,0xa0,0xbf,0x1f,
+   0x00,0x4d,0x0b,0x0c,0x00,0x00,0x00,0x00,
+   0x83,0x85,0x5d,0x14,0x1f,0x63,0xba,0xa3,
+   0xff},
+  {0x00,0x01,0x02,0x03,0x04,0x05,0x14,0x07,
+   0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,
+   0x08,0x00,0x0f,0x00},
+  {0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
+   0xff}
+ },
+/* 0x15: MD_2_350 */
+ {
+  0x50,0x18,0x0e,0x1000,
+  {0x01,0x03,0x00,0x02},
+  0xa3,
+  {0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f,
+   0x00,0x4d,0x0b,0x0c,0x00,0x00,0x00,0x00,
+   0x83,0x85,0x5d,0x28,0x1f,0x63,0xba,0xa3,
+   0xff},
+  {0x00,0x01,0x02,0x03,0x04,0x05,0x14,0x07,
+   0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,
+   0x08,0x00,0x0f,0x00},
+  {0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
+   0xff}
+ },
+/* 0x16: MD_3_350 - mode 0x03 - 1 */
+ {
+  0x50,0x18,0x0e,0x1000,
+  {0x01,0x03,0x00,0x02},
+  0xa3,
+  {0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f,
+   0x00,0x4d,0x0b,0x0c,0x00,0x00,0x00,0x00,
+   0x83,0x85,0x5d,0x28,0x1f,0x63,0xba,0xa3,
+   0xff},
+  {0x00,0x01,0x02,0x03,0x04,0x05,0x14,0x07,
+   0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,
+   0x08,0x00,0x0f,0x00},
+  {0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
+   0xff}
+ },
+/* 0x17: MD_0_1_400 */
+ {
+  0x28,0x18,0x10,0x0800,
+  {0x08,0x03,0x00,0x02},
+  0x67,
+  {0x2d,0x27,0x28,0x90,0x2b,0xb1,0xbf,0x1f,    /* b1 is a0 on 300 */
+   0x00,0x4f,0x0d,0x0e,0x00,0x00,0x00,0x00,
+   0x9c,0x8e,0x8f,0x14,0x1f,0x96,0xb9,0xa3,
+   0xff},
+  {0x00,0x01,0x02,0x03,0x04,0x05,0x14,0x07,
+   0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,
+   0x0c,0x00,0x0f,0x08},
+  {0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
+   0xff}
+ },
+/* 0x18: MD_2_3_400 - mode 0x03 - 2 */
+ {
+  0x50,0x18,0x10,0x1000,
+  {0x00,0x03,0x00,0x02},
+  0x67,
+  {0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f,
+   0x00,0x4f,0x0d,0x0e,0x00,0x00,0x00,0x00,
+   0x9c,0x8e,0x8f,0x28,0x1f,0x96,0xb9,0xa3,
+   0xff},
+  {0x00,0x01,0x02,0x03,0x04,0x05,0x14,0x07,
+   0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,
+   0x0c,0x00,0x0f,0x08},
+  {0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
+   0xff}
+ },
+/* 0x19: MD_7_400 */
+ {
+  0x50,0x18,0x10,0x1000,
+  {0x00,0x03,0x00,0x02},
+  0x66,
+  {0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f,
+   0x00,0x4f,0x0d,0x0e,0x00,0x00,0x00,0x00,
+   0x9c,0x8e,0x8f,0x28,0x0f,0x96,0xb9,0xa3,
+   0xff},
+  {0x00,0x08,0x08,0x08,0x08,0x08,0x08,0x08,
+   0x10,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
+   0x0e,0x00,0x0f,0x08},
+  {0x00,0x00,0x00,0x00,0x00,0x10,0x0a,0x00,
+   0xff}
+ },
+/* 0x1a: MD_11 */
+ {
+  0x50,0x1d,0x10,0xa000,
+  {0x01,0x0f,0x00,0x06},
+  0xe3,
+  {0x5f,0x4f,0x50,0x82,0x55,0x81,0x0b,0x3e,    /* 55,81 is 54,80 on 300 */
+   0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,
+   0xe9,0x8b,0xdf,0x28,0x00,0xe7,0x04,0xc3,    /* e9,8b is ea,8c on 300 */
+   0xff},
+  {0x00,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,
+   0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,
+   0x01,0x00,0x0f,0x00},
+  {0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x01,
+   0xff}
+ },
+/* 0x1b: ExtEGATable - Modes <= 0x02 */
+ {
+  0x50,0x1d,0x10,0xa000,
+  {0x01,0x0f,0x00,0x06},
+  0xe3,
+  {0x5f,0x4f,0x50,0x82,0x55,0x81,0x0b,0x3e,    /* 55,81 is 54,80 on 300 */
+   0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,
+   0xe9,0x8b,0xdf,0x28,0x00,0xe7,0x04,0xe3,    /* e9,8b is ea,8c on 300 */
+   0xff},
+  {0x00,0x01,0x02,0x03,0x04,0x05,0x14,0x07,
+   0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,
+   0x01,0x00,0x0f,0x00},
+  {0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x0f,
+   0xff}
+ },
+/* 0x1c: MD_13 */
+ {
+  0x28,0x18,0x08,0x2000,
+  {0x01,0x0f,0x00,0x0e},
+  0x63,
+  {0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f,    /* 55,81 is 54,80 on 300 */
+   0x00,0x41,0x00,0x00,0x00,0x00,0x00,0x00,
+   0x9c,0x8e,0x8f,0x28,0x40,0x96,0xb9,0xa3,
+   0xff},
+  {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
+   0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,
+   0x41,0x00,0x0f,0x00},
+  {0x00,0x00,0x00,0x00,0x00,0x40,0x05,0x0f,
+   0xff}
+ }
+};
+
+/**************************************************************/
+/* SIS VIDEO BRIDGE ----------------------------------------- */
+/**************************************************************/
+
+static const UCHAR SiS_SoftSetting  = 0x30;   /* RAM setting */
+
+static const UCHAR SiS_OutputSelect = 0x40;
+
+static const UCHAR SiS_NTSCTiming[] = {
+	0x17,0x1d,0x03,0x09,0x05,0x06,0x0c,0x0c,
+	0x94,0x49,0x01,0x0a,0x06,0x0d,0x04,0x0a,
+	0x06,0x14,0x0d,0x04,0x0a,0x00,0x85,0x1b,
+	0x0c,0x50,0x00,0x97,0x00,0xda,0x4a,0x17,
+	0x7d,0x05,0x4b,0x00,0x00,0xe2,0x00,0x02,
+	0x03,0x0a,0x65,0x9d,0x08,0x92,0x8f,0x40,
+	0x60,0x80,0x14,0x90,0x8c,0x60,0x14,0x50,
+	0x00,0x40,0x44,0x00,0xdb,0x02,0x3b,0x00
+};
+
+static const UCHAR SiS_PALTiming[] = {
+	0x19,0x52,0x35,0x6e,0x04,0x38,0x3d,0x70,
+	0x94,0x49,0x01,0x12,0x06,0x3e,0x35,0x6d,
+	0x06,0x14,0x3e,0x35,0x6d,0x00,0x45,0x2b,
+	0x70,0x50,0x00,0x9b,0x00,0xd9,0x5d,0x17,
+	0x7d,0x05,0x45,0x00,0x00,0xe8,0x00,0x02,
+	0x0d,0x00,0x68,0xb0,0x0b,0x92,0x8f,0x40,
+	0x60,0x80,0x14,0x90,0x8c,0x60,0x14,0x63,
+	0x00,0x40,0x3e,0x00,0xe1,0x02,0x28,0x00
+};
+
+static const UCHAR SiS_HiTVExtTiming[] = {
+        0x32,0x65,0x2c,0x5f,0x08,0x31,0x3a,0x64,
+	0x28,0x02,0x01,0x3d,0x06,0x3e,0x35,0x6d,
+	0x06,0x14,0x3e,0x35,0x6d,0x00,0xc5,0x3f,
+	0x64,0x90,0x33,0x8c,0x18,0x36,0x3e,0x13,
+	0x2a,0xde,0x2a,0x44,0x40,0x2a,0x44,0x40,
+	0x8e,0x8e,0x82,0x07,0x0b,0x92,0x0f,0x40,
+	0x60,0x80,0x14,0x90,0x8c,0x60,0x14,0x3d,
+	0x63,0x4f,0x27,0x00,0xfc,0xff,0x6a,0x00
+};
+
+static const UCHAR SiS_HiTVSt1Timing[] = {
+        0x32,0x65,0x2c,0x5f,0x08,0x31,0x3a,0x65,
+	0x28,0x02,0x01,0x3d,0x06,0x3e,0x35,0x6d,
+	0x06,0x14,0x3e,0x35,0x6d,0x00,0xc5,0x3f,
+	0x65,0x90,0x7b,0xa8,0x03,0xf0,0x87,0x03,
+	0x11,0x15,0x11,0xcf,0x10,0x11,0xcf,0x10,
+	0x35,0x35,0x3b,0x69,0x1d,0x92,0x0f,0x40,
+	0x60,0x80,0x14,0x90,0x8c,0x60,0x04,0x86,
+	0xaf,0x5d,0x0e,0x00,0xfc,0xff,0x2d,0x00
+};
+
+static const UCHAR SiS_HiTVSt2Timing[] = {
+        0x32,0x65,0x2c,0x5f,0x08,0x31,0x3a,0x64,
+	0x28,0x02,0x01,0x3d,0x06,0x3e,0x35,0x6d,
+	0x06,0x14,0x3e,0x35,0x6d,0x00,0xc5,0x3f,
+	0x64,0x90,0x33,0x8c,0x18,0x36,0x3e,0x13,
+	0x2a,0xde,0x2a,0x44,0x40,0x2a,0x44,0x40,
+	0x8e,0x8e,0x82,0x07,0x0b,0x92,0x0f,0x40,
+	0x60,0x80,0x14,0x90,0x8c,0x60,0x14,0x3d,
+	0x63,0x4f,0x27,0x00,0xfc,0xff,0x6a,0x00
+};
+
+#if 0
+static const UCHAR SiS_HiTVTextTiming[] = {
+        0x32,0x65,0x2c,0x5f,0x08,0x31,0x3a,0x65,
+	0x28,0x02,0x01,0x3d,0x06,0x3e,0x35,0x6d,
+	0x06,0x14,0x3e,0x35,0x6d,0x00,0xc5,0x3f,
+	0x65,0x90,0xe7,0xbc,0x03,0x0c,0x97,0x03,
+	0x14,0x78,0x14,0x08,0x20,0x14,0x08,0x20,
+	0xc8,0xc8,0x3b,0xd2,0x26,0x92,0x0f,0x40,
+        0x60,0x80,0x14,0x90,0x8c,0x60,0x04,0x96,
+	0x72,0x5c,0x11,0x00,0xfc,0xff,0x32,0x00
+};
 #endif
 
-#ifdef SIS315H
-UCHAR    SiS_Get310DRAMType(SiS_Private *SiS_Pr, UCHAR *ROMAddr,PSIS_HW_DEVICE_INFO HwDeviceExtension);
-void     SiS_DDR_MRS(SiS_Private *SiS_Pr);
-void     SiS_SDR_MRS(SiS_Private *SiS_Pr);
-void     SiS_DisableRefresh(SiS_Private *SiS_Pr);
-void     SiS_EnableRefresh(SiS_Private *SiS_Pr, UCHAR *ROMAddr);
-void     SiS_SetDRAMSize_310(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO);
-void     SiS_DisableChannelInterleaving(SiS_Private *SiS_Pr, int index,USHORT SiS_DDRDRAM_TYPE[][5]);
-void     SiS_SetDRAMSizingType(SiS_Private *SiS_Pr, int index,USHORT DRAMTYPE_TABLE[][5]);
-void     SiS_CheckBusWidth_310(SiS_Private *SiS_Pr, UCHAR *ROMAddress,ULONG FBAddress,
-                               PSIS_HW_DEVICE_INFO HwDeviceExtension);
-int      SiS_SetRank(SiS_Private *SiS_Pr, int index,UCHAR RankNo,USHORT DRAMTYPE_TABLE[][5]);
-int      SiS_SetDDRChannel(SiS_Private *SiS_Pr, int index,UCHAR ChannelNo,
-                           USHORT DRAMTYPE_TABLE[][5]);
-int      SiS_CheckColumn(SiS_Private *SiS_Pr, int index,USHORT DRAMTYPE_TABLE[][5],ULONG FBAddress);
-int      SiS_CheckBanks(SiS_Private *SiS_Pr, int index,USHORT DRAMTYPE_TABLE[][5],ULONG FBAddress);
-int      SiS_CheckRank(SiS_Private *SiS_Pr, int RankNo,int index,USHORT DRAMTYPE_TABLE[][5],ULONG FBAddress);
-int      SiS_CheckDDRRank(SiS_Private *SiS_Pr, int RankNo,int index,USHORT DRAMTYPE_TABLE[][5],ULONG FBAddress);
-int      SiS_CheckRanks(SiS_Private *SiS_Pr, int RankNo,int index,USHORT DRAMTYPE_TABLE[][5],ULONG FBAddress);
-int      SiS_CheckDDRRanks(SiS_Private *SiS_Pr, int RankNo,int index,USHORT DRAMTYPE_TABLE[][5],ULONG FBAddress);
-int      SiS_SDRSizing(SiS_Private *SiS_Pr, ULONG FBAddress);
-int      SiS_DDRSizing(SiS_Private *SiS_Pr, ULONG FBAddress);
-int      Is315E(SiS_Private *SiS_Pr);
-void     SiS_VerifyMclk(SiS_Private *SiS_Pr, ULONG FBAddr);
-#endif
-
-void     SiS_HandleCRT1(SiS_Private *SiS_Pr);
-void     SiS_Handle301B_1400x1050(SiS_Private *SiS_Pr, USHORT ModeNo);
-void     SiS_SetEnableDstn(SiS_Private *SiS_Pr);
-void     SiS_Delay15us(SiS_Private *SiS_Pr);
-BOOLEAN  SiS_SearchModeID(SiS_Private *SiS_Pr, UCHAR *ROMAddr, USHORT *ModeNo,USHORT *ModeIdIndex);
-BOOLEAN  SiS_CheckMemorySize(SiS_Private *SiS_Pr, UCHAR *ROMAddr,PSIS_HW_DEVICE_INFO HwDeviceExtension,
-                             USHORT ModeNo,USHORT ModeIdIndex);
-UCHAR    SiS_GetModePtr(SiS_Private *SiS_Pr, UCHAR *ROMAddr, USHORT ModeNo,USHORT ModeIdIndex);
-void     SiS_SetSeqRegs(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT StandTableIndex);
-void     SiS_SetMiscRegs(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT StandTableIndex);
-void     SiS_SetCRTCRegs(SiS_Private *SiS_Pr, UCHAR *ROMAddr,PSIS_HW_DEVICE_INFO HwDeviceExtension,
-                         USHORT StandTableIndex);
-void     SiS_SetATTRegs(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT StandTableIndex,
-                        PSIS_HW_DEVICE_INFO HwDeviceExtension);
-void     SiS_SetGRCRegs(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT StandTableIndex);
-void     SiS_ClearExt1Regs(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension);
-void     SiS_SetSync(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT RefreshRateTableIndex);
-void     SiS_SetCRT1CRTC(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
-                         USHORT RefreshRateTableIndex,
-			 PSIS_HW_DEVICE_INFO HwDeviceExtension);
-BOOLEAN  SiS_GetLCDACRT1Ptr(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
-                            USHORT RefreshRateTableIndex,USHORT *ResInfo,USHORT *DisplayType);
-void     SiS_ResetCRT1VCLK(SiS_Private *SiS_Pr, UCHAR *ROMAddr,PSIS_HW_DEVICE_INFO HwDeviceExtension);
-void     SiS_SetCRT1VCLK(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,PSIS_HW_DEVICE_INFO,
-                         USHORT RefreshRateTableIndex);
-void     SiS_SetVCLKState(SiS_Private *SiS_Pr, UCHAR *ROMAddr,PSIS_HW_DEVICE_INFO, USHORT ModeNo,
-                          USHORT RefreshRateTableIndex, USHORT ModeIdIndex);
-void     SiS_LoadDAC(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex);
-void     SiS_WriteDAC(SiS_Private *SiS_Pr, USHORT, USHORT, USHORT, USHORT, USHORT, USHORT);
-void     SiS_DisplayOn(SiS_Private *SiS_Pr);
-void 	 SiS_DisplayOff(SiS_Private *SiS_Pr);
-void     SiS_SetCRT1ModeRegs(SiS_Private *SiS_Pr, UCHAR *ROMAddr,PSIS_HW_DEVICE_INFO,USHORT ModeNo,
-                             USHORT ModeIdIndex,USHORT RefreshRateTableIndex);
-void     SiS_GetVBType(SiS_Private *SiS_Pr, USHORT BaseAddr,PSIS_HW_DEVICE_INFO);
-USHORT   SiS_ChkBUSWidth(SiS_Private *SiS_Pr, UCHAR *ROMAddr);
-USHORT   SiS_GetModeIDLength(SiS_Private *SiS_Pr, UCHAR *ROMAddr, USHORT);
-USHORT   SiS_GetRefindexLength(SiS_Private *SiS_Pr, UCHAR *ROMAddr, USHORT);
-void     SiS_SetInterlace(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT RefreshRateTableIndex);
-void     SiS_Set_LVDS_TRUMPION(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension);
-void     SiS_SetCRT1Offset(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT,USHORT,USHORT,PSIS_HW_DEVICE_INFO);
-#ifdef SIS315H
-void     SiS_SetCRT1FIFO_310(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT,USHORT,PSIS_HW_DEVICE_INFO);
+static const UCHAR SiS_HiTVGroup3Data[] = {
+        0x00,0x1a,0x22,0x63,0x62,0x22,0x08,0x5f,
+	0x05,0x21,0xb2,0xb2,0x55,0x77,0x2a,0xa6,
+	0x25,0x2f,0x47,0xfa,0xc8,0xff,0x8e,0x20,
+	0x8c,0x6e,0x60,0x2e,0x58,0x48,0x72,0x44,
+	0x56,0x36,0x4f,0x6e,0x3f,0x80,0x00,0x80,
+	0x4f,0x7f,0x03,0xa8,0x7d,0x20,0x1a,0xa9,
+	0x14,0x05,0x03,0x7e,0x64,0x31,0x14,0x75,
+	0x18,0x05,0x18,0x05,0x4c,0xa8,0x01
+};
+
+static const UCHAR SiS_HiTVGroup3Simu[] = {
+        0x00,0x1a,0x22,0x63,0x62,0x22,0x08,0x95,
+	0xdb,0x20,0xb8,0xb8,0x55,0x47,0x2a,0xa6,
+	0x25,0x2f,0x47,0xfa,0xc8,0xff,0x8e,0x20,
+	0x8c,0x6e,0x60,0x15,0x26,0xd3,0xe4,0x11,
+	0x56,0x36,0x4f,0x6e,0x3f,0x80,0x00,0x80,
+	0x67,0x36,0x01,0x47,0x0e,0x10,0xbe,0xb4,
+	0x01,0x05,0x03,0x7e,0x65,0x31,0x14,0x75,
+	0x18,0x05,0x18,0x05,0x4c,0xa8,0x01
+};
+
+#if 0
+static const UCHAR SiS_HiTVGroup3Text[] = {
+        0x00,0x1a,0x22,0x63,0x62,0x22,0x08,0xa7,
+	0xf5,0x20,0xce,0xce,0x55,0x47,0x2a,0xa6,
+	0x25,0x2f,0x47,0xfa,0xc8,0xff,0x8e,0x20,
+	0x8c,0x6e,0x60,0x18,0x2c,0x0c,0x20,0x22,
+	0x56,0x36,0x4f,0x6e,0x3f,0x80,0x00,0x80,
+	0x93,0x3c,0x01,0x50,0x2f,0x10,0xf4,0xca,
+	0x01,0x05,0x03,0x7e,0x65,0x31,0x14,0x75,
+	0x18,0x05,0x18,0x05,0x4c,0xa8,0x01
+};
 #endif
-#ifdef SIS300
-void     SiS_SetCRT1FIFO_300(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,PSIS_HW_DEVICE_INFO,
-                             USHORT RefreshRateTableIndex);
-void     SiS_SetCRT1FIFO_630(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,PSIS_HW_DEVICE_INFO,
-                             USHORT RefreshRateTableIndex);
-USHORT   SiS_CalcDelay(SiS_Private *SiS_Pr, UCHAR *ROMAddr, USHORT VCLK,
-                       USHORT colordepth, USHORT MCLK);
-USHORT   SiS_DoCalcDelay(SiS_Private *SiS_Pr, USHORT MCLK, USHORT VCLK, USHORT colordepth, USHORT key);
-USHORT   SiS_CalcDelay2(SiS_Private *SiS_Pr, UCHAR *ROMAddr, UCHAR,PSIS_HW_DEVICE_INFO HwDeviceExtension);
-#endif
-void     SiS_ClearBuffer(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO,USHORT ModeNo);
-void     SiS_SetCRT1Group(SiS_Private *SiS_Pr, UCHAR *ROMAddr,PSIS_HW_DEVICE_INFO HwDeviceExtension,
-                          USHORT ModeNo,USHORT ModeIdIndex,USHORT BaseAddr);
-void     SiS_DetectMonitor(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT BaseAddr);
-void     SiS_GetSenseStatus(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,UCHAR *ROMAddr);
-USHORT   SiS_TestMonitorType(SiS_Private *SiS_Pr, UCHAR R_DAC,UCHAR G_DAC,UCHAR B_DAC);
-USHORT   SiS_SenseCHTV(SiS_Private *SiS_Pr);
-BOOLEAN  SiS_Sense(SiS_Private *SiS_Pr, USHORT tempbx,USHORT tempcx);
-BOOLEAN  SiS_GetPanelID(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO);
-BOOLEAN  SiS_GetLCDDDCInfo(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO);
-USHORT   SiS_SenseLCD(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO);
-void     SiSRegInit(SiS_Private *SiS_Pr, USHORT BaseAddr);
-void     SiSInitPtr(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension);
-void     SiSSetLVDSetc(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT ModeNo);
-void     SiSInitPCIetc(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension);
-void     SiSDetermineROMUsage(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, UCHAR *ROMAddr);
 
-#ifdef LINUX_XF86
-USHORT 		SiS_CheckBuildCustomMode(ScrnInfoPtr pScrn, DisplayModePtr mode, int VBFlags);
-void    	SiS_SetPitch(SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, UShort BaseAddr);
-void    	SiS_SetPitchCRT1(SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, UShort BaseAddr);
-void    	SiS_SetPitchCRT2(SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, UShort BaseAddr);
-extern int      SiS_compute_vclk(int Clock, int *out_n, int *out_dn, int *out_div,
-	     	 		    int *out_sbit, int *out_scale);
-extern unsigned char SiS_GetSetBIOSScratch(ScrnInfoPtr pScrn, USHORT offset, unsigned char value);
-extern unsigned char SiS_GetSetModeID(ScrnInfoPtr pScrn, unsigned char id);
-extern USHORT 	     SiS_CalcModeIndex(ScrnInfoPtr pScrn, DisplayModePtr mode);
+static const UCHAR SiS_NTSCPhase[]    = {0x21,0xed,0xba,0x08};
+static const UCHAR SiS_PALPhase[]     = {0x2a,0x05,0xe3,0x00};
+static const UCHAR SiS_PALMPhase[]    = {0x21,0xE4,0x2E,0x9B};
+static const UCHAR SiS_PALNPhase[]    = {0x21,0xF4,0x3E,0xBA};
+static const UCHAR SiS_NTSCPhase2[]   = {0x21,0xF0,0x7B,0xD6};
+static const UCHAR SiS_PALPhase2[]    = {0x2a,0x09,0x86,0xe9};
+static const UCHAR SiS_PALMPhase2[]   = {0x21,0xE6,0xEF,0xA4};
+static const UCHAR SiS_PALNPhase2[]   = {0x21,0xF6,0x94,0x46};
+static const UCHAR SiS_SpecialPhase[] = {0x1e,0x8c,0x5c,0x7a};
+static const UCHAR SiS_SpecialPhaseM[]= {0x1e,0x83,0x0a,0xe0};
+static const UCHAR SiS_SpecialPhaseJ[]= {0x25,0xd4,0xfd,0x5e};
+
+static const SiS_TVDataStruct  SiS_StPALData[] =
+{
+ {    1,   1, 864, 525,1270, 400, 100,   0, 760,0xf4,0xff,0x1c,0x22},
+ {    1,   1, 864, 525,1270, 350, 100,   0, 760,0xf4,0xff,0x1c,0x22},
+ {    1,   1, 864, 525,1270, 400,   0,   0, 720,0xf1,0x04,0x1f,0x18},
+ {    1,   1, 864, 525,1270, 350,   0,   0, 720,0xf4,0x0b,0x1c,0x0a},
+ {    1,   1, 864, 525,1270, 480,  50,   0, 760,0xf4,0xff,0x1c,0x22},
+ {    1,   1, 864, 525,1270, 600,  50,   0,   0,0xf4,0xff,0x1c,0x22}
+};
+
+static const SiS_TVDataStruct  SiS_ExtPALData[] =
+{
+ {   27,  10, 848, 448,1270, 530,  50,   0,  50,0xf4,0xff,0x1c,0x22},  /* 640x400, 320x200 */
+ {  108,  35, 848, 398,1270, 530,  50,   0,  50,0xf4,0xff,0x1c,0x22},
+ {   12,   5, 954, 448,1270, 530,  50,   0,  50,0xf1,0x04,0x1f,0x18},
+ {    9,   4, 960, 463,1644, 438,  50,   0,  50,0xf4,0x0b,0x1c,0x0a},
+ {    9,   4, 848, 528,1270, 530,   0,   0,  50,0xf5,0xfb,0x1b,0x2a},  /* 640x480, 320x240 */
+/*{  36,  25,1060, 648,1316, 530, 438,   0, 438,0xeb,0x05,0x25,0x16},*//* 800x600, 400x300 */
+ {   36,  25,1060, 648,1270, 530, 438,   0, 438,0xeb,0x05,0x25,0x16},  /* 800x600, 400x300 - better */
+ {    3,   2,1080, 619,1270, 540, 438,   0, 438,0xf3,0x00,0x1d,0x20},  /* 720x576 */
+ {    1,   1,1170, 821,1270, 520, 686,   0, 686,0xF3,0x00,0x1D,0x20},  /* 1024x768 */
+ {    1,   1,1170, 821,1270, 520, 686,   0, 686,0xF3,0x00,0x1D,0x20}   /* 1024x768 (for NTSC equ) */
+};
+
+static const SiS_TVDataStruct  SiS_StNTSCData[] =
+{
+ {    1,   1, 858, 525,1270, 400,  50,   0, 760,0xf1,0x04,0x1f,0x18},
+ {    1,   1, 858, 525,1270, 350,  50,   0, 640,0xf1,0x04,0x1f,0x18},
+ {    1,   1, 858, 525,1270, 400,   0,   0, 720,0xf1,0x04,0x1f,0x18},
+ {    1,   1, 858, 525,1270, 350,   0,   0, 720,0xf4,0x0b,0x1c,0x0a},
+ {    1,   1, 858, 525,1270, 480,   0,   0, 760,0xf1,0x04,0x1f,0x18}
+};
+
+static const SiS_TVDataStruct  SiS_ExtNTSCData[] =
+{
+ {  143,  65, 858, 443,1270, 440, 171,   0, 171,0xf1,0x04,0x1f,0x18},    /* 640x400, 320x200 */
+ {   88,  35, 858, 393,1270, 440, 171,   0, 171,0xf1,0x04,0x1f,0x18},
+ {  143,  70, 924, 443,1270, 440,  92,   0,  92,0xf1,0x04,0x1f,0x18},
+ {  143,  70, 924, 393,1270, 440,  92,   0,  92,0xf4,0x0b,0x1c,0x0a},
+ {  143,  76, 836, 523,1270, 440, 224,   0,   0,0xf1,0x05,0x1f,0x16},    /* 640x480, 320x240 */
+ {  143, 120,1056, 643,1270, 440,   0, 128,   0,0xf4,0x10,0x1c,0x00},    /* 800x600, 400x300  */
+/*{   2,   1, 858, 503,1270, 480,   0, 128,   0,0xee,0x0c,0x22,0x08},*/  /* 720x480  (old, from 650) */
+ {  143,  76, 836, 523,1270, 440,   0, 128,   0,0xee,0x0c,0x22,0x08},    /* 720x480 - BETTER (from 300 series) */
+/*{  65,  64,1056, 791,1270, 480, 638,   0,   0,0xEE,0x0C,0x22,0x08} */  /* 1024x768 (525i) */
+ {    1,   1,1100, 811,1412, 440,   0, 128,   0,0xee,0x0c,0x22,0x08},    /* 1024x768 (525i) CORRECTED */
+ {   65,  64,1056, 791,1270, 480, 455,   0,   0,0x00,0x00,0x00,0x00}     /* 1024x768 (525p) */
+};
+
+static const SiS_TVDataStruct  SiS_StHiTVData[] =  /* Slave + TVSimu */
+{
+ {    1,   1, 0x37c,0x233,0x2b2,0x320,    0,  0, 0, 0x00,0x00,0x00,0x00},
+ {    1,   1, 0x37c,0x233,0x2b2,0x2bc,    0,  0, 0, 0x00,0x00,0x00,0x00},
+ {    1,   1, 0x37c,0x233,0x2b2,0x320,    0,  0, 0, 0x00,0x00,0x00,0x00},
+ {    1,   1, 0x37c,0x233,0x2b2,0x2bc,    0,  0, 0, 0x00,0x00,0x00,0x00},
+ {    1,   1, 0x37c,0x233,0x2b2,0x3c0,    0,  0, 0, 0x00,0x00,0x00,0x00},
+ {    8,   5, 0x41a,0x2ab,0x670,0x3c0,0x150,128, 0, 0x00,0x00,0x00,0x00}
+};
+
+static const SiS_TVDataStruct  SiS_St2HiTVData[] = /* Slave */
+{
+ {    3,   1, 0x348,0x1e3,0x670,0x3c0,0x032,  0, 0, 0x00,0x00,0x00,0x00},
+ {    1,   1, 0x37c,0x233,0x2b2,0x2bc, 	  0,  0, 0, 0x00,0x00,0x00,0x00},
+ {    3,   1, 0x348,0x1e3,0x670,0x3c0,0x032,  0, 0, 0x00,0x00,0x00,0x00},
+ {    1,   1, 0x37c,0x233,0x2b2,0x2bc,    0,  0, 0, 0x00,0x00,0x00,0x00},
+ {    5,   2, 0x348,0x233,0x670,0x3c0,0x08d,128, 0, 0x00,0x00,0x00,0x00},
+ {    8,   5, 0x41a,0x2ab,0x670,0x3c0,0x17c,128, 0, 0x00,0x00,0x00,0x00}
+};
+
+static const SiS_TVDataStruct  SiS_ExtHiTVData[] =
+{
+ {    6,   1, 0x348,0x233,0x660,0x3c0,    0,  0, 0, 0x00,0x00,0x00,0x00},
+ {    3,   1, 0x3c0,0x233,0x660,0x3c0,    0,  0, 0, 0x00,0x00,0x00,0x00},
+ {    6,   1, 0x348,0x233,0x660,0x3c0,    0,  0, 0, 0x00,0x00,0x00,0x00},
+ {    3,   1, 0x3c0,0x233,0x660,0x3c0,    0,  0, 0, 0x00,0x00,0x00,0x00},
+ {    5,   1, 0x348,0x233,0x670,0x3c0,0x166,128, 0, 0x00,0x00,0x00,0x00},  /* 640x480   */
+ {   16,   5, 0x41a,0x2ab,0x670,0x3c0,0x143,128, 0, 0x00,0x00,0x00,0x00},  /* 800x600   */
+ {   25,  12, 0x4ec,0x353,0x670,0x3c0,0x032,  0, 0, 0x00,0x00,0x00,0x00},  /* 1024x768  */
+ {    5,   4, 0x627,0x464,0x670,0x3c0,0x128,  0, 0, 0x00,0x00,0x00,0x00},  /* 1280x1024 */
+ {    4,   1, 0x41a,0x233,0x60c,0x3c0,0x143,128, 0, 0x00,0x00,0x00,0x00},  /* 800x480   */
+ {    5,   2, 0x578,0x293,0x670,0x3c0,0x032,  0, 0, 0x00,0x00,0x00,0x00},  /* 1024x576  */
+ {    8,   5, 0x6d6,0x323,0x670,0x3c0,0x128,  0, 0, 0x00,0x00,0x00,0x00}   /* 1280x720  */
+};
+
+static const SiS_TVDataStruct  SiS_St525pData[] =
+{
+ {    1,   1, 0x6b4,0x20d,0x4f6,0x190,   50,  0, 0x2f8, 0x00,0x00,0x00,0x00},
+ {    1,   1, 0x6b4,0x20d,0x4f6,0x15e,   50,  0, 0x280, 0x00,0x00,0x00,0x00},
+ {    1,   1, 0x6b4,0x20d,0x4f6,0x190,   50,  0, 0x2f8, 0x00,0x00,0x00,0x00},
+ {    1,   1, 0x6b4,0x20d,0x4f6,0x15e,   50,  0, 0x280, 0x00,0x00,0x00,0x00},
+ {    1,   1, 0x6b4,0x20d,0x4f6,0x1e0,    0,  0, 0x2f8, 0x00,0x00,0x00,0x00}
+};
+
+static const SiS_TVDataStruct  SiS_St750pData[] =
+{
+ {    1,   1, 0x672,0x2ee,0x500,0x190,   50,  0, 0x2f8, 0x00,0x00,0x00,0x00},
+ {    1,   1, 0x672,0x2ee,0x500,0x15e,   50,  0, 0x280, 0x00,0x00,0x00,0x00},
+ {    1,   1, 0x672,0x2ee,0x500,0x190,    0,  0, 0x2d0, 0x00,0x00,0x00,0x00},
+ {    1,   1, 0x672,0x2ee,0x500,0x15e,    0,  0, 0x2d0, 0x00,0x00,0x00,0x00},
+ {    1,   1, 0x672,0x2ee,0x500,0x1e0,    0,  0, 0x2f8, 0x00,0x00,0x00,0x00}
+};
+
+static const SiS_TVDataStruct  SiS_Ext750pData[] =
+{
+ {    3,   1, 0x3a7,0x1d6,0x500,0x2a8,   50,  0,     0, 0x00,0x00,0x00,0x00},
+ {   24,   7, 0x3a7,0x1a4,0x500,0x2a8,   50,  0,     0, 0x00,0x00,0x00,0x00},
+ {    3,   1, 0x3a7,0x1d6,0x500,0x2a8,   50,  0,     0, 0x00,0x00,0x00,0x00},
+ {   24,   7, 0x3a7,0x1a4,0x500,0x2a8,   50,  0,     0, 0x00,0x00,0x00,0x00},
+ {   99,  32, 0x320,0x1fe,0x500,0x2d0,   50,  0,     0, 0x00,0x00,0x00,0x00},  /* 640x480   */
+ {    5,   4, 0x5d8,0x29e,0x500,0x2a8,   50,  0,     0, 0x00,0x00,0x00,0x00},  /* 800x600   */
+ {    2,   1, 0x35a,0x1f7,0x4f6,0x1e0,    0,128,     0, 0x00,0x00,0x00,0x00},  /* 720x480   */
+ {   68,  64, 0x55f,0x346,0x500,0x2a8,0x27e,  0,     0, 0x00,0x00,0x00,0x00},  /* 1024x768  */
+};
+
+static const SiS_LCDDataStruct  SiS_LCD1280x960Data[] =
+{
+	{    9,   2, 800, 500,1800,1000},
+	{    9,   2, 800, 500,1800,1000},
+	{    4,   1, 900, 500,1800,1000},
+	{    4,   1, 900, 500,1800,1000},
+	{    9,   2, 800, 500,1800,1000},
+	{   30,  11,1056, 625,1800,1000},
+	{    5,   3,1350, 800,1800,1000},
+	{    1,   1,1576,1050,1576,1050},
+	{    1,   1,1800,1000,1800,1000}
+};
+
+/* 1280x768 panel data from Fujitsu 7911 (VL-17WDX8).
+ * Other 1280x768 panels (with clock != 81000, HTxVT != 1688x802)
+ * will be treated as custom panels.
+ */
+
+static const SiS_LCDDataStruct  SiS_StLCD1280x768Data[] =
+{
+	{ 211,  100, 2100,  408, 1688,  802 }, /* These values are *wrong* */
+	{ 211,   64, 1536,  358, 1688,  802 }, /* (which is why they aren't used yet) */
+	{ 211,  100, 2100,  408, 1688,  802 },
+	{ 211,   64, 1536,  358, 1688,  802 },
+	{ 211,   48,  840,  488, 1688,  802 },
+	{ 211,   72, 1008,  609, 1688,  802 },
+	{ 211,  128, 1400,  776, 1688,  802 },
+	{ 211,  205, 1680, 1041, 1688,  802 },
+	{ 1,      1, 1688,  802, 1688,  802 }  /* That's the only one that is correct */
+};
+
+static const SiS_LCDDataStruct  SiS_ExtLCD1280x768Data[] =
+{
+	{ 211,  100, 2100,  408, 1688,  802 }, /* These values are *wrong* */
+	{ 211,   64, 1536,  358, 1688,  802 }, /* (which is why they aren't used yet) */
+	{ 211,  100, 2100,  408, 1688,  802 },
+	{ 211,   64, 1536,  358, 1688,  802 },
+	{ 211,   48,  840,  488, 1688,  802 },
+	{ 211,   72, 1008,  609, 1688,  802 },
+	{ 211,  128, 1400,  776, 1688,  802 },
+	{ 211,  205, 1680, 1041, 1688,  802 },
+	{ 1,      1, 1688,  802, 1688,  802 }  /* That's the only one that is correct */
+};
+
+static const SiS_LCDDataStruct  SiS_NoScaleData1280x768[] =
+{
+        { 1, 1, 1688,  802, 1688,  802},
+	{ 1, 1, 1688,  802, 1688,  802},
+	{ 1, 1, 1688,  802, 1688,  802},
+	{ 1, 1, 1688,  802, 1688,  802},
+	{ 1, 1, 1688,  802, 1688,  802},
+	{ 1, 1, 1688,  802, 1688,  802},
+	{ 1, 1, 1688,  802, 1688,  802},
+	{ 1, 1, 1688,  802, 1688,  802},
+	{ 1, 1, 1688,  802, 1688,  802}
+};
+
+static const SiS_LCDDataStruct  SiS_StLCD1400x1050Data[] =
+{
+	{ 211,  100, 2100,  408, 1688, 1066 },
+	{ 211,   64, 1536,  358, 1688, 1066 },
+	{ 211,  100, 2100,  408, 1688, 1066 },
+	{ 211,   64, 1536,  358, 1688, 1066 },
+	{ 211,   48,  840,  488, 1688, 1066 },
+	{ 211,   72, 1008,  609, 1688, 1066 },
+	{ 211,  128, 1400,  776, 1688, 1066 },
+	{ 211,  205, 1680, 1041, 1688, 1066 },
+	{   1,    1, 1688, 1066, 1688, 1066 }
+};
+
+static const SiS_LCDDataStruct  SiS_ExtLCD1400x1050Data[] =
+{
+	{ 211,  100, 2100,  408, 1688, 1066 },
+	{ 211,   64, 1536,  358, 1688, 1066 },
+	{ 211,  100, 2100,  408, 1688, 1066 },
+	{ 211,   64, 1536,  358, 1688, 1066 },
+	{ 211,   48,  840,  488, 1688, 1066 },
+	{ 211,   72, 1008,  609, 1688, 1066 },
+	{ 211,  128, 1400,  776, 1688, 1066 },
+	{ 211,  205, 1680, 1041, 1688, 1066 },
+	{   1,    1, 1688, 1066, 1688, 1066 }
+};
+
+static const SiS_LCDDataStruct  SiS_NoScaleData1400x1050[] =
+{
+	{ 1, 1, 1688, 1066, 1688, 1066 },
+	{ 1, 1, 1688, 1066, 1688, 1066 },
+	{ 1, 1, 1688, 1066, 1688, 1066 },
+	{ 1, 1, 1688, 1066, 1688, 1066 },
+	{ 1, 1, 1688, 1066, 1688, 1066 },
+	{ 1, 1, 1688, 1066, 1688, 1066 },
+	{ 1, 1, 1688, 1066, 1688, 1066 },
+	{ 1, 1, 1688, 1066, 1688, 1066 },
+	{ 1, 1, 1688, 1066, 1688, 1066 }
+};
+
+static const SiS_LCDDataStruct  SiS_StLCD1600x1200Data[] =
+{
+	{27,  4, 800, 500, 2160, 1250 },
+	{27,  4, 800, 500, 2160, 1250 },
+	{ 6,  1, 900, 500, 2160, 1250 },
+	{ 6,  1, 900, 500, 2160, 1250 },
+	{27,  1, 800, 500, 2160, 1250 },
+	{ 4,  1,1080, 625, 2160, 1250 },
+	{ 5,  2,1350, 800, 2160, 1250 },
+	{135,88,1600,1100, 2160, 1250 },
+	{135,88,1600,1100, 2160, 1250 },
+	{ 1,  1,2160,1250, 2160, 1250 }
+};
+
+static const SiS_LCDDataStruct  SiS_ExtLCD1600x1200Data[] =
+{
+	{27, 4, 800, 500, 2160, 1250 },
+	{27, 4, 800, 500, 2160, 1250 },
+	{ 6, 1, 900, 500, 2160, 1250 },
+	{ 6, 1, 900, 500, 2160, 1250 },
+	{27, 1, 800, 500, 2160, 1250 },
+	{ 4, 1,1080, 625, 2160, 1250 },
+	{ 5, 2,1350, 800, 2160, 1250 },
+	{27,16,1500,1064, 2160, 1250 },
+	{27,16,1500,1064, 2160, 1250 },
+	{ 1, 1,2160,1250, 2160, 1250 }
+};
+
+static const SiS_LCDDataStruct  SiS_NoScaleData1600x1200[] =
+{
+        {1,  1, 2160, 1250, 2048, 1250},
+	{1,  1, 2160, 1250, 2048, 1250},
+	{1,  1, 2160, 1250, 2048, 1250},
+	{1,  1, 2160, 1250, 2048, 1250},
+	{1,  1, 2160, 1250, 2048, 1250},
+	{1,  1, 2160, 1250, 2048, 1250},
+	{1,  1, 2160, 1250, 2048, 1250},
+	{1,  1, 2160, 1250, 2048, 1250},
+	{1,  1, 2160, 1250, 2048, 1250},
+	{1,  1, 2160, 1250, 2048, 1250},
+};
+
+static const SiS_LCDDataStruct  SiS_NoScaleData[] =
+{
+	{ 1, 1, 800, 449, 800, 449 },
+	{ 1, 1, 800, 449, 800, 449 },
+	{ 1, 1, 900, 449, 900, 449 },
+	{ 1, 1, 900, 449, 900, 449 },
+	{ 1, 1, 800, 525, 800, 525 },
+	{ 1, 1,1056, 628,1056, 628 },
+	{ 1, 1,1344, 806,1344, 806 },
+	{ 1, 1,1688,1066,1688,1066 },
+        { 1, 1,1688, 802,1688, 802 },  /* 1280x768: 802 was 806 in both cases */
+        { 1, 1,2160,1250,2160,1250 },  /* 1600x1200 */
+	{ 1, 1,1800,1000,1800,1000 }   /* 1280x960 */
+};
+
+/* *** LCDA *** */
+
+static const SiS_LVDSDataStruct  SiS_LCDA1024x768Data_1[]=
+{
+	{  960, 438,1344, 806},
+	{  960, 388,1344, 806},
+	{ 1040, 438,1344, 806},
+	{ 1040, 388,1344, 806},
+	{  960, 518,1344, 806},   /* 640x480 */
+	{ 1120, 638,1344, 806},   /* 800x600 */
+	{ 1344, 806,1344, 806},   /* 1024x768 */
+#if 0
+	{ 840, 438,1344, 806},
+	{ 840, 409,1344, 806},
+	{ 840, 438,1344, 806},
+	{ 840, 409,1344, 806},
+	{ 840, 518,1344, 806},   /* 640x480 */
+	{1050, 638,1344, 806},   /* 800x600 */
+	{1344, 806,1344, 806},   /* 1024x768 */
 #endif
+};
 
-extern USHORT    SiS_GetOffset(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
-                       USHORT RefreshRateTableIndex,PSIS_HW_DEVICE_INFO HwDeviceExtension);
-extern USHORT    SiS_GetColorDepth(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex);
-extern void      SiS_DisableBridge(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
-extern BOOLEAN   SiS_SetCRT2Group301(SiS_Private *SiS_Pr, USHORT BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,
-                                     PSIS_HW_DEVICE_INFO HwDeviceExtension);
-extern void      SiS_PresetScratchregister(SiS_Private *SiS_Pr, USHORT SiS_P3d4,
-                                           PSIS_HW_DEVICE_INFO HwDeviceExtension);
-extern void      SiS_UnLockCRT2(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT BaseAddr);
-extern void      SiS_LockCRT2(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT BaseAddr);
-extern BOOLEAN   SiS_BridgeIsOn(SiS_Private *SiS_Pr, USHORT BaseAddr);
-extern BOOLEAN   SiS_BridgeIsEnable(SiS_Private *SiS_Pr, USHORT BaseAddr,PSIS_HW_DEVICE_INFO );
-extern void      SiS_GetVBInfo(SiS_Private *SiS_Pr, USHORT BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,
-                               USHORT ModeIdIndex,PSIS_HW_DEVICE_INFO HwDeviceExtension, int chkcrt2mode);
-extern BOOLEAN   SiS_GetLCDResInfo(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,
-                                   USHORT ModeIdIndex, PSIS_HW_DEVICE_INFO HwDeviceExtension);
-extern void      SiS_SetHiVision(SiS_Private *SiS_Pr, USHORT BaseAddr,PSIS_HW_DEVICE_INFO HwDeviceExtension);
-extern USHORT    SiS_GetRatePtrCRT2(SiS_Private *SiS_Pr, UCHAR *ROMAddr, USHORT ModeNo,USHORT ModeIdIndex,
-                                    PSIS_HW_DEVICE_INFO HwDeviceExtension);
-extern void      SiS_WhatIsThis(SiS_Private *SiS_Pr, USHORT myvbinfo);
-extern void      SiS_LongWait(SiS_Private *SiS_Pr);
-extern void      SiS_SetRegOR(USHORT Port,USHORT Index,USHORT DataOR);
-extern void      SiS_SetRegAND(USHORT Port,USHORT Index,USHORT DataAND);
-extern void      SiS_SetRegANDOR(USHORT Port,USHORT Index,USHORT DataAND,USHORT DataOR);
-extern USHORT    SiS_GetResInfo(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex);
-extern void      SiS_SetCH700x(SiS_Private *SiS_Pr, USHORT tempax);
-extern USHORT    SiS_GetCH700x(SiS_Private *SiS_Pr, USHORT tempax);
-extern void      SiS_SetCH701x(SiS_Private *SiS_Pr, USHORT tempax);
-extern USHORT    SiS_GetCH701x(SiS_Private *SiS_Pr, USHORT tempax);
-extern void      SiS_SetCH70xx(SiS_Private *SiS_Pr, USHORT tempax);
-extern USHORT    SiS_GetCH70xx(SiS_Private *SiS_Pr, USHORT tempax);
-extern BOOLEAN   SiS_GetLVDSCRT1Ptr(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
-                                    USHORT RefreshRateTableIndex,
-		                    USHORT *ResInfo,USHORT *DisplayType);
-extern USHORT    SiS_GetVCLK2Ptr(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
-                                 USHORT RefreshRateTableIndex,
-				 PSIS_HW_DEVICE_INFO HwDeviceExtension);
-extern BOOLEAN   SiS_Is301B(SiS_Private *SiS_Pr, USHORT BaseAddr);
-extern BOOLEAN   SiS_IsM650(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
-extern BOOLEAN   SiS_LowModeStuff(SiS_Private *SiS_Pr, USHORT ModeNo,PSIS_HW_DEVICE_INFO HwDeviceExtension);
-extern BOOLEAN   SiS_IsVAMode(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
-extern BOOLEAN   SiS_IsDualEdge(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
-extern USHORT    SiS_GetMCLK(SiS_Private *SiS_Pr, UCHAR *ROMAddr, PSIS_HW_DEVICE_INFO HwDeviceExtension);
+static const SiS_LVDSDataStruct  SiS_LCDA1024x768Data_2[]=
+{
+	{1344, 806,1344, 806},
+	{1344, 806,1344, 806},
+	{1344, 806,1344, 806},
+	{1344, 806,1344, 806},
+	{1344, 806,1344, 806},
+	{1344, 806,1344, 806},
+	{1344, 806,1344, 806},
+};
+
+static const SiS_LVDSDataStruct  SiS_LCDA1280x1024Data_1[]=
+{ /* Acer, Compaq */
+	{1048, 442,1688,1066},
+	{1048, 392,1688,1066},
+	{1128, 442,1688,1066},
+	{1128, 392,1688,1066},
+	{1048, 522,1688,1066},
+	{1208, 642,1688,1066},
+	{1432, 810,1688,1066},
+	{1688,1066,1688,1066}
+};
+
+static const SiS_LVDSDataStruct  SiS_LCDA1280x1024Data_2[]=
+{ /* Corrected (illegal in Acer, correct in Compaq) */
+	{1688,1066,1688,1066},
+	{1688,1066,1688,1066},
+	{1688,1066,1688,1066},
+	{1688,1066,1688,1066},
+	{1688,1066,1688,1066},
+	{1688,1066,1688,1066},
+	{1688,1066,1688,1066},
+	{1688,1066,1688,1066}
+};
+
+static const SiS_LVDSDataStruct  SiS_LCDA1400x1050Data_1[]=
+{ /* Clevo */
+        { 928, 416, 1688,1066},
+	{ 928, 366, 1688,1066},
+	{1008, 416, 1688,1066},
+	{1008, 366, 1688,1066},
+	{1200, 530, 1688,1066},
+	{1088, 616, 1688,1066},
+	{1312, 784, 1688,1066},
+	{1568,1040, 1688,1066},
+	{1688,1066, 1688,1066}
+};
+
+static const SiS_LVDSDataStruct  SiS_LCDA1400x1050Data_2[]=
+{ /* Clevo */
+    	{1688,1066, 1688,1066},
+	{1688,1066, 1688,1066},
+	{1688,1066, 1688,1066},
+	{1688,1066, 1688,1066},
+	{1688,1066, 1688,1066},
+	{1688,1066, 1688,1066},
+	{1688,1066, 1688,1066},
+	{1688,1066, 1688,1066},
+	{1688,1066, 1688,1066}
+};
+
+static const SiS_LVDSDataStruct  SiS_LCDA1600x1200Data_1[]=
+{ /* Clevo (Temporary data)  */
+	{1200, 450, 2048,1250},
+	{1200, 400, 2048,1250},
+	{1280, 450, 2048,1250},
+	{1280, 400, 2048,1250},
+	{1200, 530, 2048,1250},
+	{1360, 650, 2048,1250},
+	{1584, 818, 2048,1250},
+	{1688,1066, 2048,1250},
+	{1688,1066, 2048,1250},
+	{2048,1250, 2048,1250}   /* this should be correct */
+#if 0
+	{2160,1250, 2048,1250}   /* ? */
+#endif
+};
+
+static const SiS_LVDSDataStruct  SiS_LCDA1600x1200Data_2[]=
+{ /* Clevo (Temporary data. Seems invalid.) */
+	{2160,1250, 2160,1250},
+	{2160,1250, 2160,1250},
+	{2160,1250, 2160,1250},
+	{2160,1250, 2160,1250},
+	{2160,1250, 2160,1250},
+	{2160,1250, 2160,1250},
+	{2160,1250, 2160,1250},
+	{2160,1250, 2160,1250},
+	{2160,1250, 2160,1250},
+	{2160,1250, 2160,1250}
+};
+
+/* LVDS SKEW for LCDA */
+
+static const SiS_LVDSDesStruct SiS_PanelType1076_1[]=
+{  /* 1024x768 */
+	{ 0 , 0},
+	{ 0 , 0},
+	{ 0 , 0},
+	{ 0 , 0},
+	{ 0 , 0},
+	{ 0 , 0},
+	{ 0 , 0},   /* 805; was 0, 0 -> top line cut away (26/09/03) */
+};
+
+static const SiS_LVDSDesStruct SiS_PanelType1076_2[]=
+{  /* 1024x768; not expanded */
+	{ 1184, 622 },
+	{ 1184, 597 },
+	{ 1184, 622 },
+	{ 1184, 597 },
+	{ 1152, 650 },  /* 622 */
+	{ 1232, 722 },
+	{    0, 0   },  /* 805; was 0, 0 -> top line cut away (26/09/03) */
+};
+
+static const SiS_LVDSDesStruct SiS_PanelType1210_1[]=
+{  /* 1280x1024 */
+	{ 0 ,    0},
+	{ 0 ,    0},
+	{ 0 ,    0},
+	{ 0 ,    0},
+	{ 0 ,    0},
+	{ 0 ,    0},
+	{ 0 ,    0},
+	{ 0 , 1065},  /* Acer */
+	{ 0 ,    0}
+};
+
+static const SiS_LVDSDesStruct SiS_PanelType1210_2[]=
+{  /* 1280x1024; not expanded */
+	{ 0 , 0},
+	{ 0 , 0},
+	{ 0 , 0},
+	{ 0 , 0},
+	{ 0 , 0},
+	{ 0 , 0},
+	{ 0 , 0},
+	{ 0 , 0},
+	{ 0 , 0}
+};
+
+static const SiS_LVDSDesStruct SiS_PanelType1296_1[]=
+{  /* 1400x1050 */
+	{ 0 , 0},
+	{ 0 , 0},
+	{ 0 , 0},
+	{ 0 , 0},
+	{ 0 , 0},
+	{ 0 , 0},
+	{ 0 , 0},
+	{ 0 , 0},
+	{ 0 , 1065}   /* Was 0,0 */
+};
+
+static const SiS_LVDSDesStruct SiS_PanelType1296_2[]=
+{  /* 1400x1050; not expanded */
+	{ 1308, 741 },
+	{ 1308, 716 },
+	{ 1308, 741 },
+	{ 1308, 716 },
+	{ 1308, 781 },
+	{ 1388, 841 },
+	{ 1500, 925 },
+	{ 1628,1053 },
+	{    0,1065 }
+#if 0
+	{ 808 , 740},
+	{ 0   , 715},
+	{ 632 , 740},
+	{ 632 , 715},
+	{ 1307, 780},
+	{ 1387,1157},
+	{ 1499, 924},
+	{ 1627,1052},
+	{ 0 , 0}
+#endif
+};
+
+static const SiS_LVDSDesStruct SiS_PanelType1600_1[]=
+{  /* 1600x1200 */
+	{ 0 , 0},
+	{ 0 , 0},
+	{ 0 , 0},
+	{ 0 , 0},
+	{ 0 , 0},
+	{ 0 , 0},
+	{ 0 , 0},
+	{ 0 , 0},
+	{ 0 , 0},
+	{ 0 , 0}
+};
 
+static const SiS_LVDSDesStruct SiS_PanelType1600_2[]=
+{  /* 1600x1200; not expanded */
+	{ 0 , 0},
+	{ 0 , 0},
+	{ 0 , 0},
+	{ 0 , 0},
+	{ 0 , 0},
+	{ 0 , 0},
+	{ 0 , 0},
+	{ 0 , 0},
+	{ 0 , 0},
+	{ 0 , 0}
+};
+
+#ifdef SIS315H
+
+/* LCDA CRT1 custom data */
+
+static const SiS_LCDACRT1DataStruct  Compaq1280x1024_LCDACRT1_1[]=
+{
+ {{0x7e,0x4f,0x4f,0x82,0x58,0x06,0xb8,0x1f,
+   0x90,0x84,0x8f,0x8f,0xb9,0x30,0x00,0x06,
+   0x00}},
+ {{0x7e,0x4f,0x4f,0x82,0x58,0x06,0x86,0x1f,
+   0x5e,0x82,0x5d,0x5d,0x87,0x10,0x00,0x06,
+   0x00}},
+ {{0x7e,0x4f,0x4f,0x82,0x58,0x06,0xb8,0x1f,
+   0x90,0x84,0x8f,0x8f,0xb9,0x30,0x00,0x06,
+   0x00}},
+ {{0x7e,0x4f,0x4f,0x82,0x58,0x06,0x86,0x1f,
+   0x5e,0x82,0x5d,0x5d,0x87,0x10,0x00,0x06,
+   0x00}},
+ {{0x7e,0x4f,0x4f,0x82,0x58,0x06,0x08,0x3e,
+   0xe0,0x84,0xdf,0xdf,0x09,0x00,0x00,0x06,
+   0x00}},
+ {{0x92,0x63,0x63,0x96,0x6c,0x1a,0x80,0xf0,
+   0x58,0x8c,0x57,0x57,0x81,0x20,0x00,0x06,
+   0x01}},
+ {{0xae,0x7f,0x7f,0x92,0x88,0x96,0x28,0xf5,
+   0x00,0x84,0xff,0xff,0x29,0x10,0x00,0x02,
+   0x01}},
+ {{0xce,0x9f,0x9f,0x92,0xa8,0x16,0x28,0x5a,
+   0x00,0x84,0xff,0xff,0x29,0x01,0x00,0x07,
+   0x01}}
+};
+
+static const SiS_LCDACRT1DataStruct  Compaq1280x1024_LCDACRT1_1_H[]=
+{
+ {{0x56,0x27,0x27,0x9a,0x30,0x1e,0xb8,0x1f,
+   0x90,0x84,0x8f,0x8f,0xb9,0x30,0x00,0x05,
+   0x00}},
+ {{0x3c,0x4f,0x4f,0x82,0x58,0x06,0x86,0xd1,
+   0xbc,0x80,0xbb,0xbb,0xe5,0x00,0x00,0x06,
+   0x01}},
+ {{0x56,0x27,0x27,0x9a,0x30,0x1e,0xb8,0x1f,
+   0x90,0x84,0x8f,0x8f,0xb9,0x30,0x00,0x05,
+   0x00}},
+ {{0x3c,0x4f,0x4f,0x82,0x58,0x06,0x86,0xd1,
+   0xbc,0x80,0xbb,0xbb,0xe5,0x00,0x00,0x06,
+   0x01}},
+ {{0x56,0x27,0x27,0x9a,0x30,0x1e,0x08,0x3e,
+   0xe0,0x84,0xdf,0xdf,0x09,0x00,0x00,0x05,
+   0x00}},
+ {{0x60,0x31,0x31,0x84,0x3a,0x88,0x80,0xf0,
+   0x58,0x8c,0x57,0x57,0x81,0x20,0x00,0x01,
+   0x01}},
+ {{0x6e,0x3f,0x3f,0x92,0x48,0x96,0x28,0xf5,
+   0x00,0x84,0xff,0xff,0x29,0x10,0x00,0x01,
+   0x01}}
+};
+
+static const SiS_LCDACRT1DataStruct  Clevo1024x768_LCDACRT1_1[]=
+{
+ {{0x73,0x4f,0x4f,0x97,0x55,0x86,0xc4,0x1f,
+   0x92,0x89,0x8f,0x8f,0xb5,0x30,0x00,0x05,
+   0x00}},
+ {{0x73,0x4f,0x4f,0x97,0x55,0x86,0x97,0x1f,
+   0x60,0x87,0x5d,0x5d,0x83,0x10,0x00,0x05,
+   0x00}},
+ {{0x73,0x4f,0x4f,0x97,0x55,0x86,0xc4,0x1f,
+   0x92,0x89,0x8f,0x8f,0xb5,0x30,0x00,0x05,
+   0x00}},
+ {{0x73,0x4f,0x4f,0x97,0x55,0x86,0x97,0x1f,
+   0x60,0x87,0x5d,0x5d,0x83,0x10,0x00,0x05,
+   0x00}},
+ {{0x73,0x4f,0x4f,0x97,0x55,0x86,0x04,0x3e,
+   0xE2,0x89,0xDf,0xDf,0x05,0x00,0x00,0x05,
+   0x00}},
+ {{0x87,0x63,0x63,0x8B,0x69,0x1A,0x7c,0xf0,
+   0x5A,0x8F,0x57,0x57,0x7D,0x20,0x00,0x26,
+   0x01}},
+ {{0xA3,0x7f,0x7f,0x87,0x86,0x97,0x24,0xf5,
+   0x02,0x88,0xFf,0xFf,0x25,0x10,0x00,0x02,
+   0x01}}
+};
+
+static const SiS_LCDACRT1DataStruct  Clevo1024x768_LCDACRT1_1_H[]=
+{
+ {{0x4b,0x27,0x27,0x8f,0x2b,0x03,0xc4,0x1f,
+   0x92,0x89,0x8f,0x8f,0xb5,0x30,0x00,0x44,
+   0x00}},
+ {{0x4b,0x27,0x27,0x8f,0x2b,0x03,0x97,0x1f,
+   0x60,0x87,0x5D,0x5D,0x83,0x01,0x00,0x44,
+   0x00}},
+ {{0x4b,0x27,0x27,0x8f,0x2b,0x03,0xc4,0x1f,
+   0x92,0x89,0x8f,0x8f,0xb5,0x30,0x00,0x44,
+   0x00}},
+ {{0x4b,0x27,0x27,0x8f,0x2b,0x03,0x97,0x1f,
+   0x60,0x87,0x5D,0x5D,0x83,0x01,0x00,0x44,
+   0x00}},
+ {{0x4b,0x27,0x27,0x8f,0x32,0x1b,0x04,0x3e,
+   0xE2,0x89,0xDf,0xDf,0x05,0x00,0x00,0x45,
+   0x00}},
+ {{0x55,0x31,0x31,0x99,0x46,0x1d,0x7c,0xf0,
+   0x5A,0x8F,0x57,0x57,0x7D,0x20,0x00,0x55,
+   0x01}},
+ {{0x63,0x3F,0x3F,0x87,0x4A,0x93,0x24,0xF5,
+   0x02,0x88,0xFF,0xFF,0x25,0x10,0x00,0x01,
+   0x01}}
+};
+
+static const SiS_LCDACRT1DataStruct  Clevo1024x768_LCDACRT1_2[]=
+{
+ {{0xa3,0x4f,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
+   0x4a,0x80,0x8f,0x8f,0x25,0x30,0x00,0x06,
+   0x00}},
+ {{0xa3,0x4f,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
+   0x31,0x87,0x5d,0x5d,0x25,0x30,0x00,0x06,
+   0x00}},
+ {{0xa3,0x4f,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
+   0x4a,0x80,0x8f,0x8f,0x25,0x30,0x00,0x06,
+   0x00}},
+ {{0xa3,0x4f,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
+   0x31,0x87,0x5d,0x5d,0x25,0x30,0x00,0x06,
+   0x00}},
+ {{0xa3,0x4f,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
+   0x72,0x88,0xdf,0xdf,0x25,0x30,0x00,0x06,
+   0x00}},
+ {{0xa3,0x63,0x63,0x87,0x78,0x89,0x24,0xf1,
+   0xae,0x84,0x57,0x57,0x25,0x30,0x00,0x02,
+   0x01}},
+ {{0xa3,0x7f,0x7f,0x87,0x86,0x97,0x24,0xf5,
+   0x02,0x88,0xff,0xff,0x25,0x10,0x00,0x02,
+   0x01}}
+};
+
+static const SiS_LCDACRT1DataStruct  Clevo1024x768_LCDACRT1_2_H[]=
+{
+ {{0x7b,0x27,0x27,0x9f,0x46,0x97,0x24,0xbb,
+   0x57,0x8e,0x8f,0x8f,0x25,0x30,0x00,0x01,
+   0x00 }},
+ {{0x7b,0x27,0x27,0x9f,0x46,0x97,0x24,0xbb,
+   0x3e,0x85,0x5d,0x5d,0x25,0x10,0x00,0x01,
+   0x00 }},
+ {{0x7b,0x27,0x27,0x9f,0x46,0x97,0x24,0xbb,
+   0x57,0x8e,0x8f,0x8f,0x25,0x30,0x00,0x01,
+   0x00 }},
+ {{0x7b,0x27,0x27,0x9f,0x46,0x97,0x24,0xbb,
+   0x3e,0x85,0x5d,0x5d,0x25,0x10,0x00,0x01,
+   0x00 }},
+ {{0x7b,0x27,0x27,0x9f,0x46,0x97,0x24,0xbb,
+   0x7f,0x86,0xdf,0xdf,0x25,0x10,0x00,0x01,
+   0x00 }},
+ {{0x71,0x31,0x31,0x95,0x46,0x97,0x24,0xf1,
+   0xbb,0x82,0x57,0x57,0x25,0x10,0x00,0x01,
+   0x01 }},
+ {{0x63,0x3f,0x3f,0x87,0x46,0x97,0x24,0xf5,
+   0x0f,0x86,0xff,0xff,0x25,0x30,0x00,0x01,
+   0x01 }}
+};
+
+#endif  /* 315 */
+
+/**************************************************************/
+/* LVDS ----------------------------------------------------- */
+/**************************************************************/
+
+static const SiS_LVDSDataStruct  SiS_LVDS320x480Data_1[]=
+{
+	{ 848, 433, 400, 525},
+	{ 848, 389, 400, 525},
+	{ 848, 433, 400, 525},
+	{ 848, 389, 400, 525},
+	{ 848, 518, 400, 525},
+	{1056, 628, 400, 525},
+	{ 400, 525, 400, 525},
+	{ 800, 449,1000, 644},
+	{ 800, 525,1000, 635}
+};
+
+static const SiS_LVDSDataStruct  SiS_LVDS640x480Data_1[]=
+{
+	{ 800, 445, 800, 525},   /* 800, 449, 800, 449 */
+	{ 800, 395, 800, 525},
+	{ 800, 445, 800, 525},
+	{ 800, 395, 800, 525},
+	{ 800, 525, 800, 525},
+	{ 800, 525, 800, 525},   /* pseudo */
+	{ 800, 525, 800, 525}    /* pseudo */
+};
+
+/* FSTN 320x240 */
+static const SiS_LVDSDataStruct  SiS_LVDS640x480Data_2[]=
+{
+	{ 800, 445, 800, 525},
+	{ 800, 395, 800, 525},
+	{ 800, 445, 800, 525},
+	{ 800, 395, 800, 525},
+	{ 800, 525, 800, 525},
+        { 800, 525, 800, 525},   /* pseudo */
+	{ 800, 525, 800, 525}    /* pseudo */
+};
+
+
+static const SiS_LVDSDataStruct  SiS_LVDS800x600Data_1[]=
+{
+	{ 848, 433,1060, 629},
+	{ 848, 389,1060, 629},
+	{ 848, 433,1060, 629},
+	{ 848, 389,1060, 629},
+	{ 848, 518,1060, 629},
+	{1056, 628,1056, 628},
+	{1056, 628,1056, 628},
+	{ 800, 449,1000, 644},
+	{ 800, 525,1000, 635}
+};
+
+static const SiS_LVDSDataStruct  SiS_LVDS800x600Data_2[]=
+{
+	{1056, 628,1056, 628},
+	{1056, 628,1056, 628},
+	{1056, 628,1056, 628},
+	{1056, 628,1056, 628},
+	{1056, 628,1056, 628},
+	{1056, 628,1056, 628},
+	{1056, 628,1056, 628},
+	{ 800, 449,1000, 644},
+	{ 800, 525,1000, 635}
+};
+
+static const SiS_LVDSDataStruct  SiS_LVDS1024x768Data_1[]=
+{
+	{ 840, 438,1344, 806},
+	{ 840, 409,1344, 806},
+	{ 840, 438,1344, 806},
+	{ 840, 409,1344, 806},
+	{ 840, 518,1344, 806},   /* 640x480 */
+	{1050, 638,1344, 806},   /* 800x600 */
+	{1344, 806,1344, 806},   /* 1024x768 */
+	{ 800, 449,1280, 801},
+	{ 800, 525,1280, 813}
+};
+
+static const SiS_LVDSDataStruct  SiS_LVDS1024x768Data_2[]=
+{
+	{1344, 806,1344, 806},
+	{1344, 806,1344, 806},
+	{1344, 806,1344, 806},
+	{1344, 806,1344, 806},
+	{1344, 806,1344, 806},
+	{1344, 806,1344, 806},
+	{1344, 806,1344, 806},
+	{ 800, 449,1280, 801},
+	{ 800, 525,1280, 813}
+};
+
+
+static const SiS_LVDSDataStruct  SiS_LVDS1280x1024Data_1[]=
+{
+	{1048, 442,1688,1066},
+	{1048, 392,1688,1066},
+	{1048, 442,1688,1066},
+	{1048, 392,1688,1066},
+	{1048, 522,1688,1066},
+	{1208, 642,1688,1066},
+	{1432, 810,1688,1066},
+	{1688,1066,1688,1066}
+};
+
+static const SiS_LVDSDataStruct  SiS_LVDS1280x1024Data_2[]=
+{
+	{1688,1066,1688,1066},
+	{1688,1066,1688,1066},
+	{1688,1066,1688,1066},
+	{1688,1066,1688,1066},
+	{1688,1066,1688,1066},
+	{1688,1066,1688,1066},
+	{1688,1066,1688,1066},
+	{1688,1066,1688,1066}
+};
+
+static const SiS_LVDSDataStruct  SiS_LVDS1400x1050Data_1[]=
+{
+        { 928, 416, 1688,1066},
+	{ 928, 366, 1688,1066},
+	{ 928, 416, 1688,1066},
+	{ 928, 366, 1688,1066},
+	{ 928, 496, 1688,1066},
+	{1088, 616, 1688,1066},
+	{1312, 784, 1688,1066},
+	{1568,1040, 1688,1066},
+	{1688,1066, 1688,1066}
+};
+
+static const SiS_LVDSDataStruct  SiS_LVDS1400x1050Data_2[]=
+{
+        {1688,1066, 1688,1066},
+	{1688,1066, 1688,1066},
+	{1688,1066, 1688,1066},
+	{1688,1066, 1688,1066},
+	{1688,1066, 1688,1066},
+	{1688,1066, 1688,1066},
+	{1688,1066, 1688,1066},
+	{1688,1066, 1688,1066},
+	{1688,1066, 1688,1066},
+};
+
+static const SiS_LVDSDataStruct  SiS_LVDS1600x1200Data_1[]=
+{
+   	{1088, 520, 2048,1320},
+	{1088, 470, 2048,1320},
+	{1088, 520, 2048,1320},
+	{1088, 470, 2048,1320},
+	{1088, 600, 2048,1320},
+	{1248, 720, 2048,1320},
+	{1472, 888, 2048,1320},
+	{1728,1144, 2048,1320},
+	{1848,1170, 2048,1320},
+	{2048,1320, 2048,1320}
+#if 0
+        {1088, 450, 2048,1250},
+	{1088, 400, 2048,1250},
+	{1088, 450, 2048,1250},
+	{1088, 400, 2048,1250},
+	{1088, 530, 2048,1250},
+	{1248, 650, 2048,1250},
+	{1472, 818, 2048,1250},
+	{1728,1066, 2048,1250},
+	{1848,1066, 2048,1250},
+	{2048,1250, 2048,1250}
+#endif
+};
+
+static const SiS_LVDSDataStruct  SiS_LVDS1600x1200Data_2[]=
+{
+        {2048,1320, 2048,1320},
+	{2048,1320, 2048,1320},
+	{2048,1320, 2048,1320},
+	{2048,1320, 2048,1320},
+	{2048,1320, 2048,1320},
+	{2048,1320, 2048,1320},
+	{2048,1320, 2048,1320},
+	{2048,1320, 2048,1320},
+	{2048,1320, 2048,1320},
+	{2048,1320, 2048,1320}
+};
+
+static const SiS_LVDSDataStruct  SiS_LVDS1280x960Data_1[]=
+{
+	{ 840, 438,1344, 806},
+	{ 840, 409,1344, 806},
+	{ 840, 438,1344, 806},
+	{ 840, 409,1344, 806},
+	{ 840, 518,1344, 806},
+	{1050, 638,1344, 806},
+	{1344, 806,1344, 806},
+	{ 800, 449,1280, 801},
+	{ 800, 525,1280, 813}
+};
+
+static const SiS_LVDSDataStruct  SiS_LVDS1280x960Data_2[]=
+{
+	{1344, 806,1344, 806},
+	{1344, 806,1344, 806},
+	{1344, 806,1344, 806},
+	{1344, 806,1344, 806},
+	{1344, 806,1344, 806},
+	{1344, 806,1344, 806},
+	{1344, 806,1344, 806},
+	{ 800, 449,1280, 801},
+	{ 800, 525,1280, 813}
+};
+
+static const SiS_LVDSDataStruct  SiS_LVDS1280x768Data_1[]=
+{
+	{ 768, 438, 1408, 806},
+	{ 768, 388, 1408, 806},
+	{ 768, 438, 1408, 806},
+	{ 768, 388, 1408, 806},
+	{ 768, 518, 1408, 806},
+	{ 928, 638, 1408, 806},
+	{1152, 806, 1408, 806},
+	{1408, 806, 1408, 806},
+	{1408, 806, 1408, 806}
+};
+
+static const SiS_LVDSDataStruct  SiS_LVDS1280x768Data_2[]=
+{
+	{1408, 806, 1408, 806},
+	{1408, 806, 1408, 806},
+	{1408, 806, 1408, 806},
+	{1408, 806, 1408, 806},
+	{1408, 806, 1408, 806},
+	{1408, 806, 1408, 806},
+	{1408, 806, 1408, 806},
+	{1408, 806, 1408, 806},
+	{1408, 806, 1408, 806}
+};
+
+static const SiS_LVDSDataStruct  SiS_LVDS1024x600Data_1[] =
+{
+	{ 840, 604,1344, 800},
+	{ 840, 560,1344, 800},
+	{ 840, 604,1344, 800},
+	{ 840, 560,1344, 800},
+	{ 840, 689,1344, 800},
+	{1050, 800,1344, 800},
+	{1344, 800,1344, 800},
+	{ 800, 449,1280, 789},
+	{ 800, 525,1280, 785}
+};
+
+static const SiS_LVDSDataStruct  SiS_LVDS1024x600Data_2[] =
+{
+	{1344, 800,1344, 800},
+	{1344, 800,1344, 800},
+	{1344, 800,1344, 800},
+	{1344, 800,1344, 800},
+	{1344, 800,1344, 800},
+	{1344, 800,1344, 800},
+	{1344, 800,1344, 800},
+	{ 800, 449,1280, 801},
+	{ 800, 525,1280, 813}
+};
+
+static const SiS_LVDSDataStruct  SiS_LVDS1152x768Data_1[] =
+{
+	{ 840, 438,1344, 806},
+	{ 840, 409,1344, 806},
+	{ 840, 438,1344, 806},
+	{ 840, 409,1344, 806},
+	{ 840, 518,1344, 806},
+	{1050, 638,1344, 806},
+	{1344, 806,1344, 806},
+	{ 800, 449,1280, 801},
+	{ 800, 525,1280, 813}
+};
+
+static const SiS_LVDSDataStruct  SiS_LVDS1152x768Data_2[] =
+{
+	{1344, 806,1344, 806},
+	{1344, 806,1344, 806},
+	{1344, 806,1344, 806},
+	{1344, 806,1344, 806},
+	{1344, 806,1344, 806},
+	{1344, 806,1344, 806},
+	{1344, 806,1344, 806},
+	{ 800, 449,1280, 801},
+	{ 800, 525,1280, 813}
+};
+
+/* Pass 1:1 data */
+static const SiS_LVDSDataStruct  SiS_LVDSXXXxXXXData_1[]=
+{
+        { 800, 449,  800, 449},
+	{ 800, 449,  800, 449},
+	{ 900, 449,  900, 449},
+	{ 900, 449,  900, 449},
+	{ 800, 525,  800, 525},  /*  640x480   */
+	{1056, 628, 1056, 628},  /*  800x600   */
+	{1344, 806, 1344, 806},  /* 1024x768   */
+	{1344,1066, 1344,1066},  /* 1280x1024  */  /* INSERTED ! */
+ 	{1688, 806, 1688, 806},  /* 1280x768   */
+	/* No other panels ! */
+};
+
+/* Custom data for Barco iQ R series */
+static const SiS_LVDSDataStruct  SiS_LVDSBARCO1366Data_1[]=
+{
+	{ 832, 438,1331, 806},
+	{ 832, 388,1331, 806},
+	{ 832, 438,1331, 806},
+	{ 832, 388,1331, 806},
+	{ 832, 518,1331, 806},
+	{1050, 638,1344, 806},
+	{1344, 806,1344, 806},
+	{1688,1066,1688,1066},
+	{1688,1066,1688,1066}   /* 1360x1024 */
+};
+
+/* Custom data for Barco iQ R series */
+static const SiS_LVDSDataStruct  SiS_LVDSBARCO1366Data_2[]=
+{
+	{1344, 806,1344, 806},
+	{1344, 806,1344, 806},
+	{1344, 806,1344, 806},
+	{1344, 806,1344, 806},
+	{1344, 806,1344, 806},
+	{1344, 806,1344, 806},
+	{1344, 806,1344, 806},
+	{1688,1066,1688,1066},
+	{1688,1066,1688,1066}   /* 1360x1024 */
+};
+
+/* Custom data for Barco iQ G series */
+static const SiS_LVDSDataStruct  SiS_LVDSBARCO1024Data_1[]=
+{
+	{ 832, 438,1331, 806},
+	{ 832, 409,1331, 806},
+	{ 832, 438,1331, 806},
+	{ 832, 409,1331, 806},
+	{ 832, 518,1331, 806},   /* 640x480 */
+	{1050, 638,1344, 806},   /* 800x600 */
+	{1344, 806,1344, 806},   /* 1024x768 */
+};
+
+/* Custom data for Barco iQ G series */
+static const SiS_LVDSDataStruct  SiS_LVDSBARCO1024Data_2[]=
+{
+	{1344, 806,1344, 806},
+	{1344, 806,1344, 806},
+	{1344, 806,1344, 806},
+	{1344, 806,1344, 806},
+	{1344, 806,1344, 806},
+	{1344, 806,1344, 806},
+	{1344, 806,1344, 806},
+};
+
+/* Custom data for 848x480 parallel panel */
+static const SiS_LVDSDataStruct  SiS_LVDS848x480Data_1[]=
+{
+	{   0,   0,   0,   0},
+	{   0,   0,   0,   0},
+	{   0,   0,   0,   0},
+	{   0,   0,   0,   0},
+	{1088, 525,1088, 525},  /* 640x480 TODO */
+	{1088, 525,1088, 525},  /* 800x600 TODO */
+	{1088, 525,1088, 525},  /* 1024x768 TODO */
+	{   0,   0,   0,   0},
+	{   0,   0,   0,   0},
+	{   0,   0,   0,   0},
+	{   0,   0,   0,   0},
+	{1088, 525,1088, 525},  /* 848x480 */
+	{1088, 525,1088, 525}   /* 1360x768 TODO */
+};
+
+/* Custom data for 848x480 parallel panel */
+static const SiS_LVDSDataStruct  SiS_LVDS848x480Data_2[]=
+{
+	{   0,   0,   0,   0},
+	{   0,   0,   0,   0},
+	{   0,   0,   0,   0},
+	{   0,   0,   0,   0},
+	{1088, 525,1088, 525},  /*  640x480 */
+	{1088, 525,1088, 525},  /*  800x600 */
+	{1088, 525,1088, 525},  /* 1024x768 */
+	{   0,   0,   0,   0},
+	{   0,   0,   0,   0},
+	{   0,   0,   0,   0},
+	{   0,   0,   0,   0},
+	{1088, 525,1088, 525},  /* 848x480 */
+	{1088, 525,1088, 525}	/* 1360x768 TODO */
+};
+
+static const SiS_LVDSDataStruct  SiS_CHTVUNTSCData[]=
+{
+	{ 840, 600, 840, 600},
+	{ 840, 600, 840, 600},
+	{ 840, 600, 840, 600},
+	{ 840, 600, 840, 600},
+	{ 784, 600, 784, 600},
+	{1064, 750,1064, 750},
+        {1160, 945,1160, 945}
+};
+
+static const SiS_LVDSDataStruct  SiS_CHTVONTSCData[]=
+{
+	{ 840, 525, 840, 525},
+	{ 840, 525, 840, 525},
+	{ 840, 525, 840, 525},
+	{ 840, 525, 840, 525},
+	{ 784, 525, 784, 525},
+	{1040, 700,1040, 700},
+        {1160, 840,1160, 840}
+};
+
+/* LVDS Skew */
+
+static const SiS_LVDSDesStruct  SiS_PanelTypeNS_1[]=
+{
+	{ 8,   0},
+	{ 8,   0},
+	{ 8,   0},
+	{ 8,   0},
+	{ 8,   0},
+	{ 0,   0},
+	{ 0,   0},
+	{ 0,   0},
+	{ 0, 806},
+	{ 0,   0}
+};
+
+static const SiS_LVDSDesStruct  SiS_PanelTypeNS_2[] =
+{
+	{ 0 , 0},
+	{ 0 , 0},
+	{ 0 , 0},
+	{ 0 , 0},
+	{ 0 , 0},
+	{ 0 , 0},
+	{ 0 , 0},
+	{ 0 , 0},
+	{ 0 , 0},
+	{ 0 , 0}
+};
+
+/* Chrontel TV Skew */
+
+static const SiS_LVDSDesStruct  SiS_CHTVUNTSCDesData[]=
+{
+	{ 0,   0},
+	{ 0,   0},
+	{ 0,   0},
+	{ 0,   0},
+	{ 0,   0},
+	{ 0,   0},
+	{ 0,   0}
+};
+
+static const SiS_LVDSDesStruct  SiS_CHTVONTSCDesData[]=
+{
+	{ 0,   0},
+	{ 0,   0},
+	{ 0,   0},
+	{ 0,   0},
+	{ 0,   0},
+	{ 0,   0},
+	{ 0,   0}
+};
+
+static const SiS_LVDSDesStruct  SiS_CHTVUPALDesData[]=
+{
+	{256,   0},
+	{256,   0},
+	{256,   0},
+	{256,   0},
+	{ 0,   0},
+	{ 0,   0},
+	{ 0,   0}
+};
+
+static const SiS_LVDSDesStruct  SiS_CHTVOPALDesData[]=
+{
+	{256,   0},
+	{256,   0},
+	{256,   0},
+	{256,   0},
+	{ 0,   0},
+	{ 0,   0},
+	{ 0,   0}
+};
+
+/* CRT1 CRTC data for slave modes */
+
+static const SiS_LVDSCRT1DataStruct  SiS_LVDSCRT1320x480_1[] =
+{
+ {{0x65,0x4f,0x89,0x56,0x83,0xaa,0x1f,
+   0x90,0x85,0x8f,0xab,0x30,0x00,0x05,
+   0x00 }},
+ {{0x65,0x4f,0x89,0x56,0x83,0x83,0x1f,
+   0x5e,0x83,0x5d,0x79,0x10,0x00,0x05,
+   0x00 }},
+ {{0x65,0x4f,0x89,0x54,0x9f,0xc4,0x1f,
+   0x92,0x89,0x8f,0xb5,0x30,0x00,0x01,
+   0x00 }},
+ {{0x65,0x4f,0x89,0x56,0x83,0x83,0x1f,
+   0x5e,0x83,0x5d,0x79,0x10,0x00,0x05,
+   0x00 }},
+ {{0x65,0x4f,0x89,0x56,0x83,0x04,0x3e,
+   0xe0,0x85,0xdf,0xfb,0x10,0x00,0x05,
+   0x00 }},
+ {{0x7f,0x63,0x83,0x6c,0x1c,0x72,0xf0,
+   0x58,0x8c,0x57,0x73,0x20,0x00,0x06,
+   0x01 }},
+ {{0x2d,0x27,0x90,0x2c,0x80,0x0b,0x3e,
+   0xe9,0x8b,0xe7,0x04,0x00,0x00,0x00,
+   0x00 }}
+};
+
+static const SiS_LVDSCRT1DataStruct  SiS_LVDSCRT1640x480_1[] =
+{
+ {{0x5f,0x4f,0x82,0x55,0x81,0x0b,0x3e,
+   0xe9,0x8b,0xdf,0x04,0x30,0x00,0x05,
+   0x00}},
+ {{0x5f,0x4f,0x82,0x55,0x81,0x0b,0x3e,
+   0xe9,0x8b,0xdf,0x04,0x30,0x00,0x05,
+   0x00}},
+ {{0x5f,0x4f,0x82,0x55,0x81,0x0b,0x3e,
+   0xe9,0x8b,0xdf,0x04,0x30,0x00,0x05,
+   0x00}},
+ {{0x5f,0x4f,0x82,0x55,0x81,0x0b,0x3e,
+   0xe9,0x8b,0xdf,0x04,0x30,0x00,0x05,
+   0x00}},
+ {{0x5f,0x4f,0x82,0x55,0x81,0x0b,0x3e,
+   0xe9,0x8b,0xdf,0x04,0x30,0x00,0x05,
+   0x00}},
+ {{0x7f,0x63,0x83,0x6c,0x1c,0x72,0xf0,
+   0x58,0x8c,0x57,0x73,0x20,0x00,0x06,
+   0x01}}
+};
+
+static const SiS_LVDSCRT1DataStruct  SiS_LVDSCRT1640x480_1_H[] =
+{
+ {{0x2d,0x28,0x90,0x2b,0xa0,0xbf,0x1f,
+   0x9c,0x8e,0x96,0xb9,0x00,0x00,0x00,
+   0x00}},
+ {{0x2d,0x28,0x90,0x2b,0xa0,0xbf,0x1f,
+   0x83,0x85,0x63,0xba,0x00,0x00,0x00,
+   0x00}},
+ {{0x2d,0x28,0x90,0x2b,0xa0,0xbf,0x1f,
+   0x9c,0x8e,0x96,0xb9,0x00,0x00,0x00,
+   0x00}},
+ {{0x2d,0x28,0x90,0x2b,0xa0,0xbf,0x1f,
+   0x83,0x85,0x63,0xba,0x00,0x00,0x00,
+   0x00}},
+ {{0x2d,0x28,0x90,0x2c,0x80,0x0b,0x3e,
+   0xe9,0x8b,0xe7,0x04,0x00,0x00,0x00,
+   0x00}}
+};
+
+static const SiS_LVDSCRT1DataStruct  SiS_LVDSCRT1640x480_2[] =
+{
+ {{0x5f,0x4f,0x82,0x55,0x81,0x0b,0x3e,
+   0xe9,0x8b,0xdf,0x04,0x30,0x00,0x05,
+   0x00}},
+ {{0x5f,0x4f,0x82,0x55,0x81,0x0b,0x3e,
+   0xe9,0x8b,0xdf,0x04,0x30,0x00,0x05,
+   0x00}},
+ {{0x5f,0x4f,0x82,0x55,0x81,0x0b,0x3e,
+   0xe9,0x8b,0xdf,0x04,0x30,0x00,0x05,
+   0x00}},
+ {{0x5f,0x4f,0x82,0x55,0x81,0x0b,0x3e,
+   0xe9,0x8b,0xdf,0x04,0x30,0x00,0x05,
+   0x00}},
+ {{0x5f,0x4f,0x82,0x55,0x81,0x0b,0x3e,
+   0xe9,0x8b,0xdf,0x04,0x30,0x00,0x05,
+   0x00}},
+ {{0x7f,0x63,0x83,0x6c,0x1c,0x72,0xf0,
+   0x58,0x8c,0x57,0x73,0x20,0x00,0x06,
+   0x01}},
+ {{0x2d,0x27,0x90,0x2c,0x80,0x0b,0x3e,
+   0xe9,0x8b,0xe7,0x04,0x00,0x00,0x00,
+   0x00}}
+};
+
+static const SiS_LVDSCRT1DataStruct  SiS_LVDSCRT1640x480_2_H[] =
+{
+ {{0x65,0x4f,0x89,0x56,0x83,0xaa,0x1f,
+   0x90,0x85,0x8f,0xab,0x30,0x00,0x05,
+   0x00}},
+ {{0x65,0x4f,0x89,0x56,0x83,0x83,0x1f,
+   0x5e,0x83,0x5d,0x79,0x10,0x00,0x05,
+   0x00}},
+ {{0x65,0x4f,0x89,0x54,0x9f,0xc4,0x1f,
+   0x92,0x89,0x8f,0xb5,0x30,0x00,0x01,
+   0x00}},
+ {{0x65,0x4f,0x89,0x56,0x83,0x83,0x1f,
+   0x5e,0x83,0x5d,0x79,0x10,0x00,0x05,
+   0x00}},
+ {{0x65,0x4f,0x89,0x56,0x83,0x04,0x3e,
+   0xe0,0x85,0xdf,0xfb,0x10,0x00,0x05,
+   0x00}},
+ {{0x7f,0x63,0x83,0x6c,0x1c,0x72,0xf0,
+   0x58,0x8c,0x57,0x73,0x20,0x00,0x06,
+   0x01}},
+ {{0x2d,0x27,0x90,0x2c,0x80,0x0b,0x3e,
+   0xe9,0x8b,0xe7,0x04,0x00,0x00,0x00,
+   0x00}}
+};
+
+static const SiS_LVDSCRT1DataStruct  SiS_LVDSCRT1640x480_3[] =
+{
+ {{0x5f,0x4f,0x82,0x55,0x81,0x0b,0x3e,
+   0xe9,0x8b,0xdf,0x04,0x00,0x00,0x05,
+   0x00}},
+ {{0x5f,0x4f,0x82,0x55,0x81,0x0b,0x3e,
+   0xe9,0x8b,0xdf,0x04,0x00,0x00,0x05,
+   0x00}},
+ {{0x5f,0x4f,0x82,0x55,0x81,0x0b,0x3e,
+   0xe9,0x8b,0xdf,0x04,0x00,0x00,0x05,
+   0x00}},
+ {{0x5f,0x4f,0x82,0x55,0x81,0x0b,0x3e,
+   0xe9,0x8b,0xdf,0x04,0x00,0x00,0x05,
+   0x00}},
+ {{0x5f,0x4f,0x82,0x55,0x81,0x0b,0x3e,
+   0xe9,0x8b,0xdf,0x04,0x00,0x00,0x05,
+   0x00}},
+ {{0x7f,0x63,0x83,0x6c,0x1c,0x72,0xf0,
+   0x58,0x8c,0x57,0x73,0x20,0x00,0x06,
+   0x01}},
+ {{0x2d,0x27,0x90,0x2c,0x80,0x0b,0x3e,
+   0xe9,0x8b,0xe7,0x04,0x00,0x00,0x00,
+   0x00}}
+};
+
+static const SiS_LVDSCRT1DataStruct  SiS_LVDSCRT1640x480_3_H[] =
+{
+ {{0x65,0x4f,0x89,0x56,0x83,0xaa,0x1f,
+   0x90,0x85,0x8f,0xab,0x30,0x00,0x05,
+   0x00}},
+ {{0x65,0x4f,0x89,0x56,0x83,0x83,0x1f,
+   0x5e,0x83,0x5d,0x79,0x10,0x00,0x05,
+   0x00}},
+ {{0x65,0x4f,0x89,0x54,0x9f,0xc4,0x1f,
+   0x92,0x89,0x8f,0xb5,0x30,0x00,0x01,
+   0x00}},
+ {{0x65,0x4f,0x89,0x56,0x83,0x83,0x1f,
+   0x5e,0x83,0x5d,0x79,0x10,0x00,0x05,
+   0x00}},
+ {{0x65,0x4f,0x89,0x56,0x83,0x04,0x3e,
+   0xe0,0x85,0xdf,0xfb,0x10,0x00,0x05,
+   0x00}},
+ {{0x7f,0x63,0x83,0x6c,0x1c,0x72,0xf0,
+   0x58,0x8c,0x57,0x73,0x20,0x00,0x06,
+   0x01}},
+ {{0x2d,0x27,0x90,0x2c,0x80,0x0b,0x3e,
+   0xe9,0x8b,0xe7,0x04,0x00,0x00,0x00,
+   0x00}}
+};
+
+static const SiS_LVDSCRT1DataStruct  SiS_LVDSCRT11024x600_1[] =
+{
+ {{0x64,0x4f,0x88,0x54,0x9f,0x5a,0x3e,
+   0xe8,0x8f,0x8f,0x5b,0x00,0x00,0x01,
+   0x00}},
+ {{0x64,0x4f,0x88,0x54,0x9f,0x2e,0x3e,
+   0xb9,0x80,0x5d,0x2f,0x00,0x00,0x01,
+   0x00}},
+ {{0x64,0x4f,0x88,0x54,0x9f,0x5a,0x3e,
+   0xe8,0x8f,0x8f,0x5b,0x00,0x00,0x01,
+   0x00}},
+ {{0x64,0x4f,0x88,0x54,0x9f,0x2e,0x3e,
+   0xb9,0x80,0x5d,0x2f,0x00,0x00,0x01,
+   0x00}},
+ {{0x64,0x4f,0x88,0x54,0x9f,0xaf,0xba,
+   0x3b,0x82,0xdf,0xb0,0x00,0x00,0x01,
+   0x00}},
+ {{0x7e,0x63,0x82,0x68,0x15,0x1e,0xf1,
+   0xae,0x85,0x57,0x1f,0x30,0x00,0x26,
+   0x01}},
+ {{0xa3,0x7f,0x87,0x86,0x97,0x1e,0xf1,
+   0xae,0x85,0x57,0x1f,0x30,0x00,0x02,
+   0x01}}
+};
+
+static const SiS_LVDSCRT1DataStruct  SiS_LVDSCRT11024x600_1_H[] =
+{
+ {{0x2f,0x27,0x93,0x2b,0x90,0xc4,0x1f,
+   0x92,0x89,0x8f,0xb5,0x30,0x00,0x44,
+   0x00}},
+ {{0x2f,0x27,0x93,0x2b,0x90,0x97,0x1f,
+   0x60,0x87,0x5d,0x83,0x10,0x00,0x44,
+   0x00}},
+ {{0x2f,0x27,0x93,0x2b,0x90,0xc4,0x1f,
+   0x92,0x89,0x8f,0xb5,0x30,0x00,0x44,
+   0x00}},
+ {{0x2f,0x27,0x93,0x2b,0x90,0x97,0x1f,
+   0x60,0x87,0x5d,0x83,0x10,0x00,0x44,
+   0x00}},
+ {{0x2f,0x27,0x93,0x2b,0x90,0x04,0x3e,
+   0xe2,0x89,0xdf,0x05,0x00,0x00,0x44,
+   0x00}},
+ {{0x3c,0x31,0x80,0x35,0x1c,0x7c,0xf0,
+   0x5a,0x8f,0x57,0x7d,0x20,0x00,0x55,
+   0x01}},
+ {{0x4f,0x3f,0x93,0x45,0x0d,0x24,0xf5,
+   0x02,0x88,0xff,0x25,0x10,0x00,0x01,
+   0x01}}
+};
+
+static const SiS_LVDSCRT1DataStruct  SiS_LVDSCRT11024x600_2[] =
+{
+ {{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
+   0x4a,0x80,0x8f,0x25,0x30,0x00,0x06,
+   0x00}},
+ {{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
+   0x31,0x87,0x5d,0x25,0x30,0x00,0x06,
+   0x00}},
+ {{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
+   0x4a,0x80,0x8f,0x25,0x30,0x00,0x06,
+   0x00}},
+ {{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
+   0x31,0x87,0x5d,0x25,0x30,0x00,0x06,
+   0x00}},
+ {{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
+   0x72,0x88,0xdf,0x25,0x30,0x00,0x06,
+   0x00}},
+ {{0xa3,0x63,0x87,0x78,0x89,0x24,0xf1,
+   0xae,0x84,0x57,0x25,0x30,0x00,0x02,
+   0x01}},
+ {{0xa3,0x7f,0x87,0x86,0x97,0x24,0xf5,
+   0x02,0x88,0xff,0x25,0x10,0x00,0x02,
+   0x01}}
+};
+
+static const SiS_LVDSCRT1DataStruct  SiS_LVDSCRT11024x600_2_H[] =
+{
+ {{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb,
+   0x4a,0x80,0x8f,0x25,0x30,0x00,0x01,
+   0x00}},
+ {{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb,
+   0x31,0x87,0x5d,0x25,0x30,0x00,0x01,
+   0x00}},
+ {{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb,
+   0x4a,0x80,0x8f,0x25,0x30,0x00,0x01,
+   0x00}},
+ {{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb,
+   0x31,0x87,0x5d,0x25,0x30,0x00,0x01,
+   0x00}},
+ {{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb,
+   0x72,0x88,0xdf,0x25,0x30,0x00,0x01,
+   0x00}},
+ {{0x4f,0x31,0x93,0x3e,0x06,0x24,0xf1,
+   0xae,0x84,0x57,0x25,0x30,0x00,0x01,
+   0x01}},
+ {{0x4f,0x3f,0x93,0x45,0x0d,0x24,0xf5,
+   0x02,0x88,0xff,0x25,0x10,0x00,0x01,
+   0x01}}
+};
+
+static const SiS_LVDSCRT1DataStruct  SiS_LVDSCRT11152x768_1[] =
+{
+ {{0x64,0x4f,0x88,0x54,0x9f,0xc4,0x1f,
+   0x92,0x89,0x8f,0xb5,0x30,0x00,0x01,
+   0x00}},
+ {{0x64,0x4f,0x88,0x54,0x9f,0x97,0x1f,
+   0x60,0x87,0x5d,0x83,0x10,0x00,0x01,
+   0x00}},
+ {{0x64,0x4f,0x88,0x54,0x9f,0xc4,0x1f,
+   0x92,0x89,0x8f,0xb5,0x30,0x00,0x01,
+   0x00}},
+ {{0x64,0x4f,0x88,0x54,0x9f,0x97,0x1f,
+   0x60,0x87,0x5d,0x83,0x10,0x00,0x01,
+   0x00}},
+ {{0x64,0x4f,0x88,0x54,0x9f,0x04,0x3e,
+   0xe2,0x89,0xdf,0x05,0x00,0x00,0x01,
+   0x00}},
+ {{0x7e,0x63,0x82,0x68,0x15,0x7c,0xf0,
+   0x5a,0x8f,0x57,0x7d,0x20,0x00,0x26,
+   0x01}},
+ {{0xa3,0x7f,0x87,0x86,0x97,0x24,0xf5,
+   0x02,0x88,0xff,0x25,0x10,0x00,0x02,
+   0x01}}
+};
+
+static const SiS_LVDSCRT1DataStruct  SiS_LVDSCRT11152x768_1_H[] =
+{
+ {{0x2f,0x27,0x93,0x2b,0x90,0xc4,0x1f,
+   0x92,0x89,0x8f,0xb5,0x30,0x00,0x44,
+   0x00}},
+ {{0x2f,0x27,0x93,0x2b,0x90,0x97,0x1f,
+   0x60,0x87,0x5d,0x83,0x10,0x00,0x44,
+   0x00}},
+ {{0x2f,0x27,0x93,0x2b,0x90,0xc4,0x1f,
+   0x92,0x89,0x8f,0xb5,0x30,0x00,0x44,
+   0x00}},
+ {{0x2f,0x27,0x93,0x2b,0x90,0x97,0x1f,
+   0x60,0x87,0x5d,0x83,0x10,0x00,0x44,
+   0x00}},
+ {{0x2f,0x27,0x93,0x2b,0x90,0x04,0x3e,
+   0xe2,0x89,0xdf,0x05,0x00,0x00,0x44,
+   0x00}},
+ {{0x3c,0x31,0x80,0x35,0x1c,0x7c,0xf0,
+   0x5a,0x8f,0x57,0x7d,0x20,0x00,0x55,
+   0x01}},
+ {{0x4f,0x3f,0x93,0x45,0x0d,0x24,0xf5,
+   0x02,0x88,0xff,0x25,0x10,0x00,0x01,
+   0x01}}
+};
+
+static const SiS_LVDSCRT1DataStruct  SiS_LVDSCRT11152x768_2[] =
+{
+ {{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
+   0x4a,0x80,0x8f,0x25,0x30,0x00,0x06,
+   0x00}},
+ {{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
+   0x31,0x87,0x5d,0x25,0x30,0x00,0x06,
+   0x00}},
+ {{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
+   0x4a,0x80,0x8f,0x25,0x30,0x00,0x06,
+   0x00}},
+ {{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
+   0x31,0x87,0x5d,0x25,0x30,0x00,0x06,
+   0x00}},
+ {{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
+   0x72,0x88,0xdf,0x25,0x30,0x00,0x06,
+   0x00}},
+ {{0xa3,0x63,0x87,0x78,0x89,0x24,0xf1,
+   0xae,0x84,0x57,0x25,0x30,0x00,0x02,
+   0x01}},
+ {{0xa3,0x7f,0x87,0x86,0x97,0x24,0xf5,
+   0x02,0x88,0xff,0x25,0x10,0x00,0x02,
+   0x01}}
+};
+
+static const SiS_LVDSCRT1DataStruct  SiS_LVDSCRT11152x768_2_H[] =
+{
+ {{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb,
+   0x4a,0x80,0x8f,0x25,0x30,0x00,0x01,
+   0x00}},
+ {{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb,
+   0x31,0x87,0x5d,0x25,0x30,0x00,0x01,
+   0x00}},
+ {{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb,
+   0x4a,0x80,0x8f,0x25,0x30,0x00,0x01,
+   0x00}},
+ {{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb,
+   0x31,0x87,0x5d,0x25,0x30,0x00,0x01,
+   0x00}},
+ {{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb,
+   0x72,0x88,0xdf,0x25,0x30,0x00,0x01,
+   0x00}},
+ {{0x4f,0x31,0x93,0x3e,0x06,0x24,0xf1,
+   0xae,0x84,0x57,0x25,0x30,0x00,0x01,
+   0x01}},
+ {{0x4f,0x3f,0x93,0x45,0x0d,0x24,0xf5,
+   0x02,0x88,0xff,0x25,0x10,0x00,0x01,
+   0x01}}
+};
+
+static const SiS_LVDSCRT1DataStruct  SiS_LVDSCRT11280x768_1[] =
+{
+ {{0x5b,0x4f,0x9f,0x55,0x19,0xb4,0x1f,
+   0x9c,0x8e,0x8f,0xb5,0x10,0x00,0x01,
+   0x00}},
+ {{0x5b,0x4f,0x9f,0x55,0x19,0x82,0x1f,
+   0x6a,0x8c,0x5d,0x83,0x30,0x00,0x01,
+   0x00}},
+ {{0x5b,0x4f,0x9f,0x55,0x19,0xb4,0x1f,
+   0x9c,0x8e,0x8f,0xb5,0x10,0x00,0x01,
+   0x00}},
+ {{0x5b,0x4f,0x9f,0x55,0x19,0x82,0x1f,
+   0x6a,0x8c,0x5d,0x83,0x30,0x00,0x01,
+   0x00}},
+ {{0x5b,0x4f,0x9f,0x55,0x19,0x04,0x3e,
+   0xec,0x8e,0xdf,0x05,0x20,0x00,0x01,
+   0x00}},
+ {{0x6f,0x63,0x93,0x69,0x8d,0x7c,0xf0,
+   0x64,0x86,0x57,0x7d,0x20,0x00,0x05,
+   0x01}},
+ {{0x8b,0x7f,0x8f,0x85,0x09,0x24,0xf5,
+   0x0c,0x8e,0xff,0x25,0x30,0x00,0x02,
+   0x01}},
+ {{0xab,0x9f,0x8f,0xa5,0x89,0x24,0xf5,
+   0x0c,0x8e,0xff,0x25,0x30,0x00,0x06,
+   0x01}},
+ {{0xab,0x9f,0x8f,0xa5,0x89,0x24,0xf5,
+   0x0c,0x8e,0xff,0x25,0x30,0x00,0x06,
+   0x01}}
+};
+
+static const SiS_LVDSCRT1DataStruct  SiS_LVDSCRT11280x768_1_H[] =
+{
+ {{0x47,0x27,0x8b,0x2c,0x1a,0x9e,0x1f,
+   0x93,0x86,0x8f,0x9f,0x30,0x00,0x05,
+   0x00}},
+ {{0x47,0x27,0x8b,0x2c,0x1a,0x6c,0x1f,
+   0x60,0x84,0x5d,0x6d,0x10,0x00,0x05,
+   0x00}},
+ {{0x47,0x27,0x8b,0x30,0x1e,0x9e,0x1f,
+   0x92,0x86,0x8f,0x9f,0x30,0x00,0x05,
+   0x00}},
+ {{0x47,0x27,0x8b,0x2c,0x1a,0x6c,0x1f,
+   0x60,0x84,0x5d,0x6d,0x10,0x00,0x05,
+   0x00}},
+ {{0x47,0x27,0x8b,0x2c,0x1a,0xee,0x1f,
+   0xe2,0x86,0xdf,0xef,0x10,0x00,0x05,
+   0x00}},
+ {{0x51,0x31,0x95,0x36,0x04,0x66,0xf0,
+   0x5a,0x8e,0x57,0x67,0x20,0x00,0x01,
+   0x01}},
+ {{0x5f,0x3f,0x83,0x44,0x92,0x0e,0xf5,
+   0x02,0x86,0xff,0x0f,0x10,0x00,0x01,
+   0x01}},
+ {{0x6f,0x4f,0x93,0x54,0x82,0x0e,0x5a,
+   0x02,0x86,0xff,0x0f,0x09,0x00,0x05,
+   0x01}},
+ {{0x6f,0x4f,0x93,0x54,0x82,0x0e,0x5a,
+   0x02,0x86,0xff,0x0f,0x09,0x00,0x05,
+   0x01}}
+};
+
+static const SiS_LVDSCRT1DataStruct  SiS_LVDSCRT11280x768_2[] =
+{
+ {{0xab,0x60,0x9f,0x80,0x04,0x24,0xbb,
+   0x54,0x86,0xdb,0xda,0x00,0x00,0x02,
+   0x00}},
+ {{0xab,0x60,0x9f,0x80,0x04,0x24,0xbb,
+   0x3b,0x8d,0xc2,0xc1,0x00,0x00,0x02,
+   0x00}},
+ {{0xab,0x60,0x9f,0x80,0x04,0x24,0xbb,
+   0x54,0x86,0xdb,0xda,0x00,0x00,0x02,
+   0x00}},
+ {{0xab,0x60,0x9f,0x80,0x04,0x24,0xbb,
+   0x3b,0x8d,0xc2,0xc1,0x00,0x00,0x02,
+   0x00}},
+ {{0xab,0x60,0x9f,0x80,0x04,0x24,0xb3,
+   0x7c,0x8e,0x03,0x02,0x10,0x00,0x02,
+   0x01}},
+ {{0xab,0x63,0x8f,0x8a,0x8e,0x24,0xf1,
+   0xb6,0x88,0x57,0x25,0x10,0x00,0x02,
+   0x01}},
+ {{0xab,0x7f,0x8f,0x98,0x9c,0x24,0xf5,
+   0x0a,0x8c,0xff,0x25,0x30,0x00,0x02,
+   0x01}},
+ {{0xab,0x9f,0x8f,0xa8,0x8c,0x24,0xf5,
+   0x0a,0x8c,0xff,0x25,0x30,0x00,0x06,
+   0x01}},
+ {{0xab,0x9f,0x8f,0xa8,0x8c,0x24,0xf5,
+   0x0a,0x8c,0xff,0x25,0x30,0x00,0x06,
+   0x01}}
+};
+
+static const SiS_LVDSCRT1DataStruct  SiS_LVDSCRT11280x768_2_H[] =
+{
+ {{0x83,0x38,0x97,0x58,0x9c,0x24,0xbb,
+   0x54,0x86,0xdb,0xda,0x00,0x00,0x01,
+   0x00}},
+ {{0x83,0x38,0x97,0x58,0x9c,0x24,0xbb,
+   0x3b,0x8d,0xc2,0xc1,0x00,0x00,0x01,
+   0x00}},
+ {{0x83,0x38,0x97,0x58,0x9c,0x24,0xbb,
+   0x54,0x86,0xdb,0xda,0x00,0x00,0x01,
+   0x00}},
+ {{0x83,0x38,0x97,0x58,0x9c,0x24,0xbb,
+   0x3b,0x8d,0xc2,0xc1,0x00,0x00,0x01,
+   0x00}},
+ {{0x83,0x38,0x97,0x58,0x9c,0x24,0xb3,
+   0x7c,0x8e,0x03,0x02,0x10,0x00,0x01,
+   0x01}},
+ {{0x79,0x31,0x9d,0x58,0x9c,0x24,0xf1,
+   0xb6,0x88,0x57,0x25,0x10,0x00,0x01,
+   0x01}},
+ {{0x6b,0x3f,0x8f,0x58,0x9c,0x24,0xf5,
+   0x0a,0x8c,0xff,0x25,0x30,0x00,0x01,
+   0x01}},
+ {{0xab,0x9f,0x8f,0xa8,0x8c,0x24,0xf5,
+   0x0a,0x8c,0xff,0x25,0x30,0x00,0x06,
+   0x01}},
+ {{0xab,0x9f,0x8f,0xa8,0x8c,0x24,0xf5,
+   0x0a,0x8c,0xff,0x25,0x30,0x00,0x06,
+   0x01}}
+};
+
+static const SiS_LVDSCRT1DataStruct  SiS_LVDSCRT1XXXxXXX_1[] =
+{
+ {{0x5f,0x4f,0x82,0x55,0x81,0xbf,0x1f,
+   0x9c,0x8e,0x96,0xb9,0x30,0x00,0x05,
+   0x00}},
+ {{0x5f,0x4f,0x82,0x55,0x81,0xbf,0x1f,
+   0x9c,0x8e,0x96,0xb9,0x30,0x00,0x05,
+   0x00}},
+ {{0x5f,0x4f,0x82,0x55,0x81,0xbf,0x1f,
+   0x9c,0x8e,0x96,0xb9,0x30,0x00,0x05,
+   0x00}},
+ {{0x5f,0x4f,0x82,0x55,0x81,0xbf,0x1f,
+   0x9c,0x8e,0x96,0xb9,0x30,0x00,0x05,
+   0x00}},
+ {{0x5f,0x4f,0x82,0x55,0x81,0x0b,0x3e,
+   0xe9,0x8b,0xe7,0x04,0x00,0x00,0x05,
+   0x00}},
+ {{0x7f,0x63,0x83,0x6c,0x1c,0x72,0xf0,
+   0x58,0x8c,0x57,0x73,0x20,0x00,0x06,
+   0x01}},
+ {{0xa3,0x7f,0x87,0x86,0x97,0x24,0xf5,
+   0x02,0x88,0xff,0x25,0x10,0x00,0x02,
+   0x01}},
+ {{0xce,0x9f,0x92,0xa8,0x14,0x28,0x5a,
+   0x00,0x84,0xff,0x29,0x09,0x00,0x07,
+   0x01}},
+ {{0xce,0x9f,0x92,0xa9,0x17,0x24,0xf5,
+   0x02,0x88,0xff,0x25,0x10,0x00,0x07,
+   0x01}}
+};
+
+static const SiS_LVDSCRT1DataStruct  SiS_LVDSCRT1XXXxXXX_1_H[] =
+{
+ {{0x38,0x27,0x9c,0x2c,0x80,0xbf,0x1f,
+   0x9c,0x8e,0x96,0xb9,0x30,0x00,0x00,
+   0x00}},
+ {{0x38,0x27,0x9c,0x2c,0x80,0xbf,0x1f,
+   0x9c,0x8e,0x96,0xb9,0x30,0x00,0x00,
+   0x00}},
+ {{0x38,0x27,0x9c,0x2c,0x80,0xbf,0x1f,
+   0x9c,0x8e,0x96,0xb9,0x30,0x00,0x00,
+   0x00}},
+ {{0x38,0x27,0x9c,0x2c,0x80,0xbf,0x1f,
+   0x9c,0x8e,0x96,0xb9,0x30,0x00,0x00,
+   0x00}},
+ {{0x38,0x27,0x9c,0x2c,0x80,0x0b,0x3e,
+   0xe9,0x8b,0xe7,0x04,0x00,0x00,0x00,
+   0x00}},
+ {{0x4d,0x31,0x91,0x3b,0x03,0x72,0xf0,
+   0x58,0x8c,0x57,0x73,0x20,0x00,0x01,
+   0x01}},
+ {{0x63,0x3f,0x87,0x4a,0x92,0x24,0xf5,
+   0x02,0x88,0xff,0x25,0x10,0x00,0x01,
+   0x01}}
+};
+
+
+/**************************************************************/
+/* COMMON --------------------------------------------------- */
+/**************************************************************/
+
+#define SIS_PL_HSYNCP 0x01
+#define SIS_PL_HSYNCN 0x02
+#define SIS_PL_VSYNCP 0x04
+#define SIS_PL_VSYNCN 0x08
+#define SIS_PL_DVI    0x80
+
+typedef struct _SiS_PlasmaModes
+{
+  const char *name;
+  ULONG  clock;
+  USHORT HDisplay, HTotal, HFrontPorch, HSyncWidth;
+  USHORT VDisplay, VTotal, VFrontPorch, VSyncWidth;
+  UCHAR  SyncFlags;
+} SiS_PlasmaModes;
+
+typedef struct _SiS_PlasmaTables
+{
+   USHORT vendor;
+   UCHAR  productnum;
+   USHORT product[5];
+   const char *DDCnames[5];
+   const char *plasmaname;
+   UCHAR  modenum;
+   UCHAR  plasmamodes[20];  /* | 0x80 = DVI-capable, | 0x40 = analog */
+} SiS_PlasmaTables;
+
+static const SiS_PlasmaModes SiS_PlasmaMode[] = {
+   {  "640x400",		/* 00: IBM 400@70 */
+      25175,
+       640,  800, 17,  64,
+       400,  449, 13,   2,
+      SIS_PL_HSYNCN | SIS_PL_VSYNCN },
+   {  "640x480",		/* 01: VESA 480@72 */
+      31500,
+       640,  832, 24,  40,
+       480,  520,  9,   3,
+      SIS_PL_HSYNCN | SIS_PL_VSYNCN },
+   {  "800x600",		/* 02: VESA 600@72 */
+      50000,
+       800, 1040, 56, 120,
+       600,  666, 37,   6,
+      SIS_PL_HSYNCP | SIS_PL_VSYNCP },
+   {  "864x480",		/* 03: Cereb wide 1 */
+      42526,
+       864, 1134, 22,  86,
+       480,  500,  1,   3,
+      SIS_PL_HSYNCP | SIS_PL_VSYNCN },
+   {  "848x480",		/* 04: VESA wide (NEC1) */
+      33750,
+       848, 1088, 16, 112,
+       480,  517,  6,   8,
+      SIS_PL_HSYNCP | SIS_PL_VSYNCP },
+   {  "1024x576",		/* 05: VESA wide (NEC2) */
+      47250,
+      1024, 1320, 16, 144,
+       576,  596,  2,   4,
+      SIS_PL_HSYNCP | SIS_PL_VSYNCP },
+   {  "1280x720",		/* 06: VESA wide (NEC3) */
+      76500,
+      1280, 1696, 48, 176,
+       720,  750,  4,   8,
+      SIS_PL_HSYNCP | SIS_PL_VSYNCP },
+   {  "1360x765",		/* 07: VESA wide (NEC4) */
+      85500,
+      1360, 1792, 64, 176,
+       765,  795,  4,   8,
+      SIS_PL_HSYNCP | SIS_PL_VSYNCP },
+   {  "1024x600",		/* 08: CEREB wide 2 */
+      51200,
+      1024, 1352, 51, 164,
+       600,  628,  1,   4,
+      SIS_PL_HSYNCN | SIS_PL_VSYNCP },
+   {  "1024x768",		/* 09: VESA 768@75 */
+      78750,
+      1024, 1312,  16, 96,
+       768,  800,   1,  3,
+      SIS_PL_HSYNCP | SIS_PL_VSYNCP },
+   {  "1152x864",		/* 10: VESA 1152x864@75 */
+      108000,
+      1152, 1600, 64, 128,
+       864,  900,  1,   3,
+      SIS_PL_HSYNCP | SIS_PL_VSYNCP },
+   {  "1280x1024",		/* 11: VESA 1024@60 */
+      108000,
+      1280, 1688, 48, 112,
+      1024, 1066,  1,   3,
+      SIS_PL_HSYNCP | SIS_PL_VSYNCP },
+   {  "1280x768",		/* 12: W_XGA */
+      81000,
+      1280, 1688, 48, 112,
+       768,  802,  3,   6,
+      SIS_PL_HSYNCP | SIS_PL_VSYNCN },
+   {  "1280x768",		/* 13: I/O Data W_XGA@56Hz */
+      76064,
+      1280, 1688, 48, 112,
+       768,  802,  2,   3,
+      SIS_PL_HSYNCP | SIS_PL_VSYNCP },
+   {  "1376x768",		/* 14: I/O Wide XGA */
+      87340,
+      1376, 1808, 32, 128,
+       768,  806,  3,   6,
+      SIS_PL_HSYNCN | SIS_PL_VSYNCP },
+   {  "1280x960",		/* 15: VESA 960@60 */
+      108000,
+      1280, 1800, 96, 112,
+       960, 1000,  1,   3,
+      SIS_PL_HSYNCP | SIS_PL_VSYNCP },
+   {  "1400x1050",		/* 16: VESA 1050@60Hz */
+      108000,
+      1400, 1688, 48, 112,
+      1050, 1066,  1,   3,
+      SIS_PL_HSYNCN | SIS_PL_VSYNCN },
+   {  "1360x768",		/* 17: VESA wide (NEC4/2) */
+      85500,
+      1360, 1792, 64, 112,
+       765,  795,  3,   6,
+      SIS_PL_HSYNCP | SIS_PL_VSYNCP },
+   {  "800x600",		/* 18: VESA 600@56 */
+      36000,
+       800, 1024, 24,   2,
+       600,  625,  1,   2,
+      SIS_PL_HSYNCP | SIS_PL_VSYNCP },
+   {  "1072x600",		/* 19: Panasonic 1072x600 (sync?) */
+      54100,
+       1072, 1424, 48, 176,
+        600,  628, 16,   1,
+      SIS_PL_HSYNCP | SIS_PL_VSYNCP },
+   {  "848x480",		/* 20: Panasonic 848x480 (sync?) */
+      33070,			/* is 852x480, but we can't use 852 */
+        848, 1068, 20,  40,	/* differs from DDC data, better centered */
+        480,  516,  3,   5,	/* won't work assumingly, because data is % 8 */
+      SIS_PL_HSYNCN | SIS_PL_VSYNCN },
+};
+
+static const SiS_PlasmaTables SiS_PlasmaTable[] = {
+#if 0  /* Product IDs missing */
+   { 0x38a3, 4,
+     { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 },
+     { "", "", "", "", "" },
+     "NEC PlasmaSync 42VP4/42VP4D/42VP4G/42VP4DG",
+     11,   /* All DVI, except 0, 7, 13 */
+     { 0|0x40, 1|0xc0, 2|0xc0, 4|0xc0, 7|0x40, 9|0xc0,10|0xc0,11|0xc0,13|0x40,14|0xc0,
+      17|0xc0, 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0       }
+   },
+#endif
+#if 0  /* Product IDs missing */
+   { 0x38a3, 3,
+     { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 },
+     { "", "", "", "", "" },
+     "NEC PlasmaSync 42PD1/50PD1/50PD2",
+     5,   /* DVI entirely unknown */
+     { 0|0x40, 1|0xc0, 2|0xc0, 4|0xc0, 9|0xc0, 0     , 0     , 0     , 0     , 0     ,
+       0     , 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0       }
+   },
+   { 0x38a3, 1,
+     { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 },
+     { "", "", "", "", "" },
+     "NEC PlasmaSync 42PD3",
+     10,   /* DVI entirely unknown */
+     { 0|0x40, 1|0xc0, 2|0xc0, 3|0xc0, 4|0xc0, 5|0xc0, 6|0xc0, 7|0x40, 8|0xc0, 9|0xc0,
+       0     , 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0       }
+   },
+   { 0x38a3, 2,
+     { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 },
+     { "", "", "", "", "" },
+     "NEC PlasmaSync 42VM3/61XM1",
+     11,  /* DVI entirely unknown */
+     { 0|0x40, 1|0xc0, 2|0xc0, 3|0xc0, 4|0xc0, 5|0xc0, 6|0xc0, 8|0xc0, 9|0xc0,11|0xc0,
+      17|0xc0, 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0       }
+   },
+   { 0x38a3, 2,
+     { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 },
+     { "", "", "", "", "" },
+     "NEC PlasmaSync 42MP1/42MP2",
+     6,   /* DVI entirely unknown */
+     { 0|0x40, 1|0xc0, 2|0xc0, 4|0xc0, 9|0xc0,11|0xc0, 0     , 0     , 0     , 0     ,
+       0     , 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0       }
+   },
+   { 0x38a3, 1,
+     { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 },
+     { "", "", "", "", "" },
+     "NEC PlasmaSync 50MP1",
+     10,   /* DVI entirely unknown */
+     { 0|0x40, 1|0xc0, 2|0xc0, 4|0xc0, 7|0x40, 9|0xc0,10|0xc0,11|0xc0,13|0x40,14|0xc0,
+       0     , 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0       }
+   },
+#endif
+   { 0x38a3, 4,
+     { 0xa482, 0xa483, 0x0000, 0x0000, 0x0000 },
+     { "PX-42VM", "", "", "", "" },
+     "NEC PlasmaSync 42MP3/42MP4/50MP2/61MP1",
+     11,   /* All DVI except 0, 7, 13, 17 */
+     { 0|0x40, 1|0xc0, 2|0xc0, 4|0xc0, 7|0x40, 9|0xc0,10|0xc0,11|0xc0,13|0x40,14|0xc0,
+      17|0x40, 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0       }
+   },
+#if 0  /* Product IDs missing */
+   { 0x38a3, 1,
+     { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 },
+     { "", "", "", "", "" },
+     "NEC PlasmaSync 3300W",
+     3,
+     { 0|0x40, 1|0xc0,18|0xc0, 0     , 0     , 0     , 0     , 0     , 0     , 0     ,
+       0     , 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0       }
+   },
+   { 0x38a3, 1,
+     { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 },
+     { "", "", "", "", "" },
+     "NEC PlasmaSync 4200W",
+     4,   /* DVI entirely unknown */
+     { 0|0x40, 1|0xc0, 2|0xc0, 4|0xc0, 0     , 0     , 0     , 0     , 0     , 0     ,
+       0     , 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0       }
+   },
+   { 0x38a3, 1,
+     { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 },
+     { "", "", "", "", "" },
+     "NEC PlasmaSync 4210W",
+     6,   /* DVI entirely unknown */
+     { 0|0x40, 1|0xc0, 2|0xc0, 4|0xc0, 9|0xc0,11|0xc0, 0     , 0     , 0     , 0     ,
+       0     , 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0       }
+   },
+   { 0x38a3, 1,
+     { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 },
+     { "", "", "", "", "" },
+     "NEC PlasmaSync 5000W",
+     7,   /* DVI entirely unknown */
+     { 0|0x40, 1|0xc0, 2|0xc0, 4|0xc0, 7|0x40, 9|0xc0,11|0xc0, 0     , 0     , 0     ,
+       0     , 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0       }
+   },
+#endif
+   { 0x412f, 2,
+     { 0x000c, 0x000b, 0x0000, 0x0000, 0x0000 },
+     { "", "", "", "", "" },
+     "Pioneer 503CMX/PDA-5002",
+     6,   /* DVI unknown */
+     { 1|0xc0, 2|0xc0, 9|0xc0,11|0xc0,12|0xc0,15|0xc0, 0     , 0     , 0     , 0     ,
+       0     , 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0       }
+   },
+   { 0x34a9, 1,
+     { 0xa00e, 0x0000, 0x0000, 0x0000, 0x0000 },
+     { "", "", "", "", "" },
+     "Panasonic TH-42",
+     5,   /* No DVI output */
+     { 1|0x40, 2|0x40, 4|0x40, 9|0x40,15|0x40, 0     , 0     , 0     , 0     , 0     ,
+       0     , 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0       }
+   },
+   { 0x34a9, 1,
+     { 0xa005, 0x0000, 0x0000, 0x0000, 0x0000 },
+     { "TH-42PW*4", "", "", "", "" },
+     "Panasonic TH-42PW5",
+     1,   /* No special modes otherwise; no DVI. */
+     {20|0x40,19|0x40, 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0     ,
+       0     , 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0       }
+   },
+   { 0x0000 }
+};
+
+USHORT  SiS_GetModeID(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay, int Depth, BOOLEAN FSTN);
+USHORT  SiS_GetModeID_LCD(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay, int Depth, BOOLEAN FSTN,
+                          USHORT CustomT, int LCDwith, int LCDheight);
+USHORT  SiS_GetModeID_TV(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay, int Depth);
+USHORT  SiS_GetModeID_VGA2(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay, int Depth);
+
+void 	SiS_SetReg(SISIOADDRESS port, USHORT index, USHORT data);
+void 	SiS_SetRegByte(SISIOADDRESS port, USHORT data);
+void  	SiS_SetRegShort(SISIOADDRESS port, USHORT data);
+void	SiS_SetRegLong(SISIOADDRESS port, ULONG data);
+UCHAR	SiS_GetReg(SISIOADDRESS port, USHORT index);
+UCHAR 	SiS_GetRegByte(SISIOADDRESS port);
+USHORT	SiS_GetRegShort(SISIOADDRESS port);
+ULONG	SiS_GetRegLong(SISIOADDRESS port);
+void	SiS_SetRegANDOR(SISIOADDRESS Port,USHORT Index,USHORT DataAND,USHORT DataOR);
+void 	SiS_SetRegAND(SISIOADDRESS Port,USHORT Index,USHORT DataAND);
+void	SiS_SetRegOR(SISIOADDRESS Port,USHORT Index,USHORT DataOR);
+void	SiS_DisplayOn(SiS_Private *SiS_Pr);
+void	SiS_DisplayOff(SiS_Private *SiS_Pr);
+void	SiSRegInit(SiS_Private *SiS_Pr, SISIOADDRESS BaseAddr);
+void	SiSSetLVDSetc(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo);
+void	SiS_SetEnableDstn(SiS_Private *SiS_Pr, int enable);
+void	SiS_SetEnableFstn(SiS_Private *SiS_Pr, int enable);
+void	SiS_GetVBType(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo);
+USHORT	SiS_GetMCLK(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo);
+BOOLEAN	SiS_SearchModeID(SiS_Private *SiS_Pr, USHORT *ModeNo, USHORT *ModeIdIndex);
+UCHAR	SiS_GetModePtr(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex);
+USHORT	SiS_GetColorDepth(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex);
+USHORT	SiS_GetOffset(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdIndex,
+              USHORT RefreshRateTableIndex,PSIS_HW_INFO HwInfo);
+void	SiS_LoadDAC(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, USHORT ModeNo, USHORT ModeIdIndex);
+#ifdef LINUX_XF86
+BOOLEAN	SiSSetMode(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,ScrnInfoPtr pScrn,USHORT ModeNo, BOOLEAN dosetpitch);
+BOOLEAN	SiSBIOSSetMode(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, ScrnInfoPtr pScrn,
+               DisplayModePtr mode, BOOLEAN IsCustom);
+BOOLEAN	SiSBIOSSetModeCRT2(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, ScrnInfoPtr pScrn,
+               DisplayModePtr mode, BOOLEAN IsCustom);
+BOOLEAN	SiSBIOSSetModeCRT1(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, ScrnInfoPtr pScrn,
+               DisplayModePtr mode, BOOLEAN IsCustom);
+int	SiSTranslateToVESA(ScrnInfoPtr pScrn, int modenumber);
+BOOLEAN	SiS_GetPanelID(SiS_Private *SiS_Pr, PSIS_HW_INFO);
+USHORT 	SiS_CheckBuildCustomMode(ScrnInfoPtr pScrn, DisplayModePtr mode, int VBFlags);
+DisplayModePtr SiSBuildBuiltInModeList(ScrnInfoPtr pScrn, BOOLEAN includelcdmodes, BOOLEAN isfordvi);
+#else
+BOOLEAN	SiSSetMode(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,USHORT ModeNo);
+#endif
 #ifdef LINUX_KERNEL
-int    sisfb_mode_rate_to_dclock(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,
+int    sisfb_mode_rate_to_dclock(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
 			      unsigned char modeno, unsigned char rateindex);
-int    sisfb_mode_rate_to_ddata(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,
+int    sisfb_mode_rate_to_ddata(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
 			 unsigned char modeno, unsigned char rateindex,
-			 ULONG *left_margin, ULONG *right_margin, 
+			 ULONG *left_margin, ULONG *right_margin,
 			 ULONG *upper_margin, ULONG *lower_margin,
 			 ULONG *hsync_len, ULONG *vsync_len,
 			 ULONG *sync, ULONG *vmode);
+BOOLEAN sisfb_gettotalfrommode(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
+		       unsigned char modeno, int *htotal, int *vtotal, unsigned char rateindex);
+#endif
+
+extern void      SiS_GetVBInfo(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
+			       PSIS_HW_INFO HwInfo, int chkcrt2mode);
+extern void      SiS_GetLCDResInfo(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
+			           PSIS_HW_INFO HwInfo);
+extern void      SiS_SetYPbPr(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo);
+extern void 	 SiS_SetTVMode(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex, PSIS_HW_INFO HwInfo);
+extern void      SiS_UnLockCRT2(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo);
+extern void      SiS_LockCRT2(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo);
+extern void      SiS_DisableBridge(SiS_Private *, PSIS_HW_INFO);
+extern BOOLEAN   SiS_SetCRT2Group(SiS_Private *, PSIS_HW_INFO, USHORT);
+extern USHORT    SiS_GetRatePtr(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
+                                PSIS_HW_INFO HwInfo);
+extern void      SiS_WaitRetrace1(SiS_Private *SiS_Pr);
+extern USHORT    SiS_GetResInfo(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex);
+extern USHORT    SiS_GetCH700x(SiS_Private *SiS_Pr, USHORT tempax);
+extern USHORT    SiS_GetVCLK2Ptr(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
+                                 USHORT RefreshRateTableIndex, PSIS_HW_INFO HwInfo);
+extern BOOLEAN   SiS_IsVAMode(SiS_Private *, PSIS_HW_INFO);
+extern BOOLEAN   SiS_IsDualEdge(SiS_Private *, PSIS_HW_INFO);
+
+#ifdef LINUX_XF86
+extern int      SiS_compute_vclk(int Clock, int *out_n, int *out_dn, int *out_div,
+	     	 		 int *out_sbit, int *out_scale);
+extern void 	SiSCalcClock(ScrnInfoPtr pScrn, int clock, int max_VLD, unsigned int *vclk);
+
+extern unsigned char SiS_GetSetBIOSScratch(ScrnInfoPtr pScrn, USHORT offset, unsigned char value);
+extern unsigned char SiS_GetSetModeID(ScrnInfoPtr pScrn, unsigned char id);
+extern USHORT 	     SiS_CalcModeIndex(ScrnInfoPtr pScrn, DisplayModePtr mode, unsigned long VBFlags,
+					BOOLEAN hcm);
 #endif
 
 #endif
--- diff/drivers/video/sis/init301.c	2004-01-19 10:22:59.000000000 +0000
+++ source/drivers/video/sis/init301.c	2004-02-09 10:39:55.000000000 +0000
@@ -1,45 +1,60 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/init301.c,v 1.3 2002/22/04 01:16:16 dawes Exp $ */
+/* $XFree86$ */
 /*
- * Mode switching code (CRT2 section) for SiS 300/540/630/730/315/550/650/740/330
- * (Universal module for Linux kernel framebuffer, XFree86 4.x)
+ * Mode initializing code (CRT2 section)
+ * for SiS 300/305/540/630/730 and
+ *     SiS 315/550/650/M650/651/661FX/M661xX/740/741/M741/330/660/M660/760/M760
+ * (Universal module for Linux kernel framebuffer and XFree86 4.x)
  *
- * Assembler-To-C translation
- * Copyright 2002, 2003 by Thomas Winischhofer <thomas@winischhofer.net>
- * Minor parts Copyright SiS, Inc.
+ * Copyright (C) 2001-2004 by Thomas Winischhofer, Vienna, Austria
  *
- * Based on BIOS
- *     1.10.07, 1.10a for 650/CH7019
- *     1.11.21a for 740/CH7019
- *     1.11.05 for 650/LVDS (w/o Chrontel)
- *     1.07.1b, 1.10.6s, 1.11.6w, 1.11.7w, 1.11.8r for 650/301(B/LV), 650/302LV
- *     2.04.50 (I) and 2.04.5c (II) for 630/301(B)
- *     2.02.3b, 2.03.02, 2.04.2c, 2.04.5c, 2.07a and 2.08.b3 for 630/LVDS/LVDS+CH7005
- *     2.04.5c, 2.04.6c for 730+LVDS+CH7005
- *     1.09b for 315/301(B)
- *     1.16.51 for 300+301LV (ECS A907)
- *     1.01.03 for 330 (Xabre 400)
+ * If distributed as part of the Linux kernel, the following license terms
+ * apply:
  *
- * Known bugs:
- *   1024x768 panel, expanding (CR37=1): Mode 640x480 does not work on SOME panels
- *       therefore, we always do the scaling ourselves for now.
+ * * 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 named License,
+ * * or 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
  *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of the copyright holder not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission.  The copyright holder makes no representations
- * about the suitability of this software for any purpose.  It is provided
- * "as is" without express or implied warranty.
+ * Otherwise, the following license terms apply:
  *
- * THE COPYRIGHT HOLDER DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR 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.
+ * * 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) All advertising materials mentioning features or use of this software
+ * *    must display the following acknowledgement: "This product includes
+ * *    software developed by Thomas Winischhofer, Vienna, Austria."
+ * * 4) The name of the author may not be used to endorse or promote products
+ * *    derived from this software without specific prior written permission.
+ * *
+ * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
+ *
+ * Author: 	Thomas Winischhofer <thomas@winischhofer.net>
+ *
+ * Formerly based on non-functional code-fragements for 300 series by SiS, Inc.
+ * Used by permission.
  *
  * TW says: This code looks awful, I know. But please don't do anything about
  * this otherwise debugging will be hell.
@@ -47,14 +62,18 @@
  * video bridges and combinations thereof. If anything is changed, extreme
  * care has to be taken that that change doesn't break it for other chipsets,
  * bridges or combinations thereof.
- * All comments in this file are by me, regardless if they are marked TW or not.
+ * All comments in this file are by me, regardless if marked TW or not.
  *
  */
- 
-#if 1 
-#define NEWCH701x
+
+#if 1
+#define SET_EMI		/* 302LV/ELV: Set EMI values */
 #endif
 
+#define COMPAL_HACK	/* Needed for Compal 1400x1050 (EMI) */
+#define COMPAQ_HACK	/* Needed for Inventec/Compaq 1280x1024 (EMI) */
+#define ASUS_HACK	/* Needed for Asus A2H 1024x768 (EMI) */
+
 #include "init301.h"
 
 #if 0
@@ -72,2563 +91,3451 @@
 #define SiS_I2CDELAY      1000
 #define SiS_I2CDELAYSHORT  150
 
-BOOLEAN
-SiS_SetCRT2Group301(SiS_Private *SiS_Pr, USHORT BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,
-                    PSIS_HW_DEVICE_INFO HwDeviceExtension)
+/*********************************************/
+/*         HELPER: Lock/Unlock CRT2          */
+/*********************************************/
+
+void
+SiS_UnLockCRT2(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
 {
-   USHORT ModeIdIndex;
-   USHORT RefreshRateTableIndex;
+  if(HwInfo->jChipType >= SIS_315H)
+     SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2f,0x01);
+  else
+     SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x24,0x01);
+}
 
-   SiS_Pr->SiS_SetFlag |= ProgrammingCRT2;
+void
+SiS_LockCRT2(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
+{
+  if(HwInfo->jChipType >= SIS_315H)
+     SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2F,0xFE);
+  else
+     SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x24,0xFE);
+}
 
-   if(!SiS_Pr->UseCustomMode) {
-      SiS_SearchModeID(SiS_Pr,ROMAddr,&ModeNo,&ModeIdIndex);
-   } else {
-      ModeIdIndex = 0;
-   }      
+/*********************************************/
+/*            HELPER: Enable CRT2            */
+/*********************************************/
 
-   /* TW: Used for shifting CR33 */
-   SiS_Pr->SiS_SelectCRT2Rate = 4;
+void
+SiS_EnableCRT2(SiS_Private *SiS_Pr)
+{
+  SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20);
+}
 
-   SiS_UnLockCRT2(SiS_Pr, HwDeviceExtension, BaseAddr);
+/*********************************************/
+/*            HELPER: Write SR11             */
+/*********************************************/
 
-   RefreshRateTableIndex = SiS_GetRatePtrCRT2(SiS_Pr, ROMAddr,ModeNo,ModeIdIndex,HwDeviceExtension);
+static void
+SiS_SetRegSR11ANDOR(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, USHORT DataAND, USHORT DataOR)
+{
+   if(HwInfo->jChipType >= SIS_661) DataAND &= 0x0f;
+   SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x11,DataAND,DataOR);
+}
 
-   SiS_SaveCRT2Info(SiS_Pr,ModeNo);
+/*********************************************/
+/*    HELPER: Get Pointer to LCD structure   */
+/*********************************************/
 
-   if(SiS_LowModeStuff(SiS_Pr,ModeNo,HwDeviceExtension)) {
-      SiS_DisableBridge(SiS_Pr,HwDeviceExtension,BaseAddr);
-      if((SiS_Pr->SiS_IF_DEF_LVDS == 1) && (HwDeviceExtension->jChipType == SIS_730)) {
-         SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x00,0x80);
-      }
-      SiS_SetCRT2ModeRegs(SiS_Pr,BaseAddr,ModeNo,ModeIdIndex,HwDeviceExtension);
-   }
+/* For 661 series only */
+#ifdef SIS315H
+#if 0   /* Need to wait until hardware using this really exists */
+static UCHAR *
+GetLCDPtr661(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, int tabletype,
+             USHORT ModeNo, USHORT ModeIdIndex, USHORT RRTI)
+{
+  UCHAR *ROMAddr =  HwInfo->pjVirtualRomBase;
+  UCHAR *tableptr = NULL;
+  UCHAR tablelengths[] = { 8, 7, 6, 6, 8, 6, 0, 0, 0 };
+  USHORT modeflag, CRT2Index, tablelength, lcdid, myid, tableptri;
 
-   if(SiS_Pr->SiS_VBInfo & DisableCRT2Display) {
-      SiS_LockCRT2(SiS_Pr,HwDeviceExtension, BaseAddr);
-      SiS_DisplayOn(SiS_Pr);
-      return(TRUE);
-   }
+  if(ModeNo <= 0x13) {
+     modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
+     CRT2Index = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC;
+  } else {
+     modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
+     CRT2Index = SiS_Pr->SiS_RefIndex[RRTI].Ext_CRT2CRTC;
+     /* This is total bullshit: */
+     if(SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO == SIS_RI_720x576) CRT2Index = 10;
+  }
 
-   if(SiS_Pr->UseCustomMode) return(FALSE);
-   
-   SiS_GetCRT2Data(SiS_Pr,ROMAddr,ModeNo,ModeIdIndex,RefreshRateTableIndex,
-                   HwDeviceExtension);
+  if(tabletype <= 1) {
+#if 0	/* Not yet implemented */
+     if(ModeNo <= 0x13) {
+        CRT2Index = SiS_Pr->SiS_SModeIDTable[ModeIdIndex]. + 5;
+     } else {
+        CRT2Index = SiS_Pr->SiS_RefIndex[RRTI]. + 5;
+     }
+     if(tabletype & 1) CRT2Index >>= 4;
+#endif
+  }
 
-   /* Set up Panel Link for LVDS, 301BDH and 650/30xLV(for LCDA) */
-   if( (SiS_Pr->SiS_IF_DEF_LVDS == 1) ||
-       ((SiS_Pr->SiS_VBType & VB_NoLCD) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD)) ||
-       ((HwDeviceExtension->jChipType >= SIS_315H) && (SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV)) ) {
-   	SiS_GetLVDSDesData(SiS_Pr,ROMAddr,ModeNo,ModeIdIndex,RefreshRateTableIndex,
-	                   HwDeviceExtension);
+  CRT2Index &= 0x0f;
+
+  tablelength = tablelengths[tabletype];
+  if(SiS_Pr->SiS_LCDInfo & LCDPass11) {
+     if((tabletype == 5) || (tabletype == 7)) tablelength = 8;
+     if((tabletype == 3) || (tabletype == 8)) tablelength = 8;
+  }
+
+  if(!tablelength) return NULL;
+
+  tableptri = ROMAddr[0x222] | (ROMAddr[0x223] << 8);
+  tableptri += (tabletype << 1);
+  if(!tableptri) return NULL;
+  tableptr = &ROMAddr[tableptri];
+
+  do {
+     lcdid = tableptr[0];
+     if(lcdid == 0xff) break;
+     myid = SiS_Pr->SiS_LCDResInfo;
+     if((lcdid & 0x80) && (lcdid != 0x80)) {
+        lcdid &= 0x7f;
+	myid = SiS_Pr->SiS_LCDTypeInfo;
+     }
+     if(SiS_Pr->SiS_LCDInfo & LCDPass11) myid &= ~0x1f;
+
+     if(myid == lcdid) {
+	lcdid = tableptr[1] | (tableptr[2] << 8);
+	myid = SiS_Pr->SiS_LCDInfo661;
+	if(modeflag & HalfDCLK) myid |= 0x200;
+	if(ModeNo <= 0x13)      myid |= 0x400;
+	lcdid &= myid;
+	myid = tableptr[3] | (tableptr[4] << 8);
+	if(lcdid == myid) break;
+     }
+     tableptr += 7;
+  } while (1);
+
+  if(lcdid == myid) {
+     lcdid = tableptr[5] | (tableptr[6] << 8);
+     lcdid += (tablelength * CRT2Index);
+     return((UCHAR *)&ROMAddr[lcdid]);
+  }
+
+  return NULL;
+}
+#endif
+
+static UCHAR *
+GetLCDStructPtr661(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
+{
+   UCHAR  *ROMAddr = HwInfo->pjVirtualRomBase;
+   USHORT lcdres = SiS_Pr->SiS_LCDResInfo;
+   USHORT lcdtype = SiS_Pr->SiS_LCDTypeInfo;
+   USHORT romindex=0;
+   UCHAR  *myptr = NULL;
+   UCHAR  lcdid;
+
+   if((ROMAddr) && SiS_Pr->SiS_UseROM) {
+      romindex = ROMAddr[0x256] | (ROMAddr[0x257] << 8);
+   }
+   if(romindex) {
+      myptr = &ROMAddr[romindex];
    } else {
-        SiS_Pr->SiS_LCDHDES = SiS_Pr->SiS_LCDVDES = 0;
+      myptr = (UCHAR *)SiS_LCDStruct661;
    }
 
-#ifdef LINUX_XF86
-#ifdef TWDEBUG
-  xf86DrvMsg(0, X_INFO, "(init301: LCDHDES 0x%03x LCDVDES 0x%03x)\n", SiS_Pr->SiS_LCDHDES, SiS_Pr->SiS_LCDVDES);
-  xf86DrvMsg(0, X_INFO, "(init301: HDE     0x%03x VDE     0x%03x)\n", SiS_Pr->SiS_HDE, SiS_Pr->SiS_VDE);
-  xf86DrvMsg(0, X_INFO, "(init301: VGAHDE  0x%03x VGAVDE  0x%03x)\n", SiS_Pr->SiS_VGAHDE, SiS_Pr->SiS_VGAVDE);
-  xf86DrvMsg(0, X_INFO, "(init301: HT      0x%03x VT      0x%03x)\n", SiS_Pr->SiS_HT, SiS_Pr->SiS_VT);
-  xf86DrvMsg(0, X_INFO, "(init301: VGAHT   0x%03x VGAVT   0x%03x)\n", SiS_Pr->SiS_VGAHT, SiS_Pr->SiS_VGAVT);
-#endif
+   while(myptr[0] != 0xff) {
+      lcdid = myptr[0];
+      if((lcdid & 0x80) && (lcdid != 0x80)) {
+         lcdres = lcdtype;
+	 lcdid &= 0x7f;
+      }
+      if(lcdid == lcdres) break;
+      myptr += 26;
+   }
+   if(myptr[0] == 0xff) return NULL;
+
+   return myptr;
+}
 #endif
 
-   if(SiS_LowModeStuff(SiS_Pr,ModeNo,HwDeviceExtension)) {
-      SiS_SetGroup1(SiS_Pr,BaseAddr,ROMAddr,ModeNo,ModeIdIndex,
-                    HwDeviceExtension,RefreshRateTableIndex);
-   }
+/*********************************************/
+/*           Adjust Rate for CRT2            */
+/*********************************************/
 
-   if(SiS_Pr->SiS_IF_DEF_LVDS == 0) {
+static BOOLEAN
+SiS_AdjustCRT2Rate(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
+                   USHORT RefreshRateTableIndex, USHORT *i,
+		   PSIS_HW_INFO HwInfo)
+{
+  USHORT tempax,tempbx,infoflag;
 
-        if(SiS_LowModeStuff(SiS_Pr,ModeNo,HwDeviceExtension)) {
+  tempbx = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex + (*i)].ModeID;
 
-	   SiS_SetGroup2(SiS_Pr,BaseAddr,ROMAddr,ModeNo,ModeIdIndex,
-	                 RefreshRateTableIndex,HwDeviceExtension);
-      	   SiS_SetGroup3(SiS_Pr,BaseAddr,ROMAddr,ModeNo,ModeIdIndex,
-	                 HwDeviceExtension);
-      	   SiS_SetGroup4(SiS_Pr,BaseAddr,ROMAddr,ModeNo,ModeIdIndex,
-	                 RefreshRateTableIndex,HwDeviceExtension);
-      	   SiS_SetGroup5(SiS_Pr,HwDeviceExtension, BaseAddr,ROMAddr,
-	                 ModeNo,ModeIdIndex);
+  tempax = 0;
 
-	   /* TW: For 301BDH (Panel link initialization): */
-	   if((SiS_Pr->SiS_VBType & VB_NoLCD) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD)) {
-	      if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel640x480) {	 
-		 if(!((SiS_Pr->SiS_SetFlag & SetDOSMode) && ((ModeNo == 0x03) || (ModeNo = 0x10)))) {
-		    if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) {
-		       SiS_ModCRT1CRTC(SiS_Pr,ROMAddr,ModeNo,ModeIdIndex,
-		                       RefreshRateTableIndex,HwDeviceExtension);
-		    }
-                 }
-	      }
-	      SiS_SetCRT2ECLK(SiS_Pr,ROMAddr,ModeNo,ModeIdIndex,
-		              RefreshRateTableIndex,HwDeviceExtension);
-	   }
-        }
+  if(SiS_Pr->SiS_VBType & VB_SISVB) {
 
-   } else {
+     if(SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC) {
 
-        if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel640x480) {
-	   if(SiS_Pr->SiS_IF_DEF_TRUMPION == 0) {
-    	      SiS_ModCRT1CRTC(SiS_Pr,ROMAddr,ModeNo,ModeIdIndex,
-	                      RefreshRateTableIndex,HwDeviceExtension);
+      	tempax |= SupportRAMDAC2;
+	if(HwInfo->jChipType >= SIS_315H) {
+	   tempax |= SupportRAMDAC2_135;
+	   if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
+	      tempax |= SupportRAMDAC2_162;
+	      if(SiS_Pr->SiS_VBType & VB_SIS301C) {
+		 tempax |= SupportRAMDAC2_202;
+	      }
 	   }
 	}
-        if(SiS_Pr->SiS_IF_DEF_FSTN == 0) {
-     	   SiS_SetCRT2ECLK(SiS_Pr,ROMAddr,ModeNo,ModeIdIndex,
-	 	           RefreshRateTableIndex,HwDeviceExtension);
-	}
-	if(SiS_LowModeStuff(SiS_Pr,ModeNo,HwDeviceExtension)) {
-     	   if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) {
-	      if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) {
-	         if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) {
-#ifdef SIS315H		 
-		    SiS_SetCH701xForLCD(SiS_Pr,HwDeviceExtension,BaseAddr);
-#endif		    
+
+     } else if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) {
+
+     	tempax |= SupportLCD;
+	if(HwInfo->jChipType >= SIS_315H) {
+	   if(SiS_Pr->SiS_VBType & VB_SIS301B302B) {
+	      if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) {
+	         if(tempbx == 0x2e) {  /* 640x480 */
+		    tempax |= Support64048060Hz;
 		 }
 	      }
-	      if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
-       		 SiS_SetCHTVReg(SiS_Pr,ROMAddr,ModeNo,ModeIdIndex,
-		               RefreshRateTableIndex);
-	      }
-     	   }
+	   }
 	}
 
-   }
+     } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) {
 
-#ifdef SIS300
-   if ( (HwDeviceExtension->jChipType == SIS_540) ||
-        (HwDeviceExtension->jChipType == SIS_630) ||
-        (HwDeviceExtension->jChipType == SIS_730) ||
-        (HwDeviceExtension->jChipType == SIS_300) )
-    {
-	if(SiS_LowModeStuff(SiS_Pr,ModeNo,HwDeviceExtension)) {
-	   if(SiS_Pr->SiS_UseOEM) {
-	      if((SiS_Pr->SiS_UseROM) && ROMAddr && (SiS_Pr->SiS_UseOEM == -1)) {
-	         if((ROMAddr[0x233] == 0x12) && (ROMAddr[0x234] == 0x34)) {
-	            SiS_OEM300Setting(SiS_Pr,HwDeviceExtension,BaseAddr,ROMAddr,ModeNo);
-	         }
-	      } else {
-       	         SiS_OEM300Setting(SiS_Pr,HwDeviceExtension,BaseAddr,ROMAddr,ModeNo);
-	      }
-	   }
+      	tempax |= SupportHiVision;
+
+     } else if(SiS_Pr->SiS_VBInfo & (SetCRT2ToYPbPr525750|SetCRT2ToAVIDEO|SetCRT2ToSVIDEO|SetCRT2ToSCART)) {
+
+        tempax |= SupportTV;
+	if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
+	   tempax |= SupportTV1024;
 	}
-    }
-#endif
 
-#ifdef SIS315H
-   if ( (HwDeviceExtension->jChipType == SIS_315H)  ||
-        (HwDeviceExtension->jChipType == SIS_315)   ||
-	(HwDeviceExtension->jChipType == SIS_315PRO)||
-        (HwDeviceExtension->jChipType == SIS_550)   ||
-        (HwDeviceExtension->jChipType == SIS_740)   ||
-        (HwDeviceExtension->jChipType == SIS_650)   ||
-	(HwDeviceExtension->jChipType == SIS_330) )
-   {
-        if(SiS_LowModeStuff(SiS_Pr,ModeNo,HwDeviceExtension)) {
-	   SiS_FinalizeLCD(SiS_Pr,BaseAddr,ROMAddr,ModeNo,ModeIdIndex, HwDeviceExtension);
-#if 0      /* Instead of FinalizeLCD(), older BIOSes (A92x) used OEMLCD() */
-	   SiS_OEMLCD(SiS_Pr,HwDeviceExtension,BaseAddr,ROMAddr,ModeNo,ModeIdIndex);
-#endif
-           if(SiS_Pr->SiS_UseOEM) {
-              SiS_OEM310Setting(SiS_Pr,HwDeviceExtension,BaseAddr,ROMAddr,ModeNo,ModeIdIndex);
-           }
-           SiS_CRT2AutoThreshold(SiS_Pr,BaseAddr);
-        }
-   }
-#endif
+     }
 
-   if(HwDeviceExtension->jChipType < SIS_315H) {
-      if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
-          if(HwDeviceExtension->jChipType != SIS_730) {
-             SiS_DisplayOn(SiS_Pr);
-	  }
-      }
-   }
+  } else {	/* for LVDS  */
 
-   if(SiS_LowModeStuff(SiS_Pr,ModeNo,HwDeviceExtension)) {
-      if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
-         if(HwDeviceExtension->jChipType == SIS_730) {
-            SiS_DisplayOn(SiS_Pr);
-	 }
-      }
-      SiS_EnableBridge(SiS_Pr,HwDeviceExtension,BaseAddr);
-   }
+     if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) {
+     	if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
+           tempax |= SupportCHTV;
+      	}
+     }
 
-   SiS_DisplayOn(SiS_Pr);
+     if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
+     	tempax |= SupportLCD;
+     }
 
-   if(SiS_Pr->SiS_IF_DEF_CH70xx == 1) {
-	if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
-	     /* TW: Disable LCD panel when using TV */
-	     SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x11,0x0C);
-	} else {
-	     /* TW: Disable TV when using LCD */
-	     SiS_SetCH70xxANDOR(SiS_Pr,0x010E,0xF8);
-	}
-   }
+  }
 
-   if(SiS_LowModeStuff(SiS_Pr,ModeNo,HwDeviceExtension)) {
-      SiS_LockCRT2(SiS_Pr,HwDeviceExtension, BaseAddr);
-   }
+  /* Look backwards in table for matching CRT2 mode */
+  for(; SiS_Pr->SiS_RefIndex[RefreshRateTableIndex+(*i)].ModeID == tempbx; (*i)--) {
+     infoflag = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex + (*i)].Ext_InfoFlag;
+     if(infoflag & tempax) return(1);
+     if((*i) == 0) break;
+  }
 
-   return 1;
+  /* Look through the whole mode-section of the table from the beginning
+   * for a matching CRT2 mode if no mode was found yet.
+   */
+  for((*i) = 0; ; (*i)++) {
+     if(SiS_Pr->SiS_RefIndex[RefreshRateTableIndex + (*i)].ModeID != tempbx) {
+     	return(0);
+     }
+     infoflag = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex + (*i)].Ext_InfoFlag;
+     if(infoflag & tempax) return(1);
+  }
+  return(1);
 }
 
-BOOLEAN
-SiS_LowModeStuff(SiS_Private *SiS_Pr, USHORT ModeNo,
-                 PSIS_HW_DEVICE_INFO HwDeviceExtension)
+/*********************************************/
+/*              Get rate pointer             */
+/*********************************************/
+
+USHORT
+SiS_GetRatePtr(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
+               PSIS_HW_INFO HwInfo)
 {
-    USHORT temp,temp1,temp2;
+  SHORT  LCDRefreshIndex[] = { 0x00, 0x00, 0x01, 0x01,
+                               0x01, 0x01, 0x01, 0x01,
+			       0x01, 0x01, 0x01, 0x01,
+			       0x01, 0x01, 0x01, 0x01,
+			       0x00, 0x00, 0x00, 0x00 };
+  USHORT RefreshRateTableIndex,i,backup_i;
+  USHORT modeflag,index,temp,backupindex;
 
-    if((ModeNo != 0x03) && (ModeNo != 0x10) && (ModeNo != 0x12))
-         return(1);
-    temp = SiS_GetReg1(SiS_Pr->SiS_P3d4,0x11);
-    SiS_SetRegOR(SiS_Pr->SiS_P3d4,0x11,0x80);
-    temp1 = SiS_GetReg1(SiS_Pr->SiS_P3d4,0x00);
-    SiS_SetReg1(SiS_Pr->SiS_P3d4,0x00,0x55);
-    temp2 = SiS_GetReg1(SiS_Pr->SiS_P3d4,0x00);
-    SiS_SetReg1(SiS_Pr->SiS_P3d4,0x00,temp1);
-    SiS_SetReg1(SiS_Pr->SiS_P3d4,0x11,temp);
-    if((HwDeviceExtension->jChipType >= SIS_315H) ||
-       (HwDeviceExtension->jChipType == SIS_300)) {
-       if(temp2 == 0x55) return(0);
-       else return(1);
-    } else {
-       if(temp2 != 0x55) return(1);
-       else {
-          SiS_SetRegOR(SiS_Pr->SiS_P3d4,0x35,0x01);
-          return(0);
-       }
-    }
-}
+  /* Do NOT check for UseCustomMode here, will skrew up FIFO */
+  if(ModeNo == 0xfe) return 0;
 
-/* TW: Set Part1 registers */
-void
-SiS_SetGroup1(SiS_Private *SiS_Pr,USHORT BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,
-              USHORT ModeIdIndex,PSIS_HW_DEVICE_INFO HwDeviceExtension,
-	      USHORT RefreshRateTableIndex)
-{
-  USHORT  temp=0, tempax=0, tempbx=0, tempcx=0;
-  USHORT  pushbx=0, CRT1Index=0;
-#ifdef SIS315H
-  USHORT  pushcx=0, tempbl=0;
-#endif
-  USHORT  modeflag, resinfo=0;
+  if(ModeNo <= 0x13)
+     modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
+  else
+     modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
 
-  if(ModeNo<=0x13) {
-	modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
-  } else {
-    	CRT1Index = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT1CRTC;
-    	resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO;
-	modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
+  if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) {
+     if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
+     	if(modeflag & HalfDCLK) return(0);
+     }
   }
 
-  if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) {
+  if(ModeNo < 0x14) return(0xFFFF);
 
-	   SiS_SetCRT2Sync(SiS_Pr,BaseAddr,ROMAddr,ModeNo,
-                           RefreshRateTableIndex,HwDeviceExtension);
-#ifdef SIS315H
-	   SiS_SetGroup1_LCDA(SiS_Pr,BaseAddr,ROMAddr,ModeNo,ModeIdIndex,
-     	                      HwDeviceExtension,RefreshRateTableIndex);
-#endif
-  } else {
+  /* CR33 holds refresh rate index for CRT1 [3:0] and CRT2 [7:4]. */
 
-     if( (HwDeviceExtension->jChipType >= SIS_315H) &&
-         (SiS_Pr->SiS_IF_DEF_LVDS == 1) &&
-	 (SiS_Pr->SiS_VBInfo & SetInSlaveMode)) {
+  index = (SiS_GetReg(SiS_Pr->SiS_P3d4,0x33) >> SiS_Pr->SiS_SelectCRT2Rate) & 0x0F;
+  backupindex = index;
 
-        SiS_SetCRT2Sync(SiS_Pr,BaseAddr,ROMAddr,ModeNo,
-                        RefreshRateTableIndex,HwDeviceExtension);
+  if(index > 0) index--;
 
+  if(SiS_Pr->SiS_SetFlag & ProgrammingCRT2) {
+     if(SiS_Pr->SiS_VBType & VB_SISVB) {
+        if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
+	   if(SiS_Pr->SiS_VBType & VB_NoLCD)		index = 0;
+	   else if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) index = backupindex = 0;
+	}
+	if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) {
+	   if(!(SiS_Pr->SiS_VBType & VB_NoLCD)) {
+              temp = LCDRefreshIndex[SiS_Pr->SiS_LCDResInfo];
+              if(index > temp) index = temp;
+	   }
+	}
      } else {
+        if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) index = 0;
+	if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) {
+           if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) index = 0;
+        }
+     }
+  }
 
-        SiS_SetCRT2Offset(SiS_Pr,ROMAddr,ModeNo,ModeIdIndex,
-      		          RefreshRateTableIndex,HwDeviceExtension);
+  RefreshRateTableIndex = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].REFindex;
+  ModeNo = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].ModeID;
 
-        if (HwDeviceExtension->jChipType < SIS_315H ) {
-#ifdef SIS300
-    	      SiS_SetCRT2FIFO_300(SiS_Pr,ROMAddr,ModeNo,HwDeviceExtension);
-#endif
-        } else {
-#ifdef SIS315H
-              SiS_SetCRT2FIFO_310(SiS_Pr,ROMAddr,ModeNo,HwDeviceExtension);
-#endif
-	}
+  if(HwInfo->jChipType >= SIS_315H) {
+     if(!(SiS_Pr->SiS_VBInfo & DriverMode)) {
+        if( (SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_VESAID == 0x105) ||
+            (SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_VESAID == 0x107) ) {
+           if(backupindex <= 1) RefreshRateTableIndex++;
+        }
+     }
+  }
 
-        SiS_SetCRT2Sync(SiS_Pr,BaseAddr,ROMAddr,ModeNo,
-                        RefreshRateTableIndex,HwDeviceExtension);
+  i = 0;
+  do {
+     if(SiS_Pr->SiS_RefIndex[RefreshRateTableIndex + i].ModeID != ModeNo) break;
+     temp = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex + i].Ext_InfoFlag;
+     temp &= ModeInfoFlag;
+     if(temp < SiS_Pr->SiS_ModeType) break;
+     i++;
+     index--;
+  } while(index != 0xFFFF);
 
-	/* 1. Horizontal setup */
+  if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC)) {
+     if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) {
+      	temp = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex + i - 1].Ext_InfoFlag;
+      	if(temp & InterlaceMode) i++;
+     }
+  }
 
-        if (HwDeviceExtension->jChipType < SIS_315H ) {
+  i--;
 
-#ifdef SIS300   /* ------------- 300 series --------------*/
+  if((SiS_Pr->SiS_SetFlag & ProgrammingCRT2) && (!(SiS_Pr->SiS_VBInfo & DisableCRT2Display))) {
+     backup_i = i;
+     if(!(SiS_AdjustCRT2Rate(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, &i, HwInfo))) {
+	i = backup_i;
+     }
+  }
 
-    		temp = (SiS_Pr->SiS_VGAHT - 1) & 0x0FF;   			/* BTVGA2HT 0x08,0x09 */
-    		SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x08,temp);                   /* TW: CRT2 Horizontal Total */
+  return(RefreshRateTableIndex + i);
+}
 
-    		temp = (((SiS_Pr->SiS_VGAHT - 1) & 0xFF00) >> 8) << 4;
-    		SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x09,0x0f,temp);          /* TW: CRT2 Horizontal Total Overflow [7:4] */
+/*********************************************/
+/*            STORE CRT2 INFO in CR34        */
+/*********************************************/
 
-    		temp = (SiS_Pr->SiS_VGAHDE + 12) & 0x0FF;                       /* BTVGA2HDEE 0x0A,0x0C */
-    		SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x0A,temp);                   /* TW: CRT2 Horizontal Display Enable End */
+static void
+SiS_SaveCRT2Info(SiS_Private *SiS_Pr, USHORT ModeNo)
+{
+  USHORT temp1,temp2;
 
-    		pushbx = SiS_Pr->SiS_VGAHDE + 12;                               /* bx  BTVGA@HRS 0x0B,0x0C */
-    		tempcx = (SiS_Pr->SiS_VGAHT - SiS_Pr->SiS_VGAHDE) >> 2;
-    		tempbx = pushbx + tempcx;
-    		tempcx <<= 1;
-    		tempcx += tempbx;
+  /* Store CRT1 ModeNo in CR34 */
+  SiS_SetReg(SiS_Pr->SiS_P3d4,0x34,ModeNo);
+  temp1 = (SiS_Pr->SiS_VBInfo & SetInSlaveMode) >> 8;
+  temp2 = ~(SetInSlaveMode >> 8);
+  SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x31,temp2,temp1);
+}
 
-    		if(SiS_Pr->SiS_IF_DEF_LVDS == 0) {
-      			if(SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC){
-			        /* CRT1Index &= 0x3F; - Not any longer */
-        			tempbx = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[4];
-        			tempbx |= ((SiS_Pr->SiS_CRT1Table[CRT1Index].CR[14] & 0xC0) << 2);
-        			tempbx = (tempbx - 1) << 3;
-        			tempcx = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[5];
-        			tempcx &= 0x1F;
-        			temp = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[15];
-        			temp = (temp & 0x04) << (6-2);
-        			tempcx = (tempcx | temp);
-				tempcx--;
-				tempcx <<= 3;
-      			}
-
-    			if((SiS_Pr->SiS_VBInfo & SetCRT2ToTV) && (resinfo == 0x08)){
-        			if(!(SiS_Pr->SiS_VBInfo & SetPALTV)){
-      					tempbx = 1040;
-      					tempcx = 1042;
-      				}
-    			}
-	        }
+/*********************************************/
+/*    HELPER: GET SOME DATA FROM BIOS ROM    */
+/*********************************************/
 
-    		temp = tempbx & 0x00FF;
-    		SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x0B,temp);                   /* TW: CRT2 Horizontal Retrace Start */
-#endif /* SIS300 */
+static BOOLEAN
+SiS_CR36BIOSWord23b(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
+{
+  USHORT temp,temp1;
+  UCHAR *ROMAddr;
 
- 	} else {
+  if((ROMAddr = (UCHAR *)HwInfo->pjVirtualRomBase) && SiS_Pr->SiS_UseROM) {
+     if((ROMAddr[0x233] == 0x12) && (ROMAddr[0x234] == 0x34)) {
+        temp = 1 << ((SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) & 0xff) >> 4);
+        temp1 = (ROMAddr[0x23c] << 8) | ROMAddr[0x23b];
+        if(temp1 & temp) return(1);
+     }
+  }
+  return(0);
+}
 
-#ifdef SIS315H  /* ----------------- 310/325/330 series ------------- */
-
-	        tempcx = SiS_Pr->SiS_VGAHT;				       /* BTVGA2HT 0x08,0x09 */
-		pushcx = tempcx;
-		if(modeflag & HalfDCLK) {
-#ifndef NEWCH701x		
-		    if((SiS_Pr->SiS_IF_DEF_LVDS == 1) && (SiS_Pr->SiS_IF_DEF_CH70xx == 0)) {
-#endif		    
-		          tempax = SiS_Pr->SiS_VGAHDE >> 1;
-			  tempcx = SiS_Pr->SiS_HT - SiS_Pr->SiS_HDE + tempax;
-			  if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) {
-			      tempcx = SiS_Pr->SiS_HT - tempax;
-			  }
-#ifndef NEWCH701x					  
-		    } else {
-			  tempcx >>= 1;
-		    }
-#endif		    
-		}
-		tempcx--;
+static BOOLEAN
+SiS_CR36BIOSWord23d(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
+{
+  USHORT temp,temp1;
+  UCHAR *ROMAddr;
 
-		temp = tempcx & 0xff;
-		SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x08,temp);                  /* TW: CRT2 Horizontal Total */
+  if((ROMAddr = (UCHAR *)HwInfo->pjVirtualRomBase) && SiS_Pr->SiS_UseROM) {
+     if((ROMAddr[0x233] == 0x12) && (ROMAddr[0x234] == 0x34)) {
+        temp = 1 << ((SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) & 0xff) >> 4);
+        temp1 = (ROMAddr[0x23e] << 8) | ROMAddr[0x23d];
+        if(temp1 & temp) return(1);
+     }
+  }
+  return(0);
+}
 
-		temp = ((tempcx & 0xff00) >> 8) << 4;
-		SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x09,0x0F,temp);         /* TW: CRT2 Horizontal Total Overflow [7:4] */
+/*********************************************/
+/*          HELPER: DELAY FUNCTIONS          */
+/*********************************************/
 
-		tempcx = pushcx;					       /* BTVGA2HDEE 0x0A,0x0C */
-		tempbx = SiS_Pr->SiS_VGAHDE;
-		tempcx -= tempbx;
-		tempcx >>= 2;
-		if(modeflag & HalfDCLK) {
-		    tempbx >>= 1;
-		    tempcx >>= 1;
-		}
-		tempbx += 16;
+void
+SiS_DDC2Delay(SiS_Private *SiS_Pr, USHORT delaytime)
+{
+  USHORT i, j;
 
-		temp = tempbx & 0xff;
-		SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x0A,temp);                  /* TW: CRT2 Horizontal Display Enable End */
+  for(i=0; i<delaytime; i++) {
+     j += SiS_GetReg(SiS_Pr->SiS_P3c4,0x05);
+  }
+}
 
-		pushbx = tempbx;
-		tempcx >>= 1;
-		tempbx += tempcx;
-		tempcx += tempbx;
+static void
+SiS_GenericDelay(SiS_Private *SiS_Pr, USHORT delay)
+{
+  USHORT temp,flag;
 
-		if(SiS_Pr->SiS_IF_DEF_LVDS==0) {
-             	   if(SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC) {
-                	tempbx = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[4];
-                	tempbx |= ((SiS_Pr->SiS_CRT1Table[CRT1Index].CR[14] & 0xC0) << 2);
-                	tempbx = (tempbx - 3) << 3;         		/*(VGAHRS-3)*8 */
-                	tempcx = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[5];
-               		tempcx &= 0x1F;
-                	temp = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[15];
-                	temp = (temp & 0x04) << (5-2);      		/* VGAHRE D[5] */
-                	tempcx = (tempcx | temp);	  	  	/* (VGAHRE-3)*8 */
-			tempcx -= 3;
-			tempcx <<= 3;
-			tempcx &= 0x00FF;
-			tempcx |= (tempbx & 0xFF00);
-                	tempbx += 16;
-                	tempcx += 16;
-			tempax = SiS_Pr->SiS_VGAHT;
-			if(modeflag & HalfDCLK)  tempax >>= 1;
-			tempax--;
-			if(tempcx > tempax)  tempcx = tempax;
-             	   }
-         	   if((SiS_Pr->SiS_VBInfo & SetCRT2ToTV) && (resinfo == 0x08)){
-             	      if(!(SiS_Pr->SiS_VBInfo & SetPALTV)){
-      		 	 tempbx = 1040;
-      		 	 tempcx = 1042;
-      	     	      }
-         	   }
-		   /* TW: Makes no sense, but is in 650/302LV 1.10.6s */
-         	   if((SiS_Pr->SiS_VBInfo & SetCRT2ToTV) && (resinfo == 0x08)){
-		      if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVisionTV)) {
-             	         if(!(SiS_Pr->SiS_VBInfo & SetPALTV)) {
-      		 	    tempbx = 1040;
-      		 	    tempcx = 1042;
-      	     	         }
-		      }
-         	   }
-                }
+  flag = SiS_GetRegByte(0x61) & 0x10;
 
-		temp = tempbx & 0xff;
-	 	SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x0B,temp);                 /* TW: CRT2 Horizontal Retrace Start */
-#endif  /* SIS315H */
+  while(delay) {
+     temp = SiS_GetRegByte(0x61) & 0x10;
+     if(temp == flag) continue;
+     flag = temp;
+     delay--;
+  }
+}
 
-     	}  /* 310/325/330 series */
+#ifdef SIS315H
+static void
+SiS_LongDelay(SiS_Private *SiS_Pr, USHORT delay)
+{
+  while(delay--) {
+     SiS_GenericDelay(SiS_Pr,0x19df);
+  }
+}
+#endif
 
-  	/* TW: The following is done for all bridge/chip types/series */
+static void
+SiS_ShortDelay(SiS_Private *SiS_Pr, USHORT delay)
+{
+  while(delay--) {
+     SiS_GenericDelay(SiS_Pr,0x42);
+  }
+}
 
-  	tempax = tempbx & 0xFF00;
-  	tempbx = pushbx;
-  	tempbx = (tempbx & 0x00FF) | ((tempbx & 0xFF00) << 4);
-  	tempax |= (tempbx & 0xFF00);
-  	temp = (tempax & 0xFF00) >> 8;
-  	SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x0C,temp);                        /* TW: Overflow */
+static void
+SiS_PanelDelay(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, USHORT DelayTime)
+{
+  UCHAR  *ROMAddr = HwInfo->pjVirtualRomBase;
+  USHORT PanelID, DelayIndex, Delay=0;
 
-  	temp = tempcx & 0x00FF;
-  	SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x0D,temp);                        /* TW: CRT2 Horizontal Retrace End */
+  if(HwInfo->jChipType < SIS_315H) {
 
-  	/* 2. Vertical setup */
+#ifdef SIS300
 
-  	tempcx = SiS_Pr->SiS_VGAVT - 1;
-  	temp = tempcx & 0x00FF;
+      PanelID = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36);
+      if(SiS_Pr->SiS_VBType & VB_SISVB) {
+         if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x18) & 0x10)) PanelID = 0x12;
+      }
+      DelayIndex = PanelID >> 4;
+      if((DelayTime >= 2) && ((PanelID & 0x0f) == 1))  {
+         Delay = 3;
+      } else {
+         if(DelayTime >= 2) DelayTime -= 2;
 
-        if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
-	     if(HwDeviceExtension->jChipType < SIS_315H) {
-	          if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) {
-		       if(SiS_Pr->SiS_VBInfo & (SetCRT2ToSVIDEO | SetCRT2ToAVIDEO)) {
-		           temp--;
-		       }
-                  }
-	     } else {
- 		      temp--;
-             }
-        } else if(HwDeviceExtension->jChipType >= SIS_315H) {
-	    /* TW: 650/30xLV 1.10.6s */
-	    temp--;
-	}
-  	SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x0E,temp);                        /* TW: CRT2 Vertical Total */
+         if(!(DelayTime & 0x01)) {
+       	    Delay = SiS_Pr->SiS_PanelDelayTbl[DelayIndex].timer[0];
+         } else {
+       	    Delay = SiS_Pr->SiS_PanelDelayTbl[DelayIndex].timer[1];
+         }
+	 if((ROMAddr) && (SiS_Pr->SiS_UseROM)) {
+            if(ROMAddr[0x220] & 0x40) {
+               if(!(DelayTime & 0x01)) {
+	          Delay = (USHORT)ROMAddr[0x225];
+               } else {
+	    	  Delay = (USHORT)ROMAddr[0x226];
+               }
+            }
+         }
+      }
+      SiS_ShortDelay(SiS_Pr,Delay);
 
-  	tempbx = SiS_Pr->SiS_VGAVDE - 1;
-  	temp = tempbx & 0x00FF;
-  	SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x0F,temp);                        /* TW: CRT2 Vertical Display Enable End */
+#endif  /* SIS300 */
 
-  	temp = ((tempbx & 0xFF00) << 3) >> 8;
-  	temp |= ((tempcx & 0xFF00) >> 8);
-  	SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x12,temp);                        /* TW: Overflow (and HWCursor Test Mode) */
+   } else {
 
-	/* TW: 650/LVDS (1.10.07), 650/30xLV (1.10.6s) */
-	if(HwDeviceExtension->jChipType >= SIS_315H) {
-           tempbx++;
-   	   tempax = tempbx;
-	   tempcx++;
-	   tempcx -= tempax;
-	   tempcx >>= 2;
-	   tempbx += tempcx;
-	   if(tempcx < 4) tempcx = 4;
-	   tempcx >>= 2;
-	   tempcx += tempbx;
-	   tempcx++;
-	} else {
-	   /* TW: 300 series, LVDS/301B: */
-  	   tempbx = (SiS_Pr->SiS_VGAVT + SiS_Pr->SiS_VGAVDE) >> 1;                 /*  BTVGA2VRS     0x10,0x11   */
-  	   tempcx = ((SiS_Pr->SiS_VGAVT - SiS_Pr->SiS_VGAVDE) >> 4) + tempbx + 1;  /*  BTVGA2VRE     0x11        */
-	}
+#ifdef SIS315H
 
-  	if(SiS_Pr->SiS_IF_DEF_LVDS == 0) {
-    	   if(SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC){
-      		tempbx = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[8];
-      		temp = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[7];
-      		if(temp & 0x04) tempbx |= 0x0100;
-      		if(temp & 0x80) tempbx |= 0x0200;
-      		temp = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[13];
-      		if(temp & 0x08) tempbx |= 0x0400;
-      		temp = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[9];
-      		tempcx = (tempcx & 0xFF00) | (temp & 0x00FF);
-    	   }
-  	}
-  	temp = tempbx & 0x00FF;
-  	SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x10,temp);           /* TW: CRT2 Vertical Retrace Start */
+      if(HwInfo->jChipType >= SIS_330) return;
 
-  	temp = ((tempbx & 0xFF00) >> 8) << 4;
-  	temp |= (tempcx & 0x000F);
-  	SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x11,temp);           /* TW: CRT2 Vert. Retrace End; Overflow; "Enable CRTC Check" */
+      if((SiS_Pr->SiS_IF_DEF_LVDS == 1) ||
+         (SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) ||
+	 (SiS_Pr->SiS_CustomT == CUT_CLEVO1400)) {			/* 315 series, LVDS; Special */
+
+         if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) {
+            PanelID = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36);
+	    if(SiS_Pr->SiS_CustomT == CUT_CLEVO1400) {
+	       if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x1b) & 0x10)) PanelID = 0x12;
+	    }
+	    if(SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) {
+	       DelayIndex = PanelID & 0x0f;
+	    } else {
+	       DelayIndex = PanelID >> 4;
+	    }
+	    if((DelayTime >= 2) && ((PanelID & 0x0f) == 1))  {
+               Delay = 3;
+            } else {
+               if(DelayTime >= 2) DelayTime -= 2;
+               if(!(DelayTime & 0x01)) {
+       		  Delay = SiS_Pr->SiS_PanelDelayTblLVDS[DelayIndex].timer[0];
+               } else {
+       		  Delay = SiS_Pr->SiS_PanelDelayTblLVDS[DelayIndex].timer[1];
+               }
+	       if((ROMAddr) && (SiS_Pr->SiS_UseROM)) {
+                  if(ROMAddr[0x13c] & 0x40) {
+                     if(!(DelayTime & 0x01)) {
+	    	        Delay = (USHORT)ROMAddr[0x17e];
+                     } else {
+	    	        Delay = (USHORT)ROMAddr[0x17f];
+                     }
+                  }
+               }
+            }
+	    SiS_ShortDelay(SiS_Pr,Delay);
+	 }
 
-  	/* 3. Panel compensation delay */
+      } else if(SiS_Pr->SiS_VBType & VB_SISVB) {			/* 315 series, all bridges */
 
-  	if(HwDeviceExtension->jChipType < SIS_315H) {
+	 DelayIndex = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) >> 4;
+         if(!(DelayTime & 0x01)) {
+       	    Delay = SiS_Pr->SiS_PanelDelayTbl[DelayIndex].timer[0];
+         } else {
+       	    Delay = SiS_Pr->SiS_PanelDelayTbl[DelayIndex].timer[1];
+         }
+	 Delay <<= 8;
+	 SiS_DDC2Delay(SiS_Pr, Delay);
 
-#ifdef SIS300  /* ---------- 300 series -------------- */
+      }
 
-	   if(SiS_Pr->SiS_IF_DEF_LVDS == 0) {
-	        temp = 0x20;
+#endif /* SIS315H */
 
-		if(HwDeviceExtension->jChipType == SIS_300) {
-		   temp = 0x10;
-		   if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768)  temp = 0x2c;
-		   if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) temp = 0x20;
-		   if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x960)  temp = 0x24;
-		}
-		if(SiS_Pr->SiS_VBType & VB_SIS301) {
-		   if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) temp = 0x20;
-		}
-		if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x960)     temp = 0x24;
-		if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) 		temp = 0x08;
-		if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVisionTV) {
-      		   if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) 	temp = 0x2c;
-      		   else 					temp = 0x20;
-    	        }
-		if((ROMAddr) && (SiS_Pr->SiS_UseROM) && (SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV)) {
-		    if(ROMAddr[0x220] & 0x80) {
-		        if(SiS_Pr->SiS_VBInfo & (SetCRT2ToTV-SetCRT2ToHiVisionTV))
-				temp = ROMAddr[0x221];
-			else if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVisionTV)
-				temp = ROMAddr[0x222];
-		        else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024)
-				temp = ROMAddr[0x223];
-			else
-				temp = ROMAddr[0x224];
-			temp &= 0x3c;
-		    }
-		}
-		if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
-		   if(HwDeviceExtension->pdc) {
-			temp = HwDeviceExtension->pdc & 0x3c;
-		   }
-		}
-	   } else {
-	        temp = 0x20;
-		if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) {
-		   if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480) temp = 0x04;
-		}
-		if((ROMAddr) && SiS_Pr->SiS_UseROM) {
-		    if(ROMAddr[0x220] & 0x80) {
-		        temp = ROMAddr[0x220] & 0x3c;
-		    }
-		}
-		if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
-		   if(HwDeviceExtension->pdc) {
-			temp = HwDeviceExtension->pdc & 0x3c;
-		   }
-		}
-	   }
+   }
+}
 
-    	   SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,~0x03C,temp);         /* TW: Panel Link Delay Compensation; (Software Command Reset; Power Saving) */
+#ifdef SIS315H
+static void
+SiS_PanelDelayLoop(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
+                      USHORT DelayTime, USHORT DelayLoop)
+{
+   int i;
+   for(i=0; i<DelayLoop; i++) {
+      SiS_PanelDelay(SiS_Pr, HwInfo, DelayTime);
+   }
+}
+#endif
 
-#endif  /* SIS300 */
+/*********************************************/
+/*    HELPER: WAIT-FOR-RETRACE FUNCTIONS     */
+/*********************************************/
 
-  	} else {
+void
+SiS_WaitRetrace1(SiS_Private *SiS_Pr)
+{
+  USHORT watchdog;
 
-#ifdef SIS315H   /* ----------- 310/325/330 series ---------------*/
+  if(SiS_GetReg(SiS_Pr->SiS_P3c4,0x1f) & 0xc0) return;
 
-	   if(SiS_Pr->SiS_IF_DEF_LVDS == 0) {
-                temp = 0x10;
-                if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768)  temp = 0x2c;
-    	        if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) temp = 0x20;
-    	        if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x960)  temp = 0x24;
-		if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
-		   temp = 0x08;
-		   if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVisionTV) {
-		      switch(SiS_Pr->SiS_HiVision) {
-		      case 2:
-		      case 1:
-		      case 0:
-		         temp = 0x08;
-			 break;
-		      default:
-      		         if(SiS_Pr->SiS_VBInfo & SetInSlaveMode)  temp = 0x2c;
-      		         else 					  temp = 0x20;
-		      }
-    	           }
-		}
-		if(SiS_Pr->SiS_VBType & VB_SIS301B302B) {
-		   tempbl = 0x00;
-		   if((ROMAddr) && (SiS_Pr->SiS_UseROM)) {
-		      if(HwDeviceExtension->jChipType < SIS_330) {
-		         if(ROMAddr[0x13c] & 0x80) tempbl = 0xf0;
-		      } else {
-		         if(ROMAddr[0x1bc] & 0x80) tempbl = 0xf0;
-		      }
-		   }
-		} else {  /* LV (550/301LV checks ROM byte, other LV BIOSes do not) */
-		   tempbl = 0xF0;
-		}
-	   } else {
-	        if(HwDeviceExtension->jChipType == SIS_740) {
-		   temp = 0x03;
-	        } else {
-		   temp = 0x00;
-		}
-		if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) temp = 0x0a;
-		tempbl = 0xF0;
-		if(HwDeviceExtension->jChipType == SIS_650) {
-		   if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) {
-		      if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) tempbl = 0x0F;
-		   }
-		}
-	   }
-	   SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2D,tempbl,temp);	    /* TW: Panel Link Delay Compensation */
+  if(!(SiS_GetReg(SiS_Pr->SiS_P3d4,0x17) & 0x80)) return;
 
-    	   tempax = 0;
-    	   if (modeflag & DoubleScanMode) tempax |= 0x80;
-    	   if (modeflag & HalfDCLK)       tempax |= 0x40;
-    	   SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2C,0x3f,tempax);
+  watchdog = 65535;
+  while((SiS_GetRegByte(SiS_Pr->SiS_P3da) & 0x08) && --watchdog);
+  watchdog = 65535;
+  while((!(SiS_GetRegByte(SiS_Pr->SiS_P3da) & 0x08)) && --watchdog);
+}
 
-#endif  /* SIS315H */
+static void
+SiS_WaitRetrace2(SiS_Private *SiS_Pr, USHORT reg)
+{
+  USHORT watchdog;
 
-  	}
+  watchdog = 65535;
+  while((SiS_GetReg(SiS_Pr->SiS_Part1Port,reg) & 0x02) && --watchdog);
+  watchdog = 65535;
+  while((!(SiS_GetReg(SiS_Pr->SiS_Part1Port,reg) & 0x02)) && --watchdog);
+}
 
-     }  /* Slavemode */
+static void
+SiS_WaitVBRetrace(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
+{
+  if(HwInfo->jChipType < SIS_315H) {
+#ifdef SIS300
+     if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
+        if(!(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0x20)) return;
+     }
+     if(!(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0x80)) {
+        SiS_WaitRetrace1(SiS_Pr);
+     } else {
+        SiS_WaitRetrace2(SiS_Pr, 0x25);
+     }
+#endif
+  } else {
+#ifdef SIS315H
+     if(!(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0x40)) {
+        SiS_WaitRetrace1(SiS_Pr);
+     } else {
+        SiS_WaitRetrace2(SiS_Pr, 0x30);
+     }
+#endif
+  }
+}
 
-     if(SiS_Pr->SiS_IF_DEF_LVDS == 0) {
+static void
+SiS_VBWait(SiS_Private *SiS_Pr)
+{
+  USHORT tempal,temp,i,j;
 
-        /* TW: For 301BDH, we set up the Panel Link */
-        if( (SiS_Pr->SiS_VBType & VB_NoLCD) &&
-	    (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) ) {
+  temp = 0;
+  for(i=0; i<3; i++) {
+    for(j=0; j<100; j++) {
+       tempal = SiS_GetRegByte(SiS_Pr->SiS_P3da);
+       if(temp & 0x01) {
+          if((tempal & 0x08))  continue;
+          if(!(tempal & 0x08)) break;
+       } else {
+          if(!(tempal & 0x08)) continue;
+          if((tempal & 0x08))  break;
+       }
+    }
+    temp ^= 0x01;
+  }
+}
 
-	    SiS_SetGroup1_LVDS(SiS_Pr,BaseAddr,ROMAddr,ModeNo,ModeIdIndex,
-	                       HwDeviceExtension,RefreshRateTableIndex);
+static void
+SiS_VBLongWait(SiS_Private *SiS_Pr)
+{
+  if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
+     SiS_VBWait(SiS_Pr);
+  } else {
+     SiS_WaitRetrace1(SiS_Pr);
+  }
+}
 
-        } else if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) {                             
+/*********************************************/
+/*               HELPER: MISC                */
+/*********************************************/
 
-    	    SiS_SetGroup1_301(SiS_Pr,BaseAddr,ROMAddr,ModeNo,ModeIdIndex,
-	                      HwDeviceExtension,RefreshRateTableIndex);
-        }
+static BOOLEAN
+SiS_Is301B(SiS_Private *SiS_Pr)
+{
+  USHORT flag;
 
-     } else {
+  flag = SiS_GetReg(SiS_Pr->SiS_Part4Port,0x01);
+  if(flag >= 0xb0) return TRUE;
+  return FALSE;
+}
 
-        if(HwDeviceExtension->jChipType < SIS_315H) {
-	
-	   SiS_SetGroup1_LVDS(SiS_Pr,BaseAddr,ROMAddr,ModeNo,ModeIdIndex,
-	                        HwDeviceExtension,RefreshRateTableIndex);
-	} else {
-	
-	   if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) {
-              if((!(SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) || (SiS_Pr->SiS_VBInfo & SetInSlaveMode)) {
-    	          SiS_SetGroup1_LVDS(SiS_Pr,BaseAddr,ROMAddr,ModeNo,ModeIdIndex,
-	                              HwDeviceExtension,RefreshRateTableIndex);
-              }
-	   } else {
-	      SiS_SetGroup1_LVDS(SiS_Pr,BaseAddr,ROMAddr,ModeNo,ModeIdIndex,
-	                         HwDeviceExtension,RefreshRateTableIndex);
-	   }
-	
-	}
+static BOOLEAN
+SiS_CRT2IsLCD(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
+{
+  USHORT flag;
 
-     }
-   } /* LCDA */
+  if(HwInfo->jChipType == SIS_730) {
+     flag = SiS_GetReg(SiS_Pr->SiS_P3c4,0x13);
+     if(flag & 0x20) return TRUE;
+  }
+  flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30);
+  if(flag & 0x20) return TRUE;
+  return FALSE;
 }
 
-void
-SiS_SetGroup1_301(SiS_Private *SiS_Pr, USHORT  BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
-                  PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT RefreshRateTableIndex)
+BOOLEAN
+SiS_IsDualEdge(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
 {
-  USHORT  push1,push2;
-  USHORT  tempax,tempbx,tempcx,temp;
-  USHORT  resinfo,modeflag;
-
-  if(ModeNo <= 0x13) {
-    	modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
-    	resinfo = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ResInfo;
-  } else {
-    	modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
-    	resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO;
-  }
-
-  /* TW: The following is only done if bridge is in slave mode: */
-
-  tempax = 0xFFFF;
-  if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToTV))  tempax = SiS_GetVGAHT2(SiS_Pr);
+#ifdef SIS315H
+  USHORT flag;
 
-  if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
-  	modeflag |= Charx8Dot;
+  if(HwInfo->jChipType >= SIS_315H) {
+     if((HwInfo->jChipType != SIS_650) || (SiS_GetReg(SiS_Pr->SiS_P3d4,0x5f) & 0xf0)) {
+        flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38);
+        if(flag & EnableDualEdge) return TRUE;
+     }
   }
+#endif
+  return FALSE;
+}
 
-  if(modeflag & Charx8Dot) tempcx = 0x08;
-  else                     tempcx = 0x09;
-
-  if(tempax >= SiS_Pr->SiS_VGAHT) tempax = SiS_Pr->SiS_VGAHT;
-
-  if(modeflag & HalfDCLK) tempax >>= 1;
-
-  tempax = (tempax / tempcx) - 5;
-  tempbx = tempax & 0x00FF;
-
-  temp = 0xFF;                                                  /* set MAX HT */
-  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x03,temp);
-
-  tempax = SiS_Pr->SiS_VGAHDE;                                 	/* 0x04 Horizontal Display End */
-  if(modeflag & HalfDCLK) tempax >>= 1;
-  tempax = (tempax / tempcx) - 1;
-  tempbx |= ((tempax & 0x00FF) << 8);
-  temp = tempax & 0x00FF;
-  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x04,temp);
+BOOLEAN
+SiS_IsVAMode(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
+{
+#ifdef SIS315H
+  USHORT flag;
 
-  temp = (tempbx & 0xFF00) >> 8;
-  if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
-        if(!(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV)) {        
-    	    temp += 2;
-        }
-  }	
-  if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVisionTV) {
-     if(SiS_Pr->SiS_HiVision == 3) {
-              if(resinfo == 7) temp -= 2;
-     }
-  }
-  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x05,temp);                 /* 0x05 Horizontal Display Start */
-
-  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x06,0x03);                 /* 0x06 Horizontal Blank end     */
-
-  if((SiS_Pr->SiS_VBInfo & SetCRT2ToHiVisionTV) &&
-     (SiS_Pr->SiS_HiVision == 3)) {
-    temp = (tempbx & 0x00FF) - 1;
-    if(!(modeflag & HalfDCLK)) {
-      temp -= 6;
-      if(SiS_Pr->SiS_SetFlag & TVSimuMode) {
-        temp -= 2;
-        if(ModeNo > 0x13) temp -= 10;
-      }
-    }
-  } else {
-    tempcx = tempbx & 0x00FF;
-    tempbx = (tempbx & 0xFF00) >> 8;
-    tempcx = (tempcx + tempbx) >> 1;
-    temp = (tempcx & 0x00FF) + 2;
-    if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV){
-       temp--;
-       if(!(modeflag & HalfDCLK)){
-          if((modeflag & Charx8Dot)){
-             temp += 4;
-             if(SiS_Pr->SiS_VGAHDE >= 800) temp -= 6;
-             if(HwDeviceExtension->jChipType >= SIS_315H) {
-	        if(SiS_Pr->SiS_VGAHDE == 800) temp += 2;
-             }
-          }
-       }
-    } else {
-       if(!(modeflag & HalfDCLK)) {
-          temp -= 4;
-          if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel1280x960) {
-             if(SiS_Pr->SiS_VGAHDE >= 800) {
-                temp -= 7;
-	        if(HwDeviceExtension->jChipType < SIS_315H) {
-	           /* 650/301LV(x) does not do this, 630/301B, 300/301LV do */
-                   if(SiS_Pr->SiS_ModeType == ModeEGA) {
-                      if(SiS_Pr->SiS_VGAVDE == 1024) {
-                         temp += 15;
-                         if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel1280x1024) 
-			    temp += 7;
-                      }
-                   }
-	        }
-                if(SiS_Pr->SiS_VGAHDE >= 1280) {
-                   if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel1280x960) {
-                      if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) temp += 28;
-                   }
-                }
-             }
-          }
-       }
-    }
+  if(HwInfo->jChipType >= SIS_315H) {
+     flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38);
+     if((flag & EnableDualEdge) && (flag & SetToLCDA)) return TRUE;
   }
-  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x07,temp);               	/* 0x07 Horizontal Retrace Start */
-
-  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x08,0x00);                 /* 0x08 Horizontal Retrace End   */
-
-  if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
-     if(SiS_Pr->SiS_SetFlag & TVSimuMode) {
-            if(ModeNo <= 0x01) {
-	        SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x07,0x2a);
-		if(!(SiS_Pr->SiS_VBInfo & SetPALTV)) {
-		    SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x08,0x61);
-		} else {
-		    SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x08,0x41);
-		}
-	    } else if(SiS_Pr->SiS_ModeType == ModeText) {
-	        if(!(SiS_Pr->SiS_VBInfo & SetPALTV)) {
-		    SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x07,0x54);
-		} else {
-		    SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x07,0x55);
-		}
-		SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x08,0x00);
-	    } else if(ModeNo <= 0x13) {
-	        if(modeflag & HalfDCLK) {
-		    if(!(SiS_Pr->SiS_VBInfo & SetPALTV)) {
-		        SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x07,0x30);
-			SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x08,0x03);
-		    } else {
-		        SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x07,0x2f);
-			SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x08,0x02);
-		    }
-		} else {
-		    SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x07,0x5b);
-		    SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x08,0x03);
-		}
-	    } else if( ((HwDeviceExtension->jChipType >= SIS_315H) && (ModeNo == 0x50)) ||
-	               ((HwDeviceExtension->jChipType < SIS_315H) && (resinfo == 0 || resinfo == 1)) ) {
-	        if(!(SiS_Pr->SiS_VBInfo & SetPALTV)) {
-		    SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x07,0x30);
-		    SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x08,0x03);
-		} else {
-		    SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x07,0x2f);
-		    SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x08,0x03);
-		}
-	    }
+#endif
+  return FALSE;
+}
 
+static BOOLEAN
+SiS_IsDualLink(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
+{
+#ifdef SIS315H
+  if(HwInfo->jChipType >= SIS_315H) {
+     if((SiS_CRT2IsLCD(SiS_Pr, HwInfo)) ||
+        (SiS_IsVAMode(SiS_Pr, HwInfo))) {
+        if(SiS_Pr->SiS_LCDInfo & LCDDualLink) return TRUE;
      }
   }
-  if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVisionTV) {
-     if(SiS_Pr->SiS_HiVision & 0x03) {
-        SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x07,0xb2);
-	if(SiS_Pr->SiS_HiVision & 0x02) {
-	   SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x07,0xab);
-	}
-     }
-  }
-
-  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x18,0x03);                	/* 0x18 SR08 (FIFO Threshold?)   */
-
-  SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x19,0xF0);
-
-  tempbx = SiS_Pr->SiS_VGAVT;
-  push1 = tempbx;
-
-  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x09,0xFF);                	/* 0x09 Set Max VT    */
-
-  tempcx = 0x121;
-  tempbx = SiS_Pr->SiS_VGAVDE;                               	/* 0x0E Vertical Display End */
-  if(tempbx == 357) tempbx = 350;
-  if(tempbx == 360) tempbx = 350;
-  if(tempbx == 375) tempbx = 350;
-  if(tempbx == 405) tempbx = 400;
-  if(tempbx == 420) tempbx = 400;
-  if(tempbx == 525) tempbx = 480;
-  push2 = tempbx;
-  if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
-    	if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) {
-      		if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) {
-        		if(tempbx == 350) tempbx += 5;
-        		if(tempbx == 480) tempbx += 5;
-      		}
-    	}
-  }
-  tempbx--;
-  temp = tempbx & 0x00FF;
-  tempbx--;
-  temp = tempbx & 0x00FF;
-  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x10,temp);        		/* 0x10 vertical Blank Start */
+#endif
+  return FALSE;
+}
 
-  tempbx = push2;
-  tempbx--;
-  temp = tempbx & 0x00FF;
-#if 0
-  /* TW: Missing code from 630/301B 2.04.5a and 650/302LV 1.10.6s (calles int 2f) */
-  if(xxx()) {
-      if(temp == 0xdf) temp = 0xda;
+#ifdef SIS315H
+static BOOLEAN
+SiS_TVEnabled(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
+{
+  if((SiS_GetReg(SiS_Pr->SiS_Part2Port,0x00) & 0x0f) != 0x0c) return TRUE;
+  if(SiS_Pr->SiS_VBType & (VB_301C | VB_SIS301LV302LV)) {
+     if(SiS_GetReg(SiS_Pr->SiS_Part2Port,0x4d) & 0x10) return TRUE;
   }
+  return FALSE;
+}
 #endif
-  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x0E,temp);
 
-  if(tempbx & 0x0100) {
-  	tempcx |= 0x0002;
-	if(SiS_Pr->SiS_VBType & VB_SIS301) tempcx |= 0x000a;
-  }
+#ifdef SIS315H
+static BOOLEAN
+SiS_LCDAEnabled(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
+{
+  if(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x13) & 0x04) return TRUE;
+  return FALSE;
+}
+#endif
 
-  tempax = 0x000B;
-  if(modeflag & DoubleScanMode) tempax |= 0x8000;
+#ifdef SIS315H
+static BOOLEAN
+SiS_WeHaveBacklightCtrl(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
+{
+  USHORT flag;
 
-  if(tempbx & 0x0200) {
-  	tempcx |= 0x0040;
-	if(SiS_Pr->SiS_VBType & VB_SIS301) tempax |= 0x2000;
+  if((HwInfo->jChipType >= SIS_315H) && (HwInfo->jChipType < SIS_661)) {
+     flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x79);
+     if(flag & 0x10) return TRUE;
   }
+  return FALSE;
+}
+#endif
 
-  if(SiS_Pr->SiS_VBType & VB_SIS301) {
-        if(SiS_Pr->SiS_VBInfo & SetPALTV) {
-	      if(SiS_Pr->SiS_VGAVDE == 480) {
-	             tempax = (tempax & 0x00ff) | 0x2000;
-		     if(modeflag & DoubleScanMode)  tempax |= 0x8000;
-	      }
-	}
-  }
+#ifdef SIS315H
+static BOOLEAN
+SiS_IsNotM650orLater(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
+{
+  USHORT flag;
 
-  temp = (tempax & 0xFF00) >> 8;
-  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x0B,temp);
+  if(HwInfo->jChipType == SIS_650) {
+     flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x5f);
+     flag &= 0xF0;
+     /* Check for revision != A0 only */
+     if((flag == 0xe0) || (flag == 0xc0) ||
+        (flag == 0xb0) || (flag == 0x90)) return FALSE;
+  } else if(HwInfo->jChipType >= SIS_661) return FALSE;
+  return TRUE;
+}
+#endif
 
-  if(tempbx & 0x0400) tempcx |= 0x0600;
+#ifdef SIS315H
+static BOOLEAN
+SiS_IsYPbPr(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
+{
+  USHORT flag;
 
-  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x11,0x00);                	/* 0x11 Vertical Blank End */
+  if(HwInfo->jChipType >= SIS_315H) {
+     flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38);
+     if(flag & EnableCHYPbPr) return TRUE;  /* = YPrPb = 0x08 */
+  }
+  return FALSE;
+}
+#endif
 
-  tempax = push1;
-  tempax -= tempbx;
-  tempax >>= 2;
-  push1 = tempax;
+#ifdef SIS315H
+static BOOLEAN
+SiS_IsChScart(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
+{
+  USHORT flag;
 
-  if(HwDeviceExtension->jChipType >= SIS_315H) {
-        /* TW: 650/30xLV 1.10.6s */
-        if(ModeNo > 0x13) {
-	    if(resinfo != 0x09) {  /* 1280x1024 */
-	        tempax <<= 1;
-		tempbx += tempax;
-	    }
-	} else {
-	    if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel1400x1050) {
-	        tempax <<= 1;
-		tempbx += tempax;
-	    }
-	}
-  } else if((resinfo != 0x09) || (SiS_Pr->SiS_VBType & VB_SIS301)) {
-    	tempax <<= 1;
-    	tempbx += tempax;
+  if(HwInfo->jChipType >= SIS_315H) {
+     flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38);
+     if(flag & EnableCHScart) return TRUE;  /* = Scart = 0x04 */
   }
+  return FALSE;
+}
+#endif
 
-  if( (SiS_Pr->SiS_VBInfo & SetCRT2ToHiVisionTV) &&
-      (SiS_Pr->SiS_HiVision == 3) ) {
-    	tempbx -= 10;
-  } else {
-    	if(SiS_Pr->SiS_SetFlag & TVSimuMode) {
-      	   if(SiS_Pr->SiS_VBInfo & SetPALTV) {
-	       if(!(SiS_Pr->SiS_HiVision & 0x03)) {
-                    tempbx += 40;
-		    if(HwDeviceExtension->jChipType >= SIS_315H) {
-		       if(SiS_Pr->SiS_VGAHDE == 800) tempbx += 10;
-		    }
-      	       }
-	   }
-    	}
-  }
-  tempax = push1;
-  tempax >>= 2;
-  tempax++;
-  tempax += tempbx;
-  push1 = tempax;
-  if(SiS_Pr->SiS_VBInfo & SetPALTV) {
-    	if(tempbx <= 513)  {
-      		if(tempax >= 513) tempbx = 513;
-    	}
+#ifdef SIS315H
+static BOOLEAN
+SiS_IsTVOrYPbPrOrScart(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
+{
+  USHORT flag;
+
+  if(HwInfo->jChipType >= SIS_315H) {
+     flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30);
+     if(flag & SetCRT2ToTV)        return TRUE;
+     flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38);
+     if(flag & EnableCHYPbPr)      return TRUE;  /* = YPrPb = 0x08 */
+     if(flag & EnableCHScart)      return TRUE;  /* = Scart = 0x04 - TW */
+  } else {
+     flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30);
+     if(flag & SetCRT2ToTV)        return TRUE;
   }
-  temp = tempbx & 0x00FF;
-  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x0C,temp);			/* 0x0C Vertical Retrace Start */
+  return FALSE;
+}
+#endif
 
-  if(!(SiS_Pr->SiS_VBType & VB_SIS301)) {
-  	tempbx--;
-  	temp = tempbx & 0x00FF;
-  	SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x10,temp);
+#ifdef SIS315H
+static BOOLEAN
+SiS_IsLCDOrLCDA(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
+{
+  USHORT flag;
 
-	if(tempbx & 0x0100) tempcx |= 0x0008;
+  if(HwInfo->jChipType >= SIS_315H) {
+     flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30);
+     if(flag & SetCRT2ToLCD) return TRUE;
+     flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38);
+     if(flag & SetToLCDA)    return TRUE;
+  } else {
+     flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30);
+     if(flag & SetCRT2ToLCD) return TRUE;
+  }
+  return FALSE;
+}
+#endif
 
-  	if(tempbx & 0x0200) {
-    	   SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x0B,0x20);
-	}
+static BOOLEAN
+SiS_BridgeIsOn(SiS_Private *SiS_Pr)
+{
+  USHORT flag;
 
-  	tempbx++;
-  }
-  if(tempbx & 0x0100) tempcx |= 0x0004;
-  if(tempbx & 0x0200) tempcx |= 0x0080;
-  if(tempbx & 0x0400) {
-        if(SiS_Pr->SiS_VBType & VB_SIS301) tempcx |= 0x0800;
-  	else                               tempcx |= 0x0C00;
+  if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
+     return FALSE;
+  } else if(SiS_Pr->SiS_VBType & VB_SISVB) {
+     flag = SiS_GetReg(SiS_Pr->SiS_Part4Port,0x00);
+     if((flag == 1) || (flag == 2)) return FALSE;
   }
+  return TRUE;
+}
 
-  tempbx = push1;
-  temp = tempbx & 0x00FF;
-  temp &= 0x0F;
-  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x0D,temp);        		/* 0x0D vertical Retrace End */
-
-  if(tempbx & 0x0010) tempcx |= 0x2000;
+static BOOLEAN
+SiS_BridgeIsEnabled(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
+{
+  USHORT flag;
 
-  temp = tempcx & 0x00FF;
-  if(SiS_Pr->SiS_VBType & VB_SIS301) {
-	if(SiS_Pr->SiS_VBInfo & SetPALTV) {
-	      if(SiS_Pr->SiS_VGAVDE == 480)  temp = 0xa3;
-	}
+  if(!(SiS_BridgeIsOn(SiS_Pr))) {
+     flag = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00);
+     if(HwInfo->jChipType < SIS_315H) {
+       flag &= 0xa0;
+       if((flag == 0x80) || (flag == 0x20)) return FALSE;
+     } else {
+       flag &= 0x50;
+       if((flag == 0x40) || (flag == 0x10)) return FALSE;
+     }
   }
-  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x0A,temp);              	/* 0x0A CR07 */
+  return TRUE;
+}
 
-  temp = (tempcx & 0xFF00) >> 8;
-  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x17,temp);              	/* 0x17 SR0A */
+static BOOLEAN
+SiS_BridgeInSlave(SiS_Private *SiS_Pr)
+{
+  USHORT flag1;
 
-  tempax = modeflag;
-  temp = (tempax & 0xFF00) >> 8;
-  temp = (temp >> 1) & 0x09;
-  if(!(SiS_Pr->SiS_VBType & VB_SIS301)) {
-       /* Only use 8 dot clock */
-       temp |= 0x01;
-  }
-  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x16,temp);              	/* 0x16 SR01 */
+  flag1 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x31);
+  if(flag1 & (SetInSlaveMode >> 8)) return TRUE;
+  return FALSE;
+}
 
-  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x0F,0x00);              	/* 0x0F CR14 */
+/*********************************************/
+/*       GET VIDEO BRIDGE CONFIG INFO        */
+/*********************************************/
 
-  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x12,0x00);              	/* 0x12 CR17 */
+/* Setup general purpose IO for Chrontel communication */
+void
+SiS_SetChrontelGPIO(SiS_Private *SiS_Pr, USHORT myvbinfo)
+{
+   unsigned long  acpibase;
+   unsigned short temp;
 
-  if(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit) {
-       if(IS_SIS650) {
-           /* TW: 650/30xLV 1.10.6s */
-           if(SiS_GetReg1(SiS_Pr->SiS_Part1Port,0x00) & 0x01) {
-	       temp = 0x80;
-	   }
-       } else temp = 0x80;
-  } else  temp = 0x00;
-  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x1A,temp);                	/* 0x1A SR0E */
+   if(!(SiS_Pr->SiS_ChSW)) return;
 
-  return;
+#ifndef LINUX_XF86
+   SiS_SetRegLong(0xcf8,0x80000874);		   /* get ACPI base */
+   acpibase = SiS_GetRegLong(0xcfc);
+#else
+   acpibase = pciReadLong(0x00000800, 0x74);
+#endif
+   acpibase &= 0xFFFF;
+   temp = SiS_GetRegShort((USHORT)(acpibase + 0x3c));  /* ACPI register 0x3c: GP Event 1 I/O mode select */
+   temp &= 0xFEFF;
+   SiS_SetRegShort((USHORT)(acpibase + 0x3c), temp);
+   temp = SiS_GetRegShort((USHORT)(acpibase + 0x3c));
+   temp = SiS_GetRegShort((USHORT)(acpibase + 0x3a));  /* ACPI register 0x3a: GP Pin Level (low/high) */
+   temp &= 0xFEFF;
+   if(!(myvbinfo & SetCRT2ToTV)) temp |= 0x0100;
+   SiS_SetRegShort((USHORT)(acpibase + 0x3a), temp);
+   temp = SiS_GetRegShort((USHORT)(acpibase + 0x3a));
 }
 
 void
-SiS_SetGroup1_LVDS(SiS_Private *SiS_Pr,USHORT  BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,
-		   USHORT ModeIdIndex,PSIS_HW_DEVICE_INFO HwDeviceExtension,
-		   USHORT RefreshRateTableIndex)
+SiS_GetVBInfo(SiS_Private *SiS_Pr, USHORT ModeNo,
+              USHORT ModeIdIndex,PSIS_HW_INFO HwInfo,
+	      int checkcrt2mode)
 {
-  USHORT modeflag, resinfo;
-  USHORT push1, push2, tempax, tempbx, tempcx, temp;
-#ifdef SIS315H
-  USHORT pushcx;
-#endif
-  ULONG  tempeax=0, tempebx, tempecx, tempvcfact=0;
+  USHORT tempax,tempbx,temp;
+  USHORT modeflag, resinfo=0;
 
   if(ModeNo <= 0x13) {
-    	modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
-    	resinfo = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ResInfo;
+     modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
   } else {
-    	modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
-    	resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO;
+     if(SiS_Pr->UseCustomMode) {
+        modeflag = SiS_Pr->CModeFlag;
+     } else {
+   	modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
+	resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO;
+     }
   }
 
-  /* TW: Set up Panel Link */
-
-  /* 1. Horizontal setup */
-
-  tempax = SiS_Pr->SiS_LCDHDES;
-
-  if( (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480) &&
-      (!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) ) {
-  	tempax -= 8;
-  }
+  SiS_Pr->SiS_SetFlag = 0;
 
-  tempcx = SiS_Pr->SiS_HT;    				  /* Horiz. Total */
+  SiS_Pr->SiS_ModeType = modeflag & ModeInfoFlag;
 
-  tempbx = SiS_Pr->SiS_HDE;                               /* Horiz. Display End */
+  tempbx = 0;
+  if(SiS_BridgeIsOn(SiS_Pr) == 0) {
+    	temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30);
+#if 0
+   	if(HwInfo->jChipType < SIS_661) {
+	   /* NO - YPbPr not set yet ! */
+	   if(SiS_Pr->SiS_YPbPr & <all ypbpr except 525i>) {
+	      temp &= (SetCRT2ToHiVision | SwitchCRT2 | SetSimuScanMode); 	/* 0x83 */
+	      temp |= SetCRT2ToHiVision;   					/* 0x80 */
+   	   }
+	   if(SiS_Pr->SiS_YPbPr & <ypbpr525i>) {
+	      temp &= (SetCRT2ToHiVision | SwitchCRT2 | SetSimuScanMode); 	/* 0x83 */
+	      temp |= SetCRT2ToSVIDEO;  					/* 0x08 */
+	   }
+	}
+#endif
+    	tempbx |= temp;
+    	tempax = SiS_GetReg(SiS_Pr->SiS_P3d4,0x31) << 8;
+        tempax &= (DriverMode | LoadDACFlag | SetNotSimuMode | SetPALTV);
+    	tempbx |= tempax;
 
-  if(!(SiS_Pr->SiS_LCDInfo & LCDPass11)) {
-     if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) {
-        if((!SiS_Pr->SiS_IF_DEF_DSTN) && (SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel640x480)) {
- 	   if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel800x600)        tempbx =  800;
-	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x600)  tempbx = 1024;  /* TW */
-    	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768)  tempbx = 1024;
-	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1152x768)  tempbx = 1152;  /* TW */
-	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x768)  tempbx = 1280;
-	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) tempbx = 1280; 
-	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) tempbx = 1400; 
-	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200) tempbx = 1600; 
-        }
-     }
-  }
-  tempcx = (tempcx - tempbx) >> 2;		 /* HT-HDE / 4 */
+#ifdef SIS315H
+	if(HwInfo->jChipType >= SIS_315H) {
+    	   if(SiS_Pr->SiS_VBType & (VB_SIS301C|VB_SIS302B|VB_SIS301LV|VB_SIS302LV|VB_SIS302ELV)) {
+	      if(ModeNo == 0x03) {
+	         /* Mode 0x03 is never in driver mode */
+		 SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x31,0xbf);
+	      }
+	      if(!(SiS_GetReg(SiS_Pr->SiS_P3d4,0x31) & (DriverMode >> 8))) {
+	         /* Reset LCDA setting */
+		 SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x38,0xfc);
+	      }
+	      if(IS_SIS650) {
+	         if(SiS_Pr->SiS_UseLCDA) {
+		    if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x5f) & 0xF0) {
+		       if((ModeNo <= 0x13) || (!(SiS_GetReg(SiS_Pr->SiS_P3d4,0x31) & (DriverMode >> 8)))) {
+		          SiS_SetRegOR(SiS_Pr->SiS_P3d4,0x38,(EnableDualEdge | SetToLCDA));
+		       }
+		    }
+		 }
+	      }
+	      temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38);
+       	      if((temp & (EnableDualEdge | SetToLCDA)) == (EnableDualEdge | SetToLCDA)) {
+          	 tempbx |= SetCRT2ToLCDA;
+	      }
+	   }
+	   if(HwInfo->jChipType >= SIS_661) {
+	      tempbx &= ~(SetCRT2ToYPbPr525750 | SetCRT2ToHiVision);
+	      temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38);
+	      if(SiS_Pr->SiS_VBType & (VB_SIS301C|VB_SIS301LV|VB_SIS302LV|VB_SIS302ELV)) {
+	         if(temp & 0x04) {
+		    temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x35) & 0xe0;
+		    if(temp == 0x60) tempbx |= SetCRT2ToHiVision;
+		    else             tempbx |= SetCRT2ToYPbPr525750;
+		 }
+	      } else if(SiS_Pr->SiS_VBType & (VB_SIS301 | VB_SIS301B | VB_SIS302B)) {
+	         if(temp & 0x04) {
+		    temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x35) & 0xe0;
+		    if(temp == 0x60) tempbx |= SetCRT2ToHiVision;
+		 }
+	      }
+  	   }
 
-  push1 = tempax;
+	   if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
+	      temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38);
+	      if(temp & SetToLCDA) {
+		 tempbx |= SetCRT2ToLCDA;
+	      }
+	      if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) {
+	         if(temp & EnableCHYPbPr) {
+		    tempbx |= SetCRT2ToCHYPbPr;
+		 }
+	      }
+	   }
+	}
 
-  tempax += tempbx;
+#endif  /* SIS315H */
 
-  if(tempax >= SiS_Pr->SiS_HT) tempax -= SiS_Pr->SiS_HT;
+    	if(SiS_Pr->SiS_VBType & VB_SISVB) {
+	   temp = SetCRT2ToSVIDEO   |
+	          SetCRT2ToAVIDEO   |
+	          SetCRT2ToSCART    |
+	          SetCRT2ToLCDA     |
+	          SetCRT2ToLCD      |
+	          SetCRT2ToRAMDAC   |
+                  SetCRT2ToHiVision |
+		  SetCRT2ToYPbPr525750;
+    	} else {
+           if(HwInfo->jChipType >= SIS_315H) {
+              if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) {
+        	 temp = SetCRT2ToAVIDEO |
+		        SetCRT2ToSVIDEO |
+		        SetCRT2ToSCART  |
+		        SetCRT2ToLCDA   |
+		        SetCRT2ToLCD    |
+		        SetCRT2ToCHYPbPr;
+      	      } else {
+        	 temp = SetCRT2ToLCDA   |
+		        SetCRT2ToLCD;
+	      }
+	   } else {
+      	      if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) {
+          	 temp = SetCRT2ToTV | SetCRT2ToLCD;
+              } else {
+        	 temp = SetCRT2ToLCD;
+	      }
+	   }
+    	}
 
-  push2 = tempax;
-  
-  if(!(SiS_Pr->SiS_LCDInfo & LCDPass11)) { 
-     if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
-        if((!SiS_Pr->SiS_IF_DEF_DSTN) && (SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel640x480)) {
-     	   if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel800x600)        tempcx = 0x0028;
-	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x600)  tempcx = 0x0018;
-     	   else if( (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) ||
-	            (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1152x768) ) {
-	  	   if(HwDeviceExtension->jChipType < SIS_315H) {
-		      if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
-		         tempcx = 0x0017;
-#ifdef TWNEWPANEL
-			 tempcx = 0x0018;
-#endif
-		      } else {
-		         tempcx = 0x0017;  /* A901; sometimes 0x0018; */
-		      }
-		   } else {
-		      tempcx = 0x0018;
-		   }
+    	if(!(tempbx & temp)) {
+      	   tempax = DisableCRT2Display;
+      	   tempbx = 0;
+    	}
+
+   	if(SiS_Pr->SiS_VBType & VB_SISVB) {
+	   USHORT clearmask = ( DriverMode 	   |
+				DisableCRT2Display |
+				LoadDACFlag 	   |
+				SetNotSimuMode 	   |
+				SetInSlaveMode 	   |
+				SetPALTV 	   |
+				SwitchCRT2	   |
+				SetSimuScanMode );
+      	   if(tempbx & SetCRT2ToLCDA) {
+              tempbx &= (clearmask | SetCRT2ToLCDA);
+      	   }
+	   if(tempbx & SetCRT2ToRAMDAC) {
+              tempbx &= (clearmask | SetCRT2ToRAMDAC);
+      	   }
+	   if(tempbx & SetCRT2ToLCD) {
+              tempbx &= (clearmask | SetCRT2ToLCD);
+      	   }
+	   if(tempbx & SetCRT2ToSCART) {
+              tempbx &= (clearmask | SetCRT2ToSCART);
+      	   }
+	   if(tempbx & SetCRT2ToHiVision) {
+              tempbx &= (clearmask | SetCRT2ToHiVision);
+      	   }
+	   if(tempbx & SetCRT2ToYPbPr525750) {
+	      tempbx &= (clearmask | SetCRT2ToYPbPr525750);
+	   }
+   	} else {
+	   if(HwInfo->jChipType >= SIS_315H) {
+	      if(tempbx & SetCRT2ToLCDA) {
+	         tempbx &= (0xFF00|SwitchCRT2|SetSimuScanMode);
+	      }
 	   }
-	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x768)  tempcx = 0x0028;
-	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) tempcx = 0x0030;
-	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) tempcx = 0x0030;
-	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200) tempcx = 0x0040;
-        }
-     }
-  }
+      	   if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) {
+              if(tempbx & SetCRT2ToTV) {
+          	 tempbx &= (0xFF00|SetCRT2ToTV|SwitchCRT2|SetSimuScanMode);
+	      }
+      	   }
+      	   if(tempbx & SetCRT2ToLCD) {
+              tempbx &= (0xFF00|SetCRT2ToLCD|SwitchCRT2|SetSimuScanMode);
+	   }
+	   if(HwInfo->jChipType >= SIS_315H) {
+	      if(tempbx & SetCRT2ToLCDA) {
+	         tempbx |= SetCRT2ToLCD;
+	      }
+	   }
+	}
 
-  tempcx += tempax;                              /* lcdhrs  */
-  if(tempcx >= SiS_Pr->SiS_HT) tempcx -= SiS_Pr->SiS_HT;
+    	if(tempax & DisableCRT2Display) {
+      	   if(!(tempbx & (SwitchCRT2 | SetSimuScanMode))) {
+              tempbx = SetSimuScanMode | DisableCRT2Display;
+      	   }
+    	}
 
-  tempax = tempcx >> 3;                          /* BPLHRS */
-  temp = tempax & 0x00FF;
-  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x14,temp);		 /* Part1_14h; TW: Panel Link Horizontal Retrace Start  */
+    	if(!(tempbx & DriverMode)){
+      	   tempbx |= SetSimuScanMode;
+    	}
 
-  if(SiS_Pr->SiS_LCDInfo & LCDPass11) {
-     temp = (tempax & 0x00FF) + 2;
-  } else {
-     temp = (tempax & 0x00FF) + 10;
-     if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
-        if(!SiS_Pr->SiS_IF_DEF_DSTN) {
-           if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel640x480) {
-	      temp += 6;
-              if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel800x600) {
-	         temp++;
-	         if(HwDeviceExtension->jChipType >= SIS_315H) {
-	            if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel1024x768) {
-	               temp += 7;
-		       if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel1600x1200) {
-		          temp -= 0x14;
-			  if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel1280x768) {
-			     temp -= 10;
-			  }
+	/* LVDS/CHRONTEL (LCD/TV) and 301BDH (LCD) can only be slave in 8bpp modes */
+	if(SiS_Pr->SiS_ModeType <= ModeVGA) {
+	   if( (SiS_Pr->SiS_IF_DEF_LVDS == 1) ||
+	       ((tempbx & SetCRT2ToLCD) && (SiS_Pr->SiS_VBType & VB_NoLCD)) ) {
+	       modeflag &= (~CRT2Mode);
+	   }
+	}
+
+    	if(!(tempbx & SetSimuScanMode)) {
+      	   if(tempbx & SwitchCRT2) {
+              if((!(modeflag & CRT2Mode)) && (checkcrt2mode)) {
+		 if( (HwInfo->jChipType >= SIS_315H) &&
+		     (SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) ) {
+		    if(resinfo != SIS_RI_1600x1200) {
+                       tempbx |= SetSimuScanMode;
+		    }
+		 } else {
+            	    tempbx |= SetSimuScanMode;
+	         }
+              }
+      	   } else {
+              if(!(SiS_BridgeIsEnabled(SiS_Pr,HwInfo))) {
+          	 if(!(tempbx & DriverMode)) {
+            	    if(SiS_BridgeInSlave(SiS_Pr)) {
+		       tempbx |= SetSimuScanMode;
+            	    }
+                 }
+              }
+      	   }
+    	}
+
+    	if(!(tempbx & DisableCRT2Display)) {
+           if(tempbx & DriverMode) {
+              if(tempbx & SetSimuScanMode) {
+          	 if((!(modeflag & CRT2Mode)) && (checkcrt2mode)) {
+	            if( (HwInfo->jChipType >= SIS_315H) &&
+		        (SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) ) {
+		       if(resinfo != SIS_RI_1600x1200) {
+		          tempbx |= SetInSlaveMode;
 		       }
-	            }
+		    } else {
+            	       tempbx |= SetInSlaveMode;
+                    }
 	         }
-	      }
-           }
-        }
-     }
+              }
+           } else {
+              tempbx |= SetInSlaveMode;
+      	   }
+    	}
+
   }
 
-  temp &= 0x1F;
-  temp |= ((tempcx & 0x0007) << 5);
-  if(SiS_Pr->SiS_IF_DEF_FSTN) temp = 0x20;
-  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x15,temp);    	 /* Part1_15h; TW: Panel Link Horizontal Retrace End/Skew */
+  SiS_Pr->SiS_VBInfo = tempbx;
 
-  tempbx = push2;
-  tempcx = push1;                                /* lcdhdes  */
+  if(HwInfo->jChipType == SIS_630) {
+     SiS_SetChrontelGPIO(SiS_Pr, SiS_Pr->SiS_VBInfo);
+  }
 
-  temp = (tempcx & 0x0007);                      /* BPLHDESKEW  */
-  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x1A,temp);   	 /* Part1_1Ah; TW: Panel Link Vertical Retrace Start (2:0) */
+#ifdef TWDEBUG
+#ifdef LINUX_KERNEL
+  printk(KERN_DEBUG "sisfb: (VBInfo= 0x%04x, SetFlag=0x%04x)\n",
+      SiS_Pr->SiS_VBInfo, SiS_Pr->SiS_SetFlag);
+#endif
+#ifdef LINUX_XF86
+  xf86DrvMsgVerb(0, X_PROBED, 3, "(init301: VBInfo=0x%04x, SetFlag=0x%04x)\n",
+      SiS_Pr->SiS_VBInfo, SiS_Pr->SiS_SetFlag);
+#endif
+#endif
+}
 
-  tempcx >>= 3;                                  /* BPLHDES */
-  temp = (tempcx & 0x00FF);
-  if(ModeNo == 0x5b) temp--;                     
-  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x16,temp);    	 /* Part1_16h; TW: Panel Link Horizontal Display Enable Start  */
+/*********************************************/
+/*           DETERMINE YPbPr MODE            */
+/*********************************************/
 
-  if(HwDeviceExtension->jChipType < SIS_315H) {  
-     if(tempbx & 0x07) tempbx += 8;              
-  }
-  tempbx >>= 3;                                  /* BPLHDEE  */
-  temp = tempbx & 0x00FF;
-  if(ModeNo == 0x5b) temp--;			 
-  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x17,temp);   	 /* Part1_17h; TW: Panel Link Horizontal Display Enable End  */
+void
+SiS_SetYPbPr(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
+{
 
-  /* 2. Vertical setup */
+  UCHAR temp;
 
-  if(HwDeviceExtension->jChipType < SIS_315H) {
-     tempcx = SiS_Pr->SiS_VGAVT;
-     tempbx = SiS_Pr->SiS_VGAVDE;
-     if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) {
-        if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel640x480) {
-	   if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel800x600)       tempbx =  600;
-	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x600) tempbx =  600;
-	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) tempbx =  768;
-	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1152x768) tempbx =  768;
-	   else								tempbx = 1024;
-        }
-     }
-     tempcx -= tempbx;
+  /* Note: This variable is only used on 30xLV systems.
+   * CR38 has a different meaning on LVDS/CH7019 systems.
+   * On 661 and later, these bits moved to CR35.
+   *
+   * On 301, 301B, only HiVision 1080i is supported.
+   * On 30xLV, 301C, only YPbPr 1080i is supported.
+   */
 
-  } else {
+  SiS_Pr->SiS_YPbPr = 0;
+  if(HwInfo->jChipType >= SIS_661) return;
 
-     tempcx = SiS_Pr->SiS_VGAVT - SiS_Pr->SiS_VGAVDE;          /* VGAVT-VGAVDE  */
+  if(SiS_Pr->SiS_VBType) {
+     if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) {
+	SiS_Pr->SiS_YPbPr = YPbPrHiVision;
+     }
+  }
 
+  if(HwInfo->jChipType >= SIS_315H) {
+     if(SiS_Pr->SiS_VBType & (VB_SIS301LV302LV | VB_SIS301C)) {
+        temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38);
+	if(temp & 0x08) {
+	   switch((temp >> 4)) {
+	   case 0x00: SiS_Pr->SiS_YPbPr = YPbPr525i;     break;
+	   case 0x01: SiS_Pr->SiS_YPbPr = YPbPr525p;     break;
+	   case 0x02: SiS_Pr->SiS_YPbPr = YPbPr750p;     break;
+	   case 0x03: SiS_Pr->SiS_YPbPr = YPbPrHiVision; break;
+	   }
+	}
+     }
   }
 
-  tempbx = SiS_Pr->SiS_LCDVDES;	   		 	 	/* VGAVDES  */
-  push1 = tempbx;
+}
 
-  tempax = SiS_Pr->SiS_VGAVDE;
+/*********************************************/
+/*           DETERMINE TVMode flag           */
+/*********************************************/
 
-  if((SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) && (!SiS_Pr->SiS_IF_DEF_DSTN)) {
-     if( (SiS_Pr->SiS_IF_DEF_TRUMPION == 0)   && 
-         (!(SiS_Pr->SiS_LCDInfo & LCDPass11)) &&
-         (SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel640x480) ) {
-        if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel800x600)        tempax =  600;
-        else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x600)  tempax =  600;  
-        else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768)  tempax =  768;
-        else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1152x768)  tempax =  768;  
-        else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x768)  tempax =  768;  
-        else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) tempax = 1024; 
-        else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) tempax = 1050; 
-        else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200) tempax = 1200; 
-     }
-  }
+void
+SiS_SetTVMode(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex, PSIS_HW_INFO HwInfo)
+{
+  UCHAR  *ROMAddr = HwInfo->pjVirtualRomBase;
+  USHORT temp, temp1, resinfo = 0, romindex = 0;
+  UCHAR  OutputSelect = *SiS_Pr->pSiS_OutputSelect;
 
-  tempbx += tempax;
-  if(tempbx >= SiS_Pr->SiS_VT) tempbx -= SiS_Pr->SiS_VT;
+  SiS_Pr->SiS_TVMode = 0;
 
-  push2 = tempbx;
+  if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) return;
+  if(SiS_Pr->UseCustomMode) return;
 
-  tempcx >>= 1;
+  if(ModeNo > 0x13) {
+     resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO;
+  }
 
-  if((SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) && (SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel640x480)) {
-     if(!(SiS_Pr->SiS_LCDInfo & LCDPass11)) {
-        if(!SiS_Pr->SiS_IF_DEF_DSTN) {
-     	   if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel800x600)        tempcx = 0x0001;
-	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x600)  tempcx = 0x0001;
-     	   else if((SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) ||
-	           (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1152x768)) {
-		   if(HwDeviceExtension->jChipType < SIS_315H) {
-		      if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
-			    tempcx = 0x0002;
-#ifdef TWNEWPANEL
-			    tempcx = 0x0003;
-#endif
-		      } else {
-		            tempcx = 0x0002;   /* TW: A901; sometimes 0x0003; */
-		      }
-		   } else tempcx = 0x0003;
+  if(HwInfo->jChipType < SIS_661) {
+
+     if(SiS_Pr->SiS_VBInfo & SetPALTV) SiS_Pr->SiS_TVMode |= TVSetPAL;
+
+     if(SiS_Pr->SiS_VBType & VB_SISVB) {
+        temp = 0;
+        if((HwInfo->jChipType == SIS_630) ||
+           (HwInfo->jChipType == SIS_730)) {
+           temp = 0x35;
+	   romindex = 0xfe;
+        } else if(HwInfo->jChipType >= SIS_315H) {
+           temp = 0x38;
+	   romindex = 0xf3;
+	   if(HwInfo->jChipType >= SIS_330) romindex = 0x11b;
+        }
+        if(temp) {
+           if(romindex && ROMAddr && SiS_Pr->SiS_UseROM) {
+	      OutputSelect = ROMAddr[romindex];
+	      if(!(OutputSelect & EnablePALMN)) {
+                 SiS_SetRegAND(SiS_Pr->SiS_P3d4,temp,0x3F);
+	      }
+	   }
+	   temp1 = SiS_GetReg(SiS_Pr->SiS_P3d4,temp);
+	   if(SiS_Pr->SiS_TVMode & TVSetPAL) {
+              if(temp1 & EnablePALM) {		/* 0x40 */
+                 SiS_Pr->SiS_TVMode |= TVSetPALM;
+	         SiS_Pr->SiS_TVMode &= ~TVSetPAL;
+	      } else if(temp1 & EnablePALN) {	/* 0x80 */
+	         SiS_Pr->SiS_TVMode |= TVSetPALN;
+              }
+	   } else {
+              if(temp1 & EnableNTSCJ) {		/* 0x40 */
+	         SiS_Pr->SiS_TVMode |= TVSetNTSCJ;
+  	      }
+	   }
+        }
+	/* Translate HiVision/YPbPr to our new flags */
+	if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) {
+	   if(SiS_Pr->SiS_YPbPr == YPbPr750p)          SiS_Pr->SiS_TVMode |= TVSetYPbPr750p;
+	   else if(SiS_Pr->SiS_YPbPr == YPbPr525p)     SiS_Pr->SiS_TVMode |= TVSetYPbPr525p;
+	   else	if(SiS_Pr->SiS_YPbPr == YPbPrHiVision) SiS_Pr->SiS_TVMode |= TVSetHiVision;
+	   else					       SiS_Pr->SiS_TVMode |= TVSetYPbPr525i;
+	   if(SiS_Pr->SiS_TVMode & (TVSetYPbPr750p | TVSetYPbPr525p | TVSetYPbPr525i)) {
+	      SiS_Pr->SiS_VBInfo &= ~SetCRT2ToHiVision;
+	      SiS_Pr->SiS_VBInfo |= SetCRT2ToYPbPr525750;
+	   } else if(SiS_Pr->SiS_TVMode & TVSetHiVision) {
+	      SiS_Pr->SiS_TVMode |= TVSetPAL;
+	   }
+	}
+     } else if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) {
+        if(SiS_Pr->SiS_CHOverScan) {
+           if(SiS_Pr->SiS_IF_DEF_CH70xx == 1) {
+              temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x35);
+              if((temp & TVOverScan) || (SiS_Pr->SiS_CHOverScan == 1)) {
+	         SiS_Pr->SiS_TVMode |= TVSetCHOverScan;
+              }
+           } else if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) {
+      	      temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x79);
+      	      if((temp & 0x80) || (SiS_Pr->SiS_CHOverScan == 1)) {
+	         SiS_Pr->SiS_TVMode |= TVSetCHOverScan;
+ 	      }
+	   }
+           if(SiS_Pr->SiS_CHSOverScan) {
+              SiS_Pr->SiS_TVMode |= TVSetCHOverScan;
            }
-     	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x768)  tempcx = 0x0003;
-     	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) tempcx = 0x0001;
-     	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) tempcx = 0x0001;
-	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200) tempcx = 0x0001;
-     	   else 							 tempcx = 0x0057;
+        }
+        if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) {
+	   temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38);
+     	   if(SiS_Pr->SiS_TVMode & TVSetPAL) {
+              if(temp & EnablePALM)      SiS_Pr->SiS_TVMode |= TVSetPALM;
+	      else if(temp & EnablePALN) SiS_Pr->SiS_TVMode |= TVSetPALN;
+           } else {
+	      if(temp & EnableNTSCJ) {
+	         SiS_Pr->SiS_TVMode |= TVSetNTSCJ;
+  	      }
+	   }
 	}
      }
-  }
 
-  tempbx += tempcx;			 	/* BPLVRS  */
+  } else {  /* 661 and later */
 
-  if(HwDeviceExtension->jChipType < SIS_315H) {
-      tempbx++;
+     temp1 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x35);
+     if(temp1 & 0x01) {
+        SiS_Pr->SiS_TVMode |= TVSetPAL;
+	if(temp1 & 0x08) {
+	   SiS_Pr->SiS_TVMode |= TVSetPALN;
+	} else if(temp1 & 0x04) {
+	   if(SiS_Pr->SiS_VBType & VB_SISVB) {
+	      SiS_Pr->SiS_TVMode &= ~TVSetPAL;
+	   }
+	   SiS_Pr->SiS_TVMode |= TVSetPALM;
+	}
+     } else {
+        if(temp1 & 0x02) {
+	   SiS_Pr->SiS_TVMode |= TVSetNTSCJ;
+	}
+     }
+     if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) {
+        if(SiS_Pr->SiS_CHOverScan) {
+           if((temp1 & 0x10) || (SiS_Pr->SiS_CHOverScan == 1)) {
+	      SiS_Pr->SiS_TVMode |= TVSetCHOverScan;
+	   }
+	}
+     }
+     if(SiS_Pr->SiS_VBType & VB_SISVB) {
+        if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) {
+	   temp1 &= 0xe0;
+	   if(temp1 == 0x00)      SiS_Pr->SiS_TVMode |= TVSetYPbPr525i;
+	   else if(temp1 == 0x20) SiS_Pr->SiS_TVMode |= TVSetYPbPr525p;
+	   else if(temp1 == 0x40) SiS_Pr->SiS_TVMode |= TVSetYPbPr750p;
+	} else if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) {
+	   SiS_Pr->SiS_TVMode |= (TVSetHiVision | TVSetPAL);
+	}
+     }
   }
 
-  if(tempbx >= SiS_Pr->SiS_VT) tempbx -= SiS_Pr->SiS_VT;
+  if(SiS_Pr->SiS_VBInfo & SetCRT2ToSCART) SiS_Pr->SiS_TVMode |= TVSetPAL;
 
-  temp = tempbx & 0x00FF;
-  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x18,temp);       	 /* Part1_18h; TW: Panel Link Vertical Retrace Start  */
+  if(SiS_Pr->SiS_VBType & VB_SISVB) {
 
-  tempcx >>= 3;
+     if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) {
+        SiS_Pr->SiS_TVMode |= TVSetPAL;
+	SiS_Pr->SiS_TVMode &= ~(TVSetPALM | TVSetPALN | TVSetNTSCJ);
+     } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) {
+        if(SiS_Pr->SiS_TVMode & (TVSetYPbPr525i | TVSetYPbPr525p | TVSetYPbPr750p)) {
+	   SiS_Pr->SiS_TVMode &= ~(TVSetPAL | TVSetNTSCJ | TVSetPALM | TVSetPALN);
+	}
+     }
 
-  if(!(SiS_Pr->SiS_LCDInfo & LCDPass11)) {
-     if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
-        if( (HwDeviceExtension->jChipType < SIS_315H) &&
-            (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480) )     tempcx = 0x0001;
-        else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel800x600)    tempcx = 0x0003;
-        else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x600)   tempcx = 0x0005;
-        else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1152x768)   tempcx = 0x0005;
-	else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x768)   tempcx = 0x0011;
-        else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024)  tempcx = 0x0005;	 
-        else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050)  tempcx = 0x0002;
-        else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200)  tempcx = 0x0011;
-        else if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel640x480)  {
-     		if(HwDeviceExtension->jChipType < SIS_315H) {
-		        if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
-				tempcx = 0x0004;
-#ifdef TWNEWPANEL
-				tempcx = 0x0005;
-#endif
-		        } else {
-				tempcx = 0x0004;   /* A901; Other BIOS sets 0x0005; */
-			}
-		} else {
-			tempcx = 0x0005;
-		}
+     if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) {
+        if(!(SiS_Pr->SiS_VBInfo & SetNotSimuMode)) {
+           SiS_Pr->SiS_TVMode |= TVSetTVSimuMode;
         }
      }
-  }
 
-  tempcx = tempcx + tempbx + 1;                  /* BPLVRE  */
-  temp = tempcx & 0x000F;
-  SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0xf0,temp); /* Part1_19h; TW: Panel Link Vertical Retrace End (3:0); Misc.  */
+     if(!(SiS_Pr->SiS_TVMode & TVSetPAL)) {
+        /* BIOS sets TVNTSC1024 without checking 525p here. Wrong? */
+        if(!(SiS_Pr->SiS_TVMode & (TVSetHiVision | TVSetYPbPr525p | TVSetYPbPr750p))) {
+           if(resinfo == SIS_RI_1024x768) {
+              SiS_Pr->SiS_TVMode |= TVSetNTSC1024;
+	   }
+        }
+     }
+
+     SiS_Pr->SiS_TVMode |= TVRPLLDIV2XO;
+     if((SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) &&
+        (SiS_Pr->SiS_VBInfo & SetInSlaveMode)) {
+	SiS_Pr->SiS_TVMode &= ~TVRPLLDIV2XO;
+     } else if(SiS_Pr->SiS_TVMode & (TVSetYPbPr525p | TVSetYPbPr750p)) {
+        SiS_Pr->SiS_TVMode &= ~TVRPLLDIV2XO;
+     } else if(!(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV)) {
+        if(SiS_Pr->SiS_TVMode & TVSetTVSimuMode) {
+           SiS_Pr->SiS_TVMode &= ~TVRPLLDIV2XO;
+        }
+     }
 
-  temp = ((tempbx & 0x0700) >> 8) << 3;          /* BPLDESKEW =0 */
-  if(SiS_Pr->SiS_VGAVDE != SiS_Pr->SiS_VDE)  temp |= 0x40;
-  if(SiS_Pr->SiS_SetFlag & EnableLVDSDDA)    temp |= 0x40;
-  if(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit) {
-      if(HwDeviceExtension->jChipType >= SIS_315H) {
-         if(SiS_GetReg1(SiS_Pr->SiS_Part1Port,0x00) & 0x01) {
-            temp |= 0x80;
-         }
-      } else {
-	 if( (HwDeviceExtension->jChipType == SIS_630) ||
-	     (HwDeviceExtension->jChipType == SIS_730) ) {
-	    if(HwDeviceExtension->jChipRevision >= 0x30) {
-	       temp |= 0x80;
-	    }
-	 }
-      }
   }
-  SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x1A,0x87,temp);  /* Part1_1Ah; TW: Panel Link Control Signal (7:3); Vertical Retrace Start (2:0) */
 
-  if (HwDeviceExtension->jChipType < SIS_315H) {
+  SiS_Pr->SiS_VBInfo &= ~SetPALTV;
 
-#ifdef SIS300      /* 300 series */
+#ifdef TWDEBUG
+  xf86DrvMsg(0, X_INFO, "(init301: TVMode %x, VBInfo %x)\n", SiS_Pr->SiS_TVMode, SiS_Pr->SiS_VBInfo);
+#endif
 
-        tempeax = SiS_Pr->SiS_VGAVDE << 6;
-        temp = (USHORT)(tempeax % (ULONG)SiS_Pr->SiS_VDE);
-        tempeax = tempeax / (ULONG)SiS_Pr->SiS_VDE;
-        if(temp != 0) tempeax++;
-        tempebx = tempeax;                         /* BPLVCFACT  */
+}
 
-  	if(SiS_Pr->SiS_SetFlag & EnableLVDSDDA) {
-	   tempebx = 0x003F;
-	}
+/*********************************************/
+/*               GET LCD INFO                */
+/*********************************************/
 
-  	temp = (USHORT)(tempebx & 0x00FF);
-  	SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x1E,temp);      /* Part1_1Eh; TW: Panel Link Vertical Scaling Factor */
+void
+SiS_GetLCDResInfo(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
+		  PSIS_HW_INFO HwInfo)
+{
+#ifdef SIS300
+  UCHAR  *ROMAddr = HwInfo->pjVirtualRomBase;
+#endif
+#ifdef SIS315H
+  UCHAR  *myptr = NULL;
+#endif
+  USHORT temp,modeflag,resinfo=0;
+  const unsigned char SiS300SeriesLCDRes[] =
+         { 0,  1,  2,  3,  7,  4,  5,  8,
+	   0,  0, 10,  0,  0,  0,  0, 15 };
 
-#endif /* SIS300 */
+  SiS_Pr->SiS_LCDResInfo = 0;
+  SiS_Pr->SiS_LCDTypeInfo = 0;
+  SiS_Pr->SiS_LCDInfo = 0;
 
+  if(SiS_Pr->UseCustomMode) {
+     modeflag = SiS_Pr->CModeFlag;
   } else {
+     if(ModeNo <= 0x13) {
+    	modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
+     } else {
+    	modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
+    	resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO;
+     }
+  }
 
-#ifdef SIS315H  /* 310/325 series */
-
-#ifdef NEWCH701x
-        SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1E,0x03);
-#else
-	SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x1E,0x23);
-#endif	
-
-	tempeax = SiS_Pr->SiS_VGAVDE << 18;
-    	temp = (USHORT)(tempeax % (ULONG)SiS_Pr->SiS_VDE);
-    	tempeax = tempeax / SiS_Pr->SiS_VDE;
-    	if(temp != 0) tempeax++;
-    	tempebx = tempeax;                         /* BPLVCFACT  */
-        tempvcfact = tempeax;
-    	temp = (USHORT)(tempebx & 0x00FF);
-    	SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x37,temp);      /* Part1_37h; TW: Panel Link Vertical Scaling Factor */
-    	temp = (USHORT)((tempebx & 0x00FF00) >> 8);
-    	SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x36,temp);      /* Part1_36h; TW: Panel Link Vertical Scaling Factor */
-    	temp = (USHORT)((tempebx & 0x00030000) >> 16);
-    	if(SiS_Pr->SiS_VDE == SiS_Pr->SiS_VGAVDE) temp |= 0x04;
-    	SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x35,temp);      /* Part1_35h; TW: Panel Link Vertical Scaling Factor */
+  if(!(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA))) return;
 
-#endif /* SIS315H */
+  temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36);
 
+  if((HwInfo->jChipType < SIS_315H) || (HwInfo->jChipType >= SIS_661)) {
+     SiS_Pr->SiS_LCDTypeInfo = temp >> 4;
+  } else {
+     SiS_Pr->SiS_LCDTypeInfo = (temp & 0x0F) - 1;
   }
+  temp &= 0x0f;
+  if(HwInfo->jChipType < SIS_315H) {
+      /* Translate 300 series LCDRes to 315 series for unified usage */
+      temp = SiS300SeriesLCDRes[temp];
+  }
+  SiS_Pr->SiS_LCDResInfo = temp;
 
-  tempbx = push2;                                  /* BPLVDEE  */
-  tempcx = push1;
-
-  push1 = temp;					   
-
-  if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) {
-   	if(!SiS_Pr->SiS_IF_DEF_DSTN){
-		if(HwDeviceExtension->jChipType < SIS_315H) {
-			if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x600) {
-      				if(resinfo == 15) tempcx++;
-				if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) {
-					if(resinfo == 7) tempcx++;
-		    		}
-			} else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel800x600) {
-      				if(resinfo == 7) tempcx++;
-				if(resinfo == 8) tempcx++; /* TW: Doesnt make sense anyway... */
-			} else  if(resinfo == 8) tempcx++;
-		} else {
-			if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel800x600) {
-      				if(resinfo == 7) tempcx++;
-			}
-		}
-	}
+  if(SiS_Pr->SiS_VBType & VB_SISVB) {
+     if(SiS_Pr->SiS_LCDResInfo < SiS_Pr->SiS_PanelMin301)
+	SiS_Pr->SiS_LCDResInfo = SiS_Pr->SiS_PanelMin301;
+  } else {
+     if(SiS_Pr->SiS_LCDResInfo < SiS_Pr->SiS_PanelMinLVDS)
+	SiS_Pr->SiS_LCDResInfo = SiS_Pr->SiS_PanelMinLVDS;
   }
 
-  if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480) {
-     tempcx = SiS_Pr->SiS_VGAVDE;
-     tempbx = SiS_Pr->SiS_VGAVDE - 1;
+  if((!SiS_Pr->CP_HaveCustomData) || (SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_PanelCustom)) {
+     if(SiS_Pr->SiS_LCDResInfo > SiS_Pr->SiS_PanelMax)
+  	SiS_Pr->SiS_LCDResInfo = SiS_Pr->SiS_Panel1024x768;
   }
 
-  temp = ((tempbx & 0x0700) >> 8) << 3;
-  temp |= ((tempcx & 0x0700) >> 8);
-  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x1D,temp);     	/* Part1_1Dh; TW: Vertical Display Overflow; Control Signal */
+  if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
+     if(SiS_Pr->SiS_CustomT == CUT_BARCO1366) {
+        SiS_Pr->SiS_LCDResInfo = Panel_Barco1366;
+     } else if(SiS_Pr->SiS_CustomT == CUT_PANEL848) {
+        SiS_Pr->SiS_LCDResInfo = Panel_848x480;
+     }
+  }
 
-  temp = tempbx & 0x00FF;
-  if(SiS_Pr->SiS_IF_DEF_FSTN) temp++;
-  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x1C,temp);      	/* Part1_1Ch; TW: Panel Link Vertical Display Enable End  */
+  switch(SiS_Pr->SiS_LCDResInfo) {
+     case Panel_800x600:   SiS_Pr->PanelXRes =  800; SiS_Pr->PanelYRes =  600; break;
+     case Panel_1024x768:  SiS_Pr->PanelXRes = 1024; SiS_Pr->PanelYRes =  768; break;
+     case Panel_1280x1024: SiS_Pr->PanelXRes = 1280; SiS_Pr->PanelYRes = 1024; break;
+     case Panel_640x480_3:
+     case Panel_640x480_2:
+     case Panel_640x480:   SiS_Pr->PanelXRes =  640; SiS_Pr->PanelYRes =  480; break;
+     case Panel_1024x600:  SiS_Pr->PanelXRes = 1024; SiS_Pr->PanelYRes =  600; break;
+     case Panel_1152x864:  SiS_Pr->PanelXRes = 1152; SiS_Pr->PanelYRes =  864; break;
+     case Panel_1280x960:  SiS_Pr->PanelXRes = 1280; SiS_Pr->PanelYRes =  960; break;
+     case Panel_1152x768:  SiS_Pr->PanelXRes = 1152; SiS_Pr->PanelYRes =  768; break;
+     case Panel_1400x1050: SiS_Pr->PanelXRes = 1400; SiS_Pr->PanelYRes = 1050; break;
+     case Panel_1280x768:  SiS_Pr->PanelXRes = 1280; SiS_Pr->PanelYRes =  768; break;
+     case Panel_1600x1200: SiS_Pr->PanelXRes = 1600; SiS_Pr->PanelYRes = 1200; break;
+     case Panel_320x480:   SiS_Pr->PanelXRes =  320; SiS_Pr->PanelYRes =  480; break;
+     case Panel_Custom:    SiS_Pr->PanelXRes = SiS_Pr->CP_MaxX;
+    			   SiS_Pr->PanelYRes = SiS_Pr->CP_MaxY;
+			   break;
+     case Panel_Barco1366: SiS_Pr->PanelXRes = 1360; SiS_Pr->PanelYRes = 1024; break;
+     case Panel_848x480:   SiS_Pr->PanelXRes =  848; SiS_Pr->PanelYRes =  480; break;
+     default:		   SiS_Pr->PanelXRes = 1024; SiS_Pr->PanelYRes =  768; break;
+  }
+
+  temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x37);
+  if(HwInfo->jChipType < SIS_661) {
+     temp &= ~0xe;
+  } else {
+#ifdef SIS315H
+     if(!(temp & 0x10)) {
+        if(temp & 0x08) temp |= LCDPass11;
+     }
+     temp &= ~0xe;
+     if(SiS_Pr->SiS_VBType & (VB_SIS302LV | VB_SIS302ELV)) {
+        myptr = GetLCDStructPtr661(SiS_Pr, HwInfo);
+        if(myptr) {
+           if(myptr[2] & 0x01) temp |= LCDDualLink;
+        }
+     }
+#endif
+  }
+  SiS_Pr->SiS_LCDInfo = temp;
 
-  temp = tempcx & 0x00FF;
-  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x1B,temp);      	/* Part1_1Bh; TW: Panel Link Vertical Display Enable Start  */
+  if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
+     if(SiS_Pr->SiS_CustomT == CUT_PANEL848) {
+        SiS_Pr->SiS_LCDInfo = 0x80 | 0x40 | 0x20;   /* neg h/v sync, RGB24 */
+     }
+  }
 
-  /* 3. Additional horizontal setup (scaling, etc) */
+  if(!(SiS_Pr->UsePanelScaler))        SiS_Pr->SiS_LCDInfo &= ~DontExpandLCD;
+  else if(SiS_Pr->UsePanelScaler == 1) SiS_Pr->SiS_LCDInfo |= DontExpandLCD;
 
-  tempecx = SiS_Pr->SiS_VGAHDE;
-  if(HwDeviceExtension->jChipType >= SIS_315H) {
-     if(modeflag & HalfDCLK)
-        tempecx >>= 1;
-  }
-  tempebx = SiS_Pr->SiS_HDE;
-  if(tempecx == tempebx) tempeax = 0xFFFF;
-  else {
-     tempeax = tempecx;
-     tempeax <<= 16;
-     temp = (USHORT)(tempeax % tempebx);
-     tempeax = tempeax / tempebx;
-     if(HwDeviceExtension->jChipType >= SIS_315H) {
-         if(temp) tempeax++;
+  if(SiS_Pr->SiS_VBType & VB_SISVB) {
+     if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) {
+        if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_PanelCustom) {
+	   /* For non-standard LCD resolution, we let the panel scale */
+           SiS_Pr->SiS_LCDInfo |= DontExpandLCD;
+        } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) {
+	   if(ModeNo == 0x7c || ModeNo == 0x7d || ModeNo == 0x7e) {
+	      /* We do not scale to 1280x960 (B/C bridges only) */
+              SiS_Pr->SiS_LCDInfo |= DontExpandLCD;
+	   }
+	   if(((HwInfo->jChipType >= SIS_315H) && (ModeNo == 0x23 || ModeNo == 0x24 || ModeNo == 0x25)) ||
+	      ((HwInfo->jChipType < SIS_315H)  && (ModeNo == 0x55 || ModeNo == 0x5a || ModeNo == 0x5b))) {
+	      /* We do not scale to 1280x768 (B/C bridges only) */
+              SiS_Pr->SiS_LCDInfo |= DontExpandLCD;
+	   }
+	   if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {
+	      /* No non-scaling data available for LV bridges */
+	      SiS_Pr->SiS_LCDInfo &= ~DontExpandLCD;
+	   }
+        } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x768) {
+           /* No idea about the timing and zoom factors */
+           SiS_Pr->SiS_LCDInfo |= DontExpandLCD;
+        } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) {
+	   if(ModeNo == 0x3a || ModeNo == 0x4d || ModeNo == 0x65) {
+	      /* We do not scale to 1280x1024 (all bridges) */
+	      SiS_Pr->SiS_LCDInfo |= DontExpandLCD;
+	   }
+	} else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200) {
+	   if(SiS_Pr->SiS_VBType & VB_SIS301B302B) {
+	      /* No idea about the timing and zoom factors (C bridge only) */
+	      SiS_Pr->SiS_LCDInfo |= DontExpandLCD;
+	   }
+	}
+	if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
+	   if(SiS_Pr->SiS_CustomT == CUT_CLEVO1024) {
+              if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) {
+	         SiS_Pr->SiS_LCDInfo &= ~DontExpandLCD;
+	      }
+	   }
+	}
      }
   }
-  tempecx = tempeax;
 
-  if(HwDeviceExtension->jChipType >= SIS_315H) {
-      tempeax = SiS_Pr->SiS_VGAHDE;
-      if(modeflag & HalfDCLK) tempeax >>= 1;
-      tempeax <<= 16;
-      tempeax = (tempeax / tempecx) - 1;
+  if(HwInfo->jChipType >= SIS_315H) {
+#ifdef SIS315H
+     if(HwInfo->jChipType < SIS_661) {
+        if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x39) & 0x01) {
+           SiS_Pr->SiS_LCDInfo &= (~DontExpandLCD);
+	   SiS_Pr->SiS_LCDInfo |= LCDPass11;
+	}
+     }
+#endif
   } else {
-      tempeax = ((SiS_Pr->SiS_VGAHT << 16) / tempecx) - 1;
+#ifdef SIS300
+     if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
+        if((ROMAddr) && SiS_Pr->SiS_UseROM) {
+	   if((ROMAddr[0x233] == 0x12) && (ROMAddr[0x234] == 0x34)) {
+              if(!(ROMAddr[0x235] & 0x02)) {
+	         SiS_Pr->SiS_LCDInfo &= (~DontExpandLCD);
+ 	      }
+	   }
+        }
+     } else if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
+	if((SiS_Pr->SiS_SetFlag & SetDOSMode) && ((ModeNo == 0x03) || (ModeNo == 0x10))) {
+           SiS_Pr->SiS_LCDInfo &= (~DontExpandLCD);
+	}
+     }
+#endif
   }
-  tempecx <<= 16;
-  tempecx |= (tempeax & 0xFFFF);
-  temp = (USHORT)(tempecx & 0x00FF);
-  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x1F,temp);  	 /* Part1_1Fh; TW: Panel Link DDA Operational Number in each horiz. line */
 
-  tempbx = SiS_Pr->SiS_VDE;
-  if(HwDeviceExtension->jChipType >= SIS_315H) {
-      tempeax = (SiS_Pr->SiS_VGAVDE << 18) / tempvcfact;
-      tempbx = (USHORT)(tempeax & 0x0FFFF);
-  } else {
-      tempax = SiS_Pr->SiS_VGAVDE << 6;
-      tempbx = push1;
-      tempbx &= 0x3f;
-      if(tempbx == 0) tempbx = 64;
-      tempax = tempax / tempbx;
-      tempbx = tempax;
+  /* Trumpion: Assume non-expanding */
+  if(SiS_Pr->SiS_IF_DEF_TRUMPION != 0) {
+     SiS_Pr->SiS_LCDInfo &= (~DontExpandLCD);
   }
-  if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) tempbx--;
-  if(SiS_Pr->SiS_SetFlag & EnableLVDSDDA)                 tempbx = 1;
 
-  temp = ((tempbx & 0xFF00) >> 8) << 3;
-  temp |= (USHORT)((tempecx & 0x0700) >> 8);
-  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x20,temp);  	/* Part1_20h; TW: Overflow register */
-
-  temp = tempbx & 0x00FF;
-  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x21,temp);  	/* Part1_21h; TW: Panel Link Vertical Accumulator Register */
+  if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) {
+     SiS_Pr->SiS_LCDInfo &= (~LCDPass11);
+  }
 
-  tempecx >>= 16;                               /* BPLHCFACT  */
-  if(HwDeviceExtension->jChipType < SIS_315H) {
-      if(modeflag & HalfDCLK) tempecx >>= 1;
+#ifdef SIS315H
+  if((HwInfo->jChipType >= SIS_315H) && (HwInfo->jChipType < SIS_661)) {
+     if(SiS_Pr->SiS_VBType & (VB_SIS302LV | VB_SIS302ELV)) {
+	/* Enable 302LV/302ELV dual link mode.
+	 * For 661, this is done above.
+	 */
+        if((SiS_Pr->SiS_CustomT == CUT_CLEVO1024) &&
+	   (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768)) {
+	   /* (Sets this in SenseLCD; new paneltypes) */
+	   SiS_Pr->SiS_LCDInfo |= LCDDualLink;
+	}
+        if((SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) ||
+	   (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) ||
+           (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200)) {
+	   SiS_Pr->SiS_LCDInfo |= LCDDualLink;
+	}
+     }
   }
-  temp = (USHORT)((tempecx & 0xFF00) >> 8);
-  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x22,temp);     	/* Part1_22h; TW: Panel Link Horizontal Scaling Factor High */
+#endif
 
-  temp = (USHORT)(tempecx & 0x00FF);
-  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x23,temp);         /* Part1_22h; TW: Panel Link Horizontal Scaling Factor Low */
+  if(!((HwInfo->jChipType < SIS_315H) && (SiS_Pr->SiS_SetFlag & SetDOSMode))) {
 
-  /* 630/301B and 630/LVDS do something for 640x480 panels here */
+     if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
+        if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x600) {
+	   if(ModeNo > 0x13) {
+	      if(!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) {
+                 if((resinfo == SIS_RI_800x600) || (resinfo == SIS_RI_400x300)) {
+                    SiS_Pr->SiS_SetFlag |= EnableLVDSDDA;
+		 }
+              }
+           }
+        }
+	if(ModeNo == 0x12) {
+	   if(SiS_Pr->SiS_LCDInfo & LCDPass11) {
+	      SiS_Pr->SiS_SetFlag |= EnableLVDSDDA;
+	   }
+	}
+     }
+
+     if(modeflag & HalfDCLK) {
+        if(SiS_Pr->SiS_IF_DEF_TRUMPION == 0) {
+           if(!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) {
+	      if(!(((SiS_Pr->SiS_IF_DEF_LVDS == 1) || (HwInfo->jChipType < SIS_315H)) &&
+	                                      (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480))) {
+                 if(ModeNo > 0x13) {
+                    if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) {
+                       if(resinfo == SIS_RI_512x384) SiS_Pr->SiS_SetFlag |= EnableLVDSDDA;
+                    } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel800x600) {
+                       if(resinfo == SIS_RI_400x300) SiS_Pr->SiS_SetFlag |= EnableLVDSDDA;
+                    }
+                 }
+	      } else SiS_Pr->SiS_SetFlag |= EnableLVDSDDA;
+           } else SiS_Pr->SiS_SetFlag |= EnableLVDSDDA;
+        } else SiS_Pr->SiS_SetFlag |= EnableLVDSDDA;
+     }
 
-#ifdef SIS315H
-  /* TW: DSTN/FSTN initialisation - hardcoded for 320x480 panel */
-  if(SiS_Pr->SiS_IF_DEF_DSTN) {
-     	SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x1E,0x01);
-     	SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x25,0x00);
-     	SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x26,0x00);
-     	SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x27,0x00);
-     	SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x28,0x87);
-     	SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x29,0x5A);
-     	SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x2A,0x4B);
-     	SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x44,~0x007,0x03);
-     	tempbx = SiS_Pr->SiS_HDE + 64;                       	/*Blps = lcdhdee(lcdhdes+HDE) + 64*/
-     	temp = tempbx & 0x00FF;
-     	SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x38,temp);
-     	temp=((tempbx & 0xFF00) >> 8) << 3;
-     	SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x35,~0x078,temp);
-     	tempbx += 32;		                     		/*Blpe=lBlps+32*/
-     	temp = tempbx & 0x00FF;
-     	if(SiS_Pr->SiS_IF_DEF_FSTN)  temp=0;
-     	SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x39,temp);
-     	SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x3A,0x00);        	/*Bflml=0*/
-     	SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x3C,~0x007,0x00);
-     	tempbx = SiS_Pr->SiS_VDE / 2;
-     	temp = tempbx & 0x00FF;
-     	SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x3B,temp);
-     	temp = ((tempbx & 0xFF00) >> 8) << 3;
-     	SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x3C,~0x038,temp);
-     	tempeax = SiS_Pr->SiS_HDE << 2;                       	/* BDxFIFOSTOP = (HDE*4)/128 */
-     	tempebx = 128;
-     	temp = (USHORT)(tempeax % tempebx);
-     	tempeax = tempeax / tempebx;
-     	if(temp != 0)  tempeax++;
-     	temp = (USHORT)(tempeax & 0x003F);
-     	SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x45,~0x0FF,temp);
-     	SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x3F,0x00);         	/* BDxWadrst0 */
-     	SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x3E,0x00);
-     	SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x3D,0x10);
-     	SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x3C,~0x040,0x00);
-     	tempax = SiS_Pr->SiS_HDE >> 4;                        	/* BDxWadroff = HDE*4/8/8 */
-     	pushcx = tempax;
-     	temp = tempax & 0x00FF;
-     	SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x43,temp);
-     	temp = ((tempax & 0xFF00) >> 8) << 3;
-     	SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x44,~0x0F8,temp);
-     	tempax = SiS_Pr->SiS_VDE;                             /*BDxWadrst1 = BDxWadrst0 + BDxWadroff * VDE */
-     	tempeax = (tempax * pushcx);
-     	tempebx = 0x00100000 + tempeax;
-     	temp = (USHORT)tempebx & 0x000000FF;
-     	SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x42,temp);
-     	temp = (USHORT)((tempebx & 0x0000FF00)>>8);
-     	SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x41,temp);
-     	temp = (USHORT)((tempebx & 0x00FF0000)>>16);
-     	SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x40,temp);
-     	temp = (USHORT)(((tempebx & 0x01000000)>>24) << 7);
-     	SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x3C,~0x080,temp);
-     	SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x2F,0x03);
-     	SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x03,0x50);
-     	SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x04,0x00);
-     	SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x2F,0x01);
-     	SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x13,0x00);
-     	SiS_SetReg1(SiS_Pr->SiS_P3c4,0x05,0x86);        /* Unlock */
-     	SiS_SetReg1(SiS_Pr->SiS_P3c4,0x1e,0x62);
-     	if(SiS_Pr->SiS_IF_DEF_FSTN){
-         	SiS_SetReg1(SiS_Pr->SiS_P3c4,0x2b,0x1b);
-         	SiS_SetReg1(SiS_Pr->SiS_P3c4,0x2c,0xe3);
-         	SiS_SetReg1(SiS_Pr->SiS_P3c4,0x1e,0x62);
-         	SiS_SetReg1(SiS_Pr->SiS_P3c4,0x2e,0x04);
-         	SiS_SetReg1(SiS_Pr->SiS_P3c4,0x2f,0x42);
-         	SiS_SetReg1(SiS_Pr->SiS_P3c4,0x32,0x01);
-         	SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x2b,0x02);
-         	SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x2c,0x00);
-         	SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x2d,0x00);
-     	}
-     	SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0x0f,0x30);
-     	SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x1e,0x7d);
-     	SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x2e,0xe0);
   }
-#endif  /* SIS315H */
 
-  return;
+  if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) {
+     if(SiS_Pr->SiS_VBInfo & SetNotSimuMode) {
+     	SiS_Pr->SiS_SetFlag |= LCDVESATiming;
+     }
+  } else {
+     SiS_Pr->SiS_SetFlag |= LCDVESATiming;
+  }
 
-}
+  SiS_Pr->SiS_LCDInfo661 = 0;
+  if(SiS_Pr->SiS_SetFlag & LCDVESATiming) SiS_Pr->SiS_LCDInfo661 |= 0x0001;
+  if(SiS_Pr->SiS_SetFlag & EnableLVDSDDA) SiS_Pr->SiS_LCDInfo661 |= 0x0002;
+  if(SiS_Pr->SiS_LCDInfo & LCDPass11)     SiS_Pr->SiS_LCDInfo661 |= 0x0008;
+  if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) SiS_Pr->SiS_LCDInfo661 |= 0x0010;
+  SiS_Pr->SiS_LCDInfo661 |= (SiS_Pr->SiS_LCDInfo & 0xe0);
+  if(SiS_Pr->SiS_LCDInfo & LCDDualLink)   SiS_Pr->SiS_LCDInfo661 |= 0x0100;
 
-#ifdef SIS315H
-void
-SiS_CRT2AutoThreshold(SiS_Private *SiS_Pr, USHORT BaseAddr)
-{
-  SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x01,0x40);
-}
+#ifdef LINUX_KERNEL
+#ifdef TWDEBUG
+  printk(KERN_DEBUG "sisfb: (LCDInfo=0x%04x LCDResInfo=0x%02x LCDTypeInfo=0x%02x)\n",
+	SiS_Pr->SiS_LCDInfo, SiS_Pr->SiS_LCDResInfo, SiS_Pr->SiS_LCDTypeInfo);
 #endif
+#endif
+#ifdef LINUX_XF86
+  xf86DrvMsgVerb(0, X_PROBED, 4,
+  	"(init301: LCDInfo=0x%04x LCDResInfo=0x%02x LCDTypeInfo=0x%02x SetFlag=0x%04x)\n",
+	SiS_Pr->SiS_LCDInfo, SiS_Pr->SiS_LCDResInfo, SiS_Pr->SiS_LCDTypeInfo, SiS_Pr->SiS_SetFlag);
+#endif
+}
 
+/*********************************************/
+/*                 GET VCLK                  */
+/*********************************************/
 
-#ifdef SIS315H
-/* TW: For LVDS / 302B/30xLV - LCDA (this must only be called on 310/325 series!) */
-void
-SiS_SetGroup1_LCDA(SiS_Private *SiS_Pr, USHORT  BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
-                   PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT RefreshRateTableIndex)
+USHORT
+SiS_GetVCLK2Ptr(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
+                USHORT RefreshRateTableIndex, PSIS_HW_INFO HwInfo)
 {
+  USHORT tempbx;
+  const USHORT LCDXlat0VCLK[4]    = {VCLK40,       VCLK40,       VCLK40,       VCLK40};
+  const USHORT LVDSXlat1VCLK[4]   = {VCLK40,       VCLK40,       VCLK40,       VCLK40};
+  const USHORT LVDSXlat4VCLK[4]   = {VCLK28,       VCLK28,       VCLK28,       VCLK28};
+#ifdef SIS300
+  const USHORT LCDXlat1VCLK300[4] = {VCLK65_300,   VCLK65_300,   VCLK65_300,   VCLK65_300};
+  const USHORT LCDXlat2VCLK300[4] = {VCLK108_2_300,VCLK108_2_300,VCLK108_2_300,VCLK108_2_300};
+  const USHORT LVDSXlat2VCLK300[4]= {VCLK65_300,   VCLK65_300,   VCLK65_300,   VCLK65_300};
+  const USHORT LVDSXlat3VCLK300[4]= {VCLK65_300,   VCLK65_300,   VCLK65_300,   VCLK65_300};
+#endif
+#ifdef SIS315H
+  const USHORT LCDXlat1VCLK310[4] = {VCLK65_315,   VCLK65_315,   VCLK65_315,   VCLK65_315};
+  const USHORT LCDXlat2VCLK310[4] = {VCLK108_2_315,VCLK108_2_315,VCLK108_2_315,VCLK108_2_315};
+  const USHORT LVDSXlat2VCLK310[4]= {VCLK65_315,   VCLK65_315,   VCLK65_315,   VCLK65_315};
+  const USHORT LVDSXlat3VCLK310[4]= {VCLK108_2_315,VCLK108_2_315,VCLK108_2_315,VCLK108_2_315};
+#endif
+  USHORT CRT2Index,VCLKIndex=0;
   USHORT modeflag,resinfo;
-  USHORT push1,push2,tempax,tempbx,tempcx,temp;
-  ULONG tempeax=0,tempebx,tempecx,tempvcfact;
+  const UCHAR  *CHTVVCLKPtr = NULL;
+  const USHORT *LCDXlatVCLK1 = NULL;
+  const USHORT *LCDXlatVCLK2 = NULL;
+  const USHORT *LVDSXlatVCLK2 = NULL;
+  const USHORT *LVDSXlatVCLK3 = NULL;
 
-  if(IS_SIS330) {
-     SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2D,0x10);			/* Xabre 1.01.03 */
-  } else if(IS_SIS740) {
-     if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {					/* 740/LVDS */
-        SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,0xfb,0x04);      	/* 740/LVDS */
-	SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2D,0x03);
-     } else {
-        SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2D,0x10);			/* 740/301LV 1.10.1i */
-     }
+  if(HwInfo->jChipType >= SIS_315H) {
+#ifdef SIS315H
+     LCDXlatVCLK1 = LCDXlat1VCLK310;
+     LCDXlatVCLK2 = LCDXlat2VCLK310;
+     LVDSXlatVCLK2 = LVDSXlat2VCLK310;
+     LVDSXlatVCLK3 = LVDSXlat3VCLK310;
+#endif
   } else {
-     if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {					/* 650/LVDS */
-        SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,0xfb,0x04);      	/* 650/LVDS */
-	SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2D,0x00);			/* 650/LVDS 1.10.07 */
-     } else {
-        SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2D,0x0f);			/* 650/30xLv 1.10.6s */
-     }
+#ifdef SIS300
+     LCDXlatVCLK1 = LCDXlat1VCLK300;
+     LCDXlatVCLK2 = LCDXlat2VCLK300;
+     LVDSXlatVCLK2 = LVDSXlat2VCLK300;
+     LVDSXlatVCLK3 = LVDSXlat3VCLK300;
+#endif
   }
 
   if(ModeNo <= 0x13) {
-    modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
-    resinfo = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ResInfo;
+     modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
+     resinfo = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ResInfo;
+     CRT2Index = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC;
   } else {
-    modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
-    resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO;
-  }
-
-  tempax = SiS_Pr->SiS_LCDHDES;
-  tempbx = SiS_Pr->SiS_HDE;
-  tempcx = SiS_Pr->SiS_HT;
-
-  if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) {
-        if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768)       tempbx = 1024;
-	else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) tempbx = 1400;
-	else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200) tempbx = 1600;
-	else 							      tempbx = 1280;
+     modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
+     resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO;
+     CRT2Index = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC;
   }
-  tempcx -= tempbx;                        	            	/* HT-HDE  */
-  push1 = tempax;
-  tempax += tempbx;	                                    	/* lcdhdee  */
-  tempbx = SiS_Pr->SiS_HT;
-  if(tempax >= tempbx)	tempax -= tempbx;
-
-  push2 = tempax;						/* push ax   lcdhdee  */
 
-  tempcx >>= 2;
+  if(SiS_Pr->SiS_VBType & VB_SISVB) {    /* 30x/B/LV */
 
-  /* TW: 650/30xLV 1.10.6s, 740/LVDS */
-  if( ((SiS_Pr->SiS_IF_DEF_LVDS == 0) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) ||
-      ((SiS_Pr->SiS_IF_DEF_LVDS == 1) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD)) ) {
-     if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel640x480) {
-        if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel800x600)        tempcx = 0x28;
- 	else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768)  tempcx = 0x18;
-	else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) tempcx = 0x30;
-	else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200) tempcx = 0x40;
-	else                                                          tempcx = 0x30;
-     }
-  }
+     if(SiS_Pr->SiS_SetFlag & ProgrammingCRT2) {
 
-  tempcx += tempax;  	                                  	/* lcdhrs  */
-  if(tempcx >= tempbx) tempcx -= tempbx;
-                                                           	/* v ah,cl  */
-  tempax = tempcx;
-  tempax >>= 3;   	                                     	/* BPLHRS */
-  temp = tempax & 0x00FF;
-  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x14,temp);                 	/* Part1_14h  */
+        CRT2Index >>= 6;
+        if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) {      /*  LCD */
 
-  temp += 10;
-  if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
-     if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
-        if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel640x480) {
-	   temp += 6;
-	   if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel800x600) {
-	      temp++;
-	      if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel1024x768) {
-	         temp += 7;
-		 if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel1600x1200) {
-		    temp -= 10;
+           if(HwInfo->jChipType < SIS_315H) {
+	      if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel800x600) {
+	         VCLKIndex = LCDXlat0VCLK[CRT2Index];
+	      } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) {
+	    	 VCLKIndex = LCDXlatVCLK1[CRT2Index];
+	      } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x600) {
+	    	 VCLKIndex = LCDXlatVCLK1[CRT2Index];
+	      } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1152x768) {
+	    	 VCLKIndex = LCDXlatVCLK1[CRT2Index];
+	      } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x768) {
+	         VCLKIndex = VCLK81_300;	/* guessed */
+	      } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x960) {
+		 VCLKIndex = VCLK108_3_300;
+		 if(resinfo == SIS_RI_1280x1024) VCLKIndex = VCLK100_300;
+	      } else {
+	    	 VCLKIndex = LCDXlatVCLK2[CRT2Index];
+	      }
+	   } else {
+	      if( (SiS_Pr->SiS_VBType & VB_SIS301LV302LV) ||
+	          (!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) ) {
+      	         if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) {
+		    VCLKIndex = VCLK108_2_315;
+		 } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x768) {
+		    VCLKIndex = VCLK81_315;  	/* guessed */
+		 } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) {
+		    VCLKIndex = VCLK108_2_315;
+		 } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200) {
+		    VCLKIndex = VCLK162_315;
+		 } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x960) {
+		    VCLKIndex = VCLK108_3_315;
+		    if(resinfo == SIS_RI_1280x1024) VCLKIndex = VCLK100_315;
+		 } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) {
+		    VCLKIndex = LCDXlatVCLK1[CRT2Index];
+	         } else {
+		    VCLKIndex = LCDXlatVCLK2[CRT2Index];
+      	         }
+	      } else {
+                 VCLKIndex = (UCHAR)SiS_GetRegByte((USHORT)(SiS_Pr->SiS_P3ca+0x02));  /*  Port 3cch */
+         	 VCLKIndex = ((VCLKIndex >> 2) & 0x03);
+        	 if(ModeNo > 0x13) {
+          	    VCLKIndex = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRTVCLK;
+        	 }
+		 if(ModeNo <= 0x13) {
+		    if(HwInfo->jChipType <= SIS_315PRO) {
+		       if(SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC == 1) VCLKIndex = 0x42;
+	            } else {
+		       if(SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC == 1) VCLKIndex = 0x00;
+		    }
+		 }
+		 if(HwInfo->jChipType <= SIS_315PRO) {
+		    if(VCLKIndex == 0) VCLKIndex = 0x41;
+		    if(VCLKIndex == 1) VCLKIndex = 0x43;
+		    if(VCLKIndex == 4) VCLKIndex = 0x44;
 		 }
 	      }
 	   }
-	}
-     }
-  }
-  temp &= 0x1F;
-  temp |= ((tempcx & 0x07) << 5);
-  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x15,temp);                         /* Part1_15h  */
 
-  tempbx = push2;                                          	/* lcdhdee  */
-  tempcx = push1;                                          	/* lcdhdes  */
-  temp = (tempcx & 0x00FF);
-  temp &= 0x07;                                  		/* BPLHDESKEW  */
-  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x1A,temp);                         /* Part1_1Ah  */
+        } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {                 /*  TV */
 
-  tempcx >>= 3;   	                                     	/* BPLHDES */
-  temp = tempcx & 0x00FF;
-  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x16,temp);                         /* Part1_16h  */
+	   if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) {
+              if(SiS_Pr->SiS_TVMode & TVRPLLDIV2XO) VCLKIndex = HiTVVCLKDIV2;
+     	      else                                  VCLKIndex = HiTVVCLK;
+              if(SiS_Pr->SiS_TVMode & TVSetTVSimuMode) {
+            	 if(modeflag & Charx8Dot) 	    VCLKIndex = HiTVSimuVCLK;
+            	 else 			  	    VCLKIndex = HiTVTextVCLK;
+              }
+           } else if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) VCLKIndex = YPbPr750pVCLK - TVCLKBASE_315;
+	   else if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p)   VCLKIndex = TVVCLKDIV2;
+	   else if(SiS_Pr->SiS_TVMode & TVRPLLDIV2XO)     VCLKIndex = TVVCLKDIV2;
+           else         		            	  VCLKIndex = TVVCLK;
 
-  if(SiS_Pr->SiS_IF_DEF_LVDS == 0) {
-     if(tempbx & 0x07) tempbx += 8;
-  }
-  tempbx >>= 3;                                        		/* BPLHDEE  */
-  temp = tempbx & 0x00FF;
-  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x17,temp);                        	/* Part1_17h  */
+	   if(HwInfo->jChipType < SIS_315H) {
+              VCLKIndex += TVCLKBASE_300;
+  	   } else {
+	      VCLKIndex += TVCLKBASE_315;
+	   }
 
-  tempcx = SiS_Pr->SiS_VGAVT;
-  tempbx = SiS_Pr->SiS_VGAVDE;
-  tempcx -= tempbx; 	                                   	/* GAVT-VGAVDE  */
-  tempbx = SiS_Pr->SiS_LCDVDES;                                	/* VGAVDES  */
-  push1 = tempbx;                                      		
-  if(SiS_Pr->SiS_IF_DEF_TRUMPION == 0) {
-    if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768)        tempax = 768;
-    else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x768)   tempax = 768;
-    else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024)  tempax = 1024;
-    else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050)  tempax = 1050;
-    else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200)  tempax = 1200;
-    else                                                           tempax = 960;
-  } else tempax = SiS_Pr->SiS_VGAVDE;  /* Trumpion */
+        } else {         					/* VGA2 */
 
-  tempbx += tempax;
-  tempax = SiS_Pr->SiS_VT;                                    	/* VT  */
-  if(tempbx >= tempax)  tempbx -= tempax;
+           VCLKIndex = (UCHAR)SiS_GetRegByte((USHORT)(SiS_Pr->SiS_P3ca+0x02));
+           VCLKIndex = ((VCLKIndex >> 2) & 0x03);
+           if(ModeNo > 0x13) {
+              VCLKIndex = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRTVCLK;
+	      if(HwInfo->jChipType < SIS_315H) {
+          	 VCLKIndex &= 0x3f;
+		 if( (HwInfo->jChipType == SIS_630) &&
+		     (HwInfo->jChipRevision >= 0x30)) {
+		    if(VCLKIndex == 0x14) VCLKIndex = 0x34;
+		 }
+		 /* Better VGA2 clock for 1280x1024@75 */
+		 if(VCLKIndex == 0x17) VCLKIndex = 0x45;
+	      }
+           }
+        }
 
-  push2 = tempbx;                                      		
- 
-  tempcx >>= 2;	
+     } else {   /* If not programming CRT2 */
 
-  /* TW: 650/30xLV 1.10.6s, 740/LVDS */
-  if( ((SiS_Pr->SiS_IF_DEF_LVDS == 0) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) ||
-      ((SiS_Pr->SiS_IF_DEF_LVDS == 1) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD)) ) {
-     if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel640x480) {
-        if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel800x600)         tempcx = 1;
-   	else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768)   tempcx = 3;
-	else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x768)   tempcx = 3;
-	else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024)  tempcx = 1;
-	else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050)  tempcx = 1;
-	else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200)  tempcx = 1;
-	else                                                           tempcx = 0x0057;
+        VCLKIndex = (UCHAR)SiS_GetRegByte((USHORT)(SiS_Pr->SiS_P3ca+0x02));
+        VCLKIndex = ((VCLKIndex >> 2) & 0x03);
+        if(ModeNo > 0x13) {
+           VCLKIndex = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRTVCLK;
+	   if(HwInfo->jChipType < SIS_315H) {
+              VCLKIndex &= 0x3f;
+	      if( (HwInfo->jChipType != SIS_630) &&
+		  (HwInfo->jChipType != SIS_300) ) {
+		 if(VCLKIndex == 0x1b) VCLKIndex = 0x35;
+	      }
+	   }
+        }
      }
-  }
 
-  tempbx += tempcx;
-  if(SiS_Pr->SiS_IF_DEF_LVDS == 0) {
-     tempbx++;                                                	/* BPLVRS  */
-  }
-  if(tempbx >= tempax)   tempbx -= tempax;
-  temp = tempbx & 0x00FF;
-  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x18,temp);                             /* Part1_18h  */
+  } else {       /*   LVDS  */
 
-  tempcx >>= 3;
-  if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
-     if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
-        if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel640x480) {
-	   if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel800x600)         tempcx = 3;
-   	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768)   tempcx = 5;
-	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x768)   tempcx = 5;
-	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024)  tempcx = 5;
-	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050)  tempcx = 2;
-	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200)  tempcx = 2;
-	}
-     }
-  }
-  tempcx += tempbx;
-  tempcx++;                                                	/* BPLVRE  */
-  temp = tempcx & 0x00FF;
-  temp &= 0x0F;
-  if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
-     SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0xF0,temp);
-  } else {
-     /* TW: 650/30xLV 1.10.6s, Xabre */
-     temp |= 0xC0;
-     SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0xF0,temp);             /* Part1_19h  */
-  }
+     VCLKIndex = CRT2Index;
 
-  temp = (tempbx & 0xFF00) >> 8;
-  temp &= 0x07;
-  temp <<= 3;  		                               		/* BPLDESKEW =0 */
-  tempbx = SiS_Pr->SiS_VGAVDE;
-  if(tempbx != SiS_Pr->SiS_VDE)              temp |= 0x40;
-  if(SiS_Pr->SiS_SetFlag & EnableLVDSDDA)    temp |= 0x40;
-  if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
-     if(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit) {
-        if(SiS_GetReg1(SiS_Pr->SiS_Part1Port,0x00) & 0x01) temp |= 0x80;
-     }
-  } else {
-     if(IS_SIS650) {
-        /* TW: 650/30xLV 1.10.6s */
-        if(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit) {
-           if(SiS_GetReg1(SiS_Pr->SiS_Part1Port,0x00) & 0x01) temp |= 0x80;
+     if(SiS_Pr->SiS_SetFlag & ProgrammingCRT2) {  /* programming CRT2 */
+
+        if( (SiS_Pr->SiS_IF_DEF_CH70xx != 0) && (SiS_Pr->SiS_VBInfo & SetCRT2ToTV) ) {
+
+	   VCLKIndex &= 0x1f;
+           tempbx = 0;
+	   if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) tempbx += 1;
+           if(SiS_Pr->SiS_TVMode & TVSetPAL) {
+	      tempbx += 2;
+	      if(SiS_Pr->SiS_ModeType > ModeVGA) {
+		 if(SiS_Pr->SiS_CHSOverScan) tempbx = 8;
+	      }
+	      if(SiS_Pr->SiS_TVMode & TVSetPALM) {
+		 tempbx = 4;
+		 if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) tempbx += 1;
+	      } else if(SiS_Pr->SiS_TVMode & TVSetPALN) {
+		 tempbx = 6;
+		 if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) tempbx += 1;
+	      }
+	   }
+       	   switch(tempbx) {
+             case  0: CHTVVCLKPtr = SiS_Pr->SiS_CHTVVCLKUNTSC;  break;
+             case  1: CHTVVCLKPtr = SiS_Pr->SiS_CHTVVCLKONTSC;  break;
+             case  2: CHTVVCLKPtr = SiS_Pr->SiS_CHTVVCLKUPAL;   break;
+             case  3: CHTVVCLKPtr = SiS_Pr->SiS_CHTVVCLKOPAL;   break;
+	     case  4: CHTVVCLKPtr = SiS_Pr->SiS_CHTVVCLKUPALM;  break;
+             case  5: CHTVVCLKPtr = SiS_Pr->SiS_CHTVVCLKOPALM;  break;
+             case  6: CHTVVCLKPtr = SiS_Pr->SiS_CHTVVCLKUPALN;  break;
+             case  7: CHTVVCLKPtr = SiS_Pr->SiS_CHTVVCLKOPALN;  break;
+	     case  8: CHTVVCLKPtr = SiS_Pr->SiS_CHTVVCLKSOPAL;  break;
+	     default: CHTVVCLKPtr = SiS_Pr->SiS_CHTVVCLKOPAL;   break;
+           }
+           VCLKIndex = CHTVVCLKPtr[VCLKIndex];
+
+        } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
+
+	   VCLKIndex >>= 6;
+     	   if((SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel800x600) ||
+	      (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel320x480))
+     	      VCLKIndex = LVDSXlat1VCLK[VCLKIndex];
+	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480   ||
+	           SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480_2 ||
+		   SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480_3)
+	      VCLKIndex = LVDSXlat4VCLK[VCLKIndex];
+     	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768)
+     	      VCLKIndex = LVDSXlatVCLK2[VCLKIndex];
+	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x600)
+              VCLKIndex = LVDSXlatVCLK2[VCLKIndex];
+	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1152x768)
+              VCLKIndex = LVDSXlatVCLK2[VCLKIndex];
+	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x768)
+	      VCLKIndex = VCLK68_315;
+	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200)
+	      VCLKIndex = VCLK162_315;
+     	   else
+	      VCLKIndex = LVDSXlatVCLK3[VCLKIndex];
+
+	   if(SiS_Pr->SiS_CustomT == CUT_BARCO1366) {
+	      /* Special Timing: Barco iQ Pro R series */
+	      VCLKIndex = 0x44;
+	   }
+
+	   if(SiS_Pr->SiS_CustomT == CUT_PANEL848) {
+	      if(HwInfo->jChipType < SIS_315H) {
+		 VCLKIndex = VCLK34_300;
+	         /* if(resinfo == SIS_RI_1360x768) VCLKIndex = ?; */
+	      } else {
+		 VCLKIndex = VCLK34_315;
+		 /* if(resinfo == SIS_RI_1360x768) VCLKIndex = ?; */
+	      }
+	   }
+
+        } else {
+
+	   VCLKIndex = (UCHAR)SiS_GetRegByte((USHORT)(SiS_Pr->SiS_P3ca+0x02));
+           VCLKIndex = ((VCLKIndex >> 2) & 0x03);
+           if(ModeNo > 0x13) {
+              VCLKIndex = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRTVCLK;
+	      if(HwInfo->jChipType < SIS_315H) {
+    	 	 VCLKIndex &= 0x3F;
+              }
+	      if( (HwInfo->jChipType == SIS_630) &&
+                  (HwInfo->jChipRevision >= 0x30) ) {
+		 if(VCLKIndex == 0x14) VCLKIndex = 0x2e;
+	      }
+	   }
         }
-     } else {
-	if(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit)  temp |= 0x80;
+
+     } else {  /* if not programming CRT2 */
+
+        VCLKIndex = (UCHAR)SiS_GetRegByte((USHORT)(SiS_Pr->SiS_P3ca+0x02));
+        VCLKIndex = ((VCLKIndex >> 2) & 0x03);
+        if(ModeNo > 0x13) {
+           VCLKIndex = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRTVCLK;
+           if(HwInfo->jChipType < SIS_315H) {
+	      VCLKIndex &= 0x3F;
+	      if( (HwInfo->jChipType != SIS_630) &&
+	          (HwInfo->jChipType != SIS_300) ) {
+		 if(VCLKIndex == 0x1b) VCLKIndex = 0x35;
+	      }
+#if 0
+	      if(HwInfo->jChipType == SIS_730) {
+		 if(VCLKIndex == 0x0b) VCLKIndex = 0x40;   /* 1024x768-70 */
+		 if(VCLKIndex == 0x0d) VCLKIndex = 0x41;   /* 1024x768-75 */
+	      }
+#endif
+	   }
+        }
+
      }
+
   }
-  SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x1A,0x87,temp);            /* Part1_1Ah */
 
-  tempbx = push2;                                      		/* BPLVDEE  */
-  tempcx = push1;                                      		/* NPLVDES */
-  push1 = (USHORT)(tempeax & 0xFFFF);
+#ifdef TWDEBUG
+  xf86DrvMsg(0, X_INFO, "VCLKIndex %d (0x%x)\n", VCLKIndex, VCLKIndex);
+#endif
 
-  if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) {
-    if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel800x600) {
-      if(resinfo == 7) tempcx++;
-    }
-  }
-  if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480) {
-    tempbx = SiS_Pr->SiS_VGAVDE;
-    tempcx = tempbx;
-    tempbx--;
-  }
+  return(VCLKIndex);
+}
 
-  temp = (tempbx & 0xFF00) >> 8;
-  temp &= 0x07;
-  temp <<= 3;
-  temp = temp | (((tempcx & 0xFF00) >> 8) & 0x07);
-  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x1D,temp);                          /* Part1_1Dh */
+/*********************************************/
+/*        SET CRT2 MODE TYPE REGISTERS       */
+/*********************************************/
 
-  temp = tempbx & 0x00FF;
-  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x1C,temp);                          /* Part1_1Ch  */
+static void
+SiS_SetCRT2ModeRegs(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
+                    PSIS_HW_INFO HwInfo)
+{
+  USHORT i,j,modeflag;
+  USHORT tempcl,tempah=0;
+#ifdef SIS300
+  USHORT temp;
+#endif
+#ifdef SIS315H
+  USHORT tempbl, tempah2, tempbl2;
+#endif
 
-  temp = tempcx & 0x00FF;
-  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x1B,temp);                          /* Part1_1Bh  */
+  if(ModeNo <= 0x13) {
+     modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
+  } else {
+     if(SiS_Pr->UseCustomMode) {
+        modeflag = SiS_Pr->CModeFlag;
+     } else {
+    	modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
+     }
+  }
 
-  tempecx = SiS_Pr->SiS_VGAVT;
-  tempebx = SiS_Pr->SiS_VDE;
-  tempeax = SiS_Pr->SiS_VGAVDE;
-  tempecx -= tempeax;    	                             	/* VGAVT-VGAVDE  */
-  tempeax <<= 18;
-  temp = (USHORT)(tempeax % tempebx);
-  tempeax = tempeax / tempebx;
-  if(temp)  tempeax++;
-  tempebx = tempeax;                                        	/* BPLVCFACT  */
-  tempvcfact = tempeax;
-  temp = (USHORT)(tempebx & 0x00FF);
-  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x37,temp);
+  /* BIOS does not do this (neither 301 nor LVDS) */
+  /* (But it's harmless; see SetCRT2Offset) */
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x03,0x00);   /* fix write part1 index 0  BTDRAM bit Bug */
 
-  temp = (USHORT)((tempebx & 0x00FF00) >> 8);
-  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x36,temp);
+  if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) {
 
-  temp = (USHORT)((tempebx & 0x00030000) >> 16);
-  if(SiS_Pr->SiS_VDE == SiS_Pr->SiS_VGAVDE) temp |= 0x04;
-  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x35,temp);
+     SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x00,0xAF,0x40);
+     SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2E,0xF7);
 
-  tempecx = SiS_Pr->SiS_VGAHDE;
-  if(modeflag & HalfDCLK) tempecx >>= 1;
-  tempebx = SiS_Pr->SiS_HDE;
-  tempeax = tempecx;
-  tempeax <<= 16;
-  temp = tempeax % tempebx;
-  tempeax = tempeax / tempebx;
-  if(temp) tempeax++;
-  if(tempebx == tempecx)  tempeax = 0xFFFF;
-  tempecx = tempeax;
-  tempeax = SiS_Pr->SiS_VGAHDE;
-  if(modeflag & HalfDCLK) tempeax >>= 1;
-  tempeax <<= 16;
-  tempeax = tempeax / tempecx;
-  tempecx <<= 16;
-  tempeax--;
-  tempecx = tempecx | (tempeax & 0xFFFF);
-  temp = (USHORT)(tempecx & 0x00FF);
-  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x1F,temp);                          /* Part1_1Fh  */
+  } else {
 
-  tempeax = SiS_Pr->SiS_VGAVDE;
-  tempeax <<= 18;
-  tempeax = tempeax / tempvcfact;
-  tempbx = (USHORT)(tempeax & 0x0FFFF);
+     for(i=0,j=4; i<3; i++,j++) SiS_SetReg(SiS_Pr->SiS_Part1Port,j,0);
 
-  if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) tempbx--;
+     tempcl = SiS_Pr->SiS_ModeType;
 
-  if(SiS_Pr->SiS_SetFlag & EnableLVDSDDA)  tempbx = 1;
+     if(HwInfo->jChipType < SIS_315H) {
 
-  temp = ((tempbx & 0xFF00) >> 8) << 3;
-  temp = temp | (USHORT)(((tempecx & 0x0000FF00) >> 8) & 0x07);
-  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x20,temp);                         /* Part1_20h */
+#ifdef SIS300    /* ---- 300 series ---- */
 
-  temp = tempbx & 0x00FF;
-  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x21,temp);                         /* Part1_21h */
+        /* For 301BDH: (with LCD via LVDS) */
+        if(SiS_Pr->SiS_VBType & VB_NoLCD) {
+	   temp = SiS_GetReg(SiS_Pr->SiS_P3c4,0x32);
+	   temp &= 0xef;
+	   temp |= 0x02;
+	   if((SiS_Pr->SiS_VBInfo & SetCRT2ToTV) || (SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC)) {
+	      temp |= 0x10;
+	      temp &= 0xfd;
+	   }
+	   SiS_SetReg(SiS_Pr->SiS_P3c4,0x32,temp);
+        }
 
-  tempecx >>= 16;   	                                  	/* BPLHCFACT  */
-  if(modeflag & HalfDCLK) tempecx >>= 1;
-  temp = (USHORT)((tempecx & 0x0000FF00) >> 8);
-  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x22,temp);                         /* Part1_22h */
+        if(ModeNo > 0x13) {
+           tempcl -= ModeVGA;
+           if((tempcl > 0) || (tempcl == 0)) {      /* tempcl is USHORT -> always true! */
+              tempah = ((0x10 >> tempcl) | 0x80);
+           }
+        } else tempah = 0x80;
 
-  temp=(USHORT)(tempecx & 0x000000FF);
-  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x23,temp);
+        if(SiS_Pr->SiS_VBInfo & SetInSlaveMode)  tempah ^= 0xA0;
 
-#if 0
-  /* TW: Missing code (calles int 2f) (650/302LV 1.10.6s; 1.10.7w doesn't do this) */
-  if(xxx()) {
-      SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x0e,0xda);
-  }
-#endif
+#endif  /* SIS300 */
 
-  /* TW: Only for LVDS and 301LV/302LV */
-  if((SiS_Pr->SiS_IF_DEF_LVDS == 1) || (SiS_Pr->SiS_VBInfo & VB_SIS301LV302LV)){
-  	SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x1e,0x20);
-  }
+     } else {
 
-  return;
-}
-#endif  /* SIS 315 */
+#ifdef SIS315H    /* ------- 315/330 series ------ */
 
-void SiS_SetCRT2Offset(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,
-                       USHORT ModeIdIndex ,USHORT RefreshRateTableIndex,
-		       PSIS_HW_DEVICE_INFO HwDeviceExtension)
-{
-  USHORT offset;
-  UCHAR temp;
+        if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
+           if(SiS_Pr->SiS_VBInfo & DisableCRT2Display) {
+	      SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2e,0x08);
+           }
+        }
 
-  if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) return;
+        if(ModeNo > 0x13) {
+           tempcl -= ModeVGA;
+           if((tempcl > 0) || (tempcl == 0)) {  /* tempcl is USHORT -> always true! */
+              tempah = (0x08 >> tempcl);
+              if (tempah == 0) tempah = 1;
+              tempah |= 0x40;
+           }
+        } else tempah = 0x40;
 
-  offset = SiS_GetOffset(SiS_Pr,ROMAddr,ModeNo,ModeIdIndex,RefreshRateTableIndex,
-                         HwDeviceExtension);
-#if 0
-  if(SiS_Pr->LCDResInfo == 13) offset >>= 1;
-  if(SiS_Pr->LCDResInfo == 12) offset >>= 1;
-#endif			 
-  temp = (UCHAR)(offset & 0xFF);
-  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x07,temp);
-  temp = (UCHAR)((offset & 0xFF00) >> 8);
-  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x09,temp);
-  temp = (UCHAR)(((offset >> 3) & 0xFF) + 1);
-  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x03,temp);
-}
+        if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) tempah ^= 0x50;
 
-USHORT
-SiS_GetOffset(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
-              USHORT RefreshRateTableIndex,PSIS_HW_DEVICE_INFO HwDeviceExtension)
-{
-  USHORT temp,colordepth;
-  USHORT modeinfo,index,infoflag;
+#endif  /* SIS315H */
 
-  if(SiS_Pr->UseCustomMode) {
-     infoflag = SiS_Pr->CInfoFlag;
-     temp = SiS_Pr->CHDisplay / 16;
-  } else {
-     infoflag = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_InfoFlag;
-     modeinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeInfo;
-  
-     if(HwDeviceExtension->jChipType < SIS_315H ) {
-    	index = (modeinfo >> 4) & 0xFF;
-     } else {
-    	index = (modeinfo >> 8) & 0xFF;
      }
 
-     temp = SiS_Pr->SiS_ScreenOffset[index];
-  }
-  
-  colordepth = SiS_GetColorDepth(SiS_Pr,ROMAddr,ModeNo,ModeIdIndex);
+     if(SiS_Pr->SiS_VBInfo & DisableCRT2Display) tempah = 0;
 
-  if(infoflag & InterlaceMode) temp <<= 1;
+     if(HwInfo->jChipType < SIS_315H) {
+        SiS_SetReg(SiS_Pr->SiS_Part1Port,0x00,tempah);
+     } else {
+        if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
+           SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x00,0xa0,tempah);
+        } else if(SiS_Pr->SiS_VBType & VB_SISVB) {
+           if(IS_SIS740) {
+	      SiS_SetReg(SiS_Pr->SiS_Part1Port,0x00,tempah);
+	   } else {
+              SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x00,0xa0,tempah);
+	   }
+        }
+     }
 
-  temp *= colordepth;
+     if(SiS_Pr->SiS_VBType & VB_SISVB) {
 
-  /* TW: For 1400x1050 and 856x480 */
-  if( ( ((ModeNo >= 0x26) && (ModeNo <= 0x28)) || 
-        ModeNo == 0x3f || 
-	ModeNo == 0x42 || 
-	ModeNo == 0x45 ) ||
-      (SiS_Pr->UseCustomMode && (SiS_Pr->CHDisplay % 16)) ) {
-        colordepth >>= 1;
-	temp += colordepth;
-  }
+        tempah = 0x01;
+        if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) {
+      	   tempah |= 0x02;
+        }
+        if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC)) {
+      	   tempah ^= 0x05;
+      	   if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD)) {
+              tempah ^= 0x01;
+      	   }
+        }
 
-  return(temp);
-}
+        if(SiS_Pr->SiS_VBInfo & DisableCRT2Display)  tempah = 0;
 
-USHORT
-SiS_GetColorDepth(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex)
-{
-  USHORT ColorDepth[6] = { 1, 2, 4, 4, 6, 8};
-  SHORT  index;
-  USHORT modeflag;
+        if(HwInfo->jChipType < SIS_315H) {
 
-  if(SiS_Pr->UseCustomMode) {
-     modeflag = SiS_Pr->CModeFlag;
-  } else {
-     if(ModeNo <= 0x13)
-    	modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
-     else
-    	modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
-  }	
+      	   tempah = (tempah << 5) & 0xFF;
+      	   SiS_SetReg(SiS_Pr->SiS_Part1Port,0x01,tempah);
+      	   tempah = (tempah >> 5) & 0xFF;
 
-  index = (modeflag & ModeInfoFlag) - ModeEGA;
-  if(index < 0) index = 0;
-  return(ColorDepth[index]);
-}
+        } else {
 
-void
-SiS_SetCRT2Sync(SiS_Private *SiS_Pr, USHORT BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,
-                USHORT RefreshRateTableIndex,PSIS_HW_DEVICE_INFO HwDeviceExtension)
-{
-  USHORT tempah=0,tempbl,infoflag,flag;
+      	   SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2E,0xF8,tempah);
 
-  flag = 0;
-  tempbl = 0xC0;
+        }
 
-  infoflag = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_InfoFlag;
+        if((SiS_Pr->SiS_ModeType == ModeVGA) && (!(SiS_Pr->SiS_VBInfo & SetInSlaveMode))) {
+      	   tempah |= 0x10;
+        }
 
-  if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {					/* LVDS */
+        if((HwInfo->jChipType < SIS_315H) && (SiS_Pr->SiS_VBType & VB_SIS301)) {
+	   if((SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) ||
+	      (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x960)) {
+	      tempah |= 0x80;
+	   }
+        } else {
+	   tempah |= 0x80;
+        }
 
-    if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
-       tempah = 0;
-    } else if((SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) && (SiS_Pr->SiS_LCDInfo & LCDSync)) {
-       tempah = SiS_Pr->SiS_LCDInfo;
-    } else tempah = infoflag >> 8;
-    
-    tempah &= 0xC0;
-    
-    tempah |= 0x20;
-    if(!(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit)) tempah |= 0x10;
+        if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
+	   if(!(SiS_Pr->SiS_TVMode & (TVSetYPbPr750p | TVSetYPbPr525p))) {
+      	      if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) {
+                 tempah |= 0x20;
+	      }
+      	   }
+        }
 
-    if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
-       if(HwDeviceExtension->jChipType >= SIS_315H) {
-          tempah >>= 3;
-          SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,0xE7,tempah);
-       }
-    } else {
-       SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0x0F,tempah);
-    }
+        SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x0D,0x40,tempah);
 
-  } else {
+        tempah = 0;
 
-     if(HwDeviceExtension->jChipType < SIS_315H) {
+	if(SiS_IsDualLink(SiS_Pr, HwInfo)) tempah |= 0x40;
 
-#ifdef SIS300  /* ---- 300 series --- */
+        if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
+	   if(SiS_Pr->SiS_TVMode & TVRPLLDIV2XO) {
+              tempah |= 0x40;
+       	   }
+        }
 
-        if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {			/* 630 - 301B(-DH) */
+	if((SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) ||
+	   (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x960)  ||
+	   ((SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_PanelCustom) &&
+	    (SiS_Pr->CP_MaxX >= 1280) && (SiS_Pr->CP_MaxY >= 960))) {
+	   tempah |= 0x80;
+        }
 
-            if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
-               tempah = SiS_Pr->SiS_LCDInfo;
-	       if(SiS_Pr->SiS_LCDInfo & LCDSync) {
-                  flag = 1;
-               }
-            }
-            if(flag != 1) tempah = infoflag >> 8;
-            tempah &= 0xC0;
-	    
-            tempah |= 0x20;
-            if(!(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit)) tempah |= 0x10;
+        SiS_SetReg(SiS_Pr->SiS_Part4Port,0x0C,tempah);
 
-            if (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480) {
-	       	/* TW: BIOS does something here @@@ */
-            }
+     } else {  /* LVDS */
 
- 	    tempah &= 0x3f;
-  	    tempah |= tempbl;
-            SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0x0F,tempah);
-
-         } else {							/* 630 - 301 */
-
-            if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
-               tempah = SiS_Pr->SiS_LCDInfo;
-	       if(SiS_Pr->SiS_LCDInfo & DontExpandLCDShift) { /* ! */
-	          flag = 1;
-	       }
-            }
-            if(flag != 1) tempah = infoflag >> 8;
-            tempah &= 0xC0;
-            tempah |= 0x30;
-            SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0x3F,tempah);
+        if(HwInfo->jChipType >= SIS_315H) {
 
-         }
+	   /* LVDS can only be slave in 8bpp modes */
+	   tempah = 0x80;
+	   if((modeflag & CRT2Mode) && (SiS_Pr->SiS_ModeType > ModeVGA)) {
+	      if(SiS_Pr->SiS_VBInfo & DriverMode) {
+	         tempah |= 0x02;
+	      }
+	   }
 
-#endif /* SIS300 */
+	   if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) {
+              tempah |= 0x02;
+    	   }
 
-      } else {
+	   if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
+	      tempah ^= 0x01;
+	   }
 
-#ifdef SIS315H  /* ----- 310/325 series ---- */
+	   if(SiS_Pr->SiS_VBInfo & DisableCRT2Display) {
+	      tempah = 1;
+	   }
 
-         if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {	  		/* 310/325 - 30xLV */
+    	   SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2e,0xF0,tempah);
+
+        } else {
+
+	   tempah = 0;
+	   if( (!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) && (SiS_Pr->SiS_ModeType > ModeVGA) ) {
+              tempah |= 0x02;
+    	   }
+	   tempah <<= 5;
+
+	   if(SiS_Pr->SiS_VBInfo & DisableCRT2Display)  tempah = 0;
+
+	   SiS_SetReg(SiS_Pr->SiS_Part1Port,0x01,tempah);
+
+        }
+
+     }
+
+  }  /* LCDA */
+
+  if(SiS_Pr->SiS_VBType & VB_SISVB) {
+
+     if(HwInfo->jChipType >= SIS_315H) {
+
+#ifdef SIS315H
+
+        unsigned char bridgerev = SiS_GetReg(SiS_Pr->SiS_Part4Port,0x01);;
+
+	/* The following is nearly unpreditable and varies from machine
+	 * to machine. Especially the 301DH seems to be a real trouble
+	 * maker. Some BIOSes simply set the registers (like in the
+	 * NoLCD-if-statements here), some set them according to the
+	 * LCDA stuff. It is very likely that some machines are not
+	 * treated correctly in the following, very case-orientated
+	 * code. What do I do then...?
+	 */
+
+	/* 740 variants match for 30xB, 301B-DH, 30xLV */
+
+        if(!(IS_SIS740)) {
+           tempah = 0x04;						   /* For all bridges */
+           tempbl = 0xfb;
+           if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) {
+              tempah = 0x00;
+	      if(SiS_IsDualEdge(SiS_Pr, HwInfo)) {
+	         tempbl = 0xff;
+	      }
+           }
+           SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,tempbl,tempah);
+	}
+
+	/* The following two are responsible for eventually wrong colors
+	 * in TV output. The DH (VB_NoLCD) conditions are unknown; the
+	 * b0 was found in some 651 machine (Pim; P4_23=0xe5); the b1 version
+	 * in a 650 box (Jake). What is the criteria?
+	 */
+
+	if((IS_SIS740) || (HwInfo->jChipType >= SIS_661)) {
+	   tempah = 0x30;
+	   tempbl = 0xc0;
+	   if(SiS_Pr->SiS_VBInfo & DisableCRT2Display) {
+	      tempah = 0x00;
+	      tempbl = 0x00;
+	   }
+	   SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2c,0xcf,tempah);
+	   SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x21,0x3f,tempbl);
+	} else if(SiS_Pr->SiS_VBType & VB_SIS301) {
+	   /* Fixes "TV-blue-bug" on 315+301 */
+	   SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2c,0xcf);     /* For 301   */
+	   SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x21,0x3f);
+	} else if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {
+	   SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2c,0x30);      /* For 30xLV */
+	   SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x21,0xc0);
+	} else if((SiS_Pr->SiS_VBType & VB_NoLCD) && (bridgerev == 0xb0)) {
+	   SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2c,0x30);      /* For 30xB-DH rev b0 (or "DH on 651"?) */
+	   SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x21,0xc0);
+	} else {
+	   tempah = 0x30; tempah2 = 0xc0;		       /* For 30xB (and 301BDH rev b1) */
+	   tempbl = 0xcf; tempbl2 = 0x3f;
+	   if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) {
+	      tempah = tempah2 = 0x00;
+	      if(SiS_IsDualEdge(SiS_Pr, HwInfo)) {
+		 tempbl = tempbl2 = 0xff;
+	      }
+	   }
+	   SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2c,tempbl,tempah);
+	   SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x21,tempbl2,tempah2);
+	}
+
+	if(IS_SIS740) {
+	   tempah = 0x80;
+	   if(SiS_Pr->SiS_VBInfo & DisableCRT2Display) {
+	      tempah = 0x00;
+	   }
+	   SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x23,0x7f,tempah);
+	} else {
+	   tempah = 0x00;
+           tempbl = 0x7f;
+           if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) {
+              tempbl = 0xff;
+	      if(!(SiS_IsDualEdge(SiS_Pr, HwInfo))) {
+	         tempah = 0x80;
+	      }
+           }
+           SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x23,tempbl,tempah);
+	}
+
+	/* 661: Sets p4 27 and 34 here, done in SetGroup4 here */
+
+#endif /* SIS315H */
+
+     } else if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
+
+        SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x21,0x3f);
+
+        if((SiS_Pr->SiS_VBInfo & DisableCRT2Display) ||
+           (   (SiS_Pr->SiS_VBType & VB_NoLCD) &&
+	       (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) ) ) {
+	   SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x23,0x7F);
+	} else {
+	   SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x23,0x80);
+	}
+
+     }
+
+  } else {  /* LVDS */
+
+#ifdef SIS315H
+     if(HwInfo->jChipType >= SIS_315H) {
+
+        if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) {
+
+           tempah = 0x04;
+	   tempbl = 0xfb;
+           if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) {
+              tempah = 0x00;
+	      if(SiS_IsDualEdge(SiS_Pr, HwInfo)) {
+	         tempbl = 0xff;
+	      }
+           }
+	   SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,tempbl,tempah);
+
+	   if(SiS_Pr->SiS_VBInfo & DisableCRT2Display) {
+	      SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x13,0xfb);
+	   }
+
+	   SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2c,0x30);
+
+	} else if(HwInfo->jChipType == SIS_550) {
+
+	   SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x13,0xfb);
+	   SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2c,0x30);
+
+	}
+
+     }
+#endif
+
+  }
+
+}
+
+/*********************************************/
+/*            GET RESOLUTION DATA            */
+/*********************************************/
+
+USHORT
+SiS_GetResInfo(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdIndex)
+{
+  USHORT resindex;
+
+  if(ModeNo <= 0x13)
+     resindex = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ResInfo;
+  else
+     resindex = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO;
+
+  return(resindex);
+}
+
+static void
+SiS_GetCRT2ResInfo(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdIndex,
+                   PSIS_HW_INFO HwInfo)
+{
+  USHORT xres,yres,modeflag=0,resindex;
+
+  if(SiS_Pr->UseCustomMode) {
+     SiS_Pr->SiS_VGAHDE = SiS_Pr->SiS_HDE = SiS_Pr->CHDisplay;
+     SiS_Pr->SiS_VGAVDE = SiS_Pr->SiS_VDE = SiS_Pr->CVDisplay;
+     return;
+  }
+
+  resindex = SiS_GetResInfo(SiS_Pr,ModeNo,ModeIdIndex);
+
+  if(ModeNo <= 0x13) {
+     xres = SiS_Pr->SiS_StResInfo[resindex].HTotal;
+     yres = SiS_Pr->SiS_StResInfo[resindex].VTotal;
+  } else {
+     xres = SiS_Pr->SiS_ModeResInfo[resindex].HTotal;
+     yres = SiS_Pr->SiS_ModeResInfo[resindex].VTotal;
+     modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
+  }
+
+  if((!SiS_Pr->SiS_IF_DEF_DSTN) && (!SiS_Pr->SiS_IF_DEF_FSTN)) {
+
+     if((HwInfo->jChipType >= SIS_315H) && (SiS_Pr->SiS_IF_DEF_LVDS == 1)) {
+        if((ModeNo != 0x03) && (SiS_Pr->SiS_SetFlag & SetDOSMode)) {
+           if(yres == 350) yres = 400;
+        }
+        if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x3a) & 0x01) {
+ 	   if(ModeNo == 0x12) yres = 400;
+        }
+     }
+
+     if(ModeNo > 0x13) {
+  	if(modeflag & HalfDCLK)       xres *= 2;
+  	if(modeflag & DoubleScanMode) yres *= 2;
+     }
+
+  }
+
+  if(SiS_Pr->SiS_VBType & VB_SISVB) {
+        if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) {
+           if(xres == 720) xres = 640;
+	} else {
+	   if(SiS_Pr->SiS_VBType & VB_NoLCD) {           /* 301BDH */
+	        if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToHiVision)) {
+                   if(xres == 720) xres = 640;
+		}
+		if(SiS_Pr->SiS_SetFlag & SetDOSMode) {
+	           yres = 400;
+	           if(HwInfo->jChipType >= SIS_315H) {
+	              if(SiS_GetReg(SiS_Pr->SiS_P3c4,0x17) & 0x80) yres = 480;
+	           } else {
+	              if(SiS_GetReg(SiS_Pr->SiS_P3c4,0x13) & 0x80) yres = 480;
+	           }
+	        }
+	   } else {
+	      if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToHiVision)) {
+	         if(xres == 720) xres = 640;
+	      }
+	      if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
+		 if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200) {
+		    if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) {
+        	       if(yres == 1024) yres = 1056;
+      		    }
+		 } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) {
+		    if(!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) {
+		       /* BIOS bug - does this regardless of scaling */
+      		       if(yres == 400) yres = 405;
+		    }
+      		    if(yres == 350) yres = 360;
+      		    if(SiS_Pr->SiS_SetFlag & LCDVESATiming) {
+        	       if(yres == 360) yres = 375;
+      		    }
+   	         } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) {
+      		    if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) {
+        	       if(!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) {
+          	          if(yres == 350) yres = 357;
+          	          if(yres == 400) yres = 420;
+            	          if(yres == 480) yres = 525;
+        	       }
+      		    }
+    	         }
+	      }
+	   }
+	}
+  } else {
+    	if(xres == 720) xres = 640;
+	if(SiS_Pr->SiS_SetFlag & SetDOSMode) {
+	   yres = 400;
+	   if(HwInfo->jChipType >= SIS_315H) {
+	      if(SiS_GetReg(SiS_Pr->SiS_P3c4,0x17) & 0x80) yres = 480;
+	   } else {
+	      if(SiS_GetReg(SiS_Pr->SiS_P3c4,0x13) & 0x80) yres = 480;
+	   }
+	   if(SiS_Pr->SiS_IF_DEF_DSTN || SiS_Pr->SiS_IF_DEF_FSTN) {
+	      yres = 480;
+	   }
+	}
+  }
+  SiS_Pr->SiS_VGAHDE = SiS_Pr->SiS_HDE = xres;
+  SiS_Pr->SiS_VGAVDE = SiS_Pr->SiS_VDE = yres;
+}
+
+/*********************************************/
+/*           GET CRT2 TIMING DATA            */
+/*********************************************/
+
+static BOOLEAN
+SiS_GetLVDSCRT1Ptr(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
+		   USHORT RefreshRateTableIndex, USHORT *ResIndex,
+		   USHORT *DisplayType)
+ {
+  USHORT tempbx,modeflag=0;
+  USHORT Flag,CRT2CRTC;
+
+  if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
+     if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) {
+        if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) return FALSE;
+     }
+  } else if(SiS_Pr->SiS_VBType & VB_SISVB) {
+     if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) return FALSE;
+  } else
+     return FALSE;
+
+  if(ModeNo <= 0x13) {
+     modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
+     CRT2CRTC = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC;
+  } else {
+     modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
+     CRT2CRTC = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC;
+  }
+
+  Flag = 1;
+  tempbx = 0;
+  if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) {
+     if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD)) {
+        Flag = 0;
+        tempbx = 18;
+        if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) tempbx++;
+        if(SiS_Pr->SiS_TVMode & TVSetPAL) {
+      	   tempbx += 2;
+	   if(SiS_Pr->SiS_ModeType > ModeVGA) {
+	      if(SiS_Pr->SiS_CHSOverScan) tempbx = 99;
+	   }
+	   if(SiS_Pr->SiS_TVMode & TVSetPALM) {
+	      tempbx = 18;  /* PALM uses NTSC data */
+	      if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) tempbx++;
+	   } else if(SiS_Pr->SiS_TVMode & TVSetPALN) {
+	      tempbx = 20;  /* PALN uses PAL data  */
+	      if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) tempbx++;
+	   }
+        }
+     }
+  }
+  if(Flag) {
+     tempbx = SiS_Pr->SiS_LCDResInfo;
+     tempbx -= SiS_Pr->SiS_PanelMinLVDS;
+     if(SiS_Pr->SiS_LCDResInfo <= SiS_Pr->SiS_Panel1280x1024) {
+        if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx += 6;
+        if(modeflag & HalfDCLK) tempbx += 3;
+     } else {
+        if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) {
+           tempbx = 14;
+	   if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx += 2;
+	   if(modeflag & HalfDCLK) tempbx++;
+        } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x600) {
+           tempbx = 23;
+	   if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx += 2;
+	   if(modeflag & HalfDCLK) tempbx++;
+        } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1152x768) {
+           tempbx = 27;
+	   if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx += 2;
+	   if(modeflag & HalfDCLK) tempbx++;
+        } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200) {
+           tempbx = 36;
+	   if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx += 2;
+	   if(modeflag & HalfDCLK) tempbx++;
+        } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x768) {
+           tempbx = 40;
+	   if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx += 2;
+	   if(modeflag & HalfDCLK) tempbx++;
+        } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480_3) {
+           tempbx = 54;
+	   if(modeflag & HalfDCLK) tempbx++;
+	} else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480_2) {
+           tempbx = 52;
+	   if(modeflag & HalfDCLK) tempbx++;
+	} else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480) {
+           tempbx = 50;
+	   if(modeflag & HalfDCLK) tempbx++;
+        }
+
+     }
+     if(SiS_Pr->SiS_LCDInfo & LCDPass11) {
+        tempbx = 12;
+	if(modeflag & HalfDCLK) tempbx++;
+     }
+  }
 
-            tempah = SiS_GetReg1(SiS_Pr->SiS_P3d4,0x37);
-            tempah &= 0xC0;
-            tempah |= 0x20;
-            if(!(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit)) tempah |= 0x10;
-            SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0x0F,tempah);
-
-         } else {							/* 310/325 - 301, 301B */
-
-            tempah = infoflag >> 8;
-            tempah &= 0xC0;
-	    if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
-	       if(SiS_Pr->SiS_LCDInfo & LCDSync) {
-	          tempah = SiS_Pr->SiS_LCDInfo;
-	          tempah &= 0xC0;
-	       }
-	    }
-	    
-            tempah |= 0x20;
-            if(!(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit)) tempah |= 0x10;
 #if 0
-            if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480) {
-		/* TW: BIOS does something here @@@ */
-            }
-#endif	    
-            SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0x0F,tempah);
+  if(SiS_Pr->SiS_IF_DEF_FSTN) {
+     if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel320x480){
+        tempbx = 22;
+     }
+  }
+#endif
+
+  *ResIndex = CRT2CRTC & 0x3F;
+  *DisplayType = tempbx;
+  return TRUE;
+}
+
+static void
+SiS_GetCRT2Ptr(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdIndex,
+	       USHORT RefreshRateTableIndex,USHORT *CRT2Index,USHORT *ResIndex,
+	       PSIS_HW_INFO HwInfo)
+{
+  USHORT tempbx=0,tempal=0;
+  USHORT Flag,resinfo=0;
+
+  if(ModeNo <= 0x13) {
+     tempal = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC;
+  } else {
+     tempal = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC;
+     resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO;
+  }
+
+  if((SiS_Pr->SiS_VBType & VB_SISVB) && (SiS_Pr->SiS_IF_DEF_LVDS == 0)) {
+
+     if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {                            /* LCD */
+
+	if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x960) {
+	   tempbx = 15;
+  	} else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) {
+	   tempbx = 20;
+	   if(SiS_Pr->SiS_LCDInfo & DontExpandLCD)         tempbx = 21;
+	   else if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) tempbx = 22;
+ 	} else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200) {
+	   tempbx = 23;
+	   if(SiS_Pr->SiS_LCDInfo & DontExpandLCD)         tempbx = 24;
+	   else if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) tempbx = 25;
+#if 0
+	} else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x768) {
+	   tempbx = 26;
+	   if(SiS_Pr->SiS_LCDInfo & DontExpandLCD)         tempbx = 27;
+	   else if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) tempbx = 28;
+#endif
+ 	} else if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) {
+	   if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {
+	      if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768)       tempbx = 13;
+	      else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) tempbx = 14;
+	      else {
+	         tempbx = 29;
+		 if(ModeNo >= 0x13) {
+	            /* see below */
+	            if(resinfo == SIS_RI_1280x960) tempal = 10;
+	         }
+              }
+	   } else {
+	      tempbx = 29;
+	      if(ModeNo >= 0x13) {
+	         /* 1280x768 and 1280x960 have same CRT2CRTC,
+	          * so we change it here if 1280x960 is chosen
+	          */
+	         if(resinfo == SIS_RI_1280x960) tempal = 10;
+	      }
+   	   }
+	} else {
+      	   tempbx = SiS_Pr->SiS_LCDResInfo - SiS_Pr->SiS_Panel1024x768;
+      	   if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) {
+              tempbx += 10;
+       	   }
+	}
+
+#ifdef SIS315H
+	if(SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) {
+	   if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) {
+	      tempbx = 50;
+	      if(SiS_Pr->SiS_LCDInfo & DontExpandLCD)         tempbx = 51;
+	      else if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) tempbx = 52;
+	   }
+	}
+#endif
+
+     } else {						  	/* TV */
+
+     	if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) {
+           /* if(SiS_Pr->SiS_VGAVDE > 480) SiS_Pr->SiS_TVMode &= (~TVSetTVSimuMode); */
+           tempbx = 2;
+           if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) {
+	      tempbx = 13;
+              if(!(SiS_Pr->SiS_TVMode & TVSetTVSimuMode)) tempbx = 14;
+           }
+	} else if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) {
+	   if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p)      tempbx = 7;
+	   else if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p) tempbx = 6;
+	   else 					tempbx = 5;
+	   if(SiS_Pr->SiS_TVMode & TVSetTVSimuMode)     tempbx += 5;
+       	} else {
+           if(SiS_Pr->SiS_TVMode & TVSetPAL) 		tempbx = 3;
+           else 					tempbx = 4;
+           if(SiS_Pr->SiS_TVMode & TVSetTVSimuMode) 	tempbx += 5;
+       	}
 
-         } 
-	 
-#endif  /* SIS315H */
+     }
+
+     tempal &= 0x3F;
+
+     if(ModeNo > 0x13) {
+        if(SiS_Pr->SiS_VBInfo & SetCRT2ToTVNoHiVision) {
+      	   if(tempal == 6) tempal = 7;
+           if((resinfo == SIS_RI_720x480) ||
+	      (resinfo == SIS_RI_720x576) ||
+	      (resinfo == SIS_RI_768x576)) {
+	      tempal = 6;
+	   }
+	   if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) {
+              if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p) {
+	         if(resinfo == SIS_RI_1024x768) {
+	            tempal = 8;
+	         }
+	      }
+	   }
+	}
+     }
+
+     *CRT2Index = tempbx;
+     *ResIndex = tempal;
+
+  } else {   /* LVDS, 301B-DH (if running on LCD) */
+
+     Flag = 1;
+     tempbx = 0;
+     if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) {
+        if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD)) {
+           Flag = 0;
+           tempbx = 10;
+	   if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) tempbx += 1;
+           if(SiS_Pr->SiS_TVMode & TVSetPAL) {
+	      tempbx += 2;
+	      if(SiS_Pr->SiS_ModeType > ModeVGA) {
+		 if(SiS_Pr->SiS_CHSOverScan) tempbx = 99;
+	      }
+	      if(SiS_Pr->SiS_TVMode & TVSetPALM) {
+		 tempbx = 90;
+		 if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) tempbx += 1;
+	      } else if(SiS_Pr->SiS_TVMode & TVSetPALN) {
+		 tempbx = 92;
+		 if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) tempbx += 1;
+	      }
+           }
+        }
+     }
+
+     if(Flag) {
+
+	if(SiS_Pr->SiS_LCDResInfo <= SiS_Pr->SiS_Panel1280x1024) {
+	   tempbx = SiS_Pr->SiS_LCDResInfo - SiS_Pr->SiS_PanelMinLVDS;
+   	   if(SiS_Pr->SiS_LCDInfo & DontExpandLCD)  tempbx += 3;
+
+	   if(SiS_Pr->SiS_CustomT == CUT_BARCO1024) {
+	      tempbx = 82;
+	      if(SiS_Pr->SiS_LCDInfo & DontExpandLCD)  tempbx++;
+	   }
+	} else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x768) {
+	   tempbx = 18;
+	   if(SiS_Pr->SiS_LCDInfo & DontExpandLCD)  tempbx++;
+	} else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480) {
+	   tempbx = 6;
+	} else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480_2) {
+	   tempbx = 30;
+	} else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480_3) {
+	   tempbx = 30;
+	} else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x600) {
+	   tempbx = 15;
+  	   if(SiS_Pr->SiS_LCDInfo & DontExpandLCD)  tempbx += 2;
+	} else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1152x768) {
+	   tempbx = 16;
+	   if(SiS_Pr->SiS_LCDInfo & DontExpandLCD)  tempbx += 2;
+	} else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) {
+	   tempbx = 8;
+	   if(SiS_Pr->SiS_LCDInfo & DontExpandLCD)  tempbx++;
+	} else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200) {
+	   tempbx = 21;
+	   if(SiS_Pr->SiS_LCDInfo & DontExpandLCD)  tempbx++;
+	} else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_PanelBarco1366) {
+	   tempbx = 80;
+   	   if(SiS_Pr->SiS_LCDInfo & DontExpandLCD)  tempbx++;
+	}
+
+	if(SiS_Pr->SiS_LCDInfo & LCDPass11) {
+	   tempbx = 7;
+        }
+
+	if(SiS_Pr->SiS_CustomT == CUT_PANEL848) {
+	   tempbx = 84;
+	   if(SiS_Pr->SiS_LCDInfo & DontExpandLCD)  tempbx++;
+	}
+
+     }
+
+     if(SiS_Pr->SiS_SetFlag & SetDOSMode) {
+        if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel640x480) tempal = 7;
+  	if(HwInfo->jChipType < SIS_315H) {
+	   if(SiS_GetReg(SiS_Pr->SiS_P3c4,0x13) & 0x80) tempal++;
+	}
+     }
+
+     *CRT2Index = tempbx;
+     *ResIndex = tempal & 0x1F;
+  }
+}
+
+#ifdef SIS315H
+static void
+SiS_GetCRT2PtrA(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdIndex,
+		USHORT RefreshRateTableIndex,USHORT *CRT2Index,
+		USHORT *ResIndex)
+{
+  USHORT tempbx,tempal;
+
+  tempbx = SiS_Pr->SiS_LCDResInfo;
+
+  if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200)      tempbx = 4;
+  else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) tempbx = 3;
+  else tempbx -= SiS_Pr->SiS_Panel1024x768;
+
+  if(SiS_Pr->SiS_LCDInfo & DontExpandLCD)  tempbx += 5;
+
+  if(ModeNo <= 0x13)
+     tempal = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC;
+  else
+     tempal = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC;
+
+  /* No customs required yet (Clevo, Compaq, etc) */
+
+  *CRT2Index = tempbx;
+  *ResIndex = tempal & 0x1F;
+}
+#endif
+
+static void
+SiS_GetRAMDAC2DATA(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdIndex,
+                   USHORT RefreshRateTableIndex,PSIS_HW_INFO HwInfo)
+{
+  USHORT tempax=0,tempbx=0;
+  USHORT temp1=0,modeflag=0,tempcx=0;
+  USHORT index;
+
+  SiS_Pr->SiS_RVBHCMAX  = 1;
+  SiS_Pr->SiS_RVBHCFACT = 1;
+
+  if(ModeNo <= 0x13) {
+
+     modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
+     index = SiS_GetModePtr(SiS_Pr,ModeNo,ModeIdIndex);
+
+     tempax = SiS_Pr->SiS_StandTable[index].CRTC[0];
+     tempbx = SiS_Pr->SiS_StandTable[index].CRTC[6];
+     temp1 = SiS_Pr->SiS_StandTable[index].CRTC[7];
+
+  } else {
+
+     modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
+     index = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT1CRTC;
+
+     tempax = SiS_Pr->SiS_CRT1Table[index].CR[0];
+     tempax |= (SiS_Pr->SiS_CRT1Table[index].CR[14] << 8);
+     tempax &= 0x03FF;
+     tempbx = SiS_Pr->SiS_CRT1Table[index].CR[6];
+     tempcx = SiS_Pr->SiS_CRT1Table[index].CR[13] << 8;
+     tempcx &= 0x0100;
+     tempcx <<= 2;
+     tempbx |= tempcx;
+     temp1  = SiS_Pr->SiS_CRT1Table[index].CR[7];
+
+  }
+
+  if(temp1 & 0x01) tempbx |= 0x0100;
+  if(temp1 & 0x20) tempbx |= 0x0200;
+
+  tempax += 5;
+
+  /* Charx8Dot is no more used (and assumed), so we set it */
+  if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
+     modeflag |= Charx8Dot;
+  }
+
+  if(modeflag & Charx8Dot) tempax *= 8;
+  else                     tempax *= 9;
+
+  if(modeflag & HalfDCLK)  tempax <<= 1;
+
+  tempbx++;
+
+  SiS_Pr->SiS_VGAHT = SiS_Pr->SiS_HT = tempax;
+  SiS_Pr->SiS_VGAVT = SiS_Pr->SiS_VT = tempbx;
+}
+
+static void
+SiS_GetCRT2DataLVDS(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdIndex,
+                    USHORT RefreshRateTableIndex,
+		    PSIS_HW_INFO HwInfo)
+{
+   USHORT CRT2Index, ResIndex;
+   const SiS_LVDSDataStruct *LVDSData = NULL;
+
+   SiS_GetCRT2ResInfo(SiS_Pr, ModeNo, ModeIdIndex, HwInfo);
+
+   if(SiS_Pr->SiS_VBType & VB_SISVB) {
+      SiS_Pr->SiS_RVBHCMAX  = 1;
+      SiS_Pr->SiS_RVBHCFACT = 1;
+      SiS_Pr->SiS_NewFlickerMode = 0;
+      SiS_Pr->SiS_RVBHRS = 50;
+      SiS_Pr->SiS_RY1COE = 0;
+      SiS_Pr->SiS_RY2COE = 0;
+      SiS_Pr->SiS_RY3COE = 0;
+      SiS_Pr->SiS_RY4COE = 0;
+   }
+
+   if((SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) {
+
+#ifdef SIS315H
+      SiS_GetCRT2PtrA(SiS_Pr,ModeNo,ModeIdIndex,RefreshRateTableIndex,
+                      &CRT2Index,&ResIndex);
+
+      switch (CRT2Index) {
+      	case  0:  LVDSData = SiS_Pr->SiS_LCDA1024x768Data_1;    break;
+      	case  1:  LVDSData = SiS_Pr->SiS_LCDA1280x1024Data_1;   break;
+	case  3:  LVDSData = SiS_Pr->SiS_LCDA1400x1050Data_1;   break;
+	case  4:  LVDSData = SiS_Pr->SiS_LCDA1600x1200Data_1;   break;
+      	case  5:  LVDSData = SiS_Pr->SiS_LCDA1024x768Data_2;    break;
+      	case  6:  LVDSData = SiS_Pr->SiS_LCDA1280x1024Data_2;   break;
+	case  8:  LVDSData = SiS_Pr->SiS_LCDA1400x1050Data_2;   break;
+	case  9:  LVDSData = SiS_Pr->SiS_LCDA1600x1200Data_2;   break;
+	default:  LVDSData = SiS_Pr->SiS_LCDA1024x768Data_1;    break;
+      }
+#endif
+
+   } else {
+
+      /* 301BDH needs LVDS Data */
+      if((SiS_Pr->SiS_VBType & VB_NoLCD) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD)) {
+	 SiS_Pr->SiS_IF_DEF_LVDS = 1;
+      }
+
+      SiS_GetCRT2Ptr(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex,
+                     &CRT2Index, &ResIndex, HwInfo);
+
+      /* 301BDH needs LVDS Data */
+      if((SiS_Pr->SiS_VBType & VB_NoLCD) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD)) {
+         SiS_Pr->SiS_IF_DEF_LVDS = 0;
+      }
+
+      switch (CRT2Index) {
+      	case  0:  LVDSData = SiS_Pr->SiS_LVDS800x600Data_1;    break;
+      	case  1:  LVDSData = SiS_Pr->SiS_LVDS1024x768Data_1;   break;
+      	case  2:  LVDSData = SiS_Pr->SiS_LVDS1280x1024Data_1;  break;
+      	case  3:  LVDSData = SiS_Pr->SiS_LVDS800x600Data_2;    break;
+      	case  4:  LVDSData = SiS_Pr->SiS_LVDS1024x768Data_2;   break;
+      	case  5:  LVDSData = SiS_Pr->SiS_LVDS1280x1024Data_2;  break;
+	case  6:  LVDSData = SiS_Pr->SiS_LVDS640x480Data_1;    break;
+        case  7:  LVDSData = SiS_Pr->SiS_LVDSXXXxXXXData_1;    break;
+	case  8:  LVDSData = SiS_Pr->SiS_LVDS1400x1050Data_1;  break;
+	case  9:  LVDSData = SiS_Pr->SiS_LVDS1400x1050Data_2;  break;
+      	case 10:  LVDSData = SiS_Pr->SiS_CHTVUNTSCData;        break;
+      	case 11:  LVDSData = SiS_Pr->SiS_CHTVONTSCData;        break;
+      	case 12:  LVDSData = SiS_Pr->SiS_CHTVUPALData;         break;
+      	case 13:  LVDSData = SiS_Pr->SiS_CHTVOPALData;         break;
+      	case 14:  LVDSData = SiS_Pr->SiS_LVDS320x480Data_1;    break;
+	case 15:  LVDSData = SiS_Pr->SiS_LVDS1024x600Data_1;   break;
+	case 16:  LVDSData = SiS_Pr->SiS_LVDS1152x768Data_1;   break;
+	case 17:  LVDSData = SiS_Pr->SiS_LVDS1024x600Data_2;   break;
+	case 18:  LVDSData = SiS_Pr->SiS_LVDS1152x768Data_2;   break;
+	case 19:  LVDSData = SiS_Pr->SiS_LVDS1280x768Data_1;   break;
+	case 20:  LVDSData = SiS_Pr->SiS_LVDS1280x768Data_2;   break;
+	case 21:  LVDSData = SiS_Pr->SiS_LVDS1600x1200Data_1;  break;
+	case 22:  LVDSData = SiS_Pr->SiS_LVDS1600x1200Data_2;  break;
+	case 30:  LVDSData = SiS_Pr->SiS_LVDS640x480Data_2;    break;
+	case 80:  LVDSData = SiS_Pr->SiS_LVDSBARCO1366Data_1;  break;
+	case 81:  LVDSData = SiS_Pr->SiS_LVDSBARCO1366Data_2;  break;
+	case 82:  LVDSData = SiS_Pr->SiS_LVDSBARCO1024Data_1;  break;
+	case 83:  LVDSData = SiS_Pr->SiS_LVDSBARCO1024Data_2;  break;
+	case 84:  LVDSData = SiS_Pr->SiS_LVDS848x480Data_1;    break;
+	case 85:  LVDSData = SiS_Pr->SiS_LVDS848x480Data_2;    break;
+	case 90:  LVDSData = SiS_Pr->SiS_CHTVUPALMData;        break;
+      	case 91:  LVDSData = SiS_Pr->SiS_CHTVOPALMData;        break;
+      	case 92:  LVDSData = SiS_Pr->SiS_CHTVUPALNData;        break;
+      	case 93:  LVDSData = SiS_Pr->SiS_CHTVOPALNData;        break;
+	case 99:  LVDSData = SiS_Pr->SiS_CHTVSOPALData;	       break;  /* Super Overscan */
+	default:  LVDSData = SiS_Pr->SiS_LVDS1024x768Data_1;   break;
+      }
+   }
+
+   SiS_Pr->SiS_VGAHT = (LVDSData+ResIndex)->VGAHT;
+   SiS_Pr->SiS_VGAVT = (LVDSData+ResIndex)->VGAVT;
+   SiS_Pr->SiS_HT    = (LVDSData+ResIndex)->LCDHT;
+   SiS_Pr->SiS_VT    = (LVDSData+ResIndex)->LCDVT;
+
+   if(SiS_Pr->SiS_VBType & VB_SISVB) {
+
+      if(!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) {
+         SiS_Pr->SiS_HDE = SiS_Pr->PanelXRes;
+         SiS_Pr->SiS_VDE = SiS_Pr->PanelYRes;
+      }
+
+   } else {
+
+      if(SiS_Pr->SiS_IF_DEF_TRUMPION == 0) {
+         if((SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) && (!(SiS_Pr->SiS_LCDInfo & LCDPass11))) {
+            if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel640x480) {
+               if((!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) || (SiS_Pr->SiS_SetFlag & SetDOSMode)) {
+	          SiS_Pr->SiS_HDE = SiS_Pr->PanelXRes;
+                  SiS_Pr->SiS_VDE = SiS_Pr->PanelYRes;
+
+	 	  if(SiS_Pr->SiS_CustomT == CUT_BARCO1366) {
+		     if(ResIndex < 0x08) {
+		        SiS_Pr->SiS_HDE = 1280;
+                        SiS_Pr->SiS_VDE = 1024;
+		     }
+		  }
+               }
+            }
+         }
       }
    }
 }
 
-/* TW: Set CRT2 FIFO on 300/630/730 */
-#ifdef SIS300
-void
-SiS_SetCRT2FIFO_300(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,
-                    PSIS_HW_DEVICE_INFO HwDeviceExtension)
+static void
+SiS_GetCRT2Data301(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdIndex,
+                   USHORT RefreshRateTableIndex,
+		   PSIS_HW_INFO HwInfo)
 {
-  USHORT temp,index;
-  USHORT modeidindex,refreshratetableindex;
-  USHORT VCLK=0,MCLK,colorth=0,data2=0;
-  USHORT tempal, tempah, tempbx, tempcl, tempax;
-  USHORT CRT1ModeNo,CRT2ModeNo;
-  USHORT SelectRate_backup;
-  ULONG  data,eax;
-  const UCHAR  LatencyFactor[] = {
-  	97, 88, 86, 79, 77, 00,       /*; 64  bit    BQ=2   */
-        00, 87, 85, 78, 76, 54,       /*; 64  bit    BQ=1   */
-        97, 88, 86, 79, 77, 00,       /*; 128 bit    BQ=2   */
-        00, 79, 77, 70, 68, 48,       /*; 128 bit    BQ=1   */
-        80, 72, 69, 63, 61, 00,       /*; 64  bit    BQ=2   */
-        00, 70, 68, 61, 59, 37,       /*; 64  bit    BQ=1   */
-        86, 77, 75, 68, 66, 00,       /*; 128 bit    BQ=2   */
-        00, 68, 66, 59, 57, 37        /*; 128 bit    BQ=1   */
-  };
-  const UCHAR  LatencyFactor730[] = {
-         69, 63, 61, 
-	 86, 79, 77,
-	103, 96, 94,
-	120,113,111,
-	137,130,128,    /* <-- last entry, data below */
-	137,130,128,	/* to avoid using illegal values */
-	137,130,128,
-	137,130,128,
-	137,130,128,
-	137,130,128,
-	137,130,128,
-	137,130,128,
-	137,130,128,
-	137,130,128,
-	137,130,128,
-	137,130,128,
-  };
-  const UCHAR ThLowB[]   = {
-  	81, 4, 72, 6, 88, 8,120,12,
-        55, 4, 54, 6, 66, 8, 90,12,
-        42, 4, 45, 6, 55, 8, 75,12
-  };
-  const UCHAR ThTiming[] = {
-  	1, 2, 2, 3, 0, 1, 1, 2
-  };
+  USHORT tempax,tempbx,modeflag;
+  USHORT resinfo;
+  USHORT CRT2Index,ResIndex;
+  const SiS_LCDDataStruct *LCDPtr = NULL;
+  const SiS_TVDataStruct  *TVPtr  = NULL;
+
+  if(ModeNo <= 0x13) {
+     modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
+     resinfo = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ResInfo;
+  } else {
+     if(SiS_Pr->UseCustomMode) {
+        modeflag = SiS_Pr->CModeFlag;
+	resinfo = 0;
+     } else {
+    	modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
+    	resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO;
+     }
+  }
   
-  SelectRate_backup = SiS_Pr->SiS_SelectCRT2Rate;
+  SiS_Pr->SiS_NewFlickerMode = 0;
+  SiS_Pr->SiS_RVBHRS = 50;
+  SiS_Pr->SiS_RY1COE = 0;
+  SiS_Pr->SiS_RY2COE = 0;
+  SiS_Pr->SiS_RY3COE = 0;
+  SiS_Pr->SiS_RY4COE = 0;
+
+  SiS_GetCRT2ResInfo(SiS_Pr,ModeNo,ModeIdIndex,HwInfo);
+
+  if(SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC){
+
+     if(SiS_Pr->UseCustomMode) {
+
+        SiS_Pr->SiS_RVBHCMAX  = 1;
+        SiS_Pr->SiS_RVBHCFACT = 1;
+        SiS_Pr->SiS_VGAHT     = SiS_Pr->CHTotal;
+        SiS_Pr->SiS_VGAVT     = SiS_Pr->CVTotal;
+        SiS_Pr->SiS_HT        = SiS_Pr->CHTotal;
+        SiS_Pr->SiS_VT        = SiS_Pr->CVTotal;
+	SiS_Pr->SiS_HDE       = SiS_Pr->SiS_VGAHDE;
+        SiS_Pr->SiS_VDE       = SiS_Pr->SiS_VGAVDE;
 
-  if(!SiS_Pr->CRT1UsesCustomMode) {
-  
-     CRT1ModeNo = SiS_Pr->SiS_CRT1Mode;                                 /* get CRT1 ModeNo */
-     SiS_SearchModeID(SiS_Pr,ROMAddr,&CRT1ModeNo,&modeidindex);
-     SiS_Pr->SiS_SetFlag &= (~ProgrammingCRT2);
-     SiS_Pr->SiS_SelectCRT2Rate = 0;
-     refreshratetableindex = SiS_GetRatePtrCRT2(SiS_Pr,ROMAddr,CRT1ModeNo,
-						modeidindex,HwDeviceExtension);
+     } else {
 
-     if(CRT1ModeNo >= 0x13) {
-       index = SiS_Pr->SiS_RefIndex[refreshratetableindex].Ext_CRTVCLK;
-       index &= 0x3F;
-       VCLK = SiS_Pr->SiS_VCLKData[index].CLOCK;			/* Get VCLK */
-       data2 = SiS_Pr->SiS_ModeType - 2;
+        SiS_GetRAMDAC2DATA(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, HwInfo);
      }
-     
-  } else {
-  
-     CRT1ModeNo = 0xfe;
-     VCLK = SiS_Pr->CSRClock;						/* Get VCLK */
-     data2 = (SiS_Pr->CModeFlag & ModeInfoFlag) - 2;
-  
-  }			
-     
-  if(CRT1ModeNo >= 0x13) {
-    if(HwDeviceExtension->jChipType == SIS_300) {
-       index = SiS_GetReg1(SiS_Pr->SiS_P3c4,0x3A);
-    } else {
-       index = SiS_GetReg1(SiS_Pr->SiS_P3c4,0x1A);
-    }
-    index &= 0x07;
-    MCLK = SiS_Pr->SiS_MCLKData_0[index].CLOCK;				/* Get MCLK */
-    
-#ifdef TWDEBUG
-    xf86DrvMsg(0, X_INFO, "FIFO2: CRT1Mode 0x%x VCLK %d MCLK %d modetype-2 = %d\n",
-    	CRT1ModeNo, VCLK, MCLK, data2);
-#endif  
-  
-    switch(data2) {							/* Get color depth */
-      case 0 : 	colorth = 1; break;
-      case 1 : 	colorth = 1; break;
-      case 2 : 	colorth = 2; break;
-      case 3 : 	colorth = 2; break;
-      case 4 : 	colorth = 3; break;
-      case 5 : 	colorth = 4; break;
-      default:  colorth = 2; break;
-    }
-    data2 = (colorth * VCLK) / MCLK;  
 
-    temp = SiS_GetReg1(SiS_Pr->SiS_P3c4,0x14);
-    temp = ((temp & 0x00FF) >> 6) << 1;
-    if(temp == 0) temp = 1;
-    temp <<= 2;
-    temp &= 0xff;
+  } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
 
-    data2 = temp - data2;
-    
-#ifdef TWDEBUG
-    xf86DrvMsg(0, X_INFO, "FIFO2: data2 (step1) = %d\n",
-    	data2);
-#endif    
+     SiS_GetCRT2Ptr(SiS_Pr,ModeNo,ModeIdIndex,RefreshRateTableIndex,
+                    &CRT2Index,&ResIndex,HwInfo);
 
-    if((28 * 16) % data2) {
-      	data2 = (28 * 16) / data2;
-      	data2++;
-    } else {
-      	data2 = (28 * 16) / data2;
-    }
-    
-#ifdef TWDEBUG
-    xf86DrvMsg(0, X_INFO, "FIFO2: data2 (step2) = %d\n",
-    	data2);
-#endif
+     switch(CRT2Index) {
+       case  2:  TVPtr = SiS_Pr->SiS_ExtHiTVData;   break;
+       case  3:  TVPtr = SiS_Pr->SiS_ExtPALData;    break;
+       case  4:  TVPtr = SiS_Pr->SiS_ExtNTSCData;   break;
+       case  5:  TVPtr = SiS_Pr->SiS_Ext525iData;   break;
+       case  6:  TVPtr = SiS_Pr->SiS_Ext525pData;   break;
+       case  7:  TVPtr = SiS_Pr->SiS_Ext750pData;   break;
+       case  8:  TVPtr = SiS_Pr->SiS_StPALData;     break;
+       case  9:  TVPtr = SiS_Pr->SiS_StNTSCData;    break;
+       case 10:  TVPtr = SiS_Pr->SiS_St525iData;    break;
+       case 11:  TVPtr = SiS_Pr->SiS_St525pData;    break;
+       case 12:  TVPtr = SiS_Pr->SiS_St750pData;    break;
+       case 13:  TVPtr = SiS_Pr->SiS_St1HiTVData;   break;
+       case 14:  TVPtr = SiS_Pr->SiS_St2HiTVData;   break;
+       default:  TVPtr = SiS_Pr->SiS_StPALData;     break;
+     }
+
+     SiS_Pr->SiS_RVBHCMAX  = (TVPtr+ResIndex)->RVBHCMAX;
+     SiS_Pr->SiS_RVBHCFACT = (TVPtr+ResIndex)->RVBHCFACT;
+     SiS_Pr->SiS_VGAHT     = (TVPtr+ResIndex)->VGAHT;
+     SiS_Pr->SiS_VGAVT     = (TVPtr+ResIndex)->VGAVT;
+     SiS_Pr->SiS_HDE       = (TVPtr+ResIndex)->TVHDE;
+     SiS_Pr->SiS_VDE       = (TVPtr+ResIndex)->TVVDE;
+     SiS_Pr->SiS_RVBHRS    = (TVPtr+ResIndex)->RVBHRS;
+     SiS_Pr->SiS_NewFlickerMode = (TVPtr+ResIndex)->FlickerMode;
+     if(modeflag & HalfDCLK) {
+        SiS_Pr->SiS_RVBHRS = (TVPtr+ResIndex)->HALFRVBHRS;
+     }
 
-    if(HwDeviceExtension->jChipType == SIS_300) {
+     if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) {
 
-	tempah = SiS_GetReg1(SiS_Pr->SiS_P3c4,0x18);
-	tempah &= 0x62;
-	tempah >>= 1;
-	tempal = tempah;
-	tempah >>= 3;
-	tempal |= tempah;
-	tempal &= 0x07;
-	tempcl = ThTiming[tempal];
-	tempbx = SiS_GetReg1(SiS_Pr->SiS_P3c4,0x16);
-	tempbx >>= 6;
-	tempah = SiS_GetReg1(SiS_Pr->SiS_P3c4,0x14);
-	tempah >>= 4;
-	tempah &= 0x0c;
-	tempbx |= tempah;
-	tempbx <<= 1;
-	tempal = ThLowB[tempbx + 1];
-	tempal *= tempcl;
-	tempal += ThLowB[tempbx];
-	data = tempal;
+        if((resinfo == SIS_RI_1024x768)  ||
+           (resinfo == SIS_RI_1280x1024) ||
+           (resinfo == SIS_RI_1280x720)) {
+	   SiS_Pr->SiS_NewFlickerMode = 0x40;
+	}
 
-    } else if(HwDeviceExtension->jChipType == SIS_730) {
-       
-#ifndef LINUX_XF86
-       SiS_SetReg4(0xcf8,0x80000050);
-       eax = SiS_GetReg3(0xcfc);
-#else
-       eax = pciReadLong(0x00000000, 0x50);
-#endif
-       tempal = (USHORT)(eax >> 8);
-       tempal &= 0x06;
-       tempal <<= 5;
+        if(SiS_Pr->SiS_VGAVDE == 350) SiS_Pr->SiS_TVMode |= TVSetTVSimuMode;
 
-#ifndef LINUX_XF86
-       SiS_SetReg4(0xcf8,0x800000A0);
-       eax = SiS_GetReg3(0xcfc);
-#else
-       eax = pciReadLong(0x00000000, 0xA0);
+        SiS_Pr->SiS_HT = ExtHiTVHT;
+        SiS_Pr->SiS_VT = ExtHiTVVT;
+        if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) {
+           if(SiS_Pr->SiS_TVMode & TVSetTVSimuMode) {
+              SiS_Pr->SiS_HT = StHiTVHT;
+              SiS_Pr->SiS_VT = StHiTVVT;
+#if 0
+              if(!(modeflag & Charx8Dot)) {
+                 SiS_Pr->SiS_HT = StHiTextTVHT;
+                 SiS_Pr->SiS_VT = StHiTextTVVT;
+              }
 #endif
-       temp = (USHORT)(eax >> 28);
-       temp &= 0x0F;   
-       tempal |= temp;
+           }
+        }
 
-#ifdef TWDEBUG
-       xf86DrvMsg(0, X_INFO, "FIFO2: Latencyfactorindex = 0x%x\n", tempal);
-#endif
-      
-       tempbx = tempal;   /* BIOS BUG (2.04.5d, 2.04.6a use ah here, which is unset!) */
-       tempbx = 0;        /* -- do it like the BIOS anyway... */
-       tempax = tempbx;
-       tempbx &= 0xc0;
-       tempbx >>= 6;
-       tempax &= 0x0f;
-       tempax *= 3;
-       tempbx += tempax;
-       
-       data = LatencyFactor730[tempbx];
-       data += 15;
-       temp = SiS_GetReg1(SiS_Pr->SiS_P3c4,0x14);
-       if(!(temp & 0x80)) data += 5;
-       
-    } else {
+     } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) {
 
-       index = 0;
-       temp = SiS_GetReg1(SiS_Pr->SiS_P3c4,0x14);
-       if(temp & 0x0080) index += 12;
+        if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) {
+           SiS_Pr->SiS_HT = 1650;
+           SiS_Pr->SiS_VT = 750;
+	} else if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p) {
+	   SiS_Pr->SiS_HT = NTSCHT;
+	   SiS_Pr->SiS_VT = NTSCVT;
+        } else {
+           SiS_Pr->SiS_HT = NTSCHT;
+	   if(SiS_Pr->SiS_TVMode & TVSetNTSC1024) SiS_Pr->SiS_HT = NTSC2HT;
+           SiS_Pr->SiS_VT = NTSCVT;
+        }
 
-#ifndef LINUX_XF86
-       SiS_SetReg4(0xcf8,0x800000A0);
-       eax = SiS_GetReg3(0xcfc);
-#else
-       /* TW: We use pci functions X offers. We use tag 0, because
-        * we want to read/write to the host bridge (which is always
-        * 00:00.0 on 630, 730 and 540), not the VGA device.
-        */
-       eax = pciReadLong(0x00000000, 0xA0);
-#endif
-       temp = (USHORT)(eax >> 24);
-       if(!(temp&0x01)) index += 24;
+     } else {
 
-#ifndef LINUX_XF86
-       SiS_SetReg4(0xcf8,0x80000050);
-       eax = SiS_GetReg3(0xcfc);
-#else
-       eax = pciReadLong(0x00000000, 0x50);
-#endif
-       temp=(USHORT)(eax >> 24);
-       if(temp & 0x01) index += 6;
+        SiS_Pr->SiS_RY1COE = (TVPtr+ResIndex)->RY1COE;
+        SiS_Pr->SiS_RY2COE = (TVPtr+ResIndex)->RY2COE;
+        SiS_Pr->SiS_RY3COE = (TVPtr+ResIndex)->RY3COE;
+        SiS_Pr->SiS_RY4COE = (TVPtr+ResIndex)->RY4COE;
+
+        if(modeflag & HalfDCLK) {
+           SiS_Pr->SiS_RY1COE = 0x00;
+           SiS_Pr->SiS_RY2COE = 0xf4;
+           SiS_Pr->SiS_RY3COE = 0x10;
+           SiS_Pr->SiS_RY4COE = 0x38;
+        }
+
+        if(!(SiS_Pr->SiS_TVMode & TVSetPAL)) {
+           SiS_Pr->SiS_HT = NTSCHT;
+	   if(SiS_Pr->SiS_TVMode & TVSetNTSC1024) SiS_Pr->SiS_HT = NTSC2HT;
+           SiS_Pr->SiS_VT = NTSCVT;
+        } else {
+           SiS_Pr->SiS_HT = PALHT;
+           SiS_Pr->SiS_VT = PALVT;
+        }
 
-       temp = (temp & 0x0F) >> 1;
-       index += temp;
-       
-       data = LatencyFactor[index];
-       data += 15;
-       temp = SiS_GetReg1(SiS_Pr->SiS_P3c4,0x14);
-       if(!(temp & 0x80)) data += 5;
-    }
-    
-#ifdef TWDEBUG    
-    xf86DrvMsg(0, X_INFO, "FIFO2: latencyfactor (CRT1) = %d\n", data);
-#endif
+     }
 
-    data += data2;				/* CRT1 Request Period */
-    
-#ifdef TWDEBUG    
-    xf86DrvMsg(0, X_INFO, "FIFO2: CRT1 request period = %d\n", data);
-#endif
+  } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
 
-    CRT2ModeNo = ModeNo;
-    SiS_Pr->SiS_SetFlag |= ProgrammingCRT2;
-    SiS_Pr->SiS_SelectCRT2Rate = SelectRate_backup;
-    SiS_SearchModeID(SiS_Pr,ROMAddr,&CRT2ModeNo,&modeidindex);    
+     if(SiS_Pr->UseCustomMode) {
 
-    refreshratetableindex = SiS_GetRatePtrCRT2(SiS_Pr,ROMAddr,CRT2ModeNo,
-                                               modeidindex,HwDeviceExtension);
+        SiS_Pr->SiS_RVBHCMAX  = 1;
+        SiS_Pr->SiS_RVBHCFACT = 1;
+        SiS_Pr->SiS_VGAHT     = SiS_Pr->CHTotal;
+        SiS_Pr->SiS_VGAVT     = SiS_Pr->CVTotal;
+        SiS_Pr->SiS_HT        = SiS_Pr->CHTotal;
+        SiS_Pr->SiS_VT        = SiS_Pr->CVTotal;
+	SiS_Pr->SiS_HDE       = SiS_Pr->SiS_VGAHDE;
+        SiS_Pr->SiS_VDE       = SiS_Pr->SiS_VGAVDE;
 
-    index = SiS_GetVCLK2Ptr(SiS_Pr,ROMAddr,CRT2ModeNo,modeidindex,
-                            refreshratetableindex,HwDeviceExtension);
-    VCLK = SiS_Pr->SiS_VCLKData[index].CLOCK;                         	/* Get VCLK  */
-    
-    data2 = SiS_Pr->SiS_ModeType - 2;
-    switch(data2) {							/* Get color depth */
-      case 0 : 	colorth = 1; break;
-      case 1 : 	colorth = 1; break;
-      case 2 : 	colorth = 2; break;
-      case 3 : 	colorth = 2; break;
-      case 4 : 	colorth = 3; break;
-      case 5 : 	colorth = 4; break;
-      default:  colorth = 2; break;
-    }
-    
-#ifdef TWDEBUG    
-    xf86DrvMsg(0, X_INFO, "FIFO2: CRT2Mode 0x%x VCLK %d MCLK %d modetype-2 = %d, colorth %d\n",
-    	CRT2ModeNo, VCLK, MCLK, data2, colorth);
-#endif
+     } else {
 
-    data = data * VCLK * colorth;
-    if(data % (MCLK << 4)) {
-      	data = data / (MCLK << 4);
-      	data++;
-    } else {
-      	data = data / (MCLK << 4);
-    }
-    
-#ifdef TWDEBUG    
-    xf86DrvMsg(0, X_INFO, "FIFO2: data (unclipped) = 0x%x\n", data);
-#endif    
-    
-    if(data <= 6) data = 6;
-    if(data > 0x14) data = 0x14;
+        SiS_GetCRT2Ptr(SiS_Pr,ModeNo,ModeIdIndex,RefreshRateTableIndex,
+                      &CRT2Index,&ResIndex,HwInfo);
 
-    temp = SiS_GetReg1(SiS_Pr->SiS_Part1Port,0x01);
-    if(HwDeviceExtension->jChipType == SIS_300) {
-       if(data <= 0x0f) temp = (temp & (~0x1F)) | 0x13;
-       else             temp = (temp & (~0x1F)) | 0x16;
-       if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) {
-       		temp = (temp & (~0x1F)) | 0x13;
-       }
-    } else {
-       if( ( (HwDeviceExtension->jChipType == SIS_630) ||
-             (HwDeviceExtension->jChipType == SIS_730) )  &&
-           (HwDeviceExtension->jChipRevision >= 0x30) ) /* 630s or 730(s?) */
-      {
-	  temp = (temp & (~0x1F)) | 0x1b;
-      } else {
-	  temp = (temp & (~0x1F)) | 0x16;
-      }
-    }
-    SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x01,0xe0,temp);
+        switch(CRT2Index) {
+         case  0: LCDPtr = SiS_Pr->SiS_ExtLCD1024x768Data;        break; /* VESA Timing */
+         case  1: LCDPtr = SiS_Pr->SiS_ExtLCD1280x1024Data;       break; /* VESA Timing */
+         case  5: LCDPtr = SiS_Pr->SiS_StLCD1024x768Data;         break; /* Obviously unused */
+         case  6: LCDPtr = SiS_Pr->SiS_StLCD1280x1024Data;        break; /* Obviously unused */
+         case 10: LCDPtr = SiS_Pr->SiS_St2LCD1024x768Data;        break; /* Non-VESA Timing */
+         case 11: LCDPtr = SiS_Pr->SiS_St2LCD1280x1024Data;       break; /* Non-VESA Timing */
+         case 13: LCDPtr = SiS_Pr->SiS_NoScaleData1024x768;       break; /* Non-expanding */
+         case 14: LCDPtr = SiS_Pr->SiS_NoScaleData1280x1024;      break; /* Non-expanding */
+         case 15: LCDPtr = SiS_Pr->SiS_LCD1280x960Data;           break; /* 1280x960 */
+         case 20: LCDPtr = SiS_Pr->SiS_ExtLCD1400x1050Data;       break; /* VESA Timing */
+         case 21: LCDPtr = SiS_Pr->SiS_NoScaleData1400x1050;      break; /* Non-expanding (let panel scale) */
+         case 22: LCDPtr = SiS_Pr->SiS_StLCD1400x1050Data;        break; /* Non-VESA Timing (let panel scale) */
+         case 23: LCDPtr = SiS_Pr->SiS_ExtLCD1600x1200Data;       break; /* VESA Timing */
+         case 24: LCDPtr = SiS_Pr->SiS_NoScaleData1600x1200;      break; /* Non-expanding */
+         case 25: LCDPtr = SiS_Pr->SiS_StLCD1600x1200Data;        break; /* Non-VESA Timing */
+         case 26: LCDPtr = SiS_Pr->SiS_ExtLCD1280x768Data;        break; /* VESA Timing */
+         case 27: LCDPtr = SiS_Pr->SiS_NoScaleData1280x768;       break; /* Non-expanding */
+         case 28: LCDPtr = SiS_Pr->SiS_StLCD1280x768Data;         break; /* Non-VESA Timing */
+         case 29: LCDPtr = SiS_Pr->SiS_NoScaleData;	          break; /* Generic no-scale data */
+#ifdef SIS315H
+	 case 50: LCDPtr = (SiS_LCDDataStruct *)SiS310_ExtCompaq1280x1024Data;	break;
+	 case 51: LCDPtr = SiS_Pr->SiS_NoScaleData1280x1024;			break;
+	 case 52: LCDPtr = SiS_Pr->SiS_St2LCD1280x1024Data;	  		break;
+#endif
+         default: LCDPtr = SiS_Pr->SiS_ExtLCD1024x768Data;	  break;
+        }
+
+        SiS_Pr->SiS_RVBHCMAX  = (LCDPtr+ResIndex)->RVBHCMAX;
+        SiS_Pr->SiS_RVBHCFACT = (LCDPtr+ResIndex)->RVBHCFACT;
+        SiS_Pr->SiS_VGAHT     = (LCDPtr+ResIndex)->VGAHT;
+        SiS_Pr->SiS_VGAVT     = (LCDPtr+ResIndex)->VGAVT;
+        SiS_Pr->SiS_HT        = (LCDPtr+ResIndex)->LCDHT;
+        SiS_Pr->SiS_VT        = (LCDPtr+ResIndex)->LCDVT;
 
-    if( (HwDeviceExtension->jChipType == SIS_630) &&
-        (HwDeviceExtension->jChipRevision >= 0x30) ) /* 630s, NOT 730 */
-    {
-   	if(data > 0x13) data = 0x13;
-    }
-    SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x02,0xe0,data);
-    
-  } else {  /* If mode <= 0x13, we just restore everything */
-  
-    SiS_Pr->SiS_SetFlag |= ProgrammingCRT2;
-    SiS_Pr->SiS_SelectCRT2Rate = SelectRate_backup;
-    
+#ifdef TWDEBUG
+        xf86DrvMsg(0, X_INFO,
+    	    "GetCRT2Data: Index %d ResIndex %d\n", CRT2Index, ResIndex);
+#endif
+
+	if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) {
+           tempax = 1024;
+           if(SiS_Pr->SiS_SetFlag & LCDVESATiming) {
+              if(HwInfo->jChipType < SIS_315H) {
+                 if     (SiS_Pr->SiS_VGAVDE == 350) tempbx = 560;
+                 else if(SiS_Pr->SiS_VGAVDE == 400) tempbx = 640;
+                 else                               tempbx = 768;
+              } else {
+                 tempbx = 768;
+              }
+           } else {
+              if     (SiS_Pr->SiS_VGAVDE == 357) tempbx = 527;
+              else if(SiS_Pr->SiS_VGAVDE == 420) tempbx = 620;
+              else if(SiS_Pr->SiS_VGAVDE == 525) tempbx = 775;
+              else if(SiS_Pr->SiS_VGAVDE == 600) tempbx = 775;
+              else if(SiS_Pr->SiS_VGAVDE == 350) tempbx = 560;
+              else if(SiS_Pr->SiS_VGAVDE == 400) tempbx = 640;
+              else                               tempbx = 768;
+           }
+	} else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) {
+           tempax = 1280;
+           if     (SiS_Pr->SiS_VGAVDE == 360) tempbx = 768;
+           else if(SiS_Pr->SiS_VGAVDE == 375) tempbx = 800;
+           else if(SiS_Pr->SiS_VGAVDE == 405) tempbx = 864;
+           else                               tempbx = 1024;
+        } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x960) {
+           tempax = 1280;
+           if     (SiS_Pr->SiS_VGAVDE == 350)  tempbx = 700;
+           else if(SiS_Pr->SiS_VGAVDE == 400)  tempbx = 800;
+           else if(SiS_Pr->SiS_VGAVDE == 1024) tempbx = 960;
+           else                                tempbx = 960;
+	} else if((SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) &&
+	          (HwInfo->jChipType >= SIS_661)) {
+	   tempax = 1400;
+	   tempbx = 1050;
+	   if(SiS_Pr->SiS_VGAVDE == 1024) {
+	      tempax = 1280;
+	      tempbx = 1024;
+	   }
+        } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200) {
+           tempax = 1600;
+	   tempbx = 1200;
+	   if((HwInfo->jChipType < SIS_661) || (!(SiS_Pr->SiS_SetFlag & LCDVESATiming))) {
+              if     (SiS_Pr->SiS_VGAVDE == 350)  tempbx = 875;
+              else if(SiS_Pr->SiS_VGAVDE == 400)  tempbx = 1000;
+           }
+        } else {
+	   tempax = SiS_Pr->PanelXRes;
+           tempbx = SiS_Pr->PanelYRes;
+	}
+        if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) {
+           tempax = SiS_Pr->SiS_VGAHDE;
+           tempbx = SiS_Pr->SiS_VGAVDE;
+        }
+        SiS_Pr->SiS_HDE = tempax;
+        SiS_Pr->SiS_VDE = tempbx;
+     }
   }
 }
-#endif
 
-/* TW: Set FIFO on 310/325/330 series */
-#ifdef SIS315H
-void
-SiS_SetCRT2FIFO_310(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,
-                    PSIS_HW_DEVICE_INFO HwDeviceExtension)
+static void
+SiS_GetCRT2Data(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
+                USHORT RefreshRateTableIndex, PSIS_HW_INFO HwInfo)
 {
 
-  UCHAR CombCode[]  = { 1, 1, 1, 4, 3, 1, 3, 4,
-                        4, 1, 4, 4, 5, 1, 5, 4};
-  UCHAR CRT2ThLow[] = { 39, 63, 55, 79, 78,102, 90,114,
-                        55, 87, 84,116,103,135,119,151};
-  USHORT temp3,tempax,tempbx,tempcx;
-  USHORT tempcl, tempch;
-  USHORT index;
-  USHORT CRT1ModeNo,CRT2ModeNo;
-  USHORT ModeIdIndex;
-  USHORT RefreshRateTableIndex;
-  USHORT SelectRate_backup;
-  
-  SelectRate_backup = SiS_Pr->SiS_SelectCRT2Rate;
-  
-  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x01,0x3B);
+  if(SiS_Pr->SiS_VBType & VB_SISVB) {
 
-  if(!SiS_Pr->CRT1UsesCustomMode) {
-  
-     CRT1ModeNo = SiS_Pr->SiS_CRT1Mode;                                 /* get CRT1 ModeNo */
-     SiS_SearchModeID(SiS_Pr,ROMAddr,&CRT1ModeNo,&ModeIdIndex);
+     if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
 
-     SiS_Pr->SiS_SetFlag &= (~ProgrammingCRT2);   
-     SiS_Pr->SiS_SelectCRT2Rate = 0;
+        if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) {
 
-     /* Get REFIndex for crt1 refreshrate */
-     RefreshRateTableIndex = SiS_GetRatePtrCRT2(SiS_Pr,ROMAddr,CRT1ModeNo,
-                                             ModeIdIndex,HwDeviceExtension);
-
-     index = SiS_GetVCLK2Ptr(SiS_Pr,ROMAddr,CRT1ModeNo,ModeIdIndex,
-                          RefreshRateTableIndex,HwDeviceExtension);
-     tempax = SiS_Pr->SiS_VCLKData[index].CLOCK;                        /* Get VCLK */
-     
-     tempbx = SiS_GetColorDepth(SiS_Pr,ROMAddr,CRT1ModeNo,ModeIdIndex); /* Get colordepth */
-     tempbx >>= 1;
-     if(!tempbx) tempbx++; 
-     
-  } else {
-  
-     tempax = SiS_Pr->CSRClock;						/* Get VCLK */
-     tempbx = (SiS_Pr->CModeFlag & ModeInfoFlag) - 2;
-     switch(tempbx) {							/* Get color depth */
-       case 0 : 	tempbx = 1; break;
-       case 1 : 	tempbx = 1; break;
-       case 2 : 	tempbx = 2; break;
-       case 3 : 	tempbx = 2; break;
-       case 4 : 	tempbx = 3; break;
-       case 5 : 	tempbx = 4; break;
-       default:  	tempbx = 2; break;
-     }
-  
-  }
-    
-  tempax *= tempbx;
+           SiS_GetCRT2DataLVDS(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, HwInfo);
+
+        } else {
 
-  tempbx = SiS_GetMCLK(SiS_Pr,ROMAddr, HwDeviceExtension);     		/* Get MCLK */
+	   if((SiS_Pr->SiS_VBType & VB_NoLCD) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD)) {
 
-  tempax /= tempbx;
+	      /* Need LVDS Data for LCD on 301B-DH */
+	      SiS_GetCRT2DataLVDS(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, HwInfo);
 
-  tempbx = tempax;
+	   } else {
 
-#if 0 /* TW: BIOS code is skrewed */
-  if(SiS_GetReg1(SiS_Pr->SiS_P3c4,0x14) & 0x02) {
-   	tempax = 16;
-  } else {
-    	tempax = 8;
-  }
-#endif
-  tempax = 16;
+	      SiS_GetCRT2Data301(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, HwInfo);
+
+           }
 
-  tempax -= tempbx;
+        }
 
-  tempbx = tempax;    /* tempbx = 16-DRamBus - DCLK*BytePerPixel/MCLK */
+     } else {
 
-  tempax = ((52 * 16) / tempbx);
+     	SiS_GetCRT2Data301(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, HwInfo);
 
-  if ((52*16 % tempbx) != 0) {
-    	tempax++;
-  }
-  tempcx = tempax;
-  tempcx += 40;
+     }
 
-  /* get DRAM latency */
-  tempcl = (SiS_GetReg1(SiS_Pr->SiS_P3c4,0x17) >> 3) & 0x7;     /* SR17[5:3] DRAM Queue depth */
-  tempch = (SiS_GetReg1(SiS_Pr->SiS_P3c4,0x17) >> 6) & 0x3;     /* SR17[7:6] DRAM Grant length */
-
-  for (temp3 = 0; temp3 < 16; temp3 += 2) {
-    if ((CombCode[temp3] == tempcl) && (CombCode[temp3+1] == tempch)) {
-      temp3 = CRT2ThLow[temp3 >> 1];
-    }
-  }
+  } else {
 
-  tempcx +=  temp3;                                      /* CRT1 Request Period */
+     SiS_GetCRT2DataLVDS(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, HwInfo);
 
-  CRT2ModeNo = ModeNo;                                                 /* get CRT2 ModeNo */
-  SiS_SearchModeID(SiS_Pr,ROMAddr,&CRT2ModeNo,&ModeIdIndex);           /* Get ModeID Table */
+  }
+}
 
-  SiS_Pr->SiS_SetFlag |= ProgrammingCRT2;
-  SiS_Pr->SiS_SelectCRT2Rate = SelectRate_backup;
+/*********************************************/
+/*            GET LVDS DES DATA              */
+/*********************************************/
 
-  RefreshRateTableIndex = SiS_GetRatePtrCRT2(SiS_Pr,ROMAddr,CRT2ModeNo,
-                                           ModeIdIndex,HwDeviceExtension);
+static void
+SiS_GetLVDSDesPtr(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
+                  USHORT RefreshRateTableIndex, USHORT *PanelIndex,
+		  USHORT *ResIndex, PSIS_HW_INFO HwInfo)
+{
+  USHORT tempbx,tempal,modeflag;
 
-  index = SiS_GetVCLK2Ptr(SiS_Pr,ROMAddr,CRT2ModeNo,ModeIdIndex,
-                          RefreshRateTableIndex,HwDeviceExtension);
-  if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) {
-     tempax = SiS_Pr->SiS_VCLKData[index].CLOCK;                       /* Get VCLK  */
+  if(ModeNo <= 0x13) {
+     modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
+     tempal = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC;
   } else {
-     tempax = SiS_Pr->SiS_VBVCLKData[index].CLOCK;                     /* Get VCLK  */
+     modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
+     tempal = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC;
+  }
+
+  tempbx = 0;
+  if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) {
+     if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
+        tempbx = 50;
+        if((SiS_Pr->SiS_TVMode & TVSetPAL) && (!(SiS_Pr->SiS_TVMode & TVSetPALM))) tempbx += 2;
+        if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) tempbx += 1;
+        /* Nothing special needed for SOverscan    */
+        /*     PALM uses NTSC data, PALN uses PAL data */
+     }
   }
 
-  tempbx = SiS_GetColorDepth(SiS_Pr,ROMAddr,CRT2ModeNo,ModeIdIndex);   /* Get colordepth */
-  tempbx >>= 1;
-  if(!tempbx) tempbx++;
+  if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
+     tempbx = SiS_Pr->SiS_LCDTypeInfo;
+     if(HwInfo->jChipType >= SIS_661) {
+        /* As long as we don's use the BIOS tables, we
+	 * need to convert the TypeInfo as for 315 series
+	 */
+        tempbx = SiS_Pr->SiS_LCDResInfo - 1;
+     }
+     if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx += 16;
+     if(SiS_Pr->SiS_LCDInfo & LCDPass11) {
+        tempbx = 32;
+        if(modeflag & HalfDCLK) tempbx++;
+     }
+  }
 
-  tempax *= tempbx;
+  if(SiS_Pr->SiS_SetFlag & SetDOSMode) {
+     if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel640x480)  {
+        tempal = 0x07;
+        if(HwInfo->jChipType < SIS_315H) {
+           if(SiS_GetReg(SiS_Pr->SiS_P3c4,0x13) & 0x80) tempal++;
+        }
+     }
+  }
 
-  tempax *= tempcx;
+  *PanelIndex = tempbx;
+  *ResIndex = tempal & 0x1F;
+}
 
-  tempbx = SiS_GetMCLK(SiS_Pr,ROMAddr, HwDeviceExtension);	       /* Get MCLK */
-  tempbx <<= 4;
+#ifdef SIS315H
+static void
+SiS_GetLVDSDesPtrA(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
+                   USHORT RefreshRateTableIndex, USHORT *PanelIndex, USHORT *ResIndex,
+		   PSIS_HW_INFO HwInfo)
+{
+  USHORT tempbx=0,tempal;
 
-  tempcx = tempax;
-  tempax /= tempbx;
-  if(tempcx % tempbx) tempax++;		/* CRT1 Request period * TCLK * BytePerPixel / (MCLK*16) */
+  if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050)      tempbx = 2;
+  else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200) tempbx = 3;
+  else tempbx = SiS_Pr->SiS_LCDResInfo - 2;
 
-  if (tempax > 0x37)  tempax = 0x37;
+  if(SiS_Pr->SiS_LCDInfo & DontExpandLCD)  tempbx += 4;
 
-  /* TW: 650/LVDS (1.10.07, 1.10.00), 650/301LV, 740, 330 overrule calculated value; 315 does not */
-  if(HwDeviceExtension->jChipType >= SIS_650) {
-  	tempax = 0x04;
+  if(SiS_Pr->SiS_CustomT == CUT_CLEVO1024) {
+     if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) {
+        if(SiS_IsDualLink(SiS_Pr, HwInfo)) {
+	   tempbx = 80;
+	   if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx++;
+	}
+     }
+  }
+  if((SiS_Pr->SiS_CustomT == CUT_UNIWILL1024) ||
+     (SiS_Pr->SiS_CustomT == CUT_UNIWILL10242)) {
+     if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) {
+	tempbx = 82;
+	if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx++;
+     }
+  }
+  if(SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) {
+     if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) {
+	tempbx = 84;
+	if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx++;
+     }
+  }
+  if(SiS_Pr->SiS_CustomT == CUT_ASUSA2H_2) {
+     if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) {
+	tempbx = 86;
+	if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx++;
+     }
   }
-  
-  SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x02,~0x3F,tempax);
-}
 
-USHORT
-SiS_GetMCLK(SiS_Private *SiS_Pr, UCHAR *ROMAddr, PSIS_HW_DEVICE_INFO HwDeviceExtension)
-{
-  USHORT index;
+  if(ModeNo <= 0x13)
+     tempal = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC;
+  else
+     tempal = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC;
 
-  index = SiS_Get310DRAMType(SiS_Pr,ROMAddr,HwDeviceExtension);
-  if(index >= 4) {
-    index -= 4;
-    return(SiS_Pr->SiS_MCLKData_1[index].CLOCK);
-  } else {
-    return(SiS_Pr->SiS_MCLKData_0[index].CLOCK);
-  }
+  *PanelIndex = tempbx;
+  *ResIndex = tempal & 0x1F;
 }
 #endif
 
-/* TW: Checked against 650/LVDS 1.10.07 BIOS */
-void
-SiS_GetLVDSDesData(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
-                   USHORT RefreshRateTableIndex,
-		   PSIS_HW_DEVICE_INFO HwDeviceExtension)
+static void
+SiS_GetLVDSDesData(SiS_Private *SiS_Pr, USHORT ModeNo,USHORT ModeIdIndex,
+                   USHORT RefreshRateTableIndex, PSIS_HW_INFO HwInfo)
 {
   USHORT modeflag;
   USHORT PanelIndex,ResIndex;
   const  SiS_LVDSDesStruct *PanelDesPtr = NULL;
 
-  if((SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) ) {
+  if((SiS_Pr->UseCustomMode) ||
+     (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_PanelCustom) ||
+     (SiS_Pr->SiS_CustomT == CUT_PANEL848)) {
+     SiS_Pr->SiS_LCDHDES = 0;
+     SiS_Pr->SiS_LCDVDES = 0;
+     return;
+  }
+
+  if((SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) {
+
+#ifdef SIS315H
+     SiS_GetLVDSDesPtrA(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex,
+                        &PanelIndex, &ResIndex, HwInfo);
 
-#ifdef SIS315H  
-     SiS_GetLVDSDesPtrA(SiS_Pr,ROMAddr,ModeNo,ModeIdIndex,RefreshRateTableIndex,
-                        &PanelIndex,&ResIndex);
-			
      switch (PanelIndex)
      {
      	case  0: PanelDesPtr = SiS_Pr->LVDS1024x768Des_1;   break;  /* --- expanding --- */
@@ -2639,14 +3546,22 @@
      	case  5: PanelDesPtr = SiS_Pr->LVDS1280x1024Des_2;  break;
 	case  6: PanelDesPtr = SiS_Pr->LVDS1400x1050Des_2;  break;
 	case  7: PanelDesPtr = SiS_Pr->LVDS1600x1200Des_2;  break;
+	case 80: PanelDesPtr = (SiS_LVDSDesStruct *)Clevo1024x768Des_1;   break;  /*  custom  */
+	case 81: PanelDesPtr = (SiS_LVDSDesStruct *)Clevo1024x768Des_2;   break;
+	case 82: PanelDesPtr = (SiS_LVDSDesStruct *)Uniwill1024x768Des_1; break;
+	case 83: PanelDesPtr = (SiS_LVDSDesStruct *)Uniwill1024x768Des_2; break;
+	case 84: PanelDesPtr = (SiS_LVDSDesStruct *)Compaq1280x1024Des_1; break;
+	case 85: PanelDesPtr = (SiS_LVDSDesStruct *)Compaq1280x1024Des_2; break;
+	case 86: PanelDesPtr = (SiS_LVDSDesStruct *)Asus1024x768Des_1;    break;  /*  custom  */
+	case 87: PanelDesPtr = (SiS_LVDSDesStruct *)Asus1024x768Des_2;    break;
 	default: PanelDesPtr = SiS_Pr->LVDS1024x768Des_1;   break;
      }
 #endif
 
   } else {
 
-     SiS_GetLVDSDesPtr(SiS_Pr,ROMAddr,ModeNo,ModeIdIndex,RefreshRateTableIndex,
-                       &PanelIndex,&ResIndex,HwDeviceExtension);
+     SiS_GetLVDSDesPtr(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex,
+                       &PanelIndex, &ResIndex, HwInfo);
 
      switch (PanelIndex)
      {
@@ -2689,11 +3604,11 @@
      	case 52: PanelDesPtr = SiS_Pr->SiS_CHTVUPALDesData;    break;
      	case 53: PanelDesPtr = SiS_Pr->SiS_CHTVOPALDesData;    break;
 	default:
-		if(HwDeviceExtension->jChipType < SIS_315H)
-		   PanelDesPtr = SiS_Pr->SiS_PanelType0e_1;
-		else
-		   PanelDesPtr = SiS_Pr->SiS_PanelType01_1;
-		break;
+		 if(HwInfo->jChipType < SIS_315H)
+		    PanelDesPtr = SiS_Pr->SiS_PanelType0e_1;
+		 else
+		    PanelDesPtr = SiS_Pr->SiS_PanelType01_1;
+		 break;
      }
   }
   SiS_Pr->SiS_LCDHDES = (PanelDesPtr+ResIndex)->LCDHDES;
@@ -2709,12 +3624,11 @@
         }
      } else {
         if(!(SiS_Pr->SiS_SetFlag & SetDOSMode)) {
-           if( (HwDeviceExtension->jChipType < SIS_315H) || 
-	       (SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel1280x1024) ) {  
-              if(SiS_Pr->SiS_LCDResInfo >= SiS_Pr->SiS_Panel1024x768){
+           if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel1280x1024) {
+              if(SiS_Pr->SiS_LCDResInfo >= SiS_Pr->SiS_Panel1024x768) {
                  if(ModeNo <= 0x13) {
 	            modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
-	            if(HwDeviceExtension->jChipType < SIS_315H) {
+	            if(HwInfo->jChipType < SIS_315H) {
 	               if(!(modeflag & HalfDCLK)) SiS_Pr->SiS_LCDHDES = 320;
 	            } else {
 	               if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768)
@@ -2737,4472 +3651,3810 @@
         }
      }
   }
-  return;
 }
 
-void
-SiS_GetLVDSDesPtr(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
-                  USHORT RefreshRateTableIndex,USHORT *PanelIndex,
-		  USHORT *ResIndex,PSIS_HW_DEVICE_INFO HwDeviceExtension)
-{
-  USHORT tempbx,tempal,modeflag;
-
-  if(ModeNo <= 0x13) {
-    	modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
-	tempal = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC;
-  } else {
-    	modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
-	tempal = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC;
-  }
-
-  tempbx = 0;
-  if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) {
-     if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD)) {
-        tempbx = 50;
-        if((SiS_Pr->SiS_VBInfo & SetPALTV) && (!SiS_Pr->SiS_CHPALM)) tempbx += 2;
-        if(SiS_Pr->SiS_VBInfo & SetCHTVOverScan) tempbx += 1;
-        /* TW: Nothing special needed for SOverscan    */
-        /*     PALM uses NTSC data, PALN uses PAL data */
-     }
-  }
-  if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
-     tempbx = SiS_Pr->SiS_LCDTypeInfo;
-     if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx += 16;
-     if(SiS_Pr->SiS_LCDInfo & LCDPass11) {
-        tempbx = 32;
-        if(modeflag & HalfDCLK) tempbx++;
-     }
-  }
-  /* TW: 630/LVDS and 650/LVDS (1.10.07) BIOS */
-  if(SiS_Pr->SiS_SetFlag & SetDOSMode) {
-     if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel640x480)  {
-        tempal = 0x07;
-        if(HwDeviceExtension->jChipType < SIS_315H) {
-           if(SiS_GetReg1(SiS_Pr->SiS_P3c4,0x13) & 0x80) tempal++;
-        }
-     }
-  }
-
-  *PanelIndex = tempbx;
-  *ResIndex = tempal & 0x1F;
-}
+/*********************************************/
+/*          SET CRT2 AUTO-THRESHOLD          */
+/*********************************************/
 
 #ifdef SIS315H
-void
-SiS_GetLVDSDesPtrA(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
-                   USHORT RefreshRateTableIndex,USHORT *PanelIndex,USHORT *ResIndex)
+static void
+SiS_CRT2AutoThreshold(SiS_Private *SiS_Pr)
 {
-  USHORT tempbx=0,tempal;
-
-  if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050)      tempbx = 2;
-  else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200) tempbx = 3;
-  else tempbx = SiS_Pr->SiS_LCDResInfo - SiS_Pr->SiS_PanelMinLVDS;
-
-  if(SiS_Pr->SiS_LCDInfo & DontExpandLCD)  tempbx += 4;
-
-  if(ModeNo <= 0x13)
-     tempal = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC;
-  else
-     tempal = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC;
-
-  *PanelIndex = tempbx;
-  *ResIndex = tempal & 0x1F;
+  SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x01,0x40);
 }
 #endif
 
+/*********************************************/
+/*           DISABLE VIDEO BRIDGE            */
+/*********************************************/
+
+/* NEVER use any variables (VBInfo), this will be called
+ * from outside the context of modeswitch!
+ * MUST call getVBType before calling this
+ */
 void
-SiS_SetCRT2ModeRegs(SiS_Private *SiS_Pr, USHORT BaseAddr, USHORT ModeNo, USHORT ModeIdIndex,
-                    PSIS_HW_DEVICE_INFO HwDeviceExtension)
+SiS_DisableBridge(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
 {
-  USHORT i,j,modeflag;
-  USHORT tempcl,tempah=0;
-#ifdef SIS300
-  USHORT temp;
-#endif
 #ifdef SIS315H
-  USHORT tempbl;
+  USHORT tempah,pushax=0,modenum;
 #endif
+  USHORT temp=0;
 
-  if(ModeNo <= 0x13) {
-     modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
-  } else {
-     if(SiS_Pr->UseCustomMode) {
-        modeflag = SiS_Pr->CModeFlag;
-     } else {
-    	modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
-     }
-  }
-  
-  /* TW: BIOS does not do this (neither 301 nor LVDS) */
-  /*     (But it's harmless; see SetCRT2Offset) */
-  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x03,0x00);   /* fix write part1 index 0  BTDRAM bit Bug */
+  if(SiS_Pr->SiS_VBType & VB_SISVB) {
 
-  /* TW: Removed 301B302B301LV302LV check here to match 650/LVDS BIOS */
-  if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) {
+      if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {   /* ===== For 30xB/LV ===== */
 
-	/* TW:   1. for LVDS/302B/302LV **LCDA** */
+        if(HwInfo->jChipType < SIS_315H) {
 
-      SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x00,0xAF,0x40); /* FUNCTION CONTROL */
-      SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2E,0xF7);
+#ifdef SIS300	   /* 300 series */
 
-  } else {
+           if(HwInfo->jChipType == SIS_300) {  /* For 300+301LV (A907) */
+
+	      if(!(SiS_CR36BIOSWord23b(SiS_Pr,HwInfo))) {
+	         if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {
+	            SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x26,0xFE);
+		    SiS_PanelDelay(SiS_Pr, HwInfo, 3);
+		 }
+	      }
+	      SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x1f,0x3f);
+	      SiS_ShortDelay(SiS_Pr,1);
+	      SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x00,0xDF);
+	      SiS_DisplayOff(SiS_Pr);
+	      SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF);
+	      SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF);
+	      if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {
+	         if( (!(SiS_CRT2IsLCD(SiS_Pr, HwInfo))) ||
+	             (!(SiS_CR36BIOSWord23d(SiS_Pr, HwInfo))) ) {
+	            SiS_PanelDelay(SiS_Pr, HwInfo, 2);
+                    SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x26,0xFD);
+		 }
+	      }
 
-    for(i=0,j=4; i<3; i++,j++) SiS_SetReg1(SiS_Pr->SiS_Part1Port,j,0);
+	   } else {
 
-    tempcl = SiS_Pr->SiS_ModeType;
+	      if(!(SiS_CR36BIOSWord23b(SiS_Pr,HwInfo))) {
+	         SiS_SetRegSR11ANDOR(SiS_Pr,HwInfo,0xF7,0x08);
+	         SiS_PanelDelay(SiS_Pr, HwInfo, 3);
+	      }
+	      if(SiS_Is301B(SiS_Pr)) {
+	         SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x1f,0x3f);
+	         SiS_ShortDelay(SiS_Pr,1);
+	      }
+	      SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x00,0xDF);
+	      SiS_DisplayOff(SiS_Pr);
+	      SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF);
+	      SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF);
+	      SiS_UnLockCRT2(SiS_Pr,HwInfo);
+	      SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x01,0x80);
+	      SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x02,0x40);
+	      if( (!(SiS_CRT2IsLCD(SiS_Pr, HwInfo))) ||
+	          (!(SiS_CR36BIOSWord23d(SiS_Pr, HwInfo))) ) {
+	         SiS_PanelDelay(SiS_Pr, HwInfo, 2);
+                 SiS_SetRegSR11ANDOR(SiS_Pr,HwInfo,0xFB,0x04);
+	      }
+	   }
 
-    if(HwDeviceExtension->jChipType < SIS_315H) {
+#endif  /* SIS300 */
 
-#ifdef SIS300    /* ---- 300 series ---- */
+        } else {
 
-      /* For 301BDH: */
-      if(SiS_Pr->SiS_VBType & VB_NoLCD) {
-	  temp = SiS_GetReg1(SiS_Pr->SiS_P3c4,0x32);
-	  temp &= 0xef;
-	  temp |= 0x02;
-	  if((SiS_Pr->SiS_VBInfo & SetCRT2ToTV) || (SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC)) {
-	     temp |= 0x10;
-	     temp &= 0xfd;
-	  }
-	  SiS_SetReg1(SiS_Pr->SiS_P3c4,0x32,temp);
-      }
+#ifdef SIS315H	   /* 315 series */
 
-      if(ModeNo > 0x13) {
-        tempcl -= ModeVGA;
-        if((tempcl > 0) || (tempcl == 0)) {      /* TW: tempcl is USHORT -> always true! */
-           tempah = ((0x10 >> tempcl) | 0x80);
-        }
-      } else tempah = 0x80;
+           if(IS_SIS550650740660) {		/* 550, 650, 740, 660 */
 
-      if(SiS_Pr->SiS_VBInfo & SetInSlaveMode)  tempah ^= 0xA0;
+	      modenum = SiS_GetReg(SiS_Pr->SiS_P3d4,0x34) & 0x7f;
 
-#endif  /* SIS300 */
+              if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {			/* LV */
+#ifdef SET_EMI
+	         if(SiS_Pr->SiS_VBType & (VB_SIS302LV | VB_SIS302ELV)) {
+		    if(SiS_Pr->SiS_CustomT != CUT_CLEVO1400) {
+	               SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x30,0x0c);
+		    }
+		 }
+#endif
+		 if( (modenum <= 0x13) ||
+		     (!(SiS_IsDualEdge(SiS_Pr,HwInfo))) ||
+		     (SiS_IsVAMode(SiS_Pr,HwInfo)) ) {
+	     	    SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x26,0xFE);
+		    if((SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) ||
+		       (SiS_Pr->SiS_CustomT == CUT_CLEVO1400)) {
+		       SiS_PanelDelay(SiS_Pr, HwInfo, 3);
+		    }
+	         }
 
-    } else {
+		 if((SiS_Pr->SiS_CustomT != CUT_COMPAQ1280) &&
+		    (SiS_Pr->SiS_CustomT != CUT_CLEVO1400)) {
+		    SiS_DDC2Delay(SiS_Pr,0xff00);
+		    SiS_DDC2Delay(SiS_Pr,0xe000);
 
-#ifdef SIS315H    /* ---- 310/325/330 series ---- */
+	            SiS_SetRegByte(SiS_Pr->SiS_P3c6,0x00);
 
-      if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
-         if(SiS_Pr->SiS_VBInfo & CRT2DisplayFlag) {
-	    SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2e,0x08);
-         }
-      }
+                    pushax = SiS_GetReg(SiS_Pr->SiS_P3c4,0x06);
 
-      if(ModeNo > 0x13) {
-        tempcl -= ModeVGA;
-        if((tempcl > 0) || (tempcl == 0)) {  /* TW: tempcl is USHORT -> always true! */
-           tempah = (0x08 >> tempcl);
-           if (tempah == 0) tempah = 1;
-           tempah |= 0x40;
-        }
-      } else tempah = 0x40;
+		    if(IS_SIS740) {
+		       SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x06,0xE3);
+		    }
 
-      if(SiS_Pr->SiS_VBInfo & SetInSlaveMode)  tempah ^= 0x50;
+	            SiS_PanelDelay(SiS_Pr, HwInfo, 3);
 
-#endif  /* SIS315H */
+		    if(!(SiS_IsNotM650orLater(SiS_Pr, HwInfo))) {
+	               tempah = 0xef;
+	               if(SiS_IsVAMode(SiS_Pr,HwInfo)) {
+	                  tempah = 0xf7;
+                       }
+	               SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x4c,tempah);
+	            }
+		 }
 
-    }
+              } else if(SiS_Pr->SiS_VBType & VB_NoLCD) {			/* B-DH */
 
-    if(SiS_Pr->SiS_VBInfo & CRT2DisplayFlag)  tempah = 0;
+	         if(!(SiS_IsNotM650orLater(SiS_Pr,HwInfo))) {
+	            SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x4c,0xef);
+	         }
 
-    if(HwDeviceExtension->jChipType < SIS_315H) {
-       SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x00,tempah);  		/* FUNCTION CONTROL */
-    } else {
-       if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
-          SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x00,0xa0,tempah);  	/* FUNCTION CONTROL */
-       } else {
-          if(IS_SIS740) {
-	     SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x00,tempah);  		/* FUNCTION CONTROL */
-	  } else {
-             SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x00,0xa0,tempah);  	/* FUNCTION CONTROL */
-	  }
-       }
-    }
+	      }
+
+	      if((SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) ||
+	         (SiS_Pr->SiS_CustomT == CUT_CLEVO1400)) {
+	         SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x1F,0xef);
+	      }
 
-    if(SiS_Pr->SiS_IF_DEF_LVDS == 0) {
+              if((SiS_Pr->SiS_VBType & VB_SIS301B302B) ||
+	         (SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) ||
+		 (SiS_Pr->SiS_CustomT == CUT_CLEVO1400)) {
+	         tempah = 0x3f;
+	         if(SiS_IsDualEdge(SiS_Pr,HwInfo)) {
+	            tempah = 0x7f;
+	            if(!(SiS_IsVAMode(SiS_Pr,HwInfo))) {
+		       tempah = 0xbf;
+                    }
+	         }
+	         SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x1F,tempah);
+	      }
 
-	/* TW:   2. for 301 (301B, 302B 301LV, 302LV non-LCDA) */
+              if((SiS_IsVAMode(SiS_Pr,HwInfo)) ||
+	         ((SiS_Pr->SiS_VBType & VB_SIS301LV302LV) && (modenum <= 0x13))) {
 
-    	tempah = 0x01;
-    	if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) {
-      		tempah |= 0x02;
-    	}
-    	if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC)) {
-      		tempah ^= 0x05;
-      		if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD)) {
-        		tempah ^= 0x01;
-      		}
-    	}
+	         if((SiS_Pr->SiS_VBType & VB_SIS301B302B) ||
+		    (SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) ||
+		    (SiS_Pr->SiS_CustomT == CUT_CLEVO1400)) {
+		    SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x1E,0xDF);
+		    SiS_DisplayOff(SiS_Pr);
+		    SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF);
+		 } else {
+	            SiS_DisplayOff(SiS_Pr);
+	            SiS_PanelDelay(SiS_Pr, HwInfo, 2);
+	            SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF);
+	            SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x1E,0xDF);
+		    if((SiS_Pr->SiS_VBType & VB_SIS301LV302LV) && (modenum <= 0x13)) {
+		       SiS_DisplayOff(SiS_Pr);
+	               SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x80);
+	               SiS_PanelDelay(SiS_Pr, HwInfo, 2);
+	               SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF);
+	               temp = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00);
+                       SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x10);
+	               SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF);
+	               SiS_SetReg(SiS_Pr->SiS_Part1Port,0x00,temp);
+		    }
+		 }
 
-	if(SiS_Pr->SiS_VBInfo & CRT2DisplayFlag)  tempah = 0;
+	      } else {
 
-    	if(HwDeviceExtension->jChipType < SIS_315H) {
+	         if((SiS_Pr->SiS_VBType & VB_SIS301B302B) ||
+		    (SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) ||
+		    (SiS_Pr->SiS_CustomT == CUT_CLEVO1400)) {
+		    if(!(SiS_IsDualEdge(SiS_Pr,HwInfo))) {
+		       SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x00,0xdf);
+		       SiS_DisplayOff(SiS_Pr);
+		    }
+		    SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x80);
+		 } else {
+                    SiS_DisplayOff(SiS_Pr);
+	            SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x80);
+	            SiS_PanelDelay(SiS_Pr, HwInfo, 2);
+		 }
 
-		/* --- 300 series --- */
+		 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF);
+	         temp = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00);
+                 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x10);
+	         SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF);
+	         SiS_SetReg(SiS_Pr->SiS_Part1Port,0x00,temp);
 
-      		tempah = (tempah << 5) & 0xFF;
-      		SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x01,tempah);
-      		tempah = (tempah >> 5) & 0xFF;
+	      }
 
-    	} else {
+	      if((SiS_Pr->SiS_VBType & VB_SIS301LV302LV) &&
+	         (SiS_Pr->SiS_CustomT != CUT_COMPAQ1280) &&
+		 (SiS_Pr->SiS_CustomT != CUT_CLEVO1400)) {
 
-		/* --- 310 series --- */
+		 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x1f,~0x10);
 
-      		SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2E,0xF8,tempah);
+	         tempah = 0x3f;
+	         if(SiS_IsDualEdge(SiS_Pr,HwInfo)) {
+	            tempah = 0x7f;
+	            if(!(SiS_IsVAMode(SiS_Pr,HwInfo))) {
+		       tempah = 0xbf;
+                    }
+	         }
+	         SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x1F,tempah);
 
-    	}
+		 if(SiS_IsNotM650orLater(SiS_Pr,HwInfo)) {
+	            SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2e,0x7f);
+		 }
 
-    	if((SiS_Pr->SiS_ModeType == ModeVGA) && (!(SiS_Pr->SiS_VBInfo & SetInSlaveMode))) {
-      		tempah |= 0x10;
-	}
+	         if(!(SiS_IsVAMode(SiS_Pr,HwInfo))) {
+	            SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x00,0xdf);
+	            if(!(SiS_CRT2IsLCD(SiS_Pr,HwInfo))) {
+	               if(!(SiS_IsDualEdge(SiS_Pr,HwInfo))) {
+		          SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x26,0xFD);
+                       }
+                    }
+	         }
 
-	/* TW: 630/301 BIOS */
-	if((HwDeviceExtension->jChipType < SIS_315H) && (SiS_Pr->SiS_VBType & VB_SIS301)) {
-		if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) {
-			tempah |= 0x80;
-		}
-	} else {
-		tempah |= 0x80;
-	}
+	         SiS_SetReg(SiS_Pr->SiS_P3c4,0x06,pushax);
 
-    	if(SiS_Pr->SiS_VBInfo & (SetCRT2ToTV - SetCRT2ToHiVisionTV)) {
-      		if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) {
-			if(!(SiS_Pr->SiS_HiVision & 0x03)) {
-          			tempah |= 0x20;
-			}
-      		}
-    	}
+		 if(SiS_Pr->SiS_VBType & (VB_SIS302LV | VB_SIS302ELV)) {
+	            if( (SiS_IsVAMode(SiS_Pr, HwInfo)) ||
+	                (SiS_CRT2IsLCD(SiS_Pr, HwInfo)) ) {
+		       SiS_PanelDelayLoop(SiS_Pr, HwInfo, 3, 20);
+		    }
+	         }
+
+  	      } else if(SiS_Pr->SiS_VBType & VB_NoLCD) {
+
+	         /* NIL */
+
+	      } else if((SiS_Pr->SiS_VBType & VB_SIS301B302B) ||
+	                (SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) ||
+			(SiS_Pr->SiS_CustomT == CUT_CLEVO1400)) {
+
+		 if(!(SiS_IsNotM650orLater(SiS_Pr,HwInfo))) {
+	            tempah = 0xef;
+	            if(SiS_IsDualEdge(SiS_Pr,HwInfo)) {
+		       if(modenum > 0x13) {
+	                  tempah = 0xf7;
+		       }
+                    }
+	            SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x4c,tempah);
+		 }
+		 if((SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) ||
+		    (SiS_Pr->SiS_CustomT == CUT_CLEVO1400)) {
+		    if((SiS_IsVAMode(SiS_Pr,HwInfo)) ||
+		       (!(SiS_IsDualEdge(SiS_Pr,HwInfo)))) {
+		       if((!(SiS_WeHaveBacklightCtrl(SiS_Pr, HwInfo))) ||
+		          (!(SiS_CRT2IsLCD(SiS_Pr, HwInfo)))) {
+			  SiS_PanelDelay(SiS_Pr, HwInfo, 2);
+	     	          SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x26,0xFD);
+			  SiS_PanelDelay(SiS_Pr, HwInfo, 4);
+	               }
+		    }
+		 }
+
+	      }
+
+	  } else {			/* 315, 330 - all bridge types */
 
-    	SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x0D,0x40,tempah);
+	     if(SiS_Is301B(SiS_Pr)) {
+	        tempah = 0x3f;
+	        if(SiS_IsDualEdge(SiS_Pr,HwInfo)) {
+	           tempah = 0x7f;
+	           if(!(SiS_IsVAMode(SiS_Pr,HwInfo))) {
+		      tempah = 0xbf;
+                   }
+	        }
+	        SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x1F,tempah);
+	        if(SiS_IsVAMode(SiS_Pr,HwInfo)) {
+	           SiS_DisplayOff(SiS_Pr);
+		   SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF);
+	        }
+	     }
+	     if( (!(SiS_Is301B(SiS_Pr))) ||
+	         (!(SiS_IsVAMode(SiS_Pr,HwInfo))) ) {
 
-    	tempah = 0;
-    	if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
-	   if(!(SiS_Pr->SiS_HiVision & 0x03)) {
-      	      if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) {
-	         if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVisionTV)) {
-       		    if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
-            	       SiS_Pr->SiS_SetFlag |= RPLLDIV2XO;
-            	       tempah |= 0x40;
-       		    } else {
-        	       if(!(SiS_Pr->SiS_SetFlag & TVSimuMode)) {
-          		  SiS_Pr->SiS_SetFlag |= RPLLDIV2XO;
-            		  tempah |= 0x40;
-        	       }
-      		    }
-		 }
-     	      } else {
-        	SiS_Pr->SiS_SetFlag |= RPLLDIV2XO;
-        	tempah |= 0x40;
-      	      }
-	   }
-    	}
-	/* TW: For 302LV dual-channel */
-	if(HwDeviceExtension->jChipType >= SIS_315H) {
-	    if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
-	        if(SiS_GetReg1(SiS_Pr->SiS_P3d4,0x39) & 0x04)
-		    tempah |= 0x40;
-	    }
-	}
+ 	 	if( (!(SiS_Is301B(SiS_Pr))) ||
+		    (!(SiS_IsDualEdge(SiS_Pr,HwInfo))) ) {
 
-	if((SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) ||
-	   (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x960)) {
-		tempah |= 0x80;
-	}
+	           SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x00,0xDF);
+	           SiS_DisplayOff(SiS_Pr);
 
-    	SiS_SetReg1(SiS_Pr->SiS_Part4Port,0x0C,tempah);
+		}
 
-    } else {
+                SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x80);
 
-    	/* TW: 3. for LVDS */
+                SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF);
 
-	if(HwDeviceExtension->jChipType >= SIS_315H) {
+	        temp = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00);
+                SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x10);
+	        SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF);
+	        SiS_SetReg(SiS_Pr->SiS_Part1Port,0x00,temp);
 
-	   /* TW: Inserted this entire section (BIOS 650/LVDS); added ModeType check
-	    *     (LVDS can only be slave in 8bpp modes)
-	    */
-	   tempah = 0x80;
-	   if( (modeflag & CRT2Mode) && (SiS_Pr->SiS_ModeType > ModeVGA) ) {
-	       if (SiS_Pr->SiS_VBInfo & DriverMode) {
-	           tempah |= 0x02;
-	       }
-	   }
+	     }
 
-	   if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) {
-               tempah |= 0x02;
-    	   }
+	  }    /* 315/330 */
 
-	   if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
-	       tempah ^= 0x01;
-	   }
+#endif /* SIS315H */
 
-	   if(SiS_Pr->SiS_VBInfo & DisableCRT2Display) {
-	       tempah = 1;
-	   }
+	}
 
-    	   SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2e,0xF0,tempah);
+      } else {     /* ============ For 301 ================ */
 
-	} else {
+        if(HwInfo->jChipType < SIS_315H) {
+           if(!(SiS_CR36BIOSWord23b(SiS_Pr,HwInfo))) {
+	      SiS_SetRegSR11ANDOR(SiS_Pr,HwInfo,0xF7,0x08);
+	      SiS_PanelDelay(SiS_Pr, HwInfo, 3);
+	   }
+	}
 
-	   /* TW: (added ModeType check) */
-	   tempah = 0;
-	   if( (!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) && (SiS_Pr->SiS_ModeType > ModeVGA) ) {
-               	  tempah |= 0x02;
-    	   }
-	   tempah <<= 5;
+        SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x00,0xDF);           /* disable VB */
+        SiS_DisplayOff(SiS_Pr);
 
-	   if(SiS_Pr->SiS_VBInfo & DisableCRT2Display)  tempah = 0;
+        if(HwInfo->jChipType >= SIS_315H) {
+           SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x80);
+	}
 
-	   SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x01,tempah);
+        SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF);                /* disable lock mode */
 
+	if(HwInfo->jChipType >= SIS_315H) {
+            temp = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00);
+            SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x10);
+	    SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20);
+	    SiS_SetReg(SiS_Pr->SiS_Part1Port,0x00,temp);
+	} else {
+            SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF);            /* disable CRT2 */
+	    if( (!(SiS_CRT2IsLCD(SiS_Pr, HwInfo))) ||
+	        (!(SiS_CR36BIOSWord23d(SiS_Pr,HwInfo))) ) {
+		SiS_PanelDelay(SiS_Pr, HwInfo, 2);
+		SiS_SetRegSR11ANDOR(SiS_Pr,HwInfo,0xFB,0x04);
+	    }
 	}
 
-    }
+      }
 
-  }
+  } else {     /* ============ For LVDS =============*/
 
-  /* TW: Inserted the entire following section */
+    if(HwInfo->jChipType < SIS_315H) {
 
-  if(SiS_Pr->SiS_IF_DEF_LVDS == 0) {
+#ifdef SIS300	/* 300 series */
 
-      if(HwDeviceExtension->jChipType >= SIS_315H) {
+	if(SiS_Pr->SiS_IF_DEF_CH70xx == 1) {
+	   SiS_SetCH700x(SiS_Pr,0x090E);
+	}
 
-#ifdef SIS315H
-         if(!(IS_SIS740)) {
-            tempah = 0x04;						   /* For all bridges */
-            tempbl = 0xfb;
-            if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) {
-               tempah = 0x00;
-	       if(SiS_IsDualEdge(SiS_Pr, HwDeviceExtension, BaseAddr))
-	          tempbl = 0xff;
-            }
-            SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,tempbl,tempah);   
-	 }
-	 
-	 if(IS_SIS740) {						
-	    tempah = 0x30;
-	    tempbl = 0xcf;
-	    if(SiS_Pr->SiS_VBInfo & DisableCRT2Display) {
-	       tempah = 0x00;
-	    }
-	    SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2c,tempbl,tempah);    
-	 } else {
-	    /* TW: This in order to fix "TV-blue-bug" on 315+301 */
-            if(SiS_Pr->SiS_VBType & VB_SIS301) {
-	       SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2c,0xCF);             /* For 301   */
-	    } else {
-	       if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {
-	          SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2c,0xCF,0x30);   /* For 30xLV */
-	       } else {
-	          tempah = 0x30;					   /* For 301B  */
-	          tempbl = 0xcf;
-	          if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) {
-	             tempah = 0x00;
-		     if(SiS_IsDualEdge(SiS_Pr, HwDeviceExtension, BaseAddr)) {
-		        tempbl = 0xff;
-		     }
-	          }
-	          SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2c,tempbl,tempah);    
-	       }
-	    }
-	 }
+	if(HwInfo->jChipType == SIS_730) {
+	   if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x11) & 0x08)) {
+	      SiS_WaitVBRetrace(SiS_Pr,HwInfo);
+	   }
+	   if(!(SiS_CR36BIOSWord23b(SiS_Pr,HwInfo))) {
+	      SiS_SetRegSR11ANDOR(SiS_Pr,HwInfo,0xF7,0x08);
+	      SiS_PanelDelay(SiS_Pr, HwInfo, 3);
+	   }
+	} else {
+	   if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x11) & 0x08)) {
+	      if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x13) & 0x40)) {
+  	         if(!(SiS_CR36BIOSWord23b(SiS_Pr,HwInfo))) {
+                    SiS_WaitVBRetrace(SiS_Pr,HwInfo);
+		    if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x06) & 0x1c)) {
+		       SiS_DisplayOff(SiS_Pr);
+	            }
+	            SiS_SetRegSR11ANDOR(SiS_Pr,HwInfo,0xF7,0x08);
+	            SiS_PanelDelay(SiS_Pr, HwInfo, 3);
+                 }
+              }
+	   }
+	}
 
-	 if(IS_SIS740) {
-	    tempah = 0xc0;
-  	    tempbl = 0x3f;
-	    if(SiS_Pr->SiS_VBInfo & DisableCRT2Display) {
-	       tempah = 0x00;
-	    } 
-	    SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x21,tempbl,tempah);     
-	 } else {
-	    if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {			/* For 30xLV */
-	       SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x21,0x3f,0xc0);
-	    } else {							/* For 301, 301B */ 
-	        tempah = 0xc0;
-	        tempbl = 0x3f;
-	        if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) {
-	           tempah = 0x00;
-		   if(SiS_IsDualEdge(SiS_Pr, HwDeviceExtension, BaseAddr)) {
-		      tempbl = 0xff;
-		   }
-	        }
-	        SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x21,tempbl,tempah);     
-	    }
-	 }
+	SiS_DisplayOff(SiS_Pr);
 
-	 if(IS_SIS740) {						
-	    tempah = 0x80;
-	    tempbl = 0x7f;
-	    if(SiS_Pr->SiS_VBInfo & DisableCRT2Display) {
-	       tempah = 0x00;
-	    } 
-	    SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x23,tempbl,tempah);
-	 } else {
-	    tempah = 0x00;						/* For all bridges */	
-            tempbl = 0x7f;
-            if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) {
-               tempbl = 0xff;
-	       if(!(SiS_IsDualEdge(SiS_Pr, HwDeviceExtension, BaseAddr)))
-	          tempah |= 0x80;
-            }
-            SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x23,tempbl,tempah);
-	 }
+	SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF);
 
-#endif /* SIS315H */
+	SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF);
+	SiS_UnLockCRT2(SiS_Pr,HwInfo);
+	SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x01,0x80);
+	SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x02,0x40);
 
-      } else if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
+	if( (!(SiS_CRT2IsLCD(SiS_Pr, HwInfo))) ||
+	    (!(SiS_CR36BIOSWord23d(SiS_Pr,HwInfo))) ) {
+	   SiS_PanelDelay(SiS_Pr, HwInfo, 2);
+	   SiS_SetRegSR11ANDOR(SiS_Pr,HwInfo,0xFB,0x04);
+	}
 
-         SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x21,0x3f);
+#endif  /* SIS300 */
 
-         if((SiS_Pr->SiS_VBInfo & DisableCRT2Display) ||
-            (   (SiS_Pr->SiS_VBType & VB_NoLCD) &&
-	        (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) ) ) {
-	    SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x23,0x7F);
-	 } else {
-	    SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x23,0x80);
-	 }
+    } else {
 
-      }
+#ifdef SIS315H	/* 315 series */
 
-  } else {  /* LVDS */
+	if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) {
 
-#ifdef SIS315H
-      if(HwDeviceExtension->jChipType >= SIS_315H) {
+	   if(HwInfo->jChipType == SIS_740) {
+	      temp = SiS_GetCH701x(SiS_Pr,0x61);
+	      if(temp < 1) {
+	         SiS_SetCH701x(SiS_Pr,0xac76);
+	         SiS_SetCH701x(SiS_Pr,0x0066);
+	      }
 
-         if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) {
+	      if( (!(SiS_IsDualEdge(SiS_Pr,HwInfo))) ||
+	          (SiS_IsTVOrYPbPrOrScart(SiS_Pr,HwInfo)) ) {
+	  	 SiS_SetCH701x(SiS_Pr,0x3e49);
+	      }
+	   }
 
-            tempah = 0x04;
-	    tempbl = 0xfb;
-            if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) {
-               tempah = 0x00;
-	       if(SiS_IsDualEdge(SiS_Pr, HwDeviceExtension, BaseAddr))
-	          tempbl = 0xff;
-            }
-	    SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,tempbl,tempah);
+	   if( (!(SiS_IsDualEdge(SiS_Pr,HwInfo))) ||
+	       (SiS_IsVAMode(SiS_Pr,HwInfo)) ) {
+	      SiS_Chrontel701xBLOff(SiS_Pr);
+	      SiS_Chrontel701xOff(SiS_Pr,HwInfo);
+	   }
 
-	    if(SiS_Pr->SiS_VBInfo & DisableCRT2Display)
-	       SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,0xfb,0x00);
+	   if(HwInfo->jChipType != SIS_740) {
+	      if( (!(SiS_IsDualEdge(SiS_Pr,HwInfo))) ||
+	          (SiS_IsTVOrYPbPrOrScart(SiS_Pr,HwInfo)) ) {
+	   	 SiS_SetCH701x(SiS_Pr,0x0149);
+  	      }
+	   }
 
-	    SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2c,0xcf,0x30);
+	}
 
-	 }
+	if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) {
+	   SiS_SetRegSR11ANDOR(SiS_Pr,HwInfo,0xF7,0x08);
+	   SiS_PanelDelay(SiS_Pr, HwInfo, 3);
+	}
 
-      }
-#endif
+	if( (SiS_Pr->SiS_IF_DEF_CH70xx == 0)   ||
+	    (!(SiS_IsDualEdge(SiS_Pr,HwInfo))) ||
+	    (!(SiS_IsTVOrYPbPrOrScart(SiS_Pr,HwInfo))) ) {
+	   SiS_DisplayOff(SiS_Pr);
+	}
 
-  }
+	if( (SiS_Pr->SiS_IF_DEF_CH70xx == 0)   ||
+	    (!(SiS_IsDualEdge(SiS_Pr,HwInfo))) ||
+	    (!(SiS_IsVAMode(SiS_Pr,HwInfo))) ) {
+	   SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x80);
+	}
 
-}
+	if(HwInfo->jChipType == SIS_740) {
+	   SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2e,0x7f);
+	}
 
-void
-SiS_GetCRT2Data(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
-                USHORT RefreshRateTableIndex,
-		PSIS_HW_DEVICE_INFO HwDeviceExtension)
-{
+	SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF);
 
-  if(SiS_Pr->SiS_IF_DEF_LVDS == 0) {
+	if( (SiS_Pr->SiS_IF_DEF_CH70xx == 0)   ||
+	    (!(SiS_IsDualEdge(SiS_Pr,HwInfo))) ||
+	    (!(SiS_IsVAMode(SiS_Pr,HwInfo))) ) {
+	   SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF);
+	}
 
-     if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
+	if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) {
+	   if(SiS_CRT2IsLCD(SiS_Pr, HwInfo)) {
+	      SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x1e,0xdf);
+	      if(HwInfo->jChipType == SIS_550) {
+	         SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x1e,0xbf);
+	         SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x1e,0xef);
+	      }
+	   }
+	} else {
+	   if(HwInfo->jChipType == SIS_740) {
+	      if(SiS_IsLCDOrLCDA(SiS_Pr,HwInfo)) {
+	         SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x1e,0xdf);
+	      }
+	   } else if(SiS_IsVAMode(SiS_Pr,HwInfo)) {
+	      SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x1e,0xdf);
+	   }
+	}
 
-        if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) {
+	if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) {
+	   if(SiS_IsDualEdge(SiS_Pr,HwInfo)) {
+	      /* SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x13,0xff); */
+	   } else {
+	      SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x13,0xfb);
+	   }
+	}
 
-           SiS_GetCRT2DataLVDS(SiS_Pr,ROMAddr,ModeNo,ModeIdIndex,RefreshRateTableIndex,
-	                      HwDeviceExtension);
-        } else {
+	SiS_UnLockCRT2(SiS_Pr,HwInfo);
 
-	   if( (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) &&
-	       (SiS_Pr->SiS_VBType & VB_NoLCD) ) {
-	       
-	      /* TW: Need LVDS Data for LCD on 301BDH */
-	      SiS_GetCRT2DataLVDS(SiS_Pr,ROMAddr,ModeNo,ModeIdIndex,RefreshRateTableIndex,
-	                          HwDeviceExtension);
-				  
-	   } else {
-	
-	      SiS_GetCRT2Data301(SiS_Pr,ROMAddr,ModeNo,ModeIdIndex,RefreshRateTableIndex,
-	                         HwDeviceExtension);
-           }
+	if(HwInfo->jChipType == SIS_550) {
+	   SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x01,0x80); /* DirectDVD PAL?*/
+	   SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x02,0x40); /* VB clock / 4 ? */
+	} else if( (SiS_Pr->SiS_IF_DEF_CH70xx == 0)   ||
+	           (!(SiS_IsDualEdge(SiS_Pr,HwInfo))) ||
+		   (!(SiS_IsVAMode(SiS_Pr,HwInfo))) ) {
+	   SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2e,0xf7);
+	}
 
+        if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) {
+	   if(SiS_CRT2IsLCD(SiS_Pr, HwInfo)) {
+	      if(!(SiS_WeHaveBacklightCtrl(SiS_Pr,HwInfo))) {
+	 	 SiS_PanelDelay(SiS_Pr, HwInfo, 2);
+		 SiS_SetRegSR11ANDOR(SiS_Pr,HwInfo,0xFB,0x04);
+	      }
+	   }
         }
 
-     } else {
+#endif  /* SIS315H */
 
-     	SiS_GetCRT2Data301(SiS_Pr,ROMAddr,ModeNo,ModeIdIndex,RefreshRateTableIndex,
-	                   HwDeviceExtension);
-     }
+    }  /* 315 series */
+
+  }  /* LVDS */
 
-  } else {
-  
-     SiS_GetCRT2DataLVDS(SiS_Pr,ROMAddr,ModeNo,ModeIdIndex,RefreshRateTableIndex,
-                         HwDeviceExtension);
-  }
 }
 
-/* Checked with 650/LVDS 1.10.07 BIOS */
+/*********************************************/
+/*            ENABLE VIDEO BRIDGE            */
+/*********************************************/
+
+/* NEVER use any variables (VBInfo), this will be called
+ * from outside the context of a mode switch!
+ * MUST call getVBType before calling this
+ */
 void
-SiS_GetCRT2DataLVDS(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
-                    USHORT RefreshRateTableIndex,
-		    PSIS_HW_DEVICE_INFO HwDeviceExtension)
+SiS_EnableBridge(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
 {
-   USHORT CRT2Index, ResIndex;
-   const SiS_LVDSDataStruct *LVDSData = NULL;
-
-   SiS_GetCRT2ResInfo(SiS_Pr,ROMAddr,ModeNo,ModeIdIndex,HwDeviceExtension);
-   
-   if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
-      SiS_Pr->SiS_RVBHCMAX  = 1;
-      SiS_Pr->SiS_RVBHCFACT = 1;
-      SiS_Pr->SiS_NewFlickerMode = 0;
-      SiS_Pr->SiS_RVBHRS = 50;
-      SiS_Pr->SiS_RY1COE = 0;
-      SiS_Pr->SiS_RY2COE = 0;
-      SiS_Pr->SiS_RY3COE = 0;
-      SiS_Pr->SiS_RY4COE = 0;
-   }
+  USHORT temp=0,tempah;
+#ifdef SIS315H
+  USHORT temp1,pushax=0;
+  BOOLEAN delaylong = FALSE;
+#endif
 
-   if((SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) {
 
-#ifdef SIS315H   
-      SiS_GetCRT2PtrA(SiS_Pr,ROMAddr,ModeNo,ModeIdIndex,RefreshRateTableIndex,
-                      &CRT2Index,&ResIndex);
+  if(SiS_Pr->SiS_VBType & VB_SISVB) {
 
-      switch (CRT2Index) {
-      	case  0:  LVDSData = SiS_Pr->SiS_LVDS1024x768Data_1;    break;
-      	case  1:  LVDSData = SiS_Pr->SiS_LVDS1280x1024Data_1;   break;
-        case  2:  LVDSData = SiS_Pr->SiS_LVDS1280x960Data_1;    break;
-	case  3:  LVDSData = SiS_Pr->SiS_LCDA1400x1050Data_1;   break;
-	case  4:  LVDSData = SiS_Pr->SiS_LCDA1600x1200Data_1;   break;
-      	case  5:  LVDSData = SiS_Pr->SiS_LVDS1024x768Data_2;    break;
-      	case  6:  LVDSData = SiS_Pr->SiS_LVDS1280x1024Data_2;   break;
-      	case  7:  LVDSData = SiS_Pr->SiS_LVDS1280x960Data_2;    break;
-	case  8:  LVDSData = SiS_Pr->SiS_LCDA1400x1050Data_2;   break;
-	case  9:  LVDSData = SiS_Pr->SiS_LCDA1600x1200Data_2;   break;
-	default:  LVDSData = SiS_Pr->SiS_LVDS1024x768Data_1;    break;
-      }
-#endif      
+    if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {   /* ====== For 301B et al  ====== */
 
-   } else {
+      if(HwInfo->jChipType < SIS_315H) {
 
-      /* TW: 301BDH needs LVDS Data */
-      if( (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) &&
-          (SiS_Pr->SiS_VBType & VB_NoLCD) ) {
-	      SiS_Pr->SiS_IF_DEF_LVDS = 1;
-      }
+#ifdef SIS300     /* 300 series */
 
-      SiS_GetCRT2Ptr(SiS_Pr,ROMAddr,ModeNo,ModeIdIndex,RefreshRateTableIndex,
-                     &CRT2Index,&ResIndex,HwDeviceExtension);
-
-      /* TW: 301BDH needs LVDS Data */
-      if( (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) &&
-          (SiS_Pr->SiS_VBType & VB_NoLCD) ) {
-              SiS_Pr->SiS_IF_DEF_LVDS = 0;
-      }
+         if(HwInfo->jChipType == SIS_300) {
 
-      switch (CRT2Index) {
-      	case  0:  LVDSData = SiS_Pr->SiS_LVDS800x600Data_1;    break;
-      	case  1:  LVDSData = SiS_Pr->SiS_LVDS1024x768Data_1;   break;
-      	case  2:  LVDSData = SiS_Pr->SiS_LVDS1280x1024Data_1;  break;
-      	case  3:  LVDSData = SiS_Pr->SiS_LVDS800x600Data_2;    break;
-      	case  4:  LVDSData = SiS_Pr->SiS_LVDS1024x768Data_2;   break;
-      	case  5:  LVDSData = SiS_Pr->SiS_LVDS1280x1024Data_2;  break;
-	case  6:  LVDSData = SiS_Pr->SiS_LVDS640x480Data_1;    break;
-        case  7:  LVDSData = SiS_Pr->SiS_LVDSXXXxXXXData_1;    break;
-	case  8:  LVDSData = SiS_Pr->SiS_LVDS1400x1050Data_1;  break;
-	case  9:  LVDSData = SiS_Pr->SiS_LVDS1400x1050Data_2;  break;
-      	case 10:  LVDSData = SiS_Pr->SiS_CHTVUNTSCData;        break;
-      	case 11:  LVDSData = SiS_Pr->SiS_CHTVONTSCData;        break;
-      	case 12:  LVDSData = SiS_Pr->SiS_CHTVUPALData;         break;
-      	case 13:  LVDSData = SiS_Pr->SiS_CHTVOPALData;         break;
-      	case 14:  LVDSData = SiS_Pr->SiS_LVDS320x480Data_1;    break;
-	case 15:  LVDSData = SiS_Pr->SiS_LVDS1024x600Data_1;   break;
-	case 16:  LVDSData = SiS_Pr->SiS_LVDS1152x768Data_1;   break;
-	case 17:  LVDSData = SiS_Pr->SiS_LVDS1024x600Data_2;   break;
-	case 18:  LVDSData = SiS_Pr->SiS_LVDS1152x768Data_2;   break;
-	case 19:  LVDSData = SiS_Pr->SiS_LVDS1280x768Data_1;   break;
-	case 20:  LVDSData = SiS_Pr->SiS_LVDS1280x768Data_2;   break;
-	case 21:  LVDSData = SiS_Pr->SiS_LVDS1600x1200Data_1;  break;
-	case 22:  LVDSData = SiS_Pr->SiS_LVDS1600x1200Data_2;  break;
-	case 90:  LVDSData = SiS_Pr->SiS_CHTVUPALMData;        break;
-      	case 91:  LVDSData = SiS_Pr->SiS_CHTVOPALMData;        break;
-      	case 92:  LVDSData = SiS_Pr->SiS_CHTVUPALNData;        break;
-      	case 93:  LVDSData = SiS_Pr->SiS_CHTVOPALNData;        break;
-	case 99:  LVDSData = SiS_Pr->SiS_CHTVSOPALData;	       break;  /* TW: Super Overscan */
-	default:  LVDSData = SiS_Pr->SiS_LVDS1024x768Data_1;   break;
-     }
-   }
+	    if(SiS_CRT2IsLCD(SiS_Pr, HwInfo)) {
+	       if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {
+	          SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x26,0x02);
+	          if(!(SiS_CR36BIOSWord23d(SiS_Pr, HwInfo))) {
+	             SiS_PanelDelay(SiS_Pr, HwInfo, 0);
+	          }
+	       }
+	    }
+	    temp = SiS_GetReg(SiS_Pr->SiS_P3c4,0x32) & 0xDF;             /* lock mode */
+            if(SiS_BridgeInSlave(SiS_Pr)) {
+               tempah = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30);
+               if(!(tempah & SetCRT2ToRAMDAC))  temp |= 0x20;
+            }
+            SiS_SetReg(SiS_Pr->SiS_P3c4,0x32,temp);
+	    SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20);
+	    SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x00,0x1F,0x20);        /* enable VB processor */
+	    SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x1F,0xC0);
+	    SiS_DisplayOn(SiS_Pr);
+	    if(SiS_CRT2IsLCD(SiS_Pr, HwInfo)) {
+	       if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {
+	          if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x16) & 0x10)) {
+		     if(!(SiS_CR36BIOSWord23b(SiS_Pr,HwInfo))) {
+		        SiS_PanelDelay(SiS_Pr, HwInfo, 1);
+                     }
+		     SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x26,0x01);
+	 	  }
+	       }
+	    }
 
-   SiS_Pr->SiS_VGAHT = (LVDSData+ResIndex)->VGAHT;
-   SiS_Pr->SiS_VGAVT = (LVDSData+ResIndex)->VGAVT;
-   SiS_Pr->SiS_HT    = (LVDSData+ResIndex)->LCDHT;
-   SiS_Pr->SiS_VT    = (LVDSData+ResIndex)->LCDVT;
+	 } else {
 
-  if(SiS_Pr->SiS_IF_DEF_LVDS == 0) {
+	    if((SiS_Pr->SiS_VBType & VB_NoLCD) &&
+	       (SiS_CRT2IsLCD(SiS_Pr, HwInfo))) {
+	       /* This is only for LCD output on 301B-DH via LVDS */
+	       SiS_SetRegSR11ANDOR(SiS_Pr,HwInfo,0xFB,0x00);
+	       if(!(SiS_CR36BIOSWord23d(SiS_Pr,HwInfo))) {
+	          SiS_PanelDelay(SiS_Pr, HwInfo, 0);
+	       }
+	       SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20);   /* Enable CRT2 */
+               SiS_DisplayOn(SiS_Pr);
+	       SiS_UnLockCRT2(SiS_Pr,HwInfo);
+	       SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x02,0xBF);
+	       if(SiS_BridgeInSlave(SiS_Pr)) {
+      		  SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x01,0x1F);
+      	       } else {
+      		  SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x01,0x1F,0x40);
+               }
+	       if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x13) & 0x40)) {
+	           if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x16) & 0x10)) {
+		       if(!(SiS_CR36BIOSWord23b(SiS_Pr,HwInfo))) {
+		           SiS_PanelDelay(SiS_Pr, HwInfo, 1);
+                       }
+		       SiS_WaitVBRetrace(SiS_Pr,HwInfo);
+                       SiS_SetRegSR11ANDOR(SiS_Pr,HwInfo,0xF7,0x00);
+                   }
+	       }
+            } else {
+	       temp = SiS_GetReg(SiS_Pr->SiS_P3c4,0x32) & 0xDF;             /* lock mode */
+               if(SiS_BridgeInSlave(SiS_Pr)) {
+                  tempah = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30);
+                  if(!(tempah & SetCRT2ToRAMDAC))  temp |= 0x20;
+               }
+               SiS_SetReg(SiS_Pr->SiS_P3c4,0x32,temp);
+	       SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20);
+	       SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x00,0x1F,0x20);        /* enable VB processor */
+	       SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x1F,0xC0);
+	       SiS_DisplayOn(SiS_Pr);
+	    }
 
-    if(!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)){
-         if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768){
-           SiS_Pr->SiS_HDE = 1024;
-           SiS_Pr->SiS_VDE =  768;
-         } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024){
-           SiS_Pr->SiS_HDE = 1280;
-           SiS_Pr->SiS_VDE = 1024;
-	 } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050){
-           SiS_Pr->SiS_HDE = 1400;
-           SiS_Pr->SiS_VDE = 1050;
-	 } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200){
-           SiS_Pr->SiS_HDE = 1600;
-           SiS_Pr->SiS_VDE = 1200;
-         } else {
-	   SiS_Pr->SiS_HDE = 1280;
-	   SiS_Pr->SiS_VDE =  960;
-	 }
-    }
+         }
+#endif /* SIS300 */
 
-  } else {
+      } else {
 
-    if(SiS_Pr->SiS_IF_DEF_TRUMPION == 0) {
-      if((SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) && (!(SiS_Pr->SiS_LCDInfo & LCDPass11))) {
-        if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel640x480) {
-          if((!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) || (SiS_Pr->SiS_SetFlag & SetDOSMode)) {
-            if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel800x600) {
-              SiS_Pr->SiS_HDE =  800;
-              SiS_Pr->SiS_VDE =  600;
-	    } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x600) {
-	      SiS_Pr->SiS_HDE = 1024;
-              SiS_Pr->SiS_VDE =  600;  
-            } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) {
-              SiS_Pr->SiS_HDE = 1024;
-              SiS_Pr->SiS_VDE =  768;
- 	    } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1152x768) {
-	      SiS_Pr->SiS_HDE = 1152;
-	      SiS_Pr->SiS_VDE =  768;	
-	    } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1152x864) {
-	      SiS_Pr->SiS_HDE = 1152;
-	      SiS_Pr->SiS_VDE =  864;  
-	    } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x768) {
-	      SiS_Pr->SiS_HDE = 1280;
-	      SiS_Pr->SiS_VDE =  768;        
-            } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) {
-              SiS_Pr->SiS_HDE = 1280;
-              SiS_Pr->SiS_VDE = 1024;
-	    } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) {
-	      SiS_Pr->SiS_HDE = 1400;
-              SiS_Pr->SiS_VDE = 1050;
-	    } else {
-	      SiS_Pr->SiS_HDE = 1600;
-	      SiS_Pr->SiS_VDE = 1200;
-	    }
-            if(SiS_Pr->SiS_IF_DEF_FSTN) {
-              SiS_Pr->SiS_HDE = 320;
-              SiS_Pr->SiS_VDE = 480;
-            }
-          }
-        }
-      }
-    }
-  }
-}
+#ifdef SIS315H    /* 315 series */
 
-void
-SiS_GetCRT2Data301(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
-                   USHORT RefreshRateTableIndex,
-		   PSIS_HW_DEVICE_INFO HwDeviceExtension)
-{
-  USHORT tempax,tempbx,modeflag;
-  USHORT resinfo;
-  USHORT CRT2Index,ResIndex;
-  const SiS_LCDDataStruct *LCDPtr = NULL;
-  const SiS_TVDataStruct  *TVPtr  = NULL;
+	 if(IS_SIS550650740660) {		/* 550, 650, 740, 660 */
 
-  if(ModeNo <= 0x13) {
-    	modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
-    	resinfo = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ResInfo;
-  } else {
-    	modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
-    	resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO;
-  }
-  
-  SiS_Pr->SiS_NewFlickerMode = 0;
-  SiS_Pr->SiS_RVBHRS = 50;
-  SiS_Pr->SiS_RY1COE = 0;
-  SiS_Pr->SiS_RY2COE = 0;
-  SiS_Pr->SiS_RY3COE = 0;
-  SiS_Pr->SiS_RY4COE = 0;
+	    UCHAR r30=0, r31=0, r32=0, r33=0, cr36=0;
 
-  SiS_GetCRT2ResInfo(SiS_Pr,ROMAddr,ModeNo,ModeIdIndex,HwDeviceExtension);
+	    if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {
 
-  /* TW: For VGA2 ("RAMDAC2") */
+	       if((SiS_Pr->SiS_CustomT != CUT_COMPAQ1280) &&
+	          (SiS_Pr->SiS_CustomT != CUT_CLEVO1400)) {
+	          SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x1f,0xef);
+#ifdef SET_EMI
+		  if(SiS_Pr->SiS_VBType & (VB_SIS302LV | VB_SIS302ELV)) {
+	             SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x30,0x0c);
+		  }
+#endif
+	       }
 
-  if(SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC){
-     SiS_GetRAMDAC2DATA(SiS_Pr,ROMAddr,ModeNo,ModeIdIndex,RefreshRateTableIndex,
-                        HwDeviceExtension);
-     return;
-  }
+               if(!(SiS_IsNotM650orLater(SiS_Pr,HwInfo))) {
+	          tempah = 0x10;
+		  if(SiS_LCDAEnabled(SiS_Pr, HwInfo)) {
+		     if(SiS_TVEnabled(SiS_Pr, HwInfo)) tempah = 0x18;
+		     else 			       tempah = 0x08;
+		  }
+		  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x4c,tempah);
+	       }
 
-  /* TW: For TV */
+	       if((SiS_Pr->SiS_CustomT != CUT_COMPAQ1280) &&
+	          (SiS_Pr->SiS_CustomT != CUT_CLEVO1400)) {
+	          SiS_SetRegByte(SiS_Pr->SiS_P3c6,0x00);
+	          SiS_DisplayOff(SiS_Pr);
+	          pushax = SiS_GetReg(SiS_Pr->SiS_P3c4,0x06);
+	          if(IS_SIS740) {
+	             SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x06,0xE3);
+	          }
+	       }
 
-  if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
+	       if( (SiS_IsVAMode(SiS_Pr,HwInfo)) ||
+	           (SiS_CRT2IsLCD(SiS_Pr, HwInfo)) ) {
+                  if(!(SiS_GetReg(SiS_Pr->SiS_Part4Port,0x26) & 0x02)) {
+		     if((SiS_Pr->SiS_CustomT != CUT_COMPAQ1280) &&
+		        (SiS_Pr->SiS_CustomT != CUT_CLEVO1400)) {
+		        SiS_PanelDelayLoop(SiS_Pr, HwInfo, 3, 2);
+			SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x26,0x02);
+			if(SiS_Pr->SiS_VBType & (VB_SIS302LV | VB_SIS302ELV)) {
+			   SiS_GenericDelay(SiS_Pr, 0x4500);
+			}
+	                SiS_PanelDelayLoop(SiS_Pr, HwInfo, 3, 2);
+		     } else {
+		        SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x26,0x02);
+			SiS_PanelDelay(SiS_Pr, HwInfo, 0);
+		     }
+	          }
+	       }
 
-    SiS_GetCRT2Ptr(SiS_Pr,ROMAddr,ModeNo,ModeIdIndex,RefreshRateTableIndex,
-                   &CRT2Index,&ResIndex,HwDeviceExtension);
+               if((SiS_Pr->SiS_CustomT != CUT_COMPAQ1280) &&
+	          (SiS_Pr->SiS_CustomT != CUT_CLEVO1400)) {
+	          if(!(SiS_GetReg(SiS_Pr->SiS_P3d4,0x31) & 0x40)) {
+                     SiS_PanelDelayLoop(SiS_Pr, HwInfo, 3, 10);
+		     delaylong = TRUE;
+		  }
+	       }
 
-    switch (CRT2Index) {
-      case  2:  TVPtr = SiS_Pr->SiS_ExtHiTVData;   break;
-/*    case  7:  TVPtr = SiS_Pr->SiS_St1HiTVData;   break;  */
-      case 12:  TVPtr = SiS_Pr->SiS_St2HiTVData;   break;
-      case  3:  TVPtr = SiS_Pr->SiS_ExtPALData;    break;
-      case  4:  TVPtr = SiS_Pr->SiS_ExtNTSCData;   break;
-      case  8:  TVPtr = SiS_Pr->SiS_StPALData;     break;
-      case  9:  TVPtr = SiS_Pr->SiS_StNTSCData;    break;
-      default:  TVPtr = SiS_Pr->SiS_StPALData;     break;  /* TW: Just to avoid a crash */
-    }
+	    } else if(SiS_Pr->SiS_VBType & VB_NoLCD) {
 
-    SiS_Pr->SiS_RVBHCMAX  = (TVPtr+ResIndex)->RVBHCMAX;
-    SiS_Pr->SiS_RVBHCFACT = (TVPtr+ResIndex)->RVBHCFACT;
-    SiS_Pr->SiS_VGAHT     = (TVPtr+ResIndex)->VGAHT;
-    SiS_Pr->SiS_VGAVT     = (TVPtr+ResIndex)->VGAVT;
-    SiS_Pr->SiS_HDE       = (TVPtr+ResIndex)->TVHDE;
-    SiS_Pr->SiS_VDE       = (TVPtr+ResIndex)->TVVDE;
-    SiS_Pr->SiS_RVBHRS    = (TVPtr+ResIndex)->RVBHRS;
-    SiS_Pr->SiS_NewFlickerMode = (TVPtr+ResIndex)->FlickerMode;
-    if(modeflag & HalfDCLK) {
-	SiS_Pr->SiS_RVBHRS    = (TVPtr+ResIndex)->HALFRVBHRS;
-    }
+	       if(!(SiS_IsNotM650orLater(SiS_Pr,HwInfo))) {
+	          SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x4c,0x10);
+	       }
 
-    if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVisionTV) {  
-    
-       if(SiS_Pr->SiS_HiVision != 3) {
-       
-      	  if(resinfo == 0x08) SiS_Pr->SiS_NewFlickerMode = 0x40;
-      	  if(resinfo == 0x09) SiS_Pr->SiS_NewFlickerMode = 0x40;
-	  if(resinfo == 0x12) SiS_Pr->SiS_NewFlickerMode = 0x40;
-	  
-       } 
-       
-       switch(SiS_Pr->SiS_HiVision) {
-       case 2:
-       case 1:
-       case 0:
-          SiS_Pr->SiS_HT = 0x6b4;
-          SiS_Pr->SiS_VT = 0x20d;
-	  /* Don't care about TVSimuMode */
-          break;
-       default:
-          if(SiS_Pr->SiS_VGAVDE == 350) SiS_Pr->SiS_SetFlag |= TVSimuMode;
-
-          SiS_Pr->SiS_HT = ExtHiTVHT;
-          SiS_Pr->SiS_VT = ExtHiTVVT;
-          if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) {
-             if(SiS_Pr->SiS_SetFlag & TVSimuMode) {
-                SiS_Pr->SiS_HT = StHiTVHT;
-                SiS_Pr->SiS_VT = StHiTVVT;
-                if(!(modeflag & Charx8Dot)){
-                   SiS_Pr->SiS_HT = StHiTextTVHT;
-                   SiS_Pr->SiS_VT = StHiTextTVVT;
-                }
-             }
-          }
-       }
+  	    } else if(SiS_Pr->SiS_VBType & VB_SIS301B302B) {
 
-    } else {
+	       if(!(SiS_IsNotM650orLater(SiS_Pr,HwInfo))) {
+	          tempah = 0x10;
+		  if(SiS_LCDAEnabled(SiS_Pr, HwInfo)) {
+		     if(SiS_TVEnabled(SiS_Pr, HwInfo)) tempah = 0x18;
+		     else 			       tempah = 0x08;
+		  }
+		  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x4c,tempah);
+	       }
 
-      SiS_Pr->SiS_RY1COE = (TVPtr+ResIndex)->RY1COE;
-      SiS_Pr->SiS_RY2COE = (TVPtr+ResIndex)->RY2COE;
-      SiS_Pr->SiS_RY3COE = (TVPtr+ResIndex)->RY3COE;
-      SiS_Pr->SiS_RY4COE = (TVPtr+ResIndex)->RY4COE;
-
-      if(modeflag & HalfDCLK) {
-         SiS_Pr->SiS_RY1COE = 0x00;
-         SiS_Pr->SiS_RY2COE = 0xf4;
-         SiS_Pr->SiS_RY3COE = 0x10;
-         SiS_Pr->SiS_RY4COE = 0x38;
-      }
-
-      if(!(SiS_Pr->SiS_VBInfo & SetPALTV)) {
-        SiS_Pr->SiS_HT = NTSCHT;
-	if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {  
-	   if((ModeNo == 0x4a) || (ModeNo == 0x38)) SiS_Pr->SiS_HT = NTSC2HT;
-	}  
-        SiS_Pr->SiS_VT = NTSCVT;
-      } else {
-        SiS_Pr->SiS_HT = PALHT;
-        SiS_Pr->SiS_VT = PALVT;
-      }
+	    }
 
-    }
+	    if(!(SiS_IsVAMode(SiS_Pr,HwInfo))) {
+               temp = SiS_GetReg(SiS_Pr->SiS_P3c4,0x32) & 0xDF;
+	       if(SiS_BridgeInSlave(SiS_Pr)) {
+                  tempah = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30);
+                  if(!(tempah & SetCRT2ToRAMDAC)) {
+		     if(!(SiS_LCDAEnabled(SiS_Pr, HwInfo))) temp |= 0x20;
+		  }
+               }
+               SiS_SetReg(SiS_Pr->SiS_P3c4,0x32,temp);
 
-    return;
-  }
+	       SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20);                   /* enable CRT2 */
 
-  /* TW: For LCD */
+	       if((SiS_Pr->SiS_VBType & VB_SIS301B302B) ||
+	          (SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) ||
+		  (SiS_Pr->SiS_CustomT == CUT_CLEVO1400)) {
+	          SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2e,0x7f);
+		  temp = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x2e);
+		  if(!(temp & 0x80)) {
+		     SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2e,0x80);
+		  }
+	       } else {
+	          SiS_PanelDelay(SiS_Pr, HwInfo, 2);
+	       }
+	    } else {
+	       SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1e,0x20);
+	    }
 
-  if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
+	    SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x00,0x1f,0x20);
 
-    SiS_GetCRT2Ptr(SiS_Pr,ROMAddr,ModeNo,ModeIdIndex,RefreshRateTableIndex,
-                   &CRT2Index,&ResIndex,HwDeviceExtension);
+	    if((SiS_Pr->SiS_VBType & VB_SIS301B302B) ||
+	       (SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) ||
+	       (SiS_Pr->SiS_CustomT == CUT_CLEVO1400)) {
+	       temp = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x2e);
+	       if(!(temp & 0x80)) {
+		  SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2e,0x80);
+	       }
+	    }
 
-    switch (CRT2Index) {
-      case  0: LCDPtr = SiS_Pr->SiS_ExtLCD1024x768Data;        break; /* VESA Timing */
-      case  1: LCDPtr = SiS_Pr->SiS_ExtLCD1280x1024Data;       break; /* VESA Timing */
-      case  5: LCDPtr = SiS_Pr->SiS_StLCD1024x768Data;         break; /* Obviously unused */
-      case  6: LCDPtr = SiS_Pr->SiS_StLCD1280x1024Data;        break; /* Obviously unused */
-      case 10: LCDPtr = SiS_Pr->SiS_St2LCD1024x768Data;        break; /* Non-VESA Timing */
-      case 11: LCDPtr = SiS_Pr->SiS_St2LCD1280x1024Data;       break; /* Non-VESA Timing */
-      case 13: LCDPtr = SiS_Pr->SiS_NoScaleData1024x768;       break; /* Non-expanding */
-      case 14: LCDPtr = SiS_Pr->SiS_NoScaleData1280x1024;      break; /* Non-expanding */
-      case 15: LCDPtr = SiS_Pr->SiS_LCD1280x960Data;           break; /* 1280x960 */
-      case 20: LCDPtr = SiS_Pr->SiS_ExtLCD1400x1050Data;       break; /* VESA Timing */
-      case 21: LCDPtr = SiS_Pr->SiS_NoScaleData1400x1050;      break; /* Non-expanding (let panel scale) */
-      case 22: LCDPtr = SiS_Pr->SiS_StLCD1400x1050Data;	       break; /* Non-VESA Timing (let panel scale) */
-      case 23: LCDPtr = SiS_Pr->SiS_ExtLCD1600x1200Data;       break; /* VESA Timing */
-      case 24: LCDPtr = SiS_Pr->SiS_NoScaleData1600x1200;      break; /* Non-expanding */
-      case 25: LCDPtr = SiS_Pr->SiS_StLCD1600x1200Data;	       break; /* Non-VESA Timing */
-      default: LCDPtr = SiS_Pr->SiS_ExtLCD1024x768Data;	       break; /* Just to avoid a crash */
-    }
+	    tempah = 0xc0;
+	    if(SiS_IsDualEdge(SiS_Pr, HwInfo)) {
+	       tempah = 0x80;
+	       if(!(SiS_IsVAMode(SiS_Pr, HwInfo))) {
+	          tempah = 0x40;
+               }
+	    }
+            SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x1F,tempah);
 
-    SiS_Pr->SiS_RVBHCMAX  = (LCDPtr+ResIndex)->RVBHCMAX;
-    SiS_Pr->SiS_RVBHCFACT = (LCDPtr+ResIndex)->RVBHCFACT;
-    SiS_Pr->SiS_VGAHT     = (LCDPtr+ResIndex)->VGAHT;
-    SiS_Pr->SiS_VGAVT     = (LCDPtr+ResIndex)->VGAVT;
-    SiS_Pr->SiS_HT        = (LCDPtr+ResIndex)->LCDHT;
-    SiS_Pr->SiS_VT        = (LCDPtr+ResIndex)->LCDVT;
-    
-#ifdef TWDEBUG
-    xf86DrvMsg(0, X_INFO,
-    	"GetCRT2Data: Index %d ResIndex %d\n", CRT2Index, ResIndex);
-#endif    
-
-    tempax = 1024;
-    if(SiS_Pr->SiS_SetFlag & LCDVESATiming) {
-      if(HwDeviceExtension->jChipType < SIS_315H) {
-         if     (SiS_Pr->SiS_VGAVDE == 350) tempbx = 560;
-         else if(SiS_Pr->SiS_VGAVDE == 400) tempbx = 640;
-         else                               tempbx = 768;
-      } else {      
-         tempbx = 768; 
-      }
-    } else {
-      if     (SiS_Pr->SiS_VGAVDE == 357) tempbx = 527;
-      else if(SiS_Pr->SiS_VGAVDE == 420) tempbx = 620;
-      else if(SiS_Pr->SiS_VGAVDE == 525) tempbx = 775;
-      else if(SiS_Pr->SiS_VGAVDE == 600) tempbx = 775;
-      else if(SiS_Pr->SiS_VGAVDE == 350) tempbx = 560;
-      else if(SiS_Pr->SiS_VGAVDE == 400) tempbx = 640;
-      else                               tempbx = 768;
-    }
-    if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) {
-      tempax = 1280;
-      if     (SiS_Pr->SiS_VGAVDE == 360) tempbx = 768;
-      else if(SiS_Pr->SiS_VGAVDE == 375) tempbx = 800;
-      else if(SiS_Pr->SiS_VGAVDE == 405) tempbx = 864;
-      else                               tempbx = 1024;
-    }
-    if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x960) {
-      tempax = 1280;
-      if     (SiS_Pr->SiS_VGAVDE == 350)  tempbx = 700;
-      else if(SiS_Pr->SiS_VGAVDE == 400)  tempbx = 800;
-      else if(SiS_Pr->SiS_VGAVDE == 1024) tempbx = 960;
-      else                                tempbx = 960;
-    }
-    if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) {
-      tempax = 1400;
-      tempbx = 1050;
-    }
-    if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200) {
-      tempax = 1600;
-      tempbx = 1200;
-    }
-    if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) {
-       tempax = SiS_Pr->SiS_VGAHDE;
-       tempbx = SiS_Pr->SiS_VGAVDE;
-    }
-    SiS_Pr->SiS_HDE = tempax;
-    SiS_Pr->SiS_VDE = tempbx;
-    return;
-  }
-}
+	    if((SiS_Pr->SiS_VBType & VB_SIS301B302B) ||
+	       (((SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) ||
+	         (SiS_Pr->SiS_CustomT == CUT_CLEVO1400))     &&
+	        (!(SiS_WeHaveBacklightCtrl(SiS_Pr,HwInfo))))) {
+               SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x00,0x7f);
+	    }
 
-USHORT
-SiS_GetResInfo(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex)
-{
-  USHORT resindex;
+	    if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {
 
-  if(ModeNo <= 0x13)
-    	resindex=SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ResInfo;
-  else
-    	resindex=SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO;
+	       if((SiS_Pr->SiS_CustomT != CUT_COMPAQ1280) &&
+	          (SiS_Pr->SiS_CustomT != CUT_CLEVO1400)) {
+	          SiS_PanelDelay(SiS_Pr, HwInfo, 2);
+	       }
+#ifdef COMPAQ_HACK
+	       if(SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) {
+	          SiS_PanelDelay(SiS_Pr, HwInfo, 2);
+	       }
+#endif
 
-  return(resindex);
-}
+	       SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x1f,0x10);
 
-void
-SiS_GetCRT2ResInfo(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
-                   PSIS_HW_DEVICE_INFO HwDeviceExtension)
-{
-  USHORT xres,yres,modeflag=0,resindex;
+	       if(SiS_Pr->SiS_CustomT != CUT_CLEVO1400) {
+#ifdef SET_EMI
+	          if(SiS_Pr->SiS_VBType & (VB_SIS302LV | VB_SIS302ELV)) {
+	             SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x30,0x0c);
+		  }
+#endif
+	          SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x27,0x0c);
+#ifdef SET_EMI
+	          if(SiS_Pr->SiS_VBType & (VB_SIS302LV | VB_SIS302ELV)) {
+
+		     cr36 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36);
+
+		     /*                                              (P4_30|0x40)  */
+		     /* Compal 1400x1050: 0x05, 0x60, 0x00                YES  (1.10.7w;  CR36=69)      */
+		     /* Compal 1400x1050: 0x0d, 0x70, 0x40                YES  (1.10.7x;  CR36=69)      */
+		     /* Acer   1280x1024: 0x12, 0xd0, 0x6b                NO   (1.10.9k;  CR36=73)      */
+		     /* Compaq 1280x1024: 0x0d, 0x70, 0x6b                YES  (1.12.04b; CR36=03)      */
+		     /* Clevo   1024x768: 0x05, 0x60, 0x33                NO   (1.10.8e;  CR36=12, DL!) */
+		     /* Clevo   1024x768: 0x0d, 0x70, 0x40 (if type == 3) YES  (1.10.8y;  CR36=?2)      */
+		     /* Clevo   1024x768: 0x05, 0x60, 0x33 (if type != 3) YES  (1.10.8y;  CR36=?2)      */
+		     /* Asus    1024x768: ?                                ?   (1.10.8o;  CR36=?2)      */
+		     /* Asus    1024x768: 0x08, 0x10, 0x3c (problematic)  YES  (1.10.8q;  CR36=22)      */
+
+		     if(SiS_Pr->HaveEMI) {
+		        r30 = SiS_Pr->EMI_30;
+			r31 = SiS_Pr->EMI_31;
+			r32 = SiS_Pr->EMI_32;
+			r33 = SiS_Pr->EMI_33;
+		     } else {
+		        r30 = 0;
+		     }
 
-  resindex = SiS_GetResInfo(SiS_Pr,ROMAddr,ModeNo,ModeIdIndex);
+		     /* EMI_30 is read at driver start; however, the BIOS sets this
+		      * (if it is used) only if the LCD is in use. In case we caught
+		      * the machine while on TV output, this bit is not set and we
+		      * don't know if it should be set - hence our detection is wrong.
+		      * Work-around this here:
+		      */
+
+		     if((!SiS_Pr->HaveEMI) || (!SiS_Pr->HaveEMILCD)) {
+		        if((cr36 & 0x0f) == 0x02) {			/* 1024x768 */
+		           r30 |= 0x40;
+			   if(SiS_Pr->SiS_CustomT == CUT_CLEVO1024) {
+			      r30 &= ~0x40;
+			   }
+		        } else if((cr36 & 0x0f) == 0x03) {		/* 1280x1024 */
+		           r30 |= 0x40;
+			   if(SiS_Pr->SiS_CustomT != CUT_COMPAQ1280) {
+			      r30 &= ~0x40;
+			   }
+		        } else if((cr36 & 0x0f) == 0x09) {		/* 1400x1050 */
+		           r30 |= 0x40;
+		        } else if((cr36 & 0x0f) == 0x0b) {		/* 1600x1200 - unknown */
+		           r30 |= 0x40;
+		        }
+                     }
 
-  if(ModeNo <= 0x13) {
-    	xres = SiS_Pr->SiS_StResInfo[resindex].HTotal;
-    	yres = SiS_Pr->SiS_StResInfo[resindex].VTotal;
-  } else {
-	xres = SiS_Pr->SiS_ModeResInfo[resindex].HTotal;
-    	yres = SiS_Pr->SiS_ModeResInfo[resindex].VTotal;
-    	modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
-  }
+		     if(!SiS_Pr->HaveEMI) {
+		        if((cr36 & 0x0f) == 0x02) {
+			   if((cr36 & 0xf0) == 0x30) {
+			      r31 = 0x0d; r32 = 0x70; r33 = 0x40;
+			   } else {
+			      r31 = 0x05; r32 = 0x60; r33 = 0x33;
+			   }
+		        } else if((cr36 & 0x0f) == 0x03) {
+			   if(SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) {
+			      r31 = 0x0d; r32 = 0x70; r33 = 0x6b;
+			   } else {
+			      r31 = 0x12; r32 = 0xd0; r33 = 0x6b;
+			   }
+			} else if((cr36 & 0x0f) == 0x09) {
+			   if(SiS_Pr->SiS_CustomT == CUT_COMPAL1400_2) {
+			      r31 = 0x0d; r32 = 0x70; r33 = 0x40;  /* BIOS values */
+			   } else {
+			      r31 = 0x05; r32 = 0x60; r33 = 0x00;
+			   }
+			} else {
+			   r31 = 0x05; r32 = 0x60; r33 = 0x00;
+			}
+		     }
 
-  if((HwDeviceExtension->jChipType >= SIS_315H) && (SiS_Pr->SiS_IF_DEF_LVDS == 1)) {
-      if((ModeNo != 0x03) && (SiS_Pr->SiS_SetFlag & SetDOSMode)) {
-          if(yres == 350) yres = 400;
-      }
-      if(SiS_GetReg1(SiS_Pr->SiS_P3d4,0x3a) & 0x01) {
- 	  if(ModeNo == 0x12) yres = 400;
-      }
-  }
+		     /* BIOS values don't work so well sometimes */
+		     if(!SiS_Pr->OverruleEMI) {
+#ifdef COMPAL_HACK
+		        if(SiS_Pr->SiS_CustomT == CUT_COMPAL1400_2) {
+		           if((cr36 & 0x0f) == 0x09) {
+			      r30 = 0x60; r31 = 0x05; r32 = 0x60; r33 = 0x00;
+			   }
+ 		        }
+#endif
+#ifdef COMPAQ_HACK
+		        if(SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) {
+		           if((cr36 & 0x0f) == 0x03) {
+			      r30 = 0x20; r31 = 0x12; r32 = 0xd0; r33 = 0x6b;     /* rev 1 */
+			   }
+			}
+#endif
+#ifdef ASUS_HACK
+		        if(SiS_Pr->SiS_CustomT == CUT_ASUSA2H_2) {
+		           if((cr36 & 0x0f) == 0x02) {
+			      /* r30 = 0x60; r31 = 0x05; r32 = 0x60; r33 = 0x33;  */   /* rev 2 */
+			      /* r30 = 0x20; r31 = 0x05; r32 = 0x60; r33 = 0x33;  */   /* rev 3 */
+			      /* r30 = 0x60; r31 = 0x0d; r32 = 0x70; r33 = 0x40;  */   /* rev 4 */
+			      /* r30 = 0x20; r31 = 0x0d; r32 = 0x70; r33 = 0x40;  */   /* rev 5 */
+			   }
+			}
+#endif
+ 		     }
+		     if(!(SiS_Pr->OverruleEMI && (!r30) && (!r31) && (!r32) && (!r33))) {
+		        SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x30,0x20);
+		     }
+		     SiS_SetReg(SiS_Pr->SiS_Part4Port,0x31,r31);
+		     SiS_SetReg(SiS_Pr->SiS_Part4Port,0x32,r32);
+		     SiS_SetReg(SiS_Pr->SiS_Part4Port,0x33,r33);
+		     if(!(SiS_Pr->OverruleEMI && (!r30) && (!r31) && (!r32) && (!r33))) {
+		        SiS_SetReg(SiS_Pr->SiS_Part4Port,0x34,0x10);
+		     } else {
+		        SiS_SetReg(SiS_Pr->SiS_Part4Port,0x34,0x00);
+		     }
+		     if( (SiS_IsVAMode(SiS_Pr,HwInfo)) ||
+	                 (SiS_CRT2IsLCD(SiS_Pr, HwInfo)) ) {
+	                if(r30 & 0x40) {
+		           SiS_PanelDelayLoop(SiS_Pr, HwInfo, 3, 5);
+			   if(delaylong) {
+			      SiS_PanelDelayLoop(SiS_Pr, HwInfo, 3, 5);
+			      delaylong = FALSE;
+			   }
+			   SiS_WaitVBRetrace(SiS_Pr,HwInfo);
+			   if(SiS_Pr->SiS_CustomT == CUT_ASUSA2H_2) {
+			      SiS_GenericDelay(SiS_Pr, 0x500);
+			   }
+	                   SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x30,0x40);
+	                }
+		     }
+		  }
+#endif
+	       }
 
-  if(ModeNo > 0x13) {
-      if(SiS_Pr->SiS_IF_DEF_FSTN == 1){
-            xres *= 2;
-            yres *= 2;
-      } else {
-  	    if(modeflag & HalfDCLK)       xres *= 2;
-  	    if(modeflag & DoubleScanMode) yres *= 2;
-      }
-  }
+	       if(SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) {
 
-  if(SiS_Pr->SiS_IF_DEF_LVDS == 0) {
-        if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) {
-           if(xres == 720) xres = 640;
-	} else {
-	   if(SiS_Pr->SiS_VBType & VB_NoLCD) {           /* TW: 301BDH */
-	        if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
-                   if(xres == 720) xres = 640;
-		}
-		if(SiS_Pr->SiS_SetFlag & SetDOSMode) {
-	           yres = 400;
-	           if(HwDeviceExtension->jChipType >= SIS_315H) {
-	              if(SiS_GetReg1(SiS_Pr->SiS_P3c4,0x17) & 0x80) yres = 480;
-	           } else {
-	              if(SiS_GetReg1(SiS_Pr->SiS_P3c4,0x13) & 0x80) yres = 480;
-	           }
-	        }
-	   } else {
-	      if(SiS_Pr->SiS_VBInfo & (SetCRT2ToAVIDEO |           /* (Allow 720 for VGA2) */
-	      			       SetCRT2ToSVIDEO |
-	                               SetCRT2ToSCART  | 
-				       SetCRT2ToLCD    | 
-				       SetCRT2ToHiVisionTV)) {
-	         if(xres == 720) xres = 640;
-	      }
-	      if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
-    	         if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) {
-		    if(ModeNo <= 0x13) {
-		       /* TW: This is wrong for 640x400 *graphics* mode */
-      		       if(yres == 400) yres = 405;
-		    }
-      		    if(yres == 350) yres = 360;
-      		    if(SiS_Pr->SiS_SetFlag & LCDVESATiming) {
-        	       if(yres == 360) yres = 375;
-      		    }
-   	         }
-    	         if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768){
-      		    if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) {
-        	       if(!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) {
-          	          if(yres == 350) yres = 357;
-          	          if(yres == 400) yres = 420;
-            	          if(yres == 480) yres = 525;
-        	       }
-      		    }
-    	         }
-	      }
-	   }
-	}
-  } else {
-    	if(xres == 720) xres = 640;
-	if(SiS_Pr->SiS_SetFlag & SetDOSMode) {
-	      yres = 400;
-	      if(HwDeviceExtension->jChipType >= SIS_315H) {
-	          if(SiS_GetReg1(SiS_Pr->SiS_P3c4,0x17) & 0x80) yres = 480;
-	      } else {
-	          if(SiS_GetReg1(SiS_Pr->SiS_P3c4,0x13) & 0x80) yres = 480;
-	      }
-	}
-  }
-  SiS_Pr->SiS_VGAHDE = SiS_Pr->SiS_HDE = xres;
-  SiS_Pr->SiS_VGAVDE = SiS_Pr->SiS_VDE = yres;
-}
+	          if( (SiS_IsVAMode(SiS_Pr,HwInfo)) ||
+	              (SiS_CRT2IsLCD(SiS_Pr, HwInfo)) ) {
+		     SiS_DisplayOn(SiS_Pr);
+		     SiS_PanelDelay(SiS_Pr, HwInfo, 1);
+		     SiS_WaitVBRetrace(SiS_Pr, HwInfo);
+		     SiS_PanelDelay(SiS_Pr, HwInfo, 3);
+		     if(!(SiS_WeHaveBacklightCtrl(SiS_Pr,HwInfo))) {
+		        SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x26,0x01);
+	  	     }
+		  }
 
-void
-SiS_GetCRT2Ptr(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
-	       USHORT RefreshRateTableIndex,USHORT *CRT2Index,USHORT *ResIndex,
-	       PSIS_HW_DEVICE_INFO HwDeviceExtension)
-{
-  USHORT tempbx=0,tempal=0;
-  USHORT Flag,resinfo=0;
+	       } else if(SiS_Pr->SiS_CustomT == CUT_CLEVO1400) {
 
-  if(SiS_Pr->SiS_IF_DEF_LVDS == 0) {
+	          if(!(SiS_WeHaveBacklightCtrl(SiS_Pr,HwInfo))) {
+	             if( (SiS_IsVAMode(SiS_Pr, HwInfo)) ||
+	                 (SiS_CRT2IsLCD(SiS_Pr, HwInfo)) ) {
+		        SiS_DisplayOn(SiS_Pr);
+		        SiS_PanelDelay(SiS_Pr, HwInfo, 1);
+		        SiS_WaitVBRetrace(SiS_Pr,HwInfo);
+		        SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x26,0x01);
+		     }
+		  }
 
-    	if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {                            /* LCD */
+	       } else {
 
-	        if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x960) {
-			tempbx = 15;
-		} else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) {
-		        tempbx = 20;
-			if(SiS_Pr->SiS_LCDInfo & DontExpandLCD)         tempbx = 21;
-			else if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) tempbx = 22;
-		} else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200) {
-		        tempbx = 23;
-			if(SiS_Pr->SiS_LCDInfo & DontExpandLCD)         tempbx = 24;
-			else if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) tempbx = 25;
-		} else if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) {
-			tempbx = 13;
-			if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) tempbx++;
-		} else {
-      		   tempbx = SiS_Pr->SiS_LCDResInfo - SiS_Pr->SiS_Panel1024x768;
-      		   if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) {
-        		tempbx += 5;
-                        /* GetRevisionID();  */
-			/* TW: BIOS only adds 5 once */
-        		tempbx += 5;
-       		   }
-	        }
+	          SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2e,0x80);
+	          if(!(SiS_WeHaveBacklightCtrl(SiS_Pr,HwInfo))) {
+	             if( (SiS_IsVAMode(SiS_Pr,HwInfo)) ||
+	                 ((SiS_CRT2IsLCD(SiS_Pr, HwInfo))) ) {
+		        SiS_PanelDelayLoop(SiS_Pr, HwInfo, 3, 10);
+		        if(delaylong) {
+			   SiS_PanelDelayLoop(SiS_Pr, HwInfo, 3, 10);
+		        }
+                        SiS_WaitVBRetrace(SiS_Pr,HwInfo);
+			if(SiS_Pr->SiS_VBType & (VB_SIS302LV | VB_SIS302ELV)) {
+			   SiS_GenericDelay(SiS_Pr, 0x500);
+			}
+		        SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x26,0x01);
+	             }
+	          }
 
-     	} else {						  	/* TV */
-	
-       		if((SiS_Pr->SiS_VBType & VB_SIS301B302B) &&
-		   (SiS_Pr->SiS_VBInfo & SetCRT2ToHiVisionTV)) {
-         		if(SiS_Pr->SiS_VGAVDE > 480) SiS_Pr->SiS_SetFlag &= (~TVSimuMode);
-         		tempbx = 2;
-         		if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) {
-            			if(!(SiS_Pr->SiS_SetFlag & TVSimuMode)) tempbx = 12; 
-         		}
-       		} else {
-         		if(SiS_Pr->SiS_VBInfo & SetPALTV) tempbx = 3;
-         		else tempbx = 4;
-         		if(SiS_Pr->SiS_SetFlag & TVSimuMode) tempbx += 5;
-       		}
-		
-     	}
-
-     	if(ModeNo <= 0x13) {
-       		tempal = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC;
-     	} else {
-       		tempal = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC;
-		resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO;
-        }
-
-     	tempal &= 0x3F;
-
-      	if((SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) &&
-           (SiS_Pr->SiS_VBInfo & (SetCRT2ToTV-SetCRT2ToHiVisionTV))) {
-      		if(tempal == 0x06) tempal = 0x07;
-        }
-
-	/* TW: 300/301LV BIOS */
-	if((HwDeviceExtension->jChipType == SIS_300) &&
-	   (SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV)) {
-	    if(ModeNo > 0x13) {
-	        if((resinfo == 0x0c) || (resinfo == 0x0d))  /* 720 (index diff. on 310/325!) */
-		    tempal = 6;
-	    }
-	}
+	          SiS_SetReg(SiS_Pr->SiS_P3c4,0x06,pushax);
+	          SiS_DisplayOn(SiS_Pr);
+	          SiS_SetRegByte(SiS_Pr->SiS_P3c6,0xff);
 
-	if(HwDeviceExtension->jChipType != SIS_300) {
-           if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
-              if((ModeNo == 0x31) || (ModeNo == 0x32)) tempal = 6;
-	   }
-	}
+	          if(!(SiS_WeHaveBacklightCtrl(SiS_Pr,HwInfo))) {
+	             SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x00,0x7f);
+	          }
 
-     	*CRT2Index = tempbx;
-     	*ResIndex = tempal;
+	       }
 
-  } else {   /* LVDS, 301B-DH (if running on LCD) */
+	    }
 
-    	Flag = 1;
-    	tempbx = 0;
-    	if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) {
-	
-      		if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD)) {
-        		Flag = 0;
-        		tempbx = 10;
-			if(SiS_Pr->SiS_VBInfo & SetCHTVOverScan) tempbx += 1;
-        		if(SiS_Pr->SiS_VBInfo & SetPALTV) {
-				tempbx += 2;
-				if(SiS_Pr->SiS_CHSOverScan) tempbx = 99;
-				if(SiS_Pr->SiS_CHPALM) {
-					tempbx = 90;
-					if(SiS_Pr->SiS_VBInfo & SetCHTVOverScan) tempbx += 1;
-				} else if(SiS_Pr->SiS_CHPALN) {
-					tempbx = 92;
-					if(SiS_Pr->SiS_VBInfo & SetCHTVOverScan) tempbx += 1;
-				}
-				
-			}
-      		}
-		
-    	}
+	 } else {			/* 315, 330 */
 
-    	if(Flag) {
-      		
-		if(SiS_Pr->SiS_LCDResInfo <= SiS_Pr->SiS_Panel1280x1024) {
-		   tempbx = SiS_Pr->SiS_LCDResInfo - SiS_Pr->SiS_PanelMinLVDS;
-   	      	   if(SiS_Pr->SiS_LCDInfo & DontExpandLCD)  tempbx += 3;
-		} else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x768) {
-		   tempbx = 18;
-		   if(SiS_Pr->SiS_LCDInfo & DontExpandLCD)  tempbx++; 
-	        } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480) { 
-		   tempbx = 6;
-		} else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x600) {
-		   tempbx = 15;
-  		   if(SiS_Pr->SiS_LCDInfo & DontExpandLCD)  tempbx += 2;
-		} else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1152x768) {
-		   tempbx = 16;
-		   if(SiS_Pr->SiS_LCDInfo & DontExpandLCD)  tempbx += 2;
-		} else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) {
-		   tempbx = 8;
-		   if(SiS_Pr->SiS_LCDInfo & DontExpandLCD)  tempbx++;
-		} else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200) {
-		   tempbx = 21;
-		   if(SiS_Pr->SiS_LCDInfo & DontExpandLCD)  tempbx++;
-		}
-		
-		if(SiS_Pr->SiS_LCDInfo & LCDPass11) {
-		   tempbx = 7;
-        	}
-		
-	}
-
-    	if(ModeNo <= 0x13)
-      		tempal = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC;
-    	else {
-      		tempal = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC;
-		resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO;
-	}
-
-	if(SiS_Pr->SiS_IF_DEF_FSTN){
-       	 	if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel320x480){
-         		tempbx = 14;
-         		tempal = 6;
-        	}
-    	}
+	    if(!(SiS_IsVAMode(SiS_Pr,HwInfo))) {
+	       temp = SiS_GetReg(SiS_Pr->SiS_P3c4,0x32) & 0xDF;
+	       if(SiS_BridgeInSlave(SiS_Pr)) {
+                  tempah = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30);
+                  if(!(tempah & SetCRT2ToRAMDAC))  temp |= 0x20;
+               }
+               SiS_SetReg(SiS_Pr->SiS_P3c4,0x32,temp);
 
-	if(SiS_Pr->SiS_SetFlag & SetDOSMode) {
-	        if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel640x480) tempal = 7;
-		if(HwDeviceExtension->jChipType < SIS_315H) {
-		    if(SiS_GetReg1(SiS_Pr->SiS_P3c4,0x13) & 0x80) tempal++;
-		}
+	       SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20);                   /* enable CRT2 */
 
-	}
+	       temp = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x2E);
+               if(!(temp & 0x80))
+                  SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2E,0x80);
+            }
 
-	if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
-	    if(ModeNo > 0x13) {
-	        if(HwDeviceExtension->jChipType < SIS_315H) {
-	           if((resinfo == 0x0c) || (resinfo == 0x0d))  /* 720 */
-		       tempal = 6;
-	        } else {
-		   if((resinfo == 0x0d) || (resinfo == 0x0e))  /* 720 */
-		       tempal = 6;
-		}
-	    }
-	}
+	    SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x00,0x1f,0x20);
 
-    	*CRT2Index = tempbx;
-    	*ResIndex = tempal & 0x1F;
-  }
-}
+	    if(SiS_Is301B(SiS_Pr)) {
 
-#ifdef SIS315H
-void
-SiS_GetCRT2PtrA(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
-		USHORT RefreshRateTableIndex,USHORT *CRT2Index,
-		USHORT *ResIndex)
-{
-  USHORT tempbx,tempal;
+	       temp=SiS_GetReg(SiS_Pr->SiS_Part1Port,0x2E);
+               if(!(temp & 0x80))
+                  SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2E,0x80);
+
+	       tempah = 0xc0;
+	       if(SiS_IsDualEdge(SiS_Pr,HwInfo)) {
+	          tempah = 0x80;
+	          if(!(SiS_IsVAMode(SiS_Pr,HwInfo))) {
+	             tempah = 0x40;
+                  }
+	       }
+               SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x1F,tempah);
 
-  tempbx = SiS_Pr->SiS_LCDResInfo;
+	       SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x00,0x7f);
 
-  if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200)      tempbx = 4;
-  else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) tempbx = 3;
-  else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x960)  tempbx = 2;
-  else tempbx -= SiS_Pr->SiS_Panel1024x768;
+	    } else {
 
-  if(SiS_Pr->SiS_LCDInfo & DontExpandLCD)  tempbx += 5;
+	       SiS_VBLongWait(SiS_Pr);
+               SiS_DisplayOn(SiS_Pr);
+	       SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x00,0x7F);
+               SiS_VBLongWait(SiS_Pr);
 
-  if(ModeNo <= 0x13)
-      	tempal = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC;
-  else
-      	tempal = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC;
+	    }
 
-  *CRT2Index = tempbx;
-  *ResIndex = tempal & 0x1F;
-}
-#endif
+	 }   /* 315, 330 */
 
-void
-SiS_GetCRT2Part2Ptr(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
-		    USHORT RefreshRateTableIndex,USHORT *CRT2Index,
-		    USHORT *ResIndex)
-{
-  USHORT tempbx,tempal;
+#endif /* SIS315H */
 
-  if(ModeNo <= 0x13)
-      	tempal = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC;
-  else
-      	tempal = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC;
+      }
 
-  tempbx = SiS_Pr->SiS_LCDResInfo;
+    } else {	/* ============  For 301 ================ */
 
-  if(SiS_Pr->SiS_LCDInfo & DontExpandLCD)      tempbx += 16;
-  else if(SiS_Pr->SiS_SetFlag & LCDVESATiming) tempbx += 32;
+       if(HwInfo->jChipType < SIS_315H) {
+          if(SiS_CRT2IsLCD(SiS_Pr, HwInfo)) {
+             SiS_SetRegSR11ANDOR(SiS_Pr,HwInfo,0xFB,0x00);
+	     SiS_PanelDelay(SiS_Pr, HwInfo, 0);
+	  }
+       }
 
-  *CRT2Index = tempbx;
-  *ResIndex = tempal & 0x3F;
-}
+       temp = SiS_GetReg(SiS_Pr->SiS_P3c4,0x32) & 0xDF;          /* lock mode */
+       if(SiS_BridgeInSlave(SiS_Pr)) {
+          tempah = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30);
+          if(!(tempah & SetCRT2ToRAMDAC))  temp |= 0x20;
+       }
+       SiS_SetReg(SiS_Pr->SiS_P3c4,0x32,temp);
 
-USHORT
-SiS_GetRatePtrCRT2(SiS_Private *SiS_Pr, UCHAR *ROMAddr, USHORT ModeNo, USHORT ModeIdIndex,
-                   PSIS_HW_DEVICE_INFO HwDeviceExtension)
-{
-  SHORT  LCDRefreshIndex[] = { 0x00, 0x00, 0x03, 0x01,
-                               0x01, 0x01, 0x01, 0x01,
-			       0x01, 0x01, 0x01, 0x01,
-			       0x01, 0x01, 0x01, 0x01 };
-  USHORT RefreshRateTableIndex,i,backup_i;
-  USHORT modeflag,index,temp,backupindex;
+       SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20);                  /* enable CRT2 */
 
-  if(SiS_Pr->UseCustomMode) return 0;
-  
-  if(ModeNo <= 0x13)
-    	modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
-  else
-    	modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
+       if(HwInfo->jChipType >= SIS_315H) {
+          temp = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x2E);
+          if(!(temp & 0x80)) {
+             SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2E,0x80);         /* BVBDOENABLE=1 */
+	  }
+       }
 
-  if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) {
-    	if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
-      		if(modeflag & HalfDCLK) return(0);
-    	}
-  }
+       SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x00,0x1F,0x20);     /* enable VB processor */
 
-  if(ModeNo < 0x14) return(0xFFFF);
+       SiS_VBLongWait(SiS_Pr);
+       SiS_DisplayOn(SiS_Pr);
+       if(HwInfo->jChipType >= SIS_315H) {
+          SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x00,0x7f);
+       }
+       SiS_VBLongWait(SiS_Pr);
 
- /* TW: CR33 holds refresh rate index for CRT1 [3:0] and CRT2 [7:4].
-  *     On LVDS machines, CRT2 index is always 0 and will be
-  *     set to 0 by the following code; this causes the function
-  *     to take the first non-interlaced mode in SiS_Ext2Struct
-  */
-
-  index = SiS_GetReg1(SiS_Pr->SiS_P3d4,0x33);
-  index >>= SiS_Pr->SiS_SelectCRT2Rate;
-  index &= 0x0F;
-  backupindex = index;
+       if(HwInfo->jChipType < SIS_315H) {
+          if(SiS_CRT2IsLCD(SiS_Pr, HwInfo)) {
+	     SiS_PanelDelay(SiS_Pr, HwInfo, 1);
+             SiS_SetRegSR11ANDOR(SiS_Pr,HwInfo,0xF7,0x00);
+	  }
+       }
 
-  if(index > 0) index--;
+    }
 
-  if(SiS_Pr->SiS_SetFlag & ProgrammingCRT2) {
-      if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
-        if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA))  index = 0;
-      } else {
-        if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
-	    if(SiS_Pr->SiS_VBType & VB_NoLCD)
-	       	    index = 0;
-	    else if(SiS_Pr->SiS_LCDInfo & DontExpandLCD)
-	    	    index = backupindex = 0;
-	}
-      }
-  }
+  } else {   /* =================== For LVDS ================== */
 
-  if(SiS_Pr->SiS_SetFlag & ProgrammingCRT2) {
-    	if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) {
-      		if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
-        		index = 0;
-      		}
-    	}
-    	if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) {
-      		if(SiS_Pr->SiS_IF_DEF_LVDS == 0) {
-			if(!(SiS_Pr->SiS_VBType & VB_NoLCD)) {
-           		   temp = LCDRefreshIndex[SiS_Pr->SiS_LCDResInfo];
-        		   if(index > temp) index = temp;
-			}
-      		} else {
-        		index = 0;
-      		}
-    	}
-  }
+    if(HwInfo->jChipType < SIS_315H) {
 
-  RefreshRateTableIndex = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].REFindex;
-  ModeNo = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].ModeID;
+#ifdef SIS300    /* 300 series */
 
-  /* TW: 650/LVDS 1.10.07, 650/30xLV 1.10.6s */
-  if(HwDeviceExtension->jChipType >= SIS_315H) {
-     if(!(SiS_Pr->SiS_VBInfo & DriverMode)) {
-        if( (SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_VESAID == 0x105) ||
-            (SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_VESAID == 0x107) ) {
-           if(backupindex <= 1) RefreshRateTableIndex++;
-        }
-     }
-  }
+       if(SiS_CRT2IsLCD(SiS_Pr, HwInfo)) {
+          if(HwInfo->jChipType == SIS_730) {
+	     SiS_PanelDelay(SiS_Pr, HwInfo, 1);
+	     SiS_PanelDelay(SiS_Pr, HwInfo, 1);
+	     SiS_PanelDelay(SiS_Pr, HwInfo, 1);
+	  }
+          SiS_SetRegSR11ANDOR(SiS_Pr,HwInfo,0xFB,0x00);
+	  if(!(SiS_CR36BIOSWord23d(SiS_Pr,HwInfo))) {
+	     SiS_PanelDelay(SiS_Pr, HwInfo, 0);
+	  }
+       }
 
-  i = 0;
-  do {
-    	if(SiS_Pr->SiS_RefIndex[RefreshRateTableIndex + i].ModeID != ModeNo) break;
-    	temp = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex + i].Ext_InfoFlag;
-    	temp &= ModeInfoFlag;
-    	if(temp < SiS_Pr->SiS_ModeType) break;
-    	i++;
-    	index--;
-  } while(index != 0xFFFF);
+       SiS_EnableCRT2(SiS_Pr);
+       SiS_DisplayOn(SiS_Pr);
+       SiS_UnLockCRT2(SiS_Pr,HwInfo);
+       SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x02,0xBF);
+       if(SiS_BridgeInSlave(SiS_Pr)) {
+      	  SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x01,0x1F);
+       } else {
+      	  SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x01,0x1F,0x40);
+       }
 
-  if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC)) {
-    	if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) {
-      		temp = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex + i - 1].Ext_InfoFlag;
-      		if(temp & InterlaceMode) {
-        		i++;
-      		}
-    	}
-  }
+       if(SiS_Pr->SiS_IF_DEF_CH70xx == 1) {
+          if(!(SiS_CRT2IsLCD(SiS_Pr, HwInfo))) {
+	     SiS_WaitVBRetrace(SiS_Pr, HwInfo);
+	     SiS_SetCH700x(SiS_Pr,0x0B0E);
+          }
+       }
 
-  i--;
+       if(SiS_CRT2IsLCD(SiS_Pr, HwInfo)) {
+          if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x13) & 0x40)) {
+             if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x16) & 0x10)) {
+	        if(!(SiS_CR36BIOSWord23b(SiS_Pr,HwInfo))) {
+	 	   SiS_PanelDelay(SiS_Pr, HwInfo, 1);
+        	   SiS_PanelDelay(SiS_Pr, HwInfo, 1);
+	        }
+	        SiS_WaitVBRetrace(SiS_Pr, HwInfo);
+                SiS_SetRegSR11ANDOR(SiS_Pr,HwInfo,0xF7,0x00);
+             }
+	  }
+       }
 
-  if((SiS_Pr->SiS_SetFlag & ProgrammingCRT2) && (!(SiS_Pr->SiS_VBInfo & DisableCRT2Display))) {
-    	backup_i = i;
-    	if (!(SiS_AdjustCRT2Rate(SiS_Pr,ROMAddr,ModeNo,ModeIdIndex,
-	                             RefreshRateTableIndex,&i,HwDeviceExtension))) {
-		/* TW: This is for avoiding random data to be used; i is
-		 *     in an undefined state if no matching CRT2 mode is
-		 *     found.
-		 */
-		i = backup_i;
-	}
-  }
+#endif  /* SIS300 */
 
-  return(RefreshRateTableIndex + i);
-}
+    } else {
 
-/* Checked against all (incl 650/LVDS (1.10.07), 630/301) BIOSes */
-BOOLEAN
-SiS_AdjustCRT2Rate(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
-                   USHORT RefreshRateTableIndex,USHORT *i,PSIS_HW_DEVICE_INFO HwDeviceExtension)
-{
-  USHORT tempax,tempbx,resinfo;
-  USHORT modeflag,infoflag;
+#ifdef SIS315H    /* 315 series */
 
-  if (ModeNo <= 0x13)
-    	modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
-  else
-    	modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
+       if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) {
+	  if(SiS_CRT2IsLCD(SiS_Pr, HwInfo)) {
+	     SiS_SetRegSR11ANDOR(SiS_Pr,HwInfo,0xFB,0x00);
+	     SiS_PanelDelay(SiS_Pr, HwInfo, 0);
+          }
+       }
 
-  resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO;
-  tempbx = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex + (*i)].ModeID;
+       SiS_EnableCRT2(SiS_Pr);
+       SiS_UnLockCRT2(SiS_Pr,HwInfo);
 
-  tempax = 0;
-  if(SiS_Pr->SiS_IF_DEF_LVDS == 0) {
-    	if(SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC) {
-      		tempax |= SupportRAMDAC2;
-		if(HwDeviceExtension->jChipType >= SIS_315H) {
-		    tempax |= SupportTV;
-		    if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
-		        if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) {
-			    if(resinfo == 0x0a) tempax |= SupportTV1024;
-			}
-		    }
-		}
-    	}
-    	if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) {
-      		tempax |= SupportLCD;
-		if(HwDeviceExtension->jChipType >= SIS_315H) {
-                   if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel1600x1200) {
-		      if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel1400x1050) {
-		         if((resinfo == 6) && (SiS_Pr->SiS_LCDInfo & DontExpandLCD)) {
-			    (*i) = 0;
-                            return(1);
-		         } else {
-      		            if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel1280x1024) {
-        		      if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel1280x960) {
-           			if((resinfo == 6) && (SiS_Pr->SiS_LCDInfo & DontExpandLCD)) {
-				    return(0);
-				} else {
-             			    if((resinfo >= 9) && (resinfo != 0x14)) {
-               				return(0);
-             			    }
-           			}
-        		      }
-		            }
-		         }
-		      }
-      		   }
-		} else {
-		  if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x600) {
-		     if((resinfo != 0x0f) && ((resinfo == 4) || (resinfo >= 8))) return(0);
-		  } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1152x768) {
-		     if((resinfo != 0x10) && (resinfo > 8)) return(0);
-		  } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x960) {
-		     if((resinfo != 0x0e) && (resinfo > 8)) return(0);
-		  } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) {
-		     if(resinfo > 9) return(0);
-		  } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) {
-		     if(resinfo > 8) return(0);
-		  } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel800x600) {
-		     if((resinfo == 4) || (resinfo > 7)) return(0);
-		  } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480) {
-		     if((resinfo == 4) || (resinfo == 3) || (resinfo > 6)) return(0);
-		  }
-		}
-    	}
-    	if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVisionTV) { 
-	        if(SiS_Pr->SiS_HiVision == 3) {
-		      	tempax |= SupportHiVisionTV2;
-      			if(SiS_Pr->SiS_VBInfo & SetInSlaveMode){
-        			if(resinfo == 4) return(0);
-        			if(resinfo == 3) return(0);
-				if(resinfo == 7) {
-	          			if(SiS_Pr->SiS_SetFlag & TVSimuMode) return(0);
-        			}
-        			if(resinfo > 7) return(0);
-			}
-		} else {  
-      			tempax |= SupportHiVisionTV;
-      			if(SiS_Pr->SiS_VBInfo & SetInSlaveMode){
-        			if(resinfo == 4) return(0);
-        			if((resinfo == 3) || (resinfo == 7)) {
-	          			if(SiS_Pr->SiS_SetFlag & TVSimuMode) return(0);
-        			}
-        			if(resinfo > 7) return(0);
-			}
-		}
-    	} else {
-      	   if(SiS_Pr->SiS_VBInfo & (SetCRT2ToAVIDEO|SetCRT2ToSVIDEO|SetCRT2ToSCART)) {
-        	tempax |= SupportTV;
-		tempax |= SupportTV1024;
-		if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
-		    if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) {
-		        if((SiS_Pr->SiS_VBInfo & SetNotSimuMode) && (SiS_Pr->SiS_VBInfo & SetPALTV)) {
-			     if(resinfo != 8) {
-			         if( (!(SiS_Pr->SiS_VBInfo & SetPALTV)) ||
-				     ((SiS_Pr->SiS_VBInfo & SetPALTV) && (resinfo != 4)) ) {
-				     tempax &= ~(SupportTV1024);
-				     if(HwDeviceExtension->jChipType >= SIS_315H) {
-                                         if((modeflag & NoSupportSimuTV) && (SiS_Pr->SiS_VBInfo & SetInSlaveMode)) {
-				             if( (!(SiS_Pr->SiS_VBInfo & SetPALTV)) ||
-			                         ((SiS_Pr->SiS_VBInfo & SetPALTV) && (resinfo != 7)) ) {
-			                         if(!(SiS_Pr->SiS_VBInfo & SetNotSimuMode)) return(0);
-		                             }
-				         }
-		                     } else {
-				         if( (resinfo != 3) ||
-					     (!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) ||
-					     (SiS_Pr->SiS_VBInfo & SetNotSimuMode) ) {
-					     if(!(SiS_Pr->SiS_VBInfo & SetPALTV)) {
-						 if((modeflag & NoSupportSimuTV) && (SiS_Pr->SiS_VBInfo & SetInSlaveMode)) {
-						     if(resinfo == 3) return(0);
-						     if(!(SiS_Pr->SiS_VBInfo & SetNotSimuMode)) return (0);
-						 }
-		                             }
-                                         } else return(0);
-				     }
-				 }
-			     }
-			} else {
-			    tempax &= ~(SupportTV1024);
-			    if(HwDeviceExtension->jChipType >= SIS_315H) {
-			        if((modeflag & NoSupportSimuTV) && (SiS_Pr->SiS_VBInfo & SetInSlaveMode)) {
-			            if( (!(SiS_Pr->SiS_VBInfo & SetPALTV)) ||
-			                ((SiS_Pr->SiS_VBInfo & SetPALTV) && (resinfo != 7)) ) {
-			                if(!(SiS_Pr->SiS_VBInfo & SetNotSimuMode)) return(0);
-		                    }
-		                }
-			    } else {
-			        if( (resinfo != 3) ||
-				    (!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) ||
-				    (SiS_Pr->SiS_VBInfo & SetNotSimuMode) ) {
-				     if(!(SiS_Pr->SiS_VBInfo & SetPALTV)) {
-					 if((modeflag & NoSupportSimuTV) && (SiS_Pr->SiS_VBInfo & SetInSlaveMode)) {
-					     if(resinfo == 3) return(0);
-					     if(!(SiS_Pr->SiS_VBInfo & SetNotSimuMode)) return (0);
-					 }
-		                     }
-                                } else return(0);
-                            }
-			}
-		    } else {  /* slavemode */
-			if(resinfo != 8) {
-			    if( (!(SiS_Pr->SiS_VBInfo & SetPALTV)) ||
-			        ((SiS_Pr->SiS_VBInfo & SetPALTV) && (resinfo != 4) ) ) {
-				 tempax &= ~(SupportTV1024);
-				 if(HwDeviceExtension->jChipType >= SIS_315H) {
-				     if((modeflag & NoSupportSimuTV) && (SiS_Pr->SiS_VBInfo & SetInSlaveMode)) {
-				         if( (!(SiS_Pr->SiS_VBInfo & SetPALTV)) ||
-			                     ((SiS_Pr->SiS_VBInfo & SetPALTV) && (resinfo != 7)) ) {
-			                     if(!(SiS_Pr->SiS_VBInfo & SetNotSimuMode))  return(0);
-		                         }
-		                     }
-			        } else {
-				    if( (resinfo != 3) ||
-				        (!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) ||
-				        (SiS_Pr->SiS_VBInfo & SetNotSimuMode) ) {
-				         if(!(SiS_Pr->SiS_VBInfo & SetPALTV)) {
-					     if((modeflag & NoSupportSimuTV) && (SiS_Pr->SiS_VBInfo & SetInSlaveMode)) {
-					         if(resinfo == 3) return(0);
-					         if(!(SiS_Pr->SiS_VBInfo & SetNotSimuMode)) return (0);
-					     }
-		                         }
-                                    } else return(0);
-				}
-			    }
-			}
-		    }
-		} else {   /* 301 */
-		    tempax &= ~(SupportTV1024);
-		    if(HwDeviceExtension->jChipType >= SIS_315H) {
-		        if((modeflag & NoSupportSimuTV) && (SiS_Pr->SiS_VBInfo & SetInSlaveMode)) {
-		            if( (!(SiS_Pr->SiS_VBInfo & SetPALTV)) ||
-			        ((SiS_Pr->SiS_VBInfo & SetPALTV) && (resinfo != 7)) ) {
-			        if(!(SiS_Pr->SiS_VBInfo & SetNotSimuMode)) return(0);
-		            }
-		        }
-		    } else {
-		        if( (resinfo != 3) ||
-			    (!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) ||
-			    (SiS_Pr->SiS_VBInfo & SetNotSimuMode) ) {
-			    if(!(SiS_Pr->SiS_VBInfo & SetPALTV)) {
-			        if((modeflag & NoSupportSimuTV) && (SiS_Pr->SiS_VBInfo & SetInSlaveMode)) {
-				    if(resinfo == 3) return(0);
-				    if(!(SiS_Pr->SiS_VBInfo & SetNotSimuMode)) return (0);
-				}
-		            }
-                        } else return(0);
-		    }
-		}
-           }
-    	}
-	
-  } else {	/* TW: for LVDS  */
+       SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2e,0xf7);
 
-    	if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) {
-      		if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
-        		tempax |= SupportCHTV;
-      		}
-    	}
-    	if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
-      		tempax |= SupportLCD;
-		if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x768) {
-		     if((resinfo != 0x14) && (resinfo > 0x09)) return(0);
-		} else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x600) {
-		     if((resinfo != 0x0f) && (resinfo > 0x08)) return(0);
-		} else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1152x768) {
-		     if((resinfo != 0x10) && (resinfo > 0x08)) return(0);
-		} else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) {
-		     if((resinfo != 0x15) && (resinfo > 0x09)) return(0);
-		} else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) {
-                     if(resinfo > 0x09) return(0);
-                } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) {
-		     if(resinfo > 0x08) return(0);
-		} else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel800x600){
-		     if(resinfo > 0x07) return(0);
-		     if(resinfo == 0x04) return(0);
-		}
-    	}
-  }
-  /* TW: Look backwards in table for matching CRT2 mode */
-  for(; SiS_Pr->SiS_RefIndex[RefreshRateTableIndex+(*i)].ModeID == tempbx; (*i)--) {
-     	infoflag = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex + (*i)].Ext_InfoFlag;
-     	if(infoflag & tempax) {
-       		return(1);
-     	}
-     	if ((*i) == 0) break;
-  }
-  /* TW: Look through the whole mode-section of the table from the beginning
-   *     for a matching CRT2 mode if no mode was found yet.
-   */
-  for((*i) = 0; ; (*i)++) {
-     	infoflag = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex + (*i)].Ext_InfoFlag;
-     	if(SiS_Pr->SiS_RefIndex[RefreshRateTableIndex + (*i)].ModeID != tempbx) {
-       		return(0);
-     	}
-     	if(infoflag & tempax) {
-       		return(1);
-     	}
-  }
-  return(1);
-}
+       if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) {
+          temp = SiS_GetCH701x(SiS_Pr,0x66);
+	  temp &= 0x20;
+	  SiS_Chrontel701xBLOff(SiS_Pr);
+       }
 
-void
-SiS_SaveCRT2Info(SiS_Private *SiS_Pr, USHORT ModeNo)
-{
-  USHORT temp1,temp2;
+       if(HwInfo->jChipType != SIS_550) {
+          SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2e,0x7f);
+       }
 
-  /* TW: We store CRT1 ModeNo in CR34 */
-  SiS_SetReg1(SiS_Pr->SiS_P3d4,0x34,ModeNo);
-  temp1 = (SiS_Pr->SiS_VBInfo & SetInSlaveMode) >> 8;
-  temp2 = ~(SetInSlaveMode >> 8);
-  SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x31,temp2,temp1);
-}
+       if(HwInfo->jChipType == SIS_740) {
+          if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) {
+             if(SiS_IsLCDOrLCDA(SiS_Pr, HwInfo)) {
+	   	SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1E,0x20);
+	     }
+	  }
+       }
 
-void
-SiS_GetVBInfo(SiS_Private *SiS_Pr, USHORT BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,
-              USHORT ModeIdIndex,PSIS_HW_DEVICE_INFO HwDeviceExtension,
-	      int checkcrt2mode)
-{
-  USHORT tempax,tempbx,temp;
-  USHORT modeflag, resinfo=0;
-  UCHAR  OutputSelect = *SiS_Pr->pSiS_OutputSelect;
+       temp1 = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x2E);
+       if(!(temp1 & 0x80)) {
+          SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2E,0x80);
+       }
 
-  if(SiS_Pr->UseCustomMode) {
-        modeflag = SiS_Pr->CModeFlag;
-  } else {
-    if (ModeNo <= 0x13)
-    	modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
-    else {
-   	modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
-	resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO;
-    }
-  }    
+       if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) {
+          if(temp) {
+	     SiS_Chrontel701xBLOn(SiS_Pr, HwInfo);
+	  }
+       }
 
-  SiS_Pr->SiS_SetFlag = 0;
+       if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) {
+          if(SiS_CRT2IsLCD(SiS_Pr, HwInfo)) {
+	     SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1E,0x20);
+	     if(HwInfo->jChipType == SIS_550) {
+		SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1E,0x40);
+		SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1E,0x10);
+	     }
+	  }
+       } else if(SiS_IsVAMode(SiS_Pr,HwInfo)) {
+          if(HwInfo->jChipType != SIS_740) {
+             SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1E,0x20);
+	  }
+       }
 
-  SiS_Pr->SiS_ModeType = modeflag & ModeInfoFlag;
+       if(!(SiS_WeHaveBacklightCtrl(SiS_Pr,HwInfo))) {
+          SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x00,0x7f);
+       }
 
-  tempbx = 0;
-  if(SiS_BridgeIsOn(SiS_Pr,BaseAddr,HwDeviceExtension) == 0) {  
-    	temp = SiS_GetReg1(SiS_Pr->SiS_P3d4,0x30);
-#if 0	
-	/* SiS_HiVision is only used on 310/325/330+30xLV */
-	if(SiS_Pr->SiS_VBType & (VB_SIS301LV302LV)) {
-	   if(SiS_Pr->SiS_HiVision & 0x03) {	/* TW: New from 650/30xLV 1.10.6s */
-	      temp &= (SetCRT2ToHiVisionTV | SwitchToCRT2 | SetSimuScanMode); 	/* 0x83 */
-	      temp |= SetCRT2ToHiVisionTV;   					/* 0x80 */
-	   }
-	   if(SiS_Pr->SiS_HiVision & 0x04) {	/* TW: New from 650/30xLV 1.10.6s */
-	      temp &= (SetCRT2ToHiVisionTV | SwitchToCRT2 | SetSimuScanMode); 	/* 0x83 */
-	      temp |= SetCRT2ToSVIDEO;  					/* 0x08 */
-	   }
-	}
-#endif	
-    	if(SiS_Pr->SiS_IF_DEF_FSTN) {   /* fstn must set CR30=0x21 */
-       		temp = (SetCRT2ToLCD | SetSimuScanMode);
-       		SiS_SetReg1(SiS_Pr->SiS_P3d4,0x30,temp);
-    	}
-    	tempbx |= temp;
-    	tempax = SiS_GetReg1(SiS_Pr->SiS_P3d4,0x31) << 8;
-        tempax &= (LoadDACFlag | DriverMode | SetDispDevSwitch | SetNotSimuMode | SetPALTV);
-    	tempbx |= tempax;
-    	tempbx &= ~(SetCHTVOverScan | SetInSlaveMode | DisableCRT2Display);;
+       if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) {
+       	  if(SiS_IsTVOrYPbPrOrScart(SiS_Pr,HwInfo)) {
+             SiS_Chrontel701xOn(SiS_Pr,HwInfo);
+          }
+          if( (SiS_IsVAMode(SiS_Pr,HwInfo)) ||
+	      (SiS_IsLCDOrLCDA(SiS_Pr,HwInfo)) ) {
+             SiS_ChrontelDoSomething1(SiS_Pr,HwInfo);
+          }
+       }
 
-#ifdef SIS315H
+       if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) {
+       	  if(!(SiS_WeHaveBacklightCtrl(SiS_Pr,HwInfo))) {
+ 	     if( (SiS_IsVAMode(SiS_Pr,HwInfo)) ||
+	         (SiS_IsLCDOrLCDA(SiS_Pr,HwInfo)) ) {
+	     	SiS_Chrontel701xBLOn(SiS_Pr, HwInfo);
+	     	SiS_ChrontelInitTVVSync(SiS_Pr,HwInfo);
+             }
+       	  }
+       } else if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) {
+       	  if(!(SiS_WeHaveBacklightCtrl(SiS_Pr,HwInfo))) {
+	     if(SiS_CRT2IsLCD(SiS_Pr, HwInfo)) {
+		SiS_PanelDelay(SiS_Pr, HwInfo, 1);
+		SiS_SetRegSR11ANDOR(SiS_Pr,HwInfo,0xF7,0x00);
+	     }
+	  }
+       }
 
-	if(HwDeviceExtension->jChipType >= SIS_315H) {
-    	   if(SiS_Pr->SiS_VBType & (VB_SIS302B | VB_SIS301LV | VB_SIS302LV)) {
-	      /* From 1.10.7w, not in 1.10.8r */
-	      if(ModeNo == 0x03) {   
-	         /* Mode 0x03 is never in driver mode */
-		 SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x31,0xbf);
-	      }
-	      /* From 1.10.7w, not in 1.10.8r */
-	      if(!(SiS_GetReg1(SiS_Pr->SiS_P3d4,0x31) & (DriverMode >> 8))) {
-	         /* Reset LCDA setting */
-		 SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x38,0xfc);
-	      }
-	      if(IS_SIS650) {
-	         if(SiS_Pr->SiS_UseLCDA) {
-		    if(SiS_GetReg1(SiS_Pr->SiS_P3d4,0x5f) & 0xF0) {
-		       if((ModeNo <= 0x13) || (!(SiS_GetReg1(SiS_Pr->SiS_P3d4,0x31) & (DriverMode >> 8)))) {
-		          SiS_SetRegOR(SiS_Pr->SiS_P3d4,0x38,(EnableDualEdge | SetToLCDA));  /* 3 */
-		       }
-		    }
-		 }
-#if 0		 /* We can't detect it this way; there are machines which do not use LCDA despite
-                  * the chip revision
-		  */      	      
-		 if((tempbx & SetCRT2ToLCD) && (SiS_GetReg1(SiS_Pr->SiS_P3d4,0x30) & SetCRT2ToLCD)) {
-                    if((SiS_GetReg1(SiS_Pr->SiS_P3d4, 0x36) & 0x0f) == SiS_Pr->SiS_Panel1400x1050) {
-		       if((ModeNo <= 0x13) || (!(SiS_GetReg1(SiS_Pr->SiS_P3d4,0x31) & (DriverMode >> 8)))) {
-		          if(SiS_GetReg1(SiS_Pr->SiS_P3d4,0x5f) & 0xF0) {
-			     SiS_SetRegOR(SiS_Pr->SiS_P3d4,0x38,(EnableDualEdge | SetToLCDA));  /* 3 */
-			  }
-		       }
-		    } else {
-		       if((ModeNo <= 0x13) || (!(SiS_GetReg1(SiS_Pr->SiS_P3d4,0x31) & (DriverMode >> 8)))) {
-			  if(SiS_GetReg1(SiS_Pr->SiS_P3d4,0x5f) & 0xF0) {
-			     SiS_SetRegOR(SiS_Pr->SiS_P3d4,0x38,(EnableDualEdge | SetToLCDA));  /* 3 */
-		          }
-		       }
-		    }
-		 }
-#endif		 
-	      }
-	      temp = SiS_GetReg1(SiS_Pr->SiS_P3d4,0x38);
-       	      if((temp & (EnableDualEdge | SetToLCDA)) == (EnableDualEdge | SetToLCDA)) {
-          		tempbx |= SetCRT2ToLCDA;
-	      }
-    	   }
+#endif  /* SIS315H */
+
+    } /* 310 series */
+
+  }  /* LVDS */
+
+}
 
-	   if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
-	        temp = SiS_GetReg1(SiS_Pr->SiS_P3d4,0x38);
-	        if(temp & SetToLCDA)
-		   tempbx |= SetCRT2ToLCDA;
-		if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) {
-	           if(temp & EnableLVDSHiVision)
-		      tempbx |= SetCRT2ToHiVisionTV;
-		}
-	   }
-	}
+/*********************************************/
+/*         SET PART 1 REGISTER GROUP         */
+/*********************************************/
 
-#endif  /* SIS315H */
+/********** Set CRT2 OFFSET / PITCH **********/
+static void
+SiS_SetCRT2Offset(SiS_Private *SiS_Pr,USHORT ModeNo,
+                  USHORT ModeIdIndex ,USHORT RefreshRateTableIndex,
+	          PSIS_HW_INFO HwInfo)
+{
+  USHORT offset;
+  UCHAR temp;
 
-    	if(SiS_Pr->SiS_IF_DEF_LVDS == 0) {
-	        temp = SetCRT2ToLCDA   | SetCRT2ToSCART      | SetCRT2ToLCD    |
-		       SetCRT2ToRAMDAC | SetCRT2ToSVIDEO     | SetCRT2ToAVIDEO |  /* = 0x807C; */
-                       SetCRT2ToHiVisionTV; 					  /* = 0x80FC; */
-    	} else {
-                if(HwDeviceExtension->jChipType >= SIS_315H) {
-                    if(SiS_Pr->SiS_IF_DEF_CH70xx != 0)
-        		temp = SetCRT2ToLCDA   | SetCRT2ToSCART |
-			       SetCRT2ToLCD    | SetCRT2ToHiVisionTV |
-			       SetCRT2ToAVIDEO | SetCRT2ToSVIDEO;  /* = 0x80bc */
-      		    else
-        		temp = SetCRT2ToLCDA | SetCRT2ToLCD;
-		} else {
-      		    if(SiS_Pr->SiS_IF_DEF_CH70xx != 0)
-        		temp = SetCRT2ToTV | SetCRT2ToLCD;
-      		    else
-        		temp = SetCRT2ToLCD;
-		}
-    	}
+  if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) return;
 
-    	if(!(tempbx & temp)) {
-      		tempax = DisableCRT2Display;
-      		tempbx = 0;
-    	}
+  offset = SiS_GetOffset(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex,
+                         HwInfo);
 
-   	if(SiS_Pr->SiS_IF_DEF_LVDS == 0) {
-      		if(tempbx & SetCRT2ToLCDA) {
-        		tempbx &= (0xFF00|SwitchToCRT2|SetSimuScanMode);
-      		}
-		if(tempbx & SetCRT2ToRAMDAC) {
-        		tempbx &= (0xFF00|SetCRT2ToRAMDAC|SwitchToCRT2|SetSimuScanMode);
-      		}
-		if((tempbx & SetCRT2ToLCD) /* && (!(SiS_Pr->SiS_VBType & VB_NoLCD)) */ ) {
-		        /* We initialize the Panel Link of the type of bridge is DH */
-        		tempbx &= (0xFF00|SetCRT2ToLCD|SwitchToCRT2|SetSimuScanMode);
-      		}
-		if(tempbx & SetCRT2ToSCART) {
-        		tempbx &= (0xFF00|SetCRT2ToSCART|SwitchToCRT2|SetSimuScanMode);
-        		tempbx |= SetPALTV;
-      		}
-		if(tempbx & SetCRT2ToHiVisionTV) {
-        		tempbx &= (0xFF00|SetCRT2ToHiVisionTV|SwitchToCRT2|SetSimuScanMode);
-        		tempbx |= SetPALTV;
-      		}
-   	} else { /* LVDS */
-	        if(HwDeviceExtension->jChipType >= SIS_315H) {
-		    if(tempbx & SetCRT2ToLCDA)
-		        tempbx &= (0xFF00|SwitchToCRT2|SetSimuScanMode);
-		}
-      		if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) {
-        	    if(tempbx & SetCRT2ToTV)
-          		 tempbx &= (0xFF00|SetCRT2ToTV|SwitchToCRT2|SetSimuScanMode);
-      		}
-      		if(tempbx & SetCRT2ToLCD) {
-        		tempbx &= (0xFF00|SetCRT2ToLCD|SwitchToCRT2|SetSimuScanMode);
-		}
-	        if(HwDeviceExtension->jChipType >= SIS_315H) {
-		    if(tempbx & SetCRT2ToLCDA)
-		        tempbx |= SetCRT2ToLCD;
-		}
-	}
+  if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480_2 ||
+     SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480_3) offset >>= 1;
 
-    	if(tempax & DisableCRT2Display) {
-      		if(!(tempbx & (SwitchToCRT2 | SetSimuScanMode))) {
-        		tempbx = SetSimuScanMode | DisableCRT2Display;
-      		}
-    	}
+  temp = (UCHAR)(offset & 0xFF);
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x07,temp);
+  temp = (UCHAR)(offset >> 8);
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x09,temp);
+  temp = (UCHAR)(((offset >> 3) & 0xFF) + 1);
+  if(offset % 8) temp++;
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x03,temp);
+}
 
-    	if(!(tempbx & DriverMode)){
-      		tempbx |= SetSimuScanMode;
-    	}
+/************* Set CRT2 Sync *************/
+static void
+SiS_SetCRT2Sync(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT RefreshRateTableIndex,
+                PSIS_HW_INFO HwInfo)
+{
+  USHORT tempah=0,tempbl,infoflag;
 
-	/* TW: LVDS (LCD/TV) and 301BDH (LCD) can only be slave in 8bpp modes */
-	if(SiS_Pr->SiS_ModeType <= ModeVGA) {
-	   if( (SiS_Pr->SiS_IF_DEF_LVDS == 1) ||
-	       ((tempbx & SetCRT2ToLCD) && (SiS_Pr->SiS_VBType & VB_NoLCD)) ) {
-	       modeflag &= (~CRT2Mode);
-	   }
-	}
-	
-    	if(!(tempbx & SetSimuScanMode)){
-      	    if(tempbx & SwitchToCRT2) {
-        	if((!(modeflag & CRT2Mode)) && (checkcrt2mode)) {
-		     if( (HwDeviceExtension->jChipType >= SIS_315H) &&
-			 (SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) ) {
-			 if(resinfo != 0x0a)
-                              tempbx |= SetSimuScanMode;
-		     } else {
-            		      tempbx |= SetSimuScanMode;
-	             }
-        	}
-      	    } else {
-        	if(!(SiS_BridgeIsEnable(SiS_Pr,BaseAddr,HwDeviceExtension))) {
-          	     if(!(tempbx & DriverMode)) {
-            		  if(SiS_BridgeInSlave(SiS_Pr)) {
-			      tempbx |= SetSimuScanMode;
-            		  }
-                     }
-                }
-      	    }
-    	}
+  tempbl = 0xC0;
 
-    	if(!(tempbx & DisableCRT2Display)) {
-            if(tempbx & DriverMode) {
-                if(tempbx & SetSimuScanMode) {
-          	    if((!(modeflag & CRT2Mode)) && (checkcrt2mode)) {
-	                if( (HwDeviceExtension->jChipType >= SIS_315H) &&
-			    (SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) ) {
-			     if(resinfo != 0x0a) {  /* TW: 650/301 BIOS */
-			          tempbx |= SetInSlaveMode;
-            		          if(SiS_Pr->SiS_IF_DEF_LVDS == 0) {
-              		 	     if(tempbx & SetCRT2ToTV) {
-                		         if(!(tempbx & SetNotSimuMode))
-					     SiS_Pr->SiS_SetFlag |= TVSimuMode;
-              			     }
-                                  }
-			     }                      /* TW: 650/301 BIOS */
-		        } else {
-            		    tempbx |= SetInSlaveMode;
-            		    if(SiS_Pr->SiS_IF_DEF_LVDS == 0) {
-              		        if(tempbx & SetCRT2ToTV) {
-                		    if(!(tempbx & SetNotSimuMode))
-					SiS_Pr->SiS_SetFlag |= TVSimuMode;
-              			}
-            		    }
-                        }
-	            }
-                }
-            } else {
-                tempbx |= SetInSlaveMode;
-        	if(SiS_Pr->SiS_IF_DEF_LVDS == 0) {
-          	    if(tempbx & SetCRT2ToTV) {
-            		if(!(tempbx & SetNotSimuMode))
-			    SiS_Pr->SiS_SetFlag |= TVSimuMode;
-          	    }
-        	}
-      	    }
-    	}
-	
-	if(SiS_Pr->SiS_CHOverScan) {
-    	   if(SiS_Pr->SiS_IF_DEF_CH70xx == 1) {
-      		temp = SiS_GetReg1(SiS_Pr->SiS_P3d4,0x35);
-      		if((temp & TVOverScan) || (SiS_Pr->SiS_CHOverScan == 1) )
-		      tempbx |= SetCHTVOverScan;
-    	   }
-	   if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) {
-      		temp = SiS_GetReg1(SiS_Pr->SiS_P3d4,0x79);
-      		if( (temp & 0x80) || (SiS_Pr->SiS_CHOverScan == 1) )
-		      tempbx |= SetCHTVOverScan;
-    	   }
-	}
+  if(SiS_Pr->UseCustomMode) {
+     infoflag = SiS_Pr->CInfoFlag;
+  } else {
+     infoflag = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_InfoFlag;
   }
 
-  if(SiS_Pr->SiS_IF_DEF_LVDS == 0) {
-#ifdef SIS300
-     	if((HwDeviceExtension->jChipType==SIS_630) ||
-           (HwDeviceExtension->jChipType==SIS_730)) {
-	   	if(ROMAddr && SiS_Pr->SiS_UseROM) {
-			OutputSelect = ROMAddr[0xfe];
-                }
-           	if(!(OutputSelect & EnablePALMN))
-             		SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x35,0x3F);
-           	if(tempbx & SetCRT2ToTV) {
-              		if(tempbx & SetPALTV) {
-                  		temp = SiS_GetReg1(SiS_Pr->SiS_P3d4,0x35);
-                  		if(temp & EnablePALM) tempbx &= (~SetPALTV);
-             		}
-          	}
-      	}
-#endif
-#ifdef SIS315H
-     	if(HwDeviceExtension->jChipType >= SIS_315H) {
-	        if(ROMAddr && SiS_Pr->SiS_UseROM) {
-		    OutputSelect = ROMAddr[0xf3];
-		    if(HwDeviceExtension->jChipType == SIS_330) {
-			OutputSelect = ROMAddr[0x11b];
-		    }
-                }
-		if(!(OutputSelect & EnablePALMN))
-        		SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x38,0x3F);
-   		if(tempbx & SetCRT2ToTV) {
-    			if(tempbx & SetPALTV) {
-               			temp = SiS_GetReg1(SiS_Pr->SiS_P3d4,0x38);
-               			if(temp & EnablePALM) tempbx &= (~SetPALTV);
-              		}
-        	}
-  	}
-#endif
-  }
-  
-  /* PALM/PALN on Chrontel 7019 */
-  SiS_Pr->SiS_CHPALM = SiS_Pr->SiS_CHPALN = FALSE;
-  if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) {
-  	if(tempbx & SetCRT2ToTV) {
-    		if(tempbx & SetPALTV) {
-        		temp = SiS_GetReg1(SiS_Pr->SiS_P3d4,0x38);
-        		if(temp & EnablePALM)      SiS_Pr->SiS_CHPALM = TRUE;
-			else if(temp & EnablePALN) SiS_Pr->SiS_CHPALN = TRUE;
-        	}
-        }
-  }
+  if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {					/* LVDS */
 
-  SiS_Pr->SiS_VBInfo = tempbx;
+     if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
+        tempah = 0;
+     } else if((SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) && (SiS_Pr->SiS_LCDInfo & LCDSync)) {
+        tempah = SiS_Pr->SiS_LCDInfo;
+     } else tempah = infoflag >> 8;
 
-  if(HwDeviceExtension->jChipType == SIS_630) {
-       SiS_WhatIsThis(SiS_Pr, SiS_Pr->SiS_VBInfo);
-  }
+     tempah &= 0xC0;
 
-#ifdef TWDEBUG
-#ifdef LINUX_KERNEL
-  printk(KERN_DEBUG "sisfb: (VBInfo= 0x%04x, SetFlag=0x%04x)\n", 
-      SiS_Pr->SiS_VBInfo, SiS_Pr->SiS_SetFlag);
-#endif
-#ifdef LINUX_XF86
-  xf86DrvMsgVerb(0, X_PROBED, 3, "(init301: VBInfo=0x%04x, SetFlag=0x%04x)\n", 
-      SiS_Pr->SiS_VBInfo, SiS_Pr->SiS_SetFlag);
-#endif
-#endif
+     tempah |= 0x20;
+     if(!(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit)) tempah |= 0x10;
 
-#if 0  /* TW: Incomplete! (But does not seem to be required) */
-  if(HwDeviceExtension->jChipType < SIS_315H) {
-     /* TW: From A901/630+301B BIOS */
      if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
-         if(SiS_GetReg1(SiS_Pr->SiS_P3c4,0x13) & 0x80)
+        if((SiS_Pr->SiS_CustomT == CUT_BARCO1366) ||
+           (SiS_Pr->SiS_CustomT == CUT_BARCO1024)) {
+	   tempah |= 0xc0;
+        }
      }
-     if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD)) {
-         if(SiS_GetReg1(SiS_Pr->SiS_P3c4,0x13) & 0x80)
-	     if( [si] == 3) ModeIdIndex = 0x3f2b;
-	 }
+
+     if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
+        if(HwInfo->jChipType >= SIS_315H) {
+           tempah >>= 3;
+           SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,0xE7,tempah);
+        } else {
+           SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0x0F,0xe0);
+        }
+     } else {
+        SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0x0F,tempah);
      }
-     SiS_SetRegAND(SiS_Pr->SiS_P3d4, 0x31, 0xF7);
-     if(ModeNo == 0x13) bp+4 = 0x03;
-  } else {
-     /* From 650/30xLV BIOS: */
-     SiS_SetRegAND(SiS_Pr->SiS_P3d4, 0x31, 0xF7);
-     if(ModeNo == 0x13) bp+4 = 0x03;
-     else bp+4 = ModeNo;
-  }
-#endif
 
-  /* TW: 630/301B and 650/301 (not 301LV!) BIOSes do more here, but this seems for DOS mode */
+  } else if(SiS_Pr->SiS_VBType & VB_SISVB) {
 
-}
+     if(HwInfo->jChipType < SIS_315H) {
 
-void
-SiS_WhatIsThis(SiS_Private *SiS_Pr, USHORT myvbinfo)
-{
-   unsigned long eax, temp;
-   unsigned short temp1;
+#ifdef SIS300  /* ---- 300 series --- */
 
-   if(!(SiS_Pr->SiS_ChSW)) return;
+        if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {			/* 630 - 301B(-DH) */
 
-#ifndef LINUX_XF86
-   SiS_SetReg4(0xcf8,0x80000874);
-   eax = SiS_GetReg3(0xcfc);
-#else
-   eax = pciReadLong(0x00000800, 0x74);
-#endif
-   eax &= 0xFFFF;
-   temp = eax;
-   eax += 0x3c;
-   temp1 = SiS_GetReg4((USHORT)eax);
-   temp1 &= 0xFEFF;
-   SiS_SetReg5((USHORT)eax, temp1);
-   temp1 = SiS_GetReg4((USHORT)eax);
-   eax = temp;
-   eax += 0x3a;
-   temp1 = SiS_GetReg4((USHORT)eax);
-   temp1 &= 0xFEFF;
-   if(!(myvbinfo & SetCRT2ToTV)) {
-      temp1 |= 0x0100;
+	   tempah = infoflag >> 8;
+           if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
+	      if(SiS_Pr->SiS_LCDInfo & LCDSync) {
+	         tempah = SiS_Pr->SiS_LCDInfo;
+              }
+           }
+           tempah &= 0xC0;
+
+           tempah |= 0x20;
+           if(!(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit)) tempah |= 0x10;
+
+ 	   tempah &= 0x3f;
+  	   tempah |= tempbl;
+           SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0x0F,tempah);
+
+        } else {							/* 630 - 301 */
+
+           tempah = infoflag >> 8;
+           tempah &= 0xC0;
+           tempah |= 0x20;
+	   if(!(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit)) tempah |= 0x10;
+           SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0x0F,tempah);
+
+        }
+
+#endif /* SIS300 */
+
+     } else {
+
+#ifdef SIS315H  /* ------- 315 series ------ */
+
+        if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {	  		/* 315 - 30xLV */
+
+	   if(((SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) &&
+	       (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024)) ||
+	      ((SiS_Pr->SiS_CustomT == CUT_CLEVO1400)  &&
+	       (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050))) {
+	      tempah = infoflag >> 8;
+	   } else {
+              tempah = SiS_GetReg(SiS_Pr->SiS_P3d4,0x37);
+	   }
+	   tempah &= 0xC0;
+
+           tempah |= 0x20;
+           if(!(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit)) tempah |= 0x10;
+           SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0x0F,tempah);
+
+        } else {							/* 315 - 301, 301B */
+
+           tempah = infoflag >> 8;
+	   if(!SiS_Pr->UseCustomMode) {
+	      if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
+	         if(SiS_Pr->SiS_LCDInfo & LCDSync) {
+	            tempah = SiS_Pr->SiS_LCDInfo;
+	         }
+	      }
+	   }
+	   tempah &= 0xC0;
+
+           tempah |= 0x20;
+           if(!(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit)) tempah |= 0x10;
+
+	   if(SiS_Pr->SiS_VBType & VB_NoLCD) {			/* TEST, imitate BIOS bug */
+	      if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
+	         tempah |= 0xc0;
+	      }
+	   }
+           SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0x0F,tempah);
+
+        }
+#endif  /* SIS315H */
+      }
    }
-   SiS_SetReg5((USHORT)eax, temp1);
-   temp1 = SiS_GetReg4((USHORT)eax);
 }
 
-void
-SiS_GetRAMDAC2DATA(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
-                   USHORT RefreshRateTableIndex,PSIS_HW_DEVICE_INFO HwDeviceExtension)
+/******** Set CRT2 FIFO on 300/630/730 *******/
+#ifdef SIS300
+static void
+SiS_SetCRT2FIFO_300(SiS_Private *SiS_Pr,USHORT ModeNo,
+                    PSIS_HW_INFO HwInfo)
 {
-  USHORT tempax=0,tempbx=0;
-  USHORT temp1=0,modeflag=0,tempcx=0;
-  USHORT StandTableIndex,CRT1Index;
-#ifdef SIS315H   
-  USHORT ResInfo,DisplayType,temp=0;
-  const  SiS_LVDSCRT1DataStruct *LVDSCRT1Ptr = NULL;
-#endif
+  UCHAR  *ROMAddr  = HwInfo->pjVirtualRomBase;
+  USHORT temp,index;
+  USHORT modeidindex,refreshratetableindex;
+  USHORT VCLK=0,MCLK,colorth=0,data2=0;
+  USHORT tempal, tempah, tempbx, tempcl, tempax;
+  USHORT CRT1ModeNo,CRT2ModeNo;
+  USHORT SelectRate_backup;
+  ULONG  data,eax;
+  const UCHAR  LatencyFactor[] = {
+  	97, 88, 86, 79, 77, 00,       /*; 64  bit    BQ=2   */
+        00, 87, 85, 78, 76, 54,       /*; 64  bit    BQ=1   */
+        97, 88, 86, 79, 77, 00,       /*; 128 bit    BQ=2   */
+        00, 79, 77, 70, 68, 48,       /*; 128 bit    BQ=1   */
+        80, 72, 69, 63, 61, 00,       /*; 64  bit    BQ=2   */
+        00, 70, 68, 61, 59, 37,       /*; 64  bit    BQ=1   */
+        86, 77, 75, 68, 66, 00,       /*; 128 bit    BQ=2   */
+        00, 68, 66, 59, 57, 37        /*; 128 bit    BQ=1   */
+  };
+  const UCHAR  LatencyFactor730[] = {
+         69, 63, 61,
+	 86, 79, 77,
+	103, 96, 94,
+	120,113,111,
+	137,130,128,    /* <-- last entry, data below */
+	137,130,128,	/* to avoid using illegal values */
+	137,130,128,
+	137,130,128,
+	137,130,128,
+	137,130,128,
+	137,130,128,
+	137,130,128,
+	137,130,128,
+	137,130,128,
+	137,130,128,
+	137,130,128,
+  };
+  const UCHAR ThLowB[]   = {
+  	81, 4, 72, 6, 88, 8,120,12,
+        55, 4, 54, 6, 66, 8, 90,12,
+        42, 4, 45, 6, 55, 8, 75,12
+  };
+  const UCHAR ThTiming[] = {
+  	1, 2, 2, 3, 0, 1, 1, 2
+  };
 
-  SiS_Pr->SiS_RVBHCMAX  = 1;
-  SiS_Pr->SiS_RVBHCFACT = 1;
+  SelectRate_backup = SiS_Pr->SiS_SelectCRT2Rate;
 
-  if(ModeNo <= 0x13){
+  if(!SiS_Pr->CRT1UsesCustomMode) {
 
-    	modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
-    	StandTableIndex = SiS_GetModePtr(SiS_Pr,ROMAddr,ModeNo,ModeIdIndex);
-    	tempax = SiS_Pr->SiS_StandTable[StandTableIndex].CRTC[0];
-    	tempbx = SiS_Pr->SiS_StandTable[StandTableIndex].CRTC[6];
-	temp1 = SiS_Pr->SiS_StandTable[StandTableIndex].CRTC[7];
+     CRT1ModeNo = SiS_Pr->SiS_CRT1Mode;                                 	/* get CRT1 ModeNo */
+     SiS_SearchModeID(SiS_Pr, &CRT1ModeNo, &modeidindex);
+     SiS_Pr->SiS_SetFlag &= (~ProgrammingCRT2);
+     SiS_Pr->SiS_SelectCRT2Rate = 0;
+     refreshratetableindex = SiS_GetRatePtr(SiS_Pr, CRT1ModeNo, modeidindex, HwInfo);
+
+     if(CRT1ModeNo >= 0x13) {
+        index = SiS_Pr->SiS_RefIndex[refreshratetableindex].Ext_CRTVCLK;
+        index &= 0x3F;
+        VCLK = SiS_Pr->SiS_VCLKData[index].CLOCK;				/* Get VCLK */
+
+	colorth = SiS_GetColorDepth(SiS_Pr,CRT1ModeNo,modeidindex); 	/* Get colordepth */
+        colorth >>= 1;
+        if(!colorth) colorth++;
+     }
 
   } else {
 
-     if( (SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) ) {
-
-#ifdef SIS315H     
-    	temp = SiS_GetLVDSCRT1Ptr(SiS_Pr,ROMAddr,ModeNo,ModeIdIndex,
-			RefreshRateTableIndex,&ResInfo,&DisplayType);
-
-    	if(temp == 0)  return;
-
-    	switch(DisplayType) {
-    		case 0 : LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT1800x600_1;		break;
-    		case 1 : LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11024x768_1;          break;
-    		case 2 : LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11280x1024_1;         break;
-    		case 3 : LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT1800x600_1_H;         break;
-    		case 4 : LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11024x768_1_H;        break;
-    		case 5 : LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11280x1024_1_H;       break;
-    		case 6 : LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT1800x600_2;           break;
-    		case 7 : LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11024x768_2;          break;
-    		case 8 : LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11280x1024_2;         break;
-    		case 9 : LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT1800x600_2_H;         break;
-    		case 10: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11024x768_2_H;        break;
-    		case 11: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11280x1024_2_H;       break;
-		case 12: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT1XXXxXXX_1;           break;
-		case 13: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT1XXXxXXX_1_H;         break;
-		case 14: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11400x1050_1;         break;
-		case 15: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11400x1050_1_H;       break;
-		case 16: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11400x1050_2;         break;
-		case 17: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11400x1050_2_H;       break;
-    		case 18: LVDSCRT1Ptr = SiS_Pr->SiS_CHTVCRT1UNTSC;               break;
-    		case 19: LVDSCRT1Ptr = SiS_Pr->SiS_CHTVCRT1ONTSC;               break;
-    		case 20: LVDSCRT1Ptr = SiS_Pr->SiS_CHTVCRT1UPAL;                break;
-    		case 21: LVDSCRT1Ptr = SiS_Pr->SiS_CHTVCRT1OPAL;                break;
-    		case 22: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT1320x480_1;           break;
-		case 23: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11024x600_1;          break;
-    		case 24: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11024x600_1_H;        break;
-    		case 25: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11024x600_2;          break;
-    		case 26: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11024x600_2_H;        break;
-    		case 27: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11152x768_1;          break;
-    		case 28: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11152x768_1_H;        break;
-    		case 29: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11152x768_2;          break;
-    		case 30: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11152x768_2_H;        break;
-		case 36: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11600x1200_1;         break;
-		case 37: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11600x1200_1_H;       break;
-		case 38: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11600x1200_2;         break;
-		case 39: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11600x1200_2_H;       break;
-		case 99: LVDSCRT1Ptr = SiS_Pr->SiS_CHTVCRT1OPAL;                break;
-		default: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11024x768_1;          break;
-    	}
-	tempax = (LVDSCRT1Ptr+ResInfo)->CR[0];
-	tempax |= (LVDSCRT1Ptr+ResInfo)->CR[14] << 8;
-	tempax &= 0x03FF;
-    	tempbx = (LVDSCRT1Ptr+ResInfo)->CR[6];
-    	tempcx = (LVDSCRT1Ptr+ResInfo)->CR[13] << 8;
-    	tempcx &= 0x0100;
-    	tempcx <<= 2;
-    	tempbx |= tempcx;
-	temp1  = (LVDSCRT1Ptr+ResInfo)->CR[7];
-#endif	
+     CRT1ModeNo = 0xfe;
+     VCLK = SiS_Pr->CSRClock_CRT1;						/* Get VCLK */
+     data2 = (SiS_Pr->CModeFlag_CRT1 & ModeInfoFlag) - 2;
+     switch(data2) {								/* Get color depth */
+        case 0 : colorth = 1; break;
+        case 1 : colorth = 1; break;
+        case 2 : colorth = 2; break;
+        case 3 : colorth = 2; break;
+        case 4 : colorth = 3; break;
+        case 5 : colorth = 4; break;
+        default: colorth = 2;
+     }
+
+  }
 
+  if(CRT1ModeNo >= 0x13) {
+    if(HwInfo->jChipType == SIS_300) {
+       index = SiS_GetReg(SiS_Pr->SiS_P3c4,0x3A);
     } else {
+       index = SiS_GetReg(SiS_Pr->SiS_P3c4,0x1A);
+    }
+    index &= 0x07;
+    MCLK = SiS_Pr->SiS_MCLKData_0[index].CLOCK;				/* Get MCLK */
 
-    	modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
-    	CRT1Index = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT1CRTC;
-#if 0   /* Not any longer */	
-	if(HwDeviceExtension->jChipType < SIS_315H)  CRT1Index &= 0x3F;
-#endif	
-	tempax = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[0];
-	tempax |= SiS_Pr->SiS_CRT1Table[CRT1Index].CR[14] << 8;
-        tempax &= 0x03FF;
-    	tempbx = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[6];
-    	tempcx = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[13] << 8;
-    	tempcx &= 0x0100;
-    	tempcx <<= 2;
-    	tempbx |= tempcx;
-	temp1  = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[7];
+    data2 = (colorth * VCLK) / MCLK;
+
+    temp = SiS_GetReg(SiS_Pr->SiS_P3c4,0x14);
+    temp = ((temp & 0x00FF) >> 6) << 1;
+    if(temp == 0) temp = 1;
+    temp <<= 2;
+    temp &= 0xff;
+
+    data2 = temp - data2;
 
+    if((28 * 16) % data2) {
+      	data2 = (28 * 16) / data2;
+      	data2++;
+    } else {
+      	data2 = (28 * 16) / data2;
     }
 
-  }
+    if(HwInfo->jChipType == SIS_300) {
 
-  if(temp1 & 0x01) tempbx |= 0x0100;
-  if(temp1 & 0x20) tempbx |= 0x0200;
-  
-  tempax += 5;
+	tempah = SiS_GetReg(SiS_Pr->SiS_P3c4,0x18);
+	tempah &= 0x62;
+	tempah >>= 1;
+	tempal = tempah;
+	tempah >>= 3;
+	tempal |= tempah;
+	tempal &= 0x07;
+	tempcl = ThTiming[tempal];
+	tempbx = SiS_GetReg(SiS_Pr->SiS_P3c4,0x16);
+	tempbx >>= 6;
+	tempah = SiS_GetReg(SiS_Pr->SiS_P3c4,0x14);
+	tempah >>= 4;
+	tempah &= 0x0c;
+	tempbx |= tempah;
+	tempbx <<= 1;
+	tempal = ThLowB[tempbx + 1];
+	tempal *= tempcl;
+	tempal += ThLowB[tempbx];
+	data = tempal;
 
-  /* Charx8Dot is no more used (and assumed), so we set it */
-  if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
-      modeflag |= Charx8Dot;
-  }
+    } else if(HwInfo->jChipType == SIS_730) {
 
-  if(modeflag & Charx8Dot) tempax *= 8;
-  else                     tempax *= 9;
+#ifndef LINUX_XF86
+       SiS_SetRegLong(0xcf8,0x80000050);
+       eax = SiS_GetRegLong(0xcfc);
+#else
+       eax = pciReadLong(0x00000000, 0x50);
+#endif
+       tempal = (USHORT)(eax >> 8);
+       tempal &= 0x06;
+       tempal <<= 5;
 
-  /* TW: From 650/30xLV 1.10.6s */
-  if(modeflag & HalfDCLK)  tempax <<= 1;
+#ifndef LINUX_XF86
+       SiS_SetRegLong(0xcf8,0x800000A0);
+       eax = SiS_GetRegLong(0xcfc);
+#else
+       eax = pciReadLong(0x00000000, 0xA0);
+#endif
+       temp = (USHORT)(eax >> 28);
+       temp &= 0x0F;
+       tempal |= temp;
 
-  SiS_Pr->SiS_VGAHT = SiS_Pr->SiS_HT = tempax;
-  tempbx++;
-  SiS_Pr->SiS_VGAVT = SiS_Pr->SiS_VT = tempbx;
-}
+       tempbx = tempal;   /* BIOS BUG (2.04.5d, 2.04.6a use ah here, which is unset!) */
+       tempbx = 0;        /* -- do it like the BIOS anyway... */
+       tempax = tempbx;
+       tempbx &= 0xc0;
+       tempbx >>= 6;
+       tempax &= 0x0f;
+       tempax *= 3;
+       tempbx += tempax;
 
-void
-SiS_UnLockCRT2(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT BaseAddr)
-{
-  if(HwDeviceExtension->jChipType >= SIS_315H)
-    	SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2f,0x01);
-  else
-    	SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x24,0x01);
-}
+       data = LatencyFactor730[tempbx];
+       data += 15;
+       temp = SiS_GetReg(SiS_Pr->SiS_P3c4,0x14);
+       if(!(temp & 0x80)) data += 5;
 
-void
-SiS_LockCRT2(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT BaseAddr)
-{
-  if(HwDeviceExtension->jChipType >= SIS_315H)
-    	SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2F,0xFE);
-  else
-     	SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x24,0xFE);
-}
+    } else {
 
-void
-SiS_EnableCRT2(SiS_Private *SiS_Pr)
-{
-  SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20);
-}
+       index = 0;
+       temp = SiS_GetReg(SiS_Pr->SiS_P3c4,0x14);
+       if(temp & 0x0080) index += 12;
 
-/* Checked against all BIOSes */
-void
-SiS_DisableBridge(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT BaseAddr)
-{
-#ifdef SIS315H
-  USHORT tempah,pushax=0,modenum;
+#ifndef LINUX_XF86
+       SiS_SetRegLong(0xcf8,0x800000A0);
+       eax = SiS_GetRegLong(0xcfc);
+#else
+       /* We use pci functions X offers. We use tag 0, because
+        * we want to read/write to the host bridge (which is always
+        * 00:00.0 on 630, 730 and 540), not the VGA device.
+        */
+       eax = pciReadLong(0x00000000, 0xA0);
 #endif
-  USHORT temp=0;
-  UCHAR *ROMAddr = HwDeviceExtension->pjVirtualRomBase;
+       temp = (USHORT)(eax >> 24);
+       if(!(temp&0x01)) index += 24;
 
-  if (SiS_Pr->SiS_IF_DEF_LVDS == 0) {
+#ifndef LINUX_XF86
+       SiS_SetRegLong(0xcf8,0x80000050);
+       eax = SiS_GetRegLong(0xcfc);
+#else
+       eax = pciReadLong(0x00000000, 0x50);
+#endif
+       temp=(USHORT)(eax >> 24);
+       if(temp & 0x01) index += 6;
 
-      if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {   /* ===== TW: For 30xB/LV ===== */
+       temp = (temp & 0x0F) >> 1;
+       index += temp;
 
-        if(HwDeviceExtension->jChipType < SIS_315H) {
+       data = LatencyFactor[index];
+       data += 15;
+       temp = SiS_GetReg(SiS_Pr->SiS_P3c4,0x14);
+       if(!(temp & 0x80)) data += 5;
+    }
 
-#ifdef SIS300	   /* 300 series */
+    data += data2;				/* CRT1 Request Period */
 
-           if(HwDeviceExtension->jChipType == SIS_300) {  /* New for 300+301LV */
+    SiS_Pr->SiS_SetFlag |= ProgrammingCRT2;
+    SiS_Pr->SiS_SelectCRT2Rate = SelectRate_backup;
 
-	      if(!(SiS_CR36BIOSWord23b(SiS_Pr,HwDeviceExtension))) {
-	         if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {
-	            SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x26,0xFE,0x00);
-		    SiS_SetPanelDelay(SiS_Pr,ROMAddr, HwDeviceExtension, 3);
-		 }
-	      }
-	      if(SiS_Is301B(SiS_Pr,BaseAddr)) {
-	         SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x1f,0x3f);
-	         SiS_ShortDelay(SiS_Pr,1);
-	      }
-	      SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x00,0xDF);
-	      SiS_DisplayOff(SiS_Pr);
-	      SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF);
-	      SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF);
-	      if( (!(SiS_CRT2IsLCD(SiS_Pr,BaseAddr,HwDeviceExtension))) ||
-	          (!(SiS_CR36BIOSWord23d(SiS_Pr,HwDeviceExtension))) ) {
-	         SiS_SetPanelDelay(SiS_Pr,ROMAddr, HwDeviceExtension, 2);
-                 SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x11,0xFB,0x04);
-	      }
+    if(!SiS_Pr->UseCustomMode) {
 
-	   } else {
+       CRT2ModeNo = ModeNo;
+       SiS_SearchModeID(SiS_Pr, &CRT2ModeNo, &modeidindex);
 
-	      if(!(SiS_CR36BIOSWord23b(SiS_Pr,HwDeviceExtension))) {
-	         SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x11,0xF7,0x08);
-	         SiS_SetPanelDelay(SiS_Pr,ROMAddr, HwDeviceExtension, 3);
-	      }
-	      if(SiS_Is301B(SiS_Pr,BaseAddr)) {
-	         SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x1f,0x3f);
-	         SiS_ShortDelay(SiS_Pr,1);
-	      }
-	      SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x00,0xDF);
-	      SiS_DisplayOff(SiS_Pr);
-	      SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF);
-	      SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF);
-	      SiS_UnLockCRT2(SiS_Pr,HwDeviceExtension,BaseAddr);
-	      SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x01,0x80);
-	      SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x02,0x40);
-	      if( (!(SiS_CRT2IsLCD(SiS_Pr,BaseAddr,HwDeviceExtension))) ||
-	          (!(SiS_CR36BIOSWord23d(SiS_Pr,HwDeviceExtension))) ) {
-	         SiS_SetPanelDelay(SiS_Pr,ROMAddr, HwDeviceExtension, 2);
-                 SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x11,0xFB,0x04);
-	      }
-	   }
+       refreshratetableindex = SiS_GetRatePtr(SiS_Pr, CRT2ModeNo, modeidindex, HwInfo);
 
-#endif  /* SIS300 */
+       index = SiS_GetVCLK2Ptr(SiS_Pr,CRT2ModeNo,modeidindex,
+                               refreshratetableindex,HwInfo);
+       VCLK = SiS_Pr->SiS_VCLKData[index].CLOCK;                         	/* Get VCLK  */
 
-        } else {
+       if((SiS_Pr->SiS_CustomT == CUT_BARCO1366) || (SiS_Pr->SiS_CustomT == CUT_BARCO1024)) {
+          if((ROMAddr) && SiS_Pr->SiS_UseROM) {
+	     if(ROMAddr[0x220] & 0x01) {
+                VCLK = ROMAddr[0x229] | (ROMAddr[0x22a] << 8);
+	     }
+          }
+       }
 
-#ifdef SIS315H	   /* 310/325 series */
+    } else {
 
-           if(IS_SIS650740) {		/* 650, 740 */
+       CRT2ModeNo = 0xfe;
+       VCLK = SiS_Pr->CSRClock;							/* Get VCLK */
 
-#if 0
-	      if(SiS_GetReg1(SiS_Pr->SiS_Part4Port,0x00) != 1) return;	/* From 1.10.7w */
-#endif
+    }
 
-	      modenum = SiS_GetReg1(SiS_Pr->SiS_P3d4,0x34);
+    colorth = SiS_GetColorDepth(SiS_Pr,CRT2ModeNo,modeidindex);   	/* Get colordepth */
+    colorth >>= 1;
+    if(!colorth) colorth++;
 
-              if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {
-	      
-	         SiS_SetReg1(SiS_Pr->SiS_Part4Port,0x30,0x00);
-		 
-		 if( (modenum <= 0x13) ||
-		     (!(SiS_IsDualEdge(SiS_Pr,HwDeviceExtension, BaseAddr))) ||
-		     (SiS_IsVAMode(SiS_Pr,HwDeviceExtension, BaseAddr)) ) {
-	     	      SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x26,0xFE,0x00);
-	         }
-		 SiS_DDC2Delay(SiS_Pr,0xff00);
-		 SiS_DDC2Delay(SiS_Pr,0x6000);
-		 SiS_DDC2Delay(SiS_Pr,0x8000);
-
-	         SiS_SetReg3(SiS_Pr->SiS_P3c6,0x00);
-
-                 pushax = SiS_GetReg1(SiS_Pr->SiS_P3c4,0x06);
-		 
-		 if(IS_SIS740) {
-		    SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x06,0xE3);
-		 }
+    data = data * VCLK * colorth;
+    if(data % (MCLK << 4)) {
+      	data = data / (MCLK << 4);
+      	data++;
+    } else {
+      	data = data / (MCLK << 4);
+    }
 
-	         SiS_SetPanelDelay(SiS_Pr,ROMAddr, HwDeviceExtension, 3);
-		 
-		 if(!(SiS_IsNotM650or651(SiS_Pr,HwDeviceExtension, BaseAddr))) {
-	            tempah = 0xef;
-	            if(SiS_IsVAMode(SiS_Pr,HwDeviceExtension, BaseAddr)) {
-	               tempah = 0xf7;
-                    }
-	            SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x4c,tempah);
-	         }
+    if(data <= 6) data = 6;
+    if(data > 0x14) data = 0x14;
 
-              }
+    temp = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x01);
+    if(HwInfo->jChipType == SIS_300) {
+       if(data <= 0x0f) temp = (temp & (~0x1F)) | 0x13;
+       else             temp = (temp & (~0x1F)) | 0x16;
+       if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) {
+       		temp = (temp & (~0x1F)) | 0x13;
+       }
+    } else {
+       if( ( (HwInfo->jChipType == SIS_630) ||
+             (HwInfo->jChipType == SIS_730) )  &&
+           (HwInfo->jChipRevision >= 0x30) ) /* 630s or 730(s?) */
+      {
+	  temp = (temp & (~0x1F)) | 0x1b;
+      } else {
+	  temp = (temp & (~0x1F)) | 0x16;
+      }
+    }
+    SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x01,0xe0,temp);
 
-              if(SiS_Pr->SiS_VBType & VB_SIS301B302B) {
-	         tempah = 0x3f;
-	         if(SiS_IsDualEdge(SiS_Pr,HwDeviceExtension, BaseAddr)) {
-	            tempah = 0x7f;
-	            if(!(SiS_IsVAMode(SiS_Pr,HwDeviceExtension, BaseAddr))) {
-		       tempah = 0xbf;
-                    }
-	         }
-	         SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x1F,tempah);
-	      }
+    if( (HwInfo->jChipType == SIS_630) &&
+        (HwInfo->jChipRevision >= 0x30) ) /* 630s, NOT 730 */
+    {
+   	if(data > 0x13) data = 0x13;
+    }
+    SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x02,0xe0,data);
 
-              if((SiS_IsVAMode(SiS_Pr,HwDeviceExtension, BaseAddr)) ||
-	         ((SiS_Pr->SiS_VBType & VB_SIS301LV302LV) && (modenum <= 0x13))) {
+  } else {  /* If mode <= 0x13, we just restore everything */
 
-	         if(SiS_Pr->SiS_VBType & VB_SIS301B302B) {
-		    SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x1E,0xDF);
-		    SiS_DisplayOff(SiS_Pr);
-		    SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF);
-		 } else {
-	            SiS_DisplayOff(SiS_Pr);
-	            SiS_SetPanelDelay(SiS_Pr,ROMAddr, HwDeviceExtension, 2);
-	            SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF);
-	            SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x1E,0xDF);
-		    if((SiS_Pr->SiS_VBType & VB_SIS301LV302LV) && (modenum <= 0x13)) {
-		       SiS_DisplayOff(SiS_Pr);
-	               SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x80);
-	               SiS_SetPanelDelay(SiS_Pr,ROMAddr, HwDeviceExtension, 2);
-	               SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF);
-	               temp = SiS_GetReg1(SiS_Pr->SiS_Part1Port,0x00);
-                       SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x10);
-	               SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF);
-	               SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x00,temp);
-		    }
-		 }
+    SiS_Pr->SiS_SetFlag |= ProgrammingCRT2;
+    SiS_Pr->SiS_SelectCRT2Rate = SelectRate_backup;
 
-	      } else {
+  }
+}
+#endif
 
-	         if(SiS_Pr->SiS_VBType & VB_SIS301B302B) {
-		    if(!(SiS_IsDualEdge(SiS_Pr,HwDeviceExtension, BaseAddr))) {
-		       SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x00,0xdf);
-		       SiS_DisplayOff(SiS_Pr);
-		    }
-		    SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x80);
-		    SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF);
-		    temp = SiS_GetReg1(SiS_Pr->SiS_Part1Port,0x00);
-                    SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x10);
-	            SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF);
-	            SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x00,temp);
-		 } else {
-                    SiS_DisplayOff(SiS_Pr);
-	            SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x80);
-	            SiS_SetPanelDelay(SiS_Pr,ROMAddr, HwDeviceExtension, 2);
-	            SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF);
-	            temp = SiS_GetReg1(SiS_Pr->SiS_Part1Port,0x00);
-                    SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x10);
-	            SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF);
-	            SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x00,temp);
-		 }
+/**** Set CRT2 FIFO on 315/330 series ****/
+#ifdef SIS315H
+static void
+SiS_SetCRT2FIFO_310(SiS_Private *SiS_Pr)
+{
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x01,0x3B);
+  SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x02,~0x3F,0x04);
+}
+#endif
 
-	      }
+/*************** Set LCD-A ***************/
+#ifdef SIS315H
+static void
+SiS_SetGroup1_LCDA(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
+                   PSIS_HW_INFO HwInfo, USHORT RefreshRateTableIndex)
+{
+  USHORT modeflag,resinfo;
+  USHORT push2,tempax,tempbx,tempcx,temp;
+  ULONG tempeax=0,tempebx,tempecx,tempvcfact;
 
-	      if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {
+  /* This is not supported with LCDA */
+  if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_PanelCustom) return;
+  if(SiS_Pr->UseCustomMode) return;
 
-		 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x1f,~0x10);    /* 1.10.8r */
-		 
-	         tempah = 0x3f;
-	         if(SiS_IsDualEdge(SiS_Pr,HwDeviceExtension, BaseAddr)) {
-	            tempah = 0x7f;
-	            if(!(SiS_IsVAMode(SiS_Pr,HwDeviceExtension, BaseAddr))) {
-		       tempah = 0xbf;
-                    }
-	         }
-	         SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x1F,tempah);
+  if(IS_SIS330) {
+     SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2D,0x10);			/* Xabre 1.01.03 */
+  } else if(IS_SIS740) {
+     if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {					/* 740/LVDS */
+        SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,0xfb,0x04);      	/* 740/LVDS */
+	SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2D,0x03);
+     } else if(SiS_Pr->SiS_VBType & VB_SISVB) {
+        SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2D,0x10);			/* 740/301LV, 301BDH */
+     }
+  } else {
+     if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {					/* 650/LVDS */
+        SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,0xfb,0x04);      	/* 650/LVDS */
+	SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2D,0x00);			/* 650/LVDS 1.10.07 */
+     } else if(SiS_Pr->SiS_VBType & VB_SISVB) {
+        SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2D,0x0f);			/* 650/30xLv 1.10.6s */
+     }
+  }
 
-		 if(SiS_IsNotM650or651(SiS_Pr,HwDeviceExtension, BaseAddr)) {   /* 1.10.8r */
-	            SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2e,0x7f);
-		 }								/* 1.10.8r */
+  if(ModeNo <= 0x13) {
+     modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
+     resinfo = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ResInfo;
+  } else {
+     modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
+     resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO;
+  }
 
-	         if(!(SiS_IsVAMode(SiS_Pr,HwDeviceExtension, BaseAddr))) {
-	            SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x00,0xdf);
-	         }
+  tempax = SiS_Pr->SiS_LCDHDES;
 
-	         if(!(SiS_IsVAMode(SiS_Pr,HwDeviceExtension, BaseAddr))) {
-	            if(!(SiS_CRT2IsLCD(SiS_Pr,BaseAddr,HwDeviceExtension))) {
-	               if(!(SiS_IsDualEdge(SiS_Pr,HwDeviceExtension, BaseAddr))) {
-		          SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x26,0xFD,0x00);
-                       }
-                    }
-	         }
+  temp = (tempax & 0x0007);                        		/* BPLHDESKEW[2:0]   */
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1A,temp);                         /* Part1_1Ah  */
+  temp = (tempax >> 3) & 0x00FF;                               	/* BPLHDESKEW[10:3]  */
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x16,temp);                         /* Part1_16h  */
 
-	         SiS_SetReg1(SiS_Pr->SiS_P3c4,0x06,pushax);
+  tempbx = SiS_Pr->SiS_HDE;
+  if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) {
+     tempbx = SiS_Pr->PanelXRes;
+  }
 
-  	      }
+  tempax += tempbx;	                                    	/* HDE + HSKEW = lcdhdee  */
+  if(tempax >= SiS_Pr->SiS_HT) tempax -= SiS_Pr->SiS_HT;
 
-#if 0
-          } else if(IS_SIS740) {	/* 740 */
-	  
-	     if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {   /* 30xLV */
-	     
-	        if( (!(SiS_IsDualEdge(SiS_Pr,HwDeviceExtension, BaseAddr))) ||
-		    (SiS_IsVAMode(SiS_Pr,HwDeviceExtension, BaseAddr)) ) {
-	     	      SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x26,0xFE,0x00);
-	        }
-		
-		SiS_SetReg3(SiS_Pr->SiS_P3c6,0x00);
+  temp = tempax;
+  if(SiS_Pr->SiS_VBType & VB_SISVB) {
+     if(temp & 0x07) temp += 8;
+  }
+  temp >>= 3;                                        		/* BPLHDEE  */
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x17,temp);                        	/* Part1_17h  */
 
-                pushax = SiS_GetReg1(SiS_Pr->SiS_P3c4,0x06);
-		
-		SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x06,0xE3);
-
-	        SiS_SetPanelDelay(SiS_Pr,ROMAddr, HwDeviceExtension, 3);
-		
-		if(SiS_IsVAMode(SiS_Pr,HwDeviceExtension, BaseAddr)) {
-		   SiS_DisplayOff(SiS_Pr);
-	           SiS_SetPanelDelay(SiS_Pr,ROMAddr, HwDeviceExtension, 2);
-	           SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF);
-	           SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x1E,0xDF);
-		} else {
-		   SiS_DisplayOff(SiS_Pr);
-	           SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x80);
-	           SiS_SetPanelDelay(SiS_Pr,ROMAddr, HwDeviceExtension, 2);
-	           SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF);
-	           temp = SiS_GetReg1(SiS_Pr->SiS_Part1Port,0x00);
-                   SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x10);
-	           SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF);
-	           SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x00,temp);
-		}
-		
-		SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x1F,0x3F);
-		SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x1F,0xEF);  /* (from 650) */
-		
-		SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2e,0x7f);
-		
-		if(!(SiS_IsVAMode(SiS_Pr,HwDeviceExtension, BaseAddr))) {
-	           SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x00,0xdf);
-	        }
-		
-		if(!(SiS_WeHaveBacklightCtrl(SiS_Pr,HwDeviceExtension, BaseAddr))) {
-		   if(!(SiS_IsVAMode(SiS_Pr,HwDeviceExtension, BaseAddr))) {
-	              if(!(SiS_CRT2IsLCD(SiS_Pr,BaseAddr,HwDeviceExtension))) {
-	                 if(!(SiS_IsDualEdge(SiS_Pr,HwDeviceExtension, BaseAddr))) {
-		            SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x26,0xFD,0x00);
-                         }
-                      }
-	           }
-		}
-	        SiS_SetReg1(SiS_Pr->SiS_P3c4,0x06,pushax);
-	     
-	     } else {	/* (301,) 301B */
-	  
-	        if(SiS_Is301B(SiS_Pr,BaseAddr)) {
-	           SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x1F,0x3F);
-	        }
-	     
-	        SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x00,0xDF);
-	        SiS_DisplayOff(SiS_Pr);
-	        SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x80);
-	        SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF);
+  tempcx = (SiS_Pr->SiS_HT - tempbx) >> 2;     	            	/* (HT-HDE) / 4  */
 
-	        temp = SiS_GetReg1(SiS_Pr->SiS_Part1Port,0x00);
-                SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x10);
-	        SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF);
-	        SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x00,temp);
-		
-	     }
-#endif	  
-	  } else {			/* 315, 330 - all bridge types */
+  /* 650/30xLV 1.10.6s, 740/LVDS */
+  if( ((SiS_Pr->SiS_VBType & VB_SISVB) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) ||
+      ((SiS_Pr->SiS_IF_DEF_LVDS == 1) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD)) ) {
+     if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel640x480) {
+        if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel800x600)        tempcx = 0x28;
+ 	else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768)  tempcx = 0x18;
+	else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) tempcx = 0x30;
+	else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200) tempcx = 0x40;
+	else                                                          tempcx = 0x30;
+     }
+  }
 
-	     if(SiS_Is301B(SiS_Pr,BaseAddr)) {
-	        tempah = 0x3f;
-	        if(SiS_IsDualEdge(SiS_Pr,HwDeviceExtension, BaseAddr)) {
-	           tempah = 0x7f;
-	           if(!(SiS_IsVAMode(SiS_Pr,HwDeviceExtension, BaseAddr))) {
-		      tempah = 0xbf;
-                   }
-	        }
-	        SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x1F,tempah);
-	        if(SiS_IsVAMode(SiS_Pr,HwDeviceExtension, BaseAddr)) {
-	           SiS_DisplayOff(SiS_Pr);
-		   SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF);
-	        }
-	     }
-	     if( (!(SiS_Is301B(SiS_Pr,BaseAddr))) ||
-	         (!(SiS_IsVAMode(SiS_Pr,HwDeviceExtension, BaseAddr))) ) {
+  tempcx += tempax;  	                                  	/* lcdhrs  */
+  if(tempcx >= SiS_Pr->SiS_HT) tempcx -= SiS_Pr->SiS_HT;
 
- 	 	if( (!(SiS_Is301B(SiS_Pr,BaseAddr))) ||
-		    (!(SiS_IsDualEdge(SiS_Pr,HwDeviceExtension, BaseAddr))) ) {
+  temp = (tempcx >> 3) & 0x00FF;				/* BPLHRS */
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x14,temp);                 		/* Part1_14h  */
 
-	           SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x00,0xDF);
-	           SiS_DisplayOff(SiS_Pr);
+  temp += 10;
+  if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
+     if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
+        if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel640x480) {
+	   temp += 6;
+	   if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel800x600) {
+	      temp++;
+	      if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel1024x768) {
+	         temp += 7;
+		 if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel1600x1200) {
+		    temp -= 10;
+		 }
+	      }
+	   }
+	}
+     }
+  }
+  temp &= 0x1F;
+  temp |= ((tempcx & 0x07) << 5);
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x15,temp);                         /* Part1_15h  */
 
-		}
+  if(SiS_Pr->SiS_IF_DEF_TRUMPION == 0) {
+     tempax = SiS_Pr->PanelYRes;
+  } else {
+     tempax = SiS_Pr->SiS_VGAVDE;
+  }
 
-                SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x80);
+  tempbx = SiS_Pr->SiS_LCDVDES + tempax;
+  if(tempbx >= SiS_Pr->SiS_VT) tempbx -= SiS_Pr->SiS_VT;
+  push2 = tempbx;
 
-                SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF);
+  tempcx = (SiS_Pr->SiS_VGAVT - SiS_Pr->SiS_VGAVDE) >> 2;
 
-	        temp = SiS_GetReg1(SiS_Pr->SiS_Part1Port,0x00);
-                SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x10);
-	        SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF);
-	        SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x00,temp);
+  if( ((SiS_Pr->SiS_VBType & VB_SISVB) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) ||
+      ((SiS_Pr->SiS_IF_DEF_LVDS == 1) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD)) ) {
+     if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel640x480) {
+        if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel800x600)         tempcx = 1;
+   	else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768)   tempcx = 3;
+	else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x768)   tempcx = 3;
+	else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024)  tempcx = 1;
+	else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050)  tempcx = 1;
+	else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200)  tempcx = 1;
+	else                                                           tempcx = 0x0057;
+     }
+  }
 
-	     }
+  tempbx += tempcx;
+  if(SiS_Pr->SiS_VBType & VB_SISVB) {
+     tempbx++;                                                	/* BPLVRS  */
+  }
+  if(tempbx >= SiS_Pr->SiS_VT) tempbx -= SiS_Pr->SiS_VT;
+  temp = tempbx & 0x00FF;
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,temp);                             /* Part1_18h  */
 
-	  }    /* 315/330 */
+  tempcx >>= 3;
+  if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
+     if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
+        if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel640x480) {
+	   if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel800x600)         tempcx = 3;
+   	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768)   tempcx = 5;
+	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x768)   tempcx = 5;
+	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024)  tempcx = 5;
+	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050)  tempcx = 2;
+	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200)  tempcx = 2;
+	}
+     }
+  }
+  tempcx += tempbx;
+  tempcx++;                                                	/* BPLVRE  */
+  temp = tempcx & 0x000F;
+  if(SiS_Pr->SiS_VBType & VB_SISVB) {
+     temp |= 0xC0;
+     SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0xF0,temp); 		/* Part1_19h  */
+  } else {
+     SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0xF0,temp);
+  }
 
-#endif /* SIS315H */
+  temp = ((tempbx >> 8) & 0x07) << 3;
+  if(SiS_Pr->SiS_VGAVDE != SiS_Pr->SiS_VDE) temp |= 0x40;
+  if(SiS_Pr->SiS_SetFlag & EnableLVDSDDA)   temp |= 0x40;
+  if(SiS_Pr->SiS_VBType & VB_SISVB) {
+     /* Don't check Part1Port,0x00 -> is not being set if LCDA! */
+     /* We check SR06 instead here: */
+     if(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit) {
+        if(SiS_GetReg(SiS_Pr->SiS_P3c4,0x06) & 0x10) temp |= 0x80;
+     }
+  } else {
+     if(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit) {
+        if(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0x01) temp |= 0x80;
+     }
+  }
+  SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x1A,0x07,temp);            /* Part1_1Ah */
 
-	}
+  tempbx = push2;                                      		/* BPLVDEE */
 
-      } else {     /* ============ TW: For 301 ================ */
+  tempcx = SiS_Pr->SiS_LCDVDES;                        		/* NPLVDES */
+  if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) {
+     if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel800x600) {
+        if(resinfo == SIS_RI_800x600) tempcx++;
+     }
+  }
+  if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480) {
+     tempbx = tempcx = SiS_Pr->SiS_VGAVDE;
+     tempbx--;
+  }
 
-        if(HwDeviceExtension->jChipType < SIS_315H) {
-            if(SiS_CRT2IsLCD(SiS_Pr,BaseAddr,HwDeviceExtension)) {
-                SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x11,0xF0,0x0B);
-	        SiS_SetPanelDelay(SiS_Pr, ROMAddr, HwDeviceExtension, 1);
-	    }
-	}
+  temp = ((tempbx >> 8) & 0x07) << 3;
+  temp = temp | ((tempcx >> 8) & 0x07);
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1D,temp);                          /* Part1_1Dh */
+  temp = tempbx & 0x00FF;
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1C,temp);                          /* Part1_1Ch  */
+  temp = tempcx & 0x00FF;
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1B,temp);                          /* Part1_1Bh  */
 
-        SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x00,0xDF);           /* disable VB */
-        SiS_DisplayOff(SiS_Pr);
+  tempeax = SiS_Pr->SiS_VGAVDE << 18;
+  tempebx = SiS_Pr->SiS_VDE;
+  temp = (USHORT)(tempeax % tempebx);
+  tempeax = tempeax / tempebx;
+  if(temp) tempeax++;
+  tempvcfact = tempeax;
 
-        if(HwDeviceExtension->jChipType >= SIS_315H) {
-            SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x80);
-	}
+  temp = (USHORT)(tempeax & 0x00FF);
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x37,temp);
 
-        SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF);                /* disable lock mode */
+  temp = (USHORT)((tempeax & 0x00FF00) >> 8);
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x36,temp);
 
-	if(HwDeviceExtension->jChipType >= SIS_315H) {
-            temp = SiS_GetReg1(SiS_Pr->SiS_Part1Port,0x00);
-            SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x10);
-	    SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20);
-	    SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x00,temp);
-	} else {
-            SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF);            /* disable CRT2 */
-	}
+  temp = (USHORT)((tempeax & 0x00030000) >> 16);
+  if(SiS_Pr->SiS_VDE == SiS_Pr->SiS_VGAVDE) temp |= 0x04;
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x35,temp);
 
-      }
+  if(SiS_Pr->SiS_VBType & (VB_SIS301C | VB_SIS302ELV)) {
+     temp = (USHORT)(tempeax & 0x00FF);
+     SiS_SetReg(SiS_Pr->SiS_Part4Port,0x3c,temp);
+     temp = (USHORT)((tempeax & 0x00FF00) >> 8);
+     SiS_SetReg(SiS_Pr->SiS_Part4Port,0x3b,temp);
+     temp = (USHORT)(((tempeax & 0x00030000) >> 16) << 6);
+     SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x3a,0x3f,temp);
+     temp = 0;
+     if(SiS_Pr->SiS_VDE != SiS_Pr->SiS_VGAVDE) temp |= 0x08;
+     SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x30,0xf3,temp);
+  }
 
-  } else {     /* ============ TW: For LVDS =============*/
+  tempeax = SiS_Pr->SiS_VGAHDE << 16;
+  tempebx = SiS_Pr->SiS_HDE;
+  temp = tempeax % tempebx;
+  tempeax /= tempebx;
+  if(temp) tempeax++;
+  if(tempebx == SiS_Pr->SiS_VGAHDE) tempeax = 0xFFFF;
+  tempecx = tempeax;
+  tempeax = ((SiS_Pr->SiS_VGAHDE << 16) / tempecx) - 1;
+  tempecx = (tempecx << 16) | (tempeax & 0xFFFF);
+  temp = (USHORT)(tempecx & 0x00FF);
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1F,temp);                          /* Part1_1Fh  */
 
-    if(HwDeviceExtension->jChipType < SIS_315H) {
+  tempeax = (SiS_Pr->SiS_VGAVDE << 18) / tempvcfact;
+  tempbx = (USHORT)(tempeax & 0x0FFFF);
 
-#ifdef SIS300	/* 300 series */
+  if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) tempbx--;
 
-	if(SiS_Pr->SiS_IF_DEF_CH70xx == 1) {
-	    SiS_SetCH700x(SiS_Pr,0x090E);
-	}
+  if(SiS_Pr->SiS_SetFlag & EnableLVDSDDA)  tempbx = 1;
 
-	if(HwDeviceExtension->jChipType == SIS_730) {
-	   if(!(SiS_GetReg1(SiS_Pr->SiS_P3c4,0x11) & 0x08)) {
-	      SiS_WaitVBRetrace(SiS_Pr,HwDeviceExtension);
-	   }
-	   if(!(SiS_CR36BIOSWord23b(SiS_Pr,HwDeviceExtension))) {
-	      SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x11,0xF7,0x08);
-	      SiS_SetPanelDelay(SiS_Pr,ROMAddr, HwDeviceExtension, 3);
-	   }
-	} else {
-	   if(!(SiS_GetReg1(SiS_Pr->SiS_P3c4,0x11) & 0x08)) {
+  temp = ((tempbx >> 8) & 0x07) << 3;
+  temp = temp | ((tempecx >> 8) & 0x07);
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x20,temp);                         /* Part1_20h */
 
-	      if(!(SiS_GetReg1(SiS_Pr->SiS_P3c4,0x13) & 0x40)) {
-  
-  	          if(!(SiS_CR36BIOSWord23b(SiS_Pr,HwDeviceExtension))) {
+  temp = tempbx & 0x00FF;
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x21,temp);                         /* Part1_21h */
 
-                     SiS_WaitVBRetrace(SiS_Pr,HwDeviceExtension);
+  tempecx >>= 16;   	                                  	/* BPLHCFACT  */
+  if(modeflag & HalfDCLK) tempecx >>= 1;
+  temp = (USHORT)((tempecx & 0x0000FF00) >> 8);
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x22,temp);                         /* Part1_22h */
 
-		     if(!(SiS_GetReg1(SiS_Pr->SiS_P3c4,0x06) & 0x1c)) {
-		         SiS_DisplayOff(SiS_Pr);
-	             }
+  temp = (USHORT)(tempecx & 0x000000FF);
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x23,temp);
 
-	             SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x11,0xF7,0x08);
-	             SiS_SetPanelDelay(SiS_Pr,ROMAddr, HwDeviceExtension, 3);
-                  }
-              }
-	   }
-	}
+  if((SiS_Pr->SiS_IF_DEF_LVDS == 1) || (SiS_Pr->SiS_VBInfo & VB_SIS301LV302LV)) {
+     SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1e,0x20);
+  }
+}
+#endif  /* SIS 315 */
 
-	SiS_DisplayOff(SiS_Pr);
+static USHORT
+SiS_GetVGAHT2(SiS_Private *SiS_Pr)
+{
+  ULONG tempax,tempbx;
 
-	SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF);
+  tempbx = ((SiS_Pr->SiS_VGAVT - SiS_Pr->SiS_VGAVDE) * SiS_Pr->SiS_RVBHCMAX) & 0xFFFF;
+  tempax = (SiS_Pr->SiS_VT - SiS_Pr->SiS_VDE) * SiS_Pr->SiS_RVBHCFACT;
+  tempax = (tempax * SiS_Pr->SiS_HT) / tempbx;
+  return((USHORT) tempax);
+}
 
-	SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF);
-	SiS_UnLockCRT2(SiS_Pr,HwDeviceExtension,BaseAddr);
-	SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x01,0x80);
-	SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x02,0x40);
+/******* Set Part 1 / SiS bridge *********/
+static void
+SiS_SetGroup1_301(SiS_Private *SiS_Pr, USHORT ModeNo,USHORT ModeIdIndex,
+                  PSIS_HW_INFO HwInfo,USHORT RefreshRateTableIndex)
+{
+  USHORT  push1,push2;
+  USHORT  tempax,tempbx,tempcx,temp;
+  USHORT  resinfo,modeflag;
+  unsigned char p1_7, p1_8;
 
-	if( (!(SiS_CRT2IsLCD(SiS_Pr,BaseAddr,HwDeviceExtension))) ||
-	              (!(SiS_CR36BIOSWord23d(SiS_Pr,HwDeviceExtension))) ) {
-		SiS_SetPanelDelay(SiS_Pr,ROMAddr, HwDeviceExtension, 2);
-		SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x11,0xFB,0x04);
-	}
+  if(ModeNo <= 0x13) {
+     modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
+     resinfo = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ResInfo;
+  } else {
+     if(SiS_Pr->UseCustomMode) {
+        modeflag = SiS_Pr->CModeFlag;
+	resinfo = 0;
+     } else {
+    	modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
+    	resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO;
+     }
+  }
 
-#endif  /* SIS300 */
+  /* The following is only done if bridge is in slave mode: */
 
-    } else {
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x03,0xff);                  /* set MAX HT */
 
-#ifdef SIS315H	/* 310/325 series */
+  if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV)  modeflag |= Charx8Dot;
 
-	if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) {
-		temp = SiS_GetCH701x(SiS_Pr,0x61);
-		if(temp < 1) {
-		   SiS_SetCH701x(SiS_Pr,0xac76);
-		   SiS_SetCH701x(SiS_Pr,0x0066);
-		}
-		
-		if(!(SiS_IsDualEdge(SiS_Pr,HwDeviceExtension, BaseAddr))) {
-			SiS_SetCH701x(SiS_Pr,0x3e49);
-		} else if(SiS_IsTVOrYPbPrOrScart(SiS_Pr,HwDeviceExtension, BaseAddr))  {
-			SiS_SetCH701x(SiS_Pr,0x3e49);
-		}
-		
-		if(!(SiS_IsDualEdge(SiS_Pr,HwDeviceExtension, BaseAddr))) {
-			SiS_Chrontel701xBLOff(SiS_Pr);
-			SiS_Chrontel701xOff(SiS_Pr);
-		} else if(SiS_IsVAMode(SiS_Pr,HwDeviceExtension, BaseAddr)) {
-			SiS_Chrontel701xBLOff(SiS_Pr);
-			SiS_Chrontel701xOff(SiS_Pr);
-		}
-		
-	}
+  if(modeflag & Charx8Dot) tempcx = 0x08;
+  else                     tempcx = 0x09;
 
-	if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) {
-		SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x11,0xF7,0x08);
-		SiS_SetPanelDelay(SiS_Pr,ROMAddr, HwDeviceExtension, 3);
-	}
+  tempax = SiS_Pr->SiS_VGAHDE;                                 	/* 0x04 Horizontal Display End */
+  if(modeflag & HalfDCLK) tempax >>= 1;
+  tempax = ((tempax / tempcx) - 1) & 0xff;
+  tempbx = tempax;
 
-	if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) {
-		SiS_DisplayOff(SiS_Pr);
-	} else if(!(SiS_IsDualEdge(SiS_Pr,HwDeviceExtension, BaseAddr))) {
-		SiS_DisplayOff(SiS_Pr);
-	} else if(!(SiS_IsTVOrYPbPrOrScart(SiS_Pr,HwDeviceExtension, BaseAddr))) {
-		SiS_DisplayOff(SiS_Pr);
-	}
+  temp = tempax;
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x04,temp);
 
-	if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) {
-		SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x80);
-	} else if(!(SiS_IsDualEdge(SiS_Pr,HwDeviceExtension, BaseAddr))) {
-		SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x80);
-	} else if(!(SiS_IsVAMode(SiS_Pr,HwDeviceExtension, BaseAddr))) {
-		SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x80);
-	}
+  if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
+     if(!(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV)) {
+        temp += 2;
+     }
+  }
+  if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) {
+     if(resinfo == SIS_RI_800x600) temp -= 2;
+  }
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x05,temp);                 /* 0x05 Horizontal Display Start */
 
-	SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF);
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x06,0x03);                 /* 0x06 Horizontal Blank end     */
 
-	if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) {
-		SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF);
-	} else if(!(SiS_IsDualEdge(SiS_Pr,HwDeviceExtension, BaseAddr))) {
-		SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF);
-	} else if(!(SiS_IsVAMode(SiS_Pr,HwDeviceExtension, BaseAddr))) {
-		SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF);
-	}
+  tempax = 0xFFFF;
+  if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) tempax = SiS_GetVGAHT2(SiS_Pr);
+  if(tempax >= SiS_Pr->SiS_VGAHT) tempax = SiS_Pr->SiS_VGAHT;
+  if(modeflag & HalfDCLK)         tempax >>= 1;
+  tempax = (tempax / tempcx) - 5;
+  tempcx = tempax;
 
-	if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) {
-	        if(SiS_CRT2IsLCD(SiS_Pr, BaseAddr,HwDeviceExtension)) {
-			SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x1e,0xdf);
-		}
-	} else if(SiS_IsLCDOrLCDA(SiS_Pr,HwDeviceExtension, BaseAddr)) {
-		SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x1e,0xdf);
-	}
+  if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) {
+     temp = tempcx - 1;
+     if(!(modeflag & HalfDCLK)) {
+        temp -= 6;
+        if(SiS_Pr->SiS_TVMode & TVSetTVSimuMode) {
+           temp -= 2;
+           if(ModeNo > 0x13) temp -= 10;
+        }
+     }
+  } else {
+     tempcx = (tempcx + tempbx) >> 1;
+     temp = (tempcx & 0x00FF) + 2;
+     if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
+        temp--;
+        if(!(modeflag & HalfDCLK)) {
+           if((modeflag & Charx8Dot)) {
+              temp += 4;
+              if(SiS_Pr->SiS_VGAHDE >= 800) temp -= 6;
+              if(HwInfo->jChipType >= SIS_315H) {
+	         if(SiS_Pr->SiS_VGAHDE == 800) temp += 2;
+              }
+           }
+        }
+     } else {
+        if(!(modeflag & HalfDCLK)) {
+           temp -= 4;
+           if((SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel1280x960) &&
+	      (SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel1600x1200)) {
+              if(SiS_Pr->SiS_VGAHDE >= 800) {
+                 temp -= 7;
+	         if(HwInfo->jChipType < SIS_315H) {
+	            /* 650/301LV(x) does not do this, 630/301B, 300/301LV do */
+                    if(SiS_Pr->SiS_ModeType == ModeEGA) {
+                       if(SiS_Pr->SiS_VGAVDE == 1024) {
+                          temp += 15;
+                          if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel1280x1024)
+		  	     temp += 7;
+                       }
+                    }
+	         }
+		 if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel1400x1050) {
+                    if(SiS_Pr->SiS_VGAHDE >= 1280) {
+                       if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) temp += 28;
+		    }
+                 }
+              }
+           }
+        }
+     }
+  }
 
-	if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) {
-	    	if(SiS_IsDualEdge(SiS_Pr,HwDeviceExtension, BaseAddr)) {
-			SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x13,0xff);
-		} else {
-			SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x13,0xfb);
-		}
-	}
+  p1_7 = temp;
+  p1_8 = 0x00;
 
-	SiS_UnLockCRT2(SiS_Pr,HwDeviceExtension, BaseAddr);
+  if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
+     if(SiS_Pr->SiS_TVMode & TVSetTVSimuMode) {
+        if(ModeNo <= 0x01) {
+	   p1_7 = 0x2a;
+	   if(!(SiS_Pr->SiS_TVMode & TVSetPAL)) p1_8 = 0x61;
+	   else 	      			p1_8 = 0x41;
+	} else if(SiS_Pr->SiS_ModeType == ModeText) {
+	   if(!(SiS_Pr->SiS_TVMode & TVSetPAL)) p1_7 = 0x54;
+	   else 	    			p1_7 = 0x55;
+	   p1_8 = 0x00;
+	} else if(ModeNo <= 0x13) {
+	   if(modeflag & HalfDCLK) {
+	      if(!(SiS_Pr->SiS_TVMode & TVSetPAL)) {
+		 p1_7 = 0x30;
+		 p1_8 = 0x03;
+	      } else {
+	 	 p1_7 = 0x2f;
+		 p1_8 = 0x02;
+	      }
+	   } else {
+	      p1_7 = 0x5b;
+	      p1_8 = 0x03;
+	   }
+	} else if( ((HwInfo->jChipType >= SIS_315H) &&
+	            ((ModeNo == 0x50) || (ModeNo == 0x56) || (ModeNo == 0x53))) ||
+	           ((HwInfo->jChipType < SIS_315H) &&
+		    (resinfo == SIS_RI_320x200 || resinfo == SIS_RI_320x240)) ) {
+	   if(!(SiS_Pr->SiS_TVMode & TVSetPAL)) {
+	      p1_7 = 0x30,
+	      p1_8 = 0x03;
+	   } else {
+	      p1_7 = 0x2f;
+	      p1_8 = 0x03;
+	   }
+        }
+     }
+  }
 
-	if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) {
-		SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2e,0xf7);
-	} else if(!(SiS_IsDualEdge(SiS_Pr,HwDeviceExtension, BaseAddr))) {
-		SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2e,0xf7);
-	} else if(!(SiS_IsVAMode(SiS_Pr,HwDeviceExtension, BaseAddr))) {
-		SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2e,0xf7);
+  if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) {
+     if(SiS_Pr->SiS_TVMode & (TVSetYPbPr525p|TVSetYPbPr750p)) {
+        p1_7 = 0x63;
+	if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) p1_7 = 0x55;
+     }
+     if(SiS_Pr->SiS_TVMode & TVSetTVSimuMode) {
+        if(!(modeflag & HalfDCLK)) {
+	   p1_7 = 0xb2;
+	   if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) {
+	      p1_7 = 0xab;
+	   }
 	}
+     }
+  }
 
-#if 0  /* TW: BIOS code makes no sense */
-       if(SiS_IsVAMode(SiS_Pr,HwDeviceExtension, BaseAddr)) {
-           if(!(SiS_IsDualEdge(SiS_Pr,HwDeviceExtension, BaseAddr))) {
-	        if(SiS_WeHaveBacklightCtrl(SiS_Pr,HwDeviceExtension, BaseAddr)) {
-		  /* Nothing there! */
-		}
-           }
-       }
-#endif
-       if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) {
-		if(SiS_CRT2IsLCD(SiS_Pr, BaseAddr,HwDeviceExtension)) {
-			if(!(SiS_WeHaveBacklightCtrl(SiS_Pr,HwDeviceExtension, BaseAddr))) {
-				SiS_SetPanelDelay(SiS_Pr,ROMAddr, HwDeviceExtension, 2);
-				SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x11,0xFB,0x04);
-			}
-		}
-       }
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x07,p1_7);			/* 0x07 Horizontal Retrace Start */
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x08,p1_8);			/* 0x08 Horizontal Retrace End   */
 
-#endif  /* SIS315H */
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x03);                	/* 0x18 SR08 (FIFO Threshold?)   */
 
-    }  /* 310 series */
+  SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x19,0xF0);
 
-  }  /* LVDS */
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x09,0xFF);                	/* 0x09 Set Max VT    */
 
-}
+  tempcx = 0x121;
+  tempbx = SiS_Pr->SiS_VGAVDE;                               	/* 0x0E Vertical Display End */
+  if     (tempbx == 357) tempbx = 350;
+  else if(tempbx == 360) tempbx = 350;
+  else if(tempbx == 375) tempbx = 350;
+  else if(tempbx == 405) tempbx = 400;
+  else if(tempbx == 420) tempbx = 400;
+  else if(tempbx == 525) tempbx = 480;
+  push2 = tempbx;
+  if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
+     if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) {
+      	if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) {
+           if     (tempbx == 350) tempbx += 5;
+           else if(tempbx == 480) tempbx += 5;
+      	}
+     }
+  }
+  tempbx -= 2;
+  temp = tempbx & 0x00FF;
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x10,temp);        		/* 0x10 vertical Blank Start */
 
-/* TW: Checked against all BIOSes */
-void
-SiS_EnableBridge(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr)
-{
-  USHORT temp=0,tempah;
-#ifdef SIS315H
-  USHORT temp1,pushax=0;
-  BOOLEAN delaylong = FALSE;
+  tempbx = push2;
+  tempbx--;
+  temp = tempbx & 0x00FF;
+#if 0
+  /* Missing code from 630/301B 2.04.5a and 650/302LV 1.10.6s (calles int 2f) */
+  if(xxx()) {
+      if(temp == 0xdf) temp = 0xda;
+  }
 #endif
-  UCHAR *ROMAddr = HwDeviceExtension->pjVirtualRomBase;
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0E,temp);
 
-  if(SiS_Pr->SiS_IF_DEF_LVDS == 0) {
-
-    if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {   /* TW: ====== For 301B et al  ====== */
+  temp = 0;
+  if(modeflag & DoubleScanMode) temp |= 0x80;
+  if(HwInfo->jChipType >= SIS_661) {
+     if(tempbx & 0x0200)        temp |= 0x20;
+     SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x0B,0x5F,temp);
+     if(tempbx & 0x0100)  tempcx |= 0x000a;
+     if(tempbx & 0x0400)  tempcx |= 0x1200;
+  } else {
+     SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0B,temp);
+     if(tempbx & 0x0100)  tempcx |= 0x0002;
+     if(tempbx & 0x0400)  tempcx |= 0x0600;
+  }
 
-      if(HwDeviceExtension->jChipType < SIS_315H) {
+  if(tempbx & 0x0200)  tempcx |= 0x0040;
 
-#ifdef SIS300     /* 300 series */
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x11,0x00);                	/* 0x11 Vertical Blank End */
 
-         if(HwDeviceExtension->jChipType == SIS_300) {
+  tempax = (SiS_Pr->SiS_VGAVT - tempbx) >> 2;
 
-	    if(SiS_CRT2IsLCD(SiS_Pr,BaseAddr,HwDeviceExtension)) {
-	       if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) { 
-	          SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x26,0x02);
-	          if(!(SiS_CR36BIOSWord23d(SiS_Pr,HwDeviceExtension))) {
-	             SiS_SetPanelDelay(SiS_Pr, ROMAddr, HwDeviceExtension, 0);
-	          }
-	       }
-	    }
-	    temp = SiS_GetReg1(SiS_Pr->SiS_P3c4,0x32) & 0xDF;             /* lock mode */
-            if(SiS_BridgeInSlave(SiS_Pr)) {
-               tempah = SiS_GetReg1(SiS_Pr->SiS_P3d4,0x30);
-               if(!(tempah & SetCRT2ToRAMDAC))  temp |= 0x20;
-            }
-            SiS_SetReg1(SiS_Pr->SiS_P3c4,0x32,temp);
-	    SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20);
-	    SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x00,0x1F,0x20);        /* enable VB processor */
-	    if(SiS_Is301B(SiS_Pr,BaseAddr)) {
-               SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x1F,0xC0);
-	       SiS_DisplayOn(SiS_Pr);
-	    } else {
-	       SiS_VBLongWait(SiS_Pr);
-	       SiS_DisplayOn(SiS_Pr);
-	       SiS_VBLongWait(SiS_Pr);
-	    }
-	    if(SiS_CRT2IsLCD(SiS_Pr,BaseAddr,HwDeviceExtension)) {
-	       if(!(SiS_GetReg1(SiS_Pr->SiS_P3c4,0x13) & 0x40)) {
-		  if(!(SiS_GetReg1(SiS_Pr->SiS_P3c4,0x16) & 0x10)) {
-		     if(!(SiS_CR36BIOSWord23b(SiS_Pr,HwDeviceExtension))) {
-		           SiS_SetPanelDelay(SiS_Pr,ROMAddr, HwDeviceExtension, 1);
-                     }
-		     if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) { 
-		         SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x26,0xfe,0x01);
-	 	     }
-		  }
-               }
-	    }
+  if((ModeNo > 0x13) || (HwInfo->jChipType < SIS_315H)) {
+     if(resinfo != SIS_RI_1280x1024) {
+	tempbx += (tempax << 1);
+     }
+  } else if(HwInfo->jChipType >= SIS_315H) {
+     if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel1400x1050) {
+	tempbx += (tempax << 1);
+     }
+  }
 
-	 } else {
+  if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) {
+     tempbx -= 10;
+  } else {
+     if(SiS_Pr->SiS_TVMode & TVSetTVSimuMode) {
+        if(SiS_Pr->SiS_TVMode & TVSetPAL) {
+           tempbx += 40;
+	   if(HwInfo->jChipType >= SIS_315H) {
+	      if(SiS_Pr->SiS_VGAHDE == 800) tempbx += 10;
+	   }
+	}
+     }
+  }
+  tempax >>= 2;
+  tempax++;
+  tempax += tempbx;
+  push1 = tempax;
+  if(SiS_Pr->SiS_TVMode & TVSetPAL) {
+     if(tempbx <= 513)  {
+     	if(tempax >= 513) tempbx = 513;
+     }
+  }
+  temp = tempbx & 0x00FF;
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0C,temp);			/* 0x0C Vertical Retrace Start */
 
-	    if((SiS_Pr->SiS_VBType & VB_NoLCD) &&
-	       (SiS_CRT2IsLCD(SiS_Pr,BaseAddr,HwDeviceExtension))) {
-	       /* This is only for LCD output on 301B-DH via LVDS */
-	       SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x11,0xFB);
-	       if(!(SiS_CR36BIOSWord23d(SiS_Pr,HwDeviceExtension))) {
-	          SiS_SetPanelDelay(SiS_Pr, ROMAddr, HwDeviceExtension, 0);
-	       }
-	       SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20);   /* Enable CRT2 */
-/*	       DoSomeThingPCI_On(SiS_Pr) */
-               SiS_DisplayOn(SiS_Pr);
-	       SiS_UnLockCRT2(SiS_Pr,HwDeviceExtension, BaseAddr);
-	       SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x02,0xBF);
-	       if(SiS_BridgeInSlave(SiS_Pr)) {
-      		  SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x01,0x1F);
-      	       } else {
-      		  SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x01,0x1F,0x40);
-               }
-	       if(!(SiS_GetReg1(SiS_Pr->SiS_P3c4,0x13) & 0x40)) {
-	           if(!(SiS_GetReg1(SiS_Pr->SiS_P3c4,0x16) & 0x10)) {
-		       if(!(SiS_CR36BIOSWord23b(SiS_Pr,HwDeviceExtension))) {
-		           SiS_SetPanelDelay(SiS_Pr,ROMAddr, HwDeviceExtension, 1);
-                       }
-		       SiS_WaitVBRetrace(SiS_Pr,HwDeviceExtension);
-                       SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x11,0xF7,0x00);
-                   }
-	       }
-            } else {
-	       temp = SiS_GetReg1(SiS_Pr->SiS_P3c4,0x32) & 0xDF;             /* lock mode */
-               if(SiS_BridgeInSlave(SiS_Pr)) {
-                  tempah = SiS_GetReg1(SiS_Pr->SiS_P3d4,0x30);
-                  if(!(tempah & SetCRT2ToRAMDAC))  temp |= 0x20;
-               }
-               SiS_SetReg1(SiS_Pr->SiS_P3c4,0x32,temp);
-	       SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20);
-	       SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x00,0x1F,0x20);        /* enable VB processor */
-	       if(SiS_Is301B(SiS_Pr,BaseAddr)) {
-                  SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x1F,0xC0);
-	          SiS_DisplayOn(SiS_Pr);
-	       } else {
-	          SiS_VBLongWait(SiS_Pr);
-	          SiS_DisplayOn(SiS_Pr);
-	          SiS_VBLongWait(SiS_Pr);
-	       }
-	    }
+  tempbx--;
+  temp = tempbx & 0x00FF;
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x10,temp);
 
-         }
-#endif /* SIS300 */
+  if(tempbx & 0x0100) tempcx |= 0x0008;
 
-      } else {
+  if(tempbx & 0x0200) {
+     SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x0B,0x20);
+  }
+  tempbx++;
 
-#ifdef SIS315H    /* 310/325 series */
+  if(tempbx & 0x0100) tempcx |= 0x0004;
+  if(tempbx & 0x0200) tempcx |= 0x0080;
+  if(tempbx & 0x0400) {
+     if(HwInfo->jChipType >= SIS_661)        tempcx |= 0x0800;
+     else if(SiS_Pr->SiS_VBType & VB_SIS301) tempcx |= 0x0800;
+     else                                    tempcx |= 0x0C00;
+  }
 
-	 if(IS_SIS650740) {		/* 650 */
+  tempbx = push1;
+  temp = tempbx & 0x000F;
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0D,temp);        		/* 0x0D vertical Retrace End */
 
-#if 0
-	    if(SiS_GetReg1(SiS_Pr->SiS_Part4Port,0x00) != 1) return;	/* From 1.10.7w */
-#endif
+  if(tempbx & 0x0010) tempcx |= 0x2000;
 
-	    if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {
-	    
-	       SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x1f,0xef);  /* 1.10.7u */
-	       SiS_SetReg1(SiS_Pr->SiS_Part4Port,0x30,0x00);    /* 1.10.7u */
-
-	       if(!(IS_SIS740)) {
-                  if(!(SiS_IsNotM650or651(SiS_Pr,HwDeviceExtension, BaseAddr))) {
-	             tempah = 0x10;
-	             if(SiS_IsVAMode(SiS_Pr,HwDeviceExtension, BaseAddr)) {
-	                tempah = 0x08;
-                     }
-	             SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x4c,tempah);
-	          }
-	       }
+  temp = tempcx & 0x00FF;
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0A,temp);              	/* 0x0A CR07 */
 
-	       SiS_SetReg3(SiS_Pr->SiS_P3c6,0x00);
-	       SiS_DisplayOff(SiS_Pr);
-	       pushax = SiS_GetReg1(SiS_Pr->SiS_P3c4,0x06);
-	       if(IS_SIS740) {
-	          SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x06,0xE3);
-	       }
+  temp = (tempcx & 0xFF00) >> 8;
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x17,temp);              	/* 0x17 SR0A */
 
-	       if( (SiS_IsVAMode(SiS_Pr,HwDeviceExtension, BaseAddr)) ||
-	           (SiS_CRT2IsLCD(SiS_Pr,BaseAddr,HwDeviceExtension)) ) {
-                   if(!(SiS_GetReg1(SiS_Pr->SiS_Part4Port,0x26) & 0x02)) {
-		      SiS_SetPanelDelayLoop(SiS_Pr,ROMAddr, HwDeviceExtension, 3, 2);
-		      SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x26,0x02);
-	              SiS_SetPanelDelayLoop(SiS_Pr,ROMAddr, HwDeviceExtension, 3, 2);
-	           }
-	       }
+  tempax = modeflag;
+  temp = (tempax & 0xFF00) >> 8;
+  temp = (temp >> 1) & 0x09;
+  if(!(SiS_Pr->SiS_VBType & VB_SIS301)) temp |= 0x01;		/* Always 8 dotclock */
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x16,temp);              	/* 0x16 SR01 */
 
-	       if(!(SiS_GetReg1(SiS_Pr->SiS_P3d4,0x31) & 0x40)) {
-                  SiS_SetPanelDelayLoop(SiS_Pr,ROMAddr, HwDeviceExtension, 3, 10);
-		  delaylong = TRUE;
-	       }
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0F,0x00);              	/* 0x0F CR14 */
 
-	    }
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x12,0x00);              	/* 0x12 CR17 */
 
-	    if(!(SiS_IsVAMode(SiS_Pr,HwDeviceExtension, BaseAddr))) {
-               temp = SiS_GetReg1(SiS_Pr->SiS_P3c4,0x32) & 0xDF;
-	       if(SiS_BridgeInSlave(SiS_Pr)) {
-                  tempah = SiS_GetReg1(SiS_Pr->SiS_P3d4,0x30);
-                  if(!(tempah & SetCRT2ToRAMDAC))  temp |= 0x20;
-               }
-               SiS_SetReg1(SiS_Pr->SiS_P3c4,0x32,temp);
+  temp = 0x00;
+  if(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit) {
+     if(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0x01) {
+	temp = 0x80;
+     }
+  }
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1A,temp);                	/* 0x1A SR0E */
+}
 
-	       SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20);                   /* enable CRT2 */
-	       
-	       if(SiS_Pr->SiS_VBType & VB_SIS301B302B) {
-	          SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2e,0x7f);
-		  temp = SiS_GetReg1(SiS_Pr->SiS_Part1Port,0x2e);
-		  if(!(temp & 0x80)) {
-		     SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2e,0x80);
-		  }
-	       } else {
-	          SiS_SetPanelDelay(SiS_Pr,ROMAddr, HwDeviceExtension, 2);
-	       }
-	    }
+/*********** Set Part 1 / LVDS ***********/
+static void
+SiS_SetGroup1_LVDS(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
+ 		   PSIS_HW_INFO HwInfo, USHORT RefreshRateTableIndex)
+{
+  USHORT modeflag, resinfo;
+  USHORT push1, push2, tempax, tempbx, tempcx, temp;
+#ifdef SIS315H
+  USHORT pushcx;
+#endif
+  ULONG  tempeax=0, tempebx, tempecx, tempvcfact=0;
 
-	    if(SiS_IsVAMode(SiS_Pr,HwDeviceExtension, BaseAddr)) {
-	          SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1e,0x20);
-	    }
+  /* This is not supported on LVDS */
+  if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_PanelCustom) return;
+  if(SiS_Pr->UseCustomMode) return;
 
-	    SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x00,0x1f,0x20);
+  if(ModeNo <= 0x13) {
+     modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
+     resinfo = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ResInfo;
+  } else {
+     modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
+     resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO;
+  }
 
-	    if(SiS_Pr->SiS_VBType & VB_SIS301B302B) {
-	       temp = SiS_GetReg1(SiS_Pr->SiS_Part1Port,0x2e);
-	       if(!(temp & 0x80)) {
-		  SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2e,0x80);
-	       }
-	    }
+  /* Set up Panel Link */
 
-	    tempah = 0xc0;
-	    if(SiS_IsDualEdge(SiS_Pr,HwDeviceExtension, BaseAddr)) {
-	       tempah = 0x80;
-	       if(!(SiS_IsVAMode(SiS_Pr,HwDeviceExtension, BaseAddr))) {
-	          tempah = 0x40;
-               }
-	    }
-            SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x1F,tempah);
+  /* 1. Horizontal setup */
 
-	    if(SiS_Pr->SiS_VBType & VB_SIS301B302B) {
-               SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x00,0x7f);
-	    }
+  tempax = SiS_Pr->SiS_LCDHDES;
 
-	    if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {
-	    
-	       SiS_SetReg1(SiS_Pr->SiS_Part4Port,0x30,0x00);	/* All this from 1.10.7u */
-	       SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x27,0x0c);
-	       SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x30,0x20);
-	       SiS_SetReg1(SiS_Pr->SiS_Part4Port,0x31,0x05);  
-	       SiS_SetReg1(SiS_Pr->SiS_Part4Port,0x32,0x60);  
-	       SiS_SetReg1(SiS_Pr->SiS_Part4Port,0x33,0x00);  
-	       SiS_SetReg1(SiS_Pr->SiS_Part4Port,0x34,0x10); 
-	       SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x30,0x40); 
-	       
-	       SiS_SetPanelDelay(SiS_Pr,ROMAddr, HwDeviceExtension, 2);
-	    
-	       SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x1f,0x10);  /* 1.10.8r */
-
-	       SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2e,0x80);
-
-	       if(!(SiS_WeHaveBacklightCtrl(SiS_Pr,HwDeviceExtension, BaseAddr))) {
-	          if( (SiS_IsVAMode(SiS_Pr,HwDeviceExtension, BaseAddr)) ||
-	              ((SiS_CRT2IsLCD(SiS_Pr,BaseAddr,HwDeviceExtension))) ) {
-		    SiS_SetPanelDelayLoop(SiS_Pr,ROMAddr, HwDeviceExtension, 3, 10);
-		    if(delaylong) {
-			SiS_SetPanelDelayLoop(SiS_Pr,ROMAddr, HwDeviceExtension, 3, 10);
-		    }
-                    SiS_WaitVBRetrace(SiS_Pr,HwDeviceExtension);
-		    SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x26,0xfe,0x01);
-	         }
-	      }
+  if((!SiS_Pr->SiS_IF_DEF_FSTN) && (!SiS_Pr->SiS_IF_DEF_DSTN)) {
+     if( (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480) &&
+         (!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) ) {
+  	   tempax -= 8;
+     }
+  }
 
-	      SiS_SetReg1(SiS_Pr->SiS_P3c4,0x06,pushax);
-	      SiS_DisplayOn(SiS_Pr);
-	      SiS_SetReg3(SiS_Pr->SiS_P3c6,0xff);
+  tempcx = SiS_Pr->SiS_HT;    				  /* Horiz. Total */
 
-	      if(!(SiS_WeHaveBacklightCtrl(SiS_Pr,HwDeviceExtension, BaseAddr))) {
-	          SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x00,0x7f);
-	      }
-#if 0
-              SiS_SetReg1(SiS_Pr->SiS_Part4Port,0x30,0x00);
-	      SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x27,0x0c);
-	      SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x30,0x20);
-	      SiS_SetReg1(SiS_Pr->SiS_Part4Port,0x31,0x05);   /* 1.10.8r: 0x0d */
-	      SiS_SetReg1(SiS_Pr->SiS_Part4Port,0x32,0x60);   /* 1.10.8r: 0x70 */
-	      SiS_SetReg1(SiS_Pr->SiS_Part4Port,0x33,0x00);   /* 1.10.8r: 0x40 */
-	      SiS_SetReg1(SiS_Pr->SiS_Part4Port,0x34,0x10); 
-	      SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x30,0x40); 
-#endif	      
+  tempbx = SiS_Pr->SiS_HDE;                               /* Horiz. Display End */
 
-	  }
+  if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480_2 ||
+     SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480_3) {
+     tempbx >>= 1;
+  }
 
-#if 0
-         } else if(IS_SIS740) {		/* 740 */
-	 
-	   if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {  /* 30xLV */
-	   
-	      SiS_SetReg3(SiS_Pr->SiS_P3c6,0x00);
-	      SiS_DisplayOff(SiS_Pr);
-	      pushax = SiS_GetReg1(SiS_Pr->SiS_P3c4,0x06);
-	      SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x06,0xE3);
-	      
-	      if( (SiS_IsVAMode(SiS_Pr,HwDeviceExtension, BaseAddr)) ||
-	          (SiS_CRT2IsLCD(SiS_Pr,BaseAddr,HwDeviceExtension)) ) {
-                   if(!(SiS_GetReg1(SiS_Pr->SiS_Part4Port,0x26) & 0x02)) {
-		      SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x26,0x02);
-	              SiS_SetPanelDelay(SiS_Pr,ROMAddr, HwDeviceExtension, 3);
-		   }
+  if(!(SiS_Pr->SiS_LCDInfo & LCDPass11)) {
+     if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) {
+        if(SiS_Pr->SiS_IF_DEF_FSTN || SiS_Pr->SiS_IF_DEF_DSTN) {
+	   tempbx = SiS_Pr->PanelXRes;
+	} else if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel640x480) {
+	   tempbx = SiS_Pr->PanelXRes;
+	   if(SiS_Pr->SiS_CustomT == CUT_BARCO1024) {
+	      tempbx = 800;
+	      if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel800x600) {
+	         tempbx = 1024;
 	      }
-	      
-	      if(!(SiS_IsVAMode(SiS_Pr,HwDeviceExtension, BaseAddr))) {
-	         temp = SiS_GetReg1(SiS_Pr->SiS_P3c4,0x32) & 0xDF;
-	         if(SiS_BridgeInSlave(SiS_Pr)) {
-                    tempah = SiS_GetReg1(SiS_Pr->SiS_P3d4,0x30);
-                    if(!(tempah & SetCRT2ToRAMDAC))  temp |= 0x20;
-                 }
-                 SiS_SetReg1(SiS_Pr->SiS_P3c4,0x32,temp);
+	   }
+        }
+     }
+  }
+  tempcx = (tempcx - tempbx) >> 2;		 /* HT-HDE / 4 */
 
-	         SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20);  	
-		 SiS_SetPanelDelay(SiS_Pr,ROMAddr, HwDeviceExtension, 2);
-	      }
-	      
-	      if(SiS_IsVAMode(SiS_Pr,HwDeviceExtension, BaseAddr)) {
-	         SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1E,0x20);
-	      }
-	      
-	      SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x00,0x1f,0x20);
-	      SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x1F,0xC0);
-	      SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x1F,0x10);  /* (taken from 650 1.10.8r) */
-	      SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2E,0x80);
-	      
-	      if(!(SiS_WeHaveBacklightCtrl(SiS_Pr,HwDeviceExtension, BaseAddr))) {
-	         if( (SiS_IsVAMode(SiS_Pr,HwDeviceExtension, BaseAddr)) ||
-	             (SiS_CRT2IsLCD(SiS_Pr,BaseAddr,HwDeviceExtension)) ) {
-		    SiS_SetPanelDelayLoop(SiS_Pr,ROMAddr, HwDeviceExtension, 3, 10);
-		    if(SiS_GetReg1(SiS_Pr->SiS_P3d4,0x31) & 0x40) {
-		       SiS_WaitVBRetrace(SiS_Pr,HwDeviceExtension);
-		    }
-		    SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x26,0xfe,0x01);
-		    SiS_SetPanelDelayLoop(SiS_Pr,ROMAddr, HwDeviceExtension, 3, 10);
-		    SiS_WaitVBRetrace(SiS_Pr,HwDeviceExtension);
-	         }
-              }
-	      
-	      SiS_SetReg1(SiS_Pr->SiS_P3c4,0x06,pushax);
-	      SiS_DisplayOn(SiS_Pr);
-	      SiS_SetReg3(SiS_Pr->SiS_P3c6,0xff);
-	      
-	      if(!(SiS_WeHaveBacklightCtrl(SiS_Pr,HwDeviceExtension, BaseAddr))) {
-	         SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x00,0x7f);
-	      }
-	   
-	   } else {	/* (301), 301B */
-	 
-	      if(!(SiS_IsVAMode(SiS_Pr,HwDeviceExtension, BaseAddr))) {
-	         temp = SiS_GetReg1(SiS_Pr->SiS_P3c4,0x32) & 0xDF;
-	         if(SiS_BridgeInSlave(SiS_Pr)) {
-                    tempah = SiS_GetReg1(SiS_Pr->SiS_P3d4,0x30);
-                    if(!(tempah & SetCRT2ToRAMDAC))  temp |= 0x20;
-                 }
-                 SiS_SetReg1(SiS_Pr->SiS_P3c4,0x32,temp);
+  push1 = tempax;
 
-	         SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20);                   /* enable CRT2 */
+  tempax += tempbx;
 
-	         temp = SiS_GetReg1(SiS_Pr->SiS_Part1Port,0x2E);
-                 if(!(temp & 0x80))
-                    SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2E,0x80);
-              }
+  if(tempax >= SiS_Pr->SiS_HT) tempax -= SiS_Pr->SiS_HT;
 
-	      SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x00,0x1f,0x20);
+  push2 = tempax;
 
-	      if(SiS_Is301B(SiS_Pr,BaseAddr)) { 
-	         SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x1F,0xC0);
-	         SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x00,0x7f);
-	      } else {
-	         SiS_VBLongWait(SiS_Pr);
-                 SiS_DisplayOn(SiS_Pr);
-	         SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x00,0x7F);
-                 SiS_VBLongWait(SiS_Pr);
+  if((!SiS_Pr->SiS_IF_DEF_FSTN) &&
+     (!SiS_Pr->SiS_IF_DEF_DSTN) &&
+     (SiS_Pr->SiS_CustomT != CUT_BARCO1366) &&
+     (SiS_Pr->SiS_CustomT != CUT_BARCO1024) &&
+     (SiS_Pr->SiS_CustomT != CUT_PANEL848)) {
+     if(!(SiS_Pr->SiS_LCDInfo & LCDPass11)) {
+        if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
+           if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel640x480) {
+     	      if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel800x600)        tempcx = 0x0028;
+	      else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x600)  tempcx = 0x0018;
+     	      else if( (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) ||
+	            (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1152x768) ) {
+	  	   if(HwInfo->jChipType < SIS_315H) {
+		      if(SiS_Pr->SiS_VBType & VB_SISVB) {
+		         tempcx = 0x0017;  /* A901; sometimes 0x0018; */
+		      } else {
+		         tempcx = 0x0017;
+#ifdef TWNEWPANEL
+			 tempcx = 0x0018;
+#endif
+		      }
+		   } else {
+		      tempcx = 0x0018;
+		   }
 	      }
-	      
+	      else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x768)  tempcx = 0x0028;
+	      else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) tempcx = 0x0030;
+	      else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) tempcx = 0x0030;
+	      else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200) tempcx = 0x0040;
 	   }
-#endif
-	  
-	 } else {			/* 315, 330 */
+        }
+     }
+  }
 
-	   if(!(SiS_IsVAMode(SiS_Pr,HwDeviceExtension, BaseAddr))) {
-	      temp = SiS_GetReg1(SiS_Pr->SiS_P3c4,0x32) & 0xDF;
-	      if(SiS_BridgeInSlave(SiS_Pr)) {
-                 tempah = SiS_GetReg1(SiS_Pr->SiS_P3d4,0x30);
-                 if(!(tempah & SetCRT2ToRAMDAC))  temp |= 0x20;
-              }
-              SiS_SetReg1(SiS_Pr->SiS_P3c4,0x32,temp);
+  tempcx += tempax;                              /* lcdhrs  */
+  if(tempcx >= SiS_Pr->SiS_HT) tempcx -= SiS_Pr->SiS_HT;
 
-	      SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20);                   /* enable CRT2 */
+  tempax = tempcx >> 3;                          /* BPLHRS */
+  temp = tempax & 0x00FF;
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x14,temp);		 /* Part1_14h; Panel Link Horizontal Retrace Start  */
 
-	      temp = SiS_GetReg1(SiS_Pr->SiS_Part1Port,0x2E);
-              if(!(temp & 0x80))
-                 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2E,0x80);
+  if(SiS_Pr->SiS_LCDInfo & LCDPass11) {
+     temp = (tempax & 0x00FF) + 2;
+  } else {
+     temp = (tempax & 0x00FF) + 10;
+     if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
+        if((!SiS_Pr->SiS_IF_DEF_DSTN) &&
+	   (!SiS_Pr->SiS_IF_DEF_FSTN) &&
+	   (SiS_Pr->SiS_CustomT != CUT_BARCO1366) &&
+	   (SiS_Pr->SiS_CustomT != CUT_BARCO1024) &&
+	   (SiS_Pr->SiS_CustomT != CUT_PANEL848)) {
+           if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel640x480) {
+	      temp += 6;
+              if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel800x600) {
+	         temp++;
+	         if(HwInfo->jChipType >= SIS_315H) {
+	            if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel1024x768) {
+	               temp += 7;
+		       if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel1600x1200) {
+		          temp -= 0x14;
+			  if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel1280x768) {
+			     temp -= 10;
+			  }
+		       }
+	            }
+	         }
+	      }
            }
+        }
+     }
+  }
 
-	   SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x00,0x1f,0x20);
-
-	   if(SiS_Is301B(SiS_Pr,BaseAddr)) {
-
-	      temp=SiS_GetReg1(SiS_Pr->SiS_Part1Port,0x2E);
-              if (!(temp & 0x80))
-                 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2E,0x80);
+  temp &= 0x1F;
+  temp |= ((tempcx & 0x0007) << 5);
+#if 0
+  if(SiS_Pr->SiS_IF_DEF_FSTN) temp = 0x20;       /* WRONG? BIOS loads cl, not ah */
+#endif
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x15,temp);    	 /* Part1_15h; Panel Link Horizontal Retrace End/Skew */
 
-	      tempah = 0xc0;
-	      if(SiS_IsDualEdge(SiS_Pr,HwDeviceExtension, BaseAddr)) {
-	         tempah = 0x80;
-	         if(!(SiS_IsVAMode(SiS_Pr,HwDeviceExtension, BaseAddr))) {
-	            tempah = 0x40;
-                 }
-	      }
-              SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x1F,tempah);
+  tempbx = push2;
+  tempcx = push1;                                /* lcdhdes  */
 
-	      SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x00,0x7f);
+  temp = (tempcx & 0x0007);                      /* BPLHDESKEW  */
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1A,temp);   	 /* Part1_1Ah; Panel Link Vertical Retrace Start (2:0) */
 
-	   } else {
-	   
-	      SiS_VBLongWait(SiS_Pr);
-              SiS_DisplayOn(SiS_Pr);
-	      SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x00,0x7F);
-              SiS_VBLongWait(SiS_Pr);
+  tempcx >>= 3;                                  /* BPLHDES */
+  temp = (tempcx & 0x00FF);
+#if 0 /* Not 550 FSTN */
+  if(HwInfo->jChipType >= SIS_315H) {
+     if(ModeNo == 0x5b) temp--; */
+  }
+#endif
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x16,temp);    	 /* Part1_16h; Panel Link Horizontal Display Enable Start  */
 
-	   }
+  if((HwInfo->jChipType < SIS_315H) ||
+     (SiS_Pr->SiS_IF_DEF_FSTN) ||
+     (SiS_Pr->SiS_IF_DEF_DSTN)) {
+     if(tempbx & 0x07) tempbx += 8;
+  }
+  tempbx >>= 3;                                  /* BPLHDEE  */
+  temp = tempbx & 0x00FF;
+#if 0 /* Not 550 FSTN */
+  if(HwInfo->jChipType >= SIS_315H) {
+     if(ModeNo == 0x5b) temp--;
+  }
+#endif
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x17,temp);   	 /* Part1_17h; Panel Link Horizontal Display Enable End  */
 
-	 }   /* 315, 330 */
+  /* 2. Vertical setup */
 
-#endif /* SIS315H */
+  if(HwInfo->jChipType < SIS_315H) {
+     tempcx = SiS_Pr->SiS_VGAVT;
+     tempbx = SiS_Pr->SiS_VGAVDE;
+     if((SiS_Pr->SiS_CustomT != CUT_BARCO1366) && (SiS_Pr->SiS_CustomT != CUT_BARCO1024)) {
+        if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) {
+           if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel640x480) {
+	      tempbx = SiS_Pr->PanelYRes;
+           }
+	}
+     }
+     tempcx -= tempbx;
 
-      }
+  } else {
 
-    } else {	/* ============  TW: For 301 ================ */
+     tempcx = SiS_Pr->SiS_VGAVT - SiS_Pr->SiS_VGAVDE;           /* VGAVT-VGAVDE  */
 
-       if(HwDeviceExtension->jChipType < SIS_315H) {
-            if(SiS_CRT2IsLCD(SiS_Pr,BaseAddr,HwDeviceExtension)) {
-                SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x11,0xF0,0x0B);
-	        SiS_SetPanelDelay(SiS_Pr, ROMAddr, HwDeviceExtension, 0);
-	    }
-       }
+  }
 
-       temp = SiS_GetReg1(SiS_Pr->SiS_P3c4,0x32) & 0xDF;          /* lock mode */
-       if(SiS_BridgeInSlave(SiS_Pr)) {
-         tempah = SiS_GetReg1(SiS_Pr->SiS_P3d4,0x30);
-         if(!(tempah & SetCRT2ToRAMDAC))  temp |= 0x20;
-       }
-       SiS_SetReg1(SiS_Pr->SiS_P3c4,0x32,temp);
+  tempbx = SiS_Pr->SiS_LCDVDES;	   		 	 	/* VGAVDES  */
+  push1 = tempbx;
 
-       SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20);                  /* enable CRT2 */
+  tempax = SiS_Pr->SiS_VGAVDE;
 
-       if(HwDeviceExtension->jChipType >= SIS_315H) {
-         temp = SiS_GetReg1(SiS_Pr->SiS_Part1Port,0x2E);
-         if(!(temp & 0x80))
-           SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2E,0x80);         /* BVBDOENABLE=1 */
-       }
+  if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
+     if((SiS_Pr->SiS_CustomT == CUT_BARCO1366) || (SiS_Pr->SiS_CustomT == CUT_BARCO1024)) {
+        if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel640x480) {
+           tempax = 600;
+	   if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel800x600) {
+	      tempax = 768;
+	   }
+	}
+     } else if( (SiS_Pr->SiS_IF_DEF_TRUMPION == 0)   &&
+                (!(SiS_Pr->SiS_LCDInfo & LCDPass11)) &&
+                ((SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel640x480) ||
+	         (SiS_Pr->SiS_IF_DEF_FSTN) ||
+	         (SiS_Pr->SiS_IF_DEF_DSTN)) ) {
+	tempax = SiS_Pr->PanelYRes;
+     }
+  }
 
-       SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x00,0x1F,0x20);     /* enable VB processor */
+  tempbx += tempax;
+  if(tempbx >= SiS_Pr->SiS_VT) tempbx -= SiS_Pr->SiS_VT;
 
-       SiS_VBLongWait(SiS_Pr);
-       SiS_DisplayOn(SiS_Pr);
-       if(HwDeviceExtension->jChipType >= SIS_315H) {
-           SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x00,0x7f);
-       }
-       SiS_VBLongWait(SiS_Pr);
+  push2 = tempbx;
 
-       if(HwDeviceExtension->jChipType < SIS_315H) {
-            if(SiS_CRT2IsLCD(SiS_Pr,BaseAddr,HwDeviceExtension)) {
-	        SiS_SetPanelDelay(SiS_Pr, ROMAddr, HwDeviceExtension, 1);
-                SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x11,0xF0,0x03);
-	    }
-       }
+  tempcx >>= 1;
 
-    }
+  if((SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) &&
+     (SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel640x480) &&
+     (SiS_Pr->SiS_CustomT != CUT_BARCO1366) &&
+     (SiS_Pr->SiS_CustomT != CUT_BARCO1024) &&
+     (SiS_Pr->SiS_CustomT != CUT_PANEL848)) {
+     if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480_2 ||
+        SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480_3) {
+	tempcx = 0x0017;
+     } else if(!(SiS_Pr->SiS_LCDInfo & LCDPass11)) {
+        if(SiS_Pr->SiS_IF_DEF_FSTN || SiS_Pr->SiS_IF_DEF_DSTN) {
+	   if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel800x600)         tempcx = 0x0003;
+  	   else if((SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) ||
+	           (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x768)) tempcx = 0x0003;
+           else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024)  tempcx = 0x0001;
+           else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050)  tempcx = 0x0001;
+	   else 							  tempcx = 0x0057;
+        } else  {
+     	   if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel800x600)         tempcx = 0x0001;
+	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x600)   tempcx = 0x0001;
+     	   else if((SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) ||
+	           (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1152x768)) {
+		   if(HwInfo->jChipType < SIS_315H) {
+		      if(SiS_Pr->SiS_VBType & VB_SISVB) {
+		         tempcx = 0x0002;   /* A901; sometimes 0x0003; */
+		      } else {
+			 tempcx = 0x0002;
+#ifdef TWNEWPANEL
+			 tempcx = 0x0003;
+#endif
+		      }
+		   } else tempcx = 0x0003;
+           }
+     	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x768)  tempcx = 0x0003;
+     	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) tempcx = 0x0001;
+     	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) tempcx = 0x0001;
+	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200) tempcx = 0x0001;
+     	   else 							 tempcx = 0x0057;
+	}
+     }
+  }
 
-  } else {   /* =================== TW: For LVDS ================== */
+  tempbx += tempcx;			 	/* BPLVRS  */
 
-    if(HwDeviceExtension->jChipType < SIS_315H) {
+  if((HwInfo->jChipType < SIS_315H) ||
+     (SiS_Pr->SiS_IF_DEF_FSTN) ||
+     (SiS_Pr->SiS_IF_DEF_DSTN)) {
+     tempbx++;
+  }
 
-#ifdef SIS300    /* 300 series */
+  if(tempbx >= SiS_Pr->SiS_VT) tempbx -= SiS_Pr->SiS_VT;
 
-      if(SiS_CRT2IsLCD(SiS_Pr,BaseAddr,HwDeviceExtension)) {
-         if(HwDeviceExtension->jChipType == SIS_730) {
-	    SiS_SetPanelDelay(SiS_Pr,ROMAddr, HwDeviceExtension, 1);
-	    SiS_SetPanelDelay(SiS_Pr,ROMAddr, HwDeviceExtension, 1);
-	    SiS_SetPanelDelay(SiS_Pr,ROMAddr, HwDeviceExtension, 1);
-	 }
-         SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x11,0xFB);
-	 if(!(SiS_CR36BIOSWord23d(SiS_Pr,HwDeviceExtension))) {
-	    SiS_SetPanelDelay(SiS_Pr,ROMAddr, HwDeviceExtension, 0);
-	 }
-      }
+  temp = tempbx & 0x00FF;
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,temp);       	 /* Part1_18h; Panel Link Vertical Retrace Start  */
 
-      SiS_EnableCRT2(SiS_Pr);
-      SiS_DisplayOn(SiS_Pr);
-      SiS_UnLockCRT2(SiS_Pr,HwDeviceExtension, BaseAddr);
-      SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x02,0xBF);
-      if(SiS_BridgeInSlave(SiS_Pr)) {
-      	SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x01,0x1F);
-      } else {
-      	SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x01,0x1F,0x40);
-      }
+  tempcx >>= 3;
 
-      if(SiS_Pr->SiS_IF_DEF_CH70xx == 1) {
-        if(!(SiS_CRT2IsLCD(SiS_Pr,BaseAddr,HwDeviceExtension))) {
-	        SiS_SetCH700x(SiS_Pr,0x0B0E);
+  if((!(SiS_Pr->SiS_LCDInfo & LCDPass11)) &&
+     (SiS_Pr->SiS_CustomT != CUT_BARCO1366) &&
+     (SiS_Pr->SiS_CustomT != CUT_BARCO1024) &&
+     (SiS_Pr->SiS_CustomT != CUT_PANEL848)) {
+     if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
+        if( (HwInfo->jChipType < SIS_315H) &&
+            (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480) )     tempcx = 0x0001;
+	else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480_2)  tempcx = 0x0002;
+	else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480_3)  tempcx = 0x0002;
+        else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel800x600)    tempcx = 0x0003;
+        else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x600)   tempcx = 0x0005;
+        else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1152x768)   tempcx = 0x0005;
+	else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x768)   tempcx = 0x0011;
+        else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024)  tempcx = 0x0005;
+        else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050)  tempcx = 0x0002;
+        else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200)  tempcx = 0x0011;
+        else if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel640x480)  {
+     		if(HwInfo->jChipType < SIS_315H) {
+		   if(SiS_Pr->SiS_VBType & VB_SISVB) {
+		      tempcx = 0x0004;   /* A901; Other BIOS sets 0x0005; */
+		   } else {
+		      tempcx = 0x0004;
+#ifdef TWNEWPANEL
+		      tempcx = 0x0005;
+#endif
+		   }
+		} else {
+		   tempcx = 0x0005;
+		}
         }
-      }
-
-      if(SiS_CRT2IsLCD(SiS_Pr,BaseAddr,HwDeviceExtension)) {
-          if(!(SiS_GetReg1(SiS_Pr->SiS_P3c4,0x13) & 0x40)) {
-              if(!(SiS_GetReg1(SiS_Pr->SiS_P3c4,0x16) & 0x10)) {
-	          if(!(SiS_CR36BIOSWord23b(SiS_Pr,HwDeviceExtension))) {
-			SiS_SetPanelDelay(SiS_Pr,ROMAddr, HwDeviceExtension, 1);
-        		SiS_SetPanelDelay(SiS_Pr,ROMAddr, HwDeviceExtension, 1);
-		  }
-		  SiS_WaitVBRetrace(SiS_Pr,HwDeviceExtension);
-                  SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x11,0xF7);
-              }
-	  }
-      }
+     }
+  }
 
-#endif  /* SIS300 */
+  tempcx = tempcx + tempbx + 1;                  /* BPLVRE  */
+  temp = tempcx & 0x000F;
+  if(SiS_Pr->SiS_IF_DEF_FSTN ||
+     SiS_Pr->SiS_IF_DEF_DSTN ||
+     (SiS_Pr->SiS_CustomT == CUT_BARCO1366) ||
+     (SiS_Pr->SiS_CustomT == CUT_BARCO1024) ||
+     (SiS_Pr->SiS_CustomT == CUT_PANEL848)) {
+     temp |= 0x30;
+  }
+  SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0xf0,temp); /* Part1_19h; Panel Link Vertical Retrace End (3:0); Misc.  */
 
-    } else {
+  temp = ((tempbx & 0x0700) >> 8) << 3;          /* BPLDESKEW =0 */
+  if(SiS_Pr->SiS_IF_DEF_FSTN || SiS_Pr->SiS_IF_DEF_DSTN) {
+     if(SiS_Pr->SiS_HDE != 640) {
+        if(SiS_Pr->SiS_VGAVDE != SiS_Pr->SiS_VDE)   temp |= 0x40;
+     }
+  } else if(SiS_Pr->SiS_VGAVDE != SiS_Pr->SiS_VDE)  temp |= 0x40;
+  if(SiS_Pr->SiS_SetFlag & EnableLVDSDDA)           temp |= 0x40;
+  if(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit) {
+     if(HwInfo->jChipType >= SIS_315H) {
+        if(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0x01) {
+           temp |= 0x80;
+        }
+     } else {
+	if( (HwInfo->jChipType == SIS_630) ||
+	    (HwInfo->jChipType == SIS_730) ) {
+	   if(HwInfo->jChipRevision >= 0x30) {
+	      temp |= 0x80;
+	   }
+	}
+     }
+  }
+  SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x1A,0x87,temp);  /* Part1_1Ah; Panel Link Control Signal (7:3); Vertical Retrace Start (2:0) */
 
-#ifdef SIS315H    /* 310/325 series */
+  if (HwInfo->jChipType < SIS_315H) {
 
-#if 0  /* BIOS code makes no sense */
-       if(SiS_IsVAMode()) {
-          if(SiS_IsLCDOrLCDA()) {
-	  }
-       }
-#endif
+#ifdef SIS300      /* 300 series */
 
-       if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) {
-	    if(SiS_CRT2IsLCD(SiS_Pr,BaseAddr,HwDeviceExtension)) {
-	     	SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x11,0xFB);
-	        SiS_SetPanelDelay(SiS_Pr, ROMAddr, HwDeviceExtension, 0);
-            }
-       }
+        tempeax = SiS_Pr->SiS_VGAVDE << 6;
+        temp = (USHORT)(tempeax % (ULONG)SiS_Pr->SiS_VDE);
+        tempeax = tempeax / (ULONG)SiS_Pr->SiS_VDE;
+        if(temp != 0) tempeax++;
+        tempebx = tempeax;                         /* BPLVCFACT  */
 
-       SiS_EnableCRT2(SiS_Pr);
-       SiS_UnLockCRT2(SiS_Pr,HwDeviceExtension, BaseAddr);
+  	if(SiS_Pr->SiS_SetFlag & EnableLVDSDDA) {
+	   tempebx = 0x003F;
+	}
 
-       SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2e,0xf7);
+  	temp = (USHORT)(tempebx & 0x00FF);
+  	SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1E,temp);      /* Part1_1Eh; Panel Link Vertical Scaling Factor */
 
-       if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) {
-          temp = SiS_GetCH701x(SiS_Pr,0x66);
-	  temp &= 0x20;
-	  SiS_Chrontel701xBLOff(SiS_Pr);
-       }
+#endif /* SIS300 */
 
-       SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2e,0x7f);
-       
-#ifdef NEWCH701x
-       if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) {
-           if(SiS_IsLCDOrLCDA(SiS_Pr,HwDeviceExtension,BaseAddr)) {
-	   	SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1E,0x20);
-	   }
-       }
-#endif       
+  } else {
 
-       temp1 = SiS_GetReg1(SiS_Pr->SiS_Part1Port,0x2E);
-       if (!(temp1 & 0x80))
-           SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2E,0x80);
+#ifdef SIS315H  /* 315 series */
 
-       if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) {
-           if(temp) {
-	       SiS_Chrontel701xBLOn(SiS_Pr);
-	   }
-       }
+        if(HwInfo->jChipType == SIS_740) {
+           SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1E,0x03);
+        } else {
+	   SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1E,0x23);
+	}
 
-       if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) {
-           if(SiS_CRT2IsLCD(SiS_Pr,BaseAddr,HwDeviceExtension)) {
-	   	SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1E,0x20);
-	   }
-       } 
-#ifndef NEWCH701x       
-         else if(SiS_IsVAMode(SiS_Pr,HwDeviceExtension, BaseAddr)) {
-           SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1E,0x20);
-       }
-#endif       
+	tempeax = SiS_Pr->SiS_VGAVDE << 18;
+    	temp = (USHORT)(tempeax % (ULONG)SiS_Pr->SiS_VDE);
+    	tempeax = tempeax / SiS_Pr->SiS_VDE;
+    	if(temp != 0) tempeax++;
+    	tempebx = tempeax;                         /* BPLVCFACT  */
+        tempvcfact = tempeax;
+    	temp = (USHORT)(tempebx & 0x00FF);
+    	SiS_SetReg(SiS_Pr->SiS_Part1Port,0x37,temp);      /* Part1_37h; Panel Link Vertical Scaling Factor */
+    	temp = (USHORT)((tempebx & 0x00FF00) >> 8);
+    	SiS_SetReg(SiS_Pr->SiS_Part1Port,0x36,temp);      /* Part1_36h; Panel Link Vertical Scaling Factor */
+    	temp = (USHORT)((tempebx & 0x00030000) >> 16);
+	temp &= 0x03;
+    	if(SiS_Pr->SiS_VDE == SiS_Pr->SiS_VGAVDE) temp |= 0x04;
+    	SiS_SetReg(SiS_Pr->SiS_Part1Port,0x35,temp);      /* Part1_35h; Panel Link Vertical Scaling Factor */
 
-       if(!(SiS_WeHaveBacklightCtrl(SiS_Pr,HwDeviceExtension, BaseAddr))) {
-           SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x00,0x7f);
-       }
+#endif /* SIS315H */
 
-       if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) {
+  }
 
-       		if(SiS_IsTVOrYPbPrOrScart(SiS_Pr,HwDeviceExtension, BaseAddr)) {
-           		SiS_Chrontel701xOn(SiS_Pr,HwDeviceExtension, BaseAddr);
-         	}
-
-         	if(SiS_IsVAMode(SiS_Pr,HwDeviceExtension, BaseAddr)) {
-           		SiS_ChrontelDoSomething1(SiS_Pr,HwDeviceExtension, BaseAddr);
-         	} else if(SiS_IsLCDOrLCDA(SiS_Pr,HwDeviceExtension, BaseAddr)) {
-           		SiS_ChrontelDoSomething1(SiS_Pr,HwDeviceExtension, BaseAddr);
-        	}
+  tempbx = push2;                                  /* BPLVDEE  */
+  tempcx = push1;
 
-       }
+  push1 = temp;
 
-       if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) {
-       	 	if(!(SiS_WeHaveBacklightCtrl(SiS_Pr,HwDeviceExtension, BaseAddr))) {
- 	   		if(SiS_IsVAMode(SiS_Pr,HwDeviceExtension, BaseAddr)) {
-	            		SiS_Chrontel701xBLOn(SiS_Pr);
-	            		SiS_ChrontelDoSomething4(SiS_Pr,HwDeviceExtension, BaseAddr);
-           		} else if(SiS_IsLCDOrLCDA(SiS_Pr,HwDeviceExtension, BaseAddr))  {
-       				SiS_Chrontel701xBLOn(SiS_Pr);
-       				SiS_ChrontelDoSomething4(SiS_Pr,HwDeviceExtension, BaseAddr);
-	   		}
-       		}
-       } else if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) {
-       		if(!(SiS_WeHaveBacklightCtrl(SiS_Pr,HwDeviceExtension, BaseAddr))) {
-			if(SiS_CRT2IsLCD(SiS_Pr,BaseAddr,HwDeviceExtension)) {
-				SiS_SetPanelDelay(SiS_Pr, ROMAddr, HwDeviceExtension, 1);
-				SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x11,0xF7);
+  if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) {
+   	if(!SiS_Pr->SiS_IF_DEF_FSTN && !SiS_Pr->SiS_IF_DEF_DSTN) {
+		if(HwInfo->jChipType < SIS_315H) {
+			if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x600) {
+      				if(resinfo == SIS_RI_1024x600) tempcx++;
+				if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) {
+					if(resinfo == SIS_RI_800x600) tempcx++;
+		    		}
+			} else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel800x600) {
+      				if(resinfo == SIS_RI_800x600)  tempcx++;
+				if(resinfo == SIS_RI_1024x768) tempcx++; /* Doesnt make sense anyway... */
+			} else  if(resinfo == SIS_RI_1024x768) tempcx++;
+		} else {
+			if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel800x600) {
+      				if(resinfo == SIS_RI_800x600)  tempcx++;
 			}
 		}
-       }
+	}
+  }
 
-#endif  /* SIS315H */
+  if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480) {
+     if((!SiS_Pr->SiS_IF_DEF_FSTN) && (!SiS_Pr->SiS_IF_DEF_DSTN)) {
+        tempcx = SiS_Pr->SiS_VGAVDE;
+        tempbx = SiS_Pr->SiS_VGAVDE - 1;
+     }
+  }
 
-    } /* 310 series */
+  temp = ((tempbx & 0x0700) >> 8) << 3;
+  temp |= ((tempcx & 0x0700) >> 8);
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1D,temp);     	/* Part1_1Dh; Vertical Display Overflow; Control Signal */
 
-  }  /* LVDS */
+  temp = tempbx & 0x00FF;
+  /* if(SiS_Pr->SiS_IF_DEF_FSTN) temp++;  */
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1C,temp);      	/* Part1_1Ch; Panel Link Vertical Display Enable End  */
 
-}
+  temp = tempcx & 0x00FF;
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1B,temp);      	/* Part1_1Bh; Panel Link Vertical Display Enable Start  */
 
-void
-SiS_SiS30xBLOn(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension)
-{
-  USHORT  BaseAddr = (USHORT)HwDeviceExtension->ulIOAddress;
+  /* 3. Additional horizontal setup (scaling, etc) */
 
-  /* TW: Switch on LCD backlight on SiS30xLV */
-  if( (SiS_IsVAMode(SiS_Pr,HwDeviceExtension, BaseAddr)) ||
-      (SiS_CRT2IsLCD(SiS_Pr,BaseAddr,HwDeviceExtension)) ) {
-    if(!(SiS_GetReg1(SiS_Pr->SiS_Part4Port,0x26) & 0x02)) {
-	SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x26,0x02);
-	SiS_WaitVBRetrace(SiS_Pr,HwDeviceExtension);
-    }
-    if(!(SiS_GetReg1(SiS_Pr->SiS_Part4Port,0x26) & 0x01)) {
-        SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x26,0x01);
-    }
+  tempecx = SiS_Pr->SiS_VGAHDE;
+  if(HwInfo->jChipType >= SIS_315H) {
+     if((!SiS_Pr->SiS_IF_DEF_FSTN) && (!SiS_Pr->SiS_IF_DEF_DSTN)) {
+        if(modeflag & HalfDCLK) tempecx >>= 1;
+     }
   }
-}
-
-void
-SiS_SiS30xBLOff(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension)
-{
-  USHORT  BaseAddr = (USHORT)HwDeviceExtension->ulIOAddress;
+  tempebx = SiS_Pr->SiS_HDE;
+  if(tempecx == tempebx) tempeax = 0xFFFF;
+  else {
+     tempeax = tempecx;
+     tempeax <<= 16;
+     temp = (USHORT)(tempeax % tempebx);
+     tempeax = tempeax / tempebx;
+     if(HwInfo->jChipType >= SIS_315H) {
+        if(temp) tempeax++;
+     }
+  }
+  tempecx = tempeax;
 
-  /* TW: Switch off LCD backlight on SiS30xLV */
-  if( (!(SiS_IsDualEdge(SiS_Pr,HwDeviceExtension, BaseAddr))) ||
-      (SiS_IsVAMode(SiS_Pr,HwDeviceExtension, BaseAddr)) ) {
-	 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x26,0xFE,0x00);
+  if(HwInfo->jChipType >= SIS_315H) {
+     tempeax = SiS_Pr->SiS_VGAHDE;
+     if((!SiS_Pr->SiS_IF_DEF_FSTN) && (!SiS_Pr->SiS_IF_DEF_DSTN)) {
+        if(modeflag & HalfDCLK) tempeax >>= 1;
+     }
+     tempeax <<= 16;
+     tempeax = (tempeax / tempecx) - 1;
+  } else {
+     tempeax = ((SiS_Pr->SiS_VGAHT << 16) / tempecx) - 1;
   }
+  tempecx <<= 16;
+  tempecx |= (tempeax & 0xFFFF);
+  temp = (USHORT)(tempecx & 0x00FF);
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1F,temp);  	 /* Part1_1Fh; Panel Link DDA Operational Number in each horiz. line */
 
-  if(!(SiS_IsVAMode(SiS_Pr,HwDeviceExtension, BaseAddr))) {
-      if(!(SiS_CRT2IsLCD(SiS_Pr,BaseAddr,HwDeviceExtension))) {
-          if(!(SiS_IsDualEdge(SiS_Pr,HwDeviceExtension, BaseAddr))) {
-  	      SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x26,0xFD,0x00);
-          }
-      }
+  tempbx = SiS_Pr->SiS_VDE;
+  if(HwInfo->jChipType >= SIS_315H) {
+     tempeax = (SiS_Pr->SiS_VGAVDE << 18) / tempvcfact;
+     tempbx = (USHORT)(tempeax & 0x0FFFF);
+  } else {
+     tempeax = SiS_Pr->SiS_VGAVDE << 6;
+     tempbx = push1 & 0x3f;
+     if(tempbx == 0) tempbx = 64;
+     tempeax /= tempbx;
+     tempbx = (USHORT)(tempeax & 0x0FFFF);
+  }
+  if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) tempbx--;
+  if(SiS_Pr->SiS_SetFlag & EnableLVDSDDA) {
+     if((!SiS_Pr->SiS_IF_DEF_FSTN) && (!SiS_Pr->SiS_IF_DEF_DSTN)) tempbx = 1;
+     else if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel640x480)  tempbx = 1;
   }
-}
 
-BOOLEAN
-SiS_CR36BIOSWord23b(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension)
-{
-  USHORT temp,temp1;
-  UCHAR *ROMAddr;
+  temp = ((tempbx & 0xFF00) >> 8) << 3;
+  temp |= (USHORT)((tempecx & 0x0700) >> 8);
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x20,temp);  	/* Part1_20h; Overflow register */
 
-  if((ROMAddr = (UCHAR *)HwDeviceExtension->pjVirtualRomBase) && SiS_Pr->SiS_UseROM) {
-     temp = SiS_GetReg1(SiS_Pr->SiS_P3d4,0x36) & 0xff;
-     temp >>= 4;
-     temp = 1 << temp;
-     temp1 = (ROMAddr[0x23c] << 8) | ROMAddr[0x23b];
-     if(temp1 & temp) return(1);
-     else return(0);
-  } else {
-     return(0);
+  temp = tempbx & 0x00FF;
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x21,temp);  	/* Part1_21h; Panel Link Vertical Accumulator Register */
+
+  tempecx >>= 16;                               /* BPLHCFACT  */
+  if((HwInfo->jChipType < SIS_315H) || (SiS_Pr->SiS_IF_DEF_FSTN) || (SiS_Pr->SiS_IF_DEF_DSTN)) {
+     if(modeflag & HalfDCLK) tempecx >>= 1;
   }
-}
+  temp = (USHORT)((tempecx & 0xFF00) >> 8);
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x22,temp);     	/* Part1_22h; Panel Link Horizontal Scaling Factor High */
 
-BOOLEAN
-SiS_CR36BIOSWord23d(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension)
-{
-  USHORT temp,temp1;
-  UCHAR *ROMAddr;
+  temp = (USHORT)(tempecx & 0x00FF);
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x23,temp);         /* Part1_22h; Panel Link Horizontal Scaling Factor Low */
 
-  if((ROMAddr = (UCHAR *)HwDeviceExtension->pjVirtualRomBase) && SiS_Pr->SiS_UseROM) {
-     temp = SiS_GetReg1(SiS_Pr->SiS_P3d4,0x36) & 0xff;
-     temp >>= 4;
-     temp = 1 << temp;
-     temp1 = (ROMAddr[0x23e] << 8) | ROMAddr[0x23d];
-     if(temp1 & temp) return(1);
-     else return(0);
-  } else {
-     return(0);
+  /* 630/301B and 630/LVDS do something for 640x480 panels here */
+
+#ifdef SIS315H
+  if(SiS_Pr->SiS_IF_DEF_FSTN || SiS_Pr->SiS_IF_DEF_DSTN) {
+     SiS_SetReg(SiS_Pr->SiS_Part1Port,0x25,0x00);
+     SiS_SetReg(SiS_Pr->SiS_Part1Port,0x26,0x00);
+     SiS_SetReg(SiS_Pr->SiS_Part1Port,0x27,0x00);
+     SiS_SetReg(SiS_Pr->SiS_Part1Port,0x28,0x87);
+     SiS_SetReg(SiS_Pr->SiS_Part1Port,0x29,0x5A);
+     SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2A,0x4B);
+     SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x44,~0x007,0x03);
+     tempax = SiS_Pr->SiS_HDE;                       		/* Blps = lcdhdee(lcdhdes+HDE) + 64 */
+     if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480_2 ||
+        SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480_3) tempax >>= 1;
+     tempax += 64;
+     temp = tempax & 0x00FF;
+     SiS_SetReg(SiS_Pr->SiS_Part1Port,0x38,temp);
+     temp = ((tempax & 0xFF00) >> 8) << 3;
+     SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x35,~0x078,temp);
+     tempax += 32;		                     		/* Blpe=lBlps+32 */
+     temp = tempax & 0x00FF;
+     if(SiS_Pr->SiS_IF_DEF_FSTN) temp = 0;
+     SiS_SetReg(SiS_Pr->SiS_Part1Port,0x39,temp);
+     SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3A,0x00);        	/* Bflml=0 */
+     SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x3C,~0x007,0x00);
+
+     tempax = SiS_Pr->SiS_VDE;
+     if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480_2 ||
+        SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480_3) tempax >>= 1;
+     tempax >>= 1;
+     temp = tempax & 0x00FF;
+     SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3B,temp);
+     temp = ((tempax & 0xFF00) >> 8) << 3;
+     SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x3C,~0x038,temp);
+
+     tempeax = SiS_Pr->SiS_HDE;
+     if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480_2 ||
+        SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480_3) tempeax >>= 1;
+     tempeax <<= 2;                       			/* BDxFIFOSTOP = (HDE*4)/128 */
+     tempebx = 128;
+     temp = (USHORT)(tempeax % tempebx);
+     tempeax = tempeax / tempebx;
+     if(temp) tempeax++;
+     temp = (USHORT)(tempeax & 0x003F);
+     SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x45,~0x0FF,temp);
+     SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3F,0x00);         	/* BDxWadrst0 */
+     SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3E,0x00);
+     SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3D,0x10);
+     SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x3C,~0x040,0x00);
+
+     tempax = SiS_Pr->SiS_HDE;
+     if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480_2 ||
+        SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480_3) tempax >>= 1;
+     tempax >>= 4;                        			/* BDxWadroff = HDE*4/8/8 */
+     pushcx = tempax;
+     temp = tempax & 0x00FF;
+     SiS_SetReg(SiS_Pr->SiS_Part1Port,0x43,temp);
+     temp = ((tempax & 0xFF00) >> 8) << 3;
+     SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x44,~0x0F8,temp);
+
+     tempax = SiS_Pr->SiS_VDE;                             	/* BDxWadrst1 = BDxWadrst0 + BDxWadroff * VDE */
+     if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480_2 ||
+        SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480_3) tempax >>= 1;
+     tempeax = (tempax * pushcx);
+     tempebx = 0x00100000 + tempeax;
+     temp = (USHORT)tempebx & 0x000000FF;
+     SiS_SetReg(SiS_Pr->SiS_Part1Port,0x42,temp);
+     temp = (USHORT)((tempebx & 0x0000FF00) >> 8);
+     SiS_SetReg(SiS_Pr->SiS_Part1Port,0x41,temp);
+     temp = (USHORT)((tempebx & 0x00FF0000) >> 16);
+     SiS_SetReg(SiS_Pr->SiS_Part1Port,0x40,temp);
+     temp = (USHORT)(((tempebx & 0x01000000) >> 24) << 7);
+     SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x3C,~0x080,temp);
+
+     SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2F,0x03);
+     SiS_SetReg(SiS_Pr->SiS_Part1Port,0x03,0x50);
+     SiS_SetReg(SiS_Pr->SiS_Part1Port,0x04,0x00);
+     SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2F,0x01);
+     SiS_SetReg(SiS_Pr->SiS_Part1Port,0x19,0x38);
+
+     if(SiS_Pr->SiS_IF_DEF_FSTN) {
+        SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2b,0x02);
+        SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2c,0x00);
+        SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2d,0x00);
+        SiS_SetReg(SiS_Pr->SiS_Part1Port,0x35,0x0c);
+        SiS_SetReg(SiS_Pr->SiS_Part1Port,0x36,0x00);
+        SiS_SetReg(SiS_Pr->SiS_Part1Port,0x37,0x00);
+        SiS_SetReg(SiS_Pr->SiS_Part1Port,0x38,0x80);
+        SiS_SetReg(SiS_Pr->SiS_Part1Port,0x39,0xA0);
+        SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3a,0x00);
+        SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3b,0xf0);
+        SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3c,0x00);
+        SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3d,0x10);
+        SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3e,0x00);
+        SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3f,0x00);
+        SiS_SetReg(SiS_Pr->SiS_Part1Port,0x40,0x10);
+        SiS_SetReg(SiS_Pr->SiS_Part1Port,0x41,0x25);
+        SiS_SetReg(SiS_Pr->SiS_Part1Port,0x42,0x80);
+        SiS_SetReg(SiS_Pr->SiS_Part1Port,0x43,0x14);
+        SiS_SetReg(SiS_Pr->SiS_Part1Port,0x44,0x03);
+        SiS_SetReg(SiS_Pr->SiS_Part1Port,0x45,0x0a);
+     }
   }
-}
+#endif  /* SIS315H */
 
-void
-SiS_SetPanelDelayLoop(SiS_Private *SiS_Pr, UCHAR *ROMAddr, PSIS_HW_DEVICE_INFO HwDeviceExtension,
-                      USHORT DelayTime, USHORT DelayLoop)
-{
-   int i;
-   for(i=0; i<DelayLoop; i++) {
-      SiS_SetPanelDelay(SiS_Pr, ROMAddr, HwDeviceExtension, DelayTime);
-   }
-}		     
+}
 
-void
-SiS_SetPanelDelay(SiS_Private *SiS_Pr, UCHAR *ROMAddr, PSIS_HW_DEVICE_INFO HwDeviceExtension,
-                  USHORT DelayTime)
+/************** Set Part 1 ***************/
+static void
+SiS_SetGroup1(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
+              PSIS_HW_INFO HwInfo, USHORT RefreshRateTableIndex)
 {
-  USHORT PanelID, DelayIndex, Delay;
-#ifdef SIS300
-  USHORT temp;
+  UCHAR  *ROMAddr  = HwInfo->pjVirtualRomBase;
+  USHORT  temp=0, tempax=0, tempbx=0, tempcx=0;
+  USHORT  pushbx=0, CRT1Index=0;
+#ifdef SIS315H
+  USHORT  tempbl=0;
 #endif
+  USHORT  modeflag, resinfo=0;
 
-  if(HwDeviceExtension->jChipType < SIS_315H) {
-
-#ifdef SIS300
+  if(ModeNo <= 0x13) {
+     modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
+  } else {
+     if(SiS_Pr->UseCustomMode) {
+	modeflag = SiS_Pr->CModeFlag;
+     } else {
+    	CRT1Index = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT1CRTC;
+    	resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO;
+	modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
+     }
+  }
 
-      if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {			/* 300 series, LVDS */
+  if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) {
 
-	  PanelID = SiS_GetReg1(SiS_Pr->SiS_P3d4,0x36);
+#ifdef SIS315H
+     SiS_SetCRT2Sync(SiS_Pr, ModeNo, RefreshRateTableIndex, HwInfo);
+     SiS_SetGroup1_LCDA(SiS_Pr, ModeNo, ModeIdIndex, HwInfo, RefreshRateTableIndex);
+#endif
 
-	  DelayIndex = PanelID >> 4;
+  } else {
 
-	  if((DelayTime >= 2) && ((PanelID & 0x0f) == 1))  {
-              Delay = 3;
-          } else {
-              if(DelayTime >= 2) DelayTime -= 2;
+     if( (HwInfo->jChipType >= SIS_315H) &&
+         (SiS_Pr->SiS_IF_DEF_LVDS == 1) &&
+	 (SiS_Pr->SiS_VBInfo & SetInSlaveMode) ) {
 
-              if(!(DelayTime & 0x01)) {
-       		  Delay = SiS_Pr->SiS_PanelDelayTbl[DelayIndex].timer[0];
-              } else {
-       		  Delay = SiS_Pr->SiS_PanelDelayTbl[DelayIndex].timer[1];
-              }
-	      if((ROMAddr) && (SiS_Pr->SiS_UseROM)) {
-                  if(ROMAddr[0x220] & 0x40) {
-                      if(!(DelayTime & 0x01)) {
-	    	          Delay = (USHORT)ROMAddr[0x225];
-                      } else {
-	    	          Delay = (USHORT)ROMAddr[0x226];
-                      }
-                  }
-              }
-          }
-	  SiS_ShortDelay(SiS_Pr,Delay);
+        SiS_SetCRT2Sync(SiS_Pr, ModeNo, RefreshRateTableIndex, HwInfo);
 
-      } else {							/* 300 series, 301(B) */
+     } else {
 
-	  PanelID = SiS_GetReg1(SiS_Pr->SiS_P3d4,0x36);
-	  temp = SiS_GetReg1(SiS_Pr->SiS_P3c4,0x18);
-          if(!(temp & 0x10))  PanelID = 0x12;
+        SiS_SetCRT2Offset(SiS_Pr, ModeNo, ModeIdIndex,
+      		          RefreshRateTableIndex, HwInfo);
 
-          DelayIndex = PanelID >> 4;
+        if (HwInfo->jChipType < SIS_315H ) {
+#ifdef SIS300
+    	      SiS_SetCRT2FIFO_300(SiS_Pr, ModeNo, HwInfo);
+#endif
+        } else {
+#ifdef SIS315H
+              SiS_SetCRT2FIFO_310(SiS_Pr);
+#endif
+	}
 
-	  if((DelayTime >= 2) && ((PanelID & 0x0f) == 1))  {
-              Delay = 3;
-          } else {
-              if(DelayTime >= 2) DelayTime -= 2;
+        SiS_SetCRT2Sync(SiS_Pr, ModeNo, RefreshRateTableIndex, HwInfo);
 
-              if(!(DelayTime & 0x01)) {
-       		  Delay = SiS_Pr->SiS_PanelDelayTbl[DelayIndex].timer[0];
-              } else {
-       		  Delay = SiS_Pr->SiS_PanelDelayTbl[DelayIndex].timer[1];
-              }
-	      if((ROMAddr) && (SiS_Pr->SiS_UseROM)) {
-                  if(ROMAddr[0x220] & 0x40) {
-                      if(!(DelayTime & 0x01)) {
-	    	          Delay = (USHORT)ROMAddr[0x225];
-                      } else {
-	    	          Delay = (USHORT)ROMAddr[0x226];
-                      }
-                  }
-              }
-          }
-	  SiS_ShortDelay(SiS_Pr,Delay);
+	/* 1. Horizontal setup */
 
-      }
+        if(HwInfo->jChipType < SIS_315H ) {
 
-#endif  /* SIS300 */
+#ifdef SIS300   /* ------------- 300 series --------------*/
 
-   } else {
+    		temp = (SiS_Pr->SiS_VGAHT - 1) & 0x0FF;   			/* BTVGA2HT 0x08,0x09 */
+    		SiS_SetReg(SiS_Pr->SiS_Part1Port,0x08,temp);                   /* CRT2 Horizontal Total */
 
-      if(HwDeviceExtension->jChipType == SIS_330) return;
+    		temp = (((SiS_Pr->SiS_VGAHT - 1) & 0xFF00) >> 8) << 4;
+    		SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x09,0x0f,temp);          /* CRT2 Horizontal Total Overflow [7:4] */
 
-#ifdef SIS315H
+    		temp = (SiS_Pr->SiS_VGAHDE + 12) & 0x0FF;                       /* BTVGA2HDEE 0x0A,0x0C */
+    		SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0A,temp);                   /* CRT2 Horizontal Display Enable End */
 
-      if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {			/* 310/325 series, LVDS */
+    		pushbx = SiS_Pr->SiS_VGAHDE + 12;                               /* bx  BTVGA@HRS 0x0B,0x0C */
+    		tempcx = (SiS_Pr->SiS_VGAHT - SiS_Pr->SiS_VGAHDE) >> 2;
+    		tempbx = pushbx + tempcx;
+    		tempcx <<= 1;
+    		tempcx += tempbx;
 
-          if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) {
-              PanelID = SiS_GetReg1(SiS_Pr->SiS_P3d4,0x36);
-	      DelayIndex = PanelID >> 4;
-	      if((DelayTime >= 2) && ((PanelID & 0x0f) == 1))  {
-                 Delay = 3;
-              } else {
-                 if(DelayTime >= 2) DelayTime -= 2;
+    		if(SiS_Pr->SiS_VBType & VB_SISVB) {
 
-                 if(!(DelayTime & 0x01)) {
-       		     Delay = SiS_Pr->SiS_PanelDelayTblLVDS[DelayIndex].timer[0];
-                 } else {
-       		     Delay = SiS_Pr->SiS_PanelDelayTblLVDS[DelayIndex].timer[1];
-                 }
-	         if((ROMAddr) && (SiS_Pr->SiS_UseROM)) {
-                    if(ROMAddr[0x13c] & 0x40) {
-                        if(!(DelayTime & 0x01)) {
-	    	           Delay = (USHORT)ROMAddr[0x17e];
-                        } else {
-	    	           Delay = (USHORT)ROMAddr[0x17f];
-                        }
-                    }
-                 }
-              }
-	      SiS_ShortDelay(SiS_Pr,Delay);
-	  }
+		   if(SiS_Pr->UseCustomMode) {
+		      tempbx = SiS_Pr->CHSyncStart + 12;
+		      tempcx = SiS_Pr->CHSyncEnd + 12;
+		   }
 
-      } else {							/* 310/325 series, 301(B) */
+      		   if(SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC) {
+		      unsigned char cr4, cr14, cr5, cr15;
+		      if(SiS_Pr->UseCustomMode) {
+		         cr4  = SiS_Pr->CCRT1CRTC[4];
+			 cr14 = SiS_Pr->CCRT1CRTC[14];
+			 cr5  = SiS_Pr->CCRT1CRTC[5];
+			 cr15 = SiS_Pr->CCRT1CRTC[15];
+		      } else {
+		         cr4  = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[4];
+			 cr14 = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[14];
+			 cr5  = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[5];
+			 cr15 = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[15];
+		      }
+        	      tempbx = ((cr4 | ((cr14 & 0xC0) << 2)) - 1) << 3;
+        	      tempcx = (((cr5 & 0x1F) | ((cr15 & 0x04) << (6-2))) - 1) << 3;
+      		   }
 
-          PanelID = SiS_GetReg1(SiS_Pr->SiS_P3d4,0x36);
-	  DelayIndex = PanelID >> 4;
-          if(!(DelayTime & 0x01)) {
-       		Delay = SiS_Pr->SiS_PanelDelayTbl[DelayIndex].timer[0];
-          } else {
-       		Delay = SiS_Pr->SiS_PanelDelayTbl[DelayIndex].timer[1];
-          }
-	  SiS_DDC2Delay(SiS_Pr, Delay * 4);
+    		   if((SiS_Pr->SiS_VBInfo & SetCRT2ToTV) && (resinfo == SIS_RI_1024x768)){
+        	      if(!(SiS_Pr->SiS_TVMode & TVSetPAL)){
+      			 tempbx = 1040;
+      			 tempcx = 1042;
+      		      }
+    		   }
+	        }
 
-      }
+    		temp = tempbx & 0x00FF;
+    		SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0B,temp);                   /* CRT2 Horizontal Retrace Start */
+#endif /* SIS300 */
 
-#endif /* SIS315H */
+ 	} else {
 
-   }
+#ifdef SIS315H  /* ------------------- 315/330 series --------------- */
 
-}
+	        tempcx = SiS_Pr->SiS_VGAHT;				       /* BTVGA2HT 0x08,0x09 */
+		if(modeflag & HalfDCLK) {
+		    if(SiS_Pr->SiS_VBType & VB_SISVB) {
+		       tempcx >>= 1;
+		    } else {
+		       tempax = SiS_Pr->SiS_VGAHDE >> 1;
+		       tempcx = SiS_Pr->SiS_HT - SiS_Pr->SiS_HDE + tempax;
+		       if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) {
+			  tempcx = SiS_Pr->SiS_HT - tempax;
+		       }
+		    }
+		}
+		tempcx--;
 
-void
-SiS_LongDelay(SiS_Private *SiS_Pr, USHORT delay)
-{
-  while(delay--) {
-    SiS_GenericDelay(SiS_Pr,0x19df);
-  }
-}
+		temp = tempcx & 0xff;
+		SiS_SetReg(SiS_Pr->SiS_Part1Port,0x08,temp);                  /* CRT2 Horizontal Total */
 
-void
-SiS_ShortDelay(SiS_Private *SiS_Pr, USHORT delay)
-{
-  while(delay--) {
-      SiS_GenericDelay(SiS_Pr,0x42);
-  }
-}
+		temp = ((tempcx & 0xff00) >> 8) << 4;
+		SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x09,0x0F,temp);         /* CRT2 Horizontal Total Overflow [7:4] */
 
-void
-SiS_GenericDelay(SiS_Private *SiS_Pr, USHORT delay)
-{
-  USHORT temp,flag;
+		tempcx = SiS_Pr->SiS_VGAHT;				       /* BTVGA2HDEE 0x0A,0x0C */
+		tempbx = SiS_Pr->SiS_VGAHDE;
+		tempcx -= tempbx;
+		tempcx >>= 2;
+		if(modeflag & HalfDCLK) {
+		   tempbx >>= 1;
+		   tempcx >>= 1;
+		}
+		tempbx += 16;
 
-  flag = SiS_GetReg3(0x61) & 0x10;
+		temp = tempbx & 0xff;
+		SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0A,temp);                  /* CRT2 Horizontal Display Enable End */
 
-  while(delay) {
-      temp = SiS_GetReg3(0x61) & 0x10;
-      if(temp == flag) continue;
-      flag = temp;
-      delay--;
-  }
-}
+		pushbx = tempbx;
+		tempcx >>= 1;
+		tempbx += tempcx;
+		tempcx += tempbx;
 
-BOOLEAN
-SiS_Is301B(SiS_Private *SiS_Pr, USHORT BaseAddr)
-{
-  USHORT flag;
+		if(SiS_Pr->SiS_VBType & VB_SISVB) {
 
-  flag = SiS_GetReg1(SiS_Pr->SiS_Part4Port,0x01);
-  if(flag >= 0x0B0) return(1);
-  else return(0);
-}
+		   if(HwInfo->jChipType >= SIS_661) {
+		      if((SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200) ||
+		         (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024)) {
+			 if(resinfo == SIS_RI_1280x1024) {
+		            tempcx = 0x30;
+			 } else if(resinfo == SIS_RI_1600x1200) {
+			    tempcx = 0xff;
+			 }
+		      }
+		   }
 
-BOOLEAN
-SiS_CRT2IsLCD(SiS_Private *SiS_Pr, USHORT BaseAddr, PSIS_HW_DEVICE_INFO HwDeviceExtension)
-{
-  USHORT flag;
+		   if(SiS_Pr->UseCustomMode) {
+		      tempbx = SiS_Pr->CHSyncStart + 16;
+		      tempcx = SiS_Pr->CHSyncEnd + 16;
+		      tempax = SiS_Pr->SiS_VGAHT;
+		      if(modeflag & HalfDCLK) tempax >>= 1;
+		      tempax--;
+		      if(tempcx > tempax)  tempcx = tempax;
+		   }
 
-  if(HwDeviceExtension->jChipType == SIS_730) {
-     flag = SiS_GetReg1(SiS_Pr->SiS_P3c4,0x13);
-     if(flag & 0x20) return(1);
-  }
-  flag = SiS_GetReg1(SiS_Pr->SiS_P3d4,0x30);
-  if(flag & 0x20) return(1);
-  else return(0);
-}
+             	   if(SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC) {
+		      unsigned char cr4, cr14, cr5, cr15;
+		      if(SiS_Pr->UseCustomMode) {
+		         cr4  = SiS_Pr->CCRT1CRTC[4];
+			 cr14 = SiS_Pr->CCRT1CRTC[14];
+			 cr5  = SiS_Pr->CCRT1CRTC[5];
+			 cr15 = SiS_Pr->CCRT1CRTC[15];
+		      } else {
+		         cr4  = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[4];
+			 cr14 = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[14];
+			 cr5  = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[5];
+			 cr15 = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[15];
+		      }
+                      tempbx = ((cr4 | ((cr14 & 0xC0) << 2)) - 3) << 3; 		/* (VGAHRS-3)*8 */
+                      tempcx = (((cr5 & 0x1f) | ((cr15 & 0x04) << (5-2))) - 3) << 3; 	/* (VGAHRE-3)*8 */
+		      tempcx &= 0x00FF;
+		      tempcx |= (tempbx & 0xFF00);
+                      tempbx += 16;
+                      tempcx += 16;
+		      tempax = SiS_Pr->SiS_VGAHT;
+		      if(modeflag & HalfDCLK) tempax >>= 1;
+		      tempax--;
+		      if(tempcx > tempax)  tempcx = tempax;
+             	   }
 
-BOOLEAN
-SiS_IsDualEdge(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr)
-{
-#ifdef SIS315H
-  USHORT flag;
+		   if(SiS_Pr->SiS_TVMode & TVSetNTSC1024) {
+      		      tempbx = 1040;
+      		      tempcx = 1042;
+      	     	   }
 
-  if(HwDeviceExtension->jChipType >= SIS_315H) {
-     if((HwDeviceExtension->jChipType != SIS_650) || (SiS_GetReg1(SiS_Pr->SiS_P3d4,0x5f) & 0xf0)) {
-        flag = SiS_GetReg1(SiS_Pr->SiS_P3d4,0x38);
-        if(flag & EnableDualEdge) return(1);
-        else return(0);
-     } else return(0);
-  } else
-#endif
-     return(0);
-}
+                }
 
-BOOLEAN
-SiS_IsVAMode(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr)
-{
-#ifdef SIS315H
-  USHORT flag;
+		temp = tempbx & 0xff;
+	 	SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0B,temp);                 /* CRT2 Horizontal Retrace Start */
+#endif  /* SIS315H */
 
-  if(HwDeviceExtension->jChipType >= SIS_315H) {
-     flag = SiS_GetReg1(SiS_Pr->SiS_P3d4,0x38);
-     if((flag & EnableDualEdge) && (flag & SetToLCDA))   return(1);
-#if 0 /* Not done in 650/30xLV 1.10.6s, but in 650/301LV */
-     else if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
-       if(flag) return(1);
-       else     return(0);   			         
-     }
-#endif
-     else
-       return(0);
-  } else
-#endif
-     return(0);
- }
+     	}  /* 315/330 series */
 
-BOOLEAN
-SiS_WeHaveBacklightCtrl(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr)
-{
-#ifdef SIS315H
-  USHORT flag;
+  	/* The following is done for all bridge/chip types/series */
 
-  if(HwDeviceExtension->jChipType >= SIS_315H) {
-     flag = SiS_GetReg1(SiS_Pr->SiS_P3d4,0x79);
-     if(flag & 0x10)  return(1);
-     else             return(0);
-  } else
-#endif
-     return(0);
- }
+  	tempax = tempbx & 0xFF00;
+  	tempbx = pushbx;
+  	tempbx = (tempbx & 0x00FF) | ((tempbx & 0xFF00) << 4);
+  	tempax |= (tempbx & 0xFF00);
+  	temp = (tempax & 0xFF00) >> 8;
+  	SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0C,temp);                        /* Overflow */
 
-#if 0
-BOOLEAN
-SiS_Is315E(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr)
-{
-#ifdef SIS315H
-  USHORT flag;
+  	temp = tempcx & 0x00FF;
+  	SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0D,temp);                        /* CRT2 Horizontal Retrace End */
 
-  if(HwDeviceExtension->jChipType >= SIS_315H) {
-     flag = SiS_GetReg1(SiS_Pr->SiS_P3d4,0x5f);
-     if(flag & 0x10)  return(1);
-     else      	      return(0);
-  } else
-#endif
-     return(0);
-}
-#endif
+  	/* 2. Vertical setup */
 
-BOOLEAN
-SiS_IsNotM650or651(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr)
-{
-#ifdef SIS315H
-  USHORT flag;
+  	tempcx = SiS_Pr->SiS_VGAVT - 1;
+  	temp = tempcx & 0x00FF;
 
-  if(HwDeviceExtension->jChipType == SIS_650) {
-     flag = SiS_GetReg1(SiS_Pr->SiS_P3d4,0x5f);
-     flag &= 0xF0;
-     if((flag == 0xb0) || (flag == 0x90)) return 0;
-     else return 1;
-  } else
-#endif
-    return 1;
-}
+	if(HwInfo->jChipType < SIS_661) {
+           if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
+	      if(HwInfo->jChipType < SIS_315H) {
+	         if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) {
+	            if(SiS_Pr->SiS_VBInfo & (SetCRT2ToSVIDEO | SetCRT2ToAVIDEO)) {
+	               temp--;
+	            }
+                 }
+	      } else {
+ 	         temp--;
+              }
+           } else if(HwInfo->jChipType >= SIS_315H) {
+	      temp--;
+	   }
+	}
+  	SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0E,temp);                        /* CRT2 Vertical Total */
 
-BOOLEAN
-SiS_IsYPbPr(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr)
-{
-#ifdef SIS315H
-  USHORT flag;
+  	tempbx = SiS_Pr->SiS_VGAVDE - 1;
+  	temp = tempbx & 0x00FF;
+  	SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0F,temp);                        /* CRT2 Vertical Display Enable End */
 
-  if(HwDeviceExtension->jChipType >= SIS_315H) {
-     flag = SiS_GetReg1(SiS_Pr->SiS_P3d4,0x38);
-     if(flag & EnableLVDSHiVision)  return(1);  /* = YPrPb = 0x08 */
-     else      	                    return(0);
-  } else
-#endif
-     return(0);
-}
+  	temp = ((tempbx & 0xFF00) << 3) >> 8;
+  	temp |= ((tempcx & 0xFF00) >> 8);
+  	SiS_SetReg(SiS_Pr->SiS_Part1Port,0x12,temp);                        /* Overflow (and HWCursor Test Mode) */
 
-BOOLEAN
-SiS_IsChScart(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr)
-{
-#ifdef SIS315H
-  USHORT flag;
+	if((HwInfo->jChipType >= SIS_315H) && (HwInfo->jChipType < SIS_661)) {
+           tempbx++;
+   	   tempax = tempbx;
+	   tempcx++;
+	   tempcx -= tempax;
+	   tempcx >>= 2;
+	   tempbx += tempcx;
+	   if(tempcx < 4) tempcx = 4;
+	   tempcx >>= 2;
+	   tempcx += tempbx;
+	   tempcx++;
+	} else {
+  	   tempbx = (SiS_Pr->SiS_VGAVT + SiS_Pr->SiS_VGAVDE) >> 1;                 /*  BTVGA2VRS     0x10,0x11   */
+  	   tempcx = ((SiS_Pr->SiS_VGAVT - SiS_Pr->SiS_VGAVDE) >> 4) + tempbx + 1;  /*  BTVGA2VRE     0x11        */
+	}
 
-  if(HwDeviceExtension->jChipType >= SIS_315H) {
-     flag = SiS_GetReg1(SiS_Pr->SiS_P3d4,0x38);
-     if(flag & EnableLVDSScart)     return(1);  /* = Scart = 0x04 */
-     else      	                    return(0);
-  } else
-#endif
-     return(0);
-}
+  	if(SiS_Pr->SiS_VBType & VB_SISVB) {
 
-BOOLEAN
-SiS_IsTVOrYPbPrOrScart(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr)
-{
-  USHORT flag;
+	   if(SiS_Pr->UseCustomMode) {
+	      tempbx = SiS_Pr->CVSyncStart;
+	      tempcx = (tempcx & 0xFF00) | (SiS_Pr->CVSyncEnd & 0x00FF);
+	   }
 
-#ifdef SIS315H
-  if(HwDeviceExtension->jChipType >= SIS_315H) {
-     flag = SiS_GetReg1(SiS_Pr->SiS_P3d4,0x30);
-     if(flag & SetCRT2ToTV)        return(1);
-     flag = SiS_GetReg1(SiS_Pr->SiS_P3d4,0x38);
-     if(flag & EnableLVDSHiVision) return(1);  /* = YPrPb = 0x08 */
-     if(flag & EnableLVDSScart)    return(1);  /* = Scart = 0x04- TW inserted */
-     else                          return(0);
-  } else
-#endif
-  {
-     flag = SiS_GetReg1(SiS_Pr->SiS_P3d4,0x30);
-     if(flag & SetCRT2ToTV) return(1);
-  }
-  return(0);
-}
+    	   if(SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC) {
+	      unsigned char cr8, cr7, cr13, cr9;
+	      if(SiS_Pr->UseCustomMode) {
+	         cr8  = SiS_Pr->CCRT1CRTC[8];
+		 cr7  = SiS_Pr->CCRT1CRTC[7];
+		 cr13 = SiS_Pr->CCRT1CRTC[13];
+		 cr9  = SiS_Pr->CCRT1CRTC[9];
+	      } else {
+	         cr8  = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[8];
+		 cr7  = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[7];
+		 cr13 = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[13];
+		 cr9  = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[9];
+	      }
+      	      tempbx = cr8;
+      	      if(cr7 & 0x04)  tempbx |= 0x0100;
+      	      if(cr7 & 0x80)  tempbx |= 0x0200;
+      	      if(cr13 & 0x08) tempbx |= 0x0400;
+      	      tempcx = (tempcx & 0xFF00) | (cr9 & 0x00FF);
+    	   }
+  	}
+  	temp = tempbx & 0x00FF;
+  	SiS_SetReg(SiS_Pr->SiS_Part1Port,0x10,temp);           /* CRT2 Vertical Retrace Start */
 
-BOOLEAN
-SiS_IsLCDOrLCDA(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr)
-{
-  USHORT flag;
+  	temp = ((tempbx & 0xFF00) >> 8) << 4;
+  	temp |= (tempcx & 0x000F);
+  	SiS_SetReg(SiS_Pr->SiS_Part1Port,0x11,temp);           /* CRT2 Vert. Retrace End; Overflow; "Enable CRTC Check" */
 
-#ifdef SIS315H
-  if(HwDeviceExtension->jChipType >= SIS_315H) {
-     flag = SiS_GetReg1(SiS_Pr->SiS_P3d4,0x30);
-     if(flag & SetCRT2ToLCD) return(1);
-     flag = SiS_GetReg1(SiS_Pr->SiS_P3d4,0x38);
-     if(flag & SetToLCDA)    return(1);
-     else                    return(0);
-  } else
-#endif
-  {
-   flag = SiS_GetReg1(SiS_Pr->SiS_P3d4,0x30);
-   if(flag & SetCRT2ToLCD)   return(1);
-  }
-  return(0);
+  	/* 3. Panel compensation delay */
 
-}
+  	if(HwInfo->jChipType < SIS_315H) {
 
-BOOLEAN
-SiS_IsDisableCRT2(SiS_Private *SiS_Pr, USHORT BaseAddr)
-{
-  USHORT flag;
+#ifdef SIS300  /* ---------- 300 series -------------- */
 
-  flag = SiS_GetReg1(SiS_Pr->SiS_P3d4,0x30);
-  if(flag & 0x20) return(0);
-  else            return(1);
-}
+	   if(SiS_Pr->SiS_VBType & VB_SISVB) {
+	        temp = 0x20;
 
-BOOLEAN
-SiS_BridgeIsOn(SiS_Private *SiS_Pr, USHORT BaseAddr,PSIS_HW_DEVICE_INFO HwDeviceExtension)
-{
-  USHORT flag;
+		if(HwInfo->jChipType == SIS_300) {
+		   temp = 0x10;
+		   if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768)  temp = 0x2c;
+		   if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) temp = 0x20;
+		}
+		if(SiS_Pr->SiS_VBType & VB_SIS301) {
+		   if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) temp = 0x20;
+		}
+		if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x960)     temp = 0x24;
+		if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_PanelCustom)       temp = 0x2c;
+		if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) 		temp = 0x08;
+		if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) {
+      		   if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) 	temp = 0x2c;
+      		   else 					temp = 0x20;
+    	        }
+		if((ROMAddr) && (SiS_Pr->SiS_UseROM)) {
+		    if(ROMAddr[0x220] & 0x80) {
+		        if(SiS_Pr->SiS_VBInfo & SetCRT2ToTVNoYPbPrHiVision)
+				temp = ROMAddr[0x221];
+			else if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision)
+				temp = ROMAddr[0x222];
+		        else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024)
+				temp = ROMAddr[0x223];
+			else
+				temp = ROMAddr[0x224];
+			temp &= 0x3c;
+		    }
+		}
+		if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
+		   if(SiS_Pr->PDC) {
+			temp = SiS_Pr->PDC & 0x3c;
+		   }
+		}
+	   } else {
+	        temp = 0x20;
+		if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) {
+		   if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480) temp = 0x04;
+		}
+		if((ROMAddr) && SiS_Pr->SiS_UseROM) {
+		    if(ROMAddr[0x220] & 0x80) {
+		        temp = ROMAddr[0x220] & 0x3c;
+		    }
+		}
+		if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
+		   if(SiS_Pr->PDC) {
+		      temp = SiS_Pr->PDC & 0x3c;
+		   }
+		}
+	   }
 
-  if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
-     return(0);
-  } else {
-     flag = SiS_GetReg1(SiS_Pr->SiS_Part4Port,0x00);
-     if((flag == 1) || (flag == 2)) return(0);
-     else return(1);
-  }
-}
+    	   SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,~0x03C,temp);         /* Panel Link Delay Compensation; (Software Command Reset; Power Saving) */
 
-BOOLEAN
-SiS_BridgeIsEnable(SiS_Private *SiS_Pr, USHORT BaseAddr,PSIS_HW_DEVICE_INFO HwDeviceExtension)
-{
-  USHORT flag;
+#endif  /* SIS300 */
 
-  if(!(SiS_BridgeIsOn(SiS_Pr,BaseAddr,HwDeviceExtension))) {
-    flag = SiS_GetReg1(SiS_Pr->SiS_Part1Port,0x00);
-    if(HwDeviceExtension->jChipType < SIS_315H) {
-      /* 300 series (630/301B 2.04.5a) */
-      flag &= 0xa0;
-      if((flag == 0x80) || (flag == 0x20)) return 0;
-      else	                           return 1;
-    } else {
-      /* 310/325 series (650/30xLV 1.10.6s) */
-      flag &= 0x50;
-      if((flag == 0x40) || (flag == 0x10)) return 0;
-      else                                 return 1;
-    }
-  }
-  return 1;
-}
+  	} else {
 
-BOOLEAN
-SiS_BridgeInSlave(SiS_Private *SiS_Pr)
-{
-  USHORT flag1;
+#ifdef SIS315H   /* --------------- 315/330 series ---------------*/
 
-  flag1 = SiS_GetReg1(SiS_Pr->SiS_P3d4,0x31);
-  if(flag1 & (SetInSlaveMode >> 8)) return 1;
-  else return 0;
-}
+   	   if(HwInfo->jChipType < SIS_661) {
 
-void
-SiS_SetHiVision(SiS_Private *SiS_Pr, USHORT BaseAddr,PSIS_HW_DEVICE_INFO HwDeviceExtension)
-{
-#ifdef SIS315H
-  USHORT temp;
-#endif
+	      if(SiS_Pr->SiS_VBType & VB_SISVB) {
 
-  /* Note: This variable is only used on 30xLV systems.
-     CR38 has a different meaning on LVDS/CH7019 systems.
-   */
+                 temp = 0x10;
+                 if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768)  temp = 0x2c;
+    	         if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) temp = 0x20;
+    	         if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x960)  temp = 0x24;
+		 if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_PanelCustom)    temp = 0x2c;
+		 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
+		    temp = 0x08;
+		    if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) {
+		       if(SiS_Pr->SiS_VBInfo & SetInSlaveMode)  temp = 0x2c;
+      		       else 					temp = 0x20;
+		    }
+		 }
+		 if((SiS_Pr->SiS_VBType & VB_SIS301B302B) && (!(SiS_Pr->SiS_VBType & VB_NoLCD))) {
+		    tempbl = 0x00;
+		    if((ROMAddr) && (SiS_Pr->SiS_UseROM)) {
+		       if(HwInfo->jChipType < SIS_330) {
+		          if(ROMAddr[0x13c] & 0x80) tempbl = 0xf0;
+		       } else {
+		          if(ROMAddr[0x1bc] & 0x80) tempbl = 0xf0;
+		       }
+		    }
+		 } else {  /* LV (550/301LV checks ROM byte, other LV BIOSes do not) */
+		    tempbl = 0xF0;
+		 }
+		 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD|SetCRT2ToLCDA)) {
+		    if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {
+		       if(SiS_Pr->PDC) {
+		          temp = SiS_Pr->PDC;
+		          tempbl = 0;
+		       }
+		    }
+		 }
 
-  SiS_Pr->SiS_HiVision = 0;
-  if(HwDeviceExtension->jChipType >= SIS_315H) {
-#ifdef SIS315H
-     if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {
-        if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVisionTV) {
-           temp = SiS_GetReg1(SiS_Pr->SiS_P3d4,0x38);
-	   temp &= 0x38;
-	   SiS_Pr->SiS_HiVision = (temp >> 3);
-	}
-     }
-#endif /* SIS315H */
-  }
-}
+	      } else {  /* LVDS */
 
-BOOLEAN
-SiS_GetLCDResInfo(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,
-                  USHORT ModeIdIndex, PSIS_HW_DEVICE_INFO HwDeviceExtension)
-{
-  USHORT temp,modeflag,resinfo=0;
-  const unsigned char SiS300SeriesLCDRes[] =
-         { 0, 1, 2, 3, 7, 4, 5, 8,
-	   0, 0, 0, 0, 0, 0, 0, 0 };
+	         if(HwInfo->jChipType == SIS_740) {
+		    temp = 0x03;
+	         } else {
+		    temp = 0x00;
+		 }
+	 	 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) temp = 0x0a;
+		 tempbl = 0xF0;
+		 if(HwInfo->jChipType == SIS_650) {
+		    if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) {
+		       if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) tempbl = 0x0F;
+		    }
+		 }
 
-  SiS_Pr->SiS_LCDResInfo = 0;
-  SiS_Pr->SiS_LCDTypeInfo = 0;
-  SiS_Pr->SiS_LCDInfo = 0;
+		 if(SiS_Pr->SiS_IF_DEF_DSTN || SiS_Pr->SiS_IF_DEF_FSTN) {
+		    temp = 0x08;
+		    tempbl = 0;
+		    if((ROMAddr) && (SiS_Pr->SiS_UseROM)) {
+		       if(ROMAddr[0x13c] & 0x80) tempbl = 0xf0;
+		    }
+		 }
+	      }
 
-  if(SiS_Pr->UseCustomMode) {
-     modeflag = SiS_Pr->CModeFlag;
-  } else {
-     if(ModeNo <= 0x13) {
-    	modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
-     } else {
-    	modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
-    	resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO;
-     }
-  }
+	      SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2D,tempbl,temp);	    /* Panel Link Delay Compensation */
 
-  if(!(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)))   return 0;
+	   } /* < 661 */
 
-  if(!(SiS_Pr->SiS_VBInfo & (SetSimuScanMode | SwitchToCRT2))) return 0;
+    	   tempax = 0;
+    	   if (modeflag & DoubleScanMode) tempax |= 0x80;
+    	   if (modeflag & HalfDCLK)       tempax |= 0x40;
+    	   SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2C,0x3f,tempax);
 
-  temp = SiS_GetReg1(SiS_Pr->SiS_P3d4,0x36);
+#endif  /* SIS315H */
 
-  /* FSTN: Fake CR36 (TypeInfo 2, ResInfo SiS_Panel320x480) */
-  if(SiS_Pr->SiS_IF_DEF_FSTN) {
-   	temp = 0x20 | SiS_Pr->SiS_Panel320x480;
-   	SiS_SetReg1(SiS_Pr->SiS_P3d4,0x36,temp);
-  }
+  	}
 
-  if(HwDeviceExtension->jChipType < SIS_315H) {
-  	SiS_Pr->SiS_LCDTypeInfo = temp >> 4;
-  } else {
-        SiS_Pr->SiS_LCDTypeInfo = (temp & 0x0F) - 1;
-  }
-  temp &= 0x0f;
-  if(HwDeviceExtension->jChipType < SIS_315H) {
-      /* TW: Translate 300 series LCDRes to 310/325 series for unified usage */
-      temp = SiS300SeriesLCDRes[temp];
-  }
-  SiS_Pr->SiS_LCDResInfo = temp;
+     }  /* Slavemode */
 
-  if(SiS_Pr->SiS_IF_DEF_FSTN){
-       	SiS_Pr->SiS_LCDResInfo = SiS_Pr->SiS_Panel320x480;
-  }
+     if(SiS_Pr->SiS_VBType & VB_SISVB) {
 
-  if(SiS_Pr->SiS_IF_DEF_LVDS == 0) {
-    	if(SiS_Pr->SiS_LCDResInfo < SiS_Pr->SiS_PanelMin301)
-		SiS_Pr->SiS_LCDResInfo = SiS_Pr->SiS_PanelMin301;
-  } else {
-    	if(SiS_Pr->SiS_LCDResInfo < SiS_Pr->SiS_PanelMinLVDS)
-		SiS_Pr->SiS_LCDResInfo = SiS_Pr->SiS_PanelMinLVDS;
-  }
+        /* For 301BDH with LCD, we set up the Panel Link */
+        if( (SiS_Pr->SiS_VBType & VB_NoLCD) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) ) {
 
-  if(SiS_Pr->SiS_LCDResInfo > SiS_Pr->SiS_PanelMax)
-  	SiS_Pr->SiS_LCDResInfo = SiS_Pr->SiS_Panel1024x768;
+	    SiS_SetGroup1_LVDS(SiS_Pr, ModeNo, ModeIdIndex,
+	                       HwInfo, RefreshRateTableIndex);
 
-  temp = SiS_GetReg1(SiS_Pr->SiS_P3d4,0x37);
-  if(SiS_Pr->SiS_IF_DEF_FSTN){
-        /* TW: Fake LVDS bridge for FSTN */
-      	temp = 0x04;
-      	SiS_SetReg1(SiS_Pr->SiS_P3d4,0x37,temp);
-  }
-  SiS_Pr->SiS_LCDInfo = temp;
-  
-  if(!(SiS_Pr->UsePanelScaler))        SiS_Pr->SiS_LCDInfo &= ~DontExpandLCD;
-  else if(SiS_Pr->UsePanelScaler == 1) SiS_Pr->SiS_LCDInfo |= DontExpandLCD;
+        } else if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) {
 
-  /* TW: Inserted entire 315-block from 650/LVDS/30xLV BIOSes */
-  if(HwDeviceExtension->jChipType >= SIS_315H) {
-#ifdef SIS315H
-     if(SiS_Pr->SiS_IF_DEF_LVDS == 0) {
-         if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
-	     if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) {
-		 if(ModeNo == 0x3a || ModeNo == 0x4d || ModeNo == 0x65) {
-		     /* Bridge does not scale to 1280x1024 */
-		     SiS_Pr->SiS_LCDInfo |= DontExpandLCD;
-		 }
-	     }
-	     if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) {
-	         if(ModeNo == 0x7c || ModeNo == 0x7d || ModeNo == 0x7e) {
-		     /* TW: Bridge does not scale to 1280x960 */
-		     SiS_Pr->SiS_LCDInfo |= DontExpandLCD;
-		 }
-		 if(ModeNo == 0x2f || ModeNo == 0x5d || ModeNo == 0x5e) {
-		     /* TW: Bridge does not scale to 640x400 */
-		     SiS_Pr->SiS_LCDInfo |= DontExpandLCD;
-		 }
-	     }
-	     if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) {
-	         if(ModeNo == 0x2f || ModeNo == 0x5d || ModeNo == 0x5e) {
-		     /* TW: Most panels can't scale to 640x400 */
-		     SiS_Pr->SiS_LCDInfo &= ~DontExpandLCD;
-		 }
-	     }
-	 }
-     }
-     if(SiS_GetReg1(SiS_Pr->SiS_P3d4,0x39) & 0x01) {
-         SiS_Pr->SiS_LCDInfo &= 0xFFEF;    
-	 SiS_Pr->SiS_LCDInfo |= LCDPass11;
-     }
-#endif
-  } else {
-#ifdef SIS300
-     if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
-        if((ROMAddr) && SiS_Pr->SiS_UseROM) {
-           if(!(ROMAddr[0x235] & 0x02)) {
-	      SiS_Pr->SiS_LCDInfo &= 0xEF;
-	   }
+    	    SiS_SetGroup1_301(SiS_Pr, ModeNo, ModeIdIndex,
+	                      HwInfo, RefreshRateTableIndex);
         }
+
      } else {
-        if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
-	   if((SiS_Pr->SiS_SetFlag & SetDOSMode) && ((ModeNo == 0x03) || (ModeNo == 0x10))) {
-               SiS_Pr->SiS_LCDInfo &= 0xEF;
-	   }
-	}
-     }
-#endif
-  }
-  
-  /* TW: With Trumpion, always Expanding */
-  if(SiS_Pr->SiS_IF_DEF_TRUMPION != 0){
-       SiS_Pr->SiS_LCDInfo &= (~DontExpandLCD);
-  }
 
-  if(!((HwDeviceExtension->jChipType < SIS_315H) && (SiS_Pr->SiS_SetFlag & SetDOSMode))) {
+        if(HwInfo->jChipType < SIS_315H) {
 
-     if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
-        if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x600) {
-	   if(ModeNo > 0x13) {
-	      if(!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) {
-                 if((resinfo == 7) || (resinfo == 3)) {
-                    SiS_Pr->SiS_SetFlag |= EnableLVDSDDA;
-		 }
+	   SiS_SetGroup1_LVDS(SiS_Pr, ModeNo, ModeIdIndex,
+	                        HwInfo, RefreshRateTableIndex);
+	} else {
+
+	   if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) {
+              if((!(SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) || (SiS_Pr->SiS_VBInfo & SetInSlaveMode)) {
+    	          SiS_SetGroup1_LVDS(SiS_Pr, ModeNo,ModeIdIndex,
+	                              HwInfo,RefreshRateTableIndex);
               }
-           }
-        }
-	if(ModeNo == 0x12) {
-	   if(SiS_Pr->SiS_LCDInfo & LCDPass11) {
-	      SiS_Pr->SiS_SetFlag |= EnableLVDSDDA;
+	   } else {
+	      SiS_SetGroup1_LVDS(SiS_Pr, ModeNo,ModeIdIndex,
+	                         HwInfo,RefreshRateTableIndex);
 	   }
+
 	}
-     }
 
-     if(modeflag & HalfDCLK) {
-        if(SiS_Pr->SiS_IF_DEF_TRUMPION == 0) {
-           if(!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) {
-	      if(!(((SiS_Pr->SiS_IF_DEF_LVDS == 1) || (HwDeviceExtension->jChipType < SIS_315H)) &&
-	                                      (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480))) {
-                 if(ModeNo > 0x13) {
-                    if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) {
-                       if(resinfo == 4) SiS_Pr->SiS_SetFlag |= EnableLVDSDDA;     /* 512x384  */
-                    } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel800x600) {
-                       if(resinfo == 3) SiS_Pr->SiS_SetFlag |= EnableLVDSDDA;     /* 400x300  */
-                    }
-                 }
-	      } else SiS_Pr->SiS_SetFlag |= EnableLVDSDDA;
-           } else SiS_Pr->SiS_SetFlag |= EnableLVDSDDA;
-        } else SiS_Pr->SiS_SetFlag |= EnableLVDSDDA;
      }
-
-  }
-
-  if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) {
-    	if(SiS_Pr->SiS_VBInfo & SetNotSimuMode) {
-      		SiS_Pr->SiS_SetFlag |= LCDVESATiming;
-    	}
-  } else {
-    	SiS_Pr->SiS_SetFlag |= LCDVESATiming;
-  }
-
-#ifdef SIS315H
-  /* TW: 650/30xLV 1.10.6s */
-  if(HwDeviceExtension->jChipType >= SIS_315H) {
-    if(SiS_Pr->SiS_VBType & (VB_SIS302B | VB_SIS302LV)) {
-      /* Enable 302B/302LV dual link mode */
-      /* (302B is a theory - not in any BIOS */
-      temp = 0x00;
-      if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) temp = 0x04;
-      if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) temp = 0x04;
-      if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200) temp = 0x04;
-      SiS_SetReg1(SiS_Pr->SiS_P3d4,0x39,temp);
-    } else if(SiS_Pr->SiS_IF_DEF_LVDS == 0) {
-      SiS_SetReg1(SiS_Pr->SiS_P3d4,0x39,0x00);
-    }
-  }
-#endif
-
-#ifdef LINUX_KERNEL
-#ifdef TWDEBUG
-  printk(KERN_DEBUG "sisfb: (LCDInfo=0x%04x LCDResInfo=0x%02x LCDTypeInfo=0x%02x)\n",
-	SiS_Pr->SiS_LCDInfo, SiS_Pr->SiS_LCDResInfo, SiS_Pr->SiS_LCDTypeInfo);
-#endif
-#endif
-#ifdef LINUX_XF86
-  xf86DrvMsgVerb(0, X_PROBED, 3, 
-  	"(init301: LCDInfo=0x%04x LCDResInfo=0x%02x LCDTypeInfo=0x%02x SetFlag=0x%04x)\n",
-	SiS_Pr->SiS_LCDInfo, SiS_Pr->SiS_LCDResInfo, SiS_Pr->SiS_LCDTypeInfo, SiS_Pr->SiS_SetFlag);
-#endif
-
-  return 1;
+  } /* LCDA */
 }
 
-void
-SiS_PresetScratchregister(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension)
-{
-  return;
-  /*SiS_SetReg1(SiS_Pr->SiS_P3d4,0x30,0x21);  */
-  /*SiS_SetReg1(SiS_Pr->SiS_P3d4,0x31,0x41);  */
-  /*SiS_SetReg1(SiS_Pr->SiS_P3d4,0x32,0x28);  */
-  /*SiS_SetReg1(SiS_Pr->SiS_P3d4,0x33,0x22);  */
-  /*SiS_SetReg1(SiS_Pr->SiS_P3d4,0x35,0x43);  */
-  /*SiS_SetReg1(SiS_Pr->SiS_P3d4,0x36,0x01);  */
-  /*SiS_SetReg1(SiS_Pr->SiS_P3d4,0x37,0x00);  */
-}
+/*********************************************/
+/*         SET PART 2 REGISTER GROUP         */
+/*********************************************/
 
-void
-SiS_LongWait(SiS_Private *SiS_Pr)
+#ifdef SIS315H
+static UCHAR *
+SiS_GetGroup2CLVXPtr(SiS_Private *SiS_Pr, int tabletype, PSIS_HW_INFO HwInfo)
 {
-  USHORT i;
-
-  i = SiS_GetReg1(SiS_Pr->SiS_P3c4,0x1F);
+   UCHAR  *ROMAddr = HwInfo->pjVirtualRomBase;
+   const UCHAR  *tableptr = NULL;
+   USHORT a, b, p = 0;
 
-  if(!(i & 0xC0)) {
-    for(i=0; i<0xFFFF; i++) {
-       if(!(SiS_GetReg2(SiS_Pr->SiS_P3da) & 0x08))
-         break;
-    }
-    for(i=0; i<0xFFFF; i++) {
-       if((SiS_GetReg2(SiS_Pr->SiS_P3da) & 0x08))
-         break;
-    }
-  }
-}
+   a = SiS_Pr->SiS_VGAHDE;
+   b = SiS_Pr->SiS_HDE;
+   if(tabletype) {
+      a = SiS_Pr->SiS_VGAVDE;
+      b = SiS_Pr->SiS_VDE;
+   }
 
-void
-SiS_VBLongWait(SiS_Private *SiS_Pr)
-{
-  if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) {
-    SiS_VBWait(SiS_Pr);
-  } else {
-    SiS_LongWait(SiS_Pr);
-  }
-  return;
-}
+   if((HwInfo->jChipType >= SIS_661) && (ROMAddr = (UCHAR *)HwInfo->pjVirtualRomBase) && SiS_Pr->SiS_UseROM) {
 
-void
-SiS_VBWait(SiS_Private *SiS_Pr)
-{
-  USHORT tempal,temp,i,j;
+      if(a < b) {
+         p = ROMAddr[0x278] | (ROMAddr[0x279] << 8);
+      } else if(a == b) {
+         p = ROMAddr[0x27a] | (ROMAddr[0x27b] << 8);
+      } else {
+         if(SiS_Pr->SiS_TVMode & TVSetPAL) {
+	    p = ROMAddr[0x27e] | (ROMAddr[0x27f] << 8);
+	 } else {
+	    p = ROMAddr[0x27c] | (ROMAddr[0x27d] << 8);
+	 }
+	 if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) {
+	    if(SiS_Pr->SiS_TVMode & TVSetYPbPr525i) 	 p = ROMAddr[0x280] | (ROMAddr[0x281] << 8);
+	    else if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p) p = ROMAddr[0x282] | (ROMAddr[0x283] << 8);
+	    else 				 	 p = ROMAddr[0x284] | (ROMAddr[0x285] << 8);
+	 } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) {
+	    p = ROMAddr[0x286] | (ROMAddr[0x287] << 8);
+	 }
+	 do {
+	    if((ROMAddr[p] | ROMAddr[p+1] << 8) == a) break;
+	    p += 0x42;
+	 } while((ROMAddr[p] | ROMAddr[p+1] << 8) != 0xffff);
+	 if((ROMAddr[p] | ROMAddr[p+1] << 8) == 0xffff) p -= 0x42;
+      }
+      p += 2;
+      return(&ROMAddr[p]);
 
-  temp = 0;
-  for(i=0; i<3; i++) {
-    for(j=0; j<100; j++) {
-       tempal = SiS_GetReg2(SiS_Pr->SiS_P3da);
-       if(temp & 0x01) {
-          if((tempal & 0x08))  continue;
-          if(!(tempal & 0x08)) break;
-       } else {
-          if(!(tempal & 0x08)) continue;
-          if((tempal & 0x08))  break;
-       }
-    }
-    temp ^= 0x01;
-  }
-}
+   } else {
 
-void
-SiS_WaitVBRetrace(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension)
-{
-  if(HwDeviceExtension->jChipType < SIS_315H) {
-#ifdef SIS300
-     if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
-        if(!(SiS_GetReg1(SiS_Pr->SiS_Part1Port,0x00) & 0x20)) return;
-     }
-     if(!(SiS_GetReg1(SiS_Pr->SiS_Part1Port,0x00) & 0x80)) {
-        SiS_WaitRetrace1(SiS_Pr,HwDeviceExtension);
-     } else {
-        SiS_WaitRetrace2(SiS_Pr,HwDeviceExtension);
-     }
-#endif
-  } else {
-#ifdef SIS315H
-     if(!(SiS_GetReg1(SiS_Pr->SiS_Part1Port,0x00) & 0x40)) {
-        SiS_WaitRetrace1(SiS_Pr,HwDeviceExtension);
-     } else {
-        SiS_WaitRetrace2(SiS_Pr,HwDeviceExtension);
-     }
-#endif
-  }
+      if(a < b) {
+         tableptr = SiS_Part2CLVX_1;
+      } else if(a == b) {
+         tableptr = SiS_Part2CLVX_2;
+      } else {
+         if(SiS_Pr->SiS_TVMode & TVSetPAL) {
+	    tableptr = SiS_Part2CLVX_4;
+	 } else {
+	    tableptr = SiS_Part2CLVX_3;
+	 }
+	 if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) {
+	    if(SiS_Pr->SiS_TVMode & TVSetYPbPr525i) 	 tableptr = SiS_Part2CLVX_3;
+	    else if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p) tableptr = SiS_Part2CLVX_3;
+	    else 				         tableptr = SiS_Part2CLVX_5;
+
+	 } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) {
+	    tableptr = SiS_Part2CLVX_6;
+	 }
+	 do {
+	    if((tableptr[p] | tableptr[p+1] << 8) == a) break;
+	    p += 0x42;
+	 } while((tableptr[p] | tableptr[p+1] << 8) != 0xffff);
+	 if((tableptr[p] | tableptr[p+1] << 8) == 0xffff) p -= 0x42;
+      }
+      p += 2;
+      return((UCHAR *)&tableptr[p]);
+   }
 }
 
-void
-SiS_WaitRetrace1(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension)
-{
-  USHORT watchdog;
-#ifdef SIS300
-  USHORT i;
-#endif
 
-  if(HwDeviceExtension->jChipType >= SIS_315H) {
-#ifdef SIS315H
-     if(SiS_GetReg1(SiS_Pr->SiS_P3c4,0x1f) & 0xc0) return;
-     watchdog = 65535;
-     while( (SiS_GetReg2(SiS_Pr->SiS_P3da) & 0x08) && --watchdog);
-     watchdog = 65535;
-     while( (!(SiS_GetReg2(SiS_Pr->SiS_P3da) & 0x08)) && --watchdog);
-#endif
-  } else {
-#ifdef SIS300
-#if 0  /* TW: Not done in A901 BIOS */
-     if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
-        if(SiS_GetReg1(SiS_Pr->SiS_P3c4,0x1f) & 0xc0) return;
-     }
-#endif
-     for(i=0; i<10; i++) {
-        watchdog = 65535;
-        while( (SiS_GetReg2(SiS_Pr->SiS_P3da) & 0x08) && --watchdog);
-	if(watchdog) break;
-     }
-     for(i=0; i<10; i++) {
-        watchdog = 65535;
-        while( (!(SiS_GetReg2(SiS_Pr->SiS_P3da) & 0x08)) && --watchdog);
-	if(watchdog) break;
-     }
-#endif
-  }
+static void
+SiS_SetGroup2_C_ELV(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
+	      	    USHORT RefreshRateTableIndex, PSIS_HW_INFO HwInfo)
+{
+   UCHAR *tableptr;
+   int i, j;
+   UCHAR temp;
+
+   if(!(SiS_Pr->SiS_VBType & (VB_SIS301C | VB_SIS302ELV))) return;
+
+   tableptr = SiS_GetGroup2CLVXPtr(SiS_Pr, 0, HwInfo);
+   for(i = 0x80, j = 0; i <= 0xbf; i++, j++) {
+      SiS_SetReg(SiS_Pr->SiS_Part2Port, i, tableptr[j]);
+   }
+   if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
+      tableptr = SiS_GetGroup2CLVXPtr(SiS_Pr, 1, HwInfo);
+      for(i = 0xc0, j = 0; i <= 0xff; i++, j++) {
+         SiS_SetReg(SiS_Pr->SiS_Part2Port, i, tableptr[j]);
+      }
+   }
+   temp = 0x10;
+   if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) temp |= 0x04;
+   SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x4e,0xeb,temp);
 }
 
-void
-SiS_WaitRetraceDDC(SiS_Private *SiS_Pr)
+static void
+SiS_GetCRT2Part2Ptr(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdIndex,
+		    USHORT RefreshRateTableIndex,USHORT *CRT2Index,
+		    USHORT *ResIndex,PSIS_HW_INFO HwInfo)
 {
-  USHORT watchdog;
+  USHORT tempbx,tempal;
 
-  if(SiS_GetReg1(SiS_Pr->SiS_P3c4,0x1f) & 0xc0) return;
-  watchdog = 65535;
-  while( (SiS_GetReg2(SiS_Pr->SiS_P3da) & 0x08) && --watchdog);
-  watchdog = 65535;
-  while( (!(SiS_GetReg2(SiS_Pr->SiS_P3da) & 0x08)) && --watchdog);
-}
+  if(ModeNo <= 0x13)
+      	tempal = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC;
+  else
+      	tempal = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC;
 
-void
-SiS_WaitRetrace2(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension)
-{
-  USHORT watchdog;
-#ifdef SIS300
-  USHORT i;
-#endif
+  tempbx = SiS_Pr->SiS_LCDResInfo;
 
-  if(HwDeviceExtension->jChipType >= SIS_315H) {
-#ifdef SIS315H
-     watchdog = 65535;
-     while( (SiS_GetReg1(SiS_Pr->SiS_Part1Port,0x30) & 0x02) && --watchdog);
-     watchdog = 65535;
-     while( (!(SiS_GetReg1(SiS_Pr->SiS_Part1Port,0x30) & 0x02)) && --watchdog);
-#endif
-  } else {
-#ifdef SIS300
-     for(i=0; i<10; i++) {
-        watchdog = 65535;
-	while( (SiS_GetReg1(SiS_Pr->SiS_Part1Port,0x25) & 0x02) && --watchdog);
-	if(watchdog) break;
+  if(SiS_Pr->SiS_LCDInfo & DontExpandLCD)      tempbx += 16;
+  else if(SiS_Pr->SiS_SetFlag & LCDVESATiming) tempbx += 32;
+
+  if(SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) {
+     if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) {
+        tempbx = 100;
+        if(SiS_Pr->SiS_LCDInfo & DontExpandLCD)      tempbx = 101;
+  	else if(SiS_Pr->SiS_SetFlag & LCDVESATiming) tempbx = 102;
+     }
+  } else if(SiS_Pr->SiS_CustomT == CUT_CLEVO1024) {
+     if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) {
+        if(SiS_IsDualLink(SiS_Pr, HwInfo)) {
+           tempbx = 103;
+           if(SiS_Pr->SiS_LCDInfo & DontExpandLCD)      tempbx = 104;
+  	   else if(SiS_Pr->SiS_SetFlag & LCDVESATiming) tempbx = 105;
+	}
      }
-     for(i=0; i<10; i++) {
-        watchdog = 65535;
-	while( (!(SiS_GetReg1(SiS_Pr->SiS_Part1Port,0x25) & 0x02)) && --watchdog);
-	if(watchdog) break;
+  } else if(SiS_Pr->SiS_CustomT == CUT_ASUSA2H_2) {
+     if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) {
+        if(SiS_Pr->SiS_SetFlag & LCDVESATiming) tempbx = 106;
      }
-#endif
   }
-}
 
-/* =========== Set and Get register routines ========== */
+  *CRT2Index = tempbx;
+  *ResIndex = tempal & 0x3F;
+}
+#endif
 
-void
-SiS_SetRegANDOR(USHORT Port,USHORT Index,USHORT DataAND,USHORT DataOR)
+#ifdef SIS300
+/* For ECS A907. Highly preliminary. */
+static void
+SiS_Set300Part2Regs(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
+    		    USHORT ModeIdIndex, USHORT RefreshRateTableIndex,
+		    USHORT ModeNo)
 {
-  USHORT temp;
+  USHORT crt2crtc, resindex;
+  int    i,j;
+  const  SiS_Part2PortTblStruct *CRT2Part2Ptr = NULL;
 
-  temp = SiS_GetReg1(Port,Index);    
-  temp = (temp & (DataAND)) | DataOR;
-  SiS_SetReg1(Port,Index,temp);
-}
+  if(HwInfo->jChipType != SIS_300) return;
+  if(!(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV)) return;
+  if(SiS_Pr->UseCustomMode) return;
 
-void
-SiS_SetRegAND(USHORT Port,USHORT Index,USHORT DataAND)
-{
-  USHORT temp;
+  if(ModeNo <= 0x13) {
+     crt2crtc = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC;
+  } else {
+     crt2crtc = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC;
+  }
+
+  resindex = crt2crtc & 0x3F;
+  if(SiS_Pr->SiS_SetFlag & LCDVESATiming) CRT2Part2Ptr = SiS_Pr->SiS_CRT2Part2_1024x768_1;
+  else                                    CRT2Part2Ptr = SiS_Pr->SiS_CRT2Part2_1024x768_2;
+
+  /* The BIOS code (1.16.51,56) is obviously a fragment! */
+  if(ModeNo > 0x13) {
+     CRT2Part2Ptr = SiS_Pr->SiS_CRT2Part2_1024x768_1;
+     resindex = 4;
+  }
 
-  temp = SiS_GetReg1(Port,Index);    
-  temp &= DataAND;
-  SiS_SetReg1(Port,Index,temp);
+  SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x01,0x80,(CRT2Part2Ptr+resindex)->CR[0]);
+  SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x02,0x80,(CRT2Part2Ptr+resindex)->CR[1]);
+  for(i = 2, j = 0x04; j <= 0x06; i++, j++ ) {
+        SiS_SetReg(SiS_Pr->SiS_Part2Port,j,(CRT2Part2Ptr+resindex)->CR[i]);
+  }
+  for(j = 0x1c; j <= 0x1d; i++, j++ ) {
+        SiS_SetReg(SiS_Pr->SiS_Part2Port,j,(CRT2Part2Ptr+resindex)->CR[i]);
+  }
+  for(j = 0x1f; j <= 0x21; i++, j++ ) {
+        SiS_SetReg(SiS_Pr->SiS_Part2Port,j,(CRT2Part2Ptr+resindex)->CR[i]);
+  }
+  SiS_SetReg(SiS_Pr->SiS_Part2Port,0x23,(CRT2Part2Ptr+resindex)->CR[10]);
+  SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x25,0x0f,(CRT2Part2Ptr+resindex)->CR[11]);
 }
+#endif
 
-void SiS_SetRegOR(USHORT Port,USHORT Index,USHORT DataOR)
+static void
+SiS_SetTVSpecial(SiS_Private *SiS_Pr, USHORT ModeNo)
 {
-  USHORT temp;
+  if(!(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV)) return;
+  if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToTVNoHiVision)) return;
+  if(SiS_Pr->SiS_TVMode & (TVSetYPbPr525p | TVSetYPbPr750p)) return;
 
-  temp = SiS_GetReg1(Port,Index);    
-  temp |= DataOR;
-  SiS_SetReg1(Port,Index,temp);
+  if(!(SiS_Pr->SiS_TVMode & TVSetPAL)) {
+     if(SiS_Pr->SiS_TVMode & TVSetNTSC1024) {
+        const UCHAR specialtv[] = {
+		0xa7,0x07,0xf2,0x6e,0x17,0x8b,0x73,0x53,
+		0x13,0x40,0x34,0xf4,0x63,0xbb,0xcc,0x7a,
+		0x58,0xe4,0x73,0xda,0x13
+	};
+	int i, j;
+	for(i = 0x1c, j = 0; i <= 0x30; i++, j++) {
+	   SiS_SetReg(SiS_Pr->SiS_Part2Port,i,specialtv[j]);
+	}
+	SiS_SetReg(SiS_Pr->SiS_Part2Port,0x43,0x72);
+	if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750)) {
+	   if(SiS_Pr->SiS_TVMode & TVSetPALM) {
+	      SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x14);
+	   } else {
+	      SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x15);
+	   }
+	   SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x1b);
+	}
+     }
+  } else {
+     SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x21);
+     SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x5a);
+  }
 }
 
-/* ========================================================= */
-
-/* TW: Set 301 TV Encoder (and some LCD relevant) registers */
-void
-SiS_SetGroup2(SiS_Private *SiS_Pr, USHORT BaseAddr,UCHAR *ROMAddr, USHORT ModeNo,
-              USHORT ModeIdIndex,USHORT RefreshRateTableIndex,
-	      PSIS_HW_DEVICE_INFO HwDeviceExtension)
+static void
+SiS_SetGroup2(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,USHORT RefreshRateTableIndex,
+	      PSIS_HW_INFO HwInfo)
 {
-  USHORT      i, j, tempax, tempbx, tempcx, temp, temp1;
-  USHORT      push1, push2;
+  USHORT      i, j, tempax, tempbx, tempcx, temp;
+  USHORT      push1, push2, modeflag, crt2crtc;
+  ULONG       longtemp, tempeax;
   const       UCHAR *PhasePoint;
   const       UCHAR *TimingPoint;
-#ifdef SIS315H   
-  const       SiS_Part2PortTblStruct *CRT2Part2Ptr = NULL;
+#ifdef SIS315H
   USHORT      resindex, CRT2Index;
-#endif  
-  USHORT      modeflag, resinfo, crt2crtc;
-  ULONG       longtemp, tempeax, tempebx, temp2, tempecx;
+  const       SiS_Part2PortTblStruct *CRT2Part2Ptr = NULL;
+#endif
+#ifdef SIS300
   const UCHAR atable[] = {
-                 0xc3,0x9e,0xc3,0x9e,0x02,0x02,0x02,
-	         0xab,0x87,0xab,0x9e,0xe7,0x02,0x02
+       0xc3,0x9e,0xc3,0x9e,0x02,0x02,0x02,
+       0xab,0x87,0xab,0x9e,0xe7,0x02,0x02
   };
+#endif
 
 #ifdef SIS315H   
-  if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) {
-     /* TW: 650/30xLV 1.10.6s: (Is at end of SetGroup2!) */
-     if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
-        if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) {
-	   SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x1a,0xfc,0x03);
-	   temp = 1;
-	   if(ModeNo <= 0x13) temp = 3;
-	   SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x0b,temp);
-	}
-     }
-     if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
-       if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
-         if(!(SiS_Pr->SiS_VBInfo & SetPALTV)) {
-           if((ModeNo == 0x4a) || (ModeNo == 0x38)) {
-               SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x1c,0xa7);
-	       SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x1d,0x07);
-	       SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x1e,0xf2);
-	       SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x1f,0x6e);
-	       SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x20,0x17);
-	       SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x21,0x8b);
-	       SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x22,0x73);
-	       SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x23,0x53);
-	       SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x24,0x13);
-	       SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x25,0x40);
-	       SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x26,0x34);
-	       SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x27,0xf4);
-	       SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x28,0x63);
-	       SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x29,0xbb);
-	       SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x2a,0xcc);
-	       SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x2b,0x7a);
-	       SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x2c,0x58);
-	       SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x2d,0xe4);
-	       SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x2e,0x73);
-	       SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x2f,0xda);
-	       SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x30,0x13);
-	       SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x43,0x72);
-           }
-         }
-       }
-     }
-     return;
-  }
-#endif  
+  if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) return;
+#endif
 
-  if(ModeNo<=0x13) {
-    	modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;      /* si+St_ResInfo */
-    	resinfo = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ResInfo;
-    	crt2crtc = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC;
+  if(ModeNo <= 0x13) {
+     modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
+     crt2crtc = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC;
   } else {
-    	modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;     /* si+Ext_ResInfo */
-    	resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO;
+     if(SiS_Pr->UseCustomMode) {
+        modeflag = SiS_Pr->CModeFlag;
+	crt2crtc = 0;
+     } else {
+        modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
     	crt2crtc = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC;
+     }
   }
 
-  tempcx = SiS_Pr->SiS_VBInfo;
-  tempax = (tempcx & 0x00FF) << 8;
-  tempbx = (tempcx & 0x00FF) | ((tempcx & 0x00FF) << 8);
-  tempbx &= 0x0410;
-  temp = (tempax & 0x0800) >> 8;
-  temp >>= 1;
-  temp |= (((tempbx & 0xFF00) >> 8) << 1);
-  temp |= ((tempbx & 0x00FF) >> 3);
-  temp ^= 0x0C;
-
-  /* TW: From 1.10.7w (no vb check there; don't care - this only disables SVIDEO and CVBS signal) */
-  if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {
-  	temp |= 0x0c;
-  }
+  temp = 0;
+  if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToAVIDEO)) temp |= 0x08;
+  if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToSVIDEO)) temp |= 0x04;
+  if(SiS_Pr->SiS_VBInfo & SetCRT2ToSCART)     temp |= 0x02;
+  if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision)  temp |= 0x01;
+
+  if(!(SiS_Pr->SiS_TVMode & TVSetPAL)) 	      temp |= 0x10;
+
+  SiS_SetReg(SiS_Pr->SiS_Part2Port,0x00,temp);
 
   PhasePoint  = SiS_Pr->SiS_PALPhase;
   TimingPoint = SiS_Pr->SiS_PALTiming;
-  
-  if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVisionTV) {          
-  
-    temp ^= 0x01;
-    if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) {
-      TimingPoint = SiS_Pr->SiS_HiTVSt2Timing;
-      if(SiS_Pr->SiS_SetFlag & TVSimuMode) {
-        if(modeflag & Charx8Dot) TimingPoint = SiS_Pr->SiS_HiTVSt1Timing;
-        else TimingPoint = SiS_Pr->SiS_HiTVTextTiming;
-      }
-    } else TimingPoint = SiS_Pr->SiS_HiTVExtTiming;
-    
-    if(SiS_Pr->SiS_HiVision & 0x03) temp &= 0xfe;
-    
-  } else {
-  
-    if(SiS_Pr->SiS_VBInfo & SetPALTV){
 
-      TimingPoint = SiS_Pr->SiS_PALTiming;
-      PhasePoint  = SiS_Pr->SiS_PALPhase;
+  if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) {
 
-      if( (SiS_Pr->SiS_VBType & VB_SIS301B302B) &&
-          ( (!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) ||
-	    (SiS_Pr->SiS_SetFlag & TVSimuMode) ) ) {
-         PhasePoint = SiS_Pr->SiS_PALPhase2;
-      }
+     TimingPoint = SiS_Pr->SiS_HiTVExtTiming;
+     if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) {
+        TimingPoint = SiS_Pr->SiS_HiTVSt2Timing;
+        if(SiS_Pr->SiS_TVMode & TVSetTVSimuMode) {
+	   TimingPoint = SiS_Pr->SiS_HiTVSt1Timing;
+#if 0
+           if(!(modeflag & Charx8Dot))  TimingPoint = SiS_Pr->SiS_HiTVTextTiming;
+#endif
+        }
+     }
 
-    } else {
+  } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) {
 
-        temp |= 0x10;
-	TimingPoint = SiS_Pr->SiS_NTSCTiming;
-	PhasePoint  = SiS_Pr->SiS_NTSCPhase;
+     if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p)      TimingPoint = &SiS_YPbPrTable[2][0];
+     else if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p) TimingPoint = &SiS_YPbPrTable[1][0];
+     else					  TimingPoint = &SiS_YPbPrTable[0][0];
 
-        if( (SiS_Pr->SiS_VBType & VB_SIS301B302B) &&
-	    ( (!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) ||
-	      (SiS_Pr->SiS_SetFlag & TVSimuMode) ) ) {
-        	PhasePoint = SiS_Pr->SiS_NTSCPhase2;
-        }
+     PhasePoint = SiS_Pr->SiS_NTSCPhase;
+
+  } else if(SiS_Pr->SiS_TVMode & TVSetPAL) {
+
+     if( (SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) &&
+         ( (!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) ||
+	   (SiS_Pr->SiS_TVMode & TVSetTVSimuMode) ) ) {
+        PhasePoint = SiS_Pr->SiS_PALPhase2;
+     }
+
+  } else {
+
+     TimingPoint = SiS_Pr->SiS_NTSCTiming;
+     PhasePoint  = SiS_Pr->SiS_NTSCPhase;
+     if(SiS_Pr->SiS_TVMode & TVSetNTSCJ) {
+	PhasePoint = SiS_Pr->SiS_PALPhase;
+     }
+
+     if( (SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) &&
+	 ( (!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) ||
+	   (SiS_Pr->SiS_TVMode & TVSetTVSimuMode) ) ) {
+        PhasePoint = SiS_Pr->SiS_NTSCPhase2;
+	if(SiS_Pr->SiS_TVMode & TVSetNTSCJ) {
+	   PhasePoint = SiS_Pr->SiS_PALPhase2;
+	}
+     }
 
-    }
-    
   }
-  SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x00,temp);
 
-  temp = 0;
-  if((HwDeviceExtension->jChipType == SIS_630)||
-     (HwDeviceExtension->jChipType == SIS_730)) {
-     temp = 0x35;
-  }
-  if(HwDeviceExtension->jChipType >= SIS_315H) {
-     temp = 0x38;
-  }
-  if(temp) {
-    if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
-      if(SiS_GetReg1(SiS_Pr->SiS_P3d4,0x31) & 0x01) {
-          temp1 = SiS_GetReg1(SiS_Pr->SiS_P3d4,temp);
-          if(temp1 & EnablePALM) {	/* 0x40 */
-              	PhasePoint = SiS_Pr->SiS_PALMPhase;
-		if( (SiS_Pr->SiS_VBType & VB_SIS301B302B) &&
-		    ( (!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) ||
-		      (SiS_Pr->SiS_SetFlag & TVSimuMode) ) ) {
-	           PhasePoint = SiS_Pr->SiS_PALMPhase2;
-		}
-	  }
-          if(temp1 & EnablePALN) {	/* 0x80 */
-               	PhasePoint = SiS_Pr->SiS_PALNPhase;
-		if( (SiS_Pr->SiS_VBType & VB_SIS301B302B) &&
-		    ( (!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) ||
-		      (SiS_Pr->SiS_SetFlag & TVSimuMode) ) ) {
-	           PhasePoint = SiS_Pr->SiS_PALNPhase2;
-		}
-	  }
-      }
-    }
+  if(SiS_Pr->SiS_TVMode & TVSetPALM) {
+     PhasePoint = SiS_Pr->SiS_PALMPhase;
+     if( (SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) &&
+	 ( (!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) ||
+	   (SiS_Pr->SiS_TVMode & TVSetTVSimuMode) ) ) {
+        PhasePoint = SiS_Pr->SiS_PALMPhase2;
+     }
   }
 
-#ifdef SIS315H
-  /* TW: 650/301LV BIOS */
-  if(HwDeviceExtension->jChipType >= SIS_315H) {
-     if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {  
-        if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
-           if(!(SiS_Pr->SiS_VBInfo & SetPALTV)) {
-              if((ModeNo == 0x4a) || (ModeNo == 0x38)) {
-	         PhasePoint = SiS_Pr->SiS_SpecialPhase;
-	      }
-           }
-        }
+  if(SiS_Pr->SiS_TVMode & TVSetPALN) {
+     PhasePoint = SiS_Pr->SiS_PALNPhase;
+     if( (SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) &&
+	 ( (!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) ||
+	   (SiS_Pr->SiS_TVMode & TVSetTVSimuMode) ) ) {
+	PhasePoint = SiS_Pr->SiS_PALNPhase2;
+     }
+  }
+
+  if(SiS_Pr->SiS_TVMode & TVSetNTSC1024) {
+     PhasePoint = SiS_Pr->SiS_SpecialPhase;
+     if(SiS_Pr->SiS_TVMode & TVSetPALM) {
+        PhasePoint = SiS_Pr->SiS_SpecialPhaseM;
+     } else if(SiS_Pr->SiS_TVMode & TVSetNTSCJ) {
+        PhasePoint = SiS_Pr->SiS_SpecialPhaseJ;
      }
   }
-#endif
 
   for(i=0x31, j=0; i<=0x34; i++, j++) {
-     SiS_SetReg1(SiS_Pr->SiS_Part2Port,i,PhasePoint[j]);
+     SiS_SetReg(SiS_Pr->SiS_Part2Port,i,PhasePoint[j]);
   }
 
   for(i=0x01, j=0; i<=0x2D; i++, j++) {
-     SiS_SetReg1(SiS_Pr->SiS_Part2Port,i,TimingPoint[j]);
+     SiS_SetReg(SiS_Pr->SiS_Part2Port,i,TimingPoint[j]);
   }
   for(i=0x39; i<=0x45; i++, j++) {
-     SiS_SetReg1(SiS_Pr->SiS_Part2Port,i,TimingPoint[j]);
+     SiS_SetReg(SiS_Pr->SiS_Part2Port,i,TimingPoint[j]);
   }
 
   if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
-    if(HwDeviceExtension->jChipType >= SIS_315H) {
-      if(!(SiS_Pr->SiS_ModeType & 0x07))
+     if(SiS_Pr->SiS_ModeType != ModeText) {
         SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x3A,0x1F);
-    } else {
-      SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x3A,0x1F);
-    }
+     }
   }
 
   SiS_SetRegOR(SiS_Pr->SiS_Part2Port,0x0A,SiS_Pr->SiS_NewFlickerMode);
 
-  SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x35,SiS_Pr->SiS_RY1COE);
-  SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x36,SiS_Pr->SiS_RY2COE);
-  SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x37,SiS_Pr->SiS_RY3COE);
-  SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x38,SiS_Pr->SiS_RY4COE);
-
-  if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVisionTV) {
-      if(SiS_Pr->SiS_HiVision == 3) tempax = 950;
-      else tempax = 440;
-  } else {
-    if(SiS_Pr->SiS_VBInfo & SetPALTV) tempax = 520;
-    else tempax = 440;
-  }
-
-  if( ( ( (!(SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) || (SiS_Pr->SiS_HiVision == 3) ) && (SiS_Pr->SiS_VDE <= tempax) ) ||
-      ( (SiS_Pr->SiS_VBInfo & SetCRT2ToTV) && (SiS_Pr->SiS_HiVision != 3) &&
-        ( (SiS_Pr->SiS_VGAHDE == 1024) || ((SiS_Pr->SiS_VGAHDE != 1024) && (SiS_Pr->SiS_VDE <= tempax)) ) ) ) {
+  SiS_SetReg(SiS_Pr->SiS_Part2Port,0x35,SiS_Pr->SiS_RY1COE);
+  SiS_SetReg(SiS_Pr->SiS_Part2Port,0x36,SiS_Pr->SiS_RY2COE);
+  SiS_SetReg(SiS_Pr->SiS_Part2Port,0x37,SiS_Pr->SiS_RY3COE);
+  SiS_SetReg(SiS_Pr->SiS_Part2Port,0x38,SiS_Pr->SiS_RY4COE);
+
+  if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) 	tempax = 950;
+  else if(SiS_Pr->SiS_TVMode & TVSetPAL)      	tempax = 520;
+  else 			            		tempax = 440;
+
+  if( ( (!(SiS_Pr->SiS_VBInfo & SetCRT2ToTVNoHiVision)) && (SiS_Pr->SiS_VDE <= tempax) ) ||
+      ( (SiS_Pr->SiS_VBInfo & SetCRT2ToTVNoHiVision) &&
+        ((SiS_Pr->SiS_VGAHDE == 1024) || (SiS_Pr->SiS_VDE <= tempax)) ) ) {
 
      tempax -= SiS_Pr->SiS_VDE;
      tempax >>= 2;
-     tempax = (tempax & 0x00FF) | ((tempax & 0x00FF) << 8);
+     tempax &= 0x00ff;
+
+     temp = tempax + (USHORT)TimingPoint[0];
+     SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,temp);
+
+     temp = tempax + (USHORT)TimingPoint[1];
+     SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,temp);
 
-     temp = (tempax & 0xFF00) >> 8;
-     temp += (USHORT)TimingPoint[0];
-     SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x01,temp);
-
-     temp = (tempax & 0xFF00) >> 8;
-     temp += (USHORT)TimingPoint[1];
-     SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x02,temp);
-
-     if( (SiS_Pr->SiS_VBInfo & (SetCRT2ToTV - SetCRT2ToHiVisionTV)) &&
-        (SiS_Pr->SiS_HiVision != 3) &&
-        (SiS_Pr->SiS_VGAHDE >= 1024) ) {
-        if(SiS_Pr->SiS_VBInfo & SetPALTV) {
-           SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x01,0x19);
-           SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x02,0x52);
+     if((SiS_Pr->SiS_VBInfo & SetCRT2ToTVNoHiVision) && (SiS_Pr->SiS_VGAHDE >= 1024)) {
+        if(SiS_Pr->SiS_TVMode & TVSetPAL) {
+           SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x19);
+           SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x52);
         } else {
-           if(HwDeviceExtension->jChipType >= SIS_315H) {
-             SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x01,0x17);
-             SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x02,0x1d);
-	   } else {
-             SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x01,0x0b);
-             SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x02,0x11);
-	   }
+           SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x17);
+           SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x1d);
         }
      }
 
   }
 
   tempcx = SiS_Pr->SiS_HT;
-
-  /* TW: 650/30xLV 1.10.6s */
-  if(HwDeviceExtension->jChipType >= SIS_315H) {
-      if(SiS_GetReg1(SiS_Pr->SiS_P3d4,0x39) & 0x04) {
-      	   tempcx >>= 1;
-      }
-  }
-
+  if(SiS_IsDualLink(SiS_Pr, HwInfo)) tempcx >>= 1;
   tempcx--;
-  if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
-        tempcx--;
-  }
+  if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) tempcx--;
   temp = tempcx & 0x00FF;
-  SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x1B,temp);
+  SiS_SetReg(SiS_Pr->SiS_Part2Port,0x1B,temp);
   temp = (tempcx & 0xFF00) >> 8;
   SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x1D,0xF0,temp);
 
   tempcx++;
-  if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
-        tempcx++;
-  }
+  if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) tempcx++;
   tempcx >>= 1;
 
   push1 = tempcx;
 
   tempcx += 7;
-  if((SiS_Pr->SiS_VBInfo & SetCRT2ToHiVisionTV) &&
-     (SiS_Pr->SiS_HiVision == 3)) {
-       tempcx -= 4;
-  }
+  if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) tempcx -= 4;
   temp = (tempcx & 0x00FF) << 4;
   SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x22,0x0F,temp);
 
   tempbx = TimingPoint[j] | ((TimingPoint[j+1]) << 8);
   tempbx += tempcx;
 
-  push2 = tempbx;
-
   temp = tempbx & 0x00FF;
-  SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x24,temp);
+  SiS_SetReg(SiS_Pr->SiS_Part2Port,0x24,temp);
   temp = ((tempbx & 0xFF00) >> 8) << 4;
   SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x25,0x0F,temp);
 
-  tempbx = push2;
-
   tempbx += 8;
-  if((SiS_Pr->SiS_VBInfo & SetCRT2ToHiVisionTV) &&
-     (SiS_Pr->SiS_HiVision == 3)) {
-    tempbx -= 4;
-    tempcx = tempbx;
+  if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) {
+     tempbx -= 4;
+     tempcx = tempbx;
   }
   temp = (tempbx & 0x00FF) << 4;
   SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x29,0x0F,temp);
@@ -7210,15 +7462,12 @@
   j += 2;
   tempcx += ((TimingPoint[j] | ((TimingPoint[j+1]) << 8)));
   temp = tempcx & 0x00FF;
-  SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x27,temp);
+  SiS_SetReg(SiS_Pr->SiS_Part2Port,0x27,temp);
   temp = ((tempcx & 0xFF00) >> 8) << 4;
   SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x28,0x0F,temp);
 
   tempcx += 8;
-  if((SiS_Pr->SiS_VBInfo & SetCRT2ToHiVisionTV) &&
-     (SiS_Pr->SiS_HiVision == 3)) {
-     tempcx -= 4; 
-  }
+  if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) tempcx -= 4;
   temp = (tempcx & 0x00FF) << 4;
   SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x2A,0x0F,temp);
 
@@ -7231,363 +7480,265 @@
 
   tempcx -= 11;
   if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) {
-    tempax = SiS_GetVGAHT2(SiS_Pr) - 1;
-    tempcx = tempax;
+     tempcx = SiS_GetVGAHT2(SiS_Pr) - 1;
   }
   temp = tempcx & 0x00FF;
-  SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x2E,temp);
+  SiS_SetReg(SiS_Pr->SiS_Part2Port,0x2E,temp);
 
   tempbx = SiS_Pr->SiS_VDE;
   if(SiS_Pr->SiS_VGAVDE == 360) tempbx = 746;
   if(SiS_Pr->SiS_VGAVDE == 375) tempbx = 746;
   if(SiS_Pr->SiS_VGAVDE == 405) tempbx = 853;
-  if(HwDeviceExtension->jChipType < SIS_315H) {
-  	if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) tempbx >>= 1;
+  if(HwInfo->jChipType < SIS_315H) {
+     if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) tempbx >>= 1;
   } else {
-	if((SiS_Pr->SiS_VBInfo & SetCRT2ToTV) && (!(SiS_Pr->SiS_HiVision & 0x03))) {
-	   tempbx >>= 1;
-	   if(SiS_Pr->SiS_SetFlag & TVSimuMode) {
-	      if(ModeNo <= 0x13) {
-	         if(crt2crtc == 1) {
-	            tempbx++;
-                 }
-	      }
-	   } else {
-              if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) {
-	         if(crt2crtc == 4)   /* TW: BIOS calls GetRatePtrCRT2 here - does not make sense */
-                    if(SiS_Pr->SiS_ModeType <= 3) tempbx++;
-	      }
+     if( (SiS_Pr->SiS_VBInfo & SetCRT2ToTV) &&
+         (!(SiS_Pr->SiS_TVMode & (TVSetYPbPr525p|TVSetYPbPr750p))) ) {
+	tempbx >>= 1;
+	if(SiS_Pr->SiS_TVMode & TVSetTVSimuMode) {
+	   if(ModeNo <= 0x13) {
+	      if(crt2crtc == 1) tempbx++;
+	   }
+	} else if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) {
+	   if(crt2crtc == 4) {
+              if(SiS_Pr->SiS_ModeType <= 3) tempbx++;
 	   }
-        }
+	}
+     }
   }
   tempbx -= 2;
   temp = tempbx & 0x00FF;
-  if((SiS_Pr->SiS_VBInfo & SetCRT2ToHiVisionTV) &&
-     (SiS_Pr->SiS_HiVision == 3)) {
-    if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) {
-      if(ModeNo == 0x2f) temp++;
-    }
-  }
-  /* TW: From 1.10.7w - doesn't make sense */
-  if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
+  if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) {
      if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) {
-        if(!(SiS_Pr->SiS_VBInfo & SetPALTV)) {
-	   if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) {   /* SetFlag?? */
-	       if(ModeNo == 0x03) temp++;
-	   }
-	}
+        if((ModeNo == 0x2f) || (ModeNo == 0x5d) || (ModeNo == 0x5e)) temp++;
      }
   }
-  SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x2F,temp);
 
-  tempax = (tempcx & 0xFF00) | (tempax & 0x00FF);
-  tempbx = ((tempbx & 0xFF00) << 6) | (tempbx & 0x00FF);
-  tempax |= (tempbx & 0xFF00);
-  if(HwDeviceExtension->jChipType < SIS_315H) {
-     if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVisionTV)) {
-        if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToSCART)) {		/* TW: New from 630/301B (II) BIOS */
-           tempax |= 0x1000;
-           if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToSVIDEO))  tempax |= 0x2000;
+  if(HwInfo->jChipType < SIS_661) {
+     /* From 1.10.7w - doesn't make sense */
+     if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
+        if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) {
+           if(!(SiS_Pr->SiS_TVMode & TVSetPAL)) {
+	      if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) {   /* SetFlag?? */
+	         if(ModeNo == 0x03) temp++;
+	      }
+	   }
         }
      }
-  } else {
-     /* TODO Check this with other BIOSes */
-     if((!(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVisionTV)) && 
-        (SiS_Pr->SiS_HiVision == 3)) {
-	tempax |= 0x1000;
-        if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToSVIDEO))  tempax |= 0x2000;
-     }
   }
-  temp = (tempax & 0xFF00) >> 8;
-  SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x30,temp);
+  SiS_SetReg(SiS_Pr->SiS_Part2Port,0x2F,temp);
+
+  temp = (tempcx >> 8) & 0x0F;
+  temp |= (((tempbx >> 8) << 6) & 0xC0);
+  if(!(SiS_Pr->SiS_VBInfo & (SetCRT2ToHiVision | SetCRT2ToYPbPr525750 | SetCRT2ToSCART))) {
+     temp |= 0x10;
+     if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToSVIDEO)) temp |= 0x20;
+  }
+  SiS_SetReg(SiS_Pr->SiS_Part2Port,0x30,temp);
 
-  /* TW: 650/30xLV 1.10.6s */
-  if(HwDeviceExtension->jChipType > SIS_315H) {
+  if((HwInfo->jChipType > SIS_315H) && (HwInfo->jChipType < SIS_661)) {
      if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
-        if( (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) ||
-            (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200) ) {
-            SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x10,0x60);
+        if(SiS_Pr->SiS_VBType & (VB_SIS301C | VB_SIS302LV | VB_SIS302ELV)) {
+           if( (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) ||
+               (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200) ) {
+              SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x10,0x60);
+	   }
         }
      }
   }
-  
-  if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVisionTV) {
-     if(SiS_Pr->SiS_HiVision != 3) {
-	for(i=0, j=0; i<=0x2d; i++, j++) {
-	    SiS_SetReg1(SiS_Pr->SiS_Part2Port,i,SiS_HiVisionTable[SiS_Pr->SiS_HiVision][j]);
+
+  if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
+     tempbx = SiS_Pr->SiS_VDE;
+     if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
+        if(!(SiS_Pr->SiS_TVMode & (TVSetYPbPr525p | TVSetYPbPr750p))) {
+           tempbx >>= 1;
 	}
-	for(i=0x39; i<=0x45; i++, j++) {
-	    SiS_SetReg1(SiS_Pr->SiS_Part2Port,i,SiS_HiVisionTable[SiS_Pr->SiS_HiVision][j]);
+     }
+     tempbx -= 3;
+     if(HwInfo->jChipType >= SIS_661) {
+        if(SiS_Pr->SiS_VBType & (VB_SIS301C | VB_SIS302LV | VB_SIS302ELV)) {  /* Why not 301B/LV? */
+           temp = 0;
+	   if(tempcx & 0x0400) temp |= 0x20;
+	   if(tempbx & 0x0400) temp |= 0x40;
+	   SiS_SetReg(SiS_Pr->SiS_Part4Port,0x10,temp);
 	}
      }
-  }
+     tempbx &= 0x03ff;
+     temp = ((tempbx & 0xFF00) >> 8) << 5;
+     temp |= 0x18;
+     SiS_SetReg(SiS_Pr->SiS_Part2Port,0x46,temp);
+     temp = tempbx & 0x00FF;
+     SiS_SetReg(SiS_Pr->SiS_Part2Port,0x47,temp);
 
-  if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {     
-    tempbx = SiS_Pr->SiS_VDE;
-    if((SiS_Pr->SiS_VBInfo & SetCRT2ToTV) && (!(SiS_Pr->SiS_HiVision & 0x03))) {
-         tempbx >>= 1;
-    }
-    tempbx -= 3;
-    tempbx &= 0x03ff;
-    temp = ((tempbx & 0xFF00) >> 8) << 5;
-    temp |= 0x18;
-    SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x46,temp);
-    temp = tempbx & 0x00FF;
-    SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x47,temp);	/* tv gatingno */
-    if(HwDeviceExtension->jChipType >= SIS_315H) {	/* TW: 650/30xLV 1.10.6s */
-       if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {
-          tempax = 0;
-          if(SiS_Pr->SiS_HiVision & 0x03) {
-	     tempax = 0x3000;
-	     if(SiS_Pr->SiS_HiVision & 0x01) tempax = 0x5000;
-	  }
-	  temp = (tempax & 0xFF00) >> 8;
-          SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x4d,temp);
-       }
-    }
   }
 
-  tempbx &= 0x00FF;
+  tempbx = 0;
   if(!(modeflag & HalfDCLK)) {
-    tempcx = SiS_Pr->SiS_VGAHDE;
-    if(tempcx >= SiS_Pr->SiS_HDE) {
-      tempbx |= 0x2000;
-      tempax &= 0x00FF;
-    }
+     if(SiS_Pr->SiS_VGAHDE >= SiS_Pr->SiS_HDE) {
+        tempax = 0;
+        tempbx |= 0x2000;
+     }
   }
 
   tempcx = 0x0101;
-/*if(SiS_Pr->SiS_VBInfo & (SetPALTV | SetCRT2ToTV)) {  */ /*301b- TW: BIOS BUG? */
-  if(SiS_Pr->SiS_VBInfo & (SetCRT2ToTV - SetCRT2ToHiVisionTV)) {
-    if(!(SiS_Pr->SiS_HiVision & 0x03)) {
-      if(SiS_Pr->SiS_VGAHDE >= 1024) {
-        if((!(modeflag & HalfDCLK)) || (HwDeviceExtension->jChipType < SIS_315H)) {   /* TW: This check not in 630/301B */
-          tempcx = 0x1920;
-          if(SiS_Pr->SiS_VGAHDE >= 1280) {
-            tempcx = 0x1420;
-            tempbx &= 0xDFFF;
-          }
+  if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
+     if(SiS_Pr->SiS_VGAHDE >= 1024) {
+        if((!(modeflag & HalfDCLK)) || (HwInfo->jChipType < SIS_315H)) {
+           tempcx = 0x1920;
+           if(SiS_Pr->SiS_VGAHDE >= 1280) {
+              tempcx = 0x1420;
+              tempbx &= ~0x2000;
+           }
         }
-      }
-    }
+     }
   }
 
   if(!(tempbx & 0x2000)) {
-    if(modeflag & HalfDCLK) {
-         tempcx = (tempcx & 0xFF00) | (((tempcx & 0x00FF) << 1) & 0xff);
-    }
-    push1 = tempbx;
-    tempeax = SiS_Pr->SiS_VGAHDE;
-    tempebx = (tempcx & 0xFF00) >> 8;
-    longtemp = tempeax * tempebx;
-    tempecx = tempcx & 0x00FF;
-    longtemp /= tempecx;
-    longtemp <<= 0x0d;
-    if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
+     if(modeflag & HalfDCLK) {
+        tempcx = (tempcx & 0xFF00) | ((tempcx << 1) & 0x00FF);
+     }
+     longtemp = (SiS_Pr->SiS_VGAHDE * ((tempcx & 0xFF00) >> 8)) / (tempcx & 0x00FF);
+     longtemp <<= 13;
+     if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
      	longtemp <<= 3;
-    }
-    tempecx = SiS_Pr->SiS_HDE;
-    temp2 = longtemp % tempecx;
-    tempeax = longtemp / tempecx;
-    if(temp2 != 0) tempeax++;
-    tempax = (USHORT)tempeax;
-    tempbx = push1;
-    tempcx = (tempcx & 0xff00) | (((tempax & 0xFF00) >> 8) >> 5);
-    tempbx |= (tempax & 0x1F00);
-    tempax = ((tempax & 0x00FF) << 8) | (tempax & 0x00FF);
+     }
+     tempeax = longtemp / SiS_Pr->SiS_HDE;
+     if(longtemp % SiS_Pr->SiS_HDE) tempeax++;
+     tempax = (USHORT)tempeax;
+     tempbx |= (tempax & 0x1F00);
+     tempcx = (tempax & 0xFF00) >> (8 + 5);
   }
 
-  temp = (tempax & 0xFF00) >> 8;
-  SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x44,temp);
-  temp = (tempbx & 0xFF00) >> 8;
-  SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x45,0xC0,temp);
+  SiS_SetReg(SiS_Pr->SiS_Part2Port,0x44,tempax);
+  SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x45,0xC0,(tempbx >> 8));
 
   if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
-       temp = tempcx & 0x00FF;
-       if(tempbx & 0x2000) temp = 0;
-       temp |= 0x18;
-       SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x46,0xE0,temp);
-       if(SiS_Pr->SiS_VBInfo & SetPALTV) {
-             tempbx = 0x0382;  
-             tempcx = 0x007e;  
-       } else {
-             tempbx = 0x0369;  
-             tempcx = 0x0061;  
-       }
-       temp = (tempbx & 0x00FF) ;
-       SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x4B,temp);
-       temp = (tempcx & 0x00FF) ;
-       SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x4C,temp);
-       tempbx &= 0x03FF;
-       temp = (tempcx & 0xFF00) >> 8;
-       temp = (temp & 0x0003) << 2;
-       temp |= (tempbx >> 8);
-       if(HwDeviceExtension->jChipType < SIS_315H) {
-          SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x4D,temp);
-       } else {
-          SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x4D,0xF0,temp);
-       }
 
-       temp = SiS_GetReg1(SiS_Pr->SiS_Part2Port,0x43);
-       SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x43,(USHORT)(temp - 3));
-  }
+     temp = tempcx & 0x0007;
+     if(tempbx & 0x2000) temp = 0;
+     if((HwInfo->jChipType < SIS_661) || (!(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD))) {
+        temp |= 0x18;
+     }
+     SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x46,0xE0,temp);
+
+     if(SiS_Pr->SiS_TVMode & TVSetPAL) {
+        tempbx = 0x0382;
+        tempcx = 0x007e;
+     } else {
+        tempbx = 0x0369;
+        tempcx = 0x0061;
+     }
+     temp = (tempbx & 0x00FF) ;
+     SiS_SetReg(SiS_Pr->SiS_Part2Port,0x4B,temp);
+     temp = (tempcx & 0x00FF) ;
+     SiS_SetReg(SiS_Pr->SiS_Part2Port,0x4C,temp);
+     temp = (tempcx & 0x0300) >> (8 - 2);
+     temp |= ((tempbx >> 8) & 0x03);
+     if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) {
+        temp |= 0x10;
+	if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p)      temp |= 0x20;
+	else if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) temp |= 0x40;
+     }
+     SiS_SetReg(SiS_Pr->SiS_Part2Port,0x4D,temp);
 
-  temp = 0;
-  if((HwDeviceExtension->jChipType == SIS_630) ||
-     (HwDeviceExtension->jChipType == SIS_730)) {
-     temp = 0x35;
-  } else if(HwDeviceExtension->jChipType >= SIS_315H) {
-     temp = 0x38;
-  }
-  if(temp) {
-      if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
-          if(SiS_GetReg1(SiS_Pr->SiS_P3d4,0x31) & 0x01) {
-               if(SiS_GetReg1(SiS_Pr->SiS_P3d4,temp) & EnablePALM) {  /* 0x40 */
-                     SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x00,0xEF);
-                     temp = SiS_GetReg1(SiS_Pr->SiS_Part2Port,0x01);
-                     SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x01,temp - 1);
-               }
-          }
-      }
-  }
+     temp = SiS_GetReg(SiS_Pr->SiS_Part2Port,0x43);
+     SiS_SetReg(SiS_Pr->SiS_Part2Port,0x43,(USHORT)(temp - 3));
+
+     SiS_SetTVSpecial(SiS_Pr, ModeNo);
+
+     if(SiS_Pr->SiS_VBType & VB_SIS301C) {
+        temp = 0;
+        if(SiS_Pr->SiS_TVMode & TVSetPALM) temp = 8;
+        SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x4e,0xf7,temp);
+     }
 
-  if( (SiS_Pr->SiS_VBInfo & SetCRT2ToHiVisionTV) &&
-      (!(SiS_Pr->SiS_VBType & VB_SIS301LV302LV)) ) {
-    if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) {
-      SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x0B,0x00);
-    }
   }
 
-  if(HwDeviceExtension->jChipType < SIS_315H) {
-     if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
-     	SiS_Set300Part2Regs(SiS_Pr, HwDeviceExtension, ModeIdIndex,
-			    RefreshRateTableIndex, BaseAddr, ModeNo);
-	return;
+  if(SiS_Pr->SiS_TVMode & TVSetPALM) {
+     if(!(SiS_Pr->SiS_TVMode & TVSetNTSC1024)) {
+        temp = SiS_GetReg(SiS_Pr->SiS_Part2Port,0x01);
+        SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,temp - 1);
      }
-  } else {
-     /* TW: !!! The following is a duplicate, done for LCDA as well (see above) */
-     if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
-       if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {    
-         if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
-           if(!(SiS_Pr->SiS_VBInfo & SetPALTV)) {
-             if((ModeNo == 0x4a) || (ModeNo == 0x38)) {
-               SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x1c,0xa7);
-	       SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x1d,0x07);
-	       SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x1e,0xf2);
-	       SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x1f,0x6e);
-	       SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x20,0x17);
-	       SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x21,0x8b);
-	       SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x22,0x73);
-	       SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x23,0x53);
-	       SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x24,0x13);
-	       SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x25,0x40);
-	       SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x26,0x34);
-	       SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x27,0xf4);
-	       SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x28,0x63);
-	       SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x29,0xbb);
-	       SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x2a,0xcc);
-	       SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x2b,0x7a);
-	       SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x2c,0x58);
-	       SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x2d,0xe4);
-	       SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x2e,0x73);
-	       SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x2f,0xda);
-	       SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x30,0x13);
-	       SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x43,0x72);
-	     }
-           }
-         }
-       }
-       return;
+     SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x00,0xEF);
+  }
+
+  if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) {
+     if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) {
+        SiS_SetReg(SiS_Pr->SiS_Part2Port,0x0B,0x00);
      }
   }
 
-  /* TW: From here: Part2 LCD setup */
+  if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) return;
+
+  /* From here: Part2 LCD setup */
 
   tempbx = SiS_Pr->SiS_HDE;
-  if(HwDeviceExtension->jChipType >= SIS_315H) {
-      /* TW: 650/30xLV 1.10.6s */
-      if(SiS_GetReg1(SiS_Pr->SiS_P3d4,0x39) & 0x04) tempbx >>= 1;
-  }
-  tempbx--;			         	/* RHACTE=HDE-1 */
+  if(SiS_IsDualLink(SiS_Pr, HwInfo)) tempbx >>= 1;
+  tempbx--;			         	/* RHACTE = HDE - 1 */
   temp = tempbx & 0x00FF;
-  SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x2C,temp);
-  temp = (tempbx & 0xFF00) >> 8;
-  temp <<= 4;
+  SiS_SetReg(SiS_Pr->SiS_Part2Port,0x2C,temp);
+  temp = (tempbx & 0xFF00) >> 4;
   SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x2B,0x0F,temp);
 
   temp = 0x01;
   if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) {
-    if(SiS_Pr->SiS_ModeType == ModeEGA) {
-      if(SiS_Pr->SiS_VGAHDE >= 1024) {
-        temp = 0x02;
-	if(HwDeviceExtension->jChipType >= SIS_315H) {
-           if(SiS_Pr->SiS_SetFlag & LCDVESATiming) {
-             temp = 0x01;
+     if(SiS_Pr->SiS_ModeType == ModeEGA) {
+        if(SiS_Pr->SiS_VGAHDE >= 1024) {
+           temp = 0x02;
+	   if(HwInfo->jChipType >= SIS_315H) {
+              if(SiS_Pr->SiS_SetFlag & LCDVESATiming) {
+                 temp = 0x01;
+	      }
 	   }
-	}
-      }
-    }
+        }
+     }
   }
-  SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x0B,temp);
-
-  tempbx = SiS_Pr->SiS_VDE;         		/* RTVACTEO=(VDE-1)&0xFF */
-  push1 = tempbx;
+  SiS_SetReg(SiS_Pr->SiS_Part2Port,0x0B,temp);
 
-  tempbx--;
+  tempbx = SiS_Pr->SiS_VDE - 1;
   temp = tempbx & 0x00FF;
-  SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x03,temp);
+  SiS_SetReg(SiS_Pr->SiS_Part2Port,0x03,temp);
   temp = ((tempbx & 0xFF00) >> 8) & 0x07;
   SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x0C,0xF8,temp);
 
-  tempcx = SiS_Pr->SiS_VT;
-  push2 = tempcx;
+  tempcx = SiS_Pr->SiS_VT - 1;
+  temp = tempcx & 0x00FF;
+  SiS_SetReg(SiS_Pr->SiS_Part2Port,0x19,temp);
 
-  tempcx--;
-  temp = tempcx & 0x00FF;  			 /* RVTVT=VT-1 */
-  SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x19,temp);
+  temp = ((tempcx & 0xFF00) >> 8) << 5;
 
-  temp = (tempcx & 0xFF00) >> 8;
-  temp <<= 5;
-  
-  /* Enable dithering; newer versions only do this for 32bpp mode */
-  if((HwDeviceExtension->jChipType == SIS_300) && (SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV)) {
-    if(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit) temp |= 0x10;
-  } else if(HwDeviceExtension->jChipType < SIS_315H) {
-    if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) temp |= 0x10;
-    else {
-      if(SiS_Pr->SiS_LCDInfo & LCDSync)       /* TW: 630/301 BIOS checks this */
-         temp |= 0x10;
-    }
-  } else {
-      if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {
-         /* TW: 650/30xLV 1.10.6s */
-         if(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit) {
-            if(SiS_GetReg1(SiS_Pr->SiS_Part1Port,0x00) & 0x01) {  /* 32bpp mode? */
-      	       temp |= 0x10;
-	    }
-         }
-      } else {
-         temp |= 0x10;
-      }
+  /* Enable dithering; only do this for 32bpp mode */
+  if(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit) {
+     if(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0x01) {
+        temp |= 0x10;
+     }
   }
 
-  /* 630/301 does not do all this */
+  /* Must do special for Compaq1280; Acer1280 OK, Clevo1400 OK, COMPAL1400 OK */
+  /* Compaq1280 panel loses sync if using CR37 sync info. */
   if((SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD)) {
-     if((HwDeviceExtension->jChipType >= SIS_315H) && (SiS_Pr->SiS_VBType & VB_SIS301LV302LV)) {
-        /* TW: 650/30xLV 1.10.6s */
-        temp |= (SiS_GetReg1(SiS_Pr->SiS_P3d4,0x37) >> 6);
-	temp |= 0x08;   					/* From 1.10.7w */
-	if(!(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit)) temp |= 0x04; 	/* From 1.10.7w */
+     if((HwInfo->jChipType >= SIS_315H) && (SiS_Pr->SiS_VBType & VB_SIS301LV302LV)) {
+	if((SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) &&
+	   (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024)) {
+	   if(SiS_Pr->SiS_LCDInfo & LCDSync) {
+	      temp |= ((SiS_Pr->SiS_LCDInfo & 0xc0) >> 6);
+	   }
+	} else if((SiS_Pr->SiS_CustomT == CUT_CLEVO1400) &&
+	          (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050)) {
+	   temp |= 0x03;
+	} else {
+           temp |= (SiS_GetReg(SiS_Pr->SiS_P3d4,0x37) >> 6);
+	   temp |= 0x08;
+	   if(!(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit)) temp |= 0x04;
+	}
      } else {
-        tempbx = (tempbx & 0xFF00) | (SiS_Pr->SiS_LCDInfo & 0x0FF);
-        if(tempbx & LCDSync) {
-           tempbx &= 0xFFE0;
-           tempbx = (tempbx & 0xFF00) | ((tempbx & 0x00FF) >> 6);
-           temp |= (tempbx & 0x00FF);
-        }
+        if(SiS_Pr->SiS_LCDInfo & LCDSync) {
+	   temp |= ((SiS_Pr->SiS_LCDInfo & 0xc0) >> 6);
+	}
      }
   }
-  SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x1A,temp);
+
+  SiS_SetReg(SiS_Pr->SiS_Part2Port,0x1A,temp);
 
   SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x09,0xF0);
   SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x0A,0xF0);
@@ -7595,24 +7746,132 @@
   SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x17,0xFB);
   SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x18,0xDF);
 
-  /* 1280x960, 1280x1024 and 1600x1200 data invalid/missing in tables, use old calculation */
-  if((HwDeviceExtension->jChipType >= SIS_315H)             && 
-     (SiS_Pr->SiS_VBType & VB_SIS301LV302LV)                &&  
-     (SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel1280x1024) &&
-     (SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel1600x1200) &&
-     (SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel1280x960)) {
-     
-#ifdef SIS315H 							/* ------------- 310/325/330 series ------------ */
-
-      /* TW: Inserted this entire section from 650/301LV(x) BIOS */
-      
-      /* Using this on the 301B with an auto-expanding 1024 panel (CR37=1) results
-       * in a black bar in modes < 1024; if the panel is non-expanding, the bridge
-       * scales all modes to 1024. All modes in both variants (exp/non-exp) work.
+#if 0  /* Use the 315/330 series code for now */
+  if((HwInfo->jChipType >= SIS_661)          &&
+     (SiS_Pr->SiS_VBType & VB_SIS301LV302LV) &&
+     (ROMAddr && SiS_Pr->SiS_UseROM)) {
+
+      /* This is done for the LVDS bridges only, since
+       * the TMDS panels already work correctly with
+       * the old code. Besides, we only do that if
+       * we can get the data from the ROM, I am tired
+       * of carrying a lot of tables around.
        */
 
-      SiS_GetCRT2Part2Ptr(SiS_Pr,ROMAddr,ModeNo,ModeIdIndex,RefreshRateTableIndex,
-                         &CRT2Index,&resindex);
+#ifdef SIS315H 							/* ------------ 661/741/760 series --------- */
+      UCHAR *myptr = NULL, myptr1 = NULL;
+
+      myptr = (UCHAR *)GetLCDPtr661(SiS_Pr, HwInfo, 6, ModeNo, ModeIdIndex, RefreshRateTableIndex);
+      myptr1 = (UCHAR *)GetLCDStructPtr661(SiS_Pr, HwInfo);
+
+      tempbx = (myptr[3] | (myptr[4] << 8)) & 0x0fff;
+      tempcx = SiS_Pr->PanelYRes;
+      if(SiS_Pr->SiS_LCDInfo & LCDPass11) {
+         tempcx = SiS_Pr->SiS_VDE;
+      }
+
+      tempcx += tempbx;
+      if(tempcx >= SiS_Pr->SiS_VT) tempcx -= SiS_Pr->SiS_VT;
+
+      SiS_SetReg(SiS_Pr->SiS_Part2Port,0x05,tempbx);
+      SiS_SetReg(SiS_Pr->SiS_Part2Port,0x06,tempcx);
+
+      tempcx &= 0x07ff;
+      tempbx &= 0x07ff;
+      temp = (tempcx >> 8) << 3;
+      temp |= (tempbx >> 8);
+      SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,temp);
+
+      tempbx = (myptr[4] | (myptr[5] << 8)) >> 4;
+      tempcx = myptr1[6];
+      if(SiS_Pr->SiS_LCDInfo & LCDPass11) tempcx = myptr[7];
+
+      tempcx += tempbx;
+      if(tempcx >= SiS_Pr->SiS_VT) tempcx -= SiS_Pr->SiS_VT;
+
+      SiS_SetReg(SiS_Pr->SiS_Part2Port,0x04,tempbx);
+      temp = tempcx & 0x000f;
+      temp |= ((tempbx & 0x0f00) >> 4);
+      SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,temp);
+
+      tempax = SiS_Pr->SiS_HT;
+      tempbx = (myptr[0] | (myptr[1] << 8)) & 0x0fff;
+      tempcx = SiS_Pr->PanelXRes;
+      if(SiS_Pr->SiS_LCDInfo & LCDPass11) tempcx = SiS_Pr->SiS_HDE;
+
+      if(SiS_IsDualLink(SiS_Pr, HwInfo)) {
+         tempax >>= 1;
+	 tempbx >>= 1;
+	 tempcx >>= 1;
+      }
+      if(SiS_Pr->SiS_VBType & VB_SIS302LV)                 tempbx++;
+      if(SiS_Pr->SiS_VBType & (VB_SIS301C | VB_SIS302ELV)) tempbx++;
+
+      tempcx += tempbx;
+      if(tempcx >= tempax) tempcx -= tempax;
+
+      SiS_SetReg(SiS_Pr->SiS_Part2Port,0x1f,tempbx);
+      temp = ((tempbx & 0xff00) >> 8) << 4;
+      SiS_SetReg(SiS_Pr->SiS_Part2Port,0x20,temp);
+      SiS_SetReg(SiS_Pr->SiS_Part2Port,0x23,tempcx);
+      temp = tempcx >> 8;
+      SiS_SetReg(SiS_Pr->SiS_Part2Port,0x25,temp);
+
+      tempax = SiS_Pr->SiS_HT;
+      tempbx = (myptr[1] | (myptr[2] << 8)) >> 4;
+      tempcx = myptr1[5];
+      if(SiS_Pr->SiS_LCDInfo & LCDPass11) {
+         tempcx = myptr[6];
+      }
+      if(SiS_IsDualLink(SiS_Pr, HwInfo)) {
+         tempax >>= 1;
+	 tempbx >>= 1;
+	 tempcx >>= 1;
+      }
+      if(SiS_Pr->SiS_VBType & VB_SIS302LV) tempbx++;
+
+      tempcx += tempbx;
+      if(tempcx >= tempax) tempcx -= tempax;
+
+      SiS_SetReg(SiS_Pr->SiS_Part2Port,0x1c,tempbx);
+      temp = (tempbx & 0x0f00) >> 4;
+      SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x1d,0x0f,temp);
+      SiS_SetReg(SiS_Pr->SiS_Part2Port,0x21,tempcx);
+
+      if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) {
+         if(SiS_Pr->SiS_VGAVDE == 525) {
+	    temp = 0xc3;
+	    if(SiS_Pr->SiS_ModeType <= ModeVGA) {
+	       temp++;
+	       if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) temp += 2;
+	    }
+	    SiS_SetReg(SiS_Pr->SiS_Part2Port,0x2f,temp);
+	    SiS_SetReg(SiS_Pr->SiS_Part2Port,0x30,0xb3);
+	 } else if(SiS_Pr->SiS_VGAVDE == 420) {
+	    temp = 0x4d;
+	    if(SiS_Pr->SiS_ModeType <= ModeVGA) {
+	       temp++;
+	       if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) temp++;
+	    }
+	    SiS_SetReg(SiS_Pr->SiS_Part2Port,0x2f,temp);
+	 }
+      }
+
+#endif
+
+  } else
+#endif
+         if((HwInfo->jChipType >= SIS_315H)                    &&
+            (SiS_Pr->SiS_VBType & VB_SIS301LV302LV)            &&
+            ((SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768)  ||
+             (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) ||
+             (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) ||
+             (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200)) ) {
+
+#ifdef SIS315H 							/* ------------- 315/330 series ------------ */
+
+      SiS_GetCRT2Part2Ptr(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex,
+                          &CRT2Index, &resindex, HwInfo);
 
       switch(CRT2Index) {
         case Panel_1024x768      : CRT2Part2Ptr = SiS_Pr->SiS_CRT2Part2_1024x768_1;  break;  /* "Normal" */
@@ -7627,21 +7886,28 @@
         case Panel_1280x1024 + 32: CRT2Part2Ptr = SiS_Pr->SiS_CRT2Part2_1280x1024_3; break;
 	case Panel_1400x1050 + 32: CRT2Part2Ptr = SiS_Pr->SiS_CRT2Part2_1400x1050_3; break;
 	case Panel_1600x1200 + 32: CRT2Part2Ptr = SiS_Pr->SiS_CRT2Part2_1600x1200_3; break;
+	case 100:		   CRT2Part2Ptr = (SiS_Part2PortTblStruct *)SiS310_CRT2Part2_Compaq1280x1024_1; break;  /* Custom */
+	case 101:		   CRT2Part2Ptr = (SiS_Part2PortTblStruct *)SiS310_CRT2Part2_Compaq1280x1024_2; break;
+	case 102:		   CRT2Part2Ptr = (SiS_Part2PortTblStruct *)SiS310_CRT2Part2_Compaq1280x1024_3; break;
+	case 103:		   CRT2Part2Ptr = (SiS_Part2PortTblStruct *)SiS310_CRT2Part2_Clevo1024x768_1; break;    /* Custom */
+	case 104:		   CRT2Part2Ptr = (SiS_Part2PortTblStruct *)SiS310_CRT2Part2_Clevo1024x768_2; break;
+	case 105:		   CRT2Part2Ptr = (SiS_Part2PortTblStruct *)SiS310_CRT2Part2_Clevo1024x768_3; break;
+	case 106:		   CRT2Part2Ptr = (SiS_Part2PortTblStruct *)SiS310_CRT2Part2_Asus1024x768_3; break;
 	default:                   CRT2Part2Ptr = SiS_Pr->SiS_CRT2Part2_1024x768_3;  break;
       }
 
       SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x01,0x80,(CRT2Part2Ptr+resindex)->CR[0]);
       SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x02,0x80,(CRT2Part2Ptr+resindex)->CR[1]);
       for(i = 2, j = 0x04; j <= 0x06; i++, j++ ) {
-        SiS_SetReg1(SiS_Pr->SiS_Part2Port,j,(CRT2Part2Ptr+resindex)->CR[i]);
+        SiS_SetReg(SiS_Pr->SiS_Part2Port,j,(CRT2Part2Ptr+resindex)->CR[i]);
       }
       for(j = 0x1c; j <= 0x1d; i++, j++ ) {
-        SiS_SetReg1(SiS_Pr->SiS_Part2Port,j,(CRT2Part2Ptr+resindex)->CR[i]);
+        SiS_SetReg(SiS_Pr->SiS_Part2Port,j,(CRT2Part2Ptr+resindex)->CR[i]);
       }
       for(j = 0x1f; j <= 0x21; i++, j++ ) {
-        SiS_SetReg1(SiS_Pr->SiS_Part2Port,j,(CRT2Part2Ptr+resindex)->CR[i]);
+        SiS_SetReg(SiS_Pr->SiS_Part2Port,j,(CRT2Part2Ptr+resindex)->CR[i]);
       }
-      SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x23,(CRT2Part2Ptr+resindex)->CR[10]);
+      SiS_SetReg(SiS_Pr->SiS_Part2Port,0x23,(CRT2Part2Ptr+resindex)->CR[10]);
       SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x25,0x0f,(CRT2Part2Ptr+resindex)->CR[11]);
 
       if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) {
@@ -7651,27 +7917,24 @@
 	     temp++;
 	     if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) temp += 2;
 	  }
-	  SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x2f,temp);
-	  SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x30,0xb3);
-	}
-	if(SiS_Pr->SiS_VGAVDE == 420) {
+	  SiS_SetReg(SiS_Pr->SiS_Part2Port,0x2f,temp);
+	  SiS_SetReg(SiS_Pr->SiS_Part2Port,0x30,0xb3);
+	} else if(SiS_Pr->SiS_VGAVDE == 420) {
 	  temp = 0x4d;
 	  if(SiS_Pr->SiS_ModeType <= ModeVGA) {
 	     temp++;
 	     if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) temp++;
 	  }
-	  SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x2f,temp);
+	  SiS_SetReg(SiS_Pr->SiS_Part2Port,0x2f,temp);
 	}
      }
 
-     /* TW: 650/30xLV 1.10.6s: */
-     /* !!! This is a duplicate, done for LCDA as well - see above */
      if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
         if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) {
-	   SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x1a,0xfc,0x03);   /* Not done in 1.10.7w */
+	   /* See Sync above, 0x1a */
 	   temp = 1;
 	   if(ModeNo <= 0x13) temp = 3;
-	   SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x0b,temp);
+	   SiS_SetReg(SiS_Pr->SiS_Part2Port,0x0b,temp);
 	}
      }
 #endif
@@ -7679,401 +7942,459 @@
   } else {   /* ------ 300 series and other bridges, other LCD resolutions ------ */
 
       /* Using this on the 301B with an auto-expanding 1024 panel (CR37=1) makes
-       * the panel scale at modes < 1024 (no black bars); if the panel is non-expanding, 
+       * the panel scale at modes < 1024 (no black bars); if the panel is non-expanding,
        * the bridge scales all modes to 1024.
        * !!! Malfunction at 640x480 and 640x400 when panel is auto-expanding - black screen !!!
        */
-  
-    tempcx++;
-    
-    if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768)       tempbx =  768;
-    else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) tempbx = 1024;
-    else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200) tempbx = 1200;
-    else if(SiS_Pr->SiS_VDE != 1024) 				  tempbx =  960;
-    else            						  tempbx = 1024;
-    
-#if 0  /* old */
-    tempbx = 768;
-    if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel1024x768) {
-      tempbx = 1024;
-      if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel1280x1024) {
-         tempbx = 1200;
-         if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel1600x1200) {
-            if(tempbx != SiS_Pr->SiS_VDE) {
-               tempbx = 960;
-            }
-         }
-      }
-    }
-#endif
-    
+
+    tempcx = SiS_Pr->SiS_VT;
+    tempbx = SiS_Pr->PanelYRes;
+
     if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) {
-      tempbx = SiS_Pr->SiS_VDE - 1;
-      tempcx--;
+       tempbx = SiS_Pr->SiS_VDE - 1;
+       tempcx--;
     }
-    
+
     tempax = 1;
     if(!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) {
-      if(tempbx != SiS_Pr->SiS_VDE) {
-        tempax = tempbx;
-/*	if(SiS_Pr->SiS_VGAVDE == 525) tempax += 60;   in 650/301B BIOS */
-        if(tempax < SiS_Pr->SiS_VDE) {
-          tempax = 0;
-          tempcx = 0;
-        } else {
-          tempax -= SiS_Pr->SiS_VDE;
-        }
-        tempax >>= 1;
-      }
-      tempcx -= tempax; /* lcdvdes */
-      tempbx -= tempax; /* lcdvdee */
-    } else {
-      tempax >>= 1;
-      tempcx -= tempax; /* lcdvdes */
-      tempbx -= tempax; /* lcdvdee */
+       if(tempbx != SiS_Pr->SiS_VDE) {
+          tempax = tempbx;
+          if(tempax < SiS_Pr->SiS_VDE) {
+             tempax = 0;
+             tempcx = 0;
+          } else {
+             tempax -= SiS_Pr->SiS_VDE;
+          }
+          tempax >>= 1;
+       }
+       tempcx -= tempax; /* lcdvdes */
+       tempbx -= tempax; /* lcdvdee */
     }
-    
+
+    /* Non-expanding: lcdvdees = tempcx = VT-1; lcdvdee = tempbx = VDE-1 */
+
 #ifdef TWDEBUG
-    xf86DrvMsg(0, X_INFO, "lcdvds 0x%x lcdvde 0x%x\n", tempcx, tempbx);
-#endif    
+    xf86DrvMsg(0, X_INFO, "lcdvdes 0x%x lcdvdee 0x%x\n", tempcx, tempbx);
+#endif
 
     temp = tempcx & 0x00FF;   				/* RVEQ1EQ=lcdvdes */
-    SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x05,temp);
+    SiS_SetReg(SiS_Pr->SiS_Part2Port,0x05,temp);
     temp = tempbx & 0x00FF;   				/* RVEQ2EQ=lcdvdee */
-    SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x06,temp);
+    SiS_SetReg(SiS_Pr->SiS_Part2Port,0x06,temp);
 
     temp = ((tempbx & 0xFF00) >> 8) << 3;
     temp |= ((tempcx & 0xFF00) >> 8);
-    SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x02,temp);
+    SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,temp);
 
-    tempbx = push2;
-    tempax = push1;
-    tempcx = tempbx;
-    tempcx -= tempax;
-    tempcx >>= 4;
+    tempbx = SiS_Pr->SiS_VT;    /* push2; */
+    tempax = SiS_Pr->SiS_VDE;   /* push1; */
+    tempcx = (tempbx - tempax) >> 4;
     tempbx += tempax;
     tempbx >>= 1;
-    if(SiS_Pr->SiS_LCDInfo & DontExpandLCD)  tempbx -= 10;
-    
+    if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx -= 10;
+
+    /* non-expanding: lcdvrs = tempbx = ((VT + VDE) / 2) - 10 */
+
+    if(SiS_Pr->UseCustomMode) {
+       tempbx = SiS_Pr->CVSyncStart;
+    }
+
 #ifdef TWDEBUG
     xf86DrvMsg(0, X_INFO, "lcdvrs 0x%x\n", tempbx);
 #endif
 
-    temp = tempbx & 0x00FF;   				/* RTVACTEE=lcdvrs */
-    SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x04,temp);
+    temp = tempbx & 0x00FF;   				/* RTVACTEE = lcdvrs */
+    SiS_SetReg(SiS_Pr->SiS_Part2Port,0x04,temp);
 
     temp = ((tempbx & 0xFF00) >> 8) << 4;
     tempbx += (tempcx + 1);
     temp |= (tempbx & 0x000F);
-    SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x01,temp);
 
-    /* TW: Code from 630/301B (I+II) BIOS */
-
-    if( ( ( (HwDeviceExtension->jChipType == SIS_630) ||
-            (HwDeviceExtension->jChipType == SIS_730) ) &&
-          (HwDeviceExtension->jChipRevision > 2) )  &&
-        (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) &&
-        (!(SiS_Pr->SiS_SetFlag & LCDVESATiming))  &&
-        (!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) ) {
-            if(ModeNo == 0x13) {
-              SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x04,0xB9);
-              SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x05,0xCC);
-              SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x06,0xA6);
-            } else {
-              if((crt2crtc & 0x3F) == 4) {
-                SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x01,0x2B);
-                SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x02,0x13);
-                SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x04,0xE5);
-                SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x05,0x08);
-                SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x06,0xE2);
-              }
-            }
+    if(SiS_Pr->UseCustomMode) {
+       temp &= 0xf0;
+       temp |= (SiS_Pr->CVSyncEnd & 0x0f);
     }
 
-    /* TW: Inserted missing code from 630/301B BIOS;
-     *     Strangely, this is done in all 650 BIOSes as
-     *     well (although LCDTypeInfo is not used there
-     *     in the same way as on 300 series)
-     */
+#ifdef TWDEBUG
+    xf86DrvMsg(0, X_INFO, "lcdvre[3:0] 0x%x\n", (temp & 0x0f));
+#endif
 
-    if(SiS_Pr->SiS_LCDTypeInfo == 0x0c) {
-         crt2crtc &= 0x1f;
-         tempcx = 0;
-         if(!(SiS_Pr->SiS_VBInfo & SetNotSimuMode)) {
-           if (SiS_Pr->SiS_VBInfo & SetInSlaveMode) {
-              tempcx += 7;
-           }
-         }
-         tempcx += crt2crtc;
-         if (crt2crtc >= 4) {
-           SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x06,0xff);
-         }
+    SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,temp);
 
-         if(!(SiS_Pr->SiS_VBInfo & SetNotSimuMode)) {
-           if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) {
-             if(crt2crtc == 4) {
-                SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x01,0x28);
+    /* Code from 630/301B (I+II) BIOS */
+
+#ifdef SIS300
+    if(!SiS_Pr->UseCustomMode) {
+       if( ( ( (HwInfo->jChipType == SIS_630) ||
+               (HwInfo->jChipType == SIS_730) ) &&
+             (HwInfo->jChipRevision > 2) )  &&
+           (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) &&
+           (!(SiS_Pr->SiS_SetFlag & LCDVESATiming))  &&
+           (!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) ) {
+          if(ModeNo == 0x13) {
+             SiS_SetReg(SiS_Pr->SiS_Part2Port,0x04,0xB9);
+             SiS_SetReg(SiS_Pr->SiS_Part2Port,0x05,0xCC);
+             SiS_SetReg(SiS_Pr->SiS_Part2Port,0x06,0xA6);
+          } else {
+             if((crt2crtc & 0x3F) == 4) {
+                SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x2B);
+                SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x13);
+                SiS_SetReg(SiS_Pr->SiS_Part2Port,0x04,0xE5);
+                SiS_SetReg(SiS_Pr->SiS_Part2Port,0x05,0x08);
+                SiS_SetReg(SiS_Pr->SiS_Part2Port,0x06,0xE2);
              }
-           }
-         }
-         SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x02,0x18);
-         SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x04,atable[tempcx]);
+          }
+       }
+
+       if(HwInfo->jChipType < SIS_315H) {
+          if(SiS_Pr->SiS_LCDTypeInfo == 0x0c) {
+             crt2crtc &= 0x1f;
+             tempcx = 0;
+             if(!(SiS_Pr->SiS_VBInfo & SetNotSimuMode)) {
+                if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) {
+                   tempcx += 7;
+                }
+             }
+             tempcx += crt2crtc;
+             if(crt2crtc >= 4) {
+                SiS_SetReg(SiS_Pr->SiS_Part2Port,0x06,0xff);
+             }
+
+             if(!(SiS_Pr->SiS_VBInfo & SetNotSimuMode)) {
+                if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) {
+                   if(crt2crtc == 4) {
+                      SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x28);
+                   }
+                }
+             }
+             SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x18);
+             SiS_SetReg(SiS_Pr->SiS_Part2Port,0x04,atable[tempcx]);
+          }
+       }
     }
+#endif
 
-    tempcx = (SiS_Pr->SiS_HT - SiS_Pr->SiS_HDE) >> 2;     /* (HT-HDE)>>2     */
+    tempcx = (SiS_Pr->SiS_HT - SiS_Pr->SiS_HDE) >> 2;     /* (HT - HDE) >> 2 */
     tempbx = SiS_Pr->SiS_HDE + 7;            		  /* lcdhdee         */
     if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
-         tempbx += 2;
+       tempbx += 2;
     }
     push1 = tempbx;
+
 #ifdef TWDEBUG
-    xf86DrvMsg(0, X_INFO, "lcdhde 0x%x\n", tempbx);
-#endif    
-    temp = tempbx & 0x00FF;    			          /* RHEQPLE=lcdhdee */
-    SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x23,temp);
+    xf86DrvMsg(0, X_INFO, "lcdhdee 0x%x\n", tempbx);
+#endif
+
+    temp = tempbx & 0x00FF;    			          /* RHEQPLE = lcdhdee */
+    SiS_SetReg(SiS_Pr->SiS_Part2Port,0x23,temp);
     temp = (tempbx & 0xFF00) >> 8;
     SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x25,0xF0,temp);
 
     temp = 7;
     if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
-         temp += 2;
+       temp += 2;
     }
-    SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x1F,temp);  	  /* RHBLKE=lcdhdes[7:0] */
+    SiS_SetReg(SiS_Pr->SiS_Part2Port,0x1F,temp);  	  /* RHBLKE = lcdhdes[7:0] */
     SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x20,0x0F);	  /* lcdhdes [11:8] */
 
     tempbx += tempcx;
     push2 = tempbx;
+
+    if(SiS_Pr->UseCustomMode) {
+       tempbx = SiS_Pr->CHSyncStart + 7;
+       if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
+          tempbx += 2;
+       }
+    }
+
 #ifdef TWDEBUG
     xf86DrvMsg(0, X_INFO, "lcdhrs 0x%x\n", tempbx);
 #endif
-    temp = tempbx & 0x00FF;            		          /* RHBURSTS=lcdhrs */
-    if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) {
-       if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { 
-          if(SiS_Pr->SiS_HDE == 1280) temp = 0x47;
+
+    temp = tempbx & 0x00FF;            		          /* RHBURSTS = lcdhrs */
+    if(!SiS_Pr->UseCustomMode) {
+       if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) {
+          if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) {
+             if(SiS_Pr->SiS_HDE == 1280) temp = 0x47;
+          }
        }
     }
-    SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x1C,temp);
-    temp = ((tempbx & 0xFF00) >> 8) << 4;
+    SiS_SetReg(SiS_Pr->SiS_Part2Port,0x1C,temp);
+    temp = (tempbx & 0x0F00) >> 4;
     SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x1D,0x0F,temp);
 
     tempbx = push2;
     tempcx <<= 1;
     tempbx += tempcx;
+
+    if(SiS_Pr->UseCustomMode) {
+       tempbx = SiS_Pr->CHSyncEnd + 7;
+       if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
+          tempbx += 2;
+       }
+    }
+
 #ifdef TWDEBUG
     xf86DrvMsg(0, X_INFO, "lcdhre 0x%x\n", tempbx);
-#endif    
-    temp = tempbx & 0x00FF;            		          /* RHSYEXP2S=lcdhre */
-    SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x21,temp);
+#endif
+
+    temp = tempbx & 0x00FF;            		          /* RHSYEXP2S = lcdhre */
+    SiS_SetReg(SiS_Pr->SiS_Part2Port,0x21,temp);
 
     if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) {
-      if(SiS_Pr->SiS_VGAVDE == 525) {
-        if(SiS_Pr->SiS_ModeType <= ModeVGA)
-    	   temp=0xC6;
-        else
-       	   temp=0xC3;
-        SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x2f,temp);
-        SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x30,0xB3);
-      } else if(SiS_Pr->SiS_VGAVDE == 420) {
-        if(SiS_Pr->SiS_ModeType <= ModeVGA)
-	   temp=0x4F;
-        else
-       	   temp=0x4D;   
-        SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x2f,temp);
-      }
+       if(SiS_Pr->SiS_VGAVDE == 525) {
+          if(SiS_Pr->SiS_ModeType <= ModeVGA)
+    	     temp=0xC6;
+          else
+       	     temp=0xC3;
+          SiS_SetReg(SiS_Pr->SiS_Part2Port,0x2f,temp);
+          SiS_SetReg(SiS_Pr->SiS_Part2Port,0x30,0xB3);
+       } else if(SiS_Pr->SiS_VGAVDE == 420) {
+          if(SiS_Pr->SiS_ModeType <= ModeVGA)
+	     temp=0x4F;
+          else
+       	     temp=0x4D;
+          SiS_SetReg(SiS_Pr->SiS_Part2Port,0x2f,temp);
+       }
     }
-    SiS_Set300Part2Regs(SiS_Pr, HwDeviceExtension, ModeIdIndex,
-                        RefreshRateTableIndex, BaseAddr, ModeNo);
-
-  } /* HwDeviceExtension */
-}
 
-USHORT
-SiS_GetVGAHT2(SiS_Private *SiS_Pr)
-{
-  ULONG tempax,tempbx;
+#ifdef SIS300
+    SiS_Set300Part2Regs(SiS_Pr, HwInfo, ModeIdIndex,
+                        RefreshRateTableIndex, ModeNo);
+#endif
 
-  tempbx = ((SiS_Pr->SiS_VGAVT - SiS_Pr->SiS_VGAVDE) * SiS_Pr->SiS_RVBHCMAX) & 0xFFFF;
-  tempax = (SiS_Pr->SiS_VT - SiS_Pr->SiS_VDE) * SiS_Pr->SiS_RVBHCFACT;
-  tempax = (tempax * SiS_Pr->SiS_HT) / tempbx;
-  return((USHORT) tempax);
+  } /* HwInfo */
 }
 
-/* TW: New from 300/301LV BIOS 1.16.51 for ECS A907. Seems highly preliminary. */
-void
-SiS_Set300Part2Regs(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,
-    			USHORT ModeIdIndex, USHORT RefreshRateTableIndex,
-			USHORT BaseAddr, USHORT ModeNo)
+/*********************************************/
+/*         SET PART 3 REGISTER GROUP         */
+/*********************************************/
+
+static void
+SiS_SetGroup3(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
+              PSIS_HW_INFO HwInfo)
 {
-  USHORT crt2crtc, resindex;
-  int    i,j;
-  const  SiS_Part2PortTblStruct *CRT2Part2Ptr = NULL;
+  USHORT modeflag, i;
+  const UCHAR  *tempdi;
 
-  if(HwDeviceExtension->jChipType != SIS_300) return;
-  if(!(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV)) return;
+  if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) return;
 
   if(ModeNo<=0x13) {
-    	crt2crtc = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC;
+     modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
   } else {
-    	crt2crtc = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC;
+     if(SiS_Pr->UseCustomMode) {
+        modeflag = SiS_Pr->CModeFlag;
+     } else {
+    	modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
+     }
   }
 
-  resindex = crt2crtc & 0x3F;
-  if(SiS_Pr->SiS_SetFlag & LCDVESATiming) CRT2Part2Ptr = SiS_Pr->SiS_CRT2Part2_1024x768_1;
-  else                                    CRT2Part2Ptr = SiS_Pr->SiS_CRT2Part2_1024x768_2;
+#ifndef SIS_CP
+  SiS_SetReg(SiS_Pr->SiS_Part3Port,0x00,0x00);
+#endif
 
-  /* TW: The BIOS code (1.16.51) is obviously a fragment! */
-  if(ModeNo > 0x13) {
-     CRT2Part2Ptr = SiS_Pr->SiS_CRT2Part2_1024x768_1;
-     resindex = 4;
+#ifdef SIS_CP
+  SIS_CP_INIT301_CP
+#endif
+
+  if(SiS_Pr->SiS_TVMode & TVSetPAL) {
+     SiS_SetReg(SiS_Pr->SiS_Part3Port,0x13,0xFA);
+     SiS_SetReg(SiS_Pr->SiS_Part3Port,0x14,0xC8);
+  } else {
+     SiS_SetReg(SiS_Pr->SiS_Part3Port,0x13,0xF5);
+     SiS_SetReg(SiS_Pr->SiS_Part3Port,0x14,0xB7);
   }
 
-  SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x01,0x80,(CRT2Part2Ptr+resindex)->CR[0]);
-  SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x02,0x80,(CRT2Part2Ptr+resindex)->CR[1]);
-  for(i = 2, j = 0x04; j <= 0x06; i++, j++ ) {
-        SiS_SetReg1(SiS_Pr->SiS_Part2Port,j,(CRT2Part2Ptr+resindex)->CR[i]);
+  if(SiS_Pr->SiS_TVMode & TVSetPALM) {
+     SiS_SetReg(SiS_Pr->SiS_Part3Port,0x13,0xFA);
+     SiS_SetReg(SiS_Pr->SiS_Part3Port,0x14,0xC8);
+     SiS_SetReg(SiS_Pr->SiS_Part3Port,0x3D,0xA8);
   }
-  for(j = 0x1c; j <= 0x1d; i++, j++ ) {
-        SiS_SetReg1(SiS_Pr->SiS_Part2Port,j,(CRT2Part2Ptr+resindex)->CR[i]);
+
+  tempdi = NULL;
+  if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) {
+     tempdi = SiS_Pr->SiS_HiTVGroup3Data;
+     if(SiS_Pr->SiS_TVMode & TVSetTVSimuMode) {
+        tempdi = SiS_Pr->SiS_HiTVGroup3Simu;
+#if 0
+        if(!(modeflag & Charx8Dot)) {
+           tempdi = SiS_Pr->SiS_HiTVGroup3Text;
+        }
+#endif
+     }
+  } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) {
+     if(!(SiS_Pr->SiS_TVMode & TVSetYPbPr525i)) {
+        tempdi = SiS_HiTVGroup3_1;
+        if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) tempdi = SiS_HiTVGroup3_2;
+     }
   }
-  for(j = 0x1f; j <= 0x21; i++, j++ ) {
-        SiS_SetReg1(SiS_Pr->SiS_Part2Port,j,(CRT2Part2Ptr+resindex)->CR[i]);
+  if(tempdi) {
+     for(i=0; i<=0x3E; i++){
+        SiS_SetReg(SiS_Pr->SiS_Part3Port,i,tempdi[i]);
+     }
+     if(SiS_Pr->SiS_VBType & (VB_SIS301C | VB_SIS302ELV)) {
+	if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p) {
+	   SiS_SetReg(SiS_Pr->SiS_Part3Port,0x28,0x3f);
+	}
+     }
   }
-  SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x23,(CRT2Part2Ptr+resindex)->CR[10]);
-  SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x25,0x0f,(CRT2Part2Ptr+resindex)->CR[11]);
-}
-
-/* TW: Set 301 Macrovision(tm) registers */
-void
-SiS_SetGroup3(SiS_Private *SiS_Pr, USHORT  BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,
-              USHORT ModeIdIndex,PSIS_HW_DEVICE_INFO HwDeviceExtension)
-{
-  USHORT temp;
-  USHORT i;
-  const UCHAR  *tempdi;
-  USHORT modeflag;
 
-  if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) return;
+  if(!(SiS_Pr->SiS_VBInfo & (SetCRT2ToHiVision | SetCRT2ToYPbPr525750))) {
+#ifdef SIS_CP
+     SIS_CP_INIT301_CP2
+#endif
+  }
+}
 
-  if(ModeNo<=0x13)
-    	modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
-  else
-    	modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
+/*********************************************/
+/*         SET PART 4 REGISTER GROUP         */
+/*********************************************/
 
-  SiS_SetReg1(SiS_Pr->SiS_Part3Port,0x00,0x00);
+#ifdef SIS315H
+static void
+SiS_SetGroup4_C_ELV(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
+{
+   USHORT temp, temp1;
 
-  if(SiS_Pr->SiS_VBInfo & SetPALTV) {
-    SiS_SetReg1(SiS_Pr->SiS_Part3Port,0x13,0xFA);
-    SiS_SetReg1(SiS_Pr->SiS_Part3Port,0x14,0xC8);
-  } else {
-    if(HwDeviceExtension->jChipType >= SIS_315H) {
-      SiS_SetReg1(SiS_Pr->SiS_Part3Port,0x13,0xF5);
-      SiS_SetReg1(SiS_Pr->SiS_Part3Port,0x14,0xB7);
-    } else {
-      SiS_SetReg1(SiS_Pr->SiS_Part3Port,0x13,0xF6);
-      SiS_SetReg1(SiS_Pr->SiS_Part3Port,0x14,0xBf);
-    }
-  }
+   if(!(SiS_Pr->SiS_VBType & (VB_SIS301C | VB_SIS302ELV))) return;
 
-  temp = 0;
-  if((HwDeviceExtension->jChipType == SIS_630)||
-     (HwDeviceExtension->jChipType == SIS_730)) {
-     temp = 0x35;
-  } else if(HwDeviceExtension->jChipType >= SIS_315H) {
-     temp = 0x38;
-  }
-  if(temp) {
-      if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
-          if(SiS_GetReg1(SiS_Pr->SiS_P3d4,0x31) & 0x01) {
-              if(SiS_GetReg1(SiS_Pr->SiS_P3d4,temp) & EnablePALM){  /* 0x40 */
-                  SiS_SetReg1(SiS_Pr->SiS_Part3Port,0x13,0xFA);
-                  SiS_SetReg1(SiS_Pr->SiS_Part3Port,0x14,0xC8);
-                  SiS_SetReg1(SiS_Pr->SiS_Part3Port,0x3D,0xA8);
-              }
-          }
+   SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x3a,0x08);
+   temp = SiS_GetReg(SiS_Pr->SiS_Part4Port,0x3a);
+   if(!(temp & 0x01)) {
+      SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x3a,0xdf);
+      SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x25,0xfc);
+      if(HwInfo->jChipType < SIS_661) {
+         SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x25,0xf8);
+      }
+      SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x0f,0xfb);
+      temp = 0;
+      if(!(SiS_Pr->SiS_TVMode & TVSetYPbPr750p)) {
+         temp |= 0x0002;
+         if(!(SiS_Pr->SiS_TVMode & TVSetYPbPr525p)) {
+	    temp ^= 0x0402;
+	    if(!(SiS_Pr->SiS_TVMode & TVSetHiVision)) {
+	       temp ^= 0x0002;
+	    }
+	 }
       }
-  }
+      if(HwInfo->jChipType >= SIS_661) {
+         temp1 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x39);
+         if(temp1 & 0x01) temp |= 0x10;
+         if(temp1 & 0x02) temp |= 0x01;
+	 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x26,0xec,(temp & 0xff));
+      } else {
+         temp1 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x3b) & 0x03;
+	 if(temp1 == 0x01) temp |= 0x01;
+	 if(temp1 == 0x03) temp |= 0x04;  /* ? why not 0x10? */
+	 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x26,0xea,(temp & 0xff));
+      }
+      SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x3a,0xfb,(temp >> 8));
+   }
+}
+#endif
+
+static void
+SiS_SetCRT2VCLK(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
+                 USHORT RefreshRateTableIndex, PSIS_HW_INFO HwInfo)
+{
+  USHORT vclkindex;
+  USHORT temp, reg1, reg2;
 
-  if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVisionTV) {
-    tempdi = SiS_Pr->SiS_HiTVGroup3Data;
-    if(SiS_Pr->SiS_SetFlag & TVSimuMode) {
-      tempdi = SiS_Pr->SiS_HiTVGroup3Simu;
-      if(!(modeflag & Charx8Dot)) {
-        tempdi = SiS_Pr->SiS_HiTVGroup3Text;
-      }
-    }
-    if(SiS_Pr->SiS_HiVision & 0x03) {
-       tempdi = SiS_HiTVGroup3_1;
-       if(SiS_Pr->SiS_HiVision & 0x02) tempdi = SiS_HiTVGroup3_2;
-    }
-    for(i=0; i<=0x3E; i++){
-       SiS_SetReg1(SiS_Pr->SiS_Part3Port,i,tempdi[i]);
-    }
+  if(SiS_Pr->UseCustomMode) {
+     reg1 = SiS_Pr->CSR2B;
+     reg2 = SiS_Pr->CSR2C;
+  } else {
+     vclkindex = SiS_GetVCLK2Ptr(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex,
+                                 HwInfo);
+     reg1 = SiS_Pr->SiS_VBVCLKData[vclkindex].Part4_A;
+     reg2 = SiS_Pr->SiS_VBVCLKData[vclkindex].Part4_B;
   }
 
-  return;
+  if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
+     if(SiS_Pr->SiS_TVMode & TVSetNTSC1024) {
+        SiS_SetReg(SiS_Pr->SiS_Part4Port,0x0a,0x57);
+ 	SiS_SetReg(SiS_Pr->SiS_Part4Port,0x0b,0x46);
+	SiS_SetReg(SiS_Pr->SiS_Part4Port,0x1f,0xf6);
+     } else {
+        SiS_SetReg(SiS_Pr->SiS_Part4Port,0x0a,reg1);
+        SiS_SetReg(SiS_Pr->SiS_Part4Port,0x0b,reg2);
+     }
+  } else {
+     SiS_SetReg(SiS_Pr->SiS_Part4Port,0x0a,0x01);
+     SiS_SetReg(SiS_Pr->SiS_Part4Port,0x0b,reg2);
+     SiS_SetReg(SiS_Pr->SiS_Part4Port,0x0a,reg1);
+  }
+  SiS_SetReg(SiS_Pr->SiS_Part4Port,0x12,0x00);
+  temp = 0x08;
+  if(SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC) temp |= 0x20;
+  SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x12,temp);
 }
 
-/* TW: Set 301 VGA2 registers */
-void
-SiS_SetGroup4(SiS_Private *SiS_Pr, USHORT  BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,
-              USHORT ModeIdIndex,USHORT RefreshRateTableIndex,
-	      PSIS_HW_DEVICE_INFO HwDeviceExtension)
+/* Set 301 VGA2 registers */
+static void
+SiS_SetGroup4(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
+  	      USHORT RefreshRateTableIndex, PSIS_HW_INFO HwInfo)
 {
   USHORT tempax,tempcx,tempbx,modeflag,temp,temp2,resinfo;
   ULONG tempebx,tempeax,templong;
 
-
-  if(ModeNo<=0x13) {
-    	modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
-	resinfo = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ResInfo;
+  if(ModeNo <= 0x13) {
+     modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
+     resinfo = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ResInfo;
   } else {
+     if(SiS_Pr->UseCustomMode) {
+        modeflag = SiS_Pr->CModeFlag;
+	resinfo = 0;
+     } else {
     	modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
 	resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO;
+     }
   }
 
-  if(HwDeviceExtension->jChipType >= SIS_315H) {
-      /* TW: From 650/302LV 1.10.6s (not for 300/301LV - no LCDA on this combination) */
+  if(HwInfo->jChipType >= SIS_315H) {
      if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {
         if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) {
-           SiS_SetReg1(SiS_Pr->SiS_Part4Port,0x24,0x0e);
+           SiS_SetReg(SiS_Pr->SiS_Part4Port,0x24,0x0e);
         }
      }
   }
 
-  if(SiS_Pr->SiS_VBType & VB_SIS302LV) {
-      if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
-          SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x10,0x9f);
-      }
+  if(SiS_Pr->SiS_VBType & (VB_SIS301C | VB_SIS302LV)) {
+     if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
+        SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x10,0x9f);
+     }
   }
 
-  if(HwDeviceExtension->jChipType >= SIS_315H) {
+  if(HwInfo->jChipType >= SIS_315H) {
      if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) {
         if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {
-	   /* TW: From 650/301LV (any, incl. 1.10.6s, 1.10.7w) */
-  	   /* TW: This is a duplicate; done at the end, too */
-	   if(SiS_GetReg1(SiS_Pr->SiS_P3d4,0x39) & 0x04) {
-		SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x27,0x2c);
-	   }
-	   SiS_SetReg1(SiS_Pr->SiS_Part4Port,0x2a,0x00);
-	   SiS_SetReg1(SiS_Pr->SiS_Part4Port,0x30,0x00);
-	   SiS_SetReg1(SiS_Pr->SiS_Part4Port,0x34,0x10);
+	   if(SiS_IsDualLink(SiS_Pr, HwInfo)) {
+	      SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x27,0x2c);
+	   }
+#ifdef SET_EMI
+	   if(SiS_Pr->SiS_VBType & (VB_SIS302LV | VB_SIS302ELV)) {
+	      SiS_SetReg(SiS_Pr->SiS_Part4Port,0x2a,0x00);
+	      SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x30,0x0c);
+	      SiS_SetReg(SiS_Pr->SiS_Part4Port,0x34,0x10);
+	   }
+#endif
 	}
    	return;
      }
   }
 
   temp = SiS_Pr->SiS_RVBHCFACT;
-  SiS_SetReg1(SiS_Pr->SiS_Part4Port,0x13,temp);
+  SiS_SetReg(SiS_Pr->SiS_Part4Port,0x13,temp);
 
   tempbx = SiS_Pr->SiS_RVBHCMAX;
   temp = tempbx & 0x00FF;
-  SiS_SetReg1(SiS_Pr->SiS_Part4Port,0x14,temp);
+  SiS_SetReg(SiS_Pr->SiS_Part4Port,0x14,temp);
 
   temp2 = (((tempbx & 0xFF00) >> 8) << 7) & 0x00ff;
 
   tempcx = SiS_Pr->SiS_VGAHT - 1;
   temp = tempcx & 0x00FF;
-  SiS_SetReg1(SiS_Pr->SiS_Part4Port,0x16,temp);
+  SiS_SetReg(SiS_Pr->SiS_Part4Port,0x16,temp);
 
   temp = (((tempcx & 0xFF00) >> 8) << 3) & 0x00ff;
   temp2 |= temp;
@@ -8082,47 +8403,46 @@
   if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToTV))  tempcx -= 5;
 
   temp = tempcx & 0x00FF;
-  SiS_SetReg1(SiS_Pr->SiS_Part4Port,0x17,temp);
+  SiS_SetReg(SiS_Pr->SiS_Part4Port,0x17,temp);
 
   temp = temp2 | ((tempcx & 0xFF00) >> 8);
-  SiS_SetReg1(SiS_Pr->SiS_Part4Port,0x15,temp);
+  SiS_SetReg(SiS_Pr->SiS_Part4Port,0x15,temp);
 
   tempbx = SiS_Pr->SiS_VGAHDE;
   if(modeflag & HalfDCLK)  tempbx >>= 1;
+  if(HwInfo->jChipType >= SIS_661) {
+     if(SiS_IsDualLink(SiS_Pr, HwInfo)) tempbx >>= 1;
+  }
 
-  /* TW: New for 650/301LV and 630/301B */
   temp = 0xA0;
-  if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVisionTV) {
-       temp = 0;
-       if(tempbx > 800) {
-          temp = 0xA0;
-          if(tempbx != 1024) {
-             temp = 0xC0;
-             if(tempbx != 1280) temp = 0;
-	  }
-       }
-  } else
-    if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
-      if(tempbx <= 800) {
-         temp = 0x80;
-	 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
-            temp = 0;
-            if(tempbx > 800) temp = 0x60;
-         }
-      }
+  if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) {
+     temp = 0;
+     if(tempbx > 800) {
+        temp = 0xA0;
+        if(tempbx != 1024) {
+           temp = 0xC0;
+           if(tempbx != 1280) temp = 0;
+	}
+     }
+  } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
+     if(tempbx <= 800) {
+        temp = 0x80;
+     }
   } else {
-      temp = 0x80;
-      if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
-            temp = 0;
-            if(tempbx > 800) temp = 0x60;
-      }
-  }
-  if(SiS_Pr->SiS_HiVision & 0x03) {
+     temp = 0x80;
+     if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
         temp = 0;
-	if(SiS_Pr->SiS_VGAHDE == 1024) temp = 0x20;
+        if(tempbx > 800) temp = 0x60;
+     }
+  }
+
+  if(SiS_Pr->SiS_TVMode & (TVSetYPbPr525p | TVSetYPbPr750p)) {
+     temp = 0;
+     if(SiS_Pr->SiS_VGAHDE == 1024) temp = 0x20;
   }
-  if(HwDeviceExtension->jChipType >= SIS_315H) {
-  	if(SiS_GetReg1(SiS_Pr->SiS_P3d4,0x39) & 0x04) temp = 0;
+
+  if(HwInfo->jChipType < SIS_661) {
+     if(SiS_IsDualLink(SiS_Pr, HwInfo)) temp = 0;
   }
 
   if(SiS_Pr->SiS_VBType & VB_SIS301) {
@@ -8134,20 +8454,20 @@
 
   tempebx = SiS_Pr->SiS_VDE;
 
-  if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVisionTV) {
+  if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) {
      if(!(temp & 0xE0)) tempebx >>=1;
   }
 
   tempcx = SiS_Pr->SiS_RVBHRS;
   temp = tempcx & 0x00FF;
-  SiS_SetReg1(SiS_Pr->SiS_Part4Port,0x18,temp);
+  SiS_SetReg(SiS_Pr->SiS_Part4Port,0x18,temp);
 
   tempeax = SiS_Pr->SiS_VGAVDE;
   tempcx |= 0x4000;
-  if(tempeax <= tempebx){
-    tempcx ^= 0x4000;
+  if(tempeax <= tempebx) {
+     tempcx ^= 0x4000;
   } else {
-    tempeax -= tempebx;
+     tempeax -= tempebx;
   }
 
   templong = (tempeax * 256 * 1024) % tempebx;
@@ -8156,446 +8476,153 @@
   if(templong != 0) tempebx++;
 
   temp = (USHORT)(tempebx & 0x000000FF);
-  SiS_SetReg1(SiS_Pr->SiS_Part4Port,0x1B,temp);
+  SiS_SetReg(SiS_Pr->SiS_Part4Port,0x1B,temp);
   temp = (USHORT)((tempebx & 0x0000FF00) >> 8);
-  SiS_SetReg1(SiS_Pr->SiS_Part4Port,0x1A,temp);
+  SiS_SetReg(SiS_Pr->SiS_Part4Port,0x1A,temp);
 
   tempbx = (USHORT)(tempebx >> 16);
   temp = tempbx & 0x00FF;
   temp <<= 4;
   temp |= ((tempcx & 0xFF00) >> 8);
-  SiS_SetReg1(SiS_Pr->SiS_Part4Port,0x19,temp);
+  SiS_SetReg(SiS_Pr->SiS_Part4Port,0x19,temp);
 
   if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
 
-         SiS_SetReg1(SiS_Pr->SiS_Part4Port,0x1C,0x28);
-	 tempbx = 0;
-         tempax = SiS_Pr->SiS_VGAHDE;
-         if(modeflag & HalfDCLK) tempax >>= 1;
-         if((SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) || (SiS_Pr->SiS_HiVision & 0x03)) {
-	     if(HwDeviceExtension->jChipType >= SIS_315H) {
-	         if(SiS_GetReg1(SiS_Pr->SiS_P3d4,0x39) & 0x04) tempax >>= 1;
-		 else if(tempax > 800) tempax -= 800;
-	     } else {
-                 if(tempax > 800) tempax -= 800;
-             }
-         }
-
-/*       if((SiS_Pr->SiS_VBInfo & (SetCRT2ToTV | SetPALTV)) && (!(SiS_Pr->SiS_HiVision & 0x03))) {  */
- 	 if((SiS_Pr->SiS_VBInfo & (SetCRT2ToTV - SetCRT2ToHiVisionTV)) && (!(SiS_Pr->SiS_HiVision & 0x03))) {
-           if(tempax > 800) {
-	      tempbx = 8;
-              if(tempax == 1024)
-	        tempax *= 25;
-              else
-	        tempax *= 20;
-
-	      temp = tempax % 32;
-	      tempax /= 32;
-	      tempax--;
-	      if (temp!=0) tempax++;
-           }
-         }
-	 tempax--;
-         temp = (tempax & 0xFF00) >> 8;
-         temp &= 0x03;
-	 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {		/* From 1.10.7w */
-	 	if(ModeNo > 0x13) {			/* From 1.10.7w */
-			if(resinfo == 8) tempax = 0x1f;	/* From 1.10.7w */
-		}					/* From 1.10.7w */
-	 }						/* From 1.10.7w */
-	 SiS_SetReg1(SiS_Pr->SiS_Part4Port,0x1D,tempax & 0x00FF);
-	 temp <<= 4;
-	 temp |= tempbx;
-	 SiS_SetReg1(SiS_Pr->SiS_Part4Port,0x1E,temp);
-
-	 if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {
-	    if(IS_SIS650740) {
-	        temp = 0x0026;  /* 1.10.7w; 1.10.8r; needs corresponding code in Dis/EnableBridge! */
-	    } else {
-	        temp = 0x0036;
-	    }
-	 } else {
-	     temp = 0x0036;
-	 }
-         if((SiS_Pr->SiS_VBInfo & (SetCRT2ToTV - SetCRT2ToHiVisionTV)) &&
-	                               (!(SiS_Pr->SiS_HiVision & 0x03))) {
-		temp |= 0x01;
-	        if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) {
-	          if(!(SiS_Pr->SiS_SetFlag & TVSimuMode))
-  	                  temp &= 0xFE;
-		}
-         }
-         SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x1F,0xC0,temp);
-
-	 tempbx = SiS_Pr->SiS_HT;
-	 if(HwDeviceExtension->jChipType >= SIS_315H) {
-	 	if(SiS_GetReg1(SiS_Pr->SiS_P3d4,0x39) & 0x04) tempbx >>= 1;
-	 }
-         tempbx >>= 1;
-	 tempbx -= 2;
-         temp = ((tempbx & 0x0700) >> 8) << 3;
-         SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x21,0xC0,temp);
-         temp = tempbx & 0x00FF;
-         SiS_SetReg1(SiS_Pr->SiS_Part4Port,0x22,temp);
-	 
-         if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {
-	    if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
-               SiS_SetReg1(SiS_Pr->SiS_Part4Port,0x24,0x0e);
-	    }
-	 }
-
-	 if(HwDeviceExtension->jChipType >= SIS_315H) {
-	     /* TW: 650/LV BIOS does this for all bridge types - assumingly wrong */
-	     /* 315, 330, 650+301B BIOS don't do this at all */
-             /* TW: This is a duplicate; done for LCDA as well (see above) */
-	     if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {
-	        if(SiS_GetReg1(SiS_Pr->SiS_P3d4,0x39) & 0x04) {
-		   SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x27,0x2c);
-	        }
-	        SiS_SetReg1(SiS_Pr->SiS_Part4Port,0x2a,0x00);
-	        SiS_SetReg1(SiS_Pr->SiS_Part4Port,0x30,0x00);
-	        SiS_SetReg1(SiS_Pr->SiS_Part4Port,0x34,0x10);
-	     }
-         } else if(HwDeviceExtension->jChipType == SIS_300) {
-	     /* TW: 300/301LV BIOS does this for all bridge types - assumingly wrong */
-	     if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {
-	        SiS_SetReg1(SiS_Pr->SiS_Part4Port,0x2a,0x00);
-	        SiS_SetReg1(SiS_Pr->SiS_Part4Port,0x30,0x00);
-	        SiS_SetReg1(SiS_Pr->SiS_Part4Port,0x34,0x10);
-	     }
-	 }
-
-  }  /* 301B */
-
-  SiS_SetCRT2VCLK(SiS_Pr,BaseAddr,ROMAddr,ModeNo,ModeIdIndex,
-                  RefreshRateTableIndex,HwDeviceExtension);
-}
-
+     SiS_SetReg(SiS_Pr->SiS_Part4Port,0x1C,0x28);
 
-void
-SiS_SetCRT2VCLK(SiS_Private *SiS_Pr, USHORT BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
-                 USHORT RefreshRateTableIndex,PSIS_HW_DEVICE_INFO HwDeviceExtension)
-{
-  USHORT vclkindex;
-  USHORT tempah;
-
-  vclkindex = SiS_GetVCLK2Ptr(SiS_Pr,ROMAddr,ModeNo,ModeIdIndex,RefreshRateTableIndex,
-                              HwDeviceExtension);
+     tempbx = 0;
+     tempax = SiS_Pr->SiS_VGAHDE;
+     if(modeflag & HalfDCLK) 		tempax >>= 1;
+     if(SiS_IsDualLink(SiS_Pr, HwInfo)) tempax >>= 1;
+     if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
+	if(tempax > 800) tempax -= 800;
+     } else {
+        if(tempax > 800) {
+	   tempbx = 8;
+           if(tempax == 1024)
+	      tempax *= 25;
+           else
+	      tempax *= 20;
+
+	   temp = tempax % 32;
+	   tempax /= 32;
+	   tempax--;
+	   if (temp!=0) tempax++;
+        }
+     }
+     tempax--;
+     temp = ((tempax & 0xFF00) >> 8) & 0x03;
+     if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {			/* From 1.10.7w */
+	if(ModeNo > 0x13) {					/* From 1.10.7w */
+	   if(resinfo == SIS_RI_1024x768) tempax = 0x1f;	/* From 1.10.7w */
+	}							/* From 1.10.7w */
+     }								/* From 1.10.7w */
+     SiS_SetReg(SiS_Pr->SiS_Part4Port,0x1D,tempax & 0x00FF);
+     temp <<= 4;
+     temp |= tempbx;
+     SiS_SetReg(SiS_Pr->SiS_Part4Port,0x1E,temp);
 
-  if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
-     tempah = SiS_Pr->SiS_VBVCLKData[vclkindex].Part4_A;
-     SiS_SetReg1(SiS_Pr->SiS_Part4Port,0x0A,tempah);
-     tempah = SiS_Pr->SiS_VBVCLKData[vclkindex].Part4_B;
-     SiS_SetReg1(SiS_Pr->SiS_Part4Port,0x0B,tempah);
-     if(HwDeviceExtension->jChipType >= SIS_315H) {
-	if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
-           if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
-	      if(!(SiS_Pr->SiS_VBInfo & SetPALTV)) {
-                 if((ModeNo == 0x4a) || (ModeNo == 0x38)) {
-		    SiS_SetReg1(SiS_Pr->SiS_Part4Port,0x0a,0x57);
-		    SiS_SetReg1(SiS_Pr->SiS_Part4Port,0x0b,0x46);
-		    SiS_SetReg1(SiS_Pr->SiS_Part4Port,0x1f,0xf6);
-                 }
-              }
-           }
+     if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {
+	if(IS_SIS550650740660) {
+	   temp = 0x0026;  /* 1.10.7w; 1.10.8r; needs corresponding code in Dis/EnableBridge! */
+	} else {
+	   temp = 0x0036;
 	}
+     } else {
+	temp = 0x0036;
      }
-  } else {	
-     SiS_SetReg1(SiS_Pr->SiS_Part4Port,0x0A,0x01);
-     tempah = SiS_Pr->SiS_VBVCLKData[vclkindex].Part4_B;
-     SiS_SetReg1(SiS_Pr->SiS_Part4Port,0x0B,tempah);
-     tempah = SiS_Pr->SiS_VBVCLKData[vclkindex].Part4_A;
-     SiS_SetReg1(SiS_Pr->SiS_Part4Port,0x0A,tempah);
-  }
-  SiS_SetReg1(SiS_Pr->SiS_Part4Port,0x12,0x00);
-  tempah = 0x08;
-  if(SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC) tempah |= 0x20;
-  SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x12,tempah);
-}
-
-USHORT
-SiS_GetVCLK2Ptr(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
-                USHORT RefreshRateTableIndex,PSIS_HW_DEVICE_INFO HwDeviceExtension)
-{
-  USHORT tempbx;
-  const USHORT LCDXlat0VCLK[4]    = {VCLK40, VCLK40, VCLK40, VCLK40};
-  const USHORT LVDSXlat1VCLK[4]   = {VCLK40, VCLK40, VCLK40, VCLK40};
-#ifdef SIS300
-  const USHORT LCDXlat1VCLK300[4] = {VCLK65,   VCLK65,   VCLK65,   VCLK65};
-  const USHORT LCDXlat2VCLK300[4] = {VCLK108_2,VCLK108_2,VCLK108_2,VCLK108_2};
-  const USHORT LVDSXlat2VCLK300[4]= {VCLK65,   VCLK65,   VCLK65,   VCLK65};
-  const USHORT LVDSXlat3VCLK300[4]= {VCLK65,   VCLK65,   VCLK65,   VCLK65};
-#endif
-#ifdef SIS315H
-  const USHORT LCDXlat1VCLK310[4] = {VCLK65+2,   VCLK65+2,   VCLK65+2,   VCLK65+2};
-  const USHORT LCDXlat2VCLK310[4] = {VCLK108_2+5,VCLK108_2+5,VCLK108_2+5,VCLK108_2+5};
-  const USHORT LVDSXlat2VCLK310[4]= {VCLK65+2,   VCLK65+2,   VCLK65+2,   VCLK65+2};
-  const USHORT LVDSXlat3VCLK310[4]= {VCLK108_2+5,VCLK108_2+5,VCLK108_2+5,VCLK108_2+5};
-#endif
-  USHORT CRT2Index,VCLKIndex=0;
-  USHORT modeflag,resinfo;
-  const UCHAR *CHTVVCLKPtr=NULL;
-  const USHORT *LCDXlatVCLK1 = NULL;
-  const USHORT *LCDXlatVCLK2 = NULL;
-  const USHORT *LVDSXlatVCLK2 = NULL;
-  const USHORT *LVDSXlatVCLK3 = NULL;
-
-  if(HwDeviceExtension->jChipType >= SIS_315H) {
-#ifdef SIS315H
-		LCDXlatVCLK1 = LCDXlat1VCLK310;
-		LCDXlatVCLK2 = LCDXlat2VCLK310;
-		LVDSXlatVCLK2 = LVDSXlat2VCLK310;
-		LVDSXlatVCLK3 = LVDSXlat3VCLK310;
-#endif
-  } else {
-#ifdef SIS300
-		LCDXlatVCLK1 = LCDXlat1VCLK300;
-		LCDXlatVCLK2 = LCDXlat2VCLK300;
-		LVDSXlatVCLK2 = LVDSXlat2VCLK300;
-		LVDSXlatVCLK3 = LVDSXlat3VCLK300;
-#endif
-  }
-
-  if(ModeNo <= 0x13) {
-    	modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
-    	resinfo = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ResInfo;
-    	CRT2Index = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC;
-  } else {
-    	modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
-    	resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO;
-    	CRT2Index = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC;
-  }
-
-  if(SiS_Pr->SiS_IF_DEF_LVDS == 0) {    /* 30x/B/LV */
-
-     if(SiS_Pr->SiS_SetFlag & ProgrammingCRT2) {
-
-        CRT2Index >>= 6;
-        if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)){      /*  LCD */
-            if(HwDeviceExtension->jChipType < SIS_315H) {
-	       if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel800x600)
-	    		VCLKIndex = LCDXlat0VCLK[CRT2Index];
-	       else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768)
-	    		VCLKIndex = LCDXlatVCLK1[CRT2Index];
-	       else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x600)
-	    		VCLKIndex = LCDXlatVCLK1[CRT2Index];
-	       else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1152x768)
-	    		VCLKIndex = LCDXlatVCLK1[CRT2Index];
-	       else
-	    		VCLKIndex = LCDXlatVCLK2[CRT2Index];
-	    } else {
-               /* TW: 330, 650/301LV BIOS does not check expanding, 315 does  */
-	       if( (HwDeviceExtension->jChipType > SIS_315PRO) ||
-	           (!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) ) {
-      	          if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) {
-		     VCLKIndex = 0x19;
-		  } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) {
-		     VCLKIndex = 0x19;
-		  } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200) {
-		     VCLKIndex = 0x21;
-		  } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) {
-		     VCLKIndex = LCDXlatVCLK1[CRT2Index];
-                  } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x960) {
-		     VCLKIndex = 0x45;  /* TW: in VBVCLK table */
-		     if(resinfo == 0x09) VCLKIndex++;
-	          } else {
-		     VCLKIndex = LCDXlatVCLK2[CRT2Index];
-      	          }
-	       } else {
-                   VCLKIndex = (UCHAR)SiS_GetReg2((USHORT)(SiS_Pr->SiS_P3ca+0x02));  /*  Port 3cch */
-         	   VCLKIndex = ((VCLKIndex >> 2) & 0x03);
-        	   if(ModeNo > 0x13) {
-          		VCLKIndex = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRTVCLK;
-        	   }
-		   if(ModeNo <= 0x13) {  /* TW: 315 BIOS */
-		      if(SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC == 1) VCLKIndex = 0x42;
-		   }
-		   if(VCLKIndex == 0) VCLKIndex = 0x41;
-		   if(VCLKIndex == 1) VCLKIndex = 0x43;
-		   if(VCLKIndex == 4) VCLKIndex = 0x44;
-	       }
-	    }
-        } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {                 /*  TV */
-        	if( (SiS_Pr->SiS_VBInfo & SetCRT2ToHiVisionTV) && 
-		    (!(SiS_Pr->SiS_VBType & VB_SIS301LV302LV)) ) {
-          		if(SiS_Pr->SiS_SetFlag & RPLLDIV2XO)  VCLKIndex = HiTVVCLKDIV2;
-     			else                                  VCLKIndex = HiTVVCLK;
-          		if(SiS_Pr->SiS_SetFlag & TVSimuMode) {
-            			if(modeflag & Charx8Dot)      VCLKIndex = HiTVSimuVCLK;
-            			else 			      VCLKIndex = HiTVTextVCLK;
-          		}
-        	} else {
-       			if(SiS_Pr->SiS_SetFlag & RPLLDIV2XO)  VCLKIndex = TVVCLKDIV2;
-            		else         		              VCLKIndex = TVVCLK;
-          	}
-		if(HwDeviceExtension->jChipType >= SIS_315H) {
-              		VCLKIndex += 25;
-  		}
-        } else {         					/* RAMDAC2 */
-        	VCLKIndex = (UCHAR)SiS_GetReg2((USHORT)(SiS_Pr->SiS_P3ca+0x02));
-        	VCLKIndex = ((VCLKIndex >> 2) & 0x03);
-        	if(ModeNo > 0x13) {
-          		VCLKIndex = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRTVCLK;
-			if(HwDeviceExtension->jChipType < SIS_315H) {
-          			VCLKIndex &= 0x3f;
-				if( (HwDeviceExtension->jChipType == SIS_630) &&
-				    (HwDeviceExtension->jChipRevision >= 0x30)) {
-				     if(VCLKIndex == 0x14) VCLKIndex = 0x2e;
-				}
-			}
-        	}
-        }
-
-    } else {   /* If not programming CRT2 */
-
-        VCLKIndex = (UCHAR)SiS_GetReg2((USHORT)(SiS_Pr->SiS_P3ca+0x02));
-        VCLKIndex = ((VCLKIndex >> 2) & 0x03);
-        if(ModeNo > 0x13) {
-             VCLKIndex = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRTVCLK;
-	     if(HwDeviceExtension->jChipType < SIS_315H) {
-                VCLKIndex &= 0x3f;
-		if( (HwDeviceExtension->jChipType != SIS_630) &&
-		    (HwDeviceExtension->jChipType != SIS_300) ) {
-		   if(VCLKIndex == 0x1b) VCLKIndex = 0x35;
-		}
-	     }
-        }
-    }
-
-  } else {       /*   LVDS  */
-
-    	VCLKIndex = CRT2Index;
-
-	if(SiS_Pr->SiS_SetFlag & ProgrammingCRT2) {  /* programming CRT2 */
-
-	   if( (SiS_Pr->SiS_IF_DEF_CH70xx != 0) && (SiS_Pr->SiS_VBInfo & SetCRT2ToTV) ) {
-
-		VCLKIndex &= 0x1f;
-        	tempbx = 0;
-		if(SiS_Pr->SiS_VBInfo & SetCHTVOverScan) tempbx += 1;
-        	if(SiS_Pr->SiS_VBInfo & SetPALTV) {
-			tempbx += 2;
-			if(SiS_Pr->SiS_CHSOverScan) tempbx = 8;
-			if(SiS_Pr->SiS_CHPALM) {
-				tempbx = 4;
-				if(SiS_Pr->SiS_VBInfo & SetCHTVOverScan) tempbx += 1;
-			} else if(SiS_Pr->SiS_CHPALN) {
-				tempbx = 6;
-				if(SiS_Pr->SiS_VBInfo & SetCHTVOverScan) tempbx += 1;
-			}
-		}
-       		switch(tempbx) {
-          	   case  0: CHTVVCLKPtr = SiS_Pr->SiS_CHTVVCLKUNTSC;  break;
-         	   case  1: CHTVVCLKPtr = SiS_Pr->SiS_CHTVVCLKONTSC;  break;
-                   case  2: CHTVVCLKPtr = SiS_Pr->SiS_CHTVVCLKUPAL;   break;
-                   case  3: CHTVVCLKPtr = SiS_Pr->SiS_CHTVVCLKOPAL;   break;
-		   case  4: CHTVVCLKPtr = SiS_Pr->SiS_CHTVVCLKUPALM;  break;
-         	   case  5: CHTVVCLKPtr = SiS_Pr->SiS_CHTVVCLKOPALM;  break;
-                   case  6: CHTVVCLKPtr = SiS_Pr->SiS_CHTVVCLKUPALN;  break;
-                   case  7: CHTVVCLKPtr = SiS_Pr->SiS_CHTVVCLKOPALN;  break;
-		   case  8: CHTVVCLKPtr = SiS_Pr->SiS_CHTVVCLKSOPAL;  break;
-		   default: CHTVVCLKPtr = SiS_Pr->SiS_CHTVVCLKOPAL;   break;
-        	}
-        	VCLKIndex = CHTVVCLKPtr[VCLKIndex];
-
-	   } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
-
-	        VCLKIndex >>= 6;
-     		if((SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel800x600) ||
-		   (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel320x480))
-     			VCLKIndex = LVDSXlat1VCLK[VCLKIndex];
-     		else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768)
-     			VCLKIndex = LVDSXlatVCLK2[VCLKIndex];
-		else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x600)
-                        VCLKIndex = LVDSXlatVCLK2[VCLKIndex];
-		else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1152x768)
-                        VCLKIndex = LVDSXlatVCLK2[VCLKIndex];			
-     		else    VCLKIndex = LVDSXlatVCLK3[VCLKIndex];
-
-	   } else {
-
-	        VCLKIndex = (UCHAR)SiS_GetReg2((USHORT)(SiS_Pr->SiS_P3ca+0x02));
-                VCLKIndex = ((VCLKIndex >> 2) & 0x03);
-                if(ModeNo > 0x13) {
-                     VCLKIndex = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRTVCLK;
-		     if(HwDeviceExtension->jChipType < SIS_315H) {
-    		        VCLKIndex &= 0x3F;
-                     }
-		     if( (HwDeviceExtension->jChipType == SIS_630) &&
-                         (HwDeviceExtension->jChipRevision >= 0x30) ) {
-		         	if(VCLKIndex == 0x14) VCLKIndex = 0x2e;
-		     }
-	        }
+     if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
+        if(!(SiS_Pr->SiS_TVMode & (TVSetNTSC1024 | TVSetHiVision | TVSetYPbPr750p | TVSetYPbPr525p))) {
+	   temp |= 0x01;
+	   if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) {
+	      if(!(SiS_Pr->SiS_TVMode & TVSetTVSimuMode)) {
+  	         temp &= 0xFE;
+	      }
 	   }
+	}
+     }
+     SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x1F,0xC0,temp);
 
-	} else {  /* if not programming CRT2 */
+     tempbx = SiS_Pr->SiS_HT;
+     if(SiS_IsDualLink(SiS_Pr, HwInfo)) tempbx >>= 1;
+     tempbx >>= 1;
+     tempbx -= 2;
+     temp = ((tempbx & 0x0700) >> 8) << 3;
+     SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x21,0xC0,temp);
+     temp = tempbx & 0x00FF;
+     SiS_SetReg(SiS_Pr->SiS_Part4Port,0x22,temp);
 
-	   VCLKIndex = (UCHAR)SiS_GetReg2((USHORT)(SiS_Pr->SiS_P3ca+0x02));
-           VCLKIndex = ((VCLKIndex >> 2) & 0x03);
-           if(ModeNo > 0x13) {
-              VCLKIndex = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRTVCLK;
-              if(HwDeviceExtension->jChipType < SIS_315H) {
-	         VCLKIndex &= 0x3F;
-	         if( (HwDeviceExtension->jChipType != SIS_630) &&
-		     (HwDeviceExtension->jChipType != SIS_300) ) {
-		        if(VCLKIndex == 0x1b) VCLKIndex = 0x35;
-	         }
-#if 0		 
-		 if(HwDeviceExtension->jChipType == SIS_730) {
-		    if(VCLKIndex == 0x0b) VCLKIndex = 0x40;   /* 1024x768-70 */
-		    if(VCLKIndex == 0x0d) VCLKIndex = 0x41;   /* 1024x768-75 */ 
-		 }
-#endif		 
-	      }
+     if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {
+	if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
+           SiS_SetReg(SiS_Pr->SiS_Part4Port,0x24,0x0e);
+	   /* LCD-too-dark-error-source, see FinalizeLCD() */
+	}
+	if(HwInfo->jChipType >= SIS_315H) {
+	   if(SiS_IsDualLink(SiS_Pr, HwInfo)) {
+	      SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x27,0x2c);
 	   }
-
 	}
-
-  }
-#ifdef TWDEBUG
-  xf86DrvMsg(0, X_INFO, "VCLKIndex %d (0x%x)\n", VCLKIndex, VCLKIndex);
+#ifdef SET_EMI
+	if(SiS_Pr->SiS_VBType & (VB_SIS302LV | VB_SIS302ELV)) {
+	   SiS_SetReg(SiS_Pr->SiS_Part4Port,0x2a,0x00);
+	   SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x30,0x0c);
+	   SiS_SetReg(SiS_Pr->SiS_Part4Port,0x34,0x10);
+	}
 #endif
-  return (VCLKIndex);
+     }
+
+  }  /* 301B */
+
+  SiS_SetCRT2VCLK(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, HwInfo);
 }
 
-/* TW: Set 301 Palette address port registers */
-/* TW: Checked against 650/301LV BIOS */
-void
-SiS_SetGroup5(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr,
-              UCHAR *ROMAddr, USHORT ModeNo, USHORT ModeIdIndex)
+/*********************************************/
+/*         SET PART 5 REGISTER GROUP         */
+/*********************************************/
+
+/* Set 301 Palette address port registers */
+static void
+SiS_SetGroup5(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
+              PSIS_HW_INFO HwInfo)
 {
 
   if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)  return;
 
-  if(SiS_Pr->SiS_ModeType == ModeVGA){
-     if(!(SiS_Pr->SiS_VBInfo & (SetInSlaveMode | LoadDACFlag))){
+  if(SiS_Pr->SiS_ModeType == ModeVGA) {
+     if(!(SiS_Pr->SiS_VBInfo & (SetInSlaveMode | LoadDACFlag))) {
         SiS_EnableCRT2(SiS_Pr);
-        SiS_LoadDAC(SiS_Pr,HwDeviceExtension,ROMAddr,ModeNo,ModeIdIndex);
+        SiS_LoadDAC(SiS_Pr, HwInfo, ModeNo, ModeIdIndex);
      }
   }
 }
 
-void
-SiS_ModCRT1CRTC(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
-                USHORT RefreshRateTableIndex,PSIS_HW_DEVICE_INFO HwDeviceExtension)
+/*********************************************/
+/*     MODIFY CRT1 GROUP FOR SLAVE MODE      */
+/*********************************************/
+
+static void
+SiS_ModCRT1CRTC(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
+                USHORT RefreshRateTableIndex, PSIS_HW_INFO HwInfo)
 {
-  USHORT temp,tempah,i,modeflag,j;
-  USHORT ResInfo,DisplayType;
+  USHORT tempah,i,modeflag,j;
+  USHORT ResIndex,DisplayType;
   const SiS_LVDSCRT1DataStruct *LVDSCRT1Ptr=NULL;
 
   if(ModeNo <= 0x13) {
-    	modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
+     modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
   } else {
-    	modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
+     modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
   }
 
-  temp = SiS_GetLVDSCRT1Ptr(SiS_Pr,ROMAddr,ModeNo,ModeIdIndex,RefreshRateTableIndex,
-                            &ResInfo,&DisplayType);
+  if((SiS_Pr->SiS_CustomT == CUT_BARCO1366) ||
+     (SiS_Pr->SiS_CustomT == CUT_BARCO1024) ||
+     (SiS_Pr->SiS_CustomT == CUT_PANEL848))
+     return;
 
-  if(temp == 0) return;
+  if(!(SiS_GetLVDSCRT1Ptr(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex,
+                          &ResIndex, &DisplayType))) return;
 
-  if(HwDeviceExtension->jChipType < SIS_315H) {
+  if(HwInfo->jChipType < SIS_315H) {
      if(SiS_Pr->SiS_SetFlag & SetDOSMode) return;
   }
 
@@ -8639,216 +8666,121 @@
     case 41: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11280x768_1_H;        break;
     case 42: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11280x768_2;          break;
     case 43: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11280x768_2_H;        break;
+    case 50: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT1640x480_1;           break;
+    case 51: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT1640x480_1_H;         break;
+    case 52: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT1640x480_2;           break;
+    case 53: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT1640x480_2_H;         break;
+    case 54: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT1640x480_3;           break;
+    case 55: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT1640x480_3_H;         break;
     case 99: LVDSCRT1Ptr = SiS_Pr->SiS_CHTVCRT1SOPAL;               break;
     default: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11024x768_1;          break;
   }
 
   SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x11,0x7f);                        /*unlock cr0-7  */
 
-  tempah = (LVDSCRT1Ptr+ResInfo)->CR[0];
-  SiS_SetReg1(SiS_Pr->SiS_P3d4,0x00,tempah);
+  tempah = (LVDSCRT1Ptr + ResIndex)->CR[0];
+  SiS_SetReg(SiS_Pr->SiS_P3d4,0x00,tempah);
 
   for(i=0x02,j=1;i<=0x05;i++,j++){
-    tempah = (LVDSCRT1Ptr+ResInfo)->CR[j];
-    SiS_SetReg1(SiS_Pr->SiS_P3d4,i,tempah);
+    tempah = (LVDSCRT1Ptr + ResIndex)->CR[j];
+    SiS_SetReg(SiS_Pr->SiS_P3d4,i,tempah);
   }
   for(i=0x06,j=5;i<=0x07;i++,j++){
-    tempah = (LVDSCRT1Ptr+ResInfo)->CR[j];
-    SiS_SetReg1(SiS_Pr->SiS_P3d4,i,tempah);
+    tempah = (LVDSCRT1Ptr + ResIndex)->CR[j];
+    SiS_SetReg(SiS_Pr->SiS_P3d4,i,tempah);
   }
   for(i=0x10,j=7;i<=0x11;i++,j++){
-    tempah = (LVDSCRT1Ptr+ResInfo)->CR[j];
-    SiS_SetReg1(SiS_Pr->SiS_P3d4,i,tempah);
+    tempah = (LVDSCRT1Ptr + ResIndex)->CR[j];
+    SiS_SetReg(SiS_Pr->SiS_P3d4,i,tempah);
   }
   for(i=0x15,j=9;i<=0x16;i++,j++){
-    tempah = (LVDSCRT1Ptr+ResInfo)->CR[j];
-    SiS_SetReg1(SiS_Pr->SiS_P3d4,i,tempah);
+    tempah = (LVDSCRT1Ptr + ResIndex)->CR[j];
+    SiS_SetReg(SiS_Pr->SiS_P3d4,i,tempah);
   }
   for(i=0x0A,j=11;i<=0x0C;i++,j++){
-    tempah = (LVDSCRT1Ptr+ResInfo)->CR[j];
-    SiS_SetReg1(SiS_Pr->SiS_P3c4,i,tempah);
+    tempah = (LVDSCRT1Ptr + ResIndex)->CR[j];
+    SiS_SetReg(SiS_Pr->SiS_P3c4,i,tempah);
   }
 
-  tempah = (LVDSCRT1Ptr+ResInfo)->CR[14];
+  tempah = (LVDSCRT1Ptr + ResIndex)->CR[14];
   tempah &= 0xE0;
-  SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x0E,0x1f,tempah);     
+  SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x0E,0x1f,tempah);
 
-  tempah = (LVDSCRT1Ptr+ResInfo)->CR[14];
+  tempah = (LVDSCRT1Ptr + ResIndex)->CR[14];
   tempah &= 0x01;
   tempah <<= 5;
   if(modeflag & DoubleScanMode)  tempah |= 0x080;
   SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x09,~0x020,tempah);
 
-  /* TW: 650/LVDS BIOS - doesn't make sense */
+  /* 650/LVDS BIOS - doesn't make sense */
   if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
      if(modeflag & HalfDCLK)
         SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x11,0x7f);
   }
 }
 
-BOOLEAN
-SiS_GetLVDSCRT1Ptr(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
-		   USHORT RefreshRateTableIndex,USHORT *ResInfo,
-		   USHORT *DisplayType)
- {
-  USHORT tempbx,modeflag=0;
-  USHORT Flag,CRT2CRTC;
-
-  if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
-     if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) {
-        if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) return 0;
-     }
-  } else {
-     if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) return 0;
-  }
-
-  if(ModeNo <= 0x13) {
-    	modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
-    	CRT2CRTC = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC;
-  } else {
-    	modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
-    	CRT2CRTC = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC;
-  }
-
-  Flag = 1;
-  tempbx = 0;
-  if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) {
-     if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD)) {
-        Flag = 0;
-        tempbx = 18;
-        if(SiS_Pr->SiS_VBInfo & SetCHTVOverScan) tempbx++;
-        if(SiS_Pr->SiS_VBInfo & SetPALTV) {
-      	   tempbx += 2;
-	   if(SiS_Pr->SiS_CHSOverScan) tempbx = 99;
-	   if(SiS_Pr->SiS_CHPALM) {
-	      tempbx = 18;  /* PALM uses NTSC data */
-	      if(SiS_Pr->SiS_VBInfo & SetCHTVOverScan) tempbx++;
-	   } else if(SiS_Pr->SiS_CHPALN) {
-	      tempbx = 20;  /* PALN uses PAL data  */
-	      if(SiS_Pr->SiS_VBInfo & SetCHTVOverScan) tempbx++;
-	   }
-        }
-     }
-  }
-  if(Flag) {
-     tempbx = SiS_Pr->SiS_LCDResInfo;
-     tempbx -= SiS_Pr->SiS_PanelMinLVDS;
-     if(SiS_Pr->SiS_LCDResInfo <= SiS_Pr->SiS_Panel1280x1024) {
-        if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx += 6;
-        if(modeflag & HalfDCLK) tempbx += 3;
-     } else {
-        if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) {
-           tempbx = 14;
-	   if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx += 2;
-	   if(modeflag & HalfDCLK) tempbx++;
-        } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x600) {
-           tempbx = 23;
-	   if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx += 2;
-	   if(modeflag & HalfDCLK) tempbx++;
-        } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1152x768) {
-           tempbx = 27;
-	   if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx += 2;
-	   if(modeflag & HalfDCLK) tempbx++;
-        } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200) {
-           tempbx = 36;
-	   if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx += 2;
-	   if(modeflag & HalfDCLK) tempbx++;
-        } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x768) {
-           tempbx = 40;
-	   if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx += 2;
-	   if(modeflag & HalfDCLK) tempbx++;
-        }
-     }
-     if(SiS_Pr->SiS_LCDInfo & LCDPass11) {
-        tempbx = 12;
-	if(modeflag & HalfDCLK) tempbx++;
-     }
-  }
-  if(SiS_Pr->SiS_IF_DEF_FSTN){
-     if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel320x480){
-        tempbx = 22;
-     }
-  }
-  *ResInfo = CRT2CRTC & 0x3F;
-  *DisplayType = tempbx;
-  return 1;
-}
-
-void
-SiS_SetCRT2ECLK(SiS_Private *SiS_Pr, UCHAR *ROMAddr, USHORT ModeNo,USHORT ModeIdIndex,
-           USHORT RefreshRateTableIndex,PSIS_HW_DEVICE_INFO HwDeviceExtension)
+/*********************************************/
+/*              SET CRT2 ECLK                */
+/*********************************************/
+
+static void
+SiS_SetCRT2ECLK(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
+           USHORT RefreshRateTableIndex, PSIS_HW_INFO HwInfo)
 {
-  USHORT tempah,tempal,pushax;
-  USHORT vclkindex=0;
-    
+  UCHAR  *ROMAddr = HwInfo->pjVirtualRomBase;
+  USHORT clkbase, vclkindex=0;
+  UCHAR  sr2b, sr2c;
+
   if((SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480) || (SiS_Pr->SiS_IF_DEF_TRUMPION == 1)) {
 	SiS_Pr->SiS_SetFlag &= (~ProgrammingCRT2);
-        tempal = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRTVCLK;
-    	tempal &= 0x3F;
-	if(tempal == 2) RefreshRateTableIndex--;
-	vclkindex = SiS_GetVCLK2Ptr(SiS_Pr,ROMAddr,ModeNo,ModeIdIndex,
-                               RefreshRateTableIndex,HwDeviceExtension);
+        if((SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRTVCLK & 0x3f) == 2) {
+	   RefreshRateTableIndex--;
+	}
+	vclkindex = SiS_GetVCLK2Ptr(SiS_Pr, ModeNo, ModeIdIndex,
+                                    RefreshRateTableIndex, HwInfo);
 	SiS_Pr->SiS_SetFlag |= ProgrammingCRT2;
   } else {
-        vclkindex = SiS_GetVCLK2Ptr(SiS_Pr,ROMAddr,ModeNo,ModeIdIndex,
-                               RefreshRateTableIndex,HwDeviceExtension);
+        vclkindex = SiS_GetVCLK2Ptr(SiS_Pr, ModeNo, ModeIdIndex,
+                                    RefreshRateTableIndex, HwInfo);
   }
-  
-  tempal = 0x02B;
+
+  sr2b = SiS_Pr->SiS_VCLKData[vclkindex].SR2B;
+  sr2c = SiS_Pr->SiS_VCLKData[vclkindex].SR2C;
+
+  if((SiS_Pr->SiS_CustomT == CUT_BARCO1366) || (SiS_Pr->SiS_CustomT == CUT_BARCO1024)) {
+     if((ROMAddr) && SiS_Pr->SiS_UseROM) {
+	if(ROMAddr[0x220] & 0x01) {
+           sr2b = ROMAddr[0x227];
+	   sr2c = ROMAddr[0x228];
+	}
+     }
+  }
+
+  clkbase = 0x02B;
   if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) {
      if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) {
-    	tempal += 3;
+    	clkbase += 3;
      }
   }
-  SiS_SetReg1(SiS_Pr->SiS_P3c4,0x05,0x86);
-  pushax = tempal;
-  SiS_SetReg1(SiS_Pr->SiS_P3c4,0x31,0x20);
-  tempah = SiS_Pr->SiS_VCLKData[vclkindex].SR2B;
-  SiS_SetReg1(SiS_Pr->SiS_P3c4,tempal,tempah);
-  tempal++;
-  tempah = SiS_Pr->SiS_VCLKData[vclkindex].SR2C;
-  SiS_SetReg1(SiS_Pr->SiS_P3c4,tempal,tempah);
-  SiS_SetReg1(SiS_Pr->SiS_P3c4,0x31,0x10);
-  tempal = pushax;
-  tempah = SiS_Pr->SiS_VCLKData[vclkindex].SR2B;
-  SiS_SetReg1(SiS_Pr->SiS_P3c4,tempal,tempah);
-  tempal++;
-  tempah = SiS_Pr->SiS_VCLKData[vclkindex].SR2C;
-  SiS_SetReg1(SiS_Pr->SiS_P3c4,tempal,tempah);
-  SiS_SetReg1(SiS_Pr->SiS_P3c4,0x31,0x00);
-  tempal = pushax;
-  tempah = SiS_Pr->SiS_VCLKData[vclkindex].SR2B;
-  SiS_SetReg1(SiS_Pr->SiS_P3c4,tempal,tempah);
-  tempal++;
-  tempah = SiS_Pr->SiS_VCLKData[vclkindex].SR2C;
-  SiS_SetReg1(SiS_Pr->SiS_P3c4,tempal,tempah);
-  return;
-}
-
-#if 0  /* TW: Not used */
-void
-SiS_SetDefCRT2ExtRegs(SiS_Private *SiS_Pr, USHORT BaseAddr)
-{
-  USHORT  temp;
 
-  if(SiS_Pr->SiS_IF_DEF_LVDS==0) {
-    SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x02,0x40);
-    SiS_SetReg1(SiS_Pr->SiS_Part4Port,0x10,0x80);
-    temp=(UCHAR)SiS_GetReg1(SiS_Pr->SiS_P3c4,0x16);
-    temp &= 0xC3;
-    SiS_SetReg1(SiS_Pr->SiS_P3d4,0x35,temp);
-  } else {
-    SiS_SetReg1(SiS_Pr->SiS_P3d4,0x32,0x02);
-    SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x02,0x00);
-  }
+  SiS_SetReg(SiS_Pr->SiS_P3c4,0x05,0x86);
+  SiS_SetReg(SiS_Pr->SiS_P3c4,0x31,0x20);
+  SiS_SetReg(SiS_Pr->SiS_P3c4,clkbase,sr2b);
+  SiS_SetReg(SiS_Pr->SiS_P3c4,clkbase+1,sr2c);
+  SiS_SetReg(SiS_Pr->SiS_P3c4,0x31,0x10);
+  SiS_SetReg(SiS_Pr->SiS_P3c4,clkbase,sr2b);
+  SiS_SetReg(SiS_Pr->SiS_P3c4,clkbase+1,sr2c);
+  SiS_SetReg(SiS_Pr->SiS_P3c4,0x31,0x00);
+  SiS_SetReg(SiS_Pr->SiS_P3c4,clkbase,sr2b);
+  SiS_SetReg(SiS_Pr->SiS_P3c4,clkbase+1,sr2c);
 }
-#endif
 
-/* TW: Start of Chrontel 70xx functions ---------------------- */
+/*********************************************/
+/*           SET UP CHRONTEL CHIPS           */
+/*********************************************/
 
-/* Set-up the Chrontel Registers */
-void
-SiS_SetCHTVReg(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
+static void
+SiS_SetCHTVReg(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
                USHORT RefreshRateTableIndex)
 {
   USHORT temp, tempbx, tempcl;
@@ -8861,16 +8793,18 @@
     	tempcl = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC;
 
   TVType = 0;
-  if(SiS_Pr->SiS_VBInfo & SetCHTVOverScan) TVType += 1;
-  if(SiS_Pr->SiS_VBInfo & SetPALTV) {
+  if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) TVType += 1;
+  if(SiS_Pr->SiS_TVMode & TVSetPAL) {
   	TVType += 2;
-	if(SiS_Pr->SiS_CHSOverScan) TVType = 8;
-	if(SiS_Pr->SiS_CHPALM) {
+	if(SiS_Pr->SiS_ModeType > ModeVGA) {
+	   if(SiS_Pr->SiS_CHSOverScan) TVType = 8;
+	}
+	if(SiS_Pr->SiS_TVMode & TVSetPALM) {
 		TVType = 4;
-		if(SiS_Pr->SiS_VBInfo & SetCHTVOverScan) TVType += 1;
-	} else if(SiS_Pr->SiS_CHPALN) {
+		if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) TVType += 1;
+	} else if(SiS_Pr->SiS_TVMode & TVSetPALN) {
 		TVType = 6;
-		if(SiS_Pr->SiS_VBInfo & SetCHTVOverScan) TVType += 1;
+		if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) TVType += 1;
 	}
   }
   switch(TVType) {
@@ -8890,44 +8824,44 @@
   if(SiS_Pr->SiS_IF_DEF_CH70xx == 1) {
 
 #ifdef SIS300
-  
-     /* Chrontel 7005 - I assume that it does not come with a 310/325 series chip */
 
-     /* TW: We don't support modes >800x600 */
+     /* Chrontel 7005 - I assume that it does not come with a 315 series chip */
+
+     /* We don't support modes >800x600 */
      if (resindex > 5) return;
 
-     if(SiS_Pr->SiS_VBInfo & SetPALTV) {
-    	SiS_SetCH700x(SiS_Pr,0x4304);   /* TW: 0x40=76uA (PAL); 0x03=15bit non-multi RGB*/
-    	SiS_SetCH700x(SiS_Pr,0x6909);	/* TW: Black level for PAL (105)*/
+     if(SiS_Pr->SiS_TVMode & TVSetPAL) {
+    	SiS_SetCH700x(SiS_Pr,0x4304);   /* 0x40=76uA (PAL); 0x03=15bit non-multi RGB*/
+    	SiS_SetCH700x(SiS_Pr,0x6909);	/* Black level for PAL (105)*/
      } else {
-    	SiS_SetCH700x(SiS_Pr,0x0304);   /* TW: upper nibble=71uA (NTSC), 0x03=15bit non-multi RGB*/
-    	SiS_SetCH700x(SiS_Pr,0x7109);	/* TW: Black level for NTSC (113)*/
+    	SiS_SetCH700x(SiS_Pr,0x0304);   /* upper nibble=71uA (NTSC), 0x03=15bit non-multi RGB*/
+    	SiS_SetCH700x(SiS_Pr,0x7109);	/* Black level for NTSC (113)*/
      }
 
      temp = CHTVRegData[resindex].Reg[0];
-     tempbx=((temp&0x00FF)<<8)|0x00;	/* TW: Mode register */
+     tempbx=((temp&0x00FF)<<8)|0x00;	/* Mode register */
      SiS_SetCH700x(SiS_Pr,tempbx);
      temp = CHTVRegData[resindex].Reg[1];
-     tempbx=((temp&0x00FF)<<8)|0x07;	/* TW: Start active video register */
+     tempbx=((temp&0x00FF)<<8)|0x07;	/* Start active video register */
      SiS_SetCH700x(SiS_Pr,tempbx);
      temp = CHTVRegData[resindex].Reg[2];
-     tempbx=((temp&0x00FF)<<8)|0x08;	/* TW: Position overflow register */
+     tempbx=((temp&0x00FF)<<8)|0x08;	/* Position overflow register */
      SiS_SetCH700x(SiS_Pr,tempbx);
      temp = CHTVRegData[resindex].Reg[3];
-     tempbx=((temp&0x00FF)<<8)|0x0A;	/* TW: Horiz Position register */
+     tempbx=((temp&0x00FF)<<8)|0x0A;	/* Horiz Position register */
      SiS_SetCH700x(SiS_Pr,tempbx);
      temp = CHTVRegData[resindex].Reg[4];
-     tempbx=((temp&0x00FF)<<8)|0x0B;	/* TW: Vertical Position register */
+     tempbx=((temp&0x00FF)<<8)|0x0B;	/* Vertical Position register */
      SiS_SetCH700x(SiS_Pr,tempbx);
 
-     /* TW: Set minimum flicker filter for Luma channel (SR1-0=00),
+     /* Set minimum flicker filter for Luma channel (SR1-0=00),
                 minimum text enhancement (S3-2=10),
    	        maximum flicker filter for Chroma channel (S5-4=10)
 	        =00101000=0x28 (When reading, S1-0->S3-2, and S3-2->S1-0!)
       */
      SiS_SetCH700x(SiS_Pr,0x2801);
 
-     /* TW: Set video bandwidth
+     /* Set video bandwidth
             High bandwith Luma composite video filter(S0=1)
             low bandwith Luma S-video filter (S2-1=00)
 	    disable peak filter in S-video channel (S3=0)
@@ -8936,66 +8870,68 @@
      */
      SiS_SetCH700x(SiS_Pr,0xb103);       /* old: 3103 */
 
-     /* TW: Register 0x3D does not exist in non-macrovision register map
+     /* Register 0x3D does not exist in non-macrovision register map
             (Maybe this is a macrovision register?)
       */
-     /* SiS_SetCH70xx(SiS_Pr,0x003D); */
+#ifndef SIS_CP
+     SiS_SetCH70xx(SiS_Pr,0x003D);
+#endif
 
-     /* TW: Register 0x10 only contains 1 writable bit (S0) for sensing,
+     /* Register 0x10 only contains 1 writable bit (S0) for sensing,
             all other bits a read-only. Macrovision?
       */
      SiS_SetCH70xxANDOR(SiS_Pr,0x0010,0x1F);
 
-     /* TW: Register 0x11 only contains 3 writable bits (S0-S2) for
+     /* Register 0x11 only contains 3 writable bits (S0-S2) for
             contrast enhancement (set to 010 -> gain 1 Yout = 17/16*(Yin-30) )
       */
      SiS_SetCH70xxANDOR(SiS_Pr,0x0211,0xF8);
 
-     /* TW: Clear DSEN
+     /* Clear DSEN
       */
      SiS_SetCH70xxANDOR(SiS_Pr,0x001C,0xEF);
 
-     if(!(SiS_Pr->SiS_VBInfo & SetPALTV)) {		/* ---- NTSC ---- */
-       if(SiS_Pr->SiS_VBInfo & SetCHTVOverScan) {
+     if(!(SiS_Pr->SiS_TVMode & TVSetPAL)) {		/* ---- NTSC ---- */
+       if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) {
          if(resindex == 0x04) {   			/* 640x480 overscan: Mode 16 */
       	   SiS_SetCH70xxANDOR(SiS_Pr,0x0020,0xEF);   	/* loop filter off */
            SiS_SetCH70xxANDOR(SiS_Pr,0x0121,0xFE);      /* ACIV on, no need to set FSCI */
-         } else {
-           if(resindex == 0x05) {    			/* 800x600 overscan: Mode 23 */
-             SiS_SetCH70xxANDOR(SiS_Pr,0x0118,0xF0);	/* 0x18-0x1f: FSCI 469,762,048 */
-             SiS_SetCH70xxANDOR(SiS_Pr,0x0C19,0xF0);
-             SiS_SetCH70xxANDOR(SiS_Pr,0x001A,0xF0);
-             SiS_SetCH70xxANDOR(SiS_Pr,0x001B,0xF0);
-             SiS_SetCH70xxANDOR(SiS_Pr,0x001C,0xF0);
-             SiS_SetCH70xxANDOR(SiS_Pr,0x001D,0xF0);
-             SiS_SetCH70xxANDOR(SiS_Pr,0x001E,0xF0);
-             SiS_SetCH70xxANDOR(SiS_Pr,0x001F,0xF0);
-             SiS_SetCH70xxANDOR(SiS_Pr,0x0120,0xEF);     /* Loop filter on for mode 23 */
-             SiS_SetCH70xxANDOR(SiS_Pr,0x0021,0xFE);     /* ACIV off, need to set FSCI */
-           }
+         } else if(resindex == 0x05) {    		/* 800x600 overscan: Mode 23 */
+           SiS_SetCH70xxANDOR(SiS_Pr,0x0118,0xF0);	/* 0x18-0x1f: FSCI 469,762,048 */
+           SiS_SetCH70xxANDOR(SiS_Pr,0x0C19,0xF0);
+           SiS_SetCH70xxANDOR(SiS_Pr,0x001A,0xF0);
+           SiS_SetCH70xxANDOR(SiS_Pr,0x001B,0xF0);
+           SiS_SetCH70xxANDOR(SiS_Pr,0x001C,0xF0);
+           SiS_SetCH70xxANDOR(SiS_Pr,0x001D,0xF0);
+           SiS_SetCH70xxANDOR(SiS_Pr,0x001E,0xF0);
+           SiS_SetCH70xxANDOR(SiS_Pr,0x001F,0xF0);
+           SiS_SetCH70xxANDOR(SiS_Pr,0x0120,0xEF);       /* Loop filter on for mode 23 */
+           SiS_SetCH70xxANDOR(SiS_Pr,0x0021,0xFE);       /* ACIV off, need to set FSCI */
          }
        } else {
          if(resindex == 0x04) {     			 /* ----- 640x480 underscan; Mode 17 */
            SiS_SetCH70xxANDOR(SiS_Pr,0x0020,0xEF); 	 /* loop filter off */
            SiS_SetCH70xxANDOR(SiS_Pr,0x0121,0xFE);
-         } else {
-           if(resindex == 0x05) {   			 /* ----- 800x600 underscan: Mode 24 */
-             SiS_SetCH70xxANDOR(SiS_Pr,0x0118,0xF0);     /* (FSCI was 0x1f1c71c7 - this is for mode 22) */
-             SiS_SetCH70xxANDOR(SiS_Pr,0x0919,0xF0);	 /* FSCI for mode 24 is 428,554,851 */
-             SiS_SetCH70xxANDOR(SiS_Pr,0x081A,0xF0);
-             SiS_SetCH70xxANDOR(SiS_Pr,0x0b1B,0xF0);
-             SiS_SetCH70xxANDOR(SiS_Pr,0x031C,0xF0);
-             SiS_SetCH70xxANDOR(SiS_Pr,0x0a1D,0xF0);
-             SiS_SetCH70xxANDOR(SiS_Pr,0x061E,0xF0);
-             SiS_SetCH70xxANDOR(SiS_Pr,0x031F,0xF0);
-             SiS_SetCH70xxANDOR(SiS_Pr,0x0020,0xEF);     /* loop filter off for mode 24 */
-             SiS_SetCH70xxANDOR(SiS_Pr,0x0021,0xFE);	 /* ACIV off, need to set FSCI */
-           }
+         } else if(resindex == 0x05) {   		 /* ----- 800x600 underscan: Mode 24 */
+#if 0
+           SiS_SetCH70xxANDOR(SiS_Pr,0x0118,0xF0);       /* (FSCI was 0x1f1c71c7 - this is for mode 22) */
+           SiS_SetCH70xxANDOR(SiS_Pr,0x0919,0xF0);	 /* FSCI for mode 24 is 428,554,851 */
+           SiS_SetCH70xxANDOR(SiS_Pr,0x081A,0xF0);       /* 198b3a63 */
+           SiS_SetCH70xxANDOR(SiS_Pr,0x0b1B,0xF0);
+           SiS_SetCH70xxANDOR(SiS_Pr,0x041C,0xF0);
+           SiS_SetCH70xxANDOR(SiS_Pr,0x011D,0xF0);
+           SiS_SetCH70xxANDOR(SiS_Pr,0x061E,0xF0);
+           SiS_SetCH70xxANDOR(SiS_Pr,0x051F,0xF0);
+           SiS_SetCH70xxANDOR(SiS_Pr,0x0020,0xEF);       /* loop filter off for mode 24 */
+           SiS_SetCH70xxANDOR(SiS_Pr,0x0021,0xFE);	 /* ACIV off, need to set FSCI */
+#endif     /* All alternatives wrong (datasheet wrong?), don't use FSCI */
+	   SiS_SetCH70xxANDOR(SiS_Pr,0x0020,0xEF); 	 /* loop filter off */
+           SiS_SetCH70xxANDOR(SiS_Pr,0x0121,0xFE);
          }
        }
-     } else {				/* ---- PAL ---- */
-           /* TW: We don't play around with FSCI in PAL mode */
-         if (resindex == 0x04) {
+     } else {						/* ---- PAL ---- */
+           /* We don't play around with FSCI in PAL mode */
+         if(resindex == 0x04) {
            SiS_SetCH70xxANDOR(SiS_Pr,0x0020,0xEF); 	/* loop filter off */
            SiS_SetCH70xxANDOR(SiS_Pr,0x0121,0xFE);      /* ACIV on */
          } else {
@@ -9012,96 +8948,113 @@
 
 #ifdef SIS315H
 
-     /* TW: We don't support modes >1024x768 */
+     /* We don't support modes >1024x768 */
      if (resindex > 6) return;
 
      temp = CHTVRegData[resindex].Reg[0];
-     tempbx=((temp & 0x00FF) <<8 ) | 0x00;
+     if(SiS_Pr->SiS_TVMode & TVSetNTSCJ) {
+        temp |= 0x10;
+     }
+     tempbx=((temp & 0x00FF) << 8) | 0x00;
      SiS_SetCH701x(SiS_Pr,tempbx);
 
      temp = CHTVRegData[resindex].Reg[1];
-     tempbx=((temp & 0x00FF) <<8 ) | 0x01;
+     tempbx=((temp & 0x00FF) << 8) | 0x01;
      SiS_SetCH701x(SiS_Pr,tempbx);
 
      temp = CHTVRegData[resindex].Reg[2];
-     tempbx=((temp & 0x00FF) <<8 ) | 0x02;
+     tempbx=((temp & 0x00FF) << 8) | 0x02;
      SiS_SetCH701x(SiS_Pr,tempbx);
 
      temp = CHTVRegData[resindex].Reg[3];
-     tempbx=((temp & 0x00FF) <<8 ) | 0x04;
+     tempbx=((temp & 0x00FF) << 8) | 0x04;
      SiS_SetCH701x(SiS_Pr,tempbx);
 
      temp = CHTVRegData[resindex].Reg[4];
-     tempbx=((temp & 0x00FF) <<8 ) | 0x03;
+     tempbx=((temp & 0x00FF) << 8) | 0x03;
      SiS_SetCH701x(SiS_Pr,tempbx);
 
      temp = CHTVRegData[resindex].Reg[5];
-     tempbx=((temp & 0x00FF) <<8 ) | 0x05;
+     tempbx=((temp & 0x00FF) << 8) | 0x05;
      SiS_SetCH701x(SiS_Pr,tempbx);
 
      temp = CHTVRegData[resindex].Reg[6];
-     tempbx=((temp & 0x00FF) <<8 ) | 0x06;
+     tempbx=((temp & 0x00FF) << 8) | 0x06;
      SiS_SetCH701x(SiS_Pr,tempbx);
 
      temp = CHTVRegData[resindex].Reg[7];
-     tempbx=((temp & 0x00FF) <<8 ) | 0x07;
+     if(SiS_Pr->SiS_TVMode & TVSetNTSCJ) {
+	temp = 0x66;
+     }
+     tempbx=((temp & 0x00FF) << 8) | 0x07;
      SiS_SetCH701x(SiS_Pr,tempbx);
 
      temp = CHTVRegData[resindex].Reg[8];
-     tempbx=((temp & 0x00FF) <<8 ) | 0x08;
+     tempbx=((temp & 0x00FF) << 8) | 0x08;
      SiS_SetCH701x(SiS_Pr,tempbx);
 
      temp = CHTVRegData[resindex].Reg[9];
-     tempbx=((temp & 0x00FF) <<8 ) | 0x15;
+     tempbx=((temp & 0x00FF) << 8) | 0x15;
      SiS_SetCH701x(SiS_Pr,tempbx);
 
      temp = CHTVRegData[resindex].Reg[10];
-     tempbx=((temp & 0x00FF) <<8 ) | 0x1f;
+     tempbx=((temp & 0x00FF) << 8) | 0x1f;
      SiS_SetCH701x(SiS_Pr,tempbx);
 
      temp = CHTVRegData[resindex].Reg[11];
-     tempbx=((temp & 0x00FF) <<8 ) | 0x0c;
+     tempbx=((temp & 0x00FF) << 8) | 0x0c;
      SiS_SetCH701x(SiS_Pr,tempbx);
 
      temp = CHTVRegData[resindex].Reg[12];
-     tempbx=((temp & 0x00FF) <<8 ) | 0x0d;
+     tempbx=((temp & 0x00FF) << 8) | 0x0d;
      SiS_SetCH701x(SiS_Pr,tempbx);
 
      temp = CHTVRegData[resindex].Reg[13];
-     tempbx=((temp & 0x00FF) <<8 ) | 0x0e;
+     tempbx=((temp & 0x00FF) << 8) | 0x0e;
      SiS_SetCH701x(SiS_Pr,tempbx);
 
      temp = CHTVRegData[resindex].Reg[14];
-     tempbx=((temp & 0x00FF) <<8 ) | 0x0f;
+     tempbx=((temp & 0x00FF) << 8) | 0x0f;
      SiS_SetCH701x(SiS_Pr,tempbx);
 
      temp = CHTVRegData[resindex].Reg[15];
-     tempbx=((temp & 0x00FF) <<8 ) | 0x10;
+     tempbx=((temp & 0x00FF) << 8) | 0x10;
      SiS_SetCH701x(SiS_Pr,tempbx);
-     
+
+     temp = SiS_GetCH701x(SiS_Pr,0x21) & ~0x02;
+     /* D1 should be set for PAL, PAL-N and NTSC-J,
+        but I won't do that for PAL unless somebody
+	tells me to do so. Since the BIOS uses
+	non-default CIV values and blacklevels,
+	this might be compensated anyway.
+      */
+     if(SiS_Pr->SiS_TVMode & (TVSetPALN | TVSetNTSCJ)) temp |= 0x02;
+     SiS_SetCH701x(SiS_Pr,((temp << 8) | 0x21));
+
 #endif	/* 315 */
 
   }
-}
 
-/* TW: Chrontel 701x functions ================================= */
+#ifdef SIS_CP
+  SIS_CP_INIT301_CP3
+#endif
+
+}
 
 void
-SiS_Chrontel701xBLOn(SiS_Private *SiS_Pr)
+SiS_Chrontel701xBLOn(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
 {
-#ifndef NEWCH701x
   USHORT temp;
-#endif  
 
-  /* TW: Enable Chrontel 7019 LCD panel backlight */
+  /* Enable Chrontel 7019 LCD panel backlight */
   if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) {
-#ifdef NEWCH701x
+     if(HwInfo->jChipType == SIS_740) {
         SiS_SetCH701x(SiS_Pr,0x6566);
-#else  
+     } else {
         temp = SiS_GetCH701x(SiS_Pr,0x66);
         temp |= 0x20;
 	SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x66);
-#endif	
+     }
   }
 }
 
@@ -9110,55 +9063,102 @@
 {
   USHORT temp;
 
-  /* TW: Disable Chrontel 7019 LCD panel backlight */
+  /* Disable Chrontel 7019 LCD panel backlight */
   if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) {
-        temp = SiS_GetCH701x(SiS_Pr,0x66);
-        temp &= 0xDF;
-	SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x66);
+     temp = SiS_GetCH701x(SiS_Pr,0x66);
+     temp &= 0xDF;
+     SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x66);
   }
 }
 
-#ifdef SIS315H  /* -------- 310/325 series only --------- */
+#ifdef SIS315H  /* ----------- 315 series only ---------- */
 
-void
-SiS_SetCH701xForLCD(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT BaseAddr)
+static void
+SiS_ChrontelPowerSequencing(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
 {
-#ifdef NEWCH701x  
-  UCHAR regtable[]  = { 0x1c, 0x5f, 0x64, 0x6f, 0x70, 0x71,
-                        0x72, 0x73, 0x74, 0x76, 0x78, 0x7d, 0x66 };
-  UCHAR table1024[] = { 0x60, 0x02, 0x00, 0x07, 0x40, 0xed,
-                        0xa3, 0xc8, 0xc7, 0xac, 0xe0, 0x02, 0x44 }; 
-  UCHAR table1280[] = { 0x60, 0x03, 0x11, 0x00, 0x40, 0xe3,
-   			0xad, 0xdb, 0xf6, 0xac, 0xe0, 0x02, 0x44 }; 			
-  UCHAR table1400[] = { 0x60, 0x03, 0x11, 0x00, 0x40, 0xe3,         
-                        0xad, 0xdb, 0xf6, 0xac, 0xe0, 0x02, 0x44 }; 
-  UCHAR table1600[] = { 0x60, 0x04, 0x11, 0x00, 0x40, 0xe3,
-  			0xad, 0xde, 0xf6, 0xac, 0x60, 0x1a, 0x44 };
-#else
-  UCHAR regtable[]  = { 0x1c, 0x5f, 0x64, 0x6f, 0x70, 0x71,
-                        0x72, 0x73, 0x74, 0x76, 0x78, 0x7d };
-  UCHAR table1024[] = { 0x60, 0x02, 0x00, 0x07, 0x40, 0xed,
-                        0xa3, 0xc8, 0xc7, 0xac, 0x60, 0x02 }; 
-  UCHAR table1280[] = { 0x60, 0x03, 0x11, 0x00, 0x40, 0xe3,
-   			0xad, 0xdb, 0xf6, 0xac, 0xe0, 0x02 }; 			
-  UCHAR table1400[] = { 0x60, 0x03, 0x11, 0x00, 0x40, 0xef,   
-                        0xad, 0xdb, 0xf6, 0xac, 0x60, 0x02 }; 
-  UCHAR table1600[] = { 0x60, 0x04, 0x11, 0x00, 0x40, 0xe3,
-  			0xad, 0xde, 0xf6, 0xac, 0x60, 0x1a };
-#endif			
+  UCHAR regtable[]      = { 0x67, 0x68, 0x69, 0x6a, 0x6b };
+  UCHAR table1024_740[] = { 0x01, 0x02, 0x01, 0x01, 0x01 };
+  UCHAR table1400_740[] = { 0x01, 0x6e, 0x01, 0x01, 0x01 };
+  UCHAR asus1024_740[]  = { 0x19, 0x6e, 0x01, 0x19, 0x09 };
+  UCHAR asus1400_740[]  = { 0x19, 0x6e, 0x01, 0x19, 0x09 };
+  UCHAR table1024_650[] = { 0x01, 0x02, 0x01, 0x01, 0x02 };
+  UCHAR table1400_650[] = { 0x01, 0x02, 0x01, 0x01, 0x02 };
+  UCHAR *tableptr = NULL;
+  int i;
+
+  /* Set up Power up/down timing */
+
+  if(HwInfo->jChipType == SIS_740) {
+     if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) {
+        if(SiS_Pr->SiS_CustomT == CUT_ASUSL3000D) tableptr = asus1024_740;
+        else    			          tableptr = table1024_740;
+     } else if((SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) ||
+               (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) ||
+	       (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200)) {
+	if(SiS_Pr->SiS_CustomT == CUT_ASUSL3000D) tableptr = asus1400_740;
+        else					  tableptr = table1400_740;
+     } else return;
+  } else {
+     if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) {
+        tableptr = table1024_650;
+     } else if((SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) ||
+               (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) ||
+	       (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200)) {
+        tableptr = table1400_650;
+     } else return;
+  }
+
+  for(i=0; i<5; i++) {
+     SiS_SetCH701x(SiS_Pr,(tableptr[i] << 8) | regtable[i]);
+  }
+}
+
+static void
+SiS_SetCH701xForLCD(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
+{
+  UCHAR regtable[]      = { 0x1c, 0x5f, 0x64, 0x6f, 0x70, 0x71,
+                            0x72, 0x73, 0x74, 0x76, 0x78, 0x7d, 0x66 };
+  UCHAR table1024_740[] = { 0x60, 0x02, 0x00, 0x07, 0x40, 0xed,
+                            0xa3, 0xc8, 0xc7, 0xac, 0xe0, 0x02, 0x44 };
+  UCHAR table1280_740[] = { 0x60, 0x03, 0x11, 0x00, 0x40, 0xe3,
+   			    0xad, 0xdb, 0xf6, 0xac, 0xe0, 0x02, 0x44 };
+  UCHAR table1400_740[] = { 0x60, 0x03, 0x11, 0x00, 0x40, 0xe3,
+                            0xad, 0xdb, 0xf6, 0xac, 0xe0, 0x02, 0x44 };
+  UCHAR table1600_740[] = { 0x60, 0x04, 0x11, 0x00, 0x40, 0xe3,
+  			    0xad, 0xde, 0xf6, 0xac, 0x60, 0x1a, 0x44 };
+  UCHAR table1024_650[] = { 0x60, 0x02, 0x00, 0x07, 0x40, 0xed,
+                            0xa3, 0xc8, 0xc7, 0xac, 0x60, 0x02 };
+  UCHAR table1280_650[] = { 0x60, 0x03, 0x11, 0x00, 0x40, 0xe3,
+   		   	    0xad, 0xdb, 0xf6, 0xac, 0xe0, 0x02 };
+  UCHAR table1400_650[] = { 0x60, 0x03, 0x11, 0x00, 0x40, 0xef,
+                            0xad, 0xdb, 0xf6, 0xac, 0x60, 0x02 };
+  UCHAR table1600_650[] = { 0x60, 0x04, 0x11, 0x00, 0x40, 0xe3,
+  			    0xad, 0xde, 0xf6, 0xac, 0x60, 0x1a };
   UCHAR *tableptr = NULL;
   USHORT tempbh;
   int i;
 
-  if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) {
-     tableptr = table1024;
-  } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) {
-     tableptr = table1280;
-  } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) {
-     tableptr = table1400;
-  } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200) {
-     tableptr = table1600;
-  } else return;
+  if(HwInfo->jChipType == SIS_740) {
+     if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) {
+        tableptr = table1024_740;
+     } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) {
+        tableptr = table1280_740;
+     } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) {
+        tableptr = table1400_740;
+     } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200) {
+        tableptr = table1600_740;
+     } else return;
+  } else {
+     if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) {
+        tableptr = table1024_650;
+     } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) {
+        tableptr = table1280_650;
+     } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) {
+        tableptr = table1400_650;
+     } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200) {
+        tableptr = table1600_650;
+     } else return;
+  }
 
   tempbh = SiS_GetCH701x(SiS_Pr,0x74);
   if((tempbh == 0xf6) || (tempbh == 0xc7)) {
@@ -9169,595 +9169,780 @@
         if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) return;
 	if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) return;
      } else if(tempbh == 0xde) {
-        if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) return;
+        if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200) return;
      }
   }
-#ifdef NEWCH701x     /* New from 740/LVDS: */    
-  for(i=0; i<0x0d; i++) {	
-#else
-  for(i=0; i<0x0c; i++) {
-#endif  
+
+  if(HwInfo->jChipType == SIS_740) {
+     tempbh = 0x0d;
+  } else {
+     tempbh = 0x0c;
+  }
+  for(i = 0; i < tempbh; i++) {
      SiS_SetCH701x(SiS_Pr,(tableptr[i] << 8) | regtable[i]);
   }
-  SiS_ChrontelPowerSequencing(SiS_Pr);
+  SiS_ChrontelPowerSequencing(SiS_Pr,HwInfo);
   tempbh = SiS_GetCH701x(SiS_Pr,0x1e);
   tempbh |= 0xc0;
   SiS_SetCH701x(SiS_Pr,(tempbh << 8) | 0x1e);
-  
-#ifdef NEWCH701x     /* 740/LVDS: */
-  tempbh = SiS_GetCH701x(SiS_Pr,0x1c);
-  tempbh &= 0xfb;
-  SiS_SetCH701x(SiS_Pr,(tempbh << 8) | 0x1c);
-  SiS_SetReg1(SiS_Pr->SiS_Part1Port, 0x2d, 0x03);
-  tempbh = SiS_GetCH701x(SiS_Pr,0x64);
-  tempbh |= 0x40;
-  SiS_SetCH701x(SiS_Pr,(tempbh << 8) | 0x64);
-  tempbh = SiS_GetCH701x(SiS_Pr,0x03);
-  tempbh &= 0x3f;
-  SiS_SetCH701x(SiS_Pr,(tempbh << 8) | 0x03);
-#endif  /* End 740/LVDS */
+
+  if(HwInfo->jChipType == SIS_740) {
+     tempbh = SiS_GetCH701x(SiS_Pr,0x1c);
+     tempbh &= 0xfb;
+     SiS_SetCH701x(SiS_Pr,(tempbh << 8) | 0x1c);
+     SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2d,0x03);
+     tempbh = SiS_GetCH701x(SiS_Pr,0x64);
+     tempbh |= 0x40;
+     SiS_SetCH701x(SiS_Pr,(tempbh << 8) | 0x64);
+     tempbh = SiS_GetCH701x(SiS_Pr,0x03);
+     tempbh &= 0x3f;
+     SiS_SetCH701x(SiS_Pr,(tempbh << 8) | 0x03);
+  }
 }
 
-void
-SiS_ChrontelPowerSequencing(SiS_Private *SiS_Pr)
+static void
+SiS_ChrontelResetVSync(SiS_Private *SiS_Pr)
 {
-  UCHAR regtable[]  = { 0x67, 0x68, 0x69, 0x6a, 0x6b };
-#ifdef NEWCH701x  
-  UCHAR table1024[] = { 0x01, 0x02, 0x01, 0x01, 0x01 };
-  UCHAR table1400[] = { 0x01, 0x6e, 0x01, 0x01, 0x01 };
-#else
-  UCHAR table1024[] = { 0x01, 0x02, 0x01, 0x01, 0x02 };
-  UCHAR table1400[] = { 0x01, 0x02, 0x01, 0x01, 0x02 };
-#endif  
-  UCHAR *tableptr = NULL;
-  int i;
+  unsigned char temp, temp1;
 
-  /* Set up Power up/down timing */
-  if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) {
-     tableptr = table1024;
-  } else if((SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) ||
-            (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) ||
-	    (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200)) {
-     tableptr = table1400;
-  } else return;
-  
-  for(i=0; i<5; i++) {
-     SiS_SetCH701x(SiS_Pr,(tableptr[i] << 8) | regtable[i]);
-  }
+  temp1 = SiS_GetCH701x(SiS_Pr,0x49);
+  SiS_SetCH701x(SiS_Pr,0x3e49);
+  temp = SiS_GetCH701x(SiS_Pr,0x47);
+  temp &= 0x7f;	/* Use external VSYNC */
+  SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x47);
+  SiS_LongDelay(SiS_Pr,3);
+  temp = SiS_GetCH701x(SiS_Pr,0x47);
+  temp |= 0x80;	/* Use internal VSYNC */
+  SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x47);
+  SiS_SetCH701x(SiS_Pr,(temp1 << 8) | 0x49);
 }
 
 void
-SiS_Chrontel701xOn(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT BaseAddr)
+SiS_Chrontel701xOn(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
 {
   USHORT temp;
 
   if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) {
-#ifdef NEWCH701x
-     temp = SiS_GetCH701x(SiS_Pr,0x1c);
-     temp |= 0x04;
-     SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x1c);
-#endif 
-     if(SiS_IsYPbPr(SiS_Pr,HwDeviceExtension, BaseAddr)) {
+     if(HwInfo->jChipType == SIS_740) {
+        temp = SiS_GetCH701x(SiS_Pr,0x1c);
+        temp |= 0x04;	/* Invert XCLK phase */
+        SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x1c);
+     }
+     if(SiS_IsYPbPr(SiS_Pr, HwInfo)) {
         temp = SiS_GetCH701x(SiS_Pr,0x01);
 	temp &= 0x3f;
-	temp |= 0x80;	/* TW: Enable YPrPb (HDTV) */
+	temp |= 0x80;	/* Enable YPrPb (HDTV) */
 	SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x01);
      }
-     if(SiS_IsChScart(SiS_Pr,HwDeviceExtension, BaseAddr)) {
+     if(SiS_IsChScart(SiS_Pr, HwInfo)) {
         temp = SiS_GetCH701x(SiS_Pr,0x01);
 	temp &= 0x3f;
-	temp |= 0xc0;	/* TW: Enable SCART + CVBS */
+	temp |= 0xc0;	/* Enable SCART + CVBS */
 	SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x01);
      }
-#ifdef NEWCH701x
-     SiS_ChrontelDoSomething5(SiS_Pr);
-     SiS_SetCH701x(SiS_Pr,0x2049);   			/* TW: Enable TV path */
-#else      
-     SiS_SetCH701x(SiS_Pr,0x2049);   			/* TW: Enable TV path */
-     temp = SiS_GetCH701x(SiS_Pr,0x49);
-     if(SiS_IsYPbPr(SiS_Pr,HwDeviceExtension, BaseAddr)) {
-        temp = SiS_GetCH701x(SiS_Pr,0x73);
-	temp |= 0x60;
-	SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x73);
-     }
-     temp = SiS_GetCH701x(SiS_Pr,0x47);
-     temp &= 0x7f;
-     SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x47);
-     SiS_LongDelay(SiS_Pr,2);
-     temp = SiS_GetCH701x(SiS_Pr,0x47);
-     temp |= 0x80;
-     SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x47);
-#endif     
+     if(HwInfo->jChipType == SIS_740) {
+        SiS_ChrontelResetVSync(SiS_Pr);
+        SiS_SetCH701x(SiS_Pr,0x2049);   /* Enable TV path */
+     } else {
+        SiS_SetCH701x(SiS_Pr,0x2049);   /* Enable TV path */
+        temp = SiS_GetCH701x(SiS_Pr,0x49);
+        if(SiS_IsYPbPr(SiS_Pr,HwInfo)) {
+           temp = SiS_GetCH701x(SiS_Pr,0x73);
+	   temp |= 0x60;
+	   SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x73);
+        }
+        temp = SiS_GetCH701x(SiS_Pr,0x47);
+        temp &= 0x7f;
+        SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x47);
+        SiS_LongDelay(SiS_Pr,2);
+        temp = SiS_GetCH701x(SiS_Pr,0x47);
+        temp |= 0x80;
+        SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x47);
+     }
   }
 }
 
 void
-SiS_Chrontel701xOff(SiS_Private *SiS_Pr)
+SiS_Chrontel701xOff(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
 {
   USHORT temp;
 
+  /* Complete power down of LVDS */
   if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) {
+     if(HwInfo->jChipType == SIS_740) {
+        SiS_LongDelay(SiS_Pr,1);
+	SiS_GenericDelay(SiS_Pr,0x16ff);
+	SiS_SetCH701x(SiS_Pr,0xac76);
+	SiS_SetCH701x(SiS_Pr,0x0066);
+     } else {
         SiS_LongDelay(SiS_Pr,2);
-	/* TW: Complete power down of LVDS */
 	temp = SiS_GetCH701x(SiS_Pr,0x76);
 	temp &= 0xfc;
 	SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x76);
 	SiS_SetCH701x(SiS_Pr,0x0066);
+     }
   }
 }
 
-#ifdef NEWCH701x
-void
-SiS_ChrontelDoSomething5(SiS_Private *SiS_Pr)
+static void
+SiS_ChrontelResetDB(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
 {
-     unsigned char temp, temp1;
-     
-     temp1 = SiS_GetCH701x(SiS_Pr,0x49);
-     SiS_SetCH701x(SiS_Pr,0x3e49);
-     temp = SiS_GetCH701x(SiS_Pr,0x47);
-     temp &= 0x7f;
-     SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x47);
-     SiS_LongDelay(SiS_Pr,3);
-     temp = SiS_GetCH701x(SiS_Pr,0x47);
-     temp |= 0x80;
-     SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x47);
-     SiS_SetCH701x(SiS_Pr,(temp1 << 8) | 0x49);
+     USHORT temp;
+
+     if(HwInfo->jChipType == SIS_740) {
+
+        temp = SiS_GetCH701x(SiS_Pr,0x4a);  /* Version ID */
+        temp &= 0x01;
+        if(!temp) {
+
+           if(SiS_WeHaveBacklightCtrl(SiS_Pr,HwInfo)) {
+	      temp = SiS_GetCH701x(SiS_Pr,0x49);
+	      SiS_SetCH701x(SiS_Pr,0x3e49);
+	   }
+	   /* Reset Chrontel 7019 datapath */
+           SiS_SetCH701x(SiS_Pr,0x1048);
+           SiS_LongDelay(SiS_Pr,1);
+           SiS_SetCH701x(SiS_Pr,0x1848);
+
+	   if(SiS_WeHaveBacklightCtrl(SiS_Pr, HwInfo)) {
+	      SiS_ChrontelResetVSync(SiS_Pr);
+	      SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x49);
+	   }
+
+        } else {
+
+	   /* Clear/set/clear GPIO */
+           temp = SiS_GetCH701x(SiS_Pr,0x5c);
+	   temp &= 0xef;
+	   SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x5c);
+	   temp = SiS_GetCH701x(SiS_Pr,0x5c);
+	   temp |= 0x10;
+	   SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x5c);
+	   temp = SiS_GetCH701x(SiS_Pr,0x5c);
+	   temp &= 0xef;
+	   SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x5c);
+	   temp = SiS_GetCH701x(SiS_Pr,0x61);
+	   if(!temp) {
+	      SiS_SetCH701xForLCD(SiS_Pr, HwInfo);
+	   }
+        }
+
+     } else { /* 650 */
+        /* Reset Chrontel 7019 datapath */
+        SiS_SetCH701x(SiS_Pr,0x1048);
+        SiS_LongDelay(SiS_Pr,1);
+        SiS_SetCH701x(SiS_Pr,0x1848);
+     }
 }
-#endif
 
 void
-SiS_ChrontelResetDB(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr)
+SiS_ChrontelInitTVVSync(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
 {
-#ifdef NEWCH701x
      USHORT temp;
-     
-     /* 740/LVDS: */
-     temp = SiS_GetCH701x(SiS_Pr,0x4a);
-     temp &= 0x01;
-     if(!(temp)) {
-     
-        if(SiS_WeHaveBacklightCtrl(SiS_Pr,HwDeviceExtension, BaseAddr)) {
-	   temp = SiS_GetCH701x(SiS_Pr,0x49);
-	   SiS_SetCH701x(SiS_Pr,0x3e49);
-	}
-	/* TW: Reset Chrontel 7019 datapath */
-        SiS_SetCH701x(SiS_Pr,0x1048);
-        SiS_LongDelay(SiS_Pr,1);
-        SiS_SetCH701x(SiS_Pr,0x1848);
-	
-	if(SiS_WeHaveBacklightCtrl(SiS_Pr,HwDeviceExtension, BaseAddr)) {
-	   SiS_ChrontelDoSomething5(SiS_Pr);
-	   SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x49);
-	}    
+
+     if(HwInfo->jChipType == SIS_740) {
+
+        if(SiS_WeHaveBacklightCtrl(SiS_Pr,HwInfo)) {
+           SiS_ChrontelResetVSync(SiS_Pr);
+        }
+
      } else {
-     
-        temp = SiS_GetCH701x(SiS_Pr,0x5c);
-	temp &= 0xef;
-	SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x5c);
-	temp = SiS_GetCH701x(SiS_Pr,0x5c);
-	temp |= 0x10;
-	SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x5c);
-	temp = SiS_GetCH701x(SiS_Pr,0x5c);
-	temp &= 0xef;
-	SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x5c);
-	temp = SiS_GetCH701x(SiS_Pr,0x61);
-	if(!temp) {
-	   SiS_SetCH701xForLCD(SiS_Pr,HwDeviceExtension,BaseAddr);
-	}
-     }
-#else /* pre 740/LVDS code */     
-     /* TW: Reset Chrontel 7019 datapath */
-     SiS_SetCH701x(SiS_Pr,0x1048);
-     SiS_LongDelay(SiS_Pr,1);
-     SiS_SetCH701x(SiS_Pr,0x1848);
-#endif     
+
+        SiS_SetCH701x(SiS_Pr,0xaf76);  /* Power up LVDS block */
+        temp = SiS_GetCH701x(SiS_Pr,0x49);
+        temp &= 1;
+        if(temp != 1) {  /* TV block powered? (0 = yes, 1 = no) */
+	   temp = SiS_GetCH701x(SiS_Pr,0x47);
+	   temp &= 0x70;
+	   SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x47);  /* enable VSYNC */
+	   SiS_LongDelay(SiS_Pr,3);
+	   temp = SiS_GetCH701x(SiS_Pr,0x47);
+	   temp |= 0x80;
+	   SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x47);  /* disable VSYNC */
+        }
+
+     }
 }
 
-void
-SiS_ChrontelDoSomething4(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr)
+static void
+SiS_ChrontelDoSomething3(SiS_Private *SiS_Pr, USHORT ModeNo, PSIS_HW_INFO HwInfo)
 {
-#ifdef NEWCH701x
-     if(!(SiS_WeHaveBacklightCtrl(SiS_Pr,HwDeviceExtension, BaseAddr))) {
-        SiS_ChrontelDoSomething5(SiS_Pr);
+     USHORT temp,temp1;
+
+     if(HwInfo->jChipType == SIS_740) {
+
+        temp = SiS_GetCH701x(SiS_Pr,0x61);
+        if(temp < 1) {
+           temp++;
+	   SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x61);
+        }
+        SiS_SetCH701x(SiS_Pr,0x4566);  /* Panel power on */
+        SiS_SetCH701x(SiS_Pr,0xaf76);  /* All power on */
+        SiS_LongDelay(SiS_Pr,1);
+        SiS_GenericDelay(SiS_Pr,0x16ff);
+
+     } else {  /* 650 */
+
+        temp1 = 0;
+        temp = SiS_GetCH701x(SiS_Pr,0x61);
+        if(temp < 2) {
+           temp++;
+	   SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x61);
+	   temp1 = 1;
+        }
+        SiS_SetCH701x(SiS_Pr,0xac76);
+        temp = SiS_GetCH701x(SiS_Pr,0x66);
+        temp |= 0x5f;
+        SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x66);
+        if(ModeNo > 0x13) {
+           if(SiS_WeHaveBacklightCtrl(SiS_Pr, HwInfo)) {
+	      SiS_GenericDelay(SiS_Pr,0x3ff);
+	   } else {
+	      SiS_GenericDelay(SiS_Pr,0x2ff);
+	   }
+        } else {
+           if(!temp1)
+	      SiS_GenericDelay(SiS_Pr,0x2ff);
+        }
+        temp = SiS_GetCH701x(SiS_Pr,0x76);
+        temp |= 0x03;
+        SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x76);
+        temp = SiS_GetCH701x(SiS_Pr,0x66);
+        temp &= 0x7f;
+        SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x66);
+        SiS_LongDelay(SiS_Pr,1);
+
      }
-#else
+}
+
+static void
+SiS_ChrontelDoSomething2(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
+{
+     USHORT temp,tempcl,tempch;
+
+     SiS_LongDelay(SiS_Pr, 1);
+     tempcl = 3;
+     tempch = 0;
+
+     do {
+       temp = SiS_GetCH701x(SiS_Pr,0x66);
+       temp &= 0x04;  /* PLL stable? -> bail out */
+       if(temp == 0x04) break;
+
+       if(HwInfo->jChipType == SIS_740) {
+          /* Power down LVDS output, PLL normal operation */
+          SiS_SetCH701x(SiS_Pr,0xac76);
+       }
+
+       SiS_SetCH701xForLCD(SiS_Pr,HwInfo);
+
+       if(tempcl == 0) {
+           if(tempch == 3) break;
+	   SiS_ChrontelResetDB(SiS_Pr,HwInfo);
+	   tempcl = 3;
+	   tempch++;
+       }
+       tempcl--;
+       temp = SiS_GetCH701x(SiS_Pr,0x76);
+       temp &= 0xfb;  /* Reset PLL */
+       SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x76);
+       SiS_LongDelay(SiS_Pr,2);
+       temp = SiS_GetCH701x(SiS_Pr,0x76);
+       temp |= 0x04;  /* PLL normal operation */
+       SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x76);
+       if(HwInfo->jChipType == SIS_740) {
+          SiS_SetCH701x(SiS_Pr,0xe078);	/* PLL loop filter */
+       } else {
+          SiS_SetCH701x(SiS_Pr,0x6078);
+       }
+       SiS_LongDelay(SiS_Pr,2);
+    } while(0);
+
+    SiS_SetCH701x(SiS_Pr,0x0077);  /* MV? */
+}
+
+void
+SiS_ChrontelDoSomething1(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
+{
      USHORT temp;
 
-     SiS_SetCH701x(SiS_Pr,0xaf76);  /* Power up LVDS block */
-     temp = SiS_GetCH701x(SiS_Pr,0x49);
-     temp &= 1;
-     if(temp != 1) {  /* TV block powered? (0 = yes, 1 = no) */
-	temp = SiS_GetCH701x(SiS_Pr,0x47);
-	temp &= 0x70;
-	SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x47);  /* enable VSYNC */
-	SiS_LongDelay(SiS_Pr,3);
-	temp = SiS_GetCH701x(SiS_Pr,0x47);
-	temp |= 0x80;
-	SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x47);  /* disable VSYNC */
-     }
-#endif     
-}
+     temp = SiS_GetCH701x(SiS_Pr,0x03);
+     temp |= 0x80;	/* Set datapath 1 to TV   */
+     temp &= 0xbf;	/* Set datapath 2 to LVDS */
+     SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x03);
+
+     if(HwInfo->jChipType == SIS_740) {
+
+        temp = SiS_GetCH701x(SiS_Pr,0x1c);
+        temp &= 0xfb;	/* Normal XCLK phase */
+        SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x1c);
+
+        SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2d,0x03);
+
+        temp = SiS_GetCH701x(SiS_Pr,0x64);
+        temp |= 0x40;	/* ? Bit not defined */
+        SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x64);
+
+        temp = SiS_GetCH701x(SiS_Pr,0x03);
+        temp &= 0x3f;	/* D1 input to both LVDS and TV */
+        SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x03);
+
+	if(SiS_Pr->SiS_CustomT == CUT_ASUSL3000D) {
+	   SiS_SetCH701x(SiS_Pr,0x4063); /* LVDS off */
+	   SiS_LongDelay(SiS_Pr, 1);
+	   SiS_SetCH701x(SiS_Pr,0x0063); /* LVDS on */
+	   SiS_ChrontelResetDB(SiS_Pr, HwInfo);
+	   SiS_ChrontelDoSomething2(SiS_Pr, HwInfo);
+	   SiS_ChrontelDoSomething3(SiS_Pr, 0, HwInfo);
+	} else {
+           temp = SiS_GetCH701x(SiS_Pr,0x66);
+           if(temp != 0x45) {
+              SiS_ChrontelResetDB(SiS_Pr, HwInfo);
+              SiS_ChrontelDoSomething2(SiS_Pr, HwInfo);
+              SiS_ChrontelDoSomething3(SiS_Pr, 0, HwInfo);
+           }
+	}
+
+     } else { /* 650 */
+
+        SiS_ChrontelResetDB(SiS_Pr,HwInfo);
+        SiS_ChrontelDoSomething2(SiS_Pr,HwInfo);
+        temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x34);
+        SiS_ChrontelDoSomething3(SiS_Pr,temp,HwInfo);
+        SiS_SetCH701x(SiS_Pr,0xaf76);  /* All power on, LVDS normal operation */
+
+     }
+
+}
+#endif  /* 315 series  */
+
+/*********************************************/
+/*      MAIN: SET CRT2 REGISTER GROUP        */
+/*********************************************/
+
+BOOLEAN
+SiS_SetCRT2Group(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, USHORT ModeNo)
+{
+#ifdef SIS300
+   UCHAR  *ROMAddr  = HwInfo->pjVirtualRomBase;
+#endif
+   USHORT ModeIdIndex, RefreshRateTableIndex;
+#if 0
+   USHORT temp;
+#endif
+
+   SiS_Pr->SiS_SetFlag |= ProgrammingCRT2;
+
+   if(!SiS_Pr->UseCustomMode) {
+      SiS_SearchModeID(SiS_Pr, &ModeNo, &ModeIdIndex);
+   } else {
+      ModeIdIndex = 0;
+   }
+
+   /* Used for shifting CR33 */
+   SiS_Pr->SiS_SelectCRT2Rate = 4;
+
+   SiS_UnLockCRT2(SiS_Pr, HwInfo);
+
+   RefreshRateTableIndex = SiS_GetRatePtr(SiS_Pr, ModeNo, ModeIdIndex, HwInfo);
+
+   SiS_SaveCRT2Info(SiS_Pr,ModeNo);
+
+   if(SiS_Pr->SiS_SetFlag & LowModeTests) {
+      SiS_DisableBridge(SiS_Pr,HwInfo);
+      if((SiS_Pr->SiS_IF_DEF_LVDS == 1) && (HwInfo->jChipType == SIS_730)) {
+         SiS_SetReg(SiS_Pr->SiS_Part1Port,0x00,0x80);
+      }
+      SiS_SetCRT2ModeRegs(SiS_Pr, ModeNo, ModeIdIndex, HwInfo);
+   }
+
+   if(SiS_Pr->SiS_VBInfo & DisableCRT2Display) {
+      SiS_LockCRT2(SiS_Pr, HwInfo);
+      SiS_DisplayOn(SiS_Pr);
+      return TRUE;
+   }
+
+   SiS_GetCRT2Data(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, HwInfo);
+
+   /* Set up Panel Link for LVDS, 301BDH and 30xLV(for LCDA) */
+   if( (SiS_Pr->SiS_IF_DEF_LVDS == 1) ||
+       ((SiS_Pr->SiS_VBType & VB_NoLCD) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD)) ||
+       ((HwInfo->jChipType >= SIS_315H) && (SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV)) ) {
+      SiS_GetLVDSDesData(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, HwInfo);
+   } else {
+      SiS_Pr->SiS_LCDHDES = SiS_Pr->SiS_LCDVDES = 0;
+   }
+
+#ifdef LINUX_XF86
+#ifdef TWDEBUG
+  xf86DrvMsg(0, X_INFO, "(init301: LCDHDES 0x%03x LCDVDES 0x%03x)\n", SiS_Pr->SiS_LCDHDES, SiS_Pr->SiS_LCDVDES);
+  xf86DrvMsg(0, X_INFO, "(init301: HDE     0x%03x VDE     0x%03x)\n", SiS_Pr->SiS_HDE, SiS_Pr->SiS_VDE);
+  xf86DrvMsg(0, X_INFO, "(init301: VGAHDE  0x%03x VGAVDE  0x%03x)\n", SiS_Pr->SiS_VGAHDE, SiS_Pr->SiS_VGAVDE);
+  xf86DrvMsg(0, X_INFO, "(init301: HT      0x%03x VT      0x%03x)\n", SiS_Pr->SiS_HT, SiS_Pr->SiS_VT);
+  xf86DrvMsg(0, X_INFO, "(init301: VGAHT   0x%03x VGAVT   0x%03x)\n", SiS_Pr->SiS_VGAHT, SiS_Pr->SiS_VGAVT);
+#endif
+#endif
+
+   if(SiS_Pr->SiS_SetFlag & LowModeTests) {
+      SiS_SetGroup1(SiS_Pr, ModeNo, ModeIdIndex, HwInfo, RefreshRateTableIndex);
+   }
+
+   if(SiS_Pr->SiS_VBType & VB_SISVB) {
+
+        if(SiS_Pr->SiS_SetFlag & LowModeTests) {
 
-void
-SiS_ChrontelDoSomething3(SiS_Private *SiS_Pr, USHORT ModeNo, PSIS_HW_DEVICE_INFO HwDeviceExtension,
-                         USHORT BaseAddr)
-{
-#ifdef NEWCH701x
-     USHORT temp;
-     
-     temp = SiS_GetCH701x(SiS_Pr,0x61);
-     if(temp < 1) {
-          temp++;
-	  SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x61);
-     }
-     SiS_SetCH701x(SiS_Pr,0x4566);
-     SiS_SetCH701x(SiS_Pr,0xaf76);
-     SiS_LongDelay(SiS_Pr,1);
-     SiS_GenericDelay(SiS_Pr,0x16ff);
+	   SiS_SetGroup2(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, HwInfo);
+#ifdef SIS315H
+	   SiS_SetGroup2_C_ELV(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, HwInfo);
+#endif
+      	   SiS_SetGroup3(SiS_Pr, ModeNo, ModeIdIndex, HwInfo);
+      	   SiS_SetGroup4(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, HwInfo);
+#ifdef SIS315H
+	   SiS_SetGroup4_C_ELV(SiS_Pr, HwInfo);
+#endif
+      	   SiS_SetGroup5(SiS_Pr, ModeNo, ModeIdIndex, HwInfo);
 
-#else
-     USHORT temp,temp1;
-     
-     temp1 = 0;
-     temp = SiS_GetCH701x(SiS_Pr,0x61);
-     if(temp < 2) {
-          temp++;
-	  SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x61);
-	  temp1 = 1;
-     }
-     SiS_SetCH701x(SiS_Pr,0xac76);
-     temp = SiS_GetCH701x(SiS_Pr,0x66);
-     temp |= 0x5f;
-     SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x66);
-     if(ModeNo > 0x13) {
-         if(SiS_WeHaveBacklightCtrl(SiS_Pr,HwDeviceExtension, BaseAddr)) {
-	    SiS_GenericDelay(SiS_Pr,0x3ff);
-	 } else {
-	    SiS_GenericDelay(SiS_Pr,0x2ff);
-	 }
-     } else {
-         if(!temp1)
-	    SiS_GenericDelay(SiS_Pr,0x2ff);
-     }
-     temp = SiS_GetCH701x(SiS_Pr,0x76);
-     temp |= 0x03;
-     SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x76);
-     temp = SiS_GetCH701x(SiS_Pr,0x66);
-     temp &= 0x7f;
-     SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x66);
-     SiS_LongDelay(SiS_Pr,1);
-#endif     
-}
+	   /* For 301BDH (Panel link initialization): */
+	   if((SiS_Pr->SiS_VBType & VB_NoLCD) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD)) {
+	      if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel640x480) {
+		 if(!((SiS_Pr->SiS_SetFlag & SetDOSMode) && ((ModeNo == 0x03) || (ModeNo == 0x10)))) {
+		    if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) {
+		       SiS_ModCRT1CRTC(SiS_Pr,ModeNo,ModeIdIndex,
+		                       RefreshRateTableIndex,HwInfo);
+		    }
+                 }
+	      }
+	      SiS_SetCRT2ECLK(SiS_Pr,ModeNo,ModeIdIndex,
+		              RefreshRateTableIndex,HwInfo);
+	   }
+        }
 
-void
-SiS_ChrontelDoSomething2(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr)
-{
-     USHORT temp,tempcl,tempch;
+   } else {
 
-     SiS_LongDelay(SiS_Pr, 1);
-     tempcl = 3;
-     tempch = 0;
+        if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel640x480) {
+	   if(SiS_Pr->SiS_IF_DEF_TRUMPION == 0) {
+    	      SiS_ModCRT1CRTC(SiS_Pr,ModeNo,ModeIdIndex,
+	                      RefreshRateTableIndex,HwInfo);
+	   }
+	}
 
-     do {
-       temp = SiS_GetCH701x(SiS_Pr,0x66);
-       temp &= 0x04;
-       if(temp == 0x04) break;
-       
-#ifdef NEWCH701x
-       SiS_SetCH701x(SiS_Pr,0xac76);    /* 740/LVDS */
-#endif       
+        SiS_SetCRT2ECLK(SiS_Pr,ModeNo,ModeIdIndex,
+	                RefreshRateTableIndex,HwInfo);
 
-       SiS_SetCH701xForLCD(SiS_Pr,HwDeviceExtension,BaseAddr);
+	if(SiS_Pr->SiS_SetFlag & LowModeTests) {
+     	   if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) {
+	      if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) {
+	         if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) {
+#ifdef SIS315H
+		    SiS_SetCH701xForLCD(SiS_Pr,HwInfo);
+#endif
+		 }
+	      }
+	      if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
+       		 SiS_SetCHTVReg(SiS_Pr,ModeNo,ModeIdIndex,
+		               RefreshRateTableIndex);
+	      }
+     	   }
+	}
 
-       if(tempcl == 0) {
-           if(tempch == 3) break;
-	   SiS_ChrontelResetDB(SiS_Pr,HwDeviceExtension,BaseAddr);
-	   tempcl = 3;
-	   tempch++;
-       }
-       tempcl--;
-       temp = SiS_GetCH701x(SiS_Pr,0x76);
-       temp &= 0xfb;
-       SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x76);
-       SiS_LongDelay(SiS_Pr,2);
-       temp = SiS_GetCH701x(SiS_Pr,0x76);
-       temp |= 0x04;
-       SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x76);
-#ifdef NEWCH701x
-       SiS_SetCH701x(SiS_Pr,0xe078);
-#else       
-       SiS_SetCH701x(SiS_Pr,0x6078);
-#endif       
-       SiS_LongDelay(SiS_Pr,2);
-    } while(0);
+   }
 
-    SiS_SetCH701x(SiS_Pr,0x0077);
-}
+#ifdef SIS300
+   if(HwInfo->jChipType < SIS_315H) {
+      if(SiS_Pr->SiS_SetFlag & LowModeTests) {
+	 if(SiS_Pr->SiS_UseOEM) {
+	    if((SiS_Pr->SiS_UseROM) && ROMAddr && (SiS_Pr->SiS_UseOEM == -1)) {
+	       if((ROMAddr[0x233] == 0x12) && (ROMAddr[0x234] == 0x34)) {
+	          SiS_OEM300Setting(SiS_Pr,HwInfo,ModeNo,ModeIdIndex,
+	       			    RefreshRateTableIndex);
+	       }
+	    } else {
+       	       SiS_OEM300Setting(SiS_Pr,HwInfo,ModeNo,ModeIdIndex,
+	       			 RefreshRateTableIndex);
+	    }
+	 }
+	 if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
+            if((SiS_Pr->SiS_CustomT == CUT_BARCO1366) ||
+	       (SiS_Pr->SiS_CustomT == CUT_BARCO1024)) {
+	       SetOEMLCDData2(SiS_Pr, HwInfo, ModeNo, ModeIdIndex,RefreshRateTableIndex);
+	    }
+            if(HwInfo->jChipType == SIS_730) {
+               SiS_DisplayOn(SiS_Pr);
+	    }
+         }
+      }
+      if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
+          if(HwInfo->jChipType != SIS_730) {
+             SiS_DisplayOn(SiS_Pr);
+	  }
+      }
+   }
+#endif
 
-void
-SiS_ChrontelDoSomething1(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,
-                         USHORT BaseAddr)
-{
-     USHORT temp;
+#ifdef SIS315H
+   if(HwInfo->jChipType >= SIS_315H) {
+      if(SiS_Pr->SiS_SetFlag & LowModeTests) {
+	 if(HwInfo->jChipType < SIS_661) {
+	    SiS_FinalizeLCD(SiS_Pr, ModeNo, ModeIdIndex, HwInfo);
+            if(SiS_Pr->SiS_UseOEM) {
+               SiS_OEM310Setting(SiS_Pr, HwInfo, ModeNo, ModeIdIndex);
+            }
+	 } else {
+	    SiS_OEM661Setting(SiS_Pr, HwInfo, ModeNo, ModeIdIndex, RefreshRateTableIndex);
+	 }
+         SiS_CRT2AutoThreshold(SiS_Pr);
+      }
+   }
+#endif
 
-     temp = SiS_GetCH701x(SiS_Pr,0x03);
-     temp |= 0x80;	/* Set datapath 1 to TV   */
-     temp &= 0xbf;	/* Set datapath 2 to LVDS */
-     SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x03);
-     
-#ifdef NEWCH701x   /* 740/LVDS: */
+   if(SiS_Pr->SiS_SetFlag & LowModeTests) {
+      SiS_EnableBridge(SiS_Pr, HwInfo);
+   }
 
-     temp = SiS_GetCH701x(SiS_Pr,0x1c);
-     temp &= 0xfb;
-     SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x1c);
-     
-     SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x2d,0x03);
-     
-     temp = SiS_GetCH701x(SiS_Pr,0x64);
-     temp |= 0x40;
-     SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x64);
-     
-     temp = SiS_GetCH701x(SiS_Pr,0x03);
-     temp &= 0x3f;	
-     SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x03);
-     
-     temp = SiS_GetCH701x(SiS_Pr,0x66);
-     if(temp != 0x45) {
-        SiS_ChrontelResetDB(SiS_Pr,HwDeviceExtension,BaseAddr);
-        SiS_ChrontelDoSomething2(SiS_Pr,HwDeviceExtension,BaseAddr);
-	temp = SiS_GetReg1(SiS_Pr->SiS_P3d4,0x34);
-        SiS_ChrontelDoSomething3(SiS_Pr,temp,HwDeviceExtension,BaseAddr);
-     }     
+   SiS_DisplayOn(SiS_Pr);
+
+   if(SiS_Pr->SiS_IF_DEF_CH70xx == 1) {
+      if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
+	 /* Disable LCD panel when using TV */
+	 SiS_SetRegSR11ANDOR(SiS_Pr,HwInfo,0xFF,0x0C);
+      } else {
+	 /* Disable TV when using LCD */
+	 SiS_SetCH70xxANDOR(SiS_Pr,0x010E,0xF8);
+      }
+   }
 
-#else  /* pre-740/LVDS: */     
+   if(SiS_Pr->SiS_SetFlag & LowModeTests) {
+      SiS_LockCRT2(SiS_Pr,HwInfo);
+   }
 
-     SiS_ChrontelResetDB(SiS_Pr);
+   return TRUE;
+}
 
-     SiS_ChrontelDoSomething2(SiS_Pr,HwDeviceExtension,BaseAddr);
 
-     temp = SiS_GetReg1(SiS_Pr->SiS_P3d4,0x34);
-     SiS_ChrontelDoSomething3(SiS_Pr,temp,HwDeviceExtension,BaseAddr);
+/*********************************************/
+/*     ENABLE/DISABLE LCD BACKLIGHT (SIS)    */
+/*********************************************/
 
-     SiS_SetCH701x(SiS_Pr,0xaf76);
-     
-#endif  /* End of pre-740/LVDS */
+void
+SiS_SiS30xBLOn(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
+{
+  /* Switch on LCD backlight on SiS30xLV */
+  SiS_DDC2Delay(SiS_Pr,0xff00);
+  if(!(SiS_GetReg(SiS_Pr->SiS_Part4Port,0x26) & 0x02)) {
+     SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x26,0x02);
+     SiS_WaitVBRetrace(SiS_Pr,HwInfo);
+  }
+  if(!(SiS_GetReg(SiS_Pr->SiS_Part4Port,0x26) & 0x01)) {
+     SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x26,0x01);
+  }
 }
 
-#endif  /* 310/325 series --------------------------------- */
+void
+SiS_SiS30xBLOff(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
+{
+  /* Switch off LCD backlight on SiS30xLV */
+  SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x26,0xFE);
+  SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x26,0xFD);
+  SiS_DDC2Delay(SiS_Pr,0xe000);
+}
 
-/* TW: End of Chrontel 701x functions ==================================== */
+/*********************************************/
+/*          DDC RELATED FUNCTIONS            */
+/*********************************************/
 
-/* TW: Generic Read/write routines for Chrontel ========================== */
+static void
+SiS_SetupDDCN(SiS_Private *SiS_Pr)
+{
+  SiS_Pr->SiS_DDC_NData = ~SiS_Pr->SiS_DDC_Data;
+  SiS_Pr->SiS_DDC_NClk  = ~SiS_Pr->SiS_DDC_Clk;
+  if((SiS_Pr->SiS_DDC_Index == 0x11) && (SiS_Pr->SiS_SensibleSR11)) {
+     SiS_Pr->SiS_DDC_NData &= 0x0f;
+     SiS_Pr->SiS_DDC_NClk  &= 0x0f;
+  }
+}
 
-/* TW: The Chrontel is connected to the 630/730 via
+/* The Chrontel 700x is connected to the 630/730 via
  * the 630/730's DDC/I2C port.
  *
- * On 630(S)T chipset, the index changed from 0x11 to 0x0a,
- * possibly for working around the DDC problems
+ * On 630(S)T chipset, the index changed from 0x11 to
+ * 0x0a, possibly for working around the DDC problems
  */
 
-void
-SiS_SetCH70xx(SiS_Private *SiS_Pr, USHORT tempbx)
+static BOOLEAN
+SiS_SetChReg(SiS_Private *SiS_Pr, USHORT tempbx, USHORT myor)
 {
-   if (SiS_Pr->SiS_IF_DEF_CH70xx == 1)
-      SiS_SetCH700x(SiS_Pr,tempbx);
-   else
-      SiS_SetCH701x(SiS_Pr,tempbx);
+  USHORT tempah,temp,i;
+
+  for(i=0; i<20; i++) {				/* Do 20 attempts to write */
+     if(i) {
+        SiS_SetStop(SiS_Pr);
+	SiS_DDC2Delay(SiS_Pr,SiS_I2CDELAYSHORT);
+     }
+     if(SiS_SetStart(SiS_Pr)) continue;		/* Set start condition */
+     tempah = SiS_Pr->SiS_DDC_DeviceAddr;
+     temp = SiS_WriteDDC2Data(SiS_Pr,tempah);	/* Write DAB (S0=0=write) */
+     if(temp) continue;				/*    (ERROR: no ack) */
+     tempah = tempbx & 0x00FF;			/* Write RAB */
+     tempah |= myor;                            /* (700x: set bit 7, see datasheet) */
+     temp = SiS_WriteDDC2Data(SiS_Pr,tempah);
+     if(temp) continue;				/*    (ERROR: no ack) */
+     tempah = (tempbx & 0xFF00) >> 8;
+     temp = SiS_WriteDDC2Data(SiS_Pr,tempah);	/* Write data */
+     if(temp) continue;				/*    (ERROR: no ack) */
+     if(SiS_SetStop(SiS_Pr)) continue;		/* Set stop condition */
+     SiS_Pr->SiS_ChrontelInit = 1;
+     return TRUE;
+  }
+  return FALSE;
 }
 
-/* TW: Write to Chrontel 700x */
+/* Write to Chrontel 700x */
 /* Parameter is [Data (S15-S8) | Register no (S7-S0)] */
 void
 SiS_SetCH700x(SiS_Private *SiS_Pr, USHORT tempbx)
 {
-  USHORT tempah,temp,i;
+  SiS_Pr->SiS_DDC_DeviceAddr = 0xEA;  		/* DAB (Device Address Byte) */
 
   if(!(SiS_Pr->SiS_ChrontelInit)) {
-     SiS_Pr->SiS_DDC_Index = 0x11;		   /* TW: Bit 0 = SC;  Bit 1 = SD */
-     SiS_Pr->SiS_DDC_Data  = 0x02;                 /* Bitmask in IndexReg for Data */
-     SiS_Pr->SiS_DDC_Clk   = 0x01;                 /* Bitmask in IndexReg for Clk */
-     SiS_Pr->SiS_DDC_DataShift = 0x00;
-     SiS_Pr->SiS_DDC_DeviceAddr = 0xEA;  	   /* TW: DAB (Device Address Byte) */
-  }
-
-  for(i=0;i<10;i++) {	/* TW: Do only 10 attempts to write */
-    /* SiS_SetSwitchDDC2(SiS_Pr); */
-    if(SiS_SetStart(SiS_Pr)) continue;		/* TW: Set start condition */
-    tempah = SiS_Pr->SiS_DDC_DeviceAddr;
-    temp = SiS_WriteDDC2Data(SiS_Pr,tempah);	/* TW: Write DAB (S0=0=write) */
-    if(temp) continue;				/* TW:    (ERROR: no ack) */
-    tempah = tempbx & 0x00FF;			/* TW: Write RAB */
-    tempah |= 0x80;                             /* TW: (set bit 7, see datasheet) */
-    temp = SiS_WriteDDC2Data(SiS_Pr,tempah);
-    if(temp) continue;				/* TW:    (ERROR: no ack) */
-    tempah = (tempbx & 0xFF00) >> 8;
-    temp = SiS_WriteDDC2Data(SiS_Pr,tempah);	/* TW: Write data */
-    if(temp) continue;				/* TW:    (ERROR: no ack) */
-    if(SiS_SetStop(SiS_Pr)) continue;		/* TW: Set stop condition */
-    SiS_Pr->SiS_ChrontelInit = 1;
-    return;
+     SiS_Pr->SiS_DDC_Index = 0x11;		/* Bit 0 = SC;  Bit 1 = SD */
+     SiS_Pr->SiS_DDC_Data  = 0x02;              /* Bitmask in IndexReg for Data */
+     SiS_Pr->SiS_DDC_Clk   = 0x01;              /* Bitmask in IndexReg for Clk */
+     SiS_SetupDDCN(SiS_Pr);
   }
 
-  /* TW: For 630ST */
-  if(!(SiS_Pr->SiS_ChrontelInit)) {
-     SiS_Pr->SiS_DDC_Index = 0x0a;		/* TW: Bit 7 = SC;  Bit 6 = SD */
+  if( (!(SiS_SetChReg(SiS_Pr, tempbx, 0x80))) &&
+      (!(SiS_Pr->SiS_ChrontelInit)) ) {
+     SiS_Pr->SiS_DDC_Index = 0x0a;		/* Bit 7 = SC;  Bit 6 = SD */
      SiS_Pr->SiS_DDC_Data  = 0x80;              /* Bitmask in IndexReg for Data */
      SiS_Pr->SiS_DDC_Clk   = 0x40;              /* Bitmask in IndexReg for Clk */
-     SiS_Pr->SiS_DDC_DataShift = 0x00;
-     SiS_Pr->SiS_DDC_DeviceAddr = 0xEA;  	/* TW: DAB (Device Address Byte) */
+     SiS_SetupDDCN(SiS_Pr);
 
-     for(i=0;i<10;i++) {	/* TW: Do only 10 attempts to write */
-       /* SiS_SetSwitchDDC2(SiS_Pr); */
-       if (SiS_SetStart(SiS_Pr)) continue;	/* TW: Set start condition */
-       tempah = SiS_Pr->SiS_DDC_DeviceAddr;
-       temp = SiS_WriteDDC2Data(SiS_Pr,tempah);	/* TW: Write DAB (S0=0=write) */
-       if(temp) continue;			/* TW:    (ERROR: no ack) */
-       tempah = tempbx & 0x00FF;		/* TW: Write RAB */
-       tempah |= 0x80;                          /* TW: (set bit 7, see datasheet) */
-       temp = SiS_WriteDDC2Data(SiS_Pr,tempah);
-       if(temp) continue;			/* TW:    (ERROR: no ack) */
-       tempah = (tempbx & 0xFF00) >> 8;
-       temp = SiS_WriteDDC2Data(SiS_Pr,tempah);	/* TW: Write data */
-       if(temp) continue;			/* TW:    (ERROR: no ack) */
-       if(SiS_SetStop(SiS_Pr)) continue;	/* TW: Set stop condition */
-       SiS_Pr->SiS_ChrontelInit = 1;
-       return;
-    }
+     SiS_SetChReg(SiS_Pr, tempbx, 0x80);
   }
 }
 
-/* TW: Write to Chrontel 701x */
+/* Write to Chrontel 701x */
 /* Parameter is [Data (S15-S8) | Register no (S7-S0)] */
 void
 SiS_SetCH701x(SiS_Private *SiS_Pr, USHORT tempbx)
 {
-  USHORT tempah,temp,i;
-
-  SiS_Pr->SiS_DDC_Index = 0x11;			/* TW: Bit 0 = SC;  Bit 1 = SD */
+  SiS_Pr->SiS_DDC_Index = 0x11;			/* Bit 0 = SC;  Bit 1 = SD */
   SiS_Pr->SiS_DDC_Data  = 0x08;                 /* Bitmask in IndexReg for Data */
   SiS_Pr->SiS_DDC_Clk   = 0x04;                 /* Bitmask in IndexReg for Clk */
-  SiS_Pr->SiS_DDC_DataShift = 0x00;
-  SiS_Pr->SiS_DDC_DeviceAddr = 0xEA;  		/* TW: DAB (Device Address Byte) */
+  SiS_SetupDDCN(SiS_Pr);
+  SiS_Pr->SiS_DDC_DeviceAddr = 0xEA;  		/* DAB (Device Address Byte) */
 
-  for(i=0;i<10;i++) {	/* TW: Do only 10 attempts to write */
-    if (SiS_SetStart(SiS_Pr)) continue;		/* TW: Set start condition */
-    tempah = SiS_Pr->SiS_DDC_DeviceAddr;
-    temp = SiS_WriteDDC2Data(SiS_Pr,tempah);	/* TW: Write DAB (S0=0=write) */
-    if(temp) continue;				/* TW:    (ERROR: no ack) */
-    tempah = tempbx & 0x00FF;
-    temp = SiS_WriteDDC2Data(SiS_Pr,tempah);	/* TW: Write RAB */
-    if(temp) continue;				/* TW:    (ERROR: no ack) */
-    tempah = (tempbx & 0xFF00) >> 8;
-    temp = SiS_WriteDDC2Data(SiS_Pr,tempah);	/* TW: Write data */
-    if(temp) continue;				/* TW:    (ERROR: no ack) */
-    if(SiS_SetStop(SiS_Pr)) continue;		/* TW: Set stop condition */
-    return;
-  }
+  SiS_SetChReg(SiS_Pr, tempbx, 0);
 }
 
-/* TW: Read from Chrontel 70xx */
-/* Parameter is [Register no (S7-S0)] */
-USHORT
-SiS_GetCH70xx(SiS_Private *SiS_Pr, USHORT tempbx)
+void
+SiS_SetCH70xx(SiS_Private *SiS_Pr, USHORT tempbx)
 {
-   if (SiS_Pr->SiS_IF_DEF_CH70xx == 1)
-      return(SiS_GetCH700x(SiS_Pr,tempbx));
+   if(SiS_Pr->SiS_IF_DEF_CH70xx == 1)
+      SiS_SetCH700x(SiS_Pr,tempbx);
    else
-      return(SiS_GetCH701x(SiS_Pr,tempbx));
+      SiS_SetCH701x(SiS_Pr,tempbx);
+}
+
+static USHORT
+SiS_GetChReg(SiS_Private *SiS_Pr, USHORT myor)
+{
+  USHORT tempah,temp,i;
+
+  for(i=0; i<20; i++) {				/* Do 20 attempts to read */
+     if(i) {
+        SiS_SetStop(SiS_Pr);
+	SiS_DDC2Delay(SiS_Pr,SiS_I2CDELAYSHORT);
+     }
+     if(SiS_SetStart(SiS_Pr)) continue;		/* Set start condition */
+     tempah = SiS_Pr->SiS_DDC_DeviceAddr;
+     temp = SiS_WriteDDC2Data(SiS_Pr,tempah);	/* Write DAB (S0=0=write) */
+     if(temp) continue;				/*        (ERROR: no ack) */
+     tempah = SiS_Pr->SiS_DDC_ReadAddr | myor;	/* Write RAB (700x: | 0x80) */
+     temp = SiS_WriteDDC2Data(SiS_Pr,tempah);
+     if(temp) continue;				/*        (ERROR: no ack) */
+     if (SiS_SetStart(SiS_Pr)) continue;	/* Re-start */
+     tempah = SiS_Pr->SiS_DDC_DeviceAddr | 0x01;/* DAB | 0x01 = Read */
+     temp = SiS_WriteDDC2Data(SiS_Pr,tempah);	/* DAB (S0=1=read) */
+     if(temp) continue;				/*        (ERROR: no ack) */
+     tempah = SiS_ReadDDC2Data(SiS_Pr,tempah);	/* Read byte */
+     if(SiS_SetStop(SiS_Pr)) continue;		/* Stop condition */
+     SiS_Pr->SiS_ChrontelInit = 1;
+     return(tempah);
+  }
+  return 0xFFFF;
 }
 
-/* TW: Read from Chrontel 700x */
+/* Read from Chrontel 700x */
 /* Parameter is [Register no (S7-S0)] */
 USHORT
 SiS_GetCH700x(SiS_Private *SiS_Pr, USHORT tempbx)
 {
-  USHORT tempah,temp,i;
+  USHORT result;
+
+  SiS_Pr->SiS_DDC_DeviceAddr = 0xEA;		/* DAB */
 
   if(!(SiS_Pr->SiS_ChrontelInit)) {
-     SiS_Pr->SiS_DDC_Index = 0x11;		/* TW: Bit 0 = SC;  Bit 1 = SD */
+     SiS_Pr->SiS_DDC_Index = 0x11;		/* Bit 0 = SC;  Bit 1 = SD */
      SiS_Pr->SiS_DDC_Data  = 0x02;              /* Bitmask in IndexReg for Data */
      SiS_Pr->SiS_DDC_Clk   = 0x01;              /* Bitmask in IndexReg for Clk */
-     SiS_Pr->SiS_DDC_DataShift = 0x00;
-     SiS_Pr->SiS_DDC_DeviceAddr = 0xEA;		/* TW: DAB */
+     SiS_SetupDDCN(SiS_Pr);
   }
 
   SiS_Pr->SiS_DDC_ReadAddr = tempbx;
 
-  for(i=0;i<20;i++) {	/* TW: Do only 20 attempts to read */
-    /* SiS_SetSwitchDDC2(SiS_Pr); */
-    if(SiS_SetStart(SiS_Pr)) continue;		/* TW: Set start condition */
-    tempah = SiS_Pr->SiS_DDC_DeviceAddr;
-    temp = SiS_WriteDDC2Data(SiS_Pr,tempah);	/* TW: Write DAB (S0=0=write) */
-    if(temp) continue;				/* TW:        (ERROR: no ack) */
-    tempah = SiS_Pr->SiS_DDC_ReadAddr | 0x80;	/* TW: Write RAB | 0x80 */
-    temp = SiS_WriteDDC2Data(SiS_Pr,tempah);
-    if(temp) continue;				/* TW:        (ERROR: no ack) */
-    if (SiS_SetStart(SiS_Pr)) continue;		/* TW: Re-start */
-    tempah = SiS_Pr->SiS_DDC_DeviceAddr | 0x01; /* DAB | 0x01 = Read */
-    temp = SiS_WriteDDC2Data(SiS_Pr,tempah);	/* TW: DAB (S0=1=read) */
-    if(temp) continue;				/* TW:        (ERROR: no ack) */
-    tempah = SiS_ReadDDC2Data(SiS_Pr,tempah);	/* TW: Read byte */
-    if (SiS_SetStop(SiS_Pr)) continue;		/* TW: Stop condition */
-    SiS_Pr->SiS_ChrontelInit = 1;
-    return(tempah);
-  }
-
-  /* TW: For 630ST */
-  if(!SiS_Pr->SiS_ChrontelInit) {
-     SiS_Pr->SiS_DDC_Index = 0x0a;		/* TW: Bit 0 = SC;  Bit 1 = SD */
-     SiS_Pr->SiS_DDC_Data  = 0x80;              /* Bitmask in IndexReg for Data */
-     SiS_Pr->SiS_DDC_Clk   = 0x40;              /* Bitmask in IndexReg for Clk */
-     SiS_Pr->SiS_DDC_DataShift = 0x00;
-     SiS_Pr->SiS_DDC_DeviceAddr = 0xEA;  	/* TW: DAB (Device Address Byte) */
+  if( ((result = SiS_GetChReg(SiS_Pr,0x80)) == 0xFFFF) &&
+      (!SiS_Pr->SiS_ChrontelInit) ) {
 
-     for(i=0;i<20;i++) {	/* TW: Do only 20 attempts to read */
-       /* SiS_SetSwitchDDC2(SiS_Pr); */
-       if(SiS_SetStart(SiS_Pr)) continue;		/* TW: Set start condition */
-       tempah = SiS_Pr->SiS_DDC_DeviceAddr;
-       temp = SiS_WriteDDC2Data(SiS_Pr,tempah);		/* TW: Write DAB (S0=0=write) */
-       if(temp) continue;				/* TW:        (ERROR: no ack) */
-       tempah = SiS_Pr->SiS_DDC_ReadAddr | 0x80;	/* TW: Write RAB | 0x80 */
-       temp = SiS_WriteDDC2Data(SiS_Pr,tempah);
-       if(temp) continue;				/* TW:        (ERROR: no ack) */
-       if (SiS_SetStart(SiS_Pr)) continue;		/* TW: Re-start */
-       tempah = SiS_Pr->SiS_DDC_DeviceAddr | 0x01; 	/* DAB | 0x01 = Read */
-       temp = SiS_WriteDDC2Data(SiS_Pr,tempah);		/* TW: DAB (S0=1=read) */
-       if(temp) continue;				/* TW:        (ERROR: no ack) */
-       tempah = SiS_ReadDDC2Data(SiS_Pr,tempah);	/* TW: Read byte */
-       if (SiS_SetStop(SiS_Pr)) continue;		/* TW: Stop condition */
-       SiS_Pr->SiS_ChrontelInit = 1;
-       return(tempah);
-     }
+     SiS_Pr->SiS_DDC_Index = 0x0a;
+     SiS_Pr->SiS_DDC_Data  = 0x80;
+     SiS_Pr->SiS_DDC_Clk   = 0x40;
+     SiS_SetupDDCN(SiS_Pr);
+
+     result = SiS_GetChReg(SiS_Pr,0x80);
   }
-  return(0xFFFF);
+  return(result);
 }
 
-/* TW: Read from Chrontel 701x */
+/* Read from Chrontel 701x */
 /* Parameter is [Register no (S7-S0)] */
 USHORT
 SiS_GetCH701x(SiS_Private *SiS_Pr, USHORT tempbx)
 {
-  USHORT tempah,temp,i;
-
-  SiS_Pr->SiS_DDC_Index = 0x11;			/* TW: Bit 0 = SC;  Bit 1 = SD */
+  SiS_Pr->SiS_DDC_Index = 0x11;			/* Bit 0 = SC;  Bit 1 = SD */
   SiS_Pr->SiS_DDC_Data  = 0x08;                 /* Bitmask in IndexReg for Data */
   SiS_Pr->SiS_DDC_Clk   = 0x04;                 /* Bitmask in IndexReg for Clk */
-  SiS_Pr->SiS_DDC_DataShift = 0x00;
-  SiS_Pr->SiS_DDC_DeviceAddr = 0xEA;		/* TW: DAB */
+  SiS_SetupDDCN(SiS_Pr);
+  SiS_Pr->SiS_DDC_DeviceAddr = 0xEA;		/* DAB */
+
   SiS_Pr->SiS_DDC_ReadAddr = tempbx;
 
-   for(i=0;i<20;i++) {	/* TW: Do only 20 attempts to read */
-    if(SiS_SetStart(SiS_Pr)) continue;		/* TW: Set start condition */
-    tempah = SiS_Pr->SiS_DDC_DeviceAddr;
-    temp = SiS_WriteDDC2Data(SiS_Pr,tempah);	/* TW: Write DAB (S0=0=write) */
-    if(temp) continue;				/* TW:        (ERROR: no ack) */
-    tempah = SiS_Pr->SiS_DDC_ReadAddr;		/* TW: Write RAB */
-    temp = SiS_WriteDDC2Data(SiS_Pr,tempah);
-    if(temp) continue;				/* TW:        (ERROR: no ack) */
-    if (SiS_SetStart(SiS_Pr)) continue;		/* TW: Re-start */
-    tempah = SiS_Pr->SiS_DDC_DeviceAddr | 0x01; /* DAB | 0x01 = Read */
-    temp = SiS_WriteDDC2Data(SiS_Pr,tempah);	/* TW: DAB (S0=1=read) */
-    if(temp) continue;				/* TW:        (ERROR: no ack) */
-    tempah = SiS_ReadDDC2Data(SiS_Pr,tempah);	/* TW: Read byte */
-    SiS_SetStop(SiS_Pr);			/* TW: Stop condition */
-    return(tempah);
-   }
-  return 0xFFFF;
+  return(SiS_GetChReg(SiS_Pr,0));
 }
 
-#ifdef LINUX_XF86
-/* TW: Our own DDC functions */
+/* Read from Chrontel 70xx */
+/* Parameter is [Register no (S7-S0)] */
+USHORT
+SiS_GetCH70xx(SiS_Private *SiS_Pr, USHORT tempbx)
+{
+   if(SiS_Pr->SiS_IF_DEF_CH70xx == 1)
+      return(SiS_GetCH700x(SiS_Pr, tempbx));
+   else
+      return(SiS_GetCH701x(SiS_Pr, tempbx));
+}
+
+/* Our own DDC functions */
 USHORT
-SiS_InitDDCRegs(SiS_Private *SiS_Pr, SISPtr pSiS, USHORT adaptnum, USHORT DDCdatatype,
-		BOOLEAN checkcr32)
+SiS_InitDDCRegs(SiS_Private *SiS_Pr, unsigned long VBFlags, int VGAEngine,
+                USHORT adaptnum, USHORT DDCdatatype, BOOLEAN checkcr32)
 {
      unsigned char ddcdtype[] = { 0xa0, 0xa0, 0xa0, 0xa2, 0xa6 };
      unsigned char flag, cr32;
      USHORT        temp = 0, myadaptnum = adaptnum;
 
      if(adaptnum != 0) {
-        if(!(pSiS->VBFlags & (VB_301|VB_301B|VB_302B))) return 0xFFFF;
-	if((pSiS->VBFlags & VB_30xBDH) && (adaptnum == 1)) return 0xFFFF;
+        if(!(VBFlags & (VB_301|VB_301B|VB_301C|VB_302B))) return 0xFFFF;
+	if((VBFlags & VB_30xBDH) && (adaptnum == 1)) return 0xFFFF;
      }	
      
      /* adapternum for SiS bridges: 0 = CRT1, 1 = LCD, 2 = VGA2 */
@@ -9770,9 +9955,10 @@
      SiS_Pr->SiS_DDC_Index = 0x11;
      flag = 0xff;
 
-     cr32 = SiS_GetReg1(SiS_Pr->SiS_P3d4,0x32);
-  
-     if(pSiS->VBFlags & VB_SISBRIDGE) {
+     cr32 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x32);
+
+#if 0
+     if(VBFlags & VB_SISBRIDGE) {
 	if(myadaptnum == 0) {
 	   if(!(cr32 & 0x20)) {
 	      myadaptnum = 2;
@@ -9785,18 +9971,19 @@
 	   }
         }
      }
+#endif
 
-     if(pSiS->VGAEngine == SIS_300_VGA) {		/* 300 series */
+     if(VGAEngine == SIS_300_VGA) {		/* 300 series */
 	
         if(myadaptnum != 0) {
 	   flag = 0;
-	   if(pSiS->VBFlags & VB_SISBRIDGE) {
+	   if(VBFlags & VB_SISBRIDGE) {
 	      SiS_Pr->SiS_DDC_Port = SiS_Pr->SiS_Part4Port;
               SiS_Pr->SiS_DDC_Index = 0x0f;
 	   }
         }
 
-	if(!(pSiS->VBFlags & VB_301)) {
+	if(!(VBFlags & VB_301)) {
 	   if((cr32 & 0x80) && (checkcr32)) {
               if(myadaptnum >= 1) {
 	         if(!(cr32 & 0x08)) {
@@ -9810,11 +9997,11 @@
 	temp = 4 - (myadaptnum * 2);
 	if(flag) temp = 0;
 
-     } else {						/* 310/325/330 series */
+     } else {						/* 315/330 series */
 
      	/* here we simplify: 0 = CRT1, 1 = CRT2 (VGA, LCD) */
-	
-	if(pSiS->VBFlags & VB_SISBRIDGE) {
+
+	if(VBFlags & VB_SISBRIDGE) {
 	   if(myadaptnum == 2) {
 	      myadaptnum = 1;
            }
@@ -9822,7 +10009,7 @@
 
         if(myadaptnum == 1) {
      	   flag = 0;
-	   if(pSiS->VBFlags & VB_SISBRIDGE) {
+	   if(VBFlags & VB_SISBRIDGE) {
 	      SiS_Pr->SiS_DDC_Port = SiS_Pr->SiS_Part4Port;
               SiS_Pr->SiS_DDC_Index = 0x0f;
 	   }
@@ -9840,7 +10027,7 @@
         temp = myadaptnum;
         if(myadaptnum == 1) {
            temp = 0;
-	   if(pSiS->VBFlags & VB_LVDS) flag = 0xff;
+	   if(VBFlags & VB_LVDS) flag = 0xff;
         }
 
 	if(flag) temp = 0;
@@ -9849,10 +10036,12 @@
     SiS_Pr->SiS_DDC_Data = 0x02 << temp;
     SiS_Pr->SiS_DDC_Clk  = 0x01 << temp;
 
+    SiS_SetupDDCN(SiS_Pr);
+
 #ifdef TWDEBUG
     xf86DrvMsg(0, X_INFO, "DDC Port %x Index %x Shift %d\n",
     		SiS_Pr->SiS_DDC_Port, SiS_Pr->SiS_DDC_Index, temp);
-#endif	 
+#endif
     
     return 0;
 }
@@ -9862,15 +10051,9 @@
 {
    if(SiS_SetStart(SiS_Pr)) return 0xFFFF;
    if(SiS_WriteDDC2Data(SiS_Pr, SiS_Pr->SiS_DDC_DeviceAddr)) {
-#ifdef TWDEBUG
-        xf86DrvMsg(0, X_INFO, "WriteDAB 1 failed\n");
-#endif	 
   	return 0xFFFF;
    }
    if(SiS_WriteDDC2Data(SiS_Pr, SiS_Pr->SiS_DDC_SecAddr)) {
-#ifdef TWDEBUG
-        xf86DrvMsg(0, X_INFO, "WriteDAB 2 failed\n");
-#endif	 
    	return 0xFFFF;
    }
    return(0);
@@ -9881,9 +10064,6 @@
 {
    if(SiS_SetStart(SiS_Pr)) return 0xFFFF;
    if(SiS_WriteDDC2Data(SiS_Pr, (SiS_Pr->SiS_DDC_DeviceAddr | 0x01))) {
-#ifdef TWDEBUG
-        xf86DrvMsg(0, X_INFO, "PrepareReadDDC 1 failed\n");
-#endif	 
    	return 0xFFFF;
    }
    return(0);
@@ -9902,11 +10082,15 @@
 {
    SiS_SetSCLKLow(SiS_Pr);
    if(yesno) {
-      SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port, SiS_Pr->SiS_DDC_Index,
-                      ~SiS_Pr->SiS_DDC_Data, SiS_Pr->SiS_DDC_Data);
+      SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port,
+      		      SiS_Pr->SiS_DDC_Index,
+                      SiS_Pr->SiS_DDC_NData,
+		      SiS_Pr->SiS_DDC_Data);
    } else {
-      SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port, SiS_Pr->SiS_DDC_Index,
-                      ~SiS_Pr->SiS_DDC_Data, 0);
+      SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port,
+      		      SiS_Pr->SiS_DDC_Index,
+                      SiS_Pr->SiS_DDC_NData,
+		      0);
    }
    SiS_SetSCLKHigh(SiS_Pr);
 }
@@ -9922,8 +10106,8 @@
     if(SiS_PrepareDDC(SiS_Pr)) {
          SiS_SetStop(SiS_Pr);
 #ifdef TWDEBUG
-	 xf86DrvMsg(0, X_INFO, "DoProbeDDC 1 failed at PrepareDDC\n");
-#endif	 
+         xf86DrvMsg(0, X_INFO, "Probe: Prepare failed\n");
+#endif
          return(0xFFFF);
     }
     mask = 0xf0;
@@ -9937,6 +10121,9 @@
        } else {
            failed = TRUE;
 	   ret = 0xFFFF;
+#ifdef TWDEBUG
+           xf86DrvMsg(0, X_INFO, "Probe: Read 1 failed\n");
+#endif
        }
     }
     if(failed == FALSE) {
@@ -9946,6 +10133,9 @@
        if(temp == value) ret = 0;
        else {
           ret = 0xFFFF;
+#ifdef TWDEBUG
+          xf86DrvMsg(0, X_INFO, "Probe: Read 2 failed\n");
+#endif
           if(SiS_Pr->SiS_DDC_DeviceAddr == 0xa0) {
              if(temp == 0x30) ret = 0;
           }
@@ -9972,7 +10162,7 @@
 }
 
 USHORT
-SiS_ReadDDC(SiS_Private *SiS_Pr, SISPtr pSiS, USHORT DDCdatatype, unsigned char *buffer)
+SiS_ReadDDC(SiS_Private *SiS_Pr, USHORT DDCdatatype, unsigned char *buffer)
 {
    USHORT flag, length, i;
    unsigned char chksum,gotcha;
@@ -10004,28 +10194,7 @@
    return(flag);
 }
 
-USHORT
-SiS_ReadLCDDDC(SiS_Private *SiS_Pr, USHORT length, unsigned char *buffer)
-{
-   USHORT i=0, flag=0;
-
-   length--;
-   
-   SiS_SetSwitchDDC2(SiS_Pr);
-   if(!(SiS_PrepareDDC(SiS_Pr))) {
-      for(i=0; i<length; i++) {
-         buffer[i] = (unsigned char)SiS_ReadDDC2Data(SiS_Pr, 0);
-         SiS_SendACK(SiS_Pr, 0);
-      }
-      buffer[i] = (unsigned char)SiS_ReadDDC2Data(SiS_Pr, 0);
-      SiS_SendACK(SiS_Pr, 1);
-   } else flag = 0xFFFF;
-   
-   SiS_SetStop(SiS_Pr);
-   return(0);
-}
-
-/* TW: Our private DDC function
+/* Our private DDC functions
 
    It complies somewhat with the corresponding VESA function
    in arguments and return values.
@@ -10036,7 +10205,7 @@
 
    Arguments:
        adaptnum: 0=CRT1, 1=LCD, 2=VGA2
-                 CRT2 DDC is only supported on SiS301, 301B (non-DH version), 302B.
+                 CRT2 DDC is only supported on SiS301, 301B, 302B.
        DDCdatatype: 0=Probe, 1=EDID, 2=EDID+VDIF, 3=EDID V2 (P&D), 4=EDID V2 (FPDI-2)
        buffer: ptr to 256 data bytes which will be filled with read data.
 
@@ -10046,18 +10215,89 @@
 
  */
 USHORT
-SiS_HandleDDC(SiS_Private *SiS_Pr, SISPtr pSiS, USHORT adaptnum,
-              USHORT DDCdatatype, unsigned char *buffer)
+SiS_HandleDDC(SiS_Private *SiS_Pr, unsigned long VBFlags, int VGAEngine,
+              USHORT adaptnum, USHORT DDCdatatype, unsigned char *buffer)
 {
+   unsigned char sr1f,cr17=1;
+   USHORT result;
+
    if(adaptnum > 2) return 0xFFFF;
    if(DDCdatatype > 4) return 0xFFFF;
-   if((!(pSiS->VBFlags & VB_VIDEOBRIDGE)) && (adaptnum > 0)) return 0xFFFF;
-   if(SiS_InitDDCRegs(SiS_Pr, pSiS, adaptnum, DDCdatatype, TRUE) == 0xFFFF) return 0xFFFF;
+   if((!(VBFlags & VB_VIDEOBRIDGE)) && (adaptnum > 0)) return 0xFFFF;
+   if(SiS_InitDDCRegs(SiS_Pr, VBFlags, VGAEngine, adaptnum, DDCdatatype, FALSE) == 0xFFFF) return 0xFFFF;
+
+   sr1f = SiS_GetReg(SiS_Pr->SiS_P3c4,0x1f);
+   SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x1f,0x3f,0x04);
+   if(VGAEngine == SIS_300_VGA) {
+      cr17 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x17) & 0x80;
+      if(!cr17) {
+         SiS_SetRegOR(SiS_Pr->SiS_P3d4,0x17,0x80);
+         SiS_SetReg(SiS_Pr->SiS_P3c4,0x00,0x01);
+         SiS_SetReg(SiS_Pr->SiS_P3c4,0x00,0x03);
+      }
+   }
+   if((sr1f) || (!cr17)) {
+      SiS_WaitRetrace1(SiS_Pr);
+      SiS_WaitRetrace1(SiS_Pr);
+      SiS_WaitRetrace1(SiS_Pr);
+      SiS_WaitRetrace1(SiS_Pr);
+   }
+
    if(DDCdatatype == 0) {
-       return(SiS_ProbeDDC(SiS_Pr));
+      result = SiS_ProbeDDC(SiS_Pr);
    } else {
-       return(SiS_ReadDDC(SiS_Pr, pSiS, DDCdatatype, buffer));
+      result = SiS_ReadDDC(SiS_Pr, DDCdatatype, buffer);
    }
+   SiS_SetReg(SiS_Pr->SiS_P3c4,0x1f,sr1f);
+   if(VGAEngine == SIS_300_VGA) {
+      SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x17,0x7f,cr17);
+   }
+   return result;
+}
+
+#ifdef LINUX_XF86
+
+static BOOLEAN
+checkedid1(unsigned char *buffer)
+{
+   /* Check header */
+   if((buffer[0] != 0x00) ||
+      (buffer[1] != 0xff) ||
+      (buffer[2] != 0xff) ||
+      (buffer[3] != 0xff) ||
+      (buffer[4] != 0xff) ||
+      (buffer[5] != 0xff) ||
+      (buffer[6] != 0xff) ||
+      (buffer[7] != 0x00))
+      return FALSE;
+
+   /* Check EDID version and revision */
+   if((buffer[0x12] != 1) || (buffer[0x13] > 4)) return FALSE;
+
+   /* Check week of manufacture for sanity */
+   if(buffer[0x10] > 53) return FALSE;
+
+   /* Check year of manufacture for sanity */
+   if(buffer[0x11] > 40) return FALSE;
+
+   return TRUE;
+}
+
+static BOOLEAN
+checkedid2(unsigned char *buffer)
+{
+   USHORT year = buffer[6] | (buffer[7] << 8);
+
+   /* Check EDID version */
+   if((buffer[0] & 0xf0) != 0x20) return FALSE;
+
+   /* Check week of manufacture for sanity */
+   if(buffer[5] > 53) return FALSE;
+
+   /* Check year of manufacture for sanity */
+   if((year != 0) && ((year < 1990) || (year > 2030))) return FALSE;
+
+   return TRUE;
 }
 
 /* Sense the LCD parameters (CR36, CR37) via DDC */
@@ -10065,24 +10305,28 @@
 USHORT
 SiS_SenseLCDDDC(SiS_Private *SiS_Pr, SISPtr pSiS)
 {
-   USHORT DDCdatatype, paneltype, flag, xres, yres;
+   USHORT DDCdatatype, paneltype, flag, xres=0, yres=0;
    USHORT index, myindex, lumsize, numcodes;
    unsigned char cr37=0, seekcode;
    BOOLEAN checkexpand = FALSE;
    int retry, i;
    unsigned char buffer[256];
-   
-   if(!(pSiS->VBFlags & (VB_301|VB_301B|VB_302B))) return 0;
+
+   for(i=0; i<7; i++) SiS_Pr->CP_DataValid[i] = FALSE;
+   SiS_Pr->CP_HaveCustomData = FALSE;
+   SiS_Pr->CP_MaxX = SiS_Pr->CP_MaxY = SiS_Pr->CP_MaxClock = 0;
+
+   if(!(pSiS->VBFlags & (VB_301|VB_301B|VB_301C|VB_302B))) return 0;
    if(pSiS->VBFlags & VB_30xBDH) return 0;
   
-   if(SiS_InitDDCRegs(SiS_Pr, pSiS, 1, 0, FALSE) == 0xFFFF) return 0;
+   if(SiS_InitDDCRegs(SiS_Pr, pSiS->VBFlags, pSiS->VGAEngine, 1, 0, FALSE) == 0xFFFF) return 0;
    
    SiS_Pr->SiS_DDC_SecAddr = 0x00;
    
    /* Probe supported DA's */
    flag = SiS_ProbeDDC(SiS_Pr);
-#ifdef TWDEBUG   
-   xf86DrvMsg(pSiS->pScrn->scrnIndex, X_INFO, 
+#ifdef TWDEBUG
+   xf86DrvMsg(pSiS->pScrn->scrnIndex, X_INFO,
    	"CRT2 DDC capabilities 0x%x\n", flag);
 #endif	
    if(flag & 0x10) {
@@ -10099,18 +10343,18 @@
    /* Read the entire EDID */
    retry = 2;
    do {
-      if(SiS_ReadDDC(SiS_Pr, pSiS, DDCdatatype, buffer)) {
-         xf86DrvMsg(pSiS->pScrn->scrnIndex, X_INFO, 
-	 	"CRT2: DDC read failed (attempt %d), %s\n", 
+      if(SiS_ReadDDC(SiS_Pr, DDCdatatype, buffer)) {
+         xf86DrvMsg(pSiS->pScrn->scrnIndex, X_PROBED,
+	 	"CRT2: DDC read failed (attempt %d), %s\n",
 		(3-retry), (retry == 1) ? "giving up" : "retrying");
 	 retry--;
 	 if(retry == 0) return 0xFFFF;
       } else break;
    } while(1);
-   
-#ifdef TWDEBUG   
+
+#ifdef TWDEBUG
    for(i=0; i<256; i+=16) {
-       xf86DrvMsg(pSiS->pScrn->scrnIndex, X_INFO,
+       xf86DrvMsg(pSiS->pScrn->scrnIndex, X_PROBED,
        	"%02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x\n",
 	buffer[i],    buffer[i+1], buffer[i+2], buffer[i+3],
 	buffer[i+4],  buffer[i+5], buffer[i+6], buffer[i+7],
@@ -10124,119 +10368,261 @@
    switch(DDCdatatype) {
    case 1:							/* Analyze EDID V1 */
       /* Catch a few clear cases: */
+      if(!(checkedid1(buffer))) {
+         xf86DrvMsg(pSiS->pScrn->scrnIndex, X_PROBED,
+	 	"CRT2: EDID corrupt\n");
+	 return 0;
+      }
+
       if(!(buffer[0x14] & 0x80)) {
-         xf86DrvMsg(pSiS->pScrn->scrnIndex, X_PROBED, 
+         xf86DrvMsg(pSiS->pScrn->scrnIndex, X_PROBED,
 	        "CRT2: Attached display expects analog input (0x%02x)\n",
 		buffer[0x14]);
       	 return 0;
       }
-      
+
       if((buffer[0x18] & 0x18) != 0x08) {
-         xf86DrvMsg(pSiS->pScrn->scrnIndex, X_PROBED, 
-	 	"CRT2: Attached display is not of RGB but of %s type (0x%02x)\n", 
+         xf86DrvMsg(pSiS->pScrn->scrnIndex, X_PROBED,
+	 	"CRT2: Attached display is not of RGB but of %s type (0x%02x)\n",
 		((buffer[0x18] & 0x18) == 0x00) ? "monochrome/greyscale" :
-		  ( ((buffer[0x18] & 0x18) == 0x10) ? "non-RGB multicolor" : 
+		  ( ((buffer[0x18] & 0x18) == 0x10) ? "non-RGB multicolor" :
 		     "undefined"),
 		buffer[0x18]);
 	 return 0;
       }
-      
-      /* Now analyze the first Detailed Timing Block and hope
-       * that the preferred timing mode is stored there.
-       */	
-      xres = buffer[0x38] | ((buffer[0x3a] & 0xf0) << 4);
-      yres = buffer[0x3b] | ((buffer[0x3d] & 0xf0) << 4);
+
+      /* Now analyze the first Detailed Timing Block and see
+       * if the preferred timing mode is stored there. If so,
+       * check if this is a standard panel for which we already
+       * know the timing.
+       */
+
+      paneltype = Panel_Custom;
       checkexpand = FALSE;
-      switch(xres) {
-         case 800:
-	     if(yres == 600) {
-	     	paneltype = Panel310_800x600;
-	     	checkexpand = TRUE;
-	     }
-	     break;
-         case 1024:
-	     if(yres == 768) {
-	     	paneltype = Panel310_1024x768;
-	     	checkexpand = FALSE;    /* expand causes error at 640x480, should otherwise be TRUE; */
-	     }
-	     break;
-	 case 1280:
-	     if(yres == 960) {
-	        if(pSiS->VGAEngine == SIS_300_VGA) {
-		   paneltype = Panel300_1280x960;
-		} else {
-		   paneltype = Panel310_1280x960; 
-		}
-	     } else if(yres == 1024) {
-	     	paneltype = Panel310_1280x1024;  
-		checkexpand = TRUE;
-	     } else if(pSiS->VGAEngine == SIS_315_VGA) {
+
+      if(buffer[0x18] & 0x02) {
+
+         xres = buffer[0x38] | ((buffer[0x3a] & 0xf0) << 4);
+         yres = buffer[0x3b] | ((buffer[0x3d] & 0xf0) << 4);
+
+	 SiS_Pr->CP_PreferredX = xres;
+	 SiS_Pr->CP_PreferredY = yres;
+
+         switch(xres) {
+            case 800:
+	        if(yres == 600) {
+	     	   paneltype = Panel_800x600;
+	     	   checkexpand = TRUE;
+	        }
+	        break;
+            case 1024:
 	        if(yres == 768) {
-	       	   paneltype = Panel310_1280x768; 	/* Panel size 1280x768 not supported yet */
-		   checkexpand = TRUE;	
-	        }	
-	     }
-	     break;
-	 case 1400:
-	     if(pSiS->VGAEngine == SIS_315_VGA) {
-	        if(yres == 1050) {
-	           paneltype = Panel310_1400x1050;
-		   checkexpand = TRUE; 
-	        } 
-	     }
-      	     break;
-	 case 1600:
-	     if(pSiS->VGAEngine == SIS_315_VGA) {
-	        if(yres == 1200) {
-	           paneltype = Panel310_1600x1200;
+	     	   paneltype = Panel_1024x768;
+	     	   checkexpand = TRUE;
+	        }
+	        break;
+	    case 1280:
+	        if(yres == 1024) {
+	     	   paneltype = Panel_1280x1024;
 		   checkexpand = TRUE;
-	        } 
-	     }
-      	     break;
+	        } else if(yres == 960) {
+	           if(pSiS->VGAEngine == SIS_300_VGA) {
+		      paneltype = Panel300_1280x960;
+		   } else {
+		      paneltype = Panel310_1280x960;
+		   }
+	        } else if(yres == 768) {
+		   if( ((buffer[0x36] | (buffer[0x37] << 8)) == 8100) &&
+		       ((buffer[0x39] | ((buffer[0x3a] & 0x0f) << 8)) == (1688 - 1280)) &&
+		       ((buffer[0x3c] | ((buffer[0x3d] & 0x0f) << 8)) == (802 - 768)) ) {
+	       	      paneltype = Panel_1280x768;
+		      checkexpand = FALSE;
+		      cr37 |= 0x10;
+		   }
+	        }
+	        break;
+	    case 1400:
+	        if(pSiS->VGAEngine == SIS_315_VGA) {
+	           if(yres == 1050) {
+	              paneltype = Panel310_1400x1050;
+		      checkexpand = TRUE;
+	           }
+	        }
+      	        break;
+#if 0	    /* Treat this as custom, as we have no valid timing data yet */
+	    case 1600:
+	        if(pSiS->VGAEngine == SIS_315_VGA) {
+	           if(yres == 1200) {
+	              paneltype = Panel310_1600x1200;
+		      checkexpand = TRUE;
+	           }
+	        }
+      	        break;
+#endif
+         }
+
+	 if(paneltype != Panel_Custom) {
+	    if((buffer[0x47] & 0x18) == 0x18) {
+	       cr37 |= ((((buffer[0x47] & 0x06) ^ 0x06) << 5) | 0x20);
+	    } else {
+	       /* What now? There is no digital separate output timing... */
+	       xf86DrvMsg(pSiS->pScrn->scrnIndex, X_WARNING,
+	       	   "CRT2: Unable to retrieve Sync polarity information\n");
+	       cr37 |= 0xc0;  /* Default */
+	    }
+	 }
+
       }
 
-      if(buffer[0x18] & 0x02) {
-         /* If the preferred timing mode is stored in the first
-	  * detailed timing block, we now can extract the sync
-	  * polarisation information as well. This only works
-	  * if the Flags indicate a digital separate output.
-	  */
-	  if((buffer[0x47] & 0x18) == 0x18) {
-	     cr37 |= ((((buffer[0x47] & 0x06) ^ 0x06) << 5) | 0x20);
-	  } else {
-	     /* What now? There is no digital separate output timing... */
-	     xf86DrvMsg(pSiS->pScrn->scrnIndex, X_WARNING, 
-	     	"CRT2: Unable to retrieve Sync polarity information\n");
-	  }
-	  
-      } else {
-         /* If the preferred timing mode is *not* stored in the first
-	  * detailed timing block, we need to guess the resolution
-	  * from the supported Established Timings and assume the
-	  * default sync polarity
-	  */
+      /* If we still don't know what panel this is, we take it
+       * as a custom panel and derive the timing data from the
+       * detailed timing blocks
+       */
+      if(paneltype == Panel_Custom) {
+
+         BOOLEAN havesync = FALSE;
+	 int i, temp, base = 0x36;
+	 unsigned long estpack;
+	 unsigned short estx[] = {
+	 	720, 720, 640, 640, 640, 640, 800, 800,
+		800, 800, 832,1024,1024,1024,1024,1280,
+		1152
+	 };
+	 unsigned short esty[] = {
+	 	400, 400, 480, 480, 480, 480, 600, 600,
+		600, 600, 624, 768, 768, 768, 768,1024,
+		870
+	 };
+
 	 paneltype = 0;
-	 if(buffer[0x24] & 0x01) { 	
-	 	paneltype = Panel310_1280x1024;
-		checkexpand = TRUE;
-		cr37 |= 0x20;
-	 } else if(buffer[0x24] & 0x0e) {
-	 	paneltype = Panel310_1024x768;
-		cr37 |= 0xe0;
-		checkexpand = FALSE;		/* Bug at 640x480 */
-	 } else if(buffer[0x23] & 0x01) {
-	 	paneltype = Panel310_800x600;
-		cr37 |= 0xe0;
-		checkexpand = TRUE;
-         }
+	 SiS_Pr->CP_Supports64048075 = TRUE;
+
+	 /* Find the maximum resolution */
+
+	 /* 1. From Established timings */
+	 estpack = (buffer[0x23] << 9) | (buffer[0x24] << 1) | ((buffer[0x25] >> 7) & 0x01);
+	 for(i=16; i>=0; i--) {
+	     if(estpack & (1 << i)) {
+	        if(estx[16 - i] > SiS_Pr->CP_MaxX) SiS_Pr->CP_MaxX = estx[16 - i];
+		if(esty[16 - i] > SiS_Pr->CP_MaxY) SiS_Pr->CP_MaxY = esty[16 - i];
+	     }
+	 }
+
+	 /* 2. From Standard Timings */
+	 for(i=0x26; i < 0x36; i+=2) {
+	    if((buffer[i] != 0x01) && (buffer[i+1] != 0x01)) {
+	       temp = (buffer[i] + 31) * 8;
+	       if(temp > SiS_Pr->CP_MaxX) SiS_Pr->CP_MaxX = temp;
+	       switch((buffer[i+1] & 0xc0) >> 6) {
+	       case 0x03: temp = temp * 9 / 16; break;
+	       case 0x02: temp = temp * 4 / 5;  break;
+	       case 0x01: temp = temp * 3 / 4;  break;
+	       }
+	       if(temp > SiS_Pr->CP_MaxY) SiS_Pr->CP_MaxY = temp;
+	    }
+	 }
+
+	 /* Now extract the Detailed Timings and convert them into modes */
+
+         for(i = 0; i < 4; i++, base += 18) {
+
+	    /* Is this a detailed timing block or a monitor descriptor? */
+	    if(buffer[base] || buffer[base+1] || buffer[base+2]) {
+
+      	       xres = buffer[base+2] | ((buffer[base+4] & 0xf0) << 4);
+               yres = buffer[base+5] | ((buffer[base+7] & 0xf0) << 4);
+
+	       SiS_Pr->CP_HDisplay[i] = xres;
+	       SiS_Pr->CP_HSyncStart[i] = xres + (buffer[base+8] | ((buffer[base+11] & 0xc0) << 2));
+               SiS_Pr->CP_HSyncEnd[i]   = SiS_Pr->CP_HSyncStart[i] + (buffer[base+9] | ((buffer[base+11] & 0x30) << 4));
+	       SiS_Pr->CP_HTotal[i] = xres + (buffer[base+3] | ((buffer[base+4] & 0x0f) << 8));
+	       SiS_Pr->CP_HBlankStart[i] = xres + 1;
+	       SiS_Pr->CP_HBlankEnd[i] = SiS_Pr->CP_HTotal[i];
+
+	       SiS_Pr->CP_VDisplay[i] = yres;
+               SiS_Pr->CP_VSyncStart[i] = yres + (((buffer[base+10] & 0xf0) >> 4) | ((buffer[base+11] & 0x0c) << 2));
+               SiS_Pr->CP_VSyncEnd[i] = SiS_Pr->CP_VSyncStart[i] + ((buffer[base+10] & 0x0f) | ((buffer[base+11] & 0x03) << 4));
+	       SiS_Pr->CP_VTotal[i] = yres + (buffer[base+6] | ((buffer[base+7] & 0x0f) << 8));
+	       SiS_Pr->CP_VBlankStart[i] = yres + 1;
+	       SiS_Pr->CP_VBlankEnd[i] = SiS_Pr->CP_VTotal[i];
+
+	       SiS_Pr->CP_Clock[i] = (buffer[base] | (buffer[base+1] << 8)) * 10;
+
+	       SiS_Pr->CP_DataValid[i] = TRUE;
+
+	       /* Sort out invalid timings, interlace and too high clocks */
+	       if((SiS_Pr->CP_HDisplay[i] & 7)						||
+	          (SiS_Pr->CP_HDisplay[i] > SiS_Pr->CP_HSyncStart[i])  			||
+	          (SiS_Pr->CP_HDisplay[i] >= SiS_Pr->CP_HSyncEnd[i])   			||
+	          (SiS_Pr->CP_HDisplay[i] >= SiS_Pr->CP_HTotal[i])     			||
+	          (SiS_Pr->CP_HSyncStart[i] >= SiS_Pr->CP_HSyncEnd[i]) 			||
+	          (SiS_Pr->CP_HSyncStart[i] > SiS_Pr->CP_HTotal[i])    			||
+	          (SiS_Pr->CP_HSyncEnd[i] > SiS_Pr->CP_HTotal[i])      			||
+	          (SiS_Pr->CP_VDisplay[i] > SiS_Pr->CP_VSyncStart[i])  			||
+	          (SiS_Pr->CP_VDisplay[i] >= SiS_Pr->CP_VSyncEnd[i])   			||
+	          (SiS_Pr->CP_VDisplay[i] >= SiS_Pr->CP_VTotal[i])     			||
+	          (SiS_Pr->CP_VSyncStart[i] > SiS_Pr->CP_VSyncEnd[i])  			||
+	          (SiS_Pr->CP_VSyncStart[i] > SiS_Pr->CP_VTotal[i])    			||
+	          (SiS_Pr->CP_VSyncEnd[i] > SiS_Pr->CP_VTotal[i])      			||
+		  (((pSiS->VBFlags & VB_301C) && (SiS_Pr->CP_Clock[i] > 162500)) ||
+	           ((!(pSiS->VBFlags & VB_301C)) && (SiS_Pr->CP_Clock[i] > 108200)))	||
+		  (buffer[base+17] & 0x80)) {
+
+	          SiS_Pr->CP_DataValid[i] = FALSE;
+
+	       } else {
+
+	          paneltype = Panel_Custom;
+
+		  SiS_Pr->CP_HaveCustomData = TRUE;
+
+		  if(xres > SiS_Pr->CP_MaxX) SiS_Pr->CP_MaxX = xres;
+	          if(yres > SiS_Pr->CP_MaxY) SiS_Pr->CP_MaxY = yres;
+		  if(SiS_Pr->CP_Clock[i] > SiS_Pr->CP_MaxClock) SiS_Pr->CP_MaxClock = SiS_Pr->CP_Clock[i];
+
+		  SiS_Pr->CP_Vendor = buffer[9] | (buffer[8] << 8);
+		  SiS_Pr->CP_Product = buffer[10] | (buffer[11] << 8);
+
+		  /* By default we drive the LCD at 75Hz in 640x480 mode; if
+		   * the panel does not provide this mode, use 60hz
+		   */
+		  if(!(buffer[0x23] & 0x04)) SiS_Pr->CP_Supports64048075 = FALSE;
+
+	          /* We must assume the panel can scale, since we have
+	           * no scaling data
+		   */
+	          checkexpand = FALSE;
+	          cr37 |= 0x10;
+
+	          /* Extract the sync polarisation information. This only works
+	           * if the Flags indicate a digital separate output.
+	           */
+	          if((buffer[base+17] & 0x18) == 0x18) {
+		     SiS_Pr->CP_HSync_P[i] = (buffer[base+17] & 0x02) ? TRUE : FALSE;
+		     SiS_Pr->CP_VSync_P[i] = (buffer[base+17] & 0x04) ? TRUE : FALSE;
+		     SiS_Pr->CP_SyncValid[i] = TRUE;
+		     if(!havesync) {
+	                cr37 |= ((((buffer[base+17] & 0x06) ^ 0x06) << 5) | 0x20);
+			havesync = TRUE;
+	   	     }
+	          } else {
+		     SiS_Pr->CP_SyncValid[i] = FALSE;
+		  }
+	       }
+            }
+	 }
+	 if(!havesync) {
+	    xf86DrvMsg(pSiS->pScrn->scrnIndex, X_WARNING,
+	       	   "CRT2: Unable to retrieve Sync polarity information\n");
+   	 }
       }
-      
-      if(checkexpand) {
-         /* If any of the Established low-res modes is supported, the 
+
+      if(paneltype && checkexpand) {
+         /* If any of the Established low-res modes is supported, the
 	  * panel can scale automatically. For 800x600 panels, we only 
 	  * check the even lower ones.
 	  */
-	 if(paneltype == Panel310_800x600) {
+	 if(paneltype == Panel_800x600) {
 	    if(buffer[0x23] & 0xfc) cr37 |= 0x10;
 	 } else {
             if(buffer[0x23])	    cr37 |= 0x10;
@@ -10248,6 +10634,13 @@
    case 3:							/* Analyze EDID V2 */
    case 4:
       index = 0;
+
+      if(!(checkedid2(buffer))) {
+         xf86DrvMsg(pSiS->pScrn->scrnIndex, X_PROBED,
+	 	"CRT2: EDID corrupt\n");
+	 return 0;
+      }
+
       if((buffer[0x41] & 0x0f) == 0x03) {
          index = 0x42 + 3;
          xf86DrvMsg(pSiS->pScrn->scrnIndex, X_PROBED,
@@ -10262,20 +10655,31 @@
 		buffer[0x41]);
 	 return 0;
       }
-   
-      xres = buffer[0x76] | (buffer[0x77] << 8);
-      yres = buffer[0x78] | (buffer[0x79] << 8);
+
+      paneltype = Panel_Custom;
+      SiS_Pr->CP_MaxX = xres = buffer[0x76] | (buffer[0x77] << 8);
+      SiS_Pr->CP_MaxY = yres = buffer[0x78] | (buffer[0x79] << 8);
       switch(xres) {
          case 800:
 	     if(yres == 600) {
-	     	paneltype = Panel310_800x600;
+	     	paneltype = Panel_800x600;
 	     	checkexpand = TRUE;
 	     }
 	     break;
          case 1024:
 	     if(yres == 768) {
-	     	paneltype = Panel310_1024x768;
-	     	checkexpand = FALSE;			/* Bug at 640x480; we do the scaling ourselves */
+	     	paneltype = Panel_1024x768;
+	     	checkexpand = TRUE;
+	     }
+	     break;
+	 case 1152:
+	     if(yres == 768) {
+	        if(pSiS->VGAEngine == SIS_300_VGA) {
+		   paneltype = Panel300_1152x768;
+		} else {
+		   paneltype = Panel310_1152x768;
+		}
+	     	checkexpand = TRUE;
 	     }
 	     break;
 	 case 1280:
@@ -10286,51 +10690,49 @@
 		   paneltype = Panel300_1280x960;
 		}
 	     } else if(yres == 1024) {
-	     	paneltype = Panel310_1280x1024;  
+	     	paneltype = Panel_1280x1024;
 		checkexpand = TRUE;
-	     } else if(pSiS->VGAEngine == SIS_315_VGA) {
-	        if(yres == 768) {
-	       	   paneltype = Panel310_1280x768; 	/* Panel size 1280x768 not supported yet */
-		   checkexpand = TRUE;
-	        }
-	     } 
+	     }
+	     /* 1280x768 treated as custom here */
 	     break;
 	 case 1400:
 	     if(pSiS->VGAEngine == SIS_315_VGA) {
 	        if(yres == 1050) {
 	           paneltype = Panel310_1400x1050;
 		   checkexpand = TRUE;
-	        } 
+	        }
 	     }
       	     break;
+#if 0    /* Treat this one as custom since we have no timing data yet */
 	 case 1600:
 	     if(pSiS->VGAEngine == SIS_315_VGA) {
 	        if(yres == 1200) {
 	           paneltype = Panel310_1600x1200;
 		   checkexpand = TRUE;
-	        } 
+	        }
 	     }
       	     break;
+#endif
       }
-                 
+
       /* Determine if RGB18 or RGB24 */
       if(index) {
          if((buffer[index] == 0x20) || (buffer[index] == 0x34)) {
 	    cr37 |= 0x01;
 	 }
       }
-      
+
       if(checkexpand) {
          /* TODO - for now, we let the panel scale */
 	 cr37 |= 0x10;
       }
-     
+
       /* Now seek 4-Byte Timing codes and extract sync pol info */
       index = 0x80;
       if(buffer[0x7e] & 0x20) {			    /* skip Luminance Table (if provided) */
          lumsize = buffer[0x80] & 0x1f;
 	 if(buffer[0x80] & 0x80) lumsize *= 3;
-	 lumsize++;
+	 lumsize++;  /* luminance header byte */
 	 index += lumsize;
       }
       index += (((buffer[0x7e] & 0x1c) >> 2) * 8);   /* skip Frequency Ranges */
@@ -10346,34 +10748,127 @@
 	 if(buffer[myindex] == seekcode) {
 	    cr37 |= ((((buffer[myindex + 1] & 0x0c) ^ 0x0c) << 4) | 0x20);
 	 } else {
-	    xf86DrvMsg(pSiS->pScrn->scrnIndex, X_WARNING, 
-	    	"CRT2: Unable to retrieve Sync polarity information\n");    
+	    xf86DrvMsg(pSiS->pScrn->scrnIndex, X_WARNING,
+	        "CRT2: Unable to retrieve Sync polarity information\n");
 	 }
       } else {
-         xf86DrvMsg(pSiS->pScrn->scrnIndex, X_WARNING, 
-	    	"CRT2: Unable to retrieve Sync polarity information\n");
+         xf86DrvMsg(pSiS->pScrn->scrnIndex, X_WARNING,
+	     "CRT2: Unable to retrieve Sync polarity information\n");
+      }
+
+      /* Now seek the detailed timing descriptions for custom panels */
+      if(paneltype == Panel_Custom) {
+
+         SiS_Pr->CP_Supports64048075 = TRUE;
+
+         index += (numcodes * 4);
+	 numcodes = buffer[0x7f] & 0x07;
+	 for(i=0; i<numcodes; i++, index += 18) {
+	    xres = buffer[index+2] | ((buffer[index+4] & 0xf0) << 4);
+            yres = buffer[index+5] | ((buffer[index+7] & 0xf0) << 4);
+
+	    SiS_Pr->CP_HDisplay[i] = xres;
+	    SiS_Pr->CP_HSyncStart[i] = xres + (buffer[index+8] | ((buffer[index+11] & 0xc0) << 2));
+            SiS_Pr->CP_HSyncEnd[i] = SiS_Pr->CP_HSyncStart[i] + (buffer[index+9] | ((buffer[index+11] & 0x30) << 4));
+	    SiS_Pr->CP_HTotal[i] = xres + (buffer[index+3] | ((buffer[index+4] & 0x0f) << 8));
+	    SiS_Pr->CP_HBlankStart[i] = xres + 1;
+	    SiS_Pr->CP_HBlankEnd[i] = SiS_Pr->CP_HTotal[i];
+
+	    SiS_Pr->CP_VDisplay[i] = yres;
+            SiS_Pr->CP_VSyncStart[i] = yres + (((buffer[index+10] & 0xf0) >> 4) | ((buffer[index+11] & 0x0c) << 2));
+            SiS_Pr->CP_VSyncEnd[i] = SiS_Pr->CP_VSyncStart[i] + ((buffer[index+10] & 0x0f) | ((buffer[index+11] & 0x03) << 4));
+	    SiS_Pr->CP_VTotal[i] = yres + (buffer[index+6] | ((buffer[index+7] & 0x0f) << 8));
+	    SiS_Pr->CP_VBlankStart[i] = yres + 1;
+	    SiS_Pr->CP_VBlankEnd[i] = SiS_Pr->CP_VTotal[i];
+
+	    SiS_Pr->CP_Clock[i] = (buffer[index] | (buffer[index+1] << 8)) * 10;
+
+	    SiS_Pr->CP_DataValid[i] = TRUE;
+
+	    if((SiS_Pr->CP_HDisplay[i] & 7)						||
+	       (SiS_Pr->CP_HDisplay[i] > SiS_Pr->CP_HSyncStart[i])  			||
+	       (SiS_Pr->CP_HDisplay[i] >= SiS_Pr->CP_HSyncEnd[i])   			||
+	       (SiS_Pr->CP_HDisplay[i] >= SiS_Pr->CP_HTotal[i])     			||
+	       (SiS_Pr->CP_HSyncStart[i] >= SiS_Pr->CP_HSyncEnd[i]) 			||
+	       (SiS_Pr->CP_HSyncStart[i] > SiS_Pr->CP_HTotal[i])    			||
+	       (SiS_Pr->CP_HSyncEnd[i] > SiS_Pr->CP_HTotal[i])      			||
+	       (SiS_Pr->CP_VDisplay[i] > SiS_Pr->CP_VSyncStart[i])  			||
+	       (SiS_Pr->CP_VDisplay[i] >= SiS_Pr->CP_VSyncEnd[i])   			||
+	       (SiS_Pr->CP_VDisplay[i] >= SiS_Pr->CP_VTotal[i])     			||
+	       (SiS_Pr->CP_VSyncStart[i] > SiS_Pr->CP_VSyncEnd[i])  			||
+	       (SiS_Pr->CP_VSyncStart[i] > SiS_Pr->CP_VTotal[i])    			||
+	       (SiS_Pr->CP_VSyncEnd[i] > SiS_Pr->CP_VTotal[i])      			||
+	       (((pSiS->VBFlags & VB_301C) && (SiS_Pr->CP_Clock[i] > 162500)) ||
+	        ((!(pSiS->VBFlags & VB_301C)) && (SiS_Pr->CP_Clock[i] > 108200)))	||
+	       (buffer[index + 17] & 0x80)) {
+
+	       SiS_Pr->CP_DataValid[i] = FALSE;
+
+	    } else {
+
+	       SiS_Pr->CP_HaveCustomData = TRUE;
+
+	       if(SiS_Pr->CP_Clock[i] > SiS_Pr->CP_MaxClock) SiS_Pr->CP_MaxClock = SiS_Pr->CP_Clock[i];
+
+	       SiS_Pr->CP_HSync_P[i] = (buffer[index + 17] & 0x02) ? TRUE : FALSE;
+	       SiS_Pr->CP_VSync_P[i] = (buffer[index + 17] & 0x04) ? TRUE : FALSE;
+	       SiS_Pr->CP_SyncValid[i] = TRUE;
+
+	       SiS_Pr->CP_Vendor = buffer[2] | (buffer[1] << 8);
+	       SiS_Pr->CP_Product = buffer[3] | (buffer[4] << 8);
+
+	       /* We must assume the panel can scale, since we have
+	        * no scaling data
+    	        */
+	       cr37 |= 0x10;
+
+	    }
+	 }
+
       }
 
       break;
-     
+
    }
-   
+
    /* 1280x960 panels are always RGB24, unable to scale and use
     * high active sync polarity
     */
    if(pSiS->VGAEngine == SIS_315_VGA) {
-      if(paneltype == Panel310_1280x960) cr37 &= 0x0e; 
+      if(paneltype == Panel310_1280x960) cr37 &= 0x0e;
    } else {
-      if(paneltype == Panel300_1280x960) cr37 &= 0x0e; 
+      if(paneltype == Panel300_1280x960) cr37 &= 0x0e;
    }
-   
+
+   for(i = 0; i < 7; i++) {
+      if(SiS_Pr->CP_DataValid[i]) {
+         xf86DrvMsg(pSiS->pScrn->scrnIndex, X_PROBED,
+            "Non-standard LCD timing data no. %d:\n", i);
+         xf86DrvMsg(pSiS->pScrn->scrnIndex, X_PROBED,
+	    "   HDisplay %d HSync %d HSyncEnd %d HTotal %d\n",
+	    SiS_Pr->CP_HDisplay[i], SiS_Pr->CP_HSyncStart[i],
+	    SiS_Pr->CP_HSyncEnd[i], SiS_Pr->CP_HTotal[i]);
+         xf86DrvMsg(pSiS->pScrn->scrnIndex, X_PROBED,
+            "   VDisplay %d VSync %d VSyncEnd %d VTotal %d\n",
+            SiS_Pr->CP_VDisplay[i], SiS_Pr->CP_VSyncStart[i],
+   	    SiS_Pr->CP_VSyncEnd[i], SiS_Pr->CP_VTotal[i]);
+         xf86DrvMsg(pSiS->pScrn->scrnIndex, X_PROBED,
+	    "   Pixel clock: %3.3fMhz\n", (float)SiS_Pr->CP_Clock[i] / 1000);
+	 xf86DrvMsg(pSiS->pScrn->scrnIndex, X_INFO,
+	    "   To use this, add \"%dx%d\" to the list of Modes in the Screen section\n",
+	    SiS_Pr->CP_HDisplay[i],
+	    SiS_Pr->CP_VDisplay[i]);
+      }
+   }
+
    if(paneltype) {
+       if(!SiS_Pr->CP_PreferredX) SiS_Pr->CP_PreferredX = SiS_Pr->CP_MaxX;
+       if(!SiS_Pr->CP_PreferredY) SiS_Pr->CP_PreferredY = SiS_Pr->CP_MaxY;
        cr37 &= 0xf1;
-       cr37 |= 0x02;    /* SiS301 */
        SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x36,0xf0,paneltype);
-       SiS_SetReg1(SiS_Pr->SiS_P3d4,0x37,cr37);
+       SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x37,0xf1,cr37);
        SiS_SetRegOR(SiS_Pr->SiS_P3d4,0x32,0x08);
-#ifdef TWDEBUG       
+#ifdef TWDEBUG
        xf86DrvMsgVerb(pSiS->pScrn->scrnIndex, X_PROBED, 3, 
        	"CRT2: [DDC LCD results: 0x%02x, 0x%02x]\n", paneltype, cr37);
 #endif	
@@ -10389,10 +10884,9 @@
    int retry;
    unsigned char buffer[256];
 
-   if(!(pSiS->VBFlags & (VB_301|VB_301B|VB_302B))) return 0;
-/* if(pSiS->VBFlags & VB_30xBDH) return 0;  */
-   
-   if(SiS_InitDDCRegs(SiS_Pr, pSiS, 2, 0, FALSE) == 0xFFFF) return 0;
+   if(!(pSiS->VBFlags & (VB_301|VB_301B|VB_301C|VB_302B))) return 0;
+
+   if(SiS_InitDDCRegs(SiS_Pr, pSiS->VBFlags, pSiS->VGAEngine, 2, 0, FALSE) == 0xFFFF) return 0;
    
    SiS_Pr->SiS_DDC_SecAddr = 0x00;
    
@@ -10408,346 +10902,163 @@
       SiS_Pr->SiS_DDC_DeviceAddr = 0xa0;	/* EDID V1 */
       DDCdatatype = 1;
    } else {
-   	xf86DrvMsg(pSiS->pScrn->scrnIndex, X_INFO, 
-		"Do DDC answer\n");
-   	return 0;				/* no DDC support (or no device attached) */
-   }
-   
-   /* Read the entire EDID */
-   retry = 2;
-   do {
-      if(SiS_ReadDDC(SiS_Pr, pSiS, DDCdatatype, buffer)) {
-         xf86DrvMsg(pSiS->pScrn->scrnIndex, X_INFO, 
-	 	"CRT2: DDC read failed (attempt %d), %s\n", 
-		(3-retry), (retry == 1) ? "giving up" : "retrying");
-	 retry--;
-	 if(retry == 0) return 0xFFFF;
-      } else break;
-   } while(1);
-   
-   /* Analyze EDID. We don't have many chances to 
-    * distinguish a flat panel from a CRT...
-    */
-   switch(DDCdatatype) {
-   case 1:
-      if(buffer[0x14] & 0x80) {			/* Display uses digital input */
-          xf86DrvMsg(pSiS->pScrn->scrnIndex, X_PROBED,
-	  	"CRT2: Attached display expects digital input\n");
-      	  return 0;  	
-      }
-      foundcrt = TRUE;
-      break;
-   case 3:
-   case 4:
-      if( ((buffer[0x41] & 0x0f) != 0x01) &&  	/* Display does not support analog input */
-          ((buffer[0x41] & 0x0f) != 0x02) &&
-	  ((buffer[0x41] & 0xf0) != 0x10) &&
-	  ((buffer[0x41] & 0xf0) != 0x20) ) {
-	  xf86DrvMsg(pSiS->pScrn->scrnIndex, X_PROBED,
-	     	"CRT2: Attached display does not support analog input (0x%02x)\n",
-		buffer[0x41]);
-	  return 0;
-      }
-      foundcrt = TRUE;
-      break;	  
-   }
-   
-   if(foundcrt) {
-       SiS_SetRegOR(SiS_Pr->SiS_P3d4,0x32,0x10);
-   }
-   return(0);
-}
-
-#if 0
-   /* ----- */
-USHORT
-SiS_SenseLCDDDC(SiS_Private *SiS_Pr, SISPtr pSiS)
-{
-   USHORT DDCdatatype, paneltype, flag;
-   unsigned char cr36=0, cr37=0;
-   unsigned char tempal, tempah, tempbl, tempbh;
-   USHORT tempax, tempbx, tempcx, push1, push2, push3;
-   unsigned char addresstable[] = { 0x00, 0x22, 0x30, 0x40 };
-   int i;
-   unsigned char buffer[256];
-   
-   if(pSiS->VGAEngine != SIS_315_VGA) return 0xFFFF;
-   if(!(pSiS->VBFlags & (VB_301B|VB_302B))) return 0xFFFF;
-   
-   if(SiS_InitDDCRegs(SiS_Pr, pSiS, 1, 0, FALSE) == 0xFFFF) return 0xFFFF;   
-   
-   flag = SiS_ProbeDDC(SiS_Pr);
-   if(flag & 0x02) {
-      SiS_Pr->SiS_DDC_DeviceAddr = 0xa0;	/* EDID V1 */
-      DDCdatatype = 1;
-      SiS_Pr->SiS_DDC_SecAddr = 0x3a;
-   } else if(flag & 0x08) {
-      SiS_Pr->SiS_DDC_DeviceAddr = 0xa2;	/* EDID V2 (P&D-D Monitor) */
-      DDCdatatype = 3;
-      SiS_Pr->SiS_DDC_SecAddr = 0x76;
-   } else if(flag & 0x10) {
-      SiS_Pr->SiS_DDC_DeviceAddr = 0xa6;	/* EDID V2 (FP) */
-      DDCdatatype = 4;
-      SiS_Pr->SiS_DDC_SecAddr = 0x76;
-   } else return 0xFFFF;
-   
-   
-   SiS_ReadLCDDDC(SiS_Pr, 4, buffer);
-   tempbl = buffer[0];  /* 3a - 76 */
-   tempbh = buffer[1];  /* 3b - 77 */
-   
-   if(SiS_Pr->SiS_DDC_DeviceAddr == 0xa0) {
-   
-      /* Read and analyze EDID V1 (res) */
-   
-      tempah = 0x02;				/* 1024x768 by default */
-      tempbl &= 0xf0;
-      if(tempbl != 0x40) {			
-         tempah = 0x03;				/* 1280x1024 by default */
-	 if(tempbl == 0x50) {
-	    if(!tempbh) {
-	       tempbh = buffer[3] & 0xf0;
-	       if(tempbh == 0x30) {
-	           SiS_Pr->SiS_DDC_DeviceAddr = 0xa0;
-      		   SiS_Pr->SiS_DDC_SecAddr = 0x23;
-		   SiS_ReadLCDDDC(SiS_Pr, 2, buffer);
-		   tempbl = buffer[0];  /* 0x23 */
-		   tempbh = buffer[1];  /* 0x24 */
-		   if(tempbl) cr37 |= 0x10;
-		   tempah = 0x0a;		/* 1280x768 */
-	       }
-	       if(tempbh == 0x40) {
-	           SiS_Pr->SiS_DDC_DeviceAddr = 0xa0;
-      		   SiS_Pr->SiS_DDC_SecAddr = 0x23;
-		   SiS_ReadLCDDDC(SiS_Pr, 2, buffer);
-		   tempbl = buffer[0];  /* 0x23 */
-		   tempbh = buffer[1];  /* 0x24 */
-		   if(tempbl) cr37 |= 0x10;
-		   tempah = 0x03;		/* 1280x1024 */
-	       }
-	       tempbh = 0x00;
-	    }
-	 }
-	 if(tempbh == 0x00) goto cr36ready;
-	 tempah = 0x07;				/* 1280x960 */
-	 if(tempbh == 0xc0) goto cr36ready;
-      }
-      SiS_Pr->SiS_DDC_DeviceAddr = 0xa0;
-      SiS_Pr->SiS_DDC_SecAddr = 0x18;		/* feature support */
-      SiS_ReadLCDDDC(SiS_Pr, 2, buffer);
-      tempbl = buffer[0];
-      tempbh = buffer[1];
-      if(tempbl & 0x02) goto cr36ready;
-      SiS_Pr->SiS_DDC_DeviceAddr = 0xa0;
-      SiS_Pr->SiS_DDC_SecAddr = 0x23;		/* Established Timings */
-      SiS_ReadLCDDDC(SiS_Pr, 2, buffer);
-      tempbl = buffer[0];
-      tempbh = buffer[1];
-      tempah = 0x03;
-      if(!(tempbh & 0x01)) tempah = 0x02;
-      if(!tempbl) cr37 |= 0x10;
-      
-  } else {
-  
-      /* Read and analyze EDID V2 (res) */
-      
-      tempah = 0x02;
-      tempbx = tempbl | (tempbh << 8);
-      if(tempbx != 1024) tempah = 0x03;
-      
-  }     
-
-cr36ready:
-  cr36 = tempah;      
-  
-  if(SiS_Pr->SiS_DDC_DeviceAddr == 0xa0) {
-  
-     /* Read and analyze EDID V1 (pol) */
-  
-     SiS_Pr->SiS_DDC_SecAddr = 0x47;
-     SiS_ReadLCDDDC(SiS_Pr, 2, buffer);
-     tempah = buffer[0];
-     tempah &= 0x06;
-     tempah ^= 0x06;
-     tempah <<= 5;
-     tempah |= 0x20;
-     cr37 &= 0x1f;
-     cr37 |= tempah;
-     if((cr36 & 0x07) == 0x07) cr37 &= 0x0e;
-     
-  } else {
-  
-     /* Read and analyze EDID V2 (depth, pol) */
-  
-     push1 = tempah;
-     SiS_Pr->SiS_DDC_SecAddr = 0x45;
-     SiS_ReadLCDDDC(SiS_Pr, 2, buffer);
-     tempah = 0x01;
-     if((buffer[0] != 0x20) && (buffer[0] != 0x34)) {   /* RGB18 or 24? */
-        tempah = 0x00;
-     }
-     cr37 &= 0xfe;
-     cr37 |= tempah;
-     
-     SiS_Pr->SiS_DDC_SecAddr = 0x7e;
-     SiS_ReadLCDDDC(SiS_Pr, 2, buffer);
-     tempax = (USHORT)(buffer[0] | (buffer[1] << 8));
-     push2 = tempax;
-     tempax &= 0x0003;
-     tempax *= 0x1b;
-     push3 = tempax;
-     tempax = (USHORT)buffer[0];
-     tempax &= 0x001c;
-     tempax >>= 2;
-     tempax *= 8;
-     tempbx = push3;
-     tempbx += tempax;
-     if(buffer[0] & 0x20) {		/* Luminance table provided? */
-        SiS_Pr->SiS_DDC_SecAddr = 0x80;
-	SiS_ReadLCDDDC(SiS_Pr, 2, buffer);
-	tempax = buffer[0] | (buffer[1] << 8);
-	tempax &= 0x1f;
-	if(buffer[0] & 0x70) tempax <<= 1;
-	tempax++;	
-	tempbx += tempax;        	/* yes -> skip it */
-     }
-     tempcx = push2;
-     tempax = push1 << 8;
-     tempbx = (tempbx & 0xff00) | (((tempbx & 0x00ff) + 0x80) & 0x00ff);
-     if(tempcx & 0xf800) {
-        tempal = addresstable[((tempax & 0xff00) >> 8)];
-	tempcx &= 0xf8ff;
-	tempcx >>= 11;
-	for(i=0; i<tempcx; i++) {
-	   SiS_Pr->SiS_DDC_SecAddr = (tempbx & 0x00ff);
-	   SiS_ReadLCDDDC(SiS_Pr, 2, buffer);
-	   tempbx += 0x04;
-	   if(buffer[0] == tempal) break;
-	}
-	tempah = buffer[1];
-	tempah &= 0x0c;
-	tempah ^= 0x0c;
-	tempah <<= 4;
-	tempah |= 0x20;
-        cr37 &= 0x1f;
-        cr37 |= tempah;
-	if((cr36 & 0x07) == 0x07) cr37 &= 0x0e;
-     }
-  }
-  xf86DrvMsg(0, X_INFO, "DDC: cr36 = 0x%02x, cr37 = 0x%02x\n", cr36, cr37);
-  return 0;
-}
-#endif
-
-/* TW: Generic I2C functions (compliant to i2c library) */
-
-#if 0
-USHORT
-SiS_I2C_GetByte(SiS_Private *SiS_Pr)
-{
-   return(SiS_ReadDDC2Data(SiS_Pr,0));
-}
+   	xf86DrvMsg(pSiS->pScrn->scrnIndex, X_PROBED,
+		"Do DDC answer\n");
+   	return 0;				/* no DDC support (or no device attached) */
+   }
 
-Bool
-SiS_I2C_PutByte(SiS_Private *SiS_Pr, USHORT data)
-{
-   if(SiS_WriteDDC2Data(SiS_Pr,data)) return FALSE;
-   return TRUE;
-}
+   /* Read the entire EDID */
+   retry = 2;
+   do {
+      if(SiS_ReadDDC(SiS_Pr, DDCdatatype, buffer)) {
+         xf86DrvMsg(pSiS->pScrn->scrnIndex, X_PROBED,
+	 	"CRT2: DDC read failed (attempt %d), %s\n",
+		(3-retry), (retry == 1) ? "giving up" : "retrying");
+	 retry--;
+	 if(retry == 0) return 0xFFFF;
+      } else break;
+   } while(1);
 
-Bool
-SiS_I2C_Address(SiS_Private *SiS_Pr, USHORT addr)
-{
-   if(SiS_SetStart(SiS_Pr)) return FALSE;
-   if(SiS_WriteDDC2Data(SiS_Pr,addr)) return FALSE;
-   return TRUE;
-}
+   /* Analyze EDID. We don't have many chances to
+    * distinguish a flat panel from a CRT...
+    */
+   switch(DDCdatatype) {
+   case 1:
+      if(!(checkedid1(buffer))) {
+          xf86DrvMsg(pSiS->pScrn->scrnIndex, X_PROBED,
+	  	"CRT2: EDID corrupt\n");
+      	  return 0;
+      }
+      if(buffer[0x14] & 0x80) {			/* Display uses digital input */
+          xf86DrvMsg(pSiS->pScrn->scrnIndex, X_PROBED,
+	  	"CRT2: Attached display expects digital input\n");
+      	  return 0;
+      }
+      SiS_Pr->CP_Vendor = buffer[9] | (buffer[8] << 8);
+      SiS_Pr->CP_Product = buffer[10] | (buffer[11] << 8);
+      foundcrt = TRUE;
+      break;
+   case 3:
+   case 4:
+      if(!(checkedid2(buffer))) {
+          xf86DrvMsg(pSiS->pScrn->scrnIndex, X_PROBED,
+	  	"CRT2: EDID corrupt\n");
+      	  return 0;
+      }
+      if( ((buffer[0x41] & 0x0f) != 0x01) &&  	/* Display does not support analog input */
+          ((buffer[0x41] & 0x0f) != 0x02) &&
+	  ((buffer[0x41] & 0xf0) != 0x10) &&
+	  ((buffer[0x41] & 0xf0) != 0x20) ) {
+	  xf86DrvMsg(pSiS->pScrn->scrnIndex, X_PROBED,
+	     	"CRT2: Attached display does not support analog input (0x%02x)\n",
+		buffer[0x41]);
+	  return 0;
+      }
+      SiS_Pr->CP_Vendor = buffer[2] | (buffer[1] << 8);
+      SiS_Pr->CP_Product = buffer[3] | (buffer[4] << 8);
+      foundcrt = TRUE;
+      break;
+   }
 
-void
-SiS_I2C_Stop(SiS_Private *SiS_Pr)
-{
-   SiS_SetStop(SiS_Pr);
+   if(foundcrt) {
+      SiS_SetRegOR(SiS_Pr->SiS_P3d4,0x32,0x10);
+   }
+   return(0);
 }
-#endif
 
 #endif
 
 void
 SiS_SetCH70xxANDOR(SiS_Private *SiS_Pr, USHORT tempax,USHORT tempbh)
 {
-  USHORT tempal,tempah,tempbl;
+  USHORT tempbl;
 
-  tempal = tempax & 0x00FF;
-  tempah =(tempax >> 8) & 0x00FF;
-  tempbl = SiS_GetCH70xx(SiS_Pr,tempal);
-  tempbl = (((tempbl & tempbh) | tempah) << 8 | tempal);
+  tempbl = SiS_GetCH70xx(SiS_Pr,(tempax & 0x00FF));
+  tempbl = (((tempbl & tempbh) << 8) | tempax);
   SiS_SetCH70xx(SiS_Pr,tempbl);
 }
 
-/* TW: Generic I2C functions for Chrontel --------- */
+/* Generic I2C functions for Chrontel & DDC --------- */
 
 void
 SiS_SetSwitchDDC2(SiS_Private *SiS_Pr)
 {
   SiS_SetSCLKHigh(SiS_Pr);
-  /* SiS_DDC2Delay(SiS_Pr,SiS_I2CDELAY); */
-  SiS_WaitRetraceDDC(SiS_Pr);
+  SiS_WaitRetrace1(SiS_Pr);
 
   SiS_SetSCLKLow(SiS_Pr);
-  /* SiS_DDC2Delay(SiS_Pr,SiS_I2CDELAY); */
-  SiS_WaitRetraceDDC(SiS_Pr);
+  SiS_WaitRetrace1(SiS_Pr);
+}
+
+USHORT
+SiS_ReadDDC1Bit(SiS_Private *SiS_Pr)
+{
+   SiS_WaitRetrace1(SiS_Pr);
+   return((SiS_GetReg(SiS_Pr->SiS_P3c4,0x11) & 0x02) >> 1);
 }
 
-/* TW: Set I2C start condition */
-/* TW: This is done by a SD high-to-low transition while SC is high */
+/* Set I2C start condition */
+/* This is done by a SD high-to-low transition while SC is high */
 USHORT
 SiS_SetStart(SiS_Private *SiS_Pr)
 {
-  if(SiS_SetSCLKLow(SiS_Pr)) return 0xFFFF;			           /* TW: (SC->low)  */
-  SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port,SiS_Pr->SiS_DDC_Index,
-                  ~SiS_Pr->SiS_DDC_Data,SiS_Pr->SiS_DDC_Data);             /* TW: SD->high */
-  if(SiS_SetSCLKHigh(SiS_Pr)) return 0xFFFF;			           /* TW: SC->high */
-  SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port,SiS_Pr->SiS_DDC_Index,
-                  ~SiS_Pr->SiS_DDC_Data,0x00);                             /* TW: SD->low = start condition */
-  if(SiS_SetSCLKHigh(SiS_Pr)) return 0xFFFF;			           /* TW: (SC->low) */
+  if(SiS_SetSCLKLow(SiS_Pr)) return 0xFFFF;			           /* (SC->low)  */
+  SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port,
+    		  SiS_Pr->SiS_DDC_Index,
+                  SiS_Pr->SiS_DDC_NData,
+		  SiS_Pr->SiS_DDC_Data);             			   /* SD->high */
+  if(SiS_SetSCLKHigh(SiS_Pr)) return 0xFFFF;			           /* SC->high */
+  SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port,
+  		  SiS_Pr->SiS_DDC_Index,
+                  SiS_Pr->SiS_DDC_NData,
+		  0x00);                             			   /* SD->low = start condition */
+  if(SiS_SetSCLKHigh(SiS_Pr)) return 0xFFFF;			           /* (SC->low) */
   return 0;
 }
 
-/* TW: Set I2C stop condition */
-/* TW: This is done by a SD low-to-high transition while SC is high */
+/* Set I2C stop condition */
+/* This is done by a SD low-to-high transition while SC is high */
 USHORT
 SiS_SetStop(SiS_Private *SiS_Pr)
 {
-  if(SiS_SetSCLKLow(SiS_Pr)) return 0xFFFF;			           /* TW: (SC->low) */
-  SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port,SiS_Pr->SiS_DDC_Index,
-                  ~SiS_Pr->SiS_DDC_Data,0x00);          		   /* TW: SD->low   */
-  if(SiS_SetSCLKHigh(SiS_Pr)) return 0xFFFF;			           /* TW: SC->high  */
-  SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port,SiS_Pr->SiS_DDC_Index,
-                  ~SiS_Pr->SiS_DDC_Data,SiS_Pr->SiS_DDC_Data);  	   /* TW: SD->high = stop condition */
-  if(SiS_SetSCLKHigh(SiS_Pr)) return 0xFFFF;			           /* TW: (SC->high) */
+  if(SiS_SetSCLKLow(SiS_Pr)) return 0xFFFF;			           /* (SC->low) */
+  SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port,
+  	          SiS_Pr->SiS_DDC_Index,
+                  SiS_Pr->SiS_DDC_NData,
+		  0x00);          		   			   /* SD->low   */
+  if(SiS_SetSCLKHigh(SiS_Pr)) return 0xFFFF;			           /* SC->high  */
+  SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port,
+  		  SiS_Pr->SiS_DDC_Index,
+                  SiS_Pr->SiS_DDC_NData,
+		  SiS_Pr->SiS_DDC_Data);  	   			   /* SD->high = stop condition */
+  if(SiS_SetSCLKHigh(SiS_Pr)) return 0xFFFF;			           /* (SC->high) */
   return 0;
 }
 
-/* TW: Write 8 bits of data */
+/* Write 8 bits of data */
 USHORT
 SiS_WriteDDC2Data(SiS_Private *SiS_Pr, USHORT tempax)
 {
   USHORT i,flag,temp;
 
-  flag=0x80;
-  for(i=0;i<8;i++) {
-    SiS_SetSCLKLow(SiS_Pr);				                      /* TW: SC->low */
+  flag = 0x80;
+  for(i=0; i<8; i++) {
+    SiS_SetSCLKLow(SiS_Pr);				                      /* SC->low */
     if(tempax & flag) {
-      SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port,SiS_Pr->SiS_DDC_Index,
-                      ~SiS_Pr->SiS_DDC_Data,SiS_Pr->SiS_DDC_Data);            /* TW: Write bit (1) to SD */
+      SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port,
+      		      SiS_Pr->SiS_DDC_Index,
+                      SiS_Pr->SiS_DDC_NData,
+		      SiS_Pr->SiS_DDC_Data);            		      /* Write bit (1) to SD */
     } else {
-      SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port,SiS_Pr->SiS_DDC_Index,
-                      ~SiS_Pr->SiS_DDC_Data,0x00);                            /* TW: Write bit (0) to SD */
+      SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port,
+      		      SiS_Pr->SiS_DDC_Index,
+                      SiS_Pr->SiS_DDC_NData,
+		      0x00);                            		      /* Write bit (0) to SD */
     }
-    SiS_SetSCLKHigh(SiS_Pr);				                      /* TW: SC->high */
+    SiS_SetSCLKHigh(SiS_Pr);				                      /* SC->high */
     flag >>= 1;
   }
-  temp = SiS_CheckACK(SiS_Pr);				                      /* TW: Check acknowledge */
+  temp = SiS_CheckACK(SiS_Pr);				                      /* Check acknowledge */
   return(temp);
 }
 
@@ -10760,10 +11071,12 @@
   for(i=0; i<8; i++) {
     getdata <<= 1;
     SiS_SetSCLKLow(SiS_Pr);
-    SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port,SiS_Pr->SiS_DDC_Index,
-                    ~SiS_Pr->SiS_DDC_Data,SiS_Pr->SiS_DDC_Data);
+    SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port,
+    		    SiS_Pr->SiS_DDC_Index,
+                    SiS_Pr->SiS_DDC_NData,
+		    SiS_Pr->SiS_DDC_Data);
     SiS_SetSCLKHigh(SiS_Pr);
-    temp = SiS_GetReg1(SiS_Pr->SiS_DDC_Port,SiS_Pr->SiS_DDC_Index);
+    temp = SiS_GetReg(SiS_Pr->SiS_DDC_Port,SiS_Pr->SiS_DDC_Index);
     if(temp & SiS_Pr->SiS_DDC_Data) getdata |= 0x01;
   }
   return(getdata);
@@ -10772,8 +11085,10 @@
 USHORT
 SiS_SetSCLKLow(SiS_Private *SiS_Pr)
 {
-  SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port,SiS_Pr->SiS_DDC_Index,
-                  ~SiS_Pr->SiS_DDC_Clk,0x00);      		/* SetSCLKLow()  */
+  SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port,
+  		  SiS_Pr->SiS_DDC_Index,
+                  SiS_Pr->SiS_DDC_NClk,
+		  0x00);      					/* SetSCLKLow()  */
   SiS_DDC2Delay(SiS_Pr,SiS_I2CDELAYSHORT);
   return 0;
 }
@@ -10781,68 +11096,63 @@
 USHORT
 SiS_SetSCLKHigh(SiS_Private *SiS_Pr)
 {
-  USHORT temp,watchdog=1000;
+  USHORT temp, watchdog=1000;
 
-  SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port,SiS_Pr->SiS_DDC_Index,
-                  ~SiS_Pr->SiS_DDC_Clk,SiS_Pr->SiS_DDC_Clk);  	/* SetSCLKHigh()  */
+  SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port,
+  		  SiS_Pr->SiS_DDC_Index,
+                  SiS_Pr->SiS_DDC_NClk,
+		  SiS_Pr->SiS_DDC_Clk);  			/* SetSCLKHigh()  */
   do {
-    temp = SiS_GetReg1(SiS_Pr->SiS_DDC_Port,SiS_Pr->SiS_DDC_Index);
+    temp = SiS_GetReg(SiS_Pr->SiS_DDC_Port,SiS_Pr->SiS_DDC_Index);
   } while((!(temp & SiS_Pr->SiS_DDC_Clk)) && --watchdog);
   if (!watchdog) {
 #ifdef TWDEBUG
         xf86DrvMsg(0, X_INFO, "SetClkHigh failed\n");
-#endif	   
+#endif
   	return 0xFFFF;
   }
   SiS_DDC2Delay(SiS_Pr,SiS_I2CDELAYSHORT);
   return 0;
 }
 
-void
-SiS_DDC2Delay(SiS_Private *SiS_Pr, USHORT delaytime)
-{
-  USHORT i;
-
-  for(i=0; i<delaytime; i++) {
-    SiS_GetReg1(SiS_Pr->SiS_P3c4,0x05);
-  }
-}
-
-/* TW: Check I2C acknowledge */
+/* Check I2C acknowledge */
 /* Returns 0 if ack ok, non-0 if ack not ok */
 USHORT
 SiS_CheckACK(SiS_Private *SiS_Pr)
 {
   USHORT tempah;
 
-  SiS_SetSCLKLow(SiS_Pr);				           /* TW: (SC->low) */
-  SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port,SiS_Pr->SiS_DDC_Index,
-                  ~SiS_Pr->SiS_DDC_Data,SiS_Pr->SiS_DDC_Data);     /* TW: (SD->high) */
-  SiS_SetSCLKHigh(SiS_Pr);				           /* TW: SC->high = clock impulse for ack */
-  tempah = SiS_GetReg1(SiS_Pr->SiS_DDC_Port,SiS_Pr->SiS_DDC_Index);/* TW: Read SD */
-  SiS_SetSCLKLow(SiS_Pr);				           /* TW: SC->low = end of clock impulse */
-  if(tempah & SiS_Pr->SiS_DDC_Data) return(1);			   /* TW: Ack OK if bit = 0 */
+  SiS_SetSCLKLow(SiS_Pr);				           /* (SC->low) */
+  SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port,
+  		  SiS_Pr->SiS_DDC_Index,
+                  SiS_Pr->SiS_DDC_NData,
+		  SiS_Pr->SiS_DDC_Data);     			   /* (SD->high) */
+  SiS_SetSCLKHigh(SiS_Pr);				           /* SC->high = clock impulse for ack */
+  tempah = SiS_GetReg(SiS_Pr->SiS_DDC_Port,SiS_Pr->SiS_DDC_Index); /* Read SD */
+  SiS_SetSCLKLow(SiS_Pr);				           /* SC->low = end of clock impulse */
+  if(tempah & SiS_Pr->SiS_DDC_Data) return(1);			   /* Ack OK if bit = 0 */
   else return(0);
 }
 
-/* TW: End of I2C functions ----------------------- */
+/* End of I2C functions ----------------------- */
 
 
-/* =============== SiS 310/325/330 O.E.M. ================= */
+/* =============== SiS 315/330 O.E.M. ================= */
 
 #ifdef SIS315H
 
 static USHORT
-GetRAMDACromptr(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, UCHAR *ROMAddr)
+GetRAMDACromptr(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
 {
+  UCHAR  *ROMAddr = HwInfo->pjVirtualRomBase;
   USHORT romptr;
 
-  if(HwDeviceExtension->jChipType < SIS_330) {
-     romptr = ROMAddr[0x128] | (ROMAddr[0x129] << 8);  
+  if(HwInfo->jChipType < SIS_330) {
+     romptr = ROMAddr[0x128] | (ROMAddr[0x129] << 8);
      if(SiS_Pr->SiS_VBType & VB_SIS301B302B)
         romptr = ROMAddr[0x12a] | (ROMAddr[0x12b] << 8);
   } else {
-     romptr = ROMAddr[0x1a8] | (ROMAddr[0x1a9] << 8);  
+     romptr = ROMAddr[0x1a8] | (ROMAddr[0x1a9] << 8);
      if(SiS_Pr->SiS_VBType & VB_SIS301B302B)
         romptr = ROMAddr[0x1aa] | (ROMAddr[0x1ab] << 8);
   }
@@ -10850,16 +11160,17 @@
 }
 
 static USHORT
-GetLCDromptr(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, UCHAR *ROMAddr)
+GetLCDromptr(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
 {
+  UCHAR  *ROMAddr = HwInfo->pjVirtualRomBase;
   USHORT romptr;
 
-  if(HwDeviceExtension->jChipType < SIS_330) {
-     romptr = ROMAddr[0x120] | (ROMAddr[0x121] << 8);  
+  if(HwInfo->jChipType < SIS_330) {
+     romptr = ROMAddr[0x120] | (ROMAddr[0x121] << 8);
      if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV)
         romptr = ROMAddr[0x122] | (ROMAddr[0x123] << 8);
   } else {
-     romptr = ROMAddr[0x1a0] | (ROMAddr[0x1a1] << 8);  
+     romptr = ROMAddr[0x1a0] | (ROMAddr[0x1a1] << 8);
      if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV)
         romptr = ROMAddr[0x1a2] | (ROMAddr[0x1a3] << 8);
   }
@@ -10867,11 +11178,12 @@
 }
 
 static USHORT
-GetTVromptr(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, UCHAR *ROMAddr)
+GetTVromptr(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
 {
+  UCHAR  *ROMAddr = HwInfo->pjVirtualRomBase;
   USHORT romptr;
 
-  if(HwDeviceExtension->jChipType < SIS_330) {
+  if(HwInfo->jChipType < SIS_330) {
      romptr = ROMAddr[0x114] | (ROMAddr[0x115] << 8);
      if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV)
         romptr = ROMAddr[0x11a] | (ROMAddr[0x11b] << 8);
@@ -10884,10 +11196,22 @@
 }
 
 static USHORT
-GetLCDPtrIndexBIOS(SiS_Private *SiS_Pr)
+GetLCDPtrIndexBIOS(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
 {
   USHORT index;
-  
+
+  if((IS_SIS650) && (SiS_Pr->SiS_VBType & VB_SIS301LV302LV)) {
+     if(!(SiS_IsNotM650orLater(SiS_Pr, HwInfo))) {
+        if((index = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) & 0xf0)) {
+	   index >>= 4;
+	   index *= 3;
+	   if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) index += 2;
+           else if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) index++;
+           return index;
+	}
+     }
+  }
+
   index = SiS_Pr->SiS_LCDResInfo & 0x0F;
   if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050)      index -= 5;
   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200) index -= 6;
@@ -10895,7 +11219,6 @@
   index *= 3;
   if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) index += 2;
   else if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) index++;
-
   return index;
 }
 
@@ -10913,44 +11236,82 @@
   return index;
 }
 
-/*
----------------------------------------------------------
-       GetTVPtrIndex()
-          return       0 : NTSC Enhanced/Standard
-                       1 : NTSC Standard TVSimuMode
-                       2 : PAL Enhanced/Standard
-                       3 : PAL Standard TVSimuMode
-                       4 : HiVision Enhanced/Standard
-                       5 : HiVision Standard TVSimuMode
----------------------------------------------------------
-*/
 static USHORT
 GetTVPtrIndex(SiS_Private *SiS_Pr)
 {
   USHORT index;
 
   index = 0;
-  if(SiS_Pr->SiS_VBInfo & SetPALTV) index++;
-  if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVisionTV) index++;  /* Hivision TV use PAL */
+  if(SiS_Pr->SiS_TVMode & TVSetPAL) index = 1;
+  if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) index = 2;
+
+  if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) index = 0;
 
   index <<= 1;
 
-  if((SiS_Pr->SiS_VBInfo & SetInSlaveMode) && (SiS_Pr->SiS_SetFlag & TVSimuMode))
-    index++;
+  if((SiS_Pr->SiS_VBInfo & SetInSlaveMode) &&
+     (SiS_Pr->SiS_TVMode & TVSetTVSimuMode)) {
+     index++;
+  }
 
   return index;
 }
 
+static ULONG
+GetOEMTVPtr661_2(SiS_Private *SiS_Pr)
+{
+   USHORT index = 0, temp = 0;
+
+   if(SiS_Pr->SiS_TVMode & TVSetPAL)   index = 1;
+   if(SiS_Pr->SiS_TVMode & TVSetPALM)  index = 2;
+   if(SiS_Pr->SiS_TVMode & TVSetPALN)  index = 3;
+   if(SiS_Pr->SiS_TVMode & TVSetNTSCJ) index = 6;
+   if(SiS_Pr->SiS_TVMode & TVSetNTSC1024) {
+      index = 4;
+      if(SiS_Pr->SiS_TVMode & TVSetPALM)  index++;
+      if(SiS_Pr->SiS_TVMode & TVSetNTSCJ) index = 7;
+   }
+
+   if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
+      if((!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) ||
+         (SiS_Pr->SiS_TVMode & TVSetTVSimuMode)) {
+	 index += 8;
+	 temp++;
+      }
+      temp += 0x0100;
+   }
+   return(ULONG)(index | (temp << 16));
+}
+
+static int
+GetOEMTVPtr661(SiS_Private *SiS_Pr)
+{
+   int index = 0;
+
+   if(SiS_Pr->SiS_TVMode & TVSetPAL)       index = 2;
+   if(SiS_Pr->SiS_TVMode & TVSetHiVision)  index = 4;
+   if(SiS_Pr->SiS_TVMode & TVSetYPbPr525i) index = 6;
+   if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p) index = 8;
+   if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) index = 10;
+
+   if(SiS_Pr->SiS_TVMode & TVSetTVSimuMode) index++;
+
+   return index;
+}
+
 static void
-SetDelayComp(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT BaseAddr,
-             UCHAR *ROMAddr, USHORT ModeNo)
+SetDelayComp(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, USHORT ModeNo)
 {
-  USHORT delay,index,myindex,temp,romptr=0;
-  
-  if(SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC) {			/* VGA */
+  UCHAR  *ROMAddr = HwInfo->pjVirtualRomBase;
+  USHORT delay=0,index,myindex,temp,romptr=0;
+  BOOLEAN dochiptest = TRUE;
+
+  /* Find delay (from ROM, internal tables, PCI subsystem) */
+
+  if(SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC) {			/* ------------ VGA */
      
      if((ROMAddr) && SiS_Pr->SiS_UseROM) {
-        romptr = GetRAMDACromptr(SiS_Pr, HwDeviceExtension, ROMAddr);
+        romptr = GetRAMDACromptr(SiS_Pr, HwInfo);
 	if(!romptr) return;
 	delay = ROMAddr[romptr];
      } else {
@@ -10960,121 +11321,232 @@
 	      delay = 0x0a;
 	   } else if(IS_SIS740) {
 	      delay = 0x00;
-	   } else if(HwDeviceExtension->jChipType < SIS_330) {
+	   } else if(HwInfo->jChipType < SIS_330) {
 	      delay = 0x0c;
 	   } else {
 	      delay = 0x0c;
 	   }
 	}
-        if(SiS_Pr->SiS_IF_DEF_LVDS == 1)
+        if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
            delay = 0x00;
+	}
      }
-  
-  } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {		/* LCD */
-  
-     index = GetLCDPtrIndexBIOS(SiS_Pr);
-     myindex = GetLCDPtrIndex(SiS_Pr);
-     
-     if(IS_SIS650 && (SiS_Pr->SiS_VBType & VB_SIS301LV302LV)) { 	/* 650+30xLV */
-       if(SiS_IsNotM650or651(SiS_Pr,HwDeviceExtension, BaseAddr)) {
-          if((ROMAddr) && SiS_Pr->SiS_UseROM) {
-#if 0	     /* Always use the second pointer on 650; some BIOSes */
-             /* still carry old 301 data at the first location    */  
-	     romptr = ROMAddr[0x120] | (ROMAddr[0x121] << 8); 
-	     if(SiS_Pr->SiS_VBType & VB_SIS302LV) 
-#endif		
-	        romptr = ROMAddr[0x122] | (ROMAddr[0x123] << 8);
-	     if(!romptr) return;
-	     delay = ROMAddr[(romptr + index)];
-	  } else {
-             delay = SiS310_LCDDelayCompensation_650301B[myindex];   
-#if 0	     
-	     if(SiS_Pr->SiS_VBType & VB_SIS302LV)
-	        delay = SiS310_LCDDelayCompensation_650301B[myindex];
-#endif		
-	  }
-       } else {
-          delay = SiS310_LCDDelayCompensation_651301LV[myindex];     
-	  if(SiS_Pr->SiS_VBType & VB_SIS302LV)
-	     delay = SiS310_LCDDelayCompensation_651302LV[myindex];  
-       }
-     } else {
-        if((ROMAddr) && SiS_Pr->SiS_UseROM && 				/* 315, 330, 740, 650+301B */
-	   (SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel1280x1024)) { 
-           romptr = GetLCDromptr(SiS_Pr, HwDeviceExtension, ROMAddr);
+
+  } else if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD|SetCRT2ToLCDA)) {  /* ----------	LCD/LCDA */
+
+     BOOLEAN gotitfrompci = FALSE;
+
+     if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_PanelCustom) return;
+
+     /* Could we detect a PDC for LCD? If yes, use it */
+
+     if(SiS_Pr->PDC) {
+        if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) {
+	   SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2d,0x0f,((SiS_Pr->PDC & 0x0f) << 4));
+	}
+        return;
+     }
+
+     /* This is a piece of typical SiS crap: They code the OEM LCD
+      * delay into the code, at no defined place in the BIOS.
+      * We now have to start doing a PCI subsystem check here.
+      */
+
+     switch(SiS_Pr->SiS_CustomT) {
+     case CUT_COMPAQ1280:
+     case CUT_COMPAQ12802:
+	if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) {
+	   gotitfrompci = TRUE;
+	   dochiptest = FALSE;
+	   delay = 0x03;
+	}
+	break;
+     case CUT_CLEVO1400:
+     case CUT_CLEVO14002:
+	/* if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) { */
+	   gotitfrompci = TRUE;
+	   dochiptest = FALSE;
+	   delay = 0x02;
+	/* } */
+	break;
+     case CUT_CLEVO1024:
+     case CUT_CLEVO10242:
+        if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) {
+	   gotitfrompci = TRUE;
+	   dochiptest = FALSE;
+	   delay = 0x33;
+	   SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2D,delay);
+	   delay &= 0x0f;
+	}
+	break;
+     }
+
+     /* Could we find it through the PCI ID? If no, use ROM or table */
+
+     if(!gotitfrompci) {
+
+        index = GetLCDPtrIndexBIOS(SiS_Pr, HwInfo);
+        myindex = GetLCDPtrIndex(SiS_Pr);
+
+        if(IS_SIS650 && (SiS_Pr->SiS_VBType & VB_SIS301LV302LV)) {
+
+           if(SiS_IsNotM650orLater(SiS_Pr, HwInfo)) {
+
+              if((ROMAddr) && SiS_Pr->SiS_UseROM) {
+	         /* Always use the second pointer on 650; some BIOSes */
+                 /* still carry old 301 data at the first location    */
+	         /* romptr = ROMAddr[0x120] | (ROMAddr[0x121] << 8);  */
+	         /* if(SiS_Pr->SiS_VBType & VB_SIS302LV)              */
+	         romptr = ROMAddr[0x122] | (ROMAddr[0x123] << 8);
+	         if(!romptr) return;
+	         delay = ROMAddr[(romptr + index)];
+	      } else {
+                 delay = SiS310_LCDDelayCompensation_650301LV[myindex];
+	      }
+
+          } else {
+
+             delay = SiS310_LCDDelayCompensation_651301LV[myindex];
+	     if(SiS_Pr->SiS_VBType & (VB_SIS302LV | VB_SIS302ELV))
+	        delay = SiS310_LCDDelayCompensation_651302LV[myindex];
+
+          }
+
+        } else if((ROMAddr) && SiS_Pr->SiS_UseROM &&
+	          (SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel1280x1024)) {
+
+	   /* Data for 1280x1024 wrong in BIOS */
+           romptr = GetLCDromptr(SiS_Pr, HwInfo);
 	   if(!romptr) return;
 	   delay = ROMAddr[(romptr + index)];
-        } else {
+
+        } else if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
+
+	   if(IS_SIS740) delay = 0x03;
+	   else          delay = 0x00;
+
+	} else {
+
            delay = SiS310_LCDDelayCompensation_301[myindex];
-           if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
-#if 0 	      /* This data is (like the one in the BIOS) wrong. */	   
-	      if(IS_SIS650740) {  /* V */
-	         delay = SiS310_LCDDelayCompensation_650301B[myindex];
-	      } else {
-#endif	      
-                 delay = SiS310_LCDDelayCompensation_3xx301B[myindex];
-#if 0		 
-	      }
-#endif	      
-	   }
-           if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
-	      if(IS_SIS650) {
-                 delay = SiS310_LCDDelayCompensation_LVDS650[myindex];
-	      } else {
-	         delay = SiS310_LCDDelayCompensation_LVDS740[myindex];
-	      }
+	   if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {
+	      if(IS_SIS740) delay = 0x01;
+	      else          delay = SiS310_LCDDelayCompensation_650301LV[myindex];
+	   } else if(SiS_Pr->SiS_VBType & VB_SIS301B302B) {
+	      if(IS_SIS740) delay = 0x01;
+	      else          delay = SiS310_LCDDelayCompensation_3xx301B[myindex];
 	   }
+
         }
+
+     }  /* got it from PCI */
+
+     if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) {
+	SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2D,0x0F,((delay << 4) & 0xf0));
+	dochiptest = FALSE;
      }
      
-  } else {							/* TV */
-  
+  } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {			/* ------------ TV */
+
      index = GetTVPtrIndex(SiS_Pr);
      
      if(IS_SIS650 && (SiS_Pr->SiS_VBType & VB_SIS301LV302LV)) {
-       if(SiS_IsNotM650or651(SiS_Pr,HwDeviceExtension, BaseAddr)) {
-          if((ROMAddr) && SiS_Pr->SiS_UseROM) {
-#if 0	     /* Always use the second pointer on 650; some BIOSes */
-             /* still carry old 301 data at the first location    */  	  
-             romptr = ROMAddr[0x114] | (ROMAddr[0x115] << 8);
-	     if(SiS_Pr->SiS_VBType & VB_SIS302LV)
-#endif	     
-	        romptr = ROMAddr[0x11a] | (ROMAddr[0x11b] << 8);
-	     if(!romptr) return;
-	     delay = ROMAddr[romptr + index];
-	  } else {
-	     delay = SiS310_TVDelayCompensation_301B[index];     
-#if 0	     
-	     if(SiS_Pr->SiS_VBType & VB_SIS302LV)
-	        delay = SiS310_TVDelayCompensation_301B[index];  
-#endif		
-	  }
-       } else {
-          delay = SiS310_TVDelayCompensation_651301LV[index];       
-	  if(SiS_Pr->SiS_VBType & VB_SIS302LV)
-	      delay = SiS310_TVDelayCompensation_651302LV[index];   
-       }
+
+        if(SiS_IsNotM650orLater(SiS_Pr,HwInfo)) {
+
+           if((ROMAddr) && SiS_Pr->SiS_UseROM) {
+	      /* Always use the second pointer on 650; some BIOSes */
+              /* still carry old 301 data at the first location    */
+              /* romptr = ROMAddr[0x114] | (ROMAddr[0x115] << 8);  */
+	      /* if(SiS_Pr->SiS_VBType & VB_SIS302LV) */
+	      romptr = ROMAddr[0x11a] | (ROMAddr[0x11b] << 8);
+	      if(!romptr) return;
+	      delay = ROMAddr[romptr + index];
+
+	   } else {
+
+	      delay = SiS310_TVDelayCompensation_301B[index];
+
+	   }
+
+        } else {
+
+           switch(SiS_Pr->SiS_CustomT) {
+	   case CUT_COMPAQ1280:
+	   case CUT_COMPAQ12802:
+	   case CUT_CLEVO1400:
+	   case CUT_CLEVO14002:
+	      delay = 0x02;
+	      dochiptest = FALSE;
+	      break;
+	   case CUT_CLEVO1024:
+	   case CUT_CLEVO10242:
+	      delay = 0x03;
+	      dochiptest = FALSE;
+   	      break;
+	   default:
+              delay = SiS310_TVDelayCompensation_651301LV[index];
+	      if(SiS_Pr->SiS_VBType & VB_SIS302LV) {
+	         delay = SiS310_TVDelayCompensation_651302LV[index];
+	      }
+	   }
+        }
+
+     } else if((ROMAddr) && SiS_Pr->SiS_UseROM) {
+
+        romptr = GetTVromptr(SiS_Pr, HwInfo);
+	if(!romptr) return;
+	delay = ROMAddr[romptr + index];
+
+     } else if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
+
+        delay = SiS310_TVDelayCompensation_LVDS[index];
+
      } else {
-       if((ROMAddr) && SiS_Pr->SiS_UseROM) {
-          romptr = GetTVromptr(SiS_Pr, HwDeviceExtension, ROMAddr);
-	  if(!romptr) return;
-	  delay = ROMAddr[romptr + index];
-       } else {
-	    delay = SiS310_TVDelayCompensation_301[index];
-            if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
-	       if(IS_SIS740) 
-	          delay = SiS310_TVDelayCompensation_740301B[index];
-	       else 
-                  delay = SiS310_TVDelayCompensation_301B[index];
-	    }
-            if(SiS_Pr->SiS_IF_DEF_LVDS == 1)
-               delay = SiS310_TVDelayCompensation_LVDS[index];
-       }
+
+	delay = SiS310_TVDelayCompensation_301[index];
+        if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
+	   if(IS_SIS740) {
+	      delay = SiS310_TVDelayCompensation_740301B[index];
+	   } else {
+              delay = SiS310_TVDelayCompensation_301B[index];
+	   }
+	}
+
+     }
+
+     if(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x13) & 0x04) {  /* LCDA */
+	delay &= 0x0f;
+	dochiptest = FALSE;
      }
     
-  }
+  } else return;
+
+  /* Write delay */
+
+  if(SiS_Pr->SiS_VBType & VB_SISVB) {
+
+     if(IS_SIS650 && (SiS_Pr->SiS_VBType & VB_SIS301LV302LV) && dochiptest) {
+
+        temp = (SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) & 0xf0) >> 4;
+        if(temp == 8) {		/* 1400x1050 BIOS (COMPAL) */
+	   delay &= 0x0f;
+	   delay |= 0xb0;
+        } else if(temp == 6) {
+           delay &= 0x0f;
+	   delay |= 0xc0;
+        } else if(temp > 7) {	/* 1280x1024 BIOS (which one?) */
+	   delay = 0x35;
+        }
+        SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2D,delay);
+
+     } else {
+
+        SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2D,0xF0,delay);
+
+     }
+
+  } else {  /* LVDS */
 
-  if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
      if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
         SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2D,0xF0,delay);
      } else {
@@ -11085,47 +11557,44 @@
            SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2D,0xF0,delay);
         }
      }
-  } else {
-     if(IS_SIS650 && (SiS_Pr->SiS_VBType & VB_SIS301LV302LV)) {
-        temp = (SiS_GetReg1(SiS_Pr->SiS_P3d4,0x36) & 0xf0) >> 4;
-        if(temp == 8) {
-	   delay &= 0x0f;
-	   delay |= 0xb0;
-        } else if(temp == 6) {
-           delay &= 0x0f;
-	   delay |= 0xc0;
-        }
-        SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x2D,delay);  /* index 2D D[3:0] */
-     } else {
-        SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2D,0xF0,delay);
-     }
+
   }
+
 }
 
 static void
-SetAntiFlicker(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT BaseAddr,
-               UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex)
+SetAntiFlicker(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
+               USHORT ModeNo,USHORT ModeIdIndex)
 {
-  USHORT index,temp,romptr=0;
+  UCHAR  *ROMAddr = HwInfo->pjVirtualRomBase;
+  USHORT index,temp,temp1,romptr=0;
 
-  temp = GetTVPtrIndex(SiS_Pr);
-  temp >>= 1;  	  /* 0: NTSC, 1: PAL, 2: HiTV */
+  if(SiS_Pr->SiS_TVMode & (TVSetYPbPr750p|TVSetYPbPr525p)) return;
 
   if(ModeNo<=0x13)
      index = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].VB_StTVFlickerIndex;
   else
      index = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].VB_ExtTVFlickerIndex;
 
+  temp = GetTVPtrIndex(SiS_Pr);
+  temp >>= 1;  	  /* 0: NTSC/YPbPr, 1: PAL, 2: HiTV */
+  temp1 = temp;
+
   if(ROMAddr && SiS_Pr->SiS_UseROM) {
-     romptr = ROMAddr[0x112] | (ROMAddr[0x113] << 8);
-     if(HwDeviceExtension->jChipType == SIS_330) {
+     if(HwInfo->jChipType >= SIS_661) {
+	romptr = ROMAddr[0x260] | (ROMAddr[0x261] << 8);
+	temp1 = GetOEMTVPtr661(SiS_Pr);
+        temp1 >>= 1;
+     } else if(HwInfo->jChipType >= SIS_330) {
         romptr = ROMAddr[0x192] | (ROMAddr[0x193] << 8);
+     } else {
+        romptr = ROMAddr[0x112] | (ROMAddr[0x113] << 8);
      }
   }
 
   if(romptr) {
-     temp <<= 1;
-     temp = ROMAddr[romptr + temp + index];
+     temp1 <<= 1;
+     temp = ROMAddr[romptr + temp1 + index];
   } else {
      temp = SiS310_TVAntiFlick1[temp][index];
   }
@@ -11135,13 +11604,15 @@
 }
 
 static void
-SetEdgeEnhance(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT BaseAddr,
-               UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex)
+SetEdgeEnhance(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
+               USHORT ModeNo,USHORT ModeIdIndex)
 {
-  USHORT index,temp,romptr=0;
+  UCHAR  *ROMAddr = HwInfo->pjVirtualRomBase;
+  USHORT index,temp,temp1,romptr=0;
 
   temp = GetTVPtrIndex(SiS_Pr);
-  temp >>= 1;              	/* 0: NTSC, 1: PAL, 2: HiTV */
+  temp >>= 1;              	/* 0: NTSC/YPbPr, 1: PAL, 2: HiTV */
+  temp1 = temp;
 
   if(ModeNo<=0x13)
      index = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].VB_StTVEdgeIndex;
@@ -11149,15 +11620,20 @@
      index = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].VB_ExtTVEdgeIndex;
 
   if(ROMAddr && SiS_Pr->SiS_UseROM) {
-     romptr = ROMAddr[0x124] | (ROMAddr[0x125] << 8);
-     if(HwDeviceExtension->jChipType == SIS_330) {
+     if(HwInfo->jChipType >= SIS_661) {
+	romptr = ROMAddr[0x26c] | (ROMAddr[0x26d] << 8);
+	temp1 = GetOEMTVPtr661(SiS_Pr);
+        temp1 >>= 1;
+     } else if(HwInfo->jChipType >= SIS_330) {
         romptr = ROMAddr[0x1a4] | (ROMAddr[0x1a5] << 8);
+     } else {
+        romptr = ROMAddr[0x124] | (ROMAddr[0x125] << 8);
      }
   }
 
   if(romptr) {
-     temp <<= 1;
-     temp = ROMAddr[romptr + temp + index];
+     temp1 <<= 1;
+     temp = ROMAddr[romptr + temp1 + index];
   } else {
      temp = SiS310_TVEdge1[temp][index];
   }
@@ -11166,94 +11642,124 @@
 }
 
 static void
-SetYFilter(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT BaseAddr,
-           UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex)
+SetYFilter(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
+           USHORT ModeNo,USHORT ModeIdIndex)
 {
-  USHORT index, temp, i, j;
-  UCHAR  OutputSelect = *SiS_Pr->pSiS_OutputSelect;
-
-  temp = GetTVPtrIndex(SiS_Pr);
-  temp >>= 1;  			/* 0: NTSC, 1: PAL, 2: HiTV */
+  UCHAR  *ROMAddr = HwInfo->pjVirtualRomBase;
+  USHORT index, myindex, oldindex,temp, i, j, flag1 = 0, flag2 = 0, romptr = 0;
+  ULONG  lindex;
 
-  if (ModeNo<=0x13) {
+  if(ModeNo<=0x13) {
     index =  SiS_Pr->SiS_SModeIDTable[ModeIdIndex].VB_StTVYFilterIndex;
   } else {
     index =  SiS_Pr->SiS_EModeIDTable[ModeIdIndex].VB_ExtTVYFilterIndex;
   }
 
-  if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVisionTV)  temp = 1;  /* Hivision TV uses PAL */
+  oldindex = index;
 
-  if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
-    for(i=0x35, j=0; i<=0x38; i++, j++) {
-       SiS_SetReg1(SiS_Pr->SiS_Part2Port,i,SiS310_TVYFilter2[temp][index][j]);
-    }
-    for(i=0x48; i<=0x4A; i++, j++) {
-       SiS_SetReg1(SiS_Pr->SiS_Part2Port,i,SiS310_TVYFilter2[temp][index][j]);
-    }
-  } else {
-    for(i=0x35, j=0; i<=0x38; i++, j++){
-       SiS_SetReg1(SiS_Pr->SiS_Part2Port,i,SiS310_TVYFilter1[temp][index][j]);
-    }
+  if((HwInfo->jChipType >= SIS_661) && ROMAddr && SiS_Pr->SiS_UseROM) {
+     if(ModeNo > 0x13) {
+        index =  SiS_Pr->SiS_EModeIDTable[ModeIdIndex].VB_ExtTVYFilterIndexROM661;
+     }
+     lindex = GetOEMTVPtr661_2(SiS_Pr);
+     if(lindex & 0x00ff0000) flag1 = 1;
+     if(lindex & 0xff000000) flag2 = 1;
+     lindex &= 0xffff;
+
+     /* NTSC-J: Use PAL filters */
+     if(SiS_Pr->SiS_TVMode & TVSetNTSCJ) lindex = 1;
+
+     romptr = ROMAddr[0x268] | (ROMAddr[0x269] << 8);
+     if(flag1) myindex = index * 7;
+     else      myindex = index << 2;
+
+     if(romptr) {
+        romptr += (lindex << 1);
+        romptr = (ROMAddr[romptr] | (ROMAddr[romptr+1] << 8)) + myindex;
+	if(romptr) {
+           if((!flag1) && (flag2)) {
+	      SiS_SetReg(SiS_Pr->SiS_Part2Port,0x35,0x00);
+	      SiS_SetReg(SiS_Pr->SiS_Part2Port,0x36,0x00);
+	      SiS_SetReg(SiS_Pr->SiS_Part2Port,0x37,0x00);
+	      SiS_SetReg(SiS_Pr->SiS_Part2Port,0x38,ROMAddr[romptr++]);
+           } else {
+	      for(i=0x35; i<=0x38; i++) {
+                 SiS_SetReg(SiS_Pr->SiS_Part2Port,i,ROMAddr[romptr++]);
+              }
+           }
+           if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
+	      for(j=0, i=0x48; i<=0x4a; i++, j++) {
+                 SiS_SetReg(SiS_Pr->SiS_Part2Port,i,ROMAddr[romptr++]);
+              }
+           }
+           return;
+	}
+     }
   }
 
-  if(ROMAddr && SiS_Pr->SiS_UseROM) {
-  	OutputSelect = ROMAddr[0xf3];
-	if(HwDeviceExtension->jChipType == SIS_330) {
-	    OutputSelect = ROMAddr[0x11b];
-	}
-  }
-  if(OutputSelect & EnablePALMN) {
-      if(SiS_GetReg1(SiS_Pr->SiS_P3d4,0x31) & 0x01) {
-         temp = SiS_GetReg1(SiS_Pr->SiS_P3d4,0x38);
-         temp &= (EnablePALM | EnablePALN);
-         if(temp == EnablePALM) {
-              if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
-                 for(i=0x35, j=0; i<=0x38; i++, j++) {
-                      SiS_SetReg1(SiS_Pr->SiS_Part2Port,i,SiS310_PALMFilter2[index][j]);
-                 }
-                 for(i=0x48; i<=0x4A; i++, j++) {
-                      SiS_SetReg1(SiS_Pr->SiS_Part2Port,i,SiS310_PALMFilter2[index][j]);
-                 }
-              } else {
-                 for(i=0x35, j=0; i<=0x38; i++, j++) {
-                      SiS_SetReg1(SiS_Pr->SiS_Part2Port,i,SiS310_PALMFilter[index][j]);
-                 }
-              }
-         }
-         if(temp == EnablePALN) {
-              if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
-                 for(i=0x35, j=0; i<=0x38; i++, j++) {
-                      SiS_SetReg1(SiS_Pr->SiS_Part2Port,i,SiS310_PALNFilter2[index][j]);
-                 }
-                 for(i=0x48, j=0; i<=0x4A; i++, j++) {
-                      SiS_SetReg1(SiS_Pr->SiS_Part2Port,i,SiS310_PALNFilter2[index][j]);
-                 }
-             } else {
-                 for(i=0x35, j=0; i<=0x38; i++, j++) {
-                      SiS_SetReg1(SiS_Pr->SiS_Part2Port,i,SiS310_PALNFilter[index][j]);
-		 }
-             }
-         }
-      }
+  index = oldindex;
+
+  temp = GetTVPtrIndex(SiS_Pr);
+  temp >>= 1;  			/* 0: NTSC/YPbPr, 1: PAL, 2: HiTV */
+
+  if(SiS_Pr->SiS_TVMode & TVSetNTSCJ)	     temp = 1;  /* NTSC-J uses PAL */
+  else if(SiS_Pr->SiS_TVMode & TVSetPALM)    temp = 3;  /* PAL-M */
+  else if(SiS_Pr->SiS_TVMode & TVSetPALN)    temp = 4;  /* PAL-N */
+  if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) temp = 1;  /* HiVision uses PAL */
+
+  if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
+     for(i=0x35, j=0; i<=0x38; i++, j++) {
+        SiS_SetReg(SiS_Pr->SiS_Part2Port,i,SiS310_TVYFilter2[temp][index][j]);
+     }
+     for(i=0x48; i<=0x4A; i++, j++) {
+        SiS_SetReg(SiS_Pr->SiS_Part2Port,i,SiS310_TVYFilter2[temp][index][j]);
+     }
+  } else {
+     for(i=0x35, j=0; i<=0x38; i++, j++) {
+        SiS_SetReg(SiS_Pr->SiS_Part2Port,i,SiS310_TVYFilter1[temp][index][j]);
+     }
   }
 }
 
 static void
-SetPhaseIncr(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT BaseAddr,
-             UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex)
+SetPhaseIncr(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
+             USHORT ModeNo,USHORT ModeIdIndex)
 {
-  USHORT index,temp,temp1,i,j,resinfo,romptr=0;
+  UCHAR  *ROMAddr = HwInfo->pjVirtualRomBase;
+  USHORT index,temp,i,j,resinfo,romptr=0;
+  ULONG  lindex;
 
   if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) return;
 
-  temp1 = SiS_GetReg1(SiS_Pr->SiS_P3d4,0x38);        /* if PALM/N not set */
-  temp1 &=  (EnablePALM | EnablePALN);
-  if(temp1) return;
+  /* NTSC-J data not in BIOS, and already set in SetGroup2 */
+  if(SiS_Pr->SiS_TVMode & TVSetNTSCJ) return;
+
+  if(HwInfo->jChipType >= SIS_661) {
+     lindex = GetOEMTVPtr661_2(SiS_Pr) & 0xffff;
+     lindex <<= 2;
+     if((ROMAddr) && SiS_Pr->SiS_UseROM) {
+        romptr = ROMAddr[0x264] | (ROMAddr[0x265] << 8);
+     }
+     if(romptr) {
+	romptr += lindex;
+	for(j=0, i=0x31; i<=0x34; i++, j++) {
+           SiS_SetReg(SiS_Pr->SiS_Part2Port,i,ROMAddr[romptr + j]);
+        }
+     } else {
+        for(j=0, i=0x31; i<=0x34; i++, j++) {
+           SiS_SetReg(SiS_Pr->SiS_Part2Port,i,SiS661_TVPhase[lindex + j]);
+        }
+     }
+     return;
+  }
+
+  /* PAL-M, PAL-N not in BIOS, and already set in SetGroup2 */
+  if(SiS_Pr->SiS_TVMode & (TVSetPALM | TVSetPALN)) return;
 
-  if (ModeNo<=0x13) {
-    resinfo =  SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ResInfo;
+  if(ModeNo<=0x13) {
+     resinfo = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ResInfo;
   } else {
-    resinfo =  SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO;
+     resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO;
   }
 
   temp = GetTVPtrIndex(SiS_Pr);
@@ -11262,17 +11768,17 @@
    */
   if((ROMAddr) && SiS_Pr->SiS_UseROM) {
      romptr = ROMAddr[0x116] | (ROMAddr[0x117] << 8);
-     if(HwDeviceExtension->jChipType == SIS_330) {
+     if(HwInfo->jChipType >= SIS_330) {
         romptr = ROMAddr[0x196] | (ROMAddr[0x197] << 8);
      }
      if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
         romptr = ROMAddr[0x11c] | (ROMAddr[0x11d] << 8);
-	if(HwDeviceExtension->jChipType == SIS_330) {
+	if(HwInfo->jChipType >= SIS_330) {
 	   romptr = ROMAddr[0x19c] | (ROMAddr[0x19d] << 8);
 	}
-	if((SiS_Pr->SiS_VBInfo & SetInSlaveMode) && (!(SiS_Pr->SiS_SetFlag & TVSimuMode))) {
+	if((SiS_Pr->SiS_VBInfo & SetInSlaveMode) && (!(SiS_Pr->SiS_TVMode & TVSetTVSimuMode))) {
 	   romptr = ROMAddr[0x116] | (ROMAddr[0x117] << 8);
-	   if(HwDeviceExtension->jChipType == SIS_330) {
+	   if(HwInfo->jChipType >= SIS_330) {
               romptr = ROMAddr[0x196] | (ROMAddr[0x197] << 8);
            }
 	}
@@ -11281,295 +11787,463 @@
   if(romptr) {
      romptr += (temp << 2);
      for(j=0, i=0x31; i<=0x34; i++, j++) {
-        SiS_SetReg1(SiS_Pr->SiS_Part2Port,i,ROMAddr[romptr + j]);
+        SiS_SetReg(SiS_Pr->SiS_Part2Port,i,ROMAddr[romptr + j]);
      }
   } else {
      index = temp % 2;
      temp >>= 1;          /* 0:NTSC, 1:PAL, 2:HiTV */
      for(j=0, i=0x31; i<=0x34; i++, j++) {
         if(!(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV))
-	   SiS_SetReg1(SiS_Pr->SiS_Part2Port,i,SiS310_TVPhaseIncr1[temp][index][j]);
-        else if((!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) || (SiS_Pr->SiS_SetFlag & TVSimuMode))
-           SiS_SetReg1(SiS_Pr->SiS_Part2Port,i,SiS310_TVPhaseIncr2[temp][index][j]);
+	   SiS_SetReg(SiS_Pr->SiS_Part2Port,i,SiS310_TVPhaseIncr1[temp][index][j]);
+        else if((!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) || (SiS_Pr->SiS_TVMode & TVSetTVSimuMode))
+           SiS_SetReg(SiS_Pr->SiS_Part2Port,i,SiS310_TVPhaseIncr2[temp][index][j]);
         else
-           SiS_SetReg1(SiS_Pr->SiS_Part2Port,i,SiS310_TVPhaseIncr1[temp][index][j]);
+           SiS_SetReg(SiS_Pr->SiS_Part2Port,i,SiS310_TVPhaseIncr1[temp][index][j]);
      }
   }
 
-  if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {    /* TW: 650/301LV: (VB_SIS301LV | VB_SIS302LV)) */
-     if((!(SiS_Pr->SiS_VBInfo & SetPALTV)) && (ModeNo > 0x13)) {
-        if(resinfo == 6) {
-	      SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x31,0x21);
-	      SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x32,0xf0);
-	      SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x33,0xf5);
-	      SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x34,0x7f);
-	} else if (resinfo == 7) {
-	      SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x31,0x21);
-	      SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x32,0xf0);
-	      SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x33,0xf5);
-	      SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x34,0x7f);
-	} else if (resinfo == 8) {
-	      SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x31,0x1e);
-	      SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x32,0x8b);
-	      SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x33,0xfb);
-	      SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x34,0x7b);
+  if((SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) && (!(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision))) {
+     if((!(SiS_Pr->SiS_TVMode & (TVSetPAL | TVSetYPbPr525p | TVSetYPbPr750p))) && (ModeNo > 0x13)) {
+        if((resinfo == SIS_RI_640x480) ||
+	   (resinfo == SIS_RI_800x600)) {
+	   SiS_SetReg(SiS_Pr->SiS_Part2Port,0x31,0x21);
+	   SiS_SetReg(SiS_Pr->SiS_Part2Port,0x32,0xf0);
+	   SiS_SetReg(SiS_Pr->SiS_Part2Port,0x33,0xf5);
+	   SiS_SetReg(SiS_Pr->SiS_Part2Port,0x34,0x7f);
+	} else if(resinfo == SIS_RI_1024x768) {
+	   SiS_SetReg(SiS_Pr->SiS_Part2Port,0x31,0x1e);
+	   SiS_SetReg(SiS_Pr->SiS_Part2Port,0x32,0x8b);
+	   SiS_SetReg(SiS_Pr->SiS_Part2Port,0x33,0xfb);
+	   SiS_SetReg(SiS_Pr->SiS_Part2Port,0x34,0x7b);
 	}
      }
   }
 }
 
 void
-SiS_OEM310Setting(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT BaseAddr,
-                  UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex)
+SiS_OEM310Setting(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
+                  USHORT ModeNo,USHORT ModeIdIndex)
 {
-   SetDelayComp(SiS_Pr,HwDeviceExtension,BaseAddr,ROMAddr,ModeNo);
-   /* TW: The TV functions are not for LVDS */
-   if( (SiS_Pr->SiS_IF_DEF_LVDS == 0) && (SiS_Pr->SiS_VBInfo & SetCRT2ToTV) ) {
-       SetAntiFlicker(SiS_Pr,HwDeviceExtension,BaseAddr,ROMAddr,ModeNo,ModeIdIndex);
-       SetPhaseIncr(SiS_Pr,HwDeviceExtension,BaseAddr,ROMAddr,ModeNo,ModeIdIndex);
-       SetYFilter(SiS_Pr,HwDeviceExtension,BaseAddr,ROMAddr,ModeNo,ModeIdIndex);
-       if(!(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV)) {
-          SetEdgeEnhance(SiS_Pr,HwDeviceExtension,BaseAddr,ROMAddr,ModeNo,ModeIdIndex);
-       }
+   SetDelayComp(SiS_Pr,HwInfo,ModeNo);
+
+   if(SiS_Pr->UseCustomMode) return;
+
+   if((SiS_Pr->SiS_VBType & VB_SISVB) && (SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) {
+      SetAntiFlicker(SiS_Pr,HwInfo,ModeNo,ModeIdIndex);
+      SetPhaseIncr(SiS_Pr,HwInfo,ModeNo,ModeIdIndex);
+      SetYFilter(SiS_Pr,HwInfo,ModeNo,ModeIdIndex);
+      if(!(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV)) {
+         SetEdgeEnhance(SiS_Pr,HwInfo,ModeNo,ModeIdIndex);
+      }
+   }
+}
+
+static void
+SetDelayComp661(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, USHORT ModeNo,
+                USHORT ModeIdIndex, USHORT RTI)
+{
+   UCHAR  *ROMAddr = HwInfo->pjVirtualRomBase;
+   USHORT delay = 0, romptr = 0, index;
+   UCHAR  *myptr = NULL;
+   UCHAR  temp;
+
+   if(!(SiS_Pr->SiS_VBInfo & (SetCRT2ToTV | SetCRT2ToLCD | SetCRT2ToLCDA | SetCRT2ToRAMDAC)))
+      return;
+
+   delay = SiS_Pr->SiS_RefIndex[RTI].Ext_PDC;
+
+   delay &= 0xf0;
+   delay >>= 4;
+   if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) delay <<= 12;  /* BIOS: 8, wrong */
+
+   if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
+      index = GetOEMTVPtr661(SiS_Pr);
+      if((ROMAddr) && SiS_Pr->SiS_UseROM) {
+         romptr = ROMAddr[0x25c] | (ROMAddr[0x25d] << 8);
+         if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
+            romptr = ROMAddr[0x25e] | (ROMAddr[0x25f] << 8);
+         }
+      }
+      if(romptr) myptr = &ROMAddr[romptr];
+      if(!myptr) {
+         myptr = (UCHAR *)SiS_TVDelay661_301;
+	 if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
+	    myptr = (UCHAR *)SiS_TVDelay661_301B;
+	 }
+      }
+      delay = myptr[index];
+      if(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x13) & 0x04) delay >>= 4;  /* Should test dual edge */
+   } else if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) {
+      if(SiS_Pr->PDC) {
+         delay = SiS_Pr->PDC & 0x0f;
+	 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) {
+            delay |= (delay << 12);
+         }
+      } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_PanelCustom) {
+         delay = 0x4444;  /* TEST THIS */
+      } else if(!(SiS_Pr->SiS_LCDInfo & LCDPass11)) {
+         myptr = GetLCDStructPtr661(SiS_Pr, HwInfo);
+         if(myptr) delay = myptr[4];
+         else delay = 0x44;
+         if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) {
+            delay |= (delay << 8);
+         }
+      }
+   }
+
+   temp = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x2d);
+   if(SiS_Pr->SiS_VBInfo & (SetCRT2ToTV | SetCRT2ToLCD | SetCRT2ToRAMDAC)) {
+      temp &= 0xf0;
+      temp |= (delay & 0x000f);
+   }
+   if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) {
+      temp &= 0x0f;
+      temp |= ((delay & 0xf000) >> 8);
+   }
+   SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2d,temp);
+}
+
+static void
+SetCRT2SyncDither661(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, USHORT ModeNo, USHORT RTI)
+{
+   USHORT infoflag;
+   UCHAR temp;
+
+   infoflag = SiS_Pr->SiS_RefIndex[RTI].Ext_InfoFlag;
+   if(ModeNo <= 0x13) {
+      infoflag = SiS_GetRegByte(SiS_Pr->SiS_P3ca+2);
+   }
+   infoflag &= 0xc0;
+   if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) {
+      temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x37);
+      if(temp & 0x20) infoflag = temp;
+      if(temp & 0x01) infoflag |= 0x01;
+   }
+   if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
+      temp = 0x0c;
+      if(infoflag & 0x01) temp ^= 0x14;  /* BIOS: 18, wrong */
+      temp |= (infoflag >> 6);
+      SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x1a,0xe0,temp);
+   }
+   if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) {
+      temp = 0;
+      if(infoflag & 0x01) temp |= 0x80;
+      SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x1a,0x7f,temp);
+      temp = 0x30;
+      if(infoflag & 0x01) temp = 0x20;
+      infoflag &= 0xc0;
+      temp |= infoflag;
+      SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0x0f,temp);
+   }
+}
+
+static void
+SetPanelParms661(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
+{
+   UCHAR *myptr;
+
+   if(SiS_Pr->SiS_VBType & (VB_SIS301LV | VB_SIS302LV | VB_SIS302ELV)) {
+      if(SiS_Pr->LVDSHL != -1) {
+         SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x24,0xfc,SiS_Pr->LVDSHL);
+      }
+   }
+
+   myptr = GetLCDStructPtr661(SiS_Pr, HwInfo);
+   if(myptr) {
+      if(SiS_Pr->SiS_VBType & (VB_SIS301LV | VB_SIS302LV | VB_SIS302ELV)) {
+         if(SiS_Pr->LVDSHL == -1) {
+            SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x24,0xE0,myptr[1] & 0x1f);
+	 } else {
+	    SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x24,0xE3,myptr[1] & 0x1c);
+	 }
+      }
+      SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x0d,0x3f,myptr[2] & 0xc0);
+   }
+}
+
+void
+SiS_OEM661Setting(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
+                  USHORT ModeNo,USHORT ModeIdIndex, USHORT RRTI)
+{
+   if(SiS_Pr->SiS_VBType & VB_SISVB) {
+
+      SetDelayComp661(SiS_Pr,HwInfo,ModeNo,ModeIdIndex,RRTI);
+
+      if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) {
+         SetCRT2SyncDither661(SiS_Pr,HwInfo,ModeNo,RRTI);
+         SetPanelParms661(SiS_Pr,HwInfo);
+      }
+
+      if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
+         SetPhaseIncr(SiS_Pr,HwInfo,ModeNo,ModeIdIndex);
+         SetYFilter(SiS_Pr,HwInfo,ModeNo,ModeIdIndex);
+         SetAntiFlicker(SiS_Pr,HwInfo,ModeNo,ModeIdIndex);
+         if(!(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV)) {
+            SetEdgeEnhance(SiS_Pr,HwInfo,ModeNo,ModeIdIndex);
+         }
+      }
    }
 }
 
 /* FinalizeLCD
- * This finalizes some Part1 registers for the very panel used.
+ * This finalizes some CRT2 registers for the very panel used.
  * If we have a backup if these registers, we use it; otherwise
  * we set the register according to most BIOSes. However, this
  * function looks quite different in every BIOS, so you better
  * pray that we have a backup...
  */
 void
-SiS_FinalizeLCD(SiS_Private *SiS_Pr, USHORT BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,
-                USHORT ModeIdIndex, PSIS_HW_DEVICE_INFO HwDeviceExtension)
+SiS_FinalizeLCD(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
+                PSIS_HW_INFO HwInfo)
 {
   USHORT tempcl,tempch,tempbl,tempbh,tempbx,tempax,temp;
   USHORT resinfo,modeflag;
 
   if(!(SiS_Pr->SiS_VBType & VB_SIS301LV302LV)) return;
 
+  if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) {
+     if(SiS_Pr->LVDSHL != -1) {
+        SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x24,0xfc,SiS_Pr->LVDSHL);
+     }
+  }
+
+  if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_PanelCustom) return;
+  if(SiS_Pr->UseCustomMode) return;
+
+  switch(SiS_Pr->SiS_CustomT) {
+  case CUT_COMPAQ1280:
+  case CUT_COMPAQ12802:
+  case CUT_CLEVO1400:
+  case CUT_CLEVO14002:
+     return;
+  }
+
   if(ModeNo <= 0x13) {
-	resinfo = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ResInfo;
-	modeflag =  SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
+     resinfo = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ResInfo;
+     modeflag =  SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
   } else {
-    	resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO;
-	modeflag =  SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
+     resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO;
+     modeflag =  SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
+  }
+
+  if(IS_SIS650) {
+     if(!(SiS_GetReg(SiS_Pr->SiS_P3d4, 0x5f) & 0xf0)) {
+        if(SiS_Pr->SiS_CustomT == CUT_CLEVO1024) {
+	   SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1e,0x02);
+	} else {
+           SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1e,0x03);
+	}
+     }
+  }
+
+  if(SiS_Pr->SiS_CustomT == CUT_CLEVO1024) {
+     if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) {
+        /* Maybe all panels? */
+        if(SiS_Pr->LVDSHL == -1) {
+           SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x24,0xfc,0x01);
+	}
+	return;
+     }
+  }
+
+  if(SiS_Pr->SiS_CustomT == CUT_CLEVO10242) {
+     if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) {
+        if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) {
+	   if(SiS_Pr->LVDSHL == -1) {
+	      /* Maybe all panels? */
+              SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x24,0xfc,0x01);
+	   }
+	   if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) {
+	      tempch = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) >> 4;
+	      if(tempch == 3) {
+	         SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x02);
+	         SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1b,0x25);
+	         SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1c,0x00);
+	         SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1d,0x1b);
+	      }
+	   }
+	   return;
+	}
+     }
   }
 
   if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) {
      if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) {
-        SiS_SetReg1(SiS_Pr->SiS_Part4Port,0x2a,0x00);
-	SiS_SetReg1(SiS_Pr->SiS_Part4Port,0x30,0x00);
-	SiS_SetReg1(SiS_Pr->SiS_Part4Port,0x34,0x10);
-     }
-     tempch = SiS_GetReg1(SiS_Pr->SiS_P3d4,0x36);
-     tempch &= 0xf0;
-     tempch >>= 4;
+#ifdef SET_EMI
+	if(SiS_Pr->SiS_VBType & (VB_SIS302LV | VB_SIS302ELV)) {
+	   SiS_SetReg(SiS_Pr->SiS_Part4Port,0x2a,0x00);
+	   SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x30,0x0c);
+	   SiS_SetReg(SiS_Pr->SiS_Part4Port,0x34,0x10);
+	}
+#endif
+     } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) {
+        if(SiS_Pr->LVDSHL == -1) {
+           /* Maybe ACER only? */
+           SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x24,0xfc,0x01);
+	}
+     }
+     tempch = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) >> 4;
      if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) {
 	if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) {
-	   SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x1f,0x76);
-	}
-	if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) {	
+	   SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1f,0x76);
+	} else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) {
+	   if(tempch == 0x03) {
+	      SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x02);
+	      SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1b,0x25);
+	      SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1c,0x00);
+	      SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1d,0x1b);
+	   }
 	   if((SiS_Pr->Backup == TRUE) && (SiS_Pr->Backup_Mode == ModeNo)) {
-	      SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x14,SiS_Pr->Backup_14);
-	      SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x15,SiS_Pr->Backup_15);
-	      SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x16,SiS_Pr->Backup_16);
-	      SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x17,SiS_Pr->Backup_17);
-	      SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x18,SiS_Pr->Backup_18);
-	      SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x19,SiS_Pr->Backup_19);
-	      SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x1a,SiS_Pr->Backup_1a);
-	      SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x1b,SiS_Pr->Backup_1b);
-	      SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x1c,SiS_Pr->Backup_1c);
-	      SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x1d,SiS_Pr->Backup_1d);
-	   } else if(!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) {	/* From 1.10.8w */
-	       SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x14,0x90);
-	       if(ModeNo <= 0x13) {
-	          SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x18,0x11);
-		  if((resinfo == 0) && (resinfo == 2)) return;
-		  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x18,0x18);
-		  if((resinfo == 1) && (resinfo == 3)) return;
-	       }
-	       SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x18,0x02);
-	       if((ModeNo > 0x13) && (resinfo == 8)) {
-	          SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x18,0x02);  /* 1.10.7u */
-#if 0	       
-	          tempbx = 806;  /* 0x326 */			 /* other older BIOSes */
-		  tempbx--;
-		  temp = tempbx & 0xff;
-		  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x1b,temp);
-		  temp = (tempbx >> 8) & 0x03;
-		  SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x1d,0xf8,temp);
-#endif		  
-	       }
-	   } else {
-	       if(ModeNo <= 0x13) {
-	          if(ModeNo <= 1) {
-		     SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x18,0x70);
-		     SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x19,0xff);
-		     SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x1b,0x48);
-		     SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x1d,0x12);
-		  }
-		  if(!(modeflag & HalfDCLK)) {
-		     SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x14,0x20);
-		     SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x15,0x1a);
-		     SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x16,0x28);
-		     SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x17,0x00);
-		     SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x18,0x4c);
-		     SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x19,0xdc);
-		     if(ModeNo == 0x12) {
-			 switch(tempch) {
-			 case 0:
-			    SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x18,0x95);
-			    SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x19,0xdc);
-			    SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x1a,0x10);
-			    SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x1b,0x95);
-			    SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x1c,0x48);
-			    SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x1d,0x12);
-			    break;
-			 case 2:
-			    SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x18,0x95);
-			    SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x1b,0x48);
-			    break;
-			 case 3:
-			    SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x1b,0x95);
-			    break;
-			 }
-		     }
-		  }
-	       }
+	      SiS_SetReg(SiS_Pr->SiS_Part1Port,0x14,SiS_Pr->Backup_14);
+	      SiS_SetReg(SiS_Pr->SiS_Part1Port,0x15,SiS_Pr->Backup_15);
+	      SiS_SetReg(SiS_Pr->SiS_Part1Port,0x16,SiS_Pr->Backup_16);
+	      SiS_SetReg(SiS_Pr->SiS_Part1Port,0x17,SiS_Pr->Backup_17);
+	      SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,SiS_Pr->Backup_18);
+	      SiS_SetReg(SiS_Pr->SiS_Part1Port,0x19,SiS_Pr->Backup_19);
+	      SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1a,SiS_Pr->Backup_1a);
+	      SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1b,SiS_Pr->Backup_1b);
+	      SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1c,SiS_Pr->Backup_1c);
+	      SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1d,SiS_Pr->Backup_1d);
+	   } else if(!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) {	/* 1.10.8w */
+	      SiS_SetReg(SiS_Pr->SiS_Part1Port,0x14,0x90);
+	      if(ModeNo <= 0x13) {
+	         SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x11);
+		 if((resinfo == 0) || (resinfo == 2)) return;
+		 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x18);
+		 if((resinfo == 1) || (resinfo == 3)) return;
+	      }
+	      SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x02);
+	      if((ModeNo > 0x13) && (resinfo == SIS_RI_1024x768)) {
+	         SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x02);  /* 1.10.7u */
+#if 0
+	         tempbx = 806;  /* 0x326 */			 /* other older BIOSes */
+		 tempbx--;
+		 temp = tempbx & 0xff;
+		 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1b,temp);
+		 temp = (tempbx >> 8) & 0x03;
+		 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x1d,0xf8,temp);
+#endif
+	      }
+	   } else if(ModeNo <= 0x13) {
+	      if(ModeNo <= 1) {
+		 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x70);
+		 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x19,0xff);
+		 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1b,0x48);
+		 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1d,0x12);
+	      }
+	      if(!(modeflag & HalfDCLK)) {
+		 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x14,0x20);
+		 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x15,0x1a);
+		 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x16,0x28);
+		 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x17,0x00);
+		 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x4c);
+		 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x19,0xdc);
+		 if(ModeNo == 0x12) {
+		    switch(tempch) {
+		       case 0:
+			  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x95);
+			  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x19,0xdc);
+			  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1a,0x10);
+			  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1b,0x95);
+			  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1c,0x48);
+			  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1d,0x12);
+			  break;
+		       case 2:
+			  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x95);
+			  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1b,0x48);
+			  break;
+		       case 3:
+			  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1b,0x95);
+			  break;
+		    }
+		 }
+	      }
 	   }
 	}
      } else {
-        tempcl = tempbh = SiS_GetReg1(SiS_Pr->SiS_Part2Port,0x01);
+        tempcl = tempbh = SiS_GetReg(SiS_Pr->SiS_Part2Port,0x01);
 	tempcl &= 0x0f;
 	tempbh &= 0x70;
 	tempbh >>= 4;
-	tempbl = SiS_GetReg1(SiS_Pr->SiS_Part2Port,0x04);
+	tempbl = SiS_GetReg(SiS_Pr->SiS_Part2Port,0x04);
 	tempbx = (tempbh << 8) | tempbl;
 	if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) {
-	   if((resinfo == 8) || (!(SiS_Pr->SiS_LCDInfo & DontExpandLCD))) {
+	   if((resinfo == SIS_RI_1024x768) || (!(SiS_Pr->SiS_LCDInfo & DontExpandLCD))) {
 	      if(SiS_Pr->SiS_SetFlag & LCDVESATiming) {
-	      	tempbx = 770;
+	      	 tempbx = 770;
 	      } else {
-	        if(tempbx > 770) tempbx = 770;
-		if(SiS_Pr->SiS_VGAVDE < 600) {
-		   tempax = 768 - SiS_Pr->SiS_VGAVDE;
-		   tempax >>= 4;  				/* From 1.10.7w; 1.10.6s: 3;  */
-		   if(SiS_Pr->SiS_VGAVDE <= 480)  tempax >>= 4; /* From 1.10.7w; 1.10.6s: < 480; >>=1; */
-		   tempbx -= tempax;
-		}
+	         if(tempbx > 770) tempbx = 770;
+		 if(SiS_Pr->SiS_VGAVDE < 600) {
+		    tempax = 768 - SiS_Pr->SiS_VGAVDE;
+		    tempax >>= 4;  				 /* 1.10.7w; 1.10.6s: 3;  */
+		    if(SiS_Pr->SiS_VGAVDE <= 480)  tempax >>= 4; /* 1.10.7w; 1.10.6s: < 480; >>=1; */
+		    tempbx -= tempax;
+		 }
 	      }
 	   } else return;
 	}
-#if 0
-	if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) {
-	}
-#endif
 	temp = tempbx & 0xff;
-	SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x04,temp);
-	temp = (tempbx & 0xff00) >> 8;
-	temp <<= 4;
-	temp |= tempcl;
+	SiS_SetReg(SiS_Pr->SiS_Part2Port,0x04,temp);
+	temp = ((tempbx & 0xff00) >> 4) | tempcl;
 	SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x01,0x80,temp);
      }
   }
 }
 
-#if 0
-/* TW: New and checked from 650/301LV BIOS */
-/* This might clash with newer "FinalizeLCD()" function */
-void
-SiS_OEMLCD(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT BaseAddr,
-                  UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex)
-{
-   USHORT tempbx,tempah,tempbl,tempbh,tempcl;
-
-   if(!(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV)) return;
-
-   if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) {
-      SiS_UnLockCRT2(SiS_Pr,HwDeviceExtension,BaseAddr);
-      tempbh = SiS_GetReg1(SiS_Pr->SiS_Part1Port,0x1a);
-      tempbh &= 0x38;
-      tempbh >>= 3;
-      tempbl = SiS_GetReg1(SiS_Pr->SiS_Part1Port,0x18);
-      tempbx = (tempbh << 8) | tempbl;
-      if(SiS_Pr->SiS_LCDTypeInfo == 1)  tempbx -= 0x12;
-      SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x18,tempbx & 0x00ff);
-      tempah = (tempbx & 0xff00) >> 8;
-      tempah &= 0x07;
-      tempah <<= 3;
-      SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x1a,0xc7,tempah);
-      tempah = SiS_GetReg1(SiS_Pr->SiS_Part1Port,0x19);
-      tempah &= 0x0f;
-      if(SiS_Pr->SiS_LCDTypeInfo == 1)  tempah -= 2;
-      tempah &= 0x0f;
-      SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0xF0,tempah);
-      tempah = SiS_GetReg1(SiS_Pr->SiS_Part1Port,0x14);
-      if(SiS_Pr->SiS_LCDTypeInfo == 1)  tempah++;
-      tempah -= 8;
-      SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x14,tempah);
-   } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
-      tempcl = tempbh = SiS_GetReg1(SiS_Pr->SiS_Part2Port,0x01);
-      tempbh &= 0x70;
-      tempbh >>= 4;
-      tempbl = SiS_GetReg1(SiS_Pr->SiS_Part2Port,0x04);
-      tempbx = (tempbh << 8) | tempbl;
-      if(SiS_Pr->SiS_LCDTypeInfo == 1)  {
-           tempbx -= 0x1e;
-	   tempcl &= 0x0f;
-	   tempcl -= 4;
-	   tempcl &= 0x0f;
-      }
-      tempbl = tempbx & 0x00ff;
-      tempbh = (tempbx >> 8) & 0x00ff;
-      SiS_SetReg1(SiS_Pr->SiS_Part2Port,0x04,tempbl);
-      tempbh <<= 4;
-      tempbh |= tempcl;
-      SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x01,0x80,tempbh);
-   }
-}
-#endif
-
 #endif
 
-
 /*  =================  SiS 300 O.E.M. ================== */
 
 #ifdef SIS300
 
-#if 0   /* Not used */
-static USHORT
-GetRevisionID(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension)
+void
+SetOEMLCDData2(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
+               USHORT ModeNo,USHORT ModeIdIndex, USHORT RefTabIndex)
 {
-   ULONG temp1;
-#ifndef LINUX_XF86
-   ULONG base;
-#endif
-   USHORT temp2 = 0;
+  USHORT crt2crtc=0, modeflag, myindex=0;
+  UCHAR  temp;
+  int i;
 
-   if((HwDeviceExtension->jChipType==SIS_540)||
-      (HwDeviceExtension->jChipType==SIS_630)||
-      (HwDeviceExtension->jChipType==SIS_730)) {
-#ifndef LINUX_XF86
-     	base = 0x80000008;
-     	OutPortLong(base,0xcf8);
-     	temp1 = InPortLong(0xcfc);
-#else
-	temp1=pciReadLong(0x00000000, 0x08);
-#endif
-     	temp1 &= 0x000000FF;
-     	temp2 = (USHORT)(temp1);
-    	return temp2;
-   }
-   return 0;
+  if(ModeNo <= 0x13) {
+     modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
+     crt2crtc = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC;
+  } else {
+     modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
+     crt2crtc = SiS_Pr->SiS_RefIndex[RefTabIndex].Ext_CRT2CRTC;
+  }
+
+  crt2crtc &= 0x3f;
+
+  if(SiS_Pr->SiS_CustomT == CUT_BARCO1024) {
+     SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x13,0xdf);
+  }
+
+  if(SiS_Pr->SiS_CustomT == CUT_BARCO1366) {
+     if(modeflag & HalfDCLK) myindex = 1;
+
+     if(SiS_Pr->SiS_SetFlag & LowModeTests) {
+        for(i=0; i<7; i++) {
+           if(barco_p1[myindex][crt2crtc][i][0]) {
+	      SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,
+	                      barco_p1[myindex][crt2crtc][i][0],
+	   	   	      barco_p1[myindex][crt2crtc][i][2],
+			      barco_p1[myindex][crt2crtc][i][1]);
+	   }
+        }
+     }
+     temp = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00);
+     if(temp & 0x80) {
+        temp = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x18);
+        temp++;
+        SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,temp);
+     }
+  }
 }
-#endif
 
 static USHORT
-GetOEMLCDPtr(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, UCHAR *ROMAddr, int Flag)
+GetOEMLCDPtr(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, int Flag)
 {
+  UCHAR  *ROMAddr = HwInfo->pjVirtualRomBase;
   USHORT tempbx=0,romptr=0;
   UCHAR customtable300[] = {
   	0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
@@ -11580,9 +12254,9 @@
 	0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff
   };
 
-  if(HwDeviceExtension->jChipType == SIS_300) {
+  if(HwInfo->jChipType == SIS_300) {
 
-    tempbx = SiS_Pr->SiS_LCDResInfo - 2;
+    tempbx = (SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) & 0x0f) - 2;
     if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) tempbx += 4;
     if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) {
        if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx += 3;
@@ -11591,13 +12265,13 @@
        if(ROMAddr[0x235] & 0x80) {
           tempbx = SiS_Pr->SiS_LCDTypeInfo;
           if(Flag) {
-	    romptr = ROMAddr[0x255] | (ROMAddr[0x256] << 8);
-	    if(romptr) {
+	     romptr = ROMAddr[0x255] | (ROMAddr[0x256] << 8);
+	     if(romptr) {
 	        tempbx = ROMAddr[romptr + SiS_Pr->SiS_LCDTypeInfo];
-	    } else {
+	     } else {
 	        tempbx = customtable300[SiS_Pr->SiS_LCDTypeInfo];
-	    }
-            if(tempbx == 0xFF) return 0xFFFF;
+	     }
+             if(tempbx == 0xFF) return 0xFFFF;
           }
 	  tempbx <<= 1;
 	  if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) tempbx++;
@@ -11607,21 +12281,21 @@
   } else {
 
     if(Flag) {
-      if((ROMAddr) && SiS_Pr->SiS_UseROM) {
-         romptr = ROMAddr[0x255] | (ROMAddr[0x256] << 8);
-	 if(romptr) {
-	    tempbx = ROMAddr[romptr + SiS_Pr->SiS_LCDTypeInfo];
-	 } else {
-	    tempbx = 0xff;
-	 }
-      } else {
-         tempbx = customtable630[SiS_Pr->SiS_LCDTypeInfo];
-      }
-      if(tempbx == 0xFF) return 0xFFFF;
-      tempbx <<= 2;
-      if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) tempbx += 2;
-      if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx++;
-      return tempbx;
+       if((ROMAddr) && SiS_Pr->SiS_UseROM) {
+          romptr = ROMAddr[0x255] | (ROMAddr[0x256] << 8);
+	  if(romptr) {
+	     tempbx = ROMAddr[romptr + SiS_Pr->SiS_LCDTypeInfo];
+	  } else {
+	     tempbx = 0xff;
+	  }
+       } else {
+          tempbx = customtable630[SiS_Pr->SiS_LCDTypeInfo];
+       }
+       if(tempbx == 0xFF) return 0xFFFF;
+       tempbx <<= 2;
+       if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) tempbx += 2;
+       if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx++;
+       return tempbx;
     }
     tempbx = SiS_Pr->SiS_LCDTypeInfo << 2;
     if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) tempbx += 2;
@@ -11631,78 +12305,85 @@
 }
 
 static void
-SetOEMLCDDelay(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT BaseAddr,
-               UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex)
+SetOEMLCDDelay(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
+               USHORT ModeNo,USHORT ModeIdIndex)
 {
+  UCHAR  *ROMAddr = HwInfo->pjVirtualRomBase;
   USHORT index,temp,romptr=0;
 
+  if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_PanelCustom) return;
+
   if((ROMAddr) && SiS_Pr->SiS_UseROM) {
      if(!(ROMAddr[0x237] & 0x01)) return;
      if(!(ROMAddr[0x237] & 0x02)) return;
      romptr = ROMAddr[0x24b] | (ROMAddr[0x24c] << 8);
   }
 
-  /* TW: The Panel Compensation Delay should be set according to tables
-   *     here. Unfortunately, various BIOS versions don't case about
-   *     a uniform way using eg. ROM byte 0x220, but use different
-   *     hard coded delays (0x04, 0x20, 0x18) in SetGroup1().
-   *     Thus we don't set this if the user select a custom pdc or if
-   *     we otherwise detected a valid pdc.
+  /* The Panel Compensation Delay should be set according to tables
+   * here. Unfortunately, various BIOS versions don't case about
+   * a uniform way using eg. ROM byte 0x220, but use different
+   * hard coded delays (0x04, 0x20, 0x18) in SetGroup1().
+   * Thus we don't set this if the user select a custom pdc or if
+   * we otherwise detected a valid pdc.
    */
-  if(HwDeviceExtension->pdc) return;
+  if(SiS_Pr->PDC) return;
 
-  temp = GetOEMLCDPtr(SiS_Pr,HwDeviceExtension, ROMAddr, 0);
+  temp = GetOEMLCDPtr(SiS_Pr,HwInfo, 0);
 
-  index = SiS_Pr->SiS_VBModeIDTable[ModeIdIndex].VB_LCDDelayIndex;
+  if(SiS_Pr->UseCustomMode)
+     index = 0;
+  else
+     index = SiS_Pr->SiS_VBModeIDTable[ModeIdIndex].VB_LCDDelayIndex;
 
-  if(HwDeviceExtension->jChipType != SIS_300) {
+  if(HwInfo->jChipType != SIS_300) {
+     if(romptr) {
+	romptr += (temp * 2);
+	romptr = ROMAddr[romptr] | (ROMAddr[romptr + 1] << 8);
+	romptr += index;
+	temp = ROMAddr[romptr];
+     } else {
+	if(SiS_Pr->SiS_VBType & VB_SISVB) {
+    	   temp = SiS300_OEMLCDDelay2[temp][index];
+	} else {
+           temp = SiS300_OEMLCDDelay3[temp][index];
+        }
+     }
+  } else {
+     if((ROMAddr) && SiS_Pr->SiS_UseROM && (ROMAddr[0x235] & 0x80)) {
 	if(romptr) {
 	   romptr += (temp * 2);
 	   romptr = ROMAddr[romptr] | (ROMAddr[romptr + 1] << 8);
 	   romptr += index;
 	   temp = ROMAddr[romptr];
 	} else {
-	   if(SiS_Pr->SiS_IF_DEF_LVDS == 0) {
-    	      temp = SiS300_OEMLCDDelay2[temp][index];
+	   temp = SiS300_OEMLCDDelay5[temp][index];
+	}
+     } else {
+        if((ROMAddr) && SiS_Pr->SiS_UseROM) {
+	   romptr = ROMAddr[0x249] | (ROMAddr[0x24a] << 8);
+	   if(romptr) {
+	      romptr += (temp * 2);
+	      romptr = ROMAddr[romptr] | (ROMAddr[romptr + 1] << 8);
+	      romptr += index;
+	      temp = ROMAddr[romptr];
 	   } else {
-              temp = SiS300_OEMLCDDelay3[temp][index];
-           }
+	      temp = SiS300_OEMLCDDelay4[temp][index];
+	   }
+	} else {
+	   temp = SiS300_OEMLCDDelay4[temp][index];
 	}
-  } else {
-      if((ROMAddr) && SiS_Pr->SiS_UseROM && (ROMAddr[0x235] & 0x80)) {
-	  if(romptr) {
-	     romptr += (temp * 2);
-	     romptr = ROMAddr[romptr] | (ROMAddr[romptr + 1] << 8);
-	     romptr += index;
-	     temp = ROMAddr[romptr];
-	  } else {
-	     temp = SiS300_OEMLCDDelay5[temp][index];
-	  }
-      } else {
-          if((ROMAddr) && SiS_Pr->SiS_UseROM) {
-	     romptr = ROMAddr[0x249] | (ROMAddr[0x24a] << 8);
-	     if(romptr) {
-	        romptr += (temp * 2);
-	        romptr = ROMAddr[romptr] | (ROMAddr[romptr + 1] << 8);
-	        romptr += index;
-	        temp = ROMAddr[romptr];
-	     } else {
-	        temp = SiS300_OEMLCDDelay4[temp][index];
-	     }
-	  } else {
-	     temp = SiS300_OEMLCDDelay4[temp][index];
-	  }
-      }
+     }
   }
   temp &= 0x3c;
   SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,~0x3C,temp);  /* index 0A D[6:4] */
 }
 
 static void
-SetOEMLCDData(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT BaseAddr,
-               UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex)
+SetOEMLCDData(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
+              USHORT ModeNo,USHORT ModeIdIndex)
 {
-#if 0  /* TW: Unfinished; VData table missing */
+#if 0  /* Unfinished; Data table missing */
+  UCHAR  *ROMAddr = HwInfo->pjVirtualRomBase;
   USHORT index,temp;
 
   if((ROMAddr) && SiS_Pr->SiS_UseROM) {
@@ -11711,21 +12392,21 @@
      /* No rom pointer in BIOS header! */
   }
 
-  temp = GetOEMLCDPtr(SiS_Pr,HwDeviceExtension, ROMAddr, 1);
-  if(temp == 0xFFFF) return;
+  temp = GetOEMLCDPtr(SiS_Pr,HwInfo, 1);
+  if(temp = 0xFFFF) return;
 
   index = SiS_Pr->SiS_VBModeIDTable[ModeIdIndex]._VB_LCDHIndex;
   for(i=0x14, j=0; i<=0x17; i++, j++) {
-      SiS_SetReg1(SiS_Pr->SiS_Part1Port,i,SiS300_LCDHData[temp][index][j]);
+      SiS_SetReg(SiS_Pr->SiS_Part1Port,i,SiS300_LCDHData[temp][index][j]);
   }
   SiS_SetRegANDOR(SiS_SiS_Part1Port,0x1a, 0xf8, (SiS300_LCDHData[temp][index][j] & 0x07));
 
   index = SiS_Pr->SiS_VBModeIDTable[ModeIdIndex]._VB_LCDVIndex;
-  SiS_SetReg1(SiS_SiS_Part1Port,0x18, SiS300_LCDVData[temp][index][0]);
+  SiS_SetReg(SiS_SiS_Part1Port,0x18, SiS300_LCDVData[temp][index][0]);
   SiS_SetRegANDOR(SiS_SiS_Part1Port,0x19, 0xF0, SiS300_LCDVData[temp][index][1]);
   SiS_SetRegANDOR(SiS_SiS_Part1Port,0x1A, 0xC7, (SiS300_LCDVData[temp][index][2] & 0x38));
   for(i=0x1b, j=3; i<=0x1d; i++, j++) {
-      SiS_SetReg1(SiS_Pr->SiS_Part1Port,i,SiS300_LCDVData[temp][index][j]);
+      SiS_SetReg(SiS_Pr->SiS_Part1Port,i,SiS300_LCDVData[temp][index][j]);
   }
 #endif
 }
@@ -11737,21 +12418,22 @@
 
   index = 0;
   if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode))  index += 4;
-  if(SiS_Pr->SiS_IF_DEF_LVDS == 0) {
+  if(SiS_Pr->SiS_VBType & VB_SISVB) {
      if(SiS_Pr->SiS_VBInfo & SetCRT2ToSCART)  index += 2;
-     else if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVisionTV) index += 3;
-     else if(SiS_Pr->SiS_VBInfo & SetPALTV)   index += 1;
+     else if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) index += 3;
+     else if(SiS_Pr->SiS_TVMode & TVSetPAL)   index += 1;
   } else {
-     if(SiS_Pr->SiS_VBInfo & SetCHTVOverScan) index += 2;
-     if(SiS_Pr->SiS_VBInfo & SetPALTV)        index += 1;
+     if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) index += 2;
+     if(SiS_Pr->SiS_TVMode & TVSetPAL)        index += 1;
   }
   return index;
 }
 
 static void
-SetOEMTVDelay(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT BaseAddr,
-              UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex)
+SetOEMTVDelay(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
+              USHORT ModeNo,USHORT ModeIdIndex)
 {
+  UCHAR  *ROMAddr = HwInfo->pjVirtualRomBase;
   USHORT index,temp,romptr=0;
 
   if((ROMAddr) && SiS_Pr->SiS_UseROM) {
@@ -11770,7 +12452,7 @@
      romptr += index;
      temp = ROMAddr[romptr];
   } else {
-     if(SiS_Pr->SiS_IF_DEF_LVDS == 0) {
+     if(SiS_Pr->SiS_VBType & VB_SISVB) {
         temp = SiS300_OEMTVDelay301[temp][index];
      } else {
         temp = SiS300_OEMTVDelayLVDS[temp][index];
@@ -11781,10 +12463,10 @@
 }
 
 static void
-SetOEMAntiFlicker(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,
-                  USHORT BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,
-		  USHORT ModeIdIndex)
+SetOEMAntiFlicker(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
+                  USHORT ModeNo, USHORT ModeIdIndex)
 {
+  UCHAR  *ROMAddr = HwInfo->pjVirtualRomBase;
   USHORT index,temp,romptr=0;
 
   if((ROMAddr) && SiS_Pr->SiS_UseROM) {
@@ -11810,12 +12492,15 @@
 }
 
 static void
-SetOEMPhaseIncr(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT BaseAddr,
-                UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex)
+SetOEMPhaseIncr(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
+                USHORT ModeNo,USHORT ModeIdIndex)
 {
+  UCHAR  *ROMAddr = HwInfo->pjVirtualRomBase;
   USHORT index,i,j,temp,romptr=0;
 
-  if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVisionTV) return;
+  if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) return;
+
+  if(SiS_Pr->SiS_TVMode & (TVSetNTSC1024 | TVSetNTSCJ | TVSetPALM | TVSetPALN)) return;
 
   if((ROMAddr) && SiS_Pr->SiS_UseROM) {
      if(!(ROMAddr[0x238] & 0x01)) return;
@@ -11828,32 +12513,33 @@
   index = SiS_Pr->SiS_VBModeIDTable[ModeIdIndex].VB_TVPhaseIndex;
 
   if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
-       for(i=0x31, j=0; i<=0x34; i++, j++) {
-          SiS_SetReg1(SiS_Pr->SiS_Part2Port,i,SiS300_Phase2[temp][index][j]);
-       }
+     for(i=0x31, j=0; i<=0x34; i++, j++) {
+        SiS_SetReg(SiS_Pr->SiS_Part2Port,i,SiS300_Phase2[temp][index][j]);
+     }
   } else {
-       if(romptr) {
-          romptr += (temp * 2);
-	  romptr = ROMAddr[romptr] | (ROMAddr[romptr + 1] << 8);
-	  romptr += (index * 4);
-          for(i=0x31, j=0; i<=0x34; i++, j++) {
-	     SiS_SetReg1(SiS_Pr->SiS_Part2Port,i,ROMAddr[romptr + j]);
-	  }
-       } else {
-          for(i=0x31, j=0; i<=0x34; i++, j++) {
-             SiS_SetReg1(SiS_Pr->SiS_Part2Port,i,SiS300_Phase1[temp][index][j]);
-	  }
-       }
+     if(romptr) {
+        romptr += (temp * 2);
+	romptr = ROMAddr[romptr] | (ROMAddr[romptr + 1] << 8);
+	romptr += (index * 4);
+        for(i=0x31, j=0; i<=0x34; i++, j++) {
+	   SiS_SetReg(SiS_Pr->SiS_Part2Port,i,ROMAddr[romptr + j]);
+	}
+     } else {
+        for(i=0x31, j=0; i<=0x34; i++, j++) {
+           SiS_SetReg(SiS_Pr->SiS_Part2Port,i,SiS300_Phase1[temp][index][j]);
+	}
+     }
   }
 }
 
 static void
-SetOEMYFilter(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT BaseAddr,
-              UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex)
+SetOEMYFilter(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
+              USHORT ModeNo,USHORT ModeIdIndex)
 {
-  USHORT index,temp,temp1,i,j,romptr=0;
+  UCHAR  *ROMAddr = HwInfo->pjVirtualRomBase;
+  USHORT index,temp,i,j,romptr=0;
 
-  if(SiS_Pr->SiS_VBInfo & (SetCRT2ToSCART | SetCRT2ToHiVisionTV)) return;
+  if(SiS_Pr->SiS_VBInfo & (SetCRT2ToSCART | SetCRT2ToHiVision | SetCRT2ToYPbPr525750)) return;
 
   if((ROMAddr) && SiS_Pr->SiS_UseROM) {
      if(!(ROMAddr[0x238] & 0x01)) return;
@@ -11863,64 +12549,85 @@
 
   temp = GetOEMTVPtr(SiS_Pr);
 
+  if(SiS_Pr->SiS_TVMode & TVSetPALM)      temp = 8;
+  else if(SiS_Pr->SiS_TVMode & TVSetPALN) temp = 9;
+  /* NTSCJ uses NTSC filters */
+
   index = SiS_Pr->SiS_VBModeIDTable[ModeIdIndex].VB_TVYFilterIndex;
 
-  if(HwDeviceExtension->jChipType > SIS_300) {
-     if(SiS_GetReg1(SiS_Pr->SiS_P3d4,0x31) & 0x01) {
-       temp1 = SiS_GetReg1(SiS_Pr->SiS_P3d4,0x35);
-       if(temp1 & (EnablePALM | EnablePALN)) {
-          temp = 8;
-	  if(!(temp1 & EnablePALM)) temp = 9;
-       }
-     }
-  }
   if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
       for(i=0x35, j=0; i<=0x38; i++, j++) {
-       	SiS_SetReg1(SiS_Pr->SiS_Part2Port,i,SiS300_Filter2[temp][index][j]);
+       	SiS_SetReg(SiS_Pr->SiS_Part2Port,i,SiS300_Filter2[temp][index][j]);
       }
       for(i=0x48; i<=0x4A; i++, j++) {
-     	SiS_SetReg1(SiS_Pr->SiS_Part2Port,i,SiS300_Filter2[temp][index][j]);
+     	SiS_SetReg(SiS_Pr->SiS_Part2Port,i,SiS300_Filter2[temp][index][j]);
       }
   } else {
-      if(romptr) {
+      if((romptr) && (!(SiS_Pr->SiS_TVMode & (TVSetPALM|TVSetPALN)))) {
          romptr += (temp * 2);
 	 romptr = ROMAddr[romptr] | (ROMAddr[romptr + 1] << 8);
 	 romptr += (index * 4);
 	 for(i=0x35, j=0; i<=0x38; i++, j++) {
-       	    SiS_SetReg1(SiS_Pr->SiS_Part2Port,i,ROMAddr[romptr + j]);
+       	    SiS_SetReg(SiS_Pr->SiS_Part2Port,i,ROMAddr[romptr + j]);
          }
       } else {
          for(i=0x35, j=0; i<=0x38; i++, j++) {
-       	    SiS_SetReg1(SiS_Pr->SiS_Part2Port,i,SiS300_Filter1[temp][index][j]);
+       	    SiS_SetReg(SiS_Pr->SiS_Part2Port,i,SiS300_Filter1[temp][index][j]);
          }
       }
   }
 }
 
+static USHORT
+SiS_SearchVBModeID(SiS_Private *SiS_Pr, USHORT *ModeNo)
+{
+   USHORT ModeIdIndex;
+   UCHAR VGAINFO = SiS_Pr->SiS_VGAINFO;
+
+   if(*ModeNo <= 5) *ModeNo |= 1;
+
+   for(ModeIdIndex=0; ; ModeIdIndex++) {
+      if(SiS_Pr->SiS_VBModeIDTable[ModeIdIndex].ModeID == *ModeNo) break;
+      if(SiS_Pr->SiS_VBModeIDTable[ModeIdIndex].ModeID == 0xFF)    return 0;
+   }
+
+   if(*ModeNo != 0x07) {
+      if(*ModeNo > 0x03) return ModeIdIndex;
+      if(VGAINFO & 0x80) return ModeIdIndex;
+      ModeIdIndex++;
+   }
+
+   if(VGAINFO & 0x10) ModeIdIndex++;   /* 400 lines */
+	                               /* else 350 lines */
+   return ModeIdIndex;
+}
+
 void
-SiS_OEM300Setting(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,
-		  USHORT BaseAddr,UCHAR *ROMAddr,USHORT ModeNo)
+SiS_OEM300Setting(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
+		  USHORT ModeNo, USHORT ModeIdIndex, USHORT RefTableIndex)
 {
-  USHORT ModeIdIndex;
+  USHORT OEMModeIdIndex=0;
 
-  ModeIdIndex = SiS_SearchVBModeID(SiS_Pr,ROMAddr,&ModeNo);
-  if(!(ModeIdIndex)) return;
+  if(!SiS_Pr->UseCustomMode) {
+     OEMModeIdIndex = SiS_SearchVBModeID(SiS_Pr,&ModeNo);
+     if(!(OEMModeIdIndex)) return;
+  }
 
   if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
-       SetOEMLCDDelay(SiS_Pr,HwDeviceExtension,BaseAddr,ROMAddr,ModeNo,ModeIdIndex);
-       if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
-            SetOEMLCDData(SiS_Pr,HwDeviceExtension,BaseAddr,ROMAddr,ModeNo,ModeIdIndex);
-       }
+     SetOEMLCDDelay(SiS_Pr, HwInfo, ModeNo, OEMModeIdIndex);
+     if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
+        SetOEMLCDData(SiS_Pr, HwInfo, ModeNo, OEMModeIdIndex);
+     }
   }
+  if(SiS_Pr->UseCustomMode) return;
   if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
-       SetOEMTVDelay(SiS_Pr,HwDeviceExtension,BaseAddr,ROMAddr,ModeNo,ModeIdIndex);
-       if(SiS_Pr->SiS_IF_DEF_LVDS == 0) {
-       		SetOEMAntiFlicker(SiS_Pr,HwDeviceExtension,BaseAddr,ROMAddr,ModeNo,ModeIdIndex);
-    		SetOEMPhaseIncr(SiS_Pr,HwDeviceExtension,BaseAddr,ROMAddr,ModeNo,ModeIdIndex);
-       		SetOEMYFilter(SiS_Pr,HwDeviceExtension,BaseAddr,ROMAddr,ModeNo,ModeIdIndex);
-       }
+     SetOEMTVDelay(SiS_Pr, HwInfo, ModeNo,OEMModeIdIndex);
+     if(SiS_Pr->SiS_VBType & VB_SISVB) {
+        SetOEMAntiFlicker(SiS_Pr, HwInfo, ModeNo, OEMModeIdIndex);
+    	SetOEMPhaseIncr(SiS_Pr, HwInfo, ModeNo, OEMModeIdIndex);
+       	SetOEMYFilter(SiS_Pr, HwInfo, ModeNo, OEMModeIdIndex);
+     }
   }
 }
 #endif
 
-
--- diff/drivers/video/sis/init301.h	2003-10-09 09:47:17.000000000 +0100
+++ source/drivers/video/sis/init301.h	2004-02-09 10:39:55.000000000 +0000
@@ -1,20 +1,66 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/init301.h,v 1.4 2000/12/02 01:16:17 dawes Exp $ */
+/* $XFree86$ */
+/*
+ * Data and prototypes for init301.c
+ *
+ * Copyright (C) 2001-2004 by Thomas Winischhofer, Vienna, Austria
+ *
+ * If distributed as part of the Linux kernel, the following license terms
+ * apply:
+ *
+ * * 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 named License,
+ * * or 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
+ *
+ * Otherwise, the following license terms apply:
+ *
+ * * 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) All advertising materials mentioning features or use of this software
+ * *    must display the following acknowledgement: "This product includes
+ * *    software developed by Thomas Winischhofer, Vienna, Austria."
+ * * 4) The name of the author may not be used to endorse or promote products
+ * *    derived from this software without specific prior written permission.
+ * *
+ * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
+ *
+ * Author: 	Thomas Winischhofer <thomas@winischhofer.net>
+ *
+ */
+
 #ifndef  _INIT301_
 #define  _INIT301_
 
 #include "osdef.h"
+
 #include "initdef.h"
 #include "vgatypes.h"
 #include "vstruct.h"
 
-#ifdef TC
-#include <stdio.h>
-#include <string.h>
-#include <conio.h>
-#include <dos.h>
-#include <stdlib.h>
-#endif
-
 #ifdef LINUX_XF86
 #include "xf86.h"
 #include "xf86Pci.h"
@@ -24,6 +70,9 @@
 #endif
 
 #ifdef LINUX_KERNEL
+#ifdef SIS_CP
+#undef SIS_CP
+#endif
 #include <linux/config.h>
 #include <linux/version.h>
 #include <asm/io.h>
@@ -35,304 +84,36 @@
 #endif
 #endif
 
-#ifdef WIN2000
-#include <stdio.h>
-#include <string.h>
-#include <miniport.h>
-#include "dderror.h"
-#include "devioctl.h"
-#include "miniport.h"
-#include "ntddvdeo.h"
-#include "video.h"
-#include "sisv.h"
-#endif
-
-#if 0
-extern   const USHORT   SiS_MDA_DAC[];
-extern   const USHORT   SiS_CGA_DAC[];
-extern   const USHORT   SiS_EGA_DAC[];
-extern   const USHORT   SiS_VGA_DAC[];
-#endif
-
-extern   BOOLEAN  SiS_SearchVBModeID(SiS_Private *SiS_Pr, UCHAR *RomAddr, USHORT *);
-
-BOOLEAN  SiS_Is301B(SiS_Private *SiS_Pr, USHORT BaseAddr);
-BOOLEAN  SiS_IsNotM650or651(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
-BOOLEAN  SiS_IsDisableCRT2(SiS_Private *SiS_Pr, USHORT BaseAddr);
-BOOLEAN  SiS_IsVAMode(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
-BOOLEAN  SiS_IsDualEdge(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
-BOOLEAN  SiS_CRT2IsLCD(SiS_Private *SiS_Pr, USHORT BaseAddr, PSIS_HW_DEVICE_INFO HwDeviceExtension);
-void     SiS_SetDefCRT2ExtRegs(SiS_Private *SiS_Pr, USHORT BaseAddr);
-USHORT   SiS_GetRatePtrCRT2(SiS_Private *SiS_Pr, UCHAR *ROMAddr, USHORT ModeNo,USHORT ModeIdIndex,
-                            PSIS_HW_DEVICE_INFO HwDeviceExtension);
-BOOLEAN  SiS_AdjustCRT2Rate(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT MODEIdIndex,
-                            USHORT RefreshRateTableIndex,USHORT *i,PSIS_HW_DEVICE_INFO HwDeviceExtension);
-void     SiS_SaveCRT2Info(SiS_Private *SiS_Pr, USHORT ModeNo);
-void     SiS_GetCRT2Data(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
-		         USHORT RefreshRateTableIndex,PSIS_HW_DEVICE_INFO HwDeviceExtension);
-void     SiS_GetCRT2DataLVDS(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
-                             USHORT RefreshRateTableIndex,PSIS_HW_DEVICE_INFO HwDeviceExtension);
-#ifdef SIS315H			     
-void     SiS_GetCRT2PtrA(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
-                         USHORT RefreshRateTableIndex,USHORT *CRT2Index,USHORT *ResIndex);
-#endif
-void     SiS_GetCRT2Part2Ptr(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
-		             USHORT RefreshRateTableIndex,USHORT *CRT2Index, USHORT *ResIndex);
-void     SiS_GetCRT2Data301(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
-                            USHORT RefreshRateTableIndex,PSIS_HW_DEVICE_INFO HwDeviceExtension);
-USHORT   SiS_GetResInfo(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex);
-void     SiS_GetCRT2ResInfo(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
-                            PSIS_HW_DEVICE_INFO HwDeviceExtension);
-void     SiS_GetRAMDAC2DATA(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
-                            USHORT RefreshRateTableIndex,PSIS_HW_DEVICE_INFO HwDeviceExtension);
-void     SiS_GetCRT2Ptr(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
-                        USHORT RefreshRateTableIndex,USHORT *CRT2Index,USHORT *ResIndex,
-			PSIS_HW_DEVICE_INFO HwDeviceExtension);
-void     SiS_SetCRT2ModeRegs(SiS_Private *SiS_Pr, USHORT BaseAddr,USHORT ModeNo,USHORT ModeIdIndex,
-                             PSIS_HW_DEVICE_INFO );
-void     SiS_SetHiVision(SiS_Private *SiS_Pr, USHORT BaseAddr,PSIS_HW_DEVICE_INFO HwDeviceExtension);
-void     SiS_GetLVDSDesData(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
-			    USHORT RefreshRateTableIndex,PSIS_HW_DEVICE_INFO HwDeviceExtension);
-void     SiS_SetCRT2Offset(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
-                           USHORT RefreshRateTableIndex,PSIS_HW_DEVICE_INFO HwDeviceExtension);
-USHORT   SiS_GetOffset(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
-                       USHORT RefreshRateTableIndex,PSIS_HW_DEVICE_INFO HwDeviceExtension);
-USHORT   SiS_GetColorDepth(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex);
-USHORT   SiS_GetMCLK(SiS_Private *SiS_Pr, UCHAR *ROMAddr, PSIS_HW_DEVICE_INFO HwDeviceExtension);
-USHORT   SiS_CalcDelayVB(SiS_Private *SiS_Pr);
-USHORT   SiS_GetVCLK2Ptr(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
-                         USHORT RefreshRateTableIndex,PSIS_HW_DEVICE_INFO HwDeviceExtension);
-void     SiS_SetCRT2Sync(SiS_Private *SiS_Pr, USHORT BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,
-                         USHORT RefreshRateTableIndex,PSIS_HW_DEVICE_INFO HwDeviceExtension);
-void     SiS_SetRegANDOR(USHORT Port,USHORT Index,USHORT DataAND,USHORT DataOR);
-void     SiS_SetRegOR(USHORT Port,USHORT Index,USHORT DataOR);
-void     SiS_SetRegAND(USHORT Port,USHORT Index,USHORT DataAND);
-USHORT   SiS_GetVGAHT2(SiS_Private *SiS_Pr);
-void     SiS_Set300Part2Regs(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,
-    	 		     USHORT ModeIdIndex, USHORT RefreshRateTableIndex,
-			     USHORT BaseAddr, USHORT ModeNo);
-void     SiS_SetGroup2(SiS_Private *SiS_Pr, USHORT BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
-                       USHORT RefreshRateTableIndex,PSIS_HW_DEVICE_INFO HwDeviceExtension);
-void     SiS_SetGroup3(SiS_Private *SiS_Pr, USHORT BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
-                       PSIS_HW_DEVICE_INFO HwDeviceExtension);
-void     SiS_SetGroup4(SiS_Private *SiS_Pr, USHORT  BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
-                       USHORT RefreshRateTableIndex,PSIS_HW_DEVICE_INFO HwDeviceExtension);
-void     SiS_SetGroup5(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO, USHORT  BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,
-                       USHORT ModeIdIndex);
-void     SiS_FinalizeLCD(SiS_Private *SiS_Pr, USHORT BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
-                         PSIS_HW_DEVICE_INFO HwDeviceExtension);
-void     SiS_SetCRT2VCLK(SiS_Private *SiS_Pr, USHORT BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
-                         USHORT RefreshRateTableIndex,PSIS_HW_DEVICE_INFO HwDeviceExtension);
-void     SiS_EnableCRT2(SiS_Private *SiS_Pr);
-void     SiS_GetVBInfo(SiS_Private *SiS_Pr, USHORT BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
-                       PSIS_HW_DEVICE_INFO HwDeviceExtension, int checkcrt2mode);
-BOOLEAN  SiS_BridgeIsOn(SiS_Private *SiS_Pr, USHORT BaseAddr,PSIS_HW_DEVICE_INFO);
-BOOLEAN  SiS_BridgeIsEnable(SiS_Private *SiS_Pr, USHORT BaseAddr,PSIS_HW_DEVICE_INFO);
-BOOLEAN  SiS_BridgeInSlave(SiS_Private *SiS_Pr);
-void     SiS_PresetScratchregister(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension);
-void     SiS_SetTVSystem(SiS_Private *SiS_Pr);
-void     SiS_LongWait(SiS_Private *SiS_Pr);
-USHORT   SiS_GetQueueConfig(SiS_Private *SiS_Pr);
-void     SiS_VBLongWait(SiS_Private *SiS_Pr);
-USHORT   SiS_GetVCLKLen(SiS_Private *SiS_Pr, UCHAR *ROMAddr);
-void     SiS_WaitVBRetrace(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension);
-void     SiS_WaitRetrace1(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension);
-void     SiS_WaitRetrace2(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension);
-void     SiS_WaitRetraceDDC(SiS_Private *SiS_Pr);
-void     SiS_SetCRT2ECLK(SiS_Private *SiS_Pr, UCHAR *ROMAddr, USHORT ModeNo,USHORT ModeIdIndex,
-                         USHORT RefreshRateTableIndex,PSIS_HW_DEVICE_INFO HwDeviceExtension);
-void     SiS_GetLVDSDesPtr(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
-                           USHORT RefreshRateTableIndex,USHORT *PanelIndex,USHORT *ResIndex,
-			   PSIS_HW_DEVICE_INFO HwDeviceExtension);
-#ifdef SIS315H			   
-void     SiS_GetLVDSDesPtrA(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
-                            USHORT RefreshRateTableIndex,USHORT *PanelIndex,USHORT *ResIndex);
-#endif			    
-void     SiS_SetTPData(SiS_Private *SiS_Pr);
-void     SiS_WhatIsThis(SiS_Private *SiS_Pr, USHORT myvbinfo);
-void     SiS_ModCRT1CRTC(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
-                         USHORT RefreshRateTableIndex,PSIS_HW_DEVICE_INFO HwDeviceExtension);
-void     SiS_SetCHTVReg(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
-                        USHORT RefreshRateTableIndex);
-void     SiS_GetCHTVRegPtr(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
-                           USHORT RefreshRateTableIndex);
-void     SiS_SetCH700x(SiS_Private *SiS_Pr, USHORT tempax);
-USHORT   SiS_GetCH700x(SiS_Private *SiS_Pr, USHORT tempax);
-void     SiS_SetCH701x(SiS_Private *SiS_Pr, USHORT tempax);
-USHORT   SiS_GetCH701x(SiS_Private *SiS_Pr, USHORT tempax);
-void     SiS_SetCH70xx(SiS_Private *SiS_Pr, USHORT tempax);
-USHORT   SiS_GetCH70xx(SiS_Private *SiS_Pr, USHORT tempax);
-#ifdef LINUX_XF86
-USHORT   SiS_I2C_GetByte(SiS_Private *SiS_Pr);
-Bool     SiS_I2C_PutByte(SiS_Private *SiS_Pr, USHORT data);
-Bool     SiS_I2C_Address(SiS_Private *SiS_Pr, USHORT addr);
-void     SiS_I2C_Stop(SiS_Private *SiS_Pr);
-#endif
-void     SiS_SetCH70xxANDOR(SiS_Private *SiS_Pr, USHORT tempax,USHORT tempbh);
-void     SiS_SetSwitchDDC2(SiS_Private *SiS_Pr);
-USHORT   SiS_SetStart(SiS_Private *SiS_Pr);
-USHORT   SiS_SetStop(SiS_Private *SiS_Pr);
-void     SiS_DDC2Delay(SiS_Private *SiS_Pr, USHORT delaytime);
-USHORT   SiS_SetSCLKLow(SiS_Private *SiS_Pr);
-USHORT   SiS_SetSCLKHigh(SiS_Private *SiS_Pr);
-USHORT   SiS_ReadDDC2Data(SiS_Private *SiS_Pr, USHORT tempax);
-USHORT   SiS_WriteDDC2Data(SiS_Private *SiS_Pr, USHORT tempax);
-USHORT   SiS_CheckACK(SiS_Private *SiS_Pr);
-USHORT   SiS_ReadLCDDDC(SiS_Private *SiS_Pr, USHORT length, unsigned char *buffer);
-#ifdef LINUX_XF86
-USHORT   SiS_SenseLCDDDC(SiS_Private *SiS_Pr, SISPtr pSiS);
-USHORT   SiS_SenseVGA2DDC(SiS_Private *SiS_Pr, SISPtr pSiS);
-#endif
-#ifdef SIS315H
-void     SiS_OEM310Setting(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT BaseAddr,
-                           UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex);
-void     SiS_OEMLCD(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT BaseAddr,
-                    UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex);
-#endif
-#ifdef SIS300
-void     SiS_OEM300Setting(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT BaseAddr,
-                           UCHAR *ROMAddr,USHORT ModeNo);
-#endif
-BOOLEAN  SiS_LowModeStuff(SiS_Private *SiS_Pr, USHORT ModeNo,PSIS_HW_DEVICE_INFO HwDeviceExtension);
-
-BOOLEAN  SiS_GetLCDResInfo(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo, USHORT ModeIdIndex,
-                           PSIS_HW_DEVICE_INFO HwDeviceExtension);
-/* void    SiS_CHACRT1CRTC(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
-                        USHORT RefreshRateTableIndex); */
-
-BOOLEAN  SiS_SetCRT2Group301(SiS_Private *SiS_Pr, USHORT BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,
-                             PSIS_HW_DEVICE_INFO HwDeviceExtension);
-void     SiS_SetGroup1(SiS_Private *SiS_Pr, USHORT BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
-                       PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT RefreshRateTableIndex);
-void     SiS_SetGroup1_LVDS(SiS_Private *SiS_Pr, USHORT BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
-                            PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT RefreshRateTableIndex);
-#ifdef SIS315H			    
-void     SiS_SetGroup1_LCDA(SiS_Private *SiS_Pr, USHORT  BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
-                            PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT RefreshRateTableIndex);
-#endif			    
-void     SiS_SetGroup1_301(SiS_Private *SiS_Pr, USHORT BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
-                           PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT RefreshRateTableIndex);
-#ifdef SIS300
-void     SiS_SetCRT2FIFO_300(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,
-                             PSIS_HW_DEVICE_INFO HwDeviceExtension);
-#endif
-#ifdef SIS315H
-void     SiS_SetCRT2FIFO_310(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,
-                             PSIS_HW_DEVICE_INFO HwDeviceExtension);
-void     SiS_CRT2AutoThreshold(SiS_Private *SiS_Pr, USHORT  BaseAddr);
-#endif
-BOOLEAN  SiS_GetLCDDDCInfo(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension);
-void     SiS_UnLockCRT2(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO,USHORT BaseAddr);
-void     SiS_LockCRT2(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO,USHORT BaseAddr);
-void     SiS_DisableBridge(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO,USHORT  BaseAddr);
-void     SiS_EnableBridge(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO,USHORT BaseAddr);
-void     SiS_SetPanelDelay(SiS_Private *SiS_Pr, UCHAR* ROMAddr,PSIS_HW_DEVICE_INFO,USHORT DelayTime);
-void     SiS_SetPanelDelayLoop(SiS_Private *SiS_Pr, UCHAR *ROMAddr, PSIS_HW_DEVICE_INFO HwDeviceExtension,
-                               USHORT DelayTime, USHORT DelayLoop);
-void     SiS_ShortDelay(SiS_Private *SiS_Pr, USHORT delay);
-void     SiS_LongDelay(SiS_Private *SiS_Pr, USHORT delay);
-void     SiS_GenericDelay(SiS_Private *SiS_Pr, USHORT delay);
-void     SiS_VBWait(SiS_Private *SiS_Pr);
-
-void     SiS_SiS30xBLOn(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension);
-void     SiS_SiS30xBLOff(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension);
-
-void     SiS_Chrontel701xBLOn(SiS_Private *SiS_Pr);
-void     SiS_Chrontel701xBLOff(SiS_Private *SiS_Pr);
-#ifdef SIS315H
-void     SiS_Chrontel701xOn(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,
-                            USHORT BaseAddr);
-void     SiS_Chrontel701xOff(SiS_Private *SiS_Pr);
-void     SiS_ChrontelResetDB(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
-void     SiS_ChrontelDoSomething4(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
-void     SiS_ChrontelDoSomething3(SiS_Private *SiS_Pr, USHORT ModeNo, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
-void     SiS_ChrontelDoSomething2(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
-void     SiS_ChrontelDoSomething1(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
-BOOLEAN  SiS_WeHaveBacklightCtrl(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
-void     SiS_ChrontelPowerSequencing(SiS_Private *SiS_Pr);
-void     SiS_SetCH701xForLCD(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
-#ifdef NEWCH701x
-void     SiS_ChrontelDoSomething5(SiS_Private *SiS_Pr);
-#endif
-#endif /* 315 */
-#if 0
-BOOLEAN  SiS_IsSomethingCR5F(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
-#endif
-BOOLEAN  SiS_IsYPbPr(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
-BOOLEAN  SiS_IsChScart(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
-BOOLEAN  SiS_IsTVOrYPbPrOrScart(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
-BOOLEAN  SiS_IsLCDOrLCDA(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
-BOOLEAN  SiS_CR36BIOSWord23b(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension);
-BOOLEAN  SiS_CR36BIOSWord23d(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension);
-BOOLEAN  SiS_IsSR13_CR30(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension);
-
-extern   void     SiS_SetReg1(USHORT, USHORT, USHORT);
-extern   void     SiS_SetReg3(USHORT, USHORT);
-extern   UCHAR    SiS_GetReg1(USHORT, USHORT);
-extern   UCHAR    SiS_GetReg2(USHORT);
-extern   BOOLEAN  SiS_SearchModeID(SiS_Private *SiS_Pr, UCHAR *ROMAddr, USHORT *ModeNo,USHORT *ModeIdIndex);
-extern   BOOLEAN  SiS_GetRatePtr(SiS_Private *SiS_Pr, ULONG, USHORT);
-extern   void     SiS_SetReg4(USHORT, ULONG);
-extern   ULONG    SiS_GetReg3(USHORT);
-extern   void     SiS_SetReg5(USHORT, USHORT);
-extern   USHORT   SiS_GetReg4(USHORT);
-extern   void     SiS_DisplayOff(SiS_Private *SiS_Pr);
-extern   void     SiS_DisplayOn(SiS_Private *SiS_Pr);
-extern   UCHAR    SiS_GetModePtr(SiS_Private *SiS_Pr, UCHAR *ROMAddr, USHORT ModeNo,USHORT ModeIdIndex);
-extern   BOOLEAN  SiS_GetLCDACRT1Ptr(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
-		                     USHORT RefreshRateTableIndex,USHORT *ResInfo,USHORT *DisplayType);
-extern   BOOLEAN  SiS_GetLVDSCRT1Ptr(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
-                                     USHORT RefreshRateTableIndex,USHORT *ResInfo,USHORT *DisplayType);
-extern   void     SiS_LoadDAC(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO, UCHAR *ROMAddr,USHORT ModeNo,
-                              USHORT ModeIdIndex);
-#ifdef SIS315H
-extern   UCHAR    SiS_Get310DRAMType(SiS_Private *SiS_Pr, UCHAR *ROMAddr,PSIS_HW_DEVICE_INFO HwDeviceExtension);
-#endif
-
-#ifdef LINUX_XF86
-/* DDC functions */
-USHORT   SiS_InitDDCRegs(SiS_Private *SiS_Pr, SISPtr pSiS, USHORT adaptnum, USHORT DDCdatatype, BOOLEAN checkcr32);
-USHORT   SiS_WriteDABDDC(SiS_Private *SiS_Pr);
-USHORT   SiS_PrepareReadDDC(SiS_Private *SiS_Pr);
-USHORT   SiS_PrepareDDC(SiS_Private *SiS_Pr);
-void     SiS_SendACK(SiS_Private *SiS_Pr, USHORT yesno);
-USHORT   SiS_DoProbeDDC(SiS_Private *SiS_Pr);
-USHORT   SiS_ProbeDDC(SiS_Private *SiS_Pr);
-USHORT   SiS_ReadDDC(SiS_Private *SiS_Pr, SISPtr pSiS, USHORT DDCdatatype, unsigned char *buffer);
-USHORT   SiS_HandleDDC(SiS_Private *SiS_Pr, SISPtr pSiS, USHORT adaptnum,
-                       USHORT DDCdatatype, unsigned char *buffer);
-#endif
-
-const UCHAR SiS_HiVisionTable[3][64] = {
-  { 
-    0x17, 0x1d, 0x03, 0x09, 0x05, 0x06, 0x0c, 0x0c,
-    0x94, 0x49, 0x01, 0x0a, 0x06, 0x0d, 0x04, 0x0a,
-    0x06, 0x14, 0x0d, 0x04, 0x0a, 0x00, 0x85, 0x1b,
-    0x0c, 0x50, 0x00, 0x97, 0x00, 0xd4, 0x4a, 0x17,
-    0x7d, 0x05, 0x4b, 0x00, 0x00, 0xe2, 0x00, 0x02,
-    0x03, 0x0a, 0x65, 0x9d, 0x08, 0x92, 0x8f, 0x40,
-    0x60, 0x80, 0x14, 0x90, 0x8c, 0x60, 0x14, 0x53,
-    0x00, 0x40, 0x44, 0x00, 0xdb, 0x02, 0x3b, 0x00
+const UCHAR SiS_YPbPrTable[3][64] = {
+  {
+    0x17,0x1d,0x03,0x09,0x05,0x06,0x0c,0x0c,
+    0x94,0x49,0x01,0x0a,0x06,0x0d,0x04,0x0a,
+    0x06,0x14,0x0d,0x04,0x0a,0x00,0x85,0x1b,
+    0x0c,0x50,0x00,0x97,0x00,0xda,0x4a,0x17,
+    0x7d,0x05,0x4b,0x00,0x00,0xe2,0x00,0x02,
+    0x03,0x0a,0x65,0x9d,0x08,0x92,0x8f,0x40,
+    0x60,0x80,0x14,0x90,0x8c,0x60,0x14,0x53,
+    0x00,0x40,0x44,0x00,0xdb,0x02,0x3b,0x00
   },
-  { 
-    0x1d, 0x1d, 0x06, 0x09, 0x0b, 0x0c, 0x0c, 0x0c,
-    0x98, 0x0a, 0x01, 0x0d, 0x06, 0x0d, 0x04, 0x0a,
-    0x06, 0x14, 0x0d, 0x04, 0x0a, 0x00, 0x85, 0x3f,
-    0x0c, 0x50, 0xb2, 0x2e, 0x16, 0xb5, 0xf4, 0x03,
-    0x7d, 0x11, 0x7d, 0xea, 0x30, 0x36, 0x18, 0x96,
-    0x21, 0x0a, 0x58, 0xee, 0x42, 0x92, 0x0f, 0x40,
-    0x60, 0x80, 0x14, 0x90, 0x8c, 0x60, 0x04, 0xf3,
-    0x00, 0x40, 0x11, 0x00, 0xfc, 0xff, 0x32, 0x00
+  {
+    0x1d,0x11,0x06,0x09,0x0b,0x0c,0x0c,0x0c,
+    0x98,0x0a,0x01,0x0d,0x06,0x0d,0x04,0x0a,
+    0x06,0x14,0x0d,0x04,0x0a,0x00,0x85,0x3f,
+    0x0c,0x50,0xb2,0x9f,0x16,0x59,0x4f,0x13,
+    0xad,0x11,0xad,0x1d,0x40,0x8a,0x3d,0xb8,
+    0x51,0x5e,0x60,0x49,0x7d,0x92,0x0f,0x40,
+    0x60,0x80,0x14,0x90,0x8c,0x60,0x14,0x4b,
+    0x43,0x41,0x11,0x00,0xfc,0xff,0x32,0x00
   },
-  { 
-    0x13, 0x1d, 0xe8, 0x09, 0x09, 0xed, 0x0c, 0x0c, 
-    0x98, 0x0a, 0x01, 0x0c, 0x06, 0x0d, 0x04, 0x0a, 
-    0x06, 0x14, 0x0d, 0x04, 0x0a, 0x00, 0x85, 0x3f, 
-    0xed, 0x50, 0x70, 0x9f, 0x16, 0x59, 0x2b, 0x13, 
-    0x27, 0x0b, 0x27, 0xfc, 0x30, 0x27, 0x1c, 0xb0, 
-    0x4b, 0x4b, 0x6f, 0x2f, 0x63, 0x92, 0x0f, 0x40, 
-    0x60, 0x80, 0x14, 0x90, 0x8c, 0x60, 0x14, 0x2a, 
-    0x00, 0x40, 0x11, 0x00, 0xfc, 0xff, 0x32, 0x00 
+  {
+    0x13,0x1d,0xe8,0x09,0x09,0xed,0x0c,0x0c,
+    0x98,0x0a,0x01,0x0c,0x06,0x0d,0x04,0x0a,
+    0x06,0x14,0x0d,0x04,0x0a,0x00,0x85,0x3f,
+    0xed,0x50,0x70,0x9f,0x16,0x59,0x2b,0x13,
+    0x27,0x0b,0x27,0xfc,0x30,0x27,0x1c,0xb0,
+    0x4b,0x4b,0x6f,0x2f,0x63,0x92,0x0f,0x40,
+    0x60,0x80,0x14,0x90,0x8c,0x60,0x14,0x27,
+    0x00,0x40,0x11,0x00,0xfc,0xff,0x32,0x00
   }
 };
 
@@ -358,4 +139,204 @@
     0x18, 0x1d, 0x23, 0x28, 0x4c, 0xaa, 0x01
 };
 
+/* 301C / 302ELV (?) extended Part2 TV registers */
+
+static const UCHAR SiS_Part2CLVX_1[] = {
+    0x00,0x00,
+    0x00,0x20,0x00,0x00,0x7F,0x20,0x02,0x7F,0x7D,0x20,0x04,0x7F,0x7D,0x1F,0x06,0x7E,
+    0x7C,0x1D,0x09,0x7E,0x7C,0x1B,0x0B,0x7E,0x7C,0x19,0x0E,0x7D,0x7C,0x17,0x11,0x7C,
+    0x7C,0x14,0x14,0x7C,0x7C,0x11,0x17,0x7C,0x7D,0x0E,0x19,0x7C,0x7E,0x0B,0x1B,0x7C,
+    0x7E,0x09,0x1D,0x7C,0x7F,0x06,0x1F,0x7C,0x7F,0x04,0x20,0x7D,0x00,0x02,0x20,0x7E
+};
+
+static const UCHAR SiS_Part2CLVX_2[] = {
+    0x00,0x00,
+    0x00,0x20,0x00,0x00,0x7F,0x20,0x02,0x7F,0x7D,0x20,0x04,0x7F,0x7D,0x1F,0x06,0x7E,
+    0x7C,0x1D,0x09,0x7E,0x7C,0x1B,0x0B,0x7E,0x7C,0x19,0x0E,0x7D,0x7C,0x17,0x11,0x7C,
+    0x7C,0x14,0x14,0x7C,0x7C,0x11,0x17,0x7C,0x7D,0x0E,0x19,0x7C,0x7E,0x0B,0x1B,0x7C,
+    0x7E,0x09,0x1D,0x7C,0x7F,0x06,0x1F,0x7C,0x7F,0x04,0x20,0x7D,0x00,0x02,0x20,0x7E
+};
+
+static const UCHAR SiS_Part2CLVX_3[] = {  /* NTSC, 525i, 525p */
+    0xE0,0x01,
+    0x04,0x1A,0x04,0x7E,0x03,0x1A,0x06,0x7D,0x01,0x1A,0x08,0x7D,0x00,0x19,0x0A,0x7D,
+    0x7F,0x19,0x0C,0x7C,0x7E,0x18,0x0E,0x7C,0x7E,0x17,0x10,0x7B,0x7D,0x15,0x12,0x7C,
+    0x7D,0x13,0x13,0x7D,0x7C,0x12,0x15,0x7D,0x7C,0x10,0x17,0x7D,0x7C,0x0E,0x18,0x7E,
+    0x7D,0x0C,0x19,0x7E,0x7D,0x0A,0x19,0x00,0x7D,0x08,0x1A,0x01,0x7E,0x06,0x1A,0x02,
+    0x58,0x02,
+    0x07,0x14,0x07,0x7E,0x06,0x14,0x09,0x7D,0x05,0x14,0x0A,0x7D,0x04,0x13,0x0B,0x7E,
+    0x03,0x13,0x0C,0x7E,0x02,0x12,0x0D,0x7F,0x01,0x12,0x0E,0x7F,0x01,0x11,0x0F,0x7F,
+    0x00,0x10,0x10,0x00,0x7F,0x0F,0x11,0x01,0x7F,0x0E,0x12,0x01,0x7E,0x0D,0x12,0x03,
+    0x7E,0x0C,0x13,0x03,0x7E,0x0B,0x13,0x04,0x7E,0x0A,0x14,0x04,0x7D,0x09,0x14,0x06,
+    0x00,0x03,
+    0x09,0x0F,0x09,0x7F,0x08,0x0F,0x09,0x00,0x07,0x0F,0x0A,0x00,0x06,0x0F,0x0A,0x01,
+    0x06,0x0E,0x0B,0x01,0x05,0x0E,0x0B,0x02,0x04,0x0E,0x0C,0x02,0x04,0x0D,0x0C,0x03,
+    0x03,0x0D,0x0D,0x03,0x02,0x0C,0x0D,0x05,0x02,0x0C,0x0E,0x04,0x01,0x0B,0x0E,0x06,
+    0x01,0x0B,0x0E,0x06,0x00,0x0A,0x0F,0x07,0x00,0x0A,0x0F,0x07,0x00,0x09,0x0F,0x08,
+    0xFF,0xFF
+};
+
+static const UCHAR SiS_Part2CLVX_4[] = {   /* PAL */
+    0x58,0x02,
+    0x05,0x19,0x05,0x7D,0x03,0x19,0x06,0x7E,0x02,0x19,0x08,0x7D,0x01,0x18,0x0A,0x7D,
+    0x00,0x18,0x0C,0x7C,0x7F,0x17,0x0E,0x7C,0x7E,0x16,0x0F,0x7D,0x7E,0x14,0x11,0x7D,
+    0x7D,0x13,0x13,0x7D,0x7D,0x11,0x14,0x7E,0x7D,0x0F,0x16,0x7E,0x7D,0x0E,0x17,0x7E,
+    0x7D,0x0C,0x18,0x7F,0x7D,0x0A,0x18,0x01,0x7D,0x08,0x19,0x02,0x7D,0x06,0x19,0x04,
+    0x00,0x03,
+    0x08,0x12,0x08,0x7E,0x07,0x12,0x09,0x7E,0x06,0x12,0x0A,0x7E,0x05,0x11,0x0B,0x7F,
+    0x04,0x11,0x0C,0x7F,0x03,0x11,0x0C,0x00,0x03,0x10,0x0D,0x00,0x02,0x0F,0x0E,0x01,
+    0x01,0x0F,0x0F,0x01,0x01,0x0E,0x0F,0x02,0x00,0x0D,0x10,0x03,0x7F,0x0C,0x11,0x04,
+    0x7F,0x0C,0x11,0x04,0x7F,0x0B,0x11,0x05,0x7E,0x0A,0x12,0x06,0x7E,0x09,0x12,0x07,
+    0x40,0x02,
+    0x04,0x1A,0x04,0x7E,0x02,0x1B,0x05,0x7E,0x01,0x1A,0x07,0x7E,0x00,0x1A,0x09,0x7D,
+    0x7F,0x19,0x0B,0x7D,0x7E,0x18,0x0D,0x7D,0x7D,0x17,0x10,0x7C,0x7D,0x15,0x12,0x7C,
+    0x7C,0x14,0x14,0x7C,0x7C,0x12,0x15,0x7D,0x7C,0x10,0x17,0x7D,0x7C,0x0D,0x18,0x7F,
+    0x7D,0x0B,0x19,0x7F,0x7D,0x09,0x1A,0x00,0x7D,0x07,0x1A,0x02,0x7E,0x05,0x1B,0x02,
+    0xFF,0xFF
+};
+
+static const UCHAR SiS_Part2CLVX_5[] = {   /* 750p */
+    0x00,0x03,
+    0x05,0x19,0x05,0x7D,0x03,0x19,0x06,0x7E,0x02,0x19,0x08,0x7D,0x01,0x18,0x0A,0x7D,
+    0x00,0x18,0x0C,0x7C,0x7F,0x17,0x0E,0x7C,0x7E,0x16,0x0F,0x7D,0x7E,0x14,0x11,0x7D,
+    0x7D,0x13,0x13,0x7D,0x7D,0x11,0x14,0x7E,0x7D,0x0F,0x16,0x7E,0x7D,0x0E,0x17,0x7E,
+    0x7D,0x0C,0x18,0x7F,0x7D,0x0A,0x18,0x01,0x7D,0x08,0x19,0x02,0x7D,0x06,0x19,0x04,
+    0xFF,0xFF
+};
+
+static const UCHAR SiS_Part2CLVX_6[] = {   /* 1080i */
+    0x00,0x04,
+    0x04,0x1A,0x04,0x7E,0x02,0x1B,0x05,0x7E,0x01,0x1A,0x07,0x7E,0x00,0x1A,0x09,0x7D,
+    0x7F,0x19,0x0B,0x7D,0x7E,0x18,0x0D,0x7D,0x7D,0x17,0x10,0x7C,0x7D,0x15,0x12,0x7C,
+    0x7C,0x14,0x14,0x7C,0x7C,0x12,0x15,0x7D,0x7C,0x10,0x17,0x1D /* 0x7D? */ ,0x7C,0x0D,0x18,0x7F,
+    0x7D,0x0B,0x19,0x7F,0x7D,0x09,0x1A,0x00,0x7D,0x07,0x1A,0x02,0x7E,0x05,0x1B,0x02,
+    0xFF,0xFF,
+};
+
+
+#ifdef SIS315H
+/* 661 et al LCD data structure */
+static const UCHAR SiS_LCDStruct661[] = {
+    /* 1600x1200 */
+    0x0B,0xEA,0x81,0x10,0x00,0xC0,0x03,0x21,0x5A,0x23,0x5A,0x23,0x02,
+    0x14,0x0A,0x02,0x00,0x30,0x10,0x5A,0x10,0x10,0x0A,0xC0,0x30,0x10,
+    /* 1400x1050 */
+    0x09,0xEA,0x81,0x80,0xA3,0x70,0x03,0x19,0xD2,0x2A,0xF8,0x2F,0x02,
+    0x14,0x0A,0x02,0x00,0x30,0x10,0x5A,0x10,0x10,0x0A,0xC0,0x30,0x10,
+    /* 1280x1024 */
+    0x03,0xEA,0x81,0x40,0xA1,0x70,0x03,0x19,0xD2,0x2A,0xF8,0x2F,0x02,
+    0x14,0x0A,0x02,0x00,0x30,0x10,0x5A,0x10,0x10,0x0A,0xC0,0x30,0x10,
+    /* 1024x768 */
+    0x02,0xEA,0x80,0x00,0x11,0x88,0x06,0x0B,0xF5,0x6C,0x35,0x62,0x02,
+    0x14,0x0A,0x02,0x00,0x30,0x10,0x5A,0x10,0x10,0x0A,0xC0,0x28,0x10,
+    0xFF,
+};
+#endif
+
+void	SiS_UnLockCRT2(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo);
+void	SiS_LockCRT2(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo);
+void	SiS_EnableCRT2(SiS_Private *SiS_Pr);
+USHORT	SiS_GetRatePtr(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex, PSIS_HW_INFO HwInfo);
+void	SiS_WaitRetrace1(SiS_Private *SiS_Pr);
+BOOLEAN	SiS_IsDualEdge(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo);
+BOOLEAN	SiS_IsVAMode(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo);
+void	SiS_SetChrontelGPIO(SiS_Private *SiS_Pr, USHORT myvbinfo);
+void	SiS_GetVBInfo(SiS_Private *SiS_Pr, USHORT ModeNo,
+              USHORT ModeIdIndex,PSIS_HW_INFO HwInfo,
+	      int checkcrt2mode);
+void	SiS_SetYPbPr(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo);
+void    SiS_SetTVMode(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex, PSIS_HW_INFO HwInfo);
+void	SiS_GetLCDResInfo(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex, PSIS_HW_INFO HwInfo);
+USHORT	SiS_GetVCLK2Ptr(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
+                USHORT RefreshRateTableIndex, PSIS_HW_INFO HwInfo);
+USHORT	SiS_GetResInfo(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdIndex);
+void	SiS_DisableBridge(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo);
+void	SiS_EnableBridge(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo);
+BOOLEAN	SiS_SetCRT2Group(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, USHORT ModeNo);
+void	SiS_SiS30xBLOn(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo);
+void	SiS_SiS30xBLOff(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo);
+
+void   	SiS_SetCH700x(SiS_Private *SiS_Pr, USHORT tempax);
+USHORT 	SiS_GetCH700x(SiS_Private *SiS_Pr, USHORT tempax);
+void   	SiS_SetCH701x(SiS_Private *SiS_Pr, USHORT tempax);
+USHORT 	SiS_GetCH701x(SiS_Private *SiS_Pr, USHORT tempax);
+void   	SiS_SetCH70xx(SiS_Private *SiS_Pr, USHORT tempax);
+USHORT 	SiS_GetCH70xx(SiS_Private *SiS_Pr, USHORT tempax);
+void   	SiS_SetCH70xxANDOR(SiS_Private *SiS_Pr, USHORT tempax,USHORT tempbh);
+#ifdef SIS315H
+void   	SiS_Chrontel701xOn(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo);
+void   	SiS_Chrontel701xOff(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo);
+void   	SiS_ChrontelInitTVVSync(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo);
+void   	SiS_ChrontelDoSomething1(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo);
+void   	SiS_Chrontel701xBLOn(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo);
+void   	SiS_Chrontel701xBLOff(SiS_Private *SiS_Pr);
+#endif /* 315 */
+
+USHORT   SiS_ReadDDC1Bit(SiS_Private *SiS_Pr);
+void     SiS_SetSwitchDDC2(SiS_Private *SiS_Pr);
+USHORT   SiS_SetStart(SiS_Private *SiS_Pr);
+USHORT   SiS_SetStop(SiS_Private *SiS_Pr);
+void     SiS_DDC2Delay(SiS_Private *SiS_Pr, USHORT delaytime);
+USHORT   SiS_SetSCLKLow(SiS_Private *SiS_Pr);
+USHORT   SiS_SetSCLKHigh(SiS_Private *SiS_Pr);
+USHORT   SiS_ReadDDC2Data(SiS_Private *SiS_Pr, USHORT tempax);
+USHORT   SiS_WriteDDC2Data(SiS_Private *SiS_Pr, USHORT tempax);
+USHORT   SiS_CheckACK(SiS_Private *SiS_Pr);
+
+USHORT   SiS_InitDDCRegs(SiS_Private *SiS_Pr, unsigned long VBFlags, int VGAEngine,
+                         USHORT adaptnum, USHORT DDCdatatype, BOOLEAN checkcr32);
+USHORT   SiS_WriteDABDDC(SiS_Private *SiS_Pr);
+USHORT   SiS_PrepareReadDDC(SiS_Private *SiS_Pr);
+USHORT   SiS_PrepareDDC(SiS_Private *SiS_Pr);
+void     SiS_SendACK(SiS_Private *SiS_Pr, USHORT yesno);
+USHORT   SiS_DoProbeDDC(SiS_Private *SiS_Pr);
+USHORT   SiS_ProbeDDC(SiS_Private *SiS_Pr);
+USHORT   SiS_ReadDDC(SiS_Private *SiS_Pr, USHORT DDCdatatype, unsigned char *buffer);
+USHORT   SiS_HandleDDC(SiS_Private *SiS_Pr, unsigned long VBFlags, int VGAEngine,
+		       USHORT adaptnum, USHORT DDCdatatype, unsigned char *buffer);
+#ifdef LINUX_XF86
+USHORT   SiS_SenseLCDDDC(SiS_Private *SiS_Pr, SISPtr pSiS);
+USHORT   SiS_SenseVGA2DDC(SiS_Private *SiS_Pr, SISPtr pSiS);
+#endif
+
+#ifdef SIS315H
+void     SiS_OEM310Setting(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
+                           USHORT ModeNo,USHORT ModeIdIndex);
+void     SiS_OEM661Setting(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
+                           USHORT ModeNo,USHORT ModeIdIndex, USHORT RRTI);
+void     SiS_FinalizeLCD(SiS_Private *, USHORT, USHORT, PSIS_HW_INFO);
+#endif
+#ifdef SIS300
+void     SiS_OEM300Setting(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
+                           USHORT ModeNo, USHORT ModeIdIndex, USHORT RefTabindex);
+void     SetOEMLCDData2(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
+			USHORT ModeNo, USHORT ModeIdIndex,USHORT RefTableIndex);
+#endif
+
+extern void     SiS_SetReg(SISIOADDRESS, USHORT, USHORT);
+extern void     SiS_SetRegByte(SISIOADDRESS, USHORT);
+extern void     SiS_SetRegShort(SISIOADDRESS, USHORT);
+extern void     SiS_SetRegLong(SISIOADDRESS, ULONG);
+extern UCHAR    SiS_GetReg(SISIOADDRESS, USHORT);
+extern UCHAR    SiS_GetRegByte(SISIOADDRESS);
+extern USHORT   SiS_GetRegShort(SISIOADDRESS);
+extern ULONG    SiS_GetRegLong(SISIOADDRESS);
+extern void     SiS_SetRegANDOR(SISIOADDRESS Port,USHORT Index,USHORT DataAND,USHORT DataOR);
+extern void     SiS_SetRegOR(SISIOADDRESS Port,USHORT Index,USHORT DataOR);
+extern void     SiS_SetRegAND(SISIOADDRESS Port,USHORT Index,USHORT DataAND);
+
+extern void     SiS_DisplayOff(SiS_Private *SiS_Pr);
+extern void     SiS_DisplayOn(SiS_Private *SiS_Pr);
+
+extern BOOLEAN  SiS_SearchModeID(SiS_Private *, USHORT *, USHORT *);
+extern UCHAR    SiS_GetModePtr(SiS_Private *SiS_Pr, USHORT ModeNo,USHORT ModeIdIndex);
+
+extern USHORT   SiS_GetColorDepth(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdIndex);
+extern USHORT   SiS_GetOffset(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdIndex,
+                              USHORT RefreshRateTableIndex,PSIS_HW_INFO HwInfo);
+
+extern void     SiS_LoadDAC(SiS_Private *SiS_Pr, PSIS_HW_INFO,USHORT ModeNo,
+                            USHORT ModeIdIndex);
+
+
 #endif
--- diff/drivers/video/sis/initdef.h	2003-10-09 09:47:17.000000000 +0100
+++ source/drivers/video/sis/initdef.h	2004-02-09 10:39:55.000000000 +0000
@@ -1,13 +1,76 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/initdef.h,v 1.4 2000/12/02 01:16:17 dawes Exp $ */
-
+/* $XFree86$ */
+/*
+ * Global definitions for init.c and init301.c
+ *
+ * Copyright (C) 2001-2004 by Thomas Winischhofer, Vienna, Austria
+ *
+ * If distributed as part of the Linux kernel, the following license terms
+ * apply:
+ *
+ * * 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 named License,
+ * * or 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
+ *
+ * Otherwise, the following license terms apply:
+ *
+ * * 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) All advertising materials mentioning features or use of this software
+ * *    must display the following acknowledgement: "This product includes
+ * *    software developed by Thomas Winischhofer, Vienna, Austria."
+ * * 4) The name of the author may not be used to endorse or promote products
+ * *    derived from this software without specific prior written permission.
+ * *
+ * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
+ *
+ * Author: 	Thomas Winischhofer <thomas@winischhofer.net>
+ *
+ */
 
 #ifndef _INITDEF_
 #define _INITDEF_
 
-#define SiS300                  0x0300
-#define SiS540                  0x5300
-#define SiS630                  0x6300
-#define SiS730                  0x6300
+#define IS_SIS330		(HwInfo->jChipType == SIS_330)
+#define IS_SIS550		(HwInfo->jChipType == SIS_550)
+#define IS_SIS650		(HwInfo->jChipType == SIS_650)  /* All versions, incl 651, M65x */
+#define IS_SIS740		(HwInfo->jChipType == SIS_740)
+#define IS_SIS651	        (SiS_Pr->SiS_SysFlags & (SF_Is651 | SF_Is652))
+#define IS_SISM650	        (SiS_Pr->SiS_SysFlags & (SF_IsM650 | SF_IsM652 | SF_IsM653))
+#define IS_SIS65x               (IS_SIS651 || IS_SISM650)       /* Only special versions of 65x */
+#define IS_SIS661		(HwInfo->jChipType == SIS_661)
+#define IS_SIS741		(HwInfo->jChipType == SIS_741)
+#define IS_SIS660		(HwInfo->jChipType == SIS_660)
+#define IS_SIS760		(HwInfo->jChipType == SIS_760)
+#define IS_SIS661741660760	(IS_SIS661 || IS_SIS741 || IS_SIS660 || IS_SIS760)
+#define IS_SIS650740            ((HwInfo->jChipType >= SIS_650) && (HwInfo->jChipType < SIS_330))
+#define IS_SIS550650740         (IS_SIS550 || IS_SIS650740)
+#define IS_SIS650740660         (IS_SIS650 || IS_SIS740 || IS_SIS661741660760)
+#define IS_SIS550650740660      (IS_SIS550 || IS_SIS650740660)
 
 /* SiS_VBType */
 #define VB_SIS301	      	0x0001
@@ -15,23 +78,41 @@
 #define VB_SIS302B        	0x0004
 #define VB_SIS301LV     	0x0008
 #define VB_SIS302LV     	0x0010
-#define VB_SIS30xLV		VB_SIS301LV
-#define VB_SIS30xNEW		VB_SIS302LV
+#define VB_SIS302ELV		0x0020
+#define VB_SIS301C              0x0040
 #define VB_NoLCD        	0x8000
-#define VB_SIS301BLV302BLV      (VB_SIS301B|VB_SIS302B|VB_SIS301LV|VB_SIS302LV)
-#define VB_SIS301B302B          (VB_SIS301B|VB_SIS302B)
-#define VB_SIS301LV302LV        (VB_SIS301LV|VB_SIS302LV)
-
-#define IS_SIS650740            ((HwDeviceExtension->jChipType >= SIS_650) && (HwDeviceExtension->jChipType < SIS_330))
-
-#define IS_SIS650		(HwDeviceExtension->jChipType == SIS_650)
-#define IS_SIS740		(HwDeviceExtension->jChipType == SIS_740)
-#define IS_SIS330		(HwDeviceExtension->jChipType == SIS_330)
-#define IS_SIS550		(HwDeviceExtension->jChipType == SIS_550)
-
-#define CRT1Len                 17
-#define LVDSCRT1Len             15
-#define CHTVRegDataLen          5
+#define VB_SIS301BLV302BLV      (VB_SIS301B|VB_SIS301C|VB_SIS302B|VB_SIS301LV|VB_SIS302LV|VB_SIS302ELV)
+#define VB_SIS301B302B          (VB_SIS301B|VB_SIS301C|VB_SIS302B)
+#define VB_SIS301LV302LV        (VB_SIS301LV|VB_SIS302LV|VB_SIS302ELV)
+#define VB_SISVB		(VB_SIS301 | VB_SIS301BLV302BLV)
+
+/* VBInfo */
+#define SetSimuScanMode         0x0001   /* CR 30 */
+#define SwitchCRT2              0x0002
+#define SetCRT2ToAVIDEO         0x0004
+#define SetCRT2ToSVIDEO         0x0008
+#define SetCRT2ToSCART          0x0010
+#define SetCRT2ToLCD            0x0020
+#define SetCRT2ToRAMDAC         0x0040
+#define SetCRT2ToHiVision       0x0080   		/* for SiS bridge */
+#define SetCRT2ToCHYPbPr       	SetCRT2ToHiVision	/* for Chrontel   */
+#define SetNTSCTV               0x0000   /* CR 31 */
+#define SetPALTV                0x0100   		/* Deprecated here, now in TVMode */
+#define SetInSlaveMode          0x0200
+#define SetNotSimuMode          0x0400
+#define SetNotSimuTVMode        SetNotSimuMode
+#define SetDispDevSwitch        0x0800
+#define SetCRT2ToYPbPr525750    0x0800
+#define LoadDACFlag             0x1000
+#define DisableCRT2Display      0x2000
+#define DriverMode              0x4000
+#define HotKeySwitch            0x8000
+#define SetCRT2ToLCDA           0x8000
+
+/* v-- Needs change in sis_vga.c if changed (GPIO) --v */
+#define SetCRT2ToTV             (SetCRT2ToYPbPr525750|SetCRT2ToHiVision|SetCRT2ToSCART|SetCRT2ToSVIDEO|SetCRT2ToAVIDEO)
+#define SetCRT2ToTVNoYPbPrHiVision (SetCRT2ToSCART | SetCRT2ToSVIDEO | SetCRT2ToAVIDEO)
+#define SetCRT2ToTVNoHiVision  	(SetCRT2ToYPbPr525750 | SetCRT2ToSCART | SetCRT2ToSVIDEO | SetCRT2ToAVIDEO)
 
 /* SiS_ModeType */
 #define ModeText                0x00
@@ -59,60 +140,66 @@
 #define DoubleScanMode          0x8000
 
 /* Infoflag */
-#define SupportAllCRT2          0x0078
 #define SupportTV               0x0008
-#define SupportHiVisionTV       0x0010
-#define SupportLCD              0x0020
-#define SupportRAMDAC2          0x0040  
-#define NoSupportTV             0x0070
-#define NoSupportHiVisionTV     0x0060
-#define NoSupportLCD            0x0058
+#define SupportTV1024           0x0800
 #define SupportCHTV 		0x0800
-#define SupportTV1024           0x0800            
+#define Support64048060Hz       0x0800  /* Special for 640x480 LCD */
+#define SupportHiVision         0x0010
+#define SupportYPbPr            0x1000  /* TODO */
+#define SupportLCD              0x0020
+#define SupportRAMDAC2          0x0040	/* All           (<= 100Mhz) */
+#define SupportRAMDAC2_135      0x0100  /* All except DH (<= 135Mhz) */
+#define SupportRAMDAC2_162      0x0200  /* B, C          (<= 162Mhz) */
+#define SupportRAMDAC2_202      0x0400  /* C             (<= 202Mhz) */
 #define InterlaceMode           0x0080
-#define SupportHiVisionTV2      0x1000
 #define SyncPP                  0x0000
 #define SyncPN                  0x4000
 #define SyncNP                  0x8000
 #define SyncNN                  0xc000
-#define ECLKindex0              0x0000
-#define ECLKindex1              0x0100
-#define ECLKindex2              0x0200
-#define ECLKindex3              0x0300
-#define ECLKindex4              0x0400
-
-/* VBInfo */
-#define SetSimuScanMode         0x0001   /* CR 30 */
-#define SwitchToCRT2            0x0002
-#define SetCRT2ToAVIDEO         0x0004
-#define SetCRT2ToSVIDEO         0x0008
-#define SetCRT2ToSCART          0x0010
-#define SetCRT2ToLCD            0x0020
-#define SetCRT2ToRAMDAC         0x0040
-#define SetCRT2ToHiVisionTV     0x0080
-#define SetCRT2ToTV             0x009C   /* alias */
-#define SetNTSCTV               0x0000   /* CR 31 */
-#define SetPALTV                0x0100
-#define SetInSlaveMode          0x0200
-#define SetNotSimuMode          0x0400
-#define SetNotSimuTVMode        0x0400
-#define SetDispDevSwitch        0x0800
-#define LoadDACFlag             0x1000
-#define SetCHTVOverScan  	0x1000  /* TW: Re-defined (from 0x8000) */
-#define DisableCRT2Display      0x2000
-#define CRT2DisplayFlag         0x2000
-#define DriverMode              0x4000
-#define HotKeySwitch            0x8000  /* TW: ? */
-#define SetCRT2ToLCDA           0x8000
 
-#define PanelRGB18Bit           0x0100
-#define PanelRGB24Bit           0x0000
-
-#define TVOverScan              0x10    /* Bit in CR35 (300 series only) */
-#define TVOverScanShift         4
-#define ClearBufferFlag         0x20
+/* SetFlag */
+#define ProgrammingCRT2         0x0001
+#define LowModeTests		0x0002
+/* #define TVSimuMode           0x0002 - deprecated */
+/* #define RPLLDIV2XO           0x0004 - deprecated */
+#define LCDVESATiming           0x0008
+#define EnableLVDSDDA           0x0010
+#define SetDispDevSwitchFlag    0x0020
+#define CheckWinDos             0x0040
+#define SetDOSMode              0x0080
+
+/* TVMode flag */
+#define TVSetPAL		0x0001
+#define TVSetNTSCJ		0x0002
+#define TVSetPALM		0x0004
+#define TVSetPALN		0x0008
+#define TVSetCHOverScan		0x0010
+#define TVSetYPbPr525i		0x0020
+#define TVSetYPbPr525p		0x0040
+#define TVSetYPbPr750p		0x0080
+#define TVSetHiVision		0x0100  /* = 1080i, software-wise identical */
+#define TVSetTVSimuMode		0x0800
+#define TVRPLLDIV2XO		0x1000
+#define TVSetNTSC1024		0x2000
+
+/* YPbPr flag (>=315, <661) */
+#define YPbPr525p               0x0001	/* 525p */
+#define YPbPr750p               0x0002	/* 750p */
+#define YPbPr525i               0x0004	/* 525p */
+#define YPbPrHiVision           0x0008	/* HiVision or 1080i (bridge type dependent) */
+#define YPbPrModeMask           (YPbPr750p | YPbPr525p | YPbPr525i | YPbPrHiVision)
+
+/* SysFlags (to identify special versions) */
+#define SF_Is651                0x0001
+#define SF_IsM650               0x0002
+#define SF_Is652		0x0004
+#define SF_IsM652		0x0008
+#define SF_IsM653		0x0010
+#define SF_IsM661		0x0020
+#define SF_IsM741		0x0040
+#define SF_IsM760		0x0080
 
-/* CR32 (Newer 630, and 310/325 series)
+/* CR32 (Newer 630, and 315 series)
 
    [0]   VB connected with CVBS
    [1]   VB connected with SVHS
@@ -121,9 +208,32 @@
    [4]   VB connected with CRT2 (secondary VGA)
    [5]   CRT1 monitor is connected
    [6]   VB connected with Hi-Vision TV
-   [7]   VB connected with DVI combo connector
+   [7]   <= 330: VB connected with DVI combo connector
+         >= 661: VB connected to YPbPr
+*/
+
+/* CR35 (300 series only) */
+#define TVOverScan              0x10
+#define TVOverScanShift         4
+
+/* CR35 (661 series only)
+
+   [0]    1 = PAL, 0 = NTSC
+   [1]    1 = NTSC-J (if D0 = 0)
+   [2]    1 = PALM (if D0 = 1)
+   [3]    1 = PALN (if D0 = 1)
+   [4]    1 = Overscan (Chrontel only)
+   [7:5]  (only if D2 in CR38 is set)
+          000  525i
+ 	  001  525p
+	  010  750p
+	  011  1080i (or HiVision on 301, 301B)
+
+   These bits are being translated to TVMode flag.
 
+*/
 
+/*
    CR37
 
    [0]   Set 24/18 bit (0/1) RGB to LVDS/TMDS transmitter (set by BIOS)
@@ -134,11 +244,14 @@
 	    011   LVDS + Tumpion Zurac
 	    100   LVDS + Chrontel 7005
 	    110   Chrontel 7005
-	  310/325 series
+	  315/330 series
 	    001   SiS30x (never seen)
 	    010   LVDS
 	    011   LVDS + Chrontel 7019
+	  660 series [2:1] only:
+	     reserved (now in CR38)
 	  All other combinations reserved
+   [3]    661 only: Pass 1:1 data
    [4]    LVDS: 0: Panel Link expands / 1: Panel Link does not expand
           30x:  0: Bridge scales      / 1: Bridge does not scale = Panel scales (if possible)
    [5]    LCD polarity select
@@ -155,36 +268,60 @@
 /* CR37: LCDInfo */
 #define LCDRGB18Bit           0x0001
 #define LCDNonExpanding       0x0010
+#define LCDSync               0x0020
+#define LCDPass11             0x0100
+#define LCDDualLink	      0x0200
+
 #define DontExpandLCD	      LCDNonExpanding
 #define LCDNonExpandingShift       4
 #define DontExpandLCDShift    LCDNonExpandingShift
-#define LCDSync               0x0020
-#define LCDPass11             0x0100 
 #define LCDSyncBit            0x00e0
 #define LCDSyncShift               6
 
-/* CR38 (310/325 series) */
-#define EnableDualEdge 		0x01   
-#define SetToLCDA		0x02   /* LCD channel A (302B/LV and 650+LVDS only) */
-#define EnableSiSHiVision       0x04   /* HiVision (HDTV) on SiS bridge */
-#define EnableLVDSScart         0x04   /* Scart on Ch7019 (unofficial definition - TW) */
-#define EnableLVDSHiVision      0x08   /* YPbPr color format (480i HDTV); only on 650/Ch7019 systems */
-#define SiSHiVision1            0x10   /* See SetHiVision() */
-#define SiSHiVision2            0x20
+/* CR38 (315 series) */
+#define EnableDualEdge 		0x01
+#define SetToLCDA		0x02   /* LCD channel A (301C/302B/30x(E)LV and 650+LVDS only) */
+#define EnableCHScart           0x04   /* Scart on Ch7019 (unofficial definition - TW) */
+#define EnableCHYPbPr           0x08   /* YPbPr on Ch7019 (480i HDTV); only on 650/Ch7019 systems */
+#define EnableSiSYPbPr          0x08   /* Enable YPbPr mode (30xLV/301C only) */
+#define EnableYPbPr525i         0x00   /* Enable 525i YPbPr mode (30xLV/301C only) (mask 0x30) */
+#define EnableYPbPr525p         0x10   /* Enable 525p YPbPr mode (30xLV/301C only) (mask 0x30) */
+#define EnableYPbPr750p         0x20   /* Enable 750p YPbPr mode (30xLV/301C only) (mask 0x30) */
+#define EnableYPbPr1080i        0x30   /* Enable 1080i YPbPr mode (30xLV/301C only) (mask 0x30) */
 #define EnablePALM              0x40   /* 1 = Set PALM */
 #define EnablePALN              0x80   /* 1 = Set PALN */
+#define EnableNTSCJ             EnablePALM  /* Not BIOS */
 
-#define SetSCARTOutput          0x01
-#define BoardTVType             0x02
+/* CR38 (661 and later)
+  D[7:5]  000 No VB
+          001 301 series VB
+	  010 LVDS
+	  011 Chrontel 7019
+	  100 Conexant
+  D2      Enable YPbPr output (see CR35)
+  D[1:0]  LCDA (like before)
+*/
 
 #define EnablePALMN             0x40   /* Romflag: 1 = Allow PALM/PALN */
 
-/* CR39 (650) */
+/* CR39 (650 only) */
 #define LCDPass1_1		0x01   /* LVDS only; set by driver to pass 1:1 data to LVDS output  */
-#define Enable302LV_DualLink    0x04   /* 30xNEW (302LV) only; set by mode switching function */
+#define Enable302LV_DualLink    0x04   /* 302LV only; enable dual link */
+
+/* CR39 (661 and later)
+   D[1:0] YPbPr Aspect Ratio
+          00 4:3 letterbox
+	  01 4:3
+	  10 16:9
+	  11 4:3
+*/
 
+/* CR3B (651+301C)
+   D[1:0] YPbPr Aspect Ratio
+          ?
+*/
 
-/* CR79 (310/325 series only)
+/* CR79 (315/330 series only; not 661 and later)
    [3-0] Notify driver
          0001 Mode Switch event (set by BIOS)
 	 0010 Epansion On/Off event
@@ -202,16 +339,6 @@
    [7]   TV UnderScan/OverScan (set by BIOS)
 */
 
-/* SetFlag */
-#define ProgrammingCRT2         0x01
-#define TVSimuMode              0x02
-#define RPLLDIV2XO              0x04
-#define LCDVESATiming           0x08
-#define EnableLVDSDDA           0x10
-#define SetDispDevSwitchFlag    0x20
-#define CheckWinDos             0x40
-#define SetDOSMode              0x80
-
 /* LCDResInfo */
 #define Panel300_800x600        0x01	/* CR36 */
 #define Panel300_1024x768       0x02
@@ -220,7 +347,10 @@
 #define Panel300_640x480        0x05
 #define Panel300_1024x600       0x06
 #define Panel300_1152x768       0x07
-#define Panel300_320x480        0x08 	/* fstn - TW: This is fake, can be any */
+#define Panel300_1280x768       0x0a
+#define Panel300_320x480        0x0e 	/* fstn - TW: This is fake, can be any */
+#define Panel300_Custom		0x0f
+#define Panel300_Barco1366      0x10
 
 #define Panel310_800x600        0x01
 #define Panel310_1024x768       0x02
@@ -231,9 +361,12 @@
 #define Panel310_1280x960       0x07
 #define Panel310_1152x768       0x08	/* LVDS only */
 #define Panel310_1400x1050      0x09
-#define Panel310_1280x768       0x0a    /* LVDS only */
+#define Panel310_1280x768       0x0a
 #define Panel310_1600x1200      0x0b
-#define Panel310_320x480        0x0c    /* fstn - TW: This is fake, can be any */
+#define Panel310_640x480_2      0x0c
+#define Panel310_640x480_3      0x0d
+#define Panel310_320x480        0x0e    /* fstn - TW: This is fake, can be any */
+#define Panel310_Custom		0x0f
 
 #define Panel_800x600           0x01	/* Unified values */
 #define Panel_1024x768          0x02
@@ -246,23 +379,50 @@
 #define Panel_1400x1050         0x09
 #define Panel_1280x768          0x0a    /* LVDS only */
 #define Panel_1600x1200         0x0b
-#define Panel_320x480           0x0c    /* fstn - TW: This is fake, can be any */
+#define Panel_640x480_2		0x0c
+#define Panel_640x480_3		0x0d
+#define Panel_320x480           0x0e    /* fstn - TW: This is fake, can be any */
+#define Panel_Custom		0x0f
+#define Panel_Barco1366         0x10
+#define Panel_848x480		0x11
+#define Panel_1280x800		0x12    /* 661etc: 0x0c */
+#define Panel_1680x1050         0x13    /* 661etc: 0x0d */
+
+/* Index in ModeResInfo table */
+#define SIS_RI_320x200    0
+#define SIS_RI_320x240    1
+#define SIS_RI_320x400    2
+#define SIS_RI_400x300    3
+#define SIS_RI_512x384    4
+#define SIS_RI_640x400    5
+#define SIS_RI_640x480    6
+#define SIS_RI_800x600    7
+#define SIS_RI_1024x768   8
+#define SIS_RI_1280x1024  9
+#define SIS_RI_1600x1200 10
+#define SIS_RI_1920x1440 11
+#define SIS_RI_2048x1536 12
+#define SIS_RI_720x480   13
+#define SIS_RI_720x576   14
+#define SIS_RI_1280x960  15
+#define SIS_RI_800x480   16
+#define SIS_RI_1024x576  17
+#define SIS_RI_1280x720  18
+#define SIS_RI_856x480   19
+#define SIS_RI_1280x768  20
+#define SIS_RI_1400x1050 21
+#define SIS_RI_1152x864  22  /* Up to this SiS conforming */
+#define SIS_RI_848x480   23
+#define SIS_RI_1360x768  24
+#define SIS_RI_1024x600  25
+#define SIS_RI_1152x768  26
+#define SIS_RI_768x576   27
+#define SIS_RI_1360x1024 28
 
-#define ExtChipType             0x0e
-#define ExtChip301              0x02
-#define ExtChipLVDS             0x04
-#define ExtChipTrumpion         0x06
-#define ExtChipCH7005           0x08
-#define ExtChipMitacTV          0x0a    /* TW: Incorrect, 0x0a = Chrontel 7005 only */
-
-#define IsM650                  0x80   	/* TW: CR5F */
-
-#define LCDDataLen              8
-#define HiTVDataLen             12
-#define TVDataLen               16
-#define SetPALTV                0x0100
-#define HalfDCLK                0x1000  /* modeflag */
+/* CR5F */
+#define IsM650                  0x80
 
+/* Timing data */
 #define NTSCHT                  1716
 #define NTSC2HT                 1920
 #define NTSCVT                  525
@@ -275,37 +435,45 @@
 #define ExtHiTVHT               2100
 #define ExtHiTVVT               1125
 
-#define VCLKStartFreq           25
-#define SoftDramType            0x80
+/* Indices in (VB)VCLKData tables */
 
-#define VCLK40                  0x04   /* Index in VCLKData array */
-#define VCLK65                  0x09   /* Index in VCLKData array */
-#define VCLK108_2               0x14   /* Index in VCLKData array */
-#define TVVCLKDIV2              0x21   /* Indices in (VB)VCLKData arrays */
-#define TVVCLK                  0x22
-#define HiTVVCLKDIV2            0x23
-#define HiTVVCLK                0x24
-#define HiTVSimuVCLK            0x25
-#define HiTVTextVCLK            0x26
+#define VCLK28                  0x00   /* Index in VCLKData table (300 and 315) */
+#define VCLK40                  0x04   /* Index in VCLKData table (300 and 315) */
+#define VCLK65_300              0x09   /* Index in VCLKData table (300) */
+#define VCLK108_2_300           0x14   /* Index in VCLKData table (300) */
+#define VCLK81_300		0x3f   /* Index in VCLKData table (300) */
+#define VCLK108_3_300           0x42   /* Index in VCLKData table (300) */
+#define VCLK100_300             0x43   /* Index in VCLKData table (300) */
+#define VCLK34_300              0x3d   /* Index in VCLKData table (300) */
+#define VCLK65_315              0x0b   /* Index in (VB)VCLKData table (315) */
+#define VCLK108_2_315           0x19   /* Index in (VB)VCLKData table (315) */
+#define VCLK81_315		0x5b   /* Index in (VB)VCLKData table (315) */
+#define VCLK162_315             0x21   /* Index in (VB)VCLKData table (315) */
+#define VCLK108_3_315           0x45   /* Index in VBVCLKData table (315) */
+#define VCLK100_315             0x46   /* Index in VBVCLKData table (315) */
+#define VCLK34_315              0x55   /* Index in VBVCLKData table (315) */
+#define VCLK68_315		0x0d
+
+#define TVCLKBASE_300		0x21   /* Indices on TV clocks in VCLKData table (300) */
+#define TVCLKBASE_315	        0x3a   /* Indices on TV clocks in (VB)VCLKData table (315) */
+#define TVVCLKDIV2              0x00   /* Index relative to TVCLKBASE */
+#define TVVCLK                  0x01   /* Index relative to TVCLKBASE */
+#define HiTVVCLKDIV2            0x02   /* Index relative to TVCLKBASE */
+#define HiTVVCLK                0x03   /* Index relative to TVCLKBASE */
+#define HiTVSimuVCLK            0x04   /* Index relative to TVCLKBASE */
+#define HiTVTextVCLK            0x05   /* Index relative to TVCLKBASE */
+#define YPbPr750pVCLK		0x0f   /* NOT relative to TVCLKBASE ! */
 
-#define LoadDACFlag             0x1000
-#define AfterLockCRT2           0x4000
-#define SetCRT2ToAVIDEO         0x0004
-#define SetCRT2ToSCART          0x0010
-#define Ext2StructSize          5
+/* ------------------------------ */
 
 #define SetSCARTOutput          0x01
-#define AVIDEOSense             0x01
-#define SVIDEOSense             0x02
-#define SCARTSense              0x04
-#define LCDSense                0x08
-#define Monitor1Sense           0x20
-#define Monitor2Sense           0x10
-#define HiTVSense               0x40
-#define BoardTVType             0x02
+
 #define HotPlugFunction         0x08
+
 #define StStructSize            0x06
 
+#define SIS_VIDEO_CAPTURE       0x00 - 0x30
+#define SIS_VIDEO_PLAYBACK      0x02 - 0x30
 #define SIS_CRT2_PORT_04        0x04 - 0x30
 #define SIS_CRT2_PORT_10        0x10 - 0x30
 #define SIS_CRT2_PORT_12        0x12 - 0x30
@@ -318,8 +486,11 @@
 #define ADR_CHTVVCLKPtr         0x216
 #define ADR_CHTVRegDataPtr      0x218
 
+#define LCDDataLen              8
+#define HiTVDataLen             12
+#define TVDataLen               16
+
 #define LVDSDataLen             6
-#define EnableLVDSDDA           0x10
 #define LVDSDesDataLen          3
 #define ActiveNonExpanding      0x40
 #define ActiveNonExpandingShift 6
@@ -330,8 +501,6 @@
 #define SoftSettingAddr         0x52
 #define ModeSettingAddr         0x53
 
-#define SelectCRT1Rate          0x4
-        
 #define _PanelType00             0x00
 #define _PanelType01             0x08
 #define _PanelType02             0x10
@@ -350,7 +519,8 @@
 #define _PanelType0F             0x78
 
 #define PRIMARY_VGA       	0     /* 1: SiS is primary vga 0:SiS is secondary vga */
-#define BIOSIDCodeAddr          0x235  /* TW: Offsets to ptrs in BIOS image */
+
+#define BIOSIDCodeAddr          0x235  /* Offsets to ptrs in BIOS image */
 #define OEMUtilIDCodeAddr       0x237
 #define VBModeIDTableAddr       0x239
 #define OEMTVPtrAddr            0x241
@@ -393,7 +563,7 @@
 
 /*
   =============================================================
-   			for 310/325 series
+   			  for 315 series
   =============================================================
 */
 #define SoftDRAMType        0x80
--- diff/drivers/video/sis/oem300.h	2003-10-09 09:47:17.000000000 +0100
+++ source/drivers/video/sis/oem300.h	2004-02-09 10:39:55.000000000 +0000
@@ -1,5 +1,56 @@
-
-/* OEM Data for 300 series */
+/* $XFree86$ */
+/*
+ * OEM Data for 300 series
+ *
+ * Copyright (C) 2001-2004 by Thomas Winischhofer, Vienna, Austria
+ *
+ * If distributed as part of the Linux kernel, the following license terms
+ * apply:
+ *
+ * * 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 named License,
+ * * or 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
+ *
+ * Otherwise, the following license terms apply:
+ *
+ * * 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) All advertising materials mentioning features or use of this software
+ * *    must display the following acknowledgement: "This product includes
+ * *    software developed by Thomas Winischhofer, Vienna, Austria."
+ * * 4) The name of the author may not be used to endorse or promote products
+ * *    derived from this software without specific prior written permission.
+ * *
+ * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
+ *
+ * Author: 	Thomas Winischhofer <thomas@winischhofer.net>
+ *
+ */
 
 const UCHAR SiS300_OEMTVDelay301[8][4] =
 {
@@ -245,140 +296,124 @@
 	{0x20,0x20,0x20,0x20}
 };
 
-const UCHAR SiS300_Phase1[8][6][4] =
+const UCHAR SiS300_Phase1[8][5][4] =
 {
     {
 	{0x21,0xed,0x00,0x08},
 	{0x21,0xed,0x8a,0x08},
 	{0x21,0xed,0x8a,0x08},
 	{0x21,0xed,0x8a,0x08},
-	{0x21,0xed,0x8a,0x08},
-	{0xff,0xff,0xff,0xff}
+	{0x21,0xed,0x8a,0x08}
     },
     {
         {0x2a,0x05,0xd3,0x00},
 	{0x2a,0x05,0xd3,0x00},
 	{0x2a,0x05,0xd3,0x00},
 	{0x2a,0x05,0xd3,0x00},
-	{0x2a,0x05,0xd3,0x00},
-	{0xff,0xff,0xff,0xff}
+	{0x2a,0x05,0xd3,0x00}
     },
     {
         {0x2a,0x05,0xd3,0x00},
 	{0x2a,0x05,0xd3,0x00},
 	{0x2a,0x05,0xd3,0x00},
 	{0x2a,0x05,0xd3,0x00},
-	{0x2a,0x05,0xd3,0x00},
-	{0xff,0xff,0xff,0xff}
+	{0x2a,0x05,0xd3,0x00}
     },
     {
         {0x2a,0x05,0xd3,0x00},
 	{0x2a,0x05,0xd3,0x00},
 	{0x2a,0x05,0xd3,0x00},
 	{0x2a,0x05,0xd3,0x00},
-	{0x2a,0x05,0xd3,0x00},
-	{0xff,0xff,0xff,0xff}
+	{0x2a,0x05,0xd3,0x00}
     },
     {
         {0x21,0xed,0x00,0x08},
 	{0x21,0xed,0x8a,0x08},
 	{0x21,0xed,0x8a,0x08},
 	{0x21,0xed,0x8a,0x08},
-	{0x21,0xed,0x8a,0x08},
-	{0xff,0xff,0xff,0xff}
+	{0x21,0xed,0x8a,0x08}
     },
     {
         {0x2a,0x05,0xd3,0x00},
 	{0x2a,0x05,0xd3,0x00},
 	{0x2a,0x05,0xd3,0x00},
 	{0x2a,0x05,0xd3,0x00},
-	{0x2a,0x05,0xd3,0x00},
-	{0xff,0xff,0xff,0xff}
+	{0x2a,0x05,0xd3,0x00}
     },
     {
         {0x2a,0x05,0xd3,0x00},
 	{0x2a,0x05,0xd3,0x00},
 	{0x2a,0x05,0xd3,0x00},
 	{0x2a,0x05,0xd3,0x00},
-	{0x2a,0x05,0xd3,0x00},
-	{0xff,0xff,0xff,0xff}
+	{0x2a,0x05,0xd3,0x00}
     },
     {
         {0x2a,0x05,0xd3,0x00},
 	{0x2a,0x05,0xd3,0x00},
 	{0x2a,0x05,0xd3,0x00},
 	{0x2a,0x05,0xd3,0x00},
-	{0x2a,0x05,0xd3,0x00},
-	{0xff,0xff,0xff,0xff}
+	{0x2a,0x05,0xd3,0x00}
     }
 };
 
 
-const UCHAR SiS300_Phase2[8][6][4] =
+const UCHAR SiS300_Phase2[8][5][4] =
 {
     {
         {0x21,0xed,0x00,0x08},
 	{0x21,0xed,0x8a,0x08},
 	{0x21,0xed,0x8a,0x08},
 	{0x21,0xed,0x8a,0x08},
-	{0x21,0xed,0x8a,0x08},
-	{0xff,0xff,0xff,0xff}
+	{0x21,0xed,0x8a,0x08}
     },
     {
 	{0x2a,0x05,0xd3,0x00},
 	{0x2a,0x05,0xd3,0x00},
 	{0x2a,0x05,0xd3,0x00},
 	{0x2a,0x05,0xd3,0x00},
-	{0x2a,0x05,0xd3,0x00},
-	{0xff,0xff,0xff,0xff}
+	{0x2a,0x05,0xd3,0x00}
     },
     {
         {0x2a,0x05,0xd3,0x00},
 	{0x2a,0x05,0xd3,0x00},
 	{0x2a,0x05,0xd3,0x00},
 	{0x2a,0x05,0xd3,0x00},
-	{0x2a,0x05,0xd3,0x00},
-	{0xff,0xff,0xff,0xff}
+	{0x2a,0x05,0xd3,0x00}
     },
     {
         {0x2a,0x05,0xd3,0x00},
 	{0x2a,0x05,0xd3,0x00},
 	{0x2a,0x05,0xd3,0x00},
 	{0x2a,0x05,0xd3,0x00},
-	{0x2a,0x05,0xd3,0x00},
-	{0xff,0xff,0xff,0xff}
+	{0x2a,0x05,0xd3,0x00}
     },
     {
         {0x21,0xed,0x00,0x08},
 	{0x21,0xed,0x8a,0x08},
 	{0x21,0xed,0x8a,0x08},
 	{0x21,0xed,0x8a,0x08},
-	{0x21,0xed,0x8a,0x08},
-	{0xff,0xff,0xff,0xff}
+	{0x21,0xed,0x8a,0x08}
     },
     {
         {0x2a,0x05,0xd3,0x00},
 	{0x2a,0x05,0xd3,0x00},
 	{0x2a,0x05,0xd3,0x00},
 	{0x2a,0x05,0xd3,0x00},
-	{0x2a,0x05,0xd3,0x00},
-	{0xff,0xff,0xff,0xff}
+	{0x2a,0x05,0xd3,0x00}
     },
     {
         {0x2a,0x05,0xd3,0x00},
 	{0x2a,0x05,0xd3,0x00},
 	{0x2a,0x05,0xd3,0x00},
 	{0x2a,0x05,0xd3,0x00},
-	{0x2a,0x05,0xd3,0x00},
-	{0xff,0xff,0xff,0xff}
+	{0x2a,0x05,0xd3,0x00}
     },
     {
         {0x2a,0x05,0xd3,0x00},
 	{0x2a,0x05,0xd3,0x00},
 	{0x2a,0x05,0xd3,0x00},
 	{0x2a,0x05,0xd3,0x00},
-	{0x2a,0x05,0xd3,0x00},
-	{0xff,0xff,0xff,0xff}
+	{0x2a,0x05,0xd3,0x00}
     }
 };
 
@@ -680,325 +715,147 @@
     }
 };
 
-const UCHAR SiS300_LCDHData[24][11][5] = {
+/* Custom data for Barco iQ Pro R300 */
+const UCHAR barco_p1[2][9][7][3] = {
     {
-        {0x67,0x91,0x84,0x5e,0x00},
-	{0x67,0x91,0x84,0x5e,0x00},
-	{0x67,0x91,0x84,0x5e,0x00},
-	{0x67,0x91,0x84,0x5e,0x00},
-	{0x67,0x91,0x84,0x5e,0x00},
-	{0x67,0x91,0x84,0x5e,0x00},
-	{0x67,0x91,0x84,0x5e,0x00},
-	{0x65,0xef,0x83,0x5c,0x00},
-	{0x65,0xef,0x83,0x5c,0x00},
-	{0x8a,0x14,0x00,0x80,0x00},
-	{0x8a,0x14,0x00,0x80,0x00}
-    },
-    {
-        {0x4e,0x18,0x90,0x38,0x00},
-	{0x4e,0x18,0x90,0x38,0x00},
-	{0x8e,0x18,0x28,0x78,0x00},
-	{0x8e,0x18,0x28,0x78,0x00},
-	{0x8e,0x18,0x28,0x78,0x00},
-	{0x4e,0x18,0x90,0x38,0x00},
-	{0x4e,0x18,0x90,0x38,0x00},
-	{0x67,0x11,0x9a,0x56,0x00},
-        {0x67,0x11,0x9a,0x56,0x00},
-	{0x8a,0x14,0x00,0x80,0x00},
-	{0x8a,0x14,0x00,0x80,0x00}
-    },
-    {
-        {0x67,0x91,0x84,0x5e,0x00},
-	{0x67,0x91,0x84,0x5e,0x00},
-	{0x67,0x91,0x84,0x5e,0x00},
-	{0x67,0x91,0x84,0x5e,0x00},
-	{0x67,0x91,0x84,0x5e,0x00},
-	{0x67,0x91,0x84,0x5e,0x00},
-	{0x67,0x91,0x84,0x5e,0x00},
-	{0x65,0xef,0x83,0x5c,0x00},
-	{0x65,0xef,0x83,0x5c,0x00},
-	{0x8a,0x14,0x00,0x80,0x00},
-	{0x8a,0x14,0x00,0x80,0x00}
-    },
-    {
-    	{0x4e,0x18,0x90,0x38,0x00},
-	{0x4e,0x18,0x90,0x38,0x00},
-	{0x8e,0x18,0x28,0x78,0x00},
-	{0x8e,0x18,0x28,0x78,0x00},
-	{0x8e,0x18,0x28,0x78,0x00},
-	{0x4e,0x18,0x90,0x38,0x00},
-	{0x4e,0x18,0x90,0x38,0x00},
-	{0x67,0x11,0x9a,0x56,0x00},
-	{0x67,0x11,0x9a,0x56,0x00},
-	{0x8a,0x14,0x00,0x80,0x00},
-	{0x8a,0x14,0x00,0x80,0x00}
-    },
-    {
-    	{0x67,0x91,0x84,0x5e,0x00},
-	{0x67,0x91,0x84,0x5e,0x00},
-	{0x67,0x91,0x84,0x5e,0x00},
-	{0x67,0x91,0x84,0x5e,0x00},
-	{0x67,0x91,0x84,0x5e,0x00},
-	{0x67,0x91,0x84,0x5e,0x00},
-	{0x67,0x91,0x84,0x5e,0x00},
-	{0x65,0xef,0x83,0x5c,0x00},
-	{0x65,0xef,0x83,0x5c,0x00},
-	{0x8a,0x14,0x00,0x80,0x00},
-	{0x8a,0x14,0x00,0x80,0x00}
-    },
-    {
-        {0x4E,0x18,0x90,0x38,0x00},
-	{0x4E,0x18,0x90,0x38,0x00},
-	{0x8E,0x18,0x28,0x78,0x00},
-	{0x8E,0x18,0x28,0x78,0x00},
-	{0x8E,0x18,0x28,0x78,0x00},
-	{0x4E,0x18,0x90,0x38,0x00},
-	{0x4E,0x18,0x90,0x38,0x00},
-	{0x67,0x11,0x9A,0x56,0x00},
-	{0x67,0x11,0x9A,0x56,0x00},
-	{0x8A,0x14,0x00,0x80,0x00},
-	{0x8A,0x14,0x00,0x80,0x00}
-    },
-    {
-    	{0x67,0x91,0x84,0x5E,0x00},
-	{0x67,0x91,0x84,0x5E,0x00},
-	{0x67,0x91,0x84,0x5E,0x00},
-    	{0x67,0x91,0x84,0x5E,0x00},
-    	{0x67,0x91,0x84,0x5E,0x00},
-    	{0x67,0x91,0x84,0x5E,0x00},
-    	{0x67,0x91,0x84,0x5E,0x00},
-    	{0x65,0xEF,0x83,0x5C,0x00},
-    	{0x65,0xEF,0x83,0x5C,0x00},
-	{0x8A,0x14,0x00,0x80,0x00},
-	{0x8A,0x14,0x00,0x80,0x00}
-    },
-    {
-    	{0x4E,0x18,0x90,0x38,0x00},
-	{0x4E,0x18,0x90,0x38,0x00},
-	{0x8E,0x18,0x28,0x78,0x00},
-	{0x8E,0x18,0x28,0x78,0x00},
-	{0x8E,0x18,0x28,0x78,0x00},
-	{0x4E,0x18,0x90,0x38,0x00},
-	{0x4E,0x18,0x90,0x38,0x00},
-	{0x67,0x11,0x9A,0x56,0x00},
-	{0x67,0x11,0x9A,0x56,0x00},
-	{0x8A,0x14,0x00,0x80,0x00},
-	{0x8A,0x14,0x00,0x80,0x00}
-    },
-    {
-    	{0x67,0x91,0x84,0x5E,0x00},
-	{0x67,0x91,0x84,0x5E,0x00},
-	{0x67,0x91,0x84,0x5E,0x00},
-	{0x67,0x91,0x84,0x5E,0x00},
-	{0x67,0x91,0x84,0x5E,0x00},
-	{0x67,0x91,0x84,0x5E,0x00},
-	{0x67,0x91,0x84,0x5E,0x00},
-	{0x65,0xEF,0x83,0x5C,0x00},
-	{0x65,0xEF,0x83,0x5C,0x00},
-	{0x8A,0x14,0x00,0x80,0x00},
-	{0x8A,0x14,0x00,0x80,0x00}
-    },
-    {
-    	{0x4E,0x18,0x90,0x38,0x00},
-	{0x4E,0x18,0x90,0x38,0x00},
-	{0x8E,0x18,0x28,0x78,0x00},
-	{0x8E,0x18,0x28,0x78,0x00},
-	{0x8E,0x18,0x28,0x78,0x00},
-	{0x4E,0x18,0x90,0x38,0x00},
-	{0x4E,0x18,0x90,0x38,0x00},
-	{0x67,0x11,0x9A,0x56,0x00},
-	{0x67,0x11,0x9A,0x56,0x00},
-	{0x8A,0x14,0x00,0x80,0x00},
-	{0x8A,0x14,0x00,0x80,0x00}
-    },
-    {
-    	{0x67,0x91,0x84,0x5E,0x00},
-	{0x67,0x91,0x84,0x5E,0x00},
-	{0x67,0x91,0x84,0x5E,0x00},
-	{0x67,0x91,0x84,0x5E,0x00},
-	{0x67,0x91,0x84,0x5E,0x00},
-	{0x67,0x91,0x84,0x5E,0x00},
-	{0x67,0x91,0x84,0x5E,0x00},
-	{0x65,0xEF,0x83,0x5C,0x00},
-	{0x65,0xEF,0x83,0x5C,0x00},
-	{0x8A,0x14,0x00,0x80,0x00},
-	{0x8A,0x14,0x00,0x80,0x00}
-    },
-    {
-    	{0x4E,0x18,0x90,0x38,0x00},
-	{0x4E,0x18,0x90,0x38,0x00},
-	{0x8E,0x18,0x28,0x78,0x00},
-	{0x8E,0x18,0x28,0x78,0x00},
-	{0x8E,0x18,0x28,0x78,0x00},
-	{0x4E,0x18,0x90,0x38,0x00},
-	{0x4E,0x18,0x90,0x38,0x00},
-	{0x67,0x11,0x9A,0x56,0x00},
-	{0x67,0x11,0x9A,0x56,0x00},
-	{0x8A,0x14,0x00,0x80,0x00},
-	{0x8A,0x14,0x00,0x80,0x00}
-    },
-    {
-    	{0x67,0x91,0x84,0x5E,0x00},
-	{0x67,0x91,0x84,0x5E,0x00},
-	{0x67,0x91,0x84,0x5E,0x00},
-	{0x67,0x91,0x84,0x5E,0x00},
-	{0x67,0x91,0x84,0x5E,0x00},
-	{0x67,0x91,0x84,0x5E,0x00},
-	{0x67,0x91,0x84,0x5E,0x00},
-	{0x65,0xEF,0x83,0x5C,0x00},
-	{0x65,0xEF,0x83,0x5C,0x00},
-	{0x8A,0x14,0x00,0x80,0x00},
-	{0x8A,0x14,0x00,0x80,0x00}
-    },
-    {
-    	{0x4E,0x18,0x90,0x38,0x00},
-	{0x4E,0x18,0x90,0x38,0x00},
-	{0x8E,0x18,0x28,0x78,0x00},
-	{0x8E,0x18,0x28,0x78,0x00},
-	{0x8E,0x18,0x28,0x78,0x00},
-	{0x4E,0x18,0x90,0x38,0x00},
-	{0x4E,0x18,0x90,0x38,0x00},
-	{0x67,0x11,0x9A,0x56,0x00},
-	{0x67,0x11,0x9A,0x56,0x00},
-	{0x8A,0x14,0x00,0x80,0x00},
-	{0x8A,0x14,0x00,0x80,0x00}
-    },
-    {
-    	{0x67,0x91,0x84,0x5E,0x00},
-	{0x67,0x91,0x84,0x5E,0x00},
-	{0x67,0x91,0x84,0x5E,0x00},
-	{0x67,0x91,0x84,0x5E,0x00},
-	{0x67,0x91,0x84,0x5E,0x00},
-	{0x67,0x91,0x84,0x5E,0x00},
-	{0x67,0x91,0x84,0x5E,0x00},
-	{0x65,0xEF,0x83,0x5C,0x00},
-	{0x65,0xEF,0x83,0x5C,0x00},
-	{0x8A,0x14,0x00,0x80,0x00},
-	{0x8A,0x14,0x00,0x80,0x00}
-    },
-    {
-    	{0x4E,0x18,0x90,0x38,0x00},
-	{0x4E,0x18,0x90,0x38,0x00},
-	{0x8E,0x18,0x28,0x78,0x00},
-	{0x8E,0x18,0x28,0x78,0x00},
-	{0x8E,0x18,0x28,0x78,0x00},
-	{0x4E,0x18,0x90,0x38,0x00},
-	{0x4E,0x18,0x90,0x38,0x00},
-	{0x67,0x11,0x9A,0x56,0x00},
-	{0x67,0x11,0x9A,0x56,0x00},
-	{0x8A,0x14,0x00,0x80,0x00},
-	{0x8A,0x14,0x00,0x80,0x00}
-    },
-    {
-    	{0x67,0x91,0x84,0x5E,0x00},
-	{0x67,0x91,0x84,0x5E,0x00},
-	{0x67,0x91,0x84,0x5E,0x00},
-	{0x67,0x91,0x84,0x5E,0x00},
-	{0x67,0x91,0x84,0x5E,0x00},
-	{0x67,0x91,0x84,0x5E,0x00},
-	{0x67,0x91,0x84,0x5E,0x00},
-	{0x65,0xEF,0x83,0x5C,0x00},
-	{0x65,0xEF,0x83,0x5C,0x00},
-	{0x8A,0x14,0x00,0x80,0x00},
-	{0x8A,0x14,0x00,0x80,0x00}
-    },
-    {
-    	{0x4E,0x18,0x90,0x38,0x00},
-	{0x4E,0x18,0x90,0x38,0x00},
-	{0x8E,0x18,0x28,0x78,0x00},
-	{0x8E,0x18,0x28,0x78,0x00},
-	{0x8E,0x18,0x28,0x78,0x00},
-	{0x4E,0x18,0x90,0x38,0x00},
-	{0x4E,0x18,0x90,0x38,0x00},
-	{0x67,0x11,0x9A,0x56,0x00},
-	{0x67,0x11,0x9A,0x56,0x00},
-	{0x8A,0x14,0x00,0x80,0x00},
-	{0x8A,0x14,0x00,0x80,0x00}
-    },
-    {
-    	{0x67,0x91,0x84,0x5E,0x00},
-	{0x67,0x91,0x84,0x5E,0x00},
-	{0x67,0x91,0x84,0x5E,0x00},
-	{0x67,0x91,0x84,0x5E,0x00},
-	{0x67,0x91,0x84,0x5E,0x00},
-	{0x67,0x91,0x84,0x5E,0x00},
-	{0x67,0x91,0x84,0x5E,0x00},
-	{0x65,0xEF,0x83,0x5C,0x00},
-	{0x65,0xEF,0x83,0x5C,0x00},
-	{0x8A,0x14,0x00,0x80,0x00},
-	{0x8A,0x14,0x00,0x80,0x00}
-    },
-    {
-    	{0x4E,0x18,0x90,0x38,0x00},
-	{0x4E,0x18,0x90,0x38,0x00},
-	{0x8E,0x18,0x28,0x78,0x00},
-	{0x8E,0x18,0x28,0x78,0x00},
-	{0x8E,0x18,0x28,0x78,0x00},
-	{0x4E,0x18,0x90,0x38,0x00},
-	{0x4E,0x18,0x90,0x38,0x00},
-	{0x67,0x11,0x9A,0x56,0x00},
-	{0x67,0x11,0x9A,0x56,0x00},
-	{0x8A,0x14,0x00,0x80,0x00},
-	{0x8A,0x14,0x00,0x80,0x00}
-    },
-    {
-    	{0x67,0x91,0x84,0x5E,0x00},
-	{0x67,0x91,0x84,0x5E,0x00},
-	{0x67,0x91,0x84,0x5E,0x00},
-	{0x67,0x91,0x84,0x5E,0x00},
-	{0x67,0x91,0x84,0x5E,0x00},
-	{0x67,0x91,0x84,0x5E,0x00},
-	{0x67,0x91,0x84,0x5E,0x00},
-	{0x65,0xEF,0x83,0x5C,0x00},
-	{0x65,0xEF,0x83,0x5C,0x00},
-	{0x8A,0x14,0x00,0x80,0x00},
-	{0x8A,0x14,0x00,0x80,0x00}
-    },
-    {
-    	{0x4E,0x18,0x90,0x38,0x00},
-	{0x4E,0x18,0x90,0x38,0x00},
-	{0x8E,0x18,0x28,0x78,0x00},
-	{0x8E,0x18,0x28,0x78,0x00},
-	{0x8E,0x18,0x28,0x78,0x00},
-	{0x4E,0x18,0x90,0x38,0x00},
-	{0x4E,0x18,0x90,0x38,0x00},
-	{0x67,0x11,0x9A,0x56,0x00},
-	{0x67,0x11,0x9A,0x56,0x00},
-	{0x8A,0x14,0x00,0x80,0x00},
-	{0x8A,0x14,0x00,0x80,0x00}
-    },
-    {
-    	{0x67,0x91,0x84,0x5E,0x00},
-	{0x67,0x91,0x84,0x5E,0x00},
-	{0x67,0x91,0x84,0x5E,0x00},
-	{0x67,0x91,0x84,0x5E,0x00},
-	{0x67,0x91,0x84,0x5E,0x00},
-	{0x67,0x91,0x84,0x5E,0x00},
-	{0x67,0x91,0x84,0x5E,0x00},
-	{0x65,0xEF,0x83,0x5C,0x00},
-	{0x65,0xEF,0x83,0x5C,0x00},
-	{0x8A,0x14,0x00,0x80,0x00},
-	{0x8A,0x14,0x00,0x80,0x00}
-    },
-    {
-    	{0x4E,0x18,0x90,0x38,0x00},
-	{0x4E,0x18,0x90,0x38,0x00},
-	{0x8E,0x18,0x28,0x78,0x00},
-	{0x8E,0x18,0x28,0x78,0x00},
-	{0x8E,0x18,0x28,0x78,0x00},
-	{0x4E,0x18,0x90,0x38,0x00},
-	{0x4E,0x18,0x90,0x38,0x00},
-	{0x67,0x11,0x9A,0x56,0x00},
-	{0x67,0x11,0x9A,0x56,0x00},
-	{0x8A,0x14,0x00,0x80,0x00},
-	{0x8A,0x14,0x00,0x80,0x00}
+	{  { 0x16, 0xcf, 0x00 },
+	   { 0x18, 0x00, 0x00 },
+	   { 0x1a, 0xe7, 0x00 },
+	   { 0x1b, 0x26, 0x00 },
+	   { 0x1c, 0xff, 0x00 },
+	   { 0x1d, 0x1c, 0x00 },
+	   { 0x1e, 0x19, 0x00 }
+	},
+	{
+	   { 0x16, 0xcf, 0x00 },
+	   { 0x18, 0x00, 0x00 },
+	   { 0x1a, 0xe7, 0x00 },
+	   { 0x1b, 0x1e, 0x00 },
+	   { 0x1c, 0xff, 0x00 },
+	   { 0x1d, 0x1c, 0x00 },
+	   { 0x1e, 0x16, 0x00 }
+	},
+	{
+	   { 0x16, 0xcf, 0x00 },
+	   { 0x1a, 0xe7, 0x00 },
+	   { 0x1b, 0x26, 0x00 },
+	   { 0x1c, 0xff, 0x00 },
+	   { 0x1d, 0x1c, 0x00 },
+	   { 0x1e, 0x19, 0x00 },
+	   {    0,    0,    0 }
+	},
+	{
+	   {    0,    0,    0 }
+	},
+	{
+	   { 0x16, 0xcf, 0x00 },
+	   { 0x1a, 0xe7, 0x00 },
+	   { 0x1b, 0x26, 0x00 },
+	   { 0x1c, 0xff, 0x00 },
+	   { 0x1d, 0x1c, 0x00 },
+	   { 0x1e, 0x1e, 0x00 },
+	   {    0,    0,    0 }
+	},
+	{
+	   { 0x16, 0xd1, 0x00 },
+	   { 0x18, 0x00, 0x00 },
+	   { 0x1a, 0xe7, 0x00 },
+	   { 0x1b, 0x11, 0x00 },
+	   { 0x1c, 0xff, 0x00 },
+	   { 0x1d, 0x1c, 0x00 },
+	   { 0x1e, 0x26, 0x00 }
+	},
+	{
+	   { 0x16, 0xd1, 0x00 },
+	   { 0x1a, 0xe7, 0x00 },
+	   { 0x1b, 0x26, 0x00 },
+	   { 0x1c, 0xff, 0x00 },
+	   { 0x1d, 0x1c, 0x00 },
+	   { 0x1e, 0x30, 0x00 },
+	   {    0,    0,    0 }
+	},
+	{
+	   { 0x16, 0x00, 0x00 },
+	   { 0x17, 0xa0, 0x00 },
+	   { 0x1a, 0xa0, 0x00 },
+	   { 0x1b, 0x2a, 0x00 },
+	   { 0x1c, 0xff, 0x00 },
+	   { 0x1d, 0x1c, 0x00 },
+	   {    0,    0,    0 }
+	},
+	{
+	   { 0x16, 0x00, 0x00 },
+	   { 0x17, 0xaa, 0x00 },
+	   { 0x1a, 0xa0, 0x00 },
+	   { 0x1b, 0x2a, 0x00 },
+	   { 0x1c, 0xff, 0x00 },
+	   { 0x1d, 0x1c, 0x00 },
+	   {    0,    0,    0 }
+	}
+    },
+    {
+	{
+	   { 0x16, 0xcf, 0x00 },
+	   { 0x18, 0x00, 0x00 },
+	   { 0x1a, 0xe7, 0x00 },
+	   { 0x1b, 0x26, 0x00 },
+	   { 0x1c, 0xff, 0x00 },
+	   { 0x1d, 0x1c, 0x00 },
+	   { 0x1e, 0x19, 0x00 }
+	},
+	{
+	   {    0,    0,    0 }
+	},
+	{
+	   { 0x16, 0xcf, 0x00 },
+	   { 0x18, 0x00, 0x00 },
+	   { 0x1a, 0xe7, 0x00 },
+	   { 0x1b, 0x26, 0x00 },
+	   { 0x1c, 0xff, 0x00 },
+	   { 0x1d, 0x1c, 0x00 },
+	   { 0x1e, 0x19, 0x00 },
+	},
+	{
+	   {    0,    0,    0 }
+	},
+	{
+	   { 0x16, 0xcf, 0x00 },
+	   { 0x18, 0x00, 0x00 },
+	   { 0x1a, 0xe7, 0x00 },
+	   { 0x1b, 0x26, 0x00 },
+	   { 0x1c, 0xff, 0x00 },
+	   { 0x1d, 0x1c, 0x00 },
+	   { 0x1e, 0x1e, 0x00 }
+	},
+	{
+	   { 0x16, 0xd1, 0x00 },
+	   { 0x18, 0x00, 0x00 },
+	   { 0x1a, 0xe6, 0x00 },
+	   { 0x1b, 0x11, 0x00 },
+	   { 0x1c, 0xff, 0x00 },
+	   { 0x1d, 0x1c, 0x00 },
+	   { 0x1e, 0x26, 0x00 }
+	},
+	{
+	   { 0x18, 0x00, 0x00 },
+	   { 0x1a, 0xe0, 0x00 },
+	   { 0x1b, 0x26, 0x00 },
+	   { 0x1c, 0xff, 0x00 },
+	   { 0x1d, 0x1c, 0x00 },
+	   { 0x1e, 0x30, 0x00 },
+	   {    0,    0,    0 }
+	},
+	{
+	   {    0,    0,    0 }
+	},
+	{
+	   {    0,    0,    0 }
+	}
     }
 };
 
-#if 0
-const UCHAR SiS300_LCDVData[24][11][6] = {
-    {
-        {
-    },
-};
-#endif
+
+
+
+
+
--- diff/drivers/video/sis/oem310.h	2003-10-09 09:47:17.000000000 +0100
+++ source/drivers/video/sis/oem310.h	2004-02-09 10:39:55.000000000 +0000
@@ -1,7 +1,58 @@
+/* $XFree86$ */
+/*
+ * OEM Data for 315/330 series
+ *
+ * Copyright (C) 2001-2004 by Thomas Winischhofer, Vienna, Austria
+ *
+ * If distributed as part of the Linux kernel, the following license terms
+ * apply:
+ *
+ * * 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 named License,
+ * * or 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
+ *
+ * Otherwise, the following license terms apply:
+ *
+ * * 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) All advertising materials mentioning features or use of this software
+ * *    must display the following acknowledgement: "This product includes
+ * *    software developed by Thomas Winischhofer, Vienna, Austria."
+ * * 4) The name of the author may not be used to endorse or promote products
+ * *    derived from this software without specific prior written permission.
+ * *
+ * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
+ *
+ * Author: 	Thomas Winischhofer <thomas@winischhofer.net>
+ *
+ */
 
-/* OEM Data for 310/325/330 series */
-
-const UCHAR SiS310_LCDDelayCompensation_301[] =	    	/* 301 */
+static const UCHAR SiS310_LCDDelayCompensation_301[] =	    		/* 301 */
 {
 		 0x00,0x00,0x00,    /*   800x600 */
 		 0x0b,0x0b,0x0b,    /*  1024x768 */
@@ -21,7 +72,7 @@
 };
 
 /* This is contained in 650+301B BIOSes, but it is wrong - so we don't use it */
-UCHAR SiS310_LCDDelayCompensation_650301B[] =	   	/* 30xB,LV */
+static const UCHAR SiS310_LCDDelayCompensation_650301LV[] =	   	/* 650 + 30xLV */
 {
 		 0x01,0x01,0x01,    /*   800x600 */
 		 0x01,0x01,0x01,    /*  1024x768 */
@@ -40,67 +91,9 @@
 		 0x02,0x02,0x02
 };
 
-/* This data is correct, so we use it instead of the table above */
-UCHAR SiS310_LCDDelayCompensation_3xx301B[] =	   	/* 30xB,LV */
-{
-		 0x01,0x01,0x01,    /*   800x600 */
-		 0x0C,0x0C,0x0C,    /*  1024x768 */
-		 0x0C,0x0C,0x0C,    /* 1280x1024 */
-                 0x08,0x08,0x08,    /*   640x480 */
-		 0x0C,0x0C,0x0C,    /*  1024x600 (guessed) */
-		 0x0C,0x0C,0x0C,    /*  1152x864 (guessed) */
-		 0x0C,0x0C,0x0C,    /*  1280x960 (guessed) */
-		 0x0C,0x0C,0x0C,    /*  1152x768 (guessed) */
-		 0x0C,0x0C,0x0C,    /* 1400x1050 (guessed) */
-		 0x0C,0x0C,0x0C,    /*  1280x768 (guessed) */
-		 0x0C,0x0C,0x0C,    /* 1600x1200 (guessed) */
-		 0x02,0x02,0x02,
-		 0x02,0x02,0x02,
-		 0x02,0x02,0x02,
-		 0x02,0x02,0x02
-};
-
-const UCHAR SiS310_LCDDelayCompensation_LVDS650[] =   	/* LVDS */
+static const UCHAR SiS310_LCDDelayCompensation_651301LV[] =	  /* M650/651 301LV */
 {
-                 0x00,0x00,0x00,    /*   800x600 */
-		 0x00,0x00,0x00,    /*  1024x768 */
-		 0x00,0x00,0x00,    /* 1280x1024 */
-		 0x00,0x00,0x00,    /*   640x480 (unknown) */
-		 0x00,0x00,0x00,    /*  1024x600 (unknown) */
-		 0x00,0x00,0x00,    /*  1152x864 (unknown) */
-		 0x00,0x00,0x00,    /*  1280x960 (guessed) */
-		 0x00,0x00,0x00,    /*  1152x768 (unknown) */
-		 0x00,0x00,0x00,    /* 1400x1050 */
-		 0x00,0x00,0x00,    /*  1280x768  (guessed) */
-		 0x00,0x00,0x00,    /* 1600x1200 */
-		 0x00,0x00,0x00,
-		 0x00,0x00,0x00,
-		 0x00,0x00,0x00,
-		 0x00,0x00,0x00
-};
-
-const UCHAR SiS310_LCDDelayCompensation_LVDS740[] =   	/* LVDS */
-{
-                 0x03,0x03,0x03,    /*   800x600 */
-		 0x03,0x03,0x03,    /*  1024x768 */
-		 0x03,0x03,0x03,    /* 1280x1024 */
-		 0x03,0x03,0x03,    /*   640x480 (unknown) */
-		 0x03,0x03,0x03,    /*  1024x600 (unknown) */
-		 0x03,0x03,0x03,    /*  1152x864 (unknown) */
-		 0x03,0x03,0x03,    /*  1280x960 (guessed) */
-		 0x03,0x03,0x03,    /*  1152x768 (unknown) */
-		 0x03,0x03,0x03,    /* 1400x1050 */
-		 0x03,0x03,0x03,    /*  1280x768  (guessed) */
-		 0x03,0x03,0x03,    /* 1600x1200 */
-		 0x00,0x00,0x00,
-		 0x00,0x00,0x00,
-		 0x00,0x00,0x00,
-		 0x00,0x00,0x00
-};
-
-const UCHAR SiS310_LCDDelayCompensation_651301LV[] =	  /* M650/651 301LV */
-{
-                 0x33,0x33,0x33,    /*   800x600 (guessed) */
+                 0x33,0x33,0x33,    /*   800x600 (guessed) - new: PanelType, not PanelRes ! */
 		 0x33,0x33,0x33,    /*  1024x768 */
 		 0x33,0x33,0x33,    /* 1280x1024 */
 		 0x33,0x33,0x33,    /*   640x480 (unknown) */
@@ -117,7 +110,7 @@
 		 0x33,0x33,0x33
 };
 
-const UCHAR SiS310_LCDDelayCompensation_651302LV[] =	   /* M650/651 302LV */
+static const UCHAR SiS310_LCDDelayCompensation_651302LV[] =	   /* M650/651 302LV */
 {
                  0x33,0x33,0x33,    /*   800x600 (guessed) */
 		 0x33,0x33,0x33,    /*  1024x768 */
@@ -136,66 +129,111 @@
 		 0x33,0x33,0x33
 };
 
-const UCHAR SiS310_TVDelayCompensation_301[] = 		/* 301 */
+static const UCHAR SiS310_LCDDelayCompensation_3xx301B[] =	   	/* 30xB,LV */
+{
+		 0x01,0x01,0x01,    /*   800x600 */
+		 0x0C,0x0C,0x0C,    /*  1024x768 */
+		 0x0C,0x0C,0x0C,    /* 1280x1024 */
+                 0x08,0x08,0x08,    /*   640x480 */
+		 0x0C,0x0C,0x0C,    /*  1024x600 (guessed) */
+		 0x0C,0x0C,0x0C,    /*  1152x864 (guessed) */
+		 0x0C,0x0C,0x0C,    /*  1280x960 (guessed) */
+		 0x0C,0x0C,0x0C,    /*  1152x768 (guessed) */
+		 0x0C,0x0C,0x0C,    /* 1400x1050 (guessed) */
+		 0x0C,0x0C,0x0C,    /*  1280x768 (guessed) */
+		 0x0C,0x0C,0x0C,    /* 1600x1200 (guessed) */
+		 0x02,0x02,0x02,
+		 0x02,0x02,0x02,
+		 0x02,0x02,0x02,
+		 0x02,0x02,0x02
+};
+
+static const UCHAR SiS310_TVDelayCompensation_301[] = 		/* 301 */
 {
 		 0x02,0x02,    /* NTSC Enhanced, Standard */
                  0x02,0x02,    /* PAL */
 		 0x08,0x0b     /* HiVision */
 };
 
-const UCHAR SiS310_TVDelayCompensation_301B[] =		/* 30xB, 30xLV */
+static const UCHAR SiS310_TVDelayCompensation_301B[] =		/* 30xB, 30xLV */
 {
 		 0x03,0x03,
 		 0x03,0x03,
 		 0x03,0x03
 };
 
-const UCHAR SiS310_TVDelayCompensation_740301B[] =	/* 740 + 30xB (30xLV?) */
+static const UCHAR SiS310_TVDelayCompensation_740301B[] =	/* 740 + 30xB (30xLV?) */
 {
 		 0x05,0x05,
 		 0x05,0x05,
 		 0x05,0x05
 };
 
-const UCHAR SiS310_TVDelayCompensation_LVDS[] =		/* LVDS */
+static const UCHAR SiS310_TVDelayCompensation_LVDS[] =		/* LVDS */
 {
 		 0x0a,0x0a,
 		 0x0a,0x0a,
 		 0x0a,0x0a
 };
 
-const UCHAR SiS310_TVDelayCompensation_651301LV[] =	/* M650, 651, 301LV */
+static const UCHAR SiS310_TVDelayCompensation_651301LV[] =	/* M650, 651, 301LV */
 {
 		 0x33,0x33,
 		 0x33,0x33,
 		 0x33,0x33
 };
 
-const UCHAR SiS310_TVDelayCompensation_651302LV[] =	/* M650, 651, 302LV */
+static const UCHAR SiS310_TVDelayCompensation_651302LV[] =	/* M650, 651, 302LV */
 {
 		 0x33,0x33,
 		 0x33,0x33,
 		 0x33,0x33
 };
 
-const UCHAR SiS310_TVAntiFlick1[3][2] =
+static const UCHAR SiS_TVDelay661_301[] =			/* 661, 301 */
+{
+		 0x44,0x44,
+		 0x44,0x44,
+		 0x00,0x00,
+		 0x44,0x44,
+		 0x44,0x44,
+		 0x44,0x44
+};
+
+static const UCHAR SiS_TVDelay661_301B[] =			/* 661, 301B et al */
+{
+		 0x44,0x44,
+		 0x44,0x44,
+		 0x00,0x00,
+		 0x44,0x44,
+		 0x44,0x44,
+		 0x44,0x44
+};
+
+static const UCHAR SiS310_TVAntiFlick1[6][2] =
 {
             {0x4,0x0},
 	    {0x4,0x8},
+	    {0x0,0x0},
+	    {0x0,0x0},
+	    {0x0,0x0},
 	    {0x0,0x0}
 };
 
-const UCHAR SiS310_TVEdge1[3][2] =
+static const UCHAR SiS310_TVEdge1[6][2] =
 {
             {0x0,0x4},
 	    {0x0,0x4},
+	    {0x0,0x0},
+	    {0x0,0x0},
+	    {0x0,0x0},
 	    {0x0,0x0}
 };
 
-const UCHAR SiS310_TVYFilter1[3][8][4] =
+static const UCHAR SiS310_TVYFilter1[5][8][4] =
 {
  {
-	{0x00,0xf4,0x10,0x38},
+	{0x00,0xf4,0x10,0x38},	/* NTSC */
 	{0x00,0xf4,0x10,0x38},
 	{0xeb,0x04,0x25,0x18},
 	{0xf1,0x04,0x1f,0x18},
@@ -205,7 +243,7 @@
 	{0xeb,0x15,0x25,0xf6}
  },
  {
-	{0x00,0xf4,0x10,0x38},
+	{0x00,0xf4,0x10,0x38},	/* PAL */
 	{0x00,0xf4,0x10,0x38},
 	{0xf1,0xf7,0x1f,0x32},
 	{0xf3,0x00,0x1d,0x20},
@@ -215,7 +253,7 @@
 	{0xfc,0xfb,0x14,0x2a}
  },
  {
-	{0x00,0x00,0x00,0x00},
+	{0x00,0x00,0x00,0x00},	/* HiVision */
 	{0x00,0xf4,0x10,0x38},
 	{0x00,0xf4,0x10,0x38},
 	{0xeb,0x04,0x25,0x18},
@@ -223,13 +261,33 @@
 	{0x00,0xf4,0x10,0x38},
 	{0xeb,0x04,0x25,0x18},
 	{0xee,0x0c,0x22,0x08}
+ },
+ {
+ 	{0x00,0xf4,0x10,0x38},	/* PAL-M */
+	{0x00,0xf4,0x10,0x38},
+	{0xeb,0x04,0x10,0x18},
+	{0xf7,0x06,0x19,0x14},
+	{0x00,0xf4,0x10,0x38},
+	{0xeb,0x04,0x25,0x18},
+	{0xeb,0x04,0x25,0x18},
+	{0xeb,0x15,0x25,0xf6}
+ },
+ {
+ 	{0x00,0xf4,0x10,0x38},	/* PAL-N */
+	{0x00,0xf4,0x10,0x38},
+	{0xeb,0x04,0x10,0x18},
+	{0xf7,0x06,0x19,0x14},
+	{0x00,0xf4,0x10,0x38},
+	{0xeb,0x04,0x25,0x18},
+	{0xeb,0x04,0x25,0x18},
+	{0xeb,0x15,0x25,0xf6}
  }
 };
 
-const UCHAR SiS310_TVYFilter2[3][9][7] =
+static const UCHAR SiS310_TVYFilter2[5][9][7] =
 {
  {
-	{0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46},
+	{0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46},	/* NTSC */
 	{0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C},
 	{0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46},
 	{0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C},
@@ -240,7 +298,7 @@
 	{0xFF,0xFF,0xFC,0x00,0x0F,0x22,0x28}
  },
  {
-	{0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46},   
+	{0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46},   /* PAL */
 	{0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C},
 	{0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46},
 	{0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C},
@@ -251,6 +309,7 @@
 	{0xFF,0xFF,0xFC,0x00,0x0F,0x22,0x28}
  },
  {
+	{0x00,0x00,0x00,0xF4,0xFF,0x1C,0x22},	/* HiVision */
 	{0x00,0x00,0x00,0xF4,0xFF,0x1C,0x22},
 	{0x00,0x00,0x00,0xF4,0xFF,0x1C,0x22},
 	{0x00,0x00,0x00,0xF4,0xFF,0x1C,0x22},
@@ -259,53 +318,9 @@
 	{0x00,0x00,0x00,0xF4,0xFF,0x1C,0x22},
 	{0x00,0x00,0x00,0xF4,0xFF,0x1C,0x22},
 	{0x00,0x00,0x00,0xF4,0xFF,0x1C,0x22}
- }
-};
-
-const UCHAR SiS310_PALMFilter[16][4] =
-{
-	{0x00,0xf4,0x10,0x38},
-	{0x00,0xf4,0x10,0x38},
-	{0xeb,0x04,0x10,0x18},
-	{0xf7,0x06,0x19,0x14},
-	{0x00,0xf4,0x10,0x38},
-	{0xeb,0x04,0x25,0x18},
-	{0xeb,0x04,0x25,0x18},
-	{0xeb,0x15,0x25,0xf6},
-	{0xeb,0x04,0x25,0x18},
-	{0xeb,0x04,0x25,0x18},
-	{0xeb,0x04,0x25,0x18},
-	{0xeb,0x04,0x25,0x18},
-	{0xeb,0x04,0x25,0x18},
-	{0xeb,0x04,0x25,0x18},
-	{0xeb,0x04,0x25,0x18},
-	{0xeb,0x04,0x25,0x18}
-};
-
-const UCHAR SiS310_PALNFilter[16][4] =
-{
-	{0x00,0xf4,0x10,0x38},
-	{0x00,0xf4,0x10,0x38},
-	{0xeb,0x04,0x10,0x18},
-	{0xf7,0x06,0x19,0x14},
-	{0x00,0xf4,0x10,0x38},
-	{0xeb,0x04,0x25,0x18},
-	{0xeb,0x04,0x25,0x18},
-	{0xeb,0x15,0x25,0xf6},
-	{0xeb,0x04,0x25,0x18},
-	{0xeb,0x04,0x25,0x18},
-	{0xeb,0x04,0x25,0x18},
-	{0xeb,0x04,0x25,0x18},
-	{0xeb,0x04,0x25,0x18},
-	{0xeb,0x04,0x25,0x18},
-	{0xeb,0x04,0x25,0x18},
-	{0xeb,0x04,0x25,0x18}
-};
-
-
-const UCHAR SiS310_PALMFilter2[9][7] =
-{
-	{0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46},
+ },
+ {
+ 	{0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46}, 	/* PAL-M */
 	{0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C},
 	{0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46},
 	{0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C},
@@ -314,11 +329,9 @@
 	{0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C},
 	{0x01,0x01,0xFC,0xF8,0x08,0x26,0x38},
 	{0xFF,0xFF,0xFC,0x00,0x0F,0x22,0x28}
-};
-
-const UCHAR SiS310_PALNFilter2[9][7] =
-{
-	{0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46},
+ },
+ {
+ 	{0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46},	/* PAL-N */
 	{0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C},
 	{0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46},
 	{0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C},
@@ -327,9 +340,10 @@
 	{0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C},
 	{0x01,0x01,0xFC,0xF8,0x08,0x26,0x38},
 	{0xFF,0xFF,0xFC,0x00,0x0F,0x22,0x28}
+ }
 };
 
-const UCHAR SiS310_TVPhaseIncr1[3][2][4] =
+static const UCHAR SiS310_TVPhaseIncr1[3][2][4] =
 {
  {
 	{0x21,0xed,0xba,0x08},
@@ -345,15 +359,15 @@
  }
 };
 
-const UCHAR SiS310_TVPhaseIncr2[3][2][4] =
+static const UCHAR SiS310_TVPhaseIncr2[3][2][4] =
 {
  {
-	{0x21,0xf0,0x7b,0xd6},   /* 1.10.7w;  1.10.6s: {0x1e,0x8b,0xda,0xa7},   old: {0x21,0xF1,0x37,0x56} */
-	{0x21,0xf0,0x7b,0xd6}    /* 1.10.7w;  1.10.6s: {0x1e,0x8b,0xda,0xa7}    old: {0x21,0xF1,0x37,0x56} */
+	{0x21,0xf0,0x7b,0xd6},
+	{0x21,0xf0,0x7b,0xd6}
  },
  {
-	{0x2a,0x0a,0x41,0xe9},   /* 1.10.7w, 1.10.6s. old: {0x2a,0x09,0x86,0xe9}, */
-	{0x2a,0x0a,0x41,0xe9}    /* 1.10.7w, 1.10.6s. old: {0x2a,0x09,0x86,0xe9}  */
+	{0x2a,0x0a,0x41,0xe9},
+	{0x2a,0x0a,0x41,0xe9}
  },
  {
 	{0x2a,0x05,0xd3,0x00},
@@ -361,5 +375,239 @@
  }
 };
 
+static const UCHAR SiS661_TVPhase[] = {
+    0x21,0xED,0xBA,0x08,
+    0x2A,0x05,0xE3,0x00,
+    0x21,0xE4,0x2E,0x9B,
+    0x21,0xF4,0x3E,0xBA,
+    0x1E,0x8B,0xA2,0xA7,
+    0x1E,0x83,0x0A,0xE0,
+    0x00,0x00,0x00,0x00,
+    0x00,0x00,0x00,0x00,
+    0x21,0xF0,0x7B,0xD6,
+    0x2A,0x09,0x86,0xE9,
+    0x21,0xE6,0xEF,0xA4,
+    0x21,0xF6,0x94,0x46,
+    0x1E,0x8B,0xA2,0xA7,
+    0x1E,0x83,0x0A,0xE0,
+    0x00,0x00,0x00,0x00,
+    0x00,0x00,0x00,0x00
+};
+
+/**************************************************************/
+/* CUSTOM TIMING DATA --------------------------------------- */
+/**************************************************************/
+
+/* Inventec / Compaq Presario 3045US, 3017 */
+
+static const SiS_LCDDataStruct  SiS310_ExtCompaq1280x1024Data[] =
+{
+	{  211,  60,1024, 501,1688,1066},
+	{  211,  60,1024, 508,1688,1066},
+	{  211,  60,1024, 501,1688,1066},
+	{  211,  60,1024, 508,1688,1066},
+	{   32,  15,1696, 501,1696,1066},
+	{  212,  75,1024, 621,1696,1066},
+	{    4,   3,1696, 810,1696,1066},
+	{    1,   1,1696,1066,1696,1066}
+};
+
+static const SiS_Part2PortTblStruct SiS310_CRT2Part2_Compaq1280x1024_1[] =
+{
+ {{0x3F,0x1B,0xD0,0xF0,0xB0,0xB8,0x23,0x0A,0x07,0x14,0x8A,0x12}},
+ {{0x35,0x1B,0xA0,0xC0,0x80,0xB8,0x23,0x0A,0x07,0x14,0x8A,0x12}},
+ {{0x3F,0x1B,0xD0,0xF0,0xB0,0xB8,0x23,0x0A,0x07,0x14,0x8A,0x12}},
+ {{0x3F,0x1B,0xD0,0xF0,0xB0,0xB8,0x23,0x0A,0x07,0x14,0x8A,0x12}},
+ {{0x45,0x1C,0x20,0x3F,0xFF,0xB8,0x23,0x0A,0x07,0x14,0x8A,0x12}},
+ {{0x49,0x1C,0x40,0x7F,0xFF,0xAD,0x23,0x0A,0x07,0xF3,0x8A,0x12}},
+ {{0x4C,0x1C,0x18,0x2F,0xFF,0xBD,0x23,0x0A,0x07,0x23,0x8A,0x12}},
+ {{0x48,0x1C,0x15,0x29,0xFF,0xBD,0x23,0x0A,0x07,0x23,0x8A,0x12}}
+};
+
+static const SiS_Part2PortTblStruct SiS310_CRT2Part2_Compaq1280x1024_2[] =
+{
+ {{0x2B,0x12,0xD9,0xE5,0xD5,0x2C,0x23,0x98,0x27,0x3E,0x08,0x42}},
+ {{0x22,0x12,0xC0,0xCC,0xBC,0x2C,0x23,0x98,0x27,0x3E,0x08,0x42}},
+ {{0x2B,0x12,0xD9,0xE5,0xD5,0x2C,0x23,0x98,0x27,0x3E,0x08,0x42}},
+ {{0x22,0x12,0xC0,0xCC,0xBC,0x2C,0x23,0x98,0x27,0x3E,0x08,0x42}},
+ {{0x33,0x13,0x01,0x0D,0xFD,0x2C,0x23,0x98,0x27,0x3E,0x08,0x42}},
+ {{0x3F,0x1B,0x3D,0x49,0x39,0x54,0x23,0xC0,0x27,0x66,0x30,0x42}},
+ {{0x33,0x1B,0x91,0x9D,0x8D,0x8C,0x23,0xF8,0x27,0x9E,0x68,0x42}},
+ {{0x43,0x24,0x11,0x1D,0x0D,0xCC,0x23,0x38,0x37,0xDE,0xA8,0x42}},
+ {{0x43,0x24,0x21,0x29,0x19,0xEA,0x23,0x0A,0x07,0x32,0xC6,0x42}}
+};
+
+static const SiS_Part2PortTblStruct SiS310_CRT2Part2_Compaq1280x1024_3[] =
+{
+ {{0x47,0x1C,0x14,0x29,0xFF,0xBD,0x23,0x0A,0x07,0x23,0x8A,0x12}},
+ {{0x47,0x1C,0x14,0x29,0xFF,0xBD,0x23,0x0A,0x07,0x23,0x8A,0x12}},
+ {{0x47,0x1C,0x14,0x29,0xFF,0xBD,0x23,0x0A,0x07,0x23,0x8A,0x12}},
+ {{0x47,0x1C,0x14,0x29,0xFF,0xBD,0x23,0x0A,0x07,0x23,0x8A,0x12}},
+ {{0x47,0x1C,0x14,0x29,0xFF,0xBE,0x23,0x0A,0x07,0x26,0x8A,0x42}},
+ {{0x47,0x1C,0x14,0x29,0xFF,0xBE,0x23,0x0A,0x07,0x26,0x8A,0x42}},
+ {{0x47,0x1C,0x14,0x29,0xFF,0xBE,0x23,0x0A,0x07,0x26,0x8A,0x42}},
+ {{0x47,0x1C,0x14,0x29,0xFF,0xBE,0x23,0x0A,0x07,0x26,0x8A,0x42}}
+};
+
+/* LCDA CRT2 data is std */
+
+static const SiS_LVDSDesStruct Compaq1280x1024Des_1[] =
+{
+  { 0, 0 },
+  { 0, 0 },
+  { 0, 0 },
+  { 0, 0 },
+  { 0, 0 },
+  { 0, 0 },
+  { 0, 0 },
+  { 0, 0 }
+};
+
+static const SiS_LVDSDesStruct Compaq1280x1024Des_2[] =
+{
+  { 0, 0 },
+  { 0, 0 },
+  { 0, 0 },
+  { 0, 0 },
+  { 0, 0 },
+  { 0, 0 },
+  { 0, 0 },
+  { 0, 0 }
+};
+
+/* Clevo L285/287 (dual-link 1024x768) */
+
+static const SiS_Part2PortTblStruct SiS310_CRT2Part2_Clevo1024x768_1[] =
+{
+ {{0x25,0x12,0xC9,0xDC,0xB6,0x59,0x45,0x09,0x07,0xF9,0x09,0x24}},
+ {{0x2C,0x12,0x9A,0xAE,0x88,0x59,0x45,0x09,0x07,0xF9,0x09,0x24}},
+ {{0x25,0x12,0xC9,0xDC,0xB6,0x59,0x45,0x09,0x07,0xF9,0x09,0x24}},
+ {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {{0x38,0x13,0x16,0x0C,0xE6,0x59,0x45,0x09,0x07,0xF9,0x09,0x24}},
+ {{0x38,0x18,0x16,0x00,0x00,0x59,0x45,0x09,0x07,0xF9,0x09,0x24}},
+ {{0x36,0x13,0x13,0x25,0xFF,0x59,0x45,0x09,0x07,0xF9,0x09,0x24}},
+ {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {{0x25,0x12,0xC9,0xDC,0xB6,0x59,0x45,0x09,0x07,0xF9,0x09,0x24}}
+};
+
+static const SiS_Part2PortTblStruct SiS310_CRT2Part2_Clevo1024x768_2[] =
+{
+ {{0x25,0x12,0x51,0x6E,0x48,0xCC,0x12,0x89,0x47,0x1C,0x49,0x33}},
+ {{0x2C,0x12,0x38,0x55,0x2F,0xCC,0x12,0x89,0x47,0x1C,0x49,0x33}},
+ {{0x25,0x12,0x51,0x6E,0x48,0xCC,0x12,0x89,0x47,0x1C,0x49,0x33}},
+ {{0x2C,0x12,0x38,0x55,0x2F,0xE0,0x12,0xB1,0x47,0x30,0x71,0x33}},
+ {{0x2D,0x12,0x79,0x96,0x70,0xCC,0x12,0x89,0x47,0x1C,0x49,0x33}},
+ {{0x29,0x12,0xB5,0xD2,0xAC,0xF4,0x12,0xD9,0x47,0x44,0x99,0x33}},
+ {{0x36,0x13,0x13,0x25,0xFF,0x32,0x22,0x0A,0x07,0x82,0x0A,0x12}},
+#if 0
+ {{0x25,0x12,0x51,0x6E,0x48,0x99,0x35,0x89,0x47,0xC1,0x49,0x33}},
+ {{0x2C,0x12,0x38,0x55,0x2F,0x99,0x35,0x89,0x47,0xC1,0x49,0x33}},
+ {{0x25,0x12,0x51,0x6E,0x48,0x99,0x35,0x89,0x47,0xC1,0x49,0x33}},
+ {{0x2C,0x12,0x38,0x55,0x2F,0xC1,0x35,0xB1,0x47,0xE9,0x71,0x33}},
+ {{0x2D,0x12,0x79,0x96,0x70,0x99,0x35,0x89,0x47,0xC1,0x49,0x33}},
+ {{0x29,0x12,0xB5,0xD2,0xAC,0xE9,0x35,0xD9,0x47,0x11,0x99,0x33}},
+ {{0x36,0x13,0x13,0x25,0xFF,0x59,0x45,0x09,0x07,0xF9,0x09,0x24}}
+#endif
+};
+
+static const SiS_Part2PortTblStruct SiS310_CRT2Part2_Clevo1024x768_3[] =
+{
+ {{0x36,0x13,0x13,0x25,0xFF,0x32,0x22,0x0A,0x07,0x82,0x0A,0x12}}, /* Corrected */
+ {{0x36,0x13,0x13,0x25,0xFF,0x32,0x22,0x0A,0x07,0x82,0x0A,0x12}},
+ {{0x36,0x13,0x13,0x25,0xFF,0x32,0x22,0x0A,0x07,0x82,0x0A,0x12}},
+ {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {{0x36,0x13,0x13,0x25,0xFF,0x32,0x22,0x0A,0x07,0x82,0x0A,0x12}},
+ {{0x36,0x13,0x13,0x25,0xFF,0x32,0x22,0x0A,0x07,0x82,0x0A,0x12}},
+ {{0x36,0x13,0x13,0x25,0xFF,0x32,0x22,0x0A,0x07,0x82,0x0A,0x12}},
+ {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {{0x25,0x13,0xC9,0x25,0xFF,0x59,0x45,0x09,0x07,0xF9,0x09,0x24}}
+};
+
+/* CRT2 data is std */
+
+static const SiS_LVDSDesStruct Clevo1024x768Des_1[] =
+{
+  { 0, 0 },
+  { 0, 0 },
+  { 0, 0 },
+  { 0, 0 },
+  { 0, 0 },
+  { 0, 0 },
+  { 0, 0 }
+};
+
+static const SiS_LVDSDesStruct Clevo1024x768Des_2[] =
+{
+  { 1184, 622 },
+  { 1184, 597 },
+  { 1184, 622 },
+  { 1184, 597 },
+  { 1152, 622 },
+  { 1232, 722 },
+  {    0,   0 }
+};
+
+/* Asus A2xxxH _2 */
+
+static const SiS_Part2PortTblStruct SiS310_CRT2Part2_Asus1024x768_3[] =
+{
+ {{0x25,0x13,0xc9,0x25,0xff,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}},
+ {{0x2c,0x13,0x9a,0x25,0xff,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}},
+ {{0x25,0x13,0xc9,0x25,0xff,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}},
+ {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {{0x38,0x13,0x13,0x25,0xff,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}},
+ {{0x38,0x13,0x16,0x25,0xff,0x5a,0x45,0x0a,0x07,0xfa,0x0a,0x24}},
+ {{0x36,0x13,0x13,0x25,0xff,0x5a,0x45,0x0a,0x07,0xfa,0x0a,0x24}},
+ {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {{0x25,0x13,0xc9,0x25,0xff,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}}
+};
+
+static const SiS_LVDSDesStruct Asus1024x768Des_1[] =
+{
+  { 0, 0 },
+  { 0, 0 },
+  { 0, 0 },
+  { 0, 0 },
+  { 0, 0 },
+  { 0, 0 },
+  { 0, 0 }
+};
+
+static const SiS_LVDSDesStruct Asus1024x768Des_2[] =
+{
+  { 1184, 622 },
+  { 1184, 597 },
+  { 1184, 622 },
+  { 1184, 597 },
+  { 1152, 622 },
+  { 1232, 722 },
+  {    0,   0 }
+};
+
+/* CRT2 data is std */
+
+/* Uniwill N243S9, ECS A928 */
+
+static const SiS_LVDSDesStruct Uniwill1024x768Des_1[] =
+{
+  { 0, 0 },
+  { 0, 0 },
+  { 0, 0 },
+  { 0, 0 },
+  { 0, 0 },
+  { 0, 0 },
+  { 0, 805 }
+};
+
+static const SiS_LVDSDesStruct Uniwill1024x768Des_2[] =
+{
+  { 1184, 622 },
+  { 1184, 597 },
+  { 1184, 622 },
+  { 1184, 597 },
+  { 1152, 650 },
+  { 1232, 722 },
+  {    0, 805 },
+};
 
 
--- diff/drivers/video/sis/osdef.h	2003-10-09 09:47:17.000000000 +0100
+++ source/drivers/video/sis/osdef.h	2004-02-09 10:39:55.000000000 +0000
@@ -1,79 +1,95 @@
-/* #define WINCE_HEADER */
-/* #define WIN2000 */
-/* #define TC */
+/* $XFree86$ */
+/*
+ * OS depending defines
+ *
+ * Copyright (C) 2001-2004 by Thomas Winischhofer, Vienna, Austria
+ *
+ * If distributed as part of the Linux kernel, the following license terms
+ * apply:
+ *
+ * * 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 named License,
+ * * or 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
+ *
+ * Otherwise, the following license terms apply:
+ *
+ * * 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) All advertising materials mentioning features or use of this software
+ * *    must display the following acknowledgement: "This product includes
+ * *    software developed by Thomas Winischhofer, Vienna, Austria."
+ * * 4) The name of the author may not be used to endorse or promote products
+ * *    derived from this software without specific prior written permission.
+ * *
+ * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
+ *
+ * Author: 	Thomas Winischhofer <thomas@winischhofer.net>
+ *		Silicon Integrated Systems, Inc. (used by permission)
+ *
+ */
+
+/* The choices are: */
+
 #define LINUX_KERNEL	   /* Kernel framebuffer */
 /* #define LINUX_XF86 */   /* XFree86 */
 
 /**********************************************************************/
-#ifdef LINUX_KERNEL
-	#include <linux/config.h>
-	#include <linux/version.h>
-	#ifdef CONFIG_FB_SIS_300
- 		#define SIS300
-	#endif
-
-	#ifdef CONFIG_FB_SIS_315
-		#define SIS315H
-	#endif
-	#if 1
-		#define SISFBACCEL	/* Include 2D acceleration */
-	#endif
-	#if 1
-		#define SISFB_PAN	/* Include Y-Panning code */
-	#endif
-#else
-/*	#define SIS300*/
-	#define SIS315H
-#endif
-#ifdef LINUX_XF86
-	#define SIS300
-	/* #define SIS315H */ /* TW: done above */
-#endif
+#ifdef LINUX_KERNEL  /* -------------------------- */
+#include <linux/config.h>
+#include <linux/version.h>
 
-/**********************************************************************/
-#ifdef TC
-#endif
-#ifdef WIN2000
-#endif
-#ifdef WINCE_HEADER
+#ifdef CONFIG_FB_SIS_300
+#define SIS300
 #endif
-#ifdef LINUX_XF86
-#endif
-#ifdef LINUX_KERNEL
-#endif
-/**********************************************************************/
-#ifdef TC
-#define SiS_SetMemory(MemoryAddress,MemorySize,value) memset(MemoryAddress, value, MemorySize);
-#endif
-#ifdef WIN2000
-#define SiS_SetMemory(MemoryAddress,MemorySize,value) MemFill((PVOID) MemoryAddress,(ULONG) MemorySize,(UCHAR) value);
+
+#ifdef CONFIG_FB_SIS_315
+#define SIS315H
 #endif
-#ifdef WINCE_HEADER
-#define SiS_SetMemory(MemoryAddress,MemorySize,value) memset(MemoryAddress, value, MemorySize);
+
+#if 1
+#define SISFBACCEL	/* Include 2D acceleration */
 #endif
-#ifdef LINUX_XF86
-#define SiS_SetMemory(MemoryAddress,MemorySize,value) memset(MemoryAddress, value, MemorySize)
+
 #endif
-#ifdef LINUX_KERNEL
-#define SiS_SetMemory(MemoryAddress,MemorySize,value) memset(MemoryAddress, value, MemorySize)
+
+#ifdef LINUX_XF86 /* ----------------------------- */
+#define SIS300
+#define SIS315H
 #endif
-/**********************************************************************/
 
 /**********************************************************************/
-
-#ifdef TC
-#define SiS_MemoryCopy(Destination,Soruce,Length) memmove(Destination, Soruce, Length);
-#endif
-#ifdef WIN2000
-#define SiS_MemoryCopy(Destination,Soruce,Length)  /*VideoPortMoveMemory((PUCHAR)Destination , Soruce,length);*/
-#endif
-#ifdef WINCE_HEADER
-#define SiS_MemoryCopy(Destination,Soruce,Length) memmove(Destination, Soruce, Length);
-#endif
 #ifdef LINUX_XF86
+#define SiS_SetMemory(MemoryAddress,MemorySize,value) memset(MemoryAddress, value, MemorySize)
 #define SiS_MemoryCopy(Destination,Soruce,Length) memcpy(Destination,Soruce,Length)
 #endif
+
 #ifdef LINUX_KERNEL
+#define SiS_SetMemory(MemoryAddress,MemorySize,value) memset(MemoryAddress, value, MemorySize)
 #define SiS_MemoryCopy(Destination,Soruce,Length) memcpy(Destination,Soruce,Length)
 #endif
 
@@ -104,19 +120,6 @@
 #endif /* InPortLong */
 
 /**********************************************************************/
-/*  TC                                                                */
-/**********************************************************************/
-
-#ifdef TC
-#define OutPortByte(p,v) outp((unsigned short)(p),(unsigned char)(v))
-#define OutPortWord(p,v) outp((unsigned short)(p),(unsigned short)(v))
-#define OutPortLong(p,v) outp((unsigned short)(p),(unsigned long)(v))
-#define InPortByte(p)    inp((unsigned short)(p))
-#define InPortWord(p)    inp((unsigned short)(p))
-#define InPortLong(p)    ((inp((unsigned short)(p+2))<<16) | inp((unsigned short)(p)))
-#endif
-
-/**********************************************************************/
 /*  LINUX XF86                                                        */
 /**********************************************************************/
 
@@ -142,29 +145,4 @@
 #define InPortLong(p)    inl((u16)(p))
 #endif
 
-/**********************************************************************/
-/*  WIN 2000                                                          */
-/**********************************************************************/
-
-#ifdef WIN2000
-#define OutPortByte(p,v) VideoPortWritePortUchar ((PUCHAR) (p), (UCHAR) (v))
-#define OutPortWord(p,v) VideoPortWritePortUshort((PUSHORT) (p), (USHORT) (v))
-#define OutPortLong(p,v) VideoPortWritePortUlong ((PULONG) (p), (ULONG) (v))
-#define InPortByte(p)    VideoPortReadPortUchar  ((PUCHAR) (p))
-#define InPortWord(p)    VideoPortReadPortUshort ((PUSHORT) (p))
-#define InPortLong(p)    VideoPortReadPortUlong  ((PULONG) (p))
-#endif
 
-
-/**********************************************************************/
-/*  WIN CE                                                            */
-/**********************************************************************/
-
-#ifdef WINCE_HEADER
-#define OutPortByte(p,v) WRITE_PORT_UCHAR ((PUCHAR) (p), (UCHAR) (v))
-#define OutPortWord(p,v) WRITE_PORT_USHORT((PUSHORT) (p), (USHORT) (v))
-#define OutPortLong(p,v) WRITE_PORT_ULONG ((PULONG) (p), (ULONG) (v))
-#define InPortByte(p)    READ_PORT_UCHAR  ((PUCHAR) (p))
-#define InPortWord(p)    READ_PORT_USHORT ((PUSHORT) (p))
-#define InPortLong(p)    READ_PORT_ULONG  ((PULONG) (p))
-#endif
--- diff/drivers/video/sis/sis_accel.c	2003-10-09 09:47:17.000000000 +0100
+++ source/drivers/video/sis/sis_accel.c	2004-02-09 10:39:55.000000000 +0000
@@ -1,14 +1,27 @@
 /*
- * SiS 300/630/730/540/315/550/650/740 frame buffer driver
- * for Linux kernels 2.4.x and 2.5.x
+ * SiS 300/630/730/540/315/550/65x/74x/330/760 frame buffer driver
+ * for Linux kernels 2.4.x and 2.6.x
  *
  * 2D acceleration part
  *
- * Based on the X driver's sis300_accel.c which is
- *     Copyright Xavier Ducoin <x.ducoin@lectra.com>
- *     Copyright 2002 by Thomas Winischhofer, Vienna, Austria
+ * 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 named License,
+ * or 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
+ *
+ * Based on the XFree86 driver's sis300_accel.c which is
+ *     Copyright (C) 2001-2004 by Thomas Winischhofer, Vienna, Austria
  * and sis310_accel.c which is
- *     Copyright 2002 by Thomas Winischhofer, Vienna, Austria
+ *     Copyright (C) 2001-2004 by Thomas Winischhofer, Vienna, Austria
  *
  * Author: Thomas Winischhofer <thomas@winischhofer.net>
  *			(see http://www.winischhofer.net/
@@ -114,8 +127,8 @@
    };
 #endif
 
-/* 300 series */
-
+/* 300 series ----------------------------------------------------- */
+#ifdef CONFIG_FB_SIS_300
 static void
 SiS300Sync(void)
 {
@@ -123,12 +136,6 @@
 }
 
 static void
-SiS310Sync(void)
-{
-	SiS310Idle
-}
-
-static void
 SiS300SetupForScreenToScreenCopy(int xdir, int ydir, int rop,
                                 unsigned int planemask, int trans_color)
 {
@@ -210,8 +217,16 @@
 	SiS300SetupCMDFlag(X_INC | Y_INC | BITBLT)
 	SiS300DoCMD
 }
+#endif
 
-/* 310/325 series ------------------------------------------------ */
+/* 315/330 series ------------------------------------------------- */
+
+#ifdef CONFIG_FB_SIS_315
+static void
+SiS310Sync(void)
+{
+	SiS310Idle
+}
 
 static void
 SiS310SetupForScreenToScreenCopy(int xdir, int ydir, int rop,
@@ -230,7 +245,7 @@
 		/* SiSSetupCMDFlag(BITBLT | SRCVIDEO) */
 	}
 	SiS310SetupCMDFlag(ivideo.SiS310_AccelDepth)
-	/* TW: The 310/325 series is smart enough to know the direction */
+	/* The 315 series is smart enough to know the direction */
 }
 
 static void
@@ -306,6 +321,7 @@
 	SiS310SetupCMDFlag(BITBLT)
 	SiS310DoCMD
 }
+#endif
 
 /* --------------------------------------------------------------------- */
 
@@ -322,22 +338,33 @@
 void sisfb_syncaccel(void)
 {
     if(sisvga_engine == SIS_300_VGA) {
+#ifdef CONFIG_FB_SIS_300
     	SiS300Sync();
+#endif
     } else {
+#ifdef CONFIG_FB_SIS_315
     	SiS310Sync();
+#endif
     }
 }
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,34)  /* --- KERNEL 2.5.34 and later --- */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)  /* --------------- 2.5 --------------- */
 
 int fbcon_sis_sync(struct fb_info *info)
 {
-   if(!sisfb_accel) return 0;
    CRITFLAGS
+
+   if(!ivideo.accel)
+   	return 0;
+
    if(sisvga_engine == SIS_300_VGA) {
+#ifdef CONFIG_FB_SIS_300
       SiS300Sync();
+#endif
    } else {
+#ifdef CONFIG_FB_SIS_315
       SiS310Sync();
+#endif
    }
    CRITEND
    return 0;
@@ -352,32 +379,36 @@
    if(!rect->width || !rect->height)
    	return;
 
-   if(!sisfb_accel) {
+   if(!ivideo.accel) {
 	cfb_fillrect(info, rect);
 	return;
    }
    
    switch(info->var.bits_per_pixel) {
-		case 8: col = rect->color;
-			break;
-		case 16: col = ((u32 *)(info->pseudo_palette))[rect->color];
-			 break;
-		case 32: col = ((u32 *)(info->pseudo_palette))[rect->color];
-			 break;
-	}	
+	case 8:  col = rect->color;
+		 break;
+	case 16: col = ((u32 *)(info->pseudo_palette))[rect->color];
+		 break;
+	case 32: col = ((u32 *)(info->pseudo_palette))[rect->color];
+		 break;
+   }
 
    if(sisvga_engine == SIS_300_VGA) {
-	   CRITBEGIN
-	   SiS300SetupForSolidFill(col, myrops[rect->rop], 0);
-	   SiS300SubsequentSolidFillRect(rect->dx, rect->dy, rect->width, rect->height);
-	   CRITEND
-	   SiS300Sync();
+#ifdef CONFIG_FB_SIS_300
+      CRITBEGIN
+      SiS300SetupForSolidFill(col, myrops[rect->rop], 0);
+      SiS300SubsequentSolidFillRect(rect->dx, rect->dy, rect->width, rect->height);
+      CRITEND
+      SiS300Sync();
+#endif
    } else {
-	   CRITBEGIN
-	   SiS310SetupForSolidFill(col, myrops[rect->rop], 0);
-	   SiS310SubsequentSolidFillRect(rect->dx, rect->dy, rect->width, rect->height);
-	   CRITEND
-	   SiS310Sync();
+#ifdef CONFIG_FB_SIS_315
+      CRITBEGIN
+      SiS310SetupForSolidFill(col, myrops[rect->rop], 0);
+      SiS310SubsequentSolidFillRect(rect->dx, rect->dy, rect->width, rect->height);
+      CRITEND
+      SiS310Sync();
+#endif
    }
 
 }
@@ -388,7 +419,7 @@
    CRITFLAGS
 
    TWDEBUG("Inside sis_copyarea");
-   if(!sisfb_accel) {
+   if(!ivideo.accel) {
    	cfb_copyarea(info, area);
 	return;
    }
@@ -402,23 +433,27 @@
    else                    ydir = 1;
 
    if(sisvga_engine == SIS_300_VGA) {
+#ifdef CONFIG_FB_SIS_300
       CRITBEGIN
       SiS300SetupForScreenToScreenCopy(xdir, ydir, 3, 0, -1);
       SiS300SubsequentScreenToScreenCopy(area->sx, area->sy, area->dx, area->dy, area->width, area->height);
       CRITEND
       SiS300Sync();
+#endif
    } else {
+#ifdef CONFIG_FB_SIS_315
       CRITBEGIN
       SiS310SetupForScreenToScreenCopy(xdir, ydir, 3, 0, -1);
       SiS310SubsequentScreenToScreenCopy(area->sx, area->sy, area->dx, area->dy, area->width, area->height);
       CRITEND
       SiS310Sync();
+#endif
    }
 }
 
 #endif
 
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,5,33)  /* ------ KERNEL <2.5.34 ------ */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)  /* -------------- 2.4 --------------- */
 
 void fbcon_sis_bmove(struct display *p, int srcy, int srcx,
 			    int dsty, int dstx, int height, int width)
@@ -460,25 +495,28 @@
 	else            ydir = 1;
 
 	if(sisvga_engine == SIS_300_VGA) {
+#ifdef CONFIG_FB_SIS_300
 	   CRITBEGIN
 	   SiS300SetupForScreenToScreenCopy(xdir, ydir, 3, 0, -1);
 	   SiS300SubsequentScreenToScreenCopy(srcx, srcy, dstx, dsty, width, height);
 	   CRITEND
 	   SiS300Sync();
+#endif
 	} else {
+#ifdef CONFIG_FB_SIS_315
 	   CRITBEGIN
 	   SiS310SetupForScreenToScreenCopy(xdir, ydir, 3, 0, -1);
 	   SiS310SubsequentScreenToScreenCopy(srcx, srcy, dstx, dsty, width, height);
 	   CRITEND
 	   SiS310Sync();
-#if 0	   
+#if 0
 	   printk(KERN_INFO "sis_bmove sx %d sy %d dx %d dy %d w %d h %d\n",
 		srcx, srcy, dstx, dsty, width, height);
-#endif		
+#endif
+#endif
 	}
 }
 
-
 static void fbcon_sis_clear(struct vc_data *conp, struct display *p,
 			int srcy, int srcx, int height, int width, int color)
 {
@@ -490,17 +528,21 @@
 	height *= fontheight(p);
 
 	if(sisvga_engine == SIS_300_VGA) {
+#ifdef CONFIG_FB_SIS_300
 	   CRITBEGIN
 	   SiS300SetupForSolidFill(color, 3, 0);
 	   SiS300SubsequentSolidFillRect(srcx, srcy, width, height);
 	   CRITEND
 	   SiS300Sync();
+#endif
 	} else {
+#ifdef CONFIG_FB_SIS_315
 	   CRITBEGIN
 	   SiS310SetupForSolidFill(color, 3, 0);
 	   SiS310SubsequentSolidFillRect(srcx, srcy, width, height);
 	   CRITEND
 	   SiS310Sync();
+#endif
 	}
 }
 
@@ -575,54 +617,58 @@
 	srcy *= fontheight(p);
 
 	if(sisvga_engine == SIS_300_VGA) {
+#ifdef CONFIG_FB_SIS_300
 	   CRITBEGIN
 	   SiS300SetupForSolidFill(0, 0x0a, 0);
 	   SiS300SubsequentSolidFillRect(srcx, srcy, fontwidth(p), fontheight(p));
 	   CRITEND
 	   SiS300Sync();
+#endif
 	} else {
+#ifdef CONFIG_FB_SIS_315
 	   CRITBEGIN
 	   SiS310SetupForSolidFill(0, 0x0a, 0);
 	   SiS310SubsequentSolidFillRect(srcx, srcy, fontwidth(p), fontheight(p));
 	   CRITEND
 	   SiS310Sync();
+#endif
 	}
 }
 
 #ifdef FBCON_HAS_CFB8
 struct display_switch fbcon_sis8 = {
-	setup:			fbcon_cfb8_setup,
-	bmove:			fbcon_sis_bmove,
-	clear:			fbcon_sis_clear8,
-	putc:			fbcon_cfb8_putc,
-	putcs:			fbcon_cfb8_putcs,
-	revc:			fbcon_cfb8_revc,
-	clear_margins:		fbcon_cfb8_clear_margins,
-	fontwidthmask:		FONTWIDTH(4)|FONTWIDTH(8)|FONTWIDTH(12)|FONTWIDTH(16)
+	.setup			= fbcon_cfb8_setup,
+	.bmove			= fbcon_sis_bmove,
+	.clear			= fbcon_sis_clear8,
+	.putc			= fbcon_cfb8_putc,
+	.putcs			= fbcon_cfb8_putcs,
+	.revc			= fbcon_cfb8_revc,
+	.clear_margins		= fbcon_cfb8_clear_margins,
+	.fontwidthmask		= FONTWIDTH(4)|FONTWIDTH(8)|FONTWIDTH(12)|FONTWIDTH(16)
 };
 #endif
 #ifdef FBCON_HAS_CFB16
 struct display_switch fbcon_sis16 = {
-	setup:			fbcon_cfb16_setup,
-	bmove:			fbcon_sis_bmove,
-	clear:			fbcon_sis_clear16,
-	putc:			fbcon_cfb16_putc,
-	putcs:			fbcon_cfb16_putcs,
-	revc:			fbcon_sis_revc,
-	clear_margins:		fbcon_cfb16_clear_margins,
-	fontwidthmask:		FONTWIDTH(4)|FONTWIDTH(8)|FONTWIDTH(12)|FONTWIDTH(16)
+	.setup			= fbcon_cfb16_setup,
+	.bmove			= fbcon_sis_bmove,
+	.clear			= fbcon_sis_clear16,
+	.putc			= fbcon_cfb16_putc,
+	.putcs			= fbcon_cfb16_putcs,
+	.revc			= fbcon_sis_revc,
+	.clear_margins		= fbcon_cfb16_clear_margins,
+	.fontwidthmask		= FONTWIDTH(4)|FONTWIDTH(8)|FONTWIDTH(12)|FONTWIDTH(16)
 };
 #endif
 #ifdef FBCON_HAS_CFB32
 struct display_switch fbcon_sis32 = {
-	setup:			fbcon_cfb32_setup,
-	bmove:			fbcon_sis_bmove,
-	clear:			fbcon_sis_clear32,
-	putc:			fbcon_cfb32_putc,
-	putcs:			fbcon_cfb32_putcs,
-	revc:			fbcon_sis_revc,
-	clear_margins:		fbcon_cfb32_clear_margins,
-	fontwidthmask:		FONTWIDTH(4)|FONTWIDTH(8)|FONTWIDTH(12)|FONTWIDTH(16)
+	.setup			= fbcon_cfb32_setup,
+	.bmove			= fbcon_sis_bmove,
+	.clear			= fbcon_sis_clear32,
+	.putc			= fbcon_cfb32_putc,
+	.putcs			= fbcon_cfb32_putcs,
+	.revc			= fbcon_sis_revc,
+	.clear_margins		= fbcon_cfb32_clear_margins,
+	.fontwidthmask		= FONTWIDTH(4)|FONTWIDTH(8)|FONTWIDTH(12)|FONTWIDTH(16)
 };
 #endif
 
--- diff/drivers/video/sis/sis_accel.h	2003-10-09 09:47:17.000000000 +0100
+++ source/drivers/video/sis/sis_accel.h	2004-02-09 10:39:55.000000000 +0000
@@ -4,11 +4,24 @@
  *
  * 2D acceleration part
  *
+ * 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 named License,
+ * or 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
+ *
  * Based on the X driver's sis300_accel.h which is
- *     Copyright Xavier Ducoin <x.ducoin@lectra.com>
- *     Copyright 2002 by Thomas Winischhofer, Vienna, Austria
+ *     Copyright (C) 2001-2004 by Thomas Winischhofer, Vienna, Austria
  * and sis310_accel.h which is
- *     Copyright 2002 by Thomas Winischhofer, Vienna, Austria
+ *     Copyright (C) 2001-2004 by Thomas Winischhofer, Vienna, Austria
  *
  * Author:   Thomas Winischhofer <thomas@winischhofer.net>:
  *			(see http://www.winischhofer.net/
@@ -47,7 +60,7 @@
 #define TRAPAZOID_FILL          0x00000005  /* Fill trapezoid */
 #define TRANSPARENT_BITBLT      0x00000006  /* Transparent Blit */
 
-/* Additional engine commands for 310/325 */
+/* Additional engine commands for 315 */
 #define ALPHA_BLEND		0x00000007  /* Alpha blend ? */
 #define A3D_FUNCTION		0x00000008  /* 3D command ? */
 #define	CLEAR_Z_BUFFER		0x00000009  /* ? */
@@ -90,11 +103,11 @@
 #define NO_RESET_COUNTER        0x00400000
 #define NO_LAST_PIXEL           0x00200000
 
-/* Subfunctions for Color/Enhanced Color Expansion (310/325 only) */
+/* Subfunctions for Color/Enhanced Color Expansion (315 only) */
 #define COLOR_TO_MONO		0x00100000
 #define AA_TEXT			0x00200000
 
-/* Some general registers for 310/325 series */
+/* Some general registers for 315 series */
 #define SRC_ADDR		0x8200
 #define SRC_PITCH		0x8204
 #define AGP_BASE		0x8206 /* color-depth dependent value */
@@ -326,7 +339,7 @@
 
 
 
-/* ----------- SiS 310/325 series --------------- */
+/* -------------- SiS 315 series --------------- */
 
 /* Q_STATUS:
    bit 31 = 1: All engines idle and all queues empty
@@ -342,16 +355,27 @@
    bits 7:0:   2D counter 1
 
    Where is the command queue length (current amount of commands the queue
-   can accept) on the 310/325 series? (The current implementation is taken
-   from 300 series and certainly wrong...)
+   can accept) on the 315 series?
 */
 
 /* TW: FIXME: CmdQueLen is... where....? */
+/* We assume a length of 4 bytes per command; since 512K of
+ * of RAM are allocated, the number of commands is easily
+ * calculated (assuming that there is no 3D support yet)
+ * We calculate it very cautiously (128K only) and let the
+ * rest to the (never?)-to-come (?) 3D engine. (The 3D engine
+ * can use a similar technique, using the remaining 384K,
+ * hence a queue overflow is avoided)
+ * UPDATE: This technique causes a terrible system latency
+ * on integrated chipsets. Disable the queue handling for
+ * now.
+ */
 #define SiS310Idle \
   { \
   while( (MMIO_IN16(ivideo.mmio_vbase, Q_STATUS+2) & 0x8000) != 0x8000){}; \
   while( (MMIO_IN16(ivideo.mmio_vbase, Q_STATUS+2) & 0x8000) != 0x8000){}; \
-  CmdQueLen=MMIO_IN16(ivideo.mmio_vbase, Q_STATUS); \
+  CmdQueLen = 0; \
+  /*CmdQueLen = ((128 * 1024) / 4) - 64; */ \
   }
 
 #define SiS310SetupSRCBase(base) \
--- diff/drivers/video/sis/sis_main.c	2003-10-09 09:47:17.000000000 +0100
+++ source/drivers/video/sis/sis_main.c	2004-02-09 10:39:55.000000000 +0000
@@ -1,25 +1,34 @@
 /*
- * SiS 300/630/730/540/315/550/650/740 frame buffer device
- * for Linux kernels 2.4.x and 2.5.x
+ * SiS 300/630/730/540/315/550/650/651/M650/661FX/M661FX/740/741/M741/330/760
+ * frame buffer driver for Linux kernels 2.4.x and 2.5.x
  *
- * Partly based on the VBE 2.0 compliant graphic boards framebuffer driver,
+ * Copyright (C) 2001-2004 Thomas Winischhofer, Vienna, Austria.
+ *
+ * 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 named License,
+ * or 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
+ *
+ * Author:   	Thomas Winischhofer <thomas@winischhofer.net>
+ *
+ * Author of code base:
+ *		SiS (www.sis.com.tw)
+ *	 	Copyright (C) 1999 Silicon Integrated Systems, Inc.
+ *
+ * See http://www.winischhofer.net/ for more information and updates
+ *
+ * Originally based on the VBE 2.0 compliant graphic boards framebuffer driver,
  * which is (c) 1998 Gerd Knorr <kraxel@goldbach.in-berlin.de>
  *
- * Authors:   	SiS (www.sis.com.tw)
- *		(Various others)
- *		Thomas Winischhofer <thomas@winischhofer.net>:
- *			- SiS Xabre (330) support
- *			- many fixes and enhancements for all chipset series,
- *			- extended bridge handling, TV output for Chrontel 7005
- *                      - 650/LVDS support (for LCD panels up to 1600x1200)
- *                      - 650/740/Chrontel 7019 support
- *                      - 30xB/30xLV LCD, TV and VGA2 support
- *			- memory queue handling enhancements,
- *                      - 2D acceleration and y-panning,
- *                      - portation to 2.5 API
- *			- etc.
- *			(see http://www.winischhofer.net/
- *			for more information and updates)
  */
 
 #include <linux/config.h>
@@ -38,11 +47,15 @@
 #include <linux/ioport.h>
 #include <linux/init.h>
 #include <linux/pci.h>
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+#include <linux/vmalloc.h>
+#endif
 #include <linux/vt_kern.h>
 #include <linux/capability.h>
 #include <linux/fs.h>
 #include <linux/agp_backend.h>
 #include <linux/types.h>
+#include <asm/uaccess.h>
 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
 #include <linux/spinlock.h>
@@ -73,9 +86,13 @@
 #include "sis_main.h"
 #include "sis.h"
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
+#error "This version of sisfb requires at least 2.6.0"
+#else
 #if 0
-#ifdef LINUXBIOS
-#include "bios.h"
+#define NEWFBDEV		/* Define this as soon as new fvdev code has been merged */
+#endif
 #endif
 #endif
 
@@ -121,7 +138,7 @@
 /* ------------ Interface for init & mode switching code ------------- */
 
 BOOLEAN
-sisfb_query_VGA_config_space(PSIS_HW_DEVICE_INFO psishw_ext,
+sisfb_query_VGA_config_space(PSIS_HW_INFO psishw_ext,
 	unsigned long offset, unsigned long set, unsigned long *value)
 {
 	static struct pci_dev *pdev = NULL;
@@ -134,9 +151,19 @@
 
 	if (!init) {
 		init = TRUE;
-		pdev = pci_find_device(PCI_VENDOR_ID_SI, ivideo.chip_id, pdev);
-		if (pdev)
-			valid_pdev = TRUE;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,74)
+		pci_for_each_dev(pdev) {
+#else
+		while((pdev = pci_find_device(PCI_VENDOR_ID_SI, PCI_ANY_ID, pdev))) {
+#endif
+			DPRINTK("sisfb: Current: 0x%x, target: 0x%x\n",
+			         pdev->device, ivideo.chip_id);
+			if ((pdev->vendor == PCI_VENDOR_ID_SI)
+			           && (pdev->device == ivideo.chip_id)) {
+				valid_pdev = TRUE;
+				break;
+			}
+		}
 	}
 
 	if (!valid_pdev) {
@@ -153,7 +180,7 @@
 	return TRUE;
 }
 
-BOOLEAN sisfb_query_north_bridge_space(PSIS_HW_DEVICE_INFO psishw_ext,
+BOOLEAN sisfb_query_north_bridge_space(PSIS_HW_INFO psishw_ext,
 	unsigned long offset, unsigned long set, unsigned long *value)
 {
 	static struct pci_dev *pdev = NULL;
@@ -163,6 +190,7 @@
 	if (!init) {
 		init = TRUE;
 		switch (ivideo.chip) {
+#ifdef CONFIG_FB_SIS_300
 		case SIS_540:
 			nbridge_id = PCI_DEVICE_ID_SI_540;
 			break;
@@ -172,23 +200,48 @@
 		case SIS_730:
 			nbridge_id = PCI_DEVICE_ID_SI_730;
 			break;
+#endif
+#ifdef CONFIG_FB_SIS_315
 		case SIS_550:
 			nbridge_id = PCI_DEVICE_ID_SI_550;
 			break;
 		case SIS_650:
 			nbridge_id = PCI_DEVICE_ID_SI_650;
 			break;
-		case SIS_740:			
+		case SIS_740:
 			nbridge_id = PCI_DEVICE_ID_SI_740;
 			break;
+		case SIS_661:
+			nbridge_id = PCI_DEVICE_ID_SI_660;
+			break;
+		case SIS_741:
+			nbridge_id = PCI_DEVICE_ID_SI_741;
+			break;
+		case SIS_660:
+			nbridge_id = PCI_DEVICE_ID_SI_660;
+			break;
+		case SIS_760:
+			nbridge_id = PCI_DEVICE_ID_SI_760;
+			break;
+#endif
 		default:
 			nbridge_id = 0;
 			break;
 		}
 
-		pdev = pci_find_device(PCI_VENDOR_ID_SI, nbridge_id, pdev);
-		if (pdev)
-			valid_pdev = TRUE;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,74)
+		pci_for_each_dev(pdev) {
+#else
+		while((pdev = pci_find_device(PCI_VENDOR_ID_SI, PCI_ANY_ID, pdev))) {
+#endif
+			DPRINTK("Current: 0x%x, target: 0x%x\n",
+					pdev->device, ivideo.chip_id);
+			if ((pdev->vendor == PCI_VENDOR_ID_SI)
+					&& (pdev->device == nbridge_id)) {
+				valid_pdev = TRUE;
+				break;
+			}
+		}
 	}
 
 	if (!valid_pdev) {
@@ -207,241 +260,373 @@
 
 /* ------------------ Internal helper routines ----------------- */
 
-static void sisfb_search_mode(const char *name)
+static BOOLEAN sisfb_verify_rate(struct sisfb_monitor *monitor, int mode_idx, int rate_idx, int rate)
 {
-	int i = 0, j = 0;
+	int htotal, vtotal;
+	unsigned int dclock, hsync;
 
-	if(name == NULL) {
-	   printk(KERN_ERR "sisfb: Internal error, using default mode.\n");
-	   sisfb_mode_idx = DEFAULT_MODE;
-	   return;
+	if(!monitor->datavalid) return TRUE;
+
+	if(mode_idx < 0) return FALSE;
+
+	if(rate < (monitor->vmin - 1)) return FALSE;
+	if(rate > (monitor->vmax + 1)) return FALSE;
+
+	if(sisfb_gettotalfrommode(&SiS_Pr, &sishw_ext, sisbios_mode[mode_idx].mode_no,
+	                          &htotal, &vtotal, rate_idx)) {
+		dclock = (htotal * vtotal * rate) / 1000;
+		if(dclock > (monitor->dclockmax + 1000)) return FALSE;
+		hsync = dclock / htotal;
+		if(hsync < (monitor->hmin - 1)) return FALSE;
+		if(hsync > (monitor->hmax + 1)) return FALSE;
+        } else {
+	  	return FALSE;
 	}
-		
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)		
-        if (!strcmp(name, sisbios_mode[MODE_INDEX_NONE].name)) {
-	   printk(KERN_ERR "sisfb: Mode 'none' not supported anymore. Using default.\n");
-	   sisfb_mode_idx = DEFAULT_MODE;
-	   return;
+	return TRUE;
+};
+
+static BOOLEAN sisfb_interpret_edid(struct sisfb_monitor *monitor, u8 *buffer)
+{
+	int i, j, xres, yres, refresh, index;
+	u32 emodes;
+
+	if(buffer[0] != 0x00 || buffer[1] != 0xff ||
+	   buffer[2] != 0xff || buffer[3] != 0xff ||
+	   buffer[4] != 0xff || buffer[5] != 0xff ||
+	   buffer[6] != 0xff || buffer[7] != 0x00) {
+	   printk(KERN_DEBUG "sisfb: Bad EDID header\n");
+	   return FALSE;
 	}
-#endif		
 
-	while(sisbios_mode[i].mode_no != 0) {
-		if (!strcmp(name, sisbios_mode[i].name)) {
-			sisfb_mode_idx = i;
-			j = 1;
-			break;
-		}
-		i++;
+	if(buffer[0x12] != 0x01) {
+	   printk(KERN_INFO "sisfb: EDID version %d not supported\n",
+	   	buffer[0x12]);
+	   return FALSE;
+	}
+
+	monitor->feature = buffer[0x18];
+
+	if(!buffer[0x14] & 0x80) {
+	   if(!(buffer[0x14] & 0x08)) {
+	      printk(KERN_INFO "sisfb: WARNING: Monitor does not support separate syncs\n");
+	   }
+	}
+
+	if(buffer[0x13] >= 0x01) {
+	   /* EDID V1 rev 1 and 2: Search for monitor descriptor
+	    * to extract ranges
+	    */
+	    j = 0x36;
+	    for(i=0; i<4; i++) {
+	       if(buffer[j]     == 0x00 && buffer[j + 1] == 0x00 &&
+	          buffer[j + 2] == 0x00 && buffer[j + 3] == 0xfd &&
+		  buffer[j + 4] == 0x00) {
+		  monitor->hmin = buffer[j + 7];
+		  monitor->hmax = buffer[j + 8];
+		  monitor->vmin = buffer[j + 5];
+		  monitor->vmax = buffer[j + 6];
+		  monitor->dclockmax = buffer[j + 9] * 10 * 1000;
+		  monitor->datavalid = TRUE;
+		  break;
+	       }
+	       j += 18;
+	    }
+	}
+
+	if(!monitor->datavalid) {
+	   /* Otherwise: Get a range from the list of supported
+	    * Estabished Timings. This is not entirely accurate,
+	    * because fixed frequency monitors are not supported
+	    * that way.
+	    */
+	   monitor->hmin = 65535; monitor->hmax = 0;
+	   monitor->vmin = 65535; monitor->vmax = 0;
+	   monitor->dclockmax = 0;
+	   emodes = buffer[0x23] | (buffer[0x24] << 8) | (buffer[0x25] << 16);
+	   for(i = 0; i < 13; i++) {
+	      if(emodes & sisfb_ddcsmodes[i].mask) {
+	         if(monitor->hmin > sisfb_ddcsmodes[i].h) monitor->hmin = sisfb_ddcsmodes[i].h;
+		 if(monitor->hmax < sisfb_ddcsmodes[i].h) monitor->hmax = sisfb_ddcsmodes[i].h + 1;
+		 if(monitor->vmin > sisfb_ddcsmodes[i].v) monitor->vmin = sisfb_ddcsmodes[i].v;
+		 if(monitor->vmax < sisfb_ddcsmodes[i].v) monitor->vmax = sisfb_ddcsmodes[i].v;
+		 if(monitor->dclockmax < sisfb_ddcsmodes[i].d) monitor->dclockmax = sisfb_ddcsmodes[i].d;
+	      }
+	   }
+	   index = 0x26;
+	   for(i = 0; i < 8; i++) {
+	      xres = (buffer[index] + 31) * 8;
+	      switch(buffer[index + 1] & 0xc0) {
+	         case 0xc0: yres = (xres * 9) / 16; break;
+	         case 0x80: yres = (xres * 4) /  5; break;
+	         case 0x40: yres = (xres * 3) /  4; break;
+	         default:   yres = xres;	    break;
+	      }
+	      refresh = (buffer[index + 1] & 0x3f) + 60;
+	      if((xres >= 640) && (yres >= 480)) {
+                 for(j = 0; j < 8; j++) {
+	            if((xres == sisfb_ddcfmodes[j].x) &&
+	               (yres == sisfb_ddcfmodes[j].y) &&
+		       (refresh == sisfb_ddcfmodes[j].v)) {
+		      if(monitor->hmin > sisfb_ddcfmodes[j].h) monitor->hmin = sisfb_ddcfmodes[j].h;
+		      if(monitor->hmax < sisfb_ddcfmodes[j].h) monitor->hmax = sisfb_ddcfmodes[j].h + 1;
+		      if(monitor->vmin > sisfb_ddcsmodes[j].v) monitor->vmin = sisfb_ddcsmodes[j].v;
+		      if(monitor->vmax < sisfb_ddcsmodes[j].v) monitor->vmax = sisfb_ddcsmodes[j].v;
+		      if(monitor->dclockmax < sisfb_ddcsmodes[j].d) monitor->dclockmax = sisfb_ddcsmodes[i].d;
+	            }
+	         }
+	      }
+	      index += 2;
+           }
+	   if((monitor->hmin <= monitor->hmax) && (monitor->vmin <= monitor->vmax)) {
+	      monitor->datavalid = TRUE;
+	   }
+	}
+
+ 	return(monitor->datavalid);
+}
+
+static void sisfb_handle_ddc(struct sisfb_monitor *monitor, int crtno)
+{
+	USHORT  temp, i, realcrtno = crtno;
+   	u8      buffer[256];
+
+	monitor->datavalid = FALSE;
+
+	if(crtno) {
+       	   if(ivideo.vbflags & CRT2_LCD)      realcrtno = 1;
+      	   else if(ivideo.vbflags & CRT2_VGA) realcrtno = 2;
+      	   else return;
+   	}
+
+	if((sisfb_crt1off) && (!crtno)) return;
+
+    	temp = SiS_HandleDDC(&SiS_Pr, ivideo.vbflags, sisvga_engine, realcrtno, 0, &buffer[0]);
+   	if((!temp) || (temp == 0xffff)) {
+      	   printk(KERN_INFO "sisfb: CRT%d DDC probing failed\n", crtno + 1);
+	   return;
+   	} else {
+      	   printk(KERN_INFO "sisfb: CRT%d DDC supported\n", crtno + 1);
+      	   printk(KERN_INFO "sisfb: CRT%d DDC level: %s%s%s%s\n",
+	   	crtno + 1,
+	   	(temp & 0x1a) ? "" : "[none of the supported]",
+	   	(temp & 0x02) ? "2 " : "",
+	   	(temp & 0x08) ? "D&P" : "",
+           	(temp & 0x10) ? "FPDI-2" : "");
+      	   if(temp & 0x02) {
+	      i = 3;  /* Number of retrys */
+	      do {
+	    	 temp = SiS_HandleDDC(&SiS_Pr, ivideo.vbflags, sisvga_engine,
+				     realcrtno, 1, &buffer[0]);
+	      } while((temp) && i--);
+              if(!temp) {
+	    	 if(sisfb_interpret_edid(monitor, &buffer[0])) {
+		    printk(KERN_INFO "sisfb: Monitor range H %d-%dKHz, V %d-%dHz, Max. dotclock %dMHz\n",
+		    	monitor->hmin, monitor->hmax, monitor->vmin, monitor->vmax,
+			monitor->dclockmax / 1000);
+		 } else {
+	       	    printk(KERN_INFO "sisfb: CRT%d DDC EDID corrupt\n", crtno + 1);
+	    	 }
+	      } else {
+            	 printk(KERN_INFO "sisfb: CRT%d DDC reading failed\n", crtno + 1);
+	      }
+	   } else {
+	      printk(KERN_INFO "sisfb: VESA D&P and FPDI-2 not supported yet\n");
+	   }
 	}
-	if(!j) printk(KERN_INFO "sisfb: Invalid mode '%s'\n", name);
 }
 
-static void sisfb_search_vesamode(unsigned int vesamode)
+static void sisfb_search_vesamode(unsigned int vesamode, BOOLEAN quiet)
 {
 	int i = 0, j = 0;
 
 	if(vesamode == 0) {
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)	
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
 		sisfb_mode_idx = MODE_INDEX_NONE;
 #else
-		printk(KERN_ERR "sisfb: Mode 'none' not supported anymore. Using default.\n");
+		if(!quiet)
+		   printk(KERN_ERR "sisfb: Mode 'none' not supported anymore. Using default.\n");
 		sisfb_mode_idx = DEFAULT_MODE;
-#endif		
+#endif
 		return;
 	}
 
 	vesamode &= 0x1dff;  /* Clean VESA mode number from other flags */
 
+	while(sisbios_mode[i++].mode_no != 0) {
+		if( (sisbios_mode[i-1].vesa_mode_no_1 == vesamode) ||
+		    (sisbios_mode[i-1].vesa_mode_no_2 == vesamode) ) {
+		    if(sisfb_fstn) {
+		       if(sisbios_mode[i-1].mode_no == 0x50 ||
+		          sisbios_mode[i-1].mode_no == 0x56 ||
+		          sisbios_mode[i-1].mode_no == 0x53) continue;
+	            } else {
+		       if(sisbios_mode[i-1].mode_no == 0x5a ||
+		          sisbios_mode[i-1].mode_no == 0x5b) continue;
+		    }
+		    sisfb_mode_idx = i - 1;
+		    j = 1;
+		    break;
+		}
+	}
+	if((!j) && !quiet) printk(KERN_ERR "sisfb: Invalid VESA mode 0x%x'\n", vesamode);
+}
+
+static void sisfb_search_mode(char *name, BOOLEAN quiet)
+{
+	int i = 0;
+	unsigned int j = 0, xres = 0, yres = 0, depth = 0, rate = 0;
+	char strbuf[16], strbuf1[20];
+	char *nameptr = name;
+
+	if(name == NULL) {
+	   if(!quiet)
+	      printk(KERN_ERR "sisfb: Internal error, using default mode.\n");
+	   sisfb_mode_idx = DEFAULT_MODE;
+	   return;
+	}
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
+        if (!strnicmp(name, sisbios_mode[MODE_INDEX_NONE].name, strlen(name))) {
+	   if(!quiet)
+	      printk(KERN_ERR "sisfb: Mode 'none' not supported anymore. Using default.\n");
+	   sisfb_mode_idx = DEFAULT_MODE;
+	   return;
+	}
+#endif
+	if(strlen(name) <= 19) {
+	   strcpy(strbuf1, name);
+	   for(i=0; i<strlen(strbuf1); i++) {
+	      if(strbuf1[i] < '0' || strbuf1[i] > '9') strbuf1[i] = ' ';
+	   }
+
+	   /* This does some fuzzy mode naming detection */
+	   if(sscanf(strbuf1, "%u %u %u %u", &xres, &yres, &depth, &rate) == 4) {
+	      if((rate <= 32) || (depth > 32)) {
+	         j = rate; rate = depth; depth = j;
+	      }
+	      sprintf(strbuf, "%ux%ux%u", xres, yres, depth);
+	      nameptr = strbuf;
+	      ivideo.refresh_rate = sisfb_parm_rate = rate;
+	   } else if(sscanf(strbuf1, "%u %u %u", &xres, &yres, &depth) == 3) {
+	      sprintf(strbuf, "%ux%ux%u", xres, yres, depth);
+	      nameptr = strbuf;
+	   } else {
+	      xres = 0;
+	      if((sscanf(strbuf1, "%u %u", &xres, &yres) == 2) && (xres != 0)) {
+	         sprintf(strbuf, "%ux%ux8", xres, yres);
+	         nameptr = strbuf;
+	      } else {
+	         sisfb_search_vesamode(simple_strtoul(name, NULL, 0), quiet);
+	         return;
+	      }
+	   }
+	}
+
+	i = 0; j = 0;
 	while(sisbios_mode[i].mode_no != 0) {
-		if( (sisbios_mode[i].vesa_mode_no_1 == vesamode) ||
-		    (sisbios_mode[i].vesa_mode_no_2 == vesamode) ) {
-			sisfb_mode_idx = i;
-			j = 1;
-			break;
+		if(!strnicmp(nameptr, sisbios_mode[i++].name, strlen(nameptr))) {
+		   if(sisfb_fstn) {
+		      if(sisbios_mode[i-1].mode_no == 0x50 ||
+		         sisbios_mode[i-1].mode_no == 0x56 ||
+		         sisbios_mode[i-1].mode_no == 0x53) continue;
+	           } else {
+		      if(sisbios_mode[i-1].mode_no == 0x5a ||
+		         sisbios_mode[i-1].mode_no == 0x5b) continue;
+		   }
+		   sisfb_mode_idx = i - 1;
+		   j = 1;
+		   break;
 		}
-		i++;
 	}
-	if(!j) printk(KERN_INFO "sisfb: Invalid VESA mode 0x%x'\n", vesamode);
+	if((!j) && !quiet) printk(KERN_ERR "sisfb: Invalid mode '%s'\n", nameptr);
+
 }
 
-static int sisfb_validate_mode(int myindex)
+static int sisfb_validate_mode(int myindex, unsigned long vbflags)
 {
-   u16 xres, yres;
+   u16 xres, yres, myres;
 
 #ifdef CONFIG_FB_SIS_300
    if(sisvga_engine == SIS_300_VGA) {
-       if(!(sisbios_mode[myindex].chipset & MD_SIS300)) {
-           return(-1);
-       }
+      if(!(sisbios_mode[myindex].chipset & MD_SIS300)) return(-1);
    }
 #endif
 #ifdef CONFIG_FB_SIS_315
    if(sisvga_engine == SIS_315_VGA) {
-       if(!(sisbios_mode[myindex].chipset & MD_SIS315)) {
-	   return(-1);
-       }
+      if(!(sisbios_mode[myindex].chipset & MD_SIS315)) return(-1);
    }
 #endif
 
-   switch (ivideo.disp_state & DISPTYPE_DISP2) {
-     case DISPTYPE_LCD:
+   myres = sisbios_mode[myindex].yres;
+
+   switch (vbflags & VB_DISPTYPE_DISP2) {
+     case CRT2_LCD:
 	switch (sishw_ext.ulCRT2LCDType) {
-	case LCD_640x480:
-		xres =  640; yres =  480;  break;
-	case LCD_800x600:
-		xres =  800; yres =  600;  break;
-        case LCD_1024x600:
-		xres = 1024; yres =  600;  break;		
-	case LCD_1024x768:
-	 	xres = 1024; yres =  768;  break;
-	case LCD_1152x768:
-		xres = 1152; yres =  768;  break;		
-	case LCD_1280x960:
-	        xres = 1280; yres =  960;  break;		
-	case LCD_1280x768:
-		xres = 1280; yres =  768;  break;
-	case LCD_1280x1024:
-		xres = 1280; yres = 1024;  break;
-	case LCD_1400x1050:
-		xres = 1400; yres = 1050;  break;		
-	case LCD_1600x1200:
-		xres = 1600; yres = 1200;  break;
-	case LCD_320x480:				/* TW: FSTN */
-		xres =  320; yres =  480;  break;
-	default:
-	        xres =    0; yres =    0;  break;
+	case LCD_640x480:  xres =  640; yres =  480;  break;
+	case LCD_800x600:  xres =  800; yres =  600;  break;
+        case LCD_1024x600: xres = 1024; yres =  600;  break;
+	case LCD_1024x768: xres = 1024; yres =  768;  break;
+	case LCD_1152x768: xres = 1152; yres =  768;  break;
+	case LCD_1280x960: xres = 1280; yres =  960;  break;
+	case LCD_1280x768: xres = 1280; yres =  768;  break;
+	case LCD_1280x1024:xres = 1280; yres = 1024;  break;
+	case LCD_1400x1050:xres = 1400; yres = 1050;  break;
+	case LCD_1600x1200:xres = 1600; yres = 1200;  break;
+	case LCD_320x480:  xres =  320; yres =  480;  break; /* FSTN (old) */
+	case LCD_640x480_2:
+	case LCD_640x480_3:xres =  640; yres =  480;  break; /* FSTN (new) */
+	default:           xres =    0; yres =    0;  break;
 	}
-	if(sisbios_mode[myindex].xres > xres) {
-	        return(-1);
-	}
-        if(sisbios_mode[myindex].yres > yres) {
-	        return(-1);
+
+	if(SiS_Pr.SiS_CustomT == CUT_BARCO1366) {
+	   xres = 1360; yres = 1024;
 	}
-	if((sishw_ext.usExternalChip == 0x01) ||   /* LVDS */
-           (sishw_ext.usExternalChip == 0x05) ||   /* LVDS+Chrontel */
-	   (sishw_ext.Is301BDH)) {		   /* 301B-DH */
-	   switch (sisbios_mode[myindex].xres) {
-	   	case 512:
-	       		if(sisbios_mode[myindex].yres != 512) return -1;
-			if(sishw_ext.ulCRT2LCDType == LCD_1024x600) return -1;
-	       		break;
-	   	case 640:
-		       	if((sisbios_mode[myindex].yres != 400) &&
-	           	   (sisbios_mode[myindex].yres != 480))
-		          	return -1;
-	       		break;
-	   	case 800:
-		       	if(sisbios_mode[myindex].yres != 600) return -1;
-	       		break;
-	   	case 1024:
-		       	if((sisbios_mode[myindex].yres != 600) &&
-	           	   (sisbios_mode[myindex].yres != 768))
-		          	return -1;
-			if((sisbios_mode[myindex].yres == 600) &&
-			   (sishw_ext.ulCRT2LCDType != LCD_1024x600))
-			   	return -1;
-			break;
-		case 1152:
-			if((sisbios_mode[myindex].yres) != 768) return -1;
-			if(sishw_ext.ulCRT2LCDType != LCD_1152x768) return -1;
-			break;
-	   	case 1280:
-		   	if((sisbios_mode[myindex].yres != 768) &&
-	           	   (sisbios_mode[myindex].yres != 1024))
-		          	return -1;
-			if((sisbios_mode[myindex].yres == 768) &&
-			   (sishw_ext.ulCRT2LCDType != LCD_1280x768))
-			   	return -1;				
-			break;
-	   	case 1400:
-		   	if(sisbios_mode[myindex].yres != 1050) return -1;
-			break;
-	   	case 1600:
-		   	if(sisbios_mode[myindex].yres != 1200) return -1;
-			break;
-	   	default:
-		        return -1;		
-	   }
+
+	if(SiS_Pr.SiS_CustomT == CUT_PANEL848) {
+	   xres = 848;  yres =  480;
 	} else {
-	   switch (sisbios_mode[myindex].xres) {
-	   	case 512:
-	       		if(sisbios_mode[myindex].yres != 512) return -1;
-	       		break;
-	   	case 640:
-		       	if((sisbios_mode[myindex].yres != 400) &&
-	           	   (sisbios_mode[myindex].yres != 480))
-		          	return -1;
-	       		break;
-	   	case 800:
-		       	if(sisbios_mode[myindex].yres != 600) return -1;
-	       		break;
-	   	case 1024:
-		       	if(sisbios_mode[myindex].yres != 768) return -1;
-			break;
-	   	case 1280:
-		   	if((sisbios_mode[myindex].yres != 960) &&
-	           	   (sisbios_mode[myindex].yres != 1024))
-		          	return -1;
-			if(sisbios_mode[myindex].yres == 960) {
-			    if(sishw_ext.ulCRT2LCDType == LCD_1400x1050) 
-			   	return -1;
-			}
-			break;
-	   	case 1400:
-		   	if(sisbios_mode[myindex].yres != 1050) return -1;
-			break;
-	   	case 1600:
-		   	if(sisbios_mode[myindex].yres != 1200) return -1;
-			break;
-	   	default:
-		        return -1;		
+	   if(sisbios_mode[myindex].xres > xres) return(-1);
+           if(myres > yres) return(-1);
+	}
+
+	if(vbflags & (VB_LVDS | VB_30xBDH)) {
+	   if(sisbios_mode[myindex].xres == 320) {
+	      if((myres == 240) || (myres == 480)) {
+		 if(!sisfb_fstn) {
+		    if(sisbios_mode[myindex].mode_no == 0x5a ||
+		       sisbios_mode[myindex].mode_no == 0x5b)
+		       return(-1);
+		 } else {
+		    if(sisbios_mode[myindex].mode_no == 0x50 ||
+		       sisbios_mode[myindex].mode_no == 0x56 ||
+		       sisbios_mode[myindex].mode_no == 0x53)
+		       return(-1);
+		 }
+	      }
 	   }
 	}
+
+	if(SiS_GetModeID_LCD(sisvga_engine, vbflags, sisbios_mode[myindex].xres, sisbios_mode[myindex].yres,
+	                     0, sisfb_fstn, SiS_Pr.SiS_CustomT, xres, yres) < 0x14) {
+	   return(-1);
+	}
 	break;
-     case DISPTYPE_TV:
-	switch (sisbios_mode[myindex].xres) {
-	case 512:
-	case 640:
-	case 800:
-		break;
-	case 720:
-		if (ivideo.TV_type == TVMODE_NTSC) {
-			if (sisbios_mode[myindex].yres != 480) {
-				return(-1);
-			}
-		} else if (ivideo.TV_type == TVMODE_PAL) {
-			if (sisbios_mode[myindex].yres != 576) {
-				return(-1);
-			}
-		}
-		/* TW: LVDS/CHRONTEL does not support 720 */
-		if (ivideo.hasVB == HASVB_LVDS_CHRONTEL ||
-					ivideo.hasVB == HASVB_CHRONTEL) {
-				return(-1);
-		}
-		break;
-	case 1024:
-		if (ivideo.TV_type == TVMODE_NTSC) {
-			if(sisbios_mode[myindex].bpp == 32) {
-			       return(-1);
-			}
-		}
-		/* TW: LVDS/CHRONTEL only supports < 800 (1024 on 650/Ch7019)*/
-		if (ivideo.hasVB == HASVB_LVDS_CHRONTEL ||
-					ivideo.hasVB == HASVB_CHRONTEL) {
-		    if(ivideo.chip < SIS_315H) {
-				return(-1);
-		    }
-		}
-		break;
-	default:
-		return(-1);
+
+     case CRT2_TV:
+	if(SiS_GetModeID_TV(sisvga_engine, vbflags, sisbios_mode[myindex].xres,
+	                    sisbios_mode[myindex].yres, 0) < 0x14) {
+	   return(-1);
+	}
+	break;
+
+     case CRT2_VGA:
+        if(SiS_GetModeID_VGA2(sisvga_engine, vbflags, sisbios_mode[myindex].xres,
+	                    sisbios_mode[myindex].yres, 0) < 0x14) {
+	   return(-1);
 	}
 	break;
-     case DISPTYPE_CRT2:	
-        if(sisbios_mode[myindex].xres > 1280) return -1;
-	break;	
      }
+
      return(myindex);
 }
 
@@ -453,15 +638,20 @@
 		return;
 
 	while(sis_crt2type[i].type_no != -1) {
-		if (!strcmp(name, sis_crt2type[i].name)) {
+		if (!strnicmp(name, sis_crt2type[i].name, strlen(sis_crt2type[i].name))) {
 			sisfb_crt2type = sis_crt2type[i].type_no;
 			sisfb_tvplug = sis_crt2type[i].tvplug_no;
+			sisfb_dstn = (sis_crt2type[i].flags & FL_550_DSTN) ? 1 : 0;
+			sisfb_fstn = (sis_crt2type[i].flags & FL_550_FSTN) ? 1 : 0;
 			break;
 		}
 		i++;
 	}
 	if(sisfb_crt2type < 0)
-		printk(KERN_INFO "sisfb: Invalid CRT2 type: %s\n", name);
+		printk(KERN_ERR "sisfb: Invalid CRT2 type: %s\n", name);
+        if(ivideo.chip != SIS_550) {
+	   sisfb_dstn = sisfb_fstn = 0;
+	}
 }
 
 static void sisfb_search_queuemode(const char *name)
@@ -472,23 +662,23 @@
 		return;
 
 	while (sis_queuemode[i].type_no != -1) {
-		if (!strcmp(name, sis_queuemode[i].name)) {
+		if (!strnicmp(name, sis_queuemode[i].name, strlen(sis_queuemode[i].name))) {
 			sisfb_queuemode = sis_queuemode[i].type_no;
 			break;
 		}
 		i++;
 	}
 	if (sisfb_queuemode < 0)
-		printk(KERN_INFO "sisfb: Invalid queuemode type: %s\n", name);
+		printk(KERN_ERR "sisfb: Invalid queuemode type: %s\n", name);
 }
 
-static u8 sisfb_search_refresh_rate(unsigned int rate)
+static u8 sisfb_search_refresh_rate(unsigned int rate, int mode_idx)
 {
 	u16 xres, yres;
 	int i = 0;
 
-	xres = sisbios_mode[sisfb_mode_idx].xres;
-	yres = sisbios_mode[sisfb_mode_idx].yres;
+	xres = sisbios_mode[mode_idx].xres;
+	yres = sisbios_mode[mode_idx].yres;
 
 	sisfb_rate_idx = 0;
 	while ((sisfb_vrate[i].idx != 0) && (sisfb_vrate[i].xres <= xres)) {
@@ -536,45 +726,101 @@
 		return;
 
 	while (sis_tvtype[i].type_no != -1) {
-		if (!strcmp(name, sis_tvtype[i].name)) {
-			sisfb_tvmode = sis_tvtype[i].type_no;
+		if (!strnicmp(name, sis_tvtype[i].name, strlen(sis_tvtype[i].name))) {
+			ivideo.vbflags |= sis_tvtype[i].type_no;
 			break;
 		}
 		i++;
 	}
 }
 
+static void sisfb_search_specialtiming(const char *name)
+{
+	int i = 0;
+	BOOLEAN found = FALSE;
+
+	if(name == NULL)
+		return;
+
+	if(!strnicmp(name, "none", 4)) {
+	        SiS_Pr.SiS_CustomT = CUT_FORCENONE;
+		printk(KERN_DEBUG "sisfb: Special timing disabled\n");
+	} else {
+	   while(mycustomttable[i].chipID != 0) {
+	      if(!strnicmp(name,mycustomttable[i].optionName, strlen(mycustomttable[i].optionName))) {
+		 SiS_Pr.SiS_CustomT = mycustomttable[i].SpecialID;
+		 found = TRUE;
+		 printk(KERN_INFO "sisfb: Special timing for %s %s forced (\"%s\")\n",
+		 	mycustomttable[i].vendorName, mycustomttable[i].cardName,
+		 	mycustomttable[i].optionName);
+		 break;
+	      }
+	      i++;
+	   }
+	   if(!found) {
+	      printk(KERN_WARNING "sisfb: Invalid SpecialTiming parameter, valid are:");
+	      printk(KERN_WARNING "\t\"none\" (to disable special timings)\n");
+	      i = 0;
+	      while(mycustomttable[i].chipID != 0) {
+		 printk(KERN_WARNING "\t\"%s\" (for %s %s)\n",
+		     mycustomttable[i].optionName,
+		     mycustomttable[i].vendorName,
+		     mycustomttable[i].cardName);
+		 i++;
+	      }
+           }
+ 	}
+}
+
 static BOOLEAN sisfb_bridgeisslave(void)
 {
-   unsigned char usScratchP1_00;
+   unsigned char P1_00;
 
-   if(ivideo.hasVB == HASVB_NONE) return FALSE;
+   if(!(ivideo.vbflags & VB_VIDEOBRIDGE)) return FALSE;
 
-   inSISIDXREG(SISPART1,0x00,usScratchP1_00);
-   if( ((sisvga_engine == SIS_300_VGA) && (usScratchP1_00 & 0xa0) == 0x20) ||
-       ((sisvga_engine == SIS_315_VGA) && (usScratchP1_00 & 0x50) == 0x10) ) {
+   inSISIDXREG(SISPART1,0x00,P1_00);
+   if( ((sisvga_engine == SIS_300_VGA) && (P1_00 & 0xa0) == 0x20) ||
+       ((sisvga_engine == SIS_315_VGA) && (P1_00 & 0x50) == 0x10) ) {
 	   return TRUE;
    } else {
            return FALSE;
    }
 }
 
-static BOOLEAN sisfbcheckvretracecrt1(void)
+static BOOLEAN sisfballowretracecrt1(void)
 {
    unsigned char temp;
 
    inSISIDXREG(SISCR,0x17,temp);
    if(!(temp & 0x80)) return FALSE;
-   
-   if(sisvga_engine == SIS_315_VGA) {
-      inSISIDXREG(SISSR,0x1f,temp);
-      if(temp & 0xc0) return FALSE;
-   }
+
+   inSISIDXREG(SISSR,0x1f,temp);
+   if(temp & 0xc0) return FALSE;
+
+   return TRUE;
+}
+
+static BOOLEAN sisfbcheckvretracecrt1(void)
+{
+
+   if(!sisfballowretracecrt1()) return FALSE;
 
    if(inSISREG(SISINPSTAT) & 0x08) return TRUE;
    else 			   return FALSE;
 }
 
+static void sisfbwaitretracecrt1(void)
+{
+   int watchdog;
+
+   if(!sisfballowretracecrt1()) return;
+
+   watchdog = 65536;
+   while((!(inSISREG(SISINPSTAT) & 0x08)) && --watchdog);
+   watchdog = 65536;
+   while((inSISREG(SISINPSTAT) & 0x08) && --watchdog);
+}
+
 static BOOLEAN sisfbcheckvretracecrt2(void)
 {
    unsigned char temp, reg;
@@ -595,9 +841,9 @@
    else 	   return TRUE;
 }
 
-static BOOLEAN sisfb_CheckVBRetrace(void) 
+static BOOLEAN sisfb_CheckVBRetrace(void)
 {
-   if(ivideo.disp_state & DISPTYPE_DISP2) {
+   if(ivideo.currentvbflags & VB_DISPTYPE_DISP2) {
       if(sisfb_bridgeisslave()) {
          return(sisfbcheckvretracecrt1());
       } else {
@@ -607,60 +853,195 @@
    return(sisfbcheckvretracecrt1());
 }
 
+static int sisfb_myblank(int blank)
+{
+   u8 sr01, sr11, sr1f, cr63=0, p2_0, p1_13;
+   BOOLEAN backlight = TRUE;
+
+   switch(blank) {
+   case 0:	/* on */
+      sr01  = 0x00;
+      sr11  = 0x00;
+      sr1f  = 0x00;
+      cr63  = 0x00;
+      p2_0  = 0x20;
+      p1_13 = 0x00;
+      backlight = TRUE;
+      break;
+   case 1:	/* blank */
+      sr01  = 0x20;
+      sr11  = 0x00;
+      sr1f  = 0x00;
+      cr63  = 0x00;
+      p2_0  = 0x20;
+      p1_13 = 0x00;
+      backlight = TRUE;
+      break;
+   case 2:	/* no vsync */
+      sr01  = 0x20;
+      sr11  = 0x08;
+      sr1f  = 0x80;
+      cr63  = 0x40;
+      p2_0  = 0x40;
+      p1_13 = 0x80;
+      backlight = FALSE;
+      break;
+   case 3:	/* no hsync */
+      sr01  = 0x20;
+      sr11  = 0x08;
+      sr1f  = 0x40;
+      cr63  = 0x40;
+      p2_0  = 0x80;
+      p1_13 = 0x40;
+      backlight = FALSE;
+      break;
+   case 4:	/* off */
+      sr01  = 0x20;
+      sr11  = 0x08;
+      sr1f  = 0xc0;
+      cr63  = 0x40;
+      p2_0  = 0xc0;
+      p1_13 = 0xc0;
+      backlight = FALSE;
+      break;
+   default:
+      return 1;
+   }
+
+   if(ivideo.currentvbflags & VB_DISPTYPE_CRT1) {
+
+      setSISIDXREG(SISSR, 0x01, ~0x20, sr01);
+
+      if( (!sisfb_thismonitor.datavalid) ||
+          ((sisfb_thismonitor.datavalid) &&
+           (sisfb_thismonitor.feature & 0xe0))) {
+
+	 if(sisvga_engine == SIS_315_VGA) {
+	    setSISIDXREG(SISCR, SiS_Pr.SiS_MyCR63, 0xbf, cr63);
+	 }
+
+	 setSISIDXREG(SISSR, 0x1f, 0x3f, sr1f);
+      }
+
+   }
+
+   if(ivideo.currentvbflags & CRT2_LCD) {
+
+      if(ivideo.vbflags & (VB_301LV|VB_302LV|VB_302ELV)) {
+	 if(backlight) {
+	    SiS_SiS30xBLOn(&SiS_Pr, &sishw_ext);
+	 } else {
+	    SiS_SiS30xBLOff(&SiS_Pr, &sishw_ext);
+	 }
+      } else if(sisvga_engine == SIS_315_VGA) {
+	 if(ivideo.vbflags & VB_CHRONTEL) {
+	    if(backlight) {
+	       SiS_Chrontel701xBLOn(&SiS_Pr,&sishw_ext);
+	    } else {
+	       SiS_Chrontel701xBLOff(&SiS_Pr);
+	    }
+	 }
+      }
+
+      if(((sisvga_engine == SIS_300_VGA) &&
+          (ivideo.vbflags & (VB_301|VB_30xBDH|VB_LVDS))) ||
+         ((sisvga_engine == SIS_315_VGA) &&
+          ((ivideo.vbflags & (VB_LVDS | VB_CHRONTEL)) == VB_LVDS))) {
+          setSISIDXREG(SISSR, 0x11, ~0x0c, sr11);
+      }
+
+      if(sisvga_engine == SIS_300_VGA) {
+         if((ivideo.vbflags & (VB_301B|VB_301C|VB_302B)) &&
+            (!(ivideo.vbflags & VB_30xBDH))) {
+	    setSISIDXREG(SISPART1, 0x13, 0x3f, p1_13);
+	 }
+      } else if(sisvga_engine == SIS_315_VGA) {
+         if((ivideo.vbflags & (VB_301B|VB_301C|VB_302B)) &&
+            (!(ivideo.vbflags & VB_30xBDH))) {
+	    setSISIDXREG(SISPART2, 0x00, 0x1f, p2_0);
+	 }
+      }
+
+   } else if(ivideo.currentvbflags & CRT2_VGA) {
+
+      if(ivideo.vbflags & (VB_301B|VB_301C|VB_302B)) {
+         setSISIDXREG(SISPART2, 0x00, 0x1f, p2_0);
+      }
+
+   }
+
+   return(0);
+}
+
 /* ----------- FBDev related routines for all series ----------- */
 
+static void sisfb_set_vparms(void)
+{
+   switch(ivideo.video_bpp) {
+   case 8:
+       	ivideo.DstColor = 0x0000;
+	ivideo.SiS310_AccelDepth = 0x00000000;
+	ivideo.video_cmap_len = 256;
+       	break;
+   case 16:
+       	ivideo.DstColor = 0x8000;
+       	ivideo.SiS310_AccelDepth = 0x00010000;
+	ivideo.video_cmap_len = 16;
+       	break;
+   case 32:
+       	ivideo.DstColor = 0xC000;
+	ivideo.SiS310_AccelDepth = 0x00020000;
+	ivideo.video_cmap_len = 16;
+       	break;
+   default:
+ 	ivideo.video_cmap_len = 16;
+	printk(KERN_ERR "sisfb: Unsupported depth %d", ivideo.video_bpp);
+	ivideo.accel = 0;
+	break;
+   }
+}
+
 static int sisfb_do_set_var(struct fb_var_screeninfo *var, int isactive,
 		      struct fb_info *info)
 {
-	unsigned int htotal =
-		var->left_margin + var->xres + var->right_margin +
-		var->hsync_len;
-	unsigned int vtotal = 0; 
-	double drate = 0, hrate = 0;
+	unsigned int htotal = 0, vtotal = 0;
+	unsigned int drate = 0, hrate = 0;
 	int found_mode = 0;
 	int old_mode;
-	unsigned char reg;
+	u32 pixclock;
 
-	TWDEBUG("Inside do_set_var");
-	
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)	
-	inSISIDXREG(SISCR,0x34,reg);
-	if(reg & 0x80) {
-	   printk(KERN_INFO "sisfb: Cannot change display mode, X server is active\n");
-	   return -EBUSY;
-	}
-#endif	
+	htotal = var->left_margin + var->xres + var->right_margin + var->hsync_len;
+
+	vtotal = var->upper_margin + var->lower_margin + var->vsync_len;
+
+	pixclock = var->pixclock;
 
 	if((var->vmode & FB_VMODE_MASK) == FB_VMODE_NONINTERLACED) {
-		vtotal = var->upper_margin + var->yres + var->lower_margin +
-		         var->vsync_len;
+		vtotal += var->yres;
 		vtotal <<= 1;
 	} else if((var->vmode & FB_VMODE_MASK) == FB_VMODE_DOUBLE) {
-		vtotal = var->upper_margin + var->yres + var->lower_margin +
-		         var->vsync_len;
+		vtotal += var->yres;
 		vtotal <<= 2;
 	} else if((var->vmode & FB_VMODE_MASK) == FB_VMODE_INTERLACED) {
-		vtotal = var->upper_margin + (var->yres/2) + var->lower_margin +
-		         var->vsync_len; 
-	} else 	vtotal = var->upper_margin + var->yres + var->lower_margin +
-		         var->vsync_len;
+		vtotal += var->yres;
+		vtotal <<= 1;
+	} else 	vtotal += var->yres;
 
 	if(!(htotal) || !(vtotal)) {
 		DPRINTK("sisfb: Invalid 'var' information\n");
 		return -EINVAL;
 	}
 
-	if(var->pixclock && htotal && vtotal) {
-	   drate = 1E12 / var->pixclock;
-	   hrate = drate / htotal;
-	   ivideo.refresh_rate = (unsigned int) (hrate / vtotal * 2 + 0.5);
+	if(pixclock && htotal && vtotal) {
+	   drate = 1000000000 / pixclock;
+	   hrate = (drate * 1000) / htotal;
+	   ivideo.refresh_rate = (unsigned int) (hrate * 2 / vtotal);
 	} else ivideo.refresh_rate = 60;
 
-	/* TW: Calculation wrong for 1024x600 - force it to 60Hz */
-	if((var->xres == 1024) && (var->yres == 600)) ivideo.refresh_rate = 60;
-
+#if 0
 	printk(KERN_DEBUG "sisfb: Change mode to %dx%dx%d-%dHz\n",
 		var->xres,var->yres,var->bits_per_pixel,ivideo.refresh_rate);
+#endif
 
 	old_mode = sisfb_mode_idx;
 	sisfb_mode_idx = 0;
@@ -678,7 +1059,7 @@
 	}
 
 	if(found_mode)
-		sisfb_mode_idx = sisfb_validate_mode(sisfb_mode_idx);
+		sisfb_mode_idx = sisfb_validate_mode(sisfb_mode_idx, ivideo.currentvbflags);
 	else
 		sisfb_mode_idx = -1;
 
@@ -689,12 +1070,21 @@
 		return -EINVAL;
 	}
 
-	if(sisfb_search_refresh_rate(ivideo.refresh_rate) == 0) {
+	if(sisfb_search_refresh_rate(ivideo.refresh_rate, sisfb_mode_idx) == 0) {
 		sisfb_rate_idx = sisbios_mode[sisfb_mode_idx].rate_idx;
 		ivideo.refresh_rate = 60;
 	}
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
+	if(sisfb_thismonitor.datavalid) {
+	   if(!sisfb_verify_rate(&sisfb_thismonitor, sisfb_mode_idx,
+	                         sisfb_rate_idx, ivideo.refresh_rate)) {
+	      printk(KERN_INFO "sisfb: WARNING: Refresh rate exceeds monitor specs!\n");
+	   }
+	}
+#endif
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
 	if(((var->activate & FB_ACTIVATE_MASK) == FB_ACTIVATE_NOW) && isactive) {
 #else
 	if(isactive) {
@@ -708,14 +1098,6 @@
 
 		outSISIDXREG(SISSR, IND_SIS_PASSWORD, SIS_PASSWORD);
 
-		sisfb_post_setmode();
-
-		DPRINTK("sisfb: Set new mode: %dx%dx%d-%d \n",
-			sisbios_mode[sisfb_mode_idx].xres,
-			sisbios_mode[sisfb_mode_idx].yres,
-			sisbios_mode[sisfb_mode_idx].bpp,
-			ivideo.refresh_rate);
-
 		ivideo.video_bpp = sisbios_mode[sisfb_mode_idx].bpp;
 		ivideo.video_vwidth = ivideo.video_width = sisbios_mode[sisfb_mode_idx].xres;
 		ivideo.video_vheight = ivideo.video_height = sisbios_mode[sisfb_mode_idx].yres;
@@ -725,53 +1107,38 @@
 		if(sisfb_accel) {
 		   ivideo.accel = (var->accel_flags & FB_ACCELF_TEXT) ? -1 : 0;
 		}
-		switch(ivideo.video_bpp) {
-        	case 8:
-            		ivideo.DstColor = 0x0000;
-	    		ivideo.SiS310_AccelDepth = 0x00000000;
-			ivideo.video_cmap_len = 256;
-            		break;
-        	case 16:
-            		ivideo.DstColor = 0x8000;
-            		ivideo.SiS310_AccelDepth = 0x00010000;
-			ivideo.video_cmap_len = 16;
-            		break;
-        	case 32:
-            		ivideo.DstColor = 0xC000;
-	    		ivideo.SiS310_AccelDepth = 0x00020000;
-			ivideo.video_cmap_len = 16;
-            		break;
-		default:
-			ivideo.video_cmap_len = 16;
-		        printk(KERN_ERR "sisfb: Unsupported depth %d", ivideo.video_bpp);
-			ivideo.accel = 0;
-			break;
-    		}
+
+		sisfb_set_vparms();
+
+		ivideo.current_width = ivideo.video_width;
+		ivideo.current_height = ivideo.video_height;
+		ivideo.current_bpp = ivideo.video_bpp;
+		ivideo.current_htotal = htotal;
+		ivideo.current_vtotal = vtotal;
+		ivideo.current_pixclock = var->pixclock;
+		ivideo.current_refresh_rate = ivideo.refresh_rate;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
+                sisfb_lastrates[sisfb_mode_no] = ivideo.refresh_rate;
+#endif
+
+		sisfb_post_setmode();
 
 	}
-	TWDEBUG("End of do_set_var");
 	return 0;
 }
 
-#ifdef SISFB_PAN
 static int sisfb_pan_var(struct fb_var_screeninfo *var)
 {
 	unsigned int base;
 
-	TWDEBUG("Inside pan_var");
-	
 	if (var->xoffset > (var->xres_virtual - var->xres)) {
-	        printk(KERN_INFO "Pan: xo: %d xv %d xr %d\n",
-			var->xoffset, var->xres_virtual, var->xres);
 		return -EINVAL;
 	}
 	if(var->yoffset > (var->yres_virtual - var->yres)) {
-		printk(KERN_INFO "Pan: yo: %d yv %d yr %d\n",
-			var->yoffset, var->yres_virtual, var->yres);
 		return -EINVAL;
 	}
 
-        base = var->yoffset * var->xres_virtual + var->xoffset;
+	base = var->yoffset * var->xres_virtual + var->xoffset;
 
         /* calculate base bpp dep. */
         switch(var->bits_per_pixel) {
@@ -794,7 +1161,7 @@
 	if(sisvga_engine == SIS_315_VGA) {
 		setSISIDXREG(SISSR, 0x37, 0xFE, (base >> 24) & 0x01);
 	}
-        if(ivideo.disp_state & DISPTYPE_DISP2) {
+        if(ivideo.currentvbflags & VB_DISPTYPE_DISP2) {
 		orSISIDXREG(SISPART1, sisfb_CRT2_write_enable, 0x01);
         	outSISIDXREG(SISPART1, 0x06, (base & 0xFF));
         	outSISIDXREG(SISPART1, 0x05, ((base >> 8) & 0xFF));
@@ -803,10 +1170,8 @@
 			setSISIDXREG(SISPART1, 0x02, 0x7F, ((base >> 24) & 0x01) << 7);
 		}
         }
-	TWDEBUG("End of pan_var");
 	return 0;
 }
-#endif
 
 static void sisfb_bpp_to_var(struct fb_var_screeninfo *var)
 {
@@ -843,22 +1208,24 @@
 
 void sis_dispinfo(struct ap_data *rec)
 {
-	rec->minfo.bpp    = ivideo.video_bpp;
-	rec->minfo.xres   = ivideo.video_width;
-	rec->minfo.yres   = ivideo.video_height;
-	rec->minfo.v_xres = ivideo.video_vwidth;
-	rec->minfo.v_yres = ivideo.video_vheight;
-	rec->minfo.org_x  = ivideo.org_x;
-	rec->minfo.org_y  = ivideo.org_y;
-	rec->minfo.vrate  = ivideo.refresh_rate;
-	rec->iobase       = ivideo.vga_base - 0x30;
-	rec->mem_size     = ivideo.video_size;
-	rec->disp_state   = ivideo.disp_state; 
-	rec->version      = (VER_MAJOR << 24) | (VER_MINOR << 16) | VER_LEVEL; 
-	rec->hasVB        = ivideo.hasVB; 
-	rec->TV_type      = ivideo.TV_type; 
-	rec->TV_plug      = ivideo.TV_plug; 
-	rec->chip         = ivideo.chip;
+	rec->minfo.bpp      = ivideo.video_bpp;
+	rec->minfo.xres     = ivideo.video_width;
+	rec->minfo.yres     = ivideo.video_height;
+	rec->minfo.v_xres   = ivideo.video_vwidth;
+	rec->minfo.v_yres   = ivideo.video_vheight;
+	rec->minfo.org_x    = ivideo.org_x;
+	rec->minfo.org_y    = ivideo.org_y;
+	rec->minfo.vrate    = ivideo.refresh_rate;
+	rec->iobase         = ivideo.vga_base - 0x30;
+	rec->mem_size       = ivideo.video_size;
+	rec->disp_state     = ivideo.disp_state;
+	rec->version        = (VER_MAJOR << 24) | (VER_MINOR << 16) | VER_LEVEL;
+	rec->hasVB          = ivideo.hasVB;
+	rec->TV_type        = ivideo.TV_type;
+	rec->TV_plug        = ivideo.TV_plug;
+	rec->chip           = ivideo.chip;
+	rec->vbflags	    = ivideo.vbflags;
+	rec->currentvbflags = ivideo.currentvbflags;
 }
 
 /* ------------ FBDev related routines for 2.4 series ----------- */
@@ -871,15 +1238,14 @@
 	u16 HRE, HBE, HRS, HBS, HDE, HT;
 	u8  sr_data, cr_data, cr_data2, cr_data3, mr_data;
 	int A, B, C, D, E, F, temp;
-	double hrate, drate;
+	unsigned int hrate, drate, maxyres;
 
-	TWDEBUG("Inside crtc_to_var");
 	inSISIDXREG(SISSR, IND_SIS_COLOR_MODE, sr_data);
 
-	if (sr_data & SIS_INTERLACED_MODE)
-		var->vmode = FB_VMODE_INTERLACED;
+	if(sr_data & SIS_INTERLACED_MODE)
+	   var->vmode = FB_VMODE_INTERLACED;
 	else
-		var->vmode = FB_VMODE_NONINTERLACED;
+	   var->vmode = FB_VMODE_NONINTERLACED;
 
 	switch ((sr_data & 0x1C) >> 2) {
 	   case SIS_8BPP_COLOR_MODE:
@@ -921,6 +1287,8 @@
 
 	inSISIDXREG(SISCR, 0x09, cr_data3);
 
+	if(cr_data3 & 0x80) var->vmode = FB_VMODE_DOUBLE;
+
 	VBS = (cr_data & 0xff) | ((u16) (cr_data2 & 0x08) << 5) |
 	      ((u16) (cr_data3 & 0x20) << 4) | ((u16) (sr_data & 0x04) << 8);
 
@@ -939,26 +1307,22 @@
 	D = B - F - C;
 
         var->yres = E;
-#ifndef SISFB_PAN
-	var->yres_virtual = E;
-#endif
-	/* TW: We have to report the physical dimension to the console! */
-	if ((var->vmode & FB_VMODE_MASK) == FB_VMODE_INTERLACED) {
-		var->yres <<= 1;
-#ifndef SISFB_PAN
-		var->yres_virtual <<= 1;
-#endif
-	} else if ((var->vmode & FB_VMODE_MASK) == FB_VMODE_DOUBLE) {
-		var->yres >>= 1;
-#ifndef SISFB_PAN
-		var->yres_virtual >>= 1;
-#endif
-	}
-
 	var->upper_margin = D;
 	var->lower_margin = F;
 	var->vsync_len = C;
 
+	if((var->vmode & FB_VMODE_MASK) == FB_VMODE_INTERLACED) {
+	   var->yres <<= 1;
+	   var->upper_margin <<= 1;
+	   var->lower_margin <<= 1;
+	   var->vsync_len <<= 1;
+	} else if((var->vmode & FB_VMODE_MASK) == FB_VMODE_DOUBLE) {
+	   var->yres >>= 1;
+	   var->upper_margin >>= 1;
+	   var->lower_margin >>= 1;
+	   var->vsync_len >>= 1;
+	}
+
 	inSISIDXREG(SISSR, 0x0b, sr_data);
 
 	inSISIDXREG(SISCR, 0x00, cr_data);
@@ -999,44 +1363,62 @@
 	D = B - F - C;
 
 	var->xres = var->xres_virtual = E * 8;
-	var->left_margin = D * 8;
-	var->right_margin = F * 8;
-	var->hsync_len = C * 8;
 
+	if((var->xres == 320) &&
+	   (var->yres == 200 || var->yres == 240)) {
+		/* Terrible hack, but the correct CRTC data for
+	  	 * these modes only produces a black screen...
+	  	 */
+       		var->left_margin = (400 - 376);
+       		var->right_margin = (328 - 320);
+       		var->hsync_len = (376 - 328);
+	} else {
+	   	var->left_margin = D * 8;
+	   	var->right_margin = F * 8;
+	   	var->hsync_len = C * 8;
+	}
 	var->activate = FB_ACTIVATE_NOW;
 
 	var->sync = 0;
 
 	mr_data = inSISREG(SISMISCR);
-	if (mr_data & 0x80)
-		var->sync &= ~FB_SYNC_VERT_HIGH_ACT;
+	if(mr_data & 0x80)
+	   var->sync &= ~FB_SYNC_VERT_HIGH_ACT;
 	else
-		var->sync |= FB_SYNC_VERT_HIGH_ACT;
+	   var->sync |= FB_SYNC_VERT_HIGH_ACT;
 
-	if (mr_data & 0x40)
-		var->sync &= ~FB_SYNC_HOR_HIGH_ACT;
+	if(mr_data & 0x40)
+	   var->sync &= ~FB_SYNC_HOR_HIGH_ACT;
 	else
-		var->sync |= FB_SYNC_HOR_HIGH_ACT;
+	   var->sync |= FB_SYNC_HOR_HIGH_ACT;
 
 	VT += 2;
 	VT <<= 1;
 	HT = (HT + 5) * 8;
 
-	hrate = (double) ivideo.refresh_rate * (double) VT / 2;
-	drate = hrate * HT;
-	var->pixclock = (u32) (1E12 / drate);
+	if((var->vmode & FB_VMODE_MASK) == FB_VMODE_INTERLACED) {
+	   VT <<= 1;
+	}
+	hrate = ivideo.refresh_rate * VT / 2;
+	drate = (hrate * HT) / 1000;
+	var->pixclock = (u32) (1000000000 / drate);
 
-#ifdef SISFB_PAN
 	if(sisfb_ypan) {
-	    var->yres_virtual = ivideo.heapstart / (var->xres * (var->bits_per_pixel >> 3));
-	    if(var->yres_virtual <= var->yres) {
-	        var->yres_virtual = var->yres;
-	    }
-	} else
-#endif
+	   maxyres = ivideo.heapstart / (var->xres * (var->bits_per_pixel >> 3));
+	   if(maxyres > 32767) maxyres = 32767;
+	   if(sisfb_max) {
+	      var->yres_virtual = maxyres;
+	   } else {
+	      if(var->yres_virtual > maxyres) {
+	         var->yres_virtual = maxyres;
+	      }
+	   }
+	   if(var->yres_virtual <= var->yres) {
+	      var->yres_virtual = var->yres;
+	   }
+	} else
 	   var->yres_virtual = var->yres;
 
-        TWDEBUG("end of crtc_to_var");
 }
 
 static int sis_getcolreg(unsigned regno, unsigned *red, unsigned *green, unsigned *blue,
@@ -1069,7 +1451,7 @@
 		outSISREG(SISDACD, (red >> 10));
 		outSISREG(SISDACD, (green >> 10));
 		outSISREG(SISDACD, (blue >> 10));
-		if (ivideo.disp_state & DISPTYPE_DISP2) {
+		if (ivideo.currentvbflags & VB_DISPTYPE_DISP2) {
 		        outSISREG(SISDAC2A, regno);
 			outSISREG(SISDAC2D, (red >> 8));
 			outSISREG(SISDAC2D, (green >> 8));
@@ -1118,7 +1500,7 @@
 	display->ywrapstep = fix.ywrapstep;
 	display->line_length = fix.line_length;
 	display->next_line = fix.line_length;
-	display->can_soft_blank = 0;
+	display->can_soft_blank = 1;
 	display->inverse = sisfb_inverse;
 	display->var = *var;
 
@@ -1162,17 +1544,12 @@
 	display->dispsw = &sisfb_sw;
 	restore_flags(flags);
 
-#ifdef SISFB_PAN
-        if((ivideo.accel) && (sisfb_ypan)) {
-  	    /* display->scrollmode = SCROLL_YPAN; - not defined */
+        if(sisfb_ypan) {
+  	    /* display->scrollmode = 0;  */
 	} else {
 	    display->scrollmode = SCROLL_YREDRAW;
 	    sisfb_sw.bmove = fbcon_redraw_bmove;
 	}
-#else
-	display->scrollmode = SCROLL_YREDRAW;
-	sisfb_sw.bmove = fbcon_redraw_bmove;
-#endif
 }
 
 static void sisfb_do_install_cmap(int con, struct fb_info *info)
@@ -1191,17 +1568,16 @@
 static int sisfb_get_var(struct fb_var_screeninfo *var, int con,
 			 struct fb_info *info)
 {
-	TWDEBUG("inside get_var");
 	if(con == -1)
 		memcpy(var, &default_var, sizeof(struct fb_var_screeninfo));
 	else
 		*var = fb_display[con].var;
 
- 	/* For FSTN, DSTN */
-	if (var->xres == 320 && var->yres == 480)
+	if(sisfb_fstn) {
+	   if (var->xres == 320 && var->yres == 480)
 		var->yres = 240;
-		
-	TWDEBUG("end of get_var");
+        }
+
 	return 0;
 }
 
@@ -1211,8 +1587,6 @@
 	int err;
 	unsigned int cols, rows;
 
-	TWDEBUG("inside set_var");
-
 	fb_display[con].var.activate = FB_ACTIVATE_NOW;
         if(sisfb_do_set_var(var, con == currcon, info)) {
 		sisfb_crtc_to_var(var);
@@ -1233,16 +1607,17 @@
 
 	cols = sisbios_mode[sisfb_mode_idx].cols;
 	rows = sisbios_mode[sisfb_mode_idx].rows;
-	vc_resize_con(rows, cols, fb_display[con].conp->vc_num);
+#if 0
+	/* Why was this called here? */
+ 	vc_resize_con(rows, cols, fb_display[con].conp->vc_num);
+#endif
 
-	TWDEBUG("end of set_var");
 	return 0;
 }
 
 static int sisfb_get_cmap(struct fb_cmap *cmap, int kspc, int con,
 			  struct fb_info *info)
 {
-	TWDEBUG("inside get_cmap");
         if (con == currcon)
 		return fb_get_cmap(cmap, kspc, sis_getcolreg, info);
 
@@ -1251,7 +1626,6 @@
 	else
 		fb_copy_cmap(fb_default_cmap(ivideo.video_cmap_len), cmap, kspc ? 0 : 2);
 
-	TWDEBUG("end of get_cmap");
 	return 0;
 }
 
@@ -1260,7 +1634,6 @@
 {
 	int err;
 
-	TWDEBUG("inside set_cmap");
 	if (!fb_display[con].cmap.len) {
 		err = fb_alloc_cmap(&fb_display[con].cmap, ivideo.video_cmap_len, 0);
 		if (err)
@@ -1272,17 +1645,15 @@
 
 	else
 		fb_copy_cmap(cmap, &fb_display[con].cmap, kspc ? 0 : 1);
-	TWDEBUG("end of set_cmap");
+
 	return 0;
 }
 
-#ifdef SISFB_PAN
 static int sisfb_pan_display(struct fb_var_screeninfo *var, int con,
 			     struct fb_info* info)
 {
 	int err;
-	
-	TWDEBUG("inside pan_display");
+
 	if (var->vmode & FB_VMODE_YWRAP) {
 		if (var->yoffset < 0 || var->yoffset >= fb_display[con].var.yres_virtual || var->xoffset)
 			return -EINVAL;
@@ -1303,10 +1674,8 @@
 	else
 		fb_display[con].var.vmode &= ~FB_VMODE_YWRAP;
 
-	TWDEBUG("end of pan_display");
 	return 0;
 }
-#endif
 
 static int sisfb_mmap(struct fb_info *info, struct file *file,
 		      struct vm_area_struct *vma)
@@ -1316,7 +1685,6 @@
 	unsigned long off;
 	u32 len, mmio_off;
 
-	TWDEBUG("inside mmap");
 	if(vma->vm_pgoff > (~0UL >> PAGE_SHIFT))  return -EINVAL;
 
 	off = vma->vm_pgoff << PAGE_SHIFT;
@@ -1351,11 +1719,11 @@
 	if (boot_cpu_data.x86 > 3)
 		pgprot_val(vma->vm_page_prot) |= _PAGE_PCD;
 #endif
+        /* RedHat requires vma as the first paramater to the following call */
 	if (io_remap_page_range(vma->vm_start, off, vma->vm_end - vma->vm_start,
 				vma->vm_page_prot))
 		return -EAGAIN;
 
-        TWDEBUG("end of mmap");
 	return 0;
 }
 
@@ -1368,7 +1736,6 @@
 	u8 *gbuf = gly->gmask;
 	int size;
 
-	TWDEBUG("Inside get_glyph");
 	gly->fontheight = fontheight(p);
 	gly->fontwidth = fontwidth(p);
 	widthb = (fontwidth(p) + 7) / 8;
@@ -1382,16 +1749,11 @@
 	size = fontheight(p) * widthb;
 	memcpy(gbuf, cdat, size);
 	gly->ngmask = size;
-	TWDEBUG("End of get_glyph");
 }
 
 static int sisfb_update_var(int con, struct fb_info *info)
 {
-#ifdef SISFB_PAN
         return(sisfb_pan_var(&fb_display[con].var));
-#else
-	return 0;
-#endif	
 }
 
 static int sisfb_switch(int con, struct fb_info *info)
@@ -1428,127 +1790,7 @@
 
 static void sisfb_blank(int blank, struct fb_info *info)
 {
-	u8 reg;
-
-	inSISIDXREG(SISCR, 0x17, reg);
-
-	if(blank > 0)
-		reg &= 0x7f;
-	else
-		reg |= 0x80;
-
-        outSISIDXREG(SISCR, 0x17, reg);		
-	outSISIDXREG(SISSR, 0x00, 0x01);    /* Synchronous Reset */
-	outSISIDXREG(SISSR, 0x00, 0x03);    /* End Reset */
-	printk(KERN_DEBUG "sisfb_blank() called (%d)\n", blank);
-}
-
-
-static int sisfb_ioctl(struct inode *inode, struct file *file,
-		       unsigned int cmd, unsigned long arg, int con,
-		       struct fb_info *info)
-{
-	TWDEBUG("inside ioctl");
-	switch (cmd) {
-	   case FBIO_ALLOC:
-		if (!capable(CAP_SYS_RAWIO))
-			return -EPERM;
-		sis_malloc((struct sis_memreq *) arg);
-		break;
-	   case FBIO_FREE:
-		if (!capable(CAP_SYS_RAWIO))
-			return -EPERM;
-		sis_free(*(unsigned long *) arg);
-		break;
-	   case FBIOGET_GLYPH:
-                sis_get_glyph(info,(SIS_GLYINFO *) arg);
-		break;	
-	   case FBIOGET_HWCINFO:
-		{
-			unsigned long *hwc_offset = (unsigned long *) arg;
-
-			if (sisfb_caps & HW_CURSOR_CAP)
-				*hwc_offset = sisfb_hwcursor_vbase -
-				    (unsigned long) ivideo.video_vbase;
-			else
-				*hwc_offset = 0;
-
-			break;
-		}
-	   case FBIOPUT_MODEINFO:
-		{
-			struct mode_info *x = (struct mode_info *)arg;
-
-			ivideo.video_bpp        = x->bpp;
-			ivideo.video_width      = x->xres;
-			ivideo.video_height     = x->yres;
-			ivideo.video_vwidth     = x->v_xres;
-			ivideo.video_vheight    = x->v_yres;
-			ivideo.org_x            = x->org_x;
-			ivideo.org_y            = x->org_y;
-			ivideo.refresh_rate     = x->vrate;
-			ivideo.video_linelength = ivideo.video_vwidth * (ivideo.video_bpp >> 3);
-			switch(ivideo.video_bpp) {
-        		case 8:
-            			ivideo.DstColor = 0x0000;
-	    			ivideo.SiS310_AccelDepth = 0x00000000;
-				ivideo.video_cmap_len = 256;
-            			break;
-        		case 16:
-            			ivideo.DstColor = 0x8000;
-            			ivideo.SiS310_AccelDepth = 0x00010000;
-				ivideo.video_cmap_len = 16;
-            			break;
-        		case 32:
-            			ivideo.DstColor = 0xC000;
-	    			ivideo.SiS310_AccelDepth = 0x00020000;
-				ivideo.video_cmap_len = 16;
-            			break;
-			default:
-				ivideo.video_cmap_len = 16;
-		       	 	printk(KERN_ERR "sisfb: Unsupported depth %d", ivideo.video_bpp);
-				ivideo.accel = 0;
-				break;
-    			}
-
-			break;
-		}
-	   case FBIOGET_DISPINFO:
-		sis_dispinfo((struct ap_data *)arg);
-		break;
-	   case SISFB_GET_INFO:  /* TW: New for communication with X driver */
-	        {
-			sisfb_info *x = (sisfb_info *)arg;
-
-			x->sisfb_id = SISFB_ID;
-			x->sisfb_version = VER_MAJOR;
-			x->sisfb_revision = VER_MINOR;
-			x->sisfb_patchlevel = VER_LEVEL;
-			x->chip_id = ivideo.chip_id;
-			x->memory = ivideo.video_size / 1024;
-			x->heapstart = ivideo.heapstart / 1024;
-			x->fbvidmode = sisfb_mode_no;
-			x->sisfb_caps = sisfb_caps;
-			x->sisfb_tqlen = 512; /* yet unused */
-			x->sisfb_pcibus = ivideo.pcibus;
-			x->sisfb_pcislot = ivideo.pcislot;
-			x->sisfb_pcifunc = ivideo.pcifunc;
-			x->sisfb_lcdpdc = sisfb_detectedpdc;
-			x->sisfb_lcda = sisfb_detectedlcda;
-	                break;
-		}
-	   case SISFB_GET_VBRSTATUS:
-	        {
-			unsigned long *vbrstatus = (unsigned long *) arg;
-			if(sisfb_CheckVBRetrace()) *vbrstatus = 1;
-			else		           *vbrstatus = 0;
-		}
-	   default:
-		return -EINVAL;
-	}
-	TWDEBUG("end of ioctl");
-	return 0;
-
+	sisfb_myblank(blank);
 }
 #endif
 
@@ -1575,11 +1817,9 @@
 		rc = 256;	
 		break;
 	case 16:
-		rc = 16;	
-		break;		
 	case 32:
 		rc = 16;
-		break;	
+		break;
 	}
 	return rc;
 }
@@ -1596,7 +1836,7 @@
 		outSISREG(SISDACD, (red >> 10));
 		outSISREG(SISDACD, (green >> 10));
 		outSISREG(SISDACD, (blue >> 10));
-		if (ivideo.disp_state & DISPTYPE_DISP2) {
+		if (ivideo.currentvbflags & VB_DISPTYPE_DISP2) {
 		        outSISREG(SISDAC2A, regno);
 			outSISREG(SISDAC2D, (red >> 8));
 			outSISREG(SISDAC2D, (green >> 8));
@@ -1611,7 +1851,7 @@
 		red >>= 8;
 		green >>= 8;
 		blue >>= 8;
-		((u32 *) (info->pseudo_palette))[regno] = 
+		((u32 *) (info->pseudo_palette))[regno] =
 			(red << 16) | (green << 8) | (blue);
 		break;
 	}
@@ -1622,63 +1862,52 @@
 {
 	int err;
 
-	TWDEBUG("inside set_par");
         if((err = sisfb_do_set_var(&info->var, 1, info)))
 		return err;
 
 	sisfb_get_fix(&info->fix, info->currcon, info);
 
-	TWDEBUG("end of set_par");
 	return 0;
 }
 
 static int sisfb_check_var(struct fb_var_screeninfo *var,
                            struct fb_info *info)
 {
-	unsigned int htotal =
-		var->left_margin + var->xres + var->right_margin +
-		var->hsync_len;
-	unsigned int vtotal = 0;
-	double drate = 0, hrate = 0;
+	unsigned int htotal = 0, vtotal = 0, myrateindex = 0;
+	unsigned int drate = 0, hrate = 0, maxyres;
 	int found_mode = 0;
 	int refresh_rate, search_idx;
+	BOOLEAN recalc_clock = FALSE;
+	u32 pixclock;
 
-	TWDEBUG("Inside check_var");
+	htotal = var->left_margin + var->xres + var->right_margin + var->hsync_len;
+
+	vtotal = var->upper_margin + var->lower_margin + var->vsync_len;
+
+	pixclock = var->pixclock;
 
 	if((var->vmode & FB_VMODE_MASK) == FB_VMODE_NONINTERLACED) {
-		vtotal = var->upper_margin + var->yres + var->lower_margin +
-		         var->vsync_len;   
+		vtotal += var->yres;
 		vtotal <<= 1;
 	} else if((var->vmode & FB_VMODE_MASK) == FB_VMODE_DOUBLE) {
-		vtotal = var->upper_margin + var->yres + var->lower_margin +
-		         var->vsync_len;   
+		vtotal += var->yres;
 		vtotal <<= 2;
 	} else if((var->vmode & FB_VMODE_MASK) == FB_VMODE_INTERLACED) {
-		vtotal = var->upper_margin + (var->yres/2) + var->lower_margin +
-		         var->vsync_len;   
-	} else 	vtotal = var->upper_margin + var->yres + var->lower_margin +
-		         var->vsync_len;
+		vtotal += var->yres;
+		vtotal <<= 1;
+	} else 	vtotal += var->yres;
 
 	if(!(htotal) || !(vtotal)) {
 		SISFAIL("sisfb: no valid timing data");
 	}
 
-	if((var->pixclock) && (htotal)) {
-	   drate = 1E12 / var->pixclock;
-	   hrate = drate / htotal;
-	   refresh_rate = (unsigned int) (hrate / vtotal * 2 + 0.5);
-	} else refresh_rate = 60;
-
-	/* TW: Calculation wrong for 1024x600 - force it to 60Hz */
-	if((var->xres == 1024) && (var->yres == 600)) refresh_rate = 60;
-
 	search_idx = 0;
 	while( (sisbios_mode[search_idx].mode_no != 0) &&
 	       (sisbios_mode[search_idx].xres <= var->xres) ) {
 		if( (sisbios_mode[search_idx].xres == var->xres) &&
 		    (sisbios_mode[search_idx].yres == var->yres) &&
 		    (sisbios_mode[search_idx].bpp == var->bits_per_pixel)) {
-		        if(sisfb_validate_mode(search_idx) > 0) {
+		        if(sisfb_validate_mode(search_idx, ivideo.currentvbflags) > 0) {
 			   found_mode = 1;
 			   break;
 			}
@@ -1687,38 +1916,95 @@
 	}
 
 	if(!found_mode) {
-	
-		printk(KERN_ERR "sisfb: %dx%dx%d is no valid mode\n", 
-			var->xres, var->yres, var->bits_per_pixel);
-			
+
                 search_idx = 0;
 		while(sisbios_mode[search_idx].mode_no != 0) {
-		       
 		   if( (var->xres <= sisbios_mode[search_idx].xres) &&
-		       (var->yres <= sisbios_mode[search_idx].yres) && 
+		       (var->yres <= sisbios_mode[search_idx].yres) &&
 		       (var->bits_per_pixel == sisbios_mode[search_idx].bpp) ) {
-		          if(sisfb_validate_mode(search_idx) > 0) {
+		          if(sisfb_validate_mode(search_idx, ivideo.currentvbflags) > 0) {
 			     found_mode = 1;
 			     break;
 			  }
 		   }
 		   search_idx++;
-	        }			
+	        }
 		if(found_mode) {
+			printk(KERN_DEBUG "sisfb: Adapted from %dx%dx%d to %dx%dx%d\n",
+		   		var->xres, var->yres, var->bits_per_pixel,
+				sisbios_mode[search_idx].xres,
+				sisbios_mode[search_idx].yres,
+				var->bits_per_pixel);
 			var->xres = sisbios_mode[search_idx].xres;
 		      	var->yres = sisbios_mode[search_idx].yres;
-		      	printk(KERN_DEBUG "sisfb: Adapted to mode %dx%dx%d\n",
-		   		var->xres, var->yres, var->bits_per_pixel);
-		   
+
+
 		} else {
-		   	printk(KERN_ERR "sisfb: Failed to find similar mode to %dx%dx%d\n", 
+		   	printk(KERN_ERR "sisfb: Failed to find supported mode near %dx%dx%d\n",
 				var->xres, var->yres, var->bits_per_pixel);
 		   	return -EINVAL;
 		}
 	}
 
-	/* TW: TODO: Check the refresh rate */		
-	
+	if( ((ivideo.vbflags & VB_LVDS) ||			/* Slave modes on LVDS and 301B-DH */
+	     ((ivideo.vbflags & VB_30xBDH) && (ivideo.currentvbflags & CRT2_LCD))) &&
+	    (var->bits_per_pixel == 8) ) {
+	    	refresh_rate = 60;
+		recalc_clock = TRUE;
+	} else if( (ivideo.current_htotal == htotal) &&		/* x=x & y=y & c=c -> assume depth change */
+	    	   (ivideo.current_vtotal == vtotal) &&
+	    	   (ivideo.current_pixclock == pixclock) ) {
+		drate = 1000000000 / pixclock;
+	        hrate = (drate * 1000) / htotal;
+	        refresh_rate = (unsigned int) (hrate * 2 / vtotal);
+	} else if( ( (ivideo.current_htotal != htotal) ||	/* x!=x | y!=y & c=c -> invalid pixclock */
+	    	     (ivideo.current_vtotal != vtotal) ) &&
+	    	   (ivideo.current_pixclock == var->pixclock) ) {
+		if(sisfb_lastrates[sisbios_mode[search_idx].mode_no]) {
+			refresh_rate = sisfb_lastrates[sisbios_mode[search_idx].mode_no];
+		} else if(sisfb_parm_rate != -1) {
+			refresh_rate = sisfb_parm_rate;
+		} else {
+			refresh_rate = 60;
+		}
+		recalc_clock = TRUE;
+	} else if((pixclock) && (htotal) && (vtotal)) {
+		drate = 1000000000 / pixclock;
+	   	hrate = (drate * 1000) / htotal;
+	   	refresh_rate = (unsigned int) (hrate * 2 / vtotal);
+	} else if(ivideo.current_refresh_rate) {
+		refresh_rate = ivideo.current_refresh_rate;
+		recalc_clock = TRUE;
+	} else {
+		refresh_rate = 60;
+		recalc_clock = TRUE;
+	}
+
+	myrateindex = sisfb_search_refresh_rate(refresh_rate, search_idx);
+
+	/* Eventually recalculate timing and clock */
+	if(recalc_clock) {
+	   if(!myrateindex) myrateindex = sisbios_mode[search_idx].rate_idx;
+	   var->pixclock = (u32) (1000000000 / sisfb_mode_rate_to_dclock(&SiS_Pr, &sishw_ext,
+						sisbios_mode[search_idx].mode_no, myrateindex));
+	   sisfb_mode_rate_to_ddata(&SiS_Pr, &sishw_ext,
+		 			sisbios_mode[search_idx].mode_no, myrateindex,
+		 			&var->left_margin, &var->right_margin,
+		 			&var->upper_margin, &var->lower_margin,
+		 			&var->hsync_len, &var->vsync_len,
+		 			&var->sync, &var->vmode);
+	   if((var->vmode & FB_VMODE_MASK) == FB_VMODE_DOUBLE) {
+		var->pixclock <<= 1;
+	   }
+	}
+
+	if(sisfb_thismonitor.datavalid) {
+	   if(!sisfb_verify_rate(&sisfb_thismonitor, search_idx,
+	                         myrateindex, refresh_rate)) {
+	      printk(KERN_INFO "sisfb: WARNING: Refresh rate exceeds monitor specs!\n");
+	   }
+	}
+
 	/* Adapt RGB settings */
 	sisfb_bpp_to_var(var);	
 	
@@ -1732,24 +2018,32 @@
 	if(var->xres != var->xres_virtual)
 		var->xres_virtual = var->xres;
 
-	if(!sisfb_ypan) {
-		if(var->yres != var->yres_virtual)
-			var->yres_virtual = var->yres;
+	if(sisfb_ypan) {
+	   maxyres = ivideo.heapstart / (var->xres * (var->bits_per_pixel >> 3));
+	   if(maxyres > 32767) maxyres = 32767;
+	   if(sisfb_max) {
+	      var->yres_virtual = maxyres;
+	   } else {
+	      if(var->yres_virtual > maxyres) {
+	         var->yres_virtual = maxyres;
+	      }
+	   }
+	   if(var->yres_virtual <= var->yres) {
+	      var->yres_virtual = var->yres;
+	   }
 	} else {
-	   /* TW: Now patch yres_virtual if we use panning */
-	   /* *** May I do this? *** */
-	   var->yres_virtual = ivideo.heapstart / (var->xres * (var->bits_per_pixel >> 3));
-	    if(var->yres_virtual <= var->yres) {
-	    	/* TW: Paranoia check */
-	        var->yres_virtual = var->yres;
-	    }
+	   if(var->yres != var->yres_virtual) {
+	      var->yres_virtual = var->yres;
+	   }
+	   var->xoffset = 0;
+	   var->yoffset = 0;
 	}
 	
 	/* Truncate offsets to maximum if too high */
-	if (var->xoffset > var->xres_virtual - var->xres)
+	if(var->xoffset > var->xres_virtual - var->xres)
 		var->xoffset = var->xres_virtual - var->xres - 1;
 
-	if (var->yoffset > var->yres_virtual - var->yres)
+	if(var->yoffset > var->yres_virtual - var->yres)
 		var->yoffset = var->yres_virtual - var->yres - 1;
 	
 	/* Set everything else to 0 */
@@ -1757,28 +2051,25 @@
 	    var->green.msb_right =
 	    var->blue.msb_right =
 	    var->transp.offset = var->transp.length = var->transp.msb_right = 0;		
-		
-	TWDEBUG("end of check_var");
+
 	return 0;
 }
 
-#ifdef SISFB_PAN
 static int sisfb_pan_display(struct fb_var_screeninfo *var,
 			     struct fb_info* info)
 {
 	int err;
-	
-	TWDEBUG("inside pan_display");
-	
+
 	if (var->xoffset > (var->xres_virtual - var->xres))
 		return -EINVAL;
 	if (var->yoffset > (var->yres_virtual - var->yres))
 		return -EINVAL;
 
 	if (var->vmode & FB_VMODE_YWRAP) {
-		if (var->yoffset < 0
-		    || var->yoffset >= info->var.yres_virtual
-		    || var->xoffset) return -EINVAL;
+		if (var->yoffset < 0 ||
+		    var->yoffset >= info->var.yres_virtual ||
+		    var->xoffset)
+		    	return -EINVAL;
 	} else {
 		if (var->xoffset + info->var.xres > info->var.xres_virtual ||
 		    var->yoffset + info->var.yres > info->var.yres_virtual)
@@ -1794,10 +2085,8 @@
 	else
 		info->var.vmode &= ~FB_VMODE_YWRAP;
 
-	TWDEBUG("end of pan_display");
 	return 0;
 }
-#endif
 
 static int sisfb_mmap(struct fb_info *info, struct file *file,
 		      struct vm_area_struct *vma)
@@ -1806,7 +2095,6 @@
 	unsigned long off;
 	u32 len, mmio_off;
 
-	TWDEBUG("inside mmap");
 	if(vma->vm_pgoff > (~0UL >> PAGE_SHIFT))  return -EINVAL;
 
 	off = vma->vm_pgoff << PAGE_SHIFT;
@@ -1844,188 +2132,219 @@
 				vma->vm_page_prot))
 		return -EAGAIN;
 
-        TWDEBUG("end of mmap");
 	return 0;
 }
 
 static int sisfb_blank(int blank, struct fb_info *info)
 {
-	u8 reg;
+	return(sisfb_myblank(blank));
+}
 
-	inSISIDXREG(SISCR, 0x17, reg);
+#endif
 
-	if(blank > 0)
-		reg &= 0x7f;
-	else
-		reg |= 0x80;
+/* ----------- FBDev related routines for all series ---------- */
 
-        outSISIDXREG(SISCR, 0x17, reg);		
-	outSISIDXREG(SISSR, 0x00, 0x01);    /* Synchronous Reset */
-	outSISIDXREG(SISSR, 0x00, 0x03);    /* End Reset */
-        return(0);
-}
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
+static int sisfb_ioctl(struct inode *inode, struct file *file,
+		       unsigned int cmd, unsigned long arg,
+		       struct fb_info *info)
+#else
 static int sisfb_ioctl(struct inode *inode, struct file *file,
-		       unsigned int cmd, unsigned long arg, 
+		       unsigned int cmd, unsigned long arg, int con,
 		       struct fb_info *info)
+#endif
 {
-	TWDEBUG("inside ioctl");
+	struct sis_memreq sismemreq;
+	struct ap_data sisapdata;
+	unsigned long sismembase = 0;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
+	SIS_GLYINFO sisglyinfo;
+#endif
+
 	switch (cmd) {
 	   case FBIO_ALLOC:
-		if (!capable(CAP_SYS_RAWIO))
+		if(!capable(CAP_SYS_RAWIO))
 			return -EPERM;
-		sis_malloc((struct sis_memreq *) arg);
+		if(copy_from_user(&sismemreq, (void *)arg, sizeof(sismemreq)))
+		   	return -EFAULT;
+        	sis_malloc(&sismemreq);
+		if(copy_to_user((void *)arg, &sismemreq, sizeof(sismemreq))) {
+			sis_free(sismemreq.offset);
+		    	return -EFAULT;
+		}
 		break;
 	   case FBIO_FREE:
-		if (!capable(CAP_SYS_RAWIO))
+		if(!capable(CAP_SYS_RAWIO))
 			return -EPERM;
-		sis_free(*(unsigned long *) arg);
+		if(get_user(sismembase, (unsigned long *) arg))
+			return -EFAULT;
+		sis_free(sismembase);
 		break;
-	   case FBIOGET_HWCINFO:
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
+	   case FBIOGET_GLYPH:
+	        if(copy_from_user(&sisglyinfo, (void *)arg, sizeof(sisglyinfo)))
+			return -EFAULT;
+                sis_get_glyph(info, &sisglyinfo);
+		break;
+	   case FBIOPUT_MODEINFO:
 		{
-			unsigned long *hwc_offset = (unsigned long *) arg;
+			struct mode_info x;
 
-			if (sisfb_caps & HW_CURSOR_CAP)
-				*hwc_offset = sisfb_hwcursor_vbase -
-				    (unsigned long) ivideo.video_vbase;
-			else
-				*hwc_offset = 0;
+			if(copy_from_user(&x, (void *)arg, sizeof(x)))
+				return -EFAULT;
 
+			ivideo.video_bpp        = x.bpp;
+			ivideo.video_width      = x.xres;
+			ivideo.video_height     = x.yres;
+			ivideo.video_vwidth     = x.v_xres;
+			ivideo.video_vheight    = x.v_yres;
+			ivideo.org_x            = x.org_x;
+			ivideo.org_y            = x.org_y;
+			ivideo.refresh_rate     = x.vrate;
+			ivideo.video_linelength = ivideo.video_vwidth * (ivideo.video_bpp >> 3);
+			sisfb_set_vparms();
 			break;
 		}
-	   case FBIOPUT_MODEINFO:
+#endif
+	   case FBIOGET_HWCINFO:
 		{
-			struct mode_info *x = (struct mode_info *)arg;
+			unsigned long myhwcoffset = 0;
 
-			ivideo.video_bpp        = x->bpp;
-			ivideo.video_width      = x->xres;
-			ivideo.video_height     = x->yres;
-			ivideo.video_vwidth     = x->v_xres;
-			ivideo.video_vheight    = x->v_yres;
-			ivideo.org_x            = x->org_x;
-			ivideo.org_y            = x->org_y;
-			ivideo.refresh_rate     = x->vrate;
-			ivideo.video_linelength = ivideo.video_vwidth * (ivideo.video_bpp >> 3);
-			switch(ivideo.video_bpp) {
-        		case 8:
-            			ivideo.DstColor = 0x0000;
-	    			ivideo.SiS310_AccelDepth = 0x00000000;
-				ivideo.video_cmap_len = 256;
-            			break;
-        		case 16:
-            			ivideo.DstColor = 0x8000;
-            			ivideo.SiS310_AccelDepth = 0x00010000;
-				ivideo.video_cmap_len = 16;
-            			break;
-        		case 32:
-            			ivideo.DstColor = 0xC000;
-	    			ivideo.SiS310_AccelDepth = 0x00020000;
-				ivideo.video_cmap_len = 16;
-            			break;
-			default:
-				ivideo.video_cmap_len = 16;
-		       	 	printk(KERN_ERR "sisfb: Unsupported accel depth %d", ivideo.video_bpp);
-				ivideo.accel = 0;
-				break;
-    			}
+			if(sisfb_caps & HW_CURSOR_CAP)
+				myhwcoffset = sisfb_hwcursor_vbase -
+				    (unsigned long) ivideo.video_vbase;
+
+			return put_user(myhwcoffset, (unsigned long *)arg);
 
 			break;
 		}
 	   case FBIOGET_DISPINFO:
-		sis_dispinfo((struct ap_data *)arg);
+	   	sis_dispinfo(&sisapdata);
+		if(copy_to_user((void *)arg, &sisapdata, sizeof(sisapdata)))
+			return -EFAULT;
 		break;
-	   case SISFB_GET_INFO:  /* TW: New for communication with X driver */
+	   case SISFB_GET_INFO:  /* For communication with X driver */
 	        {
-			sisfb_info *x = (sisfb_info *)arg;
+			sisfb_info x;
 
-			x->sisfb_id = SISFB_ID;
-			x->sisfb_version = VER_MAJOR;
-			x->sisfb_revision = VER_MINOR;
-			x->sisfb_patchlevel = VER_LEVEL;
-			x->chip_id = ivideo.chip_id;
-			x->memory = ivideo.video_size / 1024;
-			x->heapstart = ivideo.heapstart / 1024;
-			x->fbvidmode = sisfb_mode_no;
-			x->sisfb_caps = sisfb_caps;
-			x->sisfb_tqlen = 512; /* yet unused */
-			x->sisfb_pcibus = ivideo.pcibus;
-			x->sisfb_pcislot = ivideo.pcislot;
-			x->sisfb_pcifunc = ivideo.pcifunc;
-			x->sisfb_lcdpdc = sisfb_detectedpdc;
-			x->sisfb_lcda = sisfb_detectedlcda;
+			x.sisfb_id = SISFB_ID;
+			x.sisfb_version = VER_MAJOR;
+			x.sisfb_revision = VER_MINOR;
+			x.sisfb_patchlevel = VER_LEVEL;
+			x.chip_id = ivideo.chip_id;
+			x.memory = ivideo.video_size / 1024;
+			x.heapstart = ivideo.heapstart / 1024;
+			x.fbvidmode = sisfb_mode_no;
+			x.sisfb_caps = sisfb_caps;
+			x.sisfb_tqlen = 512; /* yet fixed */
+			x.sisfb_pcibus = ivideo.pcibus;
+			x.sisfb_pcislot = ivideo.pcislot;
+			x.sisfb_pcifunc = ivideo.pcifunc;
+			x.sisfb_lcdpdc = sisfb_detectedpdc;
+			x.sisfb_lcda = sisfb_detectedlcda;
+			x.sisfb_vbflags = ivideo.vbflags;
+			x.sisfb_currentvbflags = ivideo.currentvbflags;
+			x.sisfb_scalelcd = SiS_Pr.UsePanelScaler;
+			x.sisfb_specialtiming = SiS_Pr.SiS_CustomT;
+			x.sisfb_haveemi = SiS_Pr.HaveEMI ? 1 : 0;
+			x.sisfb_haveemilcd = SiS_Pr.HaveEMILCD ? 1 : 0;
+			x.sisfb_emi30 = SiS_Pr.EMI_30;
+			x.sisfb_emi31 = SiS_Pr.EMI_31;
+			x.sisfb_emi32 = SiS_Pr.EMI_32;
+			x.sisfb_emi33 = SiS_Pr.EMI_33;
+			if(copy_to_user((void *)arg, &x, sizeof(x)))
+				return -EFAULT;
 	                break;
 		}
 	   case SISFB_GET_VBRSTATUS:
 	        {
-			unsigned long *vbrstatus = (unsigned long *) arg;
-			if(sisfb_CheckVBRetrace()) *vbrstatus = 1;
-			else		           *vbrstatus = 0;
+			if(sisfb_CheckVBRetrace())
+				return put_user(1UL, (unsigned long *) arg);
+			else
+				return put_user(0UL, (unsigned long *) arg);
+			break;
+		}
+	   case SISFB_GET_AUTOMAXIMIZE:
+	        {
+			if(sisfb_max)
+				return put_user(1UL, (unsigned long *) arg);
+			else
+				return put_user(0UL, (unsigned long *) arg);
+			break;
+		}
+	   case SISFB_SET_AUTOMAXIMIZE:
+	        {
+			unsigned long newmax;
+
+			if(copy_from_user(&newmax, (unsigned long *)arg, sizeof(newmax)))
+				return -EFAULT;
+
+			if(newmax) sisfb_max = 1;
+			else	   sisfb_max = 0;
+			break;
 		}
 	   default:
 		return -EINVAL;
 	}
-	TWDEBUG("end of ioctl");
 	return 0;
-
 }
 
-#endif
-
-/* ----------- FBDev related routines for all series ---------- */
 
 static int sisfb_get_fix(struct fb_fix_screeninfo *fix, int con,
 			 struct fb_info *info)
 {
-	TWDEBUG("inside get_fix");
 	memset(fix, 0, sizeof(struct fb_fix_screeninfo));
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)	
-	strcpy(fix->id, sis_fb_info.modename);
+	strcpy(fix->id, sis_fb_info->modename);
 #else
 	strcpy(fix->id, myid);
 #endif	
 
 	fix->smem_start = ivideo.video_base;
 
-        /* TW */
         if((!sisfb_mem) || (sisfb_mem > (ivideo.video_size/1024))) {
-	    if (ivideo.video_size > 0x1000000) {
-	        fix->smem_len = 0xc00000;
-	    } else if (ivideo.video_size > 0x800000)
-		fix->smem_len = 0x800000;
-	    else
-		fix->smem_len = 0x400000;
+	    if(sisvga_engine == SIS_300_VGA) {
+	       if(ivideo.video_size > 0x1000000) {
+	          	fix->smem_len = 0xc00000;
+	       } else if(ivideo.video_size > 0x800000)
+		  	fix->smem_len = 0x800000;
+	       else
+		  	fix->smem_len = 0x400000;
+            } else {
+	       	fix->smem_len = ivideo.video_size - 0x100000;
+	    }
         } else
 		fix->smem_len = sisfb_mem * 1024;
 
-	fix->type        = video_type;
+	fix->type        = FB_TYPE_PACKED_PIXELS;
 	fix->type_aux    = 0;
 	if(ivideo.video_bpp == 8)
-		fix->visual = FB_VISUAL_PSEUDOCOLOR;
+	   fix->visual = FB_VISUAL_PSEUDOCOLOR;
 	else
-		fix->visual = FB_VISUAL_TRUECOLOR;
+	   fix->visual = FB_VISUAL_TRUECOLOR;
 	fix->xpanstep    = 0;
-#ifdef SISFB_PAN
+
         if(sisfb_ypan) 	 fix->ypanstep = 1;
-#endif
+
 	fix->ywrapstep   = 0;
 	fix->line_length = ivideo.video_linelength;
 	fix->mmio_start  = ivideo.mmio_base;
 	fix->mmio_len    = sisfb_mmio_size;
 	if(sisvga_engine == SIS_300_VGA) 
 	   fix->accel    = FB_ACCEL_SIS_GLAMOUR;
-	else if(ivideo.chip == SIS_330)
+	else if((ivideo.chip == SIS_330) || (ivideo.chip == SIS_760))
 	   fix->accel    = FB_ACCEL_SIS_XABRE;
-	else 
+	else
 	   fix->accel    = FB_ACCEL_SIS_GLAMOUR_2;
-	
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)		
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
 	fix->reserved[0] = ivideo.video_size & 0xFFFF;
 	fix->reserved[1] = (ivideo.video_size >> 16) & 0xFFFF;
 	fix->reserved[2] = sisfb_caps;
-#endif	
+#endif
 
-	TWDEBUG("end of get_fix");
 	return 0;
 }
 
@@ -2033,17 +2352,15 @@
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
 static struct fb_ops sisfb_ops = {
-	owner:		THIS_MODULE,
-	fb_get_fix:	sisfb_get_fix,
-	fb_get_var:	sisfb_get_var,
-	fb_set_var:	sisfb_set_var,
-	fb_get_cmap:	sisfb_get_cmap,
-	fb_set_cmap:	sisfb_set_cmap,
-#ifdef SISFB_PAN
-        fb_pan_display:	sisfb_pan_display,
-#endif
-	fb_ioctl:	sisfb_ioctl,
-	fb_mmap:	sisfb_mmap,
+	.owner		= THIS_MODULE,
+	.fb_get_fix	= sisfb_get_fix,
+	.fb_get_var	= sisfb_get_var,
+	.fb_set_var	= sisfb_set_var,
+	.fb_get_cmap	= sisfb_get_cmap,
+	.fb_set_cmap	= sisfb_set_cmap,
+        .fb_pan_display = sisfb_pan_display,
+	.fb_ioctl	= sisfb_ioctl,
+	.fb_mmap	= sisfb_mmap,
 };
 #endif
 
@@ -2056,9 +2373,7 @@
 	.fb_check_var = sisfb_check_var,
 	.fb_set_par   = sisfb_set_par,
 	.fb_setcolreg = sisfb_setcolreg,
-#ifdef SISFB_PAN
         .fb_pan_display = sisfb_pan_display,
-#endif	
         .fb_blank     = sisfb_blank,
 	.fb_fillrect  = fbcon_sis_fillrect,
 	.fb_copyarea  = fbcon_sis_copyarea,
@@ -2097,368 +2412,98 @@
 		break;
 	}
 
-	if (nbridge_id == 0) {  /* 300 */
-
-	        inSISIDXREG(SISSR, IND_SIS_DRAM_SIZE,reg);
-		ivideo.video_size =
-		        ((unsigned int) ((reg & SIS_DRAM_SIZE_MASK) + 1) << 20);
-
-	} else {		/* 540, 630, 730 */
-
-		pdev = pci_find_device(PCI_VENDOR_ID_SI, nbridge_id, pdev);
-		if (pdev) {
-			pci_read_config_byte(pdev, IND_BRI_DRAM_STATUS, &pci_data);
-			pci_data = (pci_data & BRI_DRAM_SIZE_MASK) >> 4;
-			ivideo.video_size = (unsigned int)(1 << (pci_data+21));
-			pdev_valid = 1;
-
-			reg = SIS_DATA_BUS_64 << 6;
-			switch (pci_data) {
-			   case BRI_DRAM_SIZE_2MB:
-				reg |= SIS_DRAM_SIZE_2MB;
-				break;
-			   case BRI_DRAM_SIZE_4MB:
-				reg |= SIS_DRAM_SIZE_4MB;
-				break;
-			   case BRI_DRAM_SIZE_8MB:
-				reg |= SIS_DRAM_SIZE_8MB;
-				break;
-			   case BRI_DRAM_SIZE_16MB:
-				reg |= SIS_DRAM_SIZE_16MB;
-				break;
-			   case BRI_DRAM_SIZE_32MB:
-				reg |= SIS_DRAM_SIZE_32MB;
-				break;
-			   case BRI_DRAM_SIZE_64MB:
-				reg |= SIS_DRAM_SIZE_64MB;
-				break;
-			}
-			outSISIDXREG(SISSR, IND_SIS_DRAM_SIZE, reg);
-		}
-	
-		if (!pdev_valid)  return -1;
-	}
-	return 0;
-}
-
-static void sisfb_detect_VB_connect_300()
-{
-	u8 sr16, sr17, cr32, temp;
-
-	ivideo.TV_plug = ivideo.TV_type = 0;
-
-        switch(ivideo.hasVB) {
-	  case HASVB_LVDS_CHRONTEL:
-	  case HASVB_CHRONTEL:
-	     SiS_SenseCh();
-	     break;
-	  case HASVB_301:
-	  case HASVB_302:
-	     SiS_Sense30x();
-	     break;
-	}
-
-	inSISIDXREG(SISSR, IND_SIS_SCRATCH_REG_17, sr17);
-        inSISIDXREG(SISCR, IND_SIS_SCRATCH_REG_CR32, cr32);
-
-	if ((sr17 & 0x0F) && (ivideo.chip != SIS_300)) {
-
-		if ((sr17 & 0x01) && !sisfb_crt1off)
-			sisfb_crt1off = 0;
-		else {
-			if (sr17 & 0x0E)
-				sisfb_crt1off = 1;
-			else
-				sisfb_crt1off = 0;
-		}
-
-		if (sisfb_crt2type != -1)
-			/* TW: override detected CRT2 type */
-			ivideo.disp_state = sisfb_crt2type;
-                else if (sr17 & 0x04)
-			ivideo.disp_state = DISPTYPE_TV;			
-		else if (sr17 & 0x02)
-			ivideo.disp_state = DISPTYPE_LCD;			
-		else if (sr17 & 0x08 )
-			ivideo.disp_state = DISPTYPE_CRT2;
-		else
-			ivideo.disp_state = 0;
-
-		if(sisfb_tvplug != -1)
-			/* PR/TW: override detected TV type */
-			ivideo.TV_plug = sisfb_tvplug;
-		else if (sr17 & 0x20)
-			ivideo.TV_plug = TVPLUG_SVIDEO;
-		else if (sr17 & 0x10)
-			ivideo.TV_plug = TVPLUG_COMPOSITE;
-
-		inSISIDXREG(SISSR, IND_SIS_SCRATCH_REG_16, sr16);
-		if (sr16 & 0x20)
-			ivideo.TV_type = TVMODE_PAL;
-		else
-			ivideo.TV_type = TVMODE_NTSC;
-
-	} else {
-
-		if ((cr32 & SIS_CRT1) && !sisfb_crt1off)
-			sisfb_crt1off = 0;
-		else {
-			if (cr32 & 0x5F)
-				sisfb_crt1off = 1;
-			else
-				sisfb_crt1off = 0;
-		}
-
-		if (sisfb_crt2type != -1)
-			/* TW: override detected CRT2 type */
-			ivideo.disp_state = sisfb_crt2type;
-		else if (cr32 & SIS_VB_TV)
-			ivideo.disp_state = DISPTYPE_TV;
-		else if (cr32 & SIS_VB_LCD)
-			ivideo.disp_state = DISPTYPE_LCD;
-		else if (cr32 & SIS_VB_CRT2)
-			ivideo.disp_state = DISPTYPE_CRT2;
-		else
-			ivideo.disp_state = 0;
-
-		/* TW: Detect TV plug & type */
-		if(sisfb_tvplug != -1)
-			/* PR/TW: override with option */
-		        ivideo.TV_plug = sisfb_tvplug;
-		else if (cr32 & SIS_VB_HIVISION) {
-			ivideo.TV_type = TVMODE_HIVISION;
-			ivideo.TV_plug = TVPLUG_SVIDEO;
-		}
-		else if (cr32 & SIS_VB_SVIDEO)
-			ivideo.TV_plug = TVPLUG_SVIDEO;
-		else if (cr32 & SIS_VB_COMPOSITE)
-			ivideo.TV_plug = TVPLUG_COMPOSITE;
-		else if (cr32 & SIS_VB_SCART)
-			ivideo.TV_plug = TVPLUG_SCART;
-
-		if (ivideo.TV_type == 0) {
-		        inSISIDXREG(SISSR, IND_SIS_POWER_ON_TRAP, temp);
-			if (temp & 0x01)
-				ivideo.TV_type = TVMODE_PAL;
-			else
-				ivideo.TV_type = TVMODE_NTSC;
-		}
-
-	}
-
-	/* TW: Copy forceCRT1 option to CRT1off if option is given */
-    	if (sisfb_forcecrt1 != -1) {
-    		if(sisfb_forcecrt1) sisfb_crt1off = 0;
-		else                sisfb_crt1off = 1;
-    	}
-}
-
-static void sisfb_get_VB_type_300(void)
-{
-	u8 reg;
-
-	if(ivideo.chip != SIS_300) {
-		if(!sisfb_has_VB_300()) {
-		        inSISIDXREG(SISCR, IND_SIS_SCRATCH_REG_CR37, reg);
-			switch ((reg & SIS_EXTERNAL_CHIP_MASK) >> 1) {
-			   case SIS_EXTERNAL_CHIP_LVDS:
-				ivideo.hasVB = HASVB_LVDS;
-				break;
-			   case SIS_EXTERNAL_CHIP_TRUMPION:
-				ivideo.hasVB = HASVB_TRUMPION;
-				break;
-			   case SIS_EXTERNAL_CHIP_LVDS_CHRONTEL:
-				ivideo.hasVB = HASVB_LVDS_CHRONTEL;
-				break;
-			   case SIS_EXTERNAL_CHIP_CHRONTEL:
-				ivideo.hasVB = HASVB_CHRONTEL;
-				break;
-			   default:
-				break;
-			}
-		}
-	} else {
-		sisfb_has_VB_300();
-	}
-}
-
-static int sisfb_has_VB_300(void)
-{
-	u8 vb_chipid;
-
-	inSISIDXREG(SISPART4, 0x00, vb_chipid);
-	switch (vb_chipid) {
-	   case 0x01:
-		ivideo.hasVB = HASVB_301;
-		break;
-	   case 0x02:
-		ivideo.hasVB = HASVB_302;
-		break;
-	   default:
-		ivideo.hasVB = HASVB_NONE;
-		return FALSE;
-	}
-	return TRUE;
-
-}
-
-#endif  /* CONFIG_FB_SIS_300 */
-
-
-#ifdef CONFIG_FB_SIS_315    /* for SiS 315/550/650/740/330 */
-
-static int sisfb_get_dram_size_315(void)
-{
-	struct pci_dev *pdev = NULL;
-	int pdev_valid = 0;
-	u8  pci_data;
-	u8  reg = 0;
+	if (nbridge_id == 0) {  /* 300 */
 
-	if (ivideo.chip == SIS_550 || ivideo.chip == SIS_650 || ivideo.chip == SIS_740) {
+	        inSISIDXREG(SISSR, IND_SIS_DRAM_SIZE,reg);
+		ivideo.video_size =
+		        ((unsigned int) ((reg & SIS_DRAM_SIZE_MASK) + 1) << 20);
 
-#ifdef LINUXBIOS
+	} else {		/* 540, 630, 730 */
 
-		while ((pdev = pci_find_device(PCI_VENDOR_ID_SI, PCI_ANY_ID, pdev)) != NULL) {
-			if ((pdev->device == PCI_DEVICE_ID_SI_550) ||
-			     (pdev->device == PCI_DEVICE_ID_SI_650) ||
-			     (pdev->device == PCI_DEVICE_ID_SI_740)) {
-				pci_read_config_byte(pdev, IND_BRI_DRAM_STATUS,
-				                     &pci_data);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,74)
+		pci_for_each_dev(pdev) {
+#else
+		while((pdev = pci_find_device(PCI_VENDOR_ID_SI, PCI_ANY_ID, pdev))) {
+#endif
+			if ((pdev->vendor == PCI_VENDOR_ID_SI)
+				       && (pdev->device == nbridge_id)) {
+				pci_read_config_byte(pdev, IND_BRI_DRAM_STATUS, &pci_data);
 				pci_data = (pci_data & BRI_DRAM_SIZE_MASK) >> 4;
-				ivideo.video_size = (unsigned int)(1 << (pci_data + 21));
+				ivideo.video_size = (unsigned int)(1 << (pci_data+21));
 				pdev_valid = 1;
 
-				/* TW: Initialize SR14 "by hand" */
-				inSISIDXREG(SISSR, IND_SIS_DRAM_SIZE, reg);
-				reg &= 0xC0;
+				reg = SIS_DATA_BUS_64 << 6;
 				switch (pci_data) {
+				   case BRI_DRAM_SIZE_2MB:
+					reg |= SIS_DRAM_SIZE_2MB;
+					break;
 				   case BRI_DRAM_SIZE_4MB:
-					reg |= SIS550_DRAM_SIZE_4MB;
+					reg |= SIS_DRAM_SIZE_4MB;
 					break;
 				   case BRI_DRAM_SIZE_8MB:
-					reg |= SIS550_DRAM_SIZE_8MB;
+					reg |= SIS_DRAM_SIZE_8MB;
 					break;
 				   case BRI_DRAM_SIZE_16MB:
-					reg |= SIS550_DRAM_SIZE_16MB;
+					reg |= SIS_DRAM_SIZE_16MB;
 					break;
 				   case BRI_DRAM_SIZE_32MB:
-					reg |= SIS550_DRAM_SIZE_32MB;
+					reg |= SIS_DRAM_SIZE_32MB;
 					break;
 				   case BRI_DRAM_SIZE_64MB:
-					reg |= SIS550_DRAM_SIZE_64MB;
+					reg |= SIS_DRAM_SIZE_64MB;
 					break;
 				}
-
-			        /* TODO: set Dual channel and bus width bits here */
-
 				outSISIDXREG(SISSR, IND_SIS_DRAM_SIZE, reg);
 				break;
 			}  
 		}
 	
 		if (!pdev_valid)  return -1;
+	}
+	return 0;
+}
 
-#else
+#endif  /* CONFIG_FB_SIS_300 */
+
+
+#ifdef CONFIG_FB_SIS_315    /* for SiS 315/550/650/740/330/661/741/760 */
+
+static int sisfb_get_dram_size_315(void)
+{
+	u8  reg = 0;
+
+	if(ivideo.chip == SIS_550 ||
+	   ivideo.chip == SIS_650 ||
+	   ivideo.chip == SIS_740) {
 
                 inSISIDXREG(SISSR, IND_SIS_DRAM_SIZE, reg);
-		switch (reg & SIS550_DRAM_SIZE_MASK) {
-		   case SIS550_DRAM_SIZE_4MB:
-			ivideo.video_size = 0x400000;   break;
-		   case SIS550_DRAM_SIZE_8MB:
-			ivideo.video_size = 0x800000;   break;
-		   case SIS550_DRAM_SIZE_16MB:
-			ivideo.video_size = 0x1000000;  break;
-		   case SIS550_DRAM_SIZE_24MB:
-			ivideo.video_size = 0x1800000;  break;
-		   case SIS550_DRAM_SIZE_32MB:
-			ivideo.video_size = 0x2000000;	break;
-		   case SIS550_DRAM_SIZE_64MB:
-			ivideo.video_size = 0x4000000;	break;
-		   case SIS550_DRAM_SIZE_96MB:
-			ivideo.video_size = 0x6000000;	break;
-		   case SIS550_DRAM_SIZE_128MB:
-			ivideo.video_size = 0x8000000;	break;
-		   case SIS550_DRAM_SIZE_256MB:
-			ivideo.video_size = 0x10000000;	break;
-		   default:
-		        /* TW: Some 550 BIOSes don't seem to initialize SR14 correctly (if at all),
-			 *     do it the hard way ourselves in this case. Unfortunately, we don't
-			 *     support 24, 48, 96 and other "odd" amounts here.
-			 */
-		        printk(KERN_INFO
-			       "sisfb: Warning: Could not determine memory size, "
-			       "now reading from PCI config\n");
-			pdev_valid = 0;
-
-			while ((pdev = pci_find_device(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_550, pdev)) != NULL) {
-				pci_read_config_byte(pdev, IND_BRI_DRAM_STATUS,
-				                     &pci_data);
-				pci_data = (pci_data & BRI_DRAM_SIZE_MASK) >> 4;
-				ivideo.video_size = (unsigned int)(1 << (pci_data+21));
-				pdev_valid = 1;
-				/* TW: Initialize SR14=IND_SIS_DRAM_SIZE */
-				inSISIDXREG(SISSR, IND_SIS_DRAM_SIZE, reg);
-				reg &= 0xC0;
-				switch (pci_data) {
-				   case BRI_DRAM_SIZE_4MB:
-					reg |= SIS550_DRAM_SIZE_4MB;  break;
-				   case BRI_DRAM_SIZE_8MB:
-					reg |= SIS550_DRAM_SIZE_8MB;  break;
-				   case BRI_DRAM_SIZE_16MB:
-					reg |= SIS550_DRAM_SIZE_16MB; break;
-				   case BRI_DRAM_SIZE_32MB:
-					reg |= SIS550_DRAM_SIZE_32MB; break;
-				   case BRI_DRAM_SIZE_64MB:
-					reg |= SIS550_DRAM_SIZE_64MB; break;
-				   default:
-				   	printk(KERN_INFO "sisfb: Unable to determine memory size, giving up.\n");
-					return -1;
-				}
-				outSISIDXREG(SISSR, IND_SIS_DRAM_SIZE, reg);
-			}
-			if (!pdev_valid) {
-				printk(KERN_INFO "sisfb: Total confusion - No SiS PCI VGA device found?!\n");
-				return -1;
-			}
-			return 0;
-		}
-#endif
+		reg &= 0x3f;
+		reg++;
+		reg <<= 2;
+		ivideo.video_size = reg << 20;
 		return 0;
 
-	} else {	/* 315 */
+	} else if(ivideo.chip == SIS_661 ||
+	          ivideo.chip == SIS_741 ||
+		  ivideo.chip == SIS_660 ||
+		  ivideo.chip == SIS_760) {
+
+		inSISIDXREG(SISCR, 0x79, reg);
+		reg &= 0xf0;
+		reg >>= 4;
+		ivideo.video_size = (1 << reg) << 20;
+		return 0;
+
+	} else {	/* 315, 330 */
 
 	        inSISIDXREG(SISSR, IND_SIS_DRAM_SIZE, reg);
-		switch ((reg & SIS315_DRAM_SIZE_MASK) >> 4) {
-		   case SIS315_DRAM_SIZE_2MB:
-			ivideo.video_size = 0x200000;
-			break;
-		   case SIS315_DRAM_SIZE_4MB:
-			ivideo.video_size = 0x400000;
-			break;
-		   case SIS315_DRAM_SIZE_8MB:
-			ivideo.video_size = 0x800000;
-			break;
-		   case SIS315_DRAM_SIZE_16MB:
-			ivideo.video_size = 0x1000000;
-			break;
-		   case SIS315_DRAM_SIZE_32MB:
-			ivideo.video_size = 0x2000000;
-			break;
-		   case SIS315_DRAM_SIZE_64MB:
-			ivideo.video_size = 0x4000000;
-			break;
-		   case SIS315_DRAM_SIZE_128MB:
-			ivideo.video_size = 0x8000000;
-			break;
-		   default:
-			return -1;
-		}
-		
+		ivideo.video_size = (1 << ((reg & 0xf0) >> 4)) << 20;
+
 		reg &= SIS315_DUAL_CHANNEL_MASK;
 		reg >>= 2;
-		
+
 		if(ivideo.chip == SIS_330) {
-		
+
 		   if(reg) ivideo.video_size <<= 1;
 		
 		} else {
@@ -2470,7 +2515,7 @@
 		      case SIS315_DUAL_CHANNEL_1_RANK:
 			   ivideo.video_size <<= 1;
 			   break;
-		      case SIS315_ASYM_DDR:		/* TW: DDR asymentric */
+		      case SIS315_ASYM_DDR:		/* TW: DDR asymetric */
 			   ivideo.video_size += (ivideo.video_size/2);
 			   break;
 		   }
@@ -2483,312 +2528,581 @@
 	
 }
 
-static void sisfb_detect_VB_connect_315(void)
+#endif   /* CONFIG_FB_SIS_315 */
+
+
+/* -------------- video bridge detection --------------- */
+
+static void sisfb_detect_VB_connect()
 {
-	u8 cr32, temp=0;
+	u8 sr16, sr17, cr32, temp;
+
+	if(sisvga_engine == SIS_300_VGA) {
 
-	ivideo.TV_plug = ivideo.TV_type = 0;
+		inSISIDXREG(SISSR, IND_SIS_SCRATCH_REG_17, sr17);
+
+		if ((sr17 & 0x0F) && (ivideo.chip != SIS_300)) {
+
+			/* Old BIOSes store the detected CRT2 type in SR17
+		 	 * instead of CR32. However, since our detection
+			 * routines store their results to CR32, we now copy
+			 * the remaining bits (for LCD and VGA) to CR32 for
+			 * unified usage.
+			 * SR17[0] CRT1    [1] LCD     [2] TV    [3] VGA2
+			 *     [4] AVIDEO  [5] SVIDEO
+			 */
+
+#if 0
+			if (sr17 & 0x01) orSISIDXREG(SISCR, 0x32, SIS_CRT1);
+			else		 andSISIDXREG(SISCR, 0x32, ~SIS_CRT1);
+
+			if (sr17 & 0x02) orSISIDXREG(SISCR, 0x32, SIS_VB_LCD);
+			else		 andSISIDXREG(SISCR, 0x32, ~SIS_VB_LCD);
+
+			/* no HiVision and no DVI connector here */
+			andSISIDXREG(SISCR, 0x32, ~0xc0);
+#endif
+
+			/* PAL/NTSC is stored on SR16 on such machines */
+			if (!(ivideo.vbflags & (TV_PAL | TV_NTSC))) {
+		   		inSISIDXREG(SISSR, IND_SIS_SCRATCH_REG_16, sr16);
+				if (sr16 & 0x20)
+					ivideo.vbflags |= TV_PAL;
+				else
+					ivideo.vbflags |= TV_NTSC;
+			}
+
+		}
 
-        switch(ivideo.hasVB) {
-	  case HASVB_LVDS_CHRONTEL:
-	  case HASVB_CHRONTEL:
-	     SiS_SenseCh();
-	     break;
-	  case HASVB_301:
-	  case HASVB_302:
-	     SiS_Sense30x();
-	     break;
 	}
 
 	inSISIDXREG(SISCR, IND_SIS_SCRATCH_REG_CR32, cr32);
 
-	if ((cr32 & SIS_CRT1) && !sisfb_crt1off)
+	if (cr32 & SIS_CRT1)
 		sisfb_crt1off = 0;
 	else {
-		if (cr32 & 0x5F)   
+		if (cr32 & 0x5F)
 			sisfb_crt1off = 1;
 		else
 			sisfb_crt1off = 0;
 	}
 
-	if (sisfb_crt2type != -1)
-		/* TW: Override with option */
-		ivideo.disp_state = sisfb_crt2type;
-	else if (cr32 & SIS_VB_TV)
-		ivideo.disp_state = DISPTYPE_TV;		
-	else if (cr32 & SIS_VB_LCD)
-		ivideo.disp_state = DISPTYPE_LCD;		
-	else if (cr32 & SIS_VB_CRT2)
-		ivideo.disp_state = DISPTYPE_CRT2;
-	else
-		ivideo.disp_state = 0;
+	ivideo.vbflags &= ~(CRT2_TV | CRT2_LCD | CRT2_VGA);
 
+	if (cr32 & SIS_VB_TV)
+		ivideo.vbflags |= CRT2_TV;
+	if (cr32 & SIS_VB_LCD)
+		ivideo.vbflags |= CRT2_LCD;
+	if (cr32 & SIS_VB_CRT2)
+		ivideo.vbflags |= CRT2_VGA;
+
+	/* TW: Detect/set TV plug & type */
 	if(sisfb_tvplug != -1)
-		/* PR/TW: Override with option */
-	        ivideo.TV_plug = sisfb_tvplug;
-	else if (cr32 & SIS_VB_HIVISION) {
-		ivideo.TV_type = TVMODE_HIVISION;
-		ivideo.TV_plug = TVPLUG_SVIDEO;
-	}
-	else if (cr32 & SIS_VB_SVIDEO)
-		ivideo.TV_plug = TVPLUG_SVIDEO;
+	        ivideo.vbflags |= sisfb_tvplug;
+
+	if (cr32 & SIS_VB_SVIDEO)
+		ivideo.vbflags |= TV_SVIDEO;
 	else if (cr32 & SIS_VB_COMPOSITE)
-		ivideo.TV_plug = TVPLUG_COMPOSITE;
+		ivideo.vbflags |= TV_AVIDEO;
 	else if (cr32 & SIS_VB_SCART)
-		ivideo.TV_plug = TVPLUG_SCART;
+		ivideo.vbflags |= TV_SCART;
 
-	if(ivideo.TV_type == 0) {
-	    /* TW: PAL/NTSC changed for 650 */
-	    if((ivideo.chip <= SIS_315PRO) || (ivideo.chip >= SIS_330)) {
-
-                inSISIDXREG(SISCR, 0x38, temp);
-		if(temp & 0x10)
-			ivideo.TV_type = TVMODE_PAL;
-		else
-			ivideo.TV_type = TVMODE_NTSC;
+	if (!(ivideo.vbflags & (TV_PAL | TV_NTSC))) {
+		if(sisvga_engine == SIS_300_VGA) {
+	        	inSISIDXREG(SISSR, IND_SIS_POWER_ON_TRAP, temp);
+			if (temp & 0x01)
+				ivideo.vbflags |= TV_PAL;
+			else
+				ivideo.vbflags |= TV_NTSC;
+		} else if((ivideo.chip <= SIS_315PRO) || (ivideo.chip >= SIS_330)) {
 
-	    } else {
+                	inSISIDXREG(SISSR, 0x38, temp);
+			if(temp & 0x01)
+				ivideo.vbflags |= TV_PAL;
+			else
+				ivideo.vbflags |= TV_NTSC;
 
-	        inSISIDXREG(SISCR, 0x79, temp);
-		if(temp & 0x20)
-			ivideo.TV_type = TVMODE_PAL;
-		else
-			ivideo.TV_type = TVMODE_NTSC;
-	    }
+	    	} else {
+
+	        	inSISIDXREG(SISCR, 0x79, temp);
+			if(temp & 0x20)
+				ivideo.vbflags |= TV_PAL;
+			else
+				ivideo.vbflags |= TV_NTSC;
+	    	}
 	}
 
 	/* TW: Copy forceCRT1 option to CRT1off if option is given */
     	if (sisfb_forcecrt1 != -1) {
-    		if (sisfb_forcecrt1) sisfb_crt1off = 0;
-		else   	             sisfb_crt1off = 1;
+    		if(sisfb_forcecrt1) sisfb_crt1off = 0;
+		else                sisfb_crt1off = 1;
     	}
-}
-
-static void sisfb_get_VB_type_315(void)
-{
-	u8 reg;
 
-	if (!sisfb_has_VB_315()) {
-	        inSISIDXREG(SISCR, IND_SIS_SCRATCH_REG_CR37, reg);
-		switch ((reg & SIS_EXTERNAL_CHIP_MASK) >> 1) {
-	 	   case SIS310_EXTERNAL_CHIP_LVDS:
-			ivideo.hasVB = HASVB_LVDS;
-			break;
-		   case SIS310_EXTERNAL_CHIP_LVDS_CHRONTEL:
-			ivideo.hasVB = HASVB_LVDS_CHRONTEL;
-			break;
-		   default:
-			break;
-		}
-	}
 }
 
-
-static int sisfb_has_VB_315(void)
+static void sisfb_get_VB_type(void)
 {
 	u8 vb_chipid;
+	u8 reg;
+	char stdstr[]    = "sisfb: Detected";
+	char bridgestr[] = "video bridge";
+	char lvdsstr[]   = "LVDS transmitter";
+  	char chrstr[]    = "Chrontel TV encoder";
+
+	ivideo.hasVB = HASVB_NONE;
+	sishw_ext.ujVBChipID = VB_CHIP_UNKNOWN;
+	sishw_ext.Is301BDH = FALSE;
+	sishw_ext.usExternalChip = 0;
 
 	inSISIDXREG(SISPART4, 0x00, vb_chipid);
 	switch (vb_chipid) {
 	   case 0x01:
 		ivideo.hasVB = HASVB_301;
+		inSISIDXREG(SISPART4, 0x01, reg);
+		if(reg < 0xb0) {
+			ivideo.vbflags |= VB_301;
+			sishw_ext.ujVBChipID = VB_CHIP_301;
+			printk(KERN_INFO "%s SiS301 %s\n", stdstr, bridgestr);
+		} else if(reg < 0xc0) {
+		 	ivideo.vbflags |= VB_301B;
+			sishw_ext.ujVBChipID = VB_CHIP_301B;
+			inSISIDXREG(SISPART4,0x23,reg);
+			if(!(reg & 0x02)) {
+			   sishw_ext.Is301BDH = TRUE;
+			   ivideo.vbflags |= VB_30xBDH;
+			   printk(KERN_INFO "%s SiS301B-DH %s\n", stdstr, bridgestr);
+			} else {
+			   printk(KERN_INFO "%s SiS301B %s\n", stdstr, bridgestr);
+			}
+		} else if(reg < 0xd0) {
+		 	ivideo.vbflags |= VB_301C;
+			sishw_ext.ujVBChipID = VB_CHIP_301C;
+			printk(KERN_INFO "%s SiS301C %s\n", stdstr, bridgestr);
+		} else if(reg < 0xe0) {
+			ivideo.vbflags |= VB_301LV;
+			sishw_ext.ujVBChipID = VB_CHIP_301LV;
+			printk(KERN_INFO "%s SiS301LV %s\n", stdstr, bridgestr);
+		} else if(reg <= 0xe1) {
+		        inSISIDXREG(SISPART4,0x39,reg);
+			if(reg == 0xff) {
+			   ivideo.vbflags |= VB_302LV;
+			   sishw_ext.ujVBChipID = VB_CHIP_302LV;
+			   printk(KERN_INFO "%s SiS302LV %s\n", stdstr, bridgestr);
+			} else {
+			   ivideo.vbflags |= VB_302ELV;
+			   sishw_ext.ujVBChipID = VB_CHIP_302ELV;
+			   printk(KERN_INFO "%s SiS302ELV %s\n", stdstr, bridgestr);
+			}
+		}
 		break;
 	   case 0x02:
 		ivideo.hasVB = HASVB_302;
+		inSISIDXREG(SISPART4, 0x01, reg);
+		if(reg < 0xd0) {
+			ivideo.vbflags |= VB_302B;
+			sishw_ext.ujVBChipID = VB_CHIP_302B;
+			inSISIDXREG(SISPART4,0x23,reg);
+		  	if(!(reg & 0x02)) {
+			   sishw_ext.Is301BDH = TRUE;
+			   ivideo.vbflags |= VB_30xBDH;
+			   printk(KERN_INFO "%s SiS302B-DH %s\n", stdstr, bridgestr);
+			} else {
+			   printk(KERN_INFO "%s SiS302B %s\n", stdstr, bridgestr);
+			}
+		} else if(reg < 0xe0) {
+		 	ivideo.vbflags |= VB_301LV;
+			sishw_ext.ujVBChipID = VB_CHIP_301LV;
+			printk(KERN_INFO "%s SiS301LV %s\n", stdstr, bridgestr);
+		} else if(reg <= 0xe1) {
+			ivideo.vbflags |= VB_302LV;
+			sishw_ext.ujVBChipID = VB_CHIP_302LV;
+			printk(KERN_INFO "%s SiS302LV %s\n", stdstr, bridgestr);
+		}
 		break;
-	   default:
-		ivideo.hasVB = HASVB_NONE;
-		return FALSE;
 	}
-	return TRUE;
-}
 
-#endif   /* CONFIG_FB_SIS_315 */
+	if((!(ivideo.vbflags & VB_VIDEOBRIDGE)) && (ivideo.chip != SIS_300)) {
+		inSISIDXREG(SISCR, IND_SIS_SCRATCH_REG_CR37, reg);
+		reg &= SIS_EXTERNAL_CHIP_MASK;
+		reg >>= 1;
+		if(sisvga_engine == SIS_300_VGA) {
+			switch (reg) {
+			   case SIS_EXTERNAL_CHIP_LVDS:
+				ivideo.hasVB = HASVB_LVDS;
+				ivideo.vbflags |= VB_LVDS;
+				sishw_ext.usExternalChip = 0x01;
+				printk(KERN_INFO "%s %s\n", stdstr, lvdsstr);
+				break;
+			   case SIS_EXTERNAL_CHIP_TRUMPION:
+				ivideo.hasVB = HASVB_TRUMPION;
+				sishw_ext.usExternalChip = 0x02;
+				printk(KERN_INFO "%s Trumpion LCD scaler\n", stdstr);
+				break;
+			   case SIS_EXTERNAL_CHIP_CHRONTEL:
+				ivideo.hasVB = HASVB_CHRONTEL;
+				ivideo.vbflags |= VB_CHRONTEL;
+				sishw_ext.usExternalChip = 0x04;
+				printk(KERN_INFO "%s %s\n", stdstr, chrstr);
+				break;
+			   case SIS_EXTERNAL_CHIP_LVDS_CHRONTEL:
+				ivideo.hasVB = HASVB_LVDS_CHRONTEL;
+				ivideo.vbflags |= (VB_LVDS | VB_CHRONTEL);
+				sishw_ext.usExternalChip = 0x05;
+				printk(KERN_INFO "%s %s and %s\n", stdstr, lvdsstr, chrstr);
+				break;
+			}
+		} else if(ivideo.chip < SIS_661) {
+			switch (reg) {
+	 	   	   case SIS310_EXTERNAL_CHIP_LVDS:
+				ivideo.hasVB = HASVB_LVDS;
+				ivideo.vbflags |= VB_LVDS;
+				sishw_ext.usExternalChip = 0x01;
+				printk(KERN_INFO "%s %s\n", stdstr, lvdsstr);
+				break;
+		   	   case SIS310_EXTERNAL_CHIP_LVDS_CHRONTEL:
+				ivideo.hasVB = HASVB_LVDS_CHRONTEL;
+				ivideo.vbflags |= (VB_LVDS | VB_CHRONTEL);
+				sishw_ext.usExternalChip = 0x05;
+				printk(KERN_INFO "%s %s and %s\n", stdstr, lvdsstr, chrstr);
+				break;
+			}
+		}
+
+	}
+
+	if(ivideo.vbflags & VB_SISBRIDGE) {
+		SiS_Sense30x();
+	} else if(ivideo.vbflags & VB_CHRONTEL) {
+		SiS_SenseCh();
+	}
+
+}
 
 /* ------------------ Sensing routines ------------------ */
 
-/* TW: Determine and detect attached devices on SiS30x */
-int
+static BOOLEAN
+sisfb_test_DDC1(void)
+{
+    unsigned short old;
+    int count = 48;
+
+    old = SiS_ReadDDC1Bit(&SiS_Pr);
+    do {
+       if(old != SiS_ReadDDC1Bit(&SiS_Pr)) break;
+    } while(count--);
+    return (count == -1) ? FALSE : TRUE;
+}
+
+static void
+sisfb_sense_crt1(void)
+{
+    unsigned char SR1F, CR63=0, CR17;
+    unsigned short temp = 0xffff;
+    int i;
+    BOOLEAN mustwait = FALSE;
+
+    inSISIDXREG(SISSR,0x1F,SR1F);
+    orSISIDXREG(SISSR,0x1F,0x04);
+    andSISIDXREG(SISSR,0x1F,0x3F);
+    if(SR1F & 0xc0) mustwait = TRUE;
+
+    if(sisvga_engine == SIS_315_VGA) {
+       inSISIDXREG(SISCR,SiS_Pr.SiS_MyCR63,CR63);
+       CR63 &= 0x40;
+       andSISIDXREG(SISCR,SiS_Pr.SiS_MyCR63,0xBF);
+    }
+
+    inSISIDXREG(SISCR,0x17,CR17);
+    CR17 &= 0x80;
+    if(!CR17) {
+       orSISIDXREG(SISCR,0x17,0x80);
+       mustwait = TRUE;
+       outSISIDXREG(SISSR, 0x00, 0x01);
+       outSISIDXREG(SISSR, 0x00, 0x03);
+    }
+
+    if(mustwait) {
+       for(i=0; i < 10; i++) sisfbwaitretracecrt1();
+    }
+
+    i = 3;
+    do {
+       temp = SiS_HandleDDC(&SiS_Pr, ivideo.vbflags, sisvga_engine, 0, 0, NULL);
+    } while(((temp == 0) || (temp == 0xffff)) && i--);
+
+    if((temp == 0) || (temp == 0xffff)) {
+       if(sisfb_test_DDC1()) temp = 1;
+    }
+
+    if((temp) && (temp != 0xffff)) {
+       orSISIDXREG(SISCR,0x32,0x20);
+    }
+
+    if(sisvga_engine == SIS_315_VGA) {
+       setSISIDXREG(SISCR,SiS_Pr.SiS_MyCR63,0xBF,CR63);
+    }
+
+    setSISIDXREG(SISCR,0x17,0x7F,CR17);
+
+    outSISIDXREG(SISSR,0x1F,SR1F);
+}
+
+/* Determine and detect attached devices on SiS30x */
+static int
 SISDoSense(int tempbl, int tempbh, int tempcl, int tempch)
 {
-    int temp,i;
+    int temp;
 
     outSISIDXREG(SISPART4,0x11,tempbl);
     temp = tempbh | tempcl;
     setSISIDXREG(SISPART4,0x10,0xe0,temp);
-    for(i=0; i<10; i++) SiS_LongWait(&SiS_Pr);
+    SiS_DDC2Delay(&SiS_Pr, 0x1000);
     tempch &= 0x7f;
     inSISIDXREG(SISPART4,0x03,temp);
     temp ^= 0x0e;
     temp &= tempch;
-    return(temp);
+    return((temp == tempch));
 }
 
-void
+static void
 SiS_Sense30x(void)
 {
-  u8 backupP4_0d;
-  u8 testsvhs_tempbl, testsvhs_tempbh;
-  u8 testsvhs_tempcl, testsvhs_tempch;
-  u8 testcvbs_tempbl, testcvbs_tempbh;
-  u8 testcvbs_tempcl, testcvbs_tempch;
-  u8 testvga2_tempbl, testvga2_tempbh;
-  u8 testvga2_tempcl, testvga2_tempch;
-  int myflag, result;
+  u8 backupP4_0d,backupP2_00;
+  u8 svhs_bl, svhs_bh;
+  u8 svhs_cl, svhs_ch;
+  u8 cvbs_bl, cvbs_bh;
+  u8 cvbs_cl, cvbs_ch;
+  u8 vga2_bl, vga2_bh;
+  u8 vga2_cl, vga2_ch;
+  int myflag, result, haveresult, i, j;
+  char stdstr[] = "sisfb: Detected";
+  char tvstr[]  = "TV connected to";
 
   inSISIDXREG(SISPART4,0x0d,backupP4_0d);
-  outSISIDXREG(SISPART4,0x0d,(backupP4_0d | 0x04));
+  if(!(ivideo.vbflags & (VB_301C|VB_302ELV))) {
+     outSISIDXREG(SISPART4,0x0d,(backupP4_0d | 0x04));
+  }
+
+  inSISIDXREG(SISPART2,0x00,backupP2_00);
+  outSISIDXREG(SISPART2,0x00,(backupP2_00 | 0x1c));
 
   if(sisvga_engine == SIS_300_VGA) {
 
-  	testvga2_tempbh = 0x00; testvga2_tempbl = 0xd1;
-        testsvhs_tempbh = 0x00; testsvhs_tempbl = 0xb9;
-	testcvbs_tempbh = 0x00; testcvbs_tempbl = 0xb3;
-	if((sishw_ext.ujVBChipID != VB_CHIP_301) &&
-	   (sishw_ext.ujVBChipID != VB_CHIP_302) ) {
-	   testvga2_tempbh = 0x01; testvga2_tempbl = 0x90;
-	   testsvhs_tempbh = 0x01; testsvhs_tempbl = 0x6b;
-	   testcvbs_tempbh = 0x01; testcvbs_tempbl = 0x74;
+	if(ivideo.vbflags & (VB_301B|VB_301C|VB_302B|VB_301LV|VB_302LV)) {
+	   	vga2_bh = 0x01; vga2_bl = 0x90;
+	   	svhs_bh = 0x01; svhs_bl = 0x6b;
+	   	cvbs_bh = 0x01; cvbs_bl = 0x74;
+	} else {
+		vga2_bh = 0x00; vga2_bl = 0xd1;
+        	svhs_bh = 0x00; svhs_bl = 0xb9;
+		cvbs_bh = 0x00; cvbs_bl = 0xb3;
 	}
 	inSISIDXREG(SISPART4,0x01,myflag);
 	if(myflag & 0x04) {
-	   testvga2_tempbh = 0x00; testvga2_tempbl = 0xfd;
-	   testsvhs_tempbh = 0x00; testsvhs_tempbl = 0xdd;
-	   testcvbs_tempbh = 0x00; testcvbs_tempbl = 0xee;
-	}
-	testvga2_tempch = 0x0e;	testvga2_tempcl = 0x08;
-	testsvhs_tempch = 0x06;	testsvhs_tempcl = 0x04;
-	testcvbs_tempch = 0x08; testcvbs_tempcl = 0x04;
+	   vga2_bh = 0x00; vga2_bl = 0xfd;
+	   svhs_bh = 0x00; svhs_bl = 0xdd;
+	   cvbs_bh = 0x00; cvbs_bl = 0xee;
+	}
+	vga2_ch = 0x0e;	vga2_cl = 0x08;
+	svhs_ch = 0x04;	svhs_cl = 0x04;
+	cvbs_ch = 0x08; cvbs_cl = 0x04;
+	if(ivideo.vbflags & (VB_301LV|VB_302LV)) {
+	   	vga2_bh = 0x00; vga2_bl = 0x00;
+	   	vga2_ch = 0x00; vga2_cl = 0x00;
+	 }
 	if(ivideo.chip == SIS_300) {
 	   inSISIDXREG(SISSR,0x3b,myflag);
 	   if(!(myflag & 0x01)) {
-	      testvga2_tempbh = 0x00; testvga2_tempbl = 0x00;
-	      testvga2_tempch = 0x00; testvga2_tempcl = 0x00;
+	      	vga2_bh = 0x00; vga2_bl = 0x00;
+	      	vga2_ch = 0x00; vga2_cl = 0x00;
 	   }
 	}
 
   } else {
 
-	testvga2_tempbh = 0x00; testvga2_tempbl = 0xd1;
-        testsvhs_tempbh = 0x00; testsvhs_tempbl = 0xb9;
-	testcvbs_tempbh = 0x00; testcvbs_tempbl = 0xb3;
-	if((sishw_ext.ujVBChipID != VB_CHIP_301) &&
-	   (sishw_ext.ujVBChipID != VB_CHIP_302)) {
-	      testvga2_tempbh = 0x01; testvga2_tempbl = 0x90;
-	      testsvhs_tempbh = 0x01; testsvhs_tempbl = 0x6b;
-	      testcvbs_tempbh = 0x01; testcvbs_tempbl = 0x74;
-	      if(sishw_ext.ujVBChipID == VB_CHIP_301LV ||
-	         sishw_ext.ujVBChipID == VB_CHIP_302LV) {
-	         testvga2_tempbh = 0x00; testvga2_tempbl = 0x00;
-	         testsvhs_tempbh = 0x02; testsvhs_tempbl = 0x00;
-	         testcvbs_tempbh = 0x01; testcvbs_tempbl = 0x00;
-	      }
-	}
-	if(sishw_ext.ujVBChipID != VB_CHIP_301LV &&
-	   sishw_ext.ujVBChipID != VB_CHIP_302LV) {
-	   inSISIDXREG(SISPART4,0x01,myflag);
-	   if(myflag & 0x04) {
-	      testvga2_tempbh = 0x00; testvga2_tempbl = 0xfd;
-	      testsvhs_tempbh = 0x00; testsvhs_tempbl = 0xdd;
-	      testcvbs_tempbh = 0x00; testcvbs_tempbl = 0xee;
-	   }
+	if(ivideo.vbflags & (VB_301B|VB_302B)) {
+		vga2_bh = 0x01; vga2_bl = 0x90;
+		svhs_bh = 0x01; svhs_bl = 0x6b;
+		cvbs_bh = 0x01; cvbs_bl = 0x74;
+	} else if(ivideo.vbflags & (VB_301C|VB_302ELV)) {
+	      	vga2_bh = 0x01; vga2_bl = 0x90;
+	      	svhs_bh = 0x01; svhs_bl = 0x6b;
+	      	cvbs_bh = 0x01; cvbs_bl = 0x10;
+	} else if(ivideo.vbflags & (VB_301LV|VB_302LV)) {
+	      	vga2_bh = 0x00; vga2_bl = 0x00;
+	      	svhs_bh = 0x02; svhs_bl = 0x00;
+	      	cvbs_bh = 0x01; cvbs_bl = 0x00;
+	} else {
+		vga2_bh = 0x00; vga2_bl = 0xd1;
+        	svhs_bh = 0x00; svhs_bl = 0xb9;
+		cvbs_bh = 0x00; cvbs_bl = 0xb3;
+		inSISIDXREG(SISPART4,0x01,myflag);
+	        if(myflag & 0x04) {
+	           vga2_bh = 0x00; vga2_bl = 0xfd;
+	           svhs_bh = 0x00; svhs_bl = 0xdd;
+	           cvbs_bh = 0x00; cvbs_bl = 0xee;
+	        }
 	}
-	if((sishw_ext.ujVBChipID == VB_CHIP_301LV) ||
-	   (sishw_ext.ujVBChipID == VB_CHIP_302LV) ) {
-	   testvga2_tempbh = 0x00; testvga2_tempbl = 0x00;
-	   testvga2_tempch = 0x00; testvga2_tempcl = 0x00;
-	   testsvhs_tempch = 0x04; testsvhs_tempcl = 0x08;
-	   testcvbs_tempch = 0x08; testcvbs_tempcl = 0x08;
+
+	if(ivideo.vbflags & (VB_301LV|VB_302LV|VB_302ELV)) {
+	   vga2_bh = 0x00; vga2_bl = 0x00;
+	   vga2_ch = 0x00; vga2_cl = 0x00;
+	   svhs_ch = 0x04; svhs_cl = 0x08;
+	   cvbs_ch = 0x08; cvbs_cl = 0x08;
 	} else {
-	   testvga2_tempch = 0x0e; testvga2_tempcl = 0x08;
-	   testsvhs_tempch = 0x06; testsvhs_tempcl = 0x04;
-	   testcvbs_tempch = 0x08; testcvbs_tempcl = 0x04;
+	   vga2_ch = 0x0e; vga2_cl = 0x08;
+	   svhs_ch = 0x04; svhs_cl = 0x04;
+	   cvbs_ch = 0x08; cvbs_cl = 0x04;
 	}
     } 
 
-    if(testvga2_tempch || testvga2_tempcl || testvga2_tempbh || testvga2_tempbl) {
-        result = SISDoSense(testvga2_tempbl, testvga2_tempbh,
-                            testvga2_tempcl, testvga2_tempch);
- 	if(result) {
-        	printk(KERN_INFO "sisfb: Detected secondary VGA connection\n");
-		orSISIDXREG(SISCR, 0x32, 0x10);
-	}
+    if(vga2_ch || vga2_cl || vga2_bh || vga2_bl) {
+       haveresult = 0;
+       for(j = 0; j < 10; j++) {
+          result = 0;
+          for(i = 0; i < 3; i++) {
+             if(SISDoSense(vga2_bl, vga2_bh, vga2_cl, vga2_ch))
+	        result++;
+          }
+	  if((result == 0) || (result >= 2)) break;
+       }
+       if(result) {
+          printk(KERN_INFO "%s secondary VGA connection\n", stdstr);
+	  orSISIDXREG(SISCR, 0x32, 0x10);
+       } else {
+	  andSISIDXREG(SISCR, 0x32, ~0x10);
+       }
+    }
+
+    if(ivideo.vbflags & (VB_301C|VB_302ELV)) {
+       orSISIDXREG(SISPART4,0x0d,0x04);
+    }
+
+    haveresult = 0;
+    for(j = 0; j < 10; j++) {
+       result = 0;
+       for(i = 0; i < 3; i++) {
+          if(SISDoSense(svhs_bl, svhs_bh, svhs_cl, svhs_ch))
+	        result++;
+       }
+       if((result == 0) || (result >= 2)) break;
     }
-    
-    result = SISDoSense(testsvhs_tempbl, testsvhs_tempbh,
-                        testsvhs_tempcl, testsvhs_tempch);
     if(result) {
-        printk(KERN_INFO "sisfb: Detected TV connected to SVHS output\n");
-        /* TW: So we can be sure that there IS a SVHS output */
-	ivideo.TV_plug = TVPLUG_SVIDEO;
+        printk(KERN_INFO "%s %s SVIDEO output\n", stdstr, tvstr);
+	ivideo.vbflags |= TV_SVIDEO;
 	orSISIDXREG(SISCR, 0x32, 0x02);
+	andSISIDXREG(SISCR, 0x32, ~0x05);
     }
 
     if(!result) {
-        result = SISDoSense(testcvbs_tempbl, testcvbs_tempbh,
-	                    testcvbs_tempcl, testcvbs_tempch);
+
+	haveresult = 0;
+       	for(j = 0; j < 10; j++) {
+           result = 0;
+           for(i = 0; i < 3; i++) {
+              if(SISDoSense(cvbs_bl, cvbs_bh, cvbs_cl, cvbs_ch))
+	        result++;
+           }
+           if((result == 0) || (result >= 2)) break;
+        }
 	if(result) {
-	    printk(KERN_INFO "sisfb: Detected TV connected to CVBS output\n");
-	    /* TW: So we can be sure that there IS a CVBS output */
-	    ivideo.TV_plug = TVPLUG_COMPOSITE;
+	    printk(KERN_INFO "%s %s COMPOSITE output\n", stdstr, tvstr);
+	    ivideo.vbflags |= TV_AVIDEO;
 	    orSISIDXREG(SISCR, 0x32, 0x01);
+	    andSISIDXREG(SISCR, 0x32, ~0x06);
+	} else {
+	    andSISIDXREG(SISCR, 0x32, ~0x07);
 	}
     }
     SISDoSense(0, 0, 0, 0);
 
+    outSISIDXREG(SISPART2,0x00,backupP2_00);
     outSISIDXREG(SISPART4,0x0d,backupP4_0d);
 }
 
-/* TW: Determine and detect attached TV's on Chrontel */
-void
+/* Determine and detect attached TV's on Chrontel */
+static void
 SiS_SenseCh(void)
 {
 
-   u8 temp1;
-#ifdef CONFIG_FB_SIS_315
-   u8 temp2;
+   u8 temp1, temp2;
+#ifdef CONFIG_FB_SIS_300
+   unsigned char test[3];
+   int i;
 #endif
+   char stdstr[] = "sisfb: Chrontel: Detected TV connected to";
 
    if(ivideo.chip < SIS_315H) {
 
 #ifdef CONFIG_FB_SIS_300
-       SiS_Pr.SiS_IF_DEF_CH70xx = 1;		/* TW: Chrontel 7005 */
+       SiS_Pr.SiS_IF_DEF_CH70xx = 1;		/* Chrontel 700x */
+       SiS_SetChrontelGPIO(&SiS_Pr, 0x9c);	/* Set general purpose IO for Chrontel communication */
+       SiS_DDC2Delay(&SiS_Pr, 1000);
        temp1 = SiS_GetCH700x(&SiS_Pr, 0x25);
-       if ((temp1 >= 50) && (temp1 <= 100)) {
-	   /* TW: Read power status */
+       /* See Chrontel TB31 for explanation */
+       temp2 = SiS_GetCH700x(&SiS_Pr, 0x0e);
+       if(((temp2 & 0x07) == 0x01) || (temp2 & 0x04)) {
+	  SiS_SetCH700x(&SiS_Pr, 0x0b0e);
+	  SiS_DDC2Delay(&SiS_Pr, 300);
+       }
+       temp2 = SiS_GetCH700x(&SiS_Pr, 0x25);
+       if(temp2 != temp1) temp1 = temp2;
+
+       if((temp1 >= 0x22) && (temp1 <= 0x50)) {
+	   /* Read power status */
 	   temp1 = SiS_GetCH700x(&SiS_Pr, 0x0e);
 	   if((temp1 & 0x03) != 0x03) {
-     	        /* TW: Power all outputs */
-		SiS_SetCH70xxANDOR(&SiS_Pr, 0x030E,0xF8);
+     	        /* Power all outputs */
+		SiS_SetCH700x(&SiS_Pr, 0x0B0E);
+		SiS_DDC2Delay(&SiS_Pr, 300);
 	   }
-	   /* TW: Sense connected TV devices */
-	   SiS_SetCH700x(&SiS_Pr, 0x0110);
-	   SiS_SetCH700x(&SiS_Pr, 0x0010);
-	   temp1 = SiS_GetCH700x(&SiS_Pr, 0x10);
-	   if(!(temp1 & 0x08)) {
-		printk(KERN_INFO
-		   "sisfb: Chrontel: Detected TV connected to SVHS output\n");
-		/* TW: So we can be sure that there IS a SVHS output */
-		ivideo.TV_plug = TVPLUG_SVIDEO;
+	   /* Sense connected TV devices */
+	   for(i = 0; i < 3; i++) {
+	       SiS_SetCH700x(&SiS_Pr, 0x0110);
+	       SiS_DDC2Delay(&SiS_Pr, 0x96);
+	       SiS_SetCH700x(&SiS_Pr, 0x0010);
+	       SiS_DDC2Delay(&SiS_Pr, 0x96);
+	       temp1 = SiS_GetCH700x(&SiS_Pr, 0x10);
+	       if(!(temp1 & 0x08))       test[i] = 0x02;
+	       else if(!(temp1 & 0x02))  test[i] = 0x01;
+	       else                      test[i] = 0;
+	       SiS_DDC2Delay(&SiS_Pr, 0x96);
+	   }
+
+	   if(test[0] == test[1])      temp1 = test[0];
+	   else if(test[0] == test[2]) temp1 = test[0];
+	   else if(test[1] == test[2]) temp1 = test[1];
+	   else {
+	   	printk(KERN_INFO
+			"sisfb: TV detection unreliable - test results varied\n");
+		temp1 = test[2];
+	   }
+	   if(temp1 == 0x02) {
+		printk(KERN_INFO "%s SVIDEO output\n", stdstr);
+		ivideo.vbflags |= TV_SVIDEO;
 		orSISIDXREG(SISCR, 0x32, 0x02);
-	   } else if (!(temp1 & 0x02)) {
-		printk(KERN_INFO
-		   "sisfb: Chrontel: Detected TV connected to CVBS output\n");
-		/* TW: So we can be sure that there IS a CVBS output */
-		ivideo.TV_plug = TVPLUG_COMPOSITE;
+		andSISIDXREG(SISCR, 0x32, ~0x05);
+	   } else if (temp1 == 0x01) {
+		printk(KERN_INFO "%s CVBS output\n", stdstr);
+		ivideo.vbflags |= TV_AVIDEO;
 		orSISIDXREG(SISCR, 0x32, 0x01);
+		andSISIDXREG(SISCR, 0x32, ~0x06);
 	   } else {
  		SiS_SetCH70xxANDOR(&SiS_Pr, 0x010E,0xF8);
+		andSISIDXREG(SISCR, 0x32, ~0x07);
 	   }
        } else if(temp1 == 0) {
 	  SiS_SetCH70xxANDOR(&SiS_Pr, 0x010E,0xF8);
+	  andSISIDXREG(SISCR, 0x32, ~0x07);
        }
+       /* Set general purpose IO for Chrontel communication */
+       SiS_SetChrontelGPIO(&SiS_Pr, 0x00);
 #endif
 
    } else {
 
 #ifdef CONFIG_FB_SIS_315
-	SiS_Pr.SiS_IF_DEF_CH70xx = 2;		/* TW: Chrontel 7019 */
+	SiS_Pr.SiS_IF_DEF_CH70xx = 2;		/* Chrontel 7019 */
         temp1 = SiS_GetCH701x(&SiS_Pr, 0x49);
 	SiS_SetCH701x(&SiS_Pr, 0x2049);
 	SiS_DDC2Delay(&SiS_Pr, 0x96);
@@ -2808,22 +3122,24 @@
 	if( (temp1 & 0x01) && (temp1 & 0x02) ) temp1 = 0x04;
 	switch(temp1) {
 	case 0x01:
-	     printk(KERN_INFO
-		"sisfb: Chrontel: Detected TV connected to CVBS output\n");
-	     ivideo.TV_plug = TVPLUG_COMPOSITE;
+	     printk(KERN_INFO "%s CVBS output\n", stdstr);
+	     ivideo.vbflags |= TV_AVIDEO;
 	     orSISIDXREG(SISCR, 0x32, 0x01);
+	     andSISIDXREG(SISCR, 0x32, ~0x06);
              break;
 	case 0x02:
-	     printk(KERN_INFO
-		"sisfb: Chrontel: Detected TV connected to SVHS output\n");
-	     ivideo.TV_plug = TVPLUG_SVIDEO;
+	     printk(KERN_INFO "%s SVIDEO output\n", stdstr);
+	     ivideo.vbflags |= TV_SVIDEO;
 	     orSISIDXREG(SISCR, 0x32, 0x02);
+	     andSISIDXREG(SISCR, 0x32, ~0x05);
              break;
 	case 0x04:
-	     /* TW: This should not happen */
-	     printk(KERN_INFO
-		"sisfb: Chrontel: Detected TV connected to SCART output\n");
+	     printk(KERN_INFO "%s SCART output\n", stdstr);
+	     orSISIDXREG(SISCR, 0x32, 0x04);
+	     andSISIDXREG(SISCR, 0x32, ~0x03);
              break;
+	default:
+	     andSISIDXREG(SISCR, 0x32, ~0x07);
 	}
 #endif
 
@@ -2845,12 +3161,17 @@
 	unsigned long *write_port = 0;
 	SIS_CMDTYPE    cmd_type;
 #ifndef AGPOFF
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
 	struct agp_kern_info  *agp_info;
 	struct agp_memory     *agp;
+#else
+	agp_kern_info  *agp_info;
+	agp_memory     *agp;
+#endif
 	u32            agp_phys;
 #endif
 #endif
-/* TW: The heap start is either set manually using the "mem" parameter, or
+/*     The heap start is either set manually using the "mem" parameter, or
  *     defaults as follows:
  *     -) If more than 16MB videoRAM available, let our heap start at 12MB.
  *     -) If more than  8MB videoRAM available, let our heap start at  8MB.
@@ -2860,20 +3181,26 @@
  *     in XF86Config-4.
  *     The heap start can also be specified by parameter "mem" when starting the sisfb
  *     driver. sisfb mem=1024 lets heap starts at 1MB, etc.
+ *
+ *     On the 315 and Xabre series, the default is a 1MB heap since DRI is not
+ *     supported there.
  */
      if ((!sisfb_mem) || (sisfb_mem > (ivideo.video_size/1024))) {
-        if (ivideo.video_size > 0x1000000) {
+        if(sisvga_engine == SIS_300_VGA) {
+           if (ivideo.video_size > 0x1000000) {
 	        ivideo.heapstart = 0xc00000;
-	} else if (ivideo.video_size > 0x800000) {
+	   } else if (ivideo.video_size > 0x800000) {
 	        ivideo.heapstart = 0x800000;
-	} else {
+	   } else {
 		ivideo.heapstart = 0x400000;
+	   }
+	} else {
+	   ivideo.heapstart = ivideo.video_size - 0x100000;
 	}
      } else {
            ivideo.heapstart = sisfb_mem * 1024;
      }
-     sisfb_heap_start =
-	       (unsigned long) (ivideo.video_vbase + ivideo.heapstart);
+     sisfb_heap_start = (unsigned long) (ivideo.video_vbase + ivideo.heapstart);
      printk(KERN_INFO "sisfb: Memory heap starting at %dK\n",
      					(int)(ivideo.heapstart / 1024));
 
@@ -2882,8 +3209,8 @@
 
 #ifdef CONFIG_FB_SIS_315
      if (sisvga_engine == SIS_315_VGA) {
-        /* TW: Now initialize the 310 series' command queue mode.
-	 * On 310/325, there are three queue modes available which
+        /* Now initialize the 315/330 series' command queue mode.
+	 * On 315, there are three queue modes available which
 	 * are chosen by setting bits 7:5 in SR26:
 	 * 1. MMIO queue mode (bit 5, 0x20). The hardware will keep
 	 *    track of the queue, the FIFO, command parsing and so
@@ -2923,8 +3250,13 @@
 
 #ifndef AGPOFF
 	if (sisfb_queuemode == AGP_CMD_QUEUE) {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
 		agp_info = vmalloc(sizeof(*agp_info));
 		memset((void*)agp_info, 0x00, sizeof(*agp_info));
+#else
+		agp_info = vmalloc(sizeof(agp_kern_info));
+		memset((void*)agp_info, 0x00, sizeof(agp_kern_info));
+#endif
 		agp_copy_info(agp_info);
 
 		agp_backend_acquire();
@@ -2948,7 +3280,7 @@
 	agp_enabled = 0;
 #endif
 
-	/* TW: Now select the queue mode */
+	/* Now select the queue mode */
 
 	if ((agp_enabled) && (sisfb_queuemode == AGP_CMD_QUEUE)) {
 		cmd_type = AGP_CMD_QUEUE;
@@ -3025,10 +3357,6 @@
 		break;
 
 	   default:  /* MMIO */
-	   	/* TW: This previously only wrote SIS_MMIO_CMD_ENABLE
-		 * to IND_SIS_CMDQUEUE_SET. I doubt that this is
-		 * enough. Reserve memory in any way.
-		 */
 	   	sisfb_heap_end -= COMMAND_QUEUE_AREA_SIZE;
 		sisfb_heap_size -= COMMAND_QUEUE_AREA_SIZE;
 
@@ -3037,7 +3365,7 @@
 
 		*write_port = *read_port;
 
-		/* TW: Set Auto_Correction bit */
+		/* Set Auto_Correction bit */
 		temp |= (SIS_MMIO_CMD_ENABLE | SIS_CMD_AUTO_CORR);
 		outSISIDXREG(SISSR, IND_SIS_CMDQUEUE_SET, temp);
 
@@ -3054,7 +3382,7 @@
 
 #ifdef CONFIG_FB_SIS_300
      if (sisvga_engine == SIS_300_VGA) {
-  	    /* TW: Now initialize TurboQueue. TB is always located at the very
+  	    /* Now initialize TurboQueue. TB is always located at the very
 	     * top of the video RAM. */
 	    if (sisfb_heap_size >= TURBO_QUEUE_AREA_SIZE) {
 		unsigned int  tqueue_pos;
@@ -3082,8 +3410,8 @@
 	    }
      }
 #endif
-     /* TW: Now reserve memory for the HWCursor. It is always located at the very
-            top of the videoRAM, right below the TB memory area (if used). */
+     /* Now reserve memory for the HWCursor. It is always located at the very
+        top of the videoRAM, right below the TB memory area (if used). */
      if (sisfb_heap_size >= sisfb_hwcursor_size) {
 		sisfb_heap_end -= sisfb_hwcursor_size;
 		sisfb_heap_size -= sisfb_hwcursor_size;
@@ -3333,7 +3661,6 @@
 		req->offset = poh->offset;
 		req->size = poh->size;
 	}
-
 }
 
 void sis_free(unsigned long base)
@@ -3352,45 +3679,91 @@
 
 static void sisfb_pre_setmode(void)
 {
-	u8 cr30 = 0, cr31 = 0;
+	u8 cr30 = 0, cr31 = 0, cr33 = 0, cr35 = 0;
+
+	ivideo.currentvbflags &= (VB_VIDEOBRIDGE | VB_DISPTYPE_DISP2);
 
 	inSISIDXREG(SISCR, 0x31, cr31);
 	cr31 &= ~0x60;
+	cr31 |= 0x04;
 
-	switch (ivideo.disp_state & DISPTYPE_DISP2) {
-	   case DISPTYPE_CRT2:
-		cr30 = (SIS_VB_OUTPUT_CRT2 | SIS_SIMULTANEOUS_VIEW_ENABLE);
+	cr33 = sisfb_rate_idx & 0x0F;
+
+	SiS_SetEnableDstn(&SiS_Pr, FALSE);
+	SiS_SetEnableFstn(&SiS_Pr, FALSE);
+
+	switch (ivideo.currentvbflags & VB_DISPTYPE_DISP2) {
+	   case CRT2_TV:
+		ivideo.disp_state = DISPTYPE_TV;
+		if (ivideo.vbflags & TV_SVIDEO) {
+			cr30 = (SIS_VB_OUTPUT_SVIDEO | SIS_SIMULTANEOUS_VIEW_ENABLE);
+			ivideo.currentvbflags |= TV_SVIDEO;
+			ivideo.TV_plug = TVPLUG_SVIDEO;
+		} else if (ivideo.vbflags & TV_AVIDEO) {
+			cr30 = (SIS_VB_OUTPUT_COMPOSITE | SIS_SIMULTANEOUS_VIEW_ENABLE);
+			ivideo.currentvbflags |= TV_AVIDEO;
+			ivideo.TV_plug = TVPLUG_COMPOSITE;
+		} else if (ivideo.vbflags & TV_SCART) {
+			cr30 = (SIS_VB_OUTPUT_SCART | SIS_SIMULTANEOUS_VIEW_ENABLE);
+			ivideo.currentvbflags |= TV_SCART;
+			ivideo.TV_plug = TVPLUG_SCART;
+		}
 		cr31 |= SIS_DRIVER_MODE;
+
+		if(!(ivideo.vbflags & TV_HIVISION)) {
+	        	if (ivideo.vbflags & TV_PAL) {
+		 		cr31 |= 0x01;
+				cr35 |= 0x01;
+				ivideo.currentvbflags |= TV_PAL;
+				ivideo.TV_type = TVMODE_PAL;
+                	} else {
+		       		cr31 &= ~0x01;
+				cr35 &= ~0x01;
+				ivideo.currentvbflags |= TV_NTSC;
+				ivideo.TV_type = TVMODE_NTSC;
+			}
+		}
 		break;
-	   case DISPTYPE_LCD:
+	   case CRT2_LCD:
+		ivideo.disp_state = DISPTYPE_LCD;
 		cr30  = (SIS_VB_OUTPUT_LCD | SIS_SIMULTANEOUS_VIEW_ENABLE);
 		cr31 |= SIS_DRIVER_MODE;
+		SiS_SetEnableDstn(&SiS_Pr, sisfb_dstn);
+	        SiS_SetEnableFstn(&SiS_Pr, sisfb_fstn);
 		break;
-	   case DISPTYPE_TV:
-		if (ivideo.TV_type == TVMODE_HIVISION)
-			cr30 = (SIS_VB_OUTPUT_HIVISION | SIS_SIMULTANEOUS_VIEW_ENABLE);
-		else if (ivideo.TV_plug == TVPLUG_SVIDEO)
-			cr30 = (SIS_VB_OUTPUT_SVIDEO | SIS_SIMULTANEOUS_VIEW_ENABLE);
-		else if (ivideo.TV_plug == TVPLUG_COMPOSITE)
-			cr30 = (SIS_VB_OUTPUT_COMPOSITE | SIS_SIMULTANEOUS_VIEW_ENABLE);
-		else if (ivideo.TV_plug == TVPLUG_SCART)
-			cr30 = (SIS_VB_OUTPUT_SCART | SIS_SIMULTANEOUS_VIEW_ENABLE);
+	   case CRT2_VGA:
+		ivideo.disp_state = DISPTYPE_CRT2;
+		cr30 = (SIS_VB_OUTPUT_CRT2 | SIS_SIMULTANEOUS_VIEW_ENABLE);
 		cr31 |= SIS_DRIVER_MODE;
-
-	        if (sisfb_tvmode == 1 || ivideo.TV_type == TVMODE_PAL)
-			cr31 |= 0x01;
-                else
-                        cr31 &= ~0x01;
+		if(sisfb_nocrt2rate) {
+			cr33 |= (sisbios_mode[sisfb_mode_idx].rate_idx << 4);
+		} else {
+			cr33 |= ((sisfb_rate_idx & 0x0F) << 4);
+		}
 		break;
 	   default:	/* disable CRT2 */
 		cr30 = 0x00;
 		cr31 |= (SIS_DRIVER_MODE | SIS_VB_OUTPUT_DISABLE);
 	}
 
+	if(ivideo.chip >= SIS_661) {
+	   cr31 &= ~0x01;
+	   /* Leave overscan bit alone */
+	   setSISIDXREG(SISCR, 0x35, ~0x10, cr35);
+	}
 	outSISIDXREG(SISCR, IND_SIS_SCRATCH_REG_CR30, cr30);
 	outSISIDXREG(SISCR, IND_SIS_SCRATCH_REG_CR31, cr31);
+	outSISIDXREG(SISCR, IND_SIS_SCRATCH_REG_CR33, cr33);
 
-        outSISIDXREG(SISCR, IND_SIS_SCRATCH_REG_CR33, (sisfb_rate_idx & 0x0F));
+#ifdef CONFIG_FB_SIS_315
+        if(sisvga_engine == SIS_315_VGA) {
+	   /* Clear LCDA and PAL-N/M bits */
+	   andSISIDXREG(SISCR,0x38,~0x03);
+	   if(ivideo.chip < SIS_661) {
+	      andSISIDXREG(SISCR,0x38,~0xc0);
+	   }
+	}
+#endif
 
 	if(ivideo.accel) sisfb_syncaccel();
 
@@ -3400,67 +3773,90 @@
 static void sisfb_post_setmode(void)
 {
 	u8 reg;
+	BOOLEAN crt1isoff = FALSE;
+#ifdef CONFIG_FB_SIS_315
+	u8 reg1;
+#endif
+#ifdef CONFIG_FB_SIS_300
 	BOOLEAN doit = TRUE;
-#if 0	/* TW: Wrong: Is not in MMIO space, but in RAM */
-	/* Backup mode number to MMIO space */
-	if(ivideo.mmio_vbase) {
-	  *(volatile u8 *)(((u8*)ivideo.mmio_vbase) + 0x449) = (unsigned char)sisfb_mode_no;
-	}
-#endif	
-
-	if (ivideo.video_bpp == 8) {
-		/* TW: We can't switch off CRT1 on LVDS/Chrontel in 8bpp Modes */
-		if ((ivideo.hasVB == HASVB_LVDS) || (ivideo.hasVB == HASVB_LVDS_CHRONTEL)) {
-			doit = FALSE;
-		}
-		/* TW: We can't switch off CRT1 on 301B-DH in 8bpp Modes if using LCD */
-		if ( (sishw_ext.Is301BDH) && (ivideo.disp_state & DISPTYPE_LCD) ) {
-	        	doit = FALSE;
-	        }
-	}
-
-	/* TW: We can't switch off CRT1 if bridge is in slave mode */
-	if(ivideo.hasVB != HASVB_NONE) {
-		inSISIDXREG(SISPART1, 0x00, reg);
+#endif
+	/* We can't switch off CRT1 if bridge is in slave mode */
+	if(ivideo.vbflags & VB_VIDEOBRIDGE) {
+#ifdef CONFIG_FB_SIS_300
 		if(sisvga_engine == SIS_300_VGA) {
+			inSISIDXREG(SISPART1, 0x00, reg);
 			if((reg & 0xa0) == 0x20) {
 				doit = FALSE;
 			}
 		}
-		if(sisvga_engine == SIS_315_VGA) {
-			if((reg & 0x50) == 0x10) {
-				doit = FALSE;
-			}
-		}
+#endif
 	} else sisfb_crt1off = 0;
 
-	inSISIDXREG(SISCR, 0x17, reg);
-	if((sisfb_crt1off) && (doit))
-		reg &= ~0x80;
-	else 	      
-		reg |= 0x80;
-	outSISIDXREG(SISCR, 0x17, reg);
+	if(sisvga_engine == SIS_300_VGA) {
+
+#ifdef CONFIG_FB_SIS_300
+	   if((sisfb_crt1off) && (doit)) {
+	        crt1isoff = TRUE;
+		reg = 0x00;
+	   } else {
+	        crt1isoff = FALSE;
+		reg = 0x80;
+	   }
+	   setSISIDXREG(SISCR, 0x17, 0x7f, reg);
+#endif
+
+	} else {
+
+#ifdef CONFIG_FB_SIS_315
+	   if(sisfb_crt1off) {
+	        crt1isoff = TRUE;
+		reg  = 0x40;
+		reg1 = 0xc0;
+	   } else {
+	        crt1isoff = FALSE;
+		reg  = 0x00;
+		reg1 = 0x00;
 
-        andSISIDXREG(SISSR, IND_SIS_RAMDAC_CONTROL, ~0x04);
+	   }
+	   setSISIDXREG(SISCR, SiS_Pr.SiS_MyCR63, ~0x40, reg);
+	   setSISIDXREG(SISSR, 0x1f, ~0xc0, reg1);
+#endif
+
+	}
 
-	if((ivideo.disp_state & DISPTYPE_TV) && (ivideo.hasVB == HASVB_301)) {
+	if(crt1isoff) {
+	   ivideo.currentvbflags &= ~VB_DISPTYPE_CRT1;
+	   ivideo.currentvbflags |= VB_SINGLE_MODE;
+	   ivideo.disp_state |= DISPMODE_SINGLE;
+	} else {
+	   ivideo.currentvbflags |= VB_DISPTYPE_CRT1;
+	   ivideo.disp_state |= DISPTYPE_CRT1;
+	   if(ivideo.currentvbflags & VB_DISPTYPE_CRT2) {
+	  	ivideo.currentvbflags |= VB_MIRROR_MODE;
+		ivideo.disp_state |= DISPMODE_MIRROR;
+	   } else {
+	 	ivideo.currentvbflags |= VB_SINGLE_MODE;
+		ivideo.disp_state |= DISPMODE_SINGLE;
+	   }
+	}
 
-	   inSISIDXREG(SISPART4, 0x01, reg);
+        andSISIDXREG(SISSR, IND_SIS_RAMDAC_CONTROL, ~0x04);
 
-	   if(reg < 0xB0) {        	/* Set filter for SiS301 */
+	if((ivideo.currentvbflags & CRT2_TV) && (ivideo.vbflags & VB_301)) {  /* Set filter for SiS301 */
 
 		switch (ivideo.video_width) {
 		   case 320:
-			filter_tb = (ivideo.TV_type == TVMODE_NTSC) ? 4 : 12;
+			filter_tb = (ivideo.vbflags & TV_NTSC) ? 4 : 12;
 			break;
 		   case 640:
-			filter_tb = (ivideo.TV_type == TVMODE_NTSC) ? 5 : 13;
+			filter_tb = (ivideo.vbflags & TV_NTSC) ? 5 : 13;
 			break;
 		   case 720:
-			filter_tb = (ivideo.TV_type == TVMODE_NTSC) ? 6 : 14;
+			filter_tb = (ivideo.vbflags & TV_NTSC) ? 6 : 14;
 			break;
+		   case 400:
 		   case 800:
-			filter_tb = (ivideo.TV_type == TVMODE_NTSC) ? 7 : 15;
+			filter_tb = (ivideo.vbflags & TV_NTSC) ? 7 : 15;
 			break;
 		   default:
 			filter = -1;
@@ -3469,15 +3865,15 @@
 
 		orSISIDXREG(SISPART1, sisfb_CRT2_write_enable, 0x01);
 
-		if(ivideo.TV_type == TVMODE_NTSC) {
+		if(ivideo.vbflags & TV_NTSC) {
 
 		        andSISIDXREG(SISPART2, 0x3a, 0x1f);
 
-			if (ivideo.TV_plug == TVPLUG_SVIDEO) {
+			if (ivideo.vbflags & TV_SVIDEO) {
 
 			        andSISIDXREG(SISPART2, 0x30, 0xdf);
 
-			} else if (ivideo.TV_plug == TVPLUG_COMPOSITE) {
+			} else if (ivideo.vbflags & TV_AVIDEO) {
 
 			        orSISIDXREG(SISPART2, 0x30, 0x20);
 
@@ -3494,6 +3890,7 @@
 					outSISIDXREG(SISPART2, 0x37, 0x22);
 					outSISIDXREG(SISPART2, 0x38, 0x08);
 					break;
+				case 400:
 				case 800:
 					outSISIDXREG(SISPART2, 0x35, 0xEB);
 					outSISIDXREG(SISPART2, 0x36, 0x15);
@@ -3503,15 +3900,15 @@
 				}
 			}
 
-		} else if(ivideo.TV_type == TVMODE_PAL) {
+		} else if(ivideo.vbflags & TV_PAL) {
 
 			andSISIDXREG(SISPART2, 0x3A, 0x1F);
 
-			if (ivideo.TV_plug == TVPLUG_SVIDEO) {
+			if (ivideo.vbflags & TV_SVIDEO) {
 
 			        andSISIDXREG(SISPART2, 0x30, 0xDF);
 
-			} else if (ivideo.TV_plug == TVPLUG_COMPOSITE) {
+			} else if (ivideo.vbflags & TV_AVIDEO) {
 
 			        orSISIDXREG(SISPART2, 0x30, 0x20);
 
@@ -3528,6 +3925,7 @@
 					outSISIDXREG(SISPART2, 0x37, 0x1D);
 					outSISIDXREG(SISPART2, 0x38, 0x20);
 					break;
+				case 400:
 				case 800:
 					outSISIDXREG(SISPART2, 0x35, 0xFC);
 					outSISIDXREG(SISPART2, 0x36, 0xFB);
@@ -3538,8 +3936,8 @@
 			}
 		}
 
-		if ((filter >= 0) && (filter <=7)) {
-			DPRINTK("FilterTable[%d]-%d: %02x %02x %02x %02x\n", filter_tb, filter, 
+		if ((filter >= 0) && (filter <= 7)) {
+			DPRINTK("FilterTable[%d]-%d: %02x %02x %02x %02x\n", filter_tb, filter,
 				sis_TV_filter[filter_tb].filter[filter][0],
 				sis_TV_filter[filter_tb].filter[filter][1],
 				sis_TV_filter[filter_tb].filter[filter][2],
@@ -3550,8 +3948,6 @@
 			outSISIDXREG(SISPART2, 0x37, (sis_TV_filter[filter_tb].filter[filter][2]));
 			outSISIDXREG(SISPART2, 0x38, (sis_TV_filter[filter_tb].filter[filter][3]));
 		}
-
-	     }
 	  
 	}
 
@@ -3563,12 +3959,15 @@
 	char *this_opt;
 	
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
-	sis_fb_info.fontname[0] = '\0';
-#endif	
+	sisfb_fontname[0] = '\0';
+#endif
 
 	ivideo.refresh_rate = 0;
+	SiS_Pr.SiS_CustomT = CUT_NONE;
+	SiS_Pr.UsePanelScaler = -1;
+	SiS_Pr.LVDSHL = -1;
 
-        printk(KERN_INFO "sisfb: Options %s\n", options);
+        printk(KERN_DEBUG "sisfb: Options %s\n", options);
 
 	if (!options || !*options)
 		return 0;
@@ -3577,72 +3976,80 @@
 
 		if (!*this_opt)	continue;
 
-		if (!strncmp(this_opt, "mode:", 5)) {
-			sisfb_search_mode(this_opt + 5);
-		} else if (!strncmp(this_opt, "vesa:", 5)) {
-			sisfb_search_vesamode(simple_strtoul(this_opt + 5, NULL, 0));
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)			
-		} else if (!strcmp(this_opt, "inverse")) {
+		if (!strnicmp(this_opt, "mode:", 5)) {
+			sisfb_search_mode(this_opt + 5, FALSE);
+		} else if (!strnicmp(this_opt, "vesa:", 5)) {
+			sisfb_search_vesamode(simple_strtoul(this_opt + 5, NULL, 0), FALSE);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
+		} else if (!strnicmp(this_opt, "inverse", 7)) {
 			sisfb_inverse = 1;
 			/* fb_invert_cmaps(); */
-		} else if (!strncmp(this_opt, "font:", 5)) {
-			strcpy(sis_fb_info.fontname, this_opt + 5);
-#endif			
-		} else if (!strncmp(this_opt, "mode:", 5)) {
-			sisfb_search_mode(this_opt + 5);
-		} else if (!strncmp(this_opt, "vesa:", 5)) {
-			sisfb_search_vesamode(simple_strtoul(this_opt + 5, NULL, 0));
-		} else if (!strncmp(this_opt, "vrate:", 6)) {
+		} else if (!strnicmp(this_opt, "font:", 5)) {
+			strncpy(sisfb_fontname, this_opt + 5, sizeof(sisfb_fontname) - 1);
+			sisfb_fontname[sizeof(sisfb_fontname) - 1] = '\0';
+#endif
+		} else if (!strnicmp(this_opt, "vrate:", 6)) {
 			ivideo.refresh_rate = simple_strtoul(this_opt + 6, NULL, 0);
-		} else if (!strncmp(this_opt, "rate:", 5)) {
+			sisfb_parm_rate = ivideo.refresh_rate;
+		} else if (!strnicmp(this_opt, "rate:", 5)) {
 			ivideo.refresh_rate = simple_strtoul(this_opt + 5, NULL, 0);
-		} else if (!strncmp(this_opt, "off", 3)) {
+			sisfb_parm_rate = ivideo.refresh_rate;
+		} else if (!strnicmp(this_opt, "off", 3)) {
 			sisfb_off = 1;
-		} else if (!strncmp(this_opt, "crt1off", 7)) {
+		} else if (!strnicmp(this_opt, "crt1off", 7)) {
 			sisfb_crt1off = 1;
-		} else if (!strncmp(this_opt, "filter:", 7)) {
+		} else if (!strnicmp(this_opt, "filter:", 7)) {
 			filter = (int)simple_strtoul(this_opt + 7, NULL, 0);
-		} else if (!strncmp(this_opt, "forcecrt2type:", 14)) {
+		} else if (!strnicmp(this_opt, "forcecrt2type:", 14)) {
 			sisfb_search_crt2type(this_opt + 14);
-		} else if (!strncmp(this_opt, "forcecrt1:", 10)) {
+		} else if (!strnicmp(this_opt, "forcecrt1:", 10)) {
 			sisfb_forcecrt1 = (int)simple_strtoul(this_opt + 10, NULL, 0);
-                } else if (!strncmp(this_opt, "tvmode:",7)) {
+                } else if (!strnicmp(this_opt, "tvmode:",7)) {
 		        sisfb_search_tvstd(this_opt + 7);
-                } else if (!strncmp(this_opt, "tvstandard:",11)) {
+                } else if (!strnicmp(this_opt, "tvstandard:",11)) {
 			sisfb_search_tvstd(this_opt + 7);
-                } else if (!strncmp(this_opt, "mem:",4)) {
+                } else if (!strnicmp(this_opt, "mem:",4)) {
 		        sisfb_mem = simple_strtoul(this_opt + 4, NULL, 0);
-                } else if (!strncmp(this_opt, "dstn", 4)) {
-			enable_dstn = 1;
-			/* TW: DSTN overrules forcecrt2type */
-			sisfb_crt2type = DISPTYPE_LCD;
-		} else if (!strncmp(this_opt, "queuemode:", 10)) {
+		} else if (!strnicmp(this_opt, "queuemode:", 10)) {
 			sisfb_search_queuemode(this_opt + 10);
-		} else if (!strncmp(this_opt, "pdc:", 4)) {
+		} else if (!strnicmp(this_opt, "pdc:", 4)) {
 		        sisfb_pdc = simple_strtoul(this_opt + 4, NULL, 0);
-		        if(sisfb_pdc & ~0x3c) {
-			   printk(KERN_INFO "sisfb: Illegal pdc parameter\n");
-			   sisfb_pdc = 0;
-		        }
-		} else if (!strncmp(this_opt, "noaccel", 7)) {
+		} else if (!strnicmp(this_opt, "noaccel", 7)) {
 			sisfb_accel = 0;
-		} else if (!strncmp(this_opt, "noypan", 6)) {
+		} else if (!strnicmp(this_opt, "noypan", 6)) {
 		        sisfb_ypan = 0;
-		} else if (!strncmp(this_opt, "userom:", 7)) {
+		} else if (!strnicmp(this_opt, "nomax", 5)) {
+		        sisfb_max = 0;
+		} else if (!strnicmp(this_opt, "userom:", 7)) {
 			sisfb_userom = (int)simple_strtoul(this_opt + 7, NULL, 0);
-		} else if (!strncmp(this_opt, "useoem:", 7)) {
+		} else if (!strnicmp(this_opt, "useoem:", 7)) {
 			sisfb_useoem = (int)simple_strtoul(this_opt + 7, NULL, 0);
+		} else if (!strnicmp(this_opt, "nocrt2rate", 10)) {
+			sisfb_nocrt2rate = 1;
+	 	} else if (!strnicmp(this_opt, "scalelcd:", 9)) {
+		        unsigned long temp = 2;
+		        temp = simple_strtoul(this_opt + 9, NULL, 0);
+		        if((temp == 0) || (temp == 1)) {
+			   SiS_Pr.UsePanelScaler = temp ^ 1;
+		        }
+		} else if (!strnicmp(this_opt, "specialtiming:", 14)) {
+			sisfb_search_specialtiming(this_opt + 14);
+		} else if (!strnicmp(this_opt, "lvdshl:", 7)) {
+		        unsigned long temp = 4;
+		        temp = simple_strtoul(this_opt + 7, NULL, 0);
+		        if((temp >= 0) && (temp <= 3)) {
+			   SiS_Pr.LVDSHL = temp;
+		        }
+		} else if(this_opt[0] >= '0' && this_opt[0] <= '9') {
+			sisfb_search_mode(this_opt, TRUE);
 		} else {
 			printk(KERN_INFO "sisfb: Invalid option %s\n", this_opt);
 		}
 
 		/* TW: Acceleration only with MMIO mode */
 		if((sisfb_queuemode != -1) && (sisfb_queuemode != MMIO_CMD)) {
-			sisfb_ypan = 0;
 			sisfb_accel = 0;
 		}
-		/* TW: Panning only with acceleration */
-		if(sisfb_accel == 0) sisfb_ypan = 0;
 
 	}
 	return 0;
@@ -3653,74 +4060,43 @@
 {
 #if defined(__i386__)
         u32  segstart;
-        unsigned char *rom_base;
-        unsigned char *rom;
-        int  stage;
-        int  i;
-        char sis_rom_sig[] = "Silicon Integrated Systems";
-        char *sis_sig_300[4] = {
-          "300", "540", "630", "730"
-        };
-        char *sis_sig_310[7] = {
-          "315", "315", "315", "5315", "6325", "6325", "Xabre"
-        };
-	ushort sis_nums_300[4] = {
-	  SIS_300, SIS_540, SIS_630, SIS_730
-	};
-	unsigned short sis_nums_310[7] = {
-	  SIS_315PRO, SIS_315H, SIS_315, SIS_550, SIS_650, SIS_740, SIS_330
-	};
+        unsigned char *rom_base, *rom;
+        int  romptr;
+	unsigned short pciid;
 
         for(segstart=0x000c0000; segstart<0x000f0000; segstart+=0x00001000) {
 
-                stage = 1;
-
-                rom_base = (char *)ioremap(segstart, 0x1000);
+                rom_base = (char *)ioremap(segstart, 0x10000);
+		if(!rom_base) continue;
 
-                if ((*rom_base == 0x55) && (((*(rom_base + 1)) & 0xff) == 0xaa))
-                   stage = 2;
-
-                if (stage != 2) {
+                if((*rom_base != 0x55) || (*(rom_base + 1) != 0xaa)) {
                    iounmap(rom_base);
                    continue;
                 }
 
+		romptr = (unsigned short)(*(rom_base + 0x18) | (*(rom_base + 0x19) << 8));
+		if(romptr > (0x10000 - 8)) {
+		   iounmap(rom_base);
+		   continue;
+		}
+
+		rom = rom_base + romptr;
 
-		rom = rom_base + (unsigned short)(*(rom_base + 0x12) | (*(rom_base + 0x13) << 8));
-                if(strncmp(sis_rom_sig, rom, strlen(sis_rom_sig)) == 0) {
-                    stage = 3;
-		}
-                if(stage != 3) {
-                    iounmap(rom_base);
-                    continue;
-                }
+		if((*rom != 'P') || (*(rom + 1) != 'C') || (*(rom + 2) != 'I') || (*(rom + 3) != 'R')) {
+		   iounmap(rom_base);
+		   continue;
+		}
 
-		rom = rom_base + (unsigned short)(*(rom_base + 0x14) | (*(rom_base + 0x15) << 8));
-                for(i = 0;(i < 4) && (stage != 4); i++) {
-                    if(strncmp(sis_sig_300[i], rom, strlen(sis_sig_300[i])) == 0) {
-                        if(sis_nums_300[i] == ivideo.chip) {
-			   stage = 4;
-                           break;
-			}
-                    }
-                }
-		if(stage != 4) {
-                   for(i = 0;(i < 7) && (stage != 4); i++) {
-                      if(strncmp(sis_sig_310[i], rom, strlen(sis_sig_310[i])) == 0) {
-		          if(sis_nums_310[i] == ivideo.chip) {
-                             stage = 4;
-                             break;
-			  }
-                      }
-                   }
+		pciid = (*(rom + 4)) | ((*(rom + 5)) << 8);
+		if(pciid != 0x1039) {
+		   iounmap(rom_base);
+		   continue;
 		}
 
-                if(stage != 4) {
-                        iounmap(rom_base);
-                        continue;
-                }
+		pciid = (*(rom + 6)) | ((*(rom + 7)) << 8);
+		if(pciid == ivideo.chip_id) return rom_base;
 
-                return rom_base;
+		iounmap(rom_base);
         }
 #endif
         return NULL;
@@ -3735,11 +4111,9 @@
 	int pdev_valid = 0;
 	u32 reg32;
 	u16 reg16;
-	u8  reg, reg1;
-
-	/* outb(0x77, 0x80); */  /* What is this? */
+	u8  reg;
 
-#if 0 	
+#if 0
 	/* for DOC VB */
 	sisfb_set_reg4(0xcf8,0x800000e0);
 	reg32 = sisfb_get_reg3(0xcfc);
@@ -3751,24 +4125,39 @@
 	if (sisfb_off)
 		return -ENXIO;
 
-	if (enable_dstn)
-		SiS_SetEnableDstn(&SiS_Pr);
-		
 	sisfb_registered = 0;
+	sisfb_thismonitor.datavalid = FALSE;
 
-	memset(&sis_fb_info, 0, sizeof(sis_fb_info));
+	memset(&sishw_ext, 0, sizeof(sishw_ext));
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
+        memset(&sisfb_lastrates[0], 0, 128);
+#endif
 	
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)	
 	memset(&sis_disp, 0, sizeof(sis_disp));
-#endif	
+#endif
 
-	while ((pdev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, pdev)) != NULL) {
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,74)
+	pci_for_each_dev(pdev) {
+#else
+	while((pdev = pci_find_device(PCI_VENDOR_ID_SI, PCI_ANY_ID, pdev))) {
+#endif
 		for (b = sisdev_list; b->vendor; b++) {
 			if ((b->vendor == pdev->vendor)
 			    && (b->device == pdev->device)) {
 				pdev_valid = 1;
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,5,0)				
-				strcpy(sis_fb_info.modename, b->name);
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)) && defined(NEWFBDEV)
+				sis_fb_info = framebuffer_alloc(0, &pdev->dev);
+#else
+				sis_fb_info = kmalloc(sizeof(*sis_fb_info), GFP_KERNEL);
+#endif
+				if(!sis_fb_info) return -ENOMEM;
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)) || (!(defined(NEWFBDEV)))
+				memset(sis_fb_info, 0, sizeof(*sis_fb_info));
+#endif
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,5,0)
+				strcpy(sis_fb_info->modename, b->name);
 #else				
 				strcpy(myid, b->name);
 #endif				
@@ -3804,18 +4193,17 @@
 		break;
 	   case PCI_DEVICE_ID_SI_630_VGA:
 		{
+			ivideo.chip = SIS_630;
 			sisfb_set_reg4(0xCF8, 0x80000000);
 			reg32 = sisfb_get_reg3(0xCFC);
 			if(reg32 == 0x07301039) {
 				ivideo.chip = SIS_730;
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,5,0)				
-				strcpy(sis_fb_info.modename, "SIS 730");
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,5,0)
+				strcpy(sis_fb_info->modename, "SIS 730");
 #else
 				strcpy(myid, "SIS 730");
-#endif				
-			} else
-				ivideo.chip = SIS_630;
-
+#endif
+			}
 			sisvga_engine = SIS_300_VGA;
 			sisfb_hwcursor_size = HW_CURSOR_AREA_SIZE_300 * 2;
 			sisfb_CRT2_write_enable = IND_SIS_CRT2_WRITE_ENABLE_300;
@@ -3860,11 +4248,11 @@
 			reg32 = sisfb_get_reg3(0xCFC);
 			if(reg32 == 0x07401039) {
 				ivideo.chip = SIS_740;
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,5,0)				
-				strcpy(sis_fb_info.modename, "SIS 740");
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,5,0)
+				strcpy(sis_fb_info->modename, "SIS 740");
 #else
-				strcpy(myid, "SIS 740");				
-#endif				
+				strcpy(myid, "SIS 740");
+#endif
 			}
 			sisvga_engine = SIS_315_VGA;
 			sisfb_hwcursor_size = HW_CURSOR_AREA_SIZE_315 * 2;
@@ -3877,8 +4265,47 @@
 		sisfb_hwcursor_size = HW_CURSOR_AREA_SIZE_315 * 2;
 		sisfb_CRT2_write_enable = IND_SIS_CRT2_WRITE_ENABLE_315;
 		break;
+	   case PCI_DEVICE_ID_SI_660_VGA:
+	   	{
+			sisfb_set_reg4(0xCF8, 0x80000000);
+			reg32 = sisfb_get_reg3(0xCFC);
+			if(reg32 == 0x07601039) {
+				ivideo.chip = SIS_760;
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,5,0)
+				strcpy(sis_fb_info->modename, "SIS 760");
+#else
+				strcpy(myid, "SIS 760");
+#endif
+			} else if(reg32 == 0x06601039) {
+				ivideo.chip = SIS_660;
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,5,0)
+				strcpy(sis_fb_info->modename, "SIS 660");
+#else
+				strcpy(myid, "SIS 660");
+#endif
+			} else if(reg32 == 0x07411039) {
+				ivideo.chip = SIS_741;
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,5,0)
+				strcpy(sis_fb_info->modename, "SIS 741");
+#else
+				strcpy(myid, "SIS 741");
+#endif
+			} else {
+				ivideo.chip = SIS_661;
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,5,0)
+				strcpy(sis_fb_info->modename, "SIS 661");
+#else
+				strcpy(myid, "SIS 661");
+#endif
+			}
+			sisvga_engine = SIS_315_VGA;
+			sisfb_hwcursor_size = HW_CURSOR_AREA_SIZE_315 * 2;
+			sisfb_CRT2_write_enable = IND_SIS_CRT2_WRITE_ENABLE_315;
+			break;
+		}
 #endif
            default:
+	   	kfree(sis_fb_info);
 	        return -ENODEV;
 	}
 	sishw_ext.jChipType = ivideo.chip;
@@ -3890,73 +4317,65 @@
 
 	ivideo.video_base = pci_resource_start(pdev, 0);
 	ivideo.mmio_base = pci_resource_start(pdev, 1);
-	sishw_ext.ulIOAddress = (unsigned short) ivideo.vga_base =
-	    (unsigned short) SiS_Pr.RelIO = pci_resource_start(pdev, 2) + 0x30;
+	sishw_ext.ulIOAddress = SiS_Pr.RelIO = pci_resource_start(pdev, 2) + 0x30;
+	ivideo.vga_base = (unsigned short) sishw_ext.ulIOAddress;
 
 	sisfb_mmio_size =  pci_resource_len(pdev, 1);
 
 	if(!sisvga_enabled) {
-		if (pci_enable_device(pdev))   return -EIO;
+	   if(pci_enable_device(pdev)) {
+	      kfree(sis_fb_info);
+	      return -EIO;
+	   }
 	}
 
 	SiS_Pr.SiS_Backup70xx = 0xff;
         SiS_Pr.SiS_CHOverScan = -1;
         SiS_Pr.SiS_ChSW = FALSE;
 	SiS_Pr.SiS_UseLCDA = FALSE;
-	SiS_Pr.UsePanelScaler = -1;
-	SiSRegInit(&SiS_Pr, (USHORT)sishw_ext.ulIOAddress);
+	SiS_Pr.HaveEMI = FALSE;
+	SiS_Pr.HaveEMILCD = FALSE;
+	SiS_Pr.OverruleEMI = FALSE;
+	SiS_Pr.SiS_SensibleSR11 = FALSE;
+	SiS_Pr.SiS_MyCR63 = 0x63;
+	if(ivideo.chip >= SIS_661) {
+	   SiS_Pr.SiS_SensibleSR11 = TRUE;
+	   SiS_Pr.SiS_MyCR63 = 0x53;
+	}
+	SiSRegInit(&SiS_Pr, sishw_ext.ulIOAddress);
 
 #ifdef CONFIG_FB_SIS_300
-	/* TW: Find PCI systems for Chrontel/ISA bridge manipulation */
+	/* TW: Find PCI systems for Chrontel/GPIO communication setup */
 	if(ivideo.chip == SIS_630) {
-	  int i=0;
-          do {
-	    if(mychswtable[i].subsysVendor == ivideo.subsysvendor &&
-	       mychswtable[i].subsysCard   == ivideo.subsysdevice) {
-		SiS_Pr.SiS_ChSW = TRUE;
-            }
-            i++;
-          } while(mychswtable[i].subsysVendor != 0);
+	   int i=0;
+           do {
+	      if(mychswtable[i].subsysVendor == ivideo.subsysvendor &&
+	         mychswtable[i].subsysCard   == ivideo.subsysdevice) {
+		 SiS_Pr.SiS_ChSW = TRUE;
+		 printk(KERN_DEBUG "sisfb: Identified [%s %s] requiring Chrontel/GPIO setup\n",
+		        mychswtable[i].vendorName, mychswtable[i].cardName);
+		 break;
+              }
+              i++;
+           } while(mychswtable[i].subsysVendor != 0);
 	}
 #endif
 
         outSISIDXREG(SISSR, IND_SIS_PASSWORD, SIS_PASSWORD);
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)		
-#ifdef MODULE	
+#ifdef MODULE
 	inSISIDXREG(SISCR,0x34,reg);
-	if(reg & 0x80) {
+	if((reg & 0x80) && (reg != 0xff)) {
 	   if((sisbios_mode[sisfb_mode_idx].mode_no) != 0xFF) {
 	      printk(KERN_INFO "sisfb: Cannot initialize display mode, X server is active\n");
+	      kfree(sis_fb_info);
 	      return -EBUSY;
 	   }
 	}
 #endif	
 #endif
 
-#ifdef LINUXBIOS  /* -------------------------------- */
-
-#ifdef CONFIG_FB_SIS_300
-	if (sisvga_engine == SIS_300_VGA) {
-	        outSISIDXREG(SISSR, 0x28, 0x37);
-
-                outSISIDXREG(SISSR, 0x29, 0x61);
-
-                orSISIDXREG(SISSR, IND_SIS_SCRATCH_REG_1A, SIS_SCRATCH_REG_1A_MASK);
-	}
-#endif
-#ifdef CONFIG_FB_SIS_315
-	if (ivideo.chip == SIS_550 || ivideo.chip == SIS_650 || ivideo.chip == SIS_740) {
-	        outSISIDXREG(SISSR, 0x28, 0x5a);
-
-                outSISIDXREG(SISSR, 0x29, 0x64);
-
-                outSISIDXREG(SISCR, 0x3a, 0x00);
-	}
-#endif		
-
-#endif /* LinuxBIOS  -------------------------------- */
-
 	if (sisvga_engine == SIS_315_VGA) {
 		switch (ivideo.chip) {
 		   case SIS_315H:
@@ -3967,6 +4386,10 @@
 		   case SIS_550:
 		   case SIS_650:
 		   case SIS_740:
+		   case SIS_661:
+		   case SIS_741:
+		   case SIS_660:
+		   case SIS_760:
 			sishw_ext.bIntegratedMMEnabled = TRUE;
 			break;
 		   default:
@@ -3984,7 +4407,6 @@
 		}
 	}
 
-	sishw_ext.pDevice = NULL;
 	if(sisfb_userom) {
 	    sishw_ext.pjVirtualRomBase = sis_find_rom();
 	    if(sishw_ext.pjVirtualRomBase) {
@@ -4000,23 +4422,76 @@
 	    sishw_ext.UseROM = FALSE;
 	    printk(KERN_INFO "sisfb: Video ROM usage disabled\n");
 	}
-	sishw_ext.pjCustomizedROMImage = NULL;
 	sishw_ext.bSkipDramSizing = 0;
 	sishw_ext.pQueryVGAConfigSpace = &sisfb_query_VGA_config_space;
 	sishw_ext.pQueryNorthBridgeSpace = &sisfb_query_north_bridge_space;
-	strcpy(sishw_ext.szVBIOSVer, "0.84");
 
-	/* TW: Mode numbers for 1280x960 are different for 300 and 310/325 series */
+        /* Find systems for special custom timing */
+	if(SiS_Pr.SiS_CustomT == CUT_NONE) {
+	   int i=0, j;
+	   unsigned char *biosver = NULL;
+           unsigned char *biosdate = NULL;
+	   BOOLEAN footprint;
+	   unsigned long chksum = 0;
+
+	   if(sishw_ext.UseROM) {
+	      biosver = sishw_ext.pjVirtualRomBase + 0x06;
+	      biosdate = sishw_ext.pjVirtualRomBase + 0x2c;
+              for(i=0; i<32768; i++) chksum += sishw_ext.pjVirtualRomBase[i];
+	   }
+
+	   i=0;
+           do {
+	      if( (mycustomttable[i].chipID == ivideo.chip) &&
+	          ((!strlen(mycustomttable[i].biosversion)) ||
+		   (sishw_ext.UseROM &&
+		   (!strncmp(mycustomttable[i].biosversion, biosver, strlen(mycustomttable[i].biosversion))))) &&
+	          ((!strlen(mycustomttable[i].biosdate)) ||
+		   (sishw_ext.UseROM &&
+		   (!strncmp(mycustomttable[i].biosdate, biosdate, strlen(mycustomttable[i].biosdate))))) &&
+		  ((!mycustomttable[i].bioschksum) ||
+		   (sishw_ext.UseROM &&
+	           (mycustomttable[i].bioschksum == chksum)))	&&
+		  (mycustomttable[i].pcisubsysvendor == ivideo.subsysvendor) &&
+		  (mycustomttable[i].pcisubsyscard == ivideo.subsysdevice) ) {
+		 footprint = TRUE;
+	         for(j=0; j<5; j++) {
+	            if(mycustomttable[i].biosFootprintAddr[j]) {
+		       if(sishw_ext.UseROM) {
+	                  if(sishw_ext.pjVirtualRomBase[mycustomttable[i].biosFootprintAddr[j]] !=
+		      		mycustomttable[i].biosFootprintData[j])
+		          footprint = FALSE;
+		       } else footprint = FALSE;
+		    }
+	         }
+	         if(footprint) {
+	 	    SiS_Pr.SiS_CustomT = mycustomttable[i].SpecialID;
+		    printk(KERN_DEBUG "sisfb: Identified [%s %s], special timing applies\n",
+		        mycustomttable[i].vendorName,
+			mycustomttable[i].cardName);
+		    printk(KERN_DEBUG "sisfb: [specialtiming parameter name: %s]\n",
+		    	mycustomttable[i].optionName);
+	            break;
+                 }
+	      }
+              i++;
+           } while(mycustomttable[i].chipID);
+	}
+
+#ifdef CONFIG_FB_SIS_300
+	/* Mode numbers for 1280x768 are different for 300 and 315 series */
 	if(sisvga_engine == SIS_300_VGA) {
-		sisbios_mode[MODEINDEX_1280x960].mode_no = 0x6e;
-		sisbios_mode[MODEINDEX_1280x960+1].mode_no = 0x6f;
-		sisbios_mode[MODEINDEX_1280x960+2].mode_no = 0x7b;
-		sisbios_mode[MODEINDEX_1280x960+3].mode_no = 0x7b;
+		sisbios_mode[MODEINDEX_1280x768].mode_no = 0x55;
+		sisbios_mode[MODEINDEX_1280x768+1].mode_no = 0x5a;
+		sisbios_mode[MODEINDEX_1280x768+2].mode_no = 0x5b;
+		sisbios_mode[MODEINDEX_1280x768+3].mode_no = 0x5b;
 	}
+#endif
 
 	sishw_ext.pSR = vmalloc(sizeof(SIS_DSReg) * SR_BUFFER_SIZE);
 	if (sishw_ext.pSR == NULL) {
 		printk(KERN_ERR "sisfb: Fatal error: Allocating SRReg space failed.\n");
+		kfree(sis_fb_info);
 		return -ENODEV;
 	}
 	sishw_ext.pSR[0].jIdx = sishw_ext.pSR[0].jVal = 0xFF;
@@ -4025,6 +4500,7 @@
 	if (sishw_ext.pCR == NULL) {
 	        vfree(sishw_ext.pSR);
 		printk(KERN_ERR "sisfb: Fatal error: Allocating CRReg space failed.\n");
+		kfree(sis_fb_info);
 		return -ENODEV;
 	}
 	sishw_ext.pCR[0].jIdx = sishw_ext.pCR[0].jVal = 0xFF;
@@ -4033,32 +4509,16 @@
 	if(sisvga_engine == SIS_300_VGA) {
 		if(!sisvga_enabled) {
 		        /* Mapping Max FB Size for 300 Init */
-			sishw_ext.pjVideoMemoryAddress
-				= ioremap(ivideo.video_base, 0x4000000);
-			if((sisfb_mode_idx < 0) || ((sisbios_mode[sisfb_mode_idx].mode_no) != 0xFF)) {
-#ifdef LINUXBIOS		/* TW: SiSInit now for LinuxBIOS only */	        
-				SiSInit(&SiS_Pr, &sishw_ext);
-#endif
-				outSISIDXREG(SISSR, IND_SIS_PASSWORD, SIS_PASSWORD);
-			}
-		}
-#ifdef LINUXBIOS
-		else {
-			sishw_ext.pjVideoMemoryAddress
-				= ioremap(ivideo.video_base, 0x4000000);
+			sishw_ext.pjVideoMemoryAddress = ioremap(ivideo.video_base, 0x4000000);
 			if((sisfb_mode_idx < 0) || ((sisbios_mode[sisfb_mode_idx].mode_no) != 0xFF)) {
-				SiSInit(&SiS_Pr, &sishw_ext);
 				outSISIDXREG(SISSR, IND_SIS_PASSWORD, SIS_PASSWORD);
 			}
 		}
-		if((sisfb_mode_idx < 0) || ((sisbios_mode[sisfb_mode_idx].mode_no) != 0xFF)) { 
-		        orSISIDXREG(SISSR, 0x07, 0x10);
-		}
-#endif
 		if(sisfb_get_dram_size_300()) {
 		        vfree(sishw_ext.pSR);
 			vfree(sishw_ext.pCR);
 			printk(KERN_ERR "sisfb: Fatal error: Unable to determine RAM size\n");
+			kfree(sis_fb_info);
 			return -ENODEV;
 		}
 	}
@@ -4068,35 +4528,9 @@
 	if (sisvga_engine == SIS_315_VGA) {
 		if (!sisvga_enabled) {
 			/* Mapping Max FB Size for 315 Init */
-			sishw_ext.pjVideoMemoryAddress 
-				= ioremap(ivideo.video_base, 0x8000000);
-			if((sisfb_mode_idx < 0) || ((sisbios_mode[sisfb_mode_idx].mode_no) != 0xFF)) { 
-#ifdef LINUXBIOS
-			        /* TW: SISInit is now for LINUXBIOS only */
-				SiSInit(&SiS_Pr, &sishw_ext);
-#endif
-
-				outSISIDXREG(SISSR, IND_SIS_PASSWORD, SIS_PASSWORD);
-
-				sishw_ext.bSkipDramSizing = TRUE;
-				sishw_ext.pSR[0].jIdx = 0x13;
-				sishw_ext.pSR[1].jIdx = 0x14;
-				sishw_ext.pSR[2].jIdx = 0xFF;
-				inSISIDXREG(SISSR, 0x13, sishw_ext.pSR[0].jVal);
-				inSISIDXREG(SISSR, 0x14, sishw_ext.pSR[1].jVal);
-				sishw_ext.pSR[2].jVal = 0xFF;
-			}
-		}
-#ifdef LINUXBIOS
-		else {
-			sishw_ext.pjVideoMemoryAddress
-				= ioremap(ivideo.video_base, 0x8000000);
-			if((sisfb_mode_idx < 0) || ((sisbios_mode[sisfb_mode_idx].mode_no) != 0xFF)) { 
-
-				SiSInit(&SiS_Pr, &sishw_ext);
-
+			sishw_ext.pjVideoMemoryAddress = ioremap(ivideo.video_base, 0x8000000);
+			if((sisfb_mode_idx < 0) || ((sisbios_mode[sisfb_mode_idx].mode_no) != 0xFF)) {
 				outSISIDXREG(SISSR, IND_SIS_PASSWORD, SIS_PASSWORD);
-
 				sishw_ext.bSkipDramSizing = TRUE;
 				sishw_ext.pSR[0].jIdx = 0x13;
 				sishw_ext.pSR[1].jIdx = 0x14;
@@ -4106,11 +4540,11 @@
 				sishw_ext.pSR[2].jVal = 0xFF;
 			}
 		}
-#endif
-		if (sisfb_get_dram_size_315()) {
+		if(sisfb_get_dram_size_315()) {
 			vfree(sishw_ext.pSR);
 			vfree(sishw_ext.pCR);
 			printk(KERN_INFO "sisfb: Fatal error: Unable to determine RAM size.\n");
+			kfree(sis_fb_info);
 			return -ENODEV;
 		}
 	}
@@ -4128,39 +4562,59 @@
 
 	sishw_ext.ulVideoMemorySize = ivideo.video_size;
 
+	if(sisvga_engine == SIS_300_VGA) sisfb_pdc &= 0x3c;
 	if(sisfb_pdc) {
-	    sishw_ext.pdc = sisfb_pdc;
+	    SiS_Pr.PDC = sisfb_pdc;
 	} else {
-	    sishw_ext.pdc = 0;
+	    SiS_Pr.PDC = 0;
 	}
 
-	if (!request_mem_region(ivideo.video_base, ivideo.video_size, "sisfb FB")) {
+	if(!request_mem_region(ivideo.video_base, ivideo.video_size, "sisfb FB")) {
 		printk(KERN_ERR "sisfb: Fatal error: Unable to reserve frame buffer memory\n");
 		printk(KERN_ERR "sisfb: Is there another framebuffer driver active?\n");
 		vfree(sishw_ext.pSR);
 		vfree(sishw_ext.pCR);
+		kfree(sis_fb_info);
 		return -ENODEV;
 	}
 
-	if (!request_mem_region(ivideo.mmio_base, sisfb_mmio_size, "sisfb MMIO")) {
+	if(!request_mem_region(ivideo.mmio_base, sisfb_mmio_size, "sisfb MMIO")) {
 		printk(KERN_ERR "sisfb: Fatal error: Unable to reserve MMIO region\n");
 		release_mem_region(ivideo.video_base, ivideo.video_size);
 		vfree(sishw_ext.pSR);
 		vfree(sishw_ext.pCR);
+		kfree(sis_fb_info);
 		return -ENODEV;
 	}
 
-	ivideo.video_vbase = sishw_ext.pjVideoMemoryAddress = 
-		ioremap(ivideo.video_base, ivideo.video_size);
+	ivideo.video_vbase = sishw_ext.pjVideoMemoryAddress = ioremap(ivideo.video_base, ivideo.video_size);
+	if(!ivideo.video_vbase) {
+	   	printk(KERN_ERR "sisfb: Fatal error: Unable to map frame buffer memory\n");
+	   	release_mem_region(ivideo.video_base, ivideo.video_size);
+	   	release_mem_region(ivideo.mmio_base, sisfb_mmio_size);
+	   	vfree(sishw_ext.pSR);
+	   	vfree(sishw_ext.pCR);
+	   	kfree(sis_fb_info);
+	   	return -ENODEV;
+	}
+
 	ivideo.mmio_vbase = ioremap(ivideo.mmio_base, sisfb_mmio_size);
+	if(!ivideo.mmio_vbase) {
+	   	printk(KERN_ERR "sisfb: Fatal error: Unable to map MMIO region\n");
+	   	iounmap(ivideo.video_vbase);
+	   	release_mem_region(ivideo.video_base, ivideo.video_size);
+	   	release_mem_region(ivideo.mmio_base, sisfb_mmio_size);
+	   	vfree(sishw_ext.pSR);
+	   	vfree(sishw_ext.pCR);
+	   	kfree(sis_fb_info);
+	   	return -ENODEV;
+	}
 
 	printk(KERN_INFO "sisfb: Framebuffer at 0x%lx, mapped to 0x%p, size %dk\n",
-	       ivideo.video_base, ivideo.video_vbase,
-	       ivideo.video_size / 1024);
+	       	ivideo.video_base, ivideo.video_vbase, ivideo.video_size / 1024);
 
 	printk(KERN_INFO "sisfb: MMIO at 0x%lx, mapped to 0x%p, size %ldk\n",
-	       ivideo.mmio_base, ivideo.mmio_vbase,
-	       sisfb_mmio_size / 1024);
+	       	ivideo.mmio_base, ivideo.mmio_vbase, sisfb_mmio_size / 1024);
 
 	if(sisfb_heap_init()) {
 		printk(KERN_WARNING "sisfb: Failed to initialize offscreen memory heap\n");
@@ -4168,206 +4622,173 @@
 
 	ivideo.mtrr = (unsigned int) 0;
 
-	if((sisfb_mode_idx < 0) || ((sisbios_mode[sisfb_mode_idx].mode_no) != 0xFF)) { 
-
-#ifdef CONFIG_FB_SIS_300
-		if (sisvga_engine == SIS_300_VGA) {
-			sisfb_get_VB_type_300();
-		}
-#endif
+	ivideo.vbflags = 0;
 
-#ifdef CONFIG_FB_SIS_315
-		if (sisvga_engine == SIS_315_VGA) {
-			sisfb_get_VB_type_315();
-		}
-#endif
+	if((sisfb_mode_idx < 0) || ((sisbios_mode[sisfb_mode_idx].mode_no) != 0xFF)) {
 
 		sishw_ext.ujVBChipID = VB_CHIP_UNKNOWN;
 		sishw_ext.Is301BDH = FALSE;
 		sishw_ext.usExternalChip = 0;
 
-		switch (ivideo.hasVB) {
+		sisfb_sense_crt1();
 
-		case HASVB_301:
-		        inSISIDXREG(SISPART4, 0x01, reg);
-			if (reg >= 0xE0) {
-				sishw_ext.ujVBChipID = VB_CHIP_302LV;
-				printk(KERN_INFO "sisfb: SiS302LV bridge detected (revision 0x%02x)\n",reg);
-	  		} else if (reg >= 0xD0) {
-				sishw_ext.ujVBChipID = VB_CHIP_301LV;
-				printk(KERN_INFO "sisfb: SiS301LV bridge detected (revision 0x%02x)\n",reg);
-	  		} else if (reg >= 0xB0) {
-				sishw_ext.ujVBChipID = VB_CHIP_301B;
-				inSISIDXREG(SISPART4,0x23,reg1);
-				if(!(reg1 & 0x02)) sishw_ext.Is301BDH = TRUE;
-				printk(KERN_INFO "sisfb: SiS301B%s bridge detected (revision 0x%02x)\n",
-					(sishw_ext.Is301BDH ? "-DH" : ""), reg);
-			} else {
-				sishw_ext.ujVBChipID = VB_CHIP_301;
-				printk(KERN_INFO "sisfb: SiS301 bridge detected\n");
-			}
-			break;
-		case HASVB_302:
-		        inSISIDXREG(SISPART4, 0x01, reg);
-			if (reg >= 0xE0) {
-				sishw_ext.ujVBChipID = VB_CHIP_302LV;
-				printk(KERN_INFO "sisfb: SiS302LV bridge detected (revision 0x%02x)\n",reg);
-	  		} else if (reg >= 0xD0) {
-				sishw_ext.ujVBChipID = VB_CHIP_301LV;
-				printk(KERN_INFO "sisfb: SiS302LV bridge detected (revision 0x%02x)\n",reg);
-	  		} else if (reg >= 0xB0) {
-				inSISIDXREG(SISPART4,0x23,reg1);
-				if(!(reg1 & 0x02)) sishw_ext.Is301BDH = TRUE;
-			        sishw_ext.ujVBChipID = VB_CHIP_302B;
-				printk(KERN_INFO "sisfb: SiS302B%s bridge detected (revision 0x%02x)\n",
-					(sishw_ext.Is301BDH ? "-DH" : ""), reg);
-			} else {
-			        sishw_ext.ujVBChipID = VB_CHIP_302;
-				printk(KERN_INFO "sisfb: SiS302 bridge detected\n");
-			}
-			break;
-		case HASVB_LVDS:
-			sishw_ext.usExternalChip = 0x1;
-			printk(KERN_INFO "sisfb: LVDS transmitter detected\n");
-			break;
-		case HASVB_TRUMPION:
-			sishw_ext.usExternalChip = 0x2;
-			printk(KERN_INFO "sisfb: Trumpion Zurac LVDS scaler detected\n");
-			break;
-		case HASVB_CHRONTEL:
-			sishw_ext.usExternalChip = 0x4;
-			printk(KERN_INFO "sisfb: Chrontel TV encoder detected\n");
-			break;
-		case HASVB_LVDS_CHRONTEL:
-			sishw_ext.usExternalChip = 0x5;
-			printk(KERN_INFO "sisfb: LVDS transmitter and Chrontel TV encoder detected\n");
-			break;
-		default:
-			printk(KERN_INFO "sisfb: No or unknown bridge type detected\n");
-			break;
-		}
+		sisfb_get_VB_type();
 
-		if (ivideo.hasVB != HASVB_NONE) {
-#ifdef CONFIG_FB_SIS_300
-		      if (sisvga_engine == SIS_300_VGA) {
-				sisfb_detect_VB_connect_300();
-                      }
-#endif
-#ifdef CONFIG_FB_SIS_315
-		      if (sisvga_engine == SIS_315_VGA) {
-				sisfb_detect_VB_connect_315();
-                      }
-#endif
+		if(ivideo.vbflags & VB_VIDEOBRIDGE) {
+			sisfb_detect_VB_connect();
 		}
 
-		if (ivideo.disp_state & DISPTYPE_DISP2) {
-			if (sisfb_crt1off)
-				ivideo.disp_state |= DISPMODE_SINGLE;
-			else
-				ivideo.disp_state |= (DISPMODE_MIRROR | DISPTYPE_CRT1);
-		} else {
-			ivideo.disp_state = DISPMODE_SINGLE | DISPTYPE_CRT1;
+		ivideo.currentvbflags = ivideo.vbflags & VB_VIDEOBRIDGE;
+
+		if(ivideo.vbflags & VB_VIDEOBRIDGE) {
+		   if(sisfb_crt2type != -1) {
+		      if((sisfb_crt2type == CRT2_LCD) && (ivideo.vbflags & CRT2_LCD)) {
+		         ivideo.currentvbflags |= CRT2_LCD;
+		      } else if(sisfb_crt2type != CRT2_LCD) {
+		         ivideo.currentvbflags |= sisfb_crt2type;
+		      }
+		   } else {
+		      /* Chrontel 700x TV detection often unreliable, therefore use a
+		       * different default order on such machines
+		       */
+		      if((sisvga_engine == SIS_300_VGA) && (ivideo.vbflags & VB_CHRONTEL)) {
+		         if(ivideo.vbflags & CRT2_LCD)      ivideo.currentvbflags |= CRT2_LCD;
+		         else if(ivideo.vbflags & CRT2_TV)  ivideo.currentvbflags |= CRT2_TV;
+		         else if(ivideo.vbflags & CRT2_VGA) ivideo.currentvbflags |= CRT2_VGA;
+		      } else {
+		         if(ivideo.vbflags & CRT2_TV)       ivideo.currentvbflags |= CRT2_TV;
+		         else if(ivideo.vbflags & CRT2_LCD) ivideo.currentvbflags |= CRT2_LCD;
+		         else if(ivideo.vbflags & CRT2_VGA) ivideo.currentvbflags |= CRT2_VGA;
+		      }
+		   }
 		}
 
-		if (ivideo.disp_state & DISPTYPE_LCD) {
-		    if (!enable_dstn) {
-		        inSISIDXREG(SISCR, IND_SIS_LCD_PANEL, reg);
-			reg &= 0x0f;
-			if (sisvga_engine == SIS_300_VGA) {
-			    sishw_ext.ulCRT2LCDType = sis300paneltype[reg];
-			} else {
-			    sishw_ext.ulCRT2LCDType = sis310paneltype[reg];
-			}
-		    } else {
-		        /* TW: FSTN/DSTN */
-			sishw_ext.ulCRT2LCDType = LCD_320x480;
-		    }
+		if(ivideo.vbflags & CRT2_LCD) {
+		   inSISIDXREG(SISCR, IND_SIS_LCD_PANEL, reg);
+		   reg &= 0x0f;
+		   if(sisvga_engine == SIS_300_VGA) {
+		      sishw_ext.ulCRT2LCDType = sis300paneltype[reg];
+		   } else {
+		      sishw_ext.ulCRT2LCDType = sis310paneltype[reg];
+		   }
 		}
 		
 		sisfb_detectedpdc = 0;
-#ifndef LINUXBIOS
+
 #ifdef CONFIG_FB_SIS_300
-                /* TW: Save the current PanelDelayCompensation if the LCD is currently used */
+                /* Save the current PanelDelayCompensation if the LCD is currently used */
 		if(sisvga_engine == SIS_300_VGA) {
-	          if((sishw_ext.usExternalChip == 0x01) ||   /* LVDS */
-		     (sishw_ext.usExternalChip == 0x05) ||   /* LVDS+Chrontel */
-		     (sishw_ext.Is301BDH)) {		     /* 301B-DH */
+	           if(ivideo.vbflags & (VB_LVDS | VB_30xBDH)) {
 		       int tmp;
 		       inSISIDXREG(SISCR,0x30,tmp);
 		       if(tmp & 0x20) {
 		          /* Currently on LCD? If yes, read current pdc */
 		          inSISIDXREG(SISPART1,0x13,sisfb_detectedpdc);
 			  sisfb_detectedpdc &= 0x3c;
-			  if(sishw_ext.pdc == 0) {
+			  if(SiS_Pr.PDC == 0) {
 			     /* Let option override detection */
-			     sishw_ext.pdc = sisfb_detectedpdc;
+			     SiS_Pr.PDC = sisfb_detectedpdc;
 			  }
 			  printk(KERN_INFO
 			         "sisfb: Detected LCD PanelDelayCompensation %d\n",
   			         sisfb_detectedpdc);
 		       }
-		       if((sishw_ext.pdc) && (sishw_ext.pdc != sisfb_detectedpdc)) {
+		       if((SiS_Pr.PDC) && (SiS_Pr.PDC != sisfb_detectedpdc)) {
 		          printk(KERN_INFO
 			         "sisfb: Using LCD PanelDelayCompensation %d\n",
-				 sishw_ext.pdc);
+				 SiS_Pr.PDC);
 		       }
-	          }
+	           }
 		}
 #endif
-#endif
+
 	        sisfb_detectedlcda = 0xff;
-#ifndef LINUXBIOS
+
 #ifdef CONFIG_FB_SIS_315
-                /* TW: Try to find about LCDA */
+
 		if(sisvga_engine == SIS_315_VGA) {
-	          if((sishw_ext.ujVBChipID == VB_CHIP_302B) ||
-		     (sishw_ext.ujVBChipID == VB_CHIP_301LV) ||
-		     (sishw_ext.ujVBChipID == VB_CHIP_302LV)) {
-		       int tmp;
-		       inSISIDXREG(SISCR,0x34,tmp);
-		       if(tmp <= 0x13) {	
-		          /* Currently on LCDA? (Some BIOSes leave CR38) */
-		          inSISIDXREG(SISCR,0x38,tmp);
-			  if((tmp & 0x03) == 0x03) {
-			     SiS_Pr.SiS_UseLCDA = TRUE;
-			  } else {
-			     /* Currently on LCDA? (Some newer BIOSes set D0 in CR35) */
-			     inSISIDXREG(SISCR,0x35,tmp);
-			     if(tmp & 0x01) {
-			        SiS_Pr.SiS_UseLCDA = TRUE;
-			     } else {
-			        /* Currently on LCD? If so, we can find out 
-				   by peeking the mode register 
-				 */
-			        inSISIDXREG(SISCR,0x30,tmp);
-			        if(tmp & 0x20) {
-			           inSISIDXREG(SISPART1,0x13,tmp);
-				   if(tmp & 0x04) {
-				      SiS_Pr.SiS_UseLCDA = TRUE;
-				   }
-			        }
-			     }
-			  }
-		       } 
-		       if(SiS_Pr.SiS_UseLCDA) {
-		          sisfb_detectedlcda = 0x03;
-		          printk(KERN_INFO
-			         "sisfb: Bridge uses LCDA for low resolution and text modes\n");
-		       }
+		   /* Save PDC */
+		   if(ivideo.vbflags & (VB_301LV | VB_302LV | VB_302ELV)) {
+		      int tmp;
+		      inSISIDXREG(SISCR,0x30,tmp);
+		      if(tmp & 0x20) {
+		         /* Currently on LCD? If yes, read current pdc */
+		         inSISIDXREG(SISPART1,0x2D,sisfb_detectedpdc);
+			 if(SiS_Pr.PDC == 0) {
+			    /* Let option override detection */
+			    SiS_Pr.PDC = sisfb_detectedpdc;
+			 }
+			 printk(KERN_INFO
+			        "sisfb: Detected LCD PanelDelayCompensation %d\n",
+  			         sisfb_detectedpdc);
+		      }
+		      if((SiS_Pr.PDC) && (SiS_Pr.PDC != sisfb_detectedpdc)) {
+		         printk(KERN_INFO
+			         "sisfb: Using LCD PanelDelayCompensation %d\n",
+				 SiS_Pr.PDC);
+		      }
+		      /* Save EMI */
+		      if(ivideo.vbflags & (VB_302LV | VB_302ELV)) {
+		         inSISIDXREG(SISPART4,0x30,SiS_Pr.EMI_30);
+			 inSISIDXREG(SISPART4,0x31,SiS_Pr.EMI_31);
+			 inSISIDXREG(SISPART4,0x32,SiS_Pr.EMI_32);
+			 inSISIDXREG(SISPART4,0x33,SiS_Pr.EMI_33);
+			 SiS_Pr.HaveEMI = TRUE;
+			 if(tmp & 0x20) SiS_Pr.HaveEMILCD = TRUE;
+		      }
+		   }
+
+		   /* Try to find about LCDA */
+		   if(ivideo.vbflags & (VB_301C | VB_302B | VB_301LV | VB_302LV | VB_302ELV)) {
+		      int tmp;
+		      inSISIDXREG(SISCR,0x34,tmp);
+		      if((tmp <= 0x13) || (tmp == 0xff)) {
+		         /* Currently on LCDA? (Some BIOSes leave CR38) */
+		         inSISIDXREG(SISCR,0x38,tmp);
+			 if((tmp & 0x03) == 0x03)  SiS_Pr.SiS_UseLCDA = TRUE;
+			 else {
+			    /* Currently on LCDA? (Some newer BIOSes set D0 in CR35) */
+			    inSISIDXREG(SISCR,0x35,tmp);
+			    if(tmp & 0x01) SiS_Pr.SiS_UseLCDA = TRUE;
+			    else {
+			       /* Currently on LCD? If so, we can find out
+			        * by peeking the mode register
+				*/
+			       inSISIDXREG(SISCR,0x30,tmp);
+			       if(tmp & 0x20) {
+			          inSISIDXREG(SISPART1,0x13,tmp);
+				  if(tmp & 0x04) SiS_Pr.SiS_UseLCDA = TRUE;
+			       }
+			    }
+			 }
+		      }
+		      if(SiS_Pr.SiS_UseLCDA) {
+		         sisfb_detectedlcda = 0x03;
+		         printk(KERN_DEBUG
+			        "sisfb: Bridge uses LCDA for low resolution and text modes\n");
+		      }
 	          }
 		}
 #endif
-#endif
+
+		if (!sisfb_crt1off) {
+		   	sisfb_handle_ddc(&sisfb_thismonitor, 0);
+		} else {
+		   	if ((ivideo.vbflags & (VB_301|VB_301B|VB_301C|VB_302B)) &&
+		      	    (ivideo.vbflags & (CRT2_VGA | CRT2_LCD))) {
+		      		sisfb_handle_ddc(&sisfb_thismonitor, 1);
+		   	}
+		}
 
 		if (sisfb_mode_idx >= 0)
-			sisfb_mode_idx = sisfb_validate_mode(sisfb_mode_idx);
+			sisfb_mode_idx = sisfb_validate_mode(sisfb_mode_idx, ivideo.currentvbflags);
 
 		if (sisfb_mode_idx < 0) {
-			switch (ivideo.disp_state & DISPTYPE_DISP2) {
-			   case DISPTYPE_LCD:
+			switch (ivideo.currentvbflags & VB_DISPTYPE_DISP2) {
+			   case CRT2_LCD:
 				sisfb_mode_idx = DEFAULT_LCDMODE;
 				break;
-			   case DISPTYPE_TV:
+			   case CRT2_TV:
 				sisfb_mode_idx = DEFAULT_TVMODE;
 				break;
 			   default:
@@ -4379,39 +4800,27 @@
 		sisfb_mode_no = sisbios_mode[sisfb_mode_idx].mode_no;
 
 		if (ivideo.refresh_rate != 0)
-			sisfb_search_refresh_rate(ivideo.refresh_rate);
+			sisfb_search_refresh_rate(ivideo.refresh_rate, sisfb_mode_idx);
 
 		if (sisfb_rate_idx == 0) {
 			sisfb_rate_idx = sisbios_mode[sisfb_mode_idx].rate_idx;
 			ivideo.refresh_rate = 60;
 		}
 
+		if (sisfb_thismonitor.datavalid) {
+			if(!sisfb_verify_rate(&sisfb_thismonitor, sisfb_mode_idx,
+			                      sisfb_rate_idx, ivideo.refresh_rate)) {
+				printk(KERN_INFO "sisfb: WARNING: Refresh rate exceeds monitor specs!\n");
+			}
+		}
+
 		ivideo.video_bpp = sisbios_mode[sisfb_mode_idx].bpp;
 		ivideo.video_vwidth = ivideo.video_width = sisbios_mode[sisfb_mode_idx].xres;
 		ivideo.video_vheight = ivideo.video_height = sisbios_mode[sisfb_mode_idx].yres;
 		ivideo.org_x = ivideo.org_y = 0;
 		ivideo.video_linelength = ivideo.video_width * (ivideo.video_bpp >> 3);
-		switch(ivideo.video_bpp) {
-        	case 8:
-            		ivideo.DstColor = 0x0000;
-	    		ivideo.SiS310_AccelDepth = 0x00000000;
-			ivideo.video_cmap_len = 256;
-            		break;
-        	case 16:
-            		ivideo.DstColor = 0x8000;
-            		ivideo.SiS310_AccelDepth = 0x00010000;
-			ivideo.video_cmap_len = 16;
-            		break;
-        	case 32:
-            		ivideo.DstColor = 0xC000;
-	    		ivideo.SiS310_AccelDepth = 0x00020000;
-			ivideo.video_cmap_len = 16;
-            		break;
-		default:
-			ivideo.video_cmap_len = 16;
-		        printk(KERN_INFO "sisfb: Unsupported depth %d", ivideo.video_bpp);
-			break;
-    		}
+
+		sisfb_set_vparms();
 		
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)	
 
@@ -4424,30 +4833,56 @@
 		sisfb_pre_setmode();
 
 		if (SiSSetMode(&SiS_Pr, &sishw_ext, sisfb_mode_no) == 0) {
-			printk(KERN_ERR "sisfb: Setting mode[0x%x] failed, using default mode\n", 
+			printk(KERN_ERR "sisfb: Fatal error: Setting mode[0x%x] failed\n",
 				sisfb_mode_no);
-			return -1;
+			vfree(sishw_ext.pSR);
+			vfree(sishw_ext.pCR);
+			release_mem_region(ivideo.video_base, ivideo.video_size);
+			release_mem_region(ivideo.mmio_base, sisfb_mmio_size);
+			kfree(sis_fb_info);
+			return -EINVAL;
 		}
 
 		outSISIDXREG(SISSR, IND_SIS_PASSWORD, SIS_PASSWORD);
 
 		sisfb_post_setmode();
 
+		ivideo.accel = 0;
+		if(sisfb_accel) {
+		   ivideo.accel = -1;
+		   default_var.accel_flags |= FB_ACCELF_TEXT;
+		   sisfb_initaccel();
+		}
+
+		/* Maximize regardless of sisfb_max at startup */
+		default_var.yres_virtual = 32767;
 		sisfb_crtc_to_var(&default_var);
 		
+		sis_fb_info->node = -1;
+		sis_fb_info->flags = FBINFO_FLAG_DEFAULT;
+		sis_fb_info->blank = &sisfb_blank;
+		sis_fb_info->fbops = &sisfb_ops;
+		sis_fb_info->switch_con = &sisfb_switch;
+		sis_fb_info->updatevar = &sisfb_update_var;
+		sis_fb_info->changevar = NULL;
+		sis_fb_info->disp = &sis_disp;
+		strcpy(sis_fb_info->fontname, sisfb_fontname);
+
+		sisfb_set_disp(-1, &default_var, sis_fb_info);
+
 #else		/* --------- For 2.5: Setup a somewhat sane default var ------------ */
 
 		printk(KERN_INFO "sisfb: Default mode is %dx%dx%d (%dHz)\n",
 	       		ivideo.video_width, ivideo.video_height, ivideo.video_bpp,
 			ivideo.refresh_rate);
-			
+
 		default_var.xres = default_var.xres_virtual = ivideo.video_width;
 		default_var.yres = default_var.yres_virtual = ivideo.video_height;
 		default_var.bits_per_pixel = ivideo.video_bpp;
-		
+
 		sisfb_bpp_to_var(&default_var);
 		
-		default_var.pixclock = (u32) (1E12 /
+		default_var.pixclock = (u32) (1000000000 /
 				sisfb_mode_rate_to_dclock(&SiS_Pr, &sishw_ext,
 						sisfb_mode_no, sisfb_rate_idx));
 						
@@ -4457,28 +4892,10 @@
 			 &default_var.upper_margin, &default_var.lower_margin,
 			 &default_var.hsync_len, &default_var.vsync_len,
 			 &default_var.sync, &default_var.vmode)) {
-			 
-		   if((default_var.vmode & FB_VMODE_MASK) == FB_VMODE_INTERLACED) {
-		      default_var.yres <<= 1;
-		      default_var.yres_virtual <<= 1;
-		   } else if((default_var.vmode	& FB_VMODE_MASK) == FB_VMODE_DOUBLE) {
-		      default_var.pixclock >>= 1;
-		      default_var.yres >>= 1;
-		      default_var.yres_virtual >>= 1;
-		   }
-		   
+		   if((default_var.vmode & FB_VMODE_MASK) == FB_VMODE_DOUBLE) {
+		      default_var.pixclock <<= 1;
+	   	   }
 	        }
-#ifdef SISFB_PAN
-		if(sisfb_ypan) {
-	    		default_var.yres_virtual = 
-				ivideo.heapstart / (default_var.xres * (default_var.bits_per_pixel >> 3));
-	    		if(default_var.yres_virtual <= default_var.yres) {
-	        		default_var.yres_virtual = default_var.yres;
-	    		}
-		} 
-#endif
-		
-#endif
 
 		ivideo.accel = 0;
 		if(sisfb_accel) {
@@ -4487,32 +4904,33 @@
 		   sisfb_initaccel();
 		}
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)		/* ---- 2.4 series init ---- */
-		sis_fb_info.node = -1;
-		sis_fb_info.flags = FBINFO_FLAG_DEFAULT;
-		sis_fb_info.blank = &sisfb_blank;
-		sis_fb_info.fbops = &sisfb_ops;
-		sis_fb_info.switch_con = &sisfb_switch;
-		sis_fb_info.updatevar = &sisfb_update_var;
-		sis_fb_info.changevar = NULL;
-		sis_fb_info.disp = &sis_disp;
-			
-		sisfb_set_disp(-1, &default_var, &sis_fb_info);
-#endif
-
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)		/* ---- 2.5 series init ---- */
-		sis_fb_info.flags = FBINFO_FLAG_DEFAULT;
-		sis_fb_info.var = default_var;
-		sis_fb_info.fix = sisfb_fix;
-		sis_fb_info.par = &ivideo;
-		sis_fb_info.screen_base = ivideo.video_vbase;
-		sis_fb_info.fbops = &sisfb_ops;
-		sisfb_get_fix(&sis_fb_info.fix, -1, &sis_fb_info);
-		sis_fb_info.pseudo_palette = pseudo_palette;
+		if(sisfb_ypan) {
+		   /* Maximize regardless of sisfb_max at startup */
+	    	   default_var.yres_virtual =
+				ivideo.heapstart / (default_var.xres * (default_var.bits_per_pixel >> 3));
+		   if(default_var.yres_virtual > 32767) default_var.yres_virtual = 32767;
+	    	   if(default_var.yres_virtual <= default_var.yres) {
+	              default_var.yres_virtual = default_var.yres;
+	    	   }
+		}
+
+		sis_fb_info->flags = FBINFO_FLAG_DEFAULT;
+		sis_fb_info->var = default_var;
+		sis_fb_info->fix = sisfb_fix;
+		sis_fb_info->par = &ivideo;
+		sis_fb_info->screen_base = ivideo.video_vbase;
+		sis_fb_info->fbops = &sisfb_ops;
+#ifdef NEWFBDEV
+		sis_fb_info->class_dev.dev = &pdev->dev;
+#endif
+		sisfb_get_fix(&sis_fb_info->fix, -1, sis_fb_info);
+		sis_fb_info->pseudo_palette = pseudo_palette;
 		
-		fb_alloc_cmap(&sis_fb_info.cmap, 256 , 0);
+		fb_alloc_cmap(&sis_fb_info->cmap, 256 , 0);
 #endif
 
+		printk(KERN_INFO "sisfb: Initial vbflags 0x%lx\n", ivideo.vbflags);
+
 #ifdef CONFIG_MTRR
 		ivideo.mtrr = mtrr_add((unsigned int) ivideo.video_base,
 				(unsigned int) ivideo.video_size,
@@ -4520,37 +4938,44 @@
 		if(ivideo.mtrr) {
 			printk(KERN_INFO "sisfb: Added MTRRs\n");
 		}
+
 #endif
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
 		vc_resize_con(1, 1, 0);
 #endif
 
-		TWDEBUG("Before calling register_framebuffer");
-		
-		if(register_framebuffer(&sis_fb_info) < 0)
+		if(register_framebuffer(sis_fb_info) < 0) {
+			vfree(sishw_ext.pSR);
+			vfree(sishw_ext.pCR);
+			release_mem_region(ivideo.video_base, ivideo.video_size);
+			release_mem_region(ivideo.mmio_base, sisfb_mmio_size);
+			printk(KERN_ERR "sisfb: Fatal error: Failed to register framebuffer\n");
+			kfree(sis_fb_info);
 			return -EINVAL;
-			
+		}
+
 		sisfb_registered = 1;			
 
-		printk(KERN_INFO "sisfb: Installed SISFB_GET_INFO ioctl (%x)\n", SISFB_GET_INFO);
+		printk(KERN_DEBUG "sisfb: Installed SISFB_GET_INFO ioctl (%x)\n", SISFB_GET_INFO);
+		printk(KERN_DEBUG "sisfb: Installed SISFB_GET_VBRSTATUS ioctl (%x)\n", SISFB_GET_VBRSTATUS);
 		
 		printk(KERN_INFO "sisfb: 2D acceleration is %s, scrolling mode %s\n",
 		     sisfb_accel ? "enabled" : "disabled",
-		     sisfb_ypan  ? "ypan" : "redraw");
+		     sisfb_ypan  ? (sisfb_max ? "ypan (auto-max)" : "ypan (no auto-max)") : "redraw");
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
 		printk(KERN_INFO "fb%d: %s frame buffer device, Version %d.%d.%02d\n",
-	       		GET_FB_IDX(sis_fb_info.node), sis_fb_info.modename, VER_MAJOR, VER_MINOR,
+	       		GET_FB_IDX(sis_fb_info->node), sis_fb_info->modename, VER_MAJOR, VER_MINOR,
 	       		VER_LEVEL);		     
-#endif
-
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
+#else
 		printk(KERN_INFO "fb%d: %s frame buffer device, Version %d.%d.%02d\n",
-	       		sis_fb_info.node, myid, VER_MAJOR, VER_MINOR, VER_LEVEL);			     
+	       		sis_fb_info->node, myid, VER_MAJOR, VER_MINOR, VER_LEVEL);
 #endif
 
-	}	/* TW: if mode = "none" */
+		printk(KERN_INFO "sisfb: (C) 2001-2004 Thomas Winischhofer.\n");
+
+	}	/* if mode = "none" */
 	return 0;
 }
 
@@ -4562,38 +4987,47 @@
 static unsigned int rate = 0;
 static unsigned int crt1off = 1;
 static unsigned int mem = 0;
-static unsigned int dstn = 0;
 static char         *forcecrt2type = NULL;
 static int          forcecrt1 = -1;
 static char         *queuemode = NULL;
 static int          pdc = 0;
 static int          noaccel = -1;
 static int          noypan  = -1;
+static int	    nomax = -1;
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
 static int          inverse = 0;
 #endif
 static int          userom = 1;
 static int          useoem = -1;
 static char         *tvstandard = NULL;
+static int	    nocrt2rate = 0;
+static int          scalelcd = -1;
+static char	    *specialtiming = NULL;
+static int	    lvdshl = -1;
 
-MODULE_DESCRIPTION("SiS 300/540/630/730/315/550/650/740/330 framebuffer driver");
+MODULE_DESCRIPTION("SiS 300/540/630/730/315/550/650/651/661/740/741/330/760 framebuffer driver");
 MODULE_LICENSE("GPL");
-MODULE_AUTHOR("SiS; Thomas Winischhofer <thomas@winischhofer.net>; Various others");
+MODULE_AUTHOR("Thomas Winischhofer <thomas@winischhofer.net>; SiS; Various others");
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
 MODULE_PARM(mode, "s");
 MODULE_PARM_DESC(mode,
        "\nSelects the desired display mode in the format [X]x[Y]x[Depth], eg.\n"
-         "800x600x16 (default: none if sisfb is a module; this leaves the\n"
-	 "console untouched and the driver will only do the video memory\n"
-	 "management for eg. DRM/DRI; 800x600x8 if sisfb is in the kernel)");
+         "1024x768x16. Other formats supported include XxY-Depth and\n"
+	 "XxY-Depth@Rate. If the parameter is only one (decimal or hexadecimal)\n"
+	 "number, it will be interpreted as a VESA mode number. (default: none if\n"
+	 "sisfb is a module; this leaves the console untouched and the driver will\n"
+	 "only do the video memory management for eg. DRM/DRI; 800x600x8 if sisfb\n"
+	 "is in the kernel)");
 #endif
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)	 
 MODULE_PARM(mode, "s");
 MODULE_PARM_DESC(mode,
-       "\nSelects the desired default display mode in the format [X]x[Y]x[Depth],\n"
-         "eg. 1024x768x16 (default: 800x600x8)");
-#endif	 
+       "\nSelects the desired default display mode in the format XxYxDepth,\n"
+         "eg. 1024x768x16. Other formats supported include XxY-Depth and\n"
+	 "XxY-Depth@Rate. If the parameter is only one (decimal or hexadecimal)\n"
+	 "number, it will be interpreted as a VESA mode number. (default: 800x600x8)");
+#endif
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
 MODULE_PARM(vesa, "i");
@@ -4603,17 +5037,18 @@
 	 "and the driver will only do the video memory management for eg. DRM/DRI;\n"
 	 "0x0103 if sisfb is in the kernel)");
 #endif
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)	 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
 MODULE_PARM(vesa, "i");
 MODULE_PARM_DESC(vesa,
        "\nSelects the desired default display mode by VESA defined mode number, eg.\n"
          "0x117 (default: 0x0103)");
-#endif	 
+#endif
 
 MODULE_PARM(rate, "i");
 MODULE_PARM_DESC(rate,
 	"\nSelects the desired vertical refresh rate for CRT1 (external VGA) in Hz.\n"
-	"(default: 60)");
+	  "If the mode is specified in the format XxY-Depth@Rate, this parameter\n"
+	  "will be ignored (default: 60)");
 
 MODULE_PARM(crt1off,   "i");
 MODULE_PARM_DESC(crt1off,
@@ -4624,14 +5059,9 @@
 	"\nSelects TV flicker filter type (only for systems with a SiS301 video bridge).\n"
 	  "(Possible values 0-7, default: [no filter])");
 
-MODULE_PARM(dstn,   "i");
-MODULE_PARM_DESC(dstn,
-	"\nSelects DSTN/FSTN display mode for SiS550. This sets CRT2 type to LCD and\n"
-	  "overrides forcecrt2type setting. (1=ON, 0=OFF) (default: 0)");
-
 MODULE_PARM(queuemode,   "s");
 MODULE_PARM_DESC(queuemode,
-	"\nSelects the queue mode on 315/550/650/740/330. Possible choices are AGP, VRAM or\n"
+	"\nSelects the queue mode on 315/550/65x/74x/330/760. Possible choices are AGP, VRAM,\n"
   	  "MMIO. AGP is only available if the kernel has AGP support. The queue mode is\n"
 	  "important to programs using the 2D/3D accelerator of the SiS chip. The modes\n"
 	  "require a totally different way of programming the engines. If any mode than\n"
@@ -4642,11 +5072,12 @@
 MODULE_PARM(mem,    "i");
 MODULE_PARM_DESC(mem,
 	"\nDetermines the beginning of the video memory heap in KB. This heap is used\n"
-	  "for video RAM management for eg. DRM/DRI. The default depends on the amount\n"
-	  "of video RAM available. If 8MB of video RAM or less is available, the heap\n"
-	  "starts at 4096KB, if between 8 and 16MB are available at 8192KB, otherwise\n"
-	  "at 12288KB. The value is to be specified without 'KB' and should match\n"
-	  "the MaxXFBMem setting for XFree 4.x (x>=2).");
+	  "for video RAM management for eg. DRM/DRI. On 300 series, the default depends\n"
+	  "on the amount of video RAM available. If 8MB of video RAM or less is available,\n"
+	  "the heap starts at 4096KB, if between 8 and 16MB are available at 8192KB,\n"
+	  "otherwise at 12288KB. On 315 and Xabre series, the heap is 1MB by default. The\n"
+	  "value is to be specified without 'KB' and should match the MaxXFBMem setting for\n"
+	  "XFree 4.x (x>=2).");
 
 MODULE_PARM(forcecrt2type, "s");
 MODULE_PARM_DESC(forcecrt2type,
@@ -4664,65 +5095,97 @@
 
 MODULE_PARM(pdc, "i");
 MODULE_PARM_DESC(pdc,
-        "\n(300 series only) This is for manually selecting the LCD panel delay\n"
-	  "compensation. The driver should detect this correctly in most cases; however,\n"
-	  "sometimes this is not possible. If you see 'small waves' on the LCD, try\n"
-	  "setting this to 4, 32 or 24. If the problem persists, try other values\n"
-	  "between 4 and 60 in steps of 4. (default: [autodetected])");
+        "\nThis is for manually selecting the LCD panel delay compensation. The driver\n"
+	  "should detect this correctly in most cases; however, sometimes this is not\n"
+	  "possible. If you see 'small waves' on the LCD, try setting this to 4, 32 or 24\n"
+	  "on a 300 series chipset; 3 or 51 on a 315 series chipset. If the problem persists,\n"
+	  "try other values (on 300 series: between 4 and 60 in steps of 4; on 315 series:\n"
+	  "and value from 0 to 255). (default: [autodetected])");
 
 MODULE_PARM(noaccel, "i");
 MODULE_PARM_DESC(noaccel,
-        "\nIf set to anything other than 0, 2D acceleration and y-panning will be\n"
-	"disabled. (default: 0)");
+        "\nIf set to anything other than 0, 2D acceleration will be disabled.\n"
+	  "(default: 0)");
 
 MODULE_PARM(noypan, "i");
 MODULE_PARM_DESC(noypan,
         "\nIf set to anything other than 0, y-panning will be disabled and scrolling\n"
-	"will be performed by redrawing the screen. This required 2D acceleration, so\n"
-	"if the option noaccel is set, y-panning will be disabled. (default: 0)");
+ 	  "will be performed by redrawing the screen. (default: 0)");
+
+MODULE_PARM(nomax, "i");
+MODULE_PARM_DESC(nomax,
+        "\nIf y-panning is enabled, sisfb will by default use the entire available video\n"
+	  "memory for the virtual screen in order to optimize scrolling performance. If this\n"
+	  "is set to anything other than 0, sisfb will not do this and thereby enable the user\n"
+	  "to positively specify a virtual Y size of the screen using fbset. (default: 0)\n");
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)	
 MODULE_PARM(inverse, "i");
 MODULE_PARM_DESC(inverse,
         "\nSetting this to anything but 0 should invert the display colors, but this\n"
-	"does not seem to work. (default: 0)");
+	  "does not seem to work. (default: 0)");
 #endif	
 
 MODULE_PARM(userom, "i");
 MODULE_PARM_DESC(userom,
         "\nSetting this to 0 keeps sisfb from using the video BIOS data which is needed\n"
-	"for some LCD and TV setup. (default: 1)");
+	  "for some LCD and TV setup. (default: 1)");
 
 MODULE_PARM(useoem, "i");
 MODULE_PARM_DESC(useoem,
         "\nSetting this to 0 keeps sisfb from using its internel OEM data for some LCD\n"
-	"panels and TV connector types. (default: auto)");
+	  "panels and TV connector types. (default: [auto])");
 
 MODULE_PARM(tvstandard, "s");
 MODULE_PARM_DESC(tvstandard,
 	"\nThis allows overriding the BIOS default for the TV standard. Valid choices are\n"
-	"pal and ntsc. (default: auto)");
+	  "pal and ntsc. (default: [auto])");
+
+MODULE_PARM(nocrt2rate, "i");
+MODULE_PARM_DESC(nocrt2rate,
+	"\nSetting this to 1 will force the driver to use the default refresh rate for\n"
+	  "CRT2 if CRT2 type is VGA. (default: 0, use same rate as CRT1)");
+
+MODULE_PARM(scalelcd, "i");
+MODULE_PARM_DESC(scalelcd,
+	"\nSetting this to 1 will force the driver to scale the LCD image to the panel's\n"
+	  "native resolution. Setting it to 0 will disable scaling; if the panel can scale\n"
+	  "by itself, it will probably do this, otherwise you will see a black bar around\n"
+	  "the screen image. Default: [autodetect if panel can scale]");
+
+MODULE_PARM(specialtiming, "s");
+
+MODULE_PARM(lvdshl, "i");
+
 
 int init_module(void)
 {
 	int err;
-	
+
+	SiS_Pr.UsePanelScaler = -1;
+	SiS_Pr.SiS_CustomT = CUT_NONE;
+	SiS_Pr.LVDSHL = -1;
+
+	ivideo.refresh_rate = sisfb_parm_rate = rate;
+
+	if((scalelcd == 0) || (scalelcd == 1)) {
+	   SiS_Pr.UsePanelScaler = scalelcd ^ 1;
+	}
+
 	if(mode)
-		sisfb_search_mode(mode);
+		sisfb_search_mode(mode, FALSE);
 	else if(vesa != -1)
-		sisfb_search_vesamode(vesa);
-	else  
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)	
+		sisfb_search_vesamode(vesa, FALSE);
+	else
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
 		/* For 2.4, set mode=none if no mode is given  */
 		sisfb_mode_idx = MODE_INDEX_NONE;
 #endif
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
-		/* For 2.5, we don't need this "mode=none" stuff anymore */	
+		/* For 2.5, we don't need this "mode=none" stuff anymore */
 		sisfb_mode_idx = DEFAULT_MODE;
 #endif
 
-	ivideo.refresh_rate = rate;
-
 	if(forcecrt2type)
 		sisfb_search_crt2type(forcecrt2type);
 
@@ -4746,11 +5209,12 @@
 	if(noypan == 1)       sisfb_ypan = 0;
 	else if(noypan == 0)  sisfb_ypan = 1;
 
-	/* TW: Panning only with acceleration */
-	if(sisfb_accel == 0)  sisfb_ypan = 0;
+	if(nomax == 1)        sisfb_max = 0;
+	else if(nomax == 0)   sisfb_max = 1;
 	
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
 	if(inverse)           sisfb_inverse = 1;
+	sisfb_fontname[0] = '\0';
 #endif
 
 	if(mem)		      sisfb_mem = mem;
@@ -4759,24 +5223,21 @@
 
 	sisfb_useoem = useoem;
 
-	enable_dstn = dstn;
-
-	/* TW: DSTN overrules forcecrt2type */
-	if (enable_dstn)      sisfb_crt2type = DISPTYPE_LCD;
-
 	if (queuemode)        sisfb_search_queuemode(queuemode);
 	
-	/* TW: If other queuemode than MMIO, disable 2D accel and ypan */
+	/* If other queuemode than MMIO, disable 2D accel and ypan */
 	if((sisfb_queuemode != -1) && (sisfb_queuemode != MMIO_CMD)) {
 	        sisfb_accel = 0;
-		sisfb_ypan = 0;
 	}
 
-        if(pdc) {
-	   if(!(pdc & ~0x3c)) {
-	        sisfb_pdc = pdc & 0x3c;
-	   }
-	}
+        if(pdc) sisfb_pdc = pdc & 0x3c;
+
+	sisfb_nocrt2rate = nocrt2rate;
+
+	if(specialtiming)
+		sisfb_search_specialtiming(specialtiming);
+
+	if((lvdshl >= 0) && (lvdshl <= 3)) SiS_Pr.LVDSHL = lvdshl;
 
 	if((err = sisfb_init()) < 0) return err;
 
@@ -4785,12 +5246,16 @@
 
 void cleanup_module(void)
 {
-	/* TW: Release mem regions */
+	/* Unmap */
+	iounmap(ivideo.video_vbase);
+	iounmap(ivideo.mmio_vbase);
+
+	/* Release mem regions */
 	release_mem_region(ivideo.video_base, ivideo.video_size);
 	release_mem_region(ivideo.mmio_base, sisfb_mmio_size);
-	
+
 #ifdef CONFIG_MTRR
-	/* TW: Release MTRR region */
+	/* Release MTRR region */
 	if(ivideo.mtrr) {
 		mtrr_del(ivideo.mtrr,
 		      (unsigned int)ivideo.video_base,
@@ -4800,13 +5265,24 @@
 
 	/* Unregister the framebuffer */
 	if(sisfb_registered) {
-		unregister_framebuffer(&sis_fb_info);
+		unregister_framebuffer(sis_fb_info);
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)) && (defined(NEWFBDEV))
+		framebuffer_release(sis_fb_info);
+#else
+		kfree(sis_fb_info);
+#endif
 	}
-	
+
 	if(sishw_ext.pSR) vfree(sishw_ext.pSR);
 	if(sishw_ext.pCR) vfree(sishw_ext.pCR);
 	
-	/* TODO: Restore the initial mode */
+	/* TODO: Restore the initial mode
+	 * This sounds easy but is as good as impossible
+	 * on many machines with SiS chip and video bridge
+	 * since text modes are always set up differently
+	 * from machine to machine. Depends on the type
+	 * of integration between chipset and bridge.
+	 */
 	
 	printk(KERN_INFO "sisfb: Module unloaded\n");
 }
--- diff/drivers/video/sis/sis_main.h	2003-10-09 09:47:17.000000000 +0100
+++ source/drivers/video/sis/sis_main.h	2004-02-09 10:39:55.000000000 +0000
@@ -1,24 +1,42 @@
+/*
+ * SiS 300/630/730/540/315/550/650/651/M650/661FX/M661FX/740/741/330/760
+ * frame buffer driver for Linux kernels 2.4.x and 2.5.x
+ *
+ * Copyright (C) 2001-2004 Thomas Winischhofer, Vienna, Austria.
+ *
+ * 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 named License,
+ * or 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 _SISFB_MAIN
 #define _SISFB_MAIN
 
-/* Comments and changes marked with "TW" by Thomas Winischhofer <thomas@winischhofer.net> */
-
 #include "vstruct.h"
 
 /* ------------------- Constant Definitions ------------------------- */
 
-#undef LINUXBIOS   /* turn this on when compiling for LINUXBIOS */
 #define AGPOFF     /* default is turn off AGP */
 
 #define SISFAIL(x) do { printk(x "\n"); return -EINVAL; } while(0)
 
 #define VER_MAJOR                 1
 #define VER_MINOR                 6
-#define VER_LEVEL                 1
+#define VER_LEVEL                 25
 
 #include "sis.h"
 
-/* TW: To be included in pci_ids.h */
+/* To be included in pci_ids.h */
 #ifndef PCI_DEVICE_ID_SI_650_VGA
 #define PCI_DEVICE_ID_SI_650_VGA  0x6325
 #endif
@@ -31,13 +49,28 @@
 #ifndef PCI_DEVICE_ID_SI_330
 #define PCI_DEVICE_ID_SI_330      0x0330
 #endif
+#ifndef PCI_DEVICE_ID_SI_660_VGA
+#define PCI_DEVICE_ID_SI_660_VGA  0x6330
+#endif
+#ifndef PCI_DEVICE_ID_SI_660
+#define PCI_DEVICE_ID_SI_660      0x0661
+#endif
+#ifndef PCI_DEVICE_ID_SI_741
+#define PCI_DEVICE_ID_SI_741      0x0741
+#endif
+#ifndef PCI_DEVICE_ID_SI_660
+#define PCI_DEVICE_ID_SI_660      0x0660
+#endif
+#ifndef PCI_DEVICE_ID_SI_760
+#define PCI_DEVICE_ID_SI_760      0x0760
+#endif
 
 /* To be included in fb.h */
 #ifndef FB_ACCEL_SIS_GLAMOUR_2
-#define FB_ACCEL_SIS_GLAMOUR_2  40	/* SiS 315, 650, 740		*/
+#define FB_ACCEL_SIS_GLAMOUR_2  40	/* SiS 315, 65x, 740, 661, 741  */
 #endif
 #ifndef FB_ACCEL_SIS_XABRE
-#define FB_ACCEL_SIS_XABRE      41	/* SiS 330 ("Xabre")		*/
+#define FB_ACCEL_SIS_XABRE      41	/* SiS 330 ("Xabre"), 760 	*/
 #endif
 
 #define MAX_ROM_SCAN              0x10000
@@ -53,13 +86,12 @@
 #define TURBO_QUEUE_AREA_SIZE     0x80000 /* 512K */
 #endif
 
-/* For 315 series */
+/* For 315/Xabre series */
 #ifdef CONFIG_FB_SIS_315
 #define COMMAND_QUEUE_AREA_SIZE   0x80000 /* 512K */
 #define COMMAND_QUEUE_THRESHOLD   0x1F
 #endif
 
-/* TW */
 #define HW_CURSOR_AREA_SIZE_315   0x4000  /* 16K */
 #define HW_CURSOR_AREA_SIZE_300   0x1000  /* 4K */
 
@@ -95,7 +127,9 @@
 #define SISDAC2A                  SISPART5
 #define SISDAC2D                  (SISPART5 + 1)
 #define SISMISCR                  (SiS_Pr.RelIO + 0x1c)
-#define SISINPSTAT		  (SiS_Pr.RelIO + 0x2a)  
+#define SISMISCW                  SiS_Pr.SiS_P3c2
+#define SISINPSTAT		  (SiS_Pr.RelIO + 0x2a)
+#define SISPEL			  SiS_Pr.SiS_P3c6
 
 #define IND_SIS_PASSWORD          0x05  /* SRs */
 #define IND_SIS_COLOR_MODE        0x06
@@ -149,14 +183,6 @@
 #define SIS_DATA_BUS_64           0x01
 #define SIS_DATA_BUS_128          0x02
 
-#define SIS315_DRAM_SIZE_MASK     0xF0  /* 315 SR14 */
-#define SIS315_DRAM_SIZE_2MB      0x01
-#define SIS315_DRAM_SIZE_4MB      0x02
-#define SIS315_DRAM_SIZE_8MB      0x03
-#define SIS315_DRAM_SIZE_16MB     0x04
-#define SIS315_DRAM_SIZE_32MB     0x05
-#define SIS315_DRAM_SIZE_64MB     0x06
-#define SIS315_DRAM_SIZE_128MB    0x07
 #define SIS315_DATA_BUS_MASK      0x02
 #define SIS315_DATA_BUS_64        0x00
 #define SIS315_DATA_BUS_128       0x01
@@ -166,17 +192,6 @@
 #define SIS315_ASYM_DDR		  	0x02
 #define SIS315_DUAL_CHANNEL_1_RANK    	0x3
 
-#define SIS550_DRAM_SIZE_MASK     0x3F  /* 550/650/740 SR14 */
-#define SIS550_DRAM_SIZE_4MB      0x00
-#define SIS550_DRAM_SIZE_8MB      0x01
-#define SIS550_DRAM_SIZE_16MB     0x03
-#define SIS550_DRAM_SIZE_24MB     0x05
-#define SIS550_DRAM_SIZE_32MB     0x07
-#define SIS550_DRAM_SIZE_64MB     0x0F
-#define SIS550_DRAM_SIZE_96MB     0x17
-#define SIS550_DRAM_SIZE_128MB    0x1F
-#define SIS550_DRAM_SIZE_256MB    0x3F
-
 #define SIS_SCRATCH_REG_1A_MASK   0x10
 
 #define SIS_ENABLE_2D             0x40  /* SR1E */
@@ -217,7 +232,7 @@
 #define SIS_VB_TV                 (SIS_VB_COMPOSITE | SIS_VB_SVIDEO | \
                                    SIS_VB_SCART | SIS_VB_HIVISION)
 
-#define SIS_EXTERNAL_CHIP_MASK    	   0x0E  /* CR37 */
+#define SIS_EXTERNAL_CHIP_MASK    	   0x0E  /* CR37 (< SiS 660) */
 #define SIS_EXTERNAL_CHIP_SIS301           0x01  /* in CR37 << 1 ! */
 #define SIS_EXTERNAL_CHIP_LVDS             0x02  /* in CR37 << 1 ! */
 #define SIS_EXTERNAL_CHIP_TRUMPION         0x03  /* in CR37 << 1 ! */
@@ -236,12 +251,33 @@
 #define BRI_DRAM_SIZE_32MB        0x04
 #define BRI_DRAM_SIZE_64MB        0x05
 
-#define HW_DEVICE_EXTENSION	  SIS_HW_DEVICE_INFO
-#define PHW_DEVICE_EXTENSION      PSIS_HW_DEVICE_INFO
+#define HW_DEVICE_EXTENSION	  SIS_HW_INFO
+#define PHW_DEVICE_EXTENSION      PSIS_HW_INFO
 
 #define SR_BUFFER_SIZE            5
 #define CR_BUFFER_SIZE            5
 
+/* entries for disp_state - deprecated as of 1.6.02 */
+#define DISPTYPE_CRT1       0x00000008L
+#define DISPTYPE_CRT2       0x00000004L
+#define DISPTYPE_LCD        0x00000002L
+#define DISPTYPE_TV         0x00000001L
+#define DISPTYPE_DISP1      DISPTYPE_CRT1
+#define DISPTYPE_DISP2      (DISPTYPE_CRT2 | DISPTYPE_LCD | DISPTYPE_TV)
+#define DISPMODE_SINGLE	    0x00000020L
+#define DISPMODE_MIRROR	    0x00000010L
+#define DISPMODE_DUALVIEW   0x00000040L
+
+/* Deprecated as of 1.6.02 - use vbflags instead */
+#define HASVB_NONE      	0x00
+#define HASVB_301       	0x01
+#define HASVB_LVDS      	0x02
+#define HASVB_TRUMPION  	0x04
+#define HASVB_LVDS_CHRONTEL	0x10
+#define HASVB_302       	0x20
+#define HASVB_303       	0x40
+#define HASVB_CHRONTEL  	0x80
+
 /* Useful macros */
 #define inSISREG(base)          inb(base)
 #define outSISREG(base,val)     outb(val,base)
@@ -281,50 +317,48 @@
 /* ------------------- Global Variables ----------------------------- */
 
 /* Fbcon variables */
-static struct fb_info sis_fb_info;
-
-static int    video_type = FB_TYPE_PACKED_PIXELS;
+static struct fb_info *sis_fb_info;
 
 static struct fb_var_screeninfo default_var = {
-	.xres		= 0,
-	.yres		= 0,
-	.xres_virtual	= 0,
-	.yres_virtual	= 0,
-	.xoffset	= 0,
-	.yoffset	= 0,
-	.bits_per_pixel	= 0,
-	.grayscale	= 0,
-	.red		= {0, 8, 0},
-	.green		= {0, 8, 0},
-	.blue		= {0, 8, 0},
-	.transp		= {0, 0, 0},
-	.nonstd		= 0,
-	.activate	= FB_ACTIVATE_NOW,
-	.height		= -1,
-	.width		= -1,
-	.accel_flags	= 0,
-	.pixclock	= 0,
-	.left_margin	= 0,
-	.right_margin	= 0,
-	.upper_margin	= 0,
-	.lower_margin	= 0,
-	.hsync_len	= 0,
-	.vsync_len	= 0,
-	.sync		= 0,
-	.vmode		= FB_VMODE_NONINTERLACED,
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)	
-	.reserved	= {0, 0, 0, 0, 0, 0}
-#endif	
+	.xres            = 0,
+	.yres            = 0,
+	.xres_virtual    = 0,
+	.yres_virtual    = 0,
+	.xoffset         = 0,
+	.yoffset         = 0,
+	.bits_per_pixel  = 0,
+	.grayscale       = 0,
+	.red             = {0, 8, 0},
+	.green           = {0, 8, 0},
+	.blue            = {0, 8, 0},
+	.transp          = {0, 0, 0},
+	.nonstd          = 0,
+	.activate        = FB_ACTIVATE_NOW,
+	.height          = -1,
+	.width           = -1,
+	.accel_flags     = 0,
+	.pixclock        = 0,
+	.left_margin     = 0,
+	.right_margin    = 0,
+	.upper_margin    = 0,
+	.lower_margin    = 0,
+	.hsync_len       = 0,
+	.vsync_len       = 0,
+	.sync            = 0,
+	.vmode           = FB_VMODE_NONINTERLACED,
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
+	.reserved        = {0, 0, 0, 0, 0, 0}
+#endif
 };
 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
 static struct fb_fix_screeninfo sisfb_fix = {
 	.id		= "SiS",
 	.type		= FB_TYPE_PACKED_PIXELS,
-	.xpanstep	= 1,
+	.xpanstep	= 0,
 	.ypanstep	= 1,
 };
-static char myid[20];
+static char myid[40];
 static u32 pseudo_palette[17];
 #endif
 
@@ -347,62 +381,55 @@
 } sis_fbcon_cmap;
 
 static int sisfb_inverse = 0;
+static int currcon = 0;
 #endif
 
-/* display status */
+/* global flags */
 static int sisfb_off = 0;
 static int sisfb_crt1off = 0;
 static int sisfb_forcecrt1 = -1;
 static int sisvga_enabled = 0;
 static int sisfb_userom = 1;
 static int sisfb_useoem = -1;
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
-static int currcon = 0;
-#endif
-
-/* global flags */
-static int sisfb_registered;
-static int sisfb_tvmode = 0;
+static int sisfb_parm_rate = -1;
+static int sisfb_registered = 0;
 static int sisfb_mem = 0;
 static int sisfb_pdc = 0;
-static int enable_dstn = 0;
 static int sisfb_ypan = -1;
+static int sisfb_max = -1;
+static int sisfb_nocrt2rate = 0;
+static int sisfb_dstn = 0;
+static int sisfb_fstn = 0;
 
 VGA_ENGINE sisvga_engine = UNKNOWN_VGA;
 int 	   sisfb_accel = -1;
 
-/* TW: These are to adapted according to VGA_ENGINE type */
+/* These are to adapted according to VGA_ENGINE type */
 static int sisfb_hwcursor_size = 0;
 static int sisfb_CRT2_write_enable = 0;
 
-int sisfb_crt2type  = -1;	/* TW: CRT2 type (for overriding autodetection) */
-int sisfb_tvplug    = -1;	/* PR: Tv plug type (for overriding autodetection) */
+int sisfb_crt2type  = -1;	/* CRT2 type (for overriding autodetection) */
+int sisfb_tvplug    = -1;	/* Tv plug type (for overriding autodetection) */
 
-int sisfb_queuemode = -1; 	/* TW: Use MMIO queue mode by default (310/325 series only) */
+int sisfb_queuemode = -1; 	/* Use MMIO queue mode by default (315 series only) */
 
 unsigned char sisfb_detectedpdc = 0;
 
 unsigned char sisfb_detectedlcda = 0xff;
 
-/* data for sis components */
+/* data for sis hardware ("par") */
 struct video_info ivideo;
 
-/* TW: For ioctl SISFB_GET_INFO */
+/* For ioctl SISFB_GET_INFO */
 sisfb_info sisfbinfo;
 
-/* TW: Hardware extension; contains data on hardware */
-HW_DEVICE_EXTENSION sishw_ext = {
-	NULL, NULL, FALSE, NULL, NULL,
-	0, 0, 0, 0, 0, 0, 0, 0, 0,
-	NULL, NULL, NULL, NULL,
-	{0, 0, 0, 0},
-	0
-};
+/* Hardware info; contains data on hardware */
+SIS_HW_INFO sishw_ext;
 
-/* TW: SiS private structure */
+/* SiS private structure */
 SiS_Private  SiS_Pr;
 
-/* card parameters */
+/* Card parameters */
 static unsigned long sisfb_mmio_size = 0;
 static u8            sisfb_caps = 0;
 
@@ -412,7 +439,7 @@
 	VM_CMD_QUEUE,
 } SIS_CMDTYPE;
 
-/* Supported SiS Chips list */
+/* List of supported chips */
 static struct board {
 	u16 vendor, device;
 	const char *name;
@@ -424,16 +451,17 @@
 	{PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_315,     "SIS 315"},
 	{PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_315PRO,  "SIS 315PRO"},
 	{PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_550_VGA, "SIS 550 VGA"},
-	{PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_650_VGA, "SIS 650/M650/651/740 VGA"},
+	{PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_650_VGA, "SIS 65x/M65x/740 VGA"},
 	{PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_330,     "SIS 330"},
+	{PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_660_VGA, "SIS 661FX/M661FX/741/760 VGA"},
 	{0, 0, NULL}
 };
 
 #define MD_SIS300 1
 #define MD_SIS315 2
 
-/* mode table */
-/* NOT const - will be patched for 1280x960 mode number chaos reasons */
+/* Mode table */
+/* NOT const - will be patched for 1280x768 mode number chaos reasons */
 struct _sisbios_mode {
 	char name[15];
 	u8 mode_no;
@@ -447,14 +475,33 @@
 	u16 rows;
 	u8  chipset;
 } sisbios_mode[] = {
-#define MODE_INDEX_NONE           0  /* TW: index for mode=none */
-	{"none",         0xFF, 0x0000, 0x0000,    0,    0,  0, 0,   0,  0, MD_SIS300|MD_SIS315},  /* TW: for mode "none" */
-	{"320x240x16",   0x56, 0x0000, 0x0000,  320,  240, 16, 1,  40, 15,           MD_SIS315},
-	{"320x480x8",    0x5A, 0x0000, 0x0000,  320,  480,  8, 1,  40, 30,           MD_SIS315},  /* TW: FSTN */
-	{"320x480x16",   0x5B, 0x0000, 0x0000,  320,  480, 16, 1,  40, 30,           MD_SIS315},  /* TW: FSTN */
-	{"640x480x8",    0x2E, 0x0101, 0x0101,  640,  480,  8, 1,  80, 30, MD_SIS300|MD_SIS315},
+#define MODE_INDEX_NONE           0  /* index for mode=none */
+	{"none",         0xff, 0x0000, 0x0000,    0,    0,  0, 0,   0,  0, MD_SIS300|MD_SIS315},
+	{"320x200x8",    0x59, 0x0138, 0x0000,  320,  200,  8, 1,  40, 12, MD_SIS300|MD_SIS315},
+	{"320x200x16",   0x41, 0x010e, 0x0000,  320,  200, 16, 1,  40, 12, MD_SIS300|MD_SIS315},
+	{"320x200x24",   0x4f, 0x0000, 0x0000,  320,  200, 32, 1,  40, 12, MD_SIS300|MD_SIS315},  /* TW: That's for people who mix up color- and fb depth */
+	{"320x200x32",   0x4f, 0x0000, 0x0000,  320,  200, 32, 1,  40, 12, MD_SIS300|MD_SIS315},
+	{"320x240x8",    0x50, 0x0132, 0x0000,  320,  240,  8, 1,  40, 15, MD_SIS300|MD_SIS315},
+	{"320x240x16",   0x56, 0x0135, 0x0000,  320,  240, 16, 1,  40, 15, MD_SIS300|MD_SIS315},
+	{"320x240x24",   0x53, 0x0000, 0x0000,  320,  240, 32, 1,  40, 15, MD_SIS300|MD_SIS315},
+	{"320x240x32",   0x53, 0x0000, 0x0000,  320,  240, 32, 1,  40, 15, MD_SIS300|MD_SIS315},
+	{"320x240x8",    0x5a, 0x0132, 0x0000,  320,  480,  8, 1,  40, 30,           MD_SIS315},  /* TW: FSTN */
+	{"320x240x16",   0x5b, 0x0135, 0x0000,  320,  480, 16, 1,  40, 30,           MD_SIS315},  /* TW: FSTN */
+	{"400x300x8",    0x51, 0x0133, 0x0000,  400,  300,  8, 1,  50, 18, MD_SIS300|MD_SIS315},
+	{"400x300x16",   0x57, 0x0136, 0x0000,  400,  300, 16, 1,  50, 18, MD_SIS300|MD_SIS315},
+	{"400x300x24",   0x54, 0x0000, 0x0000,  400,  300, 32, 1,  50, 18, MD_SIS300|MD_SIS315},
+	{"400x300x32",   0x54, 0x0000, 0x0000,  400,  300, 32, 1,  50, 18, MD_SIS300|MD_SIS315},
+	{"512x384x8",    0x52, 0x0000, 0x0000,  512,  384,  8, 1,  64, 24, MD_SIS300|MD_SIS315},
+	{"512x384x16",   0x58, 0x0000, 0x0000,  512,  384, 16, 1,  64, 24, MD_SIS300|MD_SIS315},
+	{"512x384x24",   0x5c, 0x0000, 0x0000,  512,  384, 32, 1,  64, 24, MD_SIS300|MD_SIS315},
+	{"512x384x32",   0x5c, 0x0000, 0x0000,  512,  384, 32, 1,  64, 24, MD_SIS300|MD_SIS315},
+	{"640x400x8",    0x2f, 0x0000, 0x0000,  640,  400,  8, 1,  80, 25, MD_SIS300|MD_SIS315},
+	{"640x400x16",   0x5d, 0x0000, 0x0000,  640,  400, 16, 1,  80, 25, MD_SIS300|MD_SIS315},
+	{"640x400x24",   0x5e, 0x0000, 0x0000,  640,  400, 32, 1,  80, 25, MD_SIS300|MD_SIS315},
+	{"640x400x32",   0x5e, 0x0000, 0x0000,  640,  400, 32, 1,  80, 25, MD_SIS300|MD_SIS315},
+	{"640x480x8",    0x2e, 0x0101, 0x0101,  640,  480,  8, 1,  80, 30, MD_SIS300|MD_SIS315},
 	{"640x480x16",   0x44, 0x0111, 0x0111,  640,  480, 16, 1,  80, 30, MD_SIS300|MD_SIS315},
-	{"640x480x24",   0x62, 0x013a, 0x0112,  640,  480, 32, 1,  80, 30, MD_SIS300|MD_SIS315},  /* TW: That's for people who mix up color- and fb depth */
+	{"640x480x24",   0x62, 0x013a, 0x0112,  640,  480, 32, 1,  80, 30, MD_SIS300|MD_SIS315},
 	{"640x480x32",   0x62, 0x013a, 0x0112,  640,  480, 32, 1,  80, 30, MD_SIS300|MD_SIS315},
 	{"720x480x8",    0x31, 0x0000, 0x0000,  720,  480,  8, 1,  90, 30, MD_SIS300|MD_SIS315},
 	{"720x480x16",   0x33, 0x0000, 0x0000,  720,  480, 16, 1,  90, 30, MD_SIS300|MD_SIS315},
@@ -464,63 +511,87 @@
 	{"720x576x16",   0x34, 0x0000, 0x0000,  720,  576, 16, 1,  90, 36, MD_SIS300|MD_SIS315},
 	{"720x576x24",   0x36, 0x0000, 0x0000,  720,  576, 32, 1,  90, 36, MD_SIS300|MD_SIS315},
 	{"720x576x32",   0x36, 0x0000, 0x0000,  720,  576, 32, 1,  90, 36, MD_SIS300|MD_SIS315},
+	{"768x576x8",    0x5f, 0x0000, 0x0000,  768,  576,  8, 1,  96, 36, MD_SIS300|MD_SIS315},
+	{"768x576x16",   0x60, 0x0000, 0x0000,  768,  576, 16, 1,  96, 36, MD_SIS300|MD_SIS315},
+	{"768x576x24",   0x61, 0x0000, 0x0000,  768,  576, 32, 1,  96, 36, MD_SIS300|MD_SIS315},
+	{"768x576x32",   0x61, 0x0000, 0x0000,  768,  576, 32, 1,  96, 36, MD_SIS300|MD_SIS315},
 	{"800x480x8",    0x70, 0x0000, 0x0000,  800,  480,  8, 1, 100, 30, MD_SIS300|MD_SIS315},
 	{"800x480x16",   0x7a, 0x0000, 0x0000,  800,  480, 16, 1, 100, 30, MD_SIS300|MD_SIS315},
 	{"800x480x24",   0x76, 0x0000, 0x0000,  800,  480, 32, 1, 100, 30, MD_SIS300|MD_SIS315},
 	{"800x480x32",   0x76, 0x0000, 0x0000,  800,  480, 32, 1, 100, 30, MD_SIS300|MD_SIS315},
-#define DEFAULT_MODE              20 /* TW: index for 800x600x8 */
-#define DEFAULT_LCDMODE           20 /* TW: index for 800x600x8 */
-#define DEFAULT_TVMODE            20 /* TW: index for 800x600x8 */
+#define DEFAULT_MODE              43 /* index for 800x600x8 */
+#define DEFAULT_LCDMODE           43 /* index for 800x600x8 */
+#define DEFAULT_TVMODE            43 /* index for 800x600x8 */
 	{"800x600x8",    0x30, 0x0103, 0x0103,  800,  600,  8, 2, 100, 37, MD_SIS300|MD_SIS315},
 	{"800x600x16",   0x47, 0x0114, 0x0114,  800,  600, 16, 2, 100, 37, MD_SIS300|MD_SIS315},
 	{"800x600x24",   0x63, 0x013b, 0x0115,  800,  600, 32, 2, 100, 37, MD_SIS300|MD_SIS315},
 	{"800x600x32",   0x63, 0x013b, 0x0115,  800,  600, 32, 2, 100, 37, MD_SIS300|MD_SIS315},
+	{"848x480x8",    0x39, 0x0000, 0x0000,  848,  480,  8, 2, 106, 30, MD_SIS300|MD_SIS315},
+	{"848x480x16",   0x3b, 0x0000, 0x0000,  848,  480, 16, 2, 106, 30, MD_SIS300|MD_SIS315},
+	{"848x480x24",   0x3e, 0x0000, 0x0000,  848,  480, 32, 2, 106, 30, MD_SIS300|MD_SIS315},
+	{"848x480x32",   0x3e, 0x0000, 0x0000,  848,  480, 32, 2, 106, 30, MD_SIS300|MD_SIS315},
+	{"856x480x8",    0x3f, 0x0000, 0x0000,  856,  480,  8, 2, 107, 30, MD_SIS300|MD_SIS315},
+	{"856x480x16",   0x42, 0x0000, 0x0000,  856,  480, 16, 2, 107, 30, MD_SIS300|MD_SIS315},
+	{"856x480x24",   0x45, 0x0000, 0x0000,  856,  480, 32, 2, 107, 30, MD_SIS300|MD_SIS315},
+	{"856x480x32",   0x45, 0x0000, 0x0000,  856,  480, 32, 2, 107, 30, MD_SIS300|MD_SIS315},
 	{"1024x576x8",   0x71, 0x0000, 0x0000, 1024,  576,  8, 1, 128, 36, MD_SIS300|MD_SIS315},
 	{"1024x576x16",  0x74, 0x0000, 0x0000, 1024,  576, 16, 1, 128, 36, MD_SIS300|MD_SIS315},
 	{"1024x576x24",  0x77, 0x0000, 0x0000, 1024,  576, 32, 1, 128, 36, MD_SIS300|MD_SIS315},
 	{"1024x576x32",  0x77, 0x0000, 0x0000, 1024,  576, 32, 1, 128, 36, MD_SIS300|MD_SIS315},
-	{"1024x600x8",   0x20, 0x0000, 0x0000, 1024,  600,  8, 1, 128, 37, MD_SIS300          },  /* TW: 300 series only */
+	{"1024x600x8",   0x20, 0x0000, 0x0000, 1024,  600,  8, 1, 128, 37, MD_SIS300          },
 	{"1024x600x16",  0x21, 0x0000, 0x0000, 1024,  600, 16, 1, 128, 37, MD_SIS300          },
 	{"1024x600x24",  0x22, 0x0000, 0x0000, 1024,  600, 32, 1, 128, 37, MD_SIS300          },
 	{"1024x600x32",  0x22, 0x0000, 0x0000, 1024,  600, 32, 1, 128, 37, MD_SIS300          },
 	{"1024x768x8",   0x38, 0x0105, 0x0105, 1024,  768,  8, 2, 128, 48, MD_SIS300|MD_SIS315},
-	{"1024x768x16",  0x4A, 0x0117, 0x0117, 1024,  768, 16, 2, 128, 48, MD_SIS300|MD_SIS315},
+	{"1024x768x16",  0x4a, 0x0117, 0x0117, 1024,  768, 16, 2, 128, 48, MD_SIS300|MD_SIS315},
 	{"1024x768x24",  0x64, 0x013c, 0x0118, 1024,  768, 32, 2, 128, 48, MD_SIS300|MD_SIS315},
 	{"1024x768x32",  0x64, 0x013c, 0x0118, 1024,  768, 32, 2, 128, 48, MD_SIS300|MD_SIS315},
-	{"1152x768x8",   0x23, 0x0000, 0x0000, 1152,  768,  8, 1, 144, 48, MD_SIS300          },  /* TW: 300 series only */
+	{"1152x768x8",   0x23, 0x0000, 0x0000, 1152,  768,  8, 1, 144, 48, MD_SIS300          },
 	{"1152x768x16",  0x24, 0x0000, 0x0000, 1152,  768, 16, 1, 144, 48, MD_SIS300          },
 	{"1152x768x24",  0x25, 0x0000, 0x0000, 1152,  768, 32, 1, 144, 48, MD_SIS300          },
 	{"1152x768x32",  0x25, 0x0000, 0x0000, 1152,  768, 32, 1, 144, 48, MD_SIS300          },
+	{"1152x864x8",   0x29, 0x0000, 0x0000, 1152,  864,  8, 1, 144, 54, MD_SIS300|MD_SIS315},
+	{"1152x864x16",  0x2a, 0x0000, 0x0000, 1152,  864, 16, 1, 144, 54, MD_SIS300|MD_SIS315},
+	{"1152x864x24",  0x2b, 0x0000, 0x0000, 1152,  864, 32, 1, 144, 54, MD_SIS300|MD_SIS315},
+	{"1152x864x32",  0x2b, 0x0000, 0x0000, 1152,  864, 32, 1, 144, 54, MD_SIS300|MD_SIS315},
 	{"1280x720x8",   0x79, 0x0000, 0x0000, 1280,  720,  8, 1, 160, 45, MD_SIS300|MD_SIS315},
 	{"1280x720x16",  0x75, 0x0000, 0x0000, 1280,  720, 16, 1, 160, 45, MD_SIS300|MD_SIS315},
 	{"1280x720x24",  0x78, 0x0000, 0x0000, 1280,  720, 32, 1, 160, 45, MD_SIS300|MD_SIS315},
 	{"1280x720x32",  0x78, 0x0000, 0x0000, 1280,  720, 32, 1, 160, 45, MD_SIS300|MD_SIS315},
-	{"1280x768x8",   0x23, 0x0000, 0x0000, 1280,  768,  8, 1, 160, 48,           MD_SIS315},  /* TW: 310/325 series only */
-	{"1280x768x16",  0x24, 0x0000, 0x0000, 1280,  768, 16, 1, 160, 48,           MD_SIS315},
-	{"1280x768x24",  0x25, 0x0000, 0x0000, 1280,  768, 32, 1, 160, 48,           MD_SIS315},
-	{"1280x768x32",  0x25, 0x0000, 0x0000, 1280,  768, 32, 1, 160, 48,           MD_SIS315},
-#define MODEINDEX_1280x960 48
-	{"1280x960x8",   0x7C, 0x0000, 0x0000, 1280,  960,  8, 1, 160, 60, MD_SIS300|MD_SIS315},  /* TW: Modenumbers being patched */
-	{"1280x960x16",  0x7D, 0x0000, 0x0000, 1280,  960, 16, 1, 160, 60, MD_SIS300|MD_SIS315},
-	{"1280x960x24",  0x7E, 0x0000, 0x0000, 1280,  960, 32, 1, 160, 60, MD_SIS300|MD_SIS315},
-	{"1280x960x32",  0x7E, 0x0000, 0x0000, 1280,  960, 32, 1, 160, 60, MD_SIS300|MD_SIS315},
-	{"1280x1024x8",  0x3A, 0x0107, 0x0107, 1280, 1024,  8, 2, 160, 64, MD_SIS300|MD_SIS315},
-	{"1280x1024x16", 0x4D, 0x011a, 0x011a, 1280, 1024, 16, 2, 160, 64, MD_SIS300|MD_SIS315},
+#define MODEINDEX_1280x768 79
+	{"1280x768x8",   0x23, 0x0000, 0x0000, 1280,  768,  8, 1, 160, 48, MD_SIS300|MD_SIS315},
+	{"1280x768x16",  0x24, 0x0000, 0x0000, 1280,  768, 16, 1, 160, 48, MD_SIS300|MD_SIS315},
+	{"1280x768x24",  0x25, 0x0000, 0x0000, 1280,  768, 32, 1, 160, 48, MD_SIS300|MD_SIS315},
+	{"1280x768x32",  0x25, 0x0000, 0x0000, 1280,  768, 32, 1, 160, 48, MD_SIS300|MD_SIS315},
+	{"1280x960x8",   0x7c, 0x0000, 0x0000, 1280,  960,  8, 1, 160, 60, MD_SIS300|MD_SIS315},
+	{"1280x960x16",  0x7d, 0x0000, 0x0000, 1280,  960, 16, 1, 160, 60, MD_SIS300|MD_SIS315},
+	{"1280x960x24",  0x7e, 0x0000, 0x0000, 1280,  960, 32, 1, 160, 60, MD_SIS300|MD_SIS315},
+	{"1280x960x32",  0x7e, 0x0000, 0x0000, 1280,  960, 32, 1, 160, 60, MD_SIS300|MD_SIS315},
+	{"1280x1024x8",  0x3a, 0x0107, 0x0107, 1280, 1024,  8, 2, 160, 64, MD_SIS300|MD_SIS315},
+	{"1280x1024x16", 0x4d, 0x011a, 0x011a, 1280, 1024, 16, 2, 160, 64, MD_SIS300|MD_SIS315},
 	{"1280x1024x24", 0x65, 0x013d, 0x011b, 1280, 1024, 32, 2, 160, 64, MD_SIS300|MD_SIS315},
 	{"1280x1024x32", 0x65, 0x013d, 0x011b, 1280, 1024, 32, 2, 160, 64, MD_SIS300|MD_SIS315},
-	{"1400x1050x8",  0x26, 0x0000, 0x0000, 1400, 1050,  8, 1, 175, 65,           MD_SIS315},  /* TW: 310/325 series only */
+	{"1360x768x8",   0x48, 0x0000, 0x0000, 1360,  768,  8, 1, 170, 48, MD_SIS300|MD_SIS315},
+	{"1360x768x16",  0x4b, 0x0000, 0x0000, 1360,  768, 16, 1, 170, 48, MD_SIS300|MD_SIS315},
+	{"1360x768x24",  0x4e, 0x0000, 0x0000, 1360,  768, 32, 1, 170, 48, MD_SIS300|MD_SIS315},
+	{"1360x768x32",  0x4e, 0x0000, 0x0000, 1360,  768, 32, 1, 170, 48, MD_SIS300|MD_SIS315},
+	{"1360x1024x8",  0x67, 0x0000, 0x0000, 1360, 1024,  8, 1, 170, 64, MD_SIS300          },
+	{"1360x1024x16", 0x6f, 0x0000, 0x0000, 1360, 1024, 16, 1, 170, 64, MD_SIS300          },
+	{"1360x1024x24", 0x72, 0x0000, 0x0000, 1360, 1024, 32, 1, 170, 64, MD_SIS300          },
+	{"1360x1024x32", 0x72, 0x0000, 0x0000, 1360, 1024, 32, 1, 170, 64, MD_SIS300          },
+	{"1400x1050x8",  0x26, 0x0000, 0x0000, 1400, 1050,  8, 1, 175, 65,           MD_SIS315},
 	{"1400x1050x16", 0x27, 0x0000, 0x0000, 1400, 1050, 16, 1, 175, 65,           MD_SIS315},
 	{"1400x1050x24", 0x28, 0x0000, 0x0000, 1400, 1050, 32, 1, 175, 65,           MD_SIS315},
 	{"1400x1050x32", 0x28, 0x0000, 0x0000, 1400, 1050, 32, 1, 175, 65,           MD_SIS315},
-	{"1600x1200x8",  0x3C, 0x0130, 0x011c, 1600, 1200,  8, 1, 200, 75, MD_SIS300|MD_SIS315},
-	{"1600x1200x16", 0x3D, 0x0131, 0x011e, 1600, 1200, 16, 1, 200, 75, MD_SIS300|MD_SIS315},
+	{"1600x1200x8",  0x3c, 0x0130, 0x011c, 1600, 1200,  8, 1, 200, 75, MD_SIS300|MD_SIS315},
+	{"1600x1200x16", 0x3d, 0x0131, 0x011e, 1600, 1200, 16, 1, 200, 75, MD_SIS300|MD_SIS315},
 	{"1600x1200x24", 0x66, 0x013e, 0x011f, 1600, 1200, 32, 1, 200, 75, MD_SIS300|MD_SIS315},
 	{"1600x1200x32", 0x66, 0x013e, 0x011f, 1600, 1200, 32, 1, 200, 75, MD_SIS300|MD_SIS315},
 	{"1920x1440x8",  0x68, 0x013f, 0x0000, 1920, 1440,  8, 1, 240, 75, MD_SIS300|MD_SIS315},
 	{"1920x1440x16", 0x69, 0x0140, 0x0000, 1920, 1440, 16, 1, 240, 75, MD_SIS300|MD_SIS315},
-	{"1920x1440x24", 0x6B, 0x0141, 0x0000, 1920, 1440, 32, 1, 240, 75, MD_SIS300|MD_SIS315},
-	{"1920x1440x32", 0x6B, 0x0141, 0x0000, 1920, 1440, 32, 1, 240, 75, MD_SIS300|MD_SIS315},
-	{"2048x1536x8",  0x6c, 0x0000, 0x0000, 2048, 1536,  8, 1, 256, 96,           MD_SIS315},  /* TW: 310/325 series only */
+	{"1920x1440x24", 0x6b, 0x0141, 0x0000, 1920, 1440, 32, 1, 240, 75, MD_SIS300|MD_SIS315},
+	{"1920x1440x32", 0x6b, 0x0141, 0x0000, 1920, 1440, 32, 1, 240, 75, MD_SIS300|MD_SIS315},
+	{"2048x1536x8",  0x6c, 0x0000, 0x0000, 2048, 1536,  8, 1, 256, 96,           MD_SIS315},
 	{"2048x1536x16", 0x6d, 0x0000, 0x0000, 2048, 1536, 16, 1, 256, 96,           MD_SIS315},
 	{"2048x1536x24", 0x6e, 0x0000, 0x0000, 2048, 1536, 32, 1, 256, 96,           MD_SIS315},
 	{"2048x1536x32", 0x6e, 0x0000, 0x0000, 2048, 1536, 32, 1, 256, 96,           MD_SIS315},
@@ -536,39 +607,38 @@
 u8  sisfb_mode_no  = 0;
 u8  sisfb_rate_idx = 0;
 
-/* TW: CR36 evaluation */
+/* CR36 evaluation */
 const USHORT sis300paneltype[] =
-    { LCD_UNKNOWN,   LCD_800x600,  LCD_1024x768,  LCD_1280x1024,
-      LCD_1280x960,  LCD_640x480,  LCD_1024x600,  LCD_1152x768,
-      LCD_320x480,   LCD_1024x768, LCD_1024x768,  LCD_1024x768,
-      LCD_1024x768,  LCD_1024x768, LCD_1024x768,  LCD_1024x768 };
+    { LCD_UNKNOWN,   LCD_800x600,   LCD_1024x768,  LCD_1280x1024,
+      LCD_1280x960,  LCD_640x480,   LCD_1024x600,  LCD_1152x768,
+      LCD_1024x768,  LCD_1024x768,  LCD_1024x768,  LCD_1024x768,
+      LCD_1024x768,  LCD_1024x768,  LCD_320x480,   LCD_1024x768 };
 
 const USHORT sis310paneltype[] =
-    { LCD_UNKNOWN,   LCD_800x600,  LCD_1024x768,  LCD_1280x1024,
-      LCD_640x480,   LCD_1024x600, LCD_1152x864,  LCD_1280x960,
-      LCD_1152x768,  LCD_1400x1050,LCD_1280x768,  LCD_1600x1200,
-      LCD_320x480,   LCD_1024x768, LCD_1024x768,  LCD_1024x768 };
+    { LCD_UNKNOWN,   LCD_800x600,   LCD_1024x768,  LCD_1280x1024,
+      LCD_640x480,   LCD_1024x600,  LCD_1152x864,  LCD_1280x960,
+      LCD_1152x768,  LCD_1400x1050, LCD_1280x768,  LCD_1600x1200,
+      LCD_640x480_2, LCD_640x480_3, LCD_320x480,   LCD_1024x768 };
+
+#define FL_550_DSTN 0x01
+#define FL_550_FSTN 0x02
 
 static const struct _sis_crt2type {
 	char name[10];
 	int type_no;
 	int tvplug_no;
+	unsigned short flags;
 } sis_crt2type[] = {
-	{"NONE", 	0, 		-1},
-	{"LCD",  	DISPTYPE_LCD, 	-1},
-	{"TV",   	DISPTYPE_TV, 	-1},
-	{"VGA",  	DISPTYPE_CRT2, 	-1},
-	{"SVIDEO", 	DISPTYPE_TV, 	TVPLUG_SVIDEO},
-	{"COMPOSITE", 	DISPTYPE_TV, 	TVPLUG_COMPOSITE},
-	{"SCART", 	DISPTYPE_TV, 	TVPLUG_SCART},
-	{"none", 	0, 		-1},
-	{"lcd",  	DISPTYPE_LCD, 	-1},
-	{"tv",   	DISPTYPE_TV, 	-1},
-	{"vga",  	DISPTYPE_CRT2, 	-1},
-	{"svideo", 	DISPTYPE_TV, 	TVPLUG_SVIDEO},
-	{"composite", 	DISPTYPE_TV, 	TVPLUG_COMPOSITE},
-	{"scart", 	DISPTYPE_TV, 	TVPLUG_SCART},
-	{"\0",  	-1, 		-1}
+	{"NONE", 	0, 		-1,        0},
+	{"LCD",  	CRT2_LCD, 	-1,        0},
+	{"TV",   	CRT2_TV, 	-1,        0},
+	{"VGA",  	CRT2_VGA, 	-1,        0},
+	{"SVIDEO", 	CRT2_TV, 	TV_SVIDEO, 0},
+	{"COMPOSITE", 	CRT2_TV, 	TV_AVIDEO, 0},
+	{"SCART", 	CRT2_TV, 	TV_SCART,  0},
+	{"DSTN",        CRT2_LCD,       -1,        FL_550_DSTN},
+	{"FSTN",        CRT2_LCD,       -1,        FL_550_FSTN},
+	{"\0",  	-1, 		-1,        0}
 };
 
 /* Queue mode selection for 310 series */
@@ -579,9 +649,6 @@
 	{"AGP",  	AGP_CMD_QUEUE},
 	{"VRAM", 	VM_CMD_QUEUE},
 	{"MMIO", 	MMIO_CMD},
-	{"agp",  	AGP_CMD_QUEUE},
-	{"vram", 	VM_CMD_QUEUE},
-	{"mmio", 	MMIO_CMD},
 	{"\0",   	-1}
 };
 
@@ -590,10 +657,8 @@
 	char name[6];
 	int type_no;
 } sis_tvtype[] = {
-	{"PAL",  	1},
-	{"NTSC", 	2},
-	{"pal", 	1},
-	{"ntsc",  	2},
+	{"PAL",  	TV_PAL},
+	{"NTSC", 	TV_NTSC},
 	{"\0",   	-1}
 };
 
@@ -602,33 +667,103 @@
 	u16 xres;
 	u16 yres;
 	u16 refresh;
+	BOOLEAN SiS730valid32bpp;
 } sisfb_vrate[] = {
-	{1,  640,  480, 60}, {2,  640,  480,  72}, {3, 640,   480,  75}, {4,  640, 480,  85},
-	{5,  640,  480,100}, {6,  640,  480, 120}, {7, 640,   480, 160}, {8,  640, 480, 200},
-	{1,  720,  480, 60},
-	{1,  720,  576, 58},
-	{1,  800,  480, 60}, {2,  800,  480,  75}, {3, 800,   480,  85},
-	{1,  800,  600, 56}, {2,  800,  600,  60}, {3, 800,   600,  72}, {4,  800, 600,  75},
-	{5,  800,  600, 85}, {6,  800,  600, 100}, {7, 800,   600, 120}, {8,  800, 600, 160},
-	{1, 1024,  768, 43}, {2, 1024,  768,  60}, {3, 1024,  768,  70}, {4, 1024, 768,  75},
-	{5, 1024,  768, 85}, {6, 1024,  768, 100}, {7, 1024,  768, 120},
-	{1, 1024,  576, 60}, {2, 1024,  576,  75}, {3, 1024,  576,  85},
-	{1, 1024,  600, 60},
-	{1, 1152,  768, 60},
-	{1, 1280,  720, 60}, {2, 1280,  720,  75}, {3, 1280,  720,  85},
-	{1, 1280,  768, 60},
-	{1, 1280, 1024, 43}, {2, 1280, 1024,  60}, {3, 1280, 1024,  75}, {4, 1280, 1024,  85},
-	{1, 1280,  960, 70},
-	{1, 1400, 1050, 60},
-	{1, 1600, 1200, 60}, {2, 1600, 1200,  65}, {3, 1600, 1200,  70}, {4, 1600, 1200,  75},
-	{5, 1600, 1200, 85}, {6, 1600, 1200, 100}, {7, 1600, 1200, 120},
-	{1, 1920, 1440, 60}, {2, 1920, 1440,  65}, {3, 1920, 1440,  70}, {4, 1920, 1440,  75},
-	{5, 1920, 1440, 85}, {6, 1920, 1440, 100},
-	{1, 2048, 1536, 60}, {2, 2048, 1536,  65}, {3, 2048, 1536,  70}, {4, 2048, 1536,  75},
-	{5, 2048, 1536, 85},
-	{0, 0, 0, 0}
+	{1,  320,  200,  70,  TRUE},
+	{1,  320,  240,  60,  TRUE},
+	{1,  320,  480,  60,  TRUE},
+	{1,  400,  300,  60,  TRUE},
+	{1,  512,  384,  60,  TRUE},
+	{1,  640,  400,  72,  TRUE},
+	{1,  640,  480,  60,  TRUE}, {2,  640,  480,  72,  TRUE}, {3,  640,  480,  75,  TRUE},
+	{4,  640,  480,  85,  TRUE}, {5,  640,  480, 100,  TRUE}, {6,  640,  480, 120,  TRUE},
+	{7,  640,  480, 160,  TRUE}, {8,  640,  480, 200,  TRUE},
+	{1,  720,  480,  60,  TRUE},
+	{1,  720,  576,  58,  TRUE},
+	{1,  768,  576,  58,  TRUE},
+	{1,  800,  480,  60,  TRUE}, {2,  800,  480,  75,  TRUE}, {3,  800,  480,  85,  TRUE},
+	{1,  800,  600,  56,  TRUE}, {2,  800,  600,  60,  TRUE}, {3,  800,  600,  72,  TRUE},
+	{4,  800,  600,  75,  TRUE}, {5,  800,  600,  85,  TRUE}, {6,  800,  600, 105,  TRUE},
+	{7,  800,  600, 120,  TRUE}, {8,  800,  600, 160,  TRUE},
+	{1,  848,  480,  39,  TRUE}, {2,  848,  480,  60,  TRUE},
+	{1,  856,  480,  39,  TRUE}, {2,  856,  480,  60,  TRUE},
+	{1, 1024,  576,  60,  TRUE}, {2, 1024,  576,  75,  TRUE}, {3, 1024,  576,  85,  TRUE},
+	{1, 1024,  600,  60,  TRUE},
+	{1, 1024,  768,  43,  TRUE}, {2, 1024,  768,  60,  TRUE}, {3, 1024,  768,  70, FALSE},
+	{4, 1024,  768,  75, FALSE}, {5, 1024,  768,  85,  TRUE}, {6, 1024,  768, 100,  TRUE},
+	{7, 1024,  768, 120,  TRUE},
+	{1, 1152,  768,  60,  TRUE},
+	{1, 1152,  864,  75,  TRUE}, {2, 1152,  864,  84,  TRUE},
+	{1, 1280,  720,  60,  TRUE}, {2, 1280,  720,  75,  TRUE}, {3, 1280,  720,  85,  TRUE},
+	{1, 1280,  768,  60,  TRUE},
+	{1, 1280,  960,  60,  TRUE}, {2, 1280,  960,  85,  TRUE},
+	{1, 1280, 1024,  43,  TRUE}, {2, 1280, 1024,  60,  TRUE}, {3, 1280, 1024,  75,  TRUE},
+	{4, 1280, 1024,  85,  TRUE},
+	{1, 1360,  768,  60,  TRUE},
+	{1, 1360, 1024,  59,  TRUE},
+	{1, 1400, 1050,  60,  TRUE}, {2, 1400, 1050,  75,  TRUE},
+	{1, 1600, 1200,  60,  TRUE}, {2, 1600, 1200,  65,  TRUE}, {3, 1600, 1200,  70,  TRUE},
+	{4, 1600, 1200,  75,  TRUE}, {5, 1600, 1200,  85,  TRUE}, {6, 1600, 1200, 100,  TRUE},
+	{7, 1600, 1200, 120,  TRUE},
+	{1, 1920, 1440,  60,  TRUE}, {2, 1920, 1440,  65,  TRUE}, {3, 1920, 1440,  70,  TRUE},
+	{4, 1920, 1440,  75,  TRUE}, {5, 1920, 1440,  85,  TRUE}, {6, 1920, 1440, 100,  TRUE},
+	{1, 2048, 1536,  60,  TRUE}, {2, 2048, 1536,  65,  TRUE}, {3, 2048, 1536,  70,  TRUE},
+	{4, 2048, 1536,  75,  TRUE}, {5, 2048, 1536,  85,  TRUE},
+	{0,    0,    0,   0, FALSE}
 };
 
+static struct sisfb_monitor {
+	u16 hmin;
+	u16 hmax;
+	u16 vmin;
+	u16 vmax;
+	u32 dclockmax;
+	u8  feature;
+	BOOLEAN datavalid;
+} sisfb_thismonitor;
+
+static const struct _sisfbddcsmodes {
+	u32 mask;
+	u16 h;
+	u16 v;
+	u32 d;
+} sisfb_ddcsmodes[] = {
+	{ 0x10000, 67, 75, 108000},
+	{ 0x08000, 48, 72,  50000},
+	{ 0x04000, 46, 75,  49500},
+	{ 0x01000, 35, 43,  44900},
+	{ 0x00800, 48, 60,  65000},
+	{ 0x00400, 56, 70,  75000},
+	{ 0x00200, 60, 75,  78800},
+	{ 0x00100, 80, 75, 135000},
+	{ 0x00020, 31, 60,  25200},
+	{ 0x00008, 38, 72,  31500},
+	{ 0x00004, 37, 75,  31500},
+	{ 0x00002, 35, 56,  36000},
+	{ 0x00001, 38, 60,  40000}
+};
+
+static const struct _sisfbddcfmodes {
+	u16 x;
+	u16 y;
+	u16 v;
+	u16 h;
+	u32 d;
+} sisfb_ddcfmodes[] = {
+       { 1280, 1024, 85, 92, 157500},
+       { 1600, 1200, 60, 75, 162000},
+       { 1600, 1200, 65, 82, 175500},
+       { 1600, 1200, 70, 88, 189000},
+       { 1600, 1200, 75, 94, 202500},
+       { 1600, 1200, 85, 107,229500},
+       { 1920, 1440, 60, 90, 234000},
+       { 1920, 1440, 75, 113,297000}
+};
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
+static u8 sisfb_lastrates[128];
+#endif
+
 static const struct _chswtable {
     int subsysVendor;
     int subsysCard;
@@ -636,9 +771,152 @@
     char *cardName;
 } mychswtable[] = {
         { 0x1631, 0x1002, "Mitachi", "0x1002" },
+	{ 0x1071, 0x7521, "Mitac"  , "7521P"  },
 	{ 0,      0,      ""       , ""       }
 };
 
+static const struct _customttable {
+    unsigned short chipID;
+    char *biosversion;
+    char *biosdate;
+    unsigned long bioschksum;
+    unsigned short biosFootprintAddr[5];
+    unsigned char biosFootprintData[5];
+    unsigned short pcisubsysvendor;
+    unsigned short pcisubsyscard;
+    char *vendorName;
+    char *cardName;
+    unsigned long SpecialID;
+    char *optionName;
+} mycustomttable[] = {
+	{ SIS_630, "2.00.07", "09/27/2002-13:38:25",
+	  0x3240A8,
+	  { 0x220, 0x227, 0x228, 0x229, 0x0ee },
+	  {  0x01,  0xe3,  0x9a,  0x6a,  0xef },
+	  0x1039, 0x6300,
+	  "Barco", "iQ R200L/300/400", CUT_BARCO1366, "BARCO_1366"
+	},
+	{ SIS_630, "2.00.07", "09/27/2002-13:38:25",
+	  0x323FBD,
+	  { 0x220, 0x227, 0x228, 0x229, 0x0ee },
+	  {  0x00,  0x5a,  0x64,  0x41,  0xef },
+	  0x1039, 0x6300,
+	  "Barco", "iQ G200L/300/400/500", CUT_BARCO1024, "BARCO_1024"
+	},
+	{ SIS_650, "", "",
+	  0,
+	  { 0, 0, 0, 0, 0 },
+	  { 0, 0, 0, 0, 0 },
+	  0x0e11, 0x083c,
+	  "Inventec (Compaq)", "3017cl/3045US", CUT_COMPAQ12802, "COMPAQ_1280"
+	},
+	{ SIS_650, "", "",
+	  0,
+	  { 0x00c, 0, 0, 0, 0 },
+	  { 'e'  , 0, 0, 0, 0 },
+	  0x1558, 0x0287,
+	  "Clevo", "L285/L287 (Version 1)", CUT_CLEVO1024, "CLEVO_L28X_1"
+	},
+	{ SIS_650, "", "",
+	  0,
+	  { 0x00c, 0, 0, 0, 0 },
+	  { 'y'  , 0, 0, 0, 0 },
+	  0x1558, 0x0287,
+	  "Clevo", "L285/L287 (Version 2)", CUT_CLEVO10242, "CLEVO_L28X_2"
+	},
+	{ SIS_650, "", "",
+	  0,
+	  { 0, 0, 0, 0, 0 },
+	  { 0, 0, 0, 0, 0 },
+	  0x1558, 0x0400,  /* possibly 401 and 402 as well; not panelsize specific (?) */
+	  "Clevo", "D400S/D410S/D400H/D410H", CUT_CLEVO1400, "CLEVO_D4X0"
+	},
+	{ SIS_650, "", "",
+	  0,	/* Shift LCD in LCD-via-CRT1 mode */
+	  { 0, 0, 0, 0, 0 },
+	  { 0, 0, 0, 0, 0 },
+	  0x1558, 0x2263,
+	  "Clevo", "D22ES/D27ES", CUT_UNIWILL1024, "CLEVO_D2X0ES"
+	},
+	{ SIS_650, "", "",
+	  0,	/* Shift LCD in LCD-via-CRT1 mode */
+	  { 0, 0, 0, 0, 0 },
+	  { 0, 0, 0, 0, 0 },
+	  0x1734, 0x101f,
+	  "Uniwill", "N243S9", CUT_UNIWILL1024, "UNIWILL_N243S9"
+	},
+	{ SIS_650, "", "",
+	  0,	/* Shift LCD in LCD-via-CRT1 mode */
+	  { 0, 0, 0, 0, 0 },
+	  { 0, 0, 0, 0, 0 },
+	  0x1584, 0x5103,
+	  "Uniwill", "N35BS1", CUT_UNIWILL10242, "UNIWILL_N35BS1"
+	},
+	{ SIS_650, "1.09.2c", "",  /* Other versions, too? */
+	  0,	/* Shift LCD in LCD-via-CRT1 mode */
+	  { 0, 0, 0, 0, 0 },
+	  { 0, 0, 0, 0, 0 },
+	  0x1019, 0x0f05,
+	  "ECS", "A928", CUT_UNIWILL1024, "ECS_A928"
+	},
+	{ SIS_740, "1.11.27a", "",
+	  0,
+	  { 0, 0, 0, 0, 0 },
+	  { 0, 0, 0, 0, 0 },
+	  0x1043, 0x1612,
+	  "Asus", "L3000D/L3500D", CUT_ASUSL3000D, "ASUS_L3X00"
+	},
+	{ SIS_650, "1.10.9k", "",
+	  0,
+	  { 0, 0, 0, 0, 0 },
+	  { 0, 0, 0, 0, 0 },
+	  0x1025, 0x0028,
+	  "Acer", "Aspire 1700", CUT_ACER1280, "ACER_ASPIRE1700"
+	},
+	{ SIS_650, "1.10.7w", "",
+	  0,
+	  { 0, 0, 0, 0, 0 },
+	  { 0, 0, 0, 0, 0 },
+	  0x14c0, 0x0012,
+	  "Compal", "??? (V1)", CUT_COMPAL1400_1, "COMPAL_1400_1"
+	},
+	{ SIS_650, "1.10.7x", "",
+	  0,
+	  { 0, 0, 0, 0, 0 },
+	  { 0, 0, 0, 0, 0 },
+	  0x14c0, 0x0012,
+	  "Compal", "??? (V2)", CUT_COMPAL1400_2, "COMPAL_1400_2"
+	},
+	{ SIS_650, "1.10.8o", "",
+	  0,	/* For EMI (unknown) */
+	  { 0, 0, 0, 0, 0 },
+	  { 0, 0, 0, 0, 0 },
+	  0x1043, 0x1612,
+	  "Asus", "A2H (V1)", CUT_ASUSA2H_1, "ASUS_A2H_1"
+	},
+	{ SIS_650, "1.10.8q", "",
+	  0,	/* For EMI */
+	  { 0, 0, 0, 0, 0 },
+	  { 0, 0, 0, 0, 0 },
+	  0x1043, 0x1612,
+	  "Asus", "A2H (V2)", CUT_ASUSA2H_2, "ASUS_A2H_2"
+	},
+	{ 4321, "", "",			/* never autodetected */
+	  0,
+	  { 0, 0, 0, 0, 0 },
+	  { 0, 0, 0, 0, 0 },
+	  0, 0,
+	  "Generic", "LVDS/Parallel 848x480", CUT_PANEL848, "PANEL848x480"
+	},
+	{ 0, "", "",
+	  0,
+	  { 0, 0, 0, 0 },
+	  { 0, 0, 0, 0 },
+	  0, 0,
+	  "", "", CUT_NONE, ""
+	}
+};
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
 /* Offscreen layout */
 typedef struct _SIS_GLYINFO {
@@ -648,6 +926,8 @@
 	u8 gmask[72];
 	int ngmask;
 } SIS_GLYINFO;
+
+static char sisfb_fontname[40];
 #endif
 
 typedef struct _SIS_OH {
@@ -677,7 +957,6 @@
 static unsigned long sisfb_heap_size;
 static SIS_HEAP      sisfb_heap;
 
-// Eden Chen
 static const struct _sis_TV_filter {
 	u8 filter[9][4];
 } sis_TV_filter[] = {
@@ -697,7 +976,7 @@
 	   {0xF8,0xF4,0x18,0x38},
 	   {0xFC,0xFB,0x14,0x2A},
 	   {0x00,0x00,0x10,0x20},
-	   {0x00,0x04,0x10,0x18}, 
+	   {0x00,0x04,0x10,0x18},
 	   {0xFF,0xFF,0xFF,0xFF} }},
 	{ {{0x00,0x00,0x00,0x40},  /* NTSCFilter_2 */
 	   {0xF5,0xEE,0x1B,0x44},
@@ -717,7 +996,7 @@
 	   {0xF9,0x0A,0x17,0x0C},
 	   {0x00,0x07,0x10,0x12}, 
 	   {0xFF,0xFF,0xFF,0xFF} }},
-	{ {{0x00,0x00,0x00,0x40},  /* NTSCFilter_4 */
+	{ {{0x00,0x00,0x00,0x40},  /* NTSCFilter_4 - 320 */
 	   {0x00,0xE0,0x10,0x60},
 	   {0x00,0xEE,0x10,0x44},
 	   {0x00,0xF4,0x10,0x38},
@@ -726,7 +1005,7 @@
 	   {0x00,0x00,0x10,0x20},
 	   {0x00,0x04,0x10,0x18}, 
 	   {0xFF,0xFF,0xFF,0xFF} }},
-	{ {{0x00,0x00,0x00,0x40},  /* NTSCFilter_5 */
+	{ {{0x00,0x00,0x00,0x40},  /* NTSCFilter_5 - 640 */
 	   {0xF5,0xEE,0x1B,0x44},
 	   {0xF8,0xF4,0x18,0x38},
 	   {0xEB,0x04,0x25,0x18},
@@ -735,7 +1014,7 @@
 	   {0xFA,0x06,0x16,0x14},
 	   {0x00,0x04,0x10,0x18}, 
 	   {0xFF,0xFF,0xFF,0xFF} }},
-	{ {{0x00,0x00,0x00,0x40},  /* NTSCFilter_6 */
+	{ {{0x00,0x00,0x00,0x40},  /* NTSCFilter_6 - 720 */
 	   {0xEB,0x04,0x25,0x18},
 	   {0xE7,0x0E,0x29,0x04},
 	   {0xEE,0x0C,0x22,0x08},
@@ -744,7 +1023,7 @@
 	   {0xFC,0x0A,0x14,0x0C},
 	   {0x00,0x08,0x10,0x10}, 
 	   {0xFF,0xFF,0xFF,0xFF} }},
-	{ {{0x00,0x00,0x00,0x40},  /* NTSCFilter_7 */
+	{ {{0x00,0x00,0x00,0x40},  /* NTSCFilter_7 - 800 */
 	   {0xEC,0x02,0x24,0x1C},
 	   {0xF2,0x04,0x1E,0x18},
 	   {0xEB,0x15,0x25,0xF6},
@@ -789,7 +1068,7 @@
 	   {0xFB,0x04,0x15,0x18},
 	   {0x00,0x06,0x10,0x14}, 
 	   {0xFF,0xFF,0xFF,0xFF} }},
-	{ {{0x00,0x00,0x00,0x40},  /* PALFilter_4 */
+	{ {{0x00,0x00,0x00,0x40},  /* PALFilter_4 - 320 */
 	   {0x00,0xE0,0x10,0x60},
 	   {0x00,0xEE,0x10,0x44},
 	   {0x00,0xF4,0x10,0x38},
@@ -798,7 +1077,7 @@
 	   {0x00,0x00,0x10,0x20},
 	   {0x00,0x04,0x10,0x18}, 
 	   {0xFF,0xFF,0xFF,0xFF} }},
-	{ {{0x00,0x00,0x00,0x40},  /* PALFilter_5 */
+	{ {{0x00,0x00,0x00,0x40},  /* PALFilter_5 - 640 */
 	   {0xF5,0xEE,0x1B,0x44},
 	   {0xF8,0xF4,0x18,0x38},
 	   {0xF1,0xF7,0x1F,0x32},
@@ -807,7 +1086,7 @@
 	   {0xFB,0x01,0x15,0x1E},
 	   {0x00,0x04,0x10,0x18}, 
 	   {0xFF,0xFF,0xFF,0xFF} }},
-	{ {{0x00,0x00,0x00,0x40},  /* PALFilter_6 */
+	{ {{0x00,0x00,0x00,0x40},  /* PALFilter_6 - 720 */
 	   {0xF5,0xEE,0x1B,0x2A},
 	   {0xEE,0xFE,0x22,0x24},
 	   {0xF3,0x00,0x1D,0x20},
@@ -816,7 +1095,7 @@
 	   {0xFB,0x04,0x15,0x18},
 	   {0x00,0x06,0x10,0x14}, 
 	   {0xFF,0xFF,0xFF,0xFF} }},
-	{ {{0x00,0x00,0x00,0x40},  /* PALFilter_7 */
+	{ {{0x00,0x00,0x00,0x40},  /* PALFilter_7 - 800 */
 	   {0xF5,0xEE,0x1B,0x44},
 	   {0xF8,0xF4,0x18,0x38},
 	   {0xFC,0xFB,0x14,0x2A},
@@ -829,9 +1108,8 @@
 
 static int           filter = -1;
 static unsigned char filter_tb;
-//~Eden Chen
 
-/* ---------------------- Routine prototypes ------------------------- */
+/* ---------------------- Prototypes ------------------------- */
 
 /* Interface used by the world */
 #ifndef MODULE
@@ -894,10 +1172,6 @@
                                    const struct fb_fillrect *rect);
 extern void     fbcon_sis_copyarea(struct fb_info *info, 
                                    const struct fb_copyarea *area);
-#if 0				   
-extern void     cfb_imageblit(struct fb_info *info, 
-                              const struct fb_image *image);
-#endif			      
 extern int      fbcon_sis_sync(struct fb_info *info);
 static int      sisfb_ioctl(struct inode *inode, 
 	 		    struct file *file,
@@ -905,14 +1179,14 @@
 			    unsigned long arg, 
 		       	    struct fb_info *info);
 extern int	sisfb_mode_rate_to_dclock(SiS_Private *SiS_Pr, 
-			      PSIS_HW_DEVICE_INFO HwDeviceExtension,
+			      PSIS_HW_INFO HwDeviceExtension,
 			      unsigned char modeno, unsigned char rateindex);	
-extern int      sisfb_mode_rate_to_ddata(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,
+extern int      sisfb_mode_rate_to_ddata(SiS_Private *SiS_Pr, PSIS_HW_INFO HwDeviceExtension,
 			 unsigned char modeno, unsigned char rateindex,
 			 unsigned int *left_margin, unsigned int *right_margin, 
 			 unsigned int *upper_margin, unsigned int *lower_margin,
 			 unsigned int *hsync_len, unsigned int *vsync_len,
-			 unsigned int *sync, unsigned int *vmode);			      		    			      
+			 unsigned int *sync, unsigned int *vmode);
 #endif
 			
 static int      sisfb_get_fix(struct fb_fix_screeninfo *fix, int con,
@@ -923,9 +1197,9 @@
 extern void     sisfb_syncaccel(void);
 
 /* Internal general routines */
-static void     sisfb_search_mode(const char *name);
-static int      sisfb_validate_mode(int modeindex);
-static u8       sisfb_search_refresh_rate(unsigned int rate);
+static void     sisfb_search_mode(char *name, BOOLEAN quiet);
+static int      sisfb_validate_mode(int modeindex, unsigned long vbflags);
+static u8       sisfb_search_refresh_rate(unsigned int rate, int index);
 static int      sisfb_setcolreg(unsigned regno, unsigned red, unsigned green,
 			unsigned blue, unsigned transp,
 			struct fb_info *fb_info);
@@ -939,6 +1213,11 @@
 static BOOLEAN  sisfbcheckvretracecrt2(void);
 static BOOLEAN  sisfbcheckvretracecrt1(void);
 static BOOLEAN  sisfb_bridgeisslave(void);
+static void     sisfb_detect_VB_connect(void);
+static void     sisfb_get_VB_type(void);
+
+static void     sisfb_handle_ddc(struct sisfb_monitor *monitor, int crtno);
+static BOOLEAN  sisfb_interpret_edid(struct sisfb_monitor *monitor, unsigned char *buffer);
 
 /* SiS-specific Export functions */
 void            sis_dispinfo(struct ap_data *rec);
@@ -952,15 +1231,9 @@
 /* Chipset-dependent internal routines */
 #ifdef CONFIG_FB_SIS_300
 static int      sisfb_get_dram_size_300(void);
-static void     sisfb_detect_VB_connect_300(void);
-static void     sisfb_get_VB_type_300(void);
-static int      sisfb_has_VB_300(void);
 #endif
 #ifdef CONFIG_FB_SIS_315
 static int      sisfb_get_dram_size_315(void);
-static void     sisfb_detect_VB_connect_315(void);
-static void     sisfb_get_VB_type_315(void);
-static int      sisfb_has_VB_315(void);
 #endif
 
 /* Internal heap routines */
@@ -973,30 +1246,46 @@
 static void     sisfb_free_node(SIS_OH *poh);
 
 /* Internal routines to access PCI configuration space */
-BOOLEAN         sisfb_query_VGA_config_space(PSIS_HW_DEVICE_INFO psishw_ext,
+BOOLEAN         sisfb_query_VGA_config_space(PSIS_HW_INFO psishw_ext,
 	          	unsigned long offset, unsigned long set, unsigned long *value);
-BOOLEAN         sisfb_query_north_bridge_space(PSIS_HW_DEVICE_INFO psishw_ext,
+BOOLEAN         sisfb_query_north_bridge_space(PSIS_HW_INFO psishw_ext,
 	         	unsigned long offset, unsigned long set, unsigned long *value);
 
+/* Sensing routines */
+static void     SiS_Sense30x(void);
+static int      SISDoSense(int tempbl, int tempbh, int tempcl, int tempch);
+static void     SiS_SenseCh(void);
 
 /* Routines from init.c/init301.c */
-extern void 	SiSRegInit(SiS_Private *SiS_Pr, USHORT BaseAddr);
-extern BOOLEAN  SiSInit(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension);
-extern BOOLEAN  SiSSetMode(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT ModeNo);
-extern void     SiS_SetEnableDstn(SiS_Private *SiS_Pr);
-extern void     SiS_LongWait(SiS_Private *SiS_Pr);
+extern USHORT   SiS_GetModeID(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay, int Depth, BOOLEAN FSTN);
+extern USHORT   SiS_GetModeID_LCD(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay, int Depth,
+                                  BOOLEAN FSTN, USHORT CustomT, int LCDwith, int LCDheight);
+extern USHORT   SiS_GetModeID_TV(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay, int Depth);
+extern USHORT   SiS_GetModeID_VGA2(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay, int Depth);
+
+extern void 	SiSRegInit(SiS_Private *SiS_Pr, SISIOADDRESS BaseAddr);
+extern BOOLEAN  SiSSetMode(SiS_Private *SiS_Pr, PSIS_HW_INFO HwDeviceInfo, USHORT ModeNo);
+extern void     SiS_SetEnableDstn(SiS_Private *SiS_Pr, int enable);
+extern void     SiS_SetEnableFstn(SiS_Private *SiS_Pr, int enable);
+
+extern BOOLEAN  sisfb_gettotalfrommode(SiS_Private *SiS_Pr, PSIS_HW_INFO HwDeviceExtension,
+		       unsigned char modeno, int *htotal, int *vtotal, unsigned char rateindex);
 
-/* TW: Chrontel TV functions */
+/* Chrontel TV functions */
 extern USHORT 	SiS_GetCH700x(SiS_Private *SiS_Pr, USHORT tempbx);
 extern void 	SiS_SetCH700x(SiS_Private *SiS_Pr, USHORT tempbx);
 extern USHORT 	SiS_GetCH701x(SiS_Private *SiS_Pr, USHORT tempbx);
 extern void 	SiS_SetCH701x(SiS_Private *SiS_Pr, USHORT tempbx);
 extern void     SiS_SetCH70xxANDOR(SiS_Private *SiS_Pr, USHORT tempax,USHORT tempbh);
 extern void     SiS_DDC2Delay(SiS_Private *SiS_Pr, USHORT delaytime);
+extern void     SiS_SetChrontelGPIO(SiS_Private *SiS_Pr, USHORT myvbinfo);
+extern USHORT   SiS_HandleDDC(SiS_Private *SiS_Pr, unsigned long VBFlags, int VGAEngine,
+		              USHORT adaptnum, USHORT DDCdatatype, unsigned char *buffer);
+extern USHORT   SiS_ReadDDC1Bit(SiS_Private *SiS_Pr);
+extern void 	SiS_Chrontel701xBLOn(SiS_Private *SiS_Pr, PSIS_HW_INFO HwDeviceInfo);
+extern void 	SiS_Chrontel701xBLOff(SiS_Private *SiS_Pr);
+extern void 	SiS_SiS30xBLOn(SiS_Private *SiS_Pr, PSIS_HW_INFO HwDeviceInfo);
+extern void 	SiS_SiS30xBLOff(SiS_Private *SiS_Pr, PSIS_HW_INFO HwDeviceInfo);
 
-/* TW: Sensing routines */
-void            SiS_Sense30x(void);
-int             SISDoSense(int tempbl, int tempbh, int tempcl, int tempch);
-void            SiS_SenseCh(void);			
 			
 #endif
--- diff/drivers/video/sis/vgatypes.h	2003-10-09 09:47:17.000000000 +0100
+++ source/drivers/video/sis/vgatypes.h	2004-02-09 10:39:55.000000000 +0000
@@ -1,18 +1,69 @@
+/* $XFree86$ */
+/*
+ * General type definitions for universal mode switching modules
+ *
+ * Copyright (C) 2001-2004 by Thomas Winischhofer, Vienna, Austria
+ *
+ * If distributed as part of the Linux kernel, the following license terms
+ * apply:
+ *
+ * * 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 named License,
+ * * or 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
+ *
+ * Otherwise, the following license terms apply:
+ *
+ * * 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) All advertising materials mentioning features or use of this software
+ * *    must display the following acknowledgement: "This product includes
+ * *    software developed by Thomas Winischhofer, Vienna, Austria."
+ * * 4) The name of the author may not be used to endorse or promote products
+ * *    derived from this software without specific prior written permission.
+ * *
+ * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
+ *
+ * Author: 	Thomas Winischhofer <thomas@winischhofer.net>
+ *
+ */
+
 #ifndef _VGATYPES_
 #define _VGATYPES_
 
 #ifdef LINUX_XF86
+#include "xf86Version.h"
 #include "xf86Pci.h"
 #endif
 
-#ifdef LINUX_KERNEL  /* TW: We don't want the X driver to depend on kernel source */
+#ifdef LINUX_KERNEL  /* We don't want the X driver to depend on kernel source */
 #include <linux/ioctl.h>
 #endif
 
-#ifndef TC
-#define far
-#endif
-
 #ifndef FALSE
 #define FALSE   0
 #endif
@@ -49,47 +100,34 @@
 typedef unsigned long ULONG;
 #endif
 
-#ifndef PUCHAR
-typedef UCHAR far *PUCHAR;
-#endif
-
-#ifndef PUSHORT
-typedef USHORT far *PUSHORT;
-#endif
-
-#ifndef PULONG
-typedef ULONG far *PULONG;
-#endif
-
-#ifndef PVOID
-typedef void far *PVOID;
-#endif
-#ifndef VOID
-typedef void VOID;
-#endif
-
 #ifndef BOOLEAN
 typedef UCHAR BOOLEAN;
 #endif
 
-#ifndef WINCE_HEADER
 #ifndef bool
 typedef UCHAR bool;
 #endif
-#endif /*WINCE_HEADER*/
 
-#ifndef VBIOS_VER_MAX_LENGTH
-#define VBIOS_VER_MAX_LENGTH         4
+#ifdef LINUX_KERNEL
+typedef unsigned long SISIOADDRESS;
+#endif
+
+#ifdef LINUX_XF86
+#if XF86_VERSION_CURRENT < XF86_VERSION_NUMERIC(4,2,0,0,0)
+typedef unsigned long IOADDRESS;
+typedef unsigned long SISIOADDRESS;
+#else
+typedef IOADDRESS SISIOADDRESS;
+#endif
 #endif
 
-#ifndef LINUX_KERNEL   /* For kernel, this is defined in sisfb.h */
-#ifndef WIN2000
+#ifndef LINUX_KERNEL   /* For the linux kernel, this is defined in sisfb.h */
 #ifndef SIS_CHIP_TYPE
 typedef enum _SIS_CHIP_TYPE {
     SIS_VGALegacy = 0,
 #ifdef LINUX_XF86
-    SIS_530,	/* TW */
-    SIS_OLD,	/* TW */
+    SIS_530,
+    SIS_OLD,
 #endif
     SIS_300,
     SIS_630,
@@ -101,30 +139,32 @@
     SIS_550,
     SIS_650,
     SIS_740,
-    SIS_330, 
+    SIS_330,
+    SIS_661,
+    SIS_741,
+    SIS_660,
+    SIS_760,
     MAX_SIS_CHIP
 } SIS_CHIP_TYPE;
 #endif
 #endif
-#endif
 
-#ifndef WIN2000
 #ifndef SIS_VB_CHIP_TYPE
 typedef enum _SIS_VB_CHIP_TYPE {
     VB_CHIP_Legacy = 0,
     VB_CHIP_301,
-    VB_CHIP_301B,      
+    VB_CHIP_301B,
     VB_CHIP_301LV,
     VB_CHIP_302,
     VB_CHIP_302B,
     VB_CHIP_302LV,
+    VB_CHIP_301C,
+    VB_CHIP_302ELV,
     VB_CHIP_UNKNOWN, /* other video bridge or no video bridge */
     MAX_VB_CHIP
 } SIS_VB_CHIP_TYPE;
 #endif
-#endif
 
-#ifndef WIN2000
 #ifndef SIS_LCD_TYPE
 typedef enum _SIS_LCD_TYPE {
     LCD_INVALID = 0,
@@ -136,18 +176,22 @@
     LCD_1600x1200,
     LCD_1920x1440,
     LCD_2048x1536,
-    LCD_320x480,       /* TW: FSTN */
+    LCD_320x480,       /* FSTN, DSTN */
     LCD_1400x1050,
     LCD_1152x864,
     LCD_1152x768,
     LCD_1280x768,
     LCD_1024x600,
+    LCD_640x480_2,     /* FSTN, DSTN */
+    LCD_640x480_3,     /* FSTN, DSTN */
+    LCD_848x480,
+    LCD_1280x800,
+    LCD_1680x1050,
+    LCD_CUSTOM,
     LCD_UNKNOWN
 } SIS_LCD_TYPE;
 #endif
-#endif
 
-#ifndef WIN2000 /* mark by Paul, Move definition to sisv.h*/
 #ifndef PSIS_DSReg
 typedef struct _SIS_DSReg
 {
@@ -156,36 +200,27 @@
 } SIS_DSReg, *PSIS_DSReg;
 #endif
 
-#ifndef SIS_HW_DEVICE_INFO
-
-typedef struct _SIS_HW_DEVICE_INFO  SIS_HW_DEVICE_INFO, *PSIS_HW_DEVICE_INFO;
+#ifndef SIS_HW_INFO
 
-typedef BOOLEAN (*PSIS_QUERYSPACE)   (PSIS_HW_DEVICE_INFO, ULONG, ULONG, ULONG *);
+typedef struct _SIS_HW_INFO  SIS_HW_INFO, *PSIS_HW_INFO;
 
+typedef BOOLEAN (*PSIS_QUERYSPACE)   (PSIS_HW_INFO, ULONG, ULONG, ULONG *);
 
-struct _SIS_HW_DEVICE_INFO
+struct _SIS_HW_INFO
 {
-    PVOID  pDevice;              /* The pointer to the physical device data structure
-                                    in each OS or NULL for unused. */
-    UCHAR  *pjVirtualRomBase;    /* base virtual address of VBIOS ROM Space */
-                                 /* or base virtual address of ROM image file. */
-                                 /* if NULL, then read from pjROMImage; */
-                                 /* Note:ROM image file is the file of VBIOS ROM */
+#ifdef LINUX_XF86
+    PCITAG PciTag;		 /* PCI Tag */
+#endif
 
-    BOOLEAN UseROM;		 /* TW: Use the ROM image if provided */
- 
-    UCHAR  *pjCustomizedROMImage;/* base virtual address of ROM image file. */
-                                 /* wincE:ROM image file is the file for OEM */
-                                 /*       customized table */
-                                 /* Linux: not used */
-                                 /* NT   : not used  */
-                                 /* Note : pjCustomizedROMImage=NULL if no ROM image file */
+    UCHAR  *pjVirtualRomBase;    /* ROM image */
+
+    BOOLEAN UseROM;		 /* Use the ROM image if provided */
 
     UCHAR  *pjVideoMemoryAddress;/* base virtual memory address */
                                  /* of Linear VGA memory */
 
     ULONG  ulVideoMemorySize;    /* size, in bytes, of the memory on the board */
-    ULONG  ulIOAddress;          /* base I/O address of VGA ports (0x3B0) */
+    SISIOADDRESS ulIOAddress;    /* base I/O address of VGA ports (0x3B0) */
     UCHAR  jChipType;            /* Used to Identify SiS Graphics Chip */
                                  /* defined in the data structure type  */
                                  /* "SIS_CHIP_TYPE" */
@@ -194,20 +229,12 @@
     UCHAR  ujVBChipID;           /* the ID of video bridge */
                                  /* defined in the data structure type */
                                  /* "SIS_VB_CHIP_TYPE" */
+#ifdef LINUX_KERNEL
+    BOOLEAN Is301BDH;
+#endif
 
-    USHORT usExternalChip;       /* NO VB or other video bridge(not  */
+    USHORT usExternalChip;       /* NO VB or other video bridge (other than  */
                                  /* SiS video bridge) */
-                                 /* if ujVBChipID = VB_CHIP_UNKNOWN, */
-                                 /* then bit0=1 : LVDS,bit1=1 : trumpion, */
-                                 /* bit2=1 : CH7005 & no video bridge if */
-                                 /* usExternalChip = 0. */
-                                 /* Note: CR37[3:1]: */
-                                 /*             001:SiS 301 */
-                                 /*             010:LVDS */
-                                 /*             011:Trumpion LVDS Scaling Chip */
-                                 /*             100:LVDS(LCD-out)+Chrontel 7005 */
-                                 /*             101:Single Chrontel 7005 */
-				 /* TW: This has changed on 310/325 series! */
 
     ULONG  ulCRT2LCDType;        /* defined in the data structure type */
                                  /* "SIS_LCD_TYPE" */
@@ -215,6 +242,8 @@
     BOOLEAN bIntegratedMMEnabled;/* supporting integration MM enable */
                                       
     BOOLEAN bSkipDramSizing;     /* True: Skip video memory sizing. */
+
+#ifdef LINUX_KERNEL
     PSIS_DSReg  pSR;             /* restore SR registers in initial function. */
                                  /* end data :(idx, val) =  (FF, FF). */
                                  /* Note : restore SR registers if  */
@@ -224,38 +253,25 @@
                                  /* end data :(idx, val) =  (FF, FF) */
                                  /* Note : restore cR registers if  */
                                  /* bSkipDramSizing = TRUE */
+#endif
 
     PSIS_QUERYSPACE  pQueryVGAConfigSpace; /* Get/Set VGA Configuration  */
                                            /* space */
  
     PSIS_QUERYSPACE  pQueryNorthBridgeSpace;/* Get/Set North Bridge  */
                                             /* space  */
-
-    UCHAR  szVBIOSVer[VBIOS_VER_MAX_LENGTH];
-
-    UCHAR  pdc;			/* TW: PanelDelayCompensation */
-    
-#ifdef LINUX_KERNEL
-    BOOLEAN Is301BDH;
-#endif        
-
-#ifdef LINUX_XF86
-    PCITAG PciTag;		/* PCI Tag for Linux XF86 */
-#endif
 };
 #endif
-#endif 
 
-
-/* TW: Addtional IOCTL for communication sisfb <> X driver        */
-/*     If changing this, sisfb.h must also be changed (for sisfb) */
+/* Addtional IOCTL for communication sisfb <> X driver        */
+/* If changing this, sisfb.h must also be changed (for sisfb) */
 
 #ifdef LINUX_XF86  /* We don't want the X driver to depend on the kernel source */
 
-/* TW: ioctl for identifying and giving some info (esp. memory heap start) */
+/* ioctl for identifying and giving some info (esp. memory heap start) */
 #define SISFB_GET_INFO    0x80046ef8  /* Wow, what a terrible hack... */
 
-/* TW: Structure argument for SISFB_GET_INFO ioctl  */
+/* Structure argument for SISFB_GET_INFO ioctl  */
 typedef struct _SISFB_INFO sisfb_info, *psisfb_info;
 
 struct _SISFB_INFO {
@@ -284,86 +300,19 @@
 	
 	unsigned char sisfb_lcda;
 
-	char reserved[235]; 		/* for future use */
-};
-#endif
+	unsigned long sisfb_vbflags;
+	unsigned long sisfb_currentvbflags;
 
-#ifndef WIN2000
-#ifndef WINCE_HEADER
-#ifndef BUS_DATA_TYPE
-typedef enum _BUS_DATA_TYPE {
-    ConfigurationSpaceUndefined = -1,
-    Cmos,
-    EisaConfiguration,
-    Pos,
-    CbusConfiguration,
-    PCIConfiguration,
-    VMEConfiguration,
-    NuBusConfiguration,
-    PCMCIAConfiguration,
-    MPIConfiguration,
-    MPSAConfiguration,
-    PNPISAConfiguration,
-    MaximumBusDataType
-} BUS_DATA_TYPE, *PBUS_DATA_TYPE;
-#endif
-#endif /* WINCE_HEADER */
-
-#ifndef PCI_TYPE0_ADDRESSES
-#define PCI_TYPE0_ADDRESSES             6
-#endif
-
-#ifndef PCI_TYPE1_ADDRESSES
-#define PCI_TYPE1_ADDRESSES             2
-#endif
-
-#ifndef WINCE_HEADER
-#ifndef PCI_COMMON_CONFIG
-typedef struct _PCI_COMMON_CONFIG {
-    USHORT  VendorID;                   /* (ro)                 */
-    USHORT  DeviceID;                   /* (ro)                 */
-    USHORT  Command;                    /* Device control       */
-    USHORT  Status;
-    UCHAR   RevisionID;                 /* (ro)                 */
-    UCHAR   ProgIf;                     /* (ro)                 */
-    UCHAR   SubClass;                   /* (ro)                 */
-    UCHAR   BaseClass;                  /* (ro)                 */
-    UCHAR   CacheLineSize;              /* (ro+)                */
-    UCHAR   LatencyTimer;               /* (ro+)                */
-    UCHAR   HeaderType;                 /* (ro)                 */
-    UCHAR   BIST;                       /* Built in self test   */
-
-    union {
-        struct _PCI_HEADER_TYPE_0 {
-            ULONG   BaseAddresses[PCI_TYPE0_ADDRESSES];
-            ULONG   CIS;
-            USHORT  SubVendorID;
-            USHORT  SubSystemID;
-            ULONG   ROMBaseAddress;
-            ULONG   Reserved2[2];
-
-            UCHAR   InterruptLine;      /*                    */
-            UCHAR   InterruptPin;       /* (ro)               */
-            UCHAR   MinimumGrant;       /* (ro)               */
-            UCHAR   MaximumLatency;     /* (ro)               */
-        } type0;
-
-
-    } u;
-
-    UCHAR   DeviceSpecific[192];
-
-} PCI_COMMON_CONFIG, *PPCI_COMMON_CONFIG;
-#endif
-#endif /* WINCE_HEADER */
+	int sisfb_scalelcd;
+	unsigned long sisfb_specialtiming;
 
-#ifndef FIELD_OFFSET
-#define FIELD_OFFSET(type, field)    ((LONG)&(((type *)0)->field))
-#endif
+	unsigned char sisfb_haveemi;
+	unsigned char sisfb_emi30,sisfb_emi31,sisfb_emi32,sisfb_emi33;
+	unsigned char sisfb_haveemilcd;
 
-#ifndef PCI_COMMON_HDR_LENGTH
-#define PCI_COMMON_HDR_LENGTH (FIELD_OFFSET (PCI_COMMON_CONFIG, DeviceSpecific))
-#endif
+	char reserved[213]; 		/* for future use */
+};
 #endif
 
 #endif
+
--- diff/drivers/video/sis/vstruct.h	2003-10-09 09:47:17.000000000 +0100
+++ source/drivers/video/sis/vstruct.h	2004-02-09 10:39:55.000000000 +0000
@@ -1,3 +1,57 @@
+/* $XFree86$ */
+/*
+ * General structure definitions for universal mode switching modules
+ *
+ * Copyright (C) 2001-2004 by Thomas Winischhofer, Vienna, Austria
+ *
+ * If distributed as part of the Linux kernel, the following license terms
+ * apply:
+ *
+ * * 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 named License,
+ * * or 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
+ *
+ * Otherwise, the following license terms apply:
+ *
+ * * 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) All advertising materials mentioning features or use of this software
+ * *    must display the following acknowledgement: "This product includes
+ * *    software developed by Thomas Winischhofer, Vienna, Austria."
+ * * 4) The name of the author may not be used to endorse or promote products
+ * *    derived from this software without specific prior written permission.
+ * *
+ * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
+ *
+ * Author: 	Thomas Winischhofer <thomas@winischhofer.net>
+ *
+ */
+
 #ifdef _INIT_
 #define EXTERN
 #else
@@ -58,7 +112,6 @@
 	UCHAR  CR[15];
 } SiS_LVDSCRT1DataStruct;
 
-/*add for LCDA*/
 typedef struct _SiS_LCDACRT1DataStruct
 {
 	UCHAR  CR[17];
@@ -79,6 +132,7 @@
 	UCHAR  VB_StTVFlickerIndex;
 	UCHAR  VB_StTVEdgeIndex;
 	UCHAR  VB_StTVYFilterIndex;
+	UCHAR  St_PDC;
 } SiS_StStruct;
 
 typedef struct _SiS_VBModeStruct
@@ -110,14 +164,13 @@
 {
 	UCHAR  Ext_ModeID;
 	USHORT Ext_ModeFlag;
-	USHORT Ext_ModeInfo;
-	USHORT Ext_Point;
+	UCHAR  Ext_ModeOffset;
 	USHORT Ext_VESAID;
-	UCHAR  Ext_VESAMEMSize;
 	UCHAR  Ext_RESINFO;
 	UCHAR  VB_ExtTVFlickerIndex;
 	UCHAR  VB_ExtTVEdgeIndex;
 	UCHAR  VB_ExtTVYFilterIndex;
+	UCHAR  VB_ExtTVYFilterIndexROM661;
 	UCHAR  REFindex;
 } SiS_ExtStruct;
 
@@ -130,7 +183,7 @@
 	UCHAR  ModeID;
 	USHORT XRes;
 	USHORT YRes;
-	USHORT ROM_OFFSET;
+	UCHAR  Ext_PDC;
 } SiS_Ext2Struct;
 
 typedef struct _SiS_Part2PortTblStruct
@@ -149,12 +202,6 @@
 	USHORT CLOCK;
 } SiS_MCLKDataStruct;
 
-typedef struct _SiS_ECLKDataStruct
-{
-	UCHAR  SR2E,SR2F,SR30;
-	USHORT CLOCK;
-} SiS_ECLKDataStruct;
-
 typedef struct _SiS_VCLKDataStruct
 {
 	UCHAR  SR2B,SR2C;
@@ -183,41 +230,78 @@
 
 typedef UCHAR DRAM4Type[4];
 
+/* Defines for SiS_CustomT */
+/* Never change these for sisfb compatibility */
+#define CUT_NONE          0
+#define CUT_FORCENONE     1
+#define CUT_BARCO1366     2
+#define CUT_BARCO1024     3
+#define CUT_COMPAQ1280    4
+#define CUT_COMPAQ12802   5
+#define CUT_PANEL848      6
+#define CUT_CLEVO1024     7
+#define CUT_CLEVO10242    8
+#define CUT_CLEVO1400     9
+#define CUT_CLEVO14002    10
+#define CUT_UNIWILL1024   11
+#define CUT_ASUSL3000D    12
+#define CUT_UNIWILL10242  13
+#define CUT_ACER1280      14
+#define CUT_COMPAL1400_1  15
+#define CUT_COMPAL1400_2  16
+#define CUT_ASUSA2H_1     17
+#define CUT_ASUSA2H_2     18
+
 typedef struct _SiS_Private
 {
 #ifdef LINUX_KERNEL
-        USHORT RelIO;
+        SISIOADDRESS RelIO;
 #endif
-	USHORT SiS_P3c4;
-	USHORT SiS_P3d4;
-	USHORT SiS_P3c0;
-	USHORT SiS_P3ce;
-	USHORT SiS_P3c2;
-	USHORT SiS_P3ca;
-	USHORT SiS_P3c6;
-	USHORT SiS_P3c7;
-	USHORT SiS_P3c8;
-	USHORT SiS_P3c9;
-	USHORT SiS_P3da;
-	USHORT SiS_Part1Port;
-	USHORT SiS_Part2Port;
-	USHORT SiS_Part3Port;
-	USHORT SiS_Part4Port;
-	USHORT SiS_Part5Port;
+	SISIOADDRESS SiS_P3c4;
+	SISIOADDRESS SiS_P3d4;
+	SISIOADDRESS SiS_P3c0;
+	SISIOADDRESS SiS_P3ce;
+	SISIOADDRESS SiS_P3c2;
+	SISIOADDRESS SiS_P3ca;
+	SISIOADDRESS SiS_P3c6;
+	SISIOADDRESS SiS_P3c7;
+	SISIOADDRESS SiS_P3c8;
+	SISIOADDRESS SiS_P3c9;
+	SISIOADDRESS SiS_P3cb;
+	SISIOADDRESS SiS_P3cd;
+	SISIOADDRESS SiS_P3da;
+	SISIOADDRESS SiS_Part1Port;
+	SISIOADDRESS SiS_Part2Port;
+	SISIOADDRESS SiS_Part3Port;
+	SISIOADDRESS SiS_Part4Port;
+	SISIOADDRESS SiS_Part5Port;
+	SISIOADDRESS SiS_VidCapt;
+	SISIOADDRESS SiS_VidPlay;
 	USHORT SiS_IF_DEF_LVDS;
+	USHORT SiS_IF_DEF_CH70xx;
+	USHORT SiS_IF_DEF_CONEX;
 	USHORT SiS_IF_DEF_TRUMPION;
 	USHORT SiS_IF_DEF_DSTN;
 	USHORT SiS_IF_DEF_FSTN;
-	USHORT SiS_IF_DEF_CH70xx;
-	USHORT SiS_IF_DEF_HiVision;
+	USHORT SiS_SysFlags;
 	UCHAR  SiS_VGAINFO;
+#ifndef LINUX_KERNEL
+        USHORT SiS_CP1, SiS_CP2, SiS_CP3, SiS_CP4;
+#endif
 	BOOLEAN SiS_UseROM;
 	int    SiS_CHOverScan;
 	BOOLEAN SiS_CHSOverScan;
 	BOOLEAN SiS_ChSW;
 	BOOLEAN SiS_UseLCDA;
 	int    SiS_UseOEM;
+	ULONG  SiS_CustomT;
 	USHORT SiS_Backup70xx;
+	BOOLEAN HaveEMI;
+	BOOLEAN HaveEMILCD;
+	BOOLEAN OverruleEMI;
+	UCHAR  EMI_30,EMI_31,EMI_32,EMI_33;
+	UCHAR  PDC;
+	UCHAR  SiS_MyCR63;
 	USHORT SiS_CRT1Mode;
 	USHORT SiS_flag_clearbuffer;
 	int    SiS_RAMType;
@@ -225,12 +309,14 @@
 	UCHAR  SiS_DataBusWidth;
 	USHORT SiS_ModeType;
 	USHORT SiS_VBInfo;
+	USHORT SiS_TVMode;
 	USHORT SiS_LCDResInfo;
 	USHORT SiS_LCDTypeInfo;
 	USHORT SiS_LCDInfo;
+	USHORT SiS_LCDInfo661;
 	USHORT SiS_VBType;
 	USHORT SiS_VBExtInfo;
-	USHORT SiS_HiVision;
+	USHORT SiS_YPbPr;
 	USHORT SiS_SelectCRT2Rate;
 	USHORT SiS_SetFlag;
 	USHORT SiS_RVBHCFACT;
@@ -254,11 +340,13 @@
 	USHORT SiS_DDC_Port;
 	USHORT SiS_DDC_Index;
 	USHORT SiS_DDC_Data;
+	USHORT SiS_DDC_NData;
 	USHORT SiS_DDC_Clk;
-	USHORT SiS_DDC_DataShift;
+	USHORT SiS_DDC_NClk;
 	USHORT SiS_DDC_DeviceAddr;
 	USHORT SiS_DDC_ReadAddr;
 	USHORT SiS_DDC_SecAddr;
+	BOOLEAN SiS_SensibleSR11;
 	USHORT SiS_Panel800x600;
 	USHORT SiS_Panel1024x768;
 	USHORT SiS_Panel1280x1024;
@@ -270,22 +358,24 @@
 	USHORT SiS_Panel1280x768;
 	USHORT SiS_Panel1024x600;
 	USHORT SiS_Panel640x480;
+	USHORT SiS_Panel640x480_2;
+	USHORT SiS_Panel640x480_3;
 	USHORT SiS_Panel1152x864;
+	USHORT SiS_PanelCustom;
+	USHORT SiS_PanelBarco1366;
 	USHORT SiS_PanelMax;
 	USHORT SiS_PanelMinLVDS;
 	USHORT SiS_PanelMin301;
 	USHORT SiS_ChrontelInit;
 	
-	/* Pointers: */
 	const SiS_StStruct          *SiS_SModeIDTable;
-	const SiS_StandTableStruct  *SiS_StandTable;
+	SiS_StandTableStruct        *SiS_StandTable;
 	const SiS_ExtStruct         *SiS_EModeIDTable;
 	const SiS_Ext2Struct        *SiS_RefIndex;
 	const SiS_VBModeStruct      *SiS_VBModeIDTable;
 	const SiS_CRT1TableStruct   *SiS_CRT1Table;
 	const SiS_MCLKDataStruct    *SiS_MCLKData_0;
 	const SiS_MCLKDataStruct    *SiS_MCLKData_1;
-	const SiS_ECLKDataStruct    *SiS_ECLKData;
 	const SiS_VCLKDataStruct    *SiS_VCLKData;
 	const SiS_VBVCLKDataStruct  *SiS_VBVCLKData;
 	const SiS_StResInfoStruct   *SiS_StResInfo;
@@ -316,7 +406,7 @@
 	const USHORT *pSiS_RGBSenseData;
 	const USHORT *pSiS_VideoSenseData;
 	const USHORT *pSiS_YCSenseData;
-	const USHORT *pSiS_RGBSenseData2; /*301b*/
+	const USHORT *pSiS_RGBSenseData2;
 	const USHORT *pSiS_VideoSenseData2;
 	const USHORT *pSiS_YCSenseData2;
 #endif
@@ -329,6 +419,8 @@
 	const UCHAR *SiS_PALMPhase2;
 	const UCHAR *SiS_PALNPhase2;
 	const UCHAR *SiS_SpecialPhase;
+	const UCHAR *SiS_SpecialPhaseM;
+	const UCHAR *SiS_SpecialPhaseJ;
 	const SiS_LCDDataStruct  *SiS_StLCD1024x768Data;
 	const SiS_LCDDataStruct  *SiS_ExtLCD1024x768Data;
 	const SiS_LCDDataStruct  *SiS_St2LCD1024x768Data;
@@ -340,26 +432,38 @@
 	const SiS_LCDDataStruct  *SiS_LCD1280x960Data;
 	const SiS_LCDDataStruct  *SiS_NoScaleData1400x1050;
 	const SiS_LCDDataStruct  *SiS_NoScaleData1600x1200;
+	const SiS_LCDDataStruct  *SiS_NoScaleData1280x768;
 	const SiS_LCDDataStruct  *SiS_StLCD1400x1050Data;
 	const SiS_LCDDataStruct  *SiS_StLCD1600x1200Data;
+	const SiS_LCDDataStruct  *SiS_StLCD1280x768Data;
 	const SiS_LCDDataStruct  *SiS_ExtLCD1400x1050Data;
 	const SiS_LCDDataStruct  *SiS_ExtLCD1600x1200Data;
+	const SiS_LCDDataStruct  *SiS_ExtLCD1280x768Data;
+	const SiS_LCDDataStruct  *SiS_NoScaleData;
 	const SiS_TVDataStruct   *SiS_StPALData;
 	const SiS_TVDataStruct   *SiS_ExtPALData;
 	const SiS_TVDataStruct   *SiS_StNTSCData;
 	const SiS_TVDataStruct   *SiS_ExtNTSCData;
-/*	const SiS_TVDataStruct   *SiS_St1HiTVData;  */
+	const SiS_TVDataStruct   *SiS_St1HiTVData;
 	const SiS_TVDataStruct   *SiS_St2HiTVData;
 	const SiS_TVDataStruct   *SiS_ExtHiTVData;
+	const SiS_TVDataStruct   *SiS_St525iData;
+	const SiS_TVDataStruct   *SiS_St525pData;
+	const SiS_TVDataStruct   *SiS_St750pData;
+	const SiS_TVDataStruct   *SiS_Ext525iData;
+	const SiS_TVDataStruct   *SiS_Ext525pData;
+	const SiS_TVDataStruct   *SiS_Ext750pData;
 	const UCHAR *SiS_NTSCTiming;
 	const UCHAR *SiS_PALTiming;
 	const UCHAR *SiS_HiTVExtTiming;
 	const UCHAR *SiS_HiTVSt1Timing;
 	const UCHAR *SiS_HiTVSt2Timing;
-	const UCHAR *SiS_HiTVTextTiming;
 	const UCHAR *SiS_HiTVGroup3Data;
 	const UCHAR *SiS_HiTVGroup3Simu;
+#if 0
+	const UCHAR *SiS_HiTVTextTiming;
 	const UCHAR *SiS_HiTVGroup3Text;
+#endif
 	const SiS_PanelDelayTblStruct *SiS_PanelDelayTbl;
 	const SiS_PanelDelayTblStruct *SiS_PanelDelayTblLVDS;
 	const SiS_LVDSDataStruct  *SiS_LVDS800x600Data_1;
@@ -381,12 +485,23 @@
 	const SiS_LVDSDataStruct  *SiS_LVDS1152x768Data_1;
 	const SiS_LVDSDataStruct  *SiS_LVDS1152x768Data_2;
 	const SiS_LVDSDataStruct  *SiS_LVDS640x480Data_1;
+	const SiS_LVDSDataStruct  *SiS_LVDS640x480Data_2;
 	const SiS_LVDSDataStruct  *SiS_LVDS320x480Data_1;
+	const SiS_LVDSDataStruct  *SiS_LCDA1024x768Data_1;
+	const SiS_LVDSDataStruct  *SiS_LCDA1024x768Data_2;
+	const SiS_LVDSDataStruct  *SiS_LCDA1280x1024Data_1;
+	const SiS_LVDSDataStruct  *SiS_LCDA1280x1024Data_2;
 	const SiS_LVDSDataStruct  *SiS_LCDA1400x1050Data_1;
 	const SiS_LVDSDataStruct  *SiS_LCDA1400x1050Data_2;
 	const SiS_LVDSDataStruct  *SiS_LCDA1600x1200Data_1;
 	const SiS_LVDSDataStruct  *SiS_LCDA1600x1200Data_2;
 	const SiS_LVDSDataStruct  *SiS_LVDSXXXxXXXData_1;
+	const SiS_LVDSDataStruct  *SiS_LVDSBARCO1366Data_1;
+	const SiS_LVDSDataStruct  *SiS_LVDSBARCO1366Data_2;
+	const SiS_LVDSDataStruct  *SiS_LVDSBARCO1024Data_1;
+	const SiS_LVDSDataStruct  *SiS_LVDSBARCO1024Data_2;
+	const SiS_LVDSDataStruct  *SiS_LVDS848x480Data_1;
+	const SiS_LVDSDataStruct  *SiS_LVDS848x480Data_2;
 	const SiS_LVDSDataStruct  *SiS_CHTVUNTSCData;
 	const SiS_LVDSDataStruct  *SiS_CHTVONTSCData;
 	const SiS_LVDSDataStruct  *SiS_CHTVUPALData;
@@ -478,6 +593,12 @@
 	const SiS_LVDSCRT1DataStruct  *SiS_LVDSCRT11600x1200_2_H;
 	const SiS_LVDSCRT1DataStruct  *SiS_LVDSCRT1XXXxXXX_1;
 	const SiS_LVDSCRT1DataStruct  *SiS_LVDSCRT1XXXxXXX_1_H;
+	const SiS_LVDSCRT1DataStruct  *SiS_LVDSCRT1640x480_1;
+	const SiS_LVDSCRT1DataStruct  *SiS_LVDSCRT1640x480_1_H;
+	const SiS_LVDSCRT1DataStruct  *SiS_LVDSCRT1640x480_2;
+	const SiS_LVDSCRT1DataStruct  *SiS_LVDSCRT1640x480_2_H;
+	const SiS_LVDSCRT1DataStruct  *SiS_LVDSCRT1640x480_3;
+	const SiS_LVDSCRT1DataStruct  *SiS_LVDSCRT1640x480_3_H;
 	const SiS_LVDSCRT1DataStruct  *SiS_CHTVCRT1UNTSC;
 	const SiS_LVDSCRT1DataStruct  *SiS_CHTVCRT1ONTSC;
 	const SiS_LVDSCRT1DataStruct  *SiS_CHTVCRT1UPAL;
@@ -486,28 +607,23 @@
 
 	const SiS_LVDSCRT1DataStruct  *SiS_LVDSCRT1320x480_1;
 
-	const SiS_LCDACRT1DataStruct  *SiS_LCDACRT1800x600_1;
 	const SiS_LCDACRT1DataStruct  *SiS_LCDACRT11024x768_1;
 	const SiS_LCDACRT1DataStruct  *SiS_LCDACRT11280x1024_1;
 	const SiS_LCDACRT1DataStruct  *SiS_LCDACRT11400x1050_1;
 	const SiS_LCDACRT1DataStruct  *SiS_LCDACRT11600x1200_1;
-	const SiS_LCDACRT1DataStruct  *SiS_LCDACRT1800x600_1_H;
 	const SiS_LCDACRT1DataStruct  *SiS_LCDACRT11024x768_1_H;
 	const SiS_LCDACRT1DataStruct  *SiS_LCDACRT11280x1024_1_H;
 	const SiS_LCDACRT1DataStruct  *SiS_LCDACRT11400x1050_1_H;
 	const SiS_LCDACRT1DataStruct  *SiS_LCDACRT11600x1200_1_H;
-	const SiS_LCDACRT1DataStruct  *SiS_LCDACRT1800x600_2;
 	const SiS_LCDACRT1DataStruct  *SiS_LCDACRT11024x768_2;
 	const SiS_LCDACRT1DataStruct  *SiS_LCDACRT11280x1024_2;
 	const SiS_LCDACRT1DataStruct  *SiS_LCDACRT11400x1050_2;
 	const SiS_LCDACRT1DataStruct  *SiS_LCDACRT11600x1200_2;
-	const SiS_LCDACRT1DataStruct  *SiS_LCDACRT1800x600_2_H;
 	const SiS_LCDACRT1DataStruct  *SiS_LCDACRT11024x768_2_H;
 	const SiS_LCDACRT1DataStruct  *SiS_LCDACRT11280x1024_2_H;
 	const SiS_LCDACRT1DataStruct  *SiS_LCDACRT11400x1050_2_H;
 	const SiS_LCDACRT1DataStruct  *SiS_LCDACRT11600x1200_2_H;
 
-	/* TW: New for 650/301LV */
 	const SiS_Part2PortTblStruct *SiS_CRT2Part2_1024x768_1;
 	const SiS_Part2PortTblStruct *SiS_CRT2Part2_1280x1024_1;
 	const SiS_Part2PortTblStruct *SiS_CRT2Part2_1400x1050_1;
@@ -539,6 +655,9 @@
 	const UCHAR *SiS_CHTVVCLKUPALN;
 	const UCHAR *SiS_CHTVVCLKOPALN;
 	const UCHAR *SiS_CHTVVCLKSOPAL;
+
+	USHORT  PanelXRes;
+	USHORT  PanelYRes;
 	
 	BOOLEAN UseCustomMode;
 	BOOLEAN CRT1UsesCustomMode;
@@ -560,10 +679,12 @@
 	UCHAR   CSR2B;
 	UCHAR   CSR2C;
 	USHORT  CSRClock;
+	USHORT  CSRClock_CRT1;
 	USHORT  CModeFlag;
+	USHORT  CModeFlag_CRT1;
 	USHORT  CInfoFlag;
-	BOOLEAN SiS_CHPALM;
-	BOOLEAN SiS_CHPALN;
+
+	int	LVDSHL;
 	
 	BOOLEAN Backup;
 	UCHAR Backup_Mode;
@@ -578,7 +699,22 @@
 	UCHAR Backup_1c;
 	UCHAR Backup_1d;
 	
-	int    UsePanelScaler;
+	int     UsePanelScaler;
+
+	USHORT  CP_Vendor, CP_Product;
+	BOOLEAN CP_HaveCustomData;
+	int     CP_PreferredX, CP_PreferredY;
+	int	CP_MaxX, CP_MaxY, CP_MaxClock;
+	BOOLEAN CP_Supports64048075;
+	int     CP_HDisplay[7], CP_VDisplay[7];	/* For Custom LCD panel dimensions */
+    	int     CP_HTotal[7], CP_VTotal[7];
+    	int     CP_HSyncStart[7], CP_VSyncStart[7];
+    	int     CP_HSyncEnd[7], CP_VSyncEnd[7];
+	int     CP_HBlankStart[7], CP_VBlankStart[7];
+	int     CP_HBlankEnd[7], CP_VBlankEnd[7];
+    	int     CP_Clock[7];
+	BOOLEAN CP_DataValid[7];
+	BOOLEAN CP_HSync_P[7], CP_VSync_P[7], CP_SyncValid[7];
 } SiS_Private;
 
 #endif
--- diff/drivers/video/vga16fb.c	2003-05-21 11:50:16.000000000 +0100
+++ source/drivers/video/vga16fb.c	2004-02-09 10:39:55.000000000 +0000
@@ -1341,6 +1341,7 @@
 int __init vga16fb_init(void)
 {
 	int i;
+	int ret;
 
 	printk(KERN_DEBUG "vga16fb: initializing\n");
 
@@ -1349,7 +1350,8 @@
         vga16fb.screen_base = ioremap(VGA_FB_PHYS, VGA_FB_PHYS_LEN);
 	if (!vga16fb.screen_base) {
 		printk(KERN_ERR "vga16fb: unable to map device\n");
-		return -ENOMEM;
+		ret = -ENOMEM;
+		goto err_ioremap;
 	}
 	printk(KERN_INFO "vga16fb: mapped to 0x%p\n", vga16fb.screen_base);
 
@@ -1371,28 +1373,45 @@
 	vga16fb.flags = FBINFO_FLAG_DEFAULT;
 
 	i = (vga16fb_defined.bits_per_pixel == 8) ? 256 : 16;
-	fb_alloc_cmap(&vga16fb.cmap, i, 0);
+	ret = fb_alloc_cmap(&vga16fb.cmap, i, 0);
+	if (ret) {
+		printk(KERN_ERR "vga16fb: unable to allocate colormap\n");
+		ret = -ENOMEM;
+		goto err_alloc_cmap;
+	}
 
-	if (vga16fb_check_var(&vga16fb.var, &vga16fb))
-		return -EINVAL;
+	if (vga16fb_check_var(&vga16fb.var, &vga16fb)) {
+		printk(KERN_ERR "vga16fb: unable to validate variable\n");
+		ret = -EINVAL;
+		goto err_check_var;
+	}
 
 	vga16fb_update_fix(&vga16fb);
 
 	if (register_framebuffer(&vga16fb) < 0) {
-		iounmap(vga16fb.screen_base);
-		return -EINVAL;
+		printk(KERN_ERR "vga16fb: unable to register framebuffer\n");
+		ret = -EINVAL;
+		goto err_check_var;
 	}
 
 	printk(KERN_INFO "fb%d: %s frame buffer device\n",
 	       vga16fb.node, vga16fb.fix.id);
 
 	return 0;
+
+ err_check_var:
+	fb_dealloc_cmap(&vga16fb.cmap);
+ err_alloc_cmap:
+	iounmap(vga16fb.screen_base);
+ err_ioremap:
+	return ret;
 }
 
 static void __exit vga16fb_exit(void)
 {
     unregister_framebuffer(&vga16fb);
     iounmap(vga16fb.screen_base);
+    fb_dealloc_cmap(&vga16fb.cmap);
     /* XXX unshare VGA regions */
 }
 
--- diff/drivers/video/vgastate.c	2003-07-08 09:55:19.000000000 +0100
+++ source/drivers/video/vgastate.c	2004-02-09 10:39:55.000000000 +0000
@@ -365,7 +365,7 @@
 	if (saved == NULL)
 		return 1;
 	memset (saved, 0, sizeof(struct regstate));
-	(struct regstate *) state->vidstate = saved;
+	state->vidstate = (void *)saved;
 		
 	if (state->flags & VGA_SAVE_CMAP) {
 		saved->vga_cmap = vmalloc(768);
@@ -420,9 +420,8 @@
 
 		if (!fbbase) {
 			vga_cleanup(state);
-			iounmap(fbbase);
 			return 1;
-	}
+		}
 
 		/* 
 		 * save only first 32K used by vgacon
@@ -430,10 +429,11 @@
 		if (state->flags & VGA_SAVE_FONT0) {
 			saved->vga_font0 = vmalloc(4 * 8192);
 			if (!saved->vga_font0) {
-			vga_cleanup(state);
-			return 1;
+				iounmap(fbbase);
+				vga_cleanup(state);
+				return 1;
+			}
 		}
-	}
 		/* 
 		 * largely unused, but if required by the caller
 		 * we'll just save everything.
@@ -441,19 +441,21 @@
 		if (state->flags & VGA_SAVE_FONT1) {
 			saved->vga_font1 = vmalloc(state->memsize);
 			if (!saved->vga_font1) {
-			vga_cleanup(state);
-			return 1;
+				iounmap(fbbase);
+				vga_cleanup(state);
+				return 1;
+			}
 		}
-	}
 		/*
 		 * Save 8K at plane0[0], and 8K at plane1[16K]
 		 */
 		if (state->flags & VGA_SAVE_TEXT) {
 			saved->vga_text = vmalloc(8192 * 2);
 			if (!saved->vga_text) {
-			vga_cleanup(state);
-			return 1;
-		}
+				iounmap(fbbase);
+				vga_cleanup(state);
+				return 1;
+			}
 		}
 		
 		save_vga_text(state, fbbase);
@@ -475,7 +477,6 @@
 
 		if (!fbbase) {
 			vga_cleanup(state);
-			iounmap(fbbase);
 			return 1;
 		}
 		restore_vga_text(state, fbbase);
--- diff/fs/Kconfig	2004-01-19 10:22:59.000000000 +0000
+++ source/fs/Kconfig	2004-02-09 10:39:56.000000000 +0000
@@ -768,6 +768,30 @@
 	bool
 	default y if !ARM
 
+config SYSFS
+	bool "sysfs file system support" if EMBEDDED
+	default y
+	help
+	The sysfs filesystem is a virtual filesystem that the kernel uses to export
+	internal kernel objects, their attributes, and their relationships to one
+	another.
+
+	Users can use sysfs to ascertain useful information about the running kernel,
+	such as the devices the kernel has discovered on each bus and which driver
+	each is bound to. sysfs can also be used to tune devices and other kernel
+	subsystems.
+
+	Some system agents rely on the information in sysfs to operate. /sbin/hotplug
+	uses device and object attributes in sysfs to assist in delegating policy
+	decisions, like persistantly naming devices.
+
+	sysfs is currently needed by the block subsystem to mount the root partition.
+	Therefore, you MUST say Y if you're booting from a hard drive. If you use any
+	type of hotpluggable device, you'll also need sysfs for /sbin/hotplug support.
+
+	However, designers of embedded systems may want to say N here to conserve
+	space.
+
 config DEVFS_FS
 	bool "/dev file system support (OBSOLETE)"
 	depends on EXPERIMENTAL
@@ -1580,9 +1604,12 @@
 	  
 	  For most cases you probably want to say N.
 
+#
+# Intermezzo broke when we added the expanded NGROUPS patches
+#
 config INTERMEZZO_FS
 	tristate "InterMezzo file system support (replicating fs) (EXPERIMENTAL)"
-	depends on INET && EXPERIMENTAL
+	depends on INET && EXPERIMENTAL && BROKEN
 	help
 	  InterMezzo is a networked file system with disconnected operation
 	  and kernel level write back caching.  It is most often used for
--- diff/fs/Makefile	2003-08-26 10:00:54.000000000 +0100
+++ source/fs/Makefile	2004-02-09 10:39:56.000000000 +0000
@@ -39,12 +39,13 @@
 
 obj-$(CONFIG_PROC_FS)		+= proc/
 obj-y				+= partitions/
-obj-y				+= sysfs/
+obj-$(CONFIG_SYSFS)		+= sysfs/
 obj-y				+= devpts/
 
 obj-$(CONFIG_PROFILING)		+= dcookies.o
  
 # Do not add any filesystems before this line
+obj-$(CONFIG_REISERFS_FS)	+= reiserfs/
 obj-$(CONFIG_EXT3_FS)		+= ext3/ # Before ext2 so root fs can be ext3
 obj-$(CONFIG_JBD)		+= jbd/
 obj-$(CONFIG_EXT2_FS)		+= ext2/
@@ -84,7 +85,6 @@
 obj-$(CONFIG_AUTOFS_FS)		+= autofs/
 obj-$(CONFIG_AUTOFS4_FS)	+= autofs4/
 obj-$(CONFIG_ADFS_FS)		+= adfs/
-obj-$(CONFIG_REISERFS_FS)	+= reiserfs/
 obj-$(CONFIG_UDF_FS)		+= udf/
 obj-$(CONFIG_SUN_OPENPROMFS)	+= openpromfs/
 obj-$(CONFIG_JFS_FS)		+= jfs/
--- diff/fs/binfmt_elf.c	2004-02-09 10:36:12.000000000 +0000
+++ source/fs/binfmt_elf.c	2004-02-09 10:39:55.000000000 +0000
@@ -123,7 +123,7 @@
 #define STACK_ADD(sp, items) ((elf_addr_t *)(sp) - (items))
 #define STACK_ROUND(sp, items) \
 	(((unsigned long) (sp - items)) &~ 15UL)
-#define STACK_ALLOC(sp, len) sp -= len
+#define STACK_ALLOC(sp, len) ({ sp -= len ; sp; })
 #endif
 
 static void
@@ -168,7 +168,7 @@
 		if (smp_num_siblings > 1)
 			STACK_ALLOC(p, ((current->pid % 64) << 7));
 #endif
-		u_platform = (elf_addr_t *) STACK_ALLOC(p, len);
+		u_platform = (elf_addr_t *)STACK_ALLOC(p, len);
 		__copy_to_user(u_platform, k_platform, len);
 	}
 
@@ -1448,7 +1448,13 @@
 					void *kaddr;
 					flush_cache_page(vma, addr);
 					kaddr = kmap(page);
-					DUMP_WRITE(kaddr, PAGE_SIZE);
+					if ((size += PAGE_SIZE) > limit ||
+					    !dump_write(file, kaddr,
+					    PAGE_SIZE)) {
+						kunmap(page);
+						page_cache_release(page);
+						goto end_coredump;
+					}
 					kunmap(page);
 				}
 				page_cache_release(page);
--- diff/fs/binfmt_misc.c	2003-11-25 15:24:58.000000000 +0000
+++ source/fs/binfmt_misc.c	2004-02-09 10:39:55.000000000 +0000
@@ -38,6 +38,7 @@
 
 enum {Enabled, Magic};
 #define MISC_FMT_PRESERVE_ARGV0 (1<<31)
+#define MISC_FMT_OPEN_BINARY (1<<30)
 
 typedef struct {
 	struct list_head list;
@@ -101,10 +102,15 @@
 static int load_misc_binary(struct linux_binprm *bprm, struct pt_regs *regs)
 {
 	Node *fmt;
-	struct file * file;
+	struct file * interp_file = NULL;
+	struct file * binary_file = NULL;
 	char iname[BINPRM_BUF_SIZE];
 	char *iname_addr = iname;
 	int retval;
+	int fd_binary = -1;
+	char fd_str[32];
+	char * fdsp = fd_str;
+	int is_open_bin;
 
 	retval = -ENOEXEC;
 	if (!enabled)
@@ -119,33 +125,102 @@
 	if (!fmt)
 		goto _ret;
 
-	allow_write_access(bprm->file);
-	fput(bprm->file);
-	bprm->file = NULL;
+	is_open_bin = (fmt->flags & MISC_FMT_OPEN_BINARY) ? 1 : 0;
+
+ 	if (is_open_bin) {
+		/* if the binary should be opened on behalf of the
+		 * interpreter than keep it open and assign descriptor
+		 * to it */
+ 		fd_binary = get_unused_fd ();
+ 		if (fd_binary < 0) {
+ 			retval = fd_binary;
+ 			goto _ret;
+ 		}
+ 		snprintf (fd_str, sizeof(fd_str) - 1, "%d", fd_binary);
+ 	} else {
+ 		allow_write_access (bprm->file);
+ 		fput (bprm->file);
+ 		bprm->file = NULL;
+ 	}
 
 	/* Build args for interpreter */
 	if (!(fmt->flags & MISC_FMT_PRESERVE_ARGV0)) {
 		remove_arg_zero(bprm);
 	}
-	retval = copy_strings_kernel(1, &bprm->interp, bprm);
-	if (retval < 0) goto _ret; 
-	bprm->argc++;
-	retval = copy_strings_kernel(1, &iname_addr, bprm);
-	if (retval < 0) goto _ret; 
-	bprm->argc++;
+
+ 	if (is_open_bin) {
+		/* make argv[1] be the file descriptor of the binary */
+ 		retval = copy_strings_kernel (1, &fdsp, bprm);
+ 	} else {
+		/* make argv[1] be the path to the binary */
+ 		retval = copy_strings_kernel (1, &bprm->interp, bprm);
+ 	}
+	if (retval < 0)
+		goto _error;
+	bprm->argc ++;
+	retval = copy_strings_kernel (1, &iname_addr, bprm);
+	if (retval < 0)
+		goto _error;
+	bprm->argc ++;
 	bprm->interp = iname;	/* for binfmt_script */
 
-	file = open_exec(iname);
-	retval = PTR_ERR(file);
-	if (IS_ERR(file))
-		goto _ret;
-	bprm->file = file;
+	interp_file = open_exec (iname);
+	retval = PTR_ERR (interp_file);
+	if (IS_ERR (interp_file))
+		goto _error;
+
+	if (is_open_bin) {
+		binary_file = bprm->file;
+		/* if the binary is not readable than enforce mm->dumpable=0
+		   regardless of the interpreter's permissions */
+		if (permission (binary_file->f_dentry->d_inode, MAY_READ, NULL)) {
+			bprm->interp_flags |= BINPRM_FLAGS_ENFORCE_NONDUMP;
+		}
+		/* call prepare_binprm before switching to interpreter's file
+		 * so that all security calculation will be done according to
+		 * binary and not interpreter */
+		retval = prepare_binprm (bprm);
+		if (retval < 0)
+			goto _error;
+		/* switch to interpreter and read it's header */
+		bprm->file = interp_file;
+		memset (bprm->buf, 0, BINPRM_BUF_SIZE);
+		retval = kernel_read (bprm->file, 0, bprm->buf,BINPRM_BUF_SIZE);
+	} else {
+		bprm->file = interp_file;
+		retval = prepare_binprm (bprm);
+	}
+
+	if (retval < 0)
+		goto _error;
+
+	/* install the binary's fd. it is done at the latest possible point
+	 * because once it is installed it will need to be sys_close()ed
+	 * in case of error.
+	 */
+	if (is_open_bin)
+ 		fd_install (fd_binary, binary_file);
+
+	retval = search_binary_handler (bprm, regs);
+
+	if (retval < 0)
+		goto _error_close_file;
 
-	retval = prepare_binprm(bprm);
-	if (retval >= 0)
-		retval = search_binary_handler(bprm, regs);
 _ret:
 	return retval;
+
+_error_close_file:
+	if (fd_binary > 0) {
+		sys_close (fd_binary);
+		fd_binary = -1;
+		bprm->file = NULL;
+	}
+_error:
+	if (fd_binary > 0)
+		put_unused_fd (fd_binary);
+	bprm->interp_flags = 0;
+	goto _ret;
+
 }
 
 /* Command parsers */
@@ -190,6 +265,29 @@
 	return p - from;
 }
 
+static inline char * check_special_flags (char * sfs, Node * e)
+{
+	char * p = sfs;
+	int cont = 1;
+
+	/* special flags */
+	while (cont) {
+		switch (*p) {
+			case 'P':
+				p++;
+				e->flags |= MISC_FMT_PRESERVE_ARGV0;
+				break;
+			case 'O':
+				p++;
+				e->flags |= MISC_FMT_OPEN_BINARY;
+				break;
+			default:
+				cont = 0;
+		}
+	}
+
+	return p;
+}
 /*
  * This registers a new binary format, it recognises the syntax
  * ':name:type:offset:magic:mask:interpreter:'
@@ -292,10 +390,8 @@
 	if (!e->interpreter[0])
 		goto Einval;
 
-	if (*p == 'P') {
-		p++;
-		e->flags |= MISC_FMT_PRESERVE_ARGV0;
-	}
+
+	p = check_special_flags (p, e);
 
 	if (*p == '\n')
 		p++;
--- diff/fs/bio.c	2004-02-09 10:36:12.000000000 +0000
+++ source/fs/bio.c	2004-02-09 10:39:55.000000000 +0000
@@ -281,23 +281,9 @@
 	return nr_pages;
 }
 
-/**
- *	bio_add_page	-	attempt to add page to bio
- *	@bio: destination bio
- *	@page: page to add
- *	@len: vec entry length
- *	@offset: vec entry offset
- *
- *	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. 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)
+static int __bio_add_page(request_queue_t *q, struct bio *bio, struct page
+			  *page, unsigned int len, unsigned int offset)
 {
-	request_queue_t *q = bdev_get_queue(bio->bi_bdev);
 	int retried_segments = 0;
 	struct bio_vec *bvec;
 
@@ -362,14 +348,33 @@
 	return len;
 }
 
-static struct bio *__bio_map_user(struct block_device *bdev,
+/**
+ *	bio_add_page	-	attempt to add page to bio
+ *	@bio: destination bio
+ *	@page: page to add
+ *	@len: vec entry length
+ *	@offset: vec entry offset
+ *
+ *	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. 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)
+{
+	return __bio_add_page(bdev_get_queue(bio->bi_bdev), bio, page,
+			      len, offset);
+}
+
+static struct bio *__bio_map_user(request_queue_t *q, struct block_device *bdev,
 				  unsigned long uaddr, unsigned int len,
 				  int write_to_vm)
 {
 	unsigned long end = (uaddr + len + PAGE_SIZE - 1) >> PAGE_SHIFT;
 	unsigned long start = uaddr >> PAGE_SHIFT;
 	const int nr_pages = end - start;
-	request_queue_t *q = bdev_get_queue(bdev);
 	int ret, offset, i;
 	struct page **pages;
 	struct bio *bio;
@@ -412,7 +417,7 @@
 		/*
 		 * sorry...
 		 */
-		if (bio_add_page(bio, pages[i], bytes, offset) < bytes)
+		if (__bio_add_page(q, bio, pages[i], bytes, offset) < bytes)
 			break;
 
 		len -= bytes;
@@ -451,12 +456,12 @@
  *	Map the user space address into a bio suitable for io to a block
  *	device.
  */
-struct bio *bio_map_user(struct block_device *bdev, unsigned long uaddr,
-			 unsigned int len, int write_to_vm)
+struct bio *bio_map_user(request_queue_t *q, struct block_device *bdev,
+			 unsigned long uaddr, unsigned int len, int write_to_vm)
 {
 	struct bio *bio;
 
-	bio = __bio_map_user(bdev, uaddr, len, write_to_vm);
+	bio = __bio_map_user(q, bdev, uaddr, len, write_to_vm);
 
 	if (bio) {
 		/*
--- diff/fs/block_dev.c	2004-02-09 10:36:12.000000000 +0000
+++ source/fs/block_dev.c	2004-02-09 10:39:55.000000000 +0000
@@ -525,7 +525,8 @@
 static void bd_set_size(struct block_device *bdev, loff_t size)
 {
 	unsigned bsize = bdev_hardsect_size(bdev);
-	i_size_write(bdev->bd_inode, size);
+
+	bdev->bd_inode->i_size = size;
 	while (bsize < PAGE_CACHE_SIZE) {
 		if (size & bsize)
 			break;
--- diff/fs/buffer.c	2004-02-09 10:36:12.000000000 +0000
+++ source/fs/buffer.c	2004-02-09 10:39:55.000000000 +0000
@@ -431,6 +431,7 @@
 	printk("block=%llu, b_blocknr=%llu\n",
 		(unsigned long long)block, (unsigned long long)bh->b_blocknr);
 	printk("b_state=0x%08lx, b_size=%u\n", bh->b_state, bh->b_size);
+	printk("device blocksize: %d\n", 1 << bd_inode->i_blkbits);
 out_unlock:
 	spin_unlock(&bd_mapping->private_lock);
 	page_cache_release(page);
@@ -857,10 +858,13 @@
 		struct buffer_head *bh = head;
 
 		do {
-			if (buffer_uptodate(bh))
+			if (buffer_uptodate(bh)) {
 				set_buffer_dirty(bh);
-			else
+				if (unlikely(block_dump))
+					printk("%s(%d): dirtied buffer\n", current->comm, current->pid);
+			} else {
 				buffer_error();
+			}
 			bh = bh->b_this_page;
 		} while (bh != head);
 	}
@@ -1806,23 +1810,24 @@
 
 	do {
 		get_bh(bh);
-		if (buffer_mapped(bh) && buffer_dirty(bh)) {
-			if (wbc->sync_mode != WB_SYNC_NONE) {
-				lock_buffer(bh);
-			} else {
-				if (test_set_buffer_locked(bh)) {
+		if (!buffer_mapped(bh))
+			continue;
+		if (wbc->sync_mode != WB_SYNC_NONE) {
+			lock_buffer(bh);
+		} else {
+			if (test_set_buffer_locked(bh)) {
+				if (buffer_dirty(bh))
 					__set_page_dirty_nobuffers(page);
-					continue;
-				}
-			}
-			if (test_clear_buffer_dirty(bh)) {
-				if (!buffer_uptodate(bh))
-					buffer_error();
-				mark_buffer_async_write(bh);
-			} else {
-				unlock_buffer(bh);
+				continue;
 			}
 		}
+		if (test_clear_buffer_dirty(bh)) {
+			if (!buffer_uptodate(bh))
+				buffer_error();
+			mark_buffer_async_write(bh);
+		} else {
+			unlock_buffer(bh);
+		}
 	} while ((bh = bh->b_this_page) != head);
 
 	BUG_ON(PageWriteback(page));
@@ -2987,33 +2992,26 @@
 	}
 }
 
-static void buffer_init_cpu(int cpu)
+#ifdef CONFIG_HOTPLUG_CPU
+static void buffer_exit_cpu(int cpu)
 {
-	struct bh_accounting *bha = &per_cpu(bh_accounting, cpu);
-	struct bh_lru *bhl = &per_cpu(bh_lrus, cpu);
+	int i;
+	struct bh_lru *b = &per_cpu(bh_lrus, cpu);
 
-	bha->nr = 0;
-	bha->ratelimit = 0;
-	memset(bhl, 0, sizeof(*bhl));
+	for (i = 0; i < BH_LRU_SIZE; i++) {
+		brelse(b->bhs[i]);
+		b->bhs[i] = NULL;
+	}
 }
-	
-static int __devinit buffer_cpu_notify(struct notifier_block *self, 
-				unsigned long action, void *hcpu)
+
+static int buffer_cpu_notify(struct notifier_block *self,
+			      unsigned long action, void *hcpu)
 {
-	long cpu = (long)hcpu;
-	switch(action) {
-	case CPU_UP_PREPARE:
-		buffer_init_cpu(cpu);
-		break;
-	default:
-		break;
-	}
+	if (action == CPU_DEAD)
+		buffer_exit_cpu((unsigned long)hcpu);
 	return NOTIFY_OK;
 }
-
-static struct notifier_block __devinitdata buffer_nb = {
-	.notifier_call	= buffer_cpu_notify,
-};
+#endif /* CONFIG_HOTPLUG_CPU */
 
 void __init buffer_init(void)
 {
@@ -3031,9 +3029,7 @@
 	 */
 	nrpages = (nr_free_buffer_pages() * 10) / 100;
 	max_buffer_heads = nrpages * (PAGE_SIZE / sizeof(struct buffer_head));
-	buffer_cpu_notify(&buffer_nb, (unsigned long)CPU_UP_PREPARE,
-				(void *)(long)smp_processor_id());
-	register_cpu_notifier(&buffer_nb);
+	hotcpu_notifier(buffer_cpu_notify, 0);
 }
 
 EXPORT_SYMBOL(__bforget);
--- diff/fs/compat_ioctl.c	2004-02-09 10:36:12.000000000 +0000
+++ source/fs/compat_ioctl.c	2004-02-09 10:39:55.000000000 +0000
@@ -2112,6 +2112,7 @@
 		case FDDEFPRM32:
 		case FDGETPRM32:
 		{
+			compat_uptr_t name;
 			struct floppy_struct32 *uf;
 			struct floppy_struct *f;
 
@@ -2130,7 +2131,8 @@
 			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);
+			err |= __get_user(name, &uf->name);
+			f->name = compat_ptr(name);
 			if (err) {
 				err = -EFAULT;
 				goto out;
--- diff/fs/dcache.c	2004-01-19 10:22:59.000000000 +0000
+++ source/fs/dcache.c	2004-02-09 10:39:55.000000000 +0000
@@ -49,6 +49,7 @@
  */
 #define D_HASHBITS     d_hash_shift
 #define D_HASHMASK     d_hash_mask
+#define D_HASHMAX	(2*1024*1024UL)	/* max number of entries */
 
 static unsigned int d_hash_mask;
 static unsigned int d_hash_shift;
@@ -1296,10 +1297,14 @@
 			break;
 		if (dentry == vfsmnt->mnt_root || IS_ROOT(dentry)) {
 			/* Global root? */
-			if (vfsmnt->mnt_parent == vfsmnt)
+			spin_lock(&vfsmount_lock);
+			if (vfsmnt->mnt_parent == vfsmnt) {
+				spin_unlock(&vfsmount_lock);
 				goto global_root;
+			}
 			dentry = vfsmnt->mnt_mountpoint;
 			vfsmnt = vfsmnt->mnt_parent;
+			spin_unlock(&vfsmount_lock);
 			continue;
 		}
 		parent = dentry->d_parent;
@@ -1429,15 +1434,23 @@
  *
  * Returns 1 if new_dentry is a subdirectory of the parent (at any depth).
  * Returns 0 otherwise.
+ * Caller must ensure that "new_dentry" is pinned before calling is_subdir()
  */
   
 int is_subdir(struct dentry * new_dentry, struct dentry * old_dentry)
 {
 	int result;
+	struct dentry * saved = new_dentry;
 	unsigned long seq;
 
 	result = 0;
+	/* need rcu_readlock to protect against the d_parent trashing due to
+	 * d_move
+	 */
+	rcu_read_lock();
         do {
+		/* for restarting inner loop in case of seq retry */
+		new_dentry = saved;
 		seq = read_seqbegin(&rename_lock);
 		for (;;) {
 			if (new_dentry != old_dentry) {
@@ -1451,6 +1464,7 @@
 			break;
 		}
 	} while (read_seqretry(&rename_lock, seq));
+	rcu_read_unlock();
 
 	return result;
 }
@@ -1552,10 +1566,10 @@
 	
 	set_shrinker(DEFAULT_SEEKS, shrink_dcache_memory);
 
-#if PAGE_SHIFT < 13
-	mempages >>= (13 - PAGE_SHIFT);
-#endif
-	mempages *= sizeof(struct hlist_head);
+	mempages = PAGE_SHIFT < 13 ?
+		   mempages >> (13 - PAGE_SHIFT) :
+		   mempages << (PAGE_SHIFT - 13);
+	mempages = min(D_HASHMAX, mempages) * sizeof(struct hlist_head);
 	for (order = 0; ((1UL << order) << PAGE_SHIFT) < mempages; order++)
 		;
 
--- diff/fs/devfs/base.c	2004-02-09 10:36:12.000000000 +0000
+++ source/fs/devfs/base.c	2004-02-09 10:39:55.000000000 +0000
@@ -676,6 +676,7 @@
 #include <linux/smp.h>
 #include <linux/rwsem.h>
 #include <linux/sched.h>
+#include <linux/namei.h>
 
 #include <asm/uaccess.h>
 #include <asm/io.h>
@@ -685,9 +686,7 @@
 #include <asm/bitops.h>
 #include <asm/atomic.h>
 
-#include "internal.h"
-
-#define DEVFS_VERSION            "1.22 (20021013)"
+#define DEVFS_VERSION            "2004-01-31"
 
 #define DEVFS_NAME "devfs"
 
@@ -762,18 +761,6 @@
     unsigned char no_more_additions:1;
 };
 
-struct bdev_type
-{
-    dev_t dev;
-};
-
-struct cdev_type
-{
-    struct file_operations *ops;
-    dev_t dev;
-    unsigned char autogen:1;
-};
-
 struct symlink_type
 {
     unsigned int length;         /*  Not including the NULL-termimator       */
@@ -801,8 +788,7 @@
     union 
     {
 	struct directory_type dir;
-	struct bdev_type bdev;
-	struct cdev_type cdev;
+	dev_t dev;
 	struct symlink_type symlink;
 	const char *name;        /*  Only used for (mode == 0)               */
     }
@@ -813,7 +799,7 @@
     struct devfs_inode inode;
     umode_t mode;
     unsigned short namelen;      /*  I think 64k+ filenames are a way off... */
-    unsigned char vfs_deletable:1;/*  Whether the VFS may delete the entry   */
+    unsigned char vfs:1;/*  Whether the VFS may delete the entry   */
     char name[1];                /*  This is just a dummy: the allocated array
 				     is bigger. This is NULL-terminated      */
 };
@@ -925,8 +911,6 @@
 	     de->name, de, de->parent,
 	     de->parent ? de->parent->name : "no parent");
     if ( S_ISLNK (de->mode) ) kfree (de->u.symlink.linkname);
-    if ( S_ISCHR (de->mode) && de->u.cdev.autogen )
-	devfs_dealloc_devnum (de->mode, de->u.cdev.dev);
     WRITE_ENTRY_MAGIC (de, 0);
 #ifdef CONFIG_DEVFS_DEBUG
     spin_lock (&stat_lock);
@@ -1063,46 +1047,40 @@
     return retval;
 }   /*  End Function _devfs_append_entry  */
 
-
 /**
  *	_devfs_get_root_entry - Get the root devfs entry.
  *
  *	Returns the root devfs entry on success, else %NULL.
+ *
+ *	TODO it must be called asynchronously due to the fact
+ *	that devfs is initialized relatively late. Proper way
+ *	is to remove module_init from init_devfs_fs and manually
+ *	call it early enough during system init
  */
 
-static struct devfs_entry *_devfs_get_root_entry (void)
+static struct devfs_entry *_devfs_get_root_entry(void)
 {
-    struct devfs_entry *new;
-    static spinlock_t root_lock = SPIN_LOCK_UNLOCKED;
+	struct devfs_entry *new;
+	static spinlock_t root_lock = SPIN_LOCK_UNLOCKED;
 
-    /*  Always ensure the root is created  */
-    if (root_entry) return root_entry;
-    if ( ( new = _devfs_alloc_entry (NULL, 0,MODE_DIR) ) == NULL ) return NULL;
-    spin_lock (&root_lock);
-    if (root_entry)
-    {
-	spin_unlock (&root_lock);
-	devfs_put (new);
-	return (root_entry);
-    }
-    root_entry = new;
-    spin_unlock (&root_lock);
-    /*  And create the entry for ".devfsd"  */
-    if ( ( new = _devfs_alloc_entry (".devfsd", 0, S_IFCHR |S_IRUSR |S_IWUSR) )
-	 == NULL ) return NULL;
-    new->u.cdev.dev = devfs_alloc_devnum (S_IFCHR |S_IRUSR |S_IWUSR);
-    new->u.cdev.ops = &devfsd_fops;
-    _devfs_append_entry (root_entry, new, NULL);
-#ifdef CONFIG_DEVFS_DEBUG
-    if ( ( new = _devfs_alloc_entry (".stat", 0, S_IFCHR | S_IRUGO | S_IWUGO) )
-	 == NULL ) return NULL;
-    new->u.cdev.dev = devfs_alloc_devnum (S_IFCHR | S_IRUGO | S_IWUGO);
-    new->u.cdev.ops = &stat_fops;
-    _devfs_append_entry (root_entry, new, NULL);
-#endif
-    return root_entry;
-}   /*  End Function _devfs_get_root_entry  */
+	if (root_entry)
+		return root_entry;
 
+	new = _devfs_alloc_entry(NULL, 0, MODE_DIR);
+	if (new == NULL )
+		return NULL;
+
+	spin_lock(&root_lock);
+	if (root_entry) {
+		spin_unlock(&root_lock);
+		devfs_put(new);
+		return root_entry;
+	}
+	root_entry = new;
+	spin_unlock(&root_lock);
+
+	return root_entry;
+}   /*  End Function _devfs_get_root_entry  */
 
 /**
  *	_devfs_descend - Descend down a tree using the next component name.
@@ -1237,6 +1215,7 @@
 	}
 	if (S_ISLNK (de->mode) && traverse_symlink)
 	{   /*  Need to follow the link: this is a stack chomper  */
+		/* FIXME what if it puts outside of mounted tree? */
 	    link = _devfs_walk_path (dir, de->u.symlink.linkname,
 				     de->u.symlink.length, TRUE);
 	    devfs_put (de);
@@ -1444,27 +1423,19 @@
 			 current->egid, &fs_info);
 } 
 
-int devfs_mk_bdev(dev_t dev, umode_t mode, const char *fmt, ...)
+static int devfs_mk_dev(dev_t dev, umode_t mode, const char *fmt, va_list args)
 {
 	struct devfs_entry *dir = NULL, *de;
 	char buf[64];
-	va_list args;
 	int error, n;
 
-	va_start(args, fmt);
-	n = vsnprintf(buf, 64, fmt, args);
-	if (n >= 64 || !buf[0]) {
-		printk(KERN_WARNING "%s: invalid format string\n",
-				__FUNCTION__);
+	n = vsnprintf(buf, sizeof(buf), fmt, args);
+	if (n >= sizeof(buf) || !buf[0]) {
+		printk(KERN_WARNING "%s: invalid format string %s\n",
+				__FUNCTION__, fmt);
 		return -EINVAL;
 	}
 	
-	if (!S_ISBLK(mode)) {
-		printk(KERN_WARNING "%s: invalide mode (%u) for %s\n",
-				__FUNCTION__, mode, buf);
-		return -EINVAL;
-	}
-
 	de = _devfs_prepare_leaf(&dir, buf, mode);
 	if (!de) {
 		printk(KERN_WARNING "%s: could not prepare leaf for %s\n",
@@ -1472,7 +1443,7 @@
 		return -ENOMEM;		/* could be more accurate... */
 	}
 
-	de->u.bdev.dev = dev;
+	de->u.dev = dev;
 
 	error = _devfs_append_entry(dir, de, NULL);
 	if (error) {
@@ -1487,50 +1458,35 @@
 	return error;
 }
 
+int devfs_mk_bdev(dev_t dev, umode_t mode, const char *fmt, ...)
+{
+	va_list args;
+
+	if (!S_ISBLK(mode)) {
+		printk(KERN_WARNING "%s: invalide mode (%u) for %s\n",
+				__FUNCTION__, mode, fmt);
+		return -EINVAL;
+	}
+
+	va_start(args, fmt);
+	return devfs_mk_dev(dev, mode, fmt, args);
+}
+
 EXPORT_SYMBOL(devfs_mk_bdev);
 
 
 int devfs_mk_cdev(dev_t dev, umode_t mode, const char *fmt, ...)
 {
-	struct devfs_entry *dir = NULL, *de;
-	char buf[64];
 	va_list args;
-	int error, n;
-
-	va_start(args, fmt);
-	n = vsnprintf(buf, 64, fmt, args);
-	if (n >= 64 || !buf[0]) {
-		printk(KERN_WARNING "%s: invalid format string\n",
-				__FUNCTION__);
-		return -EINVAL;
-	}
 
 	if (!S_ISCHR(mode)) {
 		printk(KERN_WARNING "%s: invalide mode (%u) for %s\n",
-				__FUNCTION__, mode, buf);
+				__FUNCTION__, mode, fmt);
 		return -EINVAL;
 	}
 
-	de = _devfs_prepare_leaf(&dir, buf, mode);
-	if (!de) {
-		printk(KERN_WARNING "%s: could not prepare leaf for %s\n",
-				__FUNCTION__, buf);
-		return -ENOMEM;		/* could be more accurate... */
-	}
-
-	de->u.cdev.dev = dev;
-
-	error = _devfs_append_entry(dir, de, NULL);
-	if (error) {
-		printk(KERN_WARNING "%s: could not append to parent for %s\n",
-				__FUNCTION__, buf);
-		goto out;
-	}
-
-	devfsd_notify(de, DEVFSD_NOTIFY_REGISTERED);
- out:
-	devfs_put(dir);
-	return error;
+	va_start(args, fmt);
+	return devfs_mk_dev(dev, mode, fmt, args);
 }
 
 EXPORT_SYMBOL(devfs_mk_cdev);
@@ -1663,7 +1619,7 @@
 
 	err = devfs_do_symlink(NULL, from, to, &de);
 	if (!err) {
-		de->vfs_deletable = TRUE;
+		de->vfs = TRUE;
 		devfsd_notify(de, DEVFSD_NOTIFY_REGISTERED);
 	}
 
@@ -1732,8 +1688,8 @@
 	int n;
 
 	va_start(args, fmt);
-	n = vsnprintf(buf, 64, fmt, args);
-	if (n < 64 && buf[0]) {
+	n = vsnprintf(buf, sizeof(buf), fmt, args);
+	if (n < sizeof(buf) && buf[0]) {
 		devfs_handle_t de = _devfs_find_entry(NULL, buf, 0);
 
 		if (!de) {
@@ -1784,33 +1740,6 @@
     return pos;
 }   /*  End Function devfs_generate_path  */
 
-
-/**
- *	devfs_get_ops - Get the device operations for a devfs entry.
- *	@de: The handle to the device entry.
- *
- *	Returns a pointer to the device operations on success, else NULL.
- *	The use count for the module owning the operations will be incremented.
- */
-
-static struct file_operations *devfs_get_ops (devfs_handle_t de)
-{
-    struct file_operations *ops = de->u.cdev.ops;
-    struct module *owner;
-
-    if (!ops)
-	return NULL;
-    owner = ops->owner;
-    read_lock (&de->parent->u.dir.lock);  /*  Prevent module from unloading  */
-    if ( (de->next == de) || !try_module_get (owner) )
-    {   /*  Entry is already unhooked or module is unloading  */
-	read_unlock (&de->parent->u.dir.lock);
-	return NULL;
-    }
-    read_unlock (&de->parent->u.dir.lock);  /*  Module can continue unloading*/
-    return ops;
-}   /*  End Function devfs_get_ops  */
-
 /**
  *	devfs_setup - Process kernel boot options.
  *	@str: The boot options after the "devfs=".
@@ -1876,7 +1805,6 @@
 
 __setup("devfs=", devfs_setup);
 
-EXPORT_SYMBOL(devfs_put);
 EXPORT_SYMBOL(devfs_mk_symlink);
 EXPORT_SYMBOL(devfs_mk_dir);
 EXPORT_SYMBOL(devfs_remove);
@@ -1996,6 +1924,7 @@
 	iput (inode);
 	return NULL;
     }
+    /* FIXME where is devfs_put? */
     inode->u.generic_ip = devfs_get (de);
     inode->i_ino = de->inode.ino;
     DPRINTK (DEBUG_I_GET, "(%d): VFS inode: %p  devfs_entry: %p\n",
@@ -2003,26 +1932,25 @@
     inode->i_blocks = 0;
     inode->i_blksize = FAKE_BLOCK_SIZE;
     inode->i_op = &devfs_iops;
-    inode->i_fop = &devfs_fops;
-    if ( S_ISCHR (de->mode) )
-    {
-	inode->i_rdev = de->u.cdev.dev;
-    }
-    else if ( S_ISBLK (de->mode) )
-	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) )
-    {
-	inode->i_op = &devfs_dir_iops;
-    	inode->i_fop = &devfs_dir_fops;
-    }
-    else if ( S_ISLNK (de->mode) )
-    {
-	inode->i_op = &devfs_symlink_iops;
-	inode->i_size = de->u.symlink.length;
-    }
     inode->i_mode = de->mode;
+	if (S_ISDIR(de->mode)) {
+		inode->i_op = &devfs_dir_iops;
+		inode->i_fop = &devfs_dir_fops;
+	} else if (S_ISLNK(de->mode)) {
+		inode->i_op = &devfs_symlink_iops;
+		inode->i_size = de->u.symlink.length;
+	} else if (S_ISCHR(de->mode) || S_ISBLK(de->mode)) {
+		init_special_inode(inode, de->mode, de->u.dev);
+	} else if (S_ISFIFO(de->mode) || S_ISSOCK(de->mode)) {
+		init_special_inode(inode, de->mode, 0);
+	} else {
+		PRINTK("(%s): unknown mode %o de: %p\n",
+			de->name, de->mode, de);
+		iput(inode);
+		devfs_put(de);
+		return NULL;
+	}
+
     inode->i_uid = de->inode.uid;
     inode->i_gid = de->inode.gid;
     inode->i_atime = de->inode.atime;
@@ -2098,29 +2026,37 @@
     return stored;
 }   /*  End Function devfs_readdir  */
 
+/* Open devfs specific special files */
 static int devfs_open (struct inode *inode, struct file *file)
 {
-    int err = -ENODEV;
-    struct devfs_entry *de;
-    struct file_operations *ops;
+	int err;
+	int minor = MINOR(inode->i_rdev);
+	struct file_operations *old_fops, *new_fops;
 
-    de = get_devfs_entry_from_vfs_inode (inode);
-    if (de == NULL) return -ENODEV;
-    if ( S_ISDIR (de->mode) ) return 0;
-    file->private_data = de->info;
-    if (S_ISCHR(inode->i_mode)) {
-	ops = devfs_get_ops (de);  /*  Now have module refcount  */
-	file->f_op = ops;
-	if (file->f_op)
-	{
-	    lock_kernel ();
-	    err = file->f_op->open ? (*file->f_op->open) (inode, file) : 0;
-	    unlock_kernel ();
+	switch (minor) {
+	case 0: /* /dev/.devfsd */
+		new_fops = fops_get(&devfsd_fops);
+		break;
+#ifdef CONFIG_DEVFS_DEBUG
+	case 1: /* /dev/.stat */
+		new_fops = fops_get(&stat_fops);
+		break;
+#endif
+	default:
+		return -ENODEV;
 	}
-	else
-	    err = chrdev_open (inode, file);
-    }
-    return err;
+
+	if (new_fops == NULL)
+		return -ENODEV;
+	old_fops = file->f_op;
+	file->f_op = new_fops;
+	err = new_fops->open ? new_fops->open(inode, file) : 0;
+	if (err) {
+		file->f_op = old_fops;
+		fops_put(new_fops);
+	} else
+		fops_put(old_fops);
+	return err;
 }   /*  End Function devfs_open  */
 
 static struct file_operations devfs_fops =
@@ -2132,7 +2068,6 @@
 {
     .read    = generic_read_dir,
     .readdir = devfs_readdir,
-    .open    = devfs_open,
 };
 
 
@@ -2223,6 +2158,34 @@
     devfs_handle_t parent = get_devfs_entry_from_vfs_inode (dir);
     struct devfs_lookup_struct *lookup_info = dentry->d_fsdata;
     DECLARE_WAITQUEUE (wait, current);
+    int need_lock;
+
+    /*
+     * FIXME HACK
+     *
+     * make sure that
+     *   d_instantiate always runs under lock
+     *   we release i_sem lock before going to sleep
+     *
+     * unfortunately sometimes d_revalidate is called with
+     * and sometimes without i_sem lock held. The following checks
+     * attempt to deduce when we need to add (and drop resp.) lock
+     * here. This relies on current (2.6.2) calling coventions:
+     *
+     *   lookup_hash is always run under i_sem and is passing NULL
+     *   as nd
+     *
+     *   open(...,O_CREATE,...) calls _lookup_hash under i_sem
+     *   and sets flags to LOOKUP_OPEN|LOOKUP_CREATE
+     *
+     *   all other invocations of ->d_revalidate seem to happen
+     *   outside of i_sem
+     */
+    need_lock = nd &&
+		(!(nd->flags & LOOKUP_CREATE) || (nd->flags & LOOKUP_PARENT));
+
+    if (need_lock)
+	down(&dir->i_sem);
 
     if ( is_devfsd_or_child (fs_info) )
     {
@@ -2233,33 +2196,40 @@
 		 "(%s): dentry: %p inode: %p de: %p by: \"%s\"\n",
 		 dentry->d_name.name, dentry, dentry->d_inode, de,
 		 current->comm);
-	if (dentry->d_inode) return 1;
+	if (dentry->d_inode)
+	    goto out;
 	if (de == NULL)
 	{
 	    read_lock (&parent->u.dir.lock);
 	    de = _devfs_search_dir (parent, dentry->d_name.name,
 				    dentry->d_name.len);
 	    read_unlock (&parent->u.dir.lock);
-	    if (de == NULL) return 1;
+	    if (de == NULL)
+		goto out;
 	    lookup_info->de = de;
 	}
 	/*  Create an inode, now that the driver information is available  */
 	inode = _devfs_get_vfs_inode (dir->i_sb, de, dentry);
-	if (!inode) return 1;
+	if (!inode)
+	    goto out;
 	DPRINTK (DEBUG_I_LOOKUP,
 		 "(%s): new VFS inode(%u): %p de: %p by: \"%s\"\n",
 		 de->name, de->inode.ino, inode, de, current->comm);
 	d_instantiate (dentry, inode);
-	return 1;
+	goto out;
     }
-    if (lookup_info == NULL) return 1;  /*  Early termination  */
+    if (lookup_info == NULL)
+	goto out;  /*  Early termination  */
     read_lock (&parent->u.dir.lock);
     if (dentry->d_fsdata)
     {
 	set_current_state (TASK_UNINTERRUPTIBLE);
 	add_wait_queue (&lookup_info->wait_queue, &wait);
 	read_unlock (&parent->u.dir.lock);
+	/* at this point it is always (hopefully) locked */
+	up(&dir->i_sem);
 	schedule ();
+	down(&dir->i_sem);
 	/*
 	 * This does not need nor should remove wait from wait_queue.
 	 * Wait queue head is never reused - nothing is ever added to it
@@ -2271,6 +2241,10 @@
 
     }
     else read_unlock (&parent->u.dir.lock);
+
+out:
+    if (need_lock)
+	up(&dir->i_sem);
     return 1;
 }   /*  End Function devfs_d_revalidate_wait  */
 
@@ -2320,6 +2294,7 @@
 	revalidation  */
     up (&dir->i_sem);
     wait_for_devfsd_finished (fs_info);  /*  If I'm not devfsd, must wait  */
+    down (&dir->i_sem);      /*  Grab it again because them's the rules  */
     de = lookup_info.de;
     /*  If someone else has been so kind as to make the inode, we go home
 	early  */
@@ -2349,7 +2324,6 @@
     dentry->d_fsdata = NULL;
     wake_up (&lookup_info.wait_queue);
     write_unlock (&parent->u.dir.lock);
-    down (&dir->i_sem);      /*  Grab it again because them's the rules  */
     devfs_put (de);
     return retval;
 }   /*  End Function devfs_lookup  */
@@ -2364,7 +2338,7 @@
     de = get_devfs_entry_from_vfs_inode (inode);
     DPRINTK (DEBUG_I_UNLINK, "(%s): de: %p\n", dentry->d_name.name, de);
     if (de == NULL) return -ENOENT;
-    if (!de->vfs_deletable) return -EPERM;
+    if (!de->vfs) return -EPERM;
     write_lock (&de->parent->u.dir.lock);
     unhooked = _devfs_unhook (de);
     write_unlock (&de->parent->u.dir.lock);
@@ -2392,7 +2366,7 @@
     DPRINTK (DEBUG_DISABLED, "(%s): errcode from <devfs_do_symlink>: %d\n",
 	     dentry->d_name.name, err);
     if (err < 0) return err;
-    de->vfs_deletable = TRUE;
+    de->vfs = TRUE;
     de->inode.uid = current->euid;
     de->inode.gid = current->egid;
     de->inode.atime = CURRENT_TIME;
@@ -2421,7 +2395,7 @@
     if (parent == NULL) return -ENOENT;
     de = _devfs_alloc_entry (dentry->d_name.name, dentry->d_name.len, mode);
     if (!de) return -ENOMEM;
-    de->vfs_deletable = TRUE;
+    de->vfs = TRUE;
     if ( ( err = _devfs_append_entry (parent, de, NULL) ) != 0 )
 	return err;
     de->inode.uid = current->euid;
@@ -2451,7 +2425,7 @@
     de = get_devfs_entry_from_vfs_inode (inode);
     if (de == NULL) return -ENOENT;
     if ( !S_ISDIR (de->mode) ) return -ENOTDIR;
-    if (!de->vfs_deletable) return -EPERM;
+    if (!de->vfs) return -EPERM;
     /*  First ensure the directory is empty and will stay that way  */
     write_lock (&de->u.dir.lock);
     if (de->u.dir.first) err = -ENOTEMPTY;
@@ -2485,11 +2459,9 @@
     if (parent == NULL) return -ENOENT;
     de = _devfs_alloc_entry (dentry->d_name.name, dentry->d_name.len, mode);
     if (!de) return -ENOMEM;
-    de->vfs_deletable = TRUE;
-    if (S_ISCHR (mode))
-	de->u.cdev.dev = rdev;
-    else if (S_ISBLK (mode))
-	de->u.bdev.dev = rdev;
+    de->vfs = TRUE;
+    if (S_ISCHR(mode) || S_ISBLK(mode))
+	de->u.dev = rdev;
     if ( ( err = _devfs_append_entry (parent, de, NULL) ) != 0 )
 	return err;
     de->inode.uid = current->euid;
@@ -2642,12 +2614,9 @@
     info->uid = entry->uid;
     info->gid = entry->gid;
     de = entry->de;
-    if (S_ISCHR(de->mode)) {
-	info->major = MAJOR(de->u.cdev.dev);
-	info->minor = MINOR(de->u.cdev.dev);
-    } else if (S_ISBLK (de->mode)) {
-	info->major = MAJOR(de->u.bdev.dev);
-	info->minor = MINOR(de->u.bdev.dev);
+    if (S_ISCHR(de->mode) || S_ISBLK(de->mode)) {
+	info->major = MAJOR(de->u.dev);
+	info->minor = MINOR(de->u.dev);
     }
     pos = devfs_generate_path (de, info->devname, DEVFS_PATHLEN);
     if (pos < 0) return pos;
@@ -2809,30 +2778,53 @@
 }   /*  End Function stat_read  */
 #endif
 
-
-static int __init init_devfs_fs (void)
+static int __init init_devfs_fs(void)
 {
-    int err;
+	int err;
+	int major;
+	struct devfs_entry *devfsd;
+#ifdef CONFIG_DEVFS_DEBUG
+	struct devfs_entry *stat;
+#endif
 
-    printk (KERN_INFO "%s: v%s Richard Gooch (rgooch@atnf.csiro.au)\n",
-	    DEVFS_NAME, DEVFS_VERSION);
-    devfsd_buf_cache = kmem_cache_create ("devfsd_event",
+	if (_devfs_get_root_entry() == NULL)
+		return -ENOMEM;
+
+	printk(KERN_INFO "%s: %s Richard Gooch (rgooch@atnf.csiro.au)\n",
+	       DEVFS_NAME, DEVFS_VERSION);
+	devfsd_buf_cache = kmem_cache_create("devfsd_event",
 					  sizeof (struct devfsd_buf_entry),
 					  0, 0, NULL, NULL);
-    if (!devfsd_buf_cache) OOPS ("(): unable to allocate event slab\n");
+	if (!devfsd_buf_cache)
+		OOPS("(): unable to allocate event slab\n");
 #ifdef CONFIG_DEVFS_DEBUG
-    devfs_debug = devfs_debug_init;
-    printk (KERN_INFO "%s: devfs_debug: 0x%0x\n", DEVFS_NAME, devfs_debug);
+	devfs_debug = devfs_debug_init;
+	printk(KERN_INFO "%s: devfs_debug: 0x%0x\n", DEVFS_NAME, devfs_debug);
 #endif
-    printk (KERN_INFO "%s: boot_options: 0x%0x\n", DEVFS_NAME, boot_options);
-    err = register_filesystem (&devfs_fs_type);
-    if (!err)
-    {
-	struct vfsmount *devfs_mnt = kern_mount (&devfs_fs_type);
-	err = PTR_ERR (devfs_mnt);
-	if ( !IS_ERR (devfs_mnt) ) err = 0;
-    }
-    return err;
+	printk(KERN_INFO "%s: boot_options: 0x%0x\n", DEVFS_NAME, boot_options);
+
+	/* register special device for devfsd communication */
+	major = register_chrdev(0, "devfs", &devfs_fops);
+	if (major < 0)
+		return major;
+
+	/*  And create the entry for ".devfsd"  */
+	devfsd = _devfs_alloc_entry(".devfsd", 0, S_IFCHR|S_IRUSR|S_IWUSR);
+	if (devfsd == NULL )
+		return -ENOMEM;
+	devfsd->u.dev = MKDEV(major, 0);
+	_devfs_append_entry(root_entry, devfsd, NULL);
+
+#ifdef CONFIG_DEVFS_DEBUG
+	stat = _devfs_alloc_entry(".stat", 0, S_IFCHR|S_IRUGO);
+	if (stat == NULL )
+		return -ENOMEM;
+	stat->u.dev = MKDEV(major, 1);
+	_devfs_append_entry (root_entry, stat, NULL);
+#endif
+
+	err = register_filesystem(&devfs_fs_type);
+	return err;
 }   /*  End Function init_devfs_fs  */
 
 void __init mount_devfs_fs (void)
--- diff/fs/devfs/util.c	2003-05-21 11:50:16.000000000 +0100
+++ source/fs/devfs/util.c	2004-02-09 10:39:55.000000000 +0000
@@ -72,7 +72,6 @@
 #include <linux/vmalloc.h>
 #include <linux/genhd.h>
 #include <asm/bitops.h>
-#include "internal.h"
 
 
 int devfs_register_tape(const char *name)
@@ -96,161 +95,3 @@
 }
 
 EXPORT_SYMBOL(devfs_unregister_tape);
-
-struct major_list
-{
-    spinlock_t lock;
-    unsigned long bits[256 / BITS_PER_LONG];
-};
-#if BITS_PER_LONG == 32
-#  define INITIALISER64(low,high) (low), (high)
-#else
-#  define INITIALISER64(low,high) ( (unsigned long) (high) << 32 | (low) )
-#endif
-
-/*  Block majors already assigned:
-    0-3, 7-9, 11-63, 65-99, 101-113, 120-127, 199, 201, 240-255
-    Total free: 122
-*/
-static struct major_list block_major_list =
-{SPIN_LOCK_UNLOCKED,
-    {INITIALISER64 (0xfffffb8f, 0xffffffff),  /*  Majors 0-31,    32-63    */
-     INITIALISER64 (0xfffffffe, 0xff03ffef),  /*  Majors 64-95,   96-127   */
-     INITIALISER64 (0x00000000, 0x00000000),  /*  Majors 128-159, 160-191  */
-     INITIALISER64 (0x00000280, 0xffff0000),  /*  Majors 192-223, 224-255  */
-    }
-};
-
-/*  Char majors already assigned:
-    0-7, 9-151, 154-158, 160-211, 216-221, 224-230, 240-255
-    Total free: 19
-*/
-static struct major_list char_major_list =
-{SPIN_LOCK_UNLOCKED,
-    {INITIALISER64 (0xfffffeff, 0xffffffff),  /*  Majors 0-31,    32-63    */
-     INITIALISER64 (0xffffffff, 0xffffffff),  /*  Majors 64-95,   96-127   */
-     INITIALISER64 (0x7cffffff, 0xffffffff),  /*  Majors 128-159, 160-191  */
-     INITIALISER64 (0x3f0fffff, 0xffff007f),  /*  Majors 192-223, 224-255  */
-    }
-};
-
-
-/**
- *	devfs_alloc_major - Allocate a major number.
- *	@mode: The file mode (must be block device or character device).
- *	Returns the allocated major, else -1 if none are available.
- *	This routine is thread safe and does not block.
- */
-
-
-struct minor_list
-{
-    int major;
-    unsigned long bits[256 / BITS_PER_LONG];
-    struct minor_list *next;
-};
-
-static struct device_list {
-	struct minor_list	*first;
-	struct minor_list	*last;
-	int			none_free;
-} block_list, char_list;
-
-static DECLARE_MUTEX(device_list_mutex);
-
-
-/**
- *	devfs_alloc_devnum - Allocate a device number.
- *	@mode: The file mode (must be block device or character device).
- *
- *	Returns the allocated device number, else NODEV if none are available.
- *	This routine is thread safe and may block.
- */
-
-dev_t devfs_alloc_devnum(umode_t mode)
-{
-	struct device_list *list;
-	struct major_list *major_list;
-	struct minor_list *entry;
-	int minor;
-
-	if (S_ISCHR(mode)) {
-		major_list = &char_major_list;
-		list = &char_list;
-	} else {
-		major_list = &block_major_list;
-		list = &block_list;
-	}
-
-	down(&device_list_mutex);
-	if (list->none_free)
-		goto out_unlock;
-
-	for (entry = list->first; entry; entry = entry->next) {
-		minor = find_first_zero_bit (entry->bits, 256);
-		if (minor >= 256)
-			continue;
-		goto out_done;
-	}
-	
-	/*  Need to allocate a new major  */
-	entry = kmalloc (sizeof *entry, GFP_KERNEL);
-	if (!entry)
-		goto out_full;
-	memset(entry, 0, sizeof *entry);
-
-	spin_lock(&major_list->lock);
-	entry->major = find_first_zero_bit(major_list->bits, 256);
-	if (entry->major >= 256) {
-		spin_unlock(&major_list->lock);
-		kfree(entry);
-		goto out_full;
-	}
-	__set_bit(entry->major, major_list->bits);
-	spin_unlock(&major_list->lock);
-
-	if (!list->first)
-		list->first = entry;
-	else
-		list->last->next = entry;
-	list->last = entry;
-
-	minor = 0;
- out_done:
-	__set_bit(minor, entry->bits);
-	up(&device_list_mutex);
-	return MKDEV(entry->major, minor);
- out_full:
-	list->none_free = 1;
- out_unlock:
-	up(&device_list_mutex);
-	return 0;
-}
-
-
-/**
- *	devfs_dealloc_devnum - Dellocate a device number.
- *	@mode: The file mode (must be block device or character device).
- *	@devnum: The device number.
- *
- *	This routine is thread safe and may block.
- */
-
-void devfs_dealloc_devnum(umode_t mode, dev_t devnum)
-{
-	struct device_list *list = S_ISCHR(mode) ? &char_list : &block_list;
-	struct minor_list *entry;
-
-	if (!devnum)
-		return;
-
-	down(&device_list_mutex);
-	for (entry = list->first; entry; entry = entry->next) {
-		if (entry->major == MAJOR(devnum)) {
-			if (__test_and_clear_bit(MINOR(devnum), entry->bits))
-				list->none_free = 0;
-			break;
-		}
-	}
-	up(&device_list_mutex);
-}
--- diff/fs/direct-io.c	2004-01-19 10:22:59.000000000 +0000
+++ source/fs/direct-io.c	2004-02-09 10:39:55.000000000 +0000
@@ -52,6 +52,10 @@
  *
  * If blkfactor is zero then the user's request was aligned to the filesystem's
  * blocksize.
+ *
+ * needs_locking is set for regular files on direct-IO-naive filesystems.  It
+ * determines whether we need to do the fancy locking which prevents direct-IO
+ * from being able to read uninitialised disk blocks.
  */
 
 struct dio {
@@ -59,6 +63,7 @@
 	struct bio *bio;		/* bio under assembly */
 	struct inode *inode;
 	int rw;
+	int needs_locking;		/* doesn't change */
 	unsigned blkbits;		/* doesn't change */
 	unsigned blkfactor;		/* When we're using an alignment which
 					   is finer than the filesystem's soft
@@ -69,6 +74,7 @@
 					   been performed at the start of a
 					   write */
 	int pages_in_io;		/* approximate total IO pages */
+	size_t	size;			/* total request size (doesn't change)*/
 	sector_t block_in_file;		/* Current offset into the underlying
 					   file in dio_block units. */
 	unsigned blocks_available;	/* At block_in_file.  changes */
@@ -110,9 +116,9 @@
 	int page_errors;		/* errno from get_user_pages() */
 
 	/* BIO completion state */
-	atomic_t bio_count;		/* nr bios to be completed */
-	atomic_t bios_in_flight;	/* nr bios in flight */
-	spinlock_t bio_list_lock;	/* protects bio_list */
+	spinlock_t bio_lock;		/* protects BIO fields below */
+	int bio_count;			/* nr bios to be completed */
+	int bios_in_flight;		/* nr bios in flight */
 	struct bio *bio_list;		/* singly linked via bi_private */
 	struct task_struct *waiter;	/* waiting task (NULL if none) */
 
@@ -204,8 +210,10 @@
  */
 static void dio_complete(struct dio *dio, loff_t offset, ssize_t bytes)
 {
-	if (dio->end_io)
+	if (dio->end_io && dio->result)
 		dio->end_io(dio->inode, offset, bytes, dio->map_bh.b_private);
+	if (dio->needs_locking)
+		up_read(&dio->inode->i_alloc_sem);
 }
 
 /*
@@ -214,14 +222,38 @@
  */
 static void finished_one_bio(struct dio *dio)
 {
-	if (atomic_dec_and_test(&dio->bio_count)) {
+	unsigned long flags;
+
+	spin_lock_irqsave(&dio->bio_lock, flags);
+	if (dio->bio_count == 1) {
 		if (dio->is_async) {
+			/*
+			 * Last reference to the dio is going away.
+			 * Drop spinlock and complete the DIO.
+			 */
+			spin_unlock_irqrestore(&dio->bio_lock, flags);
 			dio_complete(dio, dio->block_in_file << dio->blkbits,
 					dio->result);
-			aio_complete(dio->iocb, dio->result, 0);
-			kfree(dio);
+			/* Complete AIO later if falling back to buffered i/o */
+			if (dio->result == dio->size || dio->rw == READ) {
+				aio_complete(dio->iocb, dio->result, 0);
+				kfree(dio);
+				return;
+			} else {
+				/*
+				 * Falling back to buffered
+				 */
+				spin_lock_irqsave(&dio->bio_lock, flags);
+				dio->bio_count--;
+				if (dio->waiter)
+					wake_up_process(dio->waiter);
+				spin_unlock_irqrestore(&dio->bio_lock, flags);
+				return;
+			}
 		}
 	}
+	dio->bio_count--;
+	spin_unlock_irqrestore(&dio->bio_lock, flags);
 }
 
 static int dio_bio_complete(struct dio *dio, struct bio *bio);
@@ -255,13 +287,13 @@
 	if (bio->bi_size)
 		return 1;
 
-	spin_lock_irqsave(&dio->bio_list_lock, flags);
+	spin_lock_irqsave(&dio->bio_lock, flags);
 	bio->bi_private = dio->bio_list;
 	dio->bio_list = bio;
-	atomic_dec(&dio->bios_in_flight);
-	if (dio->waiter && atomic_read(&dio->bios_in_flight) == 0)
+	dio->bios_in_flight--;
+	if (dio->waiter && dio->bios_in_flight == 0)
 		wake_up_process(dio->waiter);
-	spin_unlock_irqrestore(&dio->bio_list_lock, flags);
+	spin_unlock_irqrestore(&dio->bio_lock, flags);
 	return 0;
 }
 
@@ -294,10 +326,13 @@
 static void dio_bio_submit(struct dio *dio)
 {
 	struct bio *bio = dio->bio;
+	unsigned long flags;
 
 	bio->bi_private = dio;
-	atomic_inc(&dio->bio_count);
-	atomic_inc(&dio->bios_in_flight);
+	spin_lock_irqsave(&dio->bio_lock, flags);
+	dio->bio_count++;
+	dio->bios_in_flight++;
+	spin_unlock_irqrestore(&dio->bio_lock, flags);
 	if (dio->is_async && dio->rw == READ)
 		bio_set_pages_dirty(bio);
 	submit_bio(dio->rw, bio);
@@ -323,22 +358,22 @@
 	unsigned long flags;
 	struct bio *bio;
 
-	spin_lock_irqsave(&dio->bio_list_lock, flags);
+	spin_lock_irqsave(&dio->bio_lock, flags);
 	while (dio->bio_list == NULL) {
 		set_current_state(TASK_UNINTERRUPTIBLE);
 		if (dio->bio_list == NULL) {
 			dio->waiter = current;
-			spin_unlock_irqrestore(&dio->bio_list_lock, flags);
+			spin_unlock_irqrestore(&dio->bio_lock, flags);
 			blk_run_queues();
 			io_schedule();
-			spin_lock_irqsave(&dio->bio_list_lock, flags);
+			spin_lock_irqsave(&dio->bio_lock, flags);
 			dio->waiter = NULL;
 		}
 		set_current_state(TASK_RUNNING);
 	}
 	bio = dio->bio_list;
 	dio->bio_list = bio->bi_private;
-	spin_unlock_irqrestore(&dio->bio_list_lock, flags);
+	spin_unlock_irqrestore(&dio->bio_lock, flags);
 	return bio;
 }
 
@@ -380,7 +415,12 @@
 	if (dio->bio)
 		dio_bio_submit(dio);
 
-	while (atomic_read(&dio->bio_count)) {
+	/*
+	 * The bio_lock is not held for the read of bio_count.
+	 * This is ok since it is the dio_bio_complete() that changes
+	 * bio_count.
+	 */
+	while (dio->bio_count) {
 		struct bio *bio = dio_await_one(dio);
 		int ret2;
 
@@ -407,10 +447,10 @@
 			unsigned long flags;
 			struct bio *bio;
 
-			spin_lock_irqsave(&dio->bio_list_lock, flags);
+			spin_lock_irqsave(&dio->bio_lock, flags);
 			bio = dio->bio_list;
 			dio->bio_list = bio->bi_private;
-			spin_unlock_irqrestore(&dio->bio_list_lock, flags);
+			spin_unlock_irqrestore(&dio->bio_lock, flags);
 			ret = dio_bio_complete(dio, bio);
 		}
 		dio->reap_counter = 0;
@@ -449,6 +489,7 @@
 	unsigned long fs_count;	/* Number of filesystem-sized blocks */
 	unsigned long dio_count;/* Number of dio_block-sized blocks */
 	unsigned long blkmask;
+	int beyond_eof = 0;
 
 	/*
 	 * If there was a memory error and we've overwritten all the
@@ -466,8 +507,19 @@
 		if (dio_count & blkmask)	
 			fs_count++;
 
+		if (dio->needs_locking) {
+			if (dio->block_in_file >= (i_size_read(dio->inode) >>
+							dio->blkbits))
+				beyond_eof = 1;
+		}
+		/*
+		 * For writes inside i_size we forbid block creations: only
+		 * overwrites are permitted.  We fall back to buffered writes
+		 * at a higher level for inside-i_size block-instantiating
+		 * writes.
+		 */
 		ret = (*dio->get_blocks)(dio->inode, fs_startblk, fs_count,
-				map_bh, dio->rw == WRITE);
+				map_bh, (dio->rw == WRITE) && beyond_eof);
 	}
 	return ret;
 }
@@ -774,6 +826,10 @@
 			if (!buffer_mapped(map_bh)) {
 				char *kaddr;
 
+				/* AKPM: eargh, -ENOTBLK is a hack */
+				if (dio->rw == WRITE)
+					return -ENOTBLK;
+
 				if (dio->block_in_file >=
 					i_size_read(dio->inode)>>blkbits) {
 					/* We hit eof */
@@ -839,32 +895,30 @@
 	return ret;
 }
 
+/*
+ * Releases both i_sem and i_alloc_sem
+ */
 static int
 direct_io_worker(int rw, struct kiocb *iocb, struct inode *inode, 
 	const struct iovec *iov, loff_t offset, unsigned long nr_segs, 
-	unsigned blkbits, get_blocks_t get_blocks, dio_iodone_t end_io)
+	unsigned blkbits, get_blocks_t get_blocks, dio_iodone_t end_io,
+	struct dio *dio)
 {
 	unsigned long user_addr; 
 	int seg;
 	int ret = 0;
 	int ret2;
-	struct dio *dio;
 	size_t bytes;
 
-	dio = kmalloc(sizeof(*dio), GFP_KERNEL);
-	if (!dio)
-		return -ENOMEM;
-	dio->is_async = !is_sync_kiocb(iocb);
-
 	dio->bio = NULL;
 	dio->inode = inode;
 	dio->rw = rw;
 	dio->blkbits = blkbits;
 	dio->blkfactor = inode->i_blkbits - blkbits;
 	dio->start_zero_done = 0;
+	dio->size = 0;
 	dio->block_in_file = offset >> blkbits;
 	dio->blocks_available = 0;
-
 	dio->cur_page = NULL;
 
 	dio->boundary = 0;
@@ -887,9 +941,9 @@
 	 * (or synchronous) device could take the count to zero while we're
 	 * still submitting BIOs.
 	 */
-	atomic_set(&dio->bio_count, 1);
-	atomic_set(&dio->bios_in_flight, 0);
-	spin_lock_init(&dio->bio_list_lock);
+	dio->bio_count = 1;
+	dio->bios_in_flight = 0;
+	spin_lock_init(&dio->bio_lock);
 	dio->bio_list = NULL;
 	dio->waiter = NULL;
 
@@ -899,7 +953,7 @@
 
 	for (seg = 0; seg < nr_segs; seg++) {
 		user_addr = (unsigned long)iov[seg].iov_base;
-		bytes = iov[seg].iov_len;
+		dio->size += bytes = iov[seg].iov_len;
 
 		/* Index into the first page of the first block */
 		dio->first_block_in_page = (user_addr & ~PAGE_MASK) >> blkbits;
@@ -930,6 +984,13 @@
 		}
 	} /* end iovec loop */
 
+	if (ret == -ENOTBLK && rw == WRITE) {
+		/*
+		 * The remaining part of the request will be
+		 * be handled by buffered I/O when we return
+		 */
+		ret = 0;
+	}
 	/*
 	 * There may be some unwritten disk at the end of a part-written
 	 * fs-block-sized block.  Go zero that now.
@@ -953,14 +1014,48 @@
 	dio_cleanup(dio);
 
 	/*
+	 * All block lookups have been performed. For READ requests
+	 * we can let i_sem go now that its achieved its purpose
+	 * of protecting us from looking up uninitialized blocks.
+	 */
+	if ((rw == READ) && dio->needs_locking)
+		up(&dio->inode->i_sem);
+
+	/*
 	 * OK, all BIOs are submitted, so we can decrement bio_count to truly
 	 * reflect the number of to-be-processed BIOs.
 	 */
 	if (dio->is_async) {
+		int should_wait = 0;
+
+		if (dio->result < dio->size && rw == WRITE) {
+			dio->waiter = current;
+			should_wait = 1;
+		}
 		if (ret == 0)
-			ret = dio->result;	/* Bytes written */
+			ret = dio->result;
 		finished_one_bio(dio);		/* This can free the dio */
 		blk_run_queues();
+		if (should_wait) {
+			unsigned long flags;
+			/*
+			 * Wait for already issued I/O to drain out and
+			 * release its references to user-space pages
+			 * before returning to fallback on buffered I/O
+			 */
+
+			spin_lock_irqsave(&dio->bio_lock, flags);
+			set_current_state(TASK_UNINTERRUPTIBLE);
+			while (dio->bio_count) {
+				spin_unlock_irqrestore(&dio->bio_lock, flags);
+				io_schedule();
+				spin_lock_irqsave(&dio->bio_lock, flags);
+				set_current_state(TASK_UNINTERRUPTIBLE);
+			}
+			spin_unlock_irqrestore(&dio->bio_lock, flags);
+			set_current_state(TASK_RUNNING);
+			kfree(dio);
+		}
 	} else {
 		finished_one_bio(dio);
 		ret2 = dio_await_completion(dio);
@@ -980,6 +1075,10 @@
 				ret = i_size - offset;
 		}
 		dio_complete(dio, offset, ret);
+		/* We could have also come here on an AIO file extend */
+		if (!is_sync_kiocb(iocb) && !(rw == WRITE && ret >= 0 &&
+			dio->result < dio->size))
+			aio_complete(iocb, ret, 0);
 		kfree(dio);
 	}
 	return ret;
@@ -987,11 +1086,17 @@
 
 /*
  * This is a library function for use by filesystem drivers.
+ *
+ * For writes to S_ISREG files, we are called under i_sem and return with i_sem
+ * held, even though it is internally dropped.
+ *
+ * For writes to S_ISBLK files, i_sem is not held on entry; it is never taken.
  */
 int
-blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode, 
+__blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode,
 	struct block_device *bdev, const struct iovec *iov, loff_t offset, 
-	unsigned long nr_segs, get_blocks_t get_blocks, dio_iodone_t end_io)
+	unsigned long nr_segs, get_blocks_t get_blocks, dio_iodone_t end_io,
+	int needs_special_locking)
 {
 	int seg;
 	size_t size;
@@ -1000,6 +1105,9 @@
 	unsigned bdev_blkbits = 0;
 	unsigned blocksize_mask = (1 << blkbits) - 1;
 	ssize_t retval = -EINVAL;
+	loff_t end = offset;
+	struct dio *dio;
+	int needs_locking;
 
 	if (bdev)
 		bdev_blkbits = blksize_bits(bdev_hardsect_size(bdev));
@@ -1016,6 +1124,7 @@
 	for (seg = 0; seg < nr_segs; seg++) {
 		addr = (unsigned long)iov[seg].iov_base;
 		size = iov[seg].iov_len;
+		end += size;
 		if ((addr & blocksize_mask) || (size & blocksize_mask))  {
 			if (bdev)
 				 blkbits = bdev_blkbits;
@@ -1025,10 +1134,46 @@
 		}
 	}
 
-	retval = direct_io_worker(rw, iocb, inode, iov, offset, 
-				nr_segs, blkbits, get_blocks, end_io);
+	dio = kmalloc(sizeof(*dio), GFP_KERNEL);
+	retval = -ENOMEM;
+	if (!dio)
+		goto out;
+
+	/*
+	 * For regular files,
+	 *	readers need to grab i_sem and i_alloc_sem
+	 *	writers need to grab i_alloc_sem only (i_sem is already held)
+	 */
+	needs_locking = 0;
+	if (S_ISREG(inode->i_mode) && needs_special_locking) {
+		needs_locking = 1;
+		if (rw == READ) {
+			struct address_space *mapping;
+
+			mapping = iocb->ki_filp->f_mapping;
+			down(&inode->i_sem);
+			retval = filemap_write_and_wait(mapping);
+			if (retval) {
+				up(&inode->i_sem);
+				kfree(dio);
+				goto out;
+			}
+		}
+		down_read(&inode->i_alloc_sem);
+	}
+	dio->needs_locking = needs_locking;
+	/*
+	 * For file extending writes updating i_size before data
+	 * writeouts complete can expose uninitialized blocks. So
+	 * even for AIO, we need to wait for i/o to complete before
+	 * returning in this case.
+	 */
+	dio->is_async = !is_sync_kiocb(iocb) && !((rw == WRITE) &&
+		(end > i_size_read(inode)));
+
+	retval = direct_io_worker(rw, iocb, inode, iov, offset,
+				nr_segs, blkbits, get_blocks, end_io, dio);
 out:
 	return retval;
 }
-
-EXPORT_SYMBOL(blockdev_direct_IO);
+EXPORT_SYMBOL(__blockdev_direct_IO);
--- diff/fs/exec.c	2004-02-09 10:36:12.000000000 +0000
+++ source/fs/exec.c	2004-02-09 10:39:55.000000000 +0000
@@ -832,7 +832,8 @@
 	flush_thread();
 
 	if (bprm->e_uid != current->euid || bprm->e_gid != current->egid || 
-	    permission(bprm->file->f_dentry->d_inode,MAY_READ, NULL))
+	    permission(bprm->file->f_dentry->d_inode,MAY_READ, NULL) ||
+	    (bprm->interp_flags & BINPRM_FLAGS_ENFORCE_NONDUMP))
 		current->mm->dumpable = 0;
 
 	/* An exec changes our domain. We are no longer part of the thread
@@ -1105,6 +1106,7 @@
 	bprm.file = file;
 	bprm.filename = filename;
 	bprm.interp = filename;
+	bprm.interp_flags = 0;
 	bprm.sh_bang = 0;
 	bprm.loader = 0;
 	bprm.exec = 0;
@@ -1386,7 +1388,7 @@
 		goto fail_unlock;
 
  	format_corename(corename, core_pattern, signr);
-	file = filp_open(corename, O_CREAT | 2 | O_NOFOLLOW, 0600);
+	file = filp_open(corename, O_CREAT | 2 | O_NOFOLLOW | O_LARGEFILE, 0600);
 	if (IS_ERR(file))
 		goto fail_unlock;
 	inode = file->f_dentry->d_inode;
--- diff/fs/ext2/acl.c	2003-10-27 09:20:38.000000000 +0000
+++ source/fs/ext2/acl.c	2004-02-09 10:39:55.000000000 +0000
@@ -322,7 +322,8 @@
 
 check_capabilities:
 	/* Allowed to override Discretionary Access Control? */
-	if ((mask & (MAY_READ|MAY_WRITE)) || (inode->i_mode & S_IXUGO))
+	if (!(mask & MAY_EXEC) ||
+	    (inode->i_mode & S_IXUGO) || S_ISDIR(inode->i_mode))
 		if (capable(CAP_DAC_OVERRIDE))
 			return 0;
 	/* Read and search granted if capable(CAP_DAC_READ_SEARCH) */
--- diff/fs/ext2/xattr.c	2003-11-25 15:24:59.000000000 +0000
+++ source/fs/ext2/xattr.c	2004-02-09 10:39:55.000000000 +0000
@@ -741,25 +741,24 @@
 	if (header) {
 		new_bh = ext2_xattr_cache_find(inode, header);
 		if (new_bh) {
-			/*
-			 * We found an identical block in the cache. The
-			 * block returned is locked. The old block will
-			 * be released after updating the inode.
-			 */
-			ea_bdebug(new_bh, "%s block %lu",
-				(old_bh == new_bh) ? "keeping" : "reusing",
-				(unsigned long) new_bh->b_blocknr);
-			
-			error = -EDQUOT;
-			if (DQUOT_ALLOC_BLOCK(inode, 1)) {
-				unlock_buffer(new_bh);
-				goto cleanup;
+			/* We found an identical block in the cache. */
+			if (new_bh == old_bh) {
+				ea_bdebug(new_bh, "keeping this block");
+			} else {
+				/* The old block is released after updating
+				   the inode.  */
+				ea_bdebug(new_bh, "reusing block");
+
+				error = -EDQUOT;
+				if (DQUOT_ALLOC_BLOCK(inode, 1)) {
+					unlock_buffer(new_bh);
+					goto cleanup;
+				}
+				HDR(new_bh)->h_refcount = cpu_to_le32(1 +
+					le32_to_cpu(HDR(new_bh)->h_refcount));
+				ea_bdebug(new_bh, "refcount now=%d",
+					le32_to_cpu(HDR(new_bh)->h_refcount));
 			}
-			
-			HDR(new_bh)->h_refcount = cpu_to_le32(
-				le32_to_cpu(HDR(new_bh)->h_refcount) + 1);
-			ea_bdebug(new_bh, "refcount now=%d",
-				le32_to_cpu(HDR(new_bh)->h_refcount));
 			unlock_buffer(new_bh);
 		} else if (old_bh && header == HDR(old_bh)) {
 			/* Keep this block. No need to lock the block as we
--- diff/fs/ext3/acl.c	2003-10-27 09:20:38.000000000 +0000
+++ source/fs/ext3/acl.c	2004-02-09 10:39:55.000000000 +0000
@@ -327,7 +327,8 @@
 
 check_capabilities:
 	/* Allowed to override Discretionary Access Control? */
-	if ((mask & (MAY_READ|MAY_WRITE)) || (inode->i_mode & S_IXUGO))
+	if (!(mask & MAY_EXEC) ||
+	    (inode->i_mode & S_IXUGO) || S_ISDIR(inode->i_mode))
 		if (capable(CAP_DAC_OVERRIDE))
 			return 0;
 	/* Read and search granted if capable(CAP_DAC_READ_SEARCH) */
--- diff/fs/ext3/namei.c	2003-09-30 15:46:18.000000000 +0100
+++ source/fs/ext3/namei.c	2004-02-09 10:39:55.000000000 +0000
@@ -1311,7 +1311,7 @@
 	memcpy (data1, de, len);
 	de = (struct ext3_dir_entry_2 *) data1;
 	top = data1 + len;
-	while (((char *) de2=(char*)de+le16_to_cpu(de->rec_len)) < top)
+	while ((char *)(de2=(void*)de+le16_to_cpu(de->rec_len)) < top)
 		de = de2;
 	de->rec_len = cpu_to_le16(data1 + blocksize - (char *) de);
 	/* Initialize the root; the dot dirents already exist */
--- diff/fs/ext3/xattr.c	2003-11-25 15:24:59.000000000 +0000
+++ source/fs/ext3/xattr.c	2004-02-09 10:39:56.000000000 +0000
@@ -753,25 +753,26 @@
 	if (header) {
 		new_bh = ext3_xattr_cache_find(handle, inode, header, &credits);
 		if (new_bh) {
-			/*
-			 * We found an identical block in the cache. The
-			 * block returned is locked. The old block will
-			 * be released after updating the inode.
-			 */
-			ea_bdebug(new_bh, "%s block %lu",
-				(old_bh == new_bh) ? "keeping" : "reusing",
-				(unsigned long) new_bh->b_blocknr);
-
-			error = -EDQUOT;
-			if (DQUOT_ALLOC_BLOCK(inode, 1)) {
-				unlock_buffer(new_bh);
-				journal_release_buffer(handle, new_bh, credits);
-				goto cleanup;
+			/* We found an identical block in the cache. */
+			if (new_bh == old_bh)
+				ea_bdebug(new_bh, "keeping this block");
+			else {
+				/* The old block is released after updating
+				   the inode. */
+				ea_bdebug(new_bh, "reusing block");
+
+				error = -EDQUOT;
+				if (DQUOT_ALLOC_BLOCK(inode, 1)) {
+					unlock_buffer(new_bh);
+					journal_release_buffer(handle, new_bh,
+							       credits);
+					goto cleanup;
+				}
+				HDR(new_bh)->h_refcount = cpu_to_le32(1 +
+					le32_to_cpu(HDR(new_bh)->h_refcount));
+				ea_bdebug(new_bh, "refcount now=%d",
+					le32_to_cpu(HDR(new_bh)->h_refcount));
 			}
-			HDR(new_bh)->h_refcount = cpu_to_le32(
-				le32_to_cpu(HDR(new_bh)->h_refcount) + 1);
-			ea_bdebug(new_bh, "refcount now=%d",
-				le32_to_cpu(HDR(new_bh)->h_refcount));
 			unlock_buffer(new_bh);
 		} else if (old_bh && header == HDR(old_bh)) {
 			/* Keep this block. No need to lock the block as we
--- diff/fs/freevxfs/vxfs.h	2002-10-16 04:28:22.000000000 +0100
+++ source/fs/freevxfs/vxfs.h	2004-02-09 10:39:56.000000000 +0000
@@ -30,8 +30,6 @@
 #ifndef _VXFS_SUPER_H_
 #define _VXFS_SUPER_H_
 
-#ident "$Id: vxfs.h 1.12 2001/12/28 19:48:03 hch Exp $"
-
 /*
  * Veritas filesystem driver - superblock structure.
  *
--- diff/fs/freevxfs/vxfs_bmap.c	2002-10-16 04:29:06.000000000 +0100
+++ source/fs/freevxfs/vxfs_bmap.c	2004-02-09 10:39:56.000000000 +0000
@@ -27,8 +27,6 @@
  * SUCH DAMAGE.
  */
 
-#ident "$Id: vxfs_bmap.c,v 1.25 2002/01/02 23:36:55 hch Exp hch $"
-
 /*
  * Veritas filesystem driver - filesystem to disk block mapping.
  */
--- diff/fs/freevxfs/vxfs_dir.h	2002-10-16 04:28:22.000000000 +0100
+++ source/fs/freevxfs/vxfs_dir.h	2004-02-09 10:39:56.000000000 +0000
@@ -30,8 +30,6 @@
 #ifndef _VXFS_DIR_H_
 #define _VXFS_DIR_H_
 
-#ident "$Id: vxfs_dir.h,v 1.7 2001/05/21 15:48:26 hch Exp hch $"
-
 /*
  * Veritas filesystem driver - directory structure.
  *
--- diff/fs/freevxfs/vxfs_extern.h	2002-10-16 04:27:54.000000000 +0100
+++ source/fs/freevxfs/vxfs_extern.h	2004-02-09 10:39:56.000000000 +0000
@@ -30,8 +30,6 @@
 #ifndef _VXFS_EXTERN_H_
 #define _VXFS_EXTERN_H_
 
-#ident "$Id: vxfs_extern.h,v 1.22 2001/12/28 20:50:47 hch Exp hch $"
-
 /*
  * Veritas filesystem driver - external prototypes.
  *
@@ -72,7 +70,7 @@
 
 /* vxfs_subr.c */
 extern struct page *		vxfs_get_page(struct address_space *, u_long);
-extern __inline__ void		vxfs_put_page(struct page *);
+extern void			vxfs_put_page(struct page *);
 extern struct buffer_head *	vxfs_bread(struct inode *, int);
 
 #endif /* _VXFS_EXTERN_H_ */
--- diff/fs/freevxfs/vxfs_fshead.c	2003-02-13 11:46:54.000000000 +0000
+++ source/fs/freevxfs/vxfs_fshead.c	2004-02-09 10:39:56.000000000 +0000
@@ -27,8 +27,6 @@
  * SUCH DAMAGE.
  */
 
-#ident "$Id: vxfs_fshead.c,v 1.20 2002/01/02 22:02:12 hch Exp hch $"
-
 /*
  * Veritas filesystem driver - fileset header routines.
  */
--- diff/fs/freevxfs/vxfs_fshead.h	2002-10-16 04:29:01.000000000 +0100
+++ source/fs/freevxfs/vxfs_fshead.h	2004-02-09 10:39:56.000000000 +0000
@@ -30,8 +30,6 @@
 #ifndef _VXFS_FSHEAD_H_
 #define _VXFS_FSHEAD_H_
 
-#ident "$Id: vxfs_fshead.h,v 1.7 2001/05/23 17:27:39 hch Exp hch $"
-
 /*
  * Veritas filesystem driver - fileset header structures.
  *
--- diff/fs/freevxfs/vxfs_immed.c	2003-10-09 09:47:34.000000000 +0100
+++ source/fs/freevxfs/vxfs_immed.c	2004-02-09 10:39:56.000000000 +0000
@@ -27,8 +27,6 @@
  * SUCH DAMAGE.
  */
 
-#ident "$Id: vxfs_immed.c,v 1.10 2001/04/25 18:11:23 hch Exp hch $"
-
 /*
  * Veritas filesystem driver - support for 'immed' inodes.
  */
--- diff/fs/freevxfs/vxfs_inode.c	2003-09-17 12:28:11.000000000 +0100
+++ source/fs/freevxfs/vxfs_inode.c	2004-02-09 10:39:56.000000000 +0000
@@ -27,8 +27,6 @@
  * SUCH DAMAGE.
  */
 
-#ident "$Id: vxfs_inode.c,v 1.42 2002/01/02 23:51:36 hch Exp hch $"
-
 /*
  * Veritas filesystem driver - inode routines.
  */
--- diff/fs/freevxfs/vxfs_inode.h	2002-10-16 04:28:22.000000000 +0100
+++ source/fs/freevxfs/vxfs_inode.h	2004-02-09 10:39:56.000000000 +0000
@@ -30,8 +30,6 @@
 #ifndef _VXFS_INODE_H_
 #define _VXFS_INODE_H_
 
-#ident "$Id: vxfs_inode.h,v 1.15 2001/05/26 22:41:23 hch Exp hch $"
-
 /*
  * Veritas filesystem driver - inode structure.
  *
--- diff/fs/freevxfs/vxfs_lookup.c	2003-07-11 09:39:50.000000000 +0100
+++ source/fs/freevxfs/vxfs_lookup.c	2004-02-09 10:39:56.000000000 +0000
@@ -27,8 +27,6 @@
  * SUCH DAMAGE.
  */
 
-#ident "$Id: vxfs_lookup.c,v 1.21 2002/01/02 22:00:13 hch Exp hch $"
-
 /*
  * Veritas filesystem driver - lookup and other directory related code.
  */
--- diff/fs/freevxfs/vxfs_olt.c	2003-10-09 09:47:34.000000000 +0100
+++ source/fs/freevxfs/vxfs_olt.c	2004-02-09 10:39:56.000000000 +0000
@@ -27,8 +27,6 @@
  * SUCH DAMAGE.
  */
 
-#ident "$Id: vxfs_olt.c,v 1.10 2002/01/02 23:03:58 hch Exp hch $"
-
 /* 
  * Veritas filesystem driver - object location table support.
  */
--- diff/fs/freevxfs/vxfs_olt.h	2002-10-16 04:27:14.000000000 +0100
+++ source/fs/freevxfs/vxfs_olt.h	2004-02-09 10:39:56.000000000 +0000
@@ -30,8 +30,6 @@
 #ifndef _VXFS_OLT_H_
 #define _VXFS_OLT_H_
 
-#ident "$Id: vxfs_olt.h,v 1.5 2001/04/25 18:11:23 hch Exp hch $"
-
 /*
  * Veritas filesystem driver - Object Location Table data structures.
  *
--- diff/fs/freevxfs/vxfs_subr.c	2002-10-16 04:27:49.000000000 +0100
+++ source/fs/freevxfs/vxfs_subr.c	2004-02-09 10:39:56.000000000 +0000
@@ -27,8 +27,6 @@
  * SUCH DAMAGE.
  */
 
-#ident "$Id: vxfs_subr.c,v 1.8 2001/12/28 20:50:47 hch Exp hch $"
-
 /*
  * Veritas filesystem driver - shared subroutines.
  */
@@ -51,6 +49,12 @@
 	.sync_page =		block_sync_page,
 };
 
+inline void
+vxfs_put_page(struct page *pp)
+{
+	kunmap(pp);
+	page_cache_release(pp);
+}
 
 /**
  * vxfs_get_page - read a page into memory.
@@ -89,13 +93,6 @@
 	return ERR_PTR(-EIO);
 }
 
-__inline__ void
-vxfs_put_page(struct page *pp)
-{
-	kunmap(pp);
-	page_cache_release(pp);
-}
-
 /**
  * vxfs_bread - read buffer for a give inode,block tuple
  * @ip:		inode
--- diff/fs/freevxfs/vxfs_super.c	2004-02-09 10:36:12.000000000 +0000
+++ source/fs/freevxfs/vxfs_super.c	2004-02-09 10:39:56.000000000 +0000
@@ -27,8 +27,6 @@
  * SUCH DAMAGE.
  */
 
-#ident "$Id: vxfs_super.c,v 1.29 2002/01/02 22:02:12 hch Exp hch $"
-
 /*
  * Veritas filesystem driver - superblock related routines.
  */
--- diff/fs/fs-writeback.c	2004-02-09 10:36:12.000000000 +0000
+++ source/fs/fs-writeback.c	2004-02-09 10:39:56.000000000 +0000
@@ -90,9 +90,9 @@
 		if (!S_ISBLK(inode->i_mode)) {
 			if (hlist_unhashed(&inode->i_hash))
 				goto out;
-			if (inode->i_state & (I_FREEING|I_CLEAR))
-				goto out;
 		}
+		if (inode->i_state & (I_FREEING|I_CLEAR))
+			goto out;
 
 		/*
 		 * If the inode was already on s_dirty or s_io, don't
--- diff/fs/hfs/file_hdr.c	2003-10-09 09:47:34.000000000 +0100
+++ source/fs/hfs/file_hdr.c	2004-02-09 10:39:56.000000000 +0000
@@ -243,7 +243,8 @@
 	if (HFS_NEW(new)) {
 		memcpy(new, old, sizeof(*new));
 		for (lcv = 0; lcv < new->entries; ++lcv) {
-			(char *)(new->order[lcv]) += (char *)new - (char *)old;
+			new->order[lcv] = (struct hfs_hdr_descr *)
+			((char *)new->order[lcv] + ((char *)new - (char *)old));
 		}
 	}
 	return new;
--- diff/fs/hugetlbfs/inode.c	2004-02-09 10:36:12.000000000 +0000
+++ source/fs/hugetlbfs/inode.c	2004-02-09 10:39:56.000000000 +0000
@@ -194,6 +194,7 @@
 
 	hlist_del_init(&inode->i_hash);
 	list_del_init(&inode->i_list);
+	list_del_init(&inode->i_sb_list);
 	inode->i_state |= I_FREEING;
 	inodes_stat.nr_inodes--;
 	spin_unlock(&inode_lock);
@@ -236,6 +237,7 @@
 	hlist_del_init(&inode->i_hash);
 out_truncate:
 	list_del_init(&inode->i_list);
+	list_del_init(&inode->i_sb_list);
 	inode->i_state |= I_FREEING;
 	inodes_stat.nr_inodes--;
 	spin_unlock(&inode_lock);
@@ -425,7 +427,6 @@
 	}
 	inode = hugetlbfs_get_inode(dir->i_sb, current->fsuid, gid, mode, dev);
 	if (inode) {
-		dir->i_size += PSEUDO_DIRENT_SIZE;
 		dir->i_ctime = dir->i_mtime = CURRENT_TIME;
 		d_instantiate(dentry, inode);
 		dget(dentry);	/* Extra count - pin the dentry in core */
@@ -470,7 +471,6 @@
 		} else
 			iput(inode);
 	}
-	dir->i_size += PSEUDO_DIRENT_SIZE;
 	dir->i_ctime = dir->i_mtime = CURRENT_TIME;
 
 	return error;
@@ -502,65 +502,6 @@
 	return 0;
 }
 
-static int hugetlbfs_link(struct dentry *old_dentry,
-			struct inode *dir, struct dentry *dentry)
-{
-	struct inode *inode = old_dentry->d_inode;
-
-	dir->i_size += PSEUDO_DIRENT_SIZE;
-	inode->i_ctime = dir->i_ctime = dir->i_mtime = CURRENT_TIME;
-	inode->i_nlink++;
-	atomic_inc(&inode->i_count);
-	dget(dentry);
-	d_instantiate(dentry, inode);
-	return 0;
-}
-
-static int hugetlbfs_unlink(struct inode *dir, struct dentry *dentry)
-{
-	struct inode *inode = dentry->d_inode;
-
-	dir->i_size -= PSEUDO_DIRENT_SIZE;
-	inode->i_ctime = dir->i_ctime = dir->i_mtime = CURRENT_TIME;
-	inode->i_nlink--;
-	dput(dentry);
-	return 0;
-}
-
-static int hugetlbfs_rmdir(struct inode *dir, struct dentry *dentry)
-{
-	if (!simple_empty(dentry))
-		return -ENOTEMPTY;
-
-	dir->i_nlink--;
-	return hugetlbfs_unlink(dir, dentry);
-}
-
-static int hugetlbfs_rename(struct inode *old_dir, struct dentry *old_dentry,
-			struct inode *new_dir, struct dentry *new_dentry)
-{
-	struct inode *inode = old_dentry->d_inode;
-	int they_are_dirs = S_ISDIR(inode->i_mode);
-
-	if (!simple_empty(new_dentry))
-		return -ENOTEMPTY;
-
-	if (new_dentry->d_inode) {
-		hugetlbfs_unlink(new_dir, new_dentry);
-		if (they_are_dirs)
-			old_dir->i_nlink--;
-	} else if (they_are_dirs) {
-		old_dir->i_nlink--;
-		new_dir->i_nlink++;
-	}
-
-	old_dir->i_size -= PSEUDO_DIRENT_SIZE;
-	new_dir->i_size += PSEUDO_DIRENT_SIZE;
-	old_dir->i_ctime = old_dir->i_mtime = new_dir->i_ctime =
-		new_dir->i_mtime = inode->i_ctime = CURRENT_TIME;
-	return 0;
-}
-
 static void hugetlbfs_put_super(struct super_block *sb)
 {
 	struct hugetlbfs_sb_info *sbi = HUGETLBFS_SB(sb);
@@ -587,13 +528,13 @@
 static struct inode_operations hugetlbfs_dir_inode_operations = {
 	.create		= hugetlbfs_create,
 	.lookup		= simple_lookup,
-	.link		= hugetlbfs_link,
-	.unlink		= hugetlbfs_unlink,
+	.link		= simple_link,
+	.unlink		= simple_unlink,
 	.symlink	= hugetlbfs_symlink,
 	.mkdir		= hugetlbfs_mkdir,
-	.rmdir		= hugetlbfs_rmdir,
+	.rmdir		= simple_rmdir,
 	.mknod		= hugetlbfs_mknod,
-	.rename		= hugetlbfs_rename,
+	.rename		= simple_rename,
 	.setattr	= hugetlbfs_setattr,
 };
 
--- diff/fs/inode.c	2003-10-27 09:20:38.000000000 +0000
+++ source/fs/inode.c	2004-02-09 10:39:56.000000000 +0000
@@ -53,6 +53,7 @@
  */
 #define I_HASHBITS	i_hash_shift
 #define I_HASHMASK	i_hash_mask
+#define I_HASHMAX	(2*1024*1024UL)	/* max number of entries */
 
 static unsigned int i_hash_mask;
 static unsigned int i_hash_shift;
@@ -183,6 +184,7 @@
 	INIT_LIST_HEAD(&inode->i_dentry);
 	INIT_LIST_HEAD(&inode->i_devices);
 	sema_init(&inode->i_sem, 1);
+	init_rwsem(&inode->i_alloc_sem);
 	INIT_RADIX_TREE(&inode->i_data.page_tree, GFP_ATOMIC);
 	spin_lock_init(&inode->i_data.page_lock);
 	init_MUTEX(&inode->i_data.i_shared_sem);
@@ -285,7 +287,7 @@
 /*
  * Invalidate all inodes for a device.
  */
-static int invalidate_list(struct list_head *head, struct super_block * sb, struct list_head * dispose)
+static int invalidate_list(struct list_head *head, struct list_head *dispose)
 {
 	struct list_head *next;
 	int busy = 0, count = 0;
@@ -298,13 +300,12 @@
 		next = next->next;
 		if (tmp == head)
 			break;
-		inode = list_entry(tmp, struct inode, i_list);
-		if (inode->i_sb != sb)
-			continue;
+		inode = list_entry(tmp, struct inode, i_sb_list);
 		invalidate_inode_buffers(inode);
 		if (!atomic_read(&inode->i_count)) {
 			hlist_del_init(&inode->i_hash);
 			list_del(&inode->i_list);
+			list_del(&inode->i_sb_list);
 			list_add(&inode->i_list, dispose);
 			inode->i_state |= I_FREEING;
 			count++;
@@ -340,10 +341,7 @@
 
 	down(&iprune_sem);
 	spin_lock(&inode_lock);
-	busy = invalidate_list(&inode_in_use, sb, &throw_away);
-	busy |= invalidate_list(&inode_unused, sb, &throw_away);
-	busy |= invalidate_list(&sb->s_dirty, sb, &throw_away);
-	busy |= invalidate_list(&sb->s_io, sb, &throw_away);
+	busy = invalidate_list(&sb->s_inodes, &throw_away);
 	spin_unlock(&inode_lock);
 
 	dispose_list(&throw_away);
@@ -443,6 +441,7 @@
 				continue;
 		}
 		hlist_del_init(&inode->i_hash);
+		list_del_init(&inode->i_sb_list);
 		list_move(&inode->i_list, &freeable);
 		inode->i_state |= I_FREEING;
 		nr_pruned++;
@@ -553,6 +552,7 @@
 		spin_lock(&inode_lock);
 		inodes_stat.nr_inodes++;
 		list_add(&inode->i_list, &inode_in_use);
+		list_add(&inode->i_sb_list, &sb->s_inodes);
 		inode->i_ino = ++last_ino;
 		inode->i_state = 0;
 		spin_unlock(&inode_lock);
@@ -601,6 +601,7 @@
 
 			inodes_stat.nr_inodes++;
 			list_add(&inode->i_list, &inode_in_use);
+			list_add(&inode->i_sb_list, &sb->s_inodes);
 			hlist_add_head(&inode->i_hash, head);
 			inode->i_state = I_LOCK|I_NEW;
 			spin_unlock(&inode_lock);
@@ -649,6 +650,7 @@
 			inode->i_ino = ino;
 			inodes_stat.nr_inodes++;
 			list_add(&inode->i_list, &inode_in_use);
+			list_add(&inode->i_sb_list, &sb->s_inodes);
 			hlist_add_head(&inode->i_hash, head);
 			inode->i_state = I_LOCK|I_NEW;
 			spin_unlock(&inode_lock);
@@ -984,6 +986,7 @@
 	struct super_operations *op = inode->i_sb->s_op;
 
 	list_del_init(&inode->i_list);
+	list_del_init(&inode->i_sb_list);
 	inode->i_state|=I_FREEING;
 	inodes_stat.nr_inodes--;
 	spin_unlock(&inode_lock);
@@ -1031,6 +1034,7 @@
 		hlist_del_init(&inode->i_hash);
 	}
 	list_del_init(&inode->i_list);
+	list_del_init(&inode->i_sb_list);
 	inode->i_state|=I_FREEING;
 	inodes_stat.nr_inodes--;
 	spin_unlock(&inode_lock);
@@ -1178,6 +1182,8 @@
 	struct timespec now;
 	int sync_it = 0;
 
+	if (IS_NOCMTIME(inode))
+		return;
 	if (IS_RDONLY(inode))
 		return;
 
@@ -1221,34 +1227,17 @@
 void remove_dquot_ref(struct super_block *sb, int type)
 {
 	struct inode *inode;
-	struct list_head *act_head;
 	LIST_HEAD(tofree_head);
 
 	if (!sb->dq_op)
 		return;	/* nothing to do */
 	spin_lock(&inode_lock);	/* This lock is for inodes code */
 	/* We don't have to lock against quota code - test IS_QUOTAINIT is just for speedup... */
- 
-	list_for_each(act_head, &inode_in_use) {
-		inode = list_entry(act_head, struct inode, i_list);
-		if (inode->i_sb == sb && IS_QUOTAINIT(inode))
-			remove_inode_dquot_ref(inode, type, &tofree_head);
-	}
-	list_for_each(act_head, &inode_unused) {
-		inode = list_entry(act_head, struct inode, i_list);
-		if (inode->i_sb == sb && IS_QUOTAINIT(inode))
-			remove_inode_dquot_ref(inode, type, &tofree_head);
-	}
-	list_for_each(act_head, &sb->s_dirty) {
-		inode = list_entry(act_head, struct inode, i_list);
-		if (IS_QUOTAINIT(inode))
-			remove_inode_dquot_ref(inode, type, &tofree_head);
-	}
-	list_for_each(act_head, &sb->s_io) {
-		inode = list_entry(act_head, struct inode, i_list);
+
+	list_for_each_entry(inode, &sb->s_inodes, i_sb_list)
 		if (IS_QUOTAINIT(inode))
 			remove_inode_dquot_ref(inode, type, &tofree_head);
-	}
+
 	spin_unlock(&inode_lock);
 
 	put_dquot_list(&tofree_head);
@@ -1340,8 +1329,10 @@
 	for (i = 0; i < ARRAY_SIZE(i_wait_queue_heads); i++)
 		init_waitqueue_head(&i_wait_queue_heads[i].wqh);
 
-	mempages >>= (14 - PAGE_SHIFT);
-	mempages *= sizeof(struct hlist_head);
+	mempages = PAGE_SHIFT < 14 ?
+		   mempages >> (14 - PAGE_SHIFT) :
+		   mempages << (PAGE_SHIFT - 14);
+	mempages = min(I_HASHMAX, mempages) * sizeof(struct hlist_head);
 	for (order = 0; ((1UL << order) << PAGE_SHIFT) < mempages; order++)
 		;
 
--- diff/fs/intermezzo/cache.c	2003-10-09 09:47:34.000000000 +0100
+++ source/fs/intermezzo/cache.c	2004-02-09 10:39:56.000000000 +0000
@@ -74,6 +74,14 @@
         }
 }
 
+int izo_ioctl_packlen(struct izo_ioctl_data *data)
+{
+        int len = sizeof(struct izo_ioctl_data);
+        len += size_round(data->ioc_inllen1);
+        len += size_round(data->ioc_inllen2);
+        return len;
+}
+
 /* map a device to a cache */
 struct presto_cache *presto_cache_find(struct super_block *s)
 {
--- diff/fs/intermezzo/intermezzo_fs.h	2004-02-09 10:36:12.000000000 +0000
+++ source/fs/intermezzo/intermezzo_fs.h	2004-02-09 10:39:56.000000000 +0000
@@ -49,8 +49,6 @@
         struct presto_version remote_version;
 };
 
-static inline int izo_ioctl_is_invalid(struct izo_ioctl_data *data);
-
 #ifdef __KERNEL__
 # include <linux/smp.h>
 # include <linux/fsfilter.h>
@@ -335,7 +333,7 @@
 int presto_psdev_init(void);
 int izo_psdev_setpid(int minor);
 extern void presto_psdev_cleanup(void);
-inline int presto_lento_up(int minor);
+int presto_lento_up(int minor);
 int izo_psdev_setchannel(struct file *file, int fd);
 
 /* inode.c */
@@ -346,7 +344,7 @@
 void presto_frob_dop(struct dentry *de);
 char *presto_path(struct dentry *dentry, struct dentry *root,
                   char *buffer, int buflen);
-inline struct presto_dentry_data *izo_alloc_ddata(void);
+struct presto_dentry_data *izo_alloc_ddata(void);
 int presto_set_dd(struct dentry *);
 int presto_init_ddata_cache(void);
 void presto_cleanup_ddata_cache(void);
@@ -411,7 +409,7 @@
                        unsigned int flags);
 int presto_set_fsetroot_from_ioc(struct dentry *dentry, char *fsetname,
                                  unsigned int flags);
-inline int presto_is_read_only(struct presto_file_set *);
+int presto_is_read_only(struct presto_file_set *);
 int presto_truncate_lml(struct presto_file_set *fset);
 int lento_write_lml(char *path,
                      __u64 remote_ino,
@@ -419,13 +417,13 @@
                      __u32 remote_version,
                     struct presto_version *remote_file_version);
 int lento_complete_closes(char *path);
-inline int presto_f2m(struct presto_file_set *fset);
+int presto_f2m(struct presto_file_set *fset);
 int presto_prep(struct dentry *, struct presto_cache **,
                        struct presto_file_set **);
 /* cache.c */
 extern struct presto_cache *presto_cache_init(void);
-extern inline void presto_cache_add(struct presto_cache *cache);
-extern inline void presto_cache_init_hash(void);
+extern void presto_cache_add(struct presto_cache *cache);
+extern void presto_cache_init_hash(void);
 
 struct presto_cache *presto_cache_find(struct super_block *sb);
 
@@ -552,7 +550,7 @@
 
 #define JOURNAL_PAGE_SZ  PAGE_SIZE
 
-__inline__ int presto_no_journal(struct presto_file_set *fset);
+int presto_no_journal(struct presto_file_set *fset);
 int journal_fetch(int minor);
 int presto_log(struct presto_file_set *fset, struct rec_info *rec,
                const char *buf, size_t size,
@@ -657,6 +655,8 @@
 loff_t izo_rcvd_upd_remote(struct presto_file_set *fset, char * uuid,  __u64 remote_recno,
                            __u64 remote_offset);
 
+int izo_ioctl_packlen(struct izo_ioctl_data *data);
+
 /* sysctl.c */
 int init_intermezzo_sysctl(void);
 void cleanup_intermezzo_sysctl(void);
@@ -714,6 +714,54 @@
         return tmp;
 }
 
+static inline int izo_ioctl_is_invalid(struct izo_ioctl_data *data)
+{
+        if (data->ioc_len > (1<<30)) {
+                CERROR("IZO ioctl: ioc_len larger than 1<<30\n");
+                return 1;
+        }
+        if (data->ioc_inllen1 > (1<<30)) {
+                CERROR("IZO ioctl: ioc_inllen1 larger than 1<<30\n");
+                return 1;
+        }
+        if (data->ioc_inllen2 > (1<<30)) {
+                CERROR("IZO ioctl: ioc_inllen2 larger than 1<<30\n");
+                return 1;
+        }
+        if (data->ioc_inlbuf1 && !data->ioc_inllen1) {
+                CERROR("IZO ioctl: inlbuf1 pointer but 0 length\n");
+                return 1;
+        }
+        if (data->ioc_inlbuf2 && !data->ioc_inllen2) {
+                CERROR("IZO ioctl: inlbuf2 pointer but 0 length\n");
+                return 1;
+        }
+        if (data->ioc_pbuf1 && !data->ioc_plen1) {
+                CERROR("IZO ioctl: pbuf1 pointer but 0 length\n");
+                return 1;
+        }
+        if (data->ioc_pbuf2 && !data->ioc_plen2) {
+                CERROR("IZO ioctl: pbuf2 pointer but 0 length\n");
+                return 1;
+        }
+        if (izo_ioctl_packlen(data) != data->ioc_len ) {
+                CERROR("IZO ioctl: packlen exceeds ioc_len\n");
+                return 1;
+        }
+        if (data->ioc_inllen1 &&
+            data->ioc_bulk[data->ioc_inllen1 - 1] != '\0') {
+                CERROR("IZO ioctl: inlbuf1 not 0 terminated\n");
+                return 1;
+        }
+        if (data->ioc_inllen2 &&
+            data->ioc_bulk[size_round(data->ioc_inllen1) + data->ioc_inllen2
+                           - 1] != '\0') {
+                CERROR("IZO ioctl: inlbuf2 not 0 terminated\n");
+                return 1;
+        }
+        return 0;
+}
+
 /* buffer MUST be at least the size of izo_ioctl_hdr */
 static inline int izo_ioctl_getdata(char *buf, char *end, void *arg)
 {
@@ -797,8 +845,6 @@
 int kml_iocreint(__u32 size, char *ptr, __u32 offset, int dird,
                  uuid_t uuid, __u32 generate_kml);
 
-static inline int izo_ioctl_packlen(struct izo_ioctl_data *data);
-
 static inline void izo_ioctl_init(struct izo_ioctl_data *data)
 {
         memset(data, 0, sizeof(*data));
@@ -860,62 +906,6 @@
         return "Unknown InterMezzo error";
 }
 
-static inline int izo_ioctl_packlen(struct izo_ioctl_data *data)
-{
-        int len = sizeof(struct izo_ioctl_data);
-        len += size_round(data->ioc_inllen1);
-        len += size_round(data->ioc_inllen2);
-        return len;
-}
-
-static inline int izo_ioctl_is_invalid(struct izo_ioctl_data *data)
-{
-        if (data->ioc_len > (1<<30)) {
-                CERROR("IZO ioctl: ioc_len larger than 1<<30\n");
-                return 1;
-        }
-        if (data->ioc_inllen1 > (1<<30)) {
-                CERROR("IZO ioctl: ioc_inllen1 larger than 1<<30\n");
-                return 1;
-        }
-        if (data->ioc_inllen2 > (1<<30)) {
-                CERROR("IZO ioctl: ioc_inllen2 larger than 1<<30\n");
-                return 1;
-        }
-        if (data->ioc_inlbuf1 && !data->ioc_inllen1) {
-                CERROR("IZO ioctl: inlbuf1 pointer but 0 length\n");
-                return 1;
-        }
-        if (data->ioc_inlbuf2 && !data->ioc_inllen2) {
-                CERROR("IZO ioctl: inlbuf2 pointer but 0 length\n");
-                return 1;
-        }
-        if (data->ioc_pbuf1 && !data->ioc_plen1) {
-                CERROR("IZO ioctl: pbuf1 pointer but 0 length\n");
-                return 1;
-        }
-        if (data->ioc_pbuf2 && !data->ioc_plen2) {
-                CERROR("IZO ioctl: pbuf2 pointer but 0 length\n");
-                return 1;
-        }
-        if (izo_ioctl_packlen(data) != data->ioc_len ) {
-                CERROR("IZO ioctl: packlen exceeds ioc_len\n");
-                return 1;
-        }
-        if (data->ioc_inllen1 &&
-            data->ioc_bulk[data->ioc_inllen1 - 1] != '\0') {
-                CERROR("IZO ioctl: inlbuf1 not 0 terminated\n");
-                return 1;
-        }
-        if (data->ioc_inllen2 &&
-            data->ioc_bulk[size_round(data->ioc_inllen1) + data->ioc_inllen2
-                           - 1] != '\0') {
-                CERROR("IZO ioctl: inlbuf2 not 0 terminated\n");
-                return 1;
-        }
-        return 0;
-}
-
 /* kml_unpack.c */
 char *kml_print_rec(struct kml_rec *rec, int brief);
 int kml_unpack(struct kml_rec *rec, char **buf, char *end);
--- diff/fs/intermezzo/presto.c	2004-02-09 10:36:12.000000000 +0000
+++ source/fs/intermezzo/presto.c	2004-02-09 10:39:56.000000000 +0000
@@ -338,8 +338,8 @@
                 return -EBADF;
         }
 
-        ((int)cache->cache_flags) &= and_flag;
-        ((int)cache->cache_flags) |= or_flag;
+        cache->cache_flags &= and_flag;
+        cache->cache_flags |= or_flag;
         if (res)
                 *res = (int)cache->cache_flags;
 
@@ -377,8 +377,8 @@
                 make_bad_inode(dentry->d_inode);
                 return -EBADF;
         }
-        ((int)fset->fset_flags) &= and_flag;
-        ((int)fset->fset_flags) |= or_flag;
+        fset->fset_flags &= and_flag;
+        fset->fset_flags |= or_flag;
         if (res)
                 *res = (int)fset->fset_flags;
 
--- diff/fs/intermezzo/sysctl.c	2003-08-20 14:16:14.000000000 +0100
+++ source/fs/intermezzo/sysctl.c	2004-02-09 10:39:56.000000000 +0000
@@ -286,6 +286,8 @@
 	 * happens once per reboot.
 	 */
 	for(i = 0; i < total_dev; i++) {
+		void *p;
+
 		/* entry for this /proc/sys/intermezzo/intermezzo"i" */
 		ctl_table *psdev = &presto_table[i + PRESTO_PRIMARY_CTLCNT];
 		/* entries for the individual "files" in this "directory" */
@@ -298,7 +300,8 @@
 		/* the psdev has to point to psdev_entries, and fix the number */
 		psdev->ctl_name = psdev->ctl_name + i + 1; /* sorry */
 
-		PRESTO_ALLOC((void*)psdev->procname, PROCNAME_SIZE);
+		PRESTO_ALLOC(p, PROCNAME_SIZE);
+		psdev->procname = p;
 		if (!psdev->procname) {
 			PRESTO_FREE(dev_ctl_table,
 				    sizeof(ctl_table) * total_entries);
--- diff/fs/jfs/acl.c	2003-10-09 09:47:17.000000000 +0100
+++ source/fs/jfs/acl.c	2004-02-09 10:39:56.000000000 +0000
@@ -191,7 +191,8 @@
 	 * Read/write DACs are always overridable.
 	 * Executable DACs are overridable if at least one exec bit is set.
 	 */
-	if ((mask & (MAY_READ|MAY_WRITE)) || (inode->i_mode & S_IXUGO))
+	if (!(mask & MAY_EXEC) ||
+	    (inode->i_mode & S_IXUGO) || S_ISDIR(inode->i_mode))
 		if (capable(CAP_DAC_OVERRIDE))
 			return 0;
 
--- diff/fs/libfs.c	2004-02-09 10:36:12.000000000 +0000
+++ source/fs/libfs.c	2004-02-09 10:39:56.000000000 +0000
@@ -227,6 +227,7 @@
 {
 	struct inode *inode = old_dentry->d_inode;
 
+	inode->i_ctime = dir->i_ctime = dir->i_mtime = CURRENT_TIME;
 	inode->i_nlink++;
 	atomic_inc(&inode->i_count);
 	dget(dentry);
@@ -258,6 +259,7 @@
 {
 	struct inode *inode = dentry->d_inode;
 
+	inode->i_ctime = dir->i_ctime = dir->i_mtime = CURRENT_TIME;
 	inode->i_nlink--;
 	dput(dentry);
 	return 0;
@@ -277,6 +279,7 @@
 int simple_rename(struct inode *old_dir, struct dentry *old_dentry,
 		struct inode *new_dir, struct dentry *new_dentry)
 {
+	struct inode *inode = old_dentry->d_inode;
 	int they_are_dirs = S_ISDIR(old_dentry->d_inode->i_mode);
 
 	if (!simple_empty(new_dentry))
@@ -290,6 +293,10 @@
 		old_dir->i_nlink--;
 		new_dir->i_nlink++;
 	}
+
+	old_dir->i_ctime = old_dir->i_mtime = new_dir->i_ctime =
+		new_dir->i_mtime = inode->i_ctime = CURRENT_TIME;
+
 	return 0;
 }
 
--- diff/fs/namei.c	2003-10-09 09:47:34.000000000 +0100
+++ source/fs/namei.c	2004-02-09 10:39:56.000000000 +0000
@@ -190,7 +190,8 @@
 	 * Read/write DACs are always overridable.
 	 * Executable DACs are overridable if at least one exec bit is set.
 	 */
-	if ((mask & (MAY_READ|MAY_WRITE)) || (inode->i_mode & S_IXUGO))
+	if (!(mask & MAY_EXEC) ||
+	    (inode->i_mode & S_IXUGO) || S_ISDIR(inode->i_mode))
 		if (capable(CAP_DAC_OVERRIDE))
 			return 0;
 
@@ -420,15 +421,15 @@
 {
 	struct vfsmount *parent;
 	struct dentry *mountpoint;
-	spin_lock(&dcache_lock);
+	spin_lock(&vfsmount_lock);
 	parent=(*mnt)->mnt_parent;
 	if (parent == *mnt) {
-		spin_unlock(&dcache_lock);
+		spin_unlock(&vfsmount_lock);
 		return 0;
 	}
 	mntget(parent);
 	mountpoint=dget((*mnt)->mnt_mountpoint);
-	spin_unlock(&dcache_lock);
+	spin_unlock(&vfsmount_lock);
 	dput(*dentry);
 	*dentry = mountpoint;
 	mntput(*mnt);
@@ -446,9 +447,9 @@
 		struct vfsmount *mounted = lookup_mnt(*mnt, *dentry);
 		if (!mounted)
 			break;
+		mntput(*mnt);
 		*mnt = mounted;
 		dput(*dentry);
-		mntput(mounted->mnt_parent);
 		*dentry = dget(mounted->mnt_root);
 		res = 1;
 	}
@@ -464,9 +465,9 @@
 
 	mounted = lookup_mnt(*mnt, *dentry);
 	if (mounted) {
+		mntput(*mnt);
 		*mnt = mounted;
 		dput(*dentry);
-		mntput(mounted->mnt_parent);
 		*dentry = dget(mounted->mnt_root);
 		return 1;
 	}
@@ -498,14 +499,16 @@
 			dput(old);
 			break;
 		}
+		spin_unlock(&dcache_lock);
+		spin_lock(&vfsmount_lock);
 		parent = (*mnt)->mnt_parent;
 		if (parent == *mnt) {
-			spin_unlock(&dcache_lock);
+			spin_unlock(&vfsmount_lock);
 			break;
 		}
 		mntget(parent);
 		*dentry = dget((*mnt)->mnt_mountpoint);
-		spin_unlock(&dcache_lock);
+		spin_unlock(&vfsmount_lock);
 		dput(old);
 		mntput(*mnt);
 		*mnt = parent;
@@ -1258,7 +1261,6 @@
 		error = path_lookup(pathname, lookup_flags(flag)|LOOKUP_OPEN, nd);
 		if (error)
 			return error;
-		dentry = nd->dentry;
 		goto ok;
 	}
 
@@ -2241,13 +2243,17 @@
 
 	if (!page)
 		goto fail;
+	down(&inode->i_sem);
 	err = mapping->a_ops->prepare_write(NULL, page, 0, len-1);
-	if (err)
+	if (err) {
+		up(&inode->i_sem);
 		goto fail_map;
+	}
 	kaddr = kmap_atomic(page, KM_USER0);
 	memcpy(kaddr, symname, len-1);
 	kunmap_atomic(kaddr, KM_USER0);
 	mapping->a_ops->commit_write(NULL, page, 0, len-1);
+	up(&inode->i_sem);
 	/*
 	 * Notice that we are _not_ going to block here - end of page is
 	 * unmapped, so this will only try to map the rest of page, see
--- diff/fs/namespace.c	2003-10-09 09:47:34.000000000 +0100
+++ source/fs/namespace.c	2004-02-09 10:39:56.000000000 +0000
@@ -24,7 +24,15 @@
 #include <asm/uaccess.h>
 
 extern int __init init_rootfs(void);
+
+#ifdef CONFIG_SYSFS
 extern int __init sysfs_init(void);
+#else
+static inline int sysfs_init(void)
+{
+	return 0;
+}
+#endif
 
 /* spinlock for vfsmount related operations, inplace of dcache_lock */
 spinlock_t vfsmount_lock __cacheline_aligned_in_smp = SPIN_LOCK_UNLOCKED;
@@ -755,6 +763,9 @@
 	if (dev_name && !memchr(dev_name, 0, PAGE_SIZE))
 		return -EINVAL;
 
+	if (data_page)
+		((char *)data_page)[PAGE_SIZE - 1] = 0;
+
 	/* Separate the per-mountpoint flags */
 	if (flags & MS_NOSUID)
 		mnt_flags |= MNT_NOSUID;
@@ -814,12 +825,16 @@
 
 	atomic_set(&new_ns->count, 1);
 	init_rwsem(&new_ns->sem);
-	new_ns->root = NULL;
 	INIT_LIST_HEAD(&new_ns->list);
 
 	down_write(&tsk->namespace->sem);
 	/* First pass: copy the tree topology */
 	new_ns->root = copy_tree(namespace->root, namespace->root->mnt_root);
+	if (!new_ns->root) {
+		up_write(&tsk->namespace->sem);
+		kfree(new_ns);
+		goto out;
+	}
 	spin_lock(&vfsmount_lock);
 	list_add_tail(&new_ns->list, &new_ns->root->mnt_list);
 	spin_unlock(&vfsmount_lock);
--- diff/fs/ncpfs/dir.c	2003-09-30 15:46:18.000000000 +0100
+++ source/fs/ncpfs/dir.c	2004-02-09 10:39:56.000000000 +0000
@@ -270,8 +270,8 @@
 	struct dentry *parent;
 	struct inode *dir;
 	struct ncp_entry_info finfo;
-	int res, val = 0, len = dentry->d_name.len + 1;
-	__u8 __name[len];
+	int res, val = 0, len;
+	__u8 __name[NCP_MAXPATHLEN + 1];
 
 	parent = dget_parent(dentry);
 	dir = parent->d_inode;
@@ -298,14 +298,15 @@
 		dentry->d_parent->d_name.name, dentry->d_name.name,
 		NCP_GET_AGE(dentry));
 
+	len = sizeof(__name);
 	if (ncp_is_server_root(dir)) {
 		res = ncp_io2vol(server, __name, &len, dentry->d_name.name,
-						len-1, 1);
+				 dentry->d_name.len, 1);
 		if (!res)
 			res = ncp_lookup_volume(server, __name, &(finfo.i));
 	} else {
 		res = ncp_io2vol(server, __name, &len, dentry->d_name.name,
-						len-1, !ncp_preserve_case(dir));
+				 dentry->d_name.len, !ncp_preserve_case(dir));
 		if (!res)
 			res = ncp_obtain_info(server, dir, __name, &(finfo.i));
 	}
@@ -559,9 +560,9 @@
 	int valid = 0;
 	int hashed = 0;
 	ino_t ino = 0;
-	__u8 __name[256];
+	__u8 __name[NCP_MAXPATHLEN + 1];
 
-	qname.len = 256;
+	qname.len = sizeof(__name);
 	if (ncp_vol2io(NCP_SERVER(inode), __name, &qname.len,
 			entry->i.entryName, entry->i.nameLen,
 			!ncp_preserve_entry_case(inode, entry->i.NSCreator)))
@@ -762,16 +763,19 @@
 {
 	struct ncp_server* server = NCP_SBP(sb);
 	struct nw_info_struct i;
-	int result, len = strlen(server->m.mounted_vol) + 1;
-	__u8 __name[len];
+	int result;
 
 	if (ncp_single_volume(server)) {
+		int len;
 		struct dentry* dent;
+		__u8 __name[NCP_MAXPATHLEN + 1];
 
-		result = -ENOENT;
-		if (ncp_io2vol(server, __name, &len, server->m.mounted_vol,
-								len-1, 1))
+		len = sizeof(__name);
+		result = ncp_io2vol(server, __name, &len, server->m.mounted_vol,
+				    strlen(server->m.mounted_vol), 1);
+		if (result)
 			goto out;
+		result = -ENOENT;
 		if (ncp_lookup_volume(server, __name, &i)) {
 			PPRINTK("ncp_conn_logged_in: %s not found\n",
 				server->m.mounted_vol);
@@ -802,8 +806,8 @@
 	struct ncp_server *server = NCP_SERVER(dir);
 	struct inode *inode = NULL;
 	struct ncp_entry_info finfo;
-	int error, res, len = dentry->d_name.len + 1;
-	__u8 __name[len];
+	int error, res, len;
+	__u8 __name[NCP_MAXPATHLEN + 1];
 
 	lock_kernel();
 	error = -EIO;
@@ -813,14 +817,15 @@
 	PPRINTK("ncp_lookup: server lookup for %s/%s\n",
 		dentry->d_parent->d_name.name, dentry->d_name.name);
 
+	len = sizeof(__name);
 	if (ncp_is_server_root(dir)) {
 		res = ncp_io2vol(server, __name, &len, dentry->d_name.name,
-						len-1, 1);
+				 dentry->d_name.len, 1);
 		if (!res)
 			res = ncp_lookup_volume(server, __name, &(finfo.i));
 	} else {
 		res = ncp_io2vol(server, __name, &len, dentry->d_name.name,
-						len-1, !ncp_preserve_case(dir));
+				 dentry->d_name.len, !ncp_preserve_case(dir));
 		if (!res)
 			res = ncp_obtain_info(server, dir, __name, &(finfo.i));
 	}
@@ -885,20 +890,22 @@
 {
 	struct ncp_server *server = NCP_SERVER(dir);
 	struct ncp_entry_info finfo;
-	int error, result, len = dentry->d_name.len + 1;
+	int error, result, len;
 	int opmode;
-	__u8 __name[len];
+	__u8 __name[NCP_MAXPATHLEN + 1];
 	
 	PPRINTK("ncp_create_new: creating %s/%s, mode=%x\n",
 		dentry->d_parent->d_name.name, dentry->d_name.name, mode);
+
 	error = -EIO;
 	lock_kernel();
 	if (!ncp_conn_valid(server))
 		goto out;
 
 	ncp_age_dentry(server, dentry);
+	len = sizeof(__name);
 	error = ncp_io2vol(server, __name, &len, dentry->d_name.name,
-						len-1, !ncp_preserve_case(dir));
+			   dentry->d_name.len, !ncp_preserve_case(dir));
 	if (error)
 		goto out;
 
@@ -952,19 +959,21 @@
 {
 	struct ncp_entry_info finfo;
 	struct ncp_server *server = NCP_SERVER(dir);
-	int error, len = dentry->d_name.len + 1;
-	__u8 __name[len];
+	int error, len;
+	__u8 __name[NCP_MAXPATHLEN + 1];
 
 	DPRINTK("ncp_mkdir: making %s/%s\n",
 		dentry->d_parent->d_name.name, dentry->d_name.name);
+
 	error = -EIO;
 	lock_kernel();
 	if (!ncp_conn_valid(server))
 		goto out;
 
 	ncp_age_dentry(server, dentry);
+	len = sizeof(__name);
 	error = ncp_io2vol(server, __name, &len, dentry->d_name.name,
-						len-1, !ncp_preserve_case(dir));
+			   dentry->d_name.len, !ncp_preserve_case(dir));
 	if (error)
 		goto out;
 
@@ -992,8 +1001,8 @@
 static int ncp_rmdir(struct inode *dir, struct dentry *dentry)
 {
 	struct ncp_server *server = NCP_SERVER(dir);
-	int error, result, len = dentry->d_name.len + 1;
-	__u8 __name[len];
+	int error, result, len;
+	__u8 __name[NCP_MAXPATHLEN + 1];
 
 	DPRINTK("ncp_rmdir: removing %s/%s\n",
 		dentry->d_parent->d_name.name, dentry->d_name.name);
@@ -1007,8 +1016,9 @@
 	if (!d_unhashed(dentry))
 		goto out;
 
+	len = sizeof(__name);
 	error = ncp_io2vol(server, __name, &len, dentry->d_name.name,
-						len-1, !ncp_preserve_case(dir));
+			   dentry->d_name.len, !ncp_preserve_case(dir));
 	if (error)
 		goto out;
 
@@ -1110,9 +1120,8 @@
 {
 	struct ncp_server *server = NCP_SERVER(old_dir);
 	int error;
-	int old_len = old_dentry->d_name.len + 1;
-	int new_len = new_dentry->d_name.len + 1;
-	__u8 __old_name[old_len], __new_name[new_len];
+	int old_len, new_len;
+	__u8 __old_name[NCP_MAXPATHLEN + 1], __new_name[NCP_MAXPATHLEN + 1];
 
 	DPRINTK("ncp_rename: %s/%s to %s/%s\n",
 		old_dentry->d_parent->d_name.name, old_dentry->d_name.name,
@@ -1126,15 +1135,17 @@
 	ncp_age_dentry(server, old_dentry);
 	ncp_age_dentry(server, new_dentry);
 
+	old_len = sizeof(__old_name);
 	error = ncp_io2vol(server, __old_name, &old_len,
-					old_dentry->d_name.name, old_len-1,
-					!ncp_preserve_case(old_dir));
+			   old_dentry->d_name.name, old_dentry->d_name.len,
+			   !ncp_preserve_case(old_dir));
 	if (error)
 		goto out;
 
+	new_len = sizeof(__new_name);
 	error = ncp_io2vol(server, __new_name, &new_len,
-					new_dentry->d_name.name, new_len-1,
-					!ncp_preserve_case(new_dir));
+			   new_dentry->d_name.name, new_dentry->d_name.len,
+			   !ncp_preserve_case(new_dir));
 	if (error)
 		goto out;
 
--- diff/fs/ncpfs/inode.c	2003-09-30 15:46:18.000000000 +0100
+++ source/fs/ncpfs/inode.c	2004-02-09 10:39:56.000000000 +0000
@@ -917,7 +917,7 @@
 	if ((attr->ia_valid & ATTR_ATIME) != 0) {
 		__u16 dummy;
 		info_mask |= (DM_LAST_ACCESS_DATE);
-		ncp_date_unix2dos(attr->ia_ctime.tv_sec,
+		ncp_date_unix2dos(attr->ia_atime.tv_sec,
 				  &(dummy), &(info.lastAccessDate));
 		info.lastAccessDate = le16_to_cpu(info.lastAccessDate);
 	}
--- diff/fs/ncpfs/ncplib_kernel.h	2002-11-28 11:30:26.000000000 +0000
+++ source/fs/ncpfs/ncplib_kernel.h	2004-02-09 10:39:56.000000000 +0000
@@ -159,7 +159,7 @@
 
 #endif /* CONFIG_NCPFS_NLS */
 
-inline int
+int
 ncp_strnicmp(struct nls_table *,
 		const unsigned char *, const unsigned char *, int);
 
--- diff/fs/nfs/dir.c	2004-02-09 10:36:12.000000000 +0000
+++ source/fs/nfs/dir.c	2004-02-09 10:39:56.000000000 +0000
@@ -72,6 +72,26 @@
 	.setattr	= nfs_setattr,
 };
 
+#ifdef CONFIG_NFS_V4
+
+static struct dentry *nfs_atomic_lookup(struct inode *, struct dentry *, struct nameidata *);
+struct inode_operations nfs4_dir_inode_operations = {
+	.create		= nfs_create,
+	.lookup		= nfs_atomic_lookup,
+	.link		= nfs_link,
+	.unlink		= nfs_unlink,
+	.symlink	= nfs_symlink,
+	.mkdir		= nfs_mkdir,
+	.rmdir		= nfs_rmdir,
+	.mknod		= nfs_mknod,
+	.rename		= nfs_rename,
+	.permission	= nfs_permission,
+	.getattr	= nfs_getattr,
+	.setattr	= nfs_setattr,
+};
+
+#endif /* CONFIG_NFS_V4 */
+
 /*
  * Open file
  */
@@ -119,11 +139,13 @@
 	struct file	*file = desc->file;
 	struct inode	*inode = file->f_dentry->d_inode;
 	struct rpc_cred	*cred = nfs_file_cred(file);
+	unsigned long	timestamp;
 	int		error;
 
 	dfprintk(VFS, "NFS: nfs_readdir_filler() reading cookie %Lu into page %lu.\n", (long long)desc->entry->cookie, page->index);
 
  again:
+	timestamp = jiffies;
 	error = NFS_PROTO(inode)->readdir(file->f_dentry, cred, desc->entry->cookie, page,
 					  NFS_SERVER(inode)->dtsize, desc->plus);
 	if (error < 0) {
@@ -137,18 +159,21 @@
 		goto error;
 	}
 	SetPageUptodate(page);
+	NFS_FLAGS(inode) |= NFS_INO_INVALID_ATIME;
 	/* Ensure consistent page alignment of the data.
 	 * Note: assumes we have exclusive access to this mapping either
 	 *	 throught inode->i_sem or some other mechanism.
 	 */
-	if (page->index == 0)
+	if (page->index == 0) {
 		invalidate_inode_pages(inode->i_mapping);
+		NFS_I(inode)->readdir_timestamp = timestamp;
+	}
 	unlock_page(page);
 	return 0;
  error:
 	SetPageError(page);
 	unlock_page(page);
-	invalidate_inode_pages(inode->i_mapping);
+	nfs_zap_caches(inode);
 	desc->error = error;
 	return -EIO;
 }
@@ -361,6 +386,7 @@
 						page,
 						NFS_SERVER(inode)->dtsize,
 						desc->plus);
+	NFS_FLAGS(inode) |= NFS_INO_INVALID_ATIME;
 	desc->page = page;
 	desc->ptr = kmap(page);		/* matching kunmap in nfs_do_filldir */
 	if (desc->error >= 0) {
@@ -439,7 +465,15 @@
 			}
 			res = 0;
 			break;
-		} else if (res < 0)
+		}
+		if (res == -ETOOSMALL && desc->plus) {
+			NFS_FLAGS(inode) &= ~NFS_INO_ADVISE_RDPLUS;
+			nfs_zap_caches(inode);
+			desc->plus = 0;
+			desc->entry->eof = 0;
+			continue;
+		}
+		if (res < 0)
 			break;
 
 		res = nfs_do_filldir(desc, dirent, filldir);
@@ -461,14 +495,19 @@
  * In the case it has, we assume that the dentries are untrustworthy
  * and may need to be looked up again.
  */
-static inline
-int nfs_check_verifier(struct inode *dir, struct dentry *dentry)
+static inline int nfs_check_verifier(struct inode *dir, struct dentry *dentry)
 {
 	if (IS_ROOT(dentry))
 		return 1;
-	if (nfs_revalidate_inode(NFS_SERVER(dir), dir))
+	if ((NFS_FLAGS(dir) & NFS_INO_INVALID_ATTR) != 0
+			|| nfs_attribute_timeout(dir))
 		return 0;
-	return time_after(dentry->d_time, NFS_MTIME_UPDATE(dir));
+	return nfs_verify_change_attribute(dir, (unsigned long)dentry->d_fsdata);
+}
+
+static inline void nfs_set_verifier(struct dentry * dentry, unsigned long verf)
+{
+	dentry->d_fsdata = (void *)verf;
 }
 
 /*
@@ -508,9 +547,7 @@
 	/* Don't revalidate a negative dentry if we're creating a new file */
 	if ((ndflags & LOOKUP_CREATE) && !(ndflags & LOOKUP_CONTINUE))
 		return 0;
-	if (!nfs_check_verifier(dir, dentry))
-		return 1;
-	return time_after(jiffies, dentry->d_time + NFS_ATTRTIMEO(dir));
+	return !nfs_check_verifier(dir, dentry);
 }
 
 /*
@@ -532,6 +569,7 @@
 	int error;
 	struct nfs_fh fhandle;
 	struct nfs_fattr fattr;
+	unsigned long verifier;
 	int isopen = 0;
 
 	parent = dget_parent(dentry);
@@ -554,6 +592,9 @@
 		goto out_bad;
 	}
 
+	/* Revalidate parent directory attribute cache */
+	nfs_revalidate_inode(NFS_SERVER(dir), dir);
+
 	/* Force a full look up iff the parent directory has changed */
 	if (nfs_check_verifier(dir, dentry)) {
 		if (nfs_lookup_verify_inode(inode, isopen))
@@ -561,6 +602,12 @@
 		goto out_valid;
 	}
 
+	/*
+	 * Note: we're not holding inode->i_sem and so may be racing with
+	 * operations that change the directory. We therefore save the
+	 * change attribute *before* we do the RPC call.
+	 */
+	verifier = nfs_save_change_attribute(dir);
 	error = nfs_cached_lookup(dir, dentry, &fhandle, &fattr);
 	if (!error) {
 		if (memcmp(NFS_FH(inode), &fhandle, sizeof(struct nfs_fh))!= 0)
@@ -583,6 +630,7 @@
 
  out_valid_renew:
 	nfs_renew_times(dentry);
+	nfs_set_verifier(dentry, verifier);
  out_valid:
 	unlock_kernel();
 	dput(parent);
@@ -670,9 +718,11 @@
 		goto out;
 
 	error = -ENOMEM;
-	dentry->d_op = &nfs_dentry_operations;
+	dentry->d_op = NFS_PROTO(dir)->dentry_ops;
 
 	lock_kernel();
+	/* Revalidate parent directory attribute cache */
+	nfs_revalidate_inode(NFS_SERVER(dir), dir);
 
 	/* If we're doing an exclusive create, optimize away the lookup */
 	if (nfs_is_exclusive_create(dir, nd))
@@ -695,6 +745,7 @@
 	error = 0;
 	d_add(dentry, inode);
 	nfs_renew_times(dentry);
+	nfs_set_verifier(dentry, nfs_save_change_attribute(dir));
 out_unlock:
 	unlock_kernel();
 out:
@@ -702,6 +753,139 @@
 	return ERR_PTR(error);
 }
 
+#ifdef CONFIG_NFS_V4
+static int nfs_open_revalidate(struct dentry *, struct nameidata *);
+
+struct dentry_operations nfs4_dentry_operations = {
+	.d_revalidate	= nfs_open_revalidate,
+	.d_delete	= nfs_dentry_delete,
+	.d_iput		= nfs_dentry_iput,
+};
+
+static int is_atomic_open(struct inode *dir, struct nameidata *nd)
+{
+	if (!nd)
+		return 0;
+	/* Check that we are indeed trying to open this file */
+	if ((nd->flags & LOOKUP_CONTINUE) || !(nd->flags & LOOKUP_OPEN))
+		return 0;
+	/* NFS does not (yet) have a stateful open for directories */
+	if (nd->flags & LOOKUP_DIRECTORY)
+		return 0;
+	/* Are we trying to write to a read only partition? */
+	if (IS_RDONLY(dir) && (nd->intent.open.flags & (O_CREAT|O_TRUNC|FMODE_WRITE)))
+		return 0;
+	return 1;
+}
+
+static struct dentry *nfs_atomic_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd)
+{
+	struct inode *inode = NULL;
+	int error = 0;
+
+	/* Check that we are indeed trying to open this file */
+	if (!is_atomic_open(dir, nd))
+		goto no_open;
+
+	if (dentry->d_name.len > NFS_SERVER(dir)->namelen) {
+		error = -ENAMETOOLONG;
+		goto out;
+	}
+	dentry->d_op = NFS_PROTO(dir)->dentry_ops;
+
+	/* Let vfs_create() deal with O_EXCL */
+	if (nd->intent.open.flags & O_EXCL)
+		goto no_entry;
+
+	/* Open the file on the server */
+	lock_kernel();
+	/* Revalidate parent directory attribute cache */
+	nfs_revalidate_inode(NFS_SERVER(dir), dir);
+
+	if (nd->intent.open.flags & O_CREAT) {
+		nfs_begin_data_update(dir);
+		inode = nfs4_atomic_open(dir, dentry, nd);
+		nfs_end_data_update(dir);
+	} else
+		inode = nfs4_atomic_open(dir, dentry, nd);
+	unlock_kernel();
+	if (IS_ERR(inode)) {
+		error = PTR_ERR(inode);
+		switch (error) {
+			/* Make a negative dentry */
+			case -ENOENT:
+				inode = NULL;
+				break;
+			/* This turned out not to be a regular file */
+			case -ELOOP:
+				if (!(nd->intent.open.flags & O_NOFOLLOW))
+					goto no_open;
+			/* case -EISDIR: */
+			/* case -EINVAL: */
+			default:
+				goto out;
+		}
+	}
+no_entry:
+	d_add(dentry, inode);
+	nfs_renew_times(dentry);
+	nfs_set_verifier(dentry, nfs_save_change_attribute(dir));
+out:
+	BUG_ON(error > 0);
+	return ERR_PTR(error);
+no_open:
+	return nfs_lookup(dir, dentry, nd);
+}
+
+static int nfs_open_revalidate(struct dentry *dentry, struct nameidata *nd)
+{
+	struct dentry *parent = NULL;
+	struct inode *inode = dentry->d_inode;
+	struct inode *dir;
+	unsigned long verifier;
+	int openflags, ret = 0;
+
+	/* NFS only supports OPEN for regular files */
+	if (inode && !S_ISREG(inode->i_mode))
+		goto no_open;
+	parent = dget_parent(dentry);
+	dir = parent->d_inode;
+	if (!is_atomic_open(dir, nd))
+		goto no_open;
+	openflags = nd->intent.open.flags;
+	if (openflags & O_CREAT) {
+		/* If this is a negative dentry, just drop it */
+		if (!inode)
+			goto out;
+		/* If this is exclusive open, just revalidate */
+		if (openflags & O_EXCL)
+			goto no_open;
+	}
+	/* We can't create new files, or truncate existing ones here */
+	openflags &= ~(O_CREAT|O_TRUNC);
+
+	/*
+	 * Note: we're not holding inode->i_sem and so may be racing with
+	 * operations that change the directory. We therefore save the
+	 * change attribute *before* we do the RPC call.
+	 */
+	lock_kernel();
+	verifier = nfs_save_change_attribute(dir);
+	ret = nfs4_open_revalidate(dir, dentry, openflags);
+	if (!ret)
+		nfs_set_verifier(dentry, verifier);
+	unlock_kernel();
+out:
+	dput(parent);
+	if (!ret)
+		d_drop(dentry);
+	return ret;
+no_open:
+	dput(parent);
+	return nfs_lookup_revalidate(dentry, nd);
+}
+#endif /* CONFIG_NFSV4 */
+
 static inline
 int find_dirent_name(nfs_readdir_descriptor_t *desc, struct page *page, struct dentry *dentry)
 {
@@ -736,15 +920,20 @@
 	struct nfs_server *server;
 	struct nfs_entry entry;
 	struct page *page;
-	unsigned long timestamp = NFS_MTIME_UPDATE(dir);
+	unsigned long timestamp;
 	int res;
 
 	if (!NFS_USE_READDIRPLUS(dir))
 		return -ENOENT;
 	server = NFS_SERVER(dir);
-	if (server->flags & NFS_MOUNT_NOAC)
+	/* Don't use readdirplus unless the cache is stable */
+	if ((server->flags & NFS_MOUNT_NOAC) != 0
+			|| nfs_caches_unstable(dir)
+			|| nfs_attribute_timeout(dir))
+		return -ENOENT;
+	if ((NFS_FLAGS(dir) & (NFS_INO_INVALID_ATTR|NFS_INO_INVALID_DATA)) != 0)
 		return -ENOENT;
-	nfs_revalidate_inode(server, dir);
+	timestamp = NFS_I(dir)->readdir_timestamp;
 
 	entry.fh = fh;
 	entry.fattr = fattr;
@@ -798,9 +987,10 @@
 	if (inode) {
 		d_instantiate(dentry, inode);
 		nfs_renew_times(dentry);
-		error = 0;
+		nfs_set_verifier(dentry, nfs_save_change_attribute(dentry->d_parent->d_inode));
+		return 0;
 	}
-	return error;
+	error = -ENOMEM;
 out_err:
 	d_drop(dentry);
 	return error;
@@ -836,11 +1026,13 @@
 	 * does not pass the create flags.
 	 */
 	lock_kernel();
-	nfs_zap_caches(dir);
+	nfs_begin_data_update(dir);
 	inode = NFS_PROTO(dir)->create(dir, &dentry->d_name, &attr, open_flags);
+	nfs_end_data_update(dir);
 	if (!IS_ERR(inode)) {
 		d_instantiate(dentry, inode);
 		nfs_renew_times(dentry);
+		nfs_set_verifier(dentry, nfs_save_change_attribute(dir));
 		error = 0;
 	} else {
 		error = PTR_ERR(inode);
@@ -871,9 +1063,10 @@
 	attr.ia_valid = ATTR_MODE;
 
 	lock_kernel();
-	nfs_zap_caches(dir);
+	nfs_begin_data_update(dir);
 	error = NFS_PROTO(dir)->mknod(dir, &dentry->d_name, &attr, rdev,
 					&fhandle, &fattr);
+	nfs_end_data_update(dir);
 	if (!error)
 		error = nfs_instantiate(dentry, &fhandle, &fattr);
 	else
@@ -908,9 +1101,10 @@
 	 */
 	d_drop(dentry);
 #endif
-	nfs_zap_caches(dir);
+	nfs_begin_data_update(dir);
 	error = NFS_PROTO(dir)->mkdir(dir, &dentry->d_name, &attr, &fhandle,
 					&fattr);
+	nfs_end_data_update(dir);
 	if (!error)
 		error = nfs_instantiate(dentry, &fhandle, &fattr);
 	else
@@ -927,10 +1121,12 @@
 		dir->i_ino, dentry->d_name.name);
 
 	lock_kernel();
-	nfs_zap_caches(dir);
+	nfs_begin_data_update(dir);
 	error = NFS_PROTO(dir)->rmdir(dir, &dentry->d_name);
-	if (!error)
+	/* Ensure the VFS deletes this inode */
+	if (error == 0 && dentry->d_inode != NULL)
 		dentry->d_inode->i_nlink = 0;
+	nfs_end_data_update(dir);
 	unlock_kernel();
 
 	return error;
@@ -986,12 +1182,21 @@
 			goto out;
 	} while(sdentry->d_inode != NULL); /* need negative lookup */
 
-	nfs_zap_caches(dir);
 	qsilly.name = silly;
 	qsilly.len  = strlen(silly);
-	error = NFS_PROTO(dir)->rename(dir, &dentry->d_name, dir, &qsilly);
+	nfs_begin_data_update(dir);
+	if (dentry->d_inode) {
+		nfs_begin_data_update(dentry->d_inode);
+		error = NFS_PROTO(dir)->rename(dir, &dentry->d_name,
+				dir, &qsilly);
+		nfs_end_data_update(dentry->d_inode);
+	} else
+		error = NFS_PROTO(dir)->rename(dir, &dentry->d_name,
+				dir, &qsilly);
+	nfs_end_data_update(dir);
 	if (!error) {
 		nfs_renew_times(dentry);
+		nfs_set_verifier(dentry, nfs_save_change_attribute(dir));
 		d_move(dentry, sdentry);
 		error = nfs_async_unlink(dentry);
  		/* If we return 0 we don't unlink */
@@ -1023,14 +1228,17 @@
 		goto out;
 	}
 
-	nfs_zap_caches(dir);
-	if (inode)
-		NFS_CACHEINV(inode);
-	error = NFS_PROTO(dir)->remove(dir, &dentry->d_name);
-	if (error < 0)
-		goto out;
-	if (inode)
-		inode->i_nlink--;
+	nfs_begin_data_update(dir);
+	if (inode != NULL) {
+		nfs_begin_data_update(inode);
+		error = NFS_PROTO(dir)->remove(dir, &dentry->d_name);
+		/* The VFS may want to delete this inode */
+		if (error == 0)
+			inode->i_nlink--;
+		nfs_end_data_update(inode);
+	} else
+		error = NFS_PROTO(dir)->remove(dir, &dentry->d_name);
+	nfs_end_data_update(dir);
 out:
 	return error;
 }
@@ -1065,9 +1273,10 @@
 	spin_unlock(&dentry->d_lock);
 	spin_unlock(&dcache_lock);
 	error = nfs_safe_remove(dentry);
-	if (!error)
+	if (!error) {
 		nfs_renew_times(dentry);
-	else if (need_rehash)
+		nfs_set_verifier(dentry, nfs_save_change_attribute(dir));
+	} else if (need_rehash)
 		d_rehash(dentry);
 	unlock_kernel();
 	return error;
@@ -1114,9 +1323,10 @@
 	qsymname.len  = strlen(symname);
 
 	lock_kernel();
-	nfs_zap_caches(dir);
+	nfs_begin_data_update(dir);
 	error = NFS_PROTO(dir)->symlink(dir, &dentry->d_name, &qsymname,
 					  &attr, &sym_fh, &sym_attr);
+	nfs_end_data_update(dir);
 	if (!error) {
 		error = nfs_instantiate(dentry, &sym_fh, &sym_attr);
 	} else {
@@ -1148,9 +1358,12 @@
 	 */
 	lock_kernel();
 	d_drop(dentry);
-	nfs_zap_caches(dir);
-	NFS_CACHEINV(inode);
+
+	nfs_begin_data_update(dir);
+	nfs_begin_data_update(inode);
 	error = NFS_PROTO(dir)->link(inode, dir, &dentry->d_name);
+	nfs_end_data_update(inode);
+	nfs_end_data_update(dir);
 	unlock_kernel();
 	return error;
 }
@@ -1255,16 +1468,23 @@
 	if (new_inode)
 		d_delete(new_dentry);
 
-	nfs_zap_caches(new_dir);
-	nfs_zap_caches(old_dir);
+	nfs_begin_data_update(old_dir);
+	nfs_begin_data_update(new_dir);
+	nfs_begin_data_update(old_inode);
 	error = NFS_PROTO(old_dir)->rename(old_dir, &old_dentry->d_name,
 					   new_dir, &new_dentry->d_name);
+	nfs_end_data_update(old_inode);
+	nfs_end_data_update(new_dir);
+	nfs_end_data_update(old_dir);
 out:
 	if (rehash)
 		d_rehash(rehash);
-	if (!error && !S_ISDIR(old_inode->i_mode))
-		d_move(old_dentry, new_dentry);
-	nfs_renew_times(new_dentry);
+	if (!error) {
+		if (!S_ISDIR(old_inode->i_mode))
+			d_move(old_dentry, new_dentry);
+		nfs_renew_times(new_dentry);
+		nfs_set_verifier(new_dentry, nfs_save_change_attribute(new_dir));
+	}
 
 	/* new dentry created? */
 	if (dentry)
@@ -1306,6 +1526,9 @@
 		/* We only need to check permissions on file open() and access() */
 		if (!nd || !(nd->flags & (LOOKUP_OPEN|LOOKUP_ACCESS)))
 			return 0;
+		/* NFSv4 has atomic_open... */
+		if (NFS_PROTO(inode)->version > 3 && (nd->flags & LOOKUP_OPEN))
+			return 0;
 	}
 
 	lock_kernel();
@@ -1315,7 +1538,8 @@
 
 	cred = rpcauth_lookupcred(NFS_CLIENT(inode)->cl_auth, 0);
 	if (cache->cred == cred
-	    && time_before(jiffies, cache->jiffies + NFS_ATTRTIMEO(inode))) {
+	    && time_before(jiffies, cache->jiffies + NFS_ATTRTIMEO(inode))
+	    && !(NFS_FLAGS(inode) & NFS_INO_INVALID_ATTR)) {
 		if (!(res = cache->err)) {
 			/* Is the mask a subset of an accepted mask? */
 			if ((cache->mask & mask) == mask)
--- diff/fs/nfs/direct.c	2003-10-27 09:20:39.000000000 +0000
+++ source/fs/nfs/direct.c	2004-02-09 10:39:56.000000000 +0000
@@ -269,6 +269,7 @@
 	if (IS_SYNC(inode) || NFS_PROTO(inode)->version == 2 || count <= wsize)
 		wdata.args.stable = NFS_FILE_SYNC;
 
+	nfs_begin_data_update(inode);
 retry:
 	need_commit = 0;
 	tot_bytes = 0;
@@ -334,6 +335,8 @@
 						VERF_SIZE) != 0)
 			goto sync_retry;
 	}
+	nfs_end_data_update(inode);
+	NFS_FLAGS(inode) |= NFS_INO_INVALID_DATA;
 
 	return tot_bytes;
 
--- diff/fs/nfs/file.c	2004-02-09 10:36:12.000000000 +0000
+++ source/fs/nfs/file.c	2004-02-09 10:39:56.000000000 +0000
@@ -26,7 +26,6 @@
 #include <linux/mm.h>
 #include <linux/slab.h>
 #include <linux/pagemap.h>
-#include <linux/lockd/bind.h>
 #include <linux/smp_lock.h>
 
 #include <asm/uaccess.h>
@@ -105,11 +104,16 @@
 
 	dfprintk(VFS, "nfs: flush(%s/%ld)\n", inode->i_sb->s_id, inode->i_ino);
 
+	if ((file->f_mode & FMODE_WRITE) == 0)
+		return 0;
 	lock_kernel();
-	status = nfs_wb_file(inode, file);
+	/* Ensure that data+attribute caches are up to date after close() */
+	status = nfs_wb_all(inode);
 	if (!status) {
 		status = file->f_error;
 		file->f_error = 0;
+		if (!status)
+			__nfs_revalidate_inode(NFS_SERVER(inode), inode);
 	}
 	unlock_kernel();
 	return status;
@@ -278,21 +282,17 @@
 	if (!inode)
 		return -EINVAL;
 
-	/* This will be in a forthcoming patch. */
-	if (NFS_PROTO(inode)->version == 4) {
-		printk(KERN_INFO "NFS: file locking over NFSv4 is not yet supported\n");
-		return -EIO;
-	}
-
 	/* No mandatory locks over NFS */
 	if ((inode->i_mode & (S_ISGID | S_IXGRP)) == S_ISGID)
 		return -ENOLCK;
 
-	/* Fake OK code if mounted without NLM support */
-	if (NFS_SERVER(inode)->flags & NFS_MOUNT_NONLM) {
-		if (IS_GETLK(cmd))
-			status = LOCK_USE_CLNT;
-		goto out_ok;
+	if (NFS_PROTO(inode)->version != 4) {
+		/* Fake OK code if mounted without NLM support */
+		if (NFS_SERVER(inode)->flags & NFS_MOUNT_NONLM) {
+			if (IS_GETLK(cmd))
+				status = LOCK_USE_CLNT;
+			goto out_ok;
+		}
 	}
 
 	/*
@@ -302,7 +302,7 @@
 	 * Not sure whether that would be unique, though, or whether
 	 * that would break in other places.
 	 */
-	if (!fl->fl_owner || (fl->fl_flags & FL_POSIX) != FL_POSIX)
+	if (!fl->fl_owner || !(fl->fl_flags & FL_POSIX))
 		return -ENOLCK;
 
 	/*
@@ -322,7 +322,7 @@
 		return status;
 
 	lock_kernel();
-	status = nlmclnt_proc(inode, cmd, fl);
+	status = NFS_PROTO(inode)->lock(filp, cmd, fl);
 	unlock_kernel();
 	if (status < 0)
 		return status;
--- diff/fs/nfs/idmap.c	2003-10-09 09:47:34.000000000 +0100
+++ source/fs/nfs/idmap.c	2004-02-09 10:39:56.000000000 +0000
@@ -43,6 +43,7 @@
 #include <linux/sched.h>
 
 #include <linux/sunrpc/clnt.h>
+#include <linux/workqueue.h>
 #include <linux/sunrpc/rpc_pipe_fs.h>
 
 #include <linux/nfs_fs_sb.h>
@@ -51,14 +52,16 @@
 #include <linux/nfs_idmap.h>
 
 #define IDMAP_HASH_SZ          128
-#define IDMAP_HASH_TYPE_NAME   0x01
-#define IDMAP_HASH_TYPE_ID     0x02
-#define IDMAP_HASH_TYPE_INSERT 0x04
 
 struct idmap_hashent {
-	uid_t     ih_id;
-	char      ih_name[IDMAP_NAMESZ];
-	u_int32_t ih_namelen;
+	__u32 ih_id;
+	int ih_namelen;
+	char ih_name[IDMAP_NAMESZ];
+};
+
+struct idmap_hashtable {
+	__u8 h_type;
+	struct idmap_hashent h_entries[IDMAP_HASH_SZ];
 };
 
 struct idmap {
@@ -66,12 +69,10 @@
 	struct dentry        *idmap_dentry;
 	wait_queue_head_t     idmap_wq;
 	struct idmap_msg      idmap_im;
-	struct nfs_server    *idmap_server;
-	struct semaphore      idmap_lock;
-	struct semaphore      idmap_im_lock;
-	struct semaphore      idmap_hash_lock;
-	struct idmap_hashent  idmap_id_hash[IDMAP_HASH_SZ];
-	struct idmap_hashent  idmap_name_hash[IDMAP_HASH_SZ];
+	struct semaphore      idmap_lock;    /* Serializes upcalls */
+	struct semaphore      idmap_im_lock; /* Protects the hashtable */
+	struct idmap_hashtable idmap_user_hash;
+	struct idmap_hashtable idmap_group_hash;
 };
 
 static ssize_t   idmap_pipe_upcall(struct file *, struct rpc_pipe_msg *, char *,
@@ -79,10 +80,7 @@
 static ssize_t   idmap_pipe_downcall(struct file *, const char *, size_t);
 void             idmap_pipe_destroy_msg(struct rpc_pipe_msg *);
 
-static int       validate_ascii(char *, u_int32_t);
-
-static u_int32_t fnvhash32(void *, u_int32_t);
-static int       idmap_cache_lookup(struct idmap *, int, char *, u_int32_t *, uid_t *);
+static unsigned int fnvhash32(const void *, size_t);
 
 static struct rpc_pipe_ops idmap_upcall_ops = {
         .upcall         = idmap_pipe_upcall,
@@ -90,95 +88,153 @@
         .destroy_msg    = idmap_pipe_destroy_msg,
 };
 
-void *
-nfs_idmap_new(struct nfs_server *server)
+void
+nfs_idmap_new(struct nfs4_client *clp)
 {
 	struct idmap *idmap;
 
+	if (clp->cl_idmap != NULL)
+		return;
         if ((idmap = kmalloc(sizeof(*idmap), GFP_KERNEL)) == NULL)
-                return (NULL);
+                return;
 
 	memset(idmap, 0, sizeof(*idmap));
 
-	idmap->idmap_server = server;
-
 	snprintf(idmap->idmap_path, sizeof(idmap->idmap_path),
-	    "%s/idmap", idmap->idmap_server->client->cl_pathname);
+	    "%s/idmap", clp->cl_rpcclient->cl_pathname);
 
         idmap->idmap_dentry = rpc_mkpipe(idmap->idmap_path,
-	    idmap->idmap_server, &idmap_upcall_ops, 0);
-        if (IS_ERR(idmap->idmap_dentry))
-		goto err_free;
+	    idmap, &idmap_upcall_ops, 0);
+        if (IS_ERR(idmap->idmap_dentry)) {
+		kfree(idmap);
+		return;
+	}
 
         init_MUTEX(&idmap->idmap_lock);
         init_MUTEX(&idmap->idmap_im_lock);
-        init_MUTEX(&idmap->idmap_hash_lock);
 	init_waitqueue_head(&idmap->idmap_wq);
+	idmap->idmap_user_hash.h_type = IDMAP_TYPE_USER;
+	idmap->idmap_group_hash.h_type = IDMAP_TYPE_GROUP;
 
-	return (idmap);
-
- err_free:
-	kfree(idmap);
-	return (NULL);
+	clp->cl_idmap = idmap;
 }
 
 void
-nfs_idmap_delete(struct nfs_server *server)
+nfs_idmap_delete(struct nfs4_client *clp)
 {
-	struct idmap *idmap = server->idmap;
+	struct idmap *idmap = clp->cl_idmap;
 
 	if (!idmap)
 		return;
 	rpc_unlink(idmap->idmap_path);
-	server->idmap = NULL;
+	clp->cl_idmap = NULL;
 	kfree(idmap);
 }
 
 /*
+ * Helper routines for manipulating the hashtable
+ */
+static inline struct idmap_hashent *
+idmap_name_hash(struct idmap_hashtable* h, const char *name, size_t len)
+{
+	return &h->h_entries[fnvhash32(name, len) % IDMAP_HASH_SZ];
+}
+
+static struct idmap_hashent *
+idmap_lookup_name(struct idmap_hashtable *h, const char *name, size_t len)
+{
+	struct idmap_hashent *he = idmap_name_hash(h, name, len);
+
+	if (he->ih_namelen != len || memcmp(he->ih_name, name, len) != 0)
+		return NULL;
+	return he;
+}
+
+static inline struct idmap_hashent *
+idmap_id_hash(struct idmap_hashtable* h, __u32 id)
+{
+	return &h->h_entries[fnvhash32(&id, sizeof(id)) % IDMAP_HASH_SZ];
+}
+
+static struct idmap_hashent *
+idmap_lookup_id(struct idmap_hashtable *h, __u32 id)
+{
+	struct idmap_hashent *he = idmap_id_hash(h, id);
+	if (he->ih_id != id || he->ih_namelen == 0)
+		return NULL;
+	return he;
+}
+
+/*
+ * Routines for allocating new entries in the hashtable.
+ * For now, we just have 1 entry per bucket, so it's all
+ * pretty trivial.
+ */
+static inline struct idmap_hashent *
+idmap_alloc_name(struct idmap_hashtable *h, char *name, unsigned len)
+{
+	return idmap_name_hash(h, name, len);
+}
+
+static inline struct idmap_hashent *
+idmap_alloc_id(struct idmap_hashtable *h, __u32 id)
+{
+	return idmap_id_hash(h, id);
+}
+
+static void
+idmap_update_entry(struct idmap_hashent *he, const char *name,
+		size_t namelen, __u32 id)
+{
+	he->ih_id = id;
+	memcpy(he->ih_name, name, namelen);
+	he->ih_name[namelen] = '\0';
+	he->ih_namelen = namelen;
+}
+
+/*
  * Name -> ID
  */
-int
-nfs_idmap_id(struct nfs_server *server, u_int8_t type, char *name, 
-    u_int namelen, uid_t *id)
+static int
+nfs_idmap_id(struct idmap *idmap, struct idmap_hashtable *h,
+		const char *name, size_t namelen, __u32 *id)
 {
 	struct rpc_pipe_msg msg;
-	struct idmap *idmap = server->idmap;
 	struct idmap_msg *im;
+	struct idmap_hashent *he;
 	DECLARE_WAITQUEUE(wq, current);
-	int ret = -1, hashtype = IDMAP_HASH_TYPE_NAME, xnamelen = namelen;
-
-	if (idmap == NULL)
-		return (-1);
+	int ret = -EIO;
 
 	im = &idmap->idmap_im;
 
-	if (namelen > IDMAP_NAMESZ || namelen == 0)
-		return (-1);
+	/*
+	 * String sanity checks
+	 * Note that the userland daemon expects NUL terminated strings
+	 */
+	for (;;) {
+		if (namelen == 0)
+			return -EINVAL;
+		if (name[namelen-1] != '\0')
+			break;
+		namelen--;
+	}
+	if (namelen >= IDMAP_NAMESZ)
+		return -EINVAL;
 
 	down(&idmap->idmap_lock);
 	down(&idmap->idmap_im_lock);
 
-	if (name[xnamelen - 1] == '\0')
-		xnamelen--;
-
-	if (idmap_cache_lookup(idmap, hashtype, name, &xnamelen, id) == 0) {
+	he = idmap_lookup_name(h, name, namelen);
+	if (he != NULL) {
+		*id = he->ih_id;
 		ret = 0;
 		goto out;
 	}
 
 	memset(im, 0, sizeof(*im));
 	memcpy(im->im_name, name, namelen);
-	/* Make sure the string is NULL terminated */
-	if (namelen != xnamelen) {
-		/* We cannot fit a NULL character */
-		if (namelen == IDMAP_NAMESZ) {
-			ret = -1;
-			goto out;
-		}
-		im->im_name[namelen] = '\0';
-	} 
 
-	im->im_type = type;
+	im->im_type = h->h_type;
 	im->im_conv = IDMAP_CONV_NAMETOID;
 
 	memset(&msg, 0, sizeof(msg));
@@ -198,16 +254,9 @@
 	remove_wait_queue(&idmap->idmap_wq, &wq);
 	down(&idmap->idmap_im_lock);
 
-	/*
-	 * XXX Race condition here, with testing for status.  Go ahead
-	 * and and do the cace lookup anyway.
-	 */
 	if (im->im_status & IDMAP_STATUS_SUCCESS) {
-		ret = 0;
 		*id = im->im_id;
-
-		hashtype |= IDMAP_HASH_TYPE_INSERT;
-		ret = idmap_cache_lookup(idmap, hashtype, name, &xnamelen, id);
+		ret = 0;
 	}
 
  out:
@@ -220,35 +269,31 @@
 /*
  * ID -> Name
  */
-int
-nfs_idmap_name(struct nfs_server *server, u_int8_t type, uid_t id,
-    char *name, u_int *namelen)
+static int
+nfs_idmap_name(struct idmap *idmap, struct idmap_hashtable *h,
+		__u32 id, char *name)
 {
 	struct rpc_pipe_msg msg;
-	struct idmap *idmap = server->idmap;
 	struct idmap_msg *im;
+	struct idmap_hashent *he;
 	DECLARE_WAITQUEUE(wq, current);
-	int ret = -1, hashtype = IDMAP_HASH_TYPE_ID;
-	u_int len;
-
-	if (idmap == NULL)
-		return (-1);
+	int ret = -EIO;
+	unsigned int len;
 
 	im = &idmap->idmap_im;
 
-	if (*namelen < IDMAP_NAMESZ || *namelen == 0)
-		return (-1);
-
 	down(&idmap->idmap_lock);
 	down(&idmap->idmap_im_lock);
 
-	if (idmap_cache_lookup(idmap, hashtype, name, namelen, &id) == 0) {
-		ret = 0;
+	he = idmap_lookup_id(h, id);
+	if (he != 0) {
+		memcpy(name, he->ih_name, he->ih_namelen);
+		ret = he->ih_namelen;
 		goto out;
 	}
 
 	memset(im, 0, sizeof(*im));
-	im->im_type = type;
+	im->im_type = h->h_type;
 	im->im_conv = IDMAP_CONV_IDTONAME;
 	im->im_id = id;
 
@@ -263,9 +308,6 @@
 		goto out;
 	}
 
-	/*
-	 * XXX add timeouts here
-	 */
 	set_current_state(TASK_UNINTERRUPTIBLE);
 	up(&idmap->idmap_im_lock);
 	schedule();
@@ -274,23 +316,20 @@
 	down(&idmap->idmap_im_lock);
 
 	if (im->im_status & IDMAP_STATUS_SUCCESS) {
-		if ((len = validate_ascii(im->im_name, IDMAP_NAMESZ)) == -1)
+		if ((len = strnlen(im->im_name, IDMAP_NAMESZ)) == 0)
 			goto out;
-		ret = 0;
 		memcpy(name, im->im_name, len);
-		*namelen = len;
-
-		hashtype |= IDMAP_HASH_TYPE_INSERT;
-		ret = idmap_cache_lookup(idmap, hashtype, name, namelen, &id);
+		ret = len;
 	}
 
  out:
 	memset(im, 0, sizeof(*im));
 	up(&idmap->idmap_im_lock);
 	up(&idmap->idmap_lock);
-	return (ret);
+	return ret;
 }
 
+/* RPC pipefs upcall/downcall routines */
 static ssize_t
 idmap_pipe_upcall(struct file *filp, struct rpc_pipe_msg *msg,
     char *dst, size_t buflen)
@@ -317,10 +356,12 @@
 idmap_pipe_downcall(struct file *filp, const char *src, size_t mlen)
 {
         struct rpc_inode *rpci = RPC_I(filp->f_dentry->d_inode);
-	struct nfs_server *server = rpci->private;
-	struct idmap *idmap = server->idmap;
+	struct idmap *idmap = (struct idmap *)rpci->private;
 	struct idmap_msg im_in, *im = &idmap->idmap_im;
-	int match = 0, hashtype, badmsg = 0, namelen_in, namelen;
+	struct idmap_hashtable *h;
+	struct idmap_hashent *he = NULL;
+	int namelen_in;
+	int ret;
 
         if (mlen != sizeof(im_in))
                 return (-ENOSPC);
@@ -330,39 +371,66 @@
 
 	down(&idmap->idmap_im_lock);
 
-	namelen_in = validate_ascii(im_in.im_name, IDMAP_NAMESZ);
-	namelen = validate_ascii(im->im_name, IDMAP_NAMESZ);
+	ret = mlen;
+	im->im_status = im_in.im_status;
+	/* If we got an error, terminate now, and wake up pending upcalls */
+	if (!(im_in.im_status & IDMAP_STATUS_SUCCESS)) {
+		wake_up(&idmap->idmap_wq);
+		goto out;
+	}
+
+	/* Sanity checking of strings */
+	ret = -EINVAL;
+	namelen_in = strnlen(im_in.im_name, IDMAP_NAMESZ);
+	if (namelen_in == 0 || namelen_in == IDMAP_NAMESZ)
+		goto out;
 
-	badmsg = !(im_in.im_status & IDMAP_STATUS_SUCCESS) || namelen_in <= 0;
+	switch (im_in.im_type) {
+		case IDMAP_TYPE_USER:
+			h = &idmap->idmap_user_hash;
+			break;
+		case IDMAP_TYPE_GROUP:
+			h = &idmap->idmap_group_hash;
+			break;
+		default:
+			goto out;
+	}
 
 	switch (im_in.im_conv) {
 	case IDMAP_CONV_IDTONAME:
-		match = im->im_id == im_in.im_id;
+		/* Did we match the current upcall? */
+		if (im->im_conv == IDMAP_CONV_IDTONAME
+				&& im->im_type == im_in.im_type
+				&& im->im_id == im_in.im_id) {
+			/* Yes: copy string, including the terminating '\0'  */
+			memcpy(im->im_name, im_in.im_name, namelen_in);
+			im->im_name[namelen_in] = '\0';
+			wake_up(&idmap->idmap_wq);
+		}
+		he = idmap_alloc_id(h, im_in.im_id);
 		break;
 	case IDMAP_CONV_NAMETOID:
-		match = namelen == namelen_in &&
-		    memcmp(im->im_name, im_in.im_name, namelen) == 0;
+		/* Did we match the current upcall? */
+		if (im->im_conv == IDMAP_CONV_NAMETOID
+				&& im->im_type == im_in.im_type
+				&& strnlen(im->im_name, IDMAP_NAMESZ) == namelen_in
+				&& memcmp(im->im_name, im_in.im_name, namelen_in) == 0) {
+			im->im_id = im_in.im_id;
+			wake_up(&idmap->idmap_wq);
+		}
+		he = idmap_alloc_name(h, im_in.im_name, namelen_in);
 		break;
 	default:
-		badmsg = 1;
-		break;
-	}
-
-	match = match && im->im_type == im_in.im_type;
-
-	if (match) {
-		memcpy(im, &im_in, sizeof(*im));
-		wake_up(&idmap->idmap_wq);
-	} else if (!badmsg) {
-		hashtype = im_in.im_conv == IDMAP_CONV_IDTONAME ?
-		    IDMAP_HASH_TYPE_ID : IDMAP_HASH_TYPE_NAME;
-		hashtype |= IDMAP_HASH_TYPE_INSERT;
-		idmap_cache_lookup(idmap, hashtype, im_in.im_name, &namelen_in,
-		    &im_in.im_id);
+		goto out;
 	}
 
+	/* If the entry is valid, also copy it to the cache */
+	if (he != NULL)
+		idmap_update_entry(he, im_in.im_name, namelen_in, im_in.im_id);
+	ret = mlen;
+out:
 	up(&idmap->idmap_im_lock);
-	return (mlen);
+	return ret;
 }
 
 void
@@ -379,108 +447,51 @@
 	up(&idmap->idmap_im_lock);
 }
 
-static int
-validate_ascii(char *string, u_int32_t len)
-{
-	int i;
-
-	for (i = 0; i < len; i++) {
-		if (string[i] == '\0')
-			break;
-
-		if (string[i] & 0x80)
-			return (-1);
-	}
-
-	if (string[i] != '\0')
-		return (-1);
-
-	return (i);
-}
-
 /* 
  * Fowler/Noll/Vo hash
  *    http://www.isthe.com/chongo/tech/comp/fnv/
  */
 
-#define FNV_P_32 ((u_int32_t)0x01000193) /* 16777619 */
-#define FNV_1_32 ((u_int32_t)0x811c9dc5) /* 2166136261 */
+#define FNV_P_32 ((unsigned int)0x01000193) /* 16777619 */
+#define FNV_1_32 ((unsigned int)0x811c9dc5) /* 2166136261 */
 
-static u_int32_t
-fnvhash32(void *buf, u_int32_t buflen)
+static unsigned int fnvhash32(const void *buf, size_t buflen)
 {
-	u_char *p, *end = (u_char *)buf + buflen;
-	u_int32_t hash = FNV_1_32;
+	const unsigned char *p, *end = (const unsigned char *)buf + buflen;
+	unsigned int hash = FNV_1_32;
 
 	for (p = buf; p < end; p++) {
 		hash *= FNV_P_32;
-		hash ^= (u_int32_t)*p;
+		hash ^= (unsigned int)*p;
 	}
 
 	return (hash);
 }
 
-/*
- * ->ih_namelen == 0 indicates negative entry
- */
-static int
-idmap_cache_lookup(struct idmap *idmap, int type, char *name, u_int32_t *namelen,
-    uid_t *id)
+int nfs_map_name_to_uid(struct nfs4_client *clp, const char *name, size_t namelen, __u32 *uid)
 {
-	u_int32_t hash;
-	struct idmap_hashent *he = NULL;
-	int insert = type & IDMAP_HASH_TYPE_INSERT;
-	int ret = -1;
+	struct idmap *idmap = clp->cl_idmap;
 
-	/*
-	 * XXX technically, this is not needed, since we will always
-	 * hold idmap_im_lock when altering the hash tables.  but
-	 * semantically that just hurts.
-	 *
-	 * XXX cache negative responses
-	 */
-	down(&idmap->idmap_hash_lock);
+	return nfs_idmap_id(idmap, &idmap->idmap_user_hash, name, namelen, uid);
+}
 
-	if (*namelen > IDMAP_NAMESZ || *namelen == 0)
-		goto out;
+int nfs_map_group_to_gid(struct nfs4_client *clp, const char *name, size_t namelen, __u32 *uid)
+{
+	struct idmap *idmap = clp->cl_idmap;
 
-	if (type & IDMAP_HASH_TYPE_NAME) {
-		hash = fnvhash32(name, *namelen) % IDMAP_HASH_SZ;
-		he = &idmap->idmap_name_hash[hash];
-
-		/*
-		 * Testing he->ih_namelen == *namelen implicitly tests
-		 * namelen != 0, and thus a non-negative entry.
-		 */
-		if (!insert && he->ih_namelen == *namelen && 
-		    memcmp(he->ih_name, name, *namelen) == 0) {
-			*id = he->ih_id;
-			ret = 0;
-			goto out;
-		}
-	}
+	return nfs_idmap_id(idmap, &idmap->idmap_group_hash, name, namelen, uid);
+}
 
-	if (type & IDMAP_HASH_TYPE_ID) {
-		hash = fnvhash32(id, sizeof(*id)) % IDMAP_HASH_SZ;
-		he = &idmap->idmap_id_hash[hash];
-
-		if (!insert && *id == he->ih_id && he->ih_namelen != 0 && 
-		    *namelen >= he->ih_namelen) {
-			memcpy(name, he->ih_name, he->ih_namelen);
-			*namelen = he->ih_namelen;
-			ret = 0;
-			goto out;
-		}
-	}
+int nfs_map_uid_to_name(struct nfs4_client *clp, __u32 uid, char *buf)
+{
+	struct idmap *idmap = clp->cl_idmap;
 
-	if (insert && he != NULL) {
-		he->ih_id = *id;
-		memcpy(he->ih_name, name, *namelen);
-		he->ih_namelen = *namelen;
-		ret = 0;
-	}
+	return nfs_idmap_name(idmap, &idmap->idmap_user_hash, uid, buf);
+}
+int nfs_map_gid_to_group(struct nfs4_client *clp, __u32 uid, char *buf)
+{
+	struct idmap *idmap = clp->cl_idmap;
 
- out:
-	up(&idmap->idmap_hash_lock);
-	return (ret);
+	return nfs_idmap_name(idmap, &idmap->idmap_group_hash, uid, buf);
 }
+
--- diff/fs/nfs/inode.c	2004-02-09 10:36:12.000000000 +0000
+++ source/fs/nfs/inode.c	2004-02-09 10:39:56.000000000 +0000
@@ -53,8 +53,8 @@
  */
 #define NFS_MAX_READAHEAD	RPC_MAXREQS
 
-void nfs_zap_caches(struct inode *);
 static void nfs_invalidate_inode(struct inode *);
+static int nfs_update_inode(struct inode *, struct nfs_fattr *, unsigned long);
 
 static struct inode *nfs_alloc_inode(struct super_block *sb);
 static void nfs_destroy_inode(struct inode *);
@@ -151,6 +151,7 @@
 	cred = nfsi->cache_access.cred;
 	if (cred)
 		put_rpccred(cred);
+	BUG_ON(atomic_read(&nfsi->data_updates) != 0);
 }
 
 void
@@ -158,10 +159,7 @@
 {
 	struct nfs_server *server = NFS_SB(sb);
 
-#ifdef CONFIG_NFS_V4
-	if (server->idmap != NULL)
-		nfs_idmap_delete(server);
-#endif /* CONFIG_NFS_V4 */
+	nfs4_renewd_prepare_shutdown(server);
 
 	if (server->client != NULL)
 		rpc_shutdown_client(server->client);
@@ -301,7 +299,6 @@
 	server = NFS_SB(sb);
 
 	sb->s_magic      = NFS_SUPER_MAGIC;
-	sb->s_op         = &nfs_sops;
 
 	/* Did getting the root inode fail? */
 	if (nfs_get_root(&root_inode, authflavor, sb, &server->fh) < 0)
@@ -310,7 +307,7 @@
 	if (!sb->s_root)
 		goto out_no_root;
 
-	sb->s_root->d_op = &nfs_dentry_operations;
+	sb->s_root->d_op = server->rpc_ops->dentry_ops;
 
 	/* Get some general file system info */
         if (server->rpc_ops->fsinfo(server, &server->fh, &fsinfo) < 0) {
@@ -493,10 +490,17 @@
 	server->client = nfs_create_client(server, data);
 	if (server->client == NULL)
 		goto out_fail;
-	data->pseudoflavor = RPC_AUTH_UNIX;	/* RFC 2623, sec 2.3.2 */
-	server->client_sys = nfs_create_client(server, data);
-	if (server->client_sys == NULL)
-		goto out_shutdown;
+	/* RFC 2623, sec 2.3.2 */
+	if (authflavor != RPC_AUTH_UNIX) {
+		server->client_sys = rpc_clone_client(server->client);
+		if (server->client_sys == NULL)
+			goto out_shutdown;
+		if (!rpcauth_create(RPC_AUTH_UNIX, server->client_sys))
+			goto out_shutdown;
+	} else {
+		atomic_inc(&server->client->cl_count);
+		server->client_sys = server->client;
+	}
 
 	/* Fire up rpciod if not yet running */
 	if (rpciod_up() != 0) {
@@ -504,6 +508,7 @@
 		goto out_shutdown;
 	}
 
+	sb->s_op = &nfs_sops;
 	err = nfs_sb_init(sb, authflavor);
 	if (err != 0)
 		goto out_noinit;
@@ -623,13 +628,17 @@
 void
 nfs_zap_caches(struct inode *inode)
 {
+	struct nfs_inode *nfsi = NFS_I(inode);
+	int mode = inode->i_mode;
+
 	NFS_ATTRTIMEO(inode) = NFS_MINATTRTIMEO(inode);
 	NFS_ATTRTIMEO_UPDATE(inode) = jiffies;
 
-	invalidate_remote_inode(inode);
-
 	memset(NFS_COOKIEVERF(inode), 0, sizeof(NFS_COOKIEVERF(inode)));
-	NFS_CACHEINV(inode);
+	if (S_ISREG(mode) || S_ISDIR(mode) || S_ISLNK(mode))
+		nfsi->flags |= NFS_INO_INVALID_ATTR|NFS_INO_INVALID_DATA;
+	else
+		nfsi->flags |= NFS_INO_INVALID_ATTR;
 }
 
 /*
@@ -669,9 +678,6 @@
 		return 0;
 	if (is_bad_inode(inode))
 		return 0;
-	/* Force an attribute cache update if inode->i_count == 0 */
-	if (!atomic_read(&inode->i_count))
-		NFS_CACHEINV(inode);
 	return 1;
 }
 
@@ -725,7 +731,7 @@
 		inode->i_ino = hash;
 
 		/* We can't support update_atime(), since the server will reset it */
-		inode->i_flags |= S_NOATIME;
+		inode->i_flags |= S_NOATIME|S_NOCMTIME;
 		inode->i_mode = fattr->mode;
 		/* Why so? Because we want revalidate for devices/FIFOs, and
 		 * that's precisely what we have in nfs_file_inode_operations.
@@ -736,7 +742,7 @@
 			inode->i_data.a_ops = &nfs_file_aops;
 			inode->i_data.backing_dev_info = &NFS_SB(sb)->backing_dev_info;
 		} else if (S_ISDIR(inode->i_mode)) {
-			inode->i_op = &nfs_dir_inode_operations;
+			inode->i_op = NFS_SB(sb)->rpc_ops->dir_inode_ops;
 			inode->i_fop = &nfs_dir_operations;
 			if (nfs_server_capable(inode, NFS_CAP_READDIRPLUS)
 			    && fattr->size <= NFS_LIMIT_READDIRPLUS)
@@ -750,10 +756,6 @@
 		inode->i_atime = fattr->atime;
 		inode->i_mtime = fattr->mtime;
 		inode->i_ctime = fattr->ctime;
-		nfsi->read_cache_ctime = fattr->ctime;
-		nfsi->read_cache_mtime = fattr->mtime;
-		nfsi->cache_mtime_jiffies = fattr->timestamp;
-		nfsi->read_cache_isize = fattr->size;
 		if (fattr->valid & NFS_ATTR_FATTR_V4)
 			nfsi->change_attr = fattr->change_attr;
 		inode->i_size = nfs_size_to_loff_t(fattr->size);
@@ -800,65 +802,50 @@
 	struct nfs_fattr fattr;
 	int error;
 
+	if (attr->ia_valid & ATTR_SIZE) {
+		if (!S_ISREG(inode->i_mode) || attr->ia_size == i_size_read(inode))
+			attr->ia_valid &= ~ATTR_SIZE;
+	}
+
 	/* 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();
-
-	/*
-	 * Make sure the inode is up-to-date.
-	 */
-	error = nfs_revalidate_inode(NFS_SERVER(inode),inode);
-	if (error) {
-#ifdef NFS_PARANOIA
-printk("nfs_setattr: revalidate failed, error=%d\n", error);
-#endif
-		goto out;
-	}
-
-	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);
-		filemap_fdatawait(inode->i_mapping);
-		if (error)
-			goto out;
+	nfs_begin_data_update(inode);
+	/* Write all dirty data if we're changing file permissions or size */
+	if ((attr->ia_valid & (ATTR_MODE|ATTR_UID|ATTR_GID|ATTR_SIZE)) != 0) {
+		if (filemap_fdatawrite(inode->i_mapping) == 0)
+			filemap_fdatawait(inode->i_mapping);
+		nfs_wb_all(inode);
 	}
-
 	error = NFS_PROTO(inode)->setattr(dentry, &fattr, attr);
-	if (error)
-		goto out;
-	/*
-	 * If we changed the size or mtime, update the inode
-	 * now to avoid invalidating the page cache.
-	 */
-	if (attr->ia_valid & ATTR_SIZE) {
-		if (attr->ia_size != fattr.size)
-			printk("nfs_setattr: attr=%Ld, fattr=%Ld??\n",
-			       (long long) attr->ia_size, (long long)fattr.size);
-		vmtruncate(inode, attr->ia_size);
+	if (error == 0) {
+		nfs_refresh_inode(inode, &fattr);
+		if ((attr->ia_valid & ATTR_MODE) != 0) {
+			int mode;
+			mode = inode->i_mode & ~S_IALLUGO;
+			mode |= attr->ia_mode & S_IALLUGO;
+			inode->i_mode = mode;
+		}
+		if ((attr->ia_valid & ATTR_UID) != 0)
+			inode->i_uid = attr->ia_uid;
+		if ((attr->ia_valid & ATTR_GID) != 0)
+			inode->i_gid = attr->ia_gid;
+		if ((attr->ia_valid & ATTR_SIZE) != 0) {
+			i_size_write(inode, attr->ia_size);
+			vmtruncate(inode, attr->ia_size);
+		}
 	}
-
-	/*
-	 * If we changed the size or mtime, update the inode
-	 * now to avoid invalidating the page cache.
-	 */
-	if (!(fattr.valid & NFS_ATTR_WCC)) {
-		struct nfs_inode *nfsi = NFS_I(inode);
-		fattr.pre_size = nfsi->read_cache_isize;
-		fattr.pre_mtime = nfsi->read_cache_mtime;
-		fattr.pre_ctime = nfsi->read_cache_ctime;
-		fattr.valid |= NFS_ATTR_WCC;
-	}
-	/* Force an attribute cache update */
-	NFS_CACHEINV(inode);
-	error = nfs_refresh_inode(inode, &fattr);
-out:
+	if ((attr->ia_valid & (ATTR_MODE|ATTR_UID|ATTR_GID)) != 0) {
+		struct rpc_cred **cred = &NFS_I(inode)->cache_access.cred;
+		if (*cred) {
+			put_rpccred(*cred);
+			*cred = NULL;
+		}
+	}
+	nfs_end_data_update(inode);
 	unlock_kernel();
 	return error;
 }
@@ -886,7 +873,19 @@
 int nfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
 {
 	struct inode *inode = dentry->d_inode;
-	int err = nfs_revalidate_inode(NFS_SERVER(inode), inode);
+	struct nfs_inode *nfsi = NFS_I(inode);
+	int need_atime = nfsi->flags & NFS_INO_INVALID_ATIME;
+	int err;
+
+	if (__IS_FLG(inode, MS_NOATIME))
+		need_atime = 0;
+	else if (__IS_FLG(inode, MS_NODIRATIME) && S_ISDIR(inode->i_mode))
+		need_atime = 0;
+	/* We may force a getattr if the user cares about atime */
+	if (need_atime)
+		err = __nfs_revalidate_inode(NFS_SERVER(inode), inode);
+	else
+		err = nfs_revalidate_inode(NFS_SERVER(inode), inode);
 	if (!err)
 		generic_fillattr(inode, stat);
 	return err;
@@ -921,8 +920,10 @@
 	auth = NFS_CLIENT(inode)->cl_auth;
 	cred = rpcauth_lookupcred(auth, 0);
 	filp->private_data = cred;
-	if (filp->f_mode & FMODE_WRITE)
+	if ((filp->f_mode & FMODE_WRITE) != 0) {
 		nfs_set_mmcred(inode, cred);
+		nfs_begin_data_update(inode);
+	}
 	return 0;
 }
 
@@ -931,6 +932,8 @@
 	struct rpc_cred *cred;
 
 	lock_kernel();
+	if ((filp->f_mode & FMODE_WRITE) != 0)
+		nfs_end_data_update(inode);
 	cred = nfs_file_cred(filp);
 	if (cred)
 		put_rpccred(cred);
@@ -947,6 +950,9 @@
 {
 	int		 status = -ESTALE;
 	struct nfs_fattr fattr;
+	struct nfs_inode *nfsi = NFS_I(inode);
+	unsigned long verifier;
+	unsigned int flags;
 
 	dfprintk(PAGECACHE, "NFS: revalidating (%s/%Ld)\n",
 		inode->i_sb->s_id, (long long)NFS_FILEID(inode));
@@ -956,23 +962,16 @@
  		goto out_nowait;
 	if (NFS_STALE(inode) && inode != inode->i_sb->s_root->d_inode)
  		goto out_nowait;
-	if (NFS_FAKE_ROOT(inode)) {
-		dfprintk(VFS, "NFS: not revalidating fake root\n");
-		status = 0;
-		goto out_nowait;
-	}
 
 	while (NFS_REVALIDATING(inode)) {
 		status = nfs_wait_on_inode(inode, NFS_INO_REVALIDATING);
 		if (status < 0)
 			goto out_nowait;
-		if (time_before(jiffies,NFS_READTIME(inode)+NFS_ATTRTIMEO(inode))) {
-			status = NFS_STALE(inode) ? -ESTALE : 0;
-			goto out_nowait;
-		}
 	}
 	NFS_FLAGS(inode) |= NFS_INO_REVALIDATING;
 
+	/* Protect against RPC races by saving the change attribute */
+	verifier = nfs_save_change_attribute(inode);
 	status = NFS_PROTO(inode)->getattr(inode, &fattr);
 	if (status) {
 		dfprintk(PAGECACHE, "nfs_revalidate_inode: (%s/%Ld) getattr failed, error=%d\n",
@@ -986,13 +985,34 @@
 		goto out;
 	}
 
-	status = nfs_refresh_inode(inode, &fattr);
+	status = nfs_update_inode(inode, &fattr, verifier);
 	if (status) {
 		dfprintk(PAGECACHE, "nfs_revalidate_inode: (%s/%Ld) refresh failed, error=%d\n",
 			 inode->i_sb->s_id,
 			 (long long)NFS_FILEID(inode), status);
 		goto out;
 	}
+	flags = nfsi->flags;
+	/*
+	 * We may need to keep the attributes marked as invalid if
+	 * we raced with nfs_end_attr_update().
+	 */
+	if (verifier == nfsi->cache_change_attribute)
+		nfsi->flags &= ~(NFS_INO_INVALID_ATTR|NFS_INO_INVALID_ATIME);
+	/* Do the page cache invalidation */
+	if (flags & NFS_INO_INVALID_DATA) {
+		if (S_ISREG(inode->i_mode)) {
+			if (filemap_fdatawrite(inode->i_mapping) == 0)
+				filemap_fdatawait(inode->i_mapping);
+			nfs_wb_all(inode);
+		}
+		nfsi->flags &= ~NFS_INO_INVALID_DATA;
+		invalidate_inode_pages2(inode->i_mapping);
+		memset(NFS_COOKIEVERF(inode), 0, sizeof(NFS_COOKIEVERF(inode)));
+		dfprintk(PAGECACHE, "NFS: (%s/%Ld) data cache invalidated\n",
+				inode->i_sb->s_id,
+				(long long)NFS_FILEID(inode));
+	}
 	dfprintk(PAGECACHE, "NFS: (%s/%Ld) revalidation complete\n",
 		inode->i_sb->s_id,
 		(long long)NFS_FILEID(inode));
@@ -1000,41 +1020,104 @@
 	NFS_FLAGS(inode) &= ~NFS_INO_STALE;
 out:
 	NFS_FLAGS(inode) &= ~NFS_INO_REVALIDATING;
-	wake_up(&NFS_I(inode)->nfs_i_wait);
+	wake_up(&nfsi->nfs_i_wait);
  out_nowait:
 	unlock_kernel();
 	return status;
 }
 
-/*
- * nfs_fattr_obsolete - Test if attribute data is newer than cached data
- * @inode: inode
- * @fattr: attributes to test
+/**
+ * nfs_begin_data_update
+ * @inode - pointer to inode
+ * Declare that a set of operations will update file data on the server
+ */
+void nfs_begin_data_update(struct inode *inode)
+{
+	atomic_inc(&NFS_I(inode)->data_updates);
+}
+
+/**
+ * nfs_end_data_update
+ * @inode - pointer to inode
+ * Declare end of the operations that will update file data
+ */
+void nfs_end_data_update(struct inode *inode)
+{
+	struct nfs_inode *nfsi = NFS_I(inode);
+
+	if (atomic_dec_and_test(&nfsi->data_updates)) {
+		nfsi->cache_change_attribute ++;
+		/* Mark the attribute cache for revalidation */
+		nfsi->flags |= NFS_INO_INVALID_ATTR;
+		/* Directories and symlinks: invalidate page cache too */
+		if (S_ISDIR(inode->i_mode) || S_ISLNK(inode->i_mode))
+			nfsi->flags |= NFS_INO_INVALID_DATA;
+	}
+}
+
+/**
+ * nfs_refresh_inode - verify consistency of the inode attribute cache
+ * @inode - pointer to inode
+ * @fattr - updated attributes
  *
- * Avoid stuffing the attribute cache with obsolete information.
- * We always accept updates if the attribute cache timed out, or if
- * fattr->ctime is newer than our cached value.
- * If fattr->ctime matches the cached value, we still accept the update
- * if it increases the file size.
+ * Verifies the attribute cache. If we have just changed the attributes,
+ * so that fattr carries weak cache consistency data, then it may
+ * also update the ctime/mtime/change_attribute.
  */
-static inline
-int nfs_fattr_obsolete(struct inode *inode, struct nfs_fattr *fattr)
+int nfs_refresh_inode(struct inode *inode, struct nfs_fattr *fattr)
 {
 	struct nfs_inode *nfsi = NFS_I(inode);
-	long cdif;
+	loff_t cur_size, new_isize;
+	int data_unstable;
 
-	if (time_after(jiffies, nfsi->read_cache_jiffies + nfsi->attrtimeo))
-		goto out_valid;
-	cdif = fattr->ctime.tv_sec - nfsi->read_cache_ctime.tv_sec;
-	if (cdif == 0)
-		cdif = fattr->ctime.tv_nsec - nfsi->read_cache_ctime.tv_nsec;
-	if (cdif > 0)
-		goto out_valid;
-	/* Ugh... */
-	if (cdif == 0 && fattr->size > nfsi->read_cache_isize)
-		goto out_valid;
-	return -1;
- out_valid:
+	/* Are we in the process of updating data on the server? */
+	data_unstable = nfs_caches_unstable(inode);
+
+	if (fattr->valid & NFS_ATTR_FATTR_V4) {
+		if ((fattr->valid & NFS_ATTR_PRE_CHANGE) != 0
+				&& nfsi->change_attr == fattr->pre_change_attr)
+			nfsi->change_attr = fattr->change_attr;
+		if (!data_unstable && nfsi->change_attr != fattr->change_attr)
+			nfsi->flags |= NFS_INO_INVALID_ATTR;
+	}
+
+	if ((fattr->valid & NFS_ATTR_FATTR) == 0)
+		return 0;
+
+	/* Has the inode gone and changed behind our back? */
+	if (nfsi->fileid != fattr->fileid
+			|| (inode->i_mode & S_IFMT) != (fattr->mode & S_IFMT))
+		return -EIO;
+
+	cur_size = i_size_read(inode);
+ 	new_isize = nfs_size_to_loff_t(fattr->size);
+
+	/* If we have atomic WCC data, we may update some attributes */
+	if ((fattr->valid & NFS_ATTR_WCC) != 0) {
+		if (timespec_equal(&inode->i_ctime, &fattr->pre_ctime))
+			memcpy(&inode->i_ctime, &fattr->ctime, sizeof(inode->i_ctime));
+		if (timespec_equal(&inode->i_mtime, &fattr->pre_mtime))
+			memcpy(&inode->i_mtime, &fattr->mtime, sizeof(inode->i_mtime));
+	}
+
+	/* Verify a few of the more important attributes */
+	if (!data_unstable) {
+		if (!timespec_equal(&inode->i_mtime, &fattr->mtime)
+				|| cur_size != new_isize)
+			nfsi->flags |= NFS_INO_INVALID_ATTR;
+	} else if (S_ISREG(inode->i_mode) && new_isize > cur_size)
+			nfsi->flags |= NFS_INO_INVALID_ATTR;
+
+	/* Have any file permissions changed? */
+	if ((inode->i_mode & S_IALLUGO) != (fattr->mode & S_IALLUGO)
+			|| inode->i_uid != fattr->uid
+			|| inode->i_gid != fattr->gid)
+		nfsi->flags |= NFS_INO_INVALID_ATTR;
+
+	if (!timespec_equal(&inode->i_atime, &fattr->atime))
+		nfsi->flags |= NFS_INO_INVALID_ATIME;
+
+	nfsi->read_cache_jiffies = fattr->timestamp;
 	return 0;
 }
 
@@ -1050,20 +1133,22 @@
  *
  * A very similar scenario holds for the dir cache.
  */
-int
-__nfs_refresh_inode(struct inode *inode, struct nfs_fattr *fattr)
+static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr, unsigned long verifier)
 {
 	struct nfs_inode *nfsi = NFS_I(inode);
 	__u64		new_size;
 	loff_t		new_isize;
-	int		invalid = 0;
-	int		mtime_update = 0;
+	unsigned int	invalid = 0;
 	loff_t		cur_isize;
+	int data_unstable;
 
-	dfprintk(VFS, "NFS: refresh_inode(%s/%ld ct=%d info=0x%x)\n",
-			inode->i_sb->s_id, inode->i_ino,
+	dfprintk(VFS, "NFS: %s(%s/%ld ct=%d info=0x%x)\n",
+			__FUNCTION__, inode->i_sb->s_id, inode->i_ino,
 			atomic_read(&inode->i_count), fattr->valid);
 
+	if ((fattr->valid & NFS_ATTR_FATTR) == 0)
+		return 0;
+
 	/* First successful call after mount, fill real data. */
 	if (NFS_FAKE_ROOT(inode)) {
 		dfprintk(VFS, "NFS: updating fake root\n");
@@ -1072,43 +1157,49 @@
 	}
 
 	if (nfsi->fileid != fattr->fileid) {
-		printk(KERN_ERR "nfs_refresh_inode: inode number mismatch\n"
+		printk(KERN_ERR "%s: inode number mismatch\n"
 		       "expected (%s/0x%Lx), got (%s/0x%Lx)\n",
+		       __FUNCTION__,
 		       inode->i_sb->s_id, (long long)nfsi->fileid,
 		       inode->i_sb->s_id, (long long)fattr->fileid);
 		goto out_err;
 	}
 
-	/* Throw out obsolete READDIRPLUS attributes */
-	if (time_before(fattr->timestamp, NFS_READTIME(inode)))
-		return 0;
 	/*
 	 * Make sure the inode's type hasn't changed.
 	 */
 	if ((inode->i_mode & S_IFMT) != (fattr->mode & S_IFMT))
 		goto out_changed;
 
-	new_size = fattr->size;
- 	new_isize = nfs_size_to_loff_t(fattr->size);
-
-	/* Avoid races */
-	if (nfs_fattr_obsolete(inode, fattr))
-		goto out_nochange;
-
 	/*
 	 * Update the read time so we don't revalidate too often.
 	 */
 	nfsi->read_cache_jiffies = fattr->timestamp;
 
-	/*
-	 * Note: NFS_CACHE_ISIZE(inode) reflects the state of the cache.
-	 *       NOT inode->i_size!!!
-	 */
-	if (nfsi->read_cache_isize != new_size) {
+	/* Are we racing with known updates of the metadata on the server? */
+	data_unstable = ! nfs_verify_change_attribute(inode, verifier);
+
+	/* Check if the file size agrees */
+	new_size = fattr->size;
+ 	new_isize = nfs_size_to_loff_t(fattr->size);
+	cur_isize = i_size_read(inode);
+	if (cur_isize != new_size) {
 #ifdef NFS_DEBUG_VERBOSE
 		printk(KERN_DEBUG "NFS: isize change on %s/%ld\n", inode->i_sb->s_id, inode->i_ino);
 #endif
-		invalid = 1;
+		/*
+		 * If we have pending writebacks, things can get
+		 * messy.
+		 */
+		if (S_ISREG(inode->i_mode) && data_unstable) {
+			if (new_isize > cur_isize) {
+				i_size_write(inode, new_isize);
+				invalid |= NFS_INO_INVALID_ATTR|NFS_INO_INVALID_DATA;
+			}
+		} else {
+			i_size_write(inode, new_isize);
+			invalid |= NFS_INO_INVALID_ATTR|NFS_INO_INVALID_DATA;
+		}
 	}
 
 	/*
@@ -1116,12 +1207,13 @@
 	 *       can change this value in VFS without requiring a
 	 *	 cache revalidation.
 	 */
-	if (!timespec_equal(&nfsi->read_cache_mtime, &fattr->mtime)) {
+	if (!timespec_equal(&inode->i_mtime, &fattr->mtime)) {
+		memcpy(&inode->i_mtime, &fattr->mtime, sizeof(inode->i_mtime));
 #ifdef NFS_DEBUG_VERBOSE
 		printk(KERN_DEBUG "NFS: mtime change on %s/%ld\n", inode->i_sb->s_id, inode->i_ino);
 #endif
-		invalid = 1;
-		mtime_update = 1;
+		if (!data_unstable)
+			invalid |= NFS_INO_INVALID_ATTR|NFS_INO_INVALID_DATA;
 	}
 
 	if ((fattr->valid & NFS_ATTR_FATTR_V4)
@@ -1130,47 +1222,15 @@
 		printk(KERN_DEBUG "NFS: change_attr change on %s/%ld\n",
 		       inode->i_sb->s_id, inode->i_ino);
 #endif
-		invalid = 1;
-	}
-
-	/* Check Weak Cache Consistency data.
-	 * If size and mtime match the pre-operation values, we can
-	 * assume that any attribute changes were caused by our NFS
-         * operation, so there's no need to invalidate the caches.
-         */
-	if ((fattr->valid & NFS_ATTR_PRE_CHANGE)
-	    && nfsi->change_attr == fattr->pre_change_attr) {
-		invalid = 0;
-	}
-	else if ((fattr->valid & NFS_ATTR_WCC)
-	    && nfsi->read_cache_isize == fattr->pre_size
-	    && timespec_equal(&nfsi->read_cache_mtime, &fattr->pre_mtime)) {
-		invalid = 0;
-	}
-
-	/*
-	 * If we have pending writebacks, things can get
-	 * messy.
-	 */
-	cur_isize = i_size_read(inode);
-	if (nfs_have_writebacks(inode) && new_isize < cur_isize)
-		new_isize = cur_isize;
-
-	nfsi->read_cache_ctime = fattr->ctime;
-	inode->i_ctime = fattr->ctime;
-	inode->i_atime = fattr->atime;
-
-	if (mtime_update) {
-		if (invalid)
-			nfsi->cache_mtime_jiffies = fattr->timestamp;
-		nfsi->read_cache_mtime = fattr->mtime;
-		inode->i_mtime = fattr->mtime;
+		nfsi->change_attr = fattr->change_attr;
+		if (!data_unstable)
+			invalid |= NFS_INO_INVALID_ATTR|NFS_INO_INVALID_DATA;
 	}
 
-	nfsi->read_cache_isize = new_size;
-	i_size_write(inode, new_isize);
+	memcpy(&inode->i_ctime, &fattr->ctime, sizeof(inode->i_ctime));
+	memcpy(&inode->i_atime, &fattr->atime, sizeof(inode->i_atime));
 
-	if (inode->i_mode != fattr->mode ||
+	if ((inode->i_mode & S_IALLUGO) != (fattr->mode & S_IALLUGO) ||
 	    inode->i_uid != fattr->uid ||
 	    inode->i_gid != fattr->gid) {
 		struct rpc_cred **cred = &NFS_I(inode)->cache_access.cred;
@@ -1178,11 +1238,9 @@
 			put_rpccred(*cred);
 			*cred = NULL;
 		}
+		invalid |= NFS_INO_INVALID_ATTR;
 	}
 
-	if (fattr->valid & NFS_ATTR_FATTR_V4)
-		nfsi->change_attr = fattr->change_attr;
-
 	inode->i_mode = fattr->mode;
 	inode->i_nlink = fattr->nlink;
 	inode->i_uid = fattr->uid;
@@ -1198,31 +1256,30 @@
  		inode->i_blocks = fattr->du.nfs2.blocks;
  		inode->i_blksize = fattr->du.nfs2.blocksize;
  	}
- 
-	/* Update attrtimeo value */
-	if (invalid) {
+
+	/* Update attrtimeo value if we're out of the unstable period */
+	if (invalid & NFS_INO_INVALID_ATTR) {
 		nfsi->attrtimeo = NFS_MINATTRTIMEO(inode);
 		nfsi->attrtimeo_timestamp = jiffies;
-		invalidate_remote_inode(inode);
-		memset(NFS_COOKIEVERF(inode), 0, sizeof(NFS_COOKIEVERF(inode)));
 	} else if (time_after(jiffies, nfsi->attrtimeo_timestamp+nfsi->attrtimeo)) {
 		if ((nfsi->attrtimeo <<= 1) > NFS_MAXATTRTIMEO(inode))
 			nfsi->attrtimeo = NFS_MAXATTRTIMEO(inode);
 		nfsi->attrtimeo_timestamp = jiffies;
 	}
+	/* Don't invalidate the data if we were to blame */
+	if (!(S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode)
+				|| S_ISLNK(inode->i_mode)))
+		invalid &= ~NFS_INO_INVALID_DATA;
+	nfsi->flags |= invalid;
 
 	return 0;
- out_nochange:
-	if (!timespec_equal(&fattr->atime, &inode->i_atime))
-		inode->i_atime = fattr->atime;
-	return 0;
  out_changed:
 	/*
 	 * Big trouble! The inode has become a different object.
 	 */
 #ifdef NFS_PARANOIA
-	printk(KERN_DEBUG "nfs_refresh_inode: inode %ld mode changed, %07o to %07o\n",
-	       inode->i_ino, inode->i_mode, fattr->mode);
+	printk(KERN_DEBUG "%s: inode %ld mode changed, %07o to %07o\n",
+			__FUNCTION__, inode->i_ino, inode->i_mode, fattr->mode);
 #endif
 	/*
 	 * No need to worry about unhashing the dentry, as the
@@ -1274,6 +1331,8 @@
 	if (!server)
 		return ERR_PTR(-ENOMEM);
 	memset(server, 0, sizeof(struct nfs_server));
+	/* Zero out the NFS state stuff */
+	init_nfsv4_state(server);
 
 	root = &server->fh;
 	memcpy(root, &data->root, sizeof(*root));
@@ -1346,9 +1405,52 @@
 
 #ifdef CONFIG_NFS_V4
 
+static void nfs4_clear_inode(struct inode *);
+
+static struct super_operations nfs4_sops = { 
+	.alloc_inode	= nfs_alloc_inode,
+	.destroy_inode	= nfs_destroy_inode,
+	.write_inode	= nfs_write_inode,
+	.delete_inode	= nfs_delete_inode,
+	.put_super	= nfs_put_super,
+	.statfs		= nfs_statfs,
+	.clear_inode	= nfs4_clear_inode,
+	.umount_begin	= nfs_umount_begin,
+	.show_options	= nfs_show_options,
+};
+
+/*
+ * Clean out any remaining NFSv4 state that might be left over due
+ * to open() calls that passed nfs_atomic_lookup, but failed to call
+ * nfs_open().
+ */
+static void nfs4_clear_inode(struct inode *inode)
+{
+	struct nfs_inode *nfsi = NFS_I(inode);
+
+	while (!list_empty(&nfsi->open_states)) {
+		struct nfs4_state *state;
+		
+		state = list_entry(nfsi->open_states.next,
+				struct nfs4_state,
+				inode_states);
+		dprintk("%s(%s/%Ld): found unclaimed NFSv4 state %p\n",
+				__FUNCTION__,
+				inode->i_sb->s_id,
+				(long long)NFS_FILEID(inode),
+				state);
+		list_del(&state->inode_states);
+		nfs4_put_open_state(state);
+	}
+	/* Now call standard NFS clear_inode() code */
+	nfs_clear_inode(inode);
+}
+
+
 static int nfs4_fill_super(struct super_block *sb, struct nfs4_mount_data *data, int silent)
 {
 	struct nfs_server *server;
+	struct nfs4_client *clp = NULL;
 	struct rpc_xprt *xprt = NULL;
 	struct rpc_clnt *clnt = NULL;
 	struct rpc_timeout timeparms;
@@ -1398,13 +1500,13 @@
 		return -EINVAL;
 	}
 
-	/* Now create transport and client */
-	xprt = xprt_create_proto(proto, &server->addr, &timeparms);
-	if (xprt == NULL) {
-		printk(KERN_WARNING "NFS: cannot create RPC transport.\n");
+	clp = nfs4_get_client(&server->addr.sin_addr);
+	if (!clp) {
+		printk(KERN_WARNING "NFS: failed to create NFS4 client.\n");
 		goto out_fail;
 	}
 
+	/* Now create transport and client */
 	authflavour = RPC_AUTH_UNIX;
 	if (data->auth_flavourlen != 0) {
 		if (data->auth_flavourlen > 1)
@@ -1414,41 +1516,78 @@
 			goto out_fail;
 		}
 	}
-	clnt = rpc_create_client(xprt, server->hostname, &nfs_program,
-				 server->rpc_ops->version, authflavour);
+
+	down_write(&clp->cl_sem);
+	if (clp->cl_rpcclient == NULL) {
+		xprt = xprt_create_proto(proto, &server->addr, &timeparms);
+		if (xprt == NULL) {
+			up_write(&clp->cl_sem);
+			printk(KERN_WARNING "NFS: cannot create RPC transport.\n");
+			goto out_fail;
+		}
+		clnt = rpc_create_client(xprt, server->hostname, &nfs_program,
+				server->rpc_ops->version, authflavour);
+		if (clnt == NULL) {
+			up_write(&clp->cl_sem);
+			printk(KERN_WARNING "NFS: cannot create RPC client.\n");
+			xprt_destroy(xprt);
+			goto out_fail;
+		}
+		clnt->cl_chatty   = 1;
+		clp->cl_rpcclient = clnt;
+		clp->cl_cred = rpcauth_lookupcred(clnt->cl_auth, 0);
+		memcpy(clp->cl_ipaddr, server->ip_addr, sizeof(clp->cl_ipaddr));
+		nfs_idmap_new(clp);
+	}
+	if (list_empty(&clp->cl_superblocks))
+		clear_bit(NFS4CLNT_OK, &clp->cl_state);
+	list_add_tail(&server->nfs4_siblings, &clp->cl_superblocks);
+	clnt = rpc_clone_client(clp->cl_rpcclient);
+	server->nfs4_state = clp;
+	up_write(&clp->cl_sem);
+	clp = NULL;
+
 	if (clnt == NULL) {
 		printk(KERN_WARNING "NFS: cannot create RPC client.\n");
-		xprt_destroy(xprt);
-		goto out_fail;
+		goto out_remove_list;
+	}
+	if (server->nfs4_state->cl_idmap == NULL) {
+		printk(KERN_WARNING "NFS: failed to create idmapper.\n");
+		goto out_shutdown;
 	}
 
 	clnt->cl_intr     = (server->flags & NFS4_MOUNT_INTR) ? 1 : 0;
 	clnt->cl_softrtry = (server->flags & NFS4_MOUNT_SOFT) ? 1 : 0;
-	clnt->cl_chatty   = 1;
 	server->client    = clnt;
 
+	if (clnt->cl_auth->au_flavor != authflavour) {
+		if (rpcauth_create(authflavour, clnt) == NULL) {
+			printk(KERN_WARNING "NFS: couldn't create credcache!\n");
+			goto out_shutdown;
+		}
+	}
+
 	/* Fire up rpciod if not yet running */
 	if (rpciod_up() != 0) {
 		printk(KERN_WARNING "NFS: couldn't start rpciod!\n");
 		goto out_shutdown;
 	}
 
-	if (create_nfsv4_state(server, data))
-		goto out_shutdown;
-
-	if ((server->idmap = nfs_idmap_new(server)) == NULL)
-		printk(KERN_WARNING "NFS: couldn't start IDmap\n");
-
+	sb->s_op = &nfs4_sops;
 	err = nfs_sb_init(sb, authflavour);
 	if (err == 0)
 		return 0;
 	rpciod_down();
-	destroy_nfsv4_state(server);
-	if (server->idmap != NULL)
-		nfs_idmap_delete(server);
 out_shutdown:
 	rpc_shutdown_client(server->client);
+out_remove_list:
+	down_write(&server->nfs4_state->cl_sem);
+	list_del_init(&server->nfs4_siblings);
+	up_write(&server->nfs4_state->cl_sem);
+	destroy_nfsv4_state(server);
 out_fail:
+	if (clp)
+		nfs4_put_client(clp);
 	return err;
 }
 
@@ -1505,6 +1644,8 @@
 	if (!server)
 		return ERR_PTR(-ENOMEM);
 	memset(server, 0, sizeof(struct nfs_server));
+	/* Zero out the NFS state stuff */
+	init_nfsv4_state(server);
 
 	if (data->version != NFS4_MOUNT_VERSION) {
 		printk("nfs warning: mount version %s than kernel\n",
@@ -1625,6 +1766,7 @@
 		INIT_LIST_HEAD(&nfsi->dirty);
 		INIT_LIST_HEAD(&nfsi->commit);
 		INIT_RADIX_TREE(&nfsi->nfs_page_tree, GFP_ATOMIC);
+		atomic_set(&nfsi->data_updates, 0);
 		nfsi->ndirty = 0;
 		nfsi->ncommit = 0;
 		nfsi->npages = 0;
--- diff/fs/nfs/nfs3proc.c	2003-10-27 09:20:39.000000000 +0000
+++ source/fs/nfs/nfs3proc.c	2004-02-09 10:39:56.000000000 +0000
@@ -15,6 +15,7 @@
 #include <linux/nfs3.h>
 #include <linux/nfs_fs.h>
 #include <linux/nfs_page.h>
+#include <linux/lockd/bind.h>
 #include <linux/smp_lock.h>
 
 #define NFSDBG_FACILITY		NFSDBG_PROC
@@ -67,20 +68,6 @@
 	return 1;
 }
 
-static void
-nfs3_write_refresh_inode(struct inode *inode, struct nfs_fattr *fattr)
-{
-	if (fattr->valid & NFS_ATTR_FATTR) {
-		if (!(fattr->valid & NFS_ATTR_WCC)) {
-			fattr->pre_size  = NFS_CACHE_ISIZE(inode);
-			fattr->pre_mtime = NFS_CACHE_MTIME(inode);
-			fattr->pre_ctime = NFS_CACHE_CTIME(inode);
-			fattr->valid |= NFS_ATTR_WCC;
-		}
-		nfs_refresh_inode(inode, fattr);
-	}
-}
-
 static struct rpc_cred *
 nfs_cred(struct inode *inode, struct file *filp)
 {
@@ -279,7 +266,7 @@
 	msg.rpc_cred = nfs_cred(inode, filp);
 	status = rpc_call_sync(NFS_CLIENT(inode), &msg, rpcflags);
 	if (status >= 0)
-		nfs3_write_refresh_inode(inode, fattr);
+		nfs_refresh_inode(inode, fattr);
 	dprintk("NFS reply write: %d\n", status);
 	return status < 0? status : wdata->res.count;
 }
@@ -302,7 +289,7 @@
 	msg.rpc_cred = nfs_cred(inode, filp);
 	status = rpc_call_sync(NFS_CLIENT(inode), &msg, 0);
 	if (status >= 0)
-		nfs3_write_refresh_inode(inode, fattr);
+		nfs_refresh_inode(inode, fattr);
 	dprintk("NFS reply commit: %d\n", status);
 	return status;
 }
@@ -776,12 +763,13 @@
 static void
 nfs3_write_done(struct rpc_task *task)
 {
-	struct nfs_write_data *data = (struct nfs_write_data *) task->tk_calldata;
+	struct nfs_write_data *data;
 
 	if (nfs3_async_handle_jukebox(task))
 		return;
+	data = (struct nfs_write_data *)task->tk_calldata;
 	if (task->tk_status >= 0)
-		nfs3_write_refresh_inode(data->inode, data->res.fattr);
+		nfs_refresh_inode(data->inode, data->res.fattr);
 	nfs_writeback_done(task);
 }
 
@@ -834,12 +822,13 @@
 static void
 nfs3_commit_done(struct rpc_task *task)
 {
-	struct nfs_write_data *data = (struct nfs_write_data *) task->tk_calldata;
+	struct nfs_write_data *data;
 
 	if (nfs3_async_handle_jukebox(task))
 		return;
+	data = (struct nfs_write_data *)task->tk_calldata;
 	if (task->tk_status >= 0)
-		nfs3_write_refresh_inode(data->inode, data->res.fattr);
+		nfs_refresh_inode(data->inode, data->res.fattr);
 	nfs_commit_done(task);
 }
 
@@ -896,8 +885,16 @@
 	return 1;
 }
 
+static int
+nfs3_proc_lock(struct file *filp, int cmd, struct file_lock *fl)
+{
+	return nlmclnt_proc(filp->f_dentry->d_inode, cmd, fl);
+}
+
 struct nfs_rpc_ops	nfs_v3_clientops = {
 	.version	= 3,			/* protocol version */
+	.dentry_ops	= &nfs_dentry_operations,
+	.dir_inode_ops	= &nfs_dir_inode_operations,
 	.getroot	= nfs3_proc_get_root,
 	.getattr	= nfs3_proc_getattr,
 	.setattr	= nfs3_proc_setattr,
@@ -929,4 +926,5 @@
 	.file_release	= nfs_release,
 	.request_init	= nfs3_request_init,
 	.request_compatible = nfs3_request_compatible,
+	.lock		= nfs3_proc_lock,
 };
--- diff/fs/nfs/nfs4proc.c	2003-10-27 09:20:39.000000000 +0000
+++ source/fs/nfs/nfs4proc.c	2004-02-09 10:39:56.000000000 +0000
@@ -45,19 +45,21 @@
 #include <linux/nfs_fs.h>
 #include <linux/nfs_page.h>
 #include <linux/smp_lock.h>
+#include <linux/namei.h>
 
 #define NFSDBG_FACILITY		NFSDBG_PROC
 
+#define NFS4_POLL_RETRY_TIME	(15*HZ)
+
 #define GET_OP(cp,name)		&cp->ops[cp->req_nops].u.name
 #define OPNUM(cp)		cp->ops[cp->req_nops].opnum
 
+static int nfs4_async_handle_error(struct rpc_task *, struct nfs_server *);
 extern u32 *nfs4_decode_dirent(u32 *p, struct nfs_entry *entry, int plus);
 extern struct rpc_procinfo nfs4_procedures[];
 
 extern nfs4_stateid zero_stateid;
 
-static spinlock_t renew_lock = SPIN_LOCK_UNLOCKED;
-
 static void
 nfs4_setup_compound(struct nfs4_compound *cp, struct nfs4_op *ops,
 		    struct nfs_server *server, char *tag)
@@ -179,44 +181,16 @@
 	| FATTR4_WORD1_SPACE_TOTAL
 };
 
-u32 nfs4_fsinfo_bitmap[2] = {
-	FATTR4_WORD0_MAXFILESIZE
-	| FATTR4_WORD0_MAXREAD
-        | FATTR4_WORD0_MAXWRITE
-	| FATTR4_WORD0_LEASE_TIME,
-	0
-};
-
 u32 nfs4_pathconf_bitmap[2] = {
 	FATTR4_WORD0_MAXLINK
 	| FATTR4_WORD0_MAXNAME,
 	0
 };
 
-/* mount bitmap: fattr bitmap + lease time */
-u32 nfs4_mount_bitmap[2] = {
-	FATTR4_WORD0_TYPE
-	| FATTR4_WORD0_CHANGE
-	| FATTR4_WORD0_SIZE
-	| FATTR4_WORD0_FSID
-	| FATTR4_WORD0_FILEID
-	| FATTR4_WORD0_LEASE_TIME,
-	FATTR4_WORD1_MODE
-	| FATTR4_WORD1_NUMLINKS
-	| FATTR4_WORD1_OWNER
-	| FATTR4_WORD1_OWNER_GROUP
-	| FATTR4_WORD1_RAWDEV
-	| FATTR4_WORD1_SPACE_USED
-	| FATTR4_WORD1_TIME_ACCESS
-	| FATTR4_WORD1_TIME_METADATA
-	| FATTR4_WORD1_TIME_MODIFY
-};
-
 static inline void
 __nfs4_setup_getattr(struct nfs4_compound *cp, u32 *bitmap,
 		     struct nfs_fattr *fattr,
 		     struct nfs_fsstat *fsstat,
-		     struct nfs_fsinfo *fsinfo,
 		     struct nfs_pathconf *pathconf)
 {
         struct nfs4_getattr *getattr = GET_OP(cp, getattr);
@@ -224,7 +198,6 @@
         getattr->gt_bmval = bitmap;
         getattr->gt_attrs = fattr;
 	getattr->gt_fsstat = fsstat;
-	getattr->gt_fsinfo = fsinfo;
 	getattr->gt_pathconf = pathconf;
 
         OPNUM(cp) = OP_GETATTR;
@@ -236,16 +209,7 @@
 		struct nfs_fattr *fattr)
 {
 	__nfs4_setup_getattr(cp, nfs4_fattr_bitmap, fattr,
-			NULL, NULL, NULL);
-}
-
-static void
-nfs4_setup_getrootattr(struct nfs4_compound *cp,
-		struct nfs_fattr *fattr,
-		struct nfs_fsinfo *fsinfo)
-{
-	__nfs4_setup_getattr(cp, nfs4_mount_bitmap,
-			fattr, NULL, fsinfo, NULL);
+			NULL, NULL);
 }
 
 static void
@@ -253,15 +217,7 @@
 		struct nfs_fsstat *fsstat)
 {
 	__nfs4_setup_getattr(cp, nfs4_statfs_bitmap,
-			NULL, fsstat, NULL, NULL);
-}
-
-static void
-nfs4_setup_fsinfo(struct nfs4_compound *cp,
-		struct nfs_fsinfo *fsinfo)
-{
-	__nfs4_setup_getattr(cp, nfs4_fsinfo_bitmap,
-			NULL, NULL, fsinfo, NULL);
+			NULL, fsstat, NULL);
 }
 
 static void
@@ -269,7 +225,7 @@
 		struct nfs_pathconf *pathconf)
 {
 	__nfs4_setup_getattr(cp, nfs4_pathconf_bitmap,
-			NULL, NULL, NULL, pathconf);
+			NULL, NULL, pathconf);
 }
 
 static void
@@ -429,18 +385,6 @@
 }
 
 static void
-nfs4_setup_renew(struct nfs4_compound *cp)
-{
-	struct nfs4_client **client_state = GET_OP(cp, renew);
-
-	*client_state = cp->server->nfs4_state;
-
-	OPNUM(cp) = OP_RENEW;
-	cp->req_nops++;
-	cp->renew_index = cp->req_nops;
-}
-
-static void
 nfs4_setup_restorefh(struct nfs4_compound *cp)
 {
         OPNUM(cp) = OP_RESTOREFH;
@@ -455,47 +399,13 @@
 }
 
 static void
-nfs4_setup_setclientid(struct nfs4_compound *cp, u32 program, unsigned short port)
-{
-	struct nfs4_setclientid *setclientid = GET_OP(cp, setclientid);
-	struct nfs_server *server = cp->server;
-	struct timespec tv;
-	u32 *p;
-
-	tv = CURRENT_TIME;
- 	p = (u32 *)setclientid->sc_verifier.data;
-	*p++ = tv.tv_sec;
-	*p++ = tv.tv_nsec;
-	setclientid->sc_name = server->ip_addr;
-	sprintf(setclientid->sc_netid, "udp");
-	sprintf(setclientid->sc_uaddr, "%s.%d.%d", server->ip_addr, port >> 8, port & 255);
-	setclientid->sc_prog = program;
-	setclientid->sc_cb_ident = 0;
-	setclientid->sc_state = server->nfs4_state;
-	
-	OPNUM(cp) = OP_SETCLIENTID;
-	cp->req_nops++;
-}
-
-static void
-nfs4_setup_setclientid_confirm(struct nfs4_compound *cp)
-{
-	struct nfs4_client **client_state = GET_OP(cp, setclientid_confirm);
-
-	*client_state = cp->server->nfs4_state;
-
-	OPNUM(cp) = OP_SETCLIENTID_CONFIRM;
-	cp->req_nops++;
-	cp->renew_index = cp->req_nops;
-}
-
-static void
 renew_lease(struct nfs_server *server, unsigned long timestamp)
 {
-	spin_lock(&renew_lock);
-	if (time_before(server->last_renewal,timestamp))
-		server->last_renewal = timestamp;
-	spin_unlock(&renew_lock);
+	struct nfs4_client *clp = server->nfs4_state;
+	spin_lock(&clp->cl_lock);
+	if (time_before(clp->cl_last_renewal,timestamp))
+		clp->cl_last_renewal = timestamp;
+	spin_unlock(&clp->cl_lock);
 }
 
 static inline void
@@ -552,6 +462,57 @@
 	}
 }
 
+/*
+ * OPEN_RECLAIM:
+ * 	reclaim state on the server after a reboot.
+ * 	Assumes caller is holding the sp->so_sem
+ */
+int
+nfs4_open_reclaim(struct nfs4_state_owner *sp, struct nfs4_state *state)
+{
+	struct inode *inode = state->inode;
+	struct nfs_server *server = NFS_SERVER(inode);
+	struct nfs_fattr fattr = {
+		.valid = 0,
+	};
+	struct nfs4_change_info d_cinfo;
+	struct nfs4_getattr     f_getattr = {
+		.gt_bmval       = nfs4_fattr_bitmap,
+		.gt_attrs       = &fattr,
+	};
+
+	struct nfs_open_reclaimargs o_arg = {
+		.fh = NFS_FH(inode),
+		.seqid = sp->so_seqid,
+		.id = sp->so_id,
+		.share_access = state->state,
+		.clientid = server->nfs4_state->cl_clientid,
+		.claim = NFS4_OPEN_CLAIM_PREVIOUS,
+		.f_getattr = &f_getattr,
+	};
+	struct nfs_openres o_res = {
+		.cinfo = &d_cinfo,
+		.f_getattr = &f_getattr,
+		.server = server,	/* Grrr */
+	};
+	struct rpc_message msg = {
+		.rpc_proc       = &nfs4_procedures[NFSPROC4_CLNT_OPEN_RECLAIM],
+		.rpc_argp       = &o_arg,
+		.rpc_resp	= &o_res,
+		.rpc_cred	= sp->so_cred,
+	};
+	int status;
+
+	status = rpc_call_sync(server->client, &msg, 0);
+	nfs4_increment_seqid(status, sp);
+	/* Update the inode attributes */
+	nfs_refresh_inode(inode, &fattr);
+	return status;
+}
+
+/*
+ * Returns an nfs4_state + an referenced inode
+ */
 struct nfs4_state *
 nfs4_do_open(struct inode *dir, struct qstr *name, int flags, struct iattr *sattr, struct rpc_cred *cred)
 {
@@ -578,7 +539,6 @@
 	struct nfs_openargs o_arg = {
 		.fh             = NFS_FH(dir),
 		.share_access   = flags & (FMODE_READ|FMODE_WRITE),
-		.clientid       = NFS_SERVER(dir)->nfs4_state->cl_clientid,
 		.opentype       = (flags & O_CREAT) ? NFS4_OPEN_CREATE : NFS4_OPEN_NOCREATE,
 		.createmode     = (flags & O_EXCL) ? NFS4_CREATE_EXCLUSIVE : NFS4_CREATE_UNCHECKED,
 		.name           = name,
@@ -599,6 +559,7 @@
 		.rpc_cred	= cred,
 	};
 
+retry:
 	status = -ENOMEM;
 	if (!(sp = nfs4_get_state_owner(NFS_SERVER(dir), cred))) {
 		dprintk("nfs4_do_open: nfs4_get_state_owner failed!\n");
@@ -615,12 +576,12 @@
 	down(&sp->so_sema);
 	o_arg.seqid = sp->so_seqid;
 	o_arg.id = sp->so_id;
+	o_arg.clientid = NFS_SERVER(dir)->nfs4_state->cl_clientid,
 
 	status = rpc_call_sync(server->client, &msg, 0);
-	if (status) {
-		goto out_up;
-	}
 	nfs4_increment_seqid(status, sp);
+	if (status)
+		goto out_up;
 	process_cinfo(&d_cinfo, &d_attr);
 	nfs_refresh_inode(dir, &d_attr);
 
@@ -637,9 +598,7 @@
 			.fh             = &o_res.fh,
 			.seqid          = sp->so_seqid,
 		};
-		struct nfs_open_confirmres oc_res = {
-			.status         = 0,
-		};
+		struct nfs_open_confirmres oc_res;
 		struct 	rpc_message msg = {
 			.rpc_proc       = &nfs4_procedures[NFSPROC4_CLNT_OPEN_CONFIRM],
 			.rpc_argp       = &oc_arg,
@@ -649,27 +608,54 @@
 
 		memcpy(&oc_arg.stateid, &o_res.stateid, sizeof(oc_arg.stateid));
 		status = rpc_call_sync(server->client, &msg, 0);
+		nfs4_increment_seqid(status, sp);
 		if (status)
 			goto out_up;
-		nfs4_increment_seqid(status, sp);
 		memcpy(&state->stateid, &oc_res.stateid, sizeof(state->stateid));
 	} else
 		memcpy(&state->stateid, &o_res.stateid, sizeof(state->stateid));
+	spin_lock(&inode->i_lock);
+	if (flags & FMODE_READ)
+		state->nreaders++;
+	if (flags & FMODE_WRITE)
+		state->nwriters++;
 	state->state |= flags & (FMODE_READ|FMODE_WRITE);
-	state->pid = current->pid;
+	spin_unlock(&inode->i_lock);
 
 	up(&sp->so_sema);
 	nfs4_put_state_owner(sp);
-	iput(inode);
 	return state;
 
 out_up:
 	up(&sp->so_sema);
 	nfs4_put_state_owner(sp);
-	if (state)
+	if (state) {
 		nfs4_put_open_state(state);
-	if (inode)
+		state = NULL;
+	}
+	if (inode) {
 		iput(inode);
+		inode = NULL;
+	}
+	/* NOTE: BAD_SEQID means the server and client disagree about the
+	 * book-keeping w.r.t. state-changing operations
+	 * (OPEN/CLOSE/LOCK/LOCKU...)
+	 * It is actually a sign of a bug on the client or on the server.
+	 *
+	 * If we receive a BAD_SEQID error in the particular case of
+	 * doing an OPEN, we assume that nfs4_increment_seqid() will
+	 * have unhashed the old state_owner for us, and that we can
+	 * therefore safely retry using a new one. We should still warn
+	 * the user though...
+	 */
+	if (status == -NFS4ERR_BAD_SEQID) {
+		printk(KERN_WARNING "NFS: v4 server returned a bad sequence-id error!\n");
+		goto retry;
+	}
+	status = nfs4_handle_error(server, status);
+	if (!status)
+		goto retry;
+	BUG_ON(status < -1000 || status > 0);
 out:
 	return ERR_PTR(status);
 }
@@ -698,15 +684,23 @@
                 .rpc_argp       = &arg,
                 .rpc_resp       = &res,
         };
+	int status;
 
+retry:
         fattr->valid = 0;
 
 	if (state)
-		memcpy(&arg.stateid, &state->stateid, sizeof(arg.stateid));
+		nfs4_copy_stateid(&arg.stateid, state, 0);
         else
 		memcpy(&arg.stateid, &zero_stateid, sizeof(arg.stateid));
 
-        return(rpc_call_sync(server->client, &msg, 0));
+        status = rpc_call_sync(server->client, &msg, 0);
+	if (status) {
+		status = nfs4_handle_error(server, status);
+		if (!status)
+			goto retry;
+	}
+	return status;
 }
 
 /* 
@@ -728,9 +722,7 @@
 	struct nfs_closeargs arg = {
 		.fh		= NFS_FH(inode),
 	};
-	struct nfs_closeres res = {
-		.status		= 0,
-	};
+	struct nfs_closeres res;
 	struct rpc_message msg = {
 		.rpc_proc	= &nfs4_procedures[NFSPROC4_CLNT_CLOSE],
 		.rpc_argp	= &arg,
@@ -746,82 +738,111 @@
 	 * the state_owner. we keep this around to process errors
 	 */
 	nfs4_increment_seqid(status, sp);
+	if (!status)
+		memcpy(&state->stateid, &res.stateid, sizeof(state->stateid));
+
+	return status;
+}
+
+int
+nfs4_do_downgrade(struct inode *inode, struct nfs4_state *state, mode_t mode) 
+{
+	struct nfs4_state_owner *sp = state->owner;
+	int status = 0;
+	struct nfs_closeargs arg = {
+		.fh		= NFS_FH(inode),
+		.seqid		= sp->so_seqid,
+		.share_access	= mode,
+	};
+	struct nfs_closeres res;
+	struct rpc_message msg = {
+		.rpc_proc	= &nfs4_procedures[NFSPROC4_CLNT_OPEN_DOWNGRADE],
+		.rpc_argp	= &arg,
+		.rpc_resp	= &res,
+	};
+
+	memcpy(&arg.stateid, &state->stateid, sizeof(arg.stateid));
+	status = rpc_call_sync(NFS_SERVER(inode)->client, &msg, 0);
+	nfs4_increment_seqid(status, sp);
+	if (!status)
+		memcpy(&state->stateid, &res.stateid, sizeof(state->stateid));
 
 	return status;
 }
 
+struct inode *
+nfs4_atomic_open(struct inode *dir, struct dentry *dentry, struct nameidata *nd)
+{
+	struct iattr attr;
+	struct rpc_cred *cred;
+	struct nfs4_state *state;
+
+	if (nd->flags & LOOKUP_CREATE) {
+		attr.ia_mode = nd->intent.open.create_mode;
+		attr.ia_valid = ATTR_MODE;
+		if (!IS_POSIXACL(dir))
+			attr.ia_mode &= ~current->fs->umask;
+	} else {
+		attr.ia_valid = 0;
+		BUG_ON(nd->intent.open.flags & O_CREAT);
+	}
+
+	cred = rpcauth_lookupcred(NFS_SERVER(dir)->client->cl_auth, 0);
+	state = nfs4_do_open(dir, &dentry->d_name, nd->intent.open.flags, &attr, cred);
+	put_rpccred(cred);
+	if (IS_ERR(state))
+		return (struct inode *)state;
+	return state->inode;
+}
+
+int
+nfs4_open_revalidate(struct inode *dir, struct dentry *dentry, int openflags)
+{
+	struct rpc_cred *cred;
+	struct nfs4_state *state;
+	struct inode *inode;
+
+	cred = rpcauth_lookupcred(NFS_SERVER(dir)->client->cl_auth, 0);
+	state = nfs4_do_open(dir, &dentry->d_name, openflags, NULL, cred);
+	put_rpccred(cred);
+	if (state == ERR_PTR(-ENOENT) && dentry->d_inode == 0)
+		return 1;
+	if (IS_ERR(state))
+		return 0;
+	inode = state->inode;
+	if (inode == dentry->d_inode) {
+		iput(inode);
+		return 1;
+	}
+	d_drop(dentry);
+	nfs4_close_state(state, openflags);
+	iput(inode);
+	return 0;
+}
+
 static int
 nfs4_proc_get_root(struct nfs_server *server, struct nfs_fh *fhandle,
 		   struct nfs_fattr *fattr)
 {
-	struct nfs4_client	*clp;
 	struct nfs4_compound	compound;
 	struct nfs4_op		ops[4];
-	struct nfs_fsinfo	fsinfo;
 	unsigned char *		p;
 	struct qstr		q;
 	int			status;
 
-	clp = server->nfs4_state = nfs4_get_client(&server->addr.sin_addr);
-	if (!clp)
-		return -ENOMEM;
-
-	down_write(&clp->cl_sem);
-	/* Has the clientid already been initialized? */
-	if (clp->cl_state != NFS4CLNT_NEW) {
-		/* Yep, so just read the root attributes and the lease time. */
-		fattr->valid = 0;
-		nfs4_setup_compound(&compound, ops, server, "getrootfh");
-		nfs4_setup_putrootfh(&compound);
-		nfs4_setup_getrootattr(&compound, fattr, &fsinfo);
-		nfs4_setup_getfh(&compound, fhandle);
-		if ((status = nfs4_call_compound(&compound, NULL, 0)))
-			goto out_unlock;
-		goto no_setclientid;
-	}
-
-	/* 
-	 * SETCLIENTID.
-	 * Until delegations are imported, we don't bother setting the program
-	 * number and port to anything meaningful.
-	 */
-	nfs4_setup_compound(&compound, ops, server, "setclientid");
-	nfs4_setup_setclientid(&compound, 0, 0);
-	if ((status = nfs4_call_compound(&compound, NULL, 0)))
-		goto out_unlock;
-
-	/*
-	 * SETCLIENTID_CONFIRM, plus root filehandle.
-	 * We also get the lease time here.
-	 */
-	fattr->valid = 0;
-	nfs4_setup_compound(&compound, ops, server, "setclientid_confirm");
-	nfs4_setup_setclientid_confirm(&compound);
-	nfs4_setup_putrootfh(&compound);
-	nfs4_setup_getrootattr(&compound, fattr, &fsinfo);
-	nfs4_setup_getfh(&compound, fhandle);
-	if ((status = nfs4_call_compound(&compound, NULL, 0)))
-		goto out_unlock;
-	clp->cl_state = NFS4CLNT_OK;
-
-no_setclientid:
-	/*
-	 * Now that we have instantiated the clientid and determined
-	 * the lease time, we can initialize the renew daemon for this
-	 * server.
-	 * FIXME: we only need one renewd daemon per server.
-	 */
-	server->lease_time = fsinfo.lease_time * HZ;
-	if ((status = nfs4_init_renewd(server)))
-		goto out_unlock;
-	up_write(&clp->cl_sem);
-	
 	/*
 	 * Now we do a separate LOOKUP for each component of the mount path.
 	 * The LOOKUPs are done separately so that we can conveniently
 	 * catch an ERR_WRONGSEC if it occurs along the way...
 	 */
 	p = server->mnt_path;
+	fattr->valid = 0;
+	nfs4_setup_compound(&compound, ops, server, "getrootfh");
+	nfs4_setup_putrootfh(&compound);
+	nfs4_setup_getattr(&compound, fattr);
+	nfs4_setup_getfh(&compound, fhandle);
+	if ((status = nfs4_call_compound(&compound, NULL, 0)))
+		goto out;
 	for (;;) {
 		while (*p == '/')
 			p++;
@@ -847,10 +868,7 @@
 		}
 		break;
 	}
-	return status;
-out_unlock:
-	up_write(&clp->cl_sem);
-	nfs4_put_client(clp);
+out:
 	return status;
 }
 
@@ -892,28 +910,38 @@
 	struct inode *		inode = dentry->d_inode;
 	int			size_change = sattr->ia_valid & ATTR_SIZE;
 	struct nfs4_state	*state = NULL;
-	int			status;
+	int need_iput = 0;
+	int status;
 
 	fattr->valid = 0;
 	
 	if (size_change) {
 		struct rpc_cred *cred = rpcauth_lookupcred(NFS_SERVER(inode)->client->cl_auth, 0);
-		state = nfs4_do_open(dentry->d_parent->d_inode, 
+		state = nfs4_find_state(inode, cred, FMODE_WRITE);
+		if (!state) {
+			state = nfs4_do_open(dentry->d_parent->d_inode, 
 				&dentry->d_name, FMODE_WRITE, NULL, cred);
+			need_iput = 1;
+		}
 		put_rpccred(cred);
 		if (IS_ERR(state))
 			return PTR_ERR(state);
 
 		if (state->inode != inode) {
-			printk(KERN_WARNING "nfs: raced in setattr, returning -EIO\n");
-			nfs4_put_open_state(state);
-			return -EIO;
+			printk(KERN_WARNING "nfs: raced in setattr (%p != %p), returning -EIO\n", inode, state->inode);
+			status = -EIO;
+			goto out;
 		}
 	}
 	status = nfs4_do_setattr(NFS_SERVER(inode), fattr,
 			NFS_FH(inode), sattr, state);
-	if (state)
-		nfs4_put_open_state(state);
+out:
+	if (state) {
+		inode = state->inode;
+		nfs4_close_state(state, FMODE_WRITE);
+		if (need_iput)
+			iput(inode);
+	}
 	return status;
 }
 
@@ -1051,7 +1079,7 @@
 	if (filp) {
 		struct nfs4_state *state;
 		state = (struct nfs4_state *)filp->private_data;
-		memcpy(&rdata->args.stateid, &state->stateid, sizeof(rdata->args.stateid));
+		nfs4_copy_stateid(&rdata->args.stateid, state, rdata->lockowner);
 		msg.rpc_cred = state->owner->so_cred;
 	} else {
 		memcpy(&rdata->args.stateid, &zero_stateid, sizeof(rdata->args.stateid));
@@ -1060,12 +1088,8 @@
 
 	fattr->valid = 0;
 	status = rpc_call_sync(server->client, &msg, flags);
-	if (!status) {
+	if (!status)
 		renew_lease(server, timestamp);
-		/* Check cache consistency */
-		if (fattr->change_attr != NFS_CHANGE_ATTR(inode))
-			nfs_zap_caches(inode);
-	}
 	dprintk("NFS reply read: %d\n", status);
 	return status;
 }
@@ -1093,7 +1117,7 @@
 	if (filp) {
 		struct nfs4_state *state;
 		state = (struct nfs4_state *)filp->private_data;
-		memcpy(&wdata->args.stateid, &state->stateid, sizeof(wdata->args.stateid));
+		nfs4_copy_stateid(&wdata->args.stateid, state, wdata->lockowner);
 		msg.rpc_cred = state->owner->so_cred;
 	} else {
 		memcpy(&wdata->args.stateid, &zero_stateid, sizeof(wdata->args.stateid));
@@ -1102,7 +1126,6 @@
 
 	fattr->valid = 0;
 	status = rpc_call_sync(server->client, &msg, rpcflags);
-	NFS_CACHEINV(inode);
 	dprintk("NFS reply write: %d\n", status);
 	return status;
 }
@@ -1129,7 +1152,7 @@
 	if (filp) {
 		struct nfs4_state *state;
 		state = (struct nfs4_state *)filp->private_data;
-		memcpy(&cdata->args.stateid, &state->stateid, sizeof(cdata->args.stateid));
+		nfs4_copy_stateid(&cdata->args.stateid, state, cdata->lockowner);
 		msg.rpc_cred = state->owner->so_cred;
 	} else {
 		memcpy(&cdata->args.stateid, &zero_stateid, sizeof(cdata->args.stateid));
@@ -1169,18 +1192,18 @@
 	state = nfs4_do_open(dir, name, flags, sattr, cred);
 	put_rpccred(cred);
 	if (!IS_ERR(state)) {
-		inode = igrab(state->inode);
+		inode = state->inode;
 		if (flags & O_EXCL) {
 			struct nfs_fattr fattr;
 			int status;
 			status = nfs4_do_setattr(NFS_SERVER(dir), &fattr,
 			                     NFS_FH(inode), sattr, state);
 			if (status != 0) {
+				nfs4_close_state(state, flags);
 				iput(inode);
 				inode = ERR_PTR(status);
 			}
 		}
-		nfs4_put_open_state(state);
 	} else
 		inode = (struct inode *)state;
 	return inode;
@@ -1446,14 +1469,14 @@
 nfs4_proc_fsinfo(struct nfs_server *server, struct nfs_fh *fhandle,
 		 struct nfs_fsinfo *fsinfo)
 {
-	struct nfs4_compound compound;
-	struct nfs4_op ops[2];
+	struct rpc_message msg = {
+		.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_FSINFO],
+		.rpc_argp = fhandle,
+		.rpc_resp = fsinfo,
+	};
 
 	memset(fsinfo, 0, sizeof(*fsinfo));
-	nfs4_setup_compound(&compound, ops, server, "statfs");
-	nfs4_setup_putfh(&compound, fhandle);
-	nfs4_setup_fsinfo(&compound, fsinfo);
-	return nfs4_call_compound(&compound, NULL, 0);
+	return rpc_call_sync(server->client, &msg, 0);
 }
 
 static int
@@ -1471,19 +1494,31 @@
 }
 
 static void
+nfs4_restart_read(struct rpc_task *task)
+{
+	struct nfs_read_data *data = (struct nfs_read_data *)task->tk_calldata;
+	struct nfs_page *req;
+
+	rpc_restart_call(task);
+	req = nfs_list_entry(data->pages.next);
+	if (req->wb_state)
+		nfs4_copy_stateid(&data->args.stateid, req->wb_state, req->wb_lockowner);
+	else
+		memcpy(&data->args.stateid, &zero_stateid, sizeof(data->args.stateid));
+}
+
+static void
 nfs4_read_done(struct rpc_task *task)
 {
 	struct nfs_read_data *data = (struct nfs_read_data *) task->tk_calldata;
 	struct inode *inode = data->inode;
-	struct nfs_fattr *fattr = data->res.fattr;
 
+	if (nfs4_async_handle_error(task, NFS_SERVER(inode)) == -EAGAIN) {
+		task->tk_action = nfs4_restart_read;
+		return;
+	}
 	if (task->tk_status > 0)
 		renew_lease(NFS_SERVER(inode), data->timestamp);
-	/* Check cache consistency */
-	if (fattr->change_attr != NFS_CHANGE_ATTR(inode))
-		nfs_zap_caches(inode);
-	if (fattr->bitmap[1] & FATTR4_WORD1_TIME_ACCESS)
-		inode->i_atime = fattr->atime;
 	/* Call back common NFS readpage processing */
 	nfs_readpage_result(task);
 }
@@ -1512,8 +1547,9 @@
 	data->res.eof     = 0;
 	data->timestamp   = jiffies;
 
+	data->lockowner = req->wb_lockowner;
 	if (req->wb_state)
-		memcpy(&data->args.stateid, &req->wb_state->stateid, sizeof(data->args.stateid));
+		nfs4_copy_stateid(&data->args.stateid, req->wb_state, req->wb_lockowner);
 	else
 		memcpy(&data->args.stateid, &zero_stateid, sizeof(data->args.stateid));
 
@@ -1530,18 +1566,17 @@
 }
 
 static void
-nfs4_write_refresh_inode(struct inode *inode, struct nfs_fattr *fattr)
+nfs4_restart_write(struct rpc_task *task)
 {
-	/* Check cache consistency */
-	if (fattr->pre_change_attr != NFS_CHANGE_ATTR(inode))
-		nfs_zap_caches(inode);
-	NFS_CHANGE_ATTR(inode) = fattr->change_attr;
-	if (fattr->bitmap[1] & FATTR4_WORD1_SPACE_USED)
-		inode->i_blocks = (fattr->du.nfs3.used + 511) >> 9;
-	if (fattr->bitmap[1] & FATTR4_WORD1_TIME_METADATA)
-		inode->i_ctime = fattr->ctime;
-	if (fattr->bitmap[1] & FATTR4_WORD1_TIME_MODIFY)
-		inode->i_mtime = fattr->mtime;
+	struct nfs_write_data *data = (struct nfs_write_data *)task->tk_calldata;
+	struct nfs_page *req;
+
+	rpc_restart_call(task);
+	req = nfs_list_entry(data->pages.next);
+	if (req->wb_state)
+		nfs4_copy_stateid(&data->args.stateid, req->wb_state, req->wb_lockowner);
+	else
+		memcpy(&data->args.stateid, &zero_stateid, sizeof(data->args.stateid));
 }
 
 static void
@@ -1550,9 +1585,12 @@
 	struct nfs_write_data *data = (struct nfs_write_data *) task->tk_calldata;
 	struct inode *inode = data->inode;
 	
+	if (nfs4_async_handle_error(task, NFS_SERVER(inode)) == -EAGAIN) {
+		task->tk_action = nfs4_restart_write;
+		return;
+	}
 	if (task->tk_status >= 0)
 		renew_lease(NFS_SERVER(inode), data->timestamp);
-	nfs4_write_refresh_inode(inode, data->res.fattr);
 	/* Call back common NFS writeback processing */
 	nfs_writeback_done(task);
 }
@@ -1591,8 +1629,9 @@
 	data->res.verf    = &data->verf;
 	data->timestamp   = jiffies;
 
+	data->lockowner = req->wb_lockowner;
 	if (req->wb_state)
-		memcpy(&data->args.stateid, &req->wb_state->stateid, sizeof(data->args.stateid));
+		nfs4_copy_stateid(&data->args.stateid, req->wb_state, req->wb_lockowner);
 	else
 		memcpy(&data->args.stateid, &zero_stateid, sizeof(data->args.stateid));
 
@@ -1612,8 +1651,12 @@
 nfs4_commit_done(struct rpc_task *task)
 {
 	struct nfs_write_data *data = (struct nfs_write_data *) task->tk_calldata;
+	struct inode *inode = data->inode;
 	
-	nfs4_write_refresh_inode(data->inode, data->res.fattr);
+	if (nfs4_async_handle_error(task, NFS_SERVER(inode)) == -EAGAIN) {
+		task->tk_action = nfs4_restart_write;
+		return;
+	}
 	/* Call back common NFS writeback processing */
 	nfs_commit_done(task);
 }
@@ -1651,55 +1694,58 @@
 }
 
 /*
- * nfs4_proc_renew(): This is not one of the nfs_rpc_ops; it is a special
+ * nfs4_proc_async_renew(): This is not one of the nfs_rpc_ops; it is a special
  * standalone procedure for queueing an asynchronous RENEW.
  */
-struct renew_desc {
-	struct rpc_task		task;
-	struct nfs4_compound	compound;
-	struct nfs4_op		ops[1];
-};
-
 static void
 renew_done(struct rpc_task *task)
 {
-	struct nfs4_compound *cp = (struct nfs4_compound *) task->tk_msg.rpc_argp;
-	process_lease(cp);
+	struct nfs4_client *clp = (struct nfs4_client *)task->tk_msg.rpc_argp;
+	unsigned long timestamp = (unsigned long)task->tk_calldata;
+
+	if (task->tk_status < 0) {
+		switch (task->tk_status) {
+			case -NFS4ERR_STALE_CLIENTID:
+				nfs4_schedule_state_recovery(clp);
+				return;
+		}
+	}
+	spin_lock(&clp->cl_lock);
+	if (time_before(clp->cl_last_renewal,timestamp))
+		clp->cl_last_renewal = timestamp;
+	spin_unlock(&clp->cl_lock);
 }
 
-static void
-renew_release(struct rpc_task *task)
+int
+nfs4_proc_async_renew(struct nfs4_client *clp)
 {
-	kfree(task->tk_calldata);
+	struct rpc_message msg = {
+		.rpc_proc	= &nfs4_procedures[NFSPROC4_CLNT_RENEW],
+		.rpc_argp	= clp,
+		.rpc_cred	= clp->cl_cred,
+	};
+
+	return rpc_call_async(clp->cl_rpcclient, &msg, RPC_TASK_SOFT,
+			renew_done, (void *)jiffies);
 }
 
 int
-nfs4_proc_renew(struct nfs_server *server)
+nfs4_proc_renew(struct nfs4_client *clp)
 {
-	struct renew_desc *rp;
-	struct rpc_task *task;
-	struct nfs4_compound *cp;
 	struct rpc_message msg = {
-		.rpc_proc	= &nfs4_procedures[NFSPROC4_CLNT_COMPOUND],
+		.rpc_proc	= &nfs4_procedures[NFSPROC4_CLNT_RENEW],
+		.rpc_argp	= clp,
+		.rpc_cred	= clp->cl_cred,
 	};
+	unsigned long now = jiffies;
+	int status;
 
-	rp = (struct renew_desc *) kmalloc(sizeof(*rp), GFP_KERNEL);
-	if (!rp)
-		return -ENOMEM;
-	cp = &rp->compound;
-	task = &rp->task;
-	
-	nfs4_setup_compound(cp, rp->ops, server, "renew");
-	nfs4_setup_renew(cp);
-	
-	msg.rpc_argp = cp;
-	msg.rpc_resp = cp;
-	rpc_init_task(task, server->client, renew_done, RPC_TASK_ASYNC);
-	rpc_call_setup(task, &msg, 0);
-	task->tk_calldata = rp;
-	task->tk_release = renew_release;
-	
-	return rpc_execute(task);
+	status = rpc_call_sync(clp->cl_rpcclient, &msg, 0);
+	spin_lock(&clp->cl_lock);
+	if (time_before(clp->cl_last_renewal,now))
+		clp->cl_last_renewal = now;
+	spin_unlock(&clp->cl_lock);
+	return status;
 }
 
 /*
@@ -1712,43 +1758,32 @@
 nfs4_proc_file_open(struct inode *inode, struct file *filp)
 {
 	struct dentry *dentry = filp->f_dentry;
-	struct inode *dir = dentry->d_parent->d_inode;
-	struct rpc_cred *cred;
 	struct nfs4_state *state;
-	int flags = filp->f_flags;
-	int status = 0;
+	struct rpc_cred *cred;
 
 	dprintk("nfs4_proc_file_open: starting on (%.*s/%.*s)\n",
 	                       (int)dentry->d_parent->d_name.len,
 	                       dentry->d_parent->d_name.name,
 	                       (int)dentry->d_name.len, dentry->d_name.name);
 
-	if ((flags + 1) & O_ACCMODE)
-		flags++;
-
-	lock_kernel();
 
-/*
-* We have already opened the file "O_EXCL" in nfs4_proc_create!!
-* This ugliness will go away with lookup-intent...
-*/
+	/* Find our open stateid */
 	cred = rpcauth_lookupcred(NFS_SERVER(inode)->client->cl_auth, 0);
-	state = nfs4_do_open(dir, &dentry->d_name, flags, NULL, cred);
-	if (IS_ERR(state)) {
-		status = PTR_ERR(state);
-		state = NULL;
-	} else if (filp->f_mode & FMODE_WRITE)
-		nfs_set_mmcred(inode, cred);
-	if (inode != filp->f_dentry->d_inode) {
+	state = nfs4_find_state(inode, cred, filp->f_mode);
+	put_rpccred(cred);
+	if (state == NULL) {
 		printk(KERN_WARNING "NFS: v4 raced in function %s\n", __FUNCTION__);
-		status = -EIO; /* ERACE actually */
-		nfs4_put_open_state(state);
-		state = NULL;
+		return -EIO; /* ERACE actually */
+	}
+	nfs4_close_state(state, filp->f_mode);
+	if (filp->f_mode & FMODE_WRITE) {
+		lock_kernel();
+		nfs_set_mmcred(inode, state->owner->so_cred);
+		nfs_begin_data_update(inode);
+		unlock_kernel();
 	}
 	filp->private_data = state;
-	put_rpccred(cred);
-	unlock_kernel();
-	return status;
+	return 0;
 }
 
 /*
@@ -1760,7 +1795,12 @@
 	struct nfs4_state *state = (struct nfs4_state *)filp->private_data;
 
 	if (state)
-		nfs4_put_open_state(state);
+		nfs4_close_state(state, filp->f_mode);
+	if (filp->f_mode & FMODE_WRITE) {
+		lock_kernel();
+		nfs_end_data_update(inode);
+		unlock_kernel();
+	}
 	return 0;
 }
 
@@ -1780,6 +1820,120 @@
 	state = (struct nfs4_state *)filp->private_data;
 	req->wb_state = state;
 	req->wb_cred = get_rpccred(state->owner->so_cred);
+	req->wb_lockowner = current->files;
+}
+
+static int
+nfs4_async_handle_error(struct rpc_task *task, struct nfs_server *server)
+{
+	struct nfs4_client *clp = server->nfs4_state;
+
+	if (!clp)
+		return 0;
+	switch(task->tk_status) {
+		case -NFS4ERR_STALE_CLIENTID:
+		case -NFS4ERR_STALE_STATEID:
+		case -NFS4ERR_EXPIRED:
+			rpc_sleep_on(&clp->cl_rpcwaitq, task, NULL, NULL);
+			nfs4_schedule_state_recovery(clp);
+			task->tk_status = 0;
+			return -EAGAIN;
+		case -NFS4ERR_GRACE:
+		case -NFS4ERR_DELAY:
+			rpc_delay(task, NFS4_POLL_RETRY_TIME);
+			task->tk_status = 0;
+			return -EAGAIN;
+		case -NFS4ERR_OLD_STATEID:
+			task->tk_status = 0;
+			return -EAGAIN;
+	}
+	return 0;
+}
+
+int
+nfs4_wait_clnt_recover(struct rpc_clnt *clnt, struct nfs4_client *clp)
+{
+	DEFINE_WAIT(wait);
+	sigset_t oldset;
+	int interruptible, res;
+
+	might_sleep();
+
+	rpc_clnt_sigmask(clnt, &oldset);
+	interruptible = TASK_UNINTERRUPTIBLE;
+	if (clnt->cl_intr)
+		interruptible = TASK_INTERRUPTIBLE;
+	do {
+		res = 0;
+		prepare_to_wait(&clp->cl_waitq, &wait, interruptible);
+		nfs4_schedule_state_recovery(clp);
+		if (test_bit(NFS4CLNT_OK, &clp->cl_state) &&
+				!test_bit(NFS4CLNT_SETUP_STATE, &clp->cl_state))
+			break;
+		if (clnt->cl_intr && signalled()) {
+			res = -ERESTARTSYS;
+			break;
+		}
+		schedule();
+	} while(!test_bit(NFS4CLNT_OK, &clp->cl_state));
+	finish_wait(&clp->cl_waitq, &wait);
+	rpc_clnt_sigunmask(clnt, &oldset);
+	return res;
+}
+
+static int
+nfs4_delay(struct rpc_clnt *clnt)
+{
+	sigset_t oldset;
+	int res = 0;
+
+	might_sleep();
+
+	rpc_clnt_sigmask(clnt, &oldset);
+	if (clnt->cl_intr) {
+		set_current_state(TASK_INTERRUPTIBLE);
+		schedule_timeout(NFS4_POLL_RETRY_TIME);
+		if (signalled())
+			res = -ERESTARTSYS;
+	} else {
+		set_current_state(TASK_UNINTERRUPTIBLE);
+		schedule_timeout(NFS4_POLL_RETRY_TIME);
+	}
+	rpc_clnt_sigunmask(clnt, &oldset);
+	return res;
+}
+
+/* This is the error handling routine for processes that are allowed
+ * to sleep.
+ */
+int
+nfs4_handle_error(struct nfs_server *server, int errorcode)
+{
+	struct nfs4_client *clp = server->nfs4_state;
+	int ret = errorcode;
+
+	switch(errorcode) {
+		case -NFS4ERR_STALE_CLIENTID:
+		case -NFS4ERR_STALE_STATEID:
+		case -NFS4ERR_EXPIRED:
+			ret = nfs4_wait_clnt_recover(server->client, clp);
+			break;
+		case -NFS4ERR_GRACE:
+		case -NFS4ERR_DELAY:
+			ret = nfs4_delay(server->client);
+			break;
+		case -NFS4ERR_OLD_STATEID:
+			ret = 0;
+			break;
+		default:
+			if (errorcode <= -1000) {
+				printk(KERN_WARNING "%s could not handle NFSv4 error %d\n",
+						__FUNCTION__, -errorcode);
+				ret = -EIO;
+			}
+	}
+	/* We failed to handle the error */
+	return ret;
 }
 
 
@@ -1796,14 +1950,328 @@
 	state = (struct nfs4_state *)filp->private_data;
 	if (req->wb_state != state)
 		return 0;
+	if (req->wb_lockowner != current->files)
+		return 0;
 	cred = state->owner->so_cred;
 	if (req->wb_cred != cred)
 		return 0;
 	return 1;
 }
 
+int
+nfs4_proc_setclientid(struct nfs4_client *clp,
+		u32 program, unsigned short port)
+{
+	u32 *p;
+	struct nfs4_setclientid setclientid;
+	struct timespec tv;
+	struct rpc_message msg = {
+		.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_SETCLIENTID],
+		.rpc_argp = &setclientid,
+		.rpc_resp = clp,
+		.rpc_cred = clp->cl_cred,
+	};
+
+	tv = CURRENT_TIME;
+	p = (u32*)setclientid.sc_verifier.data;
+	*p++ = (u32)tv.tv_sec;
+	*p = (u32)tv.tv_nsec;
+	setclientid.sc_name = clp->cl_ipaddr;
+	sprintf(setclientid.sc_netid, "tcp");
+	sprintf(setclientid.sc_uaddr, "%s.%d.%d", clp->cl_ipaddr, port >> 8, port & 255);
+	setclientid.sc_prog = htonl(program);
+	setclientid.sc_cb_ident = 0;
+
+	return rpc_call_sync(clp->cl_rpcclient, &msg, 0);
+}
+
+int
+nfs4_proc_setclientid_confirm(struct nfs4_client *clp)
+{
+	struct nfs_fsinfo fsinfo;
+	struct rpc_message msg = {
+		.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_SETCLIENTID_CONFIRM],
+		.rpc_argp = clp,
+		.rpc_resp = &fsinfo,
+		.rpc_cred = clp->cl_cred,
+	};
+	unsigned long now;
+	int status;
+
+	now = jiffies;
+	status = rpc_call_sync(clp->cl_rpcclient, &msg, 0);
+	if (status == 0) {
+		spin_lock(&clp->cl_lock);
+		clp->cl_lease_time = fsinfo.lease_time * HZ;
+		clp->cl_last_renewal = now;
+		spin_unlock(&clp->cl_lock);
+	}
+	return status;
+}
+
+#define NFS4_LOCK_MINTIMEOUT (1 * HZ)
+#define NFS4_LOCK_MAXTIMEOUT (30 * HZ)
+
+/* 
+ * sleep, with exponential backoff, and retry the LOCK operation. 
+ */
+static unsigned long
+nfs4_set_lock_task_retry(unsigned long timeout)
+{
+	current->state = TASK_INTERRUPTIBLE;
+	schedule_timeout(timeout);
+	timeout <<= 1;
+	if (timeout > NFS4_LOCK_MAXTIMEOUT)
+		return NFS4_LOCK_MAXTIMEOUT;
+	return timeout;
+}
+
+static inline int
+nfs4_lck_type(int cmd, struct file_lock *request)
+{
+	/* set lock type */
+	switch (request->fl_type) {
+		case F_RDLCK:
+			return IS_SETLKW(cmd) ? NFS4_READW_LT : NFS4_READ_LT;
+		case F_WRLCK:
+			return IS_SETLKW(cmd) ? NFS4_WRITEW_LT : NFS4_WRITE_LT;
+		case F_UNLCK:
+			return NFS4_WRITE_LT; 
+	}
+	BUG();
+	return 0;
+}
+
+static inline uint64_t
+nfs4_lck_length(struct file_lock *request)
+{
+	if (request->fl_end == OFFSET_MAX)
+		return ~(uint64_t)0;
+	return request->fl_end - request->fl_start + 1;
+}
+
+int
+nfs4_proc_getlk(struct nfs4_state *state, int cmd, struct file_lock *request)
+{
+	struct inode *inode = state->inode;
+	struct nfs_server *server = NFS_SERVER(inode);
+	struct nfs4_client *clp = server->nfs4_state;
+	struct nfs_lockargs arg = {
+		.fh = NFS_FH(inode),
+		.type = nfs4_lck_type(cmd, request),
+		.offset = request->fl_start,
+		.length = nfs4_lck_length(request),
+	};
+	struct nfs_lockres res = {
+		.server = server,
+	};
+	struct rpc_message msg = {
+		.rpc_proc	= &nfs4_procedures[NFSPROC4_CLNT_LOCKT],
+		.rpc_argp       = &arg,
+		.rpc_resp       = &res,
+		.rpc_cred	= state->owner->so_cred,
+	};
+	struct nfs_lowner nlo;
+	struct nfs4_lock_state *lsp;
+	int status;
+
+	nlo.clientid = clp->cl_clientid;
+	down(&state->lock_sema);
+	lsp = nfs4_find_lock_state(state, request->fl_owner);
+	if (lsp)
+		nlo.id = lsp->ls_id; 
+	else {
+		spin_lock(&clp->cl_lock);
+		nlo.id = nfs4_alloc_lockowner_id(clp);
+		spin_unlock(&clp->cl_lock);
+	}
+	arg.u.lockt = &nlo;
+	status = rpc_call_sync(server->client, &msg, 0);
+	if (!status) {
+		request->fl_type = F_UNLCK;
+	} else if (status == -NFS4ERR_DENIED) {
+		int64_t len, start, end;
+		start = res.u.denied.offset;
+		len = res.u.denied.length;
+		end = start + len - 1;
+		if (end < 0 || len == 0)
+			request->fl_end = OFFSET_MAX;
+		else
+			request->fl_end = (loff_t)end;
+		request->fl_start = (loff_t)start;
+		request->fl_type = F_WRLCK;
+		if (res.u.denied.type & 1)
+			request->fl_type = F_RDLCK;
+		request->fl_pid = 0;
+		status = 0;
+	}
+	if (lsp)
+		nfs4_put_lock_state(lsp);
+	up(&state->lock_sema);
+	return status;
+}
+
+int
+nfs4_proc_unlck(struct nfs4_state *state, int cmd, struct file_lock *request)
+{
+	struct inode *inode = state->inode;
+	struct nfs_server *server = NFS_SERVER(inode);
+	struct nfs_lockargs arg = {
+		.fh = NFS_FH(inode),
+		.type = nfs4_lck_type(cmd, request),
+		.offset = request->fl_start,
+		.length = nfs4_lck_length(request),
+	};
+	struct nfs_lockres res = {
+		.server = server,
+	};
+	struct rpc_message msg = {
+		.rpc_proc	= &nfs4_procedures[NFSPROC4_CLNT_LOCKU],
+		.rpc_argp       = &arg,
+		.rpc_resp       = &res,
+		.rpc_cred	= state->owner->so_cred,
+	};
+	struct nfs4_lock_state *lsp;
+	struct nfs_locku_opargs luargs;
+	int status = 0;
+			
+	down(&state->lock_sema);
+	lsp = nfs4_find_lock_state(state, request->fl_owner);
+	if (!lsp)
+		goto out;
+	luargs.seqid = lsp->ls_seqid;
+	memcpy(&luargs.stateid, &lsp->ls_stateid, sizeof(luargs.stateid));
+	arg.u.locku = &luargs;
+	status = rpc_call_sync(server->client, &msg, 0);
+	nfs4_increment_lock_seqid(status, lsp);
+
+	if (status == 0) {
+		memcpy(&lsp->ls_stateid,  &res.u.stateid, 
+				sizeof(lsp->ls_stateid));
+		nfs4_notify_unlck(inode, request, lsp);
+	}
+	nfs4_put_lock_state(lsp);
+out:
+	up(&state->lock_sema);
+	return status;
+}
+
+static int
+nfs4_proc_setlk(struct nfs4_state *state, int cmd, struct file_lock *request)
+{
+	struct inode *inode = state->inode;
+	struct nfs_server *server = NFS_SERVER(inode);
+	struct nfs4_lock_state *lsp;
+	struct nfs_lockargs arg = {
+		.fh = NFS_FH(inode),
+		.type = nfs4_lck_type(cmd, request),
+		.offset = request->fl_start,
+		.length = nfs4_lck_length(request),
+	};
+	struct nfs_lockres res = {
+		.server = server,
+	};
+	struct rpc_message msg = {
+		.rpc_proc	= &nfs4_procedures[NFSPROC4_CLNT_LOCK],
+		.rpc_argp       = &arg,
+		.rpc_resp       = &res,
+		.rpc_cred	= state->owner->so_cred,
+	};
+	struct nfs_lock_opargs largs = {
+		.new_lock_owner = 0,
+	};
+	int status;
+
+	down(&state->lock_sema);
+	lsp = nfs4_find_lock_state(state, request->fl_owner);
+	if (lsp == NULL) {
+		struct nfs4_state_owner *owner = state->owner;
+		struct nfs_open_to_lock otl = {
+			.lock_owner = {
+				.clientid = server->nfs4_state->cl_clientid,
+			},
+		};
+		status = -ENOMEM;
+		lsp = nfs4_alloc_lock_state(state, request->fl_owner);
+		if (!lsp)
+			goto out;
+		otl.lock_seqid = lsp->ls_seqid;
+		otl.lock_owner.id = lsp->ls_id;
+		memcpy(&otl.open_stateid, &state->stateid, sizeof(otl.open_stateid));
+		largs.u.open_lock = &otl;
+		largs.new_lock_owner = 1;
+		arg.u.lock = &largs;
+		down(&owner->so_sema);
+		otl.open_seqid = owner->so_seqid;
+		status = rpc_call_sync(server->client, &msg, 0);
+		/* increment open_owner seqid on success, and 
+		* seqid mutating errors */
+		nfs4_increment_seqid(status, owner);
+		up(&owner->so_sema);
+	} else {
+		struct nfs_exist_lock el = {
+			.seqid = lsp->ls_seqid,
+		};
+		memcpy(&el.stateid, &lsp->ls_stateid, sizeof(el.stateid));
+		largs.u.exist_lock = &el;
+		largs.new_lock_owner = 0;
+		arg.u.lock = &largs;
+		status = rpc_call_sync(server->client, &msg, 0);
+	}
+	/* increment seqid on success, and * seqid mutating errors*/
+	nfs4_increment_lock_seqid(status, lsp);
+	/* save the returned stateid. */
+	if (status == 0) {
+		memcpy(&lsp->ls_stateid, &res.u.stateid, sizeof(nfs4_stateid));
+		nfs4_notify_setlk(inode, request, lsp);
+	} else if (status == -NFS4ERR_DENIED)
+		status = -EAGAIN;
+	nfs4_put_lock_state(lsp);
+out:
+	up(&state->lock_sema);
+	return status;
+}
+
+static int
+nfs4_proc_lock(struct file *filp, int cmd, struct file_lock *request)
+{
+	struct nfs4_state *state;
+	unsigned long timeout = NFS4_LOCK_MINTIMEOUT;
+	int status;
+
+	/* verify open state */
+	state = (struct nfs4_state *)filp->private_data;
+	BUG_ON(!state);
+
+	if (request->fl_start < 0 || request->fl_end < 0)
+		return -EINVAL;
+
+	if (IS_GETLK(cmd))
+		return nfs4_proc_getlk(state, F_GETLK, request);
+
+	if (!(IS_SETLK(cmd) || IS_SETLKW(cmd)))
+		return -EINVAL;
+
+	if (request->fl_type == F_UNLCK)
+		return nfs4_proc_unlck(state, cmd, request);
+
+	do {
+		status = nfs4_proc_setlk(state, cmd, request);
+		if ((status != -EAGAIN) || IS_SETLK(cmd))
+			break;
+		timeout = nfs4_set_lock_task_retry(timeout);
+		status = -ERESTARTSYS;
+		if (signalled())
+			break;
+	} while(status < 0);
+
+	return status;
+}
+
 struct nfs_rpc_ops	nfs_v4_clientops = {
 	.version	= 4,			/* protocol version */
+	.dentry_ops	= &nfs4_dentry_operations,
+	.dir_inode_ops	= &nfs4_dir_inode_operations,
 	.getroot	= nfs4_proc_get_root,
 	.getattr	= nfs4_proc_getattr,
 	.setattr	= nfs4_proc_setattr,
@@ -1835,6 +2303,7 @@
 	.file_release   = nfs4_proc_file_release,
 	.request_init	= nfs4_request_init,
 	.request_compatible = nfs4_request_compatible,
+	.lock		= nfs4_proc_lock,
 };
 
 /*
--- diff/fs/nfs/nfs4renewd.c	2002-10-16 04:28:33.000000000 +0100
+++ source/fs/nfs/nfs4renewd.c	2004-02-09 10:39:56.000000000 +0000
@@ -54,53 +54,91 @@
 #include <linux/nfs4.h>
 #include <linux/nfs_fs.h>
 
-static RPC_WAITQ(nfs4_renewd_queue, "nfs4_renewd_queue");
+#define NFSDBG_FACILITY	NFSDBG_PROC
 
-static void
-renewd(struct rpc_task *task)
+void
+nfs4_renew_state(void *data)
 {
-	struct nfs_server *server = (struct nfs_server *)task->tk_calldata;
-	unsigned long lease = server->lease_time;
-	unsigned long last = server->last_renewal;
-	unsigned long timeout;
-
-	if (!server->nfs4_state)
-		timeout = (2 * lease) / 3;
-	else if (jiffies < last + lease/3)
-		timeout = (2 * lease) / 3 + last - jiffies;
-	else {
+	struct nfs4_client *clp = (struct nfs4_client *)data;
+	long lease, timeout;
+	unsigned long last, now;
+
+	down_read(&clp->cl_sem);
+	dprintk("%s: start\n", __FUNCTION__);
+	/* Are there any active superblocks? */
+	if (list_empty(&clp->cl_superblocks))
+		goto out; 
+	spin_lock(&clp->cl_lock);
+	lease = clp->cl_lease_time;
+	last = clp->cl_last_renewal;
+	now = jiffies;
+	timeout = (2 * lease) / 3 + (long)last - (long)now;
+	/* Are we close to a lease timeout? */
+	if (time_after(now, last + lease/3)) {
+		spin_unlock(&clp->cl_lock);
 		/* Queue an asynchronous RENEW. */
-		nfs4_proc_renew(server);
+		nfs4_proc_async_renew(clp);
 		timeout = (2 * lease) / 3;
-	}
-
+		spin_lock(&clp->cl_lock);
+	} else
+		dprintk("%s: failed to call renewd. Reason: lease not expired \n",
+				__FUNCTION__);
 	if (timeout < 5 * HZ)    /* safeguard */
 		timeout = 5 * HZ;
-	task->tk_timeout = timeout;
-	task->tk_action = renewd;
-	task->tk_exit = NULL;
-	rpc_sleep_on(&nfs4_renewd_queue, task, NULL, NULL);
-	return;
+	dprintk("%s: requeueing work. Lease period = %ld\n",
+			__FUNCTION__, (timeout + HZ - 1) / HZ);
+	cancel_delayed_work(&clp->cl_renewd);
+	schedule_delayed_work(&clp->cl_renewd, timeout);
+	spin_unlock(&clp->cl_lock);
+out:
+	up_read(&clp->cl_sem);
+	dprintk("%s: done\n", __FUNCTION__);
+}
+
+/* Must be called with clp->cl_sem locked for writes */
+void
+nfs4_schedule_state_renewal(struct nfs4_client *clp)
+{
+	long timeout;
+
+	spin_lock(&clp->cl_lock);
+	timeout = (2 * clp->cl_lease_time) / 3 + (long)clp->cl_last_renewal
+		- (long)jiffies;
+	if (timeout < 5 * HZ)
+		timeout = 5 * HZ;
+	dprintk("%s: requeueing work. Lease period = %ld\n",
+			__FUNCTION__, (timeout + HZ - 1) / HZ);
+	cancel_delayed_work(&clp->cl_renewd);
+	schedule_delayed_work(&clp->cl_renewd, timeout);
+	spin_unlock(&clp->cl_lock);
 }
 
-int
-nfs4_init_renewd(struct nfs_server *server)
+void
+nfs4_renewd_prepare_shutdown(struct nfs_server *server)
 {
-	struct rpc_task *task;
-	int status;
+	struct nfs4_client *clp = server->nfs4_state;
 
-	lock_kernel();
-	status = -ENOMEM;
-	task = rpc_new_task(server->client, NULL, RPC_TASK_ASYNC);
-	if (!task)
-		goto out;
-	task->tk_calldata = server;
-	task->tk_action = renewd;
-	status = rpc_execute(task);
+	if (!clp)
+		return;
+	flush_scheduled_work();
+	down_write(&clp->cl_sem);
+	if (!list_empty(&server->nfs4_siblings))
+		list_del_init(&server->nfs4_siblings);
+	up_write(&clp->cl_sem);
+}
 
-out:
-	unlock_kernel();
-	return status;
+/* Must be called with clp->cl_sem locked for writes */
+void
+nfs4_kill_renewd(struct nfs4_client *clp)
+{
+	down_read(&clp->cl_sem);
+	if (!list_empty(&clp->cl_superblocks)) {
+		up_read(&clp->cl_sem);
+		return;
+	}
+	cancel_delayed_work(&clp->cl_renewd);
+	up_read(&clp->cl_sem);
+	flush_scheduled_work();
 }
 
 /*
--- diff/fs/nfs/nfs4state.c	2003-10-09 09:47:34.000000000 +0100
+++ source/fs/nfs/nfs4state.c	2004-02-09 10:39:56.000000000 +0000
@@ -41,6 +41,9 @@
 #include <linux/config.h>
 #include <linux/slab.h>
 #include <linux/nfs_fs.h>
+#include <linux/nfs_idmap.h>
+#include <linux/workqueue.h>
+#include <linux/bitops.h>
 
 #define OPENOWNER_POOL_SIZE	8
 
@@ -55,6 +58,29 @@
 
 static LIST_HEAD(nfs4_clientid_list);
 
+static void nfs4_recover_state(void *);
+extern void nfs4_renew_state(void *);
+
+void
+init_nfsv4_state(struct nfs_server *server)
+{
+	server->nfs4_state = NULL;
+	INIT_LIST_HEAD(&server->nfs4_siblings);
+}
+
+void
+destroy_nfsv4_state(struct nfs_server *server)
+{
+	if (server->mnt_path) {
+		kfree(server->mnt_path);
+		server->mnt_path = NULL;
+	}
+	if (server->nfs4_state) {
+		nfs4_put_client(server->nfs4_state);
+		server->nfs4_state = NULL;
+	}
+}
+
 /*
  * nfs4_get_client(): returns an empty client structure
  * nfs4_put_client(): drops reference to client structure
@@ -75,7 +101,12 @@
 		INIT_LIST_HEAD(&clp->cl_unused);
 		spin_lock_init(&clp->cl_lock);
 		atomic_set(&clp->cl_count, 1);
-		clp->cl_state = NFS4CLNT_NEW;
+		INIT_WORK(&clp->cl_recoverd, nfs4_recover_state, clp);
+		INIT_WORK(&clp->cl_renewd, nfs4_renew_state, clp);
+		INIT_LIST_HEAD(&clp->cl_superblocks);
+		init_waitqueue_head(&clp->cl_waitq);
+		INIT_RPC_WAITQ(&clp->cl_rpcwaitq, "NFS4 client");
+		clp->cl_state = 1 << NFS4CLNT_NEW;
 	}
 	return clp;
 }
@@ -93,6 +124,11 @@
 		kfree(sp);
 	}
 	BUG_ON(!list_empty(&clp->cl_state_owners));
+	if (clp->cl_cred)
+		put_rpccred(clp->cl_cred);
+	nfs_idmap_delete(clp);
+	if (clp->cl_rpcclient)
+		rpc_shutdown_client(clp->cl_rpcclient);
 	kfree(clp);
 }
 
@@ -126,10 +162,14 @@
 		return;
 	list_del(&clp->cl_servers);
 	spin_unlock(&state_spinlock);
+	BUG_ON(!list_empty(&clp->cl_superblocks));
+	wake_up_all(&clp->cl_waitq);
+	rpc_wake_up(&clp->cl_rpcwaitq);
+	nfs4_kill_renewd(clp);
 	nfs4_free_client(clp);
 }
 
-static inline u32
+u32
 nfs4_alloc_lockowner_id(struct nfs4_client *clp)
 {
 	return clp->cl_lockowner_id ++;
@@ -145,11 +185,29 @@
 		atomic_inc(&sp->so_count);
 		sp->so_cred = cred;
 		list_move(&sp->so_list, &clp->cl_state_owners);
+		sp->so_generation = clp->cl_generation;
 		clp->cl_nunused--;
 	}
 	return sp;
 }
 
+static struct nfs4_state_owner *
+nfs4_find_state_owner(struct nfs4_client *clp, struct rpc_cred *cred)
+{
+	struct nfs4_state_owner *sp, *res = NULL;
+
+	list_for_each_entry(sp, &clp->cl_state_owners, so_list) {
+		if (sp->so_cred != cred)
+			continue;
+		atomic_inc(&sp->so_count);
+		/* Move to the head of the list */
+		list_move(&sp->so_list, &clp->cl_state_owners);
+		res = sp;
+		break;
+	}
+	return res;
+}
+
 /*
  * nfs4_alloc_state_owner(): this is called on the OPEN or CREATE path to
  * create a new state_owner.
@@ -170,6 +228,15 @@
 	return sp;
 }
 
+static void
+nfs4_unhash_state_owner(struct nfs4_state_owner *sp)
+{
+	struct nfs4_client *clp = sp->so_client;
+	spin_lock(&clp->cl_lock);
+	list_del_init(&sp->so_list);
+	spin_unlock(&clp->cl_lock);
+}
+
 struct nfs4_state_owner *
 nfs4_get_state_owner(struct nfs_server *server, struct rpc_cred *cred)
 {
@@ -179,19 +246,25 @@
 	get_rpccred(cred);
 	new = nfs4_alloc_state_owner();
 	spin_lock(&clp->cl_lock);
-	sp = nfs4_client_grab_unused(clp, cred);
+	sp = nfs4_find_state_owner(clp, cred);
+	if (sp == NULL)
+		sp = nfs4_client_grab_unused(clp, cred);
 	if (sp == NULL && new != NULL) {
 		list_add(&new->so_list, &clp->cl_state_owners);
 		new->so_client = clp;
 		new->so_id = nfs4_alloc_lockowner_id(clp);
 		new->so_cred = cred;
+		new->so_generation = clp->cl_generation;
 		sp = new;
 		new = NULL;
 	}
 	spin_unlock(&clp->cl_lock);
 	if (new)
 		kfree(new);
-	if (!sp)
+	if (sp) {
+		if (!test_bit(NFS4CLNT_OK, &clp->cl_state))
+			nfs4_wait_clnt_recover(server->client, clp);
+	} else
 		put_rpccred(cred);
 	return sp;
 }
@@ -206,6 +279,8 @@
 		return;
 	if (clp->cl_nunused >= OPENOWNER_POOL_SIZE)
 		goto out_free;
+	if (list_empty(&sp->so_list))
+		goto out_free;
 	list_move(&sp->so_list, &clp->cl_unused);
 	clp->cl_nunused++;
 	spin_unlock(&clp->cl_lock);
@@ -227,24 +302,42 @@
 	state = kmalloc(sizeof(*state), GFP_KERNEL);
 	if (!state)
 		return NULL;
-	state->pid = current->pid;
 	state->state = 0;
+	state->nreaders = 0;
+	state->nwriters = 0;
+	state->flags = 0;
 	memset(state->stateid.data, 0, sizeof(state->stateid.data));
 	atomic_set(&state->count, 1);
+	INIT_LIST_HEAD(&state->lock_states);
+	init_MUTEX(&state->lock_sema);
+	rwlock_init(&state->state_lock);
 	return state;
 }
 
 static struct nfs4_state *
-__nfs4_find_state_bypid(struct inode *inode, pid_t pid)
+__nfs4_find_state(struct inode *inode, struct rpc_cred *cred, mode_t mode)
 {
 	struct nfs_inode *nfsi = NFS_I(inode);
 	struct nfs4_state *state;
 
+	mode &= (FMODE_READ|FMODE_WRITE);
 	list_for_each_entry(state, &nfsi->open_states, inode_states) {
-		if (state->pid == pid) {
-			atomic_inc(&state->count);
-			return state;
-		}
+		if (state->owner->so_cred != cred)
+			continue;
+		if ((mode & FMODE_READ) != 0 && state->nreaders == 0)
+			continue;
+		if ((mode & FMODE_WRITE) != 0 && state->nwriters == 0)
+			continue;
+		if ((state->state & mode) != mode)
+			continue;
+		/* Add the state to the head of the inode's list */
+		list_move(&state->inode_states, &nfsi->open_states);
+		atomic_inc(&state->count);
+		if (mode & FMODE_READ)
+			state->nreaders++;
+		if (mode & FMODE_WRITE)
+			state->nwriters++;
+		return state;
 	}
 	return NULL;
 }
@@ -256,7 +349,12 @@
 	struct nfs4_state *state;
 
 	list_for_each_entry(state, &nfsi->open_states, inode_states) {
+		/* Is this in the process of being freed? */
+		if (state->nreaders == 0 && state->nwriters == 0)
+			continue;
 		if (state->owner == owner) {
+			/* Add the state to the head of the inode's list */
+			list_move(&state->inode_states, &nfsi->open_states);
 			atomic_inc(&state->count);
 			return state;
 		}
@@ -265,16 +363,12 @@
 }
 
 struct nfs4_state *
-nfs4_find_state_bypid(struct inode *inode, pid_t pid)
+nfs4_find_state(struct inode *inode, struct rpc_cred *cred, mode_t mode)
 {
-	struct nfs_inode *nfsi = NFS_I(inode);
 	struct nfs4_state *state;
 
 	spin_lock(&inode->i_lock);
-	state = __nfs4_find_state_bypid(inode, pid);
-	/* Add the state to the tail of the inode's list */
-	if (state)
-		list_move_tail(&state->inode_states, &nfsi->open_states);
+	state = __nfs4_find_state(inode, cred, mode);
 	spin_unlock(&inode->i_lock);
 	return state;
 }
@@ -307,7 +401,6 @@
 		atomic_inc(&owner->so_count);
 		list_add(&state->inode_states, &nfsi->open_states);
 		state->inode = inode;
-		atomic_inc(&inode->i_count);
 		spin_unlock(&inode->i_lock);
 	} else {
 		spin_unlock(&inode->i_lock);
@@ -323,6 +416,7 @@
 {
 	struct inode *inode = state->inode;
 	struct nfs4_state_owner *owner = state->owner;
+	int status = 0;
 
 	if (!atomic_dec_and_lock(&state->count, &inode->i_lock))
 		return;
@@ -330,14 +424,230 @@
 	spin_unlock(&inode->i_lock);
 	down(&owner->so_sema);
 	list_del(&state->open_states);
-	if (state->state != 0)
-		nfs4_do_close(inode, state);
+	if (state->state != 0) {
+		do {
+			status = nfs4_do_close(inode, state);
+			if (!status)
+				break;
+			up(&owner->so_sema);
+			status = nfs4_handle_error(NFS_SERVER(inode), status);
+			down(&owner->so_sema);
+		} while (!status);
+	}
 	up(&owner->so_sema);
-	iput(inode);
 	nfs4_free_open_state(state);
 	nfs4_put_state_owner(owner);
 }
 
+void
+nfs4_close_state(struct nfs4_state *state, mode_t mode)
+{
+	struct inode *inode = state->inode;
+	struct nfs4_state_owner *owner = state->owner;
+	int newstate;
+	int status = 0;
+
+	down(&owner->so_sema);
+	/* Protect against nfs4_find_state() */
+	spin_lock(&inode->i_lock);
+	if (mode & FMODE_READ)
+		state->nreaders--;
+	if (mode & FMODE_WRITE)
+		state->nwriters--;
+	if (state->nwriters == 0 && state->nreaders == 0)
+		list_del_init(&state->inode_states);
+	spin_unlock(&inode->i_lock);
+	do {
+		newstate = 0;
+		if (state->state == 0)
+			break;
+		if (state->nreaders)
+			newstate |= FMODE_READ;
+		if (state->nwriters)
+			newstate |= FMODE_WRITE;
+		if (state->state == newstate)
+			break;
+		if (newstate != 0)
+			status = nfs4_do_downgrade(inode, state, newstate);
+		else
+			status = nfs4_do_close(inode, state);
+		if (!status) {
+			state->state = newstate;
+			break;
+		}
+		up(&owner->so_sema);
+		status = nfs4_handle_error(NFS_SERVER(inode), status);
+		down(&owner->so_sema);
+	} while (!status);
+	up(&owner->so_sema);
+	nfs4_put_open_state(state);
+}
+
+/*
+ * Search the state->lock_states for an existing lock_owner
+ * that is compatible with current->files
+ */
+static struct nfs4_lock_state *
+__nfs4_find_lock_state(struct nfs4_state *state, fl_owner_t fl_owner)
+{
+	struct nfs4_lock_state *pos;
+	list_for_each_entry(pos, &state->lock_states, ls_locks) {
+		if (pos->ls_owner != fl_owner)
+			continue;
+		atomic_inc(&pos->ls_count);
+		return pos;
+	}
+	return NULL;
+}
+
+struct nfs4_lock_state *
+nfs4_find_lock_state(struct nfs4_state *state, fl_owner_t fl_owner)
+{
+	struct nfs4_lock_state *lsp;
+	read_lock(&state->state_lock);
+	lsp = __nfs4_find_lock_state(state, fl_owner);
+	read_unlock(&state->state_lock);
+	return lsp;
+}
+
+/*
+ * Return a compatible lock_state. If no initialized lock_state structure
+ * exists, return an uninitialized one.
+ *
+ * The caller must be holding state->lock_sema
+ */
+struct nfs4_lock_state *
+nfs4_alloc_lock_state(struct nfs4_state *state, fl_owner_t fl_owner)
+{
+	struct nfs4_lock_state *lsp;
+	struct nfs4_client *clp = state->owner->so_client;
+
+	lsp = kmalloc(sizeof(*lsp), GFP_KERNEL);
+	if (lsp == NULL)
+		return NULL;
+	lsp->ls_seqid = 0;	/* arbitrary */
+	lsp->ls_id = -1; 
+	memset(lsp->ls_stateid.data, 0, sizeof(lsp->ls_stateid.data));
+	atomic_set(&lsp->ls_count, 1);
+	lsp->ls_owner = fl_owner;
+	lsp->ls_parent = state;
+	INIT_LIST_HEAD(&lsp->ls_locks);
+	spin_lock(&clp->cl_lock);
+	lsp->ls_id = nfs4_alloc_lockowner_id(clp);
+	spin_unlock(&clp->cl_lock);
+	return lsp;
+}
+
+/*
+ * Byte-range lock aware utility to initialize the stateid of read/write
+ * requests.
+ */
+void
+nfs4_copy_stateid(nfs4_stateid *dst, struct nfs4_state *state, fl_owner_t fl_owner)
+{
+	if (test_bit(LK_STATE_IN_USE, &state->flags)) {
+		struct nfs4_lock_state *lsp;
+
+		lsp = nfs4_find_lock_state(state, fl_owner);
+		if (lsp) {
+			memcpy(dst, &lsp->ls_stateid, sizeof(*dst));
+			nfs4_put_lock_state(lsp);
+			return;
+		}
+	}
+	memcpy(dst, &state->stateid, sizeof(*dst));
+}
+
+/*
+* Called with state->lock_sema held.
+*/
+void
+nfs4_increment_lock_seqid(int status, struct nfs4_lock_state *lsp)
+{
+	if (status == NFS_OK || seqid_mutating_err(-status))
+		lsp->ls_seqid++;
+}
+
+/* 
+* Check to see if the request lock (type FL_UNLK) effects the fl lock.
+*
+* fl and request must have the same posix owner
+*
+* return: 
+* 0 -> fl not effected by request
+* 1 -> fl consumed by request
+*/
+
+static int
+nfs4_check_unlock(struct file_lock *fl, struct file_lock *request)
+{
+	if (fl->fl_start >= request->fl_start && fl->fl_end <= request->fl_end)
+		return 1;
+	return 0;
+}
+
+/*
+ * Post an initialized lock_state on the state->lock_states list.
+ */
+void
+nfs4_notify_setlk(struct inode *inode, struct file_lock *request, struct nfs4_lock_state *lsp)
+{
+	struct nfs4_state *state = lsp->ls_parent;
+
+	if (!list_empty(&lsp->ls_locks))
+		return;
+	write_lock(&state->state_lock);
+	list_add(&lsp->ls_locks, &state->lock_states);
+	set_bit(LK_STATE_IN_USE, &state->flags);
+	write_unlock(&state->state_lock);
+}
+
+/* 
+ * to decide to 'reap' lock state:
+ * 1) search i_flock for file_locks with fl.lock_state = to ls.
+ * 2) determine if unlock will consume found lock. 
+ * 	if so, reap
+ *
+ * 	else, don't reap.
+ *
+ */
+void
+nfs4_notify_unlck(struct inode *inode, struct file_lock *request, struct nfs4_lock_state *lsp)
+{
+	struct nfs4_state *state = lsp->ls_parent;
+	struct file_lock *fl;
+
+	for (fl = inode->i_flock; fl != NULL; fl = fl->fl_next) {
+		if (!(fl->fl_flags & FL_POSIX))
+			continue;
+		if (fl->fl_owner != lsp->ls_owner)
+			continue;
+		/* Exit if we find at least one lock which is not consumed */
+		if (nfs4_check_unlock(fl,request) == 0)
+			return;
+	}
+
+	write_lock(&state->state_lock);
+	list_del_init(&lsp->ls_locks);
+	if (list_empty(&state->lock_states))
+		clear_bit(LK_STATE_IN_USE, &state->flags);
+	write_unlock(&state->state_lock);
+}
+
+/*
+ * Release reference to lock_state, and free it if we see that
+ * it is no longer in use
+ */
+void
+nfs4_put_lock_state(struct nfs4_lock_state *lsp)
+{
+	if (!atomic_dec_and_test(&lsp->ls_count))
+		return;
+	if (!list_empty(&lsp->ls_locks))
+		return;
+	kfree(lsp);
+}
+
 /*
 * Called with sp->so_sema held.
 *
@@ -346,10 +656,172 @@
 * see comments nfs_fs.h:seqid_mutating_error()
 */
 void
-nfs4_increment_seqid(u32 status, struct nfs4_state_owner *sp)
+nfs4_increment_seqid(int status, struct nfs4_state_owner *sp)
 {
-	if (status == NFS_OK || seqid_mutating_err(status))
+	if (status == NFS_OK || seqid_mutating_err(-status))
 		sp->so_seqid++;
+	/* If the server returns BAD_SEQID, unhash state_owner here */
+	if (status == -NFS4ERR_BAD_SEQID)
+		nfs4_unhash_state_owner(sp);
+}
+
+static int reclaimer(void *);
+struct reclaimer_args {
+	struct nfs4_client *clp;
+	struct completion complete;
+};
+
+/*
+ * State recovery routine
+ */
+void
+nfs4_recover_state(void *data)
+{
+	struct nfs4_client *clp = (struct nfs4_client *)data;
+	struct reclaimer_args args = {
+		.clp = clp,
+	};
+	might_sleep();
+
+	init_completion(&args.complete);
+
+	down_read(&clp->cl_sem);
+	if (test_and_set_bit(NFS4CLNT_SETUP_STATE, &clp->cl_state))
+		goto out_failed;
+	if (kernel_thread(reclaimer, &args, CLONE_KERNEL) < 0)
+		goto out_failed_clear;
+	wait_for_completion(&args.complete);
+	return;
+out_failed_clear:
+	smp_mb__before_clear_bit();
+	clear_bit(NFS4CLNT_SETUP_STATE, &clp->cl_state);
+	smp_mb__after_clear_bit();
+	wake_up_all(&clp->cl_waitq);
+	rpc_wake_up(&clp->cl_rpcwaitq);
+out_failed:
+	up_read(&clp->cl_sem);
+}
+
+/*
+ * Schedule a state recovery attempt
+ */
+void
+nfs4_schedule_state_recovery(struct nfs4_client *clp)
+{
+	if (!clp)
+		return;
+	smp_mb__before_clear_bit();
+	clear_bit(NFS4CLNT_OK, &clp->cl_state);
+	smp_mb__after_clear_bit();
+	schedule_work(&clp->cl_recoverd);
+}
+
+static int
+nfs4_reclaim_open_state(struct nfs4_state_owner *sp)
+{
+	struct nfs4_state *state;
+	int status = 0;
+
+	list_for_each_entry(state, &sp->so_states, open_states) {
+		status = nfs4_open_reclaim(sp, state);
+		if (status >= 0)
+			continue;
+		switch (status) {
+			default:
+				printk(KERN_ERR "%s: unhandled error %d. Zeroing state\n",
+						__FUNCTION__, status);
+			case -NFS4ERR_EXPIRED:
+			case -NFS4ERR_NO_GRACE:
+			case -NFS4ERR_RECLAIM_BAD:
+			case -NFS4ERR_RECLAIM_CONFLICT:
+				/*
+				 * Open state on this file cannot be recovered
+				 * All we can do is revert to using the zero stateid.
+				 */
+				memset(state->stateid.data, 0,
+					sizeof(state->stateid.data));
+				/* Mark the file as being 'closed' */
+				state->state = 0;
+				break;
+			case -NFS4ERR_STALE_CLIENTID:
+				goto out_err;
+		}
+	}
+	return 0;
+out_err:
+	return status;
+}
+
+static int
+reclaimer(void *ptr)
+{
+	struct reclaimer_args *args = (struct reclaimer_args *)ptr;
+	struct nfs4_client *clp = args->clp;
+	struct nfs4_state_owner *sp;
+	int generation;
+	int status;
+
+	daemonize("%u.%u.%u.%u-reclaim", NIPQUAD(clp->cl_addr));
+	allow_signal(SIGKILL);
+
+	complete(&args->complete);
+
+	/* Are there any NFS mounts out there? */
+	if (list_empty(&clp->cl_superblocks))
+		goto out;
+	if (!test_bit(NFS4CLNT_NEW, &clp->cl_state)) {
+		status = nfs4_proc_renew(clp);
+		if (status == 0) {
+			set_bit(NFS4CLNT_OK, &clp->cl_state);
+			goto out;
+		}
+	}
+	status = nfs4_proc_setclientid(clp, 0, 0);
+	if (status)
+		goto out_error;
+	status = nfs4_proc_setclientid_confirm(clp);
+	if (status)
+		goto out_error;
+	generation = ++(clp->cl_generation);
+	clear_bit(NFS4CLNT_NEW, &clp->cl_state);
+	set_bit(NFS4CLNT_OK, &clp->cl_state);
+	up_read(&clp->cl_sem);
+	nfs4_schedule_state_renewal(clp);
+restart_loop:
+	spin_lock(&clp->cl_lock);
+	list_for_each_entry(sp, &clp->cl_state_owners, so_list) {
+		if (sp->so_generation - generation <= 0)
+			continue;
+		atomic_inc(&sp->so_count);
+		spin_unlock(&clp->cl_lock);
+		down(&sp->so_sema);
+		if (sp->so_generation - generation < 0) {
+			smp_rmb();
+			sp->so_generation = clp->cl_generation;
+			status = nfs4_reclaim_open_state(sp);
+		}
+		up(&sp->so_sema);
+		nfs4_put_state_owner(sp);
+		if (status < 0) {
+			if (status == -NFS4ERR_STALE_CLIENTID)
+				nfs4_schedule_state_recovery(clp);
+			goto out;
+		}
+		goto restart_loop;
+	}
+	spin_unlock(&clp->cl_lock);
+out:
+	smp_mb__before_clear_bit();
+	clear_bit(NFS4CLNT_SETUP_STATE, &clp->cl_state);
+	smp_mb__after_clear_bit();
+	wake_up_all(&clp->cl_waitq);
+	rpc_wake_up(&clp->cl_rpcwaitq);
+	return 0;
+out_error:
+	printk(KERN_WARNING "Error: state recovery failed on NFSv4 server %u.%u.%u.%u\n",
+				NIPQUAD(clp->cl_addr.s_addr));
+	up_read(&clp->cl_sem);
+	goto out;
 }
 
 /*
--- diff/fs/nfs/nfs4xdr.c	2003-10-27 09:20:39.000000000 +0000
+++ source/fs/nfs/nfs4xdr.c	2004-02-09 10:39:56.000000000 +0000
@@ -57,7 +57,7 @@
 /* Mapping from NFS error code to "errno" error code. */
 #define errno_NFSERR_IO		EIO
 
-extern int			nfs_stat_to_errno(int);
+static int nfs_stat_to_errno(int);
 
 /* NFSv4 COMPOUND tags are only wanted for debugging purposes */
 #ifdef DEBUG
@@ -66,6 +66,10 @@
 #define NFS4_MAXTAGLEN		0
 #endif
 
+/* lock,open owner id: 
+ * we currently use size 1 (u32) out of (NFS4_OPAQUE_LIMIT  >> 2)
+ */
+#define owner_id_maxsz          1 + 1
 #define compound_encode_hdr_maxsz	3 + (NFS4_MAXTAGLEN >> 2)
 #define compound_decode_hdr_maxsz	2 + (NFS4_MAXTAGLEN >> 2)
 #define op_encode_hdr_maxsz	1
@@ -73,6 +77,8 @@
 #define encode_putfh_maxsz	op_encode_hdr_maxsz + 1 + \
 				(NFS4_FHSIZE >> 2)
 #define decode_putfh_maxsz	op_decode_hdr_maxsz
+#define encode_putrootfh_maxsz	op_encode_hdr_maxsz
+#define decode_putrootfh_maxsz	op_decode_hdr_maxsz
 #define encode_getfh_maxsz      op_encode_hdr_maxsz
 #define decode_getfh_maxsz      op_decode_hdr_maxsz + 1 + \
                                 (NFS4_FHSIZE >> 2)
@@ -90,6 +96,25 @@
 #define decode_pre_write_getattr_maxsz	op_decode_hdr_maxsz + 5
 #define encode_post_write_getattr_maxsz	op_encode_hdr_maxsz + 2
 #define decode_post_write_getattr_maxsz	op_decode_hdr_maxsz + 13
+#define encode_fsinfo_maxsz	op_encode_hdr_maxsz + 2
+#define decode_fsinfo_maxsz	op_decode_hdr_maxsz + 11
+#define encode_renew_maxsz	op_encode_hdr_maxsz + 3
+#define decode_renew_maxsz	op_decode_hdr_maxsz
+#define encode_setclientid_maxsz \
+				op_encode_hdr_maxsz + \
+				4 /*server->ip_addr*/ + \
+				1 /*Netid*/ + \
+				6 /*uaddr*/ + \
+				6 + (NFS4_VERIFIER_SIZE >> 2)
+#define decode_setclientid_maxsz \
+				op_decode_hdr_maxsz + \
+				2 + \
+				1024 /* large value for CLID_INUSE */
+#define encode_setclientid_confirm_maxsz \
+				op_encode_hdr_maxsz + \
+				3 + (NFS4_VERIFIER_SIZE >> 2)
+#define decode_setclientid_confirm_maxsz \
+				op_decode_hdr_maxsz
 
 #define NFS4_enc_compound_sz	1024  /* XXX: large enough? */
 #define NFS4_dec_compound_sz	1024  /* XXX: large enough? */
@@ -145,6 +170,24 @@
 #define NFS4_dec_open_confirm_sz        compound_decode_hdr_maxsz + \
                                         decode_putfh_maxsz + \
                                         op_decode_hdr_maxsz + 4
+#define NFS4_enc_open_reclaim_sz	compound_encode_hdr_maxsz + \
+					encode_putfh_maxsz + \
+					op_encode_hdr_maxsz + \
+					11 + \
+					encode_getattr_maxsz
+#define NFS4_dec_open_reclaim_sz	compound_decode_hdr_maxsz + \
+					decode_putfh_maxsz + \
+					op_decode_hdr_maxsz + \
+					4 + 5 + 2 + 3 + \
+					decode_getattr_maxsz
+#define NFS4_enc_open_downgrade_sz \
+				compound_encode_hdr_maxsz + \
+                                encode_putfh_maxsz + \
+                                op_encode_hdr_maxsz + 7
+#define NFS4_dec_open_downgrade_sz \
+				compound_decode_hdr_maxsz + \
+                                decode_putfh_maxsz + \
+                                op_decode_hdr_maxsz + 4
 #define NFS4_enc_close_sz       compound_encode_hdr_maxsz + \
                                 encode_putfh_maxsz + \
                                 op_encode_hdr_maxsz + 5
@@ -159,6 +202,60 @@
 #define NFS4_dec_setattr_sz     compound_decode_hdr_maxsz + \
                                 decode_putfh_maxsz + \
                                 op_decode_hdr_maxsz + 3
+#define NFS4_enc_fsinfo_sz	compound_encode_hdr_maxsz + \
+				encode_putfh_maxsz + \
+				encode_fsinfo_maxsz
+#define NFS4_dec_fsinfo_sz	compound_decode_hdr_maxsz + \
+				decode_putfh_maxsz + \
+				decode_fsinfo_maxsz
+#define NFS4_enc_renew_sz	compound_encode_hdr_maxsz + \
+				encode_renew_maxsz
+#define NFS4_dec_renew_sz	compound_decode_hdr_maxsz + \
+				decode_renew_maxsz
+#define NFS4_enc_setclientid_sz	compound_encode_hdr_maxsz + \
+				encode_setclientid_maxsz
+#define NFS4_dec_setclientid_sz	compound_decode_hdr_maxsz + \
+				decode_setclientid_maxsz
+#define NFS4_enc_setclientid_confirm_sz \
+				compound_encode_hdr_maxsz + \
+				encode_setclientid_confirm_maxsz + \
+				encode_putrootfh_maxsz + \
+				encode_fsinfo_maxsz
+#define NFS4_dec_setclientid_confirm_sz \
+				compound_decode_hdr_maxsz + \
+				decode_setclientid_confirm_maxsz + \
+				decode_putrootfh_maxsz + \
+				decode_fsinfo_maxsz
+#define NFS4_enc_lock_sz        compound_encode_hdr_maxsz + \
+				encode_putfh_maxsz + \
+				encode_getattr_maxsz + \
+				op_encode_hdr_maxsz + \
+				1 + 1 + 2 + 2 + \
+				1 + 4 + 1 + 2 + \
+				owner_id_maxsz
+#define NFS4_dec_lock_sz        compound_decode_hdr_maxsz + \
+				decode_putfh_maxsz + \
+				decode_getattr_maxsz + \
+				op_decode_hdr_maxsz + \
+				2 + 2 + 1 + 2 + \
+				owner_id_maxsz
+#define NFS4_enc_lockt_sz       compound_encode_hdr_maxsz + \
+				encode_putfh_maxsz + \
+				encode_getattr_maxsz + \
+				op_encode_hdr_maxsz + \
+				1 + 2 + 2 + 2 + \
+				owner_id_maxsz
+#define NFS4_dec_lockt_sz       NFS4_dec_lock_sz
+#define NFS4_enc_locku_sz       compound_encode_hdr_maxsz + \
+				encode_putfh_maxsz + \
+				encode_getattr_maxsz + \
+				op_encode_hdr_maxsz + \
+				1 + 1 + 4 + 2 + 2
+#define NFS4_dec_locku_sz       compound_decode_hdr_maxsz + \
+				decode_putfh_maxsz + \
+				decode_getattr_maxsz + \
+				op_decode_hdr_maxsz + 4
+
 
 
 static struct {
@@ -239,8 +336,8 @@
 encode_attrs(struct xdr_stream *xdr, struct iattr *iap,
     struct nfs_server *server)
 {
-	char owner_name[256];
-	char owner_group[256];
+	char owner_name[IDMAP_NAMESZ];
+	char owner_group[IDMAP_NAMESZ];
 	int owner_namelen = 0;
 	int owner_grouplen = 0;
 	uint32_t *p;
@@ -265,9 +362,8 @@
 	if (iap->ia_valid & ATTR_MODE)
 		len += 4;
 	if (iap->ia_valid & ATTR_UID) {
-		status = nfs_idmap_name(server, IDMAP_TYPE_USER,
-		    iap->ia_uid, owner_name, &owner_namelen);
-		if (status < 0) {
+		owner_namelen = nfs_map_uid_to_name(server->nfs4_state, iap->ia_uid, owner_name);
+		if (owner_namelen < 0) {
 			printk(KERN_WARNING "nfs: couldn't resolve uid %d to string\n",
 			       iap->ia_uid);
 			/* XXX */
@@ -278,9 +374,8 @@
 		len += 4 + (XDR_QUADLEN(owner_namelen) << 2);
 	}
 	if (iap->ia_valid & ATTR_GID) {
-		status = nfs_idmap_name(server, IDMAP_TYPE_GROUP,
-		    iap->ia_gid, owner_group, &owner_grouplen);
-		if (status < 0) {
+		owner_grouplen = nfs_map_gid_to_group(server->nfs4_state, iap->ia_gid, owner_group);
+		if (owner_grouplen < 0) {
 			printk(KERN_WARNING "nfs4: couldn't resolve gid %d to string\n",
 			       iap->ia_gid);
 			strcpy(owner_group, "nobody");
@@ -503,6 +598,15 @@
 }
 
 static int
+encode_fsinfo(struct xdr_stream *xdr)
+{
+	return encode_getattr_one(xdr, FATTR4_WORD0_MAXFILESIZE
+			| FATTR4_WORD0_MAXREAD
+			| FATTR4_WORD0_MAXWRITE
+			| FATTR4_WORD0_LEASE_TIME);
+}
+
+static int
 encode_getfh(struct xdr_stream *xdr)
 {
 	uint32_t *p;
@@ -526,6 +630,80 @@
 	return 0;
 }
 
+/*
+ * opcode,type,reclaim,offset,length,new_lock_owner = 32
+ * open_seqid,open_stateid,lock_seqid,lock_owner.clientid, lock_owner.id = 40
+ */
+static int
+encode_lock(struct xdr_stream *xdr, struct nfs_lockargs *arg)
+{
+	uint32_t *p;
+	struct nfs_lock_opargs *opargs = arg->u.lock;
+
+	RESERVE_SPACE(32);
+	WRITE32(OP_LOCK);
+	WRITE32(arg->type); 
+	WRITE32(opargs->reclaim);
+	WRITE64(arg->offset);
+	WRITE64(arg->length);
+	WRITE32(opargs->new_lock_owner);
+	if (opargs->new_lock_owner){
+		struct nfs_open_to_lock *ol = opargs->u.open_lock;
+
+		RESERVE_SPACE(40);
+		WRITE32(ol->open_seqid);
+		WRITEMEM(&ol->open_stateid, sizeof(ol->open_stateid));
+		WRITE32(ol->lock_seqid);
+		WRITE64(ol->lock_owner.clientid);
+		WRITE32(4);
+		WRITE32(ol->lock_owner.id);
+	}
+	else {
+		struct nfs_exist_lock *el = opargs->u.exist_lock;
+
+		RESERVE_SPACE(20);
+		WRITEMEM(&el->stateid, sizeof(el->stateid));
+		WRITE32(el->seqid);
+	}
+
+	return 0;
+}
+
+static int
+encode_lockt(struct xdr_stream *xdr, struct nfs_lockargs *arg)
+{
+	uint32_t *p;
+	struct nfs_lowner *opargs = arg->u.lockt;
+
+	RESERVE_SPACE(40);
+	WRITE32(OP_LOCKT);
+	WRITE32(arg->type);
+	WRITE64(arg->offset);
+	WRITE64(arg->length);
+	WRITE64(opargs->clientid);
+	WRITE32(4);
+	WRITE32(opargs->id);
+
+	return 0;
+}
+
+static int
+encode_locku(struct xdr_stream *xdr, struct nfs_lockargs *arg)
+{
+	uint32_t *p;
+	struct nfs_locku_opargs *opargs = arg->u.locku;
+
+	RESERVE_SPACE(44);
+	WRITE32(OP_LOCKU);
+	WRITE32(arg->type);
+	WRITE32(opargs->seqid);
+	WRITEMEM(&opargs->stateid, sizeof(opargs->stateid));
+	WRITE64(arg->offset);
+	WRITE64(arg->length);
+
+	return 0;
+}
+
 static int
 encode_lookup(struct xdr_stream *xdr, struct nfs4_lookup *lookup)
 {
@@ -615,6 +793,57 @@
 
 
 static int
+encode_open_reclaim(struct xdr_stream *xdr, struct nfs_open_reclaimargs *arg)
+{
+	uint32_t *p;
+
+ /*
+ * opcode 4, seqid 4, share_access 4, share_deny 4, clientid 8, ownerlen 4,
+ * owner 4, opentype 4, claim 4, delegation_type 4 = 44
+ */
+	RESERVE_SPACE(44);
+	WRITE32(OP_OPEN);
+	WRITE32(arg->seqid);
+	switch (arg->share_access) {
+		case FMODE_READ:
+			WRITE32(NFS4_SHARE_ACCESS_READ);
+			break;
+		case FMODE_WRITE:
+			WRITE32(NFS4_SHARE_ACCESS_WRITE);
+			break;
+		case FMODE_READ|FMODE_WRITE:
+			WRITE32(NFS4_SHARE_ACCESS_BOTH);
+			break;
+		default:
+			BUG();
+	}
+	WRITE32(0);                  /* for linux, share_deny = 0 always */
+	WRITE64(arg->clientid);
+	WRITE32(4);
+	WRITE32(arg->id);
+	WRITE32(NFS4_OPEN_NOCREATE);
+	WRITE32(NFS4_OPEN_CLAIM_PREVIOUS);
+	WRITE32(NFS4_OPEN_DELEGATE_NONE);
+	return 0;
+}
+
+static int
+encode_open_downgrade(struct xdr_stream *xdr, struct nfs_closeargs *arg)
+{
+	uint32_t *p;
+
+	RESERVE_SPACE(16+sizeof(arg->stateid.data));
+	WRITE32(OP_OPEN_DOWNGRADE);
+	WRITEMEM(arg->stateid.data, sizeof(arg->stateid.data));
+	WRITE32(arg->seqid);
+	WRITE32(arg->share_access);
+	/* No deny modes */
+	WRITE32(0);
+
+	return 0;
+}
+
+static int
 encode_putfh(struct xdr_stream *xdr, struct nfs_fh *fh)
 {
 	int len = fh->size;
@@ -891,21 +1120,12 @@
 		case OP_RENAME:
 			status = encode_rename(xdr, &cp->ops[i].u.rename);
 			break;
-		case OP_RENEW:
-			status = encode_renew(xdr, cp->ops[i].u.renew);
-			break;
 		case OP_RESTOREFH:
 			status = encode_restorefh(xdr);
 			break;
 		case OP_SAVEFH:
 			status = encode_savefh(xdr);
 			break;
-		case OP_SETCLIENTID:
-			status = encode_setclientid(xdr, &cp->ops[i].u.setclientid);
-			break;
-		case OP_SETCLIENTID_CONFIRM:
-			status = encode_setclientid_confirm(xdr, cp->ops[i].u.setclientid_confirm);
-			break;
 		default:
 			BUG();
 		}
@@ -1015,6 +1235,119 @@
 	return status;
 }
 
+/*
+ * Encode an OPEN request
+ */
+static int
+nfs4_xdr_enc_open_reclaim(struct rpc_rqst *req, uint32_t *p,
+		struct nfs_open_reclaimargs *args)
+{
+	struct xdr_stream xdr;
+	struct compound_hdr hdr = {
+		.nops   = 3,
+	};
+	int status;
+
+	xdr_init_encode(&xdr, &req->rq_snd_buf, p);
+	encode_compound_hdr(&xdr, &hdr);
+	status = encode_putfh(&xdr, args->fh);
+	if (status)
+		goto out;
+	status = encode_open_reclaim(&xdr, args);
+	if (status)
+		goto out;
+	status = encode_getattr(&xdr, args->f_getattr);
+out:
+	return status;
+}
+
+/*
+ * Encode an OPEN_DOWNGRADE request
+ */
+static int
+nfs4_xdr_enc_open_downgrade(struct rpc_rqst *req, uint32_t *p, struct nfs_closeargs *args)
+{
+	struct xdr_stream xdr;
+	struct compound_hdr hdr = {
+		.nops	= 2,
+	};
+	int status;
+
+	xdr_init_encode(&xdr, &req->rq_snd_buf, p);
+	encode_compound_hdr(&xdr, &hdr);
+	status = encode_putfh(&xdr, args->fh);
+	if (status)
+		goto out;
+	status = encode_open_downgrade(&xdr, args);
+out:
+	return status;
+}
+
+/*
+ * Encode a LOCK request
+ */
+static int
+nfs4_xdr_enc_lock(struct rpc_rqst *req, uint32_t *p, struct nfs_lockargs *args)
+{
+	struct xdr_stream xdr;
+	struct compound_hdr hdr = {
+		.nops   = 2,
+	};
+	int status;
+
+	xdr_init_encode(&xdr, &req->rq_snd_buf, p);
+	encode_compound_hdr(&xdr, &hdr);
+	status = encode_putfh(&xdr, args->fh);
+	if(status)
+		goto out;
+	status = encode_lock(&xdr, args);
+out:
+	return status;
+}
+
+/*
+ * Encode a LOCKT request
+ */
+static int
+nfs4_xdr_enc_lockt(struct rpc_rqst *req, uint32_t *p, struct nfs_lockargs *args)
+{
+	struct xdr_stream xdr;
+	struct compound_hdr hdr = {
+		.nops   = 2,
+	};
+	int status;
+
+	xdr_init_encode(&xdr, &req->rq_snd_buf, p);
+	encode_compound_hdr(&xdr, &hdr);
+	status = encode_putfh(&xdr, args->fh);
+	if(status)
+		goto out;
+	status = encode_lockt(&xdr, args);
+out:
+	return status;
+}
+
+/*
+ * Encode a LOCKU request
+ */
+static int
+nfs4_xdr_enc_locku(struct rpc_rqst *req, uint32_t *p, struct nfs_lockargs *args)
+{
+	struct xdr_stream xdr;
+	struct compound_hdr hdr = {
+		.nops   = 2,
+	};
+	int status;
+
+	xdr_init_encode(&xdr, &req->rq_snd_buf, p);
+	encode_compound_hdr(&xdr, &hdr);
+	status = encode_putfh(&xdr, args->fh);
+	if(status)
+		goto out;
+	status = encode_locku(&xdr, args);
+out:
+	return status;
+}
 
 /*
  * Encode a READ request
@@ -1134,6 +1467,82 @@
 }
 
 /*
+ * FSINFO request
+ */
+static int
+nfs4_xdr_enc_fsinfo(struct rpc_rqst *req, uint32_t *p, void *fhandle)
+{
+	struct xdr_stream xdr;
+	struct compound_hdr hdr = {
+		.nops	= 2,
+	};
+	int status;
+
+	xdr_init_encode(&xdr, &req->rq_snd_buf, p);
+	encode_compound_hdr(&xdr, &hdr);
+	status = encode_putfh(&xdr, fhandle);
+	if (!status)
+		status = encode_fsinfo(&xdr);
+	return status;
+}
+
+/*
+ * a RENEW request
+ */
+static int
+nfs4_xdr_enc_renew(struct rpc_rqst *req, uint32_t *p, struct nfs4_client *clp)
+{
+	struct xdr_stream xdr;
+	struct compound_hdr hdr = {
+		.nops	= 1,
+	};
+
+	xdr_init_encode(&xdr, &req->rq_snd_buf, p);
+	encode_compound_hdr(&xdr, &hdr);
+	return encode_renew(&xdr, clp);
+}
+
+/*
+ * a SETCLIENTID request
+ */
+static int
+nfs4_xdr_enc_setclientid(struct rpc_rqst *req, uint32_t *p,
+		struct nfs4_setclientid *sc)
+{
+	struct xdr_stream xdr;
+	struct compound_hdr hdr = {
+		.nops	= 1,
+	};
+
+	xdr_init_encode(&xdr, &req->rq_snd_buf, p);
+	encode_compound_hdr(&xdr, &hdr);
+	return encode_setclientid(&xdr, sc);
+}
+
+/*
+ * a SETCLIENTID_CONFIRM request
+ */
+static int
+nfs4_xdr_enc_setclientid_confirm(struct rpc_rqst *req, uint32_t *p,
+		struct nfs4_client *clp)
+{
+	struct xdr_stream xdr;
+	struct compound_hdr hdr = {
+		.nops	= 3,
+	};
+	int status;
+
+	xdr_init_encode(&xdr, &req->rq_snd_buf, p);
+	encode_compound_hdr(&xdr, &hdr);
+	status = encode_setclientid_confirm(&xdr, clp);
+	if (!status)
+		status = encode_putrootfh(&xdr);
+	if (!status)
+		status = encode_fsinfo(&xdr);
+	return status;
+}
+
+/*
  * START OF "GENERIC" DECODE ROUTINES.
  *   These may look a little ugly since they are imported from a "generic"
  * set of XDR encode/decode routines which are intended to be shared by
@@ -1295,7 +1704,6 @@
 }
 
 extern uint32_t nfs4_fattr_bitmap[2];
-extern uint32_t nfs4_fsinfo_bitmap[2];
 extern uint32_t nfs4_fsstat_bitmap[2];
 extern uint32_t nfs4_pathconf_bitmap[2];
 
@@ -1305,7 +1713,6 @@
 {
 	struct nfs_fattr *nfp = getattr->gt_attrs;
 	struct nfs_fsstat *fsstat = getattr->gt_fsstat;
-	struct nfs_fsinfo *fsinfo = getattr->gt_fsinfo;
 	struct nfs_pathconf *pathconf = getattr->gt_pathconf;
 	uint32_t attrlen, dummy32, bmlen,
 		 bmval0 = 0,
@@ -1351,11 +1758,6 @@
 		nfp->nlink = 1;
 		nfp->timestamp = jiffies;
 	}
-	if (fsinfo) {
-		fsinfo->rtmult = fsinfo->wtmult = 512;  /* ??? */
-		fsinfo->lease_time = 60;
-	}
-
         if (bmval0 & FATTR4_WORD0_TYPE) {
                 READ_BUF(4);
                 len += 4;
@@ -1389,12 +1791,6 @@
 			(long long)nfp->fsid_u.nfs4.major,
 			(long long)nfp->fsid_u.nfs4.minor);
         }
-        if (bmval0 & FATTR4_WORD0_LEASE_TIME) {
-                READ_BUF(4);
-                len += 4;
-                READ32(fsinfo->lease_time);
-                dprintk("read_attrs: lease_time=%d\n", fsinfo->lease_time);
-        }
         if (bmval0 & FATTR4_WORD0_FILEID) {
                 READ_BUF(8);
                 len += 8;
@@ -1419,12 +1815,6 @@
                 READ64(fsstat->tfiles);
                 dprintk("read_attrs: files_tot=0x%Lx\n", (long long) fsstat->tfiles);
         }
-        if (bmval0 & FATTR4_WORD0_MAXFILESIZE) {
-                READ_BUF(8);
-                len += 8;
-                READ64(fsinfo->maxfilesize);
-                dprintk("read_attrs: maxfilesize=0x%Lx\n", (long long) fsinfo->maxfilesize);
-        }
 	if (bmval0 & FATTR4_WORD0_MAXLINK) {
 		READ_BUF(4);
 		len += 4;
@@ -1437,20 +1827,6 @@
                 READ32(pathconf->max_namelen);
                 dprintk("read_attrs: maxname=%d\n", pathconf->max_namelen);
         }
-        if (bmval0 & FATTR4_WORD0_MAXREAD) {
-                READ_BUF(8);
-                len += 8;
-                READ64(fsinfo->rtmax);
-		fsinfo->rtpref = fsinfo->dtpref = fsinfo->rtmax;
-                dprintk("read_attrs: maxread=%d\n", fsinfo->rtmax);
-        }
-        if (bmval0 & FATTR4_WORD0_MAXWRITE) {
-                READ_BUF(8);
-                len += 8;
-                READ64(fsinfo->wtmax);
-		fsinfo->wtpref = fsinfo->wtmax;
-                dprintk("read_attrs: maxwrite=%d\n", fsinfo->wtmax);
-        }
 	
         if (bmval1 & FATTR4_WORD1_MODE) {
                 READ_BUF(4);
@@ -1475,10 +1851,9 @@
 		}
 		READ_BUF(dummy32);
 		len += (XDR_QUADLEN(dummy32) << 2);
-		if ((status = nfs_idmap_id(server, IDMAP_TYPE_USER,
-			 (char *)p, len, &nfp->uid)) == -1) {
-			dprintk("read_attrs: gss_get_num failed!\n");
-			/* goto out; */
+		if ((status = nfs_map_name_to_uid(server->nfs4_state, (char *)p, dummy32,
+						&nfp->uid)) < 0) {
+			dprintk("read_attrs: name-to-uid mapping failed!\n");
 			nfp->uid = -2;
 		}
 		dprintk("read_attrs: uid=%d\n", (int)nfp->uid);
@@ -1493,11 +1868,10 @@
 		}
 		READ_BUF(dummy32);
 		len += (XDR_QUADLEN(dummy32) << 2);
-		if ((status = nfs_idmap_id(server, IDMAP_TYPE_GROUP,
-			 (char *)p, len, &nfp->gid)) == -1) {
-			dprintk("read_attrs: gss_get_num failed!\n");
+		if ((status = nfs_map_group_to_gid(server->nfs4_state, (char *)p, dummy32,
+						&nfp->gid)) < 0) {
+			dprintk("read_attrs: group-to-gid mapping failed!\n");
 			nfp->gid = -2;
-			/* goto out; */
 		}
 		dprintk("read_attrs: gid=%d\n", (int)nfp->gid);
         }
@@ -1695,6 +2069,74 @@
 
 
 static int
+decode_fsinfo(struct xdr_stream *xdr, struct nfs_fsinfo *fsinfo)
+{
+	uint32_t *p;
+	uint32_t len, attrlen, bmlen, bmval0 = 0, bmval1 = 0;
+	int status;
+
+	status = decode_op_hdr(xdr, OP_GETATTR);
+	if (status)
+		return status;
+	READ_BUF(4);
+	READ32(bmlen);
+	if (bmlen < 1)
+		return -EIO;
+	READ_BUF(bmlen << 2);
+	READ32(bmval0);
+	if (bmval0 & ~(FATTR4_WORD0_MAXFILESIZE|FATTR4_WORD0_MAXREAD|
+				FATTR4_WORD0_MAXWRITE|FATTR4_WORD0_LEASE_TIME))
+		goto out_bad_bitmap;
+	if (bmlen > 1) {
+		READ32(bmval1);
+		if (bmval1 != 0 || bmlen > 2)
+			goto out_bad_bitmap;
+	}
+	READ_BUF(4);
+	READ32(attrlen);
+	READ_BUF(attrlen);
+	fsinfo->rtmult = fsinfo->wtmult = 512;	/* ??? */
+	fsinfo->lease_time = 60;
+	len = attrlen;
+
+	if (bmval0 & FATTR4_WORD0_LEASE_TIME) {
+		len -= 4;
+		READ32(fsinfo->lease_time);
+		dprintk("read_attrs: lease_time=%d\n", fsinfo->lease_time);
+	}
+	if (bmval0 & FATTR4_WORD0_MAXFILESIZE) {
+		len -= 8;
+		READ64(fsinfo->maxfilesize);
+		dprintk("read_attrs: maxfilesize=0x%Lx\n", (long long) fsinfo->maxfilesize);
+	}
+	if (bmval0 & FATTR4_WORD0_MAXREAD) {
+		len -= 8;
+		READ64(fsinfo->rtmax);
+		fsinfo->rtpref = fsinfo->dtpref = fsinfo->rtmax;
+		dprintk("read_attrs: maxread=%d\n", fsinfo->rtmax);
+	}
+	if (bmval0 & FATTR4_WORD0_MAXWRITE) {
+		len -= 8;
+		READ64(fsinfo->wtmax);
+		fsinfo->wtpref = fsinfo->wtmax;
+		dprintk("read_attrs: maxwrite=%d\n", fsinfo->wtmax);
+	}
+	if (len != 0)
+		goto out_bad_attrlen;
+	return 0;
+out_bad_attrlen:
+	printk(KERN_NOTICE "%s: server attribute length %u does not match bitmap 0x%x/0x%x\n",
+			__FUNCTION__, (unsigned int)attrlen,
+			(unsigned int) bmval0, (unsigned int)bmval1);
+	return -EIO;
+out_bad_bitmap:
+	printk(KERN_NOTICE "%s: server returned bad attribute bitmap 0x%x/0x%x\n",
+			__FUNCTION__,
+			(unsigned int)bmval0, (unsigned int)bmval1);
+	return -EIO;
+}
+
+static int
 decode_getfh(struct xdr_stream *xdr, struct nfs4_getfh *getfh)
 {
 	struct nfs_fh *fh = getfh->gf_fhandle;
@@ -1729,6 +2171,66 @@
 	return decode_change_info(xdr, link->ln_cinfo);
 }
 
+/*
+ * We create the owner, so we know a proper owner.id length is 4.
+ */
+static int
+decode_lock_denied (struct xdr_stream *xdr, struct nfs_lock_denied *denied)
+{
+	uint32_t *p;
+	uint32_t namelen;
+
+	READ_BUF(32);
+	READ64(denied->offset);
+	READ64(denied->length);
+	READ32(denied->type);
+	READ64(denied->owner.clientid);
+	READ32(namelen);
+	READ_BUF(namelen);
+	if (namelen == 4)
+		READ32(denied->owner.id);
+	return -NFS4ERR_DENIED;
+}
+
+static int
+decode_lock(struct xdr_stream *xdr, struct nfs_lockres *res)
+{
+	uint32_t *p;
+	int status;
+
+	status = decode_op_hdr(xdr, OP_LOCK);
+	if (status == 0) {
+		READ_BUF(sizeof(nfs4_stateid));
+		COPYMEM(&res->u.stateid, sizeof(res->u.stateid));
+	} else if (status == -NFS4ERR_DENIED)
+		return decode_lock_denied(xdr, &res->u.denied);
+	return status;
+}
+
+static int
+decode_lockt(struct xdr_stream *xdr, struct nfs_lockres *res)
+{
+	int status;
+	status = decode_op_hdr(xdr, OP_LOCKT);
+	if (status == -NFS4ERR_DENIED)
+		return decode_lock_denied(xdr, &res->u.denied);
+	return status;
+}
+
+static int
+decode_locku(struct xdr_stream *xdr, struct nfs_lockres *res)
+{
+	uint32_t *p;
+	int status;
+
+	status = decode_op_hdr(xdr, OP_LOCKU);
+	if (status == 0) {
+		READ_BUF(sizeof(nfs4_stateid));
+		COPYMEM(&res->u.stateid, sizeof(res->u.stateid));
+	}
+	return status;
+}
+
 static int
 decode_lookup(struct xdr_stream *xdr)
 {
@@ -1769,15 +2271,29 @@
 decode_open_confirm(struct xdr_stream *xdr, struct nfs_open_confirmres *res)
 {
         uint32_t *p;
+	int status;
 
-        res->status = decode_op_hdr(xdr, OP_OPEN_CONFIRM);
-        if (res->status)
-                return res->status;
+        status = decode_op_hdr(xdr, OP_OPEN_CONFIRM);
+        if (status)
+                return status;
         READ_BUF(sizeof(res->stateid.data));
         COPYMEM(res->stateid.data, sizeof(res->stateid.data));
         return 0;
 }
 
+static int
+decode_open_downgrade(struct xdr_stream *xdr, struct nfs_closeres *res)
+{
+	uint32_t *p;
+	int status;
+
+	status = decode_op_hdr(xdr, OP_OPEN_DOWNGRADE);
+	if (status)
+		return status;
+	READ_BUF(sizeof(res->stateid.data));
+	COPYMEM(res->stateid.data, sizeof(res->stateid.data));
+	return 0;
+}
 
 static int
 decode_putfh(struct xdr_stream *xdr)
@@ -2011,7 +2527,7 @@
 }
 
 static int
-decode_setclientid(struct xdr_stream *xdr, struct nfs4_setclientid *setclientid)
+decode_setclientid(struct xdr_stream *xdr, struct nfs4_client *clp)
 {
 	uint32_t *p;
 	uint32_t opnum;
@@ -2027,9 +2543,9 @@
 	}
 	READ32(nfserr);
 	if (nfserr == NFS_OK) {
-		READ_BUF(8 + sizeof(setclientid->sc_state->cl_confirm.data));
-		READ64(setclientid->sc_state->cl_clientid);
-		COPYMEM(setclientid->sc_state->cl_confirm.data, sizeof(setclientid->sc_state->cl_confirm.data));
+		READ_BUF(8 + sizeof(clp->cl_confirm.data));
+		READ64(clp->cl_clientid);
+		COPYMEM(clp->cl_confirm.data, sizeof(clp->cl_confirm.data));
 	} else if (nfserr == NFSERR_CLID_INUSE) {
 		uint32_t len;
 
@@ -2141,18 +2657,9 @@
 		case OP_RENAME:
 			status = decode_rename(xdr, &op->u.rename);
 			break;
-		case OP_RENEW:
-			status = decode_renew(xdr);
-			break;
 		case OP_SAVEFH:
 			status = decode_savefh(xdr);
 			break;
-		case OP_SETCLIENTID:
-			status = decode_setclientid(xdr, &op->u.setclientid);
-			break;
-		case OP_SETCLIENTID_CONFIRM:
-			status = decode_setclientid_confirm(xdr);
-			break;
 		default:
 			BUG();
 			return -EIO;
@@ -2163,6 +2670,29 @@
 
 	DECODE_TAIL;
 }
+
+/*
+ * Decode OPEN_DOWNGRADE response
+ */
+static int
+nfs4_xdr_dec_open_downgrade(struct rpc_rqst *rqstp, uint32_t *p, struct nfs_closeres *res)
+{
+        struct xdr_stream xdr;
+        struct compound_hdr hdr;
+        int status;
+
+        xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p);
+        status = decode_compound_hdr(&xdr, &hdr);
+        if (status)
+                goto out;
+        status = decode_putfh(&xdr);
+        if (status)
+                goto out;
+        status = decode_open_downgrade(&xdr, res);
+out:
+        return status;
+}
+
 /*
  * END OF "GENERIC" DECODE ROUTINES.
  */
@@ -2275,6 +2805,31 @@
 }
 
 /*
+ * Decode OPEN_RECLAIM response
+ */
+static int
+nfs4_xdr_dec_open_reclaim(struct rpc_rqst *rqstp, uint32_t *p, struct nfs_openres *res)
+{
+        struct xdr_stream xdr;
+        struct compound_hdr hdr;
+        int status;
+
+        xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p);
+        status = decode_compound_hdr(&xdr, &hdr);
+        if (status)
+                goto out;
+        status = decode_putfh(&xdr);
+        if (status)
+                goto out;
+        status = decode_open(&xdr, res);
+        if (status)
+                goto out;
+        status = decode_getattr(&xdr, res->f_getattr, res->server);
+out:
+        return status;
+}
+
+/*
  * Decode SETATTR response
  */
 static int
@@ -2299,6 +2854,71 @@
         return status;
 }
 
+/*
+ * Decode LOCK response
+ */
+static int
+nfs4_xdr_dec_lock(struct rpc_rqst *rqstp, uint32_t *p, struct nfs_lockres *res)
+{
+	struct xdr_stream xdr;
+	struct compound_hdr hdr;
+	int status;
+
+	xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p);
+	status = decode_compound_hdr(&xdr, &hdr);
+	if (status)
+		goto out;
+	status = decode_putfh(&xdr);
+	if (status)
+		goto out;
+	status = decode_lock(&xdr, res);
+out:
+	return status;
+}
+
+/*
+ * Decode LOCKT response
+ */
+static int
+nfs4_xdr_dec_lockt(struct rpc_rqst *rqstp, uint32_t *p, struct nfs_lockres *res)
+{
+	struct xdr_stream xdr;
+	struct compound_hdr hdr;
+	int status;
+
+	xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p);
+	status = decode_compound_hdr(&xdr, &hdr);
+	if (status)
+		goto out;
+	status = decode_putfh(&xdr);
+	if (status)
+		goto out;
+	status = decode_lockt(&xdr, res);
+out:
+	return status;
+}
+
+/*
+ * Decode LOCKU response
+ */
+static int
+nfs4_xdr_dec_locku(struct rpc_rqst *rqstp, uint32_t *p, struct nfs_lockres *res)
+{
+	struct xdr_stream xdr;
+	struct compound_hdr hdr;
+	int status;
+
+	xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p);
+	status = decode_compound_hdr(&xdr, &hdr);
+	if (status)
+		goto out;
+	status = decode_putfh(&xdr);
+	if (status)
+		goto out;
+	status = decode_locku(&xdr, res);
+out:
+	return status;
+}
 
 /*
  * Decode Read response
@@ -2391,6 +3011,87 @@
 	return status;
 }
 
+/*
+ * FSINFO request
+ */
+static int
+nfs4_xdr_dec_fsinfo(struct rpc_rqst *req, uint32_t *p, struct nfs_fsinfo *fsinfo)
+{
+	struct xdr_stream xdr;
+	struct compound_hdr hdr;
+	int status;
+
+	xdr_init_decode(&xdr, &req->rq_rcv_buf, p);
+	status = decode_compound_hdr(&xdr, &hdr);
+	if (!status)
+		status = decode_putfh(&xdr);
+	if (!status)
+		status = decode_fsinfo(&xdr, fsinfo);
+	if (!status)
+		status = -nfs_stat_to_errno(hdr.status);
+	return status;
+}
+
+/*
+ * Decode RENEW response
+ */
+static int
+nfs4_xdr_dec_renew(struct rpc_rqst *rqstp, uint32_t *p, void *dummy)
+{
+	struct xdr_stream xdr;
+	struct compound_hdr hdr;
+	int status;
+
+	xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p);
+	status = decode_compound_hdr(&xdr, &hdr);
+	if (!status)
+		status = decode_renew(&xdr);
+	return status;
+}
+
+/*
+ * a SETCLIENTID request
+ */
+static int
+nfs4_xdr_dec_setclientid(struct rpc_rqst *req, uint32_t *p,
+		struct nfs4_client *clp)
+{
+	struct xdr_stream xdr;
+	struct compound_hdr hdr;
+	int status;
+
+	xdr_init_decode(&xdr, &req->rq_rcv_buf, p);
+	status = decode_compound_hdr(&xdr, &hdr);
+	if (!status)
+		status = decode_setclientid(&xdr, clp);
+	if (!status)
+		status = -nfs_stat_to_errno(hdr.status);
+	return status;
+}
+
+/*
+ * a SETCLIENTID_CONFIRM request
+ */
+static int
+nfs4_xdr_dec_setclientid_confirm(struct rpc_rqst *req, uint32_t *p, struct nfs_fsinfo *fsinfo)
+{
+	struct xdr_stream xdr;
+	struct compound_hdr hdr;
+	int status;
+
+	xdr_init_decode(&xdr, &req->rq_rcv_buf, p);
+	status = decode_compound_hdr(&xdr, &hdr);
+	if (!status)
+		status = decode_setclientid_confirm(&xdr);
+	if (!status)
+		status = decode_putrootfh(&xdr);
+	if (!status)
+		status = decode_fsinfo(&xdr, fsinfo);
+	if (!status)
+		status = -nfs_stat_to_errno(hdr.status);
+	return status;
+}
+
 uint32_t *
 nfs4_decode_dirent(uint32_t *p, struct nfs_entry *entry, int plus)
 {
@@ -2426,6 +3127,67 @@
 	return p;
 }
 
+/*
+ * We need to translate between nfs status return values and
+ * the local errno values which may not be the same.
+ */
+static struct {
+	int stat;
+	int errno;
+} nfs_errtbl[] = {
+	{ NFS4_OK,		0		},
+	{ NFS4ERR_PERM,		EPERM		},
+	{ NFS4ERR_NOENT,	ENOENT		},
+	{ NFS4ERR_IO,		errno_NFSERR_IO	},
+	{ NFS4ERR_NXIO,		ENXIO		},
+	{ NFS4ERR_ACCESS,	EACCES		},
+	{ NFS4ERR_EXIST,	EEXIST		},
+	{ NFS4ERR_XDEV,		EXDEV		},
+	{ NFS4ERR_NOTDIR,	ENOTDIR		},
+	{ NFS4ERR_ISDIR,	EISDIR		},
+	{ NFS4ERR_INVAL,	EINVAL		},
+	{ NFS4ERR_FBIG,		EFBIG		},
+	{ NFS4ERR_NOSPC,	ENOSPC		},
+	{ NFS4ERR_ROFS,		EROFS		},
+	{ NFS4ERR_MLINK,	EMLINK		},
+	{ NFS4ERR_NAMETOOLONG,	ENAMETOOLONG	},
+	{ NFS4ERR_NOTEMPTY,	ENOTEMPTY	},
+	{ NFS4ERR_DQUOT,	EDQUOT		},
+	{ NFS4ERR_STALE,	ESTALE		},
+	{ NFS4ERR_BADHANDLE,	EBADHANDLE	},
+	{ NFS4ERR_BAD_COOKIE,	EBADCOOKIE	},
+	{ NFS4ERR_NOTSUPP,	ENOTSUPP	},
+	{ NFS4ERR_TOOSMALL,	ETOOSMALL	},
+	{ NFS4ERR_SERVERFAULT,	ESERVERFAULT	},
+	{ NFS4ERR_BADTYPE,	EBADTYPE	},
+	{ NFS4ERR_LOCKED,	EAGAIN		},
+	{ NFS4ERR_RESOURCE,	EREMOTEIO	},
+	{ NFS4ERR_SYMLINK,	ELOOP		},
+	{ NFS4ERR_OP_ILLEGAL,	EOPNOTSUPP	},
+	{ NFS4ERR_DEADLOCK,	EDEADLK		},
+	{ -1,			EIO		}
+};
+
+/*
+ * Convert an NFS error code to a local one.
+ * This one is used jointly by NFSv2 and NFSv3.
+ */
+static int
+nfs_stat_to_errno(int stat)
+{
+	int i;
+	for (i = 0; nfs_errtbl[i].stat != -1; i++) {
+		if (nfs_errtbl[i].stat == stat)
+			return nfs_errtbl[i].errno;
+	}
+	/* If we cannot translate the error, the recovery routines should
+	 * handle it.
+	 * Note: remaining NFSv4 error codes have values > 10000, so should
+	 * not conflict with native Linux error codes.
+	 */
+	return stat;
+}
+
 #ifndef MAX
 # define MAX(a, b)	(((a) > (b))? (a) : (b))
 #endif
@@ -2445,8 +3207,17 @@
   PROC(COMMIT,		enc_commit,	dec_commit),
   PROC(OPEN,		enc_open,	dec_open),
   PROC(OPEN_CONFIRM,	enc_open_confirm,	dec_open_confirm),
+  PROC(OPEN_RECLAIM,	enc_open_reclaim,	dec_open_reclaim),
+  PROC(OPEN_DOWNGRADE,	enc_open_downgrade,	dec_open_downgrade),
   PROC(CLOSE,		enc_close,	dec_close),
   PROC(SETATTR,		enc_setattr,	dec_setattr),
+  PROC(FSINFO,		enc_fsinfo,	dec_fsinfo),
+  PROC(RENEW,		enc_renew,	dec_renew),
+  PROC(SETCLIENTID,	enc_setclientid,	dec_setclientid),
+  PROC(SETCLIENTID_CONFIRM,	enc_setclientid_confirm,	dec_setclientid_confirm),
+  PROC(LOCK,            enc_lock,       dec_lock),
+  PROC(LOCKT,           enc_lockt,      dec_lockt),
+  PROC(LOCKU,           enc_locku,      dec_locku),
 };
 
 struct rpc_version		nfs_version4 = {
--- diff/fs/nfs/nfsroot.c	2003-08-26 10:00:54.000000000 +0100
+++ source/fs/nfs/nfsroot.c	2004-02-09 10:39:56.000000000 +0000
@@ -166,37 +166,6 @@
 
 
 /*
- *  Extract IP address from the parameter string if needed. Note that we
- *  need to have root_server_addr set _before_ IPConfig gets called as it
- *  can override it.
- */
-static void __init root_nfs_parse_addr(char *name)
-{
-	int octets = 0;
-	char *cp, *cq;
-
-	cp = cq = name;
-	while (octets < 4) {
-		while (*cp >= '0' && *cp <= '9')
-			cp++;
-		if (cp == cq || cp - cq > 3)
-			break;
-		if (*cp == '.' || octets == 3)
-			octets++;
-		if (octets < 4)
-			cp++;
-		cq = cp;
-	}
-	if (octets == 4 && (*cp == ':' || *cp == '\0')) {
-		if (*cp == ':')
-			*cp++ = '\0';
-		root_server_addr = in_aton(name);
-		strcpy(name, cp);
-	}
-}
-
-
-/*
  *  Parse option string.
  */
 static void __init root_nfs_parse(char *name, char *buf)
@@ -345,7 +314,7 @@
 			line[sizeof(nfs_root_name) - strlen(NFS_ROOT) - 1] = '\0';
 		sprintf(nfs_root_name, NFS_ROOT, line);
 	}
-	root_nfs_parse_addr(nfs_root_name);
+	root_server_addr = root_nfs_parse_addr(nfs_root_name);
 	return 1;
 }
 
--- diff/fs/nfs/proc.c	2003-10-09 09:47:34.000000000 +0100
+++ source/fs/nfs/proc.c	2004-02-09 10:39:56.000000000 +0000
@@ -42,24 +42,13 @@
 #include <linux/nfs2.h>
 #include <linux/nfs_fs.h>
 #include <linux/nfs_page.h>
+#include <linux/lockd/bind.h>
 #include <linux/smp_lock.h>
 
 #define NFSDBG_FACILITY		NFSDBG_PROC
 
 extern struct rpc_procinfo nfs_procedures[];
 
-static void
-nfs_write_refresh_inode(struct inode *inode, struct nfs_fattr *fattr)
-{
-	if (!(fattr->valid & NFS_ATTR_WCC)) {
-		fattr->pre_size  = NFS_CACHE_ISIZE(inode);
-		fattr->pre_mtime = NFS_CACHE_MTIME(inode);
-		fattr->pre_ctime = NFS_CACHE_CTIME(inode);
-		fattr->valid |= NFS_ATTR_WCC;
-	}
-	nfs_refresh_inode(inode, fattr);
-}
-
 static struct rpc_cred *
 nfs_cred(struct inode *inode, struct file *filp)
 {
@@ -204,7 +193,7 @@
 	msg.rpc_cred = nfs_cred(inode, filp);
 	status = rpc_call_sync(NFS_CLIENT(inode), &msg, flags);
 	if (status >= 0) {
-		nfs_write_refresh_inode(inode, fattr);
+		nfs_refresh_inode(inode, fattr);
 		wdata->res.count = wdata->args.count;
 		wdata->verf.committed = NFS_FILE_SYNC;
 	}
@@ -330,10 +319,8 @@
 {
 	struct rpc_message *msg = &task->tk_msg;
 	
-	if (msg->rpc_argp) {
-		NFS_CACHEINV(dir->d_inode);
+	if (msg->rpc_argp)
 		kfree(msg->rpc_argp);
-	}
 	return 0;
 }
 
@@ -583,7 +570,7 @@
 	struct nfs_write_data *data = (struct nfs_write_data *) task->tk_calldata;
 
 	if (task->tk_status >= 0)
-		nfs_write_refresh_inode(data->inode, data->res.fattr);
+		nfs_refresh_inode(data->inode, data->res.fattr);
 	nfs_writeback_done(task);
 }
 
@@ -653,9 +640,17 @@
 	return 1;
 }
 
+static int
+nfs_proc_lock(struct file *filp, int cmd, struct file_lock *fl)
+{
+	return nlmclnt_proc(filp->f_dentry->d_inode, cmd, fl);
+}
+
 
 struct nfs_rpc_ops	nfs_v2_clientops = {
 	.version	= 2,		       /* protocol version */
+	.dentry_ops	= &nfs_dentry_operations,
+	.dir_inode_ops	= &nfs_dir_inode_operations,
 	.getroot	= nfs_proc_get_root,
 	.getattr	= nfs_proc_getattr,
 	.setattr	= nfs_proc_setattr,
@@ -687,4 +682,5 @@
 	.file_release	= nfs_release,
 	.request_init	= nfs_request_init,
 	.request_compatible = nfs_request_compatible,
+	.lock		= nfs_proc_lock,
 };
--- diff/fs/nfs/read.c	2003-10-09 09:47:34.000000000 +0100
+++ source/fs/nfs/read.c	2004-02-09 10:39:56.000000000 +0000
@@ -124,6 +124,7 @@
 		if (result < rdata.args.count)	/* NFSv2ism */
 			break;
 	} while (count);
+	NFS_FLAGS(inode) |= NFS_INO_INVALID_ATIME;
 
 	if (count)
 		memclear_highpage_flush(page, rdata.args.pgbase, count);
@@ -266,6 +267,7 @@
 	dprintk("NFS: %4d nfs_readpage_result, (status %d)\n",
 		task->tk_pid, task->tk_status);
 
+	NFS_FLAGS(data->inode) |= NFS_INO_INVALID_ATIME;
 	while (!list_empty(&data->pages)) {
 		struct nfs_page *req = nfs_list_entry(data->pages.next);
 		struct page *page = req->wb_page;
--- diff/fs/nfs/unlink.c	2003-06-30 10:07:24.000000000 +0100
+++ source/fs/nfs/unlink.c	2004-02-09 10:39:56.000000000 +0000
@@ -104,6 +104,7 @@
 	status = NFS_PROTO(dir->d_inode)->unlink_setup(&msg, dir, &data->name);
 	if (status < 0)
 		goto out_err;
+	nfs_begin_data_update(dir->d_inode);
 	rpc_call_setup(task, &msg, 0);
 	return;
  out_err:
@@ -126,7 +127,7 @@
 	if (!dir)
 		return;
 	dir_i = dir->d_inode;
-	nfs_zap_caches(dir_i);
+	nfs_end_data_update(dir_i);
 	if (NFS_PROTO(dir_i)->unlink_done(dir, task))
 		return;
 	put_rpccred(data->cred);
--- diff/fs/nfs/write.c	2004-02-09 10:36:12.000000000 +0000
+++ source/fs/nfs/write.c	2004-02-09 10:39:56.000000000 +0000
@@ -157,6 +157,7 @@
 		(long long)NFS_FILEID(inode),
 		count, (long long)(page_offset(page) + offset));
 
+	nfs_begin_data_update(inode);
 	do {
 		if (count < wsize && !swapfile)
 			wdata.args.count = count;
@@ -185,6 +186,7 @@
 		if (wdata.args.offset > i_size_read(inode))
 			i_size_write(inode, wdata.args.offset);
 	} while (count);
+	nfs_end_data_update(inode);
 
 	if (PageError(page))
 		ClearPageError(page);
@@ -204,6 +206,7 @@
 	loff_t		end;
 	int		status;
 
+	nfs_begin_data_update(inode);
 	req = nfs_update_request(file, inode, page, offset, count);
 	status = (IS_ERR(req)) ? PTR_ERR(req) : 0;
 	if (status < 0)
@@ -213,6 +216,7 @@
 	end = ((loff_t)page->index<<PAGE_CACHE_SHIFT) + (loff_t)(offset + count);
 	if (i_size_read(inode) < end)
 		i_size_write(inode, end);
+	nfs_end_data_update(inode);
 
  out:
 	return status;
@@ -312,8 +316,10 @@
 	BUG_ON(error == -EEXIST);
 	if (error)
 		return error;
-	if (!nfsi->npages)
+	if (!nfsi->npages) {
 		igrab(inode);
+		nfs_begin_data_update(inode);
+	}
 	nfsi->npages++;
 	req->wb_count++;
 	return 0;
@@ -336,6 +342,7 @@
 	nfsi->npages--;
 	if (!nfsi->npages) {
 		spin_unlock(&nfs_wreq_lock);
+		nfs_end_data_update(inode);
 		iput(inode);
 	} else
 		spin_unlock(&nfs_wreq_lock);
@@ -696,6 +703,7 @@
 		return status;
 	}
 
+	nfs_begin_data_update(inode);
 	/*
 	 * Try to find an NFS request corresponding to this page
 	 * and update it.
@@ -729,6 +737,7 @@
 	} else
 		nfs_unlock_request(req);
 done:
+	nfs_end_data_update(inode);
         dprintk("NFS:      nfs_updatepage returns %d (isize %Ld)\n",
 			status, (long long)i_size_read(inode));
 	if (status < 0)
@@ -891,10 +900,7 @@
 #endif
 
 	/*
-	 * Update attributes as result of writeback.
-	 * FIXME: There is an inherent race with invalidate_inode_pages and
-	 *	  writebacks since the page->count is kept > 1 for as long
-	 *	  as the page has a write request pending.
+	 * Process the nfs_page list
 	 */
 	while (!list_empty(&data->pages)) {
 		req = nfs_list_entry(data->pages.next);
--- diff/fs/nfsd/auth.c	2003-10-09 09:47:17.000000000 +0100
+++ source/fs/nfsd/auth.c	2004-02-09 10:39:56.000000000 +0000
@@ -11,11 +11,26 @@
 #include <linux/nfsd/nfsd.h>
 
 #define	CAP_NFSD_MASK (CAP_FS_MASK|CAP_TO_MASK(CAP_SYS_RESOURCE))
-void
-nfsd_setuser(struct svc_rqst *rqstp, struct svc_export *exp)
+
+int nfsd_setuser(struct svc_rqst *rqstp, struct svc_export *exp)
 {
 	struct svc_cred	*cred = &rqstp->rq_cred;
-	int		i;
+	struct group_info *group_info;
+	int ngroups;
+	int i;
+	int ret;
+
+	ngroups = 0;
+	if (!(exp->ex_flags & NFSEXP_ALLSQUASH)) {
+		for (i = 0; i < SVC_CRED_NGROUPS; i++) {
+			if (cred->cr_groups[i] == (gid_t)NOGROUP)
+				break;
+			ngroups++;
+		}
+	}
+	group_info = groups_alloc(ngroups);
+	if (group_info == NULL)
+		return -ENOMEM;
 
 	if (exp->ex_flags & NFSEXP_ALLSQUASH) {
 		cred->cr_uid = exp->ex_anon_uid;
@@ -26,7 +41,7 @@
 			cred->cr_uid = exp->ex_anon_uid;
 		if (!cred->cr_gid)
 			cred->cr_gid = exp->ex_anon_gid;
-		for (i = 0; i < NGROUPS; i++)
+		for (i = 0; i < SVC_CRED_NGROUPS; i++)
 			if (!cred->cr_groups[i])
 				cred->cr_groups[i] = exp->ex_anon_gid;
 	}
@@ -39,19 +54,24 @@
 		current->fsgid = cred->cr_gid;
 	else
 		current->fsgid = exp->ex_anon_gid;
-	for (i = 0; i < NGROUPS; i++) {
+
+	for (i = 0; i < SVC_CRED_NGROUPS; i++) {
 		gid_t group = cred->cr_groups[i];
 		if (group == (gid_t) NOGROUP)
 			break;
-		current->groups[i] = group;
+		GROUP_AT(group_info, i) = group;
 	}
-	current->ngroups = i;
 
-	if ((cred->cr_uid)) {
-		cap_t(current->cap_effective) &= ~CAP_NFSD_MASK;
+	ret = set_current_groups(group_info);
+	if (ret == 0) {
+		if ((cred->cr_uid)) {
+			cap_t(current->cap_effective) &= ~CAP_NFSD_MASK;
+		} else {
+			cap_t(current->cap_effective) |= (CAP_NFSD_MASK &
+							current->cap_permitted);
+		}
 	} else {
-		cap_t(current->cap_effective) |= (CAP_NFSD_MASK &
-						  current->cap_permitted);
+		put_group_info(group_info);
 	}
-
+	return ret;
 }
--- diff/fs/nfsd/nfs4state.c	2003-10-09 09:47:34.000000000 +0100
+++ source/fs/nfsd/nfs4state.c	2004-02-09 10:39:56.000000000 +0000
@@ -244,7 +244,7 @@
 
 	target->cr_uid = source->cr_uid;
 	target->cr_gid = source->cr_gid;
-	for(i = 0; i < NGROUPS; i++)
+	for(i = 0; i < SVC_CRED_NGROUPS; i++)
 		target->cr_groups[i] = source->cr_groups[i];
 }
 
--- diff/fs/ntfs/ntfs.h	2003-09-17 12:28:11.000000000 +0100
+++ source/fs/ntfs/ntfs.h	2004-02-09 10:39:56.000000000 +0000
@@ -183,7 +183,7 @@
 /* From fs/ntfs/time.c */
 extern inline s64 utc2ntfs(const time_t time);
 extern inline s64 get_current_ntfs_time(void);
-extern inline time_t ntfs2utc(const s64 time);
+extern time_t ntfs2utc(const s64 time);
 
 /* From fs/ntfs/unistr.c */
 extern BOOL ntfs_are_names_equal(const uchar_t *s1, size_t s1_len,
--- diff/fs/open.c	2004-02-09 10:36:12.000000000 +0000
+++ source/fs/open.c	2004-02-09 10:39:56.000000000 +0000
@@ -192,7 +192,9 @@
 	newattrs.ia_size = length;
 	newattrs.ia_valid = ATTR_SIZE | ATTR_CTIME;
 	down(&dentry->d_inode->i_sem);
+	down_write(&dentry->d_inode->i_alloc_sem);
 	err = notify_change(dentry, &newattrs);
+	up_write(&dentry->d_inode->i_alloc_sem);
 	up(&dentry->d_inode->i_sem);
 	return err;
 }
--- diff/fs/partitions/check.c	2003-10-09 09:47:34.000000000 +0100
+++ source/fs/partitions/check.c	2004-02-09 10:39:56.000000000 +0000
@@ -315,7 +315,10 @@
 			S_IFBLK|S_IRUSR|S_IWUSR,
 			"%s/part%d", disk->devfs_name, part);
 
-	snprintf(p->kobj.name,KOBJ_NAME_LEN,"%s%d",disk->kobj.name,part);
+	if (isdigit(disk->kobj.name[strlen(disk->kobj.name)-1]))
+		snprintf(p->kobj.name,KOBJ_NAME_LEN,"%sp%d",disk->kobj.name,part);
+	else
+		snprintf(p->kobj.name,KOBJ_NAME_LEN,"%s%d",disk->kobj.name,part);
 	p->kobj.parent = &disk->kobj;
 	p->kobj.ktype = &ktype_part;
 	kobject_register(&p->kobj);
--- diff/fs/proc/array.c	2003-10-27 09:20:39.000000000 +0000
+++ source/fs/proc/array.c	2004-02-09 10:39:56.000000000 +0000
@@ -176,8 +176,10 @@
 		p->files ? p->files->max_fds : 0);
 	task_unlock(p);
 
-	for (g = 0; g < p->ngroups; g++)
-		buffer += sprintf(buffer, "%d ", p->groups[g]);
+	get_group_info(p->group_info);
+	for (g = 0; g < min(p->group_info->ngroups,NGROUPS_SMALL); g++)
+		buffer += sprintf(buffer, "%d ", GROUP_AT(p->group_info,g));
+	put_group_info(p->group_info);
 
 	buffer += sprintf(buffer, "\n");
 	return buffer;
--- diff/fs/proc/base.c	2004-02-09 10:36:12.000000000 +0000
+++ source/fs/proc/base.c	2004-02-09 10:39:56.000000000 +0000
@@ -425,17 +425,15 @@
 	mnt = vfsmnt;
 
 	while (vfsmnt != our_vfsmnt) {
-		if (vfsmnt == vfsmnt->mnt_parent) {
-			spin_unlock(&vfsmount_lock);
+		if (vfsmnt == vfsmnt->mnt_parent)
 			goto out;
-		}
 		de = vfsmnt->mnt_mountpoint;
 		vfsmnt = vfsmnt->mnt_parent;
 	}
-	spin_unlock(&vfsmount_lock);
 
 	if (!is_subdir(de, base))
 		goto out;
+	spin_unlock(&vfsmount_lock);
 
 exit:
 	dput(base);
@@ -444,6 +442,7 @@
 	mntput(mnt);
 	return res;
 out:
+	spin_unlock(&vfsmount_lock);
 	res = -EACCES;
 	goto exit;
 }
--- diff/fs/proc/proc_misc.c	2004-02-09 10:36:12.000000000 +0000
+++ source/fs/proc/proc_misc.c	2004-02-09 10:39:56.000000000 +0000
@@ -360,23 +360,12 @@
 {
 	int i;
 	extern unsigned long total_forks;
-	u64 jif;
+	unsigned long jif;
 	unsigned int sum = 0, user = 0, nice = 0, system = 0, idle = 0, iowait = 0, irq = 0, softirq = 0;
-	struct timeval now; 
-	unsigned long seq;
 
-	/* Atomically read jiffies and time of day */ 
-	do {
-		seq = read_seqbegin(&xtime_lock);
-
-		jif = get_jiffies_64();
-		do_gettimeofday(&now);
-	} while (read_seqretry(&xtime_lock, seq));
-
-	/* calc # of seconds since boot time */
-	jif -= INITIAL_JIFFIES;
-	jif = ((u64)now.tv_sec * HZ) + (now.tv_usec/(1000000/HZ)) - jif;
-	do_div(jif, HZ);
+	jif = - wall_to_monotonic.tv_sec;
+	if (wall_to_monotonic.tv_nsec)
+		--jif;
 
 	for_each_cpu(i) {
 		int j;
@@ -652,6 +641,36 @@
 		entry->proc_fops = f;
 }
 
+#ifdef CONFIG_LOCKMETER
+extern ssize_t get_lockmeter_info(char *, size_t, loff_t *);
+extern ssize_t put_lockmeter_info(const char *, size_t);
+extern int get_lockmeter_info_size(void);
+
+/*
+ * This function accesses lock metering information.
+ */
+static ssize_t read_lockmeter(struct file *file, char *buf,
+			      size_t count, loff_t *ppos)
+{
+	return get_lockmeter_info(buf, count, ppos);
+}
+
+/*
+ * Writing to /proc/lockmeter resets the counters
+ */
+static ssize_t write_lockmeter(struct file * file, const char * buf,
+			       size_t count, loff_t *ppos)
+{
+	return put_lockmeter_info(buf, count);
+}
+
+static struct file_operations proc_lockmeter_operations = {
+	NULL,           /* lseek */
+	read:		read_lockmeter,
+	write:		write_lockmeter,
+};
+#endif  /* CONFIG_LOCKMETER */
+
 void __init proc_misc_init(void)
 {
 	struct proc_dir_entry *entry;
@@ -719,6 +738,13 @@
 	if (entry)
 		entry->proc_fops = &proc_sysrq_trigger_operations;
 #endif
+#ifdef CONFIG_LOCKMETER
+	entry = create_proc_entry("lockmeter", S_IWUSR | S_IRUGO, NULL);
+	if (entry) {
+		entry->proc_fops = &proc_lockmeter_operations;
+		entry->size = get_lockmeter_info_size();
+	}
+#endif
 #ifdef CONFIG_PPC32
 	{
 		extern struct file_operations ppc_htab_operations;
--- diff/fs/readdir.c	2003-10-09 09:47:34.000000000 +0100
+++ source/fs/readdir.c	2004-02-09 10:39:56.000000000 +0000
@@ -159,7 +159,7 @@
 	if (__put_user(0, dirent->d_name + namlen))
 		goto efault;
 	buf->previous = dirent;
-	((char *) dirent) += reclen;
+	dirent = (void *)dirent + reclen;
 	buf->current_dir = dirent;
 	buf->count -= reclen;
 	return 0;
@@ -245,7 +245,7 @@
 	if (__put_user(0, dirent->d_name + namlen))
 		goto efault;
 	buf->previous = dirent;
-	((char *) dirent) += reclen;
+	dirent = (void *)dirent + reclen;
 	buf->current_dir = dirent;
 	buf->count -= reclen;
 	return 0;
--- diff/fs/reiserfs/prints.c	2003-06-30 10:07:24.000000000 +0100
+++ source/fs/reiserfs/prints.c	2004-02-09 10:39:56.000000000 +0000
@@ -110,7 +110,7 @@
 static void sprintf_item_head (char * buf, struct item_head * ih)
 {
     if (ih) {
-	sprintf (buf, "%s", (ih_version (ih) == KEY_FORMAT_3_6) ? "*3.6* " : "*3.5*");
+	strcpy (buf, (ih_version (ih) == KEY_FORMAT_3_6) ? "*3.6* " : "*3.5*");
 	sprintf_le_key (buf + strlen (buf), &(ih->ih_key));
 	sprintf (buf + strlen (buf), ", item_len %d, item_location %d, "
 		 "free_space(entry_count) %d",
--- diff/fs/super.c	2003-10-09 09:47:34.000000000 +0100
+++ source/fs/super.c	2004-02-09 10:39:56.000000000 +0000
@@ -66,6 +66,7 @@
 		INIT_LIST_HEAD(&s->s_files);
 		INIT_LIST_HEAD(&s->s_instances);
 		INIT_HLIST_HEAD(&s->s_anon);
+		INIT_LIST_HEAD(&s->s_inodes);
 		init_rwsem(&s->s_umount);
 		sema_init(&s->s_lock, 1);
 		down_write(&s->s_umount);
@@ -708,6 +709,7 @@
 	struct super_block *sb = ERR_PTR(-ENOMEM);
 	struct vfsmount *mnt;
 	int error;
+	char *secdata = NULL;
 
 	if (!type)
 		return ERR_PTR(-ENODEV);
@@ -715,11 +717,26 @@
 	mnt = alloc_vfsmnt(name);
 	if (!mnt)
 		goto out;
+
+	if (data) {
+		secdata = alloc_secdata();
+		if (!secdata) {
+			sb = ERR_PTR(-ENOMEM);
+			goto out_mnt;
+		}
+
+		error = security_sb_copy_data(fstype, data, secdata);
+		if (error) {
+			sb = ERR_PTR(error);
+			goto out_free_secdata;
+		}
+	}
+
 	sb = type->get_sb(type, flags, name, data);
 	if (IS_ERR(sb))
-		goto out_mnt;
- 	error = security_sb_kern_mount(sb);
- 	if (error) 
+		goto out_free_secdata;
+ 	error = security_sb_kern_mount(sb, secdata);
+ 	if (error)
  		goto out_sb;
 	mnt->mnt_sb = sb;
 	mnt->mnt_root = dget(sb->s_root);
@@ -732,6 +749,8 @@
 	up_write(&sb->s_umount);
 	deactivate_super(sb);
 	sb = ERR_PTR(error);
+out_free_secdata:
+	free_secdata(secdata);
 out_mnt:
 	free_vfsmnt(mnt);
 out:
--- diff/fs/ufs/super.c	2003-10-09 09:47:34.000000000 +0100
+++ source/fs/ufs/super.c	2004-02-09 10:39:56.000000000 +0000
@@ -517,11 +517,12 @@
 		goto failed;
 	}
 	if (!(sbi->s_mount_opt & UFS_MOUNT_UFSTYPE)) {
-		printk("You didn't specify the type of your ufs filesystem\n\n"
-		"mount -t ufs -o ufstype="
-		"sun|sunx86|44bsd|old|hp|nextstep|netxstep-cd|openstep ...\n\n"
-		">>>WARNING<<< Wrong ufstype may corrupt your filesystem, "
-		"default is ufstype=old\n");
+		if (!silent)
+			printk("You didn't specify the type of your ufs filesystem\n\n"
+			"mount -t ufs -o ufstype="
+			"sun|sunx86|44bsd|old|hp|nextstep|netxstep-cd|openstep ...\n\n"
+			">>>WARNING<<< Wrong ufstype may corrupt your filesystem, "
+			"default is ufstype=old\n");
 		ufs_set_opt (sbi->s_mount_opt, UFSTYPE_OLD);
 	}
 
@@ -576,7 +577,8 @@
 		uspi->s_sbbase = 0;
 		flags |= UFS_DE_OLD | UFS_UID_OLD | UFS_ST_OLD | UFS_CG_OLD;
 		if (!(sb->s_flags & MS_RDONLY)) {
-			printk(KERN_INFO "ufstype=old is supported read-only\n"); 
+			if (!silent)
+				printk(KERN_INFO "ufstype=old is supported read-only\n");
 			sb->s_flags |= MS_RDONLY;
 		}
 		break;
@@ -590,7 +592,8 @@
 		uspi->s_sbbase = 0;
 		flags |= UFS_DE_OLD | UFS_UID_OLD | UFS_ST_OLD | UFS_CG_OLD;
 		if (!(sb->s_flags & MS_RDONLY)) {
-			printk(KERN_INFO "ufstype=nextstep is supported read-only\n");
+			if (!silent)
+				printk(KERN_INFO "ufstype=nextstep is supported read-only\n");
 			sb->s_flags |= MS_RDONLY;
 		}
 		break;
@@ -604,7 +607,8 @@
 		uspi->s_sbbase = 0;
 		flags |= UFS_DE_OLD | UFS_UID_OLD | UFS_ST_OLD | UFS_CG_OLD;
 		if (!(sb->s_flags & MS_RDONLY)) {
-			printk(KERN_INFO "ufstype=nextstep-cd is supported read-only\n");
+			if (!silent)
+				printk(KERN_INFO "ufstype=nextstep-cd is supported read-only\n");
 			sb->s_flags |= MS_RDONLY;
 		}
 		break;
@@ -618,7 +622,8 @@
 		uspi->s_sbbase = 0;
 		flags |= UFS_DE_44BSD | UFS_UID_44BSD | UFS_ST_44BSD | UFS_CG_44BSD;
 		if (!(sb->s_flags & MS_RDONLY)) {
-			printk(KERN_INFO "ufstype=openstep is supported read-only\n");
+			if (!silent)
+				printk(KERN_INFO "ufstype=openstep is supported read-only\n");
 			sb->s_flags |= MS_RDONLY;
 		}
 		break;
@@ -632,12 +637,14 @@
 		uspi->s_sbbase = 0;
 		flags |= UFS_DE_OLD | UFS_UID_OLD | UFS_ST_OLD | UFS_CG_OLD;
 		if (!(sb->s_flags & MS_RDONLY)) {
-			printk(KERN_INFO "ufstype=hp is supported read-only\n");
+			if (!silent)
+				printk(KERN_INFO "ufstype=hp is supported read-only\n");
 			sb->s_flags |= MS_RDONLY;
  		}
  		break;
 	default:
-		printk("unknown ufstype\n");
+		if (!silent)
+			printk("unknown ufstype\n");
 		goto failed;
 	}
 	
@@ -687,7 +694,8 @@
 		uspi->s_sbbase += 8;
 		goto again;
 	}
-	printk("ufs_read_super: bad magic number\n");
+	if (!silent)
+		printk("ufs_read_super: bad magic number\n");
 	goto failed;
 
 magic_found:
--- diff/fs/xattr.c	2003-09-30 15:46:19.000000000 +0100
+++ source/fs/xattr.c	2004-02-09 10:39:56.000000000 +0000
@@ -16,40 +16,6 @@
 #include <asm/uaccess.h>
 
 /*
- * Extended attribute memory allocation wrappers, originally
- * based on the Intermezzo PRESTO_ALLOC/PRESTO_FREE macros.
- * Values larger than a page are uncommon - extended attributes
- * are supposed to be small chunks of metadata, and it is quite
- * unusual to have very many extended attributes, so lists tend
- * to be quite short as well.  The 64K upper limit is derived
- * from the extended attribute size limit used by XFS.
- * Intentionally allow zero @size for value/list size requests.
- */
-static void *
-xattr_alloc(size_t size, size_t limit)
-{
-	void *ptr;
-
-	if (size > limit)
-		return ERR_PTR(-E2BIG);
-
-	if (!size)	/* size request, no buffer is needed */
-		return NULL;
-
-	ptr = kmalloc((unsigned long) size, GFP_KERNEL);
-	if (!ptr)
-		return ERR_PTR(-ENOMEM);
-	return ptr;
-}
-
-static void
-xattr_free(void *ptr, size_t size)
-{
-	if (size)	/* for a size request, no buffer was needed */
-		kfree(ptr);
-}
-
-/*
  * Extended attribute SET operations
  */
 static long
@@ -57,7 +23,7 @@
 	 size_t size, int flags)
 {
 	int error;
-	void *kvalue;
+	void *kvalue = NULL;
 	char kname[XATTR_NAME_MAX + 1];
 
 	if (flags & ~(XATTR_CREATE|XATTR_REPLACE))
@@ -69,13 +35,16 @@
 	if (error < 0)
 		return error;
 
-	kvalue = xattr_alloc(size, XATTR_SIZE_MAX);
-	if (IS_ERR(kvalue))
-		return PTR_ERR(kvalue);
-
-	if (size > 0 && copy_from_user(kvalue, value, size)) {
-		xattr_free(kvalue, size);
-		return -EFAULT;
+	if (size) {
+		if (size > XATTR_SIZE_MAX)
+			return -E2BIG;
+		kvalue = kmalloc(size, GFP_KERNEL);
+		if (!kvalue)
+			return -ENOMEM;
+		if (copy_from_user(kvalue, value, size)) {
+			kfree(kvalue);
+			return -EFAULT;
+		}
 	}
 
 	error = -EOPNOTSUPP;
@@ -90,7 +59,8 @@
 out:
 		up(&d->d_inode->i_sem);
 	}
-	xattr_free(kvalue, size);
+	if (kvalue)
+		kfree(kvalue);
 	return error;
 }
 
@@ -146,7 +116,7 @@
 getxattr(struct dentry *d, char __user *name, void __user *value, size_t size)
 {
 	ssize_t error;
-	void *kvalue;
+	void *kvalue = NULL;
 	char kname[XATTR_NAME_MAX + 1];
 
 	error = strncpy_from_user(kname, name, sizeof(kname));
@@ -155,9 +125,13 @@
 	if (error < 0)
 		return error;
 
-	kvalue = xattr_alloc(size, XATTR_SIZE_MAX);
-	if (IS_ERR(kvalue))
-		return PTR_ERR(kvalue);
+	if (size) {
+		if (size > XATTR_SIZE_MAX)
+			size = XATTR_SIZE_MAX;
+		kvalue = kmalloc(size, GFP_KERNEL);
+		if (!kvalue)
+			return -ENOMEM;
+	}
 
 	error = -EOPNOTSUPP;
 	if (d->d_inode->i_op && d->d_inode->i_op->getxattr) {
@@ -165,13 +139,18 @@
 		if (error)
 			goto out;
 		error = d->d_inode->i_op->getxattr(d, kname, kvalue, size);
+		if (error > 0) {
+			if (copy_to_user(value, kvalue, error))
+				error = -EFAULT;
+		} else if (error == -ERANGE && size >= XATTR_SIZE_MAX) {
+			/* The file system tried to returned a value bigger
+			   than XATTR_SIZE_MAX bytes. Not possible. */
+			error = -E2BIG;
+		}
 	}
-
-	if (kvalue && error > 0)
-		if (copy_to_user(value, kvalue, error))
-			error = -EFAULT;
 out:
-	xattr_free(kvalue, size);
+	if (kvalue)
+		kfree(kvalue);
 	return error;
 }
 
@@ -226,11 +205,15 @@
 listxattr(struct dentry *d, char __user *list, size_t size)
 {
 	ssize_t error;
-	char *klist;
+	char *klist = NULL;
 
-	klist = (char *)xattr_alloc(size, XATTR_LIST_MAX);
-	if (IS_ERR(klist))
-		return PTR_ERR(klist);
+	if (size) {
+		if (size > XATTR_LIST_MAX)
+			size = XATTR_LIST_MAX;
+		klist = kmalloc(size, GFP_KERNEL);
+		if (!klist)
+			return -ENOMEM;
+	}
 
 	error = -EOPNOTSUPP;
 	if (d->d_inode->i_op && d->d_inode->i_op->listxattr) {
@@ -238,13 +221,18 @@
 		if (error)
 			goto out;
 		error = d->d_inode->i_op->listxattr(d, klist, size);
+		if (error > 0) {
+			if (copy_to_user(list, klist, error))
+				error = -EFAULT;
+		} else if (error == -ERANGE && size >= XATTR_LIST_MAX) {
+			/* The file system tried to returned a list bigger
+			   than XATTR_LIST_MAX bytes. Not possible. */
+			error = -E2BIG;
+		}
 	}
-
-	if (klist && error > 0)
-		if (copy_to_user(list, klist, error))
-			error = -EFAULT;
 out:
-	xattr_free(klist, size);
+	if (klist)
+		kfree(klist);
 	return error;
 }
 
--- diff/fs/xfs/linux/xfs_aops.c	2004-02-09 10:36:12.000000000 +0000
+++ source/fs/xfs/linux/xfs_aops.c	2004-02-09 10:39:56.000000000 +0000
@@ -998,7 +998,8 @@
 	if (error)
 		return -error;
 
-	return blockdev_direct_IO(rw, iocb, inode, iomap.iomap_target->pbr_bdev,
+	return blockdev_direct_IO_no_locking(rw, iocb, inode,
+		iomap.iomap_target->pbr_bdev,
 		iov, offset, nr_segs,
 		linvfs_get_blocks_direct,
 		linvfs_unwritten_convert_direct);
--- diff/fs/xfs/xfs_buf_item.c	2004-02-09 10:36:12.000000000 +0000
+++ source/fs/xfs/xfs_buf_item.c	2004-02-09 10:39:56.000000000 +0000
@@ -429,7 +429,7 @@
 		 */
 		if (bip->bli_flags & XFS_BLI_STALE_INODE) {
 			xfs_buf_do_callbacks(bp, (xfs_log_item_t *)bip);
-			XFS_BUF_FSPRIVATE(bp, void *) = NULL;
+			XFS_BUF_SET_FSPRIVATE(bp, NULL);
 			XFS_BUF_CLR_IODONE_FUNC(bp);
 		} else {
 			AIL_LOCK(mp,s);
--- diff/fs/xfs/xfs_inode.c	2004-02-09 10:36:12.000000000 +0000
+++ source/fs/xfs/xfs_inode.c	2004-02-09 10:39:56.000000000 +0000
@@ -3707,7 +3707,8 @@
 	 * Read/write DACs are always overridable.
 	 * Executable DACs are overridable if at least one exec bit is set.
 	 */
-	if ((orgmode & (S_IRUSR|S_IWUSR)) || (inode->i_mode & S_IXUGO))
+	if (!(orgmode & S_IXUSR) || (inode->i_mode & S_IXUGO) ||
+	    (ip->i_d.di_mode & S_IFMT) == S_IFDIR)
 		if (capable_cred(cr, CAP_DAC_OVERRIDE))
 			return 0;
 
--- diff/include/acpi/processor.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/acpi/processor.h	2004-02-09 10:39:56.000000000 +0000
@@ -9,8 +9,6 @@
 #define ACPI_PROCESSOR_MAX_C2_LATENCY	100
 #define ACPI_PROCESSOR_MAX_C3_LATENCY	1000
 
-#define ACPI_PROCESSOR_MAX_PERFORMANCE	8
-
 #define ACPI_PROCESSOR_MAX_THROTTLING	16
 #define ACPI_PROCESSOR_MAX_THROTTLE	250	/* 25% */
 #define ACPI_PROCESSOR_MAX_DUTY_WIDTH	4
@@ -67,20 +65,22 @@
 	acpi_integer		status;			/* success indicator */
 };
 
+#define ACPI_PDC_REVISION_ID                   0x1
+
 struct acpi_processor_performance {
-	int			state;
-	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];
-	struct acpi_processor   *pr;
+	unsigned int		 state;
+	unsigned int		 platform_limit;
+	struct acpi_pct_register control_register;
+	struct acpi_pct_register status_register;
+	unsigned int		 state_count;
+	struct acpi_processor_px *states;
+
+	/* the _PDC objects passed by the driver, if any */
+	struct acpi_object_list *pdc;
 };
 
 
+
 /* Throttling Control */
 
 struct acpi_processor_tx {
@@ -133,11 +133,11 @@
 	struct acpi_processor_limit limit;
 };
 
-extern int acpi_processor_get_platform_limit (
-	struct acpi_processor*	pr);
 extern int acpi_processor_register_performance (
 	struct acpi_processor_performance * performance,
-	struct acpi_processor ** pr,
+	unsigned int cpu);
+extern void acpi_processor_unregister_performance (
+	struct acpi_processor_performance * performance,
 	unsigned int cpu);
 
 #endif
--- diff/include/asm-alpha/byteorder.h	2003-02-26 16:01:09.000000000 +0000
+++ source/include/asm-alpha/byteorder.h	2004-02-09 10:39:56.000000000 +0000
@@ -6,7 +6,7 @@
 
 #ifdef __GNUC__
 
-static __inline __u32 __attribute__((__const)) __arch__swab32(__u32 x)
+static __inline __u32 __attribute_const__ __arch__swab32(__u32 x)
 {
 	/*
 	 * Unfortunately, we can't use the 6 instruction sequence
--- diff/include/asm-alpha/io.h	2003-02-26 16:01:02.000000000 +0000
+++ source/include/asm-alpha/io.h	2004-02-09 10:39:56.000000000 +0000
@@ -412,6 +412,11 @@
 # define readq(a)	_readq((unsigned long)(a))
 #endif
 
+#define readb_relaxed(addr) readb(addr)
+#define readw_relaxed(addr) readw(addr)
+#define readl_relaxed(addr) readl(addr)
+#define readq_relaxed(addr) readq(addr)
+
 #ifndef writeb
 # define writeb(v,a)	_writeb((v),(unsigned long)(a))
 #endif
--- diff/include/asm-alpha/mmzone.h	2003-07-11 09:39:50.000000000 +0100
+++ source/include/asm-alpha/mmzone.h	2004-02-09 10:39:56.000000000 +0000
@@ -72,9 +72,8 @@
     ((unsigned long)__va(NODE_DATA(kvaddr_to_nid(kaddr))->node_start_pfn  \
 			 << PAGE_SHIFT))
 
-#define kern_addr_valid(kaddr)						  \
-    test_bit(local_mapnr(kaddr), 					  \
-	     NODE_DATA(kvaddr_to_nid(kaddr))->valid_addr_bitmap)
+/* XXX: FIXME -- wli */
+#define kern_addr_valid(kaddr)	(0)
 
 #define virt_to_page(kaddr)	pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
 
--- diff/include/asm-alpha/param.h	2002-10-16 04:27:55.000000000 +0100
+++ source/include/asm-alpha/param.h	2004-02-09 10:39:56.000000000 +0000
@@ -19,10 +19,6 @@
 
 #define EXEC_PAGESIZE	8192
 
-#ifndef NGROUPS
-#define NGROUPS		32
-#endif
-
 #ifndef NOGROUP
 #define NOGROUP		(-1)
 #endif
--- diff/include/asm-alpha/pci.h	2003-08-20 14:16:33.000000000 +0100
+++ source/include/asm-alpha/pci.h	2004-02-09 10:39:56.000000000 +0000
@@ -51,6 +51,7 @@
    bus numbers.  */
 
 #define pcibios_assign_all_busses()	1
+#define pcibios_scan_all_fns(a, b)	0
 
 #define PCIBIOS_MIN_IO		alpha_mv.min_io_address
 #define PCIBIOS_MIN_MEM		alpha_mv.min_mem_address
--- diff/include/asm-alpha/spinlock.h	2003-10-09 09:47:17.000000000 +0100
+++ source/include/asm-alpha/spinlock.h	2004-02-09 10:39:56.000000000 +0000
@@ -6,6 +6,10 @@
 #include <linux/kernel.h>
 #include <asm/current.h>
 
+#ifdef CONFIG_LOCKMETER
+#undef DEBUG_SPINLOCK
+#undef DEBUG_RWLOCK
+#endif
 
 /*
  * Simple spin lock operations.  There are two variants, one clears IRQ's
@@ -95,9 +99,18 @@
 
 typedef struct {
 	volatile int write_lock:1, read_counter:31;
+#ifdef CONFIG_LOCKMETER
+	/* required for LOCKMETER since all bits in lock are used */
+	/* need this storage for CPU and lock INDEX ............. */
+	unsigned magic;
+#endif
 } /*__attribute__((aligned(32)))*/ rwlock_t;
 
+#ifdef CONFIG_LOCKMETER
+#define RW_LOCK_UNLOCKED (rwlock_t) { 0, 0, 0 }
+#else
 #define RW_LOCK_UNLOCKED (rwlock_t) { 0, 0 }
+#endif
 
 #define rwlock_init(x)	do { *(x) = RW_LOCK_UNLOCKED; } while(0)
 #define rwlock_is_locked(x)	(*(volatile int *)(x) != 0)
@@ -169,4 +182,41 @@
 	: "m" (*lock) : "memory");
 }
 
+#ifdef CONFIG_LOCKMETER
+static inline int _raw_write_trylock(rwlock_t *lock)
+{
+	long temp,result;
+
+	__asm__ __volatile__(
+	"	ldl_l %1,%0\n"
+	"	mov $31,%2\n"
+	"	bne %1,1f\n"
+	"	or $31,1,%2\n"
+	"	stl_c %2,%0\n"
+	"1:	mb\n"
+	: "=m" (*(volatile int *)lock), "=&r" (temp), "=&r" (result)
+	: "m" (*(volatile int *)lock)
+	);
+
+	return (result);
+}
+
+static inline int _raw_read_trylock(rwlock_t *lock)
+{
+	unsigned long temp,result;
+
+	__asm__ __volatile__(
+	"	ldl_l %1,%0\n"
+	"	mov $31,%2\n"
+	"	blbs %1,1f\n"
+	"	subl %1,2,%2\n"
+	"	stl_c %2,%0\n"
+	"1:	mb\n"
+	: "=m" (*(volatile int *)lock), "=&r" (temp), "=&r" (result)
+	: "m" (*(volatile int *)lock)
+	);
+	return (result);
+}
+#endif /* CONFIG_LOCKMETER */
+
 #endif /* _ALPHA_SPINLOCK_H */
--- diff/include/asm-alpha/topology.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/asm-alpha/topology.h	2004-02-09 10:39:56.000000000 +0000
@@ -39,9 +39,6 @@
 	return node_cpu_mask;
 }
 
-# define node_to_memblk(node)		(node)
-# define memblk_to_node(memblk)	(memblk)
-
 /* Cross-node load balancing interval. */
 # define NODE_BALANCE_RATE 10
 
--- diff/include/asm-arm/arch-ebsa110/io.h	2002-10-16 04:28:28.000000000 +0100
+++ source/include/asm-arm/arch-ebsa110/io.h	2004-02-09 10:39:56.000000000 +0000
@@ -38,6 +38,9 @@
 #define readb(b)		__readb(b)
 #define readw(b)		__readw(b)
 #define readl(b)		__readl(b)
+#define readb_relaxed(addr)	readb(addr)
+#define readw_relaxed(addr)	readw(addr)
+#define readl_relaxed(addr)	readl(addr)
 
 void __writeb(u8  val, void *addr);
 void __writew(u16 val, void *addr);
--- diff/include/asm-arm/current.h	2003-01-13 14:18:15.000000000 +0000
+++ source/include/asm-arm/current.h	2004-02-09 10:39:56.000000000 +0000
@@ -3,7 +3,7 @@
 
 #include <linux/thread_info.h>
 
-static inline struct task_struct *get_current(void) __attribute__ (( __const__ ));
+static inline struct task_struct *get_current(void) __attribute_const__;
 
 static inline struct task_struct *get_current(void)
 {
--- diff/include/asm-arm/io.h	2003-02-13 11:46:55.000000000 +0000
+++ source/include/asm-arm/io.h	2004-02-09 10:39:56.000000000 +0000
@@ -149,6 +149,9 @@
 #define readb(c) ({ unsigned int __v = __raw_readb(__mem_pci(c)); __v; })
 #define readw(c) ({ unsigned int __v = le16_to_cpu(__raw_readw(__mem_pci(c))); __v; })
 #define readl(c) ({ unsigned int __v = le32_to_cpu(__raw_readl(__mem_pci(c))); __v; })
+#define readb_relaxed(addr) readb(addr)
+#define readw_relaxed(addr) readw(addr)
+#define readl_relaxed(addr) readl(addr)
 
 #define readsb(p,d,l)		__raw_readsb((unsigned int)__mem_pci(p),d,l)
 #define readsw(p,d,l)		__raw_readsw((unsigned int)__mem_pci(p),d,l)
--- diff/include/asm-arm/param.h	2003-09-17 12:28:12.000000000 +0100
+++ source/include/asm-arm/param.h	2004-02-09 10:39:56.000000000 +0000
@@ -26,10 +26,6 @@
 
 #define EXEC_PAGESIZE	4096
 
-#ifndef NGROUPS
-#define NGROUPS         32
-#endif
-
 #ifndef NOGROUP
 #define NOGROUP         (-1)
 #endif
--- diff/include/asm-arm/pci.h	2003-09-17 12:28:12.000000000 +0100
+++ source/include/asm-arm/pci.h	2004-02-09 10:39:56.000000000 +0000
@@ -20,6 +20,8 @@
 #endif
 
 
+#define pcibios_scan_all_fns(a, b)	0
+
 static inline void pcibios_set_master(struct pci_dev *dev)
 {
 	/* No special bus mastering setup handling */
--- diff/include/asm-arm/thread_info.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/asm-arm/thread_info.h	2004-02-09 10:39:56.000000000 +0000
@@ -77,7 +77,7 @@
 /*
  * how to get the thread information struct from C
  */
-static inline struct thread_info *current_thread_info(void) __attribute__ (( __const__ ));
+static inline struct thread_info *current_thread_info(void) __attribute_const__;
 
 static inline struct thread_info *current_thread_info(void)
 {
--- diff/include/asm-arm26/current.h	2003-06-30 10:07:24.000000000 +0100
+++ source/include/asm-arm26/current.h	2004-02-09 10:39:56.000000000 +0000
@@ -3,7 +3,7 @@
 
 #include <linux/thread_info.h>
 
-static inline struct task_struct *get_current(void) __attribute__ (( __const__ ));
+static inline struct task_struct *get_current(void) __attribute_const__;
 
 static inline struct task_struct *get_current(void)
 {
--- diff/include/asm-arm26/io.h	2003-06-30 10:07:24.000000000 +0100
+++ source/include/asm-arm26/io.h	2004-02-09 10:39:56.000000000 +0000
@@ -308,6 +308,9 @@
 #define readb(c)                        (__readwrite_bug("readb"),0)
 #define readw(c)                        (__readwrite_bug("readw"),0)
 #define readl(c)                        (__readwrite_bug("readl"),0)
+#define readb_relaxed(addr)		readb(addr)
+#define readw_relaxed(addr)		readw(addr)
+#define readl_relaxed(addr)		readl(addr)
 #define writeb(v,c)                     __readwrite_bug("writeb")
 #define writew(v,c)                     __readwrite_bug("writew")
 #define writel(v,c)                     __readwrite_bug("writel")
--- diff/include/asm-arm26/param.h	2003-06-30 10:07:24.000000000 +0100
+++ source/include/asm-arm26/param.h	2004-02-09 10:39:56.000000000 +0000
@@ -22,10 +22,6 @@
 # define HZ		100
 #endif
 
-#ifndef NGROUPS
-#define NGROUPS         32
-#endif
-
 #ifndef NOGROUP
 #define NOGROUP         (-1)
 #endif
--- diff/include/asm-arm26/pci.h	2003-06-30 10:07:24.000000000 +0100
+++ source/include/asm-arm26/pci.h	2004-02-09 10:39:56.000000000 +0000
@@ -1,5 +1,6 @@
 /* Should not be needed. IDE stupidity */
 /* JMA 18.05.03 - is kinda needed, if only to tell it we don't have a PCI bus */
 
-#define PCI_DMA_BUS_IS_PHYS  0
+#define PCI_DMA_BUS_IS_PHYS  		0
+#define pcibios_scan_all_fns(a, b)	0
 
--- diff/include/asm-arm26/thread_info.h	2003-07-11 09:39:50.000000000 +0100
+++ source/include/asm-arm26/thread_info.h	2004-02-09 10:39:56.000000000 +0000
@@ -71,7 +71,7 @@
 /*
  * how to get the thread information struct from C
  */
-static inline struct thread_info *current_thread_info(void) __attribute__ (( __const__ ));
+static inline struct thread_info *current_thread_info(void) __attribute_const__;
 
 static inline struct thread_info *current_thread_info(void)
 {
--- diff/include/asm-cris/io.h	2003-07-11 09:39:50.000000000 +0100
+++ source/include/asm-cris/io.h	2004-02-09 10:39:56.000000000 +0000
@@ -42,6 +42,9 @@
 #define readb(addr) (*(volatile unsigned char *) (addr))
 #define readw(addr) (*(volatile unsigned short *) (addr))
 #define readl(addr) (*(volatile unsigned int *) (addr))
+#define readb_relaxed(addr) readb(addr)
+#define readw_relaxed(addr) readw(addr)
+#define readl_relaxed(addr) readl(addr)
 #define __raw_readb readb
 #define __raw_readw readw
 #define __raw_readl readl
--- diff/include/asm-cris/param.h	2003-07-11 09:39:50.000000000 +0100
+++ source/include/asm-cris/param.h	2004-02-09 10:39:56.000000000 +0000
@@ -14,10 +14,6 @@
 
 #define EXEC_PAGESIZE	8192
 
-#ifndef NGROUPS
-#define NGROUPS		32
-#endif
-
 #ifndef NOGROUP
 #define NOGROUP		(-1)
 #endif
--- diff/include/asm-generic/pci.h	2003-05-21 11:49:50.000000000 +0100
+++ source/include/asm-generic/pci.h	2004-02-09 10:39:56.000000000 +0000
@@ -22,4 +22,6 @@
 	region->end = res->end;
 }
 
+#define pcibios_scan_all_fns(a, b)	0
+
 #endif
--- diff/include/asm-generic/topology.h	2003-05-21 11:49:46.000000000 +0100
+++ source/include/asm-generic/topology.h	2004-02-09 10:39:56.000000000 +0000
@@ -32,9 +32,6 @@
 #ifndef cpu_to_node
 #define cpu_to_node(cpu)	(0)
 #endif
-#ifndef memblk_to_node
-#define memblk_to_node(memblk)	(0)
-#endif
 #ifndef parent_node
 #define parent_node(node)	(0)
 #endif
@@ -44,9 +41,6 @@
 #ifndef node_to_first_cpu
 #define node_to_first_cpu(node)	(0)
 #endif
-#ifndef node_to_memblk
-#define node_to_memblk(node)	(0)
-#endif
 #ifndef pcibus_to_cpumask
 #define pcibus_to_cpumask(bus)	(cpu_online_map)
 #endif
--- diff/include/asm-h8300/bitops.h	2004-01-19 10:22:59.000000000 +0000
+++ source/include/asm-h8300/bitops.h	2004-02-09 10:39:56.000000000 +0000
@@ -35,172 +35,151 @@
 	return result;
 }
 
-static __inline__ void set_bit(int nr, volatile unsigned long* addr)
-{
-	volatile unsigned char *b_addr;
-	b_addr = (volatile unsigned char *)addr + ((nr >> 3) ^ 3);
-	__asm__("mov.l %1,er0\n\t"
-		"bset r0l,%0"
-		:"+m"(*b_addr)
-		:"g"(nr & 7),"m"(*b_addr)
-		:"er0");
+#define H8300_GEN_BITOP_CONST(OP,BIT)			    \
+	case BIT:					    \
+	__asm__(OP " #" #BIT ",@%0"::"r"(b_addr):"memory"); \
+	break;
+
+#define H8300_GEN_BITOP(FNAME,OP)				      \
+static __inline__ void FNAME(int nr, volatile unsigned long* addr)    \
+{								      \
+	volatile unsigned char *b_addr;				      \
+	b_addr = (volatile unsigned char *)addr + ((nr >> 3) ^ 3);    \
+	if (__builtin_constant_p(nr)) {				      \
+		switch(nr & 7) {				      \
+			H8300_GEN_BITOP_CONST(OP,0)		      \
+			H8300_GEN_BITOP_CONST(OP,1)		      \
+			H8300_GEN_BITOP_CONST(OP,2)		      \
+			H8300_GEN_BITOP_CONST(OP,3)		      \
+			H8300_GEN_BITOP_CONST(OP,4)		      \
+			H8300_GEN_BITOP_CONST(OP,5)		      \
+			H8300_GEN_BITOP_CONST(OP,6)		      \
+			H8300_GEN_BITOP_CONST(OP,7)		      \
+		}						      \
+	} else {						      \
+		__asm__(OP " %w0,@%1"::"r"(nr),"r"(b_addr):"memory"); \
+	}							      \
 }
 
-/* Bigendian is complexed... */
-#define __set_bit(nr, addr) set_bit((nr), (addr))
-
 /*
  * clear_bit() doesn't provide any barrier for the compiler.
  */
 #define smp_mb__before_clear_bit()	barrier()
 #define smp_mb__after_clear_bit()	barrier()
 
-static __inline__ void clear_bit(int nr, volatile unsigned long* addr)
-{
-	volatile unsigned char *b_addr;
-	b_addr = (volatile unsigned char *)addr + ((nr >> 3) ^ 3);
-	__asm__("mov.l %1,er0\n\t"
-		"bclr r0l,%0"
-		:"+m"(*b_addr)
-		:"g"(nr & 7),"m"(*b_addr)
-		:"er0");
-}
-
-#define __clear_bit(nr, addr) clear_bit((nr), (addr))
+H8300_GEN_BITOP(set_bit	  ,"bset")
+H8300_GEN_BITOP(clear_bit ,"bclr")
+H8300_GEN_BITOP(change_bit,"bnot")
+#define __set_bit(nr,addr)    set_bit((nr),(addr))
+#define __clear_bit(nr,addr)  clear_bit((nr),(addr))
+#define __change_bit(nr,addr) change_bit((nr),(addr))
 
-static __inline__ void change_bit(int nr, volatile unsigned long* addr)
-{
-	volatile unsigned char *b_addr;
-	b_addr = (volatile unsigned char *)addr + ((nr >> 3) ^ 3);
-	__asm__("mov.l %1,er0\n\t"
-		"bnot r0l,%0"
-		:"+m"(*b_addr)
-		:"g"(nr & 7),"m"(*b_addr)
-		:"er0");
-}
-
-#define __change_bit(nr, addr) change_bit((nr), (addr))
+#undef H8300_GEN_BITOP
+#undef H8300_GEN_BITOP_CONST
 
 static __inline__ int test_bit(int nr, const unsigned long* addr)
 {
-	return (*((volatile unsigned char *)addr + ((nr >> 3) ^ 3)) & (1UL << (nr & 7))) != 0;
+	return (*((volatile unsigned char *)addr + 
+               ((nr >> 3) ^ 3)) & (1UL << (nr & 7))) != 0;
 }
 
 #define __test_bit(nr, addr) test_bit(nr, addr)
 
-static __inline__ int test_and_set_bit(int nr, volatile unsigned long* addr)
-{
-	int retval = 0;
-	volatile unsigned char *a;
-
-	a = (volatile unsigned char *)addr += ((nr >> 3) ^ 3);             \
-	__asm__("mov.l %4,er3\n\t"
-		"stc ccr,r3h\n\t"
-		"orc #0x80,ccr\n\t"
-		"btst r3l,%1\n\t"
-		"bset r3l,%1\n\t"
-		"beq 1f\n\t"
-		"inc.l #1,%0\n\t"
-		"1:"
-		"ldc r3h,ccr"
-		: "=r"(retval),"+m"(*a)
-		: "0" (retval),"m" (*a),"g"(nr & 7):"er3","memory");
-	return retval;
-}
-
-static __inline__ int __test_and_set_bit(int nr, volatile unsigned long* addr)
-{
-	int retval = 0;
-	volatile unsigned char *a;
-
-	a = (volatile unsigned char *)addr += ((nr >> 3) ^ 3);             \
-	__asm__("mov.l %4,er3\n\t"
-		"btst r3l,%1\n\t"
-		"bset r3l,%1\n\t"
-		"beq 1f\n\t"
-		"inc.l #1,%0\n\t"
-		"1:"
-		: "=r"(retval),"+m"(*a)
-		: "0" (retval),"m" (*a),"g"(nr & 7):"er3","memory");
-	return retval;
-}
-
-static __inline__ int test_and_clear_bit(int nr, volatile unsigned long* addr)
-{
-	int retval = 0;
-	volatile unsigned char *a;
-
-	a = (volatile unsigned char *)addr += ((nr >> 3) ^ 3);             \
-	__asm__("mov.l %4,er3\n\t"
-		"stc ccr,r3h\n\t"
-		"orc #0x80,ccr\n\t"
-		"btst r3l,%1\n\t"
-		"bclr r3l,%1\n\t"
-		"beq 1f\n\t"
-		"inc.l #1,%0\n\t"
-		"1:"
-		"ldc r3h,ccr"
-		: "=r"(retval),"+m"(*a)
-		: "0" (retval),"m" (*a),"g"(nr & 7):"er3","memory");
-	return retval;
-}
-
-static __inline__ int __test_and_clear_bit(int nr, volatile unsigned long* addr)
-{
-	int retval = 0;
-	volatile unsigned char *a;
-
-	a = (volatile unsigned char *)addr += ((nr >> 3) ^ 3);             \
-	__asm__("mov.l %4,er3\n\t"
-		"btst r3l,%1\n\t"
-		"bclr r3l,%1\n\t"
-		"beq 1f\n\t"
-		"inc.l #1,%0\n\t"
-		"1:"
-		: "=r"(retval),"+m"(*a)
-		: "0" (retval),"m" (*a),"g"(nr & 7):"er3","memory");
-	return retval;
-}
-
-static __inline__ int test_and_change_bit(int nr, volatile unsigned long* addr)
-{
-	int retval = 0;
-	volatile unsigned char *a;
-
-	a = (volatile unsigned char *)addr += ((nr >> 3) ^ 3);             \
-	__asm__("mov.l %4,er3\n\t"
-		"stc ccr,r3h\n\t"
-		"orc #0x80,ccr\n\t"
-		"btst r3l,%1\n\t"
-		"bnot r3l,%1\n\t"
-		"beq 1f\n\t"
-		"inc.l #1,%0\n\t"
-		"1:"
-		"ldc r3h,ccr"
-		: "=r"(retval),"+m"(*a)
-		: "0" (retval),"m" (*a),"g"(nr & 7):"er3","memory");
-	return retval;
-}
-
-static __inline__ int __test_and_change_bit(int nr, volatile unsigned long* addr)
-{
-	int retval = 0;
-	volatile unsigned char *a;
-
-	a = (volatile unsigned char *)addr += ((nr >> 3) ^ 3);             \
-	__asm__("mov.l %4,er3\n\t"
-		"btst r3l,%1\n\t"
-		"bnot r3l,%1\n\t"
-		"beq 1f\n\t"
-		"inc.l #1,%0\n\t"
-		"1:"
-		: "=r"(retval),"+m"(*a)
-		: "0" (retval),"m" (*a),"g"(nr & 7):"er3","memory");
-	return retval;
-}
+#define H8300_GEN_TEST_BITOP_CONST_INT(OP,BIT)			     \
+	case BIT:						     \
+	__asm__("stc ccr,%w1\n\t"				     \
+		"orc #0x80,ccr\n\t"				     \
+		"bld #" #BIT ",@%3\n\t"				     \
+		OP " #" #BIT ",@%3\n\t"				     \
+		"rotxl.l %0\n\t"				     \
+		"ldc %w1,ccr"					     \
+		: "=r"(retval),"=&r"(ccrsave)			     \
+		: "0" (retval),"r" (b_addr)			     \
+		: "memory");                                         \
+        break;
+
+#define H8300_GEN_TEST_BITOP_CONST(OP,BIT)			     \
+	case BIT:						     \
+	__asm__("bld #" #BIT ",@%2\n\t"				     \
+		OP " #" #BIT ",@%2\n\t"				     \
+		"rotxl.l %0\n\t"				     \
+		: "=r"(retval)					     \
+		: "0" (retval),"r" (b_addr)			     \
+		: "memory");                                         \
+        break;
+
+#define H8300_GEN_TEST_BITOP(FNNAME,OP)				     \
+static __inline__ int FNNAME(int nr, volatile void * addr)	     \
+{								     \
+	int retval = 0;						     \
+	char ccrsave;						     \
+	volatile unsigned char *b_addr;				     \
+	b_addr = (volatile unsigned char *)addr + ((nr >> 3) ^ 3);   \
+	if (__builtin_constant_p(nr)) {				     \
+		switch(nr & 7) {				     \
+			H8300_GEN_TEST_BITOP_CONST_INT(OP,0)	     \
+			H8300_GEN_TEST_BITOP_CONST_INT(OP,1)	     \
+			H8300_GEN_TEST_BITOP_CONST_INT(OP,2)	     \
+			H8300_GEN_TEST_BITOP_CONST_INT(OP,3)	     \
+			H8300_GEN_TEST_BITOP_CONST_INT(OP,4)	     \
+			H8300_GEN_TEST_BITOP_CONST_INT(OP,5)	     \
+			H8300_GEN_TEST_BITOP_CONST_INT(OP,6)	     \
+			H8300_GEN_TEST_BITOP_CONST_INT(OP,7)	     \
+		}						     \
+	} else {						     \
+		__asm__("stc ccr,%w1\n\t"			     \
+			"orc #0x80,ccr\n\t"			     \
+			"btst %w4,@%3\n\t"			     \
+			OP " %w4,@%3\n\t"			     \
+			"beq 1f\n\t"				     \
+			"inc.l #1,%0\n"				     \
+			"1:\n\t"				     \
+			"ldc %w1,ccr"				     \
+			: "=r"(retval),"=&r"(ccrsave)		     \
+			: "0" (retval),"r" (b_addr),"r"(nr)	     \
+			: "memory");				     \
+	}							     \
+	return retval;						     \
+}								     \
+								     \
+static __inline__ int __ ## FNNAME(int nr, volatile void * addr)     \
+{								     \
+	int retval = 0;						     \
+	volatile unsigned char *b_addr;				     \
+	b_addr = (volatile unsigned char *)addr + ((nr >> 3) ^ 3);   \
+	if (__builtin_constant_p(nr)) {				     \
+		switch(nr & 7) {				     \
+			H8300_GEN_TEST_BITOP_CONST(OP,0) 	     \
+			H8300_GEN_TEST_BITOP_CONST(OP,1) 	     \
+			H8300_GEN_TEST_BITOP_CONST(OP,2) 	     \
+			H8300_GEN_TEST_BITOP_CONST(OP,3) 	     \
+			H8300_GEN_TEST_BITOP_CONST(OP,4) 	     \
+			H8300_GEN_TEST_BITOP_CONST(OP,5) 	     \
+			H8300_GEN_TEST_BITOP_CONST(OP,6) 	     \
+			H8300_GEN_TEST_BITOP_CONST(OP,7) 	     \
+		}						     \
+	} else {						     \
+		__asm__("btst %w3,@%2\n\t"			     \
+			OP " %w3,@%2\n\t"			     \
+			"beq 1f\n\t"				     \
+			"inc.l #1,%0\n"				     \
+			"1:"					     \
+			: "=r"(retval)				     \
+			: "0" (retval),"r" (b_addr),"r"(nr)	     \
+			: "memory");				     \
+	}							     \
+	return retval;						     \
+}
+
+H8300_GEN_TEST_BITOP(test_and_set_bit,	 "bset")
+H8300_GEN_TEST_BITOP(test_and_clear_bit, "bclr")
+H8300_GEN_TEST_BITOP(test_and_change_bit,"bnot")
+#undef H8300_GEN_TEST_BITOP_CONST
+#undef H8300_GEN_TEST_BITOP_CONST_INT
+#undef H8300_GEN_TEST_BITOP
 
 #define find_first_zero_bit(addr, size) \
-        find_next_zero_bit((addr), (size), 0)
+	find_next_zero_bit((addr), (size), 0)
 
 static __inline__ int find_next_zero_bit (void * addr, int size, int offset)
 {
@@ -326,7 +305,7 @@
 }
 
 #define ext2_find_first_zero_bit(addr, size) \
-        ext2_find_next_zero_bit((addr), (size), 0)
+	ext2_find_next_zero_bit((addr), (size), 0)
 
 static __inline__ unsigned long ext2_find_next_zero_bit(void *addr, unsigned long size, unsigned long offset)
 {
--- diff/include/asm-h8300/io.h	2003-08-26 10:00:54.000000000 +0100
+++ source/include/asm-h8300/io.h	2004-02-09 10:39:56.000000000 +0000
@@ -47,6 +47,10 @@
 #define readl(addr) \
     ({ unsigned int __v = (*(volatile unsigned int *) (addr & 0x00ffffff)); __v; })
 
+#define readb_relaxed(addr) readb(addr)
+#define readw_relaxed(addr) readw(addr)
+#define readl_relaxed(addr) readl(addr)
+
 #define writeb(b,addr) (void)((*(volatile unsigned char *) (addr & 0x00ffffff)) = (b))
 #define writew(b,addr) (void)((*(volatile unsigned short *) (addr & 0x00ffffff)) = (b))
 #define writel(b,addr) (void)((*(volatile unsigned int *) (addr & 0x00ffffff)) = (b))
--- diff/include/asm-h8300/param.h	2003-05-21 11:50:10.000000000 +0100
+++ source/include/asm-h8300/param.h	2004-02-09 10:39:56.000000000 +0000
@@ -14,10 +14,6 @@
 
 #define EXEC_PAGESIZE	4096
 
-#ifndef NGROUPS
-#define NGROUPS		32
-#endif
-
 #ifndef NOGROUP
 #define NOGROUP		(-1)
 #endif
--- diff/include/asm-h8300/pci.h	2003-09-17 12:28:12.000000000 +0100
+++ source/include/asm-h8300/pci.h	2004-02-09 10:39:56.000000000 +0000
@@ -8,6 +8,7 @@
  */
 
 #define pcibios_assign_all_busses()	0
+#define pcibios_scan_all_fns(a, b)	0
 
 extern inline void pcibios_set_master(struct pci_dev *dev)
 {
--- diff/include/asm-i386/acpi.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/asm-i386/acpi.h	2004-02-09 10:39:56.000000000 +0000
@@ -116,6 +116,7 @@
 
 #ifdef CONFIG_X86_IO_APIC
 extern int skip_ioapic_setup;
+extern int acpi_irq_to_vector(u32 irq);
 
 static inline void disable_ioapic_setup(void)
 {
--- diff/include/asm-i386/apic.h	2003-09-17 12:28:12.000000000 +0100
+++ source/include/asm-i386/apic.h	2004-02-09 10:39:56.000000000 +0000
@@ -41,7 +41,7 @@
 	do { } while ( apic_read( APIC_ICR ) & APIC_ICR_BUSY );
 }
 
-#ifdef CONFIG_X86_GOOD_APIC
+#ifndef CONFIG_X86_BAD_APIC
 # define FORCE_READ_AROUND_WRITE 0
 # define apic_read_around(x)
 # define apic_write_around(x,y) apic_write((x),(y))
@@ -56,7 +56,7 @@
 	/*
 	 * ack_APIC_irq() actually gets compiled as a single instruction:
 	 * - a single rmw on Pentium/82489DX
-	 * - a single write on P6+ cores (CONFIG_X86_GOOD_APIC)
+	 * - a single write on P6+ cores (!CONFIG_X86_BAD_APIC)
 	 * ... yummie.
 	 */
 
@@ -85,7 +85,7 @@
 extern void enable_lapic_nmi_watchdog(void);
 extern void disable_timer_nmi_watchdog(void);
 extern void enable_timer_nmi_watchdog(void);
-extern inline void nmi_watchdog_tick (struct pt_regs * regs);
+extern void nmi_watchdog_tick (struct pt_regs * regs);
 extern int APIC_init_uniprocessor (void);
 extern void disable_APIC_timer(void);
 extern void enable_APIC_timer(void);
--- diff/include/asm-i386/bugs.h	2003-10-09 09:47:17.000000000 +0100
+++ source/include/asm-i386/bugs.h	2004-02-09 10:39:56.000000000 +0000
@@ -1,11 +1,11 @@
 /*
  *  include/asm-i386/bugs.h
  *
- *  Copyright (C) 1994  Linus Torvalds
+ *  Copyright (C) 1994	Linus Torvalds
  *
  *  Cyrix stuff, June 1998 by:
  *	- Rafael R. Reilova (moved everything from head.S),
- *        <rreilova@ececs.uc.edu>
+ *	  <rreilova@ececs.uc.edu>
  *	- Channing Corn (tests & fixes),
  *	- Andrew D. Balsa (code cleanup).
  *
@@ -25,7 +25,20 @@
 #include <asm/processor.h>
 #include <asm/i387.h>
 #include <asm/msr.h>
-
+#ifdef CONFIG_KGDB
+/*
+ * Provied the command line "gdb" initial break
+ */
+int __init kgdb_initial_break(char * str)
+{
+	if (*str == '\0'){
+		breakpoint();
+		return 1;
+	}
+	return 0;
+}
+__setup("gdb",kgdb_initial_break);
+#endif
 static int __init no_halt(char *s)
 {
 	boot_cpu_data.hlt_works_ok = 0;
@@ -140,7 +153,7 @@
 	  : "ecx", "edi" );
 	/* If this fails, it means that any user program may lock the CPU hard. Too bad. */
 	if (res != 12345678) printk( "Buggy.\n" );
-		        else printk( "OK.\n" );
+			else printk( "OK.\n" );
 #endif
 }
 
@@ -152,9 +165,8 @@
  * - In order to run on anything without a TSC, we need to be
  *   compiled for a i486.
  * - In order to support the local APIC on a buggy Pentium machine,
- *   we need to be compiled with CONFIG_X86_GOOD_APIC disabled,
- *   which happens implicitly if compiled for a Pentium or lower
- *   (unless an advanced selection of CPU features is used) as an
+ *   we need to be compiled with CONFIG_X86_BAD_APIC enabled,
+ *   which happens implicitly if compiled for a Pentium as an
  *   otherwise config implies a properly working local APIC without
  *   the need to do extra reads from the APIC.
 */
@@ -185,7 +197,7 @@
  * integrated APIC (see 11AP erratum in "Pentium Processor
  * Specification Update").
  */
-#if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86_GOOD_APIC)
+#if defined(CONFIG_X86_LOCAL_APIC) && !defined(CONFIG_X86_BAD_APIC)
 	if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL
 	    && cpu_has_apic
 	    && boot_cpu_data.x86 == 5
--- diff/include/asm-i386/checksum.h	2003-11-25 15:24:59.000000000 +0000
+++ source/include/asm-i386/checksum.h	2004-02-09 10:39:56.000000000 +0000
@@ -25,7 +25,7 @@
  * better 64-bit) boundary
  */
 
-asmlinkage unsigned int csum_partial_copy_generic( const char *src, char *dst, int len, int sum,
+asmlinkage unsigned int direct_csum_partial_copy_generic( const char *src, char *dst, int len, int sum,
 						   int *src_err_ptr, int *dst_err_ptr);
 
 /*
@@ -39,14 +39,19 @@
 unsigned int csum_partial_copy_nocheck ( const char *src, char *dst,
 					int len, int sum)
 {
-	return csum_partial_copy_generic ( src, dst, len, sum, NULL, NULL);
+	/*
+	 * The direct function is OK for kernel-space => kernel-space copies:
+	 */
+	return direct_csum_partial_copy_generic ( src, dst, len, sum, NULL, NULL);
 }
 
 static __inline__
 unsigned int csum_partial_copy_from_user ( const char *src, char *dst,
 						int len, int sum, int *err_ptr)
 {
-	return csum_partial_copy_generic ( src, dst, len, sum, err_ptr, NULL);
+	if (copy_from_user(dst, src, len))
+		*err_ptr = -EFAULT;
+	return csum_partial(dst, len, sum);
 }
 
 /*
@@ -172,11 +177,26 @@
  *	Copy and checksum to user
  */
 #define HAVE_CSUM_COPY_USER
-static __inline__ unsigned int csum_and_copy_to_user(const char *src, char *dst,
+static __inline__ unsigned int direct_csum_and_copy_to_user(const char *src, char *dst,
 				    int len, int sum, int *err_ptr)
 {
 	if (access_ok(VERIFY_WRITE, dst, len))
-		return csum_partial_copy_generic(src, dst, len, sum, NULL, err_ptr);
+		return direct_csum_partial_copy_generic(src, dst, len, sum, NULL, err_ptr);
+
+	if (len)
+		*err_ptr = -EFAULT;
+
+	return -1; /* invalid checksum */
+}
+
+static __inline__ unsigned int csum_and_copy_to_user(const char *src, char *dst,
+				    int len, int sum, int *err_ptr)
+{
+	if (access_ok(VERIFY_WRITE, dst, len)) {
+		if (copy_to_user(dst, src, len))
+			*err_ptr = -EFAULT;
+		return csum_partial(src, len, sum);
+	}
 
 	if (len)
 		*err_ptr = -EFAULT;
--- diff/include/asm-i386/cpu.h	2003-06-30 10:07:24.000000000 +0100
+++ source/include/asm-i386/cpu.h	2004-02-09 10:39:56.000000000 +0000
@@ -4,6 +4,7 @@
 #include <linux/device.h>
 #include <linux/cpu.h>
 #include <linux/topology.h>
+#include <linux/percpu.h>
 
 #include <asm/node.h>
 
@@ -23,4 +24,5 @@
 	return register_cpu(&cpu_devices[num].cpu, num, parent);
 }
 
+DECLARE_PER_CPU(int, cpu_state);
 #endif /* _ASM_I386_CPU_H_ */
--- diff/include/asm-i386/cpufeature.h	2003-09-30 15:46:19.000000000 +0100
+++ source/include/asm-i386/cpufeature.h	2004-02-09 10:39:56.000000000 +0000
@@ -76,6 +76,9 @@
 
 /* VIA/Cyrix/Centaur-defined CPU features, CPUID level 0xC0000001, word 5 */
 #define X86_FEATURE_XSTORE	(5*32+ 2) /* on-CPU RNG present (xstore insn) */
+#define X86_FEATURE_XSTORE_EN	(5*32+ 3) /* on-CPU RNG enabled */
+#define X86_FEATURE_XCRYPT	(5*32+ 6) /* on-CPU crypto (xcrypt insn) */
+#define X86_FEATURE_XCRYPT_EN	(5*32+ 7) /* on-CPU crypto enabled */
 
 
 #define cpu_has(c, bit)		test_bit(bit, (c)->x86_capability)
@@ -101,6 +104,7 @@
 #define cpu_has_cyrix_arr	boot_cpu_has(X86_FEATURE_CYRIX_ARR)
 #define cpu_has_centaur_mcr	boot_cpu_has(X86_FEATURE_CENTAUR_MCR)
 #define cpu_has_xstore		boot_cpu_has(X86_FEATURE_XSTORE)
+#define cpu_has_xcrypt		boot_cpu_has(X86_FEATURE_XCRYPT)
 
 #endif /* __ASM_I386_CPUFEATURE_H */
 
--- diff/include/asm-i386/desc.h	2003-10-09 09:47:17.000000000 +0100
+++ source/include/asm-i386/desc.h	2004-02-09 10:39:56.000000000 +0000
@@ -21,6 +21,13 @@
 
 extern struct Xgt_desc_struct idt_descr, cpu_gdt_descr[NR_CPUS];
 
+extern void trap_init_virtual_IDT(void);
+extern void trap_init_virtual_GDT(void);
+
+asmlinkage int system_call(void);
+asmlinkage void lcall7(void);
+asmlinkage void lcall27(void);
+
 #define load_TR_desc() __asm__ __volatile__("ltr %%ax"::"a" (GDT_ENTRY_TSS*8))
 #define load_LDT_desc() __asm__ __volatile__("lldt %%ax"::"a" (GDT_ENTRY_LDT*8))
 
@@ -30,6 +37,7 @@
  */
 extern struct desc_struct default_ldt[];
 extern void set_intr_gate(unsigned int irq, void * addr);
+extern void set_trap_gate(unsigned int n, void *addr);
 
 #define _set_tssldt_desc(n,addr,limit,type) \
 __asm__ __volatile__ ("movw %w3,0(%2)\n\t" \
@@ -90,31 +98,8 @@
 #undef C
 }
 
-static inline void clear_LDT(void)
-{
-	int cpu = get_cpu();
-
-	set_ldt_desc(cpu, &default_ldt[0], 5);
-	load_LDT_desc();
-	put_cpu();
-}
-
-/*
- * load one particular LDT into the current CPU
- */
-static inline void load_LDT_nolock(mm_context_t *pc, int cpu)
-{
-	void *segments = pc->ldt;
-	int count = pc->size;
-
-	if (likely(!count)) {
-		segments = &default_ldt[0];
-		count = 5;
-	}
-		
-	set_ldt_desc(cpu, segments, count);
-	load_LDT_desc();
-}
+extern struct page *default_ldt_page;
+extern void load_LDT_nolock(mm_context_t *pc, int cpu);
 
 static inline void load_LDT(mm_context_t *pc)
 {
@@ -123,6 +108,6 @@
 	put_cpu();
 }
 
-#endif /* !__ASSEMBLY__ */
 
+#endif /* !__ASSEMBLY__ */
 #endif
--- diff/include/asm-i386/edd.h	2003-09-30 15:46:19.000000000 +0100
+++ source/include/asm-i386/edd.h	2004-02-09 10:39:56.000000000 +0000
@@ -1,6 +1,6 @@
 /*
  * linux/include/asm-i386/edd.h
- *  Copyright (C) 2002 Dell Inc.
+ *  Copyright (C) 2002, 2003 Dell Inc.
  *  by Matt Domsch <Matt_Domsch@dell.com>
  *
  * structures and definitions for the int 13h, ax={41,48}h
@@ -41,6 +41,9 @@
 #define EDDMAGIC1 0x55AA
 #define EDDMAGIC2 0xAA55
 
+#define READ_SECTORS 0x02
+#define MBR_SIG_OFFSET 0x1B8
+#define DISK80_SIG_BUFFER 0x2cc
 #ifndef __ASSEMBLY__
 
 #define EDD_EXT_FIXED_DISK_ACCESS           (1 << 0)
@@ -167,6 +170,7 @@
 
 extern struct edd_info edd[EDDMAXNR];
 extern unsigned char eddnr;
+extern unsigned int edd_disk80_sig;
 #endif				/*!__ASSEMBLY__ */
 
 #endif				/* _ASM_I386_EDD_H */
--- diff/include/asm-i386/fixmap.h	2003-10-09 09:47:17.000000000 +0100
+++ source/include/asm-i386/fixmap.h	2004-02-09 10:39:56.000000000 +0000
@@ -18,17 +18,15 @@
 #include <asm/acpi.h>
 #include <asm/apicdef.h>
 #include <asm/page.h>
-#ifdef CONFIG_HIGHMEM
 #include <linux/threads.h>
 #include <asm/kmap_types.h>
-#endif
 
 /*
  * Here we define all the compile-time 'special' virtual
  * addresses. The point is to have a constant address at
  * compile time, but to set the physical address only
- * in the boot process. We allocate these special addresses
- * from the end of virtual memory (0xfffff000) backwards.
+ * in the boot process. We allocate these special  addresses
+ * from the end of virtual memory (0xffffe000) backwards.
  * Also this lets us do fail-safe vmalloc(), we
  * can guarantee that these special addresses and
  * vmalloc()-ed addresses never overlap.
@@ -41,11 +39,20 @@
  * TLB entries of such buffers will not be flushed across
  * task switches.
  */
+
+/*
+ * on UP currently we will have no trace of the fixmap mechanizm,
+ * no page table allocations, etc. This might change in the
+ * future, say framebuffers for the console driver(s) could be
+ * fix-mapped?
+ */
 enum fixed_addresses {
 	FIX_HOLE,
 	FIX_VSYSCALL,
 #ifdef CONFIG_X86_LOCAL_APIC
 	FIX_APIC_BASE,	/* local (CPU) APIC) -- required for SMP or not */
+#else
+	FIX_VSTACK_HOLE_1,
 #endif
 #ifdef CONFIG_X86_IO_APIC
 	FIX_IO_APIC_BASE_0,
@@ -57,20 +64,28 @@
 	FIX_LI_PCIA,	/* Lithium PCI Bridge A */
 	FIX_LI_PCIB,	/* Lithium PCI Bridge B */
 #endif
-#ifdef CONFIG_X86_F00F_BUG
-	FIX_F00F_IDT,	/* Virtual mapping for IDT */
-#endif
+	FIX_IDT,
+	FIX_GDT_1,
+	FIX_GDT_0,
+	FIX_TSS_3,
+	FIX_TSS_2,
+	FIX_TSS_1,
+	FIX_TSS_0,
+	FIX_ENTRY_TRAMPOLINE_1,
+	FIX_ENTRY_TRAMPOLINE_0,
 #ifdef CONFIG_X86_CYCLONE_TIMER
 	FIX_CYCLONE_TIMER, /*cyclone timer register*/
+	FIX_VSTACK_HOLE_2,
 #endif 
-#ifdef CONFIG_HIGHMEM
 	FIX_KMAP_BEGIN,	/* reserved pte's for temporary kernel mappings */
 	FIX_KMAP_END = FIX_KMAP_BEGIN+(KM_TYPE_NR*NR_CPUS)-1,
-#endif
 #ifdef CONFIG_ACPI_BOOT
 	FIX_ACPI_BEGIN,
 	FIX_ACPI_END = FIX_ACPI_BEGIN + FIX_ACPI_PAGES - 1,
 #endif
+#ifdef CONFIG_PCI_MMCONFIG
+	FIX_PCIE_MCFG,
+#endif
 	__end_of_permanent_fixed_addresses,
 	/* temporary boot-time mappings, used before ioremap() is functional */
 #define NR_FIX_BTMAPS	16
@@ -95,12 +110,15 @@
 		__set_fixmap(idx, 0, __pgprot(0))
 
 /*
- * used by vmalloc.c.
+ * used by vmalloc.c and various other places.
  *
  * Leave one empty page between vmalloc'ed areas and
  * the start of the fixmap.
+ *
+ * IMPORTANT: dont change FIXADDR_TOP without adjusting KM_VSTACK0
+ * and KM_VSTACK1 so that the virtual stack is 8K aligned.
  */
-#define FIXADDR_TOP	(0xfffff000UL)
+#define FIXADDR_TOP	(0xffffe000UL)
 #define __FIXADDR_SIZE	(__end_of_permanent_fixed_addresses << PAGE_SHIFT)
 #define FIXADDR_START	(FIXADDR_TOP - __FIXADDR_SIZE)
 
--- diff/include/asm-i386/highmem.h	2003-10-09 09:47:34.000000000 +0100
+++ source/include/asm-i386/highmem.h	2004-02-09 10:39:56.000000000 +0000
@@ -25,26 +25,19 @@
 #include <linux/threads.h>
 #include <asm/kmap_types.h>
 #include <asm/tlbflush.h>
+#include <asm/atomic_kmap.h>
 
 /* declarations for highmem.c */
 extern unsigned long highstart_pfn, highend_pfn;
 
-extern pte_t *kmap_pte;
-extern pgprot_t kmap_prot;
 extern pte_t *pkmap_page_table;
-
-extern void kmap_init(void);
+extern void kmap_init(void) __init;
 
 /*
  * 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.
  */
-#if NR_CPUS <= 32
-#define PKMAP_BASE (0xff800000UL)
-#else
-#define PKMAP_BASE (0xff600000UL)
-#endif
 #ifdef CONFIG_X86_PAE
 #define LAST_PKMAP 512
 #else
--- diff/include/asm-i386/hw_irq.h	2004-01-19 10:22:59.000000000 +0000
+++ source/include/asm-i386/hw_irq.h	2004-02-09 10:39:56.000000000 +0000
@@ -26,7 +26,7 @@
  */
 
 extern u8 irq_vector[NR_IRQ_VECTORS];
-#define IO_APIC_VECTOR(irq)	((int)irq_vector[irq])
+#define IO_APIC_VECTOR(irq)	(irq_vector[irq])
 
 extern void (*interrupt[NR_IRQS])(void);
 
--- diff/include/asm-i386/io.h	2003-05-21 11:49:56.000000000 +0100
+++ source/include/asm-i386/io.h	2004-02-09 10:39:56.000000000 +0000
@@ -153,6 +153,9 @@
 #define readb(addr) (*(volatile unsigned char *) __io_virt(addr))
 #define readw(addr) (*(volatile unsigned short *) __io_virt(addr))
 #define readl(addr) (*(volatile unsigned int *) __io_virt(addr))
+#define readb_relaxed(addr) readb(addr)
+#define readw_relaxed(addr) readw(addr)
+#define readl_relaxed(addr) readl(addr)
 #define __raw_readb readb
 #define __raw_readw readw
 #define __raw_readl readl
--- diff/include/asm-i386/kmap_types.h	2003-10-09 09:47:17.000000000 +0100
+++ source/include/asm-i386/kmap_types.h	2004-02-09 10:39:56.000000000 +0000
@@ -3,30 +3,36 @@
 
 #include <linux/config.h>
 
-#ifdef CONFIG_DEBUG_HIGHMEM
-# define D(n) __KM_FENCE_##n ,
-#else
-# define D(n)
-#endif
-
 enum km_type {
-D(0)	KM_BOUNCE_READ,
-D(1)	KM_SKB_SUNRPC_DATA,
-D(2)	KM_SKB_DATA_SOFTIRQ,
-D(3)	KM_USER0,
-D(4)	KM_USER1,
-D(5)	KM_BIO_SRC_IRQ,
-D(6)	KM_BIO_DST_IRQ,
-D(7)	KM_PTE0,
-D(8)	KM_PTE1,
-D(9)	KM_PTE2,
-D(10)	KM_IRQ0,
-D(11)	KM_IRQ1,
-D(12)	KM_SOFTIRQ0,
-D(13)	KM_SOFTIRQ1,
-D(14)	KM_TYPE_NR
-};
-
-#undef D
+	/*
+	 * IMPORTANT: don't move these 3 entries, and only add entries in
+	 * pairs: the 4G/4G virtual stack must be 8K aligned on each cpu.
+	 */
+	KM_BOUNCE_READ,
+	KM_VSTACK1,
+	KM_VSTACK0,
 
+	KM_LDT_PAGE15,
+	KM_LDT_PAGE0 = KM_LDT_PAGE15 + 16-1,
+	KM_USER_COPY,
+	KM_VSTACK_HOLE,
+	KM_SKB_SUNRPC_DATA,
+	KM_SKB_DATA_SOFTIRQ,
+	KM_USER0,
+	KM_USER1,
+	KM_BIO_SRC_IRQ,
+	KM_BIO_DST_IRQ,
+	KM_PTE0,
+	KM_PTE1,
+	KM_PTE2,
+	KM_IRQ0,
+	KM_IRQ1,
+	KM_SOFTIRQ0,
+	KM_SOFTIRQ1,
+	/*
+	 * Add new entries in pairs:
+	 * the 4G/4G virtual stack must be 8K aligned on each cpu.
+	 */
+	KM_TYPE_NR
+};
 #endif
--- diff/include/asm-i386/mmu.h	2003-10-09 09:47:17.000000000 +0100
+++ source/include/asm-i386/mmu.h	2004-02-09 10:39:56.000000000 +0000
@@ -8,10 +8,13 @@
  *
  * cpu_vm_mask is used to optimize ldt flushing.
  */
+
+#define MAX_LDT_PAGES 16
+
 typedef struct { 
 	int size;
 	struct semaphore sem;
-	void *ldt;
+	struct page *ldt_pages[MAX_LDT_PAGES];
 } mm_context_t;
 
 #endif
--- diff/include/asm-i386/mmu_context.h	2003-10-09 09:47:17.000000000 +0100
+++ source/include/asm-i386/mmu_context.h	2004-02-09 10:39:56.000000000 +0000
@@ -29,6 +29,10 @@
 {
 	int cpu = smp_processor_id();
 
+#ifdef CONFIG_X86_SWITCH_PAGETABLES
+	if (tsk->mm)
+		tsk->thread_info->user_pgd = (void *)__pa(tsk->mm->pgd);
+#endif
 	if (likely(prev != next)) {
 		/* stop flush ipis for the previous mm */
 		cpu_clear(cpu, prev->cpu_vm_mask);
@@ -39,12 +43,14 @@
 		cpu_set(cpu, next->cpu_vm_mask);
 
 		/* Re-load page tables */
+#if !defined(CONFIG_X86_SWITCH_PAGETABLES)
 		load_cr3(next->pgd);
+#endif
 
 		/*
 		 * load the LDT, if the LDT is different:
 		 */
-		if (unlikely(prev->context.ldt != next->context.ldt))
+		if (unlikely(prev->context.size + next->context.size))
 			load_LDT_nolock(&next->context, cpu);
 	}
 #ifdef CONFIG_SMP
@@ -56,7 +62,9 @@
 			/* We were in lazy tlb mode and leave_mm disabled 
 			 * tlb flush IPI delivery. We must reload %cr3.
 			 */
+#if !defined(CONFIG_X86_SWITCH_PAGETABLES)
 			load_cr3(next->pgd);
+#endif
 			load_LDT_nolock(&next->context, cpu);
 		}
 	}
@@ -67,6 +75,6 @@
 	asm("movl %0,%%fs ; movl %0,%%gs": :"r" (0))
 
 #define activate_mm(prev, next) \
-	switch_mm((prev),(next),NULL)
+	switch_mm((prev),(next),current)
 
 #endif
--- diff/include/asm-i386/mmzone.h	2003-09-30 15:46:19.000000000 +0100
+++ source/include/asm-i386/mmzone.h	2004-02-09 10:39:56.000000000 +0000
@@ -62,12 +62,8 @@
 	(__pfn - node_start_pfn(pfn_to_nid(__pfn)));			\
 })
 
-#define kern_addr_valid(kaddr)						\
-({									\
-	unsigned long __kaddr = (unsigned long)(kaddr);			\
-	pg_data_t *__pgdat = NODE_DATA(kvaddr_to_nid(__kaddr));		\
-	test_bit(local_mapnr(__kaddr), __pgdat->valid_addr_bitmap);	\
-})
+/* XXX: FIXME -- wli */
+#define kern_addr_valid(kaddr)	(0)
 
 #define pfn_to_page(pfn)						\
 ({									\
--- diff/include/asm-i386/module.h	2003-02-26 16:01:02.000000000 +0000
+++ source/include/asm-i386/module.h	2004-02-09 10:39:56.000000000 +0000
@@ -26,6 +26,8 @@
 #define MODULE_PROC_FAMILY "PENTIUMII "
 #elif defined CONFIG_MPENTIUMIII
 #define MODULE_PROC_FAMILY "PENTIUMIII "
+#elif defined CONFIG_MPENTIUMM
+#define MODULE_PROC_FAMILY "PENTIUMM "
 #elif defined CONFIG_MPENTIUM4
 #define MODULE_PROC_FAMILY "PENTIUM4 "
 #elif defined CONFIG_MK6
@@ -49,9 +51,15 @@
 #elif CONFIG_MVIAC3_2
 #define MODULE_PROC_FAMILY "VIAC3-2 "
 #else
-#error unknown processor family
+#define MODULE_PROC_FAMILY "this needs to be fixed"
 #endif
 
-#define MODULE_ARCH_VERMAGIC MODULE_PROC_FAMILY
+#ifdef CONFIG_REGPARM
+#define MODULE_REGPARM "REGPARM "
+#else
+#define MODULE_REGPARM ""
+#endif
+
+#define MODULE_ARCH_VERMAGIC MODULE_PROC_FAMILY MODULE_REGPARM
 
 #endif /* _ASM_I386_MODULE_H */
--- diff/include/asm-i386/page.h	2003-10-09 09:47:17.000000000 +0100
+++ source/include/asm-i386/page.h	2004-02-09 10:39:56.000000000 +0000
@@ -1,6 +1,8 @@
 #ifndef _I386_PAGE_H
 #define _I386_PAGE_H
 
+#include <linux/config.h>
+
 /* PAGE_SHIFT determines the page size */
 #define PAGE_SHIFT	12
 #define PAGE_SIZE	(1UL << PAGE_SHIFT)
@@ -9,11 +11,10 @@
 #define LARGE_PAGE_MASK (~(LARGE_PAGE_SIZE-1))
 #define LARGE_PAGE_SIZE (1UL << PMD_SHIFT)
 
-#ifdef __KERNEL__
-#ifndef __ASSEMBLY__
-
 #include <linux/config.h>
 
+#ifdef __KERNEL__
+#ifndef __ASSEMBLY__
 #ifdef CONFIG_X86_USE_3DNOW
 
 #include <asm/mmx.h>
@@ -88,8 +89,19 @@
  *
  * If you want more physical memory than this then see the CONFIG_HIGHMEM4G
  * and CONFIG_HIGHMEM64G options in the kernel configuration.
+ *
+ * Note: on PAE the kernel must never go below 32 MB, we use the
+ * first 8 entries of the 2-level boot pgd for PAE magic.
  */
 
+#ifdef CONFIG_X86_4G_VM_LAYOUT
+#define __PAGE_OFFSET		(0x02000000)
+#define TASK_SIZE		(0xff000000)
+#else
+#define __PAGE_OFFSET		(0xc0000000)
+#define TASK_SIZE		(0xc0000000)
+#endif
+
 /*
  * This much address space is reserved for vmalloc() and iomap()
  * as well as fixmap mappings.
@@ -114,16 +126,10 @@
 
 #endif /* __ASSEMBLY__ */
 
-#ifdef __ASSEMBLY__
-#define __PAGE_OFFSET		(0xC0000000)
-#else
-#define __PAGE_OFFSET		(0xC0000000UL)
-#endif
-
-
 #define PAGE_OFFSET		((unsigned long)__PAGE_OFFSET)
 #define VMALLOC_RESERVE		((unsigned long)__VMALLOC_RESERVE)
-#define MAXMEM			(-__PAGE_OFFSET-__VMALLOC_RESERVE)
+#define __MAXMEM		(-__PAGE_OFFSET-__VMALLOC_RESERVE)
+#define MAXMEM			((unsigned long)(-PAGE_OFFSET-VMALLOC_RESERVE))
 #define __pa(x)			((unsigned long)(x)-PAGE_OFFSET)
 #define __va(x)			((void *)((unsigned long)(x)+PAGE_OFFSET))
 #define pfn_to_kaddr(pfn)      __va((pfn) << PAGE_SHIFT)
--- diff/include/asm-i386/param.h	2002-10-16 04:27:19.000000000 +0100
+++ source/include/asm-i386/param.h	2004-02-09 10:39:56.000000000 +0000
@@ -13,10 +13,6 @@
 
 #define EXEC_PAGESIZE	4096
 
-#ifndef NGROUPS
-#define NGROUPS		32
-#endif
-
 #ifndef NOGROUP
 #define NOGROUP		(-1)
 #endif
--- diff/include/asm-i386/pci.h	2003-10-27 09:20:44.000000000 +0000
+++ source/include/asm-i386/pci.h	2004-02-09 10:39:56.000000000 +0000
@@ -15,6 +15,7 @@
 #else
 #define pcibios_assign_all_busses()	0
 #endif
+#define pcibios_scan_all_fns(a, b)	0
 
 extern unsigned long pci_mem_start;
 #define PCIBIOS_MIN_IO		0x1000
--- diff/include/asm-i386/pgtable.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/asm-i386/pgtable.h	2004-02-09 10:39:56.000000000 +0000
@@ -32,16 +32,17 @@
 #define ZERO_PAGE(vaddr) (virt_to_page(empty_zero_page))
 extern unsigned long empty_zero_page[1024];
 extern pgd_t swapper_pg_dir[1024];
-extern kmem_cache_t *pgd_cache;
-extern kmem_cache_t *pmd_cache;
+extern kmem_cache_t *pgd_cache, *pmd_cache, *kpmd_cache;
 extern spinlock_t pgd_lock;
 extern struct list_head pgd_list;
 
 void pmd_ctor(void *, kmem_cache_t *, unsigned long);
+void kpmd_ctor(void *, kmem_cache_t *, unsigned long);
 void pgd_ctor(void *, kmem_cache_t *, unsigned long);
 void pgd_dtor(void *, kmem_cache_t *, unsigned long);
 void pgtable_cache_init(void);
 void paging_init(void);
+void setup_identity_mappings(pgd_t *pgd_base, unsigned long start, unsigned long end);
 
 #endif /* !__ASSEMBLY__ */
 
@@ -51,6 +52,11 @@
  * newer 3-level PAE-mode page tables.
  */
 #ifndef __ASSEMBLY__
+
+extern void set_system_gate(unsigned int n, void *addr);
+extern void init_entry_mappings(void);
+extern void entry_trampoline_setup(void);
+
 #ifdef CONFIG_X86_PAE
 # include <asm/pgtable-3level.h>
 #else
@@ -63,7 +69,12 @@
 #define PGDIR_SIZE	(1UL << PGDIR_SHIFT)
 #define PGDIR_MASK	(~(PGDIR_SIZE-1))
 
-#define USER_PTRS_PER_PGD	(TASK_SIZE/PGDIR_SIZE)
+#if defined(CONFIG_X86_PAE) && defined(CONFIG_X86_4G_VM_LAYOUT)
+# define USER_PTRS_PER_PGD	4
+#else
+# define USER_PTRS_PER_PGD	((TASK_SIZE/PGDIR_SIZE) + ((TASK_SIZE % PGDIR_SIZE) + PGDIR_SIZE-1)/PGDIR_SIZE)
+#endif
+
 #define FIRST_USER_PGD_NR	0
 
 #define USER_PGD_PTRS (PAGE_OFFSET >> PGDIR_SHIFT)
@@ -233,6 +244,7 @@
 
 #define mk_pte(page, pgprot)	pfn_pte(page_to_pfn(page), (pgprot))
 #define mk_pte_huge(entry) ((entry).pte_low |= _PAGE_PRESENT | _PAGE_PSE)
+#define mk_pte_phys(physpage, pgprot) pfn_pte((physpage) >> PAGE_SHIFT, pgprot)
 
 static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
 {
--- diff/include/asm-i386/processor.h	2004-01-19 10:22:59.000000000 +0000
+++ source/include/asm-i386/processor.h	2004-02-09 10:39:56.000000000 +0000
@@ -7,6 +7,8 @@
 #ifndef __ASM_I386_PROCESSOR_H
 #define __ASM_I386_PROCESSOR_H
 
+#ifndef __ASSEMBLY__
+
 #include <asm/vm86.h>
 #include <asm/math_emu.h>
 #include <asm/segment.h>
@@ -291,11 +293,6 @@
 extern unsigned int BIOS_revision;
 extern unsigned int mca_pentium_flag;
 
-/*
- * User space process size: 3GB (default).
- */
-#define TASK_SIZE	(PAGE_OFFSET)
-
 /* This decides where the kernel will search for a free chunk of vm
  * space during mmap's.
  */
@@ -406,6 +403,7 @@
 struct thread_struct {
 /* cached TLS descriptors. */
 	struct desc_struct tls_array[GDT_ENTRY_TLS_ENTRIES];
+	void *stack_page0, *stack_page1;
 	unsigned long	esp0;
 	unsigned long	sysenter_cs;
 	unsigned long	eip;
@@ -449,7 +447,8 @@
 	.io_bitmap	= { [ 0 ... IO_BITMAP_LONGS] = ~0 },		\
 }
 
-static inline void load_esp0(struct tss_struct *tss, struct thread_struct *thread)
+static inline void
+load_esp0(struct tss_struct *tss, struct thread_struct *thread)
 {
 	tss->esp0 = thread->esp0;
 	/* This can only happen when SEP is enabled, no need to test "SEP"arately */
@@ -485,6 +484,23 @@
  */
 extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
 
+#ifdef CONFIG_X86_HIGH_ENTRY
+#define virtual_esp0(tsk) \
+	((unsigned long)(tsk)->thread_info->virtual_stack + ((tsk)->thread.esp0 - (unsigned long)(tsk)->thread_info->real_stack))
+#else
+# define virtual_esp0(tsk) ((tsk)->thread.esp0)
+#endif
+
+#define load_virtual_esp0(tss, task)					\
+	do {								\
+		tss->esp0 = virtual_esp0(task);				\
+		if (likely(cpu_has_sep) && unlikely(tss->ss1 != task->thread.sysenter_cs)) {	\
+			tss->ss1 = task->thread.sysenter_cs;		\
+			wrmsr(MSR_IA32_SYSENTER_CS,			\
+				task->thread.sysenter_cs, 0);		\
+		}							\
+	} while (0)
+
 extern unsigned long thread_saved_pc(struct task_struct *tsk);
 void show_trace(struct task_struct *task, unsigned long *stack);
 
@@ -568,7 +584,7 @@
 #define K7_NOP7        ".byte 0x8D,0x04,0x05,0,0,0,0\n"
 #define K7_NOP8        K7_NOP7 ASM_NOP1
 
-#ifdef CONFIG_MK8
+#ifdef CONFIG_CPU_ONLY_K8
 #define ASM_NOP1 K8_NOP1
 #define ASM_NOP2 K8_NOP2
 #define ASM_NOP3 K8_NOP3
@@ -577,7 +593,7 @@
 #define ASM_NOP6 K8_NOP6
 #define ASM_NOP7 K8_NOP7
 #define ASM_NOP8 K8_NOP8
-#elif defined(CONFIG_MK7)
+#elif defined(CONFIG_CPU_ONLY_K7)
 #define ASM_NOP1 K7_NOP1
 #define ASM_NOP2 K7_NOP2
 #define ASM_NOP3 K7_NOP3
@@ -630,4 +646,35 @@
 
 extern void select_idle_routine(const struct cpuinfo_x86 *c);
 
+#ifdef CONFIG_SCHED_SMT
+#define ARCH_HAS_SCHED_DOMAIN
+#define ARCH_HAS_SCHED_WAKE_BALANCE
+#endif
+
+#endif /* ! __ASSEMBLY__ */
+
+/*
+ * This handles the memory map.. We could make this a config
+ * option, but too many people screw it up, and too few need
+ * it.
+ *
+ * A __PAGE_OFFSET of 0xC0000000 means that the kernel has
+ * a virtual address space of one gigabyte, which limits the
+ * amount of physical memory you can use to about 950MB.
+ *
+ * If you want more physical memory than this then see the CONFIG_HIGHMEM4G
+ * and CONFIG_HIGHMEM64G options in the kernel configuration.
+ *
+ * Note: on PAE the kernel must never go below 32 MB, we use the
+ * first 8 entries of the 2-level boot pgd for PAE magic.
+ */
+
+#ifdef CONFIG_X86_4G_VM_LAYOUT
+#define __PAGE_OFFSET		(0x02000000)
+#define TASK_SIZE		(0xff000000)
+#else
+#define __PAGE_OFFSET		(0xc0000000)
+#define TASK_SIZE		(0xc0000000)
+#endif
+
 #endif /* __ASM_I386_PROCESSOR_H */
--- diff/include/asm-i386/rwlock.h	2003-10-09 09:47:17.000000000 +0100
+++ source/include/asm-i386/rwlock.h	2004-02-09 10:39:56.000000000 +0000
@@ -20,28 +20,52 @@
 #define RW_LOCK_BIAS		 0x01000000
 #define RW_LOCK_BIAS_STR	"0x01000000"
 
-#define __build_read_lock_ptr(rw, helper)   \
-	asm volatile(LOCK "subl $1,(%0)\n\t" \
-		     "js 2f\n" \
-		     "1:\n" \
-		     LOCK_SECTION_START("") \
-		     "2:\tcall " helper "\n\t" \
-		     "jmp 1b\n" \
-		     LOCK_SECTION_END \
-		     ::"a" (rw) : "memory")
-
-#define __build_read_lock_const(rw, helper)   \
-	asm volatile(LOCK "subl $1,%0\n\t" \
-		     "js 2f\n" \
-		     "1:\n" \
-		     LOCK_SECTION_START("") \
-		     "2:\tpushl %%eax\n\t" \
-		     "leal %0,%%eax\n\t" \
-		     "call " helper "\n\t" \
-		     "popl %%eax\n\t" \
-		     "jmp 1b\n" \
-		     LOCK_SECTION_END \
-		     :"=m" (*(volatile int *)rw) : : "memory")
+#ifdef CONFIG_SPINLINE
+
+	#define __build_read_lock_ptr(rw, helper)   \
+		asm volatile(LOCK "subl $1,(%0)\n\t" \
+			     "jns 1f\n\t" \
+			     "call " helper "\n\t" \
+			     "1:\t" \
+			     ::"a" (rw) : "memory")
+
+	#define __build_read_lock_const(rw, helper)   \
+		asm volatile(LOCK "subl $1,%0\n\t" \
+			     "jns 1f\n\t" \
+			     "pushl %%eax\n\t" \
+			     "leal %0,%%eax\n\t" \
+			     "call " helper "\n\t" \
+			     "popl %%eax\n\t" \
+			     "1:\t" \
+			     :"=m" (*(volatile int *)rw) : : "memory")
+
+#else /* !CONFIG_SPINLINE */
+
+	#define __build_read_lock_ptr(rw, helper)   \
+		asm volatile(LOCK "subl $1,(%0)\n\t" \
+			     "js 2f\n" \
+			     "1:\n" \
+			     LOCK_SECTION_START("") \
+			     "2:\tcall " helper "\n\t" \
+			     "jmp 1b\n" \
+			     LOCK_SECTION_END \
+			     ::"a" (rw) : "memory")
+
+	#define __build_read_lock_const(rw, helper)   \
+		asm volatile(LOCK "subl $1,%0\n\t" \
+			     "js 2f\n" \
+			     "1:\n" \
+			     LOCK_SECTION_START("") \
+			     "2:\tpushl %%eax\n\t" \
+			     "leal %0,%%eax\n\t" \
+			     "call " helper "\n\t" \
+			     "popl %%eax\n\t" \
+			     "jmp 1b\n" \
+			     LOCK_SECTION_END \
+			     :"=m" (*(volatile int *)rw) : : "memory")
+
+#endif /* CONFIG_SPINLINE */
+
 
 #define __build_read_lock(rw, helper)	do { \
 						if (__builtin_constant_p(rw)) \
@@ -50,28 +74,51 @@
 							__build_read_lock_ptr(rw, helper); \
 					} while (0)
 
-#define __build_write_lock_ptr(rw, helper) \
-	asm volatile(LOCK "subl $" RW_LOCK_BIAS_STR ",(%0)\n\t" \
-		     "jnz 2f\n" \
-		     "1:\n" \
-		     LOCK_SECTION_START("") \
-		     "2:\tcall " helper "\n\t" \
-		     "jmp 1b\n" \
-		     LOCK_SECTION_END \
-		     ::"a" (rw) : "memory")
-
-#define __build_write_lock_const(rw, helper) \
-	asm volatile(LOCK "subl $" RW_LOCK_BIAS_STR ",%0\n\t" \
-		     "jnz 2f\n" \
-		     "1:\n" \
-		     LOCK_SECTION_START("") \
-		     "2:\tpushl %%eax\n\t" \
-		     "leal %0,%%eax\n\t" \
-		     "call " helper "\n\t" \
-		     "popl %%eax\n\t" \
-		     "jmp 1b\n" \
-		     LOCK_SECTION_END \
-		     :"=m" (*(volatile int *)rw) : : "memory")
+#ifdef CONFIG_SPINLINE
+
+	#define __build_write_lock_ptr(rw, helper) \
+		asm volatile(LOCK "subl $" RW_LOCK_BIAS_STR ",(%0)\n\t" \
+			     "jz 1f\n\t" \
+			     "call " helper "\n\t" \
+			     "1:\n" \
+			     ::"a" (rw) : "memory")
+
+	#define __build_write_lock_const(rw, helper) \
+		asm volatile(LOCK "subl $" RW_LOCK_BIAS_STR ",%0\n\t" \
+			     "jz 1f\n\t" \
+			     "pushl %%eax\n\t" \
+			     "leal %0,%%eax\n\t" \
+			     "call " helper "\n\t" \
+			     "popl %%eax\n\t" \
+			     "1:\n" \
+			     :"=m" (*(volatile int *)rw) : : "memory")
+
+#else /* !CONFIG_SPINLINE */
+
+	#define __build_write_lock_ptr(rw, helper) \
+		asm volatile(LOCK "subl $" RW_LOCK_BIAS_STR ",(%0)\n\t" \
+			     "jnz 2f\n" \
+			     "1:\n" \
+			     LOCK_SECTION_START("") \
+			     "2:\tcall " helper "\n\t" \
+			     "jmp 1b\n" \
+			     LOCK_SECTION_END \
+			     ::"a" (rw) : "memory")
+
+	#define __build_write_lock_const(rw, helper) \
+		asm volatile(LOCK "subl $" RW_LOCK_BIAS_STR ",%0\n\t" \
+			     "jnz 2f\n" \
+			     "1:\n" \
+			     LOCK_SECTION_START("") \
+			     "2:\tpushl %%eax\n\t" \
+			     "leal %0,%%eax\n\t" \
+			     "call " helper "\n\t" \
+			     "popl %%eax\n\t" \
+			     "jmp 1b\n" \
+			     LOCK_SECTION_END \
+			     :"=m" (*(volatile int *)rw) : : "memory")
+
+#endif /* CONFIG_SPINLINE */
 
 #define __build_write_lock(rw, helper)	do { \
 						if (__builtin_constant_p(rw)) \
--- diff/include/asm-i386/setup.h	2004-01-19 10:22:59.000000000 +0000
+++ source/include/asm-i386/setup.h	2004-02-09 10:39:56.000000000 +0000
@@ -44,6 +44,7 @@
 #define INITRD_START (*(unsigned long *) (PARAM+0x218))
 #define INITRD_SIZE (*(unsigned long *) (PARAM+0x21c))
 #define EDID_INFO   (*(struct edid_info *) (PARAM+0x440))
+#define DISK80_SIGNATURE (*(unsigned int*) (PARAM+DISK80_SIG_BUFFER))
 #define EDD_NR     (*(unsigned char *) (PARAM+EDDNR))
 #define EDD_BUF     ((struct edd_info *) (PARAM+EDDBUF))
 #define COMMAND_LINE ((char *) (PARAM+2048))
--- diff/include/asm-i386/smp.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/asm-i386/smp.h	2004-02-09 10:39:56.000000000 +0000
@@ -9,6 +9,7 @@
 #include <linux/kernel.h>
 #include <linux/threads.h>
 #include <linux/cpumask.h>
+#include <linux/spinlock.h>
 #endif
 
 #ifdef CONFIG_X86_LOCAL_APIC
@@ -34,7 +35,7 @@
 extern void smp_alloc_memory(void);
 extern int pic_mode;
 extern int smp_num_siblings;
-extern int cpu_sibling_map[];
+extern cpumask_t cpu_sibling_map[];
 
 extern void smp_flush_tlb(void);
 extern void smp_message_irq(int cpl, void *dev_id, struct pt_regs *regs);
@@ -52,6 +53,7 @@
  */
 #define smp_processor_id() (current_thread_info()->cpu)
 
+extern spinlock_t call_lock;
 extern cpumask_t cpu_callout_map;
 #define cpu_possible_map cpu_callout_map
 
@@ -84,6 +86,10 @@
 }
 
 #endif
+
+extern int __cpu_disable(void);
+extern void __cpu_die(unsigned int cpu);
+
 #endif /* !__ASSEMBLY__ */
 
 #define NO_PROC_ID		0xFF		/* No processor magic marker */
--- diff/include/asm-i386/spinlock.h	2003-10-09 09:47:17.000000000 +0100
+++ source/include/asm-i386/spinlock.h	2004-02-09 10:39:56.000000000 +0000
@@ -43,18 +43,35 @@
 #define spin_is_locked(x)	(*(volatile signed char *)(&(x)->lock) <= 0)
 #define spin_unlock_wait(x)	do { barrier(); } while(spin_is_locked(x))
 
-#define spin_lock_string \
-	"\n1:\t" \
-	"lock ; decb %0\n\t" \
-	"js 2f\n" \
-	LOCK_SECTION_START("") \
-	"2:\t" \
-	"rep;nop\n\t" \
-	"cmpb $0,%0\n\t" \
-	"jle 2b\n\t" \
-	"jmp 1b\n" \
-	LOCK_SECTION_END
+#ifdef CONFIG_SPINLINE
 
+	#define spin_lock_string \
+		"\n1:\t" \
+		"lock ; decb %0\n\t" \
+		"js 2f\n" \
+		"jmp 3f\n" \
+		"2:\t" \
+		"rep;nop\n\t" \
+		"cmpb $0,%0\n\t" \
+		"jle 2b\n\t" \
+		"jmp 1b\n" \
+		"3:\t"
+
+#else /* !CONFIG_SPINLINE */
+
+	#define spin_lock_string \
+		"\n1:\t" \
+		"lock ; decb %0\n\t" \
+		"js 2f\n" \
+		LOCK_SECTION_START("") \
+		"2:\t" \
+		"rep;nop\n\t" \
+		"cmpb $0,%0\n\t" \
+		"jle 2b\n\t" \
+		"jmp 1b\n" \
+		LOCK_SECTION_END
+
+#endif /* CONFIG_SPINLINE */
 /*
  * This works. Despite all the confusion.
  * (except on PPro SMP or if we are using OOSTORE)
@@ -138,6 +155,11 @@
  */
 typedef struct {
 	volatile unsigned int lock;
+#ifdef CONFIG_LOCKMETER
+	/* required for LOCKMETER since all bits in lock are used */
+	/* and we need this storage for CPU and lock INDEX        */
+	unsigned lockmeter_magic;
+#endif
 #ifdef CONFIG_DEBUG_SPINLOCK
 	unsigned magic;
 #endif
@@ -145,11 +167,19 @@
 
 #define RWLOCK_MAGIC	0xdeaf1eed
 
+#ifdef CONFIG_LOCKMETER
+#ifdef CONFIG_DEBUG_SPINLOCK
+#define RWLOCK_MAGIC_INIT	, 0, RWLOCK_MAGIC
+#else
+#define RWLOCK_MAGIC_INIT	, 0
+#endif
+#else /* !CONFIG_LOCKMETER */
 #ifdef CONFIG_DEBUG_SPINLOCK
 #define RWLOCK_MAGIC_INIT	, RWLOCK_MAGIC
 #else
 #define RWLOCK_MAGIC_INIT	/* */
 #endif
+#endif /* !CONFIG_LOCKMETER */
 
 #define RW_LOCK_UNLOCKED (rwlock_t) { RW_LOCK_BIAS RWLOCK_MAGIC_INIT }
 
@@ -196,4 +226,60 @@
 	return 0;
 }
 
+#ifdef CONFIG_LOCKMETER
+static inline int _raw_read_trylock(rwlock_t *lock)
+{
+/* FIXME -- replace with assembler */
+	atomic_t *count = (atomic_t *)lock;
+	atomic_dec(count);
+	if (count->counter > 0)
+		return 1;
+	atomic_inc(count);
+	return 0;
+}
+#endif
+
+#if defined(CONFIG_LOCKMETER) && defined(CONFIG_HAVE_DEC_LOCK)
+extern void _metered_spin_lock  (spinlock_t *lock);
+extern void _metered_spin_unlock(spinlock_t *lock);
+
+/*
+ *  Matches what is in arch/i386/lib/dec_and_lock.c, except this one is
+ *  "static inline" so that the spin_lock(), if actually invoked, is charged
+ *  against the real caller, not against the catch-all atomic_dec_and_lock
+ */
+static inline int atomic_dec_and_lock(atomic_t *atomic, spinlock_t *lock)
+{
+	int counter;
+	int newcount;
+
+repeat:
+	counter = atomic_read(atomic);
+	newcount = counter-1;
+
+	if (!newcount)
+		goto slow_path;
+
+	asm volatile("lock; cmpxchgl %1,%2"
+		:"=a" (newcount)
+		:"r" (newcount), "m" (atomic->counter), "0" (counter));
+
+	/* If the above failed, "eax" will have changed */
+	if (newcount != counter)
+		goto repeat;
+	return 0;
+
+slow_path:
+	preempt_disable();
+	_metered_spin_lock(lock);
+	if (atomic_dec_and_test(atomic))
+		return 1;
+	_metered_spin_unlock(lock);
+	preempt_enable();
+	return 0;
+}
+
+#define ATOMIC_DEC_AND_LOCK
+#endif
+
 #endif /* __ASM_SPINLOCK_H */
--- diff/include/asm-i386/string.h	2004-01-19 10:22:59.000000000 +0000
+++ source/include/asm-i386/string.h	2004-02-09 10:39:56.000000000 +0000
@@ -23,7 +23,10 @@
  *		consider these trivial functions to be PD.
  */
 
-#define __HAVE_ARCH_STRCPY
+/* AK: in fact I bet it would be better to move this stuff all out of line.
+ */
+#if !defined(IN_STRING_C)
+
 static inline char * strcpy(char * dest,const char *src)
 {
 int d0, d1, d2;
@@ -37,7 +40,6 @@
 return dest;
 }
 
-#define __HAVE_ARCH_STRNCPY
 static inline char * strncpy(char * dest,const char *src,size_t count)
 {
 int d0, d1, d2, d3;
@@ -56,7 +58,29 @@
 return dest;
 }
 
-#define __HAVE_ARCH_STRCAT
+/*
+ * This is a more generic variant of strncpy_count() suitable for
+ * implementing string-access routines with all sorts of return
+ * code semantics. It's used by mm/usercopy.c.
+ */
+static inline size_t strncpy_count(char * dest,const char *src,size_t count)
+{
+	__asm__ __volatile__(
+
+	"1:\tdecl %0\n\t"
+	"js 2f\n\t"
+	"lodsb\n\t"
+	"stosb\n\t"
+	"testb %%al,%%al\n\t"
+	"jne 1b\n\t"
+	"2:"
+	"incl %0"
+	: "=c" (count)
+	:"S" (src),"D" (dest),"0" (count) : "memory");
+
+	return count;
+}
+
 static inline char * strcat(char * dest,const char * src)
 {
 int d0, d1, d2, d3;
@@ -73,7 +97,6 @@
 return dest;
 }
 
-#define __HAVE_ARCH_STRNCAT
 static inline char * strncat(char * dest,const char * src,size_t count)
 {
 int d0, d1, d2, d3;
@@ -96,7 +119,6 @@
 return dest;
 }
 
-#define __HAVE_ARCH_STRCMP
 static inline int strcmp(const char * cs,const char * ct)
 {
 int d0, d1;
@@ -117,7 +139,6 @@
 return __res;
 }
 
-#define __HAVE_ARCH_STRNCMP
 static inline int strncmp(const char * cs,const char * ct,size_t count)
 {
 register int __res;
@@ -140,7 +161,6 @@
 return __res;
 }
 
-#define __HAVE_ARCH_STRCHR
 static inline char * strchr(const char * s, int c)
 {
 int d0;
@@ -159,7 +179,6 @@
 return __res;
 }
 
-#define __HAVE_ARCH_STRRCHR
 static inline char * strrchr(const char * s, int c)
 {
 int d0, d1;
@@ -176,6 +195,8 @@
 return __res;
 }
 
+#endif
+
 #define __HAVE_ARCH_STRLEN
 static inline size_t strlen(const char * s)
 {
--- diff/include/asm-i386/thread_info.h	2003-10-09 09:47:17.000000000 +0100
+++ source/include/asm-i386/thread_info.h	2004-02-09 10:39:56.000000000 +0000
@@ -33,23 +33,12 @@
 					 	   0-0xBFFFFFFF for user-thead
 						   0-0xFFFFFFFF for kernel-thread
 						*/
-	struct restart_block    restart_block;
+	void *real_stack, *virtual_stack, *user_pgd;
 
+	struct restart_block    restart_block;
 	__u8			supervisor_stack[0];
 };
 
-#else /* !__ASSEMBLY__ */
-
-/* offsets into the thread_info struct for assembly code access */
-#define TI_TASK		0x00000000
-#define TI_EXEC_DOMAIN	0x00000004
-#define TI_FLAGS	0x00000008
-#define TI_STATUS	0x0000000C
-#define TI_CPU		0x00000010
-#define TI_PRE_COUNT	0x00000014
-#define TI_ADDR_LIMIT	0x00000018
-#define TI_RESTART_BLOCK 0x000001C
-
 #endif
 
 #define PREEMPT_ACTIVE		0x4000000
@@ -61,7 +50,7 @@
  */
 #ifndef __ASSEMBLY__
 
-#define INIT_THREAD_INFO(tsk)			\
+#define INIT_THREAD_INFO(tsk, thread_info)	\
 {						\
 	.task		= &tsk,			\
 	.exec_domain	= &default_exec_domain,	\
@@ -72,6 +61,7 @@
 	.restart_block = {			\
 		.fn = do_no_restart_syscall,	\
 	},					\
+	.real_stack	= &thread_info,		\
 }
 
 #define init_thread_info	(init_thread_union.thread_info)
@@ -113,6 +103,7 @@
 #define TIF_NEED_RESCHED	3	/* rescheduling necessary */
 #define TIF_SINGLESTEP		4	/* restore singlestep on return to user mode */
 #define TIF_IRET		5	/* return with iret */
+#define TIF_DB7			6	/* has debug registers */
 #define TIF_POLLING_NRFLAG	16	/* true if poll_idle() is polling TIF_NEED_RESCHED */
 
 #define _TIF_SYSCALL_TRACE	(1<<TIF_SYSCALL_TRACE)
@@ -121,6 +112,7 @@
 #define _TIF_NEED_RESCHED	(1<<TIF_NEED_RESCHED)
 #define _TIF_SINGLESTEP		(1<<TIF_SINGLESTEP)
 #define _TIF_IRET		(1<<TIF_IRET)
+#define _TIF_DB7		(1<<TIF_DB7)
 #define _TIF_POLLING_NRFLAG	(1<<TIF_POLLING_NRFLAG)
 
 #define _TIF_WORK_MASK		0x0000FFFE	/* work to do on interrupt/exception return */
--- diff/include/asm-i386/timer.h	2004-01-19 10:22:59.000000000 +0000
+++ source/include/asm-i386/timer.h	2004-02-09 10:39:56.000000000 +0000
@@ -40,9 +40,13 @@
 #endif
 
 extern unsigned long calibrate_tsc(void);
+extern void init_cpu_khz(void);
 #ifdef CONFIG_HPET_TIMER
 extern struct timer_opts timer_hpet;
 extern unsigned long calibrate_tsc_hpet(unsigned long *tsc_hpet_quotient_ptr);
 #endif
 
+#ifdef CONFIG_X86_PM_TIMER
+extern struct timer_opts timer_pmtmr;
+#endif
 #endif
--- diff/include/asm-i386/timex.h	2003-06-30 10:07:29.000000000 +0100
+++ source/include/asm-i386/timex.h	2004-02-09 10:39:56.000000000 +0000
@@ -12,7 +12,7 @@
 #ifdef CONFIG_X86_PC9800
    extern int CLOCK_TICK_RATE;
 #else
-#ifdef CONFIG_MELAN
+#ifdef CONFIG_X86_ELAN
 #  define CLOCK_TICK_RATE 1189200 /* AMD Elan has different frequency! */
 #else
 #  define CLOCK_TICK_RATE 1193182 /* Underlying HZ */
--- diff/include/asm-i386/tlbflush.h	2003-10-09 09:47:17.000000000 +0100
+++ source/include/asm-i386/tlbflush.h	2004-02-09 10:39:56.000000000 +0000
@@ -85,22 +85,28 @@
 
 static inline void flush_tlb_mm(struct mm_struct *mm)
 {
+#ifndef CONFIG_X86_SWITCH_PAGETABLES
 	if (mm == current->active_mm)
 		__flush_tlb();
+#endif
 }
 
 static inline void flush_tlb_page(struct vm_area_struct *vma,
 	unsigned long addr)
 {
+#ifndef CONFIG_X86_SWITCH_PAGETABLES
 	if (vma->vm_mm == current->active_mm)
 		__flush_tlb_one(addr);
+#endif
 }
 
 static inline void flush_tlb_range(struct vm_area_struct *vma,
 	unsigned long start, unsigned long end)
 {
+#ifndef CONFIG_X86_SWITCH_PAGETABLES
 	if (vma->vm_mm == current->active_mm)
 		__flush_tlb();
+#endif
 }
 
 #else
@@ -111,11 +117,10 @@
 	__flush_tlb()
 
 extern void flush_tlb_all(void);
-extern void flush_tlb_current_task(void);
 extern void flush_tlb_mm(struct mm_struct *);
 extern void flush_tlb_page(struct vm_area_struct *, unsigned long);
 
-#define flush_tlb()	flush_tlb_current_task()
+#define flush_tlb()	flush_tlb_all()
 
 static inline void flush_tlb_range(struct vm_area_struct * vma, unsigned long start, unsigned long end)
 {
--- diff/include/asm-i386/topology.h	2003-08-26 10:00:54.000000000 +0100
+++ source/include/asm-i386/topology.h	2004-02-09 10:39:56.000000000 +0000
@@ -43,9 +43,6 @@
 	return cpu_2_node[cpu];
 }
 
-/* Returns the number of the node containing MemBlk 'memblk' */
-#define memblk_to_node(memblk) (memblk)
-
 /* Returns the number of the node containing Node 'node'.  This architecture is flat, 
    so it is a pretty simple function! */
 #define parent_node(node) (node)
@@ -63,9 +60,6 @@
 	return first_cpu(mask);
 }
 
-/* Returns the number of the first MemBlk on Node 'node' */
-#define node_to_memblk(node) (node)
-
 /* Returns the number of the node containing PCI bus 'bus' */
 static inline cpumask_t pcibus_to_cpumask(int bus)
 {
--- diff/include/asm-i386/uaccess.h	2003-10-09 09:47:17.000000000 +0100
+++ source/include/asm-i386/uaccess.h	2004-02-09 10:39:56.000000000 +0000
@@ -26,7 +26,7 @@
 
 
 #define KERNEL_DS	MAKE_MM_SEG(0xFFFFFFFFUL)
-#define USER_DS		MAKE_MM_SEG(PAGE_OFFSET)
+#define USER_DS		MAKE_MM_SEG(TASK_SIZE)
 
 #define get_ds()	(KERNEL_DS)
 #define get_fs()	(current_thread_info()->addr_limit)
@@ -149,6 +149,45 @@
 		:"=a" (ret),"=d" (x) \
 		:"0" (ptr))
 
+extern int get_user_size(unsigned int size, void *val, const void *ptr);
+extern int put_user_size(unsigned int size, const void *val, void *ptr);
+extern int zero_user_size(unsigned int size, void *ptr);
+extern int copy_str_fromuser_size(unsigned int size, void *val, const void *ptr);
+extern int strlen_fromuser_size(unsigned int size, const void *ptr);
+
+
+# define indirect_get_user(x,ptr)					\
+({	int __ret_gu,__val_gu;						\
+	__typeof__(ptr) __ptr_gu = (ptr);				\
+	__ret_gu = get_user_size(sizeof(*__ptr_gu), &__val_gu,__ptr_gu) ? -EFAULT : 0;\
+	(x) = (__typeof__(*__ptr_gu))__val_gu;				\
+	__ret_gu;							\
+})
+#define indirect_put_user(x,ptr)					\
+({									\
+	__typeof__(*(ptr)) *__ptr_pu = (ptr), __x_pu = (x);		\
+	put_user_size(sizeof(*__ptr_pu), &__x_pu, __ptr_pu) ? -EFAULT : 0; \
+})
+#define __indirect_put_user indirect_put_user
+#define __indirect_get_user indirect_get_user
+
+#define indirect_copy_from_user(to,from,n) get_user_size(n,to,from)
+#define indirect_copy_to_user(to,from,n) put_user_size(n,from,to)
+
+#define __indirect_copy_from_user indirect_copy_from_user
+#define __indirect_copy_to_user indirect_copy_to_user
+
+#define indirect_strncpy_from_user(dst, src, count) \
+		copy_str_fromuser_size(count, dst, src)
+
+extern int strlen_fromuser_size(unsigned int size, const void *ptr);
+#define indirect_strnlen_user(str, n) strlen_fromuser_size(n, str)
+#define indirect_strlen_user(str) indirect_strnlen_user(str, ~0UL >> 1)
+
+extern int zero_user_size(unsigned int size, void *ptr);
+
+#define indirect_clear_user(mem, len) zero_user_size(len, mem)
+#define __indirect_clear_user clear_user
 
 /* Careful: we have to cast the result to the type of the pointer for sign reasons */
 /**
@@ -168,7 +207,7 @@
  * Returns zero on success, or -EFAULT on error.
  * On error, the variable @x is set to zero.
  */
-#define get_user(x,ptr)							\
+#define direct_get_user(x,ptr)						\
 ({	int __ret_gu,__val_gu;						\
 	switch(sizeof (*(ptr))) {					\
 	case 1:  __get_user_x(1,__ret_gu,__val_gu,ptr); break;		\
@@ -198,7 +237,7 @@
  *
  * Returns zero on success, or -EFAULT on error.
  */
-#define put_user(x,ptr)							\
+#define direct_put_user(x,ptr)						\
   __put_user_check((__typeof__(*(ptr)))(x),(ptr),sizeof(*(ptr)))
 
 
@@ -222,7 +261,7 @@
  * Returns zero on success, or -EFAULT on error.
  * On error, the variable @x is set to zero.
  */
-#define __get_user(x,ptr) \
+#define __direct_get_user(x,ptr) \
   __get_user_nocheck((x),(ptr),sizeof(*(ptr)))
 
 
@@ -245,7 +284,7 @@
  *
  * Returns zero on success, or -EFAULT on error.
  */
-#define __put_user(x,ptr) \
+#define __direct_put_user(x,ptr) \
   __put_user_nocheck((__typeof__(*(ptr)))(x),(ptr),sizeof(*(ptr)))
 
 #define __put_user_nocheck(x,ptr,size)				\
@@ -396,7 +435,7 @@
  * On success, this will be zero.
  */
 static inline unsigned long
-__copy_to_user(void __user *to, const void *from, unsigned long n)
+__direct_copy_to_user(void __user *to, const void *from, unsigned long n)
 {
 	if (__builtin_constant_p(n)) {
 		unsigned long ret;
@@ -434,7 +473,7 @@
  * data to the requested size using zero bytes.
  */
 static inline unsigned long
-__copy_from_user(void *to, const void __user *from, unsigned long n)
+__direct_copy_from_user(void *to, const void __user *from, unsigned long n)
 {
 	if (__builtin_constant_p(n)) {
 		unsigned long ret;
@@ -468,11 +507,11 @@
  * On success, this will be zero.
  */
 static inline unsigned long
-copy_to_user(void __user *to, const void *from, unsigned long n)
+direct_copy_to_user(void __user *to, const void *from, unsigned long n)
 {
 	might_sleep();
 	if (access_ok(VERIFY_WRITE, to, n))
-		n = __copy_to_user(to, from, n);
+		n = __direct_copy_to_user(to, from, n);
 	return n;
 }
 
@@ -493,11 +532,11 @@
  * data to the requested size using zero bytes.
  */
 static inline unsigned long
-copy_from_user(void *to, const void __user *from, unsigned long n)
+direct_copy_from_user(void *to, const void __user *from, unsigned long n)
 {
 	might_sleep();
 	if (access_ok(VERIFY_READ, from, n))
-		n = __copy_from_user(to, from, n);
+		n = __direct_copy_from_user(to, from, n);
 	else
 		memset(to, 0, n);
 	return n;
@@ -520,10 +559,68 @@
  * If there is a limit on the length of a valid string, you may wish to
  * consider using strnlen_user() instead.
  */
-#define strlen_user(str) strnlen_user(str, ~0UL >> 1)
 
-long strnlen_user(const char __user *str, long n);
-unsigned long clear_user(void __user *mem, unsigned long len);
-unsigned long __clear_user(void __user *mem, unsigned long len);
+long direct_strncpy_from_user(char *dst, const char *src, long count);
+long __direct_strncpy_from_user(char *dst, const char *src, long count);
+#define direct_strlen_user(str) direct_strnlen_user(str, ~0UL >> 1)
+long direct_strnlen_user(const char *str, long n);
+unsigned long direct_clear_user(void *mem, unsigned long len);
+unsigned long __direct_clear_user(void *mem, unsigned long len);
+
+extern int indirect_uaccess;
+
+#ifdef CONFIG_X86_UACCESS_INDIRECT
+
+/*
+ * Return code and zeroing semantics:
+
+ __clear_user          0                      <-> bytes not done
+ clear_user            0                      <-> bytes not done
+ __copy_to_user        0                      <-> bytes not done
+ copy_to_user          0                      <-> bytes not done
+ __copy_from_user      0                      <-> bytes not done, zero rest
+ copy_from_user        0                      <-> bytes not done, zero rest
+ __get_user            0                      <-> -EFAULT
+ get_user              0                      <-> -EFAULT
+ __put_user            0                      <-> -EFAULT
+ put_user              0                      <-> -EFAULT
+ strlen_user           strlen + 1             <-> 0
+ strnlen_user          strlen + 1 (or n+1)    <-> 0
+ strncpy_from_user     strlen (or n)          <-> -EFAULT
+
+ */
+
+#define __clear_user(mem,len) __indirect_clear_user(mem,len)
+#define clear_user(mem,len) indirect_clear_user(mem,len)
+#define __copy_to_user(to,from,n) __indirect_copy_to_user(to,from,n)
+#define copy_to_user(to,from,n) indirect_copy_to_user(to,from,n)
+#define __copy_from_user(to,from,n) __indirect_copy_from_user(to,from,n)
+#define copy_from_user(to,from,n) indirect_copy_from_user(to,from,n)
+#define __get_user(val,ptr) __indirect_get_user(val,ptr)
+#define get_user(val,ptr) indirect_get_user(val,ptr)
+#define __put_user(val,ptr) __indirect_put_user(val,ptr)
+#define put_user(val,ptr) indirect_put_user(val,ptr)
+#define strlen_user(str) indirect_strlen_user(str)
+#define strnlen_user(src,count) indirect_strnlen_user(src,count)
+#define strncpy_from_user(dst,src,count) \
+			indirect_strncpy_from_user(dst,src,count)
+
+#else
+
+#define __clear_user __direct_clear_user
+#define clear_user direct_clear_user
+#define __copy_to_user __direct_copy_to_user
+#define copy_to_user direct_copy_to_user
+#define __copy_from_user __direct_copy_from_user
+#define copy_from_user direct_copy_from_user
+#define __get_user __direct_get_user
+#define get_user direct_get_user
+#define __put_user __direct_put_user
+#define put_user direct_put_user
+#define strlen_user direct_strlen_user
+#define strnlen_user direct_strnlen_user
+#define strncpy_from_user direct_strncpy_from_user
+
+#endif /* CONFIG_X86_UACCESS_INDIRECT */
 
 #endif /* __i386_UACCESS_H */
--- diff/include/asm-i386/unistd.h	2003-10-09 09:47:34.000000000 +0100
+++ source/include/asm-i386/unistd.h	2004-02-09 10:39:56.000000000 +0000
@@ -279,8 +279,11 @@
 #define __NR_utimes		271
 #define __NR_fadvise64_64	272
 #define __NR_vserver		273
+#define __NR_mbind		274
+#define __NR_get_mempolicy	275
+#define __NR_set_mempolicy	276
 
-#define NR_syscalls 274
+#define NR_syscalls 276
 
 /* user-visible error numbers are in the range -1 - -124: see <asm-i386/errno.h> */
 
@@ -385,7 +388,6 @@
  * won't be any messing with the stack from main(), but we define
  * some others too.
  */
-#define __NR__exit __NR_exit
 static inline _syscall0(pid_t,setsid)
 static inline _syscall3(int,write,int,fd,const char *,buf,off_t,count)
 static inline _syscall3(int,read,int,fd,char *,buf,off_t,count)
@@ -394,7 +396,6 @@
 static inline _syscall3(int,execve,const char *,file,char **,argv,char **,envp)
 static inline _syscall3(int,open,const char *,file,int,flag,int,mode)
 static inline _syscall1(int,close,int,fd)
-static inline _syscall1(int,_exit,int,exitcode)
 static inline _syscall3(pid_t,waitpid,pid_t,pid,int *,wait_stat,int,options)
 
 #endif
--- diff/include/asm-ia64/compat.h	2003-08-20 14:16:33.000000000 +0100
+++ source/include/asm-ia64/compat.h	2004-02-09 10:39:56.000000000 +0000
@@ -26,6 +26,7 @@
 typedef s32		compat_daddr_t;
 typedef u32		compat_caddr_t;
 typedef __kernel_fsid_t	compat_fsid_t;
+typedef u32		compat_timer_t;
 
 typedef s32		compat_int_t;
 typedef s32		compat_long_t;
--- diff/include/asm-ia64/io.h	2003-10-27 09:20:44.000000000 +0000
+++ source/include/asm-ia64/io.h	2004-02-09 10:39:56.000000000 +0000
@@ -125,6 +125,10 @@
 #define __ia64_readw	___ia64_readw
 #define __ia64_readl	___ia64_readl
 #define __ia64_readq	___ia64_readq
+#define __ia64_readb_relaxed	___ia64_readb
+#define __ia64_readw_relaxed	___ia64_readw
+#define __ia64_readl_relaxed	___ia64_readl
+#define __ia64_readq_relaxed	___ia64_readq
 #define __ia64_writeb	___ia64_writeb
 #define __ia64_writew	___ia64_writew
 #define __ia64_writel	___ia64_writel
@@ -337,15 +341,27 @@
 #define __readw		platform_readw
 #define __readl		platform_readl
 #define __readq		platform_readq
+#define __readb_relaxed	platform_readb_relaxed
+#define __readw_relaxed	platform_readw_relaxed
+#define __readl_relaxed	platform_readl_relaxed
+#define __readq_relaxed	platform_readq_relaxed
 
 #define readb(a)	__readb((void *)(a))
 #define readw(a)	__readw((void *)(a))
 #define readl(a)	__readl((void *)(a))
 #define readq(a)	__readq((void *)(a))
+#define readb_relaxed(a)	__readb_relaxed((void *)(a))
+#define readw_relaxed(a)	__readw_relaxed((void *)(a))
+#define readl_relaxed(a)	__readl_relaxed((void *)(a))
+#define readq_relaxed(a)	__readq_relaxed((void *)(a))
 #define __raw_readb	readb
 #define __raw_readw	readw
 #define __raw_readl	readl
 #define __raw_readq	readq
+#define __raw_readb_relaxed	readb_relaxed
+#define __raw_readw_relaxed	readw_relaxed
+#define __raw_readl_relaxed	readl_relaxed
+#define __raw_readq_relaxed	readq_relaxed
 #define writeb(v,a)	__writeb((v), (void *) (a))
 #define writew(v,a)	__writew((v), (void *) (a))
 #define writel(v,a)	__writel((v), (void *) (a))
--- diff/include/asm-ia64/iosapic.h	2003-09-30 15:45:48.000000000 +0100
+++ source/include/asm-ia64/iosapic.h	2004-02-09 10:39:56.000000000 +0000
@@ -52,6 +52,9 @@
 #ifndef __ASSEMBLY__
 
 #ifdef CONFIG_IOSAPIC
+
+#define NR_IOSAPICS			256
+
 extern void __init iosapic_system_init (int pcat_compat);
 extern void __init iosapic_init (unsigned long address,
 				    unsigned int gsi_base);
--- diff/include/asm-ia64/machvec.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/asm-ia64/machvec.h	2004-02-09 10:39:56.000000000 +0000
@@ -65,6 +65,10 @@
 typedef unsigned short ia64_mv_readw_t (void *);
 typedef unsigned int ia64_mv_readl_t (void *);
 typedef unsigned long ia64_mv_readq_t (void *);
+typedef unsigned char ia64_mv_readb_relaxed_t (void *);
+typedef unsigned short ia64_mv_readw_relaxed_t (void *);
+typedef unsigned int ia64_mv_readl_relaxed_t (void *);
+typedef unsigned long ia64_mv_readq_relaxed_t (void *);
 
 extern void machvec_noop (void);
 extern void machvec_memory_fence (void);
@@ -116,6 +120,10 @@
 #  define platform_readw        ia64_mv.readw
 #  define platform_readl        ia64_mv.readl
 #  define platform_readq        ia64_mv.readq
+#  define platform_readb_relaxed        ia64_mv.readb_relaxed
+#  define platform_readw_relaxed        ia64_mv.readw_relaxed
+#  define platform_readl_relaxed        ia64_mv.readl_relaxed
+#  define platform_readq_relaxed        ia64_mv.readq_relaxed
 # endif
 
 /* __attribute__((__aligned__(16))) is required to make size of the
@@ -158,6 +166,10 @@
 	ia64_mv_readw_t *readw;
 	ia64_mv_readl_t *readl;
 	ia64_mv_readq_t *readq;
+	ia64_mv_readb_relaxed_t *readb_relaxed;
+	ia64_mv_readw_relaxed_t *readw_relaxed;
+	ia64_mv_readl_relaxed_t *readl_relaxed;
+	ia64_mv_readq_relaxed_t *readq_relaxed;
 } __attribute__((__aligned__(16))); /* align attrib? see above comment */
 
 #define MACHVEC_INIT(name)			\
@@ -196,6 +208,10 @@
 	platform_readw,				\
 	platform_readl,				\
 	platform_readq,				\
+	platform_readb_relaxed,			\
+	platform_readw_relaxed,			\
+	platform_readl_relaxed,			\
+	platform_readq_relaxed,			\
 }
 
 extern struct ia64_machine_vector ia64_mv;
@@ -322,5 +338,17 @@
 #ifndef platform_readq
 # define platform_readq		__ia64_readq
 #endif
+#ifndef platform_readb_relaxed
+# define platform_readb_relaxed	__ia64_readb_relaxed
+#endif
+#ifndef platform_readw_relaxed
+# define platform_readw_relaxed	__ia64_readw_relaxed
+#endif
+#ifndef platform_readl_relaxed
+# define platform_readl_relaxed	__ia64_readl_relaxed
+#endif
+#ifndef platform_readq_relaxed
+# define platform_readq_relaxed	__ia64_readq_relaxed
+#endif
 
 #endif /* _ASM_IA64_MACHVEC_H */
--- diff/include/asm-ia64/machvec_sn2.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/asm-ia64/machvec_sn2.h	2004-02-09 10:39:56.000000000 +0000
@@ -52,6 +52,10 @@
 extern ia64_mv_readw_t __sn_readw;
 extern ia64_mv_readl_t __sn_readl;
 extern ia64_mv_readq_t __sn_readq;
+extern ia64_mv_readb_t __sn_readb_relaxed;
+extern ia64_mv_readw_t __sn_readw_relaxed;
+extern ia64_mv_readl_t __sn_readl_relaxed;
+extern ia64_mv_readq_t __sn_readq_relaxed;
 extern ia64_mv_dma_alloc_coherent	sn_dma_alloc_coherent;
 extern ia64_mv_dma_free_coherent	sn_dma_free_coherent;
 extern ia64_mv_dma_map_single		sn_dma_map_single;
@@ -87,6 +91,10 @@
 #define platform_readw			__sn_readw
 #define platform_readl			__sn_readl
 #define platform_readq			__sn_readq
+#define platform_readb_relaxed		__sn_readb_relaxed
+#define platform_readw_relaxed		__sn_readw_relaxed
+#define platform_readl_relaxed		__sn_readl_relaxed
+#define platform_readq_relaxed		__sn_readq_relaxed
 #define platform_irq_desc		sn_irq_desc
 #define platform_irq_to_vector		sn_irq_to_vector
 #define platform_local_vector_to_irq	sn_local_vector_to_irq
--- diff/include/asm-ia64/mmzone.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/asm-ia64/mmzone.h	2004-02-09 10:39:56.000000000 +0000
@@ -20,11 +20,11 @@
 #ifdef CONFIG_IA64_DIG /* DIG systems are small */
 # define MAX_PHYSNODE_ID	8
 # define NR_NODES		8
-# define NR_MEMBLKS		(NR_NODES * 32)
+# define NR_NODE_MEMBLKS	(NR_NODES * 8)
 #else /* sn2 is the biggest case, so we use that if !DIG */
 # define MAX_PHYSNODE_ID	2048
 # define NR_NODES		256
-# define NR_MEMBLKS		(NR_NODES)
+# define NR_NODE_MEMBLKS	(NR_NODES * 4)
 #endif
 
 extern unsigned long max_low_pfn;
@@ -34,6 +34,6 @@
 #define pfn_to_page(pfn)	(vmem_map + (pfn))
 
 #else /* CONFIG_DISCONTIGMEM */
-# define NR_MEMBLKS		1
+# define NR_NODE_MEMBLKS	4
 #endif /* CONFIG_DISCONTIGMEM */
 #endif /* _ASM_IA64_MMZONE_H */
--- diff/include/asm-ia64/numa.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/asm-ia64/numa.h	2004-02-09 10:39:56.000000000 +0000
@@ -28,7 +28,7 @@
 
 /* Stuff below this line could be architecture independent */
 
-extern int num_memblks;		/* total number of memory chunks */
+extern int num_node_memblks;		/* total number of memory chunks */
 
 /*
  * List of node memory chunks. Filled when parsing SRAT table to
@@ -47,7 +47,7 @@
 	int	nid;		/* logical node containing this CPU */
 };
 
-extern struct node_memblk_s node_memblk[NR_MEMBLKS];
+extern struct node_memblk_s node_memblk[NR_NODE_MEMBLKS];
 extern struct node_cpuid_s node_cpuid[NR_CPUS];
 
 /*
--- diff/include/asm-ia64/param.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/asm-ia64/param.h	2004-02-09 10:39:56.000000000 +0000
@@ -12,10 +12,6 @@
 
 #define EXEC_PAGESIZE	65536
 
-#ifndef NGROUPS
-# define NGROUPS	32
-#endif
-
 #ifndef NOGROUP
 # define NOGROUP	(-1)
 #endif
--- diff/include/asm-ia64/pci.h	2003-09-17 12:28:12.000000000 +0100
+++ source/include/asm-ia64/pci.h	2004-02-09 10:39:56.000000000 +0000
@@ -16,6 +16,7 @@
  * loader.
  */
 #define pcibios_assign_all_busses()     0
+#define pcibios_scan_all_fns(a, b)	0
 
 #define PCIBIOS_MIN_IO		0x1000
 #define PCIBIOS_MIN_MEM		0x10000000
--- diff/include/asm-ia64/sn/addrs.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/asm-ia64/sn/addrs.h	2004-02-09 10:39:56.000000000 +0000
@@ -9,8 +9,6 @@
 #ifndef _ASM_IA64_SN_ADDRS_H
 #define _ASM_IA64_SN_ADDRS_H
 
-#include <linux/config.h>
-
 #include <asm/sn/sn2/addrs.h>
 
 #ifndef __ASSEMBLY__
@@ -154,7 +152,7 @@
  * the base of the register space.
  */
 #define HUB_REG_PTR(_base, _off)	\
-	(HUBREG_CAST ((__psunsigned_t)(_base) + (__psunsigned_t)(_off)))
+	(HUBREG_CAST ((unsigned long)(_base) + (__psunsigned_t)(_off)))
 
 #define HUB_REG_PTR_L(_base, _off)	\
 	HUB_L(HUB_REG_PTR((_base), (_off)))
--- diff/include/asm-ia64/sn/arch.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/asm-ia64/sn/arch.h	2004-02-09 10:39:56.000000000 +0000
@@ -11,12 +11,9 @@
 #ifndef _ASM_IA64_SN_ARCH_H
 #define _ASM_IA64_SN_ARCH_H
 
-#include <linux/config.h>
-#include <linux/threads.h>
-#include <linux/mmzone.h>
+#include <asm/types.h>
 #include <asm/sn/types.h>
-
-#include <asm/sn/sn2/arch.h>
+#include <asm/sn/sn_cpuid.h>
 
 typedef u64	shubreg_t;
 typedef u64	hubreg_t;
--- diff/include/asm-ia64/sn/bte.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/asm-ia64/sn/bte.h	2004-02-09 10:39:56.000000000 +0000
@@ -13,8 +13,7 @@
 #include <linux/timer.h>
 #include <linux/spinlock.h>
 #include <linux/cache.h>
-#include <asm/sn/io.h>
-#include <asm/delay.h>
+#include <asm/sn/types.h>
 
 
 /* #define BTE_DEBUG */
--- diff/include/asm-ia64/sn/clksupport.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/asm-ia64/sn/clksupport.h	2004-02-09 10:39:56.000000000 +0000
@@ -23,9 +23,7 @@
 #ifndef _ASM_IA64_SN_CLKSUPPORT_H
 #define _ASM_IA64_SN_CLKSUPPORT_H
 
-#include <linux/config.h>
 #include <asm/sn/arch.h>
-#include <asm/sn/addrs.h>
 
 typedef long clkreg_t;
 
--- diff/include/asm-ia64/sn/driver.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/asm-ia64/sn/driver.h	2004-02-09 10:39:56.000000000 +0000
@@ -31,7 +31,7 @@
 struct piomap;
 struct dmamap;
 
-typedef __psunsigned_t iobush_t;
+typedef unsigned long iobush_t;
 
 /* interrupt function */
 typedef void	       *intr_arg_t;
--- diff/include/asm-ia64/sn/hcl.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/asm-ia64/sn/hcl.h	2004-02-09 10:39:56.000000000 +0000
@@ -8,15 +8,16 @@
 #ifndef _ASM_IA64_SN_HCL_H
 #define _ASM_IA64_SN_HCL_H
 
+#include <linux/fs.h>
 #include <asm/sn/sgi.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 *, ...);
+void hwgraph_debug(char *, const char *, int, vertex_hdl_t, vertex_hdl_t, char *, ...);
 
 #if 1
-#define HWGRAPH_DEBUG(args) hwgraph_debug args ;
+#define HWGRAPH_DEBUG(args...) hwgraph_debug(args)
 #else   
 #define HWGRAPH_DEBUG(args)
 #endif  
@@ -58,7 +59,6 @@
 #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)
 
 /*
--- diff/include/asm-ia64/sn/hcl_util.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/asm-ia64/sn/hcl_util.h	2004-02-09 10:39:56.000000000 +0000
@@ -9,6 +9,8 @@
 #ifndef _ASM_IA64_SN_HCL_UTIL_H
 #define _ASM_IA64_SN_HCL_UTIL_H
 
+#include <asm/sn/sgi.h>
+
 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);
--- diff/include/asm-ia64/sn/hwgfs.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/asm-ia64/sn/hwgfs.h	2004-02-09 10:39:56.000000000 +0000
@@ -8,6 +8,9 @@
  *
  * Copyright (C) 1992 - 1997, 2000-2003 Silicon Graphics, Inc. All rights reserved.
  */
+
+#include <asm/types.h>
+
 typedef struct dentry *hwgfs_handle_t;
 
 extern hwgfs_handle_t hwgfs_register(hwgfs_handle_t dir, const char *name,
--- diff/include/asm-ia64/sn/iograph.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/asm-ia64/sn/iograph.h	2004-02-09 10:39:56.000000000 +0000
@@ -144,6 +144,7 @@
 void init_all_devices(void);
 #endif /* __KERNEL__ */
 
+#include <asm/sn/sgi.h>
 #include <asm/sn/xtalk/xbow.h>	/* For get MAX_PORT_NUM */
 
 int io_brick_map_widget(int, int);
--- diff/include/asm-ia64/sn/klconfig.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/asm-ia64/sn/klconfig.h	2004-02-09 10:39:56.000000000 +0000
@@ -92,9 +92,9 @@
 
 
 typedef struct console_s {
-	__psunsigned_t 	uart_base;
-	__psunsigned_t 	config_base;
-	__psunsigned_t 	memory_base;
+	unsigned long 	uart_base;
+	unsigned long 	config_base;
+	unsigned long 	memory_base;
 	short		baud;
 	short		flag;
 	int		type;
@@ -134,7 +134,7 @@
 /* --- New Macros for the changed kl_config_hdr_t structure --- */
 
 #define PTR_CH_CONS_INFO(_k)	((console_t *)\
-			((__psunsigned_t)_k + (_k->ch_cons_off)))
+			((unsigned long)_k + (_k->ch_cons_off)))
 
 #define KL_CONFIG_CH_CONS_INFO(_n)   PTR_CH_CONS_INFO(KL_CONFIG_HDR(_n))
 
@@ -672,18 +672,19 @@
 /* external declarations of Linux kernel functions. */
 
 extern lboard_t *root_lboard[];
-extern lboard_t *find_lboard(lboard_t *start, unsigned char type);
+extern lboard_t *find_lboard_any(lboard_t *start, unsigned char type);
+extern lboard_t *find_lboard_nasid(lboard_t *start, nasid_t, 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);
 extern klcpu_t *nasid_slice_to_cpuinfo(nasid_t, int);
 
 
 extern lboard_t *find_gfxpipe(int pipenum);
-extern lboard_t *find_lboard_class(lboard_t *start, unsigned char brd_class);
+extern lboard_t *find_lboard_class_any(lboard_t *start, unsigned char brd_class);
+extern lboard_t *find_lboard_class_nasid(lboard_t *start, nasid_t, unsigned char brd_class);
 extern lboard_t *find_nic_lboard(lboard_t *, nic_t);
 extern lboard_t *find_nic_type_lboard(nasid_t, unsigned char, nic_t);
 extern lboard_t *find_lboard_modslot(lboard_t *start, geoid_t geoid);
-extern lboard_t *find_lboard_module(lboard_t *start, geoid_t geoid);
 extern int	config_find_nic_router(nasid_t, nic_t, lboard_t **, klrou_t**);
 extern int	config_find_nic_hub(nasid_t, nic_t, lboard_t **, klhub_t**);
 extern int	config_find_xbow(nasid_t, lboard_t **, klxbow_t**);
--- diff/include/asm-ia64/sn/kldir.h	2003-06-30 10:07:34.000000000 +0100
+++ source/include/asm-ia64/sn/kldir.h	2004-02-09 10:39:56.000000000 +0000
@@ -11,7 +11,7 @@
 #ifndef _ASM_IA64_SN_KLDIR_H
 #define _ASM_IA64_SN_KLDIR_H
 
-#include <asm/sn/sgi.h>
+#include <linux/types.h>
 
 /*
  * The kldir memory area resides at a fixed place in each node's memory and
@@ -136,7 +136,7 @@
 typedef struct kldir_ent_s {
 	u64		magic;		/* Indicates validity of entry      */
 	off_t		offset;		/* Offset from start of node space  */
-	__psunsigned_t	pointer;	/* Pointer to area in some cases    */
+	unsigned long	pointer;	/* Pointer to area in some cases    */
 	size_t		size;		/* Size in bytes 		    */
 	u64		count;		/* Repeat count if array, 1 if not  */
 	size_t		stride;		/* Stride if array, 0 if not        */
--- diff/include/asm-ia64/sn/module.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/asm-ia64/sn/module.h	2004-02-09 10:39:56.000000000 +0000
@@ -13,7 +13,7 @@
 #endif
 
 
-#include <linux/config.h>
+#include <asm/semaphore.h>
 #include <asm/sn/klconfig.h>
 #include <asm/sn/ksys/elsc.h>
 
@@ -158,12 +158,9 @@
     spinlock_t		lock;		/* Lock for this structure	   */
 
     /* List of nodes in this module */
-    cnodeid_t		nodes[MODULE_MAX_NODES];
-    geoid_t		geoid[MODULE_MAX_NODES];
-    struct {
-		char	moduleid[8];
-    } io[MODULE_MAX_NODES];
-    int			nodecnt;	/* Number of nodes in array        */
+    cnodeid_t		nodes[MAX_SLABS + 1];
+    geoid_t		geoid[MAX_SLABS + 1];
+
     /* Fields for Module System Controller */
     int			mesgpend;	/* Message pending                 */
     int			shutdown;	/* Shutdown in progress            */
--- diff/include/asm-ia64/sn/nodepda.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/asm-ia64/sn/nodepda.h	2004-02-09 10:39:56.000000000 +0000
@@ -9,14 +9,14 @@
 #define _ASM_IA64_SN_NODEPDA_H
 
 
-#include <linux/config.h>
-#include <asm/sn/sgi.h>
+#include <asm/semaphore.h>
 #include <asm/irq.h>
 #include <asm/sn/intr.h>
 #include <asm/sn/router.h>
 #include <asm/sn/pda.h>
 #include <asm/sn/module.h>
 #include <asm/sn/bte.h>
+#include <asm/sn/sn2/arch.h>
 
 /*
  * NUMA Node-Specific Data structures are defined in this file.
--- diff/include/asm-ia64/sn/pci/bridge.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/asm-ia64/sn/pci/bridge.h	2004-02-09 10:39:56.000000000 +0000
@@ -533,12 +533,12 @@
 
     /* 0x020000-0x027FFF -- PCI Device Configuration Spaces */
     union {				/* make all access sizes available. */
-	uchar_t		    c[0x1000 / 1];	    /* 0x02{0000,,,7FFF} */
+	unsigned char		    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 {
-	    uchar_t	    c[0x100 / 1];
+	    unsigned char	    c[0x100 / 1];
 	    uint16_t	    s[0x100 / 2];
 	    uint32_t	    l[0x100 / 4];
 	    uint64_t	    d[0x100 / 8];
@@ -547,12 +547,12 @@
 
     /* 0x028000-0x028FFF -- PCI Type 1 Configuration Space */
     union {				/* make all access sizes available. */
-	uchar_t		    c[0x1000 / 1];
+	unsigned char		    c[0x1000 / 1];
 	uint16_t	    s[0x1000 / 2];
 	uint32_t	    l[0x1000 / 4];
 	uint64_t	    d[0x1000 / 8];
         union {
-            uchar_t         c[0x100 / 1];
+            unsigned char         c[0x100 / 1];
             uint16_t        s[0x100 / 2];
             uint32_t        l[0x100 / 4];
             uint64_t        d[0x100 / 8];
@@ -563,13 +563,13 @@
 
     /* 0x030000-0x030007 -- PCI Interrupt Acknowledge Cycle */
     union {
-	uchar_t		    c[8 / 1];
+	unsigned char		    c[8 / 1];
 	uint16_t	    s[8 / 2];
 	uint32_t	    l[8 / 4];
 	uint64_t	    d[8 / 8];
     } b_pci_iack;				    /* 0x030000-0x030007 */
 
-    uchar_t		    _pad_030007[0x04fff8];  /* 0x030008-0x07FFFF */
+    unsigned char		    _pad_030007[0x04fff8];  /* 0x030008-0x07FFFF */
 
     /* 0x080000-0x0FFFFF -- External Address Translation Entry RAM */
     bridge_ate_t	    b_ext_ate_ram[0x10000];
@@ -579,7 +579,7 @@
 
     /* 0x200000-0xBFFFFF -- PCI/GIO Device Spaces */
     union {				/* make all access sizes available. */
-	uchar_t		    c[0x100000 / 1];
+	unsigned char		    c[0x100000 / 1];
 	uint16_t	    s[0x100000 / 2];
 	uint32_t	    l[0x100000 / 4];
 	uint64_t	    d[0x100000 / 8];
@@ -593,7 +593,7 @@
 
     /* 0xC00000-0xFFFFFF -- External Flash Proms 1,0 */
     union {				/* make all access sizes available. */
-	uchar_t		    c[0x400000 / 1];	/* read-only */
+	unsigned char		    c[0x400000 / 1];	/* read-only */
 	uint16_t	    s[0x400000 / 2];	/* read-write */
 	uint32_t	    l[0x400000 / 4];	/* read-only */
 	uint64_t	    d[0x400000 / 8];	/* read-only */
@@ -918,6 +918,10 @@
 #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)
 
+/* NOTE: 's' is the internal device number, not the external slot number */
+#define PCIBR_BUS_TYPE0_CFG_DEV(ps, s) \
+		PCIBRIDGE_TYPE0_CFG_DEV((ps)->bs_busnum, s+1)
+
 #endif				/* LANGUAGE_C */
 
 #define BRIDGE_EXTERNAL_FLASH	0x00C00000	/* External Flash PROMS */
@@ -943,10 +947,6 @@
 #define XBRIDGE_REV_B			0x2
 
 /* macros to determine bridge type. 'wid' == widget identification */
-#define IS_BRIDGE(wid) (XWIDGET_PART_NUM(wid) == BRIDGE_WIDGET_PART_NUM && \
-			XWIDGET_MFG_NUM(wid) == BRIDGE_WIDGET_MFGR_NUM)
-#define IS_XBRIDGE(wid) (XWIDGET_PART_NUM(wid) == XBRIDGE_WIDGET_PART_NUM && \
-			XWIDGET_MFG_NUM(wid) == XBRIDGE_WIDGET_MFGR_NUM)
 #define IS_PIC_BUS0(wid) (XWIDGET_PART_NUM(wid) == PIC_WIDGET_PART_NUM_BUS0 && \
 			XWIDGET_MFG_NUM(wid) == PIC_WIDGET_MFGR_NUM)
 #define IS_PIC_BUS1(wid) (XWIDGET_PART_NUM(wid) == PIC_WIDGET_PART_NUM_BUS1 && \
--- diff/include/asm-ia64/sn/pci/pci_bus_cvlink.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/asm-ia64/sn/pci/pci_bus_cvlink.h	2004-02-09 10:39:56.000000000 +0000
@@ -31,10 +31,6 @@
 #define MAX_PCI_XWIDGET 256
 #define MAX_ATE_MAPS 1024
 
-#define SET_PCIA64(dev) \
-	(((struct sn_device_sysdata *)((dev)->sysdata))->isa64) = 1
-#define IS_PCIA64(dev)	(((dev)->dma_mask == 0xffffffffffffffffUL) || \
-		(((struct sn_device_sysdata *)((dev)->sysdata))->isa64))
 #define IS_PCI32G(dev)	((dev)->dma_mask >= 0xffffffff)
 #define IS_PCI32L(dev)	((dev)->dma_mask < 0xffffffff)
 
@@ -50,9 +46,6 @@
 
 struct sn_device_sysdata {
         vertex_hdl_t  vhdl;
-	int		isa64;
-	volatile unsigned int *dma_buf_sync;
-	volatile unsigned int *xbow_buf_sync;
 	pciio_provider_t	*pci_provider;
 };
 
--- diff/include/asm-ia64/sn/pci/pcibr.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/asm-ia64/sn/pci/pcibr.h	2004-02-09 10:39:56.000000000 +0000
@@ -41,26 +41,6 @@
 typedef struct pcibr_intr_s *pcibr_intr_t;
 
 /* =====================================================================
- *    primary entry points: Bridge (pcibr) device driver
- *
- *	These functions are normal device driver entry points
- *	and are called along with the similar entry points from
- *	other device drivers. They are included here as documentation
- *	of their existence and purpose.
- *
- *	pcibr_init() is called to inform us that there is a pcibr driver
- *	configured into the kernel; it is responsible for registering
- *	as a crosstalk widget and providing a routine to be called
- *	when a widget with the proper part number is observed.
- *
- *	pcibr_attach() is called for each vertex in the hardware graph
- *	corresponding to a crosstalk widget with the manufacturer
- *	code and part number registered by pcibr_init().
- */
-
-extern int		pcibr_attach(vertex_hdl_t);
-
-/* =====================================================================
  *    bus provider function table
  *
  *	Normally, this table is only handed off explicitly
@@ -72,7 +52,6 @@
  *	pcibr, we can go directly to this ops table.
  */
 
-extern pciio_provider_t pcibr_provider;
 extern pciio_provider_t pci_pic_provider;
 
 /* =====================================================================
@@ -107,6 +86,11 @@
 
 extern void		pcibr_piomap_done(pcibr_piomap_t piomap);
 
+extern int		pcibr_piomap_probe(pcibr_piomap_t piomap,
+					   off_t offset,
+					   int len,
+					   void *valp);
+
 extern caddr_t		pcibr_piotrans_addr(vertex_hdl_t dev,
 					    device_desc_t dev_desc,
 					    pciio_space_t space,
@@ -135,10 +119,6 @@
 					  paddr_t paddr,
 					  size_t byte_count);
 
-extern alenlist_t	pcibr_dmamap_list(pcibr_dmamap_t dmamap,
-					  alenlist_t palenlist,
-					  unsigned flags);
-
 extern void		pcibr_dmamap_done(pcibr_dmamap_t dmamap);
 
 /*
@@ -155,20 +135,12 @@
 					    size_t byte_count,
 					    unsigned flags);
 
-extern alenlist_t	pcibr_dmatrans_list(vertex_hdl_t dev,
-					    device_desc_t dev_desc,
-					    alenlist_t palenlist,
-					    unsigned flags);
-
 extern void		pcibr_dmamap_drain(pcibr_dmamap_t map);
 
 extern void		pcibr_dmaaddr_drain(vertex_hdl_t vhdl,
 					    paddr_t addr,
 					    size_t bytes);
 
-extern void		pcibr_dmalist_drain(vertex_hdl_t vhdl,
-					    alenlist_t list);
-
 typedef unsigned	pcibr_intr_ibit_f(pciio_info_t info,
 					  pciio_intr_line_t lines);
 
@@ -193,15 +165,10 @@
 
 extern int		pcibr_reset(vertex_hdl_t dev);
 
-extern int              pcibr_write_gather_flush(vertex_hdl_t dev);
-
 extern pciio_endian_t	pcibr_endian_set(vertex_hdl_t dev,
 					 pciio_endian_t device_end,
 					 pciio_endian_t desired_end);
 
-extern pciio_priority_t pcibr_priority_set(vertex_hdl_t dev,
-					   pciio_priority_t device_prio);
-
 extern uint64_t		pcibr_config_get(vertex_hdl_t conn,
 					 unsigned reg,
 					 unsigned size);
@@ -211,6 +178,10 @@
 					 unsigned size,
 					 uint64_t value);
 
+extern pciio_slot_t	pcibr_error_extract(vertex_hdl_t pcibr_vhdl,
+					    pciio_space_t *spacep,
+					    iopaddr_t *addrp);
+
 extern int		pcibr_wrb_flush(vertex_hdl_t pconn_vhdl);
 extern int		pcibr_rrb_check(vertex_hdl_t pconn_vhdl,
 					int *count_vchan0,
@@ -234,6 +205,12 @@
 					       rrb_alloc_funct_f *func);
 
 extern int		pcibr_device_unregister(vertex_hdl_t);
+extern void             pcibr_driver_reg_callback(vertex_hdl_t, int, int, int);
+extern void             pcibr_driver_unreg_callback(vertex_hdl_t,
+                                                    int, int, int);
+
+
+extern void *		pcibr_bridge_ptr_get(vertex_hdl_t, int);
 
 /*
  * Bridge-specific flags that can be set via pcibr_device_flags_set
@@ -297,6 +274,12 @@
 
 typedef int		pcibr_device_flags_t;
 
+#define MINIMAL_ATES_REQUIRED(addr, size) \
+	(IOPG(IOPGOFF(addr) + (size) - 1) == IOPG((size) - 1))
+
+#define MINIMAL_ATE_FLAG(addr, size) \
+	(MINIMAL_ATES_REQUIRED((u_long)addr, size) ? PCIBR_NO_ATE_ROUNDUP : 0)
+
 /*
  * Set bits in the Bridge Device(x) register for this device.
  * "flags" are defined above. NOTE: this includes turning
@@ -324,9 +307,6 @@
  * the allocation time in the current implementation of PCI bridge.
  */
 extern iopaddr_t	pcibr_dmamap_pciaddr_get(pcibr_dmamap_t);
-
-extern xwidget_intr_preset_f pcibr_xintr_preset;
-
 extern void		pcibr_hints_fix_rrbs(vertex_hdl_t);
 extern void		pcibr_hints_dualslot(vertex_hdl_t, pciio_slot_t, pciio_slot_t);
 extern void		pcibr_hints_subdevs(vertex_hdl_t, pciio_slot_t, ulong);
@@ -426,7 +406,6 @@
     unsigned                resp_bss_d64_flags;
     iopaddr_t               resp_bss_d32_base;
     unsigned                resp_bss_d32_flags;
-    atomic_t		    resp_bss_ext_ates_active;
     volatile unsigned      *resp_bss_cmd_pointer;
     unsigned                resp_bss_cmd_shadow;
     int                     resp_bs_rrb_valid;
@@ -438,8 +417,6 @@
     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 {
         int                     resp_f_status;
         char                    resp_f_slot_name[MAXDEVNAME];
--- diff/include/asm-ia64/sn/pci/pcibr_private.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/asm-ia64/sn/pci/pcibr_private.h	2004-02-09 10:39:56.000000000 +0000
@@ -33,24 +33,125 @@
 typedef struct pcibr_intr_wrap_s *pcibr_intr_wrap_t;
 typedef struct pcibr_intr_cbuf_s *pcibr_intr_cbuf_t;
 
-typedef volatile unsigned *cfg_p;
+typedef volatile unsigned int *cfg_p;
 typedef volatile bridgereg_t *reg_p;
 
 /*
  * extern functions
  */
-cfg_p pcibr_slot_config_addr(bridge_t *, pciio_slot_t, int);
-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);
+cfg_p pcibr_slot_config_addr(pcibr_soft_t, pciio_slot_t, int);
+cfg_p pcibr_func_config_addr(pcibr_soft_t, pciio_bus_t bus, pciio_slot_t, pciio_function_t, 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, 
-								unsigned);
+void pcibr_func_config_set(pcibr_soft_t, pciio_slot_t, pciio_function_t, int, unsigned);
+/*
+ * pcireg_ externs
+ */
+
+extern uint64_t		pcireg_id_get(pcibr_soft_t);
+extern uint64_t		pcireg_bridge_id_get(void *);
+extern uint64_t		pcireg_bus_err_get(pcibr_soft_t);
+extern uint64_t		pcireg_control_get(pcibr_soft_t);
+extern uint64_t		pcireg_bridge_control_get(void *);
+extern void		pcireg_control_set(pcibr_soft_t, uint64_t);
+extern void		pcireg_control_bit_clr(pcibr_soft_t, uint64_t);
+extern void		pcireg_control_bit_set(pcibr_soft_t, uint64_t);
+extern void		pcireg_req_timeout_set(pcibr_soft_t, uint64_t);
+extern void		pcireg_intr_dst_set(pcibr_soft_t, uint64_t);
+extern uint64_t		pcireg_intr_dst_target_id_get(pcibr_soft_t);
+extern void		pcireg_intr_dst_target_id_set(pcibr_soft_t, uint64_t);
+extern uint64_t		pcireg_intr_dst_addr_get(pcibr_soft_t);
+extern void		pcireg_intr_dst_addr_set(pcibr_soft_t, uint64_t);
+extern uint64_t		pcireg_cmdword_err_get(pcibr_soft_t);
+extern uint64_t		pcireg_llp_cfg_get(pcibr_soft_t);
+extern void		pcireg_llp_cfg_set(pcibr_soft_t, uint64_t);
+extern uint64_t		pcireg_tflush_get(pcibr_soft_t);
+extern uint64_t		pcireg_linkside_err_get(pcibr_soft_t);
+extern uint64_t		pcireg_resp_err_get(pcibr_soft_t);
+extern uint64_t		pcireg_resp_err_addr_get(pcibr_soft_t);
+extern uint64_t		pcireg_resp_err_buf_get(pcibr_soft_t);
+extern uint64_t		pcireg_resp_err_dev_get(pcibr_soft_t);
+extern uint64_t		pcireg_linkside_err_addr_get(pcibr_soft_t);
+extern uint64_t		pcireg_dirmap_get(pcibr_soft_t);
+extern void		pcireg_dirmap_set(pcibr_soft_t, uint64_t);
+extern void		pcireg_dirmap_wid_set(pcibr_soft_t, uint64_t);
+extern void		pcireg_dirmap_diroff_set(pcibr_soft_t, uint64_t);
+extern void		pcireg_dirmap_add512_set(pcibr_soft_t);
+extern void		pcireg_dirmap_add512_clr(pcibr_soft_t);
+extern uint64_t		pcireg_map_fault_get(pcibr_soft_t);
+extern uint64_t		pcireg_arbitration_get(pcibr_soft_t);
+extern void		pcireg_arbitration_set(pcibr_soft_t, uint64_t);
+extern void		pcireg_arbitration_bit_clr(pcibr_soft_t, uint64_t);
+extern void		pcireg_arbitration_bit_set(pcibr_soft_t, uint64_t);
+extern uint64_t		pcireg_parity_err_get(pcibr_soft_t);
+extern uint64_t		pcireg_type1_cntr_get(pcibr_soft_t);
+extern void		pcireg_type1_cntr_set(pcibr_soft_t, uint64_t);
+extern uint64_t		pcireg_timeout_get(pcibr_soft_t);
+extern void		pcireg_timeout_set(pcibr_soft_t, uint64_t);
+extern void		pcireg_timeout_bit_clr(pcibr_soft_t, uint64_t);
+extern void		pcireg_timeout_bit_set(pcibr_soft_t, uint64_t);
+extern uint64_t		pcireg_pci_bus_addr_get(pcibr_soft_t);
+extern uint64_t		pcireg_pci_bus_addr_addr_get(pcibr_soft_t);
+extern uint64_t		pcireg_intr_status_get(pcibr_soft_t);
+extern uint64_t		pcireg_intr_enable_get(pcibr_soft_t);
+extern void		pcireg_intr_enable_set(pcibr_soft_t, uint64_t);
+extern void		pcireg_intr_enable_bit_clr(pcibr_soft_t, uint64_t);
+extern void		pcireg_intr_enable_bit_set(pcibr_soft_t, uint64_t);
+extern void		pcireg_intr_reset_set(pcibr_soft_t, uint64_t);
+extern void		pcireg_intr_reset_bit_set(pcibr_soft_t, uint64_t);
+extern uint64_t		pcireg_intr_mode_get(pcibr_soft_t);
+extern void		pcireg_intr_mode_set(pcibr_soft_t, uint64_t);
+extern void		pcireg_intr_mode_bit_clr(pcibr_soft_t, uint64_t);
+extern uint64_t		pcireg_intr_device_get(pcibr_soft_t);
+extern void		pcireg_intr_device_set(pcibr_soft_t, uint64_t);
+extern void		pcireg_intr_device_bit_set(pcibr_soft_t, uint64_t);
+extern void		pcireg_bridge_intr_device_bit_set(void *, uint64_t);
+extern void		pcireg_intr_device_bit_clr(pcibr_soft_t, uint64_t);
+extern uint64_t		pcireg_intr_host_err_get(pcibr_soft_t);
+extern void		pcireg_intr_host_err_set(pcibr_soft_t, uint64_t);
+extern uint64_t		pcireg_intr_addr_get(pcibr_soft_t, int);
+extern void		pcireg_intr_addr_set(pcibr_soft_t, int, uint64_t);
+extern void		pcireg_bridge_intr_addr_set(void *, int, uint64_t);
+extern void *		pcireg_intr_addr_addr(pcibr_soft_t, int);
+extern void		pcireg_intr_addr_vect_set(pcibr_soft_t, int, uint64_t);
+extern void		pcireg_bridge_intr_addr_vect_set(void *, int, uint64_t);
+extern uint64_t		pcireg_intr_addr_addr_get(pcibr_soft_t, int);
+extern void		pcireg_intr_addr_addr_set(pcibr_soft_t, int, uint64_t);
+extern void		pcireg_bridge_intr_addr_addr_set(void *, int, uint64_t);
+extern uint64_t		pcireg_intr_view_get(pcibr_soft_t);
+extern uint64_t		pcireg_intr_multiple_get(pcibr_soft_t);
+extern void		pcireg_force_always_set(pcibr_soft_t, int);
+extern void *		pcireg_bridge_force_always_addr_get(void *, int);
+extern void *		pcireg_force_always_addr_get(pcibr_soft_t, int);
+extern void		pcireg_force_intr_set(pcibr_soft_t, int);
+extern uint64_t		pcireg_device_get(pcibr_soft_t, int);
+extern void		pcireg_device_set(pcibr_soft_t, int, uint64_t);
+extern void		pcireg_device_bit_set(pcibr_soft_t, int, uint64_t);
+extern void		pcireg_device_bit_clr(pcibr_soft_t, int, uint64_t);
+extern uint64_t		pcireg_rrb_get(pcibr_soft_t, int);
+extern void		pcireg_rrb_set(pcibr_soft_t, int, uint64_t);
+extern void		pcireg_rrb_bit_set(pcibr_soft_t, int, uint64_t);
+extern void		pcireg_rrb_bit_clr(pcibr_soft_t, int, uint64_t);
+extern uint64_t		pcireg_rrb_status_get(pcibr_soft_t);
+extern void		pcireg_rrb_clear_set(pcibr_soft_t, uint64_t);
+extern uint64_t		pcireg_wrb_flush_get(pcibr_soft_t, int);
+extern uint64_t		pcireg_pcix_bus_err_addr_get(pcibr_soft_t);
+extern uint64_t		pcireg_pcix_bus_err_attr_get(pcibr_soft_t);
+extern uint64_t		pcireg_pcix_bus_err_data_get(pcibr_soft_t);
+extern uint64_t		pcireg_pcix_req_err_attr_get(pcibr_soft_t);
+extern uint64_t		pcireg_pcix_req_err_addr_get(pcibr_soft_t);
+extern uint64_t		pcireg_pcix_pio_split_addr_get(pcibr_soft_t);
+extern uint64_t		pcireg_pcix_pio_split_attr_get(pcibr_soft_t);
+extern cfg_p		pcireg_type1_cfg_addr(pcibr_soft_t, pciio_function_t,
+					      int);
+extern cfg_p		pcireg_type0_cfg_addr(pcibr_soft_t, pciio_slot_t,
+					      pciio_function_t, int);
+extern bridge_ate_t	pcireg_int_ate_get(pcibr_soft_t, int);
+extern void		pcireg_int_ate_set(pcibr_soft_t, int, bridge_ate_t);
+extern bridge_ate_p	pcireg_int_ate_addr(pcibr_soft_t, int);
+
+extern uint64_t		pcireg_speed_get(pcibr_soft_t);
+extern uint64_t		pcireg_mode_get(pcibr_soft_t);
+
 /*
  * PCIBR_DEBUG() macro and debug bitmask defines
  */
@@ -117,7 +218,7 @@
     xtalk_piomap_t          bp_xtalk_pio;	/* corresponding xtalk resource */
     pcibr_piomap_t	    bp_next;	/* Next piomap on the list */
     pcibr_soft_t	    bp_soft;	/* backpointer to bridge soft data */
-    atomic_t		    bp_toc[1];	/* PCI timeout counter */
+    atomic_t		    bp_toc;	/* PCI timeout counter */
 
 };
 
@@ -143,6 +244,7 @@
     bridge_ate_t            bd_ate_proto;	/* prototype ATE (for xioaddr=0) */
     bridge_ate_t            bd_ate_prime;	/* value of 1st ATE written */
     dma_addr_t		    bd_dma_addr;	/* Linux dma handle */
+    struct resource	    resource;
 };
 
 #define	IBUFSIZE	5		/* size of circular buffer (holds 4) */
@@ -171,7 +273,7 @@
 #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. */
-    unsigned                bi_ibits;	/* which Bridge interrupt bit(s) */
+    unsigned int                bi_ibits;	/* which Bridge interrupt bit(s) */
     pcibr_soft_t            bi_soft;	/* shortcut to soft info */
     struct pcibr_intr_cbuf_s bi_ibuf;	/* circular buffer of wrap ptrs */
     unsigned		bi_last_intr;	/* For Shub lb lost intr. bug */
@@ -245,7 +347,8 @@
 struct pcibr_intr_list_s {
     pcibr_intr_list_t       il_next;
     pcibr_intr_t            il_intr;
-    volatile bridgereg_t   *il_wrbf;	/* ptr to b_wr_req_buf[] */
+    pcibr_soft_t	    il_soft;
+    pciio_slot_t	    il_slot;
 };
 
 /* =====================================================================
@@ -271,7 +374,7 @@
  * To reduce the size of the internal resource mapping structures, do
  * not use the entire PCI bus I/O address space
  */ 
-#define PCIBR_BUS_IO_BASE      0x100000
+#define PCIBR_BUS_IO_BASE      0x200000
 #define PCIBR_BUS_IO_MAX       0x0FFFFFFF
 #define PCIBR_BUS_IO_PAGE      0x100000
 
@@ -284,8 +387,6 @@
 #define PCIBR_BUS_MEM_PAGE     0x100000
 
 /* defines for pcibr_soft_s->bs_bridge_type */
-#define PCIBR_BRIDGETYPE_BRIDGE		0
-#define PCIBR_BRIDGETYPE_XBRIDGE	1
 #define PCIBR_BRIDGETYPE_PIC		2
 #define IS_PIC_BUSNUM_SOFT(ps, bus)	((ps)->bs_busnum == (bus))
 
@@ -294,25 +395,6 @@
  */
 #define PCIBR_WAR_ENABLED(pv, pcibr_soft) \
 	((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,
- * (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: 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 */
-#define PV856866 (1 << 1) /* PIC: avoid rrb's 0/1/8/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
@@ -349,14 +431,16 @@
     vertex_hdl_t          bs_conn;		/* xtalk connection point */
     vertex_hdl_t          bs_vhdl;		/* vertex owned by pcibr */
     uint64_t                bs_int_enable;	/* Mask of enabled intrs */
-    bridge_t               *bs_base;		/* PIO pointer to Bridge chip */
+    void               *bs_base;		/* PIO pointer to Bridge chip */
     char                   *bs_name;		/* hw graph name */
+    char		    bs_asic_name[16];	/* ASIC name */
     xwidgetnum_t            bs_xid;		/* Bridge's xtalk ID number */
     vertex_hdl_t          bs_master;		/* xtalk master vertex */
     xwidgetnum_t            bs_mxid;		/* master's xtalk ID number */
     pciio_slot_t            bs_first_slot;      /* first existing slot */
     pciio_slot_t            bs_last_slot;       /* last existing slot */
     pciio_slot_t            bs_last_reset;      /* last slot to reset */
+    uint32_t		    bs_unused_slot;	/* unavailable slots bitmask */
     pciio_slot_t	    bs_min_slot;	/* lowest possible slot */
     pciio_slot_t	    bs_max_slot;	/* highest possible slot */
     pcibr_soft_t	    bs_peers_soft;	/* PICs other bus's soft */
@@ -377,7 +461,7 @@
     /* 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 */
+    unsigned int            bs_dma_flags;	/* forced DMA flags */
 
     nasid_t		    bs_nasid;		/* nasid this bus is on */
     moduleid_t		    bs_moduleid;	/* io brick moduleid */
@@ -474,14 +558,6 @@
 	unsigned		bss_d64_flags;
 	iopaddr_t		bss_d32_base;
 	unsigned		bss_d32_flags;
-
-	/* Shadow information used for implementing
-	 * Bridge Hardware WAR #484930
-	 */
-	atomic_t		bss_ext_ates_active;
-        volatile unsigned      *bss_cmd_pointer;
-	unsigned		bss_cmd_shadow;
-
     } bs_slot[8];
 
     pcibr_intr_bits_f	       *bs_intr_bits;
@@ -634,8 +710,8 @@
 struct pcibr_hints_s {
     /* ph_host_slot is actually +1 so "0" means "no host" */
     pciio_slot_t            ph_host_slot[8];	/* REQ/GNT/INT in use by ... */
-    unsigned                ph_rrb_fixed;	/* do not change RRB allocations */
-    unsigned                ph_hands_off;	/* prevent further pcibr operations */
+    unsigned int            ph_rrb_fixed;	/* do not change RRB allocations */
+    unsigned int            ph_hands_off;	/* prevent further pcibr operations */
     rrb_alloc_funct_t       rrb_alloc_funct;	/* do dynamic rrb allocation */
     pcibr_intr_bits_f	   *ph_intr_bits;	/* map PCI INT[ABCD] to Bridge Int(n) */
 };
--- diff/include/asm-ia64/sn/pci/pciio.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/asm-ia64/sn/pci/pciio.h	2004-02-09 10:39:56.000000000 +0000
@@ -28,10 +28,8 @@
 
 #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;
@@ -99,10 +97,6 @@
  *	sleep waiting for resoruces, return an error
  *	instead. (PIOMAP_NOSLEEP and DMAMAP_NOSLEEP are
  *	the same numeric value and are acceptable).
- * PCIIO_INPLACE: when operating on alenlist structures,
- *	reuse the source alenlist rather than creating a
- *	new one. (PIOMAP_INPLACE and DMAMAP_INPLACE are
- *	the same numeric value and are acceptable).
  *
  * PCIIO_DMA_CMD: configure this stream as a
  *	generic "command" stream. Generally this
@@ -162,7 +156,6 @@
 
 #define	PCIIO_FIXED		DMAMAP_FIXED
 #define	PCIIO_NOSLEEP		DMAMAP_NOSLEEP
-#define	PCIIO_INPLACE		DMAMAP_INPLACE
 
 #define PCIIO_DMA_CMD		0x0010
 #define PCIIO_DMA_DATA		0x0020
@@ -321,7 +314,7 @@
 			 iopaddr_t pcipio_addr,		/* starting address */
 			 size_t byte_count,
 			 size_t byte_count_max,		/* maximum size of a mapping */
-			 unsigned flags);	/* defined in sys/pio.h */
+			 unsigned int flags);	/* defined in sys/pio.h */
 
 typedef void
 pciio_piomap_free_f     (pciio_piomap_t pciio_piomap);
@@ -340,7 +333,7 @@
 			 pciio_space_t space,	/* which address space */
 			 iopaddr_t pciio_addr,	/* starting address */
 			 size_t byte_count,	/* map this many bytes */
-			 unsigned flags);
+			 unsigned int flags);
 
 typedef caddr_t
 pciio_pio_addr_f        (vertex_hdl_t dev,	/* translate for this device */
@@ -349,7 +342,7 @@
 			 iopaddr_t pciio_addr,	/* starting address */
 			 size_t byte_count,	/* map this many bytes */
 			 pciio_piomap_t *mapp,	/* in case a piomap was needed */
-			 unsigned flags);
+			 unsigned int flags);
 
 typedef iopaddr_t
 pciio_piospace_alloc_f  (vertex_hdl_t dev,	/* PIO space for this device */
@@ -370,7 +363,7 @@
 pciio_dmamap_alloc_f    (vertex_hdl_t dev,	/* set up mappings for this device */
 			 device_desc_t dev_desc,	/* device descriptor */
 			 size_t byte_count_max,		/* max size of a mapping */
-			 unsigned flags);	/* defined in dma.h */
+			 unsigned int flags);	/* defined in dma.h */
 
 typedef void
 pciio_dmamap_free_f     (pciio_dmamap_t dmamap);
@@ -388,7 +381,7 @@
 			 device_desc_t dev_desc,	/* device descriptor */
 			 paddr_t paddr,	/* system physical address */
 			 size_t byte_count,	/* length */
-			 unsigned flags);	/* defined in dma.h */
+			 unsigned int flags);	/* defined in dma.h */
 
 typedef void
 pciio_dmamap_drain_f	(pciio_dmamap_t map);
@@ -398,9 +391,6 @@
 			 paddr_t addr,
 			 size_t bytes);
 
-typedef void
-pciio_dmalist_drain_f	(vertex_hdl_t vhdl,
-			 alenlist_t list);
 
 /* INTERRUPT MANAGEMENT */
 
@@ -433,27 +423,20 @@
 typedef int	
 pciio_reset_f		(vertex_hdl_t conn);	/* pci connection point */
 
-typedef int
-pciio_write_gather_flush_f (vertex_hdl_t dev);    /* Device flushing buffers */
-
 typedef pciio_endian_t			/* actual endianness */
 pciio_endian_set_f      (vertex_hdl_t dev,	/* specify endianness for this device */
 			 pciio_endian_t device_end,	/* endianness of device */
 			 pciio_endian_t desired_end);	/* desired endianness */
 
-typedef pciio_priority_t
-pciio_priority_set_f    (vertex_hdl_t pcicard,
-			 pciio_priority_t device_prio);
-
 typedef uint64_t
 pciio_config_get_f	(vertex_hdl_t conn,	/* pci connection point */
-			 unsigned reg,		/* register byte offset */
-			 unsigned size);	/* width in bytes (1..4) */
+			 unsigned int reg,		/* register byte offset */
+			 unsigned int size);	/* width in bytes (1..4) */
 
 typedef void
 pciio_config_set_f	(vertex_hdl_t conn,	/* pci connection point */
-			 unsigned reg,		/* register byte offset */
-			 unsigned size,		/* width in bytes (1..4) */
+			 unsigned int reg,		/* register byte offset */
+			 unsigned int size,		/* width in bytes (1..4) */
 			 uint64_t value);	/* value to store */
 
 typedef pciio_slot_t
@@ -476,13 +459,14 @@
 typedef int
 pciio_device_unregister_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.
  */
 typedef struct pciio_provider_s {
+    /* ASIC PROVIDER ID */
+    pciio_asic_type_t	   provider_asic;
+
     /* PIO MANAGEMENT */
     pciio_piomap_alloc_f   *piomap_alloc;
     pciio_piomap_free_f    *piomap_free;
@@ -500,7 +484,6 @@
     pciio_dmatrans_addr_f  *dmatrans_addr;
     pciio_dmamap_drain_f   *dmamap_drain;
     pciio_dmaaddr_drain_f  *dmaaddr_drain;
-    pciio_dmalist_drain_f  *dmalist_drain;
 
     /* INTERRUPT MANAGEMENT */
     pciio_intr_alloc_f     *intr_alloc;
@@ -513,9 +496,7 @@
     pciio_provider_startup_f *provider_startup;
     pciio_provider_shutdown_f *provider_shutdown;
     pciio_reset_f	   *reset;
-    pciio_write_gather_flush_f *write_gather_flush;
     pciio_endian_set_f     *endian_set;
-    pciio_priority_set_f   *priority_set;
     pciio_config_get_f	   *config_get;
     pciio_config_set_f	   *config_set;
 
@@ -526,9 +507,6 @@
     pciio_driver_reg_callback_f *driver_reg_callback;
     pciio_driver_unreg_callback_f *driver_unreg_callback;
     pciio_device_unregister_f 	*device_unregister;
-
-    /* GENERIC BUS INFO */
-    pciio_businfo_get_f *businfo_get;
 } pciio_provider_t;
 
 /* PCI devices use these standard PCI provider interfaces */
@@ -547,7 +525,6 @@
 extern pciio_dmatrans_addr_f pciio_dmatrans_addr;
 extern pciio_dmamap_drain_f pciio_dmamap_drain;
 extern pciio_dmaaddr_drain_f pciio_dmaaddr_drain;
-extern pciio_dmalist_drain_f pciio_dmalist_drain;
 extern pciio_intr_alloc_f pciio_intr_alloc;
 extern pciio_intr_free_f pciio_intr_free;
 extern pciio_intr_connect_f pciio_intr_connect;
@@ -556,12 +533,9 @@
 extern pciio_provider_startup_f pciio_provider_startup;
 extern pciio_provider_shutdown_f pciio_provider_shutdown;
 extern pciio_reset_f pciio_reset;
-extern pciio_write_gather_flush_f pciio_write_gather_flush;
 extern pciio_endian_set_f pciio_endian_set;
-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_extract_f pciio_error_extract;
 
 /* Widgetdev in the IOERROR structure is encoded as follows.
  *	+---------------------------+
@@ -592,7 +566,7 @@
 pciio_driver_register  (pciio_vendor_id_t vendor_id,	/* card's vendor number */
 			pciio_device_id_t device_id,	/* card's device number */
 			char *driver_prefix,	/* driver prefix */
-			unsigned flags);
+			unsigned int flags);
 
 extern void
 pciio_error_register   (vertex_hdl_t pconn,	/* which slot */
@@ -706,10 +680,8 @@
 /* Generic pci slot information access interface */
 extern pciio_info_t     pciio_info_chk(vertex_hdl_t vhdl);
 extern pciio_info_t     pciio_info_get(vertex_hdl_t vhdl);
-extern pciio_info_t     pciio_hostinfo_get(vertex_hdl_t vhdl);
 extern void             pciio_info_set(vertex_hdl_t vhdl, pciio_info_t widget_info);
 extern vertex_hdl_t     pciio_info_dev_get(pciio_info_t pciio_info);
-extern vertex_hdl_t     pciio_info_hostdev_get(pciio_info_t pciio_info);
 extern pciio_bus_t	pciio_info_bus_get(pciio_info_t pciio_info);
 extern pciio_slot_t     pciio_info_slot_get(pciio_info_t pciio_info);
 extern pciio_function_t	pciio_info_function_get(pciio_info_t pciio_info);
@@ -753,8 +725,7 @@
 	if (vchan == 1) {
 		/* Set Bit 57 */
 		*addr |= (1UL << 57);
-	}
-	else {
+	} else {
 		/* Clear Bit 57 */
 		*addr &= ~(1UL << 57);
 	}
--- diff/include/asm-ia64/sn/pci/pciio_private.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/asm-ia64/sn/pci/pciio_private.h	2004-02-09 10:39:56.000000000 +0000
@@ -20,7 +20,7 @@
  * All PCI providers set up PIO using this information.
  */
 struct pciio_piomap_s {
-    unsigned                pp_flags;	/* PCIIO_PIOMAP flags */
+    unsigned int            pp_flags;	/* PCIIO_PIOMAP flags */
     vertex_hdl_t            pp_dev;	/* associated pci card */
     pciio_slot_t            pp_slot;	/* which slot the card is in */
     pciio_space_t           pp_space;	/* which address space */
@@ -33,7 +33,7 @@
  * All PCI providers set up DMA using this information.
  */
 struct pciio_dmamap_s {
-    unsigned                pd_flags;	/* PCIIO_DMAMAP flags */
+    unsigned int            pd_flags;	/* PCIIO_DMAMAP flags */
     vertex_hdl_t            pd_dev;	/* associated pci card */
     pciio_slot_t            pd_slot;	/* which slot the card is in */
 };
@@ -43,7 +43,7 @@
  */
 
 struct pciio_intr_s {
-    unsigned                pi_flags;	/* PCIIO_INTR flags */
+    unsigned int            pi_flags;	/* PCIIO_INTR flags */
     vertex_hdl_t            pi_dev;	/* associated pci card */
     device_desc_t	    pi_dev_desc;	/* override device descriptor */
     pciio_intr_line_t       pi_lines;	/* which interrupt line(s) */
--- diff/include/asm-ia64/sn/pci/pic.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/asm-ia64/sn/pci/pic.h	2004-02-09 10:39:56.000000000 +0000
@@ -66,7 +66,7 @@
 #include <asm/sn/pci/pciio.h>
 
 
-/*********************************************************************
+/*
  *    bus provider function table
  *
  *	Normally, this table is only handed off explicitly
@@ -81,705 +81,178 @@
 extern pciio_provider_t pci_pic_provider;
 
 
-/*********************************************************************
+/*
  * misc defines
  *
  */
+
 #define PIC_WIDGET_PART_NUM_BUS0 0xd102
 #define PIC_WIDGET_PART_NUM_BUS1 0xd112
 #define PIC_WIDGET_MFGR_NUM 0x24
 #define PIC_WIDGET_REV_A  0x1
+#define PIC_WIDGET_REV_B  0x2
+#define PIC_WIDGET_REV_C  0x3
+
+#define PIC_XTALK_ADDR_MASK                     0x0000FFFFFFFFFFFF
+#define PIC_INTERNAL_ATES                       1024
+
 
 #define IS_PIC_PART_REV_A(rev) \
 	((rev == (PIC_WIDGET_PART_NUM_BUS0 << 4 | PIC_WIDGET_REV_A)) || \
 	(rev == (PIC_WIDGET_PART_NUM_BUS1 << 4 | PIC_WIDGET_REV_A)))
+#define IS_PIC_PART_REV_B(rev) \
+        ((rev == (PIC_WIDGET_PART_NUM_BUS0 << 4 | PIC_WIDGET_REV_B)) || \
+        (rev == (PIC_WIDGET_PART_NUM_BUS1 << 4 | PIC_WIDGET_REV_B)))
+#define IS_PIC_PART_REV_C(rev) \
+        ((rev == (PIC_WIDGET_PART_NUM_BUS0 << 4 | PIC_WIDGET_REV_C)) || \
+        (rev == (PIC_WIDGET_PART_NUM_BUS1 << 4 | PIC_WIDGET_REV_C)))
+
 
-/*********************************************************************
- * register offset defines
+/*
+ * misc typedefs
  *
  */
-	/* Identification Register  -- read-only */
-#define PIC_IDENTIFICATION 0x00000000
-
-	/* Status Register  -- read-only */
-#define PIC_STATUS 0x00000008
-
-	/* Upper Address Holding Register Bus Side Errors  -- read-only */
-#define PIC_UPPER_ADDR_REG_BUS_SIDE_ERRS 0x00000010
-
-	/* Lower Address Holding Register Bus Side Errors  -- read-only */
-#define PIC_LOWER_ADDR_REG_BUS_SIDE_ERRS 0x00000018
-
-	/* Control Register  -- read/write */
-#define PIC_CONTROL 0x00000020
-
-	/* PCI Request Time-out Value Register  -- read/write */
-#define PIC_PCI_REQ_TIME_OUT_VALUE 0x00000028
-
-	/* Interrupt Destination Upper Address Register  -- read/write */
-#define PIC_INTR_DEST_UPPER_ADDR 0x00000030
-
-	/* Interrupt Destination Lower Address Register  -- read/write */
-#define PIC_INTR_DEST_LOWER_ADDR 0x00000038
-
-	/* Command Word Holding Register Bus Side  -- read-only */
-#define PIC_CMD_WORD_REG_BUS_SIDE 0x00000040
-
-	/* LLP Configuration Register (Bus 0 Only)  -- read/write */
-#define PIC_LLP_CFG_REG_(BUS_0_ONLY) 0x00000048
-
-	/* PCI Target Flush Register  -- read-only */
-#define PIC_PCI_TARGET_FLUSH 0x00000050
-
-	/* Command Word Holding Register Link Side  -- read-only */
-#define PIC_CMD_WORD_REG_LINK_SIDE 0x00000058
-
-	/* Response Buffer Error Upper Address Holding  -- read-only */
-#define PIC_RESP_BUF_ERR_UPPER_ADDR_ 0x00000060
-
-	/* Response Buffer Error Lower Address Holding  -- read-only */
-#define PIC_RESP_BUF_ERR_LOWER_ADDR_ 0x00000068
-
-	/* Test Pin Control Register  -- read/write */
-#define PIC_TEST_PIN_CONTROL 0x00000070
-
-	/* Address Holding Register Link Side Errors  -- read-only */
-#define PIC_ADDR_REG_LINK_SIDE_ERRS 0x00000078
-
-	/* Direct Map Register  -- read/write */
-#define PIC_DIRECT_MAP 0x00000080
-
-	/* PCI Map Fault Address Register  -- read-only */
-#define PIC_PCI_MAP_FAULT_ADDR 0x00000090
-
-	/* Arbitration Priority Register  -- read/write */
-#define PIC_ARBITRATION_PRIORITY 0x000000A0
-
-	/* Internal Ram Parity Error Register  -- read-only */
-#define PIC_INTERNAL_RAM_PARITY_ERR 0x000000B0
-
-	/* PCI Time-out Register  -- read/write */
-#define PIC_PCI_TIME_OUT 0x000000C0
-
-	/* PCI Type 1 Configuration Register  -- read/write */
-#define PIC_PCI_TYPE_1_CFG 0x000000C8
-
-	/* PCI Bus Error Upper Address Holding Register  -- read-only */
-#define PIC_PCI_BUS_ERR_UPPER_ADDR_ 0x000000D0
-
-	/* PCI Bus Error Lower Address Holding Register  -- read-only */
-#define PIC_PCI_BUS_ERR_LOWER_ADDR_ 0x000000D8
-
-	/* PCIX Error Address Register  -- read-only */
-#define PIC_PCIX_ERR_ADDR 0x000000E0
-
-	/* PCIX Error Attribute Register  -- read-only */
-#define PIC_PCIX_ERR_ATTRIBUTE 0x000000E8
-
-	/* PCIX Error Data Register  -- read-only */
-#define PIC_PCIX_ERR_DATA 0x000000F0
-
-	/* PCIX Read Request Timeout Error Register  -- read-only */
-#define PIC_PCIX_READ_REQ_TIMEOUT_ERR 0x000000F8
-
-	/* Interrupt Status Register  -- read-only */
-#define PIC_INTR_STATUS 0x00000100
-
-	/* Interrupt Enable Register  -- read/write */
-#define PIC_INTR_ENABLE 0x00000108
-
-	/* Reset Interrupt Status Register  -- write-only */
-#define PIC_RESET_INTR_STATUS 0x00000110
-
-	/* Interrupt Mode Register  -- read/write */
-#define PIC_INTR_MODE 0x00000118
-
-	/* Interrupt Device Register  -- read/write */
-#define PIC_INTR_DEVICE 0x00000120
-
-	/* Host Error Field Register  -- read/write */
-#define PIC_HOST_ERR_FIELD 0x00000128
-
-	/* Interrupt Pin 0 Host Address Register  -- read/write */
-#define PIC_INTR_PIN_0_HOST_ADDR 0x00000130
-
-	/* Interrupt Pin 1 Host Address Register  -- read/write */
-#define PIC_INTR_PIN_1_HOST_ADDR 0x00000138
-
-	/* Interrupt Pin 2 Host Address Register  -- read/write */
-#define PIC_INTR_PIN_2_HOST_ADDR 0x00000140
-
-	/* Interrupt Pin 3 Host Address Register  -- read/write */
-#define PIC_INTR_PIN_3_HOST_ADDR 0x00000148
-
-	/* Interrupt Pin 4 Host Address Register  -- read/write */
-#define PIC_INTR_PIN_4_HOST_ADDR 0x00000150
-
-	/* Interrupt Pin 5 Host Address Register  -- read/write */
-#define PIC_INTR_PIN_5_HOST_ADDR 0x00000158
-
-	/* Interrupt Pin 6 Host Address Register  -- read/write */
-#define PIC_INTR_PIN_6_HOST_ADDR 0x00000160
-
-	/* Interrupt Pin 7 Host Address Register  -- read/write */
-#define PIC_INTR_PIN_7_HOST_ADDR 0x00000168
-
-	/* Error Interrupt View Register  -- read-only */
-#define PIC_ERR_INTR_VIEW 0x00000170
-
-	/* Multiple Interrupt Register  -- read-only */
-#define PIC_MULTIPLE_INTR 0x00000178
-
-	/* Force Always Interrupt 0 Register  -- write-only */
-#define PIC_FORCE_ALWAYS_INTR_0 0x00000180
-
-	/* Force Always Interrupt 1 Register  -- write-only */
-#define PIC_FORCE_ALWAYS_INTR_1 0x00000188
-
-	/* Force Always Interrupt 2 Register  -- write-only */
-#define PIC_FORCE_ALWAYS_INTR_2 0x00000190
-
-	/* Force Always Interrupt 3 Register  -- write-only */
-#define PIC_FORCE_ALWAYS_INTR_3 0x00000198
-
-	/* Force Always Interrupt 4 Register  -- write-only */
-#define PIC_FORCE_ALWAYS_INTR_4 0x000001A0
-
-	/* Force Always Interrupt 5 Register  -- write-only */
-#define PIC_FORCE_ALWAYS_INTR_5 0x000001A8
-
-	/* Force Always Interrupt 6 Register  -- write-only */
-#define PIC_FORCE_ALWAYS_INTR_6 0x000001B0
-
-	/* Force Always Interrupt 7 Register  -- write-only */
-#define PIC_FORCE_ALWAYS_INTR_7 0x000001B8
-
-	/* Force w/Pin Interrupt 0 Register  -- write-only */
-#define PIC_FORCE_PIN_INTR_0 0x000001C0
-
-	/* Force w/Pin Interrupt 1 Register  -- write-only */
-#define PIC_FORCE_PIN_INTR_1 0x000001C8
-
-	/* Force w/Pin Interrupt 2 Register  -- write-only */
-#define PIC_FORCE_PIN_INTR_2 0x000001D0
-
-	/* Force w/Pin Interrupt 3 Register  -- write-only */
-#define PIC_FORCE_PIN_INTR_3 0x000001D8
-
-	/* Force w/Pin Interrupt 4 Register  -- write-only */
-#define PIC_FORCE_PIN_INTR_4 0x000001E0
-
-	/* Force w/Pin Interrupt 5 Register  -- write-only */
-#define PIC_FORCE_PIN_INTR_5 0x000001E8
-
-	/* Force w/Pin Interrupt 6 Register  -- write-only */
-#define PIC_FORCE_PIN_INTR_6 0x000001F0
-
-	/* Force w/Pin Interrupt 7 Register  -- write-only */
-#define PIC_FORCE_PIN_INTR_7 0x000001F8
-
-	/* Device 0 Register  -- read/write */
-#define PIC_DEVICE_0 0x00000200
-
-	/* Device 1 Register  -- read/write */
-#define PIC_DEVICE_1 0x00000208
-
-	/* Device 2 Register  -- read/write */
-#define PIC_DEVICE_2 0x00000210
-
-	/* Device 3 Register  -- read/write */
-#define PIC_DEVICE_3 0x00000218
-
-	/* Device 0 Write Request Buffer Register  -- read-only */
-#define PIC_DEVICE_0_WRITE_REQ_BUF 0x00000240
-
-	/* Device 1 Write Request Buffer Register  -- read-only */
-#define PIC_DEVICE_1_WRITE_REQ_BUF 0x00000248
-
-	/* Device 2 Write Request Buffer Register  -- read-only */
-#define PIC_DEVICE_2_WRITE_REQ_BUF 0x00000250
-
-	/* Device 3 Write Request Buffer Register  -- read-only */
-#define PIC_DEVICE_3_WRITE_REQ_BUF 0x00000258
-
-	/* Even Device Response Buffer Register  -- read/write */
-#define PIC_EVEN_DEVICE_RESP_BUF 0x00000280
-
-	/* Odd Device Response Buffer Register  -- read/write */
-#define PIC_ODD_DEVICE_RESP_BUF 0x00000288
-
-	/* Read Response Buffer Status Register  -- read-only */
-#define PIC_READ_RESP_BUF_STATUS 0x00000290
-
-	/* Read Response Buffer Clear Register  -- write-only */
-#define PIC_READ_RESP_BUF_CLEAR 0x00000298
-
-	/* PCI RR 0 Upper Address Match Register  -- read-only */
-#define PIC_PCI_RR_0_UPPER_ADDR_MATCH 0x00000300
-
-	/* PCI RR 0 Lower Address Match Register  -- read-only */
-#define PIC_PCI_RR_0_LOWER_ADDR_MATCH 0x00000308
-
-	/* PCI RR 1 Upper Address Match Register  -- read-only */
-#define PIC_PCI_RR_1_UPPER_ADDR_MATCH 0x00000310
-
-	/* PCI RR 1 Lower Address Match Register  -- read-only */
-#define PIC_PCI_RR_1_LOWER_ADDR_MATCH 0x00000318
-
-	/* PCI RR 2 Upper Address Match Register  -- read-only */
-#define PIC_PCI_RR_2_UPPER_ADDR_MATCH 0x00000320
-
-	/* PCI RR 2 Lower Address Match Register  -- read-only */
-#define PIC_PCI_RR_2_LOWER_ADDR_MATCH 0x00000328
-
-	/* PCI RR 3 Upper Address Match Register  -- read-only */
-#define PIC_PCI_RR_3_UPPER_ADDR_MATCH 0x00000330
-
-	/* PCI RR 3 Lower Address Match Register  -- read-only */
-#define PIC_PCI_RR_3_LOWER_ADDR_MATCH 0x00000338
-
-	/* PCI RR 4 Upper Address Match Register  -- read-only */
-#define PIC_PCI_RR_4_UPPER_ADDR_MATCH 0x00000340
-
-	/* PCI RR 4 Lower Address Match Register  -- read-only */
-#define PIC_PCI_RR_4_LOWER_ADDR_MATCH 0x00000348
-
-	/* PCI RR 5 Upper Address Match Register  -- read-only */
-#define PIC_PCI_RR_5_UPPER_ADDR_MATCH 0x00000350
-
-	/* PCI RR 5 Lower Address Match Register  -- read-only */
-#define PIC_PCI_RR_5_LOWER_ADDR_MATCH 0x00000358
-
-	/* PCI RR 6 Upper Address Match Register  -- read-only */
-#define PIC_PCI_RR_6_UPPER_ADDR_MATCH 0x00000360
-
-	/* PCI RR 6 Lower Address Match Register  -- read-only */
-#define PIC_PCI_RR_6_LOWER_ADDR_MATCH 0x00000368
-
-	/* PCI RR 7 Upper Address Match Register  -- read-only */
-#define PIC_PCI_RR_7_UPPER_ADDR_MATCH 0x00000370
-
-	/* PCI RR 7 Lower Address Match Register  -- read-only */
-#define PIC_PCI_RR_7_LOWER_ADDR_MATCH 0x00000378
-
-	/* PCI RR 8 Upper Address Match Register  -- read-only */
-#define PIC_PCI_RR_8_UPPER_ADDR_MATCH 0x00000380
-
-	/* PCI RR 8 Lower Address Match Register  -- read-only */
-#define PIC_PCI_RR_8_LOWER_ADDR_MATCH 0x00000388
-
-	/* PCI RR 9 Upper Address Match Register  -- read-only */
-#define PIC_PCI_RR_9_UPPER_ADDR_MATCH 0x00000390
-
-	/* PCI RR 9 Lower Address Match Register  -- read-only */
-#define PIC_PCI_RR_9_LOWER_ADDR_MATCH 0x00000398
-
-	/* PCI RR 10 Upper Address Match Register  -- read-only */
-#define PIC_PCI_RR_10_UPPER_ADDR_MATCH 0x000003A0
-
-	/* PCI RR 10 Lower Address Match Register  -- read-only */
-#define PIC_PCI_RR_10_LOWER_ADDR_MATCH 0x000003A8
-
-	/* PCI RR 11 Upper Address Match Register  -- read-only */
-#define PIC_PCI_RR_11_UPPER_ADDR_MATCH 0x000003B0
-
-	/* PCI RR 11 Lower Address Match Register  -- read-only */
-#define PIC_PCI_RR_11_LOWER_ADDR_MATCH 0x000003B8
-
-	/* PCI RR 12 Upper Address Match Register  -- read-only */
-#define PIC_PCI_RR_12_UPPER_ADDR_MATCH 0x000003C0
-
-	/* PCI RR 12 Lower Address Match Register  -- read-only */
-#define PIC_PCI_RR_12_LOWER_ADDR_MATCH 0x000003C8
-
-	/* PCI RR 13 Upper Address Match Register  -- read-only */
-#define PIC_PCI_RR_13_UPPER_ADDR_MATCH 0x000003D0
-
-	/* PCI RR 13 Lower Address Match Register  -- read-only */
-#define PIC_PCI_RR_13_LOWER_ADDR_MATCH 0x000003D8
-
-	/* PCI RR 14 Upper Address Match Register  -- read-only */
-#define PIC_PCI_RR_14_UPPER_ADDR_MATCH 0x000003E0
-
-	/* PCI RR 14 Lower Address Match Register  -- read-only */
-#define PIC_PCI_RR_14_LOWER_ADDR_MATCH 0x000003E8
-
-	/* PCI RR 15 Upper Address Match Register  -- read-only */
-#define PIC_PCI_RR_15_UPPER_ADDR_MATCH 0x000003F0
-
-	/* PCI RR 15 Lower Address Match Register  -- read-only */
-#define PIC_PCI_RR_15_LOWER_ADDR_MATCH 0x000003F8
-
-	/* Buffer 0 Flush Count with Data Touch Register  -- read/write */
-#define PIC_BUF_0_FLUSH_CNT_WITH_DATA_TOUCH 0x00000400
-
-	/* Buffer 0 Flush Count w/o Data Touch Register  -- read/write */
-#define PIC_BUF_0_FLUSH_CNT_W_O_DATA_TOUCH 0x00000408
-
-	/* Buffer 0 Request in Flight Count Register  -- read/write */
-#define PIC_BUF_0_REQ_IN_FLIGHT_CNT 0x00000410
-
-	/* Buffer 0 Prefetch Request Count Register  -- read/write */
-#define PIC_BUF_0_PREFETCH_REQ_CNT 0x00000418
-
-	/* Buffer 0 Total PCI Retry Count Register  -- read/write */
-#define PIC_BUF_0_TOTAL_PCI_RETRY_CNT 0x00000420
-
-	/* Buffer 0 Max PCI Retry Count Register  -- read/write */
-#define PIC_BUF_0_MAX_PCI_RETRY_CNT 0x00000428
-
-	/* Buffer 0 Max Latency Count Register  -- read/write */
-#define PIC_BUF_0_MAX_LATENCY_CNT 0x00000430
-
-	/* Buffer 0 Clear All Register  -- read/write */
-#define PIC_BUF_0_CLEAR_ALL 0x00000438
-
-	/* Buffer 2 Flush Count with Data Touch Register  -- read/write */
-#define PIC_BUF_2_FLUSH_CNT_WITH_DATA_TOUCH 0x00000440
-
-	/* Buffer 2 Flush Count w/o Data Touch Register  -- read/write */
-#define PIC_BUF_2_FLUSH_CNT_W_O_DATA_TOUCH 0x00000448
-
-	/* Buffer 2 Request in Flight Count Register  -- read/write */
-#define PIC_BUF_2_REQ_IN_FLIGHT_CNT 0x00000450
-
-	/* Buffer 2 Prefetch Request Count Register  -- read/write */
-#define PIC_BUF_2_PREFETCH_REQ_CNT 0x00000458
-
-	/* Buffer 2 Total PCI Retry Count Register  -- read/write */
-#define PIC_BUF_2_TOTAL_PCI_RETRY_CNT 0x00000460
-
-	/* Buffer 2 Max PCI Retry Count Register  -- read/write */
-#define PIC_BUF_2_MAX_PCI_RETRY_CNT 0x00000468
-
-	/* Buffer 2 Max Latency Count Register  -- read/write */
-#define PIC_BUF_2_MAX_LATENCY_CNT 0x00000470
-
-	/* Buffer 2 Clear All Register  -- read/write */
-#define PIC_BUF_2_CLEAR_ALL 0x00000478
-
-	/* Buffer 4 Flush Count with Data Touch Register  -- read/write */
-#define PIC_BUF_4_FLUSH_CNT_WITH_DATA_TOUCH 0x00000480
-
-	/* Buffer 4 Flush Count w/o Data Touch Register  -- read/write */
-#define PIC_BUF_4_FLUSH_CNT_W_O_DATA_TOUCH 0x00000488
-
-	/* Buffer 4 Request in Flight Count Register  -- read/write */
-#define PIC_BUF_4_REQ_IN_FLIGHT_CNT 0x00000490
-
-	/* Buffer 4 Prefetch Request Count Register  -- read/write */
-#define PIC_BUF_4_PREFETCH_REQ_CNT 0x00000498
-
-	/* Buffer 4 Total PCI Retry Count Register  -- read/write */
-#define PIC_BUF_4_TOTAL_PCI_RETRY_CNT 0x000004A0
-
-	/* Buffer 4 Max PCI Retry Count Register  -- read/write */
-#define PIC_BUF_4_MAX_PCI_RETRY_CNT 0x000004A8
-
-	/* Buffer 4 Max Latency Count Register  -- read/write */
-#define PIC_BUF_4_MAX_LATENCY_CNT 0x000004B0
-
-	/* Buffer 4 Clear All Register  -- read/write */
-#define PIC_BUF_4_CLEAR_ALL 0x000004B8
-
-	/* Buffer 6 Flush Count with Data Touch Register  -- read/write */
-#define PIC_BUF_6_FLUSH_CNT_WITH_DATA_TOUCH 0x000004C0
-
-	/* Buffer 6 Flush Count w/o Data Touch Register  -- read/write */
-#define PIC_BUF_6_FLUSH_CNT_W_O_DATA_TOUCH 0x000004C8
-
-	/* Buffer 6 Request in Flight Count Register  -- read/write */
-#define PIC_BUF_6_REQ_IN_FLIGHT_CNT 0x000004D0
-
-	/* Buffer 6 Prefetch Request Count Register  -- read/write */
-#define PIC_BUF_6_PREFETCH_REQ_CNT 0x000004D8
-
-	/* Buffer 6 Total PCI Retry Count Register  -- read/write */
-#define PIC_BUF_6_TOTAL_PCI_RETRY_CNT 0x000004E0
-
-	/* Buffer 6 Max PCI Retry Count Register  -- read/write */
-#define PIC_BUF_6_MAX_PCI_RETRY_CNT 0x000004E8
-
-	/* Buffer 6 Max Latency Count Register  -- read/write */
-#define PIC_BUF_6_MAX_LATENCY_CNT 0x000004F0
-
-	/* Buffer 6 Clear All Register  -- read/write */
-#define PIC_BUF_6_CLEAR_ALL 0x000004F8
-
-	/* Buffer 8 Flush Count with Data Touch Register  -- read/write */
-#define PIC_BUF_8_FLUSH_CNT_WITH_DATA_TOUCH 0x00000500
-
-	/* Buffer 8 Flush Count w/o Data Touch Register  -- read/write */
-#define PIC_BUF_8_FLUSH_CNT_W_O_DATA_TOUCH 0x00000508
-
-	/* Buffer 8 Request in Flight Count Register  -- read/write */
-#define PIC_BUF_8_REQ_IN_FLIGHT_CNT 0x00000510
-
-	/* Buffer 8 Prefetch Request Count Register  -- read/write */
-#define PIC_BUF_8_PREFETCH_REQ_CNT 0x00000518
-
-	/* Buffer 8 Total PCI Retry Count Register  -- read/write */
-#define PIC_BUF_8_TOTAL_PCI_RETRY_CNT 0x00000520
-
-	/* Buffer 8 Max PCI Retry Count Register  -- read/write */
-#define PIC_BUF_8_MAX_PCI_RETRY_CNT 0x00000528
-
-	/* Buffer 8 Max Latency Count Register  -- read/write */
-#define PIC_BUF_8_MAX_LATENCY_CNT 0x00000530
-
-	/* Buffer 8 Clear All Register  -- read/write */
-#define PIC_BUF_8_CLEAR_ALL 0x00000538
-
-	/* Buffer 10 Flush Count with Data Touch Register  -- read/write */
-#define PIC_BUF_10_FLUSH_CNT_WITH_DATA_TOUCH 0x00000540
-
-	/* Buffer 10 Flush Count w/o Data Touch Register  -- read/write */
-#define PIC_BUF_10_FLUSH_CNT_W_O_DATA_TOUCH 0x00000548
-
-	/* Buffer 10 Request in Flight Count Register  -- read/write */
-#define PIC_BUF_10_REQ_IN_FLIGHT_CNT 0x00000550
-
-	/* Buffer 10 Prefetch Request Count Register  -- read/write */
-#define PIC_BUF_10_PREFETCH_REQ_CNT 0x00000558
-
-	/* Buffer 10 Total PCI Retry Count Register  -- read/write */
-#define PIC_BUF_10_TOTAL_PCI_RETRY_CNT 0x00000560
-
-	/* Buffer 10 Max PCI Retry Count Register  -- read/write */
-#define PIC_BUF_10_MAX_PCI_RETRY_CNT 0x00000568
-
-	/* Buffer 10 Max Latency Count Register  -- read/write */
-#define PIC_BUF_10_MAX_LATENCY_CNT 0x00000570
-
-	/* Buffer 10 Clear All Register  -- read/write */
-#define PIC_BUF_10_CLEAR_ALL 0x00000578
-
-	/* Buffer 12 Flush Count with Data Touch Register  -- read/write */
-#define PIC_BUF_12_FLUSH_CNT_WITH_DATA_TOUCH 0x00000580
-
-	/* Buffer 12 Flush Count w/o Data Touch Register  -- read/write */
-#define PIC_BUF_12_FLUSH_CNT_W_O_DATA_TOUCH 0x00000588
-
-	/* Buffer 12 Request in Flight Count Register  -- read/write */
-#define PIC_BUF_12_REQ_IN_FLIGHT_CNT 0x00000590
-
-	/* Buffer 12 Prefetch Request Count Register  -- read/write */
-#define PIC_BUF_12_PREFETCH_REQ_CNT 0x00000598
-
-	/* Buffer 12 Total PCI Retry Count Register  -- read/write */
-#define PIC_BUF_12_TOTAL_PCI_RETRY_CNT 0x000005A0
-
-	/* Buffer 12 Max PCI Retry Count Register  -- read/write */
-#define PIC_BUF_12_MAX_PCI_RETRY_CNT 0x000005A8
-
-	/* Buffer 12 Max Latency Count Register  -- read/write */
-#define PIC_BUF_12_MAX_LATENCY_CNT 0x000005B0
-
-	/* Buffer 12 Clear All Register  -- read/write */
-#define PIC_BUF_12_CLEAR_ALL 0x000005B8
-
-	/* Buffer 14 Flush Count with Data Touch Register  -- read/write */
-#define PIC_BUF_14_FLUSH_CNT_WITH_DATA_TOUCH 0x000005C0
-
-	/* Buffer 14 Flush Count w/o Data Touch Register  -- read/write */
-#define PIC_BUF_14_FLUSH_CNT_W_O_DATA_TOUCH 0x000005C8
-
-	/* Buffer 14 Request in Flight Count Register  -- read/write */
-#define PIC_BUF_14_REQ_IN_FLIGHT_CNT 0x000005D0
-
-	/* Buffer 14 Prefetch Request Count Register  -- read/write */
-#define PIC_BUF_14_PREFETCH_REQ_CNT 0x000005D8
-
-	/* Buffer 14 Total PCI Retry Count Register  -- read/write */
-#define PIC_BUF_14_TOTAL_PCI_RETRY_CNT 0x000005E0
-
-	/* Buffer 14 Max PCI Retry Count Register  -- read/write */
-#define PIC_BUF_14_MAX_PCI_RETRY_CNT 0x000005E8
-
-	/* Buffer 14 Max Latency Count Register  -- read/write */
-#define PIC_BUF_14_MAX_LATENCY_CNT 0x000005F0
-
-	/* Buffer 14 Clear All Register  -- read/write */
-#define PIC_BUF_14_CLEAR_ALL 0x000005F8
-
-	/* PCIX Read Buffer 0 Address Register  -- read-only */
-#define PIC_PCIX_READ_BUF_0_ADDR 0x00000A00
-
-	/* PCIX Read Buffer 0 Attribute Register  -- read-only */
-#define PIC_PCIX_READ_BUF_0_ATTRIBUTE 0x00000A08
-
-	/* PCIX Read Buffer 1 Address Register  -- read-only */
-#define PIC_PCIX_READ_BUF_1_ADDR 0x00000A10
-
-	/* PCIX Read Buffer 1 Attribute Register  -- read-only */
-#define PIC_PCIX_READ_BUF_1_ATTRIBUTE 0x00000A18
-
-	/* PCIX Read Buffer 2 Address Register  -- read-only */
-#define PIC_PCIX_READ_BUF_2_ADDR 0x00000A20
-
-	/* PCIX Read Buffer 2 Attribute Register  -- read-only */
-#define PIC_PCIX_READ_BUF_2_ATTRIBUTE 0x00000A28
-
-	/* PCIX Read Buffer 3 Address Register  -- read-only */
-#define PIC_PCIX_READ_BUF_3_ADDR 0x00000A30
-
-	/* PCIX Read Buffer 3 Attribute Register  -- read-only */
-#define PIC_PCIX_READ_BUF_3_ATTRIBUTE 0x00000A38
-
-	/* PCIX Read Buffer 4 Address Register  -- read-only */
-#define PIC_PCIX_READ_BUF_4_ADDR 0x00000A40
-
-	/* PCIX Read Buffer 4 Attribute Register  -- read-only */
-#define PIC_PCIX_READ_BUF_4_ATTRIBUTE 0x00000A48
-
-	/* PCIX Read Buffer 5 Address Register  -- read-only */
-#define PIC_PCIX_READ_BUF_5_ADDR 0x00000A50
-
-	/* PCIX Read Buffer 5 Attribute Register  -- read-only */
-#define PIC_PCIX_READ_BUF_5_ATTRIBUTE 0x00000A58
-
-	/* PCIX Read Buffer 6 Address Register  -- read-only */
-#define PIC_PCIX_READ_BUF_6_ADDR 0x00000A60
-
-	/* PCIX Read Buffer 6 Attribute Register  -- read-only */
-#define PIC_PCIX_READ_BUF_6_ATTRIBUTE 0x00000A68
-
-	/* PCIX Read Buffer 7 Address Register  -- read-only */
-#define PIC_PCIX_READ_BUF_7_ADDR 0x00000A70
-
-	/* PCIX Read Buffer 7 Attribute Register  -- read-only */
-#define PIC_PCIX_READ_BUF_7_ATTRIBUTE 0x00000A78
-
-	/* PCIX Read Buffer 8 Address Register  -- read-only */
-#define PIC_PCIX_READ_BUF_8_ADDR 0x00000A80
-
-	/* PCIX Read Buffer 8 Attribute Register  -- read-only */
-#define PIC_PCIX_READ_BUF_8_ATTRIBUTE 0x00000A88
-
-	/* PCIX Read Buffer 9 Address Register  -- read-only */
-#define PIC_PCIX_READ_BUF_9_ADDR 0x00000A90
-
-	/* PCIX Read Buffer 9 Attribute Register  -- read-only */
-#define PIC_PCIX_READ_BUF_9_ATTRIBUTE 0x00000A98
-
-	/* PCIX Read Buffer 10 Address Register  -- read-only */
-#define PIC_PCIX_READ_BUF_10_ADDR 0x00000AA0
-
-	/* PCIX Read Buffer 10 Attribute Register  -- read-only */
-#define PIC_PCIX_READ_BUF_10_ATTRIBUTE 0x00000AA8
-
-	/* PCIX Read Buffer 11 Address Register  -- read-only */
-#define PIC_PCIX_READ_BUF_11_ADDR 0x00000AB0
-
-	/* PCIX Read Buffer 11 Attribute Register  -- read-only */
-#define PIC_PCIX_READ_BUF_11_ATTRIBUTE 0x00000AB8
-
-	/* PCIX Read Buffer 12 Address Register  -- read-only */
-#define PIC_PCIX_READ_BUF_12_ADDR 0x00000AC0
-
-	/* PCIX Read Buffer 12 Attribute Register  -- read-only */
-#define PIC_PCIX_READ_BUF_12_ATTRIBUTE 0x00000AC8
-
-	/* PCIX Read Buffer 13 Address Register  -- read-only */
-#define PIC_PCIX_READ_BUF_13_ADDR 0x00000AD0
-
-	/* PCIX Read Buffer 13 Attribute Register  -- read-only */
-#define PIC_PCIX_READ_BUF_13_ATTRIBUTE 0x00000AD8
-
-	/* PCIX Read Buffer 14 Address Register  -- read-only */
-#define PIC_PCIX_READ_BUF_14_ADDR 0x00000AE0
-
-	/* PCIX Read Buffer 14 Attribute Register  -- read-only */
-#define PIC_PCIX_READ_BUF_14_ATTRIBUTE 0x00000AE8
-
-	/* PCIX Read Buffer 15 Address Register  -- read-only */
-#define PIC_PCIX_READ_BUF_15_ADDR 0x00000AF0
-
-	/* PCIX Read Buffer 15 Attribute Register  -- read-only */
-#define PIC_PCIX_READ_BUF_15_ATTRIBUTE 0x00000AF8
-
-	/* PCIX Write Buffer 0 Address Register  -- read-only */
-#define PIC_PCIX_WRITE_BUF_0_ADDR 0x00000B00
-
-	/* PCIX Write Buffer 0 Attribute Register  -- read-only */
-#define PIC_PCIX_WRITE_BUF_0_ATTRIBUTE 0x00000B08
-
-	/* PCIX Write Buffer 0 Valid Register  -- read-only */
-#define PIC_PCIX_WRITE_BUF_0_VALID 0x00000B10
-
-	/* PCIX Write Buffer 1 Address Register  -- read-only */
-#define PIC_PCIX_WRITE_BUF_1_ADDR 0x00000B20
-
-	/* PCIX Write Buffer 1 Attribute Register  -- read-only */
-#define PIC_PCIX_WRITE_BUF_1_ATTRIBUTE 0x00000B28
-
-	/* PCIX Write Buffer 1 Valid Register  -- read-only */
-#define PIC_PCIX_WRITE_BUF_1_VALID 0x00000B30
-
-	/* PCIX Write Buffer 2 Address Register  -- read-only */
-#define PIC_PCIX_WRITE_BUF_2_ADDR 0x00000B40
-
-	/* PCIX Write Buffer 2 Attribute Register  -- read-only */
-#define PIC_PCIX_WRITE_BUF_2_ATTRIBUTE 0x00000B48
+typedef uint64_t picreg_t;
+typedef uint64_t picate_t;
 
-	/* PCIX Write Buffer 2 Valid Register  -- read-only */
-#define PIC_PCIX_WRITE_BUF_2_VALID 0x00000B50
+/*
+ * PIC Bridge MMR defines
+ */
 
-	/* PCIX Write Buffer 3 Address Register  -- read-only */
-#define PIC_PCIX_WRITE_BUF_3_ADDR 0x00000B60
+/*
+ * PIC STATUS register          offset 0x00000008
+ */
 
-	/* PCIX Write Buffer 3 Attribute Register  -- read-only */
-#define PIC_PCIX_WRITE_BUF_3_ATTRIBUTE 0x00000B68
+#define PIC_STAT_PCIX_ACTIVE_SHFT       33
 
-	/* PCIX Write Buffer 3 Valid Register  -- read-only */
-#define PIC_PCIX_WRITE_BUF_3_VALID 0x00000B70
+/*
+ * PIC CONTROL register         offset 0x00000020
+ */
 
-	/* PCIX Write Buffer 4 Address Register  -- read-only */
-#define PIC_PCIX_WRITE_BUF_4_ADDR 0x00000B80
+#define PIC_CTRL_PCI_SPEED_SHFT         4
+#define PIC_CTRL_PCI_SPEED              (0x3 << PIC_CTRL_PCI_SPEED_SHFT)
+#define PIC_CTRL_PAGE_SIZE_SHFT         21
+#define PIC_CTRL_PAGE_SIZE              (0x1 << PIC_CTRL_PAGE_SIZE_SHFT)
 
-	/* PCIX Write Buffer 4 Attribute Register  -- read-only */
-#define PIC_PCIX_WRITE_BUF_4_ATTRIBUTE 0x00000B88
 
-	/* PCIX Write Buffer 4 Valid Register  -- read-only */
-#define PIC_PCIX_WRITE_BUF_4_VALID 0x00000B90
+/*
+ * PIC Intr Destination Addr    offset 0x00000038
+ */
 
-	/* PCIX Write Buffer 5 Address Register  -- read-only */
-#define PIC_PCIX_WRITE_BUF_5_ADDR 0x00000BA0
+#define PIC_INTR_DEST_ADDR              0x0000FFFFFFFFFFFF
+#define PIC_INTR_DEST_TID_SHFT          48
+#define PIC_INTR_DEST_TID               (0xFull << PIC_INTR_DEST_TID_SHFT)
 
-	/* PCIX Write Buffer 5 Attribute Register  -- read-only */
-#define PIC_PCIX_WRITE_BUF_5_ATTRIBUTE 0x00000BA8
+/*
+ * PIC PCI Responce Buffer      offset 0x00000068
+ */
+#define PIC_RSP_BUF_ADDR                0x0000FFFFFFFFFFFF
+#define PIC_RSP_BUF_NUM_SHFT            48
+#define PIC_RSP_BUF_NUM                 (0xFull << PIC_RSP_BUF_NUM_SHFT)
+#define PIC_RSP_BUF_DEV_NUM_SHFT        52
+#define PIC_RSP_BUF_DEV_NUM             (0x3ull << PIC_RSP_BUF_DEV_NUM_SHFT)
 
-	/* PCIX Write Buffer 5 Valid Register  -- read-only */
-#define PIC_PCIX_WRITE_BUF_5_VALID 0x00000BB0
+/*
+ * PIC PCI DIRECT MAP register  offset 0x00000080
+ */
+#define PIC_DIRMAP_DIROFF_SHFT          0
+#define PIC_DIRMAP_DIROFF               (0x1FFFF << PIC_DIRMAP_DIROFF_SHFT)
+#define PIC_DIRMAP_ADD512_SHFT          17
+#define PIC_DIRMAP_ADD512               (0x1 << PIC_DIRMAP_ADD512_SHFT)
+#define PIC_DIRMAP_WID_SHFT             20
+#define PIC_DIRMAP_WID                  (0xF << PIC_DIRMAP_WID_SHFT)
 
-	/* PCIX Write Buffer 6 Address Register  -- read-only */
-#define PIC_PCIX_WRITE_BUF_6_ADDR 0x00000BC0
+#define PIC_DIRMAP_OFF_ADDRSHFT         31
 
-	/* PCIX Write Buffer 6 Attribute Register  -- read-only */
-#define PIC_PCIX_WRITE_BUF_6_ATTRIBUTE 0x00000BC8
+/*
+ * Interrupt Status register            offset 0x00000100
+ */
+#define PIC_ISR_PCIX_SPLIT_MSG_PE     (0x1ull << 45)
+#define PIC_ISR_PCIX_SPLIT_EMSG       (0x1ull << 44)
+#define PIC_ISR_PCIX_SPLIT_TO         (0x1ull << 43)
+#define PIC_ISR_PCIX_UNEX_COMP        (0x1ull << 42)
+#define PIC_ISR_INT_RAM_PERR          (0x1ull << 41)
+#define PIC_ISR_PCIX_ARB_ERR          (0x1ull << 40)
+#define PIC_ISR_PCIX_REQ_TOUT         (0x1ull << 39)
+#define PIC_ISR_PCIX_TABORT           (0x1ull << 38)
+#define PIC_ISR_PCIX_PERR             (0x1ull << 37)
+#define PIC_ISR_PCIX_SERR             (0x1ull << 36)
+#define PIC_ISR_PCIX_MRETRY           (0x1ull << 35)
+#define PIC_ISR_PCIX_MTOUT            (0x1ull << 34)
+#define PIC_ISR_PCIX_DA_PARITY        (0x1ull << 33)
+#define PIC_ISR_PCIX_AD_PARITY        (0x1ull << 32)
+#define PIC_ISR_PMU_PAGE_FAULT        (0x1ull << 30)
+#define PIC_ISR_UNEXP_RESP            (0x1ull << 29)
+#define PIC_ISR_BAD_XRESP_PKT         (0x1ull << 28)
+#define PIC_ISR_BAD_XREQ_PKT          (0x1ull << 27)
+#define PIC_ISR_RESP_XTLK_ERR         (0x1ull << 26)
+#define PIC_ISR_REQ_XTLK_ERR          (0x1ull << 25)
+#define PIC_ISR_INVLD_ADDR            (0x1ull << 24)
+#define PIC_ISR_UNSUPPORTED_XOP       (0x1ull << 23)
+#define PIC_ISR_XREQ_FIFO_OFLOW       (0x1ull << 22)
+#define PIC_ISR_LLP_REC_SNERR         (0x1ull << 21)
+#define PIC_ISR_LLP_REC_CBERR         (0x1ull << 20)
+#define PIC_ISR_LLP_RCTY              (0x1ull << 19)
+#define PIC_ISR_LLP_TX_RETRY          (0x1ull << 18)
+#define PIC_ISR_LLP_TCTY              (0x1ull << 17)
+#define PIC_ISR_PCI_ABORT             (0x1ull << 15)
+#define PIC_ISR_PCI_PARITY            (0x1ull << 14)
+#define PIC_ISR_PCI_SERR              (0x1ull << 13)
+#define PIC_ISR_PCI_PERR              (0x1ull << 12)
+#define PIC_ISR_PCI_MST_TIMEOUT       (0x1ull << 11)
+#define PIC_ISR_PCI_RETRY_CNT         (0x1ull << 10)
+#define PIC_ISR_XREAD_REQ_TIMEOUT     (0x1ull << 9)
+#define PIC_ISR_INT_MSK               (0xffull << 0)
+#define PIC_ISR_INT(x)                (0x1ull << (x))
+
+#define PIC_ISR_LINK_ERROR            \
+                (PIC_ISR_LLP_REC_SNERR|PIC_ISR_LLP_REC_CBERR|       \
+                 PIC_ISR_LLP_RCTY|PIC_ISR_LLP_TX_RETRY|             \
+                 PIC_ISR_LLP_TCTY)
+
+#define PIC_ISR_PCIBUS_PIOERR         \
+                (PIC_ISR_PCI_MST_TIMEOUT|PIC_ISR_PCI_ABORT|         \
+                 PIC_ISR_PCIX_MTOUT|PIC_ISR_PCIX_TABORT)
+
+#define PIC_ISR_PCIBUS_ERROR          \
+                (PIC_ISR_PCIBUS_PIOERR|PIC_ISR_PCI_PERR|            \
+                 PIC_ISR_PCI_SERR|PIC_ISR_PCI_RETRY_CNT|            \
+                 PIC_ISR_PCI_PARITY|PIC_ISR_PCIX_PERR|              \
+                 PIC_ISR_PCIX_SERR|PIC_ISR_PCIX_MRETRY|             \
+                 PIC_ISR_PCIX_AD_PARITY|PIC_ISR_PCIX_DA_PARITY|     \
+                 PIC_ISR_PCIX_REQ_TOUT|PIC_ISR_PCIX_UNEX_COMP|      \
+                 PIC_ISR_PCIX_SPLIT_TO|PIC_ISR_PCIX_SPLIT_EMSG|     \
+                 PIC_ISR_PCIX_SPLIT_MSG_PE)
+
+#define PIC_ISR_XTALK_ERROR           \
+                (PIC_ISR_XREAD_REQ_TIMEOUT|PIC_ISR_XREQ_FIFO_OFLOW| \
+                 PIC_ISR_UNSUPPORTED_XOP|PIC_ISR_INVLD_ADDR|        \
+                 PIC_ISR_REQ_XTLK_ERR|PIC_ISR_RESP_XTLK_ERR|        \
+                 PIC_ISR_BAD_XREQ_PKT|PIC_ISR_BAD_XRESP_PKT|        \
+                 PIC_ISR_UNEXP_RESP)
+
+#define PIC_ISR_ERRORS                \
+                (PIC_ISR_LINK_ERROR|PIC_ISR_PCIBUS_ERROR|           \
+                 PIC_ISR_XTALK_ERROR|                                 \
+                 PIC_ISR_PMU_PAGE_FAULT|PIC_ISR_INT_RAM_PERR)
 
-	/* PCIX Write Buffer 6 Valid Register  -- read-only */
-#define PIC_PCIX_WRITE_BUF_6_VALID 0x00000BD0
+/*
+ * PIC RESET INTR register      offset 0x00000110
+ */
 
-	/* PCIX Write Buffer 7 Address Register  -- read-only */
-#define PIC_PCIX_WRITE_BUF_7_ADDR 0x00000BE0
+#define PIC_IRR_ALL_CLR                 0xffffffffffffffff
 
-	/* PCIX Write Buffer 7 Attribute Register  -- read-only */
-#define PIC_PCIX_WRITE_BUF_7_ATTRIBUTE 0x00000BE8
+/*
+ * PIC PCI Host Intr Addr       offset 0x00000130 - 0x00000168
+ */
+#define PIC_HOST_INTR_ADDR              0x0000FFFFFFFFFFFF
+#define PIC_HOST_INTR_FLD_SHFT          48
+#define PIC_HOST_INTR_FLD               (0xFFull << PIC_HOST_INTR_FLD_SHFT)
 
-	/* PCIX Write Buffer 7 Valid Register  -- read-only */
-#define PIC_PCIX_WRITE_BUF_7_VALID 0x00000BF0
 
-/*********************************************************************
- * misc typedefs
- *
+/*
+ * PIC MMR structure mapping
  */
-typedef uint64_t picreg_t;
-typedef uint64_t picate_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 
--- diff/include/asm-ia64/sn/pda.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/asm-ia64/sn/pda.h	2004-02-09 10:39:56.000000000 +0000
@@ -8,12 +8,9 @@
 #ifndef _ASM_IA64_SN_PDA_H
 #define _ASM_IA64_SN_PDA_H
 
-#include <linux/config.h>
 #include <linux/cache.h>
 #include <asm/percpu.h>
 #include <asm/system.h>
-#include <asm/processor.h>
-#include <asm/page.h>
 #include <asm/sn/bte.h>
 
 
--- diff/include/asm-ia64/sn/pio.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/asm-ia64/sn/pio.h	2004-02-09 10:39:56.000000000 +0000
@@ -8,9 +8,7 @@
 #ifndef _ASM_IA64_SN_PIO_H
 #define _ASM_IA64_SN_PIO_H
 
-#include <linux/types.h>
-#include <asm/sn/sgi.h>
-#include <asm/sn/driver.h>
+#include <asm/sn/types.h>
 
 /*
  * pioaddr_t	- The kernel virtual address that a PIO can be done upon.
@@ -18,7 +16,7 @@
  *		  to long mostly, just cast for other sizes.
  */
 
-typedef volatile ulong*	pioaddr_t;
+typedef volatile unsigned long*	pioaddr_t;
 
 /*
  * iopaddr_t	- the physical io space relative address (e.g. VME A16S 0x0800).
--- diff/include/asm-ia64/sn/sgi.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/asm-ia64/sn/sgi.h	2004-02-09 10:39:56.000000000 +0000
@@ -14,8 +14,6 @@
 
 #include <asm/sn/types.h>
 #include <asm/uaccess.h>		/* for copy_??_user */
-#include <linux/mm.h>
-#include <linux/fs.h>
 #include <asm/sn/hwgfs.h>
 
 typedef hwgfs_handle_t vertex_hdl_t;
@@ -44,6 +42,21 @@
 #define CPU_NONE		(-1)
 #define GRAPH_VERTEX_NONE ((vertex_hdl_t)-1)
 
+/*
+ * Defines for individual WARs. Each is a bitmask of applicable
+ * 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 (~0UL)   /* PIC: fake widget 0xf presence bit. permanent */
+#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 */
+#define PV856866 (1 << 1) /* PIC: avoid rrb's 0/1/8/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 */
 
 /*
  * No code is complete without an Assertion macro
--- diff/include/asm-ia64/sn/sn2/arch.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/asm-ia64/sn/sn2/arch.h	2004-02-09 10:39:56.000000000 +0000
@@ -8,9 +8,6 @@
 #ifndef _ASM_IA64_SN_SN2_ARCH_H
 #define _ASM_IA64_SN_SN2_ARCH_H
 
-#include <asm/types.h>
-
-
 #define CPUS_PER_NODE           4       /* CPUs on a single hub */
 #define CPUS_PER_SUBNODE        4       /* CPUs on a single hub PI */
 
--- diff/include/asm-ia64/sn/sn2/intr.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/asm-ia64/sn/sn2/intr.h	2004-02-09 10:39:56.000000000 +0000
@@ -19,8 +19,8 @@
 #define SGI_ACPI_SCI_INT		(0x34)
 #define SGI_XPC_NOTIFY			(0xe7)
 
-#define IA64_SN2_FIRST_DEVICE_VECTOR	(0x34)
-#define IA64_SN2_LAST_DEVICE_VECTOR	(0xe7)
+#define IA64_SN2_FIRST_DEVICE_VECTOR	(0x37)
+#define IA64_SN2_LAST_DEVICE_VECTOR	(0xe6)
 
 #define SN2_IRQ_RESERVED        (0x1)
 #define SN2_IRQ_CONNECTED       (0x2)
--- diff/include/asm-ia64/sn/sn2/io.h	2003-08-26 10:00:54.000000000 +0100
+++ source/include/asm-ia64/sn/sn2/io.h	2004-02-09 10:39:56.000000000 +0000
@@ -27,6 +27,10 @@
 #define __sn_readw ___sn_readw
 #define __sn_readl ___sn_readl
 #define __sn_readq ___sn_readq
+#define __sn_readb_relaxed ___sn_readb_relaxed
+#define __sn_readw_relaxed ___sn_readw_relaxed
+#define __sn_readl_relaxed ___sn_readl_relaxed
+#define __sn_readq_relaxed ___sn_readq_relaxed
 
 /*
  * The following routines are SN Platform specific, called when
@@ -208,25 +212,25 @@
 }
 
 static inline unsigned char
-sn_readb_fast (void *addr)
+___sn_readb_relaxed (void *addr)
 {
 	return *(volatile unsigned char *)addr;
 }
 
 static inline unsigned short
-sn_readw_fast (void *addr)
+___sn_readw_relaxed (void *addr)
 {
 	return *(volatile unsigned short *)addr;
 }
 
 static inline unsigned int
-sn_readl_fast (void *addr)
+___sn_readl_relaxed (void *addr)
 {
 	return *(volatile unsigned int *) addr;
 }
 
 static inline unsigned long
-sn_readq_fast (void *addr)
+___sn_readq_relaxed (void *addr)
 {
 	return *(volatile unsigned long *) addr;
 }
--- diff/include/asm-ia64/sn/sn2/shubio.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/asm-ia64/sn/sn2/shubio.h	2004-02-09 10:39:56.000000000 +0000
@@ -3385,7 +3385,6 @@
 #define IO_PERF_SETS	32
 
 #if __KERNEL__
-#include <asm/sn/alenlist.h>
 #include <asm/sn/dmamap.h>
 #include <asm/sn/driver.h>
 #include <asm/sn/xtalk/xtalk.h>
@@ -3530,11 +3529,6 @@
                         paddr_t paddr,          /* map for this address */
                         size_t byte_count);     /* map this many bytes */
 
-extern alenlist_t
-hub_dmamap_list(        hub_dmamap_t dmamap,    /* use mapping resources */
-                        alenlist_t alenlist,    /* map this Addr/Length List */
-                        unsigned flags);
-
 extern void
 hub_dmamap_done(        hub_dmamap_t dmamap);   /* done w/ mapping resources */
 
@@ -3545,12 +3539,6 @@
                         size_t byte_count,      /* length */
                         unsigned flags);                /* defined in dma.h */
 
-extern alenlist_t
-hub_dmatrans_list(      vertex_hdl_t dev,       /* translate for this device */
-                        device_desc_t dev_desc, /* device descriptor */
-                        alenlist_t palenlist,   /* system addr/length list */
-                        unsigned flags);                /* defined in dma.h */
-
 extern void
 hub_dmamap_drain(       hub_dmamap_t map);
 
@@ -3559,10 +3547,6 @@
                         paddr_t addr,
                         size_t bytes);
 
-extern void
-hub_dmalist_drain(      vertex_hdl_t vhdl,
-                        alenlist_t list);
-
 
 /* INTERRUPT MANAGEMENT */
 typedef struct hub_intr_s *hub_intr_t;
--- diff/include/asm-ia64/sn/sn2/sn_private.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/asm-ia64/sn/sn2/sn_private.h	2004-02-09 10:39:56.000000000 +0000
@@ -8,6 +8,7 @@
 #ifndef _ASM_IA64_SN_SN2_SN_PRIVATE_H
 #define _ASM_IA64_SN_SN2_SN_PRIVATE_H
 
+#include <linux/wait.h>
 #include <asm/sn/nodepda.h>
 #include <asm/sn/io.h>
 #include <asm/sn/xtalk/xwidget.h>
@@ -20,7 +21,7 @@
 extern void mem_init(void);
 extern void cpu_unenable(cpuid_t);
 extern nasid_t get_lowest_nasid(void);
-extern __psunsigned_t get_master_bridge_base(void);
+extern unsigned long get_master_bridge_base(void);
 extern int check_nasid_equiv(nasid_t, nasid_t);
 extern char get_console_pcislot(void);
 
@@ -28,7 +29,7 @@
 					 xwidgetnum_t test_wid);
 
 /* memsupport.c */
-extern void poison_state_alter_range(__psunsigned_t start, int len, int poison);
+extern void poison_state_alter_range(unsigned long start, int len, int poison);
 extern int memory_present(paddr_t);
 extern int memory_read_accessible(paddr_t);
 extern int memory_write_accessible(paddr_t);
@@ -86,7 +87,7 @@
 
 /* klnuma.c */
 extern void replicate_kernel_text(int numnodes);
-extern __psunsigned_t get_freemem_start(cnodeid_t cnode);
+extern unsigned long get_freemem_start(cnodeid_t cnode);
 extern void setup_replication_mask(int maxnodes);
 
 /* init.c */
@@ -109,7 +110,7 @@
 /* Used for debugger to signal upper software a breakpoint has taken place */
 
 extern void *debugger_update;
-extern __psunsigned_t debugger_stopped;
+extern unsigned long debugger_stopped;
 
 /* 
  * piomap, created by shub_pio_alloc.
@@ -234,9 +235,6 @@
 #define paddr_cnode(_pa)	(NASID_TO_COMPACT_NODEID(NASID_GET(_pa)))
 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 *, ...));
 void bootstrap(void);
 
--- diff/include/asm-ia64/sn/sn_cpuid.h	2003-08-26 10:00:54.000000000 +0100
+++ source/include/asm-ia64/sn/sn_cpuid.h	2004-02-09 10:39:56.000000000 +0000
@@ -13,12 +13,8 @@
 
 #include <linux/config.h>
 #include <linux/smp.h>
-#include <linux/sched.h>
-#include <linux/mmzone.h>
-#include <asm/sn/types.h>
-#include <asm/current.h>
-#include <asm/nodedata.h>
 #include <asm/sn/pda.h>
+#include <asm/intrinsics.h>
 
 
 /*
--- diff/include/asm-ia64/sn/sn_private.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/asm-ia64/sn/sn_private.h	2004-02-09 10:39:56.000000000 +0000
@@ -8,11 +8,6 @@
 #ifndef _ASM_IA64_SN_SN_PRIVATE_H
 #define _ASM_IA64_SN_SN_PRIVATE_H
 
-#include <linux/config.h>
-#include <asm/sn/nodepda.h>
-#include <asm/sn/xtalk/xwidget.h>
-#include <asm/sn/xtalk/xtalk_private.h>
-
 #include <asm/sn/sn2/sn_private.h>
 
 #endif /* _ASM_IA64_SN_SN_PRIVATE_H */
--- diff/include/asm-ia64/sn/types.h	2003-06-30 10:07:34.000000000 +0100
+++ source/include/asm-ia64/sn/types.h	2004-02-09 10:39:56.000000000 +0000
@@ -9,21 +9,15 @@
 #ifndef _ASM_IA64_SN_TYPES_H
 #define _ASM_IA64_SN_TYPES_H
 
-#include <linux/config.h>
-#include <linux/types.h>
-
 typedef unsigned long 	cpuid_t;
 typedef signed short	nasid_t;	/* node id in numa-as-id space */
 typedef signed char	partid_t;	/* partition ID type */
 typedef unsigned int    moduleid_t;     /* user-visible module number type */
 typedef unsigned int    cmoduleid_t;    /* kernel compact module id type */
-typedef signed char slabid_t;
+typedef signed char     slabid_t;
 typedef unsigned char	clusterid_t;	/* Clusterid of the cell */
 
-typedef uint64_t __psunsigned_t;
-
 typedef unsigned long iopaddr_t;
-typedef unsigned char uchar_t;
 typedef unsigned long paddr_t;
 typedef unsigned long pfn_t;
 typedef short cnodeid_t;
--- diff/include/asm-ia64/sn/vector.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/asm-ia64/sn/vector.h	2004-02-09 10:39:56.000000000 +0000
@@ -8,8 +8,6 @@
 #ifndef _ASM_IA64_SN_VECTOR_H
 #define _ASM_IA64_SN_VECTOR_H
 
-#include <linux/config.h>
-
 #define NET_VEC_NULL            ((net_vec_t)  0)
 #define NET_VEC_BAD             ((net_vec_t) -1)
 
--- diff/include/asm-ia64/sn/xtalk/xbow.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/asm-ia64/sn/xtalk/xbow.h	2004-02-09 10:39:56.000000000 +0000
@@ -12,7 +12,7 @@
  * xbow.h - header file for crossbow chip and xbow section of xbridge
  */
 
-#include <linux/config.h>
+#include <asm/types.h>
 #include <asm/sn/xtalk/xtalk.h>
 #include <asm/sn/xtalk/xwidget.h>
 #include <asm/sn/xtalk/xswitch.h>
@@ -55,12 +55,6 @@
 #ifndef __ASSEMBLY__
 typedef uint32_t      xbowreg_t;
 
-#define XBOWCONST	(xbowreg_t)
-
-/* Generic xbow register, given base and offset */
-#define XBOW_REG_PTR(base, offset) ((volatile xbowreg_t*) \
-	((__psunsigned_t)(base) + (__psunsigned_t)(offset)))
-
 /* Register set for each xbow link */
 typedef volatile struct xb_linkregs_s {
 /* 
@@ -224,14 +218,6 @@
 /*              of the widget0 address space (before 0xf4) */
 #define	XBOW_WID_UNDEF		0xe4
 
-/* pointer to link arbitration register, given xbow base, dst and src widget id */
-#define XBOW_PRIO_ARBREG_PTR(base, dst_wid, src_wid) \
-	XBOW_REG_PTR(XBOW_PRIO_LINKREGS_PTR(base, dst_wid), XBOW_ARB_OFF(src_wid))
-
-/* pointer to link registers base, given xbow base and destination widget id */
-#define XBOW_PRIO_LINKREGS_PTR(base, dst_wid) (xb_linkregs_t*) \
-	XBOW_REG_PTR(base, XB_LINK_REG_BASE(dst_wid))
-
 /* xbow link register set base, legal value for x is 0x8..0xf */
 #define	XB_LINK_BASE		0x100
 #define	XB_LINK_OFFSET		0x40
@@ -356,9 +342,6 @@
                         XWIDGET_MFG_NUM(wid) == XXBOW_WIDGET_MFGR_NUM)
 
 #define XBOW_WAR_ENABLED(pv, widid) ((1 << XWIDGET_REV_NUM(widid)) & pv)
-#define PV854827 (~0)     /* PIC: fake widget 0xf presence bit. permanent */
-#define PV863579 (1 << 1) /* PIC: PIO to PIC register */
-
 
 #ifndef __ASSEMBLY__
 /*
--- diff/include/asm-ia64/sn/xtalk/xtalk.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/asm-ia64/sn/xtalk/xtalk.h	2004-02-09 10:39:56.000000000 +0000
@@ -59,7 +59,6 @@
 
 #include <asm/types.h>
 #include <asm/sn/types.h>
-#include <asm/sn/alenlist.h>
 #include <asm/sn/ioerror.h>
 #include <asm/sn/driver.h>
 #include <asm/sn/dmamap.h>
@@ -78,14 +77,9 @@
  *	sleep waiting for resoruces, return an error
  *	instead. (PIOMAP_NOSLEEP and DMAMAP_NOSLEEP are
  *	the same numeric value and are acceptable).
- * XTALK_INPLACE: when operating on alenlist structures,
- *	reuse the source alenlist rather than creating a
- *	new one. (PIOMAP_INPLACE and DMAMAP_INPLACE are
- *	the same numeric value and are acceptable).
  */
 #define	XTALK_FIXED		DMAMAP_FIXED
 #define	XTALK_NOSLEEP		DMAMAP_NOSLEEP
-#define	XTALK_INPLACE		DMAMAP_INPLACE
 
 /* PIO MANAGEMENT */
 typedef xtalk_piomap_t
@@ -94,7 +88,7 @@
 			 iopaddr_t xtalk_addr,	/* map for this xtalk_addr range */
 			 size_t byte_count,
 			 size_t byte_count_max,		/* maximum size of a mapping */
-			 unsigned flags);	/* defined in sys/pio.h */
+			 unsigned int flags);	/* defined in sys/pio.h */
 typedef void
 xtalk_piomap_free_f     (xtalk_piomap_t xtalk_piomap);
 
@@ -111,7 +105,7 @@
 			 device_desc_t dev_desc,	/* device descriptor */
 			 iopaddr_t xtalk_addr,	/* Crosstalk address */
 			 size_t byte_count,	/* map this many bytes */
-			 unsigned flags);	/* (currently unused) */
+			 unsigned int flags);	/* (currently unused) */
 
 extern caddr_t
 xtalk_pio_addr		(vertex_hdl_t dev,	/* translate for this device */
@@ -119,7 +113,7 @@
 			 iopaddr_t xtalk_addr,	/* Crosstalk address */
 			 size_t byte_count,	/* map this many bytes */
 			 xtalk_piomap_t *xtalk_piomapp,	/* RETURNS mapping resources */
-			 unsigned flags);	/* (currently unused) */
+			 unsigned int flags);	/* (currently unused) */
 
 /* DMA MANAGEMENT */
 
@@ -129,7 +123,7 @@
 xtalk_dmamap_alloc_f    (vertex_hdl_t dev,	/* set up mappings for this device */
 			 device_desc_t dev_desc,	/* device descriptor */
 			 size_t byte_count_max,		/* max size of a mapping */
-			 unsigned flags);	/* defined in dma.h */
+			 unsigned int flags);	/* defined in dma.h */
 
 typedef void
 xtalk_dmamap_free_f     (xtalk_dmamap_t dmamap);
@@ -139,11 +133,6 @@
 			 paddr_t paddr,		/* map for this address */
 			 size_t byte_count);	/* map this many bytes */
 
-typedef alenlist_t
-xtalk_dmamap_list_f     (xtalk_dmamap_t dmamap,		/* use these mapping resources */
-			 alenlist_t alenlist,	/* map this address/length list */
-			 unsigned flags);
-
 typedef void
 xtalk_dmamap_done_f     (xtalk_dmamap_t dmamap);
 
@@ -152,13 +141,7 @@
 			 device_desc_t dev_desc,	/* device descriptor */
 			 paddr_t paddr,		/* system physical address */
 			 size_t byte_count,	/* length */
-			 unsigned flags);
-
-typedef alenlist_t
-xtalk_dmatrans_list_f   (vertex_hdl_t dev,	/* translate for this device */
-			 device_desc_t dev_desc,	/* device descriptor */
-			 alenlist_t palenlist,	/* system address/length list */
-			 unsigned flags);
+			 unsigned int flags);
 
 typedef void
 xtalk_dmamap_drain_f	(xtalk_dmamap_t map);	/* drain this map's channel */
@@ -168,11 +151,6 @@
 			 paddr_t addr,		/* to this physical address */
 			 size_t bytes);		/* for this many bytes */
 
-typedef void
-xtalk_dmalist_drain_f	(vertex_hdl_t vhdl,	/* drain channel from this device */
-			 alenlist_t list);	/* for this set of physical blocks */
-
-
 /* INTERRUPT MANAGEMENT */
 
 /*
@@ -243,7 +221,7 @@
 			     int which,
 			     iopaddr_t xtalk_addr,
 			     size_t byte_count,
-			     unsigned flags);
+			     unsigned int flags);
 
 /*
  * Adapters that provide a crosstalk interface adhere to this software interface.
@@ -260,13 +238,10 @@
     xtalk_dmamap_alloc_f   *dmamap_alloc;
     xtalk_dmamap_free_f    *dmamap_free;
     xtalk_dmamap_addr_f    *dmamap_addr;
-    xtalk_dmamap_list_f    *dmamap_list;
     xtalk_dmamap_done_f    *dmamap_done;
     xtalk_dmatrans_addr_f  *dmatrans_addr;
-    xtalk_dmatrans_list_f  *dmatrans_list;
     xtalk_dmamap_drain_f   *dmamap_drain;
     xtalk_dmaaddr_drain_f  *dmaaddr_drain;
-    xtalk_dmalist_drain_f  *dmalist_drain;
 
     /* INTERRUPT MANAGEMENT */
     xtalk_intr_alloc_f     *intr_alloc;
@@ -289,13 +264,10 @@
 extern xtalk_dmamap_alloc_f xtalk_dmamap_alloc;
 extern xtalk_dmamap_free_f xtalk_dmamap_free;
 extern xtalk_dmamap_addr_f xtalk_dmamap_addr;
-extern xtalk_dmamap_list_f xtalk_dmamap_list;
 extern xtalk_dmamap_done_f xtalk_dmamap_done;
 extern xtalk_dmatrans_addr_f xtalk_dmatrans_addr;
-extern xtalk_dmatrans_list_f xtalk_dmatrans_list;
 extern xtalk_dmamap_drain_f xtalk_dmamap_drain;
 extern xtalk_dmaaddr_drain_f xtalk_dmaaddr_drain;
-extern xtalk_dmalist_drain_f xtalk_dmalist_drain;
 extern xtalk_intr_alloc_f xtalk_intr_alloc;
 extern xtalk_intr_alloc_f xtalk_intr_alloc_nothd;
 extern xtalk_intr_free_f xtalk_intr_free;
--- diff/include/asm-ia64/sn/xtalk/xwidget.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/asm-ia64/sn/xtalk/xwidget.h	2004-02-09 10:39:56.000000000 +0000
@@ -139,17 +139,17 @@
 } widget_cfg_t;
 
 typedef struct {
-    unsigned                other:8;
-    unsigned                bo:1;
-    unsigned                error:1;
-    unsigned                vbpm:1;
-    unsigned                gbr:1;
-    unsigned                ds:2;
-    unsigned                ct:1;
-    unsigned                tnum:5;
-    unsigned                pactyp:4;
-    unsigned                sidn:4;
-    unsigned                didn:4;
+    unsigned int            other:8;
+    unsigned int            bo:1;
+    unsigned int            error:1;
+    unsigned int            vbpm:1;
+    unsigned int            gbr:1;
+    unsigned int            ds:2;
+    unsigned int            ct:1;
+    unsigned int            tnum:5;
+    unsigned int            pactyp:4;
+    unsigned int            sidn:4;
+    unsigned int            didn:4;
 } w_err_cmd_word_f;
 
 typedef union {
@@ -188,7 +188,7 @@
 extern int              xwidget_driver_register(xwidget_part_num_t part_num,
 						xwidget_mfg_num_t mfg_num,
 						char *driver_prefix,
-						unsigned flags);
+						unsigned int flags);
 
 extern void             xwidget_driver_unregister(char *driver_prefix);
 
@@ -230,7 +230,7 @@
  * However, since nobody looks inside ...
  */
 typedef struct v_widget_s {
-    unsigned                v_widget_s_is_really_empty;
+    unsigned int                v_widget_s_is_really_empty;
 #define	v_widget_s_is_really_empty	and using this would be a syntax error.
 } v_widget_t;
 #endif				/* _KERNEL */
--- diff/include/asm-ia64/spinlock.h	2004-01-19 10:22:59.000000000 +0000
+++ source/include/asm-ia64/spinlock.h	2004-02-09 10:39:56.000000000 +0000
@@ -110,8 +110,18 @@
 typedef struct {
 	volatile int read_counter	: 31;
 	volatile int write_lock		:  1;
+#ifdef CONFIG_LOCKMETER
+	/* required for LOCKMETER since all bits in lock are used */
+	/* and we need this storage for CPU and lock INDEX        */
+	unsigned lockmeter_magic;
+#endif
 } rwlock_t;
+
+#ifdef CONFIG_LOCKMETER
+#define RW_LOCK_UNLOCKED (rwlock_t) { 0, 0, 0 }
+#else
 #define RW_LOCK_UNLOCKED (rwlock_t) { 0, 0 }
+#endif
 
 #define rwlock_init(x)		do { *(x) = RW_LOCK_UNLOCKED; } while(0)
 #define rwlock_is_locked(x)	(*(volatile int *) (x) != 0)
@@ -127,6 +137,48 @@
 	}										\
 } while (0)
 
+#ifdef CONFIG_LOCKMETER
+/*
+ * HACK: This works, but still have a timing window that affects performance:
+ * we see that no one owns the Write lock, then someone * else grabs for Write
+ * lock before we do a read_lock().
+ * This means that on rare occasions our read_lock() will stall and spin-wait
+ * until we acquire for Read, instead of simply returning a trylock failure.
+ */
+static inline int _raw_read_trylock(rwlock_t *rw)
+{
+	if (rw->write_lock) {
+		return 0;
+	} else {
+		_raw_read_lock(rw);
+		return 1;
+	}
+}
+
+static inline int _raw_write_trylock(rwlock_t *rw)
+{
+	if (!(rw->write_lock)) {
+	    /* isn't currently write-locked... that looks promising... */
+	    if (test_and_set_bit(31, rw) == 0) {
+		/* now it is write-locked by me... */
+		if (rw->read_counter) {
+		    /* really read-locked, so release write-lock and fail */
+		    clear_bit(31, rw);
+		} else {
+		    /* we've the the write-lock, no read-lockers... success! */
+		    barrier();
+		    return 1;
+		}
+
+	    }
+	}
+
+	/* falls through ... fails to write-lock */
+	barrier();
+	return 0;
+}
+#endif
+
 #define _raw_read_unlock(rw)					\
 do {								\
 	rwlock_t *__read_lock_ptr = (rw);			\
@@ -190,4 +242,25 @@
 	clear_bit(31, (x));								\
 })
 
+#ifdef CONFIG_LOCKMETER
+extern void _metered_spin_lock  (spinlock_t *lock);
+extern void _metered_spin_unlock(spinlock_t *lock);
+
+/*
+ *  Use a less efficient, and inline, atomic_dec_and_lock() if lockmetering
+ *  so we can see the callerPC of who is actually doing the spin_lock().
+ *  Otherwise, all we see is the generic rollup of all locks done by
+ *  atomic_dec_and_lock().
+ */
+static inline int atomic_dec_and_lock(atomic_t *atomic, spinlock_t *lock)
+{
+	_metered_spin_lock(lock);
+	if (atomic_dec_and_test(atomic))
+		return 1;
+	_metered_spin_unlock(lock);
+	return 0;
+}
+#define ATOMIC_DEC_AND_LOCK
+#endif
+
 #endif /*  _ASM_IA64_SPINLOCK_H */
--- diff/include/asm-ia64/topology.h	2003-07-08 09:55:19.000000000 +0100
+++ source/include/asm-ia64/topology.h	2004-02-09 10:39:56.000000000 +0000
@@ -29,15 +29,6 @@
 #define node_to_cpumask(node) (node_to_cpu_mask[node])
 
 /*
- * Returns the number of the node containing MemBlk 'memblk'
- */
-#ifdef CONFIG_ACPI_NUMA
-#define memblk_to_node(memblk) (node_memblk[memblk].nid)
-#else
-#define memblk_to_node(memblk) (memblk)
-#endif
-
-/*
  * Returns the number of the node containing Node 'nid'.
  * Not implemented here. Multi-level hierarchies detected with
  * the help of node_distance().
@@ -49,12 +40,6 @@
  */
 #define node_to_first_cpu(node) (__ffs(node_to_cpumask(node)))
 
-/*
- * Returns the number of the first MemBlk on Node 'node'
- * Should be fixed when IA64 discontigmem goes in.
- */
-#define node_to_memblk(node) (node)
-
 /* Cross-node load balancing interval. */
 #define NODE_BALANCE_RATE 10
 
--- diff/include/asm-m68k/io.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/asm-m68k/io.h	2004-02-09 10:39:56.000000000 +0000
@@ -261,6 +261,10 @@
 #define writeb(val,addr)  out_8((addr),(val))
 #define writew(val,addr)  out_le16((addr),(val))
 
+#define readb_relaxed(addr) readb(addr)
+#define readw_relaxed(addr) readw(addr)
+#define readl_relaxed(addr) readl(addr)
+
 #ifndef CONFIG_ISA
 #define inb(port)      in_8(port)
 #define outb(val,port) out_8((port),(val))
--- diff/include/asm-m68k/param.h	2002-10-16 04:28:24.000000000 +0100
+++ source/include/asm-m68k/param.h	2004-02-09 10:39:56.000000000 +0000
@@ -13,10 +13,6 @@
 
 #define EXEC_PAGESIZE	8192
 
-#ifndef NGROUPS
-#define NGROUPS		32
-#endif
-
 #ifndef NOGROUP
 #define NOGROUP		(-1)
 #endif
--- diff/include/asm-m68k/pci.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/asm-m68k/pci.h	2004-02-09 10:39:56.000000000 +0000
@@ -36,6 +36,7 @@
 };
 
 #define pcibios_assign_all_busses()	0
+#define pcibios_scan_all_fns(a, b)	0
 
 static inline void pcibios_set_master(struct pci_dev *dev)
 {
--- diff/include/asm-m68k/virtconvert.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/asm-m68k/virtconvert.h	2004-02-09 10:39:56.000000000 +0000
@@ -19,8 +19,8 @@
  * Change virtual addresses to physical addresses and vv.
  */
 #ifndef CONFIG_SUN3
-extern unsigned long mm_vtop(unsigned long addr) __attribute__ ((const));
-extern unsigned long mm_ptov(unsigned long addr) __attribute__ ((const));
+extern unsigned long mm_vtop(unsigned long addr) __attribute_const__;
+extern unsigned long mm_ptov(unsigned long addr) __attribute_const__;
 #else
 static inline unsigned long mm_vtop(unsigned long vaddr)
 {
--- diff/include/asm-m68knommu/io.h	2003-07-11 09:39:50.000000000 +0100
+++ source/include/asm-m68knommu/io.h	2004-02-09 10:39:56.000000000 +0000
@@ -39,6 +39,10 @@
 #define readl(addr) \
     ({ unsigned int __v = (*(volatile unsigned int *) (addr)); __v; })
 
+#define readb_relaxed(addr) readb(addr)
+#define readw_relaxed(addr) readw(addr)
+#define readl_relaxed(addr) readl(addr)
+
 #define writeb(b,addr) (void)((*(volatile unsigned char *) (addr)) = (b))
 #define writew(b,addr) (void)((*(volatile unsigned short *) (addr)) = (b))
 #define writel(b,addr) (void)((*(volatile unsigned int *) (addr)) = (b))
--- diff/include/asm-m68knommu/param.h	2002-11-11 11:09:43.000000000 +0000
+++ source/include/asm-m68knommu/param.h	2004-02-09 10:39:56.000000000 +0000
@@ -44,10 +44,6 @@
 
 #define EXEC_PAGESIZE	4096
 
-#ifndef NGROUPS
-#define NGROUPS		32
-#endif
-
 #ifndef NOGROUP
 #define NOGROUP		(-1)
 #endif
--- diff/include/asm-m68knommu/pci.h	2003-05-21 11:49:50.000000000 +0100
+++ source/include/asm-m68knommu/pci.h	2004-02-09 10:39:56.000000000 +0000
@@ -11,6 +11,8 @@
 #define PCIBIOS_MIN_IO		0x100
 #define PCIBIOS_MIN_MEM		0x00010000
 
+#define pcibios_scan_all_fns(a, b)	0
+
 /*
  * Return whether the given PCI device DMA address mask can
  * be supported properly.  For example, if your device can
--- diff/include/asm-mips/io.h	2003-08-20 14:16:33.000000000 +0100
+++ source/include/asm-mips/io.h	2004-02-09 10:39:57.000000000 +0000
@@ -264,6 +264,10 @@
 #define readw(addr)		__ioswab16(__raw_readw(addr))
 #define readl(addr)		__ioswab32(__raw_readl(addr))
 #define readq(addr)		__ioswab64(__raw_readq(addr))
+#define readb_relaxed(addr)	readb(addr)
+#define readw_relaxed(addr)	readw(addr)
+#define readl_relaxed(addr)	readl(addr)
+#define readq_relaxed(addr)	readq(addr)
 
 #define __raw_writeb(b,addr)	((*(volatile unsigned char *)(addr)) = (b))
 #define __raw_writew(w,addr)	((*(volatile unsigned short *)(addr)) = (w))
--- diff/include/asm-mips/mmzone.h	2003-08-20 14:16:36.000000000 +0100
+++ source/include/asm-mips/mmzone.h	2004-02-09 10:39:57.000000000 +0000
@@ -75,9 +75,8 @@
 		(((unsigned long)ADDR_TO_MAPBASE((kaddr)) - PAGE_OFFSET) / \
 		sizeof(struct page))))
 
-#define kern_addr_valid(addr)	((KVADDR_TO_NID((unsigned long)addr) > \
-	-1) ? 0 : (test_bit(LOCAL_MAP_NR((addr)), \
-	NODE_DATA(KVADDR_TO_NID((unsigned long)addr))->valid_addr_bitmap)))
+/* XXX: FIXME -- wli */
+#define kern_addr_valid(addr)	(0)
 
 #define pfn_to_page(pfn)	(mem_map + (pfn))
 #define page_to_pfn(page) \
--- diff/include/asm-mips/param.h	2003-07-08 09:55:19.000000000 +0100
+++ source/include/asm-mips/param.h	2004-02-09 10:39:57.000000000 +0000
@@ -33,10 +33,6 @@
 
 #define EXEC_PAGESIZE	4096
 
-#ifndef NGROUPS
-#define NGROUPS		32
-#endif
-
 #ifndef NOGROUP
 #define NOGROUP		(-1)
 #endif
--- diff/include/asm-mips/pci.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/asm-mips/pci.h	2004-02-09 10:39:57.000000000 +0000
@@ -20,6 +20,7 @@
 #else
 #define pcibios_assign_all_busses()	0
 #endif
+#define pcibios_scan_all_fns(a, b)	0
 
 #define PCIBIOS_MIN_IO		0x1000
 #define PCIBIOS_MIN_MEM		0x10000000
--- diff/include/asm-mips/spinlock.h	2003-10-09 09:47:17.000000000 +0100
+++ source/include/asm-mips/spinlock.h	2004-02-09 10:39:57.000000000 +0000
@@ -91,9 +91,18 @@
 
 typedef struct {
 	volatile unsigned int lock;
+#ifdef CONFIG_LOCKMETER
+	/* required for LOCKMETER since all bits in lock are used */
+	/* and we need this storage for CPU and lock INDEX        */
+	unsigned lockmeter_magic;
+#endif
 } rwlock_t;
 
+#ifdef CONFIG_LOCKMETER
+#define RW_LOCK_UNLOCKED (rwlock_t) { 0, 0 }
+#else
 #define RW_LOCK_UNLOCKED (rwlock_t) { 0 }
+#endif
 
 #define rwlock_init(x)  do { *(x) = RW_LOCK_UNLOCKED; } while(0)
 
--- diff/include/asm-parisc/io.h	2003-09-30 15:46:19.000000000 +0100
+++ source/include/asm-parisc/io.h	2004-02-09 10:39:57.000000000 +0000
@@ -171,6 +171,11 @@
 #define writeq(b,addr) __raw_writeq(cpu_to_le64(b),addr)
 #endif /* !USE_HPPA_IOREMAP */
 
+#define readb_relaxed(addr) readb(addr)
+#define readw_relaxed(addr) readw(addr)
+#define readl_relaxed(addr) readl(addr)
+#define readq_relaxed(addr) readq(addr)
+
 extern void __memcpy_fromio(unsigned long dest, unsigned long src, int count);
 extern void __memcpy_toio(unsigned long dest, unsigned long src, int count);
 extern void __memset_io(unsigned long dest, char fill, int count);
--- diff/include/asm-parisc/param.h	2003-10-09 09:47:34.000000000 +0100
+++ source/include/asm-parisc/param.h	2004-02-09 10:39:57.000000000 +0000
@@ -18,10 +18,6 @@
 
 #define EXEC_PAGESIZE	4096
 
-#ifndef NGROUPS
-#define NGROUPS		32
-#endif
-
 #ifndef NOGROUP
 #define NOGROUP		(-1)
 #endif
--- diff/include/asm-parisc/pci.h	2003-10-09 09:47:34.000000000 +0100
+++ source/include/asm-parisc/pci.h	2004-02-09 10:39:57.000000000 +0000
@@ -174,6 +174,7 @@
 **   to zero for legacy platforms and one for PAT platforms.
 */
 #define pcibios_assign_all_busses()     (pdc_type == PDC_TYPE_PAT)
+#define pcibios_scan_all_fns(a, b)	0
 
 #define PCIBIOS_MIN_IO          0x10
 #define PCIBIOS_MIN_MEM         0x1000 /* NBPG - but pci/setup-res.c dies */
--- diff/include/asm-ppc/delay.h	2003-05-21 11:50:16.000000000 +0100
+++ source/include/asm-ppc/delay.h	2004-02-09 10:39:57.000000000 +0000
@@ -30,8 +30,8 @@
  * (which corresponds to ~3800 bogomips at HZ = 100).
  *  -- paulus
  */
-#define __MAX_UDELAY	(226050910/HZ)	/* maximum udelay argument */
-#define __MAX_NDELAY	(2147483647/HZ)	/* maximum ndelay argument */
+#define __MAX_UDELAY	(226050910UL/HZ)	/* maximum udelay argument */
+#define __MAX_NDELAY	(4294967295UL/HZ)	/* maximum ndelay argument */
 
 extern __inline__ void __udelay(unsigned int x)
 {
--- diff/include/asm-ppc/io.h	2003-09-17 12:28:12.000000000 +0100
+++ source/include/asm-ppc/io.h	2004-02-09 10:39:57.000000000 +0000
@@ -58,6 +58,9 @@
 #define writel(b,addr) out_le32((volatile u32 *)(addr),(b))
 #endif /* CONFIG_APUS */
 
+#define readb_relaxed(addr) readb(addr)
+#define readw_relaxed(addr) readw(addr)
+#define readl_relaxed(addr) readl(addr)
 
 #define __raw_readb(addr)	(*(volatile unsigned char *)(addr))
 #define __raw_readw(addr)	(*(volatile unsigned short *)(addr))
@@ -208,7 +211,7 @@
 #define ioremap_nocache(addr, size)	ioremap((addr), (size))
 extern void iounmap(void *addr);
 extern unsigned long iopa(unsigned long addr);
-extern unsigned long mm_ptov(unsigned long addr) __attribute__ ((const));
+extern unsigned long mm_ptov(unsigned long addr) __attribute_const__;
 extern void io_block_mapping(unsigned long virt, phys_addr_t phys,
 			     unsigned int size, int flags);
 
--- diff/include/asm-ppc/keylargo.h	2003-05-21 11:50:00.000000000 +0100
+++ source/include/asm-ppc/keylargo.h	2004-02-09 10:39:57.000000000 +0000
@@ -18,6 +18,13 @@
 #define KEYLARGO_FCR4		0x48
 #define KEYLARGO_FCR5		0x4c	/* Pangea only */
 
+/* K2 aditional FCRs */
+#define K2_FCR6			0x34
+#define K2_FCR7			0x30
+#define K2_FCR8			0x2c
+#define K2_FCR9			0x28
+#define K2_FCR10		0x24
+
 /* GPIO registers */
 #define KEYLARGO_GPIO_LEVELS0		0x50
 #define KEYLARGO_GPIO_LEVELS1		0x54
@@ -30,6 +37,10 @@
 #define KEYLARGO_GPIO_OUTOUT_DATA	0x01
 #define KEYLARGO_GPIO_INPUT_DATA	0x02
 
+/* K2 does only extint GPIOs and does 51 of them */
+#define K2_GPIO_EXTINT_0		0x58
+#define K2_GPIO_EXTINT_CNT		51
+
 /* Specific GPIO regs */
 
 #define KL_GPIO_MODEM_RESET		(KEYLARGO_GPIO_0+0x03)
@@ -67,7 +78,8 @@
 #define KL_GPIO_AIRPORT_4		(KEYLARGO_GPIO_0+0x0f)
 
 /*
- * Bits in feature control register
+ * Bits in feature control register. Those bits different for K2 are
+ * listed separately
  */
 #define KL_MBCR_MB0_PCI_ENABLE		0x00000800	/* exist ? */
 #define KL_MBCR_MB0_IDE_ENABLE		0x00001000
@@ -202,9 +214,30 @@
 #define KL4_PORT_DISCONNECT_STAT(p)	(0x00000010 << ((p)<<3))
 
 /* Pangea and Intrepid only */
-#define KL5_VIA_USE_CLK31		0x000000001	/* Pangea Only */
-#define KL5_SCC_USE_CLK31		0x000000002	/* Pangea Only */
-#define KL5_PWM_CLK32_EN		0x000000004
-#define KL5_CLK3_68_EN			0x000000010
-#define KL5_CLK32_EN			0x000000020
+#define KL5_VIA_USE_CLK31		0000000001	/* Pangea Only */
+#define KL5_SCC_USE_CLK31		0x00000002	/* Pangea Only */
+#define KL5_PWM_CLK32_EN		0x00000004
+#define KL5_CLK3_68_EN			0x00000010
+#define KL5_CLK32_EN			0x00000020
+
+
+/* K2 definitions */
+#define K2_FCR0_USB0_SWRESET		0x00200000
+#define K2_FCR0_USB1_SWRESET		0x02000000
+#define K2_FCR0_RING_PME_DISABLE	0x08000000
+
+#define K2_FCR1_PCI1_BUS_RESET_N	0x00000010
+#define K2_FCR1_PCI1_SLEEP_RESET_EN	0x00000020
+#define K2_FCR1_PCI1_CLK_ENABLE		0x00004000
+#define K2_FCR1_FW_CLK_ENABLE		0x00008000
+#define K2_FCR1_FW_RESET_N		0x00010000
+#define K2_FCR1_GMAC_CLK_ENABLE		0x00400000
+#define K2_FCR1_GMAC_POWER_DOWN		0x00800000
+#define K2_FCR1_GMAC_RESET_N		0x01000000
+#define K2_FCR1_SATA_CLK_ENABLE		0x02000000
+#define K2_FCR1_SATA_POWER_DOWN		0x04000000
+#define K2_FCR1_SATA_RESET_N		0x08000000
+#define K2_FCR1_UATA_CLK_ENABLE		0x10000000
+#define K2_FCR1_UATA_RESET_N		0x40000000
+#define K2_FCR1_UATA_CHOOSE_CLK66	0x80000000
 
--- diff/include/asm-ppc/kgdb.h	2002-10-16 04:27:15.000000000 +0100
+++ source/include/asm-ppc/kgdb.h	2004-02-09 10:39:57.000000000 +0000
@@ -11,8 +11,17 @@
 #define _PPC_KGDB_H
 
 #ifndef __ASSEMBLY__
-/* To initialize the serial, first thing called */
+
+/* Things specific to the gen550 backend. */
+struct uart_port;
+
+extern void gen550_progress(char *, unsigned short);
+extern void gen550_kgdb_map_scc(void);
+extern void gen550_init(int, struct uart_port *);
+
+/* Things specific to the pmac backend. */
 extern void zs_kgdb_hook(int tty_num);
+
 /* To init the kgdb engine. (called by serial hook)*/
 extern void set_debug_traps(void);
 
--- diff/include/asm-ppc/machdep.h	2003-05-21 11:50:16.000000000 +0100
+++ source/include/asm-ppc/machdep.h	2004-02-09 10:39:57.000000000 +0000
@@ -53,9 +53,11 @@
 	void		(*setup_io_mappings)(void);
 
   	void		(*progress)(char *, unsigned short);
+	void		(*kgdb_map_scc)(void);
 
 	unsigned char 	(*nvram_read_val)(int addr);
 	void		(*nvram_write_val)(int addr, unsigned char val);
+	void		(*nvram_sync)(void);
 
 	/*
 	 * optional PCI "hooks"
@@ -93,7 +95,7 @@
 	 * hook used to control some machine specific features (like reset
 	 * lines, chip power control, etc...).
 	 */
-	int (*feature_call)(unsigned int feature, ...);
+	long (*feature_call)(unsigned int feature, ...);
 
 #ifdef CONFIG_SMP
 	/* functions for dealing with other cpus */
--- diff/include/asm-ppc/macio.h	2003-09-30 15:46:19.000000000 +0100
+++ source/include/asm-ppc/macio.h	2004-02-09 10:39:57.000000000 +0000
@@ -9,7 +9,7 @@
 struct macio_driver;
 struct macio_chip;
 
-#define MACIO_DEV_COUNT_RESOURCE	8
+#define MACIO_DEV_COUNT_RESOURCES	8
 #define MACIO_DEV_COUNT_IRQS		8
 
 /*
@@ -38,6 +38,10 @@
 	struct macio_bus	*bus;		/* macio bus this device is on */
 	struct macio_dev	*media_bay;	/* Device is part of a media bay */
 	struct of_device	ofdev;
+	int			n_resources;
+	struct resource		resource[MACIO_DEV_COUNT_RESOURCES];
+	int			n_interrupts;
+	struct resource		interrupt[MACIO_DEV_COUNT_IRQS];
 };
 #define	to_macio_device(d) container_of(d, struct macio_dev, ofdev.dev)
 #define	of_to_macio_device(d) container_of(d, struct macio_dev, ofdev)
@@ -46,6 +50,71 @@
 extern void macio_dev_put(struct macio_dev *dev);
 
 /*
+ * Accessors to resources & interrupts and other device
+ * fields
+ */
+
+static inline int macio_resource_count(struct macio_dev *dev)
+{
+	return dev->n_resources;
+}
+
+static inline unsigned long macio_resource_start(struct macio_dev *dev, int resource_no)
+{
+	return dev->resource[resource_no].start;
+}
+
+static inline unsigned long macio_resource_end(struct macio_dev *dev, int resource_no)
+{
+	return dev->resource[resource_no].end;
+}
+
+static inline unsigned long macio_resource_len(struct macio_dev *dev, int resource_no)
+{
+	struct resource *res = &dev->resource[resource_no];
+	if (res->start == 0 || res->end == 0 || res->end < res->start)
+		return 0;
+	return res->end - res->start + 1;
+}
+
+extern int macio_request_resource(struct macio_dev *dev, int resource_no, const char *name);
+extern void macio_release_resource(struct macio_dev *dev, int resource_no);
+extern int macio_request_resources(struct macio_dev *dev, const char *name);
+extern void macio_release_resources(struct macio_dev *dev);
+
+static inline int macio_irq_count(struct macio_dev *dev)
+{
+	return dev->n_interrupts;
+}
+
+static inline int macio_irq(struct macio_dev *dev, int irq_no)
+{
+	return dev->interrupt[irq_no].start;
+}
+
+static inline void macio_set_drvdata(struct macio_dev *dev, void *data)
+{
+	dev_set_drvdata(&dev->ofdev.dev, data);
+}
+
+static inline void* macio_get_drvdata(struct macio_dev *dev)
+{
+	return dev_get_drvdata(&dev->ofdev.dev);
+}
+
+static inline struct device_node *macio_get_of_node(struct macio_dev *mdev)
+{
+	return mdev->ofdev.node;
+}
+
+#ifdef CONFIG_PCI
+static inline struct pci_dev *macio_get_pci_dev(struct macio_dev *mdev)
+{
+	return mdev->bus->pdev;
+}
+#endif
+
+/*
  * A driver for a mac-io chip based device
  */
 struct macio_driver
--- diff/include/asm-ppc/nvram.h	2003-01-13 14:18:15.000000000 +0000
+++ source/include/asm-ppc/nvram.h	2004-02-09 10:39:57.000000000 +0000
@@ -34,23 +34,40 @@
 /* Return partition offset in nvram */
 extern int	pmac_get_partition(int partition);
 
-/* Direct access to XPRAM */
+/* Direct access to XPRAM on PowerMacs */
 extern u8	pmac_xpram_read(int xpaddr);
 extern void	pmac_xpram_write(int xpaddr, u8 data);
 
+/* Synchronize NVRAM */
+extern void	nvram_sync(void);
+
+/* Normal access to NVRAM */
+extern unsigned char nvram_read_byte(int i);
+extern void nvram_write_byte(unsigned char c, int i);
+
 /* Some offsets in XPRAM */
 #define PMAC_XPRAM_MACHINE_LOC	0xe4
 #define PMAC_XPRAM_SOUND_VOLUME	0x08
 
-/* Machine location structure in XPRAM */
+/* Machine location structure in PowerMac XPRAM */
 struct pmac_machine_location {
 	unsigned int	latitude;	/* 2+30 bit Fractional number */
 	unsigned int	longitude;	/* 2+30 bit Fractional number */
 	unsigned int	delta;		/* mix of GMT delta and DLS */
 };
 
-/* /dev/nvram ioctls */
-#define PMAC_NVRAM_GET_OFFSET	_IOWR('p', 0x40, int) /* Get NVRAM partition offset */
+/*
+ * /dev/nvram ioctls
+ *
+ * Note that PMAC_NVRAM_GET_OFFSET is still supported, but is
+ * definitely obsolete. Do not use it if you can avoid it
+ */
+
+#define OBSOLETE_PMAC_NVRAM_GET_OFFSET \
+				_IOWR('p', 0x40, int)
+
+#define IOC_NVRAM_GET_OFFSET	_IOWR('p', 0x42, int)	/* Get NVRAM partition offset */
+#define IOC_NVRAM_SYNC		_IO('p', 0x43)		/* Sync NVRAM image */
 
 #endif
 #endif /* __KERNEL__ */
--- diff/include/asm-ppc/open_pic.h	2003-09-30 15:46:19.000000000 +0100
+++ source/include/asm-ppc/open_pic.h	2004-02-09 10:39:57.000000000 +0000
@@ -21,8 +21,8 @@
  *  Non-offset'ed vector numbers
  */
 
-#define OPENPIC_VEC_TIMER	64	/* and up */
-#define OPENPIC_VEC_IPI		72	/* and up */
+#define OPENPIC_VEC_TIMER	110	/* and up */
+#define OPENPIC_VEC_IPI		118	/* and up */
 #define OPENPIC_VEC_SPURIOUS	127
 
 /* OpenPIC IRQ controller structure */
@@ -51,6 +51,7 @@
 extern void openpic_cause_IPI(u_int ipi, u_int cpumask);
 extern void smp_openpic_message_pass(int target, int msg, unsigned long data,
 				     int wait);
+extern void openpic_set_k2_cascade(int irq);
 
 extern inline int openpic_to_irq(int irq)
 {
@@ -64,5 +65,25 @@
 		return 0;
 	}
 }
-/*extern int open_pic_irq_offset;*/
+/* Support for second openpic on G5 macs */
+
+// FIXME: To be replaced by sane cascaded controller management */
+
+#define PMAC_OPENPIC2_OFFSET	128
+
+#define OPENPIC2_VEC_TIMER	110	/* and up */
+#define OPENPIC2_VEC_IPI	118	/* and up */
+#define OPENPIC2_VEC_SPURIOUS	127
+
+
+extern void* OpenPIC2_Addr;
+
+/* Exported functions */
+extern void openpic2_set_sources(int first_irq, int num_irqs, void *isr);
+extern void openpic2_init(int linux_irq_offset);
+extern void openpic2_init_nmi_irq(u_int irq);
+extern u_int openpic2_irq(void);
+extern void openpic2_eoi(void);
+extern int openpic2_get_irq(struct pt_regs *regs);
+extern void openpic2_setup_ISU(int isu_num, unsigned long addr);
 #endif /* _PPC_KERNEL_OPEN_PIC_H */
--- diff/include/asm-ppc/param.h	2003-01-13 14:18:15.000000000 +0000
+++ source/include/asm-ppc/param.h	2004-02-09 10:39:57.000000000 +0000
@@ -1,22 +1,18 @@
 #ifndef _ASM_PPC_PARAM_H
 #define _ASM_PPC_PARAM_H
 
-#ifndef HZ
-#define HZ 100
-#endif
-
 #ifdef __KERNEL__
-#define HZ		100		/* internal timer frequency */
+#define HZ		1000		/* internal timer frequency */
 #define USER_HZ		100		/* for user interfaces in "ticks" */
 #define CLOCKS_PER_SEC	(USER_HZ)	/* frequency at which times() counts */
 #endif /* __KERNEL__ */
 
-#define EXEC_PAGESIZE	4096
-
-#ifndef NGROUPS
-#define NGROUPS		32
+#ifndef HZ
+#define HZ 100
 #endif
 
+#define EXEC_PAGESIZE	4096
+
 #ifndef NOGROUP
 #define NOGROUP		(-1)
 #endif
--- diff/include/asm-ppc/pci.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/asm-ppc/pci.h	2004-02-09 10:39:57.000000000 +0000
@@ -26,6 +26,7 @@
 extern int pci_assign_all_busses;
 
 #define pcibios_assign_all_busses()	(pci_assign_all_busses)
+#define pcibios_scan_all_fns(a, b)	0
 
 #define PCIBIOS_MIN_IO		0x1000
 #define PCIBIOS_MIN_MEM		0x10000000
--- diff/include/asm-ppc/pgtable.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/asm-ppc/pgtable.h	2004-02-09 10:39:57.000000000 +0000
@@ -511,9 +511,21 @@
 #endif
 }
 
+extern void flush_hash_one_pte(pte_t *ptep);
+
+/*
+ * 2.6 calles this without flushing the TLB entry, this is wrong
+ * for our hash-based implementation, we fix that up here
+ */
 static inline int ptep_test_and_clear_young(pte_t *ptep)
 {
-	return (pte_update(ptep, _PAGE_ACCESSED, 0) & _PAGE_ACCESSED) != 0;
+	unsigned long old;
+	old = (pte_update(ptep, _PAGE_ACCESSED, 0) & _PAGE_ACCESSED);
+#if _PAGE_HASHPTE != 0
+	if (old & _PAGE_HASHPTE)
+		flush_hash_one_pte(ptep);
+#endif
+	return old != 0;
 }
 
 static inline int ptep_test_and_clear_dirty(pte_t *ptep)
@@ -626,7 +638,7 @@
 extern void cache_push(__u32 addr, int length);
 extern int mm_end_of_chunk (unsigned long addr, int len);
 extern unsigned long iopa(unsigned long addr);
-extern unsigned long mm_ptov(unsigned long addr) __attribute__ ((const));
+extern unsigned long mm_ptov(unsigned long addr) __attribute_const__;
 
 /* Values for nocacheflag and cmode */
 /* These are not used by the APUS kernel_map, but prevents
--- diff/include/asm-ppc/pmac_feature.h	2003-09-30 15:46:19.000000000 +0100
+++ source/include/asm-ppc/pmac_feature.h	2004-02-09 10:39:57.000000000 +0000
@@ -112,6 +112,10 @@
  */
 #define PMAC_TYPE_UNKNOWN_INTREPID	0x11f	/* Generic */
 
+/* MacRISC4 / G5 machines
+ */
+#define PMAC_TYPE_POWERMAC_G5		0x150	/* First tower */
+
 /*
  * Motherboard flags
  */
@@ -131,8 +135,8 @@
  */
 struct device_node;
 
-static inline int pmac_call_feature(int selector, struct device_node* node,
-					int param, int value)
+static inline long pmac_call_feature(int selector, struct device_node* node,
+					long param, long value)
 {
 	if (!ppc_md.feature_call)
 		return -ENODEV;
@@ -262,9 +266,15 @@
  */
 #define PMAC_FTR_WRITE_GPIO		PMAC_FTR_DEF(18)
 
+/* PMAC_FTR_ENABLE_MPIC
+ *
+ * Enable the MPIC cell
+ */
+#define PMAC_FTR_ENABLE_MPIC		PMAC_FTR_DEF(19)
+
 
 /* Don't use those directly, they are for the sake of pmac_setup.c */
-extern int pmac_do_feature_call(unsigned int selector, ...);
+extern long pmac_do_feature_call(unsigned int selector, ...);
 extern void pmac_feature_init(void);
 
 #define PMAC_FTR_DEF(x) ((_MACH_Pmac << 16) | (x))
@@ -289,6 +299,7 @@
 	macio_keylargo,
 	macio_pangea,
 	macio_intrepid,
+	macio_keylargo2,
 };
 
 struct macio_chip
--- diff/include/asm-ppc/reg.h	2003-10-27 09:20:39.000000000 +0000
+++ source/include/asm-ppc/reg.h	2004-02-09 10:39:57.000000000 +0000
@@ -91,6 +91,7 @@
 #define SPRN_TBRU	0x10D	/* Time Base Read Upper Register (user, R/O) */
 #define SPRN_TBWL	0x11C	/* Time Base Lower Register (super, R/W) */
 #define SPRN_TBWU	0x11D	/* Time Base Upper Register (super, R/W) */
+#define SPRN_HIOR	0x137	/* 970 Hypervisor interrupt offset */
 #define SPRN_DBAT0L	0x219	/* Data BAT 0 Lower Register */
 #define SPRN_DBAT0U	0x218	/* Data BAT 0 Upper Register */
 #define SPRN_DBAT1L	0x21B	/* Data BAT 1 Lower Register */
@@ -179,7 +180,10 @@
 #define HID1_PC3	(1<<13)		/* 7450 PLL_CFG[3] */
 #define HID1_SYNCBE	(1<<11)		/* 7450 ABE for sync, eieio */
 #define HID1_ABE	(1<<10)		/* 7450 Address Broadcast Enable */
+#define SPRN_HID2	0x3F8		/* Hardware Implementation Register 2 */
 #define SPRN_IABR	0x3F2	/* Instruction Address Breakpoint Register */
+#define SPRN_HID4	0x3F4		/* 970 HID4 */
+#define SPRN_HID5	0x3F6		/* 970 HID5 */
 #if !defined(SPRN_IAC1) && !defined(SPRN_IAC2)
 #define SPRN_IAC1	0x3F4		/* Instruction Address Compare 1 */
 #define SPRN_IAC2	0x3F5		/* Instruction Address Compare 2 */
--- diff/include/asm-ppc/uninorth.h	2003-09-30 15:46:19.000000000 +0100
+++ source/include/asm-ppc/uninorth.h	2004-02-09 10:39:57.000000000 +0000
@@ -1,6 +1,8 @@
 /*
  * uninorth.h: definitions for using the "UniNorth" host bridge chip
  *             from Apple. This chip is used on "Core99" machines
+ *	       This also includes U2 used on more recent MacRISC2/3
+ *             machines and U3 (G5) 
  *
  */
 #ifdef __KERNEL__
@@ -8,23 +10,26 @@
 #define __ASM_UNINORTH_H__
 
 /*
- * Uni-N config space reg. definitions
+ * Uni-N and U3 config space reg. definitions
  *
  * (Little endian)
  */
 
 /* Address ranges selection. This one should work with Bandit too */
+/* Not U3 */
 #define UNI_N_ADDR_SELECT		0x48
 #define UNI_N_ADDR_COARSE_MASK		0xffff0000	/* 256Mb regions at *0000000 */
 #define UNI_N_ADDR_FINE_MASK		0x0000ffff	/*  16Mb regions at f*000000 */
 
 /* AGP registers */
+/* Not U3 */
 #define UNI_N_CFG_GART_BASE		0x8c
 #define UNI_N_CFG_AGP_BASE		0x90
 #define UNI_N_CFG_GART_CTRL		0x94
 #define UNI_N_CFG_INTERNAL_STATUS	0x98
 
 /* UNI_N_CFG_GART_CTRL bits definitions */
+/* Not U3 */
 #define UNI_N_CFG_GART_INVAL		0x00000001
 #define UNI_N_CFG_GART_ENABLE		0x00000100
 #define UNI_N_CFG_GART_2xRESET		0x00010000
@@ -90,6 +95,14 @@
 /* Version of the UniNorth chip */
 #define UNI_N_VERSION			0x0000		/* Known versions: 3,7 and 8 */
 
+#define UNI_N_VERSION_107		0x0003		/* 1.0.7 */
+#define UNI_N_VERSION_10A		0x0007		/* 1.0.10 */
+#define UNI_N_VERSION_150		0x0011		/* 1.5 */
+#define UNI_N_VERSION_200		0x0024		/* 2.0 */
+#define UNI_N_VERSION_PANGEA		0x00C0		/* Integrated U1 + K */
+#define UNI_N_VERSION_INTREPID		0x00D2		/* Integrated U2 + K */
+#define UNI_N_VERSION_300		0x0030		/* 3.0 (U3 on G5) */
+
 /* This register is used to enable/disable various clocks */
 #define UNI_N_CLOCK_CNTL		0x0020
 #define UNI_N_CLOCK_CNTL_PCI		0x00000001	/* PCI2 clock control */
@@ -131,5 +144,26 @@
 
 /* Uninorth 1.5 rev. has additional perf. monitor registers at 0xf00-0xf50 */
 
+
+/*
+ * U3 specific registers
+ */
+
+
+/* U3 Toggle */
+#define U3_TOGGLE_REG			0x00e0
+#define U3_PMC_START_STOP		0x0001
+#define U3_MPIC_RESET			0x0002
+#define U3_MPIC_OUTPUT_ENABLE		0x0004
+
+/* U3 API PHY Config 1 */
+#define U3_API_PHY_CONFIG_1		0x23030
+
+/* U3 HyperTransport registers */
+#define U3_HT_CONFIG_BASE      		0x70000
+#define U3_HT_LINK_COMMAND		0x100
+#define U3_HT_LINK_CONFIG		0x110
+#define U3_HT_LINK_FREQ			0x120
+
 #endif /* __ASM_UNINORTH_H__ */
 #endif /* __KERNEL__ */
--- diff/include/asm-ppc64/compat.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/asm-ppc64/compat.h	2004-02-09 10:39:57.000000000 +0000
@@ -25,6 +25,7 @@
 typedef s32		compat_daddr_t;
 typedef u32		compat_caddr_t;
 typedef __kernel_fsid_t	compat_fsid_t;
+typedef u32		compat_timer_t;
 
 typedef s32		compat_int_t;
 typedef s32		compat_long_t;
--- diff/include/asm-ppc64/hardirq.h	2003-10-27 09:20:39.000000000 +0000
+++ source/include/asm-ppc64/hardirq.h	2004-02-09 10:39:57.000000000 +0000
@@ -80,7 +80,7 @@
 
 #define irq_enter()		(preempt_count() += HARDIRQ_OFFSET)
 
-#ifdef CONFIG_PREEMPT
+#if defined(CONFIG_PREEMPT) || defined(CONFIG_DEBUG_SPINLOCK_SLEEP)
 # define in_atomic()	((preempt_count() & ~PREEMPT_ACTIVE) != kernel_locked())
 # define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1)
 #else
--- diff/include/asm-ppc64/hvcall.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/asm-ppc64/hvcall.h	2004-02-09 10:39:57.000000000 +0000
@@ -102,6 +102,8 @@
 		 unsigned long *out2,
 		 unsigned long *out3);
 
+#define HVSC			".long 0x44000022\n"
+
 /* Same as plpar_hcall but for those opcodes that return no values
  * other than status.  Slightly more efficient.
  */
--- diff/include/asm-ppc64/iSeries/vio.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/asm-ppc64/iSeries/vio.h	2004-02-09 10:39:57.000000000 +0000
@@ -49,7 +49,7 @@
  * in.  We use a table to route these, and this defines
  * the maximum number of distinct subtypes
  */
-#define VIO_MAX_SUBTYPES 7
+#define VIO_MAX_SUBTYPES 8
 
 /* Each subtype can register a handler to process their events.
  * The handler must have this interface.
@@ -103,7 +103,8 @@
 	viomajorsubtype_chario = 0x0300,
 	viomajorsubtype_config = 0x0400,
 	viomajorsubtype_cdio = 0x0500,
-	viomajorsubtype_tape = 0x0600
+	viomajorsubtype_tape = 0x0600,
+	viomajorsubtype_scsi = 0x0700
 };
 
 
--- diff/include/asm-ppc64/io.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/asm-ppc64/io.h	2004-02-09 10:39:57.000000000 +0000
@@ -79,6 +79,10 @@
 #define outsl(port, buf, nl)	_outsl_ns((u32 *)((port)+pci_io_base), (buf), (nl))
 #endif
 
+#define readb_relaxed(addr) readb(addr)
+#define readw_relaxed(addr) readw(addr)
+#define readl_relaxed(addr) readl(addr)
+
 extern void _insb(volatile u8 *port, void *buf, int ns);
 extern void _outsb(volatile u8 *port, const void *buf, int ns);
 extern void _insw(volatile u16 *port, void *buf, int ns);
--- diff/include/asm-ppc64/mmu_context.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/asm-ppc64/mmu_context.h	2004-02-09 10:39:57.000000000 +0000
@@ -156,6 +156,8 @@
 	 : : );
 #endif /* CONFIG_ALTIVEC */
 
+	cpu_set(smp_processor_id(), next->cpu_vm_mask);
+
 	/* No need to flush userspace segments if the mm doesnt change */
 	if (prev == next)
 		return;
@@ -164,7 +166,6 @@
 		flush_slb(tsk, next);
 	else
 		flush_stab(tsk, next);
-	cpu_set(smp_processor_id(), next->cpu_vm_mask);
 }
 
 #define deactivate_mm(tsk,mm)	do { } while (0)
--- diff/include/asm-ppc64/mmzone.h	2003-09-30 15:46:19.000000000 +0100
+++ source/include/asm-ppc64/mmzone.h	2004-02-09 10:39:57.000000000 +0000
@@ -72,11 +72,8 @@
 #define local_mapnr(kvaddr) \
 	( (__pa(kvaddr) >> PAGE_SHIFT) - node_start_pfn(kvaddr_to_nid(kvaddr)) 
 
-#if 0
-/* XXX fix - Anton */
-#define kern_addr_valid(kaddr)	test_bit(local_mapnr(kaddr), \
-		 NODE_DATA(kvaddr_to_nid(kaddr))->valid_addr_bitmap)
-#endif
+/* XXX fix - Anton - and wli */
+#define kern_addr_valid(kaddr)	(0)
 
 /* Written this way to avoid evaluating arguments twice */
 #define discontigmem_pfn_to_page(pfn) \
--- diff/include/asm-ppc64/paca.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/asm-ppc64/paca.h	2004-02-09 10:39:57.000000000 +0000
@@ -64,14 +64,13 @@
         u16 xHwProcNum;                 /* Physical processor number            0x1A */
 	u32 default_decr;		/* Default decrementer value		0x1c */	
 	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 */
+	u8 resv1[38];			/*					0x61-0x7F */
 
 /*=====================================================================================
  * CACHE_LINE_2 0x0080 - 0x00FF
--- diff/include/asm-ppc64/param.h	2002-10-16 04:29:02.000000000 +0100
+++ source/include/asm-ppc64/param.h	2004-02-09 10:39:57.000000000 +0000
@@ -20,10 +20,6 @@
 
 #define EXEC_PAGESIZE	4096
 
-#ifndef NGROUPS
-#define NGROUPS		32
-#endif
-
 #ifndef NOGROUP
 #define NOGROUP		(-1)
 #endif
--- diff/include/asm-ppc64/pci.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/asm-ppc64/pci.h	2004-02-09 10:39:57.000000000 +0000
@@ -19,6 +19,14 @@
 #define PCIBIOS_MIN_IO		0x1000
 #define PCIBIOS_MIN_MEM		0x10000000
 
+extern int pcibios_scan_all_fns(struct pci_bus *bus, int devfn);
+
+#ifdef CONFIG_PPC_ISERIES
+#define pcibios_scan_all_fns(a, b)	0
+#else
+extern int pcibios_scan_all_fns(struct pci_bus *bus, int devfn);
+#endif
+
 static inline void pcibios_set_master(struct pci_dev *dev)
 {
 	/* No special bus mastering setup handling */
--- diff/include/asm-ppc64/ppc32.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/asm-ppc64/ppc32.h	2004-02-09 10:39:57.000000000 +0000
@@ -2,6 +2,7 @@
 #define _PPC64_PPC32_H
 
 #include <linux/compat.h>
+#include <linux/compat_siginfo.h>
 #include <asm/siginfo.h>
 #include <asm/signal.h>
 
@@ -40,55 +41,6 @@
 
 /* These are here to support 32-bit syscalls on a 64-bit kernel. */
 
-typedef struct compat_siginfo {
-	int si_signo;
-	int si_errno;
-	int si_code;
-
-	union {
-		int _pad[SI_PAD_SIZE32];
-
-		/* kill() */
-		struct {
-			compat_pid_t _pid;		/* sender's pid */
-			compat_uid_t _uid;		/* sender's uid */
-		} _kill;
-
-		/* POSIX.1b timers */
-		struct {
-			unsigned int _timer1;
-			unsigned int _timer2;
-		} _timer;
-
-		/* POSIX.1b signals */
-		struct {
-			compat_pid_t _pid;		/* sender's pid */
-			compat_uid_t _uid;		/* sender's uid */
-			compat_sigval_t _sigval;
-		} _rt;
-
-		/* SIGCHLD */
-		struct {
-			compat_pid_t _pid;		/* which child */
-			compat_uid_t _uid;		/* sender's uid */
-			int _status;			/* exit code */
-			compat_clock_t _utime;
-			compat_clock_t _stime;
-		} _sigchld;
-
-		/* SIGILL, SIGFPE, SIGSEGV, SIGBUS, SIGEMT */
-		struct {
-			unsigned int _addr; /* faulting insn/memory ref. */
-		} _sigfault;
-
-		/* SIGPOLL */
-		struct {
-			int _band;	/* POLL_IN, POLL_OUT, POLL_MSG */
-			int _fd;
-		} _sigpoll;
-	} _sifields;
-} compat_siginfo_t;
-
 #define __old_sigaction32	old_sigaction32
 
 struct __old_sigaction32 {
@@ -141,20 +93,6 @@
 	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;
 	int msgtyp;
--- diff/include/asm-ppc64/topology.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/asm-ppc64/topology.h	2004-02-09 10:39:57.000000000 +0000
@@ -19,8 +19,6 @@
 	return node;
 }
 
-#define memblk_to_node(memblk)	(memblk)
-
 #define parent_node(node)	(node)
 
 static inline cpumask_t node_to_cpumask(int node)
@@ -35,8 +33,6 @@
 	return first_cpu(tmp);
 }
 
-#define node_to_memblk(node)	(node)
-
 #define pcibus_to_cpumask(bus)	(cpu_online_map)
 
 #define nr_cpus_node(node)	(nr_cpus_in_node[node])
--- diff/include/asm-ppc64/vio.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/asm-ppc64/vio.h	2004-02-09 10:39:57.000000000 +0000
@@ -16,6 +16,7 @@
 
 #include <linux/init.h>
 #include <linux/errno.h>
+#include <linux/device.h>
 #include <asm/hvcall.h>
 #include <asm/prom.h>
 #include <asm/scatterlist.h>
@@ -40,11 +41,11 @@
 struct TceTable;
 
 int vio_register_driver(struct vio_driver *drv);
-int vio_unregister_driver(struct vio_driver *drv);
+void 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);
+void __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);
@@ -64,11 +65,11 @@
 void vio_free_consistent(struct vio_dev *dev, size_t size, void *vaddr, 
 			 dma_addr_t dma_handle);
 
+extern struct bus_type vio_bus_type;
+
 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 {
@@ -76,55 +77,33 @@
 	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) */
+	int (*remove) (struct vio_dev *dev);	/* Device removed (NULL if not a hot-plug capable driver) */
 	unsigned long driver_data;
+
+	struct device_driver driver;
 };
 
-struct vio_bus;
+static inline struct vio_driver *to_vio_driver(struct device_driver *drv)
+{
+	return container_of(drv, struct vio_driver, driver);
+}
+
 /*
  * 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 */
+	struct device_node *archdata;   /* Open Firmware node */
 	void *driver_data;              /* data private to the driver */
 	unsigned long unit_address;	
-
-	struct TceTable *tce_table; /* vio_map_* uses this */
+	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 */
+	struct device dev;
 };
 
-
-static inline int vio_module_init(struct vio_driver *drv)
+static inline struct vio_dev *to_vio_dev(struct device *dev)
 {
-        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;
+	return container_of(dev, struct vio_dev, dev);
 }
 
 #endif /* _PHYP_H */
--- diff/include/asm-s390/io.h	2003-05-21 11:50:10.000000000 +0100
+++ source/include/asm-s390/io.h	2004-02-09 10:39:57.000000000 +0000
@@ -87,6 +87,10 @@
 #define readw(addr) (*(volatile unsigned short *) __io_virt(addr))
 #define readl(addr) (*(volatile unsigned int *) __io_virt(addr))
 
+#define readb_relaxed(addr) readb(addr)
+#define readw_relaxed(addr) readw(addr)
+#define readl_relaxed(addr) readl(addr)
+
 #define writeb(b,addr) (*(volatile unsigned char *) __io_virt(addr) = (b))
 #define writew(b,addr) (*(volatile unsigned short *) __io_virt(addr) = (b))
 #define writel(b,addr) (*(volatile unsigned int *) __io_virt(addr) = (b))
--- diff/include/asm-s390/param.h	2002-10-16 04:27:14.000000000 +0100
+++ source/include/asm-s390/param.h	2004-02-09 10:39:57.000000000 +0000
@@ -21,10 +21,6 @@
 
 #define EXEC_PAGESIZE	4096
 
-#ifndef NGROUPS
-#define NGROUPS		32
-#endif
-
 #ifndef NOGROUP
 #define NOGROUP		(-1)
 #endif
--- diff/include/asm-sh/io.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/asm-sh/io.h	2004-02-09 10:39:57.000000000 +0000
@@ -130,6 +130,10 @@
 # define writel(v,a)	({ __raw_writel((v),(unsigned long)(a)); mb(); })
 #endif
 
+#define readb_relaxed(a) readb(a)
+#define readw_relaxed(a) readw(a)
+#define readl_relaxed(a) readl(a)
+
 /*
  * If the platform has PC-like I/O, this function converts the offset into
  * an address.
--- diff/include/asm-sh/param.h	2003-07-08 09:55:19.000000000 +0100
+++ source/include/asm-sh/param.h	2004-02-09 10:39:57.000000000 +0000
@@ -17,10 +17,6 @@
 
 #define EXEC_PAGESIZE	4096
 
-#ifndef NGROUPS
-#define NGROUPS		32
-#endif
-
 #ifndef NOGROUP
 #define NOGROUP		(-1)
 #endif
--- diff/include/asm-sh/pci.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/asm-sh/pci.h	2004-02-09 10:39:57.000000000 +0000
@@ -12,6 +12,7 @@
    or architectures with incomplete PCI setup by the loader */
 
 #define pcibios_assign_all_busses()	1
+#define pcibios_scan_all_fns(a, b)	0
 
 /*
  * A board can define one or more PCI channels that represent built-in (or
--- diff/include/asm-sparc/btfixup.h	2002-10-16 04:28:20.000000000 +0100
+++ source/include/asm-sparc/btfixup.h	2004-02-09 10:39:57.000000000 +0000
@@ -39,7 +39,7 @@
 	extern __type ___f_##__name(__args);						\
 	extern unsigned ___fs_##__name[3];
 #define BTFIXUPDEF_CALL_CONST(__type, __name, __args...) 				\
-	extern __type ___f_##__name(__args) __attribute__((const));			\
+	extern __type ___f_##__name(__args) __attribute_const__;			\
 	extern unsigned ___fs_##__name[3];
 #define BTFIXUP_CALL(__name) ___f_##__name
 
@@ -49,7 +49,7 @@
 /* Put bottom 13bits into some register variable */
 
 #define BTFIXUPDEF_SIMM13(__name)							\
-	extern unsigned int ___sf_##__name(void) __attribute__((const));		\
+	extern unsigned int ___sf_##__name(void) __attribute_const__;		\
 	extern unsigned ___ss_##__name[2];						\
 	extern __inline__ unsigned int ___sf_##__name(void) {				\
 		unsigned int ret;							\
@@ -57,7 +57,7 @@
 		return ret;								\
 	}
 #define BTFIXUPDEF_SIMM13_INIT(__name,__val)						\
-	extern unsigned int ___sf_##__name(void) __attribute__((const));		\
+	extern unsigned int ___sf_##__name(void) __attribute_const__;		\
 	extern unsigned ___ss_##__name[2];						\
 	extern __inline__ unsigned int ___sf_##__name(void) {				\
 		unsigned int ret;							\
@@ -71,7 +71,7 @@
  */
 
 #define BTFIXUPDEF_HALF(__name)								\
-	extern unsigned int ___af_##__name(void) __attribute__((const));		\
+	extern unsigned int ___af_##__name(void) __attribute_const__;		\
 	extern unsigned ___as_##__name[2];						\
 	extern __inline__ unsigned int ___af_##__name(void) {				\
 		unsigned int ret;							\
@@ -79,7 +79,7 @@
 		return ret;								\
 	}
 #define BTFIXUPDEF_HALF_INIT(__name,__val)						\
-	extern unsigned int ___af_##__name(void) __attribute__((const));		\
+	extern unsigned int ___af_##__name(void) __attribute_const__;		\
 	extern unsigned ___as_##__name[2];						\
 	extern __inline__ unsigned int ___af_##__name(void) {				\
 		unsigned int ret;							\
@@ -90,7 +90,7 @@
 /* Put upper 22 bits into some register variable */
 
 #define BTFIXUPDEF_SETHI(__name)							\
-	extern unsigned int ___hf_##__name(void) __attribute__((const));		\
+	extern unsigned int ___hf_##__name(void) __attribute_const__;		\
 	extern unsigned ___hs_##__name[2];						\
 	extern __inline__ unsigned int ___hf_##__name(void) {				\
 		unsigned int ret;							\
@@ -98,7 +98,7 @@
 		return ret;								\
 	}
 #define BTFIXUPDEF_SETHI_INIT(__name,__val)						\
-	extern unsigned int ___hf_##__name(void) __attribute__((const));		\
+	extern unsigned int ___hf_##__name(void) __attribute_const__;		\
 	extern unsigned ___hs_##__name[2];						\
 	extern __inline__ unsigned int ___hf_##__name(void) {				\
 		unsigned int ret;							\
--- diff/include/asm-sparc/io.h	2003-10-27 09:20:39.000000000 +0000
+++ source/include/asm-sparc/io.h	2004-02-09 10:39:57.000000000 +0000
@@ -99,6 +99,9 @@
 #define readb(addr)	__readb((unsigned long)(addr))
 #define readw(addr)	__readw((unsigned long)(addr))
 #define readl(addr)	__readl((unsigned long)(addr))
+#define readb_relaxed(addr) readb(addr)
+#define readw_relaxed(addr) readw(addr)
+#define readl_relaxed(addr) readl(addr)
 
 #define writeb(b, addr)	__writeb((b),(unsigned long)(addr))
 #define writew(b, addr)	__writew((b),(unsigned long)(addr))
--- diff/include/asm-sparc/param.h	2002-10-16 04:27:19.000000000 +0100
+++ source/include/asm-sparc/param.h	2004-02-09 10:39:57.000000000 +0000
@@ -14,10 +14,6 @@
 
 #define EXEC_PAGESIZE	8192    /* Thanks for sun4's we carry baggage... */
 
-#ifndef NGROUPS
-#define NGROUPS		32
-#endif
-
 #ifndef NOGROUP
 #define NOGROUP		(-1)
 #endif
--- diff/include/asm-sparc/pci.h	2003-09-17 12:28:12.000000000 +0100
+++ source/include/asm-sparc/pci.h	2004-02-09 10:39:57.000000000 +0000
@@ -8,6 +8,7 @@
  * or architectures with incomplete PCI setup by the loader.
  */
 #define pcibios_assign_all_busses()	0
+#define pcibios_scan_all_fns(a, b)	0
 
 #define PCIBIOS_MIN_IO		0UL
 #define PCIBIOS_MIN_MEM		0UL
--- diff/include/asm-sparc/pgtable.h	2003-10-09 09:47:34.000000000 +0100
+++ source/include/asm-sparc/pgtable.h	2004-02-09 10:39:57.000000000 +0000
@@ -80,7 +80,7 @@
 BTFIXUPDEF_SETHI(pmd_size)
 BTFIXUPDEF_SETHI(pmd_mask)
 
-extern unsigned int pmd_align(unsigned int addr) __attribute__((const));
+extern unsigned int pmd_align(unsigned int addr) __attribute_const__;
 extern __inline__ unsigned int pmd_align(unsigned int addr)
 {
 	return ((addr + ~BTFIXUP_SETHI(pmd_mask)) & BTFIXUP_SETHI(pmd_mask));
@@ -90,7 +90,7 @@
 BTFIXUPDEF_SETHI(pgdir_size)
 BTFIXUPDEF_SETHI(pgdir_mask)
 
-extern unsigned int pgdir_align(unsigned int addr) __attribute__((const));
+extern unsigned int pgdir_align(unsigned int addr) __attribute_const__;
 extern __inline__ unsigned int pgdir_align(unsigned int addr)
 {
 	return ((addr + ~BTFIXUP_SETHI(pgdir_mask)) & BTFIXUP_SETHI(pgdir_mask));
@@ -248,19 +248,19 @@
 BTFIXUPDEF_HALF(pte_dirtyi)
 BTFIXUPDEF_HALF(pte_youngi)
 
-extern int pte_write(pte_t pte) __attribute__((const));
+extern int pte_write(pte_t pte) __attribute_const__;
 extern __inline__ int pte_write(pte_t pte)
 {
 	return pte_val(pte) & BTFIXUP_HALF(pte_writei);
 }
 
-extern int pte_dirty(pte_t pte) __attribute__((const));
+extern int pte_dirty(pte_t pte) __attribute_const__;
 extern __inline__ int pte_dirty(pte_t pte)
 {
 	return pte_val(pte) & BTFIXUP_HALF(pte_dirtyi);
 }
 
-extern int pte_young(pte_t pte) __attribute__((const));
+extern int pte_young(pte_t pte) __attribute_const__;
 extern __inline__ int pte_young(pte_t pte)
 {
 	return pte_val(pte) & BTFIXUP_HALF(pte_youngi);
@@ -271,7 +271,7 @@
  */
 BTFIXUPDEF_HALF(pte_filei)
 
-extern int pte_file(pte_t pte) __attribute__((const));
+extern int pte_file(pte_t pte) __attribute_const__;
 extern __inline__ int pte_file(pte_t pte)
 {
 	return pte_val(pte) & BTFIXUP_HALF(pte_filei);
@@ -283,19 +283,19 @@
 BTFIXUPDEF_HALF(pte_mkcleani)
 BTFIXUPDEF_HALF(pte_mkoldi)
 
-extern pte_t pte_wrprotect(pte_t pte) __attribute__((const));
+extern pte_t pte_wrprotect(pte_t pte) __attribute_const__;
 extern __inline__ pte_t pte_wrprotect(pte_t pte)
 {
 	return __pte(pte_val(pte) & ~BTFIXUP_HALF(pte_wrprotecti));
 }
 
-extern pte_t pte_mkclean(pte_t pte) __attribute__((const));
+extern pte_t pte_mkclean(pte_t pte) __attribute_const__;
 extern __inline__ pte_t pte_mkclean(pte_t pte)
 {
 	return __pte(pte_val(pte) & ~BTFIXUP_HALF(pte_mkcleani));
 }
 
-extern pte_t pte_mkold(pte_t pte) __attribute__((const));
+extern pte_t pte_mkold(pte_t pte) __attribute_const__;
 extern __inline__ pte_t pte_mkold(pte_t pte)
 {
 	return __pte(pte_val(pte) & ~BTFIXUP_HALF(pte_mkoldi));
@@ -332,7 +332,7 @@
 
 BTFIXUPDEF_INT(pte_modify_mask)
 
-extern pte_t pte_modify(pte_t pte, pgprot_t newprot) __attribute__((const));
+extern pte_t pte_modify(pte_t pte, pgprot_t newprot) __attribute_const__;
 extern __inline__ pte_t pte_modify(pte_t pte, pgprot_t newprot)
 {
 	return __pte((pte_val(pte) & BTFIXUP_INT(pte_modify_mask)) |
--- diff/include/asm-sparc64/io.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/asm-sparc64/io.h	2004-02-09 10:39:57.000000000 +0000
@@ -176,6 +176,10 @@
 #define readw(__addr)		(_readw((unsigned long)(__addr)))
 #define readl(__addr)		(_readl((unsigned long)(__addr)))
 #define readq(__addr)		(_readq((unsigned long)(__addr)))
+#define readb_relaxed(a)	readb(a)
+#define readw_relaxed(a)	readw(a)
+#define readl_relaxed(a)	readl(a)
+#define readq_relaxed(a)	readq(a)
 #define writeb(__b, __addr)	(_writeb((u8)(__b), (unsigned long)(__addr)))
 #define writew(__w, __addr)	(_writew((u16)(__w), (unsigned long)(__addr)))
 #define writel(__l, __addr)	(_writel((u32)(__l), (unsigned long)(__addr)))
--- diff/include/asm-sparc64/param.h	2002-10-16 04:27:09.000000000 +0100
+++ source/include/asm-sparc64/param.h	2004-02-09 10:39:57.000000000 +0000
@@ -14,10 +14,6 @@
 
 #define EXEC_PAGESIZE	8192    /* Thanks for sun4's we carry baggage... */
 
-#ifndef NGROUPS
-#define NGROUPS		32
-#endif
-
 #ifndef NOGROUP
 #define NOGROUP		(-1)
 #endif
--- diff/include/asm-sparc64/pci.h	2003-08-20 14:16:14.000000000 +0100
+++ source/include/asm-sparc64/pci.h	2004-02-09 10:39:57.000000000 +0000
@@ -11,6 +11,7 @@
  * or architectures with incomplete PCI setup by the loader.
  */
 #define pcibios_assign_all_busses()	0
+#define pcibios_scan_all_fns(a, b)	0
 
 #define PCIBIOS_MIN_IO		0UL
 #define PCIBIOS_MIN_MEM		0UL
--- diff/include/asm-sparc64/spinlock.h	2003-11-25 15:24:59.000000000 +0000
+++ source/include/asm-sparc64/spinlock.h	2004-02-09 10:39:57.000000000 +0000
@@ -30,15 +30,23 @@
 
 #ifndef CONFIG_DEBUG_SPINLOCK
 
-typedef unsigned char spinlock_t;
-#define SPIN_LOCK_UNLOCKED	0
+typedef struct {
+	unsigned char lock;
+	unsigned int  index;
+} spinlock_t;
 
-#define spin_lock_init(lock)	(*((unsigned char *)(lock)) = 0)
-#define spin_is_locked(lock)	(*((volatile unsigned char *)(lock)) != 0)
+#ifdef CONFIG_LOCKMETER
+#define SPIN_LOCK_UNLOCKED	(spinlock_t) {0, 0}
+#else
+#define SPIN_LOCK_UNLOCKED	(spinlock_t) { 0 }
+#endif
 
-#define spin_unlock_wait(lock)	\
+#define spin_lock_init(__lock)	do { *(__lock) = SPIN_LOCK_UNLOCKED; } while(0)
+#define spin_is_locked(__lock)	(*((volatile unsigned char *)(&((__lock)->lock))) != 0)
+
+#define spin_unlock_wait(__lock)	\
 do {	membar("#LoadLoad");	\
-} while(*((volatile unsigned char *)lock))
+} while(*((volatile unsigned char *)(&(((spinlock_t *)__lock)->lock))))
 
 static __inline__ void _raw_spin_lock(spinlock_t *lock)
 {
@@ -109,17 +117,31 @@
 
 #ifndef CONFIG_DEBUG_SPINLOCK
 
-typedef unsigned int rwlock_t;
-#define RW_LOCK_UNLOCKED	0
-#define rwlock_init(lp) do { *(lp) = RW_LOCK_UNLOCKED; } while(0)
-#define rwlock_is_locked(x) (*(x) != RW_LOCK_UNLOCKED)
+#ifdef CONFIG_LOCKMETER
+typedef struct {
+	unsigned int lock;
+	unsigned int index;
+	unsigned int cpu;
+} rwlock_t;
+#define RW_LOCK_UNLOCKED       (rwlock_t) { 0, 0, 0xff }
+#else
+typedef struct {
+	unsigned int lock;
+} rwlock_t;
+#define RW_LOCK_UNLOCKED        (rwlock_t) { 0 }
+#endif
+
+#define rwlock_init(lp)		do { *(lp) = RW_LOCK_UNLOCKED; } while(0)
+#define rwlock_is_locked(x)	((x)->lock != 0)
 
+extern int __read_trylock(rwlock_t *);
 extern void __read_lock(rwlock_t *);
 extern void __read_unlock(rwlock_t *);
 extern void __write_lock(rwlock_t *);
 extern void __write_unlock(rwlock_t *);
 extern int __write_trylock(rwlock_t *);
 
+#define _raw_read_trylock(p)	__read_trylock(p)
 #define _raw_read_lock(p)	__read_lock(p)
 #define _raw_read_unlock(p)	__read_unlock(p)
 #define _raw_write_lock(p)	__write_lock(p)
--- diff/include/asm-um/archparam-i386.h	2003-10-09 09:47:17.000000000 +0100
+++ source/include/asm-um/archparam-i386.h	2004-02-09 10:39:57.000000000 +0000
@@ -1,5 +1,5 @@
 /* 
- * Copyright (C) 2000, 2001 Jeff Dike (jdike@karaya.com)
+ * Copyright (C) 2000 - 2003 Jeff Dike (jdike@addtoit.com)
  * Licensed under the GPL
  */
 
@@ -56,6 +56,65 @@
 	pr_reg[16] = PT_REGS_SS(regs);		\
 } while(0);
 
+#define VSYSCALL_BASE	(__fix_to_virt(FIX_VSYSCALL))
+#define VSYSCALL_EHDR	((const struct elfhdr *) VSYSCALL_BASE)
+#define VSYSCALL_ENTRY	((unsigned long) &__kernel_vsyscall)
+extern void *__kernel_vsyscall;
+
+/*
+ * Architecture-neutral AT_ values in 0-17, leave some room
+ * for more of them, start the x86-specific ones at 32.
+ */
+#define AT_SYSINFO		32
+#define AT_SYSINFO_EHDR		33
+
+#define ARCH_DLINFO						\
+do {								\
+		NEW_AUX_ENT(AT_SYSINFO,	VSYSCALL_ENTRY);	\
+		NEW_AUX_ENT(AT_SYSINFO_EHDR, VSYSCALL_BASE);	\
+} while (0)
+
+/*
+ * These macros parameterize elf_core_dump in fs/binfmt_elf.c to write out
+ * extra segments containing the vsyscall DSO contents.  Dumping its
+ * contents makes post-mortem fully interpretable later without matching up
+ * the same kernel and hardware config to see what PC values meant.
+ * Dumping its extra ELF program headers includes all the other information
+ * a debugger needs to easily find how the vsyscall DSO was being used.
+ */
+#define ELF_CORE_EXTRA_PHDRS		(VSYSCALL_EHDR->e_phnum)
+#define ELF_CORE_WRITE_EXTRA_PHDRS					      \
+do {									      \
+	const struct elf_phdr *const vsyscall_phdrs =			      \
+		(const struct elf_phdr *) (VSYSCALL_BASE		      \
+					   + VSYSCALL_EHDR->e_phoff);	      \
+	int i;								      \
+	Elf32_Off ofs = 0;						      \
+	for (i = 0; i < VSYSCALL_EHDR->e_phnum; ++i) {			      \
+		struct elf_phdr phdr = vsyscall_phdrs[i];		      \
+		if (phdr.p_type == PT_LOAD) {				      \
+			ofs = phdr.p_offset = offset;			      \
+			offset += phdr.p_filesz;			      \
+		}							      \
+		else							      \
+			phdr.p_offset += ofs;				      \
+		phdr.p_paddr = 0; /* match other core phdrs */		      \
+		DUMP_WRITE(&phdr, sizeof(phdr));			      \
+	}								      \
+} while (0)
+#define ELF_CORE_WRITE_EXTRA_DATA					      \
+do {									      \
+	const struct elf_phdr *const vsyscall_phdrs =			      \
+		(const struct elf_phdr *) (VSYSCALL_BASE		      \
+					   + VSYSCALL_EHDR->e_phoff);	      \
+	int i;								      \
+	for (i = 0; i < VSYSCALL_EHDR->e_phnum; ++i) {			      \
+		if (vsyscall_phdrs[i].p_type == PT_LOAD)		      \
+			DUMP_WRITE((void *) vsyscall_phdrs[i].p_vaddr,	      \
+				   vsyscall_phdrs[i].p_filesz);		      \
+	}								      \
+} while (0)
+
 /********* Bits for asm-um/delay.h **********/
 
 typedef unsigned long um_udelay_t;
--- diff/include/asm-um/common.lds.S	2003-10-09 09:47:17.000000000 +0100
+++ source/include/asm-um/common.lds.S	2004-02-09 10:39:57.000000000 +0000
@@ -1,3 +1,5 @@
+#include <asm-generic/vmlinux.lds.h>
+
   .fini      : { *(.fini)    } =0x9090
   _etext = .;
   PROVIDE (etext = .);
@@ -67,6 +69,10 @@
   }
   __initcall_end = .;
 
+  __con_initcall_start = .;
+  .con_initcall.init : { *(.con_initcall.init) }
+  __con_initcall_end = .;
+
   __uml_initcall_start = .;
   .uml.initcall.init : { *(.uml.initcall.init) }
   __uml_initcall_end = .;
@@ -80,7 +86,33 @@
   .uml.exitcall : { *(.uml.exitcall.exit) }
   __uml_exitcall_end = .;
 
-  . = ALIGN(4096);
+  . = ALIGN(4);
+  __alt_instructions = .;
+  .altinstructions : { *(.altinstructions) } 
+  __alt_instructions_end = .; 
+  .altinstr_replacement : { *(.altinstr_replacement) } 
+  /* .exit.text is discard at runtime, not link time, to deal with references
+     from .altinstructions and .eh_frame */
+  .exit.text : { *(.exit.text) }
+  .exit.data : { *(.exit.data) }
+ 
+  __preinit_array_start = .;
+  .preinit_array : { *(.preinit_array) }
+  __preinit_array_end = .;
+  __init_array_start = .;
+  .init_array : { *(.init_array) }
+  __init_array_end = .;
+  __fini_array_start = .;
+  .fini_array : { *(.fini_array) }
+  __fini_array_end = .;
+
+   . = ALIGN(4096);
   __initramfs_start = .;
   .init.ramfs : { *(.init.ramfs) }
   __initramfs_end = .;
+
+  /* Sections to be discarded */
+  /DISCARD/ : {
+ 	*(.exitcall.exit)
+  }
+ 
--- diff/include/asm-um/current.h	2003-10-09 09:47:17.000000000 +0100
+++ source/include/asm-um/current.h	2004-02-09 10:39:57.000000000 +0000
@@ -16,8 +16,10 @@
 #define CURRENT_THREAD(dummy) (((unsigned long) &dummy) & \
 			        (PAGE_MASK << CONFIG_KERNEL_STACK_ORDER))
 
-#define current ({ int dummy; \
-                   ((struct thread_info *) CURRENT_THREAD(dummy))->task; })
+#define current_thread \
+	({ int dummy; ((struct thread_info *) CURRENT_THREAD(dummy)); })
+
+#define current (current_thread->task)
 
 #endif /* __ASSEMBLY__ */
 
--- diff/include/asm-um/fixmap.h	2003-10-09 09:47:17.000000000 +0100
+++ source/include/asm-um/fixmap.h	2004-02-09 10:39:57.000000000 +0000
@@ -34,6 +34,7 @@
 	FIX_KMAP_BEGIN,	/* reserved pte's for temporary kernel mappings */
 	FIX_KMAP_END = FIX_KMAP_BEGIN+(KM_TYPE_NR*NR_CPUS)-1,
 #endif
+	FIX_VSYSCALL,
 	__end_of_fixed_addresses
 };
 
@@ -63,6 +64,13 @@
 #define __fix_to_virt(x)	(FIXADDR_TOP - ((x) << PAGE_SHIFT))
 #define __virt_to_fix(x)      ((FIXADDR_TOP - ((x)&PAGE_MASK)) >> PAGE_SHIFT)
 
+/*
+ * This is the range that is readable by user mode, and things
+ * acting like user mode such as get_user_pages.
+ */
+#define FIXADDR_USER_START	(__fix_to_virt(FIX_VSYSCALL))
+#define FIXADDR_USER_END	(FIXADDR_USER_START + PAGE_SIZE)
+
 extern void __this_fixmap_does_not_exist(void);
 
 /*
--- diff/include/asm-um/irq.h	2003-10-09 09:47:17.000000000 +0100
+++ source/include/asm-um/irq.h	2004-02-09 10:39:57.000000000 +0000
@@ -1,15 +1,6 @@
 #ifndef __UM_IRQ_H
 #define __UM_IRQ_H
 
-/* The i386 irq.h has a struct task_struct in a prototype without including
- * sched.h.  This forward declaration kills the resulting warning.
- */
-struct task_struct;
-
-#include "asm/ptrace.h"
-
-#undef NR_IRQS
-
 #define TIMER_IRQ		0
 #define UMN_IRQ			1
 #define CONSOLE_IRQ		2
@@ -28,8 +19,4 @@
 #define LAST_IRQ XTERM_IRQ
 #define NR_IRQS (LAST_IRQ + 1)
 
-extern int um_request_irq(unsigned int irq, int fd, int type,
-			  void (*handler)(int, void *, struct pt_regs *),
-			  unsigned long irqflags,  const char * devname,
-			  void *dev_id);
 #endif
--- diff/include/asm-um/page.h	2003-10-09 09:47:17.000000000 +0100
+++ source/include/asm-um/page.h	2004-02-09 10:39:57.000000000 +0000
@@ -1,10 +1,14 @@
+/* 
+ *  Copyright (C) 2000 - 2003 Jeff Dike (jdike@addtoit.com)
+ * Licensed under the GPL
+ */
+
 #ifndef __UM_PAGE_H
 #define __UM_PAGE_H
 
 struct page;
 
 #include "asm/arch/page.h"
-#include "asm/bug.h"
 
 #undef __pa
 #undef __va
@@ -24,25 +28,36 @@
 
 #define __va_space (8*1024*1024)
 
-extern unsigned long region_pa(void *virt);
-extern void *region_va(unsigned long phys);
-
-#define __pa(virt) region_pa((void *) (virt))
-#define __va(phys) region_va((unsigned long) (phys))
-
-extern unsigned long page_to_pfn(struct page *page);
-extern struct page *pfn_to_page(unsigned long pfn);
+extern unsigned long to_phys(void *virt);
+extern void *to_virt(unsigned long phys);
 
-extern struct page *phys_to_page(unsigned long phys);
+#define __pa(virt) to_phys((void *) virt)
+#define __va(phys) to_virt((unsigned long) phys)
 
-#define virt_to_page(v) (phys_to_page(__pa(v)))
+#define page_to_pfn(page) ((page) - mem_map)
+#define pfn_to_page(pfn) (mem_map + (pfn))
 
-extern struct page *page_mem_map(struct page *page);
+#define phys_to_pfn(p) ((p) >> PAGE_SHIFT)
+#define pfn_to_phys(pfn) ((pfn) << PAGE_SHIFT)
 
-#define pfn_valid(pfn) (page_mem_map(pfn_to_page(pfn)) != NULL)
-#define virt_addr_valid(v) pfn_valid(__pa(v) >> PAGE_SHIFT)
+#define pfn_valid(pfn) ((pfn) < max_mapnr)
+#define virt_addr_valid(v) pfn_valid(phys_to_pfn(__pa(v)))
 
 extern struct page *arch_validate(struct page *page, int mask, int order);
 #define HAVE_ARCH_VALIDATE
 
+extern void arch_free_page(struct page *page, int order);
+#define HAVE_ARCH_FREE_PAGE
+
 #endif
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * Emacs will notice this stuff at the end of the file and automatically
+ * adjust the settings for this buffer only.  This must remain at the end
+ * of the file.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-file-style: "linux"
+ * End:
+ */
--- diff/include/asm-um/param.h	2002-10-16 04:27:18.000000000 +0100
+++ source/include/asm-um/param.h	2004-02-09 10:39:57.000000000 +0000
@@ -3,10 +3,6 @@
 
 #define EXEC_PAGESIZE   4096
 
-#ifndef NGROUPS
-#define NGROUPS         32
-#endif
-
 #ifndef NOGROUP
 #define NOGROUP         (-1)
 #endif
--- diff/include/asm-um/pci.h	2002-10-16 04:27:56.000000000 +0100
+++ source/include/asm-um/pci.h	2004-02-09 10:39:57.000000000 +0000
@@ -2,5 +2,6 @@
 #define __UM_PCI_H
 
 #define PCI_DMA_BUS_IS_PHYS     (1)
+#define pcibios_scan_all_fns(a, b)	0
 
 #endif
--- diff/include/asm-um/pgtable.h	2003-10-09 09:47:34.000000000 +0100
+++ source/include/asm-um/pgtable.h	2004-02-09 10:39:57.000000000 +0000
@@ -65,10 +65,10 @@
  * area for the same reason. ;)
  */
 
-extern unsigned long high_physmem;
+extern unsigned long end_iomem;
 
 #define VMALLOC_OFFSET	(__va_space)
-#define VMALLOC_START	(((unsigned long) high_physmem + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
+#define VMALLOC_START	((end_iomem + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
 
 #ifdef CONFIG_HIGHMEM
 # define VMALLOC_END	(PKMAP_BASE-2*PAGE_SIZE)
@@ -78,12 +78,13 @@
 
 #define _PAGE_PRESENT	0x001
 #define _PAGE_NEWPAGE	0x002
-#define _PAGE_PROTNONE	0x004	/* If not present */
-#define _PAGE_RW	0x008
-#define _PAGE_USER	0x010
-#define _PAGE_ACCESSED	0x020
-#define _PAGE_DIRTY	0x040
-#define _PAGE_NEWPROT   0x080
+#define _PAGE_NEWPROT   0x004
+#define _PAGE_FILE	0x008   /* set:pagecache unset:swap */
+#define _PAGE_PROTNONE	0x010	/* If not present */
+#define _PAGE_RW	0x020
+#define _PAGE_USER	0x040
+#define _PAGE_ACCESSED	0x080
+#define _PAGE_DIRTY	0x100
 
 #define REGION_MASK	0xf0000000
 #define REGION_SHIFT	28
@@ -143,7 +144,8 @@
 
 #define BAD_PAGETABLE __bad_pagetable()
 #define BAD_PAGE __bad_page()
-#define ZERO_PAGE(vaddr) (virt_to_page(empty_zero_page))
+
+#define ZERO_PAGE(vaddr) virt_to_page(empty_zero_page)
 
 /* number of bits that fit into a memory pointer */
 #define BITS_PER_PTR			(8*sizeof(unsigned long))
@@ -164,9 +166,6 @@
 
 #define pte_clear(xp)	do { pte_val(*(xp)) = _PAGE_NEWPAGE; } while (0)
 
-#define phys_region_index(x) (((x) & REGION_MASK) >> REGION_SHIFT)
-#define pte_region_index(x) phys_region_index(pte_val(x))
-
 #define pmd_none(x)	(!(pmd_val(x) & ~_PAGE_NEWPAGE))
 #define	pmd_bad(x)	((pmd_val(x) & (~PAGE_MASK & ~_PAGE_USER)) != _KERNPG_TABLE)
 #define pmd_present(x)	(pmd_val(x) & _PAGE_PRESENT)
@@ -188,19 +187,25 @@
 
 #define pages_to_mb(x) ((x) >> (20-PAGE_SHIFT))
 
-extern struct page *pte_mem_map(pte_t pte);
-extern struct page *phys_mem_map(unsigned long phys);
-extern unsigned long phys_to_pfn(unsigned long p);
-extern unsigned long pfn_to_phys(unsigned long pfn);
-
-#define pte_page(x) pfn_to_page(pte_pfn(x))
-#define pte_address(x) (__va(pte_val(x) & PAGE_MASK))
-#define mk_phys(a, r) ((a) + (r << REGION_SHIFT))
-#define phys_addr(p) ((p) & ~REGION_MASK)
-#define phys_page(p) (phys_mem_map(p) + ((phys_addr(p)) >> PAGE_SHIFT))
+#define pte_page(pte) phys_to_page(pte_val(pte))
+#define pmd_page(pmd) phys_to_page(pmd_val(pmd) & PAGE_MASK)
+
 #define pte_pfn(x) phys_to_pfn(pte_val(x))
 #define pfn_pte(pfn, prot) __pte(pfn_to_phys(pfn) | pgprot_val(prot))
-#define pfn_pmd(pfn, prot) __pmd(pfn_to_phys(pfn) | pgprot_val(prot))
+
+extern struct page *phys_to_page(const unsigned long phys);
+extern struct page *__virt_to_page(const unsigned long virt);
+#define virt_to_page(addr) __virt_to_page((const unsigned long) addr)
+  
+/*
+ * Bits 0 through 3 are taken
+ */
+#define PTE_FILE_MAX_BITS	28
+
+#define pte_to_pgoff(pte) ((pte).pte_low >> 4)
+
+#define pgoff_to_pte(off) \
+	((pte_t) { ((off) << 4) + _PAGE_FILE })
 
 static inline pte_t pte_mknewprot(pte_t pte)
 {
@@ -235,6 +240,12 @@
  * The following only work if pte_present() is true.
  * Undefined behaviour if not..
  */
+static inline int pte_user(pte_t pte)
+{ 
+	return((pte_val(pte) & _PAGE_USER) && 
+	       !(pte_val(pte) & _PAGE_PROTNONE));
+}
+
 static inline int pte_read(pte_t pte)
 { 
 	return((pte_val(pte) & _PAGE_USER) && 
@@ -252,6 +263,14 @@
 	       !(pte_val(pte) & _PAGE_PROTNONE));
 }
 
+/*
+ * The following only works if pte_present() is not true.
+ */
+static inline int pte_file(pte_t pte)
+{ 
+	return (pte).pte_low & _PAGE_FILE; 
+}
+
 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_newpage(pte_t pte) { return pte_val(pte) & _PAGE_NEWPAGE; }
@@ -334,14 +353,7 @@
  * and a page entry and page directory to the page they refer to.
  */
 
-#define mk_pte(page, pgprot) \
-({					\
-	pte_t __pte;                    \
-                                        \
-	pte_val(__pte) = page_to_phys(page) + pgprot_val(pgprot);\
-	if(pte_present(__pte)) pte_mknewprot(pte_mknewpage(__pte)); \
-	__pte;                          \
-})
+extern pte_t mk_pte(struct page *page, pgprot_t pgprot);
 
 static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
 {
@@ -351,17 +363,27 @@
 }
 
 #define pmd_page_kernel(pmd) ((unsigned long) __va(pmd_val(pmd) & PAGE_MASK))
-#define pmd_page(pmd) (phys_mem_map(pmd_val(pmd) & PAGE_MASK) + \
-		       ((phys_addr(pmd_val(pmd)) >> PAGE_SHIFT)))
 
-/* to find an entry in a page-table-directory. */
+/*
+ * the pgd page can be thought of an array like this: pgd_t[PTRS_PER_PGD]
+ *
+ * this macro returns the index of the entry in the pgd page which would
+ * control the given virtual address
+ */
 #define pgd_index(address) ((address >> PGDIR_SHIFT) & (PTRS_PER_PGD-1))
 
-/* to find an entry in a page-table-directory */
+/*
+ * pgd_offset() returns a (pgd_t *)
+ * pgd_index() is used get the offset into the pgd page's array of pgd_t's;
+ */
 #define pgd_offset(mm, address) \
 ((mm)->pgd + ((address) >> PGDIR_SHIFT))
 
-/* to find an entry in a kernel page-table-directory */
+
+/*
+ * a shortcut which implies the use of the kernel's pgd, instead
+ * of a process's
+ */
 #define pgd_offset_k(address) pgd_offset(&init_mm, address)
 
 #define pmd_index(address) \
@@ -373,7 +395,12 @@
 	return (pmd_t *) dir;
 }
 
-/* Find an entry in the third-level page table.. */ 
+/*
+ * the pte page can be thought of an array like this: pte_t[PTRS_PER_PTE]
+ *
+ * this macro returns the index of the entry in the pte page which would
+ * control the given virtual address
+ */
 #define pte_index(address) (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
 #define pte_offset_kernel(dir, address) \
 	((pte_t *) pmd_page_kernel(*(dir)) +  pte_index(address))
@@ -399,11 +426,11 @@
 #define update_mmu_cache(vma,address,pte) do ; while (0)
 
 /* Encode and de-code a swap entry */
-#define __swp_type(x)			(((x).val >> 3) & 0x7f)
-#define __swp_offset(x)			((x).val >> 10)
+#define __swp_type(x)			(((x).val >> 4) & 0x3f)
+#define __swp_offset(x)			((x).val >> 11)
 
 #define __swp_entry(type, offset) \
-	((swp_entry_t) { ((type) << 3) | ((offset) << 10) })
+	((swp_entry_t) { ((type) << 4) | ((offset) << 11) })
 #define __pte_to_swp_entry(pte) \
 	((swp_entry_t) { pte_val(pte_mkuptodate(pte)) })
 #define __swp_entry_to_pte(x)		((pte_t) { (x).val })
--- diff/include/asm-um/processor-generic.h	2003-10-09 09:47:17.000000000 +0100
+++ source/include/asm-um/processor-generic.h	2004-02-09 10:39:57.000000000 +0000
@@ -11,9 +11,7 @@
 struct task_struct;
 
 #include "linux/config.h"
-#include "linux/signal.h"
 #include "asm/ptrace.h"
-#include "asm/siginfo.h"
 #include "choose-mode.h"
 
 struct mm_struct;
@@ -22,23 +20,6 @@
 
 #define cpu_relax()	do ; while (0)
 
-#ifdef CONFIG_MODE_TT
-struct proc_tt_mode {
-	int extern_pid;
-	int tracing;
-	int switch_pipe[2];
-	int singlestep_syscall;
-	int vm_seq;
-};
-#endif
-
-#ifdef CONFIG_MODE_SKAS
-struct proc_skas_mode {
-	void *switch_buf;
-	void *fork_buf;
-};
-#endif
-
 struct thread_struct {
 	int forking;
 	unsigned long kernel_stack;
@@ -46,6 +27,7 @@
 	struct pt_regs regs;
 	unsigned long cr2;
 	int err;
+	unsigned long trap_no;
 	void *fault_addr;
 	void *fault_catcher;
 	struct task_struct *prev_sched;
@@ -54,10 +36,20 @@
 	struct arch_thread arch;
 	union {
 #ifdef CONFIG_MODE_TT
-		struct proc_tt_mode tt;
+		struct {
+			int extern_pid;
+			int tracing;
+			int switch_pipe[2];
+			int singlestep_syscall;
+			int vm_seq;
+		} tt;
 #endif
 #ifdef CONFIG_MODE_SKAS
-		struct proc_skas_mode skas;
+		struct {
+			void *switch_buf;
+			void *fork_buf;
+			int mm_count;
+		} skas;
 #endif
 	} mode;
 	struct {
@@ -101,14 +93,19 @@
 } mm_segment_t;
 
 extern struct task_struct *alloc_task_struct(void);
-extern void free_task_struct(struct task_struct *task);
 
 extern void release_thread(struct task_struct *);
 extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
 extern void dump_thread(struct pt_regs *regs, struct user *u);
+extern void prepare_to_copy(struct task_struct *tsk);
 
 extern unsigned long thread_saved_pc(struct task_struct *t);
 
+static inline void mm_copy_segments(struct mm_struct *from_mm, 
+				    struct mm_struct *new_mm)
+{
+}
+
 #define init_stack	(init_thread_union.stack)
 
 /*
--- diff/include/asm-um/processor-i386.h	2003-10-09 09:47:17.000000000 +0100
+++ source/include/asm-um/processor-i386.h	2004-02-09 10:39:57.000000000 +0000
@@ -6,8 +6,8 @@
 #ifndef __UM_PROCESSOR_I386_H
 #define __UM_PROCESSOR_I386_H
 
-extern int cpu_has_xmm;
-extern int cpu_has_cmov;
+extern int host_has_xmm;
+extern int host_has_cmov;
 
 struct arch_thread {
 	unsigned long debugregs[8];
--- diff/include/asm-um/smp.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/asm-um/smp.h	2004-02-09 10:39:57.000000000 +0000
@@ -10,7 +10,7 @@
 
 extern cpumask_t cpu_online_map;
 
-#define smp_processor_id() (current->thread_info->cpu)
+#define smp_processor_id() (current_thread->cpu)
 #define cpu_logical_map(n) (n)
 #define cpu_number_map(n) (n)
 #define PROC_CHANGE_PENALTY	15 /* Pick a number, any number */
--- diff/include/asm-um/system-generic.h	2003-10-09 09:47:17.000000000 +0100
+++ source/include/asm-um/system-generic.h	2004-02-09 10:39:57.000000000 +0000
@@ -23,8 +23,10 @@
 extern void block_signals(void);
 extern void unblock_signals(void);
 
-#define local_save_flags(flags) do { (flags) = get_signals(); } while(0)
-#define local_irq_restore(flags) do { set_signals(flags); } while(0)
+#define local_save_flags(flags) do { typecheck(unsigned long, flags); \
+				     (flags) = get_signals(); } while(0)
+#define local_irq_restore(flags) do { typecheck(unsigned long, flags); \
+				      set_signals(flags); } while(0)
 
 #define local_irq_save(flags) do { local_save_flags(flags); \
                                    local_irq_disable(); } while(0)
@@ -39,4 +41,7 @@
         (flags == 0);                   \
 })
 
+extern void *_switch_to(void *prev, void *next, void *last);
+#define switch_to(prev, next, last) prev = _switch_to(prev, next, last)
+
 #endif
--- diff/include/asm-um/thread_info.h	2003-10-09 09:47:17.000000000 +0100
+++ source/include/asm-um/thread_info.h	2004-02-09 10:39:57.000000000 +0000
@@ -9,6 +9,7 @@
 #ifndef __ASSEMBLY__
 
 #include <asm/processor.h>
+#include <asm/types.h>
 
 struct thread_info {
 	struct task_struct	*task;		/* main task structure */
@@ -43,15 +44,18 @@
 static inline struct thread_info *current_thread_info(void)
 {
 	struct thread_info *ti;
-	__asm__("andl %%esp,%0; ":"=r" (ti) : "0" (~16383UL));
+	unsigned long mask = PAGE_SIZE * 
+		(1 << CONFIG_KERNEL_STACK_ORDER) - 1;
+	__asm__("andl %%esp,%0; ":"=r" (ti) : "0" (~mask));
 	return ti;
 }
 
 /* thread information allocation */
-#define THREAD_SIZE (4*PAGE_SIZE)
-#define alloc_thread_info(tsk) ((struct thread_info *) \
-	__get_free_pages(GFP_KERNEL,2))
-#define free_thread_info(ti) free_pages((unsigned long) (ti), 2)
+#define THREAD_SIZE ((1 << CONFIG_KERNEL_STACK_ORDER) * PAGE_SIZE)
+#define alloc_thread_info(tsk) \
+	((struct thread_info *) kmalloc(THREAD_SIZE, GFP_KERNEL))
+#define free_thread_info(ti) kfree(ti)
+	
 #define get_thread_info(ti) get_task_struct((ti)->task)
 #define put_thread_info(ti) put_task_struct((ti)->task)
 
@@ -65,11 +69,13 @@
 #define TIF_POLLING_NRFLAG      3       /* true if poll_idle() is polling 
 					 * TIF_NEED_RESCHED 
 					 */
+#define TIF_RESTART_BLOCK 	4
 
 #define _TIF_SYSCALL_TRACE	(1 << TIF_SYSCALL_TRACE)
 #define _TIF_SIGPENDING		(1 << TIF_SIGPENDING)
 #define _TIF_NEED_RESCHED	(1 << TIF_NEED_RESCHED)
 #define _TIF_POLLING_NRFLAG     (1 << TIF_POLLING_NRFLAG)
+#define _TIF_RESTART_BLOCK	(1 << TIF_RESTART_BLOCK)
 
 #endif
 
--- diff/include/asm-um/timex.h	2003-10-09 09:47:17.000000000 +0100
+++ source/include/asm-um/timex.h	2004-02-09 10:39:57.000000000 +0000
@@ -1,8 +1,6 @@
 #ifndef __UM_TIMEX_H
 #define __UM_TIMEX_H
 
-#include "linux/time.h"
-
 typedef unsigned long cycles_t;
 
 #define cacheflush_time (0)
--- diff/include/asm-um/uaccess.h	2003-01-02 10:43:24.000000000 +0000
+++ source/include/asm-um/uaccess.h	2004-02-09 10:39:57.000000000 +0000
@@ -6,6 +6,8 @@
 #ifndef __UM_UACCESS_H
 #define __UM_UACCESS_H
 
+#include "linux/sched.h"
+
 #define VERIFY_READ 0
 #define VERIFY_WRITE 1
 
--- diff/include/asm-um/unistd.h	2002-11-18 10:11:55.000000000 +0000
+++ source/include/asm-um/unistd.h	2004-02-09 10:39:57.000000000 +0000
@@ -33,7 +33,10 @@
 	set_fs(KERNEL_DS);			\
 	ret = sys(args);			\
 	set_fs(fs);				\
-	return ret;
+	if (ret >= 0)				\
+		return ret;			\
+	errno = -(long)ret;			\
+	return -1;
 
 static inline long open(const char *pathname, int flags, int mode) 
 {
--- diff/include/asm-v850/io.h	2003-06-30 10:07:34.000000000 +0100
+++ source/include/asm-v850/io.h	2004-02-09 10:39:57.000000000 +0000
@@ -23,6 +23,10 @@
 #define readl(addr) \
   ({ unsigned long __v = (*(volatile unsigned long *) (addr)); __v; })
 
+#define readb_relaxed(a) readb(a)
+#define readw_relaxed(a) readw(a)
+#define readl_relaxed(a) readl(a)
+
 #define writeb(b, addr) \
   (void)((*(volatile unsigned char *) (addr)) = (b))
 #define writew(b, addr) \
--- diff/include/asm-v850/param.h	2002-11-11 11:09:43.000000000 +0000
+++ source/include/asm-v850/param.h	2004-02-09 10:39:57.000000000 +0000
@@ -18,10 +18,6 @@
 
 #define EXEC_PAGESIZE	4096
 
-#ifndef NGROUPS
-#define NGROUPS		32
-#endif
-
 #ifndef NOGROUP
 #define NOGROUP		(-1)
 #endif
--- diff/include/asm-v850/pci.h	2003-02-13 11:46:55.000000000 +0000
+++ source/include/asm-v850/pci.h	2004-02-09 10:39:57.000000000 +0000
@@ -17,6 +17,8 @@
 /* Get any platform-dependent definitions.  */
 #include <asm/machdep.h>
 
+#define pcibios_scan_all_fns(a, b)	0
+
 /* Generic declarations.  */
 
 struct scatterlist;
--- diff/include/asm-x86_64/apic.h	2003-08-20 14:16:34.000000000 +0100
+++ source/include/asm-x86_64/apic.h	2004-02-09 10:39:57.000000000 +0000
@@ -52,7 +52,7 @@
 	/*
 	 * ack_APIC_irq() actually gets compiled as a single instruction:
 	 * - a single rmw on Pentium/82489DX
-	 * - a single write on P6+ cores (CONFIG_X86_GOOD_APIC)
+	 * - a single write on P6+ cores (!CONFIG_X86_BAD_APIC)
 	 * ... yummie.
 	 */
 
@@ -79,7 +79,7 @@
 extern void enable_lapic_nmi_watchdog(void);
 extern void disable_timer_nmi_watchdog(void);
 extern void enable_timer_nmi_watchdog(void);
-extern inline void nmi_watchdog_tick (struct pt_regs * regs, unsigned reason);
+extern void nmi_watchdog_tick (struct pt_regs * regs, unsigned reason);
 extern int APIC_init_uniprocessor (void);
 extern void disable_APIC_timer(void);
 extern void enable_APIC_timer(void);
--- diff/include/asm-x86_64/hw_irq.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/asm-x86_64/hw_irq.h	2004-02-09 10:39:57.000000000 +0000
@@ -77,7 +77,7 @@
 
 #ifndef __ASSEMBLY__
 extern u8 irq_vector[NR_IRQ_VECTORS];
-#define IO_APIC_VECTOR(irq)	((int)irq_vector[irq])
+#define IO_APIC_VECTOR(irq)	(irq_vector[irq])
 
 /*
  * Various low-level irq details needed by irq.c, process.c,
@@ -132,7 +132,7 @@
 {
 	unsigned long rip;
 	extern unsigned long prof_cpu_mask;
-	extern char _stext;
+	extern char _stext[];
  
 	profile_hook(regs);
 
--- diff/include/asm-x86_64/io.h	2004-01-19 10:22:59.000000000 +0000
+++ source/include/asm-x86_64/io.h	2004-02-09 10:39:57.000000000 +0000
@@ -188,6 +188,10 @@
 #define readw(addr) (*(volatile unsigned short *) __io_virt(addr))
 #define readl(addr) (*(volatile unsigned int *) __io_virt(addr))
 #define readq(addr) (*(volatile unsigned long *) __io_virt(addr))
+#define readb_relaxed(a) readb(a)
+#define readw_relaxed(a) readw(a)
+#define readl_relaxed(a) readl(a)
+#define readq_relaxed(a) readq(a)
 #define __raw_readb readb
 #define __raw_readw readw
 #define __raw_readl readl
--- diff/include/asm-x86_64/param.h	2002-11-11 11:09:30.000000000 +0000
+++ source/include/asm-x86_64/param.h	2004-02-09 10:39:57.000000000 +0000
@@ -13,10 +13,6 @@
 
 #define EXEC_PAGESIZE	4096
 
-#ifndef NGROUPS
-#define NGROUPS		32
-#endif
-
 #ifndef NOGROUP
 #define NOGROUP		(-1)
 #endif
--- diff/include/asm-x86_64/pci.h	2003-11-25 15:24:59.000000000 +0000
+++ source/include/asm-x86_64/pci.h	2004-02-09 10:39:57.000000000 +0000
@@ -17,6 +17,7 @@
 #else
 #define pcibios_assign_all_busses()	0
 #endif
+#define pcibios_scan_all_fns(a, b)	0
 
 extern int no_iommu, force_iommu;
 
--- diff/include/asm-x86_64/topology.h	2003-11-25 15:24:59.000000000 +0000
+++ source/include/asm-x86_64/topology.h	2004-02-09 10:39:57.000000000 +0000
@@ -15,11 +15,9 @@
 extern unsigned long cpu_online_map;
 
 #define cpu_to_node(cpu)		(fake_node ? 0 : (cpu))
-#define memblk_to_node(memblk) 	(fake_node ? 0 : (memblk))
 #define parent_node(node)		(node)
 #define node_to_first_cpu(node) 	(fake_node ? 0 : (node))
 #define node_to_cpumask(node)	(fake_node ? cpu_online_map : (1UL << (node)))
-#define node_to_memblk(node)		(node)
 
 static inline unsigned long pcibus_to_cpumask(int bus)
 {
--- diff/include/linux/acpi.h	2003-10-09 09:47:34.000000000 +0100
+++ source/include/linux/acpi.h	2004-02-09 10:39:57.000000000 +0000
@@ -317,6 +317,15 @@
 	char				ec_id[0];
 } __attribute__ ((packed));
 
+/* PCI MMCONFIG */
+
+struct acpi_table_mcfg {
+	struct acpi_table_header	header;
+	u8				reserved[8];
+	u32				base_address;
+	u32				base_reserved;
+} __attribute__ ((packed));
+
 /* Table Handlers */
 
 enum acpi_table_id {
@@ -338,6 +347,7 @@
 	ACPI_SSDT,
 	ACPI_SPMI,
 	ACPI_HPET,
+	ACPI_MCFG,
 	ACPI_TABLE_COUNT
 };
 
@@ -355,8 +365,8 @@
 int acpi_table_init (void);
 int acpi_table_parse (enum acpi_table_id id, acpi_table_handler handler);
 int acpi_get_table_header_early (enum acpi_table_id id, struct acpi_table_header **header);
-int acpi_table_parse_madt (enum acpi_madt_entry_id id, acpi_madt_entry_handler handler);
-int acpi_table_parse_srat (enum acpi_srat_entry_id id, acpi_madt_entry_handler handler);
+int acpi_table_parse_madt (enum acpi_madt_entry_id id, acpi_madt_entry_handler handler, unsigned int max_entries);
+int acpi_table_parse_srat (enum acpi_srat_entry_id id, acpi_madt_entry_handler handler, unsigned int max_entries);
 void acpi_table_print (struct acpi_table_header *header, unsigned long phys_addr);
 void acpi_table_print_madt_entry (acpi_table_entry_header *madt);
 void acpi_table_print_srat_entry (acpi_table_entry_header *srat);
@@ -369,6 +379,8 @@
 
 extern int acpi_mp_config;
 
+extern u32 pci_mmcfg_base_addr;
+
 #else	/*!CONFIG_ACPI_BOOT*/
 
 #define acpi_mp_config	0
--- diff/include/linux/aio.h	2003-10-09 09:47:17.000000000 +0100
+++ source/include/linux/aio.h	2004-02-09 10:39:57.000000000 +0000
@@ -167,6 +167,7 @@
 }
 
 /* for sysctl: */
-extern unsigned aio_max_nr, aio_max_size, aio_max_pinned;
+extern atomic_t aio_nr;
+extern unsigned aio_max_nr;
 
 #endif /* __LINUX__AIO_H */
--- diff/include/linux/arcdevice.h	2003-08-20 14:16:14.000000000 +0100
+++ source/include/linux/arcdevice.h	2004-02-09 10:39:57.000000000 +0000
@@ -331,6 +331,7 @@
 void arcnet_unregister_proto(struct ArcProto *proto);
 irqreturn_t arcnet_interrupt(int irq, void *dev_id, struct pt_regs *regs);
 void arcdev_setup(struct net_device *dev);
+struct net_device *alloc_arcdev(char *name);
 void arcnet_rx(struct net_device *dev, int bufnum);
 
 #endif				/* __KERNEL__ */
--- diff/include/linux/binfmts.h	2003-08-20 14:16:34.000000000 +0100
+++ source/include/linux/binfmts.h	2004-02-09 10:39:57.000000000 +0000
@@ -35,9 +35,13 @@
 	char * interp;		/* Name of the binary really executed. Most
 				   of the time same as filename, but could be
 				   different for binfmt_{misc,script} */
+	unsigned long interp_flags;
 	unsigned long loader, exec;
 };
 
+#define BINPRM_FLAGS_ENFORCE_NONDUMP_BIT 0
+#define BINPRM_FLAGS_ENFORCE_NONDUMP (1 << BINPRM_FLAGS_ENFORCE_NONDUMP_BIT)
+
 /*
  * This structure defines the functions that are used to load the binary formats that
  * linux accepts.
--- diff/include/linux/bio.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/linux/bio.h	2004-02-09 10:39:57.000000000 +0000
@@ -231,18 +231,18 @@
 
 extern void bio_endio(struct bio *, unsigned int, int);
 struct request_queue;
-extern inline int bio_phys_segments(struct request_queue *, struct bio *);
-extern inline int bio_hw_segments(struct request_queue *, struct bio *);
+extern int bio_phys_segments(struct request_queue *, struct bio *);
+extern int bio_hw_segments(struct request_queue *, struct bio *);
 
-extern inline void __bio_clone(struct bio *, struct bio *);
+extern void __bio_clone(struct bio *, struct bio *);
 extern struct bio *bio_clone(struct bio *, int);
 
-extern inline void bio_init(struct bio *);
+extern void bio_init(struct bio *);
 
 extern int bio_add_page(struct bio *, struct page *, unsigned int,unsigned int);
 extern int bio_get_nr_vecs(struct block_device *);
-extern struct bio *bio_map_user(struct block_device *, unsigned long,
-				unsigned int, int);
+extern struct bio *bio_map_user(struct request_queue *, struct block_device *,
+				unsigned long, unsigned int, int);
 extern void bio_unmap_user(struct bio *, int);
 extern void bio_set_pages_dirty(struct bio *bio);
 extern void bio_check_pages_dirty(struct bio *bio);
--- diff/include/linux/bitmap.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/linux/bitmap.h	2004-02-09 10:39:57.000000000 +0000
@@ -41,6 +41,10 @@
 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);
+int bitmap_snprintf(char *buf, unsigned int buflen,
+			const unsigned long *maskp, int bits);
+int bitmap_parse(const char __user *ubuf, unsigned int ubuflen,
+			unsigned long *maskp, int bits);
 
 #endif /* __ASSEMBLY__ */
 
--- diff/include/linux/blkdev.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/linux/blkdev.h	2004-02-09 10:39:57.000000000 +0000
@@ -508,7 +508,7 @@
 extern void blk_recount_segments(request_queue_t *, struct bio *);
 extern inline int blk_phys_contig_segment(request_queue_t *q, struct bio *, struct bio *);
 extern inline int blk_hw_contig_segment(request_queue_t *q, struct bio *, struct bio *);
-extern int scsi_cmd_ioctl(struct block_device *, unsigned int, unsigned long);
+extern int scsi_cmd_ioctl(struct gendisk *, unsigned int, unsigned long);
 extern void blk_start_queue(request_queue_t *q);
 extern void blk_stop_queue(request_queue_t *q);
 extern void __blk_stop_queue(request_queue_t *q);
@@ -586,7 +586,7 @@
 extern void blk_queue_free_tags(request_queue_t *);
 extern int blk_queue_resize_tags(request_queue_t *, int);
 extern void blk_queue_invalidate_tags(request_queue_t *);
-extern void blk_congestion_wait(int rw, long timeout);
+extern long blk_congestion_wait(int rw, long timeout);
 
 extern void blk_rq_bio_prep(request_queue_t *, struct request *, struct bio *);
 extern void blk_rq_prep_restart(struct request *);
--- diff/include/linux/cdrom.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/linux/cdrom.h	2004-02-09 10:39:57.000000000 +0000
@@ -496,6 +496,7 @@
 #define GPCMD_GET_MEDIA_STATUS		    0xda
 
 /* Mode page codes for mode sense/set */
+#define GPMODE_VENDOR_PAGE		0x00
 #define GPMODE_R_W_ERROR_PAGE		0x01
 #define GPMODE_WRITE_PARMS_PAGE		0x05
 #define GPMODE_AUDIO_CTL_PAGE		0x0e
--- diff/include/linux/com20020.h	2003-02-26 16:01:02.000000000 +0000
+++ source/include/linux/com20020.h	2004-02-09 10:39:57.000000000 +0000
@@ -29,7 +29,6 @@
 
 int com20020_check(struct net_device *dev);
 int com20020_found(struct net_device *dev, int shared);
-void com20020_remove(struct net_device *dev);
 
 /* The number of low I/O ports used by the card. */
 #define ARCNET_TOTAL_SIZE 8
--- diff/include/linux/compat.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/linux/compat.h	2004-02-09 10:39:57.000000000 +0000
@@ -6,15 +6,26 @@
  */
 #include <linux/config.h>
 
-#ifdef CONFIG_COMPAT
+#ifndef CONFIG_COMPAT
+
+/* Non-native task requiring compat... doesn't exist */
+#define is_compat_task(x) 0
+
+#else
 
 #include <linux/stat.h>
 #include <linux/param.h>	/* for HZ */
+#include <linux/personality.h>  /* Conditional process compat */
 #include <asm/compat.h>
 
 #define compat_jiffies_to_clock_t(x)	\
 		(((unsigned long)(x) * COMPAT_USER_HZ) / HZ)
 
+/* Non-native task requiring compat */
+#ifndef HAVE_ARCH_IS_COMPAT_TASK
+#define is_compat_task(x) (x->personality == PER_LINUX32)
+#endif
+
 struct compat_itimerspec { 
 	struct compat_timespec it_interval;
 	struct compat_timespec it_value;
@@ -83,10 +94,5 @@
 	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/include/linux/compiler-gcc.h	2003-10-09 09:47:17.000000000 +0100
+++ source/include/linux/compiler-gcc.h	2004-02-09 10:39:57.000000000 +0000
@@ -13,5 +13,5 @@
    shouldn't recognize the original var, and make assumptions about it */
 #define RELOC_HIDE(ptr, off)					\
   ({ unsigned long __ptr;					\
-    __asm__ ("" : "=g"(__ptr) : "0"(ptr));		\
+	__asm__ ("" : "=r"(__ptr) : "0"(ptr));			\
     (typeof(ptr)) (__ptr + (off)); })
--- diff/include/linux/compiler-gcc3.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/linux/compiler-gcc3.h	2004-02-09 10:39:57.000000000 +0000
@@ -21,3 +21,7 @@
 
 #define __attribute_pure__	__attribute__((pure))
 #define __attribute_const__	__attribute__((__const__))
+
+#if __GNUC_MINOR__ >= 1
+#define  noinline __attribute__((noinline))
+#endif
--- diff/include/linux/compiler.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/linux/compiler.h	2004-02-09 10:39:57.000000000 +0000
@@ -94,6 +94,10 @@
 # define __attribute_const__	/* unimplemented */
 #endif
 
+#ifndef noinline
+#define noinline
+#endif
+
 /* Optimization barrier */
 #ifndef barrier
 # define barrier() __memory_barrier()
--- diff/include/linux/config.h	2003-10-09 09:47:17.000000000 +0100
+++ source/include/linux/config.h	2004-02-09 10:39:57.000000000 +0000
@@ -2,5 +2,8 @@
 #define _LINUX_CONFIG_H
 
 #include <linux/autoconf.h>
+#ifdef CONFIG_X86
+#include <asm/kgdb.h>
+#endif
 
 #endif
--- diff/include/linux/console.h	2004-01-19 10:22:59.000000000 +0000
+++ source/include/linux/console.h	2004-02-09 10:39:57.000000000 +0000
@@ -102,6 +102,14 @@
 extern void release_console_sem(void);
 extern void console_conditional_schedule(void);
 extern void console_unblank(void);
+extern int is_console_locked(void);
+
+/* Some debug stub to catch some of the obvious races in the VT code */
+#if 1
+#define WARN_CONSOLE_UNLOCKED()	WARN_ON(!is_console_locked() && !oops_in_progress)
+#else
+#define WARN_CONSOLE_UNLOCKED()
+#endif
 
 /* VESA Blanking Levels */
 #define VESA_NO_BLANKING        0
--- diff/include/linux/cpu.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/linux/cpu.h	2004-02-09 10:39:57.000000000 +0000
@@ -21,6 +21,8 @@
 
 #include <linux/sysdev.h>
 #include <linux/node.h>
+#include <linux/compiler.h>
+#include <linux/cpumask.h>
 #include <asm/semaphore.h>
 
 struct cpu {
@@ -38,9 +40,6 @@
 
 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)
@@ -51,12 +50,27 @@
 {
 }
 
-#define lock_cpu_hotplug()	do { } while (0)
-#define unlock_cpu_hotplug()		do { } while (0)
-
 #endif /* CONFIG_SMP */
 extern struct sysdev_class cpu_sysdev_class;
 
+#ifdef CONFIG_HOTPLUG_CPU
 /* Stop CPUs going up and down. */
 extern struct semaphore cpucontrol;
+#define lock_cpu_hotplug()	down(&cpucontrol)
+#define unlock_cpu_hotplug()	up(&cpucontrol)
+int cpu_down(unsigned int cpu);
+#define hotcpu_notifier(fn, pri) {				\
+	static struct notifier_block fn##_nb = { fn, pri };	\
+	register_cpu_notifier(&fn##_nb);			\
+}
+#define cpu_is_offline(cpu) unlikely(!cpu_online(cpu))
+#else
+#define lock_cpu_hotplug()	do { } while (0)
+#define unlock_cpu_hotplug()	do { } while (0)
+#define hotcpu_notifier(fn, pri)
+
+/* CPUs don't go offline once they're online w/o CONFIG_HOTPLUG_CPU */
+#define cpu_is_offline(cpu) 0
+#endif
+
 #endif /* _LINUX_CPU_H_ */
--- diff/include/linux/cpumask.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/linux/cpumask.h	2004-02-09 10:39:57.000000000 +0000
@@ -2,6 +2,7 @@
 #define __LINUX_CPUMASK_H
 
 #include <linux/threads.h>
+#include <linux/bitmap.h>
 #include <asm/cpumask.h>
 #include <asm/bug.h>
 
@@ -10,6 +11,13 @@
 extern cpumask_t cpu_online_map;
 extern cpumask_t cpu_possible_map;
 
+#ifdef CONFIG_HOTPLUG_CPU
+/* Online, or on its way down but still receiving interrupts. */
+extern cpumask_t cpu_active_map;
+#else
+#define cpu_active_map cpu_online_map
+#endif
+
 #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)
@@ -23,6 +31,8 @@
 #define for_each_online_cpu(cpu) for_each_cpu_mask(cpu, cpu_online_map)
 #else
 #define	cpu_online_map			cpumask_of_cpu(0)
+#define	cpu_possible_map		cpumask_of_cpu(0)
+#define	cpu_active_map			cpumask_of_cpu(0)
 #define num_online_cpus()		1
 #define cpu_online(cpu)			({ BUG_ON((cpu) != 0); 1; })
 #define cpu_possible(cpu)		({ BUG_ON((cpu) != 0); 1; })
@@ -31,16 +41,10 @@
 #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);
-
 #define cpumask_snprintf(buf, buflen, map)				\
-	__mask_snprintf_len(buf, buflen, cpus_addr(map), sizeof(map))
-
-extern int __mask_parse_len(const char __user *ubuf, unsigned int ubuflen,
-	unsigned long *maskp, unsigned int maskbytes);
+	bitmap_snprintf(buf, buflen, cpus_addr(map), NR_CPUS)
 
 #define cpumask_parse(buf, buflen, map)					\
-	__mask_parse_len(buf, buflen, cpus_addr(map), sizeof(map))
+	bitmap_parse(buf, buflen, cpus_addr(map), NR_CPUS)
 
 #endif /* __LINUX_CPUMASK_H */
--- diff/include/linux/device.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/linux/device.h	2004-02-09 10:39:57.000000000 +0000
@@ -253,6 +253,8 @@
 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 int class_simple_set_hotplug(struct class_simple *, 
+	int (*hotplug)(struct class_device *dev, char **envp, int num_envp, char *buffer, int buffer_size));
 extern void class_simple_device_remove(dev_t dev);
 
 
@@ -263,7 +265,6 @@
 	struct list_head children;
 	struct device 	* parent;
 
-	struct completion * complete;	/* Notification for freeing device. */
 	struct kobject kobj;
 	char	bus_id[BUS_ID_SIZE];	/* position on parent bus */
 
@@ -284,6 +285,7 @@
 					   detached from its driver. */
 
 	u64		*dma_mask;	/* dma mask (if dma'able device) */
+	struct list_head	dma_pools;	/* dma pools (if dma'ble) */
 
 	void	(*release)(struct device * dev);
 };
@@ -311,7 +313,6 @@
  */
 extern int device_register(struct device * dev);
 extern void device_unregister(struct device * dev);
-extern void device_unregister_wait(struct device * dev);
 extern void device_initialize(struct device * dev);
 extern int device_add(struct device * dev);
 extern void device_del(struct device * dev);
--- diff/include/linux/efi.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/linux/efi.h	2004-02-09 10:39:57.000000000 +0000
@@ -297,8 +297,8 @@
 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 inline unsigned long __init efi_get_time(void);
-extern inline int __init efi_set_rtc_mmss(unsigned long nowtime);
+extern unsigned long __init efi_get_time(void);
+extern int __init efi_set_rtc_mmss(unsigned long nowtime);
 extern struct efi_memory_map memmap;
 
 /*
--- diff/include/linux/elevator.h	2003-10-09 09:47:17.000000000 +0100
+++ source/include/linux/elevator.h	2004-02-09 10:39:57.000000000 +0000
@@ -94,11 +94,16 @@
  */
 extern elevator_t iosched_as;
 
+/*
+ * completely fair queueing I/O scheduler
+ */
+extern elevator_t iosched_cfq;
+
 extern int elevator_init(request_queue_t *, elevator_t *);
 extern void elevator_exit(request_queue_t *);
-extern inline int elv_rq_merge_ok(struct request *, struct bio *);
-extern inline int elv_try_merge(struct request *, struct bio *);
-extern inline int elv_try_last_merge(request_queue_t *, struct bio *);
+extern int elv_rq_merge_ok(struct request *, struct bio *);
+extern int elv_try_merge(struct request *, struct bio *);
+extern int elv_try_last_merge(request_queue_t *, struct bio *);
 
 /*
  * Return values from elevator merger
--- diff/include/linux/fs.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/linux/fs.h	2004-02-09 10:39:57.000000000 +0000
@@ -137,6 +137,7 @@
 #define S_DEAD		32	/* removed, but still open directory */
 #define S_NOQUOTA	64	/* Inode is not counted to quota */
 #define S_DIRSYNC	128	/* Directory modifications are synchronous */
+#define S_NOCMTIME	256	/* Do not update file c/mtime */
 
 /*
  * Note that nosuid etc flags are inode-specific: setting some file-system
@@ -170,6 +171,7 @@
 #define IS_ONE_SECOND(inode)	__IS_FLG(inode, MS_ONE_SECOND)
 
 #define IS_DEADDIR(inode)	((inode)->i_flags & S_DEAD)
+#define IS_NOCMTIME(inode)	((inode)->i_flags & S_NOCMTIME)
 
 /* the read-only stuff doesn't really belong here, but any other place is
    probably as bad and I don't want to create yet another include file. */
@@ -376,6 +378,7 @@
 struct inode {
 	struct hlist_node	i_hash;
 	struct list_head	i_list;
+	struct list_head	i_sb_list;
 	struct list_head	i_dentry;
 	unsigned long		i_ino;
 	atomic_t		i_count;
@@ -395,6 +398,7 @@
 	unsigned short          i_bytes;
 	spinlock_t		i_lock;	/* i_blocks, i_bytes, maybe i_size */
 	struct semaphore	i_sem;
+	struct rw_semaphore	i_alloc_sem;
 	struct inode_operations	*i_op;
 	struct file_operations	*i_fop;	/* former ->i_op->default_file_ops */
 	struct super_block	*i_sb;
@@ -461,9 +465,11 @@
 #endif
 }
 
+void i_size_write_check(struct inode *inode);
 
 static inline void i_size_write(struct inode *inode, loff_t i_size)
 {
+	i_size_write_check(inode);
 #if BITS_PER_LONG==32 && defined(CONFIG_SMP)
 	write_seqcount_begin(&inode->i_size_seqcount);
 	inode->i_size = i_size;
@@ -700,6 +706,7 @@
 	atomic_t		s_active;
 	void                    *s_security;
 
+	struct list_head	s_inodes;	/* all inodes */
 	struct list_head	s_dirty;	/* dirty inodes */
 	struct list_head	s_io;		/* parked for writeback */
 	struct hlist_head	s_anon;		/* anonymous dentries for (nfs) exporting */
@@ -1213,6 +1220,7 @@
 extern int filemap_fdatawrite(struct address_space *);
 extern int filemap_flush(struct address_space *);
 extern int filemap_fdatawait(struct address_space *);
+extern int filemap_write_and_wait(struct address_space *mapping);
 extern void sync_supers(void);
 extern void sync_filesystems(int wait);
 extern void emergency_sync(void);
@@ -1324,9 +1332,6 @@
 file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping);
 extern ssize_t generic_file_direct_IO(int rw, struct kiocb *iocb,
 	const struct iovec *iov, loff_t offset, unsigned long nr_segs);
-extern int blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode, 
-	struct block_device *bdev, const struct iovec *iov, loff_t offset, 
-	unsigned long nr_segs, get_blocks_t *get_blocks, dio_iodone_t *end_io);
 extern ssize_t generic_file_readv(struct file *filp, const struct iovec *iov, 
 	unsigned long nr_segs, loff_t *ppos);
 ssize_t generic_file_writev(struct file *filp, const struct iovec *iov, 
@@ -1348,6 +1353,32 @@
 				actor);
 }
 
+int __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode,
+	struct block_device *bdev, const struct iovec *iov, loff_t offset,
+	unsigned long nr_segs, get_blocks_t get_blocks, dio_iodone_t end_io,
+	int needs_special_locking);
+
+/*
+ * For filesystems which need locking between buffered and direct access
+ */
+static inline int blockdev_direct_IO(int rw, struct kiocb *iocb,
+	struct inode *inode, struct block_device *bdev, const struct iovec *iov,
+	loff_t offset, unsigned long nr_segs, get_blocks_t get_blocks,
+	dio_iodone_t end_io)
+{
+	return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset,
+				nr_segs, get_blocks, end_io, 1);
+}
+
+static inline int blockdev_direct_IO_no_locking(int rw, struct kiocb *iocb,
+	struct inode *inode, struct block_device *bdev, const struct iovec *iov,
+	loff_t offset, unsigned long nr_segs, get_blocks_t get_blocks,
+	dio_iodone_t end_io)
+{
+	return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset,
+				nr_segs, get_blocks, end_io, 0);
+}
+
 extern struct file_operations generic_ro_fops;
 
 #define special_file(m) (S_ISCHR(m)||S_ISBLK(m)||S_ISFIFO(m)||S_ISSOCK(m))
@@ -1421,5 +1452,25 @@
 /* kernel/fork.c */
 extern int unshare_files(void);
 
+#ifdef CONFIG_SECURITY
+static inline char *alloc_secdata(void)
+{
+	return (char *)get_zeroed_page(GFP_KERNEL);
+}
+
+static inline void free_secdata(void *secdata)
+{
+	free_page((unsigned long)secdata);
+}
+#else
+static inline char *alloc_secdata(void)
+{
+	return (char *)1;
+}
+
+static inline void free_secdata(void *secdata)
+{ }
+#endif	/* CONFIG_SECURITY */
+
 #endif /* __KERNEL__ */
 #endif /* _LINUX_FS_H */
--- diff/include/linux/fsfilter.h	2002-10-16 04:27:08.000000000 +0100
+++ source/include/linux/fsfilter.h	2004-02-09 10:39:57.000000000 +0000
@@ -74,22 +74,22 @@
 
 struct filter_fs *filter_get_filter_fs(const char *cache_type);
 void filter_setup_journal_ops(struct filter_fs *ops, char *cache_type);
-inline struct super_operations *filter_c2usops(struct filter_fs *cache);
-inline struct inode_operations *filter_c2ufiops(struct filter_fs *cache);
-inline struct inode_operations *filter_c2udiops(struct filter_fs *cache);
-inline struct inode_operations *filter_c2usiops(struct filter_fs *cache);
-inline struct file_operations *filter_c2uffops(struct filter_fs *cache);
-inline struct file_operations *filter_c2udfops(struct filter_fs *cache);
-inline struct file_operations *filter_c2usfops(struct filter_fs *cache);
-inline struct super_operations *filter_c2csops(struct filter_fs *cache);
-inline struct inode_operations *filter_c2cfiops(struct filter_fs *cache);
-inline struct inode_operations *filter_c2cdiops(struct filter_fs *cache);
-inline struct inode_operations *filter_c2csiops(struct filter_fs *cache);
-inline struct file_operations *filter_c2cffops(struct filter_fs *cache);
-inline struct file_operations *filter_c2cdfops(struct filter_fs *cache);
-inline struct file_operations *filter_c2csfops(struct filter_fs *cache);
-inline struct dentry_operations *filter_c2cdops(struct filter_fs *cache);
-inline struct dentry_operations *filter_c2udops(struct filter_fs *cache);
+struct super_operations *filter_c2usops(struct filter_fs *cache);
+struct inode_operations *filter_c2ufiops(struct filter_fs *cache);
+struct inode_operations *filter_c2udiops(struct filter_fs *cache);
+struct inode_operations *filter_c2usiops(struct filter_fs *cache);
+struct file_operations *filter_c2uffops(struct filter_fs *cache);
+struct file_operations *filter_c2udfops(struct filter_fs *cache);
+struct file_operations *filter_c2usfops(struct filter_fs *cache);
+struct super_operations *filter_c2csops(struct filter_fs *cache);
+struct inode_operations *filter_c2cfiops(struct filter_fs *cache);
+struct inode_operations *filter_c2cdiops(struct filter_fs *cache);
+struct inode_operations *filter_c2csiops(struct filter_fs *cache);
+struct file_operations *filter_c2cffops(struct filter_fs *cache);
+struct file_operations *filter_c2cdfops(struct filter_fs *cache);
+struct file_operations *filter_c2csfops(struct filter_fs *cache);
+struct dentry_operations *filter_c2cdops(struct filter_fs *cache);
+struct dentry_operations *filter_c2udops(struct filter_fs *cache);
 
 void filter_setup_super_ops(struct filter_fs *cache, struct super_operations *cache_ops, struct super_operations *filter_sops);
 void filter_setup_dir_ops(struct filter_fs *cache, struct inode *cache_inode, struct inode_operations *filter_iops, struct file_operations *ffops);
--- diff/include/linux/hdlc.h	2003-08-20 14:16:34.000000000 +0100
+++ source/include/linux/hdlc.h	2004-02-09 10:39:57.000000000 +0000
@@ -75,7 +75,7 @@
 
 
 typedef struct pvc_device_struct {
-	struct hdlc_device_struct *master;
+	struct net_device *master;
 	struct net_device *main;
 	struct net_device *ether; /* bridged Ethernet interface */
 	struct pvc_device_struct *next;	/* Sorted in ascending DLCI order */
@@ -96,11 +96,10 @@
 
 typedef struct hdlc_device_struct {
 	/* To be initialized by hardware driver */
-	struct net_device netdev; /* master net device - must be first */
 	struct net_device_stats stats;
 
 	/* used by HDLC layer to take control over HDLC device from hw driver*/
-	int (*attach)(struct hdlc_device_struct *hdlc,
+	int (*attach)(struct net_device *dev,
 		      unsigned short encoding, unsigned short parity);
 
 	/* hardware driver must handle this instead of dev->hard_start_xmit */
@@ -109,13 +108,13 @@
 
 	/* Things below are for HDLC layer internal use only */
 	struct {
-		int (*open)(struct hdlc_device_struct *hdlc);
-		void (*close)(struct hdlc_device_struct *hdlc);
+		int (*open)(struct net_device *dev);
+		void (*close)(struct net_device *dev);
 
 		/* if open & DCD */
-		void (*start)(struct hdlc_device_struct *hdlc);
+		void (*start)(struct net_device *dev);
 		/* if open & !DCD */
-		void (*stop)(struct hdlc_device_struct *hdlc);
+		void (*stop)(struct net_device *dev);
 
 		void (*detach)(struct hdlc_device_struct *hdlc);
 		int (*netif_rx)(struct sk_buff *skb);
@@ -167,16 +166,17 @@
 					      int new_mtu);
 		}ppp;
 	}state;
+	void *priv;
 }hdlc_device;
 
 
 
-int hdlc_raw_ioctl(hdlc_device *hdlc, struct ifreq *ifr);
-int hdlc_raw_eth_ioctl(hdlc_device *hdlc, struct ifreq *ifr);
-int hdlc_cisco_ioctl(hdlc_device *hdlc, struct ifreq *ifr);
-int hdlc_ppp_ioctl(hdlc_device *hdlc, struct ifreq *ifr);
-int hdlc_fr_ioctl(hdlc_device *hdlc, struct ifreq *ifr);
-int hdlc_x25_ioctl(hdlc_device *hdlc, struct ifreq *ifr);
+int hdlc_raw_ioctl(struct net_device *dev, struct ifreq *ifr);
+int hdlc_raw_eth_ioctl(struct net_device *dev, struct ifreq *ifr);
+int hdlc_cisco_ioctl(struct net_device *dev, struct ifreq *ifr);
+int hdlc_ppp_ioctl(struct net_device *dev, struct ifreq *ifr);
+int hdlc_fr_ioctl(struct net_device *dev, struct ifreq *ifr);
+int hdlc_x25_ioctl(struct net_device *dev, struct ifreq *ifr);
 
 
 /* Exported from hdlc.o */
@@ -185,19 +185,14 @@
 int hdlc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd);
 
 /* Must be used by hardware driver on module startup/exit */
-int register_hdlc_device(hdlc_device *hdlc);
-void unregister_hdlc_device(hdlc_device *hdlc);
-
-
-static __inline__ struct net_device* hdlc_to_dev(hdlc_device *hdlc)
-{
-	return &hdlc->netdev;
-}
+int register_hdlc_device(struct net_device *dev);
+void unregister_hdlc_device(struct net_device *dev);
 
+struct net_device *alloc_hdlcdev(void *priv);
 
 static __inline__ hdlc_device* dev_to_hdlc(struct net_device *dev)
 {
-	return (hdlc_device*)dev;
+	return netdev_priv(dev);
 }
 
 
@@ -207,12 +202,6 @@
 }
 
 
-static __inline__ const char *hdlc_to_name(hdlc_device *hdlc)
-{
-	return hdlc_to_dev(hdlc)->name;
-}
-
-
 static __inline__ void debug_frame(const struct sk_buff *skb)
 {
 	int i;
@@ -229,11 +218,11 @@
 
 
 /* Must be called by hardware driver when HDLC device is being opened */
-int hdlc_open(hdlc_device *hdlc);
+int hdlc_open(struct net_device *dev);
 /* Must be called by hardware driver when HDLC device is being closed */
-void hdlc_close(hdlc_device *hdlc);
+void hdlc_close(struct net_device *dev);
 /* Called by hardware driver when DCD line level changes */
-void hdlc_set_carrier(int on, hdlc_device *hdlc);
+void hdlc_set_carrier(int on, struct net_device *dev);
 
 /* May be used by hardware driver to gain control over HDLC device */
 static __inline__ void hdlc_proto_detach(hdlc_device *hdlc)
@@ -244,6 +233,12 @@
 }
 
 
+static __inline__ struct net_device_stats *hdlc_stats(struct net_device *dev)
+{
+	return &dev_to_hdlc(dev)->stats;
+}
+
+
 static __inline__ unsigned short hdlc_type_trans(struct sk_buff *skb,
 						 struct net_device *dev)
 {
--- diff/include/linux/hiddev.h	2003-09-17 12:28:12.000000000 +0100
+++ source/include/linux/hiddev.h	2004-02-09 10:39:57.000000000 +0000
@@ -39,33 +39,33 @@
 };
 
 struct hiddev_devinfo {
-	unsigned int bustype;
-	unsigned int busnum;
-	unsigned int devnum;
-	unsigned int ifnum;
-	short vendor;
-	short product;
-	short version;
-	unsigned num_applications;
+	__u32 bustype;
+	__u32 busnum;
+	__u32 devnum;
+	__u32 ifnum;
+	__s16 vendor;
+	__s16 product;
+	__s16 version;
+	__u32 num_applications;
 };
 
 struct hiddev_collection_info {
-	unsigned index;
-	unsigned type;
-	unsigned usage;
-	unsigned level;
+	__u32 index;
+	__u32 type;
+	__u32 usage;
+	__u32 level;
 };
 
 #define HID_STRING_SIZE 256
 struct hiddev_string_descriptor {
-	int index;
+	__s32 index;
 	char value[HID_STRING_SIZE];
 };
 
 struct hiddev_report_info {
-	unsigned report_type;
-	unsigned report_id;
-	unsigned num_fields;
+	__u32 report_type;
+	__u32 report_id;
+	__u32 num_fields;
 };
 
 /* To do a GUSAGE/SUSAGE, fill in at least usage_code,  report_type and 
@@ -88,20 +88,20 @@
 #define HID_REPORT_TYPE_MAX     3
 
 struct hiddev_field_info {
-	unsigned report_type;
-	unsigned report_id;
-	unsigned field_index;
-	unsigned maxusage;
-	unsigned flags;
-	unsigned physical;		/* physical usage for this field */
-	unsigned logical;		/* logical usage for this field */
-	unsigned application;		/* application usage for this field */
+	__u32 report_type;
+	__u32 report_id;
+	__u32 field_index;
+	__u32 maxusage;
+	__u32 flags;
+	__u32 physical;		/* physical usage for this field */
+	__u32 logical;		/* logical usage for this field */
+	__u32 application;		/* application usage for this field */
 	__s32 logical_minimum;
 	__s32 logical_maximum;
 	__s32 physical_minimum;
 	__s32 physical_maximum;
-	unsigned unit_exponent;
-	unsigned unit;
+	__u32 unit_exponent;
+	__u32 unit;
 };
 
 /* Fill in report_type, report_id and field_index to get the information on a
@@ -118,14 +118,22 @@
 #define HID_FIELD_BUFFERED_BYTE		0x100
 
 struct hiddev_usage_ref {
-	unsigned report_type;
-	unsigned report_id;
-	unsigned field_index;
-	unsigned usage_index;
-	unsigned usage_code;
+	__u32 report_type;
+	__u32 report_id;
+	__u32 field_index;
+	__u32 usage_index;
+	__u32 usage_code;
 	__s32 value;
 };
 
+/* hiddev_usage_ref_multi is used for sending multiple bytes to a control.
+ * It really manifests itself as setting the value of consecutive usages */
+struct hiddev_usage_ref_multi {
+	struct hiddev_usage_ref uref;
+	__u32 num_values;
+	__s32 values[HID_MAX_USAGES];
+};
+
 /* FIELD_INDEX_NONE is returned in read() data from the kernel when flags
  * is set to (HIDDEV_FLAG_UREF | HIDDEV_FLAG_REPORT) and a new report has
  * been sent by the device 
@@ -161,6 +169,10 @@
 #define HIDIOCGCOLLECTIONINFO	_IOWR('H', 0x11, struct hiddev_collection_info)
 #define HIDIOCGPHYS(len)	_IOC(_IOC_READ, 'H', 0x12, len)
 
+/* For writing/reading to multiple/consecutive usages */
+#define HIDIOCGUSAGES		_IOWR('H', 0x13, struct hiddev_usage_ref_multi)
+#define HIDIOCSUSAGES		_IOW('H', 0x14, struct hiddev_usage_ref_multi)
+
 /* 
  * Flags to be used in HIDIOCSFLAG
  */
--- diff/include/linux/hugetlb.h	2004-01-19 10:22:59.000000000 +0000
+++ source/include/linux/hugetlb.h	2004-02-09 10:39:57.000000000 +0000
@@ -95,8 +95,6 @@
 	return sb->s_fs_info;
 }
 
-#define PSEUDO_DIRENT_SIZE	20
-
 extern struct file_operations hugetlbfs_file_operations;
 extern struct vm_operations_struct hugetlb_vm_ops;
 struct file *hugetlb_zero_setup(size_t);
--- diff/include/linux/ide.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/linux/ide.h	2004-02-09 10:39:57.000000000 +0000
@@ -1416,12 +1416,12 @@
 	void			*special;
 } pkt_task_t;
 
-extern inline u32 ide_read_24(ide_drive_t *);
+extern u32 ide_read_24(ide_drive_t *);
 
-extern inline void SELECT_DRIVE(ide_drive_t *);
-extern inline void SELECT_INTERRUPT(ide_drive_t *);
-extern inline void SELECT_MASK(ide_drive_t *, int);
-extern inline void QUIRK_LIST(ide_drive_t *);
+extern void SELECT_DRIVE(ide_drive_t *);
+extern void SELECT_INTERRUPT(ide_drive_t *);
+extern void SELECT_MASK(ide_drive_t *, int);
+extern void QUIRK_LIST(ide_drive_t *);
 
 extern void ata_input_data(ide_drive_t *, void *, u32);
 extern void ata_output_data(ide_drive_t *, void *, u32);
--- diff/include/linux/if_bonding.h	2003-06-09 14:18:20.000000000 +0100
+++ source/include/linux/if_bonding.h	2004-02-09 10:39:57.000000000 +0000
@@ -1,7 +1,7 @@
 /*
  * Bond several ethernet interfaces into a Cisco, running 'Etherchannel'.
  *
- * 
+ *
  * Portions are (c) Copyright 1995 Simon "Guru Aleph-Null" Janes
  * NCM: Network and Communications Management, Inc.
  *
@@ -10,11 +10,11 @@
  *
  *	This software may be used and distributed according to the terms
  *	of the GNU Public License, incorporated herein by reference.
- * 
+ *
  * 2003/03/18 - Amir Noam <amir.noam at intel dot com>
  *	- Added support for getting slave's speed and duplex via ethtool.
  *	  Needed for 802.3ad and other future modes.
- * 
+ *
  * 2003/03/18 - Tsippy Mendelson <tsippy.mendelson at intel dot com> and
  *		Shmulik Hen <shmulik.hen at intel dot com>
  *	- Enable support of modes that need to use the unique mac address of
@@ -32,6 +32,9 @@
  * 2003/05/01 - Amir Noam <amir.noam at intel dot com>
  *	- Added ABI version control to restore compatibility between
  *	  new/old ifenslave and new/old bonding.
+ *
+ * 2003/12/01 - Shmulik Hen <shmulik.hen at intel dot com>
+ *	- Code cleanup and style changes
  */
 
 #ifndef _LINUX_IF_BONDING_H
@@ -42,7 +45,7 @@
 #include <linux/if_ether.h>
 
 /* userland - kernel ABI version (2003/05/08) */
-#define BOND_ABI_VERSION 1
+#define BOND_ABI_VERSION 2
 
 /*
  * We can remove these ioctl definitions in 2.5.  People should use the
@@ -77,10 +80,6 @@
 
 #define BOND_DEFAULT_MAX_BONDS  1   /* Default maximum number of devices to support */
 
-#define BOND_MULTICAST_DISABLED 0
-#define BOND_MULTICAST_ACTIVE   1
-#define BOND_MULTICAST_ALL      2
-
 typedef struct ifbond {
 	__s32 bond_mode;
 	__s32 num_slaves;
@@ -91,8 +90,8 @@
 {
 	__s32 slave_id; /* Used as an IN param to the BOND_SLAVE_INFO_QUERY ioctl */
 	char slave_name[IFNAMSIZ];
-	char link;
-	char state;
+	__s8 link;
+	__s8 state;
 	__u32  link_failure_count;
 } ifslave;
 
@@ -115,3 +114,4 @@
  *  tab-width: 8
  * End:
  */
+
--- diff/include/linux/init_task.h	2003-10-09 09:47:17.000000000 +0100
+++ source/include/linux/init_task.h	2004-02-09 10:39:57.000000000 +0000
@@ -40,6 +40,7 @@
 	.mmap_sem	= __RWSEM_INITIALIZER(name.mmap_sem),	\
 	.page_table_lock =  SPIN_LOCK_UNLOCKED, 		\
 	.mmlist		= LIST_HEAD_INIT(name.mmlist),		\
+	.cpu_vm_mask	= CPU_MASK_ALL,				\
 	.default_kioctx = INIT_KIOCTX(name.default_kioctx, name),	\
 }
 
@@ -56,6 +57,8 @@
 	.siglock	= SPIN_LOCK_UNLOCKED, 		\
 }
 
+extern struct group_info init_groups;
+
 /*
  *  INIT_TASK is used to set up the first task table, touch at
  * your own risk!. Base=0, limit=0x1fffff (=2MB)
@@ -87,6 +90,7 @@
 	.real_timer	= {						\
 		.function	= it_real_fn				\
 	},								\
+	.group_info	= &init_groups,					\
 	.cap_effective	= CAP_INIT_EFF_SET,				\
 	.cap_inheritable = CAP_INIT_INH_SET,				\
 	.cap_permitted	= CAP_FULL_SET,					\
--- diff/include/linux/input.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/linux/input.h	2004-02-09 10:39:57.000000000 +0000
@@ -751,6 +751,27 @@
 
 #define init_input_dev(dev)	do { INIT_LIST_HEAD(&((dev)->h_list)); INIT_LIST_HEAD(&((dev)->node)); } while (0)
 
+#define SET_INPUT_KEYCODE(dev, scancode, val)			\
+	do {							\
+		switch (dev->keycodesize) {			\
+			case 1: {				\
+				u8 *k = (u8 *)dev->keycode;	\
+				k[scancode] = val;		\
+				break;				\
+			}					\
+			case 2: {				\
+				u16 *k = (u16 *)dev->keycode;	\
+				k[scancode] = val;		\
+				break;				\
+			}					\
+			case 4: {				\
+				u32 *k = (u32 *)dev->keycode;	\
+				k[scancode] = val;		\
+				break;				\
+			}					\
+		}						\
+	} while (0)
+
 struct input_dev {
 
 	void *private;
--- diff/include/linux/interrupt.h	2003-09-30 15:46:20.000000000 +0100
+++ source/include/linux/interrupt.h	2004-02-09 10:39:57.000000000 +0000
@@ -211,6 +211,7 @@
 }
 
 extern void tasklet_kill(struct tasklet_struct *t);
+extern void tasklet_kill_immediate(struct tasklet_struct *t, unsigned int cpu);
 extern void tasklet_init(struct tasklet_struct *t,
 			 void (*func)(unsigned long), unsigned long data);
 
--- diff/include/linux/irq_cpustat.h	2003-07-11 09:39:50.000000000 +0100
+++ source/include/linux/irq_cpustat.h	2004-02-09 10:39:57.000000000 +0000
@@ -19,11 +19,7 @@
 
 #ifndef __ARCH_IRQ_STAT
 extern irq_cpustat_t irq_stat[];		/* defined in asm/hardirq.h */
-#ifdef CONFIG_SMP
 #define __IRQ_STAT(cpu, member)	(irq_stat[cpu].member)
-#else
-#define __IRQ_STAT(cpu, member)	((void)(cpu), irq_stat[0].member)
-#endif	
 #endif
 
   /* arch independent irq_stat fields */
--- diff/include/linux/isdn.h	2003-09-17 12:28:12.000000000 +0100
+++ source/include/linux/isdn.h	2004-02-09 10:39:57.000000000 +0000
@@ -192,7 +192,6 @@
 
 #include <linux/ppp_defs.h>
 #include <linux/if_ppp.h>
-#include <linux/if_pppvar.h>
 
 #include <linux/isdn_ppp.h>
 #endif
--- diff/include/linux/kernel.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/linux/kernel.h	2004-02-09 10:39:57.000000000 +0000
@@ -72,6 +72,9 @@
 extern int snprintf(char * buf, size_t size, const char * fmt, ...)
 	__attribute__ ((format (printf, 3, 4)));
 extern int vsnprintf(char *buf, size_t size, const char *fmt, va_list args);
+extern int scnprintf(char * buf, size_t size, const char * fmt, ...)
+	__attribute__ ((format (printf, 3, 4)));
+extern int vscnprintf(char *buf, size_t size, const char *fmt, va_list args);
 
 extern int sscanf(const char *, const char *, ...)
 	__attribute__ ((format (scanf,2,3)));
@@ -90,6 +93,7 @@
 unsigned long int_sqrt(unsigned long);
 
 extern int printk_ratelimit(void);
+extern int __printk_ratelimit(int ratelimit_jiffies, int ratelimit_burst);
 
 static inline void console_silent(void)
 {
--- diff/include/linux/lapb.h	2002-10-16 04:28:34.000000000 +0100
+++ source/include/linux/lapb.h	2004-02-09 10:39:57.000000000 +0000
@@ -24,12 +24,12 @@
 #define	LAPB_DCE		0x04
 
 struct lapb_register_struct {
-	void (*connect_confirmation)(void *token, int reason);
-	void (*connect_indication)(void *token, int reason);
-	void (*disconnect_confirmation)(void *token, int reason);
-	void (*disconnect_indication)(void *token, int reason);
-	int  (*data_indication)(void *token, struct sk_buff *skb);
-	void (*data_transmit)(void *token, struct sk_buff *skb);
+	void (*connect_confirmation)(struct net_device *dev, int reason);
+	void (*connect_indication)(struct net_device *dev, int reason);
+	void (*disconnect_confirmation)(struct net_device *dev, int reason);
+	void (*disconnect_indication)(struct net_device *dev, int reason);
+	int  (*data_indication)(struct net_device *dev, struct sk_buff *skb);
+	void (*data_transmit)(struct net_device *dev, struct sk_buff *skb);
 };
 
 struct lapb_parms_struct {
@@ -44,13 +44,13 @@
 	unsigned int mode;
 };
 
-extern int lapb_register(void *token, struct lapb_register_struct *callbacks);
-extern int lapb_unregister(void *token);
-extern int lapb_getparms(void *token, struct lapb_parms_struct *parms);
-extern int lapb_setparms(void *token, struct lapb_parms_struct *parms);
-extern int lapb_connect_request(void *token);
-extern int lapb_disconnect_request(void *token);
-extern int lapb_data_request(void *token, struct sk_buff *skb);
-extern int lapb_data_received(void *token, struct sk_buff *skb);
+extern int lapb_register(struct net_device *dev, struct lapb_register_struct *callbacks);
+extern int lapb_unregister(struct net_device *dev);
+extern int lapb_getparms(struct net_device *dev, struct lapb_parms_struct *parms);
+extern int lapb_setparms(struct net_device *dev, struct lapb_parms_struct *parms);
+extern int lapb_connect_request(struct net_device *dev);
+extern int lapb_disconnect_request(struct net_device *dev);
+extern int lapb_data_request(struct net_device *dev, struct sk_buff *skb);
+extern int lapb_data_received(struct net_device *dev, struct sk_buff *skb);
 
 #endif
--- diff/include/linux/limits.h	2002-10-16 04:29:02.000000000 +0100
+++ source/include/linux/limits.h	2004-02-09 10:39:57.000000000 +0000
@@ -3,7 +3,7 @@
 
 #define NR_OPEN	        1024
 
-#define NGROUPS_MAX       32	/* supplemental group IDs are available */
+#define NGROUPS_MAX    65536	/* supplemental group IDs are available */
 #define ARG_MAX       131072	/* # bytes of args + environ for exec() */
 #define CHILD_MAX        999    /* no limit :-) */
 #define OPEN_MAX         256	/* # open files a process may have */
--- diff/include/linux/list.h	2004-01-19 10:22:59.000000000 +0000
+++ source/include/linux/list.h	2004-02-09 10:39:57.000000000 +0000
@@ -142,8 +142,11 @@
  * Note: list_empty on entry does not return true after this, the entry is
  * in an undefined state.
  */
+#include <linux/kernel.h>	/* BUG_ON */
 static inline void list_del(struct list_head *entry)
 {
+	BUG_ON(entry->prev->next != entry);
+	BUG_ON(entry->next->prev != entry);
 	__list_del(entry->prev, entry->next);
 	entry->next = LIST_POISON1;
 	entry->prev = LIST_POISON2;
--- diff/include/linux/loop.h	2003-08-20 14:16:34.000000000 +0100
+++ source/include/linux/loop.h	2004-02-09 10:39:57.000000000 +0000
@@ -34,8 +34,9 @@
 	loff_t		lo_sizelimit;
 	int		lo_flags;
 	int		(*transfer)(struct loop_device *, int cmd,
-				    char *raw_buf, char *loop_buf, int size,
-				    sector_t real_block);
+				    struct page *raw_page, unsigned raw_off,
+				    struct page *loop_page, unsigned loop_off,
+				    int size, sector_t real_block);
 	char		lo_file_name[LO_NAME_SIZE];
 	char		lo_crypt_name[LO_NAME_SIZE];
 	char		lo_encrypt_key[LO_KEY_SIZE];
@@ -70,8 +71,7 @@
 /*
  * Loop flags
  */
-#define LO_FLAGS_DO_BMAP	1
-#define LO_FLAGS_READ_ONLY	2
+#define LO_FLAGS_READ_ONLY	1
 
 #include <asm/posix_types.h>	/* for __kernel_old_dev_t */
 #include <asm/types.h>		/* for __u64 */
@@ -128,8 +128,10 @@
 /* Support for loadable transfer modules */
 struct loop_func_table {
 	int number;	/* filter type */ 
-	int (*transfer)(struct loop_device *lo, int cmd, char *raw_buf,
-			char *loop_buf, int size, sector_t real_block);
+	int (*transfer)(struct loop_device *lo, int cmd,
+			struct page *raw_page, unsigned raw_off,
+			struct page *loop_page, unsigned loop_off,
+			int size, sector_t real_block);
 	int (*init)(struct loop_device *, const struct loop_info64 *); 
 	/* release is called from loop_unregister_transfer or clr_fd */
 	int (*release)(struct loop_device *); 
--- diff/include/linux/miscdevice.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/linux/miscdevice.h	2004-02-09 10:39:57.000000000 +0000
@@ -3,7 +3,6 @@
 #include <linux/module.h>
 #include <linux/major.h>
 
-#define BUSMOUSE_MINOR 0
 #define PSMOUSE_MINOR  1
 #define MS_BUSMOUSE_MINOR 2
 #define ATIXL_BUSMOUSE_MINOR 3
--- diff/include/linux/mm.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/linux/mm.h	2004-02-09 10:39:57.000000000 +0000
@@ -12,6 +12,7 @@
 #include <linux/mmzone.h>
 #include <linux/rbtree.h>
 #include <linux/fs.h>
+#include <linux/elf.h>
 
 #ifndef CONFIG_DISCONTIGMEM          /* Don't use mapnrs, do it properly */
 extern unsigned long max_mapnr;
@@ -643,31 +644,24 @@
 #endif
 
 #ifndef CONFIG_ARCH_GATE_AREA
-#ifdef AT_SYSINFO_EHDR
 static inline int in_gate_area(struct task_struct *task, unsigned long addr)
 {
+#ifdef AT_SYSINFO_EHDR
 	if ((addr >= FIXADDR_USER_START) && (addr < FIXADDR_USER_END))
 		return 1;
-	else
-		return 0;
+#endif
+	return 0;
 }
 
 extern struct vm_area_struct gate_vma;
 static inline struct vm_area_struct *get_gate_vma(struct task_struct *tsk)
 {
+#ifdef AT_SYSINFO_EHDR
 	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/include/linux/mmzone.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/linux/mmzone.h	2004-02-09 10:39:57.000000000 +0000
@@ -149,6 +149,12 @@
 	unsigned long		zone_start_pfn;
 
 	/*
+	 * dummy page used as place holder during scanning of
+	 * active_list in refill_inactive_zone()
+	 */
+	struct page *scan_page;
+
+	/*
 	 * rarely used fields:
 	 */
 	char			*name;
@@ -205,7 +211,6 @@
 	struct zonelist node_zonelists[MAX_NR_ZONES];
 	int nr_zones;
 	struct page *node_mem_map;
-	unsigned long *valid_addr_bitmap;
 	struct bootmem_data *bdata;
 	unsigned long node_start_pfn;
 	unsigned long node_present_pages; /* total number of physical pages */
@@ -214,6 +219,7 @@
 	int node_id;
 	struct pglist_data *pgdat_next;
 	wait_queue_head_t       kswapd_wait;
+	struct task_struct *kswapd;
 } pg_data_t;
 
 #define node_present_pages(nid)	(NODE_DATA(nid)->node_present_pages)
@@ -295,12 +301,6 @@
 int min_free_kbytes_sysctl_handler(struct ctl_table *, int, struct file *, 
 					  void *, size_t *);
 
-#ifdef CONFIG_NUMA
-#define MAX_NR_MEMBLKS	BITS_PER_LONG /* Max number of Memory Blocks */
-#else /* !CONFIG_NUMA */
-#define MAX_NR_MEMBLKS	1
-#endif /* CONFIG_NUMA */
-
 #include <linux/topology.h>
 /* Returns the number of the current Node. */
 #define numa_node_id()		(cpu_to_node(smp_processor_id()))
@@ -343,7 +343,6 @@
 #endif
 
 extern DECLARE_BITMAP(node_online_map, MAX_NUMNODES);
-extern DECLARE_BITMAP(memblk_online_map, MAX_NR_MEMBLKS);
 
 #if defined(CONFIG_DISCONTIGMEM) || defined(CONFIG_NUMA)
 
@@ -361,20 +360,6 @@
 	return num;
 }
 
-#define memblk_online(memblk)		test_bit(memblk, memblk_online_map)
-#define memblk_set_online(memblk)	set_bit(memblk, memblk_online_map)
-#define memblk_set_offline(memblk)	clear_bit(memblk, memblk_online_map)
-static inline unsigned int num_online_memblks(void)
-{
-	int i, num = 0;
-
-	for(i = 0; i < MAX_NR_MEMBLKS; i++){
-		if (memblk_online(i))
-			num++;
-	}
-	return num;
-}
-
 #else /* !CONFIG_DISCONTIGMEM && !CONFIG_NUMA */
 
 #define node_online(node) \
@@ -385,14 +370,6 @@
 	({ BUG_ON((node) != 0); clear_bit(node, node_online_map); })
 #define num_online_nodes()	1
 
-#define memblk_online(memblk) \
-	({ BUG_ON((memblk) != 0); test_bit(memblk, memblk_online_map); })
-#define memblk_set_online(memblk) \
-	({ BUG_ON((memblk) != 0); set_bit(memblk, memblk_online_map); })
-#define memblk_set_offline(memblk) \
-	({ BUG_ON((memblk) != 0); clear_bit(memblk, memblk_online_map); })
-#define num_online_memblks()		1
-
 #endif /* CONFIG_DISCONTIGMEM || CONFIG_NUMA */
 #endif /* !__ASSEMBLY__ */
 #endif /* __KERNEL__ */
--- diff/include/linux/mod_devicetable.h	2003-06-09 14:18:20.000000000 +0100
+++ source/include/linux/mod_devicetable.h	2004-02-09 10:39:57.000000000 +0000
@@ -148,4 +148,21 @@
 #define CCW_DEVICE_ID_MATCH_DEVICE_MODEL	0x08
 
 
+#define PNP_ID_LEN	8
+#define PNP_MAX_DEVICES	8
+
+struct pnp_device_id {
+	__u8 id[PNP_ID_LEN];
+	kernel_ulong_t driver_data;
+};
+
+struct pnp_card_device_id {
+	__u8 id[PNP_ID_LEN];
+	kernel_ulong_t driver_data;
+	struct {
+		__u8 id[PNP_ID_LEN];
+	} devs[PNP_MAX_DEVICES];
+};
+
+
 #endif /* LINUX_MOD_DEVICETABLE_H */
--- diff/include/linux/netdevice.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/linux/netdevice.h	2004-02-09 10:39:57.000000000 +0000
@@ -452,6 +452,12 @@
 						     unsigned char *haddr);
 	int			(*neigh_setup)(struct net_device *dev, struct neigh_parms *);
 	int			(*accept_fastpath)(struct net_device *, struct dst_entry*);
+#ifdef CONFIG_NETPOLL_RX
+	int			netpoll_rx;
+#endif
+#ifdef CONFIG_NET_POLL_CONTROLLER
+	void                    (*poll_controller)(struct net_device *dev);
+#endif
 
 	/* bridge stuff */
 	struct net_bridge_port	*br_port;
@@ -470,8 +476,15 @@
 	/* class/net/name entry */
 	struct class_device	class_dev;
 	struct net_device_stats* (*last_stats)(struct net_device *);
+	/* how much padding had been added by alloc_netdev() */
+	int padded;
 };
 
+static inline void *netdev_priv(struct net_device *dev)
+{
+	return (char *)dev + ((sizeof(struct net_device) + 31) & ~31);
+}
+
 #define SET_MODULE_OWNER(dev) do { } while (0)
 /* Set the sysfs physical device reference for the network logical device
  * if set prior to registration will cause a symlink during initialization.
@@ -496,6 +509,7 @@
 
 extern int			netdev_boot_setup_add(char *name, struct ifmap *map);
 extern int 			netdev_boot_setup_check(struct net_device *dev);
+extern unsigned long		netdev_boot_base(const char *prefix, int unit);
 extern struct net_device    *dev_getbyhwaddr(unsigned short type, char *hwaddr);
 extern struct net_device *__dev_getfirstbyhwtype(unsigned short type);
 extern struct net_device *dev_getfirstbyhwtype(unsigned short type);
@@ -533,6 +547,9 @@
 extern struct net_device	*dev_get_by_index(int ifindex);
 extern struct net_device	*__dev_get_by_index(int ifindex);
 extern int		dev_restart(struct net_device *dev);
+#ifdef CONFIG_NETPOLL_TRAP
+extern int		netpoll_trap(void);
+#endif
 
 typedef int gifconf_func_t(struct net_device * dev, char * bufptr, int len);
 extern int		register_gifconf(unsigned int family, gifconf_func_t * gifconf);
@@ -591,12 +608,20 @@
 
 static inline void netif_wake_queue(struct net_device *dev)
 {
+#ifdef CONFIG_NETPOLL_TRAP
+	if (netpoll_trap())
+		return;
+#endif
 	if (test_and_clear_bit(__LINK_STATE_XOFF, &dev->state))
 		__netif_schedule(dev);
 }
 
 static inline void netif_stop_queue(struct net_device *dev)
 {
+#ifdef CONFIG_NETPOLL_TRAP
+	if (netpoll_trap())
+		return;
+#endif
 	set_bit(__LINK_STATE_XOFF, &dev->state);
 }
 
--- diff/include/linux/nfs4.h	2003-10-09 09:47:34.000000000 +0100
+++ source/include/linux/nfs4.h	2004-02-09 10:39:57.000000000 +0000
@@ -88,6 +88,76 @@
 	OP_WRITE = 38,
 };
 
+enum nfsstat4 {
+	NFS4_OK = 0,
+	NFS4ERR_PERM = 1,
+	NFS4ERR_NOENT = 2,
+	NFS4ERR_IO = 5,
+	NFS4ERR_NXIO = 6,
+	NFS4ERR_ACCESS = 13,
+	NFS4ERR_EXIST = 17,
+	NFS4ERR_XDEV = 18,
+	/* Unused/reserved 19 */
+	NFS4ERR_NOTDIR = 20,
+	NFS4ERR_ISDIR = 21,
+	NFS4ERR_INVAL = 22,
+	NFS4ERR_FBIG = 27,
+	NFS4ERR_NOSPC = 28,
+	NFS4ERR_ROFS = 30,
+	NFS4ERR_MLINK = 31,
+	NFS4ERR_NAMETOOLONG = 63,
+	NFS4ERR_NOTEMPTY = 66,
+	NFS4ERR_DQUOT = 69,
+	NFS4ERR_STALE = 70,
+	NFS4ERR_BADHANDLE = 10001,
+	NFS4ERR_BAD_COOKIE = 10003,
+	NFS4ERR_NOTSUPP = 10004,
+	NFS4ERR_TOOSMALL = 10005,
+	NFS4ERR_SERVERFAULT = 10006,
+	NFS4ERR_BADTYPE = 10007,
+	NFS4ERR_DELAY = 10008,
+	NFS4ERR_SAME = 10009,
+	NFS4ERR_DENIED = 10010,
+	NFS4ERR_EXPIRED = 10011,
+	NFS4ERR_LOCKED = 10012,
+	NFS4ERR_GRACE = 10013,
+	NFS4ERR_FHEXPIRED = 10014,
+	NFS4ERR_SHARE_DENIED = 10015,
+	NFS4ERR_WRONGSEC = 10016,
+	NFS4ERR_CLID_INUSE = 10017,
+	NFS4ERR_RESOURCE = 10018,
+	NFS4ERR_MOVED = 10019,
+	NFS4ERR_NOFILEHANDLE = 10020,
+	NFS4ERR_MINOR_VERS_MISMATCH = 10021,
+	NFS4ERR_STALE_CLIENTID = 10022,
+	NFS4ERR_STALE_STATEID = 10023,
+	NFS4ERR_OLD_STATEID = 10024,
+	NFS4ERR_BAD_STATEID = 10025,
+	NFS4ERR_BAD_SEQID = 10026,
+	NFS4ERR_NOT_SAME = 10027,
+	NFS4ERR_LOCK_RANGE = 10028,
+	NFS4ERR_SYMLINK = 10029,
+	NFS4ERR_RESTOREFH = 10030,
+	NFS4ERR_LEASE_MOVED = 10031,
+	NFS4ERR_ATTRNOTSUPP = 10032,
+	NFS4ERR_NO_GRACE = 10033,
+	NFS4ERR_RECLAIM_BAD = 10034,
+	NFS4ERR_RECLAIM_CONFLICT = 10035,
+	NFS4ERR_BADXDR = 10036,
+	NFS4ERR_LOCKS_HELD = 10037,
+	NFS4ERR_OPENMODE = 10038,
+	NFS4ERR_BADOWNER = 10039,
+	NFS4ERR_BADCHAR = 10040,
+	NFS4ERR_BADNAME = 10041,
+	NFS4ERR_BAD_RANGE = 10042,
+	NFS4ERR_LOCK_NOTSUPP = 10043,
+	NFS4ERR_OP_ILLEGAL = 10044,
+	NFS4ERR_DEADLOCK = 10045,
+	NFS4ERR_FILE_OPEN = 10046,
+	NFS4ERR_ADMIN_REVOKED = 10047,
+	NFS4ERR_CB_PATH_DOWN = 10048
+};
+
 /*
  * Note: NF4BAD is not actually part of the protocol; it is just used
  * internally by nfsd.
@@ -219,8 +289,17 @@
 	NFSPROC4_CLNT_COMMIT,
 	NFSPROC4_CLNT_OPEN,
 	NFSPROC4_CLNT_OPEN_CONFIRM,
+	NFSPROC4_CLNT_OPEN_RECLAIM,
+	NFSPROC4_CLNT_OPEN_DOWNGRADE,
 	NFSPROC4_CLNT_CLOSE,
 	NFSPROC4_CLNT_SETATTR,
+	NFSPROC4_CLNT_FSINFO,
+	NFSPROC4_CLNT_RENEW,
+	NFSPROC4_CLNT_SETCLIENTID,
+	NFSPROC4_CLNT_SETCLIENTID_CONFIRM,
+	NFSPROC4_CLNT_LOCK,
+	NFSPROC4_CLNT_LOCKT,
+	NFSPROC4_CLNT_LOCKU,
 };
 
 #endif
--- diff/include/linux/nfs_fs.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/linux/nfs_fs.h	2004-02-09 10:39:57.000000000 +0000
@@ -28,6 +28,7 @@
 #include <linux/nfs3.h>
 #include <linux/nfs4.h>
 #include <linux/nfs_xdr.h>
+#include <linux/workqueue.h>
 
 /*
  * Enable debugging support for nfs client.
@@ -98,7 +99,7 @@
 	/*
 	 * Various flags
 	 */
-	unsigned short		flags;
+	unsigned int		flags;
 
 	/*
 	 * read_cache_jiffies is when we started read-caching this inode,
@@ -117,19 +118,22 @@
 	 *
 	 *	mtime != read_cache_mtime
 	 */
+	unsigned long		readdir_timestamp;
 	unsigned long		read_cache_jiffies;
-	struct timespec		read_cache_ctime;
-	struct timespec		read_cache_mtime;
-	__u64			read_cache_isize;
 	unsigned long		attrtimeo;
 	unsigned long		attrtimeo_timestamp;
 	__u64			change_attr;		/* v4 only */
 
+	/* "Generation counter" for the attribute cache. This is
+	 * bumped whenever we update the metadata on the
+	 * server.
+	 */
+	unsigned long		cache_change_attribute;
 	/*
-	 * Timestamp that dates the change made to read_cache_mtime.
-	 * This is of use for dentry revalidation
+	 * Counter indicating the number of outstanding requests that
+	 * will cause a file data update.
 	 */
-	unsigned long		cache_mtime_jiffies;
+	atomic_t		data_updates;
 
 	struct nfs_access_cache	cache_access;
 
@@ -169,7 +173,9 @@
 #define NFS_INO_STALE		0x0001		/* possible stale inode */
 #define NFS_INO_ADVISE_RDPLUS   0x0002          /* advise readdirplus */
 #define NFS_INO_REVALIDATING	0x0004		/* revalidating attrs */
-#define NFS_INO_FLUSH		0x0008		/* inode is due for flushing */
+#define NFS_INO_INVALID_ATTR	0x0008		/* cached attrs are invalid */
+#define NFS_INO_INVALID_DATA	0x0010		/* cached data is invalid */
+#define NFS_INO_INVALID_ATIME	0x0020		/* cached atime is invalid */
 #define NFS_INO_FAKE_ROOT	0x0080		/* root inode placeholder */
 
 static inline struct nfs_inode *NFS_I(struct inode *inode)
@@ -185,15 +191,7 @@
 #define NFS_ADDR(inode)			(RPC_PEERADDR(NFS_CLIENT(inode)))
 #define NFS_COOKIEVERF(inode)		(NFS_I(inode)->cookieverf)
 #define NFS_READTIME(inode)		(NFS_I(inode)->read_cache_jiffies)
-#define NFS_MTIME_UPDATE(inode)		(NFS_I(inode)->cache_mtime_jiffies)
-#define NFS_CACHE_CTIME(inode)		(NFS_I(inode)->read_cache_ctime)
-#define NFS_CACHE_MTIME(inode)		(NFS_I(inode)->read_cache_mtime)
-#define NFS_CACHE_ISIZE(inode)		(NFS_I(inode)->read_cache_isize)
 #define NFS_CHANGE_ATTR(inode)		(NFS_I(inode)->change_attr)
-#define NFS_CACHEINV(inode) \
-do { \
-	NFS_READTIME(inode) = jiffies - NFS_MAXATTRTIMEO(inode) - 1; \
-} while (0)
 #define NFS_ATTRTIMEO(inode)		(NFS_I(inode)->attrtimeo)
 #define NFS_MINATTRTIMEO(inode) \
 	(S_ISDIR(inode->i_mode)? NFS_SERVER(inode)->acdirmin \
@@ -210,6 +208,17 @@
 
 #define NFS_FILEID(inode)		(NFS_I(inode)->fileid)
 
+static inline int nfs_caches_unstable(struct inode *inode)
+{
+	return atomic_read(&NFS_I(inode)->data_updates) != 0;
+}
+
+static inline void NFS_CACHEINV(struct inode *inode)
+{
+	if (!nfs_caches_unstable(inode))
+		NFS_FLAGS(inode) |= NFS_INO_INVALID_ATTR;
+}
+
 static inline int nfs_server_capable(struct inode *inode, int cap)
 {
 	return NFS_SERVER(inode)->caps & cap;
@@ -226,13 +235,37 @@
 	return ((loff_t)page->index) << PAGE_CACHE_SHIFT;
 }
 
+/**
+ * nfs_save_change_attribute - Returns the inode attribute change cookie
+ * @inode - pointer to inode
+ * The "change attribute" is updated every time we finish an operation
+ * that will result in a metadata change on the server.
+ */
+static inline long nfs_save_change_attribute(struct inode *inode)
+{
+	return NFS_I(inode)->cache_change_attribute;
+}
+
+/**
+ * nfs_verify_change_attribute - Detects NFS inode cache updates
+ * @inode - pointer to inode
+ * @chattr - previously saved change attribute
+ * Return "false" if metadata has been updated (or is in the process of
+ * being updated) since the change attribute was saved.
+ */
+static inline int nfs_verify_change_attribute(struct inode *inode, unsigned long chattr)
+{
+	return !nfs_caches_unstable(inode)
+		&& chattr == NFS_I(inode)->cache_change_attribute;
+}
+
 /*
  * linux/fs/nfs/inode.c
  */
 extern void nfs_zap_caches(struct inode *);
 extern struct inode *nfs_fhget(struct super_block *, struct nfs_fh *,
 				struct nfs_fattr *);
-extern int __nfs_refresh_inode(struct inode *, struct nfs_fattr *);
+extern int nfs_refresh_inode(struct inode *, struct nfs_fattr *);
 extern int nfs_getattr(struct vfsmount *, struct dentry *, struct kstat *);
 extern int nfs_permission(struct inode *, int, struct nameidata *);
 extern void nfs_set_mmcred(struct inode *, struct rpc_cred *);
@@ -240,6 +273,13 @@
 extern int nfs_release(struct inode *, struct file *);
 extern int __nfs_revalidate_inode(struct nfs_server *, struct inode *);
 extern int nfs_setattr(struct dentry *, struct iattr *);
+extern void nfs_begin_attr_update(struct inode *);
+extern void nfs_end_attr_update(struct inode *);
+extern void nfs_begin_data_update(struct inode *);
+extern void nfs_end_data_update(struct inode *);
+
+/* linux/net/ipv4/ipconfig.c: trims ip addr off front of name, too. */
+extern u32 root_nfs_parse_addr(char *name); /*__init*/
 
 /*
  * linux/fs/nfs/file.c
@@ -382,20 +422,27 @@
 /*
  * inline functions
  */
-static inline int
-nfs_revalidate_inode(struct nfs_server *server, struct inode *inode)
+
+static inline int nfs_attribute_timeout(struct inode *inode)
 {
-	if (time_before(jiffies, NFS_READTIME(inode)+NFS_ATTRTIMEO(inode)))
-		return NFS_STALE(inode) ? -ESTALE : 0;
-	return __nfs_revalidate_inode(server, inode);
+	struct nfs_inode *nfsi = NFS_I(inode);
+
+	return time_after(jiffies, nfsi->read_cache_jiffies+nfsi->attrtimeo);
 }
 
-static inline int
-nfs_refresh_inode(struct inode *inode, struct nfs_fattr *fattr)
+/**
+ * nfs_revalidate_inode - Revalidate the inode attributes
+ * @server - pointer to nfs_server struct
+ * @inode - pointer to inode struct
+ *
+ * Updates inode attribute information by retrieving the data from the server.
+ */
+static inline int nfs_revalidate_inode(struct nfs_server *server, struct inode *inode)
 {
-	if ((fattr->valid & NFS_ATTR_FATTR) == 0)
-		return 0;
-	return __nfs_refresh_inode(inode,fattr);
+	if (!(NFS_FLAGS(inode) & (NFS_INO_INVALID_ATTR|NFS_INO_INVALID_DATA))
+			&& !nfs_attribute_timeout(inode))
+		return NFS_STALE(inode) ? -ESTALE : 0;
+	return __nfs_revalidate_inode(server, inode);
 }
 
 static inline loff_t
@@ -437,6 +484,8 @@
 
 #ifdef CONFIG_NFS_V4
 
+struct idmap;
+
 /*
  * In a seqid-mutating op, this macro controls which error return
  * values trigger incrementation of the seqid.
@@ -464,6 +513,7 @@
 enum nfs4_client_state {
 	NFS4CLNT_OK  = 0,
 	NFS4CLNT_NEW,
+	NFS4CLNT_SETUP_STATE,
 };
 
 /*
@@ -474,7 +524,8 @@
 	struct in_addr		cl_addr;	/* Server identifier */
 	u64			cl_clientid;	/* constant */
 	nfs4_verifier		cl_confirm;
-	enum nfs4_client_state	cl_state;
+	unsigned long		cl_state;
+	long			cl_generation;
 
 	u32			cl_lockowner_id;
 
@@ -489,6 +540,27 @@
 	int			cl_nunused;
 	spinlock_t		cl_lock;
 	atomic_t		cl_count;
+
+	struct rpc_clnt *	cl_rpcclient;
+	struct rpc_cred *	cl_cred;
+
+	struct list_head	cl_superblocks;	/* List of nfs_server structs */
+
+	unsigned long		cl_lease_time;
+	unsigned long		cl_last_renewal;
+	struct work_struct	cl_renewd;
+	struct work_struct	cl_recoverd;
+
+	wait_queue_head_t	cl_waitq;
+	struct rpc_wait_queue	cl_rpcwaitq;
+
+	/* idmapper */
+	struct idmap *		cl_idmap;
+
+	/* Our own IP address, as a null-terminated string.
+	 * This is used to generate the clientid, and the callback address.
+	 */
+	char			cl_ipaddr[16];
 };
 
 /*
@@ -508,6 +580,7 @@
 	u32                  so_seqid;   /* protected by so_sema */
 	unsigned int         so_flags;   /* protected by so_sema */
 	atomic_t	     so_count;
+	long		     so_generation;
 
 	struct rpc_cred	     *so_cred;	 /* Associated cred */
 	struct list_head     so_states;
@@ -515,73 +588,105 @@
 
 /*
  * struct nfs4_state maintains the client-side state for a given
- * (state_owner,inode) tuple.
+ * (state_owner,inode) tuple (OPEN) or state_owner (LOCK).
  *
+ * OPEN:
  * In order to know when to OPEN_DOWNGRADE or CLOSE the state on the server,
  * we need to know how many files are open for reading or writing on a
  * given inode. This information too is stored here.
+ *
+ * LOCK: one nfs4_state (LOCK) to hold the lock stateid nfs4_state(OPEN)
  */
+
+struct nfs4_lock_state {
+	struct list_head	ls_locks;	/* Other lock stateids */
+	fl_owner_t		ls_owner;	/* POSIX lock owner */
+	struct nfs4_state *	ls_parent;	/* Parent nfs4_state */
+	u32			ls_seqid;
+	u32			ls_id;
+	nfs4_stateid		ls_stateid;
+	atomic_t		ls_count;
+};
+
+/* bits for nfs4_state->flags */
+enum {
+	LK_STATE_IN_USE,
+};
+
 struct nfs4_state {
 	struct list_head open_states;	/* List of states for the same state_owner */
 	struct list_head inode_states;	/* List of states for the same inode */
+	struct list_head lock_states;	/* List of subservient lock stateids */
 
 	struct nfs4_state_owner *owner;	/* Pointer to the open owner */
 	struct inode *inode;		/* Pointer to the inode */
-	pid_t pid;			/* Thread that called OPEN */
+
+	unsigned long flags;		/* Do we hold any locks? */
+	struct semaphore lock_sema;	/* Serializes file locking operations */
+	rwlock_t state_lock;		/* Protects the lock_states list */
 
 	nfs4_stateid stateid;
 
+	unsigned int nreaders;
+	unsigned int nwriters;
 	int state;			/* State on the server (R,W, or RW) */
 	atomic_t count;
 };
 
 
+extern struct dentry_operations nfs4_dentry_operations;
+extern struct inode_operations nfs4_dir_inode_operations;
+
 /* nfs4proc.c */
-extern int nfs4_proc_renew(struct nfs_server *server);
+extern int nfs4_proc_setclientid(struct nfs4_client *, u32, unsigned short);
+extern int nfs4_proc_setclientid_confirm(struct nfs4_client *);
+extern int nfs4_open_reclaim(struct nfs4_state_owner *, struct nfs4_state *);
+extern int nfs4_proc_async_renew(struct nfs4_client *);
+extern int nfs4_proc_renew(struct nfs4_client *);
 extern int nfs4_do_close(struct inode *, struct nfs4_state *);
+int nfs4_do_downgrade(struct inode *inode, struct nfs4_state *state, mode_t mode);
+extern int nfs4_wait_clnt_recover(struct rpc_clnt *, struct nfs4_client *);
+extern struct inode *nfs4_atomic_open(struct inode *, struct dentry *, struct nameidata *);
+extern int nfs4_open_revalidate(struct inode *, struct dentry *, int);
 
 /* nfs4renewd.c */
-extern int nfs4_init_renewd(struct nfs_server *server);
+extern void nfs4_schedule_state_renewal(struct nfs4_client *);
+extern void nfs4_renewd_prepare_shutdown(struct nfs_server *);
+extern void nfs4_kill_renewd(struct nfs4_client *);
 
 /* nfs4state.c */
+extern void init_nfsv4_state(struct nfs_server *);
+extern void destroy_nfsv4_state(struct nfs_server *);
 extern struct nfs4_client *nfs4_get_client(struct in_addr *);
 extern void nfs4_put_client(struct nfs4_client *clp);
+extern u32 nfs4_alloc_lockowner_id(struct nfs4_client *);
+
 extern struct nfs4_state_owner * nfs4_get_state_owner(struct nfs_server *, struct rpc_cred *);
 extern void nfs4_put_state_owner(struct nfs4_state_owner *);
 extern struct nfs4_state * nfs4_get_open_state(struct inode *, struct nfs4_state_owner *);
 extern void nfs4_put_open_state(struct nfs4_state *);
-extern void nfs4_increment_seqid(u32 status, struct nfs4_state_owner *sp);
-
-
-
+extern void nfs4_close_state(struct nfs4_state *, mode_t);
+extern struct nfs4_state *nfs4_find_state(struct inode *, struct rpc_cred *, mode_t mode);
+extern void nfs4_increment_seqid(int status, struct nfs4_state_owner *sp);
+extern int nfs4_handle_error(struct nfs_server *, int);
+extern void nfs4_schedule_state_recovery(struct nfs4_client *);
+extern struct nfs4_lock_state *nfs4_find_lock_state(struct nfs4_state *state, fl_owner_t);
+extern struct nfs4_lock_state *nfs4_alloc_lock_state(struct nfs4_state *state, fl_owner_t);
+extern void nfs4_put_lock_state(struct nfs4_lock_state *state);
+extern void nfs4_increment_lock_seqid(int status, struct nfs4_lock_state *ls);
+extern void nfs4_notify_setlk(struct inode *, struct file_lock *, struct nfs4_lock_state *);
+extern void nfs4_notify_unlck(struct inode *, struct file_lock *, struct nfs4_lock_state *);
+extern void nfs4_copy_stateid(nfs4_stateid *, struct nfs4_state *, fl_owner_t);
 
 
 
 struct nfs4_mount_data;
-static inline int
-create_nfsv4_state(struct nfs_server *server, struct nfs4_mount_data *data)
-{
-	server->nfs4_state = NULL;
-	return 0;
-}
-
-static inline void
-destroy_nfsv4_state(struct nfs_server *server)
-{
-	if (server->mnt_path) {
-		kfree(server->mnt_path);
-		server->mnt_path = NULL;
-	}
-	if (server->nfs4_state) {
-		nfs4_put_client(server->nfs4_state);
-		server->nfs4_state = NULL;
-	}
-}
 #else
-#define create_nfsv4_state(server, data)  0
+#define init_nfsv4_state(server)  do { } while (0)
 #define destroy_nfsv4_state(server)       do { } while (0)
 #define nfs4_put_state_owner(inode, owner) do { } while (0)
 #define nfs4_put_open_state(state) do { } while (0)
+#define nfs4_renewd_prepare_shutdown(server) do { } while (0)
 #endif
 
 #endif /* __KERNEL__ */
--- diff/include/linux/nfs_fs_sb.h	2003-08-20 14:16:14.000000000 +0100
+++ source/include/linux/nfs_fs_sb.h	2004-02-09 10:39:57.000000000 +0000
@@ -35,9 +35,9 @@
 	char			ip_addr[16];
 	char *			mnt_path;
 	struct nfs4_client *	nfs4_state;	/* all NFSv4 state starts here */
-	unsigned long		lease_time;	/* in jiffies */
-	unsigned long		last_renewal;	/* in jiffies */
-	void                   *idmap;
+	struct list_head	nfs4_siblings;	/* List of other nfs_server structs
+						 * that share the same clientid
+						 */
 #endif
 };
 
--- diff/include/linux/nfs_idmap.h	2003-05-21 11:50:10.000000000 +0100
+++ source/include/linux/nfs_idmap.h	2004-02-09 10:39:57.000000000 +0000
@@ -52,18 +52,23 @@
 #define IDMAP_STATUS_SUCCESS    0x08
 
 struct idmap_msg {
-	u_int8_t  im_type;
-	u_int8_t  im_conv;
-	char      im_name[IDMAP_NAMESZ];
-	u_int32_t im_id;
-	u_int8_t  im_status;
+	__u8  im_type;
+	__u8  im_conv;
+	char  im_name[IDMAP_NAMESZ];
+	__u32 im_id;
+	__u8  im_status;
 };
 
 #ifdef __KERNEL__
-void      *nfs_idmap_new(struct nfs_server *);
-void       nfs_idmap_delete(struct nfs_server *);
-int        nfs_idmap_id(struct nfs_server *, u_int8_t, char *, u_int,  uid_t *);
-int        nfs_idmap_name(struct nfs_server *, u_int8_t, uid_t, char *, u_int *);
+struct nfs4_client;
+
+void nfs_idmap_new(struct nfs4_client *);
+void nfs_idmap_delete(struct nfs4_client *);
+
+int nfs_map_name_to_uid(struct nfs4_client *, const char *, size_t, __u32 *);
+int nfs_map_group_to_gid(struct nfs4_client *, const char *, size_t, __u32 *);
+int nfs_map_uid_to_name(struct nfs4_client *, __u32, char *);
+int nfs_map_gid_to_group(struct nfs4_client *, __u32, char *);
 #endif /* __KERNEL__ */
 
 #endif /* NFS_IDMAP_H */
--- diff/include/linux/nfs_mount.h	2003-08-20 14:16:14.000000000 +0100
+++ source/include/linux/nfs_mount.h	2004-02-09 10:39:57.000000000 +0000
@@ -20,7 +20,8 @@
  * mount-to-kernel version compatibility.  Some of these aren't used yet
  * but here they are anyway.
  */
-#define NFS_MOUNT_VERSION	5
+#define NFS_MOUNT_VERSION	6
+#define NFS_MAX_CONTEXT_LEN	256
 
 struct nfs_mount_data {
 	int		version;		/* 1 */
@@ -41,6 +42,7 @@
 	unsigned int	bsize;			/* 3 */
 	struct nfs3_fh	root;			/* 4 */
 	int		pseudoflavor;		/* 5 */
+	char		context[NFS_MAX_CONTEXT_LEN + 1];	/* 6 */
 };
 
 /* bits in the flags field */
--- diff/include/linux/nfs_page.h	2003-10-27 09:20:39.000000000 +0000
+++ source/include/linux/nfs_page.h	2004-02-09 10:39:57.000000000 +0000
@@ -26,6 +26,7 @@
 	struct list_head	wb_list,	/* Defines state of page: */
 				*wb_list_head;	/*      read/write/commit */
 	struct file		*wb_file;
+	fl_owner_t		wb_lockowner;
 	struct inode		*wb_inode;
 	struct rpc_cred		*wb_cred;
 	struct nfs4_state	*wb_state;
--- diff/include/linux/nfs_xdr.h	2003-10-27 09:20:39.000000000 +0000
+++ source/include/linux/nfs_xdr.h	2004-02-09 10:39:57.000000000 +0000
@@ -109,7 +109,6 @@
 };
 
 struct nfs_openres {
-	__u32                   status;
 	nfs4_stateid            stateid;
 	struct nfs_fh           fh;
 	struct nfs4_change_info * cinfo;
@@ -129,24 +128,95 @@
 };
 
 struct nfs_open_confirmres {
-	__u32                   status;
 	nfs4_stateid            stateid;
 };
 
 /*
+ * Arguments to the open_reclaim call.
+ */
+struct nfs_open_reclaimargs {
+	struct nfs_fh *		fh;
+	__u64			clientid;
+	__u32			seqid;
+	__u32			id;
+	__u32			share_access;
+	__u32			claim;
+	struct nfs4_getattr *   f_getattr;
+};
+
+/*
  * Arguments to the close call.
  */
 struct nfs_closeargs {
 	struct nfs_fh *         fh;
 	nfs4_stateid            stateid;
 	__u32                   seqid;
+	__u32			share_access;
 };
 
 struct nfs_closeres {
-	__u32                   status;
 	nfs4_stateid            stateid;
 };
+/*
+ *  * Arguments to the lock,lockt, and locku call.
+ *   */
+struct nfs_lowner {
+	__u64           clientid;
+	u32                     id;
+};
 
+struct nfs_open_to_lock {
+	__u32                   open_seqid;
+	nfs4_stateid            open_stateid;
+	__u32                   lock_seqid;
+	struct nfs_lowner       lock_owner;
+};
+
+struct nfs_exist_lock {
+	nfs4_stateid            stateid;
+	__u32                   seqid;
+};
+
+struct nfs_lock_opargs {
+	__u32                   reclaim;
+	__u32                   new_lock_owner;
+	union {
+		struct nfs_open_to_lock *open_lock;
+		struct nfs_exist_lock   *exist_lock;
+	} u;
+};
+
+struct nfs_locku_opargs {
+	__u32                   seqid;
+	nfs4_stateid            stateid;
+};
+
+struct nfs_lockargs {
+	struct nfs_fh *         fh;
+	__u32                   type;
+	__u64                   offset; 
+	__u64                   length; 
+	union {
+		struct nfs_lock_opargs  *lock;    /* LOCK  */
+		struct nfs_lowner       *lockt;  /* LOCKT */
+		struct nfs_locku_opargs *locku;  /* LOCKU */
+	} u;
+};
+
+struct nfs_lock_denied {
+	__u64                   offset;
+	__u64                   length;
+	__u32                   type;
+	struct nfs_lowner   	owner;
+};
+
+struct nfs_lockres {
+	union {
+		nfs4_stateid            stateid;/* LOCK success, LOCKU */
+		struct nfs_lock_denied  denied; /* LOCK failed, LOCKT success */
+	} u;
+	struct nfs_server *     server;
+};
 
 /*
  * Arguments to the read call.
@@ -449,7 +519,6 @@
         u32 *				gt_bmval;          /* request */
         struct nfs_fattr *		gt_attrs;          /* response */
 	struct nfs_fsstat *		gt_fsstat;         /* response */
-	struct nfs_fsinfo *		gt_fsinfo;         /* response */
 	struct nfs_pathconf *		gt_pathconf;       /* response */
 };
 
@@ -556,8 +625,6 @@
 		struct nfs4_rename	rename;
 		struct nfs4_client *	renew;
 		struct nfs4_setattr	setattr;
-		struct nfs4_setclientid	setclientid;
-		struct nfs4_client *	setclientid_confirm;
 	} u;
 };
 
@@ -594,6 +661,7 @@
 	struct rpc_task		task;
 	struct inode		*inode;
 	struct rpc_cred		*cred;
+	fl_owner_t		lockowner;
 	struct nfs_fattr	fattr;	/* fattr storage */
 	struct list_head	pages;	/* Coalesced read requests */
 	struct page		*pagevec[NFS_READ_MAXIOV];
@@ -609,6 +677,7 @@
 	struct rpc_task		task;
 	struct inode		*inode;
 	struct rpc_cred		*cred;
+	fl_owner_t		lockowner;
 	struct nfs_fattr	fattr;
 	struct nfs_writeverf	verf;
 	struct list_head	pages;		/* Coalesced requests we wish to flush */
@@ -627,6 +696,8 @@
  */
 struct nfs_rpc_ops {
 	int	version;		/* Protocol version */
+	struct dentry_operations *dentry_ops;
+	struct inode_operations *dir_inode_ops;
 
 	int	(*getroot) (struct nfs_server *, struct nfs_fh *,
 			    struct nfs_fattr *);
@@ -673,6 +744,7 @@
 	int	(*file_release) (struct inode *, struct file *);
 	void	(*request_init)(struct nfs_page *, struct file *);
 	int	(*request_compatible)(struct nfs_page *, struct file *, struct page *);
+	int	(*lock)(struct file *, int, struct file_lock *);
 };
 
 /*
--- diff/include/linux/nfsd/auth.h	2002-10-16 04:27:48.000000000 +0100
+++ source/include/linux/nfsd/auth.h	2004-02-09 10:39:57.000000000 +0000
@@ -21,7 +21,7 @@
  * Set the current process's fsuid/fsgid etc to those of the NFS
  * client user
  */
-void		nfsd_setuser(struct svc_rqst *, struct svc_export *);
+int nfsd_setuser(struct svc_rqst *, struct svc_export *);
 
 #endif /* __KERNEL__ */
 #endif /* LINUX_NFSD_AUTH_H */
--- diff/include/linux/parport.h	2003-05-21 11:49:56.000000000 +0100
+++ source/include/linux/parport.h	2004-02-09 10:39:57.000000000 +0000
@@ -311,6 +311,8 @@
 
 	int spintime;
 	atomic_t ref_count;
+
+	struct list_head full_list;
 };
 
 #define DEFAULT_SPIN_TIME 500 /* us */
--- diff/include/linux/parport_pc.h	2003-05-21 11:49:56.000000000 +0100
+++ source/include/linux/parport_pc.h	2004-02-09 10:39:57.000000000 +0000
@@ -41,7 +41,7 @@
 	struct pci_dev *dev;
 };
 
-extern __inline__ void parport_pc_write_data(struct parport *p, unsigned char d)
+static __inline__ void parport_pc_write_data(struct parport *p, unsigned char d)
 {
 #ifdef DEBUG_PARPORT
 	printk (KERN_DEBUG "parport_pc_write_data(%p,0x%02x)\n", p, d);
@@ -49,7 +49,7 @@
 	outb(d, DATA(p));
 }
 
-extern __inline__ unsigned char parport_pc_read_data(struct parport *p)
+static __inline__ unsigned char parport_pc_read_data(struct parport *p)
 {
 	unsigned char val = inb (DATA (p));
 #ifdef DEBUG_PARPORT
@@ -124,17 +124,17 @@
 	return ctr;
 }
 
-extern __inline__ void parport_pc_data_reverse (struct parport *p)
+static __inline__ void parport_pc_data_reverse (struct parport *p)
 {
 	__parport_pc_frob_control (p, 0x20, 0x20);
 }
 
-extern __inline__ void parport_pc_data_forward (struct parport *p)
+static __inline__ void parport_pc_data_forward (struct parport *p)
 {
 	__parport_pc_frob_control (p, 0x20, 0x00);
 }
 
-extern __inline__ void parport_pc_write_control (struct parport *p,
+static __inline__ void parport_pc_write_control (struct parport *p,
 						 unsigned char d)
 {
 	const unsigned char wm = (PARPORT_CONTROL_STROBE |
@@ -152,7 +152,7 @@
 	__parport_pc_frob_control (p, wm, d & wm);
 }
 
-extern __inline__ unsigned char parport_pc_read_control(struct parport *p)
+static __inline__ unsigned char parport_pc_read_control(struct parport *p)
 {
 	const unsigned char rm = (PARPORT_CONTROL_STROBE |
 				  PARPORT_CONTROL_AUTOFD |
@@ -162,7 +162,7 @@
 	return priv->ctr & rm; /* Use soft copy */
 }
 
-extern __inline__ unsigned char parport_pc_frob_control (struct parport *p,
+static __inline__ unsigned char parport_pc_frob_control (struct parport *p,
 							 unsigned char mask,
 							 unsigned char val)
 {
@@ -189,18 +189,18 @@
 	return __parport_pc_frob_control (p, mask, val);
 }
 
-extern __inline__ unsigned char parport_pc_read_status(struct parport *p)
+static __inline__ unsigned char parport_pc_read_status(struct parport *p)
 {
 	return inb(STATUS(p));
 }
 
 
-extern __inline__ void parport_pc_disable_irq(struct parport *p)
+static __inline__ void parport_pc_disable_irq(struct parport *p)
 {
 	__parport_pc_frob_control (p, 0x10, 0x00);
 }
 
-extern __inline__ void parport_pc_enable_irq(struct parport *p)
+static __inline__ void parport_pc_enable_irq(struct parport *p)
 {
 	__parport_pc_frob_control (p, 0x10, 0x10);
 }
--- diff/include/linux/pci.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/linux/pci.h	2004-02-09 10:39:57.000000000 +0000
@@ -393,7 +393,6 @@
 					   0xffffffff.  You only need to change
 					   this if your device has broken DMA
 					   or supports 64-bit transfers.  */
-	struct list_head pools;		/* pci_pools tied to this device */
 
 	u64		consistent_dma_mask;/* Like dma_mask, but for
 					       pci_alloc_consistent mappings as
@@ -410,14 +409,14 @@
 	unsigned short vendor_compatible[DEVICE_COUNT_COMPATIBLE];
 	unsigned short device_compatible[DEVICE_COUNT_COMPATIBLE];
 
+	int		cfg_size;	/* Size of configuration space */
+
 	/*
 	 * Instead of touching interrupt line and base address registers
 	 * directly, use the values stored here. They might be different!
 	 */
 	unsigned int	irq;
 	struct resource resource[DEVICE_COUNT_RESOURCE]; /* I/O and memory regions + expansion ROMs */
-	struct resource dma_resource[DEVICE_COUNT_DMA];
-	struct resource irq_resource[DEVICE_COUNT_IRQ];
 
 	char *		slot_name;	/* pointer to dev.bus_id */
 
@@ -694,12 +693,15 @@
 int pci_scan_bridge(struct pci_bus *bus, struct pci_dev * dev, int max, int pass);
 
 /* kmem_cache style wrapper around pci_alloc_consistent() */
-struct pci_pool *pci_pool_create (const char *name, struct pci_dev *dev,
-		size_t size, size_t align, size_t allocation);
-void pci_pool_destroy (struct pci_pool *pool);
 
-void *pci_pool_alloc (struct pci_pool *pool, int flags, dma_addr_t *handle);
-void pci_pool_free (struct pci_pool *pool, void *vaddr, dma_addr_t addr);
+#include <linux/dmapool.h>
+
+#define	pci_pool dma_pool
+#define pci_pool_create(name, pdev, size, align, allocation) \
+		dma_pool_create(name, &pdev->dev, size, align, allocation)
+#define	pci_pool_destroy(pool) dma_pool_destroy(pool)
+#define	pci_pool_alloc(pool, flags, handle) dma_pool_alloc(pool, flags, handle)
+#define	pci_pool_free(pool, vaddr, addr) dma_pool_free(pool, vaddr, addr)
 
 #if defined(CONFIG_ISA) || defined(CONFIG_EISA)
 extern struct pci_dev *isa_bridge;
--- diff/include/linux/pci_ids.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/linux/pci_ids.h	2004-02-09 10:39:57.000000000 +0000
@@ -633,6 +633,8 @@
 #define PCI_DEVICE_ID_HP_TACHLITE	0x1029
 #define PCI_DEVICE_ID_HP_J2585A		0x1030
 #define PCI_DEVICE_ID_HP_J2585B		0x1031
+#define PCI_DEVICE_ID_HP_J2973A		0x1040
+#define PCI_DEVICE_ID_HP_J2970A		0x1042
 #define PCI_DEVICE_ID_HP_DIVA		0x1048
 #define PCI_DEVICE_ID_HP_DIVA_TOSCA1	0x1049
 #define PCI_DEVICE_ID_HP_DIVA_TOSCA2	0x104A
@@ -709,6 +711,7 @@
 #define PCI_DEVICE_ID_TI_1410		0xac50
 #define PCI_DEVICE_ID_TI_1420		0xac51
 #define PCI_DEVICE_ID_TI_1520		0xac55
+#define PCI_DEVICE_ID_TI_1510		0xac56
 
 #define PCI_VENDOR_ID_SONY		0x104d
 #define PCI_DEVICE_ID_SONY_CXD3222	0x8039
@@ -804,9 +807,12 @@
 #define PCI_DEVICE_ID_APPLE_UNI_N_AGP15	0x002d
 #define PCI_DEVICE_ID_APPLE_UNI_N_FW2	0x0030
 #define PCI_DEVICE_ID_APPLE_UNI_N_GMAC2	0x0032
+#define PCI_DEVIEC_ID_APPLE_UNI_N_ATA	0x0033
 #define PCI_DEVICE_ID_APPLE_UNI_N_AGP2	0x0034
-#define PCI_DEVICE_ID_APPLE_KAUAI_ATA	0x003b
+#define PCI_DEVICE_ID_APPLE_IPID_ATA100	0x003b
 #define PCI_DEVICE_ID_APPLE_KEYLARGO_I	0x003e
+#define PCI_DEVICE_ID_APPLE_K2_ATA100	0x0043
+#define PCI_DEVICE_ID_APPLE_K2_GMAC	0x004c
 #define PCI_DEVICE_ID_APPLE_TIGON3	0x1645
 
 #define PCI_VENDOR_ID_YAMAHA		0x1073
--- diff/include/linux/percpu.h	2003-06-30 10:07:24.000000000 +0100
+++ source/include/linux/percpu.h	2004-02-09 10:39:57.000000000 +0000
@@ -35,7 +35,6 @@
 
 extern void *__alloc_percpu(size_t size, size_t align);
 extern void free_percpu(const void *);
-extern void kmalloc_percpu_init(void);
 
 #else /* CONFIG_SMP */
 
@@ -52,7 +51,6 @@
 {	
 	kfree(ptr);
 }
-static inline void kmalloc_percpu_init(void) { }
 
 #endif /* CONFIG_SMP */
 
--- diff/include/linux/pnp.h	2003-08-26 10:00:54.000000000 +0100
+++ source/include/linux/pnp.h	2004-02-09 10:39:57.000000000 +0000
@@ -12,13 +12,12 @@
 #include <linux/device.h>
 #include <linux/list.h>
 #include <linux/errno.h>
+#include <linux/mod_devicetable.h>
 
 #define PNP_MAX_PORT		8
 #define PNP_MAX_MEM		4
 #define PNP_MAX_IRQ		2
 #define PNP_MAX_DMA		2
-#define PNP_MAX_DEVICES		8
-#define PNP_ID_LEN		8
 #define PNP_NAME_LEN		50
 
 struct pnp_protocol;
@@ -33,7 +32,9 @@
 #define pnp_port_start(dev,bar)   ((dev)->res.port_resource[(bar)].start)
 #define pnp_port_end(dev,bar)     ((dev)->res.port_resource[(bar)].end)
 #define pnp_port_flags(dev,bar)   ((dev)->res.port_resource[(bar)].flags)
-#define pnp_port_valid(dev,bar)   (pnp_port_flags((dev),(bar)) & IORESOURCE_IO)
+#define pnp_port_valid(dev,bar) \
+	((pnp_port_flags((dev),(bar)) & (IORESOURCE_IO | IORESOURCE_UNSET)) \
+		== IORESOURCE_IO)
 #define pnp_port_len(dev,bar) \
 	((pnp_port_start((dev),(bar)) == 0 &&	\
 	  pnp_port_end((dev),(bar)) ==		\
@@ -45,7 +46,9 @@
 #define pnp_mem_start(dev,bar)   ((dev)->res.mem_resource[(bar)].start)
 #define pnp_mem_end(dev,bar)     ((dev)->res.mem_resource[(bar)].end)
 #define pnp_mem_flags(dev,bar)   ((dev)->res.mem_resource[(bar)].flags)
-#define pnp_mem_valid(dev,bar)   (pnp_mem_flags((dev),(bar)) & IORESOURCE_MEM)
+#define pnp_mem_valid(dev,bar) \
+	((pnp_mem_flags((dev),(bar)) & (IORESOURCE_MEM | IORESOURCE_UNSET)) \
+		== IORESOURCE_MEM)
 #define pnp_mem_len(dev,bar) \
 	((pnp_mem_start((dev),(bar)) == 0 &&	\
 	  pnp_mem_end((dev),(bar)) ==		\
@@ -56,11 +59,15 @@
 
 #define pnp_irq(dev,bar)	 ((dev)->res.irq_resource[(bar)].start)
 #define pnp_irq_flags(dev,bar)	 ((dev)->res.irq_resource[(bar)].flags)
-#define pnp_irq_valid(dev,bar)   (pnp_irq_flags((dev),(bar)) & IORESOURCE_IRQ)
+#define pnp_irq_valid(dev,bar) \
+	((pnp_irq_flags((dev),(bar)) & (IORESOURCE_IRQ | IORESOURCE_UNSET)) \
+		== IORESOURCE_IRQ)
 
 #define pnp_dma(dev,bar)	 ((dev)->res.dma_resource[(bar)].start)
 #define pnp_dma_flags(dev,bar)	 ((dev)->res.dma_resource[(bar)].flags)
-#define pnp_dma_valid(dev,bar)   (pnp_dma_flags((dev),(bar)) & IORESOURCE_DMA)
+#define pnp_dma_valid(dev,bar) \
+	((pnp_dma_flags((dev),(bar)) & (IORESOURCE_DMA | IORESOURCE_UNSET)) \
+		== IORESOURCE_DMA)
 
 #define PNP_PORT_FLAG_16BITADDR	(1<<0)
 #define PNP_PORT_FLAG_FIXED	(1<<1)
@@ -279,19 +286,6 @@
 	struct pnp_id * next;
 };
 
-struct pnp_device_id {
-	char id[PNP_ID_LEN];
-	unsigned long driver_data;	/* data private to the driver */
-};
-
-struct pnp_card_device_id {
-	char id[PNP_ID_LEN];
-	unsigned long driver_data;	/* data private to the driver */
-	struct {
-		char id[PNP_ID_LEN];
-	} devs[PNP_MAX_DEVICES];	/* logical devices */
-};
-
 struct pnp_driver {
 	char * name;
 	const struct pnp_device_id *id_table;
--- diff/include/linux/preempt.h	2003-11-25 15:24:59.000000000 +0000
+++ source/include/linux/preempt.h	2004-02-09 10:39:57.000000000 +0000
@@ -24,6 +24,17 @@
 
 extern void preempt_schedule(void);
 
+#define preempt_check_resched() \
+do { \
+	if (unlikely(test_thread_flag(TIF_NEED_RESCHED))) \
+		preempt_schedule(); \
+} while (0)
+#else
+#define preempt_check_resched()		do { } while (0)
+#endif
+
+#if defined(CONFIG_PREEMPT) || defined(CONFIG_DEBUG_SPINLOCK_SLEEP)
+
 #define preempt_disable() \
 do { \
 	inc_preempt_count(); \
@@ -36,12 +47,6 @@
 	dec_preempt_count(); \
 } while (0)
 
-#define preempt_check_resched() \
-do { \
-	if (unlikely(test_thread_flag(TIF_NEED_RESCHED))) \
-		preempt_schedule(); \
-} while (0)
-
 #define preempt_enable() \
 do { \
 	preempt_enable_no_resched(); \
--- diff/include/linux/raid/md_k.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/linux/raid/md_k.h	2004-02-09 10:39:57.000000000 +0000
@@ -281,6 +281,10 @@
 {
 	return mddev->__minor;
 }
+static inline char * mdname (mddev_t * mddev)
+{
+	return mddev->gendisk ? mddev->gendisk->disk_name : "mdX";
+}
 
 extern mdk_rdev_t * find_rdev_nr(mddev_t *mddev, int nr);
 
--- diff/include/linux/reiserfs_fs.h	2004-01-19 10:22:59.000000000 +0000
+++ source/include/linux/reiserfs_fs.h	2004-02-09 10:39:57.000000000 +0000
@@ -90,7 +90,7 @@
 #define RFALSE( cond, format, args... ) do {;} while( 0 )
 #endif
 
-#define CONSTF __attribute__( ( const ) )
+#define CONSTF __attribute_const__
 /*
  * Disk Data Structures
  */
@@ -1781,25 +1781,25 @@
 /* stree.c */
 int B_IS_IN_TREE(const struct buffer_head *);
 extern inline void copy_short_key (void * to, const void * from);
-extern inline void copy_item_head(struct item_head * p_v_to, 
+extern void copy_item_head(struct item_head * p_v_to,
 								  const struct item_head * p_v_from);
 
 // first key is in cpu form, second - le
-extern inline int comp_keys (const struct key * le_key, 
+extern int comp_keys (const struct key * le_key,
 			     const struct cpu_key * cpu_key);
-extern inline int  comp_short_keys (const struct key * le_key, 
+extern int  comp_short_keys (const struct key * le_key,
 				    const struct cpu_key * cpu_key);
-extern inline void le_key2cpu_key (struct cpu_key * to, const struct key * from);
+extern void le_key2cpu_key (struct cpu_key * to, const struct key * from);
 
 // both are cpu keys
-extern inline int comp_cpu_keys (const struct cpu_key *, const struct cpu_key *);
-extern inline int comp_short_cpu_keys (const struct cpu_key *, 
+extern  int comp_cpu_keys (const struct cpu_key *, const struct cpu_key *);
+extern int comp_short_cpu_keys (const struct cpu_key *,
 				       const struct cpu_key *);
-extern inline void cpu_key2cpu_key (struct cpu_key *, const struct cpu_key *);
+extern void cpu_key2cpu_key (struct cpu_key *, const struct cpu_key *);
 
 // both are in le form
-extern inline int comp_le_keys (const struct key *, const struct key *);
-extern inline int comp_short_le_keys (const struct key *, const struct key *);
+extern int comp_le_keys (const struct key *, const struct key *);
+extern int comp_short_le_keys (const struct key *, const struct key *);
 
 //
 // get key version from on disk key - kludge
@@ -1834,7 +1834,7 @@
 int search_for_position_by_key (struct super_block * p_s_sb, 
 								const struct cpu_key * p_s_cpu_key, 
 								struct path * p_s_search_path);
-extern inline void decrement_bcount (struct buffer_head * p_s_bh);
+extern void decrement_bcount (struct buffer_head * p_s_bh);
 void decrement_counters_in_path (struct path * p_s_search_path);
 void pathrelse (struct path * p_s_search_path);
 int reiserfs_check_path(struct path *p) ;
@@ -1916,7 +1916,7 @@
 void i_attrs_to_sd_attrs( struct inode *inode, __u16 *sd_attrs );
 
 /* namei.c */
-inline void set_de_name_and_namelen (struct reiserfs_dir_entry * de);
+void set_de_name_and_namelen (struct reiserfs_dir_entry * de);
 int search_by_entry_key (struct super_block * sb, const struct cpu_key * key, 
 			 struct path * path, 
 			 struct reiserfs_dir_entry * de);
@@ -2037,7 +2037,7 @@
                       struct buffer_head **);
 
 /* do_balance.c */
-inline void do_balance_mark_leaf_dirty (struct tree_balance * tb, 
+void do_balance_mark_leaf_dirty (struct tree_balance * tb,
 					struct buffer_head * bh, int flag);
 #define do_balance_mark_internal_dirty do_balance_mark_leaf_dirty
 #define do_balance_mark_sb_dirty do_balance_mark_leaf_dirty
--- diff/include/linux/sched.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/linux/sched.h	2004-02-09 10:39:57.000000000 +0000
@@ -147,10 +147,12 @@
 typedef struct task_struct task_t;
 
 extern void sched_init(void);
+extern void sched_init_smp(void);
 extern void init_idle(task_t *idle, int cpu);
 
 extern void show_state(void);
 extern void show_regs(struct pt_regs *);
+extern void show_trace_task(task_t *tsk);
 
 /*
  * TASK is a pointer to the task whose backtrace we want to see (or NULL for current
@@ -204,7 +206,6 @@
 	unsigned long arg_start, arg_end, env_start, env_end;
 	unsigned long rss, total_vm, locked_vm;
 	unsigned long def_flags;
-	cpumask_t cpu_vm_mask;
 
 	unsigned long saved_auxv[40]; /* for /proc/PID/auxv */
 
@@ -212,6 +213,8 @@
 #ifdef CONFIG_HUGETLB_PAGE
 	int used_hugetlb;
 #endif
+	cpumask_t cpu_vm_mask;
+
 	/* Architecture-specific MM context */
 	mm_context_t context;
 
@@ -329,6 +332,33 @@
 struct io_context;			/* See blkdev.h */
 void exit_io_context(void);
 
+#define NGROUPS_SMALL		32
+#define NGROUPS_PER_BLOCK	((int)(EXEC_PAGESIZE / sizeof(gid_t)))
+struct group_info {
+	int ngroups;
+	atomic_t usage;
+	gid_t small_block[NGROUPS_SMALL];
+	int nblocks;
+	gid_t *blocks[0];
+};
+
+#define get_group_info(group_info) do { \
+	atomic_inc(&(group_info)->usage); \
+} while (0)
+
+#define put_group_info(group_info) do { \
+	if (atomic_dec_and_test(&(group_info)->usage)) \
+		groups_free(group_info); \
+} while (0)
+
+struct group_info *groups_alloc(int gidsetsize);
+void groups_free(struct group_info *group_info);
+int set_current_groups(struct group_info *group_info);
+/* access the groups "array" with this macro */
+#define GROUP_AT(gi, i) \
+    ((gi)->blocks[(i)/NGROUPS_PER_BLOCK][(i)%NGROUPS_PER_BLOCK])
+
+
 struct task_struct {
 	volatile long state;	/* -1 unrunnable, 0 runnable, >0 stopped */
 	struct thread_info *thread_info;
@@ -403,8 +433,7 @@
 /* process credentials */
 	uid_t uid,euid,suid,fsuid;
 	gid_t gid,egid,sgid,fsgid;
-	int ngroups;
-	gid_t	groups[NGROUPS];
+	struct group_info *group_info;
 	kernel_cap_t   cap_effective, cap_inheritable, cap_permitted;
 	int keep_capabilities:1;
 	struct user_struct *user;
@@ -501,6 +530,93 @@
 #define PF_SYNCWRITE	0x00200000	/* I am doing a sync write */
 
 #ifdef CONFIG_SMP
+#define SD_FLAG_NEWIDLE		1	/* Balance when about to become idle */
+#define SD_FLAG_EXEC		2	/* Balance on exec */
+#define SD_FLAG_WAKE		4	/* Balance on task wakeup */
+#define SD_FLAG_FASTMIGRATE	8	/* Sync wakes put task on waking CPU */
+#define SD_FLAG_IDLE		16	/* Should not have all CPUs idle */
+
+struct sched_group {
+	struct sched_group *next;	/* Must be a circular list */
+	cpumask_t cpumask;
+};
+
+struct sched_domain {
+	/* These fields must be setup */
+	struct sched_domain *parent;	/* top domain must be null terminated */
+	struct sched_group *groups;	/* the balancing groups of the domain */
+	cpumask_t span;			/* span of all CPUs in this domain */
+	unsigned long min_interval;	/* Minimum balance interval ms */
+	unsigned long max_interval;	/* Maximum balance interval ms */
+	unsigned int busy_factor;	/* less balancing by factor if busy */
+	unsigned int imbalance_pct;	/* No balance until over watermark */
+	unsigned long long cache_hot_time; /* Task considered cache hot (ns) */
+	unsigned int cache_nice_tries;	/* Leave cache hot tasks for # tries */
+	int flags;			/* See SD_FLAG_* */
+
+	/* Runtime fields. */
+	unsigned long last_balance;	/* init to jiffies. units in jiffies */
+	unsigned int balance_interval;	/* initialise to 1. units in ms. */
+	unsigned int nr_balance_failed; /* initialise to 0 */
+};
+
+/* Common values for SMT siblings */
+#define SD_SIBLING_INIT (struct sched_domain) {		\
+	.span			= CPU_MASK_NONE,	\
+	.parent			= NULL,			\
+	.groups			= NULL,			\
+	.min_interval		= 1,			\
+	.max_interval		= 2,			\
+	.busy_factor		= 8,			\
+	.imbalance_pct		= 110,			\
+	.cache_hot_time		= 0,			\
+	.cache_nice_tries	= 0,			\
+	.flags			= SD_FLAG_FASTMIGRATE | SD_FLAG_NEWIDLE | SD_FLAG_WAKE,\
+	.last_balance		= jiffies,		\
+	.balance_interval	= 1,			\
+	.nr_balance_failed	= 0,			\
+}
+
+/* Common values for CPUs */
+#define SD_CPU_INIT (struct sched_domain) {		\
+	.span			= CPU_MASK_NONE,	\
+	.parent			= NULL,			\
+	.groups			= NULL,			\
+	.min_interval		= 1,			\
+	.max_interval		= 8,			\
+	.busy_factor		= 32,			\
+	.imbalance_pct		= 125,			\
+	.cache_hot_time		= (5*1000000),		\
+	.cache_nice_tries	= 2,			\
+	.flags			= SD_FLAG_FASTMIGRATE | SD_FLAG_NEWIDLE,\
+	.last_balance		= jiffies,		\
+	.balance_interval	= 1,			\
+	.nr_balance_failed	= 0,			\
+}
+
+#ifdef CONFIG_NUMA
+/* Common values for NUMA nodes */
+#define SD_NODE_INIT (struct sched_domain) {		\
+	.span			= CPU_MASK_NONE,	\
+	.parent			= NULL,			\
+	.groups			= NULL,			\
+	.min_interval		= 20,			\
+	.max_interval		= 1000*fls(num_online_cpus()),\
+	.busy_factor		= 4,			\
+	.imbalance_pct		= 125,			\
+	.cache_hot_time		= (5*1000000),		\
+	.cache_nice_tries	= 1,			\
+	.flags			= SD_FLAG_EXEC,		\
+	.last_balance		= jiffies,		\
+	.balance_interval	= 1,			\
+	.nr_balance_failed	= 0,			\
+}
+#endif
+
+DECLARE_PER_CPU(struct sched_domain, base_domains);
+#define cpu_sched_domain(cpu)	(&per_cpu(base_domains, (cpu)))
+#define this_sched_domain()	(&__get_cpu_var(base_domains))
+
 extern int set_cpus_allowed(task_t *p, cpumask_t new_mask);
 #else
 static inline int set_cpus_allowed(task_t *p, cpumask_t new_mask)
@@ -513,12 +629,14 @@
 
 #ifdef CONFIG_NUMA
 extern void sched_balance_exec(void);
-extern void node_nr_running_init(void);
 #else
 #define sched_balance_exec()   {}
-#define node_nr_running_init() {}
 #endif
 
+/* Move tasks off this (offline) CPU onto another. */
+extern void migrate_all_tasks(void);
+/* Try to move me here, if possible. */
+void migrate_to_cpu(int dest_cpu);
 extern void set_user_nice(task_t *p, long nice);
 extern int task_prio(task_t *p);
 extern int task_nice(task_t *p);
@@ -670,7 +788,7 @@
 extern struct mm_struct * mm_alloc(void);
 
 /* mmdrop drops the mm and the page tables */
-extern inline void FASTCALL(__mmdrop(struct mm_struct *));
+extern void FASTCALL(__mmdrop(struct mm_struct *));
 static inline void mmdrop(struct mm_struct * mm)
 {
 	if (atomic_dec_and_test(&mm->mm_count))
@@ -707,6 +825,8 @@
 extern int do_execve(char *, char __user * __user *, char __user * __user *, struct pt_regs *);
 extern long do_fork(unsigned long, unsigned long, struct pt_regs *, unsigned long, int __user *, int __user *);
 extern struct task_struct * copy_process(unsigned long, unsigned long, struct pt_regs *, unsigned long, int __user *, int __user *);
+extern asmlinkage long sys_sched_setscheduler(pid_t pid, int policy,
+					      struct sched_param __user *parm);
 
 #ifdef CONFIG_SMP
 extern void wait_task_inactive(task_t * p);
@@ -893,6 +1013,8 @@
 	p->thread_info->cpu = cpu;
 }
 
+/* Wake up a CPU from idle */
+void wake_idle_cpu(unsigned int cpu);
 #else
 
 static inline unsigned int task_cpu(struct task_struct *p)
--- diff/include/linux/sctp.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/linux/sctp.h	2004-02-09 10:39:57.000000000 +0000
@@ -61,14 +61,14 @@
 	__u16 dest;
 	__u32 vtag;
 	__u32 checksum;
-} sctp_sctphdr_t __attribute__((packed));
+} __attribute__((packed)) sctp_sctphdr_t;
 
 /* Section 3.2.  Chunk Field Descriptions. */
 typedef struct sctp_chunkhdr {
 	__u8 type;
 	__u8 flags;
 	__u16 length;
-} sctp_chunkhdr_t __attribute__((packed));
+} __attribute__((packed)) sctp_chunkhdr_t;
 
 
 /* Section 3.2.  Chunk Type Values.
@@ -152,7 +152,7 @@
 typedef struct sctp_paramhdr {
 	__u16 type;
 	__u16 length;
-} sctp_paramhdr_t __attribute((packed));
+} __attribute__((packed)) sctp_paramhdr_t;
 
 typedef enum {
 
@@ -202,12 +202,12 @@
 	__u16 ssn;
 	__u32 ppid;
 	__u8  payload[0];
-} sctp_datahdr_t __attribute__((packed));
+} __attribute__((packed)) sctp_datahdr_t;
 
 typedef struct sctp_data_chunk {
         sctp_chunkhdr_t chunk_hdr;
         sctp_datahdr_t  data_hdr;
-} sctp_data_chunk_t __attribute__((packed));
+} __attribute__((packed)) sctp_data_chunk_t;
 
 /* DATA Chuck Specific Flags */
 enum {
@@ -232,48 +232,48 @@
 	__u16 num_inbound_streams;
 	__u32 initial_tsn;
 	__u8  params[0];
-} sctp_inithdr_t __attribute__((packed));
+} __attribute__((packed)) sctp_inithdr_t;
 
 typedef struct sctp_init_chunk {
 	sctp_chunkhdr_t chunk_hdr;
 	sctp_inithdr_t init_hdr;
-} sctp_init_chunk_t __attribute__((packed));
+} __attribute__((packed)) sctp_init_chunk_t;
 
 
 /* Section 3.3.2.1. IPv4 Address Parameter (5) */
 typedef struct sctp_ipv4addr_param {
 	sctp_paramhdr_t param_hdr;
 	struct in_addr  addr;
-} sctp_ipv4addr_param_t __attribute__((packed));
+} __attribute__((packed)) sctp_ipv4addr_param_t;
 
 /* Section 3.3.2.1. IPv6 Address Parameter (6) */
 typedef struct sctp_ipv6addr_param {
 	sctp_paramhdr_t param_hdr;
 	struct in6_addr addr;
-} sctp_ipv6addr_param_t __attribute__((packed));
+} __attribute__((packed)) sctp_ipv6addr_param_t;
 
 /* Section 3.3.2.1 Cookie Preservative (9) */
 typedef struct sctp_cookie_preserve_param {
 	sctp_paramhdr_t param_hdr;
 	uint32_t        lifespan_increment;
-} sctp_cookie_preserve_param_t __attribute__((packed));
+} __attribute__((packed)) sctp_cookie_preserve_param_t;
 
 /* Section 3.3.2.1 Host Name Address (11) */
 typedef struct sctp_hostname_param {
 	sctp_paramhdr_t param_hdr;
 	uint8_t hostname[0];
-} sctp_hostname_param_t __attribute__((packed));
+} __attribute__((packed)) sctp_hostname_param_t;
 
 /* Section 3.3.2.1 Supported Address Types (12) */
 typedef struct sctp_supported_addrs_param {
 	sctp_paramhdr_t param_hdr;
 	uint16_t types[0];
-} sctp_supported_addrs_param_t __attribute__((packed));
+} __attribute__((packed)) sctp_supported_addrs_param_t;
 
 /* Appendix A. ECN Capable (32768) */
 typedef struct sctp_ecn_capable_param {
 	sctp_paramhdr_t param_hdr;
-} sctp_ecn_capable_param_t __attribute__((packed));
+} __attribute__((packed)) sctp_ecn_capable_param_t;
 
 
 
@@ -287,13 +287,13 @@
 typedef struct sctp_cookie_param {
 	sctp_paramhdr_t p;
 	__u8 body[0];
-} sctp_cookie_param_t __attribute__((packed));
+} __attribute__((packed)) sctp_cookie_param_t;
 
 /* Section 3.3.3.1 Unrecognized Parameters (8) */
 typedef struct sctp_unrecognized_param {
 	sctp_paramhdr_t param_hdr;
 	sctp_paramhdr_t unrecognized;
-} sctp_unrecognized_param_t __attribute__((packed));
+} __attribute__((packed)) sctp_unrecognized_param_t;
 
 
 
@@ -308,7 +308,7 @@
 typedef struct sctp_gap_ack_block {
 	__u16 start;
 	__u16 end;
-} sctp_gap_ack_block_t __attribute__((packed));
+} __attribute__((packed)) sctp_gap_ack_block_t;
 
 typedef uint32_t sctp_dup_tsn_t;
 
@@ -323,12 +323,12 @@
 	__u16 num_gap_ack_blocks;
 	__u16 num_dup_tsns;
 	sctp_sack_variable_t variable[0];
-} sctp_sackhdr_t __attribute__((packed));
+} __attribute__((packed)) sctp_sackhdr_t;
 
 typedef struct sctp_sack_chunk {
 	sctp_chunkhdr_t chunk_hdr;
 	sctp_sackhdr_t sack_hdr;
-} sctp_sack_chunk_t __attribute__((packed));
+} __attribute__((packed)) sctp_sack_chunk_t;
 
 
 /* RFC 2960.  Section 3.3.5 Heartbeat Request (HEARTBEAT) (4):
@@ -340,12 +340,12 @@
 
 typedef struct sctp_heartbeathdr {
 	sctp_paramhdr_t info;
-} sctp_heartbeathdr_t __attribute__((packed));
+} __attribute__((packed)) sctp_heartbeathdr_t;
 
 typedef struct sctp_heartbeat_chunk {
 	sctp_chunkhdr_t chunk_hdr;
 	sctp_heartbeathdr_t hb_hdr;
-} sctp_heartbeat_chunk_t __attribute__((packed));
+} __attribute__((packed)) sctp_heartbeat_chunk_t;
 
 
 /* For the abort and shutdown ACK we must carry the init tag in the
@@ -354,7 +354,7 @@
  */
 typedef struct sctp_abort_chunk {
         sctp_chunkhdr_t uh;
-} sctp_abort_chunkt_t __attribute__((packed));
+} __attribute__((packed)) sctp_abort_chunkt_t;
 
 
 /* For the graceful shutdown we must carry the tag (in common header)
@@ -362,14 +362,12 @@
  */
 typedef struct sctp_shutdownhdr {
 	__u32 cum_tsn_ack;
-} sctp_shutdownhdr_t __attribute__((packed));
+} __attribute__((packed)) sctp_shutdownhdr_t;
 
 struct sctp_shutdown_chunk_t {
         sctp_chunkhdr_t    chunk_hdr;
         sctp_shutdownhdr_t shutdown_hdr;
-} __attribute__((packed));
-
-
+} __attribute__ ((packed));
 
 /* RFC 2960.  Section 3.3.10 Operation Error (ERROR) (9) */
 
@@ -377,12 +375,12 @@
 	__u16 cause;
 	__u16 length;
 	__u8  variable[0];
-} sctp_errhdr_t __attribute__((packed));
+} __attribute__((packed)) sctp_errhdr_t;
 
 typedef struct sctp_operr_chunk {
         sctp_chunkhdr_t chunk_hdr;
 	sctp_errhdr_t   err_hdr;
-} sctp_operr_chunk_t __attribute__((packed));
+} __attribute__((packed)) sctp_operr_chunk_t;
 
 /* RFC 2960 3.3.10 - Operation Error
  *
@@ -460,7 +458,7 @@
 typedef struct sctp_ecne_chunk {
 	sctp_chunkhdr_t chunk_hdr;
 	sctp_ecnehdr_t ence_hdr;
-} sctp_ecne_chunk_t __attribute__((packed));
+} __attribute__((packed)) sctp_ecne_chunk_t;
 
 /* RFC 2960.  Appendix A.  Explicit Congestion Notification.
  *   Congestion Window Reduced (CWR) (13)
@@ -472,7 +470,7 @@
 typedef struct sctp_cwr_chunk {
 	sctp_chunkhdr_t chunk_hdr;
 	sctp_cwrhdr_t cwr_hdr;
-} sctp_cwr_chunk_t __attribute__((packed));
+} __attribute__((packed)) sctp_cwr_chunk_t;
 
 /*
  * ADDIP Section 3.1 New Chunk Types
@@ -513,16 +511,16 @@
 typedef struct sctp_addip_param {
 	sctp_paramhdr_t	param_hdr;
 	__u32		crr_id;	
-}sctp_addip_param_t __attribute__((packed));
+} __attribute__((packed)) sctp_addip_param_t;
 
 typedef struct sctp_addiphdr {
 	__u32	serial;
 	__u8	params[0];
-} sctp_addiphdr_t __attribute__((packed));
+} __attribute__((packed)) sctp_addiphdr_t;
 
 typedef struct sctp_addip_chunk {
 	sctp_chunkhdr_t chunk_hdr;
 	sctp_addiphdr_t addip_hdr;
-} sctp_addip_chunk_t __attribute__((packed));
+} __attribute__((packed)) sctp_addip_chunk_t;
 
 #endif /* __LINUX_SCTP_H__ */
--- diff/include/linux/security.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/linux/security.h	2004-02-09 10:39:57.000000000 +0000
@@ -171,6 +171,16 @@
  *	@flags contains the mount flags.
  *	@data contains the filesystem-specific data.
  *	Return 0 if permission is granted.
+ * @sb_copy_data:
+ *	Allow mount option data to be copied prior to parsing by the filesystem,
+ *	so that the security module can extract security-specific mount
+ *	options cleanly (a filesystem may modify the data e.g. with strsep()).
+ *	This also allows the original mount data to be stripped of security-
+ *	specific options to avoid having to make filesystems aware of them.
+ *	@fstype the type of filesystem being mounted.
+ *	@orig the original mount data copied from userspace.
+ *	@copy copied data which will be passed to the security module.
+ *	Returns 0 if the copy was successful.
  * @sb_check_sb:
  *	Check permission before the device with superblock @mnt->sb is mounted
  *	on the mount point named by @nd.
@@ -554,9 +564,8 @@
  *	Return 0 if permission is granted.
  * @task_setgroups:
  *	Check permission before setting the supplementary group set of the
- *	current process to @grouplist.
- *	@gidsetsize contains the number of elements in @grouplist.
- *	@grouplist contains the array of gids.
+ *	current process.
+ *	@group_info contains the new group information.
  *	Return 0 if permission is granted.
  * @task_setnice:
  *	Check permission before setting the nice value of @p to @nice.
@@ -1024,7 +1033,8 @@
 
 	int (*sb_alloc_security) (struct super_block * sb);
 	void (*sb_free_security) (struct super_block * sb);
-	int (*sb_kern_mount) (struct super_block *sb);
+	int (*sb_copy_data)(const char *fstype, void *orig, void *copy);
+	int (*sb_kern_mount) (struct super_block *sb, void *data);
 	int (*sb_statfs) (struct super_block * sb);
 	int (*sb_mount) (char *dev_name, struct nameidata * nd,
 			 char *type, unsigned long flags, void *data);
@@ -1116,7 +1126,7 @@
 	int (*task_setpgid) (struct task_struct * p, pid_t pgid);
 	int (*task_getpgid) (struct task_struct * p);
 	int (*task_getsid) (struct task_struct * p);
-	int (*task_setgroups) (int gidsetsize, gid_t * grouplist);
+	int (*task_setgroups) (struct group_info *group_info);
 	int (*task_setnice) (struct task_struct * p, int nice);
 	int (*task_setrlimit) (unsigned int resource, struct rlimit * new_rlim);
 	int (*task_setscheduler) (struct task_struct * p, int policy,
@@ -1308,9 +1318,14 @@
 	security_ops->sb_free_security (sb);
 }
 
-static inline int security_sb_kern_mount (struct super_block *sb)
+static inline int security_sb_copy_data (const char *fstype, void *orig, void *copy)
+{
+	return security_ops->sb_copy_data (fstype, orig, copy);
+}
+
+static inline int security_sb_kern_mount (struct super_block *sb, void *data)
 {
-	return security_ops->sb_kern_mount (sb);
+	return security_ops->sb_kern_mount (sb, data);
 }
 
 static inline int security_sb_statfs (struct super_block *sb)
@@ -1670,9 +1685,9 @@
 	return security_ops->task_getsid (p);
 }
 
-static inline int security_task_setgroups (int gidsetsize, gid_t *grouplist)
+static inline int security_task_setgroups (struct group_info *group_info)
 {
-	return security_ops->task_setgroups (gidsetsize, grouplist);
+	return security_ops->task_setgroups (group_info);
 }
 
 static inline int security_task_setnice (struct task_struct *p, int nice)
@@ -1973,7 +1988,12 @@
 static inline void security_sb_free (struct super_block *sb)
 { }
 
-static inline int security_sb_kern_mount (struct super_block *sb)
+static inline int security_sb_copy_data (const char *fstype, void *orig, void *copy)
+{
+	return 0;
+}
+
+static inline int security_sb_kern_mount (struct super_block *sb, void *data)
 {
 	return 0;
 }
@@ -2299,7 +2319,7 @@
 	return 0;
 }
 
-static inline int security_task_setgroups (int gidsetsize, gid_t *grouplist)
+static inline int security_task_setgroups (struct group_info *group_info)
 {
 	return 0;
 }
--- diff/include/linux/selection.h	2003-06-30 10:07:24.000000000 +0100
+++ source/include/linux/selection.h	2004-02-09 10:39:57.000000000 +0000
@@ -36,8 +36,8 @@
 extern void complement_pos(int currcons, int offset);
 extern void invert_screen(int currcons, int offset, int count, int shift);
 
-extern void getconsxy(int currcons, char *p);
-extern void putconsxy(int currcons, char *p);
+extern void getconsxy(int currcons, unsigned char *p);
+extern void putconsxy(int currcons, unsigned char *p);
 
 extern u16 vcs_scr_readw(int currcons, const u16 *org);
 extern void vcs_scr_writew(int currcons, u16 val, u16 *org);
--- diff/include/linux/serial_core.h	2003-10-09 09:47:17.000000000 +0100
+++ source/include/linux/serial_core.h	2004-02-09 10:39:57.000000000 +0000
@@ -158,7 +158,9 @@
 	unsigned char		x_char;			/* xon/xoff char */
 	unsigned char		regshift;		/* reg offset shift */
 	unsigned char		iotype;			/* io access style */
-
+#ifdef CONFIG_KGDB
+	int			kgdb;			/* in use by kgdb */
+#endif
 #define UPIO_PORT		(0)
 #define UPIO_HUB6		(1)
 #define UPIO_MEM		(2)
--- diff/include/linux/smp_lock.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/linux/smp_lock.h	2004-02-09 10:39:57.000000000 +0000
@@ -5,7 +5,9 @@
 #include <linux/sched.h>
 #include <linux/spinlock.h>
 
-#if defined(CONFIG_SMP) || defined(CONFIG_PREEMPT)
+#define BKL_DEBUG /* For testing for sleep_on() abuse */
+
+#if defined(CONFIG_SMP) || defined(CONFIG_PREEMPT) || defined(BKL_DEBUG)
 
 extern spinlock_t kernel_flag;
 
--- diff/include/linux/spinlock.h	2003-10-09 09:47:17.000000000 +0100
+++ source/include/linux/spinlock.h	2004-02-09 10:39:57.000000000 +0000
@@ -15,6 +15,12 @@
 
 #include <asm/processor.h>	/* for cpu relax */
 #include <asm/system.h>
+#ifdef CONFIG_KGDB
+#include <asm/current.h>
+#define SET_WHO(x, him) (x)->who = him;
+#else
+#define SET_WHO(x, him)
+#endif
 
 /*
  * Must define these before including other files, inline functions need them
@@ -55,6 +61,9 @@
 	const char *module;
 	char *owner;
 	int oline;
+#ifdef CONFIG_KGDB
+	struct task_struct *who;
+#endif
 } spinlock_t;
 #define SPIN_LOCK_UNLOCKED (spinlock_t) { SPINLOCK_MAGIC, 0, 10, __FILE__ , NULL, 0}
 
@@ -66,6 +75,7 @@
 		(x)->module = __FILE__; \
 		(x)->owner = NULL; \
 		(x)->oline = 0; \
+                SET_WHO(x, NULL) \
 	} while (0)
 
 #define CHECK_LOCK(x) \
@@ -88,6 +98,7 @@
 		(x)->lock = 1; \
 		(x)->owner = __FILE__; \
 		(x)->oline = __LINE__; \
+                SET_WHO(x, current)       \
 	} while (0)
 
 /* without debugging, spin_is_locked on UP always says
@@ -118,6 +129,7 @@
 		(x)->lock = 1; \
 		(x)->owner = __FILE__; \
 		(x)->oline = __LINE__; \
+                SET_WHO(x, current)       \
 		1; \
 	})
 
@@ -184,6 +196,17 @@
 
 #endif /* !SMP */
 
+#ifdef CONFIG_LOCKMETER
+extern void _metered_spin_lock   (spinlock_t *lock);
+extern void _metered_spin_unlock (spinlock_t *lock);
+extern int  _metered_spin_trylock(spinlock_t *lock);
+extern void _metered_read_lock    (rwlock_t *lock);
+extern void _metered_read_unlock  (rwlock_t *lock);
+extern void _metered_write_lock   (rwlock_t *lock);
+extern void _metered_write_unlock (rwlock_t *lock);
+extern int  _metered_write_trylock(rwlock_t *lock);
+#endif
+
 /*
  * Define the various spin_lock and rw_lock methods.  Note we define these
  * regardless of whether CONFIG_SMP or CONFIG_PREEMPT are set. The various
@@ -389,6 +412,141 @@
 				_raw_spin_trylock(lock) ? 1 : \
 				({preempt_enable(); local_bh_enable(); 0;});})
 
+#ifdef CONFIG_LOCKMETER
+#undef spin_lock
+#undef spin_trylock
+#undef spin_unlock
+#undef spin_lock_irqsave
+#undef spin_lock_irq
+#undef spin_lock_bh
+#undef read_lock
+#undef read_unlock
+#undef write_lock
+#undef write_unlock
+#undef write_trylock
+#undef spin_unlock_bh
+#undef read_lock_irqsave
+#undef read_lock_irq
+#undef read_lock_bh
+#undef read_unlock_bh
+#undef write_lock_irqsave
+#undef write_lock_irq
+#undef write_lock_bh
+#undef write_unlock_bh
+
+#define spin_lock(lock) \
+do { \
+	preempt_disable(); \
+	_metered_spin_lock(lock); \
+} while(0)
+
+#define spin_trylock(lock)     ({preempt_disable(); _metered_spin_trylock(lock) ? \
+				1 : ({preempt_enable(); 0;});})
+#define spin_unlock(lock) \
+do { \
+	_metered_spin_unlock(lock); \
+	preempt_enable(); \
+} while (0)
+
+#define spin_lock_irqsave(lock, flags) \
+do { \
+	local_irq_save(flags); \
+	preempt_disable(); \
+	_metered_spin_lock(lock); \
+} while (0)
+
+#define spin_lock_irq(lock) \
+do { \
+	local_irq_disable(); \
+	preempt_disable(); \
+	_metered_spin_lock(lock); \
+} while (0)
+
+#define spin_lock_bh(lock) \
+do { \
+	local_bh_disable(); \
+	preempt_disable(); \
+	_metered_spin_lock(lock); \
+} while (0)
+
+#define spin_unlock_bh(lock) \
+do { \
+	_metered_spin_unlock(lock); \
+	preempt_enable(); \
+	local_bh_enable(); \
+} while (0)
+
+
+#define read_lock(lock)                ({preempt_disable(); _metered_read_lock(lock);})
+#define read_unlock(lock)      ({_metered_read_unlock(lock); preempt_enable();})
+#define write_lock(lock)       ({preempt_disable(); _metered_write_lock(lock);})
+#define write_unlock(lock)     ({_metered_write_unlock(lock); preempt_enable();})
+#define write_trylock(lock)    ({preempt_disable();_metered_write_trylock(lock) ? \
+				1 : ({preempt_enable(); 0;});})
+#define spin_unlock_no_resched(lock) \
+do { \
+	_metered_spin_unlock(lock); \
+	preempt_enable_no_resched(); \
+} while (0)
+
+#define read_lock_irqsave(lock, flags) \
+do { \
+	local_irq_save(flags); \
+	preempt_disable(); \
+	_metered_read_lock(lock); \
+} while (0)
+
+#define read_lock_irq(lock) \
+do { \
+	local_irq_disable(); \
+	preempt_disable(); \
+	_metered_read_lock(lock); \
+} while (0)
+
+#define read_lock_bh(lock) \
+do { \
+	local_bh_disable(); \
+	preempt_disable(); \
+	_metered_read_lock(lock); \
+} while (0)
+
+#define read_unlock_bh(lock) \
+do { \
+	_metered_read_unlock(lock); \
+	preempt_enable(); \
+	local_bh_enable(); \
+} while (0)
+
+#define write_lock_irqsave(lock, flags) \
+do { \
+	local_irq_save(flags); \
+	preempt_disable(); \
+	_metered_write_lock(lock); \
+} while (0)
+
+#define write_lock_irq(lock) \
+do { \
+	local_irq_disable(); \
+	preempt_disable(); \
+	_metered_write_lock(lock); \
+} while (0)
+
+#define write_lock_bh(lock) \
+do { \
+	local_bh_disable(); \
+	preempt_disable(); \
+	_metered_write_lock(lock); \
+} while (0)
+
+#define write_unlock_bh(lock) \
+do { \
+	_metered_write_unlock(lock); \
+	preempt_enable(); \
+	local_bh_enable(); \
+} while (0)
+
+#endif /* !CONFIG_LOCKMETER */
+
 /* "lock on reference count zero" */
 #ifndef ATOMIC_DEC_AND_LOCK
 #include <asm/atomic.h>
--- diff/include/linux/sunrpc/auth.h	2003-06-30 10:07:24.000000000 +0100
+++ source/include/linux/sunrpc/auth.h	2004-02-09 10:39:57.000000000 +0000
@@ -28,8 +28,7 @@
 struct auth_cred {
 	uid_t	uid;
 	gid_t	gid;
-	int	ngroups;
-	gid_t	*groups;
+	struct group_info *group_info;
 };
 
 /*
@@ -73,6 +72,7 @@
 						 * differ from the flavor in
 						 * au_ops->au_flavor in gss
 						 * case) */
+	atomic_t		au_count;	/* Reference counter */
 
 	/* per-flavor data */
 };
@@ -102,6 +102,10 @@
 	u32 *			(*crmarshal)(struct rpc_task *, u32 *, int);
 	int			(*crrefresh)(struct rpc_task *);
 	u32 *			(*crvalidate)(struct rpc_task *, u32 *);
+	int			(*crwrap_req)(struct rpc_task *, kxdrproc_t,
+						void *, u32 *, void *);
+	int			(*crunwrap_resp)(struct rpc_task *, kxdrproc_t,
+						void *, u32 *, void *);
 };
 
 extern struct rpc_authops	authunix_ops;
@@ -124,6 +128,8 @@
 void			rpcauth_unbindcred(struct rpc_task *);
 u32 *			rpcauth_marshcred(struct rpc_task *, u32 *);
 u32 *			rpcauth_checkverf(struct rpc_task *, u32 *);
+int			rpcauth_wrap_req(struct rpc_task *task, kxdrproc_t encode, void *rqstp, u32 *data, void *obj);
+int			rpcauth_unwrap_resp(struct rpc_task *task, kxdrproc_t decode, void *rqstp, u32 *data, void *obj);
 int			rpcauth_refreshcred(struct rpc_task *);
 void			rpcauth_invalcred(struct rpc_task *);
 int			rpcauth_uptodatecred(struct rpc_task *);
--- diff/include/linux/sunrpc/clnt.h	2003-02-26 16:00:55.000000000 +0000
+++ source/include/linux/sunrpc/clnt.h	2004-02-09 10:39:57.000000000 +0000
@@ -26,6 +26,8 @@
 	__u32			pm_vers;
 	__u32			pm_prot;
 	__u16			pm_port;
+	unsigned char		pm_binding : 1;	/* doing a getport() */
+	struct rpc_wait_queue	pm_bindwait;	/* waiting on getport() */
 };
 
 struct rpc_inode;
@@ -34,6 +36,7 @@
  * The high-level client handle
  */
 struct rpc_clnt {
+	atomic_t		cl_count;	/* Number of clones */
 	atomic_t		cl_users;	/* number of references */
 	struct rpc_xprt *	cl_xprt;	/* transport */
 	struct rpc_procinfo *	cl_procinfo;	/* procedure info */
@@ -48,26 +51,27 @@
 				cl_intr     : 1,/* interruptible */
 				cl_chatty   : 1,/* be verbose */
 				cl_autobind : 1,/* use getport() */
-				cl_binding  : 1,/* doing a getport() */
 				cl_droppriv : 1,/* enable NFS suid hack */
 				cl_oneshot  : 1,/* dispose after use */
 				cl_dead     : 1;/* abandoned */
 
-	struct rpc_rtt		cl_rtt;		/* RTO estimator data */
-
-	struct rpc_portmap	cl_pmap;	/* port mapping */
-	struct rpc_wait_queue	cl_bindwait;	/* waiting on getport() */
+	struct rpc_rtt *	cl_rtt;		/* RTO estimator data */
+	struct rpc_portmap *	cl_pmap;	/* port mapping */
 
 	int			cl_nodelen;	/* nodename length */
 	char 			cl_nodename[UNX_MAXNODENAME];
 	char			cl_pathname[30];/* Path in rpc_pipe_fs */
 	struct dentry *		cl_dentry;	/* inode */
+	struct rpc_clnt *	cl_parent;	/* Points to parent of clones */
+	struct rpc_rtt		cl_rtt_default;
+	struct rpc_portmap	cl_pmap_default;
+	char			cl_inline_name[32];
 };
 #define cl_timeout		cl_xprt->timeout
-#define cl_prog			cl_pmap.pm_prog
-#define cl_vers			cl_pmap.pm_vers
-#define cl_port			cl_pmap.pm_port
-#define cl_prot			cl_pmap.pm_prot
+#define cl_prog			cl_pmap->pm_prog
+#define cl_vers			cl_pmap->pm_vers
+#define cl_port			cl_pmap->pm_port
+#define cl_prot			cl_pmap->pm_prot
 
 /*
  * General RPC program info
@@ -108,6 +112,7 @@
 struct rpc_clnt *rpc_create_client(struct rpc_xprt *xprt, char *servname,
 				struct rpc_program *info,
 				u32 version, rpc_authflavor_t authflavor);
+struct rpc_clnt *rpc_clone_client(struct rpc_clnt *);
 int		rpc_shutdown_client(struct rpc_clnt *);
 int		rpc_destroy_client(struct rpc_clnt *);
 void		rpc_release_client(struct rpc_clnt *);
--- diff/include/linux/sunrpc/gss_api.h	2003-06-30 10:07:24.000000000 +0100
+++ source/include/linux/sunrpc/gss_api.h	2004-02-09 10:39:57.000000000 +0000
@@ -16,6 +16,7 @@
 
 #ifdef __KERNEL__
 #include <linux/sunrpc/xdr.h>
+#include <linux/uio.h>
 
 /* The mechanism-independent gss-api context: */
 struct gss_ctx {
@@ -39,11 +40,11 @@
 u32 gss_get_mic(
 		struct gss_ctx		*ctx_id,
 		u32			qop,
-		struct xdr_netobj	*message,
+		struct xdr_buf		*message,
 		struct xdr_netobj	*mic_token);
 u32 gss_verify_mic(
 		struct gss_ctx		*ctx_id,
-		struct xdr_netobj	*message,
+		struct xdr_buf		*message,
 		struct xdr_netobj	*mic_token,
 		u32			*qstate);
 u32 gss_delete_sec_context(
@@ -95,11 +96,11 @@
 	u32 (*gss_get_mic)(
 			struct gss_ctx		*ctx_id,
 			u32			qop, 
-			struct xdr_netobj	*message,
+			struct xdr_buf		*message,
 			struct xdr_netobj	*mic_token);
 	u32 (*gss_verify_mic)(
 			struct gss_ctx		*ctx_id,
-			struct xdr_netobj	*message,
+			struct xdr_buf		*message,
 			struct xdr_netobj	*mic_token,
 			u32			*qstate);
 	void (*gss_delete_sec_context)(
--- diff/include/linux/sunrpc/gss_krb5.h	2003-01-16 11:30:40.000000000 +0000
+++ source/include/linux/sunrpc/gss_krb5.h	2004-02-09 10:39:57.000000000 +0000
@@ -50,7 +50,6 @@
 	struct crypto_tfm	*seq;
 	s32			endtime;
 	u32			seq_send;
-	u32			seq_recv;
 	struct xdr_netobj	mech_used;
 };
 
@@ -73,7 +72,7 @@
 	SEAL_ALG_DES3KD = 0x0002
 };
 
-#define RSA_MD5_CKSUM_LENGTH 16
+#define KRB5_CKSUM_LENGTH 8
 
 #define CKSUMTYPE_CRC32			0x0001
 #define CKSUMTYPE_RSA_MD4		0x0002
@@ -100,16 +99,6 @@
 #define KG_EMPTY_CCACHE                          (39756044L)
 #define KG_NO_CTYPES                             (39756045L)
 
-#define KV5M_PRINCIPAL                           (-1760647423L)
-#define KV5M_KEYBLOCK                            (-1760647421L)
-#define KV5M_CHECKSUM                            (-1760647420L)
-#define KV5M_ADDRESS                             (-1760647390L)
-#define KV5M_AUTHENTICATOR                       (-1760647410L)
-#define KV5M_AUTH_CONTEXT                        (-1760647383L)
-#define KV5M_AUTHDATA                            (-1760647414L)
-#define KV5M_GSS_OID                             (-1760647372L)
-#define KV5M_GSS_QUEUE                           (-1760647371L)
-
 /* per Kerberos v5 protocol spec crypto types from the wire. 
  * these get mapped to linux kernel crypto routines.  
  */
@@ -126,19 +115,18 @@
 #define ENCTYPE_UNKNOWN         0x01ff
 
 s32
-krb5_make_checksum(s32 cksumtype,
-		   struct xdr_netobj *input,
+krb5_make_checksum(s32 cksumtype, char *header, struct xdr_buf *body,
 		   struct xdr_netobj *cksum);
 
 u32
 krb5_make_token(struct krb5_ctx *context_handle, int qop_req,
-	struct xdr_netobj * input_message_buffer,
-	struct xdr_netobj * output_message_buffer, int toktype);
+	struct xdr_buf *input_message_buffer,
+	struct xdr_netobj *output_message_buffer, int toktype);
 
 u32
 krb5_read_token(struct krb5_ctx *context_handle,
 	  struct xdr_netobj *input_token_buffer,
-	  struct xdr_netobj *message_buffer,
+	  struct xdr_buf *message_buffer,
 	  int *qop_state, int toktype);
 
 u32
--- diff/include/linux/sunrpc/rpc_pipe_fs.h	2003-10-09 09:47:34.000000000 +0100
+++ source/include/linux/sunrpc/rpc_pipe_fs.h	2004-02-09 10:39:57.000000000 +0000
@@ -14,6 +14,7 @@
 struct rpc_pipe_ops {
 	ssize_t (*upcall)(struct file *, struct rpc_pipe_msg *, char __user *, size_t);
 	ssize_t (*downcall)(struct file *, const char __user *, size_t);
+	void (*release_pipe)(struct inode *);
 	void (*destroy_msg)(struct rpc_pipe_msg *);
 };
 
@@ -21,12 +22,15 @@
 	struct inode vfs_inode;
 	void *private;
 	struct list_head pipe;
+	struct list_head in_upcall;
 	int pipelen;
 	int nreaders;
+	int nwriters;
 	wait_queue_head_t waitq;
 #define RPC_PIPE_WAIT_FOR_OPEN	1
 	int flags;
 	struct rpc_pipe_ops *ops;
+	struct work_struct queue_timeout;
 };
 
 static inline struct rpc_inode *
@@ -35,7 +39,6 @@
 	return container_of(inode, struct rpc_inode, vfs_inode);
 }
 
-extern void rpc_inode_setowner(struct inode *, void *);
 extern int rpc_queue_upcall(struct inode *, struct rpc_pipe_msg *);
 
 extern struct dentry *rpc_mkdir(char *, struct rpc_clnt *);
--- diff/include/linux/sunrpc/sched.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/linux/sunrpc/sched.h	2004-02-09 10:39:57.000000000 +0000
@@ -48,8 +48,6 @@
 	__u8			tk_garb_retry,
 				tk_cred_retry,
 				tk_suid_retry;
-	u32			tk_gss_seqno;	/* rpcsec_gss sequence number
-						   used on this request */
 
 	/*
 	 * timeout_fn   to be executed by timer bottom half
@@ -110,6 +108,7 @@
 #define RPC_TASK_ROOTCREDS	0x0040		/* force root creds */
 #define RPC_TASK_DYNAMIC	0x0080		/* task was kmalloc'ed */
 #define RPC_TASK_KILLED		0x0100		/* task was killed */
+#define RPC_TASK_SOFT		0x0200		/* Use soft timeouts */
 
 #define RPC_IS_ASYNC(t)		((t)->tk_flags & RPC_TASK_ASYNC)
 #define RPC_IS_SETUID(t)	((t)->tk_flags & RPC_TASK_SETUID)
@@ -119,6 +118,7 @@
 #define RPC_ASSASSINATED(t)	((t)->tk_flags & RPC_TASK_KILLED)
 #define RPC_IS_ACTIVATED(t)	((t)->tk_active)
 #define RPC_DO_CALLBACK(t)	((t)->tk_callback != NULL)
+#define RPC_IS_SOFT(t)		((t)->tk_flags & RPC_TASK_SOFT)
 
 #define RPC_TASK_SLEEPING	0
 #define RPC_TASK_RUNNING	1
--- diff/include/linux/sunrpc/svcauth.h	2003-01-16 11:30:37.000000000 +0000
+++ source/include/linux/sunrpc/svcauth.h	2004-02-09 10:39:57.000000000 +0000
@@ -16,10 +16,11 @@
 #include <linux/sunrpc/cache.h>
 #include <linux/hash.h>
 
+#define SVC_CRED_NGROUPS	32
 struct svc_cred {
 	uid_t			cr_uid;
 	gid_t			cr_gid;
-	gid_t			cr_groups[NGROUPS];
+	gid_t			cr_groups[SVC_CRED_NGROUPS];
 };
 
 struct svc_rqst;		/* forward decl */
--- diff/include/linux/sunrpc/xdr.h	2003-06-09 14:18:20.000000000 +0100
+++ source/include/linux/sunrpc/xdr.h	2004-02-09 10:39:57.000000000 +0000
@@ -141,6 +141,10 @@
 extern int xdr_kmap(struct iovec *, struct xdr_buf *, size_t);
 extern void xdr_kunmap(struct xdr_buf *, size_t);
 extern void xdr_shift_buf(struct xdr_buf *, size_t);
+extern void _copy_from_pages(char *, struct page **, size_t, size_t);
+extern void xdr_buf_from_iov(struct iovec *, struct xdr_buf *);
+extern int xdr_buf_subsegment(struct xdr_buf *, struct xdr_buf *, int, int);
+extern int xdr_buf_read_netobj(struct xdr_buf *, struct xdr_netobj *, int);
 
 /*
  * Helper structure for copying from an sk_buff.
--- diff/include/linux/sunrpc/xprt.h	2003-08-26 10:00:54.000000000 +0100
+++ source/include/linux/sunrpc/xprt.h	2004-02-09 10:39:57.000000000 +0000
@@ -95,6 +95,7 @@
 	struct rpc_rqst *	rq_next;	/* free list */
 	int			rq_cong;	/* has incremented xprt->cong */
 	int			rq_received;	/* receive completed */
+	u32			rq_seqno;	/* gss seq no. used on req. */
 
 	struct list_head	rq_list;
 
@@ -162,6 +163,12 @@
 				tcp_offset;	/* fragment offset */
 	unsigned long		tcp_copied,	/* copied to request */
 				tcp_flags;
+	/*
+	 * Disconnection of idle sockets
+	 */
+	struct work_struct	task_cleanup;
+	struct timer_list	timer;
+	unsigned long		last_used;
 
 	/*
 	 * Send stuff
@@ -201,6 +208,7 @@
 void			xprt_sock_setbufsize(struct rpc_xprt *);
 
 #define XPRT_CONNECT	0
+#define XPRT_LOCKED	1
 
 #define xprt_connected(xp)		(test_bit(XPRT_CONNECT, &(xp)->sockstate))
 #define xprt_set_connected(xp)		(set_bit(XPRT_CONNECT, &(xp)->sockstate))
--- diff/include/linux/suspend.h	2003-10-27 09:20:39.000000000 +0000
+++ source/include/linux/suspend.h	2004-02-09 10:39:57.000000000 +0000
@@ -32,9 +32,6 @@
 	int page_size;
 	suspend_pagedir_t *suspend_pagedir;
 	unsigned int num_pbes;
-	struct swap_location {
-		char filename[SWAP_FILENAME_MAXLENGTH];
-	} swap_location[MAX_SWAPFILES];
 };
 
 #define SUSPEND_PD_PAGES(x)     (((x)*sizeof(struct pbe))/PAGE_SIZE+1)
@@ -43,33 +40,45 @@
 extern int shrink_mem(void);
 
 /* mm/page_alloc.c */
-extern void drain_local_pages(void);
+extern void drain_local_pages(unsigned int cpu);
+
+/* kernel/power/swsusp.c */
+extern int software_suspend(void);
 
 extern unsigned int nr_copy_pages __nosavedata;
 extern suspend_pagedir_t *pagedir_nosave __nosavedata;
-#endif /* CONFIG_PM */
-
-#ifdef CONFIG_SOFTWARE_SUSPEND
-
-extern unsigned char software_suspend_enabled;
 
-extern void software_suspend(void);
 #else	/* CONFIG_SOFTWARE_SUSPEND */
-static inline void software_suspend(void)
+static inline int software_suspend(void)
 {
 	printk("Warning: fake suspend called\n");
+	return -EPERM;
 }
+#define software_resume()		do { } while(0)
 #endif	/* CONFIG_SOFTWARE_SUSPEND */
 
 
 #ifdef CONFIG_PM
 extern void refrigerator(unsigned long);
+extern int freeze_processes(void);
+extern void thaw_processes(void);
+
+extern int pm_prepare_console(void);
+extern void pm_restore_console(void);
 
 #else
 static inline void refrigerator(unsigned long flag)
 {
 
 }
+static inline int freeze_processes(void)
+{
+	return 0;
+}
+static inline void thaw_processes(void)
+{
+
+}
 #endif	/* CONFIG_PM */
 
 #endif /* _LINUX_SWSUSP_H */
--- diff/include/linux/sysctl.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/linux/sysctl.h	2004-02-09 10:39:57.000000000 +0000
@@ -156,6 +156,8 @@
 	VM_SWAPPINESS=19,	/* Tendency to steal mapped memory */
 	VM_LOWER_ZONE_PROTECTION=20,/* Amount of protection of lower zones */
 	VM_MIN_FREE_KBYTES=21,	/* Minimum free kilobytes to maintain */
+	VM_LAPTOP_MODE=22,      /* vm laptop mode */
+	VM_BLOCK_DUMP=23,       /* block dump mode */
 };
 
 
@@ -613,6 +615,8 @@
 	FS_LEASE_TIME=15,	/* int: maximum time to wait for a lease break */
 	FS_DQSTATS=16,	/* disc quota usage statistics */
 	FS_XFS=17,	/* struct: control xfs parameters */
+	FS_AIO_NR=18,	/* current system-wide number of aio requests */
+	FS_AIO_MAX_NR=19,	/* system-wide maximum number of aio requests */
 };
 
 /* /proc/sys/fs/quota/ */
--- diff/include/linux/sysfs.h	2003-08-26 10:00:54.000000000 +0100
+++ source/include/linux/sysfs.h	2004-02-09 10:39:57.000000000 +0000
@@ -18,6 +18,12 @@
 	mode_t			mode;
 };
 
+struct attribute_group {
+	char			* name;
+	struct attribute	** attrs;
+};
+
+
 struct bin_attribute {
 	struct attribute	attr;
 	size_t			size;
@@ -25,14 +31,13 @@
 	ssize_t (*write)(struct kobject *, char *, loff_t, size_t);
 };
 
-int sysfs_create_bin_file(struct kobject * kobj, struct bin_attribute * attr);
-int sysfs_remove_bin_file(struct kobject * kobj, struct bin_attribute * attr);
-
 struct sysfs_ops {
 	ssize_t	(*show)(struct kobject *, struct attribute *,char *);
 	ssize_t	(*store)(struct kobject *,struct attribute *,const char *, size_t);
 };
 
+#ifdef CONFIG_SYSFS
+
 extern int
 sysfs_create_dir(struct kobject *);
 
@@ -57,13 +62,75 @@
 extern void
 sysfs_remove_link(struct kobject *, char * name);
 
-
-struct attribute_group {
-	char			* name;
-	struct attribute	** attrs;
-};
+int sysfs_create_bin_file(struct kobject * kobj, struct bin_attribute * attr);
+int sysfs_remove_bin_file(struct kobject * kobj, struct bin_attribute * attr);
 
 int sysfs_create_group(struct kobject *, const struct attribute_group *);
 void sysfs_remove_group(struct kobject *, const struct attribute_group *);
 
+#else /* CONFIG_SYSFS */
+
+static inline int sysfs_create_dir(struct kobject * k)
+{
+	return 0;
+}
+
+static inline void sysfs_remove_dir(struct kobject * k)
+{
+	;
+}
+
+static inline void sysfs_rename_dir(struct kobject * k, const char *new_name)
+{
+	;
+}
+
+static inline int sysfs_create_file(struct kobject * k, const struct attribute * a)
+{
+	return 0;
+}
+
+static inline int sysfs_update_file(struct kobject * k, const struct attribute * a)
+{
+	return 0;
+}
+
+static inline void sysfs_remove_file(struct kobject * k, const struct attribute * a)
+{
+	;
+}
+
+static inline int sysfs_create_link(struct kobject * k, struct kobject * t, char * n)
+{
+	return 0;
+}
+
+static inline void sysfs_remove_link(struct kobject * k, char * name)
+{
+	;
+}
+
+
+static inline int sysfs_create_bin_file(struct kobject * k, struct bin_attribute * a)
+{
+	return 0;
+}
+
+static inline int sysfs_remove_bin_file(struct kobject * k, struct bin_attribute * a)
+{
+	return 0;
+}
+
+static inline int sysfs_create_group(struct kobject * k, const struct attribute_group *g)
+{
+	return 0;
+}
+
+static inline void sysfs_remove_group(struct kobject * k, const struct attribute_group * g)
+{
+	;
+}
+
+#endif /* CONFIG_SYSFS */
+
 #endif /* _SYSFS_H_ */
--- diff/include/linux/time.h	2003-08-20 14:16:34.000000000 +0100
+++ source/include/linux/time.h	2004-02-09 10:39:57.000000000 +0000
@@ -148,14 +148,14 @@
 #endif
 #define NSEC_JIFFIE_SC (SEC_JIFFIE_SC + 29)
 #define USEC_JIFFIE_SC (SEC_JIFFIE_SC + 19)
-#define SEC_CONVERSION ((unsigned long)((((u64)NSEC_PER_SEC << SEC_JIFFIE_SC))\
-                                         / (u64)TICK_NSEC))
+#define SEC_CONVERSION ((unsigned long)((((u64)NSEC_PER_SEC << SEC_JIFFIE_SC) +\
+                                TICK_NSEC -1) / (u64)TICK_NSEC))
 
-#define NSEC_CONVERSION ((unsigned long)((((u64)1 << NSEC_JIFFIE_SC))\
-                                         / (u64)TICK_NSEC))
+#define NSEC_CONVERSION ((unsigned long)((((u64)1 << NSEC_JIFFIE_SC) +\
+                                        TICK_NSEC -1) / (u64)TICK_NSEC))
 #define USEC_CONVERSION  \
-                    ((unsigned long)((((u64)NSEC_PER_USEC << USEC_JIFFIE_SC)) \
-                                         / (u64)TICK_NSEC))
+                    ((unsigned long)((((u64)NSEC_PER_USEC << USEC_JIFFIE_SC) +\
+                                        TICK_NSEC -1) / (u64)TICK_NSEC))
 /*
  * USEC_ROUND is used in the timeval to jiffie conversion.  See there
  * for more details.  It is the scaled resolution rounding value.  Note
--- diff/include/linux/usb.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/linux/usb.h	2004-02-09 10:39:57.000000000 +0000
@@ -1016,16 +1016,6 @@
 
 /* -------------------------------------------------------------------------- */
 
-/*
- * Debugging and troubleshooting/diagnostic helpers.
- */
-void usb_show_device_descriptor(struct usb_device_descriptor *);
-void usb_show_config_descriptor(struct usb_config_descriptor *);
-void usb_show_interface_descriptor(struct usb_interface_descriptor *);
-void usb_show_endpoint_descriptor(struct usb_endpoint_descriptor *);
-void usb_show_device(struct usb_device *);
-void usb_show_string(struct usb_device *dev, char *id, int index);
-
 #ifdef DEBUG
 #define dbg(format, arg...) printk(KERN_DEBUG "%s: " format "\n" , __FILE__ , ## arg)
 #else
--- diff/include/linux/workqueue.h	2003-05-21 11:50:10.000000000 +0100
+++ source/include/linux/workqueue.h	2004-02-09 10:39:57.000000000 +0000
@@ -60,6 +60,7 @@
 extern int FASTCALL(schedule_delayed_work(struct work_struct *work, unsigned long delay));
 extern void flush_scheduled_work(void);
 extern int current_is_keventd(void);
+extern int keventd_up(void);
 
 extern void init_workqueues(void);
 
--- diff/include/linux/writeback.h	2003-10-09 09:47:17.000000000 +0100
+++ source/include/linux/writeback.h	2004-02-09 10:39:57.000000000 +0000
@@ -71,12 +71,15 @@
  * mm/page-writeback.c
  */
 int wakeup_bdflush(long nr_pages);
+void disk_is_spun_up(int postpone_writeback);
 
-/* These 5 are exported to sysctl. */
+/* These are exported to sysctl. */
 extern int dirty_background_ratio;
 extern int vm_dirty_ratio;
 extern int dirty_writeback_centisecs;
 extern int dirty_expire_centisecs;
+extern int block_dump;
+extern int laptop_mode;
 
 struct ctl_table;
 struct file;
--- diff/include/net/atmclip.h	2003-09-30 15:46:20.000000000 +0100
+++ source/include/net/atmclip.h	2004-02-09 10:39:57.000000000 +0000
@@ -44,7 +44,7 @@
 };
 
 
-#define PRIV(dev) ((struct clip_priv *) ((struct net_device *) (dev)+1))
+#define PRIV(dev) ((struct clip_priv *) netdev_priv(dev))
 
 
 struct clip_priv {
--- diff/include/net/irda/irlmp_frame.h	2002-10-16 04:27:49.000000000 +0100
+++ source/include/net/irda/irlmp_frame.h	2004-02-09 10:39:57.000000000 +0000
@@ -40,7 +40,7 @@
 
 #define CONTROL_BIT    0x80
 
-inline void irlmp_send_data_pdu(struct lap_cb *self, __u8 dlsap, __u8 slsap, 
+void irlmp_send_data_pdu(struct lap_cb *self, __u8 dlsap, __u8 slsap,
 				int expedited, struct sk_buff *skb);
 void irlmp_send_lcf_pdu(struct lap_cb *self, __u8 dlsap, __u8 slsap, 
 			__u8 opcode, struct sk_buff *skb);
--- diff/include/net/irda/timer.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/net/irda/timer.h	2004-02-09 10:39:57.000000000 +0000
@@ -74,19 +74,19 @@
 void irda_start_timer(struct timer_list *ptimer, int timeout, void* data,
 		      TIMER_CALLBACK callback);
 
-inline void irlap_start_slot_timer(struct irlap_cb *self, int timeout);
-inline void irlap_start_query_timer(struct irlap_cb *self, int timeout);
-inline void irlap_start_final_timer(struct irlap_cb *self, int timeout);
-inline void irlap_start_wd_timer(struct irlap_cb *self, int timeout);
-inline void irlap_start_backoff_timer(struct irlap_cb *self, int timeout);
+void irlap_start_slot_timer(struct irlap_cb *self, int timeout);
+void irlap_start_query_timer(struct irlap_cb *self, int timeout);
+void irlap_start_final_timer(struct irlap_cb *self, int timeout);
+void irlap_start_wd_timer(struct irlap_cb *self, int timeout);
+void irlap_start_backoff_timer(struct irlap_cb *self, int timeout);
 
 void irlap_start_mbusy_timer(struct irlap_cb *self, int timeout);
 void irlap_stop_mbusy_timer(struct irlap_cb *);
 
-inline void irlmp_start_watchdog_timer(struct lsap_cb *, int timeout);
-inline void irlmp_start_discovery_timer(struct irlmp_cb *, int timeout);
-inline void irlmp_start_idle_timer(struct lap_cb *, int timeout);
-inline void irlmp_stop_idle_timer(struct lap_cb *self); 
+void irlmp_start_watchdog_timer(struct lsap_cb *, int timeout);
+void irlmp_start_discovery_timer(struct irlmp_cb *, int timeout);
+void irlmp_start_idle_timer(struct lap_cb *, int timeout);
+void irlmp_stop_idle_timer(struct lap_cb *self);
 
 #endif
 
--- diff/include/net/lapb.h	2003-10-09 09:47:34.000000000 +0100
+++ source/include/net/lapb.h	2004-02-09 10:39:57.000000000 +0000
@@ -80,7 +80,7 @@
  */
 struct lapb_cb {
 	struct list_head	node;
-	void			*token;
+	struct net_device	*dev;
 
 	/* Link status fields */
 	unsigned int		mode;
--- diff/include/net/sctp/structs.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/net/sctp/structs.h	2004-02-09 10:39:57.000000000 +0000
@@ -369,7 +369,7 @@
 	struct sctp_paramhdr param_hdr;
 	union sctp_addr daddr;
 	unsigned long sent_at;
-} sctp_sender_hb_info_t __attribute__((packed));
+} __attribute__((packed)) sctp_sender_hb_info_t;
 
 /*
  *  RFC 2960 1.3.2 Sequenced Delivery within Streams
--- diff/include/net/tcp.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/net/tcp.h	2004-02-09 10:39:57.000000000 +0000
@@ -738,7 +738,7 @@
 #define TCP_ADD_STATS_BH(field, val)	SNMP_ADD_STATS_BH(tcp_statistics, field, val)
 #define TCP_ADD_STATS_USER(field, val)	SNMP_ADD_STATS_USER(tcp_statistics, field, val)
 
-extern inline void		tcp_put_port(struct sock *sk);
+extern void			tcp_put_port(struct sock *sk);
 extern void			tcp_inherit_port(struct sock *sk, struct sock *child);
 
 extern void			tcp_v4_err(struct sk_buff *skb, u32);
--- diff/include/pcmcia/mem_op.h	2002-11-28 11:30:26.000000000 +0000
+++ source/include/pcmcia/mem_op.h	2004-02-09 10:39:57.000000000 +0000
@@ -81,8 +81,12 @@
     size_t odd = (n & 1);
     n -= odd;
     while (n) {
-	*(u_short *)to = __raw_readw(from);
-	(char *)to += 2; (char *)from += 2; n -= 2;
+	u_short *t = to;
+
+	*t = __raw_readw(from);
+	to = (void *)((long)to + 2);
+	from = (const void *)((long)from + 2);
+	n -= 2;
     }
     if (odd)
 	*(u_char *)to = readb(from);
@@ -94,7 +98,9 @@
     n -= odd;
     while (n) {
 	__raw_writew(*(u_short *)from, to);
-	(char *)to += 2; (char *)from += 2; n -= 2;
+	to = (void *)((long)to + 2);
+	from = (const void *)((long)from + 2);
+	n -= 2;
     }
     if (odd)
 	writeb(*(u_char *)from, to);
@@ -106,7 +112,9 @@
     n -= odd;
     while (n) {
 	put_user(__raw_readw(from), (short *)to);
-	(char *)to += 2; (char *)from += 2; n -= 2;
+	to = (void *)((long)to + 2);
+	from = (const void *)((long)from + 2);
+	n -= 2;
     }
     if (odd)
 	put_user(readb(from), (char *)to);
@@ -121,7 +129,9 @@
     while (n) {
 	get_user(s, (short *)from);
 	__raw_writew(s, to);
-	(char *)to += 2; (char *)from += 2; n -= 2;
+	to = (void *)((long)to + 2);
+	from = (const void *)((long)from + 2);
+	n -= 2;
     }
     if (odd) {
 	get_user(c, (char *)from);
--- diff/include/sound/ac97_codec.h	2003-09-30 15:46:21.000000000 +0100
+++ source/include/sound/ac97_codec.h	2004-02-09 10:39:57.000000000 +0000
@@ -83,6 +83,33 @@
 #define AC97_VENDOR_ID1		0x7c	/* Vendor ID1 */
 #define AC97_VENDOR_ID2		0x7e	/* Vendor ID2 / revision */
 
+/* slot allocation */
+#define AC97_SLOT_TAG		0
+#define AC97_SLOT_CMD_ADDR	1
+#define AC97_SLOT_CMD_DATA	2
+#define AC97_SLOT_PCM_LEFT	3
+#define AC97_SLOT_PCM_RIGHT	4
+#define AC97_SLOT_MODEM_LINE1	5
+#define AC97_SLOT_PCM_CENTER	6
+#define AC97_SLOT_MIC		6	/* input */
+#define AC97_SLOT_SPDIF_LEFT1	6
+#define AC97_SLOT_PCM_SLEFT	7	/* surround left */
+#define AC97_SLOT_PCM_LEFT_0	7	/* double rate operation */
+#define AC97_SLOT_SPDIF_LEFT	7
+#define AC97_SLOT_PCM_SRIGHT	8	/* surround right */
+#define AC97_SLOT_PCM_RIGHT_0	8	/* double rate operation */
+#define AC97_SLOT_SPDIF_RIGHT	8
+#define AC97_SLOT_LFE		9
+#define AC97_SLOT_SPDIF_RIGHT1	9
+#define AC97_SLOT_MODEM_LINE2	10
+#define AC97_SLOT_PCM_LEFT_1	10	/* double rate operation */
+#define AC97_SLOT_SPDIF_LEFT2	10
+#define AC97_SLOT_HANDSET	11	/* output */
+#define AC97_SLOT_PCM_RIGHT_1	11	/* double rate operation */
+#define AC97_SLOT_SPDIF_RIGHT2	11
+#define AC97_SLOT_MODEM_GPIO	12	/* modem GPIO */
+#define AC97_SLOT_PCM_CENTER_1	12	/* double rate operation */
+
 /* basic capabilities (reset register) */
 #define AC97_BC_DEDICATED_MIC	0x0001	/* Dedicated Mic PCM In Channel */
 #define AC97_BC_RESERVED1	0x0002	/* Reserved (was Modem Line Codec support) */
@@ -180,6 +207,24 @@
 #define AC97_MEA_PRG		0x4000	/* HADC power down (high) */
 #define AC97_MEA_PRH		0x8000	/* HDAC power down (high) */
 
+/* modem gpio status defines */
+#define AC97_GPIO_LINE1_OH      0x0001  /* Off Hook Line1 */
+#define AC97_GPIO_LINE1_RI      0x0002  /* Ring Detect Line1 */
+#define AC97_GPIO_LINE1_CID     0x0004  /* Caller ID path enable Line1 */
+#define AC97_GPIO_LINE1_LCS     0x0008  /* Loop Current Sense Line1 */
+#define AC97_GPIO_LINE1_PULSE   0x0010  /* Opt./ Pulse Dial Line1 (out) */
+#define AC97_GPIO_LINE1_HL1R    0x0020  /* Opt./ Handset to Line1 relay control (out) */
+#define AC97_GPIO_LINE1_HOHD    0x0040  /* Opt./ Handset off hook detect Line1 (in) */
+#define AC97_GPIO_LINE12_AC     0x0080  /* Opt./ Int.bit 1 / Line1/2 AC (out) */
+#define AC97_GPIO_LINE12_DC     0x0100  /* Opt./ Int.bit 2 / Line1/2 DC (out) */
+#define AC97_GPIO_LINE12_RS     0x0200  /* Opt./ Int.bit 3 / Line1/2 RS (out) */
+#define AC97_GPIO_LINE2_OH      0x0400  /* Off Hook Line2 */
+#define AC97_GPIO_LINE2_RI      0x0800  /* Ring Detect Line2 */
+#define AC97_GPIO_LINE2_CID     0x1000  /* Caller ID path enable Line2 */
+#define AC97_GPIO_LINE2_LCS     0x2000  /* Loop Current Sense Line2 */
+#define AC97_GPIO_LINE2_PULSE   0x4000  /* Opt./ Pulse Dial Line2 (out) */
+#define AC97_GPIO_LINE2_HL1R    0x8000  /* Opt./ Handset to Line2 relay control (out) */
+
 /* specific - SigmaTel */
 #define AC97_SIGMATEL_ANALOG	0x6c	/* Analog Special */
 #define AC97_SIGMATEL_DAC2INVERT 0x6e
@@ -274,10 +319,13 @@
 
 
 /* ac97->scaps */
-#define AC97_SCAP_AUDIO		(1<<0)	/* audio AC'97 codec */
-#define AC97_SCAP_MODEM		(1<<1)	/* modem AC'97 codec */
+#define AC97_SCAP_AUDIO		(1<<0)	/* audio codec 97 */
+#define AC97_SCAP_MODEM		(1<<1)	/* modem codec 97 */
 #define AC97_SCAP_SURROUND_DAC	(1<<2)	/* surround L&R DACs are present */
 #define AC97_SCAP_CENTER_LFE_DAC (1<<3)	/* center and LFE DACs are present */
+#define AC97_SCAP_SKIP_AUDIO	(1<<4)	/* skip audio part of codec */
+#define AC97_SCAP_SKIP_MODEM	(1<<5)	/* skip modem part of codec */
+#define AC97_SCAP_INDEP_SDIN	(1<<6)	/* independent SDIN */
 
 /* ac97->flags */
 #define AC97_HAS_PC_BEEP	(1<<0)	/* force PC Speaker usage */
@@ -298,8 +346,36 @@
  *
  */
 
+typedef struct _snd_ac97_bus ac97_bus_t;
 typedef struct _snd_ac97 ac97_t;
 
+enum ac97_pcm_cfg {
+	AC97_PCM_CFG_FRONT = 2,
+	AC97_PCM_CFG_REAR = 10,		/* alias surround */
+	AC97_PCM_CFG_LFE = 11,		/* center + lfe */
+	AC97_PCM_CFG_40 = 4,		/* front + rear */
+	AC97_PCM_CFG_51 = 6,		/* front + rear + center/lfe */
+	AC97_PCM_CFG_SPDIF = 20
+};
+
+/* PCM allocation */
+struct ac97_pcm {
+	ac97_bus_t *bus;
+	unsigned int stream: 1,	   	   /* stream type: 1 = capture */
+		     exclusive: 1,	   /* exclusive mode, don't override with other pcms */
+		     copy_flag: 1,	   /* lowlevel driver must fill all entries */
+		     spdif: 1;		   /* spdif pcm */
+	unsigned short aslots;		   /* active slots */
+	unsigned int rates;		   /* available rates */
+	struct {
+		unsigned short slots;	   /* driver input: requested AC97 slot numbers */
+		unsigned short rslots[4];  /* allocated slots per codecs */
+		unsigned char rate_table[4];
+		ac97_t *codec[4];	   /* allocated codecs */
+	} r[2];				   /* 0 = standard rates, 1 = double rates */
+	unsigned long private_value;	   /* used by the hardware driver */
+};
+
 struct snd_ac97_build_ops {
 	int (*build_3d) (ac97_t *ac97);
 	int (*build_specific) (ac97_t *ac97);
@@ -307,18 +383,39 @@
 	int (*build_post_spdif) (ac97_t *ac97);
 };
 
-struct _snd_ac97 {
+struct _snd_ac97_bus {
+	/* -- lowlevel (hardware) driver specific -- */
 	void (*reset) (ac97_t *ac97);
 	void (*write) (ac97_t *ac97, unsigned short reg, unsigned short val);
 	unsigned short (*read) (ac97_t *ac97, unsigned short reg);
 	void (*wait) (ac97_t *ac97);
 	void (*init) (ac97_t *ac97);
+	void *private_data;
+	void (*private_free) (ac97_bus_t *bus);
+	/* --- */
+	snd_card_t *card;
+	unsigned short num;	/* bus number */
+	unsigned short vra: 1,	/* bridge supports VRA */
+		       isdin: 1;/* independent SDIN */
+	unsigned int clock;	/* AC'97 base clock (usually 48000Hz) */
+	spinlock_t bus_lock;	/* used mainly for slot allocation */
+	unsigned short used_slots[2][4]; /* actually used PCM slots */
+	unsigned short pcms_count; /* count of PCMs */
+	struct ac97_pcm *pcms;
+	ac97_t *codec[4];
+	snd_info_entry_t *proc;
+};
+
+struct _snd_ac97 {
+	/* -- lowlevel (hardware) driver specific -- */
 	struct snd_ac97_build_ops * build_ops;
 	void *private_data;
 	void (*private_free) (ac97_t *ac97);
 	/* --- */
-	snd_card_t *card;
+	ac97_bus_t *bus;
 	struct pci_dev *pci;	/* assigned PCI device - used for quirks */
+	snd_info_entry_t *proc;
+	snd_info_entry_t *proc_regs;
 	unsigned short subsystem_vendor;
 	unsigned short subsystem_device;
 	spinlock_t reg_lock;
@@ -330,7 +427,6 @@
 	unsigned short ext_mid;	/* extended modem ID (register 3C) */
 	unsigned int scaps;	/* driver capabilities */
 	unsigned int flags;	/* specific code */
-	unsigned int clock;	/* AC'97 clock (usually 48000Hz) */
 	unsigned int rates[6];	/* see AC97_RATES_* defines */
 	unsigned int spdif_status;
 	unsigned short regs[0x80]; /* register cache */
@@ -368,15 +464,14 @@
 }
 
 /* functions */
-int snd_ac97_mixer(snd_card_t * card, ac97_t * _ac97, ac97_t ** rac97);	/* create mixer controls */
-int snd_ac97_modem(snd_card_t * card, ac97_t * _ac97, ac97_t ** rac97);	/* create modem controls */
+int snd_ac97_bus(snd_card_t * card, ac97_bus_t * _bus, ac97_bus_t ** rbus); /* create new AC97 bus */
+int snd_ac97_mixer(ac97_bus_t * bus, ac97_t * _ac97, ac97_t ** rac97);	/* create mixer controls */
 
 void snd_ac97_write(ac97_t *ac97, unsigned short reg, unsigned short value);
 unsigned short snd_ac97_read(ac97_t *ac97, unsigned short reg);
 void snd_ac97_write_cache(ac97_t *ac97, unsigned short reg, unsigned short value);
 int snd_ac97_update(ac97_t *ac97, unsigned short reg, unsigned short value);
 int snd_ac97_update_bits(ac97_t *ac97, unsigned short reg, unsigned short mask, unsigned short value);
-int snd_ac97_set_rate(ac97_t *ac97, int reg, unsigned short rate);
 #ifdef CONFIG_PM
 void snd_ac97_suspend(ac97_t *ac97);
 void snd_ac97_resume(ac97_t *ac97);
@@ -399,5 +494,13 @@
 };
 
 int snd_ac97_tune_hardware(ac97_t *ac97, struct ac97_quirk *quirk);
+int snd_ac97_set_rate(ac97_t *ac97, int reg, unsigned short rate);
+
+int snd_ac97_pcm_assign(ac97_bus_t *ac97,
+			unsigned short pcms_count,
+			const struct ac97_pcm *pcms);
+int snd_ac97_pcm_open(struct ac97_pcm *pcm, unsigned int rate,
+		      enum ac97_pcm_cfg cfg, unsigned short slots);
+int snd_ac97_pcm_close(struct ac97_pcm *pcm);
 
 #endif /* __SOUND_AC97_CODEC_H */
--- diff/include/sound/asequencer.h	2003-08-20 14:16:34.000000000 +0100
+++ source/include/sound/asequencer.h	2004-02-09 10:39:57.000000000 +0000
@@ -1,6 +1,6 @@
 /*
  *  Main header file for the ALSA sequencer
- *  Copyright (c) 1998-1999 by Frank van de Pol <fvdpol@home.nl>
+ *  Copyright (c) 1998-1999 by Frank van de Pol <fvdpol@coil.demon.nl>
  *            (c) 1998-1999 by Jaroslav Kysela <perex@suse.cz>
  *
  *
--- diff/include/sound/asound.h	2003-09-30 15:46:21.000000000 +0100
+++ source/include/sound/asound.h	2004-02-09 10:39:57.000000000 +0000
@@ -107,9 +107,10 @@
 	SNDRV_HWDEP_IFACE_VX,		/* Digigram VX cards */
 	SNDRV_HWDEP_IFACE_MIXART,	/* Digigram miXart cards */
 	SNDRV_HWDEP_IFACE_USX2Y,	/* Tascam US122, US224 & US428 usb */
+	SNDRV_HWDEP_IFACE_EMUX_WAVETABLE, /* EmuX wavetable */	
 
 	/* Don't forget to change the following: */
-	SNDRV_HWDEP_IFACE_LAST = SNDRV_HWDEP_IFACE_USX2Y,
+	SNDRV_HWDEP_IFACE_LAST = SNDRV_HWDEP_IFACE_EMUX_WAVETABLE,
 };
 
 struct sndrv_hwdep_info {
@@ -272,6 +273,7 @@
 #define SNDRV_PCM_INFO_HALF_DUPLEX	0x00100000	/* only half duplex */
 #define SNDRV_PCM_INFO_JOINT_DUPLEX	0x00200000	/* playback and capture stream are somewhat correlated */
 #define SNDRV_PCM_INFO_SYNC_START	0x00400000	/* pcm support some kind of sync go */
+#define SNDRV_PCM_INFO_NONATOMIC_OPS	0x00800000	/* non-atomic prepare callback */
 
 enum sndrv_pcm_state {
 	SNDRV_PCM_STATE_OPEN = 0,	/* stream is open */
@@ -282,7 +284,8 @@
 	SNDRV_PCM_STATE_DRAINING,	/* stream is draining */
 	SNDRV_PCM_STATE_PAUSED,		/* stream is paused */
 	SNDRV_PCM_STATE_SUSPENDED,	/* hardware is suspended */
-	SNDRV_PCM_STATE_LAST = SNDRV_PCM_STATE_SUSPENDED,
+	SNDRV_PCM_STATE_DISCONNECTED,	/* hardware is disconnected */
+	SNDRV_PCM_STATE_LAST = SNDRV_PCM_STATE_DISCONNECTED,
 };
 
 enum {
@@ -683,7 +686,7 @@
  *                                                                          *
  ****************************************************************************/
 
-#define SNDRV_CTL_VERSION		SNDRV_PROTOCOL_VERSION(2, 0, 2)
+#define SNDRV_CTL_VERSION		SNDRV_PROTOCOL_VERSION(2, 0, 3)
 
 struct sndrv_ctl_card_info {
 	int card;			/* card number */
@@ -728,6 +731,7 @@
 #define SNDRV_CTL_ELEM_ACCESS_INACTIVE		(1<<8)	/* control does actually nothing, but may be updated */
 #define SNDRV_CTL_ELEM_ACCESS_LOCK		(1<<9)	/* write lock */
 #define SNDRV_CTL_ELEM_ACCESS_OWNER		(1<<10)	/* write lock owner */
+#define SNDRV_CTL_ELEM_ACCESS_USER		(1<<29) /* user space element */
 #define SNDRV_CTL_ELEM_ACCESS_DINDIRECT		(1<<30)	/* indirect access for matrix dimensions in the info structure */
 #define SNDRV_CTL_ELEM_ACCESS_INDIRECT		(1<<31)	/* indirect access for element value in the value structure */
 
@@ -824,6 +828,9 @@
 	SNDRV_CTL_IOCTL_ELEM_LOCK = _IOW('U', 0x14, struct sndrv_ctl_elem_id),
 	SNDRV_CTL_IOCTL_ELEM_UNLOCK = _IOW('U', 0x15, struct sndrv_ctl_elem_id),
 	SNDRV_CTL_IOCTL_SUBSCRIBE_EVENTS = _IOWR('U', 0x16, int),
+	SNDRV_CTL_IOCTL_ELEM_ADD = _IOWR('U', 0x17, struct sndrv_ctl_elem_info),
+	SNDRV_CTL_IOCTL_ELEM_REPLACE = _IOWR('U', 0x18, struct sndrv_ctl_elem_info),
+	SNDRV_CTL_IOCTL_ELEM_REMOVE = _IOWR('U', 0x19, struct sndrv_ctl_elem_id),
 	SNDRV_CTL_IOCTL_HWDEP_NEXT_DEVICE = _IOWR('U', 0x20, int),
 	SNDRV_CTL_IOCTL_HWDEP_INFO = _IOR('U', 0x21, struct sndrv_hwdep_info),
 	SNDRV_CTL_IOCTL_PCM_NEXT_DEVICE = _IOR('U', 0x30, int),
--- diff/include/sound/asound_fm.h	2002-10-16 04:29:02.000000000 +0100
+++ source/include/sound/asound_fm.h	2004-02-09 10:39:57.000000000 +0000
@@ -105,8 +105,6 @@
 /* for OPL3 only */
 #define SNDRV_DM_FM_IOCTL_SET_CONNECTION	_IOW('H', 0x26, int)
 
-#ifdef __SND_OSS_COMPAT__
-
 #define SNDRV_DM_FM_OSS_IOCTL_RESET		0x20
 #define SNDRV_DM_FM_OSS_IOCTL_PLAY_NOTE		0x21
 #define SNDRV_DM_FM_OSS_IOCTL_SET_VOICE		0x22
@@ -114,6 +112,4 @@
 #define SNDRV_DM_FM_OSS_IOCTL_SET_MODE		0x24
 #define SNDRV_DM_FM_OSS_IOCTL_SET_OPL		0x25
 
-#endif
-
 #endif /* __SOUND_ASOUND_FM_H */
--- diff/include/sound/core.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/sound/core.h	2004-02-09 10:39:57.000000000 +0000
@@ -308,6 +308,10 @@
 int snd_card_file_add(snd_card_t *card, struct file *file);
 int snd_card_file_remove(snd_card_t *card, struct file *file);
 
+#ifndef snd_card_set_dev
+#define snd_card_set_dev(card,devptr) ((card)->dev = (devptr))
+#endif
+
 /* device.c */
 
 int snd_device_new(snd_card_t *card, snd_device_type_t type,
@@ -331,10 +335,12 @@
 
 int snd_task_name(struct task_struct *task, char *name, size_t size);
 #ifdef CONFIG_SND_VERBOSE_PRINTK
-void snd_verbose_printk(const char *file, int line, const char *format, ...);
+void snd_verbose_printk(const char *file, int line, const char *format, ...)
+     __attribute__ ((format (printf, 3, 4)));
 #endif
 #if defined(CONFIG_SND_DEBUG) && defined(CONFIG_SND_VERBOSE_PRINTK)
-void snd_verbose_printd(const char *file, int line, const char *format, ...);
+void snd_verbose_printd(const char *file, int line, const char *format, ...)
+     __attribute__ ((format (printf, 3, 4)));
 #endif
 
 /* --- */
--- diff/include/sound/cs46xx.h	2003-05-21 11:50:10.000000000 +0100
+++ source/include/sound/cs46xx.h	2004-02-09 10:39:57.000000000 +0000
@@ -1712,6 +1712,7 @@
 
 
 	int nr_ac97_codecs;
+	ac97_bus_t *ac97_bus;
 	ac97_t *ac97[MAX_NR_AC97];
 
 	struct pci_dev *pci;
--- diff/include/sound/emu10k1.h	2003-09-30 15:46:21.000000000 +0100
+++ source/include/sound/emu10k1.h	2004-02-09 10:39:57.000000000 +0000
@@ -679,6 +679,9 @@
 #define A_ADCIDX		0x63
 #define A_ADCIDX_IDX		0x10000063
 
+#define A_MICIDX		0x64
+#define A_MICIDX_IDX		0x10000064
+
 #define FXIDX			0x65		/* FX recording buffer index register		*/
 #define FXIDX_MASK		0x0000ffff	/* 16-bit value					*/
 #define FXIDX_IDX		0x10000065
@@ -1049,7 +1052,7 @@
 snd_util_memblk_t *snd_emu10k1_synth_alloc(emu10k1_t *emu, unsigned int size);
 int snd_emu10k1_synth_free(emu10k1_t *emu, snd_util_memblk_t *blk);
 int snd_emu10k1_synth_bzero(emu10k1_t *emu, snd_util_memblk_t *blk, int offset, int size);
-int snd_emu10k1_synth_copy_from_user(emu10k1_t *emu, snd_util_memblk_t *blk, int offset, const char *data, int size);
+int snd_emu10k1_synth_copy_from_user(emu10k1_t *emu, snd_util_memblk_t *blk, int offset, const char __user *data, int size);
 int snd_emu10k1_memblk_map(emu10k1_t *emu, emu10k1_memblk_t *blk);
 
 /* voice allocation */
@@ -1152,10 +1155,12 @@
 #define FXBUS_MIDI_RIGHT	0x05
 #define FXBUS_PCM_CENTER	0x06
 #define FXBUS_PCM_LFE		0x07
-#define FXBUS_PT_LEFT		20
-#define FXBUS_PT_RIGHT		21
+#define FXBUS_PCM_LEFT_FRONT	0x08
+#define FXBUS_PCM_RIGHT_FRONT	0x09
 #define FXBUS_MIDI_REVERB	0x0c
 #define FXBUS_MIDI_CHORUS	0x0d
+#define FXBUS_PT_LEFT		0x14
+#define FXBUS_PT_RIGHT		0x15
 
 /* Inputs */
 #define EXTIN_AC97_L	   0x00	/* AC'97 capture channel - left */
@@ -1199,8 +1204,8 @@
 #define A_EXTIN_OPT_SPDIF_R     0x05    /*                              right */ 
 #define A_EXTIN_LINE2_L		0x08	/* audigy drive line2/mic2 - left */
 #define A_EXTIN_LINE2_R		0x09	/*                           right */
-#define A_EXTIN_RCA_SPDIF_L     0x0a    /* audigy drive RCA SPDIF - left */
-#define A_EXTIN_RCA_SPDIF_R     0x0b    /*                          right */
+#define A_EXTIN_ADC_L		0x0a    /* Philips ADC - left */
+#define A_EXTIN_ADC_R		0x0b    /*               right */
 #define A_EXTIN_AUX2_L		0x0c	/* audigy drive aux2 - left */
 #define A_EXTIN_AUX2_R		0x0d	/*                   - right */
 
@@ -1225,6 +1230,7 @@
 #define A_EXTOUT_AC97_R		0x11	/*      right */
 #define A_EXTOUT_ADC_CAP_L	0x16	/* ADC capture buffer left */
 #define A_EXTOUT_ADC_CAP_R	0x17	/*                    right */
+#define A_EXTOUT_MIC_CAP	0x18	/* Mic capture buffer */
 
 /* Audigy constants */
 #define A_C_00000000	0xc0
@@ -1249,8 +1255,8 @@
 #define A_C_4f1bbcdc	0xd3
 #define A_C_5a7ef9db	0xd4
 #define A_C_00100000	0xd5
-/* 0xd6 = 0x7fffffff  (?) ACCUM? */
-/* 0xd7 = 0x0000000   CCR */
+#define A_GPR_ACCU	0xd6		/* ACCUM, accumulator */
+#define A_GPR_COND	0xd7		/* CCR, condition register */
 /* 0xd8 = noise1 */
 /* 0xd9 = noise2 */
 
--- diff/include/sound/emu8000.h	2002-10-16 04:28:22.000000000 +0100
+++ source/include/sound/emu8000.h	2004-02-09 10:39:57.000000000 +0000
@@ -114,7 +114,7 @@
 void snd_emu8000_update_chorus_mode(emu8000_t *emu);
 void snd_emu8000_update_reverb_mode(emu8000_t *emu);
 void snd_emu8000_update_equalizer(emu8000_t *emu);
-int snd_emu8000_load_chorus_fx(emu8000_t *emu, int mode, const void *buf, long len);
-int snd_emu8000_load_reverb_fx(emu8000_t *emu, int mode, const void *buf, long len);
+int snd_emu8000_load_chorus_fx(emu8000_t *emu, int mode, const void __user *buf, long len);
+int snd_emu8000_load_reverb_fx(emu8000_t *emu, int mode, const void __user *buf, long len);
 
 #endif /* __SOUND_EMU8000_H */
--- diff/include/sound/emux_synth.h	2002-10-16 04:28:33.000000000 +0100
+++ source/include/sound/emux_synth.h	2004-02-09 10:39:57.000000000 +0000
@@ -63,7 +63,7 @@
 	int (*sample_new)(snd_emux_t *emu, snd_sf_sample_t *sp, snd_util_memhdr_t *hdr, const void *data, long count);
 	int (*sample_free)(snd_emux_t *emu, snd_sf_sample_t *sp, snd_util_memhdr_t *hdr);
 	void (*sample_reset)(snd_emux_t *emu);
-	int (*load_fx)(snd_emux_t *emu, int type, int arg, const void *data, long count);
+	int (*load_fx)(snd_emux_t *emu, int type, int arg, const void __user *data, long count);
 	void (*sysex)(snd_emux_t *emu, char *buf, int len, int parsed, snd_midi_channel_set_t *chset);
 #ifdef CONFIG_SND_SEQUENCER_OSS
 	int (*oss_ioctl)(snd_emux_t *emu, int cmd, int p1, int p2);
@@ -103,6 +103,8 @@
 	int midi_ports;		/* number of virtual midi devices */
 	int midi_devidx;	/* device offset of virtual midi */
 	unsigned int linear_panning: 1; /* panning is linear (sbawe = 1, emu10k1 = 0) */
+	int hwdep_idx;		/* hwdep device index */
+	snd_hwdep_t *hwdep;	/* hwdep device */
 
 	/* private */
 	int num_voices;		/* current number of voices */
@@ -113,6 +115,7 @@
 	struct semaphore register_mutex;
 	int client;		/* For the sequencer client */
 	int ports[SNDRV_EMUX_MAX_PORTS];	/* The ports for this device */
+	snd_emux_port_t *portptrs[SNDRV_EMUX_MAX_PORTS];
 	int used;	/* use counter */
 	char *name;	/* name of the device (internal) */
 	snd_rawmidi_t **vmidi;
--- diff/include/sound/hdsp.h	2003-09-30 15:46:21.000000000 +0100
+++ source/include/sound/hdsp.h	2004-02-09 10:39:57.000000000 +0000
@@ -25,17 +25,20 @@
 	Digiface,
 	Multiface,
 	H9652,
+	H9632,
 	Undefined,
 } HDSP_IO_Type;
 
 typedef struct _snd_hdsp_peak_rms hdsp_peak_rms_t;
 
 struct _snd_hdsp_peak_rms {
-	unsigned int playback_peaks[26];
 	unsigned int input_peaks[26];
+	unsigned int playback_peaks[26];
 	unsigned int output_peaks[28];
-	unsigned long long playback_rms[26];
 	unsigned long long input_rms[26];
+	unsigned long long playback_rms[26];
+	/* These are only used for H96xx cards */
+	unsigned long long output_rms[26];
 };
 
 #define SNDRV_HDSP_IOCTL_GET_PEAK_RMS _IOR('H', 0x40, hdsp_peak_rms_t)
@@ -61,6 +64,11 @@
 	unsigned char autosync_ref;
 	unsigned char line_out;
 	unsigned char passthru; 
+	unsigned char da_gain;
+	unsigned char ad_gain;
+	unsigned char phone_gain;
+	unsigned char xlr_breakout_cable;
+	unsigned char analog_extension_board;
 };
 
 #define SNDRV_HDSP_IOCTL_GET_CONFIG_INFO _IOR('H', 0x41, hdsp_config_info_t)
@@ -90,4 +98,13 @@
 
 #define SNDRV_HDSP_IOCTL_GET_MIXER _IOR('H', 0x44, hdsp_mixer_t)
 
+typedef struct _snd_hdsp_9632_aeb hdsp_9632_aeb_t;
+
+struct _snd_hdsp_9632_aeb {
+	int aebi;
+	int aebo;
+};
+
+#define SNDRV_HDSP_IOCTL_GET_9632_AEB _IOR('H', 0x45, hdsp_9632_aeb_t)
+
 #endif /* __SOUND_HDSP_H */
--- diff/include/sound/i2c.h	2002-10-16 04:27:20.000000000 +0100
+++ source/include/sound/i2c.h	2004-02-09 10:39:57.000000000 +0000
@@ -58,7 +58,7 @@
 	snd_card_t *card;	/* card which I2C belongs to */
 	char name[32];		/* some useful label */
 
-	spinlock_t lock;
+	struct semaphore lock_mutex;
 
 	snd_i2c_bus_t *master;	/* master bus when SCK/SCL is shared */
 	struct list_head buses;	/* master: slave buses sharing SCK/SCL, slave: link list */
@@ -84,15 +84,15 @@
 
 static inline void snd_i2c_lock(snd_i2c_bus_t *bus) {
 	if (bus->master)
-		spin_lock(&bus->master->lock);
+		down(&bus->master->lock_mutex);
 	else
-		spin_lock(&bus->lock);
+		down(&bus->lock_mutex);
 }
 static inline void snd_i2c_unlock(snd_i2c_bus_t *bus) {
 	if (bus->master)
-		spin_unlock(&bus->master->lock);
+		up(&bus->master->lock_mutex);
 	else
-		spin_unlock(&bus->lock);
+		up(&bus->lock_mutex);
 }
 
 int snd_i2c_sendbytes(snd_i2c_device_t *device, unsigned char *bytes, int count);
--- diff/include/sound/info.h	2003-08-20 14:16:34.000000000 +0100
+++ source/include/sound/info.h	2004-02-09 10:39:57.000000000 +0000
@@ -134,12 +134,13 @@
 /* for card drivers */
 int snd_card_proc_new(snd_card_t *card, const char *name, snd_info_entry_t **entryp);
 
-inline static void snd_info_set_text_ops(snd_info_entry_t *entry, 
+static inline void snd_info_set_text_ops(snd_info_entry_t *entry, 
 					 void *private_data,
+					 long read_size,
 					 void (*read)(snd_info_entry_t *, snd_info_buffer_t *))
 {
 	entry->private_data = private_data;
-	entry->c.text.read_size = 1024;
+	entry->c.text.read_size = read_size;
 	entry->c.text.read = read;
 }
 
--- diff/include/sound/initval.h	2003-06-30 10:07:24.000000000 +0100
+++ source/include/sound/initval.h	2004-02-09 10:39:57.000000000 +0000
@@ -35,7 +35,7 @@
 #define MODULE_DEVICES(val) MODULE_GENERIC_STRING(info_devices, val)
 #define MODULE_PARM_SYNTAX(id, val) MODULE_GENERIC_STRING(info_parm_##id, val)
 
-#define SNDRV_AUTO_PORT		0xffff
+#define SNDRV_AUTO_PORT		1
 #define SNDRV_AUTO_IRQ		0xffff
 #define SNDRV_AUTO_DMA		0xffff
 #define SNDRV_AUTO_DMA_SIZE	(0x7fffffff)
@@ -58,7 +58,7 @@
 #else
 #define SNDRV_DEFAULT_ENABLE_ISAPNP SNDRV_DEFAULT_ENABLE
 #endif
-#define SNDRV_DEFAULT_PORT	{ SNDRV_AUTO_PORT, [1 ... (SNDRV_CARDS-1)] = -1 }
+#define SNDRV_DEFAULT_PORT	{ [0 ... (SNDRV_CARDS-1)] = SNDRV_AUTO_PORT }
 #define SNDRV_DEFAULT_IRQ	{ [0 ... (SNDRV_CARDS-1)] = SNDRV_AUTO_IRQ }
 #define SNDRV_DEFAULT_DMA	{ [0 ... (SNDRV_CARDS-1)] = SNDRV_AUTO_DMA }
 #define SNDRV_DEFAULT_DMA_SIZE	{ [0 ... (SNDRV_CARDS-1)] = SNDRV_AUTO_DMA_SIZE }
@@ -136,31 +136,41 @@
 #if defined(SNDRV_GET_ID) && !defined(MODULE)
 #include <linux/ctype.h>
 #include <linux/init.h>
+#include <linux/bootmem.h>
 static int __init get_id(char **str, char **dst)
 {
-	char *s, *d;
+	char *s;
 
 	if (!(*str) || !(**str))
 		return 0;
 	for (s = *str; isalpha(*s) || isdigit(*s) || *s == '_'; s++);
 	if (s != *str) {
-		*dst = (char *)kmalloc((s - *str) + 1, GFP_KERNEL);
-		s = *str; d = *dst;
-		while (isalpha(*s) || isdigit(*s) || *s == '_') {
-			if (d != NULL)
-				*d++ = *s;
-			s++;
+		int len = s - *str;
+		char *d = (char *)alloc_bootmem(len + 1);
+		if (d != NULL) {
+			memcpy(*dst = d, *str, len);
+			d[len] = '\0';
 		}
-		if (d != NULL)
-			*d = '\0';
 	}
-	*str = s;
 	if (*s == ',') {
-		(*str)++;
+		*str = s + 1;
 		return 2;
 	}
+	*str = s;
 	return 1;
 }
 #endif
 
+/* simple wrapper for long variable.
+ * the value more than 32bit won't work!
+ */
+inline static int get_option_long(char **str, long *valp)
+{
+	int val, ret;
+	ret = get_option(str, &val);
+	if (ret)
+		*valp = val;
+	return ret;
+}
+
 #endif /* __SOUND_INITVAL_H */
--- diff/include/sound/minors.h	2002-10-16 04:27:09.000000000 +0100
+++ source/include/sound/minors.h	2004-02-09 10:39:57.000000000 +0000
@@ -81,6 +81,9 @@
 #define SNDRV_OSS_DEVICE_TYPE_SNDSTAT	5
 #define SNDRV_OSS_DEVICE_TYPE_MUSIC	6
 
+#define MODULE_ALIAS_SNDRV_MINOR(type) \
+	MODULE_ALIAS("sound-service-?-" __stringify(type))
+
 #endif
 
 #endif /* __SOUND_MINORS_H */
--- diff/include/sound/pcm.h	2003-06-30 10:07:24.000000000 +0100
+++ source/include/sound/pcm.h	2004-02-09 10:39:57.000000000 +0000
@@ -427,6 +427,10 @@
 	snd_minor_t *reg;
 	snd_info_entry_t *proc_root;
 	snd_info_entry_t *proc_info_entry;
+#ifdef CONFIG_SND_DEBUG
+	unsigned int xrun_debug: 1;
+	snd_info_entry_t *proc_xrun_debug_entry;
+#endif
 };
 
 struct _snd_pcm {
@@ -461,8 +465,6 @@
 extern snd_pcm_t *snd_pcm_devices[];
 extern snd_minor_t snd_pcm_reg[2];
 
-void snd_pcm_lock(int unlock);
-
 int snd_pcm_new(snd_card_t * card, char *id, int device,
 		int playback_count, int capture_count,
 		snd_pcm_t **rpcm);
--- diff/include/sound/pcm_oss.h	2003-10-27 09:20:39.000000000 +0000
+++ source/include/sound/pcm_oss.h	2004-02-09 10:39:57.000000000 +0000
@@ -31,7 +31,7 @@
 		     direct:1,
 		     block:1,
 		     nonblock:1,
-		     wholefrag:1,
+		     partialfrag:1,
 		     nosilence:1;
 	unsigned int periods;
 	unsigned int period_size;
--- diff/include/sound/sb.h	2003-06-30 10:07:24.000000000 +0100
+++ source/include/sound/sb.h	2004-02-09 10:39:57.000000000 +0000
@@ -63,8 +63,6 @@
 struct _snd_sb {
 	unsigned long port;		/* base port of DSP chip */
 	struct resource *res_port;
-	unsigned long alt_port;		/* alternate port (ALS4000) */
-	struct resource *res_alt_port;
 	unsigned long mpu_port;		/* MPU port for SB DSP 4.0+ */
 	int irq;			/* IRQ number of DSP chip */
 	int dma8;			/* 8-bit DMA */
@@ -72,6 +70,7 @@
 	unsigned short version;		/* version of DSP chip */
 	enum sb_hw_type hardware;	/* see to SB_HW_XXXX */
 
+	unsigned long alt_port;		/* alternate port (ALS4000) */
 	struct pci_dev *pci;		/* ALS4000 */
 
 	unsigned int open;		/* see to SB_OPEN_XXXX for sb8 */
--- diff/include/sound/seq_kernel.h	2003-06-09 14:18:20.000000000 +0100
+++ source/include/sound/seq_kernel.h	2004-02-09 10:39:57.000000000 +0000
@@ -3,7 +3,7 @@
 
 /*
  *  Main kernel header file for the ALSA sequencer
- *  Copyright (c) 1998 by Frank van de Pol <fvdpol@home.nl>
+ *  Copyright (c) 1998 by Frank van de Pol <fvdpol@coil.demon.nl>
  *
  *
  *   This program is free software; you can redistribute it and/or modify
--- diff/include/sound/sfnt_info.h	2002-10-16 04:28:25.000000000 +0100
+++ source/include/sound/sfnt_info.h	2004-02-09 10:39:57.000000000 +0000
@@ -22,16 +22,22 @@
  *
  */
 
-#include "seq_oss_legacy.h"
+#include <sound/asound.h>
 
 /*
  * patch information record
  */
 
+#ifdef SNDRV_BIG_ENDIAN
+#define SNDRV_OSS_PATCHKEY(id) (0xfd00|id)
+#else
+#define SNDRV_OSS_PATCHKEY(id) ((id<<8)|0xfd)
+#endif
+
 /* patch interface header: 16 bytes */
 typedef struct soundfont_patch_info_t {
 	unsigned short key;		/* use the key below */
-#define SNDRV_OSS_SOUNDFONT_PATCH		_PATCHKEY(0x07)
+#define SNDRV_OSS_SOUNDFONT_PATCH		SNDRV_OSS_PATCHKEY(0x07)
 
 	short device_no;		/* synthesizer number */
 	unsigned short sf_id;		/* file id (should be zero) */
@@ -181,4 +187,28 @@
 } soundfont_voice_map_t;
 
 
+/*
+ * ioctls for hwdep
+ */
+
+#define SNDRV_EMUX_HWDEP_NAME	"Emux WaveTable"
+
+#define SNDRV_EMUX_VERSION	((1 << 16) | (0 << 8) | 0)	/* 1.0.0 */
+
+struct sndrv_emux_misc_mode {
+	int port;	/* -1 = all */
+	int mode;
+	int value;
+	int value2;	/* reserved */
+};
+
+enum {
+	SNDRV_EMUX_IOCTL_VERSION = _IOR('H', 0x80, unsigned int),
+	SNDRV_EMUX_IOCTL_LOAD_PATCH = _IOWR('H', 0x81, soundfont_patch_info_t),
+	SNDRV_EMUX_IOCTL_RESET_SAMPLES = _IO('H', 0x82),
+	SNDRV_EMUX_IOCTL_REMOVE_LAST_SAMPLES = _IO('H', 0x83),
+	SNDRV_EMUX_IOCTL_MEM_AVAIL = _IOW('H', 0x84, int),
+	SNDRV_EMUX_IOCTL_MISC_MODE = _IOWR('H', 0x84, struct sndrv_emux_misc_mode),
+};
+
 #endif /* __SOUND_SFNT_INFO_H */
--- diff/include/sound/sndmagic.h	2003-10-09 09:47:34.000000000 +0100
+++ source/include/sound/sndmagic.h	2004-02-09 10:39:57.000000000 +0000
@@ -133,6 +133,7 @@
 #define mpu401_t_magic				0xa15a1701
 #define fm801_t_magic				0xa15a1801
 #define ac97_t_magic				0xa15a1901
+#define ac97_bus_t_magic			0xa15a1902
 #define ak4531_t_magic				0xa15a1a01
 #define snd_uart16550_t_magic			0xa15a1b01
 #define emu10k1_t_magic				0xa15a1c01
@@ -197,7 +198,6 @@
 #define vx_core_t_magic				0xa15a4110
 #define vx_pipe_t_magic				0xa15a4112
 #define azf3328_t_magic				0xa15a4200
-
 #define snd_card_harmony_t_magic		0xa15a4300
 
 #else
--- diff/include/sound/soundfont.h	2003-08-20 14:16:34.000000000 +0100
+++ source/include/sound/soundfont.h	2004-02-09 10:39:57.000000000 +0000
@@ -68,7 +68,7 @@
  * Type of the sample access callback
  */
 typedef int (*snd_sf_sample_new_t)(void *private_data, snd_sf_sample_t *sp,
-				   snd_util_memhdr_t *hdr, const void *buf, long count);
+				   snd_util_memhdr_t *hdr, const void __user *buf, long count);
 typedef int (*snd_sf_sample_free_t)(void *private_data, snd_sf_sample_t *sp,
 				    snd_util_memhdr_t *hdr);
 typedef void (*snd_sf_sample_reset_t)(void *private);
@@ -101,8 +101,8 @@
 } snd_sf_list_t;
 
 /* Prototypes for soundfont.c */
-int snd_soundfont_load(snd_sf_list_t *sflist, const void *data, long count, int client);
-int snd_soundfont_load_guspatch(snd_sf_list_t *sflist, const char *data,
+int snd_soundfont_load(snd_sf_list_t *sflist, const void __user *data, long count, int client);
+int snd_soundfont_load_guspatch(snd_sf_list_t *sflist, const char __user *data,
 				long count, int client);
 int snd_soundfont_close_check(snd_sf_list_t *sflist, int client);
 
--- diff/include/sound/sscape_ioctl.h	2003-09-30 15:46:21.000000000 +0100
+++ source/include/sound/sscape_ioctl.h	2004-02-09 10:39:57.000000000 +0000
@@ -8,9 +8,11 @@
   unsigned version;
 };
 
+#define SSCAPE_MICROCODE_SIZE  65536
+
 struct sscape_microcode
 {
-  unsigned char *code;	/* 65536 chars */
+  unsigned char *code;
 };
 
 #define SND_SSCAPE_LOAD_BOOTB  _IOWR('P', 100, struct sscape_bootblock)
--- diff/include/sound/trident.h	2003-06-09 14:18:20.000000000 +0100
+++ source/include/sound/trident.h	2004-02-09 10:39:57.000000000 +0000
@@ -443,6 +443,7 @@
 	snd_rawmidi_t *rmidi;
 	snd_seq_device_t *seq_dev;
 
+	ac97_bus_t *ac97_bus;
 	ac97_t *ac97;
 	ac97_t *ac97_sec;
 
--- diff/include/sound/version.h	2003-09-30 15:46:21.000000000 +0100
+++ source/include/sound/version.h	2004-02-09 10:39:57.000000000 +0000
@@ -1,3 +1,3 @@
-/* include/version.h.  Generated automatically by configure.  */
-#define CONFIG_SND_VERSION "0.9.7"
-#define CONFIG_SND_DATE " (Thu Sep 25 19:16:36 2003 UTC)"
+/* include/version.h.  Generated by configure.  */
+#define CONFIG_SND_VERSION "1.0.2"
+#define CONFIG_SND_DATE " (Tue Jan 27 10:28:52 2004 UTC)"
--- diff/include/sound/ymfpci.h	2003-08-20 14:16:34.000000000 +0100
+++ source/include/sound/ymfpci.h	2004-02-09 10:39:57.000000000 +0000
@@ -25,6 +25,7 @@
 #include "pcm.h"
 #include "rawmidi.h"
 #include "ac97_codec.h"
+#include "timer.h"
 #include <linux/gameport.h>
 
 #ifndef PCI_VENDOR_ID_YAMAHA
@@ -311,8 +312,6 @@
 
 	unsigned short old_legacy_ctrl;
 #if defined(CONFIG_GAMEPORT) || defined(CONFIG_GAMEPORT_MODULE)
-	unsigned int joystick_port;
-	struct semaphore joystick_mutex;
 	struct resource *joystick_res;
 	struct gameport gameport;
 #endif
@@ -347,8 +346,10 @@
 	u32 active_bank;
 	ymfpci_voice_t voices[64];
 
+	ac97_bus_t *ac97_bus;
 	ac97_t *ac97;
 	snd_rawmidi_t *rawmidi;
+	snd_timer_t *timer;
 
 	struct pci_dev *pci;
 	snd_card_t *card;
@@ -389,9 +390,7 @@
 int snd_ymfpci_pcm_spdif(ymfpci_t *chip, int device, snd_pcm_t **rpcm);
 int snd_ymfpci_pcm_4ch(ymfpci_t *chip, int device, snd_pcm_t **rpcm);
 int snd_ymfpci_mixer(ymfpci_t *chip, int rear_switch);
-#if defined(CONFIG_GAMEPORT) || defined(CONFIG_GAMEPORT_MODULE)
-int snd_ymfpci_joystick(ymfpci_t *chip);
-#endif
+int snd_ymfpci_timer(ymfpci_t *chip, int device);
 
 int snd_ymfpci_voice_alloc(ymfpci_t *chip, ymfpci_voice_type_t type, int pair, ymfpci_voice_t **rvoice);
 int snd_ymfpci_voice_free(ymfpci_t *chip, ymfpci_voice_t *pvoice);
@@ -401,4 +400,8 @@
 void snd_ymfpci_resume(ymfpci_t *chip);
 #endif
 
+#if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE))
+#define SUPPORT_JOYSTICK
+#endif
+
 #endif /* __SOUND_YMFPCI_H */
--- diff/include/video/sisfb.h	2003-10-09 09:47:17.000000000 +0100
+++ source/include/video/sisfb.h	2004-02-09 10:39:57.000000000 +0000
@@ -1,37 +1,98 @@
+/*
+ * Copyright (C) 2001-2004 by Thomas Winischhofer, Vienna, Austria.
+ *
+ * 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 named License,
+ * or 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_SISFB
 #define _LINUX_SISFB
 
-#include <linux/spinlock.h>
-
 #include <asm/ioctl.h>
 #include <asm/types.h>
 
-#define DISPTYPE_CRT1       0x00000008L
-#define DISPTYPE_CRT2       0x00000004L
-#define DISPTYPE_LCD        0x00000002L
-#define DISPTYPE_TV         0x00000001L
-#define DISPTYPE_DISP1      DISPTYPE_CRT1
-#define DISPTYPE_DISP2      (DISPTYPE_CRT2 | DISPTYPE_LCD | DISPTYPE_TV)
-#define DISPMODE_SINGLE	    0x00000020L
-#define DISPMODE_MIRROR	    0x00000010L
-#define DISPMODE_DUALVIEW   0x00000040L
-
-#define HASVB_NONE      	0x00
-#define HASVB_301       	0x01
-#define HASVB_LVDS      	0x02
-#define HASVB_TRUMPION  	0x04
-#define HASVB_LVDS_CHRONTEL	0x10
-#define HASVB_302       	0x20
-#define HASVB_303       	0x40
-#define HASVB_CHRONTEL  	0x80
+/**********************************************/
+/*                   PUBLIC                   */
+/**********************************************/
+
+/* vbflags */
+#define CRT2_DEFAULT            0x00000001
+#define CRT2_LCD                0x00000002  /* TW: Never change the order of the CRT2_XXX entries */
+#define CRT2_TV                 0x00000004  /*     (see SISCycleCRT2Type())                       */
+#define CRT2_VGA                0x00000008
+#define TV_NTSC                 0x00000010
+#define TV_PAL                  0x00000020
+#define TV_HIVISION             0x00000040
+#define TV_YPBPR                0x00000080
+#define TV_AVIDEO               0x00000100
+#define TV_SVIDEO               0x00000200
+#define TV_SCART                0x00000400
+#define VB_CONEXANT		0x00000800
+#define TV_PALM                 0x00001000
+#define TV_PALN                 0x00002000
+#define TV_NTSCJ		0x00001000
+#define VB_302ELV		0x00004000
+#define TV_CHSCART              0x00008000
+#define TV_CHYPBPR525I          0x00010000
+#define CRT1_VGA		0x00000000
+#define CRT1_LCDA		0x00020000
+#define VGA2_CONNECTED          0x00040000
+#define VB_DISPTYPE_CRT1	0x00080000  	/* CRT1 connected and used */
+#define VB_301                  0x00100000	/* Video bridge type */
+#define VB_301B                 0x00200000
+#define VB_302B                 0x00400000
+#define VB_30xBDH		0x00800000      /* 30xB DH version (w/o LCD support) */
+#define VB_LVDS                 0x01000000
+#define VB_CHRONTEL             0x02000000
+#define VB_301LV                0x04000000
+#define VB_302LV                0x08000000
+#define VB_301C			0x10000000
+#define VB_SINGLE_MODE          0x20000000   	/* CRT1 or CRT2; determined by DISPTYPE_CRTx */
+#define VB_MIRROR_MODE		0x40000000   	/* CRT1 + CRT2 identical (mirror mode) */
+#define VB_DUALVIEW_MODE	0x80000000   	/* CRT1 + CRT2 independent (dual head mode) */
+
+/* Aliases: */
+#define CRT2_ENABLE		(CRT2_LCD | CRT2_TV | CRT2_VGA)
+#define TV_STANDARD             (TV_NTSC | TV_PAL | TV_PALM | TV_PALN | TV_NTSCJ)
+#define TV_INTERFACE            (TV_AVIDEO|TV_SVIDEO|TV_SCART|TV_HIVISION|TV_YPBPR|TV_CHSCART|TV_CHYPBPR525I)
+
+/* Only if TV_YPBPR is set: */
+#define TV_YPBPR525I		TV_NTSC
+#define TV_YPBPR525P		TV_PAL
+#define TV_YPBPR750P		TV_PALM
+#define TV_YPBPR1080I		TV_PALN
+#define TV_YPBPRALL 		(TV_YPBPR525I | TV_YPBPR525P | TV_YPBPR750P | TV_YPBPR1080I)
+
+#define VB_SISBRIDGE            (VB_301|VB_301B|VB_301C|VB_302B|VB_301LV|VB_302LV|VB_302ELV)
+#define VB_SISTVBRIDGE          (VB_301|VB_301B|VB_301C|VB_302B|VB_301LV|VB_302LV)
+#define VB_VIDEOBRIDGE		(VB_SISBRIDGE | VB_LVDS | VB_CHRONTEL | VB_CONEXANT)
+
+#define VB_DISPTYPE_DISP2	CRT2_ENABLE
+#define VB_DISPTYPE_CRT2	CRT2_ENABLE
+#define VB_DISPTYPE_DISP1	VB_DISPTYPE_CRT1
+#define VB_DISPMODE_SINGLE	VB_SINGLE_MODE
+#define VB_DISPMODE_MIRROR	VB_MIRROR_MODE
+#define VB_DISPMODE_DUAL	VB_DUALVIEW_MODE
+#define VB_DISPLAY_MODE       	(SINGLE_MODE | MIRROR_MODE | DUALVIEW_MODE)
 
-/* TW: *Never* change the order of the following enum */
+/* *Never* change the order of the following enum */
 typedef enum _SIS_CHIP_TYPE {
-	SIS_VGALegacy = 0,
+	SIS_VGALegacy = 0,	/* chip_id in sisfb_info */
 	SIS_300,
 	SIS_630,
 	SIS_540,
-	SIS_730, 
+	SIS_730,
 	SIS_315H,
 	SIS_315,
 	SIS_315PRO,
@@ -39,15 +100,73 @@
 	SIS_650,
 	SIS_740,
 	SIS_330,
+	SIS_661,
+	SIS_741,
+	SIS_660,
+	SIS_760,
 	MAX_SIS_CHIP
 } SIS_CHIP_TYPE;
 
-typedef enum _VGA_ENGINE {
-	UNKNOWN_VGA = 0,
-	SIS_300_VGA,
-	SIS_315_VGA,
-} VGA_ENGINE;
+/* Addtional IOCTLs for communication sisfb <> X driver                */
+/* If changing this, vgatypes.h must also be changed (for X driver)    */
+
+/* ioctl for identifying and giving some info (esp. memory heap start) */
+#define SISFB_GET_INFO	  	_IOR('n',0xF8,__u32)
+/* ioctrl to get current vertical retrace status */
+#define SISFB_GET_VBRSTATUS  	_IOR('n',0xF9,__u32)
+/* ioctl to enable/disable panning auto-maximize (like nomax parameter) */
+#define SISFB_GET_AUTOMAXIMIZE 	_IOR('n',0xFA,__u32)
+#define SISFB_SET_AUTOMAXIMIZE 	_IOW('n',0xFA,__u32)
+
+/* TW: Structure argument for SISFB_GET_INFO ioctl  */
+typedef struct _SISFB_INFO sisfb_info, *psisfb_info;
+
+struct _SISFB_INFO {
+	unsigned long sisfb_id;         /* for identifying sisfb */
+#ifndef SISFB_ID
+#define SISFB_ID	  0x53495346    /* Identify myself with 'SISF' */
+#endif
+ 	int    chip_id;			/* PCI ID of detected chip */
+	int    memory;			/* video memory in KB which sisfb manages */
+	int    heapstart;               /* heap start (= sisfb "mem" argument) in KB */
+	unsigned char fbvidmode;	/* current sisfb mode */
+
+	unsigned char sisfb_version;
+	unsigned char sisfb_revision;
+	unsigned char sisfb_patchlevel;
+
+	unsigned char sisfb_caps;	/* Sisfb capabilities */
+
+	int    sisfb_tqlen;		/* turbo queue length (in KB) */
+
+	unsigned int sisfb_pcibus;      /* The card's PCI ID */
+	unsigned int sisfb_pcislot;
+	unsigned int sisfb_pcifunc;
+
+	unsigned char sisfb_lcdpdc;	/* PanelDelayCompensation */
+
+	unsigned char sisfb_lcda;	/* Detected status of LCDA for low res/text modes */
+
+	unsigned long sisfb_vbflags;
+	unsigned long sisfb_currentvbflags;
+
+	int sisfb_scalelcd;
+	unsigned long sisfb_specialtiming;
+
+	unsigned char sisfb_haveemi;
+	unsigned char sisfb_emi30,sisfb_emi31,sisfb_emi32,sisfb_emi33;
+	unsigned char sisfb_haveemilcd;
+
+	char reserved[213]; 		/* for future use */
+};
+
+/* For fb memory manager */
+struct sis_memreq {
+	unsigned long offset;
+	unsigned long size;
+};
 
+/* More or less deprecated stuff follows: */
 typedef enum _TVTYPE {
 	TVMODE_NTSC = 0,
 	TVMODE_PAL,
@@ -63,19 +182,14 @@
 	TVPLUG_TOTAL
 } SIS_TV_PLUG;
 
-struct sis_memreq {
-	unsigned long offset;
-	unsigned long size;
-};
-
 struct mode_info {
 	int    bpp;
 	int    xres;
 	int    yres;
-	int    v_xres;
-	int    v_yres;
-	int    org_x;
-	int    org_y;
+	int    v_xres;		/* deprecated - use var instead */
+	int    v_yres;		/* deprecated - use var instead */
+	int    org_x;		/* deprecated - use var instead */
+	int    org_y;		/* deprecated - use var instead */
 	unsigned int  vrate;
 };
 
@@ -83,15 +197,30 @@
 	struct mode_info minfo;
 	unsigned long iobase;
 	unsigned int  mem_size;
-	unsigned long disp_state;    	
+	unsigned long disp_state;  /* deprecated */
 	SIS_CHIP_TYPE chip;
 	unsigned char hasVB;
-	SIS_TV_TYPE TV_type;
-	SIS_TV_PLUG TV_plug;
+	SIS_TV_TYPE TV_type;	   /* deprecated */
+	SIS_TV_PLUG TV_plug;	   /* deprecated */
 	unsigned long version;
-	char reserved[256];
+	unsigned long vbflags;	   /* replaces deprecated entries above */
+	unsigned long currentvbflags;
+	char reserved[248];
 };
 
+/**********************************************/
+/*                  PRIVATE                   */
+/**********************************************/
+
+#ifdef __KERNEL__
+#include <linux/spinlock.h>
+
+typedef enum _VGA_ENGINE {
+	UNKNOWN_VGA = 0,
+	SIS_300_VGA,
+	SIS_315_VGA,
+} VGA_ENGINE;
+
 struct video_info {
 	int           chip_id;
 	unsigned int  video_size;
@@ -107,26 +236,26 @@
 	int    video_cmap_len;
 	int    video_width;
 	int    video_height;
-	int    video_vwidth;
-	int    video_vheight;
-	int    org_x;
-	int    org_y;
+	int    video_vwidth;			/* DEPRECATED - use var instead */
+	int    video_vheight;			/* DEPRECATED - use var instead */
+	int    org_x;				/* DEPRECATED - use var instead */
+	int    org_y;				/* DEPRECATED - use var instead */
 	int    video_linelength;
 	unsigned int refresh_rate;
 
-	unsigned long disp_state;
-	unsigned char hasVB;
-	unsigned char TV_type;
-	unsigned char TV_plug;
+	unsigned long disp_state;		/* DEPRECATED */
+	unsigned char hasVB;			/* DEPRECATED */
+	unsigned char TV_type;			/* DEPRECATED */
+	unsigned char TV_plug;			/* DEPRECATED */
 
 	SIS_CHIP_TYPE chip;
 	unsigned char revision_id;
 
-        unsigned short DstColor;		/* TW: For 2d acceleration */
+        unsigned short DstColor;		/* For 2d acceleration */
 	unsigned long  SiS310_AccelDepth;
 	unsigned long  CommandReg;
 
-	spinlock_t     lockaccel;
+	spinlock_t     lockaccel;		/* Do not use outside of kernel! */
 
         unsigned int   pcibus;
 	unsigned int   pcislot;
@@ -137,58 +266,20 @@
 	unsigned short subsysvendor;
 	unsigned short subsysdevice;
 
-	char reserved[236];
-};
-
-
-/* TW: Addtional IOCTL for communication sisfb <> X driver                 */
-/*     If changing this, vgatypes.h must also be changed (for X driver)    */
-
-/* TW: ioctl for identifying and giving some info (esp. memory heap start) */
-
-/*
- * NOTE! The ioctl types used to be "size_t" by mistake, but were
- * really meant to be __u32. Changed to "__u32" even though that
- * changes the value on 64-bit architectures, because the value
- * (with a 4-byte size) is also hardwired in vgatypes.h for user
- * space exports. So "__u32" is actually more compatible, duh!
- */
-#define SISFB_GET_INFO	  	_IOR('n',0xF8,__u32)
-#define SISFB_GET_VBRSTATUS  	_IOR('n',0xF9,__u32)
-
-/* TW: Structure argument for SISFB_GET_INFO ioctl  */
-typedef struct _SISFB_INFO sisfb_info, *psisfb_info;
-
-struct _SISFB_INFO {
-	unsigned long sisfb_id;         /* for identifying sisfb */
-#ifndef SISFB_ID
-#define SISFB_ID	  0x53495346    /* Identify myself with 'SISF' */
-#endif
- 	int    chip_id;			/* PCI ID of detected chip */
-	int    memory;			/* video memory in KB which sisfb manages */
-	int    heapstart;               /* heap start (= sisfb "mem" argument) in KB */
-	unsigned char fbvidmode;	/* current sisfb mode */
-	
-	unsigned char sisfb_version;
-	unsigned char sisfb_revision;
-	unsigned char sisfb_patchlevel;
+	unsigned long  vbflags;			/* Replacing deprecated stuff from above */
+	unsigned long  currentvbflags;
 
-	unsigned char sisfb_caps;	/* Sisfb capabilities */
+	int    current_bpp;
+	int    current_width;
+	int    current_height;
+	int    current_htotal;
+	int    current_vtotal;
+	__u32  current_pixclock;
+	int    current_refresh_rate;
 
-	int    sisfb_tqlen;		/* turbo queue length (in KB) */
-
-	unsigned int sisfb_pcibus;      /* The card's PCI ID */
-	unsigned int sisfb_pcislot;
-	unsigned int sisfb_pcifunc;
-
-	unsigned char sisfb_lcdpdc;	/* PanelDelayCompensation */
-	
-	unsigned char sisfb_lcda;	/* Detected status of LCDA for low res/text modes */
-
-	char reserved[235]; 		/* for future use */
+	char reserved[200];
 };
 
-#ifdef __KERNEL__
 extern struct video_info ivideo;
 
 extern void sis_malloc(struct sis_memreq *req);
--- diff/init/Kconfig	2004-01-19 10:22:59.000000000 +0000
+++ source/init/Kconfig	2004-02-09 10:39:57.000000000 +0000
@@ -43,7 +43,7 @@
 
 config STANDALONE
 	bool "Select only drivers that don't need compile-time external firmware" if EXPERIMENTAL
-	default y
+	default n
 	help
 	  Select this option if you don't have magic firmware for drivers that
 	  need it.
--- diff/init/do_mounts.c	2004-01-19 10:22:59.000000000 +0000
+++ source/init/do_mounts.c	2004-02-09 10:39:57.000000000 +0000
@@ -141,9 +141,11 @@
 	dev_t res = 0;
 	int part;
 
+#ifdef CONFIG_SYSFS
 	sys_mkdir("/sys", 0700);
 	if (sys_mount("sysfs", "/sys", "sysfs", 0, NULL) < 0)
 		goto out;
+#endif
 
 	if (strncmp(name, "/dev/", 5) != 0) {
 		unsigned maj, min;
--- diff/init/do_mounts_rd.c	2003-10-27 09:20:44.000000000 +0000
+++ source/init/do_mounts_rd.c	2004-02-09 10:39:57.000000000 +0000
@@ -4,6 +4,7 @@
 #include <linux/minix_fs.h>
 #include <linux/ext2_fs.h>
 #include <linux/romfs_fs.h>
+#include <linux/cramfs_fs.h>
 #include <linux/initrd.h>
 #include <linux/string.h>
 
@@ -41,6 +42,7 @@
  * 	minix
  * 	ext2
  *	romfs
+ *	cramfs
  * 	gzip
  */
 static int __init 
@@ -50,6 +52,7 @@
 	struct minix_super_block *minixsb;
 	struct ext2_super_block *ext2sb;
 	struct romfs_super_block *romfsb;
+	struct cramfs_super *cramfsb;
 	int nblocks = -1;
 	unsigned char *buf;
 
@@ -60,6 +63,7 @@
 	minixsb = (struct minix_super_block *) buf;
 	ext2sb = (struct ext2_super_block *) buf;
 	romfsb = (struct romfs_super_block *) buf;
+	cramfsb = (struct cramfs_super *) buf;
 	memset(buf, 0xe5, size);
 
 	/*
@@ -89,6 +93,14 @@
 		goto done;
 	}
 
+	if (cramfsb->magic == CRAMFS_MAGIC) {
+		printk(KERN_NOTICE
+		       "RAMDISK: cramfs filesystem found at block %d\n",
+		       start_block);
+		nblocks = (cramfsb->size + BLOCK_SIZE - 1) >> BLOCK_SIZE_BITS;
+		goto done;
+	}
+
 	/*
 	 * Read block 1 to test for minix and ext2 superblock
 	 */
--- diff/init/main.c	2004-02-09 10:36:12.000000000 +0000
+++ source/init/main.c	2004-02-09 10:39:57.000000000 +0000
@@ -289,6 +289,15 @@
 }
 __setup("init=", init_setup);
 
+static char *kinit_command;
+
+static int __init kinit_setup(char *str)
+{
+	kinit_command = str;
+	return 1;
+}
+__setup("kinit=", kinit_setup);
+
 extern void setup_arch(char **);
 extern void cpu_idle(void);
 
@@ -339,21 +348,21 @@
 /* Called by boot processor to activate the rest. */
 static void __init smp_init(void)
 {
-	unsigned int i, j=0;
+	unsigned int i;
+	unsigned j = 0;
 
 	/* FIXME: This should be done in userspace --RR */
 	for (i = 0; i < NR_CPUS; i++) {
 		if (num_online_cpus() >= max_cpus)
 			break;
 		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", j);
+	printk("Brought up %u CPUs\n", j);
 	smp_cpus_done(max_cpus);
 #if 0
 	/* Get other processors into their bootup holding patterns. */
@@ -370,9 +379,11 @@
  * between the root thread and the init thread may cause start_kernel to
  * be reaped by free_initmem before the root thread has proceeded to
  * cpu_idle.
+ *
+ * gcc-3.4 accidentally inlines this function, so use noinline.
  */
 
-static void rest_init(void)
+static void noinline rest_init(void)
 {
 	kernel_thread(init, NULL, CLONE_FS | CLONE_SIGHAND);
 	unlock_kernel();
@@ -405,12 +416,12 @@
 
 	build_all_zonelists();
 	page_alloc_init();
+	trap_init();
 	printk("Kernel command line: %s\n", saved_command_line);
 	parse_args("Booting kernel", command_line, __start___param,
 		   __stop___param - __start___param,
 		   &unknown_bootoption);
 	sort_main_extable();
-	trap_init();
 	rcu_init();
 	init_IRQ();
 	pidhash_init();
@@ -519,6 +530,7 @@
 	flush_scheduled_work();
 }
 
+asmlinkage long sys_access(const char __user * filename, int mode);
 /*
  * Ok, the machine is now initialized. None of the devices
  * have been touched yet, but the CPU subsystem is up and
@@ -549,7 +561,6 @@
 
 	migration_init();
 #endif
-	node_nr_running_init();
 	spawn_ksoftirqd();
 }
 
@@ -580,8 +591,16 @@
 	do_pre_smp_initcalls();
 
 	smp_init();
+	sched_init_smp();
 	do_basic_setup();
 
+	/*
+	 * check if there is an early userspace init, if yes
+	 * let it do all the work
+	 */
+	if (kinit_command || sys_access("/sbin/init", 0) == 0)
+		execute_command = kinit_command ? kinit_command : 0;
+	else
 	prepare_namespace();
 
 	/*
--- diff/kernel/Makefile	2003-10-09 09:47:34.000000000 +0100
+++ source/kernel/Makefile	2004-02-09 10:39:57.000000000 +0000
@@ -6,17 +6,19 @@
 	    exit.o itimer.o time.o softirq.o resource.o \
 	    sysctl.o capability.o ptrace.o timer.o user.o \
 	    signal.o sys.o kmod.o workqueue.o pid.o \
-	    rcupdate.o intermodule.o extable.o params.o posix-timers.o
+	    rcupdate.o intermodule.o extable.o params.o posix-timers.o \
+	    kthread.o
 
 obj-$(CONFIG_FUTEX) += futex.o
 obj-$(CONFIG_GENERIC_ISA_DMA) += dma.o
 obj-$(CONFIG_SMP) += cpu.o
+obj-$(CONFIG_LOCKMETER) += lockmeter.o
 obj-$(CONFIG_UID16) += uid16.o
 obj-$(CONFIG_MODULES) += module.o
 obj-$(CONFIG_KALLSYMS) += kallsyms.o
 obj-$(CONFIG_PM) += power/
 obj-$(CONFIG_BSD_PROCESS_ACCT) += acct.o
-obj-$(CONFIG_COMPAT) += compat.o
+obj-$(CONFIG_COMPAT) += compat.o compat_signal.o
 obj-$(CONFIG_IKCONFIG) += configs.o
 obj-$(CONFIG_IKCONFIG_PROC) += configs.o
 
--- diff/kernel/cpu.c	2004-02-09 10:36:12.000000000 +0000
+++ source/kernel/cpu.c	2004-02-09 10:39:57.000000000 +0000
@@ -1,14 +1,17 @@
 /* CPU control.
- * (C) 2001 Rusty Russell
+ * (C) 2001, 2002, 2003, 2004 Rusty Russell
+ *
  * This code is licenced under the GPL.
  */
 #include <linux/proc_fs.h>
 #include <linux/smp.h>
 #include <linux/init.h>
-#include <linux/notifier.h>
 #include <linux/sched.h>
 #include <linux/unistd.h>
+#include <linux/kmod.h>		/* for hotplug_path */
 #include <linux/cpu.h>
+#include <linux/module.h>
+#include <linux/notifier.h>
 #include <asm/semaphore.h>
 
 /* This protects CPUs going up and down... */
@@ -19,13 +22,149 @@
 /* Need to know about CPUs going up/down? */
 int register_cpu_notifier(struct notifier_block *nb)
 {
-	return notifier_chain_register(&cpu_chain, nb);
+	int ret;
+
+	if ((ret = down_interruptible(&cpucontrol)) != 0)
+		return ret;
+	ret = notifier_chain_register(&cpu_chain, nb);
+	up(&cpucontrol);
+	return ret;
 }
+EXPORT_SYMBOL(register_cpu_notifier);
 
 void unregister_cpu_notifier(struct notifier_block *nb)
 {
-	notifier_chain_unregister(&cpu_chain,nb);
+	down(&cpucontrol);
+	notifier_chain_unregister(&cpu_chain, nb);
+	up(&cpucontrol);
+}
+EXPORT_SYMBOL(unregister_cpu_notifier);
+
+#ifdef CONFIG_HOTPLUG_CPU
+static inline void check_for_tasks(int cpu)
+{
+	struct task_struct *p;
+
+	write_lock_irq(&tasklist_lock);
+	for_each_process(p) {
+		if (task_cpu(p) == cpu)
+			printk(KERN_WARNING "Task %s is on cpu %d, "
+				"not dying\n", p->comm, cpu);
+	}
+	write_unlock_irq(&tasklist_lock);
+}
+
+/* Notify userspace when a cpu event occurs, by running '/sbin/hotplug
+ * cpu' with certain environment variables set.  */
+static int cpu_run_sbin_hotplug(unsigned int cpu, const char *action)
+{
+	char *argv[3], *envp[5], cpu_str[12], action_str[32];
+	int i;
+
+	sprintf(cpu_str, "CPU=%d", cpu);
+	sprintf(action_str, "ACTION=%s", action);
+	/* FIXME: Add DEVPATH. --RR */
+
+	i = 0;
+	argv[i++] = hotplug_path;
+	argv[i++] = "cpu";
+	argv[i] = NULL;
+
+	i = 0;
+	/* minimal command environment */
+	envp [i++] = "HOME=/";
+	envp [i++] = "PATH=/sbin:/bin:/usr/sbin:/usr/bin";
+	envp [i++] = cpu_str;
+	envp [i++] = action_str;
+	envp [i] = NULL;
+
+	return call_usermodehelper(argv[0], argv, envp, 0);
+}
+
+static inline int cpu_down_check(unsigned int cpu, cpumask_t mask)
+{
+	if (!cpu_online(cpu))
+		return -EINVAL;
+
+	cpu_clear(cpu, mask);
+	if (any_online_cpu(mask) == NR_CPUS)
+		return -EBUSY;
+
+	return 0;
+}
+
+static inline int cpu_disable(int cpu)
+{
+	int ret;
+
+	ret = __cpu_disable();
+	if (ret < 0)
+		return ret;
+
+	/* Everyone looking at cpu_online() should be doing so with
+	 * preemption disabled. */
+	synchronize_kernel();
+	BUG_ON(cpu_online(cpu));
+	return 0;
+}
+
+int cpu_down(unsigned int cpu)
+{
+	int err, rc;
+	void *vcpu = (void *)(long)cpu;
+	cpumask_t oldmask, mask;
+
+	if ((err = down_interruptible(&cpucontrol)) != 0)
+		return err;
+
+	/* There has to be another cpu for this task. */
+	oldmask = current->cpus_allowed;
+	if ((err = cpu_down_check(cpu, oldmask)) != 0)
+		goto out;
+
+	/* Schedule ourselves on the dying CPU. */
+	set_cpus_allowed(current, cpumask_of_cpu(cpu));
+
+	if ((err = cpu_disable(cpu)) != 0)
+		goto out_allowed;
+
+	/* Move other tasks off to other CPUs (simple since they are
+           not running now). */
+	migrate_all_tasks();
+
+	/* Move off dying CPU, which will revert to idle process. */
+	cpus_clear(mask);
+	cpus_complement(mask);
+	cpu_clear(cpu, mask);
+	set_cpus_allowed(current, mask);
+
+	/* Tell kernel threads to go away: they can't fail here. */
+	rc = notifier_call_chain(&cpu_chain, CPU_OFFLINE, vcpu);
+	BUG_ON(rc == NOTIFY_BAD);
+
+	check_for_tasks(cpu);
+
+	/* This actually kills the CPU. */
+	__cpu_die(cpu);
+
+	/* CPU is completely dead: tell everyone.  Too late to complain. */
+	rc = notifier_call_chain(&cpu_chain, CPU_DEAD, vcpu);
+	BUG_ON(rc == NOTIFY_BAD);
+
+	cpu_run_sbin_hotplug(cpu, "offline");
+
+ out_allowed:
+	set_cpus_allowed(current, oldmask);
+ out:
+	up(&cpucontrol);
+	return err;
+}
+#else
+static inline int cpu_run_sbin_hotplug(unsigned int cpu, const char *action)
+{
+	return 0;
 }
+#endif /*CONFIG_HOTPLUG_CPU*/
 
 int __devinit cpu_up(unsigned int cpu)
 {
@@ -55,7 +194,6 @@
 		BUG();
 
 	/* Now call notifier in preparation. */
-	printk("CPU %u IS NOW UP!\n", cpu);
 	notifier_call_chain(&cpu_chain, CPU_ONLINE, hcpu);
 
 out_notify:
--- diff/kernel/exit.c	2004-02-09 10:36:12.000000000 +0000
+++ source/kernel/exit.c	2004-02-09 10:39:57.000000000 +0000
@@ -794,6 +794,7 @@
 	/* Avoid "noreturn function does return".  */
 	for (;;) ;
 }
+EXPORT_SYMBOL(do_exit);
 
 NORET_TYPE void complete_and_exit(struct completion *comp, long code)
 {
--- diff/kernel/fork.c	2004-02-09 10:36:12.000000000 +0000
+++ source/kernel/fork.c	2004-02-09 10:39:57.000000000 +0000
@@ -86,6 +86,7 @@
 
 	security_task_free(tsk);
 	free_uid(tsk->user);
+	put_group_info(tsk->group_info);
 	free_task(tsk);
 }
 
@@ -416,7 +417,7 @@
  * is dropped: either by a lazy thread or by
  * mmput. Free the page directory and the mm.
  */
-inline void __mmdrop(struct mm_struct *mm)
+void __mmdrop(struct mm_struct *mm)
 {
 	BUG_ON(mm == &init_mm);
 	mm_free_pgd(mm);
@@ -878,6 +879,7 @@
 
 	atomic_inc(&p->user->__count);
 	atomic_inc(&p->user->processes);
+	get_group_info(p->group_info);
 
 	/*
 	 * If multiple threads are within copy_process(), then this check
@@ -1084,6 +1086,7 @@
 bad_fork_cleanup_put_domain:
 	module_put(p->thread_info->exec_domain->module);
 bad_fork_cleanup_count:
+	put_group_info(p->group_info);
 	atomic_dec(&p->user->processes);
 	free_uid(p->user);
 bad_fork_free:
--- diff/kernel/futex.c	2004-02-09 10:36:12.000000000 +0000
+++ source/kernel/futex.c	2004-02-09 10:39:57.000000000 +0000
@@ -430,11 +430,10 @@
 			spin_unlock(lock_ptr);
 			goto retry;
 		}
-		if (likely(!list_empty(&q->list))) {
-			list_del(&q->list);
-			ret = 1;
-		}
+		WARN_ON(list_empty(&q->list));
+		list_del(&q->list);
 		spin_unlock(lock_ptr);
+		ret = 1;
 	}
 
 	drop_key_refs(&q->key);
--- diff/kernel/kmod.c	2004-01-19 10:22:59.000000000 +0000
+++ source/kernel/kmod.c	2004-02-09 10:39:57.000000000 +0000
@@ -34,6 +34,7 @@
 #include <linux/security.h>
 #include <linux/mount.h>
 #include <linux/kernel.h>
+#include <linux/cpu.h>
 #include <asm/uaccess.h>
 
 extern int max_threads;
@@ -158,6 +159,7 @@
 static int ____call_usermodehelper(void *data)
 {
 	struct subprocess_info *sub_info = data;
+	static cpumask_t all_cpus = CPU_MASK_ALL;
 	int retval;
 
 	/* Unblock all signals. */
@@ -168,6 +170,14 @@
 	recalc_sigpending();
 	spin_unlock_irq(&current->sighand->siglock);
 
+	/* We can run anywhere, unlike our parent keventd(). */
+	set_cpus_allowed(current, all_cpus);
+	/* As a kernel thread which was bound to a specific cpu,
+	   migrate_all_tasks wouldn't touch us.  Avoid running child
+	   on dying CPU. */
+	if (cpu_is_offline(smp_processor_id()))
+		migrate_to_cpu(any_online_cpu(all_cpus));
+
 	retval = -EPERM;
 	if (current->fs->root)
 		retval = execve(sub_info->path, sub_info->argv,sub_info->envp);
--- diff/kernel/module.c	2004-02-09 10:36:12.000000000 +0000
+++ source/kernel/module.c	2004-02-09 10:39:57.000000000 +0000
@@ -32,6 +32,7 @@
 #include <linux/err.h>
 #include <linux/vermagic.h>
 #include <linux/notifier.h>
+#include <linux/kthread.h>
 #include <asm/uaccess.h>
 #include <asm/semaphore.h>
 #include <asm/pgalloc.h>
@@ -457,6 +458,40 @@
 	}
 }
 
+#ifdef CONFIG_MODULE_FORCE_UNLOAD
+static inline int try_force(unsigned int flags)
+{
+	int ret = (flags & O_TRUNC);
+	if (ret)
+		tainted |= TAINT_FORCED_MODULE;
+	return ret;
+}
+#else
+static inline int try_force(unsigned int flags)
+{
+	return 0;
+}
+#endif /* CONFIG_MODULE_FORCE_UNLOAD */
+
+static int try_stop_module_local(struct module *mod, int flags, int *forced)
+{
+	local_irq_disable();
+
+	/* If it's not unused, quit unless we are told to block. */
+	if ((flags & O_NONBLOCK) && module_refcount(mod) != 0) {
+		if (!(*forced = try_force(flags))) {
+			local_irq_enable();
+			return -EWOULDBLOCK;
+		}
+	}
+
+	/* Mark it as dying. */
+	mod->waiter = current;
+	mod->state = MODULE_STATE_GOING;
+	local_irq_enable();
+	return 0;
+}
+
 #ifdef CONFIG_SMP
 /* Thread to stop each CPU in user context. */
 enum stopref_state {
@@ -475,13 +510,6 @@
 	int irqs_disabled = 0;
 	int prepared = 0;
 
-	sprintf(current->comm, "kmodule%lu\n", (unsigned long)cpu);
-
-	/* Highest priority we can manage, and move to right CPU. */
-#if 0 /* FIXME */
-	struct sched_param param = { .sched_priority = MAX_RT_PRIO-1 };
-	setscheduler(current->pid, SCHED_FIFO, &param);
-#endif
 	set_cpus_allowed(current, cpumask_of_cpu((int)(long)cpu));
 
 	/* Ack: we are alive */
@@ -535,29 +563,33 @@
 	}
 }
 
-/* Stop the machine.  Disables irqs. */
-static int stop_refcounts(void)
+struct stopref
+{
+	struct module *mod;
+	int flags;
+	int *forced;
+	struct completion started;
+};
+
+static int spawn_stopref(void *data)
 {
-	unsigned int i, cpu;
-	cpumask_t old_allowed;
+	struct stopref *sref = data;
+	struct sched_param param = { .sched_priority = MAX_RT_PRIO-1 };
+	unsigned int i, cpu = smp_processor_id();
 	int ret = 0;
 
-	/* One thread per cpu.  We'll do our own. */
-	cpu = smp_processor_id();
+	complete(&sref->started);
 
-	/* FIXME: racy with set_cpus_allowed. */
-	old_allowed = current->cpus_allowed;
+	/* One high-prio thread per cpu.  We'll do one (any one). */
 	set_cpus_allowed(current, cpumask_of_cpu(cpu));
+	sys_sched_setscheduler(current->pid, SCHED_FIFO, &param);
 
 	atomic_set(&stopref_thread_ack, 0);
 	stopref_num_threads = 0;
 	stopref_state = STOPREF_WAIT;
 
-	/* No CPUs can come up or down during this. */
-	down(&cpucontrol);
-
-	for (i = 0; i < NR_CPUS; i++) {
-		if (i == cpu || !cpu_online(i))
+	for_each_online_cpu(i) {
+		if (i == cpu)
 			continue;
 		ret = kernel_thread(stopref, (void *)(long)i, CLONE_KERNEL);
 		if (ret < 0)
@@ -572,40 +604,57 @@
 	/* If some failed, kill them all. */
 	if (ret < 0) {
 		stopref_set_state(STOPREF_EXIT, 1);
-		up(&cpucontrol);
-		return ret;
+		goto out;
 	}
 
 	/* Don't schedule us away at this point, please. */
 	preempt_disable();
 
-	/* Now they are all scheduled, make them hold the CPUs, ready. */
+	/* Now they are all started, make them hold the CPUs, ready. */
 	stopref_set_state(STOPREF_PREPARE, 0);
 
 	/* Make them disable irqs. */
 	stopref_set_state(STOPREF_DISABLE_IRQ, 0);
 
-	local_irq_disable();
-	return 0;
-}
+	/* Atomically disable module if possible */
+	ret = try_stop_module_local(sref->mod, sref->flags, sref->forced);
 
-/* Restart the machine.  Re-enables irqs. */
-static void restart_refcounts(void)
-{
 	stopref_set_state(STOPREF_EXIT, 0);
-	local_irq_enable();
 	preempt_enable();
-	up(&cpucontrol);
+
+out:
+	/* Wait for kthread_stop */
+	while (!signal_pending(current)) {
+		__set_current_state(TASK_INTERRUPTIBLE);
+		schedule();
+	}
+	return ret;
 }
-#else /* ...!SMP */
-static inline int stop_refcounts(void)
+
+static int try_stop_module(struct module *mod, int flags, int *forced)
 {
-	local_irq_disable();
-	return 0;
+	struct task_struct *p;
+	struct stopref sref = { mod, flags, forced };
+	int ret;
+
+	init_completion(&sref.started);
+
+	/* No CPUs can come up or down during this. */
+	lock_cpu_hotplug();
+	p = kthread_run(spawn_stopref, &sref, "krmmod");
+	if (IS_ERR(p))
+		ret = PTR_ERR(p);
+	else {
+		wait_for_completion(&sref.started);
+		ret = kthread_stop(p);
+	}
+	unlock_cpu_hotplug();
+	return ret;
 }
-static inline void restart_refcounts(void)
+#else /* ...!SMP */
+static inline int try_stop_module(struct module *mod, int flags, int *forced)
 {
-	local_irq_enable();
+	return try_stop_module_local(mod, flags, forced);
 }
 #endif
 
@@ -622,21 +671,6 @@
 /* This exists whether we can unload or not */
 static void free_module(struct module *mod);
 
-#ifdef CONFIG_MODULE_FORCE_UNLOAD
-static inline int try_force(unsigned int flags)
-{
-	int ret = (flags & O_TRUNC);
-	if (ret)
-		tainted |= TAINT_FORCED_MODULE;
-	return ret;
-}
-#else
-static inline int try_force(unsigned int flags)
-{
-	return 0;
-}
-#endif /* CONFIG_MODULE_FORCE_UNLOAD */
-
 /* Stub function for modules which don't have an exitfn */
 void cleanup_module(void)
 {
@@ -706,26 +740,9 @@
 			goto out;
 		}
 	}
-	/* Stop the machine so refcounts can't move: irqs disabled. */
-	DEBUGP("Stopping refcounts...\n");
-	ret = stop_refcounts();
-	if (ret != 0)
-		goto out;
-
-	/* If it's not unused, quit unless we are told to block. */
-	if ((flags & O_NONBLOCK) && module_refcount(mod) != 0) {
-		forced = try_force(flags);
-		if (!forced) {
-			ret = -EWOULDBLOCK;
-			restart_refcounts();
-			goto out;
-		}
-	}
 
-	/* Mark it as dying. */
-	mod->waiter = current;
-	mod->state = MODULE_STATE_GOING;
-	restart_refcounts();
+	/* Stop the machine so refcounts can't move and disable module. */
+	ret = try_stop_module(mod, flags, &forced);
 
 	/* Never wait if forced. */
 	if (!forced && module_refcount(mod) != 0)
--- diff/kernel/pid.c	2003-10-27 09:20:39.000000000 +0000
+++ source/kernel/pid.c	2004-02-09 10:39:57.000000000 +0000
@@ -122,6 +122,8 @@
 	}
 	
 	if (!offset || !atomic_read(&map->nr_free)) {
+		if (!offset)
+			map--;
 next_map:
 		map = next_free_map(map, &max_steps);
 		if (!map)
@@ -268,6 +270,9 @@
  * machine.  From a minimum of 16 slots up to 4096 slots at one gigabyte or
  * more.
  */
+#ifdef CONFIG_KGDB
+int kgdb_pid_init_done; /* so we don't call prior to... */
+#endif
 void __init pidhash_init(void)
 {
 	int i, j, pidhash_size;
@@ -289,6 +294,9 @@
 		for (j = 0; j < pidhash_size; j++)
 			INIT_LIST_HEAD(&pid_hash[i][j]);
 	}
+#ifdef CONFIG_KGDB
+	kgdb_pid_init_done++;
+#endif
 }
 
 void __init pidmap_init(void)
--- diff/kernel/posix-timers.c	2004-02-09 10:36:12.000000000 +0000
+++ source/kernel/posix-timers.c	2004-02-09 10:39:57.000000000 +0000
@@ -2,8 +2,26 @@
  * linux/kernel/posix_timers.c
  *
  *
- * 2002-10-15  Posix Clocks & timers by George Anzinger
- *			     Copyright (C) 2002 by MontaVista Software.
+ * 2002-10-15  Posix Clocks & timers
+ *                           by George Anzinger george@mvista.com
+ *
+ *			     Copyright (C) 2002 2003 by MontaVista Software.
+ *
+ * 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.
+ *
+ * MontaVista Software | 1237 East Arques Avenue | Sunnyvale | CA 94085 | USA
  */
 
 /* These are all the functions necessary to implement
@@ -33,7 +51,7 @@
 		       result; })
 
 #endif
-#define CLOCK_REALTIME_RES TICK_NSEC  // In nano seconds.
+#define CLOCK_REALTIME_RES TICK_NSEC  /* In nano seconds. */
 
 static inline u64  mpy_l_X_l_ll(unsigned long mpy1,unsigned long mpy2)
 {
@@ -82,17 +100,15 @@
 # define timer_active(tmr) BARFY	// error to use outside of SMP
 # define set_timer_inactive(tmr) do { } while (0)
 #endif
-
 /*
- * For some reason mips/mips64 define the SIGEV constants plus 128.
- * Here we define a mask to get rid of the common bits.	 The
- * optimizer should make this costless to all but mips.
- * Note that no common bits (the non-mips case) will give 0xffffffff.
- */
-#define MIPS_SIGEV ~(SIGEV_NONE & \
-		      SIGEV_SIGNAL & \
-		      SIGEV_THREAD &  \
-		      SIGEV_THREAD_ID)
+ * we assume that the new SIGEV_THREAD_ID shares no bits with the other
+ * SIGEV values.  Here we put out an error if this assumption fails.
+ */
+#if SIGEV_THREAD_ID != (SIGEV_THREAD_ID & \
+                       ~(SIGEV_SIGNAL | SIGEV_NONE | SIGEV_THREAD))
+#error "SIGEV_THREAD_ID must not share bit with other SIGEV values!"
+#endif
+
 
 #define REQUEUE_PENDING 1
 /*
@@ -301,7 +317,7 @@
 	if (timr->it_incr)
 		timr->sigq->info.si_sys_private = ++timr->it_requeue_pending;
 
-	if (timr->it_sigev_notify & SIGEV_THREAD_ID & MIPS_SIGEV)
+	if (timr->it_sigev_notify & SIGEV_THREAD_ID )
 		ret = send_sigqueue(timr->it_sigev_signo, timr->sigq,
 			timr->it_process);
 	else
@@ -338,14 +354,14 @@
 {
 	struct task_struct *rtn = current;
 
-	if ((event->sigev_notify & SIGEV_THREAD_ID & MIPS_SIGEV) &&
+	if ((event->sigev_notify & SIGEV_THREAD_ID ) &&
 		(!(rtn = find_task_by_pid(event->sigev_notify_thread_id)) ||
-			rtn->tgid != current->tgid))
+		 rtn->tgid != current->tgid ||
+		 (event->sigev_notify & ~SIGEV_THREAD_ID) != SIGEV_SIGNAL))
 		return NULL;
 
-	if ((event->sigev_notify & ~SIGEV_NONE & MIPS_SIGEV) &&
-			event->sigev_signo &&
-			((unsigned) (event->sigev_signo > SIGRTMAX)))
+	if (((event->sigev_notify & ~SIGEV_THREAD_ID) != SIGEV_NONE) &&
+	    ((event->sigev_signo <= 0) || (event->sigev_signo > SIGRTMAX)))
 		return NULL;
 
 	return rtn;
@@ -365,6 +381,8 @@
 {
 	struct k_itimer *tmr;
 	tmr = kmem_cache_alloc(posix_timers_cache, GFP_KERNEL);
+	if (!tmr)
+		return tmr;
 	memset(tmr, 0, sizeof (struct k_itimer));
 	tmr->it_id = (timer_t)-1;
 	if (unlikely(!(tmr->sigq = sigqueue_alloc()))) {
@@ -586,14 +604,18 @@
 
 	posix_get_now(&now);
 
-	if (expires && (timr->it_sigev_notify & SIGEV_NONE) && !timr->it_incr &&
-			posix_time_before(&timr->it_timer, &now))
+	if (expires &&
+	    ((timr->it_sigev_notify & ~SIGEV_THREAD_ID) == SIGEV_NONE) &&
+	    !timr->it_incr &&
+	    posix_time_before(&timr->it_timer, &now))
 		timr->it_timer.expires = expires = 0;
 	if (expires) {
 		if (timr->it_requeue_pending & REQUEUE_PENDING ||
-		    (timr->it_sigev_notify & SIGEV_NONE))
+		    (timr->it_sigev_notify & ~SIGEV_THREAD_ID) == SIGEV_NONE) {
 			while (posix_time_before(&timr->it_timer, &now))
 				posix_bump_timer(timr);
+			expires = timr->it_timer.expires;
+		}
 		else
 			if (!timer_pending(&timr->it_timer))
 				expires = 0;
@@ -804,7 +826,7 @@
 	 * equal to jiffies, so the timer notify function is called directly.
 	 * We do not even queue SIGEV_NONE timers!
 	 */
-	if (!(timr->it_sigev_notify & SIGEV_NONE)) {
+	if (((timr->it_sigev_notify & ~SIGEV_THREAD_ID) != SIGEV_NONE)) {
 		if (timr->it_timer.expires == jiffies)
 			timer_notify_task(timr);
 		else
@@ -967,9 +989,6 @@
  * if we are interrupted since we don't take lock that will stall us or
  * any other cpu. Voila, no irq lock is needed.
  *
- * Note also that the while loop assures that the sub_jiff_offset
- * will be less than a jiffie, thus no need to normalize the result.
- * Well, not really, if called with ints off :(
  */
 
 static u64 do_posix_clock_monotonic_gettime_parts(
--- diff/kernel/power/console.c	2003-09-30 15:46:21.000000000 +0100
+++ source/kernel/power/console.c	2004-02-09 10:39:57.000000000 +0000
@@ -6,6 +6,7 @@
 
 #include <linux/vt_kern.h>
 #include <linux/kbd_kern.h>
+#include <linux/console.h>
 #include "power.h"
 
 static int new_loglevel = 10;
@@ -18,14 +19,20 @@
 	console_loglevel = new_loglevel;
 
 #ifdef SUSPEND_CONSOLE
+	acquire_console_sem();
+
 	orig_fgconsole = fg_console;
 
-	if (vc_allocate(SUSPEND_CONSOLE))
+	if (vc_allocate(SUSPEND_CONSOLE)) {
 	  /* we can't have a free VC for now. Too bad,
 	   * we don't want to mess the screen for now. */
+		release_console_sem();
 		return 1;
+	}
 
 	set_console(SUSPEND_CONSOLE);
+	release_console_sem();
+
 	if (vt_waitactive(SUSPEND_CONSOLE)) {
 		pr_debug("Suspend: Can't switch VCs.");
 		return 1;
@@ -40,12 +47,9 @@
 {
 	console_loglevel = orig_loglevel;
 #ifdef SUSPEND_CONSOLE
+	acquire_console_sem();
 	set_console(orig_fgconsole);
-
-	/* FIXME: 
-	 * This following part is left over from swsusp. Is it really needed?
-	 */
-	update_screen(fg_console);
+	release_console_sem();
 #endif
 	return;
 }
--- diff/kernel/power/pmdisk.c	2004-02-09 10:36:12.000000000 +0000
+++ source/kernel/power/pmdisk.c	2004-02-09 10:39:57.000000000 +0000
@@ -628,7 +628,7 @@
 	if ((error = read_swapfiles()))
 		return error;
 
-	drain_local_pages();
+	drain_local_pages(smp_processor_id());
 
 	pm_pagedir_nosave = NULL;
 	pr_debug("pmdisk: Counting pages to copy.\n" );
@@ -659,7 +659,7 @@
 	/* During allocating of suspend pagedir, new cold pages may appear. 
 	 * Kill them 
 	 */
-	drain_local_pages();
+	drain_local_pages(smp_processor_id());
 
 	/* copy */
 	copy_pages();
--- diff/kernel/power/swsusp.c	2004-01-19 10:22:59.000000000 +0000
+++ source/kernel/power/swsusp.c	2004-02-09 10:39:57.000000000 +0000
@@ -59,6 +59,7 @@
 #include <linux/buffer_head.h>
 #include <linux/swapops.h>
 #include <linux/bootmem.h>
+#include <linux/console.h>
 
 #include <asm/uaccess.h>
 #include <asm/mmu_context.h>
@@ -283,8 +284,8 @@
  *    would happen on next reboot -- corrupting data.
  *
  *    Note: The buffer we allocate to use to write the suspend header is
- *    not freed; its not needed since system is going down anyway
- *    (plus it causes oops and I'm lazy^H^H^H^Htoo busy).
+ *    not freed; its not needed since the system is going down anyway
+ *    (plus it causes an oops and I'm lazy^H^H^H^Htoo busy).
  */
 static int write_suspend_image(void)
 {
@@ -340,6 +341,7 @@
 	printk("H");
 	BUG_ON (sizeof(struct suspend_header) > PAGE_SIZE-sizeof(swp_entry_t));
 	BUG_ON (sizeof(union diskpage) != PAGE_SIZE);
+	BUG_ON (sizeof(struct link) != PAGE_SIZE);
 	if (!(entry = get_swap_page()).val)
 		panic( "\nNot enough swapspace when writing header" );
 	if (swapfile_used[swp_type(entry)] != SWAPFILE_SUSPEND)
@@ -488,39 +490,12 @@
 	printk("|\n");
 }
 
-/* Make disk drivers accept operations, again */
-static void drivers_unsuspend(void)
-{
-	device_resume();
-}
-
-/* Called from process context */
-static int drivers_suspend(void)
-{
-	return device_suspend(4);
-}
-
-#define RESUME_PHASE1 1 /* Called from interrupts disabled */
-#define RESUME_PHASE2 2 /* Called with interrupts enabled */
-#define RESUME_ALL_PHASES (RESUME_PHASE1 | RESUME_PHASE2)
-static void drivers_resume(int flags)
-{
-	if (flags & RESUME_PHASE1) {
-		device_resume();
-	}
-  	if (flags & RESUME_PHASE2) {
-#ifdef SUSPEND_CONSOLE
-		update_screen(fg_console);	/* Hmm, is this the problem? */
-#endif
-	}
-}
-
 static int suspend_prepare_image(void)
 {
 	struct sysinfo i;
 	unsigned int nr_needed_pages = 0;
 
-	drain_local_pages();
+	drain_local_pages(smp_processor_id());
 
 	pagedir_nosave = NULL;
 	printk( "/critical section: Counting pages to copy" );
@@ -553,7 +528,7 @@
 	nr_copy_pages_check = nr_copy_pages;
 	pagedir_order_check = pagedir_order;
 
-	drain_local_pages();	/* During allocating of suspend pagedir, new cold pages may appear. Kill them */
+	drain_local_pages(smp_processor_id());	/* During allocating of suspend pagedir, new cold pages may appear. Kill them */
 	if (nr_copy_pages != count_and_copy_data_pages(pagedir_nosave))	/* copy */
 		BUG();
 
@@ -569,7 +544,7 @@
 
 static void suspend_save_image(void)
 {
-	drivers_unsuspend();
+	device_resume();
 
 	lock_swapdevices();
 	write_suspend_image();
@@ -615,6 +590,7 @@
 	mb();
 	spin_lock_irq(&suspend_pagedir_lock);	/* Done to disable interrupts */ 
 
+	device_power_down(4);
 	PRINTK( "Waiting for DMAs to settle down...\n");
 	mdelay(1000);	/* We do not want some readahead with DMA to corrupt our memory, right?
 			   Do it with disabled interrupts for best effect. That way, if some
@@ -630,8 +606,13 @@
 
 	PRINTK( "Freeing prev allocated pagedir\n" );
 	free_suspend_pagedir((unsigned long) pagedir_save);
+	device_power_up();
 	spin_unlock_irq(&suspend_pagedir_lock);
-	drivers_resume(RESUME_ALL_PHASES);
+	device_resume();
+
+	acquire_console_sem();
+	update_screen(fg_console);	/* Hmm, is this the problem? */
+	release_console_sem();
 
 	PRINTK( "Fixing swap signatures... " );
 	mark_swapfiles(((swp_entry_t) {0}), MARK_SWAP_RESUME);
@@ -672,7 +653,9 @@
 {
 	int is_problem;
 	read_swapfiles();
+	device_power_down(4);
 	is_problem = suspend_prepare_image();
+	device_power_up();
 	spin_unlock_irq(&suspend_pagedir_lock);
 	if (!is_problem) {
 		kernel_fpu_end();	/* save_processor_state() does kernel_fpu_begin, and we need to revert it in order to pass in_atomic() checks */
@@ -694,11 +677,22 @@
 	mark_swapfiles(((swp_entry_t) {0}), MARK_SWAP_RESUME);
 }
 
-static void do_software_suspend(void)
+/*
+ * This is main interface to the outside world. It needs to be
+ * called from process context.
+ */
+int software_suspend(void)
 {
+	int res;
+	if (!software_suspend_enabled)
+		return -EAGAIN;
+
+	software_suspend_enabled = 0;
+	might_sleep();
+
 	if (arch_prepare_suspend()) {
 		printk("%sArchitecture failed to prepare\n", name_suspend);
-		return;
+		return -EPERM;
 	}		
 	if (pm_prepare_console())
 		printk( "%sCan't allocate a console... proceeding\n", name_suspend);
@@ -716,7 +710,7 @@
 		blk_run_queues();
 
 		/* Save state of all device drivers, and stop them. */		   
-		if(drivers_suspend()==0)
+		if ((res = device_suspend(4))==0)
 			/* If stopping device drivers worked, we proceed basically into
 			 * suspend_save_image.
 			 *
@@ -728,24 +722,12 @@
 			 */
 			do_magic(0);
 		thaw_processes();
-	}
+	} else
+		res = -EBUSY;
 	software_suspend_enabled = 1;
 	MDELAY(1000);
 	pm_restore_console();
-}
-
-/*
- * This is main interface to the outside world. It needs to be
- * called from process context.
- */
-void software_suspend(void)
-{
-	if(!software_suspend_enabled)
-		return;
-
-	software_suspend_enabled = 0;
-	might_sleep();
-	do_software_suspend();
+	return res;
 }
 
 /* More restore stuff */
@@ -856,23 +838,23 @@
 
 static int sanity_check_failed(char *reason)
 {
-	printk(KERN_ERR "%s%s\n",name_resume,reason);
+	printk(KERN_ERR "%s%s\n", name_resume, reason);
 	return -EPERM;
 }
 
 static int sanity_check(struct suspend_header *sh)
 {
-	if(sh->version_code != LINUX_VERSION_CODE)
+	if (sh->version_code != LINUX_VERSION_CODE)
 		return sanity_check_failed("Incorrect kernel version");
-	if(sh->num_physpages != num_physpages)
+	if (sh->num_physpages != num_physpages)
 		return sanity_check_failed("Incorrect memory size");
-	if(strncmp(sh->machine, system_utsname.machine, 8))
+	if (strncmp(sh->machine, system_utsname.machine, 8))
 		return sanity_check_failed("Incorrect machine type");
-	if(strncmp(sh->version, system_utsname.version, 20))
+	if (strncmp(sh->version, system_utsname.version, 20))
 		return sanity_check_failed("Incorrect version");
-	if(sh->num_cpus != num_online_cpus())
+	if (sh->num_cpus != num_online_cpus())
 		return sanity_check_failed("Incorrect number of cpus");
-	if(sh->page_size != PAGE_SIZE)
+	if (sh->page_size != PAGE_SIZE)
 		return sanity_check_failed("Incorrect PAGE_SIZE");
 	return 0;
 }
@@ -915,7 +897,7 @@
 
 extern dev_t __init name_to_dev_t(const char *line);
 
-static int __read_suspend_image(struct block_device *bdev, union diskpage *cur, int noresume)
+static int __init __read_suspend_image(struct block_device *bdev, union diskpage *cur, int noresume)
 {
 	swp_entry_t next;
 	int i, nr_pgdir_pages;
@@ -1091,6 +1073,7 @@
 	printk( "resuming from %s\n", resume_file);
 	if (read_suspend_image(resume_file, 0))
 		goto read_failure;
+	device_suspend(4);
 	do_magic(1);
 	panic("This never returns");
 
--- diff/kernel/printk.c	2004-02-09 10:36:12.000000000 +0000
+++ source/kernel/printk.c	2004-02-09 10:39:57.000000000 +0000
@@ -62,6 +62,15 @@
  */
 static DECLARE_MUTEX(console_sem);
 struct console *console_drivers;
+/*
+ * This is used for debugging the mess that is the VT code by
+ * keeping track if we have the console semaphore held. It's
+ * definitely not the perfect debug tool (we don't know if _WE_
+ * hold it are racing, but it helps tracking those weird code
+ * path in the console code where we end up in places I want
+ * locked without the console sempahore held
+ */
+static int console_locked;
 
 /*
  * logbuf_lock protects log_buf, log_start, log_end, con_start and logged_chars
@@ -492,7 +501,7 @@
 
 	/* Emit the output into the temporary buffer */
 	va_start(args, fmt);
-	printed_len = vsnprintf(printk_buf, sizeof(printk_buf), fmt, args);
+	printed_len = vscnprintf(printk_buf, sizeof(printk_buf), fmt, args);
 	va_end(args);
 
 	/*
@@ -524,6 +533,7 @@
 		goto out;
 	}
 	if (!down_trylock(&console_sem)) {
+		console_locked = 1;
 		/*
 		 * We own the drivers.  We can drop the spinlock and let
 		 * release_console_sem() print the text
@@ -557,10 +567,17 @@
 	if (in_interrupt())
 		BUG();
 	down(&console_sem);
+	console_locked = 1;
 	console_may_schedule = 1;
 }
 EXPORT_SYMBOL(acquire_console_sem);
 
+int is_console_locked(void)
+{
+	return console_locked;
+}
+EXPORT_SYMBOL(is_console_locked);
+
 /**
  * release_console_sem - unlock the console system
  *
@@ -592,12 +609,14 @@
 		spin_unlock_irqrestore(&logbuf_lock, flags);
 		call_console_drivers(_con_start, _log_end);
 	}
+	console_locked = 0;
 	console_may_schedule = 0;
 	up(&console_sem);
 	spin_unlock_irqrestore(&logbuf_lock, flags);
 	if (wake_klogd && !oops_in_progress && waitqueue_active(&log_wait))
 		wake_up_interruptible(&log_wait);
 }
+EXPORT_SYMBOL(release_console_sem);
 
 /** console_conditional_schedule - yield the CPU if required
  *
@@ -633,6 +652,7 @@
 	 */
 	if (down_trylock(&console_sem) != 0)
 		return;
+	console_locked = 1;
 	console_may_schedule = 0;
 	for (c = console_drivers; c != NULL; c = c->next)
 		if ((c->flags & CON_ENABLED) && c->unblank)
@@ -764,12 +784,6 @@
 	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.
  *
@@ -777,7 +791,7 @@
  * every printk_ratelimit_jiffies to make a denial-of-service
  * attack impossible.
  */
-int printk_ratelimit(void)
+int __printk_ratelimit(int ratelimit_jiffies, int ratelimit_burst)
 {
 	static spinlock_t ratelimit_lock = SPIN_LOCK_UNLOCKED;
 	static unsigned long toks = 10*5*HZ;
@@ -789,12 +803,12 @@
 	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) {
+	if (toks > (ratelimit_burst * ratelimit_jiffies))
+		toks = ratelimit_burst * ratelimit_jiffies;
+	if (toks >= ratelimit_jiffies) {
 		int lost = missed;
 		missed = 0;
-		toks -= printk_ratelimit_jiffies;
+		toks -= ratelimit_jiffies;
 		spin_unlock_irqrestore(&ratelimit_lock, flags);
 		if (lost)
 			printk(KERN_WARNING "printk: %d messages suppressed.\n", lost);
@@ -804,4 +818,17 @@
 	spin_unlock_irqrestore(&ratelimit_lock, flags);
 	return 0;
 }
+EXPORT_SYMBOL(__printk_ratelimit);
+
+/* minimum time in jiffies between messages */
+int printk_ratelimit_jiffies = 5*HZ;
+
+/* number of messages we send before ratelimiting */
+int printk_ratelimit_burst = 10;
+
+int printk_ratelimit(void)
+{
+	return __printk_ratelimit(printk_ratelimit_jiffies,
+				printk_ratelimit_burst);
+}
 EXPORT_SYMBOL(printk_ratelimit);
--- diff/kernel/rcupdate.c	2003-10-09 09:47:34.000000000 +0100
+++ source/kernel/rcupdate.c	2004-02-09 10:39:57.000000000 +0000
@@ -110,7 +110,7 @@
 	    !cpus_empty(rcu_ctrlblk.rcu_cpu_mask)) {
 		return;
 	}
-	rcu_ctrlblk.rcu_cpu_mask = cpu_online_map;
+	rcu_ctrlblk.rcu_cpu_mask = cpu_active_map;
 }
 
 /*
@@ -154,6 +154,60 @@
 }
 
 
+#ifdef CONFIG_HOTPLUG_CPU
+
+/* warning! helper for rcu_offline_cpu. do not use elsewhere without reviewing
+ * locking requirements, the list it's pulling from has to belong to a cpu
+ * which is dead and hence not processing interrupts.
+ */
+static void rcu_move_batch(struct list_head *list)
+{
+	struct list_head *entry;
+	int cpu = smp_processor_id();
+
+	local_irq_disable();
+	while (!list_empty(list)) {
+		entry = list->next;
+		list_del(entry);
+		list_add_tail(entry, &RCU_nxtlist(cpu));
+	}
+	local_irq_enable();
+}
+
+static void rcu_offline_cpu(int cpu)
+{
+	/* if the cpu going offline owns the grace period
+	 * we can block indefinitely waiting for it, so flush
+	 * it here
+	 */
+	spin_lock_irq(&rcu_ctrlblk.mutex);
+	if (!rcu_ctrlblk.rcu_cpu_mask)
+		goto unlock;
+
+	cpu_clear(cpu, rcu_ctrlblk.rcu_cpu_mask);
+	if (cpus_empty(rcu_ctrlblk.rcu_cpu_mask)) {
+		rcu_ctrlblk.curbatch++;
+		/* We may avoid calling start batch if
+		 * we are starting the batch only
+		 * because of the DEAD CPU (the current
+		 * CPU will start a new batch anyway for
+		 * the callbacks we will move to current CPU).
+		 * However, we will avoid this optimisation
+		 * for now.
+		 */
+		rcu_start_batch(rcu_ctrlblk.maxbatch);
+	}
+unlock:
+	spin_unlock_irq(&rcu_ctrlblk.mutex);
+
+	rcu_move_batch(&RCU_curlist(cpu));
+	rcu_move_batch(&RCU_nxtlist(cpu));
+
+	tasklet_kill_immediate(&RCU_tasklet(cpu), cpu);
+}
+
+#endif
+
 /*
  * This does the RCU processing work from tasklet context. 
  */
@@ -214,7 +268,11 @@
 	case CPU_UP_PREPARE:
 		rcu_online_cpu(cpu);
 		break;
-	/* Space reserved for CPU_OFFLINE :) */
+#ifdef CONFIG_HOTPLUG_CPU
+	case CPU_DEAD:
+		rcu_offline_cpu(cpu);
+		break;
+#endif
 	default:
 		break;
 	}
--- diff/kernel/sched.c	2004-02-09 10:36:12.000000000 +0000
+++ source/kernel/sched.c	2004-02-09 10:39:57.000000000 +0000
@@ -37,6 +37,7 @@
 #include <linux/rcupdate.h>
 #include <linux/cpu.h>
 #include <linux/percpu.h>
+#include <linux/kthread.h>
 
 #ifdef CONFIG_NUMA
 #define cpu_to_node_mask(cpu) node_to_cpumask(cpu_to_node(cpu))
@@ -89,7 +90,6 @@
 #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))
-#define NODE_THRESHOLD		125
 #define CREDIT_LIMIT		100
 
 /*
@@ -185,11 +185,14 @@
 typedef struct runqueue runqueue_t;
 
 struct prio_array {
-	int nr_active;
+	unsigned int nr_active;
 	unsigned long bitmap[BITMAP_SIZE];
 	struct list_head queue[MAX_PRIO];
 };
 
+#define SCHED_LOAD_SHIFT 7	/* increase resolution of load calculations */
+#define SCHED_LOAD_SCALE (1 << SCHED_LOAD_SHIFT)
+
 /*
  * This is the main, per-CPU runqueue data structure.
  *
@@ -200,23 +203,33 @@
 struct runqueue {
 	spinlock_t lock;
 	unsigned long nr_running, nr_switches, expired_timestamp,
-		      nr_uninterruptible, timestamp_last_tick;
+		      nr_uninterruptible;
+	unsigned long long timestamp_last_tick;
 	task_t *curr, *idle;
 	struct mm_struct *prev_mm;
 	prio_array_t *active, *expired, arrays[2];
-	int best_expired_prio, prev_cpu_load[NR_CPUS];
-#ifdef CONFIG_NUMA
-	atomic_t *node_nr_running;
-	int prev_node_load[MAX_NUMNODES];
+	int best_expired_prio;
+
+	atomic_t nr_iowait;
+
+#ifdef CONFIG_SMP
+	unsigned long cpu_load[NR_CPUS];
 #endif
+	/* For active balancing */
+	int active_balance;
+	int push_cpu;
+
 	task_t *migration_thread;
 	struct list_head migration_queue;
-
-	atomic_t nr_iowait;
 };
 
 static DEFINE_PER_CPU(struct runqueue, runqueues);
 
+#ifdef CONFIG_SMP
+/* Mandatory scheduling domains */
+DEFINE_PER_CPU(struct sched_domain, base_domains);
+#endif
+
 #define cpu_rq(cpu)		(&per_cpu(runqueues, (cpu)))
 #define this_rq()		(&__get_cpu_var(runqueues))
 #define task_rq(p)		cpu_rq(task_cpu(p))
@@ -231,51 +244,16 @@
 # define task_running(rq, p)		((rq)->curr == (p))
 #endif
 
-#ifdef CONFIG_NUMA
-
-/*
- * Keep track of running tasks.
- */
-
-static atomic_t node_nr_running[MAX_NUMNODES] ____cacheline_maxaligned_in_smp =
-	{[0 ...MAX_NUMNODES-1] = ATOMIC_INIT(0)};
-
-static inline void nr_running_init(struct runqueue *rq)
-{
-	rq->node_nr_running = &node_nr_running[0];
-}
-
 static inline void nr_running_inc(runqueue_t *rq)
 {
-	atomic_inc(rq->node_nr_running);
 	rq->nr_running++;
 }
 
 static inline void nr_running_dec(runqueue_t *rq)
 {
-	atomic_dec(rq->node_nr_running);
 	rq->nr_running--;
 }
 
-__init void node_nr_running_init(void)
-{
-	int i;
-
-	for (i = 0; i < NR_CPUS; i++) {
-		if (cpu_possible(i))
-			cpu_rq(i)->node_nr_running =
-				&node_nr_running[cpu_to_node(i)];
-	}
-}
-
-#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)
-
-#endif /* CONFIG_NUMA */
-
 /*
  * task_rq_lock - lock the runqueue a given task resides on and disable
  * interrupts.  Note the ordering: we can safely lookup the task_rq without
@@ -530,6 +508,12 @@
 #endif
 }
 
+/* Wake up a CPU from idle */
+void wake_idle_cpu(unsigned int cpu)
+{
+	resched_task(cpu_rq(cpu)->idle);
+}
+
 /**
  * task_curr - is this task currently executing on a CPU?
  * @p: the task in question.
@@ -543,37 +527,30 @@
 typedef struct {
 	struct list_head list;
 	task_t *task;
+	int dest_cpu;
 	struct completion done;
 } migration_req_t;
 
 /*
- * The task's runqueue lock must be held, and the new mask must be valid.
+ * The task's runqueue lock must be held.
  * 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)
+static int migrate_task(task_t *p, int dest_cpu, 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));
+		set_task_cpu(p, dest_cpu);
 		return 0;
 	}
 
 	init_completion(&req->done);
 	req->task = p;
+	req->dest_cpu = dest_cpu;
 	list_add(&req->list, &rq->migration_queue);
 	return 1;
 }
@@ -634,9 +611,79 @@
 }
 
 EXPORT_SYMBOL_GPL(kick_process);
+/*
+ * Return a low guess at the load of cpu. Update previous history if update
+ * is true
+ */
+static inline unsigned long get_low_cpu_load(int cpu, int update)
+{
+	runqueue_t *rq = cpu_rq(cpu);
+	runqueue_t *this_rq = this_rq();
+	unsigned long nr = rq->nr_running << SCHED_LOAD_SHIFT;
+	unsigned long load = this_rq->cpu_load[cpu];
+	unsigned long ret = min(nr, load);
+
+	if (update)
+		this_rq->cpu_load[cpu] = (nr + load) / 2;
+
+	return ret;
+}
+
+static inline unsigned long get_high_cpu_load(int cpu, int update)
+{
+	runqueue_t *rq = cpu_rq(cpu);
+	runqueue_t *this_rq = this_rq();
+	unsigned long nr = rq->nr_running << SCHED_LOAD_SHIFT;
+	unsigned long load = this_rq->cpu_load[cpu];
+	unsigned long ret = max(nr, load);
+
+	if (update)
+		this_rq->cpu_load[cpu] = (nr + load) / 2;
+
+	return ret;
+}
 
 #endif
 
+/*
+ * sched_balance_wake can be used with SMT architectures to wake a
+ * task onto an idle sibling if cpu is not idle. Returns cpu if
+ * cpu is idle or no siblings are idle, otherwise returns an idle
+ * sibling.
+ */
+#if defined(CONFIG_SMP) && defined(ARCH_HAS_SCHED_WAKE_BALANCE)
+static int sched_balance_wake(int cpu, task_t *p)
+{
+	struct sched_domain *domain;
+	int i;
+
+	if (idle_cpu(cpu))
+		return cpu;
+
+	domain = cpu_sched_domain(cpu);
+	if (!(domain->flags & SD_FLAG_WAKE))
+		return cpu;
+
+	for_each_cpu_mask(i, domain->span) {
+		if (!cpu_online(i))
+			continue;
+
+		if (!cpu_isset(i, p->cpus_allowed))
+			continue;
+
+		if (idle_cpu(i))
+			return i;
+	}
+
+	return cpu;
+}
+#else
+static inline int sched_balance_wake(int cpu, task_t *p)
+{
+	return cpu;
+}
+#endif
+
 /***
  * try_to_wake_up - wake up a thread
  * @p: the to-be-woken-up thread
@@ -657,44 +704,109 @@
 	int success = 0;
 	long old_state;
 	runqueue_t *rq;
+	int cpu, this_cpu;
+#ifdef CONFIG_SMP
+	unsigned long long now;
+	unsigned long load, this_load;
+	int new_cpu;
+	struct sched_domain *sd;
+	runqueue_t *this_rq;
+#endif
 
-repeat_lock_task:
 	rq = task_rq_lock(p, &flags);
 	old_state = p->state;
-	if (old_state & state) {
-		if (!p->array) {
-			/*
-			 * Fast-migrate the task if it's not running or runnable
-			 * currently. Do not violate hard affinity.
-			 */
-			if (unlikely(sync && !task_running(rq, p) &&
-				(task_cpu(p) != smp_processor_id()) &&
-					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) {
-				rq->nr_uninterruptible--;
-				/*
-				 * Tasks on involuntary sleep don't earn
-				 * sleep_avg beyond just interactive state.
-				 */
-				p->activated = -1;
-			}
-			if (sync && (task_cpu(p) == smp_processor_id()))
-				__activate_task(p, rq);
-			else {
-				activate_task(p, rq);
-				if (TASK_PREEMPTS_CURR(p, rq))
-					resched_task(rq->curr);
-			}
-			success = 1;
+	if (!(old_state & state))
+		goto out;
+
+	if (p->array)
+		goto out_running;
+
+	this_cpu = smp_processor_id();
+	cpu = task_cpu(p);
+
+#ifdef CONFIG_SMP
+	if (cpu == this_cpu)
+		goto out_activate;
+
+	if (unlikely(!cpu_isset(this_cpu, p->cpus_allowed)
+		     || task_running(rq, p)
+		     || cpu_is_offline(this_cpu)))
+		goto out_activate;
+
+	/* Passive load balancing */
+	load = get_low_cpu_load(cpu, 1);
+	this_load = get_high_cpu_load(this_cpu, 1);
+	if (load > this_load) {
+		new_cpu = sched_balance_wake(this_cpu, p);
+		set_task_cpu(p, new_cpu);
+		goto repeat_lock_task;
+	}
+
+	this_rq = this_rq();
+	now = sched_clock();
+	sd = cpu_sched_domain(this_cpu);
+
+	/*
+	 * Fast-migrate the task if it's not running or
+	 * runnable currently. Do not violate hard affinity.
+	 */
+	do {
+		if (!(sd->flags & SD_FLAG_FASTMIGRATE))
+			break;
+		if (now - p->timestamp < sd->cache_hot_time)
+			break;
+
+		if (cpu_isset(cpu, sd->span)) {
+			new_cpu = sched_balance_wake(this_cpu, p);
+			set_task_cpu(p, new_cpu);
+			goto repeat_lock_task;
 		}
-		p->state = TASK_RUNNING;
+		sd = sd->parent;
+	} while (sd);
+
+	new_cpu = sched_balance_wake(cpu, p);
+	if (new_cpu != cpu) {
+		set_task_cpu(p, new_cpu);
+		goto repeat_lock_task;
+	}
+	goto out_activate;
+
+repeat_lock_task:
+	task_rq_unlock(rq, &flags);
+	rq = task_rq_lock(p, &flags);
+	old_state = p->state;
+	if (!(old_state & state))
+		goto out;
+
+	if (p->array)
+		goto out_running;
+
+	this_cpu = smp_processor_id();
+	cpu = task_cpu(p);
+
+out_activate:
+#endif /* CONFIG_SMP */
+	if (old_state == TASK_UNINTERRUPTIBLE) {
+		rq->nr_uninterruptible--;
+		/*
+		 * Tasks on involuntary sleep don't earn
+		 * sleep_avg beyond just interactive state.
+		 */
+		p->activated = -1;
+	}
+
+	if (sync && cpu == this_cpu) {
+		__activate_task(p, rq);
+	} else {
+		activate_task(p, rq);
+		if (TASK_PREEMPTS_CURR(p, rq))
+			resched_task(rq->curr);
 	}
+	success = 1;
+
+out_running:
+	p->state = TASK_RUNNING;
+out:
 	task_rq_unlock(rq, &flags);
 
 	return success;
@@ -728,7 +840,7 @@
 	INIT_LIST_HEAD(&p->run_list);
 	p->array = NULL;
 	spin_lock_init(&p->switch_lock);
-#ifdef CONFIG_PREEMPT
+#if defined(CONFIG_PREEMPT) || defined(CONFIG_DEBUG_SPINLOCK_SLEEP)
 	/*
 	 * During context-switch we hold precisely one spinlock, which
 	 * schedule_tail drops. (in the common case it's this_rq()->lock,
@@ -753,8 +865,8 @@
 	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
+		 * 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;
@@ -819,6 +931,7 @@
 void sched_exit(task_t * p)
 {
 	unsigned long flags;
+	runqueue_t *rq;
 
 	local_irq_save(flags);
 	if (p->first_time_slice) {
@@ -831,10 +944,12 @@
 	 * If the child was a (relative-) CPU hog then decrease
 	 * the sleep_avg of the parent as well.
 	 */
+	rq = task_rq_lock(p->parent, &flags);
 	if (p->sleep_avg < p->parent->sleep_avg)
 		p->parent->sleep_avg = p->parent->sleep_avg /
 		(EXIT_WEIGHT + 1) * EXIT_WEIGHT + p->sleep_avg /
 		(EXIT_WEIGHT + 1);
+	task_rq_unlock(rq, &flags);
 }
 
 /**
@@ -867,7 +982,7 @@
 	 * still held, otherwise prev could be scheduled on another cpu, die
 	 * there before we look at prev->state, and then the reference would
 	 * be dropped twice.
-	 * 		Manfred Spraul <manfred@colorfullife.com>
+	 *		Manfred Spraul <manfred@colorfullife.com>
 	 */
 	prev_task_flags = prev->flags;
 	finish_arch_switch(rq, prev);
@@ -929,7 +1044,7 @@
 {
 	unsigned long i, sum = 0;
 
-	for (i = 0; i < NR_CPUS; i++)
+	for_each_cpu(i)
 		sum += cpu_rq(i)->nr_running;
 
 	return sum;
@@ -999,258 +1114,118 @@
 		spin_unlock(&rq2->lock);
 }
 
-#ifdef CONFIG_NUMA
-/*
- * If dest_cpu is allowed for this process, migrate the task to it.
- * This is accomplished by forcing the cpu_allowed mask to only
- * allow dest_cpu, which will force the cpu onto dest_cpu.  Then
- * the cpu_allowed mask is restored.
- */
-static void sched_migrate_task(task_t *p, int dest_cpu)
+enum idle_type
+{
+	IDLE,
+	NOT_IDLE,
+	NEWLY_IDLE,
+};
+
+#ifdef CONFIG_SMP
+
+#if defined(CONFIG_NUMA) || defined(CONFIG_HOTPLUG_CPU)
+/* If dest_cpu is allowed for this process, migrate us to it. */
+void migrate_to_cpu(int dest_cpu)
 {
 	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) || !cpu_online(dest_cpu))
+	rq = task_rq_lock(current, &flags);
+	if (!cpu_isset(dest_cpu, current->cpus_allowed))
 		goto out;
 
 	/* force the process onto the specified CPU */
-	if (__set_cpus_allowed(p, new_mask, &req)) {
+	if (migrate_task(current, dest_cpu, &req)) {
 		/* Need to wait for migration thread. */
 		task_rq_unlock(rq, &flags);
 		wake_up_process(rq->migration_thread);
 		wait_for_completion(&req.done);
-
-		/* 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));
-		}
+		return;
 	}
 out:
 	task_rq_unlock(rq, &flags);
 }
+#endif /* CONFIG_NUMA || CONFIG_HOTPLUG_CPU */
 
+#ifdef CONFIG_NUMA
 /*
  * Find the least loaded CPU.  Slightly favor the current CPU by
  * setting its runqueue length as the minimum to start.
  */
-static int sched_best_cpu(struct task_struct *p)
+static int sched_best_cpu(struct task_struct *p, struct sched_domain *domain)
 {
-	int i, minload, load, best_cpu, node = 0;
-	cpumask_t cpumask;
+	int i, min_load, this_cpu, best_cpu;
 
-	best_cpu = task_cpu(p);
-	if (cpu_rq(best_cpu)->nr_running <= 2)
-		return best_cpu;
+	best_cpu = this_cpu = task_cpu(p);
+	min_load = INT_MAX;
 
-	minload = 10000000;
-	for_each_node_with_cpus(i) {
-		/*
-		 * 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.
-		 */
-		load = 10 * atomic_read(&node_nr_running[i]) / nr_cpus_node(i);
-		if (load < minload) {
-			minload = load;
-			node = i;
-		}
-	}
-
-	minload = 10000000;
-	cpumask = node_to_cpumask(node);
-	for (i = 0; i < NR_CPUS; ++i) {
-		if (!cpu_isset(i, cpumask))
+	for_each_online_cpu(i) {
+		unsigned long load;
+		if (!cpu_isset(i, domain->span))
 			continue;
-		if (cpu_rq(i)->nr_running < minload) {
+
+		if (i == this_cpu)
+			load = get_low_cpu_load(i, 0);
+		else
+			load = get_high_cpu_load(i, 0) + SCHED_LOAD_SCALE;
+
+		if (min_load > load) {
 			best_cpu = i;
-			minload = cpu_rq(i)->nr_running;
+			min_load = load;
 		}
+
 	}
 	return best_cpu;
 }
 
 void sched_balance_exec(void)
 {
+	struct sched_domain *domain = this_sched_domain();
 	int new_cpu;
+	int this_cpu = smp_processor_id();
+	if (numnodes == 1)
+		return;
 
-	if (numnodes > 1) {
-		new_cpu = sched_best_cpu(current);
-		if (new_cpu != smp_processor_id())
-			sched_migrate_task(current, new_cpu);
-	}
-}
+	while (domain->parent && !(domain->flags & SD_FLAG_EXEC))
+		domain = domain->parent;
 
-/*
- * Find the busiest node. All previous node loads contribute with a
- * geometrically deccaying weight to the load measure:
- *      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
- * provide better resolution.
- */
-static int find_busiest_node(int this_node)
-{
-	int i, node = -1, load, this_load, maxload;
-
-	if (!nr_cpus_node(this_node))
-		return node;
-	this_load = maxload = (this_rq()->prev_node_load[this_node] >> 1)
-		+ (10 * atomic_read(&node_nr_running[this_node])
-		/ nr_cpus_node(this_node));
-	this_rq()->prev_node_load[this_node] = this_load;
-	for_each_node_with_cpus(i) {
-		if (i == this_node)
-			continue;
-		load = (this_rq()->prev_node_load[i] >> 1)
-			+ (10 * atomic_read(&node_nr_running[i])
-			/ nr_cpus_node(i));
-		this_rq()->prev_node_load[i] = load;
-		if (load > maxload && (100*load > NODE_THRESHOLD*this_load)) {
-			maxload = load;
-			node = i;
-		}
+	if (domain->flags & SD_FLAG_EXEC) {
+		new_cpu = sched_best_cpu(current, domain);
+		if (new_cpu != this_cpu)
+			migrate_to_cpu(new_cpu);
 	}
-	return node;
 }
-
 #endif /* CONFIG_NUMA */
 
-#ifdef CONFIG_SMP
-
 /*
- * double_lock_balance - lock the busiest runqueue
- *
- * this_rq is locked already. Recalculate nr_running if we have to
- * drop the runqueue lock.
+ * double_lock_balance - lock the busiest runqueue, this_rq is locked already.
  */
-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 void double_lock_balance(runqueue_t *this_rq, runqueue_t *busiest)
 {
 	if (unlikely(!spin_trylock(&busiest->lock))) {
 		if (busiest < this_rq) {
 			spin_unlock(&this_rq->lock);
 			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]))
-				nr_running = this_rq->nr_running;
-			else
-				nr_running = this_rq->prev_cpu_load[this_cpu];
 		} else
 			spin_lock(&busiest->lock);
 	}
-	return nr_running;
-}
-
-/*
- * 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)
-{
-	int nr_running, load, max_load, i;
-	runqueue_t *busiest, *rq_src;
-
-	/*
-	 * We search all runqueues to find the most busy one.
-	 * We do this lockless to reduce cache-bouncing overhead,
-	 * we re-check the 'best' source CPU later on again, with
-	 * the lock held.
-	 *
-	 * We fend off statistical fluctuations in runqueue lengths by
-	 * saving the runqueue length (as seen by the balancing CPU) during
-	 * the previous load-balancing operation and using the smaller one
-	 * of the current and saved lengths. If a runqueue is long enough
-	 * for a longer amount of time then we recognize it and pull tasks
-	 * from it.
-	 *
-	 * The 'current runqueue length' is a statistical maximum variable,
-	 * for that one we take the longer one - to avoid fluctuations in
-	 * the other direction. So for a load-balance to happen it needs
-	 * stable long runqueue on the target CPU and stable short runqueue
-	 * on the local runqueue.
-	 *
-	 * We make an exception if this CPU is about to become idle - in
-	 * that case we are less picky about moving a task across CPUs and
-	 * take what can be taken.
-	 */
-	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];
-
-	busiest = NULL;
-	max_load = 1;
-	for (i = 0; i < NR_CPUS; i++) {
-		if (!cpu_isset(i, cpumask))
-			continue;
-
-		rq_src = cpu_rq(i);
-		if (idle || (rq_src->nr_running < this_rq->prev_cpu_load[i]))
-			load = rq_src->nr_running;
-		else
-			load = this_rq->prev_cpu_load[i];
-		this_rq->prev_cpu_load[i] = rq_src->nr_running;
-
-		if ((load > max_load) && (rq_src != this_rq)) {
-			busiest = rq_src;
-			max_load = load;
-		}
-	}
-
-	if (likely(!busiest))
-		goto out;
-
-	*imbalance = max_load - nr_running;
-
-	/* It needs an at least ~25% imbalance to trigger balancing. */
-	if (!idle && ((*imbalance)*4 < max_load)) {
-		busiest = NULL;
-		goto out;
-	}
-
-	nr_running = double_lock_balance(this_rq, busiest, this_cpu,
-					 idle, nr_running);
-	/*
-	 * Make sure nothing changed since we checked the
-	 * runqueue length.
-	 */
-	if (busiest->nr_running <= nr_running) {
-		spin_unlock(&busiest->lock);
-		busiest = NULL;
-	}
-out:
-	return busiest;
 }
 
 /*
  * 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, prio_array_t *this_array,
+		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);
+	enqueue_task(p, this_array);
 	p->timestamp = sched_clock() -
 				(src_rq->timestamp_last_tick - p->timestamp);
 	/*
@@ -1258,69 +1233,71 @@
 	 * to be always true for them.
 	 */
 	if (TASK_PREEMPTS_CURR(p, this_rq))
-		set_need_resched();
+		resched_task(this_rq->curr);
 }
 
 /*
  * 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)
+int can_migrate_task(task_t *p, runqueue_t *rq, int this_cpu,
+		struct sched_domain *domain, enum idle_type idle)
 {
-	unsigned long delta = rq->timestamp_last_tick - tsk->timestamp;
-
 	/*
 	 * 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))
+	if (task_running(rq, p))
 		return 0;
-	if (!idle && (delta <= JIFFIES_TO_NS(cache_decay_ticks)))
+	if (!cpu_isset(this_cpu, p->cpus_allowed))
 		return 0;
+
+	/* Aggressive migration if we've failed balancing */
+	if (idle == NEWLY_IDLE ||
+			domain->nr_balance_failed < domain->cache_nice_tries) {
+		if ((rq->timestamp_last_tick - p->timestamp)
+						< domain->cache_hot_time)
+			return 0;
+	}
+
 	return 1;
 }
 
 /*
- * Current runqueue is empty, or rebalance tick: if there is an
- * inbalance (current runqueue is too short) then pull from
- * busiest runqueue(s).
- *
- * We call this with the current runqueue locked,
- * irqs disabled.
- */
-static void load_balance(runqueue_t *this_rq, int idle, cpumask_t cpumask)
+ * move_tasks tries to move up to max_nr_move tasks from busiest to this_rq,
+ * as part of a balancing operation within "domain". Returns the number of
+ * tasks moved.
+ *
+ * Called with both runqueues locked.
+ */
+static int move_tasks(runqueue_t *this_rq, int this_cpu, runqueue_t *busiest,
+			unsigned long max_nr_move, struct sched_domain *domain,
+			enum idle_type idle)
 {
-	int imbalance, idx, this_cpu = smp_processor_id();
-	runqueue_t *busiest;
-	prio_array_t *array;
+	int idx;
+	int pulled = 0;
+	prio_array_t *array, *dst_array;
 	struct list_head *head, *curr;
 	task_t *tmp;
 
-	busiest = find_busiest_queue(this_rq, this_cpu, idle,
-				     &imbalance, cpumask);
-	if (!busiest)
+	if (max_nr_move <= 0 || busiest->nr_running <= 1)
 		goto out;
 
 	/*
-	 * We only want to steal a number of tasks equal to 1/2 the imbalance,
-	 * otherwise we'll just shift the imbalance to the new queue:
-	 */
-	imbalance /= 2;
-
-	/*
 	 * We first consider expired tasks. Those will likely not be
 	 * executed in the near future, and they are most likely to
 	 * be cache-cold, thus switching CPUs has the least effect
 	 * on them.
 	 */
-	if (busiest->expired->nr_active)
+	if (busiest->expired->nr_active) {
 		array = busiest->expired;
-	else
+		dst_array = this_rq->expired;
+	} else {
 		array = busiest->active;
+		dst_array = this_rq->active;
+	}
 
 new_array:
 	/* Start searching at priority 0: */
@@ -1333,9 +1310,10 @@
 	if (idx >= MAX_PRIO) {
 		if (array == busiest->expired) {
 			array = busiest->active;
+			dst_array = this_rq->active;
 			goto new_array;
 		}
-		goto out_unlock;
+		goto out;
 	}
 
 	head = array->queue + idx;
@@ -1345,100 +1323,432 @@
 
 	curr = curr->prev;
 
-	if (!can_migrate_task(tmp, busiest, this_cpu, idle)) {
+	if (!can_migrate_task(tmp, busiest, this_cpu, domain, idle)) {
 		if (curr != head)
 			goto skip_queue;
 		idx++;
 		goto skip_bitmap;
 	}
-	pull_task(busiest, array, tmp, this_rq, this_cpu);
+	pull_task(busiest, array, tmp, this_rq, dst_array, this_cpu);
+	pulled++;
 
-	/* Only migrate one task if we are idle */
-	if (!idle && --imbalance) {
+	/* We only want to steal up to the prescribed number of tasks. */
+	if (pulled < max_nr_move) {
 		if (curr != head)
 			goto skip_queue;
 		idx++;
 		goto skip_bitmap;
 	}
-out_unlock:
-	spin_unlock(&busiest->lock);
 out:
-	;
+	return pulled;
+}
+
+/*
+ * find_busiest_group finds and returns the busiest CPU group within the
+ * domain. It calculates and returns the number of tasks which should be
+ * moved to restore balance via the imbalance parameter.
+ */
+static struct sched_group *
+find_busiest_group(struct sched_domain *domain, int this_cpu,
+				unsigned long *imbalance, enum idle_type idle)
+{
+	unsigned long max_load, avg_load, total_load, this_load;
+	int modify, total_nr_cpus, busiest_nr_cpus = 0;
+	enum idle_type package_idle = IDLE;
+	struct sched_group *busiest = NULL, *group = domain->groups;
+
+	max_load = 0;
+	this_load = 0;
+	total_load = 0;
+	total_nr_cpus = 0;
+
+	if (group == NULL)
+		goto out_balanced;
+
+	/*
+	 * Don't modify when we newly become idle because that ruins our
+	 * statistics: its triggered by some value of nr_running (ie. 0).
+	 * Timer based balancing is a good statistic though.
+	 */
+	if (idle == NEWLY_IDLE)
+		modify = 0;
+	else
+		modify = 1;
+
+	do {
+		unsigned long load;
+		int local_group;
+		int i, nr_cpus = 0;
+
+		local_group = cpu_isset(this_cpu, group->cpumask);
+
+		/* Tally up the load of all CPUs in the group */
+		avg_load = 0;
+		for_each_cpu_mask(i, group->cpumask) {
+			if (!cpu_online(i))
+				continue;
+
+			/* Bias balancing toward cpus of our domain */
+			if (local_group) {
+				load = get_high_cpu_load(i, modify);
+				if (!idle_cpu(i))
+					package_idle = NOT_IDLE;
+			} else
+				load = get_low_cpu_load(i, modify);
+
+			nr_cpus++;
+			avg_load += load;
+		}
+
+		if (!nr_cpus)
+			goto nextgroup;
+
+		total_load += avg_load;
+		total_nr_cpus += nr_cpus;
+		avg_load /= nr_cpus;
+
+		if (local_group) {
+			this_load = avg_load;
+			goto nextgroup;
+		}
+
+		if (avg_load >= max_load) {
+			busiest = group;
+			max_load = avg_load;
+			busiest_nr_cpus = nr_cpus;
+		}
+nextgroup:
+		group = group->next;
+	} while (group != domain->groups);
+
+	if (!busiest)
+		goto out_balanced;
+
+	avg_load = total_load / total_nr_cpus;
+	if (idle == NOT_IDLE && this_load >= avg_load)
+		goto out_balanced;
+
+	if (idle == NOT_IDLE && 100*max_load <= domain->imbalance_pct*this_load)
+		goto out_balanced;
+
+	/*
+	 * We're trying to get all the cpus to the average_load, so we don't
+	 * want to push ourselves above the average load, nor do we wish to
+	 * reduce the max loaded cpu below the average load, as either of these
+	 * actions would just result in more rebalancing later, and ping-pong
+	 * tasks around. Thus we look for the minimum possible imbalance.
+	 */
+	*imbalance = min(max_load - avg_load, avg_load - this_load);
+
+	/* Get rid of the scaling factor now, rounding *up* as we divide */
+	*imbalance = (*imbalance + SCHED_LOAD_SCALE - 1) >> SCHED_LOAD_SHIFT;
+
+	if (*imbalance == 0) {
+		if (package_idle != NOT_IDLE && domain->flags & SD_FLAG_IDLE
+			&& max_load * busiest_nr_cpus > (3*SCHED_LOAD_SCALE/2))
+			*imbalance = 1;
+		else
+			busiest = NULL;
+	}
+
+	return busiest;
+
+out_balanced:
+	*imbalance = 0;
+	return NULL;
 }
 
 /*
- * One of the idle_cpu_tick() and busy_cpu_tick() functions will
- * get called every timer tick, on every CPU. Our balancing action
- * frequency and balancing agressivity depends on whether the CPU is
- * idle or not.
+ * find_busiest_queue - find the busiest runqueue among the cpus in group.
+ */
+static runqueue_t *find_busiest_queue(struct sched_group *group)
+{
+	int i;
+	unsigned long max_load = 0;
+	runqueue_t *busiest = NULL;
+
+	for_each_cpu_mask(i, group->cpumask) {
+		unsigned long load;
+
+		if (!cpu_online(i))
+			continue;
+
+		load = get_low_cpu_load(i, 0);
+
+		if (load >= max_load) {
+			max_load = load;
+			busiest = cpu_rq(i);
+		}
+	}
+
+	return busiest;
+}
+
+/*
+ * Check this_cpu to ensure it is balanced within domain. Attempt to move
+ * tasks if there is an imbalance.
  *
- * busy-rebalance every 200 msecs. idle-rebalance every 1 msec. (or on
- * systems with HZ=100, every 10 msecs.)
+ * Called with this_rq unlocked.
+ */
+static int load_balance(int this_cpu, runqueue_t *this_rq,
+			struct sched_domain *domain, enum idle_type idle)
+{
+	struct sched_group *group;
+	runqueue_t *busiest = NULL;
+	unsigned long imbalance;
+	int balanced = 0, failed = 0;
+	int nr_moved = 0;
+
+	spin_lock(&this_rq->lock);
+
+	group = find_busiest_group(domain, this_cpu, &imbalance, idle);
+	if (!group) {
+		balanced = 1;
+		goto out;
+	}
+
+	busiest = find_busiest_queue(group);
+	if (!busiest || busiest == this_rq) {
+		balanced = 1;
+		goto out;
+	}
+
+	/* Attempt to move tasks */
+	double_lock_balance(this_rq, busiest);
+
+	nr_moved = move_tasks(this_rq, this_cpu, busiest,
+					imbalance, domain, idle);
+	spin_unlock(&busiest->lock);
+out:
+	spin_unlock(&this_rq->lock);
+
+	if (!balanced && nr_moved == 0)
+		failed = 1;
+
+	if (domain->flags & SD_FLAG_IDLE && failed && busiest &&
+	   		domain->nr_balance_failed > domain->cache_nice_tries) {
+		int i;
+		for_each_cpu_mask(i, group->cpumask) {
+			int wake = 0;
+
+			if (!cpu_online(i))
+				continue;
+
+			busiest = cpu_rq(i);
+			spin_lock(&busiest->lock);
+			if (!busiest->active_balance) {
+				busiest->active_balance = 1;
+				busiest->push_cpu = this_cpu;
+				wake = 1;
+			}
+			spin_unlock(&busiest->lock);
+			if (wake)
+				wake_up_process(busiest->migration_thread);
+		}
+	}
+
+	if (failed)
+		domain->nr_balance_failed++;
+	else
+		domain->nr_balance_failed = 0;
+
+	if (balanced) {
+		if (domain->balance_interval < domain->max_interval)
+			domain->balance_interval *= 2;
+	} else {
+		domain->balance_interval = domain->min_interval;
+	}
+
+	return nr_moved;
+}
+
+/*
+ * Check this_cpu to ensure it is balanced within domain. Attempt to move
+ * tasks if there is an imbalance.
  *
- * On NUMA, do a node-rebalance every 400 msecs.
+ * Called from schedule when this_rq is about to become idle (NEWLY_IDLE).
+ * this_rq is locked.
  */
-#define IDLE_REBALANCE_TICK (HZ/1000 ?: 1)
-#define BUSY_REBALANCE_TICK (HZ/5 ?: 1)
-#define IDLE_NODE_REBALANCE_TICK (IDLE_REBALANCE_TICK * 5)
-#define BUSY_NODE_REBALANCE_TICK (BUSY_REBALANCE_TICK * 2)
+static int load_balance_newidle(int this_cpu, runqueue_t *this_rq,
+			struct sched_domain *domain)
+{
+	struct sched_group *group;
+	runqueue_t *busiest = NULL;
+	unsigned long imbalance;
+	int nr_moved = 0;
 
-#ifdef CONFIG_NUMA
-static void balance_node(runqueue_t *this_rq, int idle, int this_cpu)
+	group = find_busiest_group(domain, this_cpu, &imbalance, NEWLY_IDLE);
+	if (!group)
+		goto out;
+
+	busiest = find_busiest_queue(group);
+	if (!busiest || busiest == this_rq)
+		goto out;
+
+	/* Attempt to move tasks */
+	double_lock_balance(this_rq, busiest);
+
+	nr_moved = move_tasks(this_rq, this_cpu, busiest,
+					imbalance, domain, NEWLY_IDLE);
+
+	spin_unlock(&busiest->lock);
+
+out:
+	return nr_moved;
+}
+
+/*
+ * idle_balance is called by schedule() if this_cpu is about to become
+ * idle. Attempts to pull tasks from other CPUs.
+ */
+static inline void idle_balance(int this_cpu, runqueue_t *this_rq)
 {
-	int node = find_busiest_node(cpu_to_node(this_cpu));
+	struct sched_domain *domain = this_sched_domain();
 
-	if (node >= 0) {
-		cpumask_t cpumask = node_to_cpumask(node);
-		cpu_set(this_cpu, cpumask);
-		spin_lock(&this_rq->lock);
-		load_balance(this_rq, idle, cpumask);
-		spin_unlock(&this_rq->lock);
-	}
+	/* CPU going down is a special case: we don't pull more tasks here */
+	if (cpu_is_offline(this_cpu))
+		return;
+
+	do {
+		if (unlikely(!domain->groups))
+			/* hasn't been setup yet */
+			break;
+
+		if (domain->flags & SD_FLAG_NEWIDLE) {
+			if (load_balance_newidle(this_cpu, this_rq, domain)) {
+				/* We've pulled tasks over so stop searching */
+				break;
+			}
+		}
+
+		domain = domain->parent;
+	} while (domain);
 }
-#endif
 
-static void rebalance_tick(runqueue_t *this_rq, int idle)
+/*
+ * active_load_balance is run by migration threads. It pushes a running
+ * task off the cpu. It can be required to correctly have at least 1 task
+ * running on each physical CPU where possible, and not have a physical /
+ * logical imbalance.
+ *
+ * Called with busiest locked.
+ */
+static void active_load_balance(runqueue_t *busiest, int busiest_cpu)
 {
-#ifdef CONFIG_NUMA
-	int this_cpu = smp_processor_id();
-#endif
-	unsigned long j = jiffies;
+	int i;
+	struct sched_domain *sd = cpu_sched_domain(busiest_cpu);
+	struct sched_group *group, *busy_group;
 
-	/*
-	 * First do inter-node rebalancing, then intra-node rebalancing,
-	 * if both events happen in the same tick. The inter-node
-	 * rebalancing does not necessarily have to create a perfect
-	 * balance within the node, since we load-balance the most loaded
-	 * node with the current CPU. (ie. other CPUs in the local node
-	 * are not balanced.)
-	 */
-	if (idle) {
-#ifdef CONFIG_NUMA
-		if (!(j % IDLE_NODE_REBALANCE_TICK))
-			balance_node(this_rq, idle, this_cpu);
-#endif
-		if (!(j % IDLE_REBALANCE_TICK)) {
-			spin_lock(&this_rq->lock);
-			load_balance(this_rq, idle, cpu_to_node_mask(this_cpu));
-			spin_unlock(&this_rq->lock);
+	if (busiest->nr_running <= 1)
+		return;
+
+	/* sd->parent should never cause a NULL dereference, if it did so,
+ 	 * then push_cpu was set to a buggy value */
+	while (!cpu_isset(busiest->push_cpu, sd->span)) {
+ 		sd = sd->parent;
+		if (!sd->parent && !cpu_isset(busiest->push_cpu, sd->span)) {
+			WARN_ON(1);
+			return;
 		}
+	}
+
+	if (!sd->groups) {
+		WARN_ON(1);
 		return;
 	}
-#ifdef CONFIG_NUMA
-	if (!(j % BUSY_NODE_REBALANCE_TICK))
-		balance_node(this_rq, idle, this_cpu);
-#endif
-	if (!(j % BUSY_REBALANCE_TICK)) {
-		spin_lock(&this_rq->lock);
-		load_balance(this_rq, idle, cpu_to_node_mask(this_cpu));
-		spin_unlock(&this_rq->lock);
+
+ 	group = sd->groups;
+	while (!cpu_isset(busiest_cpu, group->cpumask)) {
+ 		group = group->next;
+		if (group == sd->groups) {
+			WARN_ON(1);
+			return;
+		}
 	}
+ 	busy_group = group;
+
+ 	group = sd->groups;
+ 	do {
+		runqueue_t *rq;
+ 		int push_cpu = 0, nr = 0;
+
+ 		if (group == busy_group)
+ 			goto next_group;
+
+ 		for_each_cpu_mask(i, group->cpumask) {
+			if (!cpu_online(i))
+				continue;
+
+			if (!idle_cpu(i))
+				goto next_group;
+ 			push_cpu = i;
+ 			nr++;
+ 		}
+ 		if (nr == 0)
+ 			goto next_group;
+
+		rq = cpu_rq(push_cpu);
+		double_lock_balance(busiest, rq);
+		move_tasks(rq, push_cpu, busiest, 1, sd, IDLE);
+		spin_unlock(&rq->lock);
+next_group:
+		group = group->next;
+	} while (group != sd->groups);
+}
+
+/*
+ * rebalance_tick will get called every timer tick, on every CPU.
+ *
+ * It checks each scheduling domain to see if it is due to be balanced,
+ * and initiates a balancing operation if so.
+ *
+ * Balancing parameters are set up in arch_init_sched_domains.
+ */
+
+/* Don't have all balancing operations going off at once */
+#define CPU_OFFSET(cpu) (HZ * cpu / NR_CPUS)
+
+static void rebalance_tick(int this_cpu, runqueue_t *this_rq, enum idle_type idle)
+{
+	unsigned long j = jiffies + CPU_OFFSET(this_cpu);
+	struct sched_domain *domain = this_sched_domain();
+
+	/* CPU going down is a special case: we don't pull more tasks here */
+	if (cpu_is_offline(this_cpu))
+		return;
+
+	/* Run through all this CPU's domains */
+	do {
+		unsigned long interval;
+
+		if (unlikely(!domain->groups))
+			break;
+
+		interval = domain->balance_interval;
+		if (idle != IDLE)
+			interval *= domain->busy_factor;
+
+		/* scale ms to jiffies */
+		interval = interval * HZ / 1000;
+		if (unlikely(interval == 0))
+			interval = 1;
+
+		if (j - domain->last_balance >= interval) {
+			if (load_balance(this_cpu, this_rq, domain, idle)) {
+				/* We've pulled tasks over so no longer idle */
+				idle = NOT_IDLE;
+			}
+			domain->last_balance += interval;
+		}
+
+		domain = domain->parent;
+	} while (domain);
 }
 #else
 /*
  * on UP we do not need to balance between CPUs:
  */
-static inline void rebalance_tick(runqueue_t *this_rq, int idle)
+static inline void rebalance_tick(int this_cpu, runqueue_t *this_rq, enum idle_type idle)
 {
 }
 #endif
@@ -1496,7 +1806,7 @@
 			cpustat->iowait += sys_ticks;
 		else
 			cpustat->idle += sys_ticks;
-		rebalance_tick(rq, 1);
+		rebalance_tick(cpu, rq, IDLE);
 		return;
 	}
 	if (TASK_NICE(p) > 0)
@@ -1580,7 +1890,7 @@
 out_unlock:
 	spin_unlock(&rq->lock);
 out:
-	rebalance_tick(rq, 0);
+	rebalance_tick(cpu, rq, NOT_IDLE);
 }
 
 void scheduling_functions_start_here(void) { }
@@ -1649,7 +1959,7 @@
 
 	if (unlikely(!rq->nr_running)) {
 #ifdef CONFIG_SMP
-		load_balance(rq, 1, cpu_to_node_mask(smp_processor_id()));
+		idle_balance(smp_processor_id(), rq);
 #endif
 		if (!rq->nr_running) {
 			next = rq->idle;
@@ -1903,10 +2213,21 @@
 	__remove_wait_queue(q, &wait);			\
 	spin_unlock_irqrestore(&q->lock, flags);
 
+#define SLEEP_ON_BKLCHECK				\
+	if (unlikely(!kernel_locked()) &&		\
+	    sleep_on_bkl_warnings < 10) {		\
+		sleep_on_bkl_warnings++;		\
+		WARN_ON(1);				\
+	}
+
+static int sleep_on_bkl_warnings;
+
 void interruptible_sleep_on(wait_queue_head_t *q)
 {
 	SLEEP_ON_VAR
 
+	SLEEP_ON_BKLCHECK
+
 	current->state = TASK_INTERRUPTIBLE;
 
 	SLEEP_ON_HEAD
@@ -1920,6 +2241,8 @@
 {
 	SLEEP_ON_VAR
 
+	SLEEP_ON_BKLCHECK
+
 	current->state = TASK_INTERRUPTIBLE;
 
 	SLEEP_ON_HEAD
@@ -1935,6 +2258,8 @@
 {
 	SLEEP_ON_VAR
 
+	SLEEP_ON_BKLCHECK
+
 	current->state = TASK_UNINTERRUPTIBLE;
 
 	SLEEP_ON_HEAD
@@ -2010,6 +2335,13 @@
 
 EXPORT_SYMBOL(set_user_nice);
 
+#if defined( CONFIG_KGDB)
+struct task_struct * kgdb_get_idle(int this_cpu)
+{
+        return cpu_rq(this_cpu)->idle;
+}
+#endif
+
 #ifndef __alpha__
 
 /*
@@ -2307,11 +2639,13 @@
 	if (copy_from_user(&new_mask, user_mask_ptr, sizeof(new_mask)))
 		return -EFAULT;
 
+	lock_cpu_hotplug();
 	read_lock(&tasklist_lock);
 
 	p = find_process_by_pid(pid);
 	if (!p) {
 		read_unlock(&tasklist_lock);
+		unlock_cpu_hotplug();
 		return -ESRCH;
 	}
 
@@ -2332,6 +2666,7 @@
 
 out_unlock:
 	put_task_struct(p);
+	unlock_cpu_hotplug();
 	return retval;
 }
 
@@ -2361,7 +2696,7 @@
 		goto out_unlock;
 
 	retval = 0;
-	cpus_and(mask, p->cpus_allowed, cpu_online_map);
+	cpus_and(mask, p->cpus_allowed, cpu_possible_map);
 
 out_unlock:
 	read_unlock(&tasklist_lock);
@@ -2565,35 +2900,28 @@
 
 static void show_task(task_t * p)
 {
-	unsigned long free = 0;
 	task_t *relative;
-	int state;
-	static const char * stat_nam[] = { "R", "S", "D", "T", "Z", "W" };
+	unsigned state;
+	static const char *stat_nam[] = { "R", "S", "D", "T", "Z", "W" };
 
 	printk("%-13.13s ", p->comm);
 	state = p->state ? __ffs(p->state) + 1 : 0;
-	if (((unsigned) state) < sizeof(stat_nam)/sizeof(char *))
+	if (state < ARRAY_SIZE(stat_nam))
 		printk(stat_nam[state]);
 	else
-		printk(" ");
+		printk("?");
 #if (BITS_PER_LONG == 32)
-	if (p == current)
-		printk(" current  ");
+	if (state == TASK_RUNNING)
+		printk(" running ");
 	else
 		printk(" %08lX ", thread_saved_pc(p));
 #else
-	if (p == current)
-		printk("   current task   ");
+	if (state == TASK_RUNNING)
+		printk("  running task   ");
 	else
 		printk(" %016lx ", thread_saved_pc(p));
 #endif
-	{
-		unsigned long * n = (unsigned long *) (p->thread_info+1);
-		while (!*n)
-			n++;
-		free = (unsigned long) n - (unsigned long)(p->thread_info+1);
-	}
-	printk("%5lu %5d %6d ", free, p->pid, p->parent->pid);
+	printk("%5d %6d ", p->pid, p->parent->pid);
 	if ((relative = eldest_child(p)))
 		printk("%5d ", relative->pid);
 	else
@@ -2611,7 +2939,8 @@
 	else
 		printk(" (NOTLB)\n");
 
-	show_stack(p, NULL);
+	if (state != TASK_RUNNING)
+		show_stack(p, NULL);
 }
 
 void show_state(void)
@@ -2620,12 +2949,12 @@
 
 #if (BITS_PER_LONG == 32)
 	printk("\n"
-	       "                         free                        sibling\n");
-	printk("  task             PC    stack   pid father child younger older\n");
+	       "                                               sibling\n");
+	printk("  task             PC      pid father child younger older\n");
 #else
 	printk("\n"
-	       "                                 free                        sibling\n");
-	printk("  task                 PC        stack   pid father child younger older\n");
+	       "                                                       sibling\n");
+	printk("  task                 PC          pid father child younger older\n");
 #endif
 	read_lock(&tasklist_lock);
 	do_each_thread(g, p) {
@@ -2659,7 +2988,7 @@
 	local_irq_restore(flags);
 
 	/* Set the preempt count _outside_ the spinlocks! */
-#ifdef CONFIG_PREEMPT
+#if defined(CONFIG_PREEMPT) || defined(CONFIG_DEBUG_SPINLOCK_SLEEP)
 	idle->thread_info->preempt_count = (idle->lock_depth >= 0);
 #else
 	idle->thread_info->preempt_count = 0;
@@ -2705,7 +3034,12 @@
 		goto out;
 	}
 
-	if (__set_cpus_allowed(p, new_mask, &req)) {
+	p->cpus_allowed = new_mask;
+	/* Can the task run on the task's current CPU? If so, we're done */
+	if (cpu_isset(task_cpu(p), new_mask))
+		goto out;
+
+	if (migrate_task(p, any_online_cpu(new_mask), &req)) {
 		/* Need help from migration thread: drop lock and wait. */
 		task_rq_unlock(rq, &flags);
 		wake_up_process(rq->migration_thread);
@@ -2719,8 +3053,16 @@
 
 EXPORT_SYMBOL_GPL(set_cpus_allowed);
 
-/* Move (not current) task off this cpu, onto dest cpu. */
-static void move_task_away(struct task_struct *p, int dest_cpu)
+/*
+ * Move (not current) task off this cpu, onto dest cpu.  We're doing
+ * this because either it can't run here any more (set_cpus_allowed()
+ * away from this CPU, or CPU going down), or because we're
+ * attempting to rebalance this task on exec (sched_balance_exec).
+ *
+ * So we race with normal scheduler movements, but that's OK, as long
+ * as the task is no longer on this CPU.
+ */
+static void __migrate_task(struct task_struct *p, int dest_cpu)
 {
 	runqueue_t *rq_dest;
 	unsigned long flags;
@@ -2729,14 +3071,21 @@
 
 	local_irq_save(flags);
 	double_rq_lock(this_rq(), rq_dest);
+	/* Already moved. */
 	if (task_cpu(p) != smp_processor_id())
-		goto out; /* Already moved */
+		goto out;
+	/* Affinity changed (again). */
+	if (!cpu_isset(dest_cpu, p->cpus_allowed))
+		goto out;
+	/* CPU went down. */
+	if (cpu_is_offline(dest_cpu))
+		goto out;
 
 	set_task_cpu(p, dest_cpu);
 	if (p->array) {
 		deactivate_task(p, this_rq());
 		activate_task(p, rq_dest);
-		if (p->prio < rq_dest->curr->prio)
+		if (TASK_PREEMPTS_CURR(p, rq_dest))
 			resched_task(rq_dest->curr);
 	}
 	p->timestamp = rq_dest->timestamp_last_tick;
@@ -2746,12 +3095,6 @@
 	local_irq_restore(flags);
 }
 
-typedef struct {
-	int cpu;
-	struct completion startup_done;
-	task_t *task;
-} migration_startup_t;
-
 /*
  * migration_thread - this is a highprio system thread that performs
  * thread migration by bumping thread off CPU then 'pushing' onto
@@ -2761,27 +3104,17 @@
 {
 	/* Marking "param" __user is ok, since we do a set_fs(KERNEL_DS); */
 	struct sched_param __user param = { .sched_priority = MAX_RT_PRIO-1 };
-	migration_startup_t *startup = data;
-	int cpu = startup->cpu;
 	runqueue_t *rq;
+	int cpu = (long)data;
 	int ret;
 
-	startup->task = current;
-	complete(&startup->startup_done);
-	set_current_state(TASK_UNINTERRUPTIBLE);
-	schedule();
-
 	BUG_ON(smp_processor_id() != cpu);
-
-	daemonize("migration/%d", cpu);
-	set_fs(KERNEL_DS);
-
 	ret = setscheduler(0, SCHED_FIFO, &param);
 
 	rq = this_rq();
-	rq->migration_thread = current;
+	BUG_ON(rq->migration_thread != current);
 
-	for (;;) {
+	while (!signal_pending(current)) {
 		struct list_head *head;
 		migration_req_t *req;
 
@@ -2789,7 +3122,13 @@
 			refrigerator(PF_IOTHREAD);
 
 		spin_lock_irq(&rq->lock);
+		if (rq->active_balance) {
+			active_load_balance(rq, cpu);
+			rq->active_balance = 0;
+		}
+
 		head = &rq->migration_queue;
+
 		current->state = TASK_INTERRUPTIBLE;
 		if (list_empty(head)) {
 			spin_unlock_irq(&rq->lock);
@@ -2800,11 +3139,77 @@
 		list_del_init(head->next);
 		spin_unlock_irq(&rq->lock);
 
-		move_task_away(req->task,
-			       any_online_cpu(req->task->cpus_allowed));
+		__migrate_task(req->task, req->dest_cpu);
 		complete(&req->done);
 	}
+	return 0;
+}
+
+#ifdef CONFIG_HOTPLUG_CPU
+/* migrate_all_tasks - function to migrate all the tasks from the
+ * current cpu caller must have already scheduled this to the target
+ * cpu via set_cpus_allowed  */
+void migrate_all_tasks(void)
+{
+	struct task_struct *tsk, *t;
+	int dest_cpu, src_cpu;
+	unsigned int node;
+
+	/* We're nailed to this CPU. */
+	src_cpu = smp_processor_id();
+
+	/* lock out everyone else intentionally */
+	write_lock_irq(&tasklist_lock);
+
+	/* watch out for per node tasks, let's stay on this node */
+	node = cpu_to_node(src_cpu);
+
+	do_each_thread(t, tsk) {
+		cpumask_t mask;
+		if (tsk == current)
+			continue;
+
+		if (task_cpu(tsk) != src_cpu)
+			continue;
+
+		/* Figure out where this task should go (attempting to
+		 * keep it on-node), and check if it can be migrated
+		 * as-is.  NOTE that kernel threads bound to more than
+		 * one online cpu will be migrated. */
+		mask = node_to_cpumask(node);
+		cpus_and(mask, mask, tsk->cpus_allowed);
+		dest_cpu = any_online_cpu(mask);
+		if (dest_cpu == NR_CPUS)
+			dest_cpu = any_online_cpu(tsk->cpus_allowed);
+		if (dest_cpu == NR_CPUS) {
+			/* Kernel threads which are bound to specific
+			 * processors need to look after themselves
+			 * with their own callbacks.  Exiting tasks
+			 * can have mm NULL too. */
+			if (tsk->mm == NULL && !(tsk->flags & PF_EXITING))
+				continue;
+
+			cpus_clear(tsk->cpus_allowed);
+			cpus_complement(tsk->cpus_allowed);
+			dest_cpu = any_online_cpu(tsk->cpus_allowed);
+
+			/* Don't tell them about moving exiting tasks,
+			   since they never leave kernel. */
+			if (!(tsk->flags & PF_EXITING)
+			    && printk_ratelimit())
+				printk(KERN_INFO "process %d (%s) no "
+				       "longer affine to cpu%d\n",
+				       tsk->pid, tsk->comm, src_cpu);
+		}
+
+		get_task_struct(tsk);
+		__migrate_task(tsk, dest_cpu);
+		put_task_struct(tsk);
+	} while_each_thread(t, tsk);
+
+	write_unlock_irq(&tasklist_lock);
 }
+#endif /* CONFIG_HOTPLUG_CPU */
 
 /*
  * migration_call - callback that gets triggered when a CPU is added.
@@ -2813,43 +3218,52 @@
 static int migration_call(struct notifier_block *nfb, unsigned long action,
 			  void *hcpu)
 {
-	long cpu = (long)hcpu;
-	migration_startup_t startup;
+	int cpu = (long)hcpu;
+	struct task_struct *p;
 
 	switch (action) {
+	case CPU_UP_PREPARE:
+		p = kthread_create(migration_thread, hcpu, "migration/%d",cpu);
+		if (IS_ERR(p))
+			return NOTIFY_BAD;
+		kthread_bind(p, cpu);
+		cpu_rq(cpu)->migration_thread = p;
+		break;
 	case CPU_ONLINE:
-
-		printk("Starting migration thread for cpu %li\n", cpu);
-
-		startup.cpu = cpu;
-		startup.task = NULL;
-		init_completion(&startup.startup_done);
-
-		kernel_thread(migration_thread, &startup, CLONE_KERNEL);
-		wait_for_completion(&startup.startup_done);
-		wait_task_inactive(startup.task);
-
-		startup.task->thread_info->cpu = cpu;
-		startup.task->cpus_allowed = cpumask_of_cpu(cpu);
-
-		wake_up_process(startup.task);
-
-		while (!cpu_rq(cpu)->migration_thread)
-			yield();
-
+		/* Strictly unneccessary, as first user will wake it. */
+		wake_up_process(cpu_rq(cpu)->migration_thread);
 		break;
+#ifdef CONFIG_HOTPLUG_CPU
+	case CPU_UP_CANCELED:
+		/* Unbind it from offline cpu so it can run.  Fall thru. */
+		kthread_bind(cpu_rq(cpu)->migration_thread,smp_processor_id());
+	case CPU_OFFLINE:
+		kthread_stop(cpu_rq(cpu)->migration_thread);
+		cpu_rq(cpu)->migration_thread = NULL;
+		break;
+
+	case CPU_DEAD:
+ 		BUG_ON(cpu_rq(cpu)->nr_running != 0);
+ 		break;
+#endif
 	}
 	return NOTIFY_OK;
 }
 
-static struct notifier_block migration_notifier
-			= { .notifier_call = &migration_call };
+/* Want this after the other threads, so they can use set_cpus_allowed
+ * from their CPU_OFFLINE callback, and also so everyone is off
+ * runqueue so we know it's empty. */
+static struct notifier_block __devinitdata migration_notifier = {
+	.notifier_call = migration_call,
+	.priority = -10,
+};
 
-__init int migration_init(void)
+int __init migration_init(void)
 {
+	void *cpu = (void *)(long)smp_processor_id();
 	/* Start one for boot CPU. */
-	migration_call(&migration_notifier, CPU_ONLINE,
-		       (void *)(long)smp_processor_id());
+	migration_call(&migration_notifier, CPU_UP_PREPARE, cpu);
+	migration_call(&migration_notifier, CPU_ONLINE, cpu);
 	register_cpu_notifier(&migration_notifier);
 	return 0;
 }
@@ -2871,47 +3285,219 @@
 spinlock_t kernel_flag __cacheline_aligned_in_smp = SPIN_LOCK_UNLOCKED;
 EXPORT_SYMBOL(kernel_flag);
 
-static void kstat_init_cpu(int cpu)
+#ifdef CONFIG_SMP
+#ifdef ARCH_HAS_SCHED_DOMAIN
+extern void __init arch_init_sched_domains(void);
+#else
+static struct sched_group sched_group_cpus[NR_CPUS];
+#ifdef CONFIG_NUMA
+static struct sched_group sched_group_nodes[MAX_NUMNODES];
+DEFINE_PER_CPU(struct sched_domain, node_domains);
+static void __init arch_init_sched_domains(void)
 {
-	/* Add any initialisation to kstat here */
-	/* Useful when cpu offlining logic is added.. */
+	int i;
+	struct sched_group *first_node = NULL, *last_node = NULL;
+
+	/* Set up domains */
+	for_each_cpu_mask(i, cpu_online_map) {
+		int node = cpu_to_node(i);
+		cpumask_t nodemask = node_to_cpumask(node);
+		struct sched_domain *node_domain = &per_cpu(node_domains, i);
+		struct sched_domain *cpu_domain = cpu_sched_domain(i);
+
+		*node_domain = SD_NODE_INIT;
+		node_domain->span = cpu_online_map;
+
+		*cpu_domain = SD_CPU_INIT;
+		cpus_and(cpu_domain->span, nodemask, cpu_online_map);
+		cpu_domain->parent = node_domain;
+	}
+
+	/* Set up groups */
+	for (i = 0; i < MAX_NUMNODES; i++) {
+		struct sched_group *first_cpu = NULL, *last_cpu = NULL;
+		int j;
+		cpumask_t nodemask;
+		struct sched_group *node = &sched_group_nodes[i];
+		cpumask_t tmp = node_to_cpumask(i);
+
+		cpus_and(nodemask, tmp, cpu_online_map);
+
+		if (cpus_empty(nodemask))
+			continue;
+
+		node->cpumask = nodemask;
+
+		for_each_cpu_mask(j, node->cpumask) {
+			struct sched_group *cpu = &sched_group_cpus[j];
+
+			cpus_clear(cpu->cpumask);
+			cpu_set(j, cpu->cpumask);
+
+			if (!first_cpu)
+				first_cpu = cpu;
+			if (last_cpu)
+				last_cpu->next = cpu;
+			last_cpu = cpu;
+		}
+		last_cpu->next = first_cpu;
+
+		if (!first_node)
+			first_node = node;
+		if (last_node)
+			last_node->next = node;
+		last_node = node;
+	}
+	last_node->next = first_node;
+
+	mb();
+	for_each_cpu_mask(i, cpu_online_map) {
+		struct sched_domain *node_domain = &per_cpu(node_domains, i);
+		struct sched_domain *cpu_domain = cpu_sched_domain(i);
+		node_domain->groups = &sched_group_nodes[cpu_to_node(i)];
+		cpu_domain->groups = &sched_group_cpus[i];
+	}
 }
 
-static int __devinit kstat_cpu_notify(struct notifier_block *self,
-				      unsigned long action, void *hcpu)
+#else /* CONFIG_NUMA */
+static void __init arch_init_sched_domains(void)
 {
-	int cpu = (unsigned long)hcpu;
-	switch(action) {
-	case CPU_UP_PREPARE:
-		kstat_init_cpu(cpu);
-		break;
-	default:
-		break;
+	int i;
+	struct sched_group *first_cpu = NULL, *last_cpu = NULL;
+
+	/* Set up domains */
+	for_each_cpu_mask(i, cpu_online_map) {
+		struct sched_domain *cpu_domain = cpu_sched_domain(i);
+
+		*cpu_domain = SD_CPU_INIT;
+		cpu_domain->span = cpu_online_map;
+	}
+
+	/* Set up CPU groups */
+	for_each_cpu_mask(i, cpu_online_map) {
+		struct sched_group *cpu = &sched_group_cpus[i];
+
+		cpus_clear(cpu->cpumask);
+		cpu_set(i, cpu->cpumask);
+
+		if (!first_cpu)
+			first_cpu = cpu;
+		if (last_cpu)
+			last_cpu->next = cpu;
+		last_cpu = cpu;
+	}
+	last_cpu->next = first_cpu;
+
+	mb();
+	for_each_cpu_mask(i, cpu_online_map) {
+		struct sched_domain *cpu_domain = cpu_sched_domain(i);
+		cpu_domain->groups = &sched_group_cpus[i];
 	}
-	return NOTIFY_OK;
 }
 
-static struct notifier_block __devinitdata kstat_nb = {
-	.notifier_call	= kstat_cpu_notify,
-	.next		= NULL,
-};
+#endif /* CONFIG_NUMA */
+#endif /* ARCH_HAS_SCHED_DOMAIN */
+
+#undef SCHED_DOMAIN_DEBUG
+#ifdef SCHED_DOMAIN_DEBUG
+void sched_domain_debug(void)
+{
+	int i;
+
+	for_each_cpu(i) {
+		int level = 0;
+		struct sched_domain *cpu_domain = cpu_sched_domain(i);
+
+		printk(KERN_DEBUG "CPU%d: %s\n",
+				i, (cpu_online(i) ? " online" : "offline"));
+
+		do {
+			int j;
+			char str[NR_CPUS];
+			struct sched_group *group = cpu_domain->groups;
+			cpumask_t groupmask, tmp;
+
+			cpumask_snprintf(str, NR_CPUS, cpu_domain->span);
+			cpus_clear(groupmask);
+
+			printk(KERN_DEBUG);
+			for (j = 0; j < level + 1; j++)
+				printk(" ");
+			printk("domain %d: span %s\n", level, str);
+
+			if (!cpu_isset(i, cpu_domain->span))
+				printk(KERN_DEBUG "ERROR domain->span does not contain CPU%d\n", i);
+			if (!cpu_isset(i, group->cpumask))
+				printk(KERN_DEBUG "ERROR domain->groups does not contain CPU%d\n", i);
+
+			printk(KERN_DEBUG);
+			for (j = 0; j < level + 2; j++)
+				printk(" ");
+			printk("groups:");
+			do {
+				if (group == NULL) {
+					printk(" ERROR: NULL");
+					break;
+				}
+
+				if (cpus_weight(group->cpumask) == 0)
+					printk(" ERROR empty group:");
+
+				cpus_and(tmp, groupmask, group->cpumask);
+				if (cpus_weight(tmp) > 0)
+					printk(" ERROR repeated CPUs:");
+
+				cpus_or(groupmask, groupmask, group->cpumask);
+
+				cpumask_snprintf(str, NR_CPUS, group->cpumask);
+				printk(" %s", str);
 
-__init static void init_kstat(void)
+				group = group->next;
+			} while (group != cpu_domain->groups);
+			printk("\n");
+
+			if (!cpus_equal(cpu_domain->span, groupmask))
+				printk(KERN_DEBUG "ERROR groups don't span domain->span\n");
+
+			level++;
+			cpu_domain = cpu_domain->parent;
+
+			if (cpu_domain) {
+				cpus_and(tmp, groupmask, cpu_domain->span);
+				if (!cpus_equal(tmp, groupmask))
+					printk(KERN_DEBUG "ERROR parent span is not a superset of domain->span\n");
+			}
+
+		} while (cpu_domain);
+	}
+}
+#else
+#define sched_domain_debug() {}
+#endif
+
+void __init sched_init_smp(void)
 {
-	kstat_cpu_notify(&kstat_nb, (unsigned long)CPU_UP_PREPARE,
-			 (void *)(long)smp_processor_id());
-	register_cpu_notifier(&kstat_nb);
+	arch_init_sched_domains();
+	sched_domain_debug();
 }
+#else
+void __init sched_init_smp(void)
+{
+}
+#endif /* CONFIG_SMP */
 
 void __init sched_init(void)
 {
 	runqueue_t *rq;
 	int i, j, k;
 
-	/* Init the kstat counters */
-	init_kstat();
 	for (i = 0; i < NR_CPUS; i++) {
 		prio_array_t *array;
+#ifdef CONFIG_SMP
+		struct sched_domain *domain;
+		domain = cpu_sched_domain(i);
+		memset(domain, 0, sizeof(struct sched_domain));
+#endif
 
 		rq = cpu_rq(i);
 		rq->active = rq->arrays;
@@ -2921,7 +3507,6 @@
 		spin_lock_init(&rq->lock);
 		INIT_LIST_HEAD(&rq->migration_queue);
 		atomic_set(&rq->nr_iowait, 0);
-		nr_running_init(rq);
 
 		for (j = 0; j < 2; j++) {
 			array = rq->arrays + j;
--- diff/kernel/signal.c	2003-11-25 15:24:59.000000000 +0000
+++ source/kernel/signal.c	2004-02-09 10:39:57.000000000 +0000
@@ -24,6 +24,7 @@
 #include <linux/binfmts.h>
 #include <linux/security.h>
 #include <linux/ptrace.h>
+#include <linux/compat_siginfo.h>
 #include <asm/param.h>
 #include <asm/uaccess.h>
 #include <asm/siginfo.h>
@@ -2006,6 +2007,12 @@
 	if (from->si_code < 0)
 		return __copy_to_user(to, from, sizeof(siginfo_t))
 			? -EFAULT : 0;
+
+	/* Use compat_siginfo_t with 32-bit signals */
+	if(is_compat_task(current)){
+		return compat_copy_siginfo_to_user((compat_siginfo_t __user *)to,from);
+	}
+
 	/*
 	 * If you change siginfo_t structure, please be sure
 	 * this code is fixed accordingly.
--- diff/kernel/softirq.c	2003-10-09 09:47:34.000000000 +0100
+++ source/kernel/softirq.c	2004-02-09 10:39:57.000000000 +0000
@@ -14,6 +14,7 @@
 #include <linux/notifier.h>
 #include <linux/percpu.h>
 #include <linux/cpu.h>
+#include <linux/kthread.h>
 
 /*
    - No shared variables, all the data are CPU local.
@@ -103,7 +104,11 @@
 		local_irq_disable();
 
 		pending = local_softirq_pending();
-		if (pending && --max_restart)
+		/*
+		 * If ksoftirqd is dead transiently during cpu offlining
+		 * continue to process from interrupt context.
+		 */
+		if (pending && (--max_restart || !__get_cpu_var(ksoftirqd)))
 			goto restart;
 		if (pending)
 			wakeup_softirqd();
@@ -117,11 +122,22 @@
 
 void local_bh_enable(void)
 {
+	if (in_irq()) {
+		printk("local_bh_enable() was called in hard irq context.   "
+			"This is probably a bug\n");
+		dump_stack();
+	}
+
 	__local_bh_enable();
-	WARN_ON(irqs_disabled());
-	if (unlikely(!in_interrupt() &&
-		     local_softirq_pending()))
+	if (unlikely(!in_interrupt() && local_softirq_pending())) {
+		if (irqs_disabled()) {
+			printk("local_bh_enable() was called with local "
+				"interrupts disabled.  This is probably a"
+				" bug\n");
+			dump_stack();
+		}
 		invoke_softirq();
+	}
 	preempt_check_resched();
 }
 EXPORT_SYMBOL(local_bh_enable);
@@ -299,58 +315,24 @@
 
 EXPORT_SYMBOL(tasklet_kill);
 
-static void tasklet_init_cpu(int cpu)
-{
-	per_cpu(tasklet_vec, cpu).list = NULL;
-	per_cpu(tasklet_hi_vec, cpu).list = NULL;
-}
-	
-static int tasklet_cpu_notify(struct notifier_block *self, 
-				unsigned long action, void *hcpu)
-{
-	long cpu = (long)hcpu;
-	switch(action) {
-	case CPU_UP_PREPARE:
-		tasklet_init_cpu(cpu);
-		break;
-	default:
-		break;
-	}
-	return 0;
-}
-
-static struct notifier_block tasklet_nb = {
-	.notifier_call	= tasklet_cpu_notify,
-	.next		= NULL,
-};
-
 void __init softirq_init(void)
 {
 	open_softirq(TASKLET_SOFTIRQ, tasklet_action, NULL);
 	open_softirq(HI_SOFTIRQ, tasklet_hi_action, NULL);
-	tasklet_cpu_notify(&tasklet_nb, (unsigned long)CPU_UP_PREPARE,
-				(void *)(long)smp_processor_id());
-	register_cpu_notifier(&tasklet_nb);
 }
 
 static int ksoftirqd(void * __bind_cpu)
 {
 	int cpu = (int) (long) __bind_cpu;
 
-	daemonize("ksoftirqd/%d", cpu);
 	set_user_nice(current, 19);
 	current->flags |= PF_IOTHREAD;
 
-	/* Migrate to the right CPU */
-	set_cpus_allowed(current, cpumask_of_cpu(cpu));
 	BUG_ON(smp_processor_id() != cpu);
 
-	__set_current_state(TASK_INTERRUPTIBLE);
-	mb();
-
-	__get_cpu_var(ksoftirqd) = current;
+	set_current_state(TASK_INTERRUPTIBLE);
 
-	for (;;) {
+	while (!signal_pending(current)) {
 		if (!local_softirq_pending())
 			schedule();
 
@@ -363,22 +345,99 @@
 
 		__set_current_state(TASK_INTERRUPTIBLE);
 	}
+	return 0;
+}
+
+#ifdef CONFIG_HOTPLUG_CPU
+/*
+ * tasklet_kill_immediate is called to remove a tasklet which can already be
+ * scheduled for execution on @cpu.
+ *
+ * Unlike tasklet_kill, this function removes the tasklet
+ * _immediately_, even if the tasklet is in TASKLET_STATE_SCHED state.
+ *
+ * When this function is called, @cpu must be in the CPU_DEAD state.
+ */
+void tasklet_kill_immediate(struct tasklet_struct *t, unsigned int cpu)
+{
+	struct tasklet_struct **i;
+
+	BUG_ON(cpu_online(cpu));
+	BUG_ON(test_bit(TASKLET_STATE_RUN, &t->state));
+
+	if (!test_bit(TASKLET_STATE_SCHED, &t->state))
+		return;
+
+	/* CPU is dead, so no lock needed. */
+	for (i = &per_cpu(tasklet_vec, cpu).list; *i; i = &(*i)->next) {
+		if (*i == t) {
+			*i = t->next;
+			return;
+		}
+	}
+	BUG();
+}
+
+static void takeover_tasklets(unsigned int cpu)
+{
+	struct tasklet_struct **i;
+
+	/* CPU is dead, so no lock needed. */
+	local_irq_disable();
+
+	/* Find end, append list for that CPU. */
+	for (i = &__get_cpu_var(tasklet_vec).list; *i; i = &(*i)->next);
+	*i = per_cpu(tasklet_vec, cpu).list;
+	per_cpu(tasklet_vec, cpu).list = NULL;
+	raise_softirq_irqoff(TASKLET_SOFTIRQ);
+
+	for (i = &__get_cpu_var(tasklet_hi_vec).list; *i; i = &(*i)->next);
+	*i = per_cpu(tasklet_hi_vec, cpu).list;
+	per_cpu(tasklet_hi_vec, cpu).list = NULL;
+	raise_softirq_irqoff(HI_SOFTIRQ);
+
+	local_irq_enable();
 }
+#endif /* CONFIG_HOTPLUG_CPU */
 
 static int __devinit cpu_callback(struct notifier_block *nfb,
 				  unsigned long action,
 				  void *hcpu)
 {
 	int hotcpu = (unsigned long)hcpu;
+	struct task_struct *p;
 
-	if (action == CPU_ONLINE) {
-		if (kernel_thread(ksoftirqd, hcpu, CLONE_KERNEL) < 0) {
+	switch (action) {
+	case CPU_UP_PREPARE:
+		BUG_ON(per_cpu(tasklet_vec, hotcpu).list);
+		BUG_ON(per_cpu(tasklet_hi_vec, hotcpu).list);
+		p = kthread_create(ksoftirqd, hcpu, "ksoftirqd/%d", hotcpu);
+		if (IS_ERR(p)) {
 			printk("ksoftirqd for %i failed\n", hotcpu);
 			return NOTIFY_BAD;
 		}
-
-		while (!per_cpu(ksoftirqd, hotcpu))
-			yield();
+		per_cpu(ksoftirqd, hotcpu) = p;
+		kthread_bind(p, hotcpu);
+  		per_cpu(ksoftirqd, hotcpu) = p;
+ 		break;
+	case CPU_ONLINE:
+		wake_up_process(per_cpu(ksoftirqd, hotcpu));
+		break;
+#ifdef CONFIG_HOTPLUG_CPU
+	case CPU_UP_CANCELED:
+		/* Unbind so it can run.  Fall thru. */
+		kthread_bind(per_cpu(ksoftirqd, hotcpu), smp_processor_id());
+	case CPU_OFFLINE:
+		p = per_cpu(ksoftirqd, hotcpu);
+		per_cpu(ksoftirqd, hotcpu) = NULL;
+		/* Must set to NULL before interrupt tries to wake it */
+		barrier();
+		kthread_stop(p);
+		break;
+	case CPU_DEAD:
+		takeover_tasklets(hotcpu);
+		break;
+#endif /* CONFIG_HOTPLUG_CPU */
  	}
 	return NOTIFY_OK;
 }
@@ -389,7 +448,9 @@
 
 __init int spawn_ksoftirqd(void)
 {
-	cpu_callback(&cpu_nfb, CPU_ONLINE, (void *)(long)smp_processor_id());
+	void *cpu = (void *)(long)smp_processor_id();
+	cpu_callback(&cpu_nfb, CPU_UP_PREPARE, cpu);
+	cpu_callback(&cpu_nfb, CPU_ONLINE, cpu);
 	register_cpu_notifier(&cpu_nfb);
 	return 0;
 }
--- diff/kernel/sys.c	2004-02-09 10:36:12.000000000 +0000
+++ source/kernel/sys.c	2004-02-09 10:39:57.000000000 +0000
@@ -475,13 +475,11 @@
 
 #ifdef CONFIG_SOFTWARE_SUSPEND
 	case LINUX_REBOOT_CMD_SW_SUSPEND:
-		if (!software_suspend_enabled) {
+		{
+			int ret = software_suspend();
 			unlock_kernel();
-			return -EAGAIN;
+			return ret;
 		}
-		software_suspend();
-		do_exit(0);
-		break;
 #endif
 
 	default:
@@ -1091,10 +1089,177 @@
 /*
  * Supplementary group IDs
  */
-asmlinkage long sys_getgroups(int gidsetsize, gid_t __user *grouplist)
+
+/* init to 2 - one for init_task, one to ensure it is never freed */
+struct group_info init_groups = { .usage = ATOMIC_INIT(2) };
+
+struct group_info *groups_alloc(int gidsetsize)
 {
+	struct group_info *group_info;
+	int nblocks;
 	int i;
-	
+
+	nblocks = (gidsetsize/NGROUPS_PER_BLOCK) +
+	    (gidsetsize%NGROUPS_PER_BLOCK?1:0);
+	group_info = kmalloc(sizeof(*group_info) + nblocks*sizeof(gid_t *),
+	    GFP_USER);
+	if (!group_info)
+		return NULL;
+	group_info->ngroups = gidsetsize;
+	group_info->nblocks = nblocks;
+	atomic_set(&group_info->usage, 1);
+
+	if (gidsetsize <= NGROUPS_SMALL) {
+		group_info->blocks[0] = group_info->small_block;
+	} else {
+		for (i = 0; i < nblocks; i++) {
+			gid_t *b;
+			b = (void *)__get_free_page(GFP_USER);
+			if (!b)
+				goto out_undo_partial_alloc;
+			group_info->blocks[i] = b;
+		}
+	}
+	return group_info;
+
+out_undo_partial_alloc:
+	while (--i >= 0) {
+		free_page((unsigned long)group_info->blocks[i]);
+	}
+	kfree(group_info);
+	return NULL;
+}
+
+EXPORT_SYMBOL(groups_alloc);
+
+void groups_free(struct group_info *group_info)
+{
+	if (group_info->ngroups > NGROUPS_SMALL) {
+		int i;
+		for (i = 0; i < group_info->nblocks; i++)
+			free_page((unsigned long)group_info->blocks[i]);
+	}
+	kfree(group_info);
+}
+
+EXPORT_SYMBOL(groups_free);
+
+/* export the group_info to a user-space array */
+static int groups_to_user(gid_t __user *grouplist,
+    struct group_info *group_info)
+{
+	int i;
+	int count = group_info->ngroups;
+
+	for (i = 0; i < group_info->nblocks; i++) {
+		int cp_count = min(NGROUPS_PER_BLOCK, count);
+		int off = i * NGROUPS_PER_BLOCK;
+		int len = cp_count * sizeof(*grouplist);
+
+		if (copy_to_user(grouplist+off, group_info->blocks[i], len))
+			return -EFAULT;
+
+		count -= cp_count;
+	}
+	return 0;
+}
+
+/* fill a group_info from a user-space array - it must be allocated already */
+static int groups_from_user(struct group_info *group_info,
+    gid_t __user *grouplist)
+ {
+	int i;
+	int count = group_info->ngroups;
+
+	for (i = 0; i < group_info->nblocks; i++) {
+		int cp_count = min(NGROUPS_PER_BLOCK, count);
+		int off = i * NGROUPS_PER_BLOCK;
+		int len = cp_count * sizeof(*grouplist);
+
+		if (copy_from_user(group_info->blocks[i], grouplist+off, len))
+			return -EFAULT;
+
+		count -= cp_count;
+	}
+	return 0;
+}
+
+/* a simple shell-metzner sort */
+static void groups_sort(struct group_info *group_info)
+{
+	int base, max, stride;
+	int gidsetsize = group_info->ngroups;
+
+	for (stride = 1; stride < gidsetsize; stride = 3 * stride + 1)
+		; /* nothing */
+	stride /= 3;
+
+	while (stride) {
+		max = gidsetsize - stride;
+		for (base = 0; base < max; base++) {
+			int left = base;
+			int right = left + stride;
+			gid_t tmp = GROUP_AT(group_info, right);
+
+			while (left >= 0 && GROUP_AT(group_info, left) > tmp) {
+				GROUP_AT(group_info, right) =
+				    GROUP_AT(group_info, left);
+				right = left;
+				left -= stride;
+			}
+			GROUP_AT(group_info, right) = tmp;
+		}
+		stride /= 3;
+	}
+}
+
+/* a simple bsearch */
+static int groups_search(struct group_info *group_info, gid_t grp)
+{
+	int left, right;
+
+	if (!group_info)
+		return 0;
+
+	left = 0;
+	right = group_info->ngroups;
+	while (left < right) {
+		int mid = (left+right)/2;
+		int cmp = grp - GROUP_AT(group_info, mid);
+		if (cmp > 0)
+			left = mid + 1;
+		else if (cmp < 0)
+			right = mid;
+		else
+			return 1;
+	}
+	return 0;
+}
+
+/* validate and set current->group_info */
+int set_current_groups(struct group_info *group_info)
+{
+	int retval;
+	struct group_info *old_info;
+
+	retval = security_task_setgroups(group_info);
+	if (retval)
+		return retval;
+
+	groups_sort(group_info);
+	old_info = current->group_info;
+	current->group_info = group_info;
+	put_group_info(old_info);
+
+	return 0;
+}
+
+EXPORT_SYMBOL(set_current_groups);
+
+asmlinkage long sys_getgroups(int gidsetsize, gid_t __user *grouplist)
+{
+	int i = 0;
+
 	/*
 	 *	SMP: Nobody else can change our grouplist. Thus we are
 	 *	safe.
@@ -1102,54 +1267,53 @@
 
 	if (gidsetsize < 0)
 		return -EINVAL;
-	i = current->ngroups;
+
+	get_group_info(current->group_info);
+	i = current->group_info->ngroups;
 	if (gidsetsize) {
-		if (i > gidsetsize)
-			return -EINVAL;
-		if (copy_to_user(grouplist, current->groups, sizeof(gid_t)*i))
-			return -EFAULT;
+		if (i > gidsetsize) {
+			i = -EINVAL;
+			goto out;
+		}
+		if (groups_to_user(grouplist, current->group_info)) {
+			i = -EFAULT;
+			goto out;
+		}
 	}
+out:
+	put_group_info(current->group_info);
 	return i;
 }
 
 /*
- *	SMP: Our groups are not shared. We can copy to/from them safely
+ *	SMP: Our groups are copy-on-write. We can set them safely
  *	without another task interfering.
  */
  
 asmlinkage long sys_setgroups(int gidsetsize, gid_t __user *grouplist)
 {
-	gid_t groups[NGROUPS];
+	struct group_info *group_info;
 	int retval;
 
 	if (!capable(CAP_SETGID))
 		return -EPERM;
-	if ((unsigned) gidsetsize > NGROUPS)
+	if ((unsigned)gidsetsize > NGROUPS_MAX)
 		return -EINVAL;
-	if (copy_from_user(groups, grouplist, gidsetsize * sizeof(gid_t)))
-		return -EFAULT;
-	retval = security_task_setgroups(gidsetsize, groups);
-	if (retval)
+
+	group_info = groups_alloc(gidsetsize);
+	if (!group_info)
+		return -ENOMEM;
+	retval = groups_from_user(group_info, grouplist);
+	if (retval) {
+		put_group_info(group_info);
 		return retval;
-	memcpy(current->groups, groups, gidsetsize * sizeof(gid_t));
-	current->ngroups = gidsetsize;
-	return 0;
-}
+	}
 
-static int supplemental_group_member(gid_t grp)
-{
-	int i = current->ngroups;
+	retval = set_current_groups(group_info);
+	if (retval)
+		put_group_info(group_info);
 
-	if (i) {
-		gid_t *groups = current->groups;
-		do {
-			if (*groups == grp)
-				return 1;
-			groups++;
-			i--;
-		} while (i);
-	}
-	return 0;
+	return retval;
 }
 
 /*
@@ -1158,8 +1322,11 @@
 int in_group_p(gid_t grp)
 {
 	int retval = 1;
-	if (grp != current->fsgid)
-		retval = supplemental_group_member(grp);
+	if (grp != current->fsgid) {
+		get_group_info(current->group_info);
+		retval = groups_search(current->group_info, grp);
+		put_group_info(current->group_info);
+	}
 	return retval;
 }
 
@@ -1168,8 +1335,11 @@
 int in_egroup_p(gid_t grp)
 {
 	int retval = 1;
-	if (grp != current->egid)
-		retval = supplemental_group_member(grp);
+	if (grp != current->egid) {
+		get_group_info(current->group_info);
+		retval = groups_search(current->group_info, grp);
+		put_group_info(current->group_info);
+	}
 	return retval;
 }
 
--- diff/kernel/sysctl.c	2004-02-09 10:36:12.000000000 +0000
+++ source/kernel/sysctl.c	2004-02-09 10:39:57.000000000 +0000
@@ -598,7 +598,6 @@
 		.maxlen		= sizeof(int),
 		.mode		= 0644,
 		.proc_handler	= &proc_dointvec,
-		.strategy	= &sysctl_jiffies,
 	},
 	{ .ctl_name = 0 }
 };
@@ -721,6 +720,26 @@
 		.strategy	= &sysctl_intvec,
 		.extra1		= &zero,
 	},
+	{
+		.ctl_name	= VM_LAPTOP_MODE,
+		.procname	= "laptop_mode",
+		.data		= &laptop_mode,
+		.maxlen		= sizeof(laptop_mode),
+		.mode		= 0644,
+		.proc_handler	= &proc_dointvec,
+		.strategy	= &sysctl_intvec,
+		.extra1		= &zero,
+	},
+	{
+		.ctl_name	= VM_BLOCK_DUMP,
+		.procname	= "block_dump",
+		.data		= &block_dump,
+		.maxlen		= sizeof(block_dump),
+		.mode		= 0644,
+		.proc_handler	= &proc_dointvec,
+		.strategy	= &sysctl_intvec,
+		.extra1		= &zero,
+	},
 	{ .ctl_name = 0 }
 };
 
@@ -815,6 +834,22 @@
 		.mode		= 0644,
 		.proc_handler	= &proc_dointvec,
 	},
+	{
+		.ctl_name	= FS_AIO_NR,
+		.procname	= "aio-nr",
+		.data		= &aio_nr,
+		.maxlen		= sizeof(aio_nr),
+		.mode		= 0444,
+		.proc_handler	= &proc_dointvec,
+	},
+	{
+		.ctl_name	= FS_AIO_MAX_NR,
+		.procname	= "aio-max-nr",
+		.data		= &aio_max_nr,
+		.maxlen		= sizeof(aio_max_nr),
+		.mode		= 0644,
+		.proc_handler	= &proc_dointvec,
+	},
 	{ .ctl_name = 0 }
 };
 
--- diff/kernel/timer.c	2004-02-09 10:36:12.000000000 +0000
+++ source/kernel/timer.c	2004-02-09 10:39:57.000000000 +0000
@@ -1223,7 +1223,74 @@
 
 	base->timer_jiffies = jiffies;
 }
-	
+
+#ifdef CONFIG_HOTPLUG_CPU
+static int migrate_timer_list(tvec_base_t *new_base, struct list_head *head)
+{
+	struct timer_list *timer;
+
+	while (!list_empty(head)) {
+		timer = list_entry(head->next, struct timer_list, entry);
+		/* We're locking backwards from __mod_timer order here,
+		   beware deadlock. */
+		if (!spin_trylock(&timer->lock))
+			return 0;
+		list_del(&timer->entry);
+		internal_add_timer(new_base, timer);
+		timer->base = new_base;
+		spin_unlock(&timer->lock);
+	}
+	return 1;
+}
+
+static void __devinit migrate_timers(int cpu)
+{
+	tvec_base_t *old_base;
+	tvec_base_t *new_base;
+	int i;
+
+	BUG_ON(cpu_online(cpu));
+	old_base = &per_cpu(tvec_bases, cpu);
+	new_base = &get_cpu_var(tvec_bases);
+	printk("migrate_timers: offlined base %p\n", old_base);
+
+	local_irq_disable();
+again:
+	/* Prevent deadlocks via ordering by old_base < new_base. */
+	if (old_base < new_base) {
+		spin_lock(&new_base->lock);
+		spin_lock(&old_base->lock);
+	} else {
+		spin_lock(&old_base->lock);
+		spin_lock(&new_base->lock);
+	}
+
+	if (old_base->running_timer)
+		BUG();
+	for (i = 0; i < TVR_SIZE; i++)
+		if (!migrate_timer_list(new_base, old_base->tv1.vec + i))
+			goto unlock_again;
+	for (i = 0; i < TVN_SIZE; i++)
+		if (!migrate_timer_list(new_base, old_base->tv2.vec + i)
+		    || !migrate_timer_list(new_base, old_base->tv3.vec + i)
+		    || !migrate_timer_list(new_base, old_base->tv4.vec + i)
+		    || !migrate_timer_list(new_base, old_base->tv5.vec + i))
+			goto unlock_again;
+	spin_unlock(&old_base->lock);
+	spin_unlock(&new_base->lock);
+	local_irq_enable();
+	put_cpu_var(tvec_bases);
+	return;
+
+unlock_again:
+	/* Avoid deadlock with __mod_timer, by backing off. */
+	spin_unlock(&old_base->lock);
+	spin_unlock(&new_base->lock);
+	cpu_relax();
+	goto again;
+}
+#endif /* CONFIG_HOTPLUG_CPU */
+
 static int __devinit timer_cpu_notify(struct notifier_block *self, 
 				unsigned long action, void *hcpu)
 {
@@ -1232,6 +1299,11 @@
 	case CPU_UP_PREPARE:
 		init_timers_cpu(cpu);
 		break;
+#ifdef CONFIG_HOTPLUG_CPU
+	case CPU_DEAD:
+		migrate_timers(cpu);
+		break;
+#endif
 	default:
 		break;
 	}
--- diff/kernel/uid16.c	2003-10-09 09:47:17.000000000 +0100
+++ source/kernel/uid16.c	2004-02-09 10:39:57.000000000 +0000
@@ -107,45 +107,84 @@
 	return sys_setfsgid((gid_t)gid);
 }
 
+static int groups16_to_user(old_gid_t __user *grouplist,
+    struct group_info *group_info)
+{
+	int i;
+	old_gid_t group;
+
+	for (i = 0; i < group_info->ngroups; i++) {
+		group = (old_gid_t)GROUP_AT(group_info, i);
+		if (put_user(group, grouplist+i))
+			return -EFAULT;
+	}
+
+	return 0;
+}
+
+static int groups16_from_user(struct group_info *group_info,
+    old_gid_t __user *grouplist)
+{
+	int i;
+	old_gid_t group;
+
+	for (i = 0; i < group_info->ngroups; i++) {
+		if (get_user(group, grouplist+i))
+			return  -EFAULT;
+		GROUP_AT(group_info, i) = (gid_t)group;
+	}
+
+	return 0;
+}
+
 asmlinkage long sys_getgroups16(int gidsetsize, old_gid_t __user *grouplist)
 {
-	old_gid_t groups[NGROUPS];
-	int i,j;
+	int i = 0;
 
 	if (gidsetsize < 0)
 		return -EINVAL;
-	i = current->ngroups;
+
+	get_group_info(current->group_info);
+	i = current->group_info->ngroups;
 	if (gidsetsize) {
-		if (i > gidsetsize)
-			return -EINVAL;
-		for(j=0;j<i;j++)
-			groups[j] = current->groups[j];
-		if (copy_to_user(grouplist, groups, sizeof(old_gid_t)*i))
-			return -EFAULT;
+		if (i > gidsetsize) {
+			i = -EINVAL;
+			goto out;
+		}
+		if (groups16_to_user(grouplist, current->group_info)) {
+			i = -EFAULT;
+			goto out;
+		}
 	}
+out:
+	put_group_info(current->group_info);
 	return i;
 }
 
 asmlinkage long sys_setgroups16(int gidsetsize, old_gid_t __user *grouplist)
 {
-	old_gid_t groups[NGROUPS];
-	gid_t new_groups[NGROUPS];
-	int i;
+	struct group_info *group_info;
+	int retval;
 
 	if (!capable(CAP_SETGID))
 		return -EPERM;
-	if ((unsigned) gidsetsize > NGROUPS)
+	if ((unsigned)gidsetsize > NGROUPS_MAX)
 		return -EINVAL;
-	if (copy_from_user(groups, grouplist, gidsetsize * sizeof(old_gid_t)))
-		return -EFAULT;
-	for (i = 0 ; i < gidsetsize ; i++)
-		new_groups[i] = (gid_t)groups[i];
-	i = security_task_setgroups(gidsetsize, new_groups);
-	if (i)
-		return i;
-	memcpy(current->groups, new_groups, gidsetsize * sizeof(gid_t));
-	current->ngroups = gidsetsize;
-	return 0;
+
+	group_info = groups_alloc(gidsetsize);
+	if (!group_info)
+		return -ENOMEM;
+	retval = groups16_from_user(group_info, grouplist);
+	if (retval) {
+		put_group_info(group_info);
+		return retval;
+	}
+
+	retval = set_current_groups(group_info);
+	if (retval)
+		put_group_info(group_info);
+
+	return retval;
 }
 
 asmlinkage long sys_getuid16(void)
--- diff/kernel/workqueue.c	2004-02-09 10:36:12.000000000 +0000
+++ source/kernel/workqueue.c	2004-02-09 10:39:57.000000000 +0000
@@ -22,6 +22,9 @@
 #include <linux/completion.h>
 #include <linux/workqueue.h>
 #include <linux/slab.h>
+#include <linux/cpu.h>
+#include <linux/notifier.h>
+#include <linux/kthread.h>
 
 /*
  * The per-CPU workqueue.
@@ -45,7 +48,6 @@
 
 	struct workqueue_struct *wq;
 	task_t *thread;
-	struct completion exit;
 
 } ____cacheline_aligned;
 
@@ -55,8 +57,36 @@
  */
 struct workqueue_struct {
 	struct cpu_workqueue_struct cpu_wq[NR_CPUS];
+	const char *name;
+	struct list_head list;
 };
 
+#ifdef CONFIG_HOTPLUG_CPU
+/* All the workqueues on the system, for hotplug cpu to add/remove
+   threads to each one as cpus come/go.  Protected by cpucontrol
+   sem. */
+static LIST_HEAD(workqueues);
+#define add_workqueue(wq) list_add(&(wq)->list, &workqueues)
+#define del_workqueue(wq) list_del(&(wq)->list)
+#else
+#define add_workqueue(wq)
+#define del_workqueue(wq)
+#endif /* CONFIG_HOTPLUG_CPU */
+
+/* Preempt must be disabled. */
+static void __queue_work(struct cpu_workqueue_struct *cwq,
+			 struct work_struct *work)
+{
+	unsigned long flags;
+
+	spin_lock_irqsave(&cwq->lock, flags);
+	work->wq_data = cwq;
+	list_add_tail(&work->entry, &cwq->worklist);
+	cwq->insert_sequence++;
+	wake_up(&cwq->more_work);
+	spin_unlock_irqrestore(&cwq->lock, flags);
+}
+
 /*
  * Queue work on a workqueue. Return non-zero if it was successfully
  * added.
@@ -66,19 +96,11 @@
  */
 int queue_work(struct workqueue_struct *wq, struct work_struct *work)
 {
-	unsigned long flags;
 	int ret = 0, cpu = get_cpu();
-	struct cpu_workqueue_struct *cwq = wq->cpu_wq + cpu;
 
 	if (!test_and_set_bit(0, &work->pending)) {
 		BUG_ON(!list_empty(&work->entry));
-		work->wq_data = cwq;
-
-		spin_lock_irqsave(&cwq->lock, flags);
-		list_add_tail(&work->entry, &cwq->worklist);
-		cwq->insert_sequence++;
-		wake_up(&cwq->more_work);
-		spin_unlock_irqrestore(&cwq->lock, flags);
+		__queue_work(wq->cpu_wq + cpu, work);
 		ret = 1;
 	}
 	put_cpu();
@@ -88,39 +110,29 @@
 static void delayed_work_timer_fn(unsigned long __data)
 {
 	struct work_struct *work = (struct work_struct *)__data;
-	struct cpu_workqueue_struct *cwq = work->wq_data;
-	unsigned long flags;
+	struct workqueue_struct *wq = work->wq_data;
 
-	/*
-	 * Do the wakeup within the spinlock, so that flushing
-	 * can be done in a guaranteed way.
-	 */
-	spin_lock_irqsave(&cwq->lock, flags);
-	list_add_tail(&work->entry, &cwq->worklist);
-	cwq->insert_sequence++;
-	wake_up(&cwq->more_work);
-	spin_unlock_irqrestore(&cwq->lock, flags);
+	__queue_work(wq->cpu_wq + smp_processor_id(), work);
 }
 
 int queue_delayed_work(struct workqueue_struct *wq,
 			struct work_struct *work, unsigned long delay)
 {
-	int ret = 0, cpu = get_cpu();
+	int ret = 0;
 	struct timer_list *timer = &work->timer;
-	struct cpu_workqueue_struct *cwq = wq->cpu_wq + cpu;
 
 	if (!test_and_set_bit(0, &work->pending)) {
 		BUG_ON(timer_pending(timer));
 		BUG_ON(!list_empty(&work->entry));
 
-		work->wq_data = cwq;
+		/* This stores wq for the moment, for the timer_fn */
+		work->wq_data = wq;
 		timer->expires = jiffies + delay;
 		timer->data = (unsigned long)work;
 		timer->function = delayed_work_timer_fn;
 		add_timer(timer);
 		ret = 1;
 	}
-	put_cpu();
 	return ret;
 }
 
@@ -153,28 +165,23 @@
 	spin_unlock_irqrestore(&cwq->lock, flags);
 }
 
-typedef struct startup_s {
-	struct cpu_workqueue_struct *cwq;
-	struct completion done;
-	const char *name;
-} startup_t;
-
-static int worker_thread(void *__startup)
+static int worker_thread(void *__cwq)
 {
-	startup_t *startup = __startup;
-	struct cpu_workqueue_struct *cwq = startup->cwq;
+	struct cpu_workqueue_struct *cwq = __cwq;
 	int cpu = cwq - cwq->wq->cpu_wq;
 	DECLARE_WAITQUEUE(wait, current);
 	struct k_sigaction sa;
+	sigset_t blocked;
 
-	daemonize("%s/%d", startup->name, cpu);
 	current->flags |= PF_IOTHREAD;
-	cwq->thread = current;
 
 	set_user_nice(current, -10);
-	set_cpus_allowed(current, cpumask_of_cpu(cpu));
+	BUG_ON(smp_processor_id() != cpu);
 
-	complete(&startup->done);
+	/* Block and flush all signals */
+	sigfillset(&blocked);
+	sigprocmask(SIG_BLOCK, &blocked, NULL);
+	flush_signals(current);
 
 	/* SIG_IGN makes children autoreap: see do_notify_parent(). */
 	sa.sa.sa_handler = SIG_IGN;
@@ -182,12 +189,10 @@
 	siginitset(&sa.sa.sa_mask, sigmask(SIGCHLD));
 	do_sigaction(SIGCHLD, &sa, (struct k_sigaction *)0);
 
-	for (;;) {
+	while (!signal_pending(current)) {
 		set_task_state(current, TASK_INTERRUPTIBLE);
 
 		add_wait_queue(&cwq->more_work, &wait);
-		if (!cwq->thread)
-			break;
 		if (list_empty(&cwq->worklist))
 			schedule();
 		else
@@ -197,9 +202,6 @@
 		if (!list_empty(&cwq->worklist))
 			run_workqueue(cwq);
 	}
-	remove_wait_queue(&cwq->more_work, &wait);
-	complete(&cwq->exit);
-
 	return 0;
 }
 
@@ -224,6 +226,7 @@
 
 	might_sleep();
 
+	lock_cpu_hotplug();
 	for (cpu = 0; cpu < NR_CPUS; cpu++) {
 		DEFINE_WAIT(wait);
 		long sequence_needed;
@@ -245,15 +248,13 @@
 		finish_wait(&cwq->work_done, &wait);
 		spin_unlock_irq(&cwq->lock);
 	}
+	unlock_cpu_hotplug();
 }
 
-static int create_workqueue_thread(struct workqueue_struct *wq,
-				   const char *name,
-				   int cpu)
+static int create_workqueue_thread(struct workqueue_struct *wq, int cpu)
 {
-	startup_t startup;
 	struct cpu_workqueue_struct *cwq = wq->cpu_wq + cpu;
-	int ret;
+	struct task_struct *p;
 
 	spin_lock_init(&cwq->lock);
 	cwq->wq = wq;
@@ -263,17 +264,13 @@
 	INIT_LIST_HEAD(&cwq->worklist);
 	init_waitqueue_head(&cwq->more_work);
 	init_waitqueue_head(&cwq->work_done);
-	init_completion(&cwq->exit);
 
-	init_completion(&startup.done);
-	startup.cwq = cwq;
-	startup.name = name;
-	ret = kernel_thread(worker_thread, &startup, CLONE_FS | CLONE_FILES);
-	if (ret >= 0) {
-		wait_for_completion(&startup.done);
-		BUG_ON(!cwq->thread);
-	}
-	return ret;
+	p = kthread_create(worker_thread, cwq, "%s/%d", wq->name, cpu);
+	if (IS_ERR(p))
+		return PTR_ERR(p);
+	cwq->thread = p;
+	kthread_bind(p, cpu);
+	return 0;
 }
 
 struct workqueue_struct *create_workqueue(const char *name)
@@ -287,12 +284,19 @@
 	if (!wq)
 		return NULL;
 
+	wq->name = name;
+	/* We don't need the distraction of CPUs appearing and vanishing. */
+	lock_cpu_hotplug();
 	for (cpu = 0; cpu < NR_CPUS; cpu++) {
 		if (!cpu_online(cpu))
 			continue;
-		if (create_workqueue_thread(wq, name, cpu) < 0)
+		if (create_workqueue_thread(wq, cpu) < 0)
 			destroy = 1;
+		else
+			wake_up_process(wq->cpu_wq[cpu].thread);
 	}
+	add_workqueue(wq);
+
 	/*
 	 * Was there any error during startup? If yes then clean up:
 	 */
@@ -300,21 +304,23 @@
 		destroy_workqueue(wq);
 		wq = NULL;
 	}
+	unlock_cpu_hotplug();
 	return wq;
 }
 
 static void cleanup_workqueue_thread(struct workqueue_struct *wq, int cpu)
 {
 	struct cpu_workqueue_struct *cwq;
+	unsigned long flags;
+	struct task_struct *p;
 
 	cwq = wq->cpu_wq + cpu;
-	if (cwq->thread) {
-		/* Tell thread to exit and wait for it. */
-		cwq->thread = NULL;
-		wake_up(&cwq->more_work);
-
-		wait_for_completion(&cwq->exit);
-	}
+	spin_lock_irqsave(&cwq->lock, flags);
+	p = cwq->thread;
+	cwq->thread = NULL;
+	spin_unlock_irqrestore(&cwq->lock, flags);
+	if (p)
+		kthread_stop(p);
 }
 
 void destroy_workqueue(struct workqueue_struct *wq)
@@ -323,10 +329,14 @@
 
 	flush_workqueue(wq);
 
+	/* We don't need the distraction of CPUs appearing and vanishing. */
+	lock_cpu_hotplug();
 	for (cpu = 0; cpu < NR_CPUS; cpu++) {
 		if (cpu_online(cpu))
 			cleanup_workqueue_thread(wq, cpu);
 	}
+	list_del(&wq->list);
+	unlock_cpu_hotplug();
 	kfree(wq);
 }
 
@@ -347,6 +357,11 @@
 	flush_workqueue(keventd_wq);
 }
 
+int keventd_up(void)
+{
+	return keventd_wq != NULL;
+}
+
 int current_is_keventd(void)
 {
 	struct cpu_workqueue_struct *cwq;
@@ -362,8 +377,78 @@
 	return 0;
 }
 
+#ifdef CONFIG_HOTPLUG_CPU
+/* Take the work from this (downed) CPU. */
+static void take_over_work(struct workqueue_struct *wq, unsigned int cpu)
+{
+	struct cpu_workqueue_struct *cwq = wq->cpu_wq + cpu;
+	LIST_HEAD(list);
+	struct work_struct *work;
+
+	spin_lock_irq(&cwq->lock);
+	printk("Workqueue %s: %i\n", wq->name, list_empty(&cwq->worklist));
+	list_splice_init(&cwq->worklist, &list);
+
+	while (!list_empty(&list)) {
+		printk("Taking work for %s\n", wq->name);
+		work = list_entry(list.next,struct work_struct,entry);
+		list_del(&work->entry);
+		__queue_work(wq->cpu_wq + smp_processor_id(), work);
+	}
+	spin_unlock_irq(&cwq->lock);
+}
+
+/* We're holding the cpucontrol mutex here */
+static int __devinit workqueue_cpu_callback(struct notifier_block *nfb,
+				  unsigned long action,
+				  void *hcpu)
+{
+	unsigned int hotcpu = (unsigned long)hcpu;
+	struct workqueue_struct *wq;
+
+	switch (action) {
+	case CPU_UP_PREPARE:
+		/* Create a new workqueue thread for it. */
+		list_for_each_entry(wq, &workqueues, list) {
+			if (create_workqueue_thread(wq, hotcpu) < 0) {
+				printk("workqueue for %i failed\n", hotcpu);
+				return NOTIFY_BAD;
+			}
+		}
+		break;
+
+	case CPU_ONLINE:
+		/* Kick off worker threads. */
+		list_for_each_entry(wq, &workqueues, list)
+			wake_up_process(wq->cpu_wq[hotcpu].thread);
+		break;
+
+	case CPU_UP_CANCELED:
+		list_for_each_entry(wq, &workqueues, list) {
+			/* Unbind so it can run. */
+			kthread_bind(wq->cpu_wq[hotcpu].thread,
+				     smp_processor_id());
+			cleanup_workqueue_thread(wq, hotcpu);
+		}
+		break;
+
+	case CPU_OFFLINE:
+		list_for_each_entry(wq, &workqueues, list)
+			take_over_work(wq, hotcpu);
+		list_for_each_entry(wq, &workqueues, list)
+			cleanup_workqueue_thread(wq, hotcpu);
+		break;
+	case CPU_DEAD:
+		break;
+	}
+
+	return NOTIFY_OK;
+}
+#endif
+
 void init_workqueues(void)
 {
+	hotcpu_notifier(workqueue_cpu_callback, 0);
 	keventd_wq = create_workqueue("events");
 	BUG_ON(!keventd_wq);
 }
--- diff/lib/Makefile	2004-02-09 10:36:12.000000000 +0000
+++ source/lib/Makefile	2004-02-09 10:39:57.000000000 +0000
@@ -5,7 +5,7 @@
 
 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 \
 	 bitmap.o extable.o
 
 lib-$(CONFIG_RWSEM_GENERIC_SPINLOCK) += rwsem-spinlock.o
--- diff/lib/bitmap.c	2004-02-09 10:36:12.000000000 +0000
+++ source/lib/bitmap.c	2004-02-09 10:39:57.000000000 +0000
@@ -1,5 +1,18 @@
-#include <linux/bitmap.h>
+/*
+ * lib/bitmap.c
+ * Helper functions for bitmap.h.
+ *
+ * This source code is licensed under the GNU General Public License,
+ * Version 2.  See the file COPYING for more details.
+ */
 #include <linux/module.h>
+#include <linux/ctype.h>
+#include <linux/errno.h>
+#include <linux/bitmap.h>
+#include <asm/bitops.h>
+#include <asm/uaccess.h>
+
+#define MAX_BITMAP_BITS	512U	/* for ia64 NR_CPUS maximum */
 
 int bitmap_empty(const unsigned long *bitmap, int bits)
 {
@@ -62,8 +75,9 @@
 			const unsigned long *src, int shift, int bits)
 {
 	int k;
-	DECLARE_BITMAP(__shr_tmp, bits);
+	DECLARE_BITMAP(__shr_tmp, MAX_BITMAP_BITS);
 
+	BUG_ON(bits > MAX_BITMAP_BITS);
 	bitmap_clear(__shr_tmp, bits);
 	for (k = 0; k < bits - shift; ++k)
 		if (test_bit(k + shift, src))
@@ -76,8 +90,9 @@
 			const unsigned long *src, int shift, int bits)
 {
 	int k;
-	DECLARE_BITMAP(__shl_tmp, bits);
+	DECLARE_BITMAP(__shl_tmp, MAX_BITMAP_BITS);
 
+	BUG_ON(bits > MAX_BITMAP_BITS);
 	bitmap_clear(__shl_tmp, bits);
 	for (k = bits; k >= shift; --k)
 		if (test_bit(k - shift, src))
@@ -139,3 +154,131 @@
 #endif
 EXPORT_SYMBOL(bitmap_weight);
 
+/*
+ * Bitmap printing & parsing functions: first version by Bill Irwin,
+ * second version by Paul Jackson, third by Joe Korty.
+ */
+
+#define CHUNKSZ				32
+#define nbits_to_hold_value(val)	fls(val)
+#define roundup_power2(val,modulus)	(((val) + (modulus) - 1) & ~((modulus) - 1))
+#define unhex(c)			(isdigit(c) ? (c - '0') : (toupper(c) - 'A' + 10))
+
+/**
+ * bitmap_snprintf - convert bitmap to an ASCII hex string.
+ * @buf: byte buffer into which string is placed
+ * @buflen: reserved size of @buf, in bytes
+ * @maskp: pointer to bitmap to convert
+ * @nmaskbits: size of bitmap, in bits
+ *
+ * Exactly @nmaskbits bits are displayed.  Hex digits are grouped into
+ * comma-separated sets of eight digits per set.
+ */
+int bitmap_snprintf(char *buf, unsigned int buflen,
+	const unsigned long *maskp, int nmaskbits)
+{
+	int i, word, bit, len = 0;
+	unsigned long val;
+	const char *sep = "";
+	int chunksz;
+	u32 chunkmask;
+
+	chunksz = nmaskbits & (CHUNKSZ - 1);
+	if (chunksz == 0)
+		chunksz = CHUNKSZ;
+
+	i = roundup_power2(nmaskbits, CHUNKSZ) - CHUNKSZ;
+	for (; i >= 0; i -= CHUNKSZ) {
+		chunkmask = ((1ULL << chunksz) - 1);
+		word = i / BITS_PER_LONG;
+		bit = i % BITS_PER_LONG;
+		val = (maskp[word] >> bit) & chunkmask;
+		len += scnprintf(buf+len, buflen-len, "%s%0*lx", sep,
+			(chunksz+3)/4, val);
+		chunksz = CHUNKSZ;
+		sep = ",";
+	}
+	return len;
+}
+EXPORT_SYMBOL(bitmap_snprintf);
+
+/**
+ * bitmap_parse - convert an ASCII hex string into a bitmap.
+ * @buf: pointer to buffer in user space containing string.
+ * @buflen: buffer size in bytes.  If string is smaller than this
+ *    then it must be terminated with a \0.
+ * @maskp: pointer to bitmap array that will contain result.
+ * @nmaskbits: size of bitmap, in bits.
+ *
+ * Commas group hex digits into chunks.  Each chunk defines exactly 32
+ * bits of the resultant bitmask.  No chunk may specify a value larger
+ * than 32 bits (-EOVERFLOW), and if a chunk specifies a smaller value
+ * then leading 0-bits are prepended.  -EINVAL is returned for illegal
+ * characters and for grouping errors such as "1,,5", ",44", "," and "".
+ * Leading and trailing whitespace accepted, but not embedded whitespace.
+ */
+int bitmap_parse(const char __user *ubuf, unsigned int ubuflen,
+        unsigned long *maskp, int nmaskbits)
+{
+	int i, c, old_c, totaldigits, ndigits, nchunks, nbits;
+	u32 chunk;
+
+	bitmap_clear(maskp, nmaskbits);
+
+	nchunks = nbits = totaldigits = c = 0;
+	do {
+		chunk = ndigits = 0;
+
+		/* Get the next chunk of the bitmap */
+		while (ubuflen) {
+			old_c = c;
+			if (get_user(c, ubuf++))
+				return -EFAULT;
+			ubuflen--;
+			if (isspace(c))
+				continue;
+
+			/*
+			 * If the last character was a space and the current
+			 * character isn't '\0', we've got embedded whitespace.
+			 * This is a no-no, so throw an error.
+			 */
+			if (totaldigits && c && isspace(old_c))
+				return -EINVAL;
+
+			/* A '\0' or a ',' signal the end of the chunk */
+			if (c == '\0' || c == ',')
+				break;
+
+			if (!isxdigit(c))
+				return -EINVAL;
+
+			/*
+			 * Make sure there are at least 4 free bits in 'chunk'.
+			 * If not, this hexdigit will overflow 'chunk', so
+			 * throw an error.
+			 */
+			if (chunk & ~((1UL << (CHUNKSZ - 4)) - 1))
+				return -EOVERFLOW;
+
+			chunk = (chunk << 4) | unhex(c);
+			ndigits++; totaldigits++;
+		}
+		if (ndigits == 0)
+			return -EINVAL;
+		if (nchunks == 0 && chunk == 0)
+			continue;
+
+		bitmap_shift_right(maskp, maskp, CHUNKSZ, nmaskbits);
+		for (i = 0; i < CHUNKSZ; i++)
+			if (chunk & (1 << i))
+				set_bit(i, maskp);
+		nchunks++;
+		nbits += (nchunks == 1) ? nbits_to_hold_value(chunk) : CHUNKSZ;
+		if (nbits > nmaskbits)
+			return -EOVERFLOW;
+	} while (ubuflen && c == ',');
+
+	return 0;
+}
+EXPORT_SYMBOL(bitmap_parse);
--- diff/lib/crc32.c	2003-05-21 11:49:46.000000000 +0100
+++ source/lib/crc32.c	2004-02-09 10:39:57.000000000 +0000
@@ -99,7 +99,9 @@
 	/* Align it */
 	if(unlikely(((long)b)&3 && len)){
 		do {
-			DO_CRC(*((u8 *)b)++);
+			u8 *p = (u8 *)b;
+			DO_CRC(*p++);
+			b = (void *)p;
 		} while ((--len) && ((long)b)&3 );
 	}
 	if(likely(len >= 4)){
@@ -120,7 +122,9 @@
 	/* And the last few bytes */
 	if(len){
 		do {
-			DO_CRC(*((u8 *)b)++);
+			u8 *p = (u8 *)b;
+			DO_CRC(*p++);
+			b = (void *)p;
 		} while (--len);
 	}
 
@@ -200,7 +204,9 @@
 	/* Align it */
 	if(unlikely(((long)b)&3 && len)){
 		do {
-			DO_CRC(*((u8 *)b)++);
+			u8 *p = (u8 *)b;
+			DO_CRC(*p++);
+			b = (u32 *)p;
 		} while ((--len) && ((long)b)&3 );
 	}
 	if(likely(len >= 4)){
@@ -221,7 +227,9 @@
 	/* And the last few bytes */
 	if(len){
 		do {
-			DO_CRC(*((u8 *)b)++);
+			u8 *p = (u8 *)b;
+			DO_CRC(*p++);
+			b = (void *)p;
 		} while (--len);
 	}
 	return __be32_to_cpu(crc);
--- diff/lib/gen_crc32table.c	2003-01-02 10:43:24.000000000 +0000
+++ source/lib/gen_crc32table.c	2004-02-09 10:39:57.000000000 +0000
@@ -1,14 +1,14 @@
 #include <stdio.h>
 #include "crc32defs.h"
-#include <sys/types.h>
+#include <inttypes.h>
 
 #define ENTRIES_PER_LINE 4
 
 #define LE_TABLE_SIZE (1 << CRC_LE_BITS)
 #define BE_TABLE_SIZE (1 << CRC_BE_BITS)
 
-static u_int32_t crc32table_le[LE_TABLE_SIZE];
-static u_int32_t crc32table_be[BE_TABLE_SIZE];
+static uint32_t crc32table_le[LE_TABLE_SIZE];
+static uint32_t crc32table_be[BE_TABLE_SIZE];
 
 /**
  * crc32init_le() - allocate and initialize LE table data
@@ -20,7 +20,7 @@
 static void crc32init_le(void)
 {
 	unsigned i, j;
-	u_int32_t crc = 1;
+	uint32_t crc = 1;
 
 	crc32table_le[0] = 0;
 
@@ -37,7 +37,7 @@
 static void crc32init_be(void)
 {
 	unsigned i, j;
-	u_int32_t crc = 0x80000000;
+	uint32_t crc = 0x80000000;
 
 	crc32table_be[0] = 0;
 
@@ -48,7 +48,7 @@
 	}
 }
 
-static void output_table(u_int32_t table[], int len, char *trans)
+static void output_table(uint32_t table[], int len, char *trans)
 {
 	int i;
 
--- diff/lib/kobject.c	2004-02-09 10:36:12.000000000 +0000
+++ source/lib/kobject.c	2004-02-09 10:39:57.000000000 +0000
@@ -630,6 +630,9 @@
 EXPORT_SYMBOL(kobject_unregister);
 EXPORT_SYMBOL(kobject_get);
 EXPORT_SYMBOL(kobject_put);
+EXPORT_SYMBOL(kobject_add);
+EXPORT_SYMBOL(kobject_del);
+EXPORT_SYMBOL(kobject_rename);
 EXPORT_SYMBOL(kobject_hotplug);
 
 EXPORT_SYMBOL(kset_register);
--- diff/lib/string.c	2003-10-27 09:20:44.000000000 +0000
+++ source/lib/string.c	2004-02-09 10:39:57.000000000 +0000
@@ -18,6 +18,8 @@
  *                    Matthew Hawkins <matt@mh.dropbear.id.au>
  * -  Kissed strtok() goodbye
  */
+
+#define IN_STRING_C 1
  
 #include <linux/types.h>
 #include <linux/string.h>
@@ -437,12 +439,13 @@
  * You should not use this function to access IO space, use memcpy_toio()
  * or memcpy_fromio() instead.
  */
-void bcopy(const char * src, char * dest, int count)
+void bcopy(const void * srcp, void * destp, size_t count)
 {
-	char *tmp = dest;
+	const char *src = srcp;
+	char *dest = destp;
 
 	while (count--)
-		*tmp++ = *src++;
+		*dest++ = *src++;
 }
 #endif
 
--- diff/lib/vsprintf.c	2004-02-09 10:36:12.000000000 +0000
+++ source/lib/vsprintf.c	2004-02-09 10:39:57.000000000 +0000
@@ -12,6 +12,8 @@
 /* 
  * Fri Jul 13 2001 Crutcher Dunnavant <crutcher+kernel@datastacks.com>
  * - changed to provide snprintf and vsnprintf functions
+ * So Feb  1 16:51:32 CET 2004 Juergen Quade <quade@hsnr.de>
+ * - scnprintf and vscnprintf
  */
 
 #include <stdarg.h>
@@ -228,14 +230,22 @@
 }
 
 /**
-* vsnprintf - Format a string and place it in a buffer
-* @buf: The buffer to place the result into
-* @size: The size of the buffer, including the trailing null space
-* @fmt: The format string to use
-* @args: Arguments for the format string
-*
-* Call this function if you are already dealing with a va_list.
-* You probably want snprintf instead.
+ * vsnprintf - Format a string and place it in a buffer
+ * @buf: The buffer to place the result into
+ * @size: The size of the buffer, including the trailing null space
+ * @fmt: The format string to use
+ * @args: Arguments for the format string
+ *
+ * The return value is the number of characters which would
+ * be generated for the given input, excluding the trailing
+ * '\0', as per ISO C99. If you want to have the exact
+ * number of characters written into @buf as return value
+ * (not including the trailing '\0'), use vscnprintf. If the
+ * return is greater than or equal to @size, the resulting
+ * string is truncated.
+ *
+ * Call this function if you are already dealing with a va_list.
+ * You probably want snprintf instead.
  */
 int vsnprintf(char *buf, size_t size, const char *fmt, va_list args)
 {
@@ -477,11 +487,40 @@
 EXPORT_SYMBOL(vsnprintf);
 
 /**
+ * vscnprintf - Format a string and place it in a buffer
+ * @buf: The buffer to place the result into
+ * @size: The size of the buffer, including the trailing null space
+ * @fmt: The format string to use
+ * @args: Arguments for the format string
+ *
+ * The return value is the number of characters which have been written into
+ * the @buf not including the trailing '\0'. If @size is <= 0 the function
+ * returns 0.
+ *
+ * Call this function if you are already dealing with a va_list.
+ * You probably want scnprintf instead.
+ */
+int vscnprintf(char *buf, size_t size, const char *fmt, va_list args)
+{
+	int i;
+
+	i=vsnprintf(buf,size,fmt,args);
+	return (i >= size) ? (size - 1) : i;
+}
+
+EXPORT_SYMBOL(vscnprintf);
+
+/**
  * snprintf - Format a string and place it in a buffer
  * @buf: The buffer to place the result into
  * @size: The size of the buffer, including the trailing null space
  * @fmt: The format string to use
  * @...: Arguments for the format string
+ *
+ * The return value is the number of characters which would be
+ * generated for the given input, excluding the trailing null,
+ * as per ISO C99.  If the return is greater than or equal to
+ * @size, the resulting string is truncated.
  */
 int snprintf(char * buf, size_t size, const char *fmt, ...)
 {
@@ -497,11 +536,39 @@
 EXPORT_SYMBOL(snprintf);
 
 /**
+ * scnprintf - Format a string and place it in a buffer
+ * @buf: The buffer to place the result into
+ * @size: The size of the buffer, including the trailing null space
+ * @fmt: The format string to use
+ * @...: Arguments for the format string
+ *
+ * The return value is the number of characters written into @buf not including
+ * the trailing '\0'. If @size is <= 0 the function returns 0. If the return is
+ * greater than or equal to @size, the resulting string is truncated.
+ */
+
+int scnprintf(char * buf, size_t size, const char *fmt, ...)
+{
+	va_list args;
+	int i;
+
+	va_start(args, fmt);
+	i = vsnprintf(buf, size, fmt, args);
+	va_end(args);
+	return (i >= size) ? (size - 1) : i;
+}
+EXPORT_SYMBOL(scnprintf);
+
+/**
  * vsprintf - Format a string and place it in a buffer
  * @buf: The buffer to place the result into
  * @fmt: The format string to use
  * @args: Arguments for the format string
  *
+ * The function returns the number of characters written
+ * into @buf. Use vsnprintf or vscnprintf in order to avoid
+ * buffer overflows.
+ *
  * Call this function if you are already dealing with a va_list.
  * You probably want sprintf instead.
  */
@@ -517,6 +584,10 @@
  * @buf: The buffer to place the result into
  * @fmt: The format string to use
  * @...: Arguments for the format string
+ *
+ * The function returns the number of characters written
+ * into @buf. Use snprintf or scnprintf in order to avoid
+ * buffer overflows.
  */
 int sprintf(char * buf, const char *fmt, ...)
 {
--- diff/mm/Makefile	2003-10-09 09:47:17.000000000 +0100
+++ source/mm/Makefile	2004-02-09 10:39:57.000000000 +0000
@@ -12,3 +12,6 @@
 			   slab.o swap.o truncate.o vmscan.o $(mmu-y)
 
 obj-$(CONFIG_SWAP)	+= page_io.o swap_state.o swapfile.o
+
+obj-$(CONFIG_X86_4G) += usercopy.o
+
--- diff/mm/filemap.c	2004-02-09 10:36:12.000000000 +0000
+++ source/mm/filemap.c	2004-02-09 10:39:57.000000000 +0000
@@ -73,6 +73,9 @@
  *  ->mmap_sem
  *    ->i_sem			(msync)
  *
+ *  ->i_sem
+ *    ->i_alloc_sem             (various)
+ *
  *  ->inode_lock
  *    ->sb_lock			(fs/fs-writeback.c)
  *    ->mapping->page_lock	(__sync_single_inode)
@@ -226,6 +229,18 @@
 
 EXPORT_SYMBOL(filemap_fdatawait);
 
+int filemap_write_and_wait(struct address_space *mapping)
+{
+	int retval = 0;
+
+	if (mapping->nrpages) {
+		retval = filemap_fdatawrite(mapping);
+		if (retval == 0)
+			retval = filemap_fdatawait(mapping);
+	}
+	return retval;
+}
+
 /*
  * This adds a page to the page cache, starting out as locked, unreferenced,
  * not uptodate and with no errors.
@@ -1495,22 +1510,35 @@
 	return page;
 }
 
+/*
+ * The logic we want is
+ *
+ *	if suid or (sgid and xgrp)
+ *		remove privs
+ */
 void remove_suid(struct dentry *dentry)
 {
-	struct iattr newattrs;
-	struct inode *inode = dentry->d_inode;
-	unsigned int mode = inode->i_mode & (S_ISUID|S_ISGID|S_IXGRP);
-
-	if (!(mode & S_IXGRP))
-		mode &= S_ISUID;
-
-	/* were any of the uid bits set? */
-	if (mode && !capable(CAP_FSETID)) {
-		newattrs.ia_valid = ATTR_KILL_SUID|ATTR_KILL_SGID|ATTR_FORCE;
+	mode_t mode = dentry->d_inode->i_mode;
+	int kill = 0;
+
+	/* suid always must be killed */
+	if (unlikely(mode & S_ISUID))
+		kill = ATTR_KILL_SUID;
+
+	/*
+	 * sgid without any exec bits is just a mandatory locking mark; leave
+	 * it alone.  If some exec bits are set, it's a real sgid; kill it.
+	 */
+	if (unlikely((mode & S_ISGID) && (mode & S_IXGRP)))
+		kill |= ATTR_KILL_SGID;
+
+	if (unlikely(kill && !capable(CAP_FSETID))) {
+		struct iattr newattrs;
+
+		newattrs.ia_valid = ATTR_FORCE | kill;
 		notify_change(dentry, &newattrs);
 	}
 }
-
 EXPORT_SYMBOL(remove_suid);
 
 /*
@@ -1700,6 +1728,7 @@
 
 /*
  * Write to a file through the page cache. 
+ * Called under i_sem for S_ISREG files.
  *
  * We put everything into the page cache prior to writing it. This is not a
  * problem when writing full pages. With partial pages, however, we first have
@@ -1788,12 +1817,21 @@
 		/*
 		 * Sync the fs metadata but not the minor inode changes and
 		 * of course not the data as we did direct DMA for the IO.
+		 * i_sem is held, which protects generic_osync_inode() from
+		 * livelocking.
 		 */
 		if (written >= 0 && file->f_flags & O_SYNC)
 			status = generic_osync_inode(inode, mapping, OSYNC_METADATA);
-		if (written >= 0 && !is_sync_kiocb(iocb))
+		if (written == count && !is_sync_kiocb(iocb))
 			written = -EIOCBQUEUED;
-		goto out_status;
+		if (written < 0 || written == count)
+			goto out_status;
+		/*
+		 * direct-io write to a hole: fall through to buffered I/O
+		 * for completing the rest of the request.
+		 */
+		pos += written;
+		count -= written;
 	}
 
 	buf = iov->iov_base;
@@ -1882,6 +1920,14 @@
 					OSYNC_METADATA|OSYNC_DATA);
 	}
 	
+	/*
+	 * If we get here for O_DIRECT writes then we must have fallen through
+	 * to buffered writes (block instantiation inside i_size).  So we sync
+	 * the file data here, to try to honour O_DIRECT expectations.
+	 */
+	if (unlikely(file->f_flags & O_DIRECT) && written)
+		status = filemap_write_and_wait(mapping);
+
 out_status:	
 	err = written ? written : status;
 out:
@@ -1973,6 +2019,9 @@
 
 EXPORT_SYMBOL(generic_file_writev);
 
+/*
+ * Called under i_sem for writes to S_ISREG files
+ */
 ssize_t
 generic_file_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov,
 	loff_t offset, unsigned long nr_segs)
@@ -1981,19 +2030,29 @@
 	struct address_space *mapping = file->f_mapping;
 	ssize_t retval;
 
-	if (mapping->nrpages) {
-		retval = filemap_fdatawrite(mapping);
-		if (retval == 0)
-			retval = filemap_fdatawait(mapping);
-		if (retval)
-			goto out;
+	retval = filemap_write_and_wait(mapping);
+	if (retval == 0) {
+		retval = mapping->a_ops->direct_IO(rw, iocb, iov,
+						offset, nr_segs);
+		if (rw == WRITE && mapping->nrpages)
+			invalidate_inode_pages2(mapping);
 	}
-
-	retval = mapping->a_ops->direct_IO(rw, iocb, iov, offset, nr_segs);
-	if (rw == WRITE && mapping->nrpages)
-		invalidate_inode_pages2(mapping);
-out:
 	return retval;
 }
 
 EXPORT_SYMBOL_GPL(generic_file_direct_IO);
+
+void i_size_write_check(struct inode *inode)
+{
+	static int count = 0;
+
+	if (down_trylock(&inode->i_sem) == 0) {
+		if (count < 10) {
+			count++;
+			printk("i_size_write() called without i_sem\n");
+			dump_stack();
+		}
+		up(&inode->i_sem);
+	}
+}
+EXPORT_SYMBOL(i_size_write_check);
--- diff/mm/memory.c	2004-02-09 10:36:12.000000000 +0000
+++ source/mm/memory.c	2004-02-09 10:39:57.000000000 +0000
@@ -108,7 +108,8 @@
 	pte_free_tlb(tlb, page);
 }
 
-static inline void free_one_pgd(struct mmu_gather *tlb, pgd_t * dir)
+static inline void free_one_pgd(struct mmu_gather *tlb, pgd_t * dir,
+							int pgd_idx)
 {
 	int j;
 	pmd_t * pmd;
@@ -122,8 +123,11 @@
 	}
 	pmd = pmd_offset(dir, 0);
 	pgd_clear(dir);
-	for (j = 0; j < PTRS_PER_PMD ; j++)
+	for (j = 0; j < PTRS_PER_PMD ; j++) {
+		if (pgd_idx * PGDIR_SIZE + j * PMD_SIZE >= TASK_SIZE)
+			break;
 		free_one_pmd(tlb, pmd+j);
+	}
 	pmd_free_tlb(tlb, pmd);
 }
 
@@ -136,11 +140,13 @@
 void clear_page_tables(struct mmu_gather *tlb, unsigned long first, int nr)
 {
 	pgd_t * page_dir = tlb->mm->pgd;
+	int pgd_idx = first;
 
 	page_dir += first;
 	do {
-		free_one_pgd(tlb, page_dir);
+		free_one_pgd(tlb, page_dir, pgd_idx);
 		page_dir++;
+		pgd_idx++;
 	} while (--nr);
 }
 
@@ -438,7 +444,7 @@
 		unsigned long address, unsigned long size)
 {
 	pmd_t * pmd;
-	unsigned long end;
+	unsigned long end, pgd_boundary;
 
 	if (pgd_none(*dir))
 		return;
@@ -449,8 +455,9 @@
 	}
 	pmd = pmd_offset(dir, address);
 	end = address + size;
-	if (end > ((address + PGDIR_SIZE) & PGDIR_MASK))
-		end = ((address + PGDIR_SIZE) & PGDIR_MASK);
+	pgd_boundary = ((address + PGDIR_SIZE) & PGDIR_MASK);
+	if (pgd_boundary && (end > pgd_boundary))
+		end = pgd_boundary;
 	do {
 		zap_pte_range(tlb, pmd, address, end - address);
 		address = (address + PMD_SIZE) & PMD_MASK; 
@@ -604,6 +611,11 @@
 	might_sleep();
 
 	if (is_vm_hugetlb_page(vma)) {
+		static int x;
+		if (x < 10) {
+			x++;
+			dump_stack();
+		}
 		zap_hugepage_range(vma, address, size);
 		return;
 	}
@@ -691,6 +703,7 @@
 		struct page **pages, struct vm_area_struct **vmas)
 {
 	int i;
+	int vm_io;
 	unsigned int flags;
 
 	/* 
@@ -734,8 +747,10 @@
 			continue;
 		}
 
-		if (!vma || (pages && (vma->vm_flags & VM_IO))
-				|| !(flags & vma->vm_flags))
+		if (!vma)
+			return i ? : -EFAULT;
+		vm_io = vma->vm_flags & VM_IO;
+		if ((pages && vm_io) || !(flags & vma->vm_flags))
 			return i ? : -EFAULT;
 
 		if (is_vm_hugetlb_page(vma)) {
@@ -745,8 +760,16 @@
 		}
 		spin_lock(&mm->page_table_lock);
 		do {
-			struct page *map;
-			while (!(map = follow_page(mm, start, write))) {
+			struct page *map = NULL;
+			int lookup_write = write;
+
+			/*
+			 * We don't follow pagetables for VM_IO regions - they
+			 * may have no pageframes.
+			 */
+			if (vm_io)
+				goto no_follow;
+			while (!(map = follow_page(mm, start, lookup_write))) {
 				spin_unlock(&mm->page_table_lock);
 				switch (handle_mm_fault(mm,vma,start,write)) {
 				case VM_FAULT_MINOR:
@@ -762,6 +785,14 @@
 				default:
 					BUG();
 				}
+				/*
+				 * Now that we have performed a write fault
+				 * and surely no longer have a shared page we
+				 * shouldn't write, we shouldn't ignore an
+				 * unwritable page in the page table if
+				 * we are forcing write access.
+				 */
+				lookup_write = write && !force;
 				spin_lock(&mm->page_table_lock);
 			}
 			if (pages) {
@@ -777,6 +808,7 @@
 				if (!PageReserved(pages[i]))
 					page_cache_get(pages[i]);
 			}
+no_follow:
 			if (vmas)
 				vmas[i] = vma;
 			i++;
@@ -951,6 +983,19 @@
 EXPORT_SYMBOL(remap_page_range);
 
 /*
+ * Do pte_mkwrite, but only if the vma says VM_WRITE.  We do this when
+ * servicing faults for write access.  In the normal case, do always want
+ * pte_mkwrite.  But get_user_pages can cause write faults for mappings
+ * that do not have writing enabled, when used by access_process_vm.
+ */
+static inline pte_t maybe_mkwrite(pte_t pte, struct vm_area_struct *vma)
+{
+	if (likely(vma->vm_flags & VM_WRITE))
+		pte = pte_mkwrite(pte);
+	return pte;
+}
+
+/*
  * 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, 
@@ -959,7 +1004,8 @@
 	pte_t entry;
 
 	flush_cache_page(vma, address);
-	entry = pte_mkwrite(pte_mkdirty(mk_pte(new_page, vma->vm_page_prot)));
+	entry = maybe_mkwrite(pte_mkdirty(mk_pte(new_page, vma->vm_page_prot)),
+			      vma);
 	ptep_establish(vma, address, page_table, entry);
 	update_mmu_cache(vma, address, entry);
 }
@@ -1011,7 +1057,8 @@
 		unlock_page(old_page);
 		if (reuse) {
 			flush_cache_page(vma, address);
-			entry = pte_mkyoung(pte_mkdirty(pte_mkwrite(pte)));
+			entry = maybe_mkwrite(pte_mkyoung(pte_mkdirty(pte)),
+					      vma);
 			ptep_establish(vma, address, page_table, entry);
 			update_mmu_cache(vma, address, entry);
 			pte_unmap(page_table);
@@ -1279,7 +1326,7 @@
 	mm->rss++;
 	pte = mk_pte(page, vma->vm_page_prot);
 	if (write_access && can_share_swap_page(page))
-		pte = pte_mkdirty(pte_mkwrite(pte));
+		pte = maybe_mkwrite(pte_mkdirty(pte), vma);
 	unlock_page(page);
 
 	flush_icache_page(vma, page);
@@ -1346,7 +1393,9 @@
 			goto out;
 		}
 		mm->rss++;
-		entry = pte_mkwrite(pte_mkdirty(mk_pte(page, vma->vm_page_prot)));
+		entry = maybe_mkwrite(pte_mkdirty(mk_pte(page,
+							 vma->vm_page_prot)),
+				      vma);
 		lru_cache_add_active(page);
 		mark_page_accessed(page);
 	}
@@ -1462,7 +1511,7 @@
 		flush_icache_page(vma, new_page);
 		entry = mk_pte(new_page, vma->vm_page_prot);
 		if (write_access)
-			entry = pte_mkwrite(pte_mkdirty(entry));
+			entry = maybe_mkwrite(pte_mkdirty(entry), vma);
 		set_pte(page_table, entry);
 		pte_chain = page_add_rmap(new_page, page_table, pte_chain);
 		pte_unmap(page_table);
--- diff/mm/mmap.c	2004-02-09 10:36:12.000000000 +0000
+++ source/mm/mmap.c	2004-02-09 10:39:57.000000000 +0000
@@ -743,8 +743,9 @@
 		if (TASK_SIZE - len >= addr &&
 		    (!vma || addr + len <= vma->vm_start))
 			return addr;
-	}
-	start_addr = addr = mm->free_area_cache;
+	} else
+		addr = mm->free_area_cache;
+	start_addr = addr;
 
 full_search:
 	for (vma = find_vma(mm, addr); ; vma = vma->vm_next) {
--- diff/mm/mremap.c	2004-02-09 10:36:12.000000000 +0000
+++ source/mm/mremap.c	2004-02-09 10:39:57.000000000 +0000
@@ -346,7 +346,9 @@
 		if ((addr <= new_addr) && (addr+old_len) > new_addr)
 			goto out;
 
-		do_munmap(current->mm, new_addr, new_len);
+		ret = do_munmap(current->mm, new_addr, new_len);
+		if (ret)
+			goto out;
 	}
 
 	/*
@@ -354,9 +356,11 @@
 	 * the unnecessary pages..
 	 * do_munmap does all the needed commit accounting
 	 */
-	ret = addr;
 	if (old_len >= new_len) {
-		do_munmap(current->mm, addr+new_len, old_len - new_len);
+		ret = do_munmap(current->mm, addr+new_len, old_len - new_len);
+		if (ret && old_len != new_len)
+			goto out;
+		ret = addr;
 		if (!(flags & MREMAP_FIXED) || (new_addr == addr))
 			goto out;
 		old_len = new_len;
--- diff/mm/page-writeback.c	2004-02-09 10:36:12.000000000 +0000
+++ source/mm/page-writeback.c	2004-02-09 10:39:57.000000000 +0000
@@ -28,6 +28,7 @@
 #include <linux/smp.h>
 #include <linux/sysctl.h>
 #include <linux/cpu.h>
+#include <linux/quotaops.h>
 
 /*
  * The maximum number of pages to writeout in a single bdflush/kupdate
@@ -81,6 +82,16 @@
  */
 int dirty_expire_centisecs = 30 * 100;
 
+/*
+ * Flag that makes the machine dump writes/reads and block dirtyings.
+ */
+int block_dump;
+
+/*
+ * Flag that puts the machine in "laptop mode".
+ */
+int laptop_mode;
+
 /* End of sysctl-exported parameters */
 
 
@@ -195,7 +206,18 @@
 	if (nr_reclaimable + ps.nr_writeback <= dirty_thresh)
 		dirty_exceeded = 0;
 
-	if (!writeback_in_progress(bdi) && nr_reclaimable > background_thresh)
+	if (unlikely(laptop_mode) && pages_written > 0) {
+		/*
+		 * Schedule full writeout to happen soon. We don't postpone
+		 * previously scheduled full writeouts, otherwise a writing
+		 * process throttled by balance_dirty_pages will be able to
+		 * postpone the full writeout indefinitely, keeping the disk
+		 * spun up as a result.
+		 */
+		disk_is_spun_up(0);
+	}
+
+	if (!unlikely(laptop_mode) && !writeback_in_progress(bdi) && nr_reclaimable > background_thresh)
 		pdflush_operation(background_writeout, 0);
 }
 
@@ -328,6 +350,8 @@
 	oldest_jif = jiffies - (dirty_expire_centisecs * HZ) / 100;
 	start_jif = jiffies;
 	next_jif = start_jif + (dirty_writeback_centisecs * HZ) / 100;
+	if (laptop_mode)
+		wbc.older_than_this = NULL;
 	nr_to_write = ps.nr_dirty + ps.nr_unstable +
 			(inodes_stat.nr_inodes - inodes_stat.nr_unused);
 	while (nr_to_write > 0) {
@@ -344,6 +368,11 @@
 	}
 	if (time_before(next_jif, jiffies + HZ))
 		next_jif = jiffies + HZ;
+	if (laptop_mode) {
+		sync_inodes(0);
+		sync_filesystems(0);
+		DQUOT_SYNC(NULL);
+	}
 	if (dirty_writeback_centisecs)
 		mod_timer(&wb_timer, next_jif);
 }
@@ -364,6 +393,28 @@
 	return 0;
 }
 
+static struct timer_list laptop_mode_wb_timer;
+
+static void laptop_mode_wb_timer_fn(unsigned long unused)
+{
+	mod_timer(&wb_timer, jiffies);
+}
+
+/*
+ * We've spun up the disk and we're in laptop mode: schedule writeback
+ * of all dirty data in 5 seconds.
+ *
+ * Laptop mode writeback will be delayed if it has previously been
+ * scheduled to occur within 5 seconds. That way, the writeback will
+ * only be triggered if the system is truly quiet again.
+ */
+void disk_is_spun_up(int postpone_writeback)
+{
+	if (postpone_writeback || !timer_pending(&laptop_mode_wb_timer))
+		mod_timer(&laptop_mode_wb_timer, jiffies + 5 * HZ);
+}
+
+
 static void wb_timer_fn(unsigned long unused)
 {
 	if (pdflush_operation(wb_kupdate, 0) < 0)
@@ -435,6 +486,11 @@
 	wb_timer.data = 0;
 	wb_timer.function = wb_timer_fn;
 	add_timer(&wb_timer);
+
+	init_timer(&laptop_mode_wb_timer);
+	laptop_mode_wb_timer.data = 0;
+	laptop_mode_wb_timer.function = laptop_mode_wb_timer_fn;
+
 	set_ratelimit();
 	register_cpu_notifier(&ratelimit_nb);
 }
@@ -526,6 +582,8 @@
 				__mark_inode_dirty(mapping->host,
 							I_DIRTY_PAGES);
 		}
+		if (unlikely(block_dump))
+			printk("%s(%d): dirtied page\n", current->comm, current->pid);
 	}
 	return ret;
 }
--- diff/mm/page_alloc.c	2004-02-09 10:36:12.000000000 +0000
+++ source/mm/page_alloc.c	2004-02-09 10:39:57.000000000 +0000
@@ -35,7 +35,6 @@
 #include <asm/tlbflush.h>
 
 DECLARE_BITMAP(node_online_map, MAX_NUMNODES);
-DECLARE_BITMAP(memblk_online_map, MAX_NR_MEMBLKS);
 struct pglist_data *pgdat_list;
 unsigned long totalram_pages;
 unsigned long totalhigh_pages;
@@ -413,11 +412,13 @@
 	spin_unlock_irqrestore(&zone->lock, flags);
         return 0;
 }
+#endif /* CONFIG_PM */
 
+#if defined(CONFIG_PM) || defined(CONFIG_HOTPLUG_CPU)
 /*
  * Spill all of this CPU's per-cpu pages back into the buddy allocator.
  */
-void drain_local_pages(void)
+void drain_local_pages(unsigned int cpu)
 {
 	unsigned long flags;
 	struct zone *zone;
@@ -427,7 +428,7 @@
 	for_each_zone(zone) {
 		struct per_cpu_pageset *pset;
 
-		pset = &zone->pageset[smp_processor_id()];
+		pset = &zone->pageset[cpu];
 		for (i = 0; i < ARRAY_SIZE(pset->pcp); i++) {
 			struct per_cpu_pages *pcp;
 
@@ -438,7 +439,7 @@
 	}
 	local_irq_restore(flags);	
 }
-#endif /* CONFIG_PM */
+#endif /* CONFIG_PM || CONFIG_HOTPLUG_CPU */
 
 /*
  * Free a 0-order page
@@ -1080,7 +1081,6 @@
 	int i, j, k, node, local_node;
 
 	local_node = pgdat->node_id;
-	printk("Building zonelist for node : %d\n", local_node);
 	for (i = 0; i < MAX_NR_ZONES; i++) {
 		struct zonelist *zonelist;
 
@@ -1118,6 +1118,7 @@
 
 	for(i = 0 ; i < numnodes ; i++)
 		build_zonelists(NODE_DATA(i));
+	printk("Built %i zonelists\n", numnodes);
 }
 
 /*
@@ -1182,24 +1183,6 @@
 	printk("On node %d totalpages: %lu\n", pgdat->node_id, realtotalpages);
 }
 
-/*
- * Get space for the valid bitmap.
- */
-static void __init calculate_zone_bitmap(struct pglist_data *pgdat,
-		unsigned long *zones_size)
-{
-	unsigned long size = 0;
-	int i;
-
-	for (i = 0; i < MAX_NR_ZONES; i++)
-		size += zones_size[i];
-	size = LONG_ALIGN((size + 7) >> 3);
-	if (size) {
-		pgdat->valid_addr_bitmap = 
-			(unsigned long *)alloc_bootmem_node(pgdat, size);
-		memset(pgdat->valid_addr_bitmap, 0, size);
-	}
-}
 
 /*
  * Initially all pages are reserved - free ones are freed
@@ -1230,6 +1213,9 @@
 	memmap_init_zone((start), (size), (nid), (zone), (start_pfn))
 #endif
 
+/* dummy pages used to scan active lists */
+static struct page scan_pages[MAX_NUMNODES][MAX_NR_ZONES];
+
 /*
  * Set up the zone data structures:
  *   - mark all pages reserved
@@ -1252,6 +1238,7 @@
 		struct zone *zone = pgdat->node_zones + j;
 		unsigned long size, realsize;
 		unsigned long batch;
+		struct page *scan_page;
 
 		zone_table[NODEZONE(nid, j)] = zone;
 		realsize = size = zones_size[j];
@@ -1306,6 +1293,22 @@
 		atomic_set(&zone->refill_counter, 0);
 		zone->nr_active = 0;
 		zone->nr_inactive = 0;
+
+		/* initialize dummy page used for scanning */
+		scan_page = &scan_pages[nid][j];
+		zone->scan_page = scan_page;
+		memset(scan_page, 0, sizeof *scan_page);
+		scan_page->flags =
+			(1 << PG_locked) |
+			(1 << PG_error) |
+			(1 << PG_lru) |
+			(1 << PG_active) |
+			(1 << PG_reserved);
+		set_page_zone(scan_page, j);
+		page_cache_get(scan_page);
+		INIT_LIST_HEAD(&scan_page->list);
+		list_add(&scan_page->lru, &zone->active_list);
+
 		if (!size)
 			continue;
 
@@ -1392,9 +1395,6 @@
 	pgdat->node_mem_map = node_mem_map;
 
 	free_area_init_core(pgdat, zones_size, zholes_size);
-	memblk_set_online(node_to_memblk(nid));
-
-	calculate_zone_bitmap(pgdat, zones_size);
 }
 
 #ifndef CONFIG_DISCONTIGMEM
@@ -1558,34 +1558,27 @@
 
 #endif /* CONFIG_PROC_FS */
 
-static void __devinit init_page_alloc_cpu(int cpu)
-{
-	struct page_state *ps = &per_cpu(page_states, cpu);
-	memset(ps, 0, sizeof(*ps));
-}
-	
-static int __devinit page_alloc_cpu_notify(struct notifier_block *self, 
-				unsigned long action, void *hcpu)
+#ifdef CONFIG_HOTPLUG_CPU
+static int page_alloc_cpu_notify(struct notifier_block *self,
+				 unsigned long action, void *hcpu)
 {
 	int cpu = (unsigned long)hcpu;
-	switch(action) {
-	case CPU_UP_PREPARE:
-		init_page_alloc_cpu(cpu);
-		break;
-	default:
-		break;
+	long *count;
+
+	if (action == CPU_DEAD) {
+		/* Drain local pagecache count. */
+		count = &per_cpu(nr_pagecache_local, cpu);
+		atomic_add(*count, &nr_pagecache);
+		*count = 0;
+		drain_local_pages(cpu);
 	}
 	return NOTIFY_OK;
 }
-
-static struct notifier_block __devinitdata page_alloc_nb = {
-	.notifier_call	= page_alloc_cpu_notify,
-};
+#endif /* CONFIG_HOTPLUG_CPU */
 
 void __init page_alloc_init(void)
 {
-	init_page_alloc_cpu(smp_processor_id());
-	register_cpu_notifier(&page_alloc_nb);
+	hotcpu_notifier(page_alloc_cpu_notify, 0);
 }
 
 /*
--- diff/mm/pdflush.c	2003-10-09 09:47:17.000000000 +0100
+++ source/mm/pdflush.c	2004-02-09 10:39:57.000000000 +0000
@@ -84,6 +84,8 @@
 	unsigned long when_i_went_to_sleep;
 };
 
+static int wakeup_count = 100;
+
 static int __pdflush(struct pdflush_work *my_work)
 {
 	daemonize("pdflush");
@@ -112,7 +114,10 @@
 
 		spin_lock_irq(&pdflush_lock);
 		if (!list_empty(&my_work->list)) {
-			printk("pdflush: bogus wakeup!\n");
+			if (wakeup_count > 0) {
+				wakeup_count--;
+				printk("pdflush: bogus wakeup!\n");
+			}
 			my_work->fn = NULL;
 			continue;
 		}
@@ -182,6 +187,7 @@
 {
 	unsigned long flags;
 	int ret = 0;
+	static int poke_count = 0;
 
 	if (fn == NULL)
 		BUG();		/* Hard to diagnose if it's deferred */
@@ -190,9 +196,19 @@
 	if (list_empty(&pdflush_list)) {
 		spin_unlock_irqrestore(&pdflush_lock, flags);
 		ret = -1;
+		if (wakeup_count < 100 && poke_count < 10) {
+			printk("%s: no threads\n", __FUNCTION__);
+			dump_stack();
+			poke_count++;
+		}
 	} else {
 		struct pdflush_work *pdf;
 
+		if (wakeup_count < 100 && poke_count < 10) {
+			printk("%s: found a thread\n", __FUNCTION__);
+			dump_stack();
+			poke_count++;
+		}
 		pdf = list_entry(pdflush_list.next, struct pdflush_work, list);
 		list_del_init(&pdf->list);
 		if (list_empty(&pdflush_list))
--- diff/mm/rmap.c	2004-02-09 10:36:12.000000000 +0000
+++ source/mm/rmap.c	2004-02-09 10:39:57.000000000 +0000
@@ -171,7 +171,17 @@
 	pte_addr_t pte_paddr = ptep_to_paddr(ptep);
 	struct pte_chain *cur_pte_chain;
 
-	if (!pfn_valid(page_to_pfn(page)) || PageReserved(page))
+	if (!pfn_valid(page_to_pfn(page))) {
+		static int count;
+
+		if (count < 5) {
+			printk("%s: invalid pfn\n", __FUNCTION__);
+			count++;
+		}
+		return pte_chain;
+	}
+
+	if (PageReserved(page))
 		return pte_chain;
 
 	pte_chain_lock(page);
--- diff/mm/slab.c	2004-01-19 10:22:59.000000000 +0000
+++ source/mm/slab.c	2004-02-09 10:39:57.000000000 +0000
@@ -357,8 +357,8 @@
 #define	RED_ACTIVE	0x170FC2A5UL	/* when obj is active */
 
 /* ...and for poisoning */
-#define	POISON_BEFORE	0x5a	/* for use-uninitialised poisoning */
-#define POISON_AFTER	0x6b	/* for use-after-free poisoning */
+#define	POISON_INUSE	0x5a	/* for use-uninitialised poisoning */
+#define POISON_FREE	0x6b	/* for use-after-free poisoning */
 #define	POISON_END	0xa5	/* end-byte of poisoning */
 
 /* memory layout of objects:
@@ -521,9 +521,19 @@
 static DEFINE_PER_CPU(struct timer_list, reap_timers);
 
 static void reap_timer_fnc(unsigned long data);
-
+static void free_block (kmem_cache_t* cachep, void** objpp, int len);
 static void enable_cpucache (kmem_cache_t *cachep);
 
+static inline void ** ac_entry(struct array_cache *ac)
+{
+	return (void**)(ac+1);
+}
+
+static inline struct array_cache *ac_data(kmem_cache_t *cachep)
+{
+	return cachep->array[smp_processor_id()];
+}
+
 /* Cal the num objs, wastage, and bytes left over for a given slab size. */
 static void cache_estimate (unsigned long gfporder, size_t size,
 		 int flags, size_t *left_over, unsigned int *num)
@@ -578,27 +588,33 @@
 	}
 }
 
-/*
- * Note: if someone calls kmem_cache_alloc() on the new
- * cpu before the cpuup callback had a chance to allocate
- * the head arrays, it will oops.
- * Is CPU_ONLINE early enough?
- */
+#ifdef CONFIG_HOTPLUG_CPU
+static void stop_cpu_timer(int cpu)
+{
+	struct timer_list *rt = &per_cpu(reap_timers, cpu);
+
+	if (rt->function) {
+		del_timer_sync(rt);
+		WARN_ON(timer_pending(rt));
+		rt->function = NULL;
+	}
+}
+#endif
+
 static int __devinit cpuup_callback(struct notifier_block *nfb,
 				  unsigned long action,
 				  void *hcpu)
 {
 	long cpu = (long)hcpu;
-	struct list_head *p;
+	kmem_cache_t* cachep;
 
 	switch (action) {
 	case CPU_UP_PREPARE:
 		down(&cache_chain_sem);
-		list_for_each(p, &cache_chain) {
+		list_for_each_entry(cachep, &cache_chain, next) {
 			int memsize;
 			struct array_cache *nc;
 
-			kmem_cache_t* cachep = list_entry(p, kmem_cache_t, next);
 			memsize = sizeof(void*)*cachep->limit+sizeof(struct array_cache);
 			nc = kmalloc(memsize, GFP_KERNEL);
 			if (!nc)
@@ -618,22 +634,32 @@
 		up(&cache_chain_sem);
 		break;
 	case CPU_ONLINE:
-		if (g_cpucache_up == FULL)
-			start_cpu_timer(cpu);
+		start_cpu_timer(cpu);
 		break;
+
+#ifdef CONFIG_HOTPLUG_CPU
+	case CPU_OFFLINE:
+		stop_cpu_timer(cpu);
+		break;
+
 	case CPU_UP_CANCELED:
+	case CPU_DEAD:
 		down(&cache_chain_sem);
-
-		list_for_each(p, &cache_chain) {
+		list_for_each_entry(cachep, &cache_chain, next) {
 			struct array_cache *nc;
-			kmem_cache_t* cachep = list_entry(p, kmem_cache_t, next);
 
+			spin_lock_irq(&cachep->spinlock);
+			/* cpu is dead; no one can alloc from it. */
 			nc = cachep->array[cpu];
 			cachep->array[cpu] = NULL;
+			cachep->free_limit -= cachep->batchcount;
+			free_block(cachep, ac_entry(nc), nc->avail);
+			spin_unlock_irq(&cachep->spinlock);
 			kfree(nc);
 		}
 		up(&cache_chain_sem);
 		break;
+#endif /* CONFIG_HOTPLUG_CPU */
 	}
 	return NOTIFY_OK;
 bad:
@@ -643,16 +669,6 @@
 
 static struct notifier_block cpucache_notifier = { &cpuup_callback, NULL, 0 };
 
-static inline void ** ac_entry(struct array_cache *ac)
-{
-	return (void**)(ac+1);
-}
-
-static inline struct array_cache *ac_data(kmem_cache_t *cachep)
-{
-	return cachep->array[smp_processor_id()];
-}
-
 /* Initialisation.
  * Called after the gfp() functions have been enabled, and before smp_init().
  */
@@ -887,60 +903,105 @@
 	*(unsigned char *)(addr+size-1) = POISON_END;
 }
 
-static void *scan_poisoned_obj(unsigned char* addr, unsigned int size)
+static void dump_line(char *data, int offset, int limit)
 {
-	unsigned char *end;
-	
-	end = addr + size - 1;
-
-	for (; addr < end; addr++) {
-		if (*addr != POISON_BEFORE && *addr != POISON_AFTER)
-			return addr;
+	int i;
+	printk(KERN_ERR "%03x:", offset);
+	for (i=0;i<limit;i++) {
+		printk(" %02x", (unsigned char)data[offset+i]);
 	}
-	if (*addr != POISON_END)
-		return addr;
-	return NULL;
+	printk("\n");
 }
+#endif
 
-static void check_poison_obj(kmem_cache_t *cachep, void *objp)
+static void print_objinfo(kmem_cache_t *cachep, void *objp, int lines)
 {
-	void *end;
-	void *realobj;
-	int size = obj_reallen(cachep);
+#if DEBUG
+	int i, size;
+	char *realobj;
 
-	realobj = objp+obj_dbghead(cachep);
+	if (cachep->flags & SLAB_RED_ZONE) {
+		printk(KERN_ERR "Redzone: 0x%lx/0x%lx.\n",
+			*dbg_redzone1(cachep, objp),
+			*dbg_redzone2(cachep, objp));
+	}
 
-	end = scan_poisoned_obj(realobj, size);
-	if (end) {
-		int s;
-		printk(KERN_ERR "Slab corruption: start=%p, expend=%p, "
-				"problemat=%p\n", realobj, realobj+size-1, end);
-		if (cachep->flags & SLAB_STORE_USER) {
-			printk(KERN_ERR "Last user: [<%p>]", *dbg_userword(cachep, objp));
-			print_symbol("(%s)", (unsigned long)*dbg_userword(cachep, objp));
-			printk("\n");
-		}
-		printk(KERN_ERR "Data: ");
-		for (s = 0; s < size; s++) {
-			if (((char*)realobj)[s] == POISON_BEFORE)
-				printk(".");
-			else if (((char*)realobj)[s] == POISON_AFTER)
-				printk("*");
-			else
-				printk("%02X ", ((unsigned char*)realobj)[s]);
-		}
+	if (cachep->flags & SLAB_STORE_USER) {
+		printk(KERN_ERR "Last user: [<%p>]", *dbg_userword(cachep, objp));
+		print_symbol("(%s)", (unsigned long)*dbg_userword(cachep, objp));
 		printk("\n");
-		printk(KERN_ERR "Next: ");
-		for (; s < size + 32; s++) {
-			if (((char*)realobj)[s] == POISON_BEFORE)
-				printk(".");
-			else if (((char*)realobj)[s] == POISON_AFTER)
-				printk("*");
-			else
-				printk("%02X ", ((unsigned char*)realobj)[s]);
+	}
+	realobj = (char*)objp+obj_dbghead(cachep);
+	size = cachep->objsize;
+	for (i=0; i<size && lines;i+=16, lines--) {
+		int limit;
+		limit = 16;
+		if (i+limit > size)
+			limit = size-i;
+		dump_line(realobj, i, limit);
+	}
+#endif
+}
+
+#if DEBUG
+
+static void check_poison_obj(kmem_cache_t *cachep, void *objp)
+{
+	char *realobj;
+	int size, i;
+	int lines = 0;
+
+	realobj = (char*)objp+obj_dbghead(cachep);
+	size = obj_reallen(cachep);
+
+	for (i=0;i<size;i++) {
+		char exp = POISON_FREE;
+		if (i == size-1)
+			exp = POISON_END;
+		if (realobj[i] != exp) {
+			int limit;
+			/* Mismatch ! */
+			/* Print header */
+			if (lines == 0) {
+				printk(KERN_ERR "Slab corruption: start=%p, len=%d\n",
+						realobj, size);
+				print_objinfo(cachep, objp, 0);
+			}
+			/* Hexdump the affected line */
+			i = (i/16)*16;
+			limit = 16;
+			if (i+limit > size)
+				limit = size-i;
+			dump_line(realobj, i, limit);
+			i += 16;
+			lines++;
+			/* Limit to 5 lines */
+			if (lines > 5)
+				break;
+		}
+	}
+	if (lines != 0) {
+		/* Print some data about the neighboring objects, if they
+		 * exist:
+		 */
+		struct slab *slabp = GET_PAGE_SLAB(virt_to_page(objp));
+		int objnr;
+
+		objnr = (objp-slabp->s_mem)/cachep->objsize;
+		if (objnr) {
+			objp = slabp->s_mem+(objnr-1)*cachep->objsize;
+			realobj = (char*)objp+obj_dbghead(cachep);
+			printk(KERN_ERR "Prev obj: start=%p, len=%d\n",
+						realobj, size);
+			print_objinfo(cachep, objp, 2);
+		}
+		if (objnr+1 < cachep->num) {
+			objp = slabp->s_mem+(objnr+1)*cachep->objsize;
+			realobj = (char*)objp+obj_dbghead(cachep);
+			printk(KERN_ERR "Next obj: start=%p, len=%d\n",
+						realobj, size);
+			print_objinfo(cachep, objp, 2);
 		}
-		printk("\n");
-		slab_error(cachep, "object was modified after freeing");
 	}
 }
 #endif
@@ -1181,7 +1242,8 @@
 		cachep = NULL;
 		goto opps;
 	}
-	slab_size = L1_CACHE_ALIGN(cachep->num*sizeof(kmem_bufctl_t)+sizeof(struct slab));
+	slab_size = L1_CACHE_ALIGN(cachep->num*sizeof(kmem_bufctl_t) +
+			sizeof(struct slab));
 
 	/*
 	 * If the slab has been placed off-slab, and we have enough space then
@@ -1225,10 +1287,13 @@
 			 * the cache that's used by kmalloc(24), otherwise
 			 * the creation of further caches will BUG().
 			 */
-			cachep->array[smp_processor_id()] = &initarray_generic.cache;
+			cachep->array[smp_processor_id()] =
+					&initarray_generic.cache;
 			g_cpucache_up = PARTIAL;
 		} else {
-			cachep->array[smp_processor_id()] = kmalloc(sizeof(struct arraycache_init),GFP_KERNEL);
+			cachep->array[smp_processor_id()] =
+				kmalloc(sizeof(struct arraycache_init),
+					GFP_KERNEL);
 		}
 		BUG_ON(!ac_data(cachep));
 		ac_data(cachep)->avail = 0;
@@ -1242,7 +1307,7 @@
 	} 
 
 	cachep->lists.next_reap = jiffies + REAPTIMEOUT_LIST3 +
-					((unsigned long)cachep)%REAPTIMEOUT_LIST3;
+				((unsigned long)cachep)%REAPTIMEOUT_LIST3;
 
 	/* Need the semaphore to access the chain. */
 	down(&cache_chain_sem);
@@ -1255,16 +1320,24 @@
 		list_for_each(p, &cache_chain) {
 			kmem_cache_t *pc = list_entry(p, kmem_cache_t, next);
 			char tmp;
-			/* This happens when the module gets unloaded and doesn't
-			   destroy its slab cache and noone else reuses the vmalloc
-			   area of the module. Print a warning. */
-			if (__get_user(tmp,pc->name)) { 
-				printk("SLAB: cache with size %d has lost its name\n", 
-					pc->objsize); 
+
+			/*
+			 * This happens when the module gets unloaded and
+			 * doesn't destroy its slab cache and noone else reuses
+			 * the vmalloc area of the module. Print a warning.
+			 */
+#ifdef CONFIG_X86_UACCESS_INDIRECT
+			if (__direct_get_user(tmp,pc->name)) {
+#else
+			if (__get_user(tmp,pc->name)) {
+#endif
+				printk("SLAB: cache with size %d has lost its "
+						"name\n", pc->objsize);
 				continue; 
 			} 	
 			if (!strcmp(pc->name,name)) { 
-				printk("kmem_cache_create: duplicate cache %s\n",name); 
+				printk("kmem_cache_create: duplicate "
+						"cache %s\n",name);
 				up(&cache_chain_sem); 
 				BUG(); 
 			}	
@@ -1321,7 +1394,6 @@
 	preempt_enable();
 }
 
-static void free_block (kmem_cache_t* cachep, void** objpp, int len);
 static void drain_array_locked(kmem_cache_t* cachep,
 				struct array_cache *ac, int force);
 
@@ -1442,6 +1514,9 @@
 		return 1;
 	}
 
+	/* no cpu_online check required here since we clear the percpu
+	 * array on cpu offline and set this to NULL.
+	 */
 	for (i = 0; i < NR_CPUS; i++)
 		kfree(cachep->array[i]);
 
@@ -1493,7 +1568,7 @@
 #if DEBUG
 		/* need to poison the objs? */
 		if (cachep->flags & SLAB_POISON)
-			poison_obj(cachep, objp, POISON_BEFORE);
+			poison_obj(cachep, objp, POISON_FREE);
 		if (cachep->flags & SLAB_STORE_USER)
 			*dbg_userword(cachep, objp) = NULL;
 
@@ -1712,13 +1787,13 @@
 	if (cachep->flags & SLAB_POISON) {
 #ifdef CONFIG_DEBUG_PAGEALLOC
 		if ((cachep->objsize % PAGE_SIZE) == 0 && OFF_SLAB(cachep)) {
-			store_stackinfo(cachep, objp, POISON_AFTER);
+			store_stackinfo(cachep, objp, (unsigned long)caller);
 	       		kernel_map_pages(virt_to_page(objp), cachep->objsize/PAGE_SIZE, 0);
 		} else {
-			poison_obj(cachep, objp, POISON_AFTER);
+			poison_obj(cachep, objp, POISON_FREE);
 		}
 #else
-		poison_obj(cachep, objp, POISON_AFTER);
+		poison_obj(cachep, objp, POISON_FREE);
 #endif
 	}
 #endif
@@ -1875,7 +1950,7 @@
 #else
 		check_poison_obj(cachep, objp);
 #endif
-		poison_obj(cachep, objp, POISON_BEFORE);
+		poison_obj(cachep, objp, POISON_INUSE);
 	}
 	if (cachep->flags & SLAB_STORE_USER)
 		*dbg_userword(cachep, objp) = caller;
@@ -1890,6 +1965,15 @@
 		*dbg_redzone1(cachep, objp) = RED_ACTIVE;
 		*dbg_redzone2(cachep, objp) = RED_ACTIVE;
 	}
+	{
+		int objnr;
+		struct slab *slabp;
+
+		slabp = GET_PAGE_SLAB(virt_to_page(objp));
+
+		objnr = (objp - slabp->s_mem) / cachep->objsize;
+		slab_bufctl(slabp)[objnr] = (int)caller;
+	}
 	objp += obj_dbghead(cachep);
 	if (cachep->ctor && cachep->flags & SLAB_POISON) {
 		unsigned long	ctor_flags = SLAB_CTOR_CONSTRUCTOR;
@@ -1951,12 +2035,14 @@
 		objnr = (objp - slabp->s_mem) / cachep->objsize;
 		check_slabp(cachep, slabp);
 #if DEBUG
+#if 0
 		if (slab_bufctl(slabp)[objnr] != BUFCTL_FREE) {
 			printk(KERN_ERR "slab: double free detected in cache '%s', objp %p.\n",
 						cachep->name, objp);
 			BUG();
 		}
 #endif
+#endif
 		slab_bufctl(slabp)[objnr] = slabp->free;
 		slabp->free = objnr;
 		STATS_DEC_ACTIVE(cachep);
@@ -2522,7 +2608,8 @@
 	struct timer_list *rt = &__get_cpu_var(reap_timers);
 
 	cache_reap();
-	mod_timer(rt, jiffies + REAPTIMEOUT_CPUC + cpu);
+	if (!cpu_is_offline(cpu))
+		mod_timer(rt, jiffies + REAPTIMEOUT_CPUC + cpu);
 }
 
 #ifdef CONFIG_PROC_FS
@@ -2693,6 +2780,29 @@
 	.show	= s_show,
 };
 
+static void do_dump_slabp(kmem_cache_t *cachep)
+{
+#if DEBUG
+	struct list_head *q;
+
+	check_irq_on();
+	spin_lock_irq(&cachep->spinlock);
+	list_for_each(q,&cachep->lists.slabs_full) {
+		struct slab *slabp;
+		int i;
+		slabp = list_entry(q, struct slab, list);
+		for (i = 0; i < cachep->num; i++) {
+			unsigned long sym = slab_bufctl(slabp)[i];
+
+			printk("obj %p/%d: %p", slabp, i, (void *)sym);
+			print_symbol(" <%s>", sym);
+			printk("\n");
+		}
+	}
+	spin_unlock_irq(&cachep->spinlock);
+#endif
+}
+
 #define MAX_SLABINFO_WRITE 128
 /**
  * slabinfo_write - Tuning for the slab allocator
@@ -2733,9 +2843,11 @@
 			    batchcount < 1 ||
 			    batchcount > limit ||
 			    shared < 0) {
-				res = -EINVAL;
+				do_dump_slabp(cachep);
+				res = 0;
 			} else {
-				res = do_tune_cpucache(cachep, limit, batchcount, shared);
+				res = do_tune_cpucache(cachep, limit,
+							batchcount, shared);
 			}
 			break;
 		}
@@ -2824,14 +2936,7 @@
 			kernel_map_pages(virt_to_page(objp),
 					c->objsize/PAGE_SIZE, 1);
 
-			if (c->flags & SLAB_RED_ZONE)
-				printk("redzone: 0x%lx/0x%lx.\n",
-					*dbg_redzone1(c, objp),
-					*dbg_redzone2(c, objp));
-
-			if (c->flags & SLAB_STORE_USER)
-				printk("Last user: %p.\n",
-					*dbg_userword(c, objp));
+			print_objinfo(c, objp, 2);
 		}
 		spin_unlock_irqrestore(&c->spinlock, flags);
 
--- diff/mm/swap.c	2004-01-19 10:22:59.000000000 +0000
+++ source/mm/swap.c	2004-02-09 10:39:57.000000000 +0000
@@ -27,6 +27,9 @@
 #include <linux/module.h>
 #include <linux/percpu_counter.h>
 #include <linux/percpu.h>
+#include <linux/cpu.h>
+#include <linux/notifier.h>
+#include <linux/init.h>
 
 /* How many pages do we try to swap or page in/out together? */
 int page_cluster;
@@ -381,7 +384,43 @@
 	preempt_enable();
 }
 EXPORT_SYMBOL(vm_acct_memory);
-#endif
+
+#ifdef CONFIG_HOTPLUG_CPU
+static void lru_drain_cache(unsigned int cpu)
+{
+	struct pagevec *pvec = &per_cpu(lru_add_pvecs, cpu);
+
+	/* CPU is dead, so no locking needed. */
+	if (pagevec_count(pvec)) {
+		printk("pagevec_count for %u is %u\n",
+		       cpu, pagevec_count(pvec));
+		__pagevec_lru_add(pvec);
+	}
+	pvec = &per_cpu(lru_add_active_pvecs, cpu);
+	if (pagevec_count(pvec)) {
+		printk("active pagevec_count for %u is %u\n",
+		       cpu, pagevec_count(pvec));
+		__pagevec_lru_add_active(pvec);
+	}
+}
+
+/* Drop the CPU's cached committed space back into the central pool. */
+static int cpu_swap_callback(struct notifier_block *nfb,
+			     unsigned long action,
+			     void *hcpu)
+{
+	long *committed;
+
+	committed = &per_cpu(committed_space, (long)hcpu);
+	if (action == CPU_DEAD) {
+		atomic_add(*committed, &vm_committed_space);
+		*committed = 0;
+		lru_drain_cache((long)hcpu);
+	}
+	return NOTIFY_OK;
+}
+#endif /* CONFIG_HOTPLUG_CPU */
+#endif /* CONFIG_SMP */
 
 #ifdef CONFIG_SMP
 void percpu_counter_mod(struct percpu_counter *fbc, long amount)
@@ -420,4 +459,5 @@
 	 * Right now other parts of the system means that we
 	 * _really_ don't want to cluster much more
 	 */
+	hotcpu_notifier(cpu_swap_callback, 0);
 }
--- diff/mm/truncate.c	2003-10-09 09:47:34.000000000 +0100
+++ source/mm/truncate.c	2004-02-09 10:39:57.000000000 +0000
@@ -174,6 +174,14 @@
 		}
 		pagevec_release(&pvec);
 	}
+
+	if (lstart == 0) {
+		WARN_ON(mapping->nrpages);
+		WARN_ON(!list_empty(&mapping->clean_pages));
+		WARN_ON(!list_empty(&mapping->dirty_pages));
+		WARN_ON(!list_empty(&mapping->locked_pages));
+		WARN_ON(!list_empty(&mapping->io_pages));
+	}
 }
 
 EXPORT_SYMBOL(truncate_inode_pages);
--- diff/mm/vmalloc.c	2003-10-09 09:47:34.000000000 +0100
+++ source/mm/vmalloc.c	2004-02-09 10:39:57.000000000 +0000
@@ -114,15 +114,16 @@
 			       unsigned long size, pgprot_t prot,
 			       struct page ***pages)
 {
-	unsigned long end;
+	unsigned long base, end;
 
+	base = address & PGDIR_MASK;
 	address &= ~PGDIR_MASK;
 	end = address + size;
 	if (end > PGDIR_SIZE)
 		end = PGDIR_SIZE;
 
 	do {
-		pte_t * pte = pte_alloc_kernel(&init_mm, pmd, address);
+		pte_t * pte = pte_alloc_kernel(&init_mm, pmd, base + address);
 		if (!pte)
 			return -ENOMEM;
 		if (map_area_pte(pte, address, end - address, prot, pages))
--- diff/mm/vmscan.c	2004-02-09 10:36:12.000000000 +0000
+++ source/mm/vmscan.c	2004-02-09 10:39:57.000000000 +0000
@@ -30,6 +30,8 @@
 #include <linux/backing-dev.h>
 #include <linux/rmap-locking.h>
 #include <linux/topology.h>
+#include <linux/cpu.h>
+#include <linux/notifier.h>
 
 #include <asm/pgalloc.h>
 #include <asm/tlbflush.h>
@@ -43,14 +45,15 @@
 int vm_swappiness = 60;
 static long total_memory;
 
+#define lru_to_page(_head) (list_entry((_head)->prev, struct page, lru))
+
 #ifdef ARCH_HAS_PREFETCH
 #define prefetch_prev_lru_page(_page, _base, _field)			\
 	do {								\
 		if ((_page)->lru.prev != _base) {			\
 			struct page *prev;				\
 									\
-			prev = list_entry(_page->lru.prev,		\
-					struct page, lru);		\
+			prev = lru_to_page(&(_page)->lru);		\
 			prefetch(&prev->_field);			\
 		}							\
 	} while (0)
@@ -64,8 +67,7 @@
 		if ((_page)->lru.prev != _base) {			\
 			struct page *prev;				\
 									\
-			prev = list_entry(_page->lru.prev,		\
-					struct page, lru);		\
+			prev = lru_to_page(&(_page)->lru);		\
 			prefetchw(&prev->_field);			\
 		}							\
 	} while (0)
@@ -135,7 +137,7 @@
  *
  * We do weird things to avoid (scanned*seeks*entries) overflowing 32 bits.
  */
-static int shrink_slab(long scanned, unsigned int gfp_mask)
+static int shrink_slab(unsigned long scanned, unsigned int gfp_mask)
 {
 	struct shrinker *shrinker;
 	long pages;
@@ -147,7 +149,7 @@
 	list_for_each_entry(shrinker, &shrinker_list, list) {
 		unsigned long long delta;
 
-		delta = 4 * (scanned / shrinker->seeks);
+		delta = 4 * scanned / shrinker->seeks;
 		delta *= (*shrinker->shrinker)(0, gfp_mask);
 		do_div(delta, pages + 1);
 		shrinker->nr += delta;
@@ -243,8 +245,7 @@
  * shrink_list returns the number of reclaimed pages
  */
 static int
-shrink_list(struct list_head *page_list, unsigned int gfp_mask,
-		int *max_scan, int *nr_mapped)
+shrink_list(struct list_head *page_list, unsigned int gfp_mask, int *nr_mapped)
 {
 	struct address_space *mapping;
 	LIST_HEAD(ret_pages);
@@ -260,7 +261,7 @@
 		int may_enter_fs;
 		int referenced;
 
-		page = list_entry(page_list->prev, struct page, lru);
+		page = lru_to_page(page_list);
 		list_del(&page->lru);
 
 		if (TestSetPageLocked(page))
@@ -271,8 +272,6 @@
 			(*nr_mapped)++;
 
 		BUG_ON(PageActive(page));
-		may_enter_fs = (gfp_mask & __GFP_FS) ||
-				(PageSwapCache(page) && (gfp_mask & __GFP_IO));
 
 		if (PageWriteback(page))
 			goto keep_locked;
@@ -303,6 +302,9 @@
 		}
 #endif /* CONFIG_SWAP */
 
+		may_enter_fs = (gfp_mask & __GFP_FS) ||
+				(PageSwapCache(page) && (gfp_mask & __GFP_IO));
+
 		/*
 		 * The page is mapped into the page tables of one or more
 		 * processes. Try to unmap it here.
@@ -478,13 +480,15 @@
  */
 static int
 shrink_cache(const int nr_pages, struct zone *zone,
-		unsigned int gfp_mask, int max_scan, int *nr_mapped)
+		unsigned int gfp_mask, int max_scan, int *nr_scanned)
 {
 	LIST_HEAD(page_list);
 	struct pagevec pvec;
 	int nr_to_process;
 	int ret = 0;
 
+	*nr_scanned = 0;
+
 	/*
 	 * Try to ensure that we free `nr_pages' pages in one pass of the loop.
 	 */
@@ -495,8 +499,9 @@
 	pagevec_init(&pvec, 1);
 
 	lru_add_drain();
+again:
 	spin_lock_irq(&zone->lru_lock);
-	while (max_scan > 0 && ret < nr_pages) {
+	while (*nr_scanned < max_scan && ret < nr_pages) {
 		struct page *page;
 		int nr_taken = 0;
 		int nr_scan = 0;
@@ -504,8 +509,7 @@
 
 		while (nr_scan++ < nr_to_process &&
 				!list_empty(&zone->inactive_list)) {
-			page = list_entry(zone->inactive_list.prev,
-						struct page, lru);
+			page = lru_to_page(&zone->inactive_list);
 
 			prefetchw_prev_lru_page(page,
 						&zone->inactive_list, flags);
@@ -527,23 +531,24 @@
 		zone->pages_scanned += nr_taken;
 		spin_unlock_irq(&zone->lru_lock);
 
+		*nr_scanned += nr_scan;
 		if (nr_taken == 0)
-			goto done;
+			goto again;
 
-		max_scan -= nr_scan;
 		mod_page_state(pgscan, nr_scan);
-		nr_freed = shrink_list(&page_list, gfp_mask,
-					&max_scan, nr_mapped);
+		nr_freed = shrink_list(&page_list, gfp_mask, nr_scanned);
 		ret += nr_freed;
+
 		if (nr_freed <= 0 && list_empty(&page_list))
-			goto done;
+			goto again;
 
 		spin_lock_irq(&zone->lru_lock);
+
 		/*
 		 * Put back any unfreeable pages.
 		 */
 		while (!list_empty(&page_list)) {
-			page = list_entry(page_list.prev, struct page, lru);
+			page = lru_to_page(&page_list);
 			if (TestSetPageLRU(page))
 				BUG();
 			list_del(&page->lru);
@@ -559,11 +564,42 @@
 		}
   	}
 	spin_unlock_irq(&zone->lru_lock);
-done:
 	pagevec_release(&pvec);
 	return ret;
 }
 
+
+/* move pages from @page_list to the @spot, that should be somewhere on the
+ * @zone->active_list */
+static int
+spill_on_spot(struct zone *zone, struct list_head *page_list,
+		struct list_head *spot, struct pagevec *pvec)
+{
+	struct page *page;
+	int          moved;
+
+	moved = 0;
+	while (!list_empty(page_list)) {
+		page = lru_to_page(page_list);
+		prefetchw_prev_lru_page(page, page_list, flags);
+		if (TestSetPageLRU(page))
+			BUG();
+		BUG_ON(!PageActive(page));
+		list_move(&page->lru, spot);
+		moved++;
+		if (!pagevec_add(pvec, page)) {
+			zone->nr_active += moved;
+			moved = 0;
+			spin_unlock_irq(&zone->lru_lock);
+			__pagevec_release(pvec);
+			spin_lock_irq(&zone->lru_lock);
+		}
+	}
+	return moved;
+}
+
+
+
 /*
  * This moves pages from the active list to the inactive list.
  *
@@ -583,44 +619,25 @@
  */
 static void
 refill_inactive_zone(struct zone *zone, const int nr_pages_in,
-			struct page_state *ps, int priority)
+			struct page_state *ps)
 {
 	int pgmoved;
 	int pgdeactivate = 0;
 	int nr_pages = nr_pages_in;
 	LIST_HEAD(l_hold);	/* The pages which were snipped off */
 	LIST_HEAD(l_inactive);	/* Pages to go onto the inactive_list */
-	LIST_HEAD(l_active);	/* Pages to go onto the active_list */
+	LIST_HEAD(l_ignore);	/* Pages to be returned to the active_list */
+	LIST_HEAD(l_active);	/* Pages to go onto the head of the
+				 * active_list */
+
 	struct page *page;
+	struct page *scan;
 	struct pagevec pvec;
 	int reclaim_mapped = 0;
 	long mapped_ratio;
 	long distress;
 	long swap_tendency;
 
-	lru_add_drain();
-	pgmoved = 0;
-	spin_lock_irq(&zone->lru_lock);
-	while (nr_pages && !list_empty(&zone->active_list)) {
-		page = list_entry(zone->active_list.prev, struct page, lru);
-		prefetchw_prev_lru_page(page, &zone->active_list, flags);
-		if (!TestClearPageLRU(page))
-			BUG();
-		list_del(&page->lru);
-		if (page_count(page) == 0) {
-			/* It is currently in pagevec_release() */
-			SetPageLRU(page);
-			list_add(&page->lru, &zone->active_list);
-		} else {
-			page_cache_get(page);
-			list_add(&page->lru, &l_hold);
-			pgmoved++;
-		}
-		nr_pages--;
-	}
-	zone->nr_active -= pgmoved;
-	spin_unlock_irq(&zone->lru_lock);
-
 	/*
 	 * `distress' is a measure of how much trouble we're having reclaiming
 	 * pages.  0 -> no problems.  100 -> great trouble.
@@ -652,10 +669,63 @@
 	if (swap_tendency >= 100)
 		reclaim_mapped = 1;
 
+	scan = zone->scan_page;
+	lru_add_drain();
+	pgmoved = 0;
+	spin_lock_irq(&zone->lru_lock);
+	if (reclaim_mapped) {
+		/*
+		 * When scanning active_list with !reclaim_mapped mapped
+		 * inactive pages are left behind zone->scan_page. If zone is
+		 * switched to reclaim_mapped mode reset zone->scan_page to
+		 * the end of inactive list so that inactive mapped pages are
+		 * re-scanned.
+		 */
+		list_move_tail(&scan->lru, &zone->active_list);
+	}
+	while (nr_pages && zone->active_list.prev != zone->active_list.next) {
+		/*
+		 * if head of active list reached---wrap to the tail
+		 */
+		if (scan->lru.prev == &zone->active_list)
+			list_move_tail(&scan->lru, &zone->active_list);
+		page = lru_to_page(&scan->lru);
+		prefetchw_prev_lru_page(page, &zone->active_list, flags);
+		if (!TestClearPageLRU(page))
+			BUG();
+		list_del(&page->lru);
+		if (page_count(page) == 0) {
+			/* It is currently in pagevec_release() */
+			SetPageLRU(page);
+			list_add(&page->lru, &zone->active_list);
+		} else {
+			page_cache_get(page);
+			list_add(&page->lru, &l_hold);
+			pgmoved++;
+		}
+		nr_pages--;
+	}
+	zone->nr_active -= pgmoved;
+	spin_unlock_irq(&zone->lru_lock);
+
 	while (!list_empty(&l_hold)) {
-		page = list_entry(l_hold.prev, struct page, lru);
+		page = lru_to_page(&l_hold);
 		list_del(&page->lru);
 		if (page_mapped(page)) {
+
+			/*
+			 * Don't clear page referenced if we're not going
+			 * to use it.
+			 */
+			if (!reclaim_mapped) {
+				list_add(&page->lru, &l_ignore);
+				continue;
+			}
+
+			/*
+			 * probably it would be useful to transfer dirty bit
+			 * from pte to the @page here.
+			 */
 			pte_chain_lock(page);
 			if (page_mapped(page) && page_referenced(page)) {
 				pte_chain_unlock(page);
@@ -663,10 +733,6 @@
 				continue;
 			}
 			pte_chain_unlock(page);
-			if (!reclaim_mapped) {
-				list_add(&page->lru, &l_active);
-				continue;
-			}
 		}
 		/*
 		 * FIXME: need to consider page_count(page) here if/when we
@@ -684,7 +750,7 @@
 	pgmoved = 0;
 	spin_lock_irq(&zone->lru_lock);
 	while (!list_empty(&l_inactive)) {
-		page = list_entry(l_inactive.prev, struct page, lru);
+		page = lru_to_page(&l_inactive);
 		prefetchw_prev_lru_page(page, &l_inactive, flags);
 		if (TestSetPageLRU(page))
 			BUG();
@@ -711,23 +777,9 @@
 		spin_lock_irq(&zone->lru_lock);
 	}
 
-	pgmoved = 0;
-	while (!list_empty(&l_active)) {
-		page = list_entry(l_active.prev, struct page, lru);
-		prefetchw_prev_lru_page(page, &l_active, flags);
-		if (TestSetPageLRU(page))
-			BUG();
-		BUG_ON(!PageActive(page));
-		list_move(&page->lru, &zone->active_list);
-		pgmoved++;
-		if (!pagevec_add(&pvec, page)) {
+	pgmoved = spill_on_spot(zone, &l_active, &zone->active_list, &pvec);
 			zone->nr_active += pgmoved;
-			pgmoved = 0;
-			spin_unlock_irq(&zone->lru_lock);
-			__pagevec_release(&pvec);
-			spin_lock_irq(&zone->lru_lock);
-		}
-	}
+	pgmoved = spill_on_spot(zone, &l_ignore, &scan->lru, &pvec);
 	zone->nr_active += pgmoved;
 	spin_unlock_irq(&zone->lru_lock);
 	pagevec_release(&pvec);
@@ -742,41 +794,49 @@
  * direct reclaim.
  */
 static int
-shrink_zone(struct zone *zone, int max_scan, unsigned int gfp_mask,
-	const int nr_pages, int *nr_mapped, struct page_state *ps, int priority)
+shrink_zone(struct zone *zone, unsigned int gfp_mask,
+	int nr_pages, int *nr_scanned, struct page_state *ps, int priority)
 {
-	unsigned long ratio;
+	unsigned long imbalance;
+	unsigned long nr_refill_inact;
+	unsigned long max_scan;
 
 	/*
 	 * Try to keep the active list 2/3 of the size of the cache.  And
 	 * make sure that refill_inactive is given a decent number of pages.
 	 *
-	 * The "ratio+1" here is important.  With pagecache-intensive workloads
-	 * the inactive list is huge, and `ratio' evaluates to zero all the
-	 * time.  Which pins the active list memory.  So we add one to `ratio'
-	 * just to make sure that the kernel will slowly sift through the
-	 * active list.
+	 * Keeping imbalance > 0 is important.  With pagecache-intensive loads
+	 * the inactive list is huge, and imbalance evaluates to zero all the
+	 * time which would pin the active list memory.
 	 */
-	ratio = (unsigned long)nr_pages * zone->nr_active /
-				((zone->nr_inactive | 1) * 2);
-	atomic_add(ratio+1, &zone->refill_counter);
-	if (atomic_read(&zone->refill_counter) > SWAP_CLUSTER_MAX) {
-		int count;
+	if (zone->nr_active >= zone->nr_inactive * 4) {
+		/* ratio will be >= 2 */
+		imbalance = 8*nr_pages;
+	} else if (zone->nr_active >= zone->nr_inactive * 2) {
+		/* 1 < ratio < 2 */
+		imbalance = 4 * nr_pages*zone->nr_active /
+				(zone->nr_inactive * 2 + 1);
+	} else {
+		imbalance = nr_pages / 2;
+	}
 
-		/*
-		 * Don't try to bring down too many pages in one attempt.
-		 * If this fails, the caller will increase `priority' and
-		 * we'll try again, with an increased chance of reclaiming
-		 * mapped memory.
-		 */
-		count = atomic_read(&zone->refill_counter);
-		if (count > SWAP_CLUSTER_MAX * 4)
-			count = SWAP_CLUSTER_MAX * 4;
-		atomic_set(&zone->refill_counter, 0);
-		refill_inactive_zone(zone, count, ps, priority);
+	imbalance++;
+
+	nr_refill_inact = atomic_read(&zone->refill_counter) + imbalance;
+	if (nr_refill_inact > SWAP_CLUSTER_MAX) {
+		refill_inactive_zone(zone, nr_refill_inact, ps);
+		nr_refill_inact = 0;
 	}
-	return shrink_cache(nr_pages, zone, gfp_mask,
-				max_scan, nr_mapped);
+	atomic_set(&zone->refill_counter, nr_refill_inact);
+
+	/*
+	 * Now pull pages from the inactive list
+	 */
+	max_scan = zone->nr_inactive >> priority;
+	if (max_scan < nr_pages * 2)
+		max_scan = nr_pages * 2;
+
+	return shrink_cache(nr_pages, zone, gfp_mask, max_scan, nr_scanned);
 }
 
 /*
@@ -805,8 +865,7 @@
 	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;
+		int nr_scanned;
 
 		if (zone->free_pages < zone->pages_high)
 			zone->temp_priority = priority;
@@ -814,16 +873,9 @@
 		if (zone->all_unreclaimable && priority != DEF_PRIORITY)
 			continue;	/* Let kswapd poll it */
 
-		/*
-		 * If we cannot reclaim `nr_pages' pages by scanning twice
-		 * that many pages then fall back to the next zone.
-		 */
-		max_scan = zone->nr_inactive >> priority;
-		if (max_scan < to_reclaim * 2)
-			max_scan = to_reclaim * 2;
-		ret += shrink_zone(zone, max_scan, gfp_mask,
-				to_reclaim, &nr_mapped, ps, priority);
-		*total_scanned += max_scan + nr_mapped;
+		ret += shrink_zone(zone, gfp_mask,
+				to_reclaim, &nr_scanned, ps, priority);
+		*total_scanned += nr_scanned;
 		if (ret >= nr_pages)
 			break;
 	}
@@ -869,31 +921,44 @@
 		get_page_state(&ps);
 		nr_reclaimed += shrink_caches(zones, priority, &total_scanned,
 						gfp_mask, nr_pages, &ps);
+
+		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;
+				reclaim_state->reclaimed_slab = 0;
+			}
+		}
+
 		if (nr_reclaimed >= nr_pages) {
 			ret = 1;
+			if (gfp_mask & __GFP_FS)
+				wakeup_bdflush(total_scanned);
 			goto out;
 		}
+
+		/* Don't stall on the first run - it might be bad luck */
+		if (likely(priority == DEF_PRIORITY))
+			continue;
+
+		/* Let the caller handle it */
 		if (!(gfp_mask & __GFP_FS))
-			break;		/* Let the caller handle it */
+			goto out;
+
 		/*
-		 * Try to write back as many pages as we just scanned.  Not
-		 * sure if that makes sense, but it's an attempt to avoid
-		 * creating IO storms unnecessarily
+		 * Try to write back as many pages as we just scanned.
+		 * Not sure if that makes sense, but it's an attempt
+		 * to avoid creating IO storms unnecessarily
 		 */
 		wakeup_bdflush(total_scanned);
 
 		/* Take a nap, wait for some writeback to complete */
 		blk_congestion_wait(WRITE, HZ/10);
-		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;
-				reclaim_state->reclaimed_slab = 0;
-			}
-		}
 	}
-	if ((gfp_mask & __GFP_FS) && !(gfp_mask & __GFP_NORETRY))
+
+	if (!(gfp_mask & __GFP_NORETRY))
 		out_of_memory();
+
 out:
 	for (i = 0; zones[i] != 0; i++)
 		zones[i]->prev_priority = zones[i]->temp_priority;
@@ -938,42 +1003,45 @@
 
 		for (i = 0; i < pgdat->nr_zones; i++) {
 			struct zone *zone = pgdat->node_zones + i;
-			int nr_mapped = 0;
-			int max_scan;
+			int nr_scanned;
 			int to_reclaim;
+			int reclaimed;
 
 			if (zone->all_unreclaimable && priority != DEF_PRIORITY)
 				continue;
 
-			if (nr_pages && to_free > 0) {	/* Software suspend */
+			if (nr_pages) {		/* Software suspend */
 				to_reclaim = min(to_free, SWAP_CLUSTER_MAX*8);
-			} else {			/* Zone balancing */
+			} else {		/* Zone balancing */
 				to_reclaim = zone->pages_high-zone->free_pages;
 				if (to_reclaim <= 0)
 					continue;
 			}
-			zone->temp_priority = priority;
 			all_zones_ok = 0;
-			max_scan = zone->nr_inactive >> priority;
-			if (max_scan < to_reclaim * 2)
-				max_scan = to_reclaim * 2;
-			if (max_scan < SWAP_CLUSTER_MAX)
-				max_scan = SWAP_CLUSTER_MAX;
-			to_free -= shrink_zone(zone, max_scan, GFP_KERNEL,
-					to_reclaim, &nr_mapped, ps, priority);
+			zone->temp_priority = priority;
+			reclaimed = shrink_zone(zone, GFP_KERNEL,
+					to_reclaim, &nr_scanned, ps, priority);
 			if (i < ZONE_HIGHMEM) {
 				reclaim_state->reclaimed_slab = 0;
-				shrink_slab(max_scan + nr_mapped, GFP_KERNEL);
-				to_free -= reclaim_state->reclaimed_slab;
+				shrink_slab(nr_scanned, GFP_KERNEL);
+				reclaimed += reclaim_state->reclaimed_slab;
 			}
+			to_free -= reclaimed;
 			if (zone->all_unreclaimable)
 				continue;
 			if (zone->pages_scanned > zone->present_pages * 2)
 				zone->all_unreclaimable = 1;
 		}
+		if (nr_pages && to_free > 0)
+			continue;	/* swsusp: need to do more work */
 		if (all_zones_ok)
-			break;
-		if (to_free > 0)
+			break;		/* kswapd: all done */
+		/*
+		 * OK, kswapd is getting into trouble.  Take a nap, then take
+		 * another pass across the zones. Don't stall on the first
+		 * pass.
+		 */
+		if (priority < DEF_PRIORITY)
 			blk_congestion_wait(WRITE, HZ/10);
 	}
 
@@ -1084,13 +1152,54 @@
 }
 #endif
 
+#ifdef CONFIG_HOTPLUG_CPU
+/* It's optimal to keep kswapds on the same CPUs as their memory, but
+   not required for correctness.  So if the last cpu in a node goes
+   away, let them run anywhere, and as the first one comes back,
+   restore their cpu bindings. */
+static int __devinit cpu_callback(struct notifier_block *nfb,
+				  unsigned long action,
+				  void *hcpu)
+{
+	pg_data_t *pgdat;
+	unsigned int hotcpu = (unsigned long)hcpu;
+	cpumask_t mask;
+
+	if (action == CPU_OFFLINE) {
+		/* Make sure that kswapd never becomes unschedulable. */
+		for_each_pgdat(pgdat) {
+			mask = node_to_cpumask(pgdat->node_id);
+			if (any_online_cpu(mask) == NR_CPUS) {
+				cpus_complement(mask);
+				set_cpus_allowed(pgdat->kswapd, mask);
+			}
+		}
+	}
+
+	if (action == CPU_ONLINE) {
+		for_each_pgdat(pgdat) {
+			mask = node_to_cpumask(pgdat->node_id);
+			cpu_clear(hotcpu, mask);
+			if (any_online_cpu(mask) == NR_CPUS) {
+				cpu_set(hotcpu, mask);
+				/* One of our CPUs came back: restore mask */
+				set_cpus_allowed(pgdat->kswapd, mask);
+			}
+		}
+	}
+	return NOTIFY_OK;
+}
+#endif /* CONFIG_HOTPLUG_CPU */
+
 static int __init kswapd_init(void)
 {
 	pg_data_t *pgdat;
 	swap_setup();
 	for_each_pgdat(pgdat)
-		kernel_thread(kswapd, pgdat, CLONE_KERNEL);
+		pgdat->kswapd
+		= find_task_by_pid(kernel_thread(kswapd, pgdat, CLONE_KERNEL));
 	total_memory = nr_free_pagecache_pages();
+	hotcpu_notifier(cpu_callback, 0);
 	return 0;
 }
 
--- diff/net/8021q/vlan.c	2003-10-09 09:47:34.000000000 +0100
+++ source/net/8021q/vlan.c	2004-02-09 10:39:57.000000000 +0000
@@ -566,7 +566,7 @@
 	goto out_put_dev;
 
 out_free_newdev:
-	kfree(new_dev);
+	free_netdev(new_dev);
 
 out_unlock:
 	rtnl_unlock();
--- diff/net/Kconfig	2003-11-25 15:24:59.000000000 +0000
+++ source/net/Kconfig	2004-02-09 10:39:57.000000000 +0000
@@ -32,8 +32,7 @@
 	  to work, choose Y.
 
 	  To compile this driver as a module, choose M here: the module will
-	  be called af_packet. If you use modprobe or kmod, you may also
-	  want to add "alias net-pf-17 af_packet" to /etc/modules.conf.
+	  be called af_packet.
 
 	  If unsure, say Y.
 
@@ -67,11 +66,8 @@
 	  want to say Y here.
 
 	  To compile this driver as a module, choose M here: the module will be
-	  called unix.  If you try building this as a module and you have
-	  said Y to "Kernel module loader support" above, be sure to add
-	  'alias net-pf-1 unix' to your /etc/modules.conf file. Note that
-	  several important services won't work correctly if you say M here
-	  and then neglect to load the module.
+	  called unix.  Note that several important services won't work
+	  correctly if you say M here and then neglect to load the module.
 
 	  Say Y unless you know what you are doing.
 
@@ -127,9 +123,7 @@
 	  in the kernel source.
 
 	  To compile this protocol support as a module, choose M here: the 
-	  module will be called ipv6.  If you try building this as a module 
-	  and you have said Y to "Kernel module loader support" above, 
-	  be sure to add 'alias net-pf-10 ipv6' to your /etc/modules.conf file.
+	  module will be called ipv6.
 
 	  It is safe to say N here for now.
 
@@ -664,4 +658,19 @@
 
 source "net/bluetooth/Kconfig"
 
+config KGDBOE
+	def_bool X86 && KGDB
+
+config NETPOLL
+	def_bool NETCONSOLE || KGDBOE
+
+config NETPOLL_RX
+	def_bool KGDBOE
+
+config NETPOLL_TRAP
+	def_bool KGDBOE
+
+config NET_POLL_CONTROLLER
+	def_bool NETPOLL
+
 endmenu
--- diff/net/appletalk/ddp.c	2004-02-09 10:36:12.000000000 +0000
+++ source/net/appletalk/ddp.c	2004-02-09 10:39:57.000000000 +0000
@@ -1051,7 +1051,7 @@
 	sk = sk_alloc(PF_APPLETALK, GFP_KERNEL, 1, NULL);
 	if (!sk)
 		goto out;
-	at = at_sk(sk) = kmalloc(sizeof(*at), GFP_KERNEL);
+	at = sk->sk_protinfo = kmalloc(sizeof(*at), GFP_KERNEL);
 	if (!at)
 		goto outsk;
 	memset(at, 0, sizeof(*at));
--- diff/net/atm/clip.c	2004-02-09 10:36:12.000000000 +0000
+++ source/net/atm/clip.c	2004-02-09 10:39:57.000000000 +0000
@@ -563,32 +563,20 @@
 }
 
 
-static int clip_init(struct net_device *dev)
+static void clip_setup(struct net_device *dev)
 {
-	DPRINTK("clip_init %s\n",dev->name);
 	dev->hard_start_xmit = clip_start_xmit;
 	/* sg_xmit ... */
-	dev->hard_header = NULL;
-	dev->rebuild_header = NULL;
-	dev->set_mac_address = NULL;
-	dev->hard_header_parse = NULL;
-	dev->hard_header_cache = NULL;
-	dev->header_cache_update = NULL;
-	dev->change_mtu = NULL;
-	dev->do_ioctl = NULL;
 	dev->get_stats = clip_get_stats;
 	dev->type = ARPHRD_ATM;
 	dev->hard_header_len = RFC1483LLC_LEN;
 	dev->mtu = RFC1626_MTU;
-	dev->addr_len = 0;
 	dev->tx_queue_len = 100; /* "normal" queue (packets) */
 	    /* When using a "real" qdisc, the qdisc determines the queue */
 	    /* length. tx_queue_len is only used for the default case, */
 	    /* without any more elaborate queuing. 100 is a reasonable */
 	    /* compromise between decent burst-tolerance and protection */
 	    /* against memory hogs. */
-	dev->flags = 0;
-	return 0;
 }
 
 
@@ -608,18 +596,16 @@
 			if (PRIV(dev)->number >= number)
 				number = PRIV(dev)->number+1;
 	}
-	dev = kmalloc(sizeof(struct net_device)+sizeof(struct clip_priv),
-	    GFP_KERNEL); 
-	if (!dev) return -ENOMEM;
-	memset(dev,0,sizeof(struct net_device)+sizeof(struct clip_priv));
+	dev = alloc_netdev(sizeof(struct clip_priv), "", clip_setup);
+	if (!dev)
+		return -ENOMEM;
 	clip_priv = PRIV(dev);
 	sprintf(dev->name,"atm%d",number);
-	dev->init = clip_init;
 	spin_lock_init(&clip_priv->xoff_lock);
 	clip_priv->number = number;
 	error = register_netdev(dev);
 	if (error) {
-		kfree(dev);
+		free_netdev(dev);
 		return error;
 	}
 	clip_priv->next = clip_devs;
@@ -634,7 +620,7 @@
 {
 	/* ignore non-CLIP devices */
 	if (((struct net_device *) dev)->type != ARPHRD_ATM ||
-	    ((struct net_device *) dev)->init != clip_init)
+	    ((struct net_device *) dev)->hard_start_xmit != clip_start_xmit)
 		return NOTIFY_DONE;
 	switch (event) {
 		case NETDEV_UP:
@@ -843,7 +829,7 @@
 	    !clip_vcc || clip_vcc->encap ? "LLC" : "NULL",
 	    (jiffies-(clip_vcc ? clip_vcc->last_use : entry->neigh->used))/HZ);
 
-	off = snprintf(buf, sizeof(buf) - 1, "%d.%d.%d.%d", NIPQUAD(entry->ip));
+	off = scnprintf(buf, sizeof(buf) - 1, "%d.%d.%d.%d", NIPQUAD(entry->ip));
 	while (off < 16)
 		buf[off++] = ' ';
 	buf[off] = '\0';
--- diff/net/atm/common.c	2004-02-09 10:36:12.000000000 +0000
+++ source/net/atm/common.c	2004-02-09 10:39:57.000000000 +0000
@@ -148,7 +148,7 @@
 	sk->sk_state_change = vcc_def_wakeup;
 	sk->sk_write_space = vcc_write_space;
 
-	vcc = atm_sk(sk) = kmalloc(sizeof(*vcc), GFP_KERNEL);
+	vcc = sk->sk_protinfo = kmalloc(sizeof(*vcc), GFP_KERNEL);
 	if (!vcc) {
 		sk_free(sk);
 		return -ENOMEM;
--- diff/net/atm/lec.c	2003-09-30 15:46:21.000000000 +0100
+++ source/net/atm/lec.c	2004-02-09 10:39:57.000000000 +0000
@@ -798,7 +798,7 @@
                         return -ENOMEM;
                 snprintf(dev_lec[i]->name, IFNAMSIZ, "lec%d", i);
                 if (register_netdev(dev_lec[i])) {
-                        kfree(dev_lec[i]);
+                        free_netdev(dev_lec[i]);
                         return -EINVAL;
                 }
 
--- diff/net/ax25/af_ax25.c	2004-02-09 10:36:12.000000000 +0000
+++ source/net/ax25/af_ax25.c	2004-02-09 10:39:57.000000000 +0000
@@ -816,7 +816,7 @@
 	if ((sk = sk_alloc(PF_AX25, GFP_ATOMIC, 1, NULL)) == NULL)
 		return -ENOMEM;
 
-	ax25 = ax25_sk(sk) = ax25_create_cb();
+	ax25 = sk->sk_protinfo = ax25_create_cb();
 	if (!ax25) {
 		sk_free(sk);
 		return -ENOMEM;
@@ -901,7 +901,7 @@
 		memcpy(ax25->digipeat, oax25->digipeat, sizeof(ax25_digi));
 	}
 
-	ax25_sk(sk) = ax25;
+	sk->sk_protinfo = ax25;
 	ax25->sk    = sk;
 
 	return sk;
--- diff/net/bluetooth/bnep/core.c	2004-02-09 10:36:12.000000000 +0000
+++ source/net/bluetooth/bnep/core.c	2004-02-09 10:39:57.000000000 +0000
@@ -501,7 +501,7 @@
 	__bnep_unlink_session(s);
 
 	up_write(&bnep_session_sem);
-	kfree(dev);
+	free_netdev(dev);
 	return 0;
 }
 
@@ -588,7 +588,7 @@
 
 failed:
 	up_write(&bnep_session_sem);
-	kfree(dev);
+	free_netdev(dev);
 	return err;
 }
 
--- diff/net/bridge/br_if.c	2004-02-09 10:36:12.000000000 +0000
+++ source/net/bridge/br_if.c	2004-02-09 10:39:57.000000000 +0000
@@ -172,7 +172,7 @@
 
 	ret = register_netdev(br->dev);
 	if (ret)
-		kfree(br->dev);
+		free_netdev(br->dev);
 	return ret;
 }
 
--- diff/net/core/Makefile	2003-09-17 12:28:12.000000000 +0100
+++ source/net/core/Makefile	2004-02-09 10:39:57.000000000 +0000
@@ -13,3 +13,4 @@
 obj-$(CONFIG_NET_DIVERT) += dv.o
 obj-$(CONFIG_NET_PKTGEN) += pktgen.o
 obj-$(CONFIG_NET_RADIO) += wireless.o
+obj-$(CONFIG_NETPOLL) += netpoll.o
--- diff/net/core/dev.c	2004-02-09 10:36:12.000000000 +0000
+++ source/net/core/dev.c	2004-02-09 10:39:57.000000000 +0000
@@ -105,6 +105,8 @@
 #include <linux/kmod.h>
 #include <linux/module.h>
 #include <linux/kallsyms.h>
+#include <linux/cpu.h>
+#include <linux/netpoll.h>
 #ifdef CONFIG_NET_RADIO
 #include <linux/wireless.h>		/* Note : will define WIRELESS_EXT */
 #include <net/iw_handler.h>
@@ -371,6 +373,30 @@
 	return 0;
 }
 
+
+/**
+ *	netdev_boot_base	- get address from boot time settings
+ *	@prefix: prefix for network device
+ *	@unit: id for network device
+ *
+ * 	Check boot time settings for the base address of device.
+ *	The found settings are set for the device to be used
+ *	later in the device probing.
+ *	Returns 0 if no settings found.
+ */
+unsigned long netdev_boot_base(const char *prefix, int unit)
+{
+	const struct netdev_boot_setup *s = dev_boot_setup;
+	char name[IFNAMSIZ];
+	int i;
+
+	sprintf(name, "%s%d", prefix, unit);
+	for (i = 0; i < NETDEV_BOOT_SETUP_MAX; i++)
+		if (!strcmp(name, s[i].name))
+			return s[i].map.base_addr;
+	return 0;
+}
+
 /*
  * Saves at boot time configured settings for any netdevice.
  */
@@ -1448,7 +1474,6 @@
 }
 #endif
 
-
 /**
  *	netif_rx	-	post buffer to the network code
  *	@skb: buffer to post
@@ -1473,6 +1498,13 @@
 	struct softnet_data *queue;
 	unsigned long flags;
 
+#ifdef CONFIG_NETPOLL_RX
+	if (skb->dev->netpoll_rx && netpoll_rx(skb)) {
+		kfree_skb(skb);
+		return NET_RX_DROP;
+	}
+#endif
+
 	if (!skb->stamp.tv_sec)
 		do_gettimeofday(&skb->stamp);
 
@@ -1628,6 +1660,13 @@
 	int ret = NET_RX_DROP;
 	unsigned short type = skb->protocol;
 
+#ifdef CONFIG_NETPOLL_RX
+	if (skb->dev->netpoll_rx && skb->dev->poll && netpoll_rx(skb)) {
+		kfree_skb(skb);
+		return NET_RX_DROP;
+	}
+#endif
+
 	if (!skb->stamp.tv_sec)
 		do_gettimeofday(&skb->stamp);
 
@@ -1752,7 +1791,6 @@
 	unsigned long start_time = jiffies;
 	int budget = netdev_max_backlog;
 
-	
 	preempt_disable();
 	local_irq_disable();
 
@@ -1779,6 +1817,10 @@
 			dev_put(dev);
 			local_irq_disable();
 		}
+
+#ifdef CONFIG_KGDBOE
+		kgdb_process_breakpoint();
+#endif
 	}
 out:
 	local_irq_enable();
@@ -2936,7 +2978,7 @@
 {
 	/*  Compatiablity with error handling in drivers */
 	if (dev->reg_state == NETREG_UNINITIALIZED) {
-		kfree(dev);
+		kfree((char *)dev - dev->padded);
 		return;
 	}
 
@@ -3039,6 +3081,52 @@
 	return 0;
 }
 
+#ifdef CONFIG_HOTPLUG_CPU
+static int dev_cpu_callback(struct notifier_block *nfb,
+			    unsigned long action,
+			    void *ocpu)
+{
+	struct sk_buff **list_skb;
+	struct net_device **list_net;
+	struct sk_buff *skb;
+	unsigned int cpu, oldcpu = (unsigned long)ocpu;
+	struct softnet_data *sd, *oldsd;
+
+	if (action != CPU_DEAD)
+		return NOTIFY_OK;
+
+	local_irq_disable();
+	cpu = smp_processor_id();
+	sd = &per_cpu(softnet_data, cpu);
+	oldsd = &per_cpu(softnet_data, oldcpu);
+
+	/* Find end of our completion_queue. */
+	list_skb = &sd->completion_queue;
+	while (*list_skb)
+		list_skb = &(*list_skb)->next;
+	/* Append completion queue from offline CPU. */
+	*list_skb = oldsd->completion_queue;
+	oldsd->completion_queue = NULL;
+
+	/* Find end of our output_queue. */
+	list_net = &sd->output_queue;
+	while (*list_net)
+		list_net = &(*list_net)->next_sched;
+	/* Append output queue from offline CPU. */
+	*list_net = oldsd->output_queue;
+	oldsd->output_queue = NULL;
+
+	raise_softirq_irqoff(NET_TX_SOFTIRQ);
+	local_irq_enable();
+
+	/* Process offline CPU's input_pkt_queue */
+	while ((skb = __skb_dequeue(&oldsd->input_pkt_queue)))
+		netif_rx(skb);
+
+	return NOTIFY_OK;
+}
+#endif /* CONFIG_HOTPLUG_CPU */
+
 
 /*
  *	Initialize the DEV module. At boot time this walks the device list and
@@ -3103,6 +3191,7 @@
 #ifdef CONFIG_NET_SCHED
 	pktsched_init();
 #endif
+	hotcpu_notifier(dev_cpu_callback, 0);
 	rc = 0;
 out:
 	return rc;
--- diff/net/core/flow.c	2004-02-09 10:36:12.000000000 +0000
+++ source/net/core/flow.c	2004-02-09 10:39:57.000000000 +0000
@@ -283,10 +283,11 @@
 void flow_cache_flush(void)
 {
 	struct flow_flush_info info;
+	static DECLARE_MUTEX(flow_flush_sem);
 
-	/* Don't want cpus going down or up during this, also protects
-	 * against multiple callers. */
+	/* Don't want cpus going down or up during this. */
 	lock_cpu_hotplug();
+	down(&flow_flush_sem);
 	atomic_set(&info.cpuleft, num_online_cpus());
 	init_completion(&info.completion);
 
@@ -296,6 +297,7 @@
 	local_bh_enable();
 
 	wait_for_completion(&info.completion);
+	up(&flow_flush_sem);
 	unlock_cpu_hotplug();
 }
 
@@ -324,6 +326,17 @@
 	tasklet_init(tasklet, flow_cache_flush_tasklet, 0);
 }
 
+#ifdef CONFIG_HOTPLUG_CPU
+static int flow_cache_cpu(struct notifier_block *nfb,
+			  unsigned long action,
+			  void *hcpu)
+{
+	if (action == CPU_DEAD)
+		__flow_cache_shrink((unsigned long)hcpu, 0);
+	return NOTIFY_OK;
+}
+#endif /* CONFIG_HOTPLUG_CPU */
+
 static int __init flow_cache_init(void)
 {
 	int i;
@@ -348,6 +361,7 @@
 	for_each_cpu(i)
 		flow_cache_cpu_prepare(i);
 
+	hotcpu_notifier(flow_cache_cpu, 0);
 	return 0;
 }
 
--- diff/net/core/net-sysfs.c	2003-10-27 09:20:44.000000000 +0000
+++ source/net/core/net-sysfs.c	2004-02-09 10:39:57.000000000 +0000
@@ -372,7 +372,7 @@
 
 	BUG_ON(dev->reg_state != NETREG_RELEASED);
 
-	kfree(dev);
+	kfree((char *)dev - dev->padded);
 }
 
 static struct class net_class = {
--- diff/net/core/sysctl_net_core.c	2004-01-19 10:22:59.000000000 +0000
+++ source/net/core/sysctl_net_core.c	2004-02-09 10:39:57.000000000 +0000
@@ -155,8 +155,7 @@
 		.data		= &net_msg_burst,
 		.maxlen		= sizeof(int),
 		.mode		= 0644,
-		.proc_handler	= &proc_dointvec_jiffies,
-		.strategy	= &sysctl_jiffies,
+		.proc_handler	= &proc_dointvec,
 	},
 	{
 		.ctl_name	= NET_CORE_OPTMEM_MAX,
--- diff/net/core/utils.c	2003-10-09 09:47:34.000000000 +0100
+++ source/net/core/utils.c	2004-02-09 10:39:57.000000000 +0000
@@ -38,40 +38,14 @@
 }
 
 int net_msg_cost = 5*HZ;
-int net_msg_burst = 10*5*HZ;
+int net_msg_burst = 10;
 
 /* 
- * This enforces a rate limit: not more than one kernel message
- * every 5secs to make a denial-of-service attack impossible.
- *
- * All warning printk()s should be guarded by this function. 
+ * All net warning printk()s should be guarded by this function.
  */ 
 int net_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 > net_msg_burst)
-		toks = net_msg_burst;
-	if (toks >= net_msg_cost) {
-		int lost = missed;
-		missed = 0;
-		toks -= net_msg_cost;
-		spin_unlock_irqrestore(&ratelimit_lock, flags);
-		if (lost)
-			printk(KERN_WARNING "NET: %d messages suppressed.\n", lost);
-		return 1;
-	}
-	missed++;
-	spin_unlock_irqrestore(&ratelimit_lock, flags);
-	return 0;
+	return __printk_ratelimit(net_msg_cost, net_msg_burst);
 }
 
 EXPORT_SYMBOL(net_random);
--- diff/net/decnet/af_decnet.c	2004-02-09 10:36:12.000000000 +0000
+++ source/net/decnet/af_decnet.c	2004-02-09 10:39:57.000000000 +0000
@@ -456,7 +456,7 @@
 	if  (!sk)
 		goto out;
 
-	DN_SK(sk) = scp = (struct dn_scp *)(sk + 1);
+	sk->sk_protinfo = scp = (struct dn_scp *)(sk + 1);
 
 	if (sock)
 		sock->ops = &dn_proto_ops;
--- diff/net/decnet/dn_neigh.c	2003-09-30 15:46:21.000000000 +0100
+++ source/net/decnet/dn_neigh.c	2004-02-09 10:39:57.000000000 +0000
@@ -327,7 +327,7 @@
 	}
 
 	data = skb_push(skb, sizeof(struct dn_short_packet) + 2);
-	((unsigned short *)data) = dn_htons(skb->len - 2);
+	data = (unsigned char *)dn_htons(skb->len - 2);
 	sp = (struct dn_short_packet *)(data + 2);
 
 	sp->msgflg   = DN_RT_PKT_SHORT|(cb->rt_flags&(DN_RT_F_RQR|DN_RT_F_RTS));
--- diff/net/econet/af_econet.c	2004-02-09 10:36:12.000000000 +0000
+++ source/net/econet/af_econet.c	2004-02-09 10:39:57.000000000 +0000
@@ -568,7 +568,7 @@
 	sock_init_data(sock,sk);
 	sk_set_owner(sk, THIS_MODULE);
 
-	eo = ec_sk(sk) = kmalloc(sizeof(*eo), GFP_KERNEL);
+	eo = sk->sk_protinfo = kmalloc(sizeof(*eo), GFP_KERNEL);
 	if (!eo)
 		goto out_free;
 	memset(eo, 0, sizeof(*eo));
--- diff/net/ipv4/ip_gre.c	2003-11-25 15:24:59.000000000 +0000
+++ source/net/ipv4/ip_gre.c	2004-02-09 10:39:57.000000000 +0000
@@ -280,7 +280,7 @@
 	nt->parms = *parms;
 
 	if (register_netdevice(dev) < 0) {
-		kfree(dev);
+		free_netdev(dev);
 		goto failed;
 	}
 
@@ -1276,7 +1276,7 @@
 	return err;
 fail:
 	inet_del_protocol(&ipgre_protocol, IPPROTO_GRE);
-	kfree(ipgre_fb_tunnel_dev);
+	free_netdev(ipgre_fb_tunnel_dev);
 	goto out;
 }
 
--- diff/net/ipv4/ipconfig.c	2003-10-09 09:47:34.000000000 +0100
+++ source/net/ipv4/ipconfig.c	2004-02-09 10:39:57.000000000 +0000
@@ -1189,12 +1189,47 @@
 #endif /* CONFIG_PROC_FS */
 
 /*
+ *  Extract IP address from the parameter string if needed. Note that we
+ *  need to have root_server_addr set _before_ IPConfig gets called as it
+ *  can override it.
+ */
+u32 __init root_nfs_parse_addr(char *name)
+{
+	u32 addr;
+	int octets = 0;
+	char *cp, *cq;
+
+	cp = cq = name;
+	while (octets < 4) {
+		while (*cp >= '0' && *cp <= '9')
+			cp++;
+		if (cp == cq || cp - cq > 3)
+			break;
+		if (*cp == '.' || octets == 3)
+			octets++;
+		if (octets < 4)
+			cp++;
+		cq = cp;
+	}
+	if (octets == 4 && (*cp == ':' || *cp == '\0')) {
+		if (*cp == ':')
+			*cp++ = '\0';
+		addr = in_aton(name);
+		strcpy(name, cp);
+	} else
+		addr = INADDR_NONE;
+
+	return addr;
+}
+
+/*
  *	IP Autoconfig dispatcher.
  */
 
 static int __init ip_auto_config(void)
 {
 	unsigned long jiff;
+	u32 addr;
 
 #ifdef CONFIG_PROC_FS
 	proc_net_fops_create("pnp", S_IRUGO, &pnp_seq_fops);
@@ -1283,6 +1318,10 @@
 		ic_dev = ic_first_dev->dev;
 	}
 
+	addr = root_nfs_parse_addr(root_server_path);
+	if (root_server_addr == INADDR_NONE)
+		root_server_addr = addr;
+
 	/*
 	 * Use defaults whereever applicable.
 	 */
--- diff/net/ipv4/ipip.c	2003-10-27 09:20:44.000000000 +0000
+++ source/net/ipv4/ipip.c	2004-02-09 10:39:57.000000000 +0000
@@ -250,7 +250,7 @@
 	nt->parms = *parms;
 
 	if (register_netdevice(dev) < 0) {
-		kfree(dev);
+		free_netdev(dev);
 		goto failed;
 	}
 
@@ -899,7 +899,7 @@
 	return err;
  fail:
 	xfrm4_tunnel_deregister(&ipip_handler);
-	kfree(ipip_fb_tunnel_dev);
+	free_netdev(ipip_fb_tunnel_dev);
 	goto out;
 }
 
--- diff/net/ipv4/ipmr.c	2004-02-09 10:36:12.000000000 +0000
+++ source/net/ipv4/ipmr.c	2004-02-09 10:39:57.000000000 +0000
@@ -209,7 +209,7 @@
 		return NULL;
 
 	if (register_netdevice(dev)) {
-		kfree(dev);
+		free_netdev(dev);
 		return NULL;
 	}
 	dev->iflink = 0;
--- diff/net/ipv4/route.c	2004-02-09 10:36:12.000000000 +0000
+++ source/net/ipv4/route.c	2004-02-09 10:39:57.000000000 +0000
@@ -2744,7 +2744,7 @@
 
 	goal = num_physpages >> (26 - PAGE_SHIFT);
 
-	for (order = 0; (1UL << order) < goal; order++)
+	for (order = 0; (order < 10) && ((1UL << order) < goal); order++)
 		/* NOTHING */;
 
 	do {
--- diff/net/ipv4/tcp.c	2004-02-09 10:36:12.000000000 +0000
+++ source/net/ipv4/tcp.c	2004-02-09 10:39:57.000000000 +0000
@@ -2610,7 +2610,7 @@
 	else
 		goal = num_physpages >> (23 - PAGE_SHIFT);
 
-	for (order = 0; (1UL << order) < goal; order++)
+	for (order = 0; (order < 10) && ((1UL << order) < goal); order++)
 		;
 	do {
 		tcp_ehash_size = (1UL << order) * PAGE_SIZE /
--- diff/net/ipv4/tcp_ipv4.c	2003-12-19 09:51:11.000000000 +0000
+++ source/net/ipv4/tcp_ipv4.c	2004-02-09 10:39:57.000000000 +0000
@@ -313,7 +313,7 @@
 	spin_unlock(&head->lock);
 }
 
-inline void tcp_put_port(struct sock *sk)
+void tcp_put_port(struct sock *sk)
 {
 	local_bh_disable();
 	__tcp_put_port(sk);
--- diff/net/ipv6/ip6_tunnel.c	2004-02-09 10:36:12.000000000 +0000
+++ source/net/ipv6/ip6_tunnel.c	2004-02-09 10:39:57.000000000 +0000
@@ -245,7 +245,7 @@
 	t->parms = *p;
 
 	if ((err = register_netdevice(dev)) < 0) {
-		kfree(dev);
+		free_netdev(dev);
 		return err;
 	}
 	dev_hold(dev);
@@ -1118,7 +1118,7 @@
 	ip6ip6_fb_tnl_dev->init = ip6ip6_fb_tnl_dev_init;
 
 	if ((err = register_netdev(ip6ip6_fb_tnl_dev))) {
-		kfree(ip6ip6_fb_tnl_dev);
+		free_netdev(ip6ip6_fb_tnl_dev);
 		goto fail;
 	}
 	return 0;
--- diff/net/ipv6/ndisc.c	2004-02-09 10:36:12.000000000 +0000
+++ source/net/ipv6/ndisc.c	2004-02-09 10:39:57.000000000 +0000
@@ -475,7 +475,8 @@
 	skb_reserve(skb, (dev->hard_header_len + 15) & ~15);
 	ip6_nd_hdr(sk, skb, dev, src_addr, daddr, IPPROTO_ICMPV6, len);
 
-	skb->h.raw = (unsigned char*) msg = (struct nd_msg *) skb_put(skb, len);
+	msg = (struct nd_msg *)skb_put(skb, len);
+	skb->h.raw = (unsigned char*)msg;
 
         msg->icmph.icmp6_type = NDISC_NEIGHBOUR_ADVERTISEMENT;
         msg->icmph.icmp6_code = 0;
@@ -559,7 +560,8 @@
 	skb_reserve(skb, (dev->hard_header_len + 15) & ~15);
 	ip6_nd_hdr(sk, skb, dev, saddr, daddr, IPPROTO_ICMPV6, len);
 
-	skb->h.raw = (unsigned char*) msg = (struct nd_msg *)skb_put(skb, len);
+	msg = (struct nd_msg *)skb_put(skb, len);
+	skb->h.raw = (unsigned char*)msg;
 	msg->icmph.icmp6_type = NDISC_NEIGHBOUR_SOLICITATION;
 	msg->icmph.icmp6_code = 0;
 	msg->icmph.icmp6_cksum = 0;
@@ -630,7 +632,8 @@
 	skb_reserve(skb, (dev->hard_header_len + 15) & ~15);
 	ip6_nd_hdr(sk, skb, dev, saddr, daddr, IPPROTO_ICMPV6, len);
 
-        skb->h.raw = (unsigned char*) hdr = (struct icmp6hdr *) skb_put(skb, len);
+        hdr = (struct icmp6hdr *)skb_put(skb, len);
+        skb->h.raw = (unsigned char*)hdr;
         hdr->icmp6_type = NDISC_ROUTER_SOLICITATION;
         hdr->icmp6_code = 0;
         hdr->icmp6_cksum = 0;
@@ -1374,7 +1377,8 @@
 	ip6_nd_hdr(sk, buff, dev, &saddr_buf, &skb->nh.ipv6h->saddr,
 		   IPPROTO_ICMPV6, len);
 
-	buff->h.raw = (unsigned char*) icmph = (struct icmp6hdr *) skb_put(buff, len);
+	icmph = (struct icmp6hdr *)skb_put(buff, len);
+	buff->h.raw = (unsigned char*)icmph;
 
 	memset(icmph, 0, sizeof(struct icmp6hdr));
 	icmph->icmp6_type = NDISC_REDIRECT;
--- diff/net/ipv6/sit.c	2004-02-09 10:36:12.000000000 +0000
+++ source/net/ipv6/sit.c	2004-02-09 10:39:57.000000000 +0000
@@ -187,7 +187,7 @@
 	nt->parms = *parms;
 
 	if (register_netdevice(dev) < 0) {
-		kfree(dev);
+		free_netdev(dev);
 		goto failed;
 	}
 
@@ -840,6 +840,6 @@
 	return err;
  fail:
 	inet_del_protocol(&sit_protocol, IPPROTO_IPV6);
-	kfree(ipip6_fb_tunnel_dev);
+	free_netdev(ipip6_fb_tunnel_dev);
 	goto out;
 }
--- diff/net/ipx/af_ipx.c	2004-02-09 10:36:12.000000000 +0000
+++ source/net/ipx/af_ipx.c	2004-02-09 10:39:57.000000000 +0000
@@ -1351,7 +1351,7 @@
         	rc = -ENOMEM;
 		if (!sk)
 			goto out;
-		ipx = ipx_sk(sk) = kmalloc(sizeof(*ipx), GFP_KERNEL);
+		ipx = sk->sk_protinfo = kmalloc(sizeof(*ipx), GFP_KERNEL);
 		if (!ipx)
 			goto outsk;
 		memset(ipx, 0, sizeof(*ipx));
--- diff/net/irda/af_irda.c	2004-02-09 10:36:12.000000000 +0000
+++ source/net/irda/af_irda.c	2004-02-09 10:39:57.000000000 +0000
@@ -1089,7 +1089,7 @@
 		return -ENOMEM;
 
 	/* Allocate IrDA socket */
-	self = irda_sk(sk) = kmalloc(sizeof(struct irda_sock), GFP_ATOMIC);
+	self = sk->sk_protinfo = kmalloc(sizeof(struct irda_sock), GFP_ATOMIC);
 	if (self == NULL) {
 		sk_free(sk);
 		return -ENOMEM;
@@ -1208,7 +1208,7 @@
 	/* Destroy IrDA socket */
 	irda_destroy_socket(irda_sk(sk));
 	/* Prevent sock_def_destruct() to create havoc */
-	irda_sk(sk) = NULL;
+	sk->sk_protinfo = NULL;
 
 	sock_orphan(sk);
 	sock->sk   = NULL;
--- diff/net/irda/irlan/irlan_common.c	2003-09-30 15:46:21.000000000 +0100
+++ source/net/irda/irlan/irlan_common.c	2004-02-09 10:39:57.000000000 +0000
@@ -224,7 +224,7 @@
 		IRDA_DEBUG(2, "%s(), register_netdev() failed!\n", 
 			   __FUNCTION__ );
 		self = NULL;
-		kfree(dev);
+		free_netdev(dev);
 	} else {
 		rtnl_lock();
 		list_add_rcu(&self->dev_list, &irlans);
--- diff/net/irda/irlan/irlan_eth.c	2003-08-26 10:00:54.000000000 +0100
+++ source/net/irda/irlan/irlan_eth.c	2004-02-09 10:39:57.000000000 +0000
@@ -60,7 +60,7 @@
 	dev->hard_start_xmit    = irlan_eth_xmit; 
 	dev->get_stats	        = irlan_eth_get_stats;
 	dev->set_multicast_list = irlan_eth_set_multicast_list;
-	dev->destructor		= (void (*)(struct net_device *)) kfree;
+	dev->destructor		= free_netdev;
 
 	SET_MODULE_OWNER(dev);
 
--- diff/net/key/af_key.c	2004-02-09 10:36:12.000000000 +0000
+++ source/net/key/af_key.c	2004-02-09 10:39:57.000000000 +0000
@@ -148,7 +148,7 @@
 	sk_set_owner(sk, THIS_MODULE);
 
 	err = -ENOMEM;
-	pfk = pfkey_sk(sk) = kmalloc(sizeof(*pfk), GFP_KERNEL);
+	pfk = sk->sk_protinfo = kmalloc(sizeof(*pfk), GFP_KERNEL);
 	if (!pfk) {
 		sk_free(sk);
 		goto out;
--- diff/net/lapb/lapb_iface.c	2003-09-17 12:28:12.000000000 +0100
+++ source/net/lapb/lapb_iface.c	2004-02-09 10:39:57.000000000 +0000
@@ -81,18 +81,14 @@
 	lapb_hold(lapb);
 }
 
-/*
- *	Convert the integer token used by the device driver into a pointer
- *	to a LAPB control structure.
- */
-static struct lapb_cb *__lapb_tokentostruct(void *token)
+static struct lapb_cb *__lapb_devtostruct(struct net_device *dev)
 {
 	struct list_head *entry;
 	struct lapb_cb *lapb, *use = NULL;
 
 	list_for_each(entry, &lapb_list) {
 		lapb = list_entry(entry, struct lapb_cb, node);
-		if (lapb->token == token) {
+		if (lapb->dev == dev) {
 			use = lapb;
 			break;
 		}
@@ -104,12 +100,12 @@
 	return use;
 }
 
-static struct lapb_cb *lapb_tokentostruct(void *token)
+static struct lapb_cb *lapb_devtostruct(struct net_device *dev)
 {
 	struct lapb_cb *rc;
 
 	read_lock_bh(&lapb_list_lock);
-	rc = __lapb_tokentostruct(token);
+	rc = __lapb_devtostruct(dev);
 	read_unlock_bh(&lapb_list_lock);
 
 	return rc;
@@ -144,14 +140,14 @@
 	return lapb;
 }
 
-int lapb_register(void *token, struct lapb_register_struct *callbacks)
+int lapb_register(struct net_device *dev, struct lapb_register_struct *callbacks)
 {
 	struct lapb_cb *lapb;
 	int rc = LAPB_BADTOKEN;
 
 	write_lock_bh(&lapb_list_lock);
 
-	lapb = __lapb_tokentostruct(token);
+	lapb = __lapb_devtostruct(dev);
 	if (lapb) {
 		lapb_put(lapb);
 		goto out;
@@ -162,7 +158,7 @@
 	if (!lapb)
 		goto out;
 
-	lapb->token     = token;
+	lapb->dev       = dev;
 	lapb->callbacks = *callbacks;
 
 	__lapb_insert_cb(lapb);
@@ -175,13 +171,13 @@
 	return rc;
 }
 
-int lapb_unregister(void *token)
+int lapb_unregister(struct net_device *dev)
 {
 	struct lapb_cb *lapb;
 	int rc = LAPB_BADTOKEN;
 
 	write_unlock_bh(&lapb_list_lock);
-	lapb = __lapb_tokentostruct(token);
+	lapb = __lapb_devtostruct(dev);
 	if (!lapb)
 		goto out;
 
@@ -199,10 +195,10 @@
 	return rc;
 }
 
-int lapb_getparms(void *token, struct lapb_parms_struct *parms)
+int lapb_getparms(struct net_device *dev, struct lapb_parms_struct *parms)
 {
 	int rc = LAPB_BADTOKEN;
-	struct lapb_cb *lapb = lapb_tokentostruct(token);
+	struct lapb_cb *lapb = lapb_devtostruct(dev);
 
 	if (!lapb)
 		goto out;
@@ -231,10 +227,10 @@
 	return rc;
 }
 
-int lapb_setparms(void *token, struct lapb_parms_struct *parms)
+int lapb_setparms(struct net_device *dev, struct lapb_parms_struct *parms)
 {
 	int rc = LAPB_BADTOKEN;
-	struct lapb_cb *lapb = lapb_tokentostruct(token);
+	struct lapb_cb *lapb = lapb_devtostruct(dev);
 
 	if (!lapb)
 		goto out;
@@ -264,9 +260,9 @@
 	return rc;
 }
 
-int lapb_connect_request(void *token)
+int lapb_connect_request(struct net_device *dev)
 {
-	struct lapb_cb *lapb = lapb_tokentostruct(token);
+	struct lapb_cb *lapb = lapb_devtostruct(dev);
 	int rc = LAPB_BADTOKEN;
 
 	if (!lapb)
@@ -283,7 +279,7 @@
 	lapb_establish_data_link(lapb);
 
 #if LAPB_DEBUG > 0
-	printk(KERN_DEBUG "lapb: (%p) S0 -> S1\n", lapb->token);
+	printk(KERN_DEBUG "lapb: (%p) S0 -> S1\n", lapb->dev);
 #endif
 	lapb->state = LAPB_STATE_1;
 
@@ -294,9 +290,9 @@
 	return rc;
 }
 
-int lapb_disconnect_request(void *token)
+int lapb_disconnect_request(struct net_device *dev)
 {
-	struct lapb_cb *lapb = lapb_tokentostruct(token);
+	struct lapb_cb *lapb = lapb_devtostruct(dev);
 	int rc = LAPB_BADTOKEN;
 
 	if (!lapb)
@@ -309,10 +305,10 @@
 
 		case LAPB_STATE_1:
 #if LAPB_DEBUG > 1
-			printk(KERN_DEBUG "lapb: (%p) S1 TX DISC(1)\n", lapb->token);
+			printk(KERN_DEBUG "lapb: (%p) S1 TX DISC(1)\n", lapb->dev);
 #endif
 #if LAPB_DEBUG > 0
-			printk(KERN_DEBUG "lapb: (%p) S1 -> S0\n", lapb->token);
+			printk(KERN_DEBUG "lapb: (%p) S1 -> S0\n", lapb->dev);
 #endif
 			lapb_send_control(lapb, LAPB_DISC, LAPB_POLLON, LAPB_COMMAND);
 			lapb->state = LAPB_STATE_0;
@@ -333,10 +329,10 @@
 	lapb->state = LAPB_STATE_2;
 
 #if LAPB_DEBUG > 1
-	printk(KERN_DEBUG "lapb: (%p) S3 DISC(1)\n", lapb->token);
+	printk(KERN_DEBUG "lapb: (%p) S3 DISC(1)\n", lapb->dev);
 #endif
 #if LAPB_DEBUG > 0
-	printk(KERN_DEBUG "lapb: (%p) S3 -> S2\n", lapb->token);
+	printk(KERN_DEBUG "lapb: (%p) S3 -> S2\n", lapb->dev);
 #endif
 
 	rc = LAPB_OK;
@@ -346,9 +342,9 @@
 	return rc;
 }
 
-int lapb_data_request(void *token, struct sk_buff *skb)
+int lapb_data_request(struct net_device *dev, struct sk_buff *skb)
 {
-	struct lapb_cb *lapb = lapb_tokentostruct(token);
+	struct lapb_cb *lapb = lapb_devtostruct(dev);
 	int rc = LAPB_BADTOKEN;
 
 	if (!lapb)
@@ -367,9 +363,9 @@
 	return rc;
 }
 
-int lapb_data_received(void *token, struct sk_buff *skb)
+int lapb_data_received(struct net_device *dev, struct sk_buff *skb)
 {
-	struct lapb_cb *lapb = lapb_tokentostruct(token);
+	struct lapb_cb *lapb = lapb_devtostruct(dev);
 	int rc = LAPB_BADTOKEN;
 
 	if (lapb) {
@@ -384,31 +380,31 @@
 void lapb_connect_confirmation(struct lapb_cb *lapb, int reason)
 {
 	if (lapb->callbacks.connect_confirmation)
-		lapb->callbacks.connect_confirmation(lapb->token, reason);
+		lapb->callbacks.connect_confirmation(lapb->dev, reason);
 }
 
 void lapb_connect_indication(struct lapb_cb *lapb, int reason)
 {
 	if (lapb->callbacks.connect_indication)
-		lapb->callbacks.connect_indication(lapb->token, reason);
+		lapb->callbacks.connect_indication(lapb->dev, reason);
 }
 
 void lapb_disconnect_confirmation(struct lapb_cb *lapb, int reason)
 {
 	if (lapb->callbacks.disconnect_confirmation)
-		lapb->callbacks.disconnect_confirmation(lapb->token, reason);
+		lapb->callbacks.disconnect_confirmation(lapb->dev, reason);
 }
 
 void lapb_disconnect_indication(struct lapb_cb *lapb, int reason)
 {
 	if (lapb->callbacks.disconnect_indication)
-		lapb->callbacks.disconnect_indication(lapb->token, reason);
+		lapb->callbacks.disconnect_indication(lapb->dev, reason);
 }
 
 int lapb_data_indication(struct lapb_cb *lapb, struct sk_buff *skb)
 {
 	if (lapb->callbacks.data_indication)
-		return lapb->callbacks.data_indication(lapb->token, skb);
+		return lapb->callbacks.data_indication(lapb->dev, skb);
 
 	kfree_skb(skb);
 	return NET_RX_CN_HIGH; /* For now; must be != NET_RX_DROP */ 
@@ -419,7 +415,7 @@
 	int used = 0;
 
 	if (lapb->callbacks.data_transmit) {
-		lapb->callbacks.data_transmit(lapb->token, skb);
+		lapb->callbacks.data_transmit(lapb->dev, skb);
 		used = 1;
 	}
 
--- diff/net/lapb/lapb_in.c	2003-10-09 09:47:34.000000000 +0100
+++ source/net/lapb/lapb_in.c	2004-02-09 10:39:57.000000000 +0000
@@ -47,23 +47,23 @@
 		case LAPB_SABM:
 #if LAPB_DEBUG > 1
 			printk(KERN_DEBUG "lapb: (%p) S0 RX SABM(%d)\n",
-			       lapb->token, frame->pf);
+			       lapb->dev, frame->pf);
 #endif
 			if (lapb->mode & LAPB_EXTENDED) {
 #if LAPB_DEBUG > 1
 				printk(KERN_DEBUG "lapb: (%p) S0 TX DM(%d)\n",
-				       lapb->token, frame->pf);
+				       lapb->dev, frame->pf);
 #endif
 				lapb_send_control(lapb, LAPB_DM, frame->pf,
 						  LAPB_RESPONSE);
 			} else {
 #if LAPB_DEBUG > 1
 				printk(KERN_DEBUG "lapb: (%p) S0 TX UA(%d)\n",
-				       lapb->token, frame->pf);
+				       lapb->dev, frame->pf);
 #endif
 #if LAPB_DEBUG > 0
 				printk(KERN_DEBUG "lapb: (%p) S0 -> S3\n",
-				       lapb->token);
+				       lapb->dev);
 #endif
 				lapb_send_control(lapb, LAPB_UA, frame->pf,
 						  LAPB_RESPONSE);
@@ -82,16 +82,16 @@
 		case LAPB_SABME:
 #if LAPB_DEBUG > 1
 			printk(KERN_DEBUG "lapb: (%p) S0 RX SABME(%d)\n",
-			       lapb->token, frame->pf);
+			       lapb->dev, frame->pf);
 #endif
 			if (lapb->mode & LAPB_EXTENDED) {
 #if LAPB_DEBUG > 1
 				printk(KERN_DEBUG "lapb: (%p) S0 TX UA(%d)\n",
-				       lapb->token, frame->pf);
+				       lapb->dev, frame->pf);
 #endif
 #if LAPB_DEBUG > 0
 				printk(KERN_DEBUG "lapb: (%p) S0 -> S3\n",
-				       lapb->token);
+				       lapb->dev);
 #endif
 				lapb_send_control(lapb, LAPB_UA, frame->pf,
 						  LAPB_RESPONSE);
@@ -107,7 +107,7 @@
 			} else {
 #if LAPB_DEBUG > 1
 				printk(KERN_DEBUG "lapb: (%p) S0 TX DM(%d)\n",
-				       lapb->token, frame->pf);
+				       lapb->dev, frame->pf);
 #endif
 				lapb_send_control(lapb, LAPB_DM, frame->pf,
 						  LAPB_RESPONSE);
@@ -117,9 +117,9 @@
 		case LAPB_DISC:
 #if LAPB_DEBUG > 1
 			printk(KERN_DEBUG "lapb: (%p) S0 RX DISC(%d)\n",
-			       lapb->token, frame->pf);
+			       lapb->dev, frame->pf);
 			printk(KERN_DEBUG "lapb: (%p) S0 TX UA(%d)\n",
-			       lapb->token, frame->pf);
+			       lapb->dev, frame->pf);
 #endif
 			lapb_send_control(lapb, LAPB_UA, frame->pf,
 					  LAPB_RESPONSE);
@@ -143,19 +143,19 @@
 		case LAPB_SABM:
 #if LAPB_DEBUG > 1
 			printk(KERN_DEBUG "lapb: (%p) S1 RX SABM(%d)\n",
-			       lapb->token, frame->pf);
+			       lapb->dev, frame->pf);
 #endif
 			if (lapb->mode & LAPB_EXTENDED) {
 #if LAPB_DEBUG > 1
 				printk(KERN_DEBUG "lapb: (%p) S1 TX DM(%d)\n",
-				       lapb->token, frame->pf);
+				       lapb->dev, frame->pf);
 #endif
 				lapb_send_control(lapb, LAPB_DM, frame->pf,
 						  LAPB_RESPONSE);
 			} else {
 #if LAPB_DEBUG > 1
 				printk(KERN_DEBUG "lapb: (%p) S1 TX UA(%d)\n",
-				       lapb->token, frame->pf);
+				       lapb->dev, frame->pf);
 #endif
 				lapb_send_control(lapb, LAPB_UA, frame->pf,
 						  LAPB_RESPONSE);
@@ -165,19 +165,19 @@
 		case LAPB_SABME:
 #if LAPB_DEBUG > 1
 			printk(KERN_DEBUG "lapb: (%p) S1 RX SABME(%d)\n",
-			       lapb->token, frame->pf);
+			       lapb->dev, frame->pf);
 #endif
 			if (lapb->mode & LAPB_EXTENDED) {
 #if LAPB_DEBUG > 1
 				printk(KERN_DEBUG "lapb: (%p) S1 TX UA(%d)\n",
-				       lapb->token, frame->pf);
+				       lapb->dev, frame->pf);
 #endif
 				lapb_send_control(lapb, LAPB_UA, frame->pf,
 						  LAPB_RESPONSE);
 			} else {
 #if LAPB_DEBUG > 1
 				printk(KERN_DEBUG "lapb: (%p) S1 TX DM(%d)\n",
-				       lapb->token, frame->pf);
+				       lapb->dev, frame->pf);
 #endif
 				lapb_send_control(lapb, LAPB_DM, frame->pf,
 						  LAPB_RESPONSE);
@@ -187,9 +187,9 @@
 		case LAPB_DISC:
 #if LAPB_DEBUG > 1
 			printk(KERN_DEBUG "lapb: (%p) S1 RX DISC(%d)\n",
-			       lapb->token, frame->pf);
+			       lapb->dev, frame->pf);
 			printk(KERN_DEBUG "lapb: (%p) S1 TX DM(%d)\n",
-			       lapb->token, frame->pf);
+			       lapb->dev, frame->pf);
 #endif
 			lapb_send_control(lapb, LAPB_DM, frame->pf,
 					  LAPB_RESPONSE);
@@ -198,12 +198,12 @@
 		case LAPB_UA:
 #if LAPB_DEBUG > 1
 			printk(KERN_DEBUG "lapb: (%p) S1 RX UA(%d)\n",
-			       lapb->token, frame->pf);
+			       lapb->dev, frame->pf);
 #endif
 			if (frame->pf) {
 #if LAPB_DEBUG > 0
 				printk(KERN_DEBUG "lapb: (%p) S1 -> S3\n",
-				       lapb->token);
+				       lapb->dev);
 #endif
 				lapb_stop_t1timer(lapb);
 				lapb_stop_t2timer(lapb);
@@ -220,12 +220,12 @@
 		case LAPB_DM:
 #if LAPB_DEBUG > 1
 			printk(KERN_DEBUG "lapb: (%p) S1 RX DM(%d)\n",
-			       lapb->token, frame->pf);
+			       lapb->dev, frame->pf);
 #endif
 			if (frame->pf) {
 #if LAPB_DEBUG > 0
 				printk(KERN_DEBUG "lapb: (%p) S1 -> S0\n",
-				       lapb->token);
+				       lapb->dev);
 #endif
 				lapb_clear_queues(lapb);
 				lapb->state = LAPB_STATE_0;
@@ -251,9 +251,9 @@
 		case LAPB_SABME:
 #if LAPB_DEBUG > 1
 			printk(KERN_DEBUG "lapb: (%p) S2 RX {SABM,SABME}(%d)\n",
-			       lapb->token, frame->pf);
+			       lapb->dev, frame->pf);
 			printk(KERN_DEBUG "lapb: (%p) S2 TX DM(%d)\n",
-			       lapb->token, frame->pf);
+			       lapb->dev, frame->pf);
 #endif
 			lapb_send_control(lapb, LAPB_DM, frame->pf,
 					  LAPB_RESPONSE);
@@ -262,9 +262,9 @@
 		case LAPB_DISC:
 #if LAPB_DEBUG > 1
 			printk(KERN_DEBUG "lapb: (%p) S2 RX DISC(%d)\n",
-			       lapb->token, frame->pf);
+			       lapb->dev, frame->pf);
 			printk(KERN_DEBUG "lapb: (%p) S2 TX UA(%d)\n",
-			       lapb->token, frame->pf);
+			       lapb->dev, frame->pf);
 #endif
 			lapb_send_control(lapb, LAPB_UA, frame->pf,
 					  LAPB_RESPONSE);
@@ -273,12 +273,12 @@
 		case LAPB_UA:
 #if LAPB_DEBUG > 1
 			printk(KERN_DEBUG "lapb: (%p) S2 RX UA(%d)\n",
-			       lapb->token, frame->pf);
+			       lapb->dev, frame->pf);
 #endif
 			if (frame->pf) {
 #if LAPB_DEBUG > 0
 				printk(KERN_DEBUG "lapb: (%p) S2 -> S0\n",
-				       lapb->token);
+				       lapb->dev);
 #endif
 				lapb->state = LAPB_STATE_0;
 				lapb_start_t1timer(lapb);
@@ -290,12 +290,12 @@
 		case LAPB_DM:
 #if LAPB_DEBUG > 1
 			printk(KERN_DEBUG "lapb: (%p) S2 RX DM(%d)\n",
-			       lapb->token, frame->pf);
+			       lapb->dev, frame->pf);
 #endif
 			if (frame->pf) {
 #if LAPB_DEBUG > 0
 				printk(KERN_DEBUG "lapb: (%p) S2 -> S0\n",
-				       lapb->token);
+				       lapb->dev);
 #endif
 				lapb->state = LAPB_STATE_0;
 				lapb_start_t1timer(lapb);
@@ -311,9 +311,9 @@
 		case LAPB_RR:
 #if LAPB_DEBUG > 1
 			printk(KERN_DEBUG "lapb: (%p) S2 RX {I,REJ,RNR,RR}"
-			       "(%d)\n", lapb->token, frame->pf);
+			       "(%d)\n", lapb->dev, frame->pf);
 			printk(KERN_DEBUG "lapb: (%p) S2 RX DM(%d)\n",
-			       lapb->token, frame->pf);
+			       lapb->dev, frame->pf);
 #endif
 			if (frame->pf)
 				lapb_send_control(lapb, LAPB_DM, frame->pf,
@@ -339,19 +339,19 @@
 		case LAPB_SABM:
 #if LAPB_DEBUG > 1
 			printk(KERN_DEBUG "lapb: (%p) S3 RX SABM(%d)\n",
-			       lapb->token, frame->pf);
+			       lapb->dev, frame->pf);
 #endif
 			if (lapb->mode & LAPB_EXTENDED) {
 #if LAPB_DEBUG > 1
 				printk(KERN_DEBUG "lapb: (%p) S3 TX DM(%d)\n",
-				       lapb->token, frame->pf);
+				       lapb->dev, frame->pf);
 #endif
 				lapb_send_control(lapb, LAPB_DM, frame->pf,
 						  LAPB_RESPONSE);
 			} else {
 #if LAPB_DEBUG > 1
 				printk(KERN_DEBUG "lapb: (%p) S3 TX UA(%d)\n",
-				       lapb->token, frame->pf);
+				       lapb->dev, frame->pf);
 #endif
 				lapb_send_control(lapb, LAPB_UA, frame->pf,
 						  LAPB_RESPONSE);
@@ -369,12 +369,12 @@
 		case LAPB_SABME:
 #if LAPB_DEBUG > 1
 			printk(KERN_DEBUG "lapb: (%p) S3 RX SABME(%d)\n",
-			       lapb->token, frame->pf);
+			       lapb->dev, frame->pf);
 #endif
 			if (lapb->mode & LAPB_EXTENDED) {
 #if LAPB_DEBUG > 1
 				printk(KERN_DEBUG "lapb: (%p) S3 TX UA(%d)\n",
-				       lapb->token, frame->pf);
+				       lapb->dev, frame->pf);
 #endif
 				lapb_send_control(lapb, LAPB_UA, frame->pf,
 						  LAPB_RESPONSE);
@@ -389,7 +389,7 @@
 			} else {
 #if LAPB_DEBUG > 1
 				printk(KERN_DEBUG "lapb: (%p) S3 TX DM(%d)\n",
-				       lapb->token, frame->pf);
+				       lapb->dev, frame->pf);
 #endif
 				lapb_send_control(lapb, LAPB_DM, frame->pf,
 						  LAPB_RESPONSE);
@@ -399,11 +399,11 @@
 		case LAPB_DISC:
 #if LAPB_DEBUG > 1
 			printk(KERN_DEBUG "lapb: (%p) S3 RX DISC(%d)\n",
-			       lapb->token, frame->pf);
+			       lapb->dev, frame->pf);
 #endif
 #if LAPB_DEBUG > 0
 			printk(KERN_DEBUG "lapb: (%p) S3 -> S0\n",
-			       lapb->token);
+			       lapb->dev);
 #endif
 			lapb_clear_queues(lapb);
 			lapb_send_control(lapb, LAPB_UA, frame->pf,
@@ -417,11 +417,11 @@
 		case LAPB_DM:
 #if LAPB_DEBUG > 1
 			printk(KERN_DEBUG "lapb: (%p) S3 RX DM(%d)\n",
-			       lapb->token, frame->pf);
+			       lapb->dev, frame->pf);
 #endif
 #if LAPB_DEBUG > 0
 			printk(KERN_DEBUG "lapb: (%p) S3 -> S0\n",
-			       lapb->token);
+			       lapb->dev);
 #endif
 			lapb_clear_queues(lapb);
 			lapb->state = LAPB_STATE_0;
@@ -433,7 +433,7 @@
 		case LAPB_RNR:
 #if LAPB_DEBUG > 1
 			printk(KERN_DEBUG "lapb: (%p) S3 RX RNR(%d) R%d\n",
-			       lapb->token, frame->pf, frame->nr);
+			       lapb->dev, frame->pf, frame->nr);
 #endif
 			lapb->condition |= LAPB_PEER_RX_BUSY_CONDITION;
 			lapb_check_need_response(lapb, frame->cr, frame->pf);
@@ -445,7 +445,7 @@
 				lapb_transmit_frmr(lapb);
 #if LAPB_DEBUG > 0
 				printk(KERN_DEBUG "lapb: (%p) S3 -> S4\n",
-				       lapb->token);
+				       lapb->dev);
 #endif
 				lapb_start_t1timer(lapb);
 				lapb_stop_t2timer(lapb);
@@ -457,7 +457,7 @@
 		case LAPB_RR:
 #if LAPB_DEBUG > 1
 			printk(KERN_DEBUG "lapb: (%p) S3 RX RR(%d) R%d\n",
-			       lapb->token, frame->pf, frame->nr);
+			       lapb->dev, frame->pf, frame->nr);
 #endif
 			lapb->condition &= ~LAPB_PEER_RX_BUSY_CONDITION;
 			lapb_check_need_response(lapb, frame->cr, frame->pf);
@@ -469,7 +469,7 @@
 				lapb_transmit_frmr(lapb);
 #if LAPB_DEBUG > 0
 				printk(KERN_DEBUG "lapb: (%p) S3 -> S4\n",
-				       lapb->token);
+				       lapb->dev);
 #endif
 				lapb_start_t1timer(lapb);
 				lapb_stop_t2timer(lapb);
@@ -481,7 +481,7 @@
 		case LAPB_REJ:
 #if LAPB_DEBUG > 1
 			printk(KERN_DEBUG "lapb: (%p) S3 RX REJ(%d) R%d\n",
-			       lapb->token, frame->pf, frame->nr);
+			       lapb->dev, frame->pf, frame->nr);
 #endif
 			lapb->condition &= ~LAPB_PEER_RX_BUSY_CONDITION;
 			lapb_check_need_response(lapb, frame->cr, frame->pf);
@@ -496,7 +496,7 @@
 				lapb_transmit_frmr(lapb);
 #if LAPB_DEBUG > 0
 				printk(KERN_DEBUG "lapb: (%p) S3 -> S4\n",
-				       lapb->token);
+				       lapb->dev);
 #endif
 				lapb_start_t1timer(lapb);
 				lapb_stop_t2timer(lapb);
@@ -508,7 +508,7 @@
 		case LAPB_I:
 #if LAPB_DEBUG > 1
 			printk(KERN_DEBUG "lapb: (%p) S3 RX I(%d) S%d R%d\n",
-			       lapb->token, frame->pf, frame->ns, frame->nr);
+			       lapb->dev, frame->pf, frame->ns, frame->nr);
 #endif
 			if (!lapb_validate_nr(lapb, frame->nr)) {
 				lapb->frmr_data = *frame;
@@ -516,7 +516,7 @@
 				lapb_transmit_frmr(lapb);
 #if LAPB_DEBUG > 0
 				printk(KERN_DEBUG "lapb: (%p) S3 -> S4\n",
-				       lapb->token);
+				       lapb->dev);
 #endif
 				lapb_start_t1timer(lapb);
 				lapb_stop_t2timer(lapb);
@@ -564,7 +564,7 @@
 #if LAPB_DEBUG > 1
 					printk(KERN_DEBUG
 					       "lapb: (%p) S3 TX REJ(%d) R%d\n",
-					       lapb->token, frame->pf, lapb->vr);
+					       lapb->dev, frame->pf, lapb->vr);
 #endif
 					lapb->condition |= LAPB_REJECT_CONDITION;
 					lapb_send_control(lapb, LAPB_REJ,
@@ -578,14 +578,14 @@
 		case LAPB_FRMR:
 #if LAPB_DEBUG > 1
 			printk(KERN_DEBUG "lapb: (%p) S3 RX FRMR(%d) %02X "
-			       "%02X %02X %02X %02X\n", lapb->token, frame->pf,
+			       "%02X %02X %02X %02X\n", lapb->dev, frame->pf,
 			       skb->data[0], skb->data[1], skb->data[2],
 			       skb->data[3], skb->data[4]);
 #endif
 			lapb_establish_data_link(lapb);
 #if LAPB_DEBUG > 0
 			printk(KERN_DEBUG "lapb: (%p) S3 -> S1\n",
-			       lapb->token);
+			       lapb->dev);
 #endif
 			lapb_requeue_frames(lapb);
 			lapb->state = LAPB_STATE_1;
@@ -594,13 +594,13 @@
 		case LAPB_ILLEGAL:
 #if LAPB_DEBUG > 1
 			printk(KERN_DEBUG "lapb: (%p) S3 RX ILLEGAL(%d)\n",
-			       lapb->token, frame->pf);
+			       lapb->dev, frame->pf);
 #endif
 			lapb->frmr_data = *frame;
 			lapb->frmr_type = LAPB_FRMR_W;
 			lapb_transmit_frmr(lapb);
 #if LAPB_DEBUG > 0
-			printk(KERN_DEBUG "lapb: (%p) S3 -> S4\n", lapb->token);
+			printk(KERN_DEBUG "lapb: (%p) S3 -> S4\n", lapb->dev);
 #endif
 			lapb_start_t1timer(lapb);
 			lapb_stop_t2timer(lapb);
@@ -624,23 +624,23 @@
 		case LAPB_SABM:
 #if LAPB_DEBUG > 1
 			printk(KERN_DEBUG "lapb: (%p) S4 RX SABM(%d)\n",
-			       lapb->token, frame->pf);
+			       lapb->dev, frame->pf);
 #endif
 			if (lapb->mode & LAPB_EXTENDED) {
 #if LAPB_DEBUG > 1
 				printk(KERN_DEBUG "lapb: (%p) S4 TX DM(%d)\n",
-				       lapb->token, frame->pf);
+				       lapb->dev, frame->pf);
 #endif
 				lapb_send_control(lapb, LAPB_DM, frame->pf,
 						  LAPB_RESPONSE);
 			} else {
 #if LAPB_DEBUG > 1
 				printk(KERN_DEBUG "lapb: (%p) S4 TX UA(%d)\n",
-				       lapb->token, frame->pf);
+				       lapb->dev, frame->pf);
 #endif
 #if LAPB_DEBUG > 0
 				printk(KERN_DEBUG "lapb: (%p) S4 -> S3\n",
-				       lapb->token);
+				       lapb->dev);
 #endif
 				lapb_send_control(lapb, LAPB_UA, frame->pf,
 						  LAPB_RESPONSE);
@@ -659,16 +659,16 @@
 		case LAPB_SABME:
 #if LAPB_DEBUG > 1
 			printk(KERN_DEBUG "lapb: (%p) S4 RX SABME(%d)\n",
-			       lapb->token, frame->pf);
+			       lapb->dev, frame->pf);
 #endif
 			if (lapb->mode & LAPB_EXTENDED) {
 #if LAPB_DEBUG > 1
 				printk(KERN_DEBUG "lapb: (%p) S4 TX UA(%d)\n",
-				       lapb->token, frame->pf);
+				       lapb->dev, frame->pf);
 #endif
 #if LAPB_DEBUG > 0
 				printk(KERN_DEBUG "lapb: (%p) S4 -> S3\n",
-				       lapb->token);
+				       lapb->dev);
 #endif
 				lapb_send_control(lapb, LAPB_UA, frame->pf,
 						  LAPB_RESPONSE);
@@ -684,7 +684,7 @@
 			} else {
 #if LAPB_DEBUG > 1
 				printk(KERN_DEBUG "lapb: (%p) S4 TX DM(%d)\n",
-				       lapb->token, frame->pf);
+				       lapb->dev, frame->pf);
 #endif
 				lapb_send_control(lapb, LAPB_DM, frame->pf,
 						  LAPB_RESPONSE);
--- diff/net/lapb/lapb_out.c	2002-10-16 04:28:27.000000000 +0100
+++ source/net/lapb/lapb_out.c	2004-02-09 10:39:57.000000000 +0000
@@ -63,7 +63,7 @@
 
 #if LAPB_DEBUG > 1
 	printk(KERN_DEBUG "lapb: (%p) S%d TX I(%d) S%d R%d\n",
-	       lapb->token, lapb->state, poll_bit, lapb->vs, lapb->vr);
+	       lapb->dev, lapb->state, poll_bit, lapb->vs, lapb->vr);
 #endif
 
 	lapb_transmit_buffer(lapb, skb, LAPB_COMMAND);	
@@ -151,7 +151,7 @@
 
 #if LAPB_DEBUG > 2
 	printk(KERN_DEBUG "lapb: (%p) S%d TX %02X %02X %02X\n",
-	       lapb->token, lapb->state,
+	       lapb->dev, lapb->state,
 	       skb->data[0], skb->data[1], skb->data[2]);
 #endif
 
@@ -167,13 +167,13 @@
 	if (lapb->mode & LAPB_EXTENDED) {
 #if LAPB_DEBUG > 1
 		printk(KERN_DEBUG "lapb: (%p) S%d TX SABME(1)\n",
-		       lapb->token, lapb->state);
+		       lapb->dev, lapb->state);
 #endif
 		lapb_send_control(lapb, LAPB_SABME, LAPB_POLLON, LAPB_COMMAND);
 	} else {
 #if LAPB_DEBUG > 1
 		printk(KERN_DEBUG "lapb: (%p) S%d TX SABM(1)\n",
-		       lapb->token, lapb->state);
+		       lapb->dev, lapb->state);
 #endif
 		lapb_send_control(lapb, LAPB_SABM, LAPB_POLLON, LAPB_COMMAND);
 	}
@@ -186,7 +186,7 @@
 {
 #if LAPB_DEBUG > 1
 	printk(KERN_DEBUG "lapb: (%p) S%d TX RR(1) R%d\n",
-	       lapb->token, lapb->state, lapb->vr);
+	       lapb->dev, lapb->state, lapb->vr);
 #endif
 
 	lapb_send_control(lapb, LAPB_RR, LAPB_POLLON, LAPB_RESPONSE);
@@ -198,7 +198,7 @@
 {
 #if LAPB_DEBUG > 1
 	printk(KERN_DEBUG "lapb: (%p) S%d TX RR(0) R%d\n",
-	       lapb->token, lapb->state, lapb->vr);
+	       lapb->dev, lapb->state, lapb->vr);
 #endif
 	lapb_send_control(lapb, LAPB_RR, LAPB_POLLOFF, LAPB_RESPONSE);
 
--- diff/net/lapb/lapb_subr.c	2003-10-09 09:47:34.000000000 +0100
+++ source/net/lapb/lapb_subr.c	2004-02-09 10:39:57.000000000 +0000
@@ -114,7 +114,7 @@
 
 #if LAPB_DEBUG > 2
 	printk(KERN_DEBUG "lapb: (%p) S%d RX %02X %02X %02X\n",
-	       lapb->token, lapb->state,
+	       lapb->dev, lapb->state,
 	       skb->data[0], skb->data[1], skb->data[2]);
 #endif
 
@@ -287,7 +287,7 @@
 
 #if LAPB_DEBUG > 1
 	printk(KERN_DEBUG "lapb: (%p) S%d TX FRMR %02X %02X %02X %02X %02X\n",
-	       lapb->token, lapb->state,
+	       lapb->dev, lapb->state,
 	       skb->data[1], skb->data[2], skb->data[3],
 	       skb->data[4], skb->data[5]);
 #endif
@@ -304,7 +304,7 @@
 
 #if LAPB_DEBUG > 1
 	printk(KERN_DEBUG "lapb: (%p) S%d TX FRMR %02X %02X %02X\n",
-	       lapb->token, lapb->state, skb->data[1],
+	       lapb->dev, lapb->state, skb->data[1],
 	       skb->data[2], skb->data[3]);
 #endif
 	}
--- diff/net/lapb/lapb_timer.c	2002-10-16 04:27:21.000000000 +0100
+++ source/net/lapb/lapb_timer.c	2004-02-09 10:39:57.000000000 +0000
@@ -107,19 +107,19 @@
 				lapb->state = LAPB_STATE_0;
 				lapb_disconnect_indication(lapb, LAPB_TIMEDOUT);
 #if LAPB_DEBUG > 0
-				printk(KERN_DEBUG "lapb: (%p) S1 -> S0\n", lapb->token);
+				printk(KERN_DEBUG "lapb: (%p) S1 -> S0\n", lapb->dev);
 #endif
 				return;
 			} else {
 				lapb->n2count++;
 				if (lapb->mode & LAPB_EXTENDED) {
 #if LAPB_DEBUG > 1
-					printk(KERN_DEBUG "lapb: (%p) S1 TX SABME(1)\n", lapb->token);
+					printk(KERN_DEBUG "lapb: (%p) S1 TX SABME(1)\n", lapb->dev);
 #endif
 					lapb_send_control(lapb, LAPB_SABME, LAPB_POLLON, LAPB_COMMAND);
 				} else {
 #if LAPB_DEBUG > 1
-					printk(KERN_DEBUG "lapb: (%p) S1 TX SABM(1)\n", lapb->token);
+					printk(KERN_DEBUG "lapb: (%p) S1 TX SABM(1)\n", lapb->dev);
 #endif
 					lapb_send_control(lapb, LAPB_SABM, LAPB_POLLON, LAPB_COMMAND);
 				}
@@ -135,13 +135,13 @@
 				lapb->state = LAPB_STATE_0;
 				lapb_disconnect_confirmation(lapb, LAPB_TIMEDOUT);
 #if LAPB_DEBUG > 0
-				printk(KERN_DEBUG "lapb: (%p) S2 -> S0\n", lapb->token);
+				printk(KERN_DEBUG "lapb: (%p) S2 -> S0\n", lapb->dev);
 #endif
 				return;
 			} else {
 				lapb->n2count++;
 #if LAPB_DEBUG > 1
-				printk(KERN_DEBUG "lapb: (%p) S2 TX DISC(1)\n", lapb->token);
+				printk(KERN_DEBUG "lapb: (%p) S2 TX DISC(1)\n", lapb->dev);
 #endif
 				lapb_send_control(lapb, LAPB_DISC, LAPB_POLLON, LAPB_COMMAND);
 			}
@@ -157,7 +157,7 @@
 				lapb_stop_t2timer(lapb);
 				lapb_disconnect_indication(lapb, LAPB_TIMEDOUT);
 #if LAPB_DEBUG > 0
-				printk(KERN_DEBUG "lapb: (%p) S3 -> S0\n", lapb->token);
+				printk(KERN_DEBUG "lapb: (%p) S3 -> S0\n", lapb->dev);
 #endif
 				return;
 			} else {
@@ -175,7 +175,7 @@
 				lapb->state = LAPB_STATE_0;
 				lapb_disconnect_indication(lapb, LAPB_TIMEDOUT);
 #if LAPB_DEBUG > 0
-				printk(KERN_DEBUG "lapb: (%p) S4 -> S0\n", lapb->token);
+				printk(KERN_DEBUG "lapb: (%p) S4 -> S0\n", lapb->dev);
 #endif
 				return;
 			} else {
--- diff/net/llc/llc_conn.c	2003-11-25 15:24:59.000000000 +0000
+++ source/net/llc/llc_conn.c	2004-02-09 10:39:57.000000000 +0000
@@ -826,7 +826,7 @@
 		        * tx_win of remote LLC) */
 	skb_queue_head_init(&llc->pdu_unack_q);
 	sk->sk_backlog_rcv = llc_backlog_rcv;
-	llc_sk(sk) = llc;
+	sk->sk_protinfo = llc;
 out:
 	return rc;
 }
--- diff/net/netlink/af_netlink.c	2004-02-09 10:36:12.000000000 +0000
+++ source/net/netlink/af_netlink.c	2004-02-09 10:39:57.000000000 +0000
@@ -230,7 +230,7 @@
 	sock_init_data(sock,sk);
 	sk_set_owner(sk, THIS_MODULE);
 
-	nlk = nlk_sk(sk) = kmalloc(sizeof(*nlk), GFP_KERNEL);
+	nlk = sk->sk_protinfo = kmalloc(sizeof(*nlk), GFP_KERNEL);
 	if (!nlk) {
 		sk_free(sk);
 		return -ENOMEM;
--- diff/net/netrom/af_netrom.c	2004-02-09 10:36:12.000000000 +0000
+++ source/net/netrom/af_netrom.c	2004-02-09 10:39:57.000000000 +0000
@@ -72,7 +72,7 @@
 	if (!sk)
 		goto out;
 
-	nr = nr_sk(sk) = kmalloc(sizeof(*nr), GFP_ATOMIC);
+	nr = sk->sk_protinfo = kmalloc(sizeof(*nr), GFP_ATOMIC);
 	if (!nr)
 		goto frees;
 
--- diff/net/packet/af_packet.c	2004-02-09 10:36:12.000000000 +0000
+++ source/net/packet/af_packet.c	2004-02-09 10:39:57.000000000 +0000
@@ -961,7 +961,7 @@
 	sock_init_data(sock,sk);
 	sk_set_owner(sk, THIS_MODULE);
 
-	po = pkt_sk(sk) = kmalloc(sizeof(*po), GFP_KERNEL);
+	po = sk->sk_protinfo = kmalloc(sizeof(*po), GFP_KERNEL);
 	if (!po)
 		goto out_free;
 	memset(po, 0, sizeof(*po));
--- diff/net/rose/af_rose.c	2004-02-09 10:36:12.000000000 +0000
+++ source/net/rose/af_rose.c	2004-02-09 10:39:57.000000000 +0000
@@ -133,7 +133,7 @@
 	if (!sk)
 		goto out;
 
-	rose = rose_sk(sk) = kmalloc(sizeof(*rose), GFP_ATOMIC);
+	rose = sk->sk_protinfo = kmalloc(sizeof(*rose), GFP_ATOMIC);
 	if (!rose)
 		goto frees;
 
--- diff/net/sunrpc/auth.c	2003-10-09 09:47:17.000000000 +0100
+++ source/net/sunrpc/auth.c	2004-02-09 10:39:57.000000000 +0000
@@ -61,6 +61,7 @@
 struct rpc_auth *
 rpcauth_create(rpc_authflavor_t pseudoflavor, struct rpc_clnt *clnt)
 {
+	struct rpc_auth		*auth;
 	struct rpc_authops	*ops;
 	u32			flavor = pseudoflavor_to_flavor(pseudoflavor);
 
@@ -68,13 +69,21 @@
 		return NULL;
 	if (!try_module_get(ops->owner))
 		return NULL;
-	clnt->cl_auth = ops->create(clnt, pseudoflavor);
-	return clnt->cl_auth;
+	auth = ops->create(clnt, pseudoflavor);
+	if (!auth)
+		return NULL;
+	atomic_set(&auth->au_count, 1);
+	if (clnt->cl_auth)
+		rpcauth_destroy(clnt->cl_auth);
+	clnt->cl_auth = auth;
+	return auth;
 }
 
 void
 rpcauth_destroy(struct rpc_auth *auth)
 {
+	if (!atomic_dec_and_test(&auth->au_count))
+		return;
 	auth->au_ops->destroy(auth);
 	module_put(auth->au_ops->owner);
 	kfree(auth);
@@ -246,34 +255,41 @@
 struct rpc_cred *
 rpcauth_lookupcred(struct rpc_auth *auth, int taskflags)
 {
-	struct auth_cred acred = {
-		.uid = current->fsuid,
-		.gid = current->fsgid,
-		.ngroups = current->ngroups,
-		.groups = current->groups,
-	};
+	struct auth_cred acred;
+	struct rpc_cred *ret;
+
+	get_group_info(current->group_info);
+	acred.uid = current->fsuid;
+	acred.gid = current->fsgid;
+	acred.group_info = current->group_info;
+
 	dprintk("RPC:     looking up %s cred\n",
 		auth->au_ops->au_name);
-	return rpcauth_lookup_credcache(auth, &acred, taskflags);
+	ret = rpcauth_lookup_credcache(auth, &acred, taskflags);
+	put_group_info(current->group_info);
+	return ret;
 }
 
 struct rpc_cred *
 rpcauth_bindcred(struct rpc_task *task)
 {
 	struct rpc_auth *auth = task->tk_auth;
-	struct auth_cred acred = {
-		.uid = current->fsuid,
-		.gid = current->fsgid,
-		.ngroups = current->ngroups,
-		.groups = current->groups,
-	};
+	struct auth_cred acred;
+	struct rpc_cred *ret;
+
+	get_group_info(current->group_info);
+	acred.uid = current->fsuid;
+	acred.gid = current->fsgid;
+	acred.group_info = current->group_info;
 
 	dprintk("RPC: %4d looking up %s cred\n",
 		task->tk_pid, task->tk_auth->au_ops->au_name);
 	task->tk_msg.rpc_cred = rpcauth_lookup_credcache(auth, &acred, task->tk_flags);
 	if (task->tk_msg.rpc_cred == 0)
 		task->tk_status = -ENOMEM;
-	return task->tk_msg.rpc_cred;
+	ret = task->tk_msg.rpc_cred;
+	put_group_info(current->group_info);
+	return ret;
 }
 
 void
@@ -340,6 +356,35 @@
 }
 
 int
+rpcauth_wrap_req(struct rpc_task *task, kxdrproc_t encode, void *rqstp,
+		u32 *data, void *obj)
+{
+	struct rpc_cred *cred = task->tk_msg.rpc_cred;
+
+	dprintk("RPC: %4d using %s cred %p to wrap rpc data\n",
+			task->tk_pid, cred->cr_auth->au_ops->au_name, cred);
+	if (cred->cr_ops->crwrap_req)
+		return cred->cr_ops->crwrap_req(task, encode, rqstp, data, obj);
+	/* By default, we encode the arguments normally. */
+	return encode(rqstp, data, obj);
+}
+
+int
+rpcauth_unwrap_resp(struct rpc_task *task, kxdrproc_t decode, void *rqstp,
+		u32 *data, void *obj)
+{
+	struct rpc_cred *cred = task->tk_msg.rpc_cred;
+
+	dprintk("RPC: %4d using %s cred %p to unwrap rpc data\n",
+			task->tk_pid, cred->cr_auth->au_ops->au_name, cred);
+	if (cred->cr_ops->crunwrap_resp)
+		return cred->cr_ops->crunwrap_resp(task, decode, rqstp,
+						   data, obj);
+	/* By default, we decode the arguments normally. */
+	return decode(rqstp, data, obj);
+}
+
+int
 rpcauth_refreshcred(struct rpc_task *task)
 {
 	struct rpc_auth	*auth = task->tk_auth;
--- diff/net/sunrpc/auth_gss/auth_gss.c	2003-10-09 09:47:34.000000000 +0100
+++ source/net/sunrpc/auth_gss/auth_gss.c	2004-02-09 10:39:57.000000000 +0000
@@ -49,7 +49,9 @@
 #include <linux/sunrpc/auth.h>
 #include <linux/sunrpc/auth_gss.h>
 #include <linux/sunrpc/gss_err.h>
+#include <linux/workqueue.h>
 #include <linux/sunrpc/rpc_pipe_fs.h>
+#include <linux/sunrpc/gss_api.h>
 #include <asm/uaccess.h>
 
 static struct rpc_authops authgss_ops;
@@ -64,7 +66,9 @@
 
 #define GSS_CRED_EXPIRE		(60 * HZ)	/* XXX: reasonable? */
 #define GSS_CRED_SLACK		1024		/* XXX: unused */
-#define GSS_VERF_SLACK		48		/* length of a krb5 verifier.*/
+/* length of a krb5 verifier (48), plus data added before arguments when
+ * using integrity (two 4-byte integers): */
+#define GSS_VERF_SLACK		56
 
 /* XXX this define must match the gssd define
 * as it is passed to gssd to signal the use of
@@ -155,17 +159,17 @@
 		gss_put_ctx(old);
 }
 
-static struct gss_cl_ctx *
-gss_cred_get_uptodate_ctx(struct rpc_cred *cred)
+static int
+gss_cred_is_uptodate_ctx(struct rpc_cred *cred)
 {
 	struct gss_cred *gss_cred = container_of(cred, struct gss_cred, gc_base);
-	struct gss_cl_ctx *ctx = NULL;
+	int res = 0;
 
 	read_lock(&gss_ctx_lock);
 	if ((cred->cr_flags & RPCAUTH_CRED_UPTODATE) && gss_cred->gc_ctx)
-		ctx = gss_get_ctx(gss_cred->gc_ctx);
+		res = 1;
 	read_unlock(&gss_ctx_lock);
-	return ctx;
+	return res;
 }
 
 static inline int
@@ -292,13 +296,9 @@
 static void
 gss_release_msg(struct gss_upcall_msg *gss_msg)
 {
-	struct gss_auth *gss_auth = gss_msg->auth;
-
-	if (!atomic_dec_and_lock(&gss_msg->count, &gss_auth->lock))
+	if (!atomic_dec_and_test(&gss_msg->count))
 		return;
-	if (!list_empty(&gss_msg->list))
-		list_del(&gss_msg->list);
-	spin_unlock(&gss_auth->lock);
+	BUG_ON(!list_empty(&gss_msg->list));
 	kfree(gss_msg);
 }
 
@@ -315,24 +315,17 @@
 	return NULL;
 }
 
-static struct gss_upcall_msg *
-gss_find_upcall(struct gss_auth *gss_auth, uid_t uid)
-{
-	struct gss_upcall_msg *gss_msg;
-
-	spin_lock(&gss_auth->lock);
-	gss_msg = __gss_find_upcall(gss_auth, uid);
-	spin_unlock(&gss_auth->lock);
-	return gss_msg;
-}
-
 static void
 __gss_unhash_msg(struct gss_upcall_msg *gss_msg)
 {
 	if (list_empty(&gss_msg->list))
 		return;
 	list_del_init(&gss_msg->list);
-	rpc_wake_up(&gss_msg->waitq);
+	if (gss_msg->msg.errno < 0)
+		rpc_wake_up_status(&gss_msg->waitq, gss_msg->msg.errno);
+	else
+		rpc_wake_up(&gss_msg->waitq);
+	atomic_dec(&gss_msg->count);
 }
 
 static void
@@ -345,40 +338,27 @@
 	spin_unlock(&gss_auth->lock);
 }
 
-static void
-gss_release_callback(struct rpc_task *task)
-{
-	struct rpc_clnt *clnt = task->tk_client;
-	struct gss_auth *gss_auth = container_of(clnt->cl_auth,
-			struct gss_auth, rpc_auth);
-	struct gss_upcall_msg *gss_msg;
-
-	gss_msg = gss_find_upcall(gss_auth, task->tk_msg.rpc_cred->cr_uid);
-	BUG_ON(!gss_msg);
-	atomic_dec(&gss_msg->count);
-	gss_release_msg(gss_msg);
-}
-
 static int
-gss_upcall(struct rpc_clnt *clnt, struct rpc_task *task, uid_t uid)
+gss_upcall(struct rpc_clnt *clnt, struct rpc_task *task, struct rpc_cred *cred)
 {
 	struct gss_auth *gss_auth = container_of(clnt->cl_auth,
 			struct gss_auth, rpc_auth);
 	struct gss_upcall_msg *gss_msg, *gss_new = NULL;
 	struct rpc_pipe_msg *msg;
 	struct dentry *dentry = gss_auth->dentry;
-	int res;
+	uid_t uid = cred->cr_uid;
+	int res = 0;
 
 retry:
+	spin_lock(&gss_auth->lock);
 	gss_msg = __gss_find_upcall(gss_auth, uid);
 	if (gss_msg)
 		goto out_sleep;
 	if (gss_new == NULL) {
 		spin_unlock(&gss_auth->lock);
 		gss_new = kmalloc(sizeof(*gss_new), GFP_KERNEL);
-		if (gss_new)
+		if (!gss_new)
 			return -ENOMEM;
-		spin_lock(&gss_auth->lock);
 		goto retry;
 	}
 	gss_msg = gss_new;
@@ -393,20 +373,34 @@
 	gss_new->auth = gss_auth;
 	list_add(&gss_new->list, &gss_auth->upcalls);
 	gss_new = NULL;
-	task->tk_timeout = 5 * HZ;
-	rpc_sleep_on(&gss_msg->waitq, task, gss_release_callback, NULL);
-	spin_unlock(&gss_auth->lock);
-	res = rpc_queue_upcall(dentry->d_inode, msg);
-	if (res) {
-		gss_unhash_msg(gss_msg);
-		gss_release_msg(gss_msg);
+	/* Has someone updated the credential behind our back? */
+	if (!gss_cred_is_uptodate_ctx(cred)) {
+		/* No, so do upcall and sleep */
+		task->tk_timeout = 0;
+		rpc_sleep_on(&gss_msg->waitq, task, NULL, NULL);
+		spin_unlock(&gss_auth->lock);
+		res = rpc_queue_upcall(dentry->d_inode, msg);
+		if (res)
+			gss_unhash_msg(gss_msg);
+	} else {
+		/* Yes, so cancel upcall */
+		__gss_unhash_msg(gss_msg);
+		spin_unlock(&gss_auth->lock);
 	}
+	gss_release_msg(gss_msg);
 	return res;
 out_sleep:
-	rpc_sleep_on(&gss_msg->waitq, task, gss_release_callback, NULL);
+	/* Sleep forever */
+	task->tk_timeout = 0;
+	rpc_sleep_on(&gss_msg->waitq, task, NULL, NULL);
 	spin_unlock(&gss_auth->lock);
 	if (gss_new)
 		kfree(gss_new);
+	/* Note: we drop the reference here: we are automatically removed
+	 * from the queue when we're woken up, and we should in any case
+	 * have no further responsabilities w.r.t. the upcall.
+	 */
+	gss_release_msg(gss_msg);
 	return 0;
 }
 
@@ -491,14 +485,52 @@
 	return err;
 }
 
+static void
+gss_pipe_release(struct inode *inode)
+{
+	struct rpc_inode *rpci = RPC_I(inode);
+	struct rpc_clnt *clnt;
+	struct rpc_auth *auth;
+	struct gss_auth *gss_auth;
+
+	clnt = rpci->private;
+	auth = clnt->cl_auth;
+	gss_auth = container_of(auth, struct gss_auth, rpc_auth);
+	spin_lock(&gss_auth->lock);
+	while (!list_empty(&gss_auth->upcalls)) {
+		struct gss_upcall_msg *gss_msg;
+
+		gss_msg = list_entry(gss_auth->upcalls.next,
+				struct gss_upcall_msg, list);
+		gss_msg->msg.errno = -EPIPE;
+		atomic_inc(&gss_msg->count);
+		__gss_unhash_msg(gss_msg);
+		spin_unlock(&gss_auth->lock);
+		gss_release_msg(gss_msg);
+		spin_lock(&gss_auth->lock);
+	}
+	spin_unlock(&gss_auth->lock);
+}
+
 void
 gss_pipe_destroy_msg(struct rpc_pipe_msg *msg)
 {
 	struct gss_upcall_msg *gss_msg = container_of(msg, struct gss_upcall_msg, msg);
+	static unsigned long ratelimit;
 
-	if (msg->errno < 0)
+	if (msg->errno < 0) {
+		atomic_inc(&gss_msg->count);
 		gss_unhash_msg(gss_msg);
-	gss_release_msg(gss_msg);
+		if (msg->errno == -ETIMEDOUT || msg->errno == -EPIPE) {
+			unsigned long now = jiffies;
+			if (time_after(now, ratelimit)) {
+				printk(KERN_WARNING "RPC: AUTH_GSS upcall timed out.\n"
+						    "Please check user daemon is running!\n");
+				ratelimit = now + 15*HZ;
+			}
+		}
+		gss_release_msg(gss_msg);
+	}
 }
 
 /* 
@@ -640,21 +672,14 @@
 	struct gss_cl_ctx	*ctx = gss_cred_get_ctx(cred);
 	u32		*cred_len;
 	struct rpc_rqst *req = task->tk_rqstp;
-	struct rpc_clnt *clnt = task->tk_client;
-	struct rpc_xprt *xprt = clnt->cl_xprt;
-	u32             *verfbase = req->rq_svec[0].iov_base; 
 	u32             maj_stat = 0;
-	struct xdr_netobj bufin,bufout;
+	struct xdr_netobj mic;
+	struct iovec	iov;
+	struct xdr_buf	verf_buf;
 	u32		service;
 
 	dprintk("RPC: gss_marshal\n");
 
-	/* We compute the checksum for the verifier over the xdr-encoded bytes
-	 * starting with the xid (which verfbase points to) and ending at
-	 * the end of the credential. */
-	if (xprt->stream)
-		verfbase++; /* See clnt.c:call_header() */
-
 	*p++ = htonl(RPC_AUTH_GSS);
 	cred_len = p++;
 
@@ -665,32 +690,39 @@
 		goto out_put_ctx;
 	}
 	spin_lock(&ctx->gc_seq_lock);
-	task->tk_gss_seqno = ctx->gc_seq++;
+	req->rq_seqno = ctx->gc_seq++;
 	spin_unlock(&ctx->gc_seq_lock);
 
 	*p++ = htonl((u32) RPC_GSS_VERSION);
 	*p++ = htonl((u32) ctx->gc_proc);
-	*p++ = htonl((u32) task->tk_gss_seqno);
+	*p++ = htonl((u32) req->rq_seqno);
 	*p++ = htonl((u32) service);
 	p = xdr_encode_netobj(p, &ctx->gc_wire_ctx);
 	*cred_len = htonl((p - (cred_len + 1)) << 2);
 
-	/* Marshal verifier. */
-	bufin.data = (u8 *)verfbase;
-	bufin.len = (p - verfbase) << 2;
+	/* We compute the checksum for the verifier over the xdr-encoded bytes
+	 * starting with the xid and ending at the end of the credential: */
+	iov.iov_base = req->rq_snd_buf.head[0].iov_base;
+	if (task->tk_client->cl_xprt->stream)
+		/* See clnt.c:call_header() */
+		iov.iov_base += 4;
+	iov.iov_len = (u8 *)p - (u8 *)iov.iov_base;
+	xdr_buf_from_iov(&iov, &verf_buf);
 
 	/* set verifier flavor*/
 	*p++ = htonl(RPC_AUTH_GSS);
 
+	mic.data = (u8 *)(p + 1);
 	maj_stat = gss_get_mic(ctx->gc_gss_ctx,
 			       GSS_C_QOP_DEFAULT, 
-			       &bufin, &bufout);
+			       &verf_buf, &mic);
 	if(maj_stat != 0){
-		printk("gss_marshal: gss_get_mic FAILED (%d)\n",
-		       maj_stat);
+		printk("gss_marshal: gss_get_mic FAILED (%d)\n", maj_stat);
 		goto out_put_ctx;
 	}
-	p = xdr_encode_netobj(p, &bufout);
+	*p++ = htonl(mic.len);
+	p += XDR_QUADLEN(mic.len);
+	gss_put_ctx(ctx);
 	return p;
 out_put_ctx:
 	gss_put_ctx(ctx);
@@ -704,58 +736,206 @@
 gss_refresh(struct rpc_task *task)
 {
 	struct rpc_clnt *clnt = task->tk_client;
-	struct gss_auth *gss_auth = container_of(clnt->cl_auth,
-			struct gss_auth, rpc_auth);
 	struct rpc_xprt *xprt = task->tk_xprt;
 	struct rpc_cred *cred = task->tk_msg.rpc_cred;
-	int err = 0;
 
 	task->tk_timeout = xprt->timeout.to_current;
-	spin_lock(&gss_auth->lock);
-	if (gss_cred_get_uptodate_ctx(cred))
-		goto out;
-	err = gss_upcall(clnt, task, cred->cr_uid);
-out:
-	spin_unlock(&gss_auth->lock);
-	return err;
+	if (!gss_cred_is_uptodate_ctx(cred))
+		return gss_upcall(clnt, task, cred);
+	return 0;
 }
 
 static u32 *
 gss_validate(struct rpc_task *task, u32 *p)
 {
 	struct rpc_cred *cred = task->tk_msg.rpc_cred;
+	struct gss_cred	*gss_cred = container_of(cred, struct gss_cred,
+						gc_base);
 	struct gss_cl_ctx *ctx = gss_cred_get_ctx(cred);
 	u32		seq, qop_state;
-	struct xdr_netobj bufin;
-	struct xdr_netobj bufout;
+	struct iovec	iov;
+	struct xdr_buf	verf_buf;
+	struct xdr_netobj mic;
 	u32		flav,len;
+	u32		service;
 
 	dprintk("RPC: gss_validate\n");
 
 	flav = ntohl(*p++);
-	if ((len = ntohl(*p++)) > RPC_MAX_AUTH_SIZE) {
-                printk("RPC: giant verf size: %ld\n", (unsigned long) len);
-                return NULL;
-	}
-	dprintk("RPC: gss_validate: verifier flavor %d, len %d\n", flav, len);
-
-	if (flav != RPC_AUTH_GSS) {
-		printk("RPC: bad verf flavor: %ld\n", (unsigned long)flav);
-		return NULL;
-	}
-	seq = htonl(task->tk_gss_seqno);
-	bufin.data = (u8 *) &seq;
-	bufin.len = sizeof(seq);
-	bufout.data = (u8 *) p;
-	bufout.len = len;
-
-	if (gss_verify_mic(ctx->gc_gss_ctx, &bufin, &bufout, &qop_state) != 0)
-		return NULL;
-	task->tk_auth->au_rslack = XDR_QUADLEN(len) + 2;
-	dprintk("RPC: GSS gss_validate: gss_verify_mic succeeded.\n");
+	if ((len = ntohl(*p++)) > RPC_MAX_AUTH_SIZE)
+                goto out_bad;
+	if (flav != RPC_AUTH_GSS)
+		goto out_bad;
+	seq = htonl(task->tk_rqstp->rq_seqno);
+	iov.iov_base = &seq;
+	iov.iov_len = sizeof(seq);
+	xdr_buf_from_iov(&iov, &verf_buf);
+	mic.data = (u8 *)p;
+	mic.len = len;
+
+	if (gss_verify_mic(ctx->gc_gss_ctx, &verf_buf, &mic, &qop_state))
+               goto out_bad;
+       service = gss_pseudoflavor_to_service(gss_cred->gc_flavor);
+       switch (service) {
+       case RPC_GSS_SVC_NONE:
+	       /* verifier data, flavor, length: */
+	       task->tk_auth->au_rslack = XDR_QUADLEN(len) + 2;
+	       break;
+       case RPC_GSS_SVC_INTEGRITY:
+	       /* verifier data, flavor, length, length, sequence number: */
+	       task->tk_auth->au_rslack = XDR_QUADLEN(len) + 4;
+	       break;
+       default:
+	       goto out_bad;
+       }
+	gss_put_ctx(ctx);
 	return p + XDR_QUADLEN(len);
+out_bad:
+	gss_put_ctx(ctx);
+	return NULL;
 }
 
+static int
+gss_wrap_req(struct rpc_task *task,
+	     kxdrproc_t encode, void *rqstp, u32 *p, void *obj)
+{
+	struct rpc_rqst	*req = (struct rpc_rqst *)rqstp;
+	struct xdr_buf	*snd_buf = &req->rq_snd_buf;
+	struct rpc_cred *cred = task->tk_msg.rpc_cred;
+	struct gss_cred	*gss_cred = container_of(cred, struct gss_cred,
+			gc_base);
+	struct gss_cl_ctx *ctx = gss_cred_get_ctx(cred);
+	u32             *integ_len = NULL;
+	int             status = -EIO;
+	u32             maj_stat = 0;
+	struct xdr_buf	integ_buf;
+	struct xdr_netobj mic;
+	u32		service;
+	u32		offset, *q;
+	struct iovec	*iov;
+
+	dprintk("RPC: gss_wrap_body\n");
+	BUG_ON(!ctx);
+	if (ctx->gc_proc != RPC_GSS_PROC_DATA) {
+		/* The spec seems a little ambiguous here, but I think that not
+		 * wrapping context destruction requests makes the most sense.
+		 */
+		status = encode(rqstp, p, obj);
+		goto out;
+	}
+	service = gss_pseudoflavor_to_service(gss_cred->gc_flavor);
+	switch (service) {
+		case RPC_GSS_SVC_NONE:
+			status = encode(rqstp, p, obj);
+			goto out;
+		case RPC_GSS_SVC_INTEGRITY:
+
+			integ_len = p++;
+			offset = (u8 *)p - (u8 *)snd_buf->head[0].iov_base;
+			*p++ = htonl(req->rq_seqno);
+
+			status = encode(rqstp, p, obj);
+			if (status)
+				goto out;
+
+			if (xdr_buf_subsegment(snd_buf, &integ_buf,
+						offset, snd_buf->len - offset))
+				goto out;
+			*integ_len = htonl(integ_buf.len);
+
+			/* guess whether we're in the head or the tail: */
+			if (snd_buf->page_len || snd_buf->tail[0].iov_len) 
+				iov = snd_buf->tail;
+			else
+				iov = snd_buf->head;
+			p = iov->iov_base + iov->iov_len;
+			mic.data = (u8 *)(p + 1);
+
+			maj_stat = gss_get_mic(ctx->gc_gss_ctx,
+					GSS_C_QOP_DEFAULT, &integ_buf, &mic);
+			status = -EIO; /* XXX? */
+			if (maj_stat)
+				goto out;
+			q = p;
+			*q++ = htonl(mic.len);
+			q += XDR_QUADLEN(mic.len);
+
+			offset = (u8 *)q - (u8 *)p;
+			iov->iov_len += offset;
+			snd_buf->len += offset;
+			break;
+		case RPC_GSS_SVC_PRIVACY:
+		default:
+			goto out;
+	}
+	status = 0;
+out:
+	gss_put_ctx(ctx);
+	dprintk("RPC: gss_wrap_req returning %d\n", status);
+	return status;
+}
+
+static int
+gss_unwrap_resp(struct rpc_task *task,
+		kxdrproc_t decode, void *rqstp, u32 *p, void *obj)
+{
+	struct rpc_rqst *req = (struct rpc_rqst *)rqstp;
+	struct xdr_buf	*rcv_buf = &req->rq_rcv_buf;
+	struct rpc_cred *cred = task->tk_msg.rpc_cred;
+	struct gss_cred *gss_cred = container_of(cred, struct gss_cred,
+			gc_base);
+	struct gss_cl_ctx *ctx = gss_cred_get_ctx(cred);
+	struct xdr_buf	integ_buf;
+	struct xdr_netobj mic;
+	int             status = -EIO;
+	u32		maj_stat = 0;
+	u32		service;
+	u32		data_offset, mic_offset;
+	u32		integ_len;
+
+	BUG_ON(!ctx);
+
+	if (ctx->gc_proc != RPC_GSS_PROC_DATA)
+		goto out_decode;
+	service = gss_pseudoflavor_to_service(gss_cred->gc_flavor);
+	switch (service) {
+		case RPC_GSS_SVC_NONE:
+			goto out_decode;
+		case RPC_GSS_SVC_INTEGRITY:
+			integ_len = ntohl(*p++);
+			if (integ_len & 3)
+				goto out;
+			data_offset = (u8 *)p - (u8 *)rcv_buf->head[0].iov_base;
+			mic_offset = integ_len + data_offset;
+			if (mic_offset > rcv_buf->len)
+				goto out;
+			if (ntohl(*p++) != req->rq_seqno)
+				goto out;
+
+			if (xdr_buf_subsegment(rcv_buf, &integ_buf, data_offset,
+						mic_offset - data_offset))
+				goto out;
+
+			if (xdr_buf_read_netobj(rcv_buf, &mic, mic_offset))
+				goto out;
+
+			maj_stat = gss_verify_mic(ctx->gc_gss_ctx, &integ_buf,
+					&mic, NULL);
+			if (maj_stat != GSS_S_COMPLETE)
+				goto out;
+			break;
+		case RPC_GSS_SVC_PRIVACY:
+		default:
+			goto out;
+	}
+out_decode:
+	status = decode(rqstp, p, obj);
+out:
+	gss_put_ctx(ctx);
+	dprintk("RPC: gss_unwrap_resp returning %d\n", status);
+	return status;
+}
+  
 static struct rpc_authops authgss_ops = {
 	.owner		= THIS_MODULE,
 	.au_flavor	= RPC_AUTH_GSS,
@@ -773,12 +953,15 @@
 	.crmarshal	= gss_marshal,
 	.crrefresh	= gss_refresh,
 	.crvalidate	= gss_validate,
+	.crwrap_req	= gss_wrap_req,
+	.crunwrap_resp	= gss_unwrap_resp,
 };
 
 static struct rpc_pipe_ops gss_upcall_ops = {
 	.upcall		= gss_pipe_upcall,
 	.downcall	= gss_pipe_downcall,
 	.destroy_msg	= gss_pipe_destroy_msg,
+	.release_pipe	= gss_pipe_release,
 };
 
 /*
--- diff/net/sunrpc/auth_gss/gss_krb5_crypto.c	2003-08-26 10:00:55.000000000 +0100
+++ source/net/sunrpc/auth_gss/gss_krb5_crypto.c	2004-02-09 10:39:57.000000000 +0000
@@ -39,6 +39,7 @@
 #include <linux/slab.h>
 #include <asm/scatterlist.h>
 #include <linux/crypto.h>
+#include <linux/highmem.h>
 #include <linux/sunrpc/gss_krb5.h>
 
 #ifdef RPC_DEBUG
@@ -57,7 +58,7 @@
         struct scatterlist sg[1];
 	u8 local_iv[16] = {0};
 
-	dprintk("RPC: gss_k5encrypt: TOP in %p out %p\nin data:\n", out, in);
+	dprintk("RPC: krb5_encrypt: input data:\n");
 	print_hexl((u32 *)in, length, 0);
 
 	if (length % crypto_tfm_alg_blocksize(tfm) != 0)
@@ -71,17 +72,18 @@
 
 	if (iv)
 		memcpy(local_iv, iv, crypto_tfm_alg_ivsize(tfm));
-	crypto_cipher_set_iv(tfm, local_iv, crypto_tfm_alg_ivsize(tfm));
 
 	memcpy(out, in, length);
 	sg[0].page = virt_to_page(out);
 	sg[0].offset = offset_in_page(out);
 	sg[0].length = length;
 
-	ret = crypto_cipher_encrypt(tfm, sg, sg, length);
+	ret = crypto_cipher_encrypt_iv(tfm, sg, sg, length, local_iv);
 
+	dprintk("RPC: krb5_encrypt: output data:\n");
+	print_hexl((u32 *)out, length, 0);
 out:
-	dprintk("gss_k5encrypt returns %d\n",ret);
+	dprintk("krb5_encrypt returns %d\n",ret);
 	return(ret);
 }
 
@@ -97,8 +99,8 @@
 	struct scatterlist sg[1];
 	u8 local_iv[16] = {0};
 
-	dprintk("RPC: gss_k5decrypt: TOP in %p out %p\nin data:\n", in, out);
-	print_hexl((u32 *)in,length,0);
+	dprintk("RPC: krb5_decrypt: input data:\n");
+	print_hexl((u32 *)in, length, 0);
 
 	if (length % crypto_tfm_alg_blocksize(tfm) != 0)
 		goto out;
@@ -110,28 +112,40 @@
 	}
 	if (iv)
 		memcpy(local_iv,iv, crypto_tfm_alg_ivsize(tfm));
-	crypto_cipher_set_iv(tfm, local_iv, crypto_tfm_alg_blocksize(tfm));
 
 	memcpy(out, in, length);
 	sg[0].page = virt_to_page(out);
 	sg[0].offset = offset_in_page(out);
 	sg[0].length = length;
 
-	ret = crypto_cipher_decrypt(tfm, sg, sg, length);
+	ret = crypto_cipher_decrypt_iv(tfm, sg, sg, length, local_iv);
 
+	dprintk("RPC: krb5_decrypt: output_data:\n");
+	print_hexl((u32 *)out, length, 0);
 out:
 	dprintk("gss_k5decrypt returns %d\n",ret);
 	return(ret);
 }
 
+void
+buf_to_sg(struct scatterlist *sg, char *ptr, int len) {
+	sg->page = virt_to_page(ptr);
+	sg->offset = offset_in_page(ptr);
+	sg->length = len;
+}
+
+/* checksum the plaintext data and the first 8 bytes of the krb5 token header,
+ * as specified by the rfc: */
 s32
-krb5_make_checksum(s32 cksumtype, struct xdr_netobj *input,
+krb5_make_checksum(s32 cksumtype, char *header, struct xdr_buf *body,
 		   struct xdr_netobj *cksum)
 {
-	s32			ret = -EINVAL;
-	struct scatterlist	sg[1];
-	char			*cksumname;
-	struct crypto_tfm	*tfm;
+	char                            *cksumname;
+	struct crypto_tfm               *tfm = NULL; /* XXX add to ctx? */
+	struct scatterlist              sg[1];
+	u32                             code = GSS_S_FAILURE;
+	int				len, thislen, offset;
+	int				i;
 
 	switch (cksumtype) {
 		case CKSUMTYPE_RSA_MD5:
@@ -145,24 +159,43 @@
 	if (!(tfm = crypto_alloc_tfm(cksumname, 0)))
 		goto out;
 	cksum->len = crypto_tfm_alg_digestsize(tfm);
-
-	if ((cksum->data = kmalloc(cksum->len, GFP_KERNEL)) == NULL) {
-		ret = -ENOMEM;
-		goto out_free_tfm;
-	}
-	sg[0].page = virt_to_page(input->data);
-	sg[0].offset = offset_in_page(input->data);
-	sg[0].length = input->len;
+	if ((cksum->data = kmalloc(cksum->len, GFP_KERNEL)) == NULL)
+		goto out;
 
 	crypto_digest_init(tfm);
+	buf_to_sg(sg, header, 8);
 	crypto_digest_update(tfm, sg, 1);
-	crypto_digest_final(tfm, cksum->data);
-
-	ret = 0;
+	if (body->head[0].iov_len) {
+		buf_to_sg(sg, body->head[0].iov_base, body->head[0].iov_len);
+		crypto_digest_update(tfm, sg, 1);
+	}
 
-out_free_tfm:
-	crypto_free_tfm(tfm);
+	len = body->page_len;
+	offset = body->page_base;
+	i = 0;
+	while (len) {
+		sg->page = body->pages[i];
+		sg->offset = offset;
+		offset = 0;
+		if (PAGE_SIZE > len)
+			thislen = len;
+		else
+			thislen = PAGE_SIZE;
+		sg->length = thislen;
+		kmap(sg->page); /* XXX kmap_atomic? */
+		crypto_digest_update(tfm, sg, 1);
+		kunmap(sg->page);
+		len -= thislen;
+		i++;
+	}
+	if (body->tail[0].iov_len) {
+		buf_to_sg(sg, body->tail[0].iov_base, body->tail[0].iov_len);
+		crypto_digest_update(tfm, sg, 1);
+	}
+	crypto_digest_final(tfm, cksum->data);
+	code = 0;
 out:
-	dprintk("RPC: gss_k5cksum: returning %d\n", ret);
-	return (ret);
+	if (tfm)
+		crypto_free_tfm(tfm);
+	return code;
 }
--- diff/net/sunrpc/auth_gss/gss_krb5_mech.c	2003-01-16 11:30:40.000000000 +0000
+++ source/net/sunrpc/auth_gss/gss_krb5_mech.c	2004-02-09 10:39:57.000000000 +0000
@@ -98,7 +98,7 @@
 			alg_mode = CRYPTO_TFM_MODE_CBC;
 			break;
 		default:
-			dprintk("RPC: get_key: unsupported algorithm %d", alg);
+			dprintk("RPC: get_key: unsupported algorithm %d\n", alg);
 			goto out_err_free_key;
 	}
 	if (!(*res = crypto_alloc_tfm(alg_name, alg_mode)))
@@ -168,7 +168,7 @@
 	return GSS_S_FAILURE;
 }
 
-void
+static void
 gss_delete_sec_context_kerberos(void *internal_ctx) {
 	struct krb5_ctx *kctx = internal_ctx;
 
@@ -181,16 +181,16 @@
 	kfree(kctx);
 }
 
-u32
+static u32
 gss_verify_mic_kerberos(struct gss_ctx		*ctx,
-			struct xdr_netobj	*signbuf,
-			struct xdr_netobj	*checksum,
-			u32		*qstate) {
+			struct xdr_buf		*message,
+			struct xdr_netobj	*mic_token,
+			u32			*qstate) {
 	u32 maj_stat = 0;
 	int qop_state;
 	struct krb5_ctx *kctx = ctx->internal_ctx_id;
 
-	maj_stat = krb5_read_token(kctx, checksum, signbuf, &qop_state,
+	maj_stat = krb5_read_token(kctx, mic_token, message, &qop_state,
 				   KG_TOK_MIC_MSG);
 	if (!maj_stat && qop_state)
 	    *qstate = qop_state;
@@ -199,21 +199,15 @@
 	return maj_stat;
 }
 
-u32
+static u32
 gss_get_mic_kerberos(struct gss_ctx	*ctx,
 		     u32		qop,
-		     struct xdr_netobj	*message_buffer,
-		     struct xdr_netobj	*message_token) {
+		     struct xdr_buf 	*message,
+		     struct xdr_netobj	*mic_token) {
 	u32 err = 0;
 	struct krb5_ctx *kctx = ctx->internal_ctx_id;
 
-	if (!message_buffer->data) return GSS_S_FAILURE;
-
-	dprintk("RPC: gss_get_mic_kerberos:"
-		" message_buffer->len %d\n",message_buffer->len);
-
-	err = krb5_make_token(kctx, qop, message_buffer,
-			      message_token, KG_TOK_MIC_MSG);
+	err = krb5_make_token(kctx, qop, message, mic_token, KG_TOK_MIC_MSG);
 
 	dprintk("RPC: gss_get_mic_kerberos returning %d\n",err);
 
@@ -237,12 +231,14 @@
 		printk("Failed to register kerberos gss mechanism!\n");
 	gm = gss_mech_get_by_OID(&gss_mech_krb5_oid);
 	gss_register_triple(RPC_AUTH_GSS_KRB5 , gm, 0, RPC_GSS_SVC_NONE);
+	gss_register_triple(RPC_AUTH_GSS_KRB5I, gm, 0, RPC_GSS_SVC_INTEGRITY);
 	gss_mech_put(gm);
 	return 0;
 }
 
 static void __exit cleanup_kerberos_module(void)
 {
+	gss_unregister_triple(RPC_AUTH_GSS_KRB5I);
 	gss_unregister_triple(RPC_AUTH_GSS_KRB5);
 }
 
--- diff/net/sunrpc/auth_gss/gss_krb5_seal.c	2003-01-16 11:30:40.000000000 +0000
+++ source/net/sunrpc/auth_gss/gss_krb5_seal.c	2004-02-09 10:39:57.000000000 +0000
@@ -63,14 +63,13 @@
 #include <linux/jiffies.h>
 #include <linux/sunrpc/gss_krb5.h>
 #include <linux/random.h>
+#include <asm/scatterlist.h>
 #include <linux/crypto.h>
 
 #ifdef RPC_DEBUG
 # define RPCDBG_FACILITY        RPCDBG_AUTH
 #endif
 
-#define CKSUM_SIZE	8
-
 static inline int
 gss_krb5_padding(int blocksize, int length) {
 	/* Most of the code is block-size independent but in practice we
@@ -79,32 +78,9 @@
 	return 8 - (length & 7);
 }
 
-/* checksum the plaintext data and the first 8 bytes of the krb5 token header,
- * as specified by the rfc: */
-static u32
-compute_checksum(s32 checksum_type, char *header, char *body, int body_len,
-		 struct xdr_netobj *md5cksum) {
-	char			*data_ptr;
-	struct xdr_netobj	plaind;
-	u32			code = GSS_S_FAILURE;
-
-	if (!(data_ptr = kmalloc(8 + body_len, GFP_KERNEL)))
-		goto out;
-	memcpy(data_ptr, header, 8);
-	memcpy(data_ptr + 8, body, body_len);
-	plaind.len = 8 + body_len;
-	plaind.data = data_ptr;
-	code = krb5_make_checksum(checksum_type, &plaind, md5cksum);
-	kfree(data_ptr);
-	code = 0;
-
-out:
-	return code;
-}
-
 u32
 krb5_make_token(struct krb5_ctx *ctx, int qop_req,
-		   struct xdr_netobj * text, struct xdr_netobj * token,
+		   struct xdr_buf *text, struct xdr_netobj *token,
 		   int toktype)
 {
 	s32			checksum_type;
@@ -113,7 +89,7 @@
 	unsigned char		*ptr, *krb5_hdr, *msg_start;
 	s32			now;
 
-	dprintk("RPC: gss_krb5_seal");
+	dprintk("RPC:     gss_krb5_seal\n");
 
 	now = jiffies;
 
@@ -144,8 +120,6 @@
 	}
 
 	token->len = g_token_size(&ctx->mech_used, 22 + tmsglen);
-	if ((token->data = kmalloc(token->len, GFP_KERNEL)) == NULL)
-		goto out_err;
 
 	ptr = token->data;
 	g_make_token_header(&ctx->mech_used, 22 + tmsglen, &ptr, toktype);
@@ -160,24 +134,11 @@
 		*(u16 *)(krb5_hdr + 4) = htons(ctx->sealalg);
 
 	if (toktype == KG_TOK_WRAP_MSG) {
-		unsigned char pad = gss_krb5_padding(blocksize, text->len);
-
-		get_random_bytes(msg_start, blocksize); /* "confounder" */
-		memcpy(msg_start + blocksize, text->data, text->len);
-
-		memset(msg_start + blocksize + text->len, pad, pad);
-
-		if (compute_checksum(checksum_type, krb5_hdr, msg_start,
-				     tmsglen, &md5cksum))
-			goto out_err;
-
-		if (krb5_encrypt(ctx->enc, NULL, msg_start, msg_start,
-					tmsglen))
-			goto out_err;
-
+		/* XXX removing support for now */
+		goto out_err;
 	} else { /* Sign only.  */
-		if (compute_checksum(checksum_type, krb5_hdr, text->data,
-					text->len, &md5cksum))
+		if (krb5_make_checksum(checksum_type, krb5_hdr, text,
+				       &md5cksum))
 			goto out_err;
 	}
 
@@ -187,10 +148,11 @@
 				  md5cksum.data, md5cksum.len))
 			goto out_err;
 		memcpy(krb5_hdr + 16,
-		       md5cksum.data + md5cksum.len - CKSUM_SIZE, CKSUM_SIZE);
+		       md5cksum.data + md5cksum.len - KRB5_CKSUM_LENGTH,
+		       KRB5_CKSUM_LENGTH);
 
 		dprintk("make_seal_token: cksum data: \n");
-		print_hexl((u32 *) (krb5_hdr + 16), CKSUM_SIZE, 0);
+		print_hexl((u32 *) (krb5_hdr + 16), KRB5_CKSUM_LENGTH, 0);
 		break;
 	default:
 		BUG();
--- diff/net/sunrpc/auth_gss/gss_krb5_unseal.c	2003-01-16 11:30:40.000000000 +0000
+++ source/net/sunrpc/auth_gss/gss_krb5_unseal.c	2004-02-09 10:39:57.000000000 +0000
@@ -68,45 +68,42 @@
 #endif
 
 
-/* message_buffer is an input if MIC and an output if WRAP. */
+/* message_buffer is an input if toktype is MIC and an output if it is WRAP:
+ * If toktype is MIC: read_token is a mic token, and message_buffer is the
+ *   data that the mic was supposedly taken over.
+ * If toktype is WRAP: read_token is a wrap token, and message_buffer is used
+ *   to return the decrypted data.
+ */
 
+/* XXX will need to change prototype and/or just split into a separate function
+ * when we add privacy (because read_token will be in pages too). */
 u32
 krb5_read_token(struct krb5_ctx *ctx,
 		struct xdr_netobj *read_token,
-		struct xdr_netobj *message_buffer,
+		struct xdr_buf *message_buffer,
 		int *qop_state, int toktype)
 {
-	s32			code;
-	int			tmsglen = 0;
-	int			conflen = 0;
 	int			signalg;
 	int			sealalg;
-	struct xdr_netobj	token = {.len = 0, .data = NULL};
 	s32			checksum_type;
-	struct xdr_netobj	cksum;
 	struct xdr_netobj	md5cksum = {.len = 0, .data = NULL};
-	struct xdr_netobj	plaind;
-	char			*data_ptr;
 	s32			now;
-	unsigned char		*plain = NULL;
-	int			cksum_len = 0;
-	int			plainlen = 0;
 	int			direction;
 	s32			seqnum;
 	unsigned char		*ptr = (unsigned char *)read_token->data;
 	int			bodysize;
 	u32			ret = GSS_S_DEFECTIVE_TOKEN;
 
-	dprintk("RPC: krb5_read_token\n");
+	dprintk("RPC:      krb5_read_token\n");
 
-	if (g_verify_token_header((struct xdr_netobj *) &ctx->mech_used,
-					&bodysize, &ptr, toktype,
+	if (g_verify_token_header(&ctx->mech_used, &bodysize, &ptr, toktype,
 					read_token->len))
 		goto out;
+	/* XXX sanity-check bodysize?? */
 
 	if (toktype == KG_TOK_WRAP_MSG) {
-		message_buffer->len = 0;
-		message_buffer->data = NULL;
+		/* XXX gone */
+		goto out;
 	}
 
 	/* get the sign and seal algorithms */
@@ -138,63 +135,6 @@
 	     signalg != SGN_ALG_HMAC_SHA1_DES3_KD))
 		goto out;
 
-	/* starting with a single alg */
-	switch (signalg) {
-	case SGN_ALG_DES_MAC_MD5:
-		cksum_len = 8;
-		break;
-	default:
-		goto out;
-	}
-
-	if (toktype == KG_TOK_WRAP_MSG)
-		tmsglen = bodysize - (14 + cksum_len);
-
-	/* get the token parameters */
-
-	/* decode the message, if WRAP */
-
-	if (toktype == KG_TOK_WRAP_MSG) {
-		dprintk("RPC: krb5_read_token KG_TOK_WRAP_MSG\n");
-
-		plain = kmalloc(tmsglen, GFP_KERNEL);
-		ret = GSS_S_FAILURE;
-		if (plain ==  NULL)
-			goto out;
-
-		code = krb5_decrypt(ctx->enc, NULL,
-				   ptr + 14 + cksum_len, plain,
-				   tmsglen);
-		if (code)
-			goto out;
-
-		plainlen = tmsglen;
-
-		conflen = crypto_tfm_alg_blocksize(ctx->enc);
-		token.len = tmsglen - conflen - plain[tmsglen - 1];
-
-		if (token.len) {
-			token.data = kmalloc(token.len, GFP_KERNEL);
-			if (token.data == NULL)
-				goto out;
-			memcpy(token.data, plain + conflen, token.len);
-		}
-
-	} else if (toktype == KG_TOK_MIC_MSG) {
-		dprintk("RPC: krb5_read_token KG_TOK_MIC_MSG\n");
-		token = *message_buffer;
-		plain = token.data;
-		plainlen = token.len;
-	} else {
-		token.len = 0;
-		token.data = NULL;
-		plain = token.data;
-		plainlen = token.len;
-	}
-
-	dprintk("RPC krb5_read_token: token.len %d plainlen %d\n", token.len,
-		plainlen);
-
 	/* compute the checksum of the message */
 
 	/* initialize the the cksum */
@@ -209,72 +149,28 @@
 
 	switch (signalg) {
 	case SGN_ALG_DES_MAC_MD5:
-		dprintk("RPC krb5_read_token SGN_ALG_DES_MAC_MD5\n");
-		/* compute the checksum of the message.
-		 * 8 = bytes of token body to be checksummed according to spec 
-		 */
-
-		data_ptr = kmalloc(8 + plainlen, GFP_KERNEL);
-		ret = GSS_S_FAILURE;
-		if (!data_ptr)
+		ret = krb5_make_checksum(checksum_type, ptr - 2,
+					 message_buffer, &md5cksum);
+		if (ret)
 			goto out;
 
-		memcpy(data_ptr, ptr - 2, 8);
-		memcpy(data_ptr + 8, plain, plainlen);
-
-		plaind.len = 8 + plainlen;
-		plaind.data = data_ptr;
-
-		code = krb5_make_checksum(checksum_type,
-					    &plaind, &md5cksum);
-
-		kfree(data_ptr);
-
-		if (code)
+		ret = krb5_encrypt(ctx->seq, NULL, md5cksum.data,
+				   md5cksum.data, 16);
+		if (ret)
 			goto out;
 
-		code = krb5_encrypt(ctx->seq, NULL, md5cksum.data,
-					  md5cksum.data, 16);
-		if (code)
+		if (memcmp(md5cksum.data + 8, ptr + 14, 8)) {
+			ret = GSS_S_BAD_SIG;
 			goto out;
-
-		if (signalg == 0)
-			cksum.len = 8;
-		else
-			cksum.len = 16;
-		cksum.data = md5cksum.data + 16 - cksum.len;
-
-		dprintk
-		    ("RPC: krb5_read_token: memcmp digest cksum.len %d:\n",
-		     cksum.len);
-		dprintk("          md5cksum.data\n");
-		print_hexl((u32 *) md5cksum.data, 16, 0);
-		dprintk("          cksum.data:\n");
-		print_hexl((u32 *) cksum.data, cksum.len, 0);
-		{
-			u32 *p;
-
-			(u8 *) p = ptr + 14;
-			dprintk("          ptr+14:\n");
-			print_hexl(p, cksum.len, 0);
 		}
-
-		code = memcmp(cksum.data, ptr + 14, cksum.len);
 		break;
 	default:
 		ret = GSS_S_DEFECTIVE_TOKEN;
 		goto out;
 	}
 
-	ret = GSS_S_BAD_SIG;
-	if (code)
-		goto out;
-
 	/* it got through unscathed.  Make sure the context is unexpired */
 
-	if (toktype == KG_TOK_WRAP_MSG)
-		*message_buffer = token;
-
 	if (qop_state)
 		*qop_state = GSS_C_QOP_DEFAULT;
 
@@ -287,8 +183,8 @@
 	/* do sequencing checks */
 
 	ret = GSS_S_BAD_SIG;
-	if ((code = krb5_get_seq_num(ctx->seq, ptr + 14, ptr + 6, &direction,
-				   &seqnum)))
+	if ((ret = krb5_get_seq_num(ctx->seq, ptr + 14, ptr + 6, &direction,
+				    &seqnum)))
 		goto out;
 
 	if ((ctx->initiate && direction != 0xff) ||
@@ -298,9 +194,5 @@
 	ret = GSS_S_COMPLETE;
 out:
 	if (md5cksum.data) kfree(md5cksum.data);
-	if (toktype == KG_TOK_WRAP_MSG) {
-		if (plain) kfree(plain);
-		if (ret && token.data) kfree(token.data);
-	}
 	return ret;
 }
--- diff/net/sunrpc/auth_gss/gss_mech_switch.c	2003-06-30 10:07:24.000000000 +0100
+++ source/net/sunrpc/auth_gss/gss_mech_switch.c	2004-02-09 10:39:57.000000000 +0000
@@ -70,6 +70,7 @@
 	}
 	gm->gm_oid.len = mech_type->len;
 	if (!(gm->gm_oid.data = kmalloc(mech_type->len, GFP_KERNEL))) {
+		kfree(gm);
 		printk("Failed to allocate memory in gss_mech_register");
 		return -1;
 	}
@@ -195,7 +196,7 @@
 u32
 gss_get_mic(struct gss_ctx	*context_handle,
 	    u32			qop,
-	    struct xdr_netobj	*message,
+	    struct xdr_buf	*message,
 	    struct xdr_netobj	*mic_token)
 {
 	 return context_handle->mech_type->gm_ops
@@ -209,7 +210,7 @@
 
 u32
 gss_verify_mic(struct gss_ctx		*context_handle,
-	       struct xdr_netobj	*message,
+	       struct xdr_buf		*message,
 	       struct xdr_netobj	*mic_token,
 	       u32			*qstate)
 {
--- diff/net/sunrpc/auth_gss/gss_pseudoflavors.c	2003-01-16 11:30:40.000000000 +0000
+++ source/net/sunrpc/auth_gss/gss_pseudoflavors.c	2004-02-09 10:39:57.000000000 +0000
@@ -92,6 +92,7 @@
 	return 0;
 
 err_unlock:
+	kfree(triple);
 	spin_unlock(&registered_triples_lock);
 err:
 	return -1;
--- diff/net/sunrpc/auth_unix.c	2003-10-09 09:47:17.000000000 +0100
+++ source/net/sunrpc/auth_unix.c	2004-02-09 10:39:57.000000000 +0000
@@ -82,7 +82,7 @@
 		cred->uc_gid = cred->uc_pgid = 0;
 		cred->uc_gids[0] = NOGROUP;
 	} else {
-		int groups = acred->ngroups;
+		int groups = acred->group_info->ngroups;
 		if (groups > NFS_NGROUPS)
 			groups = NFS_NGROUPS;
 
@@ -91,7 +91,7 @@
 		cred->uc_puid = current->uid;
 		cred->uc_pgid = current->gid;
 		for (i = 0; i < groups; i++)
-			cred->uc_gids[i] = (gid_t) acred->groups[i];
+			cred->uc_gids[i] = GROUP_AT(acred->group_info, i);
 		if (i < NFS_NGROUPS)
 		  cred->uc_gids[i] = NOGROUP;
 	}
@@ -126,11 +126,11 @@
 		 || cred->uc_pgid != current->gid)
 			return 0;
 
-		groups = acred->ngroups;
+		groups = acred->group_info->ngroups;
 		if (groups > NFS_NGROUPS)
 			groups = NFS_NGROUPS;
 		for (i = 0; i < groups ; i++)
-			if (cred->uc_gids[i] != (gid_t) acred->groups[i])
+			if (cred->uc_gids[i] != GROUP_AT(acred->group_info, i))
 				return 0;
 		return 1;
 	}
--- diff/net/sunrpc/clnt.c	2003-10-27 09:20:39.000000000 +0000
+++ source/net/sunrpc/clnt.c	2004-02-09 10:39:57.000000000 +0000
@@ -30,6 +30,7 @@
 #include <linux/utsname.h>
 
 #include <linux/sunrpc/clnt.h>
+#include <linux/workqueue.h>
 #include <linux/sunrpc/rpc_pipe_fs.h>
 
 #include <linux/nfs.h>
@@ -101,6 +102,7 @@
 {
 	struct rpc_version	*version;
 	struct rpc_clnt		*clnt = NULL;
+	int len;
 
 	dprintk("RPC: creating %s client for %s (xprt %p)\n",
 		program->name, servname, xprt);
@@ -115,23 +117,37 @@
 		goto out_no_clnt;
 	memset(clnt, 0, sizeof(*clnt));
 	atomic_set(&clnt->cl_users, 0);
+	atomic_set(&clnt->cl_count, 1);
+	clnt->cl_parent = clnt;
+
+	clnt->cl_server = clnt->cl_inline_name;
+	len = strlen(servname) + 1;
+	if (len > sizeof(clnt->cl_inline_name)) {
+		char *buf = kmalloc(len, GFP_KERNEL);
+		if (buf != 0)
+			clnt->cl_server = buf;
+		else
+			len = sizeof(clnt->cl_inline_name);
+	}
+	strlcpy(clnt->cl_server, servname, len);
 
 	clnt->cl_xprt     = xprt;
 	clnt->cl_procinfo = version->procs;
 	clnt->cl_maxproc  = version->nrprocs;
-	clnt->cl_server   = servname;
 	clnt->cl_protname = program->name;
+	clnt->cl_pmap	  = &clnt->cl_pmap_default;
 	clnt->cl_port     = xprt->addr.sin_port;
 	clnt->cl_prog     = program->number;
 	clnt->cl_vers     = version->number;
 	clnt->cl_prot     = xprt->prot;
 	clnt->cl_stats    = program->stats;
-	INIT_RPC_WAITQ(&clnt->cl_bindwait, "bindwait");
+	INIT_RPC_WAITQ(&clnt->cl_pmap_default.pm_bindwait, "bindwait");
 
 	if (!clnt->cl_port)
 		clnt->cl_autobind = 1;
 
-	rpc_init_rtt(&clnt->cl_rtt, xprt->timeout.to_initval);
+	clnt->cl_rtt = &clnt->cl_rtt_default;
+	rpc_init_rtt(&clnt->cl_rtt_default, xprt->timeout.to_initval);
 
 	if (rpc_setup_pipedir(clnt, program->pipe_dir_name) < 0)
 		goto out_no_path;
@@ -156,12 +172,40 @@
 out_no_auth:
 	rpc_rmdir(clnt->cl_pathname);
 out_no_path:
+	if (clnt->cl_server != clnt->cl_inline_name)
+		kfree(clnt->cl_server);
 	kfree(clnt);
 	clnt = NULL;
 	goto out;
 }
 
 /*
+ * This function clones the RPC client structure. It allows us to share the
+ * same transport while varying parameters such as the authentication
+ * flavour.
+ */
+struct rpc_clnt *
+rpc_clone_client(struct rpc_clnt *clnt)
+{
+	struct rpc_clnt *new;
+
+	new = (struct rpc_clnt *)kmalloc(sizeof(*new), GFP_KERNEL);
+	if (!new)
+		goto out_no_clnt;
+	memcpy(new, clnt, sizeof(*new));
+	atomic_set(&new->cl_count, 1);
+	atomic_set(&new->cl_users, 0);
+	atomic_inc(&new->cl_parent->cl_count);
+	if (new->cl_auth)
+		atomic_inc(&new->cl_auth->au_count);
+out:
+	return new;
+out_no_clnt:
+	printk(KERN_INFO "RPC: out of memory in %s\n", __FUNCTION__);
+	goto out;
+}
+
+/*
  * Properly shut down an RPC client, terminating all outstanding
  * requests. Note that we must be certain that cl_oneshot and
  * cl_dead are cleared, or else the client would be destroyed
@@ -200,19 +244,29 @@
 int
 rpc_destroy_client(struct rpc_clnt *clnt)
 {
+	if (!atomic_dec_and_test(&clnt->cl_count))
+		return 1;
+	BUG_ON(atomic_read(&clnt->cl_users) != 0);
+
 	dprintk("RPC: destroying %s client for %s\n",
 			clnt->cl_protname, clnt->cl_server);
-
 	if (clnt->cl_auth) {
 		rpcauth_destroy(clnt->cl_auth);
 		clnt->cl_auth = NULL;
 	}
+	if (clnt->cl_parent != clnt) {
+		rpc_destroy_client(clnt->cl_parent);
+		goto out_free;
+	}
 	if (clnt->cl_pathname[0])
 		rpc_rmdir(clnt->cl_pathname);
 	if (clnt->cl_xprt) {
 		xprt_destroy(clnt->cl_xprt);
 		clnt->cl_xprt = NULL;
 	}
+	if (clnt->cl_server != clnt->cl_inline_name)
+		kfree(clnt->cl_server);
+out_free:
 	kfree(clnt);
 	return 0;
 }
@@ -567,7 +621,8 @@
 		rpc_exit(task, -EIO);
 		return;
 	}
-	if (encode && (status = encode(req, p, task->tk_msg.rpc_argp)) < 0) {
+	if (encode && (status = rpcauth_wrap_req(task, encode, req, p,
+						 task->tk_msg.rpc_argp)) < 0) {
 		printk(KERN_WARNING "%s: can't encode arguments: %d\n",
 				clnt->cl_protname, -status);
 		rpc_exit(task, status);
@@ -743,7 +798,7 @@
 	to->to_retries = clnt->cl_timeout.to_retries;
 
 	dprintk("RPC: %4d call_timeout (major)\n", task->tk_pid);
-	if (clnt->cl_softrtry) {
+	if (RPC_IS_SOFT(task)) {
 		if (clnt->cl_chatty)
 			printk(KERN_NOTICE "%s: server %s not responding, timed out\n",
 				clnt->cl_protname, clnt->cl_server);
@@ -786,7 +841,7 @@
 	}
 
 	if (task->tk_status < 12) {
-		if (!clnt->cl_softrtry) {
+		if (!RPC_IS_SOFT(task)) {
 			task->tk_action = call_bind;
 			clnt->cl_stats->rpcretrans++;
 			goto out_retry;
@@ -826,7 +881,8 @@
 	task->tk_action = NULL;
 
 	if (decode)
-		task->tk_status = decode(req, p, task->tk_msg.rpc_resp);
+		task->tk_status = rpcauth_unwrap_resp(task, decode, req, p,
+						      task->tk_msg.rpc_resp);
 	dprintk("RPC: %4d call_decode result %d\n", task->tk_pid,
 					task->tk_status);
 	return;
--- diff/net/sunrpc/pmap_clnt.c	2003-06-09 14:18:21.000000000 +0100
+++ source/net/sunrpc/pmap_clnt.c	2004-02-09 10:39:57.000000000 +0000
@@ -41,7 +41,7 @@
 void
 rpc_getport(struct rpc_task *task, struct rpc_clnt *clnt)
 {
-	struct rpc_portmap *map = &clnt->cl_pmap;
+	struct rpc_portmap *map = clnt->cl_pmap;
 	struct sockaddr_in *sap = &clnt->cl_xprt->addr;
 	struct rpc_message msg = {
 		.rpc_proc	= &pmap_procedures[PMAP_GETPORT],
@@ -57,12 +57,12 @@
 			map->pm_prog, map->pm_vers, map->pm_prot);
 
 	spin_lock(&pmap_lock);
-	if (clnt->cl_binding) {
-		rpc_sleep_on(&clnt->cl_bindwait, task, NULL, 0);
+	if (map->pm_binding) {
+		rpc_sleep_on(&map->pm_bindwait, task, NULL, 0);
 		spin_unlock(&pmap_lock);
 		return;
 	}
-	clnt->cl_binding = 1;
+	map->pm_binding = 1;
 	spin_unlock(&pmap_lock);
 
 	task->tk_status = -EACCES; /* why set this? returns -EIO below */
@@ -85,8 +85,8 @@
 
 bailout:
 	spin_lock(&pmap_lock);
-	clnt->cl_binding = 0;
-	rpc_wake_up(&clnt->cl_bindwait);
+	map->pm_binding = 0;
+	rpc_wake_up(&map->pm_bindwait);
 	spin_unlock(&pmap_lock);
 	task->tk_status = -EIO;
 	task->tk_action = NULL;
@@ -129,6 +129,7 @@
 pmap_getport_done(struct rpc_task *task)
 {
 	struct rpc_clnt	*clnt = task->tk_client;
+	struct rpc_portmap *map = clnt->cl_pmap;
 
 	dprintk("RPC: %4d pmap_getport_done(status %d, port %d)\n",
 			task->tk_pid, task->tk_status, clnt->cl_port);
@@ -145,8 +146,8 @@
 		clnt->cl_xprt->addr.sin_port = clnt->cl_port;
 	}
 	spin_lock(&pmap_lock);
-	clnt->cl_binding = 0;
-	rpc_wake_up(&clnt->cl_bindwait);
+	map->pm_binding = 0;
+	rpc_wake_up(&map->pm_bindwait);
 	spin_unlock(&pmap_lock);
 }
 
--- diff/net/sunrpc/rpc_pipe.c	2003-10-09 09:47:34.000000000 +0100
+++ source/net/sunrpc/rpc_pipe.c	2004-02-09 10:39:57.000000000 +0000
@@ -25,6 +25,7 @@
 #include <linux/seq_file.h>
 
 #include <linux/sunrpc/clnt.h>
+#include <linux/workqueue.h>
 #include <linux/sunrpc/rpc_pipe_fs.h>
 
 static struct vfsmount *rpc_mount;
@@ -35,6 +36,8 @@
 
 static kmem_cache_t *rpc_inode_cachep;
 
+#define RPC_UPCALL_TIMEOUT (30*HZ)
+
 static void
 __rpc_purge_upcall(struct inode *inode, int err)
 {
@@ -47,15 +50,25 @@
 		msg->errno = err;
 		rpci->ops->destroy_msg(msg);
 	}
+	while (!list_empty(&rpci->in_upcall)) {
+		msg = list_entry(rpci->pipe.next, struct rpc_pipe_msg, list);
+		list_del_init(&msg->list);
+		msg->errno = err;
+		rpci->ops->destroy_msg(msg);
+	}
 	rpci->pipelen = 0;
 	wake_up(&rpci->waitq);
 }
 
-void
-rpc_purge_upcall(struct inode *inode, int err)
+static void
+rpc_timeout_upcall_queue(void *data)
 {
+	struct rpc_inode *rpci = (struct rpc_inode *)data;
+	struct inode *inode = &rpci->vfs_inode;
+
 	down(&inode->i_sem);
-	__rpc_purge_upcall(inode, err);
+	if (rpci->nreaders == 0 && !list_empty(&rpci->pipe))
+		__rpc_purge_upcall(inode, -ETIMEDOUT);
 	up(&inode->i_sem);
 }
 
@@ -66,7 +79,13 @@
 	int res = 0;
 
 	down(&inode->i_sem);
-	if (rpci->nreaders || (rpci->flags & RPC_PIPE_WAIT_FOR_OPEN)) {
+	if (rpci->nreaders) {
+		list_add_tail(&msg->list, &rpci->pipe);
+		rpci->pipelen += msg->len;
+	} else if (rpci->flags & RPC_PIPE_WAIT_FOR_OPEN) {
+		if (list_empty(&rpci->pipe))
+			schedule_delayed_work(&rpci->queue_timeout,
+					RPC_UPCALL_TIMEOUT);
 		list_add_tail(&msg->list, &rpci->pipe);
 		rpci->pipelen += msg->len;
 	} else
@@ -76,17 +95,31 @@
 	return res;
 }
 
-void
-rpc_inode_setowner(struct inode *inode, void *private)
+static void
+rpc_close_pipes(struct inode *inode)
 {
 	struct rpc_inode *rpci = RPC_I(inode);
+
+	cancel_delayed_work(&rpci->queue_timeout);
+	flush_scheduled_work();
 	down(&inode->i_sem);
-	rpci->private = private;
-	if (!private)
+	if (rpci->ops != NULL) {
+		rpci->nreaders = 0;
 		__rpc_purge_upcall(inode, -EPIPE);
+		rpci->nwriters = 0;
+		if (rpci->ops->release_pipe)
+			rpci->ops->release_pipe(inode);
+		rpci->ops = NULL;
+	}
 	up(&inode->i_sem);
 }
 
+static inline void
+rpc_inode_setowner(struct inode *inode, void *private)
+{
+	RPC_I(inode)->private = private;
+}
+
 static struct inode *
 rpc_alloc_inode(struct super_block *sb)
 {
@@ -110,9 +143,11 @@
 	int res = -ENXIO;
 
 	down(&inode->i_sem);
-	if (rpci->private != NULL) {
+	if (rpci->ops != NULL) {
 		if (filp->f_mode & FMODE_READ)
 			rpci->nreaders ++;
+		if (filp->f_mode & FMODE_WRITE)
+			rpci->nwriters ++;
 		res = 0;
 	}
 	up(&inode->i_sem);
@@ -125,16 +160,24 @@
 	struct rpc_inode *rpci = RPC_I(filp->f_dentry->d_inode);
 	struct rpc_pipe_msg *msg;
 
+	down(&inode->i_sem);
+	if (rpci->ops == NULL)
+		goto out;
 	msg = (struct rpc_pipe_msg *)filp->private_data;
 	if (msg != NULL) {
 		msg->errno = -EPIPE;
+		list_del_init(&msg->list);
 		rpci->ops->destroy_msg(msg);
 	}
-	down(&inode->i_sem);
+	if (filp->f_mode & FMODE_WRITE)
+		rpci->nwriters --;
 	if (filp->f_mode & FMODE_READ)
 		rpci->nreaders --;
-	if (!rpci->nreaders && !(rpci->flags & RPC_PIPE_WAIT_FOR_OPEN))
+	if (!rpci->nreaders)
 		__rpc_purge_upcall(inode, -EPIPE);
+	if (rpci->ops->release_pipe)
+		rpci->ops->release_pipe(inode);
+out:
 	up(&inode->i_sem);
 	return 0;
 }
@@ -148,7 +191,7 @@
 	int res = 0;
 
 	down(&inode->i_sem);
-	if (!rpci->private) {
+	if (rpci->ops == NULL) {
 		res = -EPIPE;
 		goto out_unlock;
 	}
@@ -158,7 +201,7 @@
 			msg = list_entry(rpci->pipe.next,
 					struct rpc_pipe_msg,
 					list);
-			list_del_init(&msg->list);
+			list_move(&msg->list, &rpci->in_upcall);
 			rpci->pipelen -= msg->len;
 			filp->private_data = msg;
 			msg->copied = 0;
@@ -170,6 +213,7 @@
 	res = rpci->ops->upcall(filp, msg, buf, len);
 	if (res < 0 || msg->len == msg->copied) {
 		filp->private_data = NULL;
+		list_del_init(&msg->list);
 		rpci->ops->destroy_msg(msg);
 	}
 out_unlock:
@@ -186,7 +230,7 @@
 
 	down(&inode->i_sem);
 	res = -EPIPE;
-	if (rpci->private != NULL)
+	if (rpci->ops != NULL)
 		res = rpci->ops->downcall(filp, buf, len);
 	up(&inode->i_sem);
 	return res;
@@ -202,7 +246,7 @@
 	poll_wait(filp, &rpci->waitq, wait);
 
 	mask = POLLOUT | POLLWRNORM;
-	if (rpci->private == NULL)
+	if (rpci->ops == NULL)
 		mask |= POLLERR | POLLHUP;
 	if (!list_empty(&rpci->pipe))
 		mask |= POLLIN | POLLRDNORM;
@@ -218,7 +262,7 @@
 
 	switch (cmd) {
 	case FIONREAD:
-		if (!rpci->private)
+		if (rpci->ops == NULL)
 			return -EPIPE;
 		len = rpci->pipelen;
 		if (filp->private_data) {
@@ -460,6 +504,7 @@
 		do {
 			dentry = dvec[--n];
 			if (dentry->d_inode) {
+				rpc_close_pipes(dentry->d_inode);
 				rpc_inode_setowner(dentry->d_inode, NULL);
 				simple_unlink(dir, dentry);
 			}
@@ -539,7 +584,10 @@
 	int error;
 
 	shrink_dcache_parent(dentry);
-	rpc_inode_setowner(dentry->d_inode, NULL);
+	if (dentry->d_inode) {
+		rpc_close_pipes(dentry->d_inode);
+		rpc_inode_setowner(dentry->d_inode, NULL);
+	}
 	if ((error = simple_rmdir(dir, dentry)) != 0)
 		return error;
 	if (!error) {
@@ -691,6 +739,7 @@
 	}
 	d_drop(dentry);
 	if (dentry->d_inode) {
+		rpc_close_pipes(dentry->d_inode);
 		rpc_inode_setowner(dentry->d_inode, NULL);
 		error = simple_unlink(dir, dentry);
 	}
@@ -766,9 +815,12 @@
 		inode_init_once(&rpci->vfs_inode);
 		rpci->private = NULL;
 		rpci->nreaders = 0;
+		rpci->nwriters = 0;
+		INIT_LIST_HEAD(&rpci->in_upcall);
 		INIT_LIST_HEAD(&rpci->pipe);
 		rpci->pipelen = 0;
 		init_waitqueue_head(&rpci->waitq);
+		INIT_WORK(&rpci->queue_timeout, rpc_timeout_upcall_queue, rpci);
 		rpci->ops = NULL;
 	}
 }
--- diff/net/sunrpc/sched.c	2003-10-09 09:47:17.000000000 +0100
+++ source/net/sunrpc/sched.c	2004-02-09 10:39:57.000000000 +0000
@@ -731,8 +731,11 @@
 	list_add(&task->tk_task, &all_tasks);
 	spin_unlock(&rpc_sched_lock);
 
-	if (clnt)
+	if (clnt) {
 		atomic_inc(&clnt->cl_users);
+		if (clnt->cl_softrtry)
+			task->tk_flags |= RPC_TASK_SOFT;
+	}
 
 #ifdef RPC_DEBUG
 	task->tk_magic = 0xf00baa;
@@ -1057,7 +1060,7 @@
 void
 rpciod_down(void)
 {
-	unsigned long flags;
+	DECLARE_WAITQUEUE(wait, current);
 
 	down(&rpciod_sema);
 	dprintk("rpciod_down pid %d sema %d\n", rpciod_pid, rpciod_users);
@@ -1082,17 +1085,24 @@
 	/*
 	 * Display a message if we're going to wait longer.
 	 */
-	while (rpciod_pid) {
-		dprintk("rpciod_down: waiting for pid %d to exit\n", rpciod_pid);
+	add_wait_queue(&rpciod_killer, &wait);
+	for (;;) {
+		set_current_state(TASK_INTERRUPTIBLE);
+		if (rpciod_pid == 0)
+			break;
+		dprintk("rpciod_down: waiting for pid %d to exit\n",
+			rpciod_pid);
 		if (signalled()) {
 			dprintk("rpciod_down: caught signal\n");
 			break;
 		}
-		interruptible_sleep_on(&rpciod_killer);
+		schedule();
 	}
-	spin_lock_irqsave(&current->sighand->siglock, flags);
+	__set_current_state(TASK_RUNNING);
+	remove_wait_queue(&rpciod_killer, &wait);
+	spin_lock_irq(&current->sighand->siglock);
 	recalc_sigpending();
-	spin_unlock_irqrestore(&current->sighand->siglock, flags);
+	spin_unlock_irq(&current->sighand->siglock);
 out:
 	up(&rpciod_sema);
 }
--- diff/net/sunrpc/sunrpc_syms.c	2003-10-09 09:47:34.000000000 +0100
+++ source/net/sunrpc/sunrpc_syms.c	2004-02-09 10:39:57.000000000 +0000
@@ -21,6 +21,7 @@
 #include <linux/sunrpc/svc.h>
 #include <linux/sunrpc/svcsock.h>
 #include <linux/sunrpc/auth.h>
+#include <linux/workqueue.h>
 #include <linux/sunrpc/rpc_pipe_fs.h>
 
 
@@ -40,6 +41,7 @@
 
 /* RPC client functions */
 EXPORT_SYMBOL(rpc_create_client);
+EXPORT_SYMBOL(rpc_clone_client);
 EXPORT_SYMBOL(rpc_destroy_client);
 EXPORT_SYMBOL(rpc_shutdown_client);
 EXPORT_SYMBOL(rpc_release_client);
@@ -65,6 +67,7 @@
 /* Client credential cache */
 EXPORT_SYMBOL(rpcauth_register);
 EXPORT_SYMBOL(rpcauth_unregister);
+EXPORT_SYMBOL(rpcauth_create);
 EXPORT_SYMBOL(rpcauth_lookupcred);
 EXPORT_SYMBOL(rpcauth_lookup_credcache);
 EXPORT_SYMBOL(rpcauth_free_credcache);
@@ -125,6 +128,9 @@
 EXPORT_SYMBOL(xdr_shift_buf);
 EXPORT_SYMBOL(xdr_write_pages);
 EXPORT_SYMBOL(xdr_read_pages);
+EXPORT_SYMBOL(xdr_buf_from_iov);
+EXPORT_SYMBOL(xdr_buf_subsegment);
+EXPORT_SYMBOL(xdr_buf_read_netobj);
 
 /* Debugging symbols */
 #ifdef RPC_DEBUG
--- diff/net/sunrpc/svcauth_unix.c	2003-07-08 09:55:20.000000000 +0100
+++ source/net/sunrpc/svcauth_unix.c	2004-02-09 10:39:57.000000000 +0000
@@ -434,11 +434,11 @@
 	if (slen > 16 || (len -= (slen + 2)*4) < 0)
 		goto badcred;
 	for (i = 0; i < slen; i++)
-		if (i < NGROUPS)
+		if (i < SVC_CRED_NGROUPS)
 			cred->cr_groups[i] = ntohl(svc_getu32(argv));
 		else
 			svc_getu32(argv);
-	if (i < NGROUPS)
+	if (i < SVC_CRED_NGROUPS)
 		cred->cr_groups[i] = NOGROUP;
 
 	if (svc_getu32(argv) != RPC_AUTH_NULL || svc_getu32(argv) != 0) {
--- diff/net/sunrpc/xdr.c	2003-10-27 09:20:39.000000000 +0000
+++ source/net/sunrpc/xdr.c	2004-02-09 10:39:57.000000000 +0000
@@ -107,16 +107,23 @@
 xdr_encode_pages(struct xdr_buf *xdr, struct page **pages, unsigned int base,
 		 unsigned int len)
 {
+	struct iovec *tail = xdr->tail;
+	u32 *p;
+
 	xdr->pages = pages;
 	xdr->page_base = base;
 	xdr->page_len = len;
 
+	p = (u32 *)xdr->head[0].iov_base + XDR_QUADLEN(xdr->head[0].iov_len);
+	tail->iov_base = p;
+	tail->iov_len = 0;
+
 	if (len & 3) {
-		struct iovec *iov = xdr->tail;
 		unsigned int pad = 4 - (len & 3);
 
-		iov->iov_base = (void *) "\0\0\0";
-		iov->iov_len  = pad;
+		*p = 0;
+		tail->iov_base = (char *)p + (len & 3);
+		tail->iov_len  = pad;
 		len += pad;
 	}
 	xdr->len += len;
@@ -538,7 +545,7 @@
  * Copies data into an arbitrary memory location from an array of pages
  * The copy is assumed to be non-overlapping.
  */
-static void
+void
 _copy_from_pages(char *p, struct page **pages, size_t pgbase, size_t len)
 {
 	struct page **pgfrom;
@@ -731,3 +738,145 @@
 	xdr->p = (uint32_t *)((char *)iov->iov_base + padding);
 	xdr->end = (uint32_t *)((char *)iov->iov_base + iov->iov_len);
 }
+
+static struct iovec empty_iov = {.iov_base = NULL, .iov_len = 0};
+
+void
+xdr_buf_from_iov(struct iovec *iov, struct xdr_buf *buf)
+{
+	buf->head[0] = *iov;
+	buf->tail[0] = empty_iov;
+	buf->page_len = 0;
+	buf->len = iov->iov_len;
+}
+
+/* Sets subiov to the intersection of iov with the buffer of length len
+ * starting base bytes after iov.  Indicates empty intersection by setting
+ * length of subiov to zero.  Decrements len by length of subiov, sets base
+ * to zero (or decrements it by length of iov if subiov is empty). */
+static void
+iov_subsegment(struct iovec *iov, struct iovec *subiov, int *base, int *len)
+{
+	if (*base > iov->iov_len) {
+		subiov->iov_base = NULL;
+		subiov->iov_len = 0;
+		*base -= iov->iov_len;
+	} else {
+		subiov->iov_base = iov->iov_base + *base;
+		subiov->iov_len = min(*len, (int)iov->iov_len - *base);
+		*base = 0;
+	}
+	*len -= subiov->iov_len; 
+}
+
+/* Sets subbuf to the portion of buf of length len beginning base bytes
+ * from the start of buf. Returns -1 if base of length are out of bounds. */
+int
+xdr_buf_subsegment(struct xdr_buf *buf, struct xdr_buf *subbuf,
+			int base, int len)
+{
+	int i;
+
+	subbuf->len = len;
+	iov_subsegment(buf->head, subbuf->head, &base, &len);
+
+	if (base < buf->page_len) {
+		i = (base + buf->page_base) >> PAGE_CACHE_SHIFT;
+		subbuf->pages = &buf->pages[i];
+		subbuf->page_base = (base + buf->page_base) & ~PAGE_CACHE_MASK;
+		subbuf->page_len = min((int)buf->page_len - base, len);
+		len -= subbuf->page_len;
+		base = 0;
+	} else {
+		base -= buf->page_len;
+		subbuf->page_len = 0;
+	}
+
+	iov_subsegment(buf->tail, subbuf->tail, &base, &len);
+	if (base || len)
+		return -1;
+	return 0;
+}
+
+/* obj is assumed to point to allocated memory of size at least len: */
+static int
+read_bytes_from_xdr_buf(struct xdr_buf *buf, int base, void *obj, int len)
+{
+	struct xdr_buf subbuf;
+	int this_len;
+	int status;
+
+	status = xdr_buf_subsegment(buf, &subbuf, base, len);
+	if (status)
+		goto out;
+	this_len = min(len, (int)subbuf.head[0].iov_len);
+	memcpy(obj, subbuf.head[0].iov_base, this_len);
+	len -= this_len;
+	obj += this_len;
+	this_len = min(len, (int)subbuf.page_len);
+	if (this_len)
+		_copy_from_pages(obj, subbuf.pages, subbuf.page_base, this_len);
+	len -= this_len;
+	obj += this_len;
+	this_len = min(len, (int)subbuf.tail[0].iov_len);
+	memcpy(obj, subbuf.tail[0].iov_base, this_len);
+out:
+	return status;
+}
+
+static int
+read_u32_from_xdr_buf(struct xdr_buf *buf, int base, u32 *obj)
+{
+	u32	raw;
+	int	status;
+
+	status = read_bytes_from_xdr_buf(buf, base, &raw, sizeof(*obj));
+	if (status)
+		return status;
+	*obj = ntohl(raw);
+	return 0;
+}
+
+/* If the netobj starting offset bytes from the start of xdr_buf is contained
+ * entirely in the head or the tail, set object to point to it; otherwise
+ * try to find space for it at the end of the tail, copy it there, and
+ * set obj to point to it. */
+int
+xdr_buf_read_netobj(struct xdr_buf *buf, struct xdr_netobj *obj, int offset)
+{
+	u32	tail_offset = buf->head[0].iov_len + buf->page_len;
+	u32	obj_end_offset;
+
+	if (read_u32_from_xdr_buf(buf, offset, &obj->len))
+		goto out;
+	obj_end_offset = offset + 4 + obj->len;
+
+	if (obj_end_offset <= buf->head[0].iov_len) {
+		/* The obj is contained entirely in the head: */
+		obj->data = buf->head[0].iov_base + offset + 4;
+	} else if (offset + 4 >= tail_offset) {
+		if (obj_end_offset - tail_offset
+				> buf->tail[0].iov_len)
+			goto out;
+		/* The obj is contained entirely in the tail: */
+		obj->data = buf->tail[0].iov_base
+			+ offset - tail_offset + 4;
+	} else {
+		/* use end of tail as storage for obj:
+		 * (We don't copy to the beginning because then we'd have
+		 * to worry about doing a potentially overlapping copy.
+		 * This assumes the object is at most half the length of the
+		 * tail.) */
+		if (obj->len > buf->tail[0].iov_len)
+			goto out;
+		obj->data = buf->tail[0].iov_base + buf->tail[0].iov_len - 
+				obj->len;
+		if (read_bytes_from_xdr_buf(buf, offset + 4,
+					obj->data, obj->len))
+			goto out;
+
+	}
+	return 0;
+out:
+	return -1;
+}
--- diff/net/sunrpc/xprt.c	2003-10-09 09:47:34.000000000 +0100
+++ source/net/sunrpc/xprt.c	2004-02-09 10:39:57.000000000 +0000
@@ -59,6 +59,7 @@
 #include <linux/unistd.h>
 #include <linux/sunrpc/clnt.h>
 #include <linux/file.h>
+#include <linux/workqueue.h>
 
 #include <net/sock.h>
 #include <net/checksum.h>
@@ -75,6 +76,7 @@
 #endif
 
 #define XPRT_MAX_BACKOFF	(8)
+#define XPRT_IDLE_TIMEOUT	(5*60*HZ)
 
 /*
  * Local functions
@@ -139,25 +141,33 @@
 {
 	struct rpc_rqst *req = task->tk_rqstp;
 
-	if (!xprt->snd_task) {
-		if (xprt->nocong || __xprt_get_cong(xprt, task)) {
-			xprt->snd_task = task;
-			if (req) {
-				req->rq_bytes_sent = 0;
-				req->rq_ntrans++;
-			}
-		}
+	if (test_and_set_bit(XPRT_LOCKED, &xprt->sockstate)) {
+		if (task == xprt->snd_task)
+			return 1;
+		if (task == NULL)
+			return 0;
+		goto out_sleep;
 	}
-	if (xprt->snd_task != task) {
-		dprintk("RPC: %4d TCP write queue full\n", task->tk_pid);
-		task->tk_timeout = 0;
-		task->tk_status = -EAGAIN;
-		if (req && req->rq_ntrans)
-			rpc_sleep_on(&xprt->resend, task, NULL, NULL);
-		else
-			rpc_sleep_on(&xprt->sending, task, NULL, NULL);
+	if (xprt->nocong || __xprt_get_cong(xprt, task)) {
+		xprt->snd_task = task;
+		if (req) {
+			req->rq_bytes_sent = 0;
+			req->rq_ntrans++;
+		}
+		return 1;
 	}
-	return xprt->snd_task == task;
+	smp_mb__before_clear_bit();
+	clear_bit(XPRT_LOCKED, &xprt->sockstate);
+	smp_mb__after_clear_bit();
+out_sleep:
+	dprintk("RPC: %4d failed to lock socket %p\n", task->tk_pid, xprt);
+	task->tk_timeout = 0;
+	task->tk_status = -EAGAIN;
+	if (req && req->rq_ntrans)
+		rpc_sleep_on(&xprt->resend, task, NULL, NULL);
+	else
+		rpc_sleep_on(&xprt->sending, task, NULL, NULL);
+	return 0;
 }
 
 static inline int
@@ -177,15 +187,15 @@
 {
 	struct rpc_task *task;
 
-	if (xprt->snd_task)
+	if (test_and_set_bit(XPRT_LOCKED, &xprt->sockstate))
 		return;
+	if (!xprt->nocong && RPCXPRT_CONGESTED(xprt))
+		goto out_unlock;
 	task = rpc_wake_up_next(&xprt->resend);
 	if (!task) {
-		if (!xprt->nocong && RPCXPRT_CONGESTED(xprt))
-			return;
 		task = rpc_wake_up_next(&xprt->sending);
 		if (!task)
-			return;
+			goto out_unlock;
 	}
 	if (xprt->nocong || __xprt_get_cong(xprt, task)) {
 		struct rpc_rqst *req = task->tk_rqstp;
@@ -194,7 +204,12 @@
 			req->rq_bytes_sent = 0;
 			req->rq_ntrans++;
 		}
+		return;
 	}
+out_unlock:
+	smp_mb__before_clear_bit();
+	clear_bit(XPRT_LOCKED, &xprt->sockstate);
+	smp_mb__after_clear_bit();
 }
 
 /*
@@ -203,9 +218,13 @@
 static void
 __xprt_release_write(struct rpc_xprt *xprt, struct rpc_task *task)
 {
-	if (xprt->snd_task == task)
+	if (xprt->snd_task == task) {
 		xprt->snd_task = NULL;
-	__xprt_lock_write_next(xprt);
+		smp_mb__before_clear_bit();
+		clear_bit(XPRT_LOCKED, &xprt->sockstate);
+		smp_mb__after_clear_bit();
+		__xprt_lock_write_next(xprt);
+	}
 }
 
 static inline void
@@ -393,6 +412,15 @@
 	sock_release(sock);
 }
 
+static void
+xprt_socket_autoclose(void *args)
+{
+	struct rpc_xprt *xprt = (struct rpc_xprt *)args;
+
+	xprt_close(xprt);
+	xprt_release_write(xprt, NULL);
+}
+
 /*
  * Mark a transport as disconnected
  */
@@ -407,6 +435,27 @@
 }
 
 /*
+ * Used to allow disconnection when we've been idle
+ */
+static void
+xprt_init_autodisconnect(unsigned long data)
+{
+	struct rpc_xprt *xprt = (struct rpc_xprt *)data;
+
+	spin_lock(&xprt->sock_lock);
+	if (!list_empty(&xprt->recv) || xprt->shutdown)
+		goto out_abort;
+	if (test_and_set_bit(XPRT_LOCKED, &xprt->sockstate))
+		goto out_abort;
+	spin_unlock(&xprt->sock_lock);
+	/* Let keventd close the socket */
+	schedule_work(&xprt->task_cleanup);
+	return;
+out_abort:
+	spin_unlock(&xprt->sock_lock);
+}
+
+/*
  * Attempt to connect a TCP socket.
  *
  */
@@ -488,7 +537,7 @@
 	case -ECONNREFUSED:
 	case -ECONNRESET:
 	case -ENOTCONN:
-		if (!task->tk_client->cl_softrtry) {
+		if (!RPC_IS_SOFT(task)) {
 			rpc_delay(task, RPC_REESTABLISH_TIMEOUT);
 			task->tk_status = -ENOTCONN;
 			break;
@@ -496,7 +545,7 @@
 	default:
 		/* Report myriad other possible returns.  If this file
 		 * system is soft mounted, just error out, like Solaris.  */
-		if (task->tk_client->cl_softrtry) {
+		if (RPC_IS_SOFT(task)) {
 			printk(KERN_WARNING
 			"RPC: error %d connecting to server %s, exiting\n",
 					-status, task->tk_client->cl_server);
@@ -530,7 +579,7 @@
 	}
 
 	/* if soft mounted, just cause this RPC to fail */
-	if (task->tk_client->cl_softrtry)
+	if (RPC_IS_SOFT(task))
 		task->tk_status = -EIO;
 
 	switch (task->tk_status) {
@@ -584,9 +633,9 @@
 		__xprt_put_cong(xprt, req);
 		if (timer) {
 			if (req->rq_ntrans == 1)
-				rpc_update_rtt(&clnt->cl_rtt, timer,
+				rpc_update_rtt(clnt->cl_rtt, timer,
 						(long)jiffies - req->rq_xtime);
-			rpc_set_timeo(&clnt->cl_rtt, timer, req->rq_ntrans - 1);
+			rpc_set_timeo(clnt->cl_rtt, timer, req->rq_ntrans - 1);
 		}
 	}
 
@@ -1224,8 +1273,8 @@
 	spin_lock_bh(&xprt->sock_lock);
 	if (!xprt->nocong) {
 		int timer = task->tk_msg.rpc_proc->p_timer;
-		task->tk_timeout = rpc_calc_rto(&clnt->cl_rtt, timer);
-		task->tk_timeout <<= rpc_ntimeo(&clnt->cl_rtt, timer);
+		task->tk_timeout = rpc_calc_rto(clnt->cl_rtt, timer);
+		task->tk_timeout <<= rpc_ntimeo(clnt->cl_rtt, timer);
 		task->tk_timeout <<= clnt->cl_timeout.to_retries
 			- req->rq_timeout.to_retries;
 		if (task->tk_timeout > req->rq_timeout.to_maxval)
@@ -1254,6 +1303,8 @@
 		spin_lock(&xprt->xprt_lock);
 		do_xprt_reserve(task);
 		spin_unlock(&xprt->xprt_lock);
+		if (task->tk_rqstp)
+			del_timer_sync(&xprt->timer);
 	}
 }
 
@@ -1333,6 +1384,9 @@
 	__xprt_put_cong(xprt, req);
 	if (!list_empty(&req->rq_list))
 		list_del(&req->rq_list);
+	xprt->last_used = jiffies;
+	if (list_empty(&xprt->recv) && !xprt->shutdown)
+		mod_timer(&xprt->timer, xprt->last_used + XPRT_IDLE_TIMEOUT);
 	spin_unlock_bh(&xprt->sock_lock);
 	task->tk_rqstp = NULL;
 	memset(req, 0, sizeof(*req));	/* mark unused */
@@ -1403,6 +1457,11 @@
 	init_waitqueue_head(&xprt->cong_wait);
 
 	INIT_LIST_HEAD(&xprt->recv);
+	INIT_WORK(&xprt->task_cleanup, xprt_socket_autoclose, xprt);
+	init_timer(&xprt->timer);
+	xprt->timer.function = xprt_init_autodisconnect;
+	xprt->timer.data = (unsigned long) xprt;
+	xprt->last_used = jiffies;
 
 	/* Set timeout parameters */
 	if (to) {
@@ -1583,6 +1642,7 @@
 	rpc_wake_up(&xprt->backlog);
 	if (waitqueue_active(&xprt->cong_wait))
 		wake_up(&xprt->cong_wait);
+	del_timer_sync(&xprt->timer);
 }
 
 /*
--- diff/net/wanrouter/wanmain.c	2003-09-30 15:46:21.000000000 +0100
+++ source/net/wanrouter/wanmain.c	2004-02-09 10:39:57.000000000 +0000
@@ -726,8 +726,6 @@
 
 		if (dev->name == NULL) {
 			err = -EINVAL;
-		} else if (dev_get(dev->name)) {
-			err = -EEXIST;	/* name already exists */
 		} else {
 
 			#ifdef WANDEBUG
--- diff/net/x25/af_x25.c	2004-02-09 10:36:12.000000000 +0000
+++ source/net/x25/af_x25.c	2004-02-09 10:39:57.000000000 +0000
@@ -438,7 +438,7 @@
 	if (!sk)
 		goto out;
 
-	x25 = x25_sk(sk) = kmalloc(sizeof(*x25), GFP_ATOMIC);
+	x25 = sk->sk_protinfo = kmalloc(sizeof(*x25), GFP_ATOMIC);
 	if (!x25)
 		goto frees;
 
--- diff/scripts/Lindent	2002-10-16 04:28:26.000000000 +0100
+++ source/scripts/Lindent	2004-02-09 10:39:57.000000000 +0000
@@ -1,2 +1,2 @@
 #!/bin/sh
-indent -kr -i8 -ts8 -sob -l80 -ss -bs -psl "$@"
+indent -kr -i8 -ts8 -sob -l80 -ss -ncs "$@"
--- diff/scripts/Makefile.lib	2003-09-30 15:46:21.000000000 +0100
+++ source/scripts/Makefile.lib	2004-02-09 10:39:57.000000000 +0000
@@ -144,8 +144,7 @@
 
 
 # If building the kernel in a separate objtree expand all occurrences
-# of -Idir to -Idir -I$(srctree)/dir.
-# hereby allowing gcc to locate files in both trees. Local tree first.
+# of -Idir to -I$(srctree)/dir except for absolute paths (starting with '/').
 
 ifeq ($(KBUILD_SRC),)
 __c_flags	= $(_c_flags)
@@ -153,16 +152,20 @@
 __hostc_flags	= $(_hostc_flags)
 __hostcxx_flags	= $(_hostcxx_flags)
 else
-flags = $(foreach o,$($(1)),\
-	$(if $(filter -I%,$(o)),$(patsubst -I%,-I$(srctree)/%,$(o)),$(o)))
 
-# -I$(obj) locate generated .h files
-# -I$(srctree)/$(src) locate .h files in srctree, from generated .c files
-# FIXME: Replace both with specific EXTRA_CFLAGS statements
-__c_flags	= -I$(obj) -I$(srctree)/$(src) $(call flags,_c_flags)
-__a_flags	=                              $(call flags,_a_flags)
-__hostc_flags	= -I$(obj)                     $(call flags,_hostc_flags)
-__hostcxx_flags	=                              $(call flags,_hostcxx_flags)
+# Prefix -I with $(srctree) if it is not an absolute path
+addtree = $(if $(filter-out -I/%,$(1)),$(patsubst -I%,-I$(srctree)/%,$(1))) $(1)
+# Find all -I options and call addtree
+flags = $(foreach o,$($(1)),$(if $(filter -I%,$(o)),$(call addtree,$(o)),$(o)))
+
+# -I$(obj) locates generated .h files
+# $(call addtree,-I$(obj)) locates .h files in srctree, from generated .c files
+#   and locates generated .h files
+# FIXME: Replace both with specific CFLAGS* statements in the makefiles
+__c_flags	= $(call addtree,-I$(obj)) $(call flags,_c_flags)
+__a_flags	=                          $(call flags,_a_flags)
+__hostc_flags	= -I$(obj)                 $(call flags,_hostc_flags)
+__hostcxx_flags	= -I$(obj)                 $(call flags,_hostcxx_flags)
 endif
 
 c_flags        = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(CPPFLAGS) \
--- diff/scripts/file2alias.c	2003-12-19 09:51:11.000000000 +0000
+++ source/scripts/file2alias.c	2004-02-09 10:39:57.000000000 +0000
@@ -176,6 +176,29 @@
 	return 1;
 }
 
+/* looks like: "pnp:dD" */
+static int do_pnp_entry(const char *filename,
+			struct pnp_device_id *id, char *alias)
+{
+	sprintf(alias, "pnp:d%s", id->id);
+	return 1;
+}
+
+/* looks like: "pnp:cCdD..." */
+static int do_pnp_card_entry(const char *filename,
+			struct pnp_card_device_id *id, char *alias)
+{
+	int i;
+
+	sprintf(alias, "pnp:c%s", id->id);
+	for (i = 0; i < PNP_MAX_DEVICES; i++) {
+		if (! *id->devs[i].id)
+			break;
+		sprintf(alias + strlen(alias), "d%s", id->devs[i].id);
+	}
+	return 1;
+}
+
 /* Ignore any prefix, eg. v850 prepends _ */
 static inline int sym_is(const char *symbol, const char *name)
 {
@@ -242,6 +265,12 @@
 	else if (sym_is(symname, "__mod_ccw_device_table"))
 		do_table(symval, sym->st_size, sizeof(struct ccw_device_id),
 			 do_ccw_entry, mod);
+	else if (sym_is(symname, "__mod_pnp_device_table"))
+		do_table(symval, sym->st_size, sizeof(struct pnp_device_id),
+			 do_pnp_entry, mod);
+	else if (sym_is(symname, "__mod_pnp_card_device_table"))
+		do_table(symval, sym->st_size, sizeof(struct pnp_card_device_id),
+			 do_pnp_card_entry, mod);
 }
 
 /* Now add out buffered information to the generated C source */
--- diff/scripts/kconfig/Makefile	2003-09-30 15:46:21.000000000 +0100
+++ source/scripts/kconfig/Makefile	2004-02-09 10:39:57.000000000 +0000
@@ -95,7 +95,7 @@
 HOSTCFLAGS_lex.zconf.o	:= -I$(src)
 HOSTCFLAGS_zconf.tab.o	:= -I$(src)
 
-HOSTLOADLIBES_qconf	= -L$(QTDIR)/lib -Wl,-rpath,$(QTDIR)/lib -l$(QTLIB) -ldl
+HOSTLOADLIBES_qconf	= -L$(QTDIR)/lib -L$(QTDIR)/lib64 -Wl,-rpath,$(QTDIR)/lib -l$(QTLIB) -ldl
 HOSTCXXFLAGS_qconf.o	= -I$(QTDIR)/include 
 
 HOSTLOADLIBES_gconf	= `pkg-config gtk+-2.0 gmodule-2.0 libglade-2.0 --libs`
--- diff/scripts/kconfig/mconf.c	2004-02-09 10:36:12.000000000 +0000
+++ source/scripts/kconfig/mconf.c	2004-02-09 10:39:57.000000000 +0000
@@ -607,6 +607,7 @@
 	struct symbol *active;
 	int stat;
 
+	active = sym_get_choice_value(menu->sym);
 	while (1) {
 		cprint_init();
 		cprint("--title");
@@ -618,24 +619,32 @@
 		cprint("6");
 
 		current_menu = menu;
-		active = sym_get_choice_value(menu->sym);
 		for (child = menu->list; child; child = child->next) {
 			if (!menu_is_visible(child))
 				continue;
 			cprint("%p", child);
 			cprint("%s", menu_get_prompt(child));
-			cprint(child->sym == active ? "ON" : "OFF");
+			if (child->sym == sym_get_choice_value(menu->sym))
+				cprint("ON");
+			else if (child->sym == active)
+				cprint("SELECTED");
+			else
+				cprint("OFF");
 		}
 
 		stat = exec_conf();
 		switch (stat) {
 		case 0:
-			if (sscanf(input_buf, "%p", &menu) != 1)
+			if (sscanf(input_buf, "%p", &child) != 1)
 				break;
-			sym_set_tristate_value(menu->sym, yes);
+			sym_set_tristate_value(child->sym, yes);
 			return;
 		case 1:
-			show_help(menu);
+			if (sscanf(input_buf, "%p", &child) == 1) {
+				show_help(child);
+				active = child->sym;
+			} else
+				show_help(menu);
 			break;
 		case 255:
 			return;
--- diff/scripts/kconfig/menu.c	2003-06-30 10:07:24.000000000 +0100
+++ source/scripts/kconfig/menu.c	2004-02-09 10:39:57.000000000 +0000
@@ -16,6 +16,26 @@
 struct file *file_list;
 struct file *current_file;
 
+static void menu_warn(struct menu *menu, const char *fmt, ...)
+{
+	va_list ap;
+	va_start(ap, fmt);
+	fprintf(stderr, "%s:%d:warning: ", menu->file->name, menu->lineno);
+	vfprintf(stderr, fmt, ap);
+	fprintf(stderr, "\n");
+	va_end(ap);
+}
+
+static void prop_warn(struct property *prop, const char *fmt, ...)
+{
+	va_list ap;
+	va_start(ap, fmt);
+	fprintf(stderr, "%s:%d:warning: ", prop->file->name, prop->lineno);
+	vfprintf(stderr, fmt, ap);
+	fprintf(stderr, "\n");
+	va_end(ap);
+}
+
 void menu_init(void)
 {
 	current_entry = current_menu = &rootmenu;
@@ -94,9 +114,9 @@
 		sym->type = type;
 		return;
 	}
-	fprintf(stderr, "%s:%d:warning: type of '%s' redefined from '%s' to '%s'\n",
-		current_entry->file->name, current_entry->lineno,
-		sym->name ? sym->name : "<choice>", sym_type_name(sym->type), sym_type_name(type));
+	menu_warn(current_entry, "type of '%s' redefined from '%s' to '%s'\n",
+	    sym->name ? sym->name : "<choice>",
+	    sym_type_name(sym->type), sym_type_name(type));
 }
 
 struct property *menu_add_prop(enum prop_type type, char *prompt, struct expr *expr, struct expr *dep)
@@ -110,8 +130,7 @@
 
 	if (prompt) {
 		if (current_entry->prompt)
-			fprintf(stderr, "%s:%d: prompt redefined\n",
-				current_entry->file->name, current_entry->lineno);
+			menu_warn(current_entry, "prompt redefined\n");
 		current_entry->prompt = prop;
 	}
 
@@ -133,6 +152,50 @@
 	menu_add_prop(type, NULL, expr_alloc_symbol(sym), dep);
 }
 
+void sym_check_prop(struct symbol *sym)
+{
+	struct property *prop;
+	struct symbol *sym2;
+	for (prop = sym->prop; prop; prop = prop->next) {
+		switch (prop->type) {
+		case P_DEFAULT:
+			if ((sym->type == S_STRING || sym->type == S_INT || sym->type == S_HEX) &&
+			    prop->expr->type != E_SYMBOL)
+				prop_warn(prop,
+				    "default for config symbol '%'"
+				    " must be a single symbol", sym->name);
+			break;
+		case P_SELECT:
+			sym2 = prop_get_symbol(prop);
+			if (sym->type != S_BOOLEAN && sym->type != S_TRISTATE)
+				prop_warn(prop,
+				    "config symbol '%s' uses select, but is "
+				    "not boolean or tristate", sym->name);
+			else if (sym2->type == S_UNKNOWN)
+				prop_warn(prop,
+				    "'select' used by config symbol '%s' "
+				    "refer to undefined symbol '%s'",
+				    sym->name, sym2->name);
+			else if (sym2->type != S_BOOLEAN && sym2->type != S_TRISTATE)
+				prop_warn(prop,
+				    "'%s' has wrong type. 'select' only "
+				    "accept arguments of boolean and "
+				    "tristate type", sym2->name);
+			break;
+		case P_RANGE:
+			if (sym->type != S_INT && sym->type != S_HEX)
+				prop_warn(prop, "range is only allowed "
+				                "for int or hex symbols");
+			if (!sym_string_valid(sym, prop->expr->left.sym->name) ||
+			    !sym_string_valid(sym, prop->expr->right.sym->name))
+				prop_warn(prop, "range is invalid");
+			break;
+		default:
+			;
+		}
+	}
+}
+
 void menu_finalize(struct menu *parent)
 {
 	struct menu *menu, *last_menu;
@@ -222,17 +285,16 @@
 		if (sym && sym_is_choice(sym) && menu->sym) {
 			menu->sym->flags |= SYMBOL_CHOICEVAL;
 			if (!menu->prompt)
-				fprintf(stderr, "%s:%d:warning: choice value must have a prompt\n",
-					menu->file->name, menu->lineno);
+				menu_warn(menu, "choice value must have a prompt");
 			for (prop = menu->sym->prop; prop; prop = prop->next) {
 				if (prop->type == P_PROMPT && prop->menu != menu) {
-					fprintf(stderr, "%s:%d:warning: choice values currently only support a single prompt\n",
-						prop->file->name, prop->lineno);
-					
+					prop_warn(prop, "choice values "
+					    "currently only support a "
+					    "single prompt");
 				}
 				if (prop->type == P_DEFAULT)
-					fprintf(stderr, "%s:%d:warning: defaults for choice values not supported\n",
-						prop->file->name, prop->lineno);
+					prop_warn(prop, "defaults for choice "
+					    "values not supported");
 			}
 			current_entry = menu;
 			menu_set_type(sym->type);
@@ -256,43 +318,15 @@
 	}
 
 	if (sym && !(sym->flags & SYMBOL_WARNED)) {
-		struct symbol *sym2;
 		if (sym->type == S_UNKNOWN)
-			fprintf(stderr, "%s:%d:warning: config symbol defined without type\n",
-				parent->file->name, parent->lineno);
+			menu_warn(parent, "config symbol defined "
+			    "without type\n");
 
 		if (sym_is_choice(sym) && !parent->prompt)
-			fprintf(stderr, "%s:%d:warning: choice must have a prompt\n",
-				parent->file->name, parent->lineno);
+			menu_warn(parent, "choice must have a prompt\n");
 
-		for (prop = sym->prop; prop; prop = prop->next) {
-			switch (prop->type) {
-			case P_DEFAULT:
-				if ((sym->type == S_STRING || sym->type == S_INT || sym->type == S_HEX) &&
-				    prop->expr->type != E_SYMBOL)
-					fprintf(stderr, "%s:%d:warning: default must be a single symbol\n",
-						prop->file->name, prop->lineno);
-				break;
-			case P_SELECT:
-				sym2 = prop_get_symbol(prop);
-				if ((sym->type != S_BOOLEAN && sym->type != S_TRISTATE) ||
-				    (sym2->type != S_BOOLEAN && sym2->type != S_TRISTATE))
-					fprintf(stderr, "%s:%d:warning: enable is only allowed with boolean and tristate symbols\n",
-						prop->file->name, prop->lineno);
-				break;
-			case P_RANGE:
-				if (sym->type != S_INT && sym->type != S_HEX)
-					fprintf(stderr, "%s:%d:warning: range is only allowed for int or hex symbols\n",
-						prop->file->name, prop->lineno);
-				if (!sym_string_valid(sym, prop->expr->left.sym->name) ||
-				    !sym_string_valid(sym, prop->expr->right.sym->name))
-					fprintf(stderr, "%s:%d:warning: range is invalid\n",
-						prop->file->name, prop->lineno);
-				break;
-			default:
-				;
-			}
-		}
+		/* Check properties connected to this symbol */
+		sym_check_prop(sym);
 		sym->flags |= SYMBOL_WARNED;
 	}
 
--- diff/scripts/lxdialog/checklist.c	2002-10-16 04:28:20.000000000 +0100
+++ source/scripts/lxdialog/checklist.c	2004-02-09 10:39:57.000000000 +0000
@@ -138,9 +138,11 @@
     /* Initializes status */
     for (i = 0; i < item_no; i++) {
 	status[i] = !strcasecmp (items[i * 3 + 2], "on");
-	if (!choice && status[i])
-            choice = i;
+	if ((!choice && status[i]) || !strcasecmp (items[i * 3 + 2], "selected"))
+            choice = i + 1;
     }
+    if (choice)
+	    choice--;
 
     max_choice = MIN (list_height, item_no);
 
@@ -302,6 +304,7 @@
 	case 'H':
 	case 'h':
 	case '?':
+	    fprintf (stderr, "%s", items[(scroll + choice) * 3]);
 	    delwin (dialog);
 	    free (status);
 	    return 1;
@@ -347,7 +350,8 @@
 
 		    }
 		}
-            }
+            } else
+		fprintf (stderr, "%s", items[(scroll + choice) * 3]);
 	    delwin (dialog);
 	    free (status);
 	    return button;
--- diff/security/commoncap.c	2004-02-09 10:36:12.000000000 +0000
+++ source/security/commoncap.c	2004-02-09 10:39:57.000000000 +0000
@@ -321,8 +321,9 @@
 		return 0;
 
 	if (sysctl_overcommit_memory == 0) {
+		unsigned long n;
+
 		free = get_page_cache_size();
-		free += nr_free_pages();
 		free += nr_swap_pages;
 
 		/*
@@ -341,6 +342,18 @@
 
 		if (free > pages)
 			return 0;
+
+		/*
+		 * nr_free_pages() is very expensive on large systems,
+		 * only call if we're about to fail.
+		 */
+		n = nr_free_pages();
+		if (!capable(CAP_SYS_ADMIN))
+			n -= n / 32;
+		free += n;
+
+		if (free > pages)
+			return 0;
 		vm_unacct_memory(pages);
 		return -ENOMEM;
 	}
--- diff/security/dummy.c	2004-02-09 10:36:12.000000000 +0000
+++ source/security/dummy.c	2004-02-09 10:39:57.000000000 +0000
@@ -194,7 +194,12 @@
 	return;
 }
 
-static int dummy_sb_kern_mount (struct super_block *sb)
+static int dummy_sb_copy_data (const char *fstype, void *orig, void *copy)
+{
+	return 0;
+}
+
+static int dummy_sb_kern_mount (struct super_block *sb, void *data)
 {
 	return 0;
 }
@@ -539,7 +544,7 @@
 	return 0;
 }
 
-static int dummy_task_setgroups (int gidsetsize, gid_t * grouplist)
+static int dummy_task_setgroups (struct group_info *group_info)
 {
 	return 0;
 }
@@ -877,6 +882,7 @@
 	set_to_dummy_if_null(ops, bprm_secureexec);
 	set_to_dummy_if_null(ops, sb_alloc_security);
 	set_to_dummy_if_null(ops, sb_free_security);
+	set_to_dummy_if_null(ops, sb_copy_data);
 	set_to_dummy_if_null(ops, sb_kern_mount);
 	set_to_dummy_if_null(ops, sb_statfs);
 	set_to_dummy_if_null(ops, sb_mount);
--- diff/security/selinux/hooks.c	2004-02-09 10:36:12.000000000 +0000
+++ source/security/selinux/hooks.c	2004-02-09 10:39:57.000000000 +0000
@@ -56,6 +56,8 @@
 #include <linux/quota.h>
 #include <linux/un.h>		/* for Unix socket types */
 #include <net/af_unix.h>	/* for Unix socket types */
+#include <linux/parser.h>
+#include <linux/nfs_mount.h>
 
 #include "avc.h"
 #include "objsec.h"
@@ -223,6 +225,7 @@
 	sbsec->magic = SELINUX_MAGIC;
 	sbsec->sb = sb;
 	sbsec->sid = SECINITSID_UNLABELED;
+	sbsec->def_sid = SECINITSID_FILE;
 	sb->s_security = sbsec;
 
 	return 0;
@@ -283,12 +286,13 @@
 
 /* The file system's label must be initialized prior to use. */
 
-static char *labeling_behaviors[5] = {
+static char *labeling_behaviors[6] = {
 	"uses xattr",
 	"uses transition SIDs",
 	"uses task SIDs",
 	"uses genfs_contexts",
-	"not configured for labeling"
+	"not configured for labeling",
+	"uses mountpoint labeling",
 };
 
 static int inode_doinit_with_dentry(struct inode *inode, struct dentry *opt_dentry);
@@ -298,7 +302,200 @@
 	return inode_doinit_with_dentry(inode, NULL);
 }
 
-static int superblock_doinit(struct super_block *sb)
+enum {
+	Opt_context = 1,
+	Opt_fscontext = 2,
+	Opt_defcontext = 4,
+};
+
+static match_table_t tokens = {
+	{Opt_context, "context=%s"},
+	{Opt_fscontext, "fscontext=%s"},
+	{Opt_defcontext, "defcontext=%s"},
+};
+
+#define SEL_MOUNT_FAIL_MSG "SELinux:  duplicate or incompatible mount options\n"
+
+static int try_context_mount(struct super_block *sb, void *data)
+{
+	char *context = NULL, *defcontext = NULL;
+	const char *name;
+	u32 sid;
+	int alloc = 0, rc = 0, seen = 0;
+	struct task_security_struct *tsec = current->security;
+	struct superblock_security_struct *sbsec = sb->s_security;
+
+	if (!data)
+		goto out;
+
+	name = sb->s_type->name;
+
+	/* Ignore these fileystems with binary mount option data. */
+	if (!strcmp(name, "coda") ||
+	    !strcmp(name, "afs") || !strcmp(name, "smbfs"))
+		goto out;
+
+	/* NFS we understand. */
+	if (!strcmp(name, "nfs")) {
+		struct nfs_mount_data *d = data;
+
+		if (d->version <  NFS_MOUNT_VERSION)
+			goto out;
+
+		if (d->context[0]) {
+			context = d->context;
+			seen |= Opt_context;
+		}
+
+	/* Standard string-based options. */
+	} else {
+		char *p, *options = data;
+
+		while ((p = strsep(&options, ",")) != NULL) {
+			int token;
+			substring_t args[MAX_OPT_ARGS];
+
+			if (!*p)
+				continue;
+
+			token = match_token(p, tokens, args);
+
+			switch (token) {
+			case Opt_context:
+				if (seen) {
+					rc = -EINVAL;
+					printk(KERN_WARNING SEL_MOUNT_FAIL_MSG);
+					goto out_free;
+				}
+				context = match_strdup(&args[0]);
+				if (!context) {
+					rc = -ENOMEM;
+					goto out_free;
+				}
+				if (!alloc)
+					alloc = 1;
+				seen |= Opt_context;
+				break;
+
+			case Opt_fscontext:
+				if (sbsec->behavior != SECURITY_FS_USE_XATTR) {
+					rc = -EINVAL;
+					printk(KERN_WARNING "SELinux:  "
+					       "fscontext option is invalid for"
+					       " this filesystem type\n");
+					goto out_free;
+				}
+				if (seen & (Opt_context|Opt_fscontext)) {
+					rc = -EINVAL;
+					printk(KERN_WARNING SEL_MOUNT_FAIL_MSG);
+					goto out_free;
+				}
+				context = match_strdup(&args[0]);
+				if (!context) {
+					rc = -ENOMEM;
+					goto out_free;
+				}
+				if (!alloc)
+					alloc = 1;
+				seen |= Opt_fscontext;
+				break;
+
+			case Opt_defcontext:
+				if (sbsec->behavior != SECURITY_FS_USE_XATTR) {
+					rc = -EINVAL;
+					printk(KERN_WARNING "SELinux:  "
+					       "defcontext option is invalid "
+					       "for this filesystem type\n");
+					goto out_free;
+				}
+				if (seen & (Opt_context|Opt_defcontext)) {
+					rc = -EINVAL;
+					printk(KERN_WARNING SEL_MOUNT_FAIL_MSG);
+					goto out_free;
+				}
+				defcontext = match_strdup(&args[0]);
+				if (!defcontext) {
+					rc = -ENOMEM;
+					goto out_free;
+				}
+				if (!alloc)
+					alloc = 1;
+				seen |= Opt_defcontext;
+				break;
+
+			default:
+				rc = -EINVAL;
+				printk(KERN_WARNING "SELinux:  unknown mount "
+				       "option\n");
+				goto out_free;
+
+			}
+		}
+	}
+
+	if (!seen)
+		goto out;
+
+	if (context) {
+		rc = security_context_to_sid(context, strlen(context), &sid);
+		if (rc) {
+			printk(KERN_WARNING "SELinux: security_context_to_sid"
+			       "(%s) failed for (dev %s, type %s) errno=%d\n",
+			       context, sb->s_id, name, rc);
+			goto out_free;
+		}
+
+		rc = avc_has_perm(tsec->sid, sbsec->sid, SECCLASS_FILESYSTEM,
+		                  FILESYSTEM__RELABELFROM, NULL, NULL);
+		if (rc)
+			goto out_free;
+
+		rc = avc_has_perm(tsec->sid, sid, SECCLASS_FILESYSTEM,
+		                  FILESYSTEM__RELABELTO, NULL, NULL);
+		if (rc)
+			goto out_free;
+
+		sbsec->sid = sid;
+
+		if (seen & Opt_context)
+			sbsec->behavior = SECURITY_FS_USE_MNTPOINT;
+	}
+
+	if (defcontext) {
+		rc = security_context_to_sid(defcontext, strlen(defcontext), &sid);
+		if (rc) {
+			printk(KERN_WARNING "SELinux: security_context_to_sid"
+			       "(%s) failed for (dev %s, type %s) errno=%d\n",
+			       defcontext, sb->s_id, name, rc);
+			goto out_free;
+		}
+
+		if (sid == sbsec->def_sid)
+			goto out_free;
+
+		rc = avc_has_perm(tsec->sid, sbsec->sid, SECCLASS_FILESYSTEM,
+				  FILESYSTEM__RELABELFROM, NULL, NULL);
+		if (rc)
+			goto out_free;
+
+		rc = avc_has_perm(sid, sbsec->sid, SECCLASS_FILESYSTEM,
+				  FILESYSTEM__ASSOCIATE, NULL, NULL);
+		if (rc)
+			goto out_free;
+
+		sbsec->def_sid = sid;
+	}
+
+out_free:
+	if (alloc) {
+		kfree(context);
+		kfree(defcontext);
+	}
+out:
+	return rc;
+}
+
+static int superblock_doinit(struct super_block *sb, void *data)
 {
 	struct superblock_security_struct *sbsec = sb->s_security;
 	struct dentry *root = sb->s_root;
@@ -328,6 +525,10 @@
 		goto out;
 	}
 
+	rc = try_context_mount(sb, data);
+	if (rc)
+		goto out;
+
 	if (sbsec->behavior == SECURITY_FS_USE_XATTR) {
 		/* Make sure that the xattr handler exists and that no
 		   error other than -ENODATA is returned by getxattr on
@@ -530,7 +731,7 @@
 	switch (sbsec->behavior) {
 	case SECURITY_FS_USE_XATTR:
 		if (!inode->i_op->getxattr) {
-			isec->sid = SECINITSID_FILE;
+			isec->sid = sbsec->def_sid;
 			break;
 		}
 
@@ -589,7 +790,7 @@
 				goto out;
 			}
 			/* Map ENODATA to the default file SID */
-			sid = SECINITSID_FILE;
+			sid = sbsec->def_sid;
 			rc = 0;
 		} else {
 			rc = security_context_to_sid(context, rc, &sid);
@@ -829,6 +1030,7 @@
 
 	tsec = current->security;
 	dsec = dir->i_security;
+	sbsec = dir->i_sb->s_security;
 
 	AVC_AUDIT_DATA_INIT(&ad, FS);
 	ad.u.fs.dentry = dentry;
@@ -839,7 +1041,7 @@
 	if (rc)
 		return rc;
 
-	if (tsec->create_sid) {
+	if (tsec->create_sid && sbsec->behavior != SECURITY_FS_USE_MNTPOINT) {
 		newsid = tsec->create_sid;
 	} else {
 		rc = security_transition_sid(tsec->sid, dsec->sid, tclass,
@@ -852,8 +1054,6 @@
 	if (rc)
 		return rc;
 
-	sbsec = dir->i_sb->s_security;
-
 	return avc_has_perm(newsid, sbsec->sid,
 			    SECCLASS_FILESYSTEM,
 			    FILESYSTEM__ASSOCIATE, NULL, &ad);
@@ -1061,6 +1261,7 @@
 
 	tsec = current->security;
 	dsec = dir->i_security;
+	sbsec = dir->i_sb->s_security;
 
 	inode = dentry->d_inode;
 	if (!inode) {
@@ -1072,7 +1273,7 @@
 		return 0;
 	}
 
-	if (tsec->create_sid) {
+	if (tsec->create_sid && sbsec->behavior != SECURITY_FS_USE_MNTPOINT) {
 		newsid = tsec->create_sid;
 	} else {
 		rc = security_transition_sid(tsec->sid, dsec->sid,
@@ -1095,10 +1296,6 @@
 		return rc;
 	}
 
-	sbsec = dir->i_sb->s_security;
-	if (!sbsec)
-		return 0;
-
 	if (sbsec->behavior == SECURITY_FS_USE_XATTR &&
 	    inode->i_op->setxattr) {
 		/* Use extended attributes. */
@@ -1660,12 +1857,83 @@
 	superblock_free_security(sb);
 }
 
-static int selinux_sb_kern_mount(struct super_block *sb)
+static inline int match_prefix(char *prefix, int plen, char *option, int olen)
+{
+	if (plen > olen)
+		return 0;
+
+	return !memcmp(prefix, option, plen);
+}
+
+static inline int selinux_option(char *option, int len)
+{
+	return (match_prefix("context=", sizeof("context=")-1, option, len) ||
+	        match_prefix("fscontext=", sizeof("fscontext=")-1, option, len) ||
+	        match_prefix("defcontext=", sizeof("defcontext=")-1, option, len));
+}
+
+static inline void take_option(char **to, char *from, int *first, int len)
+{
+	if (!*first) {
+		**to = ',';
+		*to += 1;
+	}
+	else
+		*first = 0;
+	memcpy(*to, from, len);
+	*to += len;
+}
+
+static int selinux_sb_copy_data(const char *fstype, void *orig, void *copy)
+{
+	int fnosec, fsec, rc = 0;
+	char *in_save, *in_curr, *in_end;
+	char *sec_curr, *nosec_save, *nosec;
+
+	in_curr = orig;
+	sec_curr = copy;
+
+	/* Binary mount data: just copy */
+	if (!strcmp(fstype, "nfs") || !strcmp(fstype, "coda") ||
+	    !strcmp(fstype, "smbfs") || !strcmp(fstype, "afs")) {
+		copy_page(sec_curr, in_curr);
+		goto out;
+	}
+
+	nosec = (char *)get_zeroed_page(GFP_KERNEL);
+	if (!nosec) {
+		rc = -ENOMEM;
+		goto out;
+	}
+
+	nosec_save = nosec;
+	fnosec = fsec = 1;
+	in_save = in_end = orig;
+
+	do {
+		if (*in_end == ',' || *in_end == '\0') {
+			int len = in_end - in_curr;
+
+			if (selinux_option(in_curr, len))
+				take_option(&sec_curr, in_curr, &fsec, len);
+			else
+				take_option(&nosec, in_curr, &fnosec, len);
+
+			in_curr = in_end + 1;
+		}
+	} while (*in_end++);
+
+	copy_page(in_save, nosec_save);
+out:
+	return rc;
+}
+
+static int selinux_sb_kern_mount(struct super_block *sb, void *data)
 {
 	struct avc_audit_data ad;
 	int rc;
 
-	rc = superblock_doinit(sb);
+	rc = superblock_doinit(sb, data);
 	if (rc)
 		return rc;
 
@@ -1857,6 +2125,10 @@
 		return dentry_has_perm(current, NULL, dentry, FILE__SETATTR);
 	}
 
+	sbsec = inode->i_sb->s_security;
+	if (sbsec->behavior == SECURITY_FS_USE_MNTPOINT)
+		return -ENOTSUPP;
+
 	AVC_AUDIT_DATA_INIT(&ad,FS);
 	ad.u.fs.dentry = dentry;
 
@@ -1875,10 +2147,6 @@
 	if (rc)
 		return rc;
 
-	sbsec = inode->i_sb->s_security;
-	if (!sbsec)
-		return 0;
-
 	return avc_has_perm(newsid,
 			    sbsec->sid,
 			    SECCLASS_FILESYSTEM,
@@ -1913,6 +2181,12 @@
 
 static int selinux_inode_getxattr (struct dentry *dentry, char *name)
 {
+	struct inode *inode = dentry->d_inode;
+	struct superblock_security_struct *sbsec = inode->i_sb->s_security;
+
+	if (sbsec->behavior == SECURITY_FS_USE_MNTPOINT)
+		return -ENOTSUPP;
+
 	return dentry_has_perm(current, NULL, dentry, FILE__GETATTR);
 }
 
@@ -2265,7 +2539,7 @@
 	return task_has_perm(current, p, PROCESS__GETSESSION);
 }
 
-static int selinux_task_setgroups(int gidsetsize, gid_t *grouplist)
+static int selinux_task_setgroups(struct group_info *group_info)
 {
 	/* See the comment for setuid above. */
 	return 0;
@@ -3555,6 +3829,7 @@
 
 	.sb_alloc_security =		selinux_sb_alloc_security,
 	.sb_free_security =		selinux_sb_free_security,
+	.sb_copy_data =			selinux_sb_copy_data,
 	.sb_kern_mount =	        selinux_sb_kern_mount,
 	.sb_statfs =			selinux_sb_statfs,
 	.sb_mount =			selinux_mount,
@@ -3731,7 +4006,7 @@
 		spin_unlock(&sb_security_lock);
 		down_read(&sb->s_umount);
 		if (sb->s_root)
-			superblock_doinit(sb);
+			superblock_doinit(sb, NULL);
 		drop_super(sb);
 		spin_lock(&sb_security_lock);
 		list_del_init(&sbsec->list);
--- diff/security/selinux/include/objsec.h	2004-02-09 10:36:12.000000000 +0000
+++ source/security/selinux/include/objsec.h	2004-02-09 10:39:57.000000000 +0000
@@ -63,6 +63,7 @@
 	struct super_block *sb;         /* back pointer to sb object */
 	struct list_head list;          /* list of superblock_security_struct */
 	u32 sid;              /* SID of file system */
+	u32 def_sid;			/* default SID for labeling */
 	unsigned int behavior;          /* labeling behavior */
 	unsigned char initialized;      /* initialization flag */
 	unsigned char proc;             /* proc fs */
--- diff/security/selinux/include/security.h	2003-10-27 09:20:39.000000000 +0000
+++ source/security/selinux/include/security.h	2004-02-09 10:39:57.000000000 +0000
@@ -62,11 +62,13 @@
 int security_node_sid(u16 domain, void *addr, u32 addrlen,
 	u32 *out_sid);
 
-#define SECURITY_FS_USE_XATTR 1 /* use xattr */
-#define SECURITY_FS_USE_TRANS 2 /* use transition SIDs, e.g. devpts/tmpfs */
-#define SECURITY_FS_USE_TASK  3 /* use task SIDs, e.g. pipefs/sockfs */
-#define SECURITY_FS_USE_GENFS 4 /* use the genfs support */
-#define SECURITY_FS_USE_NONE  5 /* no labeling support */
+#define SECURITY_FS_USE_XATTR		1 /* use xattr */
+#define SECURITY_FS_USE_TRANS		2 /* use transition SIDs, e.g. devpts/tmpfs */
+#define SECURITY_FS_USE_TASK		3 /* use task SIDs, e.g. pipefs/sockfs */
+#define SECURITY_FS_USE_GENFS		4 /* use the genfs support */
+#define SECURITY_FS_USE_NONE		5 /* no labeling support */
+#define SECURITY_FS_USE_MNTPOINT	6 /* use mountpoint labeling */
+
 int security_fs_use(const char *fstype, unsigned int *behavior,
 	u32 *sid);
 
--- diff/security/selinux/selinuxfs.c	2003-10-27 09:20:39.000000000 +0000
+++ source/security/selinux/selinuxfs.c	2004-02-09 10:39:57.000000000 +0000
@@ -54,7 +54,7 @@
 		return -ENOMEM;
 	memset(page, 0, PAGE_SIZE);
 
-	length = snprintf(page, PAGE_SIZE, "%d", selinux_enforcing);
+	length = scnprintf(page, PAGE_SIZE, "%d", selinux_enforcing);
 	if (length < 0) {
 		free_page((unsigned long)page);
 		return length;
@@ -139,7 +139,7 @@
 		return -ENOMEM;
 	memset(page, 0, PAGE_SIZE);
 
-	length = snprintf(page, PAGE_SIZE, "%u", POLICYDB_VERSION);
+	length = scnprintf(page, PAGE_SIZE, "%u", POLICYDB_VERSION);
 	if (length < 0) {
 		free_page((unsigned long)page);
 		return length;
@@ -404,7 +404,7 @@
 	if (length < 0)
 		goto out2;
 
-	length = snprintf(buf, PAYLOAD_SIZE, "%x %x %x %x %u",
+	length = scnprintf(buf, PAYLOAD_SIZE, "%x %x %x %x %u",
 			  avd.allowed, avd.decided,
 			  avd.auditallow, avd.auditdeny,
 			  avd.seqno);
--- diff/security/selinux/ss/services.c	2004-01-19 10:22:59.000000000 +0000
+++ source/security/selinux/ss/services.c	2004-02-09 10:39:57.000000000 +0000
@@ -16,6 +16,7 @@
 #include <linux/spinlock.h>
 #include <linux/errno.h>
 #include <linux/in.h>
+#include <linux/sched.h>
 #include <asm/semaphore.h>
 #include "flask.h"
 #include "avc.h"
--- diff/security/selinux/ss/sidtab.c	2004-01-19 10:22:59.000000000 +0000
+++ source/security/selinux/ss/sidtab.c	2004-02-09 10:39:57.000000000 +0000
@@ -7,6 +7,7 @@
 #include <linux/slab.h>
 #include <linux/spinlock.h>
 #include <linux/errno.h>
+#include <linux/sched.h>
 #include "flask.h"
 #include "security.h"
 #include "sidtab.h"
--- diff/sound/core/Makefile	2003-06-30 10:07:24.000000000 +0100
+++ source/sound/core/Makefile	2004-02-09 10:39:58.000000000 +0000
@@ -99,10 +99,6 @@
 obj-$(CONFIG_SND_POWERMAC) += snd-pcm.o snd-timer.o snd-page-alloc.o snd.o
 obj-$(CONFIG_SND_SA11XX_UDA1341) += snd-pcm.o snd-timer.o snd-page-alloc.o snd.o
 obj-$(CONFIG_SND_PC98_CS4232) += snd-pcm.o snd-timer.o snd-page-alloc.o snd.o snd-rawmidi.o snd-hwdep.o
-ifeq ($(CONFIG_SND_SB16_CSP),y)
-  obj-$(CONFIG_SND_SB16) += snd-hwdep.o
-  obj-$(CONFIG_SND_SBAWE) += snd-hwdep.o
-endif
 obj-$(CONFIG_SND_USB_AUDIO) += snd-pcm.o snd-timer.o snd-page-alloc.o snd.o snd-rawmidi.o
 obj-$(CONFIG_SND_SUN_AMD7930) += snd-pcm.o snd-timer.o snd-page-alloc.o snd.o
 obj-$(CONFIG_SND_SUN_CS4231) += snd-pcm.o snd-timer.o snd-page-alloc.o snd.o
--- diff/sound/core/control.c	2003-10-27 09:20:39.000000000 +0000
+++ source/sound/core/control.c	2004-02-09 10:39:58.000000000 +0000
@@ -253,15 +253,51 @@
 	}
 }
 
+static unsigned int snd_ctl_hole_check(snd_card_t * card,
+				       unsigned int count)
+{
+	struct list_head *list;
+	snd_kcontrol_t *kctl;
+
+	list_for_each(list, &card->controls) {
+		kctl = snd_kcontrol(list);
+		if ((kctl->id.numid <= card->last_numid &&
+		     kctl->id.numid + kctl->count > card->last_numid) ||
+		    (kctl->id.numid <= card->last_numid + count - 1 &&
+		     kctl->id.numid + kctl->count > card->last_numid + count - 1))
+		    	return card->last_numid = kctl->id.numid + kctl->count - 1;
+	}
+	return card->last_numid;
+}
+
+static int snd_ctl_find_hole(snd_card_t * card, unsigned int count)
+{
+	unsigned int last_numid, iter = 100000;
+
+	last_numid = card->last_numid;
+	while (last_numid != snd_ctl_hole_check(card, count)) {
+		if (--iter == 0) {
+			/* this situation is very unlikely */
+			snd_printk(KERN_ERR "unable to allocate new control numid\n");
+			return -ENOMEM;
+		}
+		last_numid = card->last_numid;
+	}
+	return 0;
+}
+
 /**
  * snd_ctl_add - add the control instance to the card
  * @card: the card instance
  * @kcontrol: the control instance to add
  *
  * Adds the control instance created via snd_ctl_new() or
- * snd_ctl_new1() to the given card.
+ * snd_ctl_new1() to the given card. Assigns also an unique
+ * numid used for fast search.
  *
  * Returns zero if successful, or a negative error code on failure.
+ *
+ * It frees automatically the control which cannot be added.
  */
 int snd_ctl_add(snd_card_t * card, snd_kcontrol_t * kcontrol)
 {
@@ -270,13 +306,29 @@
 
 	snd_runtime_check(card != NULL && kcontrol != NULL, return -EINVAL);
 	snd_assert(kcontrol->info != NULL, return -EINVAL);
+	id = kcontrol->id;
 	down_write(&card->controls_rwsem);
+	if (snd_ctl_find_id(card, &id)) {
+		up_write(&card->controls_rwsem);
+		snd_ctl_free_one(kcontrol);
+		snd_printd(KERN_ERR "control %i:%i:%i:%s:%i is already present\n",
+					id.iface,
+					id.device,
+					id.subdevice,
+					id.name,
+					id.index);
+		return -EBUSY;
+	}
+	if (snd_ctl_find_hole(card, kcontrol->count) < 0) {
+		up_write(&card->controls_rwsem);
+		snd_ctl_free_one(kcontrol);
+		return -ENOMEM;
+	}
 	list_add_tail(&kcontrol->list, &card->controls);
 	card->controls_count += kcontrol->count;
 	kcontrol->id.numid = card->last_numid + 1;
 	card->last_numid += kcontrol->count;
 	up_write(&card->controls_rwsem);
-	id = kcontrol->id;
 	for (idx = 0; idx < kcontrol->count; idx++, id.index++, id.numid++)
 		snd_ctl_notify(card, SNDRV_CTL_EVENT_MASK_ADD, &id);
 	return 0;
@@ -288,7 +340,8 @@
  * @kcontrol: the control instance to remove
  *
  * Removes the control from the card and then releases the instance.
- * You don't need to call snd_ctl_free_one().
+ * You don't need to call snd_ctl_free_one(). You must be in
+ * the write lock - down_write(&card->controls_rwsem).
  * 
  * Returns 0 if successful, or a negative error code on failure.
  */
@@ -298,10 +351,8 @@
 	unsigned int idx;
 
 	snd_runtime_check(card != NULL && kcontrol != NULL, return -EINVAL);
-	down_write(&card->controls_rwsem);
 	list_del(&kcontrol->list);
 	card->controls_count -= kcontrol->count;
-	up_write(&card->controls_rwsem);
 	id = kcontrol->id;
 	for (idx = 0; idx < kcontrol->count; idx++, id.index++, id.numid++)
 		snd_ctl_notify(card, SNDRV_CTL_EVENT_MASK_REMOVE, &id);
@@ -322,15 +373,50 @@
 int snd_ctl_remove_id(snd_card_t * card, snd_ctl_elem_id_t *id)
 {
 	snd_kcontrol_t *kctl;
+	int ret;
 
+	down_write(&card->controls_rwsem);
 	kctl = snd_ctl_find_id(card, id);
-	if (kctl == NULL)
+	if (kctl == NULL) {
+		up_write(&card->controls_rwsem);
 		return -ENOENT;
-	return snd_ctl_remove(card, kctl);
+	}
+	ret = snd_ctl_remove(card, kctl);
+	up_write(&card->controls_rwsem);
+	return ret;
 }
 
-static snd_kcontrol_t *_ctl_find_id
-(snd_card_t * card, snd_ctl_elem_id_t *id); /* w/o lock */
+/**
+ * snd_ctl_remove_unlocked_id - remove the unlocked control of the given id and release it
+ * @file: active control handle
+ * @id: the control id to remove
+ *
+ * Finds the control instance with the given id, removes it from the
+ * card list and releases it.
+ * 
+ * Returns 0 if successful, or a negative error code on failure.
+ */
+static int snd_ctl_remove_unlocked_id(snd_ctl_file_t * file, snd_ctl_elem_id_t *id)
+{
+	snd_card_t *card = file->card;
+	snd_kcontrol_t *kctl;
+	int idx, ret;
+
+	down_write(&card->controls_rwsem);
+	kctl = snd_ctl_find_id(card, id);
+	if (kctl == NULL) {
+		up_write(&card->controls_rwsem);
+		return -ENOENT;
+	}
+	for (idx = 0; idx < kctl->count; idx++)
+		if (kctl->vd[idx].owner != NULL && kctl->vd[idx].owner != file) {
+			up_write(&card->controls_rwsem);
+			return -EBUSY;
+		}
+	ret = snd_ctl_remove(card, kctl);
+	up_write(&card->controls_rwsem);
+	return ret;
+}
 
 /**
  * snd_ctl_rename_id - replace the id of a control on the card
@@ -348,7 +434,7 @@
 	snd_kcontrol_t *kctl;
 
 	down_write(&card->controls_rwsem);
-	kctl = _ctl_find_id(card, src_id);
+	kctl = snd_ctl_find_id(card, src_id);
 	if (kctl == NULL) {
 		up_write(&card->controls_rwsem);
 		return -ENOENT;
@@ -360,7 +446,19 @@
 	return 0;
 }
 
-static snd_kcontrol_t *_ctl_find_numid(snd_card_t * card, unsigned int numid)
+/**
+ * snd_ctl_find_numid - find the control instance with the given number-id
+ * @card: the card instance
+ * @numid: the number-id to search
+ *
+ * Finds the control instance with the given number-id from the card.
+ *
+ * Returns the pointer of the instance if found, or NULL if not.
+ *
+ * The caller must down card->controls_rwsem before calling this function
+ * (if the race condition can happen).
+ */
+snd_kcontrol_t *snd_ctl_find_numid(snd_card_t * card, unsigned int numid)
 {
 	struct list_head *list;
 	snd_kcontrol_t *kctl;
@@ -374,14 +472,26 @@
 	return NULL;
 }
 
-static snd_kcontrol_t *_ctl_find_id(snd_card_t * card, snd_ctl_elem_id_t *id)
+/**
+ * snd_ctl_find_id - find the control instance with the given id
+ * @card: the card instance
+ * @id: the id to search
+ *
+ * Finds the control instance with the given id from the card.
+ *
+ * Returns the pointer of the instance if found, or NULL if not.
+ *
+ * The caller must down card->controls_rwsem before calling this function
+ * (if the race condition can happen).
+ */
+snd_kcontrol_t *snd_ctl_find_id(snd_card_t * card, snd_ctl_elem_id_t *id)
 {
 	struct list_head *list;
 	snd_kcontrol_t *kctl;
 
 	snd_runtime_check(card != NULL && id != NULL, return NULL);
 	if (id->numid != 0)
-		return _ctl_find_numid(card, id->numid);
+		return snd_ctl_find_numid(card, id->numid);
 	list_for_each(list, &card->controls) {
 		kctl = snd_kcontrol(list);
 		if (kctl->id.iface != id->iface)
@@ -401,42 +511,6 @@
 	return NULL;
 }
 
-/**
- * snd_ctl_find_id - find the control instance with the given id
- * @card: the card instance
- * @id: the id to search
- *
- * Finds the control instance with the given id from the card.
- *
- * Returns the pointer of the instance if found, or NULL if not.
- */
-snd_kcontrol_t *snd_ctl_find_id(snd_card_t * card, snd_ctl_elem_id_t *id)
-{
-	snd_kcontrol_t *kctl;
-	down_read(&card->controls_rwsem);
-	kctl = _ctl_find_id(card, id);
-	up_read(&card->controls_rwsem);
-	return kctl;
-}
-
-/**
- * snd_ctl_find_numid - find the control instance with the given number-id
- * @card: the card instance
- * @numid: the number-id to search
- *
- * Finds the control instance with the given number-id from the card.
- *
- * Returns the pointer of the instance if found, or NULL if not.
- */
-snd_kcontrol_t *snd_ctl_find_numid(snd_card_t * card, unsigned int numid)
-{
-	snd_kcontrol_t *kctl;
-	down_read(&card->controls_rwsem);
-	kctl = _ctl_find_numid(card, numid);
-	up_read(&card->controls_rwsem);
-	return kctl;
-}
-
 static int snd_ctl_card_info(snd_card_t * card, snd_ctl_file_t * ctl,
 			     unsigned int cmd, unsigned long arg)
 {
@@ -531,7 +605,7 @@
 	if (copy_from_user(&info, _info, sizeof(info)))
 		return -EFAULT;
 	down_read(&card->controls_rwsem);
-	kctl = _ctl_find_id(card, &info.id);
+	kctl = snd_ctl_find_id(card, &info.id);
 	if (kctl == NULL) {
 		up_read(&card->controls_rwsem);
 		return -ENOENT;
@@ -564,7 +638,6 @@
 
 static int snd_ctl_elem_read(snd_card_t *card, snd_ctl_elem_value_t *_control)
 {
-
 	snd_ctl_elem_value_t *control;
 	snd_kcontrol_t *kctl;
 	snd_kcontrol_volatile_t *vd;
@@ -577,7 +650,7 @@
 	if (copy_from_user(control, _control, sizeof(*control)))
 		return -EFAULT;
 	down_read(&card->controls_rwsem);
-	kctl = _ctl_find_id(card, &control->id);
+	kctl = snd_ctl_find_id(card, &control->id);
 	if (kctl == NULL) {
 		result = -ENOENT;
 	} else {
@@ -618,7 +691,7 @@
 	if (copy_from_user(control, _control, sizeof(*control)))
 		return -EFAULT;
 	down_read(&card->controls_rwsem);
-	kctl = _ctl_find_id(card, &control->id);
+	kctl = snd_ctl_find_id(card, &control->id);
 	if (kctl == NULL) {
 		result = -ENOENT;
 	} else {
@@ -664,7 +737,7 @@
 	if (copy_from_user(&id, _id, sizeof(id)))
 		return -EFAULT;
 	down_write(&card->controls_rwsem);
-	kctl = _ctl_find_id(card, &id);
+	kctl = snd_ctl_find_id(card, &id);
 	if (kctl == NULL) {
 		result = -ENOENT;
 	} else {
@@ -692,7 +765,7 @@
 	if (copy_from_user(&id, _id, sizeof(id)))
 		return -EFAULT;
 	down_write(&card->controls_rwsem);
-	kctl = _ctl_find_id(card, &id);
+	kctl = snd_ctl_find_id(card, &id);
 	if (kctl == NULL) {
 		result = -ENOENT;
 	} else {
@@ -711,6 +784,196 @@
 	return result;
 }
 
+struct user_element {
+	enum sndrv_ctl_elem_type type;	/* element type */
+	unsigned int elem_count;	/* count of elements */
+	union {
+		struct {
+			unsigned int items;
+		} enumerated;
+	} u;
+	void *elem_data;		/* element data */
+	unsigned long elem_data_size;	/* size of element data in bytes */
+	void *priv_data;		/* private data (like strings for enumerated type) */
+	unsigned long priv_data_size;	/* size of private data in bytes */
+	unsigned short dimen_count;	/* count of dimensions */
+	unsigned short dimen[0];	/* array of dimensions */
+};
+
+static int snd_ctl_elem_user_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo)
+{
+	struct user_element *ue = kcontrol->private_data;
+
+	uinfo->type = ue->type;
+	uinfo->count = ue->elem_count;
+	if (ue->type == SNDRV_CTL_ELEM_TYPE_ENUMERATED) {
+		uinfo->value.enumerated.items = ue->u.enumerated.items;
+		if (uinfo->value.enumerated.item >= ue->u.enumerated.items)
+			uinfo->value.enumerated.item = 0;
+		strlcpy(uinfo->value.enumerated.name,
+			(char *)ue->priv_data + uinfo->value.enumerated.item * 64,
+			64);
+	}
+	return 0;
+}
+
+static int snd_ctl_elem_user_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
+{
+	struct user_element *ue = kcontrol->private_data;
+
+	memcpy(&ucontrol->value, ue->elem_data, ue->elem_data_size);
+	return 0;
+}
+
+static int snd_ctl_elem_user_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
+{
+	int change;
+	struct user_element *ue = kcontrol->private_data;
+	
+	change = memcmp(&ucontrol->value, ue->elem_data, ue->elem_data_size);
+	memcpy(ue->elem_data, &ucontrol->value, ue->elem_data_size);
+	return !!change;
+}
+
+static void snd_ctl_elem_user_free(snd_kcontrol_t * kcontrol)
+{
+	kfree(kcontrol->private_data);
+}
+
+static int snd_ctl_elem_add(snd_ctl_file_t *file, snd_ctl_elem_info_t *_info, int replace)
+{
+	snd_card_t *card = file->card;
+	snd_ctl_elem_info_t info;
+	snd_kcontrol_t kctl, *_kctl;
+	unsigned int access;
+	long private_size, dimen_size, extra_size;
+	struct user_element *ue;
+	int idx, err;
+	
+	if (copy_from_user(&info, _info, sizeof(info)))
+		return -EFAULT;
+	if (info.count > 1024)
+		return -EINVAL;
+	access = info.access == 0 ? SNDRV_CTL_ELEM_ACCESS_READWRITE :
+		 (info.access & (SNDRV_CTL_ELEM_ACCESS_READWRITE|SNDRV_CTL_ELEM_ACCESS_INACTIVE|
+		 		 SNDRV_CTL_ELEM_ACCESS_DINDIRECT|SNDRV_CTL_ELEM_ACCESS_INDIRECT));
+	if (access & (SNDRV_CTL_ELEM_ACCESS_DINDIRECT | SNDRV_CTL_ELEM_ACCESS_INDIRECT))
+		return -EINVAL;
+	info.id.numid = 0;
+	memset(&kctl, 0, sizeof(kctl));
+	down_write(&card->controls_rwsem);
+	if (!!((_kctl = snd_ctl_find_id(card, &info.id)) != NULL) ^ replace) {
+		up_write(&card->controls_rwsem);
+		return !replace ? -EBUSY : -ENOENT;
+	}
+	if (replace) {
+		err = snd_ctl_remove(card, _kctl);
+		if (err < 0) {
+			up_write(&card->controls_rwsem);
+			return err;
+		}
+	}
+	up_write(&card->controls_rwsem);
+	memcpy(&kctl.id, &info.id, sizeof(info.id));
+	kctl.count = info.owner ? info.owner : 1;
+	access |= SNDRV_CTL_ELEM_ACCESS_USER;
+	kctl.info = snd_ctl_elem_user_info;
+	if (access & SNDRV_CTL_ELEM_ACCESS_READ)
+		kctl.get = snd_ctl_elem_user_get;
+	if (access & SNDRV_CTL_ELEM_ACCESS_WRITE)
+		kctl.put = snd_ctl_elem_user_put;
+	extra_size = 0;
+	switch (info.type) {
+	case SNDRV_CTL_ELEM_TYPE_BOOLEAN:
+		private_size = sizeof(char);
+		if (info.count > 128)
+			return -EINVAL;
+		break;
+	case SNDRV_CTL_ELEM_TYPE_INTEGER:
+		private_size = sizeof(long);
+		if (info.count > 128)
+			return -EINVAL;
+		break;
+	case SNDRV_CTL_ELEM_TYPE_INTEGER64:
+		private_size = sizeof(long long);
+		if (info.count > 64)
+			return -EINVAL;
+		break;
+	case SNDRV_CTL_ELEM_TYPE_ENUMERATED:
+		private_size = sizeof(unsigned int);
+		if (info.count > 128)
+			return -EINVAL;
+		if (info.value.enumerated.items > 1024)
+			return -EINVAL;
+		extra_size = info.value.enumerated.items * 64;
+		break;
+	case SNDRV_CTL_ELEM_TYPE_BYTES:
+		private_size = sizeof(unsigned char);
+		if (info.count > 512)
+			return -EINVAL;
+		break;
+	case SNDRV_CTL_ELEM_TYPE_IEC958:
+		private_size = sizeof(struct sndrv_aes_iec958);
+		if (info.count != 1)
+			return -EINVAL;
+		break;
+	default:
+		return -EINVAL;
+	}
+	private_size *= info.count;
+	if (private_size > 1024 * 1024)
+		return -EINVAL;
+	dimen_size = 0;
+	if (!(info.access & SNDRV_CTL_ELEM_ACCESS_DINDIRECT))
+		for (idx = 0; idx < 4 && info.dimen.d[idx]; idx++)
+			dimen_size += sizeof(unsigned short);
+	ue = snd_kcalloc(sizeof(struct user_element) + dimen_size + private_size + extra_size, GFP_KERNEL);
+	if (ue == NULL)
+		return -ENOMEM;
+	ue->type = info.type;
+	ue->elem_count = info.count;
+	if (!(info.access & SNDRV_CTL_ELEM_ACCESS_DINDIRECT)) {
+		for (idx = 0; idx < 4 && info.dimen.d[idx]; idx++)
+			ue->dimen[idx] = info.dimen.d[idx];
+		ue->dimen_count = dimen_size / sizeof(unsigned short);
+	}
+	ue->elem_data = (char *)ue + sizeof(ue) + dimen_size;
+	ue->elem_data_size = private_size;
+	if (extra_size) {
+		ue->priv_data = (char *)ue + sizeof(ue) + dimen_size + private_size;
+		ue->priv_data_size = extra_size;
+		if (ue->type == SNDRV_CTL_ELEM_TYPE_ENUMERATED) {
+			if (copy_from_user(ue->priv_data, *(char **)info.value.enumerated.name, extra_size))
+				return -EFAULT;
+			ue->u.enumerated.items = info.value.enumerated.items;
+		}
+	}
+	kctl.private_free = snd_ctl_elem_user_free;
+	_kctl = snd_ctl_new(&kctl, access);
+	if (_kctl == NULL) {
+		kfree(_kctl->private_data);
+		return -ENOMEM;
+	}
+	_kctl->private_data = ue;
+	for (idx = 0; idx < _kctl->count; idx++)
+		_kctl->vd[idx].owner = file;
+	err = snd_ctl_add(card, _kctl);
+	if (err < 0) {
+		snd_ctl_free_one(_kctl);
+		return err;
+	}
+	return 0;
+}
+
+static int snd_ctl_elem_remove(snd_ctl_file_t *file, snd_ctl_elem_id_t *_id)
+{
+	snd_ctl_elem_id_t id;
+
+	if (copy_from_user(&id, _id, sizeof(id)))
+		return -EFAULT;
+	return snd_ctl_remove_unlocked_id(file, &id);
+}
+
 static int snd_ctl_subscribe_events(snd_ctl_file_t *file, int *ptr)
 {
 	int subscribe;
@@ -761,6 +1024,12 @@
 		return snd_ctl_elem_lock(ctl, (snd_ctl_elem_id_t *) arg);
 	case SNDRV_CTL_IOCTL_ELEM_UNLOCK:
 		return snd_ctl_elem_unlock(ctl, (snd_ctl_elem_id_t *) arg);
+	case SNDRV_CTL_IOCTL_ELEM_ADD:
+		return snd_ctl_elem_add(ctl, (snd_ctl_elem_info_t *) arg, 0);
+	case SNDRV_CTL_IOCTL_ELEM_REPLACE:
+		return snd_ctl_elem_add(ctl, (snd_ctl_elem_info_t *) arg, 1);
+	case SNDRV_CTL_IOCTL_ELEM_REMOVE:
+		return snd_ctl_elem_remove(ctl, (snd_ctl_elem_id_t *) arg);
 	case SNDRV_CTL_IOCTL_SUBSCRIBE_EVENTS:
 		return snd_ctl_subscribe_events(ctl, (int *) arg);
 	case SNDRV_CTL_IOCTL_POWER:
@@ -995,9 +1264,11 @@
 	snd_assert(cardnum >= 0 && cardnum < SNDRV_CARDS, return -ENXIO);
 	if ((err = snd_unregister_device(SNDRV_DEVICE_TYPE_CONTROL, card, 0)) < 0)
 		return err;
+	down_write(&card->controls_rwsem);
 	while (!list_empty(&card->controls)) {
 		control = snd_kcontrol(card->controls.next);
 		snd_ctl_remove(card, control);
 	}
+	up_write(&card->controls_rwsem);
 	return 0;
 }
--- diff/sound/core/hwdep.c	2003-10-27 09:20:39.000000000 +0000
+++ source/sound/core/hwdep.c	2004-02-09 10:39:58.000000000 +0000
@@ -214,7 +214,7 @@
 	snd_hwdep_dsp_image_t info;
 	int err;
 	
-	if (! hw->ops.dsp_load || ! hw->ops.dsp_status)
+	if (! hw->ops.dsp_load)
 		return -ENXIO;
 	memset(&info, 0, sizeof(info));
 	if (copy_from_user(&info, _info, sizeof(info)))
@@ -487,7 +487,6 @@
 
 	memset(snd_hwdep_devices, 0, sizeof(snd_hwdep_devices));
 	if ((entry = snd_info_create_module_entry(THIS_MODULE, "hwdep", NULL)) != NULL) {
-		entry->content = SNDRV_INFO_CONTENT_TEXT;
 		entry->c.text.read_size = 512;
 		entry->c.text.read = snd_hwdep_proc_read;
 		if (snd_info_register(entry) < 0) {
--- diff/sound/core/info.c	2003-09-30 15:46:21.000000000 +0100
+++ source/sound/core/info.c	2004-02-09 10:39:58.000000000 +0000
@@ -99,7 +99,7 @@
 	if (buffer->stop || buffer->error)
 		return 0;
 	va_start(args, fmt);
-	res = vsnprintf(sbuffer, sizeof(sbuffer), fmt, args);
+	res = vscnprintf(sbuffer, sizeof(sbuffer), fmt, args);
 	va_end(args);
 	if (buffer->size + res >= buffer->len) {
 		buffer->stop = 1;
--- diff/sound/core/info_oss.c	2002-10-16 04:27:19.000000000 +0100
+++ source/sound/core/info_oss.c	2004-02-09 10:39:58.000000000 +0000
@@ -114,7 +114,6 @@
 
 	memset(snd_sndstat_strings, 0, sizeof(snd_sndstat_strings));
 	if ((entry = snd_info_create_module_entry(THIS_MODULE, "sndstat", snd_oss_root)) != NULL) {
-		entry->content = SNDRV_INFO_CONTENT_TEXT;
 		entry->c.text.read_size = 2048;
 		entry->c.text.read = snd_sndstat_proc_read;
 		if (snd_info_register(entry) < 0) {
--- diff/sound/core/init.c	2003-10-27 09:20:39.000000000 +0000
+++ source/sound/core/init.c	2004-02-09 10:39:58.000000000 +0000
@@ -442,7 +442,6 @@
 		snd_printd("unable to create card entry\n");
 		goto __skip_info;
 	}
-	entry->content = SNDRV_INFO_CONTENT_TEXT;
 	entry->c.text.read_size = PAGE_SIZE;
 	entry->c.text.read = snd_card_id_read;
 	if (snd_info_register(entry) < 0) {
@@ -527,7 +526,6 @@
 
 	entry = snd_info_create_module_entry(THIS_MODULE, "cards", NULL);
 	snd_runtime_check(entry != NULL, return -ENOMEM);
-	entry->content = SNDRV_INFO_CONTENT_TEXT;
 	entry->c.text.read_size = PAGE_SIZE;
 	entry->c.text.read = snd_card_info_read;
 	if (snd_info_register(entry) < 0) {
@@ -539,7 +537,6 @@
 #ifdef MODULE
 	entry = snd_info_create_module_entry(THIS_MODULE, "modules", NULL);
 	if (entry) {
-		entry->content = SNDRV_INFO_CONTENT_TEXT;
 		entry->c.text.read_size = PAGE_SIZE;
 		entry->c.text.read = snd_card_module_info_read;
 		if (snd_info_register(entry) < 0)
@@ -682,6 +679,7 @@
 int snd_power_wait(snd_card_t *card, unsigned int power_state, struct file *file)
 {
 	wait_queue_t wait;
+	int result = 0;
 
 	/* fastpath */
 	if (snd_power_get_state(card) == power_state)
@@ -689,18 +687,24 @@
 	init_waitqueue_entry(&wait, current);
 	add_wait_queue(&card->power_sleep, &wait);
 	while (1) {
-		if (card->shutdown)
-			return -ENODEV;
-		if (snd_power_get_state(card) == power_state) {
-			remove_wait_queue(&card->power_sleep, &wait);
-			return 0;
+		if (card->shutdown) {
+			result = -ENODEV;
+			break;
 		}
-		if (file && (file->f_flags & O_NONBLOCK))
-			return -EAGAIN;
+		if (snd_power_get_state(card) == power_state)
+			break;
+#if 0 /* block all devices */
+		if (file && (file->f_flags & O_NONBLOCK)) {
+			result = -EAGAIN;
+			break;
+		}
+#endif
 		set_current_state(TASK_UNINTERRUPTIBLE);
 		snd_power_unlock(card);
 		schedule_timeout(30 * HZ);
 		snd_power_lock(card);
 	}
+	remove_wait_queue(&card->power_sleep, &wait);
+	return result;
 }
 #endif /* CONFIG_PM */
--- diff/sound/core/ioctl32/ioctl32.c	2003-09-30 15:46:21.000000000 +0100
+++ source/sound/core/ioctl32/ioctl32.c	2004-02-09 10:39:58.000000000 +0000
@@ -259,12 +259,15 @@
 
 	ctl = snd_magic_cast(snd_ctl_file_t, file->private_data, return -ENXIO);
 
+	down_read(&ctl->card->controls_rwsem);
 	kctl = snd_ctl_find_id(ctl->card, id);
 	if (! kctl) {
+		up_read(&ctl->card->controls_rwsem);
 		return -ENXIO;
 	}
 	info.id = *id;
 	err = kctl->info(kctl, &info);
+	up_read(&ctl->card->controls_rwsem);
 	if (err >= 0)
 		err = info.type;
 	return err;
--- diff/sound/core/memalloc.c	2003-09-30 15:46:21.000000000 +0100
+++ source/sound/core/memalloc.c	2004-02-09 10:39:58.000000000 +0000
@@ -39,7 +39,7 @@
 #ifndef SNDRV_CARDS
 #define SNDRV_CARDS	8
 #endif
-static int enable[8] = {[0 ... (SNDRV_CARDS-1)] = 1};
+static int enable[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = 1};
 MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
 MODULE_PARM_DESC(enable, "Enable cards to allocate buffers.");
 
@@ -94,26 +94,29 @@
 				    dma_addr_t *dma_handle)
 {
 	void *ret;
-	u64 dma_mask;
-	unsigned long rmask;
+	u64 dma_mask, cdma_mask;
+	unsigned long mask;
 
 	if (hwdev == NULL)
 		return pci_alloc_consistent(hwdev, size, dma_handle);
 	dma_mask = hwdev->dma_mask;
-	rmask = ~((unsigned long)dma_mask);
+	cdma_mask = hwdev->consistent_dma_mask;
+	mask = (unsigned long)dma_mask && (unsigned long)cdma_mask;
 	hwdev->dma_mask = 0xffffffff; /* do without masking */
+	hwdev->consistent_dma_mask = 0xffffffff; /* do without masking */
 	ret = pci_alloc_consistent(hwdev, size, dma_handle);
 	hwdev->dma_mask = dma_mask; /* restore */
+	hwdev->consistent_dma_mask = cdma_mask; /* restore */
 	if (ret) {
 		/* obtained address is out of range? */
-		if (((unsigned long)*dma_handle + size - 1) & rmask) {
+		if (((unsigned long)*dma_handle + size - 1) & ~mask) {
 			/* reallocate with the proper mask */
 			pci_free_consistent(hwdev, size, ret, *dma_handle);
 			ret = pci_alloc_consistent(hwdev, size, dma_handle);
 		}
 	} else {
 		/* wish to success now with the proper mask... */
-		if (dma_mask != 0xffffffff)
+		if (mask != 0xffffffffUL)
 			ret = pci_alloc_consistent(hwdev, size, dma_handle);
 	}
 	return ret;
@@ -207,8 +210,9 @@
 		dmab->addr = 0;
 		return -ENXIO;
 	}
-	if (dmab->area)
-		dmab->bytes = size;
+	if (! dmab->area)
+		return -ENOMEM;
+	dmab->bytes = size;
 	return 0;
 }
 
@@ -342,6 +346,8 @@
 	down(&list_mutex);
 	mem = mem_list_find(dev, 0);
 	if (mem) {
+		if (mem->used)
+			printk(KERN_WARNING "snd-page-alloc: releasing the used block (type=%d, id=0x%x\n", mem->dev.type, mem->dev.id);
 		snd_dma_free_pages(dev, &mem->buffer);
 		if (! dmab || ! dmab->bytes) {
 			/* remove the entry */
@@ -361,7 +367,7 @@
 			return -ENOMEM;
 		}
 		mem->dev = *dev;
-		list_add(&mem->list, &mem_list_head);
+		list_add_tail(&mem->list, &mem_list_head);
 	}
 	/* store the entry */
 	mem->used = 1;
@@ -640,13 +646,13 @@
 {
 	void *ptr;
 	dma_addr_t addr;
-	unsigned long rmask;
+	unsigned long mask;
 
-	rmask = ~(unsigned long)(pci ? pci->dma_mask : 0x00ffffff);
+	mask = pci ? (unsigned long)pci->consistent_dma_mask : 0x00ffffffUL;
 	ptr = (void *)__get_free_page(GFP_KERNEL);
 	if (ptr) {
 		addr = virt_to_phys(ptr);
-		if (((unsigned long)addr + PAGE_SIZE - 1) & rmask) {
+		if (((unsigned long)addr + PAGE_SIZE - 1) & ~mask) {
 			/* try to reallocate with the GFP_DMA */
 			free_page((unsigned long)ptr);
 			/* use GFP_ATOMIC for the DMA zone to avoid stall */
@@ -783,6 +789,7 @@
  * allocation of buffers for pre-defined devices
  */
 
+#ifdef CONFIG_PCI
 /* FIXME: for pci only - other bus? */
 struct prealloc_dev {
 	unsigned short vendor;
@@ -823,37 +830,48 @@
 
 	while ((pci = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, pci)) != NULL) {
 		struct prealloc_dev *dev;
+		unsigned int i;
 		if (card >= SNDRV_CARDS)
 			break;
 		for (dev = prealloc_devices; dev->vendor; dev++) {
-			unsigned int i;
-			if (dev->vendor != pci->vendor || dev->device != pci->device)
-				continue;
-			if (! enable[card++])
-				continue;
+			if (dev->vendor == pci->vendor && dev->device == pci->device)
+				break;
+		}
+		if (! dev->vendor)
+			continue;
+		if (! enable[card++]) {
+			printk(KERN_DEBUG "snd-page-alloc: skipping card %d, device %04x:%04x\n", card, pci->vendor, pci->device);
+			continue;
+		}
 			
-			if (pci_set_dma_mask(pci, dev->dma_mask) < 0) {
-				printk(KERN_ERR "snd-page-alloc: cannot set DMA mask %lx for pci %04x:%04x\n", dev->dma_mask, dev->vendor, dev->device);
-				continue;
+		if (pci_set_dma_mask(pci, dev->dma_mask) < 0 ||
+		    pci_set_consistent_dma_mask(pci, dev->dma_mask) < 0) {
+			printk(KERN_ERR "snd-page-alloc: cannot set DMA mask %lx for pci %04x:%04x\n", dev->dma_mask, dev->vendor, dev->device);
+			continue;
+		}
+		for (i = 0; i < dev->buffers; i++) {
+			struct snd_mem_list *mem;
+			mem = kmalloc(sizeof(*mem), GFP_KERNEL);
+			if (! mem) {
+				printk(KERN_WARNING "snd-page-alloc: can't malloc memlist\n");
+				break;
 			}
-
-			for (i = 0; i < dev->buffers; i++) {
-				struct snd_dma_device dma;
-				struct snd_dma_buffer buf;
-				snd_dma_device_pci(&dma, pci, SNDRV_DMA_DEVICE_UNUSED);
-				memset(&buf, 0, sizeof(buf));
-				snd_dma_alloc_pages(&dma, dev->size, &buf);
-				if (buf.bytes) {
-					if (snd_dma_set_reserved(&dma, &buf) < 0) {
-						printk(KERN_WARNING "snd-page-alloc: cannot reserve buffer\n");
-						snd_dma_free_pages(&dma, &buf);
-					}
-				} else
-					printk(KERN_WARNING "snd-page-alloc: cannot allocate buffer pages (size = %d)\n", dev->size);
+			memset(mem, 0, sizeof(*mem));
+			snd_dma_device_pci(&mem->dev, pci, SNDRV_DMA_DEVICE_UNUSED);
+			if (snd_dma_alloc_pages(&mem->dev, dev->size, &mem->buffer) < 0) {
+				printk(KERN_WARNING "snd-page-alloc: cannot allocate buffer pages (size = %d)\n", dev->size);
+				kfree(mem);
+			} else {
+				down(&list_mutex);
+				list_add_tail(&mem->list, &mem_list_head);
+				up(&list_mutex);
 			}
 		}
 	}
 }
+#else
+#define preallocate_cards()	/* NOP */
+#endif
 
 
 #ifdef CONFIG_PROC_FS
@@ -890,7 +908,8 @@
 		case SNDRV_DMA_TYPE_PCI:
 		case SNDRV_DMA_TYPE_PCI_SG:
 			if (mem->dev.dev.pci) {
-				len += sprintf(page + len, "PCI [%04x:%04x]",
+				len += sprintf(page + len, "%s [%04x:%04x]",
+					       mem->dev.type == SNDRV_DMA_TYPE_PCI ? "PCI" : "PCI-SG",
 					       mem->dev.dev.pci->vendor,
 					       mem->dev.dev.pci->device);
 			}
--- diff/sound/core/memory.c	2003-05-21 11:49:56.000000000 +0100
+++ source/sound/core/memory.c	2004-02-09 10:39:58.000000000 +0000
@@ -231,7 +231,6 @@
 
 	entry = snd_info_create_module_entry(THIS_MODULE, "meminfo", NULL);
 	if (entry) {
-		entry->content = SNDRV_INFO_CONTENT_TEXT;
 		entry->c.text.read_size = 256;
 		entry->c.text.read = snd_memory_info_read;
 		if (snd_info_register(entry) < 0) {
--- diff/sound/core/misc.c	2003-05-21 11:49:56.000000000 +0100
+++ source/sound/core/misc.c	2004-02-09 10:39:58.000000000 +0000
@@ -51,9 +51,8 @@
 		printk("ALSA %s:%d: ", file, line);
 	}
 	va_start(args, format);
-	vsnprintf(tmpbuf, sizeof(tmpbuf)-1, format, args);
+	vsnprintf(tmpbuf, sizeof(tmpbuf), format, args);
 	va_end(args);
-	tmpbuf[sizeof(tmpbuf)-1] = '\0';
 	printk(tmpbuf);
 }
 #endif
@@ -73,9 +72,8 @@
 		printk(KERN_DEBUG "ALSA %s:%d: ", file, line);
 	}
 	va_start(args, format);
-	vsnprintf(tmpbuf, sizeof(tmpbuf)-1, format, args);
+	vsnprintf(tmpbuf, sizeof(tmpbuf), format, args);
 	va_end(args);
-	tmpbuf[sizeof(tmpbuf)-1] = '\0';
 	printk(tmpbuf);
 
 }
--- diff/sound/core/oss/mixer_oss.c	2003-09-17 12:28:13.000000000 +0100
+++ source/sound/core/oss/mixer_oss.c	2004-02-09 10:39:58.000000000 +0000
@@ -30,9 +30,12 @@
 #include <sound/mixer_oss.h>
 #include <linux/soundcard.h>
 
+#define OSS_ALSAEMULVER         _SIOR ('M', 249, int)
+
 MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>");
 MODULE_DESCRIPTION("Mixer OSS emulation for ALSA.");
 MODULE_LICENSE("GPL");
+MODULE_ALIAS_SNDRV_MINOR(SNDRV_MINOR_OSS_MIXER);
 
 static int snd_mixer_oss_open(struct inode *inode, struct file *file)
 {
@@ -305,34 +308,36 @@
 			tmp = snd_mixer_oss_set_recsrc(fmixer, tmp);
 			if (tmp < 0)
 				return tmp;
-			return put_user(tmp, (int *)arg) ? -EFAULT : 0;
+			return put_user(tmp, (int *)arg);
 		case OSS_GETVERSION:
 			return put_user(SNDRV_OSS_VERSION, (int *) arg);
+		case OSS_ALSAEMULVER:
+			return put_user(1, (int *) arg);
 		case SOUND_MIXER_READ_DEVMASK:
 			tmp = snd_mixer_oss_devmask(fmixer);
 			if (tmp < 0)
 				return tmp;
-			return put_user(tmp, (int *)arg) ? -EFAULT : 0;
+			return put_user(tmp, (int *)arg);
 		case SOUND_MIXER_READ_STEREODEVS:
 			tmp = snd_mixer_oss_stereodevs(fmixer);
 			if (tmp < 0)
 				return tmp;
-			return put_user(tmp, (int *)arg) ? -EFAULT : 0;
+			return put_user(tmp, (int *)arg);
 		case SOUND_MIXER_READ_RECMASK:
 			tmp = snd_mixer_oss_recmask(fmixer);
 			if (tmp < 0)
 				return tmp;
-			return put_user(tmp, (int *)arg) ? -EFAULT : 0;
+			return put_user(tmp, (int *)arg);
 		case SOUND_MIXER_READ_CAPS:
 			tmp = snd_mixer_oss_caps(fmixer);
 			if (tmp < 0)
 				return tmp;
-			return put_user(tmp, (int *)arg) ? -EFAULT : 0;
+			return put_user(tmp, (int *)arg);
 		case SOUND_MIXER_READ_RECSRC:
 			tmp = snd_mixer_oss_get_recsrc(fmixer);
 			if (tmp < 0)
 				return tmp;
-			return put_user(tmp, (int *)arg) ? -EFAULT : 0;
+			return put_user(tmp, (int *)arg);
 		}
 	}
 	if (cmd & SIOC_IN) {
@@ -341,12 +346,12 @@
 		tmp = snd_mixer_oss_set_volume(fmixer, cmd & 0xff, tmp);
 		if (tmp < 0)
 			return tmp;
-		return put_user(tmp, (int *)arg) ? -EFAULT : 0;
+		return put_user(tmp, (int *)arg);
 	} else if (cmd & SIOC_OUT) {
 		tmp = snd_mixer_oss_get_volume(fmixer, cmd & 0xff);
 		if (tmp < 0)
 			return tmp;
-		return put_user(tmp, (int *)arg) ? -EFAULT : 0;
+		return put_user(tmp, (int *)arg);
 	}
 	return -ENXIO;
 }
@@ -464,12 +469,14 @@
 	unsigned int signature;
 	unsigned int present;
 	unsigned int channels;
-	snd_kcontrol_t *kcontrol[SNDRV_MIXER_OSS_ITEM_COUNT];
+	unsigned int numid[SNDRV_MIXER_OSS_ITEM_COUNT];
 	unsigned int capture_item;
 	struct snd_mixer_oss_assign_table *assigned;
 	unsigned int allocated: 1;
 };
 
+#define ID_UNKNOWN	((unsigned int)-1)
+
 static snd_kcontrol_t *snd_mixer_oss_test_id(snd_mixer_oss_t *mixer, const char *name, int index)
 {
 	snd_card_t * card = mixer->card;
@@ -484,15 +491,23 @@
 
 static void snd_mixer_oss_get_volume1_vol(snd_mixer_oss_file_t *fmixer,
 					  snd_mixer_oss_slot_t *pslot,
-					  snd_kcontrol_t *kctl,
+					  unsigned int numid,
 					  int *left, int *right)
 {
 	snd_ctl_elem_info_t *uinfo;
 	snd_ctl_elem_value_t *uctl;
+	snd_kcontrol_t *kctl;
+	snd_card_t *card = fmixer->card;
 
-	snd_runtime_check(kctl != NULL, return);
-	uinfo = snd_kcalloc(sizeof(*uinfo), GFP_ATOMIC);
-	uctl = snd_kcalloc(sizeof(*uctl), GFP_ATOMIC);
+	if (numid == ID_UNKNOWN)
+		return;
+	down_read(&card->controls_rwsem);
+	if ((kctl = snd_ctl_find_numid(card, numid)) == NULL) {
+		up_read(&card->controls_rwsem);
+		return;
+	}
+	uinfo = snd_kcalloc(sizeof(*uinfo), GFP_KERNEL);
+	uctl = snd_kcalloc(sizeof(*uctl), GFP_KERNEL);
 	if (uinfo == NULL || uctl == NULL)
 		goto __unalloc;
 	snd_runtime_check(!kctl->info(kctl, uinfo), goto __unalloc);
@@ -502,6 +517,7 @@
 	if (uinfo->count > 1)
 		*right = snd_mixer_oss_conv1(uctl->value.integer.value[1], uinfo->value.integer.min, uinfo->value.integer.max, &pslot->volume[1]);
       __unalloc:
+	up_read(&card->controls_rwsem);
       	if (uctl)
       		kfree(uctl);
       	if (uinfo)
@@ -510,16 +526,24 @@
 
 static void snd_mixer_oss_get_volume1_sw(snd_mixer_oss_file_t *fmixer,
 					 snd_mixer_oss_slot_t *pslot,
-					 snd_kcontrol_t *kctl,
+					 unsigned int numid,
 					 int *left, int *right,
 					 int route)
 {
 	snd_ctl_elem_info_t *uinfo;
 	snd_ctl_elem_value_t *uctl;
+	snd_kcontrol_t *kctl;
+	snd_card_t *card = fmixer->card;
 
-	snd_runtime_check(kctl != NULL, return);
-	uinfo = snd_kcalloc(sizeof(*uinfo), GFP_ATOMIC);
-	uctl = snd_kcalloc(sizeof(*uctl), GFP_ATOMIC);
+	if (numid == ID_UNKNOWN)
+		return;
+	down_read(&card->controls_rwsem);
+	if ((kctl = snd_ctl_find_numid(card, numid)) == NULL) {
+		up_read(&card->controls_rwsem);
+		return;
+	}
+	uinfo = snd_kcalloc(sizeof(*uinfo), GFP_KERNEL);
+	uctl = snd_kcalloc(sizeof(*uctl), GFP_KERNEL);
 	if (uinfo == NULL || uctl == NULL)
 		goto __unalloc;
 	snd_runtime_check(!kctl->info(kctl, uinfo), goto __unalloc);
@@ -532,6 +556,7 @@
 	if (uinfo->count > 1 && !uctl->value.integer.value[route ? 3 : 1])
 		*right = 0;
       __unalloc:
+	up_read(&card->controls_rwsem);
       	if (uctl)
       		kfree(uctl);
       	if (uinfo)
@@ -542,43 +567,46 @@
 				     snd_mixer_oss_slot_t *pslot,
 				     int *left, int *right)
 {
-	snd_card_t *card = fmixer->card;
 	struct slot *slot = (struct slot *)pslot->private_data;
 	
 	*left = *right = 100;
-	down_read(&card->controls_rwsem);
 	if (slot->present & SNDRV_MIXER_OSS_PRESENT_PVOLUME) {
-		snd_mixer_oss_get_volume1_vol(fmixer, pslot, slot->kcontrol[SNDRV_MIXER_OSS_ITEM_PVOLUME], left, right);
+		snd_mixer_oss_get_volume1_vol(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_PVOLUME], left, right);
 	} else if (slot->present & SNDRV_MIXER_OSS_PRESENT_GVOLUME) {
-		snd_mixer_oss_get_volume1_vol(fmixer, pslot, slot->kcontrol[SNDRV_MIXER_OSS_ITEM_GVOLUME], left, right);
+		snd_mixer_oss_get_volume1_vol(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_GVOLUME], left, right);
 	} else if (slot->present & SNDRV_MIXER_OSS_PRESENT_GLOBAL) {
-		snd_mixer_oss_get_volume1_vol(fmixer, pslot, slot->kcontrol[SNDRV_MIXER_OSS_ITEM_GLOBAL], left, right);
+		snd_mixer_oss_get_volume1_vol(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_GLOBAL], left, right);
 	}
 	if (slot->present & SNDRV_MIXER_OSS_PRESENT_PSWITCH) {
-		snd_mixer_oss_get_volume1_sw(fmixer, pslot, slot->kcontrol[SNDRV_MIXER_OSS_ITEM_PSWITCH], left, right, 0);
+		snd_mixer_oss_get_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_PSWITCH], left, right, 0);
 	} else if (slot->present & SNDRV_MIXER_OSS_PRESENT_GSWITCH) {
-		snd_mixer_oss_get_volume1_sw(fmixer, pslot, slot->kcontrol[SNDRV_MIXER_OSS_ITEM_GSWITCH], left, right, 0);
+		snd_mixer_oss_get_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_GSWITCH], left, right, 0);
 	} else if (slot->present & SNDRV_MIXER_OSS_PRESENT_PROUTE) {
-		snd_mixer_oss_get_volume1_sw(fmixer, pslot, slot->kcontrol[SNDRV_MIXER_OSS_ITEM_PROUTE], left, right, 1);
+		snd_mixer_oss_get_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_PROUTE], left, right, 1);
 	} else if (slot->present & SNDRV_MIXER_OSS_PRESENT_GROUTE) {
-		snd_mixer_oss_get_volume1_sw(fmixer, pslot, slot->kcontrol[SNDRV_MIXER_OSS_ITEM_GROUTE], left, right, 1);
+		snd_mixer_oss_get_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_GROUTE], left, right, 1);
 	}
-	up_read(&card->controls_rwsem);
 	return 0;
 }
 
 static void snd_mixer_oss_put_volume1_vol(snd_mixer_oss_file_t *fmixer,
 					  snd_mixer_oss_slot_t *pslot,
-					  snd_kcontrol_t *kctl,
+					  unsigned int numid,
 					  int left, int right)
 {
 	snd_ctl_elem_info_t *uinfo;
 	snd_ctl_elem_value_t *uctl;
+	snd_kcontrol_t *kctl;
+	snd_card_t *card = fmixer->card;
 	int res;
 
-	snd_runtime_check(kctl != NULL, return);
-	uinfo = snd_kcalloc(sizeof(*uinfo), GFP_ATOMIC);
-	uctl = snd_kcalloc(sizeof(*uctl), GFP_ATOMIC);
+	if (numid == ID_UNKNOWN)
+		return;
+	down_read(&card->controls_rwsem);
+	if ((kctl = snd_ctl_find_numid(card, numid)) == NULL)
+		return;
+	uinfo = snd_kcalloc(sizeof(*uinfo), GFP_KERNEL);
+	uctl = snd_kcalloc(sizeof(*uctl), GFP_KERNEL);
 	if (uinfo == NULL || uctl == NULL)
 		goto __unalloc;
 	snd_runtime_check(!kctl->info(kctl, uinfo), goto __unalloc);
@@ -588,8 +616,9 @@
 		uctl->value.integer.value[1] = snd_mixer_oss_conv2(right, uinfo->value.integer.min, uinfo->value.integer.max);
 	snd_runtime_check((res = kctl->put(kctl, uctl)) >= 0, goto __unalloc);
 	if (res > 0)
-		snd_ctl_notify(fmixer->card, SNDRV_CTL_EVENT_MASK_VALUE, &kctl->id);
+		snd_ctl_notify(card, SNDRV_CTL_EVENT_MASK_VALUE, &kctl->id);
       __unalloc:
+	up_read(&card->controls_rwsem);
       	if (uctl)
       		kfree(uctl);
       	if (uinfo)
@@ -598,17 +627,25 @@
 
 static void snd_mixer_oss_put_volume1_sw(snd_mixer_oss_file_t *fmixer,
 					 snd_mixer_oss_slot_t *pslot,
-					 snd_kcontrol_t *kctl,
+					 unsigned int numid,
 					 int left, int right,
 					 int route)
 {
 	snd_ctl_elem_info_t *uinfo;
 	snd_ctl_elem_value_t *uctl;
+	snd_kcontrol_t *kctl;
+	snd_card_t *card = fmixer->card;
 	int res;
 
-	snd_runtime_check(kctl != NULL, return);
-	uinfo = snd_kcalloc(sizeof(*uinfo), GFP_ATOMIC);
-	uctl = snd_kcalloc(sizeof(*uctl), GFP_ATOMIC);
+	if (numid == ID_UNKNOWN)
+		return;
+	down_read(&card->controls_rwsem);
+	if ((kctl = snd_ctl_find_numid(card, numid)) == NULL) {
+		up_read(&fmixer->card->controls_rwsem);
+		return;
+	}
+	uinfo = snd_kcalloc(sizeof(*uinfo), GFP_KERNEL);
+	uctl = snd_kcalloc(sizeof(*uctl), GFP_KERNEL);
 	if (uinfo == NULL || uctl == NULL)
 		goto __unalloc;
 	snd_runtime_check(!kctl->info(kctl, uinfo), goto __unalloc);
@@ -624,8 +661,9 @@
 	}
 	snd_runtime_check((res = kctl->put(kctl, uctl)) >= 0, goto __unalloc);
 	if (res > 0)
-		snd_ctl_notify(fmixer->card, SNDRV_CTL_EVENT_MASK_VALUE, &kctl->id);
+		snd_ctl_notify(card, SNDRV_CTL_EVENT_MASK_VALUE, &kctl->id);
       __unalloc:
+	up_read(&card->controls_rwsem);
       	if (uctl)
       		kfree(uctl);
       	if (uinfo)
@@ -636,40 +674,37 @@
 				     snd_mixer_oss_slot_t *pslot,
 				     int left, int right)
 {
-	snd_card_t *card = fmixer->card;
 	struct slot *slot = (struct slot *)pslot->private_data;
 	
-	down_read(&card->controls_rwsem);
 	if (slot->present & SNDRV_MIXER_OSS_PRESENT_PVOLUME) {
-		snd_mixer_oss_put_volume1_vol(fmixer, pslot, slot->kcontrol[SNDRV_MIXER_OSS_ITEM_PVOLUME], left, right);
+		snd_mixer_oss_put_volume1_vol(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_PVOLUME], left, right);
 		if (slot->present & SNDRV_MIXER_OSS_PRESENT_CVOLUME)
-			snd_mixer_oss_put_volume1_vol(fmixer, pslot, slot->kcontrol[SNDRV_MIXER_OSS_ITEM_CVOLUME], left, right);
+			snd_mixer_oss_put_volume1_vol(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_CVOLUME], left, right);
 	} else if (slot->present & SNDRV_MIXER_OSS_PRESENT_GVOLUME) {
-		snd_mixer_oss_put_volume1_vol(fmixer, pslot, slot->kcontrol[SNDRV_MIXER_OSS_ITEM_GVOLUME], left, right);
+		snd_mixer_oss_put_volume1_vol(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_GVOLUME], left, right);
 	} else if (slot->present & SNDRV_MIXER_OSS_PRESENT_GLOBAL) {
-		snd_mixer_oss_put_volume1_vol(fmixer, pslot, slot->kcontrol[SNDRV_MIXER_OSS_ITEM_GLOBAL], left, right);
+		snd_mixer_oss_put_volume1_vol(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_GLOBAL], left, right);
 	}
 	if (left || right) {
 		if (slot->present & SNDRV_MIXER_OSS_PRESENT_PSWITCH)
-			snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->kcontrol[SNDRV_MIXER_OSS_ITEM_PSWITCH], left, right, 0);
+			snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_PSWITCH], left, right, 0);
 		if (slot->present & SNDRV_MIXER_OSS_PRESENT_GSWITCH)
-			snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->kcontrol[SNDRV_MIXER_OSS_ITEM_GSWITCH], left, right, 0);
+			snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_GSWITCH], left, right, 0);
 		if (slot->present & SNDRV_MIXER_OSS_PRESENT_PROUTE)
-			snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->kcontrol[SNDRV_MIXER_OSS_ITEM_PROUTE], left, right, 1);
+			snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_PROUTE], left, right, 1);
 		if (slot->present & SNDRV_MIXER_OSS_PRESENT_GROUTE)
-			snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->kcontrol[SNDRV_MIXER_OSS_ITEM_GROUTE], left, right, 1);
+			snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_GROUTE], left, right, 1);
 	} else {
 		if (slot->present & SNDRV_MIXER_OSS_PRESENT_PSWITCH) {
-			snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->kcontrol[SNDRV_MIXER_OSS_ITEM_PSWITCH], left, right, 0);
+			snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_PSWITCH], left, right, 0);
 		} else if (slot->present & SNDRV_MIXER_OSS_PRESENT_GSWITCH) {
-			snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->kcontrol[SNDRV_MIXER_OSS_ITEM_GSWITCH], left, right, 0);
+			snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_GSWITCH], left, right, 0);
 		} else if (slot->present & SNDRV_MIXER_OSS_PRESENT_PROUTE) {
-			snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->kcontrol[SNDRV_MIXER_OSS_ITEM_PROUTE], left, right, 1);
+			snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_PROUTE], left, right, 1);
 		} else if (slot->present & SNDRV_MIXER_OSS_PRESENT_GROUTE) {
-			snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->kcontrol[SNDRV_MIXER_OSS_ITEM_GROUTE], left, right, 1);
+			snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_GROUTE], left, right, 1);
 		}
 	}
-	up_read(&card->controls_rwsem);
 	return 0;
 }
 
@@ -677,14 +712,11 @@
 					snd_mixer_oss_slot_t *pslot,
 					int *active)
 {
-	snd_card_t *card = fmixer->card;
 	struct slot *slot = (struct slot *)pslot->private_data;
 	int left, right;
 	
 	left = right = 1;
-	down_read(&card->controls_rwsem);
-	snd_mixer_oss_get_volume1_sw(fmixer, pslot, slot->kcontrol[SNDRV_MIXER_OSS_ITEM_CSWITCH], &left, &right, 0);
-	up_read(&card->controls_rwsem);
+	snd_mixer_oss_get_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_CSWITCH], &left, &right, 0);
 	*active = (left || right) ? 1 : 0;
 	return 0;
 }
@@ -693,14 +725,11 @@
 					   snd_mixer_oss_slot_t *pslot,
 					   int *active)
 {
-	snd_card_t *card = fmixer->card;
 	struct slot *slot = (struct slot *)pslot->private_data;
 	int left, right;
 	
 	left = right = 1;
-	down_read(&card->controls_rwsem);
-	snd_mixer_oss_get_volume1_sw(fmixer, pslot, slot->kcontrol[SNDRV_MIXER_OSS_ITEM_CROUTE], &left, &right, 1);
-	up_read(&card->controls_rwsem);
+	snd_mixer_oss_get_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_CROUTE], &left, &right, 1);
 	*active = (left || right) ? 1 : 0;
 	return 0;
 }
@@ -709,12 +738,9 @@
 					snd_mixer_oss_slot_t *pslot,
 					int active)
 {
-	snd_card_t *card = fmixer->card;
 	struct slot *slot = (struct slot *)pslot->private_data;
 	
-	down_read(&card->controls_rwsem);
-	snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->kcontrol[SNDRV_MIXER_OSS_ITEM_CSWITCH], active, active, 0);
-	up_read(&card->controls_rwsem);
+	snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_CSWITCH], active, active, 0);
 	return 0;
 }
 
@@ -722,12 +748,9 @@
 					   snd_mixer_oss_slot_t *pslot,
 					   int active)
 {
-	snd_card_t *card = fmixer->card;
 	struct slot *slot = (struct slot *)pslot->private_data;
 	
-	down_read(&card->controls_rwsem);
-	snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->kcontrol[SNDRV_MIXER_OSS_ITEM_CROUTE], active, active, 1);
-	up_read(&card->controls_rwsem);
+	snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_CROUTE], active, active, 1);
 	return 0;
 }
 
@@ -838,13 +861,21 @@
 {
 	snd_ctl_elem_info_t info;
 	snd_kcontrol_t *kcontrol;
+	snd_card_t *card = mixer->card;
 	int err;
 
+	down_read(&card->controls_rwsem);
 	kcontrol = snd_mixer_oss_test_id(mixer, name, index);
-	if (kcontrol == NULL)
+	if (kcontrol == NULL) {
+		up_read(&card->controls_rwsem);
 		return 0;
-	snd_runtime_check((err = kcontrol->info(kcontrol, &info)) >= 0, return err);
-	slot->kcontrol[item] = kcontrol;
+	}
+	if ((err = kcontrol->info(kcontrol, &info)) < 0) {
+		up_read(&card->controls_rwsem);
+		return err;
+	}
+	slot->numid[item] = kcontrol->id.numid;
+	up_read(&card->controls_rwsem);
 	if (info.count > slot->channels)
 		slot->channels = info.count;
 	slot->present |= 1 << item;
@@ -872,7 +903,12 @@
 	rslot->number = idx;
 }
 
-static int snd_mixer_oss_build_input(snd_mixer_oss_t *mixer, struct snd_mixer_oss_assign_table *ptr, int ptr_allocated)
+/*
+ * build an OSS mixer element.
+ * ptr_allocated means the entry is dynamically allocated (change via proc file).
+ * when replace_old = 1, the old entry is replaced with the new one.
+ */
+static int snd_mixer_oss_build_input(snd_mixer_oss_t *mixer, struct snd_mixer_oss_assign_table *ptr, int ptr_allocated, int replace_old)
 {
 	struct slot slot;
 	struct slot *pslot;
@@ -880,7 +916,12 @@
 	snd_mixer_oss_slot_t *rslot;
 	char str[64];	
 	
+	/* check if already assigned */
+	if (mixer->slots[ptr->oss_id].get_volume && ! replace_old)
+		return 0;
+
 	memset(&slot, 0, sizeof(slot));
+	memset(slot.numid, 0xff, sizeof(slot.numid)); /* ID_UNKNOWN */
 	if (snd_mixer_oss_build_test(mixer, &slot, ptr->name, ptr->index,
 				     SNDRV_MIXER_OSS_ITEM_GLOBAL))
 		return 0;
@@ -920,6 +961,7 @@
 	if (snd_mixer_oss_build_test(mixer, &slot, str, ptr->index,
 				     SNDRV_MIXER_OSS_ITEM_CVOLUME))
 		return 0;
+	down_read(&mixer->card->controls_rwsem);
 	if (ptr->index == 0 && (kctl = snd_mixer_oss_test_id(mixer, "Capture Source", 0)) != NULL) {
 		snd_ctl_elem_info_t uinfo;
 
@@ -937,8 +979,10 @@
 		} else {
 			for (slot.capture_item = 1; slot.capture_item < uinfo.value.enumerated.items; slot.capture_item++) {
 				uinfo.value.enumerated.item = slot.capture_item;
-				if (kctl->info(kctl, &uinfo))
+				if (kctl->info(kctl, &uinfo)) {
+					up_read(&mixer->card->controls_rwsem);
 					return 0;
+				}
 				if (!strcmp(uinfo.value.enumerated.name, str)) {
 					slot.present |= SNDRV_MIXER_OSS_PRESENT_CAPTURE;
 					break;
@@ -946,6 +990,7 @@
 			}
 		}
 	}
+	up_read(&mixer->card->controls_rwsem);
 	if (slot.present != 0) {
 		pslot = (struct slot *)kmalloc(sizeof(slot), GFP_KERNEL);
 		snd_runtime_check(pslot != NULL, return -ENOMEM);
@@ -1084,7 +1129,7 @@
 			goto __unlock;
 		}
 		tbl->index = idx;
-		if (snd_mixer_oss_build_input(mixer, tbl, 1) <= 0) {
+		if (snd_mixer_oss_build_input(mixer, tbl, 1, 1) <= 0) {
 			kfree(tbl->name);
 			kfree(tbl);
 		}
@@ -1127,9 +1172,11 @@
 {
 	static struct snd_mixer_oss_assign_table table[] = {
 		{ SOUND_MIXER_VOLUME, 	"Master",		0 },
+		{ SOUND_MIXER_VOLUME, 	"Front",		0 }, /* fallback */
 		{ SOUND_MIXER_BASS,	"Tone Control - Bass",	0 },
 		{ SOUND_MIXER_TREBLE,	"Tone Control - Treble", 0 },
 		{ SOUND_MIXER_SYNTH,	"Synth",		0 },
+		{ SOUND_MIXER_SYNTH,	"FM",			0 }, /* fallback */
 		{ SOUND_MIXER_PCM,	"PCM",			0 },
 		{ SOUND_MIXER_SPEAKER,	"PC Speaker", 		0 },
 		{ SOUND_MIXER_LINE,	"Line", 		0 },
@@ -1137,6 +1184,7 @@
 		{ SOUND_MIXER_CD,	"CD", 			0 },
 		{ SOUND_MIXER_IMIX,	"Monitor Mix", 		0 },
 		{ SOUND_MIXER_ALTPCM,	"PCM",			1 },
+		{ SOUND_MIXER_ALTPCM,	"Wave",			0 }, /* fallback */
 		{ SOUND_MIXER_RECLEV,	"-- nothing --",	0 },
 		{ SOUND_MIXER_IGAIN,	"Capture",		0 },
 		{ SOUND_MIXER_OGAIN,	"Playback",		0 },
@@ -1152,15 +1200,10 @@
 		{ SOUND_MIXER_RADIO,	"Radio",		0 },
 		{ SOUND_MIXER_MONITOR,	"Monitor",		0 }
 	};
-	static struct snd_mixer_oss_assign_table fm_table = {
-		SOUND_MIXER_SYNTH,	"FM",			0
-	};
 	unsigned int idx;
 	
 	for (idx = 0; idx < sizeof(table) / sizeof(struct snd_mixer_oss_assign_table); idx++)
-		snd_mixer_oss_build_input(mixer, &table[idx], 0);
-	if (mixer->slots[SOUND_MIXER_SYNTH].get_volume == NULL)
-		snd_mixer_oss_build_input(mixer, &fm_table, 0);
+		snd_mixer_oss_build_input(mixer, &table[idx], 0, 0);
 	if (mixer->mask_recsrc) {
 		mixer->get_recsrc = snd_mixer_oss_get_recsrc2;
 		mixer->put_recsrc = snd_mixer_oss_put_recsrc2;
--- diff/sound/core/oss/pcm_oss.c	2003-10-27 09:20:39.000000000 +0000
+++ source/sound/core/oss/pcm_oss.c	2004-02-09 10:39:58.000000000 +0000
@@ -40,6 +40,8 @@
 #include <linux/soundcard.h>
 #include <sound/initval.h>
 
+#define OSS_ALSAEMULVER		_SIOR ('M', 249, int)
+
 static int dsp_map[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = 0};
 static int adsp_map[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = 1};
 static int nonblock_open;
@@ -56,6 +58,8 @@
 MODULE_PARM(nonblock_open, "i");
 MODULE_PARM_DESC(nonblock_open, "Don't block opening busy PCM devices.");
 MODULE_PARM_SYNTAX(nonblock_open, "default:0,skill:advanced");
+MODULE_ALIAS_SNDRV_MINOR(SNDRV_MINOR_OSS_PCM);
+MODULE_ALIAS_SNDRV_MINOR(SNDRV_MINOR_OSS_PCM1);
 
 extern int snd_mixer_oss_ioctl_card(snd_card_t *card, unsigned int cmd, unsigned long arg);
 static int snd_pcm_oss_get_rate(snd_pcm_oss_file_t *pcm_oss_file);
@@ -122,11 +126,11 @@
 static long snd_pcm_oss_bytes(snd_pcm_substream_t *substream, long frames)
 {
 	snd_pcm_runtime_t *runtime = substream->runtime;
-	if (runtime->period_size == runtime->oss.period_bytes)
+	snd_pcm_uframes_t buffer_size = snd_pcm_lib_buffer_bytes(substream);
+	frames = frames_to_bytes(runtime, frames);
+	if (buffer_size == runtime->oss.buffer_bytes)
 		return frames;
-	if (runtime->period_size < runtime->oss.period_bytes)
-		return frames * (runtime->oss.period_bytes / runtime->period_size);
-	return frames / (runtime->period_size / runtime->oss.period_bytes);
+	return (runtime->oss.buffer_bytes * frames) / buffer_size;
 }
 
 static int snd_pcm_oss_format_from(int format)
@@ -451,7 +455,7 @@
 	sw_params->tstamp_mode = SNDRV_PCM_TSTAMP_NONE;
 	sw_params->period_step = 1;
 	sw_params->sleep_min = 0;
-	sw_params->avail_min = runtime->period_size;
+	sw_params->avail_min = 1;
 	sw_params->xfer_align = 1;
 	if (atomic_read(&runtime->mmap_count) ||
 	    (substream->oss.setup && substream->oss.setup->nosilence)) {
@@ -470,7 +474,6 @@
 		snd_printd("SW_PARAMS failed: %i\n", err);
 		goto failure;
 	}
-	runtime->control->avail_min = runtime->period_size;
 
 	runtime->oss.periods = params_periods(sparams);
 	oss_period_size = snd_pcm_plug_client_size(substream, params_period_size(sparams));
@@ -555,6 +558,7 @@
 	runtime->oss.prepare = 0;
 	runtime->oss.prev_hw_ptr_interrupt = 0;
 	runtime->oss.period_ptr = 0;
+	runtime->oss.buffer_used = 0;
 
 	return 0;
 }
@@ -812,7 +816,7 @@
 			buf += tmp;
 			bytes -= tmp;
 			xfer += tmp;
-			if (substream->oss.setup == NULL || !substream->oss.setup->wholefrag ||
+			if ((substream->oss.setup != NULL && substream->oss.setup->partialfrag) ||
 			    runtime->oss.buffer_used == runtime->oss.period_bytes) {
 				tmp = snd_pcm_oss_write2(substream, runtime->oss.buffer, runtime->oss.buffer_used, 1);
 				if (tmp <= 0)
@@ -883,12 +887,13 @@
 				if (tmp <= 0)
 					return xfer > 0 ? (snd_pcm_sframes_t)xfer : tmp;
 				runtime->oss.bytes += tmp;
-				runtime->oss.buffer_used = runtime->oss.period_bytes;
+				runtime->oss.period_ptr = tmp;
+				runtime->oss.buffer_used = tmp;
 			}
 			tmp = bytes;
 			if ((size_t) tmp > runtime->oss.buffer_used)
 				tmp = runtime->oss.buffer_used;
-			if (copy_to_user(buf, runtime->oss.buffer + (runtime->oss.period_bytes - runtime->oss.buffer_used), tmp))
+			if (copy_to_user(buf, runtime->oss.buffer + (runtime->oss.period_ptr - runtime->oss.buffer_used), tmp))
 				return xfer > 0 ? (snd_pcm_sframes_t)xfer : -EFAULT;
 			buf += tmp;
 			bytes -= tmp;
@@ -950,6 +955,9 @@
 	runtime = substream->runtime;
 	init_waitqueue_entry(&wait, current);
 	add_wait_queue(&runtime->sleep, &wait);
+#ifdef OSS_DEBUG
+	printk("sync1: size = %li\n", size);
+#endif
 	while (1) {
 		result = snd_pcm_oss_write2(substream, runtime->oss.buffer, size, 1);
 		if (result > 0) {
@@ -991,16 +999,21 @@
 	snd_pcm_runtime_t *runtime;
 	snd_pcm_format_t format;
 	unsigned long width;
-	size_t size, size1;
+	size_t size;
 
 	substream = pcm_oss_file->streams[SNDRV_PCM_STREAM_PLAYBACK];
 	if (substream != NULL) {
+		runtime = substream->runtime;
+		if (atomic_read(&runtime->mmap_count))
+			goto __direct;
 		if ((err = snd_pcm_oss_make_ready(substream)) < 0)
 			return err;
-		runtime = substream->runtime;
 		format = snd_pcm_oss_format_from(runtime->oss.format);
 		width = snd_pcm_format_physical_width(format);
 		if (runtime->oss.buffer_used > 0) {
+#ifdef OSS_DEBUG
+			printk("sync: buffer_used\n");
+#endif
 			size = (8 * (runtime->oss.period_bytes - runtime->oss.buffer_used) + 7) / width;
 			snd_pcm_format_set_silence(format,
 						   runtime->oss.buffer + runtime->oss.buffer_used,
@@ -1009,6 +1022,9 @@
 			if (err < 0)
 				return err;
 		} else if (runtime->oss.period_ptr > 0) {
+#ifdef OSS_DEBUG
+			printk("sync: period_ptr\n");
+#endif
 			size = runtime->oss.period_bytes - runtime->oss.period_ptr;
 			snd_pcm_format_set_silence(format,
 						   runtime->oss.buffer,
@@ -1017,17 +1033,35 @@
 			if (err < 0)
 				return err;
 		}
-		size = runtime->oss.period_bytes;
-		size1 = frames_to_bytes(runtime, runtime->period_size);
-		while (size < size1) {
-			snd_pcm_format_set_silence(format,
-						   runtime->oss.buffer,
-						   (8 * runtime->oss.period_bytes + 7) / width);
-			err = snd_pcm_oss_sync1(substream, runtime->oss.period_bytes);
-			if (err < 0)
-				return err;
-			size += runtime->oss.period_bytes;
+		/*
+		 * The ALSA's period might be a bit large than OSS one.
+		 * Fill the remain portion of ALSA period with zeros.
+		 */
+		size = runtime->control->appl_ptr % runtime->period_size;
+		if (size > 0) {
+			size = runtime->period_size - size;
+			if (runtime->access == SNDRV_PCM_ACCESS_RW_INTERLEAVED) {
+				size = (runtime->frame_bits * size) / 8;
+				while (size > 0) {
+					size_t size1 = size < runtime->oss.period_bytes ? size : runtime->oss.period_bytes;
+					size -= size1;
+					size1 *= 8;
+					size1 /= runtime->sample_bits;
+					snd_pcm_format_set_silence(runtime->format,
+								   runtime->oss.buffer,
+								   size1);
+					snd_pcm_lib_write(substream, runtime->oss.buffer, size1);
+				}
+			} else if (runtime->access == SNDRV_PCM_ACCESS_RW_NONINTERLEAVED) {
+				void *buffers[runtime->channels];
+				memset(buffers, 0, runtime->channels * sizeof(void *));
+				snd_pcm_lib_writev(substream, (void **)buffers, size);
+			}
 		}
+		/*
+		 * finish sync: drain the buffer
+		 */
+	      __direct:
 		saved_f_flags = substream->ffile->f_flags;
 		substream->ffile->f_flags &= ~O_NONBLOCK;
 		err = snd_pcm_kernel_playback_ioctl(substream, SNDRV_PCM_IOCTL_DRAIN, 0);
@@ -1306,11 +1340,11 @@
 	return result;
 }
 
-static void snd_pcm_oss_simulate_fill(snd_pcm_substream_t *substream)
+static void snd_pcm_oss_simulate_fill(snd_pcm_substream_t *substream, snd_pcm_uframes_t hw_ptr)
 {
 	snd_pcm_runtime_t *runtime = substream->runtime;
 	snd_pcm_uframes_t appl_ptr;
-	appl_ptr = runtime->hw_ptr_interrupt + runtime->buffer_size;
+	appl_ptr = hw_ptr + runtime->buffer_size;
 	appl_ptr %= runtime->boundary;
 	runtime->control->appl_ptr = appl_ptr;
 }
@@ -1331,8 +1365,6 @@
 	if (psubstream) {
 		if ((err = snd_pcm_oss_make_ready(psubstream)) < 0)
 			return err;
-		if (atomic_read(&psubstream->runtime->mmap_count))
-			snd_pcm_oss_simulate_fill(psubstream);
 	}
 	if (csubstream) {
 		if ((err = snd_pcm_oss_make_ready(csubstream)) < 0)
@@ -1343,6 +1375,8 @@
 		if (trigger & PCM_ENABLE_OUTPUT) {
 			if (runtime->oss.trigger)
 				goto _skip1;
+			if (atomic_read(&psubstream->runtime->mmap_count))
+				snd_pcm_oss_simulate_fill(psubstream, runtime->hw_ptr_interrupt);
 			runtime->oss.trigger = 1;
 			runtime->start_threshold = 1;
 			cmd = SNDRV_PCM_IOCTL_START;
@@ -1425,6 +1459,7 @@
 	snd_pcm_substream_t *substream;
 	snd_pcm_runtime_t *runtime;
 	snd_pcm_sframes_t delay;
+	int fixup;
 	struct count_info info;
 	int err;
 
@@ -1444,32 +1479,37 @@
 	}
 	if (stream == SNDRV_PCM_STREAM_PLAYBACK) {
 		err = snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_DELAY, &delay);
-		if (err == -EPIPE || err == -ESTRPIPE) {
+		if (err == -EPIPE || err == -ESTRPIPE || (! err && delay < 0)) {
 			err = 0;
 			delay = 0;
+			fixup = 0;
+		} else {
+			fixup = runtime->oss.buffer_used;
 		}
 	} else {
 		err = snd_pcm_oss_capture_position_fixup(substream, &delay);
+		fixup = -runtime->oss.buffer_used;
 	}
 	if (err < 0)
 		return err;
-	if (stream == SNDRV_PCM_STREAM_PLAYBACK) {
-		info.bytes = runtime->oss.bytes - snd_pcm_oss_bytes(substream, delay);
-	} else {
-		info.bytes = runtime->oss.bytes + snd_pcm_oss_bytes(substream, delay);
-	}
 	info.ptr = snd_pcm_oss_bytes(substream, runtime->status->hw_ptr % runtime->buffer_size);
 	if (atomic_read(&runtime->mmap_count)) {
 		snd_pcm_sframes_t n;
-		n = runtime->hw_ptr_interrupt - runtime->oss.prev_hw_ptr_interrupt;
+		n = (delay = runtime->hw_ptr_interrupt) - runtime->oss.prev_hw_ptr_interrupt;
 		if (n < 0)
 			n += runtime->boundary;
 		info.blocks = n / runtime->period_size;
-		runtime->oss.prev_hw_ptr_interrupt = runtime->hw_ptr_interrupt;
+		runtime->oss.prev_hw_ptr_interrupt = delay;
 		if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
-			snd_pcm_oss_simulate_fill(substream);
+			snd_pcm_oss_simulate_fill(substream, delay);
+		info.bytes = snd_pcm_oss_bytes(substream, runtime->status->hw_ptr);
 	} else {
-		info.blocks = delay / runtime->period_size;
+		delay = snd_pcm_oss_bytes(substream, delay) + fixup;
+		info.blocks = delay / runtime->oss.period_bytes;
+		if (stream == SNDRV_PCM_STREAM_PLAYBACK)
+			info.bytes = runtime->oss.bytes - delay;
+		else
+			info.bytes = runtime->oss.bytes + delay;
 	}
 	if (copy_to_user(_info, &info, sizeof(info)))
 		return -EFAULT;
@@ -1481,6 +1521,7 @@
 	snd_pcm_substream_t *substream;
 	snd_pcm_runtime_t *runtime;
 	snd_pcm_sframes_t avail;
+	int fixup;
 	struct audio_buf_info info;
 	int err;
 
@@ -1499,8 +1540,8 @@
 	info.fragstotal = runtime->periods;
 	if (runtime->oss.prepare) {
 		if (stream == SNDRV_PCM_STREAM_PLAYBACK) {
-			info.bytes = runtime->oss.period_bytes * runtime->periods;
-			info.fragments = runtime->periods;
+			info.bytes = runtime->oss.period_bytes * runtime->oss.periods;
+			info.fragments = runtime->oss.periods;
 		} else {
 			info.bytes = 0;
 			info.fragments = 0;
@@ -1508,19 +1549,22 @@
 	} else {
 		if (stream == SNDRV_PCM_STREAM_PLAYBACK) {
 			err = snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_DELAY, &avail);
-			if (err == -EPIPE || err == -ESTRPIPE) {
+			if (err == -EPIPE || err == -ESTRPIPE || (! err && avail < 0)) {
 				avail = runtime->buffer_size;
 				err = 0;
+				fixup = 0;
 			} else {
 				avail = runtime->buffer_size - avail;
+				fixup = -runtime->oss.buffer_used;
 			}
 		} else {
 			err = snd_pcm_oss_capture_position_fixup(substream, &avail);
+			fixup = runtime->oss.buffer_used;
 		}
 		if (err < 0)
 			return err;
-		info.bytes = snd_pcm_oss_bytes(substream, avail);
-		info.fragments = avail / runtime->period_size;
+		info.bytes = snd_pcm_oss_bytes(substream, avail) + fixup;
+		info.fragments = info.bytes / runtime->oss.period_bytes;
 	}
 
 #ifdef OSS_DEBUG
@@ -1858,7 +1902,9 @@
 
 	pcm_oss_file = snd_magic_cast(snd_pcm_oss_file_t, file->private_data, return -ENXIO);
 	if (cmd == OSS_GETVERSION)
-		return put_user(SNDRV_OSS_VERSION, (int *)arg) ? -EFAULT : 0;
+		return put_user(SNDRV_OSS_VERSION, (int *)arg);
+	if (cmd == OSS_ALSAEMULVER)
+		return put_user(1, (int *)arg);
 #if defined(CONFIG_SND_MIXER_OSS) || (defined(MODULE) && defined(CONFIG_SND_MIXER_OSS_MODULE))
 	if (((cmd >> 8) & 0xff) == 'M')	{	/* mixer ioctl - for OSS compatibility */
 		snd_pcm_substream_t *substream;
@@ -1887,48 +1933,48 @@
 			return -EFAULT;
 		if ((res = snd_pcm_oss_set_rate(pcm_oss_file, res))<0)
 			return res;
-		return put_user(res, (int *)arg) ? -EFAULT : 0;
+		return put_user(res, (int *)arg);
 	case SOUND_PCM_READ_RATE:
 		res = snd_pcm_oss_get_rate(pcm_oss_file);
 		if (res < 0)
 			return res;
-		return put_user(res, (int *)arg) ? -EFAULT : 0;
+		return put_user(res, (int *)arg);
 	case SNDCTL_DSP_STEREO:
 		if (get_user(res, (int *)arg))
 			return -EFAULT;
 		res = res > 0 ? 2 : 1;
 		if ((res = snd_pcm_oss_set_channels(pcm_oss_file, res)) < 0)
 			return res;
-		return put_user(--res, (int *)arg) ? -EFAULT : 0;
+		return put_user(--res, (int *)arg);
 	case SNDCTL_DSP_GETBLKSIZE:
 		res = snd_pcm_oss_get_block_size(pcm_oss_file);
 		if (res < 0)
 			return res;
-		return put_user(res, (int *)arg) ? -EFAULT : 0;
+		return put_user(res, (int *)arg);
 	case SNDCTL_DSP_SETFMT:
 		if (get_user(res, (int *)arg))
 			return -EFAULT;
 		res = snd_pcm_oss_set_format(pcm_oss_file, res);
 		if (res < 0)
 			return res;
-		return put_user(res, (int *)arg) ? -EFAULT : 0;
+		return put_user(res, (int *)arg);
 	case SOUND_PCM_READ_BITS:
 		res = snd_pcm_oss_get_format(pcm_oss_file);
 		if (res < 0)
 			return res;
-		return put_user(res, (int *)arg) ? -EFAULT : 0;
+		return put_user(res, (int *)arg);
 	case SNDCTL_DSP_CHANNELS:
 		if (get_user(res, (int *)arg))
 			return -EFAULT;
 		res = snd_pcm_oss_set_channels(pcm_oss_file, res);
 		if (res < 0)
 			return res;
-		return put_user(res, (int *)arg) ? -EFAULT : 0;
+		return put_user(res, (int *)arg);
 	case SOUND_PCM_READ_CHANNELS:
 		res = snd_pcm_oss_get_channels(pcm_oss_file);
 		if (res < 0)
 			return res;
-		return put_user(res, (int *)arg) ? -EFAULT : 0;
+		return put_user(res, (int *)arg);
 	case SOUND_PCM_WRITE_FILTER:
 	case SOUND_PCM_READ_FILTER:
 		return -EIO;
@@ -1940,7 +1986,7 @@
 		res = snd_pcm_oss_set_subdivide(pcm_oss_file, res);
 		if (res < 0)
 			return res;
-		return put_user(res, (int *)arg) ? -EFAULT : 0;
+		return put_user(res, (int *)arg);
 	case SNDCTL_DSP_SETFRAGMENT:
 		if (get_user(res, (int *)arg))
 			return -EFAULT;
@@ -1949,7 +1995,7 @@
 		res = snd_pcm_oss_get_formats(pcm_oss_file);
 		if (res < 0)
 			return res;
-		return put_user(res, (int *)arg) ? -EFAULT : 0;
+		return put_user(res, (int *)arg);
 	case SNDCTL_DSP_GETOSPACE:
 	case SNDCTL_DSP_GETISPACE:
 		return snd_pcm_oss_get_space(pcm_oss_file,
@@ -1962,12 +2008,12 @@
 		res = snd_pcm_oss_get_caps(pcm_oss_file);
 		if (res < 0)
 			return res;
-		return put_user(res, (int *)arg) ? -EFAULT : 0;
+		return put_user(res, (int *)arg);
 	case SNDCTL_DSP_GETTRIGGER:
 		res = snd_pcm_oss_get_trigger(pcm_oss_file);
 		if (res < 0)
 			return res;
-		return put_user(res, (int *)arg) ? -EFAULT : 0;
+		return put_user(res, (int *)arg);
 	case SNDCTL_DSP_SETTRIGGER:
 		if (get_user(res, (int *)arg))
 			return -EFAULT;
@@ -1998,7 +2044,7 @@
 			put_user(0, (int *)arg);
 			return res;
 		}
-		return put_user(res, (int *)arg) ? -EFAULT : 0;
+		return put_user(res, (int *)arg);
 	case SNDCTL_DSP_PROFILE:
 		return 0;	/* silently ignore */
 	default:
@@ -2160,6 +2206,8 @@
 	if (err < 0)
 		return err;
 	runtime->oss.mmap_bytes = area->vm_end - area->vm_start;
+	runtime->silence_threshold = 0;
+	runtime->silence_size = 0;
 #ifdef OSS_DEBUG
 	printk("pcm_oss: mmap ok, bytes = 0x%x\n", runtime->oss.mmap_bytes);
 #endif
@@ -2188,7 +2236,7 @@
 			    setup->direct ? " direct" : "",
 			    setup->block ? " block" : "",
 			    setup->nonblock ? " non-block" : "",
-			    setup->wholefrag ? " whole-frag" : "",
+			    setup->partialfrag ? " partial-frag" : "",
 			    setup->nosilence ? " no-silence" : "");
 		setup = setup->next;
 	}
@@ -2255,8 +2303,8 @@
 				template.block = 1;
 			} else if (!strcmp(str, "non-block")) {
 				template.nonblock = 1;
-			} else if (!strcmp(str, "whole-frag")) {
-				template.wholefrag = 1;
+			} else if (!strcmp(str, "partial-frag")) {
+				template.partialfrag = 1;
 			} else if (!strcmp(str, "no-silence")) {
 				template.nosilence = 1;
 			}
--- diff/sound/core/oss/pcm_plugin.c	2003-09-30 15:46:21.000000000 +0100
+++ source/sound/core/oss/pcm_plugin.c	2004-02-09 10:39:58.000000000 +0000
@@ -857,11 +857,14 @@
 	silence = snd_pcm_format_silence_64(format);
 	if (dst_area->step == (unsigned int) width) {
 		size_t dwords = samples * width / 64;
+		u_int64_t *dst64 = (u_int64_t *)dst;
+
 		samples -= dwords * 64 / width;
 		while (dwords-- > 0)
-			*((u_int64_t*)dst)++ = silence;
+			*dst64++ = silence;
 		if (samples == 0)
 			return 0;
+		dst = (char *)dst64;
 	}
 	dst_step = dst_area->step / 8;
 	switch (width) {
--- diff/sound/core/pcm.c	2003-06-30 10:07:24.000000000 +0100
+++ source/sound/core/pcm.c	2004-02-09 10:39:58.000000000 +0000
@@ -43,15 +43,6 @@
 static int snd_pcm_dev_disconnect(snd_device_t *device);
 static int snd_pcm_dev_unregister(snd_device_t *device);
 
-void snd_pcm_lock(int xup)
-{
-	if (!xup) {
-		down(&register_mutex);
-	} else {
-		up(&register_mutex);
-	}
-}
-
 static int snd_pcm_control_ioctl(snd_card_t * card,
 				 snd_ctl_file_t * control,
 				 unsigned int cmd, unsigned long arg)
@@ -380,6 +371,7 @@
 		snd_iprintf(buffer, "closed\n");
 		return;
 	}
+	memset(&status, 0, sizeof(status));
 	err = snd_pcm_status(substream, &status);
 	if (err < 0) {
 		snd_iprintf(buffer, "error %d\n", err);
@@ -398,6 +390,22 @@
 	snd_iprintf(buffer, "appl_ptr    : %ld\n", runtime->control->appl_ptr);
 }
 
+#ifdef CONFIG_SND_DEBUG
+static void snd_pcm_xrun_debug_read(snd_info_entry_t *entry, snd_info_buffer_t *buffer)
+{
+	snd_pcm_str_t *pstr = (snd_pcm_str_t *)entry->private_data;
+	snd_iprintf(buffer, "%d\n", pstr->xrun_debug);
+}
+
+static void snd_pcm_xrun_debug_write(snd_info_entry_t *entry, snd_info_buffer_t *buffer)
+{
+	snd_pcm_str_t *pstr = (snd_pcm_str_t *)entry->private_data;
+	char line[64];
+	if (!snd_info_get_line(buffer, line, sizeof(line)))
+		pstr->xrun_debug = !!simple_strtoul(line, NULL, 10);
+}
+#endif
+
 static int snd_pcm_stream_proc_init(snd_pcm_str_t *pstr)
 {
 	snd_pcm_t *pcm = pstr->pcm;
@@ -416,11 +424,7 @@
 	pstr->proc_root = entry;
 
 	if ((entry = snd_info_create_card_entry(pcm->card, "info", pstr->proc_root)) != NULL) {
-		entry->content = SNDRV_INFO_CONTENT_TEXT;
-		entry->mode = S_IFREG | S_IRUGO;
-		entry->c.text.read_size = 256;
-		entry->c.text.read = snd_pcm_stream_proc_info_read;
-		entry->private_data = pstr;
+		snd_info_set_text_ops(entry, pstr, 256, snd_pcm_stream_proc_info_read);
 		if (snd_info_register(entry) < 0) {
 			snd_info_free_entry(entry);
 			entry = NULL;
@@ -428,11 +432,31 @@
 	}
 	pstr->proc_info_entry = entry;
 
+#ifdef CONFIG_SND_DEBUG
+	if ((entry = snd_info_create_card_entry(pcm->card, "xrun_debug", pstr->proc_root)) != NULL) {
+		entry->c.text.read_size = 64;
+		entry->c.text.read = snd_pcm_xrun_debug_read;
+		entry->c.text.write_size = 64;
+		entry->c.text.write = snd_pcm_xrun_debug_write;
+		entry->private_data = pstr;
+		if (snd_info_register(entry) < 0) {
+			snd_info_free_entry(entry);
+			entry = NULL;
+		}
+	}
+	pstr->proc_xrun_debug_entry = entry;
+#endif
 	return 0;
 }
 
 static int snd_pcm_stream_proc_done(snd_pcm_str_t *pstr)
 {
+#ifdef CONFIG_SND_DEBUG
+	if (pstr->proc_xrun_debug_entry) {
+		snd_info_unregister(pstr->proc_xrun_debug_entry);
+		pstr->proc_xrun_debug_entry = NULL;
+	}
+#endif
 	if (pstr->proc_info_entry) {
 		snd_info_unregister(pstr->proc_info_entry);
 		pstr->proc_info_entry = NULL;
@@ -463,11 +487,7 @@
 	substream->proc_root = entry;
 
 	if ((entry = snd_info_create_card_entry(card, "info", substream->proc_root)) != NULL) {
-		entry->content = SNDRV_INFO_CONTENT_TEXT;
-		entry->mode = S_IFREG | S_IRUGO;
-		entry->c.text.read_size = 256;
-		entry->c.text.read = snd_pcm_substream_proc_info_read;
-		entry->private_data = substream;
+		snd_info_set_text_ops(entry, substream, 256, snd_pcm_substream_proc_info_read);
 		if (snd_info_register(entry) < 0) {
 			snd_info_free_entry(entry);
 			entry = NULL;
@@ -476,11 +496,7 @@
 	substream->proc_info_entry = entry;
 
 	if ((entry = snd_info_create_card_entry(card, "hw_params", substream->proc_root)) != NULL) {
-		entry->content = SNDRV_INFO_CONTENT_TEXT;
-		entry->mode = S_IFREG | S_IRUGO;
-		entry->c.text.read_size = 256;
-		entry->c.text.read = snd_pcm_substream_proc_hw_params_read;
-		entry->private_data = substream;
+		snd_info_set_text_ops(entry, substream, 256, snd_pcm_substream_proc_hw_params_read);
 		if (snd_info_register(entry) < 0) {
 			snd_info_free_entry(entry);
 			entry = NULL;
@@ -489,11 +505,7 @@
 	substream->proc_hw_params_entry = entry;
 
 	if ((entry = snd_info_create_card_entry(card, "sw_params", substream->proc_root)) != NULL) {
-		entry->content = SNDRV_INFO_CONTENT_TEXT;
-		entry->mode = S_IFREG | S_IRUGO;
-		entry->c.text.read_size = 256;
-		entry->c.text.read = snd_pcm_substream_proc_sw_params_read;
-		entry->private_data = substream;
+		snd_info_set_text_ops(entry, substream, 256, snd_pcm_substream_proc_sw_params_read);
 		if (snd_info_register(entry) < 0) {
 			snd_info_free_entry(entry);
 			entry = NULL;
@@ -502,11 +514,7 @@
 	substream->proc_sw_params_entry = entry;
 
 	if ((entry = snd_info_create_card_entry(card, "status", substream->proc_root)) != NULL) {
-		entry->content = SNDRV_INFO_CONTENT_TEXT;
-		entry->mode = S_IFREG | S_IRUGO;
-		entry->c.text.read_size = 256;
-		entry->c.text.read = snd_pcm_substream_proc_status_read;
-		entry->private_data = substream;
+		snd_info_set_text_ops(entry, substream, 256, snd_pcm_substream_proc_status_read);
 		if (snd_info_register(entry) < 0) {
 			snd_info_free_entry(entry);
 			entry = NULL;
@@ -521,23 +529,23 @@
 {
 	if (substream->proc_info_entry) {
 		snd_info_unregister(substream->proc_info_entry);
-		substream->proc_info_entry = 0;
+		substream->proc_info_entry = NULL;
 	}
 	if (substream->proc_hw_params_entry) {
 		snd_info_unregister(substream->proc_hw_params_entry);
-		substream->proc_hw_params_entry = 0;
+		substream->proc_hw_params_entry = NULL;
 	}
 	if (substream->proc_sw_params_entry) {
 		snd_info_unregister(substream->proc_sw_params_entry);
-		substream->proc_sw_params_entry = 0;
+		substream->proc_sw_params_entry = NULL;
 	}
 	if (substream->proc_status_entry) {
 		snd_info_unregister(substream->proc_status_entry);
-		substream->proc_status_entry = 0;
+		substream->proc_status_entry = NULL;
 	}
 	if (substream->proc_root) {
 		snd_info_unregister(substream->proc_root);
-		substream->proc_root = 0;
+		substream->proc_root = NULL;
 	}
 	return 0;
 }
@@ -819,7 +827,8 @@
 		runtime->private_free(runtime);
 	snd_free_pages((void*)runtime->status, PAGE_ALIGN(sizeof(snd_pcm_mmap_status_t)));
 	snd_free_pages((void*)runtime->control, PAGE_ALIGN(sizeof(snd_pcm_mmap_control_t)));
-	kfree(runtime->hw_constraints.rules);
+	if (runtime->hw_constraints.rules)
+		kfree(runtime->hw_constraints.rules);
 	kfree(runtime);
 	substream->runtime = NULL;
 	substream->pstr->substream_opened--;
@@ -835,10 +844,10 @@
 	snd_pcm_t *pcm = snd_magic_cast(snd_pcm_t, device->device_data, return -ENXIO);
 
 	snd_assert(pcm != NULL && device != NULL, return -ENXIO);
-	snd_pcm_lock(0);
+	down(&register_mutex);
 	idx = (pcm->card->number * SNDRV_PCM_DEVICES) + pcm->device;
 	if (snd_pcm_devices[idx]) {
-		snd_pcm_lock(1);
+		up(&register_mutex);
 		return -EBUSY;
 	}
 	snd_pcm_devices[idx] = pcm;
@@ -860,7 +869,7 @@
 		}
 		if ((err = snd_register_device(devtype, pcm->card, pcm->device, pcm->streams[cidx].reg, str)) < 0) {
 			snd_pcm_devices[idx] = NULL;
-			snd_pcm_lock(1);
+			up(&register_mutex);
 			return err;
 		}
 		for (substream = pcm->streams[cidx].substream; substream; substream = substream->next)
@@ -871,7 +880,7 @@
 		notify = list_entry(list, snd_pcm_notify_t, list);
 		notify->n_register(pcm);
 	}
-	snd_pcm_lock(1);
+	up(&register_mutex);
 	return 0;
 }
 
@@ -879,17 +888,22 @@
 {
 	snd_pcm_t *pcm = snd_magic_cast(snd_pcm_t, device->device_data, return -ENXIO);
 	struct list_head *list;
-	int idx;
+	snd_pcm_substream_t *substream;
+	int idx, cidx;
 
-	snd_pcm_lock(0);
+	down(&register_mutex);
 	idx = (pcm->card->number * SNDRV_PCM_DEVICES) + pcm->device;
 	snd_pcm_devices[idx] = NULL;
+	for (cidx = 0; cidx < 2; cidx++)
+		for (substream = pcm->streams[cidx].substream; substream; substream = substream->next)
+			if (substream->runtime)
+				substream->runtime->status->state = SNDRV_PCM_STATE_DISCONNECTED;
 	list_for_each(list, &snd_pcm_notify_list) {
 		snd_pcm_notify_t *notify;
 		notify = list_entry(list, snd_pcm_notify_t, list);
 		notify->n_disconnect(pcm);
 	}
-	snd_pcm_lock(1);
+	up(&register_mutex);
 	return 0;
 }
 
@@ -901,7 +915,7 @@
 	snd_pcm_t *pcm = snd_magic_cast(snd_pcm_t, device->device_data, return -ENXIO);
 
 	snd_assert(pcm != NULL, return -ENXIO);
-	snd_pcm_lock(0);
+	down(&register_mutex);
 	idx = (pcm->card->number * SNDRV_PCM_DEVICES) + pcm->device;
 	snd_pcm_devices[idx] = NULL;
 	for (cidx = 0; cidx < 2; cidx++) {
@@ -923,7 +937,7 @@
 		notify = list_entry(list, snd_pcm_notify_t, list);
 		notify->n_unregister(pcm);
 	}
-	snd_pcm_lock(1);
+	up(&register_mutex);
 	return snd_pcm_free(pcm);
 }
 
@@ -932,7 +946,7 @@
 	int idx;
 
 	snd_assert(notify != NULL && notify->n_register != NULL && notify->n_unregister != NULL, return -EINVAL);
-	snd_pcm_lock(0);
+	down(&register_mutex);
 	if (nfree) {
 		list_del(&notify->list);
 		for (idx = 0; idx < SNDRV_CARDS * SNDRV_PCM_DEVICES; idx++) {
@@ -948,7 +962,7 @@
 			notify->n_register(snd_pcm_devices[idx]);
 		}
 	}
-	snd_pcm_lock(1);
+	up(&register_mutex);
 	return 0;
 }
 
@@ -989,9 +1003,7 @@
 
 	snd_ctl_register_ioctl(snd_pcm_control_ioctl);
 	if ((entry = snd_info_create_module_entry(THIS_MODULE, "pcm", NULL)) != NULL) {
-		entry->content = SNDRV_INFO_CONTENT_TEXT;
-		entry->c.text.read_size = SNDRV_CARDS * SNDRV_PCM_DEVICES * 128;
-		entry->c.text.read = snd_pcm_proc_read;
+		snd_info_set_text_ops(entry, NULL, SNDRV_CARDS * SNDRV_PCM_DEVICES * 128, snd_pcm_proc_read);
 		if (snd_info_register(entry) < 0) {
 			snd_info_free_entry(entry);
 			entry = NULL;
@@ -1013,7 +1025,6 @@
 module_init(alsa_pcm_init)
 module_exit(alsa_pcm_exit)
 
-EXPORT_SYMBOL(snd_pcm_lock);
 EXPORT_SYMBOL(snd_pcm_devices);
 EXPORT_SYMBOL(snd_pcm_new);
 EXPORT_SYMBOL(snd_pcm_new_stream);
--- diff/sound/core/pcm_lib.c	2003-10-27 09:20:39.000000000 +0000
+++ source/sound/core/pcm_lib.c	2004-02-09 10:39:58.000000000 +0000
@@ -125,15 +125,11 @@
 	}
 }
 
-static inline int snd_pcm_update_hw_ptr_interrupt(snd_pcm_substream_t *substream)
+static inline snd_pcm_uframes_t snd_pcm_update_hw_ptr_pos(snd_pcm_substream_t *substream,
+							  snd_pcm_runtime_t *runtime)
 {
-	snd_pcm_runtime_t *runtime = substream->runtime;
 	snd_pcm_uframes_t pos;
-	snd_pcm_uframes_t old_hw_ptr, new_hw_ptr, hw_ptr_interrupt;
-	snd_pcm_uframes_t avail;
-	snd_pcm_sframes_t delta;
 
-	old_hw_ptr = runtime->status->hw_ptr;
 	pos = substream->ops->pointer(substream);
 	if (runtime->tstamp_mode & SNDRV_PCM_TSTAMP_MMAP)
 		snd_timestamp_now((snd_timestamp_t*)&runtime->status->tstamp, runtime->tstamp_timespec);
@@ -143,18 +139,64 @@
 	} else
 #endif
 	snd_runtime_check(pos < runtime->buffer_size, return 0);
-
 	pos -= pos % runtime->min_align;
-	new_hw_ptr = runtime->hw_ptr_base + pos;
+	return pos;
+}
+
+static inline int snd_pcm_update_hw_ptr_post(snd_pcm_substream_t *substream,
+					     snd_pcm_runtime_t *runtime)
+{
+	snd_pcm_uframes_t avail;
+
+	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+		avail = snd_pcm_playback_avail(runtime);
+	else
+		avail = snd_pcm_capture_avail(runtime);
+	if (avail > runtime->avail_max)
+		runtime->avail_max = avail;
+	if (avail >= runtime->stop_threshold) {
+		snd_pcm_stop(substream,
+			     runtime->status->state == SNDRV_PCM_STATE_DRAINING ?
+			     SNDRV_PCM_STATE_SETUP : SNDRV_PCM_STATE_XRUN);
+#ifdef CONFIG_SND_DEBUG
+		if (substream->pstr->xrun_debug) {
+			snd_printd(KERN_DEBUG "XRUN: pcmC%dD%d%c\n",
+				   substream->pcm->card->number,
+				   substream->pcm->device,
+				   substream->stream ? 'c' : 'p');
+			dump_stack();
+		}
+#endif
+		return -EPIPE;
+	}
+	if (avail >= runtime->control->avail_min)
+		wake_up(&runtime->sleep);
+	return 0;
+}
 
+static inline int snd_pcm_update_hw_ptr_interrupt(snd_pcm_substream_t *substream)
+{
+	snd_pcm_runtime_t *runtime = substream->runtime;
+	snd_pcm_uframes_t pos;
+	snd_pcm_uframes_t new_hw_ptr, hw_ptr_interrupt;
+	snd_pcm_sframes_t delta;
+
+	pos = snd_pcm_update_hw_ptr_pos(substream, runtime);
+	if (runtime->period_size == runtime->buffer_size)
+		goto __next_buf;
+	new_hw_ptr = runtime->hw_ptr_base + pos;
 	hw_ptr_interrupt = runtime->hw_ptr_interrupt + runtime->period_size;
 
 	delta = hw_ptr_interrupt - new_hw_ptr;
 	if (delta > 0) {
 		if ((snd_pcm_uframes_t)delta < runtime->buffer_size / 2) {
-			snd_printd("Unexpected hw_pointer value (stream = %i, delta: -%ld, max jitter = %ld): wrong interrupt acknowledge?\n", substream->stream, (long) delta, runtime->buffer_size / 2);
+#ifdef CONFIG_SND_DEBUG
+			if (runtime->periods > 1)
+				snd_printd(KERN_ERR "Unexpected hw_pointer value [1] (stream = %i, delta: -%ld, max jitter = %ld): wrong interrupt acknowledge?\n", substream->stream, (long) delta, runtime->buffer_size / 2);
+#endif
 			return 0;
 		}
+	      __next_buf:
 		runtime->hw_ptr_base += runtime->buffer_size;
 		if (runtime->hw_ptr_base == runtime->boundary)
 			runtime->hw_ptr_base = 0;
@@ -168,21 +210,7 @@
 	runtime->status->hw_ptr = new_hw_ptr;
 	runtime->hw_ptr_interrupt = new_hw_ptr - new_hw_ptr % runtime->period_size;
 
-	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
-		avail = snd_pcm_playback_avail(runtime);
-	else
-		avail = snd_pcm_capture_avail(runtime);
-	if (avail > runtime->avail_max)
-		runtime->avail_max = avail;
-	if (avail >= runtime->stop_threshold) {
-		snd_pcm_stop(substream,
-			     runtime->status->state == SNDRV_PCM_STATE_DRAINING ?
-			     SNDRV_PCM_STATE_SETUP : SNDRV_PCM_STATE_XRUN);
-		return -EPIPE;
-	}
-	if (avail >= runtime->control->avail_min)
-		wake_up(&runtime->sleep);
-	return 0;
+	return snd_pcm_update_hw_ptr_post(substream, runtime);
 }
 
 /* CAUTION: call it with irq disabled */
@@ -191,27 +219,19 @@
 	snd_pcm_runtime_t *runtime = substream->runtime;
 	snd_pcm_uframes_t pos;
 	snd_pcm_uframes_t old_hw_ptr, new_hw_ptr;
-	snd_pcm_uframes_t avail;
 	snd_pcm_sframes_t delta;
 
 	old_hw_ptr = runtime->status->hw_ptr;
-	pos = substream->ops->pointer(substream);
-	if (runtime->tstamp_mode & SNDRV_PCM_TSTAMP_MMAP)
-		snd_timestamp_now((snd_timestamp_t*)&runtime->status->tstamp, runtime->tstamp_timespec);
-#ifdef CONFIG_SND_DEBUG
-	if (pos >= runtime->buffer_size) {
-		snd_printk(KERN_ERR "BUG: stream = %i, pos = 0x%lx, buffer size = 0x%lx, period size = 0x%lx\n", substream->stream, pos, runtime->buffer_size, runtime->period_size);
-	} else
-#endif
-	snd_runtime_check(pos < runtime->buffer_size, return 0);
-
-	pos -= pos % runtime->min_align;
+	pos = snd_pcm_update_hw_ptr_pos(substream, runtime);
 	new_hw_ptr = runtime->hw_ptr_base + pos;
 
 	delta = old_hw_ptr - new_hw_ptr;
 	if (delta > 0) {
 		if ((snd_pcm_uframes_t)delta < runtime->buffer_size / 2) {
-			snd_printd("Unexpected hw_pointer value (stream = %i, delta: -%ld, max jitter = %ld): wrong interrupt acknowledge?\n", substream->stream, (long) delta, runtime->buffer_size / 2);
+#ifdef CONFIG_SND_DEBUG
+			if (runtime->periods > 2)
+				snd_printd(KERN_ERR "Unexpected hw_pointer value [2] (stream = %i, delta: -%ld, max jitter = %ld): wrong interrupt acknowledge?\n", substream->stream, (long) delta, runtime->buffer_size / 2);
+#endif
 			return 0;
 		}
 		runtime->hw_ptr_base += runtime->buffer_size;
@@ -222,23 +242,10 @@
 	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK &&
 	    runtime->silence_size > 0)
 		snd_pcm_playback_silence(substream, new_hw_ptr);
+
 	runtime->status->hw_ptr = new_hw_ptr;
 
-	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
-		avail = snd_pcm_playback_avail(runtime);
-	else
-		avail = snd_pcm_capture_avail(runtime);
-	if (avail > runtime->avail_max)
-		runtime->avail_max = avail;
-	if (avail >= runtime->stop_threshold) {
-		snd_pcm_stop(substream,
-			     runtime->status->state == SNDRV_PCM_STATE_DRAINING ?
-			     SNDRV_PCM_STATE_SETUP : SNDRV_PCM_STATE_XRUN);
-		return -EPIPE;
-	}
-	if (avail >= runtime->control->avail_min)
-		wake_up(&runtime->sleep);
-	return 0;
+	return snd_pcm_update_hw_ptr_post(substream, runtime);
 }
 
 /**
--- diff/sound/core/pcm_memory.c	2003-08-20 14:16:34.000000000 +0100
+++ source/sound/core/pcm_memory.c	2004-02-09 10:39:58.000000000 +0000
@@ -59,14 +59,18 @@
 		if (dmab->bytes >= size)
 			return 0; /* yes */
 		/* no, reset the reserved block */
+		/* if we can find bigger pages below, this block will be
+		 * automatically removed in snd_dma_set_reserved().
+		 */
 		snd_dma_free_reserved(&substream->dma_device);
 		dmab->bytes = 0;
 	}
 
 	do {
-		if ((err = snd_dma_alloc_pages(&substream->dma_device, size, dmab)) < 0)
-			return err;
-		if (dmab->area) {
+		if ((err = snd_dma_alloc_pages(&substream->dma_device, size, dmab)) < 0) {
+			if (err != -ENOMEM)
+				return err; /* fatal error */
+		} else {
 			/* remember this one */
 			snd_dma_set_reserved(&substream->dma_device, dmab);
 			return 0;
@@ -167,12 +171,12 @@
 		memset(&new_dmab, 0, sizeof(new_dmab));
 		if (size > 0) {
 
-			if (snd_dma_alloc_pages(&substream->dma_device, size, &new_dmab) < 0 ||
-			    new_dmab.area == NULL) {
+			if (snd_dma_alloc_pages(&substream->dma_device, size, &new_dmab) < 0) {
 				buffer->error = -ENOMEM;
 				return;
 			}
 			substream->buffer_bytes_max = size;
+			snd_dma_free_reserved(&substream->dma_device);
 		} else {
 			substream->buffer_bytes_max = UINT_MAX;
 		}
@@ -219,8 +223,9 @@
  */
 static inline void setup_pcm_id(snd_pcm_substream_t *subs)
 {
-	subs->dma_device.id = subs->pcm->device << 16 |
-		subs->stream << 8 | subs->number;
+	if (! subs->dma_device.id)
+		subs->dma_device.id = subs->pcm->device << 16 |
+			subs->stream << 8 | (subs->number + 1);
 }
 
 /**
@@ -346,13 +351,12 @@
 		snd_pcm_lib_free_pages(substream);
 	}
 	if (substream->dma_buffer.area != NULL && substream->dma_buffer.bytes >= size) {
-		dmab = substream->dma_buffer;
+		dmab = substream->dma_buffer; /* use the pre-allocated buffer */
 	} else {
-		memset(&dmab, 0, sizeof(dmab));
-		snd_dma_alloc_pages(&substream->dma_device, size, &dmab);
+		memset(&dmab, 0, sizeof(dmab)); /* allocate a new buffer */
+		if (snd_dma_alloc_pages(&substream->dma_device, size, &dmab) < 0)
+			return -ENOMEM;
 	}
-	if (! dmab.area)
-		return -ENOMEM;
 	runtime->dma_area = dmab.area;
 	runtime->dma_addr = dmab.addr;
 	runtime->dma_private = dmab.private_data;
@@ -378,6 +382,7 @@
 	if (runtime->dma_area == NULL)
 		return 0;
 	if (runtime->dma_area != substream->dma_buffer.area) {
+		/* it's a newly allocated buffer.  release it now. */
 		struct snd_dma_buffer dmab;
 		memset(&dmab, 0, sizeof(dmab));
 		dmab.area = runtime->dma_area;
--- diff/sound/core/pcm_misc.c	2003-05-21 11:49:56.000000000 +0100
+++ source/sound/core/pcm_misc.c	2004-02-09 10:39:58.000000000 +0000
@@ -553,8 +553,9 @@
 		if (! silence)
 			memset(data, 0, samples * 2);
 		else {
+			u_int16_t *data16 = data;
 			while (samples-- > 0)
-				*((u_int16_t *)data)++ = silence;
+				*data16++ = silence;
 		}
 		break;
 	}
@@ -564,14 +565,15 @@
 			memset(data, 0, samples * 3);
 		else {
 			while (samples-- > 0) {
+				u_int8_t *data8 = data;
 #ifdef SNDRV_LITTLE_ENDIAN
-				*((u_int8_t *)data)++ = silence >> 0;
-				*((u_int8_t *)data)++ = silence >> 8;
-				*((u_int8_t *)data)++ = silence >> 16;
+				*data8++ = silence >> 0;
+				*data8++ = silence >> 8;
+				*data8++ = silence >> 16;
 #else
-				*((u_int8_t *)data)++ = silence >> 16;
-				*((u_int8_t *)data)++ = silence >> 8;
-				*((u_int8_t *)data)++ = silence >> 0;
+				*data8++ = silence >> 16;
+				*data8++ = silence >> 8;
+				*data8++ = silence >> 0;
 #endif
 			}
 		}
@@ -582,8 +584,9 @@
 		if (! silence)
 			memset(data, 0, samples * 4);
 		else {
+			u_int32_t *data32 = data;
 			while (samples-- > 0)
-				*((u_int32_t *)data)++ = silence;
+				*data32++ = silence;
 		}
 		break;
 	}
@@ -592,8 +595,9 @@
 		if (! silence)
 			memset(data, 0, samples * 8);
 		else {
+			u_int64_t *data64 = data;
 			while (samples-- > 0)
-				*((u_int64_t *)data)++ = silence;
+				*data64++ = silence;
 		}
 		break;
 	}
--- diff/sound/core/pcm_native.c	2004-01-19 10:22:59.000000000 +0000
+++ source/sound/core/pcm_native.c	2004-02-09 10:39:58.000000000 +0000
@@ -620,7 +620,7 @@
  */
 static int snd_pcm_action_group(struct action_ops *ops,
 				snd_pcm_substream_t *substream,
-				int state)
+				int state, int atomic_only)
 {
 	struct list_head *pos;
 	snd_pcm_substream_t *s = NULL;
@@ -628,6 +628,8 @@
 
 	snd_pcm_group_for_each(pos, substream) {
 		s = snd_pcm_group_substream_entry(pos);
+		if (atomic_only && (s->pcm->info_flags & SNDRV_PCM_INFO_NONATOMIC_OPS))
+			continue;
 		if (s != substream)
 			spin_lock(&s->self_group.lock);
 		res = ops->pre_action(s, state);
@@ -637,6 +639,8 @@
 	if (res >= 0) {
 		snd_pcm_group_for_each(pos, substream) {
 			s = snd_pcm_group_substream_entry(pos);
+			if (atomic_only && (s->pcm->info_flags & SNDRV_PCM_INFO_NONATOMIC_OPS))
+				continue;
 			err = ops->do_action(s, state);
 			if (err < 0) {
 				if (res == 0)
@@ -652,7 +656,9 @@
 		/* unlock all streams */
 		snd_pcm_group_for_each(pos, substream) {
 			s1 = snd_pcm_group_substream_entry(pos);
-			if (s1 != substream)
+			if (atomic_only && (s1->pcm->info_flags & SNDRV_PCM_INFO_NONATOMIC_OPS))
+				;
+			else if (s1 != substream)
 				spin_unlock(&s1->self_group.lock);
 			if (s1 == s)	/* end */
 				break;
@@ -682,6 +688,8 @@
 
 /*
  *  Note: call with stream lock
+ *
+ * NB2: this won't handle the non-atomic callbacks
  */
 static int snd_pcm_action(struct action_ops *ops,
 			  snd_pcm_substream_t *substream,
@@ -695,7 +703,7 @@
 			spin_lock(&substream->group->lock);
 			spin_lock(&substream->self_group.lock);
 		}
-		res = snd_pcm_action_group(ops, substream, state);
+		res = snd_pcm_action_group(ops, substream, state, 0);
 		spin_unlock(&substream->group->lock);
 	} else {
 		res = snd_pcm_action_single(ops, substream, state);
@@ -705,10 +713,14 @@
 
 /*
  *  Note: don't use any locks before
+ *
+ * NB2: this can handle the non-atomic callbacks if allow_nonatomic = 1
+ *      when the pcm->info_flags has NONATOMIC_OPS bit, it's handled
+ *      ouside the lock to allow sleep in the callback.
  */
 static int snd_pcm_action_lock_irq(struct action_ops *ops,
 				   snd_pcm_substream_t *substream,
-				   int state)
+				   int state, int allow_nonatomic)
 {
 	int res;
 
@@ -716,10 +728,43 @@
 	if (snd_pcm_stream_linked(substream)) {
 		spin_lock(&substream->group->lock);
 		spin_lock(&substream->self_group.lock);
-		res = snd_pcm_action_group(ops, substream, state);
+		res = snd_pcm_action_group(ops, substream, state, allow_nonatomic);
 		spin_unlock(&substream->self_group.lock);
 		spin_unlock(&substream->group->lock);
+		if (res >= 0 && allow_nonatomic) {
+			/* now process the non-atomic substreams separately
+			 * outside the lock
+			 */
+#define MAX_LINKED_STREAMS	16	/* FIXME: should be variable */
+
+			struct list_head *pos;
+			int i, num_s = 0;
+			snd_pcm_substream_t *s;
+			snd_pcm_substream_t *subs[MAX_LINKED_STREAMS];
+			snd_pcm_group_for_each(pos, substream) {
+				if (num_s >= MAX_LINKED_STREAMS) {
+					res = -ENOMEM;
+					num_s = 0; /* don't proceed */
+					break;
+				}
+				s = snd_pcm_group_substream_entry(pos);
+				if (s->pcm->info_flags & SNDRV_PCM_INFO_NONATOMIC_OPS)
+					subs[num_s++] = s;
+			}
+			if (num_s > 0) {
+				read_unlock_irq(&snd_pcm_link_rwlock);
+				for (i = 0; i < num_s && res >= 0; i++)
+					res = snd_pcm_action_single(ops, subs[i], state);
+				return res;
+			}
+		}
 	} else {
+		if (allow_nonatomic &&
+		    (substream->pcm->info_flags & SNDRV_PCM_INFO_NONATOMIC_OPS)) {
+			read_unlock_irq(&snd_pcm_link_rwlock);
+			/* process outside the lock */
+			return snd_pcm_action_single(ops, substream, state);
+		}
 		spin_lock(&substream->self_group.lock);
 		res = snd_pcm_action_single(ops, substream, state);
 		spin_unlock(&substream->self_group.lock);
@@ -888,7 +933,8 @@
 	snd_pcm_runtime_t *runtime = substream->runtime;
 	if (runtime->trigger_master != substream)
 		return 0;
-	if (runtime->status->suspended_state != SNDRV_PCM_STATE_RUNNING)
+	if (runtime->status->suspended_state != SNDRV_PCM_STATE_RUNNING &&
+	    runtime->status->suspended_state != SNDRV_PCM_STATE_DRAINING)
 		return 0;
 	return substream->ops->trigger(substream, SNDRV_PCM_TRIGGER_SUSPEND);
 }
@@ -962,7 +1008,8 @@
 	snd_pcm_runtime_t *runtime = substream->runtime;
 	if (runtime->trigger_master != substream)
 		return 0;
-	if (runtime->status->suspended_state != SNDRV_PCM_STATE_RUNNING)
+	if (runtime->status->suspended_state != SNDRV_PCM_STATE_RUNNING &&
+	    runtime->status->suspended_state != SNDRV_PCM_STATE_DRAINING)
 		return 0;
 	return substream->ops->trigger(substream, SNDRV_PCM_TRIGGER_RESUME);
 }
@@ -991,7 +1038,7 @@
 
 	snd_power_lock(card);
 	if ((res = snd_power_wait(card, SNDRV_CTL_POWER_D0, substream->ffile)) >= 0)
-		return snd_pcm_action_lock_irq(&snd_pcm_action_resume, substream, 0);
+		return snd_pcm_action_lock_irq(&snd_pcm_action_resume, substream, 0, 0);
 	snd_power_unlock(card);
 	return res;
 }
@@ -1081,7 +1128,7 @@
 
 static int snd_pcm_reset(snd_pcm_substream_t *substream)
 {
-	return snd_pcm_action_lock_irq(&snd_pcm_action_reset, substream, 0);
+	return snd_pcm_action_lock_irq(&snd_pcm_action_reset, substream, 0, 0);
 }
 
 static int snd_pcm_pre_prepare(snd_pcm_substream_t * substream, int state)
@@ -1129,7 +1176,7 @@
 
 	snd_power_lock(card);
 	if ((res = snd_power_wait(card, SNDRV_CTL_POWER_D0, substream->ffile)) >= 0)
-		res = snd_pcm_action_lock_irq(&snd_pcm_action_prepare, substream, 0);
+		res = snd_pcm_action_lock_irq(&snd_pcm_action_prepare, substream, 0, 1); /* allow sleep if specified */
 	snd_power_unlock(card);
 	return res;
 }
@@ -1243,7 +1290,9 @@
 		}
 		set_current_state(TASK_INTERRUPTIBLE);
 		snd_pcm_stream_unlock_irq(substream);
+		snd_power_unlock(card);
 		tout = schedule_timeout(10 * HZ);
+		snd_power_lock(card);
 		snd_pcm_stream_lock_irq(substream);
 		if (tout == 0) {
 			state = runtime->status->state == SNDRV_PCM_STATE_SUSPENDED ? SUSPENDED : EXPIRED;
@@ -1497,7 +1546,7 @@
 
 	write_lock_irq(&snd_pcm_link_rwlock);
 	if (!snd_pcm_stream_linked(substream)) {
-		res = -EINVAL;
+		res = -EALREADY;
 		goto _end;
 	}
 	list_del(&substream->link_list);
@@ -2326,7 +2375,7 @@
 	case SNDRV_PCM_IOCTL_RESET:
 		return snd_pcm_reset(substream);
 	case SNDRV_PCM_IOCTL_START:
-		return snd_pcm_action(&snd_pcm_action_start, substream, 0);
+		return snd_pcm_action_lock_irq(&snd_pcm_action_start, substream, 0, 0);
 	case SNDRV_PCM_IOCTL_LINK:
 		return snd_pcm_link(substream, (long) arg);
 	case SNDRV_PCM_IOCTL_UNLINK:
--- diff/sound/core/rawmidi.c	2003-10-27 09:20:39.000000000 +0000
+++ source/sound/core/rawmidi.c	2004-02-09 10:39:58.000000000 +0000
@@ -1507,7 +1507,6 @@
 	sprintf(name, "midi%d", rmidi->device);
 	entry = snd_info_create_card_entry(rmidi->card, name, rmidi->card->proc_root);
 	if (entry) {
-		entry->content = SNDRV_INFO_CONTENT_TEXT;
 		entry->private_data = rmidi;
 		entry->c.text.read_size = 1024;
 		entry->c.text.read = snd_rawmidi_proc_info_read;
--- diff/sound/core/seq/oss/seq_oss.c	2003-09-17 12:28:13.000000000 +0100
+++ source/sound/core/seq/oss/seq_oss.c	2004-02-09 10:39:58.000000000 +0000
@@ -35,6 +35,9 @@
 MODULE_DESCRIPTION("OSS-compatible sequencer module");
 MODULE_LICENSE("GPL");
 MODULE_CLASSES("{sound}");
+/* Takashi says this is really only for sound-service-0-, but this is OK. */
+MODULE_ALIAS_SNDRV_MINOR(SNDRV_MINOR_OSS_SEQUENCER);
+MODULE_ALIAS_SNDRV_MINOR(SNDRV_MINOR_OSS_MUSIC);
 
 #ifdef SNDRV_SEQ_OSS_DEBUG
 MODULE_PARM(seq_oss_debug, "i");
--- diff/sound/core/seq/seq.c	2002-12-30 10:17:13.000000000 +0000
+++ source/sound/core/seq/seq.c	2004-02-09 10:39:58.000000000 +0000
@@ -1,6 +1,6 @@
 /*
  *  ALSA sequencer main module
- *  Copyright (c) 1998-1999 by Frank van de Pol <fvdpol@home.nl>
+ *  Copyright (c) 1998-1999 by Frank van de Pol <fvdpol@coil.demon.nl>
  *
  *
  *   This program is free software; you can redistribute it and/or modify
@@ -42,7 +42,7 @@
 int seq_default_timer_subdevice = 0;
 int seq_default_timer_resolution = 0;	/* Hz */
 
-MODULE_AUTHOR("Frank van de Pol <fvdpol@home.nl>, Jaroslav Kysela <perex@suse.cz>");
+MODULE_AUTHOR("Frank van de Pol <fvdpol@coil.demon.nl>, Jaroslav Kysela <perex@suse.cz>");
 MODULE_DESCRIPTION("Advanced Linux Sound Architecture sequencer.");
 MODULE_LICENSE("GPL");
 MODULE_CLASSES("{sound}");
--- diff/sound/core/seq/seq_clientmgr.c	2003-08-26 10:00:55.000000000 +0100
+++ source/sound/core/seq/seq_clientmgr.c	2004-02-09 10:39:58.000000000 +0000
@@ -1,6 +1,6 @@
 /*
  *  ALSA sequencer Client Manager
- *  Copyright (c) 1998-2001 by Frank van de Pol <fvdpol@home.nl>
+ *  Copyright (c) 1998-2001 by Frank van de Pol <fvdpol@coil.demon.nl>
  *                             Jaroslav Kysela <perex@suse.cz>
  *                             Takashi Iwai <tiwai@suse.de>
  *
@@ -137,7 +137,7 @@
 		if (clientid < 64) {
 			int idx;
 			
-			if (! client_requested[clientid]) {
+			if (! client_requested[clientid] && current->fs->root) {
 				client_requested[clientid] = 1;
 				for (idx = 0; idx < 64; idx++) {
 					if (seq_client_load[idx] < 0)
@@ -328,7 +328,7 @@
 	up(&register_mutex);
 
 	c = client->number;
-	(user_client_t *) file->private_data = client;
+	file->private_data = client;
 
 	/* fill client data */
 	user->file = file;
--- diff/sound/core/seq/seq_clientmgr.h	2002-10-16 04:28:34.000000000 +0100
+++ source/sound/core/seq/seq_clientmgr.h	2004-02-09 10:39:58.000000000 +0000
@@ -1,6 +1,6 @@
 /*
  *   ALSA sequencer Client Manager
- *   Copyright (c) 1998-1999 by Frank van de Pol <fvdpol@home.nl>
+ *   Copyright (c) 1998-1999 by Frank van de Pol <fvdpol@coil.demon.nl>
  *
  *
  *   This program is free software; you can redistribute it and/or modify
--- diff/sound/core/seq/seq_device.c	2003-06-09 14:18:21.000000000 +0100
+++ source/sound/core/seq/seq_device.c	2004-02-09 10:39:58.000000000 +0000
@@ -132,6 +132,9 @@
 #ifdef CONFIG_KMOD
 	struct list_head *head;
 
+	if (! current->fs->root)
+		return;
+
 	down(&ops_mutex);
 	list_for_each(head, &opslist) {
 		ops_list_t *ops = list_entry(head, ops_list_t, list);
--- diff/sound/core/seq/seq_dummy.c	2002-10-16 04:28:23.000000000 +0100
+++ source/sound/core/seq/seq_dummy.c	2004-02-09 10:39:58.000000000 +0000
@@ -45,8 +45,8 @@
   snd-seq-client-62 as "off".  This will help modprobe.
 
   The number of ports to be created can be specified via the module
-  paramter "ports".  For example, to create four ports, add the
-  following option in /etc/modules.conf:
+  parameter "ports".  For example, to create four ports, add the
+  following option in /etc/modprobe.conf:
 
 	option snd-seq-dummy ports=4
 
--- diff/sound/core/seq/seq_fifo.c	2002-10-16 04:28:20.000000000 +0100
+++ source/sound/core/seq/seq_fifo.c	2004-02-09 10:39:58.000000000 +0000
@@ -1,6 +1,6 @@
 /*
  *   ALSA sequencer FIFO
- *   Copyright (c) 1998 by Frank van de Pol <fvdpol@home.nl>
+ *   Copyright (c) 1998 by Frank van de Pol <fvdpol@coil.demon.nl>
  *
  *
  *   This program is free software; you can redistribute it and/or modify
--- diff/sound/core/seq/seq_fifo.h	2002-10-16 04:27:21.000000000 +0100
+++ source/sound/core/seq/seq_fifo.h	2004-02-09 10:39:58.000000000 +0000
@@ -1,6 +1,6 @@
 /*
  *   ALSA sequencer FIFO
- *   Copyright (c) 1998 by Frank van de Pol <fvdpol@home.nl>
+ *   Copyright (c) 1998 by Frank van de Pol <fvdpol@coil.demon.nl>
  *
  *
  *   This program is free software; you can redistribute it and/or modify
--- diff/sound/core/seq/seq_info.c	2002-10-16 04:27:22.000000000 +0100
+++ source/sound/core/seq/seq_info.c	2004-02-09 10:39:58.000000000 +0000
@@ -1,6 +1,6 @@
 /*
  *   ALSA sequencer /proc interface
- *   Copyright (c) 1998 by Frank van de Pol <fvdpol@home.nl>
+ *   Copyright (c) 1998 by Frank van de Pol <fvdpol@coil.demon.nl>
  *
  *
  *   This program is free software; you can redistribute it and/or modify
--- diff/sound/core/seq/seq_info.h	2002-10-16 04:28:24.000000000 +0100
+++ source/sound/core/seq/seq_info.h	2004-02-09 10:39:58.000000000 +0000
@@ -1,6 +1,6 @@
 /*
  *   ALSA sequencer /proc info
- *   Copyright (c) 1998 by Frank van de Pol <fvdpol@home.nl>
+ *   Copyright (c) 1998 by Frank van de Pol <fvdpol@coil.demon.nl>
  *
  *
  *   This program is free software; you can redistribute it and/or modify
--- diff/sound/core/seq/seq_memory.c	2003-06-30 10:07:24.000000000 +0100
+++ source/sound/core/seq/seq_memory.c	2004-02-09 10:39:58.000000000 +0000
@@ -1,6 +1,6 @@
 /*
  *  ALSA sequencer Memory Manager
- *  Copyright (c) 1998 by Frank van de Pol <fvdpol@home.nl>
+ *  Copyright (c) 1998 by Frank van de Pol <fvdpol@coil.demon.nl>
  *                        Jaroslav Kysela <perex@suse.cz>
  *                2000 by Takashi Iwai <tiwai@suse.de>
  *
--- diff/sound/core/seq/seq_memory.h	2002-10-16 04:27:18.000000000 +0100
+++ source/sound/core/seq/seq_memory.h	2004-02-09 10:39:58.000000000 +0000
@@ -1,6 +1,6 @@
 /*
  *  ALSA sequencer Memory Manager
- *  Copyright (c) 1998 by Frank van de Pol <fvdpol@home.nl>
+ *  Copyright (c) 1998 by Frank van de Pol <fvdpol@coil.demon.nl>
  *
  *
  *   This program is free software; you can redistribute it and/or modify
--- diff/sound/core/seq/seq_midi.c	2003-05-21 11:50:10.000000000 +0100
+++ source/sound/core/seq/seq_midi.c	2004-02-09 10:39:58.000000000 +0000
@@ -1,6 +1,6 @@
 /*
  *   Generic MIDI synth driver for ALSA sequencer
- *   Copyright (c) 1998 by Frank van de Pol <fvdpol@home.nl>
+ *   Copyright (c) 1998 by Frank van de Pol <fvdpol@coil.demon.nl>
  *                         Jaroslav Kysela <perex@suse.cz>
  *
  *   This program is free software; you can redistribute it and/or modify
@@ -39,7 +39,7 @@
 #include <sound/seq_midi_event.h>
 #include <sound/initval.h>
 
-MODULE_AUTHOR("Frank van de Pol <fvdpol@home.nl>, Jaroslav Kysela <perex@suse.cz>");
+MODULE_AUTHOR("Frank van de Pol <fvdpol@coil.demon.nl>, Jaroslav Kysela <perex@suse.cz>");
 MODULE_DESCRIPTION("Advanced Linux Sound Architecture sequencer MIDI synth.");
 MODULE_LICENSE("GPL");
 MODULE_CLASSES("{sound}");
--- diff/sound/core/seq/seq_ports.c	2003-08-20 14:16:34.000000000 +0100
+++ source/sound/core/seq/seq_ports.c	2004-02-09 10:39:58.000000000 +0000
@@ -1,6 +1,6 @@
 /*
  *   ALSA sequencer Ports
- *   Copyright (c) 1998 by Frank van de Pol <fvdpol@home.nl>
+ *   Copyright (c) 1998 by Frank van de Pol <fvdpol@coil.demon.nl>
  *                         Jaroslav Kysela <perex@suse.cz>
  *
  *
--- diff/sound/core/seq/seq_ports.h	2003-08-20 14:16:34.000000000 +0100
+++ source/sound/core/seq/seq_ports.h	2004-02-09 10:39:58.000000000 +0000
@@ -1,6 +1,6 @@
 /*
  *   ALSA sequencer Ports 
- *   Copyright (c) 1998 by Frank van de Pol <fvdpol@home.nl>
+ *   Copyright (c) 1998 by Frank van de Pol <fvdpol@coil.demon.nl>
  *
  *
  *   This program is free software; you can redistribute it and/or modify
--- diff/sound/core/seq/seq_prioq.c	2002-11-11 11:09:49.000000000 +0000
+++ source/sound/core/seq/seq_prioq.c	2004-02-09 10:39:58.000000000 +0000
@@ -1,6 +1,6 @@
 /*
  *   ALSA sequencer Priority Queue
- *   Copyright (c) 1998-1999 by Frank van de Pol <fvdpol@home.nl>
+ *   Copyright (c) 1998-1999 by Frank van de Pol <fvdpol@coil.demon.nl>
  *
  *
  *   This program is free software; you can redistribute it and/or modify
--- diff/sound/core/seq/seq_prioq.h	2002-10-16 04:29:05.000000000 +0100
+++ source/sound/core/seq/seq_prioq.h	2004-02-09 10:39:58.000000000 +0000
@@ -1,6 +1,6 @@
 /*
  *   ALSA sequencer Priority Queue
- *   Copyright (c) 1998 by Frank van de Pol <fvdpol@home.nl>
+ *   Copyright (c) 1998 by Frank van de Pol <fvdpol@coil.demon.nl>
  *
  *
  *   This program is free software; you can redistribute it and/or modify
--- diff/sound/core/seq/seq_queue.c	2003-06-09 14:18:21.000000000 +0100
+++ source/sound/core/seq/seq_queue.c	2004-02-09 10:39:58.000000000 +0000
@@ -1,6 +1,6 @@
 /*
  *   ALSA sequencer Timing queue handling
- *   Copyright (c) 1998-1999 by Frank van de Pol <fvdpol@home.nl>
+ *   Copyright (c) 1998-1999 by Frank van de Pol <fvdpol@coil.demon.nl>
  *
  *   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/sound/core/seq/seq_queue.h	2003-02-13 11:46:56.000000000 +0000
+++ source/sound/core/seq/seq_queue.h	2004-02-09 10:39:58.000000000 +0000
@@ -1,6 +1,6 @@
 /*
  *   ALSA sequencer Queue handling
- *   Copyright (c) 1998-1999 by Frank van de Pol <fvdpol@home.nl>
+ *   Copyright (c) 1998-1999 by Frank van de Pol <fvdpol@coil.demon.nl>
  *
  *   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/sound/core/seq/seq_system.c	2002-10-16 04:28:25.000000000 +0100
+++ source/sound/core/seq/seq_system.c	2004-02-09 10:39:58.000000000 +0000
@@ -1,6 +1,6 @@
 /*
  *   ALSA sequencer System services Client
- *   Copyright (c) 1998-1999 by Frank van de Pol <fvdpol@home.nl>
+ *   Copyright (c) 1998-1999 by Frank van de Pol <fvdpol@coil.demon.nl>
  *
  *
  *   This program is free software; you can redistribute it and/or modify
--- diff/sound/core/seq/seq_system.h	2002-10-16 04:28:24.000000000 +0100
+++ source/sound/core/seq/seq_system.h	2004-02-09 10:39:58.000000000 +0000
@@ -1,6 +1,6 @@
 /*
  *  ALSA sequencer System Client
- *  Copyright (c) 1998 by Frank van de Pol <fvdpol@home.nl>
+ *  Copyright (c) 1998 by Frank van de Pol <fvdpol@coil.demon.nl>
  *
  *
  *   This program is free software; you can redistribute it and/or modify
--- diff/sound/core/seq/seq_timer.c	2003-05-21 11:49:56.000000000 +0100
+++ source/sound/core/seq/seq_timer.c	2004-02-09 10:39:58.000000000 +0000
@@ -1,6 +1,6 @@
 /*
  *   ALSA sequencer Timer
- *   Copyright (c) 1998-1999 by Frank van de Pol <fvdpol@home.nl>
+ *   Copyright (c) 1998-1999 by Frank van de Pol <fvdpol@coil.demon.nl>
  *                              Jaroslav Kysela <perex@suse.cz>
  *
  *
@@ -335,7 +335,7 @@
 		if (! r && t->hw.c_resolution)
 			r = t->hw.c_resolution(t);
 		if (r) {
-			tmr->ticks = (unsigned int)(tmr->preferred_resolution / r);
+			tmr->ticks = (unsigned int)(1000000000uL / (r * tmr->preferred_resolution));
 			if (! tmr->ticks)
 				tmr->ticks = 1;
 		}
--- diff/sound/core/seq/seq_timer.h	2003-02-13 11:46:56.000000000 +0000
+++ source/sound/core/seq/seq_timer.h	2004-02-09 10:39:58.000000000 +0000
@@ -1,6 +1,6 @@
 /*
  *  ALSA sequencer Timer
- *  Copyright (c) 1998-1999 by Frank van de Pol <fvdpol@home.nl>
+ *  Copyright (c) 1998-1999 by Frank van de Pol <fvdpol@coil.demon.nl>
  *
  *
  *   This program is free software; you can redistribute it and/or modify
@@ -47,7 +47,7 @@
 	snd_timer_id_t		alsa_id;	/* ALSA's timer ID */
 	snd_timer_instance_t	*timeri;	/* timer instance */
 	unsigned int		ticks;
-	unsigned long		preferred_resolution; /* timer resolution */
+	unsigned long		preferred_resolution; /* timer resolution, ticks/sec */
 
 	unsigned int skew;
 	unsigned int skew_base;
--- diff/sound/core/sound.c	2004-02-09 10:36:12.000000000 +0000
+++ source/sound/core/sound.c	2004-02-09 10:39:58.000000000 +0000
@@ -37,7 +37,7 @@
 
 static int major = CONFIG_SND_MAJOR;
 int snd_major;
-static int cards_limit = SNDRV_CARDS;
+static int cards_limit = 1;
 static int device_mode = S_IFCHR | S_IRUGO | S_IWUGO;
 
 MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>");
@@ -49,7 +49,7 @@
 MODULE_PARM_DESC(major, "Major # for sound driver.");
 MODULE_PARM_SYNTAX(major, "default:116,skill:devel");
 MODULE_PARM(cards_limit, "i");
-MODULE_PARM_DESC(cards_limit, "Count of soundcards installed in the system.");
+MODULE_PARM_DESC(cards_limit, "Count of auto-loadable soundcards.");
 MODULE_PARM_SYNTAX(cards_limit, "default:8,skill:advanced");
 MODULE_ALIAS_CHARDEV_MAJOR(CONFIG_SND_MAJOR);
 #ifdef CONFIG_DEVFS_FS
@@ -57,7 +57,12 @@
 MODULE_PARM_DESC(device_mode, "Device file permission mask for devfs.");
 MODULE_PARM_SYNTAX(device_mode, "default:0666,base:8");
 #endif
+MODULE_ALIAS_CHARDEV_MAJOR(CONFIG_SND_MAJOR);
 
+/* this one holds the actual max. card number currently available.
+ * as default, it's identical with cards_limit option.  when more
+ * modules are loaded manually, this limit number increases, too.
+ */
 int snd_ecards_limit;
 
 static struct list_head snd_minors_hash[SNDRV_CARDS];
@@ -78,6 +83,8 @@
 {
 	int locked;
 
+	if (! current->fs->root)
+		return;
 	read_lock(&snd_card_rwlock);
 	locked = snd_cards_lock & (1 << card);
 	read_unlock(&snd_card_rwlock);
@@ -92,6 +99,8 @@
 {
 	char *str;
 
+	if (! current->fs->root)
+		return;
 	switch (minor) {
 	case SNDRV_MINOR_SEQUENCER:	str = "snd-seq";	break;
 	case SNDRV_MINOR_TIMER:		str = "snd-timer";	break;
@@ -221,8 +230,7 @@
 		return -EBUSY;
 	}
 	list_add_tail(&preg->list, &snd_minors_hash[SNDRV_MINOR_CARD(minor)]);
-
-	if (strncmp(name, "controlC", 8)) {	/* created in sound.c */
+	if (strncmp(name, "controlC", 8) || card->number >= cards_limit) {
 		devfs_mk_cdev(MKDEV(major, minor), S_IFCHR | device_mode, "snd/%s", name);
 		if (card)
 			device = card->dev;
@@ -257,7 +265,7 @@
 		return -EINVAL;
 	}
 
-	if (strncmp(mptr->name, "controlC", 8)) {	/* created in sound.c */
+	if (strncmp(mptr->name, "controlC", 8) || card->number >= cards_limit) { /* created in sound.c */
 		devfs_remove("snd/%s", mptr->name);
 		class_simple_device_remove(MKDEV(major, minor));
 	}
@@ -303,7 +311,6 @@
 
 	entry = snd_info_create_module_entry(THIS_MODULE, "devices", NULL);
 	if (entry) {
-		entry->content = SNDRV_INFO_CONTENT_TEXT;
 		entry->c.text.read_size = PAGE_SIZE;
 		entry->c.text.read = snd_minor_info_read;
 		if (snd_info_register(entry) < 0) {
--- diff/sound/core/sound_oss.c	2003-08-20 14:16:34.000000000 +0100
+++ source/sound/core/sound_oss.c	2004-02-09 10:39:58.000000000 +0000
@@ -217,7 +217,6 @@
 
 	entry = snd_info_create_module_entry(THIS_MODULE, "devices", snd_oss_root);
 	if (entry) {
-		entry->content = SNDRV_INFO_CONTENT_TEXT;
 		entry->c.text.read_size = PAGE_SIZE;
 		entry->c.text.read = snd_minor_info_oss_read;
 		if (snd_info_register(entry) < 0) {
--- diff/sound/core/timer.c	2003-10-27 09:20:39.000000000 +0000
+++ source/sound/core/timer.c	2004-02-09 10:39:58.000000000 +0000
@@ -148,6 +148,8 @@
 
 static void snd_timer_request(snd_timer_id_t *tid)
 {
+	if (! current->fs->root)
+		return;
 	switch (tid->dev_class) {
 	case SNDRV_TIMER_CLASS_GLOBAL:
 		if (tid->device < timer_limit)
@@ -304,14 +306,31 @@
 
 	snd_assert(timeri != NULL, return -ENXIO);
 
-	snd_timer_stop(timeri); /* force to stop the timer */
+	/* force to stop the timer */
+	snd_timer_stop(timeri);
 
 	if (timeri->flags & SNDRV_TIMER_IFLG_SLAVE) {
+		/* wait, until the active callback is finished */
+		spin_lock_irq(&slave_active_lock);
+		while (timeri->flags & SNDRV_TIMER_IFLG_CALLBACK) {
+			spin_unlock_irq(&slave_active_lock);
+			udelay(10);
+			spin_lock_irq(&slave_active_lock);
+		}
+		spin_unlock_irq(&slave_active_lock);
 		down(&register_mutex);
 		list_del(&timeri->open_list);
 		up(&register_mutex);
 	} else {
 		timer = timeri->timer;
+		/* wait, until the active callback is finished */
+		spin_lock_irq(&timer->lock);
+		while (timeri->flags & SNDRV_TIMER_IFLG_CALLBACK) {
+			spin_unlock_irq(&timer->lock);
+			udelay(10);
+			spin_lock_irq(&timer->lock);
+		}
+		spin_unlock_irq(&timer->lock);
 		down(&register_mutex);
 		list_del(&timeri->open_list);
 		if (timer && list_empty(&timer->open_list_head) && timer->hw.close)
@@ -389,12 +408,15 @@
 	list_del(&timeri->active_list);
 	list_add_tail(&timeri->active_list, &timer->active_list_head);
 	if (timer->running) {
+		if (timer->hw.flags & SNDRV_TIMER_HW_SLAVE)
+			goto __start_now;
 		timer->flags |= SNDRV_TIMER_FLG_RESCHED;
 		timeri->flags |= SNDRV_TIMER_IFLG_START;
 		return 1;	/* delayed start */
 	} else {
 		timer->sticks = sticks;
 		timer->hw.start(timer);
+	      __start_now:
 		timer->running++;
 		timeri->flags |= SNDRV_TIMER_IFLG_RUNNING;
 		return 0;
@@ -448,22 +470,21 @@
 
 	snd_assert(timeri != NULL, return -ENXIO);
 
+	if (timeri->flags & SNDRV_TIMER_IFLG_SLAVE) {
+		if (!keep_flag) {
+			spin_lock_irqsave(&slave_active_lock, flags);
+			timeri->flags &= ~SNDRV_TIMER_IFLG_RUNNING;
+			spin_unlock_irqrestore(&slave_active_lock, flags);
+		}
+		goto __end;
+	}
 	timer = timeri->timer;
-	if (! timer)
+	if (!timer)
 		return -EINVAL;
 	spin_lock_irqsave(&timer->lock, flags);
 	list_del_init(&timeri->ack_list);
-#if 0   /* FIXME: this causes dead lock with the sequencer timer */
-	/* wait until the callback is finished */
-	while (timeri->flags & SNDRV_TIMER_IFLG_CALLBACK) {
-		spin_unlock_irqrestore(&timer->lock, flags);
-		udelay(10);
-		spin_lock_irqsave(&timer->lock, flags);
-	}
-#endif
 	list_del_init(&timeri->active_list);
 	if ((timeri->flags & SNDRV_TIMER_IFLG_RUNNING) &&
-	    !(timeri->flags & SNDRV_TIMER_IFLG_SLAVE) &&
 	    !(--timer->running)) {
 		timer->hw.stop(timer);
 		if (timer->flags & SNDRV_TIMER_FLG_RESCHED) {
@@ -478,6 +499,7 @@
 	if (!keep_flag)
 		timeri->flags &= ~(SNDRV_TIMER_IFLG_RUNNING|SNDRV_TIMER_IFLG_START);
 	spin_unlock_irqrestore(&timer->lock, flags);
+      __end:
 	if (event != SNDRV_TIMER_EVENT_RESOLUTION)
 		snd_timer_notify1(timeri, event);
 	return 0;
@@ -913,6 +935,14 @@
  *  System timer
  */
 
+struct snd_timer_system_private {
+	struct timer_list tlist;
+	struct timer * timer;
+	unsigned long last_expires;
+	unsigned long last_jiffies;
+	unsigned long correction;
+};
+
 unsigned int snd_timer_system_resolution(void)
 {
 	return 1000000000L / HZ;
@@ -921,26 +951,44 @@
 static void snd_timer_s_function(unsigned long data)
 {
 	snd_timer_t *timer = (snd_timer_t *)data;
-	snd_timer_interrupt(timer, timer->sticks);
+	struct snd_timer_system_private *priv = timer->private_data;
+	unsigned long jiff = jiffies;
+	if (time_after(jiff, priv->last_expires))
+		priv->correction = (long)jiff - (long)priv->last_expires;
+	snd_timer_interrupt(timer, (long)jiff - (long)priv->last_jiffies);
 }
 
 static int snd_timer_s_start(snd_timer_t * timer)
 {
-	struct timer_list *tlist;
+	struct snd_timer_system_private *priv;
+	unsigned long njiff;
 
-	tlist = (struct timer_list *) timer->private_data;
-	tlist->expires = jiffies + timer->sticks;
-	add_timer(tlist);
+	priv = (struct snd_timer_system_private *) timer->private_data;
+	njiff = (priv->last_jiffies = jiffies);
+	if (priv->correction > timer->sticks - 1) {
+		priv->correction -= timer->sticks - 1;
+		njiff++;
+	} else {
+		njiff += timer->sticks - priv->correction;
+		priv->correction -= timer->sticks;
+	}
+	priv->last_expires = priv->tlist.expires = njiff;
+	add_timer(&priv->tlist);
 	return 0;
 }
 
 static int snd_timer_s_stop(snd_timer_t * timer)
 {
-	struct timer_list *tlist;
+	struct snd_timer_system_private *priv;
+	unsigned long jiff;
 
-	tlist = (struct timer_list *) timer->private_data;
-	del_timer(tlist);
-	timer->sticks = tlist->expires - jiffies;
+	priv = (struct snd_timer_system_private *) timer->private_data;
+	del_timer(&priv->tlist);
+	jiff = jiffies;
+	if (time_before(jiff, priv->last_expires))
+		timer->sticks = priv->last_expires - jiff;
+	else
+		timer->sticks = 1;
 	return 0;
 }
 
@@ -962,22 +1010,22 @@
 static int snd_timer_register_system(void)
 {
 	snd_timer_t *timer;
-	struct timer_list *tlist;
+	struct snd_timer_system_private *priv;
 	int err;
 
 	if ((err = snd_timer_global_new("system", SNDRV_TIMER_GLOBAL_SYSTEM, &timer)) < 0)
 		return err;
 	strcpy(timer->name, "system timer");
 	timer->hw = snd_timer_system;
-	tlist = (struct timer_list *) snd_kcalloc(sizeof(struct timer_list), GFP_KERNEL);
-	if (tlist == NULL) {
+	priv = (struct snd_timer_system_private *) snd_kcalloc(sizeof(struct snd_timer_system_private), GFP_KERNEL);
+	if (priv == NULL) {
 		snd_timer_free(timer);
 		return -ENOMEM;
 	}
-	init_timer(tlist);
-	tlist->function = snd_timer_s_function;
-	tlist->data = (unsigned long) timer;
-	timer->private_data = tlist;
+	init_timer(&priv->tlist);
+	priv->tlist.function = snd_timer_s_function;
+	priv->tlist.data = (unsigned long) timer;
+	timer->private_data = priv;
 	timer->private_free = snd_timer_free_system;
 	return snd_timer_global_register(timer);
 }
@@ -1381,8 +1429,8 @@
 		if (t->hw.precise_resolution) {
 			t->hw.precise_resolution(t, &gstatus.resolution_num, &gstatus.resolution_den);
 		} else {
-			gstatus.resolution_num = 1;
-			gstatus.resolution_den = gstatus.resolution;
+			gstatus.resolution_num = gstatus.resolution;
+			gstatus.resolution_den = 1000000000uL;
 		}
 	} else {
 		err = -ENODEV;
@@ -1684,20 +1732,20 @@
 				break;
 			}
 		}
-		if (err < 0)
-			break;
 
 		spin_unlock_irq(&tu->qlock);
+		if (err < 0)
+			goto _error;
 
 		if (tu->tread) {
 			if (copy_to_user(buffer, &tu->tqueue[tu->qhead++], sizeof(snd_timer_tread_t))) {
 				err = -EFAULT;
-				break;
+				goto _error;
 			}
 		} else {
 			if (copy_to_user(buffer, &tu->queue[tu->qhead++], sizeof(snd_timer_read_t))) {
 				err = -EFAULT;
-				break;
+				goto _error;
 			}
 		}
 
@@ -1710,6 +1758,7 @@
 		tu->qused--;
 	}
 	spin_unlock_irq(&tu->qlock);
+ _error:
 	return result > 0 ? result : err;
 }
 
@@ -1761,7 +1810,6 @@
 	snd_oss_info_register(SNDRV_OSS_INFO_DEV_TIMERS, SNDRV_CARDS - 1, "system timer");
 #endif
 	if ((entry = snd_info_create_module_entry(THIS_MODULE, "timers", NULL)) != NULL) {
-		entry->content = SNDRV_INFO_CONTENT_TEXT;
 		entry->c.text.read_size = SNDRV_TIMER_DEVICES * 128;
 		entry->c.text.read = snd_timer_proc_read;
 		if (snd_info_register(entry) < 0) {
--- diff/sound/drivers/mpu401/mpu401.c	2003-02-13 11:46:56.000000000 +0000
+++ source/sound/drivers/mpu401/mpu401.c	2004-02-09 10:39:58.000000000 +0000
@@ -157,7 +157,7 @@
 #ifdef CONFIG_X86_PC9800
 	       get_option(&str,&pc98ii[nr_dev]) == 2 &&
 #endif
-	       get_option(&str,(int *)&port[nr_dev]) == 2 &&
+	       get_option_long(&str,&port[nr_dev]) == 2 &&
 	       get_option(&str,&irq[nr_dev]) == 2);
 	nr_dev++;
 	return 1;
--- diff/sound/drivers/mpu401/mpu401_uart.c	2003-06-30 10:07:24.000000000 +0100
+++ source/sound/drivers/mpu401/mpu401_uart.c	2004-02-09 10:39:58.000000000 +0000
@@ -498,6 +498,7 @@
 	if (!integrated) {
 		int res_size = hardware == MPU401_HW_PC98II ? 4 : 2;
 		if ((mpu->res = request_region(port, res_size, "MPU401 UART")) == NULL) {
+			snd_printk(KERN_ERR "mpu401_uart: unable to grab port 0x%lx size %d\n", port, res_size);
 			snd_device_free(card, rmidi);
 			return -EBUSY;
 		}
@@ -519,7 +520,7 @@
 		mpu->cport = port + 1;
 	if (irq >= 0 && irq_flags) {
 		if (request_irq(irq, snd_mpu401_uart_interrupt, irq_flags, "MPU401 UART", (void *) mpu)) {
-			snd_printk("unable to grab IRQ %d\n", irq);
+			snd_printk(KERN_ERR "mpu401_uart: unable to grab IRQ %d\n", irq);
 			snd_device_free(card, rmidi);
 			return -EBUSY;
 		}
--- diff/sound/drivers/mtpav.c	2003-05-21 11:50:17.000000000 +0100
+++ source/sound/drivers/mtpav.c	2004-02-09 10:39:58.000000000 +0000
@@ -813,7 +813,7 @@
 	(void)(get_option(&str,&enable) == 2 &&
 	       get_option(&str,&index) == 2 &&
 	       get_id(&str,&id) == 2 &&
-	       get_option(&str,(int *)&port) == 2 &&
+	       get_option_long(&str,&port) == 2 &&
 	       get_option(&str,&irq) == 2 &&
 	       get_option(&str,&hwports) == 2);
 	return 1;
--- diff/sound/drivers/opl3/opl3_lib.c	2003-08-26 10:00:55.000000000 +0100
+++ source/sound/drivers/opl3/opl3_lib.c	2004-02-09 10:39:58.000000000 +0000
@@ -387,11 +387,13 @@
 		goto __step1; /* ports are already reserved */
 
 	if ((opl3->res_l_port = request_region(l_port, 2, "OPL2/3 (left)")) == NULL) {
+		snd_printk(KERN_ERR "opl3: can't grab left port 0x%lx\n", l_port);
 		snd_opl3_free(opl3);
 		return -EBUSY;
 	}
 	if (r_port != 0 &&
 	    (opl3->res_r_port = request_region(r_port, 2, "OPL2/3 (right)")) == NULL) {
+		snd_printk(KERN_ERR "opl3: can't grab right port 0x%lx\n", r_port);
 		snd_opl3_free(opl3);
 		return -EBUSY;
 	}
--- diff/sound/drivers/opl3/opl3_synth.c	2003-05-21 11:50:10.000000000 +0100
+++ source/sound/drivers/opl3/opl3_synth.c	2004-02-09 10:39:58.000000000 +0000
@@ -20,7 +20,6 @@
  */
 
 #include <sound/opl3.h>
-#define __SND_OSS_COMPAT__
 #include <sound/asound_fm.h>
 
 /*
--- diff/sound/drivers/opl4/opl4_lib.c	2003-08-20 14:16:34.000000000 +0100
+++ source/sound/drivers/opl4/opl4_lib.c	2004-02-09 10:39:58.000000000 +0000
@@ -206,6 +206,7 @@
 	opl4->res_fm_port = request_region(fm_port, 8, "OPL4 FM");
 	opl4->res_pcm_port = request_region(pcm_port, 8, "OPL4 PCM/MIX");
 	if (!opl4->res_fm_port || !opl4->res_pcm_port) {
+		snd_printk(KERN_ERR "opl4: can't grab ports 0x%lx, 0x%lx\n", fm_port, pcm_port);
 		snd_opl4_free(opl4);
 		return -EBUSY;
 	}
--- diff/sound/drivers/opl4/opl4_proc.c	2003-06-30 10:07:24.000000000 +0100
+++ source/sound/drivers/opl4/opl4_proc.c	2004-02-09 10:39:58.000000000 +0000
@@ -18,6 +18,7 @@
  */
 
 #include "opl4_local.h"
+#include <linux/vmalloc.h>
 #include <sound/info.h>
 
 #ifdef CONFIG_PROC_FS
@@ -59,15 +60,15 @@
 	if (file->f_pos + size > entry->size)
 		size = entry->size - file->f_pos;
 	if (size > 0) {
-		buf = kmalloc(size, GFP_KERNEL);
+		buf = vmalloc(size);
 		if (!buf)
 			return -ENOMEM;
 		snd_opl4_read_memory(opl4, buf, file->f_pos, size);
 		if (copy_to_user(_buf, buf, size)) {
-			kfree(buf);
+			vfree(buf);
 			return -EFAULT;
 		}
-		kfree(buf);
+		vfree(buf);
 		file->f_pos += size;
 		return size;
 	}
@@ -85,15 +86,15 @@
 	if (file->f_pos + size > entry->size)
 		size = entry->size - file->f_pos;
 	if (size > 0) {
-		buf = kmalloc(size, GFP_KERNEL);
+		buf = vmalloc(size);
 		if (!buf)
 			return -ENOMEM;
 		if (copy_from_user(buf, _buf, size)) {
-			kfree(buf);
+			vfree(buf);
 			return -EFAULT;
 		}
 		snd_opl4_write_memory(opl4, buf, file->f_pos, size);
-		kfree(buf);
+		vfree(buf);
 		file->f_pos += size;
 		return size;
 	}
--- diff/sound/drivers/serial-u16550.c	2003-05-21 11:50:17.000000000 +0100
+++ source/sound/drivers/serial-u16550.c	2004-02-09 10:39:58.000000000 +0000
@@ -63,6 +63,9 @@
 	"Generic"
 };
 
+#define SNDRV_SERIAL_NORMALBUFF 0 /* Normal blocking buffer operation */
+#define SNDRV_SERIAL_DROPBUFF   1 /* Non-blocking discard operation */
+
 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;	/* Index 0-MAX */
 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;	/* ID for this card */
 static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */
@@ -73,6 +76,7 @@
 static int outs[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};	 /* 1 to 16 */
 static int ins[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};	/* 1 to 16 */
 static int adaptor[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = SNDRV_SERIAL_SOUNDCANVAS};
+static int droponfull[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS -1)] = SNDRV_SERIAL_NORMALBUFF };
 
 MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
 MODULE_PARM_DESC(index, "Index value for Serial MIDI.");
@@ -99,6 +103,9 @@
 MODULE_PARM_DESC(outs, "Number of MIDI outputs.");
 MODULE_PARM(ins, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
 MODULE_PARM_DESC(ins, "Number of MIDI inputs.");
+MODULE_PARM(droponfull, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+MODULE_PARM_DESC(droponfull, "Flag to enable drop-on-full buffer mode");
+MODULE_PARM_SYNTAX(droponfull, SNDRV_ENABLED "," SNDRV_BOOLEAN_FALSE_DESC);
 
 MODULE_PARM_SYNTAX(outs, SNDRV_ENABLED ",allows:{{1,16}},dialog:list");
 MODULE_PARM_SYNTAX(ins, SNDRV_ENABLED ",allows:{{1,16}},dialog:list");
@@ -163,6 +170,7 @@
 	int buff_in_count;
         int buff_in;
         int buff_out;
+        int drop_on_full;
 
 	// wait timer
 	unsigned int timer_running:1;
@@ -194,12 +202,14 @@
 inline static void snd_uart16550_buffer_output(snd_uart16550_t *uart)
 {
 	unsigned short buff_out = uart->buff_out;
-	outb(uart->tx_buff[buff_out], uart->base + UART_TX);
-	uart->fifo_count++;
-	buff_out++;
-	buff_out &= TX_BUFF_MASK;
-	uart->buff_out = buff_out;
-	uart->buff_in_count--;
+	if( uart->buff_in_count > 0 ) {
+		outb(uart->tx_buff[buff_out], uart->base + UART_TX);
+		uart->fifo_count++;
+		buff_out++;
+		buff_out &= TX_BUFF_MASK;
+		uart->buff_out = buff_out;
+		uart->buff_in_count--;
+	}
 }
 
 /* This loop should be called with interrupts disabled
@@ -257,9 +267,11 @@
 	   || uart->adaptor == SNDRV_SERIAL_GENERIC) {
 		/* Can't use FIFO, must send only when CTS is true */
 		status = inb(uart->base + UART_MSR);
-		if (uart->fifo_count == 0 && (status & UART_MSR_CTS)
-		    && uart->buff_in_count > 0)
-			snd_uart16550_buffer_output(uart);
+		while( (uart->fifo_count == 0) && (status & UART_MSR_CTS) &&
+		      (uart->buff_in_count > 0) ) {
+		       snd_uart16550_buffer_output(uart);
+		       status = inb( uart->base + UART_MSR );
+		}
 	} else {
 		/* Write loop */
 		while (uart->fifo_count < uart->fifo_limit	/* Can we write ? */
@@ -335,8 +347,10 @@
 	}
 
 	uart->res_base = request_region(io_base, 8, "Serial MIDI");
-	if (uart->res_base == NULL)
+	if (uart->res_base == NULL) {
+		snd_printk(KERN_ERR "u16550: can't grab port 0x%lx\n", io_base);
 		return -EBUSY;
+	}
 
 	ok = 1;			/* uart detected unless one of the following tests should fail */
 	/* 8 data-bits, 1 stop-bit, parity off, DLAB = 0 */
@@ -576,19 +590,31 @@
 	return 0;
 };
 
-inline static void snd_uart16550_write_buffer(snd_uart16550_t *uart, unsigned char byte)
+inline static int snd_uart16550_buffer_can_write( snd_uart16550_t *uart, int Num )
+{
+	if( uart->buff_in_count + Num < TX_BUFF_SIZE )
+		return 1;
+	else
+		return 0;
+}
+
+inline static int snd_uart16550_write_buffer(snd_uart16550_t *uart, unsigned char byte)
 {
 	unsigned short buff_in = uart->buff_in;
-	uart->tx_buff[buff_in] = byte;
-	buff_in++;
-	buff_in &= TX_BUFF_MASK;
-	uart->buff_in = buff_in;
-	uart->buff_in_count++;
-	if (uart->irq < 0) /* polling mode */
-		snd_uart16550_add_timer(uart); 
+	if( uart->buff_in_count < TX_BUFF_SIZE ) {
+		uart->tx_buff[buff_in] = byte;
+		buff_in++;
+		buff_in &= TX_BUFF_MASK;
+		uart->buff_in = buff_in;
+		uart->buff_in_count++;
+		if (uart->irq < 0) /* polling mode */
+			snd_uart16550_add_timer(uart);
+		return 1;
+	} else
+		return 0;
 }
 
-static void snd_uart16550_output_byte(snd_uart16550_t *uart, snd_rawmidi_substream_t * substream, unsigned char midi_byte)
+static int snd_uart16550_output_byte(snd_uart16550_t *uart, snd_rawmidi_substream_t * substream, unsigned char midi_byte)
 {
 	if (uart->buff_in_count == 0                            /* Buffer empty? */
 	    && ((uart->adaptor != SNDRV_SERIAL_MS124W_SA &&
@@ -611,13 +637,14 @@
 			}
 		}
 	} else {
-		if (uart->buff_in_count >= TX_BUFF_SIZE) {
+		if( !snd_uart16550_write_buffer(uart, midi_byte) ) {
 			snd_printk("%s: Buffer overrun on device at 0x%lx\n",
 				   uart->rmidi->name, uart->base);
-			return;
+			return 0;
 		}
-		snd_uart16550_write_buffer(uart, midi_byte);
 	}
+
+	return 1;
 }
 
 static void snd_uart16550_output_write(snd_rawmidi_substream_t * substream)
@@ -661,40 +688,38 @@
 		}
 	} else {
 		first = 0;
-		while (1) {
-			if (snd_rawmidi_transmit(substream, &midi_byte, 1) != 1)
-				break;
+		while( 1 == snd_rawmidi_transmit_peek(substream, &midi_byte, 1) ) {
 			/* Also send F5 after 3 seconds with no data to handle device disconnect */
 			if (first == 0 && (uart->adaptor == SNDRV_SERIAL_SOUNDCANVAS ||
 				uart->adaptor == SNDRV_SERIAL_GENERIC) &&
 			   (uart->prev_out != substream->number || jiffies-lasttime > 3*HZ)) {
 
-				/* We will need three bytes of data here (worst case). */
-				if (uart->buff_in_count >= TX_BUFF_SIZE - 3)
+				if( snd_uart16550_buffer_can_write( uart, 3 ) ) {
+					/* Roland Soundcanvas part selection */
+					/* If this substream of the data is different previous
+					   substream in this uart, send the change part event */
+					uart->prev_out = substream->number;
+					/* change part */
+					snd_uart16550_output_byte(uart, substream, 0xf5);
+					/* data */
+					snd_uart16550_output_byte(uart, substream, uart->prev_out + 1);
+					/* If midi_byte is a data byte, send the previous status byte */
+					if ((midi_byte < 0x80) && (uart->adaptor == SNDRV_SERIAL_SOUNDCANVAS))
+						snd_uart16550_output_byte(uart, substream, uart->prev_status[uart->prev_out]);
+				} else if( !uart->drop_on_full )
 					break;
 
-				/* Roland Soundcanvas part selection */
-				/* If this substream of the data is different previous
-				   substream in this uart, send the change part event */
-				uart->prev_out = substream->number;
-				/* change part */
-				snd_uart16550_output_byte(uart, substream, 0xf5);
-				/* data */
-				snd_uart16550_output_byte(uart, substream, uart->prev_out + 1);
-				/* If midi_byte is a data byte, send the previous status byte */
-				if ((midi_byte < 0x80) && (uart->adaptor == SNDRV_SERIAL_SOUNDCANVAS))
-					snd_uart16550_output_byte(uart, substream, uart->prev_status[uart->prev_out]);
 			}
 
-			/* buffer full? */
-			if (uart->buff_in_count >= TX_BUFF_SIZE)
+			/* send midi byte */
+			if( !snd_uart16550_output_byte(uart, substream, midi_byte) && !uart->drop_on_full )
 				break;
 
-			/* send midi byte */
-			snd_uart16550_output_byte(uart, substream, midi_byte);
 			if (midi_byte >= 0x80 && midi_byte < 0xf0)
 				uart->prev_status[uart->prev_out] = midi_byte;
 			first = 1;
+
+			snd_rawmidi_transmit_ack( substream, 1 );
 		}
 		lasttime = jiffies;
 	}
@@ -755,6 +780,7 @@
 				       unsigned int speed,
 				       unsigned int base,
 				       int adaptor,
+				       int droponfull,
 				       snd_uart16550_t **ruart)
 {
 	static snd_device_ops_t ops = {
@@ -771,6 +797,7 @@
 	spin_lock_init(&uart->open_lock);
 	uart->irq = -1;
 	uart->base = iobase;
+	uart->drop_on_full = droponfull;
 
 	if ((err = snd_uart16550_detect(uart)) <= 0) {
 		printk(KERN_ERR "no UART detected at 0x%lx\n", iobase);
@@ -900,6 +927,7 @@
 					speed[dev],
 					base[dev],
 					adaptor[dev],
+					droponfull[dev],
 					&uart)) < 0) {
 		snd_card_free(card);
 		return err;
@@ -910,7 +938,7 @@
 		return err;
 	}
 
-	sprintf(card->longname, "%s at 0x%lx, irq %d speed %d div %d outs %d ins %d adaptor %s",
+	sprintf(card->longname, "%s at 0x%lx, irq %d speed %d div %d outs %d ins %d adaptor %s droponfull %d",
 		card->shortname,
 		uart->base,
 		uart->irq,
@@ -918,7 +946,8 @@
 		(int)uart->divisor,
 		outs[dev],
 		ins[dev],
-		adaptor_names[uart->adaptor]);
+		adaptor_names[uart->adaptor],
+		uart->drop_on_full);
 
 	if ((err = snd_card_register(card)) < 0) {
 		snd_card_free(card);
@@ -964,7 +993,7 @@
 
 /* format is: snd-serial=enable,index,id,
 			 port,irq,speed,base,outs,
- 			 ins,adaptor */
+ 			 ins,adaptor,droponfull */
 
 static int __init alsa_card_serial_setup(char *str)
 {
@@ -975,13 +1004,14 @@
 	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
 	       get_option(&str,&index[nr_dev]) == 2 &&
 	       get_id(&str,&id[nr_dev]) == 2 &&
-	       get_option(&str,(int *)&port[nr_dev]) == 2 &&
+	       get_option_long(&str,&port[nr_dev]) == 2 &&
 	       get_option(&str,&irq[nr_dev]) == 2 &&
 	       get_option(&str,&speed[nr_dev]) == 2 &&
 	       get_option(&str,&base[nr_dev]) == 2 &&
 	       get_option(&str,&outs[nr_dev]) == 2 &&
 	       get_option(&str,&ins[nr_dev]) == 2 &&
-	       get_option(&str,&adaptor[nr_dev]) == 2);
+	       get_option(&str,&adaptor[nr_dev]) == 2 &&
+	       get_option(&str,&droponfull[nr_dev]) == 2 );
 	nr_dev++;
 	return 1;
 }
--- diff/sound/drivers/vx/vx_core.c	2003-08-20 14:16:34.000000000 +0100
+++ source/sound/drivers/vx/vx_core.c	2004-02-09 10:39:58.000000000 +0000
@@ -641,7 +641,7 @@
 	snd_info_entry_t *entry;
 
 	if (! snd_card_proc_new(chip->card, "vx-status", &entry))
-		snd_info_set_text_ops(entry, chip, vx_proc_read);
+		snd_info_set_text_ops(entry, chip, 1024, vx_proc_read);
 }
 
 
--- diff/sound/drivers/vx/vx_pcm.c	2003-06-30 10:07:24.000000000 +0100
+++ source/sound/drivers/vx/vx_pcm.c	2004-02-09 10:39:58.000000000 +0000
@@ -611,6 +611,10 @@
 	runtime->hw.period_bytes_min = chip->ibl.size;
 	runtime->private_data = pipe;
 
+	/* align to 4 bytes (otherwise will be problematic when 24bit is used) */ 
+	snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 4);
+	snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 4);
+
 	return 0;
 }
 
@@ -1015,6 +1019,10 @@
 	runtime->hw.period_bytes_min = chip->ibl.size;
 	runtime->private_data = pipe;
 
+	/* align to 4 bytes (otherwise will be problematic when 24bit is used) */ 
+	snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 4);
+	snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 4);
+
 	return 0;
 }
 
--- diff/sound/i2c/cs8427.c	2003-08-20 14:16:34.000000000 +0100
+++ source/sound/i2c/cs8427.c	2004-02-09 10:39:58.000000000 +0000
@@ -23,6 +23,7 @@
 #include <sound/driver.h>
 #include <linux/slab.h>
 #include <linux/delay.h>
+#include <linux/init.h>
 #include <sound/core.h>
 #include <sound/control.h>
 #include <sound/pcm.h>
@@ -558,6 +559,18 @@
 	return err < 0 ? err : 0;
 }
 
+static int __init alsa_cs8427_module_init(void)
+{
+	return 0;
+}
+
+static void __exit alsa_cs8427_module_exit(void)
+{
+}
+
+module_init(alsa_cs8427_module_init)
+module_exit(alsa_cs8427_module_exit)
+
 EXPORT_SYMBOL(snd_cs8427_detect);
 EXPORT_SYMBOL(snd_cs8427_create);
 EXPORT_SYMBOL(snd_cs8427_reset);
--- diff/sound/i2c/i2c.c	2003-06-09 14:18:21.000000000 +0100
+++ source/sound/i2c/i2c.c	2004-02-09 10:39:58.000000000 +0000
@@ -84,7 +84,7 @@
 	bus = (snd_i2c_bus_t *)snd_magic_kcalloc(snd_i2c_bus_t, 0, GFP_KERNEL);
 	if (bus == NULL)
 		return -ENOMEM;
-	spin_lock_init(&bus->lock);
+	init_MUTEX(&bus->lock_mutex);
 	INIT_LIST_HEAD(&bus->devices);
 	INIT_LIST_HEAD(&bus->buses);
 	bus->card = card;
--- diff/sound/i2c/l3/uda1341.c	2003-06-30 10:07:24.000000000 +0100
+++ source/sound/i2c/l3/uda1341.c	2004-02-09 10:39:58.000000000 +0000
@@ -17,7 +17,7 @@
  * 2002-05-12   Tomas Kasparek  another code cleanup
  */
 
-/* $Id: uda1341.c,v 1.9 2003/04/19 13:34:33 perex Exp $ */
+/* $Id: uda1341.c,v 1.10 2003/10/23 14:34:52 perex Exp $ */
 
 #include <sound/driver.h>
 #include <linux/module.h>
@@ -421,9 +421,9 @@
 	snd_info_entry_t *entry;
 
 	if (! snd_card_proc_new(card, "uda1341", &entry))
-		snd_info_set_text_ops(entry, clnt, snd_uda1341_proc_read);
+		snd_info_set_text_ops(entry, clnt, 1024, snd_uda1341_proc_read);
 	if (! snd_card_proc_new(card, "uda1341-regs", &entry))
-		snd_info_set_text_ops(entry, clnt, snd_uda1341_proc_regs_read);
+		snd_info_set_text_ops(entry, clnt, 1024, snd_uda1341_proc_regs_read);
 }
 
 /* }}} */
--- diff/sound/i2c/other/ak4xxx-adda.c	2003-09-30 15:46:21.000000000 +0100
+++ source/sound/i2c/other/ak4xxx-adda.c	2004-02-09 10:39:58.000000000 +0000
@@ -445,6 +445,18 @@
 	return 0;
 }
 
+static int __init alsa_akm4xxx_module_init(void)
+{
+	return 0;
+}
+        
+static void __exit alsa_akm4xxx_module_exit(void)
+{
+}
+        
+module_init(alsa_akm4xxx_module_init)
+module_exit(alsa_akm4xxx_module_exit)
+
 EXPORT_SYMBOL(snd_akm4xxx_write);
 EXPORT_SYMBOL(snd_akm4xxx_reset);
 EXPORT_SYMBOL(snd_akm4xxx_init);
--- diff/sound/isa/ad1816a/ad1816a.c	2003-08-20 14:16:34.000000000 +0100
+++ source/sound/isa/ad1816a/ad1816a.c	2004-02-09 10:39:58.000000000 +0000
@@ -210,6 +210,7 @@
 		snd_card_free(card);
 		return error;
 	}
+	snd_card_set_dev(card, &pcard->card->dev);
 
 	if ((error = snd_ad1816a_create(card, port[dev],
 					irq[dev],
@@ -220,6 +221,11 @@
 		return error;
 	}
 
+	strcpy(card->driver, "AD1816A");
+	strcpy(card->shortname, "ADI SoundPort AD1816A");
+	sprintf(card->longname, "%s, SS at 0x%lx, irq %d, dma %d&%d",
+		card->shortname, chip->port, irq[dev], dma1[dev], dma2[dev]);
+
 	if ((error = snd_ad1816a_pcm(chip, 0, NULL)) < 0) {
 		snd_card_free(card);
 		return error;
@@ -254,11 +260,6 @@
 		}
 	}
 
-	strcpy(card->driver, "AD1816A");
-	strcpy(card->shortname, "ADI SoundPort AD1816A");
-	sprintf(card->longname, "%s soundcard, SS at 0x%lx, irq %d, dma %d&%d",
-		card->shortname, chip->port, irq[dev], dma1[dev], dma2[dev]);
-
 	if ((error = snd_card_register(card)) < 0) {
 		snd_card_free(card);
 		return error;
@@ -338,9 +339,9 @@
 	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
 	       get_option(&str,&index[nr_dev]) == 2 &&
 	       get_id(&str,&id[nr_dev]) == 2 &&
-	       get_option(&str,(int *)&port[nr_dev]) == 2 &&
-	       get_option(&str,(int *)&mpu_port[nr_dev]) == 2 &&
-	       get_option(&str,(int *)&fm_port[nr_dev]) == 2 &&
+	       get_option_long(&str,&port[nr_dev]) == 2 &&
+	       get_option_long(&str,&mpu_port[nr_dev]) == 2 &&
+	       get_option_long(&str,&fm_port[nr_dev]) == 2 &&
 	       get_option(&str,&irq[nr_dev]) == 2 &&
 	       get_option(&str,&mpu_irq[nr_dev]) == 2 &&
 	       get_option(&str,&dma1[nr_dev]) == 2 &&
--- diff/sound/isa/ad1816a/ad1816a_lib.c	2003-05-21 11:50:17.000000000 +0100
+++ source/sound/isa/ad1816a/ad1816a_lib.c	2004-02-09 10:39:58.000000000 +0000
@@ -593,20 +593,24 @@
 	chip->dma2 = -1;
 
 	if ((chip->res_port = request_region(port, 16, "AD1816A")) == NULL) {
+		snd_printk(KERN_ERR "ad1816a: can't grab port 0x%lx\n", port);
 		snd_ad1816a_free(chip);
 		return -EBUSY;
 	}
 	if (request_irq(irq, snd_ad1816a_interrupt, SA_INTERRUPT, "AD1816A", (void *) chip)) {
+		snd_printk(KERN_ERR "ad1816a: can't grab IRQ %d\n", irq);
 		snd_ad1816a_free(chip);
 		return -EBUSY;
 	}
 	chip->irq = irq;
 	if (request_dma(dma1, "AD1816A - 1")) {
+		snd_printk(KERN_ERR "ad1816a: can't grab DMA1 %d\n", dma1);
 		snd_ad1816a_free(chip);
 		return -EBUSY;
 	}
 	chip->dma1 = dma1;
 	if (request_dma(dma2, "AD1816A - 2")) {
+		snd_printk(KERN_ERR "ad1816a: can't grab DMA2 %d\n", dma2);
 		snd_ad1816a_free(chip);
 		return -EBUSY;
 	}
--- diff/sound/isa/ad1848/ad1848.c	2003-08-20 14:16:34.000000000 +0100
+++ source/sound/isa/ad1848/ad1848.c	2004-02-09 10:39:58.000000000 +0000
@@ -174,7 +174,7 @@
 	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
 	       get_option(&str,&index[nr_dev]) == 2 &&
 	       get_id(&str,&id[nr_dev]) == 2 &&
-	       get_option(&str,(int *)&port[nr_dev]) == 2 &&
+	       get_option_long(&str,&port[nr_dev]) == 2 &&
 	       get_option(&str,&irq[nr_dev]) == 2 &&
 	       get_option(&str,&dma1[nr_dev]) == 2 &&
 	       get_option(&str,&thinkpad[nr_dev]) == 2);
--- diff/sound/isa/ad1848/ad1848_lib.c	2003-08-20 14:16:34.000000000 +0100
+++ source/sound/isa/ad1848/ad1848_lib.c	2004-02-09 10:39:58.000000000 +0000
@@ -736,11 +736,13 @@
 			snd_ad1848_out(chip, AD1848_RIGHT_INPUT, 0x45);
 			rev = snd_ad1848_in(chip, AD1848_RIGHT_INPUT);
 			if (rev == 0x65) {
+				spin_unlock_irqrestore(&chip->reg_lock, flags);
 				id = 1;
 				ad1847 = 1;
 				break;
 			}
 			if (snd_ad1848_in(chip, AD1848_LEFT_INPUT) == 0xaa && rev == 0x45) {
+				spin_unlock_irqrestore(&chip->reg_lock, flags);
 				id = 1;
 				break;
 			}
@@ -950,15 +952,18 @@
 	memcpy(&chip->image, &snd_ad1848_original_image, sizeof(snd_ad1848_original_image));
 	
 	if ((chip->res_port = request_region(port, 4, "AD1848")) == NULL) {
+		snd_printk(KERN_ERR "ad1848: can't grab port 0x%lx\n", port);
 		snd_ad1848_free(chip);
 		return -EBUSY;
 	}
 	if (request_irq(irq, snd_ad1848_interrupt, SA_INTERRUPT, "AD1848", (void *) chip)) {
+		snd_printk(KERN_ERR "ad1848: can't grab IRQ %d\n", irq);
 		snd_ad1848_free(chip);
 		return -EBUSY;
 	}
 	chip->irq = irq;
 	if (request_dma(dma, "AD1848")) {
+		snd_printk(KERN_ERR "ad1848: can't grab DMA %d\n", dma);
 		snd_ad1848_free(chip);
 		return -EBUSY;
 	}
--- diff/sound/isa/als100.c	2003-08-20 14:16:34.000000000 +0100
+++ source/sound/isa/als100.c	2004-02-09 10:39:58.000000000 +0000
@@ -228,6 +228,7 @@
 		snd_card_free(card);
 		return error;
 	}
+	snd_card_set_dev(card, &pcard->card->dev);
 
 	if ((error = snd_sbdsp_create(card, port[dev],
 				      irq[dev],
@@ -239,6 +240,12 @@
 		return error;
 	}
 
+	strcpy(card->driver, "ALS100");
+	strcpy(card->shortname, "Avance Logic ALS100");
+	sprintf(card->longname, "%s, %s at 0x%lx, irq %d, dma %d&%d",
+		card->shortname, chip->name, chip->port,
+		irq[dev], dma8[dev], dma16[dev]);
+
 	if ((error = snd_sb16dsp_pcm(chip, 0, NULL)) < 0) {
 		snd_card_free(card);
 		return error;
@@ -249,7 +256,7 @@
 		return error;
 	}
 
-	if (mpu_port[dev] > 0) {
+	if (mpu_port[dev] > 0 && mpu_port[dev] != SNDRV_AUTO_PORT) {
 		if (snd_mpu401_uart_new(card, 0, MPU401_HW_ALS100,
 					mpu_port[dev], 0, 
 					mpu_irq[dev], SA_INTERRUPT,
@@ -257,7 +264,7 @@
 			snd_printk(KERN_ERR PFX "no MPU-401 device at 0x%lx\n", mpu_port[dev]);
 	}
 
-	if (fm_port[dev] > 0) {
+	if (fm_port[dev] > 0 && fm_port[dev] != SNDRV_AUTO_PORT) {
 		if (snd_opl3_create(card,
 				    fm_port[dev], fm_port[dev] + 2,
 				    OPL3_HW_AUTO, 0, &opl3) < 0) {
@@ -275,11 +282,6 @@
 		}
 	}
 
-	strcpy(card->driver, "ALS100");
-	strcpy(card->shortname, "Avance Logic ALS100");
-	sprintf(card->longname, "%s soundcard, %s at 0x%lx, irq %d, dma %d&%d",
-		card->shortname, chip->name, chip->port,
-		irq[dev], dma8[dev], dma16[dev]);
 	if ((error = snd_card_register(card)) < 0) {
 		snd_card_free(card);
 		return error;
@@ -359,9 +361,9 @@
 	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
 	       get_option(&str,&index[nr_dev]) == 2 &&
 	       get_id(&str,&id[nr_dev]) == 2 &&
-	       get_option(&str,(int *)&port[nr_dev]) == 2 &&
-	       get_option(&str,(int *)&mpu_port[nr_dev]) == 2 &&
-	       get_option(&str,(int *)&fm_port[nr_dev]) == 2 &&
+	       get_option_long(&str,&port[nr_dev]) == 2 &&
+	       get_option_long(&str,&mpu_port[nr_dev]) == 2 &&
+	       get_option_long(&str,&fm_port[nr_dev]) == 2 &&
 	       get_option(&str,&irq[nr_dev]) == 2 &&
 	       get_option(&str,&mpu_irq[nr_dev]) == 2 &&
 	       get_option(&str,&dma8[nr_dev]) == 2 &&
--- diff/sound/isa/azt2320.c	2003-08-20 14:16:34.000000000 +0100
+++ source/sound/isa/azt2320.c	2004-02-09 10:39:58.000000000 +0000
@@ -255,6 +255,7 @@
 		snd_card_free(card);
 		return error;
 	}
+	snd_card_set_dev(card, &pcard->card->dev);
 
 	if ((error = snd_card_azt2320_enable_wss(port[dev]))) {
 		snd_card_free(card);
@@ -270,6 +271,11 @@
 		return error;
 	}
 
+	strcpy(card->driver, "AZT2320");
+	strcpy(card->shortname, "Aztech AZT2320");
+	sprintf(card->longname, "%s, WSS at 0x%lx, irq %i, dma %i&%i",
+		card->shortname, chip->port, irq[dev], dma1[dev], dma2[dev]);
+
 	if ((error = snd_cs4231_pcm(chip, 0, NULL)) < 0) {
 		snd_card_free(card);
 		return error;
@@ -283,7 +289,7 @@
 		return error;
 	}
 
-	if (mpu_port[dev] > 0) {
+	if (mpu_port[dev] > 0 && mpu_port[dev] != SNDRV_AUTO_PORT) {
 		if (snd_mpu401_uart_new(card, 0, MPU401_HW_AZT2320,
 				mpu_port[dev], 0,
 				mpu_irq[dev], SA_INTERRUPT,
@@ -291,7 +297,7 @@
 			snd_printk(KERN_ERR PFX "no MPU-401 device at 0x%lx\n", mpu_port[dev]);
 	}
 
-	if (fm_port[dev] > 0) {
+	if (fm_port[dev] > 0 && fm_port[dev] != SNDRV_AUTO_PORT) {
 		if (snd_opl3_create(card,
 				    fm_port[dev], fm_port[dev] + 2,
 				    OPL3_HW_AUTO, 0, &opl3) < 0) {
@@ -309,11 +315,6 @@
 		}
 	}
 
-	strcpy(card->driver, "AZT2320");
-	strcpy(card->shortname, "Aztech AZT2320");
-	sprintf(card->longname, "%s soundcard, WSS at 0x%lx, irq %i, dma %i&%i",
-		card->shortname, chip->port, irq[dev], dma1[dev], dma2[dev]);
-
 	if ((error = snd_card_register(card)) < 0) {
 		snd_card_free(card);
 		return error;
@@ -393,9 +394,9 @@
 	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
 	       get_option(&str,&index[nr_dev]) == 2 &&
 	       get_id(&str,&id[nr_dev]) == 2 &&
-	       get_option(&str,(int *)&port[nr_dev]) == 2 &&
-	       get_option(&str,(int *)&wss_port[nr_dev]) == 2 &&
-	       get_option(&str,(int *)&mpu_port[nr_dev]) == 2 &&
+	       get_option_long(&str,&port[nr_dev]) == 2 &&
+	       get_option_long(&str,&wss_port[nr_dev]) == 2 &&
+	       get_option_long(&str,&mpu_port[nr_dev]) == 2 &&
 	       get_option(&str,&irq[nr_dev]) == 2 &&
 	       get_option(&str,&mpu_irq[nr_dev]) == 2 &&
 	       get_option(&str,&dma1[nr_dev]) == 2 &&
--- diff/sound/isa/cmi8330.c	2003-08-20 14:16:34.000000000 +0100
+++ source/sound/isa/cmi8330.c	2004-02-09 10:39:58.000000000 +0000
@@ -481,10 +481,13 @@
 	acard->card = card;
 
 #ifdef CONFIG_PNP
-	if (isapnp[dev] && (err = snd_cmi8330_pnp(dev, acard, pcard, pid)) < 0) {
-		snd_printk("PnP detection failed\n");
-		snd_card_free(card);
-		return err;
+	if (isapnp[dev]) {
+		if ((err = snd_cmi8330_pnp(dev, acard, pcard, pid)) < 0) {
+			snd_printk("PnP detection failed\n");
+			snd_card_free(card);
+			return err;
+		}
+		snd_card_set_dev(card, &pcard->card->dev);
 	}
 #endif
 
@@ -658,11 +661,11 @@
 	       get_option(&str,&index[nr_dev]) == 2 &&
 	       get_id(&str,&id[nr_dev]) == 2 &&
 	       get_option(&str,&pnp) == 2 &&
-	       get_option(&str,(int *)&sbport[nr_dev]) == 2 &&
+	       get_option_long(&str,&sbport[nr_dev]) == 2 &&
 	       get_option(&str,&sbirq[nr_dev]) == 2 &&
 	       get_option(&str,&sbdma8[nr_dev]) == 2 &&
 	       get_option(&str,&sbdma16[nr_dev]) == 2 &&
-	       get_option(&str,(int *)&wssport[nr_dev]) == 2 &&
+	       get_option_long(&str,&wssport[nr_dev]) == 2 &&
 	       get_option(&str,&wssirq[nr_dev]) == 2 &&
 	       get_option(&str,&wssdma[nr_dev]) == 2);
 #ifdef CONFIG_PNP
--- diff/sound/isa/cs423x/cs4231.c	2002-11-11 11:09:38.000000000 +0000
+++ source/sound/isa/cs423x/cs4231.c	2004-02-09 10:39:58.000000000 +0000
@@ -103,8 +103,6 @@
 	if (card == NULL)
 		return -ENOMEM;
 	acard = (struct snd_card_cs4231 *)card->private_data;
-	if (mpu_port[dev] < 0)
-		mpu_port[dev] = SNDRV_AUTO_PORT;
 	if ((err = snd_cs4231_create(card, port[dev], -1,
 				     irq[dev],
 				     dma1[dev],
@@ -119,6 +117,14 @@
 		snd_card_free(card);
 		return err;
 	}
+
+	strcpy(card->driver, "CS4231");
+	strcpy(card->shortname, pcm->name);
+	sprintf(card->longname, "%s at 0x%lx, irq %d, dma %d",
+		pcm->name, chip->port, irq[dev], dma1[dev]);
+	if (dma2[dev] >= 0)
+		sprintf(card->longname + strlen(card->longname), "&%d", dma2[dev]);
+
 	if ((err = snd_cs4231_mixer(chip)) < 0) {
 		snd_card_free(card);
 		return err;
@@ -128,19 +134,16 @@
 		return err;
 	}
 
-	if (mpu_irq[dev] >= 0 && mpu_irq[dev] != SNDRV_AUTO_IRQ) {
+	if (mpu_port[dev] > 0 && mpu_port[dev] != SNDRV_AUTO_PORT) {
+		if (mpu_irq[dev] == SNDRV_AUTO_IRQ)
+			mpu_irq[dev] = -1;
 		if (snd_mpu401_uart_new(card, 0, MPU401_HW_CS4232,
 					mpu_port[dev], 0,
-					mpu_irq[dev], SA_INTERRUPT,
+					mpu_irq[dev],
+					mpu_irq[dev] >= 0 ? SA_INTERRUPT : 0,
 					NULL) < 0)
 			printk(KERN_ERR "cs4231: MPU401 not detected\n");
 	}
-	strcpy(card->driver, "CS4231");
-	strcpy(card->shortname, pcm->name);
-	sprintf(card->longname, "%s at 0x%lx, irq %d, dma %d",
-		pcm->name, chip->port, irq[dev], dma1[dev]);
-	if (dma2[dev] >= 0)
-		sprintf(card->longname + strlen(card->longname), "&%d", dma2[dev]);
 	if ((err = snd_card_register(card)) < 0) {
 		snd_card_free(card);
 		return err;
@@ -194,8 +197,8 @@
 	       get_option(&str,&index[nr_dev]) == 2 &&
 	       get_id(&str,&id[nr_dev]) == 2 &&
 	       get_option(&str,&pnp) == 2 &&
-	       get_option(&str,(int *)&port[nr_dev]) == 2 &&
-	       get_option(&str,(int *)&mpu_port[nr_dev]) == 2 &&
+	       get_option_long(&str,&port[nr_dev]) == 2 &&
+	       get_option_long(&str,&mpu_port[nr_dev]) == 2 &&
 	       get_option(&str,&irq[nr_dev]) == 2 &&
 	       get_option(&str,&mpu_irq[nr_dev]) == 2 &&
 	       get_option(&str,&dma1[nr_dev]) == 2 &&
--- diff/sound/isa/cs423x/cs4231_lib.c	2003-08-20 14:16:34.000000000 +0100
+++ source/sound/isa/cs423x/cs4231_lib.c	2004-02-09 10:39:58.000000000 +0000
@@ -1531,26 +1531,31 @@
 	chip->dma2 = -1;
 
 	if ((chip->res_port = request_region(port, 4, "CS4231")) == NULL) {
+		snd_printk(KERN_ERR "cs4231: can't grab port 0x%lx\n", port);
 		snd_cs4231_free(chip);
 		return -EBUSY;
 	}
 	chip->port = port;
 	if ((long)cport >= 0 && (chip->res_cport = request_region(cport, 8, "CS4232 Control")) == NULL) {
+		snd_printk(KERN_ERR "cs4231: can't grab control port 0x%lx\n", cport);
 		snd_cs4231_free(chip);
 		return -ENODEV;
 	}
 	chip->cport = cport;
 	if (!(hwshare & CS4231_HWSHARE_IRQ) && request_irq(irq, snd_cs4231_interrupt, SA_INTERRUPT, "CS4231", (void *) chip)) {
+		snd_printk(KERN_ERR "cs4231: can't grab IRQ %d\n", irq);
 		snd_cs4231_free(chip);
 		return -EBUSY;
 	}
 	chip->irq = irq;
 	if (!(hwshare & CS4231_HWSHARE_DMA1) && request_dma(dma1, "CS4231 - 1")) {
+		snd_printk(KERN_ERR "cs4231: can't grab DMA1 %d\n", dma1);
 		snd_cs4231_free(chip);
 		return -EBUSY;
 	}
 	chip->dma1 = dma1;
 	if (!(hwshare & CS4231_HWSHARE_DMA2) && dma1 != dma2 && dma2 >= 0 && request_dma(dma2, "CS4231 - 2")) {
+		snd_printk(KERN_ERR "cs4231: can't grab DMA2 %d\n", dma2);
 		snd_cs4231_free(chip);
 		return -EBUSY;
 	}
--- diff/sound/isa/cs423x/cs4236.c	2003-09-30 15:46:21.000000000 +0100
+++ source/sound/isa/cs423x/cs4236.c	2004-02-09 10:39:58.000000000 +0000
@@ -307,7 +307,7 @@
 	pnp_init_resource_table(cfg);
 	if (port[dev] != SNDRV_AUTO_PORT)
 		pnp_resource_change(&cfg->port_resource[0], port[dev], 4);
-	if (fm_port[dev] != SNDRV_AUTO_PORT && fm_port[dev] >= 0)
+	if (fm_port[dev] != SNDRV_AUTO_PORT && fm_port[dev] > 0)
 		pnp_resource_change(&cfg->port_resource[1], fm_port[dev], 4);
 	if (sb_port[dev] != SNDRV_AUTO_PORT)
 		pnp_resource_change(&cfg->port_resource[2], sb_port[dev], 16);
@@ -327,7 +327,7 @@
 		return -EBUSY;
 	}
 	port[dev] = pnp_port_start(pdev, 0);
-	if (fm_port[dev] >= 0)
+	if (fm_port[dev] > 0)
 		fm_port[dev] = pnp_port_start(pdev, 1);
 	sb_port[dev] = pnp_port_start(pdev, 2);
 	irq[dev] = pnp_irq(pdev, 0);
@@ -338,7 +338,7 @@
 	snd_printdd("isapnp WSS: irq=%i, dma1=%i, dma2=%i\n",
 			irq[dev], dma1[dev], dma2[dev]);
 	/* CTRL initialization */
-	if (acard->ctrl && cport[dev] >= 0) {
+	if (acard->ctrl && cport[dev] > 0) {
 		pdev = acard->ctrl;
 		pnp_init_resource_table(cfg);
 		if (cport[dev] != SNDRV_AUTO_PORT)
@@ -356,12 +356,13 @@
 		snd_printdd("isapnp CTRL: control port=0x%lx\n", cport[dev]);
 	}
 	/* MPU initialization */
-	if (acard->mpu && mpu_port[dev] >= 0) {
+	if (acard->mpu && mpu_port[dev] > 0) {
 		pdev = acard->mpu;
 		pnp_init_resource_table(cfg);
 		if (mpu_port[dev] != SNDRV_AUTO_PORT)
 			pnp_resource_change(&cfg->port_resource[0], mpu_port[dev], 2);
-		if (mpu_irq[dev] != SNDRV_AUTO_IRQ && mpu_irq[dev] >= 0)
+		if (mpu_irq[dev] != SNDRV_AUTO_IRQ && mpu_irq[dev] >= 0 &&
+		    pnp_irq_valid(pdev, 0))
 			pnp_resource_change(&cfg->irq_resource[0], mpu_irq[dev], 1);
 		err = pnp_manual_config_dev(pdev, cfg, 0);
 		if (err < 0)
@@ -373,7 +374,8 @@
 			mpu_irq[dev] = SNDRV_AUTO_IRQ;
 		} else {
 			mpu_port[dev] = pnp_port_start(pdev, 0);
-			if (pnp_irq_valid(pdev, 0) && pnp_irq(pdev, 0) >= 0) {
+			if (mpu_irq[dev] >= 0 &&
+			    pnp_irq_valid(pdev, 0) && pnp_irq(pdev, 0) >= 0) {
 				mpu_irq[dev] = pnp_irq(pdev, 0);
 			} else {
 				mpu_irq[dev] = -1;	/* disable interrupt */
@@ -429,19 +431,16 @@
 	acard = (struct snd_card_cs4236 *)card->private_data;
 	card->private_free = snd_card_cs4236_free;
 #ifdef CONFIG_PNP
-	if (isapnp[dev] && (err = snd_card_cs4236_pnp(dev, acard, pcard, pid))<0) {
-		printk(KERN_ERR "isapnp detection failed and probing for " IDENT " is not supported\n");
-		snd_card_free(card);
-		return -ENXIO;
+	if (isapnp[dev]) {
+		if ((err = snd_card_cs4236_pnp(dev, acard, pcard, pid))<0) {
+			printk(KERN_ERR "isapnp detection failed and probing for " IDENT " is not supported\n");
+			snd_card_free(card);
+			return -ENXIO;
+		}
+		snd_card_set_dev(card, &pcard->card->dev);
 	}
 #endif
-	if (mpu_port[dev] < 0)
-		mpu_port[dev] = SNDRV_AUTO_PORT;
-	if (fm_port[dev] < 0)
-		fm_port[dev] = SNDRV_AUTO_PORT;
-	if (sb_port[dev] < 0)
-		sb_port[dev] = SNDRV_AUTO_PORT;
-	if (sb_port[dev] != SNDRV_AUTO_PORT)
+	if (sb_port[dev] > 0 && sb_port[dev] != SNDRV_AUTO_PORT)
 		if ((acard->res_sb_port = request_region(sb_port[dev], 16, IDENT " SB")) == NULL) {
 			printk(KERN_ERR IDENT ": unable to register SB port at 0x%lx\n", sb_port[dev]);
 			snd_card_free(card);
@@ -492,13 +491,22 @@
 		return err;
 	}
 #endif
+	strcpy(card->driver, pcm->name);
+	strcpy(card->shortname, pcm->name);
+	sprintf(card->longname, "%s at 0x%lx, irq %i, dma %i",
+		pcm->name,
+		chip->port,
+		irq[dev],
+		dma1[dev]);
+	if (dma2[dev] >= 0)
+		sprintf(card->longname + strlen(card->longname), "&%d", dma2[dev]);
 
 	if ((err = snd_cs4231_timer(chip, 0, NULL)) < 0) {
 		snd_card_free(card);
 		return err;
 	}
 
-	if (fm_port[dev] != SNDRV_AUTO_PORT) {
+	if (fm_port[dev] > 0 && fm_port[dev] != SNDRV_AUTO_PORT) {
 		if (snd_opl3_create(card,
 				    fm_port[dev], fm_port[dev] + 2,
 				    OPL3_HW_OPL3_CS, 0, &opl3) < 0) {
@@ -511,22 +519,15 @@
 		}
 	}
 
-	if (mpu_port[dev] != SNDRV_AUTO_PORT) {
+	if (mpu_port[dev] > 0 && mpu_port[dev] != SNDRV_AUTO_PORT) {
+		if (mpu_irq[dev] == SNDRV_AUTO_IRQ)
+			mpu_irq[dev] = -1;
 		if (snd_mpu401_uart_new(card, 0, MPU401_HW_CS4232,
 					mpu_port[dev], 0,
 					mpu_irq[dev],
 					mpu_irq[dev] >= 0 ? SA_INTERRUPT : 0, NULL) < 0)
 			printk(KERN_ERR IDENT ": MPU401 not detected\n");
 	}
-	strcpy(card->driver, pcm->name);
-	strcpy(card->shortname, pcm->name);
-	sprintf(card->longname, "%s at 0x%lx, irq %i, dma %i",
-		pcm->name,
-		chip->port,
-		irq[dev],
-		dma1[dev]);
-	if (dma2[dev] >= 0)
-		sprintf(card->longname + strlen(card->longname), "&%d", dma2[dev]);
 	if ((err = snd_card_register(card)) < 0) {
 		snd_card_free(card);
 		return err;
@@ -546,7 +547,7 @@
 	int res;
 
 	for ( ; dev < SNDRV_CARDS; dev++) {
-		if (!enable[dev])
+		if (!enable[dev] || !isapnp[dev])
 			continue;
 		res = snd_card_cs423x_probe(dev, card, id);
 		if (res < 0)
@@ -638,11 +639,11 @@
 	       get_option(&str,&index[nr_dev]) == 2 &&
 	       get_id(&str,&id[nr_dev]) == 2 &&
 	       get_option(&str,&pnp) == 2 &&
-	       get_option(&str,(int *)&port[nr_dev]) == 2 &&
-	       get_option(&str,(int *)&cport[nr_dev]) == 2 &&
-	       get_option(&str,(int *)&mpu_port[nr_dev]) == 2 &&
-	       get_option(&str,(int *)&fm_port[nr_dev]) == 2 &&
-	       get_option(&str,(int *)&sb_port[nr_dev]) == 2 &&
+	       get_option_long(&str,&port[nr_dev]) == 2 &&
+	       get_option_long(&str,&cport[nr_dev]) == 2 &&
+	       get_option_long(&str,&mpu_port[nr_dev]) == 2 &&
+	       get_option_long(&str,&fm_port[nr_dev]) == 2 &&
+	       get_option_long(&str,&sb_port[nr_dev]) == 2 &&
 	       get_option(&str,&irq[nr_dev]) == 2 &&
 	       get_option(&str,&mpu_irq[nr_dev]) == 2 &&
 	       get_option(&str,&dma1[nr_dev]) == 2 &&
--- diff/sound/isa/cs423x/pc98.c	2003-09-30 15:46:21.000000000 +0100
+++ source/sound/isa/cs423x/pc98.c	2004-02-09 10:39:58.000000000 +0000
@@ -327,10 +327,6 @@
 	card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
 	if (card == NULL)
 		return -ENOMEM;
-	if (mpu_port[dev] < 0 || mpu_irq[dev] < 0)
-		mpu_port[dev] = SNDRV_AUTO_PORT;
-	if (fm_port[dev] < 0)
-		fm_port[dev] = SNDRV_AUTO_PORT;
 
 	if ((err = pc98_cs4231_chip_init(dev)) < 0) {
 		snd_card_free(card);
@@ -363,7 +359,7 @@
 		return err;
 	}
 
-	if (fm_port[dev] != SNDRV_AUTO_PORT) {
+	if (fm_port[dev] > 0 && fm_port[dev] != SNDRV_AUTO_PORT) {
 		/* ??? */
 		outb(0x00, fm_port[dev] + 6);
 		inb(fm_port[dev] + 7);
@@ -381,7 +377,7 @@
 		}
 	}
 
-	if (mpu_port[dev] != SNDRV_AUTO_PORT) {
+	if (mpu_port[dev] > 0 && mpu_port[dev] != SNDRV_AUTO_PORT) {
 		err = pc98_mpu401_init(mpu_irq[dev]);
 		if (! err) {
 			err = snd_mpu401_uart_new(card, 0,
@@ -455,9 +451,9 @@
 	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
 	       get_option(&str,&index[nr_dev]) == 2 &&
 	       get_id(&str,&id[nr_dev]) == 2 &&
-	       get_option(&str,(int *)&port[nr_dev]) == 2 &&
-	       get_option(&str,(int *)&mpu_port[nr_dev]) == 2 &&
-	       get_option(&str,(int *)&fm_port[nr_dev]) == 2 &&
+	       get_option_long(&str,&port[nr_dev]) == 2 &&
+	       get_option_long(&str,&mpu_port[nr_dev]) == 2 &&
+	       get_option_long(&str,&fm_port[nr_dev]) == 2 &&
 	       get_option(&str,&irq[nr_dev]) == 2 &&
 	       get_option(&str,&mpu_irq[nr_dev]) == 2 &&
 	       get_option(&str,&dma1[nr_dev]) == 2 &&
--- diff/sound/isa/dt019x.c	2003-08-20 14:16:34.000000000 +0100
+++ source/sound/isa/dt019x.c	2004-02-09 10:39:58.000000000 +0000
@@ -210,6 +210,7 @@
 		return -ENOMEM;
 	acard = (struct snd_card_dt019x *)card->private_data;
 
+	snd_card_set_dev(card, &pcard->card->dev);
 	if ((error = snd_card_dt019x_pnp(dev, acard, pcard, pid))) {
 		snd_card_free(card);
 		return error;
@@ -226,6 +227,12 @@
 		return error;
 	}
 
+	strcpy(card->driver, "DT-019X");
+	strcpy(card->shortname, "Diamond Tech. DT-019X");
+	sprintf(card->longname, "%s, %s at 0x%lx, irq %d, dma %d",
+		card->shortname, chip->name, chip->port,
+		irq[dev], dma8[dev]);
+
 	if ((error = snd_sb16dsp_pcm(chip, 0, NULL)) < 0) {
 		snd_card_free(card);
 		return error;
@@ -235,18 +242,20 @@
 		return error;
 	}
 
-	if (mpu_port[dev] > 0) {
+	if (mpu_port[dev] > 0 && mpu_port[dev] != SNDRV_AUTO_PORT) {
+		if (mpu_irq[dev] == SNDRV_AUTO_IRQ)
+			mpu_irq[dev] = -1;
 		if (snd_mpu401_uart_new(card, 0,
 /*					MPU401_HW_SB,*/
 					MPU401_HW_MPU401,
 					mpu_port[dev], 0,
 					mpu_irq[dev],
-					SA_INTERRUPT,
+					mpu_irq[dev] >= 0 ? SA_INTERRUPT : 0,
 					NULL) < 0)
 			snd_printk(KERN_ERR PFX "no MPU-401 device at 0x%lx ?\n", mpu_port[dev]);
 	}
 
-	if (fm_port[dev] > 0) {
+	if (fm_port[dev] > 0 && fm_port[dev] != SNDRV_AUTO_PORT) {
 		if (snd_opl3_create(card,
 				    fm_port[dev],
 				    fm_port[dev] + 2,
@@ -265,11 +274,6 @@
 		}
 	}
 
-	strcpy(card->driver, "DT-019X");
-	strcpy(card->shortname, "Diamond Tech. DT-019X");
-	sprintf(card->longname, "%s soundcard, %s at 0x%lx, irq %d, dma %d",
-		card->shortname, chip->name, chip->port,
-		irq[dev], dma8[dev]);
 	if ((error = snd_card_register(card)) < 0) {
 		snd_card_free(card);
 		return error;
@@ -347,9 +351,9 @@
 	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
 	       get_option(&str,&index[nr_dev]) == 2 &&
 	       get_id(&str,&id[nr_dev]) == 2 &&
-	       get_option(&str,(int *)&port[nr_dev]) == 2 &&
-	       get_option(&str,(int *)&mpu_port[nr_dev]) == 2 &&
-	       get_option(&str,(int *)&fm_port[nr_dev]) == 2 &&
+	       get_option_long(&str,&port[nr_dev]) == 2 &&
+	       get_option_long(&str,&mpu_port[nr_dev]) == 2 &&
+	       get_option_long(&str,&fm_port[nr_dev]) == 2 &&
 	       get_option(&str,&irq[nr_dev]) == 2 &&
 	       get_option(&str,&mpu_irq[nr_dev]) == 2 &&
 	       get_option(&str,&dma8[nr_dev]) == 2);
--- diff/sound/isa/es1688/es1688.c	2002-11-11 11:09:38.000000000 +0000
+++ source/sound/isa/es1688/es1688.c	2004-02-09 10:39:58.000000000 +0000
@@ -130,6 +130,10 @@
 		return err;
 	}
 
+	strcpy(card->driver, "ES1688");
+	strcpy(card->shortname, pcm->name);
+	sprintf(card->longname, "%s at 0x%lx, irq %i, dma %i", pcm->name, chip->port, xirq, xdma);
+
 	if ((snd_opl3_create(card, chip->port, chip->port + 2, OPL3_HW_OPL3, 0, &opl3)) < 0) {
 		printk(KERN_ERR "es1688: opl3 not detected at 0x%lx\n", chip->port);
 	} else {
@@ -149,9 +153,6 @@
 			return err;
 		}
 	}
-	strcpy(card->driver, "ES1688");
-	strcpy(card->shortname, pcm->name);
-	sprintf(card->longname, "%s at 0x%lx, irq %i, dma %i", pcm->name, chip->port, xirq, xdma);
 	if ((err = snd_card_register(card)) < 0) {
 		snd_card_free(card);
 		return err;
@@ -226,8 +227,8 @@
 	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
 	       get_option(&str,&index[nr_dev]) == 2 &&
 	       get_id(&str,&id[nr_dev]) == 2 &&
-	       get_option(&str,(int *)&port[nr_dev]) == 2 &&
-	       get_option(&str,(int *)&mpu_port[nr_dev]) == 2 &&
+	       get_option_long(&str,&port[nr_dev]) == 2 &&
+	       get_option_long(&str,&mpu_port[nr_dev]) == 2 &&
 	       get_option(&str,&irq[nr_dev]) == 2 &&
 	       get_option(&str,&mpu_irq[nr_dev]) == 2 &&
 	       get_option(&str,&dma8[nr_dev]) == 2);
--- diff/sound/isa/es1688/es1688_lib.c	2003-05-21 11:50:17.000000000 +0100
+++ source/sound/isa/es1688/es1688_lib.c	2004-02-09 10:39:58.000000000 +0000
@@ -659,15 +659,18 @@
 	chip->dma8 = -1;
 	
 	if ((chip->res_port = request_region(port + 4, 12, "ES1688")) == NULL) {
+		snd_printk(KERN_ERR "es1688: can't grab port 0x%lx\n", port + 4);
 		snd_es1688_free(chip);
 		return -EBUSY;
 	}
 	if (request_irq(irq, snd_es1688_interrupt, SA_INTERRUPT, "ES1688", (void *) chip)) {
+		snd_printk(KERN_ERR "es1688: can't grab IRQ %d\n", irq);
 		snd_es1688_free(chip);
 		return -EBUSY;
 	}
 	chip->irq = irq;
 	if (request_dma(dma8, "ES1688")) {
+		snd_printk(KERN_ERR "es1688: can't grab DMA8 %d\n", dma8);
 		snd_es1688_free(chip);
 		return -EBUSY;
 	}
--- diff/sound/isa/es18xx.c	2003-08-20 14:16:34.000000000 +0100
+++ source/sound/isa/es18xx.c	2004-02-09 10:39:58.000000000 +0000
@@ -1471,8 +1471,10 @@
 		chip->ctrl_port = inb(chip->port + 0x05) << 8;
 		chip->ctrl_port += inb(chip->port + 0x05);
 
-		if ((chip->res_ctrl_port = request_region(chip->ctrl_port, 8, "ES18xx - CTRL")) == NULL)
+		if ((chip->res_ctrl_port = request_region(chip->ctrl_port, 8, "ES18xx - CTRL")) == NULL) {
+			snd_printk(KERN_ERR PFX "unable go grab port 0x%lx\n", chip->ctrl_port);
 			return -EBUSY;
+		}
 
 		return 0;
 	}
@@ -2056,9 +2058,12 @@
 		return -ENOMEM;
 	acard = (struct snd_audiodrive *)card->private_data;
 #ifdef CONFIG_PNP
-	if (isapnp[dev] && (err = snd_audiodrive_pnp(dev, acard, pcard, pid)) < 0) {
-		snd_card_free(card);
-		return err;
+	if (isapnp[dev]) {
+		if ((err = snd_audiodrive_pnp(dev, acard, pcard, pid)) < 0) {
+			snd_card_free(card);
+			return err;
+		}
+		snd_card_set_dev(card, &pcard->card->dev);
 	}
 #endif
 
@@ -2096,6 +2101,20 @@
 		snd_card_free(card);
 		return err;
 	}
+
+	sprintf(card->driver, "ES%x", chip->version);
+	sprintf(card->shortname, "ESS AudioDrive ES%x", chip->version);
+	if (xdma1 != xdma2)
+		sprintf(card->longname, "%s at 0x%lx, irq %d, dma1 %d, dma2 %d",
+			card->shortname,
+			chip->port,
+			xirq, xdma1, xdma2);
+	else
+		sprintf(card->longname, "%s at 0x%lx, irq %d, dma %d",
+			card->shortname,
+			chip->port,
+			xirq, xdma1);
+
 	if ((err = snd_es18xx_pcm(chip, 0, NULL)) < 0) {
 		snd_card_free(card);
 		return err;
@@ -2137,18 +2156,6 @@
 		card->power_state_private_data = chip;
 	}
 #endif
-	sprintf(card->driver, "ES%x", chip->version);
-	sprintf(card->shortname, "ESS AudioDrive ES%x", chip->version);
-	if (xdma1 != xdma2)
-		sprintf(card->longname, "%s at 0x%lx, irq %d, dma1 %d, dma2 %d",
-			card->shortname,
-			chip->port,
-			xirq, xdma1, xdma2);
-	else
-		sprintf(card->longname, "%s at 0x%lx, irq %d, dma %d",
-			card->shortname,
-			chip->port,
-			xirq, xdma1);
 	if ((err = snd_card_register(card)) < 0) {
 		snd_card_free(card);
 		return err;
@@ -2286,9 +2293,9 @@
 	       get_option(&str,&index[nr_dev]) == 2 &&
 	       get_id(&str,&id[nr_dev]) == 2 &&
 	       get_option(&str,&pnp) == 2 &&
-	       get_option(&str,(int *)&port[nr_dev]) == 2 &&
-	       get_option(&str,(int *)&mpu_port[nr_dev]) == 2 &&
-	       get_option(&str,(int *)&fm_port[nr_dev]) == 2 &&
+	       get_option_long(&str,&port[nr_dev]) == 2 &&
+	       get_option_long(&str,&mpu_port[nr_dev]) == 2 &&
+	       get_option_long(&str,&fm_port[nr_dev]) == 2 &&
 	       get_option(&str,&irq[nr_dev]) == 2 &&
 	       get_option(&str,&dma1[nr_dev]) == 2 &&
 	       get_option(&str,&dma2[nr_dev]) == 2);
--- diff/sound/isa/gus/gus_irq.c	2003-06-30 10:07:24.000000000 +0100
+++ source/sound/isa/gus/gus_irq.c	2004-02-09 10:39:58.000000000 +0000
@@ -136,7 +136,7 @@
 	snd_info_entry_t *entry;
 
 	if (! snd_card_proc_new(gus->card, "gusirq", &entry))
-		snd_info_set_text_ops(entry, gus, snd_gus_irq_info_read);
+		snd_info_set_text_ops(entry, gus, 1024, snd_gus_irq_info_read);
 }
 
 #endif
--- diff/sound/isa/gus/gus_main.c	2003-08-20 14:16:34.000000000 +0100
+++ source/sound/isa/gus/gus_main.c	2004-02-09 10:39:58.000000000 +0000
@@ -178,25 +178,30 @@
 	gus->gf1.reg_timerdata = GUSP(gus, TIMERDATA);
 	/* allocate resources */
 	if ((gus->gf1.res_port1 = request_region(port, 16, "GUS GF1 (Adlib/SB)")) == NULL) {
+		snd_printk(KERN_ERR "gus: can't grab SB port 0x%lx\n", port);
 		snd_gus_free(gus);
 		return -EBUSY;
 	}
 	if ((gus->gf1.res_port2 = request_region(port + 0x100, 12, "GUS GF1 (Synth)")) == NULL) {
+		snd_printk(KERN_ERR "gus: can't grab synth port 0x%lx\n", port + 0x100);
 		snd_gus_free(gus);
 		return -EBUSY;
 	}
 	if (irq >= 0 && request_irq(irq, snd_gus_interrupt, SA_INTERRUPT, "GUS GF1", (void *) gus)) {
+		snd_printk(KERN_ERR "gus: can't grab irq %d\n", irq);
 		snd_gus_free(gus);
 		return -EBUSY;
 	}
 	gus->gf1.irq = irq;
 	if (request_dma(dma1, "GUS - 1")) {
+		snd_printk(KERN_ERR "gus: can't grab DMA1 %d\n", dma1);
 		snd_gus_free(gus);
 		return -EBUSY;
 	}
 	gus->gf1.dma1 = dma1;
 	if (dma2 >= 0 && dma1 != dma2) {
 		if (request_dma(dma2, "GUS - 2")) {
+			snd_printk(KERN_ERR "gus: can't grab DMA2 %d\n", dma2);
 			snd_gus_free(gus);
 			return -EBUSY;
 		}
--- diff/sound/isa/gus/gus_mem.c	2003-02-13 11:46:57.000000000 +0000
+++ source/sound/isa/gus/gus_mem.c	2004-02-09 10:39:58.000000000 +0000
@@ -265,7 +265,7 @@
 		return -ENOMEM;
 #ifdef CONFIG_SND_DEBUG
 	if (! snd_card_proc_new(gus->card, "gusmem", &entry)) {
-		snd_info_set_text_ops(entry, gus, snd_gf1_mem_info_read);
+		snd_info_set_text_ops(entry, gus, 1024, snd_gf1_mem_info_read);
 		entry->c.text.read_size = 256 * 1024;
 	}
 #endif
--- diff/sound/isa/gus/gus_pcm.c	2003-05-21 11:49:56.000000000 +0100
+++ source/sound/isa/gus/gus_pcm.c	2004-02-09 10:39:58.000000000 +0000
@@ -334,9 +334,11 @@
 					snd_gf1_poke(gus, pos++, *buf++ ^ invert);
 			}
 		}
-		schedule_timeout(1);
-		if (signal_pending(current))
-			return -EAGAIN;
+		if (count > 0 && !in_interrupt()) {
+			schedule_timeout(1);
+			if (signal_pending(current))
+				return -EAGAIN;
+		}
 	}
 	return 0;
 }
@@ -813,6 +815,15 @@
 	.put = snd_gf1_pcm_volume_put
 };
 
+static snd_kcontrol_new_t snd_gf1_pcm_volume_control1 =
+{
+	.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+	.name = "GPCM Playback Volume",
+	.info = snd_gf1_pcm_volume_info,
+	.get = snd_gf1_pcm_volume_get,
+	.put = snd_gf1_pcm_volume_put
+};
+
 static snd_pcm_ops_t snd_gf1_pcm_playback_ops = {
 	.open =		snd_gf1_pcm_playback_open,
 	.close =	snd_gf1_pcm_playback_close,
@@ -880,7 +891,11 @@
 	strcat(pcm->name, " (synth)");
 	gus->pcm = pcm;
 
-	if ((err = snd_ctl_add(card, kctl = snd_ctl_new1(&snd_gf1_pcm_volume_control, gus))) < 0)
+	if (gus->codec_flag)
+		kctl = snd_ctl_new1(&snd_gf1_pcm_volume_control1, gus);
+	else
+		kctl = snd_ctl_new1(&snd_gf1_pcm_volume_control, gus);
+	if ((err = snd_ctl_add(card, kctl)) < 0)
 		return err;
 	kctl->id.index = control_index;
 
--- diff/sound/isa/gus/gusclassic.c	2003-08-26 10:00:55.000000000 +0100
+++ source/sound/isa/gus/gusclassic.c	2004-02-09 10:39:58.000000000 +0000
@@ -284,7 +284,7 @@
 	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
 	       get_option(&str,&index[nr_dev]) == 2 &&
 	       get_id(&str,&id[nr_dev]) == 2 &&
-	       get_option(&str,(int *)&port[nr_dev]) == 2 &&
+	       get_option_long(&str,&port[nr_dev]) == 2 &&
 	       get_option(&str,&irq[nr_dev]) == 2 &&
 	       get_option(&str,&dma1[nr_dev]) == 2 &&
 	       get_option(&str,&dma2[nr_dev]) == 2 &&
--- diff/sound/isa/gus/gusextreme.c	2003-08-26 10:00:55.000000000 +0100
+++ source/sound/isa/gus/gusextreme.c	2004-02-09 10:39:58.000000000 +0000
@@ -417,9 +417,9 @@
 	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
 	       get_option(&str,&index[nr_dev]) == 2 &&
 	       get_id(&str,&id[nr_dev]) == 2 &&
-	       get_option(&str,(int *)&port[nr_dev]) == 2 &&
-	       get_option(&str,(int *)&gf1_port[nr_dev]) == 2 &&
-	       get_option(&str,(int *)&mpu_port[nr_dev]) == 2 &&
+	       get_option_long(&str,&port[nr_dev]) == 2 &&
+	       get_option_long(&str,&gf1_port[nr_dev]) == 2 &&
+	       get_option_long(&str,&mpu_port[nr_dev]) == 2 &&
 	       get_option(&str,&irq[nr_dev]) == 2 &&
 	       get_option(&str,&gf1_irq[nr_dev]) == 2 &&
 	       get_option(&str,&mpu_irq[nr_dev]) == 2 &&
--- diff/sound/isa/gus/gusmax.c	2003-08-26 10:00:55.000000000 +0100
+++ source/sound/isa/gus/gusmax.c	2004-02-09 10:39:58.000000000 +0000
@@ -424,7 +424,7 @@
 	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
 	       get_option(&str,&index[nr_dev]) == 2 &&
 	       get_id(&str,&id[nr_dev]) == 2 &&
-	       get_option(&str,(int *)&port[nr_dev]) == 2 &&
+	       get_option_long(&str,&port[nr_dev]) == 2 &&
 	       get_option(&str,&irq[nr_dev]) == 2 &&
 	       get_option(&str,&dma1[nr_dev]) == 2 &&
 	       get_option(&str,&dma2[nr_dev]) == 2 &&
--- diff/sound/isa/gus/interwave.c	2003-08-20 14:16:34.000000000 +0100
+++ source/sound/isa/gus/interwave.c	2004-02-09 10:39:58.000000000 +0000
@@ -229,12 +229,14 @@
 				break;
 			port += 0x10;
 		}
-		if (port > 0x380)
-			return -ENODEV;
 	} else {
-		if ((iwcard->i2c_res = request_region(port, 1, "InterWave (I2C bus)")) != NULL)
-			return -ENODEV;
+		iwcard->i2c_res = request_region(port, 1, "InterWave (I2C bus)");
 	}
+	if (iwcard->i2c_res == NULL) {
+		snd_printk(KERN_ERR "interwave: can't grab i2c bus port\n");
+		return -ENODEV;
+	}
+
 	sprintf(name, "InterWave-%i", card->number);
 	if ((err = snd_i2c_bus_create(card, name, NULL, &bus)) < 0)
 		return err;
@@ -626,7 +628,7 @@
 		return -ENOENT;
 	}
 	port[dev] = pnp_port_start(pdev, 0);
-	dma1[dev] = pnp_dma(pdev, 1);
+	dma1[dev] = pnp_dma(pdev, 0);
 	if (dma2[dev] >= 0)
 		dma2[dev] = pnp_dma(pdev, 1);
 	irq[dev] = pnp_irq(pdev, 0);
@@ -699,9 +701,12 @@
 	iwcard->irq = -1;
 	card->private_free = snd_interwave_free;
 #ifdef CONFIG_PNP
-	if (isapnp[dev] && snd_interwave_pnp(dev, iwcard, pcard, pid)) {
-		snd_card_free(card);
-		return -ENODEV;
+	if (isapnp[dev]) {
+		if (snd_interwave_pnp(dev, iwcard, pcard, pid)) {
+			snd_card_free(card);
+			return -ENODEV;
+		}
+		snd_card_set_dev(card, &pcard->card->dev);
 	}
 #endif
 	xirq = irq[dev];
@@ -994,9 +999,9 @@
 	       get_option(&str,&index[nr_dev]) == 2 &&
 	       get_id(&str,&id[nr_dev]) == 2 &&
 	       get_option(&str,&pnp) == 2 &&
-	       get_option(&str,(int *)&port[nr_dev]) == 2 &&
+	       get_option_long(&str,&port[nr_dev]) == 2 &&
 #ifdef SNDRV_STB
-	       get_option(&str,(int *)&port_tc[nr_dev]) == 2 &&
+	       get_option_long(&str,&port_tc[nr_dev]) == 2 &&
 #endif
 	       get_option(&str,&irq[nr_dev]) == 2 &&
 	       get_option(&str,&dma1[nr_dev]) == 2 &&
--- diff/sound/isa/opl3sa2.c	2003-08-26 10:00:55.000000000 +0100
+++ source/sound/isa/opl3sa2.c	2004-02-09 10:39:58.000000000 +0000
@@ -236,8 +236,10 @@
 
 	card = chip->card;
 	port = chip->port;
-	if ((chip->res_port = request_region(port, 2, "OPL3-SA control")) == NULL)
+	if ((chip->res_port = request_region(port, 2, "OPL3-SA control")) == NULL) {
+		snd_printk(KERN_ERR "opl3sa2: can't grab port 0x%lx\n", port);
 		return -EBUSY;
+	}
 	// snd_printk("REG 0A = 0x%x\n", snd_opl3sa2_read(chip, 0x0a));
 	chip->version = 0;
 	tmp = snd_opl3sa2_read(chip, OPL3SA2_MISC);
@@ -757,8 +759,11 @@
 	if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0)
 		goto __error;
 #ifdef CONFIG_PNP
-	if (isapnp[dev] && (err = snd_opl3sa2_pnp(dev, chip, pcard, pid)) < 0)
-		goto __error;
+	if (isapnp[dev]) {
+		if ((err = snd_opl3sa2_pnp(dev, chip, pcard, pid)) < 0)
+			goto __error;
+		snd_card_set_dev(card, &pcard->card->dev);
+	}
 #endif
 	chip->ymode = opl3sa3_ymode[dev] & 0x03 ; /* initialise this card from supplied (or default) parameter*/ 
 	chip->card = card;
@@ -771,6 +776,7 @@
 	if ((err = snd_opl3sa2_detect(chip)) < 0)
 		goto __error;
 	if (request_irq(xirq, snd_opl3sa2_interrupt, SA_INTERRUPT, "OPL3-SA2/3", (void *)chip)) {
+		snd_printk(KERN_ERR "opl3sa2: can't grab IRQ %d\n", xirq);
 		err = -ENODEV;
 		goto __error;
 	}
@@ -945,11 +951,11 @@
 	       get_option(&str,&index[nr_dev]) == 2 &&
 	       get_id(&str,&id[nr_dev]) == 2 &&
 	       get_option(&str,&pnp) == 2 &&
-	       get_option(&str,(int *)&port[nr_dev]) == 2 &&
-	       get_option(&str,(int *)&sb_port[nr_dev]) == 2 &&
-	       get_option(&str,(int *)&wss_port[nr_dev]) == 2 &&
-	       get_option(&str,(int *)&fm_port[nr_dev]) == 2 &&
-	       get_option(&str,(int *)&midi_port[nr_dev]) == 2 &&
+	       get_option_long(&str,&port[nr_dev]) == 2 &&
+	       get_option_long(&str,&sb_port[nr_dev]) == 2 &&
+	       get_option_long(&str,&wss_port[nr_dev]) == 2 &&
+	       get_option_long(&str,&fm_port[nr_dev]) == 2 &&
+	       get_option_long(&str,&midi_port[nr_dev]) == 2 &&
 	       get_option(&str,&irq[nr_dev]) == 2 &&
 	       get_option(&str,&dma1[nr_dev]) == 2 &&
 	       get_option(&str,&dma2[nr_dev]) == 2 &&
--- diff/sound/isa/opti9xx/opti92x-ad1848.c	2003-06-30 10:07:24.000000000 +0100
+++ source/sound/isa/opti9xx/opti92x-ad1848.c	2004-02-09 10:39:58.000000000 +0000
@@ -543,11 +543,11 @@
 
 __skip_base:
 	switch (chip->irq) {
-#ifdef OPTi93X
+//#ifdef OPTi93X
 	case 5:
 		irq_bits = 0x05;
 		break;
-#endif	/* OPTi93X */
+//#endif	/* OPTi93X */
 	case 7:
 		irq_bits = 0x01;
 		break;
@@ -604,6 +604,7 @@
 __skip_resources:
 	if (chip->hardware > OPTi9XX_HW_82C928) {
 		switch (chip->mpu_port) {
+		case 0:
 		case -1:
 			break;
 		case 0x300:
@@ -644,7 +645,7 @@
 		}
 
 		snd_opti9xx_write_mask(chip, OPTi9XX_MC_REG(6),
-			(chip->mpu_port == -1) ? 0x00 :
+			(chip->mpu_port <= 0) ? 0x00 :
 				0x80 | mpu_port_bits << 5 | mpu_irq_bits << 3,
 			0xf8);
 	}
@@ -1304,23 +1305,27 @@
 	codec->dma2 = -1;
 
 	if ((codec->res_port = request_region(chip->wss_base + 4, 4, "OPTI93x CODEC")) == NULL) {
+		snd_printk(KERN_ERR "opti9xx: can't grab port 0x%lx\n", chip->wss_base + 4);
 		snd_opti93x_free(codec);
 		return -EBUSY;
 	}
 	if (request_dma(dma1, "OPTI93x - 1")) {
+		snd_printk(KERN_ERR "opti9xx: can't grab DMA1 %d\n", dma1);
 		snd_opti93x_free(codec);
 		return -EBUSY;
 	}
 	codec->dma1 = chip->dma1;
 	if (request_dma(dma2, "OPTI93x - 2")) {
+		snd_printk(KERN_ERR "opti9xx: can't grab DMA2 %d\n", dma2);
 		snd_opti93x_free(codec);
 		return -EBUSY;
 	}
 	codec->dma2 = chip->dma2;
 
 	if (request_irq(chip->irq, snd_opti93x_interrupt, SA_INTERRUPT, DRIVER_NAME" - WSS", codec)) {
-	  snd_opti93x_free(codec);
-	  return -EBUSY;
+		snd_printk(KERN_ERR "opti9xx: can't grab IRQ %d\n", chip->irq);
+		snd_opti93x_free(codec);
+		return -EBUSY;
 	}
 
 	codec->card = card;
@@ -1734,15 +1739,23 @@
 #if defined(CS4231) || defined(OPTi93X)
 	if (dma2 != SNDRV_AUTO_DMA)
 		pnp_resource_change(&cfg->dma_resource[1], dma2, 1);
+#else
+#ifdef snd_opti9xx_fixup_dma2
+	snd_opti9xx_fixup_dma2(pdev);
+#endif
 #endif	/* CS4231 || OPTi93X */
-	if (fm_port != SNDRV_AUTO_PORT)
+#ifdef OPTi93X
+	if (fm_port > 0 && fm_port != SNDRV_AUTO_PORT)
 		pnp_resource_change(&cfg->port_resource[1], fm_port, 4);
-
+#else
+	if (fm_port > 0 && fm_port != SNDRV_AUTO_PORT)
+		pnp_resource_change(&cfg->port_resource[2], fm_port, 4);
+#endif
 	if (pnp_manual_config_dev(pdev, cfg, 0) < 0)
 		snd_printk(KERN_ERR "AUDIO the requested resources are invalid, using auto config\n");
 	err = pnp_activate_dev(pdev);
 	if (err < 0) {
-		snd_printk(KERN_ERR "AUDIO pnp configure failure\n");
+		snd_printk(KERN_ERR "AUDIO pnp configure failure: %d\n", err);
 		kfree(cfg);
 		return err;
 	}
@@ -1762,7 +1775,7 @@
 #endif	/* CS4231 || OPTi93X */
 
 	pdev = chip->devmpu;
-	if (pdev) {
+	if (pdev && mpu_port > 0) {
 		pnp_init_resource_table(cfg);
 
 		if (mpu_port != SNDRV_AUTO_PORT)
@@ -1960,6 +1973,7 @@
 		}
 		if (hw <= OPTi9XX_HW_82C930)
 			chip->mc_base -= 0x80;
+		snd_card_set_dev(card, &pcard->card->dev);
 	} else {
 #endif	/* CONFIG_PNP */
 		if ((error = snd_card_opti9xx_detect(card, chip)) < 0) {
@@ -1985,9 +1999,6 @@
 	chip->dma2 = dma2;
 #endif
 
-#ifdef CONFIG_PNP
-	if (!isapnp) {
-#endif
 	if (chip->wss_base == SNDRV_AUTO_PORT) {
 		if ((chip->wss_base = snd_legacy_find_free_ioport(possible_ports, 4)) < 0) {
 			snd_card_free(card);
@@ -1995,6 +2006,9 @@
 			return -EBUSY;
 		}
 	}
+#ifdef CONFIG_PNP
+	if (!isapnp) {
+#endif
 	if (chip->mpu_port == SNDRV_AUTO_PORT) {
 		if ((chip->mpu_port = snd_legacy_find_free_ioport(possible_mpu_ports, 2)) < 0) {
 			snd_card_free(card);
@@ -2092,8 +2106,19 @@
 		return error;
 	}
 #endif
+	strcpy(card->driver, chip->name);
+	sprintf(card->shortname, "OPTi %s", card->driver);
+#if defined(CS4231) || defined(OPTi93X)
+	sprintf(card->longname, "%s, %s at 0x%lx, irq %d, dma %d&%d",
+		card->shortname, pcm->name, chip->wss_base + 4,
+		chip->irq, chip->dma1, chip->dma2);
+#else
+	sprintf(card->longname, "%s, %s at 0x%lx, irq %d, dma %d",
+		card->shortname, pcm->name, chip->wss_base + 4,
+		chip->irq, chip->dma1);
+#endif	/* CS4231 || OPTi93X */
 
-	if (chip->mpu_port <= 0)
+	if (chip->mpu_port <= 0 || chip->mpu_port == SNDRV_AUTO_PORT)
 		rmidi = NULL;
 	else
 		if ((error = snd_mpu401_uart_new(card, 0, MPU401_HW_MPU401,
@@ -2101,7 +2126,7 @@
 				&rmidi)))
 			snd_printk("no MPU-401 device at 0x%lx?\n", chip->mpu_port);
 
-	if (chip->fm_port > 0) {
+	if (chip->fm_port > 0 && chip->fm_port != SNDRV_AUTO_PORT) {
 		opl3_t *opl3 = NULL;
 #ifndef OPTi93X
 		if (chip->hardware == OPTi9XX_HW_82C928 ||
@@ -2145,17 +2170,6 @@
 		}
 	}
 
-	strcpy(card->driver, chip->name);
-	sprintf(card->shortname, "OPTi %s", card->driver);
-#if defined(CS4231) || defined(OPTi93X)
-	sprintf(card->longname, "%s soundcard, %s at 0x%lx, irq %d, dma %d&%d",
-		card->shortname, pcm->name, chip->wss_base + 4,
-		chip->irq, chip->dma1, chip->dma2);
-#else
-	sprintf(card->longname, "%s soundcard, %s at 0x%lx, irq %d, dma %d",
-		card->shortname, pcm->name, chip->wss_base + 4,
-		chip->irq, chip->dma1);
-#endif	/* CS4231 || OPTi93X */
 	if ((error = snd_card_register(card))) {
 		snd_card_free(card);
 		return error;
@@ -2240,9 +2254,9 @@
 	       get_option(&str,&index) == 2 &&
 	       get_id(&str,&id) == 2 &&
 	       get_option(&str,&pnp) == 2 &&
-	       get_option(&str,(int *)&port) == 2 &&
-	       get_option(&str,(int *)&mpu_port) == 2 &&
-	       get_option(&str,(int *)&fm_port) == 2 &&
+	       get_option_long(&str,&port) == 2 &&
+	       get_option_long(&str,&mpu_port) == 2 &&
+	       get_option_long(&str,&fm_port) == 2 &&
 	       get_option(&str,&irq) == 2 &&
 	       get_option(&str,&mpu_irq) == 2 &&
 	       get_option(&str,&dma1) == 2
--- diff/sound/isa/sb/emu8000.c	2003-08-20 14:16:34.000000000 +0100
+++ source/sound/isa/sb/emu8000.c	2004-02-09 10:39:58.000000000 +0000
@@ -655,7 +655,7 @@
 };
 
 /*exported*/ int
-snd_emu8000_load_chorus_fx(emu8000_t *emu, int mode, const void *buf, long len)
+snd_emu8000_load_chorus_fx(emu8000_t *emu, int mode, const void __user *buf, long len)
 {
 	soundfont_chorus_fx_t rec;
 	if (mode < SNDRV_EMU8000_CHORUS_PREDEFINED || mode >= SNDRV_EMU8000_CHORUS_NUMBERS) {
@@ -782,7 +782,7 @@
 };
 
 /*exported*/ int
-snd_emu8000_load_reverb_fx(emu8000_t *emu, int mode, const void *buf, long len)
+snd_emu8000_load_reverb_fx(emu8000_t *emu, int mode, const void __user *buf, long len)
 {
 	soundfont_reverb_fx_t rec;
 
@@ -1044,8 +1044,10 @@
 
 __error:
 	for (i = 0; i < EMU8000_NUM_CONTROLS; i++) {
+		down_write(&card->controls_rwsem);
 		if (emu->controls[i])
 			snd_ctl_remove(card, emu->controls[i]);
+		up_write(&card->controls_rwsem);
 	}
 	return err;
 }
@@ -1110,6 +1112,7 @@
 	if (!(hw->res_port1 = request_region(hw->port1, 4, "Emu8000-1")) ||
 	    !(hw->res_port2 = request_region(hw->port2, 4, "Emu8000-2")) ||
 	    !(hw->res_port3 = request_region(hw->port3, 4, "Emu8000-3"))) {
+		snd_printk(KERN_ERR "sbawe: can't grab ports 0x%lx, 0x%lx, 0x%lx\n", hw->port1, hw->port2, hw->port3);
 		snd_emu8000_free(hw);
 		return -EBUSY;
 	}
--- diff/sound/isa/sb/emu8000_callback.c	2002-10-16 04:27:52.000000000 +0100
+++ source/sound/isa/sb/emu8000_callback.c	2004-02-09 10:39:58.000000000 +0000
@@ -36,7 +36,7 @@
 #ifdef CONFIG_SND_SEQUENCER_OSS
 static int oss_ioctl(snd_emux_t *emu, int cmd, int p1, int p2);
 #endif
-static int load_fx(snd_emux_t *emu, int type, int mode, const void *buf, long len);
+static int load_fx(snd_emux_t *emu, int type, int mode, const void __user *buf, long len);
 
 static void set_pitch(emu8000_t *hw, snd_emux_voice_t *vp);
 static void set_volume(emu8000_t *hw, snd_emux_voice_t *vp);
@@ -523,7 +523,7 @@
  */
 
 static int
-load_fx(snd_emux_t *emu, int type, int mode, const void *buf, long len)
+load_fx(snd_emux_t *emu, int type, int mode, const void __user *buf, long len)
 {
 	emu8000_t *hw;
 	hw = snd_magic_cast(emu8000_t, emu->hw, return -EINVAL);
--- diff/sound/isa/sb/emu8000_local.h	2002-10-16 04:28:23.000000000 +0100
+++ source/sound/isa/sb/emu8000_local.h	2004-02-09 10:39:58.000000000 +0000
@@ -32,7 +32,7 @@
 #define NELEM(arr) (sizeof(arr)/sizeof((arr)[0]))
 
 /* emu8000_patch.c */
-int snd_emu8000_sample_new(snd_emux_t *rec, snd_sf_sample_t *sp, snd_util_memhdr_t *hdr, const void *data, long count);
+int snd_emu8000_sample_new(snd_emux_t *rec, snd_sf_sample_t *sp, snd_util_memhdr_t *hdr, const void __user *data, long count);
 int snd_emu8000_sample_free(snd_emux_t *rec, snd_sf_sample_t *sp, snd_util_memhdr_t *hdr);
 void snd_emu8000_sample_reset(snd_emux_t *rec);
 
--- diff/sound/isa/sb/emu8000_patch.c	2003-10-27 09:20:39.000000000 +0000
+++ source/sound/isa/sb/emu8000_patch.c	2004-02-09 10:39:58.000000000 +0000
@@ -82,7 +82,7 @@
  * 8bit samples etc.
  */
 static unsigned short
-read_word(const void *buf, int offset, int mode)
+read_word(const void __user *buf, int offset, int mode)
 {
 	unsigned short c;
 	if (mode & SNDRV_SFNT_SAMPLE_8BITS) {
@@ -146,7 +146,7 @@
  */
 int
 snd_emu8000_sample_new(snd_emux_t *rec, snd_sf_sample_t *sp,
-		       snd_util_memhdr_t *hdr, const void *data, long count)
+		       snd_util_memhdr_t *hdr, const void __user *data, long count)
 {
 	int  i;
 	int  rc;
--- diff/sound/isa/sb/emu8000_synth.c	2002-10-16 04:28:32.000000000 +0100
+++ source/sound/isa/sb/emu8000_synth.c	2004-02-09 10:39:58.000000000 +0000
@@ -71,6 +71,7 @@
 	emu->midi_ports = hw->seq_ports < 2 ? hw->seq_ports : 2; /* number of virmidi ports */
 	emu->midi_devidx = 1;
 	emu->linear_panning = 1;
+	emu->hwdep_idx = 2; /* FIXED */
 
 	if (snd_emux_register(emu, dev->card, hw->index, "Emu8000") < 0) {
 		snd_emux_free(emu);
--- diff/sound/isa/sb/es968.c	2003-08-20 14:16:34.000000000 +0100
+++ source/sound/isa/sb/es968.c	2004-02-09 10:39:58.000000000 +0000
@@ -149,6 +149,7 @@
 		snd_card_free(card);
 		return error;
 	}
+	snd_card_set_dev(card, &pcard->card->dev);
 
 	if ((error = snd_sbdsp_create(card, port[dev],
 				      irq[dev],
@@ -257,7 +258,7 @@
 	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
 	       get_option(&str,&index[nr_dev]) == 2 &&
 	       get_id(&str,&id[nr_dev]) == 2 &&
-	       get_option(&str,(int *)&port[nr_dev]) == 2 &&
+	       get_option_long(&str,&port[nr_dev]) == 2 &&
 	       get_option(&str,&irq[nr_dev]) == 2 &&
 	       get_option(&str,&dma8[nr_dev]) == 2);
 	nr_dev++;
--- diff/sound/isa/sb/sb16.c	2003-08-20 14:16:34.000000000 +0100
+++ source/sound/isa/sb/sb16.c	2004-02-09 10:39:58.000000000 +0000
@@ -77,7 +77,7 @@
 static int isapnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};
 #endif
 static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;	/* 0x220,0x240,0x260,0x280 */
-static long mpu_port[SNDRV_CARDS] = {0x330, 0x300,[2 ... (SNDRV_CARDS - 1)] = -1};
+static long mpu_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;	/* 0x330,0x300 */
 static long fm_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;
 #ifdef SNDRV_SBAWE_EMU8000
 static long awe_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;
@@ -157,6 +157,8 @@
 
 static snd_card_t *snd_sb16_legacy[SNDRV_CARDS] = SNDRV_DEFAULT_PTR;
 
+#ifdef CONFIG_PNP
+
 static struct pnp_card_device_id snd_sb16_pnpids[] = {
 #ifndef SNDRV_SBAWE
 	/* Sound Blaster 16 PnP */
@@ -250,6 +252,8 @@
 
 MODULE_DEVICE_TABLE(pnp_card, snd_sb16_pnpids);
 
+#endif /* CONFIG_PNP */
+
 #ifdef SNDRV_SBAWE_EMU8000
 #define DRIVER_NAME	"snd-card-sbawe"
 #else
@@ -393,6 +397,7 @@
 			snd_card_free(card);
 			return err;
 		}
+		snd_card_set_dev(card, &pcard->card->dev);
 	}
 #endif
 
@@ -465,7 +470,23 @@
 		return -ENXIO;
 	}
 
-	if (chip->mpu_port) {
+	strcpy(card->driver,
+#ifdef SNDRV_SBAWE_EMU8000
+			awe_port[dev] > 0 ? "SB AWE" :
+#endif
+			"SB16");
+	strcpy(card->shortname, chip->name);
+	sprintf(card->longname, "%s at 0x%lx, irq %i, dma ",
+		chip->name,
+		chip->port,
+		xirq);
+	if (xdma8 >= 0)
+		sprintf(card->longname + strlen(card->longname), "%d", xdma8);
+	if (xdma16 >= 0)
+		sprintf(card->longname + strlen(card->longname), "%s%d",
+			xdma8 >= 0 ? "&" : "", xdma16);
+
+	if (chip->mpu_port > 0 && chip->mpu_port != SNDRV_AUTO_PORT) {
 		if ((err = snd_mpu401_uart_new(card, 0, MPU401_HW_SB,
 					       chip->mpu_port, 0,
 					       xirq, 0, &chip->rmidi)) < 0) {
@@ -475,10 +496,15 @@
 		chip->rmidi_callback = snd_mpu401_uart_interrupt;
 	}
 
-	if (fm_port[dev] > 0) {
+#ifdef SNDRV_SBAWE_EMU8000
+	if (awe_port[dev] == SNDRV_AUTO_PORT)
+		awe_port[dev] = 0; /* disable */
+#endif
+
+	if (fm_port[dev] > 0 && fm_port[dev] != SNDRV_AUTO_PORT) {
 		if (snd_opl3_create(card, fm_port[dev], fm_port[dev] + 2,
 				    OPL3_HW_OPL3,
-				    fm_port[dev] == port[dev] || fm_port[dev] == 0x388,
+				    acard->fm_res != NULL || fm_port[dev] == port[dev],
 				    &opl3) < 0) {
 			snd_printk(KERN_ERR PFX "no OPL device at 0x%lx-0x%lx\n",
 				   fm_port[dev], fm_port[dev] + 2);
@@ -530,21 +556,6 @@
 		(mic_agc[dev] ? 0x00 : 0x01));
 	spin_unlock_irqrestore(&chip->mixer_lock, flags);
 
-	strcpy(card->driver, 
-#ifdef SNDRV_SBAWE_EMU8000
-			awe_port[dev] > 0 ? "SB AWE" :
-#endif
-			"SB16");
-	strcpy(card->shortname, chip->name);
-	sprintf(card->longname, "%s at 0x%lx, irq %i, dma ",
-		chip->name,
-		chip->port,
-		xirq);
-	if (xdma8 >= 0)
-		sprintf(card->longname + strlen(card->longname), "%d", xdma8);
-	if (xdma16 >= 0)
-		sprintf(card->longname + strlen(card->longname), "%s%d",
-			xdma8 >= 0 ? "&" : "", xdma16);
 	if ((err = snd_card_register(card)) < 0) {
 		snd_card_free(card);
 		return err;
@@ -696,9 +707,9 @@
 	       get_option(&str,&index[nr_dev]) == 2 &&
 	       get_id(&str,&id[nr_dev]) == 2 &&
 	       get_option(&str,&pnp) == 2 &&
-	       get_option(&str,(int *)&port[nr_dev]) == 2 &&
-	       get_option(&str,(int *)&mpu_port[nr_dev]) == 2 &&
-	       get_option(&str,(int *)&fm_port[nr_dev]) == 2 &&
+	       get_option_long(&str,&port[nr_dev]) == 2 &&
+	       get_option_long(&str,&mpu_port[nr_dev]) == 2 &&
+	       get_option_long(&str,&fm_port[nr_dev]) == 2 &&
 	       get_option(&str,&irq[nr_dev]) == 2 &&
 	       get_option(&str,&dma8[nr_dev]) == 2 &&
 	       get_option(&str,&dma16[nr_dev]) == 2 &&
@@ -709,7 +720,7 @@
 #endif
 #ifdef SNDRV_SBAWE_EMU8000
 	       &&
-	       get_option(&str,(int *)&awe_port[nr_dev]) == 2 &&
+	       get_option_long(&str,&awe_port[nr_dev]) == 2 &&
 	       get_option(&str,&seq_ports[nr_dev]) == 2
 #endif
 	       );
--- diff/sound/isa/sb/sb16_csp.c	2003-06-09 14:18:21.000000000 +0100
+++ source/sound/isa/sb/sb16_csp.c	2004-02-09 10:39:58.000000000 +0000
@@ -1059,10 +1059,12 @@
 
 	card = p->chip->card;	
 	
+	down_write(&card->controls_rwsem);
 	if (p->qsound_switch)
 		snd_ctl_remove(card, p->qsound_switch);
 	if (p->qsound_space)
 		snd_ctl_remove(card, p->qsound_space);
+	up_write(&card->controls_rwsem);
 
 	/* cancel pending transfer of QSound parameters */
 	spin_lock_irqsave (&p->q_lock, flags);
@@ -1105,7 +1107,7 @@
 	snd_info_entry_t *entry;
 	sprintf(name, "cspD%d", device);
 	if (! snd_card_proc_new(p->chip->card, name, &entry))
-		snd_info_set_text_ops(entry, p, info_read);
+		snd_info_set_text_ops(entry, p, 1024, info_read);
 	return 0;
 }
 
--- diff/sound/isa/sb/sb8.c	2003-06-30 10:07:24.000000000 +0100
+++ source/sound/isa/sb/sb8.c	2004-02-09 10:39:58.000000000 +0000
@@ -242,7 +242,7 @@
 	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
 	       get_option(&str,&index[nr_dev]) == 2 &&
 	       get_id(&str,&id[nr_dev]) == 2 &&
-	       get_option(&str,(int *)&port[nr_dev]) == 2 &&
+	       get_option_long(&str,&port[nr_dev]) == 2 &&
 	       get_option(&str,&irq[nr_dev]) == 2 &&
 	       get_option(&str,&dma8[nr_dev]) == 2);
 	nr_dev++;
--- diff/sound/isa/sb/sb_common.c	2003-05-21 11:50:17.000000000 +0100
+++ source/sound/isa/sb/sb_common.c	2004-02-09 10:39:58.000000000 +0000
@@ -185,10 +185,6 @@
 		release_resource(chip->res_port);
 		kfree_nocheck(chip->res_port);
 	}
-	if (chip->res_alt_port) {
-		release_resource(chip->res_alt_port);
-		kfree_nocheck(chip->res_alt_port);
-	}
 	if (chip->irq >= 0)
 		free_irq(chip->irq, (void *) chip);
 #ifdef CONFIG_ISA
@@ -243,6 +239,7 @@
 	if (request_irq(irq, irq_handler, hardware == SB_HW_ALS4000 ?
 			SA_INTERRUPT | SA_SHIRQ : SA_INTERRUPT,
 			"SoundBlaster", (void *) chip)) {
+		snd_printk(KERN_ERR "sb: can't grab irq %d\n", irq);
 		snd_sbdsp_free(chip);
 		return -EBUSY;
 	}
@@ -252,12 +249,14 @@
 		goto __skip_allocation;
 	
 	if ((chip->res_port = request_region(port, 16, "SoundBlaster")) == NULL) {
+		snd_printk(KERN_ERR "sb: can't grab port 0x%lx\n", port);
 		snd_sbdsp_free(chip);
 		return -EBUSY;
 	}
 
 #ifdef CONFIG_ISA
 	if (dma8 >= 0 && request_dma(dma8, "SoundBlaster - 8bit")) {
+		snd_printk(KERN_ERR "sb: can't grab DMA8 %d\n", dma8);
 		snd_sbdsp_free(chip);
 		return -EBUSY;
 	}
@@ -267,6 +266,7 @@
 			/* no duplex */
 			dma16 = -1;
 		} else if (request_dma(dma16, "SoundBlaster - 16bit")) {
+			snd_printk(KERN_ERR "sb: can't grab DMA16 %d\n", dma16);
 			snd_sbdsp_free(chip);
 			return -EBUSY;
 		}
--- diff/sound/isa/sgalaxy.c	2003-05-21 11:50:17.000000000 +0100
+++ source/sound/isa/sgalaxy.c	2004-02-09 10:39:58.000000000 +0000
@@ -150,8 +150,10 @@
         if (tmp < 0)
                 return -EINVAL;
 
-	if (request_irq(irq, snd_sgalaxy_dummy_interrupt, SA_INTERRUPT, "sgalaxy", NULL))
+	if (request_irq(irq, snd_sgalaxy_dummy_interrupt, SA_INTERRUPT, "sgalaxy", NULL)) {
+		snd_printk(KERN_ERR "sgalaxy: can't grab irq %d\n", irq);
 		return -EIO;
+	}
 
         outb(tmp | 0x40, port);
         tmp1 = dma_bits[dma % 4];
@@ -341,10 +343,10 @@
 	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
 	       get_option(&str,&index[nr_dev]) == 2 &&
 	       get_id(&str,&id[nr_dev]) == 2 &&
-	       get_option(&str,(int *)&sbport[nr_dev]) == 2 &&
-	       get_option(&str,(int *)&wssport[nr_dev]) == 2 &&
-	       get_option(&str,(int *)&irq[nr_dev]) == 2 &&
-	       get_option(&str,(int *)&dma1[nr_dev]) == 2);
+	       get_option_long(&str,&sbport[nr_dev]) == 2 &&
+	       get_option_long(&str,&wssport[nr_dev]) == 2 &&
+	       get_option(&str,&irq[nr_dev]) == 2 &&
+	       get_option(&str,&dma1[nr_dev]) == 2);
 	nr_dev++;
 	return 1;
 }
--- diff/sound/isa/sscape.c	2003-09-30 15:46:21.000000000 +0100
+++ source/sound/isa/sscape.c	2004-02-09 10:39:58.000000000 +0000
@@ -31,6 +31,7 @@
 #include <sound/hwdep.h>
 #include <sound/cs4231.h>
 #include <sound/mpu401.h>
+#define SNDRV_GET_ID
 #include <sound/initval.h>
 
 #include <sound/sscape_ioctl.h>
@@ -616,10 +617,10 @@
 	 */
 	if (get_user(code, &mc->code))
 		return -EFAULT;
-	if ((err = verify_area(VERIFY_READ, code, 65536)) != 0)
+	if ((err = verify_area(VERIFY_READ, code, SSCAPE_MICROCODE_SIZE)) != 0)
 		return err;
 
-	if ((ret = upload_dma_data(sscape, code, 65536)) == 0) {
+	if ((ret = upload_dma_data(sscape, code, SSCAPE_MICROCODE_SIZE)) == 0) {
 		snd_printk(KERN_INFO "sscape: MIDI firmware loaded\n");
 	}
 
@@ -1173,6 +1174,7 @@
 	 * can detect and control this hardware ...
 	 */
 	if ((io_res = request_region(params->port, 8, "SoundScape")) == NULL) {
+		snd_printk(KERN_ERR "sscape: can't grab port 0x%x\n", params->port);
 		return -EBUSY;
 	}
 
@@ -1180,6 +1182,7 @@
 	 * Grab both DMA channels (OK, only one for now) ...
 	 */
 	if ((err = request_dma(params->dma1, "SoundScape")) < 0) {
+		snd_printk(KERN_ERR "sscape: can't grab DMA %d\n", params->dma1);
 		goto _release_region;
 	}
 
@@ -1406,6 +1409,7 @@
 			ret = create_sscape(this, &card);
 			if (ret < 0)
 				return ret;
+			snd_card_set_dev(card, &pcard->card->dev);
 			pnp_set_card_drvdata(pcard, card);
 			++sscape_cards;
 			++idx;
@@ -1538,8 +1542,8 @@
 		return 0;
 
 	(void)((get_option(&str, &index[nr_dev]) == 2) &&
-	       (get_option(&str, (int*)&id[nr_dev]) == 2) &&
-	       (get_option(&str, (int*)&port[nr_dev]) == 2) &&
+	       (get_id(&str, &id[nr_dev]) == 2) &&
+	       (get_option_long(&str, &port[nr_dev]) == 2) &&
 	       (get_option(&str, &irq[nr_dev]) == 2) &&
 	       (get_option(&str, &mpu_irq[nr_dev]) == 2) &&
 	       (get_option(&str, &dma[nr_dev]) == 2)); 
--- diff/sound/isa/wavefront/wavefront.c	2003-08-20 14:16:34.000000000 +0100
+++ source/sound/isa/wavefront/wavefront.c	2004-02-09 10:39:58.000000000 +0000
@@ -418,13 +418,6 @@
 	snd_hwdep_t *fx_processor;
 	int hw_dev = 0, midi_dev = 0, err;
 
-	if (cs4232_mpu_port[dev] < 0)
-		cs4232_mpu_port[dev] = SNDRV_AUTO_PORT;
-	if (fm_port[dev] < 0)
-		fm_port[dev] = SNDRV_AUTO_PORT;
-	if (ics2115_port[dev] < 0)
-		ics2115_port[dev] = SNDRV_AUTO_PORT;
-
 #ifdef CONFIG_PNP
 	if (!isapnp[dev]) {
 #endif
@@ -456,12 +449,15 @@
 	card->private_free = snd_wavefront_free;
 
 #ifdef CONFIG_PNP
-	if (isapnp[dev] && snd_wavefront_pnp (dev, acard, pcard, pid) < 0) {
-		if (cs4232_pcm_port[dev] == SNDRV_AUTO_PORT) {
-			snd_printk ("isapnp detection failed\n");
-			snd_card_free (card);
-			return -ENODEV;
+	if (isapnp[dev]) {
+		if (snd_wavefront_pnp (dev, acard, pcard, pid) < 0) {
+			if (cs4232_pcm_port[dev] == SNDRV_AUTO_PORT) {
+				snd_printk ("isapnp detection failed\n");
+				snd_card_free (card);
+				return -ENODEV;
+			}
 		}
+		snd_card_set_dev(card, &pcard->card->dev);
 	}
 #endif /* CONFIG_PNP */
 
@@ -490,7 +486,7 @@
 
 	/* ---------- OPL3 synth --------- */
 
-	if (fm_port[dev] != SNDRV_AUTO_PORT) {
+	if (fm_port[dev] > 0 && fm_port[dev] != SNDRV_AUTO_PORT) {
 		opl3_t *opl3;
 
 	        if ((err = snd_opl3_create(card,
@@ -561,7 +557,7 @@
 
 	/* ------ ICS2115 internal MIDI ------------ */
 
-	if (ics2115_port[dev] >= 0 && ics2115_port[dev] != SNDRV_AUTO_PORT) {
+	if (ics2115_port[dev] > 0 && ics2115_port[dev] != SNDRV_AUTO_PORT) {
 		ics2115_internal_rmidi = 
 			snd_wavefront_new_midi (card, 
 						midi_dev,
@@ -578,7 +574,7 @@
 
 	/* ------ ICS2115 external MIDI ------------ */
 
-	if (ics2115_port[dev] >= 0 && ics2115_port[dev] != SNDRV_AUTO_PORT) {
+	if (ics2115_port[dev] > 0 && ics2115_port[dev] != SNDRV_AUTO_PORT) {
 		ics2115_external_rmidi = 
 			snd_wavefront_new_midi (card, 
 						midi_dev,
@@ -631,7 +627,7 @@
 	if (dma2[dev] >= 0 && dma2[dev] < 8)
 		sprintf(card->longname + strlen(card->longname), "&%d", dma2[dev]);
 
-	if (cs4232_mpu_port[dev] != SNDRV_AUTO_PORT) {
+	if (cs4232_mpu_port[dev] > 0 && cs4232_mpu_port[dev] != SNDRV_AUTO_PORT) {
 		sprintf (card->longname + strlen (card->longname), 
 			 " MPU-401 0x%lx irq %d",
 			 cs4232_mpu_port[dev],
@@ -756,13 +752,13 @@
 	       get_option(&str,&index[nr_dev]) == 2 &&
 	       get_id(&str,&id[nr_dev]) == 2 &&
 	       get_option(&str,&isapnp[nr_dev]) == 2 &&
-	       get_option(&str,(int *)&cs4232_pcm_port[nr_dev]) == 2 &&
+	       get_option_long(&str,&cs4232_pcm_port[nr_dev]) == 2 &&
 	       get_option(&str,&cs4232_pcm_irq[nr_dev]) == 2 &&
-	       get_option(&str,(int *)&cs4232_mpu_port[nr_dev]) == 2 &&
+	       get_option_long(&str,&cs4232_mpu_port[nr_dev]) == 2 &&
 	       get_option(&str,&cs4232_mpu_irq[nr_dev]) == 2 &&
-	       get_option(&str,(int *)&ics2115_port[nr_dev]) == 2 &&
+	       get_option_long(&str,&ics2115_port[nr_dev]) == 2 &&
 	       get_option(&str,&ics2115_irq[nr_dev]) == 2 &&
-	       get_option(&str,(int *)&fm_port[nr_dev]) == 2 &&
+	       get_option_long(&str,&fm_port[nr_dev]) == 2 &&
 	       get_option(&str,&dma1[nr_dev]) == 2 &&
 	       get_option(&str,&dma2[nr_dev]) == 2 &&
 	       get_option(&str,&use_cs4232_midi[nr_dev]) == 2);
--- diff/sound/oss/ac97_codec.c	2003-10-09 09:47:34.000000000 +0100
+++ source/sound/oss/ac97_codec.c	2004-02-09 10:39:58.000000000 +0000
@@ -1428,9 +1428,8 @@
  *	ac97_unregister_driver	-	unregister a codec helper
  *	@driver: Driver handler
  *
- *	Register a handler for codecs matching the codec id. The handler
- *	attach function is called for all present codecs and will be 
- *	called when new codecs are discovered.
+ *	Unregister a handler for codecs matching the codec id. The handler
+ *	remove function is called for all matching codecs.
  */
  
 void ac97_unregister_driver(struct ac97_driver *driver)
@@ -1440,13 +1439,14 @@
 	
 	down(&codec_sem);
 	list_del_init(&driver->list);
-	
+
 	list_for_each(l, &codecs)
 	{
 		c = list_entry(l, struct ac97_codec, list);
-		if(c->driver == driver)
+		if (c->driver == driver) {
 			driver->remove(c, driver);
-		c->driver = NULL;
+			c->driver = NULL;
+		}
 	}
 	
 	up(&codec_sem);
--- diff/sound/oss/ad1889.c	2003-10-27 09:20:39.000000000 +0000
+++ source/sound/oss/ad1889.c	2004-02-09 10:39:58.000000000 +0000
@@ -354,9 +354,9 @@
 	for (i = 0; i < AD_MAX_STATES; i++) {
 		out += sprintf(out, "DMA status for %s:\n", 
 			(i == AD_WAV_STATE ? "WAV" : "ADC")); 
-		out += sprintf(out, "\t\t0x%p (IOVA: 0x%u)\n", 
+		out += sprintf(out, "\t\t0x%p (IOVA: 0x%llu)\n",
 			dev->state[i].dmabuf.rawbuf,
-			dev->state[i].dmabuf.dma_handle);
+			(unsigned long long)dev->state[i].dmabuf.dma_handle);
 
 		out += sprintf(out, "\tread ptr: offset %u\n", 
 			(unsigned int)dev->state[i].dmabuf.rd_ptr);
--- diff/sound/oss/dmasound/tas3001c.c	2003-10-09 09:47:34.000000000 +0100
+++ source/sound/oss/dmasound/tas3001c.c	2004-02-09 10:39:58.000000000 +0000
@@ -55,7 +55,7 @@
 
 static const union tas_biquad_t
 tas3001c_eq_unity={
-	buf: { 0x100000, 0x000000, 0x000000, 0x000000, 0x000000 }
+	.buf = { 0x100000, 0x000000, 0x000000, 0x000000, 0x000000 }
 };
 
 
--- diff/sound/oss/dmasound/tas3001c_tables.c	2003-09-30 15:46:21.000000000 +0100
+++ source/sound/oss/dmasound/tas3001c_tables.c	2004-02-09 10:39:58.000000000 +0000
@@ -2,241 +2,241 @@
 #include "tas_eq_prefs.h"
 
 static struct tas_drce_t eqp_0e_2_1_drce = {
-  enable:    1,
-  above:     { val: 3.0 * (1<<8), expand: 0 },
-  below:     { val: 1.0 * (1<<8), expand: 0 },
-  threshold: -15.33  * (1<<8),
-  energy:    2.4     * (1<<12),
-  attack:    0.013   * (1<<12),
-  decay:     0.212   * (1<<12),
+  .enable     = 1,
+  .above      { .val = 3.0 * (1<<8), .expand = 0 },
+  .below      { .val = 1.0 * (1<<8), .expand = 0 },
+  .threshold  -15.33  * (1<<8),
+  .energy     2.4     * (1<<12),
+  .attack     0.013   * (1<<12),
+  .decay      0.212   * (1<<12),
 };
 
 static struct tas_biquad_ctrl_t eqp_0e_2_1_biquads[]={
-  { channel: 0, filter: 0, data: { coeff: { 0x0FCAD3, 0xE06A58, 0x0FCAD3, 0xE06B09, 0x0F9657 } } },
-  { channel: 0, filter: 1, data: { coeff: { 0x041731, 0x082E63, 0x041731, 0xFD8D08, 0x02CFBD } } },
-  { channel: 0, filter: 2, data: { coeff: { 0x0FFDC7, 0xE0524C, 0x0FBFAA, 0xE0524C, 0x0FBD72 } } },
-  { channel: 0, filter: 3, data: { coeff: { 0x0F3D35, 0xE228CA, 0x0EC7B2, 0xE228CA, 0x0E04E8 } } },
-  { channel: 0, filter: 4, data: { coeff: { 0x0FCEBF, 0xE181C2, 0x0F2656, 0xE181C2, 0x0EF516 } } },
-  { channel: 0, filter: 5, data: { coeff: { 0x0EC417, 0x073E22, 0x0B0633, 0x073E22, 0x09CA4A } } },
-
-  { channel: 1, filter: 0, data: { coeff: { 0x0FCAD3, 0xE06A58, 0x0FCAD3, 0xE06B09, 0x0F9657 } } },
-  { channel: 1, filter: 1, data: { coeff: { 0x041731, 0x082E63, 0x041731, 0xFD8D08, 0x02CFBD } } },
-  { channel: 1, filter: 2, data: { coeff: { 0x0FFDC7, 0xE0524C, 0x0FBFAA, 0xE0524C, 0x0FBD72 } } },
-  { channel: 1, filter: 3, data: { coeff: { 0x0F3D35, 0xE228CA, 0x0EC7B2, 0xE228CA, 0x0E04E8 } } },
-  { channel: 1, filter: 4, data: { coeff: { 0x0FCEBF, 0xE181C2, 0x0F2656, 0xE181C2, 0x0EF516 } } },
-  { channel: 1, filter: 5, data: { coeff: { 0x0EC417, 0x073E22, 0x0B0633, 0x073E22, 0x09CA4A } } },
+  { .channel = 0, .filter = 0, .data = { .coeff = { 0x0FCAD3, 0xE06A58, 0x0FCAD3, 0xE06B09, 0x0F9657 } } },
+  { .channel = 0, .filter = 1, .data = { .coeff = { 0x041731, 0x082E63, 0x041731, 0xFD8D08, 0x02CFBD } } },
+  { .channel = 0, .filter = 2, .data = { .coeff = { 0x0FFDC7, 0xE0524C, 0x0FBFAA, 0xE0524C, 0x0FBD72 } } },
+  { .channel = 0, .filter = 3, .data = { .coeff = { 0x0F3D35, 0xE228CA, 0x0EC7B2, 0xE228CA, 0x0E04E8 } } },
+  { .channel = 0, .filter = 4, .data = { .coeff = { 0x0FCEBF, 0xE181C2, 0x0F2656, 0xE181C2, 0x0EF516 } } },
+  { .channel = 0, .filter = 5, .data = { .coeff = { 0x0EC417, 0x073E22, 0x0B0633, 0x073E22, 0x09CA4A } } },
+
+  { .channel = 1, .filter = 0, .data = { .coeff = { 0x0FCAD3, 0xE06A58, 0x0FCAD3, 0xE06B09, 0x0F9657 } } },
+  { .channel = 1, .filter = 1, .data = { .coeff = { 0x041731, 0x082E63, 0x041731, 0xFD8D08, 0x02CFBD } } },
+  { .channel = 1, .filter = 2, .data = { .coeff = { 0x0FFDC7, 0xE0524C, 0x0FBFAA, 0xE0524C, 0x0FBD72 } } },
+  { .channel = 1, .filter = 3, .data = { .coeff = { 0x0F3D35, 0xE228CA, 0x0EC7B2, 0xE228CA, 0x0E04E8 } } },
+  { .channel = 1, .filter = 4, .data = { .coeff = { 0x0FCEBF, 0xE181C2, 0x0F2656, 0xE181C2, 0x0EF516 } } },
+  { .channel = 1, .filter = 5, .data = { .coeff = { 0x0EC417, 0x073E22, 0x0B0633, 0x073E22, 0x09CA4A } } },
 };
 
 static struct tas_eq_pref_t eqp_0e_2_1 = {
-  sample_rate:  44100,
-  device_id:    0x0e,
-  output_id:    TAS_OUTPUT_EXTERNAL_SPKR,
-  speaker_id:   0x01,
+  .sample_rate   = 44100,
+  .device_id     = 0x0e,
+  .output_id     = TAS_OUTPUT_EXTERNAL_SPKR,
+  .speaker_id    = 0x01,
 
-  drce:         &eqp_0e_2_1_drce,
+  .drce          = &eqp_0e_2_1_drce,
 
-  filter_count: 12,
-  biquads:      eqp_0e_2_1_biquads
+  .filter_count  = 12,
+  .biquads       = eqp_0e_2_1_biquads
 };
 
 /* ======================================================================== */
 
 static struct tas_drce_t eqp_10_1_0_drce={
-  enable:    1,
-  above:     { val: 3.0 * (1<<8), expand: 0 },
-  below:     { val: 1.0 * (1<<8), expand: 0 },
-  threshold: -12.46  * (1<<8),
-  energy:    2.4     * (1<<12),
-  attack:    0.013   * (1<<12),
-  decay:     0.212   * (1<<12),
+  .enable     = 1,
+  .above      = { .val = 3.0 * (1<<8), .expand = 0 },
+  .below      = { .val = 1.0 * (1<<8), .expand = 0 },
+  .threshold  = -12.46  * (1<<8),
+  .energy     = 2.4     * (1<<12),
+  .attack     = 0.013   * (1<<12),
+  .decay      = 0.212   * (1<<12),
 };
 
 static struct tas_biquad_ctrl_t eqp_10_1_0_biquads[]={
-  { channel: 0, filter: 0, data: { coeff: { 0x0F4A12, 0xE16BDA, 0x0F4A12, 0xE173F0, 0x0E9C3A } } },
-  { channel: 0, filter: 1, data: { coeff: { 0x02DD54, 0x05BAA8, 0x02DD54, 0xF8001D, 0x037532 } } },
-  { channel: 0, filter: 2, data: { coeff: { 0x0E2FC7, 0xE4D5DC, 0x0D7477, 0xE4D5DC, 0x0BA43F } } },
-  { channel: 0, filter: 3, data: { coeff: { 0x0E7899, 0xE67CCA, 0x0D0E93, 0xE67CCA, 0x0B872D } } },
-  { channel: 0, filter: 4, data: { coeff: { 0x100000, 0x000000, 0x000000, 0x000000, 0x000000 } } },
-  { channel: 0, filter: 5, data: { coeff: { 0x100000, 0x000000, 0x000000, 0x000000, 0x000000 } } },
-
-  { channel: 1, filter: 0, data: { coeff: { 0x0F4A12, 0xE16BDA, 0x0F4A12, 0xE173F0, 0x0E9C3A } } },
-  { channel: 1, filter: 1, data: { coeff: { 0x02DD54, 0x05BAA8, 0x02DD54, 0xF8001D, 0x037532 } } },
-  { channel: 1, filter: 2, data: { coeff: { 0x0E2FC7, 0xE4D5DC, 0x0D7477, 0xE4D5DC, 0x0BA43F } } },
-  { channel: 1, filter: 3, data: { coeff: { 0x0E7899, 0xE67CCA, 0x0D0E93, 0xE67CCA, 0x0B872D } } },
-  { channel: 1, filter: 4, data: { coeff: { 0x100000, 0x000000, 0x000000, 0x000000, 0x000000 } } },
-  { channel: 1, filter: 5, data: { coeff: { 0x100000, 0x000000, 0x000000, 0x000000, 0x000000 } } },
+  { .channel = 0, .filter = 0, .data = { .coeff = { 0x0F4A12, 0xE16BDA, 0x0F4A12, 0xE173F0, 0x0E9C3A } } },
+  { .channel = 0, .filter = 1, .data = { .coeff = { 0x02DD54, 0x05BAA8, 0x02DD54, 0xF8001D, 0x037532 } } },
+  { .channel = 0, .filter = 2, .data = { .coeff = { 0x0E2FC7, 0xE4D5DC, 0x0D7477, 0xE4D5DC, 0x0BA43F } } },
+  { .channel = 0, .filter = 3, .data = { .coeff = { 0x0E7899, 0xE67CCA, 0x0D0E93, 0xE67CCA, 0x0B872D } } },
+  { .channel = 0, .filter = 4, .data = { .coeff = { 0x100000, 0x000000, 0x000000, 0x000000, 0x000000 } } },
+  { .channel = 0, .filter = 5, .data = { .coeff = { 0x100000, 0x000000, 0x000000, 0x000000, 0x000000 } } },
+
+  { .channel = 1, .filter = 0, .data = { .coeff = { 0x0F4A12, 0xE16BDA, 0x0F4A12, 0xE173F0, 0x0E9C3A } } },
+  { .channel = 1, .filter = 1, .data = { .coeff = { 0x02DD54, 0x05BAA8, 0x02DD54, 0xF8001D, 0x037532 } } },
+  { .channel = 1, .filter = 2, .data = { .coeff = { 0x0E2FC7, 0xE4D5DC, 0x0D7477, 0xE4D5DC, 0x0BA43F } } },
+  { .channel = 1, .filter = 3, .data = { .coeff = { 0x0E7899, 0xE67CCA, 0x0D0E93, 0xE67CCA, 0x0B872D } } },
+  { .channel = 1, .filter = 4, .data = { .coeff = { 0x100000, 0x000000, 0x000000, 0x000000, 0x000000 } } },
+  { .channel = 1, .filter = 5, .data = { .coeff = { 0x100000, 0x000000, 0x000000, 0x000000, 0x000000 } } },
 };
 
 static struct tas_eq_pref_t eqp_10_1_0 = {
-  sample_rate:  44100,
-  device_id:    0x10,
-  output_id:    TAS_OUTPUT_INTERNAL_SPKR,
-  speaker_id:   0x00,
+  .sample_rate   = 44100,
+  .device_id     = 0x10,
+  .output_id     = TAS_OUTPUT_INTERNAL_SPKR,
+  .speaker_id    = 0x00,
 
-  drce:         &eqp_10_1_0_drce,
+  .drce          = &eqp_10_1_0_drce,
 
-  filter_count: 12,
-  biquads:      eqp_10_1_0_biquads
+  .filter_count  = 12,
+  .biquads       = eqp_10_1_0_biquads
 };
 
 /* ======================================================================== */
 
 static struct tas_drce_t eqp_15_2_1_drce={
-  enable:    1,
-  above:     { val: 3.0 * (1<<8), expand: 0 },
-  below:     { val: 1.0 * (1<<8), expand: 0 },
-  threshold: -15.33  * (1<<8),
-  energy:    2.4     * (1<<12),
-  attack:    0.013   * (1<<12),
-  decay:     0.212   * (1<<12),
+  .enable     = 1,
+  .above      = { .val = 3.0 * (1<<8), .expand = 0 },
+  .below      = { .val = 1.0 * (1<<8), .expand = 0 },
+  .threshold  = -15.33  * (1<<8),
+  .energy     = 2.4     * (1<<12),
+  .attack     = 0.013   * (1<<12),
+  .decay      = 0.212   * (1<<12),
 };
 
 static struct tas_biquad_ctrl_t eqp_15_2_1_biquads[]={
-  { channel: 0, filter: 0, data: { coeff: { 0x0FE143, 0xE05204, 0x0FCCC5, 0xE05266, 0x0FAE6B } } },
-  { channel: 0, filter: 1, data: { coeff: { 0x102383, 0xE03A03, 0x0FA325, 0xE03A03, 0x0FC6A8 } } },
-  { channel: 0, filter: 2, data: { coeff: { 0x0FF2AB, 0xE06285, 0x0FB20A, 0xE06285, 0x0FA4B5 } } },
-  { channel: 0, filter: 3, data: { coeff: { 0x0F544D, 0xE35971, 0x0D8F3A, 0xE35971, 0x0CE388 } } },
-  { channel: 0, filter: 4, data: { coeff: { 0x13E1D3, 0xF3ECB5, 0x042227, 0xF3ECB5, 0x0803FA } } },
-  { channel: 0, filter: 5, data: { coeff: { 0x0AC119, 0x034181, 0x078AB1, 0x034181, 0x024BCA } } },
-
-  { channel: 1, filter: 0, data: { coeff: { 0x0FE143, 0xE05204, 0x0FCCC5, 0xE05266, 0x0FAE6B } } },
-  { channel: 1, filter: 1, data: { coeff: { 0x102383, 0xE03A03, 0x0FA325, 0xE03A03, 0x0FC6A8 } } },
-  { channel: 1, filter: 2, data: { coeff: { 0x0FF2AB, 0xE06285, 0x0FB20A, 0xE06285, 0x0FA4B5 } } },
-  { channel: 1, filter: 3, data: { coeff: { 0x0F544D, 0xE35971, 0x0D8F3A, 0xE35971, 0x0CE388 } } },
-  { channel: 1, filter: 4, data: { coeff: { 0x13E1D3, 0xF3ECB5, 0x042227, 0xF3ECB5, 0x0803FA } } },
-  { channel: 1, filter: 5, data: { coeff: { 0x0AC119, 0x034181, 0x078AB1, 0x034181, 0x024BCA } } },
+  { .channel = 0, .filter = 0, .data = { .coeff = { 0x0FE143, 0xE05204, 0x0FCCC5, 0xE05266, 0x0FAE6B } } },
+  { .channel = 0, .filter = 1, .data = { .coeff = { 0x102383, 0xE03A03, 0x0FA325, 0xE03A03, 0x0FC6A8 } } },
+  { .channel = 0, .filter = 2, .data = { .coeff = { 0x0FF2AB, 0xE06285, 0x0FB20A, 0xE06285, 0x0FA4B5 } } },
+  { .channel = 0, .filter = 3, .data = { .coeff = { 0x0F544D, 0xE35971, 0x0D8F3A, 0xE35971, 0x0CE388 } } },
+  { .channel = 0, .filter = 4, .data = { .coeff = { 0x13E1D3, 0xF3ECB5, 0x042227, 0xF3ECB5, 0x0803FA } } },
+  { .channel = 0, .filter = 5, .data = { .coeff = { 0x0AC119, 0x034181, 0x078AB1, 0x034181, 0x024BCA } } },
+
+  { .channel = 1, .filter = 0, .data = { .coeff = { 0x0FE143, 0xE05204, 0x0FCCC5, 0xE05266, 0x0FAE6B } } },
+  { .channel = 1, .filter = 1, .data = { .coeff = { 0x102383, 0xE03A03, 0x0FA325, 0xE03A03, 0x0FC6A8 } } },
+  { .channel = 1, .filter = 2, .data = { .coeff = { 0x0FF2AB, 0xE06285, 0x0FB20A, 0xE06285, 0x0FA4B5 } } },
+  { .channel = 1, .filter = 3, .data = { .coeff = { 0x0F544D, 0xE35971, 0x0D8F3A, 0xE35971, 0x0CE388 } } },
+  { .channel = 1, .filter = 4, .data = { .coeff = { 0x13E1D3, 0xF3ECB5, 0x042227, 0xF3ECB5, 0x0803FA } } },
+  { .channel = 1, .filter = 5, .data = { .coeff = { 0x0AC119, 0x034181, 0x078AB1, 0x034181, 0x024BCA } } },
 };
 
 static struct tas_eq_pref_t eqp_15_2_1 = {
-  sample_rate:  44100,
-  device_id:    0x15,
-  output_id:    TAS_OUTPUT_EXTERNAL_SPKR,
-  speaker_id:   0x01,
+  .sample_rate   = 44100,
+  .device_id     = 0x15,
+  .output_id     = TAS_OUTPUT_EXTERNAL_SPKR,
+  .speaker_id    = 0x01,
 
-  drce:         &eqp_15_2_1_drce,
+  .drce          = &eqp_15_2_1_drce,
 
-  filter_count: 12,
-  biquads:      eqp_15_2_1_biquads
+  .filter_count  = 12,
+  .biquads       = eqp_15_2_1_biquads
 };
 
 /* ======================================================================== */
 
 static struct tas_drce_t eqp_15_1_0_drce={
-  enable:    1,
-  above:     { val: 3.0 * (1<<8), expand: 0 },
-  below:     { val: 1.0 * (1<<8), expand: 0 },
-  threshold: 0.0     * (1<<8),
-  energy:    2.4     * (1<<12),
-  attack:    0.013   * (1<<12),
-  decay:     0.212   * (1<<12),
+  .enable     = 1,
+  .above      = { .val = 3.0 * (1<<8), .expand = 0 },
+  .below      = { .val = 1.0 * (1<<8), .expand = 0 },
+  .threshold  = 0.0     * (1<<8),
+  .energy     = 2.4     * (1<<12),
+  .attack     = 0.013   * (1<<12),
+  .decay      = 0.212   * (1<<12),
 };
 
 static struct tas_biquad_ctrl_t eqp_15_1_0_biquads[]={
-  { channel: 0, filter: 0, data: { coeff: { 0x0FAD08, 0xE0A5EF, 0x0FAD08, 0xE0A79D, 0x0F5BBE } } },
-  { channel: 0, filter: 1, data: { coeff: { 0x04B38D, 0x09671B, 0x04B38D, 0x000F71, 0x02BEC5 } } },
-  { channel: 0, filter: 2, data: { coeff: { 0x0FDD32, 0xE0A56F, 0x0F8A69, 0xE0A56F, 0x0F679C } } },
-  { channel: 0, filter: 3, data: { coeff: { 0x0FD284, 0xE135FB, 0x0F2161, 0xE135FB, 0x0EF3E5 } } },
-  { channel: 0, filter: 4, data: { coeff: { 0x0E81B1, 0xE6283F, 0x0CE49D, 0xE6283F, 0x0B664F } } },
-  { channel: 0, filter: 5, data: { coeff: { 0x0F2D62, 0xE98797, 0x0D1E19, 0xE98797, 0x0C4B7B } } },
-
-  { channel: 1, filter: 0, data: { coeff: { 0x0FAD08, 0xE0A5EF, 0x0FAD08, 0xE0A79D, 0x0F5BBE } } },
-  { channel: 1, filter: 1, data: { coeff: { 0x04B38D, 0x09671B, 0x04B38D, 0x000F71, 0x02BEC5 } } },
-  { channel: 1, filter: 2, data: { coeff: { 0x0FDD32, 0xE0A56F, 0x0F8A69, 0xE0A56F, 0x0F679C } } },
-  { channel: 1, filter: 3, data: { coeff: { 0x0FD284, 0xE135FB, 0x0F2161, 0xE135FB, 0x0EF3E5 } } },
-  { channel: 1, filter: 4, data: { coeff: { 0x0E81B1, 0xE6283F, 0x0CE49D, 0xE6283F, 0x0B664F } } },
-  { channel: 1, filter: 5, data: { coeff: { 0x0F2D62, 0xE98797, 0x0D1E19, 0xE98797, 0x0C4B7B } } },
+  { .channel = 0, .filter = 0, .data = { .coeff = { 0x0FAD08, 0xE0A5EF, 0x0FAD08, 0xE0A79D, 0x0F5BBE } } },
+  { .channel = 0, .filter = 1, .data = { .coeff = { 0x04B38D, 0x09671B, 0x04B38D, 0x000F71, 0x02BEC5 } } },
+  { .channel = 0, .filter = 2, .data = { .coeff = { 0x0FDD32, 0xE0A56F, 0x0F8A69, 0xE0A56F, 0x0F679C } } },
+  { .channel = 0, .filter = 3, .data = { .coeff = { 0x0FD284, 0xE135FB, 0x0F2161, 0xE135FB, 0x0EF3E5 } } },
+  { .channel = 0, .filter = 4, .data = { .coeff = { 0x0E81B1, 0xE6283F, 0x0CE49D, 0xE6283F, 0x0B664F } } },
+  { .channel = 0, .filter = 5, .data = { .coeff = { 0x0F2D62, 0xE98797, 0x0D1E19, 0xE98797, 0x0C4B7B } } },
+
+  { .channel = 1, .filter = 0, .data = { .coeff = { 0x0FAD08, 0xE0A5EF, 0x0FAD08, 0xE0A79D, 0x0F5BBE } } },
+  { .channel = 1, .filter = 1, .data = { .coeff = { 0x04B38D, 0x09671B, 0x04B38D, 0x000F71, 0x02BEC5 } } },
+  { .channel = 1, .filter = 2, .data = { .coeff = { 0x0FDD32, 0xE0A56F, 0x0F8A69, 0xE0A56F, 0x0F679C } } },
+  { .channel = 1, .filter = 3, .data = { .coeff = { 0x0FD284, 0xE135FB, 0x0F2161, 0xE135FB, 0x0EF3E5 } } },
+  { .channel = 1, .filter = 4, .data = { .coeff = { 0x0E81B1, 0xE6283F, 0x0CE49D, 0xE6283F, 0x0B664F } } },
+  { .channel = 1, .filter = 5, .data = { .coeff = { 0x0F2D62, 0xE98797, 0x0D1E19, 0xE98797, 0x0C4B7B } } },
 };
 
 static struct tas_eq_pref_t eqp_15_1_0 = {
-  sample_rate:  44100,
-  device_id:    0x15,
-  output_id:    TAS_OUTPUT_INTERNAL_SPKR,
-  speaker_id:   0x00,
+  .sample_rate   = 44100,
+  .device_id     = 0x15,
+  .output_id     = TAS_OUTPUT_INTERNAL_SPKR,
+  .speaker_id    = 0x00,
 
-  drce:         &eqp_15_1_0_drce,
+  .drce          = &eqp_15_1_0_drce,
 
-  filter_count: 12,
-  biquads:      eqp_15_1_0_biquads
+  .filter_count  = 12,
+  .biquads       = eqp_15_1_0_biquads
 };
 
 /* ======================================================================== */
 
 static struct tas_drce_t eqp_0f_2_1_drce={
-  enable:    1,
-  above:     { val: 3.0 * (1<<8), expand: 0 },
-  below:     { val: 1.0 * (1<<8), expand: 0 },
-  threshold: -15.33  * (1<<8),
-  energy:    2.4     * (1<<12),
-  attack:    0.013   * (1<<12),
-  decay:     0.212   * (1<<12),
+  .enable     = 1,
+  .above      = { .val = 3.0 * (1<<8), .expand = 0 },
+  .below      = { .val = 1.0 * (1<<8), .expand = 0 },
+  .threshold  = -15.33  * (1<<8),
+  .energy     = 2.4     * (1<<12),
+  .attack     = 0.013   * (1<<12),
+  .decay      = 0.212   * (1<<12),
 };
 
 static struct tas_biquad_ctrl_t eqp_0f_2_1_biquads[]={
-  { channel: 0, filter: 0, data: { coeff: { 0x0FE143, 0xE05204, 0x0FCCC5, 0xE05266, 0x0FAE6B } } },
-  { channel: 0, filter: 1, data: { coeff: { 0x102383, 0xE03A03, 0x0FA325, 0xE03A03, 0x0FC6A8 } } },
-  { channel: 0, filter: 2, data: { coeff: { 0x0FF2AB, 0xE06285, 0x0FB20A, 0xE06285, 0x0FA4B5 } } },
-  { channel: 0, filter: 3, data: { coeff: { 0x0F544D, 0xE35971, 0x0D8F3A, 0xE35971, 0x0CE388 } } },
-  { channel: 0, filter: 4, data: { coeff: { 0x13E1D3, 0xF3ECB5, 0x042227, 0xF3ECB5, 0x0803FA } } },
-  { channel: 0, filter: 5, data: { coeff: { 0x0AC119, 0x034181, 0x078AB1, 0x034181, 0x024BCA } } },
-
-  { channel: 1, filter: 0, data: { coeff: { 0x0FE143, 0xE05204, 0x0FCCC5, 0xE05266, 0x0FAE6B } } },
-  { channel: 1, filter: 1, data: { coeff: { 0x102383, 0xE03A03, 0x0FA325, 0xE03A03, 0x0FC6A8 } } },
-  { channel: 1, filter: 2, data: { coeff: { 0x0FF2AB, 0xE06285, 0x0FB20A, 0xE06285, 0x0FA4B5 } } },
-  { channel: 1, filter: 3, data: { coeff: { 0x0F544D, 0xE35971, 0x0D8F3A, 0xE35971, 0x0CE388 } } },
-  { channel: 1, filter: 4, data: { coeff: { 0x13E1D3, 0xF3ECB5, 0x042227, 0xF3ECB5, 0x0803FA } } },
-  { channel: 1, filter: 5, data: { coeff: { 0x0AC119, 0x034181, 0x078AB1, 0x034181, 0x024BCA } } },
+  { .channel = 0, .filter = 0, .data = { .coeff = { 0x0FE143, 0xE05204, 0x0FCCC5, 0xE05266, 0x0FAE6B } } },
+  { .channel = 0, .filter = 1, .data = { .coeff = { 0x102383, 0xE03A03, 0x0FA325, 0xE03A03, 0x0FC6A8 } } },
+  { .channel = 0, .filter = 2, .data = { .coeff = { 0x0FF2AB, 0xE06285, 0x0FB20A, 0xE06285, 0x0FA4B5 } } },
+  { .channel = 0, .filter = 3, .data = { .coeff = { 0x0F544D, 0xE35971, 0x0D8F3A, 0xE35971, 0x0CE388 } } },
+  { .channel = 0, .filter = 4, .data = { .coeff = { 0x13E1D3, 0xF3ECB5, 0x042227, 0xF3ECB5, 0x0803FA } } },
+  { .channel = 0, .filter = 5, .data = { .coeff = { 0x0AC119, 0x034181, 0x078AB1, 0x034181, 0x024BCA } } },
+
+  { .channel = 1, .filter = 0, .data = { .coeff = { 0x0FE143, 0xE05204, 0x0FCCC5, 0xE05266, 0x0FAE6B } } },
+  { .channel = 1, .filter = 1, .data = { .coeff = { 0x102383, 0xE03A03, 0x0FA325, 0xE03A03, 0x0FC6A8 } } },
+  { .channel = 1, .filter = 2, .data = { .coeff = { 0x0FF2AB, 0xE06285, 0x0FB20A, 0xE06285, 0x0FA4B5 } } },
+  { .channel = 1, .filter = 3, .data = { .coeff = { 0x0F544D, 0xE35971, 0x0D8F3A, 0xE35971, 0x0CE388 } } },
+  { .channel = 1, .filter = 4, .data = { .coeff = { 0x13E1D3, 0xF3ECB5, 0x042227, 0xF3ECB5, 0x0803FA } } },
+  { .channel = 1, .filter = 5, .data = { .coeff = { 0x0AC119, 0x034181, 0x078AB1, 0x034181, 0x024BCA } } },
 };
 
 static struct tas_eq_pref_t eqp_0f_2_1 = {
-  sample_rate:  44100,
-  device_id:    0x0f,
-  output_id:    TAS_OUTPUT_EXTERNAL_SPKR,
-  speaker_id:   0x01,
+  .sample_rate   = 44100,
+  .device_id     = 0x0f,
+  .output_id     = TAS_OUTPUT_EXTERNAL_SPKR,
+  .speaker_id    = 0x01,
 
-  drce:         &eqp_0f_2_1_drce,
+  .drce          = &eqp_0f_2_1_drce,
 
-  filter_count: 12,
-  biquads:      eqp_0f_2_1_biquads
+  .filter_count  = 12,
+  .biquads       = eqp_0f_2_1_biquads
 };
 
 /* ======================================================================== */
 
 static struct tas_drce_t eqp_0f_1_0_drce={
-  enable:    1,
-  above:     { val: 3.0 * (1<<8), expand: 0 },
-  below:     { val: 1.0 * (1<<8), expand: 0 },
-  threshold: -15.33  * (1<<8),
-  energy:    2.4     * (1<<12),
-  attack:    0.013   * (1<<12),
-  decay:     0.212   * (1<<12),
+  .enable     = 1,
+  .above      = { .val = 3.0 * (1<<8), .expand = 0 },
+  .below      = { .val = 1.0 * (1<<8), .expand = 0 },
+  .threshold  = -15.33  * (1<<8),
+  .energy     = 2.4     * (1<<12),
+  .attack     = 0.013   * (1<<12),
+  .decay      = 0.212   * (1<<12),
 };
 
 static struct tas_biquad_ctrl_t eqp_0f_1_0_biquads[]={
-  { channel: 0, filter: 0, data: { coeff: { 0x0FCAD3, 0xE06A58, 0x0FCAD3, 0xE06B09, 0x0F9657 } } },
-  { channel: 0, filter: 1, data: { coeff: { 0x041731, 0x082E63, 0x041731, 0xFD8D08, 0x02CFBD } } },
-  { channel: 0, filter: 2, data: { coeff: { 0x0FFDC7, 0xE0524C, 0x0FBFAA, 0xE0524C, 0x0FBD72 } } },
-  { channel: 0, filter: 3, data: { coeff: { 0x0F3D35, 0xE228CA, 0x0EC7B2, 0xE228CA, 0x0E04E8 } } },
-  { channel: 0, filter: 4, data: { coeff: { 0x0FCEBF, 0xE181C2, 0x0F2656, 0xE181C2, 0x0EF516 } } },
-  { channel: 0, filter: 5, data: { coeff: { 0x0EC417, 0x073E22, 0x0B0633, 0x073E22, 0x09CA4A } } },
-
-  { channel: 1, filter: 0, data: { coeff: { 0x0FCAD3, 0xE06A58, 0x0FCAD3, 0xE06B09, 0x0F9657 } } },
-  { channel: 1, filter: 1, data: { coeff: { 0x041731, 0x082E63, 0x041731, 0xFD8D08, 0x02CFBD } } },
-  { channel: 1, filter: 2, data: { coeff: { 0x0FFDC7, 0xE0524C, 0x0FBFAA, 0xE0524C, 0x0FBD72 } } },
-  { channel: 1, filter: 3, data: { coeff: { 0x0F3D35, 0xE228CA, 0x0EC7B2, 0xE228CA, 0x0E04E8 } } },
-  { channel: 1, filter: 4, data: { coeff: { 0x0FCEBF, 0xE181C2, 0x0F2656, 0xE181C2, 0x0EF516 } } },
-  { channel: 1, filter: 5, data: { coeff: { 0x0EC417, 0x073E22, 0x0B0633, 0x073E22, 0x09CA4A } } },
+  { .channel = 0, .filter = 0, .data = { .coeff = { 0x0FCAD3, 0xE06A58, 0x0FCAD3, 0xE06B09, 0x0F9657 } } },
+  { .channel = 0, .filter = 1, .data = { .coeff = { 0x041731, 0x082E63, 0x041731, 0xFD8D08, 0x02CFBD } } },
+  { .channel = 0, .filter = 2, .data = { .coeff = { 0x0FFDC7, 0xE0524C, 0x0FBFAA, 0xE0524C, 0x0FBD72 } } },
+  { .channel = 0, .filter = 3, .data = { .coeff = { 0x0F3D35, 0xE228CA, 0x0EC7B2, 0xE228CA, 0x0E04E8 } } },
+  { .channel = 0, .filter = 4, .data = { .coeff = { 0x0FCEBF, 0xE181C2, 0x0F2656, 0xE181C2, 0x0EF516 } } },
+  { .channel = 0, .filter = 5, .data = { .coeff = { 0x0EC417, 0x073E22, 0x0B0633, 0x073E22, 0x09CA4A } } },
+
+  { .channel = 1, .filter = 0, .data = { .coeff = { 0x0FCAD3, 0xE06A58, 0x0FCAD3, 0xE06B09, 0x0F9657 } } },
+  { .channel = 1, .filter = 1, .data = { .coeff = { 0x041731, 0x082E63, 0x041731, 0xFD8D08, 0x02CFBD } } },
+  { .channel = 1, .filter = 2, .data = { .coeff = { 0x0FFDC7, 0xE0524C, 0x0FBFAA, 0xE0524C, 0x0FBD72 } } },
+  { .channel = 1, .filter = 3, .data = { .coeff = { 0x0F3D35, 0xE228CA, 0x0EC7B2, 0xE228CA, 0x0E04E8 } } },
+  { .channel = 1, .filter = 4, .data = { .coeff = { 0x0FCEBF, 0xE181C2, 0x0F2656, 0xE181C2, 0x0EF516 } } },
+  { .channel = 1, .filter = 5, .data = { .coeff = { 0x0EC417, 0x073E22, 0x0B0633, 0x073E22, 0x09CA4A } } },
 };
 
 static struct tas_eq_pref_t eqp_0f_1_0 = {
-  sample_rate:  44100,
-  device_id:    0x0f,
-  output_id:    TAS_OUTPUT_INTERNAL_SPKR,
-  speaker_id:   0x00,
+  .sample_rate   = 44100,
+  .device_id     = 0x0f,
+  .output_id     = TAS_OUTPUT_INTERNAL_SPKR,
+  .speaker_id    = 0x00,
 
-  drce:         &eqp_0f_1_0_drce,
+  .drce          = &eqp_0f_1_0_drce,
 
-  filter_count: 12,
-  biquads:      eqp_0f_1_0_biquads
+  .filter_count  = 12,
+  .biquads       = eqp_0f_1_0_biquads
 };
 
 /* ======================================================================== */
@@ -358,10 +358,10 @@
 };
 
 struct tas_gain_t tas3001c_gain = {
-  master: tas3001c_master_tab,
-  treble: tas3001c_treble_tab,
-  bass:   tas3001c_bass_tab,
-  mixer:  tas3001c_mixer_tab
+  .master  = tas3001c_master_tab,
+  .treble  = tas3001c_treble_tab,
+  .bass    = tas3001c_bass_tab,
+  .mixer   = tas3001c_mixer_tab
 };
 
 struct tas_eq_pref_t *tas3001c_eq_prefs[]={
--- diff/sound/oss/dmasound/tas3004_tables.c	2003-09-30 15:46:21.000000000 +0100
+++ source/sound/oss/dmasound/tas3004_tables.c	2004-02-09 10:39:58.000000000 +0000
@@ -2,169 +2,169 @@
 #include "tas_eq_prefs.h"
 
 static struct tas_drce_t eqp_17_1_0_drce={
-    enable:    1,
-    above:     { val: 3.0 * (1<<8), expand: 0 },
-    below:     { val: 1.0 * (1<<8), expand: 0 },
-    threshold: -19.12  * (1<<8),
-    energy:    2.4     * (1<<12),
-    attack:    0.013   * (1<<12),
-    decay:     0.212   * (1<<12),
+    .enable     = 1,
+    .above      = { .val = 3.0 * (1<<8), .expand = 0 },
+    .below      = { .val = 1.0 * (1<<8), .expand = 0 },
+    .threshold  = -19.12  * (1<<8),
+    .energy     = 2.4     * (1<<12),
+    .attack     = 0.013   * (1<<12),
+    .decay      = 0.212   * (1<<12),
 };
 
 static struct tas_biquad_ctrl_t eqp_17_1_0_biquads[]={
-  { channel: 0, filter: 0, data: { coeff: { 0x0fd0d4, 0xe05e56, 0x0fd0d4, 0xe05ee1, 0x0fa234 } } },
-  { channel: 0, filter: 1, data: { coeff: { 0x0910d7, 0x088e1a, 0x030651, 0x01dcb1, 0x02c892 } } },
-  { channel: 0, filter: 2, data: { coeff: { 0x0ff895, 0xe0970b, 0x0f7f00, 0xe0970b, 0x0f7795 } } },
-  { channel: 0, filter: 3, data: { coeff: { 0x0fd1c4, 0xe1ac22, 0x0ec8cf, 0xe1ac22, 0x0e9a94 } } },
-  { channel: 0, filter: 4, data: { coeff: { 0x0f7c1c, 0xe3cc03, 0x0df786, 0xe3cc03, 0x0d73a2 } } },
-  { channel: 0, filter: 5, data: { coeff: { 0x11fb92, 0xf5a1a0, 0x073cd2, 0xf5a1a0, 0x093865 } } },
-  { channel: 0, filter: 6, data: { coeff: { 0x0e17a9, 0x068b6c, 0x08a0e5, 0x068b6c, 0x06b88e } } },
-
-  { channel: 1, filter: 0, data: { coeff: { 0x0fd0d4, 0xe05e56, 0x0fd0d4, 0xe05ee1, 0x0fa234 } } },
-  { channel: 1, filter: 1, data: { coeff: { 0x0910d7, 0x088e1a, 0x030651, 0x01dcb1, 0x02c892 } } },
-  { channel: 1, filter: 2, data: { coeff: { 0x0ff895, 0xe0970b, 0x0f7f00, 0xe0970b, 0x0f7795 } } },
-  { channel: 1, filter: 3, data: { coeff: { 0x0fd1c4, 0xe1ac22, 0x0ec8cf, 0xe1ac22, 0x0e9a94 } } },
-  { channel: 1, filter: 4, data: { coeff: { 0x0f7c1c, 0xe3cc03, 0x0df786, 0xe3cc03, 0x0d73a2 } } },
-  { channel: 1, filter: 5, data: { coeff: { 0x11fb92, 0xf5a1a0, 0x073cd2, 0xf5a1a0, 0x093865 } } },
-  { channel: 1, filter: 6, data: { coeff: { 0x0e17a9, 0x068b6c, 0x08a0e5, 0x068b6c, 0x06b88e } } }
+  { .channel = 0, .filter = 0, .data = { .coeff = { 0x0fd0d4, 0xe05e56, 0x0fd0d4, 0xe05ee1, 0x0fa234 } } },
+  { .channel = 0, .filter = 1, .data = { .coeff = { 0x0910d7, 0x088e1a, 0x030651, 0x01dcb1, 0x02c892 } } },
+  { .channel = 0, .filter = 2, .data = { .coeff = { 0x0ff895, 0xe0970b, 0x0f7f00, 0xe0970b, 0x0f7795 } } },
+  { .channel = 0, .filter = 3, .data = { .coeff = { 0x0fd1c4, 0xe1ac22, 0x0ec8cf, 0xe1ac22, 0x0e9a94 } } },
+  { .channel = 0, .filter = 4, .data = { .coeff = { 0x0f7c1c, 0xe3cc03, 0x0df786, 0xe3cc03, 0x0d73a2 } } },
+  { .channel = 0, .filter = 5, .data = { .coeff = { 0x11fb92, 0xf5a1a0, 0x073cd2, 0xf5a1a0, 0x093865 } } },
+  { .channel = 0, .filter = 6, .data = { .coeff = { 0x0e17a9, 0x068b6c, 0x08a0e5, 0x068b6c, 0x06b88e } } },
+
+  { .channel = 1, .filter = 0, .data = { .coeff = { 0x0fd0d4, 0xe05e56, 0x0fd0d4, 0xe05ee1, 0x0fa234 } } },
+  { .channel = 1, .filter = 1, .data = { .coeff = { 0x0910d7, 0x088e1a, 0x030651, 0x01dcb1, 0x02c892 } } },
+  { .channel = 1, .filter = 2, .data = { .coeff = { 0x0ff895, 0xe0970b, 0x0f7f00, 0xe0970b, 0x0f7795 } } },
+  { .channel = 1, .filter = 3, .data = { .coeff = { 0x0fd1c4, 0xe1ac22, 0x0ec8cf, 0xe1ac22, 0x0e9a94 } } },
+  { .channel = 1, .filter = 4, .data = { .coeff = { 0x0f7c1c, 0xe3cc03, 0x0df786, 0xe3cc03, 0x0d73a2 } } },
+  { .channel = 1, .filter = 5, .data = { .coeff = { 0x11fb92, 0xf5a1a0, 0x073cd2, 0xf5a1a0, 0x093865 } } },
+  { .channel = 1, .filter = 6, .data = { .coeff = { 0x0e17a9, 0x068b6c, 0x08a0e5, 0x068b6c, 0x06b88e } } }
 };
 
 static struct tas_eq_pref_t eqp_17_1_0 = {
-  sample_rate:  44100,
-  device_id:    0x17,
-  output_id:    TAS_OUTPUT_INTERNAL_SPKR,
-  speaker_id:   0x00,
+  .sample_rate   = 44100,
+  .device_id     = 0x17,
+  .output_id     = TAS_OUTPUT_INTERNAL_SPKR,
+  .speaker_id    = 0x00,
 
-  drce:         &eqp_17_1_0_drce,
+  .drce          = &eqp_17_1_0_drce,
 
-  filter_count: 14,
-  biquads:      eqp_17_1_0_biquads
+  .filter_count  = 14,
+  .biquads       = eqp_17_1_0_biquads
 };
 
 /* ======================================================================== */
 
 static struct tas_drce_t eqp_18_1_0_drce={
-  enable:    1,
-  above:     { val: 3.0 * (1<<8), expand: 0 },
-  below:     { val: 1.0 * (1<<8), expand: 0 },
-  threshold: -13.14  * (1<<8),
-  energy:    2.4     * (1<<12),
-  attack:    0.013   * (1<<12),
-  decay:     0.212   * (1<<12),
+  .enable     = 1,
+  .above      = { .val = 3.0 * (1<<8), .expand = 0 },
+  .below      = { .val = 1.0 * (1<<8), .expand = 0 },
+  .threshold  = -13.14  * (1<<8),
+  .energy     = 2.4     * (1<<12),
+  .attack     = 0.013   * (1<<12),
+  .decay      = 0.212   * (1<<12),
 };
 
 static struct tas_biquad_ctrl_t eqp_18_1_0_biquads[]={
-  { channel: 0, filter: 0, data: { coeff: { 0x0f5514, 0xe155d7, 0x0f5514, 0xe15cfa, 0x0eb14b } } },
-  { channel: 0, filter: 1, data: { coeff: { 0x06ec33, 0x02abe3, 0x015eef, 0xf764d9, 0x03922d } } },
-  { channel: 0, filter: 2, data: { coeff: { 0x0ef5f2, 0xe67d1f, 0x0bcf37, 0xe67d1f, 0x0ac529 } } },
-  { channel: 0, filter: 3, data: { coeff: { 0x0db050, 0xe5be4d, 0x0d0c78, 0xe5be4d, 0x0abcc8 } } },
-  { channel: 0, filter: 4, data: { coeff: { 0x0f1298, 0xe64ec6, 0x0cc03e, 0xe64ec6, 0x0bd2d7 } } },
-  { channel: 0, filter: 5, data: { coeff: { 0x0c641a, 0x06537a, 0x08d155, 0x06537a, 0x053570 } } },
-  { channel: 0, filter: 6, data: { coeff: { 0x100000, 0x000000, 0x000000, 0x000000, 0x000000 } } },
-
-  { channel: 1, filter: 0, data: { coeff: { 0x0f5514, 0xe155d7, 0x0f5514, 0xe15cfa, 0x0eb14b } } },
-  { channel: 1, filter: 1, data: { coeff: { 0x06ec33, 0x02abe3, 0x015eef, 0xf764d9, 0x03922d } } },
-  { channel: 1, filter: 2, data: { coeff: { 0x0ef5f2, 0xe67d1f, 0x0bcf37, 0xe67d1f, 0x0ac529 } } },
-  { channel: 1, filter: 3, data: { coeff: { 0x0db050, 0xe5be4d, 0x0d0c78, 0xe5be4d, 0x0abcc8 } } },
-  { channel: 1, filter: 4, data: { coeff: { 0x0f1298, 0xe64ec6, 0x0cc03e, 0xe64ec6, 0x0bd2d7 } } },
-  { channel: 1, filter: 5, data: { coeff: { 0x0c641a, 0x06537a, 0x08d155, 0x06537a, 0x053570 } } },
-  { channel: 1, filter: 6, data: { coeff: { 0x100000, 0x000000, 0x000000, 0x000000, 0x000000 } } }
+  { .channel = 0, .filter = 0, .data = { .coeff = { 0x0f5514, 0xe155d7, 0x0f5514, 0xe15cfa, 0x0eb14b } } },
+  { .channel = 0, .filter = 1, .data = { .coeff = { 0x06ec33, 0x02abe3, 0x015eef, 0xf764d9, 0x03922d } } },
+  { .channel = 0, .filter = 2, .data = { .coeff = { 0x0ef5f2, 0xe67d1f, 0x0bcf37, 0xe67d1f, 0x0ac529 } } },
+  { .channel = 0, .filter = 3, .data = { .coeff = { 0x0db050, 0xe5be4d, 0x0d0c78, 0xe5be4d, 0x0abcc8 } } },
+  { .channel = 0, .filter = 4, .data = { .coeff = { 0x0f1298, 0xe64ec6, 0x0cc03e, 0xe64ec6, 0x0bd2d7 } } },
+  { .channel = 0, .filter = 5, .data = { .coeff = { 0x0c641a, 0x06537a, 0x08d155, 0x06537a, 0x053570 } } },
+  { .channel = 0, .filter = 6, .data = { .coeff = { 0x100000, 0x000000, 0x000000, 0x000000, 0x000000 } } },
+
+  { .channel = 1, .filter = 0, .data = { .coeff = { 0x0f5514, 0xe155d7, 0x0f5514, 0xe15cfa, 0x0eb14b } } },
+  { .channel = 1, .filter = 1, .data = { .coeff = { 0x06ec33, 0x02abe3, 0x015eef, 0xf764d9, 0x03922d } } },
+  { .channel = 1, .filter = 2, .data = { .coeff = { 0x0ef5f2, 0xe67d1f, 0x0bcf37, 0xe67d1f, 0x0ac529 } } },
+  { .channel = 1, .filter = 3, .data = { .coeff = { 0x0db050, 0xe5be4d, 0x0d0c78, 0xe5be4d, 0x0abcc8 } } },
+  { .channel = 1, .filter = 4, .data = { .coeff = { 0x0f1298, 0xe64ec6, 0x0cc03e, 0xe64ec6, 0x0bd2d7 } } },
+  { .channel = 1, .filter = 5, .data = { .coeff = { 0x0c641a, 0x06537a, 0x08d155, 0x06537a, 0x053570 } } },
+  { .channel = 1, .filter = 6, .data = { .coeff = { 0x100000, 0x000000, 0x000000, 0x000000, 0x000000 } } }
 };
 
 static struct tas_eq_pref_t eqp_18_1_0 = {
-  sample_rate:  44100,
-  device_id:    0x18,
-  output_id:    TAS_OUTPUT_INTERNAL_SPKR,
-  speaker_id:   0x00,
+  .sample_rate   = 44100,
+  .device_id     = 0x18,
+  .output_id     = TAS_OUTPUT_INTERNAL_SPKR,
+  .speaker_id    = 0x00,
 
-  drce:         &eqp_18_1_0_drce,
+  .drce          = &eqp_18_1_0_drce,
 
-  filter_count: 14,
-  biquads:      eqp_18_1_0_biquads
+  .filter_count  = 14,
+  .biquads       = eqp_18_1_0_biquads
 };
 
 /* ======================================================================== */
 
 static struct tas_drce_t eqp_1a_1_0_drce={
-  enable:    1,
-  above:     { val: 3.0 * (1<<8), expand: 0 },
-  below:     { val: 1.0 * (1<<8), expand: 0 },
-  threshold: -10.75  * (1<<8),
-  energy:    2.4     * (1<<12),
-  attack:    0.013   * (1<<12),
-  decay:     0.212   * (1<<12),
+  .enable     = 1,
+  .above      = { .val = 3.0 * (1<<8), .expand = 0 },
+  .below      = { .val = 1.0 * (1<<8), .expand = 0 },
+  .threshold  = -10.75  * (1<<8),
+  .energy     = 2.4     * (1<<12),
+  .attack     = 0.013   * (1<<12),
+  .decay      = 0.212   * (1<<12),
 };
 
 static struct tas_biquad_ctrl_t eqp_1a_1_0_biquads[]={
-  { channel: 0, filter: 0, data: { coeff: { 0x0fb8fd, 0xe08e04, 0x0fb8fd, 0xe08f40, 0x0f7336 } } },
-  { channel: 0, filter: 1, data: { coeff: { 0x06371d, 0x0c6e3a, 0x06371d, 0x05bfd3, 0x031ca2 } } },
-  { channel: 0, filter: 2, data: { coeff: { 0x0fa1c0, 0xe18692, 0x0f030e, 0xe18692, 0x0ea4ce } } },
-  { channel: 0, filter: 3, data: { coeff: { 0x0fe495, 0xe17eff, 0x0f0452, 0xe17eff, 0x0ee8e7 } } },
-  { channel: 0, filter: 4, data: { coeff: { 0x100857, 0xe7e71c, 0x0e9599, 0xe7e71c, 0x0e9df1 } } },
-  { channel: 0, filter: 5, data: { coeff: { 0x0fb26e, 0x06a82c, 0x0db2b4, 0x06a82c, 0x0d6522 } } },
-  { channel: 0, filter: 6, data: { coeff: { 0x11419d, 0xf06cbf, 0x0a4f6e, 0xf06cbf, 0x0b910c } } },
-
-  { channel: 1, filter: 0, data: { coeff: { 0x0fb8fd, 0xe08e04, 0x0fb8fd, 0xe08f40, 0x0f7336 } } },
-  { channel: 1, filter: 1, data: { coeff: { 0x06371d, 0x0c6e3a, 0x06371d, 0x05bfd3, 0x031ca2 } } },
-  { channel: 1, filter: 2, data: { coeff: { 0x0fa1c0, 0xe18692, 0x0f030e, 0xe18692, 0x0ea4ce } } },
-  { channel: 1, filter: 3, data: { coeff: { 0x0fe495, 0xe17eff, 0x0f0452, 0xe17eff, 0x0ee8e7 } } },
-  { channel: 1, filter: 4, data: { coeff: { 0x100857, 0xe7e71c, 0x0e9599, 0xe7e71c, 0x0e9df1 } } },
-  { channel: 1, filter: 5, data: { coeff: { 0x0fb26e, 0x06a82c, 0x0db2b4, 0x06a82c, 0x0d6522 } } },
-  { channel: 1, filter: 6, data: { coeff: { 0x11419d, 0xf06cbf, 0x0a4f6e, 0xf06cbf, 0x0b910c } } }
+  { .channel = 0, .filter = 0, .data = { .coeff = { 0x0fb8fd, 0xe08e04, 0x0fb8fd, 0xe08f40, 0x0f7336 } } },
+  { .channel = 0, .filter = 1, .data = { .coeff = { 0x06371d, 0x0c6e3a, 0x06371d, 0x05bfd3, 0x031ca2 } } },
+  { .channel = 0, .filter = 2, .data = { .coeff = { 0x0fa1c0, 0xe18692, 0x0f030e, 0xe18692, 0x0ea4ce } } },
+  { .channel = 0, .filter = 3, .data = { .coeff = { 0x0fe495, 0xe17eff, 0x0f0452, 0xe17eff, 0x0ee8e7 } } },
+  { .channel = 0, .filter = 4, .data = { .coeff = { 0x100857, 0xe7e71c, 0x0e9599, 0xe7e71c, 0x0e9df1 } } },
+  { .channel = 0, .filter = 5, .data = { .coeff = { 0x0fb26e, 0x06a82c, 0x0db2b4, 0x06a82c, 0x0d6522 } } },
+  { .channel = 0, .filter = 6, .data = { .coeff = { 0x11419d, 0xf06cbf, 0x0a4f6e, 0xf06cbf, 0x0b910c } } },
+
+  { .channel = 1, .filter = 0, .data = { .coeff = { 0x0fb8fd, 0xe08e04, 0x0fb8fd, 0xe08f40, 0x0f7336 } } },
+  { .channel = 1, .filter = 1, .data = { .coeff = { 0x06371d, 0x0c6e3a, 0x06371d, 0x05bfd3, 0x031ca2 } } },
+  { .channel = 1, .filter = 2, .data = { .coeff = { 0x0fa1c0, 0xe18692, 0x0f030e, 0xe18692, 0x0ea4ce } } },
+  { .channel = 1, .filter = 3, .data = { .coeff = { 0x0fe495, 0xe17eff, 0x0f0452, 0xe17eff, 0x0ee8e7 } } },
+  { .channel = 1, .filter = 4, .data = { .coeff = { 0x100857, 0xe7e71c, 0x0e9599, 0xe7e71c, 0x0e9df1 } } },
+  { .channel = 1, .filter = 5, .data = { .coeff = { 0x0fb26e, 0x06a82c, 0x0db2b4, 0x06a82c, 0x0d6522 } } },
+  { .channel = 1, .filter = 6, .data = { .coeff = { 0x11419d, 0xf06cbf, 0x0a4f6e, 0xf06cbf, 0x0b910c } } }
 };
 
 static struct tas_eq_pref_t eqp_1a_1_0 = {
-  sample_rate:  44100,
-  device_id:    0x1a,
-  output_id:    TAS_OUTPUT_INTERNAL_SPKR,
-  speaker_id:   0x00,
+  .sample_rate   = 44100,
+  .device_id     = 0x1a,
+  .output_id     = TAS_OUTPUT_INTERNAL_SPKR,
+  .speaker_id    = 0x00,
 
-  drce:         &eqp_1a_1_0_drce,
+  .drce          = &eqp_1a_1_0_drce,
 
-  filter_count: 14,
-  biquads:      eqp_1a_1_0_biquads
+  .filter_count  = 14,
+  .biquads       = eqp_1a_1_0_biquads
 };
 
 /* ======================================================================== */
 
 static struct tas_drce_t eqp_1c_1_0_drce={
-  enable:    1,
-  above:     { val: 3.0 * (1<<8), expand: 0 },
-  below:     { val: 1.0 * (1<<8), expand: 0 },
-  threshold: -14.34  * (1<<8),
-  energy:    2.4     * (1<<12),
-  attack:    0.013   * (1<<12),
-  decay:     0.212   * (1<<12),
+  .enable     = 1,
+  .above      = { .val = 3.0 * (1<<8), .expand = 0 },
+  .below      = { .val = 1.0 * (1<<8), .expand = 0 },
+  .threshold  = -14.34  * (1<<8),
+  .energy     = 2.4     * (1<<12),
+  .attack     = 0.013   * (1<<12),
+  .decay      = 0.212   * (1<<12),
 };
 
 static struct tas_biquad_ctrl_t eqp_1c_1_0_biquads[]={
-  { channel: 0, filter: 0, data: { coeff: { 0x0f4f95, 0xe160d4, 0x0f4f95, 0xe1686e, 0x0ea6c5 } } },
-  { channel: 0, filter: 1, data: { coeff: { 0x066b92, 0x0290d4, 0x0148a0, 0xf6853f, 0x03bfc7 } } },
-  { channel: 0, filter: 2, data: { coeff: { 0x0f57dc, 0xe51c91, 0x0dd1cb, 0xe51c91, 0x0d29a8 } } },
-  { channel: 0, filter: 3, data: { coeff: { 0x0df1cb, 0xe4fa84, 0x0d7cdc, 0xe4fa84, 0x0b6ea7 } } },
-  { channel: 0, filter: 4, data: { coeff: { 0x0eba36, 0xe6aa48, 0x0b9f52, 0xe6aa48, 0x0a5989 } } },
-  { channel: 0, filter: 5, data: { coeff: { 0x0caf02, 0x05ef9d, 0x084beb, 0x05ef9d, 0x04faee } } },
-  { channel: 0, filter: 6, data: { coeff: { 0x0fc686, 0xe22947, 0x0e4b5d, 0xe22947, 0x0e11e4 } } },
-
-  { channel: 1, filter: 0, data: { coeff: { 0x0f4f95, 0xe160d4, 0x0f4f95, 0xe1686e, 0x0ea6c5 } } },
-  { channel: 1, filter: 1, data: { coeff: { 0x066b92, 0x0290d4, 0x0148a0, 0xf6853f, 0x03bfc7 } } },
-  { channel: 1, filter: 2, data: { coeff: { 0x0f57dc, 0xe51c91, 0x0dd1cb, 0xe51c91, 0x0d29a8 } } },
-  { channel: 1, filter: 3, data: { coeff: { 0x0df1cb, 0xe4fa84, 0x0d7cdc, 0xe4fa84, 0x0b6ea7 } } },
-  { channel: 1, filter: 4, data: { coeff: { 0x0eba36, 0xe6aa48, 0x0b9f52, 0xe6aa48, 0x0a5989 } } },
-  { channel: 1, filter: 5, data: { coeff: { 0x0caf02, 0x05ef9d, 0x084beb, 0x05ef9d, 0x04faee } } },
-  { channel: 1, filter: 6, data: { coeff: { 0x0fc686, 0xe22947, 0x0e4b5d, 0xe22947, 0x0e11e4 } } }
+  { .channel = 0, .filter = 0, .data = { .coeff = { 0x0f4f95, 0xe160d4, 0x0f4f95, 0xe1686e, 0x0ea6c5 } } },
+  { .channel = 0, .filter = 1, .data = { .coeff = { 0x066b92, 0x0290d4, 0x0148a0, 0xf6853f, 0x03bfc7 } } },
+  { .channel = 0, .filter = 2, .data = { .coeff = { 0x0f57dc, 0xe51c91, 0x0dd1cb, 0xe51c91, 0x0d29a8 } } },
+  { .channel = 0, .filter = 3, .data = { .coeff = { 0x0df1cb, 0xe4fa84, 0x0d7cdc, 0xe4fa84, 0x0b6ea7 } } },
+  { .channel = 0, .filter = 4, .data = { .coeff = { 0x0eba36, 0xe6aa48, 0x0b9f52, 0xe6aa48, 0x0a5989 } } },
+  { .channel = 0, .filter = 5, .data = { .coeff = { 0x0caf02, 0x05ef9d, 0x084beb, 0x05ef9d, 0x04faee } } },
+  { .channel = 0, .filter = 6, .data = { .coeff = { 0x0fc686, 0xe22947, 0x0e4b5d, 0xe22947, 0x0e11e4 } } },
+
+  { .channel = 1, .filter = 0, .data = { .coeff = { 0x0f4f95, 0xe160d4, 0x0f4f95, 0xe1686e, 0x0ea6c5 } } },
+  { .channel = 1, .filter = 1, .data = { .coeff = { 0x066b92, 0x0290d4, 0x0148a0, 0xf6853f, 0x03bfc7 } } },
+  { .channel = 1, .filter = 2, .data = { .coeff = { 0x0f57dc, 0xe51c91, 0x0dd1cb, 0xe51c91, 0x0d29a8 } } },
+  { .channel = 1, .filter = 3, .data = { .coeff = { 0x0df1cb, 0xe4fa84, 0x0d7cdc, 0xe4fa84, 0x0b6ea7 } } },
+  { .channel = 1, .filter = 4, .data = { .coeff = { 0x0eba36, 0xe6aa48, 0x0b9f52, 0xe6aa48, 0x0a5989 } } },
+  { .channel = 1, .filter = 5, .data = { .coeff = { 0x0caf02, 0x05ef9d, 0x084beb, 0x05ef9d, 0x04faee } } },
+  { .channel = 1, .filter = 6, .data = { .coeff = { 0x0fc686, 0xe22947, 0x0e4b5d, 0xe22947, 0x0e11e4 } } }
 };
 
 static struct tas_eq_pref_t eqp_1c_1_0 = {
-  sample_rate:  44100,
-  device_id:    0x1c,
-  output_id:    TAS_OUTPUT_INTERNAL_SPKR,
-  speaker_id:   0x00,
+  .sample_rate   = 44100,
+  .device_id     = 0x1c,
+  .output_id     = TAS_OUTPUT_INTERNAL_SPKR,
+  .speaker_id    = 0x00,
 
-  drce:         &eqp_1c_1_0_drce,
+  .drce          = &eqp_1c_1_0_drce,
 
-  filter_count: 14,
-  biquads:      eqp_1c_1_0_biquads
+  .filter_count  = 14,
+  .biquads       = eqp_1c_1_0_biquads
 };
 
 /* ======================================================================== */
@@ -286,10 +286,10 @@
 };
 
 struct tas_gain_t tas3004_gain={
-  master: tas3004_master_tab,
-  treble: tas3004_treble_tab,
-  bass:   tas3004_bass_tab,
-  mixer:  tas3004_mixer_tab
+  .master  = tas3004_master_tab,
+  .treble  = tas3004_treble_tab,
+  .bass    = tas3004_bass_tab,
+  .mixer   = tas3004_mixer_tab
 };
 
 struct tas_eq_pref_t *tas3004_eq_prefs[]={
--- diff/sound/oss/dmasound/trans_16.c	2003-09-30 15:46:21.000000000 +0100
+++ source/sound/oss/dmasound/trans_16.c	2004-02-09 10:39:58.000000000 +0000
@@ -573,34 +573,34 @@
 }
 
 TRANS transAwacsNormal = {
-	ct_ulaw:	pmac_ct_law,
-	ct_alaw:	pmac_ct_law,
-	ct_s8:		pmac_ct_s8,
-	ct_u8:		pmac_ct_u8,
-	ct_s16be:	pmac_ct_s16,
-	ct_u16be:	pmac_ct_u16,
-	ct_s16le:	pmac_ct_s16,
-	ct_u16le:	pmac_ct_u16,
+	.ct_ulaw=	pmac_ct_law,
+	.ct_alaw=	pmac_ct_law,
+	.ct_s8=		pmac_ct_s8,
+	.ct_u8=		pmac_ct_u8,
+	.ct_s16be=	pmac_ct_s16,
+	.ct_u16be=	pmac_ct_u16,
+	.ct_s16le=	pmac_ct_s16,
+	.ct_u16le=	pmac_ct_u16,
 };
 
 TRANS transAwacsExpand = {
-	ct_ulaw:	pmac_ctx_law,
-	ct_alaw:	pmac_ctx_law,
-	ct_s8:		pmac_ctx_s8,
-	ct_u8:		pmac_ctx_u8,
-	ct_s16be:	pmac_ctx_s16,
-	ct_u16be:	pmac_ctx_u16,
-	ct_s16le:	pmac_ctx_s16,
-	ct_u16le:	pmac_ctx_u16,
+	.ct_ulaw=	pmac_ctx_law,
+	.ct_alaw=	pmac_ctx_law,
+	.ct_s8=		pmac_ctx_s8,
+	.ct_u8=		pmac_ctx_u8,
+	.ct_s16be=	pmac_ctx_s16,
+	.ct_u16be=	pmac_ctx_u16,
+	.ct_s16le=	pmac_ctx_s16,
+	.ct_u16le=	pmac_ctx_u16,
 };
 
 TRANS transAwacsNormalRead = {
-	ct_s8:		pmac_ct_s8_read,
-	ct_u8:		pmac_ct_u8_read,
-	ct_s16be:	pmac_ct_s16_read,
-	ct_u16be:	pmac_ct_u16_read,
-	ct_s16le:	pmac_ct_s16_read,
-	ct_u16le:	pmac_ct_u16_read,
+	.ct_s8=		pmac_ct_s8_read,
+	.ct_u8=		pmac_ct_u8_read,
+	.ct_s16be=	pmac_ct_s16_read,
+	.ct_u16be=	pmac_ct_u16_read,
+	.ct_s16le=	pmac_ct_s16_read,
+	.ct_u16le=	pmac_ct_u16_read,
 };
 
 /* translation tables */
--- diff/sound/oss/sb_card.h	2003-05-21 11:50:01.000000000 +0100
+++ source/sound/oss/sb_card.h	2004-02-09 10:39:58.000000000 +0000
@@ -25,119 +25,119 @@
 /* Card PnP ID Table */
 static struct pnp_card_device_id sb_pnp_card_table[] = {
 	/* Sound Blaster 16 */
-	{.id = "CTL0024", .driver_data = 0, devs : { {.id="CTL0031"}, } },
+	{.id = "CTL0024", .driver_data = 0, .devs = { {.id="CTL0031"}, } },
 	/* Sound Blaster 16 */
-	{.id = "CTL0025", .driver_data = 0, devs : { {.id="CTL0031"}, } },
+	{.id = "CTL0025", .driver_data = 0, .devs = { {.id="CTL0031"}, } },
 	/* Sound Blaster 16 */
-	{.id = "CTL0026", .driver_data = 0, devs : { {.id="CTL0031"}, } },
+	{.id = "CTL0026", .driver_data = 0, .devs = { {.id="CTL0031"}, } },
 	/* Sound Blaster 16 */
-	{.id = "CTL0027", .driver_data = 0, devs : { {.id="CTL0031"}, } },
+	{.id = "CTL0027", .driver_data = 0, .devs = { {.id="CTL0031"}, } },
 	/* Sound Blaster 16 */
-	{.id = "CTL0028", .driver_data = 0, devs : { {.id="CTL0031"}, } },
+	{.id = "CTL0028", .driver_data = 0, .devs = { {.id="CTL0031"}, } },
 	/* Sound Blaster 16 */
-	{.id = "CTL0029", .driver_data = 0, devs : { {.id="CTL0031"}, } },
+	{.id = "CTL0029", .driver_data = 0, .devs = { {.id="CTL0031"}, } },
 	/* Sound Blaster 16 */
-	{.id = "CTL002a", .driver_data = 0, devs : { {.id="CTL0031"}, } },
+	{.id = "CTL002a", .driver_data = 0, .devs = { {.id="CTL0031"}, } },
 	/* Sound Blaster 16 */
-	{.id = "CTL002b", .driver_data = 0, devs : { {.id="CTL0031"}, } },
+	{.id = "CTL002b", .driver_data = 0, .devs = { {.id="CTL0031"}, } },
 	/* Sound Blaster 16 */
-	{.id = "CTL002c", .driver_data = 0, devs : { {.id="CTL0031"}, } },
+	{.id = "CTL002c", .driver_data = 0, .devs = { {.id="CTL0031"}, } },
 	/* Sound Blaster 16 */
-	{.id = "CTL00ed", .driver_data = 0, devs : { {.id="CTL0041"}, } },
+	{.id = "CTL00ed", .driver_data = 0, .devs = { {.id="CTL0041"}, } },
 	/* Sound Blaster 16 */
-	{.id = "CTL0086", .driver_data = 0, devs : { {.id="CTL0041"}, } },
+	{.id = "CTL0086", .driver_data = 0, .devs = { {.id="CTL0041"}, } },
 	/* Sound Blaster Vibra16S */
-	{.id = "CTL0051", .driver_data = 0, devs : { {.id="CTL0001"}, } },
+	{.id = "CTL0051", .driver_data = 0, .devs = { {.id="CTL0001"}, } },
 	/* Sound Blaster Vibra16C */
-	{.id = "CTL0070", .driver_data = 0, devs : { {.id="CTL0001"}, } },
+	{.id = "CTL0070", .driver_data = 0, .devs = { {.id="CTL0001"}, } },
 	/* Sound Blaster Vibra16CL */
-	{.id = "CTL0080", .driver_data = 0, devs : { {.id="CTL0041"}, } },
+	{.id = "CTL0080", .driver_data = 0, .devs = { {.id="CTL0041"}, } },
 	/* Sound Blaster Vibra16CL */
-	{.id = "CTL00F0", .driver_data = 0, devs : { {.id="CTL0043"}, } },
+	{.id = "CTL00F0", .driver_data = 0, .devs = { {.id="CTL0043"}, } },
 	/* Sound Blaster AWE 32 */
-	{.id = "CTL0039", .driver_data = 0, devs : { {.id="CTL0031"}, } },
+	{.id = "CTL0039", .driver_data = 0, .devs = { {.id="CTL0031"}, } },
 	/* Sound Blaster AWE 32 */
-	{.id = "CTL0042", .driver_data = 0, devs : { {.id="CTL0031"}, } },
+	{.id = "CTL0042", .driver_data = 0, .devs = { {.id="CTL0031"}, } },
 	/* Sound Blaster AWE 32 */
-	{.id = "CTL0043", .driver_data = 0, devs : { {.id="CTL0031"}, } },
+	{.id = "CTL0043", .driver_data = 0, .devs = { {.id="CTL0031"}, } },
 	/* Sound Blaster AWE 32 */
-	{.id = "CTL0044", .driver_data = 0, devs : { {.id="CTL0031"}, } },
+	{.id = "CTL0044", .driver_data = 0, .devs = { {.id="CTL0031"}, } },
 	/* Sound Blaster AWE 32 */
-	{.id = "CTL0045", .driver_data = 0, devs : { {.id="CTL0031"}, } },
+	{.id = "CTL0045", .driver_data = 0, .devs = { {.id="CTL0031"}, } },
 	/* Sound Blaster AWE 32 */
-	{.id = "CTL0046", .driver_data = 0, devs : { {.id="CTL0031"}, } },
+	{.id = "CTL0046", .driver_data = 0, .devs = { {.id="CTL0031"}, } },
 	/* Sound Blaster AWE 32 */
-	{.id = "CTL0047", .driver_data = 0, devs : { {.id="CTL0031"}, } },
+	{.id = "CTL0047", .driver_data = 0, .devs = { {.id="CTL0031"}, } },
 	/* Sound Blaster AWE 32 */
-	{.id = "CTL0048", .driver_data = 0, devs : { {.id="CTL0031"}, } },
+	{.id = "CTL0048", .driver_data = 0, .devs = { {.id="CTL0031"}, } },
 	/* Sound Blaster AWE 32 */
-	{.id = "CTL0054", .driver_data = 0, devs : { {.id="CTL0031"}, } },
+	{.id = "CTL0054", .driver_data = 0, .devs = { {.id="CTL0031"}, } },
 	/* Sound Blaster AWE 32 */
-	{.id = "CTL009C", .driver_data = 0, devs : { {.id="CTL0041"}, } },
+	{.id = "CTL009C", .driver_data = 0, .devs = { {.id="CTL0041"}, } },
 	/* Createive SB32 PnP */
-	{.id = "CTL009F", .driver_data = 0, devs : { {.id="CTL0041"}, } },
+	{.id = "CTL009F", .driver_data = 0, .devs = { {.id="CTL0041"}, } },
 	/* Sound Blaster AWE 64 */
-	{.id = "CTL009D", .driver_data = 0, devs : { {.id="CTL0042"}, } },
+	{.id = "CTL009D", .driver_data = 0, .devs = { {.id="CTL0042"}, } },
 	/* Sound Blaster AWE 64 Gold */
-	{.id = "CTL009E", .driver_data = 0, devs : { {.id="CTL0044"}, } },
+	{.id = "CTL009E", .driver_data = 0, .devs = { {.id="CTL0044"}, } },
 	/* Sound Blaster AWE 64 Gold */
-	{.id = "CTL00B2", .driver_data = 0, devs : { {.id="CTL0044"}, } },
+	{.id = "CTL00B2", .driver_data = 0, .devs = { {.id="CTL0044"}, } },
 	/* Sound Blaster AWE 64 */
-	{.id = "CTL00C1", .driver_data = 0, devs : { {.id="CTL0042"}, } },
+	{.id = "CTL00C1", .driver_data = 0, .devs = { {.id="CTL0042"}, } },
 	/* Sound Blaster AWE 64 */
-	{.id = "CTL00C3", .driver_data = 0, devs : { {.id="CTL0045"}, } },
+	{.id = "CTL00C3", .driver_data = 0, .devs = { {.id="CTL0045"}, } },
 	/* Sound Blaster AWE 64 */
-	{.id = "CTL00C5", .driver_data = 0, devs : { {.id="CTL0045"}, } },
+	{.id = "CTL00C5", .driver_data = 0, .devs = { {.id="CTL0045"}, } },
 	/* Sound Blaster AWE 64 */
-	{.id = "CTL00C7", .driver_data = 0, devs : { {.id="CTL0045"}, } },
+	{.id = "CTL00C7", .driver_data = 0, .devs = { {.id="CTL0045"}, } },
 	/* Sound Blaster AWE 64 */
-	{.id = "CTL00E4", .driver_data = 0, devs : { {.id="CTL0045"}, } },
+	{.id = "CTL00E4", .driver_data = 0, .devs = { {.id="CTL0045"}, } },
 	/* Sound Blaster AWE 64 */
-	{.id = "CTL00E9", .driver_data = 0, devs : { {.id="CTL0045"}, } },
+	{.id = "CTL00E9", .driver_data = 0, .devs = { {.id="CTL0045"}, } },
 	/* ESS 1868 */
-	{.id = "ESS0968", .driver_data = 0, devs : { {.id="ESS0968"}, } },
+	{.id = "ESS0968", .driver_data = 0, .devs = { {.id="ESS0968"}, } },
 	/* ESS 1868 */
-	{.id = "ESS1868", .driver_data = 0, devs : { {.id="ESS1868"}, } },
+	{.id = "ESS1868", .driver_data = 0, .devs = { {.id="ESS1868"}, } },
 	/* ESS 1868 */
-	{.id = "ESS1868", .driver_data = 0, devs : { {.id="ESS8611"}, } },
+	{.id = "ESS1868", .driver_data = 0, .devs = { {.id="ESS8611"}, } },
 	/* ESS 1869 PnP AudioDrive */
-	{.id = "ESS0003", .driver_data = 0, devs : { {.id="ESS1869"}, } },
+	{.id = "ESS0003", .driver_data = 0, .devs = { {.id="ESS1869"}, } },
 	/* ESS 1869 */
-	{.id = "ESS1869", .driver_data = 0, devs : { {.id="ESS1869"}, } },
+	{.id = "ESS1869", .driver_data = 0, .devs = { {.id="ESS1869"}, } },
 	/* ESS 1878 */
-	{.id = "ESS1878", .driver_data = 0, devs : { {.id="ESS1878"}, } },
+	{.id = "ESS1878", .driver_data = 0, .devs = { {.id="ESS1878"}, } },
 	/* ESS 1879 */
-	{.id = "ESS1879", .driver_data = 0, devs : { {.id="ESS1879"}, } },
+	{.id = "ESS1879", .driver_data = 0, .devs = { {.id="ESS1879"}, } },
 	/* CMI 8330 SoundPRO */
-	{.id = "CMI0001", .driver_data = 0, devs : { {.id="@X@0001"},
+	{.id = "CMI0001", .driver_data = 0, .devs = { {.id="@X@0001"},
 						     {.id="@H@0001"},
 						     {.id="@@@0001"}, } },
 	/* Diamond DT0197H */
-	{.id = "RWR1688", .driver_data = 0, devs : { {.id="@@@0001"},
+	{.id = "RWR1688", .driver_data = 0, .devs = { {.id="@@@0001"},
 						     {.id="@X@0001"},
 						     {.id="@H@0001"}, } },
 	/* ALS007 */
-	{.id = "ALS0007", .driver_data = 0, devs : { {.id="@@@0001"},
+	{.id = "ALS0007", .driver_data = 0, .devs = { {.id="@@@0001"},
 						     {.id="@X@0001"},
 						     {.id="@H@0001"}, } },
 	/* ALS100 */
-	{.id = "ALS0001", .driver_data = 0, devs : { {.id="@@@0001"},
+	{.id = "ALS0001", .driver_data = 0, .devs = { {.id="@@@0001"},
 						     {.id="@X@0001"},
 						     {.id="@H@0001"}, } },
 	/* ALS110 */
-	{.id = "ALS0110", .driver_data = 0, devs : { {.id="@@@1001"},
+	{.id = "ALS0110", .driver_data = 0, .devs = { {.id="@@@1001"},
 						     {.id="@X@1001"},
 						     {.id="@H@0001"}, } },
 	/* ALS120 */
-	{.id = "ALS0120", .driver_data = 0, devs : { {.id="@@@2001"},
+	{.id = "ALS0120", .driver_data = 0, .devs = { {.id="@@@2001"},
 						     {.id="@X@2001"},
 						     {.id="@H@0001"}, } },
 	/* ALS200 */
-	{.id = "ALS0200", .driver_data = 0, devs : { {.id="@@@0020"},
+	{.id = "ALS0200", .driver_data = 0, .devs = { {.id="@@@0020"},
 						     {.id="@X@0030"},
 						     {.id="@H@0001"}, } },
 	/* ALS200 */
-	{.id = "RTL3000", .driver_data = 0, devs : { {.id="@@@2001"},
+	{.id = "RTL3000", .driver_data = 0, .devs = { {.id="@@@2001"},
 						     {.id="@X@2001"},
 						     {.id="@H@0001"}, } },
 	/* -end- */
--- diff/sound/pci/ac97/Makefile	2003-08-20 14:16:34.000000000 +0100
+++ source/sound/pci/ac97/Makefile	2004-02-09 10:39:58.000000000 +0000
@@ -3,7 +3,7 @@
 # Copyright (c) 2001 by Jaroslav Kysela <perex@suse.cz>
 #
 
-snd-ac97-codec-objs := ac97_codec.o ac97_proc.o ac97_patch.o
+snd-ac97-codec-objs := ac97_codec.o ac97_pcm.o ac97_proc.o ac97_patch.o
 snd-ak4531-codec-objs := ak4531_codec.o
 
 # Toplevel Module Dependency
--- diff/sound/pci/ac97/ac97_codec.c	2003-09-30 15:46:21.000000000 +0100
+++ source/sound/pci/ac97/ac97_codec.c	2004-02-09 10:39:58.000000000 +0000
@@ -101,8 +101,8 @@
 { 0x41445362, 0xffffffff, "AD1887",		patch_ad1881,	NULL },
 { 0x41445363, 0xffffffff, "AD1886A",		patch_ad1881,	NULL },
 { 0x41445370, 0xffffffff, "AD1980",		patch_ad1980,	NULL },
-{ 0x41445372, 0xffffffff, "AD1981A",		patch_ad1881,	NULL },
-{ 0x41445374, 0xffffffff, "AD1981B",		patch_ad1881,	NULL },
+{ 0x41445372, 0xffffffff, "AD1981A",		patch_ad1981a,	NULL },
+{ 0x41445374, 0xffffffff, "AD1981B",		patch_ad1981b,	NULL },
 { 0x41445375, 0xffffffff, "AD1985",		patch_ad1985,	NULL },
 { 0x414c4300, 0xfffffff0, "RL5306",	 	NULL,		NULL },
 { 0x414c4310, 0xfffffff0, "RL5382", 		NULL,		NULL },
@@ -112,6 +112,8 @@
 { 0x414c4721, 0xfffffff0, "ALC650D",		patch_alc650,	NULL },
 { 0x414c4722, 0xfffffff0, "ALC650E",		patch_alc650,	NULL },
 { 0x414c4723, 0xfffffff0, "ALC650F",		patch_alc650,	NULL },
+{ 0x414c4760, 0xfffffff0, "ALC655",		patch_alc655,	NULL },
+{ 0x414c4780, 0xfffffff0, "ALC658",		patch_alc655,	NULL },
 { 0x414c4730, 0xffffffff, "ALC101",		NULL,		NULL },
 { 0x414c4740, 0xfffffff0, "ALC202",		NULL,		NULL },
 { 0x414c4750, 0xfffffff0, "ALC250",		NULL,		NULL },
@@ -139,11 +141,12 @@
 { 0x49434551, 0xffffffff, "VT1616", 		patch_vt1616,	NULL }, 
 { 0x49434552, 0xffffffff, "VT1616i",		patch_vt1616,	NULL }, // VT1616 compatible (chipset integrated)
 { 0x49544520, 0xffffffff, "IT2226E",		NULL,		NULL },
+{ 0x49544561, 0xffffffff, "IT2646E",		patch_it2646,	NULL },
 { 0x4e534300, 0xffffffff, "LM4540/43/45/46/48",	NULL,		NULL }, // only guess --jk
 { 0x4e534331, 0xffffffff, "LM4549",		NULL,		NULL },
 { 0x4e534350, 0xffffffff, "LM4550",		NULL,		NULL },
 { 0x50534304, 0xffffffff, "UCB1400",		NULL,		NULL },
-{ 0x53494c20, 0xffffffe0, "Si3036/8",		NULL,		NULL },
+{ 0x53494c20, 0xffffffe0, "Si3036/8",		NULL,		mpatch_si3036 },
 { 0x54524102, 0xffffffff, "TR28022",		NULL,		NULL },
 { 0x54524106, 0xffffffff, "TR28026",		NULL,		NULL },
 { 0x54524108, 0xffffffff, "TR28028",		patch_tritech_tr28028,	NULL }, // added by xin jin [07/09/99]
@@ -202,7 +205,7 @@
   /*  24 */ "Wolfson Microelectronics 3D Enhancement",
   /*  25 */ "Delta Integration 3D Enhancement",
   /*  26 */ "SigmaTel 3D Enhancement",
-  /*  27 */ "Reserved 27",
+  /*  27 */ "IC Ensemble/KS Waves",
   /*  28 */ "Rockwell 3D Stereo Enhancement",
   /*  29 */ "Reserved 29",
   /*  30 */ "Reserved 30",
@@ -270,7 +273,7 @@
 {
 	if (!snd_ac97_valid_reg(ac97, reg))
 		return;
-	ac97->write(ac97, reg, value);
+	ac97->bus->write(ac97, reg, value);
 }
 
 /**
@@ -288,7 +291,7 @@
 {
 	if (!snd_ac97_valid_reg(ac97, reg))
 		return 0;
-	return ac97->read(ac97, reg);
+	return ac97->bus->read(ac97, reg);
 }
 
 /**
@@ -308,7 +311,7 @@
 	spin_lock(&ac97->reg_lock);
 	ac97->regs[reg] = value;
 	spin_unlock(&ac97->reg_lock);
-	ac97->write(ac97, reg, value);
+	ac97->bus->write(ac97, reg, value);
 	set_bit(reg, ac97->reg_accessed);
 }
 
@@ -335,7 +338,7 @@
 	if (change) {
 		ac97->regs[reg] = value;
 		spin_unlock(&ac97->reg_lock);
-		ac97->write(ac97, reg, value);
+		ac97->bus->write(ac97, reg, value);
 	} else
 		spin_unlock(&ac97->reg_lock);
 	return change;
@@ -368,7 +371,7 @@
 	if (change) {
 		ac97->regs[reg] = new;
 		spin_unlock(&ac97->reg_lock);
-		ac97->write(ac97, reg, new);
+		ac97->bus->write(ac97, reg, new);
 	} else
 		spin_unlock(&ac97->reg_lock);
 	return change;
@@ -388,11 +391,11 @@
 		ac97->spec.ad18xx.pcmreg[codec] = new;
 		spin_unlock(&ac97->reg_lock);
 		/* select single codec */
-		ac97->write(ac97, AC97_AD_SERIAL_CFG, ac97->spec.ad18xx.unchained[codec] | ac97->spec.ad18xx.chained[codec]);
+		ac97->bus->write(ac97, AC97_AD_SERIAL_CFG, ac97->spec.ad18xx.unchained[codec] | ac97->spec.ad18xx.chained[codec]);
 		/* update PCM bits */
-		ac97->write(ac97, AC97_PCM, new);
+		ac97->bus->write(ac97, AC97_PCM, new);
 		/* select all codecs */
-		ac97->write(ac97, AC97_AD_SERIAL_CFG, 0x7000);
+		ac97->bus->write(ac97, AC97_AD_SERIAL_CFG, 0x7000);
 	} else
 		spin_unlock(&ac97->reg_lock);
 	up(&ac97->spec.ad18xx.mutex);
@@ -976,9 +979,31 @@
  *
  */
 
+static int snd_ac97_bus_free(ac97_bus_t *bus)
+{
+	if (bus) {
+		snd_ac97_bus_proc_done(bus);
+		if (bus->pcms)
+			kfree(bus->pcms);
+		if (bus->private_free)
+			bus->private_free(bus);
+		snd_magic_kfree(bus);
+	}
+	return 0;
+}
+
+static int snd_ac97_bus_dev_free(snd_device_t *device)
+{
+	ac97_bus_t *bus = snd_magic_cast(ac97_bus_t, device->device_data, return -ENXIO);
+	return snd_ac97_bus_free(bus);
+}
+
 static int snd_ac97_free(ac97_t *ac97)
 {
 	if (ac97) {
+		snd_ac97_proc_done(ac97);
+		if (ac97->bus)
+			ac97->bus->codec[ac97->num] = NULL;
 		if (ac97->private_free)
 			ac97->private_free(ac97);
 		snd_magic_kfree(ac97);
@@ -1014,17 +1039,17 @@
 		}
 		return 0;
 	case AC97_CENTER_LFE_MASTER:	/* center */
-		if ((ac97->ext_id & 0x40) == 0)
+		if ((ac97->ext_id & AC97_EI_CDAC) == 0)
 			return 0;
 		break;
 	case AC97_CENTER_LFE_MASTER+1:	/* lfe */
-		if ((ac97->ext_id & 0x100) == 0)
+		if ((ac97->ext_id & AC97_EI_LDAC) == 0)
 			return 0;
 		reg = AC97_CENTER_LFE_MASTER;
 		mask = 0x0080;
 		break;
 	case AC97_SURROUND_MASTER:
-		if ((ac97->ext_id & 0x80) == 0)
+		if ((ac97->ext_id & AC97_EI_SDAC) == 0)
 			return 0;
 		break;
 	}
@@ -1193,7 +1218,7 @@
 
 static int snd_ac97_mixer_build(ac97_t * ac97)
 {
-	snd_card_t *card = ac97->card;
+	snd_card_t *card = ac97->bus->card;
 	snd_kcontrol_t *kctl;
 	int err;
 	unsigned int idx;
@@ -1492,6 +1517,12 @@
 static int snd_ac97_modem_build(snd_card_t * card, ac97_t * ac97)
 {
 	/* TODO */
+	//printk("AC97_GPIO_CFG = %x\n",snd_ac97_read(ac97,AC97_GPIO_CFG));
+	snd_ac97_write(ac97, AC97_GPIO_CFG, 0xffff & ~(AC97_GPIO_LINE1_OH));
+	snd_ac97_write(ac97, AC97_GPIO_POLARITY, 0xffff & ~(AC97_GPIO_LINE1_OH));
+	snd_ac97_write(ac97, AC97_GPIO_STICKY, 0xffff);
+	snd_ac97_write(ac97, AC97_GPIO_WAKEUP, 0x0);
+	snd_ac97_write(ac97, AC97_MISC_AFE, 0x0);
 	return 0;
 }
 
@@ -1500,7 +1531,7 @@
 	unsigned short val;
 	unsigned int tmp;
 
-	tmp = ((unsigned int)rate * ac97->clock) / 48000;
+	tmp = ((unsigned int)rate * ac97->bus->clock) / 48000;
 	snd_ac97_write_cache(ac97, reg, tmp & 0xffff);
 	val = snd_ac97_read(ac97, reg);
 	return val == (tmp & 0xffff);
@@ -1605,13 +1636,62 @@
 }
 
 /**
- * snd_ac97_mixer - create an AC97 codec component
+ * snd_ac97_bus - create an AC97 bus component
  * @card: the card instance
+ * @_bus: the template of AC97 bus, callbacks and
+ *         the private data.
+ * @rbus: the pointer to store the new AC97 bus instance.
+ *
+ * Creates an AC97 bus component.  An ac97_bus_t instance is newly
+ * allocated and initialized from the template (_bus).
+ *
+ * The template must include the valid callbacks (at least read and
+ * write), the bus number (num), and the private data (private_data).
+ * The other callbacks, wait and reset, are not mandatory.
+ * 
+ * The clock is set to 48000.  If another clock is needed, set
+ * bus->clock manually.
+ *
+ * The AC97 bus instance is registered as a low-level device, so you don't
+ * have to release it manually.
+ *
+ * Returns zero if successful, or a negative error code on failure.
+ */
+int snd_ac97_bus(snd_card_t * card, ac97_bus_t * _bus, ac97_bus_t ** rbus)
+{
+	int err;
+	ac97_bus_t *bus;
+	static snd_device_ops_t ops = {
+		.dev_free =	snd_ac97_bus_dev_free,
+	};
+
+	snd_assert(card != NULL, return -EINVAL);
+	snd_assert(_bus != NULL && rbus != NULL, return -EINVAL);
+	bus = snd_magic_kmalloc(ac97_bus_t, 0, GFP_KERNEL);
+	if (bus == NULL)
+		return -ENOMEM;
+	*bus = *_bus;
+	bus->card = card;
+	if (bus->clock == 0)
+		bus->clock = 48000;
+	spin_lock_init(&bus->bus_lock);
+	snd_ac97_bus_proc_init(bus);
+	if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, bus, &ops)) < 0) {
+		snd_ac97_bus_free(bus);
+		return err;
+	}
+	*rbus = bus;
+	return 0;
+}
+
+/**
+ * snd_ac97_mixer - create an Codec97 component
+ * @bus: the AC97 bus which codec is attached to
  * @_ac97: the template of ac97, including index, callbacks and
  *         the private data.
  * @rac97: the pointer to store the new ac97 instance.
  *
- * Creates an AC97 codec component.  An ac97_t instance is newly
+ * Creates an Codec97 component.  An ac97_t instance is newly
  * allocated and initialized from the template (_ac97).  The codec
  * is then initialized by the standard procedure.
  *
@@ -1620,21 +1700,16 @@
  * data (private_data).  The other callbacks, wait and reset, are not
  * mandatory.
  * 
- * The clock is set to 48000.  If another clock is needed, reset
- * ac97->clock manually afterwards.
- *
  * The ac97 instance is registered as a low-level device, so you don't
  * have to release it manually.
  *
- * The MCs (Modem Codecs only) are only detected but valid. The PCM driver
- * have to check for MCs using the !ac97_is_audio() function.
- *
  * Returns zero if successful, or a negative error code on failure.
  */
-int snd_ac97_mixer(snd_card_t * card, ac97_t * _ac97, ac97_t ** rac97)
+int snd_ac97_mixer(ac97_bus_t * bus, ac97_t * _ac97, ac97_t ** rac97)
 {
 	int err;
 	ac97_t *ac97;
+	snd_card_t *card;
 	char name[64];
 	unsigned long end_time;
 	unsigned int reg;
@@ -1644,40 +1719,42 @@
 
 	snd_assert(rac97 != NULL, return -EINVAL);
 	*rac97 = NULL;
-	snd_assert(card != NULL && _ac97 != NULL, return -EINVAL);
+	snd_assert(bus != NULL && _ac97 != NULL, return -EINVAL);
+	snd_assert(_ac97->num < 4 && bus->codec[_ac97->num] == NULL, return -EINVAL);
+	card = bus->card;
 	ac97 = snd_magic_kmalloc(ac97_t, 0, GFP_KERNEL);
 	if (ac97 == NULL)
 		return -ENOMEM;
 	*ac97 = *_ac97;
-	ac97->card = card;
+	ac97->bus = bus;
+	bus->codec[ac97->num] = ac97;
 	spin_lock_init(&ac97->reg_lock);
 
 	if (ac97->pci) {
 		pci_read_config_word(ac97->pci, PCI_SUBSYSTEM_VENDOR_ID, &ac97->subsystem_vendor);
 		pci_read_config_word(ac97->pci, PCI_SUBSYSTEM_ID, &ac97->subsystem_device);
 	}
-	if (ac97->reset) {
-		ac97->reset(ac97);
+	if (bus->reset) {
+		bus->reset(ac97);
 		goto __access_ok;
 	}
 
 	snd_ac97_write(ac97, AC97_RESET, 0);	/* reset to defaults */
-	if (ac97->wait)
-		ac97->wait(ac97);
+	if (bus->wait)
+		bus->wait(ac97);
 	else {
 		udelay(50);
 		if (ac97_reset_wait(ac97, HZ/2, 0) < 0 &&
 		    ac97_reset_wait(ac97, HZ/2, 1) < 0) {
-			snd_printk("AC'97 %d:%d does not respond - RESET\n", ac97->num, ac97->addr);
-			snd_ac97_free(ac97);
-			return -ENXIO;
+			snd_printk(KERN_WARNING "AC'97 %d does not respond - RESET\n", ac97->num);
+			/* proceed anyway - it's often non-critical */
 		}
 	}
       __access_ok:
 	ac97->id = snd_ac97_read(ac97, AC97_VENDOR_ID1) << 16;
 	ac97->id |= snd_ac97_read(ac97, AC97_VENDOR_ID2);
 	if (ac97->id == 0x00000000 || ac97->id == 0xffffffff) {
-		snd_printk("AC'97 %d:%d access is not valid [0x%x], removing mixer.\n", ac97->num, ac97->addr, ac97->id);
+		snd_printk(KERN_ERR "AC'97 %d access is not valid [0x%x], removing mixer.\n", ac97->num, ac97->id);
 		snd_ac97_free(ac97);
 		return -EIO;
 	}
@@ -1697,7 +1774,7 @@
         }
 	
 	/* test for AC'97 */
-	if (! (ac97->scaps & AC97_SCAP_AUDIO)) {
+	if (!(ac97->scaps & AC97_SCAP_SKIP_AUDIO) && !(ac97->scaps & AC97_SCAP_AUDIO)) {
 		/* test if we can write to the record gain volume register */
 		snd_ac97_write_cache(ac97, AC97_REC_GAIN, 0x8a06);
 		if ((err = snd_ac97_read(ac97, AC97_REC_GAIN)) == 0x8a06)
@@ -1711,13 +1788,22 @@
 	}
 
 	/* test for MC'97 */
-	ac97->ext_mid = snd_ac97_read(ac97, AC97_EXTENDED_MID);
-	if (ac97->ext_mid == 0xffff)	/* invalid combination */
-		ac97->ext_mid = 0;
-	if (ac97->ext_mid & 1)
-		ac97->scaps |= AC97_SCAP_MODEM;
+	if (!(ac97->scaps & AC97_SCAP_SKIP_MODEM) && !(ac97->scaps & AC97_SCAP_MODEM)) {
+		ac97->ext_mid = snd_ac97_read(ac97, AC97_EXTENDED_MID);
+		if (ac97->ext_mid == 0xffff)	/* invalid combination */
+			ac97->ext_mid = 0;
+		if (ac97->ext_mid & 1)
+			ac97->scaps |= AC97_SCAP_MODEM;
+	}
+
+	if (!ac97_is_audio(ac97) && !ac97_is_modem(ac97)) {
+		if (!(ac97->scaps & (AC97_SCAP_SKIP_AUDIO|AC97_SCAP_SKIP_MODEM)))
+			snd_printk(KERN_ERR "AC'97 %d access error (not audio or modem codec)\n", ac97->num);
+		snd_ac97_free(ac97);
+		return -EACCES;
+	}
 
-	if (ac97->reset) // FIXME: always skipping?
+	if (bus->reset) // FIXME: always skipping?
 		goto __ready_ok;
 
 	/* FIXME: add powerdown control */
@@ -1736,12 +1822,43 @@
 			set_current_state(TASK_UNINTERRUPTIBLE);
 			schedule_timeout(HZ/10);
 		} while (time_after_eq(end_time, jiffies));
-		snd_printk("AC'97 %d:%d analog subsections not ready\n", ac97->num, ac97->addr);
+		snd_printk(KERN_ERR "AC'97 %d analog subsections not ready\n", ac97->num);
 	}
 
+	/* FIXME: add powerdown control */
+	if (ac97_is_modem(ac97)) {
+		unsigned char tmp;
+
+		/* nothing should be in powerdown mode */
+		/* note: it's important to set the rate at first */
+		tmp = AC97_MEA_GPIO;
+		if (ac97->ext_mid & AC97_MEI_LINE1) {
+			snd_ac97_write_cache(ac97, AC97_LINE1_RATE, 12000);
+			tmp |= AC97_MEA_ADC1 | AC97_MEA_DAC1;
+		}
+		if (ac97->ext_mid & AC97_MEI_LINE2) {
+			snd_ac97_write_cache(ac97, AC97_LINE2_RATE, 12000);
+			tmp |= AC97_MEA_ADC2 | AC97_MEA_DAC2;
+		}
+		if (ac97->ext_mid & AC97_MEI_HANDSET) {
+			snd_ac97_write_cache(ac97, AC97_HANDSET_RATE, 12000);
+			tmp |= AC97_MEA_HADC | AC97_MEA_HDAC;
+		}
+		snd_ac97_write_cache(ac97, AC97_EXTENDED_MSTATUS, 0xff00 & ~(tmp << 8));
+		udelay(100);
+		/* nothing should be in powerdown mode */
+		snd_ac97_write_cache(ac97, AC97_EXTENDED_MSTATUS, 0xff00 & ~(tmp << 8));
+		end_time = jiffies + (HZ / 10);
+		do {
+			if ((snd_ac97_read(ac97, AC97_EXTENDED_MSTATUS) & tmp) == tmp)
+				goto __ready_ok;
+			set_current_state(TASK_UNINTERRUPTIBLE);
+			schedule_timeout(HZ/10);
+		} while (time_after_eq(end_time, jiffies));
+		snd_printk(KERN_ERR "MC'97 %d converters and GPIO not ready (0x%x)\n", ac97->num, snd_ac97_read(ac97, AC97_EXTENDED_MSTATUS));
+	}
+	
       __ready_ok:
-	if (ac97->clock == 0)
-		ac97->clock = 48000;	/* standard value */
 	if (ac97_is_audio(ac97))
 		ac97->addr = (ac97->ext_id & AC97_EI_ADDR_MASK) >> AC97_EI_ADDR_SHIFT;
 	else
@@ -1780,8 +1897,8 @@
 		ac97->scaps |= AC97_SCAP_CENTER_LFE_DAC;
 	}
 	/* additional initializations */
-	if (ac97->init)
-		ac97->init(ac97);
+	if (bus->init)
+		bus->init(ac97);
 	snd_ac97_get_name(ac97, ac97->id, name, 0);
 	snd_ac97_get_name(NULL, ac97->id, name, 0);  // ac97->id might be changed in the special setup code
 	if (ac97_is_audio(ac97)) {
@@ -1802,183 +1919,6 @@
 			return -ENOMEM;
 		}
 	}
-	snd_ac97_proc_init(card, ac97, "ac97");
-	if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, ac97, &ops)) < 0) {
-		snd_ac97_free(ac97);
-		return err;
-	}
-	*rac97 = ac97;
-	return 0;
-}
-
-/* wait for a while until registers are accessible after RESET
- * return 0 if ok, negative not ready
- */
-static int ac97_modem_reset_wait(ac97_t *ac97, int timeout)
-{
-	unsigned long end_time;
-	end_time = jiffies + timeout;
-	do {
-		unsigned short ext_mid;
-		
-		/* use preliminary reads to settle the communication */
-		snd_ac97_read(ac97, AC97_EXTENDED_MID);
-		snd_ac97_read(ac97, AC97_VENDOR_ID1);
-		snd_ac97_read(ac97, AC97_VENDOR_ID2);
-		ext_mid = snd_ac97_read(ac97, AC97_EXTENDED_MID);
-		if (ext_mid != 0xffff && (ext_mid & 1) != 0)
-			return 0;
-		set_current_state(TASK_UNINTERRUPTIBLE);
-		schedule_timeout(HZ/100);
-	} while (time_after_eq(end_time, jiffies));
-	return -ENODEV;
-}
-
-/**
- * snd_ac97_modem - create an MC97 codec component
- * @card: the card instance
- * @_ac97: the template of ac97, including index, callbacks and
- *         the private data.
- * @rac97: the pointer to store the new ac97 instance.
- *
- * Creates an MC97 codec component.  An ac97_t instance is newly
- * allocated and initialized from the template (_ac97).  The codec
- * is then initialized by the standard procedure.
- *
- * The template must include the valid callbacks (at least read and
- * write), the codec number (num) and address (addr), and the private
- * data (private_data).  The other callbacks, wait and reset, are not
- * mandatory.
- * 
- * The clock is set to 48000.  If another clock is needed, reset
- * ac97->clock manually afterwards.
- *
- * The ac97 instance is registered as a low-level device, so you don't
- * have to release it manually.
- *
- * The ACs (Audio Codecs only) are only detected but valid. The PCM driver
- * have to check for ACs using the !ac97_is_modem() function.
- *
- * Returns zero if successful, or a negative error code on failure.
- */
-int snd_ac97_modem(snd_card_t * card, ac97_t * _ac97, ac97_t ** rac97)
-{
-	int err;
-	ac97_t *ac97;
-	char name[64];
-	unsigned long end_time;
-	unsigned short tmp;
-	static snd_device_ops_t ops = {
-		.dev_free =	snd_ac97_dev_free,
-	};
-
-	snd_assert(rac97 != NULL, return -EINVAL);
-	*rac97 = NULL;
-	snd_assert(card != NULL && _ac97 != NULL, return -EINVAL);
-	ac97 = snd_magic_kcalloc(ac97_t, 0, GFP_KERNEL);
-	if (ac97 == NULL)
-		return -ENOMEM;
-	*ac97 = *_ac97;
-	ac97->card = card;
-	spin_lock_init(&ac97->reg_lock);
-
-	ac97->pci = _ac97->pci;
-	if (ac97->pci) {
-		pci_read_config_word(ac97->pci, PCI_SUBSYSTEM_VENDOR_ID, &ac97->subsystem_vendor);
-		pci_read_config_word(ac97->pci, PCI_SUBSYSTEM_ID, &ac97->subsystem_device);
-	}
-
-	if (ac97->reset) {
-		ac97->reset(ac97);
-		goto __access_ok;
-	}
-
-	snd_ac97_write(ac97, AC97_EXTENDED_MID, 0);	/* reset to defaults */
-	if (ac97->wait)
-		ac97->wait(ac97);
-	else {
-		udelay(50);
-		if (ac97_modem_reset_wait(ac97, HZ/2) < 0) {
-			snd_printk("MC'97 %d:%d does not respond - MODEM RESET\n", ac97->num, ac97->addr);
-			snd_ac97_free(ac97);
-			return -ENXIO;
-		}
-	}
-      __access_ok:
-	ac97->id = snd_ac97_read(ac97, AC97_VENDOR_ID1) << 16;
-	ac97->id |= snd_ac97_read(ac97, AC97_VENDOR_ID2);
-	if (ac97->id == 0x00000000 || ac97->id == 0xffffffff) {
-		snd_printk("MC'97 %d:%d access is not valid [0x%x], removing modem controls.\n", ac97->num, ac97->addr, ac97->id);
-		snd_ac97_free(ac97);
-		return -EIO;
-	}
-	
-	/* test for MC'97 */
-	ac97->ext_mid = snd_ac97_read(ac97, AC97_EXTENDED_MID);
-	if (ac97->ext_mid == 0xffff)	/* invalid combination */
-		ac97->ext_mid = 0;
-	if (ac97->ext_mid & 1)
-		ac97->scaps |= AC97_SCAP_MODEM;
-
-	/* non-destructive test for AC'97 */
-	tmp = snd_ac97_read(ac97, AC97_RESET);
-	if (tmp == 0 || tmp == 0xffff) {
-		tmp = snd_ac97_read(ac97, AC97_EXTENDED_ID);
-		if (tmp == 0 || tmp == 0xffff) {
-			tmp = snd_ac97_read(ac97, AC97_REC_GAIN);
-			if (tmp == 0 || tmp == 0xffff)
-				tmp = snd_ac97_read(ac97, AC97_POWERDOWN);
-		}
-	}
-	if ((tmp != 0 && tmp != 0xffff) || !(ac97->scaps & AC97_SCAP_MODEM))
-		ac97->scaps |= AC97_SCAP_AUDIO;
-
-	if (ac97->reset) // FIXME: always skipping?
-		goto __ready_ok;
-
-	/* FIXME: add powerdown control */
-	if (ac97->scaps & AC97_SCAP_MODEM) {
-		/* nothing should be in powerdown mode */
-		/* note: it's important to set the rate at first */
-		tmp = AC97_MEA_GPIO;
-		if (ac97->ext_mid & AC97_MEI_LINE1) {
-			snd_ac97_write_cache(ac97, AC97_LINE1_RATE, 12000);
-			tmp |= AC97_MEA_ADC1 | AC97_MEA_DAC1;
-		}
-		if (ac97->ext_mid & AC97_MEI_LINE2) {
-			snd_ac97_write_cache(ac97, AC97_LINE2_RATE, 12000);
-			tmp |= AC97_MEA_ADC2 | AC97_MEA_DAC2;
-		}
-		if (ac97->ext_mid & AC97_MEI_HANDSET) {
-			snd_ac97_write_cache(ac97, AC97_HANDSET_RATE, 12000);
-			tmp |= AC97_MEA_HADC | AC97_MEA_HDAC;
-		}
-		snd_ac97_write_cache(ac97, AC97_EXTENDED_MSTATUS, 0xff00 & ~(tmp << 8));
-		udelay(100);
-		/* nothing should be in powerdown mode */
-		snd_ac97_write_cache(ac97, AC97_EXTENDED_MSTATUS, 0xff00 & ~(tmp << 8));
-		end_time = jiffies + (HZ / 10);
-		do {
-			if ((snd_ac97_read(ac97, AC97_EXTENDED_MSTATUS) & tmp) == tmp)
-				goto __ready_ok;
-			set_current_state(TASK_UNINTERRUPTIBLE);
-			schedule_timeout(HZ/10);
-		} while (time_after_eq(end_time, jiffies));
-		snd_printk("MC'97 %d:%d converters and GPIO not ready (0x%x)\n", ac97->num, ac97->addr, snd_ac97_read(ac97, AC97_EXTENDED_MSTATUS));
-	}
-
-      __ready_ok:
-	/* additional initializations */
-	/* FIXME: ADD MODEM INITALIZATION */
-	if (ac97_is_modem(ac97))
-		ac97->addr = (ac97->ext_mid & AC97_MEI_ADDR_MASK) >> AC97_MEI_ADDR_SHIFT;
-	else
-		ac97->addr = (ac97->ext_id & AC97_EI_ADDR_MASK) >> AC97_EI_ADDR_SHIFT;
-
-	if (ac97->init)
-		ac97->init(ac97);
-	snd_ac97_get_name(ac97, ac97->id, name, 1);
-	snd_ac97_get_name(NULL, ac97->id, name, 1);  // ac97->id might be changed in the special setup code
 	if (ac97_is_modem(ac97)) {
 		if (card->mixername[0] == '\0') {
 			strcpy(card->mixername, name);
@@ -1992,12 +1932,12 @@
 			snd_ac97_free(ac97);
 			return err;
 		}
+		if (snd_ac97_modem_build(card, ac97) < 0) {
+			snd_ac97_free(ac97);
+			return -ENOMEM;
+		}
 	}
-	if (ac97_is_modem(ac97) && snd_ac97_modem_build(card, ac97) < 0) {
-		snd_ac97_free(ac97);
-		return -ENOMEM;
-	}
-	snd_ac97_proc_init(card, ac97, "mc97");
+	snd_ac97_proc_init(ac97);
 	if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, ac97, &ops)) < 0) {
 		snd_ac97_free(ac97);
 		return err;
@@ -2006,110 +1946,6 @@
 	return 0;
 }
 
-/*
- *  PCM support
- */
-
-static int set_spdif_rate(ac97_t *ac97, unsigned short rate)
-{
-	unsigned short old, bits, reg, mask;
-
-	if (! (ac97->ext_id & AC97_EI_SPDIF))
-		return -ENODEV;
-
-	if (ac97->flags & AC97_CS_SPDIF) {
-		switch (rate) {
-		case 48000: bits = 0; break;
-		case 44100: bits = 1 << AC97_SC_SPSR_SHIFT; break;
-		default: /* invalid - disable output */
-			snd_ac97_update_bits(ac97, AC97_EXTENDED_STATUS, AC97_EA_SPDIF, 0);
-			return -EINVAL;
-		}
-		reg = AC97_CSR_SPDIF;
-		mask = 1 << AC97_SC_SPSR_SHIFT;
-	} else {
-		if (ac97->id == AC97_ID_CM9739 && rate != 48000) {
-			snd_ac97_update_bits(ac97, AC97_EXTENDED_STATUS, AC97_EA_SPDIF, 0);
-			return -EINVAL;
-		}
-		switch (rate) {
-		case 44100: bits = AC97_SC_SPSR_44K; break;
-		case 48000: bits = AC97_SC_SPSR_48K; break;
-		case 32000: bits = AC97_SC_SPSR_32K; break;
-		default: /* invalid - disable output */
-			snd_ac97_update_bits(ac97, AC97_EXTENDED_STATUS, AC97_EA_SPDIF, 0);
-			return -EINVAL;
-		}
-		reg = AC97_SPDIF;
-		mask = AC97_SC_SPSR_MASK;
-	}
-
-	spin_lock(&ac97->reg_lock);
-	old = ac97->regs[reg] & mask;
-	spin_unlock(&ac97->reg_lock);
-	if (old != bits) {
-		snd_ac97_update_bits(ac97, AC97_EXTENDED_STATUS, AC97_EA_SPDIF, 0);
-		snd_ac97_update_bits(ac97, reg, mask, bits);
-	}
-	snd_ac97_update_bits(ac97, AC97_EXTENDED_STATUS, AC97_EA_SPDIF, AC97_EA_SPDIF);
-	return 0;
-}
-
-/**
- * snd_ac97_set_rate - change the rate of the given input/output.
- * @ac97: the ac97 instance
- * @reg: the register to change
- * @rate: the sample rate to set
- *
- * Changes the rate of the given input/output on the codec.
- * If the codec doesn't support VAR, the rate must be 48000 (except
- * for SPDIF).
- *
- * The valid registers are AC97_PMC_MIC_ADC_RATE,
- * AC97_PCM_FRONT_DAC_RATE, AC97_PCM_LR_ADC_RATE and AC97_SPDIF.
- * The SPDIF register is a pseudo-register to change the rate of SPDIF
- * (only if supported).
- *
- * Returns zero if successful, or a negative error code on failure.
- */
-int snd_ac97_set_rate(ac97_t *ac97, int reg, unsigned short rate)
-{
-	unsigned short mask;
-	unsigned int tmp;
-	
-	switch (reg) {
-	case AC97_PCM_MIC_ADC_RATE:
-		mask = 0x0000;
-		if ((ac97->regs[AC97_EXTENDED_STATUS] & AC97_EA_VRM) == 0)	/* MIC VRA */
-			if (rate != 48000)
-				return -EINVAL;
-		break;
-	case AC97_PCM_FRONT_DAC_RATE:
-		mask = 0x0200;
-		if ((ac97->regs[AC97_EXTENDED_STATUS] & AC97_EA_VRA) == 0)	/* VRA */
-			if (rate != 48000)
-				return -EINVAL;
-		break;
-	case AC97_PCM_LR_ADC_RATE:
-		mask = 0x0100;
-		if ((ac97->regs[AC97_EXTENDED_STATUS] & AC97_EA_VRA) == 0)	/* VRA */
-			if (rate != 48000)
-				return -EINVAL;
-		break;
-	case AC97_SPDIF:
-		return set_spdif_rate(ac97, rate);
-	default:
-		return -EINVAL;
-	}
-	tmp = ((unsigned int)rate * ac97->clock) / 48000;
-	if (tmp > 65535)
-		return -EINVAL;
-	snd_ac97_update(ac97, reg, tmp & 0xffff);
-	snd_ac97_read(ac97, reg);
-	return 0;
-}
-
-
 #ifdef CONFIG_PM
 /**
  * snd_ac97_suspend - General suspend function for AC97 codec
@@ -2143,8 +1979,8 @@
 {
 	int i, is_ad18xx, codec;
 
-	if (ac97->reset) {
-		ac97->reset(ac97);
+	if (ac97->bus->reset) {
+		ac97->bus->reset(ac97);
 		goto  __reset_ready;
 	}
 
@@ -2155,29 +1991,29 @@
 	snd_ac97_write(ac97, AC97_GENERAL_PURPOSE, 0);
 
 	snd_ac97_write(ac97, AC97_POWERDOWN, ac97->regs[AC97_POWERDOWN]);
-	snd_ac97_write(ac97, AC97_MASTER, 0x8000);
+	snd_ac97_write(ac97, AC97_MASTER, 0x8101);
 	for (i = 0; i < 10; i++) {
-		if (snd_ac97_read(ac97, AC97_MASTER) == 0x8000)
+		if (snd_ac97_read(ac97, AC97_MASTER) == 0x8101)
 			break;
 		mdelay(1);
 	}
 __reset_ready:
 
-	if (ac97->init)
-		ac97->init(ac97);
+	if (ac97->bus->init)
+		ac97->bus->init(ac97);
 
-	is_ad18xx = (ac97->id & 0xffffff40) == AC97_ID_AD1881;
+	is_ad18xx = (ac97->flags & AC97_AD_MULTI);
 	if (is_ad18xx) {
 		/* restore the AD18xx codec configurations */
 		for (codec = 0; codec < 3; codec++) {
 			if (! ac97->spec.ad18xx.id[codec])
 				continue;
 			/* select single codec */
-			ac97->write(ac97, AC97_AD_SERIAL_CFG, ac97->spec.ad18xx.unchained[codec] | ac97->spec.ad18xx.chained[codec]);
-			ac97->write(ac97, AC97_AD_CODEC_CFG, ac97->spec.ad18xx.codec_cfg[codec]);
+			ac97->bus->write(ac97, AC97_AD_SERIAL_CFG, ac97->spec.ad18xx.unchained[codec] | ac97->spec.ad18xx.chained[codec]);
+			ac97->bus->write(ac97, AC97_AD_CODEC_CFG, ac97->spec.ad18xx.codec_cfg[codec]);
 		}
 		/* select all codecs */
-		ac97->write(ac97, AC97_AD_SERIAL_CFG, 0x7000);
+		ac97->bus->write(ac97, AC97_AD_SERIAL_CFG, 0x7000);
 	}
 
 	/* restore ac97 status */
@@ -2196,12 +2032,12 @@
 						if (! ac97->spec.ad18xx.id[codec])
 							continue;
 						/* select single codec */
-						ac97->write(ac97, AC97_AD_SERIAL_CFG, ac97->spec.ad18xx.unchained[codec] | ac97->spec.ad18xx.chained[codec]);
+						ac97->bus->write(ac97, AC97_AD_SERIAL_CFG, ac97->spec.ad18xx.unchained[codec] | ac97->spec.ad18xx.chained[codec]);
 						/* update PCM bits */
-						ac97->write(ac97, AC97_PCM, ac97->spec.ad18xx.pcmreg[codec]);
+						ac97->bus->write(ac97, AC97_PCM, ac97->spec.ad18xx.pcmreg[codec]);
 					}
 					/* select all codecs */
-					ac97->write(ac97, AC97_AD_SERIAL_CFG, 0x7000);
+					ac97->bus->write(ac97, AC97_AD_SERIAL_CFG, 0x7000);
 					continue;
 				} else if (i == AC97_AD_TEST ||
 					   i == AC97_AD_CODEC_CFG ||
@@ -2231,13 +2067,13 @@
 
 /*
  */
-static int remove_ctl(ac97_t *ac97, const char *name)
+int snd_ac97_remove_ctl(ac97_t *ac97, const char *name)
 {
 	snd_ctl_elem_id_t id;
 	memset(&id, 0, sizeof(id));
 	strcpy(id.name, name);
 	id.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
-	return snd_ctl_remove_id(ac97->card, &id);
+	return snd_ctl_remove_id(ac97->bus->card, &id);
 }
 
 static snd_kcontrol_t *ctl_find(ac97_t *ac97, const char *name)
@@ -2246,10 +2082,10 @@
 	memset(&sid, 0, sizeof(sid));
 	strcpy(sid.name, name);
 	sid.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
-	return snd_ctl_find_id(ac97->card, &sid);
+	return snd_ctl_find_id(ac97->bus->card, &sid);
 }
 
-static int rename_ctl(ac97_t *ac97, const char *src, const char *dst)
+int snd_ac97_rename_ctl(ac97_t *ac97, const char *src, const char *dst)
 {
 	snd_kcontrol_t *kctl = ctl_find(ac97, src);
 	if (kctl) {
@@ -2259,7 +2095,7 @@
 	return -ENOENT;
 }
 
-static int swap_ctl(ac97_t *ac97, const char *s1, const char *s2)
+int snd_ac97_swap_ctl(ac97_t *ac97, const char *s1, const char *s2)
 {
 	snd_kcontrol_t *kctl1, *kctl2;
 	kctl1 = ctl_find(ac97, s1);
@@ -2276,22 +2112,22 @@
 {
 	/* FIXME: error checks.. */
 	if (remove_master) {
-		remove_ctl(ac97, "Master Playback Switch");
-		remove_ctl(ac97, "Master Playback Volume");
+		snd_ac97_remove_ctl(ac97, "Master Playback Switch");
+		snd_ac97_remove_ctl(ac97, "Master Playback Volume");
 	} else {
-		rename_ctl(ac97, "Master Playback Switch", "Line-Out Playback Switch");
-		rename_ctl(ac97, "Master Playback Volume", "Line-Out Playback Volume");
+		snd_ac97_rename_ctl(ac97, "Master Playback Switch", "Line-Out Playback Switch");
+		snd_ac97_rename_ctl(ac97, "Master Playback Volume", "Line-Out Playback Volume");
 	}
-	rename_ctl(ac97, "Headphone Playback Switch", "Master Playback Switch");
-	rename_ctl(ac97, "Headphone Playback Volume", "Master Playback Volume");
+	snd_ac97_rename_ctl(ac97, "Headphone Playback Switch", "Master Playback Switch");
+	snd_ac97_rename_ctl(ac97, "Headphone Playback Volume", "Master Playback Volume");
 	return 0;
 }
 
 static int swap_surround(ac97_t *ac97)
 {
 	/* FIXME: error checks.. */
-	swap_ctl(ac97, "Master Playback Switch", "Surround Playback Switch");
-	swap_ctl(ac97, "Master Playback Volume", "Surround Playback Volume");
+	snd_ac97_swap_ctl(ac97, "Master Playback Switch", "Surround Playback Switch");
+	snd_ac97_swap_ctl(ac97, "Master Playback Volume", "Surround Playback Volume");
 	return 0;
 }
 
@@ -2301,7 +2137,7 @@
 	/* Turn on OMS bit to route microphone to back panel */
 	scfg = snd_ac97_read(ac97, AC97_AD_SERIAL_CFG);
 	snd_ac97_write_cache(ac97, AC97_AD_SERIAL_CFG, scfg | 0x0200);
-	return swap_headphone(ac97, 1);
+	return 0;
 }
 
 /**
@@ -2353,10 +2189,13 @@
 EXPORT_SYMBOL(snd_ac97_write_cache);
 EXPORT_SYMBOL(snd_ac97_update);
 EXPORT_SYMBOL(snd_ac97_update_bits);
+EXPORT_SYMBOL(snd_ac97_bus);
 EXPORT_SYMBOL(snd_ac97_mixer);
-EXPORT_SYMBOL(snd_ac97_modem);
-EXPORT_SYMBOL(snd_ac97_set_rate);
+EXPORT_SYMBOL(snd_ac97_pcm_assign);
+EXPORT_SYMBOL(snd_ac97_pcm_open);
+EXPORT_SYMBOL(snd_ac97_pcm_close);
 EXPORT_SYMBOL(snd_ac97_tune_hardware);
+EXPORT_SYMBOL(snd_ac97_set_rate);
 #ifdef CONFIG_PM
 EXPORT_SYMBOL(snd_ac97_resume);
 #endif
--- diff/sound/pci/ac97/ac97_local.h	2003-09-30 15:46:21.000000000 +0100
+++ source/sound/pci/ac97/ac97_local.h	2004-02-09 10:39:58.000000000 +0000
@@ -37,6 +37,12 @@
 int snd_ac97_get_single(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol);
 int snd_ac97_put_single(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol);
 int snd_ac97_try_bit(ac97_t * ac97, int reg, int bit);
+int snd_ac97_remove_ctl(ac97_t *ac97, const char *name);
+int snd_ac97_rename_ctl(ac97_t *ac97, const char *src, const char *dst);
+int snd_ac97_swap_ctl(ac97_t *ac97, const char *s1, const char *s2);
 
 /* ac97_proc.c */
-void snd_ac97_proc_init(snd_card_t * card, ac97_t * ac97, const char *prefix);
+void snd_ac97_bus_proc_init(ac97_bus_t * ac97);
+void snd_ac97_bus_proc_done(ac97_bus_t * ac97);
+void snd_ac97_proc_init(ac97_t * ac97);
+void snd_ac97_proc_done(ac97_t * ac97);
--- diff/sound/pci/ac97/ac97_patch.c	2003-09-30 15:46:21.000000000 +0100
+++ source/sound/pci/ac97/ac97_patch.c	2004-02-09 10:39:58.000000000 +0000
@@ -46,7 +46,7 @@
 	int idx, err;
 
 	for (idx = 0; idx < count; idx++)
-		if ((err = snd_ctl_add(ac97->card, snd_ac97_cnew(&controls[idx], ac97))) < 0)
+		if ((err = snd_ctl_add(ac97->bus->card, snd_ac97_cnew(&controls[idx], ac97))) < 0)
 			return err;
 	return 0;
 }
@@ -201,12 +201,12 @@
 	snd_kcontrol_t *kctl;
 	int err;
 
-	if ((err = snd_ctl_add(ac97->card, kctl = snd_ac97_cnew(&snd_ac97_controls_3d[0], ac97))) < 0)
+	if ((err = snd_ctl_add(ac97->bus->card, kctl = snd_ac97_cnew(&snd_ac97_controls_3d[0], ac97))) < 0)
 		return err;
 	strcpy(kctl->id.name, "3D Control - Wide");
 	kctl->private_value = AC97_3D_CONTROL | (9 << 8) | (7 << 16);
 	snd_ac97_write_cache(ac97, AC97_3D_CONTROL, 0x0000);
-	if ((err = snd_ctl_add(ac97->card, snd_ac97_cnew(&snd_ac97_ymf753_controls_speaker, ac97))) < 0)
+	if ((err = snd_ctl_add(ac97->bus->card, snd_ac97_cnew(&snd_ac97_ymf753_controls_speaker, ac97))) < 0)
 		return err;
 	snd_ac97_write_cache(ac97, AC97_YMF753_3D_MODE_SEL, 0x0c00);
 	return 0;
@@ -306,7 +306,7 @@
 	snd_kcontrol_t *kctl;
 	int err;
 
-	if ((err = snd_ctl_add(ac97->card, kctl = snd_ac97_cnew(&snd_ac97_controls_3d[0], ac97))) < 0)
+	if ((err = snd_ctl_add(ac97->bus->card, kctl = snd_ac97_cnew(&snd_ac97_controls_3d[0], ac97))) < 0)
 		return err;
 	strcpy(kctl->id.name, "3D Control Sigmatel - Depth");
 	kctl->private_value = AC97_3D_CONTROL | (3 << 16);
@@ -319,11 +319,11 @@
 	snd_kcontrol_t *kctl;
 	int err;
 
-	if ((err = snd_ctl_add(ac97->card, kctl = snd_ac97_cnew(&snd_ac97_controls_3d[0], ac97))) < 0)
+	if ((err = snd_ctl_add(ac97->bus->card, kctl = snd_ac97_cnew(&snd_ac97_controls_3d[0], ac97))) < 0)
 		return err;
 	strcpy(kctl->id.name, "3D Control Sigmatel - Depth");
 	kctl->private_value = AC97_3D_CONTROL | (3 << 16);
-	if ((err = snd_ctl_add(ac97->card, kctl = snd_ac97_cnew(&snd_ac97_controls_3d[0], ac97))) < 0)
+	if ((err = snd_ctl_add(ac97->bus->card, kctl = snd_ac97_cnew(&snd_ac97_controls_3d[0], ac97))) < 0)
 		return err;
 	strcpy(kctl->id.name, "3D Control Sigmatel - Rear Depth");
 	kctl->private_value = AC97_3D_CONTROL | (2 << 8) | (3 << 16);
@@ -708,7 +708,7 @@
 #define AC97_AD198X_2MIC	0x0040	/* 2-channel mic select */
 #define AC97_AD198X_SPRD	0x0080	/* SPREAD enable */
 #define AC97_AD198X_DMIX0	0x0100	/* downmix mode: 0 = 6-to-4, 1 = 6-to-2 downmix */
-#define AC97_AD198X_DMIX1	0x0300	/* downmix mode: 1 = enabled */
+#define AC97_AD198X_DMIX1	0x0200	/* downmix mode: 1 = enabled */
 #define AC97_AD198X_HPSEL	0x0400	/* headphone amplifier input select */
 #define AC97_AD198X_CLDIS	0x0800	/* center/lfe disable */
 #define AC97_AD198X_LODIS	0x1000	/* LINE_OUT disable */
@@ -717,7 +717,7 @@
 #define AC97_AD198X_DACZ	0x8000	/* DAC zero-fill mode */
 
 
-static int snd_ac97_ad1980_spdif_source_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
+static int snd_ac97_ad198x_spdif_source_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
 {
 	static char *texts[2] = { "AC-Link", "A/D Converter" };
 
@@ -730,7 +730,7 @@
 	return 0;
 }
 
-static int snd_ac97_ad1980_spdif_source_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
+static int snd_ac97_ad198x_spdif_source_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
 {
 	ac97_t *ac97 = snd_kcontrol_chip(kcontrol);
 	unsigned short val;
@@ -740,7 +740,7 @@
 	return 0;
 }
 
-static int snd_ac97_ad1980_spdif_source_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
+static int snd_ac97_ad198x_spdif_source_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
 {
 	ac97_t *ac97 = snd_kcontrol_chip(kcontrol);
 	unsigned short val;
@@ -751,21 +751,163 @@
 	return snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 0x0004, val);
 }
 
-static const snd_kcontrol_new_t snd_ac97_ad1980_spdif_source = {
+static const snd_kcontrol_new_t snd_ac97_ad198x_spdif_source = {
 	.iface	= SNDRV_CTL_ELEM_IFACE_MIXER,
 	.name	= SNDRV_CTL_NAME_IEC958("",PLAYBACK,NONE) "Source",
-	.info	= snd_ac97_ad1980_spdif_source_info,
-	.get	= snd_ac97_ad1980_spdif_source_get,
-	.put	= snd_ac97_ad1980_spdif_source_put,
+	.info	= snd_ac97_ad198x_spdif_source_info,
+	.get	= snd_ac97_ad198x_spdif_source_get,
+	.put	= snd_ac97_ad198x_spdif_source_put,
 };
 
-static int patch_ad1980_post_spdif(ac97_t * ac97)
+static int patch_ad198x_post_spdif(ac97_t * ac97)
 {
- 	return patch_build_controls(ac97, &snd_ac97_ad1980_spdif_source, 1);
+ 	return patch_build_controls(ac97, &snd_ac97_ad198x_spdif_source, 1);
+}
+
+static struct snd_ac97_build_ops patch_ad1981a_build_ops = {
+	.build_post_spdif = patch_ad198x_post_spdif
+};
+
+int patch_ad1981a(ac97_t *ac97)
+{
+	patch_ad1881(ac97);
+	ac97->build_ops = &patch_ad1981a_build_ops;
+	snd_ac97_update_bits(ac97, AC97_AD_MISC, AC97_AD198X_MSPLT, AC97_AD198X_MSPLT);
+	ac97->flags |= AC97_STEREO_MUTES;
+	return 0;
+}
+
+static const snd_kcontrol_new_t snd_ac97_ad198x_2cmic =
+AC97_SINGLE("Stereo Mic", AC97_AD_MISC, 6, 1, 0);
+
+static int patch_ad1981b_specific(ac97_t *ac97)
+{
+	return patch_build_controls(ac97, &snd_ac97_ad198x_2cmic, 1);
+}
+
+static struct snd_ac97_build_ops patch_ad1981b_build_ops = {
+	.build_post_spdif = patch_ad198x_post_spdif,
+	.build_specific = patch_ad1981b_specific
+};
+
+int patch_ad1981b(ac97_t *ac97)
+{
+	patch_ad1881(ac97);
+	ac97->build_ops = &patch_ad1981b_build_ops;
+	snd_ac97_update_bits(ac97, AC97_AD_MISC, AC97_AD198X_MSPLT, AC97_AD198X_MSPLT);
+	ac97->flags |= AC97_STEREO_MUTES;
+	return 0;
+}
+
+static int snd_ac97_ad1980_lohpsel_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo)
+{
+	uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
+	uinfo->count = 1;
+	uinfo->value.integer.min = 0;
+	uinfo->value.integer.max = 1;
+	return 0;
+}
+
+static int snd_ac97_ad1980_lohpsel_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t* ucontrol)
+{
+	ac97_t *ac97 = snd_kcontrol_chip(kcontrol);
+	unsigned short val;
+
+	val = ac97->regs[AC97_AD_MISC];
+	ucontrol->value.integer.value[0] = !(val & AC97_AD198X_LOSEL);
+	return 0;
+}
+
+static int snd_ac97_ad1980_lohpsel_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+{
+	ac97_t *ac97 = snd_kcontrol_chip(kcontrol);
+	unsigned short val;
+
+	val = !ucontrol->value.integer.value[0]
+		? (AC97_AD198X_LOSEL | AC97_AD198X_HPSEL) : 0;
+	return snd_ac97_update_bits(ac97, AC97_AD_MISC,
+				    AC97_AD198X_LOSEL | AC97_AD198X_HPSEL, val);
+}
+
+static int snd_ac97_ad1980_downmix_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo)
+{
+	static char *texts[3] = {"Off", "6 -> 4", "6 -> 2"};
+
+	uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
+	uinfo->count = 1;
+	uinfo->value.enumerated.items = 3;
+	if (uinfo->value.enumerated.item > 2)
+		uinfo->value.enumerated.item = 2;
+	strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
+	return 0;
+}
+
+static int snd_ac97_ad1980_downmix_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t* ucontrol)
+{
+	ac97_t *ac97 = snd_kcontrol_chip(kcontrol);
+	unsigned short val;
+
+	val = ac97->regs[AC97_AD_MISC];
+	if (!(val & AC97_AD198X_DMIX1))
+		ucontrol->value.enumerated.item[0] = 0;
+	else
+		ucontrol->value.enumerated.item[0] = 1 + ((val >> 8) & 1);
+	return 0;
+}
+
+static int snd_ac97_ad1980_downmix_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+{
+	ac97_t *ac97 = snd_kcontrol_chip(kcontrol);
+	unsigned short val;
+
+	if (ucontrol->value.enumerated.item[0] > 2)
+		return -EINVAL;
+	if (ucontrol->value.enumerated.item[0] == 0)
+		val = 0;
+	else
+		val = AC97_AD198X_DMIX1 |
+			((ucontrol->value.enumerated.item[0] - 1) << 8);
+	return snd_ac97_update_bits(ac97, AC97_AD_MISC,
+				    AC97_AD198X_DMIX0 | AC97_AD198X_DMIX1, val);
+}
+
+static const snd_kcontrol_new_t snd_ac97_ad1980_controls[] = {
+	{
+		.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+		.name = "Exchange Front/Surround",
+		.info = snd_ac97_ad1980_lohpsel_info,
+		.get = snd_ac97_ad1980_lohpsel_get,
+		.put = snd_ac97_ad1980_lohpsel_put
+	},
+	AC97_SINGLE("Spread Front to Surround and Center/LFE", AC97_AD_MISC, 7, 1, 0),
+	{
+		.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+		.name = "Downmix",
+		.info = snd_ac97_ad1980_downmix_info,
+		.get = snd_ac97_ad1980_downmix_get,
+		.put = snd_ac97_ad1980_downmix_put
+	},
+	AC97_SINGLE("Surround Jack as Input", AC97_AD_MISC, 12, 1, 0),
+	AC97_SINGLE("Center/LFE Jack as Input", AC97_AD_MISC, 11, 1, 0),
+};
+
+static int patch_ad1980_specific(ac97_t *ac97)
+{
+	int err;
+
+	/* rename 0x04 as "Master" and 0x02 as "Master Surround" */
+	snd_ac97_rename_ctl(ac97, "Master Playback Switch", "Master Surround Playback Switch");
+	snd_ac97_rename_ctl(ac97, "Master Playback Volume", "Master Surround Playback Volume");
+	snd_ac97_rename_ctl(ac97, "Headphone Playback Switch", "Master Playback Switch");
+	snd_ac97_rename_ctl(ac97, "Headphone Playback Volume", "Master Playback Volume");
+	if ((err = patch_build_controls(ac97, &snd_ac97_ad198x_2cmic, 1)) < 0)
+		return err;
+	return patch_build_controls(ac97, snd_ac97_ad1980_controls, ARRAY_SIZE(snd_ac97_ad1980_controls));
 }
 
 static struct snd_ac97_build_ops patch_ad1980_build_ops = {
-	.build_post_spdif = &patch_ad1980_post_spdif
+	.build_post_spdif = patch_ad198x_post_spdif,
+	.build_specific = patch_ad1980_specific
 };
 
 int patch_ad1980(ac97_t * ac97)
@@ -776,29 +918,50 @@
 	ac97->build_ops = &patch_ad1980_build_ops;
 	/* Switch FRONT/SURROUND LINE-OUT/HP-OUT default connection */
 	/* it seems that most vendors connect line-out connector to headphone out of AC'97 */
+	/* AD-compatible mode */
 	/* Stereo mutes enabled */
 	misc = snd_ac97_read(ac97, AC97_AD_MISC);
 	snd_ac97_write_cache(ac97, AC97_AD_MISC, misc |
 			     AC97_AD198X_LOSEL |
 			     AC97_AD198X_HPSEL |
-			     AC97_AD198X_MSPLT);
+			     AC97_AD198X_MSPLT |
+			     AC97_AD198X_AC97NC);
 	ac97->flags |= AC97_STEREO_MUTES;
 	return 0;
 }
 
+static const snd_kcontrol_new_t snd_ac97_ad1985_controls[] = {
+	AC97_SINGLE("Center/LFE Jack as Mic", AC97_AD_SERIAL_CFG, 9, 1, 0),
+	AC97_SINGLE("Exchange Center/LFE", AC97_AD_SERIAL_CFG, 3, 1, 0)
+};
+
+static int patch_ad1985_specific(ac97_t *ac97)
+{
+	int err;
+
+	if ((err = patch_ad1980_specific(ac97)) < 0)
+		return err;
+	return patch_build_controls(ac97, snd_ac97_ad1985_controls, ARRAY_SIZE(snd_ac97_ad1985_controls));
+}
+
+static struct snd_ac97_build_ops patch_ad1985_build_ops = {
+	.build_post_spdif = patch_ad198x_post_spdif,
+	.build_specific = patch_ad1985_specific
+};
+
 int patch_ad1985(ac97_t * ac97)
 {
 	unsigned short misc;
 	
-	patch_ad1881(ac97);
-	ac97->build_ops = &patch_ad1980_build_ops;
+	ac97->build_ops = &patch_ad1985_build_ops;
 	misc = snd_ac97_read(ac97, AC97_AD_MISC);
 	/* switch front/surround line-out/hp-out */
-	/* center/LFE, surround in High-Z mode */
+	/* center/LFE, mic in 3.75V mode */
 	/* AD-compatible mode */
 	/* Stereo mutes enabled */
+	/* in accordance with ADI driver: misc | 0x5c28 */
 	snd_ac97_write_cache(ac97, AC97_AD_MISC, misc |
-			     AC97_AD198X_VREFD |
+			     AC97_AD198X_VREFH |
 			     AC97_AD198X_LOSEL |
 			     AC97_AD198X_HPSEL |
 			     AC97_AD198X_CLDIS |
@@ -820,6 +983,8 @@
 	/* 7: Independent Master Volume Left */
 	/* 8: reserved */
 	AC97_SINGLE("Line-In As Surround", AC97_ALC650_MULTICH, 9, 1, 0),
+	/* 10: mic, see below */
+	/* 11-13: in IEC958 controls */
 	AC97_SINGLE("Swap Surround Slot", AC97_ALC650_MULTICH, 14, 1, 0),
 #if 0 /* always set in patch_alc650 */
 	AC97_SINGLE("IEC958 Input Clock Enable", AC97_ALC650_CLOCK, 0, 1, 0),
@@ -898,7 +1063,6 @@
 int patch_alc650(ac97_t * ac97)
 {
 	unsigned short val;
-	int spdif = 0;
 
 	ac97->build_ops = &patch_alc650_ops;
 
@@ -907,22 +1071,16 @@
 	ac97->spec.dev_flags = (ac97->id == 0x414c4722 ||
 				ac97->id == 0x414c4723);
 
-	/* check spdif (should be only on rev.E) */
-	if (ac97->spec.dev_flags) {
-		val = snd_ac97_read(ac97, AC97_EXTENDED_STATUS);
-		if (val & AC97_EA_SPCV)
-			spdif = 1;
-	}
+	/* enable AC97_ALC650_GPIO_SETUP, AC97_ALC650_CLOCK for R/W */
+	snd_ac97_write_cache(ac97, AC97_ALC650_GPIO_STATUS, 
+		snd_ac97_read(ac97, AC97_ALC650_GPIO_STATUS) | 0x8000);
 
-	if (spdif) {
-		/* enable AC97_ALC650_GPIO_SETUP, AC97_ALC650_CLOCK for R/W */
-		snd_ac97_write_cache(ac97, AC97_ALC650_GPIO_STATUS, 
-			snd_ac97_read(ac97, AC97_ALC650_GPIO_STATUS) | 0x8000);
+	/* Enable SPDIF-IN only on Rev.E and above */
+	if (ac97->spec.dev_flags) {
 		/* enable spdif in */
 		snd_ac97_write_cache(ac97, AC97_ALC650_CLOCK,
 				     snd_ac97_read(ac97, AC97_ALC650_CLOCK) | 0x03);
-	} else
-		ac97->ext_id &= ~AC97_EI_SPDIF; /* disable extended-id */
+	}
 
 	val = snd_ac97_read(ac97, AC97_ALC650_MULTICH);
 	val &= ~0xc000; /* slot: 3,4,7,8,6,9 */
@@ -953,6 +1111,98 @@
 	return 0;
 }
 
+static const snd_kcontrol_new_t snd_ac97_controls_alc655[] = {
+	AC97_SINGLE("Duplicate Front", AC97_ALC650_MULTICH, 0, 1, 0),
+	AC97_SINGLE("Line-In As Surround", AC97_ALC650_MULTICH, 9, 1, 0),
+	AC97_SINGLE("Mic As Center/LFE", AC97_ALC650_MULTICH, 10, 1, 0),
+};
+
+static int alc655_iec958_route_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo)
+{
+	static char *texts_655[3] = { "PCM", "Analog In", "IEC958 In" };
+	static char *texts_658[4] = { "PCM", "Analog1 In", "Analog2 In", "IEC958 In" };
+	ac97_t *ac97 = snd_kcontrol_chip(kcontrol);
+
+	uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
+	uinfo->count = 1;
+	uinfo->value.enumerated.items = ac97->spec.dev_flags ? 4 : 3;
+	if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items)
+		uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1;
+	strcpy(uinfo->value.enumerated.name,
+	       ac97->spec.dev_flags ?
+	       texts_658[uinfo->value.enumerated.item] :
+	       texts_655[uinfo->value.enumerated.item]);
+	return 0;
+
+}
+
+static int alc655_iec958_route_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+{
+	ac97_t *ac97 = snd_kcontrol_chip(kcontrol);
+	unsigned short val;
+
+	val = ac97->regs[AC97_ALC650_MULTICH];
+	val = (val >> 12) & 3;
+	if (ac97->spec.dev_flags && val == 3)
+		val = 0;
+	ucontrol->value.enumerated.item[0] = val;
+	return 0;
+}
+
+static int alc655_iec958_route_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+{
+	ac97_t *ac97 = snd_kcontrol_chip(kcontrol);
+	return snd_ac97_update_bits(ac97, AC97_ALC650_MULTICH, 3 << 12,
+				    (unsigned short)ucontrol->value.enumerated.item[0]);
+}
+
+static const snd_kcontrol_new_t snd_ac97_spdif_controls_alc655[] = {
+        AC97_SINGLE("IEC958 Capture Switch", AC97_ALC650_MULTICH, 11, 1, 0),
+        AC97_SINGLE("IEC958 Input Monitor", AC97_ALC650_MULTICH, 14, 1, 0),
+	{
+		.iface  = SNDRV_CTL_ELEM_IFACE_MIXER,
+		.name   = "IEC958 Playback Route",
+		.info   = alc655_iec958_route_info,
+		.get    = alc655_iec958_route_get,
+		.put    = alc655_iec958_route_put,
+	},
+};
+
+static int patch_alc655_specific(ac97_t * ac97)
+{
+	int err;
+
+	if ((err = patch_build_controls(ac97, snd_ac97_controls_alc655, ARRAY_SIZE(snd_ac97_controls_alc655))) < 0)
+		return err;
+	if (ac97->ext_id & AC97_EI_SPDIF) {
+		if ((err = patch_build_controls(ac97, snd_ac97_spdif_controls_alc655, ARRAY_SIZE(snd_ac97_spdif_controls_alc655))) < 0)
+			return err;
+	}
+	return 0;
+}
+
+static struct snd_ac97_build_ops patch_alc655_ops = {
+	.build_specific	= patch_alc655_specific
+};
+
+int patch_alc655(ac97_t * ac97)
+{
+	ac97->spec.dev_flags = (ac97->id == 0x414c4780); /* ALC658 */
+
+	ac97->build_ops = &patch_alc655_ops;
+
+	/* enable spdif in */
+	snd_ac97_write_cache(ac97, AC97_ALC650_CLOCK,
+			     snd_ac97_read(ac97, AC97_ALC650_MULTICH) | 0x8000);
+	snd_ac97_write_cache(ac97, AC97_ALC650_CLOCK,
+			     snd_ac97_read(ac97, AC97_ALC650_CLOCK) | 0x02);
+
+	/* full DAC volume */
+	snd_ac97_write_cache(ac97, AC97_ALC650_SURR_DAC_VOL, 0x0808);
+	snd_ac97_write_cache(ac97, AC97_ALC650_LFE_DAC_VOL, 0x0808);
+	return 0;
+}
+
 static const snd_kcontrol_new_t snd_ac97_cm9738_controls[] = {
 	AC97_SINGLE("Line-In As Surround", AC97_CM9738_VENDOR_CTRL, 10, 1, 0),
 	AC97_SINGLE("Duplicate Front", AC97_CM9738_VENDOR_CTRL, 13, 1, 0),
@@ -1099,3 +1349,48 @@
 	ac97->build_ops = &patch_vt1616_ops;
 	return 0;
 }
+
+static const snd_kcontrol_new_t snd_ac97_controls_it2646[] = {
+	AC97_SINGLE("Line-In As Surround", 0x76, 9, 1, 0),
+	AC97_SINGLE("Mic As Center/LFE", 0x76, 10, 1, 0),
+};
+
+static const snd_kcontrol_new_t snd_ac97_spdif_controls_it2646[] = {
+	AC97_SINGLE("IEC958 Capture Switch", 0x76, 11, 1, 0),
+	AC97_SINGLE("Analog to IEC958 Output", 0x76, 12, 1, 0),
+	AC97_SINGLE("IEC958 Input Monitor", 0x76, 13, 1, 0),
+};
+
+static int patch_it2646_specific(ac97_t * ac97)
+{
+	int err;
+	if ((err = patch_build_controls(ac97, snd_ac97_controls_it2646, ARRAY_SIZE(snd_ac97_controls_it2646))) < 0)
+		return err;
+	if ((err = patch_build_controls(ac97, snd_ac97_spdif_controls_it2646, ARRAY_SIZE(snd_ac97_spdif_controls_it2646))) < 0)
+		return err;
+	return 0;
+}
+
+static struct snd_ac97_build_ops patch_it2646_ops = {
+	.build_specific	= patch_it2646_specific
+};
+
+int patch_it2646(ac97_t * ac97)
+{
+	ac97->build_ops = &patch_it2646_ops;
+	/* full DAC volume */
+	snd_ac97_write_cache(ac97, 0x5E, 0x0808);
+	snd_ac97_write_cache(ac97, 0x7A, 0x0808);
+	return 0;
+}
+
+/* Si3036/8 specific registers */
+#define AC97_SI3036_CHIP_ID     0x5a
+
+int mpatch_si3036(ac97_t * ac97)
+{
+	//printk("mpatch_si3036: chip id = %x\n", snd_ac97_read(ac97, 0x5a));
+	snd_ac97_write_cache(ac97, 0x5c, 0xf210 );
+	snd_ac97_write_cache(ac97, 0x68, 0);
+	return 0;
+}
--- diff/sound/pci/ac97/ac97_patch.h	2003-08-26 10:00:55.000000000 +0100
+++ source/sound/pci/ac97/ac97_patch.h	2004-02-09 10:39:58.000000000 +0000
@@ -42,8 +42,13 @@
 int patch_ad1885(ac97_t * ac97);
 int patch_ad1886(ac97_t * ac97);
 int patch_ad1980(ac97_t * ac97);
+int patch_ad1981a(ac97_t * ac97);
+int patch_ad1981b(ac97_t * ac97);
 int patch_ad1985(ac97_t * ac97);
 int patch_alc650(ac97_t * ac97);
+int patch_alc655(ac97_t * ac97);
 int patch_cm9738(ac97_t * ac97);
 int patch_cm9739(ac97_t * ac97);
 int patch_vt1616(ac97_t * ac97);
+int patch_it2646(ac97_t * ac97);
+int mpatch_si3036(ac97_t * ac97);
--- diff/sound/pci/ac97/ac97_proc.c	2003-09-30 15:46:21.000000000 +0100
+++ source/sound/pci/ac97/ac97_proc.c	2004-02-09 10:39:58.000000000 +0000
@@ -37,15 +37,12 @@
 static void snd_ac97_proc_read_main(ac97_t *ac97, snd_info_buffer_t * buffer, int subidx)
 {
 	char name[64];
-	unsigned int id;
 	unsigned short val, tmp, ext, mext;
 	static const char *spdif_slots[4] = { " SPDIF=3/4", " SPDIF=7/8", " SPDIF=6/9", " SPDIF=res" };
 	static const char *spdif_rates[4] = { " Rate=44.1kHz", " Rate=res", " Rate=48kHz", " Rate=32kHz" };
 	static const char *spdif_rates_cs4205[4] = { " Rate=48kHz", " Rate=44.1kHz", " Rate=res", " Rate=res" };
 
-	id = snd_ac97_read(ac97, AC97_VENDOR_ID1) << 16;
-	id |= snd_ac97_read(ac97, AC97_VENDOR_ID2);
-	snd_ac97_get_name(NULL, id, name, 0);
+	snd_ac97_get_name(NULL, ac97->id, name, 0);
 	snd_iprintf(buffer, "%d-%d/%d: %s\n\n", ac97->addr, ac97->num, subidx, name);
 	if ((ac97->scaps & AC97_SCAP_AUDIO) == 0)
 		goto __modem;
@@ -299,21 +296,67 @@
 	}	
 }
 
-void snd_ac97_proc_init(snd_card_t * card, ac97_t * ac97, const char *prefix)
+void snd_ac97_proc_init(ac97_t * ac97)
 {
 	snd_info_entry_t *entry;
 	char name[32];
+	const char *prefix;
 
-	if (ac97->num)
-		sprintf(name, "%s#%d-%d", prefix, ac97->addr, ac97->num);
-	else
-		sprintf(name, "%s#%d", prefix, ac97->addr);
-	if (! snd_card_proc_new(card, name, &entry))
-		snd_info_set_text_ops(entry, ac97, snd_ac97_proc_read);
-	if (ac97->num)
-		sprintf(name, "%s#%d-%dregs", prefix, ac97->addr, ac97->num);
-	else
-		sprintf(name, "%s#%dregs", prefix, ac97->addr);
-	if (! snd_card_proc_new(card, name, &entry))
-		snd_info_set_text_ops(entry, ac97, snd_ac97_proc_regs_read);
+	if (ac97->bus->proc == NULL)
+		return;
+	prefix = ac97_is_audio(ac97) ? "ac97" : "mc97";
+	sprintf(name, "%s#%d-%d", prefix, ac97->addr, ac97->num);
+	if ((entry = snd_info_create_card_entry(ac97->bus->card, name, ac97->bus->proc)) != NULL) {
+		snd_info_set_text_ops(entry, ac97, 1024, snd_ac97_proc_read);
+		if (snd_info_register(entry) < 0) {
+			snd_info_free_entry(entry);
+			entry = NULL;
+		}
+	}
+	ac97->proc = entry;
+	sprintf(name, "%s#%d-%d+regs", prefix, ac97->addr, ac97->num);
+	if ((entry = snd_info_create_card_entry(ac97->bus->card, name, ac97->bus->proc)) != NULL) {
+		snd_info_set_text_ops(entry, ac97, 1024, snd_ac97_proc_regs_read);
+		if (snd_info_register(entry) < 0) {
+			snd_info_free_entry(entry);
+			entry = NULL;
+		}
+	}
+	ac97->proc_regs = entry;
+}
+
+void snd_ac97_proc_done(ac97_t * ac97)
+{
+	if (ac97->proc_regs) {
+		snd_info_unregister(ac97->proc_regs);
+		ac97->proc_regs = NULL;
+	}
+	if (ac97->proc) {
+		snd_info_unregister(ac97->proc);
+		ac97->proc = NULL;
+	}
+}
+
+void snd_ac97_bus_proc_init(ac97_bus_t * bus)
+{
+	snd_info_entry_t *entry;
+	char name[32];
+
+	sprintf(name, "codec97#%d", bus->num);
+	if ((entry = snd_info_create_card_entry(bus->card, name, bus->card->proc_root)) != NULL) {
+		entry->mode = S_IFDIR | S_IRUGO | S_IXUGO;
+		if (snd_info_register(entry) < 0) {
+			snd_info_free_entry(entry);
+			entry = NULL;
+		}
+	}
+	bus->proc = entry;
+}
+
+void snd_ac97_bus_proc_done(ac97_bus_t * bus)
+{
+	if (bus->proc) {
+		snd_info_unregister(bus->proc);
+		bus->proc = NULL;
+	}
 }
--- diff/sound/pci/ac97/ak4531_codec.c	2003-02-13 11:46:57.000000000 +0000
+++ source/sound/pci/ac97/ak4531_codec.c	2004-02-09 10:39:58.000000000 +0000
@@ -425,7 +425,7 @@
 	snd_info_entry_t *entry;
 
 	if (! snd_card_proc_new(card, "ak4531", &entry))
-		snd_info_set_text_ops(entry, ak4531, snd_ak4531_proc_read);
+		snd_info_set_text_ops(entry, ak4531, 1024, snd_ak4531_proc_read);
 }
 
 EXPORT_SYMBOL(snd_ak4531_mixer);
--- diff/sound/pci/ali5451/ali5451.c	2003-08-20 14:16:34.000000000 +0100
+++ source/sound/pci/ali5451/ali5451.c	2004-02-09 10:39:58.000000000 +0000
@@ -265,6 +265,7 @@
 	unsigned int spurious_irq_count;
 	unsigned int spurious_irq_max_delta;
 
+	ac97_bus_t *ac97_bus;
 	ac97_t *ac97;
 	unsigned short	ac97_ext_id;
 	unsigned short	ac97_ext_status;
@@ -1860,6 +1861,12 @@
 	ALI5451_SPDIF(SNDRV_CTL_NAME_IEC958("",CAPTURE,SWITCH), 0, 2)
 };
 
+static void snd_ali_mixer_free_ac97_bus(ac97_bus_t *bus)
+{
+	ali_t *codec = snd_magic_cast(ali_t, bus->private_data, return);
+	codec->ac97_bus = NULL;
+}
+
 static void snd_ali_mixer_free_ac97(ac97_t *ac97)
 {
 	ali_t *codec = snd_magic_cast(ali_t, ac97->private_data, return);
@@ -1868,16 +1875,23 @@
 
 static int __devinit snd_ali_mixer(ali_t * codec)
 {
+	ac97_bus_t bus;
 	ac97_t ac97;
 	unsigned int idx;
 	int err;
 
+	memset(&bus, 0, sizeof(bus));
+	bus.write = snd_ali_codec_write;
+	bus.read = snd_ali_codec_read;
+	bus.private_data = codec;
+	bus.private_free = snd_ali_mixer_free_ac97_bus;
+	if ((err = snd_ac97_bus(codec->card, &bus, &codec->ac97_bus)) < 0)
+		return err;
+
 	memset(&ac97, 0, sizeof(ac97));
-	ac97.write = snd_ali_codec_write;
-	ac97.read = snd_ali_codec_read;
 	ac97.private_data = codec;
 	ac97.private_free = snd_ali_mixer_free_ac97;
-	if ((err = snd_ac97_mixer(codec->card, &ac97, &codec->ac97)) < 0) {
+	if ((err = snd_ac97_mixer(codec->ac97_bus, &ac97, &codec->ac97)) < 0) {
 		snd_printk("ali mixer creating error.\n");
 		return err;
 	}
@@ -2092,11 +2106,11 @@
 	if ((err = pci_enable_device(pci)) < 0)
 		return err;
 	/* check, if we can restrict PCI DMA transfers to 31 bits */
-	if (!pci_dma_supported(pci, 0x7fffffff)) {
+	if (pci_set_dma_mask(pci, 0x7fffffff) < 0 ||
+	    pci_set_consistent_dma_mask(pci, 0x7fffffff) < 0) {
 		snd_printk("architecture does not support 31bit PCI busmaster DMA\n");
 		return -ENXIO;
 	}
-	pci_set_dma_mask(pci, 0x7fffffff);
 
 	if ((codec = snd_magic_kcalloc(ali_t, 0, GFP_KERNEL)) == NULL)
 		return -ENOMEM;
--- diff/sound/pci/als4000.c	2003-08-20 14:16:34.000000000 +0100
+++ source/sound/pci/als4000.c	2004-02-09 10:39:58.000000000 +0000
@@ -63,6 +63,7 @@
 #include <linux/init.h>
 #include <linux/pci.h>
 #include <linux/slab.h>
+#include <linux/gameport.h>
 #include <sound/core.h>
 #include <sound/pcm.h>
 #include <sound/rawmidi.h>
@@ -78,14 +79,15 @@
 MODULE_CLASSES("{sound}");
 MODULE_DEVICES("{{Avance Logic,ALS4000}}");
 
+#if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE))
+#define SUPPORT_JOYSTICK 1
+#endif
+
 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;	/* Index 0-MAX */
 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;	/* ID for this card */
 static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;	/* Enable this card */
-static int joystick_port[SNDRV_CARDS] =
-#ifdef CONFIG_ISA
-	{0x200};	/* enable as default */
-#else
-	{0};	/* disabled */
+#ifdef SUPPORT_JOYSTICK
+static int joystick_port[SNDRV_CARDS];
 #endif
 
 MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
@@ -105,6 +107,11 @@
 
 typedef struct {
 	unsigned long gcr;
+	struct resource *res_gcr;
+#ifdef SUPPORT_JOYSTICK
+	struct gameport gameport;
+	struct resource *res_joystick;
+#endif
 } snd_card_als4000_t;
 
 static struct pci_device_id snd_als4000_ids[] = {
@@ -523,7 +530,7 @@
 
 /******************************************************************/
 
-static void __devinit snd_als4000_set_addr(unsigned long gcr,
+static void snd_als4000_set_addr(unsigned long gcr,
 					unsigned int sb,
 					unsigned int mpu,
 					unsigned int opl,
@@ -574,6 +581,18 @@
 	snd_card_als4000_t * acard = (snd_card_als4000_t *)card->private_data;
 	/* make sure that interrupts are disabled */
 	snd_als4000_gcr_write_addr( acard->gcr, 0x8c, 0);
+	/* free resources */
+#ifdef SUPPORT_JOYSTICK
+	if (acard->res_joystick) {
+		if (acard->gameport.io)
+			gameport_unregister_port(&acard->gameport);
+		snd_als4000_set_addr(acard->gcr, 0, 0, 0, 0); /* disable joystick */
+		release_resource(acard->res_joystick);
+		kfree_nocheck(acard->res_joystick);
+	}
+#endif
+	release_resource(acard->res_gcr);
+	kfree_nocheck(acard->res_gcr);
 }
 
 static int __devinit snd_card_als4000_probe(struct pci_dev *pci,
@@ -588,6 +607,7 @@
 	opl3_t *opl3;
 	unsigned short word;
 	int err;
+	int joystick = 0;
 
 	if (dev >= SNDRV_CARDS)
 		return -ENODEV;
@@ -601,11 +621,11 @@
 		return err;
 	}
 	/* check, if we can restrict PCI DMA transfers to 24 bits */
-	if (!pci_dma_supported(pci, 0x00ffffff)) {
+	if (pci_set_dma_mask(pci, 0x00ffffff) < 0 ||
+	    pci_set_consistent_dma_mask(pci, 0x00ffffff) < 0) {
 		snd_printk("architecture does not support 24bit PCI busmaster DMA\n");
 		return -ENXIO;
 	}
-	pci_set_dma_mask(pci, 0x00ffffff);
 
 	gcr = pci_resource_start(pci, 0);
 	if ((res_gcr_port = request_region(gcr, 0x40, "ALS4000")) == NULL) {
@@ -617,9 +637,6 @@
 	pci_write_config_word(pci, PCI_COMMAND, word | PCI_COMMAND_IO);
 	pci_set_master(pci);
 	
-	/* disable all legacy ISA stuff except for joystick */
-	snd_als4000_set_addr(gcr, 0, 0, 0, joystick_port[dev]);
-	
 	card = snd_card_new(index[dev], id[dev], THIS_MODULE, 
 			    sizeof( snd_card_als4000_t ) );
 	if (card == NULL) {
@@ -630,8 +647,29 @@
 
 	acard = (snd_card_als4000_t *)card->private_data;
 	acard->gcr = gcr;
+	acard->res_gcr = res_gcr_port;
 	card->private_free = snd_card_als4000_free;
 
+	/* disable all legacy ISA stuff except for joystick */
+#ifdef SUPPORT_JOYSTICK
+	if (joystick_port[dev] == 1) {
+		/* auto-detect */
+		long p;
+		for (p = 0x200; p <= 0x218; p += 8) {
+			if ((acard->res_joystick = request_region(p, 8, "ALS4000 gameport")) != NULL) {
+				joystick_port[dev] = p;
+				break;
+			}
+		}
+	} else if (joystick_port[dev] > 0)
+		acard->res_joystick = request_region(joystick_port[dev], 8, "ALS4000 gameport");
+	if (acard->res_joystick)
+		joystick = joystick_port[dev];
+	else
+		joystick = 0;
+#endif
+	snd_als4000_set_addr(gcr, 0, 0, 0, joystick);
+	
 	if ((err = snd_sbdsp_create(card,
 				    gcr + 0x10,
 				    pci->irq,
@@ -640,18 +678,21 @@
 				    -1,
 				    SB_HW_ALS4000,
 				    &chip)) < 0) {
-		release_resource(res_gcr_port);
-		kfree_nocheck(res_gcr_port);
 		snd_card_free(card);
 		return err;
 	}
 
 	chip->pci = pci;
 	chip->alt_port = gcr;
-	chip->res_alt_port = res_gcr_port;
+	snd_card_set_dev(card, &pci->dev);
 
 	snd_als4000_configure(chip);
-	
+
+	strcpy(card->driver, "ALS4000");
+	strcpy(card->shortname, "Avance Logic ALS4000");
+	sprintf(card->longname, "%s at 0x%lx, irq %i",
+		card->shortname, chip->alt_port, chip->irq);
+
 	if ((err = snd_mpu401_uart_new( card, 0, MPU401_HW_ALS4000,
 				        gcr+0x30, 1, pci->irq, 0,
 				        &chip->rmidi)) < 0) {
@@ -680,10 +721,12 @@
 		}
 	}
 
-	strcpy(card->driver, "ALS4000");
-	strcpy(card->shortname, "Avance Logic ALS4000");
-	sprintf(card->longname, "%s at 0x%lx, irq %i",
-		card->shortname, chip->alt_port, chip->irq);
+#ifdef SUPPORT_JOYSTICK
+	if (acard->res_joystick) {
+		acard->gameport.io = joystick;
+		gameport_register_port(&acard->gameport);
+	}
+#endif
 
 	if ((err = snd_card_register(card)) < 0) {
 		snd_card_free(card);
@@ -730,7 +773,7 @@
 
 #ifndef MODULE
 
-/* format is: snd-als4000=enable,index,id */
+/* format is: snd-als4000=enable,index,id,joystick_port */
 
 static int __init alsa_card_als4000_setup(char *str)
 {
@@ -740,7 +783,11 @@
 		return 0;
 	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
 	       get_option(&str,&index[nr_dev]) == 2 &&
-	       get_id(&str,&id[nr_dev]) == 2);
+	       get_id(&str,&id[nr_dev]) == 2
+#ifdef SUPPORT_JOYSTICK
+	       && get_option(&str,&joystick_port[nr_dev]) == 2
+#endif
+	       );
 	nr_dev++;
 	return 1;
 }
--- diff/sound/pci/azt3328.c	2003-08-26 10:00:55.000000000 +0100
+++ source/sound/pci/azt3328.c	2004-02-09 10:39:58.000000000 +0000
@@ -97,6 +97,7 @@
 #include <linux/pci.h>
 #include <linux/delay.h>
 #include <linux/slab.h>
+#include <linux/gameport.h>
 #include <sound/core.h>
 #include <sound/control.h>
 #include <sound/pcm.h>
@@ -113,6 +114,10 @@
 MODULE_CLASSES("{sound}");
 MODULE_DEVICES("{{Aztech,AZF3328}}");
 
+#if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE))
+#define SUPPORT_JOYSTICK 1
+#endif
+
 #define DEBUG_MISC	0
 #define DEBUG_CALLS	0
 #define DEBUG_MIXER	0
@@ -158,8 +163,9 @@
 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;	/* Index 0-MAX */
 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;	/* ID for this card */
 static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;	/* Enable this card */
-static int joystick[SNDRV_CARDS] =
-	{-1};	/* "unset" as default */
+#ifdef SUPPORT_JOYSTICK
+static int joystick[SNDRV_CARDS];
+#endif
 
 MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
 MODULE_PARM_DESC(index, "Index value for AZF3328 soundcard.");
@@ -170,9 +176,11 @@
 MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
 MODULE_PARM_DESC(enable, "Enable AZF3328 soundcard.");
 MODULE_PARM_SYNTAX(enable, SNDRV_INDEX_DESC);
+#ifdef SUPPORT_JOYSTICK
 MODULE_PARM(joystick, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
-MODULE_PARM_DESC(joystick, "Forced joystick port enable for AZF3328 soundcard. (0 = force disable)");
-MODULE_PARM_SYNTAX(joystick, SNDRV_ENABLED);
+MODULE_PARM_DESC(joystick, "Enable joystick for AZF3328 soundcard.");
+MODULE_PARM_SYNTAX(joystick, SNDRV_BOOLEAN_FALSE_DESC);
+#endif
 
 typedef struct _snd_azf3328 azf3328_t;
 #define chip_t azf3328_t
@@ -190,7 +198,11 @@
 	struct resource *res_synth_port;
 	unsigned long mixer_port;
 	struct resource *res_mixer_port;
-	unsigned long game_port;
+
+#ifdef SUPPORT_JOYSTICK
+	struct gameport gameport;
+	struct resource *res_joystick;
+#endif
 
 	struct pci_dev *pci;
 	snd_card_t *card;
@@ -1259,6 +1271,16 @@
 
         synchronize_irq(chip->irq);
       __end_hw:
+#ifdef SUPPORT_JOYSTICK
+	if (chip->res_joystick) {
+		gameport_unregister_port(&chip->gameport);
+		/* disable gameport */
+		snd_azf3328_io2_write(chip, IDX_IO2_LEGACY_ADDR,
+				      snd_azf3328_io2_read(chip, IDX_IO2_LEGACY_ADDR) & ~LEGACY_JOY);
+		release_resource(chip->res_joystick);
+		kfree_nocheck(chip->res_joystick);
+	}
+#endif
         if (chip->res_codec_port) {
 		release_resource(chip->res_codec_port);
 		kfree_nocheck(chip->res_codec_port);
@@ -1339,11 +1361,11 @@
 	chip->irq = -1;
 
 	/* check if we can restrict PCI DMA transfers to 24 bits */
-	if (!pci_dma_supported(pci, 0x00ffffff)) {
+	if (pci_set_dma_mask(pci, 0x00ffffff) < 0 ||
+	    pci_set_consistent_dma_mask(pci, 0x00ffffff) < 0) {
 		snd_printk("architecture does not support 24bit PCI busmaster DMA\n");
 		return -ENXIO;
 	}
-	pci_set_dma_mask(pci, 0x00ffffff);
 
 	chip->codec_port = pci_resource_start(pci, 0);
 	if ((chip->res_codec_port = request_region(chip->codec_port, 0x80, "Aztech AZF3328 I/O")) == NULL) {
@@ -1415,57 +1437,33 @@
 
 	spin_unlock_irqrestore(&chip->reg_lock, flags);
 
+	snd_card_set_dev(card, &pci->dev);
+
 	*rchip = chip;
 	return 0;
 }
 
+#ifdef SUPPORT_JOYSTICK
 static void __devinit snd_azf3328_config_joystick(azf3328_t *chip, int joystick)
 {
-	int i, detected = 0, activate = 0;
-	char *msg = NULL;
 	unsigned char val;
 
-	if (joystick == -1) /* auto detection/activation */
-	{
-		for (i=0x200; i <= 0x207; i++)
-			if (inb(i) != 0xff)
-				detected = 1; /* other joy found, don't activate */
+	if (joystick == 1) {
+		if ((chip->res_joystick = request_region(0x200, 8, "AZF3328 gameport")) != NULL)
+			chip->gameport.io = 0x200;
 	}
 
-	if ((joystick == -1) && (detected == 1))
-	{
-		activate = 0;
-		msg = "DISABLED (address occupied by another joystick port)";
-	}
-	else
-	if ((joystick == -1) && (detected == 0))
-	{
-		activate = 1;
-		msg = "ENABLED (via autodetect)";
-	}
-	else
-	if (joystick == 0)
-	{
-		activate = 0;
-		msg = "DISABLED (forced)";
-	}
-	else
-	if (joystick == 1)
-	{
-		activate = 1;
-		msg = "ENABLED (Warning: forced!)";
-	}
 	val = inb(chip->io2_port + IDX_IO2_LEGACY_ADDR);
-	if (activate)
-	    val |= LEGACY_JOY;
+	if (chip->res_joystick)
+		val |= LEGACY_JOY;
 	else
-	    val &= ~LEGACY_JOY;
+		val &= ~LEGACY_JOY;
 
 	outb(val, chip->io2_port + IDX_IO2_LEGACY_ADDR);
-#ifdef MODULE
-	printk("azt3328: Joystick port: %s.\n", msg);
-#endif
+	if (chip->res_joystick)
+		gameport_register_port(&chip->gameport);
 }
+#endif
 
 static int __devinit snd_azf3328_probe(struct pci_dev *pci,
 					  const struct pci_device_id *pci_id)
@@ -1537,7 +1535,9 @@
 "azt3328: Feel free to contact hw7oshyuv3001@sneakemail.com for bug reports etc.!\n");
 #endif
 
+#ifdef SUPPORT_JOYSTICK
 	snd_azf3328_config_joystick(chip, joystick[dev]);
+#endif
 
 	pci_set_drvdata(pci, chip);
 	dev++;
@@ -1598,7 +1598,7 @@
 
 #ifndef MODULE
 
-/* format is: snd-azf3328=enable,index,id */
+/* format is: snd-azf3328=enable,index,id,joystick */
 
 static int __init alsa_card_azf3328_setup(char *str)
 {
@@ -1610,12 +1610,16 @@
 		return 0;
 	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
 	       get_option(&str,&index[nr_dev]) == 2 &&
-	       get_id(&str,&id[nr_dev]) == 2);
+	       get_id(&str,&id[nr_dev]) == 2
+#ifdef SUPPORT_JOYSTICK
+	       && get_option(&str,&joystick[nr_dev]) == 2
+#endif
+	       );
 	nr_dev++;
 	snd_azf3328_dbgcallleave();
 	return 1;
 }
 
-__setup("snd-azf3328=", alsa_card_azf3328_setup);
+__setup("snd-azt3328=", alsa_card_azf3328_setup);
 
 #endif /* ifndef MODULE */
--- diff/sound/pci/cmipci.c	2003-10-09 09:47:34.000000000 +0100
+++ source/sound/pci/cmipci.c	2004-02-09 10:39:58.000000000 +0000
@@ -31,6 +31,7 @@
 #include <linux/init.h>
 #include <linux/pci.h>
 #include <linux/slab.h>
+#include <linux/gameport.h>
 #include <sound/core.h>
 #include <sound/info.h>
 #include <sound/control.h>
@@ -52,14 +53,21 @@
 		"{C-Media,CMI8338A},"
 		"{C-Media,CMI8338B}}");
 
+#if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE))
+#define SUPPORT_JOYSTICK 1
+#endif
+
 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;	/* Index 0-MAX */
 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;	/* ID for this card */
 static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;	/* Enable switches */
-static long mpu_port[SNDRV_CARDS] = {0x330, [1 ... (SNDRV_CARDS-1)]=-1};
-static long fm_port[SNDRV_CARDS] = {0x388, [1 ... (SNDRV_CARDS-1)]=-1};
+static long mpu_port[SNDRV_CARDS];
+static long fm_port[SNDRV_CARDS];
 #ifdef DO_SOFT_AC3
 static int soft_ac3[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)]=1};
 #endif
+#ifdef SUPPORT_JOYSTICK
+static int joystick_port[SNDRV_CARDS];
+#endif
 
 MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
 MODULE_PARM_DESC(index, "Index value for C-Media PCI soundcard.");
@@ -72,15 +80,20 @@
 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
 MODULE_PARM(mpu_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
 MODULE_PARM_DESC(mpu_port, "MPU-401 port.");
-MODULE_PARM_SYNTAX(mpu_port, SNDRV_ENABLED ",allows:{{-1},{0x330},{0x320},{0x310},{0x300}},dialog:list");
+MODULE_PARM_SYNTAX(mpu_port, SNDRV_ENABLED ",allows:{{0},{0x330},{0x320},{0x310},{0x300}},dialog:list");
 MODULE_PARM(fm_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
 MODULE_PARM_DESC(fm_port, "FM port.");
-MODULE_PARM_SYNTAX(fm_port, SNDRV_ENABLED ",allows:{{-1},{0x388},{0x3c8},{0x3e0},{0x3e8}},dialog:list");
+MODULE_PARM_SYNTAX(fm_port, SNDRV_ENABLED ",allows:{{0},{0x388},{0x3c8},{0x3e0},{0x3e8}},dialog:list");
 #ifdef DO_SOFT_AC3
 MODULE_PARM(soft_ac3, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
 MODULE_PARM_DESC(soft_ac3, "Sofware-conversion of raw SPDIF packets (model 033 only).");
 MODULE_PARM_SYNTAX(soft_ac3, SNDRV_ENABLED "," SNDRV_BOOLEAN_TRUE_DESC);
 #endif
+#ifdef SUPPORT_JOYSTICK
+MODULE_PARM(joystick_port, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+MODULE_PARM_DESC(joystick_port, "Joystick port address.");
+MODULE_PARM_SYNTAX(joystick_port, SNDRV_ENABLED ",allows:{{0},{1},{0x200},{0x201}},dialog:list");
+#endif
 
 #ifndef PCI_DEVICE_ID_CMEDIA_CM8738
 #define PCI_DEVICE_ID_CMEDIA_CM8738	0x0111
@@ -339,6 +352,7 @@
 #define CM_EXTENT_MIDI	  0x2
 #define CM_EXTENT_SYNTH	  0x4
 
+
 /*
  * pci ids
  */
@@ -480,6 +494,11 @@
 	/* external MIDI */
 	snd_rawmidi_t *rmidi;
 
+#ifdef SUPPORT_JOYSTICK
+	struct gameport gameport;
+	struct resource *res_joystick;
+#endif
+
 	spinlock_t reg_lock;
 };
 
@@ -703,6 +722,7 @@
 
 		spin_lock_irqsave(&cm->reg_lock, flags);
 		snd_cmipci_set_bit(cm, CM_REG_LEGACY_CTRL, CM_NXCHG);
+		snd_cmipci_set_bit(cm, CM_REG_MISC_CTRL, CM_XCHGDAC);
 		if (channels > 4) {
 			snd_cmipci_clear_bit(cm, CM_REG_CHFORMAT, CM_CHB3D);
 			snd_cmipci_set_bit(cm, CM_REG_CHFORMAT, CM_CHB3D5C);
@@ -727,6 +747,7 @@
 			snd_cmipci_clear_bit(cm, CM_REG_CHFORMAT, CM_CHB3D5C);
 			snd_cmipci_clear_bit(cm, CM_REG_LEGACY_CTRL, CM_CHB3D6C);
 			snd_cmipci_clear_bit(cm, CM_REG_MISC_CTRL, CM_ENCENTER);
+			snd_cmipci_clear_bit(cm, CM_REG_MISC_CTRL, CM_XCHGDAC);
 			spin_unlock_irqrestore(&cm->reg_lock, flags);
 		}
 	}
@@ -1851,6 +1872,7 @@
 		return err;
 	runtime->hw = snd_cmipci_playback;
 	snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_SIZE, 0, 0x10000);
+	cm->dig_pcm_status = cm->dig_status;
 	return 0;
 }
 
@@ -2599,7 +2621,7 @@
 DEFINE_BIT_SWITCH_ARG(fourch, CM_REG_MISC_CTRL, CM_N4SPK3D, 0, 0);
 DEFINE_BIT_SWITCH_ARG(line_rear, CM_REG_MIXER1, CM_SPK4, 1, 0);
 DEFINE_BIT_SWITCH_ARG(line_bass, CM_REG_LEGACY_CTRL, CM_LINE_AS_BASS, 0, 0);
-DEFINE_BIT_SWITCH_ARG(joystick, CM_REG_FUNCTRL1, CM_JYSTK_EN, 0, 0);
+// DEFINE_BIT_SWITCH_ARG(joystick, CM_REG_FUNCTRL1, CM_JYSTK_EN, 0, 0); /* now module option */
 DEFINE_SWITCH_ARG(modem, CM_REG_MISC_CTRL, CM_FLINKON|CM_FLINKOFF, CM_FLINKON, 0, 0);
 
 #define DEFINE_SWITCH(sname, stype, sarg) \
@@ -2649,11 +2671,14 @@
 
 /* both for CM8338/8738 */
 static snd_kcontrol_new_t snd_cmipci_mixer_switches[] __devinitdata = {
-	DEFINE_MIXER_SWITCH("Exchange DAC", exchange_dac),
 	DEFINE_MIXER_SWITCH("Four Channel Mode", fourch),
 	DEFINE_MIXER_SWITCH("Line-In As Rear", line_rear),
 };
 
+/* for non-multichannel chips */
+static snd_kcontrol_new_t snd_cmipci_nomulti_switch __devinitdata =
+DEFINE_MIXER_SWITCH("Exchange DAC", exchange_dac);
+
 /* only for CM8738 */
 static snd_kcontrol_new_t snd_cmipci_8738_mixer_switches[] __devinitdata = {
 #if 0 /* controlled in pcm device */
@@ -2693,7 +2718,7 @@
 
 /* card control switches */
 static snd_kcontrol_new_t snd_cmipci_control_switches[] __devinitdata = {
-	DEFINE_CARD_SWITCH("Joystick", joystick),
+	// DEFINE_CARD_SWITCH("Joystick", joystick), /* now module option */
 	DEFINE_CARD_SWITCH("Modem", modem),
 };
 
@@ -2729,6 +2754,11 @@
 		if (err < 0)
 			return err;
 	}
+	if (! cm->can_multi_ch) {
+		err = snd_ctl_add(cm->card, snd_ctl_new1(&snd_cmipci_nomulti_switch, cm));
+		if (err < 0)
+			return err;
+	}
 	if (cm->device == PCI_DEVICE_ID_CMEDIA_CM8738 ||
 	    cm->device == PCI_DEVICE_ID_CMEDIA_CM8738B) {
 		sw = snd_cmipci_8738_mixer_switches;
@@ -2816,7 +2846,7 @@
 	snd_info_entry_t *entry;
 
 	if (! snd_card_proc_new(cm->card, "cmipci", &entry))
-		snd_info_set_text_ops(entry, cm, snd_cmipci_proc_read);
+		snd_info_set_text_ops(entry, cm, 1024, snd_cmipci_proc_read);
 }
 #else /* !CONFIG_PROC_FS */
 static inline void snd_cmipci_proc_init(cmipci_t *cm) {}
@@ -2905,6 +2935,14 @@
 
 		free_irq(cm->irq, (void *)cm);
 	}
+#ifdef SUPPORT_JOYSTICK
+	if (cm->res_joystick) {
+		gameport_unregister_port(&cm->gameport);
+		snd_cmipci_clear_bit(cm, CM_REG_FUNCTRL1, CM_JYSTK_EN);
+		release_resource(cm->res_joystick);
+		kfree_nocheck(cm->res_joystick);
+	}
+#endif
 	if (cm->res_iobase) {
 		release_resource(cm->res_iobase);
 		kfree_nocheck(cm->res_iobase);
@@ -2928,8 +2966,8 @@
 		.dev_free =	snd_cmipci_dev_free,
 	};
 	unsigned int val = 0;
-	unsigned long iomidi = mpu_port[dev];
-	unsigned long iosynth = fm_port[dev];
+	long iomidi = mpu_port[dev];
+	long iosynth = fm_port[dev];
 	int pcm_index, pcm_spdif_index;
 
 	*rcmipci = NULL;
@@ -3110,6 +3148,33 @@
 	snd_cmipci_set_bit(cm, CM_REG_MISC_CTRL, CM_SPDIF48K|CM_SPDF_AC97);
 #endif /* USE_VAR48KRATE */
 
+#ifdef SUPPORT_JOYSTICK
+	if (joystick_port[dev] > 0) {
+		if (joystick_port[dev] == 1) { /* auto-detect */
+			static int ports[] = { 0x200, 0x201, 0 };
+			int i;
+			for (i = 0; ports[i]; i++) {
+				joystick_port[dev] = ports[i];
+				cm->res_joystick = request_region(ports[i], 8, "CMIPCI gameport");
+				if (cm->res_joystick)
+					break;
+			}
+		} else {
+			cm->res_joystick = request_region(joystick_port[dev], 8, "CMIPCI gameport");
+		}
+	}
+	if (cm->res_joystick) {
+		cm->gameport.io = joystick_port[dev];
+		snd_cmipci_set_bit(cm, CM_REG_FUNCTRL1, CM_JYSTK_EN);
+		gameport_register_port(&cm->gameport);
+	} else {
+		if (joystick_port[dev] > 0)
+			printk(KERN_WARNING "cmipci: cannot reserve joystick ports\n");
+		snd_cmipci_clear_bit(cm, CM_REG_FUNCTRL1, CM_JYSTK_EN);
+	}
+#endif
+	snd_card_set_dev(card, &pci->dev);
+
 	*rcmipci = cm;
 	return 0;
 
@@ -3218,7 +3283,7 @@
 #ifndef MODULE
 
 /* format is: snd-cmipci=enable,index,id,
-			 mpu_port,fm_port */
+			 mpu_port,fm_port,soft_ac3,joystick_port */
 
 static int __init alsa_card_cmipci_setup(char *str)
 {
@@ -3229,8 +3294,15 @@
 	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
 	       get_option(&str,&index[nr_dev]) == 2 &&
 	       get_id(&str,&id[nr_dev]) == 2 &&
-	       get_option(&str,(int *)&mpu_port[nr_dev]) == 2 &&
-	       get_option(&str,(int *)&fm_port[nr_dev]) == 2);
+	       get_option_long(&str,&mpu_port[nr_dev]) == 2 &&
+	       get_option_long(&str,&fm_port[nr_dev]) == 2
+#ifdef DO_SOFT_AC3
+	       && get_option(&str,&soft_ac3[nr_dev]) == 2
+#endif
+#ifdef SUPPORT_JOYSTICK
+	       && get_option(&str,&joystick_port[nr_dev]) == 2
+#endif
+	       );
 	nr_dev++;
 	return 1;
 }
--- diff/sound/pci/cs4281.c	2003-08-26 10:00:55.000000000 +0100
+++ source/sound/pci/cs4281.c	2004-02-09 10:39:58.000000000 +0000
@@ -479,6 +479,7 @@
 
 	int dual_codec;
 
+	ac97_bus_t *ac97_bus;
 	ac97_t *ac97;
 	ac97_t *ac97_secondary;
 
@@ -564,7 +565,7 @@
 }
 
 static void snd_cs4281_ac97_write(ac97_t *ac97,
-				   unsigned short reg, unsigned short val)
+				  unsigned short reg, unsigned short val)
 {
 	/*
 	 *  1. Write ACCAD = Command Address Register = 46Ch for AC97 register address
@@ -609,7 +610,7 @@
 }
 
 static unsigned short snd_cs4281_ac97_read(ac97_t *ac97,
-					    unsigned short reg)
+					   unsigned short reg)
 {
 	cs4281_t *chip = snd_magic_cast(cs4281_t, ac97->private_data, return -ENXIO);
 	int count;
@@ -1119,6 +1120,12 @@
 	.private_value = ((BA0_PPLVC << 16) | BA0_PPRVC),
 };
 
+static void snd_cs4281_mixer_free_ac97_bus(ac97_bus_t *bus)
+{
+	cs4281_t *chip = snd_magic_cast(cs4281_t, bus->private_data, return);
+	chip->ac97_bus = NULL;
+}
+
 static void snd_cs4281_mixer_free_ac97(ac97_t *ac97)
 {
 	cs4281_t *chip = snd_magic_cast(cs4281_t, ac97->private_data, return);
@@ -1131,19 +1138,26 @@
 static int __devinit snd_cs4281_mixer(cs4281_t * chip)
 {
 	snd_card_t *card = chip->card;
+	ac97_bus_t bus;
 	ac97_t ac97;
 	int err;
 
+	memset(&bus, 0, sizeof(bus));
+	bus.write = snd_cs4281_ac97_write;
+	bus.read = snd_cs4281_ac97_read;
+	bus.private_data = chip;
+	bus.private_free = snd_cs4281_mixer_free_ac97_bus;
+	if ((err = snd_ac97_bus(card, &bus, &chip->ac97_bus)) < 0)
+		return err;
+
 	memset(&ac97, 0, sizeof(ac97));
-	ac97.write = snd_cs4281_ac97_write;
-	ac97.read = snd_cs4281_ac97_read;
 	ac97.private_data = chip;
 	ac97.private_free = snd_cs4281_mixer_free_ac97;
-	if ((err = snd_ac97_mixer(card, &ac97, &chip->ac97)) < 0)
+	if ((err = snd_ac97_mixer(chip->ac97_bus, &ac97, &chip->ac97)) < 0)
 		return err;
 	if (chip->dual_codec) {
 		ac97.num = 1;
-		if ((err = snd_ac97_mixer(card, &ac97, &chip->ac97_secondary)) < 0)
+		if ((err = snd_ac97_mixer(chip->ac97_bus, &ac97, &chip->ac97_secondary)) < 0)
 			return err;
 	}
 	if ((err = snd_ctl_add(card, snd_ctl_new1(&snd_cs4281_fm_vol, chip))) < 0)
@@ -1178,23 +1192,11 @@
 	if (file->f_pos + size > CS4281_BA0_SIZE)
 		size = (long)CS4281_BA0_SIZE - file->f_pos;
 	if (size > 0) {
-		char *tmp;
-		long res;
-		unsigned long virt;
-		if ((tmp = kmalloc(size, GFP_KERNEL)) == NULL)
-			return -ENOMEM;
-		virt = chip->ba0 + file->f_pos;
-		memcpy_fromio(tmp, virt, size);
-		if (copy_to_user(buf, tmp, size))
-			res = -EFAULT;
-		else {
-			res = size;
-			file->f_pos += size;
-		}
-		kfree(tmp);
-		return res;
+		if (copy_to_user_fromio(buf, chip->ba0 + file->f_pos, size))
+			return -EFAULT;
+		file->f_pos += size;
 	}
-	return 0;
+	return size;
 }
 
 static long snd_cs4281_BA1_read(snd_info_entry_t *entry, void *file_private_data,
@@ -1207,23 +1209,11 @@
 	if (file->f_pos + size > CS4281_BA1_SIZE)
 		size = (long)CS4281_BA1_SIZE - file->f_pos;
 	if (size > 0) {
-		char *tmp;
-		long res;
-		unsigned long virt;
-		if ((tmp = kmalloc(size, GFP_KERNEL)) == NULL)
-			return -ENOMEM;
-		virt = chip->ba1 + file->f_pos;
-		memcpy_fromio(tmp, virt, size);
-		if (copy_to_user(buf, tmp, size))
-			res = -EFAULT;
-		else {
-			res = size;
-			file->f_pos += size;
-		}
-		kfree(tmp);
-		return res;
+		if (copy_to_user_fromio(buf, chip->ba1 + file->f_pos, size))
+			return -EFAULT;
+		file->f_pos += size;
 	}
-	return 0;
+	return size;
 }
 
 static struct snd_info_entry_ops snd_cs4281_proc_ops_BA0 = {
@@ -1239,7 +1229,7 @@
 	snd_info_entry_t *entry;
 
 	if (! snd_card_proc_new(chip->card, "cs4281", &entry))
-		snd_info_set_text_ops(entry, chip, snd_cs4281_proc_read);
+		snd_info_set_text_ops(entry, chip, 1024, snd_cs4281_proc_read);
 	if (! snd_card_proc_new(chip->card, "cs4281_BA0", &entry)) {
 		entry->content = SNDRV_INFO_CONTENT_DATA;
 		entry->private_data = chip;
@@ -1480,6 +1470,8 @@
 		return err;
 	}
 
+	snd_card_set_dev(card, &pci->dev);
+
 	*rchip = chip;
 	return 0;
 }
--- diff/sound/pci/cs46xx/cs46xx_lib.c	2003-09-30 15:46:21.000000000 +0100
+++ source/sound/pci/cs46xx/cs46xx_lib.c	2004-02-09 10:39:58.000000000 +0000
@@ -1804,6 +1804,13 @@
 /*
  *  Mixer routines
  */
+static void snd_cs46xx_mixer_free_ac97_bus(ac97_bus_t *bus)
+{
+	cs46xx_t *chip = snd_magic_cast(cs46xx_t, bus->private_data, return);
+
+	chip->ac97_bus = NULL;
+}
+
 static void snd_cs46xx_mixer_free_ac97(ac97_t *ac97)
 {
 	cs46xx_t *chip = snd_magic_cast(cs46xx_t, ac97->private_data, return);
@@ -2445,6 +2452,7 @@
 int __devinit snd_cs46xx_mixer(cs46xx_t *chip)
 {
 	snd_card_t *card = chip->card;
+	ac97_bus_t bus;
 	ac97_t ac97;
 	snd_ctl_elem_id_t id;
 	int err;
@@ -2453,14 +2461,20 @@
 	/* detect primary codec */
 	chip->nr_ac97_codecs = 0;
 	snd_printdd("snd_cs46xx: detecting primary codec\n");
+	memset(&bus, 0, sizeof(bus));
+	bus.write = snd_cs46xx_ac97_write;
+	bus.read = snd_cs46xx_ac97_read;
+#ifdef CONFIG_SND_CS46XX_NEW_DSP
+	bus.reset = snd_cs46xx_codec_reset;
+#endif
+	bus.private_data = chip;
+	bus.private_free = snd_cs46xx_mixer_free_ac97_bus;
+	if ((err = snd_ac97_bus(card, &bus, &chip->ac97_bus)) < 0)
+		return err;
+
 	memset(&ac97, 0, sizeof(ac97));
-	ac97.write = snd_cs46xx_ac97_write;
-	ac97.read = snd_cs46xx_ac97_read;
 	ac97.private_data = chip;
 	ac97.private_free = snd_cs46xx_mixer_free_ac97;
-#ifdef CONFIG_SND_CS46XX_NEW_DSP
-	ac97.reset = snd_cs46xx_codec_reset;
-#endif
 	chip->ac97[CS46XX_PRIMARY_CODEC_INDEX] = &ac97;
 
 	snd_cs46xx_ac97_write(&ac97, AC97_MASTER, 0x8000);
@@ -2474,7 +2488,7 @@
 	return -ENXIO;
 
  _ok:
-	if ((err = snd_ac97_mixer(card, &ac97, &chip->ac97[CS46XX_PRIMARY_CODEC_INDEX])) < 0)
+	if ((err = snd_ac97_mixer(chip->ac97_bus, &ac97, &chip->ac97[CS46XX_PRIMARY_CODEC_INDEX])) < 0)
 		return err;
 	snd_printdd("snd_cs46xx: primary codec phase one\n");
 	chip->nr_ac97_codecs = 1;
@@ -2483,8 +2497,6 @@
 	snd_printdd("snd_cs46xx: detecting seconadry codec\n");
 	/* try detect a secondary codec */
 	memset(&ac97, 0, sizeof(ac97));    
-	ac97.write = snd_cs46xx_ac97_write;
-	ac97.read = snd_cs46xx_ac97_read;
 	ac97.private_data = chip;
 	ac97.private_free = snd_cs46xx_mixer_free_ac97;
 	ac97.num = CS46XX_SECONDARY_CODEC_INDEX;
@@ -2516,13 +2528,7 @@
 	/* well, one codec only ... */
 	goto _end;
  _ok2:
-	/* set secondary codec in extended mode */
-
-	/* use custom reset to set secondary codec in
-	   extended mode */
-	ac97.reset = snd_cs46xx_codec_reset;
-
-	if ((err = snd_ac97_mixer(card, &ac97, &chip->ac97[CS46XX_SECONDARY_CODEC_INDEX])) < 0)
+	if ((err = snd_ac97_mixer(chip->ac97_bus, &ac97, &chip->ac97[CS46XX_SECONDARY_CODEC_INDEX])) < 0)
 		return err;
 	chip->nr_ac97_codecs = 2;
 
@@ -2546,8 +2552,10 @@
     
 #ifdef CONFIG_SND_CS46XX_NEW_DSP
 	if (chip->nr_ac97_codecs == 1 && 
-	    snd_cs46xx_codec_read(chip, AC97_VENDOR_ID2,
-				  CS46XX_PRIMARY_CODEC_INDEX) == 0x592d) {
+	    (snd_cs46xx_codec_read(chip, AC97_VENDOR_ID2,
+				  CS46XX_PRIMARY_CODEC_INDEX) == 0x592b ||
+	     snd_cs46xx_codec_read(chip, AC97_VENDOR_ID2,
+				   CS46XX_PRIMARY_CODEC_INDEX) == 0x592d)) {
 		/* set primary cs4294 codec into Extended Audio Mode */
 		snd_printdd("setting EAM bit on cs4294 CODEC\n");
 		snd_cs46xx_codec_write(chip, AC97_CSR_ACMODE, 0x200,
@@ -2849,23 +2857,11 @@
 	if (file->f_pos + (size_t)size > region->size)
 		size = region->size - file->f_pos;
 	if (size > 0) {
-		char *tmp;
-		long res;
-		unsigned long virt;
-		if ((tmp = kmalloc(size, GFP_KERNEL)) == NULL)
-			return -ENOMEM;
-		virt = region->remap_addr + file->f_pos;
-		memcpy_fromio(tmp, virt, size);
-		if (copy_to_user(buf, tmp, size))
-			res = -EFAULT;
-		else {
-			res = size;
-			file->f_pos += size;
-		}
-		kfree(tmp);
-		return res;
+		if (copy_to_user_fromio(buf, region->remap_addr + file->f_pos, size))
+			return -EFAULT;
+		file->f_pos += size;
 	}
-	return 0;
+	return size;
 }
 
 static struct snd_info_entry_ops snd_cs46xx_proc_io_ops = {
@@ -4005,6 +4001,8 @@
 	
 	chip->active_ctrl(chip, -1); /* disable CLKRUN */
 
+	snd_card_set_dev(card, &pci->dev);
+
 	*rchip = chip;
 	return 0;
 }
--- diff/sound/pci/emu10k1/emu10k1_main.c	2003-08-20 14:16:35.000000000 +0100
+++ source/sound/pci/emu10k1/emu10k1_main.c	2004-02-09 10:39:58.000000000 +0000
@@ -239,14 +239,9 @@
  		}
 	}
 	
-	if (!emu->APS) {	/* enable analog output */
-		if (!emu->audigy) {
-			unsigned int reg = inl(emu->port + HCFG);
-			outl(reg | HCFG_GPOUT0, emu->port + HCFG);
-		} else {
-			unsigned int reg = inl(emu->port + A_IOCFG);
-			outl(reg | A_IOCFG_GPOUT0, emu->port + A_IOCFG);
-		}
+	if (emu->audigy) {	/* enable analog output */
+		unsigned int reg = inl(emu->port + A_IOCFG);
+		outl(reg | A_IOCFG_GPOUT0, emu->port + A_IOCFG);
 	}
 
 	/*
@@ -269,6 +264,9 @@
 			 * This has to be done after init ALice3 I2SOut beyond 48KHz.
 			 * So, sequence is important. */
 			outl(inl(emu->port + A_IOCFG) | 0x0040, emu->port + A_IOCFG);
+		} else {
+			/* Disable routing from AC97 line out to Front speakers */
+			outl(inl(emu->port + A_IOCFG) | 0x0080, emu->port + A_IOCFG);
 		}
 	}
 	
@@ -601,7 +599,8 @@
 		return -ENOMEM;
 	/* set the DMA transfer mask */
 	emu->dma_mask = is_audigy ? AUDIGY_DMA_MASK : EMU10K1_DMA_MASK;
-	if (pci_set_dma_mask(pci, emu->dma_mask) < 0) {
+	if (pci_set_dma_mask(pci, emu->dma_mask) < 0 ||
+	    pci_set_consistent_dma_mask(pci, emu->dma_mask) < 0) {
 		snd_printk(KERN_ERR "architecture does not support PCI busmaster DMA with mask 0x%lx\n", emu->dma_mask);
 		snd_magic_kfree(emu);
 		return -ENXIO;
@@ -715,6 +714,7 @@
 
 	snd_emu10k1_proc_init(emu);
 
+	snd_card_set_dev(card, &pci->dev);
 	*remu = emu;
 	return 0;
 }
--- diff/sound/pci/emu10k1/emu10k1_patch.c	2002-10-16 04:27:51.000000000 +0100
+++ source/sound/pci/emu10k1/emu10k1_patch.c	2004-02-09 10:39:58.000000000 +0000
@@ -36,7 +36,7 @@
  */
 int
 snd_emu10k1_sample_new(snd_emux_t *rec, snd_sf_sample_t *sp,
-		       snd_util_memhdr_t *hdr, const void *data, long count)
+		       snd_util_memhdr_t *hdr, const void __user *data, long count)
 {
 	int offset;
 	int truesize, size, loopsize, blocksize;
--- diff/sound/pci/emu10k1/emu10k1_synth.c	2002-10-16 04:27:22.000000000 +0100
+++ source/sound/pci/emu10k1/emu10k1_synth.c	2004-02-09 10:39:58.000000000 +0000
@@ -58,6 +58,7 @@
 	emu->midi_ports = arg->seq_ports < 2 ? arg->seq_ports : 2; /* maximum two ports */
 	emu->midi_devidx = hw->audigy ? 2 : 1; /* audigy has two external midis */
 	emu->linear_panning = 0;
+	emu->hwdep_idx = 2; /* FIXED */
 
 	if (snd_emux_register(emu, dev->card, arg->index, "Emu10k1") < 0) {
 		snd_emux_free(emu);
--- diff/sound/pci/emu10k1/emu10k1_synth_local.h	2002-10-16 04:27:50.000000000 +0100
+++ source/sound/pci/emu10k1/emu10k1_synth_local.h	2004-02-09 10:39:58.000000000 +0000
@@ -26,7 +26,7 @@
 #include <sound/emu10k1_synth.h>
 
 /* emu10k1_patch.c */
-int snd_emu10k1_sample_new(snd_emux_t *private_data, snd_sf_sample_t *sp, snd_util_memhdr_t *hdr, const void *_data, long count);
+int snd_emu10k1_sample_new(snd_emux_t *private_data, snd_sf_sample_t *sp, snd_util_memhdr_t *hdr, const void __user *_data, long count);
 int snd_emu10k1_sample_free(snd_emux_t *private_data, snd_sf_sample_t *sp, snd_util_memhdr_t *hdr);
 int snd_emu10k1_memhdr_init(snd_emux_t *emu);
 
--- diff/sound/pci/emu10k1/emufx.c	2003-09-30 15:46:21.000000000 +0100
+++ source/sound/pci/emu10k1/emufx.c	2004-02-09 10:39:58.000000000 +0000
@@ -913,8 +913,12 @@
 			return -EFAULT;
 		if (snd_emu10k1_look_for_ctl(emu, &gctl.id))
 			continue;
-		if (snd_ctl_find_id(emu->card, &gctl.id) != NULL)
+		down_read(&emu->card->controls_rwsem);
+		if (snd_ctl_find_id(emu->card, &gctl.id) != NULL) {
+			up_read(&emu->card->controls_rwsem);
 			return -EEXIST;
+		}
+		up_read(&emu->card->controls_rwsem);
 		if (gctl.id.iface != SNDRV_CTL_ELEM_IFACE_MIXER &&
 		    gctl.id.iface != SNDRV_CTL_ELEM_IFACE_PCM)
 			return -EINVAL;
@@ -1009,13 +1013,16 @@
 	unsigned int i;
 	snd_ctl_elem_id_t *_id, id;
 	snd_emu10k1_fx8010_ctl_t *ctl;
+	snd_card_t *card = emu->card;
 	
 	for (i = 0, _id = icode->gpr_del_controls;
 	     i < icode->gpr_del_control_count; i++, _id++) {
 	     	snd_runtime_check(copy_from_user(&id, _id, sizeof(id)) == 0, continue);
+		down_write(&card->controls_rwsem);
 		ctl = snd_emu10k1_look_for_ctl(emu, &id);
-		snd_runtime_check(ctl == NULL, continue);
-		snd_ctl_remove(emu->card, ctl->kcontrol);
+		if (ctl)
+			snd_ctl_remove(card, ctl->kcontrol);
+		up_write(&card->controls_rwsem);
 	}
 }
 
@@ -1234,14 +1241,12 @@
  * initial DSP configuration for Audigy
  */
 
-#define A_GPR_ACCU 0xd6
-#define A_GPR_COND 0xd7
-
 static int __devinit _snd_emu10k1_audigy_init_efx(emu10k1_t *emu)
 {
 	int err, i, z, gpr, nctl;
 	const int playback = 10;
 	const int capture = playback + (SND_EMU10K1_PLAYBACK_CHANNELS * 2); /* we reserve 10 voices */
+	const int stereo_mix = capture + 2;
 	const int tmp = 0x88;
 	u32 ptr;
 	emu10k1_fx8010_code_t *icode;
@@ -1265,45 +1270,52 @@
 	strcpy(icode->name, "Audigy DSP code for ALSA");
 	ptr = 0;
 	nctl = 0;
-	gpr = capture + 10;
+	gpr = stereo_mix + 10;
 
 	/* stop FX processor */
 	snd_emu10k1_ptr_write(emu, A_DBG, 0, (emu->fx8010.dbg = 0) | A_DBG_SINGLE_STEP);
 
-	/* Wave Playback Volume */
-	A_OP(icode, &ptr, iMAC0, A_GPR(playback), A_C_00000000, A_GPR(gpr), A_FXBUS(FXBUS_PCM_LEFT));
-	A_OP(icode, &ptr, iMAC0, A_GPR(playback+1), A_C_00000000, A_GPR(gpr+1), A_FXBUS(FXBUS_PCM_RIGHT));
-	snd_emu10k1_init_stereo_control(&controls[nctl++], "Wave Playback Volume", gpr, 100);
+	/* PCM front Playback Volume (independent from stereo mix) */
+	A_OP(icode, &ptr, iMAC0, A_GPR(playback), A_C_00000000, A_GPR(gpr), A_FXBUS(FXBUS_PCM_LEFT_FRONT));
+	A_OP(icode, &ptr, iMAC0, A_GPR(playback+1), A_C_00000000, A_GPR(gpr+1), A_FXBUS(FXBUS_PCM_RIGHT_FRONT));
+	snd_emu10k1_init_stereo_control(&controls[nctl++], "PCM Front Playback Volume", gpr, 100);
 	gpr += 2;
-
-	/* Wave Surround Playback */
-	A_OP(icode, &ptr, iMAC0, A_GPR(playback+2), A_C_00000000, A_GPR(gpr), A_FXBUS(FXBUS_PCM_LEFT));
-	A_OP(icode, &ptr, iMAC0, A_GPR(playback+3), A_C_00000000, A_GPR(gpr+1), A_FXBUS(FXBUS_PCM_RIGHT));
-	snd_emu10k1_init_stereo_control(&controls[nctl++], "Wave Surround Playback Volume", gpr, 0);
+	
+	/* PCM Surround Playback (independent from stereo mix) */
+	A_OP(icode, &ptr, iMAC0, A_GPR(playback+2), A_C_00000000, A_GPR(gpr), A_FXBUS(FXBUS_PCM_LEFT_REAR));
+	A_OP(icode, &ptr, iMAC0, A_GPR(playback+3), A_C_00000000, A_GPR(gpr+1), A_FXBUS(FXBUS_PCM_RIGHT_REAR));
+	snd_emu10k1_init_stereo_control(&controls[nctl++], "PCM Surround Playback Volume", gpr, 100);
 	gpr += 2;
 
-	/* Wave Center Playback */
-	/* Center = sub = Left/2 + Right/2 */
-	A_OP(icode, &ptr, iINTERP, A_GPR(tmp), A_FXBUS(FXBUS_PCM_LEFT), 0xcd, A_FXBUS(FXBUS_PCM_RIGHT));
-	A_OP(icode, &ptr, iMAC0, A_GPR(playback+4), A_C_00000000, A_GPR(gpr), A_GPR(tmp));
-	snd_emu10k1_init_mono_control(&controls[nctl++], "Wave Center Playback Volume", gpr, 0);
+	/* PCM Center Playback (independent from stereo mix) */
+	A_OP(icode, &ptr, iMAC0, A_GPR(playback+4), A_C_00000000, A_GPR(gpr), A_FXBUS(FXBUS_PCM_CENTER));
+	snd_emu10k1_init_mono_control(&controls[nctl++], "PCM Center Playback Volume", gpr, 100);
 	gpr++;
 
-	/* Wave LFE Playback */
-	A_OP(icode, &ptr, iMAC0, A_GPR(playback+5), A_C_00000000, A_GPR(gpr), A_GPR(tmp));
-	snd_emu10k1_init_mono_control(&controls[nctl++], "Wave LFE Playback Volume", gpr, 0);
+	/* PCM LFE Playback (independent from stereo mix) */
+	A_OP(icode, &ptr, iMAC0, A_GPR(playback+5), A_C_00000000, A_GPR(gpr), A_FXBUS(FXBUS_PCM_LFE));
+	snd_emu10k1_init_mono_control(&controls[nctl++], "PCM LFE Playback Volume", gpr, 100);
 	gpr++;
+	
+	/*
+	 * Stereo Mix
+	 */
+	/* Wave (PCM) Playback Volume (will be renamed later) */
+	A_OP(icode, &ptr, iMAC0, A_GPR(stereo_mix), A_C_00000000, A_GPR(gpr), A_FXBUS(FXBUS_PCM_LEFT));
+	A_OP(icode, &ptr, iMAC0, A_GPR(stereo_mix+1), A_C_00000000, A_GPR(gpr+1), A_FXBUS(FXBUS_PCM_RIGHT));
+	snd_emu10k1_init_stereo_control(&controls[nctl++], "Wave Playback Volume", gpr, 100);
+	gpr += 2;
 
 	/* Music Playback */
-	A_OP(icode, &ptr, iMAC0, A_GPR(playback+0), A_GPR(playback+0), A_GPR(gpr), A_FXBUS(FXBUS_MIDI_LEFT));
-	A_OP(icode, &ptr, iMAC0, A_GPR(playback+1), A_GPR(playback+1), A_GPR(gpr+1), A_FXBUS(FXBUS_MIDI_RIGHT));
+	A_OP(icode, &ptr, iMAC0, A_GPR(stereo_mix+0), A_GPR(stereo_mix+0), A_GPR(gpr), A_FXBUS(FXBUS_MIDI_LEFT));
+	A_OP(icode, &ptr, iMAC0, A_GPR(stereo_mix+1), A_GPR(stereo_mix+1), A_GPR(gpr+1), A_FXBUS(FXBUS_MIDI_RIGHT));
 	snd_emu10k1_init_stereo_control(&controls[nctl++], "Music Playback Volume", gpr, 100);
 	gpr += 2;
 
-	/* Wave Capture */
+	/* Wave (PCM) Capture */
 	A_OP(icode, &ptr, iMAC0, A_GPR(capture+0), A_C_00000000, A_GPR(gpr), A_FXBUS(FXBUS_PCM_LEFT));
 	A_OP(icode, &ptr, iMAC0, A_GPR(capture+1), A_C_00000000, A_GPR(gpr+1), A_FXBUS(FXBUS_PCM_RIGHT));
-	snd_emu10k1_init_stereo_control(&controls[nctl++], "Wave Capture Volume", gpr, 0);
+	snd_emu10k1_init_stereo_control(&controls[nctl++], "PCM Capture Volume", gpr, 0);
 	gpr += 2;
 
 	/* Music Capture */
@@ -1312,42 +1324,29 @@
 	snd_emu10k1_init_stereo_control(&controls[nctl++], "Music Capture Volume", gpr, 0);
 	gpr += 2;
 
-	/* Surround Playback */
-	A_OP(icode, &ptr, iMAC0, A_GPR(playback+2), A_GPR(playback+2), A_GPR(gpr), A_FXBUS(FXBUS_PCM_LEFT_REAR));
-	A_OP(icode, &ptr, iMAC0, A_GPR(playback+3), A_GPR(playback+3), A_GPR(gpr+1), A_FXBUS(FXBUS_PCM_RIGHT_REAR));
-	snd_emu10k1_init_stereo_control(&controls[nctl++], "Surround Playback Volume", gpr, 80);
-	gpr += 2;
-
-	/* Center Playback */
-	A_OP(icode, &ptr, iMAC0, A_GPR(playback+4), A_GPR(playback+4), A_GPR(gpr), A_FXBUS(FXBUS_PCM_CENTER));
-	snd_emu10k1_init_mono_control(&controls[nctl++], "Center Playback Volume", gpr, 80);
-	gpr++;
-
-	/* LFE Playback */
-	A_OP(icode, &ptr, iMAC0, A_GPR(playback+5), A_GPR(playback+5), A_GPR(gpr), A_FXBUS(FXBUS_PCM_LFE));
-	snd_emu10k1_init_mono_control(&controls[nctl++], "LFE Playback Volume", gpr, 80);
-	gpr++;
-
 	/*
 	 * inputs
 	 */
 #define A_ADD_VOLUME_IN(var,vol,input) \
 A_OP(icode, &ptr, iMAC0, A_GPR(var), A_GPR(var), A_GPR(vol), A_EXTIN(input))
 
-	/* AC'97 Playback Volume */
-	A_ADD_VOLUME_IN(playback, gpr, A_EXTIN_AC97_L);
-	A_ADD_VOLUME_IN(playback+1, gpr+1, A_EXTIN_AC97_R);
-	snd_emu10k1_init_stereo_control(&controls[nctl++], "AC97 Playback Volume", gpr, 0);
+	/* AC'97 Playback Volume - used only for mic */
+	A_ADD_VOLUME_IN(stereo_mix, gpr, A_EXTIN_AC97_L);
+	A_ADD_VOLUME_IN(stereo_mix+1, gpr+1, A_EXTIN_AC97_R);
+	snd_emu10k1_init_stereo_control(&controls[nctl++], "AMic Playback Volume", gpr, 0);
 	gpr += 2;
-	/* AC'97 Capture Volume */
+	/* AC'97 Capture Volume - used only for mic */
 	A_ADD_VOLUME_IN(capture, gpr, A_EXTIN_AC97_L);
 	A_ADD_VOLUME_IN(capture+1, gpr+1, A_EXTIN_AC97_R);
-	snd_emu10k1_init_stereo_control(&controls[nctl++], "AC97 Capture Volume", gpr, 100);
+	snd_emu10k1_init_stereo_control(&controls[nctl++], "Mic Capture Volume", gpr, 0);
 	gpr += 2;
 
+	/* mic capture buffer */	
+	A_OP(icode, &ptr, iINTERP, A_EXTOUT(A_EXTOUT_MIC_CAP), A_EXTIN(A_EXTIN_AC97_L), 0xcd, A_EXTIN(A_EXTIN_AC97_R));
+
 	/* Audigy CD Playback Volume */
-	A_ADD_VOLUME_IN(playback, gpr, A_EXTIN_SPDIF_CD_L);
-	A_ADD_VOLUME_IN(playback+1, gpr+1, A_EXTIN_SPDIF_CD_R);
+	A_ADD_VOLUME_IN(stereo_mix, gpr, A_EXTIN_SPDIF_CD_L);
+	A_ADD_VOLUME_IN(stereo_mix+1, gpr+1, A_EXTIN_SPDIF_CD_R);
 	snd_emu10k1_init_stereo_control(&controls[nctl++], "Audigy CD Playback Volume", gpr, 0);
 	gpr += 2;
 	/* Audigy CD Capture Volume */
@@ -1357,19 +1356,19 @@
 	gpr += 2;
 
  	/* Optical SPDIF Playback Volume */
-	A_ADD_VOLUME_IN(playback, gpr, A_EXTIN_OPT_SPDIF_L);
-	A_ADD_VOLUME_IN(playback+1, gpr+1, A_EXTIN_OPT_SPDIF_R);
-	snd_emu10k1_init_stereo_control(&controls[nctl++], "Optical IEC958 Playback Volume", gpr, 0);
+	A_ADD_VOLUME_IN(stereo_mix, gpr, A_EXTIN_OPT_SPDIF_L);
+	A_ADD_VOLUME_IN(stereo_mix+1, gpr+1, A_EXTIN_OPT_SPDIF_R);
+	snd_emu10k1_init_stereo_control(&controls[nctl++], "IEC958 Optical Playback Volume", gpr, 0);
 	gpr += 2;
 	/* Optical SPDIF Capture Volume */
 	A_ADD_VOLUME_IN(capture, gpr, A_EXTIN_OPT_SPDIF_L);
 	A_ADD_VOLUME_IN(capture+1, gpr+1, A_EXTIN_OPT_SPDIF_R);
-	snd_emu10k1_init_stereo_control(&controls[nctl++], "Optical IEC958 Capture Volume", gpr, 0);
+	snd_emu10k1_init_stereo_control(&controls[nctl++], "IEC958 Optical Capture Volume", gpr, 0);
 	gpr += 2;
 
 	/* Line2 Playback Volume */
-	A_ADD_VOLUME_IN(playback, gpr, A_EXTIN_LINE2_L);
-	A_ADD_VOLUME_IN(playback+1, gpr+1, A_EXTIN_LINE2_R);
+	A_ADD_VOLUME_IN(stereo_mix, gpr, A_EXTIN_LINE2_L);
+	A_ADD_VOLUME_IN(stereo_mix+1, gpr+1, A_EXTIN_LINE2_R);
 	snd_emu10k1_init_stereo_control(&controls[nctl++], "Line2 Playback Volume", gpr, 0);
 	gpr += 2;
 	/* Line2 Capture Volume */
@@ -1378,20 +1377,20 @@
 	snd_emu10k1_init_stereo_control(&controls[nctl++], "Line2 Capture Volume", gpr, 0);
 	gpr += 2;
         
-	/* RCA SPDIF Playback Volume */
-	A_ADD_VOLUME_IN(playback, gpr, A_EXTIN_RCA_SPDIF_L);
-	A_ADD_VOLUME_IN(playback+1, gpr+1, A_EXTIN_RCA_SPDIF_R);
-	snd_emu10k1_init_stereo_control(&controls[nctl++], "RCA SPDIF Playback Volume", gpr, 0);
-	gpr += 2;
-	/* RCA SPDIF Capture Volume */
-	A_ADD_VOLUME_IN(capture, gpr, A_EXTIN_RCA_SPDIF_L);
-	A_ADD_VOLUME_IN(capture+1, gpr+1, A_EXTIN_RCA_SPDIF_R);
-	snd_emu10k1_init_stereo_control(&controls[nctl++], "RCA SPDIF Capture Volume", gpr, 0);
+	/* Philips ADC Playback Volume */
+	A_ADD_VOLUME_IN(stereo_mix, gpr, A_EXTIN_ADC_L);
+	A_ADD_VOLUME_IN(stereo_mix+1, gpr+1, A_EXTIN_ADC_R);
+	snd_emu10k1_init_stereo_control(&controls[nctl++], "Analog Mix Playback Volume", gpr, 0);
+	gpr += 2;
+	/* Philips ADC Capture Volume */
+	A_ADD_VOLUME_IN(capture, gpr, A_EXTIN_ADC_L);
+	A_ADD_VOLUME_IN(capture+1, gpr+1, A_EXTIN_ADC_R);
+	snd_emu10k1_init_stereo_control(&controls[nctl++], "Analog Mix Capture Volume", gpr, 0);
 	gpr += 2;
 
 	/* Aux2 Playback Volume */
-	A_ADD_VOLUME_IN(playback, gpr, A_EXTIN_AUX2_L);
-	A_ADD_VOLUME_IN(playback+1, gpr+1, A_EXTIN_AUX2_R);
+	A_ADD_VOLUME_IN(stereo_mix, gpr, A_EXTIN_AUX2_L);
+	A_ADD_VOLUME_IN(stereo_mix+1, gpr+1, A_EXTIN_AUX2_R);
 	snd_emu10k1_init_stereo_control(&controls[nctl++], "Aux2 Playback Volume", gpr, 0);
 	gpr += 2;
 	/* Aux2 Capture Volume */
@@ -1399,6 +1398,30 @@
 	A_ADD_VOLUME_IN(capture+1, gpr+1, A_EXTIN_AUX2_R);
 	snd_emu10k1_init_stereo_control(&controls[nctl++], "Aux2 Capture Volume", gpr, 0);
 	gpr += 2;
+	
+	/* Stereo Mix Front Playback Volume */
+	A_OP(icode, &ptr, iMAC0, A_GPR(playback), A_GPR(playback), A_GPR(gpr), A_GPR(stereo_mix));
+	A_OP(icode, &ptr, iMAC0, A_GPR(playback+1), A_GPR(playback+1), A_GPR(gpr+1), A_GPR(stereo_mix+1));
+	snd_emu10k1_init_stereo_control(&controls[nctl++], "Front Playback Volume", gpr, 100);
+	gpr += 2;
+	
+	/* Stereo Mix Surround Playback */
+	A_OP(icode, &ptr, iMAC0, A_GPR(playback+2), A_GPR(playback+2), A_GPR(gpr), A_GPR(stereo_mix));
+	A_OP(icode, &ptr, iMAC0, A_GPR(playback+3), A_GPR(playback+3), A_GPR(gpr+1), A_GPR(stereo_mix+1));
+	snd_emu10k1_init_stereo_control(&controls[nctl++], "Surround Playback Volume", gpr, 0);
+	gpr += 2;
+
+	/* Stereo Mix Center Playback */
+	/* Center = sub = Left/2 + Right/2 */
+	A_OP(icode, &ptr, iINTERP, A_GPR(tmp), A_GPR(stereo_mix), 0xcd, A_GPR(stereo_mix+1));
+	A_OP(icode, &ptr, iMAC0, A_GPR(playback+4), A_GPR(playback+4), A_GPR(gpr), A_GPR(tmp));
+	snd_emu10k1_init_mono_control(&controls[nctl++], "Center Playback Volume", gpr, 0);
+	gpr++;
+
+	/* Stereo Mix LFE Playback */
+	A_OP(icode, &ptr, iMAC0, A_GPR(playback+5), A_GPR(playback+5), A_GPR(gpr), A_GPR(tmp));
+	snd_emu10k1_init_mono_control(&controls[nctl++], "LFE Playback Volume", gpr, 0);
+	gpr++;
 
 	/*
 	 * outputs
@@ -1497,20 +1520,18 @@
 	snd_emu10k1_init_stereo_onoff_control(controls + nctl++, "Tone Control - Switch", gpr, 0);
 	gpr += 2;
 
-	/* Master volume for audigy2 */
-	if (emu->revision == 4) {
-		A_OP(icode, &ptr, iMAC0, A_GPR(playback+0+SND_EMU10K1_PLAYBACK_CHANNELS), A_C_00000000, A_GPR(gpr), A_GPR(playback+0+SND_EMU10K1_PLAYBACK_CHANNELS));
-		A_OP(icode, &ptr, iMAC0, A_GPR(playback+1+SND_EMU10K1_PLAYBACK_CHANNELS), A_C_00000000, A_GPR(gpr+1), A_GPR(playback+1+SND_EMU10K1_PLAYBACK_CHANNELS));
-		snd_emu10k1_init_stereo_control(&controls[nctl++], "Wave Master Playback Volume", gpr, 0);
-		gpr += 2;
-	}	
+	/* Master volume (will be renamed later) */
+	A_OP(icode, &ptr, iMAC0, A_GPR(playback+0+SND_EMU10K1_PLAYBACK_CHANNELS), A_C_00000000, A_GPR(gpr), A_GPR(playback+0+SND_EMU10K1_PLAYBACK_CHANNELS));
+	A_OP(icode, &ptr, iMAC0, A_GPR(playback+1+SND_EMU10K1_PLAYBACK_CHANNELS), A_C_00000000, A_GPR(gpr+1), A_GPR(playback+1+SND_EMU10K1_PLAYBACK_CHANNELS));
+	A_OP(icode, &ptr, iMAC0, A_GPR(playback+2+SND_EMU10K1_PLAYBACK_CHANNELS), A_C_00000000, A_GPR(gpr+1), A_GPR(playback+2+SND_EMU10K1_PLAYBACK_CHANNELS));
+	A_OP(icode, &ptr, iMAC0, A_GPR(playback+3+SND_EMU10K1_PLAYBACK_CHANNELS), A_C_00000000, A_GPR(gpr+1), A_GPR(playback+3+SND_EMU10K1_PLAYBACK_CHANNELS));
+	A_OP(icode, &ptr, iMAC0, A_GPR(playback+4+SND_EMU10K1_PLAYBACK_CHANNELS), A_C_00000000, A_GPR(gpr+1), A_GPR(playback+4+SND_EMU10K1_PLAYBACK_CHANNELS));
+	A_OP(icode, &ptr, iMAC0, A_GPR(playback+5+SND_EMU10K1_PLAYBACK_CHANNELS), A_C_00000000, A_GPR(gpr+1), A_GPR(playback+5+SND_EMU10K1_PLAYBACK_CHANNELS));
+	snd_emu10k1_init_stereo_control(&controls[nctl++], "Wave Master Playback Volume", gpr, 0);
+	gpr += 2;
 
 	/* analog speakers */
-	if (emu->revision == 4) { /* audigy2 */
-		A_PUT_STEREO_OUTPUT(A_EXTOUT_AFRONT_L, A_EXTOUT_AFRONT_R, playback + SND_EMU10K1_PLAYBACK_CHANNELS);
-	} else {
-		A_PUT_STEREO_OUTPUT(A_EXTOUT_AC97_L, A_EXTOUT_AC97_R, playback + SND_EMU10K1_PLAYBACK_CHANNELS);
-	}
+	A_PUT_STEREO_OUTPUT(A_EXTOUT_AFRONT_L, A_EXTOUT_AFRONT_R, playback + SND_EMU10K1_PLAYBACK_CHANNELS);
 	A_PUT_STEREO_OUTPUT(A_EXTOUT_AREAR_L, A_EXTOUT_AREAR_R, playback+2 + SND_EMU10K1_PLAYBACK_CHANNELS);
 	A_PUT_OUTPUT(A_EXTOUT_ACENTER, playback+4 + SND_EMU10K1_PLAYBACK_CHANNELS);
 	A_PUT_OUTPUT(A_EXTOUT_ALFE, playback+5 + SND_EMU10K1_PLAYBACK_CHANNELS);
@@ -1519,7 +1540,7 @@
 	A_PUT_STEREO_OUTPUT(A_EXTOUT_HEADPHONE_L, A_EXTOUT_HEADPHONE_R, playback + SND_EMU10K1_PLAYBACK_CHANNELS);
 
 	/* digital outputs */
-//	A_PUT_STEREO_OUTPUT(A_EXTOUT_FRONT_L, A_EXTOUT_FRONT_R, playback + SND_EMU10K1_PLAYBACK_CHANNELS);
+	/* A_PUT_STEREO_OUTPUT(A_EXTOUT_FRONT_L, A_EXTOUT_FRONT_R, playback + SND_EMU10K1_PLAYBACK_CHANNELS); */
 
 	/* IEC958 Optical Raw Playback Switch */ 
 	icode->gpr_map[gpr++] = 0x1008;
@@ -1804,28 +1825,28 @@
 	snd_emu10k1_init_stereo_onoff_control(controls + i++, "Music Capture Switch", gpr + 2, 0);
 	gpr += 4;
 
-	/* Surround Digital Playback Volume */
+	/* Surround Digital Playback Volume (renamed later without Digital) */
 	for (z = 0; z < 2; z++)
 		VOLUME_ADD(icode, &ptr, playback + 2 + z, 4 + z, gpr + z);
 	snd_emu10k1_init_stereo_control(controls + i++, "Surround Digital Playback Volume", gpr, 100);
 	gpr += 2;
 
-	/* Surround Digital Capture Volume + Switch */
+	/* Surround Capture Volume + Switch */
 	for (z = 0; z < 2; z++) {
 		SWITCH(icode, &ptr, tmp + 0, 4 + z, gpr + 2 + z);
 		VOLUME_ADD(icode, &ptr, capture + z, tmp + 0, gpr + z);
 	}
-	snd_emu10k1_init_stereo_control(controls + i++, "Surround Digital Capture Volume", gpr, 0);
-	snd_emu10k1_init_stereo_onoff_control(controls + i++, "Surround Digital Capture Switch", gpr + 2, 0);
+	snd_emu10k1_init_stereo_control(controls + i++, "Surround Capture Volume", gpr, 0);
+	snd_emu10k1_init_stereo_onoff_control(controls + i++, "Surround Capture Switch", gpr + 2, 0);
 	gpr += 4;
 
-	/* Center Playback Volume */
+	/* Center Playback Volume (renamed later without Digital) */
 	VOLUME_ADD(icode, &ptr, playback + 4, 6, gpr);
-	snd_emu10k1_init_mono_control(controls + i++, "Center Playback Volume", gpr++, 100);
+	snd_emu10k1_init_mono_control(controls + i++, "Center Digital Playback Volume", gpr++, 100);
 
-	/* LFE Playback Volume + Switch */
+	/* LFE Playback Volume + Switch (renamed later without Digital) */
 	VOLUME_ADD(icode, &ptr, playback + 5, 7, gpr);
-	snd_emu10k1_init_mono_control(controls + i++, "LFE Playback Volume", gpr++, 100);
+	snd_emu10k1_init_mono_control(controls + i++, "LFE Digital Playback Volume", gpr++, 100);
 
 	/*
 	 *  Process inputs
@@ -1880,7 +1901,7 @@
 		/* IEC958 Optical Playback Volume */
 		for (z = 0; z < 2; z++)
 			VOLUME_ADDIN(icode, &ptr, playback + z, EXTIN_TOSLINK_L + z, gpr + z);
-		snd_emu10k1_init_stereo_control(controls + i++, "IEC958 Optical Playback Volume", gpr, 0);
+		snd_emu10k1_init_stereo_control(controls + i++, "IEC958 LiveDrive Playback Volume", gpr, 0);
 		gpr += 2;
 	
 		/* IEC958 Optical Capture Volume */
@@ -1888,8 +1909,8 @@
 			SWITCH_IN(icode, &ptr, tmp + 0, EXTIN_TOSLINK_L + z, gpr + 2 + z);
 			VOLUME_ADD(icode, &ptr, capture + z, tmp + 0, gpr + z);
 		}
-		snd_emu10k1_init_stereo_control(controls + i++, "IEC958 Optical Capture Volume", gpr, 0);
-		snd_emu10k1_init_stereo_onoff_control(controls + i++, "IEC958 Optical Capture Switch", gpr + 2, 0);
+		snd_emu10k1_init_stereo_control(controls + i++, "IEC958 LiveDrive Capture Volume", gpr, 0);
+		snd_emu10k1_init_stereo_onoff_control(controls + i++, "IEC958 LiveDrive Capture Switch", gpr + 2, 0);
 		gpr += 4;
 	}
 	
@@ -1931,7 +1952,7 @@
 		/* Line LiveDrive Playback Volume */
 		for (z = 0; z < 2; z++)
 			VOLUME_ADDIN(icode, &ptr, playback + z, EXTIN_LINE2_L + z, gpr + z);
-		snd_emu10k1_init_stereo_control(controls + i++, "Line LiveDrive Playback Volume", gpr, 0);
+		snd_emu10k1_init_stereo_control(controls + i++, "Line2 LiveDrive Playback Volume", gpr, 0);
 		controls[i-1].id.index = 1;
 		gpr += 2;
 	
@@ -1940,8 +1961,9 @@
 			SWITCH_IN(icode, &ptr, tmp + 0, EXTIN_LINE2_L + z, gpr + 2 + z);
 			VOLUME_ADD(icode, &ptr, capture + z, tmp + 0, gpr + z);
 		}
-		snd_emu10k1_init_stereo_control(controls + i++, "Line LiveDrive Capture Volume", gpr, 0);
-		snd_emu10k1_init_stereo_onoff_control(controls + i++, "Line LiveDrive Capture Switch", gpr + 2, 0);
+		snd_emu10k1_init_stereo_control(controls + i++, "Line2 LiveDrive Capture Volume", gpr, 0);
+		controls[i-1].id.index = 1;
+		snd_emu10k1_init_stereo_onoff_control(controls + i++, "Line2 LiveDrive Capture Switch", gpr + 2, 0);
 		controls[i-1].id.index = 1;
 		gpr += 4;
 	}
--- diff/sound/pci/emu10k1/emumixer.c	2003-08-20 14:16:35.000000000 +0100
+++ source/sound/pci/emu10k1/emumixer.c	2004-02-09 10:39:58.000000000 +0000
@@ -455,31 +455,89 @@
 
 int __devinit snd_emu10k1_mixer(emu10k1_t *emu)
 {
-	ac97_t ac97;
 	int err, pcm;
 	snd_kcontrol_t *kctl;
 	snd_card_t *card = emu->card;
+	char **c;
+	static char *emu10k1_remove_ctls[] = {
+		/* no AC97 mono, surround, center/lfe */
+		"Master Mono Playback Switch",
+		"Master Mono Playback Volume",
+		"PCM Out Path & Mute",
+		"Mono Output Select",
+		"Surround Playback Switch",
+		"Surround Playback Volume",
+		"Center Playback Switch",
+		"Center Playback Volume",
+		"LFE Playback Switch",
+		"LFE Playback Volume",
+		NULL
+	};
+	static char *emu10k1_rename_ctls[] = {
+		"Surround Digital Playback Volume", "Surround Playback Volume",
+		"Center Digital Playback Volume", "Center Playback Volume",
+		"LFE Digital Playback Volume", "LFE Playback Volume",
+		NULL
+	};
+	static char *audigy_remove_ctls[] = {
+		/* Master/PCM controls on ac97 of Audigy has no effect */
+		"PCM Playback Switch",
+		"PCM Playback Volume",
+		"Master Mono Playback Switch",
+		"Master Mono Playback Volume",
+		"Master Playback Switch",
+		"Master Playback Volume",
+		"PCM Out Path & Mute",
+		"Mono Output Select",
+		/* remove unused AC97 capture controls */
+		"Capture Source",
+		"Capture Switch",
+		"Capture Volume",
+		"Mic Select",
+		"Video Playback Switch",
+		"Video Playback Volume",
+		"Mic Playback Switch",
+		"Mic Playback Volume",
+		NULL
+	};
+	static char *audigy_rename_ctls[] = {
+		/* use conventional names */
+		"Wave Playback Volume", "PCM Playback Volume",
+		/* "Wave Capture Volume", "PCM Capture Volume", */
+		"Wave Master Playback Volume", "Master Playback Volume",
+		"AMic Playback Volume", "Mic Playback Volume",
+		NULL
+	};
 
 	if (!emu->no_ac97) {
+		ac97_bus_t bus, *pbus;
+		ac97_t ac97;
+
+		memset(&bus, 0, sizeof(bus));
+		bus.write = snd_emu10k1_ac97_write;
+		bus.read = snd_emu10k1_ac97_read;
+		if ((err = snd_ac97_bus(emu->card, &bus, &pbus)) < 0)
+			return err;
+		
 		memset(&ac97, 0, sizeof(ac97));
-		ac97.write = snd_emu10k1_ac97_write;
-		ac97.read = snd_emu10k1_ac97_read;
 		ac97.private_data = emu;
 		ac97.private_free = snd_emu10k1_mixer_free_ac97;
-		if ((err = snd_ac97_mixer(emu->card, &ac97, &emu->ac97)) < 0)
+		if ((err = snd_ac97_mixer(pbus, &ac97, &emu->ac97)) < 0)
 			return err;
-		if (emu->audigy && emu->revision == 4) {
-			/* Master/PCM controls on ac97 of Audigy2 has no effect */
-			/* FIXME: keep master volume/switch to be sure.
-			 * once after we check that they play really no roles,
-			 * they shall be removed.
-			 */
-			rename_ctl(card, "Master Playback Switch", "AC97 Master Playback Switch");
-			rename_ctl(card, "Master Playback Volume", "AC97 Master Playback Volume");
-			/* pcm controls are removed */
-			remove_ctl(card, "PCM Playback Switch");
-			remove_ctl(card, "PCM Playback Volume");
+		if (emu->audigy) {
+			/* set master volume to 0 dB */
+			snd_ac97_write(emu->ac97, AC97_MASTER, 0x0202);
+			/* set capture source to mic */
+			snd_ac97_write(emu->ac97, AC97_REC_SEL, 0x0000);
+			c = audigy_remove_ctls;
+		} else {
+			/* remove unused AC97 controls */
+			snd_ac97_write(emu->ac97, AC97_SURROUND_MASTER, 0x0202);
+			snd_ac97_write(emu->ac97, AC97_CENTER_LFE_MASTER, 0x0202);
+			c = emu10k1_remove_ctls;
 		}
+		for (; *c; c++)
+			remove_ctl(card, *c);
 	} else {
 		if (emu->APS)
 			strcpy(emu->card->mixername, "EMU APS");
@@ -489,13 +547,12 @@
 			strcpy(emu->card->mixername, "Emu10k1");
 	}
 
-	if (emu->audigy && emu->revision == 4) {
-		/* Audigy2 and Audigy2 EX */
-		/* use the conventional names */
-		rename_ctl(card, "Wave Playback Volume", "PCM Playback Volume");
-		rename_ctl(card, "Wave Playback Volume", "PCM Capture Volume");
-		rename_ctl(card, "Wave Master Playback Volume", "Master Playback Volume");
-	}
+	if (emu->audigy)
+		c = audigy_rename_ctls;
+	else
+		c = emu10k1_rename_ctls;
+	for (; *c; c += 2)
+		rename_ctl(card, c[0], c[1]);
 
 	if ((kctl = emu->ctl_send_routing = snd_ctl_new1(&snd_emu10k1_send_routing_control, emu)) == NULL)
 		return -ENOMEM;
@@ -536,6 +593,11 @@
 			return -ENOMEM;
 		if ((err = snd_ctl_add(card, kctl)))
 			return err;
+		if ((kctl = ctl_find(card, SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT))) != NULL) {
+			/* already defined by ac97, remove it */
+			/* FIXME: or do we need both controls? */
+			remove_ctl(card, SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT));
+		}
 		if ((kctl = snd_ctl_new1(&snd_emu10k1_spdif_control, emu)) == NULL)
 			return -ENOMEM;
 		if ((err = snd_ctl_add(card, kctl)))
--- diff/sound/pci/emu10k1/emupcm.c	2003-09-30 15:46:21.000000000 +0100
+++ source/sound/pci/emu10k1/emupcm.c	2004-02-09 10:39:58.000000000 +0000
@@ -871,7 +871,7 @@
 	epcm->capture_inte = INTE_MICBUFENABLE;
 	epcm->capture_ba_reg = MICBA;
 	epcm->capture_bs_reg = MICBS;
-	epcm->capture_idx_reg = MICIDX;
+	epcm->capture_idx_reg = emu->audigy ? A_MICIDX : MICIDX;
 	substream->runtime->private_data = epcm;
 	substream->runtime->private_free = snd_emu10k1_pcm_free_substream;
 	runtime->hw = snd_emu10k1_capture;
--- diff/sound/pci/emu10k1/emuproc.c	2003-05-21 11:49:56.000000000 +0100
+++ source/sound/pci/emu10k1/emuproc.c	2004-02-09 10:39:58.000000000 +0000
@@ -240,7 +240,7 @@
 	snd_info_entry_t *entry;
 	
 	if (! snd_card_proc_new(emu->card, "emu10k1", &entry))
-		snd_info_set_text_ops(entry, emu, snd_emu10k1_proc_read);
+		snd_info_set_text_ops(entry, emu, 1024, snd_emu10k1_proc_read);
 
 	if (! snd_card_proc_new(emu->card, "fx8010_gpr", &entry)) {
 		entry->content = SNDRV_INFO_CONTENT_DATA;
--- diff/sound/pci/emu10k1/memory.c	2003-05-21 11:49:56.000000000 +0100
+++ source/sound/pci/emu10k1/memory.c	2004-02-09 10:39:58.000000000 +0000
@@ -529,7 +529,7 @@
 /*
  * copy_from_user(blk + offset, data, size)
  */
-int snd_emu10k1_synth_copy_from_user(emu10k1_t *emu, snd_util_memblk_t *blk, int offset, const char *data, int size)
+int snd_emu10k1_synth_copy_from_user(emu10k1_t *emu, snd_util_memblk_t *blk, int offset, const char __user *data, int size)
 {
 	int page, nextofs, end_offset, temp, temp1;
 	void *ptr;
--- diff/sound/pci/ens1370.c	2003-09-30 15:46:21.000000000 +0100
+++ source/sound/pci/ens1370.c	2004-02-09 10:39:58.000000000 +0000
@@ -72,9 +72,20 @@
 		"{Ectiva,EV1938}}");
 #endif
 
+#if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE))
+#define SUPPORT_JOYSTICK
+#endif
+
 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;	/* Index 0-MAX */
 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;	/* ID for this card */
 static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;	/* Enable switches */
+#ifdef SUPPORT_JOYSTICK
+#ifdef CHIP1371
+static int joystick_port[SNDRV_CARDS];
+#else
+static int joystick[SNDRV_CARDS];
+#endif
+#endif
 
 MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
 MODULE_PARM_DESC(index, "Index value for Ensoniq AudioPCI soundcard.");
@@ -85,6 +96,17 @@
 MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
 MODULE_PARM_DESC(enable, "Enable Ensoniq AudioPCI soundcard.");
 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
+#ifdef SUPPORT_JOYSTICK
+#ifdef CHIP1371
+MODULE_PARM(joystick_port, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+MODULE_PARM_DESC(joystick_port, "Joystick port address.");
+MODULE_PARM_SYNTAX(joystick_port, SNDRV_ENABLED ",allows:{{0},{1},{0x200},{0x208},{0x210},{0x218}},dialog:list");
+#else
+MODULE_PARM(joystick, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+MODULE_PARM_DESC(joystick, "Enable joystick.");
+MODULE_PARM_SYNTAX(joystick, SNDRV_ENABLED "," SNDRV_BOOLEAN_FALSE_DESC);
+#endif
+#endif /* SUPPORT_JOYSTICK */
 
 #ifndef PCI_DEVICE_ID_ENSONIQ_CT5880
 #define PCI_DEVICE_ID_ENSONIQ_CT5880    0x5880
@@ -416,9 +438,8 @@
 	dma_addr_t bugbuf_addr;
 #endif
 
-#if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE))
+#ifdef SUPPORT_JOYSTICK
 	struct gameport gameport;
-	struct semaphore joy_sem;	// gameport configuration semaphore
 #endif
 };
 
@@ -1371,33 +1392,6 @@
 	return change;
 }
 
-static snd_kcontrol_new_t snd_ens1373_spdif_default __devinitdata =
-{
-	.iface =	SNDRV_CTL_ELEM_IFACE_PCM,
-	.name =		SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT),
-	.info =		snd_ens1373_spdif_info,
-	.get =		snd_ens1373_spdif_default_get,
-	.put =		snd_ens1373_spdif_default_put,
-};
-
-static snd_kcontrol_new_t snd_ens1373_spdif_mask __devinitdata =
-{
-	.access =	SNDRV_CTL_ELEM_ACCESS_READ,
-	.iface =	SNDRV_CTL_ELEM_IFACE_PCM,
-	.name =		SNDRV_CTL_NAME_IEC958("",PLAYBACK,MASK),
-	.info =		snd_ens1373_spdif_info,
-	.get =		snd_ens1373_spdif_mask_get
-};
-
-static snd_kcontrol_new_t snd_ens1373_spdif_stream __devinitdata =
-{
-	.iface =	SNDRV_CTL_ELEM_IFACE_PCM,
-	.name =		SNDRV_CTL_NAME_IEC958("",PLAYBACK,PCM_STREAM),
-	.info =		snd_ens1373_spdif_info,
-	.get =		snd_ens1373_spdif_stream_get,
-	.put =		snd_ens1373_spdif_stream_put
-};
-
 #define ES1371_SPDIF(xname) \
 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .info = snd_es1371_spdif_info, \
   .get = snd_es1371_spdif_get, .put = snd_es1371_spdif_put }
@@ -1441,8 +1435,33 @@
 	return change;
 }
 
-static snd_kcontrol_new_t snd_es1371_mixer_spdif __devinitdata =
-ES1371_SPDIF("IEC958 Playback Switch");
+
+/* spdif controls */
+static snd_kcontrol_new_t snd_es1371_mixer_spdif[] __devinitdata = {
+	ES1371_SPDIF("IEC958 Playback Switch"),
+	{
+		.iface =	SNDRV_CTL_ELEM_IFACE_PCM,
+		.name =		SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT),
+		.info =		snd_ens1373_spdif_info,
+		.get =		snd_ens1373_spdif_default_get,
+		.put =		snd_ens1373_spdif_default_put,
+	},
+	{
+		.access =	SNDRV_CTL_ELEM_ACCESS_READ,
+		.iface =	SNDRV_CTL_ELEM_IFACE_PCM,
+		.name =		SNDRV_CTL_NAME_IEC958("",PLAYBACK,MASK),
+		.info =		snd_ens1373_spdif_info,
+		.get =		snd_ens1373_spdif_mask_get
+	},
+	{
+		.iface =	SNDRV_CTL_ELEM_IFACE_PCM,
+		.name =		SNDRV_CTL_NAME_IEC958("",PLAYBACK,PCM_STREAM),
+		.info =		snd_ens1373_spdif_info,
+		.get =		snd_ens1373_spdif_stream_get,
+		.put =		snd_ens1373_spdif_stream_put
+	},
+};
+
 
 static int snd_es1373_rear_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo)
 {
@@ -1491,6 +1510,56 @@
 	.put =		snd_es1373_rear_put,
 };
 
+static int snd_es1373_line_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo)
+{
+	uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
+	uinfo->count = 1;
+	uinfo->value.integer.min = 0;
+	uinfo->value.integer.max = 1;
+	return 0;
+}
+
+static int snd_es1373_line_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
+{
+	ensoniq_t *ensoniq = snd_kcontrol_chip(kcontrol);
+	int val = 0;
+	
+	spin_lock_irq(&ensoniq->reg_lock);
+	if ((ensoniq->ctrl & ES_1371_GPIO_OUTM) >= 4)
+	    	val = 1;
+	ucontrol->value.integer.value[0] = val;
+	spin_unlock_irq(&ensoniq->reg_lock);
+	return 0;
+}
+
+static int snd_es1373_line_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
+{
+	ensoniq_t *ensoniq = snd_kcontrol_chip(kcontrol);
+	int changed;
+	unsigned int ctrl;
+	
+	spin_lock_irq(&ensoniq->reg_lock);
+	ctrl = ensoniq->ctrl;
+	if (ucontrol->value.integer.value[0])
+		ensoniq->ctrl |= ES_1371_GPIO_OUT(4);	/* switch line-in -> rear out */
+	else
+		ensoniq->ctrl &= ~ES_1371_GPIO_OUT(4);
+	changed = (ctrl != ensoniq->ctrl);
+	if (changed)
+		outl(ensoniq->ctrl, ES_REG(ensoniq, CONTROL));
+	spin_unlock_irq(&ensoniq->reg_lock);
+	return changed;
+}
+
+static snd_kcontrol_new_t snd_ens1373_line __devinitdata =
+{
+	.iface =	SNDRV_CTL_ELEM_IFACE_MIXER,
+	.name =		"Line In->Rear Out Switch",
+	.info =		snd_es1373_line_info,
+	.get =		snd_es1373_line_get,
+	.put =		snd_es1373_line_put,
+};
+
 static void snd_ensoniq_mixer_free_ac97(ac97_t *ac97)
 {
 	ensoniq_t *ensoniq = snd_magic_cast(ensoniq_t, ac97->private_data, return);
@@ -1513,23 +1582,28 @@
 static int snd_ensoniq_1371_mixer(ensoniq_t * ensoniq)
 {
 	snd_card_t *card = ensoniq->card;
+	ac97_bus_t bus, *pbus;
 	ac97_t ac97;
 	int err, idx;
 
+	memset(&bus, 0, sizeof(bus));
+	bus.write = snd_es1371_codec_write;
+	bus.read = snd_es1371_codec_read;
+	if ((err = snd_ac97_bus(card, &bus, &pbus)) < 0)
+		return err;
+
 	memset(&ac97, 0, sizeof(ac97));
-	ac97.write = snd_es1371_codec_write;
-	ac97.read = snd_es1371_codec_read;
 	ac97.private_data = ensoniq;
 	ac97.private_free = snd_ensoniq_mixer_free_ac97;
 	ac97.scaps = AC97_SCAP_AUDIO;
-	if ((err = snd_ac97_mixer(card, &ac97, &ensoniq->u.es1371.ac97)) < 0)
+	if ((err = snd_ac97_mixer(pbus, &ac97, &ensoniq->u.es1371.ac97)) < 0)
 		return err;
 	for (idx = 0; es1371_spdif_present[idx].vid != (unsigned short)PCI_ANY_ID; idx++)
 		if (ensoniq->pci->vendor == es1371_spdif_present[idx].vid &&
 		    ensoniq->pci->device == es1371_spdif_present[idx].did &&
 		    ensoniq->rev == es1371_spdif_present[idx].rev) {
 		    	snd_kcontrol_t *kctl;
-			int index = 0; 
+			int i, index = 0; 
 
 			ensoniq->spdif_default = ensoniq->spdif_stream = SNDRV_PCM_DEFAULT_CON_SPDIF;
 			outl(ensoniq->spdif_default, ES_REG(ensoniq, CHANNEL_STATUS));
@@ -1537,36 +1611,38 @@
 		    	if (ensoniq->u.es1371.ac97->ext_id & AC97_EI_SPDIF)
 			    	index++;
 
-		    	kctl = snd_ctl_new1(&snd_es1371_mixer_spdif, ensoniq);
-			kctl->id.index = index;
-			snd_ctl_add(card, kctl);
-
-			kctl = snd_ctl_new1(&snd_ens1373_spdif_default, ensoniq);
-			kctl->id.index = index;
-			snd_ctl_add(card, kctl);
-
-			kctl = snd_ctl_new1(&snd_ens1373_spdif_mask, ensoniq);
-			kctl->id.index = index;
-			snd_ctl_add(card, kctl);
-
-			kctl = snd_ctl_new1(&snd_ens1373_spdif_stream, ensoniq);
-			kctl->id.index = index;
-			snd_ctl_add(card, kctl);
+			for (i = 0; i < (int)ARRAY_SIZE(snd_es1371_mixer_spdif); i++) {
+				kctl = snd_ctl_new1(&snd_es1371_mixer_spdif[i], ensoniq);
+				if (! kctl)
+					return -ENOMEM;
+				kctl->id.index = index;
+				if ((err = snd_ctl_add(card, kctl)) < 0)
+					return err;
+			}
 			break;
 		}
 	if (ensoniq->u.es1371.ac97->ext_id & AC97_EI_SDAC) {
 		/* mirror rear to front speakers */
 		ensoniq->cssr &= ~(ES_1373_REAR_BIT27|ES_1373_REAR_BIT24);
 		ensoniq->cssr |= ES_1373_REAR_BIT26;
-		snd_ctl_add(card, snd_ctl_new1(&snd_ens1373_rear, ensoniq));
+		err = snd_ctl_add(card, snd_ctl_new1(&snd_ens1373_rear, ensoniq));
+		if (err < 0)
+			return err;
+	}
+	if ((ensoniq->subsystem_vendor_id == 0x1274) &&
+	    (ensoniq->subsystem_device_id == 0x2000)) { /* GA-7DXR */
+		 err = snd_ctl_add(card, snd_ctl_new1(&snd_ens1373_line, ensoniq));
+		 if (err < 0)
+			 return err;
 	}
+
 	return 0;
 }
 
 #endif /* CHIP1371 */
 
-/* generic control callbacks for ens1370 and for joystick */
-#if defined(CHIP1370) || defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE))
+/* generic control callbacks for ens1370 */
+#ifdef CHIP1370
 #define ENSONIQ_CONTROL(xname, mask) \
 { .iface = SNDRV_CTL_ELEM_IFACE_CARD, .name = xname, .info = snd_ensoniq_control_info, \
   .get = snd_ensoniq_control_get, .put = snd_ensoniq_control_put, \
@@ -1593,7 +1669,6 @@
 	return 0;
 }
 
-#ifdef CHIP1370
 static int snd_ensoniq_control_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
 {
 	ensoniq_t *ensoniq = snd_kcontrol_chip(kcontrol);
@@ -1611,14 +1686,11 @@
 	spin_unlock_irqrestore(&ensoniq->reg_lock, flags);
 	return change;
 }
-#endif /* CHIP1370 */
-#endif /* CHIP1370 || GAMEPORT */
 
 /*
  * ENS1370 mixer
  */
 
-#ifdef CHIP1370
 static snd_kcontrol_new_t snd_es1370_controls[2] __devinitdata = {
 ENSONIQ_CONTROL("PCM 0 Output also on Line-In Jack", ES_1370_XCTL0),
 ENSONIQ_CONTROL("Mic +5V bias", ES_1370_XCTL1)
@@ -1653,136 +1725,55 @@
 	ak4531.private_free = snd_ensoniq_mixer_free_ak4531;
 	if ((err = snd_ak4531_mixer(card, &ak4531, &ensoniq->u.es1370.ak4531)) < 0)
 		return err;
-	for (idx = 0; idx < ES1370_CONTROLS; idx++)
-		snd_ctl_add(card, snd_ctl_new1(&snd_es1370_controls[idx], ensoniq));
+	for (idx = 0; idx < ES1370_CONTROLS; idx++) {
+		err = snd_ctl_add(card, snd_ctl_new1(&snd_es1370_controls[idx], ensoniq));
+		if (err < 0)
+			return err;
+	}
 	return 0;
 }
 
 #endif /* CHIP1370 */
 
-/*
- *  General Switches...
- */
-
-#if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE))
-/* MQ: gameport driver connectivity */
-#define ENSONIQ_JOY_CONTROL(xname, mask) \
-{ .iface = SNDRV_CTL_ELEM_IFACE_CARD, .name = xname, .info = snd_ensoniq_control_info, \
-  .get = snd_ensoniq_control_get, .put = snd_ensoniq_joy_control_put, \
-  .private_value = mask }
-
-static int snd_ensoniq_joy_enable(ensoniq_t *ensoniq)
+#ifdef SUPPORT_JOYSTICK
+static int snd_ensoniq_joystick(ensoniq_t *ensoniq, long port)
 {
-	static unsigned long last_jiffies = 0;
-	unsigned long flags;
-
-	if (!request_region(ensoniq->gameport.io, 8, "ens137x: gameport")) {
-#define ES___GAMEPORT_LOG_DELAY (30*HZ)
-		// avoid log pollution: limit to 2 infos per minute
-		if (time_after(jiffies, last_jiffies + ES___GAMEPORT_LOG_DELAY)) {
-			last_jiffies = jiffies;
+#ifdef CHIP1371
+	if (port == 1) { /* auto-detect */
+		for (port = 0x200; port <= 0x218; port += 8)
+			if (request_region(port, 8, "ens137x: gameport"))
+				break;
+		if (port > 0x218) {
+			snd_printk("no gameport available\n");
+			return -EBUSY;
+		}
+	} else
+#endif
+	{
+		if (!request_region(port, 8, "ens137x: gameport")) {
 			snd_printk("gameport io port 0x%03x in use", ensoniq->gameport.io);
+			return -EBUSY;
 		}
-		return 0;
 	}
-	spin_lock_irqsave(&ensoniq->reg_lock, flags);
+	ensoniq->gameport.io = port;
 	ensoniq->ctrl |= ES_JYSTK_EN;
+#ifdef CHIP1371
+	ensoniq->ctrl &= ~ES_1371_JOY_ASELM;
+	ensoniq->ctrl |= ES_1371_JOY_ASEL((ensoniq->gameport.io - 0x200) / 8);
+#endif
 	outl(ensoniq->ctrl, ES_REG(ensoniq, CONTROL));
-	spin_unlock_irqrestore(&ensoniq->reg_lock, flags);
 	gameport_register_port(&ensoniq->gameport);
-	return 1;
+	return 0;
 }
 
-static int snd_ensoniq_joy_disable(ensoniq_t *ensoniq)
+static void snd_ensoniq_joystick_free(ensoniq_t *ensoniq)
 {
-	unsigned long flags;
-
 	gameport_unregister_port(&ensoniq->gameport);
-	spin_lock_irqsave(&ensoniq->reg_lock, flags);
 	ensoniq->ctrl &= ~ES_JYSTK_EN;
 	outl(ensoniq->ctrl, ES_REG(ensoniq, CONTROL));
-	spin_unlock_irqrestore(&ensoniq->reg_lock, flags);
 	release_region(ensoniq->gameport.io, 8);
-	return 1;
-}
-
-static int snd_ensoniq_joy_control_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
-{
-	ensoniq_t *ensoniq = snd_kcontrol_chip(kcontrol);
-	unsigned int nval;
-	int change;
-
-	down(&ensoniq->joy_sem);
-	nval = ucontrol->value.integer.value[0] ? ES_JYSTK_EN : 0;
-	change = (ensoniq->ctrl & ES_JYSTK_EN) != nval;	// spinlock shouldn't be needed because of joy_sem
-	if (change) {
-		if (nval)	// enable
-			change = snd_ensoniq_joy_enable(ensoniq);
-		else	change = snd_ensoniq_joy_disable(ensoniq);
-	}
-	up(&ensoniq->joy_sem);
-	return change;
-}
-
-static snd_kcontrol_new_t snd_ensoniq_control_joystick __devinitdata =
-ENSONIQ_JOY_CONTROL("Joystick Enable", ES_JYSTK_EN);
-
-#ifdef CHIP1371
-
-#define ES1371_JOYSTICK_ADDR(xname) \
-{ .iface = SNDRV_CTL_ELEM_IFACE_CARD, .name = xname, .info = snd_es1371_joystick_addr_info, \
-  .get = snd_es1371_joystick_addr_get, .put = snd_es1371_joystick_addr_put }
-
-static int snd_es1371_joystick_addr_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo)
-{
-        uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
-        uinfo->count = 1;
-        uinfo->value.enumerated.items = 4;
-	if (uinfo->value.enumerated.item >= 4)
-		uinfo->value.enumerated.item = 3;
-	sprintf(uinfo->value.enumerated.name, "port 0x%x", (uinfo->value.enumerated.item * 8) + 0x200);
-        return 0;
-}
-
-static int snd_es1371_joystick_addr_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
-{
-	ensoniq_t *ensoniq = snd_kcontrol_chip(kcontrol);
-	unsigned long flags;
-	
-	spin_lock_irqsave(&ensoniq->reg_lock, flags);
-	ucontrol->value.enumerated.item[0] = ES_1371_JOY_ASELI(ensoniq->ctrl);
-	spin_unlock_irqrestore(&ensoniq->reg_lock, flags);
-	return 0;
-}
-
-static int snd_es1371_joystick_addr_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
-{
-	ensoniq_t *ensoniq = snd_kcontrol_chip(kcontrol);
-	unsigned long flags;
-	unsigned int nval;
-	int change;
-
-	down(&ensoniq->joy_sem);
-	nval = ES_1371_JOY_ASEL(ucontrol->value.integer.value[0]);
-	spin_lock_irqsave(&ensoniq->reg_lock, flags);
-	if (!(change = !(ensoniq->ctrl & ES_JYSTK_EN)))
-		goto no_change;	// FIXME: now we allow change only when joystick is disabled
-	change = (ensoniq->ctrl & ES_1371_JOY_ASELM) != nval;
-	ensoniq->ctrl &= ~ES_1371_JOY_ASELM;
-	ensoniq->ctrl |= nval;
-	outl(ensoniq->ctrl, ES_REG(ensoniq, CONTROL));
-	ensoniq->gameport.io = 0x200 + ES_1371_JOY_ASELI(nval) * 8;
-no_change:
-	spin_unlock_irqrestore(&ensoniq->reg_lock, flags);
-	up(&ensoniq->joy_sem);
-	return change;
 }
-
-static snd_kcontrol_new_t snd_es1371_joystick_addr __devinitdata =
-ES1371_JOYSTICK_ADDR("Joystick Address");
-
-#endif /* CHIP1371 */
-#endif /* CONFIG_GAMEPORT */
+#endif /* SUPPORT_JOYSTICK */
 
 /*
 
@@ -1812,7 +1803,7 @@
 	snd_info_entry_t *entry;
 
 	if (! snd_card_proc_new(ensoniq->card, "audiopci", &entry))
-		snd_info_set_text_ops(entry, ensoniq, snd_ensoniq_proc_read);
+		snd_info_set_text_ops(entry, ensoniq, 1024, snd_ensoniq_proc_read);
 }
 
 /*
@@ -1821,9 +1812,9 @@
 
 static int snd_ensoniq_free(ensoniq_t *ensoniq)
 {
-#if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE))
+#ifdef SUPPORT_JOYSTICK
 	if (ensoniq->ctrl & ES_JYSTK_EN)
-		snd_ensoniq_joy_disable(ensoniq);
+		snd_ensoniq_joystick_free(ensoniq);
 #endif
 	if (ensoniq->irq < 0)
 		goto __hw_end;
@@ -2019,14 +2010,6 @@
 	outb(ensoniq->uartc = 0x00, ES_REG(ensoniq, UART_CONTROL));
 	outb(0x00, ES_REG(ensoniq, UART_RES));
 	outl(ensoniq->cssr, ES_REG(ensoniq, STATUS));
-#if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE))
-	init_MUTEX(&ensoniq->joy_sem);
-#ifdef CHIP1371
-	snd_ctl_add(card, snd_ctl_new1(&snd_es1371_joystick_addr, ensoniq));
-#endif
-	snd_ctl_add(card, snd_ctl_new1(&snd_ensoniq_control_joystick, ensoniq));
-	ensoniq->gameport.io = 0x200;	// FIXME: is ES1371 configured like this above ?
-#endif
 	synchronize_irq(ensoniq->irq);
 
 	if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, ensoniq, &ops)) < 0) {
@@ -2034,6 +2017,8 @@
 		return err;
 	}
 
+	snd_card_set_dev(card, &pci->dev);
+
 	*rensoniq = ensoniq;
 	return 0;
 }
@@ -2331,6 +2316,22 @@
 		snd_card_free(card);
 		return err;
 	}
+#ifdef SUPPORT_JOYSTICK
+#ifdef CHIP1371
+	switch (joystick_port[dev]) {
+	case 1: /* auto-detect */
+	case 0x200:
+	case 0x208:
+	case 0x210:
+	case 0x218:
+		snd_ensoniq_joystick(ensoniq, joystick_port[dev]);
+		break;
+	}
+#else
+	if (joystick[dev])
+		snd_ensoniq_joystick(ensoniq, 0x200);
+#endif
+#endif /* SUPPORT_JOYSTICK */
 	strcpy(card->driver, DRIVER_NAME);
 
 	strcpy(card->shortname, "Ensoniq AudioPCI");
@@ -2386,7 +2387,7 @@
 
 #ifndef MODULE
 
-/* format is: snd-ens1370=enable,index,id */
+/* format is: snd-ens1370=enable,index,id,joystick */
 
 static int __init alsa_card_ens137x_setup(char *str)
 {
@@ -2396,7 +2397,15 @@
 		return 0;
 	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
 	       get_option(&str,&index[nr_dev]) == 2 &&
-	       get_id(&str,&id[nr_dev]) == 2);
+	       get_id(&str,&id[nr_dev]) == 2
+#ifdef SUPPORT_JOYSTICK
+#ifdef CHIP1371
+	       && get_option(&str,&joystick_port[nr_dev]) == 2
+#else
+	       && get_option(&str,&joystick[nr_dev]) == 2
+#endif
+#endif
+	       );
 	nr_dev++;
 	return 1;
 }
--- diff/sound/pci/es1938.c	2003-08-26 10:00:55.000000000 +0100
+++ source/sound/pci/es1938.c	2004-02-09 10:39:58.000000000 +0000
@@ -1398,11 +1398,11 @@
 	if ((err = pci_enable_device(pci)) < 0)
 		return err;
         /* check, if we can restrict PCI DMA transfers to 24 bits */
-        if (!pci_dma_supported(pci, 0x00ffffff)) {
+	if (pci_set_dma_mask(pci, 0x00ffffff) < 0 ||
+	    pci_set_consistent_dma_mask(pci, 0x00ffffff) < 0) {
                 snd_printk("architecture does not support 24bit PCI busmaster DMA\n");
                 return -ENXIO;
         }
-	pci_set_dma_mask(pci, 0x00ffffff);
 
 	chip = snd_magic_kcalloc(es1938_t, 0, GFP_KERNEL);
 	if (chip == NULL)
@@ -1483,6 +1483,8 @@
 		return err;
 	}
 
+	snd_card_set_dev(card, &pci->dev);
+
 	*rchip = chip;
 	return 0;
 }
@@ -1633,6 +1635,14 @@
 		snd_card_free(card);
 		return err;
 	}
+
+	strcpy(card->driver, "ES1938");
+	strcpy(card->shortname, "ESS ES1938 (Solo-1)");
+	sprintf(card->longname, "%s rev %i, irq %i",
+		card->shortname,
+		chip->revision,
+		chip->irq);
+
 	if ((err = snd_es1938_new_pcm(chip, 0, &pcm)) < 0) {
 		snd_card_free(card);
 		return err;
@@ -1668,13 +1678,6 @@
 	gameport_register_port(&chip->gameport);
 #endif
 
-	strcpy(card->driver, "ES1938");
-	strcpy(card->shortname, "ESS ES1938 (Solo-1)");
-	sprintf(card->longname, "%s rev %i, irq %i",
-		card->shortname,
-		chip->revision,
-		chip->irq);
-
 	if ((err = snd_card_register(card)) < 0) {
 		snd_card_free(card);
 		return err;
--- diff/sound/pci/es1968.c	2003-09-30 15:46:21.000000000 +0100
+++ source/sound/pci/es1968.c	2004-02-09 10:39:58.000000000 +0000
@@ -94,7 +94,6 @@
  *	places.
  */
 
-#define __SND_OSS_COMPAT__
 #include <sound/driver.h>
 #include <asm/io.h>
 #include <linux/delay.h>
@@ -102,6 +101,7 @@
 #include <linux/init.h>
 #include <linux/pci.h>
 #include <linux/slab.h>
+#include <linux/gameport.h>
 #include <sound/core.h>
 #include <sound/pcm.h>
 #include <sound/mpu401.h>
@@ -122,6 +122,10 @@
 		"{ESS,Maestro 1},"
 		"{TerraTec,DMX}}");
 
+#if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE))
+#define SUPPORT_JOYSTICK 1
+#endif
+
 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;	/* Index 1-MAX */
 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;	/* ID for this card */
 static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;	/* Enable this card */
@@ -131,6 +135,9 @@
 static int clock[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0};
 static int use_pm[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 2};
 static int enable_mpu[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 2};
+#ifdef SUPPORT_JOYSTICK
+static int joystick[SNDRV_CARDS];
+#endif
 
 MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
 MODULE_PARM_DESC(index, "Index value for " CARD_NAME " soundcard.");
@@ -159,6 +166,11 @@
 MODULE_PARM(enable_mpu, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
 MODULE_PARM_DESC(enable_mpu, "Enable MPU401.  (0 = off, 1 = on, 2 = auto)");
 MODULE_PARM_SYNTAX(enable_mpu, SNDRV_ENABLED "," SNDRV_BOOLEAN_TRUE_DESC);
+#ifdef SUPPORT_JOYSTICK
+MODULE_PARM(joystick, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+MODULE_PARM_DESC(joystick, "Enable joystick.");
+MODULE_PARM_SYNTAX(joystick, SNDRV_ENABLED "," SNDRV_BOOLEAN_FALSE_DESC);
+#endif
 
 
 /* PCI Dev ID's */
@@ -602,6 +614,11 @@
 #ifdef CONFIG_PM
 	u16 apu_map[NR_APUS][NR_APU_REGS];
 #endif
+
+#ifdef SUPPORT_JOYSTICK
+	struct gameport gameport;
+	struct resource *res_joystick;
+#endif
 };
 
 static irqreturn_t snd_es1968_interrupt(int irq, void *dev_id, struct pt_regs *regs);
@@ -2020,15 +2037,20 @@
 static int __devinit
 snd_es1968_mixer(es1968_t *chip)
 {
+	ac97_bus_t bus, *pbus;
 	ac97_t ac97;
 	snd_ctl_elem_id_t id;
 	int err;
 
+	memset(&bus, 0, sizeof(bus));
+	bus.write = snd_es1968_ac97_write;
+	bus.read = snd_es1968_ac97_read;
+	if ((err = snd_ac97_bus(chip->card, &bus, &pbus)) < 0)
+		return err;
+
 	memset(&ac97, 0, sizeof(ac97));
-	ac97.write = snd_es1968_ac97_write;
-	ac97.read = snd_es1968_ac97_read;
 	ac97.private_data = chip;
-	if ((err = snd_ac97_mixer(chip->card, &ac97, &chip->ac97)) < 0)
+	if ((err = snd_ac97_mixer(pbus, &ac97, &chip->ac97)) < 0)
 		return err;
 
 	/* attach master switch / volumes for h/w volume control */
@@ -2478,6 +2500,13 @@
 	if (chip->res_io_port)
 		snd_es1968_reset(chip);
 
+#ifdef SUPPORT_JOYSTICK
+	if (chip->res_joystick) {
+		gameport_unregister_port(&chip->gameport);
+		release_resource(chip->res_joystick);
+		kfree_nocheck(chip->res_joystick);
+	}
+#endif
 	snd_es1968_set_acpi(chip, ACPI_D3);
 	chip->master_switch = NULL;
 	chip->master_volume = NULL;
@@ -2534,11 +2563,11 @@
 	if ((err = pci_enable_device(pci)) < 0)
 		return err;
 	/* check, if we can restrict PCI DMA transfers to 28 bits */
-	if (!pci_dma_supported(pci, 0x0fffffff)) {
+	if (pci_set_dma_mask(pci, 0x0fffffff) < 0 ||
+	    pci_set_consistent_dma_mask(pci, 0x0fffffff) < 0) {
 		snd_printk("architecture does not support 28bit PCI busmaster DMA\n");
 		return -ENXIO;
 	}
-	pci_set_dma_mask(pci, 0x0fffffff);
 
 	chip = (es1968_t *) snd_magic_kcalloc(es1968_t, 0, GFP_KERNEL);
 	if (! chip)
@@ -2617,62 +2646,13 @@
 		return err;
 	}
 
-	*chip_ret = chip;
-
-	return 0;
-}
-
-
-/*
- * joystick
- */
-
-static int snd_es1968_joystick_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo)
-{
-	uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
-	uinfo->count = 1;
-	uinfo->value.integer.min = 0;
-	uinfo->value.integer.max = 1;
-	return 0;
-}
-
-static int snd_es1968_joystick_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
-{
-	es1968_t *chip = snd_kcontrol_chip(kcontrol);
-	u16 val;
-
-	pci_read_config_word(chip->pci, ESM_LEGACY_AUDIO_CONTROL, &val);
-	ucontrol->value.integer.value[0] = (val & 0x04) ? 1 : 0;
-	return 0;
-}
+	snd_card_set_dev(card, &pci->dev);
 
-static int snd_es1968_joystick_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
-{
-	es1968_t *chip = snd_kcontrol_chip(kcontrol);
-	u16 val, oval;
+	*chip_ret = chip;
 
-	pci_read_config_word(chip->pci, ESM_LEGACY_AUDIO_CONTROL, &oval);
-	val = oval & ~0x04;
-	if (ucontrol->value.integer.value[0])
-		val |= 0x04;
-	if (val != oval) {
-		pci_write_config_word(chip->pci, ESM_LEGACY_AUDIO_CONTROL, val);
-		return 1;
-	}
 	return 0;
 }
 
-#define num_controls(ary) (sizeof(ary) / sizeof(snd_kcontrol_new_t))
-
-static snd_kcontrol_new_t snd_es1968_control_switches[] __devinitdata = {
-	{
-		.name = "Joystick",
-		.iface = SNDRV_CTL_ELEM_IFACE_CARD,
-		.info = snd_es1968_joystick_info,
-		.get = snd_es1968_joystick_get,
-		.put = snd_es1968_joystick_put,
-	}
-};
 
 /*
  */
@@ -2756,14 +2736,17 @@
 		}
 	}
 
-	/* card switches */
-	for (i = 0; i < num_controls(snd_es1968_control_switches); i++) {
-		err = snd_ctl_add(card, snd_ctl_new1(&snd_es1968_control_switches[i], chip));
-		if (err < 0) {
-			snd_card_free(card);
-			return err;
-		}
+#ifdef SUPPORT_JOYSTICK
+#define JOYSTICK_ADDR	0x200
+	if (joystick[dev] &&
+	    (chip->res_joystick = request_region(JOYSTICK_ADDR, 8, "ES1968 gameport")) != NULL) {
+		u16 val;
+		pci_read_config_word(pci, ESM_LEGACY_AUDIO_CONTROL, &val);
+		pci_write_config_word(pci, ESM_LEGACY_AUDIO_CONTROL, val | 0x04);
+		chip->gameport.io = JOYSTICK_ADDR;
+		gameport_register_port(&chip->gameport);
 	}
+#endif
 
 	snd_es1968_start_irq(chip);
 
@@ -2834,7 +2817,8 @@
 			 pcm_substreams_c,
 			 clock,
 			 use_pm,
-			 enable_mpu
+			 enable_mpu,
+			 joystick
 */
 
 static int __init alsa_card_es1968_setup(char *str)
@@ -2851,7 +2835,11 @@
 	       get_option(&str,&pcm_substreams_c[nr_dev]) == 2 &&
 	       get_option(&str,&clock[nr_dev]) == 2 &&
 	       get_option(&str,&use_pm[nr_dev]) == 2 &&
-	       get_option(&str,&enable_mpu[nr_dev]) == 2);
+	       get_option(&str,&enable_mpu[nr_dev]) == 2
+#ifdef SUPPORT_JOYSTICK
+	       && get_option(&str,&joystick[nr_dev]) == 2
+#endif
+	       );
 	nr_dev++;
 	return 1;
 }
--- diff/sound/pci/fm801.c	2003-08-20 14:16:35.000000000 +0100
+++ source/sound/pci/fm801.c	2004-02-09 10:39:58.000000000 +0000
@@ -147,6 +147,7 @@
 	unsigned int cap_size;
 	unsigned int cap_pos;
 
+	ac97_bus_t *ac97_bus;
 	ac97_t *ac97;
 	ac97_t *ac97_sec;
 
@@ -844,6 +845,12 @@
 FM801_SINGLE("IEC958 Playback Switch", FM801_GEN_CTRL, 2, 1, 0),
 };
 
+static void snd_fm801_mixer_free_ac97_bus(ac97_bus_t *bus)
+{
+	fm801_t *chip = snd_magic_cast(fm801_t, bus->private_data, return);
+	chip->ac97_bus = NULL;
+}
+
 static void snd_fm801_mixer_free_ac97(ac97_t *ac97)
 {
 	fm801_t *chip = snd_magic_cast(fm801_t, ac97->private_data, return);
@@ -856,21 +863,28 @@
 
 static int __devinit snd_fm801_mixer(fm801_t *chip)
 {
+	ac97_bus_t bus;
 	ac97_t ac97;
 	unsigned int i;
 	int err;
 
+	memset(&bus, 0, sizeof(bus));
+	bus.write = snd_fm801_codec_write;
+	bus.read = snd_fm801_codec_read;
+	bus.private_data = chip;
+	bus.private_free = snd_fm801_mixer_free_ac97_bus;
+	if ((err = snd_ac97_bus(chip->card, &bus, &chip->ac97_bus)) < 0)
+		return err;
+
 	memset(&ac97, 0, sizeof(ac97));
-	ac97.write = snd_fm801_codec_write;
-	ac97.read = snd_fm801_codec_read;
 	ac97.private_data = chip;
 	ac97.private_free = snd_fm801_mixer_free_ac97;
-	if ((err = snd_ac97_mixer(chip->card, &ac97, &chip->ac97)) < 0)
+	if ((err = snd_ac97_mixer(chip->ac97_bus, &ac97, &chip->ac97)) < 0)
 		return err;
 	if (chip->secondary) {
 		ac97.num = 1;
 		ac97.addr = chip->secondary_addr;
-		if ((err = snd_ac97_mixer(chip->card, &ac97, &chip->ac97_sec)) < 0)
+		if ((err = snd_ac97_mixer(chip->ac97_bus, &ac97, &chip->ac97_sec)) < 0)
 			return err;
 	}
 	for (i = 0; i < FM801_CONTROLS; i++)
@@ -1040,6 +1054,8 @@
 		return err;
 	}
 
+	snd_card_set_dev(card, &pci->dev);
+
 	*rchip = chip;
 	return 0;
 }
@@ -1067,6 +1083,13 @@
 		snd_card_free(card);
 		return err;
 	}
+
+	strcpy(card->driver, "FM801");
+	strcpy(card->shortname, "ForteMedia FM801-");
+	strcat(card->shortname, chip->multichannel ? "AU" : "AS");
+	sprintf(card->longname, "%s at 0x%lx, irq %i",
+		card->shortname, chip->port, chip->irq);
+
 	if ((err = snd_fm801_pcm(chip, 0, NULL)) < 0) {
 		snd_card_free(card);
 		return err;
@@ -1092,12 +1115,6 @@
 		return err;
 	}
 
-	strcpy(card->driver, "FM801");
-	strcpy(card->shortname, "ForteMedia FM801-");
-	strcat(card->shortname, chip->multichannel ? "AU" : "AS");
-	sprintf(card->longname, "%s at 0x%lx, irq %i",
-		card->shortname, chip->port, chip->irq);
-
 	if ((err = snd_card_register(card)) < 0) {
 		snd_card_free(card);
 		return err;
--- diff/sound/pci/ice1712/Makefile	2003-06-30 10:07:25.000000000 +0100
+++ source/sound/pci/ice1712/Makefile	2004-02-09 10:39:58.000000000 +0000
@@ -5,7 +5,7 @@
 
 snd-ice17xx-ak4xxx-objs := ak4xxx.o
 snd-ice1712-objs := ice1712.o delta.o hoontech.o ews.o
-snd-ice1724-objs := ice1724.o amp.o revo.o aureon.o
+snd-ice1724-objs := ice1724.o amp.o revo.o aureon.o prodigy.o
 
 # Toplevel Module Dependency
 obj-$(CONFIG_SND_ICE1712) += snd-ice1712.o snd-ice17xx-ak4xxx.o
--- diff/sound/pci/ice1712/ak4xxx.c	2003-08-20 14:16:35.000000000 +0100
+++ source/sound/pci/ice1712/ak4xxx.c	2004-02-09 10:39:58.000000000 +0000
@@ -175,6 +175,18 @@
 	return 0;
 }
 
+static int __init alsa_ice1712_akm4xxx_module_init(void)
+{
+	return 0;
+}
+        
+static void __exit alsa_ice1712_akm4xxx_module_exit(void)
+{
+}
+        
+module_init(alsa_ice1712_akm4xxx_module_init)
+module_exit(alsa_ice1712_akm4xxx_module_exit)
+
 EXPORT_SYMBOL(snd_ice1712_akm4xxx_init);
 EXPORT_SYMBOL(snd_ice1712_akm4xxx_free);
 EXPORT_SYMBOL(snd_ice1712_akm4xxx_build_controls);
--- diff/sound/pci/ice1712/aureon.c	2003-09-30 15:46:21.000000000 +0100
+++ source/sound/pci/ice1712/aureon.c	2004-02-09 10:39:58.000000000 +0000
@@ -185,7 +185,7 @@
 		if (nvol <= 0x1a && ovol <= 0x1a)
 			change = 0;
 		else
-			wm_put(ice, idx, nvol | 0x100);
+			wm_put(ice, idx, nvol | 0x180); /* update on zero detect */
 	}
 	snd_ice1712_restore_gpio_status(ice);
 	return change;
@@ -366,9 +366,15 @@
 static int __devinit aureon_init(ice1712_t *ice)
 {
 	static unsigned short wm_inits[] = {
+		/* These come first to reduce init pop noise */
+		0x1b, 0x000,		/* ADC Mux */
+		0x1c, 0x009,		/* Out Mux1 */
+		0x1d, 0x009,		/* Out Mux2 */
+
+		0x18, 0x000,		/* All power-up */
+
 		0x16, 0x122,		/* I2S, normal polarity, 24bit */
 		0x17, 0x022,		/* 256fs, slave mode */
-		0x18, 0x000,		/* All power-up */
 		0x00, 0,		/* DAC1 analog mute */
 		0x01, 0,		/* DAC2 analog mute */
 		0x02, 0,		/* DAC3 analog mute */
@@ -393,9 +399,6 @@
 		0x15, 0x000,		/* no deemphasis, no ZFLG */
 		0x19, 0x000,		/* -12dB ADC/L */
 		0x1a, 0x000,		/* -12dB ADC/R */
-		0x1b, 0x000,		/* ADC Mux */
-		0x1c, 0x009,		/* Out Mux1 */
-		0x1d, 0x009,		/* Out Mux2 */
 	};
 	static unsigned short cs_inits[] = {
 		0x0441, /* RUN */
--- diff/sound/pci/ice1712/delta.c	2003-06-30 10:07:25.000000000 +0100
+++ source/sound/pci/ice1712/delta.c	2004-02-09 10:39:58.000000000 +0000
@@ -257,6 +257,26 @@
 }
 
 /*
+ * change the DFS bit according rate for Delta1010
+ */
+static void delta_1010_set_rate_val(ice1712_t *ice, unsigned int rate)
+{
+	unsigned char tmp, tmp2;
+
+	if (rate == 0)	/* no hint - S/PDIF input is master, simply return */
+		return;
+
+	down(&ice->gpio_mutex);
+	tmp = snd_ice1712_read(ice, ICE1712_IREG_GPIO_DATA);
+	tmp2 = tmp & ~ICE1712_DELTA_DFS;
+	if (rate > 48000)
+		tmp2 |= ICE1712_DELTA_DFS;
+	if (tmp != tmp2)
+		snd_ice1712_write(ice, ICE1712_IREG_GPIO_DATA, tmp2);
+	up(&ice->gpio_mutex);
+}
+
+/*
  * change the rate of AK4524 on Delta 44/66, AP, 1010LT
  */
 static void delta_ak4524_set_rate_val(akm4xxx_t *ak, unsigned int rate)
@@ -271,8 +291,7 @@
 	down(&ice->gpio_mutex);
 	tmp = snd_ice1712_read(ice, ICE1712_IREG_GPIO_DATA);
 	up(&ice->gpio_mutex);
-	tmp2 = tmp;
-	tmp2 &= ~ICE1712_DELTA_DFS; 
+	tmp2 = tmp & ~ICE1712_DELTA_DFS; 
 	if (rate > 48000)
 		tmp2 |= ICE1712_DELTA_DFS;
 	if (tmp == tmp2)
@@ -454,7 +473,11 @@
 			return err;
 		break;
 	case ICE1712_SUBDEVICE_DELTA1010:
+		ice->gpio.set_pro_rate = delta_1010_set_rate_val;
+		break;
 	case ICE1712_SUBDEVICE_DELTADIO2496:
+		ice->gpio.set_pro_rate = delta_1010_set_rate_val;
+		/* fall thru */
 	case ICE1712_SUBDEVICE_DELTA66:
 		ice->spdif.ops.open = delta_open_spdif;
 		ice->spdif.ops.setup_rate = delta_setup_spdif;
--- diff/sound/pci/ice1712/ice1712.c	2003-08-26 10:00:55.000000000 +0100
+++ source/sound/pci/ice1712/ice1712.c	2004-02-09 10:39:58.000000000 +0000
@@ -1040,16 +1040,21 @@
 	default:
 		snd_BUG();
 		val = 0;
+		rate = 48000;
 		break;
 	}
 	outb(val, ICEMT(ice, RATE));
 
 	spin_unlock_irqrestore(&ice->reg_lock, flags);
 
+	if (ice->gpio.set_pro_rate)
+		ice->gpio.set_pro_rate(ice, rate);
 	for (i = 0; i < ice->akm_codecs; i++) {
 		if (ice->akm[i].ops.set_rate_val)
 			ice->akm[i].ops.set_rate_val(&ice->akm[i], rate);
 	}
+	if (ice->spdif.ops.setup_rate)
+		ice->spdif.ops.setup_rate(ice, rate);
 }
 
 static int snd_ice1712_playback_pro_prepare(snd_pcm_substream_t * substream)
@@ -1072,8 +1077,6 @@
 	ice1712_t *ice = snd_pcm_substream_chip(substream);
 
 	snd_ice1712_set_pro_rate(ice, params_rate(hw_params), 0);
-	if (ice->spdif.ops.setup_rate)
-		ice->spdif.ops.setup_rate(ice, params_rate(hw_params));
 	return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params));
 }
 
@@ -1449,13 +1452,17 @@
 	int err;
 
 	if (ice_has_con_ac97(ice)) {
+		ac97_bus_t bus, *pbus;
 		ac97_t ac97;
+		memset(&bus, 0, sizeof(bus));
+		bus.write = snd_ice1712_ac97_write;
+		bus.read = snd_ice1712_ac97_read;
+		if ((err = snd_ac97_bus(ice->card, &bus, &pbus)) < 0)
+			return err;
 		memset(&ac97, 0, sizeof(ac97));
-		ac97.write = snd_ice1712_ac97_write;
-		ac97.read = snd_ice1712_ac97_read;
 		ac97.private_data = ice;
 		ac97.private_free = snd_ice1712_mixer_free_ac97;
-		if ((err = snd_ac97_mixer(ice->card, &ac97, &ice->ac97)) < 0)
+		if ((err = snd_ac97_mixer(pbus, &ac97, &ice->ac97)) < 0)
 			printk(KERN_WARNING "ice1712: cannot initialize ac97 for consumer, skipped\n");
 		else {
 			if ((err = snd_ctl_add(ice->card, snd_ctl_new1(&snd_ice1712_mixer_digmix_route_ac97, ice))) < 0)
@@ -1465,13 +1472,17 @@
 	}
 
 	if (! (ice->eeprom.data[ICE_EEP1_ACLINK] & ICE1712_CFG_PRO_I2S)) {
+		ac97_bus_t bus, *pbus;
 		ac97_t ac97;
+		memset(&bus, 0, sizeof(bus));
+		bus.write = snd_ice1712_pro_ac97_write;
+		bus.read = snd_ice1712_pro_ac97_read;
+		if ((err = snd_ac97_bus(ice->card, &bus, &pbus)) < 0)
+			return err;
 		memset(&ac97, 0, sizeof(ac97));
-		ac97.write = snd_ice1712_pro_ac97_write;
-		ac97.read = snd_ice1712_pro_ac97_read;
 		ac97.private_data = ice;
 		ac97.private_free = snd_ice1712_mixer_free_ac97;
-		if ((err = snd_ac97_mixer(ice->card, &ac97, &ice->ac97)) < 0)
+		if ((err = snd_ac97_mixer(pbus, &ac97, &ice->ac97)) < 0)
 			printk(KERN_WARNING "ice1712: cannot initialize pro ac97, skipped\n");
 		else
 			return 0;
@@ -1532,7 +1543,7 @@
 	snd_info_entry_t *entry;
 
 	if (! snd_card_proc_new(ice->card, "ice1712", &entry))
-		snd_info_set_text_ops(entry, ice, snd_ice1712_proc_read);
+		snd_info_set_text_ops(entry, ice, 1024, snd_ice1712_proc_read);
 }
 
 /*
@@ -2352,11 +2363,11 @@
 	if ((err = pci_enable_device(pci)) < 0)
 		return err;
 	/* check, if we can restrict PCI DMA transfers to 28 bits */
-	if (!pci_dma_supported(pci, 0x0fffffff)) {
+	if (pci_set_dma_mask(pci, 0x0fffffff) < 0 ||
+	    pci_set_consistent_dma_mask(pci, 0x0fffffff) < 0) {
 		snd_printk("architecture does not support 28bit PCI busmaster DMA\n");
 		return -ENXIO;
 	}
-	pci_set_dma_mask(pci, 0x0fffffff);
 
 	ice = snd_magic_kcalloc(ice1712_t, 0, GFP_KERNEL);
 	if (ice == NULL)
@@ -2434,6 +2445,8 @@
  		return err;
 	}
 
+	snd_card_set_dev(card, &pci->dev);
+
 	*r_ice1712 = ice;
 	return 0;
 }
--- diff/sound/pci/ice1712/ice1712.h	2003-08-20 14:16:35.000000000 +0100
+++ source/sound/pci/ice1712/ice1712.h	2004-02-09 10:39:58.000000000 +0000
@@ -353,6 +353,8 @@
 		void (*set_dir)(ice1712_t *ice, unsigned int data);
 		void (*set_data)(ice1712_t *ice, unsigned int data);
 		unsigned int (*get_data)(ice1712_t *ice);
+		/* misc operators - move to another place? */
+		void (*set_pro_rate)(ice1712_t *ice, unsigned int rate);
 	} gpio;
 	struct semaphore gpio_mutex;
 };
--- diff/sound/pci/ice1712/ice1724.c	2003-09-30 15:46:21.000000000 +0100
+++ source/sound/pci/ice1712/ice1724.c	2004-02-09 10:39:58.000000000 +0000
@@ -43,6 +43,8 @@
 #include "amp.h"
 #include "revo.h"
 #include "aureon.h"
+#include "prodigy.h"
+
 
 MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>");
 MODULE_DESCRIPTION("ICEnsemble ICE1724 (Envy24HT)");
@@ -52,6 +54,7 @@
 	       REVO_DEVICE_DESC
 	       AMP_AUDIO2000_DEVICE_DESC
 	       AUREON_DEVICE_DESC
+	       PRODIGY_DEVICE_DESC
 		"{VIA,VT1724},"
 		"{ICEnsemble,Generic ICE1724},"
 		"{ICEnsemble,Generic Envy24HT}}");
@@ -908,17 +911,21 @@
 	int err;
 
 	if (! (ice->eeprom.data[ICE_EEP2_ACLINK] & VT1724_CFG_PRO_I2S)) {
+		ac97_bus_t bus, *pbus;
 		ac97_t ac97;
 		/* cold reset */
 		outb(inb(ICEMT1724(ice, AC97_CMD)) | 0x80, ICEMT1724(ice, AC97_CMD));
 		mdelay(5); /* FIXME */
 		outb(inb(ICEMT1724(ice, AC97_CMD)) & ~0x80, ICEMT1724(ice, AC97_CMD));
 
+		memset(&bus, 0, sizeof(bus));
+		bus.write = snd_vt1724_ac97_write;
+		bus.read = snd_vt1724_ac97_read;
+		if ((err = snd_ac97_bus(ice->card, &bus, &pbus)) < 0)
+			return err;
 		memset(&ac97, 0, sizeof(ac97));
-		ac97.write = snd_vt1724_ac97_write;
-		ac97.read = snd_vt1724_ac97_read;
 		ac97.private_data = ice;
-		if ((err = snd_ac97_mixer(ice->card, &ac97, &ice->ac97)) < 0)
+		if ((err = snd_ac97_mixer(pbus, &ac97, &ice->ac97)) < 0)
 			printk(KERN_WARNING "ice1712: cannot initialize pro ac97, skipped\n");
 		else
 			return 0;
@@ -975,7 +982,7 @@
 	snd_info_entry_t *entry;
 
 	if (! snd_card_proc_new(ice->card, "ice1724", &entry))
-		snd_info_set_text_ops(entry, ice, snd_vt1724_proc_read);
+		snd_info_set_text_ops(entry, ice, 1024, snd_vt1724_proc_read);
 }
 
 /*
@@ -1576,6 +1583,7 @@
 	snd_vt1724_revo_cards,
 	snd_vt1724_amp_cards, 
 	snd_vt1724_aureon_cards,
+	snd_vt1724_prodigy_cards,
 	0,
 };
 
@@ -1793,7 +1801,6 @@
         /* enable PCI device */
 	if ((err = pci_enable_device(pci)) < 0)
 		return err;
-	pci_set_dma_mask(pci, 0xffffffff); 
 
 	ice = snd_magic_kcalloc(ice1712_t, 0, GFP_KERNEL);
 	if (ice == NULL)
@@ -1857,6 +1864,8 @@
  		return err;
 	}
 
+	snd_card_set_dev(card, &pci->dev);
+
 	*r_ice1712 = ice;
 	return 0;
 }
--- diff/sound/pci/intel8x0.c	2004-02-09 10:36:12.000000000 +0000
+++ source/sound/pci/intel8x0.c	2004-02-09 10:39:58.000000000 +0000
@@ -33,6 +33,7 @@
 #include <linux/init.h>
 #include <linux/pci.h>
 #include <linux/slab.h>
+#include <linux/gameport.h>
 #include <sound/core.h>
 #include <sound/pcm.h>
 #include <sound/ac97_codec.h>
@@ -40,6 +41,9 @@
 #include <sound/mpu401.h>
 #define SNDRV_GET_ID
 #include <sound/initval.h>
+/* for 440MX workaround */
+#include <asm/pgtable.h>
+#include <asm/cacheflush.h>
 
 MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>");
 MODULE_DESCRIPTION("Intel 82801AA,82901AB,i810,i820,i830,i840,i845,MX440; SiS 7012; Ali 5455");
@@ -59,7 +63,9 @@
 		"{AMD,AMD8111},"
 	        "{ALI,M5455}}");
 
+#if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE))
 #define SUPPORT_JOYSTICK 1
+#endif
 #define SUPPORT_MIDI 1
 
 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;	/* Index 0-MAX */
@@ -67,12 +73,7 @@
 static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;	/* Enable this card */
 static int ac97_clock[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0};
 #ifdef SUPPORT_JOYSTICK
-static int joystick_port[SNDRV_CARDS] =
-#ifdef CONFIG_ISA
-	{0x200};	/* enable as default */
-#else
-	{0};	/* disabled */
-#endif
+static int joystick[SNDRV_CARDS];
 #endif
 #ifdef SUPPORT_MIDI
 static int mpu_port[SNDRV_CARDS]; /* disabled */
@@ -91,9 +92,9 @@
 MODULE_PARM_DESC(ac97_clock, "AC'97 codec clock (0 = auto-detect).");
 MODULE_PARM_SYNTAX(ac97_clock, SNDRV_ENABLED ",default:0");
 #ifdef SUPPORT_JOYSTICK
-MODULE_PARM(joystick_port, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
-MODULE_PARM_DESC(joystick_port, "Joystick port address for Intel i8x0 soundcard. (0 = disabled)");
-MODULE_PARM_SYNTAX(joystick_port, SNDRV_ENABLED ",allows:{{0},{0x200}},dialog:list");
+MODULE_PARM(joystick, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+MODULE_PARM_DESC(joystick, "Enable joystick for Intel i8x0 soundcard.");
+MODULE_PARM_SYNTAX(joystick, SNDRV_ENABLED "," SNDRV_BOOLEAN_FALSE_DESC);
 #endif
 #ifdef SUPPORT_MIDI
 MODULE_PARM(mpu_port, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
@@ -368,9 +369,8 @@
 	unsigned int roff_picb;
 	unsigned int int_sta_mask;		/* interrupt status mask */
 	unsigned int ali_slot;			/* ALI DMA slot */
-	ac97_t *ac97;
-	unsigned short ac97_rate_regs[3];
-	int ac97_rates_idx;
+	struct ac97_pcm *pcm;
+	int pcm_open_flag;
 } ichdev_t;
 
 typedef struct _snd_intel8x0 intel8x0_t;
@@ -404,7 +404,9 @@
 	    smp20bit: 1;
 	int in_ac97_init: 1,
 	    in_sdin_init: 1;
+	int fix_nocache: 1; /* workaround for 440MX */
 
+	ac97_bus_t *ac97_bus;
 	ac97_t *ac97[3];
 	unsigned int ac97_sdin[3];
 
@@ -723,6 +725,23 @@
 	iputbyte(chip, port + ichdev->roff_sr, ICH_FIFOE | ICH_BCIS | ICH_LVBCI);
 }
 
+#ifdef __i386__
+/*
+ * Intel 82443MX running a 100MHz processor system bus has a hardware bug,
+ * which aborts PCI busmaster for audio transfer.  A workaround is to set
+ * the pages as non-cached.  For details, see the errata in
+ *	http://www.intel.com/design/chipsets/specupdt/245051.htm
+ */
+static void fill_nocache(void *buf, int size, int nocache)
+{
+	size = (size + PAGE_SIZE - 1) >> PAGE_SHIFT;
+	change_page_attr(virt_to_page(buf), size, nocache ? PAGE_KERNEL_NOCACHE : PAGE_KERNEL);
+	global_flush_tlb();
+}
+#else
+#define fill_nocache(buf,size,nocache)
+#endif
+
 /*
  *  Interrupt handler
  */
@@ -888,11 +907,46 @@
 static int snd_intel8x0_hw_params(snd_pcm_substream_t * substream,
 				  snd_pcm_hw_params_t * hw_params)
 {
-	return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params));
+	intel8x0_t *chip = snd_pcm_substream_chip(substream);
+	ichdev_t *ichdev = get_ichdev(substream);
+	snd_pcm_runtime_t *runtime = substream->runtime;
+	size_t size = params_buffer_bytes(hw_params);
+	int err;
+
+	if (chip->fix_nocache && runtime->dma_area && runtime->dma_bytes < size)
+		fill_nocache(runtime->dma_area, runtime->dma_bytes, 0); /* clear */
+	err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params));
+	if (err < 0)
+		return err;
+	if (chip->fix_nocache && err > 0)
+		fill_nocache(runtime->dma_area, runtime->dma_bytes, 1);
+	if (ichdev->pcm_open_flag) {
+		snd_ac97_pcm_close(ichdev->pcm);
+		ichdev->pcm_open_flag = 0;
+	}
+	err = snd_ac97_pcm_open(ichdev->pcm, params_rate(hw_params),
+				params_channels(hw_params),
+				ichdev->pcm->r[0].slots);
+	if (err >= 0) {
+		ichdev->pcm_open_flag = 1;
+		/* FIXME: hack to enable spdif support */
+		if (ichdev->ichd == ICHD_PCMOUT && chip->device_type == DEVICE_SIS)
+			snd_ac97_set_rate(ichdev->pcm->r[0].codec[0], AC97_SPDIF, params_rate(hw_params));
+	}
+	return err;
 }
 
 static int snd_intel8x0_hw_free(snd_pcm_substream_t * substream)
 {
+	intel8x0_t *chip = snd_pcm_substream_chip(substream);
+	ichdev_t *ichdev = get_ichdev(substream);
+
+	if (ichdev->pcm_open_flag) {
+		snd_ac97_pcm_close(ichdev->pcm);
+		ichdev->pcm_open_flag = 0;
+	}
+	if (chip->fix_nocache && substream->runtime->dma_area)
+		fill_nocache(substream->runtime->dma_area, substream->runtime->dma_bytes, 0);
 	return snd_pcm_lib_free_pages(substream);
 }
 
@@ -925,6 +979,13 @@
 			cnt |= ICH_PCM_4;
 		else if (chip->multi6 && channels == 6)
 			cnt |= ICH_PCM_6;
+		if (chip->device_type == DEVICE_NFORCE) {
+			/* reset to 2ch once to keep the 6 channel data in alignment,
+			 * to start from Front Left always
+			 */
+			iputdword(chip, ICHREG(GLOB_CNT), (cnt & 0xcfffff));
+			mdelay(50); /* grrr... */
+		}
 		iputdword(chip, ICHREG(GLOB_CNT), cnt);
 		break;
 	}
@@ -935,7 +996,6 @@
 	intel8x0_t *chip = snd_pcm_substream_chip(substream);
 	snd_pcm_runtime_t *runtime = substream->runtime;
 	ichdev_t *ichdev = get_ichdev(substream);
-	int i;
 
 	ichdev->physbuf = runtime->dma_addr;
 	ichdev->size = snd_pcm_lib_buffer_bytes(substream);
@@ -945,14 +1005,6 @@
 		snd_intel8x0_setup_multi_channels(chip, runtime->channels);
 		spin_unlock(&chip->reg_lock);
 	}
-	if (ichdev->ac97) {
-		for (i = 0; i < 3; i++)
-			if (ichdev->ac97_rate_regs[i])
-				snd_ac97_set_rate(ichdev->ac97, ichdev->ac97_rate_regs[i], runtime->rate);
-		/* FIXME: hack to enable spdif support */
-		if (ichdev->ichd == ICHD_PCMOUT && chip->device_type == DEVICE_SIS)
-			snd_ac97_set_rate(ichdev->ac97, AC97_SPDIF, runtime->rate);
-	}
 	snd_intel8x0_setup_periods(chip, ichdev);
 	return 0;
 }
@@ -1031,13 +1083,11 @@
 
 	ichdev->substream = substream;
 	runtime->hw = snd_intel8x0_stream;
-	if (ichdev->ac97 && ichdev->ac97_rates_idx >= 0) {
-		runtime->hw.rates = ichdev->ac97->rates[ichdev->ac97_rates_idx];
-		for (i = 0; i < ARRAY_SIZE(rates); i++) {
-			if (runtime->hw.rates & (1 << i)) {
-				runtime->hw.rate_min = rates[i];
-				break;
-			}
+	runtime->hw.rates = ichdev->pcm->rates;
+	for (i = 0; i < ARRAY_SIZE(rates); i++) {
+		if (runtime->hw.rates & (1 << i)) {
+			runtime->hw.rate_min = rates[i];
+			break;
 		}
 	}
 	if (chip->device_type == DEVICE_SIS) {
@@ -1513,7 +1563,7 @@
 		rec = tbl + i;
 		if (i > 0 && rec->ac97_idx) {
 			/* activate PCM only when associated AC'97 codec */
-			if (! chip->ichd[rec->ac97_idx].ac97)
+			if (! chip->ichd[rec->ac97_idx].pcm)
 				continue;
 		}
 		err = snd_intel8x0_pcm1(chip, device, rec);
@@ -1531,76 +1581,100 @@
  *  Mixer part
  */
 
+static void snd_intel8x0_mixer_free_ac97_bus(ac97_bus_t *bus)
+{
+	intel8x0_t *chip = snd_magic_cast(intel8x0_t, bus->private_data, return);
+	chip->ac97_bus = NULL;
+}
+
 static void snd_intel8x0_mixer_free_ac97(ac97_t *ac97)
 {
 	intel8x0_t *chip = snd_magic_cast(intel8x0_t, ac97->private_data, return);
 	chip->ac97[ac97->num] = NULL;
 }
 
-struct _ac97_rate_regs {
-	unsigned int ichd;
-	unsigned short regs[3];
-	short rates_idx;
-};
-
-static struct _ac97_rate_regs intel_ac97_rate_regs[] __devinitdata = {
-	{ ICHD_PCMOUT, { AC97_PCM_FRONT_DAC_RATE, AC97_PCM_SURR_DAC_RATE, AC97_PCM_LFE_DAC_RATE }, AC97_RATES_FRONT_DAC },
-	{ ICHD_PCMIN, { AC97_PCM_LR_ADC_RATE, 0, 0 }, AC97_RATES_ADC },
-	{ ICHD_MIC, { AC97_PCM_MIC_ADC_RATE, 0, 0 }, AC97_RATES_MIC_ADC },
-	{ ICHD_MIC2, { AC97_PCM_MIC_ADC_RATE, 0, 0 }, AC97_RATES_MIC_ADC },
-	{ ICHD_PCM2IN, { AC97_PCM_LR_ADC_RATE, 0, 0 }, AC97_RATES_ADC },
-	{ ICHD_SPBAR, { AC97_SPDIF, 0, 0 }, AC97_RATES_SPDIF },
-};
-
-static struct _ac97_rate_regs nforce_ac97_rate_regs[] __devinitdata = {
-	{ NVD_PCMOUT, { AC97_PCM_FRONT_DAC_RATE, AC97_PCM_SURR_DAC_RATE, AC97_PCM_LFE_DAC_RATE }, AC97_RATES_FRONT_DAC },
-	{ NVD_PCMIN, { AC97_PCM_LR_ADC_RATE, 0, 0 }, AC97_RATES_ADC },
-	{ NVD_MIC, { AC97_PCM_MIC_ADC_RATE, 0, 0 }, AC97_RATES_MIC_ADC },
-	{ NVD_SPBAR, { AC97_SPDIF, AC97_PCM_FRONT_DAC_RATE, 0 }, -1 }, /* spdif is 48k only */
-};
-
-static struct _ac97_rate_regs ali_ac97_rate_regs[] __devinitdata = {
-#if 0 /* FIXME: my test board doens't work well with VRA... */
-	{ ALID_PCMOUT, { AC97_PCM_FRONT_DAC_RATE, AC97_PCM_SURR_DAC_RATE, AC97_PCM_LFE_DAC_RATE }, AC97_RATES_FRONT_DAC },
-	{ ALID_PCMIN, { AC97_PCM_LR_ADC_RATE, 0, 0 }, AC97_RATES_ADC },
-	{ ALID_MIC, { AC97_PCM_MIC_ADC_RATE, 0, 0 }, AC97_RATES_MIC_ADC },
-	{ ALID_AC97SPDIFOUT, { AC97_SPDIF, 0, 0 }, AC97_RATES_SPDIF },
-	{ ALID_SPDIFOUT, { 0, 0, 0 }, -1 },
-	{ ALID_SPDIFIN, { 0, 0, 0 }, -1 },
-#else
-	{ ALID_PCMOUT, { AC97_PCM_FRONT_DAC_RATE }, -1 },
-	{ ALID_PCMIN, { AC97_PCM_LR_ADC_RATE }, -1 },
-	{ ALID_MIC, { AC97_PCM_MIC_ADC_RATE }, -1 },
-	{ ALID_AC97SPDIFOUT, { AC97_SPDIF }, -1 },
-	{ ALID_SPDIFOUT, { }, -1 },
-	{ ALID_SPDIFIN, { }, -1 },
-#endif
+static struct ac97_pcm ac97_pcm_defs[] __devinitdata = {
+	/* front PCM */
+	{
+		.exclusive = 1,
+		.r = {	{
+				.slots = (1 << AC97_SLOT_PCM_LEFT) |
+					 (1 << AC97_SLOT_PCM_RIGHT) |
+					 (1 << AC97_SLOT_PCM_CENTER) |
+					 (1 << AC97_SLOT_PCM_SLEFT) |
+					 (1 << AC97_SLOT_PCM_SRIGHT) |
+					 (1 << AC97_SLOT_LFE)
+			}
+		}
+	},
+	/* PCM IN #1 */
+	{
+		.stream = 1,
+		.exclusive = 1,
+		.r = {	{
+				.slots = (1 << AC97_SLOT_PCM_LEFT) |
+					 (1 << AC97_SLOT_PCM_RIGHT)
+			}
+		}
+	},
+	/* MIC IN #1 */
+	{
+		.stream = 1,
+		.exclusive = 1,
+		.r = {	{
+				.slots = (1 << AC97_SLOT_MIC)
+			}
+		}
+	},
+	/* S/PDIF PCM */
+	{
+		.exclusive = 1,
+		.spdif = 1,
+		.r = {	{
+				.slots = (1 << AC97_SLOT_SPDIF_LEFT2) |
+					 (1 << AC97_SLOT_SPDIF_RIGHT2)
+			}
+		}
+	},
+	/* PCM IN #2 */
+	{
+		.stream = 1,
+		.exclusive = 1,
+		.r = {	{
+				.slots = (1 << AC97_SLOT_PCM_LEFT) |
+					 (1 << AC97_SLOT_PCM_RIGHT)
+			}
+		}
+	},
+	/* MIC IN #2 */
+	{
+		.stream = 1,
+		.exclusive = 1,
+		.r = {	{
+				.slots = (1 << AC97_SLOT_MIC)
+			}
+		}
+	},
 };
 
 static struct ac97_quirk ac97_quirks[] __devinitdata = {
 	{
 		.vendor = 0x1028,
 		.device = 0x00d8,
-		.name = "Dell Precision 530",
+		.name = "Dell Precision 530",	/* AD1885 */
 		.type = AC97_TUNE_HP_ONLY
 	},
 	{
 		.vendor = 0x1028,
 		.device = 0x0126,
-		.name = "Dell Optiplex GX260",
+		.name = "Dell Optiplex GX260",	/* AD1981A */
 		.type = AC97_TUNE_HP_ONLY
 	},
-	{
-		.vendor = 0x1028,
-		.device = 0x0157,
-		.name = "Dell Dimension 8300",
-		.type = AC97_TUNE_SWAP_SURROUND
-	},
-	{
-		.vendor = 0x1043,
-		.device =0x80b0,
-		.name = "ASUS P4PE Mobo",
-		.type = AC97_TUNE_SWAP_SURROUND
+	{	/* FIXME: which codec? */
+		.vendor = 0x103c,
+		.device = 0x00c3,
+		.name = "Hewlett-Packard onboard",
+		.type = AC97_TUNE_HP_ONLY
 	},
  	{
 		.vendor = 0x1043,
@@ -1611,13 +1685,13 @@
 	{
 		.vendor = 0x10f1,
 		.device = 0x2665,
-		.name = "Fujitsu-Siemens Celcius",
+		.name = "Fujitsu-Siemens Celsius",	/* AD1981? */
 		.type = AC97_TUNE_HP_ONLY
 	},
 	{
 		.vendor = 0x110a,
 		.device = 0x0056,
-		.name = "Fujitsu-Siemens Scenic",
+		.name = "Fujitsu-Siemens Scenic",	/* AD1981? */
 		.type = AC97_TUNE_HP_ONLY
 	},
 	{
@@ -1629,24 +1703,15 @@
 	{
 		.vendor = 0x1734,
 		.device = 0x0088,
-		.name = "Fujitsu-Siemens D1522",
+		.name = "Fujitsu-Siemens D1522",	/* AD1981 */
 		.type = AC97_TUNE_HP_ONLY
 	},
-#if 0
-	/* FIXME: this seems invalid */
-	{
-		.vendor = 0x4144,
-		.device = 0x5360,
-		.type = "AMD64 Motherboard",
-		.name = AC97_TUNE_HP_ONLY
-	},
-#endif
 	{
 		.vendor = 0x8086,
 		.device = 0x2000,
 		.mask = 0xfff0,
-		.name = "Intel ICH5/AD1985 (discrete)",
-		.type = AC97_TUNE_HP_ONLY
+		.name = "Intel ICH5/AD1985",
+		.type = AC97_TUNE_AD_SHARING
 	},
 	{
 		.vendor = 0x8086,
@@ -1658,7 +1723,7 @@
 	{
 		.vendor = 0x8086,
 		.device = 0x4d44,
-		.name = "Intel D850EMV2",
+		.name = "Intel D850EMV2",	/* AD1885 */
 		.type = AC97_TUNE_HP_ONLY
 	},
 	{
@@ -1679,13 +1744,7 @@
 		.vendor = 0x8086,
 		.device = 0xa000,
 		.mask = 0xfff0,
-		.name = "Intel ICH5/AD1985 (discrete)",
-		.type = AC97_TUNE_HP_ONLY
-	},
-	{
-		.vendor = 0x103c,
-		.device = 0x00c3,
-		.name = "Hewlett-Packard onboard",
+		.name = "Intel ICH5/AD1985",
 		.type = AC97_TUNE_HP_ONLY
 	},
 	{ } /* terminator */
@@ -1693,50 +1752,42 @@
 
 static int __devinit snd_intel8x0_mixer(intel8x0_t *chip, int ac97_clock)
 {
+	ac97_bus_t bus, *pbus;
 	ac97_t ac97, *x97;
-	ichdev_t *ichdev;
 	int err;
-	unsigned int i, num, codecs, _codecs;
+	unsigned int i, codecs;
 	unsigned int glob_sta = 0;
-	struct _ac97_rate_regs *tbl;
 	int spdif_idx = -1; /* disabled */
 
 	switch (chip->device_type) {
 	case DEVICE_NFORCE:
-		tbl = nforce_ac97_rate_regs;
 		spdif_idx = NVD_SPBAR;
 		break;
 	case DEVICE_ALI:
-		tbl = ali_ac97_rate_regs;
 		spdif_idx = ALID_AC97SPDIFOUT;
 		break;
 	default:
-		tbl = intel_ac97_rate_regs;
 		if (chip->device_type == DEVICE_INTEL_ICH4)
 			spdif_idx = ICHD_SPBAR;
 		break;
 	};
-	for (i = 0; i < chip->bdbars_count; i++) {
-		struct _ac97_rate_regs *aregs = tbl + i;
-		ichdev = &chip->ichd[aregs->ichd];
-		ichdev->ac97_rate_regs[0] = aregs->regs[0];
-		ichdev->ac97_rate_regs[1] = aregs->regs[1];
-		ichdev->ac97_rate_regs[2] = aregs->regs[2];
-		ichdev->ac97_rates_idx = aregs->rates_idx;
-	}
 
 	chip->in_ac97_init = 1;
+	memset(&bus, 0, sizeof(bus));
+	bus.private_data = chip;
+	bus.private_free = snd_intel8x0_mixer_free_ac97_bus;
+	if (ac97_clock >= 8000 && ac97_clock <= 48000)
+		bus.clock = ac97_clock;
+	else
+		bus.clock = 48000;
+	
 	memset(&ac97, 0, sizeof(ac97));
 	ac97.private_data = chip;
 	ac97.private_free = snd_intel8x0_mixer_free_ac97;
-	if (ac97_clock >= 8000 && ac97_clock <= 48000)
-		ac97.clock = ac97_clock;
-	else
-		ac97.clock = 48000;
 	if (chip->device_type != DEVICE_ALI) {
 		glob_sta = igetdword(chip, ICHREG(GLOB_STA));
-		ac97.write = snd_intel8x0_codec_write;
-		ac97.read = snd_intel8x0_codec_read;
+		bus.write = snd_intel8x0_codec_write;
+		bus.read = snd_intel8x0_codec_read;
 		if (chip->device_type == DEVICE_INTEL_ICH4) {
 			codecs = 0;
 			if (glob_sta & ICH_PCR)
@@ -1756,9 +1807,10 @@
 		} else {
 			codecs = glob_sta & ICH_SCR ? 2 : 1;
 		}
+		bus.vra = 1;
 	} else {
-		ac97.write = snd_intel8x0_ali_codec_write;
-		ac97.read = snd_intel8x0_ali_codec_read;
+		bus.write = snd_intel8x0_ali_codec_write;
+		bus.read = snd_intel8x0_ali_codec_read;
 		codecs = 1;
 		/* detect the secondary codec */
 		for (i = 0; i < 100; i++) {
@@ -1770,144 +1822,82 @@
 			iputdword(chip, ICHREG(ALI_RTSR), reg | 0x40);
 			udelay(1);
 		}
+		/* FIXME: my test board doens't work well with VRA... */
+		bus.vra = 0;
 	}
+	if ((err = snd_ac97_bus(chip->card, &bus, &pbus)) < 0)
+		goto __err;
+	chip->ac97_bus = pbus;
 	ac97.pci = chip->pci;
-	if ((err = snd_ac97_mixer(chip->card, &ac97, &x97)) < 0) {
-		/* clear the cold-reset bit for the next chance */
-		if (chip->device_type != DEVICE_ALI)
-			iputdword(chip, ICHREG(GLOB_CNT), igetdword(chip, ICHREG(GLOB_CNT)) & ~ICH_AC97COLD);
-		return err;
+	for (i = 0; i < codecs; i++) {
+		ac97.num = i;
+		if ((err = snd_ac97_mixer(pbus, &ac97, &x97)) < 0) {
+			snd_printk(KERN_ERR "Unable to initialize codec #%d\n", i);
+			if (i == 0)
+				goto __err;
+			continue;
+		}
+		chip->ac97[i] = x97;
 	}
-	chip->ac97[0] = x97;
 	/* tune up the primary codec */
 	snd_ac97_tune_hardware(chip->ac97[0], ac97_quirks);
-	/* the following three entries are common among all devices */
-	chip->ichd[ICHD_PCMOUT].ac97 = x97;
-	chip->ichd[ICHD_PCMIN].ac97 = x97;
-	if (x97->ext_id & AC97_EI_VRM)
-		chip->ichd[ICHD_MIC].ac97 = x97;
-	/* spdif */
-	if ((x97->ext_id & AC97_EI_SPDIF) && spdif_idx >= 0)
-		chip->ichd[spdif_idx].ac97 = x97;
-	/* make sure, that we have DACs at right slot for rev2.2 */
-	if (ac97_is_rev22(x97))
-		snd_ac97_update_bits(x97, AC97_EXTENDED_ID, AC97_EI_DACS_SLOT_MASK, 0);
-	/* AnalogDevices CNR boards uses special codec chaining */
-	/* skip standard test method for secondary codecs in this case */
-	if (x97->flags & AC97_AD_MULTI)
-		codecs = 1;
-	if (codecs < 2)
-		goto __skip_secondary;
-	for (i = 1, num = 1, _codecs = codecs; num < _codecs; num++) {
-		ac97.num = num;
-		if ((err = snd_ac97_mixer(chip->card, &ac97, &x97)) < 0) {
-			snd_printk("Unable to initialize codec #%i [device = %i, GLOB_STA = 0x%x]\n", i, chip->device_type, glob_sta);
-			codecs--;
-			continue;
-		}
-		chip->ac97[i++] = x97;
-		if (!ac97_is_audio(x97))
-			continue;
-		switch (chip->device_type) {
-		case DEVICE_INTEL_ICH4:
-			if (chip->ichd[ICHD_PCM2IN].ac97 == NULL)
-				chip->ichd[ICHD_PCM2IN].ac97 = x97;
-			if (x97->ext_id & AC97_EI_VRM) {
-				if (chip->ichd[ICHD_MIC].ac97 == NULL)
-					chip->ichd[ICHD_MIC].ac97 = x97;
-				else if (chip->ichd[ICHD_MIC2].ac97 == NULL &&
-					 chip->ichd[ICHD_PCM2IN].ac97 == x97)
-					chip->ichd[ICHD_MIC2].ac97 = x97;
-			}
-			break;
-		default:
-			if (x97->ext_id & AC97_EI_VRM) {
-				if (chip->ichd[ICHD_MIC].ac97 == NULL)
-					chip->ichd[ICHD_MIC].ac97 = x97;
-			}
-			break;
-		}
-		if ((x97->ext_id & AC97_EI_SPDIF) && spdif_idx >= 0) {
-			if (chip->ichd[spdif_idx].ac97 == NULL)
-				chip->ichd[spdif_idx].ac97 = x97;
-		}
+	/* enable separate SDINs for ICH4 */
+	if (chip->device_type == DEVICE_INTEL_ICH4)
+		pbus->isdin = 1;
+	/* find the available PCM streams */
+	i = ARRAY_SIZE(ac97_pcm_defs);
+	if (chip->device_type != DEVICE_INTEL_ICH4)
+		i -= 2;		/* do not allocate PCM2IN and MIC2 */
+	if (spdif_idx < 0)
+		i--;		/* do not allocate S/PDIF */
+	err = snd_ac97_pcm_assign(pbus, i, ac97_pcm_defs);
+	if (err < 0)
+		goto __err;
+	chip->ichd[ICHD_PCMOUT].pcm = &pbus->pcms[0];
+	chip->ichd[ICHD_PCMIN].pcm = &pbus->pcms[1];
+	chip->ichd[ICHD_MIC].pcm = &pbus->pcms[2];
+	if (spdif_idx >= 0)
+		chip->ichd[spdif_idx].pcm = &pbus->pcms[3];
+	if (chip->device_type == DEVICE_INTEL_ICH4) {
+		chip->ichd[ICHD_PCM2IN].pcm = &pbus->pcms[4];
+		chip->ichd[ICHD_MIC2].pcm = &pbus->pcms[5];
 	}
-	
-      __skip_secondary:
+	/* enable separate SDINs for ICH4 */
 	if (chip->device_type == DEVICE_INTEL_ICH4) {
+		struct ac97_pcm *pcm = chip->ichd[ICHD_PCM2IN].pcm;
 		u8 tmp = igetbyte(chip, ICHREG(SDM));
 		tmp &= ~(ICH_DI2L_MASK|ICH_DI1L_MASK);
-		if (chip->ichd[ICHD_PCM2IN].ac97) {
+		if (pcm) {
 			tmp |= ICH_SE;	/* steer enable for multiple SDINs */
 			tmp |= chip->ac97_sdin[0] << ICH_DI1L_SHIFT;
-			tmp |= chip->ac97_sdin[chip->ichd[ICHD_PCM2IN].ac97->num] << ICH_DI2L_SHIFT;
+			for (i = 1; i < 4; i++) {
+				if (pcm->r[0].codec[i]) {
+					tmp |= chip->ac97_sdin[pcm->r[0].codec[1]->num] << ICH_DI2L_SHIFT;
+					break;
+				}
+			}
 		} else {
-			tmp &= ~ICH_SE;
+			tmp &= ~ICH_SE; /* steer disable */
 		}
 		iputbyte(chip, ICHREG(SDM), tmp);
 	}
-      	for (i = 0; i < codecs; i++) {
-		x97 = chip->ac97[i];
-		if (!ac97_is_audio(x97))
-			continue;
-		if (x97->scaps & AC97_SCAP_SURROUND_DAC)
-			chip->multi4 = 1;
-	}
-      	for (i = 0; i < codecs && chip->multi4; i++) {
-		x97 = chip->ac97[i];
-		if (!ac97_is_audio(x97))
-			continue;
-		if (x97->scaps & AC97_SCAP_CENTER_LFE_DAC)
+	if (pbus->pcms[0].r[0].slots & (1 << AC97_SLOT_PCM_SLEFT)) {
+		chip->multi4 = 1;
+		if (pbus->pcms[0].r[0].slots & (1 << AC97_SLOT_LFE))
 			chip->multi6 = 1;
 	}
-	if (chip->device_type == DEVICE_ALI && chip->ac97[1]) {
-		/* set secondary codec id */
-		iputdword(chip, ICHREG(ALI_SSR),
-			  (igetdword(chip, ICHREG(ALI_SSR)) & ~ICH_ALI_SS_SEC_ID) |
-			  (chip->ac97[1]->addr << 5));
-	}
-	if (codecs > 1 && !chip->multi6) {
-		/* assign right slots for rev2.2 codecs */
-		i = 1;
-		for ( ; i < codecs && !chip->multi4; i++) {
-			x97 = chip->ac97[i];
-			if (!ac97_is_audio(x97))
-				continue;
-			if (ac97_is_rev22(x97)) {
-				snd_ac97_update_bits(x97, AC97_EXTENDED_ID, AC97_EI_DACS_SLOT_MASK, 1);
-				chip->multi4 = 1;
-			}
-		}
-		for ( ; i < codecs && chip->multi4; i++) {
-			x97 = chip->ac97[i];
-			if (!ac97_is_audio(x97))
-				continue;
-			if (ac97_is_rev22(x97)) {
-				snd_ac97_update_bits(x97, AC97_EXTENDED_ID, AC97_EI_DACS_SLOT_MASK, 2);
-				chip->multi6 = 1;
-				break;
-			}
-		}
-		/* ok, some older codecs might support only AMAP */
-		if (!chip->multi4) {
-			int cnums = 0;
-			for (i = 1; i < codecs; i++) {
-				x97 = chip->ac97[i];
-				if (!ac97_is_audio(x97))
-					continue;
-				if (ac97_can_amap(x97)) {
-					if (x97->addr > 0)
-						cnums++;
-				}
-			}
-			if (cnums >= 2)
-				chip->multi6 = 1;
-			if (cnums >= 1)
-				chip->multi4 = 1;
-		}
+	if (chip->device_type == DEVICE_NFORCE) {
+		/* 48kHz only */
+		chip->ichd[spdif_idx].pcm->rates = SNDRV_PCM_RATE_48000;
 	}
 	chip->in_ac97_init = 0;
 	return 0;
+
+ __err:
+	/* clear the cold-reset bit for the next chance */
+	if (chip->device_type != DEVICE_ALI)
+		iputdword(chip, ICHREG(GLOB_CNT), igetdword(chip, ICHREG(GLOB_CNT)) & ~ICH_AC97COLD);
+	return err;
 }
 
 
@@ -2107,8 +2097,11 @@
 	/* --- */
 	synchronize_irq(chip->irq);
       __hw_end:
-	if (chip->bdbars)
+	if (chip->bdbars) {
+		if (chip->fix_nocache)
+			fill_nocache(chip->bdbars, chip->bdbars_count * sizeof(u32) * ICH_MAX_FRAGS * 2, 0);
 		snd_free_pci_pages(chip->pci, chip->bdbars_count * sizeof(u32) * ICH_MAX_FRAGS * 2, chip->bdbars, chip->bdbars_addr);
+	}
 	if (chip->remap_addr)
 		iounmap((void *) chip->remap_addr);
 	if (chip->remap_bmaddr)
@@ -2212,7 +2205,7 @@
 	unsigned long flags;
 	struct timeval start_time, stop_time;
 
-	if (chip->ac97[0]->clock != 48000)
+	if (chip->ac97_bus->clock != 48000)
 		return; /* specified in module option */
 
 	subs = chip->pcm[0]->streams[0].substream;
@@ -2227,7 +2220,7 @@
 
 	/* set rate */
 	if (snd_ac97_set_rate(chip->ac97[0], AC97_PCM_FRONT_DAC_RATE, 48000) < 0) {
-		snd_printk(KERN_ERR "cannot set ac97 rate: clock = %d\n", chip->ac97[0]->clock);
+		snd_printk(KERN_ERR "cannot set ac97 rate: clock = %d\n", chip->ac97_bus->clock);
 		return;
 	}
 	snd_intel8x0_setup_periods(chip, ichdev);
@@ -2271,10 +2264,8 @@
 
 	t = stop_time.tv_sec - start_time.tv_sec;
 	t *= 1000000;
-	if (stop_time.tv_usec < start_time.tv_usec)
-		t -= start_time.tv_usec - stop_time.tv_usec;
-	else
-		t += stop_time.tv_usec - start_time.tv_usec;
+	t += stop_time.tv_usec - start_time.tv_usec;
+	printk(KERN_INFO "%s: measured %lu usecs\n", __FUNCTION__, t);
 	if (t == 0) {
 		snd_printk(KERN_ERR "?? calculation error..\n");
 		return;
@@ -2286,8 +2277,8 @@
 		printk(KERN_INFO "intel8x0: measured clock %ld rejected\n", pos);
 	else if (pos < 47500 || pos > 48500)
 		/* not 48000Hz, tuning the clock.. */
-		chip->ac97[0]->clock = (chip->ac97[0]->clock * 48000) / pos;
-	printk(KERN_INFO "intel8x0: clocking to %d\n", chip->ac97[0]->clock);
+		chip->ac97_bus->clock = (chip->ac97_bus->clock * 48000) / pos;
+	printk(KERN_INFO "intel8x0: clocking to %d\n", chip->ac97_bus->clock);
 }
 
 static void snd_intel8x0_proc_read(snd_info_entry_t * entry,
@@ -2321,7 +2312,7 @@
 	snd_info_entry_t *entry;
 
 	if (! snd_card_proc_new(chip->card, "intel8x0", &entry))
-		snd_info_set_text_ops(entry, chip, snd_intel8x0_proc_read);
+		snd_info_set_text_ops(entry, chip, 1024, snd_intel8x0_proc_read);
 }
 
 static int snd_intel8x0_dev_free(snd_device_t *device)
@@ -2397,6 +2388,9 @@
 	snd_intel8x0_proc_init(chip);
 	sprintf(chip->ac97_name, "%s - AC'97", card->shortname);
 	sprintf(chip->ctrl_name, "%s - Controller", card->shortname);
+	if (pci->vendor == PCI_VENDOR_ID_INTEL &&
+	    pci->device == PCI_DEVICE_ID_INTEL_440MX)
+		chip->fix_nocache = 1; /* enable workaround */
 	if (device_type == DEVICE_ALI) {
 		/* ALI5455 has no ac97 region */
 		chip->bmaddr = pci_resource_start(pci, 0);
@@ -2505,6 +2499,9 @@
 	}
 	/* tables must be aligned to 8 bytes here, but the kernel pages
 	   are much bigger, so we don't care (on i386) */
+	/* workaround for 440MX */
+	if (chip->fix_nocache)
+		fill_nocache(chip->bdbars, chip->bdbars_count * sizeof(u32) * ICH_MAX_FRAGS * 2, 1);
 	int_sta_masks = 0;
 	for (i = 0; i < chip->bdbars_count; i++) {
 		ichdev = &chip->ichd[i];
@@ -2530,6 +2527,8 @@
 		return err;
 	}
 
+	snd_card_set_dev(card, &pci->dev);
+
 	*r_intel8x0 = chip;
 	return 0;
 }
@@ -2591,7 +2590,6 @@
 			break;
 		}
 	}
-	card->dev = &pci->dev;
 
 	if ((err = snd_intel8x0_create(card, pci, pci_id->driver_data, &chip)) < 0) {
 		snd_card_free(card);
@@ -2657,9 +2655,16 @@
  * initialize joystick/midi addresses
  */
 
+#ifdef SUPPORT_JOYSTICK
+/* there is only one available device, so we keep it here */
+static struct pci_dev *ich_gameport_pci;
+static struct gameport ich_gameport = { .io = 0x200 };
+#endif
+
 static int __devinit snd_intel8x0_joystick_probe(struct pci_dev *pci,
 						 const struct pci_device_id *id)
 {
+	u16 val;
 	static int dev;
 	if (dev >= SNDRV_CARDS)
 		return -ENODEV;
@@ -2668,17 +2673,24 @@
 		return -ENOENT;
 	}
 
-	if (joystick_port[dev] > 0 || mpu_port[dev] > 0) {
-		u16 val;
-		pci_read_config_word(pci, 0xe6, &val);
-		if (joystick_port[dev] > 0)
+	pci_read_config_word(pci, 0xe6, &val);
+#ifdef SUPPORT_JOYSTICK
+	if (joystick[dev]) {
+		if (! request_region(ich_gameport.io, 8, "ICH gameport")) {
+			printk(KERN_WARNING "intel8x0: cannot grab gameport 0x%x\n",  ich_gameport.io);
+			joystick[dev] = 0;
+		} else {
+			ich_gameport_pci = pci;
+			gameport_register_port(&ich_gameport);
 			val |= 0x100;
-		if (mpu_port[dev] == 0x300 || mpu_port[dev] == 0x330)
-			val |= 0x20;
-		pci_write_config_word(pci, 0xe6, val | 0x100);
-
+		}
+	}
+#endif
+#ifdef SUPPORT_MIDI
+	if (mpu_port[dev] > 0) {
 		if (mpu_port[dev] == 0x300 || mpu_port[dev] == 0x330) {
 			u8 b;
+			val |= 0x20;
 			pci_read_config_byte(pci, 0xe2, &b);
 			if (mpu_port[dev] == 0x300)
 				b |= 0x08;
@@ -2687,9 +2699,27 @@
 			pci_write_config_byte(pci, 0xe2, b);
 		}
 	}
+#endif
+	pci_write_config_word(pci, 0xe6, val);
 	return 0;
 }
 
+static void __devexit snd_intel8x0_joystick_remove(struct pci_dev *pci)
+{
+	u16 val;
+#ifdef SUPPORT_JOYSTICK
+	if (ich_gameport_pci == pci) {
+		gameport_unregister_port(&ich_gameport);
+		release_region(ich_gameport.io, 8);
+		ich_gameport_pci = NULL;
+	}
+#endif
+	/* disable joystick and MIDI */
+	pci_read_config_word(pci, 0xe6, &val);
+	val &= ~0x120;
+	pci_write_config_word(pci, 0xe6, val);
+}
+
 static struct pci_device_id snd_intel8x0_joystick_ids[] = {
 	{ 0x8086, 0x2410, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },	/* 82801AA */
 	{ 0x8086, 0x2420, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },	/* 82901AB */
@@ -2708,6 +2738,7 @@
 	.name = "Intel ICH Joystick",
 	.id_table = snd_intel8x0_joystick_ids,
 	.probe = snd_intel8x0_joystick_probe,
+	.remove = __devexit_p(snd_intel8x0_joystick_remove),
 };
 
 static int have_joystick;
@@ -2750,7 +2781,7 @@
 
 #ifndef MODULE
 
-/* format is: snd-intel8x0=enable,index,id,ac97_clock */
+/* format is: snd-intel8x0=enable,index,id,ac97_clock,mpu_port,joystick */
 
 static int __init alsa_card_intel8x0_setup(char *str)
 {
@@ -2761,7 +2792,14 @@
 	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
 	       get_option(&str,&index[nr_dev]) == 2 &&
 	       get_id(&str,&id[nr_dev]) == 2 &&
-	       get_option(&str,&ac97_clock[nr_dev]) == 2);
+	       get_option(&str,&ac97_clock[nr_dev]) == 2
+#ifdef SUPPORT_MIDI
+	       && get_option(&str,&mpu_port[nr_dev]) == 2
+#endif
+#ifdef SUPPORT_JOYSTICK
+	       && get_option(&str,&joystick[nr_dev]) == 2
+#endif
+	       );
 	nr_dev++;
 	return 1;
 }
--- diff/sound/pci/korg1212/korg1212.c	2003-08-20 14:16:35.000000000 +0100
+++ source/sound/pci/korg1212/korg1212.c	2004-02-09 10:39:58.000000000 +0000
@@ -2093,7 +2093,7 @@
 	snd_info_entry_t *entry;
 
 	if (! snd_card_proc_new(korg1212->card, "korg1212", &entry))
-		snd_info_set_text_ops(entry, korg1212, snd_korg1212_proc_read);
+		snd_info_set_text_ops(entry, korg1212, 1024, snd_korg1212_proc_read);
 }
 
 static int
@@ -2461,6 +2461,8 @@
                 return err;
         }
         
+	snd_card_set_dev(card, &pci->dev);
+
         * rchip = korg1212;
 	return 0;
 
--- diff/sound/pci/maestro3.c	2003-08-20 14:16:35.000000000 +0100
+++ source/sound/pci/maestro3.c	2004-02-09 10:39:58.000000000 +0000
@@ -1981,14 +1981,19 @@
 
 static int __devinit snd_m3_mixer(m3_t *chip)
 {
+	ac97_bus_t bus, *pbus;
 	ac97_t ac97;
 	int err;
 
+	memset(&bus, 0, sizeof(bus));
+	bus.write = snd_m3_ac97_write;
+	bus.read = snd_m3_ac97_read;
+	if ((err = snd_ac97_bus(chip->card, &bus, &pbus)) < 0)
+		return err;
+	
 	memset(&ac97, 0, sizeof(ac97));
-	ac97.write = snd_m3_ac97_write;
-	ac97.read = snd_m3_ac97_read;
 	ac97.private_data = chip;
-	if ((err = snd_ac97_mixer(chip->card, &ac97, &chip->ac97)) < 0)
+	if ((err = snd_ac97_mixer(pbus, &ac97, &chip->ac97)) < 0)
 		return err;
 
 	/* seems ac97 PCM needs initialization.. hack hack.. */
@@ -2349,7 +2354,8 @@
 {
 	unsigned long io = chip->iobase;
 
-	outw(ASSP_INT_ENABLE | MPU401_INT_ENABLE, io + HOST_INT_CTRL);
+	/* TODO: MPU401 not supported yet */
+	outw(ASSP_INT_ENABLE /*| MPU401_INT_ENABLE*/, io + HOST_INT_CTRL);
 	outb(inb(io + ASSP_CONTROL_C) | ASSP_HOST_INT_ENABLE,
 	     io + ASSP_CONTROL_C);
 }
@@ -2541,11 +2547,11 @@
 		return -EIO;
 
 	/* check, if we can restrict PCI DMA transfers to 28 bits */
-	if (!pci_dma_supported(pci, 0x0fffffff)) {
+	if (pci_set_dma_mask(pci, 0x0fffffff) < 0 ||
+	    pci_set_consistent_dma_mask(pci, 0x0fffffff) < 0) {
 		snd_printk("architecture does not support 28bit PCI busmaster DMA\n");
 		return -ENXIO;
 	}
-	pci_set_dma_mask(pci, 0x0fffffff);
 
 	chip = snd_magic_kcalloc(m3_t, 0, GFP_KERNEL);
 	if (chip == NULL)
@@ -2659,6 +2665,8 @@
 	snd_m3_enable_ints(chip);
 	snd_m3_assp_continue(chip);
 
+	snd_card_set_dev(card, &pci->dev);
+
 	*chip_ret = chip;
 
 	return 0; 
--- diff/sound/pci/nm256/nm256.c	2003-08-20 14:16:35.000000000 +0100
+++ source/sound/pci/nm256/nm256.c	2004-02-09 10:39:58.000000000 +0000
@@ -335,7 +335,7 @@
 		return;
 	}
 #endif
-	memcpy_toio(chip->buffer + offset, src, size);
+	memcpy_toio((void *)chip->buffer + offset, src, size);
 }
 
 /*
@@ -1195,6 +1195,7 @@
 static int __devinit
 snd_nm256_mixer(nm256_t *chip)
 {
+	ac97_bus_t bus, *pbus;
 	ac97_t ac97;
 	int i, err;
 	/* looks like nm256 hangs up when unexpected registers are touched... */
@@ -1208,16 +1209,20 @@
 		-1
 	};
 
+	memset(&bus, 0, sizeof(bus));
+	bus.reset = snd_nm256_ac97_reset;
+	bus.write = snd_nm256_ac97_write;
+	bus.read = snd_nm256_ac97_read;
+	if ((err = snd_ac97_bus(chip->card, &bus, &pbus)) < 0)
+		return err;
+
 	memset(&ac97, 0, sizeof(ac97));
-	ac97.reset = snd_nm256_ac97_reset;
-	ac97.write = snd_nm256_ac97_write;
-	ac97.read = snd_nm256_ac97_read;
 	ac97.scaps = AC97_SCAP_AUDIO; /* we support audio! */
 	ac97.limited_regs = 1;
 	for (i = 0; mixer_regs[i] >= 0; i++)
 		set_bit(mixer_regs[i], ac97.reg_accessed);
 	ac97.private_data = chip;
-	err = snd_ac97_mixer(chip->card, &ac97, &chip->ac97);
+	err = snd_ac97_mixer(pbus, &ac97, &chip->ac97);
 	if (err < 0)
 		return err;
 	if (! (chip->ac97->id & (0xf0000000))) {
@@ -1555,6 +1560,8 @@
 	if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0)
 		goto __error;
 
+	snd_card_set_dev(card, &pci->dev);
+
 	*chip_ret = chip;
 	return 0;
 
--- diff/sound/pci/rme32.c	2003-08-26 10:00:55.000000000 +0100
+++ source/sound/pci/rme32.c	2004-02-09 10:39:58.000000000 +0000
@@ -1191,18 +1191,18 @@
 		}
 		bytes = diff << rme32->playback_frlog;
 		if (bytes > RME32_BUFFER_SIZE - rme32->playback_ptr) {
-			memcpy_toio(rme32->iobase + RME32_IO_DATA_BUFFER + rme32->playback_ptr,
+			memcpy_toio((void *)(rme32->iobase + RME32_IO_DATA_BUFFER + rme32->playback_ptr),
 				    runtime->dma_area + rme32->playback_ptr,
 				    RME32_BUFFER_SIZE - rme32->playback_ptr);
 			bytes -= RME32_BUFFER_SIZE - rme32->playback_ptr;
 			if (bytes > RME32_BUFFER_SIZE) {
 				bytes = RME32_BUFFER_SIZE;
 			}
-			memcpy_toio(rme32->iobase + RME32_IO_DATA_BUFFER,
+			memcpy_toio((void *)(rme32->iobase + RME32_IO_DATA_BUFFER),
 				    runtime->dma_area, bytes);
 			rme32->playback_ptr = bytes;
 		} else if (bytes != 0) {
-			memcpy_toio(rme32->iobase + RME32_IO_DATA_BUFFER + rme32->playback_ptr,
+			memcpy_toio((void *)(rme32->iobase + RME32_IO_DATA_BUFFER + rme32->playback_ptr),
 				    runtime->dma_area + rme32->playback_ptr, bytes);
 			rme32->playback_ptr += bytes;
 		}
@@ -1223,17 +1223,17 @@
 		ptr = frameptr << rme32->capture_frlog;
 		if (ptr > rme32->capture_ptr) {
 			memcpy_fromio(runtime->dma_area + rme32->capture_ptr,
-				      rme32->iobase + RME32_IO_DATA_BUFFER +
-				      rme32->capture_ptr,
+				      (void *)(rme32->iobase + RME32_IO_DATA_BUFFER +
+					       rme32->capture_ptr),
 				      ptr - rme32->capture_ptr);
 			rme32->capture_ptr += ptr - rme32->capture_ptr;
 		} else if (ptr < rme32->capture_ptr) {
 			memcpy_fromio(runtime->dma_area + rme32->capture_ptr,
-				      rme32->iobase + RME32_IO_DATA_BUFFER +
-				      rme32->capture_ptr,
+				      (void *)(rme32->iobase + RME32_IO_DATA_BUFFER +
+					       rme32->capture_ptr),
 				      RME32_BUFFER_SIZE - rme32->capture_ptr);
 			memcpy_fromio(runtime->dma_area,
-				      rme32->iobase + RME32_IO_DATA_BUFFER,
+				      (void *)(rme32->iobase + RME32_IO_DATA_BUFFER),
 				      ptr);
 			rme32->capture_ptr = ptr;
 		}
@@ -1545,7 +1545,7 @@
 	snd_info_entry_t *entry;
 
 	if (! snd_card_proc_new(rme32->card, "rme32", &entry))
-		snd_info_set_text_ops(entry, rme32, snd_rme32_proc_read);
+		snd_info_set_text_ops(entry, rme32, 1024, snd_rme32_proc_read);
 }
 
 /*
@@ -1948,6 +1948,7 @@
 	rme32 = (rme32_t *) card->private_data;
 	rme32->card = card;
 	rme32->pci = pci;
+	snd_card_set_dev(card, &pci->dev);
 	if ((err = snd_rme32_create(rme32)) < 0) {
 		snd_card_free(card);
 		return err;
--- diff/sound/pci/rme96.c	2003-08-20 14:16:36.000000000 +0100
+++ source/sound/pci/rme96.c	2004-02-09 10:39:58.000000000 +0000
@@ -1524,21 +1524,21 @@
 		bytes = diff << rme96->playback_frlog;
 		
 		if (bytes > RME96_BUFFER_SIZE - rme96->playback_ptr) {
-			memcpy_toio(rme96->iobase + RME96_IO_PLAY_BUFFER +
-				    rme96->playback_ptr,
+			memcpy_toio((void *)(rme96->iobase + RME96_IO_PLAY_BUFFER +
+					     rme96->playback_ptr),
 				    runtime->dma_area + rme96->playback_ptr,
 				    RME96_BUFFER_SIZE - rme96->playback_ptr);
 		        bytes -= RME96_BUFFER_SIZE - rme96->playback_ptr;
 			if (bytes > RME96_BUFFER_SIZE) {
 			        bytes = RME96_BUFFER_SIZE;
 			}
-			memcpy_toio(rme96->iobase + RME96_IO_PLAY_BUFFER,
+			memcpy_toio((void *)(rme96->iobase + RME96_IO_PLAY_BUFFER),
 				    runtime->dma_area,
 				    bytes);
 			rme96->playback_ptr = bytes;
 		} else if (bytes != 0) {
-			memcpy_toio(rme96->iobase + RME96_IO_PLAY_BUFFER +
-				    rme96->playback_ptr,
+			memcpy_toio((void *)(rme96->iobase + RME96_IO_PLAY_BUFFER +
+					     rme96->playback_ptr),
 				    runtime->dma_area + rme96->playback_ptr,
 				    bytes);
 			rme96->playback_ptr += bytes;
@@ -1560,17 +1560,17 @@
 		ptr = frameptr << rme96->capture_frlog;
 		if (ptr > rme96->capture_ptr) {
 			memcpy_fromio(runtime->dma_area + rme96->capture_ptr,
-				      rme96->iobase + RME96_IO_REC_BUFFER +
-				      rme96->capture_ptr,
+				      (void *)(rme96->iobase + RME96_IO_REC_BUFFER +
+					       rme96->capture_ptr),
 				      ptr - rme96->capture_ptr);
 			rme96->capture_ptr += ptr - rme96->capture_ptr;
 		} else if (ptr < rme96->capture_ptr) {
 			memcpy_fromio(runtime->dma_area + rme96->capture_ptr,
-				      rme96->iobase + RME96_IO_REC_BUFFER +
-				      rme96->capture_ptr,
+				      (void *)(rme96->iobase + RME96_IO_REC_BUFFER +
+					       rme96->capture_ptr),
 				      RME96_BUFFER_SIZE - rme96->capture_ptr);
 			memcpy_fromio(runtime->dma_area,
-				      rme96->iobase + RME96_IO_REC_BUFFER,
+				      (void *)(rme96->iobase + RME96_IO_REC_BUFFER),
 				      ptr);
 			rme96->capture_ptr = ptr;
 		}
@@ -1930,7 +1930,7 @@
 	snd_info_entry_t *entry;
 
 	if (! snd_card_proc_new(rme96->card, "rme96", &entry))
-		snd_info_set_text_ops(entry, rme96, snd_rme96_proc_read);
+		snd_info_set_text_ops(entry, rme96, 1024, snd_rme96_proc_read);
 }
 
 /*
@@ -2504,6 +2504,7 @@
 	rme96 = (rme96_t *)card->private_data;	
 	rme96->card = card;
 	rme96->pci = pci;
+	snd_card_set_dev(card, &pci->dev);
 	if ((err = snd_rme96_create(rme96)) < 0) {
 		snd_card_free(card);
 		return err;
--- diff/sound/pci/rme9652/hdsp.c	2003-09-30 15:46:21.000000000 +0100
+++ source/sound/pci/rme9652/hdsp.c	2004-02-09 10:39:58.000000000 +0000
@@ -69,15 +69,24 @@
 MODULE_LICENSE("GPL");
 MODULE_CLASSES("{sound}");
 MODULE_DEVICES("{{RME Hammerfall-DSP},"
-	        "{RME HDSP-9652}}");
+	        "{RME HDSP-9652},"
+		"{RME HDSP-9632}}");
 
 #define HDSP_MAX_CHANNELS        26
+#define HDSP_MAX_DS_CHANNELS     14
+#define HDSP_MAX_QS_CHANNELS     8
 #define DIGIFACE_SS_CHANNELS     26
 #define DIGIFACE_DS_CHANNELS     14
 #define MULTIFACE_SS_CHANNELS    18
 #define MULTIFACE_DS_CHANNELS    14
 #define H9652_SS_CHANNELS        26
 #define H9652_DS_CHANNELS        14
+/* This does not include possible Analog Extension Boards
+   AEBs are detected at card initialization
+*/
+#define H9632_SS_CHANNELS	 12
+#define H9632_DS_CHANNELS	 8
+#define H9632_QS_CHANNELS	 4
 
 /* Write registers. These are defined as byte-offsets from the iobase value.
  */
@@ -121,7 +130,21 @@
 #define HDSP_playbackRmsLevel   4612  /* 26 * 64 bit values */
 #define HDSP_inputRmsLevel      4868  /* 26 * 64 bit values */
 
-#define HDSP_IO_EXTENT     5192
+
+/* This is for H9652 cards
+   Peak values are read downward from the base
+   Rms values are read upward
+   There are rms values for the outputs too
+   26*3 values are read in ss mode
+   14*3 in ds mode, with no gap between values
+*/
+#define HDSP_9652_peakBase	7164	
+#define HDSP_9652_rmsBase	4096
+
+/* c.f. the hdsp_9632_meters_t struct */
+#define HDSP_9632_metersBase	4096
+
+#define HDSP_IO_EXTENT     7168
 
 /* control2 register bits */
 
@@ -137,6 +160,7 @@
 #define HDSP_BIGENDIAN_MODE     0x200
 #define HDSP_RD_MULTIPLE        0x400
 #define HDSP_9652_ENABLE_MIXER  0x800
+#define HDSP_TDO                0x10000000
 
 #define HDSP_S_PROGRAM     	(HDSP_PROGRAM|HDSP_CONFIG_MODE_0)
 #define HDSP_S_LOAD		(HDSP_PROGRAM|HDSP_CONFIG_MODE_1)
@@ -146,11 +170,11 @@
 #define HDSP_Start                (1<<0)  /* start engine */
 #define HDSP_Latency0             (1<<1)  /* buffer size = 2^n where n is defined by Latency{2,1,0} */
 #define HDSP_Latency1             (1<<2)  /* [ see above ] */
-#define HDSP_Latency2             (1<<3)  /* ] see above ] */
+#define HDSP_Latency2             (1<<3)  /* [ see above ] */
 #define HDSP_ClockModeMaster      (1<<4)  /* 1=Master, 0=Slave/Autosync */
 #define HDSP_AudioInterruptEnable (1<<5)  /* what do you think ? */
-#define HDSP_Frequency0           (1<<6)  /* 0=44.1kHz/88.2kHz 1=48kHz/96kHz */
-#define HDSP_Frequency1           (1<<7)  /* 0=32kHz/64kHz */
+#define HDSP_Frequency0           (1<<6)  /* 0=44.1kHz/88.2kHz/176.4kHz 1=48kHz/96kHz/192kHz */
+#define HDSP_Frequency1           (1<<7)  /* 0=32kHz/64kHz/128kHz */
 #define HDSP_DoubleSpeed          (1<<8)  /* 0=normal speed, 1=double speed */
 #define HDSP_SPDIFProfessional    (1<<9)  /* 0=consumer, 1=professional */
 #define HDSP_SPDIFEmphasis        (1<<10) /* 0=none, 1=on */
@@ -160,21 +184,46 @@
 #define HDSP_SPDIFInputSelect0    (1<<14) 
 #define HDSP_SPDIFInputSelect1    (1<<15) 
 #define HDSP_SyncRef0             (1<<16) 
-#define HDSP_SyncRef1             (1<<17) 
+#define HDSP_SyncRef1             (1<<17)
+#define HDSP_AnalogExtensionBoard (1<<18) /* For H9632 cards */ 
+#define HDSP_XLRBreakoutCable     (1<<20) /* For H9632 cards */
 #define HDSP_Midi0InterruptEnable (1<<22)
 #define HDSP_Midi1InterruptEnable (1<<23)
 #define HDSP_LineOut              (1<<24)
+#define HDSP_ADGain0		  (1<<25) /* From here : H9632 specific */
+#define HDSP_ADGain1		  (1<<26)
+#define HDSP_DAGain0		  (1<<27)
+#define HDSP_DAGain1		  (1<<28)
+#define HDSP_PhoneGain0		  (1<<29)
+#define HDSP_PhoneGain1		  (1<<30)
+#define HDSP_QuadSpeed	  	  (1<<31)
+
+#define HDSP_ADGainMask       (HDSP_ADGain0|HDSP_ADGain1)
+#define HDSP_ADGainMinus10dBV  HDSP_ADGainMask
+#define HDSP_ADGainPlus4dBu   (HDSP_ADGain0)
+#define HDSP_ADGainLowGain     0
+
+#define HDSP_DAGainMask         (HDSP_DAGain0|HDSP_DAGain1)
+#define HDSP_DAGainHighGain      HDSP_DAGainMask
+#define HDSP_DAGainPlus4dBu     (HDSP_DAGain0)
+#define HDSP_DAGainMinus10dBV    0
+
+#define HDSP_PhoneGainMask      (HDSP_PhoneGain0|HDSP_PhoneGain1)
+#define HDSP_PhoneGain0dB        HDSP_PhoneGainMask
+#define HDSP_PhoneGainMinus6dB  (HDSP_PhoneGain0)
+#define HDSP_PhoneGainMinus12dB  0
 
 #define HDSP_LatencyMask    (HDSP_Latency0|HDSP_Latency1|HDSP_Latency2)
-#define HDSP_FrequencyMask  (HDSP_Frequency0|HDSP_Frequency1|HDSP_DoubleSpeed)
+#define HDSP_FrequencyMask  (HDSP_Frequency0|HDSP_Frequency1|HDSP_DoubleSpeed|HDSP_QuadSpeed)
 
 #define HDSP_SPDIFInputMask    (HDSP_SPDIFInputSelect0|HDSP_SPDIFInputSelect1)
 #define HDSP_SPDIFInputADAT1    0
-#define HDSP_SPDIFInputCoaxial (HDSP_SPDIFInputSelect1)
-#define HDSP_SPDIFInputCDROM   (HDSP_SPDIFInputSelect0|HDSP_SPDIFInputSelect1)
+#define HDSP_SPDIFInputCoaxial (HDSP_SPDIFInputSelect0)
+#define HDSP_SPDIFInputCdrom   (HDSP_SPDIFInputSelect1)
+#define HDSP_SPDIFInputAES     (HDSP_SPDIFInputSelect0|HDSP_SPDIFInputSelect1)
 
 #define HDSP_SyncRefMask        (HDSP_SyncRef0|HDSP_SyncRef1|HDSP_SyncRef2)
-#define HDSP_SyncRef_ADAT1      0
+#define HDSP_SyncRef_ADAT1       0
 #define HDSP_SyncRef_ADAT2      (HDSP_SyncRef0)
 #define HDSP_SyncRef_ADAT3      (HDSP_SyncRef1)
 #define HDSP_SyncRef_SPDIF      (HDSP_SyncRef0|HDSP_SyncRef1)
@@ -183,20 +232,23 @@
 
 /* Sample Clock Sources */
 
-#define HDSP_CLOCK_SOURCE_AUTOSYNC         0
-#define HDSP_CLOCK_SOURCE_INTERNAL_32KHZ   1
-#define HDSP_CLOCK_SOURCE_INTERNAL_44_1KHZ 2
-#define HDSP_CLOCK_SOURCE_INTERNAL_48KHZ   3
-#define HDSP_CLOCK_SOURCE_INTERNAL_64KHZ   4
-#define HDSP_CLOCK_SOURCE_INTERNAL_88_2KHZ 5
-#define HDSP_CLOCK_SOURCE_INTERNAL_96KHZ   6
+#define HDSP_CLOCK_SOURCE_AUTOSYNC           0
+#define HDSP_CLOCK_SOURCE_INTERNAL_32KHZ     1
+#define HDSP_CLOCK_SOURCE_INTERNAL_44_1KHZ   2
+#define HDSP_CLOCK_SOURCE_INTERNAL_48KHZ     3
+#define HDSP_CLOCK_SOURCE_INTERNAL_64KHZ     4
+#define HDSP_CLOCK_SOURCE_INTERNAL_88_2KHZ   5
+#define HDSP_CLOCK_SOURCE_INTERNAL_96KHZ     6
+#define HDSP_CLOCK_SOURCE_INTERNAL_128KHZ    7
+#define HDSP_CLOCK_SOURCE_INTERNAL_176_4KHZ  8
+#define HDSP_CLOCK_SOURCE_INTERNAL_192KHZ    9
 
 /* Preferred sync reference choices - used by "pref_sync_ref" control switch */
 
 #define HDSP_SYNC_FROM_WORD      0
-#define HDSP_SYNC_FROM_ADAT_SYNC 1
-#define HDSP_SYNC_FROM_SPDIF     2
-#define HDSP_SYNC_FROM_ADAT1     3
+#define HDSP_SYNC_FROM_SPDIF     1
+#define HDSP_SYNC_FROM_ADAT1     2
+#define HDSP_SYNC_FROM_ADAT_SYNC 3
 #define HDSP_SYNC_FROM_ADAT2     4
 #define HDSP_SYNC_FROM_ADAT3     5
 
@@ -218,16 +270,21 @@
 
 /* Possible sources of S/PDIF input */
 
-#define HDSP_SPDIFIN_OPTICAL 0	/* optical  (ADAT1) */
-#define HDSP_SPDIFIN_COAXIAL 1	/* coaxial  (RCA) */
-#define HDSP_SPDIFIN_INTERN  2	/* internal (CDROM) */
+#define HDSP_SPDIFIN_OPTICAL  0	/* optical  (ADAT1) */
+#define HDSP_SPDIFIN_COAXIAL  1	/* coaxial (RCA) */
+#define HDSP_SPDIFIN_INTERNAL 2	/* internal (CDROM) */
+#define HDSP_SPDIFIN_AES      3 /* xlr for H9632 (AES)*/
 
 #define HDSP_Frequency32KHz    HDSP_Frequency0
 #define HDSP_Frequency44_1KHz  HDSP_Frequency1
-#define HDSP_Frequency48KHz   (HDSP_Frequency1|HDSP_Frequency0)
-#define HDSP_Frequency64KHz   (HDSP_DoubleSpeed|HDSP_Frequency0)
-#define HDSP_Frequency88_2KHz (HDSP_DoubleSpeed|HDSP_Frequency1)
-#define HDSP_Frequency96KHz   (HDSP_DoubleSpeed|HDSP_Frequency1|HDSP_Frequency0)
+#define HDSP_Frequency48KHz    (HDSP_Frequency1|HDSP_Frequency0)
+#define HDSP_Frequency64KHz    (HDSP_DoubleSpeed|HDSP_Frequency0)
+#define HDSP_Frequency88_2KHz  (HDSP_DoubleSpeed|HDSP_Frequency1)
+#define HDSP_Frequency96KHz    (HDSP_DoubleSpeed|HDSP_Frequency1|HDSP_Frequency0)
+/* For H9632 cards */
+#define HDSP_Frequency128KHz   (HDSP_QuadSpeed|HDSP_DoubleSpeed|HDSP_Frequency0)
+#define HDSP_Frequency176_4KHz (HDSP_QuadSpeed|HDSP_DoubleSpeed|HDSP_Frequency1)
+#define HDSP_Frequency192KHz   (HDSP_QuadSpeed|HDSP_DoubleSpeed|HDSP_Frequency1|HDSP_Frequency0)
 
 #define hdsp_encode_latency(x)       (((x)<<1) & HDSP_LatencyMask)
 #define hdsp_decode_latency(x)       (((x) & HDSP_LatencyMask)>>1)
@@ -238,7 +295,8 @@
 /* Status Register bits */
 
 #define HDSP_audioIRQPending    (1<<0)
-#define HDSP_Lock2              (1<<1)
+#define HDSP_Lock2              (1<<1)     /* this is for Digiface and H9652 */
+#define HDSP_spdifFrequency3	HDSP_Lock2 /* this is for H9632 only */
 #define HDSP_Lock1              (1<<2)
 #define HDSP_Lock0              (1<<3)
 #define HDSP_SPDIFSync          (1<<4)
@@ -256,8 +314,9 @@
 #define HDSP_SPDIFErrorFlag     (1<<25)
 #define HDSP_BufferID           (1<<26)
 #define HDSP_TimecodeSync       (1<<27)
-#define HDSP_CIN                (1<<28)
-#define HDSP_midi0IRQPending    (1<<30) /* notice the gap at bit 29 */
+#define HDSP_AEBO          	(1<<28) /* H9632 specific Analog Extension Boards */
+#define HDSP_AEBI		(1<<29) /* 0 = present, 1 = absent */
+#define HDSP_midi0IRQPending    (1<<30) 
 #define HDSP_midi1IRQPending    (1<<31)
 
 #define HDSP_spdifFrequencyMask    (HDSP_spdifFrequency0|HDSP_spdifFrequency1|HDSP_spdifFrequency2)
@@ -270,6 +329,11 @@
 #define HDSP_spdifFrequency88_2KHz (HDSP_spdifFrequency0|HDSP_spdifFrequency2)
 #define HDSP_spdifFrequency96KHz   (HDSP_spdifFrequency2|HDSP_spdifFrequency1)
 
+/* This is for H9632 cards */
+#define HDSP_spdifFrequency128KHz   HDSP_spdifFrequencyMask
+#define HDSP_spdifFrequency176_4KHz HDSP_spdifFrequency3
+#define HDSP_spdifFrequency192KHz   (HDSP_spdifFrequency3|HDSP_spdifFrequency0)
+
 /* Status2 Register bits */
 
 #define HDSP_version0     (1<<0)
@@ -293,6 +357,7 @@
 #define HDSP_systemFrequency64   (HDSP_inp_freq2)
 #define HDSP_systemFrequency88_2 (HDSP_inp_freq0|HDSP_inp_freq2)
 #define HDSP_systemFrequency96   (HDSP_inp_freq1|HDSP_inp_freq2)
+/* FIXME : more values for 9632 cards ? */
 
 #define HDSP_SelSyncRefMask        (HDSP_SelSyncRef0|HDSP_SelSyncRef1|HDSP_SelSyncRef2)
 #define HDSP_SelSyncRef_ADAT1      0
@@ -340,8 +405,25 @@
 #define HDSP_DMA_AREA_BYTES ((HDSP_MAX_CHANNELS+1) * HDSP_CHANNEL_BUFFER_BYTES)
 #define HDSP_DMA_AREA_KILOBYTES (HDSP_DMA_AREA_BYTES/1024)
 
-typedef struct _hdsp          hdsp_t;
-typedef struct _hdsp_midi     hdsp_midi_t;
+typedef struct _hdsp             hdsp_t;
+typedef struct _hdsp_midi        hdsp_midi_t;
+typedef struct _hdsp_9632_meters hdsp_9632_meters_t;
+
+struct _hdsp_9632_meters {
+    u32 input_peak[16];
+    u32 playback_peak[16];
+    u32 output_peak[16];
+    u32 xxx_peak[16];
+    u32 padding[64];
+    u32 input_rms_low[16];
+    u32 playback_rms_low[16];
+    u32 output_rms_low[16];
+    u32 xxx_rms_low[16];
+    u32 input_rms_high[16];
+    u32 playback_rms_high[16];
+    u32 output_rms_high[16];
+    u32 xxx_rms_high[16];
+};
 
 struct _hdsp_midi {
     hdsp_t                  *hdsp;
@@ -372,8 +454,13 @@
 	unsigned short	      state;		     /* stores state bits */
 	u32		      firmware_cache[24413]; /* this helps recover from accidental iobox power failure */
 	size_t                period_bytes; 	     /* guess what this is */
-	unsigned char         ds_channels;
-	unsigned char         ss_channels;	    /* different for multiface/digiface */
+	unsigned char	      max_channels;
+	unsigned char	      qs_in_channels;	     /* quad speed mode for H9632 */
+	unsigned char         ds_in_channels;
+	unsigned char         ss_in_channels;	    /* different for multiface/digiface */
+	unsigned char	      qs_out_channels;	    
+	unsigned char         ds_out_channels;
+	unsigned char         ss_out_channels;
 	void                 *capture_buffer_unaligned;	 /* original buffer addresses */
 	void                 *playback_buffer_unaligned; /* original buffer addresses */
 	unsigned char        *capture_buffer;	    /* suitably aligned address */
@@ -384,9 +471,6 @@
 	pid_t                 playback_pid;
 	int                   running;
         int                   passthru;              /* non-zero if doing pass-thru */
-	int                   last_spdif_sample_rate;/* for information reporting */
-	int                   last_external_sample_rate;
-        int                   last_internal_sample_rate;
 	int                   system_sample_rate;
 	char                 *channel_map;
 	int                   dev;
@@ -399,7 +483,6 @@
 	snd_hwdep_t          *hwdep;
 	struct pci_dev       *pci;
 	snd_kcontrol_t       *spdif_ctl;
-	snd_kcontrol_t       *playback_mixer_ctls[HDSP_MAX_CHANNELS];
         unsigned short        mixer_matrix[HDSP_MATRIX_MIXER_SIZE];
 };
 
@@ -423,7 +506,7 @@
 	16, 17, 18, 19, 20, 21, 22, 23, 
 	/* SPDIF */
 	24, 25,
-	-1, -1, -1, -1, -1, -1, -1, -1, 
+	-1, -1, -1, -1, -1, -1, -1, -1
 };
 
 static char channel_map_ds[HDSP_MAX_CHANNELS] = {
@@ -432,7 +515,49 @@
 	/* channels 12 and 13 are S/PDIF */
 	24, 25,
 	/* others don't exist */
-	-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
+	-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
+};
+
+static char channel_map_H9632_ss[HDSP_MAX_CHANNELS] = {
+	/* ADAT channels */
+	0, 1, 2, 3, 4, 5, 6, 7,
+	/* SPDIF */
+	8, 9,
+	/* Analog */
+	10, 11, 
+	/* AO4S-192 and AI4S-192 extension boards */
+	12, 13, 14, 15,
+	/* others don't exist */
+	-1, -1, -1, -1, -1, -1, -1, -1, 
+	-1, -1
+};
+
+static char channel_map_H9632_ds[HDSP_MAX_CHANNELS] = {
+	/* ADAT */
+	1, 3, 5, 7,
+	/* SPDIF */
+	8, 9,
+	/* Analog */
+	10, 11, 
+	/* AO4S-192 and AI4S-192 extension boards */
+	12, 13, 14, 15,
+	/* others don't exist */
+	-1, -1, -1, -1, -1, -1, -1, -1,
+	-1, -1, -1, -1, -1, -1
+};
+
+static char channel_map_H9632_qs[HDSP_MAX_CHANNELS] = {
+	/* ADAT is disabled in this mode */
+	/* SPDIF */
+	8, 9,
+	/* Analog */
+	10, 11,
+	/* AO4S-192 and AI4S-192 extension boards */
+	12, 13, 14, 15,
+	/* others don't exist */
+	-1, -1, -1, -1, -1, -1, -1, -1,
+	-1, -1, -1, -1, -1, -1, -1, -1,
+	-1, -1
 };
 
 #define HDSP_PREALLOCATE_MEMORY	/* via module snd-hdsp_mem */
@@ -492,15 +617,17 @@
 static inline void snd_hdsp_initialize_midi_flush (hdsp_t *hdsp);
 static inline void snd_hdsp_initialize_channels (hdsp_t *hdsp);
 static inline int hdsp_fifo_wait(hdsp_t *hdsp, int count, int timeout);
-static int hdsp_update_simple_mixer_controls(hdsp_t *hdsp);
 static int hdsp_autosync_ref(hdsp_t *hdsp);
 static int snd_hdsp_set_defaults(hdsp_t *hdsp);
+static inline void snd_hdsp_9652_enable_mixer (hdsp_t *hdsp);
 
 static inline int hdsp_playback_to_output_key (hdsp_t *hdsp, int in, int out)
 {
 	switch (hdsp->firmware_rev) {
 	case 0xa:
 		return (64 * out) + (32 + (in));
+	case 0x96:
+		return (32 * out) + (16 + (in));
 	default:
 		return (52 * out) + (26 + (in));
 	}
@@ -511,6 +638,8 @@
 	switch (hdsp->firmware_rev) {
 	case 0xa:
 		return (64 * out) + in;
+	case 0x96:
+		return (32 * out) + in;
 	default:
 		return (52 * out) + in;
 	}
@@ -529,7 +658,7 @@
 static inline int hdsp_check_for_iobox (hdsp_t *hdsp)
 {
 
-	if (hdsp->io_type == H9652) return 0;
+	if (hdsp->io_type == H9652 || hdsp->io_type == H9632) return 0;
 	if (hdsp_read (hdsp, HDSP_statusRegister) & HDSP_ConfigError) {
 		snd_printk ("Hammerfall-DSP: no Digiface or Multiface connected!\n");
 		hdsp->state &= ~HDSP_FirmwareLoaded;
@@ -565,6 +694,13 @@
 				return -EIO;
 			}
 		}
+
+		if ((1000 / HZ) < 3000) {
+			set_current_state(TASK_UNINTERRUPTIBLE);
+			schedule_timeout((3000 * HZ + 999) / 1000);
+		} else {
+			mdelay(3000);
+		}
 		
 		if (hdsp_fifo_wait (hdsp, 0, HDSP_LONG_WAIT)) {
 			snd_printk ("timeout at end of firmware loading\n");
@@ -579,12 +715,6 @@
 		hdsp_write (hdsp, HDSP_control2Reg, hdsp->control2_register);
 		snd_printk ("finished firmware loading\n");
 		
-		if ((1000 / HZ) < 3000) {
-			set_current_state(TASK_UNINTERRUPTIBLE);
-			schedule_timeout((3000 * HZ + 999) / 1000);
-		} else {
-			mdelay(3000);
-		}
 	}
 	if (hdsp->state & HDSP_InitializationComplete) {
 		snd_printk("firmware loaded from cache, restoring defaults\n");
@@ -643,7 +773,7 @@
 
 static inline int hdsp_check_for_firmware (hdsp_t *hdsp)
 {
-	if (hdsp->io_type == H9652) return 0;
+	if (hdsp->io_type == H9652 || hdsp->io_type == H9632) return 0;
 	if ((hdsp_read (hdsp, HDSP_statusRegister) & HDSP_DllError) != 0) {
 		snd_printk("firmware not present.\n");
 		hdsp->state &= ~HDSP_FirmwareLoaded;
@@ -692,8 +822,8 @@
 
 	if (addr >= HDSP_MATRIX_MIXER_SIZE)
 		return -1;
-		
-	if (hdsp->io_type == H9652) {
+	
+	if (hdsp->io_type == H9652 || hdsp->io_type == H9632) {
 
 		/* from martin björnsen:
 		   
@@ -707,8 +837,17 @@
 		   memory."
 		*/
 
+		if (hdsp->io_type == H9632 && addr >= 512) {
+			return 0;
+		}
+
+		if (hdsp->io_type == H9652 && addr >= 1352) {
+			return 0;
+		}
+
 		hdsp->mixer_matrix[addr] = data;
 
+		
 		/* `addr' addresses a 16-bit wide address, but
 		   the address space accessed via hdsp_write
 		   uses byte offsets. put another way, addr
@@ -716,8 +855,9 @@
 		   corresponding memory location, we need
 		   to access 0 to 2703 ...
 		*/
-
-		hdsp_write (hdsp, 4096 + (addr*2), 
+		ad = addr/2;
+	
+		hdsp_write (hdsp, 4096 + (ad*4), 
 			    (hdsp->mixer_matrix[(addr&0x7fe)+1] << 16) + 
 			    hdsp->mixer_matrix[addr&0x7fe]);
 		
@@ -786,10 +926,20 @@
 	case HDSP_spdifFrequency64KHz: return 64000;
 	case HDSP_spdifFrequency88_2KHz: return 88200;
 	case HDSP_spdifFrequency96KHz: return 96000;
+	case HDSP_spdifFrequency128KHz: 
+		if (hdsp->io_type == H9632) return 128000;
+		break;
+	case HDSP_spdifFrequency176_4KHz: 
+		if (hdsp->io_type == H9632) return 176400;
+		break;
+	case HDSP_spdifFrequency192KHz: 
+		if (hdsp->io_type == H9632) return 192000;
+		break;
 	default:
-		snd_printk ("unknown spdif frequency status; bits = 0x%x, status = 0x%x\n", rate_bits, status);
-		return 0;
+		break;
 	}
+	snd_printk ("unknown spdif frequency status; bits = 0x%x, status = 0x%x\n", rate_bits, status);
+	return 0;
 }
 
 static inline void hdsp_compute_period_size(hdsp_t *hdsp)
@@ -867,7 +1017,7 @@
 	int current_rate;
 	int rate_bits;
 
-	/* ASSUMPTION: hdsp->lock is either help, or
+	/* ASSUMPTION: hdsp->lock is either held, or
 	   there is no need for it (e.g. during module
 	   initialization).
 	*/
@@ -884,6 +1034,8 @@
 		
 			if ((spdif_freq == external_freq*2) && (hdsp_autosync_ref(hdsp) >= HDSP_AUTOSYNC_FROM_ADAT1)) {
 				snd_printk("Detected ADAT in double speed mode\n");
+			} else if (hdsp->io_type == H9632 && (spdif_freq == external_freq*4) && (hdsp_autosync_ref(hdsp) >= HDSP_AUTOSYNC_FROM_ADAT1)) {
+				snd_printk("Detected ADAT in quad speed mode\n");			
 			} else if (rate != external_freq) {
 				snd_printk("No AutoSync source for requested rate\n");
 				return -1;
@@ -903,6 +1055,10 @@
 	   exists for externally-driven rate changes. All we can do
 	   is to flag rate changes in the read/write routines.  */
 
+	if (rate > 96000 && hdsp->io_type != H9632) {
+		return -EINVAL;
+	}
+	
 	switch (rate) {
 	case 32000:
 		if (current_rate > 48000) {
@@ -923,29 +1079,47 @@
 		rate_bits = HDSP_Frequency48KHz;
 		break;
 	case 64000:
-		if (current_rate <= 48000) {
+		if (current_rate <= 48000 || current_rate > 96000) {
 			reject_if_open = 1;
 		}
 		rate_bits = HDSP_Frequency64KHz;
 		break;
 	case 88200:
-		if (current_rate <= 48000) {
+		if (current_rate <= 48000 || current_rate > 96000) {
 			reject_if_open = 1;
 		}
 		rate_bits = HDSP_Frequency88_2KHz;
 		break;
 	case 96000:
-		if (current_rate <= 48000) {
+		if (current_rate <= 48000 || current_rate > 96000) {
 			reject_if_open = 1;
 		}
 		rate_bits = HDSP_Frequency96KHz;
 		break;
+	case 128000:
+		if (current_rate < 128000) {
+			reject_if_open = 1;
+		}
+		rate_bits = HDSP_Frequency128KHz;
+		break;
+	case 176400:
+		if (current_rate < 128000) {
+			reject_if_open = 1;
+		}
+		rate_bits = HDSP_Frequency176_4KHz;
+		break;
+	case 192000:
+		if (current_rate < 128000) {
+			reject_if_open = 1;
+		}
+		rate_bits = HDSP_Frequency192KHz;
+		break;
 	default:
 		return -EINVAL;
 	}
 
 	if (reject_if_open && (hdsp->capture_pid >= 0 || hdsp->playback_pid >= 0)) {
-		snd_printk ("cannot change between single- and double-speed mode (capture PID = %d, playback PID = %d)\n",
+		snd_printk ("cannot change speed mode (capture PID = %d, playback PID = %d)\n",
 			    hdsp->capture_pid,
 			    hdsp->playback_pid);
 		return -EBUSY;
@@ -955,8 +1129,14 @@
 	hdsp->control_register |= rate_bits;
 	hdsp_write(hdsp, HDSP_controlRegister, hdsp->control_register);
 
-	if (rate > 48000) {
-		hdsp->channel_map = channel_map_ds;
+	if (rate >= 128000) {
+		hdsp->channel_map = channel_map_H9632_qs;
+	} else if (rate > 48000) {
+		if (hdsp->io_type == H9632) {
+			hdsp->channel_map = channel_map_H9632_ds;
+		} else {
+			hdsp->channel_map = channel_map_ds;
+		}
 	} else {
 		switch (hdsp->io_type) {
 		case Multiface:
@@ -966,6 +1146,9 @@
 		case H9652:
 			hdsp->channel_map = channel_map_df_ss;
 			break;
+		case H9632:
+			hdsp->channel_map = channel_map_H9632_ss;
+			break;
 		default:
 			/* should never happen */
 			break;
@@ -973,10 +1156,6 @@
 	}
 	
 	hdsp->system_sample_rate = rate;
-	
-	if (reject_if_open) {
-		hdsp_update_simple_mixer_controls (hdsp);
-	}
 
 	return 0;
 }
@@ -993,11 +1172,11 @@
 		/* set thru for all channels */
 
 		if (enable) {
-			for (i = 0; i < 26; i++) {
+			for (i = 0; i < hdsp->max_channels; i++) {
 				hdsp_write_gain (hdsp, hdsp_input_to_output_key(hdsp,i,i), UNITY_GAIN);
 			}
 		} else {
-			for (i = 0; i < 26; i++) {
+			for (i = 0; i < hdsp->max_channels; i++) {
 				hdsp_write_gain (hdsp, hdsp_input_to_output_key(hdsp,i,i), MINUS_INFINITY_GAIN);
 			}
 		}
@@ -1005,7 +1184,7 @@
 	} else {
 		int mapped_channel;
 
-		snd_assert(channel < HDSP_MAX_CHANNELS, return);
+		snd_assert(channel < hdsp->max_channels, return);
 
 		mapped_channel = hdsp->channel_map[channel];
 
@@ -1463,13 +1642,14 @@
 
 static int snd_hdsp_info_spdif_in(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
 {
-	static char *texts[3] = {"ADAT1", "Coaxial", "Internal"};
+	static char *texts[4] = {"Optical", "Coaxial", "Internal", "AES"};
+	hdsp_t *hdsp = _snd_kcontrol_chip(kcontrol);
 
 	uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
 	uinfo->count = 1;
-	uinfo->value.enumerated.items = 3;
-	if (uinfo->value.enumerated.item > 2)
-		uinfo->value.enumerated.item = 2;
+	uinfo->value.enumerated.items = ((hdsp->io_type == H9632) ? 4 : 3);
+	if (uinfo->value.enumerated.item > ((hdsp->io_type == H9632) ? 3 : 2))
+		uinfo->value.enumerated.item = ((hdsp->io_type == H9632) ? 3 : 2);
 	strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
 	return 0;
 }
@@ -1491,7 +1671,7 @@
 	
 	if (!snd_hdsp_use_is_exclusive(hdsp))
 		return -EBUSY;
-	val = ucontrol->value.enumerated.item[0] % 3;
+	val = ucontrol->value.enumerated.item[0] % ((hdsp->io_type == H9632) ? 4 : 3);
 	spin_lock_irqsave(&hdsp->lock, flags);
 	change = val != hdsp_spdif_in(hdsp);
 	if (change)
@@ -1704,10 +1884,12 @@
 
 static int snd_hdsp_info_spdif_sample_rate(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
 {
-	static char *texts[] = {"32000", "44100", "48000", "64000", "88200", "96000", "None"};
+	static char *texts[] = {"32000", "44100", "48000", "64000", "88200", "96000", "None", "128000", "176400", "192000"};
+	hdsp_t *hdsp = _snd_kcontrol_chip(kcontrol);
+
 	uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
 	uinfo->count = 1;
-	uinfo->value.enumerated.items = 7 ;
+	uinfo->value.enumerated.items = (hdsp->io_type == H9632) ? 10 : 7;
 	if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items)
 		uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1;
 	strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
@@ -1737,6 +1919,15 @@
 	case 96000:
 		ucontrol->value.enumerated.item[0] = 5;
 		break;
+	case 128000:
+		ucontrol->value.enumerated.item[0] = 7;
+		break;
+	case 176400:
+		ucontrol->value.enumerated.item[0] = 8;
+		break;
+	case 192000:
+		ucontrol->value.enumerated.item[0] = 9;
+		break;
 	default:
 		ucontrol->value.enumerated.item[0] = 6;		
 	}
@@ -1778,10 +1969,11 @@
 
 static int snd_hdsp_info_autosync_sample_rate(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
 {
-	static char *texts[] = {"32000", "44100", "48000", "64000", "88200", "96000", "None"};	
+	hdsp_t *hdsp = _snd_kcontrol_chip(kcontrol);
+	static char *texts[] = {"32000", "44100", "48000", "64000", "88200", "96000", "None", "128000", "176400", "192000"};	
 	uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
 	uinfo->count = 1;
-	uinfo->value.enumerated.items = 7 ;
+	uinfo->value.enumerated.items = (hdsp->io_type == H9632) ? 10 : 7 ;
 	if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items)
 		uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1;
 	strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
@@ -1811,6 +2003,15 @@
 	case 96000:
 		ucontrol->value.enumerated.item[0] = 5;
 		break;
+	case 128000:
+		ucontrol->value.enumerated.item[0] = 7;
+		break;
+	case 176400:
+		ucontrol->value.enumerated.item[0] = 8;
+		break;
+	case 192000:
+		ucontrol->value.enumerated.item[0] = 9;
+		break;	
 	default:
 		ucontrol->value.enumerated.item[0] = 6;		
 	}
@@ -1882,6 +2083,12 @@
 			return 5;
 		case 96000:
 			return 6;
+		case 128000:
+			return 7;
+		case 176400:
+			return 8;
+		case 192000:
+			return 9;
 		default:
 			return 3;	
 		}
@@ -1896,9 +2103,11 @@
 	switch (mode) {
 	case HDSP_CLOCK_SOURCE_AUTOSYNC:
 		if (hdsp_external_sample_rate(hdsp) != 0) {
-		    hdsp->control_register &= ~HDSP_ClockModeMaster;		
-		    hdsp_write(hdsp, HDSP_controlRegister, hdsp->control_register);
-		    return 0;
+		    if (!hdsp_set_rate(hdsp, hdsp_external_sample_rate(hdsp), 1)) {
+			hdsp->control_register &= ~HDSP_ClockModeMaster;		
+			hdsp_write(hdsp, HDSP_controlRegister, hdsp->control_register);
+			return 0;
+		    }
 		}
 		return -1;
 	case HDSP_CLOCK_SOURCE_INTERNAL_32KHZ:
@@ -1919,6 +2128,15 @@
 	case HDSP_CLOCK_SOURCE_INTERNAL_96KHZ:
 		rate = 96000;
 		break;
+	case HDSP_CLOCK_SOURCE_INTERNAL_128KHZ:
+		rate = 128000;
+		break;
+	case HDSP_CLOCK_SOURCE_INTERNAL_176_4KHZ:
+		rate = 176400;
+		break;
+	case HDSP_CLOCK_SOURCE_INTERNAL_192KHZ:
+		rate = 192000;
+		break;
 	default:
 		rate = 48000;
 	}
@@ -1930,11 +2148,15 @@
 
 static int snd_hdsp_info_clock_source(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
 {
-	static char *texts[] = {"AutoSync", "Internal 32.0 kHz", "Internal 44.1 kHz", "Internal 48.0 kHz", "Internal 64.0 kHz", "Internal 88.2 kHz", "Internal 96.0 kHz" };
+	static char *texts[] = {"AutoSync", "Internal 32.0 kHz", "Internal 44.1 kHz", "Internal 48.0 kHz", "Internal 64.0 kHz", "Internal 88.2 kHz", "Internal 96.0 kHz", "Internal 128 kHz", "Internal 176.4 kHz", "Internal 192.0 KHz" };
+	hdsp_t *hdsp = _snd_kcontrol_chip(kcontrol);
 	
 	uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
 	uinfo->count = 1;
-	uinfo->value.enumerated.items = 7;
+	if (hdsp->io_type == H9632)
+	    uinfo->value.enumerated.items = 10;
+	else
+	    uinfo->value.enumerated.items = 7;	
 	if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items)
 		uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1;
 	strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
@@ -1960,7 +2182,11 @@
 		return -EBUSY;
 	val = ucontrol->value.enumerated.item[0];
 	if (val < 0) val = 0;
-	if (val > 6) val = 6;
+	if (hdsp->io_type == H9632) {
+	    if (val > 9) val = 9;
+	} else {
+	    if (val > 6) val = 6;
+	}
 	spin_lock_irqsave(&hdsp->lock, flags);
 	if (val != hdsp_clock_source(hdsp)) {
 		change = (hdsp_set_clock_source(hdsp, val) == 0) ? 1 : 0;
@@ -1971,264 +2197,362 @@
 	return change;
 }
 
-#define HDSP_PREF_SYNC_REF(xname, xindex) \
+#define HDSP_DA_GAIN(xname, xindex) \
 { .iface = SNDRV_CTL_ELEM_IFACE_HWDEP, \
   .name = xname, \
   .index = xindex, \
-  .info = snd_hdsp_info_pref_sync_ref, \
-  .get = snd_hdsp_get_pref_sync_ref, \
-  .put = snd_hdsp_put_pref_sync_ref \
+  .info = snd_hdsp_info_da_gain, \
+  .get = snd_hdsp_get_da_gain, \
+  .put = snd_hdsp_put_da_gain \
 }
 
-static int hdsp_pref_sync_ref(hdsp_t *hdsp)
+static int hdsp_da_gain(hdsp_t *hdsp)
 {
-	/* Notice that this looks at the requested sync source,
-	   not the one actually in use.
-	*/
-
-	switch (hdsp->control_register & HDSP_SyncRefMask) {
-	case HDSP_SyncRef_ADAT1:
-		return HDSP_SYNC_FROM_ADAT1;
-	case HDSP_SyncRef_ADAT2:
-		return HDSP_SYNC_FROM_ADAT2;
-	case HDSP_SyncRef_ADAT3:
-		return HDSP_SYNC_FROM_ADAT3;
-	case HDSP_SyncRef_SPDIF:
-		return HDSP_SYNC_FROM_SPDIF;
-	case HDSP_SyncRef_WORD:
-		return HDSP_SYNC_FROM_WORD;
-	case HDSP_SyncRef_ADAT_SYNC:
-		return HDSP_SYNC_FROM_ADAT_SYNC;
+	switch (hdsp->control_register & HDSP_DAGainMask) {
+	case HDSP_DAGainHighGain:
+		return 0;
+	case HDSP_DAGainPlus4dBu:
+		return 1;
+	case HDSP_DAGainMinus10dBV:
+		return 2;
 	default:
-		return HDSP_SYNC_FROM_WORD;
+		return 1;	
 	}
-	return 0;
 }
 
-static int hdsp_set_pref_sync_ref(hdsp_t *hdsp, int pref)
+static int hdsp_set_da_gain(hdsp_t *hdsp, int mode)
 {
-	hdsp->control_register &= ~HDSP_SyncRefMask;
-	switch (pref) {
-	case HDSP_SYNC_FROM_ADAT1:
-		hdsp->control_register &= ~HDSP_SyncRefMask; /* clear SyncRef bits */
-		break;
-	case HDSP_SYNC_FROM_ADAT2:
-		hdsp->control_register |= HDSP_SyncRef_ADAT2;
-		break;
-	case HDSP_SYNC_FROM_ADAT3:
-		hdsp->control_register |= HDSP_SyncRef_ADAT3;
-		break;
-	case HDSP_SYNC_FROM_SPDIF:
-		hdsp->control_register |= HDSP_SyncRef_SPDIF;
-		break;
-	case HDSP_SYNC_FROM_WORD:
-		hdsp->control_register |= HDSP_SyncRef_WORD;
+	hdsp->control_register &= ~HDSP_DAGainMask;
+	switch (mode) {
+	case 0:
+		hdsp->control_register |= HDSP_DAGainHighGain;
 		break;
-	case HDSP_SYNC_FROM_ADAT_SYNC:
-		hdsp->control_register |= HDSP_SyncRef_ADAT_SYNC;
+	case 1:
+		hdsp->control_register |= HDSP_DAGainPlus4dBu;
 		break;
+	case 2:
+		hdsp->control_register |= HDSP_DAGainMinus10dBV;		
+		break;	    
 	default:
 		return -1;
+
 	}
 	hdsp_write(hdsp, HDSP_controlRegister, hdsp->control_register);
 	return 0;
 }
 
-static int snd_hdsp_info_pref_sync_ref(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
+static int snd_hdsp_info_da_gain(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
 {
-	static char *texts[] = {"Word", "ADAT Sync", "IEC958", "ADAT1", "ADAT2", "ADAT3" };
-	hdsp_t *hdsp = _snd_kcontrol_chip(kcontrol);
+	static char *texts[] = {"Hi Gain", "+4 dBu", "-10 dbV"};
 	
 	uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
 	uinfo->count = 1;
-
-	switch (hdsp->io_type) {
-	case Digiface:
-	case H9652:
-		uinfo->value.enumerated.items = 6;
-		break;
-	case Multiface:
-		uinfo->value.enumerated.items = 4;
-	default:
-		uinfo->value.enumerated.items = 0;
-		break;
-	}
-		
+	uinfo->value.enumerated.items = 3;
 	if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items)
 		uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1;
 	strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
 	return 0;
 }
 
-static int snd_hdsp_get_pref_sync_ref(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
+static int snd_hdsp_get_da_gain(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
 {
 	hdsp_t *hdsp = _snd_kcontrol_chip(kcontrol);
 	
-	ucontrol->value.enumerated.item[0] = hdsp_pref_sync_ref(hdsp);
+	ucontrol->value.enumerated.item[0] = hdsp_da_gain(hdsp);
 	return 0;
 }
 
-static int snd_hdsp_put_pref_sync_ref(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
+static int snd_hdsp_put_da_gain(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
 {
 	hdsp_t *hdsp = _snd_kcontrol_chip(kcontrol);
 	unsigned long flags;
-	int change, max;
-	unsigned int val;
+	int change;
+	int val;
 	
 	if (!snd_hdsp_use_is_exclusive(hdsp))
 		return -EBUSY;
-
-	switch (hdsp->io_type) {
-	case Digiface:
-	case H9652:
-		max = 6;
-		break;
-	case Multiface:
-		max = 4;
-		break;
-	default:
-		return -EIO;
-	}
-
-	val = ucontrol->value.enumerated.item[0] % max;
+	val = ucontrol->value.enumerated.item[0];
+	if (val < 0) val = 0;
+	if (val > 2) val = 2;
 	spin_lock_irqsave(&hdsp->lock, flags);
-	change = (int)val != hdsp_pref_sync_ref(hdsp);
-	hdsp_set_pref_sync_ref(hdsp, val);
+	if (val != hdsp_da_gain(hdsp)) {
+		change = (hdsp_set_da_gain(hdsp, val) == 0) ? 1 : 0;
+	} else {
+		change = 0;
+	}
 	spin_unlock_irqrestore(&hdsp->lock, flags);
 	return change;
 }
 
-#define HDSP_AUTOSYNC_REF(xname, xindex) \
+#define HDSP_AD_GAIN(xname, xindex) \
 { .iface = SNDRV_CTL_ELEM_IFACE_HWDEP, \
   .name = xname, \
   .index = xindex, \
-  .access = SNDRV_CTL_ELEM_ACCESS_READ, \
-  .info = snd_hdsp_info_autosync_ref, \
-  .get = snd_hdsp_get_autosync_ref, \
+  .info = snd_hdsp_info_ad_gain, \
+  .get = snd_hdsp_get_ad_gain, \
+  .put = snd_hdsp_put_ad_gain \
 }
 
-static int hdsp_autosync_ref(hdsp_t *hdsp)
+static int hdsp_ad_gain(hdsp_t *hdsp)
 {
-	/* This looks at the autosync selected sync reference */
-	unsigned int status2 = hdsp_read(hdsp, HDSP_status2Register);
+	switch (hdsp->control_register & HDSP_ADGainMask) {
+	case HDSP_ADGainMinus10dBV:
+		return 0;
+	case HDSP_ADGainPlus4dBu:
+		return 1;
+	case HDSP_ADGainLowGain:
+		return 2;
+	default:
+		return 1;	
+	}
+}
 
-	switch (status2 & HDSP_SelSyncRefMask) {
-	case HDSP_SelSyncRef_WORD:
-		return HDSP_AUTOSYNC_FROM_WORD;
-	case HDSP_SelSyncRef_ADAT_SYNC:
-		return HDSP_AUTOSYNC_FROM_ADAT_SYNC;
-	case HDSP_SelSyncRef_SPDIF:
-		return HDSP_AUTOSYNC_FROM_SPDIF;
-	case HDSP_SelSyncRefMask:
-		return HDSP_AUTOSYNC_FROM_NONE;	
-	case HDSP_SelSyncRef_ADAT1:
-		return HDSP_AUTOSYNC_FROM_ADAT1;
-	case HDSP_SelSyncRef_ADAT2:
-		return HDSP_AUTOSYNC_FROM_ADAT2;
-	case HDSP_SelSyncRef_ADAT3:
-		return HDSP_AUTOSYNC_FROM_ADAT3;
+static int hdsp_set_ad_gain(hdsp_t *hdsp, int mode)
+{
+	hdsp->control_register &= ~HDSP_ADGainMask;
+	switch (mode) {
+	case 0:
+		hdsp->control_register |= HDSP_ADGainMinus10dBV;
+		break;
+	case 1:
+		hdsp->control_register |= HDSP_ADGainPlus4dBu;		
+		break;
+	case 2:
+		hdsp->control_register |= HDSP_ADGainLowGain;		
+		break;	    
 	default:
-		return HDSP_AUTOSYNC_FROM_WORD;
+		return -1;
+
 	}
+	hdsp_write(hdsp, HDSP_controlRegister, hdsp->control_register);
 	return 0;
 }
 
-static int snd_hdsp_info_autosync_ref(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
+static int snd_hdsp_info_ad_gain(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
 {
-	static char *texts[] = {"Word", "ADAT Sync", "IEC958", "None", "ADAT1", "ADAT2", "ADAT3" };
+	static char *texts[] = {"-10 dBV", "+4 dBu", "Lo Gain"};
 	
 	uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
 	uinfo->count = 1;
-	uinfo->value.enumerated.items = 7;
+	uinfo->value.enumerated.items = 3;
 	if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items)
 		uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1;
 	strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
 	return 0;
 }
 
-static int snd_hdsp_get_autosync_ref(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
+static int snd_hdsp_get_ad_gain(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
 {
 	hdsp_t *hdsp = _snd_kcontrol_chip(kcontrol);
 	
-	ucontrol->value.enumerated.item[0] = hdsp_pref_sync_ref(hdsp);
+	ucontrol->value.enumerated.item[0] = hdsp_ad_gain(hdsp);
 	return 0;
 }
 
-#define HDSP_PASSTHRU(xname, xindex) \
+static int snd_hdsp_put_ad_gain(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
+{
+	hdsp_t *hdsp = _snd_kcontrol_chip(kcontrol);
+	unsigned long flags;
+	int change;
+	int val;
+	
+	if (!snd_hdsp_use_is_exclusive(hdsp))
+		return -EBUSY;
+	val = ucontrol->value.enumerated.item[0];
+	if (val < 0) val = 0;
+	if (val > 2) val = 2;
+	spin_lock_irqsave(&hdsp->lock, flags);
+	if (val != hdsp_ad_gain(hdsp)) {
+		change = (hdsp_set_ad_gain(hdsp, val) == 0) ? 1 : 0;
+	} else {
+		change = 0;
+	}
+	spin_unlock_irqrestore(&hdsp->lock, flags);
+	return change;
+}
+
+#define HDSP_PHONE_GAIN(xname, xindex) \
 { .iface = SNDRV_CTL_ELEM_IFACE_HWDEP, \
   .name = xname, \
   .index = xindex, \
-  .info = snd_hdsp_info_passthru, \
-  .put = snd_hdsp_put_passthru, \
-  .get = snd_hdsp_get_passthru \
+  .info = snd_hdsp_info_phone_gain, \
+  .get = snd_hdsp_get_phone_gain, \
+  .put = snd_hdsp_put_phone_gain \
 }
 
-static int snd_hdsp_info_passthru(snd_kcontrol_t * kcontrol, snd_ctl_elem_info_t * uinfo)
+static int hdsp_phone_gain(hdsp_t *hdsp)
 {
-	uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
-	uinfo->count = 1;
-	uinfo->value.integer.min = 0;
-	uinfo->value.integer.max = 1;
-	return 0;
+	switch (hdsp->control_register & HDSP_PhoneGainMask) {
+	case HDSP_PhoneGain0dB:
+		return 0;
+	case HDSP_PhoneGainMinus6dB:
+		return 1;
+	case HDSP_PhoneGainMinus12dB:
+		return 2;
+	default:
+		return 0;	
+	}
 }
 
-static int snd_hdsp_get_passthru(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
+static int hdsp_set_phone_gain(hdsp_t *hdsp, int mode)
+{
+	hdsp->control_register &= ~HDSP_PhoneGainMask;
+	switch (mode) {
+	case 0:
+		hdsp->control_register |= HDSP_PhoneGain0dB;
+		break;
+	case 1:
+		hdsp->control_register |= HDSP_PhoneGainMinus6dB;		
+		break;
+	case 2:
+		hdsp->control_register |= HDSP_PhoneGainMinus12dB;		
+		break;	    
+	default:
+		return -1;
+
+	}
+	hdsp_write(hdsp, HDSP_controlRegister, hdsp->control_register);
+	return 0;
+}
+
+static int snd_hdsp_info_phone_gain(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
+{
+	static char *texts[] = {"0 dB", "-6 dB", "-12 dB"};
+	
+	uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
+	uinfo->count = 1;
+	uinfo->value.enumerated.items = 3;
+	if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items)
+		uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1;
+	strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
+	return 0;
+}
+
+static int snd_hdsp_get_phone_gain(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
 {
 	hdsp_t *hdsp = _snd_kcontrol_chip(kcontrol);
-	unsigned long flags;
+	
+	ucontrol->value.enumerated.item[0] = hdsp_phone_gain(hdsp);
+	return 0;
+}
 
+static int snd_hdsp_put_phone_gain(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
+{
+	hdsp_t *hdsp = _snd_kcontrol_chip(kcontrol);
+	unsigned long flags;
+	int change;
+	int val;
+	
+	if (!snd_hdsp_use_is_exclusive(hdsp))
+		return -EBUSY;
+	val = ucontrol->value.enumerated.item[0];
+	if (val < 0) val = 0;
+	if (val > 2) val = 2;
 	spin_lock_irqsave(&hdsp->lock, flags);
-	ucontrol->value.integer.value[0] = hdsp->passthru;
+	if (val != hdsp_phone_gain(hdsp)) {
+		change = (hdsp_set_phone_gain(hdsp, val) == 0) ? 1 : 0;
+	} else {
+		change = 0;
+	}
 	spin_unlock_irqrestore(&hdsp->lock, flags);
+	return change;
+}
+
+#define HDSP_XLR_BREAKOUT_CABLE(xname, xindex) \
+{ .iface = SNDRV_CTL_ELEM_IFACE_HWDEP, \
+  .name = xname, \
+  .index = xindex, \
+  .info = snd_hdsp_info_xlr_breakout_cable, \
+  .get = snd_hdsp_get_xlr_breakout_cable, \
+  .put = snd_hdsp_put_xlr_breakout_cable \
+}
+
+static int hdsp_xlr_breakout_cable(hdsp_t *hdsp)
+{
+	if (hdsp->control_register & HDSP_XLRBreakoutCable) {
+		return 1;
+	}
 	return 0;
 }
 
-static int snd_hdsp_put_passthru(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
+static int hdsp_set_xlr_breakout_cable(hdsp_t *hdsp, int mode)
+{
+	if (mode) {
+		hdsp->control_register |= HDSP_XLRBreakoutCable;
+	} else {
+		hdsp->control_register &= ~HDSP_XLRBreakoutCable;
+	}
+	hdsp_write(hdsp, HDSP_controlRegister, hdsp->control_register);
+	return 0;
+}
+
+static int snd_hdsp_info_xlr_breakout_cable(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
+{
+	uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
+	uinfo->count = 1;
+	uinfo->value.integer.min = 0;
+	uinfo->value.integer.max = 1;
+	return 0;
+}
+
+static int snd_hdsp_get_xlr_breakout_cable(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
+{
+	hdsp_t *hdsp = _snd_kcontrol_chip(kcontrol);
+	
+	ucontrol->value.enumerated.item[0] = hdsp_xlr_breakout_cable(hdsp);
+	return 0;
+}
+
+static int snd_hdsp_put_xlr_breakout_cable(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
 {
 	hdsp_t *hdsp = _snd_kcontrol_chip(kcontrol);
 	unsigned long flags;
 	int change;
-	unsigned int val;
-	int err = 0;
-
+	int val;
+	
 	if (!snd_hdsp_use_is_exclusive(hdsp))
 		return -EBUSY;
-
 	val = ucontrol->value.integer.value[0] & 1;
 	spin_lock_irqsave(&hdsp->lock, flags);
-	change = (ucontrol->value.integer.value[0] != hdsp->passthru);
-	if (change)
-		err = hdsp_set_passthru(hdsp, val);
+	change = (int)val != hdsp_xlr_breakout_cable(hdsp);
+	hdsp_set_xlr_breakout_cable(hdsp, val);
 	spin_unlock_irqrestore(&hdsp->lock, flags);
-	return err ? err : change;
+	return change;
 }
 
-#define HDSP_LINE_OUT(xname, xindex) \
+/* (De)activates old RME Analog Extension Board
+   These are connected to the internal ADAT connector
+   Switching this on desactivates external ADAT
+*/
+#define HDSP_AEB(xname, xindex) \
 { .iface = SNDRV_CTL_ELEM_IFACE_HWDEP, \
   .name = xname, \
   .index = xindex, \
-  .info = snd_hdsp_info_line_out, \
-  .get = snd_hdsp_get_line_out, \
-  .put = snd_hdsp_put_line_out \
+  .info = snd_hdsp_info_aeb, \
+  .get = snd_hdsp_get_aeb, \
+  .put = snd_hdsp_put_aeb \
 }
 
-static int hdsp_line_out(hdsp_t *hdsp)
+static int hdsp_aeb(hdsp_t *hdsp)
 {
-	return (hdsp->control_register & HDSP_LineOut) ? 1 : 0;
+	if (hdsp->control_register & HDSP_AnalogExtensionBoard) {
+		return 1;
+	}
+	return 0;
 }
 
-static int hdsp_set_line_output(hdsp_t *hdsp, int out)
+static int hdsp_set_aeb(hdsp_t *hdsp, int mode)
 {
-	if (out) {
-		hdsp->control_register |= HDSP_LineOut;
+	if (mode) {
+		hdsp->control_register |= HDSP_AnalogExtensionBoard;
 	} else {
-		hdsp->control_register &= ~HDSP_LineOut;
+		hdsp->control_register &= ~HDSP_AnalogExtensionBoard;
 	}
 	hdsp_write(hdsp, HDSP_controlRegister, hdsp->control_register);
 	return 0;
 }
 
-static int snd_hdsp_info_line_out(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
+static int snd_hdsp_info_aeb(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
 {
 	uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
 	uinfo->count = 1;
@@ -2237,182 +2561,399 @@
 	return 0;
 }
 
-static int snd_hdsp_get_line_out(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
+static int snd_hdsp_get_aeb(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
 {
 	hdsp_t *hdsp = _snd_kcontrol_chip(kcontrol);
-	unsigned long flags;
 	
-	spin_lock_irqsave(&hdsp->lock, flags);
-	ucontrol->value.integer.value[0] = hdsp_line_out(hdsp);
-	spin_unlock_irqrestore(&hdsp->lock, flags);
+	ucontrol->value.enumerated.item[0] = hdsp_aeb(hdsp);
 	return 0;
 }
 
-static int snd_hdsp_put_line_out(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
+static int snd_hdsp_put_aeb(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
 {
 	hdsp_t *hdsp = _snd_kcontrol_chip(kcontrol);
 	unsigned long flags;
 	int change;
-	unsigned int val;
+	int val;
 	
 	if (!snd_hdsp_use_is_exclusive(hdsp))
 		return -EBUSY;
 	val = ucontrol->value.integer.value[0] & 1;
 	spin_lock_irqsave(&hdsp->lock, flags);
-	change = (int)val != hdsp_line_out(hdsp);
-	hdsp_set_line_output(hdsp, val);
+	change = (int)val != hdsp_aeb(hdsp);
+	hdsp_set_aeb(hdsp, val);
 	spin_unlock_irqrestore(&hdsp->lock, flags);
 	return change;
 }
 
-#define HDSP_MIXER(xname, xindex) \
+#define HDSP_PREF_SYNC_REF(xname, xindex) \
 { .iface = SNDRV_CTL_ELEM_IFACE_HWDEP, \
   .name = xname, \
   .index = xindex, \
-  .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | \
-		 SNDRV_CTL_ELEM_ACCESS_VOLATILE, \
-  .info = snd_hdsp_info_mixer, \
-  .get = snd_hdsp_get_mixer, \
-  .put = snd_hdsp_put_mixer \
+  .info = snd_hdsp_info_pref_sync_ref, \
+  .get = snd_hdsp_get_pref_sync_ref, \
+  .put = snd_hdsp_put_pref_sync_ref \
 }
 
-static int snd_hdsp_info_mixer(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
+static int hdsp_pref_sync_ref(hdsp_t *hdsp)
 {
-	uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
-	uinfo->count = 3;
-	uinfo->value.integer.min = 0;
-	uinfo->value.integer.max = 65536;
-	uinfo->value.integer.step = 1;
+	/* Notice that this looks at the requested sync source,
+	   not the one actually in use.
+	*/
+
+	switch (hdsp->control_register & HDSP_SyncRefMask) {
+	case HDSP_SyncRef_ADAT1:
+		return HDSP_SYNC_FROM_ADAT1;
+	case HDSP_SyncRef_ADAT2:
+		return HDSP_SYNC_FROM_ADAT2;
+	case HDSP_SyncRef_ADAT3:
+		return HDSP_SYNC_FROM_ADAT3;
+	case HDSP_SyncRef_SPDIF:
+		return HDSP_SYNC_FROM_SPDIF;
+	case HDSP_SyncRef_WORD:
+		return HDSP_SYNC_FROM_WORD;
+	case HDSP_SyncRef_ADAT_SYNC:
+		return HDSP_SYNC_FROM_ADAT_SYNC;
+	default:
+		return HDSP_SYNC_FROM_WORD;
+	}
 	return 0;
 }
 
-static int snd_hdsp_get_mixer(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
+static int hdsp_set_pref_sync_ref(hdsp_t *hdsp, int pref)
+{
+	hdsp->control_register &= ~HDSP_SyncRefMask;
+	switch (pref) {
+	case HDSP_SYNC_FROM_ADAT1:
+		hdsp->control_register &= ~HDSP_SyncRefMask; /* clear SyncRef bits */
+		break;
+	case HDSP_SYNC_FROM_ADAT2:
+		hdsp->control_register |= HDSP_SyncRef_ADAT2;
+		break;
+	case HDSP_SYNC_FROM_ADAT3:
+		hdsp->control_register |= HDSP_SyncRef_ADAT3;
+		break;
+	case HDSP_SYNC_FROM_SPDIF:
+		hdsp->control_register |= HDSP_SyncRef_SPDIF;
+		break;
+	case HDSP_SYNC_FROM_WORD:
+		hdsp->control_register |= HDSP_SyncRef_WORD;
+		break;
+	case HDSP_SYNC_FROM_ADAT_SYNC:
+		hdsp->control_register |= HDSP_SyncRef_ADAT_SYNC;
+		break;
+	default:
+		return -1;
+	}
+	hdsp_write(hdsp, HDSP_controlRegister, hdsp->control_register);
+	return 0;
+}
+
+static int snd_hdsp_info_pref_sync_ref(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
+{
+	static char *texts[] = {"Word", "IEC958", "ADAT1", "ADAT Sync", "ADAT2", "ADAT3" };
+	hdsp_t *hdsp = _snd_kcontrol_chip(kcontrol);
+	
+	uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
+	uinfo->count = 1;
+
+	switch (hdsp->io_type) {
+	case Digiface:
+	case H9652:
+		uinfo->value.enumerated.items = 6;
+		break;
+	case Multiface:
+		uinfo->value.enumerated.items = 4;
+		break;
+	case H9632:
+		uinfo->value.enumerated.items = 3;
+		break;
+	default:
+		uinfo->value.enumerated.items = 0;
+		break;
+	}
+		
+	if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items)
+		uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1;
+	strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
+	return 0;
+}
+
+static int snd_hdsp_get_pref_sync_ref(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
+{
+	hdsp_t *hdsp = _snd_kcontrol_chip(kcontrol);
+	
+	ucontrol->value.enumerated.item[0] = hdsp_pref_sync_ref(hdsp);
+	return 0;
+}
+
+static int snd_hdsp_put_pref_sync_ref(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
 {
 	hdsp_t *hdsp = _snd_kcontrol_chip(kcontrol);
 	unsigned long flags;
-	int source;
-	int destination;
-	int addr;
+	int change, max;
+	unsigned int val;
+	
+	if (!snd_hdsp_use_is_exclusive(hdsp))
+		return -EBUSY;
 
-	source = ucontrol->value.integer.value[0];
-	destination = ucontrol->value.integer.value[1];
+	switch (hdsp->io_type) {
+	case Digiface:
+	case H9652:
+		max = 6;
+		break;
+	case Multiface:
+		max = 4;
+		break;
+	case H9632:
+		max = 3;
+		break;
+	default:
+		return -EIO;
+	}
 
-	if (source > 25) {
-		addr = hdsp_playback_to_output_key(hdsp,source-26,destination);
-	} else {
-		addr = hdsp_input_to_output_key(hdsp,source, destination);
+	val = ucontrol->value.enumerated.item[0] % max;
+	spin_lock_irqsave(&hdsp->lock, flags);
+	change = (int)val != hdsp_pref_sync_ref(hdsp);
+	hdsp_set_pref_sync_ref(hdsp, val);
+	spin_unlock_irqrestore(&hdsp->lock, flags);
+	return change;
+}
+
+#define HDSP_AUTOSYNC_REF(xname, xindex) \
+{ .iface = SNDRV_CTL_ELEM_IFACE_HWDEP, \
+  .name = xname, \
+  .index = xindex, \
+  .access = SNDRV_CTL_ELEM_ACCESS_READ, \
+  .info = snd_hdsp_info_autosync_ref, \
+  .get = snd_hdsp_get_autosync_ref, \
+}
+
+static int hdsp_autosync_ref(hdsp_t *hdsp)
+{
+	/* This looks at the autosync selected sync reference */
+	unsigned int status2 = hdsp_read(hdsp, HDSP_status2Register);
+
+	switch (status2 & HDSP_SelSyncRefMask) {
+	case HDSP_SelSyncRef_WORD:
+		return HDSP_AUTOSYNC_FROM_WORD;
+	case HDSP_SelSyncRef_ADAT_SYNC:
+		return HDSP_AUTOSYNC_FROM_ADAT_SYNC;
+	case HDSP_SelSyncRef_SPDIF:
+		return HDSP_AUTOSYNC_FROM_SPDIF;
+	case HDSP_SelSyncRefMask:
+		return HDSP_AUTOSYNC_FROM_NONE;	
+	case HDSP_SelSyncRef_ADAT1:
+		return HDSP_AUTOSYNC_FROM_ADAT1;
+	case HDSP_SelSyncRef_ADAT2:
+		return HDSP_AUTOSYNC_FROM_ADAT2;
+	case HDSP_SelSyncRef_ADAT3:
+		return HDSP_AUTOSYNC_FROM_ADAT3;
+	default:
+		return HDSP_AUTOSYNC_FROM_WORD;
 	}
+	return 0;
+}
+
+static int snd_hdsp_info_autosync_ref(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
+{
+	static char *texts[] = {"Word", "ADAT Sync", "IEC958", "None", "ADAT1", "ADAT2", "ADAT3" };
 	
+	uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
+	uinfo->count = 1;
+	uinfo->value.enumerated.items = 7;
+	if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items)
+		uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1;
+	strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
+	return 0;
+}
+
+static int snd_hdsp_get_autosync_ref(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
+{
+	hdsp_t *hdsp = _snd_kcontrol_chip(kcontrol);
+	
+	ucontrol->value.enumerated.item[0] = hdsp_pref_sync_ref(hdsp);
+	return 0;
+}
+
+#define HDSP_PASSTHRU(xname, xindex) \
+{ .iface = SNDRV_CTL_ELEM_IFACE_HWDEP, \
+  .name = xname, \
+  .index = xindex, \
+  .info = snd_hdsp_info_passthru, \
+  .put = snd_hdsp_put_passthru, \
+  .get = snd_hdsp_get_passthru \
+}
+
+static int snd_hdsp_info_passthru(snd_kcontrol_t * kcontrol, snd_ctl_elem_info_t * uinfo)
+{
+	uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
+	uinfo->count = 1;
+	uinfo->value.integer.min = 0;
+	uinfo->value.integer.max = 1;
+	return 0;
+}
+
+static int snd_hdsp_get_passthru(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
+{
+	hdsp_t *hdsp = _snd_kcontrol_chip(kcontrol);
+	unsigned long flags;
+
 	spin_lock_irqsave(&hdsp->lock, flags);
-	ucontrol->value.integer.value[2] = hdsp_read_gain (hdsp, addr);
+	ucontrol->value.integer.value[0] = hdsp->passthru;
 	spin_unlock_irqrestore(&hdsp->lock, flags);
 	return 0;
 }
 
-static int snd_hdsp_put_mixer(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
+static int snd_hdsp_put_passthru(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
 {
 	hdsp_t *hdsp = _snd_kcontrol_chip(kcontrol);
 	unsigned long flags;
 	int change;
-	int source;
-	int destination;
-	int gain;
-	int addr;
+	unsigned int val;
+	int err = 0;
 
 	if (!snd_hdsp_use_is_exclusive(hdsp))
 		return -EBUSY;
 
-	source = ucontrol->value.integer.value[0];
-	destination = ucontrol->value.integer.value[1];
+	val = ucontrol->value.integer.value[0] & 1;
+	spin_lock_irqsave(&hdsp->lock, flags);
+	change = (ucontrol->value.integer.value[0] != hdsp->passthru);
+	if (change)
+		err = hdsp_set_passthru(hdsp, val);
+	spin_unlock_irqrestore(&hdsp->lock, flags);
+	return err ? err : change;
+}
+
+#define HDSP_LINE_OUT(xname, xindex) \
+{ .iface = SNDRV_CTL_ELEM_IFACE_HWDEP, \
+  .name = xname, \
+  .index = xindex, \
+  .info = snd_hdsp_info_line_out, \
+  .get = snd_hdsp_get_line_out, \
+  .put = snd_hdsp_put_line_out \
+}
+
+static int hdsp_line_out(hdsp_t *hdsp)
+{
+	return (hdsp->control_register & HDSP_LineOut) ? 1 : 0;
+}
 
-	if (source > 25) {
-		addr = hdsp_playback_to_output_key(hdsp,source-26, destination);
+static int hdsp_set_line_output(hdsp_t *hdsp, int out)
+{
+	if (out) {
+		hdsp->control_register |= HDSP_LineOut;
 	} else {
-		addr = hdsp_input_to_output_key(hdsp,source, destination);
+		hdsp->control_register &= ~HDSP_LineOut;
 	}
+	hdsp_write(hdsp, HDSP_controlRegister, hdsp->control_register);
+	return 0;
+}
 
-	gain = ucontrol->value.integer.value[2];
+static int snd_hdsp_info_line_out(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
+{
+	uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
+	uinfo->count = 1;
+	uinfo->value.integer.min = 0;
+	uinfo->value.integer.max = 1;
+	return 0;
+}
+
+static int snd_hdsp_get_line_out(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
+{
+	hdsp_t *hdsp = _snd_kcontrol_chip(kcontrol);
+	unsigned long flags;
+	
+	spin_lock_irqsave(&hdsp->lock, flags);
+	ucontrol->value.integer.value[0] = hdsp_line_out(hdsp);
+	spin_unlock_irqrestore(&hdsp->lock, flags);
+	return 0;
+}
 
+static int snd_hdsp_put_line_out(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
+{
+	hdsp_t *hdsp = _snd_kcontrol_chip(kcontrol);
+	unsigned long flags;
+	int change;
+	unsigned int val;
+	
+	if (!snd_hdsp_use_is_exclusive(hdsp))
+		return -EBUSY;
+	val = ucontrol->value.integer.value[0] & 1;
 	spin_lock_irqsave(&hdsp->lock, flags);
-	change = gain != hdsp_read_gain(hdsp, addr);
-	if (change)
-		hdsp_write_gain(hdsp, addr, gain);
+	change = (int)val != hdsp_line_out(hdsp);
+	hdsp_set_line_output(hdsp, val);
 	spin_unlock_irqrestore(&hdsp->lock, flags);
 	return change;
 }
 
-/* The simple mixer control(s) provide gain control for the
-   basic 1:1 mappings of playback streams to output
-   streams. 
-*/
-
-#define HDSP_PLAYBACK_MIXER \
-{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
-  .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_WRITE | \
+#define HDSP_MIXER(xname, xindex) \
+{ .iface = SNDRV_CTL_ELEM_IFACE_HWDEP, \
+  .name = xname, \
+  .index = xindex, \
+  .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | \
 		 SNDRV_CTL_ELEM_ACCESS_VOLATILE, \
-  .info = snd_hdsp_info_playback_mixer, \
-  .get = snd_hdsp_get_playback_mixer, \
-  .put = snd_hdsp_put_playback_mixer \
+  .info = snd_hdsp_info_mixer, \
+  .get = snd_hdsp_get_mixer, \
+  .put = snd_hdsp_put_mixer \
 }
 
-static int snd_hdsp_info_playback_mixer(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
+static int snd_hdsp_info_mixer(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
 {
 	uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
-	uinfo->count = 1;
+	uinfo->count = 3;
 	uinfo->value.integer.min = 0;
 	uinfo->value.integer.max = 65536;
 	uinfo->value.integer.step = 1;
 	return 0;
 }
 
-static int snd_hdsp_get_playback_mixer(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
+static int snd_hdsp_get_mixer(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
 {
 	hdsp_t *hdsp = _snd_kcontrol_chip(kcontrol);
 	unsigned long flags;
+	int source;
+	int destination;
 	int addr;
-	int channel;
-	int mapped_channel;
 
-	channel = ucontrol->id.index - 1;
-
-        snd_assert(channel >= 0 || channel < HDSP_MAX_CHANNELS, return -EINVAL);
-        
-	if ((mapped_channel = hdsp->channel_map[channel]) < 0) {
-		return -EINVAL;
+	source = ucontrol->value.integer.value[0];
+	destination = ucontrol->value.integer.value[1];
+	
+	if (source >= hdsp->max_channels) {
+		addr = hdsp_playback_to_output_key(hdsp,source-hdsp->max_channels,destination);
+	} else {
+		addr = hdsp_input_to_output_key(hdsp,source, destination);
 	}
-
-	addr = hdsp_playback_to_output_key(hdsp,mapped_channel, mapped_channel);
-
+	
 	spin_lock_irqsave(&hdsp->lock, flags);
-	ucontrol->value.integer.value[0] = hdsp_read_gain (hdsp, addr);
+	ucontrol->value.integer.value[2] = hdsp_read_gain (hdsp, addr);
 	spin_unlock_irqrestore(&hdsp->lock, flags);
 	return 0;
 }
 
-static int snd_hdsp_put_playback_mixer(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
+static int snd_hdsp_put_mixer(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
 {
 	hdsp_t *hdsp = _snd_kcontrol_chip(kcontrol);
 	unsigned long flags;
 	int change;
-	int addr;
-	int channel;
-	int mapped_channel;
+	int source;
+	int destination;
 	int gain;
+	int addr;
 
 	if (!snd_hdsp_use_is_exclusive(hdsp))
 		return -EBUSY;
-	
-	channel = ucontrol->id.index - 1;
 
-        snd_assert(channel >= 0 || channel < HDSP_MAX_CHANNELS, return -EINVAL);
-        
-	if ((mapped_channel = hdsp->channel_map[channel]) < 0) {
-		return -EINVAL;
-	}
+	source = ucontrol->value.integer.value[0];
+	destination = ucontrol->value.integer.value[1];
 
-	addr = hdsp_playback_to_output_key(hdsp,mapped_channel, mapped_channel);
-	gain = ucontrol->value.integer.value[0];
+	if (source >= hdsp->max_channels) {
+		addr = hdsp_playback_to_output_key(hdsp,source-hdsp->max_channels, destination);
+	} else {
+		addr = hdsp_input_to_output_key(hdsp,source, destination);
+	}
 
+	gain = ucontrol->value.integer.value[2];
 
 	spin_lock_irqsave(&hdsp->lock, flags);
 	change = gain != hdsp_read_gain(hdsp, addr);
@@ -2566,6 +3107,7 @@
 			return -EINVAL;
 		break;
 	case Multiface:
+	case H9632:
 		if (offset >= 1) 
 			return -EINVAL;
 		break;
@@ -2577,6 +3119,13 @@
 	return 0;
 }
 
+static snd_kcontrol_new_t snd_hdsp_9632_controls[] = {
+HDSP_DA_GAIN("DA Gain", 0),
+HDSP_AD_GAIN("AD Gain", 0),
+HDSP_PHONE_GAIN("Phones Gain", 0),
+HDSP_XLR_BREAKOUT_CABLE("XLR Breakout Cable", 0)
+};
+
 static snd_kcontrol_new_t snd_hdsp_controls[] = {
 {
 	.iface =	SNDRV_CTL_ELEM_IFACE_PCM,
@@ -2637,34 +3186,14 @@
 
 #define HDSP_CONTROLS (sizeof(snd_hdsp_controls)/sizeof(snd_kcontrol_new_t))
 
-static snd_kcontrol_new_t snd_hdsp_playback_mixer = HDSP_PLAYBACK_MIXER;
-static snd_kcontrol_new_t snd_hdsp_adat_sync_check = HDSP_ADAT_SYNC_CHECK;
-
-
-static int hdsp_update_simple_mixer_controls(hdsp_t *hdsp)
-{
-    int i;
-
-    for (i = hdsp->ds_channels; i < hdsp->ss_channels; ++i) {
-	    if (hdsp->system_sample_rate > 48000) {
-		    hdsp->playback_mixer_ctls[i]->vd[0].access = SNDRV_CTL_ELEM_ACCESS_INACTIVE |
-							    SNDRV_CTL_ELEM_ACCESS_READ |
-							     SNDRV_CTL_ELEM_ACCESS_VOLATILE;
-	    } else {
-		    hdsp->playback_mixer_ctls[i]->vd[0].access = SNDRV_CTL_ELEM_ACCESS_READWRITE |
-							     SNDRV_CTL_ELEM_ACCESS_VOLATILE;
-	    }
-	    snd_ctl_notify(hdsp->card, SNDRV_CTL_EVENT_MASK_VALUE | 
-			    SNDRV_CTL_EVENT_MASK_INFO, &hdsp->playback_mixer_ctls[i]->id);
-    }
-
-    return 0;
-}
+#define HDSP_9632_CONTROLS (sizeof(snd_hdsp_9632_controls)/sizeof(snd_kcontrol_new_t))
 
+static snd_kcontrol_new_t snd_hdsp_96xx_aeb = HDSP_AEB("Analog Extension Board", 0);
+static snd_kcontrol_new_t snd_hdsp_adat_sync_check = HDSP_ADAT_SYNC_CHECK;
 
 int snd_hdsp_create_controls(snd_card_t *card, hdsp_t *hdsp)
 {
-	unsigned int idx, limit;
+	unsigned int idx;
 	int err;
 	snd_kcontrol_t *kctl;
 
@@ -2676,38 +3205,8 @@
 			hdsp->spdif_ctl = kctl;
 	}
 
-	snd_hdsp_playback_mixer.name = "Chn";
-	snd_hdsp_adat_sync_check.name = "ADAT Lock Status";
-
-	switch (hdsp->io_type) {
-	case Digiface:
-		limit = DIGIFACE_SS_CHANNELS;
-		break;
-	case H9652:
-		limit = H9652_SS_CHANNELS;
-		break;
-	case Multiface:
-		limit = MULTIFACE_SS_CHANNELS;
-		break;
-	default:
-		return -EIO;
-	}
-	
-	/* The index values are one greater than the channel ID so that alsamixer
-	   will display them correctly. We want to use the index for fast lookup
-	   of the relevant channel, but if we use it at all, most ALSA software
-	   does the wrong thing with it ...
-	*/
-
-	for (idx = 0; idx < limit; ++idx) {
-		snd_hdsp_playback_mixer.index = idx+1;
-		if ((err = snd_ctl_add (card, kctl = snd_ctl_new1(&snd_hdsp_playback_mixer, hdsp)))) {
-			return err;
-		}
-		hdsp->playback_mixer_ctls[idx] = kctl;
-	}
-	
 	/* ADAT SyncCheck status */
+	snd_hdsp_adat_sync_check.name = "ADAT Lock Status";
 	snd_hdsp_adat_sync_check.index = 1;
 	if ((err = snd_ctl_add (card, kctl = snd_ctl_new1(&snd_hdsp_adat_sync_check, hdsp)))) {
 		return err;
@@ -2720,6 +3219,22 @@
 			}
 		}
 	}
+	
+	/* DA, AD and Phone gain and XLR breakout cable controls for H9632 cards */
+	if (hdsp->io_type == H9632) {
+		for (idx = 0; idx < HDSP_9632_CONTROLS; idx++) {
+			if ((err = snd_ctl_add(card, kctl = snd_ctl_new1(&snd_hdsp_9632_controls[idx], hdsp))) < 0) {
+				return err;
+			}
+		}
+	}
+
+	/* AEB control for H96xx card */
+	if (hdsp->io_type == H9632 || hdsp->io_type == H9652) {
+		if ((err = snd_ctl_add(card, kctl = snd_ctl_new1(&snd_hdsp_96xx_aeb, hdsp))) < 0) {
+				return err;
+		}	
+	}
 
 	return 0;
 }
@@ -2812,6 +3327,15 @@
 	case HDSP_CLOCK_SOURCE_INTERNAL_96KHZ:
 		clock_source = "Internal 96 kHz";
 		break;
+	case HDSP_CLOCK_SOURCE_INTERNAL_128KHZ:
+		clock_source = "Internal 128 kHz";
+		break;
+	case HDSP_CLOCK_SOURCE_INTERNAL_176_4KHZ:
+		clock_source = "Internal 176.4 kHz";
+		break;
+		case HDSP_CLOCK_SOURCE_INTERNAL_192KHZ:
+		clock_source = "Internal 192 kHz";
+		break;	
 	default:
 		clock_source = "Error";		
 	}
@@ -2884,16 +3408,19 @@
 		
 	snd_iprintf(buffer, "\n");
 
-	switch ((hdsp->control_register & HDSP_SPDIFInputMask) >> 14) {
+	switch (hdsp_spdif_in(hdsp)) {
 	case HDSP_SPDIFIN_OPTICAL:
-		snd_iprintf(buffer, "IEC958 input: ADAT1\n");
+		snd_iprintf(buffer, "IEC958 input: Optical\n");
 		break;
 	case HDSP_SPDIFIN_COAXIAL:
 		snd_iprintf(buffer, "IEC958 input: Coaxial\n");
 		break;
-	case HDSP_SPDIFIN_INTERN:
+	case HDSP_SPDIFIN_INTERNAL:
 		snd_iprintf(buffer, "IEC958 input: Internal\n");
 		break;
+	case HDSP_SPDIFIN_AES:
+		snd_iprintf(buffer, "IEC958 input: AES\n");
+		break;
 	default:
 		snd_iprintf(buffer, "IEC958 input: ???\n");
 		break;
@@ -2980,13 +3507,60 @@
 	}
 
 	snd_iprintf(buffer, "\n");
+	
+	/* Informations about H9632 specific controls */
+	if (hdsp->io_type == H9632) {
+		char *tmp;
+	
+		switch (hdsp_ad_gain(hdsp)) {
+		case 0:
+			tmp = "-10 dBV";
+			break;
+		case 1:
+			tmp = "+4 dBu";
+			break;
+		default:
+			tmp = "Lo Gain";
+			break;
+		}
+		snd_iprintf(buffer, "AD Gain : %s\n", tmp);
+
+		switch (hdsp_da_gain(hdsp)) {
+		case 0:
+			tmp = "Hi Gain";
+			break;
+		case 1:
+			tmp = "+4 dBu";
+			break;
+		default:
+			tmp = "-10 dBV";
+			break;
+		}
+		snd_iprintf(buffer, "DA Gain : %s\n", tmp);
+		
+		switch (hdsp_phone_gain(hdsp)) {
+		case 0:
+			tmp = "0 dB";
+			break;
+		case 1:
+			tmp = "-6 dB";
+			break;
+		default:
+			tmp = "-12 dB";
+			break;
+		}
+		snd_iprintf(buffer, "Phones Gain : %s\n", tmp);
 
-#if 0
-	for (x = 0; x < 26; x++) {
-		unsigned int val = hdsp_read (hdsp, HDSP_inputPeakLevel + (4 * x));
-		snd_iprintf (buffer, "%d: input peak = %d overs = %d\n", x, val&0xffffff00, val&0xf);
+		snd_iprintf(buffer, "XLR Breakout Cable : %s\n", hdsp_xlr_breakout_cable(hdsp) ? "yes" : "no");	
+		
+		if (hdsp->control_register & HDSP_AnalogExtensionBoard) {
+			snd_iprintf(buffer, "AEB : on (ADAT1 internal)\n");
+		} else {
+			snd_iprintf(buffer, "AEB : off (ADAT1 external)\n");
+		}
+		snd_iprintf(buffer, "\n");
 	}
-#endif
+
 }
 
 static void __devinit snd_hdsp_proc_init(hdsp_t *hdsp)
@@ -2994,7 +3568,7 @@
 	snd_info_entry_t *entry;
 
 	if (! snd_card_proc_new(hdsp->card, "hdsp", &entry))
-		snd_info_set_text_ops(entry, hdsp, snd_hdsp_proc_read);
+		snd_info_set_text_ops(entry, hdsp, 1024, snd_hdsp_proc_read);
 }
 
 static void snd_hdsp_free_buffers(hdsp_t *hdsp)
@@ -3078,8 +3652,21 @@
 		                 HDSP_SPDIFInputCoaxial | 
 		                 hdsp_encode_latency(7) | 
 		                 HDSP_LineOut;
+	
 
 	hdsp_write(hdsp, HDSP_controlRegister, hdsp->control_register);
+
+#ifdef SNDRV_BIG_ENDIAN
+	hdsp->control2_register = HDSP_BIGENDIAN_MODE;
+#else
+	hdsp->control2_register = 0;
+#endif
+	if (hdsp->io_type == H9652) {
+	        snd_hdsp_9652_enable_mixer (hdsp);
+	} else {
+	    hdsp_write (hdsp, HDSP_control2Reg, hdsp->control2_register);
+	} 
+
 	hdsp_reset_hw_pointer(hdsp);
 	hdsp_compute_period_size(hdsp);
 
@@ -3089,7 +3676,7 @@
 		hdsp->mixer_matrix[i] = MINUS_INFINITY_GAIN;
 	}
 
-	for (i = 0; i < (hdsp->io_type == H9652 ? 1352 : HDSP_MATRIX_MIXER_SIZE); i++) {
+	for (i = 0; i < ((hdsp->io_type == H9652 || hdsp->io_type == H9632) ? 1352 : HDSP_MATRIX_MIXER_SIZE); ++i) {
 		if (hdsp_write_gain (hdsp, i, MINUS_INFINITY_GAIN)) {
 			return -EIO;
 		}
@@ -3097,21 +3684,30 @@
 	
 	if ((hdsp->io_type != H9652) && line_outs_monitor[hdsp->dev]) {
 		
+		int lineouts_base;
+		
 		snd_printk ("sending all inputs and playback streams to line outs.\n");
 
 		/* route all inputs to the line outs for easy monitoring. send
 		   odd numbered channels to right, even to left.
 		*/
+		if (hdsp->io_type == H9632) {
+			/* this is the phones/analog output */
+			lineouts_base = 10;
+		} else {
+			lineouts_base = 26;
+		}
 		
-		for (i = 0; i < HDSP_MAX_CHANNELS; i++) {
+		for (i = 0; i < hdsp->max_channels; i++) {
 			if (i & 1) { 
-				if (hdsp_write_gain (hdsp, hdsp_input_to_output_key (hdsp, i, 26), UNITY_GAIN) ||
-				    hdsp_write_gain (hdsp, hdsp_playback_to_output_key (hdsp, i, 26), UNITY_GAIN)) {
+				if (hdsp_write_gain (hdsp, hdsp_input_to_output_key (hdsp, i, lineouts_base), UNITY_GAIN) ||
+				    hdsp_write_gain (hdsp, hdsp_playback_to_output_key (hdsp, i, lineouts_base), UNITY_GAIN)) {
 				    return -EIO;
 				}    
 			} else {
-				if (hdsp_write_gain (hdsp, hdsp_input_to_output_key (hdsp, i, 27), UNITY_GAIN) ||
-				    hdsp_write_gain (hdsp, hdsp_playback_to_output_key (hdsp, i, 27), UNITY_GAIN)) {
+				if (hdsp_write_gain (hdsp, hdsp_input_to_output_key (hdsp, i, lineouts_base+1), UNITY_GAIN) ||
+				    hdsp_write_gain (hdsp, hdsp_playback_to_output_key (hdsp, i, lineouts_base+1), UNITY_GAIN)) {
+				    
 				    return -EIO;
 				}
 			}
@@ -3120,6 +3716,12 @@
 
 	hdsp->passthru = 0;
 
+	/* H9632 specific defaults */
+	if (hdsp->io_type == H9632) {
+		hdsp->control_register |= (HDSP_DAGainPlus4dBu | HDSP_ADGainPlus4dBu | HDSP_PhoneGain0dB);
+		hdsp_write(hdsp, HDSP_controlRegister, hdsp->control_register);
+	}
+
 	/* set a default rate so that the channel map is set up.
 	 */
 
@@ -3208,7 +3810,7 @@
 {
 	int mapped_channel;
 
-        snd_assert(channel >= 0 || channel < HDSP_MAX_CHANNELS, return NULL);
+        snd_assert(channel >= 0 || channel < hdsp->max_channels, return NULL);
         
 	if ((mapped_channel = hdsp->channel_map[channel]) < 0) {
 		return NULL;
@@ -3378,7 +3980,7 @@
 	hdsp_t *hdsp = _snd_pcm_substream_chip(substream);
 	int mapped_channel;
 
-	snd_assert(info->channel < HDSP_MAX_CHANNELS, return -EINVAL);
+	snd_assert(info->channel < hdsp->max_channels, return -EINVAL);
 
 	if ((mapped_channel = hdsp->channel_map[info->channel]) < 0) {
 		return -EINVAL;
@@ -3567,42 +4169,118 @@
 	.fifo_size =		0
 };
 
-static unsigned int period_sizes[] = { 64, 128, 256, 512, 1024, 2048, 4096, 8192 };
+static unsigned int hdsp_period_sizes[] = { 64, 128, 256, 512, 1024, 2048, 4096, 8192 };
+
+#define HDSP_PERIOD_SIZES sizeof(hdsp_period_sizes) / sizeof(hdsp_period_sizes[0])
+
+static snd_pcm_hw_constraint_list_t hdsp_hw_constraints_period_sizes = {
+	.count = HDSP_PERIOD_SIZES,
+	.list = hdsp_period_sizes,
+	.mask = 0
+};
+
+static unsigned int hdsp_9632_sample_rates[] = { 32000, 44100, 48000, 64000, 88200, 96000, 128000, 176400, 192000 };
 
-#define PERIOD_SIZES sizeof(period_sizes) / sizeof(period_sizes[0])
+#define HDSP_9632_SAMPLE_RATES sizeof(hdsp_9632_sample_rates) / sizeof(hdsp_9632_sample_rates[0])
 
-static snd_pcm_hw_constraint_list_t hw_constraints_period_sizes = {
-	.count = PERIOD_SIZES,
-	.list = period_sizes,
+static snd_pcm_hw_constraint_list_t hdsp_hw_constraints_9632_sample_rates = {
+	.count = HDSP_9632_SAMPLE_RATES,
+	.list = hdsp_9632_sample_rates,
 	.mask = 0
 };
 
-static int snd_hdsp_hw_rule_channels(snd_pcm_hw_params_t *params,
+static int snd_hdsp_hw_rule_in_channels(snd_pcm_hw_params_t *params,
+					snd_pcm_hw_rule_t *rule)
+{
+	hdsp_t *hdsp = rule->private;
+	snd_interval_t *c = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS);
+	if (hdsp->io_type == H9632) {
+		unsigned int list[3];
+		list[0] = hdsp->qs_in_channels;
+		list[1] = hdsp->ds_in_channels;
+		list[2] = hdsp->ss_in_channels;
+		return snd_interval_list(c, 3, list, 0);
+	} else {
+		unsigned int list[2];
+		list[0] = hdsp->ds_in_channels;
+		list[1] = hdsp->ss_in_channels;
+		return snd_interval_list(c, 2, list, 0);
+	}
+}
+
+static int snd_hdsp_hw_rule_out_channels(snd_pcm_hw_params_t *params,
 					snd_pcm_hw_rule_t *rule)
 {
+	unsigned int list[3];
 	hdsp_t *hdsp = rule->private;
 	snd_interval_t *c = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS);
-	unsigned int list[2] = { hdsp->ds_channels, hdsp->ss_channels };
+	if (hdsp->io_type == H9632) {
+		list[0] = hdsp->qs_out_channels;
+		list[1] = hdsp->ds_out_channels;
+		list[2] = hdsp->ss_out_channels;
+		return snd_interval_list(c, 3, list, 0);
+	} else {
+		list[0] = hdsp->ds_out_channels;
+		list[1] = hdsp->ss_out_channels;
+	}
 	return snd_interval_list(c, 2, list, 0);
 }
 
-static int snd_hdsp_hw_rule_channels_rate(snd_pcm_hw_params_t *params,
+static int snd_hdsp_hw_rule_in_channels_rate(snd_pcm_hw_params_t *params,
+					     snd_pcm_hw_rule_t *rule)
+{
+	hdsp_t *hdsp = rule->private;
+	snd_interval_t *c = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS);
+	snd_interval_t *r = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE);
+	if (r->min > 96000 && hdsp->io_type == H9632) {
+		snd_interval_t t = {
+			.min = hdsp->qs_in_channels,
+			.max = hdsp->qs_in_channels,
+			.integer = 1,
+		};
+		return snd_interval_refine(c, &t);	
+	} else if (r->min > 48000 && r->max <= 96000) {
+		snd_interval_t t = {
+			.min = hdsp->ds_in_channels,
+			.max = hdsp->ds_in_channels,
+			.integer = 1,
+		};
+		return snd_interval_refine(c, &t);
+	} else if (r->max < 64000) {
+		snd_interval_t t = {
+			.min = hdsp->ss_in_channels,
+			.max = hdsp->ss_in_channels,
+			.integer = 1,
+		};
+		return snd_interval_refine(c, &t);
+	}
+	return 0;
+}
+
+static int snd_hdsp_hw_rule_out_channels_rate(snd_pcm_hw_params_t *params,
 					     snd_pcm_hw_rule_t *rule)
 {
 	hdsp_t *hdsp = rule->private;
 	snd_interval_t *c = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS);
 	snd_interval_t *r = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE);
-	if (r->min > 48000) {
+	if (r->min > 96000 && hdsp->io_type == H9632) {
+		snd_interval_t t = {
+			.min = hdsp->qs_out_channels,
+			.max = hdsp->qs_out_channels,
+			.integer = 1,
+		};
+		return snd_interval_refine(c, &t);	
+	} else if (r->min > 48000 && r->max <= 96000) {
 		snd_interval_t t = {
-			.min = hdsp->ds_channels,
-			.max = hdsp->ds_channels,
+			.min = hdsp->ds_out_channels,
+			.max = hdsp->ds_out_channels,
 			.integer = 1,
 		};
 		return snd_interval_refine(c, &t);
 	} else if (r->max < 64000) {
 		snd_interval_t t = {
-			.min = hdsp->ss_channels,
-			.max = hdsp->ss_channels,
+			.min = hdsp->ss_out_channels,
+			.max = hdsp->ss_out_channels,
 			.integer = 1,
 		};
 		return snd_interval_refine(c, &t);
@@ -3610,20 +4288,58 @@
 	return 0;
 }
 
-static int snd_hdsp_hw_rule_rate_channels(snd_pcm_hw_params_t *params,
+static int snd_hdsp_hw_rule_rate_out_channels(snd_pcm_hw_params_t *params,
+					     snd_pcm_hw_rule_t *rule)
+{
+	hdsp_t *hdsp = rule->private;
+	snd_interval_t *c = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS);
+	snd_interval_t *r = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE);
+	if (c->min >= hdsp->ss_out_channels) {
+		snd_interval_t t = {
+			.min = 32000,
+			.max = 48000,
+			.integer = 1,
+		};
+		return snd_interval_refine(r, &t);
+	} else if (c->max <= hdsp->qs_out_channels && hdsp->io_type == H9632) {
+		snd_interval_t t = {
+			.min = 128000,
+			.max = 192000,
+			.integer = 1,
+		};
+		return snd_interval_refine(r, &t);
+	} else if (c->max <= hdsp->ds_out_channels) {
+		snd_interval_t t = {
+			.min = 64000,
+			.max = 96000,
+			.integer = 1,
+		};
+		return snd_interval_refine(r, &t);
+	}
+	return 0;
+}
+
+static int snd_hdsp_hw_rule_rate_in_channels(snd_pcm_hw_params_t *params,
 					     snd_pcm_hw_rule_t *rule)
 {
 	hdsp_t *hdsp = rule->private;
 	snd_interval_t *c = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS);
 	snd_interval_t *r = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE);
-	if (c->min >= hdsp->ss_channels) {
+	if (c->min >= hdsp->ss_in_channels) {
 		snd_interval_t t = {
 			.min = 32000,
 			.max = 48000,
 			.integer = 1,
 		};
 		return snd_interval_refine(r, &t);
-	} else if (c->max <= hdsp->ds_channels) {
+	} else if (c->max <= hdsp->qs_in_channels && hdsp->io_type == H9632) {
+		snd_interval_t t = {
+			.min = 128000,
+			.max = 192000,
+			.integer = 1,
+		};
+		return snd_interval_refine(r, &t);
+	} else if (c->max <= hdsp->ds_in_channels) {
 		snd_interval_t t = {
 			.min = 64000,
 			.max = 96000,
@@ -3674,15 +4390,23 @@
 	spin_unlock_irqrestore(&hdsp->lock, flags);
 
 	snd_pcm_hw_constraint_msbits(runtime, 0, 32, 24);
-	snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, &hw_constraints_period_sizes);
+	snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, &hdsp_hw_constraints_period_sizes);
+	if (hdsp->io_type == H9632) {
+		runtime->hw.channels_min = hdsp->qs_out_channels;
+		runtime->hw.channels_max = hdsp->ss_out_channels;
+		runtime->hw.rate_max = 192000;
+		runtime->hw.rates = SNDRV_PCM_RATE_KNOT;
+		snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, &hdsp_hw_constraints_9632_sample_rates);
+	}
+	
 	snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
-			     snd_hdsp_hw_rule_channels, hdsp,
+			     snd_hdsp_hw_rule_out_channels, hdsp,
 			     SNDRV_PCM_HW_PARAM_CHANNELS, -1);
 	snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
-			     snd_hdsp_hw_rule_channels_rate, hdsp,
+			     snd_hdsp_hw_rule_out_channels_rate, hdsp,
 			     SNDRV_PCM_HW_PARAM_RATE, -1);
 	snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
-			     snd_hdsp_hw_rule_rate_channels, hdsp,
+			     snd_hdsp_hw_rule_rate_out_channels, hdsp,
 			     SNDRV_PCM_HW_PARAM_CHANNELS, -1);
 
 	hdsp->creg_spdif_stream = hdsp->creg_spdif;
@@ -3751,15 +4475,22 @@
 	spin_unlock_irqrestore(&hdsp->lock, flags);
 
 	snd_pcm_hw_constraint_msbits(runtime, 0, 32, 24);
-	snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, &hw_constraints_period_sizes);
+	snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, &hdsp_hw_constraints_period_sizes);
+	if (hdsp->io_type == H9632) {
+		runtime->hw.channels_min = hdsp->qs_in_channels;
+		runtime->hw.channels_max = hdsp->ss_in_channels;
+		runtime->hw.rate_max = 192000;
+		runtime->hw.rates = SNDRV_PCM_RATE_KNOT;
+		snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, &hdsp_hw_constraints_9632_sample_rates);
+	}
 	snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
-			     snd_hdsp_hw_rule_channels, hdsp,
+			     snd_hdsp_hw_rule_in_channels, hdsp,
 			     SNDRV_PCM_HW_PARAM_CHANNELS, -1);
 	snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
-			     snd_hdsp_hw_rule_channels_rate, hdsp,
+			     snd_hdsp_hw_rule_in_channels_rate, hdsp,
 			     SNDRV_PCM_HW_PARAM_RATE, -1);
 	snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
-			     snd_hdsp_hw_rule_rate_channels, hdsp,
+			     snd_hdsp_hw_rule_rate_in_channels, hdsp,
 			     SNDRV_PCM_HW_PARAM_CHANNELS, -1);
 	return 0;
 }
@@ -3780,42 +4511,117 @@
 
 static int snd_hdsp_hwdep_dummy_op(snd_hwdep_t *hw, struct file *file)
 {
-    /* we have nothing to initialize but the call is required */
-    return 0;
+	/* we have nothing to initialize but the call is required */
+	return 0;
 }
 
 
 static int snd_hdsp_hwdep_ioctl(snd_hwdep_t *hw, struct file *file, unsigned int cmd, unsigned long arg)
 {
 	hdsp_t *hdsp = (hdsp_t *)hw->private_data;	
-	
+
 	switch (cmd) {
 	case SNDRV_HDSP_IOCTL_GET_PEAK_RMS: {
 		hdsp_peak_rms_t *peak_rms;
-
+		int i;
+		
 		if (hdsp->io_type == H9652) {
-		    snd_printk("hardware metering isn't supported yet for hdsp9652 cards\n");
-		    return -EINVAL;
+			unsigned long rms_low, rms_high;
+			int doublespeed = 0;
+			if (hdsp_read (hdsp, HDSP_statusRegister) & HDSP_DoubleSpeedStatus)
+				doublespeed = 1;
+			peak_rms = (hdsp_peak_rms_t *)arg;
+			for (i = 0; i < 26; ++i) {
+				if (!(doublespeed && (i & 4))) {
+					if (copy_to_user_fromio((void *)peak_rms->input_peaks+i*4, hdsp->iobase+HDSP_9652_peakBase-i*4, 4) != 0)
+						return -EFAULT;
+					if (copy_to_user_fromio((void *)peak_rms->playback_peaks+i*4, hdsp->iobase+HDSP_9652_peakBase-(doublespeed ? 14 : 26)*4-i*4, 4) != 0)
+						return -EFAULT;
+					if (copy_to_user_fromio((void *)peak_rms->output_peaks+i*4, hdsp->iobase+HDSP_9652_peakBase-2*(doublespeed ? 14 : 26)*4-i*4, 4) != 0)
+						return -EFAULT;
+					rms_low = *(u32 *)(hdsp->iobase+HDSP_9652_rmsBase+i*8) & 0xFFFFFF00;
+					rms_high = *(u32 *)(hdsp->iobase+HDSP_9652_rmsBase+i*8+4) & 0xFFFFFF00;
+					rms_high += (rms_low >> 24);
+					rms_low <<= 8;
+					if (copy_to_user((void *)peak_rms->input_rms+i*8, &rms_low, 4) != 0)
+						return -EFAULT;
+					if (copy_to_user((void *)peak_rms->input_rms+i*8+4, &rms_high, 4) != 0)
+						return -EFAULT;					
+					rms_low = *(u32 *)(hdsp->iobase+HDSP_9652_rmsBase+(doublespeed ? 14 : 26)*8+i*8) & 0xFFFFFF00;
+					rms_high = *(u32 *)(hdsp->iobase+HDSP_9652_rmsBase+(doublespeed ? 14 : 26)*8+i*8+4) & 0xFFFFFF00;
+					rms_high += (rms_low >> 24);
+					rms_low <<= 8;
+					if (copy_to_user((void *)peak_rms->playback_rms+i*8, &rms_low, 4) != 0)
+						return -EFAULT;
+					if (copy_to_user((void *)peak_rms->playback_rms+i*8+4, &rms_high, 4) != 0)
+						return -EFAULT;					
+					rms_low = *(u32 *)(hdsp->iobase+HDSP_9652_rmsBase+2*(doublespeed ? 14 : 26)*8+i*8) & 0xFFFFFF00;
+					rms_high = *(u32 *)(hdsp->iobase+HDSP_9652_rmsBase+2*(doublespeed ? 14 : 26)*8+i*8+4) & 0xFFFFFF00;
+					rms_high += (rms_low >> 24);
+					rms_low <<= 8;
+					if (copy_to_user((void *)peak_rms->output_rms+i*8, &rms_low, 4) != 0)
+						return -EFAULT;
+					if (copy_to_user((void *)peak_rms->output_rms+i*8+4, &rms_high, 4) != 0)
+						return -EFAULT;					
+				}
+			}
+			return 0;
+		}
+		if (hdsp->io_type == H9632) {
+			int j;
+			hdsp_9632_meters_t *m;
+			int doublespeed = 0;
+			if (hdsp_read (hdsp, HDSP_statusRegister) & HDSP_DoubleSpeedStatus)
+				doublespeed = 1;
+			m = (hdsp_9632_meters_t *)(hdsp->iobase+HDSP_9632_metersBase);
+			peak_rms = (hdsp_peak_rms_t *)arg;
+			for (i = 0, j = 0; i < 16; ++i, ++j) {
+				if (copy_to_user((void *)peak_rms->input_peaks+i*4, &(m->input_peak[j]), 4) != 0)
+					return -EFAULT;
+				if (copy_to_user((void *)peak_rms->playback_peaks+i*4, &(m->playback_peak[j]), 4) != 0)
+					return -EFAULT;
+				if (copy_to_user((void *)peak_rms->output_peaks+i*4, &(m->output_peak[j]), 4) != 0)
+					return -EFAULT;
+				if (copy_to_user((void *)peak_rms->input_rms+i*8, &(m->input_rms_low[j]), 4) != 0)
+					return -EFAULT;
+				if (copy_to_user((void *)peak_rms->playback_rms+i*8, &(m->playback_rms_low[j]), 4) != 0)
+					return -EFAULT;
+				if (copy_to_user((void *)peak_rms->output_rms+i*8, &(m->output_rms_low[j]), 4) != 0)
+					return -EFAULT;
+				if (copy_to_user((void *)peak_rms->input_rms+i*8+4, &(m->input_rms_high[j]), 4) != 0)
+					return -EFAULT;
+				if (copy_to_user((void *)peak_rms->playback_rms+i*8+4, &(m->playback_rms_high[j]), 4) != 0)
+					return -EFAULT;
+				if (copy_to_user((void *)peak_rms->output_rms+i*8+4, &(m->output_rms_high[j]), 4) != 0)
+					return -EFAULT;
+				if (doublespeed && i == 3) i += 4;
+			}
+			return 0;
 		}
 		if (!(hdsp->state & HDSP_FirmwareLoaded)) {
 			snd_printk("firmware needs to be uploaded to the card.\n");	
 			return -EINVAL;
 		}
 		peak_rms = (hdsp_peak_rms_t *)arg;
-		if (copy_to_user_fromio((void *)peak_rms->playback_peaks, hdsp->iobase+HDSP_playbackPeakLevel, 26*4) != 0) {
-			return -EFAULT;
-		}
-		if (copy_to_user_fromio((void *)peak_rms->input_peaks, hdsp->iobase+HDSP_inputPeakLevel, 26*4) != 0) {
-			return -EFAULT;
-		}
-		if (copy_to_user_fromio((void *)peak_rms->output_peaks, hdsp->iobase+HDSP_outputPeakLevel, 28*4) != 0) {
-			return -EFAULT;
-		}
-		if (copy_to_user_fromio((void *)peak_rms->playback_rms, hdsp->iobase+HDSP_playbackRmsLevel, 26*8) != 0) {
-			return -EFAULT;
-		}
-		if (copy_to_user_fromio((void *)peak_rms->input_rms, hdsp->iobase+HDSP_inputRmsLevel, 26*8) != 0) {
-			return -EFAULT;
+		for (i = 0; i < 26; ++i) {
+		    if (copy_to_user((void *)peak_rms->playback_peaks+i*4, (void *)hdsp->iobase+HDSP_playbackPeakLevel+i*4, 4) != 0)
+			    return -EFAULT;
+		    if (copy_to_user((void *)peak_rms->input_peaks+i*4, (void *)hdsp->iobase+HDSP_inputPeakLevel+i*4, 4) != 0)
+			    return -EFAULT;
+		}
+		for (i = 0; i < 26; ++i) {
+			if (copy_to_user((void *)peak_rms->playback_rms+i*8+4, (void *)hdsp->iobase+HDSP_playbackRmsLevel+i*8, 4) != 0)
+				return -EFAULT;
+			if (copy_to_user((void *)peak_rms->playback_rms+i*8, (void *)hdsp->iobase+HDSP_playbackRmsLevel+i*8+4, 4) != 0)
+				return -EFAULT;
+			if (copy_to_user((void *)peak_rms->input_rms+i*8+4, (void *)hdsp->iobase+HDSP_inputRmsLevel+i*8, 4) != 0)
+				return -EFAULT;
+			if (copy_to_user((void *)peak_rms->input_rms+i*8, (void *)hdsp->iobase+HDSP_inputRmsLevel+i*8+4, 4) != 0)
+				return -EFAULT;
+		}
+		for (i = 0; i < 28; ++i) {
+		    if (copy_to_user((void *)peak_rms->output_peaks+i*4, (void *)hdsp->iobase+HDSP_outputPeakLevel+i*4, 4) != 0)
+			    return -EFAULT;
 		}
 		break;
 	}
@@ -3823,7 +4629,7 @@
 		hdsp_config_info_t info;
 		unsigned long flags;
 		int i;
-
+		
 		if (!(hdsp->state & HDSP_FirmwareLoaded)) {
 			snd_printk("Firmware needs to be uploaded to the card.\n");	
 			return -EINVAL;
@@ -3831,9 +4637,11 @@
 		spin_lock_irqsave(&hdsp->lock, flags);
 		info.pref_sync_ref = (unsigned char)hdsp_pref_sync_ref(hdsp);
 		info.wordclock_sync_check = (unsigned char)hdsp_wc_sync_check(hdsp);
-		info.adatsync_sync_check = (unsigned char)hdsp_adatsync_sync_check(hdsp);
+		if (hdsp->io_type != H9632) {
+		    info.adatsync_sync_check = (unsigned char)hdsp_adatsync_sync_check(hdsp);
+		}
 		info.spdif_sync_check = (unsigned char)hdsp_spdif_sync_check(hdsp);
-		for (i = 0; i < ((hdsp->io_type != Multiface) ? 3 : 1); ++i) {
+		for (i = 0; i < ((hdsp->io_type != Multiface && hdsp->io_type != H9632) ? 3 : 1); ++i) {
 			info.adat_sync_check[i] = (unsigned char)hdsp_adat_sync_check(hdsp, i);
 		}
 		info.spdif_in = (unsigned char)hdsp_spdif_in(hdsp);
@@ -3849,16 +4657,36 @@
 		info.autosync_ref = (unsigned char)hdsp_autosync_ref(hdsp);
 		info.line_out = (unsigned char)hdsp_line_out(hdsp);
 		info.passthru = (unsigned char)hdsp->passthru;
+		if (hdsp->io_type == H9632) {
+			info.da_gain = (unsigned char)hdsp_da_gain(hdsp);
+			info.ad_gain = (unsigned char)hdsp_ad_gain(hdsp);
+			info.phone_gain = (unsigned char)hdsp_phone_gain(hdsp);
+			info.xlr_breakout_cable = (unsigned char)hdsp_xlr_breakout_cable(hdsp);
+		
+		}
+		if (hdsp->io_type == H9632 || hdsp->io_type == H9652) {
+			info.analog_extension_board = (unsigned char)hdsp_aeb(hdsp);
+		}
 		spin_unlock_irqrestore(&hdsp->lock, flags);
 		if (copy_to_user((void *)arg, &info, sizeof(info)))
 			return -EFAULT;
 		break;
 	}
+	case SNDRV_HDSP_IOCTL_GET_9632_AEB: {
+		hdsp_9632_aeb_t h9632_aeb;
+		
+		if (hdsp->io_type != H9632) return -EINVAL;
+		h9632_aeb.aebi = hdsp->ss_in_channels - H9632_SS_CHANNELS;
+		h9632_aeb.aebo = hdsp->ss_out_channels - H9632_SS_CHANNELS;
+		if (copy_to_user((void *)arg, &h9632_aeb, sizeof(h9632_aeb)))
+			return -EFAULT;
+		break;
+	}
 	case SNDRV_HDSP_IOCTL_GET_VERSION: {
 		hdsp_version_t hdsp_version;
 		int err;
-
-		if (hdsp->io_type == H9652) return -EINVAL;
+		
+		if (hdsp->io_type == H9652 || hdsp->io_type == H9632) return -EINVAL;
 		if (hdsp->io_type == Undefined) {
 			if ((err = hdsp_get_iobox_version(hdsp)) < 0) {
 				return err;
@@ -3875,17 +4703,18 @@
 		hdsp_firmware_t *firmware;
 		unsigned long *firmware_data;
 		int err;
-
-		if (hdsp->io_type == H9652) return -EINVAL;
+		
+		if (hdsp->io_type == H9652 || hdsp->io_type == H9632) return -EINVAL;
 		/* SNDRV_HDSP_IOCTL_GET_VERSION must have been called */
 		if (hdsp->io_type == Undefined) return -EINVAL;
 
 		snd_printk("initializing firmware upload\n");
 		firmware = (hdsp_firmware_t *)arg;
+
 		if (get_user(firmware_data, &firmware->firmware_data)) {
 			return -EFAULT;
 		}
-
+		
 		if (hdsp_check_for_iobox (hdsp)) {
 			return -EIO;
 		}
@@ -3900,7 +4729,6 @@
 			return err;
 		}
 		
-		
 		if (!(hdsp->state & HDSP_InitializationComplete)) {
 			snd_hdsp_initialize_channels(hdsp);
 		
@@ -3914,8 +4742,8 @@
 		break;
 	}
 	case SNDRV_HDSP_IOCTL_GET_MIXER: {
-		hdsp_mixer_t	*mixer;
-
+		hdsp_mixer_t *mixer;
+		
 		mixer = (hdsp_mixer_t *)arg;
 		if (copy_to_user(mixer->matrix, hdsp->mixer_matrix, sizeof(unsigned short)*HDSP_MATRIX_MIXER_SIZE))
 			return -EFAULT;
@@ -4011,7 +4839,7 @@
 		return -EIO;
 	}
 	
-	for (i = 0; i < HDSP_MAX_CHANNELS; ++i) {
+	for (i = 0; i < hdsp->max_channels; ++i) {
 		hdsp_write (hdsp, HDSP_inputEnable + (4 * i), 1);
 		hdsp_write (hdsp, HDSP_outputEnable + (4 * i), 1);
 	}
@@ -4021,24 +4849,41 @@
 
 static inline void snd_hdsp_initialize_channels(hdsp_t *hdsp)
 {
+	int status, aebi_channels, aebo_channels;
+	
 	switch (hdsp->io_type) {
 	case Digiface:
 		hdsp->card_name = "RME Hammerfall DSP + Digiface";
-		hdsp->ss_channels = DIGIFACE_SS_CHANNELS;
-		hdsp->ds_channels = DIGIFACE_DS_CHANNELS;
+		hdsp->ss_in_channels = hdsp->ss_out_channels = DIGIFACE_SS_CHANNELS;
+		hdsp->ds_in_channels = hdsp->ds_out_channels = DIGIFACE_DS_CHANNELS;
 		break;
 
 	case H9652:
 		hdsp->card_name = "RME Hammerfall HDSP 9652";
-		hdsp->ss_channels = H9652_SS_CHANNELS;
-		hdsp->ds_channels = H9652_DS_CHANNELS;
+		hdsp->ss_in_channels = hdsp->ss_out_channels = H9652_SS_CHANNELS;
+		hdsp->ds_in_channels = hdsp->ds_out_channels = H9652_DS_CHANNELS;
+		break;
+	
+	case H9632:
+		status = hdsp_read(hdsp, HDSP_statusRegister);
+		/* HDSP_AEBx bits are low when AEB are connected */
+		aebi_channels = (status & HDSP_AEBI) ? 0 : 4;
+		aebo_channels = (status & HDSP_AEBO) ? 0 : 4;
+		hdsp->card_name = "RME Hammerfall HDSP 9632";
+		hdsp->ss_in_channels = H9632_SS_CHANNELS+aebi_channels;
+		hdsp->ds_in_channels = H9632_DS_CHANNELS+aebi_channels;
+		hdsp->qs_in_channels = H9632_QS_CHANNELS+aebi_channels;
+		hdsp->ss_out_channels = H9632_SS_CHANNELS+aebo_channels;
+		hdsp->ds_out_channels = H9632_DS_CHANNELS+aebo_channels;
+		hdsp->qs_out_channels = H9632_QS_CHANNELS+aebo_channels;
 		break;
 
 	case Multiface:
 		hdsp->card_name = "RME Hammerfall DSP + Multiface";
-		hdsp->ss_channels = MULTIFACE_SS_CHANNELS;
-		hdsp->ds_channels = MULTIFACE_DS_CHANNELS;
-
+		hdsp->ss_in_channels = hdsp->ss_out_channels = MULTIFACE_SS_CHANNELS;
+		hdsp->ds_in_channels = hdsp->ds_out_channels = MULTIFACE_DS_CHANNELS;
+		break;
+		
 	default:
  		/* should never get here */
 		break;
@@ -4056,38 +4901,40 @@
 	int err;
 	
 	if ((err = snd_hdsp_create_pcm(card, hdsp)) < 0) {
+		snd_printk("Error creating pcm interface\n");
 		return err;
 	}
 	
+
 	if ((err = snd_hdsp_create_midi(card, hdsp, 0)) < 0) {
+		snd_printk("Error creating first midi interface\n");
 		return err;
 	}
 
+
 	if ((err = snd_hdsp_create_midi(card, hdsp, 1)) < 0) {
+		snd_printk("Error creating second midi interface\n");
 		return err;
 	}
 
 	if ((err = snd_hdsp_create_controls(card, hdsp)) < 0) {
+		snd_printk("Error creating ctl interface\n");
 		return err;
 	}
 
 	snd_hdsp_proc_init(hdsp);
 
-	hdsp->last_spdif_sample_rate = -1;
 	hdsp->system_sample_rate = -1;
-	hdsp->last_external_sample_rate = -1;
-	hdsp->last_internal_sample_rate = -1;
 	hdsp->playback_pid = -1;
 	hdsp->capture_pid = -1;
 	hdsp->capture_substream = NULL;
 	hdsp->playback_substream = NULL;
 
 	if ((err = snd_hdsp_set_defaults(hdsp)) < 0) {
+		snd_printk("Error setting default values\n");
 		return err;
 	}
 	
-	hdsp_update_simple_mixer_controls(hdsp);
-	
 	if (!(hdsp->state & HDSP_InitializationComplete)) {
 		sprintf(card->longname, "%s at 0x%lx, irq %d", hdsp->card_name, 
 			hdsp->port, hdsp->irq);
@@ -4108,8 +4955,8 @@
 {
 	struct pci_dev *pci = hdsp->pci;
 	int err;
-	int i;
 	int is_9652 = 0;
+	int is_9632 = 0;
 
 	hdsp->irq = -1;
 	hdsp->state = 0;
@@ -4123,9 +4970,10 @@
 	spin_lock_init(&hdsp->midi[1].lock);
 	hdsp->iobase = 0;
 	hdsp->res_port = 0;
+	hdsp->control_register = 0;
+	hdsp->control2_register = 0;
 	hdsp->io_type = Undefined;
-	for (i = 0; i < HDSP_MAX_CHANNELS; ++i)
-		hdsp->playback_mixer_ctls[i] = 0;
+	hdsp->max_channels = 26;
 
 	hdsp->card = card;
 	
@@ -4134,6 +4982,16 @@
 	tasklet_init(&hdsp->midi_tasklet, hdsp_midi_tasklet, (unsigned long)hdsp);
 	
 	pci_read_config_word(hdsp->pci, PCI_CLASS_REVISION, &hdsp->firmware_rev);
+	
+	/* From Martin Bjoernsen :
+	    "It is important that the card's latency timer register in
+	    the PCI configuration space is set to a value much larger
+	    than 0 by the computer's BIOS or the driver.
+	    The windows driver always sets this 8 bit register [...]
+	    to its maximum 255 to avoid problems with some computers."
+	*/
+	pci_write_config_byte(hdsp->pci, PCI_LATENCY_TIMER, 0xFF);
+	
 	strcpy(card->driver, "H-DSP");
 	strcpy(card->mixername, "Xilinx FPGA");
 
@@ -4150,7 +5008,11 @@
 		hdsp->card_name = "RME HDSP 9652";
 		is_9652 = 1;
 		break;
-
+	case 0x96:
+		hdsp->card_name = "RME HDSP 9632";
+		hdsp->max_channels = 16;
+		is_9632 = 1;
+		break;
 	default:
 		return -ENODEV;
 	}
@@ -4185,7 +5047,7 @@
 		return err;
 	}
 	
-	if (!is_9652 && hdsp_check_for_iobox (hdsp)) {
+	if (!is_9652 && !is_9632 && hdsp_check_for_iobox (hdsp)) {
 		/* no iobox connected, we defer initialization */
 		snd_printk("card initialization pending : waiting for firmware\n");
 		if ((err = snd_hdsp_create_hwdep(card, hdsp)) < 0) {
@@ -4216,7 +5078,10 @@
 
 	if (is_9652) {
 	        hdsp->io_type = H9652;
-	        snd_hdsp_9652_enable_mixer (hdsp);
+	}
+	
+	if (is_9632) {
+		hdsp->io_type = H9632;
 	}
 
 	if ((err = snd_hdsp_create_hwdep(card, hdsp)) < 0) {
@@ -4289,6 +5154,7 @@
 	card->private_free = snd_hdsp_card_free;
 	hdsp->dev = dev;
 	hdsp->pci = pci;
+	snd_card_set_dev(card, &pci->dev);
 
 	if ((err = snd_hdsp_create(card, hdsp, precise_ptr[dev])) < 0) {
 		snd_card_free(card);
--- diff/sound/pci/rme9652/rme9652.c	2003-08-20 14:16:36.000000000 +0100
+++ source/sound/pci/rme9652/rme9652.c	2004-02-09 10:39:58.000000000 +0000
@@ -1618,7 +1618,6 @@
 RME9652_SPDIF_RATE("IEC958 Sample Rate", 0),
 RME9652_ADAT_SYNC("ADAT1 Sync Check", 0, 0),
 RME9652_ADAT_SYNC("ADAT2 Sync Check", 0, 1),
-RME9652_ADAT_SYNC("ADAT3 Sync Check", 0, 2),
 RME9652_TC_VALID("Timecode Valid", 0),
 RME9652_PASSTHRU("Passthru", 0)
 };
@@ -1835,7 +1834,7 @@
 	snd_info_entry_t *entry;
 
 	if (! snd_card_proc_new(rme9652->card, "rme9652", &entry))
-		snd_info_set_text_ops(entry, rme9652, snd_rme9652_proc_read);
+		snd_info_set_text_ops(entry, rme9652, 1024, snd_rme9652_proc_read);
 }
 
 static void snd_rme9652_free_buffers(rme9652_t *rme9652)
@@ -2705,6 +2704,7 @@
 	card->private_free = snd_rme9652_card_free;
 	rme9652->dev = dev;
 	rme9652->pci = pci;
+	snd_card_set_dev(card, &pci->dev);
 
 	if ((err = snd_rme9652_create(card, rme9652, precise_ptr[dev])) < 0) {
 		snd_card_free(card);
--- diff/sound/pci/sonicvibes.c	2003-08-26 10:00:55.000000000 +0100
+++ source/sound/pci/sonicvibes.c	2004-02-09 10:39:58.000000000 +0000
@@ -1177,7 +1177,7 @@
 	snd_info_entry_t *entry;
 
 	if (! snd_card_proc_new(sonic->card, "sonicvibes", &entry))
-		snd_info_set_text_ops(entry, sonic, snd_sonicvibes_proc_read);
+		snd_info_set_text_ops(entry, sonic, 1024, snd_sonicvibes_proc_read);
 }
 
 /*
@@ -1249,11 +1249,11 @@
 	if ((err = pci_enable_device(pci)) < 0)
 		return err;
 	/* check, if we can restrict PCI DMA transfers to 24 bits */
-        if (!pci_dma_supported(pci, 0x00ffffff)) {
+        if (pci_set_dma_mask(pci, 0x00ffffff) < 0 ||
+	    pci_set_consistent_dma_mask(pci, 0x00ffffff) < 0) {
                 snd_printk("architecture does not support 24bit PCI busmaster DMA\n");
                 return -ENXIO;
         }
-	pci_set_dma_mask(pci, 0x00ffffff);
 
 	sonic = snd_magic_kcalloc(sonicvibes_t, 0, GFP_KERNEL);
 	if (sonic == NULL)
@@ -1384,6 +1384,8 @@
 		return err;
 	}
 
+	snd_card_set_dev(card, &pci->dev);
+
 	*rsonic = sonic;
 	return 0;
 }
@@ -1467,6 +1469,15 @@
 		snd_card_free(card);
 		return err;
 	}
+
+	strcpy(card->driver, "SonicVibes");
+	strcpy(card->shortname, "S3 SonicVibes");
+	sprintf(card->longname, "%s rev %i at 0x%lx, irq %i",
+		card->shortname,
+		sonic->revision,
+		pci_resource_start(pci, 1),
+		sonic->irq);
+
 	if ((err = snd_sonicvibes_pcm(sonic, 0, NULL)) < 0) {
 		snd_card_free(card);
 		return err;
@@ -1497,13 +1508,6 @@
 	sonic->gameport.io = sonic->game_port;
 	gameport_register_port(&sonic->gameport);
 #endif
-	strcpy(card->driver, "SonicVibes");
-	strcpy(card->shortname, "S3 SonicVibes");
-	sprintf(card->longname, "%s rev %i at 0x%lx, irq %i",
-		card->shortname,
-		sonic->revision,
-		pci_resource_start(pci, 1),
-		sonic->irq);
 
 	if ((err = snd_card_register(card)) < 0) {
 		snd_card_free(card);
--- diff/sound/pci/trident/trident.c	2003-08-20 14:16:36.000000000 +0100
+++ source/sound/pci/trident/trident.c	2004-02-09 10:39:58.000000000 +0000
@@ -106,6 +106,30 @@
 		snd_card_free(card);
 		return err;
 	}
+
+	switch (trident->device) {
+	case TRIDENT_DEVICE_ID_DX:
+		str = "TRID4DWAVEDX";
+		break;
+	case TRIDENT_DEVICE_ID_NX:
+		str = "TRID4DWAVENX";
+		break;
+	case TRIDENT_DEVICE_ID_SI7018:
+		str = "SI7018";
+		break;
+	default:
+		str = "Unknown";
+	}
+	strcpy(card->driver, str);
+	if (trident->device == TRIDENT_DEVICE_ID_SI7018) {
+		strcpy(card->shortname, "SiS ");
+	} else {
+		strcpy(card->shortname, "Trident ");
+	}
+	strcat(card->shortname, card->driver);
+	sprintf(card->longname, "%s PCI Audio at 0x%lx, irq %d",
+		card->shortname, trident->port, trident->irq);
+
 	if ((err = snd_trident_pcm(trident, pcm_dev++, NULL)) < 0) {
 		snd_card_free(card);
 		return err;
@@ -141,29 +165,6 @@
 
 	snd_trident_gameport(trident);
 
-	switch (trident->device) {
-	case TRIDENT_DEVICE_ID_DX:
-		str = "TRID4DWAVEDX";
-		break;
-	case TRIDENT_DEVICE_ID_NX:
-		str = "TRID4DWAVENX";
-		break;
-	case TRIDENT_DEVICE_ID_SI7018:
-		str = "SI7018";
-		break;
-	default:
-		str = "Unknown";
-	}
-	strcpy(card->driver, str);
-	if (trident->device == TRIDENT_DEVICE_ID_SI7018) {
-		strcpy(card->shortname, "SiS ");
-	} else {
-		strcpy(card->shortname, "Trident ");
-	}
-	strcat(card->shortname, card->driver);
-	sprintf(card->longname, "%s PCI Audio at 0x%lx, irq %d",
-		card->shortname, trident->port, trident->irq);
-
 	if ((err = snd_card_register(card)) < 0) {
 		snd_card_free(card);
 		return err;
--- diff/sound/pci/trident/trident_main.c	2003-09-30 15:46:21.000000000 +0100
+++ source/sound/pci/trident/trident_main.c	2004-02-09 10:39:58.000000000 +0000
@@ -2955,6 +2955,7 @@
 
 static int __devinit snd_trident_mixer(trident_t * trident, int pcm_spdif_device)
 {
+	ac97_bus_t _bus;
 	ac97_t _ac97;
 	snd_card_t * card = trident->card;
 	snd_kcontrol_t *kctl;
@@ -2965,14 +2966,18 @@
 	if (!uctl)
 		return -ENOMEM;
 
+	memset(&_bus, 0, sizeof(_bus));
+	_bus.write = snd_trident_codec_write;
+	_bus.read = snd_trident_codec_read;
+	if ((err = snd_ac97_bus(trident->card, &_bus, &trident->ac97_bus)) < 0)
+		goto __out;
+
 	memset(&_ac97, 0, sizeof(_ac97));
-	_ac97.write = snd_trident_codec_write;
-	_ac97.read = snd_trident_codec_read;
 	_ac97.private_data = trident;
 	trident->ac97_detect = 1;
 
       __again:
-	if ((err = snd_ac97_mixer(trident->card, &_ac97, &trident->ac97)) < 0) {
+	if ((err = snd_ac97_mixer(trident->ac97_bus, &_ac97, &trident->ac97)) < 0) {
 		if (trident->device == TRIDENT_DEVICE_ID_SI7018) {
 			if ((err = snd_trident_sis_reset(trident)) < 0)
 				goto __out;
@@ -2987,7 +2992,7 @@
 	if (trident->device == TRIDENT_DEVICE_ID_SI7018 &&
 	    (inl(TRID_REG(trident, SI_SERIAL_INTF_CTRL)) & SI_AC97_PRIMARY_READY) != 0) {
 		_ac97.num = 1;
-		err = snd_ac97_mixer(trident->card, &_ac97, &trident->ac97_sec);
+		err = snd_ac97_mixer(trident->ac97_bus, &_ac97, &trident->ac97_sec);
 		if (err < 0)
 			snd_printk("SI7018: the secondary codec - invalid access\n");
 #if 0	// only for my testing purpose --jk
@@ -3295,7 +3300,7 @@
 	if (trident->device == TRIDENT_DEVICE_ID_SI7018)
 		s = "sis7018";
 	if (! snd_card_proc_new(trident->card, s, &entry))
-		snd_info_set_text_ops(entry, trident, snd_trident_proc_read);
+		snd_info_set_text_ops(entry, trident, 1024, snd_trident_proc_read);
 }
 
 static int snd_trident_dev_free(snd_device_t *device)
@@ -3518,11 +3523,11 @@
 	if ((err = pci_enable_device(pci)) < 0)
 		return err;
 	/* check, if we can restrict PCI DMA transfers to 30 bits */
-	if (!pci_dma_supported(pci, 0x3fffffff)) {
+	if (pci_set_dma_mask(pci, 0x3fffffff) < 0 ||
+	    pci_set_consistent_dma_mask(pci, 0x3fffffff) < 0) {
 		snd_printk("architecture does not support 30bit PCI busmaster DMA\n");
 		return -ENXIO;
 	}
-	pci_set_dma_mask(pci, 0x3fffffff);
 	
 	trident = snd_magic_kcalloc(trident_t, 0, GFP_KERNEL);
 	if (trident == NULL)
@@ -3624,6 +3629,7 @@
 		snd_trident_free(trident);
 		return err;
 	}
+	snd_card_set_dev(card, &pci->dev);
 	*rtrident = trident;
 	return 0;
 }
@@ -3947,7 +3953,9 @@
 		return;
 
 	pci_enable_device(trident->pci);
-	pci_set_dma_mask(trident->pci, 0x3fffffff); /* to be sure */
+	if (pci_set_dma_mask(trident->pci, 0x3fffffff) < 0 ||
+	    pci_set_consistent_dma_mask(trident->pci, 0x3fffffff) < 0)
+		snd_printk(KERN_WARNING "trident: can't set the proper DMA mask\n");
 	pci_set_master(trident->pci); /* to be sure */
 
 	switch (trident->device) {
--- diff/sound/pci/via82xx.c	2003-10-27 09:20:39.000000000 +0000
+++ source/sound/pci/via82xx.c	2004-02-09 10:39:58.000000000 +0000
@@ -50,6 +50,7 @@
 #include <linux/init.h>
 #include <linux/pci.h>
 #include <linux/slab.h>
+#include <linux/gameport.h>
 #include <sound/core.h>
 #include <sound/pcm.h>
 #include <sound/pcm_params.h>
@@ -69,10 +70,17 @@
 MODULE_CLASSES("{sound}");
 MODULE_DEVICES("{{VIA,VT82C686A/B/C,pci},{VIA,VT8233A/C,8235}}");
 
+#if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE))
+#define SUPPORT_JOYSTICK 1
+#endif
+
 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;	/* Index 0-MAX */
 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;	/* ID for this card */
 static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;	/* Enable this card */
-static long mpu_port[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = -1};
+static long mpu_port[SNDRV_CARDS];
+#ifdef SUPPORT_JOYSTICK
+static int joystick[SNDRV_CARDS];
+#endif
 static int ac97_clock[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 48000};
 static int dxs_support[SNDRV_CARDS];
 
@@ -86,14 +94,19 @@
 MODULE_PARM_DESC(enable, "Enable audio part of VIA 82xx bridge.");
 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
 MODULE_PARM(mpu_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
-MODULE_PARM_DESC(mpu_port, "MPU-401 port.");
+MODULE_PARM_DESC(mpu_port, "MPU-401 port. (VT82C686x only)");
 MODULE_PARM_SYNTAX(mpu_port, SNDRV_PORT_DESC);
+#ifdef SUPPORT_JOYSTICK
+MODULE_PARM(joystick, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+MODULE_PARM_DESC(joystick, "Enable joystick. (VT82C686x only)");
+MODULE_PARM_SYNTAX(joystick, SNDRV_ENABLE_DESC "," SNDRV_BOOLEAN_FALSE_DESC);
+#endif
 MODULE_PARM(ac97_clock, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
 MODULE_PARM_DESC(ac97_clock, "AC'97 codec clock (default 48000Hz).");
 MODULE_PARM_SYNTAX(ac97_clock, SNDRV_ENABLED ",default:48000");
 MODULE_PARM(dxs_support, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
-MODULE_PARM_DESC(dxs_support, "Support for DXS channels (0 = auto, 1 = enable, 2 = disable, 3 = 48k only)");
-MODULE_PARM_SYNTAX(dxs_support, SNDRV_ENABLED ",allows:{{0,3}},dialog:list");
+MODULE_PARM_DESC(dxs_support, "Support for DXS channels (0 = auto, 1 = enable, 2 = disable, 3 = 48k only, 4 = no VRA)");
+MODULE_PARM_SYNTAX(dxs_support, SNDRV_ENABLED ",allows:{{0,4}},dialog:list");
 
 
 /* pci ids */
@@ -235,6 +248,8 @@
 #define VIA_REG_OFS_CAPTURE_FIFO	0x02	/* byte - bit 6 = fifo  enable */
 #define   VIA_REG_CAPTURE_FIFO_ENABLE	0x40
 
+#define VIA_DXS_MAX_VOLUME		31	/* max. volume (attenuation) of reg 0x32/33 */
+
 #define VIA_REG_CAPTURE_CHANNEL		0x63	/* byte - input select */
 #define   VIA_REG_CAPTURE_CHANNEL_MIC	0x4
 #define   VIA_REG_CAPTURE_CHANNEL_LINE	0
@@ -290,6 +305,7 @@
 #define VIA_DXS_ENABLE	1
 #define VIA_DXS_DISABLE	2
 #define VIA_DXS_48K	3
+#define VIA_DXS_NO_VRA	4
 
 
 /*
@@ -449,9 +465,11 @@
 	viadev_t devs[VIA_MAX_DEVS];
 	struct via_rate_lock rates[2]; /* playback and capture */
 	unsigned int dxs_fixed: 1;	/* DXS channel accepts only 48kHz */
+	unsigned int no_vra: 1;		/* no need to set VRA on DXS channels */
 
 	snd_rawmidi_t *rmidi;
 
+	ac97_bus_t *ac97_bus;
 	ac97_t *ac97;
 	unsigned int ac97_clock;
 	unsigned int ac97_secondary;	/* secondary AC'97 codec is present */
@@ -459,6 +477,11 @@
 	spinlock_t reg_lock;
 	spinlock_t ac97_lock;
 	snd_info_entry_t *proc_entry;
+
+#ifdef SUPPORT_JOYSTICK
+	struct gameport gameport;
+	struct resource *res_joystick;
+#endif
 };
 
 static struct pci_device_id snd_via82xx_ids[] = {
@@ -509,7 +532,6 @@
 		if ((val = snd_via82xx_codec_xread(chip)) & stat)
 			return val & 0xffff;
 	}
-	snd_printk(KERN_ERR "codec_valid: codec %i is not valid [0x%x]\n", secondary, snd_via82xx_codec_xread(chip));
 	return -EIO;
 }
  
@@ -554,6 +576,7 @@
       	while (1) {
       		if (again++ > 3) {
 		        spin_unlock(&chip->ac97_lock);
+			snd_printk(KERN_ERR "codec_read: codec %i is not valid [0x%x]\n", ac97->num, snd_via82xx_codec_xread(chip));
 		      	return 0xffff;
 		}
 		snd_via82xx_codec_xwrite(chip, xval);
@@ -865,12 +888,12 @@
 
 	spin_lock(&rec->lock);
 	if (rec->rate != rate) {
-		if (rec->rate && rec->used > 1) { /* already set */
-			spin_unlock(&rec->lock);
-			return -EINVAL;
+		if (rec->rate && rec->used > 1) /* already set */
+			changed = -EINVAL;
+		else {
+			rec->rate = rate;
+			changed = 1;
 		}
-		rec->rate = rate;
-		changed = 1;
 	}
 	spin_unlock(&rec->lock);
 	return changed;
@@ -890,9 +913,8 @@
 	if ((rate_changed = via_lock_rate(&chip->rates[0], runtime->rate)) < 0)
 		return rate_changed;
 	if (rate_changed) {
-		snd_ac97_set_rate(chip->ac97, AC97_PCM_FRONT_DAC_RATE, runtime->rate);
-		snd_ac97_set_rate(chip->ac97, AC97_PCM_SURR_DAC_RATE, runtime->rate);
-		snd_ac97_set_rate(chip->ac97, AC97_PCM_LFE_DAC_RATE, runtime->rate);
+		snd_ac97_set_rate(chip->ac97, AC97_PCM_FRONT_DAC_RATE,
+				  chip->no_vra ? 48000 : runtime->rate);
 		snd_ac97_set_rate(chip->ac97, AC97_SPDIF, runtime->rate);
 	}
 #if 0
@@ -1382,7 +1404,7 @@
 static int snd_via8233_capture_source_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
 {
 	via82xx_t *chip = snd_kcontrol_chip(kcontrol);
-	unsigned long port = chip->port + kcontrol->id.index ? (VIA_REG_CAPTURE_CHANNEL + 0x10) : VIA_REG_CAPTURE_CHANNEL;
+	unsigned long port = chip->port + (kcontrol->id.index ? (VIA_REG_CAPTURE_CHANNEL + 0x10) : VIA_REG_CAPTURE_CHANNEL);
 	ucontrol->value.enumerated.item[0] = inb(port) & VIA_REG_CAPTURE_CHANNEL_MIC ? 1 : 0;
 	return 0;
 }
@@ -1390,7 +1412,7 @@
 static int snd_via8233_capture_source_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
 {
 	via82xx_t *chip = snd_kcontrol_chip(kcontrol);
-	unsigned long port = chip->port + kcontrol->id.index ? (VIA_REG_CAPTURE_CHANNEL + 0x10) : VIA_REG_CAPTURE_CHANNEL;
+	unsigned long port = chip->port + (kcontrol->id.index ? (VIA_REG_CAPTURE_CHANNEL + 0x10) : VIA_REG_CAPTURE_CHANNEL);
 	unsigned long flags;
 	u8 val, oval;
 
@@ -1461,7 +1483,7 @@
 	uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
 	uinfo->count = 2;
 	uinfo->value.integer.min = 0;
-	uinfo->value.integer.max = 0xff;
+	uinfo->value.integer.max = VIA_DXS_MAX_VOLUME;
 	return 0;
 }
 
@@ -1469,8 +1491,8 @@
 {
 	via82xx_t *chip = snd_kcontrol_chip(kcontrol);
 	unsigned int idx = snd_ctl_get_ioff(kcontrol, &ucontrol->id);
-	ucontrol->value.integer.value[0] = 0xff - chip->playback_volume[idx][0];
-	ucontrol->value.integer.value[1] = 0xff - chip->playback_volume[idx][1];
+	ucontrol->value.integer.value[0] = VIA_DXS_MAX_VOLUME - chip->playback_volume[idx][0];
+	ucontrol->value.integer.value[1] = VIA_DXS_MAX_VOLUME - chip->playback_volume[idx][1];
 	return 0;
 }
 
@@ -1480,19 +1502,18 @@
 	unsigned int idx = snd_ctl_get_ioff(kcontrol, &ucontrol->id);
 	unsigned long port = chip->port + 0x10 * idx;
 	unsigned char val;
-	int change;
+	int i, change = 0;
 
-	val = 0xff - ucontrol->value.integer.value[0];
-	change = val != chip->playback_volume[idx][0];
-	if (change) {
-		chip->playback_volume[idx][0] = val;
-		outb(val, port + VIA_REG_OFS_PLAYBACK_VOLUME_L);
-	}
-	val = 0xff - ucontrol->value.integer.value[1];
-	change |= val != chip->playback_volume[idx][1];
-	if (change) {
-		chip->playback_volume[idx][1] = val;
-		outb(val, port + VIA_REG_OFS_PLAYBACK_VOLUME_R);
+	for (i = 0; i < 2; i++) {
+		val = ucontrol->value.integer.value[i];
+		if (val > VIA_DXS_MAX_VOLUME)
+			val = VIA_DXS_MAX_VOLUME;
+		val = VIA_DXS_MAX_VOLUME - val;
+		change |= val != chip->playback_volume[idx][i];
+		if (change) {
+			chip->playback_volume[idx][i] = val;
+			outb(val, port + VIA_REG_OFS_PLAYBACK_VOLUME_L + i);
+		}
 	}
 	return change;
 }
@@ -1509,6 +1530,12 @@
 /*
  */
 
+static void snd_via82xx_mixer_free_ac97_bus(ac97_bus_t *bus)
+{
+	via82xx_t *chip = snd_magic_cast(via82xx_t, bus->private_data, return);
+	chip->ac97_bus = NULL;
+}
+
 static void snd_via82xx_mixer_free_ac97(ac97_t *ac97)
 {
 	via82xx_t *chip = snd_magic_cast(via82xx_t, ac97->private_data, return);
@@ -1516,29 +1543,42 @@
 }
 
 static struct ac97_quirk ac97_quirks[] = {
-	{
+	{	/* FIXME: which codec? */
 		.vendor = 0x1106,
 		.device = 0x4161,
 		.name = "ASRock K7VT2",
 		.type = AC97_TUNE_HP_ONLY
 	},
+	{
+		.vendor = 0x1849,
+		.device = 0x3059,
+		.name = "ASRock K7VM2",
+		.type = AC97_TUNE_HP_ONLY	/* VT1616 */
+	},
 	{ } /* terminator */
 };
 
 static int __devinit snd_via82xx_mixer_new(via82xx_t *chip)
 {
+	ac97_bus_t bus;
 	ac97_t ac97;
 	int err;
 
+	memset(&bus, 0, sizeof(bus));
+	bus.write = snd_via82xx_codec_write;
+	bus.read = snd_via82xx_codec_read;
+	bus.wait = snd_via82xx_codec_wait;
+	bus.private_data = chip;
+	bus.private_free = snd_via82xx_mixer_free_ac97_bus;
+	bus.clock = chip->ac97_clock;
+	if ((err = snd_ac97_bus(chip->card, &bus, &chip->ac97_bus)) < 0)
+		return err;
+
 	memset(&ac97, 0, sizeof(ac97));
-	ac97.write = snd_via82xx_codec_write;
-	ac97.read = snd_via82xx_codec_read;
-	ac97.wait = snd_via82xx_codec_wait;
 	ac97.private_data = chip;
 	ac97.private_free = snd_via82xx_mixer_free_ac97;
-	ac97.clock = chip->ac97_clock;
 	ac97.pci = chip->pci;
-	if ((err = snd_ac97_mixer(chip->card, &ac97, &chip->ac97)) < 0)
+	if ((err = snd_ac97_mixer(chip->ac97_bus, &ac97, &chip->ac97)) < 0)
 		return err;
 
 	snd_ac97_tune_hardware(chip->ac97, ac97_quirks);
@@ -1552,53 +1592,6 @@
 }
 
 /*
- * joystick
- */
-
-static int snd_via82xx_joystick_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo)
-{
-	uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
-	uinfo->count = 1;
-	uinfo->value.integer.min = 0;
-	uinfo->value.integer.max = 1;
-	return 0;
-}
-
-static int snd_via82xx_joystick_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
-{
-	via82xx_t *chip = snd_kcontrol_chip(kcontrol);
-	u16 val;
-
-	pci_read_config_word(chip->pci, VIA_FUNC_ENABLE, &val);
-	ucontrol->value.integer.value[0] = (val & VIA_FUNC_ENABLE_GAME) ? 1 : 0;
-	return 0;
-}
-
-static int snd_via82xx_joystick_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
-{
-	via82xx_t *chip = snd_kcontrol_chip(kcontrol);
-	u16 val, oval;
-
-	pci_read_config_word(chip->pci, VIA_FUNC_ENABLE, &oval);
-	val = oval & ~VIA_FUNC_ENABLE_GAME;
-	if (ucontrol->value.integer.value[0])
-		val |= VIA_FUNC_ENABLE_GAME;
-	if (val != oval) {
-		pci_write_config_word(chip->pci, VIA_FUNC_ENABLE, val);
-		return 1;
-	}
-	return 0;
-}
-
-static snd_kcontrol_new_t snd_via82xx_joystick_control __devinitdata = {
-	.name = "Joystick",
-	.iface = SNDRV_CTL_ELEM_IFACE_CARD,
-	.info = snd_via82xx_joystick_info,
-	.get = snd_via82xx_joystick_get,
-	.put = snd_via82xx_joystick_put,
-};
-
-/*
  *
  */
 
@@ -1653,7 +1646,7 @@
 						    "VIA82xx MPU401")) != NULL) {
 			legacy |= VIA_FUNC_ENABLE_MIDI;
 		} else {
-			mpu_port[dev] = -1;
+			mpu_port[dev] = 0;
 			legacy &= ~VIA_FUNC_ENABLE_MIDI;
 		}
 	} else {
@@ -1680,8 +1673,18 @@
 		if (rev_h)
 			legacy &= ~VIA_FUNC_MIDI_PNP;	/* disable PCI I/O 2 */
 		legacy &= ~VIA_FUNC_ENABLE_MIDI;
-		mpu_port[dev] = -1;
+		mpu_port[dev] = 0;
+	}
+
+#ifdef SUPPORT_JOYSTICK
+#define JOYSTICK_ADDR	0x200
+	if (joystick[dev] &&
+	    (chip->res_joystick = request_region(JOYSTICK_ADDR, 8, "VIA686 gameport")) != NULL) {
+		legacy |= VIA_FUNC_ENABLE_GAME;
+		chip->gameport.io = JOYSTICK_ADDR;
 	}
+#endif
+
 	pci_write_config_byte(chip->pci, VIA_FUNC_ENABLE, legacy);
 	pci_write_config_byte(chip->pci, VIA_PNP_CONTROL, legacy_cfg);
 	if (chip->mpu_res) {
@@ -1695,9 +1698,13 @@
 		}
 		pci_write_config_byte(chip->pci, VIA_FUNC_ENABLE, legacy);
 	}
-	
-	/* card switches */
-	return snd_ctl_add(chip->card, snd_ctl_new1(&snd_via82xx_joystick_control, chip));
+
+#ifdef SUPPORT_JOYSTICK
+	if (chip->res_joystick)
+		gameport_register_port(&chip->gameport);
+#endif
+
+	return 0;
 }
 
 
@@ -1711,7 +1718,7 @@
 	
 	snd_iprintf(buffer, "%s\n\n", chip->card->longname);
 	for (i = 0; i < 0xa0; i += 4) {
-		snd_iprintf(buffer, "%02x: %08x", i, inl(chip->port + i));
+		snd_iprintf(buffer, "%02x: %08x\n", i, inl(chip->port + i));
 	}
 }
 
@@ -1720,7 +1727,7 @@
 	snd_info_entry_t *entry;
 
 	if (! snd_card_proc_new(chip->card, "via82xx", &entry))
-		snd_info_set_text_ops(entry, chip, snd_via82xx_proc_read);
+		snd_info_set_text_ops(entry, chip, 1024, snd_via82xx_proc_read);
 }
 
 /*
@@ -1859,6 +1866,13 @@
 	if (chip->irq >= 0)
 		free_irq(chip->irq, (void *)chip);
 	if (chip->chip_type == TYPE_VIA686) {
+#ifdef SUPPORT_JOYSTICK
+		if (chip->res_joystick) {
+			gameport_unregister_port(&chip->gameport);
+			release_resource(chip->res_joystick);
+			kfree_nocheck(chip->res_joystick);
+		}
+#endif
 		pci_write_config_byte(chip->pci, VIA_FUNC_ENABLE, chip->old_legacy);
 		pci_write_config_byte(chip->pci, VIA_PNP_CONTROL, chip->old_legacy_cfg);
 	}
@@ -1937,6 +1951,8 @@
 	 * We call pci_set_master here because it does not hurt. */
 	pci_set_master(pci);
 
+	snd_card_set_dev(card, &pci->dev);
+
 	*r_via = chip;
 	return 0;
 }
@@ -1967,8 +1983,22 @@
 static int __devinit check_dxs_list(struct pci_dev *pci)
 {
 	static struct dxs_whitelist whitelist[] = {
+		{ .vendor = 0x1005, .device = 0x4710, .action = VIA_DXS_ENABLE }, /* Avance Logic Mobo */
 		{ .vendor = 0x1019, .device = 0x0996, .action = VIA_DXS_48K },
+		{ .vendor = 0x1043, .device = 0x8095, .action = VIA_DXS_ENABLE }, /* ASUS A7V8X */
+		{ .vendor = 0x1043, .device = 0x80a1, .action = VIA_DXS_NO_VRA }, /* ASUS A7V8-X */
+		{ .vendor = 0x1043, .device = 0x80b0, .action = VIA_DXS_ENABLE }, /* ASUS A7V600 */
+		{ .vendor = 0x10cf, .device = 0x118e, .action = VIA_DXS_ENABLE }, /* FSC laptop */
+		{ .vendor = 0x1106, .device = 0x4161, .action = VIA_DXS_NO_VRA }, /* ASRock K7VT2 */
+		{ .vendor = 0x1297, .device = 0xa232, .action = VIA_DXS_ENABLE }, /* Shuttle ?? */
 		{ .vendor = 0x1297, .device = 0xc160, .action = VIA_DXS_ENABLE }, /* Shuttle SK41G */
+		{ .vendor = 0x1458, .device = 0xa002, .action = VIA_DXS_ENABLE }, /* Gigabyte GA-7VAXP */
+		{ .vendor = 0x147b, .device = 0x1401, .action = VIA_DXS_ENABLE }, /* ABIT KD7(-RAID) */
+		{ .vendor = 0x14ff, .device = 0x0403, .action = VIA_DXS_ENABLE }, /* Twinhead mobo */
+		{ .vendor = 0x1462, .device = 0x7120, .action = VIA_DXS_ENABLE }, /* MSI KT4V */
+		{ .vendor = 0x1631, .device = 0xe004, .action = VIA_DXS_ENABLE }, /* Easy Note 3174, Packard Bell */
+		{ .vendor = 0x1695, .device = 0x3005, .action = VIA_DXS_ENABLE }, /* EPoX EP-8K9A */
+		{ .vendor = 0x1849, .device = 0x3059, .action = VIA_DXS_NO_VRA }, /* ASRock K7VM2 */
 		{ } /* terminator */
 	};
 	struct dxs_whitelist *w;
@@ -1994,7 +2024,8 @@
 	 * not detected, try 48k rate only to be sure.
 	 */
 	printk(KERN_INFO "via82xx: Assuming DXS channels with 48k fixed sample rate.\n");
-	printk(KERN_INFO "         Please try dxs_support=1 option and report if it works on your machine.\n");
+	printk(KERN_INFO "         Please try dxs_support=1 or dxs_support=4 option\n");
+	printk(KERN_INFO "         and report if it works on your machine.\n");
 	return VIA_DXS_48K;
 };
 
@@ -2073,12 +2104,14 @@
 		if (chip_type == TYPE_VIA8233A) {
 			if ((err = snd_via8233a_pcm_new(chip)) < 0)
 				goto __error;
-			chip->dxs_fixed = 1; /* use 48k for DXS #3 */
+			// chip->dxs_fixed = 1; /* FIXME: use 48k for DXS #3? */
 		} else {
 			if ((err = snd_via8233_pcm_new(chip)) < 0)
 				goto __error;
 			if (dxs_support[dev] == VIA_DXS_48K)
 				chip->dxs_fixed = 1;
+			else if (dxs_support[dev] == VIA_DXS_NO_VRA)
+				chip->no_vra = 1;
 		}
 		if ((err = snd_via8233_init_misc(chip, dev)) < 0)
 			goto __error;
@@ -2142,7 +2175,7 @@
 #ifndef MODULE
 
 /* format is: snd-via82xx=enable,index,id,
-			  mpu_port,ac97_clock,dxs_support */
+			  mpu_port,joystick,ac97_clock,dxs_support */
 
 static int __init alsa_card_via82xx_setup(char *str)
 {
@@ -2153,7 +2186,10 @@
 	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
 	       get_option(&str,&index[nr_dev]) == 2 &&
 	       get_id(&str,&id[nr_dev]) == 2 &&
-	       get_option(&str,(int *)&mpu_port[nr_dev]) == 2 &&
+	       get_option_long(&str,&mpu_port[nr_dev]) == 2 &&
+#ifdef SUPPORT_JOYSTICK
+	       get_option(&str,&joystick[nr_dev]) == 2 &&
+#endif
 	       get_option(&str,&ac97_clock[nr_dev]) == 2 &&
 	       get_option(&str,&dxs_support[nr_dev]) == 2);
 	nr_dev++;
--- diff/sound/pci/vx222/vx222.c	2003-08-20 14:16:36.000000000 +0100
+++ source/sound/pci/vx222/vx222.c	2004-02-09 10:39:58.000000000 +0000
@@ -192,6 +192,8 @@
 		return err;
 	}
 
+	snd_card_set_dev(card, &pci->dev);
+
 	*rchip = vx;
 	return 0;
 }
--- diff/sound/pci/ymfpci/ymfpci.c	2003-08-20 14:16:36.000000000 +0100
+++ source/sound/pci/ymfpci/ymfpci.c	2004-02-09 10:39:58.000000000 +0000
@@ -44,8 +44,11 @@
 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;	/* Index 0-MAX */
 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;	/* ID for this card */
 static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;	/* Enable this card */
-static long fm_port[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = -1};
-static long mpu_port[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = -1};
+static long fm_port[SNDRV_CARDS];
+static long mpu_port[SNDRV_CARDS];
+#ifdef SUPPORT_JOYSTICK
+static long joystick_port[SNDRV_CARDS];
+#endif
 static int rear_switch[SNDRV_CARDS];
 
 MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
@@ -63,6 +66,11 @@
 MODULE_PARM(fm_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
 MODULE_PARM_DESC(fm_port, "FM OPL-3 Port.");
 MODULE_PARM_SYNTAX(fm_port, SNDRV_ENABLED);
+#ifdef SUPPORT_JOYSTICK
+MODULE_PARM(joystick_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+MODULE_PARM_DESC(joystick_port, "Joystick port address");
+MODULE_PARM_SYNTAX(joystick_port, SNDRV_ENABLED);
+#endif
 MODULE_PARM(rear_switch, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
 MODULE_PARM_DESC(rear_switch, "Enable shared rear/line-in switch");
 MODULE_PARM_SYNTAX(rear_switch, SNDRV_ENABLED "," SNDRV_BOOLEAN_FALSE_DESC);
@@ -86,6 +94,9 @@
 	snd_card_t *card;
 	struct resource *fm_res = NULL;
 	struct resource *mpu_res = NULL;
+#ifdef SUPPORT_JOYSTICK
+	struct resource *joystick_res = NULL;
+#endif
 	ymfpci_t *chip;
 	opl3_t *opl3;
 	char *str;
@@ -117,51 +128,92 @@
 	legacy_ctrl2 = 0x0800;	/* SBEN = 0, SMOD = 01, LAD = 0 */
 
 	if (pci_id->device >= 0x0010) { /* YMF 744/754 */
-		if (fm_port[dev] < 0) {
+		if (fm_port[dev] == 1) {
+			/* auto-detect */
 			fm_port[dev] = pci_resource_start(pci, 1);
 		}
-		if (fm_port[dev] >= 0 &&
+		if (fm_port[dev] > 0 &&
 		    (fm_res = request_region(fm_port[dev], 4, "YMFPCI OPL3")) != NULL) {
 			legacy_ctrl |= YMFPCI_LEGACY_FMEN;
 			pci_write_config_word(pci, PCIR_DSXG_FMBASE, fm_port[dev]);
 		}
-		if (mpu_port[dev] < 0) {
+		if (mpu_port[dev] == 1) {
+			/* auto-detect */
 			mpu_port[dev] = pci_resource_start(pci, 1) + 0x20;
 		}
-		if (mpu_port[dev] >= 0 &&
+		if (mpu_port[dev] > 0 &&
 		    (mpu_res = request_region(mpu_port[dev], 2, "YMFPCI MPU401")) != NULL) {
 			legacy_ctrl |= YMFPCI_LEGACY_MEN;
 			pci_write_config_word(pci, PCIR_DSXG_MPU401BASE, mpu_port[dev]);
 		}
+#ifdef SUPPORT_JOYSTICK
+		if (joystick_port[dev] == 1) {
+			/* auto-detect */
+			joystick_port[dev] = pci_resource_start(pci, 2);
+		}
+		if (joystick_port[dev] > 0 &&
+		    (joystick_res = request_region(joystick_port[dev], 1, "YMFPCI gameport")) != NULL) {
+			legacy_ctrl |= YMFPCI_LEGACY_JPEN;
+			pci_write_config_word(pci, PCIR_DSXG_JOYBASE, joystick_port[dev]);
+		}
+#endif
 	} else {
 		switch (fm_port[dev]) {
 		case 0x388: legacy_ctrl2 |= 0; break;
 		case 0x398: legacy_ctrl2 |= 1; break;
 		case 0x3a0: legacy_ctrl2 |= 2; break;
 		case 0x3a8: legacy_ctrl2 |= 3; break;
-		default: fm_port[dev] = -1; break;
+		default: fm_port[dev] = 0; break;
 		}
 		if (fm_port[dev] > 0 &&
 		    (fm_res = request_region(fm_port[dev], 4, "YMFPCI OPL3")) != NULL) {
 			legacy_ctrl |= YMFPCI_LEGACY_FMEN;
 		} else {
 			legacy_ctrl2 &= ~YMFPCI_LEGACY2_FMIO;
-			fm_port[dev] = -1;
+			fm_port[dev] = 0;
 		}
 		switch (mpu_port[dev]) {
 		case 0x330: legacy_ctrl2 |= 0 << 4; break;
 		case 0x300: legacy_ctrl2 |= 1 << 4; break;
 		case 0x332: legacy_ctrl2 |= 2 << 4; break;
 		case 0x334: legacy_ctrl2 |= 3 << 4; break;
-		default: mpu_port[dev] = -1; break;
+		default: mpu_port[dev] = 0; break;
 		}
 		if (mpu_port[dev] > 0 &&
 		    (mpu_res = request_region(mpu_port[dev], 2, "YMFPCI MPU401")) != NULL) {
 			legacy_ctrl |= YMFPCI_LEGACY_MEN;
 		} else {
 			legacy_ctrl2 &= ~YMFPCI_LEGACY2_MPUIO;
-			mpu_port[dev] = -1;
+			mpu_port[dev] = 0;
 		}
+#ifdef SUPPORT_JOYSTICK
+		if (joystick_port[dev] == 1) {
+			/* auto-detect */
+			long p;
+			for (p = 0x201; p <= 0x205; p++) {
+				if (p == 0x203) continue;
+				if ((joystick_res = request_region(p, 1, "YMFPCI gameport")) != NULL)
+					break;
+			}
+			if (joystick_res)
+				joystick_port[dev] = p;
+		}
+		switch (joystick_port[dev]) {
+		case 0x201: legacy_ctrl2 |= 0 << 6; break;
+		case 0x202: legacy_ctrl2 |= 1 << 6; break;
+		case 0x204: legacy_ctrl2 |= 2 << 6; break;
+		case 0x205: legacy_ctrl2 |= 3 << 6; break;
+		default: joystick_port[dev] = 0; break;
+		}
+		if (! joystick_res && joystick_port[dev] > 0)
+			joystick_res = request_region(joystick_port[dev], 1, "YMFPCI gameport");
+		if (joystick_res) {
+			legacy_ctrl |= YMFPCI_LEGACY_JPEN;
+		} else {
+			legacy_ctrl2 &= ~YMFPCI_LEGACY2_JSIO;
+			joystick_port[dev] = 0;
+		}
+#endif
 	}
 	if (mpu_res) {
 		legacy_ctrl |= YMFPCI_LEGACY_MIEN;
@@ -182,10 +234,25 @@
 			release_resource(fm_res);
 			kfree_nocheck(fm_res);
 		}
+#ifdef SUPPORT_JOYSTICK
+		if (joystick_res) {
+			release_resource(joystick_res);
+			kfree_nocheck(joystick_res);
+		}
+#endif
 		return err;
 	}
 	chip->fm_res = fm_res;
 	chip->mpu_res = mpu_res;
+#ifdef SUPPORT_JOYSTICK
+	chip->joystick_res = joystick_res;
+#endif
+	strcpy(card->driver, str);
+	sprintf(card->shortname, "Yamaha DS-XG (%s)", str);
+	sprintf(card->longname, "%s at 0x%lx, irq %i",
+		card->shortname,
+		chip->reg_area_phys,
+		chip->irq);
 	if ((err = snd_ymfpci_pcm(chip, 0, NULL)) < 0) {
 		snd_card_free(card);
 		return err;
@@ -206,6 +273,10 @@
 		snd_card_free(card);
 		return err;
 	}
+	if ((err = snd_ymfpci_timer(chip, 0)) < 0) {
+		snd_card_free(card);
+		return err;
+	}
 	if (chip->mpu_res) {
 		if ((err = snd_mpu401_uart_new(card, 0, MPU401_HW_YMFPCI,
 					       mpu_port[dev], 1,
@@ -229,17 +300,12 @@
 			return err;
 		}
 	}
-#if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE))
-	if ((err = snd_ymfpci_joystick(chip)) < 0) {
-		printk(KERN_WARNING "ymfpci: cannot initialize joystick, skipping...\n");
+#ifdef SUPPORT_JOYSTICK
+	if (chip->joystick_res) {
+		chip->gameport.io = joystick_port[dev];
+		gameport_register_port(&chip->gameport);
 	}
 #endif
-	strcpy(card->driver, str);
-	sprintf(card->shortname, "Yamaha DS-XG PCI (%s)", str);
-	sprintf(card->longname, "%s at 0x%lx, irq %i",
-		card->shortname,
-		chip->reg_area_phys,
-		chip->irq);
 
 	if ((err = snd_card_register(card)) < 0) {
 		snd_card_free(card);
@@ -319,8 +385,8 @@
 	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
 	       get_option(&str,&index[nr_dev]) == 2 &&
 	       get_id(&str,&id[nr_dev]) == 2 &&
-	       get_option(&str,(int *)&fm_port[nr_dev]) == 2 &&
-	       get_option(&str,(int *)&mpu_port[nr_dev]) == 2);
+	       get_option_long(&str,&fm_port[nr_dev]) == 2 &&
+	       get_option_long(&str,&mpu_port[nr_dev]) == 2);
 	nr_dev++;
 	return 1;
 }
--- diff/sound/pci/ymfpci/ymfpci_main.c	2003-08-26 10:00:55.000000000 +0100
+++ source/sound/pci/ymfpci/ymfpci_main.c	2004-02-09 10:39:58.000000000 +0000
@@ -779,7 +779,8 @@
 
 	status = snd_ymfpci_readw(chip, YDSXGR_INTFLAG);
 	if (status & 1) {
-		/* timer handler */
+		if (chip->timer)
+			snd_timer_interrupt(chip->timer, chip->timer->sticks);
 	}
 	snd_ymfpci_writew(chip, YDSXGR_INTFLAG, status);
 
@@ -1135,7 +1136,7 @@
 
 	if (rpcm)
 		*rpcm = NULL;
-	if ((err = snd_pcm_new(chip->card, "YMFPCI - AC'97", device, 0, 1, &pcm)) < 0)
+	if ((err = snd_pcm_new(chip->card, "YMFPCI - PCM2", device, 0, 1, &pcm)) < 0)
 		return err;
 	pcm->private_data = chip;
 	pcm->private_free = snd_ymfpci_pcm2_free;
@@ -1144,7 +1145,8 @@
 
 	/* global setup */
 	pcm->info_flags = 0;
-	strcpy(pcm->name, "YMFPCI - AC'97");
+	sprintf(pcm->name, "YMFPCI - %s",
+		chip->device_id == PCI_DEVICE_ID_YAMAHA_754 ? "Direct Recording" : "AC'97");
 	chip->pcm2 = pcm;
 
 	snd_pcm_lib_preallocate_pci_pages_for_all(chip->pci, pcm, 64*1024, 256*1024);
@@ -1368,6 +1370,61 @@
 	.put =		snd_ymfpci_spdif_stream_put
 };
 
+static int snd_ymfpci_drec_source_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *info)
+{
+	static char *texts[3] = {"AC'97", "IEC958", "ZV Port"};
+
+	info->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
+	info->count = 1;
+	info->value.enumerated.items = 3;
+	if (info->value.enumerated.item > 2)
+		info->value.enumerated.item = 2;
+	strcpy(info->value.enumerated.name, texts[info->value.enumerated.item]);
+	return 0;
+}
+
+static int snd_ymfpci_drec_source_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *value)
+{
+	ymfpci_t *chip = snd_kcontrol_chip(kcontrol);
+	unsigned long flags;
+	u16 reg;
+
+	spin_lock_irqsave(&chip->reg_lock, flags);
+	reg = snd_ymfpci_readw(chip, YDSXGR_GLOBALCTRL);
+	spin_unlock_irqrestore(&chip->reg_lock, flags);
+	if (!(reg & 0x100))
+		value->value.enumerated.item[0] = 0;
+	else
+		value->value.enumerated.item[0] = 1 + ((reg & 0x200) != 0);
+	return 0;
+}
+
+static int snd_ymfpci_drec_source_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *value)
+{
+	ymfpci_t *chip = snd_kcontrol_chip(kcontrol);
+	unsigned long flags;
+	u16 reg, old_reg;
+
+	spin_lock_irqsave(&chip->reg_lock, flags);
+	old_reg = snd_ymfpci_readw(chip, YDSXGR_GLOBALCTRL);
+	if (value->value.enumerated.item[0] == 0)
+		reg = old_reg & ~0x100;
+	else
+		reg = (old_reg & ~0x300) | 0x100 | ((value->value.enumerated.item[0] == 2) << 9);
+	snd_ymfpci_writew(chip, YDSXGR_GLOBALCTRL, reg);
+	spin_unlock_irqrestore(&chip->reg_lock, flags);
+	return reg != old_reg;
+}
+
+static snd_kcontrol_new_t snd_ymfpci_drec_source __devinitdata = {
+	.access =	SNDRV_CTL_ELEM_ACCESS_READWRITE,
+	.iface =	SNDRV_CTL_ELEM_IFACE_MIXER,
+	.name =		"Direct Recording Source",
+	.info =		snd_ymfpci_drec_source_info,
+	.get =		snd_ymfpci_drec_source_get,
+	.put =		snd_ymfpci_drec_source_put
+};
+
 /*
  *  Mixer controls
  */
@@ -1651,6 +1708,12 @@
  *  Mixer routines
  */
 
+static void snd_ymfpci_mixer_free_ac97_bus(ac97_bus_t *bus)
+{
+	ymfpci_t *chip = snd_magic_cast(ymfpci_t, bus->private_data, return);
+	chip->ac97_bus = NULL;
+}
+
 static void snd_ymfpci_mixer_free_ac97(ac97_t *ac97)
 {
 	ymfpci_t *chip = snd_magic_cast(ymfpci_t, ac97->private_data, return);
@@ -1659,17 +1722,24 @@
 
 int __devinit snd_ymfpci_mixer(ymfpci_t *chip, int rear_switch)
 {
+	ac97_bus_t bus;
 	ac97_t ac97;
 	snd_kcontrol_t *kctl;
 	unsigned int idx;
 	int err;
 
+	memset(&bus, 0, sizeof(bus));
+	bus.write = snd_ymfpci_codec_write;
+	bus.read = snd_ymfpci_codec_read;
+	bus.private_data = chip;
+	bus.private_free = snd_ymfpci_mixer_free_ac97_bus;
+	if ((err = snd_ac97_bus(chip->card, &bus, &chip->ac97_bus)) < 0)
+		return err;
+
 	memset(&ac97, 0, sizeof(ac97));
-	ac97.write = snd_ymfpci_codec_write;
-	ac97.read = snd_ymfpci_codec_read;
 	ac97.private_data = chip;
 	ac97.private_free = snd_ymfpci_mixer_free_ac97;
-	if ((err = snd_ac97_mixer(chip->card, &ac97, &chip->ac97)) < 0)
+	if ((err = snd_ac97_mixer(chip->ac97_bus, &ac97, &chip->ac97)) < 0)
 		return err;
 
 	for (idx = 0; idx < YMFPCI_CONTROLS; idx++) {
@@ -1690,6 +1760,11 @@
 	kctl->id.device = chip->pcm_spdif->device;
 	chip->spdif_pcm_ctl = kctl;
 
+	/* direct recording source */
+	if (chip->device_id == PCI_DEVICE_ID_YAMAHA_754 &&
+	    (err = snd_ctl_add(chip->card, kctl = snd_ctl_new1(&snd_ymfpci_drec_source, chip))) < 0)
+		return err;
+
 	/*
 	 * shared rear/line-in
 	 */
@@ -1703,174 +1778,74 @@
 
 
 /*
- * joystick support
+ * timer
  */
 
-#if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE))
-static int ymfpci_joystick_ports[4] = {
-	0x201, 0x202, 0x204, 0x205
-};
-
-static int snd_ymfpci_get_joystick_port(ymfpci_t *chip, int index)
-{
-	if (index < 4)
-		return ymfpci_joystick_ports[index];
-	else
-		return pci_resource_start(chip->pci, 2);
-}
-
-static void setup_joystick_base(ymfpci_t *chip)
-{
-	if (chip->device_id >= 0x0010) /* YMF 744/754 */
-		pci_write_config_word(chip->pci, PCIR_DSXG_JOYBASE,
-				      snd_ymfpci_get_joystick_port(chip, chip->joystick_port));
-	else {
-		u16 legacy_ctrl2;
-		pci_read_config_word(chip->pci, PCIR_DSXG_ELEGACY, &legacy_ctrl2);
-		legacy_ctrl2 &= ~YMFPCI_LEGACY2_JSIO;
-		legacy_ctrl2 |= chip->joystick_port << 6;
-		pci_write_config_word(chip->pci, PCIR_DSXG_ELEGACY, legacy_ctrl2);
-	}
-}
-
-static int snd_ymfpci_enable_joystick(ymfpci_t *chip)
-{
-	u16 val;
-
-	chip->gameport.io = snd_ymfpci_get_joystick_port(chip, chip->joystick_port);
-	chip->joystick_res = request_region(chip->gameport.io, 1, "YMFPCI gameport");
-	if (!chip->joystick_res) {
-		snd_printk(KERN_WARNING "gameport port %#x in use\n", chip->gameport.io);
-		return 0;
-	}
-	setup_joystick_base(chip);
-	pci_read_config_word(chip->pci, PCIR_DSXG_LEGACY, &val);
-	val |= YMFPCI_LEGACY_JPEN;
-	pci_write_config_word(chip->pci, PCIR_DSXG_LEGACY, val);
-	gameport_register_port(&chip->gameport);
-	return 1;
-}
-
-static int snd_ymfpci_disable_joystick(ymfpci_t *chip)
-{
-	u16 val;
-
-	gameport_unregister_port(&chip->gameport);
-	pci_read_config_word(chip->pci, PCIR_DSXG_LEGACY, &val);
-	val &= ~YMFPCI_LEGACY_JPEN;
-	pci_write_config_word(chip->pci, PCIR_DSXG_LEGACY, val);
-	release_resource(chip->joystick_res);
-	kfree_nocheck(chip->joystick_res);
-	chip->joystick_res = NULL;
-	return 1;
-}
-
-static int snd_ymfpci_joystick_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo)
-{
-	uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
-	uinfo->count = 1;
-	uinfo->value.integer.min = 0;
-	uinfo->value.integer.max = 1;
-	return 0;
-}
-
-static int snd_ymfpci_joystick_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+static int snd_ymfpci_timer_start(snd_timer_t *timer)
 {
-	ymfpci_t *chip = snd_kcontrol_chip(kcontrol);
-	u16 val;
+	ymfpci_t *chip;
+	unsigned long flags;
+	unsigned int count;
 
-	pci_read_config_word(chip->pci, PCIR_DSXG_LEGACY, &val);
-	ucontrol->value.integer.value[0] = (val & YMFPCI_LEGACY_JPEN) ? 1 : 0;
+	chip = snd_timer_chip(timer);
+	count = timer->sticks - 1;
+	if (count == 0) /* minimum time is 20.8 us */
+		count = 1;
+	spin_lock_irqsave(&chip->reg_lock, flags);
+	snd_ymfpci_writew(chip, YDSXGR_TIMERCOUNT, count);
+	snd_ymfpci_writeb(chip, YDSXGR_TIMERCTRL, 0x03);
+	spin_unlock_irqrestore(&chip->reg_lock, flags);
 	return 0;
 }
 
-static int snd_ymfpci_joystick_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
-{
-	ymfpci_t *chip = snd_kcontrol_chip(kcontrol);
-	int enabled, change;
-
-	down(&chip->joystick_mutex);
-	enabled = chip->joystick_res != NULL;
-	change = enabled != !! ucontrol->value.integer.value[0];
-	if (change) {
-		if (!enabled)
-			change = snd_ymfpci_enable_joystick(chip);
-		else
-			change = snd_ymfpci_disable_joystick(chip);
-	}
-	up(&chip->joystick_mutex);
-	return change;
-}
-
-static int snd_ymfpci_joystick_addr_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo)
+static int snd_ymfpci_timer_stop(snd_timer_t *timer)
 {
-	ymfpci_t *chip = snd_kcontrol_chip(kcontrol);
-	int ports = chip->device_id >= 0x0010 ? 5 : 4;
+	ymfpci_t *chip;
+	unsigned long flags;
 
-	uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
-	uinfo->count = 1;
-	uinfo->value.enumerated.items = ports;
-	if (uinfo->value.enumerated.item >= ports)
-		uinfo->value.enumerated.item = ports - 1;
-	sprintf(uinfo->value.enumerated.name, "port 0x%x",
-		snd_ymfpci_get_joystick_port(chip, uinfo->value.enumerated.item));
+	chip = snd_timer_chip(timer);
+	spin_lock_irqsave(&chip->reg_lock, flags);
+	snd_ymfpci_writeb(chip, YDSXGR_TIMERCTRL, 0x00);
+	spin_unlock_irqrestore(&chip->reg_lock, flags);
 	return 0;
 }
 
-static int snd_ymfpci_joystick_addr_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+static int snd_ymfpci_timer_precise_resolution(snd_timer_t *timer,
+					       unsigned long *num, unsigned long *den)
 {
-	ymfpci_t *chip = snd_kcontrol_chip(kcontrol);
-	ucontrol->value.enumerated.item[0] = chip->joystick_port;
+	*num = 1;
+	*den = 96000;
 	return 0;
 }
 
-static int snd_ymfpci_joystick_addr_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
-{
-	ymfpci_t *chip = snd_kcontrol_chip(kcontrol);
-	int change, enabled;
-
-	down(&chip->joystick_mutex);
-	change = ucontrol->value.enumerated.item[0] != chip->joystick_port;
-	if (change) {
-		enabled = chip->joystick_res != NULL;
-		if (enabled)
-			snd_ymfpci_disable_joystick(chip);
-		chip->joystick_port = ucontrol->value.enumerated.item[0];
-		if (enabled)
-			snd_ymfpci_enable_joystick(chip);
-	}
-	up(&chip->joystick_mutex);
-	return change;
-}
-
-static snd_kcontrol_new_t snd_ymfpci_control_joystick __devinitdata = {
-	.name = "Joystick",
-	.iface = SNDRV_CTL_ELEM_IFACE_CARD,
-	.info = snd_ymfpci_joystick_info,
-	.get = snd_ymfpci_joystick_get,
-	.put = snd_ymfpci_joystick_put,
+static struct _snd_timer_hardware snd_ymfpci_timer_hw = {
+	.flags = SNDRV_TIMER_HW_AUTO,
+	.resolution = 10417, /* 1/2fs = 10.41666...us */
+	.ticks = 65536,
+	.start = snd_ymfpci_timer_start,
+	.stop = snd_ymfpci_timer_stop,
+	.precise_resolution = snd_ymfpci_timer_precise_resolution,
 };
 
-static snd_kcontrol_new_t snd_ymfpci_control_joystick_addr __devinitdata = {
-	.name = "Joystick Address",
-	.iface = SNDRV_CTL_ELEM_IFACE_CARD,
-	.info = snd_ymfpci_joystick_addr_info,
-	.get = snd_ymfpci_joystick_addr_get,
-	.put = snd_ymfpci_joystick_addr_put,
-};
-
-int __devinit snd_ymfpci_joystick(ymfpci_t *chip)
+int __devinit snd_ymfpci_timer(ymfpci_t *chip, int device)
 {
+	snd_timer_t *timer = NULL;
+	snd_timer_id_t tid;
 	int err;
 
-	chip->joystick_port = 0; /* default */
-	if ((err = snd_ctl_add(chip->card, snd_ctl_new1(&snd_ymfpci_control_joystick, chip))) < 0)
-		return err;
-	if ((err = snd_ctl_add(chip->card, snd_ctl_new1(&snd_ymfpci_control_joystick_addr, chip))) < 0)
-		return err;
-	return 0;
+	tid.dev_class = SNDRV_TIMER_CLASS_CARD;
+	tid.dev_sclass = SNDRV_TIMER_SCLASS_NONE;
+	tid.card = chip->card->number;
+	tid.device = device;
+	tid.subdevice = 0;
+	if ((err = snd_timer_new(chip->card, "YMFPCI", &tid, &timer)) >= 0) {
+		strcpy(timer->name, "YMFPCI timer");
+		timer->private_data = chip;
+		timer->hw = snd_ymfpci_timer_hw;
+	}
+	chip->timer = timer;
+	return err;
 }
-#endif /* CONFIG_GAMEPORT */
 
 
 /*
@@ -1893,7 +1868,7 @@
 	snd_info_entry_t *entry;
 	
 	if (! snd_card_proc_new(card, "ymfpci", &entry))
-		snd_info_set_text_ops(entry, chip, snd_ymfpci_proc_read);
+		snd_info_set_text_ops(entry, chip, 1024, snd_ymfpci_proc_read);
 	return 0;
 }
 
@@ -2122,9 +2097,13 @@
 		release_resource(chip->fm_res);
 		kfree_nocheck(chip->fm_res);
 	}
-#if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE))
-	if (chip->joystick_res)
-		snd_ymfpci_disable_joystick(chip);
+#ifdef SUPPORT_JOYSTICK
+	if (chip->joystick_res) {
+		if (chip->gameport.io)
+			gameport_unregister_port(&chip->gameport);
+		release_resource(chip->joystick_res);
+		kfree_nocheck(chip->joystick_res);
+	}
 #endif
 	if (chip->reg_area_virt)
 		iounmap((void *)chip->reg_area_virt);
@@ -2221,10 +2200,11 @@
 
 	/* start hw again */
 	if (chip->start_count > 0) {
-		spin_lock(&chip->reg_lock);
+		unsigned long flags;
+		spin_lock_irqsave(&chip->reg_lock, flags);
 		snd_ymfpci_writel(chip, YDSXGR_MODE, chip->saved_ydsxgr_mode);
 		chip->active_bank = snd_ymfpci_readl(chip, YDSXGR_CTRLSELECT);
-		spin_unlock(&chip->reg_lock);
+		spin_unlock_irqrestore(&chip->reg_lock, flags);
 	}
 	snd_power_change_state(card, SNDRV_CTL_POWER_D0);
 }
@@ -2275,9 +2255,6 @@
 	spin_lock_init(&chip->voice_lock);
 	init_waitqueue_head(&chip->interrupt_sleep);
 	atomic_set(&chip->interrupt_sleep_count, 0);
-#if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE))
-	init_MUTEX(&chip->joystick_mutex);
-#endif
 	chip->card = card;
 	chip->pci = pci;
 	chip->irq = -1;
@@ -2336,6 +2313,8 @@
 		return err;
 	}
 
+	snd_card_set_dev(card, &pci->dev);
+
 	*rchip = chip;
 	return 0;
 }
--- diff/sound/pcmcia/Kconfig	2003-06-30 10:07:25.000000000 +0100
+++ source/sound/pcmcia/Kconfig	2004-02-09 10:39:58.000000000 +0000
@@ -5,13 +5,13 @@
 
 config SND_VXPOCKET
 	tristate "Digigram VXpocket"
-	depends on SND && PCMCIA
+	depends on SND && PCMCIA && ISA
 	help
 	  Say 'Y' or 'M' to include support for Digigram VXpocket soundcard.
 
 config SND_VXP440
 	tristate "Digigram VXpocket 440"
-	depends on SND && PCMCIA
+	depends on SND && PCMCIA && ISA
 	help
 	  Say 'Y' or 'M' to include support for Digigram VXpocket 440 soundcard.
 
--- diff/sound/pcmcia/vx/vx_entry.c	2004-02-09 10:36:12.000000000 +0000
+++ source/sound/pcmcia/vx/vx_entry.c	2004-02-09 10:39:58.000000000 +0000
@@ -27,6 +27,10 @@
 #include <pcmcia/cisreg.h>
 
 
+MODULE_AUTHOR("Takashi Iwai <tiwai@suse.de>");
+MODULE_DESCRIPTION("Common routines for Digigram PCMCIA VX drivers");
+MODULE_LICENSE("GPL");
+
 /*
  * prototypes
  */
--- diff/sound/ppc/daca.c	2003-09-30 15:46:21.000000000 +0100
+++ source/sound/ppc/daca.c	2004-02-09 10:39:58.000000000 +0000
@@ -249,7 +249,8 @@
 	pmac_daca_t *mix;
 
 #ifdef CONFIG_KMOD
-	request_module("i2c-keywest");
+	if (current->fs->root)
+		request_module("i2c-keywest");
 #endif /* CONFIG_KMOD */	
 
 	mix = kmalloc(sizeof(*mix), GFP_KERNEL);
--- diff/sound/ppc/tumbler.c	2003-09-30 15:46:21.000000000 +0100
+++ source/sound/ppc/tumbler.c	2004-02-09 10:39:58.000000000 +0000
@@ -666,6 +666,10 @@
 	pmac_tumbler_t *mix;
 	pmac_gpio_t *gp;
 	int val;
+#ifdef PMAC_SUPPORT_AUTOMUTE
+	if (chip->update_automute && chip->auto_mute)
+		return 0; /* don't touch in the auto-mute mode */
+#endif	
 	if (! (mix = chip->mixer_data))
 		return -ENODEV;
 	gp = (kcontrol->private_value == TUMBLER_MUTE_HP) ? &mix->hp_mute : &mix->amp_mute;
@@ -993,7 +997,8 @@
 	char *chipname;
 
 #ifdef CONFIG_KMOD
-	request_module("i2c-keywest");
+	if (current->fs->root)
+		request_module("i2c-keywest");
 #endif /* CONFIG_KMOD */	
 
 	mix = kmalloc(sizeof(*mix), GFP_KERNEL);
--- diff/sound/synth/emux/Makefile	2003-02-13 11:46:57.000000000 +0000
+++ source/sound/synth/emux/Makefile	2004-02-09 10:39:58.000000000 +0000
@@ -4,7 +4,7 @@
 #
 
 snd-emux-synth-objs := emux.o emux_synth.o emux_seq.o emux_nrpn.o \
-		       emux_effect.o emux_proc.o soundfont.o \
+		       emux_effect.o emux_proc.o emux_hwdep.o soundfont.o \
 		       $(if $(CONFIG_SND_SEQUENCER_OSS),emux_oss.o)
 
 #
--- diff/sound/synth/emux/emux.c	2002-11-18 10:11:55.000000000 +0000
+++ source/sound/synth/emux/emux.c	2004-02-09 10:39:58.000000000 +0000
@@ -67,6 +67,7 @@
  */
 int snd_emux_register(snd_emux_t *emu, snd_card_t *card, int index, char *name)
 {
+	int err;
 	snd_sf_callback_t sf_cb;
 
 	snd_assert(emu->hw != NULL, return -EINVAL);
@@ -90,6 +91,9 @@
 	if (emu->sflist == NULL)
 		return -ENOMEM;
 
+	if ((err = snd_emux_init_hwdep(emu)) < 0)
+		return err;
+
 	snd_emux_init_voices(emu);
 
 	snd_emux_init_seq(emu, card, index);
@@ -128,6 +132,8 @@
 #endif
 	snd_emux_detach_seq(emu);
 
+	snd_emux_delete_hwdep(emu);
+
 	if (emu->sflist)
 		snd_sf_free(emu->sflist);
 
--- diff/sound/synth/emux/emux_seq.c	2003-05-21 11:49:56.000000000 +0100
+++ source/sound/synth/emux/emux_seq.c	2004-02-09 10:39:58.000000000 +0000
@@ -107,6 +107,7 @@
 		p->port_mode =  SNDRV_EMUX_PORT_MODE_MIDI;
 		snd_emux_init_port(p);
 		emu->ports[i] = p->chset.port;
+		emu->portptrs[i] = p;
 	}
 
 	return 0;
--- diff/sound/synth/emux/emux_voice.h	2002-10-16 04:27:13.000000000 +0100
+++ source/sound/synth/emux/emux_voice.h	2004-02-09 10:39:58.000000000 +0000
@@ -81,4 +81,8 @@
 
 #define STATE_IS_PLAYING(s) ((s) & SNDRV_EMUX_ST_ON)
 
+/* emux_hwdep.c */
+int snd_emux_init_hwdep(snd_emux_t *emu);
+void snd_emux_delete_hwdep(snd_emux_t *emu);
+
 #endif
--- diff/sound/synth/emux/soundfont.c	2003-08-20 14:16:36.000000000 +0100
+++ source/sound/synth/emux/soundfont.c	2004-02-09 10:39:58.000000000 +0000
@@ -30,6 +30,7 @@
 #include <linux/slab.h>
 #include <sound/core.h>
 #include <sound/soundfont.h>
+#include <sound/seq_oss_legacy.h>
 
 /* Prototypes for static functions */
 
@@ -43,14 +44,14 @@
 static void set_sample_counter(snd_sf_list_t *sflist, snd_soundfont_t *sf, snd_sf_sample_t *sp);
 static snd_sf_sample_t *sf_sample_new(snd_sf_list_t *sflist, snd_soundfont_t *sf);
 static void sf_sample_delete(snd_sf_list_t *sflist, snd_soundfont_t *sf, snd_sf_sample_t *sp);
-static int load_map(snd_sf_list_t *sflist, const void *data, int count);
-static int load_info(snd_sf_list_t *sflist, const void *data, long count);
+static int load_map(snd_sf_list_t *sflist, const void __user *data, int count);
+static int load_info(snd_sf_list_t *sflist, const void __user *data, long count);
 static int remove_info(snd_sf_list_t *sflist, snd_soundfont_t *sf, int bank, int instr);
 static void init_voice_info(soundfont_voice_info_t *avp);
 static void init_voice_parm(soundfont_voice_parm_t *pp);
 static snd_sf_sample_t *set_sample(snd_soundfont_t *sf, soundfont_voice_info_t *avp);
 static snd_sf_sample_t *find_sample(snd_soundfont_t *sf, int sample_id);
-static int load_data(snd_sf_list_t *sflist, const void *data, long count);
+static int load_data(snd_sf_list_t *sflist, const void __user *data, long count);
 static void rebuild_presets(snd_sf_list_t *sflist);
 static void add_preset(snd_sf_list_t *sflist, snd_sf_zone_t *cur);
 static void delete_preset(snd_sf_list_t *sflist, snd_sf_zone_t *zp);
@@ -111,7 +112,7 @@
  * it wants to do with it.
  */
 int
-snd_soundfont_load(snd_sf_list_t *sflist, const void *data, long count, int client)
+snd_soundfont_load(snd_sf_list_t *sflist, const void __user *data, long count, int client)
 {
 	soundfont_patch_info_t patch;
 	unsigned long flags;
@@ -211,7 +212,7 @@
 
 /* open patch; create sf list */
 static int
-open_patch(snd_sf_list_t *sflist, const char *data, int count, int client)
+open_patch(snd_sf_list_t *sflist, const char __user *data, int count, int client)
 {
 	soundfont_open_parm_t parm;
 	snd_soundfont_t *sf;
@@ -394,7 +395,7 @@
 
 /* load voice map */
 static int
-load_map(snd_sf_list_t *sflist, const void *data, int count)
+load_map(snd_sf_list_t *sflist, const void __user *data, int count)
 {
 	snd_sf_zone_t *zp, *prevp;
 	snd_soundfont_t *sf;
@@ -490,7 +491,7 @@
  * open soundfont.
  */
 static int
-load_info(snd_sf_list_t *sflist, const void *data, long count)
+load_info(snd_sf_list_t *sflist, const void __user *data, long count)
 {
 	snd_soundfont_t *sf;
 	snd_sf_zone_t *zone;
@@ -674,7 +675,7 @@
  * routine.
  */
 static int
-load_data(snd_sf_list_t *sflist, const void *data, long count)
+load_data(snd_sf_list_t *sflist, const void __user *data, long count)
 {
 	snd_soundfont_t *sf;
 	soundfont_sample_info_t sample_info;
@@ -912,7 +913,7 @@
 
 /* load GUS patch */
 static int
-load_guspatch(snd_sf_list_t *sflist, const char *data, long count, int client)
+load_guspatch(snd_sf_list_t *sflist, const char __user *data, long count, int client)
 {
 	struct patch_info patch;
 	snd_soundfont_t *sf;
@@ -1085,7 +1086,7 @@
 
 /* load GUS patch */
 int
-snd_soundfont_load_guspatch(snd_sf_list_t *sflist, const char *data,
+snd_soundfont_load_guspatch(snd_sf_list_t *sflist, const char __user *data,
 			    long count, int client)
 {
 	int rc;
--- diff/sound/usb/usbaudio.c	2004-02-09 10:36:12.000000000 +0000
+++ source/sound/usb/usbaudio.c	2004-02-09 10:39:58.000000000 +0000
@@ -23,6 +23,18 @@
  *   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
+ *
+ *
+ *  NOTES:
+ *
+ *   - async unlink should be used for avoiding the sleep inside lock.
+ *     2.4.22 usb-uhci seems buggy for async unlinking and results in
+ *     oops.  in such a cse, pass async_unlink=0 option.
+ *   - the linked URBs would be preferred but not used so far because of
+ *     the instability of unlinking.
+ *   - type II is not supported properly.  there is no device which supports
+ *     this type *correctly*.  SB extigy looks as if it supports, but it's
+ *     indeed an AC3 stream packed in SPDIF frames (i.e. no real AC3 stream).
  */
 
 
@@ -57,6 +69,7 @@
 static int vid[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS-1)] = -1 }; /* Vendor ID for this card */
 static int pid[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS-1)] = -1 }; /* Product ID for this card */
 static int nrpacks = 4;		/* max. number of packets per urb */
+static int async_unlink = 1;
 
 MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
 MODULE_PARM_DESC(index, "Index value for the USB audio adapter.");
@@ -76,21 +89,9 @@
 MODULE_PARM(nrpacks, "i");
 MODULE_PARM_DESC(nrpacks, "Max. number of packets per URB.");
 MODULE_PARM_SYNTAX(nrpacks, SNDRV_ENABLED ",allows:{{2,10}}");
-
-
-/*
- * for using ASYNC unlink mode, define the following.
- * this will make the driver quicker response for request to STOP-trigger,
- * but it may cause oops by some unknown reason (bug of usb driver?),
- * so turning off might be sure.
- */
-/* #define SND_USE_ASYNC_UNLINK */
-
-#ifdef SND_USB_ASYNC_UNLINK
-#define UNLINK_FLAGS	URB_ASYNC_UNLINK
-#else
-#define UNLINK_FLAGS	0
-#endif
+MODULE_PARM(async_unlink, "i");
+MODULE_PARM_DESC(async_unlink, "Use async unlink mode.");
+MODULE_PARM_SYNTAX(async_unlink, SNDRV_BOOLEAN_TRUE_DESC);
 
 
 /*
@@ -572,20 +573,18 @@
 	snd_urb_ctx_t *ctx = (snd_urb_ctx_t *)urb->context;
 	snd_usb_substream_t *subs = ctx->subs;
 	snd_pcm_substream_t *substream = ctx->subs->pcm_substream;
-	int err;
+	int err = 0;
 
-	clear_bit(ctx->index, &subs->active_mask);
-	if (subs->running && subs->ops.retire(subs, substream->runtime, urb))
-		return;
-	if (! subs->running) /* can be stopped during retire callback */
-		return;
-	if ((err = subs->ops.prepare(subs, substream->runtime, urb)) < 0 ||
+	if ((subs->running && subs->ops.retire(subs, substream->runtime, urb)) ||
+	    ! subs->running || /* can be stopped during retire callback */
+	    (err = subs->ops.prepare(subs, substream->runtime, urb)) < 0 ||
 	    (err = usb_submit_urb(urb, GFP_ATOMIC)) < 0) {
-		snd_printd(KERN_ERR "cannot submit urb (err = %d)\n", err);
-		snd_pcm_stop(substream, SNDRV_PCM_STATE_XRUN);
-		return;
+		clear_bit(ctx->index, &subs->active_mask);
+		if (err < 0) {
+			snd_printd(KERN_ERR "cannot submit urb (err = %d)\n", err);
+			snd_pcm_stop(substream, SNDRV_PCM_STATE_XRUN);
+		}
 	}
-	set_bit(ctx->index, &subs->active_mask);
 }
 
 
@@ -597,63 +596,66 @@
 	snd_urb_ctx_t *ctx = (snd_urb_ctx_t *)urb->context;
 	snd_usb_substream_t *subs = ctx->subs;
 	snd_pcm_substream_t *substream = ctx->subs->pcm_substream;
-	int err;
+	int err = 0;
 
-	clear_bit(ctx->index + 16, &subs->active_mask);
-	if (subs->running && subs->ops.retire_sync(subs, substream->runtime, urb))
-		return;
-	if (! subs->running) /* can be stopped during retire callback */
-		return;
-	if ((err = subs->ops.prepare_sync(subs, substream->runtime, urb))  < 0 ||
+	if ((subs->running && subs->ops.retire_sync(subs, substream->runtime, urb)) ||
+	    ! subs->running || /* can be stopped during retire callback */
+	    (err = subs->ops.prepare_sync(subs, substream->runtime, urb)) < 0 ||
 	    (err = usb_submit_urb(urb, GFP_ATOMIC)) < 0) {
-		snd_printd(KERN_ERR "cannot submit sync urb (err = %d)\n", err);
-		snd_pcm_stop(substream, SNDRV_PCM_STATE_XRUN);
-		return;
+		clear_bit(ctx->index + 16, &subs->active_mask);
+		if (err < 0) {
+			snd_printd(KERN_ERR "cannot submit sync urb (err = %d)\n", err);
+			snd_pcm_stop(substream, SNDRV_PCM_STATE_XRUN);
+		}
 	}
-	set_bit(ctx->index + 16, &subs->active_mask);
 }
 
 
 /*
  * unlink active urbs.
- * return the number of active urbs.
  */
-static int deactivate_urbs(snd_usb_substream_t *subs, int force)
+static int deactivate_urbs(snd_usb_substream_t *subs, int force, int can_sleep)
 {
 	unsigned int i;
-	int alive;
+	int async;
 
 	subs->running = 0;
 
 	if (!force && subs->stream->chip->shutdown) /* to be sure... */
 		return 0;
 
-#ifndef SND_USB_ASYNC_UNLINK
-	if (in_interrupt())
+	async = !can_sleep && async_unlink;
+
+	if (! async && in_interrupt())
 		return 0;
-#endif
-	alive = 0;
+
 	for (i = 0; i < subs->nurbs; i++) {
 		if (test_bit(i, &subs->active_mask)) {
-			alive++;
-			if (! test_and_set_bit(i, &subs->unlink_mask))
-				usb_unlink_urb(subs->dataurb[i].urb);
+			if (! test_and_set_bit(i, &subs->unlink_mask)) {
+				struct urb *u = subs->dataurb[i].urb;
+				if (async)
+					u->transfer_flags |= URB_ASYNC_UNLINK;
+				else
+					u->transfer_flags &= ~URB_ASYNC_UNLINK;
+				usb_unlink_urb(u);
+			}
 		}
 	}
 	if (subs->syncpipe) {
 		for (i = 0; i < SYNC_URBS; i++) {
 			if (test_bit(i+16, &subs->active_mask)) {
-				alive++;
- 				if (! test_and_set_bit(i+16, &subs->unlink_mask))
-					usb_unlink_urb(subs->syncurb[i].urb);
+ 				if (! test_and_set_bit(i+16, &subs->unlink_mask)) {
+					struct urb *u = subs->syncurb[i].urb;
+					if (async)
+						u->transfer_flags |= URB_ASYNC_UNLINK;
+					else
+						u->transfer_flags &= ~URB_ASYNC_UNLINK;
+					usb_unlink_urb(u);
+				}
 			}
 		}
 	}
-#ifdef SND_USB_ASYNC_UNLINK
-	return alive;
-#else
 	return 0;
-#endif
 }
 
 
@@ -682,9 +684,11 @@
 		}
 	}
 
+	subs->active_mask = 0;
+	subs->unlink_mask = 0;
 	subs->running = 1;
 	for (i = 0; i < subs->nurbs; i++) {
-		if ((err = usb_submit_urb(subs->dataurb[i].urb, GFP_KERNEL)) < 0) {
+		if ((err = usb_submit_urb(subs->dataurb[i].urb, GFP_ATOMIC)) < 0) {
 			snd_printk(KERN_ERR "cannot submit datapipe for urb %d, err = %d\n", i, err);
 			goto __error;
 		}
@@ -692,7 +696,7 @@
 	}
 	if (subs->syncpipe) {
 		for (i = 0; i < SYNC_URBS; i++) {
-			if ((err = usb_submit_urb(subs->syncurb[i].urb, GFP_KERNEL)) < 0) {
+			if ((err = usb_submit_urb(subs->syncurb[i].urb, GFP_ATOMIC)) < 0) {
 				snd_printk(KERN_ERR "cannot submit syncpipe for urb %d, err = %d\n", i, err);
 				goto __error;
 			}
@@ -703,7 +707,7 @@
 
  __error:
 	// snd_pcm_stop(subs->pcm_substream, SNDRV_PCM_STATE_XRUN);
-	deactivate_urbs(subs, 0);
+	deactivate_urbs(subs, 0, 0);
 	return -EPIPE;
 }
 
@@ -763,7 +767,7 @@
 		err = start_urbs(subs, substream->runtime);
 		break;
 	case SNDRV_PCM_TRIGGER_STOP:
-		err = deactivate_urbs(subs, 0);
+		err = deactivate_urbs(subs, 0, 0);
 		break;
 	default:
 		err = -EINVAL;
@@ -796,8 +800,8 @@
 	int i;
 
 	/* stop urbs (to be sure) */
-	if (deactivate_urbs(subs, force) > 0)
-		wait_clear_urbs(subs);
+	deactivate_urbs(subs, force, 1);
+	wait_clear_urbs(subs);
 
 	for (i = 0; i < MAX_URBS; i++)
 		release_urb_ctx(&subs->dataurb[i]);
@@ -825,14 +829,6 @@
 	subs->freqmax = subs->freqn + (subs->freqn >> 2); /* max. allowed frequency */
 	subs->phase = 0;
 
-	/* reset the pointer */
-	subs->hwptr = 0;
-	subs->hwptr_done = 0;
-	subs->transfer_sched = 0;
-	subs->transfer_done = 0;
-	subs->active_mask = 0;
-	subs->unlink_mask = 0;
-
 	/* calculate the max. size of packet */
 	maxsize = ((subs->freqmax + 0x3fff) * (frame_bits >> 3)) >> 14;
 	if (subs->maxpacksize && maxsize > subs->maxpacksize) {
@@ -915,7 +911,7 @@
 		}
 		u->urb->dev = subs->dev;
 		u->urb->pipe = subs->datapipe;
-		u->urb->transfer_flags = URB_ISO_ASAP | UNLINK_FLAGS;
+		u->urb->transfer_flags = URB_ISO_ASAP;
 		u->urb->number_of_packets = u->packets;
 		u->urb->context = u;
 		u->urb->complete = snd_usb_complete_callback(snd_complete_urb);
@@ -937,7 +933,7 @@
 			u->urb->transfer_buffer_length = nrpacks * 3;
 			u->urb->dev = subs->dev;
 			u->urb->pipe = subs->syncpipe;
-			u->urb->transfer_flags = URB_ISO_ASAP | UNLINK_FLAGS;
+			u->urb->transfer_flags = URB_ISO_ASAP;
 			u->urb->number_of_packets = u->packets;
 			u->urb->context = u;
 			u->urb->complete = snd_usb_complete_callback(snd_complete_sync_urb);
@@ -955,6 +951,7 @@
 {
 	struct list_head *p;
 	struct audioformat *found = NULL;
+	int cur_attr = 0, attr;
 
 	list_for_each(p, &subs->fmt_list) {
 		struct audioformat *fp;
@@ -971,9 +968,37 @@
 			if (i >= fp->nr_rates)
 				continue;
 		}
+		attr = fp->ep_attr & EP_ATTR_MASK;
+		if (! found) {
+			found = fp;
+			cur_attr = attr;
+			continue;
+		}
+		/* avoid async out and adaptive in if the other method
+		 * supports the same format.
+		 * this is a workaround for the case like
+		 * M-audio audiophile USB.
+		 */
+		if (attr != cur_attr) {
+			if ((attr == EP_ATTR_ASYNC &&
+			     subs->direction == SNDRV_PCM_STREAM_PLAYBACK) ||
+			    (attr == EP_ATTR_ADAPTIVE &&
+			     subs->direction == SNDRV_PCM_STREAM_CAPTURE))
+				continue;
+			if ((cur_attr == EP_ATTR_ASYNC &&
+			     subs->direction == SNDRV_PCM_STREAM_PLAYBACK) ||
+			    (cur_attr == EP_ATTR_ADAPTIVE &&
+			     subs->direction == SNDRV_PCM_STREAM_CAPTURE)) {
+				found = fp;
+				cur_attr = attr;
+				continue;
+			}
+		}
 		/* find the format with the largest max. packet size */
-		if (! found || fp->maxpacksize > found->maxpacksize)
+		if (fp->maxpacksize > found->maxpacksize) {
 			found = fp;
+			cur_attr = attr;
+		}
 	}
 	return found;
 }
@@ -1241,6 +1266,17 @@
 	subs->maxframesize = bytes_to_frames(runtime, subs->maxpacksize);
 	subs->curframesize = bytes_to_frames(runtime, subs->curpacksize);
 
+	/* reset the pointer */
+	subs->hwptr = 0;
+	subs->hwptr_done = 0;
+	subs->transfer_sched = 0;
+	subs->transfer_done = 0;
+	subs->phase = 0;
+
+	/* clear urbs (to be sure) */
+	deactivate_urbs(subs, 0, 1);
+	wait_clear_urbs(subs);
+
 	return 0;
 }
 
@@ -1430,7 +1466,7 @@
 		fp = list_entry(p, struct audioformat, list);
 		if (! hw_check_valid_format(params, fp))
 			continue;
-		fbits |= (1UL << fp->format);
+		fbits |= (1ULL << fp->format);
 	}
 
 	oldbits[0] = fmt->bits[0];
@@ -1455,6 +1491,7 @@
 	u32 channels[64];
 	u32 rates[64];
 	u32 cmaster, rmaster;
+	u32 rate_min = 0, rate_max = 0;
 	struct list_head *p;
 
 	memset(channels, 0, sizeof(channels));
@@ -1466,6 +1503,15 @@
 		/* unconventional channels? */
 		if (f->channels > 32)
 			return 1;
+		/* continuous rate min/max matches? */
+		if (f->rates & SNDRV_PCM_RATE_CONTINUOUS) {
+			if (rate_min && f->rate_min != rate_min)
+				return 1;
+			if (rate_max && f->rate_max != rate_max)
+				return 1;
+			rate_min = f->rate_min;
+			rate_max = f->rate_max;
+		}
 		/* combination of continuous rates and fixed rates? */
 		if (rates[f->format] & SNDRV_PCM_RATE_CONTINUOUS) {
 			if (f->rates != rates[f->format])
@@ -1820,7 +1866,7 @@
 
 	sprintf(name, "stream%d", stream->pcm_index);
 	if (! snd_card_proc_new(card, name, &entry))
-		snd_info_set_text_ops(entry, stream, proc_pcm_format_read);
+		snd_info_set_text_ops(entry, stream, 1024, proc_pcm_format_read);
 }
 
 
@@ -1956,7 +2002,7 @@
 	as->pcm = pcm;
 	pcm->private_data = as;
 	pcm->private_free = snd_usb_audio_pcm_free;
-	pcm->info_flags = 0;
+	pcm->info_flags = SNDRV_PCM_INFO_NONATOMIC_OPS;
 	if (chip->pcm_devs > 0)
 		sprintf(pcm->name, "USB Audio #%d", chip->pcm_devs);
 	else
@@ -2009,10 +2055,20 @@
 			pcm_format = SNDRV_PCM_FORMAT_S8;
 			break;
 		case 2:
-			pcm_format = SNDRV_PCM_FORMAT_S16_LE;
+			/* M-Audio audiophile USB workaround */
+			if (dev->descriptor.idVendor == 0x0763 &&
+			    dev->descriptor.idProduct == 0x2003)
+				pcm_format = SNDRV_PCM_FORMAT_S16_BE; /* grrr, big endian!! */
+			else
+				pcm_format = SNDRV_PCM_FORMAT_S16_LE;
 			break;
 		case 3:
-			pcm_format = SNDRV_PCM_FORMAT_S24_3LE;
+			/* M-Audio audiophile USB workaround */
+			if (dev->descriptor.idVendor == 0x0763 &&
+			    dev->descriptor.idProduct == 0x2003)
+				pcm_format = SNDRV_PCM_FORMAT_S24_3BE; /* grrr, big endian!! */
+			else
+				pcm_format = SNDRV_PCM_FORMAT_S24_3LE;
 			break;
 		case 4:
 			pcm_format = SNDRV_PCM_FORMAT_S32_LE;
@@ -2606,6 +2662,32 @@
 
 
 /*
+ * common proc files to show the usb device info
+ */
+static void proc_audio_usbbus_read(snd_info_entry_t *entry, snd_info_buffer_t *buffer)
+{
+	snd_usb_audio_t *chip = snd_magic_cast(snd_usb_audio_t, entry->private_data, return);
+	if (! chip->shutdown)
+		snd_iprintf(buffer, "%03d/%03d\n", chip->dev->bus->busnum, chip->dev->devnum);
+}
+
+static void proc_audio_usbid_read(snd_info_entry_t *entry, snd_info_buffer_t *buffer)
+{
+	snd_usb_audio_t *chip = snd_magic_cast(snd_usb_audio_t, entry->private_data, return);
+	if (! chip->shutdown)
+		snd_iprintf(buffer, "%04x:%04x\n", chip->dev->descriptor.idVendor, chip->dev->descriptor.idProduct);
+}
+
+static void snd_usb_audio_create_proc(snd_usb_audio_t *chip)
+{
+	snd_info_entry_t *entry;
+	if (! snd_card_proc_new(chip->card, "usbbus", &entry))
+		snd_info_set_text_ops(entry, chip, 1024, proc_audio_usbbus_read);
+	if (! snd_card_proc_new(chip->card, "usbid", &entry))
+		snd_info_set_text_ops(entry, chip, 1024, proc_audio_usbid_read);
+}
+
+/*
  * free the chip instance
  *
  * here we have to do not much, since pcm and controls are already freed
@@ -2637,6 +2719,7 @@
 {
 	snd_usb_audio_t *chip;
 	int err, len;
+	char component[14];
 	static snd_device_ops_t ops = {
 		.dev_free =	snd_usb_audio_dev_free,
 	};
@@ -2657,52 +2740,48 @@
 	}
 
 	strcpy(card->driver, "USB-Audio");
+	sprintf(component, "USB%04x:%04x",
+		dev->descriptor.idVendor, dev->descriptor.idProduct);
+	snd_component_add(card, component);
 
 	/* retrieve the device string as shortname */
-	if (dev->descriptor.iProduct)
-		len = usb_string(dev, dev->descriptor.iProduct,
-				 card->shortname, sizeof(card->shortname));
-	else
-		len = 0;
-	if (len <= 0) {
- 		if (quirk && quirk->product_name) {
-			strlcpy(card->shortname, quirk->product_name, sizeof(card->shortname));
-		} else {
+ 	if (quirk && quirk->product_name) {
+		strlcpy(card->shortname, quirk->product_name, sizeof(card->shortname));
+	} else {
+		if (!dev->descriptor.iProduct ||
+		    usb_string(dev, dev->descriptor.iProduct,
+      			       card->shortname, sizeof(card->shortname)) <= 0) {
+			/* no name available from anywhere, so use ID */
 			sprintf(card->shortname, "USB Device %#04x:%#04x",
 				dev->descriptor.idVendor, dev->descriptor.idProduct);
 		}
 	}
 
 	/* retrieve the vendor and device strings as longname */
-	if (dev->descriptor.iManufacturer)
-		len = usb_string(dev, dev->descriptor.iManufacturer,
-				 card->longname, sizeof(card->longname));
-	else
-		len = 0;
-	if (len <= 0) {
-		if (quirk && quirk->vendor_name) {
-			len = strlcpy(card->longname, quirk->vendor_name, sizeof(card->longname));
-		} else {
+	if (quirk && quirk->vendor_name) {
+		len = strlcpy(card->longname, quirk->vendor_name, sizeof(card->longname));
+	} else {
+		if (dev->descriptor.iManufacturer)
+			len = usb_string(dev, dev->descriptor.iManufacturer,
+					 card->longname, sizeof(card->longname));
+		else
 			len = 0;
-		}
+		/* we don't really care if there isn't any vendor string */
 	}
 	if (len > 0)
 		strlcat(card->longname, " ", sizeof(card->longname));
 
-	len = strlen(card->longname);
-
-	if ((!dev->descriptor.iProduct
-	     || usb_string(dev, dev->descriptor.iProduct,
-			   card->longname + len, sizeof(card->longname) - len) <= 0)
-	    && quirk && quirk->product_name) {
-		strlcat(card->longname, quirk->product_name, sizeof(card->longname));
-	}
+	strlcat(card->longname, card->shortname, sizeof(card->longname));
 
 	len = strlcat(card->longname, " at ", sizeof(card->longname));
 
 	if (len < sizeof(card->longname))
 		usb_make_path(dev, card->longname + len, sizeof(card->longname) - len);
 
+	snd_usb_audio_create_proc(chip);
+
+	snd_card_set_dev(card, &dev->dev);
+
 	*rchip = chip;
 	return 0;
 }
@@ -2733,7 +2812,7 @@
 	alts = &intf->altsetting[0];
 	ifnum = get_iface_desc(alts)->bInterfaceNumber;
 
-	if (quirk && quirk->ifnum != QUIRK_ANY_INTERFACE && ifnum != quirk->ifnum)
+	if (quirk && quirk->ifnum >= 0 && ifnum != quirk->ifnum)
 		goto __err_val;
 
 	/* SB Extigy needs special boot-up sequence */
@@ -2794,7 +2873,7 @@
 	}
 
 	err = 1; /* continue */
-	if (quirk) {
+	if (quirk && quirk->ifnum != QUIRK_NO_INTERFACE) {
 		/* need some special handlings */
 		if ((err = snd_usb_create_quirk(chip, intf, quirk)) < 0)
 			goto __error;
--- diff/sound/usb/usbaudio.h	2004-01-19 10:22:59.000000000 +0000
+++ source/sound/usb/usbaudio.h	2004-02-09 10:39:58.000000000 +0000
@@ -142,7 +142,8 @@
  * Information about devices with broken descriptors
  */
 
-#define QUIRK_ANY_INTERFACE -1
+#define QUIRK_NO_INTERFACE		-2
+#define QUIRK_ANY_INTERFACE		-1
 
 #define QUIRK_MIDI_FIXED_ENDPOINT	0
 #define QUIRK_MIDI_YAMAHA		1
--- diff/sound/usb/usbmidi.c	2003-08-20 14:16:36.000000000 +0100
+++ source/sound/usb/usbmidi.c	2004-02-09 10:39:58.000000000 +0000
@@ -142,8 +142,7 @@
 {
 	if (status == -ENOENT)
 		return status; /* killed */
-	if (status == -ENODEV ||
-	    status == -EILSEQ ||
+	if (status == -EILSEQ ||
 	    status == -ETIMEDOUT)
 		return -ENODEV; /* device removed */
 	snd_printk(KERN_ERR "urb status %d\n", status);
--- diff/sound/usb/usbquirks.h	2003-09-30 15:46:21.000000000 +0100
+++ source/sound/usb/usbquirks.h	2004-02-09 10:39:58.000000000 +0000
@@ -39,202 +39,72 @@
 	.idProduct = prod, \
 	.bInterfaceClass = USB_CLASS_VENDOR_SPEC
 
-/* Yamaha devices */
-{
-	USB_DEVICE(0x0499, 0x1000),
-	.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
-		.vendor_name = "Yamaha",
-		.product_name = "UX256",
-		.ifnum = QUIRK_ANY_INTERFACE,
-		.type = QUIRK_MIDI_YAMAHA
-	}
-},
-{
-	USB_DEVICE(0x0499, 0x1001),
-	.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
-		.vendor_name = "Yamaha",
-		.product_name = "MU1000",
-		.ifnum = QUIRK_ANY_INTERFACE,
-		.type = QUIRK_MIDI_YAMAHA
-	}
-},
-{
-	USB_DEVICE(0x0499, 0x1002),
-	.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
-		.vendor_name = "Yamaha",
-		.product_name = "MU2000",
-		.ifnum = QUIRK_ANY_INTERFACE,
-		.type = QUIRK_MIDI_YAMAHA
-	}
-},
-{
-	USB_DEVICE(0x0499, 0x1003),
-	.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
-		.vendor_name = "Yamaha",
-		.product_name = "MU500",
-		.ifnum = QUIRK_ANY_INTERFACE,
-		.type = QUIRK_MIDI_YAMAHA
-	}
-},
-{
-	USB_DEVICE_VENDOR_SPEC(0x0499, 0x1004),
-	.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
-		.vendor_name = "Yamaha",
-		.product_name = "UW500",
-		.ifnum = 3,
-		.type = QUIRK_MIDI_YAMAHA
-	}
-},
-{
-	USB_DEVICE(0x0499, 0x1005),
-	.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
-		.vendor_name = "Yamaha",
-		.product_name = "MOTIF6",
-		.ifnum = QUIRK_ANY_INTERFACE,
-		.type = QUIRK_MIDI_YAMAHA
-	}
-},
-{
-	USB_DEVICE(0x0499, 0x1006),
-	.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
-		.vendor_name = "Yamaha",
-		.product_name = "MOTIF7",
-		.ifnum = QUIRK_ANY_INTERFACE,
-		.type = QUIRK_MIDI_YAMAHA
-	}
-},
-{
-	USB_DEVICE(0x0499, 0x1007),
-	.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
-		.vendor_name = "Yamaha",
-		.product_name = "MOTIF8",
-		.ifnum = QUIRK_ANY_INTERFACE,
-		.type = QUIRK_MIDI_YAMAHA
-	}
-},
-{
-	USB_DEVICE(0x0499, 0x1008),
-	.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
-		.vendor_name = "Yamaha",
-		.product_name = "UX96",
-		.ifnum = QUIRK_ANY_INTERFACE,
-		.type = QUIRK_MIDI_YAMAHA
-	}
-},
-{
-	USB_DEVICE(0x0499, 0x1009),
-	.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
-		.vendor_name = "Yamaha",
-		.product_name = "UX16",
-		.ifnum = QUIRK_ANY_INTERFACE,
-		.type = QUIRK_MIDI_YAMAHA
-	}
-},
-{
-	USB_DEVICE_VENDOR_SPEC(0x0499, 0x100a),
-	.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
-		.vendor_name = "Yamaha",
-		.product_name = "EOS BX",
-		.ifnum = 3,
-		.type = QUIRK_MIDI_YAMAHA
-	}
-},
-{
-	USB_DEVICE(0x0499, 0x100e),
-	.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
-		.vendor_name = "Yamaha",
-		.product_name = "S08",
-		.ifnum = QUIRK_ANY_INTERFACE,
-		.type = QUIRK_MIDI_YAMAHA
-	}
-},
-{
-	USB_DEVICE(0x0499, 0x100f),
-	.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
-		.vendor_name = "Yamaha",
-		.product_name = "CLP-150",
-		.ifnum = QUIRK_ANY_INTERFACE,
-		.type = QUIRK_MIDI_YAMAHA
-	}
-},
-{
-	USB_DEVICE(0x0499, 0x1010),
-	.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
-		.vendor_name = "Yamaha",
-		.product_name = "CLP-170",
-		.ifnum = QUIRK_ANY_INTERFACE,
-		.type = QUIRK_MIDI_YAMAHA
-	}
-},
-{
-	USB_DEVICE(0x0499, 0x1011),
-	.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
-		.vendor_name = "Yamaha",
-		.product_name = "P-250",
-		.ifnum = QUIRK_ANY_INTERFACE,
-		.type = QUIRK_MIDI_YAMAHA
-	}
-},
-{
-	USB_DEVICE(0x0499, 0x1012),
-	.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
-		.vendor_name = "Yamaha",
-		.product_name = "TYROS",
-		.ifnum = QUIRK_ANY_INTERFACE,
-		.type = QUIRK_MIDI_YAMAHA
-	}
-},
-{
-	USB_DEVICE(0x0499, 0x1013),
-	.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
-		.vendor_name = "Yamaha",
-		.product_name = "PF-500",
-		.ifnum = QUIRK_ANY_INTERFACE,
-		.type = QUIRK_MIDI_YAMAHA
-	}
-},
-{
-	USB_DEVICE(0x0499, 0x1014),
-	.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
-		.vendor_name = "Yamaha",
-		.product_name = "S90",
-		.ifnum = QUIRK_ANY_INTERFACE,
-		.type = QUIRK_MIDI_YAMAHA
-	}
-},
-{
-	USB_DEVICE(0x0499, 0x5002),
-	.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
-		.vendor_name = "Yamaha",
-		.product_name = "DME32",
-		.ifnum = QUIRK_ANY_INTERFACE,
-		.type = QUIRK_MIDI_YAMAHA
-	}
-},
-{
-	USB_DEVICE(0x0499, 0x5003),
-	.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
-		.vendor_name = "Yamaha",
-		.product_name = "DM2000",
-		.ifnum = QUIRK_ANY_INTERFACE,
-		.type = QUIRK_MIDI_YAMAHA
-	}
-},
-{
-	USB_DEVICE(0x0499, 0x5004),
-	.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
-		.vendor_name = "Yamaha",
-		.product_name = "02R96",
-		.ifnum = QUIRK_ANY_INTERFACE,
-		.type = QUIRK_MIDI_YAMAHA
-	}
-},
+/*
+ * Yamaha devices
+ */
+
+#define YAMAHA_DEVICE(id, name) { \
+	USB_DEVICE(0x0499, id), \
+	.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { \
+		.vendor_name = "Yamaha", \
+		.product_name = name, \
+		.ifnum = QUIRK_ANY_INTERFACE, \
+		.type = QUIRK_MIDI_YAMAHA \
+	} \
+}
+#define YAMAHA_INTERFACE(id, intf, name) { \
+	USB_DEVICE_VENDOR_SPEC(0x0499, id), \
+	.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { \
+		.vendor_name = "Yamaha", \
+		.product_name = name, \
+		.ifnum = intf, \
+		.type = QUIRK_MIDI_YAMAHA \
+	} \
+}
+YAMAHA_DEVICE(0x1000, "UX256"),
+YAMAHA_DEVICE(0x1001, "MU1000"),
+YAMAHA_DEVICE(0x1002, "MU2000"),
+YAMAHA_DEVICE(0x1003, "MU500"),
+YAMAHA_INTERFACE(0x1004, 3, "UW500"),
+YAMAHA_DEVICE(0x1005, "MOTIF6"),
+YAMAHA_DEVICE(0x1006, "MOTIF7"),
+YAMAHA_DEVICE(0x1007, "MOTIF8"),
+YAMAHA_DEVICE(0x1008, "UX96"),
+YAMAHA_DEVICE(0x1009, "UX16"),
+YAMAHA_INTERFACE(0x100a, 3, "EOS BX"),
+YAMAHA_DEVICE(0x100e, "S08"),
+YAMAHA_DEVICE(0x100f, "CLP-150"),
+YAMAHA_DEVICE(0x1010, "CLP-170"),
+YAMAHA_DEVICE(0x1011, "P-250"),
+YAMAHA_DEVICE(0x1012, "TYROS"),
+YAMAHA_DEVICE(0x1013, "PF-500"),
+YAMAHA_DEVICE(0x1014, "S90"),
+YAMAHA_DEVICE(0x1015, "MOTIF-R"),
+YAMAHA_DEVICE(0x1017, "CVP-204"),
+YAMAHA_DEVICE(0x1018, "CVP-206"),
+YAMAHA_DEVICE(0x1019, "CVP-208"),
+YAMAHA_DEVICE(0x101a, "CVP-210"),
+YAMAHA_DEVICE(0x101b, "PSR-1100"),
+YAMAHA_DEVICE(0x101c, "PSR-2100"),
+YAMAHA_DEVICE(0x101e, "PSR-K1"),
+YAMAHA_DEVICE(0x1020, "EZ-250i"),
+YAMAHA_DEVICE(0x1021, "MOTIF ES 6"),
+YAMAHA_DEVICE(0x1022, "MOTIF ES 7"),
+YAMAHA_DEVICE(0x1023, "MOTIF ES 8"),
+YAMAHA_DEVICE(0x5000, "CS1D"),
+YAMAHA_DEVICE(0x5001, "DSP1D"),
+YAMAHA_DEVICE(0x5002, "DME32"),
+YAMAHA_DEVICE(0x5003, "DM2000"),
+YAMAHA_DEVICE(0x5004, "02R96"),
+YAMAHA_DEVICE(0x5005, "ACU16-C"),
+YAMAHA_DEVICE(0x5006, "NHB32-C"),
+YAMAHA_DEVICE(0x5007, "DM1000"),
+YAMAHA_DEVICE(0x5008, "01V96"),
+#undef YAMAHA_DEVICE
+#undef YAMAHA_INTERFACE
 
 /*
  * Roland/RolandED/Edirol devices
- *
- * The USB MIDI Specification has been written by Roland,
- * but a 100% conforming Roland device has yet to be found.
  */
 {
 	USB_DEVICE(0x0582, 0x0000),
@@ -631,6 +501,15 @@
 		}
 	}
 },
+{
+	USB_DEVICE(0x0582, 0x0052),
+	.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
+		.vendor_name = "EDIROL",
+		.product_name = "UM-1SX",
+		.ifnum = 0,
+		.type = QUIRK_MIDI_STANDARD_INTERFACE
+	}
+},
 
 /* Midiman/M-Audio devices */
 {
@@ -768,6 +647,19 @@
 		}
 	}
 },
+{
+	USB_DEVICE_VENDOR_SPEC(0x0763, 0x200d),
+	.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
+		.vendor_name = "M-Audio",
+		.product_name = "OmniStudio",
+		.ifnum = 9,
+		.type = QUIRK_MIDI_MIDIMAN,
+		.data = & (const snd_usb_midi_endpoint_info_t) {
+			.out_cables = 0x0001,
+			.in_cables  = 0x0001
+		}
+	}
+},
 
 /* Mark of the Unicorn devices */
 {
@@ -785,4 +677,15 @@
 	}
 },
 
+{
+	/* Creative Sound Blaster MP3+ */
+	USB_DEVICE(0x041e, 0x3010),
+	.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
+		.vendor_name = "Creative Labs",
+		.product_name = "Sound Blaster MP3+",
+		.ifnum = QUIRK_NO_INTERFACE
+	}
+	
+},
+
 #undef USB_DEVICE_VENDOR_SPEC
--- diff/Documentation/i386/kgdb/andthen	1970-01-01 01:00:00.000000000 +0100
+++ source/Documentation/i386/kgdb/andthen	2004-02-09 10:39:51.000000000 +0000
@@ -0,0 +1,100 @@
+
+define	set_andthen
+	set var $thp=0
+	set var $thp=(struct kgdb_and_then_struct *)&kgdb_data[0]
+	set var $at_size = (sizeof kgdb_data)/(sizeof *$thp)
+	set var $at_oc=kgdb_and_then_count
+	set var $at_cc=$at_oc
+end
+
+define andthen_next
+	set var $at_cc=$arg0
+end
+
+define andthen
+	andthen_set_edge
+	if ($at_cc >= $at_oc)
+		printf "Outside window.  Window size is %d\n",($at_oc-$at_low)
+	else
+		printf "%d: ",$at_cc
+		output *($thp+($at_cc++ % $at_size ))
+		printf "\n"
+	end
+end
+define andthen_set_edge
+	set var $at_oc=kgdb_and_then_count
+	set var $at_low = $at_oc - $at_size
+	if ($at_low < 0 )
+		set var $at_low = 0
+	end
+	if (( $at_cc > $at_oc) || ($at_cc < $at_low))
+		printf "Count outside of window, setting count to "
+		if ($at_cc >= $at_oc)
+			set var $at_cc = $at_oc
+		else
+			set var $at_cc = $at_low
+		end
+		printf "%d\n",$at_cc
+	end
+end
+
+define beforethat
+	andthen_set_edge
+	if ($at_cc <= $at_low)
+		printf "Outside window.  Window size is %d\n",($at_oc-$at_low)
+	else
+		printf "%d: ",$at_cc-1
+		output *($thp+(--$at_cc % $at_size ))
+		printf "\n"
+	end
+end
+
+document andthen_next
+	andthen_next <count>
+	.	sets the number of the event to display next. If this event
+	.	is not in the event pool, either andthen or beforethat will
+	.	correct it to the nearest event pool edge.  The event pool
+	.	ends at the last event recorded and begins <number of events>
+	.	prior to that.  If beforethat is used next, it will display
+	.	event <count> -1.
+.
+	andthen commands are: set_andthen, andthen_next, andthen and beforethat
+end
+
+
+document andthen
+	andthen
+.	displays the next event in the list.  <set_andthen> sets up to display
+.	the oldest saved event first.
+.	<count> (optional) count of the event to display.
+.	note the number of events saved is specified at configure time.
+.	if events are saved between calls to andthen the index will change
+.	but the displayed event will be the next one (unless the event buffer
+.	is overrun).
+.
+.	andthen commands are: set_andthen, andthen_next, andthen and beforethat
+end
+
+document set_andthen
+	set_andthen
+.	sets up to use the <andthen> and <beforethat> commands.
+.		if you have defined your own struct, use the above and
+.		then enter the following:
+.		p $thp=(struct kgdb_and_then_structX *)&kgdb_data[0]
+.		where <kgdb_and_then_structX> is the name of your structure.
+.
+.	andthen commands are: set_andthen, andthen_next, andthen and beforethat
+end
+
+document beforethat
+	beforethat
+.	displays the next prior event in the list. <set_andthen> sets up to
+.	display the last occuring event first.
+.
+.	note the number of events saved is specified at configure time.
+.	if events are saved between calls to beforethat the index will change
+.	but the displayed event will be the next one (unless the event buffer
+.	is overrun).
+.
+.	andthen commands are: set_andthen, andthen_next, andthen and beforethat
+end
--- diff/Documentation/i386/kgdb/debug-nmi.txt	1970-01-01 01:00:00.000000000 +0100
+++ source/Documentation/i386/kgdb/debug-nmi.txt	2004-02-09 10:39:51.000000000 +0000
@@ -0,0 +1,37 @@
+Subject: Debugging with NMI
+Date: Mon, 12 Jul 1999 11:28:31 -0500
+From: David Grothe <dave@gcom.com>
+Organization: Gcom, Inc
+To: David Grothe <dave@gcom.com>
+
+Kernel hackers:
+
+Maybe this is old hat, but it is new to me --
+
+On an ISA bus machine, if you short out the A1 and B1 pins of an ISA
+slot you will generate an NMI to the CPU.  This interrupts even a
+machine that is hung in a loop with interrupts disabled.  Used in
+conjunction with kgdb <
+ftp://ftp.gcom.com/pub/linux/src/kgdb-2.3.35/kgdb-2.3.35.tgz > you can
+gain debugger control of a machine that is hung in the kernel!  Even
+without kgdb the kernel will print a stack trace so you can find out
+where it was hung.
+
+The A1/B1 pins are directly opposite one another and the farthest pins
+towards the bracket end of the ISA bus socket.  You can stick a paper
+clip or multi-meter probe between them to short them out.
+
+I had a spare ISA bus to PC104 bus adapter around.  The PC104 end of the
+board consists of two rows of wire wrap pins.  So I wired a push button
+between the A1/B1 pins and now have an ISA board that I can stick into
+any ISA bus slot for debugger entry.
+
+Microsoft has a circuit diagram of a PCI card at
+http://www.microsoft.com/hwdev/DEBUGGING/DMPSW.HTM.  If you want to
+build one you will have to mail them and ask for the PAL equations.
+Nobody makes one comercially.
+
+[THIS TIP COMES WITH NO WARRANTY WHATSOEVER.  It works for me, but if
+your machine catches fire, it is your problem, not mine.]
+
+-- Dave (the kgdb guy)
--- diff/Documentation/i386/kgdb/gdb-globals.txt	1970-01-01 01:00:00.000000000 +0100
+++ source/Documentation/i386/kgdb/gdb-globals.txt	2004-02-09 10:39:51.000000000 +0000
@@ -0,0 +1,71 @@
+Sender: akale@veritas.com
+Date: Fri, 23 Jun 2000 19:26:35 +0530
+From: "Amit S. Kale" <akale@veritas.com>
+Organization: Veritas Software (India)
+To: Dave Grothe <dave@gcom.com>, linux-kernel@vger.rutgers.edu
+CC: David Milburn <dmilburn@wirespeed.com>,
+        "Edouard G. Parmelan" <Edouard.Parmelan@quadratec.fr>,
+        ezannoni@cygnus.com, Keith Owens <kaos@ocs.com.au>
+Subject: Re: Module debugging using kgdb
+
+Dave Grothe wrote:
+>
+> Amit:
+>
+> There is a 2.4.0 version of kgdb on our ftp site:
+> ftp://ftp.gcom.com/pub/linux/src/kgdb.  I mirrored your version of gdb
+> and loadmodule.sh there.
+>
+> Have a look at the README file and see if I go it right.  If not, send
+> me some corrections and I will update it.
+>
+> Does your version of gdb solve the global variable problem?
+
+Yes.
+Thanks to Elena Zanoni, gdb (developement version) can now calculate
+correctly addresses  of dynamically loaded object files. I have not been
+following gdb developement for sometime and am not sure when symbol
+address calculation fix is going to appear in a gdb stable version.
+
+Elena, any idea when the fix will make it to a prebuilt gdb from a
+redhat release?
+
+For the time being I have built a gdb developement version. It can be
+used for module debugging with loadmodule.sh script.
+
+The problem with calculating of module addresses with previous versions
+of gdb was as follows:
+gdb did not use base address of a section while calculating address of
+a symbol in the section in an object file loaded via 'add-symbol-file'.
+It used address of .text segment instead. Due to this addresses of
+symbols in .data, .bss etc. (e.g. global variables) were calculated incorrectly.
+
+Above mentioned fix allow gdb to use base address of a segment while
+calculating address of a symbol in it. It adds a parameter '-s' to
+'add-symbol-file' command for specifying base address of a segment.
+
+loadmodule.sh script works as follows.
+
+1. Copy a module file to target machine.
+2. Load the module on the target machine using insmod with -m parameter.
+insmod produces a module load map which contains base addresses of all
+sections in the module and addresses of symbols in the module file.
+3. Find all sections and their base addresses in the module from
+the module map.
+4. Generate a script that loads the module file. The script uses
+'add-symbol-file' and specifies address of text segment followed by
+addresses of all segments in the module.
+
+Here is an example gdb script produced by loadmodule.sh script.
+
+add-symbol-file foo 0xd082c060 -s .text.lock 0xd08cbfb5
+-s .fixup 0xd08cfbdf -s .rodata 0xd08cfde0 -s __ex_table 0xd08e3b38
+-s .data 0xd08e3d00 -s .bss 0xd08ec8c0 -s __ksymtab 0xd08ee838
+
+With this command gdb can calculate addresses of symbols in ANY segment
+in a module file.
+
+Regards.
+--
+Amit Kale
+Veritas Software ( http://www.veritas.com )
--- diff/Documentation/i386/kgdb/gdbinit	1970-01-01 01:00:00.000000000 +0100
+++ source/Documentation/i386/kgdb/gdbinit	2004-02-09 10:39:51.000000000 +0000
@@ -0,0 +1,14 @@
+shell echo -e "\003" >/dev/ttyS0
+set remotebaud 38400
+target remote /dev/ttyS0
+define si
+stepi
+printf "EAX=%08x EBX=%08x ECX=%08x EDX=%08x\n", $eax, $ebx, $ecx, $edx
+printf "ESI=%08x EDI=%08x EBP=%08x ESP=%08x\n", $esi, $edi, $ebp, $esp
+x/i $eip
+end
+define ni
+nexti
+printf "EAX=%08x EBX=%08x ECX=%08x EDX=%08x\n", $eax, $ebx, $ecx, $edx
+printf "ESI=%08x EDI=%08x EBP=%08x ESP=%08x\n", $esi, $edi, $ebp, $esp
+x/i $eip
--- diff/Documentation/i386/kgdb/gdbinit-modules	1970-01-01 01:00:00.000000000 +0100
+++ source/Documentation/i386/kgdb/gdbinit-modules	2004-02-09 10:39:51.000000000 +0000
@@ -0,0 +1,146 @@
+#
+# Usefull GDB user-command to debug Linux Kernel Modules with gdbstub.
+#
+# This don't work for Linux-2.0 or older.
+#
+# Author Edouard G. Parmelan <Edouard.Parmelan@quadratec.fr>
+#
+#
+# Fri Apr 30 20:33:29 CEST 1999
+#   First public release.
+#
+#   Major cleanup after experiment Linux-2.0 kernel without success.
+#   Symbols of a module are not in the correct order, I can't explain
+#   why :(
+#
+# Fri Mar 19 15:41:40 CET 1999
+#   Initial version.
+#
+# Thu Jan  6 16:29:03 CST 2000
+#   A little fixing by Dave Grothe <dave@gcom.com>
+#
+# Mon Jun 19 09:33:13 CDT 2000
+#   Alignment changes from Edouard Parmelan
+#
+# The basic idea is to find where insmod load the module and inform
+# GDB to load the symbol table of the module with the GDB command
+# ``add-symbol-file <object> <address>''.
+#
+# The Linux kernel holds the list of all loaded modules in module_list,
+# this list end with &kernel_module (exactly with module->next == NULL,
+# but the last module is not a real module).
+#
+# Insmod allocates the struct module before the object file.  Since
+# Linux-2.1, this structure contain his size.  The real address of
+# the object file is then (char*)module + module->size_of_struct.
+#
+# You can use three user functions ``mod-list'', ``mod-print-symbols''
+# and ``add-module-symbols''.
+#
+# mod-list list all loaded modules with the format:
+#    <module-address> <module-name>
+#
+# As soon as you have found the address of your module, you can
+# print its exported symbols (mod-print-symbols) or inform GDB to add
+# symbols from your module file (mod-add-symbols).
+#
+# The argument that you give to mod-print-symbols or mod-add-symbols
+# is the <module-address> from the mod-list command.
+#
+# When using the mod-add-symbols command you must also give the full
+# pathname of the modules object code file.
+#
+# The command mod-add-lis is an example of how to make this easier.
+# You can edit this macro to contain the path name of your own
+# favorite module and then use it as a shorthand to load it.  You
+# still need the module-address, however.
+#
+# The internal function ``mod-validate'' set the GDB variable $mod
+# as a ``struct module*'' if the kernel known the module otherwise
+# $mod is set to NULL.  This ensure to not add symbols for a wrong
+# address.
+#
+# Have a nice hacking day !
+#
+#
+define mod-list
+    set $mod = (struct module*)module_list
+    # the last module is the kernel, ignore it
+    while $mod != &kernel_module
+    	printf "%p\t%s\n", (long)$mod, ($mod)->name
+	set $mod = $mod->next
+    end
+end
+document mod-list
+List all modules in the form: <module-address> <module-name>
+Use the <module-address> as the argument for the other
+mod-commands: mod-print-symbols, mod-add-symbols.
+end
+
+define mod-validate
+    set $mod = (struct module*)module_list
+    while ($mod != $arg0) && ($mod != &kernel_module)
+    	set $mod = $mod->next
+    end
+    if $mod == &kernel_module
+	set $mod = 0
+    	printf "%p is not a module\n", $arg0
+    end
+end
+document mod-validate
+mod-validate <module-address>
+Internal user-command used to validate the module parameter.
+If <module> is a real loaded module, set $mod to it otherwise set $mod to 0.
+end
+
+
+define mod-print-symbols
+    mod-validate $arg0
+    if $mod != 0
+	set $i = 0
+	while $i < $mod->nsyms
+	    set $sym = $mod->syms[$i]
+	    printf "%p\t%s\n", $sym->value, $sym->name
+	    set $i = $i + 1
+	end
+    end
+end
+document mod-print-symbols
+mod-print-symbols <module-address>
+Print all exported symbols of the module.  see mod-list
+end
+
+
+define mod-add-symbols-align
+    mod-validate $arg0
+    if $mod != 0
+	set $mod_base = ($mod->size_of_struct + (long)$mod)
+	if ($arg2 != 0) && (($mod_base & ($arg2 - 1)) != 0)
+	    set $mod_base = ($mod_base | ($arg2 - 1)) + 1
+	end
+	add-symbol-file $arg1 $mod_base
+    end
+end
+document mod-add-symbols-align
+mod-add-symbols-align <module-address> <object file path name> <align>
+Load the symbols table of the module from the object file where
+first section aligment is <align>.
+To retreive alignment, use `objdump -h <object file path name>'.
+end
+
+define mod-add-symbols
+    mod-add-symbols-align $arg0 $arg1 sizeof(long)
+end
+document mod-add-symbols
+mod-add-symbols <module-address> <object file path name>
+Load the symbols table of the module from the object file.
+Default alignment is 4.  See mod-add-symbols-align.
+end
+
+define mod-add-lis
+    mod-add-symbols-align $arg0 /usr/src/LiS/streams.o 16
+end
+document mod-add-lis
+mod-add-lis <module-address>
+Does mod-add-symbols <module-address> /usr/src/LiS/streams.o
+end
--- diff/Documentation/i386/kgdb/gdbinit.hw	1970-01-01 01:00:00.000000000 +0100
+++ source/Documentation/i386/kgdb/gdbinit.hw	2004-02-09 10:39:51.000000000 +0000
@@ -0,0 +1,117 @@
+
+#Using ia-32 hardware breakpoints.
+#
+#4 hardware breakpoints are available in ia-32 processors. These breakpoints
+#do not need code modification. They are set using debug registers.
+#
+#Each hardware breakpoint can be of one of the
+#three types: execution, write, access.
+#1. An Execution breakpoint is triggered when code at the breakpoint address is
+#executed.
+#2. A write breakpoint ( aka watchpoints ) is triggered when memory location
+#at the breakpoint address is written.
+#3. An access breakpoint is triggered when memory location at the breakpoint
+#address is either read or written.
+#
+#As hardware breakpoints are available in limited number, use software
+#breakpoints ( br command in gdb ) instead of execution hardware breakpoints.
+#
+#Length of an access or a write breakpoint defines length of the datatype to
+#be watched. Length is 1 for char, 2 short , 3 int.
+#
+#For placing execution, write and access breakpoints, use commands
+#hwebrk, hwwbrk, hwabrk
+#To remove a breakpoint use hwrmbrk command.
+#
+#These commands take following types of arguments. For arguments associated
+#with each command, use help command.
+#1. breakpointno: 0 to 3
+#2. length: 1 to 3
+#3. address: Memory location in hex ( without 0x ) e.g c015e9bc
+#
+#Use the command exinfo to find which hardware breakpoint occured.
+
+#hwebrk breakpointno address
+define hwebrk
+	maintenance packet Y$arg0,0,0,$arg1
+end
+document hwebrk
+	hwebrk <breakpointno> <address>
+	Places a hardware execution breakpoint
+	<breakpointno> = 0 - 3
+	<address> = Hex digits without leading "0x".
+end
+
+#hwwbrk breakpointno length address
+define hwwbrk
+	maintenance packet Y$arg0,1,$arg1,$arg2
+end
+document hwwbrk
+	hwwbrk <breakpointno> <length> <address>
+	Places a hardware write breakpoint
+	<breakpointno> = 0 - 3
+	<length> = 1 (1 byte), 2 (2 byte), 3 (4 byte)
+	<address> = Hex digits without leading "0x".
+end
+
+#hwabrk breakpointno length address
+define hwabrk
+	maintenance packet Y$arg0,1,$arg1,$arg2
+end
+document hwabrk
+	hwabrk <breakpointno> <length> <address>
+	Places a hardware access breakpoint
+	<breakpointno> = 0 - 3
+	<length> = 1 (1 byte), 2 (2 byte), 3 (4 byte)
+	<address> = Hex digits without leading "0x".
+end
+
+#hwrmbrk breakpointno
+define hwrmbrk
+	maintenance packet y$arg0
+end
+document hwrmbrk
+	hwrmbrk <breakpointno>
+	<breakpointno> = 0 - 3
+	Removes a hardware breakpoint
+end
+
+define reboot
+        maintenance packet r
+end
+#exinfo
+define exinfo
+	maintenance packet qE
+end
+document exinfo
+	exinfo
+	Gives information about a breakpoint.
+end
+define get_th
+	p $th=(struct thread_info *)((int)$esp & ~8191)
+end
+document get_th
+	get_tu
+	Gets and prints the current thread_info pointer, Defines th to be it.
+end
+define get_cu
+	p $cu=((struct thread_info *)((int)$esp & ~8191))->task
+end
+document get_cu
+	get_cu
+	Gets and print the "current" value.  Defines $cu to be it.
+end
+define int_off
+	set var $flags=$eflags
+	set $eflags=$eflags&~0x200
+	end
+define int_on
+	set var $eflags|=$flags&0x200
+	end
+document int_off
+	saves the current interrupt state and clears the processor interrupt
+	flag.  Use int_on to restore the saved flag.
+end
+document int_on
+	Restores the interrupt flag saved by int_off.
+end
--- diff/Documentation/i386/kgdb/kgdb.txt	1970-01-01 01:00:00.000000000 +0100
+++ source/Documentation/i386/kgdb/kgdb.txt	2004-02-09 10:39:51.000000000 +0000
@@ -0,0 +1,775 @@
+Last edit: <20030806.1637.12>
+This file has information specific to the i386 kgdb option.  Other
+platforms with the kgdb option may behave in a similar fashion.
+
+New features:
+============
+20030806.1557.37
+This version was made against the 2.6.0-test2 kernel. We have made the
+following changes:
+
+- The getthread() code in the stub calls find_task_by_pid().  It fails
+  if we are early in the bring up such that the pid arrays have yet to
+  be allocated.  We have added a line to kernel/pid.c to make
+  "kgdb_pid_init_done" true once the arrays are allocated.  This way the
+  getthread() code knows not to call.  This is only used by the thread
+  debugging stuff and threads will not yet exist at this point in the
+  boot.
+
+- For some reason, gdb was not asking for a new thread list when the
+  "info thread" command was given.  We changed to the newer version of
+  the thread info command and gdb now seems to ask when needed.  Result,
+  we now get all threads in the thread list.
+
+- We now respond to the ThreadExtraInfo request from gdb with the thread
+  name from task_struct .comm.  This then appears in the thread list.
+  Thoughts on additional options for this are welcome.  Things such as
+  "has BKL" and "Preempted" come to mind.  I think we could have a flag
+  word that could enable different bits of info here.
+
+- We now honor, sort of, the C and S commands.  These are continue and
+  single set after delivering a signal.  We ignore the signal and do the
+  requested action.  This only happens when we told gdb that a signal
+  was the reason for entry, which is only done on memory faults.  The
+  result is that you can now continue into the Oops.
+
+- We changed the -g to -gdwarf-2.  This seems to be the same as -ggdb,
+  but it is more exact on what language to use.
+
+- We added two dwarf2 include files and a bit of code at the end of
+  entry.S.  This does not yet work, so it is disabled.  Still we want to
+  keep track of the code and "maybe" someone out there can fix it.
+
+- Randy Dunlap sent some fix ups for this file which are now merged.
+
+- Hugh Dickins sent a fix to a bit of code in traps.c that prevents a
+  compiler warning if CONFIG_KGDB is off (now who would do that :).
+
+- Andrew Morton sent a fix for the serial driver which is now merged.
+
+- Andrew also sent a change to the stub around the cpu managment code
+  which is also merged.
+
+- Andrew also sent a patch to make "f" as well as "g" work as SysRq
+  commands to enter kgdb, merged.
+
+- If CONFIG_KGDB and CONFIG_DEBUG_SPINLOCKS are both set we added a
+  "who" field to the spinlock data struct.  This is filled with
+  "current" when ever the spinlock suceeds.  Useful if you want to know
+  who has the lock.
+
+_ And last, but not least, we fixed the "get_cu" macro to properly get
+  the current value of "current".
+
+New features:
+============
+20030505.1827.27
+We are starting to align with the sourceforge version, at least in
+commands.  To this end, the boot command string to start kgdb at
+boot time has been changed from "kgdb" to "gdb".
+
+Andrew Morton sent a couple of patches which are now included as follows:
+1.) We now return a flag to the interrupt handler.
+2.) We no longer use smp_num_cpus (a conflict with the lock meter).
+3.) And from William Lee Irwin III <wli@holomorphy.com> code to make
+    sure high-mem is set up before we attempt to register our interrupt
+    handler.
+We now include asm/kgdb.h from config.h so you will most likely never
+have to include it.  It also 'NULLS' the kgdb macros you might have in
+your code when CONFIG_KGDB is not defined.  This allows you to just
+turn off CONFIG_KGDB to turn off all the kgdb_ts() calls and such.
+This include is conditioned on the machine being an x86 so as to not
+mess with other archs.
+
+20020801.1129.03
+This is currently the version for the 2.4.18 (and beyond?) kernel.
+
+We have several new "features" beginning with this version:
+
+1.) Kgdb now syncs the "other" CPUs with a cross-CPU NMI.  No more
+    waiting and it will pull that guy out of an IRQ off spin lock :)
+
+2.) We doctored up the code that tells where a task is waiting and
+    included it so that the "info thread" command will show a bit more
+    than "schedule()".  Try it...
+
+3.) Added the ability to call a function from gdb.  All the standard gdb
+    issues apply, i.e. if you hit a breakpoint in the function, you are
+    not allowed to call another (gdb limitation, not kgdb).  To help
+    this capability we added a memory allocation function.  Gdb does not
+    return this memory (it is used for strings that you pass to that function
+    you are calling from gdb) so we fixed up a way to allow you to
+    manually return the memory (see below).
+
+4.) Kgdb time stamps (kgdb_ts()) are enhanced to expand what was the
+    interrupt flag to now also include the preemption count and the
+    "in_interrupt" info.  The flag is now called "with_pif" to indicate
+    the order, preempt_count, in_interrupt, flag.  The preempt_count is
+    shifted left by 4 bits so you can read the count in hex by dropping
+    the low order digit.  In_interrupt is in bit 1, and the flag is in
+    bit 0.
+
+5.) The command: "p kgdb_info" is now expanded and prints something
+    like:
+(gdb) p kgdb_info
+$2 = {used_malloc = 0, called_from = 0xc0107506, entry_tsc = 67468627259,
+  errcode = 0, vector = 3, print_debug_info = 0, hold_on_sstep = 1,
+  cpus_waiting = {{task = 0xc027a000, pid = 32768, hold = 0,
+      regs = 0xc027bf84}, {task = 0x0, pid = 0, hold = 0, regs = 0x0}}}
+
+    Things to note here: a.) used_malloc is the amount of memory that
+    has been malloc'ed to do calls from gdb.  You can reclaim this
+    memory like this: "p kgdb_info.used_malloc=0" Cool, huh?  b.)
+    cpus_waiting is now "sized" by the number of CPUs you enter at
+    configure time in the kgdb configure section.  This is NOT used
+    anywhere else in the system, but it is "nice" here.  c.)  The task's
+    "pid" is now in the structure.  This is the pid you will need to use
+    to decode to the thread id to get gdb to look at that thread.
+    Remember that the "info thread" command prints a list of threads
+    wherein it numbers each thread with its reference number followed
+    by the thread's pid.  Note that the per-CPU idle threads actually
+    have pids of 0 (yes, there is more than one pid 0 in an SMP system).
+    To avoid confusion, kgdb numbers these threads with numbers beyond
+    the MAX_PID.  That is why you see 32768 and above.
+
+6.) A subtle change, we now provide the complete register set for tasks
+    that are active on the other CPUs.  This allows better trace back on
+    those tasks.
+
+    And, let's mention what we could not fix.  Back-trace from all but the
+    thread that we trapped will, most likely, have a bogus entry in it.
+    The problem is that gdb does not recognize the entry code for
+    functions that use "current" near (at all?) the entry.  The compiler
+    is putting the "current" decode as the first two instructions of the
+    function where gdb expects to find %ebp changing code.  Back trace
+    also has trouble with interrupt frames.  I am talking with Daniel
+    Jacobowitz about some way to fix this, but don't hold your breath.
+
+20011220.0050.35
+Major enhancement with this version is the ability to hold one or more
+CPUs in an SMP system while allowing the others to continue.  Also, by
+default only the current CPU is enabled on single-step commands (please
+note that gdb issues single-step commands at times other than when you
+use the si command).
+
+Another change is to collect some useful information in
+a global structure called "kgdb_info".  You should be able to just:
+
+p kgdb_info
+
+although I have seen cases where the first time this is done gdb just
+prints the first member but prints the whole structure if you then enter
+CR (carriage return or enter).  This also works:
+
+p *&kgdb_info
+
+Here is a sample:
+(gdb) p kgdb_info
+$4 = {called_from = 0xc010732c, entry_tsc = 32804123790856, errcode = 0,
+  vector = 3, print_debug_info = 0}
+
+"Called_from" is the return address from the current entry into kgdb.
+Sometimes it is useful to know why you are in kgdb, for example, was
+it an NMI or a real breakpoint?  The simple way to interrogate this
+return address is:
+
+l *0xc010732c
+
+which will print the surrounding few lines of source code.
+
+"Entry_tsc" is the CPU TSC on entry to kgdb (useful to compare to the
+kgdb_ts entries).
+
+"errcode" and "vector" are other entry parameters which may be helpful on
+some traps.
+
+"print_debug_info" is the internal debugging kgdb print enable flag.  Yes,
+you can modify it.
+
+In SMP systems kgdb_info also includes the "cpus_waiting" structure and
+"hold_on_step":
+
+(gdb) p kgdb_info
+$7 = {called_from = 0xc0112739, entry_tsc = 1034936624074, errcode = 0,
+  vector = 2, print_debug_info = 0, hold_on_sstep = 1, cpus_waiting = {{
+      task = 0x0, hold = 0, regs = 0x0}, {task = 0xc71b8000, hold = 0,
+      regs = 0xc71b9f70}, {task = 0x0, hold = 0, regs = 0x0}, {task = 0x0,
+      hold = 0, regs = 0x0}, {task = 0x0, hold = 0, regs = 0x0}, {task = 0x0,
+      hold = 0, regs = 0x0}, {task = 0x0, hold = 0, regs = 0x0}, {task = 0x0,
+      hold = 0, regs = 0x0}}}
+
+"Cpus_waiting" has an entry for each CPU other than the current one that
+has been stopped.  Each entry contains the task_struct address for that
+CPU, the address of the regs for that task and a hold flag.  All these
+have the proper typing so that, for example:
+
+p *kgdb_info.cpus_waiting[1].regs
+
+will print the registers for CPU 1.
+
+"Hold_on_sstep" is a new feature with this version and comes up set or
+true.  What this means is that whenever kgdb is asked to single-step all
+other CPUs are held (i.e. not allowed to execute).  The flag applies to
+all but the current CPU and, again, can be changed:
+
+p kgdb_info.hold_on_sstep=0
+
+restores the old behavior of letting all CPUs run during single-stepping.
+
+Likewise, each CPU has a "hold" flag, which if set, locks that CPU out
+of execution.  Note that this has some risk in cases where the CPUs need
+to communicate with each other.  If kgdb finds no CPU available on exit,
+it will push a message thru gdb and stay in kgdb.  Note that it is legal
+to hold the current CPU as long as at least one CPU can execute.
+
+20010621.1117.09
+This version implements an event queue.  Events are signaled by calling
+a function in the kgdb stub and may be examined from gdb.  See EVENTS
+below for details.  This version also tightens up the interrupt and SMP
+handling to not allow interrupts on the way to kgdb from a breakpoint
+trap.  It is fine to allow these interrupts for user code, but not
+system debugging.
+
+Version
+=======
+
+This version of the kgdb package was developed and tested on
+kernel version 2.4.16.  It will not install on any earlier kernels.
+It is possible that it will continue to work on later versions
+of 2.4 and then versions of 2.5 (I hope).
+
+
+Debugging Setup
+===============
+
+Designate one machine as the "development" machine.  This is the
+machine on which you run your compiles and which has your source
+code for the kernel.  Designate a second machine as the "target"
+machine.  This is the machine that will run your experimental
+kernel.
+
+The two machines will be connected together via a serial line out
+one or the other of the COM ports of the PC.  You will need the
+appropriate modem eliminator (null modem) cable(s) for this.
+
+Decide on which tty port you want the machines to communicate, then
+connect them up back-to-back using the null modem cable.  COM1 is
+/dev/ttyS0 and COM2 is /dev/ttyS1. You should test this connection
+with the two machines prior to trying to debug a kernel.  Once you
+have it working, on the TARGET machine, enter:
+
+setserial /dev/ttyS0 (or what ever tty you are using)
+
+and record the port address and the IRQ number.
+
+On the DEVELOPMENT machine you need to apply the patch for the kgdb
+hooks.  You have probably already done that if you are reading this
+file.
+
+On your DEVELOPMENT machine, go to your kernel source directory and do
+"make Xconfig" where X is one of "x", "menu", or "".  If you are
+configuring in the standard serial driver, it must not be a module.
+Either yes or no is ok, but making the serial driver a module means it
+will initialize after kgdb has set up the UART interrupt code and may
+cause a failure of the control-C option discussed below.  The configure
+question for the serial driver is under the "Character devices" heading
+and is:
+
+"Standard/generic (8250/16550 and compatible UARTs) serial support"
+
+Go down to the kernel debugging menu item and open it up.  Enable the
+kernel kgdb stub code by selecting that item.  You can also choose to
+turn on the "-ggdb -O1" compile options.  The -ggdb causes the compiler
+to put more debug info (like local symbols) in the object file.  On the
+i386 -g and -ggdb are the same so this option just reduces to "O1".  The
+-O1 reduces the optimization level.  This may be helpful in some cases,
+be aware, however, that this may also mask the problem you are looking
+for.
+
+The baud rate.  Default is 115200.  What ever you choose be sure that
+the host machine is set to the same speed.  I recommend the default.
+
+The port.  This is the I/O address of the serial UART that you should
+have gotten using setserial as described above.  The standard COM1 port
+(3f8) using IRQ 4 is default.  COM2 is 2f8 which by convention uses IRQ
+3.
+
+The port IRQ (see above).
+
+Stack overflow test.  This option makes a minor change in the trap,
+system call and interrupt code to detect stack overflow and transfer
+control to kgdb if it happens.  (Some platforms have this in the
+baseline code, but the i386 does not.)
+
+You can also configure the system to recognize the boot option
+"console=kgdb" which if given will cause all console output during
+booting to be put thru gdb as well as other consoles.  This option
+requires that gdb and kgdb be connected prior to sending console output
+so, if they are not, a breakpoint is executed to force the connection.
+This will happen before any kernel output (it is going thru gdb, right),
+and will stall the boot until the connection is made.
+
+You can also configure in a patch to SysRq to enable the kGdb SysRq.
+This request generates a breakpoint.  Since the serial port IRQ line is
+set up after any serial drivers, it is possible that this command will
+work when the control-C will not.
+
+Save and exit the Xconfig program.  Then do "make clean" , "make dep"
+and "make bzImage" (or whatever target you want to make).  This gets the
+kernel compiled with the "-g" option set -- necessary for debugging.
+
+You have just built the kernel on your DEVELOPMENT machine that you
+intend to run on your TARGET machine.
+
+To install this new kernel, use the following installation procedure.
+Remember, you are on the DEVELOPMENT machine patching the kernel source
+for the kernel that you intend to run on the TARGET machine.
+
+Copy this kernel to your target machine using your usual procedures.  I
+usually arrange to copy development:
+/usr/src/linux/arch/i386/boot/bzImage to /vmlinuz on the TARGET machine
+via a LAN based NFS access.  That is, I run the cp command on the target
+and copy from the development machine via the LAN.  Run Lilo (see "man
+lilo" for details on how to set this up) on the new kernel on the target
+machine so that it will boot!  Then boot the kernel on the target
+machine.
+
+On the DEVELOPMENT machine, create a file called .gdbinit in the
+directory /usr/src/linux.  An example .gdbinit file looks like this:
+
+shell echo -e "\003" >/dev/ttyS0
+set remotebaud 38400 (or what ever speed you have chosen)
+target remote /dev/ttyS0
+
+
+Change the "echo" and "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.
+
+You are now ready to try it out.
+
+Boot your target machine with "kgdb" in the boot command i.e. something
+like:
+
+lilo> test kgdb
+
+or if you also want console output thru gdb:
+
+lilo> test kgdb console=kgdb
+
+You should see the lilo message saying it has loaded the kernel and then
+all output stops.  The kgdb stub is trying to connect with gdb.  Start
+gdb something like this:
+
+
+On your DEVELOPMENT machine, cd /usr/src/linux and enter "gdb vmlinux".
+When gdb gets the symbols loaded it will read your .gdbinit file and, 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 kgdb activation
+code.
+
+The gdb interaction should look something like this:
+
+    linux-dev:/usr/src/linux# gdb vmlinux
+    GDB is free software and you are welcome to distribute copies of it
+     under certain conditions; type "show copying" to see the conditions.
+    There is absolutely no warranty for GDB; type "show warranty" for details.
+    GDB 4.15.1 (i486-slackware-linux),
+    Copyright 1995 Free Software Foundation, Inc...
+    breakpoint () at i386-stub.c:750
+    750     }
+    (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.
+
+If you have the kgdb console enabled when you continue, gdb will print
+out all the console messages.
+
+The above example caused a breakpoint relatively early in the boot
+process.  For the i386 kgdb it is possible to code a break instruction
+as the first C-language point in init/main.c, i.e. as the first instruction
+in start_kernel().  This could be done as follows:
+
+#include <asm/kgdb.h>
+	 breakpoint();
+
+This breakpoint() is really a function that sets up the breakpoint and
+single-step hardware trap cells and then executes a breakpoint.  Any
+early hard coded breakpoint will need to use this function.  Once the
+trap cells are set up they need not be set again, but doing it again
+does not hurt anything, so you don't need to be concerned about which
+breakpoint is hit first.  Once the trap cells are set up (and the kernel
+sets them up in due course even if breakpoint() is never called) the
+macro:
+
+BREAKPOINT;
+
+will generate an inline breakpoint.  This may be more useful as it stops
+the processor at the instruction instead of in a function a step removed
+from the location of interest.  In either case <asm/kgdb.h> must be
+included to define both breakpoint() and BREAKPOINT.
+
+Triggering kgdbstub at other times
+==================================
+
+Often you don't need to enter the debugger until much later in the boot
+or even after the machine has been running for some time.  Once the
+kernel is booted and interrupts are on, you can force the system to
+enter the debugger by sending a control-C to the debug port. This is
+what the first line of the recommended .gdbinit file does.  This allows
+you to start gdb any time after the system is up as well as when the
+system is already at a breakpoint.  (In the case where the system is
+already at a breakpoint the control-C is not needed, however, it will
+be ignored by the target so no harm is done.  Also note the the echo
+command assumes that the port speed is already set.  This will be true
+once gdb has connected, but it is best to set the port speed before you
+run gdb.)
+
+Another simple way to do this is to put the following file in you ~/bin
+directory:
+
+#!/bin/bash
+echo  -e "\003"  > /dev/ttyS0
+
+Here, the ttyS0 should be replaced with what ever port you are using.
+The "\003" is control-C.  Once you are connected with gdb, you can enter
+control-C at the command prompt.
+
+An alternative way to get control to the debugger is to enable the kGdb
+SysRq command.  Then you would enter Alt-SysRq-g (all three keys at the
+same time, but push them down in the order given).  To refresh your
+memory of the available SysRq commands try Alt-SysRq-=.  Actually any
+undefined command could replace the "=", but I like to KNOW that what I
+am pushing will never be defined.
+
+Debugging hints
+===============
+
+You can break into the target machine at any time from the development
+machine by typing ^C (see above paragraph).  If the target machine has
+interrupts enabled this will stop it in the kernel and enter the
+debugger.
+
+There is unfortunately no way of breaking into the kernel if it is
+in a loop with interrupts disabled, so if this happens to you then
+you need to place exploratory breakpoints or printk's into the kernel
+to find out where it is looping.  The exploratory breakpoints can be
+entered either thru gdb or hard coded into the source.  This is very
+handy if you do something like:
+
+if (<it hurts>) BREAKPOINT;
+
+
+There is a copy of an e-mail in the Documentation/i386/kgdb/ directory
+(debug-nmi.txt) which describes how to create an NMI on an ISA bus
+machine using a paper clip.  I have a sophisticated version of this made
+by wiring a push button switch into a PC104/ISA bus adapter card.  The
+adapter card nicely furnishes wire wrap pins for all the ISA bus
+signals.
+
+When you are done debugging the kernel on the target machine it is a
+good idea to leave it in a running state.  This makes reboots faster,
+bypassing the fsck.  So do a gdb "continue" as the last gdb command if
+this is possible.  To terminate gdb itself on the development machine
+and leave the target machine running, first clear all breakpoints and
+continue, then type ^Z to suspend gdb and then kill it with "kill %1" or
+something similar.
+
+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.  Make sure it works
+in both directions.  There is no point in tearing out your hair in the
+kernel if the line doesn't work.
+
+All of the real action takes place in the file
+/usr/src/linux/arch/i386/kernel/kgdb_stub.c.  That is the code on the target
+machine that interacts with gdb on the development machine.  In gdb you can
+turn on a debug switch with the following command:
+
+	set remotedebug
+
+This will print out the protocol messages that gdb is exchanging with
+the target machine.
+
+Another place to look is /usr/src/arch/i386/lib/kgdb_serial.c. This is
+the code that talks to the serial port on the target side.  There might
+be a problem there.  In particular there is a section of this code that
+tests the UART which will tell you what UART you have if you define
+"PRNT" (just remove "_off" from the #define PRNT_off).  To view this
+report you will need to boot the system without any beakpoints.  This
+allows the kernel to run to the point where it calls kgdb to set up
+interrupts.  At this time kgdb will test the UART and print out the type
+it finds.  (You need to wait so that the printks are actually being
+printed.  Early in the boot they are cached, waiting for the console to
+be enabled.  Also, if kgdb is entered thru a breakpoint it is possible
+to cause a dead lock by calling printk when the console is locked.  The
+stub thus avoids doing printks from breakpoints, especially in the
+serial code.)  At this time, if the UART fails to do the expected thing,
+kgdb will print out (using printk) information on what failed.  (These
+messages will be buried in all the other boot up messages.  Look for
+lines that start with "gdb_hook_interrupt:".  You may want to use dmesg
+once the system is up to view the log.  If this fails or if you still
+don't connect, review your answers for the port address.  Use:
+
+setserial /dev/ttyS0
+
+to get the current port and IRQ information.  This command will also
+tell you what the system found for the UART type. The stub recognizes
+the following UART types:
+
+16450, 16550, and 16550A
+
+If you are really desperate you can use printk debugging in the
+kgdbstub code in the target kernel until you get it working.  In particular,
+there is a global variable in /usr/src/linux/arch/i386/kernel/kgdb_stub.c
+named "remote_debug".  Compile your kernel with this set to 1, rather
+than 0 and the debug stub will print out lots of stuff as it does
+what it does.  Likewise there are debug printks in the kgdb_serial.c
+code that can be turned on with simple changes in the macro defines.
+
+
+Debugging Loadable Modules
+==========================
+
+This technique comes courtesy of Edouard Parmelan
+<Edouard.Parmelan@quadratec.fr>
+
+When you run gdb, enter the command
+
+source gdbinit-modules
+
+This will read in a file of gdb macros that was installed in your
+kernel source directory when kgdb was installed.  This file implements
+the following commands:
+
+mod-list
+    Lists the loaded modules in the form <module-address> <module-name>
+
+mod-print-symbols <module-address>
+    Prints all the symbols in the indicated module.
+
+mod-add-symbols <module-address> <object-file-path-name>
+    Loads the symbols from the object file and associates them
+    with the indicated module.
+
+After you have loaded the module that you want to debug, use the command
+mod-list to find the <module-address> of your module.  Then use that
+address in the mod-add-symbols command to load your module's symbols.
+From that point onward you can debug your module as if it were a part
+of the kernel.
+
+The file gdbinit-modules also contains a command named mod-add-lis as
+an example of how to construct a command of your own to load your
+favorite module.  The idea is to "can" the pathname of the module
+in the command so you don't have to type so much.
+
+Threads
+=======
+
+Each process in a target machine is seen as a gdb thread. gdb thread
+related commands (info threads, thread n) can be used.
+
+ia-32 hardware breakpoints
+==========================
+
+kgdb stub contains support for hardware breakpoints using debugging features
+of ia-32(x86) processors. These breakpoints do not need code modification.
+They use debugging registers. 4 hardware breakpoints are available in ia-32
+processors.
+
+Each hardware breakpoint can be of one of the following three types.
+
+1. Execution breakpoint - An Execution breakpoint is triggered when code
+	at the breakpoint address is executed.
+
+	As limited number of hardware breakpoints are available, it is
+	advisable to use software breakpoints ( break command ) instead
+	of execution hardware breakpoints, unless modification of code
+	is to be avoided.
+
+2. Write breakpoint - A write breakpoint is triggered when memory
+	location at the breakpoint address is written.
+
+	A write or can be placed for data of variable length. Length of
+	a write breakpoint indicates length of the datatype to be
+	watched. Length is 1 for 1 byte data , 2 for 2 byte data, 3 for
+	4 byte data.
+
+3. Access breakpoint - An access breakpoint is triggered when memory
+	location at the breakpoint address is either read or written.
+
+	Access breakpoints also have lengths similar to write breakpoints.
+
+IO breakpoints in ia-32 are not supported.
+
+Since gdb stub at present does not use the protocol used by gdb for hardware
+breakpoints, hardware breakpoints are accessed through gdb macros. gdb macros
+for hardware breakpoints are described below.
+
+hwebrk	- Places an execution breakpoint
+	hwebrk breakpointno address
+hwwbrk	- Places a write breakpoint
+	hwwbrk breakpointno length address
+hwabrk	- Places an access breakpoint
+	hwabrk breakpointno length address
+hwrmbrk	- Removes a breakpoint
+	hwrmbrk breakpointno
+exinfo	- Tells whether a software or hardware breakpoint has occurred.
+	Prints number of the hardware breakpoint if a hardware breakpoint has
+	occurred.
+
+Arguments required by these commands are as follows
+breakpointno	- 0 to 3
+length		- 1 to 3
+address		- Memory location in hex digits ( without 0x ) e.g c015e9bc
+
+SMP support
+==========
+
+When a breakpoint occurs or user issues a break ( Ctrl + C ) to gdb
+client, all the processors are forced to enter the debugger. Current
+thread corresponds to the thread running on the processor where
+breakpoint occurred.  Threads running on other processor(s) appear
+similar to other non-running threads in the 'info threads' output.
+Within the kgdb stub there is a structure "waiting_cpus" in which kgdb
+records the values of "current" and "regs" for each CPU other than the
+one that hit the breakpoint.  "current" is a pointer to the task
+structure for the task that CPU is running, while "regs" points to the
+saved registers for the task.  This structure can be examined with the
+gdb "p" command.
+
+ia-32 hardware debugging registers on all processors are set to same
+values.  Hence any hardware breakpoints may occur on any processor.
+
+gdb troubleshooting
+===================
+
+1. gdb hangs
+Kill it. restart gdb. Connect to target machine.
+
+2. gdb cannot connect to target machine (after killing a gdb and
+restarting another) If the target machine was not inside debugger when
+you killed gdb, gdb cannot connect because the target machine won't
+respond.  In this case echo "Ctrl+C"(ASCII 3) to the serial line.
+e.g. echo -e "\003" > /dev/ttyS1
+This forces that target machine into the debugger, after which you
+can connect.
+
+3. gdb cannot connect even after echoing Ctrl+C into serial line
+Try changing serial line settings min to 1 and time to 0
+e.g. stty min 1 time 0 < /dev/ttyS1
+Try echoing again
+
+Check serial line speed and set it to correct value if required
+e.g. stty ispeed 115200 ospeed 115200 < /dev/ttyS1
+
+EVENTS
+======
+
+Ever want to know the order of things happening?  Which CPU did what and
+when?  How did the spinlock get the way it is?  Then events are for
+you.  Events are defined by calls to an event collection interface and
+saved for later examination.  In this case, kgdb events are saved by a
+very fast bit of code in kgdb which is fully SMP and interrupt protected
+and they are examined by using gdb to display them.  Kgdb keeps only
+the last N events, where N must be a power of two and is defined at
+configure time.
+
+
+Events are signaled to kgdb by calling:
+
+kgdb_ts(data0,data1)
+
+For each call kgdb records each call in an array along with other info.
+Here is the array definition:
+
+struct kgdb_and_then_struct {
+#ifdef CONFIG_SMP
+	int	on_cpu;
+#endif
+	long long at_time;
+	int  	from_ln;
+	char	* in_src;
+	void	*from;
+        int     with_if;
+	int	data0;
+	int	data1;
+};
+
+For SMP machines the CPU is recorded, for all machines the TSC is
+recorded (gets a time stamp) as well as the line number and source file
+the call was made from.  The address of the (from), the "if" (interrupt
+flag) and the two data items are also recorded.  The macro kgdb_ts casts
+the types to int, so you can put any 32-bit values here.  There is a
+configure option to select the number of events you want to keep.  A
+nice number might be 128, but you can keep up to 1024 if you want.  The
+number must be a power of two.  An "andthen" macro library is provided
+for gdb to help you look at these events.  It is also possible to define
+a different structure for the event storage and cast the data to this
+structure.  For example the following structure is defined in kgdb:
+
+struct kgdb_and_then_struct2 {
+#ifdef CONFIG_SMP
+	int	on_cpu;
+#endif
+	long long at_time;
+	int  	from_ln;
+	char	* in_src;
+	void	*from;
+        int     with_if;
+	struct task_struct *t1;
+	struct task_struct *t2;
+};
+
+If you use this for display, the data elements will be displayed as
+pointers to task_struct entries.  You may want to define your own
+structure to use in casting.  You should only change the last two items
+and you must keep the structure size the same.  Kgdb will handle these
+as 32-bit ints, but within that constraint you can define a structure to
+cast to any 32-bit quantity.  This need only be available to gdb and is
+only used for casting in the display code.
+
+Final Items
+===========
+
+I picked up this code from Amit S. Kale and enhanced it.
+
+If you make some really cool modification to this stuff, or if you
+fix a bug, please let me know.
+
+George Anzinger
+<george@mvista.com>
+
+Amit S. Kale
+<akale@veritas.com>
+
+(First kgdb by David Grothe <dave@gcom.com>)
+
+(modified by Tigran Aivazian <tigran@sco.com>)
+    Putting gdbstub into the kernel config menu.
+
+(modified by Scott Foehner <sfoehner@engr.sgi.com>)
+    Hooks for entering gdbstub at boot time.
+
+(modified by Amit S. Kale <akale@veritas.com>)
+    Threads, ia-32 hw debugging, mp support, console support,
+    nmi watchdog handling.
+
+(modified by George Anzinger <george@mvista.com>)
+    Extended threads to include the idle threads.
+    Enhancements to allow breakpoint() at first C code.
+    Use of module_init() and __setup() to automate the configure.
+    Enhanced the cpu "collection" code to work in early bring-up.
+    Added ability to call functions from gdb
+    Print info thread stuff without going back to schedule()
+    Now collect the "other" cpus with an IPI/ NMI.
--- diff/Documentation/i386/kgdb/kgdbeth.txt	1970-01-01 01:00:00.000000000 +0100
+++ source/Documentation/i386/kgdb/kgdbeth.txt	2004-02-09 10:39:51.000000000 +0000
@@ -0,0 +1,92 @@
+KGDB over ethernet
+==================
+
+Authors
+-------
+
+Robert Walsh <rjwalsh@durables.org>  (2.6 port)
+wangdi <wangdi@clusterfs.com>        (2.6 port)
+Matt Mackall <mpm@selenic.com>       (netpoll api)
+San Mehat                            (original 2.4 code)
+
+
+Introduction
+------------
+
+KGDB supports debugging over ethernet (kgdboe) via polling of a given
+network interface. Most cards should be supported automatically.
+Debugging facilities are available as soon as the network driver and
+kgdboe have initialized. Unfortunately, this is too late in the boot
+process for debugging some issues, but works quite well for many
+others. This should not interfere with normal network usage and
+doesn't require a dedicated NIC.
+
+Terminology
+-----------
+
+This document uses the following terms:
+
+  TARGET: the machine being debugged.
+  HOST:   the machine running gdb.
+
+
+Usage
+-----
+
+You need to use the following command-line option on the TARGET kernel:
+
+  kgdboe=[tgt-port]@<tgt-ip>/[dev],[host-port]@<host-ip>/[host-macaddr]
+
+    where
+        tgt-port      source for UDP packets (defaults to 6443)
+        tgt-ip        source IP to use (interface address)
+        dev           network interface (eth0)
+        host-port     HOST UDP port (6442) (not really used)
+        host-ip       IP address for HOST machine
+        host-macaddr  ethernet MAC address for HOST (ff:ff:ff:ff:ff:ff)
+
+  examples:
+
+    kgdboe=7000@192.168.0.1/eth1,7001@192.168.0.2/00:05:3C:04:47:5D
+        this machine is 192.168.0.1 on eth1
+        remote machine is 192.168.0.2 with MAC address 00:05:3C:04:47:5D
+        listen for gdb packets on port 7000
+        send unsolicited gdb packets to port 7001
+
+    kgdboe=@192.168.0.1/,@192.168.0.2/
+        this machine is 192.168.0.1 on default interface eth0
+        remote machine is 192.168.0.2, use default broadcast MAC address
+        listen for gdb packets on default port 6443
+        send unsolicited gdb packets to port 6442
+
+Only packets originating from the configured HOST IP address will be
+accepted by the debugger.
+
+On the HOST side, run gdb as normal and use a remote UDP host as the
+target:
+
+   % gdb ./vmlinux
+   GNU gdb Red Hat Linux (5.3post-0.20021129.18rh)
+   Copyright 2003 Free Software Foundation, Inc.
+   GDB is free software, covered by the GNU General Public License, and you are
+   welcome to change it and/or distribute copies of it under certain conditions.
+   Type "show copying" to see the conditions.
+   There is absolutely no warranty for GDB.  Type "show warranty" for details.
+   This GDB was configured as "i386-redhat-linux-gnu"...
+   (gdb) target remote udp:HOSTNAME:6443
+
+You can now continue as if you were debugging over a serial line.
+
+Limitations
+-----------
+
+The current release of this code is exclusive of using kgdb on a
+serial interface, so you must boot without the kgdboe option to use
+serial debugging. Trying to debug the network driver while using it
+will prove interesting.
+
+Bug reports
+-----------
+
+Send bug reports to Robert Walsh <rjwalsh@durables.org> and Matt
+Mackall <mpm@selenic.com>.
--- diff/Documentation/i386/kgdb/loadmodule.sh	1970-01-01 01:00:00.000000000 +0100
+++ source/Documentation/i386/kgdb/loadmodule.sh	2004-02-09 10:39:51.000000000 +0000
@@ -0,0 +1,78 @@
+#/bin/sh
+# This script loads a module on a target machine and generates a gdb script.
+# source generated gdb script to load the module file at appropriate addresses
+# in gdb.
+#
+# Usage:
+# Loading the module on target machine and generating gdb script)
+#	[foo]$ loadmodule.sh <modulename>
+#
+# Loading the module file into gdb
+#	(gdb) source <gdbscriptpath>
+#
+# Modify following variables according to your setup.
+#	TESTMACHINE - Name of the target machine
+#	GDBSCRIPTS - The directory where a gdb script will be generated
+#
+# Author: Amit S. Kale (akale@veritas.com).
+#
+# If you run into problems, please check files pointed to by following
+# variables.
+#	ERRFILE - /tmp/<modulename>.errs contains stderr output of insmod
+#	MAPFILE - /tmp/<modulename>.map contains stdout output of insmod
+#	GDBSCRIPT - $GDBSCRIPTS/load<modulename> gdb script.
+
+TESTMACHINE=foo
+GDBSCRIPTS=/home/bar
+
+if [ $# -lt 1 ] ; then {
+	echo Usage: $0 modulefile
+	exit
+} ; fi
+
+MODULEFILE=$1
+MODULEFILEBASENAME=`basename $1`
+
+if [ $MODULEFILE = $MODULEFILEBASENAME ] ; then {
+	MODULEFILE=`pwd`/$MODULEFILE
+} fi
+
+ERRFILE=/tmp/$MODULEFILEBASENAME.errs
+MAPFILE=/tmp/$MODULEFILEBASENAME.map
+GDBSCRIPT=$GDBSCRIPTS/load$MODULEFILEBASENAME
+
+function findaddr() {
+	local ADDR=0x$(echo "$SEGMENTS" | \
+		grep "$1" | sed 's/^[^ ]*[ ]*[^ ]*[ ]*//' | \
+		sed 's/[ ]*[^ ]*$//')
+	echo $ADDR
+}
+
+function checkerrs() {
+	if [ "`cat $ERRFILE`" != "" ] ; then {
+		cat $ERRFILE
+		exit
+	} fi
+}
+
+#load the module
+echo Copying $MODULEFILE to $TESTMACHINE
+rcp $MODULEFILE root@${TESTMACHINE}:
+
+echo Loading module $MODULEFILE
+rsh -l root $TESTMACHINE  /sbin/insmod -m ./`basename $MODULEFILE` \
+	> $MAPFILE 2> $ERRFILE
+checkerrs
+
+SEGMENTS=`head -n 11 $MAPFILE | tail -n 10`
+TEXTADDR=$(findaddr "\\.text[^.]")
+LOADSTRING="add-symbol-file $MODULEFILE $TEXTADDR"
+SEGADDRS=`echo "$SEGMENTS" | awk '//{
+	if ($1 != ".text" && $1 != ".this" &&
+	    $1 != ".kstrtab" && $1 != ".kmodtab") {
+		print " -s " $1 " 0x" $3 " "
+	}
+}'`
+LOADSTRING="$LOADSTRING $SEGADDRS"
+echo Generating script $GDBSCRIPT
+echo $LOADSTRING > $GDBSCRIPT
--- diff/Documentation/laptop-mode.txt	1970-01-01 01:00:00.000000000 +0100
+++ source/Documentation/laptop-mode.txt	2004-02-09 10:39:51.000000000 +0000
@@ -0,0 +1,480 @@
+How to conserve battery power using laptop-mode
+-----------------------------------------------
+
+Document Author: Bart Samwel (bart@samwel.tk)
+Date created: January 2, 2004
+
+Introduction
+------------
+
+Laptopmode is used to minimize the time that the hard disk needs to be spun up,
+to conserve battery power on laptops. It has been reported to cause significant
+power savings.
+
+Contents
+--------
+
+* Introduction
+* The short story
+* Caveats
+* The details
+* Tips & Tricks
+* Control script
+* ACPI integration
+* Monitoring tool
+
+
+The short story
+---------------
+
+If you just want to use it, run the laptop_mode control script (which is included
+at the end of this document) as follows:
+
+# laptop_mode start
+
+Then set your harddisk spindown time to a relatively low value with hdparm:
+
+hdparm -S 4 /dev/hda
+
+The value -S 4 means 20 seconds idle time before spindown. Your harddisk will
+now only spin up when a disk cache miss occurs, or at least once every 10
+minutes to write back any pending changes.
+
+To stop laptop_mode, remount your filesystems with regular commit intervals
+(e.g., 5 seconds), and run "laptop_mode stop".
+
+
+Caveats
+-------
+
+* The downside of laptop mode is that you have a chance of losing up
+  to 10 minutes of work. If you cannot afford this, don't use it!
+
+* Most desktop hard drives have a very limited lifetime measured in spindown
+  cycles, typically about 50.000 times (it's usually listed on the spec sheet).
+  Check your drive's rating, and don't wear down your drive's lifetime if you
+  don't need to.
+
+* If you mount some of your ext3/reiserfs filesystems with the -n option, then
+  the control script will not be able to remount them correctly. You must set
+  DO_REMOUNTS=0 in the control script, otherwise it will remount them with the
+  wrong options -- or it will fail because it cannot write to /etc/mtab.
+
+* If you have your filesystems listed as type "auto" in fstab, like I did, then
+  the control script will not recognize them as filesystems that need remounting.
+
+The details
+-----------
+
+Laptop-mode is controlled by the flag /proc/sys/vm/laptop_mode. When this
+flag is set, any physical disk read operation (that might have caused the
+hard disk to spin up) causes Linux to flush all dirty blocks. The result
+of this is that after a disk has spun down, it will not be spun up anymore
+to write dirty blocks, because those blocks had already been written
+immediately after the most recent read operation
+
+To increase the effectiveness of the laptop_mode strategy, the laptop_mode
+control script increases dirty_expire_centisecs and dirty_writeback_centisecs in
+/proc/sys/vm to about 10 minutes (by default), which means that pages that are
+dirtied are not forced to be written to disk as often. The control script also
+changes the dirty background ratio, so that background writeback of dirty pages
+is not done anymore. Combined with a higher commit value (also 10 minutes) for
+ext3 or ReiserFS filesystems (also done automatically by the control script),
+this results in concentration of disk activity in a small time interval which
+occurs only once every 10 minutes, or whenever the disk is forced to spin up by
+a cache miss. The disk can then be spun down in the periods of inactivity.
+
+If you want to find out which process caused the disk to spin up, you can
+gather information by setting the flag /proc/sys/vm/block_dump. When this flag
+is set, Linux reports all disk read and write operations that take place, and
+all block dirtyings done to files. This makes it possible to debug why a disk
+needs to spin up, and to increase battery life even more.
+
+If 10 minutes is too much or too little downtime for you, you can configure
+this downtime as follows. In the control script, set the MAX_AGE value to the
+maximum number of seconds of disk downtime that you would like. You should
+then set your filesystem's commit interval to the same value. The dirty ratio
+is also configurable from the control script.
+
+If you don't like the idea of the control script remounting your filesystems
+for you, you can change DO_REMOUNTS to 0 in the script.
+
+Thanks to Kiko Piris, the control script can be used to enable laptop mode on
+both the Linux 2.4 and 2.6 series.
+
+
+Tips & Tricks
+-------------
+
+* Bartek Kania reports getting up to 50 minutes of extra battery life (on top
+  of his regular 3 to 3.5 hours) using very aggressive power management (hdparm
+  -B1) and a spindown time of 5 seconds (hdparm -S1).
+
+* You can spin down the disk while playing MP3, by setting the disk readahead
+  to 8MB (hdparm -a 16384). Effectively, the disk will read a complete MP3 at
+  once, and will then spin down while the MP3 is playing. (Thanks to Bartek
+  Kania.)
+
+* Drew Scott Daniels observed: "I don't know why, but when I decrease the number
+  of colours that my display uses it consumes less battery power. I've seen
+  this on powerbooks too. I hope that this is a piece of information that
+  might be useful to the Laptop Mode patch or it's users."
+
+
+Control script
+--------------
+
+Please note that this control script works for the Linux 2.4 and 2.6 series.
+
+--------------------CONTROL SCRIPT BEGIN------------------------------------------
+#!/bin/sh
+
+# start or stop laptop_mode, best run by a power management daemon when
+# ac gets connected/disconnected from a laptop
+#
+# install as /sbin/laptop_mode
+#
+# Contributors to this script:   Kiko Piris
+#				 Bart Samwel
+#				 Dax Kelson
+# Original Linux 2.4 version by: Jens Axboe
+
+parse_mount_opts () {
+	echo "$*"			| \
+	sed 's/commit=[0-9]*//g'	| \
+	sed 's/,,*/,/g'			| \
+	sed 's/^,//'			| \
+	sed 's/,$//'			| \
+	cat -
+}
+
+KLEVEL="$(uname -r | cut -c1-3)"
+case "$KLEVEL" in
+	"2.4")
+		true
+		;;
+	"2.6")
+		true
+		;;
+	*)
+		echo "Unhandled kernel level: $KLEVEL ('uname -r' = '$(uname -r)')"
+		exit 1
+		;;
+esac
+
+# Shall we remount journaled fs. with appropiate commit interval? (1=yes)
+DO_REMOUNTS=1
+
+# age time, in seconds. should be put into a sysconfig file
+MAX_AGE=600
+
+# Allowed dirty ratio, in pct. should be put into a sysconfig file as well.
+DIRTY_RATIO=40
+
+# kernel default dirty buffer age
+DEF_AGE=30
+DEF_UPDATE=5
+DEF_DIRTY_BACKGROUND_RATIO=10
+DEF_DIRTY_RATIO=40
+
+
+if [ ! -e /proc/sys/vm/laptop_mode ]; then
+	echo "Kernel is not patched with laptop_mode patch."
+	exit 1
+fi
+
+if [ ! -w /proc/sys/vm/laptop_mode ]; then
+	echo "You do not have enough privileges to enable laptop_mode."
+	exit 1
+fi
+
+case "$1" in
+	start)
+		AGE=$((100*$MAX_AGE))
+		echo -n "Starting laptop_mode"
+		case "$KLEVEL" in
+			"2.4")
+				echo "1"				> /proc/sys/vm/laptop_mode
+				echo "30 500 0 0 $AGE $AGE 60 20 0"	> /proc/sys/vm/bdflush
+				;;
+			"2.6")
+				echo "1"				> /proc/sys/vm/laptop_mode
+				echo "$AGE"				> /proc/sys/vm/dirty_writeback_centisecs
+				echo "$AGE"				> /proc/sys/vm/dirty_expire_centisecs
+				echo "$DIRTY_RATIO"			> /proc/sys/vm/dirty_ratio
+				echo "$DIRTY_RATIO"			> /proc/sys/vm/dirty_background_ratio
+				;;
+		esac
+		if [ $DO_REMOUNTS -eq 1 ]; then
+			cat /etc/mtab | while read DEV MP FST OPTS DUMP PASS ; do
+				PARSEDOPTS="$(parse_mount_opts "$OPTS")"
+				case "$FST" in
+					"ext3")		mount $DEV -t $FST $MP -o remount,$PARSEDOPTS,commit=$MAX_AGE ;;
+					"reiserfs")	mount $DEV -t $FST $MP -o remount,$PARSEDOPTS,commit=$MAX_AGE ;;
+					"xfs")		mount $DEV -t $FST $MP -o remount,$PARSEDOPTS,commit=$MAX_AGE ;;
+				esac
+			done
+		fi
+		echo "."
+		;;
+	stop)
+		U_AGE=$((100*$DEF_UPDATE))
+		B_AGE=$((100*$DEF_AGE))
+		echo -n "Stopping laptop_mode"
+		case "$KLEVEL" in
+			"2.4")
+				echo "0"				> /proc/sys/vm/laptop_mode
+				echo "30 500 0 0 $U_AGE $B_AGE 60 20 0"	> /proc/sys/vm/bdflush
+				;;
+			"2.6")
+				echo "0"				> /proc/sys/vm/laptop_mode
+				echo "$U_AGE"				> /proc/sys/vm/dirty_writeback_centisecs
+				echo "$B_AGE"				> /proc/sys/vm/dirty_expire_centisecs
+				echo "$DEF_DIRTY_RATIO"			> /proc/sys/vm/dirty_ratio
+				echo "$DEF_DIRTY_BACKGROUND_RATIO"	> /proc/sys/vm/dirty_background_ratio
+				;;
+		esac
+		if [ $DO_REMOUNTS -eq 1 ]; then
+			cat /etc/mtab | while read DEV MP FST OPTS DUMP PASS ; do
+				PARSEDOPTS="$(parse_mount_opts "$OPTS")"
+				case "$FST" in
+					"ext3")		mount $DEV -t $FST $MP -o remount,$PARSEDOPTS ;;
+					"reiserfs")	mount $DEV -t $FST $MP -o remount,$PARSEDOPTS ;;
+					"xfs")		mount $DEV -t $FST $MP -o remount,$PARSEDOPTS ;;
+				esac
+			done
+		fi
+		echo "."
+		;;
+	*)
+		echo "$0 {start|stop}"
+		;;
+
+esac
+
+exit 0
+
+--------------------CONTROL SCRIPT END--------------------------------------------
+
+
+ACPI integration
+----------------
+
+Dax Kelson submitted this so that the ACPI acpid daemon will
+kick off the laptop_mode script and run hdparm.
+
+---------------------------/etc/acpi/events/ac_adapter BEGIN-------------------------------------------
+event=ac_adapter
+action=/etc/acpi/actions/battery.sh
+---------------------------/etc/acpi/events/ac_adapter END-------------------------------------------
+
+---------------------------/etc/acpi/actions/battery.sh BEGIN-------------------------------------------
+#!/bin/sh
+
+# cpu throttling
+# cat /proc/acpi/processor/CPU0/throttling for more info
+ACAD_THR=0
+BATT_THR=2
+
+# spindown time for HD (man hdparm for valid values)
+# I prefer 2 hours for acad and 20 seconds for batt
+ACAD_HD=244
+BATT_HD=4
+
+# ac/battery event handler
+
+status=`awk '/^state: / { print $2 }' /proc/acpi/ac_adapter/AC/state`
+
+case $status in
+        "on-line")
+                echo "Setting HD spindown to 2 hours"
+                /sbin/laptop-mode stop
+                /sbin/hdparm -S $ACAD_HD /dev/hda > /dev/null 2>&1
+                /sbin/hdparm -B 255 /dev/hda > /dev/null 2>&1
+                #echo -n $ACAD_CPU:$ACAD_THR > /proc/acpi/processor/CPU0/limit
+                exit 0
+        ;;
+        "off-line")
+                echo "Setting HD spindown to 20 seconds"
+                /sbin/laptop-mode start
+                /sbin/hdparm -S $BATT_HD /dev/hda > /dev/null 2>&1
+                /sbin/hdparm -B 1 /dev/hda > /dev/null 2>&1
+                #echo -n $BATT_CPU:$BATT_THR > /proc/acpi/processor/CPU0/limit
+                exit 0
+        ;;
+esac
+---------------------------/etc/acpi/actions/battery.sh END-------------------------------------------
+
+Monitoring tool
+---------------
+
+Bartek Kania submitted this, it can be used to measure how much time your disk
+spends spun up/down.
+
+---------------------------dslm.c BEGIN-------------------------------------------
+/*
+ * Simple Disk SLeep Monitor
+ *  by Bartek Kania
+ * Licenced under the GPL
+ */
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <time.h>
+#include <string.h>
+#include <signal.h>
+#include <sys/ioctl.h>
+#include <linux/hdreg.h>
+
+#ifdef DEBUG
+#define D(x) x
+#else
+#define D(x)
+#endif
+
+int endit = 0;
+
+/* Check if the disk is in powersave-mode
+ * Most of the code is stolen from hdparm.
+ * 1 = active, 0 = standby/sleep, -1 = unknown */
+int check_powermode(int fd)
+{
+    unsigned char args[4] = {WIN_CHECKPOWERMODE1,0,0,0};
+    int state;
+
+    if (ioctl(fd, HDIO_DRIVE_CMD, &args)
+	&& (args[0] = WIN_CHECKPOWERMODE2) /* try again with 0x98 */
+	&& ioctl(fd, HDIO_DRIVE_CMD, &args)) {
+	if (errno != EIO || args[0] != 0 || args[1] != 0) {
+	    state = -1; /* "unknown"; */
+	} else
+	    state = 0; /* "sleeping"; */
+    } else {
+	state = (args[2] == 255) ? 1 : 0;
+    }
+    D(printf(" drive state is:  %s\n", state));
+
+    return state;
+}
+
+char *state_name(int i)
+{
+    if (i == -1) return "unknown";
+    if (i == 0) return "sleeping";
+    if (i == 1) return "active";
+
+    return "internal error";
+}
+
+char *myctime(time_t time)
+{
+    char *ts = ctime(&time);
+    ts[strlen(ts) - 1] = 0;
+
+    return ts;
+}
+
+void measure(int fd)
+{
+    time_t start_time;
+    int last_state;
+    time_t last_time;
+    int curr_state;
+    time_t curr_time = 0;
+    time_t time_diff;
+    time_t active_time = 0;
+    time_t sleep_time = 0;
+    time_t unknown_time = 0;
+    time_t total_time = 0;
+    int changes = 0;
+    float tmp;
+
+    printf("Starting measurements\n");
+
+    last_state = check_powermode(fd);
+    start_time = last_time = time(0);
+    printf("  System is in state %s\n\n", state_name(last_state));
+
+    while(!endit) {
+	sleep(1);
+	curr_state = check_powermode(fd);
+
+	if (curr_state != last_state || endit) {
+	    changes++;
+	    curr_time = time(0);
+	    time_diff = curr_time - last_time;
+
+	    if (last_state == 1) active_time += time_diff;
+	    else if (last_state == 0) sleep_time += time_diff;
+	    else unknown_time += time_diff;
+
+	    last_state = curr_state;
+	    last_time = curr_time;
+
+	    printf("%s: State-change to %s\n", myctime(curr_time),
+		   state_name(curr_state));
+	}
+    }
+    changes--; /* Compensate for SIGINT */
+
+    total_time = time(0) - start_time;
+    printf("\nTotal running time:  %lus\n", curr_time - start_time);
+    printf(" State changed %d times\n", changes);
+
+    tmp = (float)sleep_time / (float)total_time * 100;
+    printf(" Time in sleep state:   %lus (%.2f%%)\n", sleep_time, tmp);
+    tmp = (float)active_time / (float)total_time * 100;
+    printf(" Time in active state:  %lus (%.2f%%)\n", active_time, tmp);
+    tmp = (float)unknown_time / (float)total_time * 100;
+    printf(" Time in unknown state: %lus (%.2f%%)\n", unknown_time, tmp);
+}
+
+void ender(int s)
+{
+    endit = 1;
+}
+
+void usage()
+{
+    puts("usage: dslm [-w <time>] <disk>");
+    exit(0);
+}
+
+int main(int ac, char **av)
+{
+    int fd;
+    char *disk = 0;
+    int settle_time = 60;
+
+    /* Parse the simple command-line */
+    if (ac == 2)
+	disk = av[1];
+    else if (ac == 4) {
+	settle_time = atoi(av[2]);
+	disk = av[3];
+    } else
+	usage();
+
+    if (!(fd = open(disk, O_RDONLY|O_NONBLOCK))) {
+	printf("Can't open %s, because: %s\n", disk, strerror(errno));
+	exit(-1);
+    }
+
+    if (settle_time) {
+	printf("Waiting %d seconds for the system to settle down to "
+	       "'normal'\n", settle_time);
+	sleep(settle_time);
+    } else
+	puts("Not waiting for system to settle down");
+
+    signal(SIGINT, ender);
+
+    measure(fd);
+
+    close(fd);
+
+    return 0;
+}
+---------------------------dslm.c END---------------------------------------------
--- diff/Documentation/must-fix.txt	1970-01-01 01:00:00.000000000 +0100
+++ source/Documentation/must-fix.txt	2004-02-09 10:39:51.000000000 +0000
@@ -0,0 +1,288 @@
+
+Must-fix bugs
+=============
+
+drivers/char/
+~~~~~~~~~~~~~
+
+o TTY locking is broken.
+
+  o see FIXME in do_tty_hangup().  This causes ppp BUGs in local_bh_enable()
+
+  o Other problems: aviro, dipankar, Alan have details.
+
+  o somebody will have to document the tty driver and ldisc API
+
+drivers/tty
+~~~~~~~~~~~
+
+o viro: tty_driver refcounting, tty/misc/upper levels of sound still not
+  completely fixed.
+
+drivers/block/
+~~~~~~~~~~~~~~
+
+o loop.c: Concurrent write access on block devices might cause a deadlock
+  of the complete system. See:
+  http://marc.theaimsgroup.com/?l=linux-kernel&m=106275365925769&w==
+  http://bugzilla.kernel.org/show_bug.cgi?id=1198
+  Thread of possible fix:
+  http://www.kerneli.org/pipermail/cryptoapi-devel/2003-October/000676.html
+
+  (Fruhwirth Clemens)
+
+o ideraid hasn't been ported to 2.5 at all yet.
+
+  We need to understand whether the proposed BIO split code will suffice
+  for this.
+
+drivers/input/
+~~~~~~~~~~~~~~
+
+o rmk: unconverted keyboard/mouse drivers (there's a deadline of 2.6.0
+  currently on these remaining in my/Linus' tree.)
+
+o viro: large absence of locking.
+
+o viro: parport is nearly as bad as that and there the code is more hairy.
+  IMO parport is more of "figure out what API changes are needed for its
+  users, get them done ASAP, then fix generic layer at leisure"
+
+o (Albert Cahalan) Lots of people (check Google) get this message from the
+  kernel:
+
+  psmouse.c: Lost synchronization, throwing 2 bytes away.
+
+  (the number of bytes will be 1, 2, or 3)
+
+  At work, I get it when there is heavy NFS traffic.  The mouse goes crazy,
+  jumping around and doing random cut-and-paste all over everything.  This
+  is with a decently fast and modern PC.
+
+o There seem to be too many reports of keyboards and mice failing or acting
+  strangely.
+
+
+drivers/misc/
+~~~~~~~~~~~~~
+
+o rmk: UCB1[23]00 drivers, currently sitting in drivers/misc in the ARM
+  tree.  (touchscreen, audio, gpio, type device.)
+
+  These need to be moved out of drivers/misc/ and into real places
+
+o viro: actually, misc.c has a good chance to die.  With cdev-cidr that's
+  trivial.
+
+drivers/net/
+~~~~~~~~~~~~
+
+drivers/net/irda/
+~~~~~~~~~~~~~~~~~
+
+  (Jean Tourrilhes)
+
+o irport need to be converted to sir-kthread
+
+o dongle drivers need to be converted to sir-dev (in progress)
+
+o new drivers (irtty-sir/smsc-ircc2/donauboe) need more testing (in progress)
+
+
+drivers/pci/
+~~~~~~~~~~~~
+
+o alan: Some cardbus crashes the system
+
+  (bugzilla, please?)
+
+drivers/pcmcia/
+~~~~~~~~~~~~~~~
+
+o alan: This is a locking disaster.
+
+  (rmk, brodo: in progress)
+
+drivers/pld/
+~~~~~~~~~~~~
+
+o rmk: EPXA (ARM platform) PLD hotswap drivers (drivers/pld)
+
+  (rmk: will work out what to do here.  maybe drivers/arm/)
+
+drivers/video/
+~~~~~~~~~~~~~~
+
+o Lots of drivers don't compile, others do but don't work.
+
+drivers/scsi/
+~~~~~~~~~~~~~
+
+o Convert am53c974, dpt_i2o, initio and pci2220i to DMA-mapping
+
+o Make inia100, cpqfc, pci2000 and dc390t compile
+
+o Convert
+
+   wd33c99 based: a2091 a3000 gpv11 mvme174 sgiwd93
+
+   53c7xx based: amiga7xxx bvme6000 mvme16x initio am53c974 pci2000
+   pci2220i dc390t
+
+  To new error handling
+
+  It also might be possible to shift the 53c7xx based drivers over to
+  53c700 which does the new EH stuff, but I don't have the hardware to check
+  such a shift.
+
+  For the non-compiling stuff, I've probably missed a few that just aren't
+  compilable on my platforms, so any updates would be welcome.  Also, are
+  some of our non-compiling or unconverted drivers obsolete?
+
+fs/
+~~~
+
+o AIO/direct-IO writes can race with truncate and wreck filesystems.
+  (Badari has a patch)
+
+o viro: fs/char_dev.c needs removal of aeb stuff and merge of cdev-cidr.
+  In progress.
+
+o forward-port sct's O_DIRECT fixes (Badari has a patch)
+
+o viro: there is some generic stuff for namei/namespace/super, but that's a
+  slow-merge and can go in 2.6 just fine
+
+o trond: NFS has a mmap-versus-truncate problem (fixed? needs testing)
+
+o trond: NFSv4 client, bugs in lockd, RPSEC_GSS for NFSv[23], some atomic open
+  bits. more info: http://www.fys.uio.no/~trondmy/src/Linux-2.6.x/2.6.0-test11/
+
+kernel/sched.c
+~~~~~~~~~~~~~~
+
+o Starvation, general interactivity need close monitoring.
+
+o SMT aware scheduler (Ingo, Rusty, Nick have implementations)
+
+kernel/
+~~~~~~~
+
+o Alan: 32bit uid support is *still* broken for process accounting.
+
+  Create a 32bit uid, turn accounting on.  Shock horror it doesn't work
+  because the field is 16bit.  We need an acct structure flag day for 2.6
+  IMHO
+
+  (alan has patch)
+
+o viro: core sysctl code is racy.  And its interaction wiuth sysfs
+
+o (ingo) rwsems (on x86) are limited to 32766 waiting processes.  This
+  means that setting pid_max to above 32K is unsafe :-(
+
+  An option is to use CONFIG_RWSEM_GENERIC_SPINLOCK variant all the time,
+  for all archs, and not inline any part of the ops.
+
+lib/kobject.c
+~~~~~~~~~~~~~
+
+o kobject refcounting (comments from Al Viro):
+
+  _anything_ can grab a temporary reference to kobject.  IOW, if kobject is
+  embedded into something that could be freed - it _MUST_ have a destructor
+  and that destructor _MUST_ be the destructor for containing object.
+
+  Any violation of the above (and we already have a bunch of those) is a
+  user-triggerable memory corruption.
+
+  We can tolerate it for a while in 2.5 (e.g.  during work on susbsystem we
+  can decide to switch to that way of handling objects and have subsystem
+  vulnerable for a while), but all such windows must be closed before 2.6
+  and during 2.6 we can't open them at all.
+
+o All block drivers which control multiple gendisks with a single
+  request_queue are broken, due to one-to-one assumptions in the request
+  queue sysfs hookup.
+
+mm/
+~~~
+
+o GFP_DMA32 (or something like that).  Lots of ideas.  jejb, zaitcev,
+  willy, arjan, wli.
+
+  Specifically, 64-bit systems need to be able to enforce 32-bit addressing
+  limits for device metadata like network cards' ring buffers and SCSI
+  command descriptors.
+
+o access_process_vm() doesn't flush right.  We probably need new flushing
+  primitives to do this (davem?)
+
+
+modules
+~~~~~~~
+
+  (Rusty)
+
+net/
+~~~~
+
+  (davem)
+
+o UDP apps can in theory deadlock, because the ip_append_data path can end
+  up sleeping while the socket lock is held.
+
+  It is OK to sleep with the socket held held, normally.  But in this case
+  the sleep happens while waiting for socket memory/space to become
+  available, if another context needs to take the socket lock to free up the
+  space we could hang.
+
+  I sent a rough patch on how to fix this to Alexey, and he is analyzing
+  the situation.  I expect a final fix from him next week or so.
+
+o Semantics for IPSEC during operations such as TCP connect suck currently.
+
+  When we first try to connect to a destination, we may need to ask the
+  IPSEC key management daemon to resolve the IPSEC routes for us.  For the
+  purposes of what the kernel needs to do, you can think of it like ARP.  We
+  can't send the packet out properly until we resolve the path.
+
+  What happens now for IPSEC is basically this:
+
+  O_NONBLOCK: returns -EAGAIN over and over until route is resolved
+
+  !O_NONBLOCK: Sleeps until route is resolved
+
+  These semantics are total crap.  The solution, which Alexey is working
+  on, is to allow incomplete routes to exist.  These "incomplete" routes
+  merely put the packet onto a "resolution queue", and once the key manager
+  does it's thing we finish the output of the packet.  This is precisely how
+  ARP works.
+
+  I don't know when Alexey will be done with this.
+
+net/*/netfilter/
+~~~~~~~~~~~~~~~~
+
+  (Rusty)
+
+sound/
+~~~~~~
+
+global
+~~~~~~
+
+o viro: 64-bit dev_t (not a mustfix for 2.6.0). 32-bit dev_t is done, 64-bit
+  means extra work on nfsd/raid/etc.
+
+o alan: Forward port 2.4 fixes
+  - Chris Wright: Security fixes including execve holes, execve vs proc races
+
+o There are about 60 or 70 security related checks that need doing
+  (copy_user etc) from Stanford tools.  (badari is looking into this, and
+  hollisb)
+
+o A couple of hundred real looking bugzilla bugs
+
+o viro: cdev rework. Mostly done.
+
--- diff/Documentation/networking/netconsole.txt	1970-01-01 01:00:00.000000000 +0100
+++ source/Documentation/networking/netconsole.txt	2004-02-09 10:39:51.000000000 +0000
@@ -0,0 +1,57 @@
+
+started by Ingo Molnar <mingo@redhat.com>, 2001.09.17
+2.6 port and netpoll api by Matt Mackall <mpm@selenic.com>, Sep 9 2003
+
+Please send bug reports to Matt Mackall <mpm@selenic.com>
+
+This module logs kernel printk messages over UDP allowing debugging of
+problem where disk logging fails and serial consoles are impractical.
+
+It can be used either built-in or as a module. As a built-in,
+netconsole initializes immediately after NIC cards and will bring up
+the specified interface as soon as possible. While this doesn't allow
+capture of early kernel panics, it does capture most of the boot
+process.
+
+It takes a string configuration parameter "netconsole" in the
+following format:
+
+ netconsole=[src-port]@[src-ip]/[<dev>],[tgt-port]@<tgt-ip>/[tgt-macaddr]
+
+   where
+        src-port      source for UDP packets (defaults to 6665)
+        src-ip        source IP to use (interface address)
+        dev           network interface (eth0)
+        tgt-port      port for logging agent (6666)
+        tgt-ip        IP address for logging agent
+        tgt-macaddr   ethernet MAC address for logging agent (broadcast)
+
+Examples:
+
+ linux netconsole=4444@10.0.0.1/eth1,9353@10.0.0.2/12:34:56:78:9a:bc
+
+  or
+
+ insmod netconsole netconsole=@/,@10.0.0.2/
+
+Built-in netconsole starts immediately after the TCP stack is
+initialized and attempts to bring up the supplied dev at the supplied
+address.
+
+The remote host can run either 'netcat -u -l -p <port>' or syslogd.
+
+WARNING: the default target ethernet setting uses the broadcast
+ethernet address to send packets, which can cause increased load on
+other systems on the same ethernet segment.
+
+NOTE: the network device (eth1 in the above case) can run any kind
+of other network traffic, netconsole is not intrusive. Netconsole
+might cause slight delays in other traffic if the volume of kernel
+messages is high, but should have no other impact.
+
+Netconsole was designed to be as instantaneous as possible, to
+enable the logging of even the most critical kernel bugs. It works
+from IRQ contexts as well, and does not enable interrupts while
+sending packets. Due to these unique needs, configuration can not
+be more automatic, and some fundamental limitations will remain:
+only IP networks, UDP packets and ethernet devices are supported.
--- diff/Documentation/sched-domains.txt	1970-01-01 01:00:00.000000000 +0100
+++ source/Documentation/sched-domains.txt	2004-02-09 10:39:51.000000000 +0000
@@ -0,0 +1,55 @@
+Each CPU has a "base" scheduling domain (struct sched_domain). These are
+accessed via cpu_sched_domain(i) and this_sched_domain() macros. The domain
+hierarchy is built from these base domains via the ->parent pointer. ->parent
+MUST be NULL terminated, and domain structures should be per-CPU as they
+are locklessly updated.
+
+Each scheduling domain spans a number of CPUs (stored in the ->span field).
+A domain's span MUST be a superset of it child's span, and a base domain
+for CPU i MUST span at least i. The top domain for each CPU will generally
+span all CPUs in the system although strictly it doesn't have to, but this
+could lead to a case where some CPUs will never be given tasks to run unless
+the CPUs allowed mask is explicitly set. A sched domain's span means "balance
+process load among these CPUs".
+
+Each scheduling domain must have one or more CPU groups (struct sched_group)
+which are organised as a circular one way linked list from the ->groups
+pointer. The union of cpumasks of these groups MUST be the same as the
+domain's span. The intersection of cpumasks from any two of these groups
+MUST be the empty set. The group pointed to by the ->groups pointer MUST
+contain the CPU to which the domain belongs. Groups may be shared among
+CPUs as they contain read only data after they have been set up.
+
+Balancing within a sched domain occurs between groups. That is, each group
+is treated as one entity. The load of a group is defined as the sum of the
+load of each of its member CPUs, and only when the load of a group becomes
+out of balance are tasks moved between groups.
+
+In kernel/sched.c, rebalance_tick is run periodically on each CPU. This
+function takes its CPU's base sched domain and checks to see if has reached
+its rebalance interval. If so, then it will run load_balance on that domain.
+rebalance_tick then checks the parent sched_domain (if it exists), and the
+parent of the parent and so forth.
+
+*** Implementing sched domains ***
+The "base" domain will "span" the first level of the hierarchy. In the case
+of SMT, you'll span all siblings of the physical CPU, with each group being
+a single virtual CPU.
+
+In SMP, the parent of the base domain will span all physical CPUs in the
+node. Each group being a single physical CPU. Then with NUMA, the parent
+of the SMP domain will span the entire machine, with each group having the
+cpumask of a node. Or, you could do multi-level NUMA or Opteron, for example,
+might have just one domain covering its one NUMA level.
+
+The implementor should read comments in include/linux/sched.h:
+struct sched_domain fields, SD_FLAG_*, SD_*_INIT to get an idea of
+the specifics and what to tune.
+
+Implementors should change the line
+#undef SCHED_DOMAIN_DEBUG
+to
+#define SCHED_DOMAIN_DEBUG
+in kernel/sched.c as this enables an error checking parse of the sched domains
+which should catch most possible errors (described above). It also prints out
+the domain structure in a visual format.
--- diff/Documentation/should-fix.txt	1970-01-01 01:00:00.000000000 +0100
+++ source/Documentation/should-fix.txt	2004-02-09 10:39:52.000000000 +0000
@@ -0,0 +1,545 @@
+Not-ready features and speedups
+===============================
+
+Legend:
+
+PRI1:	We're totally lame if this doesn't get in
+PRI2:	Would be nice
+PRI3:	Not very important
+
+drivers/block/
+~~~~~~~~~~~~~~
+
+o viro: paride drivers need a big cleanup. Partially done, but ATAPI drivers
+  need serious work and bug fixing.
+
+  PRI2
+
+drivers/char/rtc/
+~~~~~~~~~~~~~~~~~
+
+o rmk, trini: add support for alarms to the existing generic rtc driver.
+
+  PRI2
+
+console drivers
+~~~~~~~~~~~~~~~
+  (Pavel Machek <pavel@ucw.cz>)
+
+o There are few must-fix bugs in cursor handling.
+
+o Play with gpm selection for a while and your cursor gets corrupted with
+  random dots. Ouch.
+
+device mapper
+~~~~~~~~~~~~~
+
+o ioctl interface cleanup patch is ready (redo the structure layouts)
+
+  PRI1
+
+o A port of the 2.4 snapshot and mirror targets is in progress
+
+  PRI1
+
+o the fs interface to dm needs to be redone.  gregkh was going to work on
+  this.  viro is interested in seeing work thus-far.
+
+  PRI2
+
+drivers/net/wireless/
+~~~~~~~~~~~~~~~~~~~~~
+
+  (Jean Tourrilhes <jt@bougret.hpl.hp.com>)
+
+o get HostAP driver in the kernel.  No consolidation of the 802.11
+  management across driver can happen until this one is in (which is probably
+  2.7.X material).  I think Jouni is mostly ready but didn't find time for
+  it.
+
+  PRI2
+
+o get more wireless drivers into the kernel.  The most "integrable" drivers
+  at this point seem the NWN driver, Pavel's Spectrum driver.
+
+  PRI1
+
+drivers/usb/gadget/
+~~~~~~~~~~~~~~~~~~~
+
+o rmk: SA11xx USB client/gadget code (David B has been doing some work on
+  this, and keeps trying to prod me, but unfortunately I haven't had the time
+  to look at his work, sorry David.)
+
+  PRI3
+
+fs/
+~~~
+
+o ext3 and ext2 block allocators have serious failure modes - interleaved
+  allocations.
+
+  PRI3
+
+o Integrate Chris Mason's 2.4 reiserfs ordered data and data journaling
+  patches.  They make reiserfs a lot safer.
+
+  Ordered: PRI2
+  data journalled: PRI3
+
+o viro: convert more filesystems to use lib/parser.c for options.
+
+  PRI2
+
+o aio: fs IO isn't async at present.  suparna has restart patches, they're
+  in -mm.  Need to get Ben to review/comment.
+
+  PRI1.
+
+o drepper: various filesystems use ->pid wrongly
+
+  PRI1
+
+o hch: devfs: there's a fundamental lookup vs devfsd race that's only
+  fixable by introducing a lookup vs devfs deadlock.  I can't see how this is
+  fixable without getting rid of the current devfsd design.  Mandrake seems
+  to have a workaround for this so this is at least not triggered so easily,
+  but that's not what I'd consider a fix..
+
+  PRI2
+
+kernel/
+~~~~~~~
+
+o rusty: Zippel's Reference count simplification.  Tricky code, but cuts
+  about 120 lines from module.c.  Patch exists, needs stressing.
+
+  PRI3
+
+o rusty: Fix module-failed-init races by starting module "disabled".  Patch
+  exists, requires some subsystems (ie.  add_partition) to explicitly say
+  "make module live now".  Without patch we are no worse off than 2.4 etc.
+
+  PRI1
+
+o Integrate userspace irq balancing daemon.
+
+  PRI2
+
+o kexec.  Seems to work, was in -mm.
+
+  PRI3
+
+o rmk: lib/inflate.c must not use static variables (causes these to be
+  referenced via GOTOFF relocations in PIC decompressor.  We have a PIC
+  decompressor to avoid having to hard code a per platform zImage link
+  address into the makefiles.)
+
+  PRI2
+
+o klibc merge?
+
+  PRI2
+
+mm/
+~~~
+
+o dropbehind for large files
+
+  PRI2
+
+net/
+~~~~
+
+  (davem)
+
+o Real serious use of IPSEC is hampered by lack of MPLS support.  MPLS is a
+  switching technology that works by switching based upon fixed length labels
+  prepended to packets.  Many people use this and IPSEC to implement VPNs
+  over public networks, it is also used for things like traffic engineering.
+
+  A good reference site is:
+
+	http://www.mplsrc.com/
+
+  Anyways, an existing (crappy) implementation exists.  I've almost
+  completed a rewrite, I should have something in the tree next week.
+
+  PRI1
+
+o Sometimes we generate IP fragments when it truly isn't necessary.
+
+  The way IP fragmentation is specified, each fragment must be modulo 8
+  bytes in length.  So suppose the device has an MTU that is not 0 modulo 8,
+  ethernet even classifies in this way.  1500 == (8 * 187) + 4
+
+  Our IP fragmenting engine can fragment on packets that are sized within
+  the last modulo 8 bytes of the MTU.  This happens in obscure cases, but it
+  does happen.
+
+  I've proposed a fix to Alexey, whereby very late in the output path we
+  check the packet, if we fragmented but the data length would fit into the
+  MTU we unfragment the packet.
+
+  This is low priority, because technically it creates suboptimal behavior
+  rather than mis-operation.
+
+  PRI1
+
+net/*/netfilter/
+~~~~~~~~~~~~~~~~
+
+o Lots of misc. cleanups, which are happening slowly.
+
+  PRI2
+
+power management
+~~~~~~~~~~~~~~~~
+
+o Pat and Pavel disagree over swsusp. Need to sort that out.
+
+  PRI2
+
+o Frame buffer restore codepaths (that requires some deep PCI magic)
+
+  PRI2
+
+o XFree86 hooks
+
+  PRI2
+
+o AGP restoration
+
+  PRI2
+
+o DRI restoration
+
+  (davej/Alan: not super-critical, can crash laptop on restore.  davej
+  looking into it.)
+
+  PRI2
+
+o IDE suspend/resume without races (Ben is looking at this a little)
+
+  PRI2
+
+o Pat: There are already CPU device structures; MTRRs should be a
+  dynamically registered interface of CPUs, which implies there needs
+  to be some other glue to know that there are MTRRs that need to be
+  saved/restored.
+
+  PRI1
+
+global
+~~~~~~
+
+o We need a kernel side API for reporting error events to userspace (could
+  be async to 2.6 itself)
+
+  (Prototype core based on netlink exists)
+
+  PRI2
+
+o Kai: Introduce a sane, easy and standard way to build external modules
+  - make clean and make modules_install are both broken
+
+  PRI2
+
+drivers
+~~~~~~~
+
+o Alan: Cardbus/PCMCIA requires all Russell's stuff is merged to do
+  multiheader right and so on
+
+  PRI1
+
+drivers/acpi/
+~~~~~~~~~~~~~
+
+o Fix acpi for all newer IBM Thinkpads see
+  http://bugme.osdl.org/show_bug.cgi?id=1038 for more information
+
+o alan: VIA APIC stuff is one bit of this, there are also some other
+  reports that were caused by ACPI not setting level v edge trigger some
+  times
+
+  PRI1
+
+o mochel: it seems the acpi irq routing code could use a serious rewrite.
+
+  grover: The problem is the ACPI irq routing code is trying to piggyback
+  on the existing MPS-specific data structures, and it's generally a hack.
+  So yes mochel is right, but it is also purging MPS-ities from common code
+  as well.  I've done some preliminary work in this area and it doesn't seem
+  to break anything (yet) but a rewrite in this area imho should not be
+  rushed out the door.  And, I think the above bugs can be fixed w/o the
+  rewrite.
+
+  PRI2
+
+o mochel: ACPI suspend doesn't work.  Important, not cricital.  Pat is
+  working it.
+
+  PRI2
+
+drivers/block/
+~~~~~~~~~~~~~~
+
+o More testing of floppy
+
+  PRI3
+
+drivers/char/
+~~~~~~~~~~~~~
+
+
+drivers/ide/
+~~~~~~~~~~~~
+
+  (Alan)
+
+o IDE PIO has occasional unexplained PIO disk eating reports
+
+  PRI1
+
+o IDE has multiple zillions of races/hangs in 2.5 still
+
+  PRI1
+
+o IDE scsi needs rewriting
+
+  PRI2
+
+o IDE needs significant reworking to handle Simplex right
+
+  PRI2
+
+o IDE hotplug handling for 2.5 is completely broken still
+
+  PRI2
+
+o There are lots of other IDE bugs that wont go away until the taskfile
+  stuff is included, the locking bugs that allow any user to hang the IDE
+  layer in 2.5, and some other updates are forward ported.  (esp.  HPT372N).
+
+  PRI1
+
+drivers/isdn/
+~~~~~~~~~~~~~
+
+  (Kai, rmk)
+
+o isdn_tty locking is completely broken (cli() and friends)
+
+  PRI2
+
+o fix other drivers
+
+  PRI2
+
+o lots more cleanups, adaption to recent APIs etc
+
+  PRI3
+
+o fixup tty-based ISDN drivers which provide TIOCM* ioctls (see my recent
+  3-set patch for serial stuff)
+
+  Alternatively, we could re-introduce the fallback to driver ioctl parsing
+  for these if not enough drivers get updated.
+
+  PRI3
+
+drivers/net/
+~~~~~~~~~~~~
+
+o davej: Either Wireless network drivers or PCMCIA broke somewhen.  A
+  configuration that worked fine under 2.4 doesn't receive any packets.  Need
+  to look into this more to make sure I don't have any misconfiguration that
+  just 'happened to work' under 2.4
+
+  PRI1
+
+drivers/scsi/
+~~~~~~~~~~~~~
+
+o jejb: qlogic -
+
+  o Merge the feral driver.  It covers all qlogic chips: 1020 all the way
+    up to 23xxx. http://linux-scsi.bkbits.net/scsi-isp-2.5
+
+  o qla2xxx: only for FC chips.  Has significant build issues.  hch
+    promises to send me a "must fix" list for this.
+    http://linux-scsi.bkbits.net/scsi-qla2xxx-2.5
+
+  PRI2
+
+o hch, Mike Anderson, Badari Pulavarty: scsi locking issues
+
+  o there are lots of members of struct Scsi_Host/scsi_device/scsi_cmnd
+    with very unclear locking, many of them probably want to become
+    atomic_t's or bitmaps (for the 1bit bitfields).
+
+  o there's lots of volatile abuse in the scsi code that needs to be
+    thought about.
+
+  o there's some global variables incremented without any locks
+
+  PRI2
+
+sound/
+~~~~~~
+
+o rmk: several OSS drivers for SA11xx-based hardware in need of
+  ALSA-ification and L3 bus support code for these.
+
+o rmk: need to complete ALSA-ification of the WaveArtist driver for both
+  NetWinder and other stuff (there's some fairly fundamental differences in
+  the way the mixer needs to be handled for the NetWinder.)
+
+  (Issues with forward-porting 2.4 bugfixes.)
+  (Killing off OSS is 2.7 material)
+
+PRI2
+
+arch/i386/
+~~~~~~~~~~
+
+o Also PC9800 merge needs finishing to the point we want for 2.6 (not all).
+
+  PRI3
+
+o davej: PAT support (for mtrr exhaustion w/ AGP)
+
+  PRI2
+
+o 2.5.x won't boot on some 440GX
+
+  alan: Problem understood now, feasible fix in 2.4/2.4-ac.  (440GX has two
+  IRQ routers, we use the $PIR table with the PIIX, but the 440GX doesnt use
+  the PIIX for its IRQ routing).  Fall back to BIOS for 440GX works and Intel
+  concurs.
+
+  PRI1
+
+o 2.5.x doesn't handle VIA APIC right yet.
+
+  1. We must write the PCI_INTERRUPT_LINE
+
+  2. We have quirk handlers that seem to trash it.
+
+  PRI1
+
+o ECC driver questions are not yet sorted (DaveJ is working on this) (Dan
+  Hollis)
+
+  alan: ECC - I have some test bits from Dan's stuff - they need no kernel
+  core changes for most platforms.  That means we can treat it as a random
+  driver merge.
+
+  PRI3
+
+o alan: 2.4 has some fixes for tsc handling bugs.  One where some bioses in
+  SMM mode mess up our toggle on the time high/low or mangle the counter and
+  one where a few chips need religious use of _p for timer access and we
+  don't do that.  This is forward porting little bits of fixup.
+
+  ACPI HZ stuff we can't trap - a lot of ACPI is implemented as outb's
+  triggering SMM traps
+
+  PRI1
+
+arch/x86_64/
+~~~~~~~~~~~~
+
+  (Andi)
+
+o time handling is broken. Need to move up 2.4 time.c code.
+
+  PRI1
+
+o NMI watchdog seems to tick too fast
+
+  PRI2
+
+o need to coredump 64bit vsyscall code with dwarf2
+
+  PRI2
+
+o move 64bit signal trampolines into vsyscall code and add dwarf2 for it.
+  (in progress)
+
+  PRI1
+
+o describe kernel assembly with dwarf2 annotations for kgdb
+
+  PRI3
+
+arch/alpha/
+~~~~~~~~~~~
+
+o rth: Ptrace writes are broken.  This means we can't (reliably) set
+  breakpoints or modify variables from gdb.
+
+  PRI1
+
+arch/arm/
+~~~~~~~~~
+
+o rmk: missing raw keyboard translation tables for all ARM machines.
+  Haven't even looked into this at all.  This could be messy since there
+  isn't an ARM architecture standard.  I'm presently hoping that it won't be
+  an issue.  If it does, I guess we'll see drivers/char/keyboard.c explode.
+
+  PRI2
+
+arch/others/
+~~~~~~~~~~~~
+
+o SH needs resyncing, as do some other ports. SH64 needs merging.
+  No impact on mainstream platforms hopefully.
+
+  PRI2
+
+arch/s390/
+~~~~~~~~~
+
+o A nastly memory management problem causes random crashes.  These appear
+  to be fixed/hidden by the objrmap patch, more investigation is needed.
+
+  PRI1
+
+drivers/s390/
+~~~~~~~~~~~~~
+
+o Early userspace and 64 bit dev_t will allow the removal of most of
+  dasd_devmap.c and dasd_genhd.c.
+
+  PRI2
+
+o The 3270 console driver needs to be replaced with a working one
+  (prototype is there, needs to be finished).
+
+  PRI2
+
+o Minor interface changes are pending in cio/ when the z990 machines are
+  out.
+
+  PRI2
+
+o Jan Glauber is working on a fix for the timer issues related to running
+  on virtualized CPUs (wall-clock vs.  cpu time).
+
+  PRI1
+
+o a block device driver for ramdisks shared among virtual machines
+
+  PRI3
+
+o driver for crypto hardware
+
+  PRI3
+
+o 'claw' network device driver
+
+  PRI3
+
--- diff/Documentation/sound/alsa/Joystick.txt	1970-01-01 01:00:00.000000000 +0100
+++ source/Documentation/sound/alsa/Joystick.txt	2004-02-09 10:39:52.000000000 +0000
@@ -0,0 +1,87 @@
+Analog Joystick Support on ALSA Drivers
+=======================================
+                          Oct. 14, 2003
+           Takashi Iwai <tiwai@suse.de>
+
+General
+-------
+
+First of all, you need to enable GAMEPORT support on Linux kernel for
+using a joystick with the ALSA driver.  For the details of gameport
+support, refer to Documentation/input/joystick.txt.
+
+The joystick support of ALSA drivers is different between ISA and PCI
+cards.  In the case of ISA (PnP) cards, it's usually handled by the
+independent module (ns558).  Meanwhile, the ALSA PCI drivers have the
+built-in gameport support.  Hence, when the ALSA PCI driver is built
+in the kernel, CONFIG_GAMEPORT must be 'y', too.  Otherwise, the
+gameport support on that card will be (silently) disabled.
+
+Some adapter modules probe the physical connection of the device at
+the load time.  It'd be safer to plug in the joystick device before
+loading the module.
+
+
+PCI Cards
+---------
+
+For PCI cards, the joystick is enabled when the appropriate module
+option is specified.  Some drivers don't need options, and the
+joystick support is always enabled.  In the former ALSA version, there
+was a dynamic control API for the joystick activation.  It was
+changed, however, to the static module options because of the system
+stability and the resource management.
+
+The following PCI drivers support the joystick natively.
+
+    Driver	Module Option	Available Values
+    ---------------------------------------------------------------------------
+    als4000	joystick_port	0 = disable (default), 1 = auto-detect,
+                                manual: any address (e.g. 0x200)
+    au88x0	N/A		N/A
+    azf3328	joystick	0 = disable, 1 = enable, -1 = auto (default)
+    ens1370	joystick	0 = disable (default), 1 = enable
+    ens1371	joystick_port	0 = disable (default), 1 = auto-detect,
+                                manual: 0x200, 0x208, 0x210, 0x218
+    cmipci	joystick	0 = disable (default), 1 = enable
+    cs4281	N/A		N/A
+    cs46xx	N/A		N/A
+    es1938	N/A		N/A
+    es1968	joystick	0 = disable (default), 1 = enable
+    intel8x0(*1)joystick	0 = disable (default), 1 = enable
+    sonicvibes	N/A		N/A
+    trident	N/A		N/A
+    via82xx(*2)	joystick	0 = disable (default), 1 = enable
+    ymfpci	joystick_port	0 = disable (default), 1 = auto-detect,
+                                manual: 0x201, 0x202, 0x204, 0x205(*3)
+    ---------------------------------------------------------------------------
+
+    *1)  not all chips support joystick
+    *2)  VIA686A/B only
+    *3)  With YMF744/754 chips, the port address can be chosen arbitrarily
+
+The following drivers don't support gameport natively, but there are
+additional modules.  Load the corresponding module to add the gameport
+support.
+
+    Driver	Additional Module
+    -----------------------------
+    emu10k1	emu10k1-gp
+    fm801	fm801-gp
+    -----------------------------
+
+Note: the "pcigame" and "cs461x" modules are for the OSS drivers only.
+      These ALSA drivers (cs46xx, trident and au88x0) have the
+      built-in gameport support.
+
+As mentioned above, ALSA PCI drivers have the built-in gameport
+support, so you don't have to load ns558 module.  Just load "joydev"
+and the appropriate adapter module (e.g. "analog").
+
+
+ISA Cards
+---------
+
+ALSA ISA drivers don't have the built-in gameport support.
+Instead, you need to load "ns558" module in addition to "joydev" and
+the adapter module (e.g. "analog").
--- diff/Documentation/video4linux/bttv/Modprobe.conf	1970-01-01 01:00:00.000000000 +0100
+++ source/Documentation/video4linux/bttv/Modprobe.conf	2004-02-09 10:39:52.000000000 +0000
@@ -0,0 +1,11 @@
+# i2c
+alias char-major-89	i2c-dev
+options i2c-core	i2c_debug=1
+options i2c-algo-bit	bit_test=1
+
+# bttv
+alias char-major-81	videodev
+alias char-major-81-0	bttv
+options	bttv		card=2 radio=1
+options	tuner		debug=1
+
--- diff/arch/i386/kernel/entry_trampoline.c	1970-01-01 01:00:00.000000000 +0100
+++ source/arch/i386/kernel/entry_trampoline.c	2004-02-09 10:39:50.000000000 +0000
@@ -0,0 +1,75 @@
+/*
+ * linux/arch/i386/kernel/entry_trampoline.c
+ *
+ * (C) Copyright 2003 Ingo Molnar
+ *
+ * This file contains the needed support code for 4GB userspace
+ */
+
+#include <linux/init.h>
+#include <linux/smp.h>
+#include <linux/mm.h>
+#include <linux/sched.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/highmem.h>
+#include <asm/desc.h>
+#include <asm/atomic_kmap.h>
+
+extern char __entry_tramp_start, __entry_tramp_end, __start___entry_text;
+
+void __init init_entry_mappings(void)
+{
+#ifdef CONFIG_X86_HIGH_ENTRY
+	void *tramp;
+
+	/*
+	 * We need a high IDT and GDT for the 4G/4G split:
+	 */
+	trap_init_virtual_IDT();
+
+	__set_fixmap(FIX_ENTRY_TRAMPOLINE_0, __pa((unsigned long)&__entry_tramp_start), PAGE_KERNEL);
+	__set_fixmap(FIX_ENTRY_TRAMPOLINE_1, __pa((unsigned long)&__entry_tramp_start) + PAGE_SIZE, PAGE_KERNEL);
+	tramp = (void *)fix_to_virt(FIX_ENTRY_TRAMPOLINE_0);
+
+	printk("mapped 4G/4G trampoline to %p.\n", tramp);
+	BUG_ON((void *)&__start___entry_text != tramp);
+	/*
+	 * Virtual kernel stack:
+	 */
+	BUG_ON(__kmap_atomic_vaddr(KM_VSTACK0) & 8191);
+	BUG_ON(sizeof(struct desc_struct)*NR_CPUS*GDT_ENTRIES > 2*PAGE_SIZE);
+	BUG_ON((unsigned int)&__entry_tramp_end - (unsigned int)&__entry_tramp_start > 2*PAGE_SIZE);
+
+	/*
+	 * set up the initial thread's virtual stack related
+	 * fields:
+	 */
+	current->thread.stack_page0 = virt_to_page((char *)current->thread_info);
+	current->thread.stack_page1 = virt_to_page((char *)current->thread_info + PAGE_SIZE);
+	current->thread_info->virtual_stack = (void *)__kmap_atomic_vaddr(KM_VSTACK0);
+
+	__kunmap_atomic_type(KM_VSTACK0);
+	__kunmap_atomic_type(KM_VSTACK1);
+        __kmap_atomic(current->thread.stack_page0, KM_VSTACK0);
+        __kmap_atomic(current->thread.stack_page1, KM_VSTACK1);
+
+#endif
+	printk("current: %p\n", current);
+	printk("current->thread_info: %p\n", current->thread_info);
+	current->thread_info->real_stack = (void *)current->thread_info;
+	current->thread_info->user_pgd = NULL;
+	current->thread.esp0 = (unsigned long)current->thread_info->real_stack + THREAD_SIZE;
+}
+
+
+
+void __init entry_trampoline_setup(void)
+{
+	/*
+	 * old IRQ entries set up by the boot code will still hang
+	 * around - they are a sign of hw trouble anyway, now they'll
+	 * produce a double fault message.
+	 */
+	trap_init_virtual_GDT();
+}
--- diff/arch/i386/kernel/kgdb_stub.c	1970-01-01 01:00:00.000000000 +0100
+++ source/arch/i386/kernel/kgdb_stub.c	2004-02-09 10:39:50.000000000 +0000
@@ -0,0 +1,2457 @@
+/*
+ *
+ * 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.
+ *
+ */
+
+/*
+ * Copyright (c) 2000 VERITAS Software Corporation.
+ *
+ */
+/****************************************************************************
+ *  Header: remcom.c,v 1.34 91/03/09 12:29:49 glenne Exp $
+ *
+ *  Module name: remcom.c $
+ *  Revision: 1.34 $
+ *  Date: 91/03/09 12:29:49 $
+ *  Contributor:     Lake Stevens Instrument Division$
+ *
+ *  Description:     low level support for gdb debugger. $
+ *
+ *  Considerations:  only works on target hardware $
+ *
+ *  Written by:	     Glenn Engel $
+ *  Updated by:	     David Grothe <dave@gcom.com>
+ *  Updated by:	     Robert Walsh <rjwalsh@durables.org>
+ *  Updated by:	     wangdi <wangdi@clusterfs.com>
+ *  ModuleState:     Experimental $
+ *
+ *  NOTES:	     See Below $
+ *
+ *  Modified for 386 by Jim Kingdon, Cygnus Support.
+ *  Compatibility with 2.1.xx kernel by David Grothe <dave@gcom.com>
+ *
+ *  Changes to allow auto initilization.  All that is needed is that it
+ *  be linked with the kernel and a break point (int 3) be executed.
+ *  The header file <asm/kgdb.h> defines BREAKPOINT to allow one to do
+ *  this. It should also be possible, once the interrupt system is up, to
+ *  call putDebugChar("+").  Once this is done, the remote debugger should
+ *  get our attention by sending a ^C in a packet. George Anzinger
+ *  <george@mvista.com>
+ *  Integrated into 2.2.5 kernel by Tigran Aivazian <tigran@sco.com>
+ *  Added thread support, support for multiple processors,
+ *	support for ia-32(x86) hardware debugging.
+ *	Amit S. Kale ( akale@veritas.com )
+ *
+ *  Modified to support debugging over ethernet by Robert Walsh
+ *  <rjwalsh@durables.org> and wangdi <wangdi@clusterfs.com>, based on
+ *  code by San Mehat.
+ *
+ *
+ *  To enable debugger support, two things need to happen.  One, a
+ *  call to set_debug_traps() is necessary in order to allow any breakpoints
+ *  or error conditions to be properly intercepted and reported to gdb.
+ *  Two, a breakpoint needs to be generated to begin communication.  This
+ *  is most easily accomplished by a call to breakpoint().  Breakpoint()
+ *  simulates a breakpoint by executing an int 3.
+ *
+ *************
+ *
+ *    The following gdb commands are supported:
+ *
+ * command	    function				   Return value
+ *
+ *    g		    return the value of the CPU registers  hex data or ENN
+ *    G		    set the value of the CPU registers	   OK or ENN
+ *
+ *    mAA..AA,LLLL  Read LLLL bytes at address AA..AA	   hex data or ENN
+ *    MAA..AA,LLLL: Write LLLL bytes at address AA.AA	   OK or ENN
+ *
+ *    c		    Resume at current address		   SNN	 ( signal NN)
+ *    cAA..AA	    Continue at address AA..AA		   SNN
+ *
+ *    s		    Step one instruction		   SNN
+ *    sAA..AA	    Step one instruction from AA..AA	   SNN
+ *
+ *    k		    kill
+ *
+ *    ?		    What was the last sigval ?		   SNN	 (signal NN)
+ *
+ * All commands and responses are sent with a packet which includes a
+ * checksum.  A packet consists of
+ *
+ * $<packet info>#<checksum>.
+ *
+ * where
+ * <packet info> :: <characters representing the command or response>
+ * <checksum>	 :: < two hex digits computed as modulo 256 sum of <packetinfo>>
+ *
+ * When a packet is received, it is first acknowledged with either '+' or '-'.
+ * '+' indicates a successful transfer.	 '-' indicates a failed transfer.
+ *
+ * Example:
+ *
+ * Host:		  Reply:
+ * $m0,10#2a		   +$00010203040506070809101112131415#42
+ *
+ ****************************************************************************/
+#define KGDB_VERSION "<20030915.1651.33>"
+#include <linux/config.h>
+#include <linux/types.h>
+#include <asm/string.h>		/* for strcpy */
+#include <linux/kernel.h>
+#include <linux/sched.h>
+#include <asm/vm86.h>
+#include <asm/system.h>
+#include <asm/ptrace.h>		/* for linux pt_regs struct */
+#include <asm/kgdb_local.h>
+#include <linux/list.h>
+#include <asm/atomic.h>
+#include <asm/processor.h>
+#include <linux/irq.h>
+#include <asm/desc.h>
+#include <linux/inet.h>
+#include <linux/netpoll.h>
+
+/************************************************************************
+ *
+ * external low-level support routines
+ */
+typedef void (*Function) (void);	/* pointer to a function */
+
+/* Thread reference */
+typedef unsigned char threadref[8];
+
+extern int tty_putDebugChar(int);     /* write a single character      */
+extern int tty_getDebugChar(void);    /* read and return a single char */
+extern void tty_flushDebugChar(void); /* flush pending characters      */
+extern int eth_putDebugChar(int);     /* write a single character      */
+extern int eth_getDebugChar(void);    /* read and return a single char */
+extern void eth_flushDebugChar(void); /* flush pending characters      */
+
+/************************************************************************/
+/* BUFMAX defines the maximum number of characters in inbound/outbound buffers*/
+/* at least NUMREGBYTES*2 are needed for register packets */
+/* Longer buffer is needed to list all threads */
+#define BUFMAX 400
+
+char *kgdb_version = KGDB_VERSION;
+
+/*  debug >  0 prints ill-formed commands in valid packets & checksum errors */
+int debug_regs = 0;		/* set to non-zero to print registers */
+
+/* filled in by an external module */
+char *gdb_module_offsets;
+
+static const char hexchars[] = "0123456789abcdef";
+
+/* Number of bytes of registers.  */
+#define NUMREGBYTES 64
+/*
+ * Note that this register image is in a different order than
+ * the register image that Linux produces at interrupt time.
+ *
+ * Linux's register image is defined by struct pt_regs in ptrace.h.
+ * Just why GDB uses a different order is a historical mystery.
+ */
+enum regnames { _EAX,		/* 0 */
+	_ECX,			/* 1 */
+	_EDX,			/* 2 */
+	_EBX,			/* 3 */
+	_ESP,			/* 4 */
+	_EBP,			/* 5 */
+	_ESI,			/* 6 */
+	_EDI,			/* 7 */
+	_PC /* 8 also known as eip */ ,
+	_PS /* 9 also known as eflags */ ,
+	_CS,			/* 10 */
+	_SS,			/* 11 */
+	_DS,			/* 12 */
+	_ES,			/* 13 */
+	_FS,			/* 14 */
+	_GS			/* 15 */
+};
+
+/***************************  ASSEMBLY CODE MACROS *************************/
+/*
+ * Put the error code here just in case the user cares.
+ * Likewise, the vector number here (since GDB only gets the signal
+ * number through the usual means, and that's not very specific).
+ * The called_from is the return address so he can tell how we entered kgdb.
+ * This will allow him to seperate out the various possible entries.
+ */
+#define REMOTE_DEBUG 0		/* set != to turn on printing (also available in info) */
+
+#define PID_MAX PID_MAX_DEFAULT
+
+#ifdef CONFIG_SMP
+void smp_send_nmi_allbutself(void);
+#define IF_SMP(x) x
+#undef MAX_NO_CPUS
+#ifndef CONFIG_NO_KGDB_CPUS
+#define CONFIG_NO_KGDB_CPUS 2
+#endif
+#if CONFIG_NO_KGDB_CPUS > NR_CPUS
+#define MAX_NO_CPUS NR_CPUS
+#else
+#define MAX_NO_CPUS CONFIG_NO_KGDB_CPUS
+#endif
+#define hold_init hold_on_sstep: 1,
+#define MAX_CPU_MASK (unsigned long)((1LL << MAX_NO_CPUS) - 1LL)
+#define NUM_CPUS num_online_cpus()
+#else
+#define IF_SMP(x)
+#define hold_init
+#undef MAX_NO_CPUS
+#define MAX_NO_CPUS 1
+#define NUM_CPUS 1
+#endif
+#define NOCPU (struct task_struct *)0xbad1fbad
+/* *INDENT-OFF*	 */
+struct kgdb_info {
+	int used_malloc;
+	void *called_from;
+	long long entry_tsc;
+	int errcode;
+	int vector;
+	int print_debug_info;
+#ifdef CONFIG_SMP
+	int hold_on_sstep;
+	struct {
+		volatile struct task_struct *task;
+		int pid;
+		int hold;
+		struct pt_regs *regs;
+	} cpus_waiting[MAX_NO_CPUS];
+#endif
+} kgdb_info = {hold_init print_debug_info:REMOTE_DEBUG, vector:-1};
+
+/* *INDENT-ON*	*/
+
+#define used_m kgdb_info.used_malloc
+/*
+ * This is little area we set aside to contain the stack we
+ * need to build to allow gdb to call functions.  We use one
+ * per cpu to avoid locking issues.  We will do all this work
+ * with interrupts off so that should take care of the protection
+ * issues.
+ */
+#define LOOKASIDE_SIZE 200	/* should be more than enough */
+#define MALLOC_MAX   200	/* Max malloc size */
+struct {
+	unsigned int esp;
+	int array[LOOKASIDE_SIZE];
+} fn_call_lookaside[MAX_NO_CPUS];
+
+static int trap_cpu;
+static unsigned int OLD_esp;
+
+#define END_OF_LOOKASIDE  &fn_call_lookaside[trap_cpu].array[LOOKASIDE_SIZE]
+#define IF_BIT 0x200
+#define TF_BIT 0x100
+
+#define MALLOC_ROUND 8-1
+
+static char malloc_array[MALLOC_MAX];
+IF_SMP(static void to_gdb(const char *mess));
+void *
+malloc(int size)
+{
+
+	if (size <= (MALLOC_MAX - used_m)) {
+		int old_used = used_m;
+		used_m += ((size + MALLOC_ROUND) & (~MALLOC_ROUND));
+		return &malloc_array[old_used];
+	} else {
+		return NULL;
+	}
+}
+
+/*
+ * I/O dispatch functions...
+ * Based upon kgdboe, either call the ethernet
+ * handler or the serial one..
+ */
+void
+putDebugChar(int c)
+{
+	if (!kgdboe) {
+		tty_putDebugChar(c);
+	} else {
+		eth_putDebugChar(c);
+	}
+}
+
+int
+getDebugChar(void)
+{
+	if (!kgdboe) {
+		return tty_getDebugChar();
+	} else {
+		return eth_getDebugChar();
+	}
+}
+
+void
+flushDebugChar(void)
+{
+	if (!kgdboe) {
+		tty_flushDebugChar();
+	} else {
+		eth_flushDebugChar();
+	}
+}
+
+/*
+ * Gdb calls functions by pushing agruments, including a return address
+ * on the stack and the adjusting EIP to point to the function.	 The
+ * whole assumption in GDB is that we are on a different stack than the
+ * one the "user" i.e. code that hit the break point, is on.  This, of
+ * course is not true in the kernel.  Thus various dodges are needed to
+ * do the call without directly messing with EIP (which we can not change
+ * as it is just a location and not a register.	 To adjust it would then
+ * require that we move every thing below EIP up or down as needed.  This
+ * will not work as we may well have stack relative pointer on the stack
+ * (such as the pointer to regs, for example).
+
+ * So here is what we do:
+ * We detect gdb attempting to store into the stack area and instead, store
+ * into the fn_call_lookaside.array at the same relative location as if it
+ * were the area ESP pointed at.  We also trap ESP modifications
+ * and uses these to adjust fn_call_lookaside.esp.  On entry
+ * fn_call_lookaside.esp will be set to point at the last entry in
+ * fn_call_lookaside.array.  This allows us to check if it has changed, and
+ * if so, on exit, we add the registers we will use to do the move and a
+ * trap/ interrupt return exit sequence.  We then adjust the eflags in the
+ * regs array (remember we now have a copy in the fn_call_lookaside.array) to
+ * kill the interrupt bit, AND we change EIP to point at our set up stub.
+ * As part of the register set up we preset the registers to point at the
+ * begining and end of the fn_call_lookaside.array, so all the stub needs to
+ * do is move words from the array to the stack until ESP= the desired value
+ * then do the rti.  This will then transfer to the desired function with
+ * all the correct registers.  Nifty huh?
+ */
+extern asmlinkage void fn_call_stub(void);
+extern asmlinkage void fn_rtn_stub(void);
+/*					   *INDENT-OFF*	 */
+__asm__("fn_rtn_stub:\n\t"
+	"movl %eax,%esp\n\t"
+	"fn_call_stub:\n\t"
+	"1:\n\t"
+	"addl $-4,%ebx\n\t"
+	"movl (%ebx), %eax\n\t"
+	"pushl %eax\n\t"
+	"cmpl %esp,%ecx\n\t"
+	"jne  1b\n\t"
+	"popl %eax\n\t"
+	"popl %ebx\n\t"
+	"popl %ecx\n\t"
+	"iret \n\t");
+/*					     *INDENT-ON*  */
+#define gdb_i386vector	kgdb_info.vector
+#define gdb_i386errcode kgdb_info.errcode
+#define waiting_cpus	kgdb_info.cpus_waiting
+#define remote_debug	kgdb_info.print_debug_info
+#define hold_cpu(cpu)	kgdb_info.cpus_waiting[cpu].hold
+/* gdb locks */
+
+#ifdef CONFIG_SMP
+static int in_kgdb_called;
+static spinlock_t waitlocks[MAX_NO_CPUS] =
+    {[0 ... MAX_NO_CPUS - 1] = SPIN_LOCK_UNLOCKED };
+/*
+ * The following array has the thread pointer of each of the "other"
+ * cpus.  We make it global so it can be seen by gdb.
+ */
+volatile int in_kgdb_entry_log[MAX_NO_CPUS];
+volatile struct pt_regs *in_kgdb_here_log[MAX_NO_CPUS];
+/*
+static spinlock_t continuelocks[MAX_NO_CPUS];
+*/
+spinlock_t kgdb_spinlock = SPIN_LOCK_UNLOCKED;
+/* waiters on our spinlock plus us */
+static atomic_t spinlock_waiters = ATOMIC_INIT(1);
+static int spinlock_count = 0;
+static int spinlock_cpu = 0;
+/*
+ * Note we use nested spin locks to account for the case where a break
+ * point is encountered when calling a function by user direction from
+ * kgdb. Also there is the memory exception recursion to account for.
+ * Well, yes, but this lets other cpus thru too.  Lets add a
+ * cpu id to the lock.
+ */
+#define KGDB_SPIN_LOCK(x) if( spinlock_count == 0 || \
+			      spinlock_cpu != smp_processor_id()){\
+				      atomic_inc(&spinlock_waiters); \
+				      while (! spin_trylock(x)) {\
+					    in_kgdb(&regs);\
+				      }\
+				      atomic_dec(&spinlock_waiters); \
+				      spinlock_count = 1; \
+				      spinlock_cpu = smp_processor_id(); \
+			  }else{  \
+				      spinlock_count++; \
+			  }
+#define KGDB_SPIN_UNLOCK(x) if( --spinlock_count == 0) spin_unlock(x)
+#else
+unsigned kgdb_spinlock = 0;
+#define KGDB_SPIN_LOCK(x) --*x
+#define KGDB_SPIN_UNLOCK(x) ++*x
+#endif
+
+int
+hex(char ch)
+{
+	if ((ch >= 'a') && (ch <= 'f'))
+		return (ch - 'a' + 10);
+	if ((ch >= '0') && (ch <= '9'))
+		return (ch - '0');
+	if ((ch >= 'A') && (ch <= 'F'))
+		return (ch - 'A' + 10);
+	return (-1);
+}
+
+/* scan for the sequence $<data>#<checksum>	*/
+void
+getpacket(char *buffer)
+{
+	unsigned char checksum;
+	unsigned char xmitcsum;
+	int i;
+	int count;
+	char ch;
+
+	do {
+		/* wait around for the start character, ignore all other characters */
+		while ((ch = (getDebugChar() & 0x7f)) != '$') ;
+		checksum = 0;
+		xmitcsum = -1;
+
+		count = 0;
+
+		/* now, read until a # or end of buffer is found */
+		while (count < BUFMAX) {
+			ch = getDebugChar() & 0x7f;
+			if (ch == '#')
+				break;
+			checksum = checksum + ch;
+			buffer[count] = ch;
+			count = count + 1;
+		}
+		buffer[count] = 0;
+
+		if (ch == '#') {
+			xmitcsum = hex(getDebugChar() & 0x7f) << 4;
+			xmitcsum += hex(getDebugChar() & 0x7f);
+			if ((remote_debug) && (checksum != xmitcsum)) {
+				printk
+				    ("bad checksum.	My count = 0x%x, sent=0x%x. buf=%s\n",
+				     checksum, xmitcsum, buffer);
+			}
+
+			if (checksum != xmitcsum)
+				putDebugChar('-');	/* failed checksum */
+			else {
+				putDebugChar('+');	/* successful transfer */
+				/* if a sequence char is present, reply the sequence ID */
+				if (buffer[2] == ':') {
+					putDebugChar(buffer[0]);
+					putDebugChar(buffer[1]);
+					/* remove sequence chars from buffer */
+					count = strlen(buffer);
+					for (i = 3; i <= count; i++)
+						buffer[i - 3] = buffer[i];
+				}
+			}
+		}
+	} while (checksum != xmitcsum);
+
+	if (remote_debug)
+		printk("R:%s\n", buffer);
+	flushDebugChar();
+}
+
+/* send the packet in buffer.  */
+
+void
+putpacket(char *buffer)
+{
+	unsigned char checksum;
+	int count;
+	char ch;
+
+	/*  $<packet info>#<checksum>. */
+
+	if (!kgdboe) {
+		do {
+			if (remote_debug)
+				printk("T:%s\n", buffer);
+			putDebugChar('$');
+			checksum = 0;
+			count = 0;
+
+			while ((ch = buffer[count])) {
+				putDebugChar(ch);
+				checksum += ch;
+				count += 1;
+			}
+
+			putDebugChar('#');
+			putDebugChar(hexchars[checksum >> 4]);
+			putDebugChar(hexchars[checksum % 16]);
+			flushDebugChar();
+
+		} while ((getDebugChar() & 0x7f) != '+');
+	} else {
+		/*
+		 * For udp, we can not transfer too much bytes once.
+		 * We only transfer MAX_SEND_COUNT size bytes each time
+		 */
+
+#define MAX_SEND_COUNT 30
+
+		int send_count = 0, i = 0;
+		char send_buf[MAX_SEND_COUNT];
+
+		do {
+			if (remote_debug)
+				printk("T:%s\n", buffer);
+			putDebugChar('$');
+			checksum = 0;
+			count = 0;
+			send_count = 0;
+			while ((ch = buffer[count])) {
+				if (send_count >= MAX_SEND_COUNT) {
+					for(i = 0; i < MAX_SEND_COUNT; i++) {
+						putDebugChar(send_buf[i]);
+					}
+					flushDebugChar();
+					send_count = 0;
+				} else {
+					send_buf[send_count] = ch;
+					checksum += ch;
+					count ++;
+					send_count++;
+				}
+			}
+			for(i = 0; i < send_count; i++)
+				putDebugChar(send_buf[i]);
+			putDebugChar('#');
+			putDebugChar(hexchars[checksum >> 4]);
+			putDebugChar(hexchars[checksum % 16]);
+			flushDebugChar();
+		} while ((getDebugChar() & 0x7f) != '+');
+	}
+}
+
+static char remcomInBuffer[BUFMAX];
+static char remcomOutBuffer[BUFMAX];
+static short error;
+
+void
+debug_error(char *format, char *parm)
+{
+	if (remote_debug)
+		printk(format, parm);
+}
+
+static void
+print_regs(struct pt_regs *regs)
+{
+	printk("EAX=%08lx ", regs->eax);
+	printk("EBX=%08lx ", regs->ebx);
+	printk("ECX=%08lx ", regs->ecx);
+	printk("EDX=%08lx ", regs->edx);
+	printk("\n");
+	printk("ESI=%08lx ", regs->esi);
+	printk("EDI=%08lx ", regs->edi);
+	printk("EBP=%08lx ", regs->ebp);
+	printk("ESP=%08lx ", (long) &regs->esp);
+	printk("\n");
+	printk(" DS=%08x ", regs->xds);
+	printk(" ES=%08x ", regs->xes);
+	printk(" SS=%08x ", __KERNEL_DS);
+	printk(" FL=%08lx ", regs->eflags);
+	printk("\n");
+	printk(" CS=%08x ", regs->xcs);
+	printk(" IP=%08lx ", regs->eip);
+#if 0
+	printk(" FS=%08x ", regs->fs);
+	printk(" GS=%08x ", regs->gs);
+#endif
+	printk("\n");
+
+}				/* print_regs */
+
+#define NEW_esp fn_call_lookaside[trap_cpu].esp
+
+static void
+regs_to_gdb_regs(int *gdb_regs, struct pt_regs *regs)
+{
+	gdb_regs[_EAX] = regs->eax;
+	gdb_regs[_EBX] = regs->ebx;
+	gdb_regs[_ECX] = regs->ecx;
+	gdb_regs[_EDX] = regs->edx;
+	gdb_regs[_ESI] = regs->esi;
+	gdb_regs[_EDI] = regs->edi;
+	gdb_regs[_EBP] = regs->ebp;
+	gdb_regs[_DS] = regs->xds;
+	gdb_regs[_ES] = regs->xes;
+	gdb_regs[_PS] = regs->eflags;
+	gdb_regs[_CS] = regs->xcs;
+	gdb_regs[_PC] = regs->eip;
+	/* Note, as we are a debugging the kernel, we will always
+	 * trap in kernel code, this means no priviledge change,
+	 * and so the pt_regs structure is not completely valid.  In a non
+	 * privilege change trap, only EFLAGS, CS and EIP are put on the stack,
+	 * SS and ESP are not stacked, this means that the last 2 elements of
+	 * pt_regs is not valid (they would normally refer to the user stack)
+	 * also, using regs+1 is no good because you end up will a value that is
+	 * 2 longs (8) too high.  This used to cause stepping over functions
+	 * to fail, so my fix is to use the address of regs->esp, which
+	 * should point at the end of the stack frame.	Note I have ignored
+	 * completely exceptions that cause an error code to be stacked, such
+	 * as double fault.  Stuart Hughes, Zentropix.
+	 * original code: gdb_regs[_ESP] =  (int) (regs + 1) ;
+
+	 * this is now done on entry and moved to OLD_esp (as well as NEW_esp).
+	 */
+	gdb_regs[_ESP] = NEW_esp;
+	gdb_regs[_SS] = __KERNEL_DS;
+	gdb_regs[_FS] = 0xFFFF;
+	gdb_regs[_GS] = 0xFFFF;
+}				/* regs_to_gdb_regs */
+
+static void
+gdb_regs_to_regs(int *gdb_regs, struct pt_regs *regs)
+{
+	regs->eax = gdb_regs[_EAX];
+	regs->ebx = gdb_regs[_EBX];
+	regs->ecx = gdb_regs[_ECX];
+	regs->edx = gdb_regs[_EDX];
+	regs->esi = gdb_regs[_ESI];
+	regs->edi = gdb_regs[_EDI];
+	regs->ebp = gdb_regs[_EBP];
+	regs->xds = gdb_regs[_DS];
+	regs->xes = gdb_regs[_ES];
+	regs->eflags = gdb_regs[_PS];
+	regs->xcs = gdb_regs[_CS];
+	regs->eip = gdb_regs[_PC];
+	NEW_esp = gdb_regs[_ESP];	/* keep the value */
+#if 0				/* can't change these */
+	regs->esp = gdb_regs[_ESP];
+	regs->xss = gdb_regs[_SS];
+	regs->fs = gdb_regs[_FS];
+	regs->gs = gdb_regs[_GS];
+#endif
+
+}				/* gdb_regs_to_regs */
+extern void scheduling_functions_start_here(void);
+extern void scheduling_functions_end_here(void);
+#define first_sched	((unsigned long) scheduling_functions_start_here)
+#define last_sched	((unsigned long) scheduling_functions_end_here)
+
+int thread_list = 0;
+
+void
+get_gdb_regs(struct task_struct *p, struct pt_regs *regs, int *gdb_regs)
+{
+	unsigned long stack_page;
+	int count = 0;
+	IF_SMP(int i);
+	if (!p || p == current) {
+		regs_to_gdb_regs(gdb_regs, regs);
+		return;
+	}
+#ifdef CONFIG_SMP
+	for (i = 0; i < MAX_NO_CPUS; i++) {
+		if (p == kgdb_info.cpus_waiting[i].task) {
+			regs_to_gdb_regs(gdb_regs,
+					 kgdb_info.cpus_waiting[i].regs);
+			gdb_regs[_ESP] =
+			    (int) &kgdb_info.cpus_waiting[i].regs->esp;
+
+			return;
+		}
+	}
+#endif
+	memset(gdb_regs, 0, NUMREGBYTES);
+	gdb_regs[_ESP] = p->thread.esp;
+	gdb_regs[_PC] = p->thread.eip;
+	gdb_regs[_EBP] = *(int *) gdb_regs[_ESP];
+	gdb_regs[_EDI] = *(int *) (gdb_regs[_ESP] + 4);
+	gdb_regs[_ESI] = *(int *) (gdb_regs[_ESP] + 8);
+
+/*
+ * This code is to give a more informative notion of where a process
+ * is waiting.	It is used only when the user asks for a thread info
+ * list.  If he then switches to the thread, s/he will find the task
+ * is in schedule, but a back trace should show the same info we come
+ * up with.  This code was shamelessly purloined from process.c.  It was
+ * then enhanced to provide more registers than simply the program
+ * counter.
+ */
+
+	if (!thread_list) {
+		return;
+	}
+
+	if (p->state == TASK_RUNNING)
+		return;
+	stack_page = (unsigned long) p->thread_info;
+	if (gdb_regs[_ESP] < stack_page || gdb_regs[_ESP] > 8188 + stack_page)
+		return;
+	/* include/asm-i386/system.h:switch_to() pushes ebp last. */
+	do {
+		if (gdb_regs[_EBP] < stack_page ||
+		    gdb_regs[_EBP] > 8184 + stack_page)
+			return;
+		gdb_regs[_PC] = *(unsigned long *) (gdb_regs[_EBP] + 4);
+		gdb_regs[_ESP] = gdb_regs[_EBP] + 8;
+		gdb_regs[_EBP] = *(unsigned long *) gdb_regs[_EBP];
+		if (gdb_regs[_PC] < first_sched || gdb_regs[_PC] >= last_sched)
+			return;
+	} while (count++ < 16);
+	return;
+}
+
+/* Indicate to caller of mem2hex or hex2mem that there has been an
+   error.  */
+static volatile int mem_err = 0;
+static volatile int mem_err_expected = 0;
+static volatile int mem_err_cnt = 0;
+static int garbage_loc = -1;
+
+int
+get_char(char *addr)
+{
+	return *addr;
+}
+
+void
+set_char(char *addr, int val, int may_fault)
+{
+	/*
+	 * This code traps references to the area mapped to the kernel
+	 * stack as given by the regs and, instead, stores to the
+	 * fn_call_lookaside[cpu].array
+	 */
+	if (may_fault &&
+	    (unsigned int) addr < OLD_esp &&
+	    ((unsigned int) addr > (OLD_esp - (unsigned int) LOOKASIDE_SIZE))) {
+		addr = (char *) END_OF_LOOKASIDE - ((char *) OLD_esp - addr);
+	}
+	*addr = val;
+}
+
+/* convert the memory pointed to by mem into hex, placing result in buf */
+/* return a pointer to the last char put in buf (null) */
+/* If MAY_FAULT is non-zero, then we should set mem_err in response to
+   a fault; if zero treat a fault like any other fault in the stub.  */
+char *
+mem2hex(char *mem, char *buf, int count, int may_fault)
+{
+	int i;
+	unsigned char ch;
+
+	if (may_fault) {
+		mem_err_expected = 1;
+		mem_err = 0;
+	}
+	for (i = 0; i < count; i++) {
+		/* printk("%lx = ", mem) ; */
+
+		ch = get_char(mem++);
+
+		/* printk("%02x\n", ch & 0xFF) ; */
+		if (may_fault && mem_err) {
+			if (remote_debug)
+				printk("Mem fault fetching from addr %lx\n",
+				       (long) (mem - 1));
+			*buf = 0;	/* truncate buffer */
+			return (buf);
+		}
+		*buf++ = hexchars[ch >> 4];
+		*buf++ = hexchars[ch % 16];
+	}
+	*buf = 0;
+	if (may_fault)
+		mem_err_expected = 0;
+	return (buf);
+}
+
+/* convert the hex array pointed to by buf into binary to be placed in mem */
+/* return a pointer to the character AFTER the last byte written */
+/* NOTE: We use the may fault flag to also indicate if the write is to
+ * the registers (0) or "other" memory (!=0)
+ */
+char *
+hex2mem(char *buf, char *mem, int count, int may_fault)
+{
+	int i;
+	unsigned char ch;
+
+	if (may_fault) {
+		mem_err_expected = 1;
+		mem_err = 0;
+	}
+	for (i = 0; i < count; i++) {
+		ch = hex(*buf++) << 4;
+		ch = ch + hex(*buf++);
+		set_char(mem++, ch, may_fault);
+
+		if (may_fault && mem_err) {
+			if (remote_debug)
+				printk("Mem fault storing to addr %lx\n",
+				       (long) (mem - 1));
+			return (mem);
+		}
+	}
+	if (may_fault)
+		mem_err_expected = 0;
+	return (mem);
+}
+
+/**********************************************/
+/* WHILE WE FIND NICE HEX CHARS, BUILD AN INT */
+/* RETURN NUMBER OF CHARS PROCESSED	      */
+/**********************************************/
+int
+hexToInt(char **ptr, int *intValue)
+{
+	int numChars = 0;
+	int hexValue;
+
+	*intValue = 0;
+
+	while (**ptr) {
+		hexValue = hex(**ptr);
+		if (hexValue >= 0) {
+			*intValue = (*intValue << 4) | hexValue;
+			numChars++;
+		} else
+			break;
+
+		(*ptr)++;
+	}
+
+	return (numChars);
+}
+
+#define stubhex(h) hex(h)
+#ifdef old_thread_list
+
+static int
+stub_unpack_int(char *buff, int fieldlength)
+{
+	int nibble;
+	int retval = 0;
+
+	while (fieldlength) {
+		nibble = stubhex(*buff++);
+		retval |= nibble;
+		fieldlength--;
+		if (fieldlength)
+			retval = retval << 4;
+	}
+	return retval;
+}
+#endif
+static char *
+pack_hex_byte(char *pkt, int byte)
+{
+	*pkt++ = hexchars[(byte >> 4) & 0xf];
+	*pkt++ = hexchars[(byte & 0xf)];
+	return pkt;
+}
+
+#define BUF_THREAD_ID_SIZE 16
+
+static char *
+pack_threadid(char *pkt, threadref * id)
+{
+	char *limit;
+	unsigned char *altid;
+
+	altid = (unsigned char *) id;
+	limit = pkt + BUF_THREAD_ID_SIZE;
+	while (pkt < limit)
+		pkt = pack_hex_byte(pkt, *altid++);
+	return pkt;
+}
+
+#ifdef old_thread_list
+static char *
+unpack_byte(char *buf, int *value)
+{
+	*value = stub_unpack_int(buf, 2);
+	return buf + 2;
+}
+
+static char *
+unpack_threadid(char *inbuf, threadref * id)
+{
+	char *altref;
+	char *limit = inbuf + BUF_THREAD_ID_SIZE;
+	int x, y;
+
+	altref = (char *) id;
+
+	while (inbuf < limit) {
+		x = stubhex(*inbuf++);
+		y = stubhex(*inbuf++);
+		*altref++ = (x << 4) | y;
+	}
+	return inbuf;
+}
+#endif
+void
+int_to_threadref(threadref * id, int value)
+{
+	unsigned char *scan;
+
+	scan = (unsigned char *) id;
+	{
+		int i = 4;
+		while (i--)
+			*scan++ = 0;
+	}
+	*scan++ = (value >> 24) & 0xff;
+	*scan++ = (value >> 16) & 0xff;
+	*scan++ = (value >> 8) & 0xff;
+	*scan++ = (value & 0xff);
+}
+int
+int_to_hex_v(unsigned char * id, int value)
+{
+	unsigned char *start = id;
+	int shift;
+	int ch;
+
+	for (shift = 28; shift >= 0; shift -= 4) {
+		if ((ch = (value >> shift) & 0xf) || (id != start)) {
+			*id = hexchars[ch];
+			id++;
+		}
+	}
+	if (id == start)
+		*id++ = '0';
+	return id - start;
+}
+#ifdef old_thread_list
+
+static int
+threadref_to_int(threadref * ref)
+{
+	int i, value = 0;
+	unsigned char *scan;
+
+	scan = (char *) ref;
+	scan += 4;
+	i = 4;
+	while (i-- > 0)
+		value = (value << 8) | ((*scan++) & 0xff);
+	return value;
+}
+#endif
+static int
+cmp_str(char *s1, char *s2, int count)
+{
+	while (count--) {
+		if (*s1++ != *s2++)
+			return 0;
+	}
+	return 1;
+}
+
+#if 1				/* this is a hold over from 2.4 where O(1) was "sometimes" */
+extern struct task_struct *kgdb_get_idle(int cpu);
+#define idle_task(cpu) kgdb_get_idle(cpu)
+#else
+#define idle_task(cpu) init_tasks[cpu]
+#endif
+
+extern int kgdb_pid_init_done;
+
+struct task_struct *
+getthread(int pid)
+{
+	struct task_struct *thread;
+	if (pid >= PID_MAX && pid <= (PID_MAX + MAX_NO_CPUS)) {
+
+		return idle_task(pid - PID_MAX);
+	} else {
+		/*
+		 * find_task_by_pid is relatively safe all the time
+		 * Other pid functions require lock downs which imply
+		 * that we may be interrupting them (as we get here
+		 * in the middle of most any lock down).
+		 * Still we don't want to call until the table exists!
+		 */
+		if (kgdb_pid_init_done){
+			thread = find_task_by_pid(pid);
+			if (thread) {
+				return thread;
+			}
+		}
+	}
+	return NULL;
+}
+/* *INDENT-OFF*	 */
+struct hw_breakpoint {
+	unsigned enabled;
+	unsigned type;
+	unsigned len;
+	unsigned addr;
+} breakinfo[4] = { {enabled:0},
+		   {enabled:0},
+		   {enabled:0},
+		   {enabled:0}};
+/* *INDENT-ON*	*/
+unsigned hw_breakpoint_status;
+void
+correct_hw_break(void)
+{
+	int breakno;
+	int correctit;
+	int breakbit;
+	unsigned dr7;
+
+	asm volatile ("movl %%db7, %0\n":"=r" (dr7)
+		      :);
+	/* *INDENT-OFF*	 */
+	do {
+		unsigned addr0, addr1, addr2, addr3;
+		asm volatile ("movl %%db0, %0\n"
+			      "movl %%db1, %1\n"
+			      "movl %%db2, %2\n"
+			      "movl %%db3, %3\n"
+			      :"=r" (addr0), "=r"(addr1),
+			      "=r"(addr2), "=r"(addr3)
+			      :);
+	} while (0);
+	/* *INDENT-ON*	*/
+	correctit = 0;
+	for (breakno = 0; breakno < 3; breakno++) {
+		breakbit = 2 << (breakno << 1);
+		if (!(dr7 & breakbit) && breakinfo[breakno].enabled) {
+			correctit = 1;
+			dr7 |= breakbit;
+			dr7 &= ~(0xf0000 << (breakno << 2));
+			dr7 |= (((breakinfo[breakno].len << 2) |
+				 breakinfo[breakno].type) << 16) <<
+			    (breakno << 2);
+			switch (breakno) {
+			case 0:
+				asm volatile ("movl %0, %%dr0\n"::"r"
+					      (breakinfo[breakno].addr));
+				break;
+
+			case 1:
+				asm volatile ("movl %0, %%dr1\n"::"r"
+					      (breakinfo[breakno].addr));
+				break;
+
+			case 2:
+				asm volatile ("movl %0, %%dr2\n"::"r"
+					      (breakinfo[breakno].addr));
+				break;
+
+			case 3:
+				asm volatile ("movl %0, %%dr3\n"::"r"
+					      (breakinfo[breakno].addr));
+				break;
+			}
+		} else if ((dr7 & breakbit) && !breakinfo[breakno].enabled) {
+			correctit = 1;
+			dr7 &= ~breakbit;
+			dr7 &= ~(0xf0000 << (breakno << 2));
+		}
+	}
+	if (correctit) {
+		asm volatile ("movl %0, %%db7\n"::"r" (dr7));
+	}
+}
+
+int
+remove_hw_break(unsigned breakno)
+{
+	if (!breakinfo[breakno].enabled) {
+		return -1;
+	}
+	breakinfo[breakno].enabled = 0;
+	return 0;
+}
+
+int
+set_hw_break(unsigned breakno, unsigned type, unsigned len, unsigned addr)
+{
+	if (breakinfo[breakno].enabled) {
+		return -1;
+	}
+	breakinfo[breakno].enabled = 1;
+	breakinfo[breakno].type = type;
+	breakinfo[breakno].len = len;
+	breakinfo[breakno].addr = addr;
+	return 0;
+}
+
+#ifdef CONFIG_SMP
+static int in_kgdb_console = 0;
+
+int
+in_kgdb(struct pt_regs *regs)
+{
+	unsigned flags;
+	int cpu = smp_processor_id();
+	in_kgdb_called = 1;
+	if (!spin_is_locked(&kgdb_spinlock)) {
+		if (in_kgdb_here_log[cpu] ||	/* we are holding this cpu */
+		    in_kgdb_console) {	/* or we are doing slow i/o */
+			return 1;
+		}
+		return 0;
+	}
+
+	/* As I see it the only reason not to let all cpus spin on
+	 * the same spin_lock is to allow selected ones to proceed.
+	 * This would be a good thing, so we leave it this way.
+	 * Maybe someday....  Done !
+
+	 * in_kgdb() is called from an NMI so we don't pretend
+	 * to have any resources, like printk() for example.
+	 */
+
+	kgdb_local_irq_save(flags);	/* only local here, to avoid hanging */
+	/*
+	 * log arival of this cpu
+	 * The NMI keeps on ticking.  Protect against recurring more
+	 * than once, and ignor the cpu that has the kgdb lock
+	 */
+	in_kgdb_entry_log[cpu]++;
+	in_kgdb_here_log[cpu] = regs;
+	if (cpu == spinlock_cpu || waiting_cpus[cpu].task)
+		goto exit_in_kgdb;
+
+	/*
+	 * For protection of the initilization of the spin locks by kgdb
+	 * it locks the kgdb spinlock before it gets the wait locks set
+	 * up.	We wait here for the wait lock to be taken.  If the
+	 * kgdb lock goes away first??	Well, it could be a slow exit
+	 * sequence where the wait lock is removed prior to the kgdb lock
+	 * so if kgdb gets unlocked, we just exit.
+	 */
+
+	while (spin_is_locked(&kgdb_spinlock) &&
+	       !spin_is_locked(waitlocks + cpu)) ;
+	if (!spin_is_locked(&kgdb_spinlock))
+		goto exit_in_kgdb;
+
+	waiting_cpus[cpu].task = current;
+	waiting_cpus[cpu].pid = (current->pid) ? : (PID_MAX + cpu);
+	waiting_cpus[cpu].regs = regs;
+
+	spin_unlock_wait(waitlocks + cpu);
+
+	/*
+	 * log departure of this cpu
+	 */
+	waiting_cpus[cpu].task = 0;
+	waiting_cpus[cpu].pid = 0;
+	waiting_cpus[cpu].regs = 0;
+	correct_hw_break();
+      exit_in_kgdb:
+	in_kgdb_here_log[cpu] = 0;
+	kgdb_local_irq_restore(flags);
+	return 1;
+	/*
+	   spin_unlock(continuelocks + smp_processor_id());
+	 */
+}
+
+void
+smp__in_kgdb(struct pt_regs regs)
+{
+	ack_APIC_irq();
+	in_kgdb(&regs);
+}
+#else
+int
+in_kgdb(struct pt_regs *regs)
+{
+	return (kgdb_spinlock);
+}
+#endif
+
+void
+printexceptioninfo(int exceptionNo, int errorcode, char *buffer)
+{
+	unsigned dr6;
+	int i;
+	switch (exceptionNo) {
+	case 1:		/* debug exception */
+		break;
+	case 3:		/* breakpoint */
+		sprintf(buffer, "Software breakpoint");
+		return;
+	default:
+		sprintf(buffer, "Details not available");
+		return;
+	}
+	asm volatile ("movl %%db6, %0\n":"=r" (dr6)
+		      :);
+	if (dr6 & 0x4000) {
+		sprintf(buffer, "Single step");
+		return;
+	}
+	for (i = 0; i < 4; ++i) {
+		if (dr6 & (1 << i)) {
+			sprintf(buffer, "Hardware breakpoint %d", i);
+			return;
+		}
+	}
+	sprintf(buffer, "Unknown trap");
+	return;
+}
+
+/*
+ * This function does all command procesing for interfacing to gdb.
+ *
+ * NOTE:  The INT nn instruction leaves the state of the interrupt
+ *	  enable flag UNCHANGED.  That means that when this routine
+ *	  is entered via a breakpoint (INT 3) instruction from code
+ *	  that has interrupts enabled, then interrupts will STILL BE
+ *	  enabled when this routine is entered.	 The first thing that
+ *	  we do here is disable interrupts so as to prevent recursive
+ *	  entries and bothersome serial interrupts while we are
+ *	  trying to run the serial port in polled mode.
+ *
+ * For kernel version 2.1.xx the kgdb_cli() actually gets a spin lock so
+ * it is always necessary to do a restore_flags before returning
+ * so as to let go of that lock.
+ */
+int
+kgdb_handle_exception(int exceptionVector,
+		      int signo, int err_code, struct pt_regs *linux_regs)
+{
+	struct task_struct *usethread = NULL;
+	struct task_struct *thread_list_start = 0, *thread = NULL;
+	int addr, length;
+	int breakno, breaktype;
+	char *ptr;
+	int newPC;
+	threadref thref;
+	int threadid;
+	int thread_min = PID_MAX + MAX_NO_CPUS;
+#ifdef old_thread_list
+	int maxthreads;
+#endif
+	int nothreads;
+	unsigned long flags;
+	int gdb_regs[NUMREGBYTES / 4];
+	int dr6;
+	IF_SMP(int entry_state = 0);	/* 0, ok, 1, no nmi, 2 sync failed */
+#define NO_NMI 1
+#define NO_SYNC 2
+#define	regs	(*linux_regs)
+#define NUMREGS NUMREGBYTES/4
+	/*
+	 * If the entry is not from the kernel then return to the Linux
+	 * trap handler and let it process the interrupt normally.
+	 */
+	if ((linux_regs->eflags & VM_MASK) || (3 & linux_regs->xcs)) {
+		printk("ignoring non-kernel exception\n");
+		print_regs(&regs);
+		return (0);
+	}
+	/*
+	 * If we're using eth mode, set the 'mode' in the netdevice.
+	 */
+
+	if (kgdboe)
+		netpoll_set_trap(1);
+
+	kgdb_local_irq_save(flags);
+
+	/* Get kgdb spinlock */
+
+	KGDB_SPIN_LOCK(&kgdb_spinlock);
+	rdtscll(kgdb_info.entry_tsc);
+	/*
+	 * We depend on this spinlock and the NMI watch dog to control the
+	 * other cpus.	They will arrive at "in_kgdb()" as a result of the
+	 * NMI and will wait there for the following spin locks to be
+	 * released.
+	 */
+#ifdef CONFIG_SMP
+
+#if 0
+	if (cpu_callout_map & ~MAX_CPU_MASK) {
+		printk("kgdb : too many cpus, possibly not mapped"
+		       " in contiguous space, change MAX_NO_CPUS"
+		       " in kgdb_stub and make new kernel.\n"
+		       " cpu_callout_map is %lx\n", cpu_callout_map);
+		goto exit_just_unlock;
+	}
+#endif
+	if (spinlock_count == 1) {
+		int time = 0, end_time, dum = 0;
+		int i;
+		int cpu_logged_in[MAX_NO_CPUS] = {[0 ... MAX_NO_CPUS - 1] = (0)
+		};
+		if (remote_debug) {
+			printk("kgdb : cpu %d entry, syncing others\n",
+			       smp_processor_id());
+		}
+		for (i = 0; i < MAX_NO_CPUS; i++) {
+			/*
+			 * Use trylock as we may already hold the lock if
+			 * we are holding the cpu.  Net result is all
+			 * locked.
+			 */
+			spin_trylock(&waitlocks[i]);
+		}
+		for (i = 0; i < MAX_NO_CPUS; i++)
+			cpu_logged_in[i] = 0;
+		/*
+		 * Wait for their arrival.  We know the watch dog is active if
+		 * in_kgdb() has ever been called, as it is always called on a
+		 * watchdog tick.
+		 */
+		rdtsc(dum, time);
+		end_time = time + 2;	/* Note: we use the High order bits! */
+		i = 1;
+		if (num_online_cpus() > 1) {
+			int me_in_kgdb = in_kgdb_entry_log[smp_processor_id()];
+			smp_send_nmi_allbutself();
+
+			while (i < num_online_cpus() && time != end_time) {
+				int j;
+				for (j = 0; j < MAX_NO_CPUS; j++) {
+					if (waiting_cpus[j].task &&
+					    waiting_cpus[j].task != NOCPU &&
+					    !cpu_logged_in[j]) {
+						i++;
+						cpu_logged_in[j] = 1;
+						if (remote_debug) {
+							printk
+							    ("kgdb : cpu %d arrived at kgdb\n",
+							     j);
+						}
+						break;
+					} else if (!waiting_cpus[j].task &&
+						   !cpu_online(j)) {
+						waiting_cpus[j].task = NOCPU;
+						cpu_logged_in[j] = 1;
+						waiting_cpus[j].hold = 1;
+						break;
+					}
+					if (!waiting_cpus[j].task &&
+					    in_kgdb_here_log[j]) {
+
+						int wait = 100000;
+						while (wait--) ;
+						if (!waiting_cpus[j].task &&
+						    in_kgdb_here_log[j]) {
+							printk
+							    ("kgdb : cpu %d stall"
+							     " in in_kgdb\n",
+							     j);
+							i++;
+							cpu_logged_in[j] = 1;
+							waiting_cpus[j].task =
+							    (struct task_struct
+							     *) 1;
+						}
+					}
+				}
+
+				if (in_kgdb_entry_log[smp_processor_id()] >
+				    (me_in_kgdb + 10)) {
+					break;
+				}
+
+				rdtsc(dum, time);
+			}
+			if (i < num_online_cpus()) {
+				printk
+				    ("kgdb : time out, proceeding without sync\n");
+#if 0
+				printk("kgdb : Waiting_cpus: 0 = %d, 1 = %d\n",
+				       waiting_cpus[0].task != 0,
+				       waiting_cpus[1].task != 0);
+				printk("kgdb : Cpu_logged in: 0 = %d, 1 = %d\n",
+				       cpu_logged_in[0], cpu_logged_in[1]);
+				printk
+				    ("kgdb : in_kgdb_here_log in: 0 = %d, 1 = %d\n",
+				     in_kgdb_here_log[0] != 0,
+				     in_kgdb_here_log[1] != 0);
+#endif
+				entry_state = NO_SYNC;
+			} else {
+#if 0
+				int ent =
+				    in_kgdb_entry_log[smp_processor_id()] -
+				    me_in_kgdb;
+				printk("kgdb : sync after %d entries\n", ent);
+#endif
+			}
+		} else {
+			if (remote_debug) {
+				printk
+				    ("kgdb : %d cpus, but watchdog not active\n"
+				     "proceeding without locking down other cpus\n",
+				     num_online_cpus());
+				entry_state = NO_NMI;
+			}
+		}
+	}
+#endif
+
+	if (remote_debug) {
+		unsigned long *lp = (unsigned long *) &linux_regs;
+
+		printk("handle_exception(exceptionVector=%d, "
+		       "signo=%d, err_code=%d, linux_regs=%p)\n",
+		       exceptionVector, signo, err_code, linux_regs);
+		if (debug_regs) {
+			print_regs(&regs);
+			printk("Stk: %8lx %8lx %8lx %8lx"
+			       "  %8lx %8lx %8lx %8lx\n",
+			       lp[0], lp[1], lp[2], lp[3],
+			       lp[4], lp[5], lp[6], lp[7]);
+			printk("     %8lx %8lx %8lx %8lx"
+			       "  %8lx %8lx %8lx %8lx\n",
+			       lp[8], lp[9], lp[10], lp[11],
+			       lp[12], lp[13], lp[14], lp[15]);
+			printk("     %8lx %8lx %8lx %8lx  "
+			       "%8lx %8lx %8lx %8lx\n",
+			       lp[16], lp[17], lp[18], lp[19],
+			       lp[20], lp[21], lp[22], lp[23]);
+			printk("     %8lx %8lx %8lx %8lx  "
+			       "%8lx %8lx %8lx %8lx\n",
+			       lp[24], lp[25], lp[26], lp[27],
+			       lp[28], lp[29], lp[30], lp[31]);
+		}
+	}
+
+	/* Disable hardware debugging while we are in kgdb */
+	/* Get the debug register status register */
+/*				       *INDENT-OFF*  */
+      __asm__("movl %0,%%db7"
+	      :	/* no output */
+	      :"r"(0));
+
+	asm volatile ("movl %%db6, %0\n"
+		      :"=r" (hw_breakpoint_status)
+		      :);
+
+/*				       *INDENT-ON*  */
+	switch (exceptionVector) {
+	case 0:		/* divide error */
+	case 1:		/* debug exception */
+	case 2:		/* NMI */
+	case 3:		/* breakpoint */
+	case 4:		/* overflow */
+	case 5:		/* bounds check */
+	case 6:		/* invalid opcode */
+	case 7:		/* device not available */
+	case 8:		/* double fault (errcode) */
+	case 10:		/* invalid TSS (errcode) */
+	case 12:		/* stack fault (errcode) */
+	case 16:		/* floating point error */
+	case 17:		/* alignment check (errcode) */
+	default:		/* any undocumented */
+		break;
+	case 11:		/* segment not present (errcode) */
+	case 13:		/* general protection (errcode) */
+	case 14:		/* page fault (special errcode) */
+	case 19:		/* cache flush denied */
+		if (mem_err_expected) {
+			/*
+			 * This fault occured because of the
+			 * get_char or set_char routines.  These
+			 * two routines use either eax of edx to
+			 * indirectly reference the location in
+			 * memory that they are working with.
+			 * For a page fault, when we return the
+			 * instruction will be retried, so we
+			 * have to make sure that these
+			 * registers point to valid memory.
+			 */
+			mem_err = 1;	/* set mem error flag */
+			mem_err_expected = 0;
+			mem_err_cnt++;	/* helps in debugging */
+			/* make valid address */
+			regs.eax = (long) &garbage_loc;
+			/* make valid address */
+			regs.edx = (long) &garbage_loc;
+			if (remote_debug)
+				printk("Return after memory error: "
+				       "mem_err_cnt=%d\n", mem_err_cnt);
+			if (debug_regs)
+				print_regs(&regs);
+			goto exit_kgdb;
+		}
+		break;
+	}
+	if (remote_debug)
+		printk("kgdb : entered kgdb on cpu %d\n", smp_processor_id());
+
+	gdb_i386vector = exceptionVector;
+	gdb_i386errcode = err_code;
+	kgdb_info.called_from = __builtin_return_address(0);
+#ifdef CONFIG_SMP
+	/*
+	 * OK, we can now communicate, lets tell gdb about the sync.
+	 * but only if we had a problem.
+	 */
+	switch (entry_state) {
+	case NO_NMI:
+		to_gdb("NMI not active, other cpus not stopped\n");
+		break;
+	case NO_SYNC:
+		to_gdb("Some cpus not stopped, see 'kgdb_info' for details\n");
+	default:;
+	}
+
+#endif
+/*
+ * Set up the gdb function call area.
+ */
+	trap_cpu = smp_processor_id();
+	OLD_esp = NEW_esp = (int) (&linux_regs->esp);
+
+      IF_SMP(once_again:)
+	    /* reply to host that an exception has occurred */
+	    remcomOutBuffer[0] = 'S';
+	remcomOutBuffer[1] = hexchars[signo >> 4];
+	remcomOutBuffer[2] = hexchars[signo % 16];
+	remcomOutBuffer[3] = 0;
+
+	putpacket(remcomOutBuffer);
+
+	while (1 == 1) {
+		error = 0;
+		remcomOutBuffer[0] = 0;
+		getpacket(remcomInBuffer);
+		switch (remcomInBuffer[0]) {
+		case '?':
+			remcomOutBuffer[0] = 'S';
+			remcomOutBuffer[1] = hexchars[signo >> 4];
+			remcomOutBuffer[2] = hexchars[signo % 16];
+			remcomOutBuffer[3] = 0;
+			break;
+		case 'd':
+			remote_debug = !(remote_debug);	/* toggle debug flag */
+			printk("Remote debug %s\n",
+			       remote_debug ? "on" : "off");
+			break;
+		case 'g':	/* return the value of the CPU registers */
+			get_gdb_regs(usethread, &regs, gdb_regs);
+			mem2hex((char *) gdb_regs,
+				remcomOutBuffer, NUMREGBYTES, 0);
+			break;
+		case 'G':	/* set the value of the CPU registers - return OK */
+			hex2mem(&remcomInBuffer[1],
+				(char *) gdb_regs, NUMREGBYTES, 0);
+			if (!usethread || usethread == current) {
+				gdb_regs_to_regs(gdb_regs, &regs);
+				strcpy(remcomOutBuffer, "OK");
+			} else {
+				strcpy(remcomOutBuffer, "E00");
+			}
+			break;
+
+		case 'P':{	/* set the value of a single CPU register -
+				   return OK */
+				/*
+				 * For some reason, gdb wants to talk about psudo
+				 * registers (greater than 15).	 These may have
+				 * meaning for ptrace, but for us it is safe to
+				 * ignor them.	We do this by dumping them into
+				 * _GS which we also ignor, but do have memory for.
+				 */
+				int regno;
+
+				ptr = &remcomInBuffer[1];
+				regs_to_gdb_regs(gdb_regs, &regs);
+				if ((!usethread || usethread == current) &&
+				    hexToInt(&ptr, &regno) &&
+				    *ptr++ == '=' && (regno >= 0)) {
+					regno =
+					    (regno >= NUMREGS ? _GS : regno);
+					hex2mem(ptr, (char *) &gdb_regs[regno],
+						4, 0);
+					gdb_regs_to_regs(gdb_regs, &regs);
+					strcpy(remcomOutBuffer, "OK");
+					break;
+				}
+				strcpy(remcomOutBuffer, "E01");
+				break;
+			}
+
+			/* mAA..AA,LLLL	 Read LLLL bytes at address AA..AA */
+		case 'm':
+			/* TRY TO READ %x,%x.  IF SUCCEED, SET PTR = 0 */
+			ptr = &remcomInBuffer[1];
+			if (hexToInt(&ptr, &addr) &&
+			    (*(ptr++) == ',') && (hexToInt(&ptr, &length))) {
+				ptr = 0;
+				/*
+				 * hex doubles the byte count
+				 */
+				if (length > (BUFMAX / 2))
+					length = BUFMAX / 2;
+				mem2hex((char *) addr,
+					remcomOutBuffer, length, 1);
+				if (mem_err) {
+					strcpy(remcomOutBuffer, "E03");
+					debug_error("memory fault\n", NULL);
+				}
+			}
+
+			if (ptr) {
+				strcpy(remcomOutBuffer, "E01");
+				debug_error
+				    ("malformed read memory command: %s\n",
+				     remcomInBuffer);
+			}
+			break;
+
+			/* MAA..AA,LLLL:
+			   Write LLLL bytes at address AA.AA return OK */
+		case 'M':
+			/* TRY TO READ '%x,%x:'.  IF SUCCEED, SET PTR = 0 */
+			ptr = &remcomInBuffer[1];
+			if (hexToInt(&ptr, &addr) &&
+			    (*(ptr++) == ',') &&
+			    (hexToInt(&ptr, &length)) && (*(ptr++) == ':')) {
+				hex2mem(ptr, (char *) addr, length, 1);
+
+				if (mem_err) {
+					strcpy(remcomOutBuffer, "E03");
+					debug_error("memory fault\n", NULL);
+				} else {
+					strcpy(remcomOutBuffer, "OK");
+				}
+
+				ptr = 0;
+			}
+			if (ptr) {
+				strcpy(remcomOutBuffer, "E02");
+				debug_error
+				    ("malformed write memory command: %s\n",
+				     remcomInBuffer);
+			}
+			break;
+		case 'S':
+			remcomInBuffer[0] = 's';
+		case 'C':
+			/* Csig;AA..AA where ;AA..AA is optional
+			 * continue with signal
+			 * Since signals are meaning less to us, delete that
+			 * part and then fall into the 'c' code.
+			 */
+			ptr = &remcomInBuffer[1];
+			length = 2;
+			while (*ptr && *ptr != ';') {
+				length++;
+				ptr++;
+			}
+			if (*ptr) {
+				do {
+					ptr++;
+					*(ptr - length++) = *ptr;
+				} while (*ptr);
+			} else {
+				remcomInBuffer[1] = 0;
+			}
+
+			/* cAA..AA  Continue at address AA..AA(optional) */
+			/* sAA..AA  Step one instruction from AA..AA(optional) */
+			/* D	    detach, reply OK and then continue */
+		case 'c':
+		case 's':
+		case 'D':
+
+			/* try to read optional parameter,
+			   pc unchanged if no parm */
+			ptr = &remcomInBuffer[1];
+			if (hexToInt(&ptr, &addr)) {
+				if (remote_debug)
+					printk("Changing EIP to 0x%x\n", addr);
+
+				regs.eip = addr;
+			}
+
+			newPC = regs.eip;
+
+			/* clear the trace bit */
+			regs.eflags &= 0xfffffeff;
+
+			/* set the trace bit if we're stepping */
+			if (remcomInBuffer[0] == 's')
+				regs.eflags |= 0x100;
+
+			/* detach is a friendly version of continue. Note that
+			   debugging is still enabled (e.g hit control C)
+			 */
+			if (remcomInBuffer[0] == 'D') {
+				strcpy(remcomOutBuffer, "OK");
+				putpacket(remcomOutBuffer);
+			}
+
+			if (remote_debug) {
+				printk("Resuming execution\n");
+				print_regs(&regs);
+			}
+			asm volatile ("movl %%db6, %0\n":"=r" (dr6)
+				      :);
+			if (!(dr6 & 0x4000)) {
+				for (breakno = 0; breakno < 4; ++breakno) {
+					if (dr6 & (1 << breakno) &&
+					    (breakinfo[breakno].type == 0)) {
+						/* Set restore flag */
+						regs.eflags |= 0x10000;
+						break;
+					}
+				}
+			}
+
+			if (kgdboe)
+				netpoll_set_trap(0);
+
+			correct_hw_break();
+			asm volatile ("movl %0, %%db6\n"::"r" (0));
+			goto exit_kgdb;
+
+			/* kill the program */
+		case 'k':	/* do nothing */
+			break;
+
+			/* query */
+		case 'q':
+			nothreads = 0;
+			switch (remcomInBuffer[1]) {
+			case 'f':
+				threadid = 1;
+				thread_list = 2;
+				thread_list_start = (usethread ? : current);
+			case 's':
+				if (!cmp_str(&remcomInBuffer[2],
+					     "ThreadInfo", 10))
+					break;
+
+				remcomOutBuffer[nothreads++] = 'm';
+				for (; threadid < PID_MAX + MAX_NO_CPUS;
+				     threadid++) {
+					thread = getthread(threadid);
+					if (thread) {
+						nothreads += int_to_hex_v(
+							&remcomOutBuffer[
+								nothreads],
+							threadid);
+						if (thread_min > threadid)
+							thread_min = threadid;
+						remcomOutBuffer[
+							nothreads] = ',';
+						nothreads++;
+						if (nothreads > BUFMAX - 10)
+							break;
+					}
+				}
+				if (remcomOutBuffer[nothreads - 1] == 'm') {
+					remcomOutBuffer[nothreads - 1] = 'l';
+				} else {
+					nothreads--;
+				}
+				remcomOutBuffer[nothreads] = 0;
+				break;
+
+#ifdef old_thread_list /* Old thread info request */
+			case 'L':
+				/* List threads */
+				thread_list = 2;
+				thread_list_start = (usethread ? : current);
+				unpack_byte(remcomInBuffer + 3, &maxthreads);
+				unpack_threadid(remcomInBuffer + 5, &thref);
+				do {
+					int buf_thread_limit =
+					    (BUFMAX - 22) / BUF_THREAD_ID_SIZE;
+					if (maxthreads > buf_thread_limit) {
+						maxthreads = buf_thread_limit;
+					}
+				} while (0);
+				remcomOutBuffer[0] = 'q';
+				remcomOutBuffer[1] = 'M';
+				remcomOutBuffer[4] = '0';
+				pack_threadid(remcomOutBuffer + 5, &thref);
+
+				threadid = threadref_to_int(&thref);
+				for (nothreads = 0;
+				     nothreads < maxthreads &&
+				     threadid < PID_MAX + MAX_NO_CPUS;
+				     threadid++) {
+					thread = getthread(threadid);
+					if (thread) {
+						int_to_threadref(&thref,
+								 threadid);
+						pack_threadid(remcomOutBuffer +
+							      21 +
+							      nothreads * 16,
+							      &thref);
+						nothreads++;
+						if (thread_min > threadid)
+							thread_min = threadid;
+					}
+				}
+
+				if (threadid == PID_MAX + MAX_NO_CPUS) {
+					remcomOutBuffer[4] = '1';
+				}
+				pack_hex_byte(remcomOutBuffer + 2, nothreads);
+				remcomOutBuffer[21 + nothreads * 16] = '\0';
+				break;
+#endif
+			case 'C':
+				/* Current thread id */
+				remcomOutBuffer[0] = 'Q';
+				remcomOutBuffer[1] = 'C';
+				threadid = current->pid;
+				if (!threadid) {
+					/*
+					 * idle thread
+					 */
+					for (threadid = PID_MAX;
+					     threadid < PID_MAX + MAX_NO_CPUS;
+					     threadid++) {
+						if (current ==
+						    idle_task(threadid -
+							      PID_MAX))
+							break;
+					}
+				}
+				int_to_threadref(&thref, threadid);
+				pack_threadid(remcomOutBuffer + 2, &thref);
+				remcomOutBuffer[18] = '\0';
+				break;
+
+			case 'E':
+				/* Print exception info */
+				printexceptioninfo(exceptionVector,
+						   err_code, remcomOutBuffer);
+				break;
+			case 'T':{
+				char * nptr;
+				/* Thread extra info */
+				if (!cmp_str(&remcomInBuffer[2],
+					    "hreadExtraInfo,", 15)) {
+					break;
+				}
+				ptr = &remcomInBuffer[17];
+				hexToInt(&ptr, &threadid);
+				thread = getthread(threadid);
+				nptr = &thread->comm[0];
+				length = 0;
+				ptr = &remcomOutBuffer[0];
+				do {
+					length++;
+					ptr = pack_hex_byte(ptr, *nptr++);
+				 } while (*nptr && length < 16);
+				/*
+				 * would like that 16 to be the size of
+				 * task_struct.comm but don't know the
+				 * syntax..
+				 */
+				*ptr = 0;
+			}
+			}
+			break;
+
+			/* task related */
+		case 'H':
+			switch (remcomInBuffer[1]) {
+			case 'g':
+				ptr = &remcomInBuffer[2];
+				hexToInt(&ptr, &threadid);
+				thread = getthread(threadid);
+				if (!thread) {
+					remcomOutBuffer[0] = 'E';
+					remcomOutBuffer[1] = '\0';
+					break;
+				}
+				/*
+				 * Just in case I forget what this is all about,
+				 * the "thread info" command to gdb causes it
+				 * to ask for a thread list.  It then switches
+				 * to each thread and asks for the registers.
+				 * For this (and only this) usage, we want to
+				 * fudge the registers of tasks not on the run
+				 * list (i.e. waiting) to show the routine that
+				 * called schedule. Also, gdb, is a minimalist
+				 * in that if the current thread is the last
+				 * it will not re-read the info when done.
+				 * This means that in this case we must show
+				 * the real registers. So here is how we do it:
+				 * Each entry we keep track of the min
+				 * thread in the list (the last that gdb will)
+				 * get info for.  We also keep track of the
+				 * starting thread.
+				 * "thread_list" is cleared when switching back
+				 * to the min thread if it is was current, or
+				 * if it was not current, thread_list is set
+				 * to 1.  When the switch to current comes,
+				 * if thread_list is 1, clear it, else do
+				 * nothing.
+				 */
+				usethread = thread;
+				if ((thread_list == 1) &&
+				    (thread == thread_list_start)) {
+					thread_list = 0;
+				}
+				if (thread_list && (threadid == thread_min)) {
+					if (thread == thread_list_start) {
+						thread_list = 0;
+					} else {
+						thread_list = 1;
+					}
+				}
+				/* follow through */
+			case 'c':
+				remcomOutBuffer[0] = 'O';
+				remcomOutBuffer[1] = 'K';
+				remcomOutBuffer[2] = '\0';
+				break;
+			}
+			break;
+
+			/* Query thread status */
+		case 'T':
+			ptr = &remcomInBuffer[1];
+			hexToInt(&ptr, &threadid);
+			thread = getthread(threadid);
+			if (thread) {
+				remcomOutBuffer[0] = 'O';
+				remcomOutBuffer[1] = 'K';
+				remcomOutBuffer[2] = '\0';
+				if (thread_min > threadid)
+					thread_min = threadid;
+			} else {
+				remcomOutBuffer[0] = 'E';
+				remcomOutBuffer[1] = '\0';
+			}
+			break;
+
+		case 'Y': /* set up a hardware breakpoint */
+			ptr = &remcomInBuffer[1];
+			hexToInt(&ptr, &breakno);
+			ptr++;
+			hexToInt(&ptr, &breaktype);
+			ptr++;
+			hexToInt(&ptr, &length);
+			ptr++;
+			hexToInt(&ptr, &addr);
+			if (set_hw_break(breakno & 0x3,
+					 breaktype & 0x3,
+					 length & 0x3, addr) == 0) {
+				strcpy(remcomOutBuffer, "OK");
+			} else {
+				strcpy(remcomOutBuffer, "ERROR");
+			}
+			break;
+
+			/* Remove hardware breakpoint */
+		case 'y':
+			ptr = &remcomInBuffer[1];
+			hexToInt(&ptr, &breakno);
+			if (remove_hw_break(breakno & 0x3) == 0) {
+				strcpy(remcomOutBuffer, "OK");
+			} else {
+				strcpy(remcomOutBuffer, "ERROR");
+			}
+			break;
+
+		case 'r':	/* reboot */
+			strcpy(remcomOutBuffer, "OK");
+			putpacket(remcomOutBuffer);
+			/*to_gdb("Rebooting\n"); */
+			/* triplefault	 no return from here */
+			{
+				static long no_idt[2];
+				__asm__ __volatile__("lidt %0"::"m"(no_idt[0]));
+				BREAKPOINT;
+			}
+
+		}		/* switch */
+
+		/* reply to the request */
+		putpacket(remcomOutBuffer);
+	}			/* while(1==1) */
+	/*
+	 *  reached by goto only.
+	 */
+      exit_kgdb:
+	/*
+	 * Here is where we set up to trap a gdb function call.	 NEW_esp
+	 * will be changed if we are trying to do this.	 We handle both
+	 * adding and subtracting, thus allowing gdb to put grung on
+	 * the stack which it removes later.
+	 */
+	if (NEW_esp != OLD_esp) {
+		int *ptr = END_OF_LOOKASIDE;
+		if (NEW_esp < OLD_esp)
+			ptr -= (OLD_esp - NEW_esp) / sizeof (int);
+		*--ptr = linux_regs->eflags;
+		*--ptr = linux_regs->xcs;
+		*--ptr = linux_regs->eip;
+		*--ptr = linux_regs->ecx;
+		*--ptr = linux_regs->ebx;
+		*--ptr = linux_regs->eax;
+		linux_regs->ecx = NEW_esp - (sizeof (int) * 6);
+		linux_regs->ebx = (unsigned int) END_OF_LOOKASIDE;
+		if (NEW_esp < OLD_esp) {
+			linux_regs->eip = (unsigned int) fn_call_stub;
+		} else {
+			linux_regs->eip = (unsigned int) fn_rtn_stub;
+			linux_regs->eax = NEW_esp;
+		}
+		linux_regs->eflags &= ~(IF_BIT | TF_BIT);
+	}
+#ifdef CONFIG_SMP
+	/*
+	 * Release gdb wait locks
+	 * Sanity check time.  Must have at least one cpu to run.  Also single
+	 * step must not be done if the current cpu is on hold.
+	 */
+	if (spinlock_count == 1) {
+		int ss_hold = (regs.eflags & 0x100) && kgdb_info.hold_on_sstep;
+		int cpu_avail = 0;
+		int i;
+
+		for (i = 0; i < MAX_NO_CPUS; i++) {
+			if (!cpu_online(i))
+				break;
+			if (!hold_cpu(i)) {
+				cpu_avail = 1;
+			}
+		}
+		/*
+		 * Early in the bring up there will be NO cpus on line...
+		 */
+		if (!cpu_avail && !cpus_empty(cpu_online_map)) {
+			to_gdb("No cpus unblocked, see 'kgdb_info.hold_cpu'\n");
+			goto once_again;
+		}
+		if (hold_cpu(smp_processor_id()) && (regs.eflags & 0x100)) {
+			to_gdb
+			    ("Current cpu must be unblocked to single step\n");
+			goto once_again;
+		}
+		if (!(ss_hold)) {
+			int i;
+			for (i = 0; i < MAX_NO_CPUS; i++) {
+				if (!hold_cpu(i)) {
+					spin_unlock(&waitlocks[i]);
+				}
+			}
+		} else {
+			spin_unlock(&waitlocks[smp_processor_id()]);
+		}
+		/* Release kgdb spinlock */
+		KGDB_SPIN_UNLOCK(&kgdb_spinlock);
+		/*
+		 * If this cpu is on hold, this is where we
+		 * do it.  Note, the NMI will pull us out of here,
+		 * but will return as the above lock is not held.
+		 * We will stay here till another cpu releases the lock for us.
+		 */
+		spin_unlock_wait(waitlocks + smp_processor_id());
+		kgdb_local_irq_restore(flags);
+		return (0);
+	}
+#if 0
+exit_just_unlock:
+#endif
+#endif
+	/* Release kgdb spinlock */
+	KGDB_SPIN_UNLOCK(&kgdb_spinlock);
+	kgdb_local_irq_restore(flags);
+	return (0);
+}
+
+/* this function is used to set up exception handlers for tracing and
+ * breakpoints.
+ * This function is not needed as the above line does all that is needed.
+ * We leave it for backward compatitability...
+ */
+void
+set_debug_traps(void)
+{
+	/*
+	 * linux_debug_hook is defined in traps.c.  We store a pointer
+	 * to our own exception handler into it.
+
+	 * But really folks, every hear of labeled common, an old Fortran
+	 * concept.  Lots of folks can reference it and it is define if
+	 * anyone does.	 Only one can initialize it at link time.  We do
+	 * this with the hook.	See the statement above.  No need for any
+	 * executable code and it is ready as soon as the kernel is
+	 * loaded.  Very desirable in kernel debugging.
+
+	 linux_debug_hook = handle_exception ;
+	 */
+
+	/* In case GDB is started before us, ack any packets (presumably
+	   "$?#xx") sitting there.
+	   putDebugChar ('+');
+
+	   initialized = 1;
+	 */
+}
+
+/* This function will generate a breakpoint exception.	It is used at the
+   beginning of a program to sync up with a debugger and can be used
+   otherwise as a quick means to stop program execution and "break" into
+   the debugger. */
+/* But really, just use the BREAKPOINT macro.  We will handle the int stuff
+ */
+
+#ifdef later
+/*
+ * possibly we should not go thru the traps.c code at all?  Someday.
+ */
+void
+do_kgdb_int3(struct pt_regs *regs, long error_code)
+{
+	kgdb_handle_exception(3, 5, error_code, regs);
+	return;
+}
+#endif
+#undef regs
+#ifdef CONFIG_TRAP_BAD_SYSCALL_EXITS
+asmlinkage void
+bad_sys_call_exit(int stuff)
+{
+	struct pt_regs *regs = (struct pt_regs *) &stuff;
+	printk("Sys call %d return with %x preempt_count\n",
+	       (int) regs->orig_eax, preempt_count());
+}
+#endif
+#ifdef CONFIG_STACK_OVERFLOW_TEST
+#include <asm/kgdb.h>
+asmlinkage void
+stack_overflow(void)
+{
+#ifdef BREAKPOINT
+	BREAKPOINT;
+#else
+	printk("Kernel stack overflow, looping forever\n");
+#endif
+	while (1) {
+	}
+}
+#endif
+
+#if defined(CONFIG_SMP) || defined(CONFIG_KGDB_CONSOLE)
+char gdbconbuf[BUFMAX];
+
+static void
+kgdb_gdb_message(const char *s, unsigned count)
+{
+	int i;
+	int wcount;
+	char *bufptr;
+	/*
+	 * This takes care of NMI while spining out chars to gdb
+	 */
+	IF_SMP(in_kgdb_console = 1);
+	gdbconbuf[0] = 'O';
+	bufptr = gdbconbuf + 1;
+	while (count > 0) {
+		if ((count << 1) > (BUFMAX - 2)) {
+			wcount = (BUFMAX - 2) >> 1;
+		} else {
+			wcount = count;
+		}
+		count -= wcount;
+		for (i = 0; i < wcount; i++) {
+			bufptr = pack_hex_byte(bufptr, s[i]);
+		}
+		*bufptr = '\0';
+		s += wcount;
+
+		putpacket(gdbconbuf);
+
+	}
+	IF_SMP(in_kgdb_console = 0);
+}
+#endif
+#ifdef CONFIG_SMP
+static void
+to_gdb(const char *s)
+{
+	int count = 0;
+	while (s[count] && (count++ < BUFMAX)) ;
+	kgdb_gdb_message(s, count);
+}
+#endif
+#ifdef CONFIG_KGDB_CONSOLE
+#include <linux/console.h>
+#include <linux/init.h>
+#include <linux/fs.h>
+#include <asm/uaccess.h>
+#include <asm/semaphore.h>
+
+void
+kgdb_console_write(struct console *co, const char *s, unsigned count)
+{
+
+	if (gdb_i386vector == -1) {
+		/*
+		 * We have not yet talked to gdb.  What to do...
+		 * lets break, on continue we can do the write.
+		 * But first tell him whats up. Uh, well no can do,
+		 * as this IS the console.  Oh well...
+		 * We do need to wait or the messages will be lost.
+		 * Other option would be to tell the above code to
+		 * ignore this breakpoint and do an auto return,
+		 * but that might confuse gdb.	Also this happens
+		 * early enough in boot up that we don't have the traps
+		 * set up yet, so...
+		 */
+		breakpoint();
+	}
+	kgdb_gdb_message(s, count);
+}
+
+/*
+ * ------------------------------------------------------------
+ * Serial KGDB driver
+ * ------------------------------------------------------------
+ */
+
+static struct console kgdbcons = {
+	name:"kgdb",
+	write:kgdb_console_write,
+#ifdef CONFIG_KGDB_USER_CONSOLE
+	device:kgdb_console_device,
+#endif
+	flags:CON_PRINTBUFFER | CON_ENABLED,
+	index:-1,
+};
+
+/*
+ * The trick here is that this file gets linked before printk.o
+ * That means we get to peer at the console info in the command
+ * line before it does.	 If we are up, we register, otherwise,
+ * do nothing.	By returning 0, we allow printk to look also.
+ */
+static int kgdb_console_enabled;
+
+int __init
+kgdb_console_init(char *str)
+{
+	if ((strncmp(str, "kgdb", 4) == 0) || (strncmp(str, "gdb", 3) == 0)) {
+		register_console(&kgdbcons);
+		kgdb_console_enabled = 1;
+	}
+	return 0;		/* let others look at the string */
+}
+
+__setup("console=", kgdb_console_init);
+
+#ifdef CONFIG_KGDB_USER_CONSOLE
+static kdev_t kgdb_console_device(struct console *c);
+/* This stuff sort of works, but it knocks out telnet devices
+ * we are leaving it here in case we (or you) find time to figure it out
+ * better..
+ */
+
+/*
+ * We need a real char device as well for when the console is opened for user
+ * space activities.
+ */
+
+static int
+kgdb_consdev_open(struct inode *inode, struct file *file)
+{
+	return 0;
+}
+
+static ssize_t
+kgdb_consdev_write(struct file *file, const char *buf,
+		   size_t count, loff_t * ppos)
+{
+	int size, ret = 0;
+	static char kbuf[128];
+	static DECLARE_MUTEX(sem);
+
+	/* We are not reentrant... */
+	if (down_interruptible(&sem))
+		return -ERESTARTSYS;
+
+	while (count > 0) {
+		/* need to copy the data from user space */
+		size = count;
+		if (size > sizeof (kbuf))
+			size = sizeof (kbuf);
+		if (copy_from_user(kbuf, buf, size)) {
+			ret = -EFAULT;
+			break;;
+		}
+		kgdb_console_write(&kgdbcons, kbuf, size);
+		count -= size;
+		ret += size;
+		buf += size;
+	}
+
+	up(&sem);
+
+	return ret;
+}
+
+struct file_operations kgdb_consdev_fops = {
+	open:kgdb_consdev_open,
+	write:kgdb_consdev_write
+};
+static kdev_t
+kgdb_console_device(struct console *c)
+{
+	return MKDEV(TTYAUX_MAJOR, 1);
+}
+
+/*
+ * This routine gets called from the serial stub in the i386/lib
+ * This is so it is done late in bring up (just before the console open).
+ */
+void
+kgdb_console_finit(void)
+{
+	if (kgdb_console_enabled) {
+		char *cptr = cdevname(MKDEV(TTYAUX_MAJOR, 1));
+		char *cp = cptr;
+		while (*cptr && *cptr != '(')
+			cptr++;
+		*cptr = 0;
+		unregister_chrdev(TTYAUX_MAJOR, cp);
+		register_chrdev(TTYAUX_MAJOR, "kgdb", &kgdb_consdev_fops);
+	}
+}
+#endif
+#endif
+#ifdef CONFIG_KGDB_TS
+#include <asm/msr.h>		/* time stamp code */
+#include <asm/hardirq.h>	/* in_interrupt */
+#ifdef CONFIG_KGDB_TS_64
+#define DATA_POINTS 64
+#endif
+#ifdef CONFIG_KGDB_TS_128
+#define DATA_POINTS 128
+#endif
+#ifdef CONFIG_KGDB_TS_256
+#define DATA_POINTS 256
+#endif
+#ifdef CONFIG_KGDB_TS_512
+#define DATA_POINTS 512
+#endif
+#ifdef CONFIG_KGDB_TS_1024
+#define DATA_POINTS 1024
+#endif
+#ifndef DATA_POINTS
+#define DATA_POINTS 128		/* must be a power of two */
+#endif
+#define INDEX_MASK (DATA_POINTS - 1)
+#if (INDEX_MASK & DATA_POINTS)
+#error "CONFIG_KGDB_TS_COUNT must be a power of 2"
+#endif
+struct kgdb_and_then_struct {
+#ifdef CONFIG_SMP
+	int on_cpu;
+#endif
+	struct task_struct *task;
+	long long at_time;
+	int from_ln;
+	char *in_src;
+	void *from;
+	int *with_shpf;
+	int data0;
+	int data1;
+};
+struct kgdb_and_then_struct2 {
+#ifdef CONFIG_SMP
+	int on_cpu;
+#endif
+	struct task_struct *task;
+	long long at_time;
+	int from_ln;
+	char *in_src;
+	void *from;
+	int *with_shpf;
+	struct task_struct *t1;
+	struct task_struct *t2;
+};
+struct kgdb_and_then_struct kgdb_data[DATA_POINTS];
+
+struct kgdb_and_then_struct *kgdb_and_then = &kgdb_data[0];
+int kgdb_and_then_count;
+
+void
+kgdb_tstamp(int line, char *source, int data0, int data1)
+{
+	static spinlock_t ts_spin = SPIN_LOCK_UNLOCKED;
+	int flags;
+	kgdb_local_irq_save(flags);
+	spin_lock(&ts_spin);
+	rdtscll(kgdb_and_then->at_time);
+#ifdef CONFIG_SMP
+	kgdb_and_then->on_cpu = smp_processor_id();
+#endif
+	kgdb_and_then->task = current;
+	kgdb_and_then->from_ln = line;
+	kgdb_and_then->in_src = source;
+	kgdb_and_then->from = __builtin_return_address(0);
+	kgdb_and_then->with_shpf = (int *) (((flags & IF_BIT) >> 9) |
+					    (preempt_count() << 8));
+	kgdb_and_then->data0 = data0;
+	kgdb_and_then->data1 = data1;
+	kgdb_and_then = &kgdb_data[++kgdb_and_then_count & INDEX_MASK];
+	spin_unlock(&ts_spin);
+	kgdb_local_irq_restore(flags);
+#ifdef CONFIG_PREEMPT
+
+#endif
+	return;
+}
+#endif
+typedef int gdb_debug_hook(int exceptionVector,
+			   int signo, int err_code, struct pt_regs *linux_regs);
+gdb_debug_hook *linux_debug_hook = &kgdb_handle_exception;	/* histerical reasons... */
+
+static int kgdb_need_breakpoint[NR_CPUS];
+
+void kgdb_schedule_breakpoint(void)
+{
+	kgdb_need_breakpoint[smp_processor_id()] = 1;
+}
+
+void kgdb_process_breakpoint(void)
+{
+	/*
+	 * Handle a breakpoint queued from inside network driver code
+         * to avoid reentrancy issues
+	 */
+	if (kgdb_need_breakpoint[smp_processor_id()]) {
+		kgdb_need_breakpoint[smp_processor_id()] = 0;
+		BREAKPOINT;
+	}
+}
+
--- diff/arch/i386/kernel/timers/timer_pm.c	1970-01-01 01:00:00.000000000 +0100
+++ source/arch/i386/kernel/timers/timer_pm.c	2004-02-09 10:39:50.000000000 +0000
@@ -0,0 +1,217 @@
+/*
+ * (C) Dominik Brodowski <linux@brodo.de> 2003
+ *
+ * Driver to use the Power Management Timer (PMTMR) available in some
+ * southbridges as primary timing source for the Linux kernel.
+ *
+ * Based on parts of linux/drivers/acpi/hardware/hwtimer.c, timer_pit.c,
+ * timer_hpet.c, and on Arjan van de Ven's implementation for 2.4.
+ *
+ * This file is licensed under the GPL v2.
+ */
+
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/device.h>
+#include <linux/init.h>
+#include <asm/types.h>
+#include <asm/timer.h>
+#include <asm/smp.h>
+#include <asm/io.h>
+#include <asm/arch_hooks.h>
+
+
+/* The I/O port the PMTMR resides at.
+ * The location is detected during setup_arch(),
+ * in arch/i386/acpi/boot.c */
+u32 pmtmr_ioport = 0;
+
+
+/* value of the Power timer at last timer interrupt */
+static u32 offset_tick;
+static u32 offset_delay;
+
+static unsigned long long monotonic_base;
+static seqlock_t monotonic_lock = SEQLOCK_UNLOCKED;
+
+#define ACPI_PM_MASK 0xFFFFFF /* limit it to 24 bits */
+
+/*helper function to safely read acpi pm timesource*/
+static inline u32 read_pmtmr(void)
+{
+	u32 v1=0,v2=0,v3=0;
+	/* It has been reported that because of various broken
+	 * chipsets (ICH4, PIIX4 and PIIX4E) where the ACPI PM time
+	 * source is not latched, so you must read it multiple
+	 * times to insure a safe value is read.
+	 */
+	do {
+		v1 = inl(pmtmr_ioport);
+		v2 = inl(pmtmr_ioport);
+		v3 = inl(pmtmr_ioport);
+	} while ((v1 > v2 && v1 < v3) || (v2 > v3 && v2 < v1)
+			|| (v3 > v1 && v3 < v2));
+
+	/* mask the output to 24 bits */
+	return v2 & ACPI_PM_MASK;
+}
+
+static int init_pmtmr(char* override)
+{
+	u32 value1, value2;
+	unsigned int i;
+
+ 	if (override[0] && strncmp(override,"pmtmr",5))
+		return -ENODEV;
+
+	if (!pmtmr_ioport)
+		return -ENODEV;
+
+	/* we use the TSC for delay_pmtmr, so make sure it exists */
+	if (!cpu_has_tsc)
+		return -ENODEV;
+
+	/* "verify" this timing source */
+	value1 = read_pmtmr();
+	for (i = 0; i < 10000; i++) {
+		value2 = read_pmtmr();
+		if (value2 == value1)
+			continue;
+		if (value2 > value1)
+			goto pm_good;
+		if ((value2 < value1) && ((value2) < 0xFFF))
+			goto pm_good;
+		printk(KERN_INFO "PM-Timer had inconsistent results: 0x%#x, 0x%#x - aborting.\n", value1, value2);
+		return -EINVAL;
+	}
+	printk(KERN_INFO "PM-Timer had no reasonable result: 0x%#x - aborting.\n", value1);
+	return -ENODEV;
+
+pm_good:
+	init_cpu_khz();
+	return 0;
+}
+
+static inline u32 cyc2us(u32 cycles)
+{
+	/* The Power Management Timer ticks at 3.579545 ticks per microsecond.
+	 * 1 / PM_TIMER_FREQUENCY == 0.27936511 =~ 286/1024 [error: 0.024%]
+	 *
+	 * Even with HZ = 100, delta is at maximum 35796 ticks, so it can
+	 * easily be multiplied with 286 (=0x11E) without having to fear
+	 * u32 overflows.
+	 */
+	cycles *= 286;
+	return (cycles >> 10);
+}
+
+/*
+ * this gets called during each timer interrupt
+ *   - Called while holding the writer xtime_lock
+ */
+static void mark_offset_pmtmr(void)
+{
+	u32 lost, delta, last_offset;
+	static int first_run = 1;
+	last_offset = offset_tick;
+
+	write_seqlock(&monotonic_lock);
+
+	offset_tick = read_pmtmr();
+
+	/* calculate tick interval */
+	delta = (offset_tick - last_offset) & ACPI_PM_MASK;
+
+	/* convert to usecs */
+	delta = cyc2us(delta);
+
+	/* update the monotonic base value */
+	monotonic_base += delta * NSEC_PER_USEC;
+	write_sequnlock(&monotonic_lock);
+
+	/* convert to ticks */
+	delta += offset_delay;
+	lost = delta / (USEC_PER_SEC / HZ);
+	offset_delay = delta % (USEC_PER_SEC / HZ);
+
+
+	/* compensate for lost ticks */
+	if (lost >= 2)
+		jiffies_64 += lost - 1;
+
+	/* don't calculate delay for first run,
+	   or if we've got less then a tick */
+	if (first_run || (lost < 1)) {
+		first_run = 0;
+		offset_delay = 0;
+	}
+}
+
+
+static unsigned long long monotonic_clock_pmtmr(void)
+{
+	u32 last_offset, this_offset;
+	unsigned long long base, ret;
+	unsigned seq;
+
+
+	/* atomically read monotonic base & last_offset */
+	do {
+		seq = read_seqbegin(&monotonic_lock);
+		last_offset = offset_tick;
+		base = monotonic_base;
+	} while (read_seqretry(&monotonic_lock, seq));
+
+	/* Read the pmtmr */
+	this_offset =  read_pmtmr();
+
+	/* convert to nanoseconds */
+	ret = (this_offset - last_offset) & ACPI_PM_MASK;
+	ret = base + (cyc2us(ret) * NSEC_PER_USEC);
+	return ret;
+}
+
+static void delay_pmtmr(unsigned long loops)
+{
+	unsigned long bclock, now;
+
+	rdtscl(bclock);
+	do
+	{
+		rep_nop();
+		rdtscl(now);
+	} while ((now-bclock) < loops);
+}
+
+
+/*
+ * get the offset (in microseconds) from the last call to mark_offset()
+ *	- Called holding a reader xtime_lock
+ */
+static unsigned long get_offset_pmtmr(void)
+{
+	u32 now, offset, delta = 0;
+
+	offset = offset_tick;
+	now = read_pmtmr();
+	delta = (now - offset)&ACPI_PM_MASK;
+
+	return (unsigned long) offset_delay + cyc2us(delta);
+}
+
+
+/* acpi timer_opts struct */
+struct timer_opts timer_pmtmr = {
+	.name			= "pmtmr",
+	.init 			= init_pmtmr,
+	.mark_offset		= mark_offset_pmtmr,
+	.get_offset		= get_offset_pmtmr,
+	.monotonic_clock 	= monotonic_clock_pmtmr,
+	.delay 			= delay_pmtmr,
+};
+
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Dominik Brodowski <linux@brodo.de>");
+MODULE_DESCRIPTION("Power Management Timer (PMTMR) as primary timing source for x86");
--- diff/arch/i386/lib/kgdb_serial.c	1970-01-01 01:00:00.000000000 +0100
+++ source/arch/i386/lib/kgdb_serial.c	2004-02-09 10:39:50.000000000 +0000
@@ -0,0 +1,499 @@
+/*
+ * Serial interface GDB stub
+ *
+ * Written (hacked together) by David Grothe (dave@gcom.com)
+ * Modified to allow invokation early in boot see also
+ * kgdb.h for instructions by George Anzinger(george@mvista.com)
+ * Modified to handle debugging over ethernet by Robert Walsh
+ * <rjwalsh@durables.org> and wangdi <wangdi@clusterfs.com>, based on
+ * code by San Mehat.
+ *
+ */
+
+#include <linux/module.h>
+#include <linux/errno.h>
+#include <linux/signal.h>
+#include <linux/sched.h>
+#include <linux/timer.h>
+#include <linux/interrupt.h>
+#include <linux/tty.h>
+#include <linux/tty_flip.h>
+#include <linux/serial.h>
+#include <linux/serial_reg.h>
+#include <linux/config.h>
+#include <linux/major.h>
+#include <linux/string.h>
+#include <linux/fcntl.h>
+#include <linux/ptrace.h>
+#include <linux/ioport.h>
+#include <linux/mm.h>
+#include <linux/init.h>
+#include <linux/highmem.h>
+#include <asm/system.h>
+#include <asm/io.h>
+#include <asm/segment.h>
+#include <asm/bitops.h>
+#include <asm/system.h>
+#include <asm/kgdb_local.h>
+#ifdef CONFIG_KGDB_USER_CONSOLE
+extern void kgdb_console_finit(void);
+#endif
+#define PRNT_off
+#define TEST_EXISTANCE
+#ifdef PRNT
+#define dbprintk(s) printk s
+#else
+#define dbprintk(s)
+#endif
+#define TEST_INTERRUPT_off
+#ifdef TEST_INTERRUPT
+#define intprintk(s) printk s
+#else
+#define intprintk(s)
+#endif
+
+#define IRQ_T(info) ((info->flags & ASYNC_SHARE_IRQ) ? SA_SHIRQ : SA_INTERRUPT)
+
+#define	GDB_BUF_SIZE	512	/* power of 2, please */
+
+static char gdb_buf[GDB_BUF_SIZE];
+static int gdb_buf_in_inx;
+static atomic_t gdb_buf_in_cnt;
+static int gdb_buf_out_inx;
+
+struct async_struct *gdb_async_info;
+static int gdb_async_irq;
+
+#define outb_px(a,b) outb_p(b,a)
+
+static void program_uart(struct async_struct *info);
+static void write_char(struct async_struct *info, int chr);
+/*
+ * Get a byte from the hardware data buffer and return it
+ */
+static int
+read_data_bfr(struct async_struct *info)
+{
+	char it = inb_p(info->port + UART_LSR);
+
+	if (it & UART_LSR_DR)
+		return (inb_p(info->port + UART_RX));
+	/*
+	 * If we have a framing error assume somebody messed with
+	 * our uart.  Reprogram it and send '-' both ways...
+	 */
+	if (it & 0xc) {
+		program_uart(info);
+		write_char(info, '-');
+		return ('-');
+	}
+	return (-1);
+
+}				/* read_data_bfr */
+
+/*
+ * Get a char if available, return -1 if nothing available.
+ * Empty the receive buffer first, then look at the interface hardware.
+
+ * Locking here is a bit of a problem.	We MUST not lock out communication
+ * if we are trying to talk to gdb about a kgdb entry.	ON the other hand
+ * we can loose chars in the console pass thru if we don't lock.  It is also
+ * possible that we could hold the lock or be waiting for it when kgdb
+ * NEEDS to talk.  Since kgdb locks down the world, it does not need locks.
+ * We do, of course have possible issues with interrupting a uart operation,
+ * but we will just depend on the uart status to help keep that straight.
+
+ */
+static spinlock_t uart_interrupt_lock = SPIN_LOCK_UNLOCKED;
+#ifdef CONFIG_SMP
+extern spinlock_t kgdb_spinlock;
+#endif
+
+static int
+read_char(struct async_struct *info)
+{
+	int chr;
+	unsigned long flags;
+	local_irq_save(flags);
+#ifdef CONFIG_SMP
+	if (!spin_is_locked(&kgdb_spinlock)) {
+		spin_lock(&uart_interrupt_lock);
+	}
+#endif
+	if (atomic_read(&gdb_buf_in_cnt) != 0) {	/* intr routine has q'd chars */
+		chr = gdb_buf[gdb_buf_out_inx++];
+		gdb_buf_out_inx &= (GDB_BUF_SIZE - 1);
+		atomic_dec(&gdb_buf_in_cnt);
+	} else {
+		chr = read_data_bfr(info);
+	}
+#ifdef CONFIG_SMP
+	if (!spin_is_locked(&kgdb_spinlock)) {
+		spin_unlock(&uart_interrupt_lock);
+	}
+#endif
+	local_irq_restore(flags);
+	return (chr);
+}
+
+/*
+ * Wait until the interface can accept a char, then write it.
+ */
+static void
+write_char(struct async_struct *info, int chr)
+{
+	while (!(inb_p(info->port + UART_LSR) & UART_LSR_THRE)) ;
+
+	outb_p(chr, info->port + UART_TX);
+
+}				/* write_char */
+
+/*
+ * Mostly we don't need a spinlock, but since the console goes
+ * thru here with interrutps on, well, we need to catch those
+ * chars.
+ */
+/*
+ * This is the receiver interrupt routine for the GDB stub.
+ * It will receive a limited number of characters of input
+ * from the gdb  host machine and save them up in a buffer.
+ *
+ * When the gdb stub routine tty_getDebugChar() is called it
+ * draws characters out of the buffer until it is empty and
+ * then reads directly from the serial port.
+ *
+ * We do not attempt to write chars from the interrupt routine
+ * since the stubs do all of that via tty_putDebugChar() which
+ * writes one byte after waiting for the interface to become
+ * ready.
+ *
+ * The debug stubs like to run with interrupts disabled since,
+ * after all, they run as a consequence of a breakpoint in
+ * the kernel.
+ *
+ * Perhaps someone who knows more about the tty driver than I
+ * care to learn can make this work for any low level serial
+ * driver.
+ */
+static irqreturn_t
+gdb_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+{
+	struct async_struct *info;
+	unsigned long flags;
+
+	info = gdb_async_info;
+	if (!info || !info->tty || irq != gdb_async_irq)
+		return IRQ_NONE;
+
+	local_irq_save(flags);
+	spin_lock(&uart_interrupt_lock);
+	do {
+		int chr = read_data_bfr(info);
+		intprintk(("Debug char on int: %x hex\n", chr));
+		if (chr < 0)
+			continue;
+
+		if (chr == 3) {	/* Ctrl-C means remote interrupt */
+			BREAKPOINT;
+			continue;
+		}
+
+		if (atomic_read(&gdb_buf_in_cnt) >= GDB_BUF_SIZE) {
+			/* buffer overflow tosses early char */
+			read_char(info);
+		}
+		gdb_buf[gdb_buf_in_inx++] = chr;
+		gdb_buf_in_inx &= (GDB_BUF_SIZE - 1);
+	} while (inb_p(info->port + UART_IIR) & UART_IIR_RDI);
+	spin_unlock(&uart_interrupt_lock);
+	local_irq_restore(flags);
+	return IRQ_HANDLED;
+}				/* gdb_interrupt */
+
+/*
+ * Just a NULL routine for testing.
+ */
+void
+gdb_null(void)
+{
+}				/* gdb_null */
+
+/* These structure are filled in with values defined in asm/kgdb_local.h
+ */
+static struct serial_state state = SB_STATE;
+static struct async_struct local_info = SB_INFO;
+static int ok_to_enable_ints = 0;
+static void kgdb_enable_ints_now(void);
+
+extern char *kgdb_version;
+/*
+ * Hook an IRQ for KGDB.
+ *
+ * This routine is called from tty_putDebugChar, below.
+ */
+static int ints_disabled = 1;
+int
+gdb_hook_interrupt(struct async_struct *info, int verb)
+{
+	struct serial_state *state = info->state;
+	unsigned long flags;
+	int port;
+#ifdef TEST_EXISTANCE
+	int scratch, scratch2;
+#endif
+
+	/* The above fails if memory managment is not set up yet.
+	 * Rather than fail the set up, just keep track of the fact
+	 * and pick up the interrupt thing later.
+	 */
+	gdb_async_info = info;
+	port = gdb_async_info->port;
+	gdb_async_irq = state->irq;
+	if (verb) {
+		printk("kgdb %s : port =%x, IRQ=%d, divisor =%d\n",
+		       kgdb_version,
+		       port,
+		       gdb_async_irq, gdb_async_info->state->custom_divisor);
+	}
+	local_irq_save(flags);
+#ifdef TEST_EXISTANCE
+	/* Existance test */
+	/* Should not need all this, but just in case.... */
+
+	scratch = inb_p(port + UART_IER);
+	outb_px(port + UART_IER, 0);
+	outb_px(0xff, 0x080);
+	scratch2 = inb_p(port + UART_IER);
+	outb_px(port + UART_IER, scratch);
+	if (scratch2) {
+		printk
+		    ("gdb_hook_interrupt: Could not clear IER, not a UART!\n");
+		local_irq_restore(flags);
+		return 1;	/* We failed; there's nothing here */
+	}
+	scratch2 = inb_p(port + UART_LCR);
+	outb_px(port + UART_LCR, 0xBF);	/* set up for StarTech test */
+	outb_px(port + UART_EFR, 0);	/* EFR is the same as FCR */
+	outb_px(port + UART_LCR, 0);
+	outb_px(port + UART_FCR, UART_FCR_ENABLE_FIFO);
+	scratch = inb_p(port + UART_IIR) >> 6;
+	if (scratch == 1) {
+		printk("gdb_hook_interrupt: Undefined UART type!"
+		       "  Not a UART! \n");
+		local_irq_restore(flags);
+		return 1;
+	} else {
+		dbprintk(("gdb_hook_interrupt: UART type "
+			  "is %d where 0=16450, 2=16550 3=16550A\n", scratch));
+	}
+	scratch = inb_p(port + UART_MCR);
+	outb_px(port + UART_MCR, UART_MCR_LOOP | scratch);
+	outb_px(port + UART_MCR, UART_MCR_LOOP | 0x0A);
+	scratch2 = inb_p(port + UART_MSR) & 0xF0;
+	outb_px(port + UART_MCR, scratch);
+	if (scratch2 != 0x90) {
+		printk("gdb_hook_interrupt: "
+		       "Loop back test failed! Not a UART!\n");
+		local_irq_restore(flags);
+		return scratch2 + 1000;	/* force 0 to fail */
+	}
+#endif				/* test existance */
+	program_uart(info);
+	local_irq_restore(flags);
+
+	return (0);
+
+}				/* gdb_hook_interrupt */
+
+static void
+program_uart(struct async_struct *info)
+{
+	int port = info->port;
+
+	(void) inb_p(port + UART_RX);
+	outb_px(port + UART_IER, 0);
+
+	(void) inb_p(port + UART_RX);	/* serial driver comments say */
+	(void) inb_p(port + UART_IIR);	/* this clears the interrupt regs */
+	(void) inb_p(port + UART_MSR);
+	outb_px(port + UART_LCR, UART_LCR_WLEN8 | UART_LCR_DLAB);
+	outb_px(port + UART_DLL, info->state->custom_divisor & 0xff);	/* LS */
+	outb_px(port + UART_DLM, info->state->custom_divisor >> 8);	/* MS  */
+	outb_px(port + UART_MCR, info->MCR);
+
+	outb_px(port + UART_FCR, UART_FCR_ENABLE_FIFO | UART_FCR_TRIGGER_1 | UART_FCR_CLEAR_XMIT | UART_FCR_CLEAR_RCVR);	/* set fcr */
+	outb_px(port + UART_LCR, UART_LCR_WLEN8);	/* reset DLAB */
+	outb_px(port + UART_FCR, UART_FCR_ENABLE_FIFO | UART_FCR_TRIGGER_1);	/* set fcr */
+	if (!ints_disabled) {
+		intprintk(("KGDB: Sending %d to port %x offset %d\n",
+			   gdb_async_info->IER,
+			   (int) gdb_async_info->port, UART_IER));
+		outb_px(gdb_async_info->port + UART_IER, gdb_async_info->IER);
+	}
+	return;
+}
+
+/*
+ * tty_getDebugChar
+ *
+ * This is a GDB stub routine.	It waits for a character from the
+ * serial interface and then returns it.  If there is no serial
+ * interface connection then it returns a bogus value which will
+ * almost certainly cause the system to hang.  In the
+ */
+int kgdb_in_isr = 0;
+int kgdb_in_lsr = 0;
+extern spinlock_t kgdb_spinlock;
+
+/* Caller takes needed protections */
+
+int
+tty_getDebugChar(void)
+{
+	volatile int chr, dum, time, end_time;
+
+	dbprintk(("tty_getDebugChar(port %x): ", gdb_async_info->port));
+
+	if (gdb_async_info == NULL) {
+		gdb_hook_interrupt(&local_info, 0);
+	}
+	/*
+	 * This trick says if we wait a very long time and get
+	 * no char, return the -1 and let the upper level deal
+	 * with it.
+	 */
+	rdtsc(dum, time);
+	end_time = time + 2;
+	while (((chr = read_char(gdb_async_info)) == -1) &&
+	       (end_time - time) > 0) {
+		rdtsc(dum, time);
+	};
+	/*
+	 * This covers our butts if some other code messes with
+	 * our uart, hay, it happens :o)
+	 */
+	if (chr == -1)
+		program_uart(gdb_async_info);
+
+	dbprintk(("%c\n", chr > ' ' && chr < 0x7F ? chr : ' '));
+	return (chr);
+
+}				/* tty_getDebugChar */
+
+static int count = 3;
+static spinlock_t one_at_atime = SPIN_LOCK_UNLOCKED;
+
+static int __init
+kgdb_enable_ints(void)
+{
+	if (kgdboe) {
+		return 0;
+	}
+	if (gdb_async_info == NULL) {
+		gdb_hook_interrupt(&local_info, 1);
+	}
+	ok_to_enable_ints = 1;
+	kgdb_enable_ints_now();
+#ifdef CONFIG_KGDB_USER_CONSOLE
+	kgdb_console_finit();
+#endif
+	return 0;
+}
+
+#ifdef CONFIG_SERIAL_8250
+void shutdown_for_kgdb(struct async_struct *gdb_async_info);
+#endif
+
+#ifdef CONFIG_DISCONTIGMEM
+static inline int kgdb_mem_init_done(void)
+{
+	return highmem_start_page != NULL;
+}
+#else
+static inline int kgdb_mem_init_done(void)
+{
+	return max_mapnr != 0;
+}
+#endif
+
+static void
+kgdb_enable_ints_now(void)
+{
+	if (!spin_trylock(&one_at_atime))
+		return;
+	if (!ints_disabled)
+		goto exit;
+	if (kgdb_mem_init_done() &&
+			ints_disabled) {	/* don't try till mem init */
+#ifdef CONFIG_SERIAL_8250
+		/*
+		 * The ifdef here allows the system to be configured
+		 * without the serial driver.
+		 * Don't make it a module, however, it will steal the port
+		 */
+		shutdown_for_kgdb(gdb_async_info);
+#endif
+		ints_disabled = request_irq(gdb_async_info->state->irq,
+					    gdb_interrupt,
+					    IRQ_T(gdb_async_info),
+					    "KGDB-stub", NULL);
+		intprintk(("KGDB: request_irq returned %d\n", ints_disabled));
+	}
+	if (!ints_disabled) {
+		intprintk(("KGDB: Sending %d to port %x offset %d\n",
+			   gdb_async_info->IER,
+			   (int) gdb_async_info->port, UART_IER));
+		outb_px(gdb_async_info->port + UART_IER, gdb_async_info->IER);
+	}
+      exit:
+	spin_unlock(&one_at_atime);
+}
+
+/*
+ * tty_putDebugChar
+ *
+ * This is a GDB stub routine.	It waits until the interface is ready
+ * to transmit a char and then sends it.  If there is no serial
+ * interface connection then it simply returns to its caller, having
+ * pretended to send the char.	Caller takes needed protections.
+ */
+void
+tty_putDebugChar(int chr)
+{
+	dbprintk(("tty_putDebugChar(port %x): chr=%02x '%c', ints_on=%d\n",
+		  gdb_async_info->port,
+		  chr,
+		  chr > ' ' && chr < 0x7F ? chr : ' ', ints_disabled ? 0 : 1));
+
+	if (gdb_async_info == NULL) {
+		gdb_hook_interrupt(&local_info, 0);
+	}
+
+	write_char(gdb_async_info, chr);	/* this routine will wait */
+	count = (chr == '#') ? 0 : count + 1;
+	if ((count == 2)) {	/* try to enable after */
+		if (ints_disabled & ok_to_enable_ints)
+			kgdb_enable_ints_now();	/* try to enable after */
+
+		/* We do this a lot because, well we really want to get these
+		 * interrupts.	The serial driver will clear these bits when it
+		 * initializes the chip.  Every thing else it does is ok,
+		 * but this.
+		 */
+		if (!ints_disabled) {
+			outb_px(gdb_async_info->port + UART_IER,
+				gdb_async_info->IER);
+		}
+	}
+
+}				/* tty_putDebugChar */
+
+/*
+ * This does nothing for the serial port, since it doesn't buffer.
+ */
+
+void tty_flushDebugChar(void)
+{
+}
+
+module_init(kgdb_enable_ints);
--- diff/arch/i386/pci/mmconfig.c	1970-01-01 01:00:00.000000000 +0100
+++ source/arch/i386/pci/mmconfig.c	2004-02-09 10:39:50.000000000 +0000
@@ -0,0 +1,115 @@
+/*
+ * mmconfig.c - Low-level direct PCI config space access via MMCONFIG
+ */
+
+#include <linux/pci.h>
+#include <linux/init.h>
+#include "pci.h"
+
+/* The physical address of the MMCONFIG aperture.  Set from ACPI tables. */
+u32 pci_mmcfg_base_addr;
+
+#define mmcfg_virt_addr (fix_to_virt(FIX_PCIE_MCFG))
+
+/* The base address of the last MMCONFIG device accessed */
+static u32 mmcfg_last_accessed_device;
+
+/*
+ * Functions for accessing PCI configuration space with MMCONFIG accesses
+ */
+
+static inline void pci_exp_set_dev_base(int bus, int devfn)
+{
+	u32 dev_base = pci_mmcfg_base_addr | (bus << 20) | (devfn << 12);
+	if (dev_base != mmcfg_last_accessed_device) {
+		mmcfg_last_accessed_device = dev_base;
+		set_fixmap(FIX_PCIE_MCFG, dev_base);
+	}
+}
+
+static int pci_mmcfg_read(int seg, int bus, int devfn, int reg, int len, u32 *value)
+{
+	unsigned long flags;
+
+	if (!value || (bus > 255) || (devfn > 255) || (reg > 4095))
+		return -EINVAL;
+
+	spin_lock_irqsave(&pci_config_lock, flags);
+
+	pci_exp_set_dev_base(bus, devfn);
+
+	switch (len) {
+	case 1:
+		*value = readb(mmcfg_virt_addr + reg);
+		break;
+	case 2:
+		*value = readw(mmcfg_virt_addr + reg);
+		break;
+	case 4:
+		*value = readl(mmcfg_virt_addr + reg);
+		break;
+	}
+
+	spin_unlock_irqrestore(&pci_config_lock, flags);
+
+	return 0;
+}
+
+static int pci_mmcfg_write(int seg, int bus, int devfn, int reg, int len, u32 value)
+{
+	unsigned long flags;
+
+	if ((bus > 255) || (devfn > 255) || (reg > 4095))
+		return -EINVAL;
+
+	spin_lock_irqsave(&pci_config_lock, flags);
+
+	pci_exp_set_dev_base(bus, devfn);
+
+	switch (len) {
+	case 1:
+		writeb(value, mmcfg_virt_addr + reg);
+		break;
+	case 2:
+		writew(value, mmcfg_virt_addr + reg);
+		break;
+	case 4:
+		writel(value, mmcfg_virt_addr + reg);
+		break;
+	}
+
+	/* Dummy read to flush PCI write */
+	readl(mmcfg_virt_addr);
+
+	spin_unlock_irqrestore(&pci_config_lock, flags);
+
+	return 0;
+}
+
+static struct pci_raw_ops pci_mmcfg = {
+	.read =		pci_mmcfg_read,
+	.write =	pci_mmcfg_write,
+};
+
+static int __init pci_mmcfg_init(void)
+{
+	struct resource *region;
+
+	if ((pci_probe & PCI_PROBE_MMCONF) == 0)
+		goto out;
+	if (!pci_mmcfg_base_addr)
+		goto out;
+	region = request_mem_region(pci_mmcfg_base_addr, 256 * 1024 * 1024,
+			"PCI MMCONFIG");
+	if (!region)
+		goto out;
+
+	printk(KERN_INFO "PCI: Using MMCONFIG\n");
+	raw_pci_ops = &pci_mmcfg;
+	pci_probe = (pci_probe & ~PCI_PROBE_MASK) | PCI_PROBE_MMCONF;
+
+ out:
+	return 0;
+}
+
+arch_initcall(pci_mmcfg_init);
--- diff/arch/ppc/configs/g5_defconfig	1970-01-01 01:00:00.000000000 +0100
+++ source/arch/ppc/configs/g5_defconfig	2004-02-09 10:39:51.000000000 +0000
@@ -0,0 +1,1383 @@
+#
+# Automatically generated make config: don't edit
+#
+CONFIG_MMU=y
+CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+CONFIG_HAVE_DEC_LOCK=y
+CONFIG_PPC=y
+CONFIG_PPC32=y
+CONFIG_GENERIC_NVRAM=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=y
+# CONFIG_BSD_PROCESS_ACCT is not set
+CONFIG_SYSCTL=y
+CONFIG_LOG_BUF_SHIFT=17
+# 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
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+
+#
+# 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=y
+
+#
+# Processor
+#
+# CONFIG_6xx is not set
+# CONFIG_40x is not set
+# CONFIG_44x is not set
+# CONFIG_POWER3 is not set
+CONFIG_POWER4=y
+# CONFIG_8xx is not set
+CONFIG_ALTIVEC=y
+# CONFIG_CPU_FREQ is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
+CONFIG_PPC64BRIDGE=y
+CONFIG_PPC_STD_MMU=y
+
+#
+# Platform options
+#
+CONFIG_PPC_MULTIPLATFORM=y
+# CONFIG_APUS is not set
+# CONFIG_WILLOW is not set
+# CONFIG_PCORE is not set
+# CONFIG_POWERPMC250 is not set
+# CONFIG_EV64260 is not set
+# CONFIG_SPRUCE is not set
+# CONFIG_LOPEC is not set
+# CONFIG_MCPN765 is not set
+# CONFIG_MVME5100 is not set
+# CONFIG_PPLUS is not set
+# CONFIG_PRPMC750 is not set
+# CONFIG_PRPMC800 is not set
+# CONFIG_SANDPOINT is not set
+# CONFIG_ADIR is not set
+# CONFIG_K2 is not set
+# CONFIG_PAL4 is not set
+# CONFIG_GEMINI is not set
+# CONFIG_EST8260 is not set
+# CONFIG_SBS8260 is not set
+# CONFIG_RPX6 is not set
+# CONFIG_TQM8260 is not set
+CONFIG_PPC_CHRP=y
+CONFIG_PPC_PMAC=y
+CONFIG_PPC_PREP=y
+CONFIG_PPC_OF=y
+CONFIG_PPCBUG_NVRAM=y
+CONFIG_SMP=y
+CONFIG_IRQ_ALL_CPUS=y
+CONFIG_NR_CPUS=4
+CONFIG_HIGHMEM=y
+CONFIG_KERNEL_ELF=y
+CONFIG_BINFMT_ELF=y
+CONFIG_BINFMT_MISC=m
+CONFIG_PROC_DEVICETREE=y
+# CONFIG_PPC_RTAS is not set
+# CONFIG_PREP_RESIDUAL is not set
+# CONFIG_CMDLINE_BOOL is not set
+
+#
+# Bus options
+#
+# CONFIG_ISA is not set
+CONFIG_GENERIC_ISA_DMA=y
+CONFIG_PCI=y
+CONFIG_PCI_DOMAINS=y
+# CONFIG_PCI_LEGACY_PROC is not set
+CONFIG_PCI_NAMES=y
+CONFIG_HOTPLUG=y
+
+#
+# PCMCIA/CardBus support
+#
+CONFIG_PCMCIA=m
+CONFIG_YENTA=m
+CONFIG_CARDBUS=y
+# CONFIG_I82092 is not set
+# CONFIG_TCIC is not set
+
+#
+# Advanced setup
+#
+CONFIG_ADVANCED_OPTIONS=y
+# CONFIG_HIGHMEM_START_BOOL is not set
+CONFIG_HIGHMEM_START=0xfe000000
+# CONFIG_LOWMEM_SIZE_BOOL is not set
+CONFIG_LOWMEM_SIZE=0x30000000
+# CONFIG_KERNEL_START_BOOL is not set
+CONFIG_KERNEL_START=0xc0000000
+CONFIG_TASK_SIZE_BOOL=y
+CONFIG_TASK_SIZE=0x80000000
+CONFIG_BOOT_LOAD=0x00800000
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_FW_LOADER=y
+
+#
+# Memory Technology Devices (MTD)
+#
+# CONFIG_MTD is not set
+
+#
+# Parallel port support
+#
+# CONFIG_PARPORT 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=y
+CONFIG_BLK_DEV_CRYPTOLOOP=y
+CONFIG_BLK_DEV_NBD=m
+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=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_IDECS is not set
+CONFIG_BLK_DEV_IDECD=y
+# CONFIG_BLK_DEV_IDETAPE is not set
+CONFIG_BLK_DEV_IDEFLOPPY=y
+CONFIG_BLK_DEV_IDESCSI=y
+# 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=y
+# CONFIG_BLK_DEV_OPTI621 is not set
+# CONFIG_BLK_DEV_SL82C105 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_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_IDE_PMAC=y
+CONFIG_BLK_DEV_IDE_PMAC_ATA100FIRST=y
+CONFIG_BLK_DEV_IDEDMA_PMAC=y
+CONFIG_BLK_DEV_IDE_PMAC_BLINK=y
+CONFIG_BLK_DEV_IDEDMA_PMAC_AUTO=y
+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
+
+#
+# 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=y
+# CONFIG_CHR_DEV_OSST is not set
+CONFIG_BLK_DEV_SR=y
+CONFIG_BLK_DEV_SR_VENDOR=y
+CONFIG_CHR_DEV_SG=y
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+# CONFIG_SCSI_MULTI_LUN is not set
+# CONFIG_SCSI_REPORT_LUNS is not set
+CONFIG_SCSI_CONSTANTS=y
+# 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=y
+CONFIG_AIC7XXX_CMDS_PER_DEVICE=253
+CONFIG_AIC7XXX_RESET_DELAY_MS=15000
+# CONFIG_AIC7XXX_BUILD_FIRMWARE is not set
+CONFIG_AIC7XXX_DEBUG_ENABLE=y
+CONFIG_AIC7XXX_DEBUG_MASK=0
+CONFIG_AIC7XXX_REG_PRETTY_PRINT=y
+# 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=y
+CONFIG_SCSI_SATA_SVW=y
+# CONFIG_SCSI_ATA_PIIX is not set
+# CONFIG_SCSI_SATA_PROMISE is not set
+# CONFIG_SCSI_SATA_SIL 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
+# 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_INITIO 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_QLA21XX is not set
+# CONFIG_SCSI_QLA22XX is not set
+# CONFIG_SCSI_QLA23XX is not set
+# CONFIG_SCSI_DC395x is not set
+# CONFIG_SCSI_DC390T is not set
+# CONFIG_SCSI_NSP32 is not set
+# CONFIG_SCSI_DEBUG is not set
+# CONFIG_SCSI_MESH is not set
+# CONFIG_SCSI_MAC53C94 is not set
+
+#
+# PCMCIA SCSI adapter support
+#
+# CONFIG_PCMCIA_AHA152X is not set
+# CONFIG_PCMCIA_FDOMAIN is not set
+# CONFIG_PCMCIA_NINJA_SCSI is not set
+# CONFIG_PCMCIA_QLOGIC is not set
+
+#
+# Multi-device support (RAID and LVM)
+#
+# CONFIG_MD is not set
+
+#
+# Fusion MPT device support
+#
+# CONFIG_FUSION is not set
+
+#
+# IEEE 1394 (FireWire) support (EXPERIMENTAL)
+#
+CONFIG_IEEE1394=y
+
+#
+# Subsystem Options
+#
+# CONFIG_IEEE1394_VERBOSEDEBUG is not set
+CONFIG_IEEE1394_OUI_DB=y
+
+#
+# Device Drivers
+#
+# CONFIG_IEEE1394_PCILYNX is not set
+CONFIG_IEEE1394_OHCI1394=y
+
+#
+# Protocol Drivers
+#
+CONFIG_IEEE1394_VIDEO1394=m
+CONFIG_IEEE1394_SBP2=m
+# CONFIG_IEEE1394_SBP2_PHYS_DMA is not set
+CONFIG_IEEE1394_ETH1394=m
+CONFIG_IEEE1394_DV1394=m
+CONFIG_IEEE1394_RAWIO=m
+# CONFIG_IEEE1394_CMP is not set
+
+#
+# I2O device support
+#
+# CONFIG_I2O is not set
+
+#
+# Macintosh device drivers
+#
+CONFIG_ADB_PMU=y
+# CONFIG_PMAC_PBOOK is not set
+# CONFIG_PMAC_BACKLIGHT is not set
+# CONFIG_MAC_SERIAL is not set
+CONFIG_ADB=y
+CONFIG_INPUT_ADBHID=y
+CONFIG_MAC_EMUMOUSEBTN=y
+CONFIG_THERM_PM72=y
+
+#
+# Networking support
+#
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+# CONFIG_PACKET_MMAP is not set
+# CONFIG_NETLINK_DEV is not set
+CONFIG_UNIX=y
+CONFIG_NET_KEY=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=y
+CONFIG_INET_AH=y
+CONFIG_INET_ESP=y
+CONFIG_INET_IPCOMP=y
+
+#
+# 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 is not set
+
+#
+# IP: Netfilter Configuration
+#
+CONFIG_IP_NF_CONNTRACK=m
+CONFIG_IP_NF_FTP=m
+CONFIG_IP_NF_IRC=m
+CONFIG_IP_NF_TFTP=m
+CONFIG_IP_NF_AMANDA=m
+CONFIG_IP_NF_QUEUE=m
+CONFIG_IP_NF_IPTABLES=m
+CONFIG_IP_NF_MATCH_LIMIT=m
+CONFIG_IP_NF_MATCH_IPRANGE=m
+CONFIG_IP_NF_MATCH_MAC=m
+CONFIG_IP_NF_MATCH_PKTTYPE=m
+CONFIG_IP_NF_MATCH_MARK=m
+CONFIG_IP_NF_MATCH_MULTIPORT=m
+CONFIG_IP_NF_MATCH_TOS=m
+CONFIG_IP_NF_MATCH_RECENT=m
+CONFIG_IP_NF_MATCH_ECN=m
+CONFIG_IP_NF_MATCH_DSCP=m
+CONFIG_IP_NF_MATCH_AH_ESP=m
+CONFIG_IP_NF_MATCH_LENGTH=m
+CONFIG_IP_NF_MATCH_TTL=m
+CONFIG_IP_NF_MATCH_TCPMSS=m
+CONFIG_IP_NF_MATCH_HELPER=m
+CONFIG_IP_NF_MATCH_STATE=m
+CONFIG_IP_NF_MATCH_CONNTRACK=m
+CONFIG_IP_NF_MATCH_OWNER=m
+CONFIG_IP_NF_FILTER=m
+CONFIG_IP_NF_TARGET_REJECT=m
+CONFIG_IP_NF_NAT=m
+CONFIG_IP_NF_NAT_NEEDED=y
+CONFIG_IP_NF_TARGET_MASQUERADE=m
+CONFIG_IP_NF_TARGET_REDIRECT=m
+CONFIG_IP_NF_TARGET_NETMAP=m
+CONFIG_IP_NF_TARGET_SAME=m
+# CONFIG_IP_NF_NAT_LOCAL is not set
+CONFIG_IP_NF_NAT_SNMP_BASIC=m
+CONFIG_IP_NF_NAT_IRC=m
+CONFIG_IP_NF_NAT_FTP=m
+CONFIG_IP_NF_NAT_TFTP=m
+CONFIG_IP_NF_NAT_AMANDA=m
+CONFIG_IP_NF_MANGLE=m
+CONFIG_IP_NF_TARGET_TOS=m
+CONFIG_IP_NF_TARGET_ECN=m
+CONFIG_IP_NF_TARGET_DSCP=m
+CONFIG_IP_NF_TARGET_MARK=m
+CONFIG_IP_NF_TARGET_CLASSIFY=m
+CONFIG_IP_NF_TARGET_LOG=m
+CONFIG_IP_NF_TARGET_ULOG=m
+CONFIG_IP_NF_TARGET_TCPMSS=m
+CONFIG_IP_NF_ARPTABLES=m
+CONFIG_IP_NF_ARPFILTER=m
+CONFIG_IP_NF_ARP_MANGLE=m
+# CONFIG_IP_NF_COMPAT_IPCHAINS is not set
+# CONFIG_IP_NF_COMPAT_IPFWADM is not set
+CONFIG_XFRM=y
+CONFIG_XFRM_USER=y
+
+#
+# SCTP Configuration (EXPERIMENTAL)
+#
+CONFIG_IPV6_SCTP__=y
+CONFIG_IP_SCTP=y
+# CONFIG_SCTP_ADLER32 is not set
+# CONFIG_SCTP_DBG_MSG is not set
+# CONFIG_SCTP_DBG_OBJCNT is not set
+# CONFIG_SCTP_HMAC_NONE is not set
+CONFIG_SCTP_HMAC_SHA1=y
+# CONFIG_SCTP_HMAC_MD5 is not set
+CONFIG_ATM=m
+CONFIG_ATM_CLIP=m
+CONFIG_ATM_CLIP_NO_ICMP=y
+# CONFIG_ATM_LANE is not set
+CONFIG_ATM_BR2684=m
+# CONFIG_ATM_BR2684_IPFILTER 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
+
+#
+# Ethernet (10 or 100Mbit)
+#
+CONFIG_NET_ETHERNET=y
+# CONFIG_MII is not set
+# CONFIG_MACE is not set
+# CONFIG_BMAC is not set
+# CONFIG_OAKNET is not set
+# CONFIG_HAPPYMEAL is not set
+CONFIG_SUNGEM=y
+# CONFIG_NET_VENDOR_3COM is not set
+
+#
+# Tulip family network device support
+#
+CONFIG_NET_TULIP=y
+CONFIG_DE2104X=y
+CONFIG_TULIP=y
+# CONFIG_TULIP_MWI is not set
+CONFIG_TULIP_MMIO=y
+# CONFIG_DE4X5 is not set
+# CONFIG_WINBOND_840 is not set
+# CONFIG_DM9102 is not set
+# CONFIG_PCMCIA_XIRCOM is not set
+# CONFIG_PCMCIA_XIRTULIP 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_FORCEDETH 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=m
+CONFIG_PPP_MULTILINK=y
+CONFIG_PPP_FILTER=y
+CONFIG_PPP_ASYNC=m
+CONFIG_PPP_SYNC_TTY=m
+CONFIG_PPP_DEFLATE=m
+CONFIG_PPP_BSDCOMP=m
+CONFIG_PPPOE=m
+CONFIG_PPPOATM=m
+# CONFIG_SLIP is not set
+
+#
+# Wireless LAN (non-hamradio)
+#
+CONFIG_NET_RADIO=y
+
+#
+# Obsolete Wireless cards support (pre-802.11)
+#
+# CONFIG_STRIP is not set
+# CONFIG_PCMCIA_WAVELAN is not set
+# CONFIG_PCMCIA_NETWAVE is not set
+
+#
+# Wireless 802.11 Frequency Hopping cards support
+#
+# CONFIG_PCMCIA_RAYCS is not set
+
+#
+# Wireless 802.11b ISA/PCI cards support
+#
+# CONFIG_AIRO is not set
+CONFIG_HERMES=m
+CONFIG_APPLE_AIRPORT=m
+CONFIG_PLX_HERMES=m
+CONFIG_TMD_HERMES=m
+CONFIG_PCI_HERMES=m
+
+#
+# Wireless 802.11b Pcmcia/Cardbus cards support
+#
+# CONFIG_PCMCIA_HERMES is not set
+CONFIG_AIRO_CS=m
+# CONFIG_PCMCIA_ATMEL is not set
+# CONFIG_PCMCIA_WL3501 is not set
+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 is not set
+
+#
+# ATM drivers
+#
+# CONFIG_ATM_TCP is not set
+# CONFIG_ATM_LANAI is not set
+# CONFIG_ATM_ENI is not set
+# CONFIG_ATM_FIRESTREAM is not set
+# CONFIG_ATM_ZATM is not set
+# CONFIG_ATM_NICSTAR is not set
+# CONFIG_ATM_IDT77252 is not set
+# CONFIG_ATM_AMBASSADOR is not set
+# CONFIG_ATM_HORIZON is not set
+# CONFIG_ATM_IA is not set
+# CONFIG_ATM_FORE200E_MAYBE is not set
+# CONFIG_ATM_HE is not set
+
+#
+# Amateur Radio support
+#
+# CONFIG_HAMRADIO is not set
+
+#
+# IrDA (infrared) support
+#
+# CONFIG_IRDA is not set
+
+#
+# Bluetooth support
+#
+CONFIG_BT=m
+CONFIG_BT_L2CAP=m
+CONFIG_BT_SCO=m
+CONFIG_BT_RFCOMM=m
+CONFIG_BT_RFCOMM_TTY=y
+CONFIG_BT_BNEP=m
+CONFIG_BT_BNEP_MC_FILTER=y
+CONFIG_BT_BNEP_PROTO_FILTER=y
+
+#
+# Bluetooth device drivers
+#
+CONFIG_BT_HCIUSB=m
+# CONFIG_BT_HCIUSB_SCO is not set
+CONFIG_BT_HCIUART=m
+CONFIG_BT_HCIUART_H4=y
+CONFIG_BT_HCIUART_BCSP=y
+CONFIG_BT_HCIUART_BCSP_TXCRC=y
+# CONFIG_BT_HCIBCM203X is not set
+# CONFIG_BT_HCIBFUSB is not set
+# CONFIG_BT_HCIDTL1 is not set
+# CONFIG_BT_HCIBT3C is not set
+# CONFIG_BT_HCIBLUECARD is not set
+CONFIG_BT_HCIBTUART=m
+# CONFIG_BT_HCIVHCI 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=y
+CONFIG_INPUT_EVBUG=m
+
+#
+# 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=y
+# CONFIG_KEYBOARD_ATKBD is not set
+# 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 is not set
+# CONFIG_MOUSE_SERIAL is not set
+CONFIG_INPUT_JOYSTICK=y
+# CONFIG_JOYSTICK_IFORCE is not set
+# CONFIG_JOYSTICK_WARRIOR is not set
+# CONFIG_JOYSTICK_MAGELLAN is not set
+# CONFIG_JOYSTICK_SPACEORB is not set
+# CONFIG_JOYSTICK_SPACEBALL is not set
+# CONFIG_JOYSTICK_STINGER is not set
+# CONFIG_JOYSTICK_TWIDDLER is not set
+# CONFIG_INPUT_JOYDUMP is not set
+CONFIG_INPUT_TOUCHSCREEN=y
+# CONFIG_TOUCHSCREEN_GUNZE is not set
+CONFIG_INPUT_MISC=y
+# CONFIG_INPUT_PCSPKR is not set
+CONFIG_INPUT_UINPUT=m
+
+#
+# Character devices
+#
+CONFIG_VT=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=m
+CONFIG_SERIAL_8250_CS=m
+CONFIG_SERIAL_8250_NR_UARTS=4
+# CONFIG_SERIAL_8250_EXTENDED is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_SERIAL_PMACZILOG=y
+CONFIG_SERIAL_PMACZILOG_CONSOLE=y
+CONFIG_UNIX98_PTYS=y
+CONFIG_UNIX98_PTY_COUNT=256
+
+#
+# Mice
+#
+CONFIG_BUSMOUSE=y
+# CONFIG_QIC02_TAPE is not set
+
+#
+# IPMI
+#
+# CONFIG_IPMI_HANDLER is not set
+
+#
+# Watchdog Cards
+#
+# CONFIG_WATCHDOG is not set
+CONFIG_NVRAM=y
+CONFIG_GEN_RTC=y
+# CONFIG_GEN_RTC_X is not set
+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM 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
+#
+# CONFIG_SYNCLINK_CS is not set
+# CONFIG_RAW_DRIVER is not set
+
+#
+# I2C support
+#
+CONFIG_I2C=y
+CONFIG_I2C_CHARDEV=y
+
+#
+# I2C Algorithms
+#
+CONFIG_I2C_ALGOBIT=y
+# CONFIG_I2C_ALGOPCF is not set
+
+#
+# I2C Hardware Bus support
+#
+# CONFIG_I2C_ALI1535 is not set
+# CONFIG_I2C_ALI15X3 is not set
+# CONFIG_I2C_AMD756 is not set
+# CONFIG_I2C_AMD8111 is not set
+# CONFIG_I2C_ELV is not set
+# CONFIG_I2C_I801 is not set
+# CONFIG_I2C_I810 is not set
+# CONFIG_I2C_ISA is not set
+CONFIG_I2C_KEYWEST=y
+# CONFIG_I2C_NFORCE2 is not set
+# CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_I2C_PIIX4 is not set
+# CONFIG_I2C_PROSAVAGE is not set
+# CONFIG_I2C_SAVAGE4 is not set
+# CONFIG_SCx200_ACB is not set
+# CONFIG_I2C_SIS5595 is not set
+# CONFIG_I2C_SIS630 is not set
+# CONFIG_I2C_SIS96X is not set
+# CONFIG_I2C_VELLEMAN is not set
+# CONFIG_I2C_VIA is not set
+# CONFIG_I2C_VIAPRO is not set
+# CONFIG_I2C_VOODOO3 is not set
+
+#
+# I2C Hardware Sensors Chip support
+#
+# CONFIG_I2C_SENSOR is not set
+# CONFIG_SENSORS_ADM1021 is not set
+# CONFIG_SENSORS_ASB100 is not set
+# CONFIG_SENSORS_EEPROM is not set
+# CONFIG_SENSORS_IT87 is not set
+# CONFIG_SENSORS_LM75 is not set
+# CONFIG_SENSORS_LM78 is not set
+# CONFIG_SENSORS_LM83 is not set
+# CONFIG_SENSORS_LM85 is not set
+# CONFIG_SENSORS_LM90 is not set
+# CONFIG_SENSORS_VIA686A is not set
+# CONFIG_SENSORS_W83781D is not set
+# CONFIG_SENSORS_W83L785TS is not set
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+# CONFIG_I2C_DEBUG_CHIP is not set
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+
+#
+# Digital Video Broadcasting Devices
+#
+# CONFIG_DVB 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_CONTROL is not set
+# CONFIG_FB_PLATINUM is not set
+# CONFIG_FB_VALKYRIE is not set
+# 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=y
+# CONFIG_FB_MATROX is not set
+CONFIG_FB_RADEON=y
+# 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_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=m
+CONFIG_DMASOUND_PMAC=m
+CONFIG_DMASOUND=m
+
+#
+# Advanced Linux Sound Architecture
+#
+CONFIG_SND=m
+# CONFIG_SND_SEQUENCER is not set
+# CONFIG_SND_OSSEMUL is not set
+# CONFIG_SND_VERBOSE_PRINTK is not set
+# CONFIG_SND_DEBUG is not set
+
+#
+# Generic devices
+#
+# CONFIG_SND_DUMMY is not set
+# CONFIG_SND_MTPAV is not set
+# CONFIG_SND_SERIAL_U16550 is not set
+# CONFIG_SND_MPU401 is not set
+
+#
+# PCI devices
+#
+# CONFIG_SND_ALI5451 is not set
+# CONFIG_SND_AZT3328 is not set
+# CONFIG_SND_CS46XX is not set
+# CONFIG_SND_CS4281 is not set
+# CONFIG_SND_EMU10K1 is not set
+# 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 is not set
+# 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 PowerMac devices
+#
+CONFIG_SND_POWERMAC=m
+
+#
+# ALSA USB devices
+#
+# CONFIG_SND_USB_AUDIO is not set
+
+#
+# PCMCIA devices
+#
+# CONFIG_SND_VXPOCKET is not set
+# CONFIG_SND_VXP440 is not set
+
+#
+# Open Sound System
+#
+# CONFIG_SOUND_PRIME is not set
+
+#
+# USB support
+#
+CONFIG_USB=y
+# 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=y
+CONFIG_USB_OHCI_HCD=y
+# CONFIG_USB_UHCI_HCD is not set
+
+#
+# USB Device Class drivers
+#
+CONFIG_USB_AUDIO=m
+
+#
+# USB Bluetooth TTY can only be used with disabled Bluetooth subsystem
+#
+CONFIG_USB_MIDI=m
+CONFIG_USB_ACM=m
+CONFIG_USB_PRINTER=m
+CONFIG_USB_STORAGE=m
+CONFIG_USB_STORAGE_DEBUG=y
+CONFIG_USB_STORAGE_DATAFAB=y
+CONFIG_USB_STORAGE_FREECOM=y
+CONFIG_USB_STORAGE_ISD200=y
+CONFIG_USB_STORAGE_DPCM=y
+CONFIG_USB_STORAGE_HP8200e=y
+CONFIG_USB_STORAGE_SDDR09=y
+CONFIG_USB_STORAGE_SDDR55=y
+CONFIG_USB_STORAGE_JUMPSHOT=y
+
+#
+# USB Human Interface Devices (HID)
+#
+CONFIG_USB_HID=y
+CONFIG_USB_HIDINPUT=y
+CONFIG_HID_FF=y
+CONFIG_HID_PID=y
+CONFIG_LOGITECH_FF=y
+CONFIG_THRUSTMASTER_FF=y
+CONFIG_USB_HIDDEV=y
+# CONFIG_USB_AIPTEK is not set
+CONFIG_USB_WACOM=m
+# 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=m
+# 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=m
+# 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=m
+# CONFIG_USB_SERIAL_IPAQ is not set
+# CONFIG_USB_SERIAL_IR is not set
+# CONFIG_USB_SERIAL_EDGEPORT is not set
+# CONFIG_USB_SERIAL_EDGEPORT_TI is not set
+# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
+CONFIG_USB_SERIAL_KEYSPAN=m
+# CONFIG_USB_SERIAL_KEYSPAN_MPR is not set
+CONFIG_USB_SERIAL_KEYSPAN_USA28=y
+CONFIG_USB_SERIAL_KEYSPAN_USA28X=y
+# CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set
+CONFIG_USB_SERIAL_KEYSPAN_USA19=y
+CONFIG_USB_SERIAL_KEYSPAN_USA18X=y
+CONFIG_USB_SERIAL_KEYSPAN_USA19W=y
+CONFIG_USB_SERIAL_KEYSPAN_USA19QW=y
+CONFIG_USB_SERIAL_KEYSPAN_USA19QI=y
+CONFIG_USB_SERIAL_KEYSPAN_USA49W=y
+# CONFIG_USB_SERIAL_KEYSPAN_USA49WLC is not set
+# CONFIG_USB_SERIAL_KLSI is not set
+# CONFIG_USB_SERIAL_KOBIL_SCT is not set
+# CONFIG_USB_SERIAL_MCT_U232 is not set
+# CONFIG_USB_SERIAL_PL2303 is not set
+# CONFIG_USB_SERIAL_SAFE is not set
+# CONFIG_USB_SERIAL_CYBERJACK is not set
+# CONFIG_USB_SERIAL_XIRCOM is not set
+# CONFIG_USB_SERIAL_OMNINET is not set
+CONFIG_USB_EZUSB=y
+
+#
+# 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_SPEEDTOUCH is not set
+# CONFIG_USB_TEST is not set
+# CONFIG_USB_GADGET is not set
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+CONFIG_EXT2_FS_XATTR=y
+# CONFIG_EXT2_FS_POSIX_ACL is not set
+# CONFIG_EXT2_FS_SECURITY 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=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 is not set
+# CONFIG_AUTOFS4_FS is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+CONFIG_ISO9660_FS=y
+CONFIG_JOLIET=y
+CONFIG_ZISOFS=y
+CONFIG_ZISOFS_FS=y
+CONFIG_UDF_FS=m
+
+#
+# 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_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=m
+# 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=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
+# CONFIG_NFSD_TCP is not set
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+CONFIG_EXPORTFS=y
+CONFIG_SUNRPC=y
+# CONFIG_SUNRPC_GSS is not set
+CONFIG_SMB_FS=m
+# CONFIG_SMB_NLS_DEFAULT is not set
+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=y
+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 is not set
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
+# CONFIG_EFI_PARTITION is not set
+
+#
+# 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
+# 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=m
+# 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
+
+#
+# Library routines
+#
+CONFIG_CRC32=y
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=y
+
+#
+# Kernel hacking
+#
+CONFIG_DEBUG_KERNEL=y
+CONFIG_DEBUG_SLAB=y
+# CONFIG_MAGIC_SYSRQ is not set
+CONFIG_DEBUG_SPINLOCK=y
+CONFIG_DEBUG_HIGHMEM=y
+CONFIG_DEBUG_SPINLOCK_SLEEP=y
+# CONFIG_KGDB is not set
+CONFIG_XMON=y
+# CONFIG_BDI_SWITCH is not set
+# CONFIG_DEBUG_INFO is not set
+CONFIG_BOOTX_TEXT=y
+
+#
+# Security options
+#
+# CONFIG_SECURITY is not set
+
+#
+# Cryptographic options
+#
+CONFIG_CRYPTO=y
+CONFIG_CRYPTO_HMAC=y
+CONFIG_CRYPTO_NULL=m
+CONFIG_CRYPTO_MD4=m
+CONFIG_CRYPTO_MD5=y
+CONFIG_CRYPTO_SHA1=y
+CONFIG_CRYPTO_SHA256=m
+CONFIG_CRYPTO_SHA512=m
+CONFIG_CRYPTO_DES=y
+CONFIG_CRYPTO_BLOWFISH=m
+CONFIG_CRYPTO_TWOFISH=m
+CONFIG_CRYPTO_SERPENT=m
+CONFIG_CRYPTO_AES=m
+CONFIG_CRYPTO_CAST5=m
+CONFIG_CRYPTO_CAST6=m
+CONFIG_CRYPTO_DEFLATE=y
+# CONFIG_CRYPTO_TEST is not set
--- diff/arch/ppc/kernel/cpu_setup_power4.S	1970-01-01 01:00:00.000000000 +0100
+++ source/arch/ppc/kernel/cpu_setup_power4.S	2004-02-09 10:39:51.000000000 +0000
@@ -0,0 +1,182 @@
+/*
+ * This file contains low level CPU setup functions.
+ *    Copyright (C) 2003 Benjamin Herrenschmidt (benh@kernel.crashing.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.
+ *
+ */
+
+#include <linux/config.h>
+#include <asm/processor.h>
+#include <asm/page.h>
+#include <asm/ppc_asm.h>
+#include <asm/cputable.h>
+#include <asm/ppc_asm.h>
+#include <asm/offsets.h>
+#include <asm/cache.h>
+
+_GLOBAL(__power4_cpu_preinit)
+	/*
+	 * On the PPC970, we have to turn off real-mode cache inhibit
+	 * early, before we first turn the MMU off.
+	 */
+	mfspr	r0,SPRN_PVR
+	srwi	r0,r0,16
+	cmpwi	r0,0x39
+	bnelr
+
+	li	r0,0
+	sync
+	mtspr	SPRN_HID4,r0
+	isync
+	sync
+	mtspr	SPRN_HID5,r0
+	isync
+
+	mfspr	r0,SPRN_HID1
+	li	r11,0x1200		/* enable i-fetch cacheability */
+	sldi	r11,r11,44		/* and prefetch */
+	or	r0,r0,r11
+	mtspr	SPRN_HID1,r0
+	mtspr	SPRN_HID1,r0
+	isync
+	li	r0,0
+	sync
+	mtspr	SPRN_HIOR,0		/* Clear interrupt prefix */
+	isync
+	blr
+
+_GLOBAL(__setup_cpu_power4)
+	blr
+_GLOBAL(__setup_cpu_ppc970)
+	mfspr	r0,SPRN_HID0
+	li	r11,5			/* clear DOZE and SLEEP */
+	rldimi	r0,r11,52,8		/* set NAP and DPM */
+	mtspr	SPRN_HID0,r0
+	mfspr	r0,SPRN_HID0
+	mfspr	r0,SPRN_HID0
+	mfspr	r0,SPRN_HID0
+	mfspr	r0,SPRN_HID0
+	mfspr	r0,SPRN_HID0
+	mfspr	r0,SPRN_HID0
+	sync
+	isync
+	blr
+
+/* Definitions for the table use to save CPU states */
+#define CS_HID0		0
+#define CS_HID1		8
+#define	CS_HID4		16
+#define CS_HID5		24
+#define CS_SIZE		32
+
+	.data
+	.balign	L1_CACHE_LINE_SIZE
+cpu_state_storage:	
+	.space	CS_SIZE
+	.balign	L1_CACHE_LINE_SIZE,0
+	.text
+	
+/* Called in normal context to backup CPU 0 state. This
+ * does not include cache settings. This function is also
+ * called for machine sleep. This does not include the MMU
+ * setup, BATs, etc... but rather the "special" registers
+ * like HID0, HID1, HID4, etc...
+ */
+_GLOBAL(__save_cpu_setup)
+	/* Some CR fields are volatile, we back it up all */
+	mfcr	r7
+
+	/* Get storage ptr */
+	lis	r5,cpu_state_storage@h
+	ori	r5,r5,cpu_state_storage@l
+
+	/* We only deal with 970 for now */
+	mfspr	r0,SPRN_PVR
+	srwi	r0,r0,16
+	cmpwi	r0,0x39
+	bne	1f
+
+	/* Save HID0,1,4 and 5 */
+	mfspr	r3,SPRN_HID0
+	std	r3,CS_HID0(r5)
+	mfspr	r3,SPRN_HID1
+	std	r3,CS_HID1(r5)
+	mfspr	r3,SPRN_HID4
+	std	r3,CS_HID4(r5)
+	mfspr	r3,SPRN_HID5
+	std	r3,CS_HID5(r5)
+	
+1:
+	mtcr	r7
+	blr
+
+/* Called with no MMU context (typically MSR:IR/DR off) to
+ * restore CPU state as backed up by the previous
+ * function. This does not include cache setting
+ */
+_GLOBAL(__restore_cpu_setup)
+	/* Some CR fields are volatile, we back it up all */
+	mfcr	r7
+
+	/* Get storage ptr */
+	lis	r5,(cpu_state_storage-KERNELBASE)@h
+	ori	r5,r5,cpu_state_storage@l
+
+	/* We only deal with 970 for now */
+	mfspr	r0,SPRN_PVR
+	srwi	r0,r0,16
+	cmpwi	r0,0x39
+	bne	1f
+
+	/* Clear interrupt prefix */
+	li	r0,0
+	sync
+	mtspr	SPRN_HIOR,0
+	isync
+
+	/* Restore HID0 */
+	ld	r3,CS_HID0(r5)
+	sync
+	isync
+	mtspr	SPRN_HID0,r3
+	mfspr	r3,SPRN_HID0
+	mfspr	r3,SPRN_HID0
+	mfspr	r3,SPRN_HID0
+	mfspr	r3,SPRN_HID0
+	mfspr	r3,SPRN_HID0
+	mfspr	r3,SPRN_HID0
+	sync
+	isync
+
+	/* Restore HID1 */
+	ld	r3,CS_HID1(r5)
+	sync
+	isync
+	mtspr	SPRN_HID1,r3
+	mtspr	SPRN_HID1,r3
+	sync
+	isync
+	
+	/* Restore HID4 */
+	ld	r3,CS_HID4(r5)
+	sync
+	isync
+	mtspr	SPRN_HID4,r3
+	sync
+	isync
+
+	/* Restore HID5 */
+	ld	r3,CS_HID5(r5)
+	sync
+	isync
+	mtspr	SPRN_HID5,r3
+	sync
+	isync
+1:
+	mtcr	r7
+	blr
+
--- diff/arch/ppc/kernel/smp-tbsync.c	1970-01-01 01:00:00.000000000 +0100
+++ source/arch/ppc/kernel/smp-tbsync.c	2004-02-09 10:39:51.000000000 +0000
@@ -0,0 +1,181 @@
+/*
+ * Smp timebase synchronization for ppc.
+ *
+ * Copyright (C) 2003 Samuel Rydh (samuel@ibrium.se)
+ *
+ */
+
+#include <linux/config.h>
+#include <linux/kernel.h>
+#include <linux/sched.h>
+#include <linux/smp.h>
+#include <linux/unistd.h>
+#include <linux/init.h>
+#include <asm/atomic.h>
+#include <asm/smp.h>
+#include <asm/time.h>
+
+#define NUM_ITER		300
+
+enum {
+	kExit=0, kSetAndTest, kTest
+};
+
+static struct {
+	volatile int		tbu;
+	volatile int		tbl;
+	volatile int		mark;
+	volatile int		cmd;
+	volatile int		handshake;
+	int			filler[3];
+
+	volatile int		ack;
+	int			filler2[7];
+
+	volatile int		race_result;
+} *tbsync;
+
+static volatile int		running;
+
+static void __devinit
+enter_contest( int mark, int add )
+{
+	while( (int)(get_tbl() - mark) < 0 )
+		tbsync->race_result = add;
+}
+
+void __devinit
+smp_generic_take_timebase( void )
+{
+	int cmd, tbl, tbu;
+
+	local_irq_disable();
+	while( !running )
+		;
+	rmb();
+
+	for( ;; ) {
+		tbsync->ack = 1;
+		while( !tbsync->handshake )
+			;
+		rmb();
+
+		cmd = tbsync->cmd;
+		tbl = tbsync->tbl;
+		tbu = tbsync->tbu;
+		tbsync->ack = 0;
+		if( cmd == kExit )
+			return;
+
+		if( cmd == kSetAndTest ) {
+			while( tbsync->handshake )
+				;
+			asm volatile ("mttbl %0" :: "r" (tbl) );
+			asm volatile ("mttbu %0" :: "r" (tbu) );
+		} else {
+			while( tbsync->handshake )
+				;
+		}
+		enter_contest( tbsync->mark, -1 );
+	}
+	local_irq_enable();
+}
+
+static int __devinit
+start_contest( int cmd, int offset, int num )
+{
+	int i, tbu, tbl, mark, score=0;
+
+	tbsync->cmd = cmd;
+
+	local_irq_disable();
+	for( i=-3; i<num; ) {
+		tbl = get_tbl() + 400;
+		tbsync->tbu = tbu = get_tbu();
+		tbsync->tbl = tbl + offset;
+		tbsync->mark = mark = tbl + 400;
+
+		wmb();
+
+		tbsync->handshake = 1;
+		while( tbsync->ack )
+			;
+
+		while( (int)(get_tbl() - tbl) <= 0 )
+			;
+		tbsync->handshake = 0;
+		enter_contest( mark, 1 );
+
+		while( !tbsync->ack )
+			;
+
+		if( tbsync->tbu != get_tbu() || ((tbsync->tbl ^ get_tbl()) & 0x80000000) )
+			continue;
+		if( i++ > 0 )
+			score += tbsync->race_result;
+	}
+	local_irq_enable();
+	return score;
+}
+
+void __devinit
+smp_generic_give_timebase( void )
+{
+	int i, score, score2, old, min=0, max=5000, offset=1000;
+
+	printk("Synchronizing timebase\n");
+
+	/* if this fails then this kernel won't work anyway... */
+	tbsync = kmalloc( sizeof(*tbsync), GFP_KERNEL );
+	memset( tbsync, 0, sizeof(*tbsync) );
+	mb();
+	running = 1;
+
+	while( !tbsync->ack )
+		;
+
+	/* binary search */
+	for( old=-1 ; old != offset ; offset=(min+max)/2 ) {
+		score = start_contest( kSetAndTest, offset, NUM_ITER );
+
+		printk("score %d, offset %d\n", score, offset );
+
+		if( score > 0 )
+			max = offset;
+		else
+			min = offset;
+		old = offset;
+	}
+	score = start_contest( kSetAndTest, min, NUM_ITER );
+	score2 = start_contest( kSetAndTest, max, NUM_ITER );
+
+	printk( "Min %d (score %d), Max %d (score %d)\n", min, score, max, score2 );
+	score = abs( score );
+	score2 = abs( score2 );
+	offset = (score < score2) ? min : max;
+
+	/* guard against inaccurate mttb */
+	for( i=0; i<10; i++ ) {
+		start_contest( kSetAndTest, offset, NUM_ITER/10 );
+
+		if( (score2=start_contest(kTest, offset, NUM_ITER)) < 0 )
+			score2 = -score2;
+		if( score2 <= score || score2 < 20 )
+			break;
+	}
+	printk("Final offset: %d (%d/%d)\n", offset, score2, NUM_ITER );
+
+	/* exiting */
+	tbsync->cmd = kExit;
+	wmb();
+	tbsync->handshake = 1;
+	while( tbsync->ack )
+		;
+	tbsync->handshake = 0;
+	kfree( tbsync );
+	tbsync = NULL;
+	running = 0;
+
+	/* all done */
+	smp_tb_synchronized = 1;
+}
--- diff/arch/ppc/platforms/pmac_low_i2c.c	1970-01-01 01:00:00.000000000 +0100
+++ source/arch/ppc/platforms/pmac_low_i2c.c	2004-02-09 10:39:51.000000000 +0000
@@ -0,0 +1,513 @@
+/*
+ *  arch/ppc/platforms/pmac_low_i2c.c
+ *
+ *  Copyright (C) 2003 Ben. Herrenschmidt (benh@kernel.crashing.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 file contains some low-level i2c access routines that
+ *  need to be used by various bits of the PowerMac platform code
+ *  at times where the real asynchronous & interrupt driven driver
+ *  cannot be used. The API borrows some semantics from the darwin
+ *  driver in order to ease the implementation of the platform
+ *  properties parser
+ */
+
+#include <linux/config.h>
+#include <linux/types.h>
+#include <linux/delay.h>
+#include <linux/sched.h>
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/adb.h>
+#include <linux/pmu.h>
+#include <asm/keylargo.h>
+#include <asm/uninorth.h>
+#include <asm/io.h>
+#include <asm/prom.h>
+#include <asm/machdep.h>
+#include <asm/pmac_low_i2c.h>
+
+#define MAX_LOW_I2C_HOST	4
+
+#if 1
+#define DBG(x...) do {\
+		printk(KERN_DEBUG "KW:" x);	\
+	} while(0)
+#else
+#define DBGG(x...)
+#endif
+
+struct low_i2c_host;
+
+typedef int (*low_i2c_func_t)(struct low_i2c_host *host, u8 addr, u8 sub, u8 *data, int len);
+
+struct low_i2c_host
+{
+	struct device_node	*np;		/* OF device node */
+	struct semaphore	mutex;		/* Access mutex for use by i2c-keywest */
+	low_i2c_func_t		func;		/* Access function */
+	int			is_open : 1;	/* Poor man's access control */
+	int			mode;		/* Current mode */
+	int			channel;	/* Current channel */
+	int			num_channels;	/* Number of channels */
+	unsigned long		base;		/* For keywest-i2c, base address */
+	int			bsteps;		/* And register stepping */
+	int			speed;		/* And speed */
+};
+
+static struct low_i2c_host	low_i2c_hosts[MAX_LOW_I2C_HOST];
+
+/* No locking is necessary on allocation, we are running way before
+ * anything can race with us
+ */
+static struct low_i2c_host *find_low_i2c_host(struct device_node *np)
+{
+	int i;
+
+	for (i = 0; i < MAX_LOW_I2C_HOST; i++)
+		if (low_i2c_hosts[i].np == np)
+			return &low_i2c_hosts[i];
+	return NULL;
+}
+
+/*
+ *
+ * i2c-keywest implementation (UniNorth, U2, U3, Keylargo's)
+ *
+ */
+
+/*
+ * Keywest i2c definitions borrowed from drivers/i2c/i2c-keywest.h,
+ * should be moved somewhere in include/asm-ppc/
+ */
+/* Register indices */
+typedef enum {
+	reg_mode = 0,
+	reg_control,
+	reg_status,
+	reg_isr,
+	reg_ier,
+	reg_addr,
+	reg_subaddr,
+	reg_data
+} reg_t;
+
+
+/* Mode register */
+#define KW_I2C_MODE_100KHZ	0x00
+#define KW_I2C_MODE_50KHZ	0x01
+#define KW_I2C_MODE_25KHZ	0x02
+#define KW_I2C_MODE_DUMB	0x00
+#define KW_I2C_MODE_STANDARD	0x04
+#define KW_I2C_MODE_STANDARDSUB	0x08
+#define KW_I2C_MODE_COMBINED	0x0C
+#define KW_I2C_MODE_MODE_MASK	0x0C
+#define KW_I2C_MODE_CHAN_MASK	0xF0
+
+/* Control register */
+#define KW_I2C_CTL_AAK		0x01
+#define KW_I2C_CTL_XADDR	0x02
+#define KW_I2C_CTL_STOP		0x04
+#define KW_I2C_CTL_START	0x08
+
+/* Status register */
+#define KW_I2C_STAT_BUSY	0x01
+#define KW_I2C_STAT_LAST_AAK	0x02
+#define KW_I2C_STAT_LAST_RW	0x04
+#define KW_I2C_STAT_SDA		0x08
+#define KW_I2C_STAT_SCL		0x10
+
+/* IER & ISR registers */
+#define KW_I2C_IRQ_DATA		0x01
+#define KW_I2C_IRQ_ADDR		0x02
+#define KW_I2C_IRQ_STOP		0x04
+#define KW_I2C_IRQ_START	0x08
+#define KW_I2C_IRQ_MASK		0x0F
+
+/* State machine states */
+enum {
+	state_idle,
+	state_addr,
+	state_read,
+	state_write,
+	state_stop,
+	state_dead
+};
+
+#define WRONG_STATE(name) do {\
+		printk(KERN_DEBUG "KW: wrong state. Got %s, state: %s (isr: %02x)\n", \
+		       name, __kw_state_names[state], isr); \
+	} while(0)
+
+static const char *__kw_state_names[] = {
+	"state_idle",
+	"state_addr",
+	"state_read",
+	"state_write",
+	"state_stop",
+	"state_dead"
+};
+
+static inline u8 __kw_read_reg(struct low_i2c_host *host, reg_t reg)
+{
+	return in_8(((volatile u8 *)host->base)
+		+ (((unsigned)reg) << host->bsteps));
+}
+
+static inline void __kw_write_reg(struct low_i2c_host *host, reg_t reg, u8 val)
+{
+	out_8(((volatile u8 *)host->base)
+		+ (((unsigned)reg) << host->bsteps), val);
+	(void)__kw_read_reg(host, reg_subaddr);
+}
+
+#define kw_write_reg(reg, val)	__kw_write_reg(host, reg, val) 
+#define kw_read_reg(reg)	__kw_read_reg(host, reg) 
+
+
+/* Don't schedule, the g5 fan controller is too
+ * timing sensitive
+ */
+static u8 kw_wait_interrupt(struct low_i2c_host* host)
+{
+	int i;
+	u8 isr;
+	
+	for (i = 0; i < 200000; i++) {
+		isr = kw_read_reg(reg_isr) & KW_I2C_IRQ_MASK;
+		if (isr != 0)
+			return isr;
+		udelay(1);
+	}
+	return isr;
+}
+
+static int kw_handle_interrupt(struct low_i2c_host *host, int state, int rw, int *rc, u8 **data, int *len, u8 isr)
+{
+	u8 ack;
+
+	if (isr == 0) {
+		if (state != state_stop) {
+			DBG("KW: Timeout !\n");
+			*rc = -EIO;
+			goto stop;
+		}
+		if (state == state_stop) {
+			ack = kw_read_reg(reg_status);
+			if (!(ack & KW_I2C_STAT_BUSY)) {
+				state = state_idle;
+				kw_write_reg(reg_ier, 0x00);
+			}
+		}
+		return state;
+	}
+
+	if (isr & KW_I2C_IRQ_ADDR) {
+		ack = kw_read_reg(reg_status);
+		if (state != state_addr) {
+			kw_write_reg(reg_isr, KW_I2C_IRQ_ADDR);
+			WRONG_STATE("KW_I2C_IRQ_ADDR"); 
+			*rc = -EIO;
+			goto stop;
+		}
+		if ((ack & KW_I2C_STAT_LAST_AAK) == 0) {			
+			*rc = -ENODEV;
+			DBG("KW: NAK on address\n");
+			return state_stop;		     
+		} else {
+			if (rw) {
+				state = state_read;
+				if (*len > 1)
+					kw_write_reg(reg_control, KW_I2C_CTL_AAK);
+			} else {
+				state = state_write;
+				kw_write_reg(reg_data, **data);
+				(*data)++; (*len)--;
+			}
+		}
+		kw_write_reg(reg_isr, KW_I2C_IRQ_ADDR);
+	}
+
+	if (isr & KW_I2C_IRQ_DATA) {
+		if (state == state_read) {
+			**data = kw_read_reg(reg_data);
+			(*data)++; (*len)--;
+			kw_write_reg(reg_isr, KW_I2C_IRQ_DATA);
+			if ((*len) == 0)
+				state = state_stop;
+			else if ((*len) == 1)
+				kw_write_reg(reg_control, 0);
+		} else if (state == state_write) {
+			ack = kw_read_reg(reg_status);
+			if ((ack & KW_I2C_STAT_LAST_AAK) == 0) {
+				DBG("KW: nack on data write\n");
+				*rc = -EIO;
+				goto stop;
+			} else if (*len) {
+				kw_write_reg(reg_data, **data);
+				(*data)++; (*len)--;
+			} else {
+				kw_write_reg(reg_control, KW_I2C_CTL_STOP);
+				state = state_stop;
+				*rc = 0;
+			}
+			kw_write_reg(reg_isr, KW_I2C_IRQ_DATA);
+		} else {
+			kw_write_reg(reg_isr, KW_I2C_IRQ_DATA);
+			WRONG_STATE("KW_I2C_IRQ_DATA"); 
+			if (state != state_stop) {
+				*rc = -EIO;
+				goto stop;
+			}
+		}
+	}
+
+	if (isr & KW_I2C_IRQ_STOP) {
+		kw_write_reg(reg_isr, KW_I2C_IRQ_STOP);
+		if (state != state_stop) {
+			WRONG_STATE("KW_I2C_IRQ_STOP");
+			*rc = -EIO;
+		}
+		return state_idle;
+	}
+
+	if (isr & KW_I2C_IRQ_START)
+		kw_write_reg(reg_isr, KW_I2C_IRQ_START);
+
+	return state;
+
+ stop:
+	kw_write_reg(reg_control, KW_I2C_CTL_STOP);	
+	return state_stop;
+}
+
+static int keywest_low_i2c_func(struct low_i2c_host *host, u8 addr, u8 subaddr, u8 *data, int len)
+{
+	u8 mode_reg = host->speed;
+	int state = state_addr;
+	int rc = 0;
+
+	/* Setup mode & subaddress if any */
+	switch(host->mode) {
+	case pmac_low_i2c_mode_dumb:
+		printk(KERN_ERR "low_i2c: Dumb mode not supported !\n");
+		return -EINVAL;
+	case pmac_low_i2c_mode_std:
+		mode_reg |= KW_I2C_MODE_STANDARD;
+		break;
+	case pmac_low_i2c_mode_stdsub:
+		mode_reg |= KW_I2C_MODE_STANDARDSUB;
+		kw_write_reg(reg_subaddr, subaddr);
+		break;
+	case pmac_low_i2c_mode_combined:
+		mode_reg |= KW_I2C_MODE_COMBINED;
+		kw_write_reg(reg_subaddr, subaddr);
+		break;
+	}
+
+	/* Setup channel & clear pending irqs */
+	kw_write_reg(reg_isr, kw_read_reg(reg_isr));
+	kw_write_reg(reg_mode, mode_reg | (host->channel << 4));
+	kw_write_reg(reg_status, 0);
+
+	/* Set up address and r/w bit */
+	kw_write_reg(reg_addr, addr);
+
+	/* Start sending address & disable interrupt*/
+	kw_write_reg(reg_ier, 0 /*KW_I2C_IRQ_MASK*/);
+	kw_write_reg(reg_control, KW_I2C_CTL_XADDR);
+
+	/* State machine, to turn into an interrupt handler */
+	while(state != state_idle) {
+		u8 isr = kw_wait_interrupt(host);
+		state = kw_handle_interrupt(host, state, addr & 1, &rc, &data, &len, isr);
+	}
+
+	return rc;
+}
+
+static void keywest_low_i2c_add(struct device_node *np)
+{
+	struct low_i2c_host	*host = find_low_i2c_host(NULL);
+	unsigned long		*psteps, *prate, steps, aoffset = 0;
+	struct device_node	*parent;
+
+	if (host == NULL) {
+		printk(KERN_ERR "low_i2c: Can't allocate host for %s\n",
+		       np->full_name);
+		return;
+	}
+	memset(host, 0, sizeof(*host));
+
+	init_MUTEX(&host->mutex);
+	host->np = of_node_get(np);	
+	psteps = (unsigned long *)get_property(np, "AAPL,address-step", NULL);
+	steps = psteps ? (*psteps) : 0x10;
+	for (host->bsteps = 0; (steps & 0x01) == 0; host->bsteps++)
+		steps >>= 1;
+	parent = of_get_parent(np);
+	host->num_channels = 1;
+	if (parent && parent->name[0] == 'u') {
+		host->num_channels = 2;
+		aoffset = 3;
+	}
+	/* Select interface rate */
+	host->speed = KW_I2C_MODE_100KHZ;
+	prate = (unsigned long *)get_property(np, "AAPL,i2c-rate", NULL);
+	if (prate) switch(*prate) {
+	case 100:
+		host->speed = KW_I2C_MODE_100KHZ;
+		break;
+	case 50:
+		host->speed = KW_I2C_MODE_50KHZ;
+		break;
+	case 25:
+		host->speed = KW_I2C_MODE_25KHZ;
+		break;
+	}	
+	host->mode = pmac_low_i2c_mode_std;
+	host->base = (unsigned long)ioremap(np->addrs[0].address + aoffset,
+						np->addrs[0].size);
+	host->func = keywest_low_i2c_func;
+}
+
+/*
+ *
+ * PMU implementation
+ *
+ */
+
+
+#ifdef CONFIG_ADB_PMU
+
+static int pmu_low_i2c_func(struct low_i2c_host *host, u8 addr, u8 sub, u8 *data, int len)
+{
+	// TODO
+	return -ENODEV;
+}
+
+static void pmu_low_i2c_add(struct device_node *np)
+{
+	struct low_i2c_host	*host = find_low_i2c_host(NULL);
+
+	if (host == NULL) {
+		printk(KERN_ERR "low_i2c: Can't allocate host for %s\n",
+		       np->full_name);
+		return;
+	}
+	memset(host, 0, sizeof(*host));
+
+	init_MUTEX(&host->mutex);
+	host->np = of_node_get(np);	
+	host->num_channels = 3;
+	host->mode = pmac_low_i2c_mode_std;
+	host->func = pmu_low_i2c_func;
+}
+
+#endif /* CONFIG_ADB_PMU */
+
+void __init pmac_init_low_i2c(void)
+{
+	struct device_node *np;
+
+	/* Probe keywest-i2c busses */
+	np = of_find_compatible_node(NULL, "i2c", "keywest-i2c");
+	while(np) {
+		keywest_low_i2c_add(np);
+		np = of_find_compatible_node(np, "i2c", "keywest-i2c");
+	}
+
+#ifdef CONFIG_ADB_PMU
+	/* Probe PMU busses */
+	np = of_find_node_by_name(NULL, "via-pmu");
+	if (np)
+		pmu_low_i2c_add(np);
+#endif /* CONFIG_ADB_PMU */
+
+	/* TODO: Add CUDA support as well */
+}
+
+int pmac_low_i2c_lock(struct device_node *np)
+{
+	struct low_i2c_host *host = find_low_i2c_host(np);
+
+	if (!host)
+		return -ENODEV;
+	down(&host->mutex);
+	return 0;
+}
+EXPORT_SYMBOL(pmac_low_i2c_lock);
+
+int pmac_low_i2c_unlock(struct device_node *np)
+{
+	struct low_i2c_host *host = find_low_i2c_host(np);
+
+	if (!host)
+		return -ENODEV;
+	up(&host->mutex);
+	return 0;
+}
+EXPORT_SYMBOL(pmac_low_i2c_unlock);
+
+
+int pmac_low_i2c_open(struct device_node *np, int channel)
+{
+	struct low_i2c_host *host = find_low_i2c_host(np);
+
+	if (!host)
+		return -ENODEV;
+
+	if (channel >= host->num_channels)
+		return -EINVAL;
+
+	down(&host->mutex);
+	host->is_open = 1;
+	host->channel = channel;
+
+	return 0;
+}
+EXPORT_SYMBOL(pmac_low_i2c_open);
+
+int pmac_low_i2c_close(struct device_node *np)
+{
+	struct low_i2c_host *host = find_low_i2c_host(np);
+
+	if (!host)
+		return -ENODEV;
+
+	host->is_open = 0;
+	up(&host->mutex);
+
+	return 0;
+}
+EXPORT_SYMBOL(pmac_low_i2c_close);
+
+int pmac_low_i2c_setmode(struct device_node *np, int mode)
+{
+	struct low_i2c_host *host = find_low_i2c_host(np);
+
+	if (!host)
+		return -ENODEV;
+	WARN_ON(!host->is_open);
+	host->mode = mode;
+
+	return 0;
+}
+EXPORT_SYMBOL(pmac_low_i2c_setmode);
+
+int pmac_low_i2c_xfer(struct device_node *np, u8 addrdir, u8 subaddr, u8 *data, int len)
+{
+	struct low_i2c_host *host = find_low_i2c_host(np);
+
+	if (!host)
+		return -ENODEV;
+	WARN_ON(!host->is_open);
+
+	return host->func(host, addrdir, subaddr, data, len);
+}
+EXPORT_SYMBOL(pmac_low_i2c_xfer);
+
--- diff/arch/ppc/syslib/open_pic2.c	1970-01-01 01:00:00.000000000 +0100
+++ source/arch/ppc/syslib/open_pic2.c	2004-02-09 10:39:51.000000000 +0000
@@ -0,0 +1,716 @@
+/*
+ *  arch/ppc/kernel/open_pic.c -- OpenPIC Interrupt Handling
+ *
+ *  Copyright (C) 1997 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
+ *  for more details.
+ *
+ *  This is a duplicate of open_pic.c that deals with U3s MPIC on
+ *  G5 PowerMacs. It's the same file except it's using big endian
+ *  register accesses
+ */
+
+#include <linux/config.h>
+#include <linux/types.h>
+#include <linux/kernel.h>
+#include <linux/sched.h>
+#include <linux/init.h>
+#include <linux/irq.h>
+#include <linux/interrupt.h>
+#include <linux/sysdev.h>
+#include <asm/ptrace.h>
+#include <asm/signal.h>
+#include <asm/io.h>
+#include <asm/irq.h>
+#include <asm/prom.h>
+#include <asm/sections.h>
+#include <asm/open_pic.h>
+#include <asm/i8259.h>
+#include <asm/hardirq.h>
+
+#include "open_pic_defs.h"
+
+void *OpenPIC2_Addr;
+static volatile struct OpenPIC *OpenPIC2 = NULL;
+/*
+ * We define OpenPIC_InitSenses table thusly:
+ * bit 0x1: sense, 0 for edge and 1 for level.
+ * bit 0x2: polarity, 0 for negative, 1 for positive.
+ */
+extern  u_int OpenPIC_NumInitSenses;
+extern u_char *OpenPIC_InitSenses;
+extern int use_of_interrupt_tree;
+
+static u_int NumProcessors;
+static u_int NumSources;
+static int open_pic2_irq_offset;
+static volatile OpenPIC_Source *ISR[NR_IRQS];
+
+/* Global Operations */
+static void openpic2_disable_8259_pass_through(void);
+static void openpic2_set_priority(u_int pri);
+static void openpic2_set_spurious(u_int vector);
+
+/* Timer Interrupts */
+static void openpic2_inittimer(u_int timer, u_int pri, u_int vector);
+static void openpic2_maptimer(u_int timer, u_int cpumask);
+
+/* Interrupt Sources */
+static void openpic2_enable_irq(u_int irq);
+static void openpic2_disable_irq(u_int irq);
+static void openpic2_initirq(u_int irq, u_int pri, u_int vector, int polarity,
+			    int is_level);
+static void openpic2_mapirq(u_int irq, u_int cpumask, u_int keepmask);
+
+/*
+ * These functions are not used but the code is kept here
+ * for completeness and future reference.
+ */
+static void openpic2_reset(void);
+#ifdef notused
+static void openpic2_enable_8259_pass_through(void);
+static u_int openpic2_get_priority(void);
+static u_int openpic2_get_spurious(void);
+static void openpic2_set_sense(u_int irq, int sense);
+#endif /* notused */
+
+/*
+ * Description of the openpic for the higher-level irq code
+ */
+static void openpic2_end_irq(unsigned int irq_nr);
+static void openpic2_ack_irq(unsigned int irq_nr);
+
+struct hw_interrupt_type open_pic2 = {
+	" OpenPIC2 ",
+	NULL,
+	NULL,
+	openpic2_enable_irq,
+	openpic2_disable_irq,
+	openpic2_ack_irq,
+	openpic2_end_irq,
+};
+
+/*
+ *  Accesses to the current processor's openpic registers
+ *  On cascaded controller, this is only CPU 0
+ */
+#define THIS_CPU		Processor[0]
+#define DECL_THIS_CPU
+#define CHECK_THIS_CPU
+
+#if 1
+#define check_arg_ipi(ipi) \
+    if (ipi < 0 || ipi >= OPENPIC_NUM_IPI) \
+	printk("open_pic.c:%d: illegal ipi %d\n", __LINE__, ipi);
+#define check_arg_timer(timer) \
+    if (timer < 0 || timer >= OPENPIC_NUM_TIMERS) \
+	printk("open_pic.c:%d: illegal timer %d\n", __LINE__, timer);
+#define check_arg_vec(vec) \
+    if (vec < 0 || vec >= OPENPIC_NUM_VECTORS) \
+	printk("open_pic.c:%d: illegal vector %d\n", __LINE__, vec);
+#define check_arg_pri(pri) \
+    if (pri < 0 || pri >= OPENPIC_NUM_PRI) \
+	printk("open_pic.c:%d: illegal priority %d\n", __LINE__, pri);
+/*
+ * Print out a backtrace if it's out of range, since if it's larger than NR_IRQ's
+ * data has probably been corrupted and we're going to panic or deadlock later
+ * anyway --Troy
+ */
+extern unsigned long* _get_SP(void);
+#define check_arg_irq(irq) \
+    if (irq < open_pic2_irq_offset || irq >= NumSources+open_pic2_irq_offset \
+	|| ISR[irq - open_pic2_irq_offset] == 0) { \
+      printk("open_pic.c:%d: illegal irq %d\n", __LINE__, irq); \
+      /*print_backtrace(_get_SP());*/ }
+#define check_arg_cpu(cpu) \
+    if (cpu < 0 || cpu >= NumProcessors){ \
+	printk("open_pic2.c:%d: illegal cpu %d\n", __LINE__, cpu); \
+	/*print_backtrace(_get_SP());*/ }
+#else
+#define check_arg_ipi(ipi)	do {} while (0)
+#define check_arg_timer(timer)	do {} while (0)
+#define check_arg_vec(vec)	do {} while (0)
+#define check_arg_pri(pri)	do {} while (0)
+#define check_arg_irq(irq)	do {} while (0)
+#define check_arg_cpu(cpu)	do {} while (0)
+#endif
+
+static u_int openpic2_read(volatile u_int *addr)
+{
+	u_int val;
+
+	val = in_be32(addr);
+	return val;
+}
+
+static inline void openpic2_write(volatile u_int *addr, u_int val)
+{
+	out_be32(addr, val);
+}
+
+static inline u_int openpic2_readfield(volatile u_int *addr, u_int mask)
+{
+	u_int val = openpic2_read(addr);
+	return val & mask;
+}
+
+inline void openpic2_writefield(volatile u_int *addr, u_int mask,
+			       u_int field)
+{
+	u_int val = openpic2_read(addr);
+	openpic2_write(addr, (val & ~mask) | (field & mask));
+}
+
+static inline void openpic2_clearfield(volatile u_int *addr, u_int mask)
+{
+	openpic2_writefield(addr, mask, 0);
+}
+
+static inline void openpic2_setfield(volatile u_int *addr, u_int mask)
+{
+	openpic2_writefield(addr, mask, mask);
+}
+
+static void openpic2_safe_writefield(volatile u_int *addr, u_int mask,
+				    u_int field)
+{
+	openpic2_setfield(addr, OPENPIC_MASK);
+	while (openpic2_read(addr) & OPENPIC_ACTIVITY);
+	openpic2_writefield(addr, mask | OPENPIC_MASK, field | OPENPIC_MASK);
+}
+
+static void openpic2_reset(void)
+{
+	openpic2_setfield(&OpenPIC2->Global.Global_Configuration0,
+			 OPENPIC_CONFIG_RESET);
+	while (openpic2_readfield(&OpenPIC2->Global.Global_Configuration0,
+				 OPENPIC_CONFIG_RESET))
+		mb();
+}
+
+void __init openpic2_set_sources(int first_irq, int num_irqs, void *first_ISR)
+{
+	volatile OpenPIC_Source *src = first_ISR;
+	int i, last_irq;
+
+	last_irq = first_irq + num_irqs;
+	if (last_irq > NumSources)
+		NumSources = last_irq;
+	if (src == 0)
+		src = &((struct OpenPIC *)OpenPIC2_Addr)->Source[first_irq];
+	for (i = first_irq; i < last_irq; ++i, ++src)
+		ISR[i] = src;
+}
+
+/*
+ * The `offset' parameter defines where the interrupts handled by the
+ * OpenPIC start in the space of interrupt numbers that the kernel knows
+ * about.  In other words, the OpenPIC's IRQ0 is numbered `offset' in the
+ * kernel's interrupt numbering scheme.
+ * We assume there is only one OpenPIC.
+ */
+void __init openpic2_init(int offset)
+{
+	u_int t, i;
+	u_int timerfreq;
+	const char *version;
+
+	if (!OpenPIC2_Addr) {
+		printk("No OpenPIC2 found !\n");
+		return;
+	}
+	OpenPIC2 = (volatile struct OpenPIC *)OpenPIC2_Addr;
+
+	if (ppc_md.progress) ppc_md.progress("openpic: enter", 0x122);
+
+	t = openpic2_read(&OpenPIC2->Global.Feature_Reporting0);
+	switch (t & OPENPIC_FEATURE_VERSION_MASK) {
+	case 1:
+		version = "1.0";
+		break;
+	case 2:
+		version = "1.2";
+		break;
+	case 3:
+		version = "1.3";
+		break;
+	default:
+		version = "?";
+		break;
+	}
+	NumProcessors = ((t & OPENPIC_FEATURE_LAST_PROCESSOR_MASK) >>
+			 OPENPIC_FEATURE_LAST_PROCESSOR_SHIFT) + 1;
+	if (NumSources == 0)
+		openpic2_set_sources(0,
+				    ((t & OPENPIC_FEATURE_LAST_SOURCE_MASK) >>
+				     OPENPIC_FEATURE_LAST_SOURCE_SHIFT) + 1,
+				    NULL);
+	printk("OpenPIC (2) Version %s (%d CPUs and %d IRQ sources) at %p\n",
+	       version, NumProcessors, NumSources, OpenPIC2);
+	timerfreq = openpic2_read(&OpenPIC2->Global.Timer_Frequency);
+	if (timerfreq)
+		printk("OpenPIC timer frequency is %d.%06d MHz\n",
+		       timerfreq / 1000000, timerfreq % 1000000);
+
+	open_pic2_irq_offset = offset;
+
+	/* Initialize timer interrupts */
+	if ( ppc_md.progress ) ppc_md.progress("openpic2: timer",0x3ba);
+	for (i = 0; i < OPENPIC_NUM_TIMERS; i++) {
+		/* Disabled, Priority 0 */
+		openpic2_inittimer(i, 0, OPENPIC2_VEC_TIMER+i+offset);
+		/* No processor */
+		openpic2_maptimer(i, 0);
+	}
+
+	/* Initialize external interrupts */
+	if (ppc_md.progress) ppc_md.progress("openpic2: external",0x3bc);
+
+	openpic2_set_priority(0xf);
+
+	/* Init all external sources, including possibly the cascade. */
+	for (i = 0; i < NumSources; i++) {
+		int sense;
+
+		if (ISR[i] == 0)
+			continue;
+
+		/* the bootloader may have left it enabled (bad !) */
+		openpic2_disable_irq(i+offset);
+
+		sense = (i < OpenPIC_NumInitSenses)? OpenPIC_InitSenses[i]: \
+				(IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE);
+
+		if (sense & IRQ_SENSE_MASK)
+			irq_desc[i+offset].status = IRQ_LEVEL;
+
+		/* Enabled, Priority 8 */
+		openpic2_initirq(i, 8, i+offset, (sense & IRQ_POLARITY_MASK),
+				(sense & IRQ_SENSE_MASK));
+		/* Processor 0 */
+		openpic2_mapirq(i, 1<<0, 0);
+	}
+
+	/* Init descriptors */
+	for (i = offset; i < NumSources + offset; i++)
+		irq_desc[i].handler = &open_pic2;
+
+	/* Initialize the spurious interrupt */
+	if (ppc_md.progress) ppc_md.progress("openpic2: spurious",0x3bd);
+	openpic2_set_spurious(OPENPIC2_VEC_SPURIOUS+offset);
+
+	openpic2_disable_8259_pass_through();
+	openpic2_set_priority(0);
+
+	if (ppc_md.progress) ppc_md.progress("openpic2: exit",0x222);
+}
+
+#ifdef notused
+static void openpic2_enable_8259_pass_through(void)
+{
+	openpic2_clearfield(&OpenPIC2->Global.Global_Configuration0,
+			   OPENPIC_CONFIG_8259_PASSTHROUGH_DISABLE);
+}
+#endif /* notused */
+
+/* This can't be __init, it is used in openpic_sleep_restore_intrs */
+static void openpic2_disable_8259_pass_through(void)
+{
+	openpic2_setfield(&OpenPIC2->Global.Global_Configuration0,
+			 OPENPIC_CONFIG_8259_PASSTHROUGH_DISABLE);
+}
+
+/*
+ *  Find out the current interrupt
+ */
+u_int openpic2_irq(void)
+{
+	u_int vec;
+	DECL_THIS_CPU;
+
+	CHECK_THIS_CPU;
+	vec = openpic2_readfield(&OpenPIC2->THIS_CPU.Interrupt_Acknowledge,
+				OPENPIC_VECTOR_MASK);
+	return vec;
+}
+
+void openpic2_eoi(void)
+{
+	DECL_THIS_CPU;
+
+	CHECK_THIS_CPU;
+	openpic2_write(&OpenPIC2->THIS_CPU.EOI, 0);
+	/* Handle PCI write posting */
+	(void)openpic2_read(&OpenPIC2->THIS_CPU.EOI);
+}
+
+#ifdef notused
+static u_int openpic2_get_priority(void)
+{
+	DECL_THIS_CPU;
+
+	CHECK_THIS_CPU;
+	return openpic2_readfield(&OpenPIC2->THIS_CPU.Current_Task_Priority,
+				 OPENPIC_CURRENT_TASK_PRIORITY_MASK);
+}
+#endif /* notused */
+
+static void __init openpic2_set_priority(u_int pri)
+{
+	DECL_THIS_CPU;
+
+	CHECK_THIS_CPU;
+	check_arg_pri(pri);
+	openpic2_writefield(&OpenPIC2->THIS_CPU.Current_Task_Priority,
+			   OPENPIC_CURRENT_TASK_PRIORITY_MASK, pri);
+}
+
+/*
+ *  Get/set the spurious vector
+ */
+#ifdef notused
+static u_int openpic2_get_spurious(void)
+{
+	return openpic2_readfield(&OpenPIC2->Global.Spurious_Vector,
+				 OPENPIC_VECTOR_MASK);
+}
+#endif /* notused */
+
+/* This can't be __init, it is used in openpic_sleep_restore_intrs */
+static void openpic2_set_spurious(u_int vec)
+{
+	check_arg_vec(vec);
+	openpic2_writefield(&OpenPIC2->Global.Spurious_Vector, OPENPIC_VECTOR_MASK,
+			   vec);
+}
+
+static spinlock_t openpic2_setup_lock = SPIN_LOCK_UNLOCKED;
+
+/*
+ *  Initialize a timer interrupt (and disable it)
+ *
+ *  timer: OpenPIC timer number
+ *  pri: interrupt source priority
+ *  vec: the vector it will produce
+ */
+static void __init openpic2_inittimer(u_int timer, u_int pri, u_int vec)
+{
+	check_arg_timer(timer);
+	check_arg_pri(pri);
+	check_arg_vec(vec);
+	openpic2_safe_writefield(&OpenPIC2->Global.Timer[timer].Vector_Priority,
+				OPENPIC_PRIORITY_MASK | OPENPIC_VECTOR_MASK,
+				(pri << OPENPIC_PRIORITY_SHIFT) | vec);
+}
+
+/*
+ *  Map a timer interrupt to one or more CPUs
+ */
+static void __init openpic2_maptimer(u_int timer, u_int cpumask)
+{
+	check_arg_timer(timer);
+	openpic2_write(&OpenPIC2->Global.Timer[timer].Destination,
+		      cpumask);
+}
+
+/*
+ * Initalize the interrupt source which will generate an NMI.
+ * This raises the interrupt's priority from 8 to 9.
+ *
+ * irq: The logical IRQ which generates an NMI.
+ */
+void __init
+openpic2_init_nmi_irq(u_int irq)
+{
+	check_arg_irq(irq);
+	openpic2_safe_writefield(&ISR[irq - open_pic2_irq_offset]->Vector_Priority,
+				OPENPIC_PRIORITY_MASK,
+				9 << OPENPIC_PRIORITY_SHIFT);
+}
+
+/*
+ *
+ * All functions below take an offset'ed irq argument
+ *
+ */
+
+
+/*
+ *  Enable/disable an external interrupt source
+ *
+ *  Externally called, irq is an offseted system-wide interrupt number
+ */
+static void openpic2_enable_irq(u_int irq)
+{
+	volatile u_int *vpp;
+
+	check_arg_irq(irq);
+	vpp = &ISR[irq - open_pic2_irq_offset]->Vector_Priority;
+       	openpic2_clearfield(vpp, OPENPIC_MASK);
+	/* make sure mask gets to controller before we return to user */
+       	do {
+       		mb(); /* sync is probably useless here */
+       	} while (openpic2_readfield(vpp, OPENPIC_MASK));
+}
+
+static void openpic2_disable_irq(u_int irq)
+{
+	volatile u_int *vpp;
+	u32 vp;
+
+	check_arg_irq(irq);
+	vpp = &ISR[irq - open_pic2_irq_offset]->Vector_Priority;
+	openpic2_setfield(vpp, OPENPIC_MASK);
+	/* make sure mask gets to controller before we return to user */
+	do {
+		mb();  /* sync is probably useless here */
+		vp = openpic2_readfield(vpp, OPENPIC_MASK | OPENPIC_ACTIVITY);
+	} while((vp & OPENPIC_ACTIVITY) && !(vp & OPENPIC_MASK));
+}
+
+
+/*
+ *  Initialize an interrupt source (and disable it!)
+ *
+ *  irq: OpenPIC interrupt number
+ *  pri: interrupt source priority
+ *  vec: the vector it will produce
+ *  pol: polarity (1 for positive, 0 for negative)
+ *  sense: 1 for level, 0 for edge
+ */
+static void __init
+openpic2_initirq(u_int irq, u_int pri, u_int vec, int pol, int sense)
+{
+	openpic2_safe_writefield(&ISR[irq]->Vector_Priority,
+				OPENPIC_PRIORITY_MASK | OPENPIC_VECTOR_MASK |
+				OPENPIC_SENSE_MASK | OPENPIC_POLARITY_MASK,
+				(pri << OPENPIC_PRIORITY_SHIFT) | vec |
+				(pol ? OPENPIC_POLARITY_POSITIVE :
+			    		OPENPIC_POLARITY_NEGATIVE) |
+				(sense ? OPENPIC_SENSE_LEVEL : OPENPIC_SENSE_EDGE));
+}
+
+/*
+ *  Map an interrupt source to one or more CPUs
+ */
+static void openpic2_mapirq(u_int irq, u_int physmask, u_int keepmask)
+{
+	if (ISR[irq] == 0)
+		return;
+	if (keepmask != 0)
+		physmask |= openpic2_read(&ISR[irq]->Destination) & keepmask;
+	openpic2_write(&ISR[irq]->Destination, physmask);
+}
+
+#ifdef notused
+/*
+ *  Set the sense for an interrupt source (and disable it!)
+ *
+ *  sense: 1 for level, 0 for edge
+ */
+static void openpic2_set_sense(u_int irq, int sense)
+{
+	if (ISR[irq] != 0)
+		openpic2_safe_writefield(&ISR[irq]->Vector_Priority,
+					OPENPIC_SENSE_LEVEL,
+					(sense ? OPENPIC_SENSE_LEVEL : 0));
+}
+#endif /* notused */
+
+/* No spinlocks, should not be necessary with the OpenPIC
+ * (1 register = 1 interrupt and we have the desc lock).
+ */
+static void openpic2_ack_irq(unsigned int irq_nr)
+{
+	openpic2_disable_irq(irq_nr);
+	openpic2_eoi();
+}
+
+static void openpic2_end_irq(unsigned int irq_nr)
+{
+	if (!(irq_desc[irq_nr].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
+		openpic2_enable_irq(irq_nr);
+}
+
+int
+openpic2_get_irq(struct pt_regs *regs)
+{
+	int irq = openpic2_irq();
+
+	if (irq == (OPENPIC2_VEC_SPURIOUS + open_pic2_irq_offset))
+		irq = -1;
+	return irq;
+}
+
+#ifdef CONFIG_PM
+
+/*
+ * We implement the IRQ controller as a sysdev and put it
+ * to sleep at powerdown stage (the callback is named suspend,
+ * but it's old semantics, for the Device Model, it's really
+ * powerdown). The possible problem is that another sysdev that
+ * happens to be suspend after this one will have interrupts off,
+ * that may be an issue... For now, this isn't an issue on pmac
+ * though...
+ */
+
+static u32 save_ipi_vp[OPENPIC_NUM_IPI];
+static u32 save_irq_src_vp[OPENPIC_MAX_SOURCES];
+static u32 save_irq_src_dest[OPENPIC_MAX_SOURCES];
+static u32 save_cpu_task_pri[OPENPIC_MAX_PROCESSORS];
+static int openpic_suspend_count;
+
+static void openpic2_cached_enable_irq(u_int irq)
+{
+	check_arg_irq(irq);
+	save_irq_src_vp[irq - open_pic2_irq_offset] &= ~OPENPIC_MASK;
+}
+
+static void openpic2_cached_disable_irq(u_int irq)
+{
+	check_arg_irq(irq);
+	save_irq_src_vp[irq - open_pic2_irq_offset] |= OPENPIC_MASK;
+}
+
+/* WARNING: Can be called directly by the cpufreq code with NULL parameter,
+ * we need something better to deal with that... Maybe switch to S1 for
+ * cpufreq changes
+ */
+int openpic2_suspend(struct sys_device *sysdev, u32 state)
+{
+	int	i;
+	unsigned long flags;
+
+	spin_lock_irqsave(&openpic2_setup_lock, flags);
+
+	if (openpic_suspend_count++ > 0) {
+		spin_unlock_irqrestore(&openpic2_setup_lock, flags);
+		return 0;
+	}
+
+	open_pic2.enable = openpic2_cached_enable_irq;
+	open_pic2.disable = openpic2_cached_disable_irq;
+
+	for (i=0; i<NumProcessors; i++) {
+		save_cpu_task_pri[i] = openpic2_read(&OpenPIC2->Processor[i].Current_Task_Priority);
+		openpic2_writefield(&OpenPIC2->Processor[i].Current_Task_Priority,
+				   OPENPIC_CURRENT_TASK_PRIORITY_MASK, 0xf);
+	}
+
+	for (i=0; i<OPENPIC_NUM_IPI; i++)
+		save_ipi_vp[i] = openpic2_read(&OpenPIC2->Global.IPI_Vector_Priority(i));
+	for (i=0; i<NumSources; i++) {
+		if (ISR[i] == 0)
+			continue;
+		save_irq_src_vp[i] = openpic2_read(&ISR[i]->Vector_Priority) & ~OPENPIC_ACTIVITY;
+		save_irq_src_dest[i] = openpic2_read(&ISR[i]->Destination);
+	}
+
+	spin_unlock_irqrestore(&openpic2_setup_lock, flags);
+
+	return 0;
+}
+
+/* WARNING: Can be called directly by the cpufreq code with NULL parameter,
+ * we need something better to deal with that... Maybe switch to S1 for
+ * cpufreq changes
+ */
+int openpic2_resume(struct sys_device *sysdev)
+{
+	int		i;
+	unsigned long	flags;
+	u32		vppmask =	OPENPIC_PRIORITY_MASK | OPENPIC_VECTOR_MASK |
+					OPENPIC_SENSE_MASK | OPENPIC_POLARITY_MASK |
+					OPENPIC_MASK;
+
+	spin_lock_irqsave(&openpic2_setup_lock, flags);
+
+	if ((--openpic_suspend_count) > 0) {
+		spin_unlock_irqrestore(&openpic2_setup_lock, flags);
+		return 0;
+	}
+
+	openpic2_reset();
+
+	/* OpenPIC sometimes seem to need some time to be fully back up... */
+	do {
+		openpic2_set_spurious(OPENPIC2_VEC_SPURIOUS+open_pic2_irq_offset);
+	} while(openpic2_readfield(&OpenPIC2->Global.Spurious_Vector, OPENPIC_VECTOR_MASK)
+			!= (OPENPIC2_VEC_SPURIOUS + open_pic2_irq_offset));
+	
+	openpic2_disable_8259_pass_through();
+
+	for (i=0; i<OPENPIC_NUM_IPI; i++)
+		openpic2_write(&OpenPIC2->Global.IPI_Vector_Priority(i),
+			      save_ipi_vp[i]);
+	for (i=0; i<NumSources; i++) {
+		if (ISR[i] == 0)
+			continue;
+		openpic2_write(&ISR[i]->Destination, save_irq_src_dest[i]);
+		openpic2_write(&ISR[i]->Vector_Priority, save_irq_src_vp[i]);
+		/* make sure mask gets to controller before we return to user */
+		do {
+			openpic2_write(&ISR[i]->Vector_Priority, save_irq_src_vp[i]);
+		} while (openpic2_readfield(&ISR[i]->Vector_Priority, vppmask)
+			 != (save_irq_src_vp[i] & vppmask));
+	}
+	for (i=0; i<NumProcessors; i++)
+		openpic2_write(&OpenPIC2->Processor[i].Current_Task_Priority,
+			      save_cpu_task_pri[i]);
+
+	open_pic2.enable = openpic2_enable_irq;
+	open_pic2.disable = openpic2_disable_irq;
+
+	spin_unlock_irqrestore(&openpic2_setup_lock, flags);
+
+	return 0;
+}
+
+#endif /* CONFIG_PM */
+
+/* HACK ALERT */
+static struct sysdev_class openpic2_sysclass = {
+	set_kset_name("openpic2"),
+};
+
+static struct sys_device device_openpic2 = {
+	.id		= 0,
+	.cls		= &openpic2_sysclass,
+};
+
+static struct sysdev_driver driver_openpic2 = {
+#ifdef CONFIG_PM
+	.suspend	= &openpic2_suspend,
+	.resume		= &openpic2_resume,
+#endif /* CONFIG_PM */
+};
+
+static int __init init_openpic2_sysfs(void)
+{
+	int rc;
+
+	if (!OpenPIC2_Addr)
+		return -ENODEV;
+	printk(KERN_DEBUG "Registering openpic2 with sysfs...\n");
+	rc = sysdev_class_register(&openpic2_sysclass);
+	if (rc) {
+		printk(KERN_ERR "Failed registering openpic sys class\n");
+		return -ENODEV;
+	}
+	rc = sys_device_register(&device_openpic2);
+	if (rc) {
+		printk(KERN_ERR "Failed registering openpic sys device\n");
+		return -ENODEV;
+	}
+	rc = sysdev_driver_register(&openpic2_sysclass, &driver_openpic2);
+	if (rc) {
+		printk(KERN_ERR "Failed registering openpic sys driver\n");
+		return -ENODEV;
+	}
+	return 0;
+}
+
+subsys_initcall(init_openpic2_sysfs);
+
--- diff/arch/ppc64/kernel/hvconsole.c	1970-01-01 01:00:00.000000000 +0100
+++ source/arch/ppc64/kernel/hvconsole.c	2004-02-09 10:39:51.000000000 +0000
@@ -0,0 +1,88 @@
+/*
+ * hvconsole.c
+ * Copyright (C) 2004 Hollis Blanchard, IBM Corporation
+ *
+ * LPAR console support.
+ * 
+ * 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/kernel.h>
+#include <asm/hvcall.h>
+#include <asm/prom.h>
+#include <asm/hvconsole.h>
+
+int hvc_get_chars(int index, char *buf, int count)
+{
+	unsigned long got;
+
+	if (plpar_hcall(H_GET_TERM_CHAR, index, 0, 0, 0, &got,
+		(unsigned long *)buf, (unsigned long *)buf+1) == H_Success) {
+		/*
+		 * Work around a HV bug where it gives us a null
+		 * after every \r.  -- paulus
+		 */
+		if (got > 0) {
+			int i;
+			for (i = 1; i < got; ++i) {
+				if (buf[i] == 0 && buf[i-1] == '\r') {
+					--got;
+					if (i < got)
+						memmove(&buf[i], &buf[i+1],
+							got - i);
+				}
+			}
+		}
+		return got;
+	}
+	return 0;
+}
+
+int hvc_put_chars(int index, const char *buf, int count)
+{
+	unsigned long *lbuf = (unsigned long *) buf;
+	long ret;
+
+	ret = plpar_hcall_norets(H_PUT_TERM_CHAR, index, count, lbuf[0],
+				 lbuf[1]);
+	if (ret == H_Success)
+		return count;
+	if (ret == H_Busy)
+		return 0;
+	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)
+{
+	struct device_node *vty;
+	int num_found = 0;
+
+	/* 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 num_found;
+}
--- diff/arch/um/drivers/cow.h	1970-01-01 01:00:00.000000000 +0100
+++ source/arch/um/drivers/cow.h	2004-02-09 10:39:51.000000000 +0000
@@ -0,0 +1,41 @@
+#ifndef __COW_H__
+#define __COW_H__
+
+#include <asm/types.h>
+
+#if __BYTE_ORDER == __BIG_ENDIAN
+# define ntohll(x) (x)
+# define htonll(x) (x)
+#elif __BYTE_ORDER == __LITTLE_ENDIAN
+# define ntohll(x)  bswap_64(x)
+# define htonll(x)  bswap_64(x)
+#else
+#error "__BYTE_ORDER not defined"
+#endif
+
+extern int init_cow_file(int fd, char *cow_file, char *backing_file, 
+			 int sectorsize, int alignment, int *bitmap_offset_out, 
+			 unsigned long *bitmap_len_out, int *data_offset_out);
+
+extern int file_reader(__u64 offset, char *buf, int len, void *arg);
+extern int read_cow_header(int (*reader)(__u64, char *, int, void *), 
+			   void *arg, __u32 *version_out, 
+			   char **backing_file_out, time_t *mtime_out, 
+			   __u64 *size_out, int *sectorsize_out, 
+			   __u32 *align_out, int *bitmap_offset_out);
+
+extern int write_cow_header(char *cow_file, int fd, char *backing_file, 
+			    int sectorsize, int alignment, long long *size);
+
+extern void cow_sizes(int version, __u64 size, int sectorsize, int align,
+		      int bitmap_offset, unsigned long *bitmap_len_out, 
+		      int *data_offset_out);
+
+#endif
+
+/*
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-file-style: "linux"
+ * End:
+ */
--- diff/arch/um/drivers/cow_kern.c	1970-01-01 01:00:00.000000000 +0100
+++ source/arch/um/drivers/cow_kern.c	2004-02-09 10:39:51.000000000 +0000
@@ -0,0 +1,630 @@
+#define COW_MAJOR 60
+#define MAJOR_NR COW_MAJOR
+
+#include <linux/stddef.h>
+#include <linux/kernel.h>
+#include <linux/ctype.h>
+#include <linux/stat.h>
+#include <linux/vmalloc.h>
+#include <linux/blkdev.h>
+#include <linux/blk.h>
+#include <linux/fs.h>
+#include <linux/genhd.h>
+#include <linux/devfs_fs.h>
+#include <asm/uaccess.h>
+#include "2_5compat.h"
+#include "cow.h"
+#include "ubd_user.h"
+
+#define COW_SHIFT 4
+
+struct cow {
+	int count;
+	char *cow_path;
+	dev_t cow_dev;
+	struct block_device *cow_bdev;
+	char *backing_path;
+	dev_t backing_dev;
+	struct block_device *backing_bdev;
+	int sectorsize;
+	unsigned long *bitmap;
+	unsigned long bitmap_len;
+	int bitmap_offset;
+	int data_offset;
+	devfs_handle_t devfs;
+	struct semaphore sem;
+	struct semaphore io_sem;
+	atomic_t working;
+	spinlock_t io_lock;
+	struct buffer_head *bh;
+	struct buffer_head *bhtail;
+	void *end_io;
+};
+
+#define DEFAULT_COW { \
+	.count			= 0, \
+	.cow_path		= NULL, \
+	.cow_dev		= 0, \
+	.backing_path		= NULL, \
+	.backing_dev		= 0, \
+        .bitmap			= NULL, \
+	.bitmap_len		= 0, \
+	.bitmap_offset		= 0, \
+        .data_offset		= 0, \
+	.devfs			= NULL, \
+	.working		= ATOMIC_INIT(0), \
+	.io_lock		= SPIN_LOCK_UNLOCKED, \
+}
+
+#define MAX_DEV (8)
+#define MAX_MINOR (MAX_DEV << COW_SHIFT)
+
+struct cow cow_dev[MAX_DEV] = { [ 0 ... MAX_DEV - 1 ] = DEFAULT_COW };
+
+/* Not modified by this driver */
+static int blk_sizes[MAX_MINOR] = { [ 0 ... MAX_MINOR - 1 ] = BLOCK_SIZE };
+static int hardsect_sizes[MAX_MINOR] = { [ 0 ... MAX_MINOR - 1 ] = 512 };
+
+/* Protected by cow_lock */
+static int sizes[MAX_MINOR] = { [ 0 ... MAX_MINOR - 1 ] = 0 };
+
+static struct hd_struct	cow_part[MAX_MINOR] =
+	{ [ 0 ... MAX_MINOR - 1 ] = { 0, 0, 0 } };
+
+/* Protected by io_request_lock */
+static request_queue_t *cow_queue;
+
+static int cow_open(struct inode *inode, struct file *filp);
+static int cow_release(struct inode * inode, struct file * file);
+static int cow_ioctl(struct inode * inode, struct file * file,
+		     unsigned int cmd, unsigned long arg);
+static int cow_revalidate(kdev_t rdev);
+
+static struct block_device_operations cow_blops = {
+	.open		= cow_open,
+	.release	= cow_release,
+	.ioctl		= cow_ioctl,
+	.revalidate	= cow_revalidate,
+};
+
+/* Initialized in an initcall, and unchanged thereafter */
+devfs_handle_t cow_dir_handle;
+
+#define INIT_GENDISK(maj, name, parts, shift, bsizes, max, blops) \
+{ \
+	.major 		= maj, \
+	.major_name  	= name, \
+	.minor_shift 	= shift, \
+	.max_p  	= 1 << shift, \
+	.part  		= parts, \
+	.sizes  	= bsizes, \
+	.nr_real  	= max, \
+	.real_devices  	= NULL, \
+	.next  		= NULL, \
+	.fops  		= blops, \
+	.de_arr  	= NULL, \
+	.flags  	= 0 \
+}
+
+static spinlock_t cow_lock = SPIN_LOCK_UNLOCKED;
+
+static struct gendisk cow_gendisk = INIT_GENDISK(MAJOR_NR, "cow", cow_part,
+						 COW_SHIFT, sizes, MAX_DEV, 
+						 &cow_blops);
+
+static int cow_add(int n)
+{
+	struct cow *dev = &cow_dev[n];
+	char name[sizeof("nnnnnn\0")];
+	int err = -ENODEV;
+
+	if(dev->cow_path == NULL)
+		goto out;
+
+	sprintf(name, "%d", n);
+	dev->devfs = devfs_register(cow_dir_handle, name, DEVFS_FL_REMOVABLE,
+				    MAJOR_NR, n << COW_SHIFT, S_IFBLK | 
+				    S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP,
+				    &cow_blops, NULL);
+
+	init_MUTEX_LOCKED(&dev->sem);
+	init_MUTEX(&dev->io_sem);
+
+	return(0);
+
+ out:
+	return(err);
+}
+
+/*
+ * Add buffer_head to back of pending list
+ */
+static void cow_add_bh(struct cow *cow, struct buffer_head *bh)
+{
+	unsigned long flags;
+
+	spin_lock_irqsave(&cow->io_lock, flags);
+	if(cow->bhtail != NULL){
+		cow->bhtail->b_reqnext = bh;
+		cow->bhtail = bh;
+	}
+	else {
+		cow->bh = bh;
+		cow->bhtail = bh;
+	}
+	spin_unlock_irqrestore(&cow->io_lock, flags);
+}
+
+/*
+* Grab first pending buffer
+*/
+static struct buffer_head *cow_get_bh(struct cow *cow)
+{
+	struct buffer_head *bh;
+
+	spin_lock_irq(&cow->io_lock);
+	bh = cow->bh;
+	if(bh != NULL){
+		if(bh == cow->bhtail)
+			cow->bhtail = NULL;
+		cow->bh = bh->b_reqnext;
+		bh->b_reqnext = NULL;
+	}
+	spin_unlock_irq(&cow->io_lock);
+
+	return(bh);
+}
+
+static void cow_handle_bh(struct cow *cow, struct buffer_head *bh, 
+			  struct buffer_head **cow_bh, int ncow_bh)
+{
+	int i;
+
+	if(ncow_bh > 0)
+		ll_rw_block(WRITE, ncow_bh, cow_bh);
+
+	for(i = 0; i < ncow_bh ; i++){
+		wait_on_buffer(cow_bh[i]);
+		brelse(cow_bh[i]);
+	}
+
+	ll_rw_block(WRITE, 1, &bh);
+	brelse(bh);
+}
+
+static struct buffer_head *cow_new_bh(struct cow *dev, int sector)
+{
+	struct buffer_head *bh;
+
+	sector = (dev->bitmap_offset + sector / 8) / dev->sectorsize;
+	bh = getblk(dev->cow_dev, sector, dev->sectorsize);
+	memcpy(bh->b_data, dev->bitmap + sector / (8 * sizeof(dev->bitmap[0])),
+	       dev->sectorsize);
+	return(bh);
+}
+
+/* Copied from loop.c, needed to avoid deadlocking in make_request. */
+
+static int cow_thread(void *data)
+{
+	struct cow *dev = data;
+	struct buffer_head *bh;
+
+	daemonize();
+	exit_files(current);
+
+	sprintf(current->comm, "cow%d", dev - cow_dev);
+
+	spin_lock_irq(&current->sigmask_lock);
+	sigfillset(&current->blocked);
+	flush_signals(current);
+	spin_unlock_irq(&current->sigmask_lock);
+
+	atomic_inc(&dev->working);
+
+	current->policy = SCHED_OTHER;
+	current->nice = -20;
+
+	current->flags |= PF_NOIO;
+
+	/*
+	 * up sem, we are running
+	 */
+	up(&dev->sem);
+
+	for(;;){
+		int start, len, nbh, i, update_bitmap = 0;
+		struct buffer_head *cow_bh[2];
+
+		down_interruptible(&dev->io_sem);
+		/*
+		 * could be upped because of tear-down, not because of
+		 * pending work
+		 */
+		if(!atomic_read(&dev->working))
+			break;
+
+		bh = cow_get_bh(dev);
+		if(bh == NULL){
+			printk(KERN_ERR "cow: missing bh\n");
+			continue;
+		}
+
+		start = bh->b_blocknr * bh->b_size / dev->sectorsize;
+		len = bh->b_size / dev->sectorsize;
+		for(i = 0; i < len ; i++){
+			if(ubd_test_bit(start + i, 
+					(unsigned char *) dev->bitmap))
+				continue;
+
+			update_bitmap = 1;
+			ubd_set_bit(start + i, (unsigned char *) dev->bitmap);
+		}
+
+		cow_bh[0] = NULL;
+		cow_bh[1] = NULL;
+		nbh = 0;
+		if(update_bitmap){
+			cow_bh[0] = cow_new_bh(dev, start);
+			nbh++;
+			if(start / dev->sectorsize != 
+			   (start + len) / dev->sectorsize){
+				cow_bh[1] = cow_new_bh(dev, start + len);
+				nbh++;
+			}
+		}
+		
+		bh->b_dev = dev->cow_dev;
+		bh->b_blocknr += dev->data_offset / dev->sectorsize;
+
+		cow_handle_bh(dev, bh, cow_bh, nbh);
+
+		/*
+		 * upped both for pending work and tear-down, lo_pending
+		 * will hit zero then
+		 */
+		if(atomic_dec_and_test(&dev->working))
+			break;
+	}
+
+	up(&dev->sem);
+	return(0);
+}
+
+static int cow_make_request(request_queue_t *q, int rw, struct buffer_head *bh)
+{
+	struct cow *dev;
+	int n, minor;
+
+	minor = MINOR(bh->b_rdev);
+	n = minor >> COW_SHIFT;
+	dev = &cow_dev[n];
+
+	dev->end_io = NULL;
+	if(ubd_test_bit(bh->b_rsector, (unsigned char *) dev->bitmap)){
+		bh->b_rdev = dev->cow_dev;
+		bh->b_rsector += dev->data_offset / dev->sectorsize;
+	}
+	else if(rw == WRITE){
+		bh->b_dev = dev->cow_dev;
+		bh->b_blocknr += dev->data_offset / dev->sectorsize;
+
+		cow_add_bh(dev, bh);
+		up(&dev->io_sem);
+		return(0);
+	}
+	else {
+		bh->b_rdev = dev->backing_dev;
+	}
+
+	return(1);
+}
+
+int cow_init(void)
+{
+	int i;
+
+	cow_dir_handle = devfs_mk_dir (NULL, "cow", NULL);
+	if (devfs_register_blkdev(MAJOR_NR, "cow", &cow_blops)) {
+		printk(KERN_ERR "cow: unable to get major %d\n", MAJOR_NR);
+		return -1;
+	}
+	read_ahead[MAJOR_NR] = 8;		/* 8 sector (4kB) read-ahead */
+	blksize_size[MAJOR_NR] = blk_sizes;
+	blk_size[MAJOR_NR] = sizes;
+	INIT_HARDSECT(hardsect_size, MAJOR_NR, hardsect_sizes);
+
+	cow_queue = BLK_DEFAULT_QUEUE(MAJOR_NR);
+	blk_init_queue(cow_queue, NULL);
+	INIT_ELV(cow_queue, &cow_queue->elevator);
+	blk_queue_make_request(cow_queue, cow_make_request);
+
+	add_gendisk(&cow_gendisk);
+
+	for(i=0;i<MAX_DEV;i++) 
+		cow_add(i);
+
+	return(0);
+}
+
+__initcall(cow_init);
+
+static int reader(__u64 start, char *buf, int count, void *arg)
+{
+	dev_t dev = *((dev_t *) arg);
+	struct buffer_head *bh;
+	__u64 block;
+	int cur, offset, left, n, blocksize = get_hardsect_size(dev);
+
+	if(blocksize == 0)
+		panic("Zero blocksize");
+
+	block = start / blocksize;
+	offset = start % blocksize;
+	left = count;
+	cur = 0;
+	while(left > 0){
+		n = (left > blocksize) ? blocksize : left;
+
+		bh = bread(dev, block, (n < 512) ? 512 : n);
+		if(bh == NULL)
+			return(-EIO);
+
+		n -= offset;
+		memcpy(&buf[cur], bh->b_data + offset, n);
+		block++;
+		left -= n;
+		cur += n;
+		offset = 0;
+		brelse(bh);
+	}
+
+	return(count);
+}
+
+static int cow_open(struct inode *inode, struct file *filp)
+{
+	int (*dev_ioctl)(struct inode *, struct file *, unsigned int, 
+			 unsigned long);
+	mm_segment_t fs;
+	struct cow *dev;
+	__u64 size;
+	__u32 version, align;
+	time_t mtime;
+	char *backing_file;
+	int n, offset, err = 0;
+
+	n = DEVICE_NR(inode->i_rdev);
+	if(n >= MAX_DEV)
+		return(-ENODEV);
+	dev = &cow_dev[n];
+	offset = n << COW_SHIFT;
+
+	spin_lock(&cow_lock);
+
+	if(dev->count == 0){
+		dev->cow_dev = name_to_kdev_t(dev->cow_path);
+		if(dev->cow_dev == 0){
+			printk(KERN_ERR "cow_open - name_to_kdev_t(\"%s\") "
+			       "failed\n", dev->cow_path);
+			err = -ENODEV;
+		}
+
+		dev->backing_dev = name_to_kdev_t(dev->backing_path);
+		if(dev->backing_dev == 0){
+			printk(KERN_ERR "cow_open - name_to_kdev_t(\"%s\") "
+			       "failed\n", dev->backing_path);
+			err = -ENODEV;
+		}
+
+		if(err) 
+			goto out;
+
+		dev->cow_bdev = bdget(dev->cow_dev);
+		if(dev->cow_bdev == NULL){
+			printk(KERN_ERR "cow_open - bdget(\"%s\") failed\n", 
+			       dev->cow_path);
+			err = -ENOMEM;
+		}
+		dev->backing_bdev = bdget(dev->backing_dev);
+		if(dev->backing_bdev == NULL){
+			printk(KERN_ERR "cow_open - bdget(\"%s\") failed\n", 
+			       dev->backing_path);
+			err = -ENOMEM;
+		}
+
+		if(err) 
+			goto out;
+
+		err = blkdev_get(dev->cow_bdev, FMODE_READ|FMODE_WRITE, 0, 
+				 BDEV_RAW);
+		if(err){
+			printk("cow_open - blkdev_get of COW device failed, "
+			       "error = %d\n", err);
+			goto out;
+		}
+		
+		err = blkdev_get(dev->backing_bdev, FMODE_READ, 0, BDEV_RAW);
+		if(err){
+			printk("cow_open - blkdev_get of backing device "
+			       "failed, error = %d\n", err);
+			goto out;
+		}
+		
+		err = read_cow_header(reader, &dev->cow_dev, &version, 
+				      &backing_file, &mtime, &size,
+				      &dev->sectorsize, &align, 
+				      &dev->bitmap_offset);
+		if(err){
+			printk(KERN_ERR "cow_open - read_cow_header failed, "
+			       "err = %d\n", err);
+			goto out;
+		}
+
+		cow_sizes(version, size, dev->sectorsize, align, 
+			  dev->bitmap_offset, &dev->bitmap_len, 
+			  &dev->data_offset);
+		dev->bitmap = (void *) vmalloc(dev->bitmap_len);
+		if(dev->bitmap == NULL){
+			err = -ENOMEM;
+			printk(KERN_ERR "Failed to vmalloc COW bitmap\n");
+			goto out;
+		}
+		flush_tlb_kernel_vm();
+		
+		err = reader(dev->bitmap_offset, (char *) dev->bitmap, 
+			     dev->bitmap_len, &dev->cow_dev);
+		if(err < 0){
+			printk(KERN_ERR "Failed to read COW bitmap\n");
+			vfree(dev->bitmap);
+			goto out;
+		}
+
+		dev_ioctl = dev->backing_bdev->bd_op->ioctl;
+		fs = get_fs();
+		set_fs(KERNEL_DS);
+		err = (*dev_ioctl)(inode, filp, BLKGETSIZE, 
+				   (unsigned long) &sizes[offset]);
+		set_fs(fs);
+		if(err){
+			printk(KERN_ERR "cow_open - BLKGETSIZE failed, "
+			       "error = %d\n", err);
+			goto out;
+		}
+
+		kernel_thread(cow_thread, dev, 
+			      CLONE_FS | CLONE_FILES | CLONE_SIGHAND);
+		down(&dev->sem);
+	}
+	dev->count++;
+ out:
+	spin_unlock(&cow_lock);
+	return(err);
+}
+
+static int cow_release(struct inode * inode, struct file * file)
+{
+	struct cow *dev;
+	int n, err;
+
+	n = DEVICE_NR(inode->i_rdev);
+	if(n >= MAX_DEV)
+		return(-ENODEV);
+	dev = &cow_dev[n];
+
+	spin_lock(&cow_lock);
+
+	if(--dev->count > 0)
+		goto out;
+
+	err = blkdev_put(dev->cow_bdev, BDEV_RAW);
+	if(err)
+		printk("cow_release - blkdev_put of cow device failed, "
+		       "error = %d\n", err);
+	bdput(dev->cow_bdev);
+	dev->cow_bdev = 0;
+
+	err = blkdev_put(dev->backing_bdev, BDEV_RAW);
+	if(err)
+		printk("cow_release - blkdev_put of backing device failed, "
+		       "error = %d\n", err);
+	bdput(dev->backing_bdev);
+	dev->backing_bdev = 0;
+
+ out:
+	spin_unlock(&cow_lock);
+	return(0);
+}
+
+static int cow_ioctl(struct inode * inode, struct file * file,
+		     unsigned int cmd, unsigned long arg)
+{
+	struct cow *dev;
+	int (*dev_ioctl)(struct inode *, struct file *, unsigned int, 
+			 unsigned long);
+	int n;
+
+	n = DEVICE_NR(inode->i_rdev);
+	if(n >= MAX_DEV)
+		return(-ENODEV);
+	dev = &cow_dev[n];
+
+	dev_ioctl = dev->backing_bdev->bd_op->ioctl;
+	return((*dev_ioctl)(inode, file, cmd, arg));
+}
+
+static int cow_revalidate(kdev_t rdev)
+{
+	printk(KERN_ERR "Need to implement cow_revalidate\n");
+	return(0);
+}
+
+static int parse_unit(char **ptr)
+{
+	char *str = *ptr, *end;
+	int n = -1;
+
+	if(isdigit(*str)) {
+		n = simple_strtoul(str, &end, 0);
+		if(end == str)
+			return(-1);
+		*ptr = end;
+	}
+	else if (('a' <= *str) && (*str <= 'h')) {
+		n = *str - 'a';
+		str++;
+		*ptr = str;
+	}
+	return(n);
+}
+
+static int cow_setup(char *str)
+{
+	struct cow *dev;
+	char *cow_name, *backing_name;
+	int unit;
+
+	unit = parse_unit(&str);
+	if(unit < 0){
+		printk(KERN_ERR "cow_setup - Couldn't parse unit number\n");
+		return(1);
+	}
+
+	if(*str != '='){
+		printk(KERN_ERR "cow_setup - Missing '=' after unit "
+		       "number\n");
+		return(1);
+	}
+	str++;
+
+	cow_name = str;
+	backing_name = strchr(str, ',');
+	if(backing_name == NULL){
+		printk(KERN_ERR "cow_setup - missing backing device name\n");
+		return(0);
+	}
+	*backing_name = '\0';
+	backing_name++;
+
+	spin_lock(&cow_lock);
+
+	dev = &cow_dev[unit];
+	dev->cow_path = cow_name;
+	dev->backing_path = backing_name;
+	
+	spin_unlock(&cow_lock);
+	return(0);
+}
+
+__setup("cow", cow_setup);
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * Emacs will notice this stuff at the end of the file and automatically
+ * adjust the settings for this buffer only.  This must remain at the end
+ * of the file.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-file-style: "linux"
+ * End:
+ */
--- diff/arch/um/drivers/cow_sys.h	1970-01-01 01:00:00.000000000 +0100
+++ source/arch/um/drivers/cow_sys.h	2004-02-09 10:39:51.000000000 +0000
@@ -0,0 +1,48 @@
+#ifndef __COW_SYS_H__
+#define __COW_SYS_H__
+
+#include "kern_util.h"
+#include "user_util.h"
+#include "os.h"
+#include "user.h"
+
+static inline void *cow_malloc(int size)
+{
+	return(um_kmalloc(size));
+}
+
+static inline void cow_free(void *ptr)
+{
+	kfree(ptr);
+}
+
+#define cow_printf printk
+
+static inline char *cow_strdup(char *str)
+{
+	return(uml_strdup(str));
+}
+
+static inline int cow_seek_file(int fd, __u64 offset)
+{
+	return(os_seek_file(fd, offset));
+}
+
+static inline int cow_file_size(char *file, __u64 *size_out)
+{
+	return(os_file_size(file, size_out));
+}
+
+static inline int cow_write_file(int fd, char *buf, int size)
+{
+	return(os_write_file(fd, buf, size));
+}
+
+#endif
+
+/*
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-file-style: "linux"
+ * End:
+ */
--- diff/arch/um/drivers/cow_user.c	1970-01-01 01:00:00.000000000 +0100
+++ source/arch/um/drivers/cow_user.c	2004-02-09 10:39:51.000000000 +0000
@@ -0,0 +1,375 @@
+#include <stddef.h>
+#include <string.h>
+#include <errno.h>
+#include <unistd.h>
+#include <byteswap.h>
+#include <sys/time.h>
+#include <sys/param.h>
+#include <sys/user.h>
+#include <netinet/in.h>
+
+#include "os.h"
+
+#include "cow.h"
+#include "cow_sys.h"
+
+#define PATH_LEN_V1 256
+
+struct cow_header_v1 {
+	int magic;
+	int version;
+	char backing_file[PATH_LEN_V1];
+	time_t mtime;
+	__u64 size;
+	int sectorsize;
+};
+
+#define PATH_LEN_V2 MAXPATHLEN
+
+struct cow_header_v2 {
+	unsigned long magic;
+	unsigned long version;
+	char backing_file[PATH_LEN_V2];
+	time_t mtime;
+	__u64 size;
+	int sectorsize;
+};
+
+/* Define PATH_LEN_V3 as the usual value of MAXPATHLEN, just hard-code it in 
+ * case other systems have different values for MAXPATHLEN
+ */
+#define PATH_LEN_V3 4096
+
+/* Changes from V2 - 
+ *	PATH_LEN_V3 as described above
+ *	Explicitly specify field bit lengths for systems with different
+ *		lengths for the usual C types.  Not sure whether char or
+ *		time_t should be changed, this can be changed later without
+ *		breaking compatibility
+ *	Add alignment field so that different alignments can be used for the
+ *		bitmap and data
+ * 	Add cow_format field to allow for the possibility of different ways
+ *		of specifying the COW blocks.  For now, the only value is 0,
+ * 		for the traditional COW bitmap.
+ *	Move the backing_file field to the end of the header.  This allows
+ *		for the possibility of expanding it into the padding required
+ *		by the bitmap alignment.
+ * 	The bitmap and data portions of the file will be aligned as specified
+ * 		by the alignment field.  This is to allow COW files to be
+ *		put on devices with restrictions on access alignments, such as
+ *		/dev/raw, with a 512 byte alignment restriction.  This also
+ *		allows the data to be more aligned more strictly than on
+ *		sector boundaries.  This is needed for ubd-mmap, which needs
+ *		the data to be page aligned.
+ *	Fixed (finally!) the rounding bug
+ */
+
+struct cow_header_v3 {
+	__u32 magic;
+	__u32 version;
+	time_t mtime;
+	__u64 size;
+	__u32 sectorsize;
+	__u32 alignment;
+	__u32 cow_format;
+	char backing_file[PATH_LEN_V3];
+};
+
+/* COW format definitions - for now, we have only the usual COW bitmap */
+#define COW_BITMAP 0
+
+union cow_header {
+	struct cow_header_v1 v1;
+	struct cow_header_v2 v2;
+	struct cow_header_v3 v3;
+};
+
+#define COW_MAGIC 0x4f4f4f4d  /* MOOO */
+#define COW_VERSION 3
+
+#define DIV_ROUND(x, len) (((x) + (len) - 1) / (len))
+#define ROUND_UP(x, align) DIV_ROUND(x, align) * (align)
+
+void cow_sizes(int version, __u64 size, int sectorsize, int align, 
+	       int bitmap_offset, unsigned long *bitmap_len_out, 
+	       int *data_offset_out)
+{
+	if(version < 3){
+		*bitmap_len_out = (size + sectorsize - 1) / (8 * sectorsize);
+
+		*data_offset_out = bitmap_offset + *bitmap_len_out;
+		*data_offset_out = (*data_offset_out + sectorsize - 1) / 
+			sectorsize;
+		*data_offset_out *= sectorsize;
+	}
+	else {
+		*bitmap_len_out = DIV_ROUND(size, sectorsize);
+		*bitmap_len_out = DIV_ROUND(*bitmap_len_out, 8);
+
+		*data_offset_out = bitmap_offset + *bitmap_len_out;
+		*data_offset_out = ROUND_UP(*data_offset_out, align);
+	}
+}
+
+static int absolutize(char *to, int size, char *from)
+{
+	char save_cwd[256], *slash;
+	int remaining;
+
+	if(getcwd(save_cwd, sizeof(save_cwd)) == NULL) {
+		cow_printf("absolutize : unable to get cwd - errno = %d\n", 
+			   errno);
+		return(-1);
+	}
+	slash = strrchr(from, '/');
+	if(slash != NULL){
+		*slash = '\0';
+		if(chdir(from)){
+			*slash = '/';
+			cow_printf("absolutize : Can't cd to '%s' - " 
+				   "errno = %d\n", from, errno);
+			return(-1);
+		}
+		*slash = '/';
+		if(getcwd(to, size) == NULL){
+			cow_printf("absolutize : unable to get cwd of '%s' - "
+			       "errno = %d\n", from, errno);
+			return(-1);
+		}
+		remaining = size - strlen(to);
+		if(strlen(slash) + 1 > remaining){
+			cow_printf("absolutize : unable to fit '%s' into %d "
+			       "chars\n", from, size);
+			return(-1);
+		}
+		strcat(to, slash);
+	}
+	else {
+		if(strlen(save_cwd) + 1 + strlen(from) + 1 > size){
+			cow_printf("absolutize : unable to fit '%s' into %d "
+			       "chars\n", from, size);
+			return(-1);
+		}
+		strcpy(to, save_cwd);
+		strcat(to, "/");
+		strcat(to, from);
+	}
+	chdir(save_cwd);
+	return(0);
+}
+
+int write_cow_header(char *cow_file, int fd, char *backing_file, 
+		     int sectorsize, int alignment, long long *size)
+{
+	struct cow_header_v3 *header;
+	unsigned long modtime;
+	int err;
+
+	err = cow_seek_file(fd, 0);
+	if(err < 0){
+		cow_printf("write_cow_header - lseek failed, err = %d\n", -err);
+		goto out;
+	}
+
+	err = -ENOMEM;
+	header = cow_malloc(sizeof(*header));
+	if(header == NULL){
+		cow_printf("Failed to allocate COW V3 header\n");
+		goto out;
+	}
+	header->magic = htonl(COW_MAGIC);
+	header->version = htonl(COW_VERSION);
+
+	err = -EINVAL;
+	if(strlen(backing_file) > sizeof(header->backing_file) - 1){
+		cow_printf("Backing file name \"%s\" is too long - names are "
+			   "limited to %d characters\n", backing_file, 
+			   sizeof(header->backing_file) - 1);
+		goto out_free;
+	}
+
+	if(absolutize(header->backing_file, sizeof(header->backing_file), 
+		      backing_file))
+		goto out_free;
+
+	err = os_file_modtime(header->backing_file, &modtime);
+	if(err < 0){
+		cow_printf("Backing file '%s' mtime request failed, "
+			   "err = %d\n", header->backing_file, -err);
+		goto out_free;
+	}
+
+	err = cow_file_size(header->backing_file, size);
+	if(err < 0){
+		cow_printf("Couldn't get size of backing file '%s', "
+			   "err = %d\n", header->backing_file, -err);
+		goto out_free;
+	}
+
+	header->mtime = htonl(modtime);
+	header->size = htonll(*size);
+	header->sectorsize = htonl(sectorsize);
+	header->alignment = htonl(alignment);
+	header->cow_format = COW_BITMAP;
+
+	err = os_write_file(fd, header, sizeof(*header));
+	if(err != sizeof(*header)){
+		cow_printf("Write of header to new COW file '%s' failed, "
+			   "err = %d\n", cow_file, -err);
+		goto out_free;
+	}
+	err = 0;
+ out_free:
+	cow_free(header);
+ out:
+	return(err);
+}
+
+int file_reader(__u64 offset, char *buf, int len, void *arg)
+{
+	int fd = *((int *) arg);
+
+	return(pread(fd, buf, len, offset));
+}
+
+/* XXX Need to sanity-check the values read from the header */
+
+int read_cow_header(int (*reader)(__u64, char *, int, void *), void *arg, 
+		    __u32 *version_out, char **backing_file_out, 
+		    time_t *mtime_out, __u64 *size_out, 
+		    int *sectorsize_out, __u32 *align_out, 
+		    int *bitmap_offset_out)
+{
+	union cow_header *header;
+	char *file;
+	int err, n;
+	unsigned long version, magic;
+
+	header = cow_malloc(sizeof(*header));
+	if(header == NULL){
+	        cow_printf("read_cow_header - Failed to allocate header\n");
+		return(-ENOMEM);
+	}
+	err = -EINVAL;
+	n = (*reader)(0, (char *) header, sizeof(*header), arg);
+	if(n < offsetof(typeof(header->v1), backing_file)){
+		cow_printf("read_cow_header - short header\n");
+		goto out;
+	}
+
+	magic = header->v1.magic;
+	if(magic == COW_MAGIC) {
+		version = header->v1.version;
+	}
+	else if(magic == ntohl(COW_MAGIC)){
+		version = ntohl(header->v1.version);
+	}
+	/* No error printed because the non-COW case comes through here */
+	else goto out;
+
+	*version_out = version;
+
+	if(version == 1){
+		if(n < sizeof(header->v1)){
+			cow_printf("read_cow_header - failed to read V1 "
+				   "header\n");
+			goto out;
+		}
+		*mtime_out = header->v1.mtime;
+		*size_out = header->v1.size;
+		*sectorsize_out = header->v1.sectorsize;
+		*bitmap_offset_out = sizeof(header->v1);
+		*align_out = *sectorsize_out;
+		file = header->v1.backing_file;
+	}
+	else if(version == 2){
+		if(n < sizeof(header->v2)){
+			cow_printf("read_cow_header - failed to read V2 "
+				   "header\n");
+			goto out;
+		}
+		*mtime_out = ntohl(header->v2.mtime);
+		*size_out = ntohll(header->v2.size);
+		*sectorsize_out = ntohl(header->v2.sectorsize);
+		*bitmap_offset_out = sizeof(header->v2);
+		*align_out = *sectorsize_out;
+		file = header->v2.backing_file;
+	}
+	else if(version == 3){
+		if(n < sizeof(header->v3)){
+			cow_printf("read_cow_header - failed to read V2 "
+				   "header\n");
+			goto out;
+		}
+		*mtime_out = ntohl(header->v3.mtime);
+		*size_out = ntohll(header->v3.size);
+		*sectorsize_out = ntohl(header->v3.sectorsize);
+		*align_out = ntohl(header->v3.alignment);
+		*bitmap_offset_out = ROUND_UP(sizeof(header->v3), *align_out);
+		file = header->v3.backing_file;
+	}
+	else {
+		cow_printf("read_cow_header - invalid COW version\n");
+		goto out;		
+	}
+	err = -ENOMEM;
+	*backing_file_out = cow_strdup(file);
+	if(*backing_file_out == NULL){
+		cow_printf("read_cow_header - failed to allocate backing "
+			   "file\n");
+		goto out;
+	}
+	err = 0;
+ out:
+	cow_free(header);
+	return(err);
+}
+
+int init_cow_file(int fd, char *cow_file, char *backing_file, int sectorsize,
+		  int alignment, int *bitmap_offset_out, 
+		  unsigned long *bitmap_len_out, int *data_offset_out)
+{
+	__u64 size, offset;
+	char zero = 0;
+	int err;
+
+	err = write_cow_header(cow_file, fd, backing_file, sectorsize, 
+			       alignment, &size);
+	if(err) 
+		goto out;
+	
+	*bitmap_offset_out = ROUND_UP(sizeof(struct cow_header_v3), alignment);
+	cow_sizes(COW_VERSION, size, sectorsize, alignment, *bitmap_offset_out,
+		  bitmap_len_out, data_offset_out);
+
+	offset = *data_offset_out + size - sizeof(zero);
+	err = cow_seek_file(fd, offset);
+	if(err < 0){
+		cow_printf("cow bitmap lseek failed : err = %d\n", -err);
+		goto out;
+	}
+
+	/* does not really matter how much we write it is just to set EOF 
+	 * this also sets the entire COW bitmap
+	 * to zero without having to allocate it 
+	 */
+	err = cow_write_file(fd, &zero, sizeof(zero));
+	if(err != sizeof(zero)){
+		cow_printf("Write of bitmap to new COW file '%s' failed, "
+			   "err = %d\n", cow_file, -err);
+		err = -EINVAL;
+		goto out;
+	}
+
+	return(0);
+
+ out:
+	return(err);
+}
+
+/*
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-file-style: "linux"
+ * End:
+ */
--- diff/arch/um/include/irq_kern.h	1970-01-01 01:00:00.000000000 +0100
+++ source/arch/um/include/irq_kern.h	2004-02-09 10:39:51.000000000 +0000
@@ -0,0 +1,28 @@
+/* 
+ * Copyright (C) 2001, 2002 Jeff Dike (jdike@karaya.com)
+ * Licensed under the GPL
+ */
+
+#ifndef __IRQ_KERN_H__
+#define __IRQ_KERN_H__
+
+#include "linux/interrupt.h"
+
+extern int um_request_irq(unsigned int irq, int fd, int type,
+			  irqreturn_t (*handler)(int, void *, 
+						 struct pt_regs *),
+			  unsigned long irqflags,  const char * devname,
+			  void *dev_id);
+
+#endif
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * Emacs will notice this stuff at the end of the file and automatically
+ * adjust the settings for this buffer only.  This must remain at the end
+ * of the file.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-file-style: "linux"
+ * End:
+ */
--- diff/arch/um/include/mem_kern.h	1970-01-01 01:00:00.000000000 +0100
+++ source/arch/um/include/mem_kern.h	2004-02-09 10:39:51.000000000 +0000
@@ -0,0 +1,30 @@
+/* 
+ * Copyright (C) 2003 Jeff Dike (jdike@addtoit.com)
+ * Licensed under the GPL
+ */
+
+#ifndef __MEM_KERN_H__
+#define __MEM_KERN_H__
+
+#include "linux/list.h"
+#include "linux/types.h"
+
+struct remapper {
+	struct list_head list;
+	int (*proc)(int, unsigned long, int, __u64);
+};
+
+extern void register_remapper(struct remapper *info);
+
+#endif
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * Emacs will notice this stuff at the end of the file and automatically
+ * adjust the settings for this buffer only.  This must remain at the end
+ * of the file.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-file-style: "linux"
+ * End:
+ */
--- diff/arch/um/kernel/physmem.c	1970-01-01 01:00:00.000000000 +0100
+++ source/arch/um/kernel/physmem.c	2004-02-09 10:39:51.000000000 +0000
@@ -0,0 +1,349 @@
+/* 
+ * Copyright (C) 2000 - 2003 Jeff Dike (jdike@addtoit.com)
+ * Licensed under the GPL
+ */
+
+#include "linux/mm.h"
+#include "linux/ghash.h"
+#include "linux/slab.h"
+#include "linux/vmalloc.h"
+#include "linux/bootmem.h"
+#include "asm/types.h"
+#include "asm/pgtable.h"
+#include "kern_util.h"
+#include "user_util.h"
+#include "mode_kern.h"
+#include "mem.h"
+#include "mem_user.h"
+#include "os.h"
+#include "kern.h"
+#include "init.h"
+
+#define PHYS_HASHSIZE (8192)
+
+struct phys_desc;
+
+DEF_HASH_STRUCTS(virtmem, PHYS_HASHSIZE, struct phys_desc);
+
+struct phys_desc {
+	struct virtmem_ptrs virt_ptrs;
+	int fd;
+	__u64 offset;
+	void *virt;
+	unsigned long phys;
+};
+
+struct virtmem_table virtmem_hash;
+
+static int virt_cmp(void *virt1, void *virt2)
+{
+	return(virt1 != virt2);
+}
+
+static int virt_hash(void *virt)
+{
+	unsigned long addr = ((unsigned long) virt) >> PAGE_SHIFT;
+	return(addr % PHYS_HASHSIZE);
+}
+
+DEF_HASH(static, virtmem, struct phys_desc, virt_ptrs, void *, virt, virt_cmp, 
+	 virt_hash);
+
+int physmem_subst_mapping(void *virt, int fd, __u64 offset, int w)
+{
+	struct phys_desc *desc;
+	unsigned long phys;
+	int err;
+
+	virt = (void *) ((unsigned long) virt & PAGE_MASK);
+	err = os_map_memory(virt, fd, offset, PAGE_SIZE, 1, w, 0);
+	if(err)
+		goto out;
+
+	phys = __pa(virt);
+	if(find_virtmem_hash(&virtmem_hash, virt) != NULL)
+		panic("Address 0x%p is already substituted\n", virt);
+
+	err = -ENOMEM;
+	desc = kmalloc(sizeof(*desc), GFP_ATOMIC);
+	if(desc == NULL)
+		goto out;
+
+	*desc = ((struct phys_desc) { .virt_ptrs =	{ NULL, NULL },
+				      .fd =		fd,
+				      .offset =		offset,
+				      .virt =		virt,
+				      .phys =		__pa(virt) });
+	insert_virtmem_hash(&virtmem_hash, desc);
+	err = 0;
+ out:
+	return(err);
+}
+
+static int physmem_fd = -1;
+
+int physmem_remove_mapping(void *virt)
+{
+	struct phys_desc *desc;
+	int err;
+
+	virt = (void *) ((unsigned long) virt & PAGE_MASK);
+	desc = find_virtmem_hash(&virtmem_hash, virt);
+	if(desc == NULL)
+		return(0);
+
+	remove_virtmem_hash(&virtmem_hash, desc);
+	kfree(desc);
+
+	err = os_map_memory(virt, physmem_fd, __pa(virt), PAGE_SIZE, 1, 1, 0);
+	if(err)
+		panic("Failed to unmap block device page from physical memory, "
+		      "errno = %d", -err);
+	return(1);
+}
+
+void arch_free_page(struct page *page, int order)
+{
+	void *virt;
+	int i;
+
+	for(i = 0; i < 1 << order; i++){
+		virt = __va(page_to_phys(page + i));
+		physmem_remove_mapping(virt);
+	}
+}
+
+int is_remapped(void *virt)
+{
+	return(find_virtmem_hash(&virtmem_hash, virt) != NULL);
+}
+
+/* Changed during early boot */
+unsigned long high_physmem;
+
+extern unsigned long physmem_size;
+
+void *to_virt(unsigned long phys)
+{
+	return((void *) uml_physmem + phys);
+}
+
+unsigned long to_phys(void *virt)
+{
+	return(((unsigned long) virt) - uml_physmem);
+}
+
+int init_maps(unsigned long physmem, unsigned long iomem, unsigned long highmem)
+{
+	struct page *p, *map;
+	unsigned long phys_len, phys_pages, highmem_len, highmem_pages;
+	unsigned long iomem_len, iomem_pages, total_len, total_pages;
+	int i;
+
+	phys_pages = physmem >> PAGE_SHIFT;
+	phys_len = phys_pages * sizeof(struct page);
+
+	iomem_pages = iomem >> PAGE_SHIFT;
+	iomem_len = iomem_pages * sizeof(struct page);
+
+	highmem_pages = highmem >> PAGE_SHIFT;
+	highmem_len = highmem_pages * sizeof(struct page);
+
+	total_pages = phys_pages + iomem_pages + highmem_pages;
+	total_len = phys_len + iomem_pages + highmem_len;
+
+	if(kmalloc_ok){
+		map = kmalloc(total_len, GFP_KERNEL);
+		if(map == NULL) 
+			map = vmalloc(total_len);
+	}
+	else map = alloc_bootmem_low_pages(total_len);
+
+	if(map == NULL)
+		return(-ENOMEM);
+
+	for(i = 0; i < total_pages; i++){
+		p = &map[i];
+		set_page_count(p, 0);
+		SetPageReserved(p);
+		INIT_LIST_HEAD(&p->list);
+	}
+
+	mem_map = map;
+	max_mapnr = total_pages;
+	return(0);
+}
+
+struct page *phys_to_page(const unsigned long phys)
+{
+	return(&mem_map[phys >> PAGE_SHIFT]);
+}
+
+struct page *__virt_to_page(const unsigned long virt)
+{
+	return(&mem_map[__pa(virt) >> PAGE_SHIFT]);
+}
+
+unsigned long page_to_phys(struct page *page)
+{
+	return((page - mem_map) << PAGE_SHIFT);
+}
+
+pte_t mk_pte(struct page *page, pgprot_t pgprot)
+{
+	pte_t pte;
+
+	pte_val(pte) = page_to_phys(page) + pgprot_val(pgprot);
+	if(pte_present(pte)) pte_mknewprot(pte_mknewpage(pte));
+	return(pte);
+}
+
+/* Changed during early boot */
+static unsigned long kmem_top = 0;
+
+unsigned long get_kmem_end(void)
+{
+	if(kmem_top == 0) 
+		kmem_top = CHOOSE_MODE(kmem_end_tt, kmem_end_skas);
+	return(kmem_top);
+}
+
+void map_memory(unsigned long virt, unsigned long phys, unsigned long len, 
+		int r, int w, int x)
+{
+	__u64 offset;
+	int fd, err;
+
+	fd = phys_mapping(phys, &offset);
+	err = os_map_memory((void *) virt, fd, offset, len, r, w, x);
+	if(err)
+		panic("map_memory(0x%lx, %d, 0x%llx, %ld, %d, %d, %d) failed, "
+		      "err = %d\n", virt, fd, offset, len, r, w, x, err);
+}
+
+#define PFN_UP(x) (((x) + PAGE_SIZE-1) >> PAGE_SHIFT)
+
+void setup_physmem(unsigned long start, unsigned long reserve_end,
+		   unsigned long len, unsigned long highmem)
+{
+	unsigned long reserve = reserve_end - start;
+	int pfn = PFN_UP(__pa(reserve_end));
+	int delta = (len - reserve) >> PAGE_SHIFT;
+	int err, offset, bootmap_size;
+
+	physmem_fd = create_mem_file(len + highmem);
+
+	offset = uml_reserved - uml_physmem;
+	err = os_map_memory((void *) uml_reserved, physmem_fd, offset, 
+			    len - offset, 1, 1, 0);
+	if(err < 0){
+		os_print_error(err, "Mapping memory");
+		exit(1);
+	}
+
+	bootmap_size = init_bootmem(pfn, pfn + delta);
+	free_bootmem(__pa(reserve_end) + bootmap_size,
+		     len - bootmap_size - reserve);
+}
+
+int phys_mapping(unsigned long phys, __u64 *offset_out)
+{
+	struct phys_desc *desc = find_virtmem_hash(&virtmem_hash, 
+						   __va(phys & PAGE_MASK));
+	int fd = -1;
+
+	if(desc != NULL){
+		fd = desc->fd;
+		*offset_out = desc->offset;
+	}
+	else if(phys < physmem_size){
+		fd = physmem_fd;
+		*offset_out = phys;
+	}
+	else if(phys < __pa(end_iomem)){
+		struct iomem_region *region = iomem_regions;
+	
+		while(region != NULL){
+			if((phys >= region->phys) && 
+			   (phys < region->phys + region->size)){
+				fd = region->fd;
+				*offset_out = phys - region->phys;
+				break;
+			}
+			region = region->next;
+		}
+	}
+	else if(phys < __pa(end_iomem) + highmem){
+		fd = physmem_fd;
+		*offset_out = phys - iomem_size;
+	}
+
+	return(fd);
+}
+
+static int __init uml_mem_setup(char *line, int *add)
+{
+	char *retptr;
+	physmem_size = memparse(line,&retptr);
+	return 0;
+}
+__uml_setup("mem=", uml_mem_setup,
+"mem=<Amount of desired ram>\n"
+"    This controls how much \"physical\" memory the kernel allocates\n"
+"    for the system. The size is specified as a number followed by\n"
+"    one of 'k', 'K', 'm', 'M', which have the obvious meanings.\n"
+"    This is not related to the amount of memory in the host.  It can\n"
+"    be more, and the excess, if it's ever used, will just be swapped out.\n"
+"	Example: mem=64M\n\n"
+);
+
+unsigned long find_iomem(char *driver, unsigned long *len_out)
+{
+	struct iomem_region *region = iomem_regions;
+	
+	while(region != NULL){
+		if(!strcmp(region->driver, driver)){
+			*len_out = region->size;
+			return(region->virt);
+		}
+	}
+
+	return(0);
+}
+
+int setup_iomem(void)
+{
+	struct iomem_region *region = iomem_regions;
+	unsigned long iomem_start = high_physmem + PAGE_SIZE;
+	int err;
+
+	while(region != NULL){
+		err = os_map_memory((void *) iomem_start, region->fd, 0, 
+				    region->size, 1, 1, 0);
+		if(err)
+			printk("Mapping iomem region for driver '%s' failed, "
+			       "errno = %d\n", region->driver, -err);
+		else {
+			region->virt = iomem_start;
+			region->phys = __pa(region->virt);
+		}
+
+		iomem_start += region->size + PAGE_SIZE;
+		region = region->next;
+	}
+
+	return(0);
+}
+
+__initcall(setup_iomem);
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * Emacs will notice this stuff at the end of the file and automatically
+ * adjust the settings for this buffer only.  This must remain at the end
+ * of the file.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-file-style: "linux"
+ * End:
+ */
--- diff/arch/um/kernel/skas/uaccess.c	1970-01-01 01:00:00.000000000 +0100
+++ source/arch/um/kernel/skas/uaccess.c	2004-02-09 10:39:51.000000000 +0000
@@ -0,0 +1,219 @@
+/* 
+ * Copyright (C) 2002 - 2003 Jeff Dike (jdike@addtoit.com)
+ * Licensed under the GPL
+ */
+
+#include "linux/stddef.h"
+#include "linux/kernel.h"
+#include "linux/string.h"
+#include "linux/fs.h"
+#include "linux/highmem.h"
+#include "asm/page.h"
+#include "asm/pgtable.h"
+#include "asm/uaccess.h"
+#include "kern_util.h"
+
+extern void *um_virt_to_phys(struct task_struct *task, unsigned long addr, 
+			     pte_t *pte_out);
+
+static unsigned long maybe_map(unsigned long virt, int is_write)
+{
+	pte_t pte;
+	int err;
+
+	void *phys = um_virt_to_phys(current, virt, &pte);
+	int dummy_code;
+
+	if(IS_ERR(phys) || (is_write && !pte_write(pte))){
+		err = handle_page_fault(virt, 0, is_write, 0, &dummy_code);
+		if(err)
+			return(0);
+		phys = um_virt_to_phys(current, virt, NULL);
+	}
+	return((unsigned long) phys);
+}
+
+static int do_op(unsigned long addr, int len, int is_write, 
+		 int (*op)(unsigned long addr, int len, void *arg), void *arg)
+{
+	struct page *page;
+	int n;
+
+	addr = maybe_map(addr, is_write);
+	if(addr == -1)
+		return(-1);
+
+	page = phys_to_page(addr);
+	addr = (unsigned long) kmap(page) + (addr & ~PAGE_MASK);
+	n = (*op)(addr, len, arg);
+	kunmap(page);
+
+	return(n);
+}
+
+static int buffer_op(unsigned long addr, int len, int is_write,
+		     int (*op)(unsigned long addr, int len, void *arg),
+		     void *arg)
+{
+	int size = min(PAGE_ALIGN(addr) - addr, (unsigned long) len);
+	int remain = len, n;
+
+	n = do_op(addr, size, is_write, op, arg);
+	if(n != 0)
+		return(n < 0 ? remain : 0);
+
+	addr += size;
+	remain -= size;
+	if(remain == 0) 
+		return(0);
+
+	while(addr < ((addr + remain) & PAGE_MASK)){
+		n = do_op(addr, PAGE_SIZE, is_write, op, arg);
+		if(n != 0)
+			return(n < 0 ? remain : 0);
+
+		addr += PAGE_SIZE;
+		remain -= PAGE_SIZE;
+	}
+	if(remain == 0)
+		return(0);
+
+	n = do_op(addr, remain, is_write, op, arg);
+	if(n != 0)
+		return(n < 0 ? remain : 0);
+	return(0);
+}
+
+static int copy_chunk_from_user(unsigned long from, int len, void *arg)
+{
+	unsigned long *to_ptr = arg, to = *to_ptr;
+
+	memcpy((void *) to, (void *) from, len);
+	*to_ptr += len;
+	return(0);
+}
+
+int copy_from_user_skas(void *to, const void *from, int n)
+{
+	if(segment_eq(get_fs(), KERNEL_DS)){
+		memcpy(to, from, n);
+		return(0);
+	}
+
+	return(access_ok_skas(VERIFY_READ, from, n) ?
+	       buffer_op((unsigned long) from, n, 0, copy_chunk_from_user, &to):
+	       n);
+}
+
+static int copy_chunk_to_user(unsigned long to, int len, void *arg)
+{
+	unsigned long *from_ptr = arg, from = *from_ptr;
+
+	memcpy((void *) to, (void *) from, len);
+	*from_ptr += len;
+	return(0);
+}
+
+int copy_to_user_skas(void *to, const void *from, int n)
+{
+	if(segment_eq(get_fs(), KERNEL_DS)){
+		memcpy(to, from, n);
+		return(0);
+	}
+
+	return(access_ok_skas(VERIFY_WRITE, to, n) ?
+	       buffer_op((unsigned long) to, n, 1, copy_chunk_to_user, &from) :
+	       n);
+}
+
+static int strncpy_chunk_from_user(unsigned long from, int len, void *arg)
+{
+	char **to_ptr = arg, *to = *to_ptr;
+	int n;
+
+	strncpy(to, (void *) from, len);
+	n = strnlen(to, len);
+	*to_ptr += n;
+
+	if(n < len) 
+	        return(1);
+	return(0);
+}
+
+int strncpy_from_user_skas(char *dst, const char *src, int count)
+{
+	int n;
+	char *ptr = dst;
+
+	if(segment_eq(get_fs(), KERNEL_DS)){
+		strncpy(dst, src, count);
+		return(strnlen(dst, count));
+	}
+
+	if(!access_ok_skas(VERIFY_READ, src, 1))
+		return(-EFAULT);
+
+	n = buffer_op((unsigned long) src, count, 0, strncpy_chunk_from_user, 
+		      &ptr);
+	if(n != 0)
+		return(-EFAULT);
+	return(strnlen(dst, count));
+}
+
+static int clear_chunk(unsigned long addr, int len, void *unused)
+{
+	memset((void *) addr, 0, len);
+	return(0);
+}
+
+int __clear_user_skas(void *mem, int len)
+{
+	return(buffer_op((unsigned long) mem, len, 1, clear_chunk, NULL));
+}
+
+int clear_user_skas(void *mem, int len)
+{
+	if(segment_eq(get_fs(), KERNEL_DS)){
+		memset(mem, 0, len);
+		return(0);
+	}
+
+	return(access_ok_skas(VERIFY_WRITE, mem, len) ? 
+	       buffer_op((unsigned long) mem, len, 1, clear_chunk, NULL) : len);
+}
+
+static int strnlen_chunk(unsigned long str, int len, void *arg)
+{
+	int *len_ptr = arg, n;
+
+	n = strnlen((void *) str, len);
+	*len_ptr += n;
+
+	if(n < len)
+		return(1);
+	return(0);
+}
+
+int strnlen_user_skas(const void *str, int len)
+{
+	int count = 0, n;
+
+	if(segment_eq(get_fs(), KERNEL_DS))
+		return(strnlen(str, len) + 1);
+
+	n = buffer_op((unsigned long) str, len, 0, strnlen_chunk, &count);
+	if(n == 0)
+		return(count + 1);
+	return(-EFAULT);
+}
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * Emacs will notice this stuff at the end of the file and automatically
+ * adjust the settings for this buffer only.  This must remain at the end
+ * of the file.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-file-style: "linux"
+ * End:
+ */
--- diff/arch/um/kernel/tt/uaccess.c	1970-01-01 01:00:00.000000000 +0100
+++ source/arch/um/kernel/tt/uaccess.c	2004-02-09 10:39:51.000000000 +0000
@@ -0,0 +1,73 @@
+/* 
+ * Copyright (C) 2000 - 2003 Jeff Dike (jdike@addtoit.com)
+ * Licensed under the GPL
+ */
+
+#include "linux/sched.h"
+#include "asm/uaccess.h"
+
+int copy_from_user_tt(void *to, const void *from, int n)
+{
+	if(!access_ok_tt(VERIFY_READ, from, n)) 
+		return(n);
+
+	return(__do_copy_from_user(to, from, n, &current->thread.fault_addr,
+				   &current->thread.fault_catcher));
+}
+
+int copy_to_user_tt(void *to, const void *from, int n)
+{
+	if(!access_ok_tt(VERIFY_WRITE, to, n))
+		return(n);
+		
+	return(__do_copy_to_user(to, from, n, &current->thread.fault_addr,
+				 &current->thread.fault_catcher));
+}
+
+int strncpy_from_user_tt(char *dst, const char *src, int count)
+{
+	int n;
+
+	if(!access_ok_tt(VERIFY_READ, src, 1)) 
+		return(-EFAULT);
+
+	n = __do_strncpy_from_user(dst, src, count, 
+				   &current->thread.fault_addr,
+				   &current->thread.fault_catcher);
+	if(n < 0) return(-EFAULT);
+	return(n);
+}
+
+int __clear_user_tt(void *mem, int len)
+{
+	return(__do_clear_user(mem, len,
+			       &current->thread.fault_addr,
+			       &current->thread.fault_catcher));
+}
+
+int clear_user_tt(void *mem, int len)
+{
+	if(!access_ok_tt(VERIFY_WRITE, mem, len))
+		return(len);
+
+	return(__do_clear_user(mem, len, &current->thread.fault_addr,
+			       &current->thread.fault_catcher));
+}
+
+int strnlen_user_tt(const void *str, int len)
+{
+	return(__do_strnlen_user(str, len,
+				 &current->thread.fault_addr,
+				 &current->thread.fault_catcher));
+}
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * Emacs will notice this stuff at the end of the file and automatically
+ * adjust the settings for this buffer only.  This must remain at the end
+ * of the file.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-file-style: "linux"
+ * End:
+ */
--- diff/arch/um/sys-i386/time.c	1970-01-01 01:00:00.000000000 +0100
+++ source/arch/um/sys-i386/time.c	2004-02-09 10:39:51.000000000 +0000
@@ -0,0 +1,24 @@
+/*
+ * sys-i386/time.c 
+ * Created 		25.9.2002	Sapan Bhatia
+ *
+ */
+
+unsigned long long time_stamp(void)
+{
+	unsigned long low, high;
+
+	asm("rdtsc" : "=a" (low), "=d" (high));
+	return((((unsigned long long) high) << 32) + low);
+}
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * Emacs will notice this stuff at the end of the file and automatically
+ * adjust the settings for this buffer only.  This must remain at the end
+ * of the file.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-file-style: "linux"
+ * End:
+ */
--- diff/arch/x86_64/Kconfig.kgdb	1970-01-01 01:00:00.000000000 +0100
+++ source/arch/x86_64/Kconfig.kgdb	2004-02-09 10:39:51.000000000 +0000
@@ -0,0 +1,176 @@
+config KGDB
+	bool "Include kgdb kernel debugger"
+	depends on DEBUG_KERNEL
+	select DEBUG_INFO
+	help
+	  If you say Y here, the system will be compiled with the debug
+	  option (-g) and a debugging stub will be included in the
+	  kernel.  This stub communicates with gdb on another (host)
+	  computer via a serial port.  The host computer should have
+	  access to the kernel binary file (vmlinux) and a serial port
+	  that is connected to the target machine.  Gdb can be made to
+	  configure the serial port or you can use stty and setserial to
+	  do this. See the 'target' command in gdb. This option also
+	  configures in the ability to request a breakpoint early in the
+	  boot process.  To request the breakpoint just include 'kgdb'
+	  as a boot option when booting the target machine.  The system
+	  will then break as soon as it looks at the boot options.  This
+	  option also installs a breakpoint in panic and sends any
+	  kernel faults to the debugger. For more information see the
+	  Documentation/i386/kgdb.txt file.
+
+choice
+	depends on KGDB
+    	prompt "Debug serial port BAUD"
+	default KGDB_115200BAUD
+	help
+	  Gdb and the kernel stub need to agree on the baud rate to be
+	  used.  Some systems (x86 family at this writing) allow this to
+	  be configured.
+
+config KGDB_9600BAUD
+	bool "9600"
+
+config KGDB_19200BAUD
+	bool "19200"
+
+config KGDB_38400BAUD
+	bool "38400"
+
+config KGDB_57600BAUD
+	bool "57600"
+
+config KGDB_115200BAUD
+	bool "115200"
+endchoice
+
+config KGDB_PORT
+	hex "hex I/O port address of the debug serial port"
+	depends on KGDB
+	default  3f8
+	help
+	  Some systems (x86 family at this writing) allow the port
+	  address to be configured.  The number entered is assumed to be
+	  hex, don't put 0x in front of it.  The standard address are:
+	  COM1 3f8 , irq 4 and COM2 2f8 irq 3.  Setserial /dev/ttySx
+	  will tell you what you have.  It is good to test the serial
+	  connection with a live system before trying to debug.
+
+config KGDB_IRQ
+	int "IRQ of the debug serial port"
+	depends on KGDB
+	default 4
+	help
+	  This is the irq for the debug port.  If everything is working
+	  correctly and the kernel has interrupts on a control C to the
+	  port should cause a break into the kernel debug stub.
+
+config DEBUG_INFO
+	bool
+	depends on KGDB
+	default y
+
+config KGDB_MORE
+	bool "Add any additional compile options"
+	depends on KGDB
+	default n
+	help
+	  Saying yes here turns on the ability to enter additional
+	  compile options.
+
+
+config KGDB_OPTIONS
+	depends on KGDB_MORE
+	string "Additional compile arguments"
+	default "-O1"
+	help
+	  This option allows you enter additional compile options for
+	  the whole kernel compile.  Each platform will have a default
+	  that seems right for it.  For example on PPC "-ggdb -O1", and
+	  for i386 "-O1".  Note that by configuring KGDB "-g" is already
+	  turned on.  In addition, on i386 platforms
+	  "-fomit-frame-pointer" is deleted from the standard compile
+	  options.
+
+config NO_KGDB_CPUS
+	int "Number of CPUs"
+	depends on KGDB && SMP
+	default NR_CPUS
+	help
+
+	  This option sets the number of cpus for kgdb ONLY.  It is used
+	  to prune some internal structures so they look "nice" when
+	  displayed with gdb.  This is to overcome possibly larger
+	  numbers that may have been entered above.  Enter the real
+	  number to get nice clean kgdb_info displays.
+
+config KGDB_TS
+	bool "Enable kgdb time stamp macros?"
+	depends on KGDB
+	default n
+	help
+	  Kgdb event macros allow you to instrument your code with calls
+	  to the kgdb event recording function.  The event log may be
+	  examined with gdb at a break point.  Turning on this
+	  capability also allows you to choose how many events to
+	  keep. Kgdb always keeps the lastest events.
+
+choice
+	depends on KGDB_TS
+	prompt "Max number of time stamps to save?"
+	default KGDB_TS_128
+
+config KGDB_TS_64
+	bool "64"
+
+config KGDB_TS_128
+	bool "128"
+
+config KGDB_TS_256
+	bool "256"
+
+config KGDB_TS_512
+	bool "512"
+
+config KGDB_TS_1024
+	bool "1024"
+
+endchoice
+
+config STACK_OVERFLOW_TEST
+	bool "Turn on kernel stack overflow testing?"
+	depends on KGDB
+	default n
+	help
+	  This option enables code in the front line interrupt handlers
+	  to check for kernel stack overflow on interrupts and system
+	  calls.  This is part of the kgdb code on x86 systems.
+
+config KGDB_CONSOLE
+	bool "Enable serial console thru kgdb port"
+	depends on KGDB
+	default n
+	help
+	  This option enables the command line "console=kgdb" option.
+	  When the system is booted with this option in the command line
+	  all kernel printk output is sent to gdb (as well as to other
+	  consoles).  For this to work gdb must be connected.  For this
+	  reason, this command line option will generate a breakpoint if
+	  gdb has not yet connected.  After the gdb continue command is
+	  given all pent up console output will be printed by gdb on the
+	  host machine.  Neither this option, nor KGDB require the
+	  serial driver to be configured.
+
+config KGDB_SYSRQ
+	bool "Turn on SysRq 'G' command to do a break?"
+	depends on KGDB
+	default y
+	help
+	  This option includes an option in the SysRq code that allows
+	  you to enter SysRq G which generates a breakpoint to the KGDB
+	  stub.  This will work if the keyboard is alive and can
+	  interrupt the system.  Because of constraints on when the
+	  serial port interrupt can be enabled, this code may allow you
+	  to interrupt the system before the serial port control C is
+	  available.  Just say yes here.
+
--- diff/arch/x86_64/kernel/kgdb_stub.c	1970-01-01 01:00:00.000000000 +0100
+++ source/arch/x86_64/kernel/kgdb_stub.c	2004-02-09 10:39:51.000000000 +0000
@@ -0,0 +1,2595 @@
+/*
+ *
+ * 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.
+ *
+ */
+
+/*
+ * Copyright (c) 2000 VERITAS Software Corporation.
+ *
+ */
+/****************************************************************************
+ *  Header: remcom.c,v 1.34 91/03/09 12:29:49 glenne Exp $
+ *
+ *  Module name: remcom.c $
+ *  Revision: 1.34 $
+ *  Date: 91/03/09 12:29:49 $
+ *  Contributor:     Lake Stevens Instrument Division$
+ *
+ *  Description:     low level support for gdb debugger. $
+ *
+ *  Considerations:  only works on target hardware $
+ *
+ *  Written by:	     Glenn Engel $
+ *  Updated by:	     David Grothe <dave@gcom.com>
+ *  Updated by:	     Robert Walsh <rjwalsh@durables.org>
+ *  Updated by:	     wangdi <wangdi@clusterfs.com>
+ *  ModuleState:     Experimental $
+ *
+ *  NOTES:	     See Below $
+ *
+ *  Modified for 386 by Jim Kingdon, Cygnus Support.
+ *  Compatibility with 2.1.xx kernel by David Grothe <dave@gcom.com>
+ *
+ *  Changes to allow auto initilization.  All that is needed is that it
+ *  be linked with the kernel and a break point (int 3) be executed.
+ *  The header file <asm/kgdb.h> defines BREAKPOINT to allow one to do
+ *  this. It should also be possible, once the interrupt system is up, to
+ *  call putDebugChar("+").  Once this is done, the remote debugger should
+ *  get our attention by sending a ^C in a packet. George Anzinger
+ *  <george@mvista.com>
+ *  Integrated into 2.2.5 kernel by Tigran Aivazian <tigran@sco.com>
+ *  Added thread support, support for multiple processors,
+ *	support for ia-32(x86) hardware debugging.
+ *	Amit S. Kale ( akale@veritas.com )
+ *
+ *  Modified to support debugging over ethernet by Robert Walsh
+ *  <rjwalsh@durables.org> and wangdi <wangdi@clusterfs.com>, based on
+ *  code by San Mehat.
+ *
+ *  X86_64 changes from Andi Kleen's patch merged by Jim Houston
+ * 	(jim.houston@ccur.com).  If it works thank Andi if its broken
+ * 	blame me.
+ *
+ *  To enable debugger support, two things need to happen.  One, a
+ *  call to set_debug_traps() is necessary in order to allow any breakpoints
+ *  or error conditions to be properly intercepted and reported to gdb.
+ *  Two, a breakpoint needs to be generated to begin communication.  This
+ *  is most easily accomplished by a call to breakpoint().  Breakpoint()
+ *  simulates a breakpoint by executing an int 3.
+ *
+ *************
+ *
+ *    The following gdb commands are supported:
+ *
+ * command	    function				   Return value
+ *
+ *    g		    return the value of the CPU registers  hex data or ENN
+ *    G		    set the value of the CPU registers	   OK or ENN
+ *
+ *    mAA..AA,LLLL  Read LLLL bytes at address AA..AA	   hex data or ENN
+ *    MAA..AA,LLLL: Write LLLL bytes at address AA.AA	   OK or ENN
+ *
+ *    c		    Resume at current address		   SNN	 ( signal NN)
+ *    cAA..AA	    Continue at address AA..AA		   SNN
+ *
+ *    s		    Step one instruction		   SNN
+ *    sAA..AA	    Step one instruction from AA..AA	   SNN
+ *
+ *    k		    kill
+ *
+ *    ?		    What was the last sigval ?		   SNN	 (signal NN)
+ *
+ * All commands and responses are sent with a packet which includes a
+ * checksum.  A packet consists of
+ *
+ * $<packet info>#<checksum>.
+ *
+ * where
+ * <packet info> :: <characters representing the command or response>
+ * <checksum>	 :: < two hex digits computed as modulo 256 sum of <packetinfo>>
+ *
+ * When a packet is received, it is first acknowledged with either '+' or '-'.
+ * '+' indicates a successful transfer.	 '-' indicates a failed transfer.
+ *
+ * Example:
+ *
+ * Host:		  Reply:
+ * $m0,10#2a		   +$00010203040506070809101112131415#42
+ *
+ ****************************************************************************/
+#define KGDB_VERSION "<20030915.1651.33>"
+#include <linux/config.h>
+#include <linux/types.h>
+#include <asm/string.h>		/* for strcpy */
+#include <linux/kernel.h>
+#include <linux/sched.h>
+#include <asm/system.h>
+#include <asm/ptrace.h>		/* for linux pt_regs struct */
+#include <asm/kgdb_local.h>
+#include <linux/list.h>
+#include <asm/atomic.h>
+#include <asm/processor.h>
+#include <linux/irq.h>
+#include <asm/desc.h>
+#include <linux/inet.h>
+#include <linux/netpoll.h>
+#include <linux/cpumask.h>
+#include <linux/bitops.h>
+#include <linux/notifier.h>
+#include <asm/kdebug.h>
+#include <asm/uaccess.h>
+#include <linux/ptrace.h>
+
+#define Dearly_printk(x...)
+int kgdb_enabled = 0;
+
+/************************************************************************
+ *
+ * external low-level support routines
+ */
+typedef void (*Function) (void);	/* pointer to a function */
+
+/* Thread reference */
+typedef unsigned char threadref[8];
+
+extern int tty_putDebugChar(int);     /* write a single character      */
+extern int tty_getDebugChar(void);    /* read and return a single char */
+extern void tty_flushDebugChar(void); /* flush pending characters      */
+extern int eth_putDebugChar(int);     /* write a single character      */
+extern int eth_getDebugChar(void);    /* read and return a single char */
+extern void eth_flushDebugChar(void); /* flush pending characters      */
+
+/************************************************************************/
+/* BUFMAX defines the maximum number of characters in inbound/outbound buffers*/
+/* at least NUMREGBYTES*2 are needed for register packets */
+/* Longer buffer is needed to list all threads */
+#define BUFMAX 400
+
+char *kgdb_version = KGDB_VERSION;
+
+/*  debug >  0 prints ill-formed commands in valid packets & checksum errors */
+int debug_regs = 0;		/* set to non-zero to print registers */
+
+/* filled in by an external module */
+char *gdb_module_offsets;
+
+static const char hexchars[] = "0123456789abcdef";
+
+/* Number of bytes of registers.  */
+#define NUMREGBYTES (NUMREGS * sizeof(unsigned long))
+/*
+ * Note that this register image is in a different order than
+ * the register image that Linux produces at interrupt time.
+ *
+ * Linux's register image is defined by struct pt_regs in ptrace.h.
+ * Just why GDB uses a different order is a historical mystery.
+ *
+ * Could add XMM and segment registers here.
+ */
+enum regnames {_RAX,
+	       _RBX,
+	       _RCX,
+	       _RDX,
+	       _RSI,
+	       _RDI,
+	       _RBP,
+	       _RSP,
+	       _R8,
+	       _R9,
+	       _R10,
+	       _R11,
+	       _R12,
+	       _R13,
+	       _R14,
+	       _R15,
+	       _PC,
+	       _PS,
+	       NUMREGS };
+
+
+/***************************  ASSEMBLY CODE MACROS *************************/
+/*
+ * Put the error code here just in case the user cares.
+ * Likewise, the vector number here (since GDB only gets the signal
+ * number through the usual means, and that's not very specific).
+ * The called_from is the return address so he can tell how we entered kgdb.
+ * This will allow him to seperate out the various possible entries.
+ */
+#define REMOTE_DEBUG 0		/* set != to turn on printing (also available in info) */
+
+#define PID_MAX PID_MAX_DEFAULT
+
+#ifdef CONFIG_SMP
+void smp_send_nmi_allbutself(void);
+#define IF_SMP(x) x
+#undef MAX_NO_CPUS
+#ifndef CONFIG_NO_KGDB_CPUS
+#define CONFIG_NO_KGDB_CPUS 2
+#endif
+#if CONFIG_NO_KGDB_CPUS > NR_CPUS
+#define MAX_NO_CPUS NR_CPUS
+#else
+#define MAX_NO_CPUS CONFIG_NO_KGDB_CPUS
+#endif
+#define hold_init hold_on_sstep: 1,
+#define MAX_CPU_MASK (unsigned long)((1LL << MAX_NO_CPUS) - 1LL)
+#define NUM_CPUS num_online_cpus()
+#else
+#define IF_SMP(x)
+#define hold_init
+#undef MAX_NO_CPUS
+#define MAX_NO_CPUS 1
+#define NUM_CPUS 1
+#endif
+#define NOCPU (struct task_struct *)0xbad1fbad
+/* *INDENT-OFF*	 */
+struct kgdb_info {
+	int used_malloc;
+	void *called_from;
+	long long entry_tsc;
+	int errcode;
+	int vector;
+	int print_debug_info;
+#ifdef CONFIG_SMP
+	int hold_on_sstep;
+	struct {
+		volatile struct task_struct *task;
+		int pid;
+		int hold;
+		struct pt_regs *regs;
+	} cpus_waiting[MAX_NO_CPUS];
+#endif
+} kgdb_info = {hold_init print_debug_info:REMOTE_DEBUG, vector:-1};
+
+/* *INDENT-ON*	*/
+
+#define used_m kgdb_info.used_malloc
+/*
+ * This is little area we set aside to contain the stack we
+ * need to build to allow gdb to call functions.  We use one
+ * per cpu to avoid locking issues.  We will do all this work
+ * with interrupts off so that should take care of the protection
+ * issues.
+ */
+#define LOOKASIDE_SIZE 200	/* should be more than enough */
+#define MALLOC_MAX   200	/* Max malloc size */
+struct {
+	unsigned long rsp;
+	unsigned long array[LOOKASIDE_SIZE];
+} fn_call_lookaside[MAX_NO_CPUS];
+
+static int trap_cpu;
+static unsigned long OLD_esp;
+
+#define END_OF_LOOKASIDE  &fn_call_lookaside[trap_cpu].array[LOOKASIDE_SIZE]
+#define IF_BIT 0x200
+#define TF_BIT 0x100
+
+#define MALLOC_ROUND 8-1
+
+static char malloc_array[MALLOC_MAX];
+IF_SMP(static void to_gdb(const char *mess));
+void *
+malloc(int size)
+{
+
+	if (size <= (MALLOC_MAX - used_m)) {
+		int old_used = used_m;
+		used_m += ((size + MALLOC_ROUND) & (~MALLOC_ROUND));
+		return &malloc_array[old_used];
+	} else {
+		return NULL;
+	}
+}
+
+/*
+ * I/O dispatch functions...
+ * Based upon kgdboe, either call the ethernet
+ * handler or the serial one..
+ */
+void
+putDebugChar(int c)
+{
+	if (!kgdboe) {
+		tty_putDebugChar(c);
+	} else {
+		eth_putDebugChar(c);
+	}
+}
+
+int
+getDebugChar(void)
+{
+	if (!kgdboe) {
+		return tty_getDebugChar();
+	} else {
+		return eth_getDebugChar();
+	}
+}
+
+void
+flushDebugChar(void)
+{
+	if (!kgdboe) {
+		tty_flushDebugChar();
+	} else {
+		eth_flushDebugChar();
+	}
+}
+
+/*
+ * Gdb calls functions by pushing agruments, including a return address
+ * on the stack and the adjusting EIP to point to the function.	 The
+ * whole assumption in GDB is that we are on a different stack than the
+ * one the "user" i.e. code that hit the break point, is on.  This, of
+ * course is not true in the kernel.  Thus various dodges are needed to
+ * do the call without directly messing with EIP (which we can not change
+ * as it is just a location and not a register.	 To adjust it would then
+ * require that we move every thing below EIP up or down as needed.  This
+ * will not work as we may well have stack relative pointer on the stack
+ * (such as the pointer to regs, for example).
+
+ * So here is what we do:
+ * We detect gdb attempting to store into the stack area and instead, store
+ * into the fn_call_lookaside.array at the same relative location as if it
+ * were the area ESP pointed at.  We also trap ESP modifications
+ * and uses these to adjust fn_call_lookaside.esp.  On entry
+ * fn_call_lookaside.esp will be set to point at the last entry in
+ * fn_call_lookaside.array.  This allows us to check if it has changed, and
+ * if so, on exit, we add the registers we will use to do the move and a
+ * trap/ interrupt return exit sequence.  We then adjust the eflags in the
+ * regs array (remember we now have a copy in the fn_call_lookaside.array) to
+ * kill the interrupt bit, AND we change EIP to point at our set up stub.
+ * As part of the register set up we preset the registers to point at the
+ * begining and end of the fn_call_lookaside.array, so all the stub needs to
+ * do is move words from the array to the stack until ESP= the desired value
+ * then do the rti.  This will then transfer to the desired function with
+ * all the correct registers.  Nifty huh?
+ */
+extern asmlinkage void fn_call_stub(void);
+extern asmlinkage void fn_rtn_stub(void);
+/*					   *INDENT-OFF*	 */
+__asm__("fn_rtn_stub:\n\t"
+	"movq %rax,%rsp\n\t"
+	"fn_call_stub:\n\t"
+	"1:\n\t"
+	"addq $-8,%rbx\n\t"
+	"movq (%rbx), %rax\n\t"
+	"pushq %rax\n\t"
+	"cmpq %rsp,%rcx\n\t"
+	"jne  1b\n\t"
+	"popq %rax\n\t"
+	"popq %rbx\n\t"
+	"popq %rcx\n\t"
+	"iret \n\t");
+/*					     *INDENT-ON*  */
+#define gdb_i386vector	kgdb_info.vector
+#define gdb_i386errcode kgdb_info.errcode
+#define waiting_cpus	kgdb_info.cpus_waiting
+#define remote_debug	kgdb_info.print_debug_info
+#define hold_cpu(cpu)	kgdb_info.cpus_waiting[cpu].hold
+/* gdb locks */
+
+#ifdef CONFIG_SMP
+static int in_kgdb_called;
+static spinlock_t waitlocks[MAX_NO_CPUS] =
+    {[0 ... MAX_NO_CPUS - 1] = SPIN_LOCK_UNLOCKED };
+/*
+ * The following array has the thread pointer of each of the "other"
+ * cpus.  We make it global so it can be seen by gdb.
+ */
+volatile int in_kgdb_entry_log[MAX_NO_CPUS];
+volatile struct pt_regs *in_kgdb_here_log[MAX_NO_CPUS];
+/*
+static spinlock_t continuelocks[MAX_NO_CPUS];
+*/
+spinlock_t kgdb_spinlock = SPIN_LOCK_UNLOCKED;
+/* waiters on our spinlock plus us */
+static atomic_t spinlock_waiters = ATOMIC_INIT(1);
+static int spinlock_count = 0;
+static int spinlock_cpu = 0;
+/*
+ * Note we use nested spin locks to account for the case where a break
+ * point is encountered when calling a function by user direction from
+ * kgdb. Also there is the memory exception recursion to account for.
+ * Well, yes, but this lets other cpus thru too.  Lets add a
+ * cpu id to the lock.
+ */
+#define KGDB_SPIN_LOCK(x) if( spinlock_count == 0 || \
+			      spinlock_cpu != smp_processor_id()){\
+				      atomic_inc(&spinlock_waiters); \
+				      while (! spin_trylock(x)) {\
+					    in_kgdb(&regs);\
+				      }\
+				      atomic_dec(&spinlock_waiters); \
+				      spinlock_count = 1; \
+				      spinlock_cpu = smp_processor_id(); \
+			  }else{  \
+				      spinlock_count++; \
+			  }
+#define KGDB_SPIN_UNLOCK(x) if( --spinlock_count == 0) spin_unlock(x)
+#else
+unsigned kgdb_spinlock = 0;
+#define KGDB_SPIN_LOCK(x) --*x
+#define KGDB_SPIN_UNLOCK(x) ++*x
+#endif
+
+int
+hex(char ch)
+{
+	if ((ch >= 'a') && (ch <= 'f'))
+		return (ch - 'a' + 10);
+	if ((ch >= '0') && (ch <= '9'))
+		return (ch - '0');
+	if ((ch >= 'A') && (ch <= 'F'))
+		return (ch - 'A' + 10);
+	return (-1);
+}
+
+/* scan for the sequence $<data>#<checksum>	*/
+void
+getpacket(char *buffer)
+{
+	unsigned char checksum;
+	unsigned char xmitcsum;
+	int i;
+	int count;
+	char ch;
+
+	do {
+		/* wait around for the start character, ignore all other characters */
+		while ((ch = (getDebugChar() & 0x7f)) != '$') ;
+		checksum = 0;
+		xmitcsum = -1;
+
+		count = 0;
+
+		/* now, read until a # or end of buffer is found */
+		while (count < BUFMAX) {
+			ch = getDebugChar() & 0x7f;
+			if (ch == '#')
+				break;
+			checksum = checksum + ch;
+			buffer[count] = ch;
+			count = count + 1;
+		}
+		buffer[count] = 0;
+
+		if (ch == '#') {
+			xmitcsum = hex(getDebugChar() & 0x7f) << 4;
+			xmitcsum += hex(getDebugChar() & 0x7f);
+			if ((remote_debug) && (checksum != xmitcsum)) {
+				printk
+				    ("bad checksum.	My count = 0x%x, sent=0x%x. buf=%s\n",
+				     checksum, xmitcsum, buffer);
+			}
+
+			if (checksum != xmitcsum)
+				putDebugChar('-');	/* failed checksum */
+			else {
+				putDebugChar('+');	/* successful transfer */
+				/* if a sequence char is present, reply the sequence ID */
+				if (buffer[2] == ':') {
+					putDebugChar(buffer[0]);
+					putDebugChar(buffer[1]);
+					/* remove sequence chars from buffer */
+					count = strlen(buffer);
+					for (i = 3; i <= count; i++)
+						buffer[i - 3] = buffer[i];
+				}
+			}
+		}
+	} while (checksum != xmitcsum);
+
+	if (remote_debug)
+		printk("R:%s\n", buffer);
+	flushDebugChar();
+}
+
+/* send the packet in buffer.  */
+
+void
+putpacket(char *buffer)
+{
+	unsigned char checksum;
+	int count;
+	char ch;
+
+	/*  $<packet info>#<checksum>. */
+
+	if (!kgdboe) {
+		do {
+			if (remote_debug)
+				printk("T:%s\n", buffer);
+			putDebugChar('$');
+			checksum = 0;
+			count = 0;
+
+			while ((ch = buffer[count])) {
+				putDebugChar(ch);
+				checksum += ch;
+				count += 1;
+			}
+
+			putDebugChar('#');
+			putDebugChar(hexchars[checksum >> 4]);
+			putDebugChar(hexchars[checksum % 16]);
+			flushDebugChar();
+
+		} while ((getDebugChar() & 0x7f) != '+');
+	} else {
+		/*
+		 * For udp, we can not transfer too much bytes once.
+		 * We only transfer MAX_SEND_COUNT size bytes each time
+		 */
+
+#define MAX_SEND_COUNT 30
+
+		int send_count = 0, i = 0;
+		char send_buf[MAX_SEND_COUNT];
+
+		do {
+			if (remote_debug)
+				printk("T:%s\n", buffer);
+			putDebugChar('$');
+			checksum = 0;
+			count = 0;
+			send_count = 0;
+			while ((ch = buffer[count])) {
+				if (send_count >= MAX_SEND_COUNT) {
+					for(i = 0; i < MAX_SEND_COUNT; i++) {
+						putDebugChar(send_buf[i]);
+					}
+					flushDebugChar();
+					send_count = 0;
+				} else {
+					send_buf[send_count] = ch;
+					checksum += ch;
+					count ++;
+					send_count++;
+				}
+			}
+			for(i = 0; i < send_count; i++)
+				putDebugChar(send_buf[i]);
+			putDebugChar('#');
+			putDebugChar(hexchars[checksum >> 4]);
+			putDebugChar(hexchars[checksum % 16]);
+			flushDebugChar();
+		} while ((getDebugChar() & 0x7f) != '+');
+	}
+}
+
+static char remcomInBuffer[BUFMAX];
+static char remcomOutBuffer[BUFMAX];
+static char lbuf[BUFMAX];
+static short error;
+
+void
+debug_error(char *format, char *parm)
+{
+	if (remote_debug)
+		printk(format, parm);
+}
+
+static void
+print_regs(struct pt_regs *regs)
+{
+	printk("RAX=%016lx RBX=%016lx RCX=%016lx\n",
+		regs->rax, regs->rbx, regs->rcx);
+	printk("RDX=%016lx RSI=%016lx RDI=%016lx\n",
+		regs->rdx, regs->rsi, regs->rdi);
+	printk("RBP=%016lx PS=%016lx PC=%016lx\n",
+		regs->rbp, regs->eflags, regs->rip);
+ 	printk("R8=%016lx R9=%016lx R10=%016lx\n",
+		regs->r8, regs->r9, regs->r10);
+	printk("R11=%016lx R12=%016lx R13=%016lx\n",
+		regs->r11, regs->r12, regs->r13);
+	printk("R14=%016lx R15=%016lx RSP=%016lx\n",
+		regs->r14, regs->r15, regs->rsp);
+}
+
+#define NEW_esp fn_call_lookaside[trap_cpu].rsp
+
+static void
+regs_to_gdb_regs(unsigned long *gdb_regs, struct pt_regs *regs)
+{
+	gdb_regs[_RAX] =  regs->rax;
+	gdb_regs[_RBX] =  regs->rbx;
+	gdb_regs[_RCX] =  regs->rcx;
+	gdb_regs[_RDX] =  regs->rdx;
+	gdb_regs[_RSI] =  regs->rsi;
+	gdb_regs[_RDI] =  regs->rdi;
+	gdb_regs[_RBP] =  regs->rbp;
+	gdb_regs[ _PS] =  regs->eflags;
+	gdb_regs[ _PC] =  regs->rip;
+	gdb_regs[ _R8] =  regs->r8;
+	gdb_regs[ _R9] =  regs->r9;
+	gdb_regs[_R10] = regs->r10;
+	gdb_regs[_R11] = regs->r11;
+	gdb_regs[_R12] = regs->r12;
+	gdb_regs[_R13] = regs->r13;
+	gdb_regs[_R14] = regs->r14;
+	gdb_regs[_R15] = regs->r15;
+	gdb_regs[_RSP] =  regs->rsp;
+
+	/* Note, as we are a debugging the kernel, we will always
+	 * trap in kernel code, this means no priviledge change,
+	 * and so the pt_regs structure is not completely valid.  In a non
+	 * privilege change trap, only EFLAGS, CS and EIP are put on the stack,
+	 * SS and ESP are not stacked, this means that the last 2 elements of
+	 * pt_regs is not valid (they would normally refer to the user stack)
+	 * also, using regs+1 is no good because you end up will a value that is
+	 * 2 longs (8) too high.  This used to cause stepping over functions
+	 * to fail, so my fix is to use the address of regs->esp, which
+	 * should point at the end of the stack frame.	Note I have ignored
+	 * completely exceptions that cause an error code to be stacked, such
+	 * as double fault.  Stuart Hughes, Zentropix.
+	 * original code: gdb_regs[_ESP] =  (int) (regs + 1) ;
+
+	 * this is now done on entry and moved to OLD_esp (as well as NEW_esp).
+	 */
+}
+
+static void
+gdb_regs_to_regs(unsigned long *gdb_regs, struct pt_regs *regs)
+{
+	regs->rax	=     gdb_regs[_RAX] ;
+	regs->rbx	=     gdb_regs[_RBX] ;
+	regs->rcx	=     gdb_regs[_RCX] ;
+	regs->rdx	=     gdb_regs[_RDX] ;
+	regs->rsi	=     gdb_regs[_RSI] ;
+	regs->rdi	=     gdb_regs[_RDI] ;
+	regs->rbp	=     gdb_regs[_RBP] ;
+	regs->eflags	=     gdb_regs[ _PS] ;
+	regs->rip	=     gdb_regs[ _PC] ;
+	regs->r8	=     gdb_regs[ _R8] ;
+	regs->r9	=     gdb_regs[ _R9] ;
+	regs->r10	=     gdb_regs[ _R10] ;
+	regs->r11	=     gdb_regs[ _R11] ;
+	regs->r12	=     gdb_regs[ _R12] ;
+	regs->r13	=     gdb_regs[ _R13] ;
+	regs->r14	=     gdb_regs[ _R14] ;
+	regs->r15	=     gdb_regs[ _R15] ;
+ #if 0					/* can't change these */
+	regs->rsp	=     gdb_regs[_RSP] ;
+	regs->ss	=     gdb_regs[ _SS] ;
+	regs->fs = gdb_regs[_FS];
+	regs->gs = gdb_regs[_GS];
+#endif
+}				/* gdb_regs_to_regs */
+
+extern void scheduling_functions_start_here(void);
+extern void scheduling_functions_end_here(void);
+#define first_sched	((unsigned long) scheduling_functions_start_here)
+#define last_sched	((unsigned long) scheduling_functions_end_here)
+
+int thread_list = 0;
+extern void thread_return(void);
+
+void
+get_gdb_regs(struct task_struct *p, struct pt_regs *regs, unsigned long *gdb_regs)
+{
+	unsigned long **rbp, *rsp, *rsp0, pc;
+	int count = 0;
+	IF_SMP(int i);
+	if (!p || p == current) {
+		regs_to_gdb_regs(gdb_regs, regs);
+		return;
+	}
+#ifdef CONFIG_SMP
+	for (i = 0; i < MAX_NO_CPUS; i++) {
+		if (p == kgdb_info.cpus_waiting[i].task) {
+			regs_to_gdb_regs(gdb_regs,
+					 kgdb_info.cpus_waiting[i].regs);
+			gdb_regs[_RSP] =
+			    (unsigned long)&kgdb_info.cpus_waiting[i].regs->rsp;
+
+			return;
+		}
+	}
+#endif
+	memset(gdb_regs, 0, NUMREGBYTES);
+	rsp = (unsigned long *)p->thread.rsp;
+	rbp = (unsigned long **)rsp[0];
+	rsp += 2;
+	gdb_regs[_PC] =  (unsigned long)thread_return;
+	gdb_regs[_RBP] = (unsigned long)rbp;
+	gdb_regs[_RSP] = (unsigned long)rsp;
+
+/*
+ * This code is to give a more informative notion of where a process
+ * is waiting.	It is used only when the user asks for a thread info
+ * list.  If he then switches to the thread, s/he will find the task
+ * is in schedule, but a back trace should show the same info we come
+ * up with.  This code was shamelessly purloined from process.c.  It was
+ * then enhanced to provide more registers than simply the program
+ * counter.
+ */
+
+	if (!thread_list) {
+		return;
+	}
+
+	if (p->state == TASK_RUNNING)
+		return;
+	rsp0 = (unsigned long *)p->thread.rsp0;
+	if (rsp < (unsigned long *) p->thread_info || rsp > rsp0)
+		return;
+	/* include/asm-i386/system.h:switch_to() pushes ebp last. */
+	do {
+		if (*rbp < rsp || *rbp > rsp0)
+			break;
+		rbp = (unsigned long **)*rbp;
+		rsp = (unsigned long *)rbp;
+		pc = rsp[1];
+
+		if (pc < first_sched || pc >= last_sched)
+			break;
+		gdb_regs[_PC] = (unsigned long)pc;
+		gdb_regs[_RSP] = (unsigned long)rsp;
+		gdb_regs[_RBP] = (unsigned long)rbp;
+	} while (count++ < 16);
+	return;
+}
+
+/* convert the memory pointed to by mem into hex, placing result in buf */
+/* returns nonzero if any memory access fails. */
+int mem2hex( char* mem, char* buf, int   count)
+{
+	int i;
+	unsigned char ch;
+	int ret = 0;
+
+	for (i=0;i<count;i++) {
+		ch = 0;
+		ret |= __get_user(ch, mem);
+		mem++;
+		*buf++ = hexchars[ch >> 4];
+		*buf++ = hexchars[ch % 16];
+	}
+	*buf = 0;
+	if (ret) {
+		Dearly_printk("mem2hex: fault at accessing %p\n", mem);
+	}
+	return(ret);
+}
+
+/* convert the hex array pointed to by buf into binary to be placed in mem */
+/* return nonzero if any memory access fails. */
+int hex2mem( char* buf, char* mem, int count)
+{
+	int i;
+	unsigned char ch;
+	int ret = 0;
+
+	for (i=0;i<count;i++) {
+		ch = hex(*buf++) << 4;
+		ch = ch + hex(*buf++);
+		ret |= __put_user(ch, mem);
+		mem++;
+	}
+	if (ret) {
+		Dearly_printk("hex2mem: fault at %p\n", mem);
+	}
+	return(ret);
+}
+
+#if 0
+/* Indicate to caller of mem2hex or hex2mem that there has been an
+   error.  */
+static volatile int mem_err = 0;
+static volatile int mem_err_expected = 0;
+static volatile int mem_err_cnt = 0;
+static int garbage_loc = -1;
+
+int
+get_char(char *addr)
+{
+	return *addr;
+}
+
+void
+set_char(char *addr, int val, int may_fault)
+{
+	/*
+	 * This code traps references to the area mapped to the kernel
+	 * stack as given by the regs and, instead, stores to the
+	 * fn_call_lookaside[cpu].array
+	 */
+	if (may_fault &&
+	    (unsigned int) addr < OLD_esp &&
+	    ((unsigned int) addr > (OLD_esp - (unsigned int) LOOKASIDE_SIZE))) {
+		addr = (char *) END_OF_LOOKASIDE - ((char *) OLD_esp - addr);
+	}
+	*addr = val;
+}
+
+/* convert the memory pointed to by mem into hex, placing result in buf */
+/* return a pointer to the last char put in buf (null) */
+/* If MAY_FAULT is non-zero, then we should set mem_err in response to
+   a fault; if zero treat a fault like any other fault in the stub.  */
+char *
+mem2hex(char *mem, char *buf, int count, int may_fault)
+{
+	int i;
+	unsigned char ch;
+
+	if (may_fault) {
+		mem_err_expected = 1;
+		mem_err = 0;
+	}
+	for (i = 0; i < count; i++) {
+		/* printk("%lx = ", mem) ; */
+
+		ch = get_char(mem++);
+
+		/* printk("%02x\n", ch & 0xFF) ; */
+		if (may_fault && mem_err) {
+			if (remote_debug)
+				printk("Mem fault fetching from addr %lx\n",
+				       (long) (mem - 1));
+			*buf = 0;	/* truncate buffer */
+			return (buf);
+		}
+		*buf++ = hexchars[ch >> 4];
+		*buf++ = hexchars[ch % 16];
+	}
+	*buf = 0;
+	if (may_fault)
+		mem_err_expected = 0;
+	return (buf);
+}
+
+/* convert the hex array pointed to by buf into binary to be placed in mem */
+/* return a pointer to the character AFTER the last byte written */
+/* NOTE: We use the may fault flag to also indicate if the write is to
+ * the registers (0) or "other" memory (!=0)
+ */
+char *
+hex2mem(char *buf, char *mem, int count, int may_fault)
+{
+	int i;
+	unsigned char ch;
+
+	if (may_fault) {
+		mem_err_expected = 1;
+		mem_err = 0;
+	}
+	for (i = 0; i < count; i++) {
+		ch = hex(*buf++) << 4;
+		ch = ch + hex(*buf++);
+		set_char(mem++, ch, may_fault);
+
+		if (may_fault && mem_err) {
+			if (remote_debug)
+				printk("Mem fault storing to addr %lx\n",
+				       (long) (mem - 1));
+			return (mem);
+		}
+	}
+	if (may_fault)
+		mem_err_expected = 0;
+	return (mem);
+}
+#endif
+
+/**********************************************/
+/* WHILE WE FIND NICE HEX CHARS, BUILD AN INT */
+/* RETURN NUMBER OF CHARS PROCESSED	      */
+/**********************************************/
+int
+hexToLong(char **ptr, unsigned long *value)
+{
+	int numChars = 0;
+	int hexValue;
+
+	*value = 0;
+
+	while (**ptr) {
+		hexValue = hex(**ptr);
+		if (hexValue >= 0) {
+			*value = (*value << 4) | hexValue;
+			numChars++;
+		} else
+			break;
+
+		(*ptr)++;
+	}
+
+	return (numChars);
+}
+
+#define stubhex(h) hex(h)
+#ifdef old_thread_list
+
+static int
+stub_unpack_int(char *buff, int fieldlength)
+{
+	int nibble;
+	int retval = 0;
+
+	while (fieldlength) {
+		nibble = stubhex(*buff++);
+		retval |= nibble;
+		fieldlength--;
+		if (fieldlength)
+			retval = retval << 4;
+	}
+	return retval;
+}
+#endif
+static char *
+pack_hex_byte(char *pkt, int byte)
+{
+	*pkt++ = hexchars[(byte >> 4) & 0xf];
+	*pkt++ = hexchars[(byte & 0xf)];
+	return pkt;
+}
+
+#define BUF_THREAD_ID_SIZE 16
+
+static char *
+pack_threadid(char *pkt, threadref * id)
+{
+	char *limit;
+	unsigned char *altid;
+
+	altid = (unsigned char *) id;
+	limit = pkt + BUF_THREAD_ID_SIZE;
+	while (pkt < limit)
+		pkt = pack_hex_byte(pkt, *altid++);
+	return pkt;
+}
+
+#ifdef old_thread_list
+static char *
+unpack_byte(char *buf, int *value)
+{
+	*value = stub_unpack_int(buf, 2);
+	return buf + 2;
+}
+
+static char *
+unpack_threadid(char *inbuf, threadref * id)
+{
+	char *altref;
+	char *limit = inbuf + BUF_THREAD_ID_SIZE;
+	int x, y;
+
+	altref = (char *) id;
+
+	while (inbuf < limit) {
+		x = stubhex(*inbuf++);
+		y = stubhex(*inbuf++);
+		*altref++ = (x << 4) | y;
+	}
+	return inbuf;
+}
+#endif
+void
+int_to_threadref(threadref * id, int value)
+{
+	unsigned char *scan;
+
+	scan = (unsigned char *) id;
+	{
+		int i = 4;
+		while (i--)
+			*scan++ = 0;
+	}
+	*scan++ = (value >> 24) & 0xff;
+	*scan++ = (value >> 16) & 0xff;
+	*scan++ = (value >> 8) & 0xff;
+	*scan++ = (value & 0xff);
+}
+int
+int_to_hex_v(unsigned char * id, int value)
+{
+	unsigned char *start = id;
+	int shift;
+	int ch;
+
+	for (shift = 28; shift >= 0; shift -= 4) {
+		if ((ch = (value >> shift) & 0xf) || (id != start)) {
+			*id = hexchars[ch];
+			id++;
+		}
+	}
+	if (id == start)
+		*id++ = '0';
+	return id - start;
+}
+#ifdef old_thread_list
+
+static int
+threadref_to_int(threadref * ref)
+{
+	int i, value = 0;
+	unsigned char *scan;
+
+	scan = (char *) ref;
+	scan += 4;
+	i = 4;
+	while (i-- > 0)
+		value = (value << 8) | ((*scan++) & 0xff);
+	return value;
+}
+#endif
+static int
+cmp_str(char *s1, char *s2, int count)
+{
+	while (count--) {
+		if (*s1++ != *s2++)
+			return 0;
+	}
+	return 1;
+}
+
+#if 1				/* this is a hold over from 2.4 where O(1) was "sometimes" */
+extern struct task_struct *kgdb_get_idle(int cpu);
+#define idle_task(cpu) kgdb_get_idle(cpu)
+#else
+#define idle_task(cpu) init_tasks[cpu]
+#endif
+
+extern int kgdb_pid_init_done;
+
+struct task_struct *
+getthread(int pid)
+{
+	struct task_struct *thread;
+	if (pid >= PID_MAX && pid <= (PID_MAX + MAX_NO_CPUS)) {
+		if (!cpu_online(pid - PID_MAX))
+			return NULL;
+
+		return idle_task(pid - PID_MAX);
+	} else {
+		/*
+		 * find_task_by_pid is relatively safe all the time
+		 * Other pid functions require lock downs which imply
+		 * that we may be interrupting them (as we get here
+		 * in the middle of most any lock down).
+		 * Still we don't want to call until the table exists!
+		 */
+		if (kgdb_pid_init_done){
+			thread = find_task_by_pid(pid);
+			if (thread) {
+				return thread;
+			}
+		}
+	}
+	return NULL;
+}
+/* *INDENT-OFF*	 */
+struct hw_breakpoint {
+	unsigned enabled;
+	unsigned type;
+	unsigned len;
+	unsigned long addr;
+} breakinfo[4] = { {enabled:0},
+		   {enabled:0},
+		   {enabled:0},
+		   {enabled:0}};
+/* *INDENT-ON*	*/
+unsigned long hw_breakpoint_status;
+void
+correct_hw_break(void)
+{
+	int breakno;
+	int correctit;
+	int breakbit;
+	unsigned long dr7;
+
+	asm volatile ("movq %%db7, %0\n":"=r" (dr7)
+		      :);
+	/* *INDENT-OFF*	 */
+	do {
+		unsigned long addr0, addr1, addr2, addr3;
+		asm volatile ("movq %%db0, %0\n"
+			      "movq %%db1, %1\n"
+			      "movq %%db2, %2\n"
+			      "movq %%db3, %3\n"
+			      :"=r" (addr0), "=r"(addr1),
+			      "=r"(addr2), "=r"(addr3)
+			      :);
+	} while (0);
+	/* *INDENT-ON*	*/
+	correctit = 0;
+	for (breakno = 0; breakno < 3; breakno++) {
+		breakbit = 2 << (breakno << 1);
+		if (!(dr7 & breakbit) && breakinfo[breakno].enabled) {
+			correctit = 1;
+			dr7 |= breakbit;
+			dr7 &= ~(0xf0000 << (breakno << 2));
+			dr7 |= (((breakinfo[breakno].len << 2) |
+				 breakinfo[breakno].type) << 16) <<
+			    (breakno << 2);
+			switch (breakno) {
+			case 0:
+				asm volatile ("movq %0, %%dr0\n"::"r"
+					      (breakinfo[breakno].addr));
+				break;
+
+			case 1:
+				asm volatile ("movq %0, %%dr1\n"::"r"
+					      (breakinfo[breakno].addr));
+				break;
+
+			case 2:
+				asm volatile ("movq %0, %%dr2\n"::"r"
+					      (breakinfo[breakno].addr));
+				break;
+
+			case 3:
+				asm volatile ("movq %0, %%dr3\n"::"r"
+					      (breakinfo[breakno].addr));
+				break;
+			}
+		} else if ((dr7 & breakbit) && !breakinfo[breakno].enabled) {
+			correctit = 1;
+			dr7 &= ~breakbit;
+			dr7 &= ~(0xf0000 << (breakno << 2));
+		}
+	}
+	if (correctit) {
+		asm volatile ("movq %0, %%db7\n"::"r" (dr7));
+	}
+}
+
+int
+remove_hw_break(unsigned breakno)
+{
+	if (!breakinfo[breakno].enabled) {
+		return -1;
+	}
+	breakinfo[breakno].enabled = 0;
+	return 0;
+}
+
+int
+set_hw_break(unsigned breakno, unsigned type, unsigned len, unsigned addr)
+{
+	if (breakinfo[breakno].enabled) {
+		return -1;
+	}
+	breakinfo[breakno].enabled = 1;
+	breakinfo[breakno].type = type;
+	breakinfo[breakno].len = len;
+	breakinfo[breakno].addr = addr;
+	return 0;
+}
+
+#ifdef CONFIG_SMP
+static int in_kgdb_console = 0;
+
+int
+in_kgdb(struct pt_regs *regs)
+{
+	unsigned long flags;
+	int cpu;
+	if (!kgdb_enabled)
+		return 0;
+	cpu = smp_processor_id();
+	in_kgdb_called = 1;
+	if (!spin_is_locked(&kgdb_spinlock)) {
+		if (in_kgdb_here_log[cpu] ||	/* we are holding this cpu */
+		    in_kgdb_console) {	/* or we are doing slow i/o */
+			return 1;
+		}
+		return 0;
+	}
+
+	/* As I see it the only reason not to let all cpus spin on
+	 * the same spin_lock is to allow selected ones to proceed.
+	 * This would be a good thing, so we leave it this way.
+	 * Maybe someday....  Done !
+
+	 * in_kgdb() is called from an NMI so we don't pretend
+	 * to have any resources, like printk() for example.
+	 */
+
+	local_irq_save(flags);	/* only local here, to avoid hanging */
+	/*
+	 * log arival of this cpu
+	 * The NMI keeps on ticking.  Protect against recurring more
+	 * than once, and ignor the cpu that has the kgdb lock
+	 */
+	in_kgdb_entry_log[cpu]++;
+	in_kgdb_here_log[cpu] = regs;
+	if (cpu == spinlock_cpu || waiting_cpus[cpu].task)
+		goto exit_in_kgdb;
+
+	/*
+	 * For protection of the initilization of the spin locks by kgdb
+	 * it locks the kgdb spinlock before it gets the wait locks set
+	 * up.	We wait here for the wait lock to be taken.  If the
+	 * kgdb lock goes away first??	Well, it could be a slow exit
+	 * sequence where the wait lock is removed prior to the kgdb lock
+	 * so if kgdb gets unlocked, we just exit.
+	 */
+
+	while (spin_is_locked(&kgdb_spinlock) &&
+	       !spin_is_locked(waitlocks + cpu)) ;
+	if (!spin_is_locked(&kgdb_spinlock))
+		goto exit_in_kgdb;
+
+	waiting_cpus[cpu].task = current;
+	waiting_cpus[cpu].pid = (current->pid) ? : (PID_MAX + cpu);
+	waiting_cpus[cpu].regs = regs;
+
+	spin_unlock_wait(waitlocks + cpu);
+
+	/*
+	 * log departure of this cpu
+	 */
+	waiting_cpus[cpu].task = 0;
+	waiting_cpus[cpu].pid = 0;
+	waiting_cpus[cpu].regs = 0;
+	correct_hw_break();
+      exit_in_kgdb:
+	in_kgdb_here_log[cpu] = 0;
+	local_irq_restore(flags);
+	return 1;
+	/*
+	   spin_unlock(continuelocks + smp_processor_id());
+	 */
+}
+
+void
+smp__in_kgdb(struct pt_regs regs)
+{
+	ack_APIC_irq();
+	in_kgdb(&regs);
+}
+#else
+int
+in_kgdb(struct pt_regs *regs)
+{
+	return (kgdb_spinlock);
+}
+#endif
+
+void
+printexceptioninfo(int exceptionNo, int errorcode, char *buffer)
+{
+	unsigned long dr6;
+	int i;
+	switch (exceptionNo) {
+	case 1:		/* debug exception */
+		break;
+	case 3:		/* breakpoint */
+		sprintf(buffer, "Software breakpoint");
+		return;
+	default:
+		sprintf(buffer, "Details not available");
+		return;
+	}
+	asm volatile ("movq %%db6, %0\n":"=r" (dr6)
+		      :);
+	if (dr6 & 0x4000) {
+		sprintf(buffer, "Single step");
+		return;
+	}
+	for (i = 0; i < 4; ++i) {
+		if (dr6 & (1 << i)) {
+			sprintf(buffer, "Hardware breakpoint %d", i);
+			return;
+		}
+	}
+	sprintf(buffer, "Unknown trap");
+	return;
+}
+
+/*
+ * The ThreadExtraInfo query allows us to pass an arbitrary string
+ * for display with the "info threads" command.
+ */
+
+void
+print_extra_info(task_t *p, char *buf)
+{
+	if (!p) {
+		sprintf(buf, "Invalid thread");
+		return;
+	}
+	sprintf(buf, "0x%p %8d %4d  %c  %s",
+		   (void *)p,  p->parent->pid,
+		   task_cpu(p),
+		   (p->state == 0) ? (task_curr(p)?'R':'r') :
+		     (p->state < 0) ? 'U' :
+		     (p->state & TASK_UNINTERRUPTIBLE) ? 'D' :
+		     (p->state & TASK_STOPPED || p->ptrace & PT_PTRACED) ? 'T' :
+		     (p->state & (TASK_ZOMBIE | TASK_DEAD)) ? 'Z' :
+		     (p->state & TASK_INTERRUPTIBLE) ? 'S' : '?',
+		   p->comm);
+}
+
+/*
+ * This function does all command procesing for interfacing to gdb.
+ *
+ * NOTE:  The INT nn instruction leaves the state of the interrupt
+ *	  enable flag UNCHANGED.  That means that when this routine
+ *	  is entered via a breakpoint (INT 3) instruction from code
+ *	  that has interrupts enabled, then interrupts will STILL BE
+ *	  enabled when this routine is entered.	 The first thing that
+ *	  we do here is disable interrupts so as to prevent recursive
+ *	  entries and bothersome serial interrupts while we are
+ *	  trying to run the serial port in polled mode.
+ *
+ * For kernel version 2.1.xx the kgdb_cli() actually gets a spin lock so
+ * it is always necessary to do a restore_flags before returning
+ * so as to let go of that lock.
+ */
+int
+kgdb_handle_exception(int exceptionVector,
+		      int signo, int err_code, struct pt_regs *linux_regs)
+{
+	struct task_struct *usethread = NULL;
+	struct task_struct *thread_list_start = 0, *thread = NULL;
+	struct task_struct *p;
+	unsigned long addr, length;
+	unsigned long breakno, breaktype;
+	char *ptr;
+	unsigned long newPC;
+	threadref thref;
+	unsigned long threadid, tmpid;
+	int thread_min = PID_MAX + MAX_NO_CPUS;
+#ifdef old_thread_list
+	int maxthreads;
+#endif
+	int nothreads;
+	unsigned long flags;
+	unsigned long gdb_regs[NUMREGS];
+	unsigned long dr6;
+	IF_SMP(int entry_state = 0);	/* 0, ok, 1, no nmi, 2 sync failed */
+#define NO_NMI 1
+#define NO_SYNC 2
+#define	regs	(*linux_regs)
+	/*
+	 * If the entry is not from the kernel then return to the Linux
+	 * trap handler and let it process the interrupt normally.
+	 */
+	if ((linux_regs->eflags & VM_MASK) || (3 & linux_regs->cs)) {
+		printk("ignoring non-kernel exception\n");
+		print_regs(&regs);
+		return (0);
+	}
+	/*
+	 * If we're using eth mode, set the 'mode' in the netdevice.
+	 */
+
+	if (kgdboe)
+		netpoll_set_trap(1);
+
+	local_irq_save(flags);
+
+	/* Get kgdb spinlock */
+
+	KGDB_SPIN_LOCK(&kgdb_spinlock);
+	rdtscll(kgdb_info.entry_tsc);
+	/*
+	 * We depend on this spinlock and the NMI watch dog to control the
+	 * other cpus.	They will arrive at "in_kgdb()" as a result of the
+	 * NMI and will wait there for the following spin locks to be
+	 * released.
+	 */
+#ifdef CONFIG_SMP
+
+#if 0
+	if (cpu_callout_map & ~MAX_CPU_MASK) {
+		printk("kgdb : too many cpus, possibly not mapped"
+		       " in contiguous space, change MAX_NO_CPUS"
+		       " in kgdb_stub and make new kernel.\n"
+		       " cpu_callout_map is %lx\n", cpu_callout_map);
+		goto exit_just_unlock;
+	}
+#endif
+	if (spinlock_count == 1) {
+		int time, end_time, dum;
+		int i;
+		int cpu_logged_in[MAX_NO_CPUS] = {[0 ... MAX_NO_CPUS - 1] = (0)
+		};
+		if (remote_debug) {
+			printk("kgdb : cpu %d entry, syncing others\n",
+			       smp_processor_id());
+		}
+		for (i = 0; i < MAX_NO_CPUS; i++) {
+			/*
+			 * Use trylock as we may already hold the lock if
+			 * we are holding the cpu.  Net result is all
+			 * locked.
+			 */
+			spin_trylock(&waitlocks[i]);
+		}
+		for (i = 0; i < MAX_NO_CPUS; i++)
+			cpu_logged_in[i] = 0;
+		/*
+		 * Wait for their arrival.  We know the watch dog is active if
+		 * in_kgdb() has ever been called, as it is always called on a
+		 * watchdog tick.
+		 */
+		rdtsc(dum, time);
+		end_time = time + 2;	/* Note: we use the High order bits! */
+		i = 1;
+		if (num_online_cpus() > 1) {
+			int me_in_kgdb = in_kgdb_entry_log[smp_processor_id()];
+			smp_send_nmi_allbutself();
+
+			while (i < num_online_cpus() && time != end_time) {
+				int j;
+				for (j = 0; j < MAX_NO_CPUS; j++) {
+					if (waiting_cpus[j].task &&
+					    waiting_cpus[j].task != NOCPU &&
+					    !cpu_logged_in[j]) {
+						i++;
+						cpu_logged_in[j] = 1;
+						if (remote_debug) {
+							printk
+							    ("kgdb : cpu %d arrived at kgdb\n",
+							     j);
+						}
+						break;
+					} else if (!waiting_cpus[j].task &&
+						   !cpu_online(j)) {
+						waiting_cpus[j].task = NOCPU;
+						cpu_logged_in[j] = 1;
+						waiting_cpus[j].hold = 1;
+						break;
+					}
+					if (!waiting_cpus[j].task &&
+					    in_kgdb_here_log[j]) {
+
+						int wait = 100000;
+						while (wait--) ;
+						if (!waiting_cpus[j].task &&
+						    in_kgdb_here_log[j]) {
+							printk
+							    ("kgdb : cpu %d stall"
+							     " in in_kgdb\n",
+							     j);
+							i++;
+							cpu_logged_in[j] = 1;
+							waiting_cpus[j].task =
+							    (struct task_struct
+							     *) 1;
+						}
+					}
+				}
+
+				if (in_kgdb_entry_log[smp_processor_id()] >
+				    (me_in_kgdb + 10)) {
+					break;
+				}
+
+				rdtsc(dum, time);
+			}
+			if (i < num_online_cpus()) {
+				printk
+				    ("kgdb : time out, proceeding without sync\n");
+#if 0
+				printk("kgdb : Waiting_cpus: 0 = %d, 1 = %d\n",
+				       waiting_cpus[0].task != 0,
+				       waiting_cpus[1].task != 0);
+				printk("kgdb : Cpu_logged in: 0 = %d, 1 = %d\n",
+				       cpu_logged_in[0], cpu_logged_in[1]);
+				printk
+				    ("kgdb : in_kgdb_here_log in: 0 = %d, 1 = %d\n",
+				     in_kgdb_here_log[0] != 0,
+				     in_kgdb_here_log[1] != 0);
+#endif
+				entry_state = NO_SYNC;
+			} else {
+#if 0
+				int ent =
+				    in_kgdb_entry_log[smp_processor_id()] -
+				    me_in_kgdb;
+				printk("kgdb : sync after %d entries\n", ent);
+#endif
+			}
+		} else {
+			if (remote_debug) {
+				printk
+				    ("kgdb : %d cpus, but watchdog not active\n"
+				     "proceeding without locking down other cpus\n",
+				     num_online_cpus());
+				entry_state = NO_NMI;
+			}
+		}
+	}
+#endif
+
+	if (remote_debug) {
+		unsigned long *lp = (unsigned long *) &linux_regs;
+
+		printk("handle_exception(exceptionVector=%d, "
+		       "signo=%d, err_code=%d, linux_regs=%p)\n",
+		       exceptionVector, signo, err_code, linux_regs);
+		if (debug_regs) {
+			print_regs(&regs);
+			printk("Stk: %8lx %8lx %8lx %8lx"
+			       "  %8lx %8lx %8lx %8lx\n",
+			       lp[0], lp[1], lp[2], lp[3],
+			       lp[4], lp[5], lp[6], lp[7]);
+			printk("     %8lx %8lx %8lx %8lx"
+			       "  %8lx %8lx %8lx %8lx\n",
+			       lp[8], lp[9], lp[10], lp[11],
+			       lp[12], lp[13], lp[14], lp[15]);
+			printk("     %8lx %8lx %8lx %8lx  "
+			       "%8lx %8lx %8lx %8lx\n",
+			       lp[16], lp[17], lp[18], lp[19],
+			       lp[20], lp[21], lp[22], lp[23]);
+			printk("     %8lx %8lx %8lx %8lx  "
+			       "%8lx %8lx %8lx %8lx\n",
+			       lp[24], lp[25], lp[26], lp[27],
+			       lp[28], lp[29], lp[30], lp[31]);
+		}
+	}
+
+	/* Disable hardware debugging while we are in kgdb */
+	/* Get the debug register status register */
+/*				       *INDENT-OFF*  */
+      __asm__("movq %0,%%db7"
+	      :	/* no output */
+	      :"r"(0UL));
+
+	asm volatile ("movq %%db6, %0\n"
+		      :"=r" (hw_breakpoint_status)
+		      :);
+
+#if 0
+/*				       *INDENT-ON*  */
+	switch (exceptionVector) {
+	case 0:		/* divide error */
+	case 1:		/* debug exception */
+	case 2:		/* NMI */
+	case 3:		/* breakpoint */
+	case 4:		/* overflow */
+	case 5:		/* bounds check */
+	case 6:		/* invalid opcode */
+	case 7:		/* device not available */
+	case 8:		/* double fault (errcode) */
+	case 10:		/* invalid TSS (errcode) */
+	case 12:		/* stack fault (errcode) */
+	case 16:		/* floating point error */
+	case 17:		/* alignment check (errcode) */
+	default:		/* any undocumented */
+		break;
+	case 11:		/* segment not present (errcode) */
+	case 13:		/* general protection (errcode) */
+	case 14:		/* page fault (special errcode) */
+	case 19:		/* cache flush denied */
+		if (mem_err_expected) {
+			/*
+			 * This fault occured because of the
+			 * get_char or set_char routines.  These
+			 * two routines use either eax of edx to
+			 * indirectly reference the location in
+			 * memory that they are working with.
+			 * For a page fault, when we return the
+			 * instruction will be retried, so we
+			 * have to make sure that these
+			 * registers point to valid memory.
+			 */
+			mem_err = 1;	/* set mem error flag */
+			mem_err_expected = 0;
+			mem_err_cnt++;	/* helps in debugging */
+			/* make valid address */
+			regs.eax = (long) &garbage_loc;
+			/* make valid address */
+			regs.edx = (long) &garbage_loc;
+			if (remote_debug)
+				printk("Return after memory error: "
+				       "mem_err_cnt=%d\n", mem_err_cnt);
+			if (debug_regs)
+				print_regs(&regs);
+			goto exit_kgdb;
+		}
+		break;
+	}
+#endif
+	if (remote_debug)
+		printk("kgdb : entered kgdb on cpu %d\n", smp_processor_id());
+
+	gdb_i386vector = exceptionVector;
+	gdb_i386errcode = err_code;
+	kgdb_info.called_from = __builtin_return_address(0);
+#ifdef CONFIG_SMP
+	/*
+	 * OK, we can now communicate, lets tell gdb about the sync.
+	 * but only if we had a problem.
+	 */
+	switch (entry_state) {
+	case NO_NMI:
+		to_gdb("NMI not active, other cpus not stopped\n");
+		break;
+	case NO_SYNC:
+		to_gdb("Some cpus not stopped, see 'kgdb_info' for details\n");
+	default:;
+	}
+
+#endif
+/*
+ * Set up the gdb function call area.
+ */
+	trap_cpu = smp_processor_id();
+	OLD_esp = NEW_esp = (unsigned long) (&linux_regs->rsp);
+
+      IF_SMP(once_again:)
+	    /* reply to host that an exception has occurred */
+	    remcomOutBuffer[0] = 'S';
+	remcomOutBuffer[1] = hexchars[signo >> 4];
+	remcomOutBuffer[2] = hexchars[signo % 16];
+	remcomOutBuffer[3] = 0;
+
+	putpacket(remcomOutBuffer);
+
+	while (1 == 1) {
+		error = 0;
+		remcomOutBuffer[0] = 0;
+		getpacket(remcomInBuffer);
+		switch (remcomInBuffer[0]) {
+		case '?':
+			remcomOutBuffer[0] = 'S';
+			remcomOutBuffer[1] = hexchars[signo >> 4];
+			remcomOutBuffer[2] = hexchars[signo % 16];
+			remcomOutBuffer[3] = 0;
+			break;
+		case 'd':
+			remote_debug = !(remote_debug);	/* toggle debug flag */
+			printk("Remote debug %s\n",
+			       remote_debug ? "on" : "off");
+			break;
+		case 'g':	/* return the value of the CPU registers */
+			get_gdb_regs(usethread, &regs, gdb_regs);
+			mem2hex((char *) gdb_regs,
+				remcomOutBuffer, NUMREGBYTES);
+			break;
+		case 'G':	/* set the value of the CPU registers - return OK */
+			hex2mem(&remcomInBuffer[1],
+				(char *) gdb_regs, NUMREGBYTES);
+			if (!usethread || usethread == current) {
+				gdb_regs_to_regs(gdb_regs, &regs);
+				strcpy(remcomOutBuffer, "OK");
+			} else {
+				strcpy(remcomOutBuffer, "E00");
+			}
+			break;
+
+		case 'P':{	/* set the value of a single CPU register -
+				   return OK */
+				/*
+				 * For some reason, gdb wants to talk about psudo
+				 * registers (greater than 15).
+				 */
+				unsigned long regno;
+
+				ptr = &remcomInBuffer[1];
+				regs_to_gdb_regs(gdb_regs, &regs);
+				if ((!usethread || usethread == current) &&
+				    hexToLong(&ptr, &regno) &&
+				    *ptr++ == '=' && (regno >= 0)) {
+					if (regno >= NUMREGS)
+						break;
+					hex2mem(ptr, (char *) &gdb_regs[regno],
+						8);
+					gdb_regs_to_regs(gdb_regs, &regs);
+					strcpy(remcomOutBuffer, "OK");
+					break;
+				}
+				strcpy(remcomOutBuffer, "E01");
+				break;
+			}
+
+			/* mAA..AA,LLLL	 Read LLLL bytes at address AA..AA */
+		case 'm':
+			/* TRY TO READ %x,%x.  IF SUCCEED, SET PTR = 0 */
+			ptr = &remcomInBuffer[1];
+			if (hexToLong(&ptr, &addr) &&
+			    (*(ptr++) == ',') && (hexToLong(&ptr, &length))) {
+				ptr = 0;
+				/*
+				 * hex doubles the byte count
+				 */
+				if (length > (BUFMAX / 2))
+					length = BUFMAX / 2;
+				if (mem2hex((char *) addr,
+					remcomOutBuffer, length)) {
+					strcpy(remcomOutBuffer, "E03");
+					debug_error("memory fault\n", NULL);
+				}
+			}
+
+			if (ptr) {
+				strcpy(remcomOutBuffer, "E01");
+				debug_error
+				    ("malformed read memory command: %s\n",
+				     remcomInBuffer);
+			}
+			break;
+
+			/* MAA..AA,LLLL:
+			   Write LLLL bytes at address AA.AA return OK */
+		case 'M':
+			/* TRY TO READ '%x,%x:'.  IF SUCCEED, SET PTR = 0 */
+			ptr = &remcomInBuffer[1];
+			if (hexToLong(&ptr, &addr) &&
+			    (*(ptr++) == ',') &&
+			    (hexToLong(&ptr, &length)) && (*(ptr++) == ':')) {
+				if (hex2mem(ptr, (char *) addr, length)) {
+					strcpy(remcomOutBuffer, "E03");
+					debug_error("memory fault\n", NULL);
+				} else {
+					strcpy(remcomOutBuffer, "OK");
+				}
+
+				ptr = 0;
+			}
+			if (ptr) {
+				strcpy(remcomOutBuffer, "E02");
+				debug_error
+				    ("malformed write memory command: %s\n",
+				     remcomInBuffer);
+			}
+			break;
+		case 'S':
+			remcomInBuffer[0] = 's';
+		case 'C':
+			/* Csig;AA..AA where ;AA..AA is optional
+			 * continue with signal
+			 * Since signals are meaning less to us, delete that
+			 * part and then fall into the 'c' code.
+			 */
+			ptr = &remcomInBuffer[1];
+			length = 2;
+			while (*ptr && *ptr != ';') {
+				length++;
+				ptr++;
+			}
+			if (*ptr) {
+				do {
+					ptr++;
+					*(ptr - length++) = *ptr;
+				} while (*ptr);
+			} else {
+				remcomInBuffer[1] = 0;
+			}
+
+			/* cAA..AA  Continue at address AA..AA(optional) */
+			/* sAA..AA  Step one instruction from AA..AA(optional) */
+			/* D	    detach, reply OK and then continue */
+		case 'c':
+		case 's':
+		case 'D':
+
+			/* try to read optional parameter,
+			   pc unchanged if no parm */
+			ptr = &remcomInBuffer[1];
+			if (hexToLong(&ptr, &addr)) {
+				if (remote_debug)
+					printk("Changing EIP to 0x%lx\n", addr);
+
+				regs.rip = addr;
+			}
+
+			newPC = regs.rip;
+
+			/* clear the trace bit */
+			regs.eflags &= 0xfffffeff;
+
+			/* set the trace bit if we're stepping */
+			if (remcomInBuffer[0] == 's')
+				regs.eflags |= 0x100;
+
+			/* detach is a friendly version of continue. Note that
+			   debugging is still enabled (e.g hit control C)
+			 */
+			if (remcomInBuffer[0] == 'D') {
+				strcpy(remcomOutBuffer, "OK");
+				putpacket(remcomOutBuffer);
+			}
+
+			if (remote_debug) {
+				printk("Resuming execution\n");
+				print_regs(&regs);
+			}
+			asm volatile ("movq %%db6, %0\n":"=r" (dr6)
+				      :);
+			if (!(dr6 & 0x4000)) {
+				for (breakno = 0; breakno < 4; ++breakno) {
+					if (dr6 & (1 << breakno) &&
+					    (breakinfo[breakno].type == 0)) {
+						/* Set restore flag */
+						regs.eflags |= 0x10000;
+						break;
+					}
+				}
+			}
+
+			if (kgdboe)
+				netpoll_set_trap(0);
+
+			correct_hw_break();
+			asm volatile ("movq %0, %%db6\n"::"r" (0UL));
+			goto exit_kgdb;
+
+			/* kill the program */
+		case 'k':	/* do nothing */
+			break;
+
+			/* query */
+		case 'q':
+			nothreads = 0;
+			switch (remcomInBuffer[1]) {
+			case 'f':
+				threadid = 1;
+				thread_list = 2;
+				thread_list_start = (usethread ? : current);
+			case 's':
+				if (!cmp_str(&remcomInBuffer[2],
+					     "ThreadInfo", 10))
+					break;
+
+				remcomOutBuffer[nothreads++] = 'm';
+				for (; threadid < PID_MAX + MAX_NO_CPUS;
+				     threadid++) {
+					thread = getthread(threadid);
+					if (thread) {
+						nothreads += int_to_hex_v(
+							&remcomOutBuffer[
+								nothreads],
+							threadid);
+						if (thread_min > threadid)
+							thread_min = threadid;
+						remcomOutBuffer[
+							nothreads] = ',';
+						nothreads++;
+						if (nothreads > BUFMAX - 10)
+							break;
+					}
+				}
+				if (remcomOutBuffer[nothreads - 1] == 'm') {
+					remcomOutBuffer[nothreads - 1] = 'l';
+				} else {
+					nothreads--;
+				}
+				remcomOutBuffer[nothreads] = 0;
+				break;
+
+#ifdef old_thread_list /* Old thread info request */
+			case 'L':
+				/* List threads */
+				thread_list = 2;
+				thread_list_start = (usethread ? : current);
+				unpack_byte(remcomInBuffer + 3, &maxthreads);
+				unpack_threadid(remcomInBuffer + 5, &thref);
+				do {
+					int buf_thread_limit =
+					    (BUFMAX - 22) / BUF_THREAD_ID_SIZE;
+					if (maxthreads > buf_thread_limit) {
+						maxthreads = buf_thread_limit;
+					}
+				} while (0);
+				remcomOutBuffer[0] = 'q';
+				remcomOutBuffer[1] = 'M';
+				remcomOutBuffer[4] = '0';
+				pack_threadid(remcomOutBuffer + 5, &thref);
+
+				/* If start flag set start at 0. */
+				if (remcomInBuffer[2] == '1')
+					threadid = 0;
+				else
+					threadid = threadref_to_int(&thref);
+				for (nothreads = 0;
+				     nothreads < maxthreads &&
+				     threadid < PID_MAX + MAX_NO_CPUS;
+				     threadid++) {
+					thread = getthread(threadid);
+					if (thread) {
+						int_to_threadref(&thref,
+								 threadid);
+						pack_threadid(remcomOutBuffer +
+							      21 +
+							      nothreads * 16,
+							      &thref);
+						nothreads++;
+						if (thread_min > threadid)
+							thread_min = threadid;
+					}
+				}
+
+				if (threadid == PID_MAX + MAX_NO_CPUS) {
+					remcomOutBuffer[4] = '1';
+				}
+				pack_hex_byte(remcomOutBuffer + 2, nothreads);
+				remcomOutBuffer[21 + nothreads * 16] = '\0';
+				break;
+#endif
+			case 'C':
+				/* Current thread id */
+				remcomOutBuffer[0] = 'Q';
+				remcomOutBuffer[1] = 'C';
+				threadid = current->pid;
+				if (!threadid) {
+					/*
+					 * idle thread
+					 */
+					for (threadid = PID_MAX;
+					     threadid < PID_MAX + MAX_NO_CPUS;
+					     threadid++) {
+						if (current ==
+						    idle_task(threadid -
+							      PID_MAX))
+							break;
+					}
+				}
+				int_to_threadref(&thref, threadid);
+				pack_threadid(remcomOutBuffer + 2, &thref);
+				remcomOutBuffer[18] = '\0';
+				break;
+
+			case 'E':
+				/* Print exception info */
+				printexceptioninfo(exceptionVector,
+						   err_code, remcomOutBuffer);
+				break;
+			case 'T':
+				ptr = &remcomInBuffer[0];
+				if (strncmp(ptr, "qThreadExtraInfo,",
+					strlen("qThreadExtraInfo,")) == 0) {
+					ptr += strlen("qThreadExtraInfo,");
+					hexToLong(&ptr, &tmpid);
+					p = getthread(tmpid);
+					print_extra_info(p, lbuf);
+					mem2hex(lbuf, remcomOutBuffer,
+						strlen(lbuf));
+				}
+				break;
+#if 0
+			case 'T':{
+				char * nptr;
+				/* Thread extra info */
+				if (!cmp_str(&remcomInBuffer[2],
+					    "hreadExtraInfo,", 15)) {
+					break;
+				}
+				ptr = &remcomInBuffer[17];
+				hexToLong(&ptr, &threadid);
+				thread = getthread(threadid);
+				nptr = &thread->comm[0];
+				length = 0;
+				ptr = &remcomOutBuffer[0];
+				do {
+					length++;
+					ptr = pack_hex_byte(ptr, *nptr++);
+				 } while (*nptr && length < 16);
+				/*
+				 * would like that 16 to be the size of
+				 * task_struct.comm but don't know the
+				 * syntax..
+				 */
+				*ptr = 0;
+			}
+#endif
+			}
+			break;
+
+			/* task related */
+		case 'H':
+			switch (remcomInBuffer[1]) {
+			case 'g':
+				ptr = &remcomInBuffer[2];
+				hexToLong(&ptr, &threadid);
+				thread = getthread(threadid);
+				if (!thread) {
+					remcomOutBuffer[0] = 'E';
+					remcomOutBuffer[1] = '\0';
+					break;
+				}
+				/*
+				 * Just in case I forget what this is all about,
+				 * the "thread info" command to gdb causes it
+				 * to ask for a thread list.  It then switches
+				 * to each thread and asks for the registers.
+				 * For this (and only this) usage, we want to
+				 * fudge the registers of tasks not on the run
+				 * list (i.e. waiting) to show the routine that
+				 * called schedule. Also, gdb, is a minimalist
+				 * in that if the current thread is the last
+				 * it will not re-read the info when done.
+				 * This means that in this case we must show
+				 * the real registers. So here is how we do it:
+				 * Each entry we keep track of the min
+				 * thread in the list (the last that gdb will)
+				 * get info for.  We also keep track of the
+				 * starting thread.
+				 * "thread_list" is cleared when switching back
+				 * to the min thread if it is was current, or
+				 * if it was not current, thread_list is set
+				 * to 1.  When the switch to current comes,
+				 * if thread_list is 1, clear it, else do
+				 * nothing.
+				 */
+				usethread = thread;
+				if ((thread_list == 1) &&
+				    (thread == thread_list_start)) {
+					thread_list = 0;
+				}
+				if (thread_list && (threadid == thread_min)) {
+					if (thread == thread_list_start) {
+						thread_list = 0;
+					} else {
+						thread_list = 1;
+					}
+				}
+				/* follow through */
+			case 'c':
+				remcomOutBuffer[0] = 'O';
+				remcomOutBuffer[1] = 'K';
+				remcomOutBuffer[2] = '\0';
+				break;
+			}
+			break;
+
+			/* Query thread status */
+		case 'T':
+			ptr = &remcomInBuffer[1];
+			hexToLong(&ptr, &threadid);
+			thread = getthread(threadid);
+			if (thread) {
+				remcomOutBuffer[0] = 'O';
+				remcomOutBuffer[1] = 'K';
+				remcomOutBuffer[2] = '\0';
+				if (thread_min > threadid)
+					thread_min = threadid;
+			} else {
+				remcomOutBuffer[0] = 'E';
+				remcomOutBuffer[1] = '\0';
+			}
+			break;
+
+		case 'Y': /* set up a hardware breakpoint */
+			ptr = &remcomInBuffer[1];
+			hexToLong(&ptr, &breakno);
+			ptr++;
+			hexToLong(&ptr, &breaktype);
+			ptr++;
+			hexToLong(&ptr, &length);
+			ptr++;
+			hexToLong(&ptr, &addr);
+			if (set_hw_break(breakno & 0x3,
+					 breaktype & 0x3,
+					 length & 0x3, addr) == 0) {
+				strcpy(remcomOutBuffer, "OK");
+			} else {
+				strcpy(remcomOutBuffer, "ERROR");
+			}
+			break;
+
+			/* Remove hardware breakpoint */
+		case 'y':
+			ptr = &remcomInBuffer[1];
+			hexToLong(&ptr, &breakno);
+			if (remove_hw_break(breakno & 0x3) == 0) {
+				strcpy(remcomOutBuffer, "OK");
+			} else {
+				strcpy(remcomOutBuffer, "ERROR");
+			}
+			break;
+
+		case 'r':	/* reboot */
+			strcpy(remcomOutBuffer, "OK");
+			putpacket(remcomOutBuffer);
+			/*to_gdb("Rebooting\n"); */
+			/* triplefault	 no return from here */
+			{
+				static long no_idt[2];
+				__asm__ __volatile__("lidt %0"::"m"(no_idt[0]));
+				BREAKPOINT;
+			}
+
+		}		/* switch */
+
+		/* reply to the request */
+		putpacket(remcomOutBuffer);
+	}			/* while(1==1) */
+	/*
+	 *  reached by goto only.
+	 */
+      exit_kgdb:
+	/*
+	 * Here is where we set up to trap a gdb function call.	 NEW_esp
+	 * will be changed if we are trying to do this.	 We handle both
+	 * adding and subtracting, thus allowing gdb to put grung on
+	 * the stack which it removes later.
+	 */
+	if (NEW_esp != OLD_esp) {
+		unsigned long *ptr = END_OF_LOOKASIDE;
+		if (NEW_esp < OLD_esp)
+			ptr -= (OLD_esp - NEW_esp) / sizeof (unsigned long);
+		*--ptr = linux_regs->eflags;
+		*--ptr = linux_regs->cs;
+		*--ptr = linux_regs->rip;
+		*--ptr = linux_regs->rcx;
+		*--ptr = linux_regs->rbx;
+		*--ptr = linux_regs->rax;
+		linux_regs->rcx = NEW_esp - (sizeof (unsigned long) * 6);
+		linux_regs->rbx = (unsigned long) END_OF_LOOKASIDE;
+		if (NEW_esp < OLD_esp) {
+			linux_regs->rip = (unsigned long) fn_call_stub;
+		} else {
+			linux_regs->rip = (unsigned long) fn_rtn_stub;
+			linux_regs->rax = NEW_esp;
+		}
+		linux_regs->eflags &= ~(IF_BIT | TF_BIT);
+	}
+#ifdef CONFIG_SMP
+	/*
+	 * Release gdb wait locks
+	 * Sanity check time.  Must have at least one cpu to run.  Also single
+	 * step must not be done if the current cpu is on hold.
+	 */
+	if (spinlock_count == 1) {
+		int ss_hold = (regs.eflags & 0x100) && kgdb_info.hold_on_sstep;
+		int cpu_avail = 0;
+		int i;
+
+		for (i = 0; i < MAX_NO_CPUS; i++) {
+			if (!cpu_online(i))
+				break;
+			if (!hold_cpu(i)) {
+				cpu_avail = 1;
+			}
+		}
+		/*
+		 * Early in the bring up there will be NO cpus on line...
+		 */
+		if (!cpu_avail && !cpus_empty(cpu_online_map)) {
+			to_gdb("No cpus unblocked, see 'kgdb_info.hold_cpu'\n");
+			goto once_again;
+		}
+		if (hold_cpu(smp_processor_id()) && (regs.eflags & 0x100)) {
+			to_gdb
+			    ("Current cpu must be unblocked to single step\n");
+			goto once_again;
+		}
+		if (!(ss_hold)) {
+			int i;
+			for (i = 0; i < MAX_NO_CPUS; i++) {
+				if (!hold_cpu(i)) {
+					spin_unlock(&waitlocks[i]);
+				}
+			}
+		} else {
+			spin_unlock(&waitlocks[smp_processor_id()]);
+		}
+		/* Release kgdb spinlock */
+		KGDB_SPIN_UNLOCK(&kgdb_spinlock);
+		/*
+		 * If this cpu is on hold, this is where we
+		 * do it.  Note, the NMI will pull us out of here,
+		 * but will return as the above lock is not held.
+		 * We will stay here till another cpu releases the lock for us.
+		 */
+		spin_unlock_wait(waitlocks + smp_processor_id());
+		local_irq_restore(flags);
+		return (1);
+	}
+#if 0
+exit_just_unlock:
+#endif
+#endif
+	/* Release kgdb spinlock */
+	KGDB_SPIN_UNLOCK(&kgdb_spinlock);
+	local_irq_restore(flags);
+	return (1);
+}
+
+#undef regs
+static int kgdb_notify(struct notifier_block *self, unsigned long cmd, void *ptr)
+{
+	struct die_args *d = ptr;
+
+	if (!kgdb_enabled || (cmd == DIE_DEBUG && user_mode(d->regs)))
+		return NOTIFY_DONE;
+	if (cmd == DIE_NMI_IPI) {
+		if (in_kgdb(d->regs))
+			return NOTIFY_BAD;
+	} else if (kgdb_handle_exception(d->trapnr, d->signr, d->err, d->regs))
+		return NOTIFY_BAD; /* skip */
+
+	return NOTIFY_DONE;
+}
+
+static struct notifier_block kgdb_notifier = {
+	.notifier_call = kgdb_notify,
+	.priority = 0,
+};
+
+void set_debug_traps(void)
+{
+	static int initialized = 0;
+
+	if (!initialized) {
+		initialized = 1;
+		notifier_chain_register(&die_chain, &kgdb_notifier);
+	}
+}
+
+/*
+ * Provide the command line "gdb" initial break
+ */
+int __init kgdb_initial_break(char * str)
+{
+	if (*str == '\0'){
+		breakpoint();
+		return 1;
+	}
+	return 0;
+}
+__setup("gdb",kgdb_initial_break);
+
+/* This function will generate a breakpoint exception.	It is used at the
+   beginning of a program to sync up with a debugger and can be used
+   otherwise as a quick means to stop program execution and "break" into
+   the debugger. */
+/* But really, just use the BREAKPOINT macro.  We will handle the int stuff
+ */
+
+void breakpoint(void)
+{
+
+	set_debug_traps();
+	kgdb_enabled = 1;
+#if 0
+	/*
+	 * These calls were not enough to allow breakpoint to be
+	 * called before trap_init().  I moved the argument parsing
+	 * after trap_init() and it seems to work.
+	 */
+	set_intr_usr_gate(3,&int3); /* disable ints on trap */
+	set_intr_gate(1,&debug);
+	set_intr_gate(14,&page_fault);
+#endif
+
+        BREAKPOINT;
+}
+
+#ifdef later
+/*
+ * possibly we should not go thru the traps.c code at all?  Someday.
+ */
+void
+do_kgdb_int3(struct pt_regs *regs, long error_code)
+{
+	kgdb_handle_exception(3, 5, error_code, regs);
+	return;
+}
+#endif
+#undef regs
+#ifdef CONFIG_TRAP_BAD_SYSCALL_EXITS
+asmlinkage void
+bad_sys_call_exit(int stuff)
+{
+	struct pt_regs *regs = (struct pt_regs *) &stuff;
+	printk("Sys call %d return with %x preempt_count\n",
+	       (int) regs->orig_eax, preempt_count());
+}
+#endif
+#ifdef CONFIG_STACK_OVERFLOW_TEST
+#include <asm/kgdb.h>
+asmlinkage void
+stack_overflow(void)
+{
+#ifdef BREAKPOINT
+	BREAKPOINT;
+#else
+	printk("Kernel stack overflow, looping forever\n");
+#endif
+	while (1) {
+	}
+}
+#endif
+
+#if defined(CONFIG_SMP) || defined(CONFIG_KGDB_CONSOLE)
+char gdbconbuf[BUFMAX];
+
+static void
+kgdb_gdb_message(const char *s, unsigned count)
+{
+	int i;
+	int wcount;
+	char *bufptr;
+	/*
+	 * This takes care of NMI while spining out chars to gdb
+	 */
+	IF_SMP(in_kgdb_console = 1);
+	gdbconbuf[0] = 'O';
+	bufptr = gdbconbuf + 1;
+	while (count > 0) {
+		if ((count << 1) > (BUFMAX - 2)) {
+			wcount = (BUFMAX - 2) >> 1;
+		} else {
+			wcount = count;
+		}
+		count -= wcount;
+		for (i = 0; i < wcount; i++) {
+			bufptr = pack_hex_byte(bufptr, s[i]);
+		}
+		*bufptr = '\0';
+		s += wcount;
+
+		putpacket(gdbconbuf);
+
+	}
+	IF_SMP(in_kgdb_console = 0);
+}
+#endif
+#ifdef CONFIG_SMP
+static void
+to_gdb(const char *s)
+{
+	int count = 0;
+	while (s[count] && (count++ < BUFMAX)) ;
+	kgdb_gdb_message(s, count);
+}
+#endif
+#ifdef CONFIG_KGDB_CONSOLE
+#include <linux/console.h>
+#include <linux/init.h>
+#include <linux/fs.h>
+#include <asm/semaphore.h>
+
+void
+kgdb_console_write(struct console *co, const char *s, unsigned count)
+{
+
+	if (gdb_i386vector == -1) {
+		/*
+		 * We have not yet talked to gdb.  What to do...
+		 * lets break, on continue we can do the write.
+		 * But first tell him whats up. Uh, well no can do,
+		 * as this IS the console.  Oh well...
+		 * We do need to wait or the messages will be lost.
+		 * Other option would be to tell the above code to
+		 * ignore this breakpoint and do an auto return,
+		 * but that might confuse gdb.	Also this happens
+		 * early enough in boot up that we don't have the traps
+		 * set up yet, so...
+		 */
+		breakpoint();
+	}
+	kgdb_gdb_message(s, count);
+}
+
+/*
+ * ------------------------------------------------------------
+ * Serial KGDB driver
+ * ------------------------------------------------------------
+ */
+
+static struct console kgdbcons = {
+	name:"kgdb",
+	write:kgdb_console_write,
+#ifdef CONFIG_KGDB_USER_CONSOLE
+	device:kgdb_console_device,
+#endif
+	flags:CON_PRINTBUFFER | CON_ENABLED,
+	index:-1,
+};
+
+/*
+ * The trick here is that this file gets linked before printk.o
+ * That means we get to peer at the console info in the command
+ * line before it does.	 If we are up, we register, otherwise,
+ * do nothing.	By returning 0, we allow printk to look also.
+ */
+static int kgdb_console_enabled;
+
+int __init
+kgdb_console_init(char *str)
+{
+	if ((strncmp(str, "kgdb", 4) == 0) || (strncmp(str, "gdb", 3) == 0)) {
+		register_console(&kgdbcons);
+		kgdb_console_enabled = 1;
+	}
+	return 0;		/* let others look at the string */
+}
+
+__setup("console=", kgdb_console_init);
+
+#ifdef CONFIG_KGDB_USER_CONSOLE
+static kdev_t kgdb_console_device(struct console *c);
+/* This stuff sort of works, but it knocks out telnet devices
+ * we are leaving it here in case we (or you) find time to figure it out
+ * better..
+ */
+
+/*
+ * We need a real char device as well for when the console is opened for user
+ * space activities.
+ */
+
+static int
+kgdb_consdev_open(struct inode *inode, struct file *file)
+{
+	return 0;
+}
+
+static ssize_t
+kgdb_consdev_write(struct file *file, const char *buf,
+		   size_t count, loff_t * ppos)
+{
+	int size, ret = 0;
+	static char kbuf[128];
+	static DECLARE_MUTEX(sem);
+
+	/* We are not reentrant... */
+	if (down_interruptible(&sem))
+		return -ERESTARTSYS;
+
+	while (count > 0) {
+		/* need to copy the data from user space */
+		size = count;
+		if (size > sizeof (kbuf))
+			size = sizeof (kbuf);
+		if (copy_from_user(kbuf, buf, size)) {
+			ret = -EFAULT;
+			break;;
+		}
+		kgdb_console_write(&kgdbcons, kbuf, size);
+		count -= size;
+		ret += size;
+		buf += size;
+	}
+
+	up(&sem);
+
+	return ret;
+}
+
+struct file_operations kgdb_consdev_fops = {
+	open:kgdb_consdev_open,
+	write:kgdb_consdev_write
+};
+static kdev_t
+kgdb_console_device(struct console *c)
+{
+	return MKDEV(TTYAUX_MAJOR, 1);
+}
+
+/*
+ * This routine gets called from the serial stub in the i386/lib
+ * This is so it is done late in bring up (just before the console open).
+ */
+void
+kgdb_console_finit(void)
+{
+	if (kgdb_console_enabled) {
+		char *cptr = cdevname(MKDEV(TTYAUX_MAJOR, 1));
+		char *cp = cptr;
+		while (*cptr && *cptr != '(')
+			cptr++;
+		*cptr = 0;
+		unregister_chrdev(TTYAUX_MAJOR, cp);
+		register_chrdev(TTYAUX_MAJOR, "kgdb", &kgdb_consdev_fops);
+	}
+}
+#endif
+#endif
+#ifdef CONFIG_KGDB_TS
+#include <asm/msr.h>		/* time stamp code */
+#include <asm/hardirq.h>	/* in_interrupt */
+#ifdef CONFIG_KGDB_TS_64
+#define DATA_POINTS 64
+#endif
+#ifdef CONFIG_KGDB_TS_128
+#define DATA_POINTS 128
+#endif
+#ifdef CONFIG_KGDB_TS_256
+#define DATA_POINTS 256
+#endif
+#ifdef CONFIG_KGDB_TS_512
+#define DATA_POINTS 512
+#endif
+#ifdef CONFIG_KGDB_TS_1024
+#define DATA_POINTS 1024
+#endif
+#ifndef DATA_POINTS
+#define DATA_POINTS 128		/* must be a power of two */
+#endif
+#define INDEX_MASK (DATA_POINTS - 1)
+#if (INDEX_MASK & DATA_POINTS)
+#error "CONFIG_KGDB_TS_COUNT must be a power of 2"
+#endif
+struct kgdb_and_then_struct {
+#ifdef CONFIG_SMP
+	int on_cpu;
+#endif
+	struct task_struct *task;
+	long long at_time;
+	int from_ln;
+	char *in_src;
+	void *from;
+	int *with_shpf;
+	int data0;
+	int data1;
+};
+struct kgdb_and_then_struct2 {
+#ifdef CONFIG_SMP
+	int on_cpu;
+#endif
+	struct task_struct *task;
+	long long at_time;
+	int from_ln;
+	char *in_src;
+	void *from;
+	int *with_shpf;
+	struct task_struct *t1;
+	struct task_struct *t2;
+};
+struct kgdb_and_then_struct kgdb_data[DATA_POINTS];
+
+struct kgdb_and_then_struct *kgdb_and_then = &kgdb_data[0];
+int kgdb_and_then_count;
+
+void
+kgdb_tstamp(int line, char *source, int data0, int data1)
+{
+	static spinlock_t ts_spin = SPIN_LOCK_UNLOCKED;
+	int flags;
+	local_irq_save(flags);
+	spin_lock(&ts_spin);
+	rdtscll(kgdb_and_then->at_time);
+#ifdef CONFIG_SMP
+	kgdb_and_then->on_cpu = smp_processor_id();
+#endif
+	kgdb_and_then->task = current;
+	kgdb_and_then->from_ln = line;
+	kgdb_and_then->in_src = source;
+	kgdb_and_then->from = __builtin_return_address(0);
+	kgdb_and_then->with_shpf = (int *) (((flags & IF_BIT) >> 9) |
+					    (preempt_count() << 8));
+	kgdb_and_then->data0 = data0;
+	kgdb_and_then->data1 = data1;
+	kgdb_and_then = &kgdb_data[++kgdb_and_then_count & INDEX_MASK];
+	spin_unlock(&ts_spin);
+	local_irq_restore(flags);
+#ifdef CONFIG_PREEMPT
+
+#endif
+	return;
+}
+#endif
+typedef int gdb_debug_hook(int exceptionVector,
+			   int signo, int err_code, struct pt_regs *linux_regs);
+gdb_debug_hook *linux_debug_hook = &kgdb_handle_exception;	/* histerical reasons... */
+
+static int kgdb_need_breakpoint[NR_CPUS];
+
+void kgdb_schedule_breakpoint(void)
+{
+	kgdb_need_breakpoint[smp_processor_id()] = 1;
+}
+
+void kgdb_process_breakpoint(void)
+{
+	/*
+	 * Handle a breakpoint queued from inside network driver code
+         * to avoid reentrancy issues
+	 */
+	if (kgdb_need_breakpoint[smp_processor_id()]) {
+		kgdb_need_breakpoint[smp_processor_id()] = 0;
+		kgdb_enabled = 1;
+		BREAKPOINT;
+	}
+}
+
--- diff/arch/x86_64/lib/kgdb_serial.c	1970-01-01 01:00:00.000000000 +0100
+++ source/arch/x86_64/lib/kgdb_serial.c	2004-02-09 10:39:51.000000000 +0000
@@ -0,0 +1,490 @@
+/*
+ * Serial interface GDB stub
+ *
+ * Written (hacked together) by David Grothe (dave@gcom.com)
+ * Modified to allow invokation early in boot see also
+ * kgdb.h for instructions by George Anzinger(george@mvista.com)
+ * Modified to handle debugging over ethernet by Robert Walsh
+ * <rjwalsh@durables.org> and wangdi <wangdi@clusterfs.com>, based on
+ * code by San Mehat.
+ *
+ */
+
+#include <linux/module.h>
+#include <linux/errno.h>
+#include <linux/signal.h>
+#include <linux/sched.h>
+#include <linux/timer.h>
+#include <linux/interrupt.h>
+#include <linux/tty.h>
+#include <linux/tty_flip.h>
+#include <linux/serial.h>
+#include <linux/serial_reg.h>
+#include <linux/config.h>
+#include <linux/major.h>
+#include <linux/string.h>
+#include <linux/fcntl.h>
+#include <linux/ptrace.h>
+#include <linux/ioport.h>
+#include <linux/mm.h>
+#include <linux/init.h>
+#include <linux/highmem.h>
+#include <asm/system.h>
+#include <asm/io.h>
+#include <asm/segment.h>
+#include <asm/bitops.h>
+#include <asm/system.h>
+#include <asm/kgdb_local.h>
+#ifdef CONFIG_KGDB_USER_CONSOLE
+extern void kgdb_console_finit(void);
+#endif
+#define PRNT_off
+#define TEST_EXISTANCE
+#ifdef PRNT
+#define dbprintk(s) printk s
+#else
+#define dbprintk(s)
+#endif
+#define TEST_INTERRUPT_off
+#ifdef TEST_INTERRUPT
+#define intprintk(s) printk s
+#else
+#define intprintk(s)
+#endif
+
+#define IRQ_T(info) ((info->flags & ASYNC_SHARE_IRQ) ? SA_SHIRQ : SA_INTERRUPT)
+
+#define	GDB_BUF_SIZE	512	/* power of 2, please */
+
+static char gdb_buf[GDB_BUF_SIZE];
+static int gdb_buf_in_inx;
+static atomic_t gdb_buf_in_cnt;
+static int gdb_buf_out_inx;
+
+struct async_struct *gdb_async_info;
+static int gdb_async_irq;
+
+#define outb_px(a,b) outb_p(b,a)
+
+static void program_uart(struct async_struct *info);
+static void write_char(struct async_struct *info, int chr);
+/*
+ * Get a byte from the hardware data buffer and return it
+ */
+static int
+read_data_bfr(struct async_struct *info)
+{
+	char it = inb_p(info->port + UART_LSR);
+
+	if (it & UART_LSR_DR)
+		return (inb_p(info->port + UART_RX));
+	/*
+	 * If we have a framing error assume somebody messed with
+	 * our uart.  Reprogram it and send '-' both ways...
+	 */
+	if (it & 0xc) {
+		program_uart(info);
+		write_char(info, '-');
+		return ('-');
+	}
+	return (-1);
+
+}				/* read_data_bfr */
+
+/*
+ * Get a char if available, return -1 if nothing available.
+ * Empty the receive buffer first, then look at the interface hardware.
+
+ * Locking here is a bit of a problem.	We MUST not lock out communication
+ * if we are trying to talk to gdb about a kgdb entry.	ON the other hand
+ * we can loose chars in the console pass thru if we don't lock.  It is also
+ * possible that we could hold the lock or be waiting for it when kgdb
+ * NEEDS to talk.  Since kgdb locks down the world, it does not need locks.
+ * We do, of course have possible issues with interrupting a uart operation,
+ * but we will just depend on the uart status to help keep that straight.
+
+ */
+static spinlock_t uart_interrupt_lock = SPIN_LOCK_UNLOCKED;
+#ifdef CONFIG_SMP
+extern spinlock_t kgdb_spinlock;
+#endif
+
+static int
+read_char(struct async_struct *info)
+{
+	int chr;
+	unsigned long flags;
+	local_irq_save(flags);
+#ifdef CONFIG_SMP
+	if (!spin_is_locked(&kgdb_spinlock)) {
+		spin_lock(&uart_interrupt_lock);
+	}
+#endif
+	if (atomic_read(&gdb_buf_in_cnt) != 0) {	/* intr routine has q'd chars */
+		chr = gdb_buf[gdb_buf_out_inx++];
+		gdb_buf_out_inx &= (GDB_BUF_SIZE - 1);
+		atomic_dec(&gdb_buf_in_cnt);
+	} else {
+		chr = read_data_bfr(info);
+	}
+#ifdef CONFIG_SMP
+	if (!spin_is_locked(&kgdb_spinlock)) {
+		spin_unlock(&uart_interrupt_lock);
+	}
+#endif
+	local_irq_restore(flags);
+	return (chr);
+}
+
+/*
+ * Wait until the interface can accept a char, then write it.
+ */
+static void
+write_char(struct async_struct *info, int chr)
+{
+	while (!(inb_p(info->port + UART_LSR) & UART_LSR_THRE)) ;
+
+	outb_p(chr, info->port + UART_TX);
+
+}				/* write_char */
+
+/*
+ * Mostly we don't need a spinlock, but since the console goes
+ * thru here with interrutps on, well, we need to catch those
+ * chars.
+ */
+/*
+ * This is the receiver interrupt routine for the GDB stub.
+ * It will receive a limited number of characters of input
+ * from the gdb  host machine and save them up in a buffer.
+ *
+ * When the gdb stub routine tty_getDebugChar() is called it
+ * draws characters out of the buffer until it is empty and
+ * then reads directly from the serial port.
+ *
+ * We do not attempt to write chars from the interrupt routine
+ * since the stubs do all of that via tty_putDebugChar() which
+ * writes one byte after waiting for the interface to become
+ * ready.
+ *
+ * The debug stubs like to run with interrupts disabled since,
+ * after all, they run as a consequence of a breakpoint in
+ * the kernel.
+ *
+ * Perhaps someone who knows more about the tty driver than I
+ * care to learn can make this work for any low level serial
+ * driver.
+ */
+static irqreturn_t
+gdb_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+{
+	struct async_struct *info;
+	unsigned long flags;
+
+	info = gdb_async_info;
+	if (!info || !info->tty || irq != gdb_async_irq)
+		return IRQ_NONE;
+
+	local_irq_save(flags);
+	spin_lock(&uart_interrupt_lock);
+	do {
+		int chr = read_data_bfr(info);
+		intprintk(("Debug char on int: %x hex\n", chr));
+		if (chr < 0)
+			continue;
+
+		if (chr == 3) {	/* Ctrl-C means remote interrupt */
+			BREAKPOINT;
+			continue;
+		}
+
+		if (atomic_read(&gdb_buf_in_cnt) >= GDB_BUF_SIZE) {
+			/* buffer overflow tosses early char */
+			read_char(info);
+		}
+		gdb_buf[gdb_buf_in_inx++] = chr;
+		gdb_buf_in_inx &= (GDB_BUF_SIZE - 1);
+	} while (inb_p(info->port + UART_IIR) & UART_IIR_RDI);
+	spin_unlock(&uart_interrupt_lock);
+	local_irq_restore(flags);
+	return IRQ_HANDLED;
+}				/* gdb_interrupt */
+
+/*
+ * Just a NULL routine for testing.
+ */
+void
+gdb_null(void)
+{
+}				/* gdb_null */
+
+/* These structure are filled in with values defined in asm/kgdb_local.h
+ */
+static struct serial_state state = SB_STATE;
+static struct async_struct local_info = SB_INFO;
+static int ok_to_enable_ints = 0;
+static void kgdb_enable_ints_now(void);
+
+extern char *kgdb_version;
+/*
+ * Hook an IRQ for KGDB.
+ *
+ * This routine is called from tty_putDebugChar, below.
+ */
+static int ints_disabled = 1;
+int
+gdb_hook_interrupt(struct async_struct *info, int verb)
+{
+	struct serial_state *state = info->state;
+	unsigned long flags;
+	int port;
+#ifdef TEST_EXISTANCE
+	int scratch, scratch2;
+#endif
+
+	/* The above fails if memory managment is not set up yet.
+	 * Rather than fail the set up, just keep track of the fact
+	 * and pick up the interrupt thing later.
+	 */
+	gdb_async_info = info;
+	port = gdb_async_info->port;
+	gdb_async_irq = state->irq;
+	if (verb) {
+		printk("kgdb %s : port =%x, IRQ=%d, divisor =%d\n",
+		       kgdb_version,
+		       port,
+		       gdb_async_irq, gdb_async_info->state->custom_divisor);
+	}
+	local_irq_save(flags);
+#ifdef TEST_EXISTANCE
+	/* Existance test */
+	/* Should not need all this, but just in case.... */
+
+	scratch = inb_p(port + UART_IER);
+	outb_px(port + UART_IER, 0);
+	outb_px(0xff, 0x080);
+	scratch2 = inb_p(port + UART_IER);
+	outb_px(port + UART_IER, scratch);
+	if (scratch2) {
+		printk
+		    ("gdb_hook_interrupt: Could not clear IER, not a UART!\n");
+		local_irq_restore(flags);
+		return 1;	/* We failed; there's nothing here */
+	}
+	scratch2 = inb_p(port + UART_LCR);
+	outb_px(port + UART_LCR, 0xBF);	/* set up for StarTech test */
+	outb_px(port + UART_EFR, 0);	/* EFR is the same as FCR */
+	outb_px(port + UART_LCR, 0);
+	outb_px(port + UART_FCR, UART_FCR_ENABLE_FIFO);
+	scratch = inb_p(port + UART_IIR) >> 6;
+	if (scratch == 1) {
+		printk("gdb_hook_interrupt: Undefined UART type!"
+		       "  Not a UART! \n");
+		local_irq_restore(flags);
+		return 1;
+	} else {
+		dbprintk(("gdb_hook_interrupt: UART type "
+			  "is %d where 0=16450, 2=16550 3=16550A\n", scratch));
+	}
+	scratch = inb_p(port + UART_MCR);
+	outb_px(port + UART_MCR, UART_MCR_LOOP | scratch);
+	outb_px(port + UART_MCR, UART_MCR_LOOP | 0x0A);
+	scratch2 = inb_p(port + UART_MSR) & 0xF0;
+	outb_px(port + UART_MCR, scratch);
+	if (scratch2 != 0x90) {
+		printk("gdb_hook_interrupt: "
+		       "Loop back test failed! Not a UART!\n");
+		local_irq_restore(flags);
+		return scratch2 + 1000;	/* force 0 to fail */
+	}
+#endif				/* test existance */
+	program_uart(info);
+	local_irq_restore(flags);
+
+	return (0);
+
+}				/* gdb_hook_interrupt */
+
+static void
+program_uart(struct async_struct *info)
+{
+	int port = info->port;
+
+	(void) inb_p(port + UART_RX);
+	outb_px(port + UART_IER, 0);
+
+	(void) inb_p(port + UART_RX);	/* serial driver comments say */
+	(void) inb_p(port + UART_IIR);	/* this clears the interrupt regs */
+	(void) inb_p(port + UART_MSR);
+	outb_px(port + UART_LCR, UART_LCR_WLEN8 | UART_LCR_DLAB);
+	outb_px(port + UART_DLL, info->state->custom_divisor & 0xff);	/* LS */
+	outb_px(port + UART_DLM, info->state->custom_divisor >> 8);	/* MS  */
+	outb_px(port + UART_MCR, info->MCR);
+
+	outb_px(port + UART_FCR, UART_FCR_ENABLE_FIFO | UART_FCR_TRIGGER_1 | UART_FCR_CLEAR_XMIT | UART_FCR_CLEAR_RCVR);	/* set fcr */
+	outb_px(port + UART_LCR, UART_LCR_WLEN8);	/* reset DLAB */
+	outb_px(port + UART_FCR, UART_FCR_ENABLE_FIFO | UART_FCR_TRIGGER_1);	/* set fcr */
+	if (!ints_disabled) {
+		intprintk(("KGDB: Sending %d to port %x offset %d\n",
+			   gdb_async_info->IER,
+			   (int) gdb_async_info->port, UART_IER));
+		outb_px(gdb_async_info->port + UART_IER, gdb_async_info->IER);
+	}
+	return;
+}
+
+/*
+ * tty_getDebugChar
+ *
+ * This is a GDB stub routine.	It waits for a character from the
+ * serial interface and then returns it.  If there is no serial
+ * interface connection then it returns a bogus value which will
+ * almost certainly cause the system to hang.  In the
+ */
+int kgdb_in_isr = 0;
+int kgdb_in_lsr = 0;
+extern spinlock_t kgdb_spinlock;
+
+/* Caller takes needed protections */
+
+int
+tty_getDebugChar(void)
+{
+	volatile int chr, dum, time, end_time;
+
+	dbprintk(("tty_getDebugChar(port %x): ", gdb_async_info->port));
+
+	if (gdb_async_info == NULL) {
+		gdb_hook_interrupt(&local_info, 0);
+	}
+	/*
+	 * This trick says if we wait a very long time and get
+	 * no char, return the -1 and let the upper level deal
+	 * with it.
+	 */
+	rdtsc(dum, time);
+	end_time = time + 2;
+	while (((chr = read_char(gdb_async_info)) == -1) &&
+	       (end_time - time) > 0) {
+		rdtsc(dum, time);
+	};
+	/*
+	 * This covers our butts if some other code messes with
+	 * our uart, hay, it happens :o)
+	 */
+	if (chr == -1)
+		program_uart(gdb_async_info);
+
+	dbprintk(("%c\n", chr > ' ' && chr < 0x7F ? chr : ' '));
+	return (chr);
+
+}				/* tty_getDebugChar */
+
+static int count = 3;
+static spinlock_t one_at_atime = SPIN_LOCK_UNLOCKED;
+
+static int __init
+kgdb_enable_ints(void)
+{
+	set_debug_traps();
+	if (kgdboe) {
+		return 0;
+	}
+	if (gdb_async_info == NULL) {
+		gdb_hook_interrupt(&local_info, 1);
+	}
+	ok_to_enable_ints = 1;
+	kgdb_enable_ints_now();
+#ifdef CONFIG_KGDB_USER_CONSOLE
+	kgdb_console_finit();
+#endif
+	return 0;
+}
+
+#ifdef CONFIG_SERIAL_8250
+void shutdown_for_kgdb(struct async_struct *gdb_async_info);
+#endif
+
+#define kgdb_mem_init_done()    (1)
+
+static void
+kgdb_enable_ints_now(void)
+{
+	if (!spin_trylock(&one_at_atime))
+		return;
+	if (!ints_disabled)
+		goto exit;
+	if (kgdb_mem_init_done() &&
+			ints_disabled) {	/* don't try till mem init */
+#ifdef CONFIG_SERIAL_8250
+		/*
+		 * The ifdef here allows the system to be configured
+		 * without the serial driver.
+		 * Don't make it a module, however, it will steal the port
+		 */
+		shutdown_for_kgdb(gdb_async_info);
+#endif
+		ints_disabled = request_irq(gdb_async_info->state->irq,
+					    gdb_interrupt,
+					    IRQ_T(gdb_async_info),
+					    "KGDB-stub", NULL);
+		intprintk(("KGDB: request_irq returned %d\n", ints_disabled));
+	}
+	if (!ints_disabled) {
+		intprintk(("KGDB: Sending %d to port %x offset %d\n",
+			   gdb_async_info->IER,
+			   (int) gdb_async_info->port, UART_IER));
+		outb_px(gdb_async_info->port + UART_IER, gdb_async_info->IER);
+	}
+      exit:
+	spin_unlock(&one_at_atime);
+}
+
+/*
+ * tty_putDebugChar
+ *
+ * This is a GDB stub routine.	It waits until the interface is ready
+ * to transmit a char and then sends it.  If there is no serial
+ * interface connection then it simply returns to its caller, having
+ * pretended to send the char.	Caller takes needed protections.
+ */
+void
+tty_putDebugChar(int chr)
+{
+	dbprintk(("tty_putDebugChar(port %x): chr=%02x '%c', ints_on=%d\n",
+		  gdb_async_info->port,
+		  chr,
+		  chr > ' ' && chr < 0x7F ? chr : ' ', ints_disabled ? 0 : 1));
+
+	if (gdb_async_info == NULL) {
+		gdb_hook_interrupt(&local_info, 0);
+	}
+
+	write_char(gdb_async_info, chr);	/* this routine will wait */
+	count = (chr == '#') ? 0 : count + 1;
+	if ((count == 2)) {	/* try to enable after */
+		if (ints_disabled & ok_to_enable_ints)
+			kgdb_enable_ints_now();	/* try to enable after */
+
+		/* We do this a lot because, well we really want to get these
+		 * interrupts.	The serial driver will clear these bits when it
+		 * initializes the chip.  Every thing else it does is ok,
+		 * but this.
+		 */
+		if (!ints_disabled) {
+			outb_px(gdb_async_info->port + UART_IER,
+				gdb_async_info->IER);
+		}
+	}
+
+}				/* tty_putDebugChar */
+
+/*
+ * This does nothing for the serial port, since it doesn't buffer.
+ */
+
+void tty_flushDebugChar(void)
+{
+}
+
+module_init(kgdb_enable_ints);
--- diff/drivers/base/dmapool.c	1970-01-01 01:00:00.000000000 +0100
+++ source/drivers/base/dmapool.c	2004-02-09 10:39:52.000000000 +0000
@@ -0,0 +1,421 @@
+
+#include <linux/device.h>
+#include <linux/mm.h>
+#include <asm/io.h>		/* Needed for i386 to build */
+#include <asm/scatterlist.h>	/* Needed for i386 to build */
+#include <linux/dma-mapping.h>
+#include <linux/dmapool.h>
+#include <linux/slab.h>
+#include <linux/module.h>
+
+/*
+ * Pool allocator ... wraps the dma_alloc_coherent page allocator, so
+ * small blocks are easily used by drivers for bus mastering controllers.
+ * This should probably be sharing the guts of the slab allocator.
+ */
+
+struct dma_pool {	/* the pool */
+	struct list_head	page_list;
+	spinlock_t		lock;
+	size_t			blocks_per_page;
+	size_t			size;
+	struct device		*dev;
+	size_t			allocation;
+	char			name [32];
+	wait_queue_head_t	waitq;
+	struct list_head	pools;
+};
+
+struct dma_page {	/* cacheable header for 'allocation' bytes */
+	struct list_head	page_list;
+	void			*vaddr;
+	dma_addr_t		dma;
+	unsigned		in_use;
+	unsigned long		bitmap [0];
+};
+
+#define	POOL_TIMEOUT_JIFFIES	((100 /* msec */ * HZ) / 1000)
+#define	POOL_POISON_FREED	0xa7	/* !inuse */
+#define	POOL_POISON_ALLOCATED	0xa9	/* !initted */
+
+static DECLARE_MUTEX (pools_lock);
+
+static ssize_t
+show_pools (struct device *dev, char *buf)
+{
+	unsigned		temp, size;
+	char			*next;
+	struct list_head	*i, *j;
+
+	next = buf;
+	size = PAGE_SIZE;
+
+	temp = scnprintf(next, size, "poolinfo - 0.1\n");
+	size -= temp;
+	next += temp;
+
+	down (&pools_lock);
+	list_for_each (i, &dev->dma_pools) {
+		struct dma_pool	*pool;
+		unsigned	pages = 0, blocks = 0;
+
+		pool = list_entry (i, struct dma_pool, pools);
+
+		list_for_each (j, &pool->page_list) {
+			struct dma_page	*page;
+
+			page = list_entry (j, struct dma_page, page_list);
+			pages++;
+			blocks += page->in_use;
+		}
+
+		/* per-pool info, no real statistics yet */
+		temp = scnprintf(next, size, "%-16s %4u %4Zu %4Zu %2u\n",
+				pool->name,
+				blocks, pages * pool->blocks_per_page,
+				pool->size, pages);
+		size -= temp;
+		next += temp;
+	}
+	up (&pools_lock);
+
+	return PAGE_SIZE - size;
+}
+static DEVICE_ATTR (pools, S_IRUGO, show_pools, NULL);
+
+/**
+ * dma_pool_create - Creates a pool of consistent memory blocks, for dma.
+ * @name: name of pool, for diagnostics
+ * @dev: device that will be doing the DMA
+ * @size: size of the blocks in this pool.
+ * @align: alignment requirement for blocks; must be a power of two
+ * @allocation: returned blocks won't cross this boundary (or zero)
+ * Context: !in_interrupt()
+ *
+ * Returns a dma allocation pool with the requested characteristics, or
+ * null if one can't be created.  Given one of these pools, dma_pool_alloc()
+ * may be used to allocate memory.  Such memory will all have "consistent"
+ * DMA mappings, accessible by the device and its driver without using
+ * cache flushing primitives.  The actual size of blocks allocated may be
+ * larger than requested because of alignment.
+ *
+ * If allocation is nonzero, objects returned from dma_pool_alloc() won't
+ * cross that size boundary.  This is useful for devices which have
+ * addressing restrictions on individual DMA transfers, such as not crossing
+ * boundaries of 4KBytes.
+ */
+struct dma_pool *
+dma_pool_create (const char *name, struct device *dev,
+	size_t size, size_t align, size_t allocation)
+{
+	struct dma_pool		*retval;
+
+	if (align == 0)
+		align = 1;
+	if (size == 0)
+		return 0;
+	else if (size < align)
+		size = align;
+	else if ((size % align) != 0) {
+		size += align + 1;
+		size &= ~(align - 1);
+	}
+
+	if (allocation == 0) {
+		if (PAGE_SIZE < size)
+			allocation = size;
+		else
+			allocation = PAGE_SIZE;
+		// FIXME: round up for less fragmentation
+	} else if (allocation < size)
+		return 0;
+
+	if (!(retval = kmalloc (sizeof *retval, SLAB_KERNEL)))
+		return retval;
+
+	strlcpy (retval->name, name, sizeof retval->name);
+
+	retval->dev = dev;
+
+	INIT_LIST_HEAD (&retval->page_list);
+	spin_lock_init (&retval->lock);
+	retval->size = size;
+	retval->allocation = allocation;
+	retval->blocks_per_page = allocation / size;
+	init_waitqueue_head (&retval->waitq);
+
+	if (dev) {
+		down (&pools_lock);
+		if (list_empty (&dev->dma_pools))
+			device_create_file (dev, &dev_attr_pools);
+		/* note:  not currently insisting "name" be unique */
+		list_add (&retval->pools, &dev->dma_pools);
+		up (&pools_lock);
+	} else
+		INIT_LIST_HEAD (&retval->pools);
+
+	return retval;
+}
+
+
+static struct dma_page *
+pool_alloc_page (struct dma_pool *pool, int mem_flags)
+{
+	struct dma_page	*page;
+	int		mapsize;
+
+	mapsize = pool->blocks_per_page;
+	mapsize = (mapsize + BITS_PER_LONG - 1) / BITS_PER_LONG;
+	mapsize *= sizeof (long);
+
+	page = (struct dma_page *) kmalloc (mapsize + sizeof *page, mem_flags);
+	if (!page)
+		return 0;
+	page->vaddr = dma_alloc_coherent (pool->dev,
+					    pool->allocation,
+					    &page->dma,
+					    mem_flags);
+	if (page->vaddr) {
+		memset (page->bitmap, 0xff, mapsize);	// bit set == free
+#ifdef	CONFIG_DEBUG_SLAB
+		memset (page->vaddr, POOL_POISON_FREED, pool->allocation);
+#endif
+		list_add (&page->page_list, &pool->page_list);
+		page->in_use = 0;
+	} else {
+		kfree (page);
+		page = 0;
+	}
+	return page;
+}
+
+
+static inline int
+is_page_busy (int blocks, unsigned long *bitmap)
+{
+	while (blocks > 0) {
+		if (*bitmap++ != ~0UL)
+			return 1;
+		blocks -= BITS_PER_LONG;
+	}
+	return 0;
+}
+
+static void
+pool_free_page (struct dma_pool *pool, struct dma_page *page)
+{
+	dma_addr_t	dma = page->dma;
+
+#ifdef	CONFIG_DEBUG_SLAB
+	memset (page->vaddr, POOL_POISON_FREED, pool->allocation);
+#endif
+	dma_free_coherent (pool->dev, pool->allocation, page->vaddr, dma);
+	list_del (&page->page_list);
+	kfree (page);
+}
+
+
+/**
+ * dma_pool_destroy - destroys a pool of dma memory blocks.
+ * @pool: dma pool that will be destroyed
+ * Context: !in_interrupt()
+ *
+ * Caller guarantees that no more memory from the pool is in use,
+ * and that nothing will try to use the pool after this call.
+ */
+void
+dma_pool_destroy (struct dma_pool *pool)
+{
+	down (&pools_lock);
+	list_del (&pool->pools);
+	if (pool->dev && list_empty (&pool->dev->dma_pools))
+		device_remove_file (pool->dev, &dev_attr_pools);
+	up (&pools_lock);
+
+	while (!list_empty (&pool->page_list)) {
+		struct dma_page		*page;
+		page = list_entry (pool->page_list.next,
+				struct dma_page, page_list);
+		if (is_page_busy (pool->blocks_per_page, page->bitmap)) {
+			if (pool->dev)
+				dev_err(pool->dev, "dma_pool_destroy %s, %p busy\n",
+					pool->name, page->vaddr);
+			else
+				printk (KERN_ERR "dma_pool_destroy %s, %p busy\n",
+					pool->name, page->vaddr);
+			/* leak the still-in-use consistent memory */
+			list_del (&page->page_list);
+			kfree (page);
+		} else
+			pool_free_page (pool, page);
+	}
+
+	kfree (pool);
+}
+
+
+/**
+ * dma_pool_alloc - get a block of consistent memory
+ * @pool: dma pool that will produce the block
+ * @mem_flags: GFP_* bitmask
+ * @handle: pointer to dma address of block
+ *
+ * This returns the kernel virtual address of a currently unused block,
+ * and reports its dma address through the handle.
+ * If such a memory block can't be allocated, null is returned.
+ */
+void *
+dma_pool_alloc (struct dma_pool *pool, int mem_flags, dma_addr_t *handle)
+{
+	unsigned long		flags;
+	struct list_head	*entry;
+	struct dma_page		*page;
+	int			map, block;
+	size_t			offset;
+	void			*retval;
+
+restart:
+	spin_lock_irqsave (&pool->lock, flags);
+	list_for_each (entry, &pool->page_list) {
+		int		i;
+		page = list_entry (entry, struct dma_page, page_list);
+		/* only cachable accesses here ... */
+		for (map = 0, i = 0;
+				i < pool->blocks_per_page;
+				i += BITS_PER_LONG, map++) {
+			if (page->bitmap [map] == 0)
+				continue;
+			block = ffz (~ page->bitmap [map]);
+			if ((i + block) < pool->blocks_per_page) {
+				clear_bit (block, &page->bitmap [map]);
+				offset = (BITS_PER_LONG * map) + block;
+				offset *= pool->size;
+				goto ready;
+			}
+		}
+	}
+	if (!(page = pool_alloc_page (pool, SLAB_ATOMIC))) {
+		if (mem_flags & __GFP_WAIT) {
+			DECLARE_WAITQUEUE (wait, current);
+
+			current->state = TASK_INTERRUPTIBLE;
+			add_wait_queue (&pool->waitq, &wait);
+			spin_unlock_irqrestore (&pool->lock, flags);
+
+			schedule_timeout (POOL_TIMEOUT_JIFFIES);
+
+			remove_wait_queue (&pool->waitq, &wait);
+			goto restart;
+		}
+		retval = 0;
+		goto done;
+	}
+
+	clear_bit (0, &page->bitmap [0]);
+	offset = 0;
+ready:
+	page->in_use++;
+	retval = offset + page->vaddr;
+	*handle = offset + page->dma;
+#ifdef	CONFIG_DEBUG_SLAB
+	memset (retval, POOL_POISON_ALLOCATED, pool->size);
+#endif
+done:
+	spin_unlock_irqrestore (&pool->lock, flags);
+	return retval;
+}
+
+
+static struct dma_page *
+pool_find_page (struct dma_pool *pool, dma_addr_t dma)
+{
+	unsigned long		flags;
+	struct list_head	*entry;
+	struct dma_page		*page;
+
+	spin_lock_irqsave (&pool->lock, flags);
+	list_for_each (entry, &pool->page_list) {
+		page = list_entry (entry, struct dma_page, page_list);
+		if (dma < page->dma)
+			continue;
+		if (dma < (page->dma + pool->allocation))
+			goto done;
+	}
+	page = 0;
+done:
+	spin_unlock_irqrestore (&pool->lock, flags);
+	return page;
+}
+
+
+/**
+ * dma_pool_free - put block back into dma pool
+ * @pool: the dma pool holding the block
+ * @vaddr: virtual address of block
+ * @dma: dma address of block
+ *
+ * Caller promises neither device nor driver will again touch this block
+ * unless it is first re-allocated.
+ */
+void
+dma_pool_free (struct dma_pool *pool, void *vaddr, dma_addr_t dma)
+{
+	struct dma_page		*page;
+	unsigned long		flags;
+	int			map, block;
+
+	if ((page = pool_find_page (pool, dma)) == 0) {
+		if (pool->dev)
+			dev_err(pool->dev, "dma_pool_free %s, %p/%lx (bad dma)\n",
+				pool->name, vaddr, (unsigned long) dma);
+		else
+			printk (KERN_ERR "dma_pool_free %s, %p/%lx (bad dma)\n",
+				pool->name, vaddr, (unsigned long) dma);
+		return;
+	}
+
+	block = dma - page->dma;
+	block /= pool->size;
+	map = block / BITS_PER_LONG;
+	block %= BITS_PER_LONG;
+
+#ifdef	CONFIG_DEBUG_SLAB
+	if (((dma - page->dma) + (void *)page->vaddr) != vaddr) {
+		if (pool->dev)
+			dev_err(pool->dev, "dma_pool_free %s, %p (bad vaddr)/%Lx\n",
+				pool->name, vaddr, (unsigned long long) dma);
+		else
+			printk (KERN_ERR "dma_pool_free %s, %p (bad vaddr)/%Lx\n",
+				pool->name, vaddr, (unsigned long long) dma);
+		return;
+	}
+	if (page->bitmap [map] & (1UL << block)) {
+		if (pool->dev)
+			dev_err(pool->dev, "dma_pool_free %s, dma %Lx already free\n",
+				pool->name, (unsigned long long)dma);
+		else
+			printk (KERN_ERR "dma_pool_free %s, dma %Lx already free\n",
+				pool->name, (unsigned long long)dma);
+		return;
+	}
+	memset (vaddr, POOL_POISON_FREED, pool->size);
+#endif
+
+	spin_lock_irqsave (&pool->lock, flags);
+	page->in_use--;
+	set_bit (block, &page->bitmap [map]);
+	if (waitqueue_active (&pool->waitq))
+		wake_up (&pool->waitq);
+	/*
+	 * Resist a temptation to do
+	 *    if (!is_page_busy(bpp, page->bitmap)) pool_free_page(pool, page);
+	 * Better have a few empty pages hang around.
+	 */
+	spin_unlock_irqrestore (&pool->lock, flags);
+}
+
+
+EXPORT_SYMBOL (dma_pool_create);
+EXPORT_SYMBOL (dma_pool_destroy);
+EXPORT_SYMBOL (dma_pool_alloc);
+EXPORT_SYMBOL (dma_pool_free);
--- diff/drivers/block/cfq-iosched.c	1970-01-01 01:00:00.000000000 +0100
+++ source/drivers/block/cfq-iosched.c	2004-02-09 10:39:52.000000000 +0000
@@ -0,0 +1,707 @@
+/*
+ *  linux/drivers/block/cfq-iosched.c
+ *
+ *  CFQ, or complete fairness queueing, disk scheduler.
+ *
+ *  Based on ideas from a previously unfinished io
+ *  scheduler (round robin per-process disk scheduling) and Andrea Arcangeli.
+ *
+ *  Copyright (C) 2003 Jens Axboe <axboe@suse.de>
+ */
+#include <linux/kernel.h>
+#include <linux/fs.h>
+#include <linux/blkdev.h>
+#include <linux/elevator.h>
+#include <linux/bio.h>
+#include <linux/config.h>
+#include <linux/module.h>
+#include <linux/slab.h>
+#include <linux/init.h>
+#include <linux/compiler.h>
+#include <linux/hash.h>
+#include <linux/rbtree.h>
+#include <linux/mempool.h>
+
+/*
+ * tunables
+ */
+static int cfq_quantum = 4;
+static int cfq_queued = 8;
+
+#define CFQ_QHASH_SHIFT		6
+#define CFQ_QHASH_ENTRIES	(1 << CFQ_QHASH_SHIFT)
+#define list_entry_qhash(entry)	list_entry((entry), struct cfq_queue, cfq_hash)
+
+#define CFQ_MHASH_SHIFT		8
+#define CFQ_MHASH_BLOCK(sec)	((sec) >> 3)
+#define CFQ_MHASH_ENTRIES	(1 << CFQ_MHASH_SHIFT)
+#define CFQ_MHASH_FN(sec)	(hash_long(CFQ_MHASH_BLOCK((sec)),CFQ_MHASH_SHIFT))
+#define ON_MHASH(crq)		!list_empty(&(crq)->hash)
+#define rq_hash_key(rq)		((rq)->sector + (rq)->nr_sectors)
+#define list_entry_hash(ptr)	list_entry((ptr), struct cfq_rq, hash)
+
+#define list_entry_cfqq(ptr)	list_entry((ptr), struct cfq_queue, cfq_list)
+
+#define RQ_DATA(rq)		((struct cfq_rq *) (rq)->elevator_private)
+
+static kmem_cache_t *crq_pool;
+static kmem_cache_t *cfq_pool;
+static mempool_t *cfq_mpool;
+
+struct cfq_data {
+	struct list_head rr_list;
+	struct list_head *dispatch;
+	struct list_head *cfq_hash;
+
+	struct list_head *crq_hash;
+
+	unsigned int busy_queues;
+	unsigned int max_queued;
+
+	mempool_t *crq_pool;
+};
+
+struct cfq_queue {
+	struct list_head cfq_hash;
+	struct list_head cfq_list;
+	struct rb_root sort_list;
+	int pid;
+	int queued[2];
+#if 0
+	/*
+	 * with a simple addition like this, we can do io priorities. almost.
+	 * does need a split request free list, too.
+	 */
+	int io_prio
+#endif
+};
+
+struct cfq_rq {
+	struct rb_node rb_node;
+	sector_t rb_key;
+
+	struct request *request;
+
+	struct cfq_queue *cfq_queue;
+
+	struct list_head hash;
+};
+
+static void cfq_put_queue(struct cfq_data *cfqd, struct cfq_queue *cfqq);
+static struct cfq_queue *cfq_find_cfq_hash(struct cfq_data *cfqd, int pid);
+static void cfq_dispatch_sort(struct list_head *head, struct cfq_rq *crq);
+
+/*
+ * lots of deadline iosched dupes, can be abstracted later...
+ */
+static inline void __cfq_del_crq_hash(struct cfq_rq *crq)
+{
+	list_del_init(&crq->hash);
+}
+
+static inline void cfq_del_crq_hash(struct cfq_rq *crq)
+{
+	if (ON_MHASH(crq))
+		__cfq_del_crq_hash(crq);
+}
+
+static void cfq_remove_merge_hints(request_queue_t *q, struct cfq_rq *crq)
+{
+	cfq_del_crq_hash(crq);
+
+	if (q->last_merge == crq->request)
+		q->last_merge = NULL;
+}
+
+static inline void cfq_add_crq_hash(struct cfq_data *cfqd, struct cfq_rq *crq)
+{
+	struct request *rq = crq->request;
+
+	BUG_ON(ON_MHASH(crq));
+
+	list_add(&crq->hash, &cfqd->crq_hash[CFQ_MHASH_FN(rq_hash_key(rq))]);
+}
+
+static struct request *cfq_find_rq_hash(struct cfq_data *cfqd, sector_t offset)
+{
+	struct list_head *hash_list = &cfqd->crq_hash[CFQ_MHASH_FN(offset)];
+	struct list_head *entry, *next = hash_list->next;
+
+	while ((entry = next) != hash_list) {
+		struct cfq_rq *crq = list_entry_hash(entry);
+		struct request *__rq = crq->request;
+
+		next = entry->next;
+
+		BUG_ON(!ON_MHASH(crq));
+
+		if (!rq_mergeable(__rq)) {
+			__cfq_del_crq_hash(crq);
+			continue;
+		}
+
+		if (rq_hash_key(__rq) == offset)
+			return __rq;
+	}
+
+	return NULL;
+}
+
+/*
+ * rb tree support functions
+ */
+#define RB_NONE		(2)
+#define RB_EMPTY(node)	((node)->rb_node == NULL)
+#define RB_CLEAR(node)	((node)->rb_color = RB_NONE)
+#define RB_CLEAR_ROOT(root)	((root)->rb_node = NULL)
+#define ON_RB(node)	((node)->rb_color != RB_NONE)
+#define rb_entry_crq(node)	rb_entry((node), struct cfq_rq, rb_node)
+#define rq_rb_key(rq)		(rq)->sector
+
+static inline void cfq_del_crq_rb(struct cfq_queue *cfqq, struct cfq_rq *crq)
+{
+	if (ON_RB(&crq->rb_node)) {
+		cfqq->queued[rq_data_dir(crq->request)]--;
+		rb_erase(&crq->rb_node, &cfqq->sort_list);
+		crq->cfq_queue = NULL;
+	}
+}
+
+static struct cfq_rq *
+__cfq_add_crq_rb(struct cfq_queue *cfqq, struct cfq_rq *crq)
+{
+	struct rb_node **p = &cfqq->sort_list.rb_node;
+	struct rb_node *parent = NULL;
+	struct cfq_rq *__crq;
+
+	while (*p) {
+		parent = *p;
+		__crq = rb_entry_crq(parent);
+
+		if (crq->rb_key < __crq->rb_key)
+			p = &(*p)->rb_left;
+		else if (crq->rb_key > __crq->rb_key)
+			p = &(*p)->rb_right;
+		else
+			return __crq;
+	}
+
+	rb_link_node(&crq->rb_node, parent, p);
+	return 0;
+}
+
+static void
+cfq_add_crq_rb(struct cfq_data *cfqd, struct cfq_queue *cfqq,struct cfq_rq *crq)
+{
+	struct request *rq = crq->request;
+	struct cfq_rq *__alias;
+
+	crq->rb_key = rq_rb_key(rq);
+	cfqq->queued[rq_data_dir(rq)]++;
+retry:
+	__alias = __cfq_add_crq_rb(cfqq, crq);
+	if (!__alias) {
+		rb_insert_color(&crq->rb_node, &cfqq->sort_list);
+		crq->cfq_queue = cfqq;
+		return;
+	}
+
+	cfq_del_crq_rb(cfqq, __alias);
+	cfq_dispatch_sort(cfqd->dispatch, __alias);
+	goto retry;
+}
+
+static struct request *
+cfq_find_rq_rb(struct cfq_data *cfqd, sector_t sector)
+{
+	struct cfq_queue *cfqq = cfq_find_cfq_hash(cfqd, current->tgid);
+	struct rb_node *n;
+
+	if (!cfqq)
+		goto out;
+
+	n = cfqq->sort_list.rb_node;
+	while (n) {
+		struct cfq_rq *crq = rb_entry_crq(n);
+
+		if (sector < crq->rb_key)
+			n = n->rb_left;
+		else if (sector > crq->rb_key)
+			n = n->rb_right;
+		else
+			return crq->request;
+	}
+
+out:
+	return NULL;
+}
+
+static void cfq_remove_request(request_queue_t *q, struct request *rq)
+{
+	struct cfq_data *cfqd = q->elevator.elevator_data;
+	struct cfq_rq *crq = RQ_DATA(rq);
+
+	if (crq) {
+		struct cfq_queue *cfqq = crq->cfq_queue;
+
+		cfq_remove_merge_hints(q, crq);
+		list_del_init(&rq->queuelist);
+
+		if (cfqq) {
+			cfq_del_crq_rb(cfqq, crq);
+
+			if (RB_EMPTY(&cfqq->sort_list))
+				cfq_put_queue(cfqd, cfqq);
+		}
+	}
+}
+
+static int
+cfq_merge(request_queue_t *q, struct request **req, struct bio *bio)
+{
+	struct cfq_data *cfqd = q->elevator.elevator_data;
+	struct request *__rq;
+	int ret;
+
+	ret = elv_try_last_merge(q, bio);
+	if (ret != ELEVATOR_NO_MERGE) {
+		__rq = q->last_merge;
+		goto out_insert;
+	}
+
+	__rq = cfq_find_rq_hash(cfqd, bio->bi_sector);
+	if (__rq) {
+		BUG_ON(__rq->sector + __rq->nr_sectors != bio->bi_sector);
+
+		if (elv_rq_merge_ok(__rq, bio)) {
+			ret = ELEVATOR_BACK_MERGE;
+			goto out;
+		}
+	}
+
+	__rq = cfq_find_rq_rb(cfqd, bio->bi_sector + bio_sectors(bio));
+	if (__rq) {
+		if (elv_rq_merge_ok(__rq, bio)) {
+			ret = ELEVATOR_FRONT_MERGE;
+			goto out;
+		}
+	}
+
+	return ELEVATOR_NO_MERGE;
+out:
+	q->last_merge = __rq;
+out_insert:
+	*req = __rq;
+	return ret;
+}
+
+static void cfq_merged_request(request_queue_t *q, struct request *req)
+{
+	struct cfq_data *cfqd = q->elevator.elevator_data;
+	struct cfq_rq *crq = RQ_DATA(req);
+
+	cfq_del_crq_hash(crq);
+	cfq_add_crq_hash(cfqd, crq);
+
+	if (ON_RB(&crq->rb_node) && (rq_rb_key(req) != crq->rb_key)) {
+		struct cfq_queue *cfqq = crq->cfq_queue;
+
+		cfq_del_crq_rb(cfqq, crq);
+		cfq_add_crq_rb(cfqd, cfqq, crq);
+	}
+
+	q->last_merge = req;
+}
+
+static void
+cfq_merged_requests(request_queue_t *q, struct request *req,
+		    struct request *next)
+{
+	cfq_merged_request(q, req);
+	cfq_remove_request(q, next);
+}
+
+static void cfq_dispatch_sort(struct list_head *head, struct cfq_rq *crq)
+{
+	struct list_head *entry = head;
+	struct request *__rq;
+
+	if (!list_empty(head)) {
+		__rq = list_entry_rq(head->next);
+
+		if (crq->request->sector < __rq->sector) {
+			entry = head->prev;
+			goto link;
+		}
+	}
+
+	while ((entry = entry->prev) != head) {
+		__rq = list_entry_rq(entry);
+
+		if (crq->request->sector <= __rq->sector)
+			break;
+	}
+
+link:
+	list_add_tail(&crq->request->queuelist, entry);
+}
+
+static inline void
+__cfq_dispatch_requests(request_queue_t *q, struct cfq_data *cfqd,
+			struct cfq_queue *cfqq)
+{
+	struct cfq_rq *crq = rb_entry_crq(rb_first(&cfqq->sort_list));
+
+	cfq_del_crq_rb(cfqq, crq);
+	cfq_remove_merge_hints(q, crq);
+	cfq_dispatch_sort(cfqd->dispatch, crq);
+}
+
+static int cfq_dispatch_requests(request_queue_t *q, struct cfq_data *cfqd)
+{
+	struct cfq_queue *cfqq;
+	struct list_head *entry, *tmp;
+	int ret, queued, good_queues;
+
+	if (list_empty(&cfqd->rr_list))
+		return 0;
+
+	queued = ret = 0;
+restart:
+	good_queues = 0;
+	list_for_each_safe(entry, tmp, &cfqd->rr_list) {
+		cfqq = list_entry_cfqq(cfqd->rr_list.next);
+
+		BUG_ON(RB_EMPTY(&cfqq->sort_list));
+
+		__cfq_dispatch_requests(q, cfqd, cfqq);
+
+		if (RB_EMPTY(&cfqq->sort_list))
+			cfq_put_queue(cfqd, cfqq);
+		else
+			good_queues++;
+
+		queued++;
+		ret = 1;
+	}
+
+	if ((queued < cfq_quantum) && good_queues)
+		goto restart;
+
+	return ret;
+}
+
+static struct request *cfq_next_request(request_queue_t *q)
+{
+	struct cfq_data *cfqd = q->elevator.elevator_data;
+	struct request *rq;
+
+	if (!list_empty(cfqd->dispatch)) {
+		struct cfq_rq *crq;
+dispatch:
+		rq = list_entry_rq(cfqd->dispatch->next);
+
+		BUG_ON(q->last_merge == rq);
+		crq = RQ_DATA(rq);
+		if (crq)
+			BUG_ON(ON_MHASH(crq));
+
+		return rq;
+	}
+
+	if (cfq_dispatch_requests(q, cfqd))
+		goto dispatch;
+
+	return NULL;
+}
+
+static inline struct cfq_queue *
+__cfq_find_cfq_hash(struct cfq_data *cfqd, int pid, const int hashval)
+{
+	struct list_head *hash_list = &cfqd->cfq_hash[hashval];
+	struct list_head *entry;
+
+	list_for_each(entry, hash_list) {
+		struct cfq_queue *__cfqq = list_entry_qhash(entry);
+
+		if (__cfqq->pid == pid)
+			return __cfqq;
+	}
+
+	return NULL;
+}
+
+static struct cfq_queue *cfq_find_cfq_hash(struct cfq_data *cfqd, int pid)
+{
+	const int hashval = hash_long(current->tgid, CFQ_QHASH_SHIFT);
+
+	return __cfq_find_cfq_hash(cfqd, pid, hashval);
+}
+
+static void cfq_put_queue(struct cfq_data *cfqd, struct cfq_queue *cfqq)
+{
+	cfqd->busy_queues--;
+	list_del(&cfqq->cfq_list);
+	list_del(&cfqq->cfq_hash);
+	mempool_free(cfqq, cfq_mpool);
+}
+
+static struct cfq_queue *cfq_get_queue(struct cfq_data *cfqd, int pid)
+{
+	const int hashval = hash_long(current->tgid, CFQ_QHASH_SHIFT);
+	struct cfq_queue *cfqq = __cfq_find_cfq_hash(cfqd, pid, hashval);
+
+	if (!cfqq) {
+		cfqq = mempool_alloc(cfq_mpool, GFP_NOIO);
+
+		INIT_LIST_HEAD(&cfqq->cfq_hash);
+		INIT_LIST_HEAD(&cfqq->cfq_list);
+		RB_CLEAR_ROOT(&cfqq->sort_list);
+
+		cfqq->pid = pid;
+		cfqq->queued[0] = cfqq->queued[1] = 0;
+		list_add(&cfqq->cfq_hash, &cfqd->cfq_hash[hashval]);
+	}
+
+	return cfqq;
+}
+
+static void cfq_enqueue(struct cfq_data *cfqd, struct cfq_rq *crq)
+{
+	struct cfq_queue *cfqq;
+
+	cfqq = cfq_get_queue(cfqd, current->tgid);
+
+	cfq_add_crq_rb(cfqd, cfqq, crq);
+
+	if (list_empty(&cfqq->cfq_list)) {
+		list_add(&cfqq->cfq_list, &cfqd->rr_list);
+		cfqd->busy_queues++;
+	}
+}
+
+static void
+cfq_insert_request(request_queue_t *q, struct request *rq, int where)
+{
+	struct cfq_data *cfqd = q->elevator.elevator_data;
+	struct cfq_rq *crq = RQ_DATA(rq);
+
+	switch (where) {
+		case ELEVATOR_INSERT_BACK:
+			while (cfq_dispatch_requests(q, cfqd))
+				;
+			list_add_tail(&rq->queuelist, cfqd->dispatch);
+			break;
+		case ELEVATOR_INSERT_FRONT:
+			list_add(&rq->queuelist, cfqd->dispatch);
+			break;
+		case ELEVATOR_INSERT_SORT:
+			BUG_ON(!blk_fs_request(rq));
+			cfq_enqueue(cfqd, crq);
+			break;
+		default:
+			printk("%s: bad insert point %d\n", __FUNCTION__,where);
+			return;
+	}
+
+	if (rq_mergeable(rq)) {
+		cfq_add_crq_hash(cfqd, crq);
+
+		if (!q->last_merge)
+			q->last_merge = rq;
+	}
+}
+
+static int cfq_queue_empty(request_queue_t *q)
+{
+	struct cfq_data *cfqd = q->elevator.elevator_data;
+
+	if (list_empty(cfqd->dispatch) && list_empty(&cfqd->rr_list))
+		return 1;
+
+	return 0;
+}
+
+static struct request *
+cfq_former_request(request_queue_t *q, struct request *rq)
+{
+	struct cfq_rq *crq = RQ_DATA(rq);
+	struct rb_node *rbprev = rb_prev(&crq->rb_node);
+
+	if (rbprev)
+		return rb_entry_crq(rbprev)->request;
+
+	return NULL;
+}
+
+static struct request *
+cfq_latter_request(request_queue_t *q, struct request *rq)
+{
+	struct cfq_rq *crq = RQ_DATA(rq);
+	struct rb_node *rbnext = rb_next(&crq->rb_node);
+
+	if (rbnext)
+		return rb_entry_crq(rbnext)->request;
+
+	return NULL;
+}
+
+static int cfq_may_queue(request_queue_t *q, int rw)
+{
+	struct cfq_data *cfqd = q->elevator.elevator_data;
+	struct cfq_queue *cfqq;
+	int ret = 1;
+
+	if (!cfqd->busy_queues)
+		goto out;
+
+	cfqq = cfq_find_cfq_hash(cfqd, current->tgid);
+	if (cfqq) {
+		int limit = (q->nr_requests - cfq_queued) / cfqd->busy_queues;
+
+		if (limit < 3)
+			limit = 3;
+		else if (limit > cfqd->max_queued)
+			limit = cfqd->max_queued;
+
+		if (cfqq->queued[rw] > limit)
+			ret = 0;
+	}
+out:
+	return ret;
+}
+
+static void cfq_put_request(request_queue_t *q, struct request *rq)
+{
+	struct cfq_data *cfqd = q->elevator.elevator_data;
+	struct cfq_rq *crq = RQ_DATA(rq);
+
+	if (crq) {
+		BUG_ON(q->last_merge == rq);
+		BUG_ON(ON_MHASH(crq));
+
+		mempool_free(crq, cfqd->crq_pool);
+		rq->elevator_private = NULL;
+	}
+}
+
+static int cfq_set_request(request_queue_t *q, struct request *rq, int gfp_mask)
+{
+	struct cfq_data *cfqd = q->elevator.elevator_data;
+	struct cfq_rq *crq = mempool_alloc(cfqd->crq_pool, gfp_mask);
+
+	if (crq) {
+		RB_CLEAR(&crq->rb_node);
+		crq->request = rq;
+		crq->cfq_queue = NULL;
+		INIT_LIST_HEAD(&crq->hash);
+		rq->elevator_private = crq;
+		return 0;
+	}
+
+	return 1;
+}
+
+static void cfq_exit(request_queue_t *q, elevator_t *e)
+{
+	struct cfq_data *cfqd = e->elevator_data;
+
+	e->elevator_data = NULL;
+	mempool_destroy(cfqd->crq_pool);
+	kfree(cfqd->crq_hash);
+	kfree(cfqd->cfq_hash);
+	kfree(cfqd);
+}
+
+static int cfq_init(request_queue_t *q, elevator_t *e)
+{
+	struct cfq_data *cfqd;
+	int i;
+
+	cfqd = kmalloc(sizeof(*cfqd), GFP_KERNEL);
+	if (!cfqd)
+		return -ENOMEM;
+
+	memset(cfqd, 0, sizeof(*cfqd));
+	INIT_LIST_HEAD(&cfqd->rr_list);
+
+	cfqd->crq_hash = kmalloc(sizeof(struct list_head) * CFQ_MHASH_ENTRIES, GFP_KERNEL);
+	if (!cfqd->crq_hash)
+		goto out_crqhash;
+
+	cfqd->cfq_hash = kmalloc(sizeof(struct list_head) * CFQ_QHASH_ENTRIES, GFP_KERNEL);
+	if (!cfqd->cfq_hash)
+		goto out_cfqhash;
+
+	cfqd->crq_pool = mempool_create(BLKDEV_MIN_RQ, mempool_alloc_slab, mempool_free_slab, crq_pool);
+	if (!cfqd->crq_pool)
+		goto out_crqpool;
+
+	for (i = 0; i < CFQ_MHASH_ENTRIES; i++)
+		INIT_LIST_HEAD(&cfqd->crq_hash[i]);
+	for (i = 0; i < CFQ_QHASH_ENTRIES; i++)
+		INIT_LIST_HEAD(&cfqd->cfq_hash[i]);
+
+	cfqd->dispatch = &q->queue_head;
+	e->elevator_data = cfqd;
+
+	/*
+	 * just set it to some high value, we want anyone to be able to queue
+	 * some requests. fairness is handled differently
+	 */
+	cfqd->max_queued = q->nr_requests;
+	q->nr_requests = 8192;
+
+	return 0;
+out_crqpool:
+	kfree(cfqd->cfq_hash);
+out_cfqhash:
+	kfree(cfqd->crq_hash);
+out_crqhash:
+	kfree(cfqd);
+	return -ENOMEM;
+}
+
+static int __init cfq_slab_setup(void)
+{
+	crq_pool = kmem_cache_create("crq_pool", sizeof(struct cfq_rq), 0, 0,
+					NULL, NULL);
+
+	if (!crq_pool)
+		panic("cfq_iosched: can't init crq pool\n");
+
+	cfq_pool = kmem_cache_create("cfq_pool", sizeof(struct cfq_queue), 0, 0,
+					NULL, NULL);
+
+	if (!cfq_pool)
+		panic("cfq_iosched: can't init cfq pool\n");
+
+	cfq_mpool = mempool_create(64, mempool_alloc_slab, mempool_free_slab, cfq_pool);
+
+	if (!cfq_mpool)
+		panic("cfq_iosched: can't init cfq mpool\n");
+
+	return 0;
+}
+
+subsys_initcall(cfq_slab_setup);
+
+elevator_t iosched_cfq = {
+	.elevator_name =		"cfq",
+	.elevator_merge_fn = 		cfq_merge,
+	.elevator_merged_fn =		cfq_merged_request,
+	.elevator_merge_req_fn =	cfq_merged_requests,
+	.elevator_next_req_fn =		cfq_next_request,
+	.elevator_add_req_fn =		cfq_insert_request,
+	.elevator_remove_req_fn =	cfq_remove_request,
+	.elevator_queue_empty_fn =	cfq_queue_empty,
+	.elevator_former_req_fn =	cfq_former_request,
+	.elevator_latter_req_fn =	cfq_latter_request,
+	.elevator_set_req_fn =		cfq_set_request,
+	.elevator_put_req_fn =		cfq_put_request,
+	.elevator_may_queue_fn =	cfq_may_queue,
+	.elevator_init_fn =		cfq_init,
+	.elevator_exit_fn =		cfq_exit,
+};
+
+EXPORT_SYMBOL(iosched_cfq);
--- diff/drivers/block/paride/Transition-notes	1970-01-01 01:00:00.000000000 +0100
+++ source/drivers/block/paride/Transition-notes	2004-02-09 10:39:52.000000000 +0000
@@ -0,0 +1,128 @@
+Lemma 1:
+	If ps_tq is scheduled, ps_tq_active is 1.  ps_tq_int() can be called
+	only when ps_tq_active is 1.
+Proof:	All assignments to ps_tq_active and all scheduling of ps_tq happen
+	under ps_spinlock.  There are three places where that can happen:
+	one in ps_set_intr() (A) and two in ps_tq_int() (B and C).
+	Consider the sequnce of these events.  A can not be preceded by
+	anything except B, since it is under if (!ps_tq_active) under
+	ps_spinlock.  C is always preceded by B, since we can't reach it
+	other than through B and we don't drop ps_spinlock between them.
+	IOW, the sequence is A?(BA|BC|B)*.  OTOH, number of B can not exceed
+	the sum of numbers of A and C, since each call of ps_tq_int() is
+	the result of ps_tq execution.  Therefore, the sequence starts with
+	A and each B is preceded by either A or C.  Moments when we enter
+	ps_tq_int() are sandwiched between {A,C} and B in that sequence,
+	since at any time number of B can not exceed the number of these
+	moments which, in turn, can not exceed the number of A and C.
+	In other words, the sequence of events is (A or C set ps_tq_active to
+	1 and schedule ps_tq, ps_tq is executed, ps_tq_int() is entered,
+	B resets ps_tq_active)*.
+
+
+consider the following area:
+	* in do_pd_request1(): to calls of pi_do_claimed() and return in
+	  case when pd_req is NULL.
+	* in next_request(): to call of do_pd_request1()
+	* in do_pd_read(): to call of ps_set_intr()
+	* in do_pd_read_start(): to calls of pi_do_claimed(), next_request()
+and ps_set_intr()
+	* in do_pd_read_drq(): to calls of pi_do_claimed() and next_request()
+	* in do_pd_write(): to call of ps_set_intr()
+	* in do_pd_write_start(): to calls of pi_do_claimed(), next_request()
+and ps_set_intr()
+	* in do_pd_write_done(): to calls of pi_do_claimed() and next_request()
+	* in ps_set_intr(): to check for ps_tq_active and to scheduling
+	  ps_tq if ps_tq_active was 0.
+	* in ps_tq_int(): from the moment when we get ps_spinlock() to the
+	  return, call of con() or scheduling ps_tq.
+	* in pi_schedule_claimed() when called from pi_do_claimed() called from
+	  pd.c, everything until returning 1 or setting or setting ->claim_cont
+	  on the path that returns 0
+	* in pi_do_claimed() when called from pd.c, everything until the call
+	  of pi_do_claimed() plus the everything until the call of cont() if
+	  pi_do_claimed() has returned 1.
+	* in pi_wake_up() called for PIA that belongs to pd.c, everything from
+	  the moment when pi_spinlock has been acquired.
+
+Lemma 2:
+	1) at any time at most one thread of execution can be in that area or
+	be preempted there.
+	2) When there is such a thread, pd_busy is set or pd_lock is held by
+	that thread.
+	3) When there is such a thread, ps_tq_active is 0 or ps_spinlock is
+	held by that thread.
+	4) When there is such a thread, all PIA belonging to pd.c have NULL
+	->claim_cont or pi_spinlock is held by thread in question.
+
+Proof:	consider the first moment when the above is not true.
+
+(1) can become not true if some thread enters that area while another is there.
+	a) do_pd_request1() can be called from next_request() or do_pd_request()
+	   In the first case the thread was already in the area.  In the second,
+	   the thread was holding pd_lock and found pd_busy not set, which would
+	   mean that (2) was already not true.
+	b) ps_set_intr() and pi_schedule_claimed() can be called only from the
+	   area.
+	c) pi_do_claimed() is called by pd.c only from the area.
+	d) ps_tq_int() can enter the area only when the thread is holding
+	   ps_spinlock and ps_tq_active is 1 (due to Lemma 1).  It means that
+	   (3) was already not true.
+	e) do_pd_{read,write}* could be called only from the area.  The only
+	   case that needs consideration is call from pi_wake_up() and there
+	   we would have to be called for the PIA that got ->claimed_cont
+	   from pd.c.  That could happen only if pi_do_claimed() had been
+	   called from pd.c for that PIA, which happens only for PIA belonging
+	   to pd.c.
+	f) pi_wake_up() can enter the area only when the thread is holding
+	   pi_spinlock and ->claimed_cont is non-NULL for PIA belonging to
+	   pd.c.  It means that (4) was already not true.
+
+(2) can become not true only when pd_lock is released by the thread in question.
+	Indeed, pd_busy is reset only in the area and thread that resets
+	it is holding pd_lock.	The only place within the area where we
+	release pd_lock is in pd_next_buf() (called from within the area).
+	But that code does not reset pd_busy, so pd_busy would have to be
+	0 when pd_next_buf() had acquired pd_lock.  If it become 0 while
+	we were acquiring the lock, (1) would be already false, since
+	the thread that had reset it would be in the area simulateously.
+	If it was 0 before we tried to acquire pd_lock, (2) would be
+	already false.
+
+For similar reasons, (3) can become not true only when ps_spinlock is released
+by the thread in question.  However, all such places within the area are right
+after resetting ps_tq_active to 0.
+
+(4) is done the same way - all places where we release pi_spinlock within
+the area are either after resetting ->claimed_cont to NULL while holding
+pi_spinlock, or after not tocuhing ->claimed_cont since acquiring pi_spinlock
+also in the area.  The only place where ->claimed_cont is made non-NULL is
+in the area, under pi_spinlock and we do not release it until after leaving
+the area.
+
+QED.
+
+
+Corollary 1: ps_tq_active can be killed.  Indeed, the only place where we
+check its value is in ps_set_intr() and if it had been non-zero at that
+point, we would have violated either (2.1) (if it was set while ps_set_intr()
+was acquiring ps_spinlock) or (2.3) (if it was set when we started to
+acquire ps_spinlock).
+
+Corollary 2: ps_spinlock can be killed.  Indeed, Lemma 1 and Lemma 2 show
+that the only possible contention is between scheduling ps_tq followed by
+immediate release of spinlock and beginning of execution of ps_tq on
+another CPU.
+
+Corollary 3: assignment to pd_busy in do_pd_read_start() and do_pd_write_start()
+can be killed.  Indeed, we are not holding pd_lock and thus pd_busy is already
+1 here.
+
+Corollary 4: in ps_tq_int() uses of con can be replaced with uses of
+ps_continuation, since the latter is changed only from the area.
+We don't need to reset it to NULL, since we are guaranteed that there
+will be a call of ps_set_intr() before we look at ps_continuation again.
+We can remove the check for ps_continuation being NULL for the same
+reason - the value is guaranteed to be set by the last ps_set_intr() and
+we never pass it NULL.  Assignements in the beginning of ps_set_intr()
+can be taken to callers as long as they remain within the area.
--- diff/drivers/char/drm/drm_irq.h	1970-01-01 01:00:00.000000000 +0100
+++ source/drivers/char/drm/drm_irq.h	2004-02-09 10:39:52.000000000 +0000
@@ -0,0 +1,377 @@
+/**
+ * \file drm_irq.h 
+ * IRQ support
+ *
+ * \author Rickard E. (Rik) Faith <faith@valinux.com>
+ * \author Gareth Hughes <gareth@valinux.com>
+ */
+
+/*
+ * Created: Fri Mar 19 14:30:16 1999 by faith@valinux.com
+ *
+ * Copyright 1999, 2000 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * 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.  IN NO EVENT SHALL
+ * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#include "drmP.h"
+
+#include <linux/interrupt.h>	/* For task queue support */
+
+#ifndef __HAVE_SHARED_IRQ
+#define __HAVE_SHARED_IRQ	0
+#endif
+
+#if __HAVE_SHARED_IRQ
+#define DRM_IRQ_TYPE		SA_SHIRQ
+#else
+#define DRM_IRQ_TYPE		0
+#endif
+
+/**
+ * Get interrupt from bus id.
+ * 
+ * \param inode device inode.
+ * \param filp file pointer.
+ * \param cmd command.
+ * \param arg user argument, pointing to a drm_irq_busid structure.
+ * \return zero on success or a negative number on failure.
+ * 
+ * Finds the PCI device with the specified bus id and gets its IRQ number.
+ * This IOCTL is deprecated, and will now return EINVAL for any busid not equal
+ * to that of the device that this DRM instance attached to.
+ */
+int DRM(irq_by_busid)(struct inode *inode, struct file *filp,
+		   unsigned int cmd, unsigned long arg)
+{
+	drm_file_t *priv = filp->private_data;
+	drm_device_t *dev = priv->dev;
+	drm_irq_busid_t p;
+
+	if (copy_from_user(&p, (drm_irq_busid_t *)arg, sizeof(p)))
+		return -EFAULT;
+
+	if ((p.busnum >> 8) != dev->pci_domain ||
+	    (p.busnum & 0xff) != dev->pci_bus ||
+	    p.devnum != dev->pci_slot ||
+	    p.funcnum != dev->pci_func)
+		return -EINVAL;
+
+	p.irq = dev->irq;
+
+	DRM_DEBUG("%d:%d:%d => IRQ %d\n",
+		  p.busnum, p.devnum, p.funcnum, p.irq);
+	if (copy_to_user((drm_irq_busid_t *)arg, &p, sizeof(p)))
+		return -EFAULT;
+	return 0;
+}
+
+#if __HAVE_IRQ
+
+/**
+ * Install IRQ handler.
+ *
+ * \param dev DRM device.
+ * \param irq IRQ number.
+ *
+ * Initializes the IRQ related data, and setups drm_device::vbl_queue. Installs the handler, calling the driver
+ * \c DRM(driver_irq_preinstall)() and \c DRM(driver_irq_postinstall)() functions
+ * before and after the installation.
+ */
+int DRM(irq_install)( drm_device_t *dev )
+{
+	int ret;
+ 
+	if ( dev->irq == 0 )
+		return -EINVAL;
+
+	down( &dev->struct_sem );
+
+	/* Driver must have been initialized */
+	if ( !dev->dev_private ) {
+		up( &dev->struct_sem );
+		return -EINVAL;
+	}
+
+	if ( dev->irq_enabled ) {
+		up( &dev->struct_sem );
+		return -EBUSY;
+	}
+	dev->irq_enabled = 1;
+	up( &dev->struct_sem );
+
+	DRM_DEBUG( "%s: irq=%d\n", __FUNCTION__, dev->irq );
+
+#if 0 /* this is already done in DRM(setup) - why do it here ?? */
+	dev->context_flag = 0;
+	dev->interrupt_flag = 0;
+	dev->dma_flag = 0;
+#endif
+
+#if __HAVE_DMA
+	dev->dma->next_buffer = NULL;
+	dev->dma->next_queue = NULL;
+	dev->dma->this_buffer = NULL;
+#endif
+
+#if __HAVE_IRQ_BH
+	INIT_WORK(&dev->work, DRM(irq_immediate_bh), dev);
+#endif
+
+#if __HAVE_VBL_IRQ
+	init_waitqueue_head(&dev->vbl_queue);
+
+	spin_lock_init( &dev->vbl_lock );
+
+	INIT_LIST_HEAD( &dev->vbl_sigs.head );
+
+	dev->vbl_pending = 0;
+#endif
+
+				/* Before installing handler */
+	DRM(driver_irq_preinstall)(dev);
+
+				/* Install handler */
+	ret = request_irq( dev->irq, DRM(irq_handler),
+			   DRM_IRQ_TYPE, dev->devname, dev );
+	if ( ret < 0 ) {
+		down( &dev->struct_sem );
+		dev->irq_enabled = 0;
+		up( &dev->struct_sem );
+		return ret;
+	}
+
+				/* After installing handler */
+	DRM(driver_irq_postinstall)(dev);
+
+	return 0;
+}
+
+/**
+ * Uninstall the IRQ handler.
+ *
+ * \param dev DRM device.
+ *
+ * Calls the driver's \c DRM(driver_irq_uninstall)() function, and stops the irq.
+ */
+int DRM(irq_uninstall)( drm_device_t *dev )
+{
+	int irq_enabled;
+
+	down( &dev->struct_sem );
+	irq_enabled = dev->irq_enabled;
+	dev->irq_enabled = 0;
+	up( &dev->struct_sem );
+
+	if ( !irq_enabled )
+		return -EINVAL;
+
+	DRM_DEBUG( "%s: irq=%d\n", __FUNCTION__, dev->irq );
+
+	DRM(driver_irq_uninstall)( dev );
+
+	free_irq( dev->irq, dev );
+
+	return 0;
+}
+
+/**
+ * IRQ control ioctl.
+ *
+ * \param inode device inode.
+ * \param filp file pointer.
+ * \param cmd command.
+ * \param arg user argument, pointing to a drm_control structure.
+ * \return zero on success or a negative number on failure.
+ *
+ * Calls irq_install() or irq_uninstall() according to \p arg.
+ */
+int DRM(control)( struct inode *inode, struct file *filp,
+		  unsigned int cmd, unsigned long arg )
+{
+	drm_file_t *priv = filp->private_data;
+	drm_device_t *dev = priv->dev;
+	drm_control_t ctl;
+
+	if ( copy_from_user( &ctl, (drm_control_t *)arg, sizeof(ctl) ) )
+		return -EFAULT;
+
+	switch ( ctl.func ) {
+	case DRM_INST_HANDLER:
+		if (dev->if_version < DRM_IF_VERSION(1, 2) &&
+		    ctl.irq != dev->irq)
+			return -EINVAL;
+		return DRM(irq_install)( dev );
+	case DRM_UNINST_HANDLER:
+		return DRM(irq_uninstall)( dev );
+	default:
+		return -EINVAL;
+	}
+}
+
+#if __HAVE_VBL_IRQ
+
+/**
+ * Wait for VBLANK.
+ *
+ * \param inode device inode.
+ * \param filp file pointer.
+ * \param cmd command.
+ * \param data user argument, pointing to a drm_wait_vblank structure.
+ * \return zero on success or a negative number on failure.
+ *
+ * Verifies the IRQ is installed. 
+ *
+ * If a signal is requested checks if this task has already scheduled the same signal
+ * for the same vblank sequence number - nothing to be done in
+ * that case. If the number of tasks waiting for the interrupt exceeds 100 the
+ * function fails. Otherwise adds a new entry to drm_device::vbl_sigs for this
+ * task.
+ *
+ * If a signal is not requested, then calls vblank_wait().
+ */
+int DRM(wait_vblank)( DRM_IOCTL_ARGS )
+{
+	drm_file_t *priv = filp->private_data;
+	drm_device_t *dev = priv->dev;
+	drm_wait_vblank_t vblwait;
+	struct timeval now;
+	int ret = 0;
+	unsigned int flags;
+
+	if (!dev->irq)
+		return -EINVAL;
+
+	DRM_COPY_FROM_USER_IOCTL( vblwait, (drm_wait_vblank_t *)data,
+				  sizeof(vblwait) );
+
+	switch ( vblwait.request.type & ~_DRM_VBLANK_FLAGS_MASK ) {
+	case _DRM_VBLANK_RELATIVE:
+		vblwait.request.sequence += atomic_read( &dev->vbl_received );
+		vblwait.request.type &= ~_DRM_VBLANK_RELATIVE;
+	case _DRM_VBLANK_ABSOLUTE:
+		break;
+	default:
+		return -EINVAL;
+	}
+
+	flags = vblwait.request.type & _DRM_VBLANK_FLAGS_MASK;
+	
+	if ( flags & _DRM_VBLANK_SIGNAL ) {
+		unsigned long irqflags;
+		drm_vbl_sig_t *vbl_sig;
+		
+		vblwait.reply.sequence = atomic_read( &dev->vbl_received );
+
+		spin_lock_irqsave( &dev->vbl_lock, irqflags );
+
+		/* Check if this task has already scheduled the same signal
+		 * for the same vblank sequence number; nothing to be done in
+		 * that case
+		 */
+		list_for_each_entry( vbl_sig, &dev->vbl_sigs.head, head ) {
+			if (vbl_sig->sequence == vblwait.request.sequence
+			    && vbl_sig->info.si_signo == vblwait.request.signal
+			    && vbl_sig->task == current)
+			{
+				spin_unlock_irqrestore( &dev->vbl_lock, irqflags );
+				goto done;
+			}
+		}
+
+		if ( dev->vbl_pending >= 100 ) {
+			spin_unlock_irqrestore( &dev->vbl_lock, irqflags );
+			return -EBUSY;
+		}
+
+		dev->vbl_pending++;
+
+		spin_unlock_irqrestore( &dev->vbl_lock, irqflags );
+
+		if ( !( vbl_sig = DRM_MALLOC( sizeof( drm_vbl_sig_t ) ) ) ) {
+			return -ENOMEM;
+		}
+
+		memset( (void *)vbl_sig, 0, sizeof(*vbl_sig) );
+
+		vbl_sig->sequence = vblwait.request.sequence;
+		vbl_sig->info.si_signo = vblwait.request.signal;
+		vbl_sig->task = current;
+
+		spin_lock_irqsave( &dev->vbl_lock, irqflags );
+
+		list_add_tail( (struct list_head *) vbl_sig, &dev->vbl_sigs.head );
+
+		spin_unlock_irqrestore( &dev->vbl_lock, irqflags );
+	} else {
+		ret = DRM(vblank_wait)( dev, &vblwait.request.sequence );
+
+		do_gettimeofday( &now );
+		vblwait.reply.tval_sec = now.tv_sec;
+		vblwait.reply.tval_usec = now.tv_usec;
+	}
+
+done:
+	DRM_COPY_TO_USER_IOCTL( (drm_wait_vblank_t *)data, vblwait,
+				sizeof(vblwait) );
+
+	return ret;
+}
+
+/**
+ * Send the VBLANK signals.
+ *
+ * \param dev DRM device.
+ *
+ * Sends a signal for each task in drm_device::vbl_sigs and empties the list.
+ *
+ * If a signal is not requested, then calls vblank_wait().
+ */
+void DRM(vbl_send_signals)( drm_device_t *dev )
+{
+	struct list_head *list, *tmp;
+	drm_vbl_sig_t *vbl_sig;
+	unsigned int vbl_seq = atomic_read( &dev->vbl_received );
+	unsigned long flags;
+
+	spin_lock_irqsave( &dev->vbl_lock, flags );
+
+	list_for_each_safe( list, tmp, &dev->vbl_sigs.head ) {
+		vbl_sig = list_entry( list, drm_vbl_sig_t, head );
+		if ( ( vbl_seq - vbl_sig->sequence ) <= (1<<23) ) {
+			vbl_sig->info.si_code = vbl_seq;
+			send_sig_info( vbl_sig->info.si_signo, &vbl_sig->info, vbl_sig->task );
+
+			list_del( list );
+
+			DRM_FREE( vbl_sig, sizeof(*vbl_sig) );
+
+			dev->vbl_pending--;
+		}
+	}
+
+	spin_unlock_irqrestore( &dev->vbl_lock, flags );
+}
+
+#endif	/* __HAVE_VBL_IRQ */
+
+#endif /* __HAVE_IRQ */
--- diff/drivers/char/generic_nvram.c	1970-01-01 01:00:00.000000000 +0100
+++ source/drivers/char/generic_nvram.c	2004-02-09 10:39:52.000000000 +0000
@@ -0,0 +1,145 @@
+/*
+ * Generic /dev/nvram driver for architectures providing some
+ * "generic" hooks, that is :
+ *
+ * nvram_read_byte, nvram_write_byte, nvram_sync
+ *
+ * Note that an additional hook is supported for PowerMac only
+ * for getting the nvram "partition" informations
+ *
+ */
+
+#define NVRAM_VERSION "1.1"
+
+#include <linux/module.h>
+
+#include <linux/types.h>
+#include <linux/errno.h>
+#include <linux/fs.h>
+#include <linux/miscdevice.h>
+#include <linux/fcntl.h>
+#include <linux/init.h>
+#include <linux/smp_lock.h>
+#include <asm/uaccess.h>
+#include <asm/nvram.h>
+
+#define NVRAM_SIZE	8192
+
+static loff_t nvram_llseek(struct file *file, loff_t offset, int origin)
+{
+	lock_kernel();
+	switch (origin) {
+	case 1:
+		offset += file->f_pos;
+		break;
+	case 2:
+		offset += NVRAM_SIZE;
+		break;
+	}
+	if (offset < 0) {
+		unlock_kernel();
+		return -EINVAL;
+	}
+	file->f_pos = offset;
+	unlock_kernel();
+	return file->f_pos;
+}
+
+static ssize_t read_nvram(struct file *file, char __user *buf,
+			  size_t count, loff_t *ppos)
+{
+	unsigned int i;
+	char __user *p = buf;
+
+	if (verify_area(VERIFY_WRITE, buf, count))
+		return -EFAULT;
+	if (*ppos >= NVRAM_SIZE)
+		return 0;
+	for (i = *ppos; count > 0 && i < NVRAM_SIZE; ++i, ++p, --count)
+		if (__put_user(nvram_read_byte(i), p))
+			return -EFAULT;
+	*ppos = i;
+	return p - buf;
+}
+
+static ssize_t write_nvram(struct file *file, const char __user *buf,
+			   size_t count, loff_t *ppos)
+{
+	unsigned int i;
+	const char __user *p = buf;
+	char c;
+
+	if (verify_area(VERIFY_READ, buf, count))
+		return -EFAULT;
+	if (*ppos >= NVRAM_SIZE)
+		return 0;
+	for (i = *ppos; count > 0 && i < NVRAM_SIZE; ++i, ++p, --count) {
+		if (__get_user(c, p))
+			return -EFAULT;
+		nvram_write_byte(c, i);
+	}
+	*ppos = i;
+	return p - buf;
+}
+
+static int nvram_ioctl(struct inode *inode, struct file *file,
+	unsigned int cmd, unsigned long arg)
+{
+	switch(cmd) {
+#ifdef CONFIG_PPC_PMAC
+	case OBSOLETE_PMAC_NVRAM_GET_OFFSET:
+		printk(KERN_WARNING "nvram: Using obsolete PMAC_NVRAM_GET_OFFSET ioctl\n");
+	case IOC_NVRAM_GET_OFFSET: {
+		int part, offset;
+
+		if (_machine != _MACH_Pmac)
+			return -EINVAL;
+		if (copy_from_user(&part, (void __user*)arg, sizeof(part)) != 0)
+			return -EFAULT;
+		if (part < pmac_nvram_OF || part > pmac_nvram_NR)
+			return -EINVAL;
+		offset = pmac_get_partition(part);
+		if (copy_to_user((void __user*)arg, &offset, sizeof(offset)) != 0)
+			return -EFAULT;
+		break;
+	}
+#endif /* CONFIG_PPC_PMAC */
+	case IOC_NVRAM_SYNC:
+		nvram_sync();
+		break;
+	default:
+		return -EINVAL;
+	}
+
+	return 0;
+}
+
+struct file_operations nvram_fops = {
+	.owner		= THIS_MODULE,
+	.llseek		= nvram_llseek,
+	.read		= read_nvram,
+	.write		= write_nvram,
+	.ioctl		= nvram_ioctl,
+};
+
+static struct miscdevice nvram_dev = {
+	NVRAM_MINOR,
+	"nvram",
+	&nvram_fops
+};
+
+int __init nvram_init(void)
+{
+	printk(KERN_INFO "Macintosh non-volatile memory driver v%s\n",
+		NVRAM_VERSION);
+	return misc_register(&nvram_dev);
+}
+
+void __exit nvram_cleanup(void)
+{
+        misc_deregister( &nvram_dev );
+}
+
+module_init(nvram_init);
+module_exit(nvram_cleanup);
+MODULE_LICENSE("GPL");
--- diff/drivers/i2c/busses/i2c-hydra.c	1970-01-01 01:00:00.000000000 +0100
+++ source/drivers/i2c/busses/i2c-hydra.c	2004-02-09 10:39:52.000000000 +0000
@@ -0,0 +1,186 @@
+/*
+    i2c-hydra.c - Part of lm_sensors,  Linux kernel modules
+                  for hardware monitoring
+
+    i2c Support for the Apple `Hydra' Mac I/O
+
+    Copyright (c) 1999-2004 Geert Uytterhoeven <geert@linux-m68k.org>
+
+    Based on i2c Support for Via Technologies 82C586B South Bridge
+    Copyright (c) 1998, 1999 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/kernel.h>
+#include <linux/module.h>
+#include <linux/pci.h>
+#include <linux/types.h>
+#include <linux/i2c.h>
+#include <linux/i2c-algo-bit.h>
+#include <linux/init.h>
+#include <asm/io.h>
+#include <asm/hydra.h>
+
+
+#define HYDRA_CPD_PD0	0x00000001	/* CachePD lines */
+#define HYDRA_CPD_PD1	0x00000002
+#define HYDRA_CPD_PD2	0x00000004
+#define HYDRA_CPD_PD3	0x00000008
+
+#define HYDRA_SCLK	HYDRA_CPD_PD0
+#define HYDRA_SDAT	HYDRA_CPD_PD1
+#define HYDRA_SCLK_OE	0x00000010
+#define HYDRA_SDAT_OE	0x00000020
+
+static inline void pdregw(void *data, u32 val)
+{
+	struct Hydra *hydra = (struct Hydra *)data;
+	writel(val, &hydra->CachePD);
+}
+
+static inline u32 pdregr(void *data)
+{
+	struct Hydra *hydra = (struct Hydra *)data;
+	return readl(&hydra->CachePD);
+}
+
+static void hydra_bit_setscl(void *data, int state)
+{
+	u32 val = pdregr(data);
+	if (state)
+		val &= ~HYDRA_SCLK_OE;
+	else {
+		val &= ~HYDRA_SCLK;
+		val |= HYDRA_SCLK_OE;
+	}
+	pdregw(data, val);
+}
+
+static void hydra_bit_setsda(void *data, int state)
+{
+	u32 val = pdregr(data);
+	if (state)
+		val &= ~HYDRA_SDAT_OE;
+	else {
+		val &= ~HYDRA_SDAT;
+		val |= HYDRA_SDAT_OE;
+	}
+	pdregw(data, val);
+}
+
+static int hydra_bit_getscl(void *data)
+{
+	return (pdregr(data) & HYDRA_SCLK) != 0;
+}
+
+static int hydra_bit_getsda(void *data)
+{
+	return (pdregr(data) & HYDRA_SDAT) != 0;
+}
+
+/* ------------------------------------------------------------------------ */
+
+static struct i2c_algo_bit_data hydra_bit_data = {
+	.setsda		= hydra_bit_setsda,
+	.setscl		= hydra_bit_setscl,
+	.getsda		= hydra_bit_getsda,
+	.getscl		= hydra_bit_getscl,
+	.udelay		= 5,
+	.mdelay		= 5,
+	.timeout	= HZ
+};
+
+static struct i2c_adapter hydra_adap = {
+	.owner		= THIS_MODULE,
+	.name		= "Hydra i2c",
+	.id		= I2C_HW_B_HYDRA,
+	.algo_data	= &hydra_bit_data,
+};
+
+static struct pci_device_id hydra_ids[] = {
+	{
+		.vendor		= PCI_VENDOR_ID_APPLE,
+		.device		= PCI_DEVICE_ID_APPLE_HYDRA,
+		.subvendor	= PCI_ANY_ID,
+		.subdevice	= PCI_ANY_ID,
+	},
+	{ 0, }
+};
+
+static int __devinit hydra_probe(struct pci_dev *dev,
+				 const struct pci_device_id *id)
+{
+	unsigned long base = pci_resource_start(dev, 0);
+	int res;
+
+	if (!request_mem_region(base+offsetof(struct Hydra, CachePD), 4,
+				hydra_adap.name))
+		return -EBUSY;
+
+	hydra_bit_data.data = ioremap(base, pci_resource_len(dev, 0));
+	if (hydra_bit_data.data == NULL) {
+		release_mem_region(base+offsetof(struct Hydra, CachePD), 4);
+		return -ENODEV;
+	}
+
+	pdregw(hydra_bit_data.data, 0);		/* clear SCLK_OE and SDAT_OE */
+	hydra_adap.dev.parent = &dev->dev;
+	res = i2c_bit_add_bus(&hydra_adap);
+	if (res < 0) {
+		iounmap(hydra_bit_data.data);
+		release_mem_region(base+offsetof(struct Hydra, CachePD), 4);
+		return res;
+	}
+	return 0;
+}
+
+static void __devexit hydra_remove(struct pci_dev *dev)
+{
+	pdregw(hydra_bit_data.data, 0);		/* clear SCLK_OE and SDAT_OE */
+	i2c_bit_del_bus(&hydra_adap);
+	iounmap(hydra_bit_data.data);
+	release_mem_region(pci_resource_start(dev, 0)+
+			   offsetof(struct Hydra, CachePD), 4);
+}
+
+
+static struct pci_driver hydra_driver = {
+	.name		= "hydra smbus",
+	.id_table	= hydra_ids,
+	.probe		= hydra_probe,
+	.remove		= __devexit_p(hydra_remove),
+};
+
+static int __init i2c_hydra_init(void)
+{
+	return pci_module_init(&hydra_driver);
+}
+
+
+static void __exit i2c_hydra_exit(void)
+{
+	pci_unregister_driver(&hydra_driver);
+}
+
+
+
+MODULE_AUTHOR("Geert Uytterhoeven <geert@linux-m68k.org>");
+MODULE_DESCRIPTION("i2c for Apple Hydra Mac I/O");
+MODULE_LICENSE("GPL");
+
+module_init(i2c_hydra_init);
+module_exit(i2c_hydra_exit);
+
--- diff/drivers/i2c/chips/gl518sm.c	1970-01-01 01:00:00.000000000 +0100
+++ source/drivers/i2c/chips/gl518sm.c	2004-02-09 10:39:52.000000000 +0000
@@ -0,0 +1,612 @@
+/*
+ * gl518sm.c - Part of lm_sensors, Linux kernel modules for hardware
+ *             monitoring
+ * Copyright (C) 1998, 1999 Frodo Looijaard <frodol@dds.nl> and
+ * Kyosti Malkki <kmalkki@cc.hut.fi>
+ * Copyright (C) 2004 Hong-Gunn Chew <hglinux@gunnet.org> 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.
+ *
+ * Ported to Linux 2.6 by Hong-Gunn Chew with the help of Jean Delvare
+ * and advice of Greg Kroah-Hartman.
+ *
+ * Notes about the port:
+ * Release 0x00 of the GL518SM chipset doesn't support reading of in0,
+ * in1 nor in2. The original driver had an ugly workaround to get them
+ * anyway (changing limits and watching alarms trigger and wear off).
+ * We did not keep that part of the original driver in the Linux 2.6
+ * version, since it was making the driver significantly more complex
+ * with no real benefit.
+ *
+ * History:
+ * 2004-01-28  Original port. (Hong-Gunn Chew)
+ * 2004-01-31  Code review and approval. (Jean Delvare)
+ */
+
+#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 */
+static unsigned short normal_i2c[] = { 0x2c, 0x2d, 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(gl518sm_r00, gl518sm_r80);
+
+/* Many GL518 constants specified below */
+
+/* The GL518 registers */
+#define GL518_REG_CHIP_ID	0x00
+#define GL518_REG_REVISION	0x01
+#define GL518_REG_VENDOR_ID	0x02
+#define GL518_REG_CONF		0x03
+#define GL518_REG_TEMP_IN	0x04
+#define GL518_REG_TEMP_MAX	0x05
+#define GL518_REG_TEMP_HYST	0x06
+#define GL518_REG_FAN_COUNT	0x07
+#define GL518_REG_FAN_LIMIT	0x08
+#define GL518_REG_VIN1_LIMIT	0x09
+#define GL518_REG_VIN2_LIMIT	0x0a
+#define GL518_REG_VIN3_LIMIT	0x0b
+#define GL518_REG_VDD_LIMIT	0x0c
+#define GL518_REG_VIN3		0x0d
+#define GL518_REG_MISC		0x0f
+#define GL518_REG_ALARM		0x10
+#define GL518_REG_MASK		0x11
+#define GL518_REG_INT		0x12
+#define GL518_REG_VIN2		0x13
+#define GL518_REG_VIN1		0x14
+#define GL518_REG_VDD		0x15
+
+
+/*
+ * Conversions. Rounding and limit checking is only done on the TO_REG
+ * variants. Note that you should be a bit careful with which arguments
+ * these macros are called: arguments may be evaluated more than once.
+ * Fixing this is just not worth it.
+ */
+
+#define RAW_FROM_REG(val)	val
+
+#define BOOL_FROM_REG(val)	((val)?0:1)
+#define BOOL_TO_REG(val)	((val)?0:1)
+
+#define TEMP_TO_REG(val)	(SENSORS_LIMIT(((((val)<0? \
+				(val)-500:(val)+500)/1000)+119),0,255))
+#define TEMP_FROM_REG(val)	(((val) - 119) * 1000)
+
+static inline u8 FAN_TO_REG(long rpm, int div)
+{
+	long rpmdiv;
+	if (rpm == 0)
+		return 0;
+	rpmdiv = SENSORS_LIMIT(rpm, 1, 1920000) * div;
+	return SENSORS_LIMIT((960000 + rpmdiv / 2) / rpmdiv, 1, 255);
+}
+#define FAN_FROM_REG(val,div)	((val)==0 ? 0 : (960000/((val)*(div))))
+
+#define IN_TO_REG(val)		(SENSORS_LIMIT((((val)+9)/19),0,255))
+#define IN_FROM_REG(val)	((val)*19)
+
+#define VDD_TO_REG(val)		(SENSORS_LIMIT((((val)*4+47)/95),0,255))
+#define VDD_FROM_REG(val)	(((val)*95+2)/4)
+
+#define DIV_TO_REG(val)		((val)==4?2:(val)==2?1:(val)==1?0:3)
+#define DIV_FROM_REG(val)	(1 << (val))
+
+#define BEEP_MASK_TO_REG(val)	((val) & 0x7f & data->alarm_mask)
+#define BEEP_MASK_FROM_REG(val)	((val) & 0x7f)
+
+/* Each client has this additional data */
+struct gl518_data {
+	enum chips type;
+
+	struct semaphore update_lock;
+	char valid;		/* !=0 if following fields are valid */
+	unsigned long last_updated;	/* In jiffies */
+
+	u8 voltage_in[4];	/* Register values; [0] = VDD */
+	u8 voltage_min[4];	/* Register values; [0] = VDD */
+	u8 voltage_max[4];	/* Register values; [0] = VDD */
+	u8 iter_voltage_in[4];	/* Register values; [0] = VDD */
+	u8 fan_in[2];
+	u8 fan_min[2];
+	u8 fan_div[2];		/* Register encoding, shifted right */
+	u8 fan_auto1;		/* Boolean */
+	u8 temp_in;		/* Register values */
+	u8 temp_max;		/* Register values */
+	u8 temp_hyst;		/* Register values */
+	u8 alarms;		/* Register value */
+	u8 alarm_mask;		/* Register value */
+	u8 beep_mask;		/* Register value */
+	u8 beep_enable;		/* Boolean */
+};
+
+static int gl518_attach_adapter(struct i2c_adapter *adapter);
+static int gl518_detect(struct i2c_adapter *adapter, int address, int kind);
+static void gl518_init_client(struct i2c_client *client);
+static int gl518_detach_client(struct i2c_client *client);
+static int gl518_read_value(struct i2c_client *client, u8 reg);
+static int gl518_write_value(struct i2c_client *client, u8 reg, u16 value);
+static void gl518_update_client(struct i2c_client *client);
+
+/* This is the driver that will be inserted */
+static struct i2c_driver gl518_driver = {
+	.owner		= THIS_MODULE,
+	.name		= "gl518sm",
+	.id		= I2C_DRIVERID_GL518,
+	.flags		= I2C_DF_NOTIFY,
+	.attach_adapter	= gl518_attach_adapter,
+	.detach_client	= gl518_detach_client,
+};
+
+/*
+ * Internal variables
+ */
+
+static int gl518_id = 0;
+
+/*
+ * Sysfs stuff
+ */
+
+#define show(type, suffix, value)					\
+static ssize_t show_##suffix(struct device *dev, char *buf)		\
+{									\
+	struct i2c_client *client = to_i2c_client(dev);			\
+	struct gl518_data *data = i2c_get_clientdata(client);		\
+	gl518_update_client(client);					\
+	return sprintf(buf, "%d\n", type##_FROM_REG(data->value));	\
+}
+
+#define show_fan(suffix, value, index)					\
+static ssize_t show_##suffix(struct device *dev, char *buf)		\
+{									\
+	struct i2c_client *client = to_i2c_client(dev);			\
+	struct gl518_data *data = i2c_get_clientdata(client);		\
+	gl518_update_client(client);					\
+	return sprintf(buf, "%d\n", FAN_FROM_REG(data->value[index],	\
+		DIV_FROM_REG(data->fan_div[index])));			\
+}
+
+show(TEMP, temp_input1, temp_in);
+show(TEMP, temp_max1, temp_max);
+show(TEMP, temp_hyst1, temp_hyst);
+show(BOOL, fan_auto1, fan_auto1);
+show_fan(fan_input1, fan_in, 0);
+show_fan(fan_input2, fan_in, 1);
+show_fan(fan_min1, fan_min, 0);
+show_fan(fan_min2, fan_min, 1);
+show(DIV, fan_div1, fan_div[0]);
+show(DIV, fan_div2, fan_div[1]);
+show(VDD, in_input0, voltage_in[0]);
+show(IN, in_input1, voltage_in[1]);
+show(IN, in_input2, voltage_in[2]);
+show(IN, in_input3, voltage_in[3]);
+show(VDD, in_min0, voltage_min[0]);
+show(IN, in_min1, voltage_min[1]);
+show(IN, in_min2, voltage_min[2]);
+show(IN, in_min3, voltage_min[3]);
+show(VDD, in_max0, voltage_max[0]);
+show(IN, in_max1, voltage_max[1]);
+show(IN, in_max2, voltage_max[2]);
+show(IN, in_max3, voltage_max[3]);
+show(RAW, alarms, alarms);
+show(BOOL, beep_enable, beep_enable);
+show(BEEP_MASK, beep_mask, beep_mask);
+
+#define set(type, suffix, value, reg)					\
+static ssize_t set_##suffix(struct device *dev, const char *buf,	\
+	size_t count)							\
+{									\
+	struct i2c_client *client = to_i2c_client(dev);			\
+	struct gl518_data *data = i2c_get_clientdata(client);		\
+	data->value = type##_TO_REG(simple_strtol(buf, NULL, 10));	\
+	gl518_write_value(client, reg, data->value);			\
+	return count;							\
+}
+
+#define set_bits(type, suffix, value, reg, mask, shift)			\
+static ssize_t set_##suffix(struct device *dev, const char *buf,	\
+	size_t count)							\
+{									\
+	struct i2c_client *client = to_i2c_client(dev);			\
+	struct gl518_data *data = i2c_get_clientdata(client);		\
+	int regvalue = gl518_read_value(client, reg);			\
+	data->value = type##_TO_REG(simple_strtoul(buf, NULL, 10));	\
+	regvalue = (regvalue & ~mask) | (data->value << shift);		\
+	gl518_write_value(client, reg, regvalue);			\
+	return count;							\
+}
+
+#define set_low(type, suffix, value, reg)				\
+	set_bits(type, suffix, value, reg, 0x00ff, 0)
+#define set_high(type, suffix, value, reg)				\
+	set_bits(type, suffix, value, reg, 0xff00, 8)
+
+set(TEMP, temp_max1, temp_max, GL518_REG_TEMP_MAX);
+set(TEMP, temp_hyst1, temp_hyst, GL518_REG_TEMP_HYST);
+set_bits(BOOL, fan_auto1, fan_auto1, GL518_REG_MISC, 0x08, 3);
+set_bits(DIV, fan_div1, fan_div[0], GL518_REG_MISC, 0xc0, 6);
+set_bits(DIV, fan_div2, fan_div[1], GL518_REG_MISC, 0x30, 4);
+set_low(VDD, in_min0, voltage_min[0], GL518_REG_VDD_LIMIT);
+set_low(IN, in_min1, voltage_min[1], GL518_REG_VIN1_LIMIT);
+set_low(IN, in_min2, voltage_min[2], GL518_REG_VIN2_LIMIT);
+set_low(IN, in_min3, voltage_min[3], GL518_REG_VIN3_LIMIT);
+set_high(VDD, in_max0, voltage_max[0], GL518_REG_VDD_LIMIT);
+set_high(IN, in_max1, voltage_max[1], GL518_REG_VIN1_LIMIT);
+set_high(IN, in_max2, voltage_max[2], GL518_REG_VIN2_LIMIT);
+set_high(IN, in_max3, voltage_max[3], GL518_REG_VIN3_LIMIT);
+set_bits(BOOL, beep_enable, beep_enable, GL518_REG_CONF, 0x04, 2);
+set(BEEP_MASK, beep_mask, beep_mask, GL518_REG_ALARM);
+
+static ssize_t set_fan_min1(struct device *dev, const char *buf, size_t count)
+{
+	struct i2c_client *client = to_i2c_client(dev);
+	struct gl518_data *data = i2c_get_clientdata(client);
+	int regvalue = gl518_read_value(client, GL518_REG_FAN_LIMIT);
+
+	data->fan_min[0] = FAN_TO_REG(simple_strtoul(buf, NULL, 10),
+		DIV_FROM_REG(data->fan_div[0]));
+	regvalue = (regvalue & 0x00ff) | (data->fan_min[0] << 8);
+	gl518_write_value(client, GL518_REG_FAN_LIMIT, regvalue);
+
+	data->beep_mask = gl518_read_value(client, GL518_REG_ALARM);
+	if (data->fan_min[0] == 0)
+		data->alarm_mask &= ~0x20;
+	else
+		data->alarm_mask |= 0x20;
+	data->beep_mask &= data->alarm_mask;
+	gl518_write_value(client, GL518_REG_ALARM, data->beep_mask);
+
+	return count;
+}
+
+static ssize_t set_fan_min2(struct device *dev, const char *buf, size_t count)
+{
+	struct i2c_client *client = to_i2c_client(dev);
+	struct gl518_data *data = i2c_get_clientdata(client);
+	int regvalue = gl518_read_value(client, GL518_REG_FAN_LIMIT);
+
+	data->fan_min[1] = FAN_TO_REG(simple_strtoul(buf, NULL, 10),
+		DIV_FROM_REG(data->fan_div[1]));
+	regvalue = (regvalue & 0xff00) | data->fan_min[1];
+	gl518_write_value(client, GL518_REG_FAN_LIMIT, regvalue);
+
+	data->beep_mask = gl518_read_value(client, GL518_REG_ALARM);
+	if (data->fan_min[1] == 0)
+		data->alarm_mask &= ~0x40;
+	else
+		data->alarm_mask |= 0x40;
+	data->beep_mask &= data->alarm_mask;
+	gl518_write_value(client, GL518_REG_ALARM, data->beep_mask);
+
+	return count;
+}
+
+static DEVICE_ATTR(temp_input1, S_IRUGO, show_temp_input1, NULL);
+static DEVICE_ATTR(temp_max1, S_IWUSR|S_IRUGO, show_temp_max1, set_temp_max1);
+static DEVICE_ATTR(temp_hyst1, S_IWUSR|S_IRUGO,
+	show_temp_hyst1, set_temp_hyst1);
+static DEVICE_ATTR(fan_auto1, S_IWUSR|S_IRUGO, show_fan_auto1, set_fan_auto1);
+static DEVICE_ATTR(fan_input1, S_IRUGO, show_fan_input1, NULL);
+static DEVICE_ATTR(fan_input2, S_IRUGO, show_fan_input2, NULL);
+static DEVICE_ATTR(fan_min1, S_IWUSR|S_IRUGO, show_fan_min1, set_fan_min1);
+static DEVICE_ATTR(fan_min2, S_IWUSR|S_IRUGO, show_fan_min2, set_fan_min2);
+static DEVICE_ATTR(fan_div1, S_IWUSR|S_IRUGO, show_fan_div1, set_fan_div1);
+static DEVICE_ATTR(fan_div2, S_IWUSR|S_IRUGO, show_fan_div2, set_fan_div2);
+static DEVICE_ATTR(in_input0, S_IRUGO, show_in_input0, NULL);
+static DEVICE_ATTR(in_input1, S_IRUGO, show_in_input1, NULL);
+static DEVICE_ATTR(in_input2, S_IRUGO, show_in_input2, NULL);
+static DEVICE_ATTR(in_input3, S_IRUGO, show_in_input3, NULL);
+static DEVICE_ATTR(in_min0, S_IWUSR|S_IRUGO, show_in_min0, set_in_min0);
+static DEVICE_ATTR(in_min1, S_IWUSR|S_IRUGO, show_in_min1, set_in_min1);
+static DEVICE_ATTR(in_min2, S_IWUSR|S_IRUGO, show_in_min2, set_in_min2);
+static DEVICE_ATTR(in_min3, S_IWUSR|S_IRUGO, show_in_min3, set_in_min3);
+static DEVICE_ATTR(in_max0, S_IWUSR|S_IRUGO, show_in_max0, set_in_max0);
+static DEVICE_ATTR(in_max1, S_IWUSR|S_IRUGO, show_in_max1, set_in_max1);
+static DEVICE_ATTR(in_max2, S_IWUSR|S_IRUGO, show_in_max2, set_in_max2);
+static DEVICE_ATTR(in_max3, S_IWUSR|S_IRUGO, show_in_max3, set_in_max3);
+static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL);
+static DEVICE_ATTR(beep_enable, S_IWUSR|S_IRUGO,
+	show_beep_enable, set_beep_enable);
+static DEVICE_ATTR(beep_mask, S_IWUSR|S_IRUGO,
+	show_beep_mask, set_beep_mask);
+
+/*
+ * Real code
+ */
+
+static int gl518_attach_adapter(struct i2c_adapter *adapter)
+{
+	if (!(adapter->class & I2C_ADAP_CLASS_SMBUS))
+		return 0;
+	return i2c_detect(adapter, &addr_data, gl518_detect);
+}
+
+static int gl518_detect(struct i2c_adapter *adapter, int address, int kind)
+{
+	int i;
+	struct i2c_client *new_client;
+	struct gl518_data *data;
+	int err = 0;
+	const char *name = "";
+
+	if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA |
+				     I2C_FUNC_SMBUS_WORD_DATA))
+		goto exit;
+
+	/* 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 gl518_{read,write}_value. */
+
+	if (!(new_client = kmalloc(sizeof(struct i2c_client) +
+				   sizeof(struct gl518_data),
+				   GFP_KERNEL))) {
+		err = -ENOMEM;
+		goto exit;
+	}
+	memset(new_client, 0x00, sizeof(struct i2c_client) +
+		sizeof(struct gl518_data));
+
+	data = (struct gl518_data *) (new_client + 1);
+	i2c_set_clientdata(new_client, data);
+
+	new_client->addr = address;
+	new_client->adapter = adapter;
+	new_client->driver = &gl518_driver;
+	new_client->flags = 0;
+
+	/* Now, we do the remaining detection. */
+
+	if (kind < 0) {
+		if ((gl518_read_value(new_client, GL518_REG_CHIP_ID) != 0x80)
+		 || (gl518_read_value(new_client, GL518_REG_CONF) & 0x80))
+			goto exit_free;
+	}
+
+	/* Determine the chip type. */
+	if (kind <= 0) {
+		i = gl518_read_value(new_client, GL518_REG_REVISION);
+		if (i == 0x00) {
+			kind = gl518sm_r00;
+			name = "gl518sm";
+		} else if (i == 0x80) {
+			kind = gl518sm_r80;
+			name = "gl518sm";
+		} else {
+			if (kind <= 0)
+				dev_info(&adapter->dev,
+				    "Ignoring 'force' parameter for unknown "
+				    "chip at adapter %d, address 0x%02x\n",
+				    i2c_adapter_id(adapter), address);
+			goto exit_free;
+		}
+	}
+
+	/* Fill in the remaining client fields */
+	strlcpy(new_client->name, name, I2C_NAME_SIZE);
+	new_client->id = gl518_id++;
+	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 exit_free;
+
+	/* Initialize the GL518SM chip */
+	data->alarm_mask = 0xff;
+	data->voltage_in[0]=data->voltage_in[1]=data->voltage_in[2]=0;
+	gl518_init_client((struct i2c_client *) new_client);
+
+	/* Register sysfs hooks */
+	device_create_file(&new_client->dev, &dev_attr_in_input0);
+	device_create_file(&new_client->dev, &dev_attr_in_input1);
+	device_create_file(&new_client->dev, &dev_attr_in_input2);
+	device_create_file(&new_client->dev, &dev_attr_in_input3);
+	device_create_file(&new_client->dev, &dev_attr_in_min0);
+	device_create_file(&new_client->dev, &dev_attr_in_min1);
+	device_create_file(&new_client->dev, &dev_attr_in_min2);
+	device_create_file(&new_client->dev, &dev_attr_in_min3);
+	device_create_file(&new_client->dev, &dev_attr_in_max0);
+	device_create_file(&new_client->dev, &dev_attr_in_max1);
+	device_create_file(&new_client->dev, &dev_attr_in_max2);
+	device_create_file(&new_client->dev, &dev_attr_in_max3);
+	device_create_file(&new_client->dev, &dev_attr_fan_auto1);
+	device_create_file(&new_client->dev, &dev_attr_fan_input1);
+	device_create_file(&new_client->dev, &dev_attr_fan_input2);
+	device_create_file(&new_client->dev, &dev_attr_fan_min1);
+	device_create_file(&new_client->dev, &dev_attr_fan_min2);
+	device_create_file(&new_client->dev, &dev_attr_fan_div1);
+	device_create_file(&new_client->dev, &dev_attr_fan_div2);
+	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_alarms);
+	device_create_file(&new_client->dev, &dev_attr_beep_enable);
+	device_create_file(&new_client->dev, &dev_attr_beep_mask);
+
+	return 0;
+
+/* OK, this is not exactly good programming practice, usually. But it is
+   very code-efficient in this case. */
+
+exit_free:
+	kfree(new_client);
+exit:
+	return err;
+}
+
+
+/* Called when we have found a new GL518SM.
+   Note that we preserve D4:NoFan2 and D2:beep_enable. */
+static void gl518_init_client(struct i2c_client *client)
+{
+	/* Make sure we leave D7:Reset untouched */
+	u8 regvalue = gl518_read_value(client, GL518_REG_CONF) & 0x7f;
+
+	/* Comparator mode (D3=0), standby mode (D6=0) */
+	gl518_write_value(client, GL518_REG_CONF, (regvalue &= 0x37));
+
+	/* Never interrupts */
+	gl518_write_value(client, GL518_REG_MASK, 0x00);
+
+	/* Clear status register (D5=1), start (D6=1) */
+	gl518_write_value(client, GL518_REG_CONF, 0x20 | regvalue);
+	gl518_write_value(client, GL518_REG_CONF, 0x40 | regvalue);
+}
+
+static int gl518_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 inline u16 swap_bytes(u16 val)
+{
+	return (val >> 8) | (val << 8);
+}
+
+/* Registers 0x07 to 0x0c are word-sized, others are byte-sized 
+   GL518 uses a high-byte first convention, which is exactly opposite to
+   the usual practice. */
+static int gl518_read_value(struct i2c_client *client, u8 reg)
+{
+	if ((reg >= 0x07) && (reg <= 0x0c))
+		return swap_bytes(i2c_smbus_read_word_data(client, reg));
+	else
+		return i2c_smbus_read_byte_data(client, reg);
+}
+
+/* Registers 0x07 to 0x0c are word-sized, others are byte-sized 
+   GL518 uses a high-byte first convention, which is exactly opposite to
+   the usual practice. */
+static int gl518_write_value(struct i2c_client *client, u8 reg, u16 value)
+{
+	if ((reg >= 0x07) && (reg <= 0x0c))
+		return i2c_smbus_write_word_data(client, reg,
+						 swap_bytes(value));
+	else
+		return i2c_smbus_write_byte_data(client, reg, value);
+}
+
+static void gl518_update_client(struct i2c_client *client)
+{
+	struct gl518_data *data = i2c_get_clientdata(client);
+	int val;
+
+	down(&data->update_lock);
+
+	if ((jiffies - data->last_updated > HZ + HZ / 2) ||
+	    (jiffies < data->last_updated) || !data->valid) {
+		dev_dbg(&client->dev, "Starting gl518 update\n");
+
+		data->alarms = gl518_read_value(client, GL518_REG_INT);
+		data->beep_mask = gl518_read_value(client, GL518_REG_ALARM);
+
+		val = gl518_read_value(client, GL518_REG_VDD_LIMIT);
+		data->voltage_min[0] = val & 0xff;
+		data->voltage_max[0] = (val >> 8) & 0xff;
+		val = gl518_read_value(client, GL518_REG_VIN1_LIMIT);
+		data->voltage_min[1] = val & 0xff;
+		data->voltage_max[1] = (val >> 8) & 0xff;
+		val = gl518_read_value(client, GL518_REG_VIN2_LIMIT);
+		data->voltage_min[2] = val & 0xff;
+		data->voltage_max[2] = (val >> 8) & 0xff;
+		val = gl518_read_value(client, GL518_REG_VIN3_LIMIT);
+		data->voltage_min[3] = val & 0xff;
+		data->voltage_max[3] = (val >> 8) & 0xff;
+
+		val = gl518_read_value(client, GL518_REG_FAN_COUNT);
+		data->fan_in[0] = (val >> 8) & 0xff;
+		data->fan_in[1] = val & 0xff;
+
+		val = gl518_read_value(client, GL518_REG_FAN_LIMIT);
+		data->fan_min[0] = (val >> 8) & 0xff;
+		data->fan_min[1] = val & 0xff;
+
+		data->temp_in = gl518_read_value(client, GL518_REG_TEMP_IN);
+		data->temp_max =
+		    gl518_read_value(client, GL518_REG_TEMP_MAX);
+		data->temp_hyst =
+		    gl518_read_value(client, GL518_REG_TEMP_HYST);
+
+		val = gl518_read_value(client, GL518_REG_MISC);
+		data->fan_div[0] = (val >> 6) & 0x03;
+		data->fan_div[1] = (val >> 4) & 0x03;
+		data->fan_auto1  = (val >> 3) & 0x01;
+
+		data->alarms &= data->alarm_mask;
+
+		val = gl518_read_value(client, GL518_REG_CONF);
+		data->beep_enable = (val >> 2) & 1;
+
+		if (data->type != gl518sm_r00) {
+			data->voltage_in[0] =
+			    gl518_read_value(client, GL518_REG_VDD);
+			data->voltage_in[1] =
+			    gl518_read_value(client, GL518_REG_VIN1);
+			data->voltage_in[2] =
+			    gl518_read_value(client, GL518_REG_VIN2);
+		}
+		data->voltage_in[3] =
+		    gl518_read_value(client, GL518_REG_VIN3);
+
+		data->last_updated = jiffies;
+		data->valid = 1;
+	}
+
+	up(&data->update_lock);
+}
+
+static int __init sensors_gl518sm_init(void)
+{
+	return i2c_add_driver(&gl518_driver);
+}
+
+static void __exit sensors_gl518sm_exit(void)
+{
+	i2c_del_driver(&gl518_driver);
+}
+
+MODULE_AUTHOR("Frodo Looijaard <frodol@dds.nl>, "
+	"Kyosti Malkki <kmalkki@cc.hut.fi> and "
+	"Hong-Gunn Chew <hglinux@gunnet.org>");
+MODULE_DESCRIPTION("GL518SM driver");
+MODULE_LICENSE("GPL");
+
+module_init(sensors_gl518sm_init);
+module_exit(sensors_gl518sm_exit);
--- diff/drivers/input/serio/gscps2.c	1970-01-01 01:00:00.000000000 +0100
+++ source/drivers/input/serio/gscps2.c	2004-02-09 10:39:52.000000000 +0000
@@ -0,0 +1,470 @@
+/*
+ * drivers/input/serio/gscps2.c
+ *
+ * Copyright (c) 2004 Helge Deller <deller@gmx.de>
+ * Copyright (c) 2002 Laurent Canet <canetl@esiee.fr>
+ * Copyright (c) 2002 Thibaut Varene <varenet@esiee.fr>
+ *
+ * Pieces of code 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 GSC PS/2 port driver, 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.
+ * 
+ * TODO:
+ * - Dino testing (did HP ever shipped a machine on which this port
+ *                 was usable/enabled ?)
+ */
+
+#include <linux/config.h>
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/serio.h>
+#include <linux/input.h>
+#include <linux/interrupt.h>
+#include <linux/spinlock.h>
+#include <linux/delay.h>
+#include <linux/ioport.h>
+#include <linux/pci_ids.h>
+
+#include <asm/irq.h>
+#include <asm/io.h>
+#include <asm/parisc-device.h>
+
+MODULE_AUTHOR("Laurent Canet <canetl@esiee.fr>, Thibaut Varene <varenet@esiee.fr>, Helge Deller <deller@gmx.de>");
+MODULE_DESCRIPTION("HP GSC PS/2 port driver");
+MODULE_LICENSE("GPL");
+MODULE_DEVICE_TABLE(parisc, gscps2_device_tbl);
+
+#define PFX "gscps2.c: "
+
+/* 
+ * Driver constants
+ */
+
+/* various constants */
+#define ENABLE			1
+#define DISABLE			0
+
+#define GSC_DINO_OFFSET		0x0800	/* offset for DINO controller versus LASI one */
+
+/* PS/2 IO port offsets */
+#define GSC_ID			0x00	/* device ID offset (see: GSC_ID_XXX) */
+#define GSC_RESET		0x00	/* reset port offset */
+#define GSC_RCVDATA		0x04	/* receive port offset */
+#define GSC_XMTDATA		0x04	/* transmit port offset */
+#define GSC_CONTROL		0x08	/* see: Control register bits */
+#define GSC_STATUS		0x0C	/* see: Status register bits */
+
+/* Control register bits */
+#define GSC_CTRL_ENBL		0x01	/* enable interface */
+#define GSC_CTRL_LPBXR		0x02	/* loopback operation */
+#define GSC_CTRL_DIAG		0x20	/* directly control clock/data line */
+#define GSC_CTRL_DATDIR		0x40	/* data line direct control */
+#define GSC_CTRL_CLKDIR		0x80	/* clock line direct control */
+
+/* Status register bits */
+#define GSC_STAT_RBNE		0x01	/* Receive Buffer Not Empty */
+#define GSC_STAT_TBNE		0x02	/* Transmit Buffer Not Empty */
+#define GSC_STAT_TERR		0x04	/* Timeout Error */
+#define GSC_STAT_PERR		0x08	/* Parity Error */
+#define GSC_STAT_CMPINTR	0x10	/* Composite Interrupt = irq on any port */
+#define GSC_STAT_DATSHD		0x40	/* Data Line Shadow */
+#define GSC_STAT_CLKSHD		0x80	/* Clock Line Shadow */
+
+/* IDs returned by GSC_ID port register */
+#define GSC_ID_KEYBOARD		0	/* device ID values */
+#define GSC_ID_MOUSE		1
+
+
+static irqreturn_t gscps2_interrupt(int irq, void *dev, struct pt_regs *regs);
+
+#define BUFFER_SIZE 0x0f
+
+/* GSC PS/2 port device struct */
+struct gscps2port {
+	struct list_head node;
+	struct parisc_device *padev;
+	struct serio port;
+	spinlock_t lock;
+	char *addr;
+	u8 act, append; /* position in buffer[] */
+	struct {
+		u8 data;
+		u8 str;
+	} buffer[BUFFER_SIZE+1];
+	int id;
+	char name[32];
+};
+
+/*
+ * Various HW level routines
+ */
+
+#define gscps2_readb_input(x)		readb((x)+GSC_RCVDATA)
+#define gscps2_readb_control(x)		readb((x)+GSC_CONTROL)
+#define gscps2_readb_status(x)		readb((x)+GSC_STATUS)
+#define gscps2_writeb_control(x, y)	writeb((x), (y)+GSC_CONTROL)
+
+
+/*
+ * wait_TBE() - wait for Transmit Buffer Empty
+ */
+
+static int wait_TBE(char *addr)
+{
+	int timeout = 25000; /* device is expected to react within 250 msec */
+	while (gscps2_readb_status(addr) & GSC_STAT_TBNE) {
+		if (!--timeout)
+			return 0;	/* This should not happen */
+		udelay(10);
+	}
+	return 1;
+}
+
+
+/*
+ * gscps2_flush() - flush the receive buffer
+ */
+
+static void gscps2_flush(struct gscps2port *ps2port)
+{
+	while (gscps2_readb_status(ps2port->addr) & GSC_STAT_RBNE)
+		gscps2_readb_input(ps2port->addr);
+	ps2port->act = ps2port->append = 0;
+}
+
+/*
+ * gscps2_writeb_output() - write a byte to the port
+ *
+ * returns 1 on sucess, 0 on error
+ */
+
+static inline int gscps2_writeb_output(struct gscps2port *ps2port, u8 data)
+{
+	unsigned long flags;
+	char *addr = ps2port->addr;
+
+	if (!wait_TBE(addr)) {
+		printk(KERN_DEBUG PFX "timeout - could not write byte %#x\n", data);
+		return 0;
+	}
+
+	while (gscps2_readb_status(ps2port->addr) & GSC_STAT_RBNE)
+		/* wait */;
+
+	spin_lock_irqsave(&ps2port->lock, flags);
+	writeb(data, addr+GSC_XMTDATA);
+	spin_unlock_irqrestore(&ps2port->lock, flags);
+
+	/* this is ugly, but due to timing of the port it seems to be necessary. */
+	mdelay(6);
+
+	/* make sure any received data is returned as fast as possible */
+	/* this is important e.g. when we set the LEDs on the keyboard */
+	gscps2_interrupt(0, NULL, NULL);
+
+	return 1;
+}
+
+
+/*
+ * gscps2_enable() - enables or disables the port
+ */
+
+static void gscps2_enable(struct gscps2port *ps2port, int enable)
+{
+	unsigned long flags;
+	u8 data;
+
+	/* now enable/disable the port */
+	spin_lock_irqsave(&ps2port->lock, flags);
+	gscps2_flush(ps2port);
+	data = gscps2_readb_control(ps2port->addr);
+	if (enable)
+		data |= GSC_CTRL_ENBL;
+	else
+		data &= ~GSC_CTRL_ENBL;
+	gscps2_writeb_control(data, ps2port->addr);
+	spin_unlock_irqrestore(&ps2port->lock, flags);
+	wait_TBE(ps2port->addr);
+	gscps2_flush(ps2port);
+}
+
+/*
+ * gscps2_reset() - resets the PS/2 port
+ */
+
+static void gscps2_reset(struct gscps2port *ps2port)
+{
+	char *addr = ps2port->addr;
+	unsigned long flags;
+
+	/* reset the interface */
+	spin_lock_irqsave(&ps2port->lock, flags);
+	gscps2_flush(ps2port);
+	writeb(0xff, addr+GSC_RESET);
+	gscps2_flush(ps2port);
+	spin_unlock_irqrestore(&ps2port->lock, flags);
+
+	/* enable it */
+	gscps2_enable(ps2port, ENABLE);
+}
+
+static LIST_HEAD(ps2port_list);
+
+/**
+ * gscps2_interrupt() - Interruption service routine
+ *
+ * This function reads received PS/2 bytes and processes them on 
+ * all interfaces.
+ * The problematic part here is, that the keyboard and mouse PS/2 port
+ * share the same interrupt and it's not possible to send data if any
+ * one of them holds input data. To solve this problem we try to receive
+ * the data as fast as possible and handle the reporting to the upper layer
+ * later.
+ */
+
+static irqreturn_t gscps2_interrupt(int irq, void *dev, struct pt_regs *regs)
+{
+	struct gscps2port *ps2port;
+
+	list_for_each_entry(ps2port, &ps2port_list, node) {
+
+	  unsigned long flags;
+	  spin_lock_irqsave(&ps2port->lock, flags);
+
+	  while ( (ps2port->buffer[ps2port->append].str = 
+		   gscps2_readb_status(ps2port->addr)) & GSC_STAT_RBNE ) {
+		ps2port->buffer[ps2port->append].data = 
+				gscps2_readb_input(ps2port->addr);
+		ps2port->append = ((ps2port->append+1) & BUFFER_SIZE);
+	  }
+
+	  spin_unlock_irqrestore(&ps2port->lock, flags);
+
+	} /* list_for_each_entry */
+
+	/* all data was read from the ports - now report the data to upper layer */
+
+	list_for_each_entry(ps2port, &ps2port_list, node) {
+
+	  while (ps2port->act != ps2port->append) {
+
+	    unsigned int rxflags;
+	    u8 data, status;
+
+	    /* Did new data arrived while we read existing data ?
+	       If yes, exit now and let the new irq handler start over again */
+	    if (gscps2_readb_status(ps2port->addr) & GSC_STAT_CMPINTR)
+		return IRQ_HANDLED;
+
+	    status = ps2port->buffer[ps2port->act].str;
+	    data   = ps2port->buffer[ps2port->act].data;
+
+	    ps2port->act = ((ps2port->act+1) & BUFFER_SIZE);
+	    rxflags =	((status & GSC_STAT_TERR) ? SERIO_TIMEOUT : 0 ) |
+			((status & GSC_STAT_PERR) ? SERIO_PARITY  : 0 );
+
+	    serio_interrupt(&ps2port->port, data, rxflags, regs);
+
+	  } /* while() */
+
+	} /* list_for_each_entry */
+
+	return IRQ_HANDLED;
+}
+
+
+/*
+ * gscps2_write() - send a byte out through the aux interface.
+ */
+
+static int gscps2_write(struct serio *port, unsigned char data)
+{
+	struct gscps2port *ps2port = port->driver;
+
+	if (!gscps2_writeb_output(ps2port, data)) {
+		printk(KERN_DEBUG PFX "sending byte %#x failed.\n", data);
+		return -1;
+	}
+	return 0;
+}
+
+/*
+ * gscps2_open() is called when a port is opened by the higher layer.
+ * It resets and enables the port.
+ */
+
+static int gscps2_open(struct serio *port)
+{
+	struct gscps2port *ps2port = port->driver;
+
+	gscps2_reset(ps2port);
+
+	gscps2_interrupt(0, NULL, NULL);
+
+	return 0;
+}
+
+/*
+ * gscps2_close() disables the port
+ */
+
+static void gscps2_close(struct serio *port)
+{
+	struct gscps2port *ps2port = port->driver;
+	gscps2_enable(ps2port, DISABLE);
+}
+
+static struct serio gscps2_serio_port =
+{
+	.name =		"GSC PS/2",
+	.idbus =	BUS_GSC,
+	.idvendor =	PCI_VENDOR_ID_HP,
+	.idproduct =	0x0001,
+	.idversion =	0x0010,
+	.type =		SERIO_8042,
+	.write =	gscps2_write,
+	.open =		gscps2_open,
+	.close =	gscps2_close,
+};
+
+/**
+ * gscps2_probe() - Probes PS2 devices
+ * @return: success/error report
+ */
+
+static int __init gscps2_probe(struct parisc_device *dev)
+{
+        struct gscps2port *ps2port;
+	unsigned long hpa = dev->hpa;
+	int ret;
+
+	if (!dev->irq)
+		return -ENODEV;
+	
+	/* Offset for DINO PS/2. Works with LASI even */
+	if (dev->id.sversion == 0x96)
+		hpa += GSC_DINO_OFFSET;
+
+	ps2port = kmalloc(sizeof(struct gscps2port), GFP_KERNEL);
+	if (!ps2port)
+		return -ENOMEM;
+
+	dev_set_drvdata(&dev->dev, ps2port);
+
+	memset(ps2port, 0, sizeof(struct gscps2port));
+	ps2port->padev = dev;
+	ps2port->addr = ioremap(hpa, GSC_STATUS + 4);
+	spin_lock_init(&ps2port->lock);
+
+	gscps2_reset(ps2port);
+	ps2port->id = readb(ps2port->addr+GSC_ID) & 0x0f;
+	snprintf(ps2port->name, sizeof(ps2port->name)-1, "%s %s",
+		gscps2_serio_port.name, 
+		(ps2port->id == GSC_ID_KEYBOARD) ? "keyboard" : "mouse" );
+
+	memcpy(&ps2port->port, &gscps2_serio_port, sizeof(gscps2_serio_port));
+	ps2port->port.driver = ps2port;
+	ps2port->port.name = ps2port->name;
+	ps2port->port.phys = dev->dev.bus_id;
+
+	list_add_tail(&ps2port->node, &ps2port_list);
+
+	ret = -EBUSY;
+	if (request_irq(dev->irq, gscps2_interrupt, SA_SHIRQ, ps2port->name, ps2port))
+		goto fail_miserably;
+
+	if ( (ps2port->id != GSC_ID_KEYBOARD) && (ps2port->id != GSC_ID_MOUSE) ) {
+		printk(KERN_WARNING PFX "Unsupported PS/2 port at 0x%08lx (id=%d) ignored\n",
+				hpa, ps2port->id);
+		ret = -ENODEV;
+		goto fail;
+	}
+
+#if 0
+	if (!request_mem_region(hpa, GSC_STATUS + 4, ps2port->port.name))
+		goto fail;
+#endif
+
+	printk(KERN_INFO "serio: %s port at 0x%p irq %d @ %s\n",
+		ps2port->name,
+		ps2port->addr,
+		ps2port->padev->irq,
+		ps2port->port.phys);
+
+	serio_register_port(&ps2port->port);
+	
+	return 0;
+	
+fail:
+	free_irq(dev->irq, ps2port);
+
+fail_miserably:
+	list_del(&ps2port->node);
+	iounmap(ps2port->addr);
+	release_mem_region(dev->hpa, GSC_STATUS + 4);
+	kfree(ps2port);
+	return ret;
+}
+
+/**
+ * gscps2_remove() - Removes PS2 devices
+ * @return: success/error report
+ */
+
+static int __devexit gscps2_remove(struct parisc_device *dev)
+{
+	struct gscps2port *ps2port = dev_get_drvdata(&dev->dev);
+
+	serio_unregister_port(&ps2port->port);
+	free_irq(dev->irq, ps2port);
+	gscps2_flush(ps2port);
+	list_del(&ps2port->node);
+	iounmap(ps2port->addr);
+#if 0
+	release_mem_region(dev->hpa, GSC_STATUS + 4); 
+#endif
+	dev_set_drvdata(&dev->dev, NULL);
+	kfree(ps2port);
+	return 0;
+}
+
+
+static struct parisc_device_id gscps2_device_tbl[] = {
+	{ HPHW_FIO, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x00084 }, /* LASI PS/2 */
+#ifdef DINO_TESTED
+	{ HPHW_FIO, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x00096 }, /* DINO PS/2 */ 
+#endif
+	{ 0, }	/* 0 terminated list */
+};
+
+static struct parisc_driver parisc_ps2_driver = {
+	.name		= "GSC PS/2",
+	.id_table	= gscps2_device_tbl,
+	.probe		= gscps2_probe,
+	.remove		= gscps2_remove,
+};
+
+static int __init gscps2_init(void)
+{
+	register_parisc_driver(&parisc_ps2_driver);
+	return 0;
+}
+
+static void __exit gscps2_exit(void)
+{
+	unregister_parisc_driver(&parisc_ps2_driver);
+}
+
+
+module_init(gscps2_init);
+module_exit(gscps2_exit);
+
--- diff/drivers/macintosh/Kconfig	1970-01-01 01:00:00.000000000 +0100
+++ source/drivers/macintosh/Kconfig	2004-02-09 10:39:52.000000000 +0000
@@ -0,0 +1,148 @@
+
+menu "Macintosh device drivers"
+
+# we want to change this to something like CONFIG_SYSCTRL_CUDA/PMU
+config ADB_CUDA
+	bool "Support for CUDA based PowerMacs"
+	depends on PPC_PMAC && !POWER4
+	help
+	  This provides support for CUDA based Power Macintosh systems.  This
+	  includes most OldWorld PowerMacs, the first generation iMacs, the
+	  Blue&White G3 and the "Yikes" G4 (PCI Graphics).  All later models
+	  should use CONFIG_ADB_PMU instead.  It is safe to say Y here even if
+	  your machine doesn't have a CUDA.
+
+	  If unsure say Y.
+
+config ADB_PMU
+	bool "Support for PMU  based PowerMacs"
+	depends on PPC_PMAC
+	help
+	  On PowerBooks, iBooks, and recent iMacs and Power Macintoshes, the
+	  PMU is an embedded microprocessor whose primary function is to
+	  control system power, and battery charging on the portable models.
+	  The PMU also controls the ADB (Apple Desktop Bus) which connects to
+	  the keyboard and mouse on some machines, as well as the non-volatile
+	  RAM and the RTC (real time clock) chip.  Say Y to enable support for
+	  this device; you should do so if your machine is one of those
+	  mentioned above.
+
+config PMAC_PBOOK
+	bool "Power management support for PowerBooks"
+	depends on ADB_PMU
+	---help---
+	  This provides support for putting a PowerBook to sleep; it also
+	  enables media bay support.  Power management works on the
+	  PB2400/3400/3500, Wallstreet, Lombard, and Bronze PowerBook G3 and
+	  the Titanium Powerbook G4, as well as the iBooks.  You should get
+	  the power management daemon, pmud, to make it work and you must have
+	  the /dev/pmu device (see the pmud README).
+
+	  Get pmud from <ftp://ftp.samba.org/pub/ppclinux/pmud/>.
+
+	  If you have a PowerBook, you should say Y here.
+
+	  You may also want to compile the dma sound driver as a module and
+	  have it autoloaded. The act of removing the module shuts down the
+	  sound hardware for more power savings.
+
+config PM
+	bool
+	depends on PPC_PMAC && ADB_PMU && PMAC_PBOOK
+	default y
+
+config PMAC_APM_EMU
+	tristate "APM emulation"
+	depends on PMAC_PBOOK
+
+# made a separate option since backlight may end up beeing used
+# on non-powerbook machines (but only on PMU based ones AFAIK)
+config PMAC_BACKLIGHT
+	bool "Backlight control for LCD screens"
+	depends on ADB_PMU
+	help
+	  Say Y here to build in code to manage the LCD backlight on a
+	  Macintosh PowerBook.  With this code, the backlight will be turned
+	  on and off appropriately on power-management and lid-open/lid-closed
+	  events; also, the PowerBook button device will be enabled so you can
+	  change the screen brightness.
+
+config MAC_FLOPPY
+	bool "Support for PowerMac floppy"
+	depends on PPC_PMAC && !POWER4
+	help
+	  If you have a SWIM-3 (Super Woz Integrated Machine 3; from Apple)
+	  floppy controller, say Y here. Most commonly found in PowerMacs.
+
+config MAC_SERIAL
+	tristate "Support for PowerMac serial ports (OBSOLETE DRIVER)"
+	depends on PPC_PMAC
+	help
+	  This driver is obsolete. Use CONFIG_SERIAL_PMACZILOG in
+	  "Character devices --> Serial drivers --> PowerMac z85c30" option.
+
+config ADB
+	bool "Apple Desktop Bus (ADB) support"
+	depends on PPC_PMAC
+	help
+	  Apple Desktop Bus (ADB) support is for support of devices which
+	  are connected to an ADB port.  ADB devices tend to have 4 pins.
+	  If you have an Apple Macintosh prior to the iMac, an iBook or
+	  PowerBook, or a "Blue and White G3", you probably want to say Y
+	  here.  Otherwise say N.
+
+config ADB_MACIO
+	bool "Include MacIO (CHRP) ADB driver"
+	depends on ADB && !POWER4
+	help
+	  Say Y here to include direct support for the ADB controller in the
+	  Hydra chip used on PowerPC Macintoshes of the CHRP type.  (The Hydra
+	  also includes a MESH II SCSI controller, DBDMA controller, VIA chip,
+	  OpenPIC controller and two RS422/Geoports.)
+
+config INPUT_ADBHID
+	bool "Support for ADB input devices (keyboard, mice, ...)"
+	depends on ADB && INPUT=y
+	help
+	  Say Y here if you want to have ADB (Apple Desktop Bus) HID devices
+	  such as keyboards, mice, joysticks, trackpads  or graphic tablets
+	  handled by the input layer.  If you say Y here, make sure to say Y to
+	  the corresponding drivers "Keyboard support" (CONFIG_INPUT_KEYBDEV),
+	  "Mouse Support" (CONFIG_INPUT_MOUSEDEV) and "Event interface
+	  support" (CONFIG_INPUT_EVDEV) as well.
+
+	  If unsure, say Y.
+
+config MAC_EMUMOUSEBTN
+	bool "Support for mouse button 2+3 emulation"
+	depends on INPUT_ADBHID
+	help
+	  This provides generic support for emulating the 2nd and 3rd mouse
+	  button with keypresses.  If you say Y here, the emulation is still
+	  disabled by default.  The emulation is controlled by these sysctl
+	  entries:
+	  /proc/sys/dev/mac_hid/mouse_button_emulation
+	  /proc/sys/dev/mac_hid/mouse_button2_keycode
+	  /proc/sys/dev/mac_hid/mouse_button3_keycode
+
+	  If you have an Apple machine with a 1-button mouse, say Y here.
+
+config THERM_WINDTUNNEL
+	tristate "Support for thermal management on Windtunnel G4s"
+	depends on I2C && I2C_KEYWEST && !POWER4
+	help
+	  This driver provides some thermostat and fan control for the desktop
+	  G4 "Windtunnel"
+
+config THERM_PM72
+	tristate "Support for thermal management on PowerMac G5"
+	depends on I2C && I2C_KEYWEST && POWER4
+	help
+	  This driver provides thermostat and fan control for the desktop
+	  G5 machines. 
+
+config ANSLCD
+	bool "Support for ANS LCD display"
+	depends on ADB_CUDA
+
+endmenu
--- diff/drivers/macintosh/therm_pm72.c	1970-01-01 01:00:00.000000000 +0100
+++ source/drivers/macintosh/therm_pm72.c	2004-02-09 10:39:52.000000000 +0000
@@ -0,0 +1,1241 @@
+/*
+ * Device driver for the thermostats & fan controller of  the
+ * Apple G5 "PowerMac7,2" desktop machines.
+ *
+ * (c) Copyright IBM Corp. 2003
+ *
+ * Maintained by: Benjamin Herrenschmidt
+ *                <benh@kernel.crashing.org>
+ * 
+ *
+ * The algorithm used is the PID control algorithm, used the same
+ * way the published Darwin code does, using the same values that
+ * are present in the Darwin 7.0 snapshot property lists.
+ *
+ * As far as the CPUs control loops are concerned, I use the
+ * calibration & PID constants provided by the EEPROM,
+ * I do _not_ embed any value from the property lists, as the ones
+ * provided by Darwin 7.0 seem to always have an older version that
+ * what I've seen on the actual computers.
+ * It would be interesting to verify that though. Darwin has a
+ * version code of 1.0.0d11 for all control loops it seems, while
+ * so far, the machines EEPROMs contain a dataset versioned 1.0.0f
+ *
+ * Darwin doesn't provide source to all parts, some missing
+ * bits like the AppleFCU driver or the actual scale of some
+ * of the values returned by sensors had to be "guessed" some
+ * way... or based on what Open Firmware does.
+ *
+ * I didn't yet figure out how to get the slots power consumption
+ * out of the FCU, so that part has not been implemented yet and
+ * the slots fan is set to a fixed 50% PWM, hoping this value is
+ * safe enough ...
+ *
+ * Note: I have observed strange oscillations of the CPU control
+ * loop on a dual G5 here. When idle, the CPU exhaust fan tend to
+ * oscillates slowly (over several minutes) between the minimum
+ * of 300RPMs and approx. 1000 RPMs. I don't know what is causing
+ * this, it could be some incorrect constant or an error in the
+ * way I ported the algorithm, or it could be just normal. I
+ * don't have full understanding on the way Apple tweaked the PID
+ * algorithm for the CPU control, it is definitely not a standard
+ * implementation...
+ *
+ * TODO:  - Check MPU structure version/signature
+ *        - Add things like /sbin/overtemp for non-critical
+ *          overtemp conditions so userland can take some policy
+ *          decisions, like slewing down CPUs
+ *	  - Deal with fan failures
+ *
+ * History:
+ *
+ *  Nov. 13, 2003 : 0.5
+ *	- First release
+ *
+ *  Nov. 14, 2003 : 0.6
+ *	- Read fan speed from FCU, low level fan routines now deal
+ *	  with errors & check fan status, though higher level don't
+ *	  do much.
+ *	- Move a bunch of definitions to .h file
+ *
+ *  Nov. 18, 2003 : 0.7
+ *	- Fix build on ppc64 kernel
+ *	- Move back statics definitions to .c file
+ *	- Avoid calling schedule_timeout with a negative number
+ *
+ *  Dev. 18, 2003 : 0.8
+ *	- Fix typo when reading back fan speed on 2 CPU machines
+ *
+ */
+
+#include <linux/config.h>
+#include <linux/types.h>
+#include <linux/module.h>
+#include <linux/errno.h>
+#include <linux/kernel.h>
+#include <linux/delay.h>
+#include <linux/sched.h>
+#include <linux/i2c.h>
+#include <linux/slab.h>
+#include <linux/init.h>
+#include <linux/spinlock.h>
+#include <linux/smp_lock.h>
+#include <linux/wait.h>
+#include <linux/reboot.h>
+#include <linux/kmod.h>
+#include <linux/i2c.h>
+#include <linux/i2c-dev.h>
+#include <asm/prom.h>
+#include <asm/machdep.h>
+#include <asm/io.h>
+#include <asm/system.h>
+#include <asm/sections.h>
+#include <asm/of_device.h>
+
+#include "therm_pm72.h"
+
+#define VERSION "0.8"
+
+#undef DEBUG
+
+#ifdef DEBUG
+#define DBG(args...)	printk(args)
+#else
+#define DBG(args...)
+#endif
+
+
+/*
+ * Driver statics
+ */
+
+static struct of_device *		of_dev;
+static struct i2c_adapter *		u3_0;
+static struct i2c_adapter *		u3_1;
+static struct i2c_client *		fcu;
+static struct cpu_pid_state		cpu_state[2];
+static struct backside_pid_state	backside_state;
+static struct drives_pid_state		drives_state;
+static int				state;
+static int				cpu_count;
+static pid_t				ctrl_task;
+static struct completion		ctrl_complete;
+static int				critical_state;
+static DECLARE_MUTEX(driver_lock);
+
+/*
+ * i2c_driver structure to attach to the host i2c controller
+ */
+
+static int therm_pm72_attach(struct i2c_adapter *adapter);
+static int therm_pm72_detach(struct i2c_adapter *adapter);
+
+static struct i2c_driver therm_pm72_driver =
+{
+	.name		= "therm_pm72",
+	.id		= 0xDEADBEEF,
+	.flags		= I2C_DF_NOTIFY,
+	.attach_adapter	= therm_pm72_attach,
+	.detach_adapter	= therm_pm72_detach,
+};
+
+
+static inline void wait_ms(unsigned int ms)
+{
+	set_current_state(TASK_UNINTERRUPTIBLE);
+	schedule_timeout(1 + (ms * HZ + 999) / 1000);
+}
+
+/*
+ * Utility function to create an i2c_client structure and
+ * attach it to one of u3 adapters
+ */
+static struct i2c_client *attach_i2c_chip(int id, const char *name)
+{
+	struct i2c_client *clt;
+	struct i2c_adapter *adap;
+
+	if (id & 0x100)
+		adap = u3_1;
+	else
+		adap = u3_0;
+	if (adap == NULL)
+		return NULL;
+
+	clt = kmalloc(sizeof(struct i2c_client), GFP_KERNEL);
+	if (clt == NULL)
+		return NULL;
+	memset(clt, 0, sizeof(struct i2c_client));
+
+	clt->addr = (id >> 1) & 0x7f;
+	clt->adapter = adap;
+	clt->driver = &therm_pm72_driver;
+	clt->id = 0xDEADBEEF;
+	strncpy(clt->name, name, I2C_NAME_SIZE-1);
+
+	if (i2c_attach_client(clt)) {
+		printk(KERN_ERR "therm_pm72: Failed to attach to i2c ID 0x%x\n", id);
+		kfree(clt);
+		return NULL;
+	}
+	return clt;
+}
+
+/*
+ * Utility function to get rid of the i2c_client structure
+ * (will also detach from the adapter hopepfully)
+ */
+static void detach_i2c_chip(struct i2c_client *clt)
+{
+	i2c_detach_client(clt);
+	kfree(clt);
+}
+
+/*
+ * Here are the i2c chip access wrappers
+ */
+static int read_smon_adc(struct i2c_client *chip, int chan)
+{
+	int ctrl;
+
+	ctrl = i2c_smbus_read_byte_data(chip, 1);
+	i2c_smbus_write_byte_data(chip, 1, (ctrl & 0x1f) | (chan << 5));
+	wait_ms(1);
+	return le16_to_cpu(i2c_smbus_read_word_data(chip, 4)) >> 6;
+}
+
+static int fan_read_reg(int reg, unsigned char *buf, int nb)
+{
+	int tries, nr, nw;
+
+	buf[0] = reg;
+	tries = 0;
+	for (;;) {
+		nw = i2c_master_send(fcu, buf, 1);
+		if (nw > 0 || (nw < 0 && nw != -EIO) || tries >= 100)
+			break;
+		wait_ms(10);
+		++tries;
+	}
+	if (nw < 0) {
+		printk(KERN_ERR "Failure writing address to FCU: %d", nw);
+		return -EIO;
+	}
+	tries = 0;
+	for (;;) {
+		nr = i2c_master_recv(fcu, buf, nb);
+		if (nr > 0 || (nr < 0 && nr != ENODEV) || tries >= 100)
+			break;
+		wait_ms(10);
+		++tries;
+	}
+	if (nr < 0)
+		printk(KERN_ERR "Failure reading data from FCU: %d", nw);
+	return nr;
+}
+
+static int fan_write_reg(int reg, const unsigned char *ptr, int nb)
+{
+	int tries, nw;
+	unsigned char buf[16];
+
+	buf[0] = reg;
+	memcpy(buf+1, ptr, nb);
+	++nb;
+	tries = 0;
+	for (;;) {
+		nw = i2c_master_send(fcu, buf, nb);
+		if (nw > 0 || (nw < 0 && nw != EIO) || tries >= 100)
+			break;
+		wait_ms(10);
+		++tries;
+	}
+	if (nw < 0)
+		printk(KERN_ERR "Failure writing to FCU: %d", nw);
+	return nw;
+}
+
+static int set_rpm_fan(int fan, int rpm)
+{
+	unsigned char buf[2];
+	int rc;
+
+	if (rpm < 300)
+		rpm = 300;
+	else if (rpm > 8191)
+		rpm = 8191;
+	buf[0] = rpm >> 5;
+	buf[1] = rpm << 3;
+	rc = fan_write_reg(0x10 + (fan * 2), buf, 2);
+	if (rc < 0)
+		return -EIO;
+	return 0;
+}
+
+static int get_rpm_fan(int fan, int programmed)
+{
+	unsigned char failure;
+	unsigned char active;
+	unsigned char buf[2];
+	int rc, reg_base;
+
+	rc = fan_read_reg(0xb, &failure, 1);
+	if (rc != 1)
+		return -EIO;
+	if ((failure & (1 << fan)) != 0)
+		return -EFAULT;
+	rc = fan_read_reg(0xd, &active, 1);
+	if (rc != 1)
+		return -EIO;
+	if ((active & (1 << fan)) == 0)
+		return -ENXIO;
+
+	/* Programmed value or real current speed */
+	reg_base = programmed ? 0x10 : 0x11;
+	rc = fan_read_reg(reg_base + (fan * 2), buf, 2);
+	if (rc != 2)
+		return -EIO;
+
+	return (buf[0] << 5) | buf[1] >> 3;
+}
+
+static int set_pwm_fan(int fan, int pwm)
+{
+	unsigned char buf[2];
+	int rc;
+
+	if (pwm < 10)
+		pwm = 10;
+	else if (pwm > 100)
+		pwm = 100;
+	pwm = (pwm * 2559) / 1000;
+	buf[0] = pwm;
+	rc = fan_write_reg(0x30 + (fan * 2), buf, 1);
+	if (rc < 0)
+		return rc;
+	return 0;
+}
+
+static int get_pwm_fan(int fan)
+{
+	unsigned char failure;
+	unsigned char active;
+	unsigned char buf[2];
+	int rc;
+
+	rc = fan_read_reg(0x2b, &failure, 1);
+	if (rc != 1)
+		return -EIO;
+	if ((failure & (1 << fan)) != 0)
+		return -EFAULT;
+	rc = fan_read_reg(0x2d, &active, 1);
+	if (rc != 1)
+		return -EIO;
+	if ((active & (1 << fan)) == 0)
+		return -ENXIO;
+
+	/* Programmed value or real current speed */
+	rc = fan_read_reg(0x30 + (fan * 2), buf, 1);
+	if (rc != 1)
+		return -EIO;
+
+	return (buf[0] * 1000) / 2559;
+}
+
+/*
+ * Utility routine to read the CPU calibration EEPROM data
+ * from the device-tree
+ */
+static int read_eeprom(int cpu, struct mpu_data *out)
+{
+	struct device_node *np;
+	char nodename[64];
+	u8 *data;
+	int len;
+
+	/* prom.c routine for finding a node by path is a bit brain dead
+	 * and requires exact @xxx unit numbers. This is a bit ugly but
+	 * will work for these machines
+	 */
+	sprintf(nodename, "/u3@0,f8000000/i2c@f8001000/cpuid@a%d", cpu ? 2 : 0);
+	np = of_find_node_by_path(nodename);
+	if (np == NULL) {
+		printk(KERN_ERR "therm_pm72: Failed to retreive cpuid node from device-tree\n");
+		return -ENODEV;
+	}
+	data = (u8 *)get_property(np, "cpuid", &len);
+	if (data == NULL) {
+		printk(KERN_ERR "therm_pm72: Failed to retreive cpuid property from device-tree\n");
+		of_node_put(np);
+		return -ENODEV;
+	}
+	memcpy(out, data, sizeof(struct mpu_data));
+	of_node_put(np);
+	
+	return 0;
+}
+
+/* 
+ * Now, unfortunately, sysfs doesn't give us a nice void * we could
+ * pass around to the attribute functions, so we don't really have
+ * choice but implement a bunch of them...
+ *
+ * That sucks a bit, we take the lock because FIX32TOPRINT evaluates
+ * the input twice... I accept patches :)
+ */
+#define BUILD_SHOW_FUNC_FIX(name, data)				\
+static ssize_t show_##name(struct device *dev, char *buf)	\
+{								\
+	ssize_t r;						\
+	down(&driver_lock);					\
+	r = sprintf(buf, "%d.%03d", FIX32TOPRINT(data));	\
+	up(&driver_lock);					\
+	return r;						\
+}
+#define BUILD_SHOW_FUNC_INT(name, data)				\
+static ssize_t show_##name(struct device *dev, char *buf)	\
+{								\
+	return sprintf(buf, "%d", data);			\
+}
+
+BUILD_SHOW_FUNC_FIX(cpu0_temperature, cpu_state[0].last_temp)
+BUILD_SHOW_FUNC_FIX(cpu0_voltage, cpu_state[0].voltage)
+BUILD_SHOW_FUNC_FIX(cpu0_current, cpu_state[0].current_a)
+BUILD_SHOW_FUNC_INT(cpu0_exhaust_fan_rpm, cpu_state[0].rpm)
+BUILD_SHOW_FUNC_INT(cpu0_intake_fan_rpm, cpu_state[0].intake_rpm)
+
+BUILD_SHOW_FUNC_FIX(cpu1_temperature, cpu_state[1].last_temp)
+BUILD_SHOW_FUNC_FIX(cpu1_voltage, cpu_state[1].voltage)
+BUILD_SHOW_FUNC_FIX(cpu1_current, cpu_state[1].current_a)
+BUILD_SHOW_FUNC_INT(cpu1_exhaust_fan_rpm, cpu_state[1].rpm)
+BUILD_SHOW_FUNC_INT(cpu1_intake_fan_rpm, cpu_state[1].intake_rpm)
+
+BUILD_SHOW_FUNC_FIX(backside_temperature, backside_state.last_temp)
+BUILD_SHOW_FUNC_INT(backside_fan_pwm, backside_state.pwm)
+
+BUILD_SHOW_FUNC_FIX(drives_temperature, drives_state.last_temp)
+BUILD_SHOW_FUNC_INT(drives_fan_rpm, drives_state.rpm)
+
+static DEVICE_ATTR(cpu0_temperature,S_IRUGO,show_cpu0_temperature,NULL);
+static DEVICE_ATTR(cpu0_voltage,S_IRUGO,show_cpu0_voltage,NULL);
+static DEVICE_ATTR(cpu0_current,S_IRUGO,show_cpu0_current,NULL);
+static DEVICE_ATTR(cpu0_exhaust_fan_rpm,S_IRUGO,show_cpu0_exhaust_fan_rpm,NULL);
+static DEVICE_ATTR(cpu0_intake_fan_rpm,S_IRUGO,show_cpu0_intake_fan_rpm,NULL);
+
+static DEVICE_ATTR(cpu1_temperature,S_IRUGO,show_cpu1_temperature,NULL);
+static DEVICE_ATTR(cpu1_voltage,S_IRUGO,show_cpu1_voltage,NULL);
+static DEVICE_ATTR(cpu1_current,S_IRUGO,show_cpu1_current,NULL);
+static DEVICE_ATTR(cpu1_exhaust_fan_rpm,S_IRUGO,show_cpu1_exhaust_fan_rpm,NULL);
+static DEVICE_ATTR(cpu1_intake_fan_rpm,S_IRUGO,show_cpu1_intake_fan_rpm,NULL);
+
+static DEVICE_ATTR(backside_temperature,S_IRUGO,show_backside_temperature,NULL);
+static DEVICE_ATTR(backside_fan_pwm,S_IRUGO,show_backside_fan_pwm,NULL);
+
+static DEVICE_ATTR(drives_temperature,S_IRUGO,show_drives_temperature,NULL);
+static DEVICE_ATTR(drives_fan_rpm,S_IRUGO,show_drives_fan_rpm,NULL);
+
+/*
+ * CPUs fans control loop
+ */
+static void do_monitor_cpu(struct cpu_pid_state *state)
+{
+	s32 temp, voltage, current_a, power, power_target;
+	s32 integral, derivative, proportional, adj_in_target, sval;
+	s64 integ_p, deriv_p, prop_p, sum; 
+	int i, intake, rc;
+
+	DBG("cpu %d:\n", state->index);
+
+	/* Read current fan status */
+	if (state->index == 0)
+		rc = get_rpm_fan(CPUA_EXHAUST_FAN_RPM_ID, !RPM_PID_USE_ACTUAL_SPEED);
+	else
+		rc = get_rpm_fan(CPUB_EXHAUST_FAN_RPM_ID, !RPM_PID_USE_ACTUAL_SPEED);
+	if (rc < 0) {
+		printk(KERN_WARNING "Error %d reading CPU %d exhaust fan !\n",
+		       rc, state->index);
+		/* XXX What do we do now ? */
+	} else
+		state->rpm = rc;
+	DBG("  current rpm: %d\n", state->rpm);
+
+	/* Get some sensor readings and scale it */
+	temp = read_smon_adc(state->monitor, 1);
+	voltage = read_smon_adc(state->monitor, 3);
+	current_a = read_smon_adc(state->monitor, 4);
+
+	/* Fixup temperature according to diode calibration
+	 */
+	DBG("  temp raw: %04x, m_diode: %04x, b_diode: %04x\n",
+	    temp, state->mpu.mdiode, state->mpu.bdiode);
+	temp = (temp * state->mpu.mdiode + (state->mpu.bdiode << 12)) >> 2;
+	state->last_temp = temp;
+	DBG("  temp: %d.%03d\n", FIX32TOPRINT(temp));
+
+	/* Check tmax, increment overtemp if we are there. At tmax+8, we go
+	 * full blown immediately and try to trigger a shutdown
+	 */
+	if (temp >= ((state->mpu.tmax + 8) << 16)) {
+		printk(KERN_WARNING "Warning ! CPU %d temperature way above maximum !\n",
+		       state->index);
+		state->overtemp = CPU_MAX_OVERTEMP;
+	} else if (temp > (state->mpu.tmax << 16))
+		state->overtemp++;
+	else
+		state->overtemp = 0;
+	if (state->overtemp >= CPU_MAX_OVERTEMP)
+		critical_state = 1;
+	if (state->overtemp > 0) {
+		state->rpm = state->mpu.rmaxn_exhaust_fan;
+		state->intake_rpm = intake = state->mpu.rmaxn_intake_fan;
+		goto do_set_fans;
+	}
+	
+	/* Scale other sensor values according to fixed scales
+	 * obtained in Darwin and calculate power from I and V
+	 */
+	state->voltage = voltage *= ADC_CPU_VOLTAGE_SCALE;
+	state->current_a = current_a *= ADC_CPU_CURRENT_SCALE;
+	power = (((u64)current_a) * ((u64)voltage)) >> 16;
+
+	/* Calculate power target value (could be done once for all)
+	 * and convert to a 16.16 fp number
+	 */
+	power_target = ((u32)(state->mpu.pmaxh - state->mpu.padjmax)) << 16;
+
+	DBG("  current: %d.%03d, voltage: %d.%03d\n",
+	    FIX32TOPRINT(current_a), FIX32TOPRINT(voltage));
+	DBG("  power: %d.%03d W, target: %d.%03d, error: %d.%03d\n", FIX32TOPRINT(power),
+	    FIX32TOPRINT(power_target), FIX32TOPRINT(power_target - power));
+
+	/* Store temperature and power in history array */
+	state->cur_temp = (state->cur_temp + 1) % CPU_TEMP_HISTORY_SIZE;
+	state->temp_history[state->cur_temp] = temp;
+	state->cur_power = (state->cur_power + 1) % state->count_power;
+	state->power_history[state->cur_power] = power;
+	state->error_history[state->cur_power] = power_target - power;
+	
+	/* If first loop, fill the history table */
+	if (state->first) {
+		for (i = 0; i < (state->count_power - 1); i++) {
+			state->cur_power = (state->cur_power + 1) % state->count_power;
+			state->power_history[state->cur_power] = power;
+			state->error_history[state->cur_power] = power_target - power;
+		}
+		for (i = 0; i < (CPU_TEMP_HISTORY_SIZE - 1); i++) {
+			state->cur_temp = (state->cur_temp + 1) % CPU_TEMP_HISTORY_SIZE;
+			state->temp_history[state->cur_temp] = temp;			
+		}
+		state->first = 0;
+	}
+
+	/* Calculate the integral term normally based on the "power" values */
+	sum = 0;
+	integral = 0;
+	for (i = 0; i < state->count_power; i++)
+		integral += state->error_history[i];
+	integral *= CPU_PID_INTERVAL;
+	DBG("  integral: %08x\n", integral);
+
+	/* Calculate the adjusted input (sense value).
+	 *   G_r is 12.20
+	 *   integ is 16.16
+	 *   so the result is 28.36
+	 *
+	 * input target is mpu.ttarget, input max is mpu.tmax
+	 */
+	integ_p = ((s64)state->mpu.pid_gr) * (s64)integral;
+	DBG("   integ_p: %d\n", (int)(deriv_p >> 36));
+	sval = (state->mpu.tmax << 16) - ((integ_p >> 20) & 0xffffffff);
+	adj_in_target = (state->mpu.ttarget << 16);
+	if (adj_in_target > sval)
+		adj_in_target = sval;
+	DBG("   adj_in_target: %d.%03d, ttarget: %d\n", FIX32TOPRINT(adj_in_target),
+	    state->mpu.ttarget);
+
+	/* Calculate the derivative term */
+	derivative = state->temp_history[state->cur_temp] -
+		state->temp_history[(state->cur_temp + CPU_TEMP_HISTORY_SIZE - 1)
+				    % CPU_TEMP_HISTORY_SIZE];
+	derivative /= CPU_PID_INTERVAL;
+	deriv_p = ((s64)state->mpu.pid_gd) * (s64)derivative;
+	DBG("   deriv_p: %d\n", (int)(deriv_p >> 36));
+	sum += deriv_p;
+
+	/* Calculate the proportional term */
+	proportional = temp - adj_in_target;
+	prop_p = ((s64)state->mpu.pid_gp) * (s64)proportional;
+	DBG("   prop_p: %d\n", (int)(prop_p >> 36));
+	sum += prop_p;
+
+	/* Scale sum */
+	sum >>= 36;
+
+	DBG("   sum: %d\n", (int)sum);
+	state->rpm += (s32)sum;
+
+	if (state->rpm < state->mpu.rminn_exhaust_fan)
+		state->rpm = state->mpu.rminn_exhaust_fan;
+	if (state->rpm > state->mpu.rmaxn_exhaust_fan)
+		state->rpm = state->mpu.rmaxn_exhaust_fan;
+
+	intake = (state->rpm * CPU_INTAKE_SCALE) >> 16;
+	if (intake < state->mpu.rminn_intake_fan)
+		intake = state->mpu.rminn_intake_fan;
+	if (intake > state->mpu.rmaxn_intake_fan)
+		intake = state->mpu.rmaxn_intake_fan;
+	state->intake_rpm = intake;
+
+ do_set_fans:
+	DBG("** CPU %d RPM: %d Ex, %d In, overtemp: %d\n",
+	    state->index, (int)state->rpm, intake, state->overtemp);
+
+	/* We should check for errors, shouldn't we ? But then, what
+	 * do we do once the error occurs ? For FCU notified fan
+	 * failures (-EFAULT) we probably want to notify userland
+	 * some way...
+	 */
+	if (state->index == 0) {
+		set_rpm_fan(CPUA_INTAKE_FAN_RPM_ID, intake);
+		set_rpm_fan(CPUA_EXHAUST_FAN_RPM_ID, state->rpm);
+	} else {
+		set_rpm_fan(CPUB_INTAKE_FAN_RPM_ID, intake);
+		set_rpm_fan(CPUB_EXHAUST_FAN_RPM_ID, state->rpm);
+	}
+}
+
+/*
+ * Initialize the state structure for one CPU control loop
+ */
+static int init_cpu_state(struct cpu_pid_state *state, int index)
+{
+	state->index = index;
+	state->first = 1;
+	state->rpm = 1000;
+	state->overtemp = 0;
+
+	if (index == 0)
+		state->monitor = attach_i2c_chip(SUPPLY_MONITOR_ID, "CPU0_monitor");
+	else if (index == 1)
+		state->monitor = attach_i2c_chip(SUPPLY_MONITORB_ID, "CPU1_monitor");
+	if (state->monitor == NULL)
+		goto fail;
+
+	if (read_eeprom(index, &state->mpu))
+		goto fail;
+
+	state->count_power = state->mpu.tguardband;
+	if (state->count_power > CPU_POWER_HISTORY_SIZE) {
+		printk(KERN_WARNING "Warning ! too many power history slots\n");
+		state->count_power = CPU_POWER_HISTORY_SIZE;
+	}
+	DBG("CPU %d Using %d power history entries\n", index, state->count_power);
+
+	if (index == 0) {
+		device_create_file(&of_dev->dev, &dev_attr_cpu0_temperature);
+		device_create_file(&of_dev->dev, &dev_attr_cpu0_voltage);
+		device_create_file(&of_dev->dev, &dev_attr_cpu0_current);
+		device_create_file(&of_dev->dev, &dev_attr_cpu0_exhaust_fan_rpm);
+		device_create_file(&of_dev->dev, &dev_attr_cpu0_intake_fan_rpm);
+	} else {
+		device_create_file(&of_dev->dev, &dev_attr_cpu1_temperature);
+		device_create_file(&of_dev->dev, &dev_attr_cpu1_voltage);
+		device_create_file(&of_dev->dev, &dev_attr_cpu1_current);
+		device_create_file(&of_dev->dev, &dev_attr_cpu1_exhaust_fan_rpm);
+		device_create_file(&of_dev->dev, &dev_attr_cpu1_intake_fan_rpm);
+	}
+
+	return 0;
+ fail:
+	if (state->monitor)
+		detach_i2c_chip(state->monitor);
+	state->monitor = NULL;
+	
+	return -ENODEV;
+}
+
+/*
+ * Dispose of the state data for one CPU control loop
+ */
+static void dispose_cpu_state(struct cpu_pid_state *state)
+{
+	if (state->monitor == NULL)
+		return;
+
+	if (state->index == 0) {
+		device_remove_file(&of_dev->dev, &dev_attr_cpu0_temperature);
+		device_remove_file(&of_dev->dev, &dev_attr_cpu0_voltage);
+		device_remove_file(&of_dev->dev, &dev_attr_cpu0_current);
+		device_remove_file(&of_dev->dev, &dev_attr_cpu0_exhaust_fan_rpm);
+		device_remove_file(&of_dev->dev, &dev_attr_cpu0_intake_fan_rpm);
+	} else {
+		device_remove_file(&of_dev->dev, &dev_attr_cpu1_temperature);
+		device_remove_file(&of_dev->dev, &dev_attr_cpu1_voltage);
+		device_remove_file(&of_dev->dev, &dev_attr_cpu1_current);
+		device_remove_file(&of_dev->dev, &dev_attr_cpu1_exhaust_fan_rpm);
+		device_remove_file(&of_dev->dev, &dev_attr_cpu1_intake_fan_rpm);
+	}
+
+	detach_i2c_chip(state->monitor);
+	state->monitor = NULL;
+}
+
+/*
+ * Motherboard backside & U3 heatsink fan control loop
+ */
+static void do_monitor_backside(struct backside_pid_state *state)
+{
+	s32 temp, integral, derivative;
+	s64 integ_p, deriv_p, prop_p, sum; 
+	int i, rc;
+
+	if (--state->ticks != 0)
+		return;
+	state->ticks = BACKSIDE_PID_INTERVAL;
+
+	DBG("backside:\n");
+
+	/* Check fan status */
+	rc = get_pwm_fan(BACKSIDE_FAN_PWM_ID);
+	if (rc < 0) {
+		printk(KERN_WARNING "Error %d reading backside fan !\n", rc);
+		/* XXX What do we do now ? */
+	} else
+		state->pwm = rc;
+	DBG("  current pwm: %d\n", state->pwm);
+
+	/* Get some sensor readings */
+	temp = i2c_smbus_read_byte_data(state->monitor, MAX6690_EXT_TEMP) << 16;
+	state->last_temp = temp;
+	DBG("  temp: %d.%03d, target: %d.%03d\n", FIX32TOPRINT(temp),
+	    FIX32TOPRINT(BACKSIDE_PID_INPUT_TARGET));
+
+	/* Store temperature and error in history array */
+	state->cur_sample = (state->cur_sample + 1) % BACKSIDE_PID_HISTORY_SIZE;
+	state->sample_history[state->cur_sample] = temp;
+	state->error_history[state->cur_sample] = temp - BACKSIDE_PID_INPUT_TARGET;
+	
+	/* If first loop, fill the history table */
+	if (state->first) {
+		for (i = 0; i < (BACKSIDE_PID_HISTORY_SIZE - 1); i++) {
+			state->cur_sample = (state->cur_sample + 1) %
+				BACKSIDE_PID_HISTORY_SIZE;
+			state->sample_history[state->cur_sample] = temp;
+			state->error_history[state->cur_sample] =
+				temp - BACKSIDE_PID_INPUT_TARGET;
+		}
+		state->first = 0;
+	}
+
+	/* Calculate the integral term */
+	sum = 0;
+	integral = 0;
+	for (i = 0; i < BACKSIDE_PID_HISTORY_SIZE; i++)
+		integral += state->error_history[i];
+	integral *= BACKSIDE_PID_INTERVAL;
+	DBG("  integral: %08x\n", integral);
+	integ_p = ((s64)BACKSIDE_PID_G_r) * (s64)integral;
+	DBG("   integ_p: %d\n", (int)(integ_p >> 36));
+	sum += integ_p;
+
+	/* Calculate the derivative term */
+	derivative = state->error_history[state->cur_sample] -
+		state->error_history[(state->cur_sample + BACKSIDE_PID_HISTORY_SIZE - 1)
+				    % BACKSIDE_PID_HISTORY_SIZE];
+	derivative /= BACKSIDE_PID_INTERVAL;
+	deriv_p = ((s64)BACKSIDE_PID_G_d) * (s64)derivative;
+	DBG("   deriv_p: %d\n", (int)(deriv_p >> 36));
+	sum += deriv_p;
+
+	/* Calculate the proportional term */
+	prop_p = ((s64)BACKSIDE_PID_G_p) * (s64)(state->error_history[state->cur_sample]);
+	DBG("   prop_p: %d\n", (int)(prop_p >> 36));
+	sum += prop_p;
+
+	/* Scale sum */
+	sum >>= 36;
+
+	DBG("   sum: %d\n", (int)sum);
+	state->pwm += (s32)sum;
+	if (state->pwm < BACKSIDE_PID_OUTPUT_MIN)
+		state->pwm = BACKSIDE_PID_OUTPUT_MIN;
+	if (state->pwm > BACKSIDE_PID_OUTPUT_MAX)
+		state->pwm = BACKSIDE_PID_OUTPUT_MAX;
+
+	DBG("** BACKSIDE PWM: %d\n", (int)state->pwm);
+	set_pwm_fan(BACKSIDE_FAN_PWM_ID, state->pwm);
+}
+
+/*
+ * Initialize the state structure for the backside fan control loop
+ */
+static int init_backside_state(struct backside_pid_state *state)
+{
+	state->ticks = 1;
+	state->first = 1;
+	state->pwm = 50;
+
+	state->monitor = attach_i2c_chip(BACKSIDE_MAX_ID, "backside_temp");
+	if (state->monitor == NULL)
+		return -ENODEV;
+
+	device_create_file(&of_dev->dev, &dev_attr_backside_temperature);
+	device_create_file(&of_dev->dev, &dev_attr_backside_fan_pwm);
+
+	return 0;
+}
+
+/*
+ * Dispose of the state data for the backside control loop
+ */
+static void dispose_backside_state(struct backside_pid_state *state)
+{
+	if (state->monitor == NULL)
+		return;
+
+	device_remove_file(&of_dev->dev, &dev_attr_backside_temperature);
+	device_remove_file(&of_dev->dev, &dev_attr_backside_fan_pwm);
+
+	detach_i2c_chip(state->monitor);
+	state->monitor = NULL;
+}
+ 
+/*
+ * Drives bay fan control loop
+ */
+static void do_monitor_drives(struct drives_pid_state *state)
+{
+	s32 temp, integral, derivative;
+	s64 integ_p, deriv_p, prop_p, sum; 
+	int i, rc;
+
+	if (--state->ticks != 0)
+		return;
+	state->ticks = DRIVES_PID_INTERVAL;
+
+	DBG("drives:\n");
+
+	/* Check fan status */
+	rc = get_rpm_fan(DRIVES_FAN_RPM_ID, !RPM_PID_USE_ACTUAL_SPEED);
+	if (rc < 0) {
+		printk(KERN_WARNING "Error %d reading drives fan !\n", rc);
+		/* XXX What do we do now ? */
+	} else
+		state->rpm = rc;
+	DBG("  current rpm: %d\n", state->rpm);
+
+	/* Get some sensor readings */
+	temp = le16_to_cpu(i2c_smbus_read_word_data(state->monitor, DS1775_TEMP)) << 8;
+	state->last_temp = temp;
+	DBG("  temp: %d.%03d, target: %d.%03d\n", FIX32TOPRINT(temp),
+	    FIX32TOPRINT(DRIVES_PID_INPUT_TARGET));
+
+	/* Store temperature and error in history array */
+	state->cur_sample = (state->cur_sample + 1) % DRIVES_PID_HISTORY_SIZE;
+	state->sample_history[state->cur_sample] = temp;
+	state->error_history[state->cur_sample] = temp - DRIVES_PID_INPUT_TARGET;
+	
+	/* If first loop, fill the history table */
+	if (state->first) {
+		for (i = 0; i < (DRIVES_PID_HISTORY_SIZE - 1); i++) {
+			state->cur_sample = (state->cur_sample + 1) %
+				DRIVES_PID_HISTORY_SIZE;
+			state->sample_history[state->cur_sample] = temp;
+			state->error_history[state->cur_sample] =
+				temp - DRIVES_PID_INPUT_TARGET;
+		}
+		state->first = 0;
+	}
+
+	/* Calculate the integral term */
+	sum = 0;
+	integral = 0;
+	for (i = 0; i < DRIVES_PID_HISTORY_SIZE; i++)
+		integral += state->error_history[i];
+	integral *= DRIVES_PID_INTERVAL;
+	DBG("  integral: %08x\n", integral);
+	integ_p = ((s64)DRIVES_PID_G_r) * (s64)integral;
+	DBG("   integ_p: %d\n", (int)(integ_p >> 36));
+	sum += integ_p;
+
+	/* Calculate the derivative term */
+	derivative = state->error_history[state->cur_sample] -
+		state->error_history[(state->cur_sample + DRIVES_PID_HISTORY_SIZE - 1)
+				    % DRIVES_PID_HISTORY_SIZE];
+	derivative /= DRIVES_PID_INTERVAL;
+	deriv_p = ((s64)DRIVES_PID_G_d) * (s64)derivative;
+	DBG("   deriv_p: %d\n", (int)(deriv_p >> 36));
+	sum += deriv_p;
+
+	/* Calculate the proportional term */
+	prop_p = ((s64)DRIVES_PID_G_p) * (s64)(state->error_history[state->cur_sample]);
+	DBG("   prop_p: %d\n", (int)(prop_p >> 36));
+	sum += prop_p;
+
+	/* Scale sum */
+	sum >>= 36;
+
+	DBG("   sum: %d\n", (int)sum);
+	state->rpm += (s32)sum;
+	if (state->rpm < DRIVES_PID_OUTPUT_MIN)
+		state->rpm = DRIVES_PID_OUTPUT_MIN;
+	if (state->rpm > DRIVES_PID_OUTPUT_MAX)
+		state->rpm = DRIVES_PID_OUTPUT_MAX;
+
+	DBG("** DRIVES RPM: %d\n", (int)state->rpm);
+	set_rpm_fan(DRIVES_FAN_RPM_ID, state->rpm);
+}
+
+/*
+ * Initialize the state structure for the drives bay fan control loop
+ */
+static int init_drives_state(struct drives_pid_state *state)
+{
+	state->ticks = 1;
+	state->first = 1;
+	state->rpm = 1000;
+
+	state->monitor = attach_i2c_chip(DRIVES_DALLAS_ID, "drives_temp");
+	if (state->monitor == NULL)
+		return -ENODEV;
+
+	device_create_file(&of_dev->dev, &dev_attr_drives_temperature);
+	device_create_file(&of_dev->dev, &dev_attr_drives_fan_rpm);
+
+	return 0;
+}
+
+/*
+ * Dispose of the state data for the drives control loop
+ */
+static void dispose_drives_state(struct drives_pid_state *state)
+{
+	if (state->monitor == NULL)
+		return;
+
+	device_remove_file(&of_dev->dev, &dev_attr_drives_temperature);
+	device_remove_file(&of_dev->dev, &dev_attr_drives_fan_rpm);
+
+	detach_i2c_chip(state->monitor);
+	state->monitor = NULL;
+}
+
+static int call_critical_overtemp(void)
+{
+	char *argv[] = { critical_overtemp_path, NULL };
+	static char *envp[] = { "HOME=/",
+				"TERM=linux",
+				"PATH=/sbin:/usr/sbin:/bin:/usr/bin",
+				NULL };
+
+	return call_usermodehelper(critical_overtemp_path, argv, envp, 0);
+}
+
+
+/*
+ * Here's the kernel thread that calls the various control loops
+ */
+static int main_control_loop(void *x)
+{
+	daemonize("kfand");
+
+	DBG("main_control_loop started\n");
+
+	/* Set the PCI fan once for now */
+	set_pwm_fan(SLOTS_FAN_PWM_ID, SLOTS_FAN_DEFAULT_PWM);
+
+	while (state == state_attached) {
+		unsigned long elapsed, start;
+
+		start = jiffies;
+
+		down(&driver_lock);
+		do_monitor_cpu(&cpu_state[0]);
+		if (cpu_state[1].monitor != NULL)
+			do_monitor_cpu(&cpu_state[1]);
+		do_monitor_backside(&backside_state);
+		do_monitor_drives(&drives_state);
+		up(&driver_lock);
+
+		if (critical_state == 1) {
+			printk(KERN_WARNING "Temperature control detected a critical condition\n");
+			printk(KERN_WARNING "Attempting to shut down...\n");
+			if (call_critical_overtemp()) {
+				printk(KERN_WARNING "Can't call %s, power off now!\n",
+				       critical_overtemp_path);
+				machine_power_off();
+			}
+		}
+		if (critical_state > 0)
+			critical_state++;
+		if (critical_state > MAX_CRITICAL_STATE) {
+			printk(KERN_WARNING "Shutdown timed out, power off now !\n");
+			machine_power_off();
+		}
+
+		// FIXME: Deal with signals
+		set_current_state(TASK_INTERRUPTIBLE);
+		elapsed = jiffies - start;
+		if (elapsed < HZ)
+			schedule_timeout(HZ - elapsed);
+	}
+
+	DBG("main_control_loop ended\n");
+
+	ctrl_task = 0;
+	complete_and_exit(&ctrl_complete, 0);
+}
+
+/*
+ * Dispose the control loops when tearing down
+ */
+static void dispose_control_loops(void)
+{
+	dispose_cpu_state(&cpu_state[0]);
+	dispose_cpu_state(&cpu_state[1]);
+
+	dispose_backside_state(&backside_state);
+	dispose_drives_state(&drives_state);
+}
+
+/*
+ * Create the control loops. U3-0 i2c bus is up, so we can now
+ * get to the various sensors
+ */
+static int create_control_loops(void)
+{
+	struct device_node *np;
+
+	/* Count CPUs from the device-tree, we don't care how many are
+	 * actually used by Linux
+	 */
+	cpu_count = 0;
+	for (np = NULL; NULL != (np = of_find_node_by_type(np, "cpu"));)
+		cpu_count++;
+
+	DBG("counted %d CPUs in the device-tree\n", cpu_count);
+
+	/* Create control loops for everything. If any fail, everything
+	 * fails
+	 */
+	if (init_cpu_state(&cpu_state[0], 0))
+		goto fail;
+	if (cpu_count > 1 && init_cpu_state(&cpu_state[1], 1))
+		goto fail;
+	if (init_backside_state(&backside_state))
+		goto fail;
+	if (init_drives_state(&drives_state))
+		goto fail;
+
+	DBG("all control loops up !\n");
+
+	return 0;
+	
+ fail:
+	DBG("failure creating control loops, disposing\n");
+
+	dispose_control_loops();
+
+	return -ENODEV;
+}
+
+/*
+ * Start the control loops after everything is up, that is create
+ * the thread that will make them run
+ */
+static void start_control_loops(void)
+{
+	init_completion(&ctrl_complete);
+
+	ctrl_task = kernel_thread(main_control_loop, NULL, SIGCHLD | CLONE_KERNEL);
+}
+
+/*
+ * Stop the control loops when tearing down
+ */
+static void stop_control_loops(void)
+{
+	if (ctrl_task != 0)
+		wait_for_completion(&ctrl_complete);
+}
+
+/*
+ * Attach to the i2c FCU after detecting U3-1 bus
+ */
+static int attach_fcu(void)
+{
+	fcu = attach_i2c_chip(FAN_CTRLER_ID, "fcu");
+	if (fcu == NULL)
+		return -ENODEV;
+
+	DBG("FCU attached\n");
+
+	return 0;
+}
+
+/*
+ * Detach from the i2c FCU when tearing down
+ */
+static void detach_fcu(void)
+{
+	if (fcu)
+		detach_i2c_chip(fcu);
+	fcu = NULL;
+}
+
+/*
+ * Attach to the i2c controller. We probe the various chips based
+ * on the device-tree nodes and build everything for the driver to
+ * run, we then kick the driver monitoring thread
+ */
+static int therm_pm72_attach(struct i2c_adapter *adapter)
+{
+	down(&driver_lock);
+
+	/* Check state */
+	if (state == state_detached)
+		state = state_attaching;
+	if (state != state_attaching) {
+		up(&driver_lock);
+		return 0;
+	}
+
+	/* Check if we are looking for one of these */
+	if (u3_0 == NULL && !strcmp(adapter->name, "u3 0")) {
+		u3_0 = adapter;
+		DBG("found U3-0, creating control loops\n");
+		if (create_control_loops())
+			u3_0 = NULL;
+	} else if (u3_1 == NULL && !strcmp(adapter->name, "u3 1")) {
+		u3_1 = adapter;
+		DBG("found U3-1, attaching FCU\n");
+		if (attach_fcu())
+			u3_1 = NULL;
+	}
+	/* We got all we need, start control loops */
+	if (u3_0 != NULL && u3_1 != NULL) {
+		DBG("everything up, starting control loops\n");
+		state = state_attached;
+		start_control_loops();
+	}
+	up(&driver_lock);
+
+	return 0;
+}
+
+/*
+ * Called on every adapter when the driver or the i2c controller
+ * is going away.
+ */
+static int therm_pm72_detach(struct i2c_adapter *adapter)
+{
+	down(&driver_lock);
+
+	if (state != state_detached)
+		state = state_detaching;
+
+	/* Stop control loops if any */
+	DBG("stopping control loops\n");
+	up(&driver_lock);
+	stop_control_loops();
+	down(&driver_lock);
+
+	if (u3_0 != NULL && !strcmp(adapter->name, "u3 0")) {
+		DBG("lost U3-0, disposing control loops\n");
+		dispose_control_loops();
+		u3_0 = NULL;
+	}
+	
+	if (u3_1 != NULL && !strcmp(adapter->name, "u3 1")) {
+		DBG("lost U3-1, detaching FCU\n");
+		detach_fcu();
+		u3_1 = NULL;
+	}
+	if (u3_0 == NULL && u3_1 == NULL)
+		state = state_detached;
+
+	up(&driver_lock);
+
+	return 0;
+}
+
+static int fcu_of_probe(struct of_device* dev, const struct of_match *match)
+{
+	int rc;
+
+	state = state_detached;
+
+	rc = i2c_add_driver(&therm_pm72_driver);
+	if (rc < 0)
+		return rc;
+	return 0;
+}
+
+static int fcu_of_remove(struct of_device* dev)
+{
+	i2c_del_driver(&therm_pm72_driver);
+
+	return 0;
+}
+
+static struct of_match fcu_of_match[] = 
+{
+	{
+	.name 		= OF_ANY_MATCH,
+	.type		= "fcu",
+	.compatible	= OF_ANY_MATCH
+	},
+	{},
+};
+
+static struct of_platform_driver fcu_of_platform_driver = 
+{
+	.name 		= "temperature",
+	.match_table	= fcu_of_match,
+	.probe		= fcu_of_probe,
+	.remove		= fcu_of_remove
+};
+
+/*
+ * Check machine type, attach to i2c controller
+ */
+static int __init therm_pm72_init(void)
+{
+	struct device_node *np;
+
+	if (!machine_is_compatible("PowerMac7,2"))
+	    	return -ENODEV;
+
+	printk(KERN_INFO "PowerMac G5 Thermal control driver %s\n", VERSION);
+
+	np = of_find_node_by_type(NULL, "fcu");
+	if (np == NULL) {
+		printk(KERN_ERR "Can't find FCU in device-tree !\n");
+		return -ENODEV;
+	}
+	of_dev = of_platform_device_create(np, "temperature");
+	if (of_dev == NULL) {
+		printk(KERN_ERR "Can't register FCU platform device !\n");
+		return -ENODEV;
+	}
+
+	of_register_driver(&fcu_of_platform_driver);
+	
+	return 0;
+}
+
+static void __exit therm_pm72_exit(void)
+{
+	of_unregister_driver(&fcu_of_platform_driver);
+
+	if (of_dev)
+		of_device_unregister(of_dev);
+}
+
+module_init(therm_pm72_init);
+module_exit(therm_pm72_exit);
+
+MODULE_AUTHOR("Benjamin Herrenschmidt <benh@kernel.crashing.org>");
+MODULE_DESCRIPTION("Driver for Apple's PowerMac7,2 G5 thermal control");
+MODULE_LICENSE("GPL");
+
--- diff/drivers/macintosh/therm_pm72.h	1970-01-01 01:00:00.000000000 +0100
+++ source/drivers/macintosh/therm_pm72.h	2004-02-09 10:39:52.000000000 +0000
@@ -0,0 +1,236 @@
+#ifndef __THERM_PMAC_7_2_H__
+#define __THERM_PMAC_7_2_H__
+
+typedef unsigned short fu16;
+typedef int fs32;
+typedef short fs16;
+
+struct mpu_data
+{
+	u8	signature;		/* 0x00 - EEPROM sig. */
+	u8	bytes_used;		/* 0x01 - Bytes used in eeprom (160 ?) */
+	u8	size;			/* 0x02 - EEPROM size (256 ?) */
+	u8	version;		/* 0x03 - EEPROM version */
+	u32	data_revision;		/* 0x04 - Dataset revision */
+	u8	processor_bin_code[3];	/* 0x08 - Processor BIN code */
+	u8	bin_code_expansion;	/* 0x0b - ??? (padding ?) */
+	u8	processor_num;		/* 0x0c - Number of CPUs on this MPU */
+	u8	input_mul_bus_div;	/* 0x0d - Clock input multiplier/bus divider */
+	u8	reserved1[2];		/* 0x0e - */
+	u32	input_clk_freq_high;	/* 0x10 - Input clock frequency high */
+	u8	cpu_nb_target_cycles;	/* 0x14 - ??? */
+	u8	cpu_statlat;		/* 0x15 - ??? */
+	u8	cpu_snooplat;		/* 0x16 - ??? */
+	u8	cpu_snoopacc;		/* 0x17 - ??? */
+	u8	nb_paamwin;		/* 0x18 - ??? */
+	u8	nb_statlat;		/* 0x19 - ??? */
+	u8	nb_snooplat;		/* 0x1a - ??? */
+	u8	nb_snoopwin;		/* 0x1b - ??? */
+	u8	api_bus_mode;		/* 0x1c - ??? */
+	u8	reserved2[3];		/* 0x1d - */
+	u32	input_clk_freq_low;	/* 0x20 - Input clock frequency low */
+	u8	processor_card_slot;	/* 0x24 - Processor card slot number */
+	u8	reserved3[2];		/* 0x25 - */
+	u8	padjmax;       		/* 0x27 - Max power adjustment (Not in OF!) */
+	u8	ttarget;		/* 0x28 - Target temperature */
+	u8	tmax;			/* 0x29 - Max temperature */
+	u8	pmaxh;			/* 0x2a - Max power */
+	u8	tguardband;		/* 0x2b - Guardband temp ??? Hist. len in OSX */
+	fs32	pid_gp;			/* 0x2c - PID proportional gain */
+	fs32	pid_gr;			/* 0x30 - PID reset gain */
+	fs32	pid_gd;			/* 0x34 - PID derivative gain */
+	fu16	voph;			/* 0x38 - Vop High */
+	fu16	vopl;			/* 0x3a - Vop Low */
+	fs16	nactual_die;		/* 0x3c - nActual Die */
+	fs16	nactual_heatsink;	/* 0x3e - nActual Heatsink */
+	fs16	nactual_system;		/* 0x40 - nActual System */
+	u16	calibration_flags;	/* 0x42 - Calibration flags */
+	fu16	mdiode;			/* 0x44 - Diode M value (scaling factor) */
+	fs16	bdiode;			/* 0x46 - Diode B value (offset) */
+	fs32	theta_heat_sink;	/* 0x48 - Theta heat sink */
+	u16	rminn_intake_fan;	/* 0x4c - Intake fan min RPM */
+	u16	rmaxn_intake_fan;	/* 0x4e - Intake fan max RPM */
+	u16	rminn_exhaust_fan;	/* 0x50 - Exhaust fan min RPM */
+	u16	rmaxn_exhaust_fan;	/* 0x52 - Exhaust fan max RPM */
+	u8	processor_part_num[8];	/* 0x54 - Processor part number */
+	u32	processor_lot_num;	/* 0x5c - Processor lot number */
+	u8	orig_card_sernum[0x10];	/* 0x60 - Card original serial number */
+	u8	curr_card_sernum[0x10];	/* 0x70 - Card current serial number */
+	u8	mlb_sernum[0x18];	/* 0x80 - MLB serial number */
+	u32	checksum1;		/* 0x98 - */
+	u32	checksum2;		/* 0x9c - */	
+}; /* Total size = 0xa0 */
+
+/* Display a 16.16 fixed point value */
+#define FIX32TOPRINT(f)	((f) >> 16),((((f) & 0xffff) * 1000) >> 16)
+
+/*
+ * Maximum number of seconds to be in critical state (after a
+ * normal shutdown attempt). If the machine isn't down after
+ * this counter elapses, we force an immediate machine power
+ * off.
+ */
+#define MAX_CRITICAL_STATE			30
+static char * critical_overtemp_path = "/sbin/critical_overtemp";
+
+/*
+ * This option is "weird" :) Basically, if you define this to 1
+ * the control loop for the RPMs fans (not PWMs) will apply the
+ * correction factor obtained from the PID to the _actual_ RPM
+ * speed read from the FCU.
+ * If you define the below constant to 0, then it will be
+ * applied to the setpoint RPM speed, that is basically the
+ * speed we proviously "asked" for.
+ *
+ * I'm not sure which of these Apple's algorithm is supposed
+ * to use
+ */
+#define RPM_PID_USE_ACTUAL_SPEED		1
+
+/*
+ * i2c IDs. Currently, we hard code those and assume that
+ * the FCU is on U3 bus 1 while all sensors are on U3 bus
+ * 0. This appear to be safe enough for this first version
+ * of the driver, though I would accept any clean patch
+ * doing a better use of the device-tree without turning the
+ * while i2c registration mecanism into a racy mess
+ */
+#define FAN_CTRLER_ID		0x15e
+#define SUPPLY_MONITOR_ID      	0x58
+#define SUPPLY_MONITORB_ID     	0x5a
+#define DRIVES_DALLAS_ID	0x94
+#define BACKSIDE_MAX_ID		0x98
+
+/*
+ * Some MAX6690 & DS1775 register definitions
+ */
+#define MAX6690_INT_TEMP	0
+#define MAX6690_EXT_TEMP	1
+#define DS1775_TEMP		0
+
+/*
+ * Scaling factors for the AD7417 ADC converters (except
+ * for the CPU diode which is obtained from the EEPROM).
+ * Those values are obtained from the property list of
+ * the darwin driver
+ */
+#define ADC_12V_CURRENT_SCALE	0x0320	/* _AD2 */
+#define ADC_CPU_VOLTAGE_SCALE	0x00a0	/* _AD3 */
+#define ADC_CPU_CURRENT_SCALE	0x1f40	/* _AD4 */
+
+/*
+ * PID factors for the U3/Backside fan control loop
+ */
+#define BACKSIDE_FAN_PWM_ID		1
+#define BACKSIDE_PID_G_d		0x02800000
+#define BACKSIDE_PID_G_p		0x00500000
+#define BACKSIDE_PID_G_r		0x00000000
+#define BACKSIDE_PID_INPUT_TARGET	0x00410000
+#define BACKSIDE_PID_INTERVAL		5
+#define BACKSIDE_PID_OUTPUT_MAX		100
+#define BACKSIDE_PID_OUTPUT_MIN		20
+#define BACKSIDE_PID_HISTORY_SIZE	2
+
+struct backside_pid_state
+{
+	int			ticks;
+	struct i2c_client *	monitor;
+	s32		       	sample_history[BACKSIDE_PID_HISTORY_SIZE];
+	s32			error_history[BACKSIDE_PID_HISTORY_SIZE];
+	int			cur_sample;
+	s32			last_temp;
+	int			pwm;
+	int			first;
+};
+
+/*
+ * PID factors for the Drive Bay fan control loop
+ */
+#define DRIVES_FAN_RPM_ID      		2
+#define DRIVES_PID_G_d			0x01e00000
+#define DRIVES_PID_G_p			0x00500000
+#define DRIVES_PID_G_r			0x00000000
+#define DRIVES_PID_INPUT_TARGET		0x00280000
+#define DRIVES_PID_INTERVAL    		5
+#define DRIVES_PID_OUTPUT_MAX		4000
+#define DRIVES_PID_OUTPUT_MIN		300
+#define DRIVES_PID_HISTORY_SIZE		2
+
+struct drives_pid_state
+{
+	int			ticks;
+	struct i2c_client *	monitor;
+	s32	       		sample_history[BACKSIDE_PID_HISTORY_SIZE];
+	s32			error_history[BACKSIDE_PID_HISTORY_SIZE];
+	int			cur_sample;
+	s32			last_temp;
+	int			rpm;
+	int			first;
+};
+
+#define SLOTS_FAN_PWM_ID       		2
+#define	SLOTS_FAN_DEFAULT_PWM		50 /* Do better here ! */
+
+/*
+ * IDs in Darwin for the sensors & fans
+ *
+ * CPU A AD7417_TEMP	10	(CPU A ambient temperature)
+ * CPU A AD7417_AD1	11	(CPU A diode temperature)
+ * CPU A AD7417_AD2	12	(CPU A 12V current)
+ * CPU A AD7417_AD3	13	(CPU A voltage)
+ * CPU A AD7417_AD4	14	(CPU A current)
+ *
+ * CPU A FAKE POWER	48	(I_V_inputs: 13, 14)
+ *
+ * CPU B AD7417_TEMP	15	(CPU B ambient temperature)
+ * CPU B AD7417_AD1	16	(CPU B diode temperature)
+ * CPU B AD7417_AD2	17	(CPU B 12V current)
+ * CPU B AD7417_AD3	18	(CPU B voltage)
+ * CPU B AD7417_AD4	19	(CPU B current)
+ *
+ * CPU B FAKE POWER	49	(I_V_inputs: 18, 19)
+ */
+
+#define CPUA_INTAKE_FAN_RPM_ID		3
+#define CPUA_EXHAUST_FAN_RPM_ID		4
+#define CPUB_INTAKE_FAN_RPM_ID		5
+#define CPUB_EXHAUST_FAN_RPM_ID		6
+
+#define CPU_INTAKE_SCALE		0x0000f852
+#define CPU_TEMP_HISTORY_SIZE		2
+#define CPU_POWER_HISTORY_SIZE		10
+#define CPU_PID_INTERVAL		1
+#define CPU_MAX_OVERTEMP		30
+
+struct cpu_pid_state
+{
+	int			index;
+	struct i2c_client *	monitor;
+	struct mpu_data		mpu;
+	int			overtemp;
+	s32	       		temp_history[CPU_TEMP_HISTORY_SIZE];
+	int			cur_temp;
+	s32			power_history[CPU_POWER_HISTORY_SIZE];
+	s32			error_history[CPU_POWER_HISTORY_SIZE];
+	int			cur_power;
+	int			count_power;
+	int			rpm;
+	int			intake_rpm;
+	s32			voltage;
+	s32			current_a;
+	s32			last_temp;
+	int			first;
+};
+
+/*
+ * Driver state
+ */
+enum {
+	state_detached,
+	state_attaching,
+	state_attached,
+	state_detaching,
+};
+
+
+#endif /* __THERM_PMAC_7_2_H__ */
--- diff/drivers/macintosh/therm_windtunnel.c	1970-01-01 01:00:00.000000000 +0100
+++ source/drivers/macintosh/therm_windtunnel.c	2004-02-09 10:39:52.000000000 +0000
@@ -0,0 +1,456 @@
+/* 
+ *   Creation Date: <2003/03/14 20:54:13 samuel>
+ *   Time-stamp: <2003/03/15 18:55:53 samuel>
+ *   
+ *	<therm_windtunnel.c>
+ *	
+ *	The G4 "windtunnel" has a single fan controlled by a
+ *	DS1775 fan controller and an ADM1030 thermostat.
+ *
+ *	The fan controller is equipped with a temperature sensor
+ *	which measures the case temperature. The ADM censor
+ *	measures the CPU temperature. This driver tunes the
+ *	behavior of the fan. It is based upon empirical observations
+ *	of the 'AppleFan' driver under OSX.
+ *
+ *	WARNING: This driver has only been testen on Apple's
+ *	1.25 MHz Dual G4 (March 03). Other machines might have
+ *	a different thermal design. It is tuned for a CPU
+ *	temperatur around 57 C.
+ *
+ *   Copyright (C) 2003 Samuel Rydh (samuel@ibrium.se)
+ *
+ *   Loosely based upon 'thermostat.c' written by Benjamin Herrenschmidt
+ *   
+ *   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
+ *   
+ */
+
+#include <linux/config.h>
+#include <linux/types.h>
+#include <linux/module.h>
+#include <linux/errno.h>
+#include <linux/kernel.h>
+#include <linux/delay.h>
+#include <linux/sched.h>
+#include <linux/i2c.h>
+#include <linux/slab.h>
+#include <linux/init.h>
+#include <linux/workqueue.h>
+#include <asm/prom.h>
+#include <asm/machdep.h>
+#include <asm/io.h>
+#include <asm/system.h>
+#include <asm/sections.h>
+
+MODULE_AUTHOR("Samuel Rydh <samuel@ibrium.se>");
+MODULE_DESCRIPTION("Apple G4 (windtunnel) fan driver");
+MODULE_LICENSE("GPL");
+
+#define LOG_TEMP		0			/* continously log temperature */
+
+/* scan 0x48-0x4f (DS1775) and 0x2c-2x2f (ADM1030) */
+static unsigned short normal_i2c[] = { 0x49, 0x2c, I2C_CLIENT_END };
+static unsigned short normal_i2c_range[] = { 0x48, 0x4f, 0x2c, 0x2f, I2C_CLIENT_END };
+static struct work_struct poll_work;
+
+I2C_CLIENT_INSMOD;
+
+#define I2C_DRIVERID_G4FAN	0x9001			/* fixme */
+
+#define THERMOSTAT_CLIENT_ID	1
+#define FAN_CLIENT_ID		2
+
+struct temp_range {
+	u8			high;			/* start the fan */
+	u8			low;			/* stop the fan */
+};
+struct apple_thermal_info {
+	u8			id;			/* implementation ID */
+	u8			fan_count;		/* number of fans */
+	u8			thermostat_count;	/* number of thermostats */
+	u8			unused[5];
+	struct temp_range	ranges[4];		/* temperature ranges (may be [])*/
+};
+
+static int do_detect( struct i2c_adapter *adapter, int addr, int kind);
+
+static struct {
+	struct i2c_client	*thermostat;
+	struct i2c_client	*fan;
+	int			error;
+	struct timer_list	timer;
+
+	int			overheat_temp;		/* 100% fan at this temp */
+	int			overheat_hyst;
+	int			temp;
+	int			casetemp;
+	int			fan_level;		/* active fan_table setting */
+
+	int			downind;
+	int			upind;
+
+	int			r0, r1, r20, r23, r25;	/* saved register */
+} x;
+
+static struct {
+	int			temp;
+	int			fan_setting;
+} fan_up_table[] = {
+	{ 0x0000, 11 },		/* min fan */
+	{ 0x3900, 8 },		/* 57.0 C */
+	{ 0x3a4a, 7 },		/* 58.3 C */
+	{ 0x3ad3, 6 },		/* 58.8 C */
+	{ 0x3b3c, 5 },		/* 59.2 C */
+	{ 0x3b94, 4 },		/* 59.6 C */
+	{ 0x3be3, 3 },		/* 58.9 C */
+	{ 0x3c29, 2 },		/* 59.2 C */
+	{ 0xffff, 1 }		/* on fire */
+};
+static struct {
+	int			temp;
+	int			fan_setting;
+} fan_down_table[] = {
+	{ 0x3700, 11 },		/* 55.0 C */
+	{ 0x374a, 6 },
+	{ 0x3800, 7 },		/* 56.0 C */
+	{ 0x3900, 8 },		/* 57.0 C */
+	{ 0x3a4a, 7 },		/* 58.3 C */
+	{ 0x3ad3, 6 },		/* 58.8 C */
+	{ 0x3b3c, 5 },		/* 59.2 C */
+	{ 0x3b94, 4 },		/* 58.9 C */
+	{ 0x3be3, 3 },		/* 58.9 C */
+	{ 0x3c29, 2 },		/* 59.2 C */
+	{ 0xffff, 1 }
+};
+
+static int
+write_reg( struct i2c_client *cl, int reg, int data, int len )
+{
+	u8 tmp[3];
+
+	if( len < 1 || len > 2 || data < 0 )
+		return -EINVAL;
+
+	tmp[0] = reg;
+	tmp[1] = (len == 1) ? data : (data >> 8);
+	tmp[2] = data;
+	len++;
+	
+	if( i2c_master_send(cl, tmp, len) != len )
+		return -ENODEV;
+	return 0;
+}
+
+static int
+read_reg( struct i2c_client *cl, int reg, int len )
+{
+	u8 buf[2];
+
+	if( len != 1 && len != 2 )
+		return -EINVAL;
+	buf[0] = reg;
+	if( i2c_master_send(cl, buf, 1) != 1 )
+		return -ENODEV;
+	if( i2c_master_recv(cl, buf, len) != len )
+		return -ENODEV;
+	return (len == 2)? ((unsigned int)buf[0] << 8) | buf[1] : buf[0];
+}
+
+
+static void
+print_temp( const char *s, int temp )
+{
+	printk("%s%d.%d C", s ? s : "", temp>>8, (temp & 255)*10/256 );
+}
+
+static void
+tune_fan( int fan_setting )
+{
+	int val = (fan_setting << 3) | 7;
+	x.fan_level = fan_setting;
+	
+	//write_reg( x.fan, 0x24, val, 1 );
+	write_reg( x.fan, 0x25, val, 1 );
+	write_reg( x.fan, 0x20, 0, 1 );
+	print_temp("CPU-temp: ", x.temp );
+	if( x.casetemp )
+		print_temp(", Case: ", x.casetemp );
+	printk("  Tuning fan: %d (%02x)\n", fan_setting, val );
+}
+
+static void
+poll_temp( void *param )
+{
+	int temp = read_reg( x.thermostat, 0, 2 );
+	int i, level, casetemp;
+
+	/* this actually occurs when the computer is loaded */
+	if( temp < 0 )
+		goto out;
+
+	casetemp = read_reg(x.fan, 0x0b, 1) << 8;
+	casetemp |= (read_reg(x.fan, 0x06, 1) & 0x7) << 5;
+
+	if( LOG_TEMP && x.temp != temp ) {
+		print_temp("CPU-temp: ", temp );
+		print_temp(", Case: ", casetemp );
+		printk(",  Fan: %d\n", x.fan_level );
+	}
+	x.temp = temp;
+	x.casetemp = casetemp;
+
+	level = -1;
+	for( i=0; (temp & 0xffff) > fan_down_table[i].temp ; i++ )
+		;
+	if( i < x.downind )
+		level = fan_down_table[i].fan_setting;
+	x.downind = i;
+
+	for( i=0; (temp & 0xfffe) >= fan_up_table[i+1].temp ; i++ )
+		;
+	if( x.upind < i )
+		level = fan_up_table[i].fan_setting;
+	x.upind = i;
+
+	if( level >= 0 )
+		tune_fan( level );
+ out:
+	x.timer.expires = jiffies + 8*HZ;
+	add_timer( &x.timer );
+}
+
+static void
+schedule_poll( unsigned long t )
+{
+	schedule_work(&poll_work);
+}
+
+/************************************************************************/
+/*	i2c probing and setup						*/
+/************************************************************************/
+
+static int
+do_attach( struct i2c_adapter *adapter )
+{
+	return i2c_probe( adapter, &addr_data, &do_detect );
+}
+
+static int
+do_detach( struct i2c_client *client )
+{
+	int err;
+
+	printk("do_detach: id %d\n", client->id );
+	if( (err=i2c_detach_client(client)) ) {
+		printk("failed to detach thermostat client\n");
+		return err;
+	}
+	kfree( client );
+	return 0;
+}
+
+static struct i2c_driver g4fan_driver = {  
+	.name		= "Apple G4 Thermostat/Fan",
+	.id		= I2C_DRIVERID_G4FAN,
+	.flags		= I2C_DF_NOTIFY,
+	.attach_adapter = &do_attach,
+	.detach_client	= &do_detach,
+	.command	= NULL,
+};
+
+static int
+detect_fan( struct i2c_client *cl )
+{
+	/* check that this is an ADM1030 */
+	if( read_reg(cl, 0x3d, 1) != 0x30 || read_reg(cl, 0x3e, 1) != 0x41 )
+		goto out;
+	printk("ADM1030 fan controller detected at %02x\n", cl->addr );
+
+	if( x.fan ) {
+		x.error |= 2;
+		goto out;
+	}
+	x.fan = cl;
+	cl->id = FAN_CLIENT_ID;
+	strncpy( cl->name, "ADM1030 fan controller", sizeof(cl->name) );
+
+	if( i2c_attach_client( cl ) )
+		goto out;
+	return 0;
+ out:
+	if( cl != x.fan )
+		kfree( cl );
+	return 0;
+}
+
+static int
+detect_thermostat( struct i2c_client *cl ) 
+{
+	int hyst_temp, os_temp, temp;
+
+	if( (temp=read_reg(cl, 0, 2)) < 0 )
+		goto out;
+	
+	/* temperature sanity check */
+	if( temp < 0x1600 || temp > 0x3c00 )
+		goto out;
+	hyst_temp = read_reg(cl, 2, 2);
+	os_temp = read_reg(cl, 3, 2);
+	if( hyst_temp < 0 || os_temp < 0 )
+		goto out;
+
+	printk("DS1775 digital thermometer detected at %02x\n", cl->addr );
+	print_temp("Temp: ", temp );
+	print_temp("  Hyst: ", hyst_temp );
+	print_temp("  OS: ", os_temp );
+	printk("\n");
+
+	if( x.thermostat ) {
+		x.error |= 1;
+		goto out;
+	}
+	x.temp = temp;
+	x.thermostat = cl;
+	x.overheat_temp = os_temp;
+	x.overheat_hyst = hyst_temp;
+	
+	cl->id = THERMOSTAT_CLIENT_ID;
+	strncpy( cl->name, "DS1775 thermostat", sizeof(cl->name) );
+
+	if( i2c_attach_client( cl ) )
+		goto out;
+	return 0;
+out:
+	kfree( cl );
+	return 0;
+}
+
+static int
+do_detect( struct i2c_adapter *adapter, int addr, int kind )
+{
+	struct i2c_client *cl;
+
+	if( strncmp(adapter->name, "uni-n", 5) )
+		return 0;
+	if( !i2c_check_functionality(adapter, I2C_FUNC_SMBUS_WORD_DATA
+				     | I2C_FUNC_SMBUS_WRITE_BYTE) )
+		return 0;
+
+	if( !(cl=kmalloc( sizeof(struct i2c_client), GFP_KERNEL )) )
+		return -ENOMEM;
+	memset( cl, 0, sizeof(struct i2c_client) );
+
+	cl->addr = addr;
+	cl->adapter = adapter;
+	cl->driver = &g4fan_driver;
+	cl->flags = 0;
+
+	if( addr < 0x48 )
+		return detect_fan( cl );
+	return detect_thermostat( cl );
+}
+
+#define PRINT_REG( r )	printk("reg %02x = %02x\n", r, read_reg(x.fan, r, 1) )
+
+static int __init
+g4fan_init( void )
+{
+	struct apple_thermal_info *info;
+	struct device_node *np;
+	int ret, val;
+	
+	np = of_find_node_by_name(NULL, "power-mgt");
+	if (np == NULL)
+		return -ENODEV;
+	info = (struct apple_thermal_info*)get_property(np, "thermal-info", NULL);
+	of_node_put(np);
+	if (info == NULL)
+		return -ENODEV;
+	
+	/* check for G4 "Windtunnel" SMP */
+	if( machine_is_compatible("PowerMac3,6") ) {
+		if( info->id != 3 ) {
+			printk(KERN_ERR "g4fan: design id %d unknown\n", info->id);
+			return -ENODEV;
+		}
+	} else {
+		printk(KERN_ERR "g4fan: unsupported machine type\n");
+		return -ENODEV;
+	}
+	if( (ret=i2c_add_driver(&g4fan_driver)) )
+		return ret;
+
+	if( !x.thermostat || !x.fan ) {
+		i2c_del_driver(&g4fan_driver );
+		return -ENODEV;
+	}
+
+	/* save registers (if we unload the module) */
+	x.r0 = read_reg( x.fan, 0x00, 1 );
+	x.r1 = read_reg( x.fan, 0x01, 1 );
+	x.r20 = read_reg( x.fan, 0x20, 1 );
+	x.r23 = read_reg( x.fan, 0x23, 1 );
+	x.r25 = read_reg( x.fan, 0x25, 1 );
+
+	/* improve measurement resolution (convergence time 1.5s) */
+	if( (val=read_reg( x.thermostat, 1, 1 )) >= 0 ) {
+		val |= 0x60;
+		if( write_reg( x.thermostat, 1, val, 1 ) )
+			printk("Failed writing config register\n");
+	}
+	/* disable interrupts and TAC input */
+	write_reg( x.fan, 0x01, 0x01, 1 );
+	/* enable filter */
+	write_reg( x.fan, 0x23, 0x91, 1 );
+	/* remote temp. controls fan */
+	write_reg( x.fan, 0x00, 0x95, 1 );
+
+	/* The thermostat (which besides measureing temperature controls
+	 * has a THERM output which puts the fan on 100%) is usually
+	 * set to kick in at 80 C (chip default). We reduce this a bit
+	 * to be on the safe side (OSX doesn't)...
+	 */
+	if( x.overheat_temp == (80 << 8) ) {
+		x.overheat_temp = 65 << 8;
+		x.overheat_hyst = 60 << 8;
+		write_reg( x.thermostat, 2, x.overheat_hyst, 2 );
+		write_reg( x.thermostat, 3, x.overheat_temp, 2 );
+
+		print_temp("Reducing overheating limit to ", x.overheat_temp );
+		print_temp(" (Hyst: ", x.overheat_hyst );
+		printk(")\n");
+	}
+
+	/* set an initial fan setting */
+	x.upind = x.downind = 1;
+	tune_fan( fan_up_table[x.upind].fan_setting );
+
+	INIT_WORK(&poll_work, poll_temp, NULL);
+
+	init_timer( &x.timer );
+	x.timer.expires = jiffies + 8*HZ;
+	x.timer.function = schedule_poll;
+	add_timer( &x.timer );
+	return 0;
+}
+
+static void __exit
+g4fan_exit( void )
+{
+	del_timer( &x.timer );
+
+	write_reg( x.fan, 0x01, x.r1, 1 );
+	write_reg( x.fan, 0x20, x.r20, 1 );
+	write_reg( x.fan, 0x23, x.r23, 1 );
+	write_reg( x.fan, 0x25, x.r25, 1 );
+	write_reg( x.fan, 0x00, x.r0, 1 );
+
+	i2c_del_driver( &g4fan_driver );
+}
+
+module_init(g4fan_init);
+module_exit(g4fan_exit);
+
--- diff/drivers/net/e100.c	1970-01-01 01:00:00.000000000 +0100
+++ source/drivers/net/e100.c	2004-02-09 10:39:53.000000000 +0000
@@ -0,0 +1,2297 @@
+/*******************************************************************************
+
+  
+  Copyright(c) 1999 - 2004 Intel Corporation. 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.
+  
+  The full GNU General Public License is included in this distribution in the
+  file called LICENSE.
+  
+  Contact Information:
+  Linux NICS <linux.nics@intel.com>
+  Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
+
+*******************************************************************************/
+
+/*
+ *	e100.c: Intel(R) PRO/100 ethernet driver
+ *
+ *	(Re)written 2003 by scott.feldman@intel.com.  Based loosely on
+ *	original e100 driver, but better described as a munging of
+ *	e100, e1000, eepro100, tg3, 8139cp, and other drivers.
+ *
+ *	References:
+ *		Intel 8255x 10/100 Mbps Ethernet Controller Family,
+ *		Open Source Software Developers Manual,
+ *		http://sourceforge.net/projects/e1000
+ *
+ *
+ *	                      Theory of Operation
+ *
+ *	I.   General
+ *
+ *	The driver supports Intel(R) 10/100 Mbps PCI Fast Ethernet
+ *	controller family, which includes the 82557, 82558, 82559, 82550,
+ *	82551, and 82562 devices.  82558 and greater controllers
+ *	integrate the Intel 82555 PHY.  The controllers are used in
+ *	server and client network interface cards, as well as in
+ *	LAN-On-Motherboard (LOM), CardBus, MiniPCI, and ICHx
+ *	configurations.  8255x supports a 32-bit linear addressing
+ *	mode and operates at 33Mhz PCI clock rate.
+ *
+ *	II.  Driver Operation
+ *
+ *	Memory-mapped mode is used exclusively to access the device's
+ *	shared-memory structure, the Control/Status Registers (CSR). All
+ *	setup, configuration, and control of the device, including queuing
+ *	of Tx, Rx, and configuration commands is through the CSR.
+ *	cmd_lock serializes accesses to the CSR command register.  cb_lock
+ *	protects the shared Command Block List (CBL).
+ *
+ *	8255x is highly MII-compliant and all access to the PHY go
+ *	through the Management Data Interface (MDI).  Consequently, the
+ *	driver leverages the mii.c library shared with other MII-compliant
+ *	devices.
+ *
+ *	Big- and Little-Endian byte order as well as 32- and 64-bit
+ *	archs are supported.  Weak-ordered memory and non-cache-coherent
+ *	archs are supported.
+ *
+ *	III. Transmit
+ *
+ *	A Tx skb is mapped and hangs off of a TCB.  TCBs are linked
+ *	together in a fixed-size ring (CBL) thus forming the flexible mode
+ *	memory structure.  A TCB marked with the suspend-bit indicates
+ *	the end of the ring.  The last TCB processed suspends the
+ *	controller, and the controller can be restarted by issue a CU
+ *	resume command to continue from the suspend point, or a CU start
+ *	command to start at a given position in the ring.
+ *
+ *	Non-Tx commands (config, multicast setup, etc) are linked
+ *	into the CBL ring along with Tx commands.  The common structure
+ *	used for both Tx and non-Tx commands is the Command Block (CB).
+ *
+ *	cb_to_use is the next CB to use for queuing a command; cb_to_clean
+ *	is the next CB to check for completion; cb_to_send is the first
+ *	CB to start on in case of a previous failure to resume.  CB clean
+ *	up happens in interrupt context in response to a CU interrupt, or
+ *	in dev->poll in the case where NAPI is enabled.  cbs_avail keeps
+ *	track of number of free CB resources available.
+ *
+ * 	Hardware padding of short packets to minimum packet size is
+ * 	enabled.  82557 pads with 7Eh, while the later controllers pad
+ * 	with 00h.
+ *
+ *	IV.  Recieve
+ *
+ *	The Receive Frame Area (RFA) comprises a ring of Receive Frame
+ *	Descriptors (RFD) + data buffer, thus forming the simplified mode
+ *	memory structure.  Rx skbs are allocated to contain both the RFD
+ *	and the data buffer, but the RFD is pulled off before the skb is
+ *	indicated.  The data buffer is aligned such that encapsulated
+ *	protocol headers are u32-aligned.  Since the RFD is part of the
+ *	mapped shared memory, and completion status is contained within
+ *	the RFD, the RFD must be dma_sync'ed to maintain a consistent
+ *	view from software and hardware.
+ *
+ *	Under typical operation, the  receive unit (RU) is start once,
+ *	and the controller happily fills RFDs as frames arrive.  If
+ *	replacement RFDs cannot be allocated, or the RU goes non-active,
+ *	the RU must be restarted.  Frame arrival generates an interrupt,
+ *	and Rx indication and re-allocation happen in the same context,
+ *	therefore no locking is required.  If NAPI is enabled, this work
+ *	happens in dev->poll.  A software-generated interrupt is gen-
+ *	erated from the watchdog to recover from a failed allocation
+ *	senario where all Rx resources have been indicated and none re-
+ *	placed.
+ *
+ *	V.   Miscellaneous
+ *
+ * 	VLAN offloading of tagging, stripping and filtering is not
+ * 	supported, but driver will accommodate the extra 4-byte VLAN tag
+ * 	for processing by upper layers.  Tx/Rx Checksum offloading is not
+ * 	supported.  Tx Scatter/Gather is not supported.  Jumbo Frames is
+ * 	not supported (hardware limitation).
+ *
+ * 	NAPI support is enabled with CONFIG_E100_NAPI.
+ *
+ * 	MagicPacket(tm) WoL support is enabled/disabled via ethtool.
+ *
+ * 	Thanks to JC (jchapman@katalix.com) for helping with
+ * 	testing/troubleshooting the development driver.
+ */
+
+#include <linux/config.h>
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/kernel.h>
+#include <linux/types.h>
+#include <linux/slab.h>
+#include <linux/delay.h>
+#include <linux/init.h>
+#include <linux/pci.h>
+#include <linux/netdevice.h>
+#include <linux/etherdevice.h>
+#include <linux/mii.h>
+#include <linux/if_vlan.h>
+#include <linux/skbuff.h>
+#include <linux/ethtool.h>
+#include <linux/string.h>
+#include <asm/unaligned.h>
+
+
+#define DRV_NAME		"e100"
+#define DRV_VERSION		"3.0.13_dev"
+#define DRV_DESCRIPTION		"Intel(R) PRO/100 Network Driver"
+#define DRV_COPYRIGHT		"Copyright(c) 1999-2004 Intel Corporation"
+#define PFX			DRV_NAME ": "
+
+#define E100_WATCHDOG_PERIOD	2 * HZ
+#define E100_NAPI_WEIGHT	16
+
+MODULE_DESCRIPTION(DRV_DESCRIPTION);
+MODULE_AUTHOR(DRV_COPYRIGHT);
+MODULE_LICENSE("GPL");
+
+static int debug = 3;
+module_param(debug, int, 0);
+MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)");
+#define DPRINTK(nlevel, klevel, fmt, args...) \
+	(void)((NETIF_MSG_##nlevel & nic->msg_enable) && \
+	printk(KERN_##klevel PFX "%s: %s: " fmt, nic->netdev->name, \
+		__FUNCTION__ , ## args))
+
+#define INTEL_8255X_ETHERNET_DEVICE(device_id, ich) {\
+	PCI_VENDOR_ID_INTEL, device_id, PCI_ANY_ID, PCI_ANY_ID, \
+	PCI_CLASS_NETWORK_ETHERNET << 8, 0xFFFF00, ich }
+static struct pci_device_id e100_id_table[] = {
+	INTEL_8255X_ETHERNET_DEVICE(0x1029, 0),
+	INTEL_8255X_ETHERNET_DEVICE(0x1030, 0),
+	INTEL_8255X_ETHERNET_DEVICE(0x1031, 3),
+	INTEL_8255X_ETHERNET_DEVICE(0x1032, 3),
+	INTEL_8255X_ETHERNET_DEVICE(0x1033, 3),
+	INTEL_8255X_ETHERNET_DEVICE(0x1034, 3),
+	INTEL_8255X_ETHERNET_DEVICE(0x1038, 3),
+	INTEL_8255X_ETHERNET_DEVICE(0x1039, 4),
+	INTEL_8255X_ETHERNET_DEVICE(0x103A, 4),
+	INTEL_8255X_ETHERNET_DEVICE(0x103B, 4),
+	INTEL_8255X_ETHERNET_DEVICE(0x103C, 4),
+	INTEL_8255X_ETHERNET_DEVICE(0x103D, 4),
+	INTEL_8255X_ETHERNET_DEVICE(0x103E, 4),
+	INTEL_8255X_ETHERNET_DEVICE(0x1050, 5),
+	INTEL_8255X_ETHERNET_DEVICE(0x1051, 5),
+	INTEL_8255X_ETHERNET_DEVICE(0x1052, 5),
+	INTEL_8255X_ETHERNET_DEVICE(0x1053, 5),
+	INTEL_8255X_ETHERNET_DEVICE(0x1054, 5),
+	INTEL_8255X_ETHERNET_DEVICE(0x1055, 5),
+	INTEL_8255X_ETHERNET_DEVICE(0x1064, 6),
+	INTEL_8255X_ETHERNET_DEVICE(0x1065, 6),
+	INTEL_8255X_ETHERNET_DEVICE(0x1066, 6),
+	INTEL_8255X_ETHERNET_DEVICE(0x1067, 6),
+	INTEL_8255X_ETHERNET_DEVICE(0x1068, 6),
+	INTEL_8255X_ETHERNET_DEVICE(0x1069, 6),
+	INTEL_8255X_ETHERNET_DEVICE(0x106A, 6),
+	INTEL_8255X_ETHERNET_DEVICE(0x106B, 6),
+	INTEL_8255X_ETHERNET_DEVICE(0x1059, 0),
+	INTEL_8255X_ETHERNET_DEVICE(0x1209, 0),
+	INTEL_8255X_ETHERNET_DEVICE(0x1229, 0),
+	INTEL_8255X_ETHERNET_DEVICE(0x2449, 2),
+	INTEL_8255X_ETHERNET_DEVICE(0x2459, 2),
+	INTEL_8255X_ETHERNET_DEVICE(0x245D, 2),
+	{ 0, }
+};
+MODULE_DEVICE_TABLE(pci, e100_id_table);
+
+enum mac {
+	mac_82557_D100_A  = 0,
+	mac_82557_D100_B  = 1,
+	mac_82557_D100_C  = 2,
+	mac_82558_D101_A4 = 4,
+	mac_82558_D101_B0 = 5,
+	mac_82559_D101M   = 8,
+	mac_82559_D101S   = 9,
+	mac_82550_D102    = 12,
+	mac_82550_D102_C  = 13,
+	mac_82551_E       = 14,
+	mac_82551_F       = 15,
+	mac_82551_10      = 16,
+	mac_unknown       = 0xFF,
+};
+
+enum phy {
+	phy_100a     = 0x000003E0,
+	phy_100c     = 0x035002A8,
+	phy_82555_tx = 0x015002A8,
+	phy_nsc_tx   = 0x5C002000,
+	phy_82562_et = 0x033002A8,
+	phy_82562_em = 0x032002A8,
+	phy_82562_eh = 0x017002A8,
+	phy_unknown  = 0xFFFFFFFF,
+};
+
+/* CSR (Control/Status Registers) */
+struct csr {
+	struct {
+		u8 status;
+		u8 stat_ack;
+		u8 cmd_lo;
+		u8 cmd_hi;
+		u32 gen_ptr;
+	} scb;
+	u32 port;
+	u16 flash_ctrl;
+	u8 eeprom_ctrl_lo;
+	u8 eeprom_ctrl_hi;
+	u32 mdi_ctrl;
+	u32 rx_dma_count;
+};
+
+enum scb_status {
+	rus_ready        = 0x10,
+	rus_mask         = 0x3C,
+};
+
+enum scb_stat_ack {
+	stat_ack_not_ours    = 0x00,
+	stat_ack_sw_gen      = 0x04,
+	stat_ack_rnr         = 0x10,
+	stat_ack_cu_idle     = 0x20,
+	stat_ack_frame_rx    = 0x40,
+	stat_ack_cu_cmd_done = 0x80,
+	stat_ack_not_present = 0xFF,
+	stat_ack_rx = (stat_ack_sw_gen | stat_ack_rnr | stat_ack_frame_rx),
+	stat_ack_tx = (stat_ack_cu_idle | stat_ack_cu_cmd_done),
+};
+
+enum scb_cmd_hi {
+	irq_mask_none = 0x00,
+	irq_mask_all  = 0x01,
+	irq_sw_gen    = 0x02,
+};
+
+enum scb_cmd_lo {
+	ruc_start      = 0x01,
+	ruc_load_base  = 0x06,
+	cuc_start      = 0x10,
+	cuc_resume     = 0x20,
+	cuc_dump_addr  = 0x40,
+	cuc_dump_stats = 0x50,
+	cuc_load_base  = 0x60,
+	cuc_dump_reset = 0x70,
+};
+
+enum port {
+	software_reset  = 0x0000,
+	selftest        = 0x0001,
+	selective_reset = 0x0002,
+};
+
+enum eeprom_ctrl_lo {
+	eesk = 0x01,
+	eecs = 0x02,
+	eedi = 0x04,
+	eedo = 0x08,
+};
+
+enum mdi_ctrl {
+	mdi_write = 0x04000000,
+	mdi_read  = 0x08000000,
+	mdi_ready = 0x10000000,
+};
+
+enum eeprom_op {
+	op_write = 0x05,
+	op_read  = 0x06,
+	op_ewds  = 0x10,
+	op_ewen  = 0x13,
+};
+
+enum eeprom_offsets {
+	eeprom_id         = 0x0A,
+	eeprom_config_asf = 0x0D,
+	eeprom_smbus_addr = 0x90,
+};
+
+enum eeprom_id {
+	eeprom_id_wol = 0x0020,
+};
+
+enum eeprom_config_asf {
+	eeprom_asf = 0x8000,
+	eeprom_gcl = 0x4000,
+};
+
+enum cb_status {
+	cb_complete = 0x8000,
+	cb_ok       = 0x2000,
+};
+
+enum cb_command {
+	cb_iaaddr = 0x0001,
+	cb_config = 0x0002,
+	cb_multi  = 0x0003,
+	cb_tx     = 0x0004,
+	cb_dump   = 0x0006,
+	cb_tx_sf  = 0x0008,
+	cb_cid    = 0x1f00,
+	cb_i      = 0x2000,
+	cb_s      = 0x4000,
+	cb_el     = 0x8000,
+};
+
+struct rfd {
+	u16 status;
+	u16 command;
+	u32 link;
+	u32 rbd;
+	u16 actual_size;
+	u16 size;
+};
+
+struct rx {
+	struct rx *next, *prev;
+	struct sk_buff *skb;
+	dma_addr_t dma_addr;
+};
+
+#if defined(__BIG_ENDIAN_BITFIELD)
+#define X(a,b)	b,a
+#else
+#define X(a,b)	a,b
+#endif
+struct config {
+/*0*/	u8 X(byte_count:6, pad0:2);
+/*1*/	u8 X(X(rx_fifo_limit:4, tx_fifo_limit:3), pad1:1);
+/*2*/	u8 adaptive_ifs;
+/*3*/	u8 X(X(X(X(mwi_enable:1, type_enable:1), read_align_enable:1),
+	   term_write_cache_line:1), pad3:4);
+/*4*/	u8 X(rx_dma_max_count:7, pad4:1);
+/*5*/	u8 X(tx_dma_max_count:7, dma_max_count_enable:1);
+/*6*/	u8 X(X(X(X(X(X(X(late_scb_update:1, direct_rx_dma:1),
+	   tno_intr:1), cna_intr:1), standard_tcb:1), standard_stat_counter:1),
+	   rx_discard_overruns:1), rx_save_bad_frames:1);
+/*7*/	u8 X(X(X(X(X(rx_discard_short_frames:1, tx_underrun_retry:2),
+	   pad7:2), rx_extended_rfd:1), tx_two_frames_in_fifo:1),
+	   tx_dynamic_tbd:1);
+/*8*/	u8 X(X(mii_mode:1, pad8:6), csma_disabled:1);
+/*9*/	u8 X(X(X(X(X(rx_tcpudp_checksum:1, pad9:3), vlan_arp_tco:1),
+	   link_status_wake:1), arp_wake:1), mcmatch_wake:1);
+/*10*/	u8 X(X(X(pad10:3, no_source_addr_insertion:1), preamble_length:2),
+	   loopback:2);
+/*11*/	u8 X(linear_priority:3, pad11:5);
+/*12*/	u8 X(X(linear_priority_mode:1, pad12:3), ifs:4);
+/*13*/	u8 ip_addr_lo;
+/*14*/	u8 ip_addr_hi;
+/*15*/	u8 X(X(X(X(X(X(X(promiscuous_mode:1, broadcast_disabled:1),
+	   wait_after_win:1), pad15_1:1), ignore_ul_bit:1), crc_16_bit:1),
+	   pad15_2:1), crs_or_cdt:1);
+/*16*/	u8 fc_delay_lo;
+/*17*/	u8 fc_delay_hi;
+/*18*/	u8 X(X(X(X(X(rx_stripping:1, tx_padding:1), rx_crc_transfer:1),
+	   rx_long_ok:1), fc_priority_threshold:3), pad18:1);
+/*19*/	u8 X(X(X(X(X(X(X(addr_wake:1, magic_packet_disable:1),
+	   fc_disable:1), fc_restop:1), fc_restart:1), fc_reject:1),
+	   full_duplex_force:1), full_duplex_pin:1);
+/*20*/	u8 X(X(X(pad20_1:5, fc_priority_location:1), multi_ia:1), pad20_2:1);
+/*21*/	u8 X(X(pad21_1:3, multicast_all:1), pad21_2:4);
+/*22*/	u8 X(X(rx_d102_mode:1, rx_vlan_drop:1), pad22:6);
+	u8 pad_d102[9];
+};
+
+#define E100_MAX_MULTICAST_ADDRS	64
+struct multi {
+	u16 count;
+	u8 addr[E100_MAX_MULTICAST_ADDRS * ETH_ALEN + 2/*pad*/];
+};
+
+/* Important: keep total struct u32-aligned */
+struct cb {
+	u16 status;
+	u16 command;
+	u32 link;
+	union {
+		u8 iaaddr[ETH_ALEN];
+		struct config config;
+		struct multi multi;
+		struct {
+			u32 tbd_array;
+			u16 tcb_byte_count;
+			u8 threshold;
+			u8 tbd_count;
+			struct {
+				u32 buf_addr;
+				u16 size;
+				u16 eol;
+			} tbd;
+		} tcb;
+		u32 dump_buffer_addr;
+	} u;
+	struct cb *next, *prev;
+	dma_addr_t dma_addr;
+	struct sk_buff *skb;
+};
+
+enum loopback {
+	lb_none = 0, lb_mac = 1, lb_phy = 3,
+};
+
+struct stats {
+	u32 tx_good_frames, tx_max_collisions, tx_late_collisions,
+		tx_underruns, tx_lost_crs, tx_deferred, tx_single_collisions,
+		tx_multiple_collisions, tx_total_collisions;
+	u32 rx_good_frames, rx_crc_errors, rx_alignment_errors,
+		rx_resource_errors, rx_overrun_errors, rx_cdt_errors,
+		rx_short_frame_errors;
+	u32 fc_xmt_pause, fc_rcv_pause, fc_rcv_unsupported;
+	u16 xmt_tco_frames, rcv_tco_frames;
+	u32 complete;
+};
+
+struct mem {
+	struct {
+		u32 signature;
+		u32 result;
+	} selftest;
+	struct stats stats;
+	u8 dump_buf[596];
+};
+
+struct param_range {
+	u32 min;
+	u32 max;
+	u32 count;
+};
+
+struct params {
+	struct param_range rfds;
+	struct param_range cbs;
+};
+
+struct nic {
+	/* Begin: frequently used values: keep adjacent for cache effect */
+	u32 msg_enable				____cacheline_aligned;
+	struct net_device *netdev;
+	struct pci_dev *pdev;
+
+	struct rx *rxs				____cacheline_aligned;
+	struct rx *rx_to_use;
+	struct rx *rx_to_clean;
+	struct rfd blank_rfd;
+	int ru_running;
+
+	spinlock_t cb_lock			____cacheline_aligned;
+	spinlock_t cmd_lock;
+	struct csr *csr;
+	enum scb_cmd_lo cuc_cmd;
+	unsigned int cbs_avail;
+	struct cb *cbs;
+	struct cb *cb_to_use;
+	struct cb *cb_to_send;
+	struct cb *cb_to_clean;
+	u16 tx_command;
+	/* End: frequently used values: keep adjacent for cache effect */
+
+	enum {
+		ich           = (1 << 0),
+		promiscuous   = (1 << 1),
+		multicast_all = (1 << 2),
+		wol_magic     = (1 << 3),
+	} flags					____cacheline_aligned;
+
+	enum mac mac;
+	enum phy phy;
+	struct params params;
+	struct net_device_stats net_stats;
+	struct timer_list watchdog;
+	struct timer_list blink_timer;
+	struct mii_if_info mii;
+	enum loopback loopback;
+
+	struct mem *mem;
+	dma_addr_t dma_addr;
+
+	dma_addr_t cbs_dma_addr;
+	u8 adaptive_ifs;
+	u8 tx_threshold;
+	u32 tx_frames;
+	u32 tx_collisions;
+	u32 tx_deferred;
+	u32 tx_single_collisions;
+	u32 tx_multiple_collisions;
+	u32 tx_fc_pause;
+	u32 tx_tco_frames;
+
+	u32 rx_fc_pause;
+	u32 rx_fc_unsupported;
+	u32 rx_tco_frames;
+
+	u8 rev_id;
+	u16 leds;
+	u16 eeprom_wc;
+	u16 eeprom[256];
+	u32 pm_state[16];
+};
+
+static inline void e100_write_flush(struct nic *nic)
+{
+	/* Flush previous PCI writes through intermediate bridges
+	 * by doing a benign read */
+	(void)readb(&nic->csr->scb.status);
+}
+
+static inline void e100_enable_irq(struct nic *nic)
+{
+	writeb(irq_mask_none, &nic->csr->scb.cmd_hi);
+	e100_write_flush(nic);
+}
+
+static inline void e100_disable_irq(struct nic *nic)
+{
+	writeb(irq_mask_all, &nic->csr->scb.cmd_hi);
+	e100_write_flush(nic);
+}
+
+static void e100_hw_reset(struct nic *nic)
+{
+	/* Put CU and RU into idle with a selective reset to get
+	 * device off of PCI bus */
+	writel(selective_reset, &nic->csr->port);
+	e100_write_flush(nic); udelay(20);
+
+	/* Now fully reset device */
+	writel(software_reset, &nic->csr->port);
+	e100_write_flush(nic); udelay(20);
+
+	/* TCO workaround - 82559 and greater */
+	if(nic->mac >= mac_82559_D101M) {
+		/* Issue a redundant CU load base without setting
+		 * general pointer, and without waiting for scb to
+		 * clear.  This gets us into post-driver.  Finally,
+		 * wait 20 msec for reset to take effect. */
+		writeb(cuc_load_base, &nic->csr->scb.cmd_lo);
+		mdelay(20);
+	}
+
+	/* Mask off our interrupt line - it's unmasked after reset */
+	e100_disable_irq(nic);
+}
+
+static int e100_self_test(struct nic *nic)
+{
+	u32 dma_addr = nic->dma_addr + offsetof(struct mem, selftest);
+
+	/* Passing the self-test is a pretty good indication
+	 * that the device can DMA to/from host memory */
+
+	nic->mem->selftest.signature = 0;
+	nic->mem->selftest.result = 0xFFFFFFFF;
+
+	writel(selftest | dma_addr, &nic->csr->port);
+	e100_write_flush(nic);
+	/* Wait 10 msec for self-test to complete */
+	set_current_state(TASK_UNINTERRUPTIBLE);
+	schedule_timeout(HZ / 100 + 1);
+
+	/* Interrupts are enabled after self-test */
+	e100_disable_irq(nic);
+
+	/* Check results of self-test */
+	if(nic->mem->selftest.result != 0) {
+		DPRINTK(HW, ERR, "Self-test failed: result=0x%08X\n",
+			nic->mem->selftest.result);
+		return -ETIMEDOUT;
+	}
+	if(nic->mem->selftest.signature == 0) {
+		DPRINTK(HW, ERR, "Self-test failed: timed out\n");
+		return -ETIMEDOUT;
+	}
+
+	return 0;
+}
+
+static void e100_eeprom_write(struct nic *nic, u16 addr_len, u16 addr, u16 data)
+{
+	u32 cmd_addr_data[3];
+	u8 ctrl;
+	int i, j;
+
+	/* Three cmds: write/erase enable, write data, write/erase disable */
+	cmd_addr_data[0] = op_ewen << (addr_len - 2);
+	cmd_addr_data[1] = (((op_write << addr_len) | addr) << 16) | data;
+	cmd_addr_data[2] = op_ewds << (addr_len - 2);
+
+	/* Bit-bang cmds to write word to eeprom */
+	for(j = 0; j < 3; j++) {
+
+		/* Chip select */
+		writeb(eecs | eesk, &nic->csr->eeprom_ctrl_lo);
+		e100_write_flush(nic); udelay(4);
+
+		for(i = 31; i >= 0; i--) {
+			ctrl = (cmd_addr_data[j] & (1 << i)) ?
+				eecs | eedi : eecs;
+			writeb(ctrl, &nic->csr->eeprom_ctrl_lo);
+			e100_write_flush(nic); udelay(4);
+			writeb(ctrl | eesk, &nic->csr->eeprom_ctrl_lo);
+			e100_write_flush(nic); udelay(4);
+		}
+		/* Wait 10 msec for cmd to complete */
+		set_current_state(TASK_UNINTERRUPTIBLE);
+		schedule_timeout(HZ / 100 + 1);
+
+		/* Chip deselect */
+		writeb(0, &nic->csr->eeprom_ctrl_lo);
+		e100_write_flush(nic); udelay(4);
+	}
+
+};
+
+/* General technique stolen from the eepro100 driver - very clever */
+static u16 e100_eeprom_read(struct nic *nic, u16 *addr_len, u16 addr)
+{
+	u32 cmd_addr_data;
+	u16 data = 0;
+	u8 ctrl;
+	int i;
+
+	cmd_addr_data = ((op_read << *addr_len) | addr) << 16;
+
+	/* Chip select */
+	writeb(eecs | eesk, &nic->csr->eeprom_ctrl_lo);
+	e100_write_flush(nic); udelay(4);
+
+	/* Bit-bang to read word from eeprom */
+	for(i = 31; i >= 0; i--) {
+		ctrl = (cmd_addr_data & (1 << i)) ? eecs | eedi : eecs;
+		writeb(ctrl, &nic->csr->eeprom_ctrl_lo);
+		e100_write_flush(nic); udelay(4);
+		writeb(ctrl | eesk, &nic->csr->eeprom_ctrl_lo);
+		e100_write_flush(nic); udelay(4);
+		/* Eeprom drives a dummy zero to EEDO after receiving
+		 * complete address.  Use this to adjust addr_len. */
+		ctrl = readb(&nic->csr->eeprom_ctrl_lo);
+		if(!(ctrl & eedo) && i > 16) {
+			*addr_len -= (i - 16);
+			i = 17;
+		}
+		data = (data << 1) | (ctrl & eedo ? 1 : 0);
+	}
+
+	/* Chip deselect */
+	writeb(0, &nic->csr->eeprom_ctrl_lo);
+	e100_write_flush(nic); udelay(4);
+
+	return data;
+};
+
+/* Load entire EEPROM image into driver cache and validate checksum */
+static int e100_eeprom_load(struct nic *nic)
+{
+	u16 addr, addr_len = 8, checksum = 0;
+
+	/* Try reading with an 8-bit addr len to discover actual addr len */
+	e100_eeprom_read(nic, &addr_len, 0);
+	nic->eeprom_wc = 1 << addr_len;
+
+	for(addr = 0; addr < nic->eeprom_wc; addr++) {
+		nic->eeprom[addr] = e100_eeprom_read(nic, &addr_len, addr);
+		if(addr < nic->eeprom_wc - 1)
+			checksum += nic->eeprom[addr];
+	}
+
+	/* The checksum, stored in the last word, is calculated such that
+	 * the sum of words should be 0xBABA */
+	checksum = 0xBABA - checksum;
+	if(checksum != nic->eeprom[nic->eeprom_wc - 1]) {
+		DPRINTK(PROBE, ERR, "EEPROM corrupted\n");
+		return -EAGAIN;
+	}
+
+	return 0;
+}
+
+/* Save (portion of) driver EEPROM cache to device and update checksum */
+static int e100_eeprom_save(struct nic *nic, u16 start, u16 count)
+{
+	u16 addr, addr_len = 8, checksum = 0;
+
+	/* Try reading with an 8-bit addr len to discover actual addr len */
+	e100_eeprom_read(nic, &addr_len, 0);
+	nic->eeprom_wc = 1 << addr_len;
+
+	if(start + count >= nic->eeprom_wc)
+		return -EINVAL;
+
+	for(addr = start; addr < start + count; addr++)
+		e100_eeprom_write(nic, addr_len, addr, nic->eeprom[addr]);
+
+	/* The checksum, stored in the last word, is calculated such that
+	 * the sum of words should be 0xBABA */
+	for(addr = 0; addr < nic->eeprom_wc - 1; addr++)
+		checksum += nic->eeprom[addr];
+	nic->eeprom[nic->eeprom_wc - 1] = 0xBABA - checksum;
+	e100_eeprom_write(nic, addr_len, nic->eeprom_wc - 1, 0xBABA - checksum);
+
+	return 0;
+}
+
+#define E100_WAIT_SCB_TIMEOUT 40
+static inline int e100_exec_cmd(struct nic *nic, u8 cmd, dma_addr_t dma_addr)
+{
+	unsigned long flags;
+	unsigned int i;
+	int err = 0;
+
+	spin_lock_irqsave(&nic->cmd_lock, flags);
+
+	/* Previous command is accepted when SCB clears */
+	for(i = 0; i < E100_WAIT_SCB_TIMEOUT; i++) {
+		if(likely(!readb(&nic->csr->scb.cmd_lo)))
+			break;
+		cpu_relax();
+		if(unlikely(i > (E100_WAIT_SCB_TIMEOUT >> 1)))
+			udelay(5);
+	}
+	if(unlikely(i == E100_WAIT_SCB_TIMEOUT)) {
+		err = -EAGAIN;
+		goto err_unlock;
+	}
+
+	if(unlikely(cmd != cuc_resume))
+		writel(dma_addr, &nic->csr->scb.gen_ptr);
+	writeb(cmd, &nic->csr->scb.cmd_lo);
+
+err_unlock:
+	spin_unlock_irqrestore(&nic->cmd_lock, flags);
+
+	return err;
+}
+
+static inline int e100_exec_cb(struct nic *nic, struct sk_buff *skb,
+	void (*cb_prepare)(struct nic *, struct cb *, struct sk_buff *))
+{
+	struct cb *cb;
+	unsigned long flags;
+	int err = 0;
+
+	spin_lock_irqsave(&nic->cb_lock, flags);
+
+	if(unlikely(!nic->cbs_avail)) {
+		err = -ENOMEM;
+		goto err_unlock;
+	}
+
+	cb = nic->cb_to_use;
+	nic->cb_to_use = cb->next;
+	nic->cbs_avail--;
+	cb->skb = skb;
+
+	if(unlikely(!nic->cbs_avail))
+		err = -ENOSPC;
+
+	cb_prepare(nic, cb, skb);
+
+	/* Order is important otherwise we'll be in a race with h/w:
+	 * set S-bit in current first, then clear S-bit in previous. */
+	cb->command |= cpu_to_le16(cb_s);
+	cb->prev->command &= cpu_to_le16(~cb_s);
+
+	while(nic->cb_to_send != nic->cb_to_use) {
+		if(unlikely((err = e100_exec_cmd(nic, nic->cuc_cmd,
+			nic->cb_to_send->dma_addr)))) {
+			/* Ok, here's where things get sticky.  It's
+			 * possible that we can't schedule the command
+			 * because the controller is too busy, so
+			 * let's just queue the command and try again
+			 * when another command is scheduled. */
+			break;
+		} else {
+			nic->cuc_cmd = cuc_resume;
+			nic->cb_to_send = nic->cb_to_send->next;
+		}
+	}
+
+err_unlock:
+	spin_unlock_irqrestore(&nic->cb_lock, flags);
+
+	return err;
+}
+
+static u16 mdio_ctrl(struct nic *nic, u32 addr, u32 dir, u32 reg, u16 data)
+{
+	u32 data_out = 0;
+	unsigned int i;
+
+	writel((reg << 16) | (addr << 21) | dir | data, &nic->csr->mdi_ctrl);
+
+	for(i = 0; i < 100; i++) {
+		udelay(20);
+		if((data_out = readl(&nic->csr->mdi_ctrl)) & mdi_ready)
+			break;
+	}
+
+	DPRINTK(HW, DEBUG,
+		"%s:addr=%d, reg=%d, data_in=0x%04X, data_out=0x%04X\n",
+		dir == mdi_read ? "READ" : "WRITE", addr, reg, data, data_out);
+	return (u16)data_out;
+}
+
+static int mdio_read(struct net_device *netdev, int addr, int reg)
+{
+	return mdio_ctrl(netdev->priv, addr, mdi_read, reg, 0);
+}
+
+static void mdio_write(struct net_device *netdev, int addr, int reg, int data)
+{
+	mdio_ctrl(netdev->priv, addr, mdi_write, reg, data);
+}
+
+static void e100_get_defaults(struct nic *nic)
+{
+	struct param_range rfds = { .min = 64, .max = 256, .count = 64 };
+	struct param_range cbs  = { .min = 64, .max = 256, .count = 64 };
+
+	pci_read_config_byte(nic->pdev, PCI_REVISION_ID, &nic->rev_id);
+	/* MAC type is encoded as rev ID; exception: ICH is treated as 82559 */
+	nic->mac = (nic->flags & ich) ? mac_82559_D101M : nic->rev_id;
+	if(nic->mac == mac_unknown)
+		nic->mac = mac_82557_D100_A;
+
+	nic->params.rfds = rfds;
+	nic->params.cbs = cbs;
+
+	/* Quadwords to DMA into FIFO before starting frame transmit */
+	nic->tx_threshold = 0xE0;
+
+	nic->tx_command = cpu_to_le16(cb_tx | cb_i | cb_tx_sf |
+		((nic->mac >= mac_82558_D101_A4) ? cb_cid : 0));
+
+	/* Template for a freshly allocated RFD */
+	nic->blank_rfd.command = cpu_to_le16(cb_el);
+	nic->blank_rfd.rbd = 0xFFFFFFFF;
+	nic->blank_rfd.size = cpu_to_le16(VLAN_ETH_FRAME_LEN);
+
+	/* MII setup */
+	nic->mii.phy_id_mask = 0x1F;
+	nic->mii.reg_num_mask = 0x1F;
+	nic->mii.dev = nic->netdev;
+	nic->mii.mdio_read = mdio_read;
+	nic->mii.mdio_write = mdio_write;
+}
+
+static void e100_configure(struct nic *nic, struct cb *cb, struct sk_buff *skb)
+{
+	struct config *config = &cb->u.config;
+	u8 *c = (u8 *)config;
+
+	cb->command = cpu_to_le16(cb_config);
+
+	memset(config, 0, sizeof(struct config));
+
+	config->byte_count = 0x16;		/* bytes in this struct */
+	config->rx_fifo_limit = 0x8;		/* bytes in FIFO before DMA */
+	config->direct_rx_dma = 0x1;		/* reserved */
+	config->standard_tcb = 0x1;		/* 1=standard, 0=extended */
+	config->standard_stat_counter = 0x1;	/* 1=standard, 0=extended */
+	config->rx_discard_short_frames = 0x1;	/* 1=discard, 0=pass */
+	config->tx_underrun_retry = 0x3;	/* # of underrun retries */
+	config->mii_mode = 0x1;			/* 1=MII mode, 0=503 mode */
+	config->pad10 = 0x6;
+	config->no_source_addr_insertion = 0x1;	/* 1=no, 0=yes */
+	config->preamble_length = 0x2;		/* 0=1, 1=3, 2=7, 3=15 bytes */
+	config->ifs = 0x6;			/* x16 = inter frame spacing */
+	config->ip_addr_hi = 0xF2;		/* ARP IP filter - not used */
+	config->pad15_1 = 0x1;
+	config->pad15_2 = 0x1;
+	config->crs_or_cdt = 0x0;		/* 0=CRS only, 1=CRS or CDT */
+	config->fc_delay_hi = 0x40;		/* time delay for fc frame */
+	config->tx_padding = 0x1;		/* 1=pad short frames */
+	config->fc_priority_threshold = 0x7;	/* 7=priority fc disabled */
+	config->pad18 = 0x1;
+	config->full_duplex_pin = 0x1;		/* 1=examine FDX# pin */
+	config->pad20_1 = 0x1F;
+	config->fc_priority_location = 0x1;	/* 1=byte#31, 0=byte#19 */
+	config->pad21_1 = 0x5;
+
+	config->adaptive_ifs = nic->adaptive_ifs;
+	config->loopback = nic->loopback;
+
+	if(nic->mii.force_media && nic->mii.full_duplex)
+		config->full_duplex_force = 0x1;	/* 1=force, 0=auto */
+
+	if(nic->flags & promiscuous || nic->loopback) {
+		config->rx_save_bad_frames = 0x1;	/* 1=save, 0=discard */
+		config->rx_discard_short_frames = 0x0;	/* 1=discard, 0=save */
+		config->promiscuous_mode = 0x1;		/* 1=on, 0=off */
+	}
+
+	if(nic->flags & multicast_all)
+		config->multicast_all = 0x1;		/* 1=accept, 0=no */
+
+	if(!(nic->flags & wol_magic))
+		config->magic_packet_disable = 0x1;	/* 1=off, 0=on */
+
+	if(nic->mac >= mac_82558_D101_A4) {
+		config->fc_disable = 0x1;	/* 1=Tx fc off, 0=Tx fc on */
+		config->mwi_enable = 0x1;	/* 1=enable, 0=disable */
+		config->standard_tcb = 0x0;	/* 1=standard, 0=extended */
+		config->rx_long_ok = 0x1;	/* 1=VLANs ok, 0=standard */
+		if(nic->mac >= mac_82559_D101M)
+			config->tno_intr = 0x1;		/* TCO stats enable */
+		else
+			config->standard_stat_counter = 0x0;
+	}
+
+	DPRINTK(HW, DEBUG, "[00-07]=%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X\n",
+		c[0], c[1], c[2], c[3], c[4], c[5], c[6], c[7]);
+	DPRINTK(HW, DEBUG, "[08-15]=%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X\n",
+		c[8], c[9], c[10], c[11], c[12], c[13], c[14], c[15]);
+	DPRINTK(HW, DEBUG, "[16-23]=%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X\n",
+		c[16], c[17], c[18], c[19], c[20], c[21], c[22], c[23]);
+}
+
+static void e100_setup_iaaddr(struct nic *nic, struct cb *cb,
+	struct sk_buff *skb)
+{
+	cb->command = cpu_to_le16(cb_iaaddr);
+	memcpy(cb->u.iaaddr, nic->netdev->dev_addr, ETH_ALEN);
+}
+
+static void e100_dump(struct nic *nic, struct cb *cb, struct sk_buff *skb)
+{
+	cb->command = cpu_to_le16(cb_dump);
+	cb->u.dump_buffer_addr = cpu_to_le32(nic->dma_addr +
+		offsetof(struct mem, dump_buf));
+}
+
+#define NCONFIG_AUTO_SWITCH	0x0080
+#define MII_NSC_CONG		MII_RESV1
+#define NSC_CONG_ENABLE		0x0100
+#define NSC_CONG_TXREADY	0x0400
+#define ADVERTISE_FC_SUPPORTED	0x0400
+static int e100_phy_init(struct nic *nic)
+{
+	struct net_device *netdev = nic->netdev;
+	u32 addr;
+	u16 bmcr, stat, id_lo, id_hi, cong;
+
+	/* Discover phy addr by searching addrs in order {1,0,2,..., 31} */
+	for(addr = 0; addr < 32; addr++) {
+		nic->mii.phy_id = (addr == 0) ? 1 : (addr == 1) ? 0 : addr;
+		bmcr = mdio_read(netdev, nic->mii.phy_id, MII_BMCR);
+		stat = mdio_read(netdev, nic->mii.phy_id, MII_BMSR);
+		stat = mdio_read(netdev, nic->mii.phy_id, MII_BMSR);
+		if(!((bmcr == 0xFFFF) || ((stat == 0) && (bmcr == 0))))
+			break;
+	}
+	DPRINTK(HW, DEBUG, "phy_addr = %d\n", nic->mii.phy_id);
+	if(addr == 32)
+		return -EAGAIN;
+
+	/* Selected the phy and isolate the rest */
+	for(addr = 0; addr < 32; addr++) {
+		if(addr != nic->mii.phy_id) {
+			mdio_write(netdev, addr, MII_BMCR, BMCR_ISOLATE);
+		} else {
+			bmcr = mdio_read(netdev, addr, MII_BMCR);
+			mdio_write(netdev, addr, MII_BMCR,
+				bmcr & ~BMCR_ISOLATE);
+		}
+	}
+
+	/* Get phy ID */
+	id_lo = mdio_read(netdev, nic->mii.phy_id, MII_PHYSID1);
+	id_hi = mdio_read(netdev, nic->mii.phy_id, MII_PHYSID2);
+	nic->phy = (u32)id_hi << 16 | (u32)id_lo;
+	DPRINTK(HW, DEBUG, "phy ID = 0x%08X\n", nic->phy);
+
+	/* Handle National tx phy */
+	if(nic->phy == phy_nsc_tx) {
+		/* Disable congestion control */
+		cong = mdio_read(netdev, nic->mii.phy_id, MII_NSC_CONG);
+		cong |= NSC_CONG_TXREADY;
+		cong &= ~NSC_CONG_ENABLE;
+		mdio_write(netdev, nic->mii.phy_id, MII_NSC_CONG, cong);
+	}
+
+	if(nic->mac >= mac_82550_D102)
+		/* enable/disable MDI/MDI-X auto-switching */
+		mdio_write(netdev, nic->mii.phy_id, MII_NCONFIG,
+			nic->mii.force_media ? 0 : NCONFIG_AUTO_SWITCH);
+
+	return 0;
+}
+
+static int e100_hw_init(struct nic *nic)
+{
+	int err;
+
+	e100_hw_reset(nic);
+
+	DPRINTK(HW, ERR, "e100_hw_init\n");
+	if(!in_interrupt() && (err = e100_self_test(nic)))
+		return err;
+
+	if((err = e100_phy_init(nic)))
+		return err;
+	if((err = e100_exec_cmd(nic, cuc_load_base, 0)))
+		return err;
+	if((err = e100_exec_cmd(nic, ruc_load_base, 0)))
+		return err;
+	if((err = e100_exec_cb(nic, NULL, e100_configure)))
+		return err;
+	if((err = e100_exec_cb(nic, NULL, e100_setup_iaaddr)))
+		return err;
+	if((err = e100_exec_cmd(nic, cuc_dump_addr,
+		nic->dma_addr + offsetof(struct mem, stats))))
+		return err;
+	if((err = e100_exec_cmd(nic, cuc_dump_reset, 0)))
+		return err;
+
+	e100_disable_irq(nic);
+
+	return 0;
+}
+
+static void e100_multi(struct nic *nic, struct cb *cb, struct sk_buff *skb)
+{
+	struct net_device *netdev = nic->netdev;
+	struct dev_mc_list *list = netdev->mc_list;
+	u16 i, count = min(netdev->mc_count, E100_MAX_MULTICAST_ADDRS);
+
+	cb->command = cpu_to_le16(cb_multi);
+	cb->u.multi.count = cpu_to_le16(count * ETH_ALEN);
+	for(i = 0; list && i < count; i++, list = list->next)
+		memcpy(&cb->u.multi.addr[i*ETH_ALEN], &list->dmi_addr,
+			ETH_ALEN);
+}
+
+static void e100_set_multicast_list(struct net_device *netdev)
+{
+	struct nic *nic = netdev->priv;
+
+	DPRINTK(HW, DEBUG, "mc_count=%d, flags=0x%04X\n",
+		netdev->mc_count, netdev->flags);
+
+	if(netdev->flags & IFF_PROMISC)
+		nic->flags |= promiscuous;
+	else
+		nic->flags &= ~promiscuous;
+
+	if(netdev->flags & IFF_ALLMULTI ||
+		netdev->mc_count > E100_MAX_MULTICAST_ADDRS)
+		nic->flags |= multicast_all;
+	else
+		nic->flags &= ~multicast_all;
+
+	e100_exec_cb(nic, NULL, e100_configure);
+	e100_exec_cb(nic, NULL, e100_multi);
+}
+
+static void e100_update_stats(struct nic *nic)
+{
+	struct net_device_stats *ns = &nic->net_stats;
+	struct stats *s = &nic->mem->stats;
+	u32 *complete = (nic->mac < mac_82558_D101_A4) ? &s->fc_xmt_pause :
+		(nic->mac < mac_82559_D101M) ? (u32 *)&s->xmt_tco_frames :
+		&s->complete;
+
+	/* Device's stats reporting may take several microseconds to
+	 * complete, so where always waiting for results of the
+	 * previous command. */
+
+	if(*complete == le32_to_cpu(0x0000A007)) {
+		*complete = 0;
+		nic->tx_frames = le32_to_cpu(s->tx_good_frames);
+		nic->tx_collisions = le32_to_cpu(s->tx_total_collisions);
+		ns->tx_aborted_errors += le32_to_cpu(s->tx_max_collisions);
+		ns->tx_window_errors += le32_to_cpu(s->tx_late_collisions);
+		ns->tx_carrier_errors += le32_to_cpu(s->tx_lost_crs);
+		ns->tx_fifo_errors += le32_to_cpu(s->tx_underruns);
+		ns->collisions += nic->tx_collisions;
+		ns->tx_errors += le32_to_cpu(s->tx_max_collisions) +
+			le32_to_cpu(s->tx_lost_crs);
+		ns->rx_dropped += le32_to_cpu(s->rx_resource_errors);
+		ns->rx_length_errors += le32_to_cpu(s->rx_short_frame_errors);
+		ns->rx_over_errors += le32_to_cpu(s->rx_resource_errors);
+		ns->rx_crc_errors += le32_to_cpu(s->rx_crc_errors);
+		ns->rx_frame_errors += le32_to_cpu(s->rx_alignment_errors);
+		ns->rx_fifo_errors += le32_to_cpu(s->rx_overrun_errors);
+		ns->rx_errors += le32_to_cpu(s->rx_crc_errors) +
+			le32_to_cpu(s->rx_alignment_errors) +
+			le32_to_cpu(s->rx_short_frame_errors) +
+			le32_to_cpu(s->rx_cdt_errors);
+		nic->tx_deferred += le32_to_cpu(s->tx_deferred);
+		nic->tx_single_collisions +=
+			le32_to_cpu(s->tx_single_collisions);
+		nic->tx_multiple_collisions +=
+			le32_to_cpu(s->tx_multiple_collisions);
+		if(nic->mac >= mac_82558_D101_A4) {
+			nic->tx_fc_pause += le32_to_cpu(s->fc_xmt_pause);
+			nic->rx_fc_pause += le32_to_cpu(s->fc_rcv_pause);
+			nic->rx_fc_unsupported +=
+				le32_to_cpu(s->fc_rcv_unsupported);
+			if(nic->mac >= mac_82559_D101M) {
+				nic->tx_tco_frames +=
+					le16_to_cpu(s->xmt_tco_frames);
+				nic->rx_tco_frames +=
+					le16_to_cpu(s->rcv_tco_frames);
+			}
+		}
+	}
+
+	e100_exec_cmd(nic, cuc_dump_reset, 0);
+}
+
+static void e100_adjust_adaptive_ifs(struct nic *nic, int speed, int duplex)
+{
+	/* Adjust inter-frame-spacing (IFS) between two transmits if
+	 * we're getting collisions on a half-duplex connection. */
+
+	if(duplex == DUPLEX_HALF) {
+		u32 prev = nic->adaptive_ifs;
+		u32 min_frames = (speed == SPEED_100) ? 1000 : 100;
+
+		if((nic->tx_frames / 32 < nic->tx_collisions) &&
+		   (nic->tx_frames > min_frames)) {
+			if(nic->adaptive_ifs < 60)
+				nic->adaptive_ifs += 5;
+		} else if (nic->tx_frames < min_frames) {
+			if(nic->adaptive_ifs >= 5)
+				nic->adaptive_ifs -= 5;
+		}
+		if(nic->adaptive_ifs != prev)
+			e100_exec_cb(nic, NULL, e100_configure);
+	}
+}
+
+static void e100_watchdog(unsigned long data)
+{
+	struct nic *nic = (struct nic *)data;
+	struct ethtool_cmd cmd;
+
+	DPRINTK(TIMER, DEBUG, "right now = %ld\n", jiffies);
+
+	/* mii library handles link maintenance tasks */
+
+	mii_ethtool_gset(&nic->mii, &cmd);
+
+	if(mii_link_ok(&nic->mii) && !netif_carrier_ok(nic->netdev)) {
+		DPRINTK(LINK, INFO, "link up, %sMbps, %s-duplex\n",
+			cmd.speed == SPEED_100 ? "100" : "10",
+			cmd.duplex == DUPLEX_FULL ? "full" : "half");
+	} else if(!mii_link_ok(&nic->mii) && netif_carrier_ok(nic->netdev)) {
+		DPRINTK(LINK, INFO, "link down\n");
+	}
+
+	mii_check_link(&nic->mii);
+
+	/* Software generated interrupt to recover from (rare) Rx
+	 * allocation failure */
+	writeb(irq_sw_gen, &nic->csr->scb.cmd_hi);
+	e100_write_flush(nic);
+
+	e100_update_stats(nic);
+	e100_adjust_adaptive_ifs(nic, cmd.speed, cmd.duplex);
+
+	if(nic->mac <= mac_82557_D100_C)
+		/* Issue a multicast command to workaround a 557 lock up */
+		e100_set_multicast_list(nic->netdev);
+
+	mod_timer(&nic->watchdog, jiffies + E100_WATCHDOG_PERIOD);
+}
+
+static inline void e100_xmit_prepare(struct nic *nic, struct cb *cb,
+	struct sk_buff *skb)
+{
+	cb->command = nic->tx_command;
+	cb->u.tcb.tbd_array = cb->dma_addr + offsetof(struct cb, u.tcb.tbd);
+	cb->u.tcb.tcb_byte_count = 0;
+	cb->u.tcb.threshold = nic->tx_threshold;
+	cb->u.tcb.tbd_count = 1;
+	cb->u.tcb.tbd.buf_addr = cpu_to_le32(pci_map_single(nic->pdev,
+		skb->data, skb->len, PCI_DMA_TODEVICE));
+	cb->u.tcb.tbd.size = cpu_to_le16(skb->len);
+}
+
+static int e100_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
+{
+	struct nic *nic = netdev->priv;
+	int err = e100_exec_cb(nic, skb, e100_xmit_prepare);
+
+	switch(err) {
+	case -ENOSPC:
+		/* We queued the skb, but now we're out of space. */
+		netif_stop_queue(netdev);
+		break;
+	case -ENOMEM:
+		/* This is a hard error - log it. */
+		DPRINTK(TX_ERR, DEBUG, "Out of Tx resources, returning skb\n");
+		netif_stop_queue(netdev);
+		return 1;
+	}
+
+	netdev->trans_start = jiffies;
+	return 0;
+}
+
+static inline int e100_tx_clean(struct nic *nic)
+{
+	struct cb *cb;
+	int tx_cleaned = 0;
+
+	spin_lock(&nic->cb_lock);
+
+	DPRINTK(TX_DONE, DEBUG, "cb->status = 0x%04X\n",
+		nic->cb_to_clean->status);
+
+	/* Clean CBs marked complete */
+	for(cb = nic->cb_to_clean;
+	    cb->status & cpu_to_le16(cb_complete);
+	    cb = nic->cb_to_clean = cb->next) {
+		if(likely(cb->skb)) {
+			nic->net_stats.tx_packets++;
+			nic->net_stats.tx_bytes += cb->skb->len;
+
+			pci_unmap_single(nic->pdev,
+				le32_to_cpu(cb->u.tcb.tbd.buf_addr),
+				le16_to_cpu(cb->u.tcb.tbd.size),
+				PCI_DMA_TODEVICE);
+			dev_kfree_skb_any(cb->skb);
+			tx_cleaned = 1;
+		}
+		cb->status = 0;
+		nic->cbs_avail++;
+	}
+
+	spin_unlock(&nic->cb_lock);
+
+	/* Recover from running out of Tx resources in xmit_frame */
+	if(unlikely(tx_cleaned && netif_queue_stopped(nic->netdev)))
+		netif_wake_queue(nic->netdev);
+
+	return tx_cleaned;
+}
+
+static void e100_clean_cbs(struct nic *nic)
+{
+	if(nic->cbs) {
+		while(nic->cb_to_clean != nic->cb_to_use) {
+			struct cb *cb = nic->cb_to_clean;
+			if(cb->skb) {
+				pci_unmap_single(nic->pdev,
+					le32_to_cpu(cb->u.tcb.tbd.buf_addr),
+					le16_to_cpu(cb->u.tcb.tbd.size),
+					PCI_DMA_TODEVICE);
+				dev_kfree_skb(cb->skb);
+			}
+			nic->cb_to_clean = nic->cb_to_clean->next;
+		}
+		nic->cbs_avail = nic->params.cbs.count;
+		pci_free_consistent(nic->pdev,
+			sizeof(struct cb) * nic->params.cbs.count,
+			nic->cbs, nic->cbs_dma_addr);
+		nic->cbs = NULL;
+		nic->cbs_avail = 0;
+	}
+	nic->cuc_cmd = cuc_start;
+	nic->cb_to_use = nic->cb_to_send = nic->cb_to_clean =
+		nic->cbs;
+}
+
+static int e100_alloc_cbs(struct nic *nic)
+{
+	struct cb *cb;
+	unsigned int i, count = nic->params.cbs.count;
+
+	nic->cuc_cmd = cuc_start;
+	nic->cb_to_use = nic->cb_to_send = nic->cb_to_clean = NULL;
+	nic->cbs_avail = 0;
+
+	nic->cbs = pci_alloc_consistent(nic->pdev,
+		sizeof(struct cb) * count, &nic->cbs_dma_addr);
+	if(!nic->cbs)
+		return -ENOMEM;
+
+	for(cb = nic->cbs, i = 0; i < count; cb++, i++) {
+		cb->next = (i + 1 < count) ? cb + 1 : nic->cbs;
+		cb->prev = (i == 0) ? nic->cbs + count - 1 : cb - 1;
+
+		cb->dma_addr = nic->cbs_dma_addr + i * sizeof(struct cb);
+		cb->link = cpu_to_le32(nic->cbs_dma_addr +
+			((i+1) % count) * sizeof(struct cb));
+	}
+
+	nic->cb_to_use = nic->cb_to_send = nic->cb_to_clean = nic->cbs;
+	nic->cbs_avail = count;
+
+	return 0;
+}
+
+static inline void e100_start_receiver(struct nic *nic)
+{
+	/* (Re)start RU if suspended or idle and RFA is non-NULL */
+	if(!nic->ru_running && nic->rx_to_clean->skb) {
+		e100_exec_cmd(nic, ruc_start, nic->rx_to_clean->dma_addr);
+		nic->ru_running = 1;
+	}
+}
+
+#define RFD_BUF_LEN (sizeof(struct rfd) + VLAN_ETH_FRAME_LEN)
+static inline int e100_rx_alloc_skb(struct nic *nic, struct rx *rx)
+{
+	unsigned int rx_offset = 2; /* u32 align protocol headers */
+
+	if(!(rx->skb = dev_alloc_skb(RFD_BUF_LEN + rx_offset)))
+		return -ENOMEM;
+
+	/* Align, init, and map the RFA. */
+	rx->skb->dev = nic->netdev;
+	skb_reserve(rx->skb, rx_offset);
+	memcpy(rx->skb->data, &nic->blank_rfd, sizeof(struct rfd));
+	rx->dma_addr = pci_map_single(nic->pdev, rx->skb->data,
+		RFD_BUF_LEN, PCI_DMA_FROMDEVICE);
+
+	/* Link the RFD to end of RFA by linking previous RFD to
+	 * this one, and clearing EL bit of previous.  */
+	if(rx->prev->skb) {
+		struct rfd *prev_rfd = (struct rfd *)rx->prev->skb->data;
+		put_unaligned(cpu_to_le32(rx->dma_addr),
+			(u32 *)&prev_rfd->link);
+		prev_rfd->command &= ~cpu_to_le16(cb_el);
+		pci_dma_sync_single(nic->pdev, rx->prev->dma_addr,
+			sizeof(struct rfd), PCI_DMA_TODEVICE);
+	}
+
+	return 0;
+}
+
+static inline int e100_rx_indicate(struct nic *nic, struct rx *rx,
+	unsigned int *work_done, unsigned int work_to_do)
+{
+	struct sk_buff *skb = rx->skb;
+	struct rfd *rfd = (struct rfd *)skb->data;
+	u16 rfd_status, actual_size;
+
+	if(unlikely(work_done && *work_done >= work_to_do))
+		return -EAGAIN;
+
+	/* Need to sync before taking a peek at cb_complete bit */
+	pci_dma_sync_single(nic->pdev, rx->dma_addr,
+		sizeof(struct rfd), PCI_DMA_FROMDEVICE);
+	rfd_status = le16_to_cpu(rfd->status);
+
+	DPRINTK(RX_STATUS, DEBUG, "status=0x%04X\n", rfd_status);
+
+	/* If data isn't ready, nothing to indicate */
+	if(unlikely(!(rfd_status & cb_complete)))
+       		return -EAGAIN;
+
+	/* Get actual data size */
+	actual_size = le16_to_cpu(rfd->actual_size) & 0x3FFF;
+	if(unlikely(actual_size > RFD_BUF_LEN - sizeof(struct rfd)))
+		actual_size = RFD_BUF_LEN - sizeof(struct rfd);
+
+	/* Get data */
+	pci_dma_sync_single(nic->pdev, rx->dma_addr,
+		sizeof(struct rfd) + actual_size,
+		PCI_DMA_FROMDEVICE);
+	pci_unmap_single(nic->pdev, rx->dma_addr,
+		RFD_BUF_LEN, PCI_DMA_FROMDEVICE);
+
+	/* Pull off the RFD and put the actual data (minus eth hdr) */
+	skb_reserve(skb, sizeof(struct rfd));
+	skb_put(skb, actual_size);
+	skb->protocol = eth_type_trans(skb, nic->netdev);
+
+	if(unlikely(!(rfd_status & cb_ok)) ||
+	   actual_size > nic->netdev->mtu + VLAN_ETH_HLEN) {
+		/* Don't indicate if errors */
+		dev_kfree_skb_any(skb);
+	} else {
+		nic->net_stats.rx_packets++;
+		nic->net_stats.rx_bytes += actual_size;
+		nic->netdev->last_rx = jiffies;
+#ifdef CONFIG_E100_NAPI
+		netif_receive_skb(skb);
+#else
+		netif_rx(skb);
+#endif
+		if(work_done)
+			(*work_done)++;
+	}
+
+	rx->skb = NULL;
+
+	return 0;
+}
+
+static inline void e100_rx_clean(struct nic *nic, unsigned int *work_done,
+	unsigned int work_to_do)
+{
+	struct rx *rx;
+
+	/* Indicate newly arrived packets */
+	for(rx = nic->rx_to_clean; rx->skb; rx = nic->rx_to_clean = rx->next) {
+		if(e100_rx_indicate(nic, rx, work_done, work_to_do))
+			break; /* No more to clean */
+	}
+
+	/* Alloc new skbs to refill list */
+	for(rx = nic->rx_to_use; !rx->skb; rx = nic->rx_to_use = rx->next) {
+		if(unlikely(e100_rx_alloc_skb(nic, rx)))
+			break; /* Better luck next time (see watchdog) */
+	}
+
+	e100_start_receiver(nic);
+}
+
+static void e100_rx_clean_list(struct nic *nic)
+{
+	struct rx *rx;
+	unsigned int i, count = nic->params.rfds.count;
+
+	if(nic->rxs) {
+		for(rx = nic->rxs, i = 0; i < count; rx++, i++) {
+			if(rx->skb) {
+				pci_unmap_single(nic->pdev, rx->dma_addr,
+					RFD_BUF_LEN, PCI_DMA_FROMDEVICE);
+				dev_kfree_skb(rx->skb);
+			}
+		}
+		kfree(nic->rxs);
+		nic->rxs = NULL;
+	}
+
+	nic->rx_to_use = nic->rx_to_clean = NULL;
+	nic->ru_running = 0;
+}
+
+static int e100_rx_alloc_list(struct nic *nic)
+{
+	struct rx *rx;
+	unsigned int i, count = nic->params.rfds.count;
+
+	nic->rx_to_use = nic->rx_to_clean = NULL;
+
+	if(!(nic->rxs = kmalloc(sizeof(struct rx) * count, GFP_ATOMIC)))
+		return -ENOMEM;
+	memset(nic->rxs, 0, sizeof(struct rx) * count);
+
+	for(rx = nic->rxs, i = 0; i < count; rx++, i++) {
+		rx->next = (i + 1 < count) ? rx + 1 : nic->rxs;
+		rx->prev = (i == 0) ? nic->rxs + count - 1 : rx - 1;
+		if(e100_rx_alloc_skb(nic, rx)) {
+			e100_rx_clean_list(nic);
+			return -ENOMEM;
+		}
+	}
+
+	nic->rx_to_use = nic->rx_to_clean = nic->rxs;
+
+	return 0;
+}
+
+static irqreturn_t e100_intr(int irq, void *dev_id, struct pt_regs *regs)
+{
+	struct net_device *netdev = dev_id;
+	struct nic *nic = netdev->priv;
+	u8 stat_ack = readb(&nic->csr->scb.stat_ack);
+
+	DPRINTK(INTR, DEBUG, "stat_ack = 0x%02X\n", stat_ack);
+
+	if(stat_ack == stat_ack_not_ours ||	/* Not our interrupt */
+	   stat_ack == stat_ack_not_present)	/* Hardware is ejected */
+		return IRQ_NONE;
+
+	/* Ack interrupt(s) */
+	writeb(stat_ack, &nic->csr->scb.stat_ack);
+
+	/* We hit Receive No Resource (RNR); restart RU after cleaning */
+	if(stat_ack & stat_ack_rnr)
+		nic->ru_running = 0;
+
+#ifdef CONFIG_E100_NAPI
+	e100_disable_irq(nic);
+	netif_rx_schedule(netdev);
+#else
+	if(stat_ack & stat_ack_rx)
+		e100_rx_clean(nic, NULL, 0);
+	if(stat_ack & stat_ack_tx)
+		e100_tx_clean(nic);
+#endif
+
+	return IRQ_HANDLED;
+}
+
+#ifdef CONFIG_E100_NAPI
+static int e100_poll(struct net_device *netdev, int *budget)
+{
+	struct nic *nic = netdev->priv;
+	unsigned int work_to_do = min(netdev->quota, *budget);
+	unsigned int work_done = 0;
+	int tx_cleaned;
+
+	e100_rx_clean(nic, &work_done, work_to_do);
+	tx_cleaned = e100_tx_clean(nic);
+
+	/* If no Rx and Tx cleanup work was done, exit polling mode. */
+	if((!tx_cleaned && (work_done == 0)) || !netif_running(netdev)) {
+		netif_rx_complete(netdev);
+		e100_enable_irq(nic);
+		return 0;
+	}
+
+	*budget -= work_done;
+	netdev->quota -= work_done;
+
+	return 1;
+}
+#endif
+
+#ifdef CONFIG_NET_POLL_CONTROLLER
+static void e100_netpoll(struct net_device *netdev)
+{
+	struct nic *nic = netdev->priv;
+	e100_disable_irq(nic);
+	e100_intr(nic->pdev->irq, netdev, NULL);
+	e100_enable_irq(nic);
+}
+#endif
+
+static struct net_device_stats *e100_get_stats(struct net_device *netdev)
+{
+	struct nic *nic = netdev->priv;
+	return &nic->net_stats;
+}
+
+static int e100_set_mac_address(struct net_device *netdev, void *p)
+{
+	struct nic *nic = netdev->priv;
+	struct sockaddr *addr = p;
+
+	if (!is_valid_ether_addr(addr->sa_data))
+		return -EADDRNOTAVAIL;
+
+	memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
+	e100_exec_cb(nic, NULL, e100_setup_iaaddr);
+
+	return 0;
+}
+
+static int e100_change_mtu(struct net_device *netdev, int new_mtu)
+{
+	if(new_mtu < ETH_ZLEN || new_mtu > ETH_DATA_LEN)
+		return -EINVAL;
+	netdev->mtu = new_mtu;
+	return 0;
+}
+
+static int e100_asf(struct nic *nic)
+{
+	/* ASF can be enabled from eeprom */
+	return((nic->pdev->device >= 0x1050) && (nic->pdev->device <= 0x1055) &&
+	   (nic->eeprom[eeprom_config_asf] & eeprom_asf) &&
+	   !(nic->eeprom[eeprom_config_asf] & eeprom_gcl) &&
+	   ((nic->eeprom[eeprom_smbus_addr] & 0xFF) != 0xFE));
+}
+
+static int e100_up(struct nic *nic)
+{
+	int err;
+
+	if((err = e100_rx_alloc_list(nic)))
+		return err;
+	if((err = e100_alloc_cbs(nic)))
+		goto err_rx_clean_list;
+	if((err = e100_hw_init(nic)))
+		goto err_clean_cbs;
+	e100_set_multicast_list(nic->netdev);
+	e100_start_receiver(nic);
+	netif_start_queue(nic->netdev);
+	mod_timer(&nic->watchdog, jiffies);
+	if((err = request_irq(nic->pdev->irq, e100_intr, SA_SHIRQ,
+		nic->netdev->name, nic->netdev)))
+		goto err_no_irq;
+	e100_enable_irq(nic);
+	return 0;
+
+err_no_irq:
+	del_timer_sync(&nic->watchdog);
+	netif_stop_queue(nic->netdev);
+err_clean_cbs:
+	e100_clean_cbs(nic);
+err_rx_clean_list:
+	e100_rx_clean_list(nic);
+	return err;
+}
+
+static void e100_down(struct nic *nic)
+{
+	e100_hw_reset(nic);
+	free_irq(nic->pdev->irq, nic->netdev);
+	del_timer_sync(&nic->watchdog);
+	netif_carrier_off(nic->netdev);
+	netif_stop_queue(nic->netdev);
+	e100_clean_cbs(nic);
+	e100_rx_clean_list(nic);
+}
+
+static void e100_tx_timeout(struct net_device *netdev)
+{
+	struct nic *nic = netdev->priv;
+
+	DPRINTK(TX_ERR, DEBUG, "scb.status=0x%02X\n",
+		readb(&nic->csr->scb.status));
+	e100_down(netdev->priv);
+	e100_up(netdev->priv);
+}
+
+static int e100_loopback_test(struct nic *nic, enum loopback loopback_mode)
+{
+	int err;
+	struct sk_buff *skb;
+
+	/* Use driver resources to perform internal MAC or PHY
+	 * loopback test.  A single packet is prepared and transmitted
+	 * in loopback mode, and the test passes if the received
+	 * packet compares byte-for-byte to the transmitted packet. */
+
+	if((err = e100_rx_alloc_list(nic)))
+		return err;
+	if((err = e100_alloc_cbs(nic)))
+		goto err_clean_rx;
+
+	/* ICH PHY loopback is broken so do MAC loopback instead */
+	if(nic->flags & ich && loopback_mode == lb_phy)
+		loopback_mode = lb_mac;
+
+	nic->loopback = loopback_mode;
+	if((err = e100_hw_init(nic)))
+		goto err_loopback_none;
+
+	if(loopback_mode == lb_phy)
+		mdio_write(nic->netdev, nic->mii.phy_id, MII_BMCR,
+			BMCR_LOOPBACK);
+
+	e100_start_receiver(nic);
+
+	if(!(skb = dev_alloc_skb(ETH_DATA_LEN))) {
+		err = -ENOMEM;
+		goto err_loopback_none;
+	}
+	skb_put(skb, ETH_DATA_LEN);
+	memset(skb->data, 0xFF, ETH_DATA_LEN);
+	e100_xmit_frame(skb, nic->netdev);
+
+	set_current_state(TASK_UNINTERRUPTIBLE);
+	schedule_timeout(HZ / 100 + 1);
+
+	if(memcmp(nic->rx_to_clean->skb->data + sizeof(struct rfd),
+	   skb->data, ETH_DATA_LEN))
+       		err = -EAGAIN;
+
+err_loopback_none:
+	mdio_write(nic->netdev, nic->mii.phy_id, MII_BMCR, 0);
+	nic->loopback = lb_none;
+	e100_hw_init(nic);
+	e100_clean_cbs(nic);
+err_clean_rx:
+	e100_rx_clean_list(nic);
+	return err;
+}
+
+#define MII_LED_CONTROL	0x1B
+static void e100_blink_led(unsigned long data)
+{
+	struct nic *nic = (struct nic *)data;
+	enum led_state {
+		led_on     = 0x01,
+		led_off    = 0x04,
+		led_on_559 = 0x05,
+		led_on_557 = 0x07,
+	};
+
+	nic->leds = (nic->leds & led_on) ? led_off :
+		(nic->mac < mac_82559_D101M) ? led_on_557 : led_on_559;
+	mdio_write(nic->netdev, nic->mii.phy_id, MII_LED_CONTROL, nic->leds);
+	mod_timer(&nic->blink_timer, jiffies + HZ / 4);
+}
+
+static int e100_get_settings(struct net_device *netdev, struct ethtool_cmd *cmd)
+{
+	struct nic *nic = netdev->priv;
+	return mii_ethtool_gset(&nic->mii, cmd);
+}
+
+static int e100_set_settings(struct net_device *netdev, struct ethtool_cmd *cmd)
+{
+	struct nic *nic = netdev->priv;
+	int err;
+
+	mdio_write(netdev, nic->mii.phy_id, MII_BMCR, BMCR_RESET);
+	err = mii_ethtool_sset(&nic->mii, cmd);
+	e100_exec_cb(nic, NULL, e100_configure);
+
+	return err;
+}
+
+static void e100_get_drvinfo(struct net_device *netdev,
+	struct ethtool_drvinfo *info)
+{
+	struct nic *nic = netdev->priv;
+	strcpy(info->driver, DRV_NAME);
+	strcpy(info->version, DRV_VERSION);
+	strcpy(info->fw_version, "N/A");
+	strcpy(info->bus_info, pci_name(nic->pdev));
+}
+
+static int e100_get_regs_len(struct net_device *netdev)
+{
+	struct nic *nic = netdev->priv;
+#define E100_PHY_REGS		0x1C
+#define E100_REGS_LEN		1 + E100_PHY_REGS + \
+	sizeof(nic->mem->dump_buf) / sizeof(u32)
+	return E100_REGS_LEN * sizeof(u32);
+}
+
+static void e100_get_regs(struct net_device *netdev,
+	struct ethtool_regs *regs, void *p)
+{
+	struct nic *nic = netdev->priv;
+	u32 *buff = p;
+	int i;
+
+	regs->version = (1 << 24) | nic->rev_id;
+	buff[0] = readb(&nic->csr->scb.cmd_hi) << 24 |
+		readb(&nic->csr->scb.cmd_lo) << 16 |
+		readw(&nic->csr->scb.status);
+	for(i = E100_PHY_REGS; i >= 0; i--)
+		buff[1 + E100_PHY_REGS - i] =
+			mdio_read(netdev, nic->mii.phy_id, i);
+	memset(nic->mem->dump_buf, 0, sizeof(nic->mem->dump_buf));
+	e100_exec_cb(nic, NULL, e100_dump);
+	set_current_state(TASK_UNINTERRUPTIBLE);
+	schedule_timeout(HZ / 100 + 1);
+	memcpy(&buff[2 + E100_PHY_REGS], nic->mem->dump_buf,
+		sizeof(nic->mem->dump_buf));
+}
+
+static void e100_get_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
+{
+	struct nic *nic = netdev->priv;
+	wol->supported = (nic->mac >= mac_82558_D101_A4) ?  WAKE_MAGIC : 0;
+	wol->wolopts = (nic->flags & wol_magic) ? WAKE_MAGIC : 0;
+}
+
+static int e100_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
+{
+	struct nic *nic = netdev->priv;
+
+	if(wol->wolopts != WAKE_MAGIC && wol->wolopts != 0)
+		return -EOPNOTSUPP;
+
+	if(wol->wolopts)
+		nic->flags |= wol_magic;
+	else
+		nic->flags &= ~wol_magic;
+
+	pci_enable_wake(nic->pdev, 0, nic->flags & (wol_magic | e100_asf(nic)));
+	e100_exec_cb(nic, NULL, e100_configure);
+
+	return 0;
+}
+
+static u32 e100_get_msglevel(struct net_device *netdev)
+{
+	struct nic *nic = netdev->priv;
+	return nic->msg_enable;
+}
+
+static void e100_set_msglevel(struct net_device *netdev, u32 value)
+{
+	struct nic *nic = netdev->priv;
+	nic->msg_enable = value;
+}
+
+static int e100_nway_reset(struct net_device *netdev)
+{
+	struct nic *nic = netdev->priv;
+	return mii_nway_restart(&nic->mii);
+}
+
+static u32 e100_get_link(struct net_device *netdev)
+{
+	struct nic *nic = netdev->priv;
+	return mii_link_ok(&nic->mii);
+}
+
+static int e100_get_eeprom_len(struct net_device *netdev)
+{
+	struct nic *nic = netdev->priv;
+	return nic->eeprom_wc << 1;
+}
+
+#define E100_EEPROM_MAGIC	0x1234
+static int e100_get_eeprom(struct net_device *netdev,
+	struct ethtool_eeprom *eeprom, u8 *bytes)
+{
+	struct nic *nic = netdev->priv;
+
+	eeprom->magic = E100_EEPROM_MAGIC;
+	memcpy(bytes, &((u8 *)nic->eeprom)[eeprom->offset], eeprom->len);
+
+	return 0;
+}
+
+static int e100_set_eeprom(struct net_device *netdev,
+	struct ethtool_eeprom *eeprom, u8 *bytes)
+{
+	struct nic *nic = netdev->priv;
+
+	if(eeprom->magic != E100_EEPROM_MAGIC)
+		return -EINVAL;
+	memcpy(&((u8 *)nic->eeprom)[eeprom->offset], bytes, eeprom->len);
+
+	return e100_eeprom_save(nic, eeprom->offset >> 1,
+		(eeprom->len >> 1) + 1);
+}
+
+static void e100_get_ringparam(struct net_device *netdev,
+	struct ethtool_ringparam *ring)
+{
+	struct nic *nic = netdev->priv;
+	struct param_range *rfds = &nic->params.rfds;
+	struct param_range *cbs = &nic->params.cbs;
+
+	ring->rx_max_pending = rfds->max;
+	ring->tx_max_pending = cbs->max;
+	ring->rx_mini_max_pending = 0;
+	ring->rx_jumbo_max_pending = 0;
+	ring->rx_pending = rfds->count;
+	ring->tx_pending = cbs->count;
+	ring->rx_mini_pending = 0;
+	ring->rx_jumbo_pending = 0;
+}
+
+static int e100_set_ringparam(struct net_device *netdev,
+	struct ethtool_ringparam *ring)
+{
+	struct nic *nic = netdev->priv;
+	struct param_range *rfds = &nic->params.rfds;
+	struct param_range *cbs = &nic->params.cbs;
+
+	if(netif_running(netdev))
+		e100_down(nic);
+	rfds->count = max(ring->rx_pending, rfds->min);
+	rfds->count = min(rfds->count, rfds->max);
+	cbs->count = max(ring->tx_pending, cbs->min);
+	cbs->count = min(cbs->count, cbs->max);
+	if(netif_running(netdev))
+		e100_up(nic);
+
+	return 0;
+}
+
+static const char e100_gstrings_test[][ETH_GSTRING_LEN] = {
+	"Link test     (on/offline)",
+	"Eeprom test   (on/offline)",
+	"Self test        (offline)",
+	"Mac loopback     (offline)",
+	"Phy loopback     (offline)",
+};
+#define E100_TEST_LEN	sizeof(e100_gstrings_test) / ETH_GSTRING_LEN
+
+static int e100_diag_test_count(struct net_device *netdev)
+{
+	return E100_TEST_LEN;
+}
+
+static void e100_diag_test(struct net_device *netdev,
+	struct ethtool_test *test, u64 *data)
+{
+	struct nic *nic = netdev->priv;
+	int i;
+
+	memset(data, 0, E100_TEST_LEN * sizeof(u64));
+	data[0] = !mii_link_ok(&nic->mii);
+	data[1] = e100_eeprom_load(nic);
+	if(test->flags & ETH_TEST_FL_OFFLINE) {
+		if(netif_running(netdev))
+			e100_down(nic);
+		data[2] = e100_self_test(nic);
+		data[3] = e100_loopback_test(nic, lb_mac);
+		data[4] = e100_loopback_test(nic, lb_phy);
+		if(netif_running(netdev))
+			e100_up(nic);
+	}
+	for(i = 0; i < E100_TEST_LEN; i++)
+		test->flags |= data[i] ? ETH_TEST_FL_FAILED : 0;
+}
+
+static int e100_phys_id(struct net_device *netdev, u32 data)
+{
+	struct nic *nic = netdev->priv;
+
+	if(!data || data > (u32)(MAX_SCHEDULE_TIMEOUT / HZ))
+		data = (u32)(MAX_SCHEDULE_TIMEOUT / HZ);
+	mod_timer(&nic->blink_timer, jiffies);
+	set_current_state(TASK_INTERRUPTIBLE);
+	schedule_timeout(data * HZ);
+	del_timer_sync(&nic->blink_timer);
+	mdio_write(netdev, nic->mii.phy_id, MII_LED_CONTROL, 0);
+
+	return 0;
+}
+
+static const char e100_gstrings_stats[][ETH_GSTRING_LEN] = {
+	"rx_packets", "tx_packets", "rx_bytes", "tx_bytes", "rx_errors",
+	"tx_errors", "rx_dropped", "tx_dropped", "multicast", "collisions",
+	"rx_length_errors", "rx_over_errors", "rx_crc_errors",
+	"rx_frame_errors", "rx_fifo_errors", "rx_missed_errors",
+	"tx_aborted_errors", "tx_carrier_errors", "tx_fifo_errors",
+	"tx_heartbeat_errors", "tx_window_errors",
+	/* device-specific stats */
+	"tx_deferred", "tx_single_collisions", "tx_multi_collisions",
+	"tx_flow_control_pause", "rx_flow_control_pause",
+	"rx_flow_control_unsupported", "tx_tco_packets", "rx_tco_packets",
+};
+#define E100_NET_STATS_LEN	21
+#define E100_STATS_LEN	sizeof(e100_gstrings_stats) / ETH_GSTRING_LEN
+
+static int e100_get_stats_count(struct net_device *netdev)
+{
+	return E100_STATS_LEN;
+}
+
+static void e100_get_ethtool_stats(struct net_device *netdev,
+	struct ethtool_stats *stats, u64 *data)
+{
+	struct nic *nic = netdev->priv;
+	int i;
+
+	for(i = 0; i < E100_NET_STATS_LEN; i++)
+		data[i] = ((unsigned long *)&nic->net_stats)[i];
+
+	data[i++] = nic->tx_deferred;
+	data[i++] = nic->tx_single_collisions;
+	data[i++] = nic->tx_multiple_collisions;
+	data[i++] = nic->tx_fc_pause;
+	data[i++] = nic->rx_fc_pause;
+	data[i++] = nic->rx_fc_unsupported;
+	data[i++] = nic->tx_tco_frames;
+	data[i++] = nic->rx_tco_frames;
+}
+
+static void e100_get_strings(struct net_device *netdev, u32 stringset, u8 *data)
+{
+	switch(stringset) {
+	case ETH_SS_TEST:
+		memcpy(data, *e100_gstrings_test, sizeof(e100_gstrings_test));
+		break;
+	case ETH_SS_STATS:
+		memcpy(data, *e100_gstrings_stats, sizeof(e100_gstrings_stats));
+		break;
+	}
+}
+
+static struct ethtool_ops e100_ethtool_ops = {
+	.get_settings		= e100_get_settings,
+	.set_settings		= e100_set_settings,
+	.get_drvinfo		= e100_get_drvinfo,
+	.get_regs_len		= e100_get_regs_len,
+	.get_regs		= e100_get_regs,
+	.get_wol		= e100_get_wol,
+	.set_wol		= e100_set_wol,
+	.get_msglevel		= e100_get_msglevel,
+	.set_msglevel		= e100_set_msglevel,
+	.nway_reset		= e100_nway_reset,
+	.get_link		= e100_get_link,
+	.get_eeprom_len		= e100_get_eeprom_len,
+	.get_eeprom		= e100_get_eeprom,
+	.set_eeprom		= e100_set_eeprom,
+	.get_ringparam		= e100_get_ringparam,
+	.set_ringparam		= e100_set_ringparam,
+	.self_test_count	= e100_diag_test_count,
+	.self_test		= e100_diag_test,
+	.get_strings		= e100_get_strings,
+	.phys_id		= e100_phys_id,
+	.get_stats_count	= e100_get_stats_count,
+	.get_ethtool_stats	= e100_get_ethtool_stats,
+};
+
+static int e100_do_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
+{
+	struct nic *nic = netdev->priv;
+	struct mii_ioctl_data *mii = (struct mii_ioctl_data *)&ifr->ifr_data;
+
+	return generic_mii_ioctl(&nic->mii, mii, cmd, NULL);
+}
+
+static int e100_alloc(struct nic *nic)
+{
+	nic->mem = pci_alloc_consistent(nic->pdev, sizeof(struct mem),
+		&nic->dma_addr);
+	return nic->mem ? 0 : -ENOMEM;
+}
+
+static void e100_free(struct nic *nic)
+{
+	if(nic->mem) {
+		pci_free_consistent(nic->pdev, sizeof(struct mem),
+			nic->mem, nic->dma_addr);
+		nic->mem = NULL;
+	}
+}
+
+static int e100_open(struct net_device *netdev)
+{
+	struct nic *nic = netdev->priv;
+	int err = 0;
+
+	netif_carrier_off(netdev);
+	if((err = e100_up(nic)))
+		DPRINTK(IFUP, ERR, "Cannot open interface, aborting.\n");
+	return err;
+}
+
+static int e100_close(struct net_device *netdev)
+{
+	e100_down(netdev->priv);
+	return 0;
+}
+
+static int __devinit e100_probe(struct pci_dev *pdev,
+	const struct pci_device_id *ent)
+{
+	struct net_device *netdev;
+	struct nic *nic;
+	int err;
+
+	if(!(netdev = alloc_etherdev(sizeof(struct nic)))) {
+		if(((1 << debug) - 1) & NETIF_MSG_PROBE)
+			printk(KERN_ERR PFX "Etherdev alloc failed, abort.\n");
+		return -ENOMEM;
+	}
+
+	netdev->open = e100_open;
+	netdev->stop = e100_close;
+	netdev->hard_start_xmit = e100_xmit_frame;
+	netdev->get_stats = e100_get_stats;
+	netdev->set_multicast_list = e100_set_multicast_list;
+	netdev->set_mac_address = e100_set_mac_address;
+	netdev->change_mtu = e100_change_mtu;
+	netdev->do_ioctl = e100_do_ioctl;
+	SET_ETHTOOL_OPS(netdev, &e100_ethtool_ops);
+	netdev->tx_timeout = e100_tx_timeout;
+	netdev->watchdog_timeo = E100_WATCHDOG_PERIOD;
+#ifdef CONFIG_E100_NAPI
+	netdev->poll = e100_poll;
+	netdev->weight = E100_NAPI_WEIGHT;
+#endif
+#ifdef CONFIG_NET_POLL_CONTROLLER
+	netdev->poll_controller = e100_netpoll;
+#endif
+
+	nic = netdev->priv;
+	nic->netdev = netdev;
+	nic->pdev = pdev;
+	nic->msg_enable = (1 << debug) - 1;
+	pci_set_drvdata(pdev, netdev);
+
+	if((err = pci_enable_device(pdev))) {
+		DPRINTK(PROBE, ERR, "Cannot enable PCI device, aborting.\n");
+		goto err_out_free_dev;
+	}
+
+	if(!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM)) {
+		DPRINTK(PROBE, ERR, "Cannot find proper PCI device "
+			"base address, aborting.\n");
+		err = -ENODEV;
+		goto err_out_disable_pdev;
+	}
+
+	if((err = pci_request_regions(pdev, DRV_NAME))) {
+		DPRINTK(PROBE, ERR, "Cannot obtain PCI resources, aborting.\n");
+		goto err_out_disable_pdev;
+	}
+
+	pci_set_master(pdev);
+
+	if((err = pci_set_dma_mask(pdev, 0xFFFFFFFFULL))) {
+		DPRINTK(PROBE, ERR, "No usable DMA configuration, aborting.\n");
+		goto err_out_free_res;
+	}
+
+	SET_MODULE_OWNER(netdev);
+	SET_NETDEV_DEV(netdev, &pdev->dev);
+
+	nic->csr = ioremap(pci_resource_start(pdev, 0), sizeof(struct csr));
+	if(!nic->csr) {
+		DPRINTK(PROBE, ERR, "Cannot map device registers, aborting.\n");
+		err = -ENOMEM;
+		goto err_out_free_res;
+	}
+
+	if(ent->driver_data)
+		nic->flags |= ich;
+	else
+		nic->flags &= ~ich;
+
+	spin_lock_init(&nic->cb_lock);
+	spin_lock_init(&nic->cmd_lock);
+
+	init_timer(&nic->watchdog);
+	nic->watchdog.function = e100_watchdog;
+	nic->watchdog.data = (unsigned long)nic;
+	init_timer(&nic->blink_timer);
+	nic->blink_timer.function = e100_blink_led;
+	nic->blink_timer.data = (unsigned long)nic;
+
+	if((err = e100_alloc(nic))) {
+		DPRINTK(PROBE, ERR, "Cannot alloc driver memory, aborting.\n");
+		goto err_out_iounmap;
+	}
+
+	e100_get_defaults(nic);
+	e100_hw_reset(nic);
+	e100_phy_init(nic);
+
+	if((err = e100_eeprom_load(nic)))
+		goto err_out_free;
+	((u16 *)netdev->dev_addr)[0] = le16_to_cpu(nic->eeprom[0]);
+	((u16 *)netdev->dev_addr)[1] = le16_to_cpu(nic->eeprom[1]);
+	((u16 *)netdev->dev_addr)[2] = le16_to_cpu(nic->eeprom[2]);
+	if(!is_valid_ether_addr(netdev->dev_addr)) {
+		DPRINTK(PROBE, ERR, "Invalid MAC address from "
+			"EEPROM, aborting.\n");
+		err = -EAGAIN;
+		goto err_out_free;
+	}
+
+	/* Wol magic packet can be enabled from eeprom */
+	if((nic->mac >= mac_82558_D101_A4) &&
+	   (nic->eeprom[eeprom_id] & eeprom_id_wol))
+		nic->flags |= wol_magic;
+
+	pci_enable_wake(pdev, 0, nic->flags & (wol_magic | e100_asf(nic)));
+
+	if((err = register_netdev(netdev))) {
+		DPRINTK(PROBE, ERR, "Cannot register net device, aborting.\n");
+		goto err_out_free;
+	}
+
+	DPRINTK(PROBE, INFO, "addr 0x%lx, irq %d, "
+		"MAC addr %02X:%02X:%02X:%02X:%02X:%02X\n",
+		pci_resource_start(pdev, 0), pdev->irq,
+		netdev->dev_addr[0], netdev->dev_addr[1], netdev->dev_addr[2],
+		netdev->dev_addr[3], netdev->dev_addr[4], netdev->dev_addr[5]);
+
+	return 0;
+
+err_out_free:
+	e100_free(nic);
+err_out_iounmap:
+	iounmap(nic->csr);
+err_out_free_res:
+	pci_release_regions(pdev);
+err_out_disable_pdev:
+	pci_disable_device(pdev);
+err_out_free_dev:
+	pci_set_drvdata(pdev, NULL);
+	free_netdev(netdev);
+	return err;
+}
+
+static void __devexit e100_remove(struct pci_dev *pdev)
+{
+	struct net_device *netdev = pci_get_drvdata(pdev);
+
+	if(netdev) {
+		struct nic *nic = netdev->priv;
+		unregister_netdev(netdev);
+		e100_free(nic);
+		iounmap(nic->csr);
+		free_netdev(netdev);
+		pci_release_regions(pdev);
+		pci_disable_device(pdev);
+		pci_set_drvdata(pdev, NULL);
+	}
+}
+
+#ifdef CONFIG_PM
+static int e100_suspend(struct pci_dev *pdev, u32 state)
+{
+	struct net_device *netdev = pci_get_drvdata(pdev);
+	struct nic *nic = netdev->priv;
+
+	if(netif_running(netdev))
+		e100_down(nic);
+	e100_hw_reset(nic);
+	netif_device_detach(netdev);
+
+	pci_save_state(pdev, nic->pm_state);
+	pci_enable_wake(pdev, state, nic->flags & (wol_magic | e100_asf(nic)));
+	pci_disable_device(pdev);
+	pci_set_power_state(pdev, state);
+
+	return 0;
+}
+
+static int e100_resume(struct pci_dev *pdev)
+{
+	struct net_device *netdev = pci_get_drvdata(pdev);
+	struct nic *nic = netdev->priv;
+
+	pci_set_power_state(pdev, 0);
+	pci_restore_state(pdev, nic->pm_state);
+	e100_hw_init(nic);
+
+	netif_device_attach(netdev);
+	if(netif_running(netdev))
+		e100_up(nic);
+
+	return 0;
+}
+#endif
+
+static struct pci_driver e100_driver = {
+	.name =         DRV_NAME,
+	.id_table =     e100_id_table,
+	.probe =        e100_probe,
+	.remove =       __devexit_p(e100_remove),
+#ifdef CONFIG_PM
+	.suspend =      e100_suspend,
+	.resume =       e100_resume,
+#endif
+};
+
+static int __init e100_init_module(void)
+{
+	if(((1 << debug) - 1) & NETIF_MSG_DRV) {
+		printk(KERN_INFO PFX "%s, %s\n", DRV_DESCRIPTION, DRV_VERSION);
+		printk(KERN_INFO PFX "%s\n", DRV_COPYRIGHT);
+	}
+        return pci_module_init(&e100_driver);
+}
+
+static void __exit e100_cleanup_module(void)
+{
+	pci_unregister_driver(&e100_driver);
+}
+
+module_init(e100_init_module);
+module_exit(e100_cleanup_module);
--- diff/drivers/net/kgdb_eth.c	1970-01-01 01:00:00.000000000 +0100
+++ source/drivers/net/kgdb_eth.c	2004-02-09 10:39:53.000000000 +0000
@@ -0,0 +1,131 @@
+/*
+ * Network interface GDB stub
+ *
+ * Written by San Mehat (nettwerk@biodome.org)
+ * Based upon 'gdbserial' by David Grothe (dave@gcom.com)
+ * and Scott Foehner (sfoehner@engr.sgi.com)
+ *
+ * Twiddled for 2.6 by Robert Walsh <rjwalsh@durables.org>
+ * and wangdi <wangdi@clusterfs.com>.
+ *
+ * Refactored for netpoll API by Matt Mackall <mpm@selenic.com>
+ *
+ */
+
+#include <linux/sched.h>
+#include <linux/interrupt.h>
+#include <linux/config.h>
+#include <linux/string.h>
+#include <linux/netpoll.h>
+
+#include <asm/system.h>
+#include <asm/kgdb.h>
+#include <asm/io.h>
+#include <asm/bitops.h>
+#include <asm/system.h>
+#include <asm/irq.h>
+#include <asm/atomic.h>
+
+#define IN_BUF_SIZE 512 /* power of 2, please */
+#define OUT_BUF_SIZE 256
+
+static char in_buf[IN_BUF_SIZE], out_buf[OUT_BUF_SIZE];
+static int in_head, in_tail, out_count;
+static atomic_t in_count;
+int kgdboe = 0; /* Default to tty mode */
+
+extern void set_debug_traps(void);
+extern void breakpoint(void);
+static void rx_hook(struct netpoll *np, int port, char *msg, int len);
+
+static struct netpoll np = {
+	.name = "kgdboe",
+	.dev_name = "eth0",
+	.rx_hook = rx_hook,
+	.local_port = 6443,
+	.remote_port = 6442,
+	.remote_mac = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff},
+};
+
+int eth_getDebugChar(void)
+{
+	int chr;
+
+	while (atomic_read(&in_count) == 0)
+		netpoll_poll(&np);
+
+	chr = in_buf[in_tail++];
+	in_tail &= (IN_BUF_SIZE - 1);
+	atomic_dec(&in_count);
+	return chr;
+}
+
+void eth_flushDebugChar(void)
+{
+	if(out_count && np.dev) {
+		netpoll_send_udp(&np, out_buf, out_count);
+		out_count = 0;
+	}
+}
+
+void eth_putDebugChar(int chr)
+{
+	out_buf[out_count++] = chr;
+	if(out_count == OUT_BUF_SIZE)
+		eth_flushDebugChar();
+}
+
+static void rx_hook(struct netpoll *np, int port, char *msg, int len)
+{
+	int i;
+
+	np->remote_port = port;
+
+	/* Is this gdb trying to attach? */
+	if (!netpoll_trap() && len == 8 && !strncmp(msg, "$Hc-1#09", 8))
+		kgdb_schedule_breakpoint();
+
+	for (i = 0; i < len; i++) {
+		if (msg[i] == 3)
+			kgdb_schedule_breakpoint();
+
+		if (atomic_read(&in_count) >= IN_BUF_SIZE) {
+			/* buffer overflow, clear it */
+			in_head = in_tail = 0;
+			atomic_set(&in_count, 0);
+			break;
+		}
+		in_buf[in_head++] = msg[i];
+		in_head &= (IN_BUF_SIZE - 1);
+		atomic_inc(&in_count);
+	}
+}
+
+static int option_setup(char *opt)
+{
+	return netpoll_parse_options(&np, opt);
+}
+
+__setup("kgdboe=", option_setup);
+
+static int init_kgdboe(void)
+{
+#ifdef CONFIG_SMP
+	if (num_online_cpus() > CONFIG_NO_KGDB_CPUS) {
+		printk("kgdb: too manu cpus. Cannot enable debugger with more than %d cpus\n", CONFIG_NO_KGDB_CPUS);
+		return -1;
+	}
+#endif
+
+	set_debug_traps();
+
+	if(!np.remote_ip || netpoll_setup(&np))
+		return 1;
+
+	kgdboe = 1;
+	printk(KERN_INFO "kgdb: debugging over ethernet enabled\n");
+
+	return 0;
+}
+
+module_init(init_kgdboe);
--- diff/drivers/net/netconsole.c	1970-01-01 01:00:00.000000000 +0100
+++ source/drivers/net/netconsole.c	2004-02-09 10:39:53.000000000 +0000
@@ -0,0 +1,127 @@
+/*
+ *  linux/drivers/net/netconsole.c
+ *
+ *  Copyright (C) 2001  Ingo Molnar <mingo@redhat.com>
+ *
+ *  This file contains the implementation of an IRQ-safe, crash-safe
+ *  kernel console implementation that outputs kernel messages to the
+ *  network.
+ *
+ * Modification history:
+ *
+ * 2001-09-17    started by Ingo Molnar.
+ * 2003-08-11    2.6 port by Matt Mackall
+ *               simplified options
+ *               generic card hooks
+ *               works non-modular
+ * 2003-09-07    rewritten with netpoll api
+ */
+
+/****************************************************************
+ *      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.
+ *
+ *      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/mm.h>
+#include <linux/tty.h>
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/console.h>
+#include <linux/tty_driver.h>
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/string.h>
+#include <linux/sysrq.h>
+#include <linux/smp.h>
+#include <linux/netpoll.h>
+
+MODULE_AUTHOR("Maintainer: Matt Mackall <mpm@selenic.com>");
+MODULE_DESCRIPTION("Console driver for network interfaces");
+MODULE_LICENSE("GPL");
+
+static char config[256];
+module_param_string(netconsole, config, 256, 0);
+MODULE_PARM_DESC(netconsole, " netconsole=[src-port]@[src-ip]/[dev],[tgt-port]@<tgt-ip>/[tgt-macaddr]\n");
+
+static struct netpoll np = {
+	.name = "netconsole",
+	.dev_name = "eth0",
+	.local_port = 6665,
+	.remote_port = 6666,
+	.remote_mac = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff},
+};
+static int configured = 0;
+
+#define MAX_PRINT_CHUNK 1000
+
+static void write_msg(struct console *con, const char *msg, unsigned int len)
+{
+	int frag, left;
+	unsigned long flags;
+
+	if (!np.dev)
+		return;
+
+	local_irq_save(flags);
+
+	for(left = len; left; ) {
+		frag = min(left, MAX_PRINT_CHUNK);
+		netpoll_send_udp(&np, msg, frag);
+		msg += frag;
+		left -= frag;
+	}
+
+	local_irq_restore(flags);
+}
+
+static struct console netconsole = {
+	.flags = CON_ENABLED | CON_PRINTBUFFER,
+	.write = write_msg
+};
+
+static int option_setup(char *opt)
+{
+	configured = !netpoll_parse_options(&np, opt);
+	return 0;
+}
+
+__setup("netconsole=", option_setup);
+
+static int init_netconsole(void)
+{
+	if(strlen(config))
+		option_setup(config);
+
+	if(!configured) {
+		printk("netconsole: not configured, aborting\n");
+		return -EINVAL;
+	}
+
+	if(netpoll_setup(&np))
+		return -EINVAL;
+
+	register_console(&netconsole);
+	printk(KERN_INFO "netconsole: network logging started\n");
+	return 0;
+}
+
+static void cleanup_netconsole(void)
+{
+	unregister_console(&netconsole);
+	netpoll_cleanup(&np);
+}
+
+module_init(init_netconsole);
+module_exit(cleanup_netconsole);
--- diff/drivers/pnp/isapnp/Kconfig	1970-01-01 01:00:00.000000000 +0100
+++ source/drivers/pnp/isapnp/Kconfig	2004-02-09 10:39:54.000000000 +0000
@@ -0,0 +1,11 @@
+#
+# ISA Plug and Play configuration
+#
+config ISAPNP
+	bool "ISA Plug and Play support (EXPERIMENTAL)"
+	depends on PNP && EXPERIMENTAL
+	help
+	  Say Y here if you would like support for ISA Plug and Play devices.
+	  Some information is in <file:Documentation/isapnp.txt>.
+
+	  If unsure, say Y.
--- diff/drivers/pnp/pnpbios/Kconfig	1970-01-01 01:00:00.000000000 +0100
+++ source/drivers/pnp/pnpbios/Kconfig	2004-02-09 10:39:54.000000000 +0000
@@ -0,0 +1,41 @@
+#
+# Plug and Play BIOS configuration
+#
+config PNPBIOS
+	bool "Plug and Play BIOS support (EXPERIMENTAL)"
+	depends on PNP && EXPERIMENTAL
+	---help---
+	  Linux uses the PNPBIOS as defined in "Plug and Play BIOS
+	  Specification Version 1.0A May 5, 1994" to autodetect built-in
+	  mainboard resources (e.g. parallel port resources).
+
+	  Some features (e.g. event notification, docking station information,
+	  ISAPNP services) are not currently implemented.
+
+	  If you would like the kernel to detect and allocate resources to
+	  your mainboard devices (on some systems they are disabled by the
+	  BIOS) say Y here.  Also the PNPBIOS can help prevent resource
+	  conflicts between mainboard devices and other bus devices.
+
+	  Note: ACPI is expected to supersede PNPBIOS some day, currently it
+	  co-exists nicely.  If you have a non-ISA system that supports ACPI,
+	  you probably don't need PNPBIOS support.
+
+config PNPBIOS_PROC_FS
+	bool "Plug and Play BIOS /proc interface"
+	depends on PNPBIOS && PROC_FS
+	---help---
+	  If you say Y here and to "/proc file system support", you will be
+	  able to directly access the PNPBIOS.  This includes resource
+	  allocation, ESCD, and other PNPBIOS services.  Using this
+	  interface is potentially dangerous because the PNPBIOS driver will
+	  not be notified of any resource changes made by writting directly.
+	  Also some buggy systems will fault when accessing certain features
+	  in the PNPBIOS /proc interface (e.g. "boot" configs).
+
+	  See the latest pcmcia-cs (stand-alone package) for a nice set of
+	  PNPBIOS /proc interface tools (lspnp and setpnp).
+
+	  Unless you are debugging or have other specific reasons, it is
+	  recommended that you say N here.
+
--- diff/drivers/scsi/qla2xxx/ql2322.c	1970-01-01 01:00:00.000000000 +0100
+++ source/drivers/scsi/qla2xxx/ql2322.c	2004-02-09 10:39:55.000000000 +0000
@@ -0,0 +1,108 @@
+/*
+ * QLogic ISP2322 device driver for Linux 2.6.x
+ * 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[] = "qla2322";
+
+extern unsigned char  fw2322ipx_version[];
+extern unsigned char  fw2322ipx_version_str[];
+extern unsigned short fw2322ipx_addr01;
+extern unsigned short fw2322ipx_code01[];
+extern unsigned short fw2322ipx_length01;
+extern unsigned long rseqipx_code_addr01;
+extern unsigned short rseqipx_code01[];
+extern unsigned short rseqipx_code_length01;
+extern unsigned long xseqipx_code_addr01;
+extern unsigned short xseqipx_code01[];
+extern unsigned short xseqipx_code_length01;
+
+static struct qla_fw_info qla_fw_tbl[] = {
+	{
+		.addressing	= FW_INFO_ADDR_NORMAL,
+		.fwcode		= &fw2322ipx_code01[0],
+		.fwlen		= &fw2322ipx_length01,
+		.fwstart	= &fw2322ipx_addr01,
+	},
+	{
+		.addressing	= FW_INFO_ADDR_EXTENDED,
+		.fwcode		= &rseqipx_code01[0],
+		.fwlen		= &rseqipx_code_length01,
+		.lfwstart	= &rseqipx_code_addr01,
+	},
+	{
+		.addressing	= FW_INFO_ADDR_EXTENDED,
+		.fwcode		= &xseqipx_code01[0],
+		.fwlen		= &xseqipx_code_length01,
+		.lfwstart	= &xseqipx_code_addr01,
+	},
+	{ FW_INFO_ADDR_NOMORE, },
+};
+
+static struct qla_board_info qla_board_tbl[] = {
+	{
+		.drv_name	= qla_driver_name,
+		.isp_name	= "ISP2322",
+		.fw_info	= qla_fw_tbl,
+	},
+};
+
+static struct pci_device_id qla2322_pci_tbl[] = {
+	{
+		.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[0],
+	},
+	{0, 0},
+};
+MODULE_DEVICE_TABLE(pci, qla2322_pci_tbl);
+
+static int __devinit
+qla2322_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
+qla2322_remove_one(struct pci_dev *pdev)
+{
+	qla2x00_remove_one(pdev);
+}
+
+static struct pci_driver qla2322_pci_driver = {
+	.name		= "qla2322",
+	.id_table	= qla2322_pci_tbl,
+	.probe		= qla2322_probe_one,
+	.remove		= __devexit_p(qla2322_remove_one),
+};
+
+static int __init
+qla2322_init(void)
+{
+	return pci_module_init(&qla2322_pci_driver);
+}
+
+static void __exit
+qla2322_exit(void)
+{
+	pci_unregister_driver(&qla2322_pci_driver);
+}
+
+module_init(qla2322_init);
+module_exit(qla2322_exit);
+
+MODULE_AUTHOR("QLogic Corporation");
+MODULE_DESCRIPTION("QLogic ISP2322 FC-SCSI Host Bus Adapter driver");
+MODULE_LICENSE("GPL");
--- diff/drivers/scsi/qla2xxx/ql2322_fw.c	1970-01-01 01:00:00.000000000 +0100
+++ source/drivers/scsi/qla2xxx/ql2322_fw.c	2004-02-09 10:39:55.000000000 +0000
@@ -0,0 +1,8019 @@
+/**************************************************************************
+ *                  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.21 (16:27 Jan 19, 2004)
+ */
+
+#ifdef UNIQUE_FW_NAME
+unsigned short fw2322ipx_version = 3*1024+2;
+#else
+unsigned short risc_code_version = 3*1024+2;
+#endif
+
+#ifdef UNIQUE_FW_NAME
+unsigned char fw2322ipx_version_str[] = {3, 2,21};
+#else
+unsigned char firmware_version[] = {3, 2,21};
+#endif
+
+#ifdef UNIQUE_FW_NAME
+#define fw2322ipx_VERSION_STRING "3.02.21"
+#else
+#define FW_VERSION_STRING "3.02.21"
+#endif
+
+#ifdef UNIQUE_FW_NAME
+unsigned short fw2322ipx_addr01 = 0x0800 ;
+#else
+unsigned short risc_code_addr01 = 0x0800 ;
+#endif
+
+#ifdef UNIQUE_FW_NAME
+unsigned short fw2322ipx_code01[] = { 
+#else
+unsigned short risc_code01[] = { 
+#endif
+	0x0470, 0x0000, 0x0000, 0xdddb, 0x0000, 0x0003, 0x0002, 0x0015,
+	0x0137, 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, 0x2e32, 0x3120, 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, 0x20c9, 0x1cff, 0x2059, 0x0000, 0x2b78,
+	0x7883, 0x0004, 0x2089, 0x2a7c, 0x2051, 0x1800, 0x2a70, 0x20e1,
+	0x0001, 0x20e9, 0x0001, 0x2009, 0x0000, 0x080c, 0x0e55, 0x00f6,
+	0x7888, 0x9005, 0x11f8, 0x2061, 0xc000, 0x080c, 0x202e, 0x1170,
+	0x2079, 0x0300, 0x080c, 0x2044, 0x2061, 0xe000, 0x080c, 0x202e,
+	0x1128, 0x2079, 0x0380, 0x080c, 0x2044, 0x0060, 0x00fe, 0x7883,
+	0x4010, 0x7837, 0x4010, 0x7833, 0x0010, 0x2091, 0x5000, 0x2091,
+	0x4080, 0x0cf8, 0x00fe, 0x2029, 0x5600, 0x2031, 0xffff, 0x2039,
+	0x55dc, 0x2021, 0x0200, 0x20e9, 0x0001, 0x20a1, 0x0000, 0x20a9,
+	0x0800, 0x900e, 0x4104, 0x20e9, 0x0001, 0x20a1, 0x1000, 0x900e,
+	0x2001, 0x0dc1, 0x9084, 0x0fff, 0x20a8, 0x4104, 0x2001, 0x0000,
+	0x9086, 0x0000, 0x0120, 0x21a8, 0x4104, 0x8001, 0x1de0, 0x756e,
+	0x7672, 0x776a, 0x7476, 0x747a, 0x00e6, 0x2071, 0x1b4c, 0x2472,
+	0x00ee, 0x20a1, 0x1ddc, 0x7170, 0x810d, 0x810d, 0x810d, 0x810d,
+	0x918c, 0x000f, 0x2001, 0x0001, 0x9112, 0x900e, 0x21a8, 0x4104,
+	0x8211, 0x1de0, 0x7170, 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, 0x0f53, 0x080c, 0x5f4f, 0x080c, 0xaa6e, 0x080c,
+	0x110a, 0x080c, 0x131f, 0x080c, 0x1b99, 0x080c, 0x9057, 0x080c,
+	0x0d0f, 0x080c, 0x108f, 0x080c, 0x3434, 0x080c, 0x76fc, 0x080c,
+	0x698e, 0x080c, 0x87cf, 0x080c, 0x8436, 0x080c, 0x2213, 0x080c,
+	0x7dcc, 0x080c, 0x205d, 0x080c, 0x2197, 0x080c, 0x2208, 0x2091,
+	0x3009, 0x7883, 0x0000, 0x1004, 0x0943, 0x7880, 0x9086, 0x0002,
+	0x1190, 0x7883, 0x4000, 0x7837, 0x4000, 0x7833, 0x0010, 0x0e04,
+	0x0937, 0x2091, 0x5000, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004,
+	0xd084, 0x190c, 0x11cd, 0x2071, 0x1800, 0x7003, 0x0000, 0x780c,
+	0x9084, 0x0030, 0x9086, 0x0000, 0x190c, 0x0d7d, 0x2071, 0x1800,
+	0x7000, 0x908e, 0x0003, 0x1168, 0x080c, 0x4afd, 0x080c, 0x345b,
+	0x080c, 0x7764, 0x080c, 0x6ed6, 0x080c, 0x88ad, 0x080c, 0x845f,
+	0x0c68, 0x000b, 0x0c88, 0x096d, 0x096e, 0x0b09, 0x096b, 0x0bc3,
+	0x0d0e, 0x0d0e, 0x0d0e, 0x080c, 0x0d7d, 0x0005, 0x0126, 0x00f6,
+	0x2091, 0x8000, 0x7000, 0x9086, 0x0001, 0x1904, 0x0adc, 0x080c,
+	0x0ea5, 0x080c, 0x73e4, 0x0150, 0x080c, 0x7407, 0x15b0, 0x2079,
+	0x0100, 0x7828, 0x9085, 0x1800, 0x782a, 0x0478, 0x080c, 0x7315,
+	0x7000, 0x9086, 0x0001, 0x1904, 0x0adc, 0x7098, 0x9086, 0x0028,
+	0x1904, 0x0adc, 0x080c, 0x842e, 0x080c, 0x8420, 0x2001, 0x0161,
+	0x2003, 0x0001, 0x2079, 0x0100, 0x2011, 0xffff, 0x080c, 0x2a0b,
+	0x7a28, 0x9295, 0x5e2c, 0x7a2a, 0x2011, 0x725a, 0x080c, 0x850b,
+	0x2011, 0x724d, 0x080c, 0x8614, 0x2011, 0x5da6, 0x080c, 0x850b,
+	0x2011, 0x8030, 0x901e, 0x7396, 0x04d0, 0x080c, 0x5653, 0x2079,
+	0x0100, 0x7844, 0x9005, 0x1904, 0x0adc, 0x2011, 0x5da6, 0x080c,
+	0x850b, 0x2011, 0x725a, 0x080c, 0x850b, 0x2011, 0x724d, 0x080c,
+	0x8614, 0x2001, 0x0265, 0x2001, 0x0205, 0x2003, 0x0000, 0x7840,
+	0x9084, 0xfffb, 0x7842, 0x2001, 0x19a4, 0x2004, 0x9005, 0x1140,
+	0x00c6, 0x2061, 0x0100, 0x080c, 0x5ef7, 0x00ce, 0x0804, 0x0adc,
+	0x780f, 0x006b, 0x7a28, 0x080c, 0x73ec, 0x0118, 0x9295, 0x5e2c,
+	0x0010, 0x9295, 0x402c, 0x7a2a, 0x2011, 0x8010, 0x73d8, 0x2001,
+	0x19a5, 0x2003, 0x0001, 0x080c, 0x28ea, 0x080c, 0x4a38, 0x7248,
+	0xc284, 0x724a, 0x2001, 0x180c, 0x200c, 0xc1ac, 0xc1cc, 0x2102,
+	0x2001, 0x0390, 0x2003, 0x0400, 0x080c, 0xa781, 0x080c, 0x9f4a,
+	0x2011, 0x0004, 0x080c, 0xc733, 0x080c, 0xa79d, 0x080c, 0x681f,
+	0x080c, 0x73e4, 0x1120, 0x080c, 0x2938, 0x0600, 0x0420, 0x080c,
+	0x5efe, 0x0140, 0x7097, 0x0001, 0x70d3, 0x0000, 0x080c, 0x5820,
+	0x0804, 0x0adc, 0x080c, 0x55fc, 0xd094, 0x01a8, 0x2001, 0x0390,
+	0x2003, 0x0404, 0x2011, 0x180c, 0x2204, 0xc0cd, 0x2012, 0x080c,
+	0x5600, 0xd0d4, 0x1118, 0x080c, 0x2938, 0x1270, 0x2011, 0x180c,
+	0x2204, 0xc0bc, 0x00a8, 0x080c, 0x5600, 0xd0d4, 0x1db8, 0x2011,
+	0x180c, 0x2204, 0xc0bd, 0x0060, 0x2011, 0x180c, 0x2204, 0xc0bd,
+	0x2012, 0x080c, 0x6962, 0x1128, 0xd0a4, 0x0118, 0x2204, 0xc0fd,
+	0x2012, 0x080c, 0x6928, 0x0120, 0x7a0c, 0xc2b4, 0x7a0e, 0x00a8,
+	0x707f, 0x0000, 0x080c, 0x73e4, 0x1130, 0x70b0, 0x9005, 0x1168,
+	0x080c, 0xcb83, 0x0050, 0x080c, 0xcb83, 0x70dc, 0xd09c, 0x1128,
+	0x70b0, 0x9005, 0x0110, 0x080c, 0x5ed4, 0x70e7, 0x0000, 0x70e3,
+	0x0000, 0x70a7, 0x0000, 0x080c, 0x2940, 0x0228, 0x2011, 0x0101,
+	0x2204, 0xc0c4, 0x2012, 0x72dc, 0x080c, 0x73e4, 0x1178, 0x9016,
+	0x0016, 0x080c, 0x26e7, 0x2019, 0x196d, 0x211a, 0x001e, 0x705f,
+	0xffff, 0x7063, 0x00ef, 0x7083, 0x0000, 0x0020, 0x2019, 0x196d,
+	0x201b, 0x0000, 0x2079, 0x1847, 0x7804, 0xd0ac, 0x0108, 0xc295,
+	0x72de, 0x080c, 0x73e4, 0x0118, 0x9296, 0x0004, 0x0518, 0x2011,
+	0x0001, 0x080c, 0xc733, 0x70ab, 0x0000, 0x70af, 0xffff, 0x7003,
+	0x0002, 0x00fe, 0x080c, 0x2f79, 0x080c, 0xa781, 0x2011, 0x0005,
+	0x080c, 0xa0a6, 0x080c, 0xa79d, 0x080c, 0x73e4, 0x0148, 0x00c6,
+	0x2061, 0x0100, 0x0016, 0x080c, 0x26e7, 0x61e2, 0x001e, 0x00ce,
+	0x012e, 0x00e0, 0x70ab, 0x0000, 0x70af, 0xffff, 0x7003, 0x0002,
+	0x080c, 0xa781, 0x2011, 0x0005, 0x080c, 0xa0a6, 0x080c, 0xa79d,
+	0x080c, 0x73e4, 0x0148, 0x00c6, 0x2061, 0x0100, 0x0016, 0x080c,
+	0x26e7, 0x61e2, 0x001e, 0x00ce, 0x00fe, 0x012e, 0x0005, 0x00c6,
+	0x00b6, 0x080c, 0x73e4, 0x1118, 0x20a9, 0x0800, 0x0010, 0x20a9,
+	0x0782, 0x080c, 0x73e4, 0x1110, 0x900e, 0x0010, 0x2009, 0x007e,
+	0x86ff, 0x0138, 0x9180, 0x1000, 0x2004, 0x905d, 0x0110, 0xb800,
+	0xd0bc, 0x090c, 0x32bc, 0x8108, 0x1f04, 0x0af0, 0x707f, 0x0000,
+	0x7080, 0x9084, 0x00ff, 0x7082, 0x70b3, 0x0000, 0x00be, 0x00ce,
+	0x0005, 0x00b6, 0x0126, 0x2091, 0x8000, 0x7000, 0x9086, 0x0002,
+	0x1904, 0x0bc0, 0x70ac, 0x9086, 0xffff, 0x0120, 0x080c, 0x2f79,
+	0x0804, 0x0bc0, 0x70dc, 0xd0ac, 0x1110, 0xd09c, 0x0538, 0xd084,
+	0x0528, 0x0006, 0x2001, 0x0103, 0x2003, 0x002b, 0x000e, 0xd08c,
+	0x01e8, 0x080c, 0x332d, 0x11b0, 0x70e0, 0x9086, 0xffff, 0x0190,
+	0x080c, 0x310b, 0x70dc, 0xd094, 0x1904, 0x0bc0, 0x2011, 0x0001,
+	0x080c, 0xce35, 0x0110, 0x2011, 0x0003, 0x901e, 0x080c, 0x3145,
+	0x0804, 0x0bc0, 0x70e4, 0x9005, 0x1904, 0x0bc0, 0x70a8, 0x9005,
+	0x1904, 0x0bc0, 0x70dc, 0xd0a4, 0x0118, 0xd0b4, 0x0904, 0x0bc0,
+	0x080c, 0x6928, 0x1904, 0x0bc0, 0x080c, 0x697b, 0x1904, 0x0bc0,
+	0x080c, 0x6962, 0x01c0, 0x0156, 0x00c6, 0x20a9, 0x007f, 0x900e,
+	0x0016, 0x080c, 0x652d, 0x1118, 0xb800, 0xd0ec, 0x1138, 0x001e,
+	0x8108, 0x1f04, 0x0b60, 0x00ce, 0x015e, 0x0028, 0x001e, 0x00ce,
+	0x015e, 0x0804, 0x0bc0, 0x0006, 0x2001, 0x0103, 0x2003, 0x002b,
+	0x000e, 0x2011, 0x19b1, 0x080c, 0x0fc3, 0x2011, 0x19cb, 0x080c,
+	0x0fc3, 0x7030, 0xc08c, 0x7032, 0x7003, 0x0003, 0x70af, 0xffff,
+	0x080c, 0x0e79, 0x9006, 0x080c, 0x2574, 0x080c, 0x332d, 0x0118,
+	0x080c, 0x4bd5, 0x0050, 0x0036, 0x0046, 0x2019, 0xffff, 0x2021,
+	0x0006, 0x080c, 0x4bef, 0x004e, 0x003e, 0x00f6, 0x2079, 0x0100,
+	0x080c, 0x7407, 0x0150, 0x080c, 0x73e4, 0x7828, 0x0118, 0x9084,
+	0xe1ff, 0x0010, 0x9084, 0xffdf, 0x782a, 0x00fe, 0x080c, 0xa781,
+	0x2001, 0x19e6, 0x2004, 0x9086, 0x0005, 0x1120, 0x2011, 0x0000,
+	0x080c, 0xa0a6, 0x2011, 0x0000, 0x080c, 0xa0b0, 0x080c, 0xa79d,
+	0x012e, 0x00be, 0x0005, 0x0016, 0x0026, 0x0046, 0x00f6, 0x0126,
+	0x2091, 0x8000, 0x2079, 0x0100, 0x7904, 0x918c, 0xfffd, 0x7906,
+	0x2009, 0x00f7, 0x080c, 0x5ebd, 0x7940, 0x918c, 0x0010, 0x7942,
+	0x7924, 0xd1b4, 0x0120, 0x2011, 0x0040, 0x080c, 0x2a0b, 0xd19c,
+	0x0120, 0x2011, 0x0008, 0x080c, 0x2a0b, 0x0006, 0x0036, 0x0156,
+	0x0000, 0x2001, 0x19a5, 0x2004, 0x9005, 0x1518, 0x080c, 0x299f,
+	0x1148, 0x2001, 0x0001, 0x080c, 0x2919, 0x2001, 0x0001, 0x080c,
+	0x28fc, 0x00b8, 0x080c, 0x29a7, 0x1138, 0x9006, 0x080c, 0x2919,
+	0x9006, 0x080c, 0x28fc, 0x0068, 0x080c, 0x29af, 0x1d50, 0x2001,
+	0x1996, 0x2004, 0xd0fc, 0x0108, 0x0020, 0x080c, 0x2713, 0x0804,
+	0x0cc1, 0x080c, 0x2a2e, 0x080c, 0x2a72, 0x20a9, 0x003a, 0x1d04,
+	0x0c17, 0x080c, 0x85f4, 0x1f04, 0x0c17, 0x080c, 0x73f5, 0x0148,
+	0x080c, 0x7407, 0x1118, 0x080c, 0x76f7, 0x0050, 0x080c, 0x73ec,
+	0x0dd0, 0x080c, 0x76f2, 0x080c, 0x76e8, 0x080c, 0x7315, 0x0020,
+	0x2009, 0x00f8, 0x080c, 0x5ebd, 0x7850, 0xc0e5, 0x7852, 0x080c,
+	0x73e4, 0x0120, 0x7843, 0x0090, 0x7843, 0x0010, 0x2021, 0xe678,
+	0x2019, 0xea60, 0x0d0c, 0x85f4, 0x7820, 0xd09c, 0x15a0, 0x080c,
+	0x73e4, 0x0904, 0x0ca3, 0x7824, 0xd0ac, 0x1904, 0x0cc6, 0x080c,
+	0x7407, 0x1548, 0x0046, 0x2021, 0x0320, 0x8421, 0x1df0, 0x004e,
+	0x2011, 0x1800, 0x080c, 0x2a0b, 0x080c, 0x29b7, 0x7824, 0x9084,
+	0x1800, 0x1168, 0x9484, 0x0fff, 0x1140, 0x2001, 0x1810, 0x2004,
+	0x9084, 0x9000, 0x0110, 0x080c, 0x0ce9, 0x8421, 0x1160, 0x1d04,
+	0x0c73, 0x080c, 0x85f4, 0x080c, 0x76f2, 0x080c, 0x76e8, 0x7003,
+	0x0001, 0x0804, 0x0cc6, 0x8319, 0x1928, 0x2001, 0x1810, 0x2004,
+	0x9084, 0x9000, 0x0110, 0x080c, 0x0ce9, 0x1d04, 0x0c89, 0x080c,
+	0x85f4, 0x2009, 0x1999, 0x2104, 0x9005, 0x0118, 0x8001, 0x200a,
+	0x1188, 0x200b, 0x000a, 0x2011, 0x0048, 0x080c, 0x2a0b, 0x20a9,
+	0x0002, 0x080c, 0x2998, 0x7924, 0x080c, 0x29b7, 0xd19c, 0x0110,
+	0x080c, 0x28ea, 0x00f0, 0x080c, 0x73f5, 0x1140, 0x94a2, 0x03e8,
+	0x1128, 0x080c, 0x73b8, 0x7003, 0x0001, 0x00c0, 0x2011, 0x1800,
+	0x080c, 0x2a0b, 0x080c, 0x29b7, 0x7824, 0x080c, 0x73fe, 0x0110,
+	0xd0ac, 0x1160, 0x9084, 0x1800, 0x0904, 0x0c7b, 0x7003, 0x0001,
+	0x0028, 0x2001, 0x0001, 0x080c, 0x2574, 0x00a0, 0x7850, 0xc0e4,
+	0x7852, 0x2009, 0x180c, 0x210c, 0xd19c, 0x1120, 0x7904, 0x918d,
+	0x0002, 0x7906, 0x2011, 0x0048, 0x080c, 0x2a0b, 0x7828, 0x9085,
+	0x0028, 0x782a, 0x2001, 0x19a5, 0x2003, 0x0000, 0x9006, 0x78f2,
+	0x015e, 0x003e, 0x000e, 0x012e, 0x00fe, 0x004e, 0x002e, 0x001e,
+	0x0005, 0x0006, 0x0016, 0x0026, 0x0036, 0x0046, 0x00b6, 0x00c6,
+	0x00d6, 0x00e6, 0x00f6, 0x0156, 0x0071, 0x0d0c, 0x85f4, 0x015e,
+	0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x004e, 0x003e, 0x002e,
+	0x001e, 0x000e, 0x0005, 0x00e6, 0x2071, 0x189e, 0x7004, 0x9086,
+	0x0001, 0x1110, 0x080c, 0x345b, 0x00ee, 0x0005, 0x0005, 0x2a70,
+	0x2061, 0x19a9, 0x2063, 0x0003, 0x6007, 0x0002, 0x600b, 0x0015,
+	0x600f, 0x0137, 0x2001, 0x197c, 0x900e, 0x2102, 0x7196, 0x2001,
+	0x0100, 0x2004, 0x9082, 0x0002, 0x0218, 0x705f, 0xffff, 0x0008,
+	0x715e, 0x7067, 0xffff, 0x717e, 0x7182, 0x080c, 0xcb83, 0x70ef,
+	0x00c0, 0x2061, 0x196c, 0x6003, 0x0909, 0x6106, 0x600b, 0x8800,
+	0x600f, 0x0200, 0x6013, 0x00ff, 0x6017, 0x001f, 0x611a, 0x601f,
+	0x07d0, 0x2061, 0x1974, 0x6003, 0x8000, 0x6106, 0x610a, 0x600f,
+	0x0200, 0x6013, 0x00ff, 0x6116, 0x601b, 0x0001, 0x611e, 0x2061,
+	0x1987, 0x6003, 0x514c, 0x6007, 0x4f47, 0x600b, 0x4943, 0x600f,
+	0x2020, 0x2001, 0x182c, 0x2102, 0x0005, 0x9016, 0x080c, 0x652d,
+	0x1178, 0xb804, 0x90c4, 0x00ff, 0x98c6, 0x0006, 0x0128, 0x90c4,
+	0xff00, 0x98c6, 0x0600, 0x1120, 0x9186, 0x0080, 0x0108, 0x8210,
+	0x8108, 0x9186, 0x0800, 0x1d50, 0x2208, 0x0005, 0x2091, 0x8000,
+	0x2079, 0x0000, 0x000e, 0x00f6, 0x0010, 0x2091, 0x8000, 0x0e04,
+	0x0d7f, 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, 0x1b22, 0x7a08,
+	0x226a, 0x2069, 0x1b23, 0x7a18, 0x226a, 0x8d68, 0x7a1c, 0x226a,
+	0x782c, 0x2019, 0x1b30, 0x201a, 0x2019, 0x1b33, 0x9016, 0x7808,
+	0xd09c, 0x0168, 0x7820, 0x201a, 0x8210, 0x8318, 0x9386, 0x1b4c,
+	0x0108, 0x0ca8, 0x7808, 0xd09c, 0x0110, 0x2011, 0xdead, 0x2019,
+	0x1b31, 0x782c, 0x201a, 0x8318, 0x221a, 0x7803, 0x0000, 0x2069,
+	0x1a78, 0x901e, 0x20a9, 0x0020, 0x7b26, 0x7a28, 0x226a, 0x8d68,
+	0x8318, 0x1f04, 0x0dcc, 0x0491, 0x002e, 0x003e, 0x00de, 0x015e,
+	0x2079, 0x1800, 0x7803, 0x0005, 0x2091, 0x4080, 0x2001, 0x0089,
+	0x2004, 0xd084, 0x0180, 0x2001, 0x1a20, 0x2004, 0x9005, 0x0128,
+	0x2001, 0x008b, 0x2004, 0xd0fc, 0x0dd8, 0x2001, 0x008a, 0x2003,
+	0x0002, 0x2003, 0x1001, 0x080c, 0x560b, 0x1170, 0x080c, 0x0f13,
+	0x0110, 0x080c, 0x0e66, 0x080c, 0x560b, 0x1130, 0x2071, 0x1800,
+	0x2011, 0x8000, 0x080c, 0x0f27, 0x0c70, 0x0005, 0x2001, 0x0382,
+	0x2004, 0x9084, 0x0007, 0x9086, 0x0001, 0x1120, 0x2001, 0x0015,
+	0x080c, 0xa772, 0x2079, 0x0380, 0x2069, 0x1b02, 0x7818, 0x6802,
+	0x781c, 0x6806, 0x7840, 0x680a, 0x7844, 0x680e, 0x782c, 0x6812,
+	0x2019, 0x1b0d, 0x9016, 0x7808, 0xd09c, 0x0150, 0x7820, 0x201a,
+	0x8210, 0x8318, 0x8210, 0x9282, 0x0011, 0x0ea8, 0x2011, 0xdead,
+	0x6a2a, 0x7830, 0x681a, 0x7834, 0x681e, 0x7838, 0x6822, 0x783c,
+	0x6826, 0x7803, 0x0000, 0x2069, 0x1ac2, 0x901e, 0x20a9, 0x0020,
+	0x7b26, 0x7828, 0x206a, 0x8d68, 0x8318, 0x1f04, 0x0e40, 0x2069,
+	0x1ae2, 0x2019, 0x00b0, 0x20a9, 0x0020, 0x7b26, 0x7828, 0x206a,
+	0x8d68, 0x8318, 0x1f04, 0x0e4d, 0x0005, 0x918c, 0x03ff, 0x2001,
+	0x0003, 0x2004, 0x9084, 0x0600, 0x1118, 0x918d, 0x6c00, 0x0010,
+	0x918d, 0x6400, 0x2001, 0x017f, 0x2102, 0x0005, 0x0026, 0x0126,
+	0x2011, 0x0080, 0x080c, 0x0f05, 0x20a9, 0x0900, 0x080c, 0x0f3b,
+	0x2011, 0x0040, 0x080c, 0x0f05, 0x20a9, 0x0900, 0x080c, 0x0f3b,
+	0x0c78, 0x0026, 0x080c, 0x0f13, 0x1188, 0x2011, 0x010e, 0x2214,
+	0x9294, 0x0007, 0x9296, 0x0007, 0x0118, 0x2011, 0x0947, 0x0010,
+	0x2011, 0x1b47, 0x080c, 0x0f27, 0x002e, 0x0005, 0x2011, 0x010e,
+	0x2214, 0x9294, 0x0007, 0x9296, 0x0007, 0x0118, 0x2011, 0xa880,
+	0x0010, 0x2011, 0x6840, 0xd0e4, 0x70f3, 0x0000, 0x1128, 0x70f3,
+	0x0fa0, 0x080c, 0x0f18, 0x002e, 0x0005, 0x0026, 0x080c, 0x0f13,
+	0x0148, 0xd0a4, 0x1138, 0x2011, 0xcdd5, 0x0010, 0x2011, 0x0080,
+	0x080c, 0x0f18, 0x002e, 0x0005, 0x0026, 0x70f3, 0x0000, 0x080c,
+	0x0f13, 0x1130, 0x2011, 0x8040, 0x080c, 0x0f27, 0x002e, 0x0005,
+	0x080c, 0x29af, 0x1118, 0x2011, 0xcdc5, 0x0010, 0x2011, 0xcac2,
+	0x080c, 0x0f18, 0x002e, 0x0005, 0x00e6, 0x0016, 0x0006, 0x2071,
+	0x1800, 0xd0b4, 0x70ec, 0x71e8, 0x1118, 0xc0e4, 0xc1f4, 0x0050,
+	0x0006, 0x3b00, 0x9084, 0xff3e, 0x20d8, 0x000e, 0x70f3, 0x0000,
+	0xc0e5, 0xc1f5, 0x0099, 0x000e, 0x001e, 0x00ee, 0x0005, 0x00e6,
+	0x2071, 0x1800, 0xd0e4, 0x70ec, 0x1110, 0xc0dc, 0x0008, 0xc0dd,
+	0x0016, 0x71e8, 0x0019, 0x001e, 0x00ee, 0x0005, 0x70ee, 0x71ea,
+	0x7000, 0x9084, 0x0007, 0x000b, 0x0005, 0x0ecb, 0x0ea5, 0x0ea5,
+	0x0e79, 0x0eb4, 0x0ea5, 0x0ea5, 0x0eb4, 0xc284, 0x0016, 0x3b08,
+	0x3a00, 0x9104, 0x918d, 0x00c1, 0x21d8, 0x9084, 0xff3e, 0x9205,
+	0x20d0, 0x001e, 0x0005, 0x2001, 0x183b, 0x2004, 0xd0dc, 0x0005,
+	0x9e86, 0x1800, 0x190c, 0x0d7d, 0x70ec, 0xd0e4, 0x0108, 0xc2e5,
+	0x72ee, 0xd0e4, 0x1118, 0x9294, 0x00c1, 0x08f9, 0x0005, 0x9e86,
+	0x1800, 0x190c, 0x0d7d, 0x70e8, 0xd0f4, 0x0108, 0xc2f5, 0x72ea,
+	0xd0f4, 0x1140, 0x9284, 0x8000, 0x8005, 0xc284, 0x9215, 0x9294,
+	0x00c1, 0x0861, 0x0005, 0x1d04, 0x0f3b, 0x2091, 0x6000, 0x1f04,
+	0x0f3b, 0x0005, 0x890e, 0x810e, 0x810f, 0x9194, 0x003f, 0x918c,
+	0xffc0, 0x0005, 0x0006, 0x2200, 0x914d, 0x894f, 0x894d, 0x894d,
+	0x000e, 0x000e, 0x0005, 0x01d6, 0x0146, 0x0036, 0x0096, 0x2061,
+	0x188d, 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, 0x189d, 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,
+	0x0f42, 0x2100, 0x9300, 0x2098, 0x22e0, 0x009e, 0x002e, 0x001e,
+	0x0036, 0x3518, 0x20a9, 0x0001, 0x4002, 0x8007, 0x4004, 0x8319,
+	0x1dd8, 0x003e, 0x0005, 0x20e9, 0x0001, 0x71b8, 0x81ff, 0x11c0,
+	0x9006, 0x2009, 0x0200, 0x20a9, 0x0002, 0x9298, 0x0018, 0x23a0,
+	0x4001, 0x2009, 0x0700, 0x20a9, 0x0002, 0x9298, 0x0008, 0x23a0,
+	0x4001, 0x707c, 0x8007, 0x7180, 0x810f, 0x20a9, 0x0002, 0x4001,
+	0x9298, 0x000c, 0x23a0, 0x900e, 0x080c, 0x0d5d, 0x2001, 0x0000,
+	0x810f, 0x20a9, 0x0002, 0x4001, 0x0005, 0x89ff, 0x0140, 0xa804,
+	0xa807, 0x0000, 0x0006, 0x080c, 0x106d, 0x009e, 0x0cb0, 0x0005,
+	0x00e6, 0x2071, 0x1800, 0x080c, 0x10e6, 0x090c, 0x0d7d, 0x00ee,
+	0x0005, 0x0086, 0x00e6, 0x0006, 0x0026, 0x0036, 0x0126, 0x2091,
+	0x8000, 0x00c9, 0x2071, 0x1800, 0x73c0, 0x702c, 0x9016, 0x9045,
+	0x0158, 0x8210, 0x9906, 0x090c, 0x0d7d, 0x2300, 0x9202, 0x0120,
+	0x1a0c, 0x0d7d, 0xa000, 0x0c98, 0x012e, 0x003e, 0x002e, 0x000e,
+	0x00ee, 0x008e, 0x0005, 0x0086, 0x00e6, 0x0006, 0x0126, 0x2091,
+	0x8000, 0x2071, 0x1910, 0x7010, 0x9005, 0x0140, 0x7018, 0x9045,
+	0x0128, 0x9906, 0x090c, 0x0d7d, 0xa000, 0x0cc8, 0x012e, 0x000e,
+	0x00ee, 0x008e, 0x0005, 0x00e6, 0x2071, 0x1800, 0x0126, 0x2091,
+	0x8000, 0x70c0, 0x8001, 0x0270, 0x70c2, 0x702c, 0x2048, 0x9085,
+	0x0001, 0xa800, 0x702e, 0xa803, 0x0000, 0xa807, 0x0000, 0x012e,
+	0x00ee, 0x0005, 0x904e, 0x0cd8, 0x00e6, 0x0126, 0x2091, 0x8000,
+	0x2071, 0x1800, 0x70c0, 0x90ca, 0x0020, 0x0268, 0x8001, 0x70c2,
+	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, 0x70c0,
+	0x8000, 0x70c2, 0x080c, 0x8420, 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, 0x188d,
+	0x7000, 0x9005, 0x11a0, 0x2001, 0x0558, 0xa802, 0x2048, 0x2009,
+	0x5600, 0x8940, 0x2800, 0xa802, 0xa95e, 0xa863, 0x0001, 0x8420,
+	0x9886, 0x0800, 0x0120, 0x2848, 0x9188, 0x0040, 0x0c90, 0x2071,
+	0x188d, 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, 0x74be, 0x74c2, 0x0005, 0x00e6, 0x0016,
+	0x9984, 0xfc00, 0x01e8, 0x908c, 0xf800, 0x1168, 0x9982, 0x0400,
+	0x02b8, 0x9982, 0x0440, 0x0278, 0x9982, 0x0558, 0x0288, 0x9982,
+	0x0800, 0x1270, 0x0040, 0x9982, 0x0800, 0x0250, 0x2071, 0x188d,
+	0x7010, 0x9902, 0x1228, 0x9085, 0x0001, 0x001e, 0x00ee, 0x0005,
+	0x9006, 0x0cd8, 0x00e6, 0x2071, 0x1a1f, 0x7007, 0x0000, 0x9006,
+	0x701e, 0x7022, 0x7002, 0x2071, 0x0000, 0x7010, 0x9085, 0x8044,
+	0x7012, 0x00ee, 0x0005, 0x0126, 0x2091, 0x8000, 0x00e6, 0xa06f,
+	0x0000, 0x2071, 0x1a1f, 0x701c, 0x9088, 0x1a29, 0x280a, 0x8000,
+	0x9084, 0x003f, 0x701e, 0x7120, 0x9106, 0x090c, 0x0d7d, 0x7004,
+	0x9005, 0x1128, 0x00f6, 0x2079, 0x0080, 0x00a9, 0x00fe, 0x00ee,
+	0x012e, 0x0005, 0x0126, 0x2091, 0x8000, 0x00e6, 0x2071, 0x1a1f,
+	0x7004, 0x9005, 0x1128, 0x00f6, 0x2079, 0x0080, 0x0021, 0x00fe,
+	0x00ee, 0x012e, 0x0005, 0x7004, 0x9086, 0x0000, 0x1110, 0x7007,
+	0x0006, 0x7000, 0x0002, 0x115d, 0x12e0, 0x115b, 0x115b, 0x12d4,
+	0x12d4, 0x12d4, 0x12d4, 0x080c, 0x0d7d, 0x701c, 0x7120, 0x9106,
+	0x1148, 0x792c, 0x9184, 0x0001, 0x1120, 0xd1fc, 0x1110, 0x7007,
+	0x0000, 0x0005, 0x0096, 0x9180, 0x1a29, 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, 0x1a1f, 0x2104,
+	0xc095, 0x200a, 0x080c, 0x113a, 0x0005, 0x0016, 0x00e6, 0x2071,
+	0x1a1f, 0x00f6, 0x2079, 0x0080, 0x792c, 0xd1bc, 0x190c, 0x0d76,
+	0x782b, 0x0002, 0xd1fc, 0x0120, 0x918c, 0x0700, 0x7004, 0x0023,
+	0x00fe, 0x00ee, 0x001e, 0x0005, 0x114b, 0x11f3, 0x1227, 0x12ff,
+	0x0d7d, 0x131a, 0x0d7d, 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, 0x1190, 0x0005, 0x7008, 0x0096, 0x2048,
+	0xa86f, 0x0100, 0x009e, 0x7007, 0x0000, 0x080c, 0x114b, 0x0005,
+	0x7008, 0x0096, 0x2048, 0xa86f, 0x0200, 0x009e, 0x0ca0, 0x918c,
+	0x0700, 0x1150, 0x700c, 0x9005, 0x0180, 0x7800, 0x7802, 0x7804,
+	0x7806, 0x080c, 0x11a5, 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, 0x18b9, 0x2004, 0x9906, 0x1128, 0xa89c, 0x080f,
+	0x00de, 0x009e, 0x00a0, 0x00de, 0x009e, 0x0096, 0x00d6, 0x7008,
+	0x2048, 0x0081, 0x0150, 0xa89c, 0x0086, 0x2940, 0x080f, 0x008e,
+	0x00de, 0x009e, 0x080c, 0x113a, 0x0005, 0x00de, 0x009e, 0x080c,
+	0x113a, 0x0005, 0xa8a8, 0xd08c, 0x0005, 0x0096, 0xa0a0, 0x904d,
+	0x090c, 0x0d7d, 0xa06c, 0x908e, 0x0100, 0x0130, 0xa87b, 0x0030,
+	0xa883, 0x0000, 0xa897, 0x4002, 0x080c, 0x6c73, 0xa09f, 0x0000,
+	0xa0a3, 0x0000, 0x2848, 0x080c, 0x106d, 0x009e, 0x0005, 0x00a6,
+	0xa0a0, 0x904d, 0x090c, 0x0d7d, 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, 0x111b, 0x00e8, 0xa97c, 0xa894, 0x0016,
+	0x0006, 0x080c, 0x6c73, 0x000e, 0x001e, 0xd1fc, 0x1138, 0xd1f4,
+	0x0128, 0x00c6, 0x2060, 0x080c, 0xaad8, 0x00ce, 0x7008, 0x2048,
+	0xa89f, 0x0000, 0xa8a3, 0x0000, 0x080c, 0x106d, 0x7007, 0x0000,
+	0x080c, 0x113a, 0x00ae, 0x0005, 0x0126, 0x2091, 0x8000, 0x782b,
+	0x1001, 0x7007, 0x0005, 0x7000, 0xc094, 0x7002, 0x012e, 0x0005,
+	0x0096, 0x2001, 0x192e, 0x204c, 0xa87c, 0x7812, 0xa88c, 0x7802,
+	0xa890, 0x7806, 0xa894, 0x780a, 0xa898, 0x780e, 0x782b, 0x0020,
+	0x0126, 0x2091, 0x8000, 0x782b, 0x0041, 0x7007, 0x0003, 0x7000,
+	0xc084, 0x7002, 0x2900, 0x700a, 0x012e, 0x009e, 0x0005, 0x20e1,
+	0x0000, 0x2099, 0x0088, 0x782b, 0x0040, 0x0096, 0x2001, 0x192e,
+	0x204c, 0xaa7c, 0x009e, 0x080c, 0x8ae5, 0x2009, 0x188c, 0x2104,
+	0x9084, 0xfffc, 0x200a, 0x080c, 0x8958, 0x7007, 0x0000, 0x080c,
+	0x114b, 0x0005, 0x7007, 0x0000, 0x080c, 0x114b, 0x0005, 0x0126,
+	0x2091, 0x2200, 0x2079, 0x0300, 0x2071, 0x1a69, 0x7003, 0x0000,
+	0x78bf, 0x00f6, 0x0041, 0x7807, 0x0007, 0x7803, 0x0000, 0x7803,
+	0x0001, 0x012e, 0x0005, 0x00c6, 0x7803, 0x0000, 0x2001, 0x0165,
+	0x2003, 0x4198, 0x7808, 0xd09c, 0x0118, 0x7820, 0x04e9, 0x0cd0,
+	0x2001, 0x1a6a, 0x2003, 0x0000, 0x78ab, 0x0004, 0x78ac, 0xd0ac,
+	0x1de8, 0x78ab, 0x0002, 0x7807, 0x0007, 0x7827, 0x0030, 0x782b,
+	0x0400, 0x7827, 0x0031, 0x782b, 0x1a78, 0x781f, 0xff00, 0x781b,
+	0xff00, 0x2001, 0x0200, 0x2004, 0xd0dc, 0x0110, 0x781f, 0x0303,
+	0x2061, 0x1a78, 0x602f, 0x1ddc, 0x2001, 0x181a, 0x2004, 0x9082,
+	0x1ddc, 0x6032, 0x603b, 0x1e31, 0x602b, 0x1ab8, 0x6007, 0x1a98,
+	0x2061, 0x1a98, 0x60af, 0x193c, 0x2001, 0x1927, 0x2004, 0x60ba,
+	0x783f, 0x3334, 0x00ce, 0x0005, 0x9086, 0x000d, 0x11d0, 0x7808,
+	0xd09c, 0x01b8, 0x7820, 0x0026, 0x2010, 0x080c, 0xc711, 0x0180,
+	0x2260, 0x6000, 0x9086, 0x0004, 0x1158, 0x0016, 0x6120, 0x9186,
+	0x0009, 0x0108, 0x0020, 0x2009, 0x004c, 0x080c, 0xab77, 0x001e,
+	0x002e, 0x0005, 0x0126, 0x2091, 0x2200, 0x7908, 0x9184, 0x0070,
+	0x190c, 0x0d76, 0xd19c, 0x05a0, 0x7820, 0x908c, 0xf000, 0x0540,
+	0x2060, 0x6020, 0x9086, 0x0003, 0x1550, 0x6000, 0x9086, 0x0004,
+	0x1530, 0x6114, 0x2148, 0xa876, 0xa87a, 0xa867, 0x0103, 0x080c,
+	0x6a95, 0x00b6, 0x6010, 0x2058, 0xba3c, 0x8211, 0x0208, 0xba3e,
+	0xb8d0, 0x9005, 0x190c, 0x6658, 0x00be, 0x6044, 0xd0fc, 0x190c,
+	0xa7aa, 0x080c, 0xab01, 0x7808, 0xd09c, 0x19b0, 0x012e, 0x0005,
+	0x908a, 0x0024, 0x1a0c, 0x0d7d, 0x002b, 0x012e, 0x0005, 0x04b0,
+	0x012e, 0x0005, 0x13fe, 0x1424, 0x1454, 0x1459, 0x145d, 0x1462,
+	0x148a, 0x148e, 0x149c, 0x14a0, 0x13fe, 0x156b, 0x156f, 0x15d4,
+	0x15db, 0x13fe, 0x15dc, 0x15dd, 0x15e8, 0x15ef, 0x13fe, 0x13fe,
+	0x13fe, 0x13fe, 0x13fe, 0x13fe, 0x13fe, 0x1464, 0x13fe, 0x142c,
+	0x1451, 0x1418, 0x13fe, 0x1438, 0x1402, 0x1400, 0x080c, 0x0d7d,
+	0x080c, 0x0d76, 0x080c, 0x15fa, 0x2009, 0x1a77, 0x2104, 0x8000,
+	0x200a, 0x080c, 0x7e7f, 0x080c, 0x1a9e, 0x0005, 0x6044, 0xd0fc,
+	0x190c, 0xa7aa, 0x2009, 0x0055, 0x080c, 0xab77, 0x012e, 0x0005,
+	0x080c, 0x15fa, 0x2060, 0x6044, 0xd0fc, 0x190c, 0xa7aa, 0x2009,
+	0x0055, 0x080c, 0xab77, 0x0005, 0x2009, 0x0048, 0x080c, 0x15fa,
+	0x2060, 0x080c, 0xab77, 0x0005, 0x2009, 0x0054, 0x080c, 0x15fa,
+	0x2060, 0x6044, 0xd0fc, 0x190c, 0xa7aa, 0x080c, 0xab77, 0x0005,
+	0x080c, 0x15fa, 0x2060, 0x0056, 0x0066, 0x080c, 0x15fa, 0x2028,
+	0x080c, 0x15fa, 0x2030, 0x0036, 0x0046, 0x2021, 0x0000, 0x2418,
+	0x2009, 0x0056, 0x080c, 0xab77, 0x004e, 0x003e, 0x006e, 0x005e,
+	0x0005, 0x080c, 0x15fa, 0x0005, 0x7004, 0xc085, 0xc0b5, 0x7006,
+	0x0005, 0x7004, 0xc085, 0x7006, 0x0005, 0x080c, 0x15fa, 0x080c,
+	0x16be, 0x0005, 0x080c, 0x0d7d, 0x080c, 0x15fa, 0x2060, 0x6014,
+	0x0096, 0x2048, 0xa83b, 0xffff, 0x009e, 0x2009, 0x0048, 0x080c,
+	0xab77, 0x2001, 0x015d, 0x2003, 0x0000, 0x2009, 0x03e8, 0x8109,
+	0x0160, 0x2001, 0x0201, 0x2004, 0x9005, 0x0dc8, 0x2001, 0x0218,
+	0x2004, 0xd0ec, 0x1110, 0x080c, 0x15ff, 0x2001, 0x0307, 0x2003,
+	0x8000, 0x0005, 0x7004, 0xc095, 0x7006, 0x0005, 0x080c, 0x15fa,
+	0x2060, 0x6014, 0x0096, 0x2048, 0xa83b, 0xffff, 0x009e, 0x2009,
+	0x0048, 0x080c, 0xab77, 0x0005, 0x080c, 0x15fa, 0x080c, 0x0d7d,
+	0x080c, 0x15fa, 0x080c, 0x1556, 0x7827, 0x0018, 0x79ac, 0xd1dc,
+	0x0904, 0x1509, 0x7827, 0x0015, 0x7828, 0x782b, 0x0000, 0x9065,
+	0x0140, 0x2001, 0x020d, 0x2003, 0x0050, 0x2003, 0x0020, 0x0804,
+	0x150f, 0x7004, 0x9005, 0x01c8, 0x1188, 0x78ab, 0x0004, 0x7827,
+	0x0018, 0x782b, 0x0000, 0xd1bc, 0x090c, 0x0d7d, 0x2001, 0x020d,
+	0x2003, 0x0050, 0x2003, 0x0020, 0x0804, 0x153b, 0x78ab, 0x0004,
+	0x7803, 0x0001, 0x080c, 0x156f, 0x0005, 0x7827, 0x0018, 0xa001,
+	0x7828, 0x7827, 0x0011, 0xa001, 0x7928, 0x9106, 0x0110, 0x79ac,
+	0x08e0, 0x00e6, 0x2071, 0x0200, 0x702c, 0xd0c4, 0x0140, 0x00ee,
+	0x080c, 0x1a9e, 0x080c, 0x1333, 0x7803, 0x0001, 0x0005, 0x7037,
+	0x0001, 0xa001, 0x7150, 0x00ee, 0x918c, 0xff00, 0x9186, 0x0500,
+	0x0110, 0x79ac, 0x0810, 0x7004, 0xc09d, 0x7006, 0x78ab, 0x0004,
+	0x7803, 0x0001, 0x080c, 0x156f, 0x2001, 0x020d, 0x2003, 0x0020,
+	0x0005, 0x7828, 0x782b, 0x0000, 0x9065, 0x090c, 0x0d7d, 0x6014,
+	0x2048, 0x78ab, 0x0004, 0x918c, 0x0700, 0x0198, 0x080c, 0x7e7f,
+	0x080c, 0x1a9e, 0x080c, 0xc723, 0x0158, 0xa9ac, 0xa936, 0xa9b0,
+	0xa93a, 0xa83f, 0xffff, 0xa843, 0xffff, 0xa880, 0xc0bd, 0xa882,
+	0x0005, 0x6020, 0x9086, 0x0009, 0x1128, 0x2009, 0x004c, 0x080c,
+	0xab77, 0x0048, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc,
+	0x6024, 0x190c, 0xcb18, 0x2029, 0x00c8, 0x8529, 0x0128, 0x2001,
+	0x0201, 0x2004, 0x9005, 0x0dc8, 0x7dbc, 0x080c, 0xe573, 0xd5a4,
+	0x1118, 0x080c, 0x15ff, 0x0005, 0x080c, 0x7e7f, 0x080c, 0x1a9e,
+	0x0005, 0x781f, 0x0300, 0x7803, 0x0001, 0x0005, 0x0016, 0x0066,
+	0x0076, 0x00f6, 0x2079, 0x0300, 0x7908, 0x918c, 0x0007, 0x9186,
+	0x0003, 0x0120, 0x2001, 0x0016, 0x080c, 0x1670, 0x00fe, 0x007e,
+	0x006e, 0x001e, 0x0005, 0x7004, 0xc09d, 0x7006, 0x0005, 0x7104,
+	0x9184, 0x0004, 0x190c, 0x0d7d, 0xd184, 0x1189, 0xd19c, 0x0158,
+	0xc19c, 0x7106, 0x2001, 0x020d, 0x2003, 0x0050, 0x2003, 0x0020,
+	0x080c, 0x15ff, 0x0005, 0x81ff, 0x190c, 0x0d7d, 0x0005, 0xc184,
+	0xd1b4, 0xc1b4, 0x7106, 0x0016, 0x00e6, 0x15f0, 0x2071, 0x0200,
+	0x080c, 0x16ab, 0x05c8, 0x6014, 0x9005, 0x05b0, 0x0096, 0x2048,
+	0xa864, 0x009e, 0x9084, 0x00ff, 0x908e, 0x0029, 0x0160, 0x908e,
+	0x0048, 0x1550, 0x601c, 0xd084, 0x11e0, 0x00f6, 0x2c78, 0x080c,
+	0x1728, 0x00fe, 0x00b0, 0x00f6, 0x2c78, 0x080c, 0x18ad, 0x00fe,
+	0x2009, 0x01f4, 0x8109, 0x0168, 0x2001, 0x0201, 0x2004, 0x9005,
+	0x0dc8, 0x2001, 0x0218, 0x2004, 0xd0ec, 0x1118, 0x080c, 0x15ff,
+	0x0040, 0x2001, 0x020d, 0x2003, 0x0020, 0x080c, 0x1333, 0x7803,
+	0x0001, 0x00ee, 0x001e, 0x0005, 0x2001, 0x020d, 0x2003, 0x0050,
+	0x2003, 0x0020, 0x0461, 0x0ca8, 0x0429, 0x2060, 0x2009, 0x0053,
+	0x080c, 0xab77, 0x0005, 0x0005, 0x0005, 0x00e1, 0x2008, 0x00d1,
+	0x0006, 0x7004, 0xc09d, 0x7006, 0x000e, 0x080c, 0x8e42, 0x0005,
+	0x0089, 0x9005, 0x0118, 0x080c, 0x8a45, 0x0cd0, 0x0005, 0x2001,
+	0x0036, 0x2009, 0x1820, 0x210c, 0x2011, 0x181f, 0x2214, 0x080c,
+	0x1670, 0x0005, 0x7808, 0xd09c, 0x0de8, 0x7820, 0x0005, 0x080c,
+	0x1556, 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, 0x1662, 0x6827, 0x0001, 0x8109, 0x1dd0, 0x04d9, 0x6827,
+	0x0002, 0x04c1, 0x6804, 0x9005, 0x1130, 0x682c, 0xd0e4, 0x1500,
+	0x6804, 0x9005, 0x0de8, 0x79b8, 0xd1ec, 0x1130, 0x08c0, 0x080c,
+	0x7e7f, 0x080c, 0x1a9e, 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, 0x139a, 0x00ce, 0x002e, 0x001e, 0x000e,
+	0x0006, 0x7832, 0x7936, 0x7a3a, 0x781b, 0x8080, 0x0059, 0x1118,
+	0x000e, 0x00fe, 0x0005, 0x000e, 0x792c, 0x3900, 0x8000, 0x2004,
+	0x080c, 0x0d7d, 0x2009, 0xff00, 0x8109, 0x0120, 0x7818, 0xd0bc,
+	0x1dd8, 0x0005, 0x9085, 0x0001, 0x0005, 0x7832, 0x7936, 0x7a3a,
+	0x781b, 0x8080, 0x0c79, 0x1108, 0x0005, 0x792c, 0x3900, 0x8000,
+	0x2004, 0x080c, 0x0d7d, 0x7037, 0x0001, 0x7150, 0x7037, 0x0002,
+	0x7050, 0x2060, 0xd1bc, 0x1110, 0x7054, 0x2060, 0x918c, 0xff00,
+	0x9186, 0x0500, 0x0110, 0x9085, 0x0001, 0x0005, 0x00e6, 0x0016,
+	0x2071, 0x0200, 0x0c41, 0x6124, 0xd1dc, 0x01f8, 0x701c, 0xd08c,
+	0x0904, 0x171d, 0x7017, 0x0000, 0x2001, 0x0264, 0x2004, 0xd0bc,
+	0x0904, 0x171d, 0x2001, 0x0268, 0x00c6, 0x2064, 0x6104, 0x6038,
+	0x00ce, 0x918e, 0x0039, 0x1904, 0x171d, 0x9c06, 0x15f0, 0x0126,
+	0x2091, 0x2600, 0x080c, 0x7de7, 0x012e, 0x7358, 0x745c, 0x6014,
+	0x905d, 0x0598, 0x2b48, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be,
+	0xd0bc, 0x190c, 0xcaf3, 0xab42, 0xac3e, 0x2001, 0x1869, 0x2004,
+	0xd0b4, 0x1170, 0x601c, 0xd0e4, 0x1158, 0x6010, 0x00b6, 0x2058,
+	0xb800, 0x00be, 0xd0bc, 0x1120, 0xa83b, 0x7fff, 0xa837, 0xffff,
+	0x080c, 0x1e51, 0x1190, 0x080c, 0x18fc, 0x2a00, 0xa816, 0x0130,
+	0x2800, 0xa80e, 0x2c05, 0xa80a, 0x2c00, 0xa812, 0x7037, 0x0020,
+	0x781f, 0x0300, 0x001e, 0x00ee, 0x0005, 0x7037, 0x0050, 0x7037,
+	0x0020, 0x001e, 0x00ee, 0x080c, 0x15ff, 0x0005, 0x080c, 0x0d7d,
+	0x2cf0, 0x0126, 0x2091, 0x2200, 0x3e60, 0x6014, 0x2048, 0x2940,
+	0x903e, 0x2730, 0xa864, 0x2068, 0xa81a, 0x9d84, 0x000f, 0x9088,
+	0x1e31, 0x2165, 0x0002, 0x1752, 0x17c0, 0x1752, 0x1752, 0x1756,
+	0x17a1, 0x1752, 0x1776, 0x174b, 0x17b7, 0x1752, 0x1752, 0x175b,
+	0x18ab, 0x178a, 0x1780, 0xa964, 0x918c, 0x00ff, 0x918e, 0x0048,
+	0x0904, 0x17b7, 0x9085, 0x0001, 0x0804, 0x18a3, 0xa87c, 0xd0ac,
+	0x0dc8, 0x0804, 0x17c7, 0xa87c, 0xd0ac, 0x0da0, 0x0804, 0x1832,
+	0xa898, 0x901d, 0x1108, 0xab9c, 0x9016, 0xaab2, 0xaa3e, 0xaa42,
+	0x3e00, 0x9080, 0x0008, 0x2004, 0x9080, 0x900b, 0x2005, 0x9005,
+	0x090c, 0x0d7d, 0x2004, 0xa8ae, 0x0804, 0x188b, 0xa87c, 0xd0bc,
+	0x09c8, 0xa890, 0xa842, 0xa88c, 0xa83e, 0xa888, 0x0804, 0x17c7,
+	0xa87c, 0xd0bc, 0x0978, 0xa890, 0xa842, 0xa88c, 0xa83e, 0xa888,
+	0x0804, 0x1832, 0xa87c, 0xd0bc, 0x0928, 0xa890, 0xa842, 0xa88c,
+	0xa83e, 0xa804, 0x9045, 0x090c, 0x0d7d, 0xa164, 0xa91a, 0x91ec,
+	0x000f, 0x9d80, 0x1e31, 0x2065, 0xa888, 0xd19c, 0x1904, 0x1832,
+	0x0430, 0xa87c, 0xd0ac, 0x0904, 0x1752, 0xa804, 0x9045, 0x090c,
+	0x0d7d, 0xa164, 0xa91a, 0x91ec, 0x000f, 0x9d80, 0x1e31, 0x2065,
+	0x9006, 0xa842, 0xa83e, 0xd19c, 0x1904, 0x1832, 0x0080, 0xa87c,
+	0xd0ac, 0x0904, 0x1752, 0x9006, 0xa842, 0xa83e, 0x0804, 0x1832,
+	0xa87c, 0xd0ac, 0x0904, 0x1752, 0x9006, 0xa842, 0xa83e, 0x2c05,
+	0x908a, 0x0036, 0x1a0c, 0x0d7d, 0x9082, 0x001b, 0x0002, 0x17ea,
+	0x17ea, 0x17ec, 0x17ea, 0x17ea, 0x17ea, 0x17f6, 0x17ea, 0x17ea,
+	0x17ea, 0x1800, 0x17ea, 0x17ea, 0x17ea, 0x180a, 0x17ea, 0x17ea,
+	0x17ea, 0x1814, 0x17ea, 0x17ea, 0x17ea, 0x181e, 0x17ea, 0x17ea,
+	0x17ea, 0x1828, 0x080c, 0x0d7d, 0xa574, 0xa478, 0x9d86, 0x0024,
+	0x0904, 0x1760, 0xa37c, 0xa280, 0x0804, 0x188b, 0xa584, 0xa488,
+	0x9d86, 0x0024, 0x0904, 0x1760, 0xa38c, 0xa290, 0x0804, 0x188b,
+	0xa594, 0xa498, 0x9d86, 0x0024, 0x0904, 0x1760, 0xa39c, 0xa2a0,
+	0x0804, 0x188b, 0xa5a4, 0xa4a8, 0x9d86, 0x0024, 0x0904, 0x1760,
+	0xa3ac, 0xa2b0, 0x0804, 0x188b, 0xa5b4, 0xa4b8, 0x9d86, 0x0024,
+	0x0904, 0x1760, 0xa3bc, 0xa2c0, 0x0804, 0x188b, 0xa5c4, 0xa4c8,
+	0x9d86, 0x0024, 0x0904, 0x1760, 0xa3cc, 0xa2d0, 0x0804, 0x188b,
+	0xa5d4, 0xa4d8, 0x9d86, 0x0024, 0x0904, 0x1760, 0xa3dc, 0xa2e0,
+	0x0804, 0x188b, 0x2c05, 0x908a, 0x0034, 0x1a0c, 0x0d7d, 0x9082,
+	0x001b, 0x0002, 0x1855, 0x1853, 0x1853, 0x1853, 0x1853, 0x1853,
+	0x1860, 0x1853, 0x1853, 0x1853, 0x1853, 0x1853, 0x186b, 0x1853,
+	0x1853, 0x1853, 0x1853, 0x1853, 0x1876, 0x1853, 0x1853, 0x1853,
+	0x1853, 0x1853, 0x1881, 0x080c, 0x0d7d, 0xa56c, 0xa470, 0xa774,
+	0xa678, 0x9d86, 0x002c, 0x0904, 0x1760, 0xa37c, 0xa280, 0x0458,
+	0xa584, 0xa488, 0xa78c, 0xa690, 0x9d86, 0x002c, 0x0904, 0x1760,
+	0xa394, 0xa298, 0x0400, 0xa59c, 0xa4a0, 0xa7a4, 0xa6a8, 0x9d86,
+	0x002c, 0x0904, 0x1760, 0xa3ac, 0xa2b0, 0x00a8, 0xa5b4, 0xa4b8,
+	0xa7bc, 0xa6c0, 0x9d86, 0x002c, 0x0904, 0x1760, 0xa3c4, 0xa2c8,
+	0x0050, 0xa5cc, 0xa4d0, 0xa7d4, 0xa6d8, 0x9d86, 0x002c, 0x0904,
+	0x1760, 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, 0x1752, 0x2ff0, 0x0126, 0x2091,
+	0x2200, 0x3e60, 0x6014, 0x2048, 0x2940, 0xa80e, 0x2061, 0x1e2c,
+	0xa813, 0x1e2c, 0x2c05, 0xa80a, 0xa964, 0xa91a, 0xa87c, 0xd0ac,
+	0x090c, 0x0d7d, 0x9006, 0xa842, 0xa83e, 0x2c05, 0x908a, 0x0034,
+	0x1a0c, 0x0d7d, 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, 0x0d7d, 0xa80e, 0xa064, 0xa81a,
+	0x9084, 0x000f, 0x9080, 0x1e31, 0x2015, 0x82ff, 0x090c, 0x0d7d,
+	0xaa12, 0x2205, 0xa80a, 0x0c18, 0x903e, 0x2730, 0xa880, 0xd0fc,
+	0x1190, 0x2d00, 0x0002, 0x1a26, 0x1953, 0x1953, 0x1a26, 0x1953,
+	0x1a20, 0x1a26, 0x1953, 0x1a26, 0x19c3, 0x19c3, 0x1a26, 0x19c3,
+	0x1a26, 0x1a1d, 0x19c3, 0xc0fc, 0xa882, 0xab2c, 0xaa30, 0xad1c,
+	0xac20, 0xdd9c, 0x0904, 0x1a28, 0x2c05, 0x908a, 0x0034, 0x1a0c,
+	0x0d7d, 0x9082, 0x001b, 0x0002, 0x193f, 0x193d, 0x193d, 0x193d,
+	0x193d, 0x193d, 0x1943, 0x193d, 0x193d, 0x193d, 0x193d, 0x193d,
+	0x1947, 0x193d, 0x193d, 0x193d, 0x193d, 0x193d, 0x194b, 0x193d,
+	0x193d, 0x193d, 0x193d, 0x193d, 0x194f, 0x080c, 0x0d7d, 0xa774,
+	0xa678, 0x0804, 0x1a28, 0xa78c, 0xa690, 0x0804, 0x1a28, 0xa7a4,
+	0xa6a8, 0x0804, 0x1a28, 0xa7bc, 0xa6c0, 0x0804, 0x1a28, 0xa7d4,
+	0xa6d8, 0x0804, 0x1a28, 0xa898, 0x901d, 0x1108, 0xab9c, 0x9016,
+	0x2c05, 0x908a, 0x0036, 0x1a0c, 0x0d7d, 0x9082, 0x001b, 0x0002,
+	0x197b, 0x197b, 0x197d, 0x197b, 0x197b, 0x197b, 0x1987, 0x197b,
+	0x197b, 0x197b, 0x1991, 0x197b, 0x197b, 0x197b, 0x199b, 0x197b,
+	0x197b, 0x197b, 0x19a5, 0x197b, 0x197b, 0x197b, 0x19af, 0x197b,
+	0x197b, 0x197b, 0x19b9, 0x080c, 0x0d7d, 0xa574, 0xa478, 0x9d86,
+	0x0004, 0x0904, 0x1a28, 0xa37c, 0xa280, 0x0804, 0x1a28, 0xa584,
+	0xa488, 0x9d86, 0x0004, 0x0904, 0x1a28, 0xa38c, 0xa290, 0x0804,
+	0x1a28, 0xa594, 0xa498, 0x9d86, 0x0004, 0x0904, 0x1a28, 0xa39c,
+	0xa2a0, 0x0804, 0x1a28, 0xa5a4, 0xa4a8, 0x9d86, 0x0004, 0x0904,
+	0x1a28, 0xa3ac, 0xa2b0, 0x0804, 0x1a28, 0xa5b4, 0xa4b8, 0x9d86,
+	0x0004, 0x0904, 0x1a28, 0xa3bc, 0xa2c0, 0x0804, 0x1a28, 0xa5c4,
+	0xa4c8, 0x9d86, 0x0004, 0x0904, 0x1a28, 0xa3cc, 0xa2d0, 0x0804,
+	0x1a28, 0xa5d4, 0xa4d8, 0x9d86, 0x0004, 0x0904, 0x1a28, 0xa3dc,
+	0xa2e0, 0x0804, 0x1a28, 0xa898, 0x901d, 0x1108, 0xab9c, 0x9016,
+	0x2c05, 0x908a, 0x0034, 0x1a0c, 0x0d7d, 0x9082, 0x001b, 0x0002,
+	0x19eb, 0x19e9, 0x19e9, 0x19e9, 0x19e9, 0x19e9, 0x19f5, 0x19e9,
+	0x19e9, 0x19e9, 0x19e9, 0x19e9, 0x19ff, 0x19e9, 0x19e9, 0x19e9,
+	0x19e9, 0x19e9, 0x1a09, 0x19e9, 0x19e9, 0x19e9, 0x19e9, 0x19e9,
+	0x1a13, 0x080c, 0x0d7d, 0xa56c, 0xa470, 0xa774, 0xa678, 0x9d86,
+	0x000c, 0x05b0, 0xa37c, 0xa280, 0x0498, 0xa584, 0xa488, 0xa78c,
+	0xa690, 0x9d86, 0x000c, 0x0560, 0xa394, 0xa298, 0x0448, 0xa59c,
+	0xa4a0, 0xa7a4, 0xa6a8, 0x9d86, 0x000c, 0x0510, 0xa3ac, 0xa2b0,
+	0x00f8, 0xa5b4, 0xa4b8, 0xa7bc, 0xa6c0, 0x9d86, 0x000c, 0x01c0,
+	0xa3c4, 0xa2c8, 0x00a8, 0xa5cc, 0xa4d0, 0xa7d4, 0xa6d8, 0x9d86,
+	0x000c, 0x0170, 0xa3dc, 0xa2e0, 0x0058, 0x9d86, 0x000e, 0x1130,
+	0x080c, 0x1e07, 0x1904, 0x18fc, 0x900e, 0x0050, 0x080c, 0x0d7d,
+	0xab2e, 0xaa32, 0xad1e, 0xac22, 0xaf26, 0xae2a, 0x080c, 0x1e07,
+	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, 0xab77, 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, 0x139a, 0x8631,
+	0x1db8, 0x00ce, 0x781f, 0x0800, 0x2031, 0x0168, 0x00c6, 0x7808,
+	0xd09c, 0x190c, 0x139a, 0x00ce, 0x2001, 0x0038, 0x080c, 0x1b2b,
+	0x7930, 0x9186, 0x0040, 0x0160, 0x9186, 0x0042, 0x190c, 0x0d7d,
+	0x2001, 0x001e, 0x8001, 0x1df0, 0x8631, 0x1d40, 0x080c, 0x1b3a,
+	0x000e, 0x6022, 0x012e, 0x0005, 0x080c, 0x1b27, 0x7827, 0x0015,
+	0x7828, 0x9c06, 0x1db8, 0x782b, 0x0000, 0x0ca0, 0x00f6, 0x2079,
+	0x0300, 0x7803, 0x0000, 0x78ab, 0x0004, 0x00fe, 0x080c, 0x73e4,
+	0x11b0, 0x2001, 0x0138, 0x2003, 0x0000, 0x2001, 0x0160, 0x2003,
+	0x0000, 0x2011, 0x012c, 0xa001, 0xa001, 0x8211, 0x1de0, 0x0081,
+	0x2001, 0x0386, 0x2003, 0x2020, 0x080c, 0x7485, 0x0005, 0x0479,
+	0x0039, 0x2001, 0x0160, 0x2502, 0x2001, 0x0138, 0x2202, 0x0005,
+	0x00e6, 0x2071, 0x0200, 0x080c, 0x29c3, 0x2009, 0x003c, 0x080c,
+	0x2184, 0x2001, 0x015d, 0x2003, 0x0000, 0x7000, 0x9084, 0x003c,
+	0x1de0, 0x080c, 0x8420, 0x70a0, 0x70a2, 0x7098, 0x709a, 0x709c,
+	0x709e, 0x2001, 0x020d, 0x2003, 0x0020, 0x00f6, 0x2079, 0x0300,
+	0x080c, 0x1333, 0x7803, 0x0001, 0x00fe, 0x00ee, 0x0005, 0x2001,
+	0x0138, 0x2014, 0x2003, 0x0000, 0x2001, 0x0160, 0x202c, 0x2003,
+	0x0000, 0x080c, 0x73e4, 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, 0x1670, 0x7930,
+	0x0005, 0x2c08, 0x621c, 0x080c, 0x169d, 0x7930, 0x0005, 0x8001,
+	0x1df0, 0x0005, 0x2031, 0x0005, 0x781c, 0x9084, 0x0007, 0x0170,
+	0x2001, 0x0038, 0x0c41, 0x9186, 0x0040, 0x0904, 0x1b98, 0x2001,
+	0x001e, 0x0c69, 0x8631, 0x1d80, 0x080c, 0x0d7d, 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, 0x1b31, 0x9186, 0x0040, 0x190c, 0x0d7d,
+	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, 0x0d7d, 0xa001, 0xa001, 0x781f, 0x0200,
+	0x0005, 0x0126, 0x2091, 0x2400, 0x2079, 0x0380, 0x2001, 0x19e5,
+	0x2070, 0x012e, 0x0005, 0x2cf0, 0x0126, 0x2091, 0x2400, 0x3e60,
+	0x6014, 0x2048, 0xa964, 0xa91a, 0x918c, 0x00ff, 0x9184, 0x000f,
+	0x0002, 0x1bc1, 0x1bc1, 0x1bc1, 0x1bc3, 0x1bc1, 0x1bc1, 0x1bc1,
+	0x1bc1, 0x1bc1, 0x1bcb, 0x1bc1, 0x1bc7, 0x1bc1, 0x1bc1, 0x1bc1,
+	0x1bc1, 0x080c, 0x0d7d, 0x9186, 0x0013, 0x0128, 0x0cd0, 0x9186,
+	0x001b, 0x0108, 0x0cb0, 0xa87c, 0xd0b4, 0x0904, 0x1d3a, 0x9184,
+	0x000f, 0x9080, 0x1e31, 0x2015, 0x2205, 0xab88, 0x2908, 0xa80a,
+	0xa90e, 0xaa12, 0xab16, 0x9006, 0xa842, 0xa83e, 0x012e, 0x0005,
+	0x2cf0, 0x0126, 0x2091, 0x2400, 0x3e60, 0x6014, 0x2048, 0xa88c,
+	0xa990, 0xaaac, 0xabb0, 0xaa36, 0xab3a, 0xa83e, 0xa942, 0xa846,
+	0xa94a, 0xa964, 0x918c, 0x00ff, 0x9186, 0x001e, 0x0190, 0x2940,
+	0xa064, 0xa81a, 0x90ec, 0x000f, 0x9d80, 0x1e31, 0x2065, 0x2c05,
+	0x2808, 0x2c10, 0xab88, 0xa80a, 0xa90e, 0xaa12, 0xab16, 0x012e,
+	0x0005, 0xa804, 0x2040, 0x0c60, 0x2cf0, 0x0126, 0x2091, 0x2400,
+	0x3e60, 0x6014, 0x2048, 0xa97c, 0x2950, 0xd1dc, 0x1904, 0x1d04,
+	0xc1dd, 0xa97e, 0x9006, 0xa842, 0xa83e, 0xa988, 0x8109, 0xa916,
+	0xa964, 0xa91a, 0x9184, 0x000f, 0x9088, 0x1e31, 0x2145, 0x0002,
+	0x1c38, 0x1c46, 0x1c38, 0x1c38, 0x1c38, 0x1c3a, 0x1c38, 0x1c38,
+	0x1c9b, 0x1c9b, 0x1c38, 0x1c38, 0x1c38, 0x1c99, 0x1c38, 0x1c38,
+	0x080c, 0x0d7d, 0xa804, 0x2050, 0xb164, 0xa91a, 0x9184, 0x000f,
+	0x9080, 0x1e31, 0x2045, 0xd19c, 0x1904, 0x1c9b, 0x9036, 0x2638,
+	0x2805, 0x908a, 0x0036, 0x1a0c, 0x0d7d, 0x9082, 0x001b, 0x0002,
+	0x1c6b, 0x1c6b, 0x1c6d, 0x1c6b, 0x1c6b, 0x1c6b, 0x1c73, 0x1c6b,
+	0x1c6b, 0x1c6b, 0x1c79, 0x1c6b, 0x1c6b, 0x1c6b, 0x1c7f, 0x1c6b,
+	0x1c6b, 0x1c6b, 0x1c85, 0x1c6b, 0x1c6b, 0x1c6b, 0x1c8b, 0x1c6b,
+	0x1c6b, 0x1c6b, 0x1c91, 0x080c, 0x0d7d, 0xb574, 0xb478, 0xb37c,
+	0xb280, 0x0804, 0x1ce0, 0xb584, 0xb488, 0xb38c, 0xb290, 0x0804,
+	0x1ce0, 0xb594, 0xb498, 0xb39c, 0xb2a0, 0x0804, 0x1ce0, 0xb5a4,
+	0xb4a8, 0xb3ac, 0xb2b0, 0x0804, 0x1ce0, 0xb5b4, 0xb4b8, 0xb3bc,
+	0xb2c0, 0x0804, 0x1ce0, 0xb5c4, 0xb4c8, 0xb3cc, 0xb2d0, 0x0804,
+	0x1ce0, 0xb5d4, 0xb4d8, 0xb3dc, 0xb2e0, 0x0804, 0x1ce0, 0x0804,
+	0x1ce0, 0x080c, 0x0d7d, 0x2805, 0x908a, 0x0034, 0x1a0c, 0x0d7d,
+	0x9082, 0x001b, 0x0002, 0x1cbe, 0x1cbc, 0x1cbc, 0x1cbc, 0x1cbc,
+	0x1cbc, 0x1cc5, 0x1cbc, 0x1cbc, 0x1cbc, 0x1cbc, 0x1cbc, 0x1ccc,
+	0x1cbc, 0x1cbc, 0x1cbc, 0x1cbc, 0x1cbc, 0x1cd3, 0x1cbc, 0x1cbc,
+	0x1cbc, 0x1cbc, 0x1cbc, 0x1cda, 0x080c, 0x0d7d, 0xb56c, 0xb470,
+	0xb774, 0xb678, 0xb37c, 0xb280, 0x00d8, 0xb584, 0xb488, 0xb78c,
+	0xb690, 0xb394, 0xb298, 0x00a0, 0xb59c, 0xb4a0, 0xb7a4, 0xb6a8,
+	0xb3ac, 0xb2b0, 0x0068, 0xb5b4, 0xb4b8, 0xb7bc, 0xb6c0, 0xb3c4,
+	0xb2c8, 0x0030, 0xb5cc, 0xb4d0, 0xb7d4, 0xb6d8, 0xb3dc, 0xb2e0,
+	0xab2e, 0xaa32, 0xad1e, 0xac22, 0xaf26, 0xae2a, 0xa988, 0x8109,
+	0xa916, 0x1118, 0x9006, 0x012e, 0x0005, 0x8840, 0x2805, 0x9005,
+	0x1168, 0xb004, 0x9005, 0x090c, 0x0d7d, 0x2050, 0xb164, 0xa91a,
+	0x9184, 0x000f, 0x9080, 0x1e31, 0x2045, 0x2805, 0x2810, 0x2a08,
+	0xa80a, 0xa90e, 0xaa12, 0x0c30, 0x3e60, 0x6344, 0xd3fc, 0x190c,
+	0x0d7d, 0xa93c, 0xaa40, 0xa844, 0x9106, 0x1118, 0xa848, 0x9206,
+	0x0508, 0x2958, 0xab48, 0xac44, 0x2940, 0x080c, 0x1e51, 0x1998,
+	0x2850, 0x2c40, 0xab14, 0xa880, 0xd0fc, 0x1140, 0xa810, 0x2005,
+	0xa80a, 0x2a00, 0xa80e, 0x2009, 0x8015, 0x0070, 0x00c6, 0x3e60,
+	0x6044, 0xc0a4, 0x9085, 0x8005, 0x6046, 0x00ce, 0x8319, 0xab16,
+	0x1904, 0x1ced, 0x2009, 0x8005, 0x3e60, 0x6044, 0x9105, 0x6046,
+	0x0804, 0x1cea, 0x080c, 0x0d7d, 0x00f6, 0x00e6, 0x0096, 0x00c6,
+	0x0026, 0x704c, 0x9c06, 0x190c, 0x0d7d, 0x2079, 0x0090, 0x2001,
+	0x0105, 0x2003, 0x0010, 0x782b, 0x0004, 0x7057, 0x0000, 0x6014,
+	0x2048, 0x080c, 0xc723, 0x0118, 0xa880, 0xc0bd, 0xa882, 0x6020,
+	0x9086, 0x0006, 0x1170, 0x2061, 0x0100, 0x62c8, 0x2001, 0x00fa,
+	0x8001, 0x1df0, 0x60c8, 0x9206, 0x1dc0, 0x60c4, 0xa89a, 0x60c8,
+	0xa896, 0x704c, 0x2060, 0x00c6, 0x080c, 0xc32e, 0x080c, 0xa781,
+	0x00ce, 0x704c, 0x9c06, 0x1150, 0x2009, 0x0040, 0x080c, 0x2184,
+	0x080c, 0xa239, 0x2011, 0x0000, 0x080c, 0xa0b0, 0x002e, 0x00ce,
+	0x009e, 0x00ee, 0x00fe, 0x0005, 0x00f6, 0x2079, 0x0090, 0x781c,
+	0x0006, 0x7818, 0x0006, 0x2079, 0x0100, 0x7a14, 0x9284, 0x1984,
+	0x9085, 0x0012, 0x7816, 0x2019, 0x1000, 0x8319, 0x090c, 0x0d7d,
+	0x7820, 0xd0bc, 0x1dd0, 0x79c8, 0x000e, 0x9102, 0x001e, 0x0006,
+	0x0016, 0x79c4, 0x000e, 0x9103, 0x78c6, 0x000e, 0x78ca, 0x9284,
+	0x1984, 0x9085, 0x0012, 0x7816, 0x2079, 0x0090, 0x782b, 0x0008,
+	0x7057, 0x0000, 0x00fe, 0x0005, 0x00f6, 0x00e6, 0x2071, 0x19e5,
+	0x7054, 0x9086, 0x0000, 0x0904, 0x1e02, 0x2079, 0x0090, 0x2009,
+	0x0207, 0x210c, 0xd194, 0x01b8, 0x2009, 0x020c, 0x210c, 0x9184,
+	0x0003, 0x0188, 0x080c, 0xe5bc, 0x2001, 0x0133, 0x2004, 0x9005,
+	0x090c, 0x0d7d, 0x0016, 0x2009, 0x0040, 0x080c, 0x2184, 0x001e,
+	0x2001, 0x020c, 0x2102, 0x2009, 0x0206, 0x2104, 0x2009, 0x0203,
+	0x210c, 0x9106, 0x1120, 0x2009, 0x0040, 0x080c, 0x2184, 0x782c,
+	0xd0fc, 0x09a8, 0x080c, 0xa79d, 0x782c, 0xd0fc, 0x1de8, 0x080c,
+	0xa781, 0x7054, 0x9086, 0x0000, 0x1950, 0x782b, 0x0004, 0x782c,
+	0xd0ac, 0x1de8, 0x2009, 0x0040, 0x080c, 0x2184, 0x782b, 0x0002,
+	0x7057, 0x0000, 0x00ee, 0x00fe, 0x0005, 0x080c, 0x0d7d, 0x8c60,
+	0x2c05, 0x9005, 0x0110, 0x8a51, 0x0005, 0xa004, 0x9005, 0x0168,
+	0xa85a, 0x2040, 0xa064, 0x9084, 0x000f, 0x9080, 0x1e31, 0x2065,
+	0x8cff, 0x090c, 0x0d7d, 0x8a51, 0x0005, 0x2050, 0x0005, 0x0000,
+	0x001d, 0x0021, 0x0025, 0x0029, 0x002d, 0x0031, 0x0035, 0x0000,
+	0x001b, 0x0021, 0x0027, 0x002d, 0x0033, 0x0000, 0x0000, 0x0023,
+	0x0000, 0x0000, 0x1e24, 0x1e20, 0x1e24, 0x1e24, 0x1e2e, 0x0000,
+	0x1e24, 0x1e2b, 0x1e2b, 0x1e28, 0x1e2b, 0x1e2b, 0x0000, 0x1e2e,
+	0x1e2b, 0x0000, 0x1e26, 0x1e26, 0x0000, 0x1e26, 0x1e2e, 0x0000,
+	0x1e26, 0x1e2c, 0x1e2c, 0x1e2c, 0x0000, 0x1e2c, 0x0000, 0x1e2e,
+	0x1e2c, 0x00c6, 0x00d6, 0x0086, 0xab42, 0xac3e, 0xa888, 0x9055,
+	0x0904, 0x2028, 0x2940, 0xa064, 0x90ec, 0x000f, 0x9de0, 0x1e31,
+	0x9d86, 0x0007, 0x0130, 0x9d86, 0x000e, 0x0118, 0x9d86, 0x000f,
+	0x1120, 0xa08c, 0x9422, 0xa090, 0x931b, 0x2c05, 0x9065, 0x1140,
+	0x0310, 0x0804, 0x2028, 0xa004, 0x9045, 0x0904, 0x2028, 0x0c18,
+	0x2c05, 0x9005, 0x0904, 0x1f10, 0xdd9c, 0x1904, 0x1ecc, 0x908a,
+	0x0036, 0x1a0c, 0x0d7d, 0x9082, 0x001b, 0x0002, 0x1ea1, 0x1ea1,
+	0x1ea3, 0x1ea1, 0x1ea1, 0x1ea1, 0x1ea9, 0x1ea1, 0x1ea1, 0x1ea1,
+	0x1eaf, 0x1ea1, 0x1ea1, 0x1ea1, 0x1eb5, 0x1ea1, 0x1ea1, 0x1ea1,
+	0x1ebb, 0x1ea1, 0x1ea1, 0x1ea1, 0x1ec1, 0x1ea1, 0x1ea1, 0x1ea1,
+	0x1ec7, 0x080c, 0x0d7d, 0xa07c, 0x9422, 0xa080, 0x931b, 0x0804,
+	0x1f06, 0xa08c, 0x9422, 0xa090, 0x931b, 0x0804, 0x1f06, 0xa09c,
+	0x9422, 0xa0a0, 0x931b, 0x0804, 0x1f06, 0xa0ac, 0x9422, 0xa0b0,
+	0x931b, 0x0804, 0x1f06, 0xa0bc, 0x9422, 0xa0c0, 0x931b, 0x0804,
+	0x1f06, 0xa0cc, 0x9422, 0xa0d0, 0x931b, 0x0804, 0x1f06, 0xa0dc,
+	0x9422, 0xa0e0, 0x931b, 0x04d0, 0x908a, 0x0034, 0x1a0c, 0x0d7d,
+	0x9082, 0x001b, 0x0002, 0x1eee, 0x1eec, 0x1eec, 0x1eec, 0x1eec,
+	0x1eec, 0x1ef3, 0x1eec, 0x1eec, 0x1eec, 0x1eec, 0x1eec, 0x1ef8,
+	0x1eec, 0x1eec, 0x1eec, 0x1eec, 0x1eec, 0x1efd, 0x1eec, 0x1eec,
+	0x1eec, 0x1eec, 0x1eec, 0x1f02, 0x080c, 0x0d7d, 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, 0x2028, 0x8c60, 0x0804, 0x1e78,
+	0xa004, 0x9045, 0x0904, 0x2028, 0x0804, 0x1e5b, 0x8a51, 0x0904,
+	0x2028, 0x8c60, 0x2c05, 0x9005, 0x1158, 0xa004, 0x9045, 0x0904,
+	0x2028, 0xa064, 0x90ec, 0x000f, 0x9de0, 0x1e31, 0x2c05, 0x2060,
+	0xa880, 0xc0fc, 0xa882, 0x0804, 0x201d, 0x2c05, 0x8422, 0x8420,
+	0x831a, 0x9399, 0x0000, 0xac2e, 0xab32, 0xdd9c, 0x1904, 0x1fba,
+	0x9082, 0x001b, 0x0002, 0x1f56, 0x1f56, 0x1f58, 0x1f56, 0x1f56,
+	0x1f56, 0x1f66, 0x1f56, 0x1f56, 0x1f56, 0x1f74, 0x1f56, 0x1f56,
+	0x1f56, 0x1f82, 0x1f56, 0x1f56, 0x1f56, 0x1f90, 0x1f56, 0x1f56,
+	0x1f56, 0x1f9e, 0x1f56, 0x1f56, 0x1f56, 0x1fac, 0x080c, 0x0d7d,
+	0xa17c, 0x2400, 0x9122, 0xa180, 0x2300, 0x911b, 0x0a0c, 0x0d7d,
+	0xa074, 0x9420, 0xa078, 0x9319, 0x0804, 0x2018, 0xa18c, 0x2400,
+	0x9122, 0xa190, 0x2300, 0x911b, 0x0a0c, 0x0d7d, 0xa084, 0x9420,
+	0xa088, 0x9319, 0x0804, 0x2018, 0xa19c, 0x2400, 0x9122, 0xa1a0,
+	0x2300, 0x911b, 0x0a0c, 0x0d7d, 0xa094, 0x9420, 0xa098, 0x9319,
+	0x0804, 0x2018, 0xa1ac, 0x2400, 0x9122, 0xa1b0, 0x2300, 0x911b,
+	0x0a0c, 0x0d7d, 0xa0a4, 0x9420, 0xa0a8, 0x9319, 0x0804, 0x2018,
+	0xa1bc, 0x2400, 0x9122, 0xa1c0, 0x2300, 0x911b, 0x0a0c, 0x0d7d,
+	0xa0b4, 0x9420, 0xa0b8, 0x9319, 0x0804, 0x2018, 0xa1cc, 0x2400,
+	0x9122, 0xa1d0, 0x2300, 0x911b, 0x0a0c, 0x0d7d, 0xa0c4, 0x9420,
+	0xa0c8, 0x9319, 0x0804, 0x2018, 0xa1dc, 0x2400, 0x9122, 0xa1e0,
+	0x2300, 0x911b, 0x0a0c, 0x0d7d, 0xa0d4, 0x9420, 0xa0d8, 0x9319,
+	0x0804, 0x2018, 0x9082, 0x001b, 0x0002, 0x1fd8, 0x1fd6, 0x1fd6,
+	0x1fd6, 0x1fd6, 0x1fd6, 0x1fe5, 0x1fd6, 0x1fd6, 0x1fd6, 0x1fd6,
+	0x1fd6, 0x1ff2, 0x1fd6, 0x1fd6, 0x1fd6, 0x1fd6, 0x1fd6, 0x1fff,
+	0x1fd6, 0x1fd6, 0x1fd6, 0x1fd6, 0x1fd6, 0x200c, 0x080c, 0x0d7d,
+	0xa17c, 0x2400, 0x9122, 0xa180, 0x2300, 0x911b, 0x0a0c, 0x0d7d,
+	0xa06c, 0x9420, 0xa070, 0x9319, 0x0498, 0xa194, 0x2400, 0x9122,
+	0xa198, 0x2300, 0x911b, 0x0a0c, 0x0d7d, 0xa084, 0x9420, 0xa088,
+	0x9319, 0x0430, 0xa1ac, 0x2400, 0x9122, 0xa1b0, 0x2300, 0x911b,
+	0x0a0c, 0x0d7d, 0xa09c, 0x9420, 0xa0a0, 0x9319, 0x00c8, 0xa1c4,
+	0x2400, 0x9122, 0xa1c8, 0x2300, 0x911b, 0x0a0c, 0x0d7d, 0xa0b4,
+	0x9420, 0xa0b8, 0x9319, 0x0060, 0xa1dc, 0x2400, 0x9122, 0xa1e0,
+	0x2300, 0x911b, 0x0a0c, 0x0d7d, 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, 0x00c6, 0x610c,
+	0x0016, 0x9026, 0x2410, 0x6004, 0x9420, 0x9291, 0x0000, 0x2c04,
+	0x9210, 0x9ce0, 0x0002, 0x918a, 0x0002, 0x1da8, 0x9284, 0x000f,
+	0x9405, 0x001e, 0x00ce, 0x0005, 0x7803, 0x0003, 0x780f, 0x0000,
+	0x6004, 0x7812, 0x2c04, 0x7816, 0x9ce0, 0x0002, 0x918a, 0x0002,
+	0x1db8, 0x0005, 0x2001, 0x0005, 0x2004, 0xd0bc, 0x190c, 0x0d76,
+	0xd094, 0x0110, 0x080c, 0x11d5, 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, 0x2181, 0x7900, 0xd1dc, 0x1118, 0x9084, 0x0006, 0x001a,
+	0x9084, 0x000e, 0x0002, 0x20a3, 0x209b, 0x7de7, 0x209b, 0x209d,
+	0x209d, 0x209d, 0x209d, 0x7dcd, 0x209b, 0x209f, 0x209b, 0x209d,
+	0x209b, 0x209d, 0x209b, 0x080c, 0x0d7d, 0x0031, 0x0020, 0x080c,
+	0x7dcd, 0x080c, 0x7de7, 0x0005, 0x0006, 0x0016, 0x0026, 0x080c,
+	0xe5bc, 0x7930, 0x9184, 0x0003, 0x01f0, 0x080c, 0xa781, 0x2001,
+	0x19f8, 0x2004, 0x9005, 0x0180, 0x2001, 0x0133, 0x2004, 0x9005,
+	0x090c, 0x0d7d, 0x00c6, 0x2001, 0x19f8, 0x2064, 0x080c, 0xa79d,
+	0x080c, 0xc32e, 0x00ce, 0x0408, 0x2009, 0x0040, 0x080c, 0x2184,
+	0x080c, 0xa79d, 0x00d0, 0x9184, 0x0014, 0x01a0, 0x6a00, 0x9286,
+	0x0003, 0x0160, 0x080c, 0x73e4, 0x1138, 0x080c, 0x76e8, 0x080c,
+	0x5f41, 0x080c, 0x7315, 0x0010, 0x080c, 0x5dfc, 0x080c, 0x7e75,
+	0x0041, 0x0018, 0x9184, 0x9540, 0x1dc8, 0x002e, 0x001e, 0x000e,
+	0x0005, 0x00e6, 0x0036, 0x0046, 0x0056, 0x2071, 0x1a69, 0x080c,
+	0x1a9e, 0x005e, 0x004e, 0x003e, 0x00ee, 0x0005, 0x0126, 0x2091,
+	0x2e00, 0x2071, 0x1800, 0x7128, 0x2001, 0x196f, 0x2102, 0x2001,
+	0x1977, 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, 0x0d76, 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, 0x29bd, 0x080c, 0x28ea, 0x080c, 0x2a2e, 0x9006, 0x080c,
+	0x2919, 0x9006, 0x080c, 0x28fc, 0x20a9, 0x0012, 0x1d04, 0x21ae,
+	0x2091, 0x6000, 0x1f04, 0x21ae, 0x602f, 0x0100, 0x602f, 0x0000,
+	0x6050, 0x9085, 0x0400, 0x9084, 0xdfff, 0x6052, 0x6224, 0x080c,
+	0x2a0b, 0x080c, 0x2608, 0x2009, 0x00ef, 0x6132, 0x6136, 0x080c,
+	0x2618, 0x60e7, 0x0000, 0x61ea, 0x60e3, 0x0008, 0x604b, 0xf7f7,
+	0x6043, 0x0000, 0x602f, 0x0080, 0x602f, 0x0000, 0x6007, 0x349f,
+	0x00c6, 0x2061, 0x0140, 0x608b, 0x000b, 0x608f, 0x10b8, 0x6093,
+	0x0000, 0x6097, 0x0198, 0x00ce, 0x6004, 0x9085, 0x8000, 0x6006,
+	0x60bb, 0x0000, 0x20a9, 0x0018, 0x60bf, 0x0000, 0x1f04, 0x21ec,
+	0x60bb, 0x0000, 0x60bf, 0x0108, 0x60bf, 0x0012, 0x60bf, 0x0405,
+	0x60bf, 0x0014, 0x60bf, 0x0320, 0x60bf, 0x0018, 0x601b, 0x00f0,
+	0x601f, 0x001e, 0x600f, 0x006b, 0x602b, 0x402c, 0x012e, 0x0005,
+	0x00f6, 0x2079, 0x0140, 0x78c3, 0x0080, 0x78c3, 0x0083, 0x78c3,
+	0x0000, 0x00fe, 0x0005, 0x2001, 0x1835, 0x2003, 0x0000, 0x2001,
+	0x1834, 0x2003, 0x0001, 0x0005, 0x0126, 0x2091, 0x2800, 0x0006,
+	0x0016, 0x0026, 0x6124, 0x6028, 0x910c, 0x0066, 0x2031, 0x1837,
+	0x2634, 0x96b4, 0x0028, 0x006e, 0x1138, 0x6020, 0xd1bc, 0x0120,
+	0xd0bc, 0x1168, 0xd0b4, 0x1198, 0x9184, 0x5e2c, 0x1118, 0x9184,
+	0x0007, 0x00aa, 0x9195, 0x0004, 0x9284, 0x0007, 0x0082, 0x0016,
+	0x2001, 0x0387, 0x200c, 0xd1a4, 0x001e, 0x0d70, 0x0c98, 0x0016,
+	0x2001, 0x0387, 0x200c, 0xd1b4, 0x001e, 0x0d30, 0x0c58, 0x225a,
+	0x2257, 0x2257, 0x2257, 0x2259, 0x2257, 0x2257, 0x2257, 0x080c,
+	0x0d7d, 0x0029, 0x002e, 0x001e, 0x000e, 0x012e, 0x0005, 0x00a6,
+	0x6124, 0x6028, 0xd09c, 0x0118, 0xd19c, 0x1904, 0x24d4, 0xd1f4,
+	0x190c, 0x0d76, 0x080c, 0x73e4, 0x0904, 0x22b7, 0x080c, 0xce35,
+	0x1120, 0x7000, 0x9086, 0x0003, 0x0580, 0x6024, 0x9084, 0x1800,
+	0x0560, 0x080c, 0x7407, 0x0118, 0x080c, 0x73f5, 0x1530, 0x2011,
+	0x0020, 0x080c, 0x2a0b, 0x6043, 0x0000, 0x080c, 0xce35, 0x0168,
+	0x080c, 0x7407, 0x1150, 0x2001, 0x19a5, 0x2003, 0x0001, 0x6027,
+	0x1800, 0x080c, 0x725a, 0x0804, 0x24d7, 0x70a4, 0x9005, 0x1150,
+	0x70a7, 0x0001, 0x00d6, 0x2069, 0x0140, 0x080c, 0x743b, 0x00de,
+	0x1904, 0x24d7, 0x080c, 0x76f2, 0x0428, 0x080c, 0x7407, 0x1590,
+	0x6024, 0x9084, 0x1800, 0x1108, 0x0468, 0x080c, 0x76f2, 0x080c,
+	0x76e8, 0x080c, 0x5f41, 0x080c, 0x7315, 0x0804, 0x24d4, 0xd1ac,
+	0x1508, 0x6024, 0xd0dc, 0x1170, 0xd0e4, 0x1178, 0xd0d4, 0x1190,
+	0xd0cc, 0x0130, 0x7098, 0x9086, 0x0028, 0x1110, 0x080c, 0x75c9,
+	0x0804, 0x24d4, 0x080c, 0x76ed, 0x0048, 0x2001, 0x197d, 0x2003,
+	0x0002, 0x0020, 0x080c, 0x7526, 0x0804, 0x24d4, 0x080c, 0x766c,
+	0x0804, 0x24d4, 0x6220, 0xd1bc, 0x0138, 0xd2bc, 0x1904, 0x2539,
+	0xd2b4, 0x1904, 0x254b, 0x0000, 0xd1ac, 0x0904, 0x23e1, 0x0036,
+	0x6328, 0xc3bc, 0x632a, 0x003e, 0x080c, 0x73e4, 0x11d0, 0x2011,
+	0x0020, 0x080c, 0x2a0b, 0x0006, 0x0026, 0x0036, 0x080c, 0x73fe,
+	0x1158, 0x080c, 0x76e8, 0x080c, 0x5f41, 0x080c, 0x7315, 0x003e,
+	0x002e, 0x000e, 0x00ae, 0x0005, 0x003e, 0x002e, 0x000e, 0x080c,
+	0x73b8, 0x0016, 0x0046, 0x00c6, 0x644c, 0x9486, 0xf0f0, 0x1138,
+	0x2061, 0x0100, 0x644a, 0x6043, 0x0090, 0x6043, 0x0010, 0x74da,
+	0x948c, 0xff00, 0x7038, 0xd084, 0x0178, 0x9186, 0xf800, 0x1160,
+	0x7048, 0xd084, 0x1148, 0xc085, 0x704a, 0x0036, 0x2418, 0x2011,
+	0x8016, 0x080c, 0x4a38, 0x003e, 0x080c, 0xce2e, 0x1904, 0x23b8,
+	0x9196, 0xff00, 0x05a8, 0x7060, 0x9084, 0x00ff, 0x810f, 0x81ff,
+	0x0110, 0x9116, 0x0568, 0x7130, 0xd184, 0x1550, 0x080c, 0x3328,
+	0x0128, 0xc18d, 0x7132, 0x080c, 0x6962, 0x1510, 0x6240, 0x9294,
+	0x0010, 0x0130, 0x6248, 0x9294, 0xff00, 0x9296, 0xff00, 0x01c0,
+	0x7030, 0xd08c, 0x0904, 0x23b8, 0x7038, 0xd08c, 0x1140, 0x2001,
+	0x180c, 0x200c, 0xd1ac, 0x1904, 0x23b8, 0xc1ad, 0x2102, 0x0036,
+	0x73d8, 0x2011, 0x8013, 0x080c, 0x4a38, 0x003e, 0x0804, 0x23b8,
+	0x7038, 0xd08c, 0x1140, 0x2001, 0x180c, 0x200c, 0xd1ac, 0x1904,
+	0x23b8, 0xc1ad, 0x2102, 0x0036, 0x73d8, 0x2011, 0x8013, 0x080c,
+	0x4a38, 0x003e, 0x7130, 0xc185, 0x7132, 0x2011, 0x1848, 0x220c,
+	0xd1a4, 0x01f0, 0x0016, 0x2009, 0x0001, 0x2011, 0x0100, 0x080c,
+	0x87b6, 0x2019, 0x000e, 0x00c6, 0x2061, 0x0000, 0x080c, 0xe101,
+	0x00ce, 0x9484, 0x00ff, 0x9080, 0x3334, 0x200d, 0x918c, 0xff00,
+	0x810f, 0x2120, 0x9006, 0x2009, 0x000e, 0x080c, 0xe191, 0x001e,
+	0x0016, 0x2009, 0x0002, 0x2019, 0x0004, 0x080c, 0x316a, 0x001e,
+	0x0078, 0x0156, 0x00b6, 0x20a9, 0x007f, 0x900e, 0x080c, 0x652d,
+	0x1110, 0x080c, 0x5f5b, 0x8108, 0x1f04, 0x23ae, 0x00be, 0x015e,
+	0x00ce, 0x004e, 0x080c, 0xa781, 0x080c, 0xaa49, 0x080c, 0xa79d,
+	0x60e3, 0x0000, 0x001e, 0x2001, 0x1800, 0x2014, 0x9296, 0x0004,
+	0x1170, 0xd19c, 0x11b0, 0x2011, 0x180c, 0x2214, 0xd29c, 0x1120,
+	0x6204, 0x9295, 0x0002, 0x6206, 0x6228, 0xc29d, 0x622a, 0x2003,
+	0x0001, 0x2001, 0x1826, 0x2003, 0x0000, 0x2011, 0x0020, 0x080c,
+	0x2a0b, 0xd194, 0x0904, 0x24d4, 0x0016, 0x080c, 0xa781, 0x6220,
+	0xd2b4, 0x0904, 0x246f, 0x080c, 0x85c0, 0x080c, 0x9d09, 0x2011,
+	0x0004, 0x080c, 0x2a0b, 0x00f6, 0x2019, 0x19f1, 0x2304, 0x907d,
+	0x0904, 0x243c, 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, 0x29e1, 0x2001, 0x001e,
+	0x8001, 0x0240, 0x20a9, 0x0009, 0x080c, 0x2998, 0x6904, 0xd1dc,
+	0x1140, 0x0cb0, 0x2001, 0x0100, 0x080c, 0x29d1, 0x9006, 0x080c,
+	0x29d1, 0x080c, 0x94a8, 0x080c, 0xa79d, 0x7814, 0x2048, 0xa867,
+	0x0103, 0x2f60, 0x080c, 0xaad8, 0x009e, 0x00ee, 0x00ce, 0x00de,
+	0x00fe, 0x001e, 0x00ae, 0x0005, 0x00fe, 0x00d6, 0x2069, 0x0140,
+	0x6804, 0x9084, 0x4000, 0x0110, 0x080c, 0x29e1, 0x00de, 0x00c6,
+	0x2061, 0x19e5, 0x6034, 0x080c, 0xce35, 0x0120, 0x909a, 0x0003,
+	0x1258, 0x0018, 0x909a, 0x00c8, 0x1238, 0x8000, 0x6036, 0x00ce,
+	0x080c, 0x9ce1, 0x0804, 0x24d1, 0x2061, 0x0100, 0x62c0, 0x080c,
+	0xa6b7, 0x2019, 0x19f1, 0x2304, 0x9065, 0x0130, 0x6003, 0x0001,
+	0x2009, 0x0027, 0x080c, 0xab77, 0x00ce, 0x0804, 0x24d1, 0xd2bc,
+	0x0904, 0x24b4, 0x080c, 0x85cd, 0x2011, 0x0004, 0x080c, 0x2a0b,
+	0x00d6, 0x2069, 0x0140, 0x6804, 0x9084, 0x4000, 0x0110, 0x080c,
+	0x29e1, 0x00de, 0x00c6, 0x2061, 0x19e5, 0x6050, 0x080c, 0xce35,
+	0x0120, 0x909a, 0x0003, 0x1668, 0x0018, 0x909a, 0x00c8, 0x1648,
+	0x8000, 0x6052, 0x604c, 0x00ce, 0x9005, 0x05d8, 0x2009, 0x07d0,
+	0x080c, 0x85c5, 0x9080, 0x0008, 0x2004, 0x9086, 0x0006, 0x1138,
+	0x2009, 0x1984, 0x2011, 0x0012, 0x080c, 0x2a1a, 0x0450, 0x9080,
+	0x0008, 0x2004, 0x9086, 0x0009, 0x0d98, 0x2009, 0x1984, 0x2011,
+	0x0016, 0x080c, 0x2a1a, 0x00e8, 0x2011, 0x0004, 0x080c, 0x2a0b,
+	0x00c0, 0x0036, 0x2019, 0x0001, 0x080c, 0x9fef, 0x003e, 0x2019,
+	0x19f8, 0x2304, 0x9065, 0x0160, 0x2009, 0x004f, 0x6020, 0x9086,
+	0x0009, 0x1110, 0x2009, 0x004f, 0x6003, 0x0003, 0x080c, 0xab77,
+	0x00ce, 0x080c, 0xa79d, 0x001e, 0xd19c, 0x0904, 0x2532, 0x7038,
+	0xd0ac, 0x1538, 0x0016, 0x0156, 0x2011, 0x0008, 0x080c, 0x2a0b,
+	0x6050, 0xc0e5, 0x6052, 0x20a9, 0x0367, 0x1f04, 0x24ff, 0x1d04,
+	0x24e7, 0x080c, 0x85f4, 0x6020, 0xd09c, 0x1db8, 0x00f6, 0x2079,
+	0x0100, 0x080c, 0x2948, 0x00fe, 0x1d80, 0x6050, 0xc0e4, 0x6052,
+	0x2011, 0x0008, 0x080c, 0x2a0b, 0x015e, 0x001e, 0x0498, 0x015e,
+	0x001e, 0x0016, 0x6028, 0xc09c, 0x602a, 0x080c, 0xa781, 0x080c,
+	0xaa49, 0x080c, 0xa79d, 0x60e3, 0x0000, 0x080c, 0xe59b, 0x080c,
+	0xe5b6, 0x080c, 0x5600, 0xd0fc, 0x1138, 0x080c, 0xce2e, 0x1120,
+	0x9085, 0x0001, 0x080c, 0x742b, 0x9006, 0x080c, 0x29d1, 0x2009,
+	0x0002, 0x080c, 0x29bd, 0x00e6, 0x2071, 0x1800, 0x7003, 0x0004,
+	0x080c, 0x0eb4, 0x00ee, 0x2011, 0x0008, 0x080c, 0x2a0b, 0x080c,
+	0x0bc3, 0x001e, 0x918c, 0xffd0, 0x2110, 0x080c, 0x2a0b, 0x00ae,
+	0x0005, 0x0016, 0x2001, 0x0387, 0x200c, 0xd1a4, 0x001e, 0x0904,
+	0x22e4, 0x0016, 0x2009, 0x2545, 0x00c0, 0x2001, 0x0387, 0x2003,
+	0x1000, 0x001e, 0x0c38, 0x0016, 0x2001, 0x0387, 0x200c, 0xd1b4,
+	0x001e, 0x0904, 0x22e4, 0x0016, 0x2009, 0x2557, 0x0030, 0x2001,
+	0x0387, 0x2003, 0x4000, 0x001e, 0x08a8, 0x6028, 0xc0bc, 0x602a,
+	0x2001, 0x0156, 0x2003, 0xbc91, 0x8000, 0x2003, 0xffff, 0x6043,
+	0x0001, 0x080c, 0x29b7, 0x2011, 0x0080, 0x080c, 0x2a0b, 0x6017,
+	0x0000, 0x6043, 0x0000, 0x0817, 0x0006, 0x0016, 0x0026, 0x0036,
+	0x00e6, 0x00f6, 0x0126, 0x2091, 0x8000, 0x2071, 0x1800, 0x71d0,
+	0x70d2, 0x9116, 0x0904, 0x25c7, 0x81ff, 0x01a0, 0x2009, 0x0000,
+	0x080c, 0x29bd, 0x2011, 0x8011, 0x2019, 0x010e, 0x231c, 0x939e,
+	0x0007, 0x1118, 0x2019, 0x0001, 0x0010, 0x2019, 0x0000, 0x080c,
+	0x4a38, 0x0468, 0x2001, 0x19a6, 0x200c, 0x81ff, 0x1140, 0x2001,
+	0x0109, 0x2004, 0xd0b4, 0x0118, 0x2019, 0x0003, 0x0008, 0x2118,
+	0x2011, 0x8012, 0x080c, 0x4a38, 0x080c, 0x0eb4, 0x080c, 0x5600,
+	0xd0fc, 0x11a8, 0x080c, 0xce2e, 0x1190, 0x00c6, 0x080c, 0x2663,
+	0x080c, 0xa781, 0x080c, 0x9f4a, 0x080c, 0xa79d, 0x2061, 0x0100,
+	0x2019, 0x0028, 0x2009, 0x0002, 0x080c, 0x316a, 0x00ce, 0x012e,
+	0x00fe, 0x00ee, 0x003e, 0x002e, 0x001e, 0x000e, 0x0005, 0x2028,
+	0x918c, 0x00ff, 0x2130, 0x9094, 0xff00, 0x11f0, 0x2011, 0x1837,
+	0x2214, 0xd2ac, 0x11c8, 0x81ff, 0x01e8, 0x2011, 0x181f, 0x2204,
+	0x9106, 0x1190, 0x2011, 0x1820, 0x2214, 0x9294, 0xff00, 0x9584,
+	0xff00, 0x9206, 0x1148, 0x2011, 0x1820, 0x2214, 0x9294, 0x00ff,
+	0x9584, 0x00ff, 0x9206, 0x1120, 0x2500, 0x080c, 0x80cc, 0x0048,
+	0x9584, 0x00ff, 0x9080, 0x3334, 0x200d, 0x918c, 0xff00, 0x810f,
+	0x9006, 0x0005, 0x9080, 0x3334, 0x200d, 0x918c, 0x00ff, 0x0005,
+	0x00d6, 0x2069, 0x0140, 0x2001, 0x1818, 0x2003, 0x00ef, 0x20a9,
+	0x0010, 0x9006, 0x6852, 0x6856, 0x1f04, 0x2613, 0x00de, 0x0005,
+	0x0006, 0x00d6, 0x0026, 0x2069, 0x0140, 0x2001, 0x1818, 0x2102,
+	0x8114, 0x8214, 0x8214, 0x8214, 0x20a9, 0x0010, 0x6853, 0x0000,
+	0x9006, 0x82ff, 0x1128, 0x9184, 0x000f, 0x9080, 0xe5ca, 0x2005,
+	0x6856, 0x8211, 0x1f04, 0x2628, 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, 0x2658, 0x680f, 0x0000, 0x000e, 0x001e, 0x002e,
+	0x00de, 0x015e, 0x0005, 0x080c, 0x55fc, 0xd0c4, 0x0150, 0xd0a4,
+	0x0140, 0x9006, 0x0046, 0x2020, 0x2009, 0x002e, 0x080c, 0xe191,
+	0x004e, 0x0005, 0x00f6, 0x0016, 0x0026, 0x2079, 0x0140, 0x78c4,
+	0xd0dc, 0x0904, 0x26cf, 0x080c, 0x2938, 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, 0x9030,
+	0x928c, 0xff00, 0x0110, 0x2011, 0x00ff, 0x2200, 0x8007, 0x9085,
+	0x004c, 0x78c2, 0x2009, 0x0138, 0x220a, 0x080c, 0x73e4, 0x1118,
+	0x2009, 0x196d, 0x220a, 0x002e, 0x001e, 0x00fe, 0x0005, 0x78c3,
+	0x0000, 0x0cc8, 0x0126, 0x2091, 0x2800, 0x0006, 0x0016, 0x0026,
+	0x2001, 0x0170, 0x200c, 0x8000, 0x2014, 0x9184, 0x0003, 0x0110,
+	0x080c, 0x0d76, 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, 0x198e, 0x2004, 0x908a, 0x0007, 0x1a0c, 0x0d7d, 0x0033,
+	0x00ee, 0x002e, 0x001e, 0x000e, 0x015e, 0x0005, 0x272d, 0x274b,
+	0x276f, 0x2771, 0x279a, 0x279c, 0x279e, 0x2001, 0x0001, 0x080c,
+	0x2574, 0x080c, 0x2982, 0x2001, 0x1990, 0x2003, 0x0000, 0x7828,
+	0x9084, 0xe1d7, 0x782a, 0x9006, 0x20a9, 0x0009, 0x080c, 0x2954,
+	0x2001, 0x198e, 0x2003, 0x0006, 0x2009, 0x001e, 0x2011, 0x279f,
+	0x080c, 0x85d2, 0x0005, 0x2009, 0x1993, 0x200b, 0x0000, 0x2001,
+	0x1998, 0x2003, 0x0036, 0x2001, 0x1997, 0x2003, 0x002a, 0x2001,
+	0x1990, 0x2003, 0x0001, 0x9006, 0x080c, 0x28fc, 0x2001, 0xffff,
+	0x20a9, 0x0009, 0x080c, 0x2954, 0x2001, 0x198e, 0x2003, 0x0006,
+	0x2009, 0x001e, 0x2011, 0x279f, 0x080c, 0x85d2, 0x0005, 0x080c,
+	0x0d7d, 0x2001, 0x1998, 0x2003, 0x0036, 0x2001, 0x1990, 0x2003,
+	0x0003, 0x7a38, 0x9294, 0x0005, 0x9296, 0x0004, 0x0110, 0x9006,
+	0x0010, 0x2001, 0x0001, 0x080c, 0x28fc, 0x2001, 0x1994, 0x2003,
+	0x0000, 0x2001, 0xffff, 0x20a9, 0x0009, 0x080c, 0x2954, 0x2001,
+	0x198e, 0x2003, 0x0006, 0x2009, 0x001e, 0x2011, 0x279f, 0x080c,
+	0x85d2, 0x0005, 0x080c, 0x0d7d, 0x080c, 0x0d7d, 0x0005, 0x0006,
+	0x0016, 0x0026, 0x00e6, 0x00f6, 0x0156, 0x0126, 0x2091, 0x8000,
+	0x2079, 0x0100, 0x2001, 0x1990, 0x2004, 0x908a, 0x0007, 0x1a0c,
+	0x0d7d, 0x0043, 0x012e, 0x015e, 0x00fe, 0x00ee, 0x002e, 0x001e,
+	0x000e, 0x0005, 0x27c1, 0x27e1, 0x2821, 0x2851, 0x2875, 0x2885,
+	0x2887, 0x080c, 0x2948, 0x11b0, 0x7850, 0x9084, 0xefff, 0x7852,
+	0x2009, 0x1996, 0x2104, 0x7a38, 0x9294, 0x0005, 0x9296, 0x0004,
+	0x0110, 0xc08d, 0x0008, 0xc085, 0x200a, 0x2001, 0x198e, 0x2003,
+	0x0001, 0x0030, 0x080c, 0x28ab, 0x2001, 0xffff, 0x080c, 0x273c,
+	0x0005, 0x080c, 0x2889, 0x05e0, 0x2009, 0x1997, 0x2104, 0x8001,
+	0x200a, 0x080c, 0x2948, 0x1178, 0x7850, 0x9084, 0xefff, 0x7852,
+	0x7a38, 0x9294, 0x0005, 0x9296, 0x0005, 0x0518, 0x2009, 0x1996,
+	0x2104, 0xc085, 0x200a, 0x2009, 0x1993, 0x2104, 0x8000, 0x200a,
+	0x9086, 0x0005, 0x0118, 0x080c, 0x2891, 0x00c0, 0x200b, 0x0000,
+	0x7a38, 0x9294, 0x0006, 0x9296, 0x0004, 0x0110, 0x9006, 0x0010,
+	0x2001, 0x0001, 0x080c, 0x2919, 0x2001, 0x1990, 0x2003, 0x0002,
+	0x0028, 0x2001, 0x198e, 0x2003, 0x0003, 0x0010, 0x080c, 0x275e,
+	0x0005, 0x080c, 0x2889, 0x0560, 0x2009, 0x1997, 0x2104, 0x8001,
+	0x200a, 0x080c, 0x2948, 0x1168, 0x7850, 0x9084, 0xefff, 0x7852,
+	0x2001, 0x198e, 0x2003, 0x0003, 0x2001, 0x198f, 0x2003, 0x0000,
+	0x00b8, 0x2009, 0x1997, 0x2104, 0x9005, 0x1118, 0x080c, 0x28ce,
+	0x0010, 0x080c, 0x289e, 0x080c, 0x2891, 0x2009, 0x1993, 0x200b,
+	0x0000, 0x2001, 0x1990, 0x2003, 0x0001, 0x080c, 0x275e, 0x0000,
+	0x0005, 0x04b9, 0x0508, 0x080c, 0x2948, 0x11b8, 0x7850, 0x9084,
+	0xefff, 0x7852, 0x2009, 0x1994, 0x2104, 0x8000, 0x200a, 0x9086,
+	0x0007, 0x0108, 0x0078, 0x2001, 0x1999, 0x2003, 0x000a, 0x2009,
+	0x1996, 0x2104, 0xc0fd, 0x200a, 0x0038, 0x0419, 0x2001, 0x1990,
+	0x2003, 0x0004, 0x080c, 0x2789, 0x0005, 0x0099, 0x0168, 0x080c,
+	0x2948, 0x1138, 0x7850, 0x9084, 0xefff, 0x7852, 0x080c, 0x2775,
+	0x0018, 0x0079, 0x080c, 0x2789, 0x0005, 0x080c, 0x0d7d, 0x080c,
+	0x0d7d, 0x2009, 0x1998, 0x2104, 0x8001, 0x200a, 0x090c, 0x28ea,
+	0x0005, 0x7a38, 0x9294, 0x0005, 0x9296, 0x0005, 0x0110, 0x9006,
+	0x0010, 0x2001, 0x0001, 0x080c, 0x2919, 0x0005, 0x7a38, 0x9294,
+	0x0006, 0x9296, 0x0006, 0x0110, 0x9006, 0x0010, 0x2001, 0x0001,
+	0x080c, 0x28fc, 0x0005, 0x2009, 0x1993, 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, 0x2919, 0x0005, 0x0086, 0x2001,
+	0x1996, 0x2004, 0x9084, 0x7fff, 0x090c, 0x0d7d, 0x2009, 0x1995,
+	0x2144, 0x8846, 0x280a, 0x9844, 0x0dd8, 0xd08c, 0x1120, 0xd084,
+	0x1120, 0x080c, 0x0d7d, 0x9006, 0x0010, 0x2001, 0x0001, 0x00a1,
+	0x008e, 0x0005, 0x0006, 0x0156, 0x2001, 0x198e, 0x20a9, 0x0009,
+	0x2003, 0x0000, 0x8000, 0x1f04, 0x28f0, 0x2001, 0x1995, 0x2003,
+	0x8000, 0x015e, 0x000e, 0x0005, 0x00f6, 0x2079, 0x0100, 0x9085,
+	0x0000, 0x0158, 0x7838, 0x9084, 0xfff9, 0x9085, 0x0004, 0x783a,
+	0x2009, 0x199b, 0x210c, 0x795a, 0x0050, 0x7838, 0x9084, 0xfffb,
+	0x9085, 0x0006, 0x783a, 0x2009, 0x199c, 0x210c, 0x795a, 0x00fe,
+	0x0005, 0x00f6, 0x2079, 0x0100, 0x9085, 0x0000, 0x0158, 0x7838,
+	0x9084, 0xfffa, 0x9085, 0x0004, 0x783a, 0x7850, 0x9084, 0xfff0,
+	0x7852, 0x0060, 0x7838, 0x9084, 0xfffb, 0x9085, 0x0005, 0x783a,
+	0x7850, 0x9084, 0xfff0, 0x9085, 0x0000, 0x7852, 0x00fe, 0x0005,
+	0x0006, 0x2001, 0x0100, 0x2004, 0x9082, 0x0007, 0x000e, 0x0005,
+	0x0006, 0x2001, 0x0100, 0x2004, 0x9082, 0x0009, 0x000e, 0x0005,
+	0x0156, 0x20a9, 0x0064, 0x7820, 0x080c, 0x29b7, 0xd09c, 0x1110,
+	0x1f04, 0x294b, 0x015e, 0x0005, 0x0126, 0x0016, 0x0006, 0x2091,
+	0x8000, 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, 0x2974, 0x080c, 0x85f4,
+	0x1f04, 0x2974, 0x7850, 0x9085, 0x1000, 0x7852, 0x000e, 0x001e,
+	0x012e, 0x0005, 0x080c, 0x2a72, 0x0005, 0x0006, 0x0156, 0x00f6,
+	0x2079, 0x0100, 0x20a9, 0x000a, 0x7854, 0xd0ac, 0x1100, 0x7854,
+	0xd08c, 0x1110, 0x1f04, 0x298f, 0x00fe, 0x015e, 0x000e, 0x0005,
+	0x1d04, 0x2998, 0x080c, 0x85f4, 0x1f04, 0x2998, 0x0005, 0x0006,
+	0x2001, 0x199a, 0x2004, 0x9086, 0x0000, 0x000e, 0x0005, 0x0006,
+	0x2001, 0x199a, 0x2004, 0x9086, 0x0001, 0x000e, 0x0005, 0x0006,
+	0x2001, 0x199a, 0x2004, 0x9086, 0x0002, 0x000e, 0x0005, 0xa001,
+	0xa001, 0xa001, 0xa001, 0xa001, 0x0005, 0x0006, 0x2001, 0x19a6,
+	0x2102, 0x000e, 0x0005, 0x2009, 0x0171, 0x2104, 0xd0dc, 0x0140,
+	0x2009, 0x0170, 0x2104, 0x200b, 0x0080, 0xa001, 0xa001, 0x200a,
+	0x0005, 0x0016, 0x0026, 0x080c, 0x73fe, 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,
+	0x1128, 0x080c, 0x73fe, 0x0110, 0xc0bc, 0x0008, 0xc0bd, 0x200a,
+	0x001e, 0x000e, 0x0005, 0x00f6, 0x2079, 0x0380, 0x7843, 0x0101,
+	0x7844, 0xd084, 0x1de8, 0x2001, 0x0109, 0x2202, 0x7843, 0x0100,
+	0x00fe, 0x0005, 0x00f6, 0x2079, 0x0380, 0x7843, 0x0202, 0x7844,
+	0xd08c, 0x1de8, 0x2079, 0x0100, 0x7814, 0x9104, 0x9205, 0x7a16,
+	0x2079, 0x0380, 0x7843, 0x0200, 0x00fe, 0x0005, 0x0016, 0x0026,
+	0x0036, 0x00c6, 0x2061, 0x0100, 0x6050, 0x9084, 0xfbff, 0x9085,
+	0x0040, 0x6052, 0x20a9, 0x0002, 0x080c, 0x2998, 0x6050, 0x9085,
+	0x0400, 0x9084, 0xff9f, 0x6052, 0x20a9, 0x0005, 0x080c, 0x2998,
+	0x6054, 0xd0bc, 0x090c, 0x0d7d, 0x20a9, 0x0005, 0x080c, 0x2998,
+	0x6054, 0xd0ac, 0x090c, 0x0d7d, 0x2009, 0x19ad, 0x9084, 0x7e00,
+	0x8007, 0x8004, 0x8004, 0x200a, 0x9085, 0x0000, 0x605a, 0x2009,
+	0x199b, 0x2011, 0x199c, 0x6358, 0x939c, 0x38df, 0x2320, 0x939d,
+	0x0000, 0x94a5, 0x0000, 0x230a, 0x2412, 0x00ce, 0x003e, 0x002e,
+	0x001e, 0x0005, 0x0006, 0x00c6, 0x2061, 0x0100, 0x6050, 0xc0cd,
+	0x6052, 0x00ce, 0x000e, 0x0005, 0x2f78, 0x2f78, 0x2b7c, 0x2b7c,
+	0x2b88, 0x2b88, 0x2b94, 0x2b94, 0x2ba2, 0x2ba2, 0x2bae, 0x2bae,
+	0x2bbc, 0x2bbc, 0x2bca, 0x2bca, 0x2bdc, 0x2bdc, 0x2be8, 0x2be8,
+	0x2bf6, 0x2bf6, 0x2c14, 0x2c14, 0x2c34, 0x2c34, 0x2c04, 0x2c04,
+	0x2c24, 0x2c24, 0x2c42, 0x2c42, 0x2bda, 0x2bda, 0x2bda, 0x2bda,
+	0x2bda, 0x2bda, 0x2bda, 0x2bda, 0x2bda, 0x2bda, 0x2bda, 0x2bda,
+	0x2bda, 0x2bda, 0x2bda, 0x2bda, 0x2bda, 0x2bda, 0x2bda, 0x2bda,
+	0x2bda, 0x2bda, 0x2bda, 0x2bda, 0x2bda, 0x2bda, 0x2bda, 0x2bda,
+	0x2bda, 0x2bda, 0x2bda, 0x2bda, 0x2c54, 0x2c54, 0x2c60, 0x2c60,
+	0x2c6e, 0x2c6e, 0x2c7c, 0x2c7c, 0x2c8c, 0x2c8c, 0x2c9a, 0x2c9a,
+	0x2caa, 0x2caa, 0x2cba, 0x2cba, 0x2ccc, 0x2ccc, 0x2cda, 0x2cda,
+	0x2cea, 0x2cea, 0x2d0c, 0x2d0c, 0x2d30, 0x2d30, 0x2cfa, 0x2cfa,
+	0x2d1e, 0x2d1e, 0x2d40, 0x2d40, 0x2bda, 0x2bda, 0x2bda, 0x2bda,
+	0x2bda, 0x2bda, 0x2bda, 0x2bda, 0x2bda, 0x2bda, 0x2bda, 0x2bda,
+	0x2bda, 0x2bda, 0x2bda, 0x2bda, 0x2bda, 0x2bda, 0x2bda, 0x2bda,
+	0x2bda, 0x2bda, 0x2bda, 0x2bda, 0x2bda, 0x2bda, 0x2bda, 0x2bda,
+	0x2bda, 0x2bda, 0x2bda, 0x2bda, 0x2d54, 0x2d54, 0x2d60, 0x2d60,
+	0x2d6e, 0x2d6e, 0x2d7c, 0x2d7c, 0x2d8c, 0x2d8c, 0x2d9a, 0x2d9a,
+	0x2daa, 0x2daa, 0x2dba, 0x2dba, 0x2dcc, 0x2dcc, 0x2dda, 0x2dda,
+	0x2dea, 0x2dea, 0x2dfa, 0x2dfa, 0x2e0c, 0x2e0c, 0x2e1c, 0x2e1c,
+	0x2e2e, 0x2e2e, 0x2e40, 0x2e40, 0x2bda, 0x2bda, 0x2bda, 0x2bda,
+	0x2bda, 0x2bda, 0x2bda, 0x2bda, 0x2bda, 0x2bda, 0x2bda, 0x2bda,
+	0x2bda, 0x2bda, 0x2bda, 0x2bda, 0x2bda, 0x2bda, 0x2bda, 0x2bda,
+	0x2bda, 0x2bda, 0x2bda, 0x2bda, 0x2bda, 0x2bda, 0x2bda, 0x2bda,
+	0x2bda, 0x2bda, 0x2bda, 0x2bda, 0x2e54, 0x2e54, 0x2e62, 0x2e62,
+	0x2e72, 0x2e72, 0x2e82, 0x2e82, 0x2e94, 0x2e94, 0x2ea4, 0x2ea4,
+	0x2eb6, 0x2eb6, 0x2ec8, 0x2ec8, 0x2edc, 0x2edc, 0x2eec, 0x2eec,
+	0x2efe, 0x2efe, 0x2f10, 0x2f10, 0x2f24, 0x2f24, 0x2f35, 0x2f35,
+	0x2f48, 0x2f48, 0x2f5b, 0x2f5b, 0x2bda, 0x2bda, 0x2bda, 0x2bda,
+	0x2bda, 0x2bda, 0x2bda, 0x2bda, 0x2bda, 0x2bda, 0x2bda, 0x2bda,
+	0x2bda, 0x2bda, 0x2bda, 0x2bda, 0x2bda, 0x2bda, 0x2bda, 0x2bda,
+	0x2bda, 0x2bda, 0x2bda, 0x2bda, 0x2bda, 0x2bda, 0x2bda, 0x2bda,
+	0x2bda, 0x2bda, 0x2bda, 0x2bda, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x221c, 0x0804, 0x2f70,
+	0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156,
+	0x080c, 0x2052, 0x0804, 0x2f70, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2052, 0x080c, 0x221c,
+	0x0804, 0x2f70, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
+	0x0146, 0x0156, 0x080c, 0x207c, 0x0804, 0x2f70, 0x0106, 0x0006,
+	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x221c,
+	0x080c, 0x207c, 0x0804, 0x2f70, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2052, 0x080c, 0x207c,
+	0x0804, 0x2f70, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
+	0x0146, 0x0156, 0x080c, 0x2052, 0x080c, 0x221c, 0x080c, 0x207c,
+	0x0804, 0x2f70, 0xa001, 0x0cf0, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x139a, 0x0804, 0x2f70,
+	0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156,
+	0x080c, 0x221c, 0x080c, 0x139a, 0x0804, 0x2f70, 0x0106, 0x0006,
+	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2052,
+	0x080c, 0x139a, 0x0804, 0x2f70, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x221c, 0x080c, 0x139a,
+	0x080c, 0x207c, 0x0804, 0x2f70, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2052, 0x080c, 0x221c,
+	0x080c, 0x139a, 0x0804, 0x2f70, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2052, 0x080c, 0x139a,
+	0x080c, 0x207c, 0x0804, 0x2f70, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x139a, 0x080c, 0x207c,
+	0x0804, 0x2f70, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
+	0x0146, 0x0156, 0x080c, 0x2052, 0x080c, 0x221c, 0x080c, 0x139a,
+	0x080c, 0x207c, 0x0804, 0x2f70, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x26d2, 0x0804, 0x2f70,
+	0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156,
+	0x080c, 0x26d2, 0x080c, 0x221c, 0x0804, 0x2f70, 0x0106, 0x0006,
+	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x26d2,
+	0x080c, 0x2052, 0x0804, 0x2f70, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x26d2, 0x080c, 0x2052,
+	0x080c, 0x221c, 0x0804, 0x2f70, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x26d2, 0x080c, 0x207c,
+	0x0804, 0x2f70, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
+	0x0146, 0x0156, 0x080c, 0x26d2, 0x080c, 0x221c, 0x080c, 0x207c,
+	0x0804, 0x2f70, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
+	0x0146, 0x0156, 0x080c, 0x26d2, 0x080c, 0x2052, 0x080c, 0x207c,
+	0x0804, 0x2f70, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
+	0x0146, 0x0156, 0x080c, 0x26d2, 0x080c, 0x2052, 0x080c, 0x221c,
+	0x080c, 0x207c, 0x0804, 0x2f70, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x26d2, 0x080c, 0x139a,
+	0x0804, 0x2f70, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
+	0x0146, 0x0156, 0x080c, 0x26d2, 0x080c, 0x221c, 0x080c, 0x139a,
+	0x0804, 0x2f70, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
+	0x0146, 0x0156, 0x080c, 0x26d2, 0x080c, 0x2052, 0x080c, 0x139a,
+	0x0804, 0x2f70, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
+	0x0146, 0x0156, 0x080c, 0x26d2, 0x080c, 0x221c, 0x080c, 0x139a,
+	0x080c, 0x207c, 0x0804, 0x2f70, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x26d2, 0x080c, 0x2052,
+	0x080c, 0x221c, 0x080c, 0x139a, 0x0804, 0x2f70, 0x0106, 0x0006,
+	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x26d2,
+	0x080c, 0x2052, 0x080c, 0x139a, 0x080c, 0x207c, 0x0804, 0x2f70,
+	0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156,
+	0x080c, 0x26d2, 0x080c, 0x139a, 0x080c, 0x207c, 0x0804, 0x2f70,
+	0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156,
+	0x080c, 0x26d2, 0x080c, 0x2052, 0x080c, 0x221c, 0x080c, 0x139a,
+	0x080c, 0x207c, 0x0804, 0x2f70, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0xa7e7, 0x0804, 0x2f70,
+	0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156,
+	0x080c, 0xa7e7, 0x080c, 0x221c, 0x0804, 0x2f70, 0x0106, 0x0006,
+	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2052,
+	0x080c, 0xa7e7, 0x0804, 0x2f70, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2052, 0x080c, 0xa7e7,
+	0x080c, 0x221c, 0x0804, 0x2f70, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0xa7e7, 0x080c, 0x207c,
+	0x0804, 0x2f70, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
+	0x0146, 0x0156, 0x080c, 0xa7e7, 0x080c, 0x221c, 0x080c, 0x207c,
+	0x0804, 0x2f70, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
+	0x0146, 0x0156, 0x080c, 0x2052, 0x080c, 0xa7e7, 0x080c, 0x207c,
+	0x0804, 0x2f70, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
+	0x0146, 0x0156, 0x080c, 0x2052, 0x080c, 0xa7e7, 0x080c, 0x221c,
+	0x080c, 0x207c, 0x0804, 0x2f70, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0xa7e7, 0x080c, 0x139a,
+	0x0804, 0x2f70, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
+	0x0146, 0x0156, 0x080c, 0xa7e7, 0x080c, 0x221c, 0x080c, 0x139a,
+	0x0804, 0x2f70, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
+	0x0146, 0x0156, 0x080c, 0x2052, 0x080c, 0xa7e7, 0x080c, 0x139a,
+	0x0804, 0x2f70, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
+	0x0146, 0x0156, 0x080c, 0x2052, 0x080c, 0xa7e7, 0x080c, 0x221c,
+	0x080c, 0x139a, 0x0804, 0x2f70, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0xa7e7, 0x080c, 0x139a,
+	0x080c, 0x207c, 0x0804, 0x2f70, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0xa7e7, 0x080c, 0x221c,
+	0x080c, 0x139a, 0x080c, 0x207c, 0x0804, 0x2f70, 0x0106, 0x0006,
+	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2052,
+	0x080c, 0xa7e7, 0x080c, 0x139a, 0x080c, 0x207c, 0x0804, 0x2f70,
+	0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156,
+	0x080c, 0x2052, 0x080c, 0xa7e7, 0x080c, 0x221c, 0x080c, 0x139a,
+	0x080c, 0x207c, 0x0804, 0x2f70, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x26d2, 0x080c, 0xa7e7,
+	0x0804, 0x2f70, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
+	0x0146, 0x0156, 0x080c, 0x26d2, 0x080c, 0xa7e7, 0x080c, 0x221c,
+	0x0804, 0x2f70, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
+	0x0146, 0x0156, 0x080c, 0x26d2, 0x080c, 0x2052, 0x080c, 0xa7e7,
+	0x0804, 0x2f70, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
+	0x0146, 0x0156, 0x080c, 0x26d2, 0x080c, 0x2052, 0x080c, 0xa7e7,
+	0x080c, 0x221c, 0x0804, 0x2f70, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x26d2, 0x080c, 0xa7e7,
+	0x080c, 0x207c, 0x0804, 0x2f70, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x26d2, 0x080c, 0xa7e7,
+	0x080c, 0x221c, 0x080c, 0x207c, 0x0804, 0x2f70, 0x0106, 0x0006,
+	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x26d2,
+	0x080c, 0x2052, 0x080c, 0xa7e7, 0x080c, 0x207c, 0x0804, 0x2f70,
+	0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156,
+	0x080c, 0x26d2, 0x080c, 0x2052, 0x080c, 0xa7e7, 0x080c, 0x221c,
+	0x080c, 0x207c, 0x0804, 0x2f70, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x26d2, 0x080c, 0xa7e7,
+	0x080c, 0x139a, 0x0804, 0x2f70, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x26d2, 0x080c, 0xa7e7,
+	0x080c, 0x221c, 0x080c, 0x139a, 0x0804, 0x2f70, 0x0106, 0x0006,
+	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x26d2,
+	0x080c, 0x2052, 0x080c, 0xa7e7, 0x080c, 0x139a, 0x0804, 0x2f70,
+	0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156,
+	0x080c, 0x26d2, 0x080c, 0x2052, 0x080c, 0xa7e7, 0x080c, 0x221c,
+	0x080c, 0x139a, 0x0804, 0x2f70, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x26d2, 0x080c, 0xa7e7,
+	0x080c, 0x139a, 0x080c, 0x207c, 0x04d8, 0x0106, 0x0006, 0x0126,
+	0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x26d2, 0x080c,
+	0xa7e7, 0x080c, 0x221c, 0x080c, 0x139a, 0x080c, 0x207c, 0x0440,
+	0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156,
+	0x080c, 0x26d2, 0x080c, 0x2052, 0x080c, 0x139a, 0x080c, 0xa7e7,
+	0x080c, 0x207c, 0x00a8, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
+	0x0136, 0x0146, 0x0156, 0x080c, 0x26d2, 0x080c, 0x2052, 0x080c,
+	0xa7e7, 0x080c, 0x221c, 0x080c, 0x139a, 0x080c, 0x207c, 0x0000,
+	0x015e, 0x014e, 0x013e, 0x01de, 0x01ce, 0x012e, 0x000e, 0x010e,
+	0x000d, 0x00b6, 0x00c6, 0x0026, 0x0046, 0x9026, 0x080c, 0x6928,
+	0x1904, 0x3086, 0x72dc, 0x2001, 0x197c, 0x2004, 0x9005, 0x1110,
+	0xd29c, 0x0148, 0xd284, 0x1138, 0xd2bc, 0x1904, 0x3086, 0x080c,
+	0x308b, 0x0804, 0x3086, 0xd2cc, 0x1904, 0x3086, 0x080c, 0x73e4,
+	0x1120, 0x70af, 0xffff, 0x0804, 0x3086, 0xd294, 0x0120, 0x70af,
+	0xffff, 0x0804, 0x3086, 0x080c, 0x3323, 0x0160, 0x080c, 0xce35,
+	0x0128, 0x2001, 0x1818, 0x203c, 0x0804, 0x3013, 0x70af, 0xffff,
+	0x0804, 0x3086, 0x2001, 0x1818, 0x203c, 0x7294, 0xd284, 0x0904,
+	0x3013, 0xd28c, 0x1904, 0x3013, 0x0036, 0x73ac, 0x938e, 0xffff,
+	0x1110, 0x2019, 0x0001, 0x8314, 0x92e0, 0x1d80, 0x2c04, 0x938c,
+	0x0001, 0x0120, 0x9084, 0xff00, 0x8007, 0x0010, 0x9084, 0x00ff,
+	0x970e, 0x05b8, 0x908e, 0x0000, 0x05a0, 0x908e, 0x00ff, 0x1150,
+	0x7230, 0xd284, 0x1598, 0x7294, 0xc28d, 0x7296, 0x70af, 0xffff,
+	0x003e, 0x0488, 0x900e, 0x080c, 0x25cf, 0x080c, 0x64cc, 0x1520,
+	0x9006, 0xb8bb, 0x0520, 0xb8ac, 0x9005, 0x0148, 0x00c6, 0x2060,
+	0x080c, 0x8a5a, 0x00ce, 0x090c, 0x8dfe, 0xb8af, 0x0000, 0x080c,
+	0x696a, 0x1150, 0x7030, 0xd08c, 0x0118, 0xb800, 0xd0bc, 0x0120,
+	0x080c, 0x30a4, 0x0148, 0x0028, 0x080c, 0x31f8, 0x080c, 0x30d0,
+	0x0118, 0x8318, 0x0804, 0x2fc3, 0x73ae, 0x0010, 0x70af, 0xffff,
+	0x003e, 0x0804, 0x3086, 0x9780, 0x3334, 0x203d, 0x97bc, 0xff00,
+	0x873f, 0x2041, 0x007e, 0x70ac, 0x9096, 0xffff, 0x1118, 0x900e,
+	0x28a8, 0x0050, 0x9812, 0x0220, 0x2008, 0x9802, 0x20a8, 0x0020,
+	0x70af, 0xffff, 0x0804, 0x3086, 0x2700, 0x0156, 0x0016, 0x9106,
+	0x0904, 0x307b, 0xc484, 0x080c, 0x652d, 0x0148, 0x080c, 0xce35,
+	0x1904, 0x307b, 0x080c, 0x64cc, 0x1904, 0x3083, 0x0008, 0xc485,
+	0xb8bb, 0x0520, 0xb8ac, 0x9005, 0x0148, 0x00c6, 0x2060, 0x080c,
+	0x8a5a, 0x00ce, 0x090c, 0x8dfe, 0xb8af, 0x0000, 0x080c, 0x696a,
+	0x1130, 0x7030, 0xd08c, 0x01f8, 0xb800, 0xd0bc, 0x11e0, 0x7294,
+	0xd28c, 0x0180, 0x080c, 0x696a, 0x9082, 0x0006, 0x02e0, 0xd484,
+	0x1118, 0x080c, 0x64f1, 0x0028, 0x080c, 0x3291, 0x01a0, 0x080c,
+	0x32bc, 0x0088, 0x080c, 0x31f8, 0x080c, 0xce35, 0x1160, 0x080c,
+	0x30d0, 0x0188, 0x0040, 0x080c, 0xce35, 0x1118, 0x080c, 0x3291,
+	0x0110, 0x0451, 0x0140, 0x001e, 0x8108, 0x015e, 0x1f04, 0x302c,
+	0x70af, 0xffff, 0x0018, 0x001e, 0x015e, 0x71ae, 0x004e, 0x002e,
+	0x00ce, 0x00be, 0x0005, 0x00c6, 0x0016, 0x70af, 0x0001, 0x2009,
+	0x007e, 0x080c, 0x64cc, 0x1168, 0xb813, 0x00ff, 0xb817, 0xfffe,
+	0x080c, 0x31f8, 0x04a9, 0x0128, 0x70dc, 0xc0bd, 0x70de, 0x080c,
+	0xcb83, 0x001e, 0x00ce, 0x0005, 0x0016, 0x0076, 0x00d6, 0x00c6,
+	0x2001, 0x184c, 0x2004, 0x9084, 0x00ff, 0xb842, 0x080c, 0xab4a,
+	0x01d0, 0x2b00, 0x6012, 0x080c, 0xcbb0, 0x6023, 0x0001, 0x9006,
+	0x080c, 0x6469, 0x2001, 0x0000, 0x080c, 0x647d, 0x0126, 0x2091,
+	0x8000, 0x70a8, 0x8000, 0x70aa, 0x012e, 0x2009, 0x0004, 0x080c,
+	0xab77, 0x9085, 0x0001, 0x00ce, 0x00de, 0x007e, 0x001e, 0x0005,
+	0x0016, 0x0076, 0x00d6, 0x00c6, 0x2001, 0x184c, 0x2004, 0x9084,
+	0x00ff, 0xb842, 0x080c, 0xab4a, 0x0548, 0x2b00, 0x6012, 0xb800,
+	0xc0c4, 0xb802, 0xb8a0, 0x9086, 0x007e, 0x0140, 0xb804, 0x9084,
+	0x00ff, 0x9086, 0x0006, 0x1110, 0x080c, 0x31ab, 0x080c, 0xcbb0,
+	0x6023, 0x0001, 0x9006, 0x080c, 0x6469, 0x2001, 0x0002, 0x080c,
+	0x647d, 0x0126, 0x2091, 0x8000, 0x70a8, 0x8000, 0x70aa, 0x012e,
+	0x2009, 0x0002, 0x080c, 0xab77, 0x9085, 0x0001, 0x00ce, 0x00de,
+	0x007e, 0x001e, 0x0005, 0x00b6, 0x00c6, 0x0026, 0x2009, 0x0080,
+	0x080c, 0x64cc, 0x1140, 0xb813, 0x00ff, 0xb817, 0xfffc, 0x0039,
+	0x0110, 0x70e3, 0xffff, 0x002e, 0x00ce, 0x00be, 0x0005, 0x0016,
+	0x0076, 0x00d6, 0x00c6, 0x080c, 0xaa82, 0x01d0, 0x2b00, 0x6012,
+	0x080c, 0xcbb0, 0x6023, 0x0001, 0x9006, 0x080c, 0x6469, 0x2001,
+	0x0002, 0x080c, 0x647d, 0x0126, 0x2091, 0x8000, 0x70e4, 0x8000,
+	0x70e6, 0x012e, 0x2009, 0x0002, 0x080c, 0xab77, 0x9085, 0x0001,
+	0x00ce, 0x00de, 0x007e, 0x001e, 0x0005, 0x00c6, 0x00d6, 0x0126,
+	0x2091, 0x8000, 0x2009, 0x007f, 0x080c, 0x64cc, 0x11b8, 0xb813,
+	0x00ff, 0xb817, 0xfffd, 0xb8d7, 0x0004, 0x080c, 0xaa82, 0x0170,
+	0x2b00, 0x6012, 0x6316, 0x6023, 0x0001, 0x620a, 0x080c, 0xcbb0,
+	0x2009, 0x0022, 0x080c, 0xab77, 0x9085, 0x0001, 0x012e, 0x00de,
+	0x00ce, 0x0005, 0x00e6, 0x00c6, 0x0066, 0x0036, 0x0026, 0x00b6,
+	0x21f0, 0x9036, 0x080c, 0xa781, 0x1110, 0x2031, 0x0001, 0x0066,
+	0x080c, 0x927a, 0x080c, 0x91f0, 0x080c, 0xa6d7, 0x080c, 0xba04,
+	0x006e, 0x86ff, 0x0110, 0x080c, 0xa79d, 0x3e08, 0x2130, 0x81ff,
+	0x0120, 0x20a9, 0x007e, 0x900e, 0x0018, 0x20a9, 0x007f, 0x900e,
+	0x0016, 0x080c, 0x652d, 0x1140, 0x9686, 0x0002, 0x1118, 0xb800,
+	0xd0bc, 0x1110, 0x080c, 0x5f5b, 0x001e, 0x8108, 0x1f04, 0x3190,
+	0x9686, 0x0001, 0x190c, 0x32f7, 0x00be, 0x002e, 0x003e, 0x006e,
+	0x00ce, 0x00ee, 0x0005, 0x00e6, 0x00c6, 0x0036, 0x0026, 0x0016,
+	0x00b6, 0x9016, 0x080c, 0xa781, 0x1110, 0x2011, 0x0001, 0x0026,
+	0x6210, 0x2258, 0xbaa0, 0x0026, 0x2019, 0x0029, 0x080c, 0x926f,
+	0x0076, 0x2039, 0x0000, 0x080c, 0x9141, 0x2c08, 0x080c, 0xdeb3,
+	0x007e, 0x001e, 0x002e, 0x82ff, 0x0110, 0x080c, 0xa79d, 0xba10,
+	0xbb14, 0x080c, 0x5f5b, 0xba12, 0xbb16, 0x00be, 0x001e, 0x002e,
+	0x003e, 0x00ce, 0x00ee, 0x0005, 0x00e6, 0x0006, 0x00b6, 0x6010,
+	0x2058, 0xb8a0, 0x00be, 0x9086, 0x0080, 0x0150, 0x2071, 0x1800,
+	0x70a8, 0x9005, 0x0110, 0x8001, 0x70aa, 0x000e, 0x00ee, 0x0005,
+	0x2071, 0x1800, 0x70e4, 0x9005, 0x0dc0, 0x8001, 0x70e6, 0x0ca8,
+	0xb800, 0xc08c, 0xb802, 0x0005, 0x00f6, 0x00e6, 0x00c6, 0x00b6,
+	0x0036, 0x0026, 0x0016, 0x0156, 0x2178, 0x9016, 0x080c, 0xa781,
+	0x1110, 0x2011, 0x0001, 0x0026, 0x81ff, 0x1118, 0x20a9, 0x0001,
+	0x0088, 0x080c, 0x55fc, 0xd0c4, 0x0150, 0xd0a4, 0x0140, 0x9006,
+	0x0046, 0x2020, 0x2009, 0x002d, 0x080c, 0xe191, 0x004e, 0x20a9,
+	0x0800, 0x9016, 0x0026, 0x928e, 0x007e, 0x0904, 0x326c, 0x928e,
+	0x007f, 0x0904, 0x326c, 0x928e, 0x0080, 0x05f0, 0x9288, 0x1000,
+	0x210c, 0x81ff, 0x05c8, 0x8fff, 0x1150, 0x2001, 0x198c, 0x0006,
+	0x2003, 0x0001, 0x080c, 0x327e, 0x000e, 0x2003, 0x0000, 0x00b6,
+	0x00c6, 0x2158, 0x2001, 0x0001, 0x080c, 0x6934, 0x00ce, 0x00be,
+	0x2019, 0x0029, 0x080c, 0x926f, 0x0076, 0x2039, 0x0000, 0x080c,
+	0x9141, 0x00b6, 0x00c6, 0x0026, 0x2158, 0xba04, 0x9294, 0x00ff,
+	0x9286, 0x0006, 0x1118, 0xb807, 0x0404, 0x0028, 0x2001, 0x0004,
+	0x8007, 0x9215, 0xba06, 0x002e, 0x00ce, 0x00be, 0x0016, 0x2c08,
+	0x080c, 0xdeb3, 0x001e, 0x007e, 0x002e, 0x8210, 0x1f04, 0x3222,
+	0x002e, 0x82ff, 0x0110, 0x080c, 0xa79d, 0x015e, 0x001e, 0x002e,
+	0x003e, 0x00be, 0x00ce, 0x00ee, 0x00fe, 0x0005, 0x0046, 0x0026,
+	0x0016, 0x080c, 0x55fc, 0xd0c4, 0x0140, 0xd0a4, 0x0130, 0x9006,
+	0x2220, 0x2009, 0x0029, 0x080c, 0xe191, 0x001e, 0x002e, 0x004e,
+	0x0005, 0x0016, 0x0026, 0x0036, 0x00c6, 0x7294, 0x82ff, 0x01e8,
+	0x080c, 0x6962, 0x11d0, 0x2100, 0x080c, 0x2602, 0x81ff, 0x01b8,
+	0x2019, 0x0001, 0x8314, 0x92e0, 0x1d80, 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, 0x0066, 0x9036, 0x080c, 0xa781, 0x1110, 0x2031, 0x0001,
+	0x0066, 0x0036, 0x2019, 0x0029, 0x00d9, 0x003e, 0x006e, 0x86ff,
+	0x0110, 0x080c, 0xa79d, 0x006e, 0x9180, 0x1000, 0x2004, 0x9065,
+	0x0158, 0x0016, 0x00c6, 0x2061, 0x1b30, 0x001e, 0x6112, 0x080c,
+	0x31ab, 0x001e, 0x080c, 0x64f1, 0x012e, 0x00ce, 0x001e, 0x0005,
+	0x0016, 0x0026, 0x2110, 0x080c, 0xa275, 0x080c, 0xe4f3, 0x002e,
+	0x001e, 0x0005, 0x2001, 0x1837, 0x2004, 0xd0cc, 0x0005, 0x00c6,
+	0x00b6, 0x080c, 0x73e4, 0x1118, 0x20a9, 0x0800, 0x0010, 0x20a9,
+	0x0782, 0x080c, 0x73e4, 0x1110, 0x900e, 0x0010, 0x2009, 0x007e,
+	0x9180, 0x1000, 0x2004, 0x905d, 0x0130, 0x86ff, 0x0110, 0xb800,
+	0xd0bc, 0x090c, 0x64f1, 0x8108, 0x1f04, 0x3308, 0x2061, 0x1800,
+	0x607f, 0x0000, 0x6080, 0x9084, 0x00ff, 0x6082, 0x60b3, 0x0000,
+	0x00be, 0x00ce, 0x0005, 0x2001, 0x1869, 0x2004, 0xd0bc, 0x0005,
+	0x2011, 0x1848, 0x2214, 0xd2ec, 0x0005, 0x0026, 0x2011, 0x1867,
+	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, 0x189e, 0x7003, 0x0002,
+	0x9006, 0x7016, 0x701a, 0x704a, 0x704e, 0x700e, 0x7042, 0x7046,
+	0x703b, 0x18ba, 0x703f, 0x18ba, 0x7007, 0x0001, 0x080c, 0x1054,
+	0x090c, 0x0d7d, 0x2900, 0x706a, 0xa867, 0x0002, 0xa8ab, 0xdcb0,
+	0x080c, 0x1054, 0x090c, 0x0d7d, 0x2900, 0x706e, 0xa867, 0x0002,
+	0xa8ab, 0xdcb0, 0x0005, 0x2071, 0x189e, 0x7004, 0x0002, 0x3463,
+	0x3464, 0x3477, 0x348b, 0x0005, 0x1004, 0x3474, 0x0e04, 0x3474,
+	0x2079, 0x0000, 0x0126, 0x2091, 0x8000, 0x700c, 0x9005, 0x1128,
+	0x700f, 0x0001, 0x012e, 0x0468, 0x0005, 0x012e, 0x0ce8, 0x2079,
+	0x0000, 0x2061, 0x18b8, 0x2c4c, 0xa86c, 0x908e, 0x0100, 0x0128,
+	0x9086, 0x0200, 0x0904, 0x355f, 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, 0x61d0,
+	0x0042, 0x2100, 0x908a, 0x003f, 0x1a04, 0x355c, 0x61d0, 0x0804,
+	0x34f1, 0x3533, 0x356b, 0x3575, 0x3579, 0x3583, 0x3589, 0x358d,
+	0x359d, 0x35a0, 0x35aa, 0x35af, 0x35b4, 0x35bf, 0x35ca, 0x35d9,
+	0x35e8, 0x35f6, 0x360d, 0x3628, 0x355c, 0x36d1, 0x370f, 0x37b4,
+	0x37c5, 0x37e8, 0x355c, 0x355c, 0x355c, 0x3820, 0x3840, 0x3849,
+	0x3875, 0x387b, 0x355c, 0x38c1, 0x355c, 0x355c, 0x355c, 0x355c,
+	0x355c, 0x38cc, 0x38d5, 0x38dd, 0x38df, 0x355c, 0x355c, 0x355c,
+	0x355c, 0x355c, 0x355c, 0x390f, 0x355c, 0x355c, 0x355c, 0x355c,
+	0x355c, 0x392c, 0x3990, 0x355c, 0x355c, 0x355c, 0x355c, 0x355c,
+	0x355c, 0x0002, 0x39ba, 0x39bd, 0x3a1c, 0x3a35, 0x3a65, 0x3d07,
+	0x355c, 0x51cd, 0x355c, 0x355c, 0x355c, 0x355c, 0x355c, 0x355c,
+	0x355c, 0x355c, 0x35aa, 0x35af, 0x4206, 0x5620, 0x4224, 0x525c,
+	0x52ad, 0x53b0, 0x355c, 0x5412, 0x544e, 0x547f, 0x558b, 0x54ac,
+	0x550b, 0x355c, 0x4228, 0x43dd, 0x43f3, 0x4418, 0x447d, 0x44f1,
+	0x4511, 0x4588, 0x4599, 0x45b1, 0x45b4, 0x45d9, 0x4649, 0x46b3,
+	0x46bb, 0x47ed, 0x4962, 0x4996, 0x4bfa, 0x355c, 0x4c18, 0x4cc4,
+	0x4da6, 0x4e00, 0x355c, 0x4eb5, 0x355c, 0x4f1b, 0x4f36, 0x46bb,
+	0x517c, 0x714c, 0x0000, 0x2021, 0x4000, 0x080c, 0x4a14, 0x0126,
+	0x2091, 0x8000, 0x0e04, 0x353d, 0x0010, 0x012e, 0x0cc0, 0x7c36,
+	0x9486, 0x4000, 0x0118, 0x7833, 0x0011, 0x0010, 0x7833, 0x0010,
+	0x7c82, 0x7986, 0x7a8a, 0x7b8e, 0x2091, 0x4080, 0x2001, 0x0089,
+	0x2004, 0xd084, 0x190c, 0x11cd, 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, 0x4a21, 0x7883, 0x0004, 0x7884,
+	0x0807, 0x2039, 0x0001, 0x902e, 0x2520, 0x7b88, 0x7a8c, 0x7884,
+	0x7990, 0x0804, 0x4a24, 0x7984, 0x7888, 0x2114, 0x200a, 0x0804,
+	0x3533, 0x7984, 0x2114, 0x0804, 0x3533, 0x20e1, 0x0000, 0x2099,
+	0x0021, 0x20e9, 0x0000, 0x20a1, 0x0021, 0x20a9, 0x001f, 0x4003,
+	0x7984, 0x7a88, 0x7b8c, 0x0804, 0x3533, 0x7884, 0x2060, 0x04d8,
+	0x2009, 0x0003, 0x2011, 0x0002, 0x2019, 0x0015, 0x789b, 0x0137,
+	0x0804, 0x3533, 0x2039, 0x0001, 0x7d98, 0x7c9c, 0x0800, 0x2039,
+	0x0001, 0x7d98, 0x7c9c, 0x0848, 0x79a0, 0x9182, 0x0040, 0x0210,
+	0x0804, 0x3568, 0x2138, 0x7d98, 0x7c9c, 0x0804, 0x356f, 0x79a0,
+	0x9182, 0x0040, 0x0210, 0x0804, 0x3568, 0x2138, 0x7d98, 0x7c9c,
+	0x0804, 0x357d, 0x79a0, 0x9182, 0x0040, 0x0210, 0x0804, 0x3568,
+	0x21e8, 0x7984, 0x7888, 0x20a9, 0x0001, 0x21a0, 0x4004, 0x0804,
+	0x3533, 0x2061, 0x0800, 0xe10c, 0x9006, 0x2c15, 0x9200, 0x8c60,
+	0x8109, 0x1dd8, 0x2010, 0x9005, 0x0904, 0x3533, 0x0804, 0x3562,
+	0x79a0, 0x9182, 0x0040, 0x0210, 0x0804, 0x3568, 0x21e0, 0x20a9,
+	0x0001, 0x7984, 0x2198, 0x4012, 0x0804, 0x3533, 0x2069, 0x1847,
+	0x7884, 0x7990, 0x911a, 0x1a04, 0x3568, 0x8019, 0x0904, 0x3568,
+	0x684a, 0x6942, 0x788c, 0x6852, 0x7888, 0x6856, 0x9006, 0x685a,
+	0x685e, 0x080c, 0x7719, 0x0804, 0x3533, 0x2069, 0x1847, 0x7884,
+	0x7994, 0x911a, 0x1a04, 0x3568, 0x8019, 0x0904, 0x3568, 0x684e,
+	0x6946, 0x788c, 0x6862, 0x7888, 0x6866, 0x9006, 0x686a, 0x686e,
+	0x0126, 0x2091, 0x8000, 0x080c, 0x69d4, 0x012e, 0x0804, 0x3533,
+	0x902e, 0x2520, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x3565,
+	0x7984, 0x7b88, 0x7a8c, 0x20a9, 0x0005, 0x20e9, 0x0001, 0x20a1,
+	0x18a6, 0x4101, 0x080c, 0x49d8, 0x1120, 0x2009, 0x0002, 0x0804,
+	0x3565, 0x2009, 0x0020, 0xa85c, 0x9080, 0x0019, 0xaf60, 0x080c,
+	0x4a21, 0x701f, 0x364c, 0x0005, 0xa864, 0x2008, 0x9084, 0x00ff,
+	0x9096, 0x0011, 0x0168, 0x9096, 0x0019, 0x0150, 0x9096, 0x0015,
+	0x0138, 0x9096, 0x0048, 0x0120, 0x9096, 0x0029, 0x1904, 0x3565,
+	0x810f, 0x918c, 0x00ff, 0x0904, 0x3565, 0x7112, 0x7010, 0x8001,
+	0x0560, 0x7012, 0x080c, 0x49d8, 0x1120, 0x2009, 0x0002, 0x0804,
+	0x3565, 0x2009, 0x0020, 0x7068, 0x2040, 0xa28c, 0xa390, 0xa494,
+	0xa598, 0x9290, 0x0040, 0x9399, 0x0000, 0x94a1, 0x0000, 0x95a9,
+	0x0000, 0xa85c, 0x9080, 0x0019, 0xaf60, 0x080c, 0x4a21, 0x701f,
+	0x368a, 0x0005, 0xa864, 0x9084, 0x00ff, 0x9096, 0x0002, 0x0120,
+	0x9096, 0x000a, 0x1904, 0x3565, 0x0888, 0x7014, 0x2048, 0xa868,
+	0xc0fd, 0xa86a, 0xa864, 0x9084, 0x00ff, 0x9096, 0x0029, 0x1160,
+	0xc2fd, 0xaa7a, 0x080c, 0x60ae, 0x0150, 0x0126, 0x2091, 0x8000,
+	0xa87a, 0xa982, 0x012e, 0x0050, 0x080c, 0x63c7, 0x1128, 0x7007,
+	0x0003, 0x701f, 0x36b6, 0x0005, 0x080c, 0x6ebf, 0x0126, 0x2091,
+	0x8000, 0x20a9, 0x0005, 0x20e1, 0x0001, 0x2099, 0x18a6, 0x400a,
+	0x2100, 0x9210, 0x9399, 0x0000, 0x94a1, 0x0000, 0x95a9, 0x0000,
+	0xa85c, 0x9080, 0x0019, 0x2009, 0x0020, 0x012e, 0xaf60, 0x0804,
+	0x4a24, 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, 0x1a20, 0x2004, 0x9005, 0x0128,
+	0x2001, 0x008b, 0x2004, 0xd0fc, 0x0dd8, 0x2001, 0x008a, 0x2003,
+	0x0002, 0x2003, 0x1001, 0x2071, 0x0080, 0x0804, 0x0427, 0x81ff,
+	0x1904, 0x3565, 0x7984, 0x080c, 0x652d, 0x1904, 0x3568, 0x7e98,
+	0x9684, 0x3fff, 0x9082, 0x4000, 0x1a04, 0x3568, 0x7c88, 0x7d8c,
+	0x080c, 0x675f, 0x080c, 0x66f0, 0x1518, 0x2061, 0x1ddc, 0x0126,
+	0x2091, 0x8000, 0x6000, 0x9086, 0x0000, 0x0148, 0x6014, 0x904d,
+	0x0130, 0xa86c, 0x9406, 0x1118, 0xa870, 0x9506, 0x0150, 0x012e,
+	0x9ce0, 0x001c, 0x2001, 0x181a, 0x2004, 0x9c02, 0x1a04, 0x3565,
+	0x0c30, 0x080c, 0xc32e, 0x012e, 0x0904, 0x3565, 0x0804, 0x3533,
+	0x900e, 0x2001, 0x0005, 0x080c, 0x6ebf, 0x0126, 0x2091, 0x8000,
+	0x080c, 0xca20, 0x080c, 0x6c7f, 0x012e, 0x0804, 0x3533, 0x00a6,
+	0x2950, 0xb198, 0x080c, 0x652d, 0x1904, 0x37a1, 0xb6a4, 0x9684,
+	0x3fff, 0x9082, 0x4000, 0x16e8, 0xb49c, 0xb5a0, 0x080c, 0x675f,
+	0x080c, 0x670a, 0x1520, 0x2061, 0x1ddc, 0x0126, 0x2091, 0x8000,
+	0x6000, 0x9086, 0x0000, 0x0148, 0x6014, 0x904d, 0x0130, 0xa86c,
+	0x9406, 0x1118, 0xa870, 0x9506, 0x0158, 0x012e, 0x9ce0, 0x001c,
+	0x2001, 0x181a, 0x2004, 0x9c02, 0x2009, 0x000d, 0x12b0, 0x0c28,
+	0x080c, 0xc32e, 0x012e, 0x2009, 0x0003, 0x0178, 0x00e0, 0x900e,
+	0x2001, 0x0005, 0x080c, 0x6ebf, 0x0126, 0x2091, 0x8000, 0x080c,
+	0xca20, 0x080c, 0x6c73, 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, 0x3565, 0x080c,
+	0x49ef, 0x0904, 0x3568, 0x080c, 0x65f4, 0x0904, 0x3565, 0x080c,
+	0x6765, 0x0904, 0x3565, 0x0804, 0x4508, 0x81ff, 0x1904, 0x3565,
+	0x080c, 0x4a0b, 0x0904, 0x3568, 0x080c, 0x67f3, 0x0904, 0x3565,
+	0x2019, 0x0005, 0x79a8, 0x080c, 0x6780, 0x0904, 0x3565, 0x7888,
+	0x908a, 0x1000, 0x1a04, 0x3568, 0x8003, 0x800b, 0x810b, 0x9108,
+	0x080c, 0x8519, 0x7984, 0xd184, 0x1904, 0x3533, 0x0804, 0x4508,
+	0x0126, 0x2091, 0x8000, 0x81ff, 0x0118, 0x2009, 0x0001, 0x0450,
+	0x2029, 0x07ff, 0x645c, 0x2400, 0x9506, 0x01f8, 0x2508, 0x080c,
+	0x652d, 0x11d8, 0x080c, 0x67f3, 0x1128, 0x2009, 0x0002, 0x62c0,
+	0x2518, 0x00c0, 0x2019, 0x0004, 0x900e, 0x080c, 0x6780, 0x1118,
+	0x2009, 0x0006, 0x0078, 0x7884, 0x908a, 0x1000, 0x1270, 0x8003,
+	0x800b, 0x810b, 0x9108, 0x080c, 0x8519, 0x8529, 0x1ae0, 0x012e,
+	0x0804, 0x3533, 0x012e, 0x0804, 0x3565, 0x012e, 0x0804, 0x3568,
+	0x080c, 0x49ef, 0x0904, 0x3568, 0x080c, 0x65f4, 0x0904, 0x3565,
+	0x080c, 0xa781, 0xbaa0, 0x2019, 0x0005, 0x00c6, 0x9066, 0x080c,
+	0x926f, 0x0076, 0x903e, 0x080c, 0x9141, 0x900e, 0x080c, 0xdeb3,
+	0x007e, 0x00ce, 0x080c, 0xa79d, 0x080c, 0x675f, 0x0804, 0x3533,
+	0x080c, 0x49ef, 0x0904, 0x3568, 0x080c, 0x675f, 0x2208, 0x0804,
+	0x3533, 0x0156, 0x00d6, 0x00e6, 0x00c6, 0x2069, 0x1910, 0x6810,
+	0x6914, 0x910a, 0x1208, 0x900e, 0x6816, 0x9016, 0x901e, 0x2071,
+	0x19e5, 0x7028, 0x9065, 0x0118, 0x8210, 0x600c, 0x0cd8, 0x2300,
+	0x9218, 0x00ce, 0x00ee, 0x00de, 0x015e, 0x0804, 0x3533, 0x00f6,
+	0x0016, 0x907d, 0x0138, 0x9006, 0x8000, 0x2f0c, 0x81ff, 0x0110,
+	0x2178, 0x0cd0, 0x001e, 0x00fe, 0x0005, 0x2069, 0x1910, 0x6910,
+	0x62bc, 0x0804, 0x3533, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804,
+	0x3565, 0x0126, 0x2091, 0x8000, 0x080c, 0x5610, 0x0128, 0x2009,
+	0x0007, 0x012e, 0x0804, 0x3565, 0x012e, 0x615c, 0x9190, 0x3334,
+	0x2215, 0x9294, 0x00ff, 0x637c, 0x83ff, 0x0108, 0x6280, 0x67dc,
+	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, 0x73e4, 0x1118, 0x2031, 0x0004, 0x0038, 0xd79c, 0x0120,
+	0x2009, 0x0005, 0x0804, 0x3565, 0x9036, 0x7e9a, 0x7f9e, 0x0804,
+	0x3533, 0x614c, 0x6250, 0x2019, 0x1984, 0x231c, 0x2001, 0x1985,
+	0x2004, 0x789a, 0x0804, 0x3533, 0x0126, 0x2091, 0x8000, 0x6138,
+	0x623c, 0x6340, 0x012e, 0x0804, 0x3533, 0x080c, 0x4a0b, 0x0904,
+	0x3568, 0xba44, 0xbb38, 0x0804, 0x3533, 0x080c, 0x0d7d, 0x080c,
+	0x4a0b, 0x2110, 0x0904, 0x3568, 0xb804, 0x908c, 0x00ff, 0x918e,
+	0x0006, 0x0140, 0x9084, 0xff00, 0x9086, 0x0600, 0x2009, 0x0009,
+	0x1904, 0x3565, 0x0126, 0x2091, 0x8000, 0x2019, 0x0005, 0x00c6,
+	0x9066, 0x080c, 0xa781, 0x080c, 0xa275, 0x080c, 0x926f, 0x0076,
+	0x903e, 0x080c, 0x9141, 0x900e, 0x080c, 0xdeb3, 0x007e, 0x00ce,
+	0x080c, 0xa79d, 0xb807, 0x0407, 0x012e, 0x0804, 0x3533, 0x614c,
+	0x6250, 0x7884, 0x604e, 0x7b88, 0x6352, 0x2069, 0x1847, 0x831f,
+	0x9305, 0x6816, 0x788c, 0x2069, 0x1984, 0x2d1c, 0x206a, 0x7e98,
+	0x9682, 0x0014, 0x1210, 0x2031, 0x07d0, 0x2069, 0x1985, 0x2d04,
+	0x266a, 0x789a, 0x0804, 0x3533, 0x0126, 0x2091, 0x8000, 0x6138,
+	0x7884, 0x603a, 0x910e, 0xd1b4, 0x190c, 0x0ecc, 0xd0c4, 0x01a8,
+	0x00d6, 0x78a8, 0x2009, 0x199b, 0x200a, 0x78ac, 0x2011, 0x199c,
+	0x2012, 0x2069, 0x0100, 0x6838, 0x9086, 0x0007, 0x1118, 0x2214,
+	0x6a5a, 0x0010, 0x210c, 0x695a, 0x00de, 0x7888, 0x603e, 0x2011,
+	0x0116, 0x220c, 0x7888, 0xd08c, 0x0118, 0x918d, 0x0040, 0x0010,
+	0x918c, 0xff7f, 0x2112, 0x6140, 0x788c, 0x6042, 0x910e, 0xd1e4,
+	0x190c, 0x0ee7, 0x9084, 0x0020, 0x0130, 0x78b4, 0x6046, 0x9084,
+	0x0001, 0x090c, 0x4206, 0x6040, 0xd0cc, 0x0120, 0x78b0, 0x2011,
+	0x0114, 0x2012, 0x012e, 0x0804, 0x3533, 0x00f6, 0x2079, 0x1800,
+	0x7a38, 0xa898, 0x9084, 0xfebf, 0x9215, 0xa89c, 0x9084, 0xfebf,
+	0x8002, 0x9214, 0x7838, 0x9084, 0x0140, 0x9215, 0x7a3a, 0xa897,
+	0x4000, 0x900e, 0x9085, 0x0001, 0x2001, 0x0000, 0x00fe, 0x0005,
+	0x7898, 0x9005, 0x01a8, 0x7888, 0x9025, 0x0904, 0x3568, 0x788c,
+	0x902d, 0x0904, 0x3568, 0x900e, 0x080c, 0x652d, 0x1120, 0xba44,
+	0xbb38, 0xbc46, 0xbd3a, 0x9186, 0x07ff, 0x0190, 0x8108, 0x0ca0,
+	0x080c, 0x4a0b, 0x0904, 0x3568, 0x7888, 0x900d, 0x0904, 0x3568,
+	0x788c, 0x9005, 0x0904, 0x3568, 0xba44, 0xb946, 0xbb38, 0xb83a,
+	0x0804, 0x3533, 0x2011, 0xbc09, 0x0010, 0x2011, 0xbc05, 0x080c,
+	0x5610, 0x1904, 0x3565, 0x00c6, 0x2061, 0x0100, 0x7984, 0x9186,
+	0x00ff, 0x1130, 0x2001, 0x1818, 0x2004, 0x9085, 0xff00, 0x0088,
+	0x9182, 0x007f, 0x16e0, 0x9188, 0x3334, 0x210d, 0x918c, 0x00ff,
+	0x2001, 0x1818, 0x2004, 0x0026, 0x9116, 0x002e, 0x0580, 0x810f,
+	0x9105, 0x0126, 0x2091, 0x8000, 0x0006, 0x080c, 0xaa82, 0x000e,
+	0x0510, 0x602e, 0x620a, 0x7984, 0x00b6, 0x080c, 0x64d2, 0x2b08,
+	0x00be, 0x1500, 0x6112, 0x6023, 0x0001, 0x080c, 0x49d8, 0x01d0,
+	0x9006, 0xa866, 0x7007, 0x0003, 0xa832, 0xa868, 0xc0fd, 0xa86a,
+	0x701f, 0x3a15, 0x2900, 0x6016, 0x2009, 0x0032, 0x080c, 0xab77,
+	0x012e, 0x00ce, 0x0005, 0x012e, 0x00ce, 0x0804, 0x3565, 0x00ce,
+	0x0804, 0x3568, 0x080c, 0xaad8, 0x0cb0, 0xa830, 0x9086, 0x0100,
+	0x0904, 0x3565, 0x0804, 0x3533, 0x2061, 0x1a6d, 0x0126, 0x2091,
+	0x8000, 0x6000, 0xd084, 0x0170, 0x6104, 0x6208, 0x2061, 0x1800,
+	0x6354, 0x6074, 0x789a, 0x60c0, 0x789e, 0x60bc, 0x78aa, 0x012e,
+	0x0804, 0x3533, 0x900e, 0x2110, 0x0c88, 0x81ff, 0x1904, 0x3565,
+	0x080c, 0x73e4, 0x0904, 0x3565, 0x0126, 0x2091, 0x8000, 0x6254,
+	0x6074, 0x9202, 0x0248, 0x9085, 0x0001, 0x080c, 0x2638, 0x080c,
+	0x5820, 0x012e, 0x0804, 0x3533, 0x012e, 0x0804, 0x3568, 0x0006,
+	0x0016, 0x00c6, 0x00e6, 0x2001, 0x19a7, 0x2070, 0x2061, 0x1847,
+	0x6008, 0x2072, 0x900e, 0x2011, 0x1400, 0x080c, 0x9030, 0x7206,
+	0x00ee, 0x00ce, 0x001e, 0x000e, 0x0005, 0x0126, 0x2091, 0x8000,
+	0x81ff, 0x0128, 0x012e, 0x2021, 0x400b, 0x0804, 0x3535, 0x7884,
+	0xd0fc, 0x0148, 0x2001, 0x002a, 0x2004, 0x9082, 0x00e1, 0x0288,
+	0x012e, 0x0804, 0x3568, 0x2001, 0x002a, 0x2004, 0x2069, 0x1847,
+	0x6908, 0x9102, 0x1230, 0x012e, 0x0804, 0x3568, 0x012e, 0x0804,
+	0x3565, 0x080c, 0xaa42, 0x0dd0, 0x7884, 0xd0fc, 0x0904, 0x3ae0,
+	0x00c6, 0x080c, 0x49d8, 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, 0x3c6a,
+	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, 0x4a21, 0x701f, 0x3ba7, 0x7023, 0x0001, 0x012e, 0x0005,
+	0x080c, 0xa781, 0x0046, 0x0086, 0x0096, 0x00a6, 0x00b6, 0x00c6,
+	0x00d6, 0x00e6, 0x00f6, 0x080c, 0x3a4f, 0x2001, 0x199d, 0x2003,
+	0x0000, 0x2021, 0x000a, 0x2061, 0x0100, 0x6104, 0x0016, 0x60bb,
+	0x0000, 0x60bf, 0x32e1, 0x60bf, 0x0012, 0x080c, 0x3cd9, 0x080c,
+	0x3c98, 0x00f6, 0x00e6, 0x0086, 0x2940, 0x2071, 0x19e5, 0x2079,
+	0x0090, 0x00d6, 0x2069, 0x0000, 0x6884, 0xd0b4, 0x0140, 0x2001,
+	0x0035, 0x2004, 0x780e, 0x2001, 0x0034, 0x2004, 0x780a, 0x00de,
+	0x2011, 0x0001, 0x080c, 0x404a, 0x008e, 0x00ee, 0x00fe, 0x080c,
+	0x3f77, 0x080c, 0x3ea4, 0x05b8, 0x2001, 0x020b, 0x2004, 0x9084,
+	0x0140, 0x1db8, 0x080c, 0x40be, 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, 0x1820,
+	0x2004, 0x9106, 0x1168, 0x00c6, 0x2061, 0x0100, 0x6024, 0x9084,
+	0x1e00, 0x00ce, 0x0138, 0x080c, 0x3eae, 0x080c, 0x3c93, 0x0058,
+	0x080c, 0x3c93, 0x080c, 0x3fe2, 0x080c, 0x3f6d, 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, 0x131f, 0x2009,
+	0x0028, 0x080c, 0x2184, 0x2001, 0x0227, 0x200c, 0x2102, 0x080c,
+	0xa79d, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x00ae, 0x009e,
+	0x008e, 0x004e, 0x2001, 0x199d, 0x2004, 0x9005, 0x1118, 0x012e,
+	0x0804, 0x3533, 0x012e, 0x2021, 0x400c, 0x0804, 0x3535, 0x0016,
+	0x0026, 0x0036, 0x0046, 0x0056, 0x0076, 0x0086, 0x0096, 0x00d6,
+	0x0156, 0x7014, 0x2048, 0x7020, 0x20a8, 0x8000, 0x7022, 0xa804,
+	0x9005, 0x0904, 0x3c03, 0x2048, 0x1f04, 0x3bb7, 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, 0x4a21, 0x701f,
+	0x3ba7, 0x00b0, 0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084,
+	0xffc0, 0x9080, 0x001b, 0x21a8, 0x27e0, 0x2098, 0x27e8, 0x20a0,
+	0x0006, 0x080c, 0x0fb8, 0x000e, 0x080c, 0x4a24, 0x701f, 0x3ba7,
+	0x015e, 0x00de, 0x009e, 0x008e, 0x007e, 0x005e, 0x004e, 0x003e,
+	0x002e, 0x001e, 0x0005, 0x7014, 0x2048, 0xa864, 0x9086, 0x0103,
+	0x1118, 0x701f, 0x3c68, 0x0450, 0x7014, 0x2048, 0xa868, 0xc0fd,
+	0xa86a, 0x2009, 0x007f, 0x080c, 0x64cc, 0x0110, 0x9006, 0x0030,
+	0xb813, 0x00ff, 0xb817, 0xfffd, 0x080c, 0xcbff, 0x015e, 0x00de,
+	0x009e, 0x008e, 0x007e, 0x005e, 0x004e, 0x003e, 0x002e, 0x001e,
+	0x0904, 0x3565, 0x0016, 0x0026, 0x0036, 0x0046, 0x0056, 0x0076,
+	0x0086, 0x0096, 0x00d6, 0x0156, 0x701f, 0x3c3a, 0x7007, 0x0003,
+	0x0804, 0x3bf8, 0xa830, 0x9086, 0x0100, 0x2021, 0x400c, 0x0904,
+	0x3535, 0x0076, 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, 0x0fb8, 0x000e,
+	0x080c, 0x4a24, 0x007e, 0x701f, 0x3ba7, 0x7023, 0x0001, 0x0005,
+	0x0804, 0x3533, 0x0156, 0x00c6, 0xa814, 0x908a, 0x001e, 0x0218,
+	0xa833, 0x001e, 0x0010, 0xa832, 0x0078, 0x81ff, 0x0168, 0x0016,
+	0x080c, 0x49d8, 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, 0x199d, 0x2003, 0x0001, 0x0005,
+	0x00f6, 0x00e6, 0x00c6, 0x2061, 0x0200, 0x2001, 0x19a8, 0x2004,
+	0x601a, 0x2061, 0x0100, 0x2001, 0x19a7, 0x2004, 0x60ce, 0x6104,
+	0xc1ac, 0x6106, 0x080c, 0x49d8, 0xa813, 0x0019, 0xa817, 0x0001,
+	0x2900, 0xa85a, 0x2001, 0x002e, 0x2004, 0xa866, 0x2001, 0x002f,
+	0x2004, 0xa86a, 0x2061, 0x0090, 0x2079, 0x0100, 0x2001, 0x19a7,
+	0x2004, 0x6036, 0x2009, 0x0040, 0x080c, 0x2184, 0x2001, 0x002a,
+	0x2004, 0x9084, 0xfff8, 0xa86e, 0x601a, 0xa873, 0x0000, 0x601f,
+	0x0000, 0x78ca, 0x9006, 0x600a, 0x600e, 0x00ce, 0x00ee, 0x00fe,
+	0x0005, 0x00e6, 0x080c, 0x49d8, 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, 0x29af, 0x1130, 0x9006,
+	0x080c, 0x2919, 0x9006, 0x080c, 0x28fc, 0x7884, 0x9084, 0x0007,
+	0x0002, 0x3d24, 0x3d2d, 0x3d36, 0x3d21, 0x3d21, 0x3d21, 0x3d21,
+	0x3d21, 0x012e, 0x0804, 0x3568, 0x2009, 0x0114, 0x2104, 0x9085,
+	0x0800, 0x200a, 0x080c, 0x3ef8, 0x00c0, 0x2009, 0x0114, 0x2104,
+	0x9085, 0x4000, 0x200a, 0x080c, 0x3ef8, 0x0078, 0x080c, 0x73e4,
+	0x1128, 0x012e, 0x2009, 0x0016, 0x0804, 0x3565, 0x81ff, 0x0128,
+	0x012e, 0x2021, 0x400b, 0x0804, 0x3535, 0x080c, 0xa781, 0x0086,
+	0x0096, 0x00a6, 0x00b6, 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x080c,
+	0x3a4f, 0x2009, 0x0101, 0x210c, 0x0016, 0x7ec8, 0x7dcc, 0x9006,
+	0x2068, 0x2060, 0x2058, 0x080c, 0x4199, 0x080c, 0x40e9, 0x903e,
+	0x2720, 0x00f6, 0x00e6, 0x0086, 0x2940, 0x2071, 0x19e5, 0x2079,
+	0x0090, 0x00d6, 0x2069, 0x0000, 0x6884, 0xd0b4, 0x0120, 0x68d4,
+	0x780e, 0x68d0, 0x780a, 0x00de, 0x2011, 0x0001, 0x080c, 0x404a,
+	0x080c, 0x29b7, 0x080c, 0x29b7, 0x080c, 0x29b7, 0x080c, 0x29b7,
+	0x080c, 0x404a, 0x008e, 0x00ee, 0x00fe, 0x080c, 0x3f77, 0x2009,
+	0x9c40, 0x8109, 0x11b0, 0x080c, 0x3eae, 0x2001, 0x0004, 0x200c,
+	0x918c, 0xfffd, 0x2102, 0x001e, 0x00fe, 0x00ee, 0x00de, 0x00ce,
+	0x00be, 0x00ae, 0x009e, 0x008e, 0x2009, 0x0017, 0x080c, 0x3565,
+	0x0cf8, 0x2001, 0x020b, 0x2004, 0x9084, 0x0140, 0x1d10, 0x00f6,
+	0x2079, 0x0000, 0x7884, 0x00fe, 0xd0bc, 0x0178, 0x2001, 0x0201,
+	0x200c, 0x81ff, 0x0150, 0x080c, 0x3f55, 0x2d00, 0x9c05, 0x9b05,
+	0x0120, 0x080c, 0x3eae, 0x0804, 0x3e57, 0x080c, 0x40be, 0x080c,
+	0x3fe2, 0x080c, 0x3f38, 0x080c, 0x3f6d, 0x00f6, 0x2079, 0x0100,
+	0x7824, 0xd0ac, 0x0130, 0x8b58, 0x080c, 0x3eae, 0x00fe, 0x0804,
+	0x3e57, 0x00fe, 0x080c, 0x3ea4, 0x1150, 0x8d68, 0x2001, 0x0032,
+	0x2602, 0x2001, 0x0033, 0x2502, 0x080c, 0x3eae, 0x0080, 0x87ff,
+	0x0138, 0x2001, 0x0201, 0x2004, 0x9005, 0x1908, 0x8739, 0x0038,
+	0x2001, 0x1a69, 0x2004, 0x9086, 0x0000, 0x1904, 0x3da7, 0x2001,
+	0x032f, 0x2003, 0x00f6, 0x8631, 0x1208, 0x8529, 0x2500, 0x9605,
+	0x0904, 0x3e57, 0x7884, 0xd0bc, 0x0128, 0x2d00, 0x9c05, 0x9b05,
+	0x1904, 0x3e57, 0xa013, 0x0019, 0x2001, 0x032a, 0x2003, 0x0004,
+	0x7884, 0xd0ac, 0x1148, 0x2001, 0x1a69, 0x2003, 0x0003, 0x2001,
+	0x032a, 0x2003, 0x0009, 0x0030, 0xa017, 0x0001, 0x78b4, 0x9005,
+	0x0108, 0xa016, 0x2800, 0xa05a, 0x2009, 0x0040, 0x080c, 0x2184,
+	0x2900, 0xa85a, 0xa813, 0x0019, 0x7884, 0xd0a4, 0x1180, 0xa817,
+	0x0000, 0x00c6, 0x20a9, 0x0004, 0x2061, 0x0090, 0x602b, 0x0008,
+	0x2001, 0x0203, 0x2004, 0x1f04, 0x3e2e, 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, 0x3d61, 0x001e,
+	0x00c6, 0x2001, 0x032a, 0x2003, 0x0004, 0x2061, 0x0100, 0x6027,
+	0x0002, 0x6106, 0x2011, 0x020d, 0x2013, 0x0020, 0x2001, 0x0004,
+	0x200c, 0x918c, 0xfffd, 0x2102, 0x080c, 0x131f, 0x7884, 0x9084,
+	0x0003, 0x9086, 0x0002, 0x01b0, 0x2009, 0x0028, 0x080c, 0x2184,
+	0x2001, 0x0227, 0x200c, 0x2102, 0x6050, 0x9084, 0xb7ff, 0x080c,
+	0x2a72, 0x6052, 0x602f, 0x0000, 0x604b, 0xf7f7, 0x6043, 0x0090,
+	0x6043, 0x0010, 0x080c, 0xa79d, 0x00ce, 0x2d08, 0x2c10, 0x2b18,
+	0x2b00, 0x9c05, 0x9d05, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be,
+	0x00ae, 0x009e, 0x008e, 0x1118, 0x012e, 0x0804, 0x3533, 0x012e,
+	0x2021, 0x400c, 0x0804, 0x3535, 0x9085, 0x0001, 0x1d04, 0x3ead,
+	0x2091, 0x6000, 0x8420, 0x9486, 0x0064, 0x0005, 0x2001, 0x0105,
+	0x2003, 0x0010, 0x2001, 0x032a, 0x2003, 0x0004, 0x2001, 0x1a69,
+	0x2003, 0x0000, 0x0071, 0x2009, 0x0048, 0x080c, 0x2184, 0x2001,
+	0x0227, 0x2024, 0x2402, 0x2001, 0x0109, 0x2003, 0x4000, 0x9026,
+	0x0005, 0x00f6, 0x00e6, 0x2071, 0x19e5, 0x7054, 0x9086, 0x0000,
+	0x0520, 0x2079, 0x0090, 0x2009, 0x0206, 0x2104, 0x2009, 0x0203,
+	0x210c, 0x9106, 0x1120, 0x2009, 0x0040, 0x080c, 0x2184, 0x782c,
+	0xd0fc, 0x0d88, 0x080c, 0x40be, 0x7054, 0x9086, 0x0000, 0x1d58,
+	0x782b, 0x0004, 0x782c, 0xd0ac, 0x1de8, 0x2009, 0x0040, 0x080c,
+	0x2184, 0x782b, 0x0002, 0x7057, 0x0000, 0x00ee, 0x00fe, 0x0005,
+	0x00f6, 0x2079, 0x0100, 0x2001, 0x1818, 0x200c, 0x7932, 0x7936,
+	0x080c, 0x2618, 0x080c, 0x2a2e, 0x080c, 0x2a72, 0x784b, 0xf7f7,
+	0x7843, 0x0090, 0x7843, 0x0010, 0x7850, 0xc0e5, 0x7852, 0x2019,
+	0x61a8, 0x7820, 0xd09c, 0x0110, 0x8319, 0x1dd8, 0x7850, 0xc0e4,
+	0x7852, 0x2011, 0x0048, 0x080c, 0x2a0b, 0x7843, 0x0040, 0x2019,
+	0x01f4, 0xa001, 0xa001, 0x8319, 0x1de0, 0x2001, 0x0100, 0x080c,
+	0x29d1, 0x2011, 0x0020, 0x080c, 0x2a0b, 0x7843, 0x0000, 0x9006,
+	0x080c, 0x29d1, 0x2011, 0x0048, 0x080c, 0x2a0b, 0x00fe, 0x0005,
+	0x7884, 0xd0ac, 0x11c8, 0x00f6, 0x00e6, 0x2071, 0x1a69, 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, 0x19a8, 0x2004, 0x70e2, 0x080c, 0x3c89,
+	0x1188, 0x2001, 0x1820, 0x2004, 0x2009, 0x181f, 0x210c, 0x918c,
+	0x00ff, 0x706e, 0x716a, 0x7066, 0x918d, 0x3200, 0x7162, 0x7073,
+	0xe109, 0x0080, 0x702c, 0x9085, 0x0002, 0x702e, 0x2009, 0x1818,
+	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, 0x40be, 0x00f6, 0x2071,
+	0x1a69, 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, 0x404a, 0x2011, 0x0001, 0x080c, 0x404a, 0x00fe,
+	0x00ee, 0x0005, 0x00f6, 0x00e6, 0x2071, 0x1a69, 0x2079, 0x0320,
+	0x792c, 0xd1fc, 0x0904, 0x4047, 0x782b, 0x0002, 0x9026, 0xd19c,
+	0x1904, 0x4043, 0x7000, 0x0002, 0x4047, 0x3ff8, 0x4028, 0x4043,
+	0xd1bc, 0x1170, 0xd1dc, 0x1190, 0x8001, 0x7002, 0x2011, 0x0001,
+	0x080c, 0x404a, 0x0904, 0x4047, 0x080c, 0x404a, 0x0804, 0x4047,
+	0x00f6, 0x2079, 0x0300, 0x78bf, 0x0000, 0x00fe, 0x7810, 0x7914,
+	0x782b, 0x0004, 0x7812, 0x7916, 0x2001, 0x0201, 0x200c, 0x81ff,
+	0x0de8, 0x080c, 0x3f55, 0x2009, 0x0001, 0x00f6, 0x2079, 0x0300,
+	0x78b8, 0x00fe, 0xd0ec, 0x0110, 0x2009, 0x0011, 0x792a, 0x00f8,
+	0x8001, 0x7002, 0x9184, 0x0880, 0x1140, 0x782c, 0xd0fc, 0x1904,
+	0x3fec, 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, 0x0d7d, 0x9398, 0x4078, 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,
+	0x40b5, 0x40ac, 0x40a3, 0x409a, 0x4091, 0x4088, 0x407f, 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, 0x19e5, 0x2079, 0x0090, 0x792c, 0xd1fc, 0x01e8,
+	0x782b, 0x0002, 0x2940, 0x9026, 0x7054, 0x0002, 0x40e5, 0x40d1,
+	0x40dc, 0x8001, 0x7056, 0xd19c, 0x1180, 0x2011, 0x0001, 0x080c,
+	0x404a, 0x190c, 0x404a, 0x0048, 0x8001, 0x7056, 0x782c, 0xd0fc,
+	0x1d38, 0x2011, 0x0001, 0x080c, 0x404a, 0x008e, 0x00ee, 0x00fe,
+	0x0005, 0x00f6, 0x00e6, 0x00c6, 0x0086, 0x2061, 0x0200, 0x2001,
+	0x19a8, 0x2004, 0x601a, 0x2061, 0x0100, 0x2001, 0x19a7, 0x2004,
+	0x60ce, 0x6104, 0xc1ac, 0x6106, 0x2001, 0x002c, 0x2004, 0x9005,
+	0x0520, 0x2038, 0x2001, 0x002e, 0x2024, 0x2001, 0x002f, 0x201c,
+	0x080c, 0x49d8, 0xa813, 0x0019, 0xaf16, 0x2900, 0xa85a, 0x978a,
+	0x0007, 0x0220, 0x2138, 0x2009, 0x0007, 0x0010, 0x2708, 0x903e,
+	0x0096, 0xa858, 0x2048, 0xa85c, 0x9080, 0x0019, 0x009e, 0x080c,
+	0x4161, 0x1d68, 0x2900, 0xa85a, 0x00d0, 0x080c, 0x49d8, 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, 0x19a7, 0x2004, 0x6036, 0x2009,
+	0x0040, 0x080c, 0x2184, 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, 0x49d8, 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, 0x49d8,
+	0x2940, 0xa813, 0x0019, 0xaf16, 0x2900, 0xa85a, 0x978a, 0x0007,
+	0x0220, 0x2138, 0x2009, 0x0007, 0x0010, 0x2708, 0x903e, 0x0096,
+	0xa858, 0x2048, 0xa85c, 0x9080, 0x0019, 0x009e, 0x080c, 0x4161,
+	0x1d68, 0x2900, 0xa85a, 0x00d8, 0x080c, 0x49d8, 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, 0x1a69,
+	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, 0x0007, 0x20a1, 0x1840, 0x20e9, 0x0001, 0x9006,
+	0x4004, 0x20a9, 0x000c, 0x20a1, 0xfff4, 0x20e9, 0x0000, 0x9006,
+	0x4004, 0x2009, 0x013c, 0x200a, 0x012e, 0x7880, 0x9086, 0x0052,
+	0x0108, 0x0005, 0x0804, 0x3533, 0x7d98, 0x7c9c, 0x0804, 0x362a,
+	0x080c, 0x73e4, 0x190c, 0x5f06, 0x6040, 0x9084, 0x0020, 0x09b1,
+	0x2069, 0x1847, 0x2d00, 0x2009, 0x0030, 0x7a8c, 0x7b88, 0x7c9c,
+	0x7d98, 0x2039, 0x0001, 0x080c, 0x4a21, 0x701f, 0x4240, 0x0005,
+	0x080c, 0x560b, 0x1130, 0x3b00, 0x3a08, 0xc194, 0xc095, 0x20d8,
+	0x21d0, 0x2069, 0x1847, 0x6800, 0x9005, 0x0904, 0x3568, 0x6804,
+	0xd0ac, 0x0118, 0xd0a4, 0x0904, 0x3568, 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, 0x3568, 0x9288, 0x3334, 0x210d, 0x918c, 0x00ff, 0x6166,
+	0xd0dc, 0x0130, 0x6828, 0x908a, 0x007f, 0x1a04, 0x3568, 0x605e,
+	0x6888, 0x9084, 0x0030, 0x8004, 0x8004, 0x8004, 0x8004, 0x0006,
+	0x2009, 0x19af, 0x9080, 0x270b, 0x2005, 0x200a, 0x2008, 0x2001,
+	0x0018, 0x080c, 0xa772, 0x2009, 0x0390, 0x200b, 0x0400, 0x000e,
+	0x2009, 0x19b0, 0x9080, 0x270f, 0x2005, 0x200a, 0x6808, 0x908a,
+	0x0100, 0x0a04, 0x3568, 0x908a, 0x0841, 0x1a04, 0x3568, 0x9084,
+	0x0007, 0x1904, 0x3568, 0x680c, 0x9005, 0x0904, 0x3568, 0x6810,
+	0x9005, 0x0904, 0x3568, 0x6848, 0x6940, 0x910a, 0x1a04, 0x3568,
+	0x8001, 0x0904, 0x3568, 0x684c, 0x6944, 0x910a, 0x1a04, 0x3568,
+	0x8001, 0x0904, 0x3568, 0x6814, 0x908c, 0x00ff, 0x614e, 0x8007,
+	0x9084, 0x00ff, 0x6052, 0x080c, 0x7719, 0x080c, 0x69a0, 0x080c,
+	0x69d4, 0x6808, 0x602a, 0x080c, 0x20f6, 0x2009, 0x0170, 0x200b,
+	0x0080, 0xa001, 0xa001, 0x200b, 0x0000, 0x0036, 0x6b08, 0x080c,
+	0x2672, 0x003e, 0x6000, 0x9086, 0x0000, 0x1904, 0x43cb, 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, 0x19b1, 0x20e9, 0x0001, 0x4001,
+	0x20a9, 0x0004, 0x20a1, 0x19cb, 0x20e9, 0x0001, 0x4001, 0x080c,
+	0x869b, 0x00c6, 0x900e, 0x20a9, 0x0001, 0x6b70, 0xd384, 0x01c8,
+	0x0020, 0x839d, 0x12b0, 0x3508, 0x8109, 0x080c, 0x7cda, 0x6878,
+	0x6016, 0x6874, 0x2008, 0x9084, 0xff00, 0x8007, 0x600a, 0x9184,
+	0x00ff, 0x6006, 0x8108, 0x1118, 0x6003, 0x0003, 0x0010, 0x6003,
+	0x0001, 0x1f04, 0x4329, 0x00ce, 0x00c6, 0x2061, 0x199a, 0x6a88,
+	0x9284, 0xc000, 0x2010, 0x9286, 0x0000, 0x1158, 0x2063, 0x0000,
+	0x2001, 0x0001, 0x080c, 0x2919, 0x2001, 0x0001, 0x080c, 0x28fc,
+	0x0088, 0x9286, 0x4000, 0x1148, 0x2063, 0x0001, 0x9006, 0x080c,
+	0x2919, 0x9006, 0x080c, 0x28fc, 0x0028, 0x9286, 0x8000, 0x1d30,
+	0x2063, 0x0002, 0x00ce, 0x00e6, 0x2c70, 0x080c, 0x0eb4, 0x00ee,
+	0x6888, 0xd0ec, 0x0130, 0x2011, 0x0114, 0x2204, 0x9085, 0x0180,
+	0x2012, 0x6a80, 0x9284, 0x0030, 0x9086, 0x0030, 0x1128, 0x9294,
+	0xffcf, 0x9295, 0x0020, 0x6a82, 0x2001, 0x197c, 0x6a80, 0x9294,
+	0x0030, 0x928e, 0x0000, 0x0170, 0x928e, 0x0010, 0x0118, 0x928e,
+	0x0020, 0x0140, 0x2003, 0xaaaa, 0x080c, 0x26e7, 0x2001, 0x196d,
+	0x2102, 0x0008, 0x2102, 0x00c6, 0x2061, 0x0100, 0x602f, 0x0040,
+	0x602f, 0x0000, 0x00ce, 0x080c, 0x73e4, 0x0128, 0x080c, 0x4f0f,
+	0x0110, 0x080c, 0x2638, 0x60d4, 0x9005, 0x01c0, 0x6003, 0x0001,
+	0x2009, 0x43b3, 0x00e0, 0x080c, 0x73e4, 0x1168, 0x2011, 0x725a,
+	0x080c, 0x850b, 0x2011, 0x724d, 0x080c, 0x8614, 0x080c, 0x76ed,
+	0x080c, 0x7315, 0x0040, 0x080c, 0x5dfc, 0x0028, 0x6003, 0x0004,
+	0x2009, 0x43cb, 0x0020, 0x080c, 0x68d5, 0x0804, 0x3533, 0x2001,
+	0x0170, 0x2004, 0x9084, 0x00ff, 0x9086, 0x004c, 0x1118, 0x2091,
+	0x31bd, 0x0817, 0x2091, 0x313d, 0x0817, 0x6000, 0x9086, 0x0000,
+	0x0904, 0x3565, 0x2069, 0x1847, 0x7890, 0x6842, 0x7894, 0x6846,
+	0x2d00, 0x2009, 0x0030, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x2039,
+	0x0001, 0x0804, 0x4a24, 0x9006, 0x080c, 0x2638, 0x81ff, 0x1904,
+	0x3565, 0x080c, 0x73e4, 0x11b0, 0x080c, 0x76e8, 0x080c, 0x5f41,
+	0x080c, 0x3328, 0x0118, 0x6130, 0xc18d, 0x6132, 0x080c, 0xce35,
+	0x0130, 0x080c, 0x7407, 0x1118, 0x080c, 0x73b8, 0x0038, 0x080c,
+	0x7315, 0x0020, 0x080c, 0x5f06, 0x080c, 0x5dfc, 0x0804, 0x3533,
+	0x81ff, 0x1904, 0x3565, 0x080c, 0x73e4, 0x1110, 0x0804, 0x3565,
+	0x6194, 0x81ff, 0x01a8, 0x704f, 0x0000, 0x2001, 0x1d80, 0x2009,
+	0x0040, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x0126, 0x2091, 0x8000,
+	0x2039, 0x0001, 0x080c, 0x4a24, 0x701f, 0x3531, 0x012e, 0x0005,
+	0x704f, 0x0001, 0x00d6, 0x2069, 0x1d80, 0x20a9, 0x0040, 0x20e9,
+	0x0001, 0x20a1, 0x1d80, 0x2019, 0xffff, 0x4304, 0x655c, 0x9588,
+	0x3334, 0x210d, 0x918c, 0x00ff, 0x216a, 0x900e, 0x2011, 0x0002,
+	0x2100, 0x9506, 0x01a8, 0x080c, 0x652d, 0x1190, 0xb814, 0x821c,
+	0x0238, 0x9398, 0x1d80, 0x9085, 0xff00, 0x8007, 0x201a, 0x0038,
+	0x9398, 0x1d80, 0x2324, 0x94a4, 0xff00, 0x9405, 0x201a, 0x8210,
+	0x8108, 0x9182, 0x0080, 0x1208, 0x0c18, 0x8201, 0x8007, 0x2d0c,
+	0x9105, 0x206a, 0x00de, 0x20a9, 0x0040, 0x20a1, 0x1d80, 0x2099,
+	0x1d80, 0x080c, 0x5e91, 0x0804, 0x4425, 0x080c, 0x4a0b, 0x0904,
+	0x3568, 0x080c, 0x49d8, 0x1120, 0x2009, 0x0002, 0x0804, 0x3565,
+	0x080c, 0x55fc, 0xd0b4, 0x0558, 0x7884, 0x908e, 0x007e, 0x0538,
+	0x908e, 0x007f, 0x0520, 0x908e, 0x0080, 0x0508, 0x080c, 0x3323,
+	0x1148, 0xb800, 0xd08c, 0x11d8, 0xb804, 0x9084, 0x00ff, 0x9086,
+	0x0006, 0x11a8, 0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a, 0x080c,
+	0xc8eb, 0x1120, 0x2009, 0x0003, 0x0804, 0x3565, 0x7007, 0x0003,
+	0x701f, 0x44b3, 0x0005, 0x080c, 0x4a0b, 0x0904, 0x3568, 0x20a9,
+	0x002b, 0xb8c4, 0x20e0, 0xb8c8, 0x2098, 0xa860, 0x20e8, 0xa85c,
+	0x9080, 0x0002, 0x20a0, 0x4003, 0x20a9, 0x0008, 0x9080, 0x0006,
+	0x20a0, 0xb8c4, 0x20e0, 0xb8c8, 0x9080, 0x0006, 0x2098, 0x080c,
+	0x0fb8, 0x0070, 0x20a9, 0x0004, 0xa85c, 0x9080, 0x000a, 0x20a0,
+	0xb8c4, 0x20e0, 0xb8c8, 0x9080, 0x000a, 0x2098, 0x080c, 0x0fb8,
+	0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080,
+	0x0002, 0x2009, 0x002b, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x0804,
+	0x4a24, 0x81ff, 0x1904, 0x3565, 0x080c, 0x49ef, 0x0904, 0x3568,
+	0x080c, 0x676e, 0x0904, 0x3565, 0x0058, 0xa878, 0x9005, 0x0120,
+	0x2009, 0x0004, 0x0804, 0x3565, 0xa974, 0xaa94, 0x0804, 0x3533,
+	0x080c, 0x5604, 0x0904, 0x3533, 0x701f, 0x44fd, 0x7007, 0x0003,
+	0x0005, 0x81ff, 0x1904, 0x3565, 0x7888, 0x908a, 0x1000, 0x1a04,
+	0x3568, 0x080c, 0x4a0b, 0x0904, 0x3568, 0x080c, 0x696a, 0x0120,
+	0x080c, 0x6972, 0x1904, 0x3568, 0x080c, 0x67f3, 0x0904, 0x3565,
+	0x2019, 0x0004, 0x900e, 0x080c, 0x6780, 0x0904, 0x3565, 0x7984,
+	0x7a88, 0x04c9, 0x08a8, 0xa89c, 0x908a, 0x1000, 0x12f8, 0x080c,
+	0x4a09, 0x01e0, 0x080c, 0x696a, 0x0118, 0x080c, 0x6972, 0x11b0,
+	0x080c, 0x67f3, 0x2009, 0x0002, 0x0168, 0x2009, 0x0002, 0x2019,
+	0x0004, 0x080c, 0x6780, 0x2009, 0x0003, 0x0120, 0xa998, 0xaa9c,
+	0x00d1, 0x0060, 0xa897, 0x4005, 0xa99a, 0x0010, 0xa897, 0x4006,
+	0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x0005, 0xa897, 0x4000,
+	0x080c, 0x5604, 0x0110, 0x9006, 0x0018, 0x900e, 0x9085, 0x0001,
+	0x2001, 0x0000, 0x0005, 0x9186, 0x00ff, 0x0110, 0x0071, 0x0060,
+	0x2029, 0x007e, 0x2061, 0x1800, 0x645c, 0x2400, 0x9506, 0x0110,
+	0x2508, 0x0019, 0x8529, 0x1ec8, 0x0005, 0x080c, 0x652d, 0x1138,
+	0x2200, 0x8003, 0x800b, 0x810b, 0x9108, 0x080c, 0x8519, 0x0005,
+	0x81ff, 0x1904, 0x3565, 0x080c, 0x49ef, 0x0904, 0x3568, 0x080c,
+	0x65f4, 0x0904, 0x3565, 0x080c, 0x6777, 0x0904, 0x3565, 0x0804,
+	0x4508, 0x81ff, 0x1904, 0x3565, 0x080c, 0x49ef, 0x0904, 0x3568,
+	0x080c, 0x696a, 0x0120, 0x080c, 0x6972, 0x1904, 0x3568, 0x080c,
+	0x65f4, 0x0904, 0x3565, 0x080c, 0x6765, 0x0904, 0x3565, 0x0804,
+	0x4508, 0x6100, 0x0804, 0x3533, 0x080c, 0x4a0b, 0x0904, 0x3568,
+	0x080c, 0x5610, 0x1904, 0x3565, 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,
+	0x3533, 0x78a8, 0x909c, 0x0003, 0xd0b4, 0x1140, 0x939a, 0x0003,
+	0x1a04, 0x3565, 0x625c, 0x7884, 0x9206, 0x1548, 0x080c, 0x8685,
+	0x2001, 0xfff4, 0x2009, 0x000c, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98,
+	0x2039, 0x0000, 0x0006, 0x78a8, 0x9084, 0x0080, 0x1118, 0x000e,
+	0x0804, 0x4a24, 0x000e, 0x2031, 0x0000, 0x2061, 0x18b8, 0x2c44,
+	0xa66a, 0xa17a, 0xa772, 0xa076, 0xa28e, 0xa392, 0xa496, 0xa59a,
+	0x080c, 0x111b, 0x7007, 0x0002, 0x701f, 0x462f, 0x0005, 0x81ff,
+	0x1904, 0x3565, 0x080c, 0x4a0b, 0x0904, 0x3568, 0x080c, 0x696a,
+	0x1904, 0x3565, 0x00c6, 0x080c, 0x49d8, 0x00ce, 0x0904, 0x3565,
+	0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a, 0x7ea8, 0x080c, 0xc891,
+	0x0904, 0x3565, 0x7007, 0x0003, 0x701f, 0x4633, 0x0005, 0x080c,
+	0x4206, 0x0804, 0x3533, 0xa830, 0x9086, 0x0100, 0x0904, 0x3565,
+	0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080,
+	0x001b, 0x2009, 0x000c, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x0804,
+	0x4a24, 0x9006, 0x080c, 0x2638, 0x78a8, 0x9084, 0x00ff, 0x9086,
+	0x00ff, 0x0118, 0x81ff, 0x1904, 0x3565, 0x080c, 0x73e4, 0x0110,
+	0x080c, 0x5f06, 0x7888, 0x908a, 0x1000, 0x1a04, 0x3568, 0x7984,
+	0x9186, 0x00ff, 0x0138, 0x9182, 0x007f, 0x1a04, 0x3568, 0x2100,
+	0x080c, 0x2602, 0x0026, 0x00c6, 0x0126, 0x2091, 0x8000, 0x2061,
+	0x1a01, 0x601b, 0x0000, 0x601f, 0x0000, 0x6073, 0x0000, 0x6077,
+	0x0000, 0x080c, 0x73e4, 0x1158, 0x080c, 0x76e8, 0x080c, 0x5f41,
+	0x9085, 0x0001, 0x080c, 0x742b, 0x080c, 0x7315, 0x00f0, 0x080c,
+	0xa781, 0x080c, 0xaa49, 0x080c, 0xa79d, 0x2061, 0x0100, 0x2001,
+	0x1818, 0x2004, 0x9084, 0x00ff, 0x810f, 0x9105, 0x604a, 0x6043,
+	0x0090, 0x6043, 0x0010, 0x2009, 0x1997, 0x200b, 0x0000, 0x2009,
+	0x002d, 0x2011, 0x5e2c, 0x080c, 0x85d2, 0x7984, 0x080c, 0x73e4,
+	0x1110, 0x2009, 0x00ff, 0x7a88, 0x080c, 0x456b, 0x012e, 0x00ce,
+	0x002e, 0x0804, 0x3533, 0x7984, 0x080c, 0x64cc, 0x2b08, 0x1904,
+	0x3568, 0x0804, 0x3533, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804,
+	0x3565, 0x60dc, 0xd0ac, 0x1130, 0xd09c, 0x1120, 0x2009, 0x0005,
+	0x0804, 0x3565, 0x080c, 0x49d8, 0x1120, 0x2009, 0x0002, 0x0804,
+	0x3565, 0x7984, 0x9192, 0x0021, 0x1a04, 0x3568, 0x7a8c, 0x7b88,
+	0x7c9c, 0x7d98, 0xa85c, 0x9080, 0x0019, 0x702a, 0xaf60, 0x7736,
+	0x080c, 0x4a21, 0x701f, 0x46eb, 0x7880, 0x9086, 0x006e, 0x0110,
+	0x701f, 0x50c1, 0x0005, 0x2009, 0x0080, 0x080c, 0x652d, 0x1118,
+	0x080c, 0x696a, 0x0120, 0x2021, 0x400a, 0x0804, 0x3535, 0x00d6,
+	0x0096, 0xa964, 0xaa6c, 0xab70, 0xac74, 0xad78, 0xae7c, 0xa884,
+	0x90be, 0x0100, 0x0904, 0x4784, 0x90be, 0x0112, 0x0904, 0x4784,
+	0x90be, 0x0113, 0x0904, 0x4784, 0x90be, 0x0114, 0x0904, 0x4784,
+	0x90be, 0x0117, 0x0904, 0x4784, 0x90be, 0x011a, 0x0904, 0x4784,
+	0x90be, 0x011c, 0x0904, 0x4784, 0x90be, 0x0121, 0x0904, 0x476b,
+	0x90be, 0x0131, 0x0904, 0x476b, 0x90be, 0x0171, 0x0904, 0x4784,
+	0x90be, 0x0173, 0x0904, 0x4784, 0x90be, 0x01a1, 0x1128, 0xa894,
+	0x8007, 0xa896, 0x0804, 0x478f, 0x90be, 0x0212, 0x0904, 0x4778,
+	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, 0x3568, 0x7028, 0x9080, 0x0010, 0x2098, 0x20a0, 0x7034,
+	0x20e0, 0x20e8, 0x20a9, 0x0007, 0x080c, 0x47cd, 0x7028, 0x9080,
+	0x000e, 0x2098, 0x20a0, 0x7034, 0x20e0, 0x20e8, 0x20a9, 0x0001,
+	0x080c, 0x47cd, 0x00c8, 0x7028, 0x9080, 0x000c, 0x2098, 0x20a0,
+	0x7034, 0x20e0, 0x20e8, 0x20a9, 0x0001, 0x080c, 0x47da, 0x00b8,
+	0x7028, 0x9080, 0x000e, 0x2098, 0x20a0, 0x7034, 0x20e0, 0x20e8,
+	0x20a9, 0x0001, 0x080c, 0x47da, 0x7028, 0x9080, 0x000c, 0x2098,
+	0x20a0, 0x7034, 0x20e0, 0x20e8, 0x20a9, 0x0001, 0x04f1, 0x00c6,
+	0x080c, 0x49d8, 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, 0xc8ac, 0x1120, 0x2009, 0x0003, 0x0804, 0x3565,
+	0x7007, 0x0003, 0x701f, 0x47c4, 0x0005, 0x00ce, 0x009e, 0x00de,
+	0x2009, 0x0002, 0x0804, 0x3565, 0xa820, 0x9086, 0x8001, 0x1904,
+	0x3533, 0x2009, 0x0004, 0x0804, 0x3565, 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, 0x3565, 0x60dc, 0xd0ac, 0x1130, 0xd09c, 0x1120,
+	0x2009, 0x0005, 0x0804, 0x3565, 0x7984, 0x78a8, 0x2040, 0x080c,
+	0xaa42, 0x1120, 0x9182, 0x007f, 0x0a04, 0x3568, 0x9186, 0x00ff,
+	0x0904, 0x3568, 0x9182, 0x0800, 0x1a04, 0x3568, 0x7a8c, 0x7b88,
+	0x607c, 0x9306, 0x1140, 0x6080, 0x924e, 0x0904, 0x3568, 0x99cc,
+	0xff00, 0x0904, 0x3568, 0x0126, 0x2091, 0x8000, 0x080c, 0x48eb,
+	0x0904, 0x486b, 0x0086, 0x90c6, 0x4000, 0x008e, 0x1538, 0x00c6,
+	0x0006, 0x0036, 0xb818, 0xbb1c, 0x9305, 0xbb20, 0x9305, 0xbb24,
+	0x9305, 0xbb28, 0x9305, 0xbb2c, 0x9305, 0xbb30, 0x9305, 0xbb34,
+	0x9305, 0x003e, 0x0570, 0xd88c, 0x1128, 0x080c, 0x696a, 0x0110,
+	0xc89d, 0x0438, 0x900e, 0x080c, 0x681c, 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,
+	0x3535, 0x000e, 0x00ce, 0x2b00, 0x7026, 0x0016, 0x00b6, 0x00c6,
+	0x00e6, 0x2c70, 0x080c, 0xab4a, 0x0904, 0x48c0, 0x2b00, 0x6012,
+	0x080c, 0xcbb0, 0x2e58, 0x00ee, 0x00e6, 0x00c6, 0x080c, 0x49d8,
+	0x00ce, 0x2b70, 0x1158, 0x080c, 0xaad8, 0x00ee, 0x00ce, 0x00be,
+	0x001e, 0x012e, 0x2009, 0x0002, 0x0804, 0x3565, 0x900e, 0xa966,
+	0xa96a, 0x2900, 0x6016, 0xa932, 0xa868, 0xc0fd, 0xd88c, 0x0108,
+	0xc0f5, 0xa86a, 0xd89c, 0x1110, 0x080c, 0x31ab, 0x6023, 0x0001,
+	0x9006, 0x080c, 0x6469, 0xd89c, 0x0138, 0x2001, 0x0004, 0x080c,
+	0x647d, 0x2009, 0x0003, 0x0030, 0x2001, 0x0002, 0x080c, 0x647d,
+	0x2009, 0x0002, 0x080c, 0xab77, 0x78a8, 0xd094, 0x0138, 0x00ee,
+	0x7024, 0x00e6, 0x2058, 0xb8d4, 0xc08d, 0xb8d6, 0x9085, 0x0001,
+	0x00ee, 0x00ce, 0x00be, 0x001e, 0x012e, 0x1120, 0x2009, 0x0003,
+	0x0804, 0x3565, 0x7007, 0x0003, 0x701f, 0x48cf, 0x0005, 0xa830,
+	0x9086, 0x0100, 0x7024, 0x2058, 0x1138, 0x2009, 0x0004, 0xba04,
+	0x9294, 0x00ff, 0x0804, 0x5559, 0x900e, 0xa868, 0xd0f4, 0x1904,
+	0x3533, 0x080c, 0x681c, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108,
+	0xc18d, 0x0804, 0x3533, 0x00e6, 0x00d6, 0x0096, 0x83ff, 0x0904,
+	0x493a, 0x902e, 0x080c, 0xaa42, 0x0130, 0x9026, 0x20a9, 0x0800,
+	0x2071, 0x1000, 0x0030, 0x2021, 0x007f, 0x20a9, 0x0781, 0x2071,
+	0x107f, 0x2e04, 0x9005, 0x11b8, 0x2100, 0x9406, 0x1904, 0x494b,
+	0x2428, 0x94ce, 0x007f, 0x1120, 0x92ce, 0xfffd, 0x1558, 0x0030,
+	0x94ce, 0x0080, 0x1130, 0x92ce, 0xfffc, 0x1520, 0x93ce, 0x00ff,
+	0x1508, 0xc5fd, 0x0480, 0x2058, 0xbf10, 0x2700, 0x9306, 0x11e8,
+	0xbe14, 0x2600, 0x9206, 0x11c8, 0x2400, 0x9106, 0x1180, 0xd884,
+	0x0598, 0xd894, 0x1588, 0x080c, 0x690a, 0x1570, 0x2001, 0x4000,
+	0x0460, 0x080c, 0x696a, 0x1540, 0x2001, 0x4000, 0x0430, 0x2001,
+	0x4007, 0x0418, 0x2001, 0x4006, 0x0400, 0x2400, 0x9106, 0x1158,
+	0xbe14, 0x87ff, 0x1128, 0x86ff, 0x0918, 0x080c, 0xaa42, 0x1900,
+	0x2001, 0x4008, 0x0090, 0x8420, 0x8e70, 0x1f04, 0x4901, 0x85ff,
+	0x1130, 0x2001, 0x4009, 0x0048, 0x2001, 0x0001, 0x0030, 0x080c,
+	0x64cc, 0x1dd0, 0xbb12, 0xba16, 0x9006, 0x9005, 0x009e, 0x00de,
+	0x00ee, 0x0005, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x3565,
+	0x080c, 0x49d8, 0x1120, 0x2009, 0x0002, 0x0804, 0x3565, 0xa867,
+	0x0000, 0xa868, 0xc0fd, 0xa86a, 0x7884, 0x9005, 0x0904, 0x3568,
+	0x9096, 0x00ff, 0x0120, 0x9092, 0x0004, 0x1a04, 0x3568, 0x2010,
+	0x2918, 0x080c, 0x3145, 0x1120, 0x2009, 0x0003, 0x0804, 0x3565,
+	0x7007, 0x0003, 0x701f, 0x498d, 0x0005, 0xa830, 0x9086, 0x0100,
+	0x1904, 0x3533, 0x2009, 0x0004, 0x0804, 0x3565, 0x7984, 0x080c,
+	0xaa42, 0x1120, 0x9182, 0x007f, 0x0a04, 0x3568, 0x9186, 0x00ff,
+	0x0904, 0x3568, 0x9182, 0x0800, 0x1a04, 0x3568, 0x2001, 0x9000,
+	0x080c, 0x55b4, 0x1904, 0x3565, 0x0804, 0x3533, 0xa998, 0x080c,
+	0xaa42, 0x1118, 0x9182, 0x007f, 0x0280, 0x9186, 0x00ff, 0x0168,
+	0x9182, 0x0800, 0x1250, 0x2001, 0x9000, 0x080c, 0x55b4, 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, 0x103b, 0x0198, 0x9006, 0xa802, 0x7014, 0x9005, 0x1120,
+	0x2900, 0x7016, 0x701a, 0x0040, 0x7018, 0xa802, 0x0086, 0x2040,
+	0x2900, 0xa006, 0x701a, 0x008e, 0x9085, 0x0001, 0x0005, 0x7984,
+	0x080c, 0x652d, 0x1130, 0x7e88, 0x9684, 0x3fff, 0x9082, 0x4000,
+	0x0208, 0x905e, 0x8bff, 0x0005, 0xa998, 0x080c, 0x652d, 0x1130,
+	0xae9c, 0x9684, 0x3fff, 0x9082, 0x4000, 0x0208, 0x905e, 0x8bff,
+	0x0005, 0xae98, 0x0008, 0x7e84, 0x2608, 0x080c, 0x652d, 0x1108,
+	0x0008, 0x905e, 0x8bff, 0x0005, 0x0016, 0x7114, 0x81ff, 0x0128,
+	0x2148, 0xa904, 0x080c, 0x106d, 0x0cc8, 0x7116, 0x711a, 0x001e,
+	0x0005, 0x2031, 0x0001, 0x0010, 0x2031, 0x0000, 0x2061, 0x18b8,
+	0x2c44, 0xa66a, 0xa17a, 0xa772, 0xa076, 0xa28e, 0xa392, 0xa496,
+	0xa59a, 0x080c, 0x111b, 0x7007, 0x0002, 0x701f, 0x3533, 0x0005,
+	0x00f6, 0x0126, 0x2091, 0x8000, 0x2079, 0x0000, 0x2001, 0x18b0,
+	0x2004, 0x9005, 0x1190, 0x0e04, 0x4a55, 0x7a36, 0x7833, 0x0012,
+	0x7a82, 0x7b86, 0x7c8a, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004,
+	0xd084, 0x190c, 0x11cd, 0x0804, 0x4abb, 0x0016, 0x0086, 0x0096,
+	0x00c6, 0x00e6, 0x2071, 0x189e, 0x7044, 0x9005, 0x1540, 0x7148,
+	0x9182, 0x0010, 0x0288, 0x7038, 0x2060, 0x080c, 0x103b, 0x0904,
+	0x4ab3, 0xa84b, 0x0000, 0x2900, 0x7046, 0x2001, 0x0002, 0x9080,
+	0x1e31, 0x2005, 0xa846, 0x0098, 0x7038, 0x90e0, 0x0004, 0x2001,
+	0x18ba, 0x9c82, 0x18fa, 0x0210, 0x2061, 0x18ba, 0x2c00, 0x703a,
+	0x7148, 0x81ff, 0x1108, 0x703e, 0x8108, 0x714a, 0x0460, 0x7148,
+	0x8108, 0x714a, 0x7044, 0x2040, 0xa144, 0x2105, 0x0016, 0x908a,
+	0x0036, 0x1a0c, 0x0d7d, 0x2060, 0x001e, 0x8108, 0x2105, 0x9005,
+	0xa146, 0x1520, 0x080c, 0x103b, 0x1130, 0x8109, 0xa946, 0x7148,
+	0x8109, 0x714a, 0x00d8, 0x9006, 0xa806, 0xa84a, 0xa046, 0x2800,
+	0xa802, 0x2900, 0xa006, 0x7046, 0x2001, 0x0002, 0x9080, 0x1e31,
+	0x2005, 0xa846, 0x0058, 0x2262, 0x6306, 0x640a, 0x00ee, 0x00ce,
+	0x009e, 0x008e, 0x001e, 0x012e, 0x00fe, 0x0005, 0x2c00, 0x9082,
+	0x001b, 0x0002, 0x4add, 0x4add, 0x4adf, 0x4add, 0x4add, 0x4add,
+	0x4ae3, 0x4add, 0x4add, 0x4add, 0x4ae7, 0x4add, 0x4add, 0x4add,
+	0x4aeb, 0x4add, 0x4add, 0x4add, 0x4aef, 0x4add, 0x4add, 0x4add,
+	0x4af3, 0x4add, 0x4add, 0x4add, 0x4af8, 0x080c, 0x0d7d, 0xa276,
+	0xa37a, 0xa47e, 0x0898, 0xa286, 0xa38a, 0xa48e, 0x0878, 0xa296,
+	0xa39a, 0xa49e, 0x0858, 0xa2a6, 0xa3aa, 0xa4ae, 0x0838, 0xa2b6,
+	0xa3ba, 0xa4be, 0x0818, 0xa2c6, 0xa3ca, 0xa4ce, 0x0804, 0x4ab6,
+	0xa2d6, 0xa3da, 0xa4de, 0x0804, 0x4ab6, 0x00e6, 0x2071, 0x189e,
+	0x7048, 0x9005, 0x0904, 0x4b8f, 0x0126, 0x2091, 0x8000, 0x0e04,
+	0x4b8e, 0x00f6, 0x2079, 0x0000, 0x00c6, 0x0096, 0x0086, 0x0076,
+	0x9006, 0x2038, 0x7040, 0x2048, 0x9005, 0x0500, 0xa948, 0x2105,
+	0x0016, 0x908a, 0x0036, 0x1a0c, 0x0d7d, 0x2060, 0x001e, 0x8108,
+	0x2105, 0x9005, 0xa94a, 0x1904, 0x4b91, 0xa804, 0x9005, 0x090c,
+	0x0d7d, 0x7042, 0x2938, 0x2040, 0xa003, 0x0000, 0x2001, 0x0002,
+	0x9080, 0x1e31, 0x2005, 0xa04a, 0x0804, 0x4b91, 0x703c, 0x2060,
+	0x2c14, 0x6304, 0x6408, 0x650c, 0x2200, 0x7836, 0x7833, 0x0012,
+	0x7882, 0x2300, 0x7886, 0x2400, 0x788a, 0x2091, 0x4080, 0x2001,
+	0x0089, 0x2004, 0xd084, 0x190c, 0x11cd, 0x87ff, 0x0118, 0x2748,
+	0x080c, 0x106d, 0x7048, 0x8001, 0x704a, 0x9005, 0x1170, 0x7040,
+	0x2048, 0x9005, 0x0128, 0x080c, 0x106d, 0x9006, 0x7042, 0x7046,
+	0x703b, 0x18ba, 0x703f, 0x18ba, 0x0420, 0x7040, 0x9005, 0x1508,
+	0x7238, 0x2c00, 0x9206, 0x0148, 0x9c80, 0x0004, 0x90fa, 0x18fa,
+	0x0210, 0x2001, 0x18ba, 0x703e, 0x00a0, 0x9006, 0x703e, 0x703a,
+	0x7044, 0x9005, 0x090c, 0x0d7d, 0x2048, 0xa800, 0x9005, 0x1de0,
+	0x2900, 0x7042, 0x2001, 0x0002, 0x9080, 0x1e31, 0x2005, 0xa84a,
+	0x0000, 0x007e, 0x008e, 0x009e, 0x00ce, 0x00fe, 0x012e, 0x00ee,
+	0x0005, 0x2c00, 0x9082, 0x001b, 0x0002, 0x4bb0, 0x4bb0, 0x4bb2,
+	0x4bb0, 0x4bb0, 0x4bb0, 0x4bb7, 0x4bb0, 0x4bb0, 0x4bb0, 0x4bbc,
+	0x4bb0, 0x4bb0, 0x4bb0, 0x4bc1, 0x4bb0, 0x4bb0, 0x4bb0, 0x4bc6,
+	0x4bb0, 0x4bb0, 0x4bb0, 0x4bcb, 0x4bb0, 0x4bb0, 0x4bb0, 0x4bd0,
+	0x080c, 0x0d7d, 0xaa74, 0xab78, 0xac7c, 0x0804, 0x4b3c, 0xaa84,
+	0xab88, 0xac8c, 0x0804, 0x4b3c, 0xaa94, 0xab98, 0xac9c, 0x0804,
+	0x4b3c, 0xaaa4, 0xaba8, 0xacac, 0x0804, 0x4b3c, 0xaab4, 0xabb8,
+	0xacbc, 0x0804, 0x4b3c, 0xaac4, 0xabc8, 0xaccc, 0x0804, 0x4b3c,
+	0xaad4, 0xabd8, 0xacdc, 0x0804, 0x4b3c, 0x0016, 0x0026, 0x0036,
+	0x00b6, 0x00c6, 0x2009, 0x007e, 0x080c, 0x652d, 0x2019, 0x0001,
+	0xb85c, 0xd0ac, 0x0110, 0x2019, 0x0000, 0x2011, 0x801b, 0x080c,
+	0x4a38, 0x00ce, 0x00be, 0x003e, 0x002e, 0x001e, 0x0005, 0x0026,
+	0x080c, 0x55fc, 0xd0c4, 0x0120, 0x2011, 0x8014, 0x080c, 0x4a38,
+	0x002e, 0x0005, 0x81ff, 0x1904, 0x3565, 0x0126, 0x2091, 0x8000,
+	0x6030, 0xc08d, 0xc085, 0xc0ac, 0x6032, 0x080c, 0x73e4, 0x1158,
+	0x080c, 0x76e8, 0x080c, 0x5f41, 0x9085, 0x0001, 0x080c, 0x742b,
+	0x080c, 0x7315, 0x0010, 0x080c, 0x5dfc, 0x012e, 0x0804, 0x3533,
+	0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x3565, 0x080c, 0x5610,
+	0x0120, 0x2009, 0x0007, 0x0804, 0x3565, 0x080c, 0x6962, 0x0120,
+	0x2009, 0x0008, 0x0804, 0x3565, 0x080c, 0x3323, 0x0128, 0x7984,
+	0x080c, 0x64cc, 0x1904, 0x3568, 0x080c, 0x4a0b, 0x0904, 0x3568,
+	0x2b00, 0x7026, 0x080c, 0x696a, 0x7888, 0x1170, 0x9084, 0x0005,
+	0x1158, 0x900e, 0x080c, 0x681c, 0x1108, 0xc185, 0xb800, 0xd0bc,
+	0x0108, 0xc18d, 0x0804, 0x3533, 0x080c, 0x49d8, 0x0904, 0x3565,
+	0x9006, 0xa866, 0xa832, 0xa868, 0xc0fd, 0xa86a, 0x080c, 0xc94e,
+	0x0904, 0x3565, 0x7888, 0xd094, 0x0118, 0xb8d4, 0xc08d, 0xb8d6,
+	0x7007, 0x0003, 0x701f, 0x4cb1, 0x0005, 0x2061, 0x1800, 0x080c,
+	0x5610, 0x2009, 0x0007, 0x1578, 0x080c, 0x6962, 0x0118, 0x2009,
+	0x0008, 0x0448, 0x080c, 0x3323, 0x0120, 0xa998, 0x080c, 0x64cc,
+	0x1530, 0x080c, 0x4a09, 0x0518, 0x080c, 0x696a, 0xa89c, 0x1168,
+	0x9084, 0x0005, 0x1150, 0x900e, 0x080c, 0x681c, 0x1108, 0xc185,
+	0xb800, 0xd0bc, 0x0108, 0xc18d, 0x00d0, 0xa868, 0xc0fc, 0xa86a,
+	0x080c, 0xc94e, 0x11e0, 0xa89c, 0xd094, 0x0118, 0xb8d4, 0xc08d,
+	0xb8d6, 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,
+	0x5559, 0x900e, 0x080c, 0x681c, 0x1108, 0xc185, 0xb800, 0xd0bc,
+	0x0108, 0xc18d, 0x0804, 0x3533, 0x080c, 0x5610, 0x0120, 0x2009,
+	0x0007, 0x0804, 0x3565, 0x7f84, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98,
+	0x080c, 0x49d8, 0x1120, 0x2009, 0x0002, 0x0804, 0x3565, 0x900e,
+	0x2130, 0x7126, 0x7132, 0xa860, 0x20e8, 0x7036, 0xa85c, 0x9080,
+	0x0005, 0x702a, 0x20a0, 0x080c, 0x652d, 0x1904, 0x4d53, 0x080c,
+	0x696a, 0x0138, 0x080c, 0x6972, 0x0120, 0x080c, 0x690a, 0x1904,
+	0x4d53, 0xd794, 0x1110, 0xd784, 0x01a8, 0xb8c4, 0x20e0, 0xb8c8,
+	0x9080, 0x0006, 0x2098, 0x3400, 0xd794, 0x0160, 0x20a9, 0x0008,
+	0x4003, 0x2098, 0x20a0, 0x3d00, 0x20e0, 0x20a9, 0x0002, 0x080c,
+	0x47da, 0x0048, 0x20a9, 0x0004, 0x4003, 0x2098, 0x20a0, 0x3d00,
+	0x20e0, 0x080c, 0x47da, 0x9186, 0x007e, 0x0170, 0x9186, 0x0080,
+	0x0158, 0x080c, 0x696a, 0x90c2, 0x0006, 0x1210, 0xc1fd, 0x0020,
+	0x080c, 0x681c, 0x1108, 0xc1fd, 0x4104, 0xc1fc, 0xd794, 0x0528,
+	0xb8c4, 0x20e0, 0xb8c8, 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, 0x47cd, 0x9c80, 0x0026, 0x2098,
+	0xb8c4, 0x20e0, 0x20a9, 0x0002, 0x4003, 0xd794, 0x0110, 0x96b0,
+	0x000b, 0x96b0, 0x0005, 0x8108, 0x080c, 0xaa42, 0x0118, 0x9186,
+	0x0800, 0x0040, 0xd78c, 0x0120, 0x9186, 0x0800, 0x0170, 0x0018,
+	0x9186, 0x007e, 0x0150, 0xd794, 0x0118, 0x9686, 0x0020, 0x0010,
+	0x9686, 0x0028, 0x0150, 0x0804, 0x4ce3, 0x86ff, 0x1120, 0x7124,
+	0x810b, 0x0804, 0x3533, 0x7033, 0x0001, 0x7122, 0x7024, 0x9600,
+	0x7026, 0x772e, 0x2061, 0x18b8, 0x2c44, 0xa06b, 0x0000, 0xa67a,
+	0x7034, 0xa072, 0x7028, 0xa076, 0xa28e, 0xa392, 0xa496, 0xa59a,
+	0x080c, 0x111b, 0x7007, 0x0002, 0x701f, 0x4d8f, 0x0005, 0x7030,
+	0x9005, 0x1180, 0x7120, 0x7028, 0x20a0, 0x772c, 0x9036, 0x7034,
+	0x20e8, 0x2061, 0x18b8, 0x2c44, 0xa28c, 0xa390, 0xa494, 0xa598,
+	0x0804, 0x4ce3, 0x7124, 0x810b, 0x0804, 0x3533, 0x2029, 0x007e,
+	0x7984, 0x7a88, 0x7b8c, 0x7c98, 0x9184, 0xff00, 0x8007, 0x90e2,
+	0x0020, 0x0a04, 0x3568, 0x9502, 0x0a04, 0x3568, 0x9184, 0x00ff,
+	0x90e2, 0x0020, 0x0a04, 0x3568, 0x9502, 0x0a04, 0x3568, 0x9284,
+	0xff00, 0x8007, 0x90e2, 0x0020, 0x0a04, 0x3568, 0x9502, 0x0a04,
+	0x3568, 0x9284, 0x00ff, 0x90e2, 0x0020, 0x0a04, 0x3568, 0x9502,
+	0x0a04, 0x3568, 0x9384, 0xff00, 0x8007, 0x90e2, 0x0020, 0x0a04,
+	0x3568, 0x9502, 0x0a04, 0x3568, 0x9384, 0x00ff, 0x90e2, 0x0020,
+	0x0a04, 0x3568, 0x9502, 0x0a04, 0x3568, 0x9484, 0xff00, 0x8007,
+	0x90e2, 0x0020, 0x0a04, 0x3568, 0x9502, 0x0a04, 0x3568, 0x9484,
+	0x00ff, 0x90e2, 0x0020, 0x0a04, 0x3568, 0x9502, 0x0a04, 0x3568,
+	0x2061, 0x1987, 0x6102, 0x6206, 0x630a, 0x640e, 0x0804, 0x3533,
+	0x080c, 0x49d8, 0x0904, 0x3565, 0x2009, 0x0016, 0x7a8c, 0x7b88,
+	0x7c9c, 0x7d98, 0xa85c, 0x9080, 0x0019, 0xaf60, 0x080c, 0x4a21,
+	0x701f, 0x4e13, 0x0005, 0x2001, 0x0138, 0x2003, 0x0000, 0x00e6,
+	0x2071, 0x0300, 0x701c, 0xd0a4, 0x1de8, 0x00ee, 0x20a9, 0x0016,
+	0x896e, 0x8d6e, 0x8d6f, 0x9d84, 0xffc0, 0x9080, 0x0019, 0x2098,
+	0x9d84, 0x003f, 0x20e0, 0x2069, 0x1877, 0x20e9, 0x0001, 0x2da0,
+	0x4003, 0x6800, 0x9005, 0x0904, 0x4e94, 0x6804, 0x2008, 0x918c,
+	0xfff8, 0x1904, 0x4e94, 0x680c, 0x9005, 0x0904, 0x4e94, 0x9082,
+	0xff01, 0x1a04, 0x4e94, 0x6810, 0x9082, 0x005c, 0x0a04, 0x4e94,
+	0x6824, 0x2008, 0x9082, 0x0008, 0x0a04, 0x4e94, 0x9182, 0x0400,
+	0x1a04, 0x4e94, 0x0056, 0x2029, 0x0000, 0x080c, 0x8bd4, 0x005e,
+	0x6944, 0x6820, 0x9102, 0x06c0, 0x6820, 0x9082, 0x0019, 0x16a0,
+	0x6828, 0x6944, 0x810c, 0x9102, 0x0678, 0x6840, 0x9082, 0x000f,
+	0x1658, 0x080c, 0x1054, 0x2900, 0x0904, 0x4eae, 0x684e, 0x00e6,
+	0x2071, 0x1930, 0x00b6, 0x2059, 0x0000, 0x080c, 0x8a90, 0x00be,
+	0x00ee, 0x0558, 0x080c, 0x87ea, 0x080c, 0x8830, 0x11e0, 0x6857,
+	0x0000, 0x00c6, 0x2061, 0x0100, 0x6104, 0x918d, 0x2000, 0x6106,
+	0x6b10, 0x2061, 0x1a69, 0x630a, 0x00ce, 0x080c, 0x26e7, 0x2001,
+	0x0138, 0x2102, 0x0804, 0x3533, 0x080c, 0x26e7, 0x2001, 0x0138,
+	0x2102, 0x0804, 0x3568, 0x00e6, 0x2071, 0x1930, 0x080c, 0x8c65,
+	0x080c, 0x8c74, 0x080c, 0x8a7f, 0x00ee, 0x2001, 0x188a, 0x204c,
+	0x080c, 0x106d, 0x2001, 0x188a, 0x2003, 0x0000, 0x080c, 0x26e7,
+	0x2001, 0x0138, 0x2102, 0x0804, 0x3565, 0x2001, 0x1924, 0x200c,
+	0x918e, 0x0000, 0x0904, 0x4f0d, 0x080c, 0x8a7a, 0x0904, 0x4f0d,
+	0x2001, 0x0101, 0x200c, 0x918c, 0xdfff, 0x2102, 0x2001, 0x0138,
+	0x2003, 0x0000, 0x00e6, 0x2071, 0x0300, 0x701c, 0xd0a4, 0x1de8,
+	0x00ee, 0x080c, 0x8a7f, 0x2001, 0x0035, 0x080c, 0x1670, 0x00c6,
+	0x2061, 0x193c, 0x6004, 0x6100, 0x9106, 0x1de0, 0x00ce, 0x080c,
+	0x26e7, 0x2001, 0x0138, 0x2102, 0x00e6, 0x00f6, 0x2071, 0x1923,
+	0x080c, 0x89bb, 0x0120, 0x2f00, 0x080c, 0x8a45, 0x0cc8, 0x00fe,
+	0x00ee, 0x0126, 0x2091, 0x8000, 0x2001, 0x188a, 0x200c, 0x81ff,
+	0x0138, 0x2148, 0x080c, 0x106d, 0x2001, 0x188a, 0x2003, 0x0000,
+	0x2001, 0x183d, 0x2003, 0x0020, 0x00e6, 0x2071, 0x1930, 0x080c,
+	0x8c65, 0x080c, 0x8c74, 0x00ee, 0x012e, 0x0804, 0x3533, 0x0006,
+	0x080c, 0x55fc, 0xd0cc, 0x000e, 0x0005, 0x0006, 0x080c, 0x5600,
+	0xd0bc, 0x000e, 0x0005, 0x6174, 0x7a84, 0x6300, 0x82ff, 0x1118,
+	0x7986, 0x0804, 0x3533, 0x83ff, 0x1904, 0x3568, 0x2001, 0xfff0,
+	0x9200, 0x1a04, 0x3568, 0x2019, 0xffff, 0x6078, 0x9302, 0x9200,
+	0x0a04, 0x3568, 0x7986, 0x6276, 0x0804, 0x3533, 0x080c, 0x5610,
+	0x1904, 0x3565, 0x7c88, 0x7d84, 0x7e98, 0x7f8c, 0x080c, 0x49d8,
+	0x0904, 0x3565, 0x900e, 0x901e, 0x7326, 0x7332, 0xa860, 0x20e8,
+	0x7036, 0xa85c, 0x9080, 0x0003, 0x702a, 0x20a0, 0x91d8, 0x1000,
+	0x2b5c, 0x8bff, 0x0178, 0x080c, 0x696a, 0x0118, 0x080c, 0x6972,
+	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, 0x9030, 0x2208, 0x0804, 0x3533, 0x7033, 0x0001, 0x7122,
+	0x7024, 0x9300, 0x7026, 0x2061, 0x18b8, 0x2c44, 0xa06b, 0x0000,
+	0xa37a, 0x7028, 0xa076, 0x7034, 0xa072, 0xa48e, 0xa592, 0xa696,
+	0xa79a, 0x080c, 0x111b, 0x7007, 0x0002, 0x701f, 0x4f90, 0x0005,
+	0x7030, 0x9005, 0x1178, 0x7120, 0x7028, 0x20a0, 0x901e, 0x7034,
+	0x20e8, 0x2061, 0x18b8, 0x2c44, 0xa48c, 0xa590, 0xa694, 0xa798,
+	0x0804, 0x4f4e, 0x7224, 0x900e, 0x2001, 0x0003, 0x080c, 0x9030,
+	0x2208, 0x0804, 0x3533, 0x00f6, 0x00e6, 0x080c, 0x5610, 0x2009,
+	0x0007, 0x1904, 0x5023, 0x2071, 0x189e, 0x745c, 0x84ff, 0x2009,
+	0x000e, 0x1904, 0x5023, 0xac9c, 0xad98, 0xaea4, 0xafa0, 0x0096,
+	0x080c, 0x1054, 0x2009, 0x0002, 0x0904, 0x5023, 0x2900, 0x705e,
+	0x900e, 0x901e, 0x7356, 0x7362, 0xa860, 0x7066, 0xa85c, 0x9080,
+	0x0003, 0x705a, 0x20a0, 0x91d8, 0x1000, 0x2b5c, 0x8bff, 0x0178,
+	0x080c, 0x696a, 0x0118, 0x080c, 0x6972, 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, 0x9030, 0x2208,
+	0x009e, 0xa897, 0x4000, 0xa99a, 0x715c, 0x81ff, 0x090c, 0x0d7d,
+	0x2148, 0x080c, 0x106d, 0x9006, 0x705e, 0x918d, 0x0001, 0x2008,
+	0x0418, 0x7063, 0x0001, 0x7152, 0x7054, 0x9300, 0x7056, 0x2061,
+	0x18b9, 0x2c44, 0xa37a, 0x7058, 0xa076, 0x7064, 0xa072, 0xa48e,
+	0xa592, 0xa696, 0xa79a, 0xa09f, 0x502f, 0x000e, 0xa0a2, 0x080c,
+	0x111b, 0x9006, 0x0048, 0x009e, 0xa897, 0x4005, 0xa99a, 0x900e,
+	0x9085, 0x0001, 0x2001, 0x0030, 0x00ee, 0x00fe, 0x0005, 0x00f6,
+	0xa0a0, 0x904d, 0x090c, 0x0d7d, 0x00e6, 0x2071, 0x189e, 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, 0x9030, 0xaa9a, 0x715c, 0x81ff, 0x090c,
+	0x0d7d, 0x2148, 0x080c, 0x106d, 0x705f, 0x0000, 0xa0a0, 0x2048,
+	0x0126, 0x2091, 0x8000, 0x080c, 0x6c7f, 0x012e, 0xa09f, 0x0000,
+	0xa0a3, 0x0000, 0x00ee, 0x00fe, 0x0005, 0x91d8, 0x1000, 0x2b5c,
+	0x8bff, 0x0178, 0x080c, 0x696a, 0x0118, 0x080c, 0x6972, 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, 0x0d7d, 0x2148, 0x080c, 0x106d, 0x9006,
+	0x705e, 0x918d, 0x0001, 0x2008, 0xa0a0, 0x2048, 0x0126, 0x2091,
+	0x8000, 0x080c, 0x6c7f, 0x012e, 0xa09f, 0x0000, 0xa0a3, 0x0000,
+	0x0070, 0x7063, 0x0001, 0x7152, 0x7054, 0x9300, 0x7056, 0xa37a,
+	0xa48e, 0xa592, 0xa696, 0xa79a, 0x080c, 0x111b, 0x9006, 0x00ee,
+	0x0005, 0x0096, 0xa88c, 0x90be, 0x7000, 0x0148, 0x90be, 0x7100,
+	0x0130, 0x90be, 0x7200, 0x0118, 0x009e, 0x0804, 0x3568, 0xa884,
+	0xa988, 0x080c, 0x25cf, 0x1518, 0x080c, 0x64cc, 0x1500, 0x7126,
+	0xbe12, 0xbd16, 0xae7c, 0x080c, 0x49d8, 0x01c8, 0x080c, 0x49d8,
+	0x01b0, 0x009e, 0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a, 0xa823,
+	0x0000, 0xa804, 0x2048, 0x080c, 0xc8cc, 0x1120, 0x2009, 0x0003,
+	0x0804, 0x3565, 0x7007, 0x0003, 0x701f, 0x50fc, 0x0005, 0x009e,
+	0x2009, 0x0002, 0x0804, 0x3565, 0x7124, 0x080c, 0x32bc, 0xa820,
+	0x9086, 0x8001, 0x1120, 0x2009, 0x0004, 0x0804, 0x3565, 0x2900,
+	0x7022, 0xa804, 0x0096, 0x2048, 0x8906, 0x8006, 0x8007, 0x90bc,
+	0x003f, 0x9084, 0xffc0, 0x009e, 0x9080, 0x0002, 0x0076, 0x0006,
+	0x2098, 0x20a0, 0x27e0, 0x27e8, 0x20a9, 0x002a, 0x080c, 0x0fb8,
+	0xaa6c, 0xab70, 0xac74, 0xad78, 0x2061, 0x18b8, 0x2c44, 0xa06b,
+	0x0000, 0xae64, 0xaf8c, 0x97c6, 0x7000, 0x0118, 0x97c6, 0x7100,
+	0x1148, 0x96c2, 0x0004, 0x0600, 0x2009, 0x0004, 0x000e, 0x007e,
+	0x0804, 0x4a24, 0x97c6, 0x7200, 0x11b8, 0x96c2, 0x0054, 0x02a0,
+	0x000e, 0x007e, 0x2061, 0x18b8, 0x2c44, 0xa076, 0xa772, 0xa07b,
+	0x002a, 0xa28e, 0xa392, 0xa496, 0xa59a, 0x080c, 0x111b, 0x7007,
+	0x0002, 0x701f, 0x5158, 0x0005, 0x000e, 0x007e, 0x0804, 0x3568,
+	0x7020, 0x2048, 0xa804, 0x2048, 0xa804, 0x2048, 0x8906, 0x8006,
+	0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x0002, 0x2098,
+	0x20a0, 0x27e0, 0x27e8, 0x20a9, 0x002a, 0x080c, 0x0fb8, 0x2100,
+	0x2238, 0x2061, 0x18b8, 0x2c44, 0xa28c, 0xa390, 0xa494, 0xa598,
+	0x2009, 0x002a, 0x0804, 0x4a24, 0x81ff, 0x1904, 0x3565, 0x798c,
+	0x2001, 0x197e, 0x2102, 0x080c, 0x49ef, 0x0904, 0x3568, 0x080c,
+	0x696a, 0x0120, 0x080c, 0x6972, 0x1904, 0x3568, 0x080c, 0x65f4,
+	0x0904, 0x3565, 0x0126, 0x2091, 0x8000, 0x080c, 0x6789, 0x012e,
+	0x0904, 0x3565, 0x0804, 0x4508, 0xa9a0, 0x2001, 0x197e, 0xc18d,
+	0x2102, 0x080c, 0x49fc, 0x01a0, 0x080c, 0x696a, 0x0118, 0x080c,
+	0x6972, 0x1170, 0x080c, 0x65f4, 0x2009, 0x0002, 0x0128, 0x080c,
+	0x6789, 0x1170, 0x2009, 0x0003, 0xa897, 0x4005, 0xa99a, 0x0010,
+	0xa897, 0x4006, 0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x0005,
+	0xa897, 0x4000, 0x080c, 0x5604, 0x0110, 0x9006, 0x0018, 0x900e,
+	0x9085, 0x0001, 0x2001, 0x0000, 0x0005, 0x78a8, 0xd08c, 0x1118,
+	0xd084, 0x0904, 0x447d, 0x080c, 0x4a0b, 0x0904, 0x3568, 0x080c,
+	0x49d8, 0x1120, 0x2009, 0x0002, 0x0804, 0x3565, 0x080c, 0x696a,
+	0x0130, 0x908e, 0x0004, 0x0118, 0x908e, 0x0005, 0x15a0, 0x78a8,
+	0xd08c, 0x0120, 0xb800, 0xc08c, 0xb802, 0x0028, 0x080c, 0x55fc,
+	0xd0b4, 0x0904, 0x44b7, 0x7884, 0x908e, 0x007e, 0x0904, 0x44b7,
+	0x908e, 0x007f, 0x0904, 0x44b7, 0x908e, 0x0080, 0x0904, 0x44b7,
+	0xb800, 0xd08c, 0x1904, 0x44b7, 0xa867, 0x0000, 0xa868, 0xc0fd,
+	0xa86a, 0x080c, 0xc8eb, 0x1120, 0x2009, 0x0003, 0x0804, 0x3565,
+	0x7007, 0x0003, 0x701f, 0x5215, 0x0005, 0x080c, 0x4a0b, 0x0904,
+	0x3568, 0x0804, 0x44b7, 0x080c, 0x3323, 0x0108, 0x0005, 0x2009,
+	0x1834, 0x210c, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x3565,
+	0x080c, 0x5610, 0x0120, 0x2009, 0x0007, 0x0804, 0x3565, 0x080c,
+	0x6962, 0x0120, 0x2009, 0x0008, 0x0804, 0x3565, 0xb89c, 0xd0a4,
+	0x1118, 0xd0ac, 0x1904, 0x44b7, 0x9006, 0xa866, 0xa832, 0xa868,
+	0xc0fd, 0xa86a, 0x080c, 0xc94e, 0x1120, 0x2009, 0x0003, 0x0804,
+	0x3565, 0x7007, 0x0003, 0x701f, 0x524e, 0x0005, 0xa830, 0x9086,
+	0x0100, 0x1120, 0x2009, 0x0004, 0x0804, 0x5559, 0x080c, 0x4a0b,
+	0x0904, 0x3568, 0x0804, 0x51e7, 0x81ff, 0x2009, 0x0001, 0x1904,
+	0x3565, 0x080c, 0x5610, 0x2009, 0x0007, 0x1904, 0x3565, 0x080c,
+	0x6962, 0x0120, 0x2009, 0x0008, 0x0804, 0x3565, 0x080c, 0x4a0b,
+	0x0904, 0x3568, 0x080c, 0x696a, 0x2009, 0x0009, 0x1904, 0x3565,
+	0x080c, 0x49d8, 0x2009, 0x0002, 0x0904, 0x3565, 0x9006, 0xa866,
+	0xa832, 0xa868, 0xc0fd, 0xa86a, 0x7988, 0x9194, 0xff00, 0x918c,
+	0x00ff, 0x9006, 0x82ff, 0x1128, 0xc0ed, 0xa952, 0x798c, 0xa956,
+	0x0038, 0x928e, 0x0100, 0x1904, 0x3568, 0xc0e5, 0xa952, 0xa956,
+	0xa83e, 0x080c, 0xcbb1, 0x2009, 0x0003, 0x0904, 0x3565, 0x7007,
+	0x0003, 0x701f, 0x52a4, 0x0005, 0xa830, 0x9086, 0x0100, 0x2009,
+	0x0004, 0x0904, 0x3565, 0x0804, 0x3533, 0x7aa8, 0x9284, 0xc000,
+	0x0148, 0xd2ec, 0x01a0, 0x080c, 0x5610, 0x1188, 0x2009, 0x0014,
+	0x0804, 0x3565, 0xd2dc, 0x1568, 0x81ff, 0x2009, 0x0001, 0x1904,
+	0x3565, 0x080c, 0x5610, 0x2009, 0x0007, 0x1904, 0x3565, 0xd2f4,
+	0x0130, 0x9284, 0x5000, 0x080c, 0x55d7, 0x0804, 0x3533, 0xd2fc,
+	0x0158, 0x080c, 0x4a0b, 0x0904, 0x3568, 0x7984, 0x9284, 0x9000,
+	0x080c, 0x55b4, 0x0804, 0x3533, 0x080c, 0x4a0b, 0x0904, 0x3568,
+	0xb804, 0x9084, 0x00ff, 0x9086, 0x0006, 0x2009, 0x0009, 0x1904,
+	0x538d, 0x080c, 0x49d8, 0x2009, 0x0002, 0x0904, 0x538d, 0xa85c,
+	0x9080, 0x001b, 0xaf60, 0x2009, 0x0008, 0x7a8c, 0x7b88, 0x7c9c,
+	0x7d98, 0x080c, 0x4a21, 0x701f, 0x52fe, 0x0005, 0xa86c, 0x9086,
+	0x0500, 0x1138, 0xa870, 0x9005, 0x1120, 0xa874, 0x9084, 0xff00,
+	0x0110, 0x1904, 0x3568, 0xa866, 0xa832, 0xa868, 0xc0fd, 0xa86a,
+	0x080c, 0x4a0b, 0x1110, 0x0804, 0x3568, 0x2009, 0x0043, 0x080c,
+	0xcc19, 0x2009, 0x0003, 0x0904, 0x538d, 0x7007, 0x0003, 0x701f,
+	0x5322, 0x0005, 0xa830, 0x9086, 0x0100, 0x2009, 0x0004, 0x0904,
+	0x538d, 0x7984, 0x7aa8, 0x9284, 0x1000, 0x080c, 0x55b4, 0x0804,
+	0x3533, 0x00c6, 0xaab0, 0x9284, 0xc000, 0x0140, 0xd2ec, 0x0168,
+	0x080c, 0x5610, 0x1150, 0x2009, 0x0014, 0x04f0, 0x2061, 0x1800,
+	0x080c, 0x5610, 0x2009, 0x0007, 0x15b8, 0xd2f4, 0x0128, 0x9284,
+	0x5000, 0x080c, 0x55d7, 0x0050, 0xd2fc, 0x0178, 0x080c, 0x4a09,
+	0x0588, 0xa998, 0x9284, 0x9000, 0x080c, 0x55b4, 0xa87b, 0x0000,
+	0xa883, 0x0000, 0xa897, 0x4000, 0x0438, 0x080c, 0x4a09, 0x0510,
+	0x080c, 0x696a, 0x2009, 0x0009, 0x11b8, 0xa8c4, 0x9086, 0x0500,
+	0x11c8, 0xa8c8, 0x9005, 0x11b0, 0xa8cc, 0x9084, 0xff00, 0x1190,
+	0x080c, 0x4a09, 0x1108, 0x0070, 0x2009, 0x004b, 0x080c, 0xcc19,
+	0x2009, 0x0003, 0x0108, 0x0078, 0x0429, 0x19c0, 0xa897, 0x4005,
+	0xa99a, 0x0010, 0xa897, 0x4006, 0x900e, 0x9085, 0x0001, 0x2001,
+	0x0030, 0x00ce, 0x0005, 0x9006, 0x0ce0, 0x7aa8, 0xd2dc, 0x0904,
+	0x3565, 0x0016, 0x7984, 0x9284, 0x1000, 0xc0fd, 0x080c, 0x55b4,
+	0x001e, 0x1904, 0x3565, 0x0804, 0x3533, 0x00f6, 0x2d78, 0x0011,
+	0x00fe, 0x0005, 0xaab0, 0xd2dc, 0x0150, 0x0016, 0xa998, 0x9284,
+	0x1000, 0xc0fd, 0x080c, 0x55b4, 0x001e, 0x9085, 0x0001, 0x0005,
+	0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x3565, 0x080c, 0x5610,
+	0x0120, 0x2009, 0x0007, 0x0804, 0x3565, 0x7984, 0x7ea8, 0x96b4,
+	0x00ff, 0x080c, 0x652d, 0x1904, 0x3568, 0x9186, 0x007f, 0x0138,
+	0x080c, 0x696a, 0x0120, 0x2009, 0x0009, 0x0804, 0x3565, 0x080c,
+	0x49d8, 0x1120, 0x2009, 0x0002, 0x0804, 0x3565, 0xa867, 0x0000,
+	0xa868, 0xc0fd, 0xa86a, 0x2001, 0x0100, 0x8007, 0xa80a, 0x080c,
+	0xc905, 0x1120, 0x2009, 0x0003, 0x0804, 0x3565, 0x7007, 0x0003,
+	0x701f, 0x53eb, 0x0005, 0xa808, 0x8007, 0x9086, 0x0100, 0x1120,
+	0x2009, 0x0004, 0x0804, 0x3565, 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, 0x4a24, 0x080c, 0x49d8, 0x1120, 0x2009, 0x0002, 0x0804,
+	0x3565, 0x7984, 0x9194, 0xff00, 0x918c, 0x00ff, 0x8217, 0x82ff,
+	0x1118, 0x7023, 0x19b1, 0x0040, 0x92c6, 0x0001, 0x1118, 0x7023,
+	0x19cb, 0x0010, 0x0804, 0x3568, 0x2009, 0x001a, 0x7a8c, 0x7b88,
+	0x7c9c, 0x7d98, 0xa85c, 0x9080, 0x0019, 0xaf60, 0x080c, 0x4a21,
+	0x701f, 0x543b, 0x0005, 0x2001, 0x182e, 0x2003, 0x0001, 0xa85c,
+	0x9080, 0x0019, 0x2098, 0xa860, 0x20e0, 0x20a9, 0x001a, 0x7020,
+	0x20a0, 0x20e9, 0x0001, 0x4003, 0x0804, 0x3533, 0x080c, 0x49d8,
+	0x1120, 0x2009, 0x0002, 0x0804, 0x3565, 0x7984, 0x9194, 0xff00,
+	0x918c, 0x00ff, 0x8217, 0x82ff, 0x1118, 0x2099, 0x19b1, 0x0040,
+	0x92c6, 0x0001, 0x1118, 0x2099, 0x19cb, 0x0010, 0x0804, 0x3568,
+	0xa85c, 0x9080, 0x0019, 0x20a0, 0xa860, 0x20e8, 0x20a9, 0x001a,
+	0x20e1, 0x0001, 0x4003, 0x2009, 0x001a, 0x7a8c, 0x7b88, 0x7c9c,
+	0x7d98, 0xa85c, 0x9080, 0x0019, 0xaf60, 0x0804, 0x4a24, 0x7884,
+	0x908a, 0x1000, 0x1a04, 0x3568, 0x0126, 0x2091, 0x8000, 0x8003,
+	0x800b, 0x810b, 0x9108, 0x00c6, 0x2061, 0x1a01, 0x6142, 0x00ce,
+	0x012e, 0x0804, 0x3533, 0x00c6, 0x080c, 0x73e4, 0x1160, 0x080c,
+	0x76e8, 0x080c, 0x5f41, 0x9085, 0x0001, 0x080c, 0x742b, 0x080c,
+	0x7315, 0x080c, 0x0d7d, 0x2061, 0x1800, 0x6030, 0xc09d, 0x6032,
+	0x080c, 0x5dfc, 0x00ce, 0x0005, 0x00c6, 0x2001, 0x1800, 0x2004,
+	0x908e, 0x0000, 0x0904, 0x3565, 0x7884, 0x9005, 0x0188, 0x7888,
+	0x2061, 0x199a, 0x2c0c, 0x2062, 0x080c, 0x299f, 0x01a0, 0x080c,
+	0x29a7, 0x0188, 0x080c, 0x29af, 0x0170, 0x2162, 0x0804, 0x3568,
+	0x2061, 0x0100, 0x6038, 0x9086, 0x0007, 0x1118, 0x2009, 0x0001,
+	0x0010, 0x2009, 0x0000, 0x7884, 0x9086, 0x0002, 0x1588, 0x2061,
+	0x0100, 0x6028, 0xc09c, 0x602a, 0x080c, 0xa781, 0x0026, 0x2011,
+	0x0003, 0x080c, 0xa0a6, 0x2011, 0x0002, 0x080c, 0xa0b0, 0x002e,
+	0x080c, 0x9f6f, 0x0036, 0x901e, 0x080c, 0x9fef, 0x003e, 0x080c,
+	0xa79d, 0x60e3, 0x0000, 0x080c, 0xe59b, 0x080c, 0xe5b6, 0x9085,
+	0x0001, 0x080c, 0x742b, 0x9006, 0x080c, 0x29d1, 0x2001, 0x1800,
+	0x2003, 0x0004, 0x0026, 0x2011, 0x0008, 0x080c, 0x2a0b, 0x002e,
+	0x00ce, 0x0804, 0x3533, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804,
+	0x3565, 0x080c, 0x5610, 0x0120, 0x2009, 0x0007, 0x0804, 0x3565,
+	0x7984, 0x7ea8, 0x96b4, 0x00ff, 0x080c, 0x652d, 0x1904, 0x3568,
+	0x9186, 0x007f, 0x0138, 0x080c, 0x696a, 0x0120, 0x2009, 0x0009,
+	0x0804, 0x3565, 0x080c, 0x49d8, 0x1120, 0x2009, 0x0002, 0x0804,
+	0x3565, 0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a, 0x080c, 0xc908,
+	0x1120, 0x2009, 0x0003, 0x0804, 0x3565, 0x7007, 0x0003, 0x701f,
+	0x5542, 0x0005, 0xa830, 0x9086, 0x0100, 0x1120, 0x2009, 0x0004,
+	0x0804, 0x3565, 0xa8e0, 0xa866, 0xa834, 0x8007, 0x800c, 0xa85c,
+	0x9080, 0x000c, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0xaf60, 0x0804,
+	0x4a24, 0xa898, 0x9086, 0x000d, 0x1904, 0x3565, 0x2021, 0x4005,
+	0x0126, 0x2091, 0x8000, 0x0e04, 0x5566, 0x0010, 0x012e, 0x0cc0,
+	0x7c36, 0x9486, 0x4000, 0x0118, 0x7833, 0x0011, 0x0010, 0x7833,
+	0x0010, 0x7883, 0x4005, 0xa998, 0x7986, 0xa9a4, 0x799a, 0xa9a8,
+	0x799e, 0x080c, 0x4a14, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004,
+	0xd084, 0x190c, 0x11cd, 0x7007, 0x0001, 0x2091, 0x5000, 0x700f,
+	0x0000, 0x012e, 0x0005, 0x0126, 0x2091, 0x8000, 0x00c6, 0x2061,
+	0x1a01, 0x7984, 0x6152, 0x614e, 0x6057, 0x0000, 0x604b, 0x0009,
+	0x7898, 0x606a, 0x789c, 0x6066, 0x7888, 0x6062, 0x788c, 0x605e,
+	0x2001, 0x1a0f, 0x2044, 0x2001, 0x1a16, 0xa076, 0xa060, 0xa072,
+	0xa07b, 0x0001, 0xa07f, 0x0002, 0xa06b, 0x0000, 0xa09f, 0x0000,
+	0x00ce, 0x012e, 0x0804, 0x3533, 0x0126, 0x2091, 0x8000, 0x00b6,
+	0x00c6, 0x90e4, 0xc000, 0x0128, 0x0006, 0x080c, 0xc770, 0x000e,
+	0x1198, 0xd0e4, 0x0160, 0x9180, 0x1000, 0x2004, 0x905d, 0x0160,
+	0x080c, 0x5f5b, 0x080c, 0xaa42, 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,
+	0x55df, 0x015e, 0x012e, 0x0005, 0x2001, 0x1848, 0x2004, 0x0005,
+	0x2001, 0x1867, 0x2004, 0x0005, 0x0006, 0x2001, 0x1810, 0x2004,
+	0xd0d4, 0x000e, 0x0005, 0x2001, 0x180e, 0x2004, 0xd0b4, 0x0005,
+	0x2001, 0x1800, 0x2004, 0x9086, 0x0003, 0x0005, 0x0016, 0x00e6,
+	0x2071, 0x189e, 0x7108, 0x910d, 0x710a, 0x00ee, 0x001e, 0x0005,
+	0x080c, 0x49d8, 0x080c, 0x0f42, 0x2100, 0x2238, 0x7d84, 0x7c88,
+	0x7b8c, 0x7a90, 0x79a4, 0x9182, 0x0081, 0x1a04, 0x3568, 0x810c,
+	0x080c, 0x4a21, 0x701f, 0x5635, 0x0005, 0x2079, 0x0000, 0x7d94,
+	0x7c98, 0x7ba8, 0x7aac, 0x79a4, 0x810c, 0x2061, 0x18b8, 0x2c44,
+	0xa770, 0xa074, 0x2071, 0x189e, 0x080c, 0x4a24, 0x701f, 0x5649,
+	0x0005, 0x2061, 0x18b8, 0x2c44, 0xa074, 0x2048, 0x9006, 0xa802,
+	0xa806, 0x0804, 0x3533, 0x0126, 0x0156, 0x0136, 0x0146, 0x01c6,
+	0x01d6, 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x2061, 0x0100, 0x2069,
+	0x0200, 0x2071, 0x1800, 0x6044, 0xd0a4, 0x11e8, 0xd084, 0x0118,
+	0x080c, 0x57fc, 0x0068, 0xd08c, 0x0118, 0x080c, 0x5705, 0x0040,
+	0xd094, 0x0118, 0x080c, 0x56d5, 0x0018, 0xd09c, 0x0108, 0x0099,
+	0x00fe, 0x00ee, 0x00de, 0x00ce, 0x01de, 0x01ce, 0x014e, 0x013e,
+	0x015e, 0x012e, 0x0005, 0x0016, 0x6128, 0xd19c, 0x1110, 0xc19d,
+	0x612a, 0x001e, 0x0c68, 0x0006, 0x7098, 0x9005, 0x000e, 0x0120,
+	0x709b, 0x0000, 0x7093, 0x0000, 0x624c, 0x9286, 0xf0f0, 0x1150,
+	0x6048, 0x9086, 0xf0f0, 0x0130, 0x624a, 0x6043, 0x0090, 0x6043,
+	0x0010, 0x0490, 0x9294, 0xff00, 0x9296, 0xf700, 0x0178, 0x7138,
+	0xd1a4, 0x1160, 0x6240, 0x9295, 0x0100, 0x6242, 0x9294, 0x0010,
+	0x0128, 0x2009, 0x00f7, 0x080c, 0x5ebd, 0x00f0, 0x6040, 0x9084,
+	0x0010, 0x9085, 0x0140, 0x6042, 0x6043, 0x0000, 0x7087, 0x0000,
+	0x70a3, 0x0001, 0x70c7, 0x0000, 0x70df, 0x0000, 0x2009, 0x1d80,
+	0x200b, 0x0000, 0x7097, 0x0000, 0x708b, 0x000f, 0x2009, 0x000f,
+	0x2011, 0x5d9f, 0x080c, 0x85d2, 0x0005, 0x2001, 0x1869, 0x2004,
+	0xd08c, 0x0110, 0x705f, 0xffff, 0x7088, 0x9005, 0x1528, 0x2011,
+	0x5d9f, 0x080c, 0x850b, 0x6040, 0x9094, 0x0010, 0x9285, 0x0020,
+	0x6042, 0x20a9, 0x00c8, 0x6044, 0xd08c, 0x1168, 0x1f04, 0x56eb,
+	0x6242, 0x709b, 0x0000, 0x6040, 0x9094, 0x0010, 0x9285, 0x0080,
+	0x6042, 0x6242, 0x0048, 0x6242, 0x709b, 0x0000, 0x708f, 0x0000,
+	0x9006, 0x080c, 0x5f46, 0x0000, 0x0005, 0x708c, 0x908a, 0x0003,
+	0x1a0c, 0x0d7d, 0x000b, 0x0005, 0x570f, 0x5760, 0x57fb, 0x00f6,
+	0x0016, 0x6900, 0x918c, 0x0800, 0x708f, 0x0001, 0x2001, 0x015d,
+	0x2003, 0x0000, 0x6803, 0x00fc, 0x20a9, 0x0004, 0x6800, 0x9084,
+	0x00fc, 0x0120, 0x1f04, 0x571e, 0x080c, 0x0d7d, 0x68a0, 0x68a2,
+	0x689c, 0x689e, 0x6898, 0x689a, 0xa001, 0x918d, 0x1600, 0x6902,
+	0x001e, 0x6837, 0x0020, 0x080c, 0x5f22, 0x2079, 0x1d00, 0x7833,
+	0x1101, 0x7837, 0x0000, 0x20e1, 0x0001, 0x2099, 0x1805, 0x20e9,
+	0x0001, 0x20a1, 0x1d0e, 0x20a9, 0x0004, 0x4003, 0x080c, 0xa57b,
+	0x20e1, 0x0001, 0x2099, 0x1d00, 0x20e9, 0x0000, 0x20a1, 0x0240,
+	0x20a9, 0x0014, 0x4003, 0x60c3, 0x000c, 0x600f, 0x0000, 0x080c,
+	0x5dd0, 0x00fe, 0x9006, 0x7092, 0x6043, 0x0008, 0x6042, 0x0005,
+	0x00f6, 0x7090, 0x7093, 0x0000, 0x9025, 0x0904, 0x57d8, 0x6020,
+	0xd0b4, 0x1904, 0x57d6, 0x71a0, 0x81ff, 0x0904, 0x57c4, 0x9486,
+	0x000c, 0x1904, 0x57d1, 0x9480, 0x0018, 0x8004, 0x20a8, 0x080c,
+	0x5f1b, 0x2011, 0x0260, 0x2019, 0x1d00, 0x220c, 0x2304, 0x9106,
+	0x11e8, 0x8210, 0x8318, 0x1f04, 0x577d, 0x6043, 0x0004, 0x2061,
+	0x0140, 0x605b, 0xbc94, 0x605f, 0xf0f0, 0x2061, 0x0100, 0x6043,
+	0x0006, 0x708f, 0x0002, 0x709b, 0x0002, 0x2009, 0x07d0, 0x2011,
+	0x5da6, 0x080c, 0x85d2, 0x080c, 0x5f22, 0x04c0, 0x080c, 0x5f1b,
+	0x2079, 0x0260, 0x7930, 0x918e, 0x1101, 0x1558, 0x7834, 0x9005,
+	0x1540, 0x7900, 0x918c, 0x00ff, 0x1118, 0x7804, 0x9005, 0x0190,
+	0x080c, 0x5f1b, 0x2011, 0x026e, 0x2019, 0x1805, 0x20a9, 0x0004,
+	0x220c, 0x2304, 0x9102, 0x0230, 0x11a0, 0x8210, 0x8318, 0x1f04,
+	0x57b8, 0x0078, 0x70a3, 0x0000, 0x080c, 0x5f1b, 0x20e1, 0x0000,
+	0x2099, 0x0260, 0x20e9, 0x0001, 0x20a1, 0x1d00, 0x20a9, 0x0014,
+	0x4003, 0x6043, 0x0008, 0x6043, 0x0000, 0x0010, 0x00fe, 0x0005,
+	0x6040, 0x9085, 0x0100, 0x6042, 0x6020, 0xd0b4, 0x1db8, 0x080c,
+	0xa57b, 0x20e1, 0x0001, 0x2099, 0x1d00, 0x20e9, 0x0000, 0x20a1,
+	0x0240, 0x20a9, 0x0014, 0x4003, 0x60c3, 0x000c, 0x2011, 0x19f2,
+	0x2013, 0x0000, 0x7093, 0x0000, 0x60a3, 0x0056, 0x60a7, 0x9575,
+	0x080c, 0x9cfc, 0x08d8, 0x0005, 0x7098, 0x908a, 0x001d, 0x1a0c,
+	0x0d7d, 0x000b, 0x0005, 0x582d, 0x5840, 0x5869, 0x5889, 0x58af,
+	0x58de, 0x5904, 0x593c, 0x5962, 0x5990, 0x59cb, 0x5a03, 0x5a21,
+	0x5a4c, 0x5a6e, 0x5a89, 0x5a93, 0x5ac7, 0x5aed, 0x5b1c, 0x5b42,
+	0x5b7a, 0x5bbe, 0x5bfb, 0x5c1c, 0x5c75, 0x5c97, 0x5cc5, 0x5cc5,
+	0x00c6, 0x2061, 0x1800, 0x6003, 0x0007, 0x2061, 0x0100, 0x6004,
+	0x9084, 0xfff9, 0x6006, 0x00ce, 0x0005, 0x2061, 0x0140, 0x605b,
+	0xbc94, 0x605f, 0xf0f0, 0x2061, 0x0100, 0x6043, 0x0002, 0x709b,
+	0x0001, 0x2009, 0x07d0, 0x2011, 0x5da6, 0x080c, 0x85d2, 0x0005,
+	0x00f6, 0x7090, 0x9086, 0x0014, 0x1510, 0x6042, 0x6020, 0xd0b4,
+	0x11f0, 0x080c, 0x5f1b, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1102,
+	0x11a0, 0x7834, 0x9005, 0x1188, 0x7a38, 0xd2fc, 0x0128, 0x70c4,
+	0x9005, 0x1110, 0x70c7, 0x0001, 0x2011, 0x5da6, 0x080c, 0x850b,
+	0x709b, 0x0010, 0x080c, 0x5a93, 0x0010, 0x7093, 0x0000, 0x00fe,
+	0x0005, 0x00f6, 0x709b, 0x0003, 0x6043, 0x0004, 0x2011, 0x5da6,
+	0x080c, 0x850b, 0x080c, 0x5e9f, 0x2079, 0x0240, 0x7833, 0x1102,
+	0x7837, 0x0000, 0x20a9, 0x0008, 0x9f88, 0x000e, 0x200b, 0x0000,
+	0x8108, 0x1f04, 0x587e, 0x60c3, 0x0014, 0x080c, 0x5dd0, 0x00fe,
+	0x0005, 0x00f6, 0x7090, 0x9005, 0x0500, 0x2011, 0x5da6, 0x080c,
+	0x850b, 0x9086, 0x0014, 0x11b8, 0x080c, 0x5f1b, 0x2079, 0x0260,
+	0x7a30, 0x9296, 0x1102, 0x1178, 0x7834, 0x9005, 0x1160, 0x7a38,
+	0xd2fc, 0x0128, 0x70c4, 0x9005, 0x1110, 0x70c7, 0x0001, 0x709b,
+	0x0004, 0x0029, 0x0010, 0x080c, 0x5ef7, 0x00fe, 0x0005, 0x00f6,
+	0x709b, 0x0005, 0x080c, 0x5e9f, 0x2079, 0x0240, 0x7833, 0x1103,
+	0x7837, 0x0000, 0x080c, 0x5f1b, 0x080c, 0x5efe, 0x1170, 0x7084,
+	0x9005, 0x1158, 0x715c, 0x9186, 0xffff, 0x0138, 0x2011, 0x0008,
+	0x080c, 0x5d53, 0x0168, 0x080c, 0x5ed4, 0x20a9, 0x0008, 0x20e1,
+	0x0000, 0x2099, 0x026e, 0x20e9, 0x0000, 0x20a1, 0x024e, 0x4003,
+	0x60c3, 0x0014, 0x080c, 0x5dd0, 0x00fe, 0x0005, 0x00f6, 0x7090,
+	0x9005, 0x0500, 0x2011, 0x5da6, 0x080c, 0x850b, 0x9086, 0x0014,
+	0x11b8, 0x080c, 0x5f1b, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1103,
+	0x1178, 0x7834, 0x9005, 0x1160, 0x7a38, 0xd2fc, 0x0128, 0x70c4,
+	0x9005, 0x1110, 0x70c7, 0x0001, 0x709b, 0x0006, 0x0029, 0x0010,
+	0x080c, 0x5ef7, 0x00fe, 0x0005, 0x00f6, 0x709b, 0x0007, 0x080c,
+	0x5e9f, 0x2079, 0x0240, 0x7833, 0x1104, 0x7837, 0x0000, 0x080c,
+	0x5f1b, 0x080c, 0x5efe, 0x11b8, 0x7084, 0x9005, 0x11a0, 0x7164,
+	0x9186, 0xffff, 0x0180, 0x9180, 0x3334, 0x200d, 0x918c, 0xff00,
+	0x810f, 0x2011, 0x0008, 0x080c, 0x5d53, 0x0180, 0x080c, 0x4f15,
+	0x0110, 0x080c, 0x2638, 0x20a9, 0x0008, 0x20e1, 0x0000, 0x2099,
+	0x026e, 0x20e9, 0x0000, 0x20a1, 0x024e, 0x4003, 0x60c3, 0x0014,
+	0x080c, 0x5dd0, 0x00fe, 0x0005, 0x00f6, 0x7090, 0x9005, 0x0500,
+	0x2011, 0x5da6, 0x080c, 0x850b, 0x9086, 0x0014, 0x11b8, 0x080c,
+	0x5f1b, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1104, 0x1178, 0x7834,
+	0x9005, 0x1160, 0x7a38, 0xd2fc, 0x0128, 0x70c4, 0x9005, 0x1110,
+	0x70c7, 0x0001, 0x709b, 0x0008, 0x0029, 0x0010, 0x080c, 0x5ef7,
+	0x00fe, 0x0005, 0x00f6, 0x709b, 0x0009, 0x080c, 0x5e9f, 0x2079,
+	0x0240, 0x7833, 0x1105, 0x7837, 0x0100, 0x080c, 0x5efe, 0x1150,
+	0x7084, 0x9005, 0x1138, 0x080c, 0x5cc6, 0x1188, 0x9085, 0x0001,
+	0x080c, 0x2638, 0x20a9, 0x0008, 0x080c, 0x5f1b, 0x20e1, 0x0000,
+	0x2099, 0x026e, 0x20e9, 0x0000, 0x20a1, 0x024e, 0x4003, 0x60c3,
+	0x0014, 0x080c, 0x5dd0, 0x0010, 0x080c, 0x5820, 0x00fe, 0x0005,
+	0x00f6, 0x7090, 0x9005, 0x05a8, 0x2011, 0x5da6, 0x080c, 0x850b,
+	0x9086, 0x0014, 0x1560, 0x080c, 0x5f1b, 0x2079, 0x0260, 0x7a30,
+	0x9296, 0x1105, 0x1520, 0x7834, 0x9084, 0x0100, 0x2011, 0x0100,
+	0x921e, 0x1160, 0x7a38, 0xd2fc, 0x0128, 0x70c4, 0x9005, 0x1110,
+	0x70c7, 0x0001, 0x709b, 0x000a, 0x00b1, 0x0098, 0x9005, 0x1178,
+	0x7a38, 0xd2fc, 0x0128, 0x70c4, 0x9005, 0x1110, 0x70c7, 0x0001,
+	0x7097, 0x0000, 0x709b, 0x000e, 0x080c, 0x5a6e, 0x0010, 0x080c,
+	0x5ef7, 0x00fe, 0x0005, 0x00f6, 0x709b, 0x000b, 0x2011, 0x1d0e,
+	0x20e9, 0x0001, 0x22a0, 0x20a9, 0x0040, 0x2019, 0xffff, 0x4304,
+	0x080c, 0x5e9f, 0x2079, 0x0240, 0x7833, 0x1106, 0x7837, 0x0000,
+	0x080c, 0x5efe, 0x0118, 0x2013, 0x0000, 0x0020, 0x7060, 0x9085,
+	0x0100, 0x2012, 0x20a9, 0x0040, 0x2009, 0x024e, 0x2011, 0x1d0e,
+	0x220e, 0x8210, 0x8108, 0x9186, 0x0260, 0x1128, 0x6810, 0x8000,
+	0x6812, 0x2009, 0x0240, 0x1f04, 0x59f0, 0x60c3, 0x0084, 0x080c,
+	0x5dd0, 0x00fe, 0x0005, 0x00f6, 0x7090, 0x9005, 0x01c0, 0x2011,
+	0x5da6, 0x080c, 0x850b, 0x9086, 0x0084, 0x1178, 0x080c, 0x5f1b,
+	0x2079, 0x0260, 0x7a30, 0x9296, 0x1106, 0x1138, 0x7834, 0x9005,
+	0x1120, 0x709b, 0x000c, 0x0029, 0x0010, 0x080c, 0x5ef7, 0x00fe,
+	0x0005, 0x00f6, 0x709b, 0x000d, 0x080c, 0x5e9f, 0x2079, 0x0240,
+	0x7833, 0x1107, 0x7837, 0x0000, 0x080c, 0x5f1b, 0x20a9, 0x0040,
+	0x2011, 0x026e, 0x2009, 0x024e, 0x220e, 0x8210, 0x8108, 0x9186,
+	0x0260, 0x1150, 0x6810, 0x8000, 0x6812, 0x2009, 0x0240, 0x6814,
+	0x8000, 0x6816, 0x2011, 0x0260, 0x1f04, 0x5a34, 0x60c3, 0x0084,
+	0x080c, 0x5dd0, 0x00fe, 0x0005, 0x00f6, 0x7090, 0x9005, 0x01e0,
+	0x2011, 0x5da6, 0x080c, 0x850b, 0x9086, 0x0084, 0x1198, 0x080c,
+	0x5f1b, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1107, 0x1158, 0x7834,
+	0x9005, 0x1140, 0x7097, 0x0001, 0x080c, 0x5e71, 0x709b, 0x000e,
+	0x0029, 0x0010, 0x080c, 0x5ef7, 0x00fe, 0x0005, 0x918d, 0x0001,
+	0x080c, 0x5f46, 0x709b, 0x000f, 0x7093, 0x0000, 0x2061, 0x0140,
+	0x605b, 0xbc85, 0x605f, 0xb5b5, 0x2061, 0x0100, 0x6043, 0x0005,
+	0x6043, 0x0004, 0x2009, 0x07d0, 0x2011, 0x5da6, 0x080c, 0x84ff,
+	0x0005, 0x7090, 0x9005, 0x0130, 0x2011, 0x5da6, 0x080c, 0x850b,
+	0x709b, 0x0000, 0x0005, 0x709b, 0x0011, 0x080c, 0xa57b, 0x080c,
+	0x5f1b, 0x20e1, 0x0000, 0x2099, 0x0260, 0x20e9, 0x0000, 0x20a1,
+	0x0240, 0x7490, 0x9480, 0x0018, 0x9080, 0x0007, 0x9084, 0x03f8,
+	0x8004, 0x20a8, 0x4003, 0x080c, 0x5efe, 0x11a0, 0x717c, 0x81ff,
+	0x0188, 0x900e, 0x7080, 0x9084, 0x00ff, 0x0160, 0x080c, 0x25cf,
+	0x9186, 0x007e, 0x0138, 0x9186, 0x0080, 0x0120, 0x2011, 0x0008,
+	0x080c, 0x5d53, 0x60c3, 0x0014, 0x080c, 0x5dd0, 0x0005, 0x00f6,
+	0x7090, 0x9005, 0x0500, 0x2011, 0x5da6, 0x080c, 0x850b, 0x9086,
+	0x0014, 0x11b8, 0x080c, 0x5f1b, 0x2079, 0x0260, 0x7a30, 0x9296,
+	0x1103, 0x1178, 0x7834, 0x9005, 0x1160, 0x7a38, 0xd2fc, 0x0128,
+	0x70c4, 0x9005, 0x1110, 0x70c7, 0x0001, 0x709b, 0x0012, 0x0029,
+	0x0010, 0x7093, 0x0000, 0x00fe, 0x0005, 0x00f6, 0x709b, 0x0013,
+	0x080c, 0x5ead, 0x2079, 0x0240, 0x7833, 0x1103, 0x7837, 0x0000,
+	0x080c, 0x5f1b, 0x080c, 0x5efe, 0x1170, 0x7084, 0x9005, 0x1158,
+	0x715c, 0x9186, 0xffff, 0x0138, 0x2011, 0x0008, 0x080c, 0x5d53,
+	0x0168, 0x080c, 0x5ed4, 0x20a9, 0x0008, 0x20e1, 0x0000, 0x2099,
+	0x026e, 0x20e9, 0x0000, 0x20a1, 0x024e, 0x4003, 0x60c3, 0x0014,
+	0x080c, 0x5dd0, 0x00fe, 0x0005, 0x00f6, 0x7090, 0x9005, 0x0500,
+	0x2011, 0x5da6, 0x080c, 0x850b, 0x9086, 0x0014, 0x11b8, 0x080c,
+	0x5f1b, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1104, 0x1178, 0x7834,
+	0x9005, 0x1160, 0x7a38, 0xd2fc, 0x0128, 0x70c4, 0x9005, 0x1110,
+	0x70c7, 0x0001, 0x709b, 0x0014, 0x0029, 0x0010, 0x7093, 0x0000,
+	0x00fe, 0x0005, 0x00f6, 0x709b, 0x0015, 0x080c, 0x5ead, 0x2079,
+	0x0240, 0x7833, 0x1104, 0x7837, 0x0000, 0x080c, 0x5f1b, 0x080c,
+	0x5efe, 0x11b8, 0x7084, 0x9005, 0x11a0, 0x7164, 0x9186, 0xffff,
+	0x0180, 0x9180, 0x3334, 0x200d, 0x918c, 0xff00, 0x810f, 0x2011,
+	0x0008, 0x080c, 0x5d53, 0x0180, 0x080c, 0x4f15, 0x0110, 0x080c,
+	0x2638, 0x20a9, 0x0008, 0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9,
+	0x0000, 0x20a1, 0x024e, 0x4003, 0x60c3, 0x0014, 0x080c, 0x5dd0,
+	0x00fe, 0x0005, 0x00f6, 0x7090, 0x9005, 0x05f0, 0x2011, 0x5da6,
+	0x080c, 0x850b, 0x9086, 0x0014, 0x15a8, 0x080c, 0x5f1b, 0x2079,
+	0x0260, 0x7a30, 0x9296, 0x1105, 0x1568, 0x7834, 0x9084, 0x0100,
+	0x2011, 0x0100, 0x921e, 0x1168, 0x9085, 0x0001, 0x080c, 0x5f46,
+	0x7a38, 0xd2fc, 0x0128, 0x70c4, 0x9005, 0x1110, 0x70c7, 0x0001,
+	0x0080, 0x9005, 0x11b8, 0x7a38, 0xd2fc, 0x0128, 0x70c4, 0x9005,
+	0x1110, 0x70c7, 0x0001, 0x9085, 0x0001, 0x080c, 0x5f46, 0x7097,
+	0x0000, 0x7a38, 0xd2f4, 0x0110, 0x70df, 0x0008, 0x709b, 0x0016,
+	0x0029, 0x0010, 0x7093, 0x0000, 0x00fe, 0x0005, 0x080c, 0xa57b,
+	0x080c, 0x5f1b, 0x20e1, 0x0000, 0x2099, 0x0260, 0x20e9, 0x0000,
+	0x20a1, 0x0240, 0x20a9, 0x000e, 0x4003, 0x2011, 0x026d, 0x2204,
+	0x9084, 0x0100, 0x2011, 0x024d, 0x2012, 0x2011, 0x026e, 0x709b,
+	0x0017, 0x080c, 0x5efe, 0x1150, 0x7084, 0x9005, 0x1138, 0x080c,
+	0x5cc6, 0x1188, 0x9085, 0x0001, 0x080c, 0x2638, 0x20a9, 0x0008,
+	0x080c, 0x5f1b, 0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9, 0x0000,
+	0x20a1, 0x024e, 0x4003, 0x60c3, 0x0014, 0x080c, 0x5dd0, 0x0010,
+	0x080c, 0x5820, 0x0005, 0x00f6, 0x7090, 0x9005, 0x01d8, 0x2011,
+	0x5da6, 0x080c, 0x850b, 0x9086, 0x0084, 0x1190, 0x080c, 0x5f1b,
+	0x2079, 0x0260, 0x7a30, 0x9296, 0x1106, 0x1150, 0x7834, 0x9005,
+	0x1138, 0x9006, 0x080c, 0x5f46, 0x709b, 0x0018, 0x0029, 0x0010,
+	0x7093, 0x0000, 0x00fe, 0x0005, 0x00f6, 0x709b, 0x0019, 0x080c,
+	0x5ead, 0x2079, 0x0240, 0x7833, 0x1106, 0x7837, 0x0000, 0x080c,
+	0x5f1b, 0x2009, 0x026e, 0x2039, 0x1d0e, 0x20a9, 0x0040, 0x213e,
+	0x8738, 0x8108, 0x9186, 0x0280, 0x1128, 0x6814, 0x8000, 0x6816,
+	0x2009, 0x0260, 0x1f04, 0x5c2f, 0x2039, 0x1d0e, 0x080c, 0x5efe,
+	0x11e8, 0x2728, 0x2514, 0x8207, 0x9084, 0x00ff, 0x8000, 0x2018,
+	0x9294, 0x00ff, 0x8007, 0x9205, 0x202a, 0x7060, 0x2310, 0x8214,
+	0x92a0, 0x1d0e, 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, 0x5c62, 0x60c3,
+	0x0084, 0x080c, 0x5dd0, 0x00fe, 0x0005, 0x00f6, 0x7090, 0x9005,
+	0x01e0, 0x2011, 0x5da6, 0x080c, 0x850b, 0x9086, 0x0084, 0x1198,
+	0x080c, 0x5f1b, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1107, 0x1158,
+	0x7834, 0x9005, 0x1140, 0x7097, 0x0001, 0x080c, 0x5e71, 0x709b,
+	0x001a, 0x0029, 0x0010, 0x7093, 0x0000, 0x00fe, 0x0005, 0x9085,
+	0x0001, 0x080c, 0x5f46, 0x709b, 0x001b, 0x080c, 0xa57b, 0x080c,
+	0x5f1b, 0x2011, 0x0260, 0x2009, 0x0240, 0x7490, 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, 0x5cae,
+	0x60c3, 0x0084, 0x080c, 0x5dd0, 0x0005, 0x0005, 0x0086, 0x0096,
+	0x2029, 0x1848, 0x252c, 0x20a9, 0x0008, 0x2041, 0x1d0e, 0x20e9,
+	0x0001, 0x28a0, 0x080c, 0x5f1b, 0x20e1, 0x0000, 0x2099, 0x026e,
+	0x4003, 0x20a9, 0x0008, 0x2011, 0x0007, 0xd5d4, 0x0108, 0x9016,
+	0x2800, 0x9200, 0x200c, 0x91a6, 0xffff, 0x1148, 0xd5d4, 0x0110,
+	0x8210, 0x0008, 0x8211, 0x1f04, 0x5ce0, 0x0804, 0x5d4f, 0x82ff,
+	0x1160, 0xd5d4, 0x0120, 0x91a6, 0x3fff, 0x0d90, 0x0020, 0x91a6,
+	0x3fff, 0x0904, 0x5d4f, 0x918d, 0xc000, 0x20a9, 0x0010, 0x2019,
+	0x0001, 0xd5d4, 0x0110, 0x2019, 0x0010, 0x2120, 0xd5d4, 0x0110,
+	0x8423, 0x0008, 0x8424, 0x1240, 0xd5d4, 0x0110, 0x8319, 0x0008,
+	0x8318, 0x1f04, 0x5d06, 0x04d8, 0x23a8, 0x2021, 0x0001, 0x8426,
+	0x8425, 0x1f04, 0x5d18, 0x2328, 0x8529, 0x92be, 0x0007, 0x0158,
+	0x0006, 0x2039, 0x0007, 0x2200, 0x973a, 0x000e, 0x27a8, 0x95a8,
+	0x0010, 0x1f04, 0x5d27, 0x755e, 0x95c8, 0x3334, 0x292d, 0x95ac,
+	0x00ff, 0x7582, 0x6532, 0x6536, 0x0016, 0x2508, 0x080c, 0x2618,
+	0x001e, 0x60e7, 0x0000, 0x65ea, 0x2018, 0x2304, 0x9405, 0x201a,
+	0x7087, 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, 0x715e, 0x91a0, 0x3334, 0x242d, 0x95ac, 0x00ff, 0x7582,
+	0x6532, 0x6536, 0x0016, 0x2508, 0x080c, 0x2618, 0x001e, 0x60e7,
+	0x0000, 0x65ea, 0x7087, 0x0001, 0x9084, 0x0000, 0x0005, 0x00e6,
+	0x2071, 0x1800, 0x708b, 0x0000, 0x00ee, 0x0005, 0x00e6, 0x00f6,
+	0x2079, 0x0100, 0x2071, 0x0140, 0x080c, 0x5e60, 0x080c, 0x9d09,
+	0x7004, 0x9084, 0x4000, 0x0110, 0x080c, 0x29e1, 0x0126, 0x2091,
+	0x8000, 0x2071, 0x1826, 0x2073, 0x0000, 0x7840, 0x0026, 0x0016,
+	0x2009, 0x00f7, 0x080c, 0x5ebd, 0x001e, 0x9094, 0x0010, 0x9285,
+	0x0080, 0x7842, 0x7a42, 0x002e, 0x012e, 0x00fe, 0x00ee, 0x0005,
+	0x0126, 0x2091, 0x8000, 0x080c, 0x2940, 0x0228, 0x2011, 0x0101,
+	0x2204, 0xc0c5, 0x2012, 0x2011, 0x19f2, 0x2013, 0x0000, 0x7093,
+	0x0000, 0x012e, 0x60a3, 0x0056, 0x60a7, 0x9575, 0x080c, 0x9cfc,
+	0x6144, 0xd184, 0x0120, 0x7198, 0x918d, 0x2000, 0x0018, 0x718c,
+	0x918d, 0x1000, 0x2011, 0x1997, 0x2112, 0x2009, 0x07d0, 0x2011,
+	0x5da6, 0x080c, 0x85d2, 0x0005, 0x0016, 0x0026, 0x00c6, 0x0126,
+	0x2091, 0x8000, 0x080c, 0xa781, 0x080c, 0xaa49, 0x080c, 0xa79d,
+	0x2009, 0x00f7, 0x080c, 0x5ebd, 0x2061, 0x1a01, 0x900e, 0x611a,
+	0x611e, 0x6172, 0x6176, 0x2061, 0x1800, 0x6003, 0x0001, 0x2061,
+	0x0100, 0x6043, 0x0090, 0x6043, 0x0010, 0x2009, 0x1997, 0x200b,
+	0x0000, 0x2009, 0x002d, 0x2011, 0x5e2c, 0x080c, 0x84ff, 0x012e,
+	0x00ce, 0x002e, 0x001e, 0x0005, 0x00e6, 0x0006, 0x0126, 0x2091,
+	0x8000, 0x0471, 0x2071, 0x0100, 0x080c, 0x9d09, 0x2071, 0x0140,
+	0x7004, 0x9084, 0x4000, 0x0110, 0x080c, 0x29e1, 0x080c, 0x73ec,
+	0x0188, 0x080c, 0x7407, 0x1170, 0x080c, 0x76f2, 0x0016, 0x080c,
+	0x26e7, 0x2001, 0x196d, 0x2102, 0x001e, 0x080c, 0x76ed, 0x080c,
+	0x7315, 0x0050, 0x2009, 0x0001, 0x080c, 0x29bd, 0x2001, 0x0001,
+	0x080c, 0x2574, 0x080c, 0x5dfc, 0x012e, 0x000e, 0x00ee, 0x0005,
+	0x2001, 0x180e, 0x2004, 0xd0bc, 0x0158, 0x0026, 0x0036, 0x2011,
+	0x8017, 0x2001, 0x1997, 0x201c, 0x080c, 0x4a38, 0x003e, 0x002e,
+	0x0005, 0x20a9, 0x0012, 0x20e9, 0x0001, 0x20a1, 0x1d80, 0x080c,
+	0x5f1b, 0x20e9, 0x0000, 0x2099, 0x026e, 0x0099, 0x20a9, 0x0020,
+	0x080c, 0x5f15, 0x2099, 0x0260, 0x20a1, 0x1d92, 0x0051, 0x20a9,
+	0x000e, 0x080c, 0x5f18, 0x2099, 0x0260, 0x20a1, 0x1db2, 0x0009,
+	0x0005, 0x0016, 0x0026, 0x3410, 0x3308, 0x2104, 0x8007, 0x2012,
+	0x8108, 0x8210, 0x1f04, 0x5e95, 0x002e, 0x001e, 0x0005, 0x080c,
+	0xa57b, 0x20e1, 0x0001, 0x2099, 0x1d00, 0x20e9, 0x0000, 0x20a1,
+	0x0240, 0x20a9, 0x000c, 0x4003, 0x0005, 0x080c, 0xa57b, 0x080c,
+	0x5f1b, 0x20e1, 0x0000, 0x2099, 0x0260, 0x20e9, 0x0000, 0x20a1,
+	0x0240, 0x20a9, 0x000c, 0x4003, 0x0005, 0x00c6, 0x0006, 0x2061,
+	0x0100, 0x810f, 0x2001, 0x1834, 0x2004, 0x9005, 0x1138, 0x2001,
+	0x1818, 0x2004, 0x9084, 0x00ff, 0x9105, 0x0010, 0x9185, 0x00f7,
+	0x604a, 0x000e, 0x00ce, 0x0005, 0x0016, 0x0046, 0x080c, 0x6966,
+	0x0158, 0x9006, 0x2020, 0x2009, 0x002a, 0x080c, 0xe191, 0x2001,
+	0x180c, 0x200c, 0xc195, 0x2102, 0x2019, 0x002a, 0x900e, 0x080c,
+	0x316a, 0x080c, 0xce35, 0x0140, 0x0036, 0x2019, 0xffff, 0x2021,
+	0x0007, 0x080c, 0x4bef, 0x003e, 0x004e, 0x001e, 0x0005, 0x080c,
+	0x5dfc, 0x709b, 0x0000, 0x7093, 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, 0x1d00, 0x4004, 0x2079, 0x1d00,
+	0x7803, 0x2200, 0x7807, 0x00ef, 0x780f, 0x00ef, 0x7813, 0x0138,
+	0x7823, 0xffff, 0x7827, 0xffff, 0x01de, 0x014e, 0x015e, 0x00fe,
+	0x0005, 0x2001, 0x1800, 0x2003, 0x0001, 0x0005, 0x2001, 0x19a4,
+	0x0118, 0x2003, 0x0001, 0x0010, 0x2003, 0x0000, 0x0005, 0x0156,
+	0x20a9, 0x0800, 0x2009, 0x1000, 0x9006, 0x200a, 0x8108, 0x1f04,
+	0x5f55, 0x015e, 0x0005, 0x00d6, 0x0036, 0x0156, 0x0136, 0x0146,
+	0x2069, 0x1847, 0x9006, 0xb802, 0xb8d6, 0xb807, 0x0707, 0xb80a,
+	0xb80e, 0xb812, 0x9198, 0x3334, 0x231d, 0x939c, 0x00ff, 0xbb16,
+	0x0016, 0x0026, 0xb886, 0x080c, 0xaa42, 0x1120, 0x9192, 0x007e,
+	0x1208, 0xbb86, 0x20a9, 0x0004, 0xb8c4, 0x20e8, 0xb9c8, 0x9198,
+	0x0006, 0x9006, 0x23a0, 0x4004, 0x20a9, 0x0004, 0x9198, 0x000a,
+	0x23a0, 0x4004, 0x002e, 0x001e, 0xb83e, 0xb842, 0xb8ce, 0xb8d2,
+	0xb85e, 0xb862, 0xb866, 0xb86a, 0xb86f, 0x0100, 0xb872, 0xb876,
+	0xb87a, 0xb88a, 0xb88e, 0xb893, 0x0008, 0xb896, 0xb89a, 0xb89e,
+	0xb8be, 0xb9a2, 0x0096, 0xb8a4, 0x904d, 0x0110, 0x080c, 0x106d,
+	0xb8a7, 0x0000, 0x009e, 0x9006, 0xb84a, 0x6810, 0xb83a, 0x680c,
+	0xb846, 0xb8bb, 0x0520, 0xb8ac, 0x9005, 0x0198, 0x00c6, 0x2060,
+	0x9c82, 0x1ddc, 0x0a0c, 0x0d7d, 0x2001, 0x181a, 0x2004, 0x9c02,
+	0x1a0c, 0x0d7d, 0x080c, 0x8a5a, 0x00ce, 0x090c, 0x8dfe, 0xb8af,
+	0x0000, 0x6814, 0x9084, 0x00ff, 0xb842, 0x014e, 0x013e, 0x015e,
+	0x003e, 0x00de, 0x0005, 0x0126, 0x2091, 0x8000, 0xa974, 0xae78,
+	0x9684, 0x3fff, 0x9082, 0x4000, 0x1a04, 0x6031, 0x9182, 0x0800,
+	0x1a04, 0x6035, 0x2001, 0x180c, 0x2004, 0x9084, 0x0003, 0x1904,
+	0x603b, 0x9188, 0x1000, 0x2104, 0x905d, 0x0198, 0xb804, 0x9084,
+	0x00ff, 0x908e, 0x0006, 0x1188, 0xb8a4, 0x900d, 0x1904, 0x604d,
+	0x080c, 0x63f6, 0x9006, 0x012e, 0x0005, 0x2001, 0x0005, 0x900e,
+	0x04b8, 0x2001, 0x0028, 0x900e, 0x0498, 0x9082, 0x0006, 0x1290,
+	0x080c, 0xaa42, 0x1160, 0xb8a0, 0x9084, 0xff80, 0x1140, 0xb900,
+	0xd1fc, 0x0d10, 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, 0x9065, 0x09a8, 0x080c, 0x696a, 0x1990,
+	0xb800, 0xd0bc, 0x0978, 0x0804, 0x5ff4, 0x080c, 0x6798, 0x0904,
+	0x5ffd, 0x0804, 0x5ff8, 0x00e6, 0x2071, 0x19e5, 0x7004, 0x9086,
+	0x0002, 0x1128, 0x7030, 0x9080, 0x0004, 0x2004, 0x9b06, 0x00ee,
+	0x0005, 0x00b6, 0x00e6, 0x0126, 0x2091, 0x8000, 0xa874, 0x908e,
+	0x00ff, 0x1120, 0x2001, 0x196b, 0x205c, 0x0060, 0xa974, 0x9182,
+	0x0800, 0x1690, 0x9188, 0x1000, 0x2104, 0x905d, 0x01d0, 0x080c,
+	0x690a, 0x11d0, 0x080c, 0xaa82, 0x0570, 0x2b00, 0x6012, 0x2900,
+	0x6016, 0x6023, 0x0009, 0x602b, 0x0000, 0xa874, 0x908e, 0x00ff,
+	0x1110, 0x602b, 0x8000, 0x2009, 0x0043, 0x080c, 0xab77, 0x9006,
+	0x00b0, 0x2001, 0x0028, 0x0090, 0x2009, 0x180c, 0x210c, 0xd18c,
+	0x0118, 0x2001, 0x0004, 0x0038, 0xd184, 0x0118, 0x2001, 0x0004,
+	0x0010, 0x2001, 0x0029, 0x0010, 0x2001, 0x0029, 0x9005, 0x012e,
+	0x00ee, 0x00be, 0x0005, 0x2001, 0x002c, 0x0cc0, 0x00b6, 0x00e6,
+	0x0126, 0x2091, 0x8000, 0xa974, 0x9182, 0x0800, 0x1a04, 0x6129,
+	0x9188, 0x1000, 0x2104, 0x905d, 0x0904, 0x6101, 0xb8a0, 0x9086,
+	0x007f, 0x0178, 0x080c, 0x6972, 0x0160, 0xa994, 0x81ff, 0x0130,
+	0x908e, 0x0004, 0x0130, 0x908e, 0x0005, 0x0118, 0x080c, 0x696a,
+	0x1598, 0xa87c, 0xd0fc, 0x01e0, 0xa894, 0x9005, 0x01c8, 0x2060,
+	0x0026, 0x2010, 0x080c, 0xc711, 0x002e, 0x1120, 0x2001, 0x0008,
+	0x0804, 0x612b, 0x6020, 0x9086, 0x000a, 0x0120, 0x2001, 0x0008,
+	0x0804, 0x612b, 0x601a, 0x6003, 0x0008, 0x2900, 0x6016, 0x0058,
+	0x080c, 0xaa82, 0x05e8, 0x2b00, 0x6012, 0x2900, 0x6016, 0x600b,
+	0xffff, 0x6023, 0x000a, 0x2009, 0x0003, 0x080c, 0xab77, 0x9006,
+	0x0458, 0x2001, 0x0028, 0x0438, 0x9082, 0x0006, 0x1290, 0x080c,
+	0xaa42, 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, 0x61c0, 0x617b, 0x6192, 0x61c0, 0x61c0,
+	0x61c0, 0x61c0, 0x61c0, 0x2100, 0x9082, 0x007e, 0x1278, 0x080c,
+	0x64cc, 0x0148, 0x9046, 0xb810, 0x9306, 0x1904, 0x61c8, 0xb814,
+	0x9206, 0x15f0, 0x0028, 0xbb12, 0xba16, 0x0010, 0x080c, 0x48eb,
+	0x0150, 0x04b0, 0x080c, 0x652d, 0x1598, 0xb810, 0x9306, 0x1580,
+	0xb814, 0x9206, 0x1568, 0x080c, 0xaa82, 0x0530, 0x2b00, 0x6012,
+	0x080c, 0xcbb0, 0x2900, 0x6016, 0x600b, 0xffff, 0x6023, 0x000a,
+	0xa878, 0x9086, 0x0001, 0x1170, 0x080c, 0x31ab, 0x9006, 0x080c,
+	0x6469, 0x2001, 0x0002, 0x080c, 0x647d, 0x2001, 0x0200, 0xb86e,
+	0xb893, 0x0002, 0x2009, 0x0003, 0x080c, 0xab77, 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, 0x63a7, 0x90c6, 0x0056, 0x0904, 0x63ab,
+	0x90c6, 0x0066, 0x0904, 0x63af, 0x90c6, 0x0071, 0x0904, 0x63b3,
+	0x90c6, 0x0074, 0x0904, 0x63b7, 0x90c6, 0x007c, 0x0904, 0x63bb,
+	0x90c6, 0x007e, 0x0904, 0x63bf, 0x90c6, 0x0037, 0x0904, 0x63c3,
+	0x9016, 0x2079, 0x1800, 0xa974, 0x9186, 0x00ff, 0x0904, 0x63a2,
+	0x9182, 0x0800, 0x1a04, 0x63a2, 0x080c, 0x652d, 0x1198, 0xb804,
+	0x9084, 0x00ff, 0x9082, 0x0006, 0x1268, 0xa894, 0x90c6, 0x006f,
+	0x0148, 0x080c, 0xaa42, 0x1904, 0x638b, 0xb8a0, 0x9084, 0xff80,
+	0x1904, 0x638b, 0xa894, 0x90c6, 0x006f, 0x0158, 0x90c6, 0x005e,
+	0x0904, 0x62eb, 0x90c6, 0x0064, 0x0904, 0x6314, 0x2008, 0x0804,
+	0x62ad, 0xa998, 0xa8b0, 0x2040, 0x080c, 0xaa42, 0x1120, 0x9182,
+	0x007f, 0x0a04, 0x62ad, 0x9186, 0x00ff, 0x0904, 0x62ad, 0x9182,
+	0x0800, 0x1a04, 0x62ad, 0xaaa0, 0xab9c, 0x787c, 0x9306, 0x1188,
+	0x7880, 0x0096, 0x924e, 0x1128, 0x2208, 0x2310, 0x009e, 0x0804,
+	0x62ad, 0x99cc, 0xff00, 0x009e, 0x1120, 0x2208, 0x2310, 0x0804,
+	0x62ad, 0x080c, 0x48eb, 0x0904, 0x62b7, 0x900e, 0x9016, 0x90c6,
+	0x4000, 0x15e0, 0x0006, 0x080c, 0x681c, 0x1108, 0xc185, 0xb800,
+	0xd0bc, 0x0108, 0xc18d, 0x20a9, 0x0004, 0xa860, 0x20e8, 0xa85c,
+	0x9080, 0x0031, 0x20a0, 0xb8c4, 0x20e0, 0xb8c8, 0x9080, 0x0006,
+	0x2098, 0x080c, 0x0fb8, 0x20a9, 0x0004, 0xa860, 0x20e8, 0xa85c,
+	0x9080, 0x0035, 0x20a0, 0xb8c4, 0x20e0, 0xb8c8, 0x9080, 0x000a,
+	0x2098, 0x080c, 0x0fb8, 0xa8c4, 0xabc8, 0x9305, 0xabcc, 0x9305,
+	0xabd0, 0x9305, 0xabd4, 0x9305, 0xabd8, 0x9305, 0xabdc, 0x9305,
+	0xabe0, 0x9305, 0x9005, 0x0510, 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, 0x0478, 0x000e, 0x080c,
+	0xaa82, 0x1130, 0x2001, 0x4005, 0x2009, 0x0003, 0x9016, 0x0c78,
+	0x2b00, 0x6012, 0x080c, 0xcbb0, 0x2900, 0x6016, 0x6023, 0x0001,
+	0xa868, 0xd88c, 0x0108, 0xc0f5, 0xa86a, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x31ab, 0x012e, 0x9006, 0x080c, 0x6469, 0x2001, 0x0002,
+	0x080c, 0x647d, 0x2009, 0x0002, 0x080c, 0xab77, 0xa8b0, 0xd094,
+	0x0118, 0xb8d4, 0xc08d, 0xb8d6, 0x9006, 0x9005, 0x012e, 0x00ee,
+	0x00fe, 0x00be, 0x0005, 0x080c, 0x5610, 0x0118, 0x2009, 0x0007,
+	0x00f8, 0xa998, 0xaeb0, 0x080c, 0x652d, 0x1904, 0x62a8, 0x9186,
+	0x007f, 0x0130, 0x080c, 0x696a, 0x0118, 0x2009, 0x0009, 0x0080,
+	0x0096, 0x080c, 0x103b, 0x1120, 0x009e, 0x2009, 0x0002, 0x0040,
+	0x2900, 0x009e, 0xa806, 0x080c, 0xc908, 0x19b0, 0x2009, 0x0003,
+	0x2001, 0x4005, 0x0804, 0x62af, 0xa998, 0xaeb0, 0x080c, 0x652d,
+	0x1904, 0x62a8, 0x0096, 0x080c, 0x103b, 0x1128, 0x009e, 0x2009,
+	0x0002, 0x0804, 0x6368, 0x2900, 0x009e, 0xa806, 0x0096, 0x2048,
+	0x20a9, 0x002b, 0xb8c4, 0x20e0, 0xb8c8, 0x2098, 0xa860, 0x20e8,
+	0xa85c, 0x9080, 0x0002, 0x20a0, 0x4003, 0x20a9, 0x0008, 0x9080,
+	0x0006, 0x20a0, 0xbbc8, 0x9398, 0x0006, 0x2398, 0x080c, 0x0fb8,
+	0x009e, 0xa87b, 0x0000, 0xa883, 0x0000, 0xa897, 0x4000, 0xd684,
+	0x1168, 0x080c, 0x55fc, 0xd0b4, 0x1118, 0xa89b, 0x000b, 0x00e0,
+	0xb800, 0xd08c, 0x0118, 0xa89b, 0x000c, 0x00b0, 0x080c, 0x696a,
+	0x0118, 0xa89b, 0x0009, 0x0080, 0x080c, 0x5610, 0x0118, 0xa89b,
+	0x0007, 0x0050, 0x080c, 0xc8eb, 0x1904, 0x62e4, 0x2009, 0x0003,
+	0x2001, 0x4005, 0x0804, 0x62af, 0xa87b, 0x0030, 0xa897, 0x4005,
+	0xa804, 0x8006, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0,
+	0x9080, 0x0002, 0x2009, 0x002b, 0xaaa0, 0xab9c, 0xaca8, 0xada4,
+	0x2031, 0x0000, 0x2041, 0x1275, 0x080c, 0xaffd, 0x1904, 0x62e4,
+	0x2009, 0x0002, 0x08e8, 0x2001, 0x0028, 0x900e, 0x0804, 0x62e5,
+	0x2009, 0x180c, 0x210c, 0xd18c, 0x0118, 0x2001, 0x0004, 0x0038,
+	0xd184, 0x0118, 0x2001, 0x0004, 0x0010, 0x2001, 0x0029, 0x900e,
+	0x0804, 0x62e5, 0x2001, 0x0029, 0x900e, 0x0804, 0x62e5, 0x080c,
+	0x3757, 0x0804, 0x62e6, 0x080c, 0x5331, 0x0804, 0x62e6, 0x080c,
+	0x4533, 0x0804, 0x62e6, 0x080c, 0x49ae, 0x0804, 0x62e6, 0x080c,
+	0x4c65, 0x0804, 0x62e6, 0x080c, 0x4fab, 0x0804, 0x62e6, 0x080c,
+	0x519c, 0x0804, 0x62e6, 0x080c, 0x3975, 0x0804, 0x62e6, 0x00b6,
+	0xa974, 0xae78, 0x9684, 0x3fff, 0x9082, 0x4000, 0x1608, 0x9182,
+	0x0800, 0x1258, 0x9188, 0x1000, 0x2104, 0x905d, 0x0130, 0x080c,
+	0x696a, 0x1138, 0x00d9, 0x9006, 0x00b0, 0x2001, 0x0028, 0x900e,
+	0x0090, 0x9082, 0x0006, 0x1240, 0xb900, 0xd1fc, 0x0d98, 0x2001,
+	0x0029, 0x2009, 0x1000, 0x0038, 0x2001, 0x0029, 0x900e, 0x0018,
+	0x2001, 0x0029, 0x900e, 0x9005, 0x00be, 0x0005, 0xa877, 0x0000,
+	0xb8d0, 0x9005, 0x1904, 0x645d, 0xb888, 0x9005, 0x1904, 0x645d,
+	0xb838, 0xb93c, 0x9102, 0x1a04, 0x645d, 0x2b10, 0x080c, 0xaaaf,
+	0x0904, 0x6459, 0x8108, 0xb93e, 0x6212, 0x2900, 0x6016, 0x6023,
+	0x0003, 0x600b, 0xffff, 0x6007, 0x0040, 0xa878, 0x605e, 0xa880,
+	0x9084, 0x00ff, 0x6066, 0xa883, 0x0000, 0xa87c, 0xd0ac, 0x0588,
+	0xc0dd, 0xa87e, 0xa888, 0x8001, 0x1530, 0xa816, 0xa864, 0x9094,
+	0x00f7, 0x9296, 0x0011, 0x11f8, 0x9084, 0x00ff, 0xc0bd, 0x601e,
+	0xa8ac, 0xaab0, 0xa836, 0xaa3a, 0x2001, 0x000f, 0x8001, 0x1df0,
+	0x2001, 0x8004, 0x6003, 0x0004, 0x6046, 0x00f6, 0x2079, 0x0380,
+	0x7818, 0xd0bc, 0x1de8, 0x7833, 0x0010, 0x2c00, 0x7836, 0x781b,
+	0x8080, 0x00fe, 0x0005, 0x080c, 0x1728, 0x601c, 0xc0bd, 0x601e,
+	0x0c38, 0xd0b4, 0x190c, 0x1c0c, 0x2001, 0x8004, 0x6003, 0x0002,
+	0x0c18, 0x81ff, 0x1110, 0xb88b, 0x0001, 0x2908, 0xb8cc, 0xb9ce,
+	0x9005, 0x1110, 0xb9d2, 0x0020, 0x0096, 0x2048, 0xa902, 0x009e,
+	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, 0x6966, 0x0140, 0x9284,
+	0xff00, 0x8007, 0x9086, 0x0007, 0x1110, 0x2011, 0x0600, 0x000e,
+	0x9294, 0xff00, 0x9215, 0xba06, 0x0006, 0x9086, 0x0006, 0x1120,
+	0xba90, 0x82ff, 0x090c, 0x0d7d, 0x000e, 0x00ce, 0x012e, 0x00be,
+	0x0005, 0x00b6, 0x0126, 0x00c6, 0x2091, 0x8000, 0x6210, 0x2258,
+	0xba04, 0x0006, 0x9086, 0x0006, 0x1168, 0xb89c, 0xd0a4, 0x0150,
+	0x080c, 0x6962, 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,
+	0x1188, 0x0096, 0x080c, 0x103b, 0x2958, 0x009e, 0x0168, 0x2b00,
+	0x2012, 0xb85c, 0xb8ca, 0xb860, 0xb8c6, 0x9006, 0xb8a6, 0xb8ae,
+	0x080c, 0x5f5b, 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, 0x106d, 0x00d6, 0x00c6, 0xb8bc, 0x2060, 0x8cff, 0x0168,
+	0x600c, 0x0006, 0x6014, 0x2048, 0x080c, 0xc723, 0x0110, 0x080c,
+	0x0fed, 0x080c, 0xaad8, 0x00ce, 0x0c88, 0x00ce, 0x00de, 0x2b48,
+	0xb8c8, 0xb85e, 0xb8c4, 0xb862, 0x080c, 0x107d, 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, 0x73e4,
+	0x1510, 0xb8a0, 0x9086, 0x007e, 0x0120, 0x080c, 0xaa42, 0x11d8,
+	0x0078, 0x7040, 0xd0e4, 0x01b8, 0x00c6, 0x2061, 0x1980, 0x7048,
+	0x2062, 0x704c, 0x6006, 0x7050, 0x600a, 0x7054, 0x600e, 0x00ce,
+	0x703c, 0x2069, 0x0140, 0x9005, 0x1110, 0x2001, 0x0001, 0x6886,
+	0x2069, 0x1800, 0x68b6, 0x7040, 0xb85e, 0x7048, 0xb862, 0x704c,
+	0xb866, 0x20e1, 0x0000, 0x2099, 0x0276, 0xb8c4, 0x20e8, 0xb8c8,
+	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, 0xbbd4, 0xc384, 0xba00, 0x2009,
+	0x1867, 0x210c, 0xd0bc, 0x0120, 0xd1ec, 0x0110, 0xc2ad, 0x0008,
+	0xc2ac, 0xd0c4, 0x0148, 0xd1e4, 0x0138, 0xc2bd, 0xd0cc, 0x0128,
+	0xd38c, 0x1108, 0xc385, 0x0008, 0xc2bc, 0xba02, 0xbbd6, 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, 0x0d7d, 0x3c00, 0x20e8, 0x3300,
+	0x8001, 0x20a0, 0x4604, 0x8210, 0xaa06, 0x01de, 0x01ce, 0x014e,
+	0x013e, 0x0060, 0x080c, 0x103b, 0x0170, 0x2900, 0xb8a6, 0xa803,
+	0x0000, 0x080c, 0x67b8, 0xa807, 0x0001, 0xae12, 0x9085, 0x0001,
+	0x012e, 0x009e, 0x0005, 0x9006, 0x0cd8, 0x0126, 0x2091, 0x8000,
+	0x0096, 0xb8a4, 0x904d, 0x0188, 0xa800, 0x9005, 0x1150, 0x080c,
+	0x67c7, 0x1158, 0xa804, 0x908a, 0x0002, 0x0218, 0x8001, 0xa806,
+	0x0020, 0x080c, 0x106d, 0xb8a7, 0x0000, 0x009e, 0x012e, 0x0005,
+	0x0096, 0x00c6, 0xb888, 0x9005, 0x1904, 0x66b1, 0xb8d0, 0x904d,
+	0x0904, 0x66b1, 0x080c, 0xaaaf, 0x0904, 0x66ad, 0x8210, 0xba3e,
+	0xa800, 0xb8d2, 0x9005, 0x1108, 0xb8ce, 0x2b00, 0x6012, 0x2900,
+	0x6016, 0x6023, 0x0003, 0x600b, 0xffff, 0x6007, 0x0040, 0xa878,
+	0x605e, 0xa880, 0x9084, 0x00ff, 0x6066, 0xa883, 0x0000, 0xa87c,
+	0xd0ac, 0x01c8, 0xc0dd, 0xa87e, 0xa888, 0x8001, 0x1568, 0xa816,
+	0xa864, 0x9094, 0x00f7, 0x9296, 0x0011, 0x1530, 0x9084, 0x00ff,
+	0xc0bd, 0x601e, 0xa8ac, 0xaab0, 0xa836, 0xaa3a, 0x2001, 0x8004,
+	0x6003, 0x0004, 0x0030, 0x080c, 0x1c0c, 0x2001, 0x8004, 0x6003,
+	0x0002, 0x6046, 0x2001, 0x0010, 0x2c08, 0x080c, 0xa772, 0xb838,
+	0xba3c, 0x9202, 0x0a04, 0x665e, 0x0020, 0x82ff, 0x1110, 0xb88b,
+	0x0001, 0x00ce, 0x009e, 0x0005, 0x080c, 0x1728, 0x601c, 0xc0bd,
+	0x601e, 0x08e0, 0x00b6, 0x0096, 0x0016, 0x20a9, 0x0800, 0x900e,
+	0x0016, 0x080c, 0x652d, 0x1158, 0xb8d0, 0x904d, 0x0140, 0x3e00,
+	0x9086, 0x0002, 0x1118, 0xb800, 0xd0bc, 0x1108, 0x0041, 0x001e,
+	0x8108, 0x1f04, 0x66c0, 0x001e, 0x00be, 0x009e, 0x0005, 0x0096,
+	0x0016, 0xb8d0, 0x904d, 0x0188, 0xa800, 0xb8d2, 0x9005, 0x1108,
+	0xb8ce, 0x9006, 0xa802, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000,
+	0x080c, 0xca1a, 0x080c, 0x6c7f, 0x0c60, 0x001e, 0x009e, 0x0005,
+	0x0086, 0x9046, 0xb8d0, 0x904d, 0x0198, 0xa86c, 0x9406, 0x1118,
+	0xa870, 0x9506, 0x0128, 0x2940, 0xa800, 0x904d, 0x0148, 0x0ca8,
+	0xa800, 0x88ff, 0x1110, 0xb8d2, 0x0008, 0xa002, 0xa803, 0x0000,
+	0x008e, 0x0005, 0x901e, 0x0010, 0x2019, 0x0001, 0x00e6, 0x0096,
+	0x00c6, 0x0086, 0x0026, 0x0126, 0x2091, 0x8000, 0x2071, 0x19e5,
+	0x9046, 0x7028, 0x9065, 0x01e8, 0x6014, 0x2068, 0x83ff, 0x0120,
+	0x605c, 0x9606, 0x0158, 0x0030, 0xa86c, 0x9406, 0x1118, 0xa870,
+	0x9506, 0x0120, 0x2c40, 0x600c, 0x2060, 0x0c60, 0x600c, 0x0006,
+	0x0066, 0x2830, 0x080c, 0x9e79, 0x006e, 0x000e, 0x83ff, 0x0508,
+	0x0c08, 0x9046, 0xb8d0, 0x904d, 0x01e0, 0x83ff, 0x0120, 0xa878,
+	0x9606, 0x0158, 0x0030, 0xa86c, 0x9406, 0x1118, 0xa870, 0x9506,
+	0x0120, 0x2940, 0xa800, 0x2048, 0x0c70, 0xb8d0, 0xaa00, 0x0026,
+	0x9906, 0x1110, 0xbad2, 0x0008, 0xa202, 0x000e, 0x83ff, 0x0108,
+	0x0c10, 0x002e, 0x008e, 0x00ce, 0x009e, 0x00ee, 0x0005, 0x9016,
+	0x0489, 0x1110, 0x2011, 0x0001, 0x0005, 0x080c, 0x681c, 0x0128,
+	0x080c, 0xc7ef, 0x0010, 0x9085, 0x0001, 0x0005, 0x080c, 0x681c,
+	0x0128, 0x080c, 0xc785, 0x0010, 0x9085, 0x0001, 0x0005, 0x080c,
+	0x681c, 0x0128, 0x080c, 0xc7ec, 0x0010, 0x9085, 0x0001, 0x0005,
+	0x080c, 0x681c, 0x0128, 0x080c, 0xc7a9, 0x0010, 0x9085, 0x0001,
+	0x0005, 0x080c, 0x681c, 0x0128, 0x080c, 0xc819, 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, 0x103b, 0x0168, 0x2900, 0xb8a6, 0x080c,
+	0x67b8, 0xa803, 0x0001, 0xa807, 0x0000, 0x9085, 0x0001, 0x012e,
+	0x009e, 0x0005, 0x9006, 0x0cd8, 0x0096, 0x0126, 0x2091, 0x8000,
+	0xb8a4, 0x904d, 0x0130, 0xb8a7, 0x0000, 0x080c, 0x106d, 0x9085,
+	0x0001, 0x012e, 0x009e, 0x0005, 0xb89c, 0xd0a4, 0x0005, 0x00b6,
+	0x00f6, 0x080c, 0x73e4, 0x01b0, 0x71c4, 0x81ff, 0x1198, 0x71dc,
+	0xd19c, 0x0180, 0x2001, 0x007e, 0x9080, 0x1000, 0x2004, 0x905d,
+	0x0148, 0xb804, 0x9084, 0x00ff, 0x9086, 0x0006, 0x1118, 0xb800,
+	0xc0ed, 0xb802, 0x2079, 0x1847, 0x7804, 0xd0a4, 0x01d0, 0x0156,
+	0x20a9, 0x007f, 0x900e, 0x0016, 0x080c, 0x652d, 0x1168, 0xb804,
+	0x9084, 0xff00, 0x8007, 0x9096, 0x0004, 0x0118, 0x9086, 0x0006,
+	0x1118, 0xb800, 0xc0ed, 0xb802, 0x001e, 0x8108, 0x1f04, 0x6843,
+	0x015e, 0x080c, 0x6928, 0x0120, 0x2001, 0x1983, 0x200c, 0x0038,
+	0x2079, 0x1847, 0x7804, 0xd0a4, 0x0130, 0x2009, 0x07d0, 0x2011,
+	0x686e, 0x080c, 0x85d2, 0x00fe, 0x00be, 0x0005, 0x00b6, 0x2011,
+	0x686e, 0x080c, 0x850b, 0x080c, 0x6928, 0x01d8, 0x2001, 0x107e,
+	0x2004, 0x2058, 0xb900, 0xc1ec, 0xb902, 0x080c, 0x6966, 0x0130,
+	0x2009, 0x07d0, 0x2011, 0x686e, 0x080c, 0x85d2, 0x00e6, 0x2071,
+	0x1800, 0x9006, 0x707e, 0x7060, 0x7082, 0x080c, 0x2f79, 0x00ee,
+	0x04d0, 0x0156, 0x00c6, 0x20a9, 0x007f, 0x900e, 0x0016, 0x080c,
+	0x652d, 0x1558, 0xb800, 0xd0ec, 0x0540, 0x0046, 0xbaa0, 0x2220,
+	0x9006, 0x2009, 0x0029, 0x080c, 0xe191, 0xb800, 0xc0e5, 0xc0ec,
+	0xb802, 0x080c, 0x6962, 0x2001, 0x0707, 0x1128, 0xb804, 0x9084,
+	0x00ff, 0x9085, 0x0700, 0xb806, 0x080c, 0xa781, 0x2019, 0x0029,
+	0x080c, 0x926f, 0x0076, 0x903e, 0x080c, 0x9141, 0x900e, 0x080c,
+	0xdeb3, 0x007e, 0x004e, 0x080c, 0xa79d, 0x001e, 0x8108, 0x1f04,
+	0x6896, 0x00ce, 0x015e, 0x00be, 0x0005, 0x00b6, 0x6010, 0x2058,
+	0xb800, 0xc0ec, 0xb802, 0x00be, 0x0005, 0x00b6, 0x00c6, 0x0096,
+	0x080c, 0x1054, 0x090c, 0x0d7d, 0x2958, 0x009e, 0x2001, 0x196b,
+	0x2b02, 0xb8af, 0x0000, 0x2009, 0x00ff, 0x080c, 0x5f5b, 0xb807,
+	0x0006, 0xb813, 0x00ff, 0xb817, 0xffff, 0xb86f, 0x0200, 0xb86c,
+	0xb893, 0x0002, 0xb8bb, 0x0520, 0xb8a3, 0x00ff, 0xb8af, 0x0000,
+	0x00ce, 0x00be, 0x0005, 0x7810, 0x00b6, 0x2058, 0xb800, 0x00be,
+	0xd0ac, 0x0005, 0x6010, 0x00b6, 0x905d, 0x0108, 0xb800, 0x00be,
+	0xd0bc, 0x0005, 0x0006, 0x0016, 0x0026, 0xb804, 0x908c, 0x00ff,
+	0x9196, 0x0006, 0x0188, 0x9196, 0x0004, 0x0170, 0x9196, 0x0005,
+	0x0158, 0x908c, 0xff00, 0x810f, 0x9196, 0x0006, 0x0128, 0x9196,
+	0x0004, 0x0110, 0x9196, 0x0005, 0x002e, 0x001e, 0x000e, 0x0005,
+	0x00b6, 0x00f6, 0x2001, 0x107e, 0x2004, 0x905d, 0x0110, 0xb800,
+	0xd0ec, 0x00fe, 0x00be, 0x0005, 0x0126, 0x0026, 0x2091, 0x8000,
+	0x0006, 0xbaa0, 0x9290, 0x1000, 0x2204, 0x9b06, 0x190c, 0x0d7d,
+	0x000e, 0xba00, 0x9005, 0x0110, 0xc2fd, 0x0008, 0xc2fc, 0xba02,
+	0x002e, 0x012e, 0x0005, 0x2011, 0x1837, 0x2204, 0xd0cc, 0x0138,
+	0x2001, 0x1981, 0x200c, 0x2011, 0x6958, 0x080c, 0x85d2, 0x0005,
+	0x2011, 0x6958, 0x080c, 0x850b, 0x2011, 0x1837, 0x2204, 0xc0cc,
+	0x2012, 0x0005, 0x080c, 0x55fc, 0xd0ac, 0x0005, 0x080c, 0x55fc,
+	0xd0a4, 0x0005, 0x0016, 0xb904, 0x9184, 0x00ff, 0x908e, 0x0006,
+	0x001e, 0x0005, 0x0016, 0xb904, 0x9184, 0xff00, 0x8007, 0x908e,
+	0x0006, 0x001e, 0x0005, 0x00b6, 0x00f6, 0x080c, 0xce35, 0x0158,
+	0x70dc, 0x9084, 0x0028, 0x0138, 0x2001, 0x107f, 0x2004, 0x905d,
+	0x0110, 0xb8d4, 0xd094, 0x00fe, 0x00be, 0x0005, 0x2071, 0x1910,
+	0x7003, 0x0001, 0x7007, 0x0000, 0x9006, 0x7012, 0x7016, 0x701a,
+	0x701e, 0x700a, 0x7046, 0x2001, 0x1947, 0x2003, 0x0000, 0x0005,
+	0x0016, 0x00e6, 0x2071, 0x1948, 0x900e, 0x710a, 0x080c, 0x55fc,
+	0xd0fc, 0x1140, 0x080c, 0x55fc, 0x900e, 0xd09c, 0x0108, 0x8108,
+	0x7102, 0x00f8, 0x2001, 0x1867, 0x200c, 0x9184, 0x0007, 0x0002,
+	0x69aa, 0x69aa, 0x69aa, 0x69aa, 0x69aa, 0x69c0, 0x69ce, 0x69aa,
+	0x7003, 0x0003, 0x2009, 0x1868, 0x210c, 0x9184, 0xff00, 0x8007,
+	0x9005, 0x1110, 0x2001, 0x0002, 0x7006, 0x0018, 0x7003, 0x0005,
+	0x0c88, 0x00ee, 0x001e, 0x0005, 0x00e6, 0x2071, 0x0050, 0x684c,
+	0x9005, 0x1150, 0x00e6, 0x2071, 0x1910, 0x7028, 0xc085, 0x702a,
+	0x00ee, 0x9085, 0x0001, 0x0488, 0x6844, 0x9005, 0x0158, 0x080c,
+	0x775a, 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, 0x1910, 0x7028, 0xc084, 0x702a, 0x7007,
+	0x0001, 0x700b, 0x0000, 0x00ee, 0x9006, 0x00ee, 0x0005, 0x00e6,
+	0x0026, 0x2071, 0x1948, 0x7000, 0x9015, 0x0904, 0x6c84, 0x9286,
+	0x0003, 0x0904, 0x6b14, 0x9286, 0x0005, 0x0904, 0x6b14, 0x2071,
+	0x1877, 0xa87c, 0x9005, 0x0904, 0x6a75, 0x7140, 0xa868, 0x9102,
+	0x0a04, 0x6c84, 0xa878, 0xd084, 0x15d8, 0xa853, 0x0019, 0x2001,
+	0x8023, 0xa84e, 0x2071, 0x1910, 0x701c, 0x9005, 0x1904, 0x6e27,
+	0x0e04, 0x6e95, 0x2071, 0x0000, 0xa850, 0x7032, 0xa84c, 0x7082,
+	0xa870, 0x7086, 0xa86c, 0x708a, 0xa880, 0x708e, 0x7036, 0x0146,
+	0x01d6, 0x0136, 0x01c6, 0x0156, 0x20e9, 0x0000, 0x20a1, 0x002a,
+	0xa868, 0x20a8, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x0021, 0x2098,
+	0x4003, 0x015e, 0x01ce, 0x013e, 0x01de, 0x014e, 0x2091, 0x4080,
+	0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x11cd, 0x0804, 0x6af7,
+	0xa853, 0x001b, 0x2001, 0x8027, 0x0820, 0x7004, 0xd08c, 0x1904,
+	0x6c84, 0xa853, 0x001a, 0x2001, 0x8024, 0x0804, 0x6a39, 0x00e6,
+	0x0026, 0x2071, 0x1948, 0x7000, 0x9015, 0x0904, 0x6c84, 0x9286,
+	0x0003, 0x0904, 0x6b14, 0x9286, 0x0005, 0x0904, 0x6b14, 0xa84f,
+	0x8022, 0xa853, 0x0018, 0x0804, 0x6adc, 0xa868, 0xd0fc, 0x11d8,
+	0x00e6, 0x0026, 0x2001, 0x1948, 0x2004, 0x9005, 0x0904, 0x6c84,
+	0xa87c, 0xd0bc, 0x1904, 0x6c84, 0xa978, 0xa874, 0x9105, 0x1904,
+	0x6c84, 0x2001, 0x1948, 0x2004, 0x0002, 0x6c84, 0x6ad8, 0x6b14,
+	0x6b14, 0x6c84, 0x6b14, 0x0005, 0xa868, 0xd0fc, 0x1500, 0x00e6,
+	0x0026, 0x2009, 0x1948, 0x210c, 0x81ff, 0x0904, 0x6c84, 0xa87c,
+	0xd0cc, 0x0904, 0x6c84, 0xa880, 0x9084, 0x00ff, 0x9086, 0x0001,
+	0x1904, 0x6c84, 0x9186, 0x0003, 0x0904, 0x6b14, 0x9186, 0x0005,
+	0x0904, 0x6b14, 0xa84f, 0x8021, 0xa853, 0x0017, 0x0028, 0x0005,
+	0xa84f, 0x8020, 0xa853, 0x0016, 0x2071, 0x1910, 0x701c, 0x9005,
+	0x1904, 0x6e27, 0x0e04, 0x6e95, 0x2071, 0x0000, 0xa84c, 0x7082,
+	0xa850, 0x7032, 0xa86c, 0x7086, 0x7036, 0xa870, 0x708a, 0x2091,
+	0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x11cd, 0x2071,
+	0x1800, 0x2011, 0x0001, 0xa804, 0x900d, 0x702c, 0x1158, 0xa802,
+	0x2900, 0x702e, 0x70c0, 0x9200, 0x70c2, 0x080c, 0x8420, 0x002e,
+	0x00ee, 0x0005, 0x0096, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900,
+	0x81ff, 0x1dc8, 0x009e, 0x0c58, 0xa84f, 0x0000, 0x00f6, 0x2079,
+	0x0050, 0x2071, 0x1910, 0xa803, 0x0000, 0x7010, 0x9005, 0x1904,
+	0x6c09, 0x782c, 0x908c, 0x0780, 0x190c, 0x6fe1, 0x8004, 0x8004,
+	0x8004, 0x9084, 0x0003, 0x0002, 0x6b32, 0x6c09, 0x6b57, 0x6ba4,
+	0x080c, 0x0d7d, 0x2071, 0x1800, 0x2900, 0x7822, 0xa804, 0x900d,
+	0x1170, 0x2071, 0x1a01, 0x703c, 0x9005, 0x1328, 0x2001, 0x1949,
+	0x2004, 0x8005, 0x703e, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x9016,
+	0x702c, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8,
+	0x702e, 0x70c0, 0x9200, 0x70c2, 0x080c, 0x8420, 0x0c10, 0x2071,
+	0x1800, 0x2900, 0x7822, 0xa804, 0x900d, 0x15a8, 0x7824, 0x00e6,
+	0x2071, 0x0040, 0x712c, 0xd19c, 0x1170, 0x2009, 0x1830, 0x210c,
+	0x918a, 0x0020, 0x0240, 0x7022, 0x2001, 0x1dc0, 0x200c, 0x8108,
+	0x2102, 0x00ee, 0x0058, 0x00ee, 0x2048, 0x702c, 0xa802, 0x2900,
+	0x702e, 0x70c0, 0x8000, 0x70c2, 0x080c, 0x8420, 0x782c, 0x9094,
+	0x0780, 0x190c, 0x6fe1, 0xd0a4, 0x19c8, 0x2071, 0x1a01, 0x703c,
+	0x9005, 0x1328, 0x2001, 0x1949, 0x2004, 0x8005, 0x703e, 0x00fe,
+	0x002e, 0x00ee, 0x0005, 0x9016, 0x702c, 0x2148, 0xa904, 0xa802,
+	0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e, 0x70c0, 0x9200, 0x70c2,
+	0x080c, 0x8420, 0x0804, 0x6b5e, 0x0096, 0x00e6, 0x7824, 0x2048,
+	0x2071, 0x1800, 0x702c, 0xa802, 0x2900, 0x702e, 0x70c0, 0x8000,
+	0x70c2, 0x080c, 0x8420, 0x782c, 0x9094, 0x0780, 0x190c, 0x6fe1,
+	0xd0a4, 0x1d60, 0x00ee, 0x782c, 0x9094, 0x0780, 0x190c, 0x6fe1,
+	0xd09c, 0x11a0, 0x009e, 0x2900, 0x7822, 0xa804, 0x900d, 0x1560,
+	0x2071, 0x1a01, 0x703c, 0x9005, 0x1328, 0x2001, 0x1949, 0x2004,
+	0x8005, 0x703e, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x009e, 0x2908,
+	0x7010, 0x8000, 0x7012, 0x7018, 0x904d, 0x711a, 0x0110, 0xa902,
+	0x0008, 0x711e, 0x2148, 0xa804, 0x900d, 0x1170, 0x2071, 0x1a01,
+	0x703c, 0x9005, 0x1328, 0x2001, 0x1949, 0x2004, 0x8005, 0x703e,
+	0x00fe, 0x002e, 0x00ee, 0x0005, 0x2071, 0x1800, 0x9016, 0x702c,
+	0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e,
+	0x70c0, 0x9200, 0x70c2, 0x080c, 0x8420, 0x00fe, 0x002e, 0x00ee,
+	0x0005, 0x2908, 0x7010, 0x8000, 0x7012, 0x7018, 0x904d, 0x711a,
+	0x0110, 0xa902, 0x0008, 0x711e, 0x2148, 0xa804, 0x900d, 0x1904,
+	0x6c5e, 0x782c, 0x9094, 0x0780, 0x190c, 0x6fe1, 0xd09c, 0x1198,
+	0x701c, 0x904d, 0x0180, 0x7010, 0x8001, 0x7012, 0x1108, 0x701a,
+	0xa800, 0x701e, 0x2900, 0x7822, 0x782c, 0x9094, 0x0780, 0x190c,
+	0x6fe1, 0xd09c, 0x0d68, 0x782c, 0x9094, 0x0780, 0x190c, 0x6fe1,
+	0xd0a4, 0x01b0, 0x00e6, 0x7824, 0x2048, 0x2071, 0x1800, 0x702c,
+	0xa802, 0x2900, 0x702e, 0x70c0, 0x8000, 0x70c2, 0x080c, 0x8420,
+	0x782c, 0x9094, 0x0780, 0x190c, 0x6fe1, 0xd0a4, 0x1d60, 0x00ee,
+	0x2071, 0x1a01, 0x703c, 0x9005, 0x1328, 0x2001, 0x1949, 0x2004,
+	0x8005, 0x703e, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x00e6, 0x2071,
+	0x1800, 0x9016, 0x702c, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900,
+	0x81ff, 0x1dc8, 0x702e, 0x70c0, 0x9200, 0x70c2, 0x080c, 0x8420,
+	0x00ee, 0x0804, 0x6c19, 0xa868, 0xd0fc, 0x1560, 0x0096, 0xa804,
+	0xa807, 0x0000, 0x904d, 0x190c, 0x0fed, 0x009e, 0x0018, 0xa868,
+	0xd0fc, 0x1500, 0x00e6, 0x0026, 0xa84f, 0x0000, 0x00f6, 0x2079,
+	0x0050, 0x2071, 0x1910, 0xa803, 0x0000, 0x7010, 0x9005, 0x1904,
+	0x6da1, 0x782c, 0x908c, 0x0780, 0x190c, 0x6fe1, 0x8004, 0x8004,
+	0x8004, 0x9084, 0x0003, 0x0002, 0x6ca3, 0x6da1, 0x6cbe, 0x6d30,
+	0x080c, 0x0d7d, 0x0005, 0x2071, 0x1800, 0x2900, 0x7822, 0xa804,
+	0x900d, 0x1120, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x9016, 0x702c,
+	0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e,
+	0x70c0, 0x9200, 0x70c2, 0x080c, 0x8420, 0x0c60, 0x2071, 0x1800,
+	0x2900, 0x7822, 0xa804, 0x900d, 0x1904, 0x6d1f, 0x7830, 0xd0dc,
+	0x1120, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x7824, 0x00e6, 0x2071,
+	0x0040, 0x712c, 0xd19c, 0x1170, 0x2009, 0x1830, 0x210c, 0x918a,
+	0x0020, 0x0240, 0x7022, 0x2001, 0x1dc0, 0x200c, 0x8108, 0x2102,
+	0x00ee, 0x0058, 0x00ee, 0x2048, 0x702c, 0xa802, 0x2900, 0x702e,
+	0x70c0, 0x8000, 0x70c2, 0x080c, 0x8420, 0x782c, 0x9094, 0x0780,
+	0x190c, 0x6fe1, 0xd0a4, 0x19c8, 0x0e04, 0x6d16, 0x7838, 0x7938,
+	0x910e, 0x1de0, 0x00d6, 0x2069, 0x0000, 0x6836, 0x6833, 0x0013,
+	0x00de, 0x2001, 0x1921, 0x200c, 0xc184, 0x2102, 0x2091, 0x4080,
+	0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x11cd, 0x2009, 0x1947,
+	0x200b, 0x0000, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x2001, 0x1921,
+	0x200c, 0xc185, 0x2102, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x9016,
+	0x702c, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8,
+	0x702e, 0x70c0, 0x9200, 0x70c2, 0x080c, 0x8420, 0x0804, 0x6ccd,
+	0x0096, 0x00e6, 0x7824, 0x2048, 0x2071, 0x1800, 0x702c, 0xa802,
+	0x2900, 0x702e, 0x70c0, 0x8000, 0x70c2, 0x080c, 0x8420, 0x782c,
+	0x9094, 0x0780, 0x190c, 0x6fe1, 0xd0a4, 0x1d60, 0x00ee, 0x0e04,
+	0x6d74, 0x7838, 0x7938, 0x910e, 0x1de0, 0x00d6, 0x2069, 0x0000,
+	0x6836, 0x6833, 0x0013, 0x00de, 0x7044, 0xc084, 0x7046, 0x2091,
+	0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x11cd, 0x2009,
+	0x1947, 0x200b, 0x0000, 0x782c, 0x9094, 0x0780, 0x190c, 0x6fe1,
+	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,
+	0x70c0, 0x9200, 0x70c2, 0x080c, 0x8420, 0x00fe, 0x002e, 0x00ee,
+	0x0005, 0x2908, 0x7010, 0x8000, 0x7012, 0x7018, 0x904d, 0x711a,
+	0x0110, 0xa902, 0x0008, 0x711e, 0x2148, 0xa804, 0x900d, 0x1904,
+	0x6e12, 0x782c, 0x9094, 0x0780, 0x190c, 0x6fe1, 0xd09c, 0x11b0,
+	0x701c, 0x904d, 0x0198, 0xa84c, 0x9005, 0x1180, 0x7010, 0x8001,
+	0x7012, 0x1108, 0x701a, 0xa800, 0x701e, 0x2900, 0x7822, 0x782c,
+	0x9094, 0x0780, 0x190c, 0x6fe1, 0xd09c, 0x0d50, 0x782c, 0x9094,
+	0x0780, 0x190c, 0x6fe1, 0xd0a4, 0x05c8, 0x00e6, 0x7824, 0x2048,
+	0x2071, 0x1800, 0x702c, 0xa802, 0x2900, 0x702e, 0x70c0, 0x8000,
+	0x70c2, 0x080c, 0x8420, 0x782c, 0x9094, 0x0780, 0x190c, 0x6fe1,
+	0xd0a4, 0x1d60, 0x00ee, 0x0e04, 0x6e0b, 0x7838, 0x7938, 0x910e,
+	0x1de0, 0x00d6, 0x2069, 0x0000, 0x6836, 0x6833, 0x0013, 0x00de,
+	0x7044, 0xc084, 0x7046, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004,
+	0xd084, 0x190c, 0x11cd, 0x2009, 0x1947, 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, 0x70c0,
+	0x9200, 0x70c2, 0x080c, 0x8420, 0x00ee, 0x0804, 0x6db1, 0x2071,
+	0x1910, 0xa803, 0x0000, 0x2908, 0x7010, 0x8000, 0x7012, 0x7018,
+	0x904d, 0x711a, 0x0110, 0xa902, 0x0008, 0x711e, 0x2148, 0xa804,
+	0x900d, 0x1128, 0x1e04, 0x6e52, 0x002e, 0x00ee, 0x0005, 0x2071,
+	0x1800, 0x9016, 0x702c, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900,
+	0x81ff, 0x1dc8, 0x702e, 0x70c0, 0x9200, 0x70c2, 0x080c, 0x8420,
+	0x0e04, 0x6e3c, 0x2071, 0x1910, 0x701c, 0x2048, 0xa84c, 0x900d,
+	0x0d18, 0x2071, 0x0000, 0x7182, 0xa850, 0x7032, 0xa86c, 0x7086,
+	0x7036, 0xa870, 0x708a, 0xa850, 0x9082, 0x0019, 0x1278, 0x2091,
+	0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x11cd, 0x2071,
+	0x1910, 0x080c, 0x6fcd, 0x002e, 0x00ee, 0x0005, 0xa850, 0x9082,
+	0x001c, 0x1e68, 0xa880, 0x708e, 0x7036, 0x0146, 0x01d6, 0x0136,
+	0x01c6, 0x0156, 0x20e9, 0x0000, 0x20a1, 0x002a, 0xa868, 0x20a8,
+	0xa860, 0x20e0, 0xa85c, 0x9080, 0x0021, 0x2098, 0x4003, 0x015e,
+	0x01ce, 0x013e, 0x01de, 0x014e, 0x0890, 0x2071, 0x1910, 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, 0x70c0,
+	0x9200, 0x70c2, 0x080c, 0x8420, 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, 0x1910,
+	0x7004, 0x0002, 0x6ee0, 0x6ee1, 0x6fcc, 0x6ee1, 0x0d7d, 0x6fcc,
+	0x0005, 0x2001, 0x1948, 0x2004, 0x0002, 0x6eeb, 0x6eeb, 0x6f65,
+	0x6f66, 0x6eeb, 0x6f66, 0x0126, 0x2091, 0x8000, 0x1e0c, 0x6fec,
+	0x701c, 0x904d, 0x0508, 0xa84c, 0x9005, 0x0904, 0x6f36, 0x0e04,
+	0x6f14, 0xa94c, 0x2071, 0x0000, 0x7182, 0xa850, 0x7032, 0xa86c,
+	0x7086, 0x7036, 0xa870, 0x708a, 0xa850, 0x9082, 0x0019, 0x1278,
+	0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x11cd,
+	0x2071, 0x1910, 0x080c, 0x6fcd, 0x012e, 0x0804, 0x6f64, 0xa850,
+	0x9082, 0x001c, 0x1e68, 0xa880, 0x708e, 0x7036, 0x0146, 0x01d6,
+	0x0136, 0x01c6, 0x0156, 0x20e9, 0x0000, 0x20a1, 0x002a, 0xa868,
+	0x20a8, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x0021, 0x2098, 0x4003,
+	0x015e, 0x01ce, 0x013e, 0x01de, 0x014e, 0x0890, 0x2001, 0x005b,
+	0x2004, 0x9094, 0x0780, 0x190c, 0x6fe1, 0xd09c, 0x2071, 0x1910,
+	0x1510, 0x2071, 0x1910, 0x700f, 0x0001, 0xa964, 0x9184, 0x00ff,
+	0x9086, 0x0003, 0x1130, 0x810f, 0x918c, 0x00ff, 0x8101, 0x0108,
+	0x710e, 0x2900, 0x00d6, 0x2069, 0x0050, 0x6822, 0x00de, 0x2071,
+	0x1910, 0x701c, 0x2048, 0x7010, 0x8001, 0x7012, 0xa800, 0x701e,
+	0x9005, 0x1108, 0x701a, 0x012e, 0x0005, 0x0005, 0x00d6, 0x2008,
+	0x2069, 0x1a01, 0x683c, 0x9005, 0x0760, 0x0158, 0x9186, 0x0003,
+	0x0540, 0x2001, 0x1815, 0x2004, 0x2009, 0x1b4c, 0x210c, 0x9102,
+	0x1500, 0x0126, 0x2091, 0x8000, 0x2069, 0x0050, 0x693c, 0x6838,
+	0x9106, 0x0190, 0x0e04, 0x6f98, 0x2069, 0x0000, 0x6837, 0x8040,
+	0x6833, 0x0012, 0x6883, 0x8040, 0x2091, 0x4080, 0x2001, 0x0089,
+	0x2004, 0xd084, 0x190c, 0x11cd, 0x2069, 0x1a01, 0x683f, 0xffff,
+	0x012e, 0x00de, 0x0126, 0x2091, 0x8000, 0x1e0c, 0x7062, 0x701c,
+	0x904d, 0x0540, 0x2001, 0x005b, 0x2004, 0x9094, 0x0780, 0x15c9,
+	0xd09c, 0x1500, 0x2071, 0x1910, 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, 0x106d, 0x0005, 0x012e,
+	0x0005, 0x2091, 0x8000, 0x0e04, 0x6fe3, 0x0006, 0x0016, 0x2001,
+	0x8004, 0x0006, 0x0804, 0x0d86, 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, 0x11cd,
+	0x2009, 0x1947, 0x200b, 0x0000, 0x00fe, 0x009e, 0x0005, 0x782c,
+	0x9094, 0x0780, 0x1971, 0xd0a4, 0x0db8, 0x2009, 0x1947, 0x2104,
+	0x8000, 0x200a, 0x9082, 0x000f, 0x0e78, 0x00e6, 0x2071, 0x1800,
+	0x7824, 0x00e6, 0x2071, 0x0040, 0x712c, 0xd19c, 0x1170, 0x2009,
+	0x1830, 0x210c, 0x918a, 0x0020, 0x0240, 0x7022, 0x2001, 0x1dc0,
+	0x200c, 0x8108, 0x2102, 0x00ee, 0x0058, 0x00ee, 0x2048, 0x702c,
+	0xa802, 0x2900, 0x702e, 0x70c0, 0x8000, 0x70c2, 0x080c, 0x8420,
+	0x782c, 0x9094, 0x0780, 0x190c, 0x6fe1, 0xd0a4, 0x19c8, 0x7838,
+	0x7938, 0x910e, 0x1de0, 0x00d6, 0x2069, 0x0000, 0x6836, 0x6833,
+	0x0013, 0x00de, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084,
+	0x190c, 0x11cd, 0x2009, 0x1947, 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, 0x11cd, 0x00fe, 0x0005, 0x782c,
+	0x9094, 0x0780, 0x190c, 0x6fe1, 0xd0a4, 0x0db8, 0x00e6, 0x2071,
+	0x1800, 0x7824, 0x2048, 0x702c, 0xa802, 0x2900, 0x702e, 0x70c0,
+	0x8000, 0x70c2, 0x080c, 0x8420, 0x782c, 0x9094, 0x0780, 0x190c,
+	0x6fe1, 0xd0a4, 0x1d70, 0x00d6, 0x2069, 0x0050, 0x693c, 0x2069,
+	0x1948, 0x6808, 0x690a, 0x2069, 0x1a01, 0x9102, 0x1118, 0x683c,
+	0x9005, 0x1328, 0x2001, 0x1949, 0x200c, 0x810d, 0x693e, 0x00de,
+	0x00ee, 0x00fe, 0x0005, 0x7098, 0x908a, 0x0029, 0x1a0c, 0x0d7d,
+	0x9082, 0x001d, 0x003b, 0x0026, 0x2011, 0x1e00, 0x080c, 0x2a0b,
+	0x002e, 0x0005, 0x718a, 0x7114, 0x7130, 0x7158, 0x7179, 0x71b9,
+	0x71cb, 0x7130, 0x71a1, 0x70cf, 0x70fd, 0x70ce, 0x0005, 0x00d6,
+	0x2069, 0x0200, 0x6804, 0x9005, 0x1180, 0x6808, 0x9005, 0x1518,
+	0x709b, 0x0028, 0x2069, 0x198d, 0x2d04, 0x7002, 0x080c, 0x7526,
+	0x6028, 0x9085, 0x0600, 0x602a, 0x00b0, 0x709b, 0x0028, 0x2069,
+	0x198d, 0x2d04, 0x7002, 0x6028, 0x9085, 0x0600, 0x602a, 0x00e6,
+	0x0036, 0x0046, 0x0056, 0x2071, 0x1a69, 0x080c, 0x1a9e, 0x005e,
+	0x004e, 0x003e, 0x00ee, 0x00de, 0x0005, 0x00d6, 0x2069, 0x0200,
+	0x6804, 0x9005, 0x1178, 0x6808, 0x9005, 0x1160, 0x709b, 0x0028,
+	0x2069, 0x198d, 0x2d04, 0x7002, 0x080c, 0x75c9, 0x6028, 0x9085,
+	0x0600, 0x602a, 0x00de, 0x0005, 0x0006, 0x2001, 0x0090, 0x080c,
+	0x29d1, 0x000e, 0x6124, 0xd1e4, 0x1190, 0x080c, 0x723c, 0xd1d4,
+	0x1160, 0xd1dc, 0x1138, 0xd1cc, 0x0150, 0x709b, 0x0020, 0x080c,
+	0x723c, 0x0028, 0x709b, 0x001d, 0x0010, 0x709b, 0x001f, 0x0005,
+	0x2001, 0x0088, 0x080c, 0x29d1, 0x6124, 0xd1cc, 0x11d8, 0xd1dc,
+	0x11b0, 0xd1e4, 0x1188, 0x9184, 0x1e00, 0x11c8, 0x60e3, 0x0001,
+	0x600c, 0xc0b4, 0x600e, 0x080c, 0x7410, 0x2001, 0x0080, 0x080c,
+	0x29d1, 0x709b, 0x0028, 0x0058, 0x709b, 0x001e, 0x0040, 0x709b,
+	0x001d, 0x0028, 0x709b, 0x0020, 0x0010, 0x709b, 0x001f, 0x0005,
+	0x60e3, 0x0001, 0x600c, 0xc0b4, 0x600e, 0x080c, 0x7410, 0x2001,
+	0x0080, 0x080c, 0x29d1, 0x6124, 0xd1d4, 0x1180, 0xd1dc, 0x1158,
+	0xd1e4, 0x1130, 0x9184, 0x1e00, 0x1158, 0x709b, 0x0028, 0x0040,
+	0x709b, 0x001e, 0x0028, 0x709b, 0x001d, 0x0010, 0x709b, 0x001f,
+	0x0005, 0x2001, 0x00a0, 0x080c, 0x29d1, 0x6124, 0xd1dc, 0x1138,
+	0xd1e4, 0x0138, 0x080c, 0x1ac8, 0x709b, 0x001e, 0x0010, 0x709b,
+	0x001d, 0x0005, 0x080c, 0x72c5, 0x6124, 0xd1dc, 0x1188, 0x080c,
+	0x723c, 0x0016, 0x080c, 0x1ac8, 0x001e, 0xd1d4, 0x1128, 0xd1e4,
+	0x0138, 0x709b, 0x001e, 0x0020, 0x709b, 0x001f, 0x080c, 0x723c,
+	0x0005, 0x0006, 0x2001, 0x00a0, 0x080c, 0x29d1, 0x000e, 0x6124,
+	0xd1d4, 0x1160, 0xd1cc, 0x1150, 0xd1dc, 0x1128, 0xd1e4, 0x0140,
+	0x709b, 0x001e, 0x0028, 0x709b, 0x001d, 0x0010, 0x709b, 0x0021,
+	0x0005, 0x080c, 0x72c5, 0x6124, 0xd1d4, 0x1150, 0xd1dc, 0x1128,
+	0xd1e4, 0x0140, 0x709b, 0x001e, 0x0028, 0x709b, 0x001d, 0x0010,
+	0x709b, 0x001f, 0x0005, 0x0006, 0x2001, 0x0090, 0x080c, 0x29d1,
+	0x000e, 0x6124, 0xd1d4, 0x1178, 0xd1cc, 0x1150, 0xd1dc, 0x1128,
+	0xd1e4, 0x0158, 0x709b, 0x001e, 0x0040, 0x709b, 0x001d, 0x0028,
+	0x709b, 0x0020, 0x0010, 0x709b, 0x001f, 0x0005, 0x0016, 0x00c6,
+	0x00d6, 0x00e6, 0x0126, 0x2061, 0x0100, 0x2069, 0x0140, 0x2071,
+	0x1800, 0x2091, 0x8000, 0x080c, 0x73e4, 0x11f8, 0x2001, 0x180c,
+	0x200c, 0xd1b4, 0x01d0, 0xc1b4, 0x2102, 0x0026, 0x2011, 0x0200,
+	0x080c, 0x2a0b, 0x002e, 0x080c, 0x29b7, 0x6024, 0xd0cc, 0x0148,
+	0x2001, 0x00a0, 0x080c, 0x29d1, 0x080c, 0x76e8, 0x080c, 0x5f41,
+	0x0428, 0x6028, 0xc0cd, 0x602a, 0x0408, 0x080c, 0x73fe, 0x0150,
+	0x080c, 0x73f5, 0x1138, 0x2001, 0x0001, 0x080c, 0x2574, 0x080c,
+	0x73b8, 0x00a0, 0x080c, 0x72c2, 0x0178, 0x2001, 0x0001, 0x080c,
+	0x2574, 0x7098, 0x9086, 0x001e, 0x0120, 0x7098, 0x9086, 0x0022,
+	0x1118, 0x709b, 0x0025, 0x0010, 0x709b, 0x0021, 0x012e, 0x00ee,
+	0x00de, 0x00ce, 0x001e, 0x0005, 0x0026, 0x2011, 0x724d, 0x080c,
+	0x8614, 0x002e, 0x0016, 0x0026, 0x2009, 0x0064, 0x2011, 0x724d,
+	0x080c, 0x860b, 0x002e, 0x001e, 0x0005, 0x00e6, 0x00f6, 0x0016,
+	0x080c, 0x9d09, 0x2071, 0x1800, 0x080c, 0x71e6, 0x001e, 0x00fe,
+	0x00ee, 0x0005, 0x0016, 0x0026, 0x0036, 0x00c6, 0x00d6, 0x00e6,
+	0x00f6, 0x0126, 0x080c, 0x9d09, 0x2061, 0x0100, 0x2069, 0x0140,
+	0x2071, 0x1800, 0x2091, 0x8000, 0x6028, 0xc09c, 0x602a, 0x080c,
+	0xa781, 0x2011, 0x0003, 0x080c, 0xa0a6, 0x2011, 0x0002, 0x080c,
+	0xa0b0, 0x080c, 0x9f6f, 0x080c, 0x85c0, 0x0036, 0x901e, 0x080c,
+	0x9fef, 0x003e, 0x080c, 0xa79d, 0x60e3, 0x0000, 0x080c, 0xe59b,
+	0x080c, 0xe5b6, 0x2009, 0x0004, 0x080c, 0x29bd, 0x080c, 0x28ea,
+	0x2001, 0x1800, 0x2003, 0x0004, 0x2011, 0x0008, 0x080c, 0x2a0b,
+	0x2011, 0x724d, 0x080c, 0x8614, 0x080c, 0x73fe, 0x0118, 0x9006,
+	0x080c, 0x29d1, 0x080c, 0x0bc3, 0x2001, 0x0001, 0x080c, 0x2574,
+	0x012e, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x003e, 0x002e, 0x001e,
+	0x0005, 0x0026, 0x00e6, 0x2011, 0x725a, 0x2071, 0x1a01, 0x701c,
+	0x9206, 0x1118, 0x7018, 0x9005, 0x0110, 0x9085, 0x0001, 0x00ee,
+	0x002e, 0x0005, 0x6020, 0xd09c, 0x0005, 0x6800, 0x9084, 0xfffe,
+	0x9086, 0x00c0, 0x01b8, 0x2001, 0x00c0, 0x080c, 0x29d1, 0x0156,
+	0x20a9, 0x002d, 0x1d04, 0x72d2, 0x2091, 0x6000, 0x1f04, 0x72d2,
+	0x015e, 0x00d6, 0x2069, 0x1800, 0x689c, 0x8001, 0x0220, 0x0118,
+	0x689e, 0x00de, 0x0005, 0x689f, 0x0014, 0x68ec, 0xd0dc, 0x0dc8,
+	0x6800, 0x9086, 0x0001, 0x1da8, 0x080c, 0x8620, 0x0c90, 0x00c6,
+	0x00d6, 0x00e6, 0x2061, 0x0100, 0x2069, 0x0140, 0x2071, 0x1800,
+	0x080c, 0x76f7, 0x2001, 0x196d, 0x2003, 0x0000, 0x9006, 0x709a,
+	0x60e2, 0x6886, 0x080c, 0x2643, 0x9006, 0x080c, 0x29d1, 0x080c,
+	0x5dfc, 0x0026, 0x2011, 0xffff, 0x080c, 0x2a0b, 0x002e, 0x602b,
+	0x182c, 0x00ee, 0x00de, 0x00ce, 0x0005, 0x00c6, 0x00d6, 0x00e6,
+	0x2061, 0x0100, 0x2069, 0x0140, 0x2071, 0x1800, 0x2001, 0x197d,
+	0x200c, 0x9186, 0x0000, 0x0158, 0x9186, 0x0001, 0x0158, 0x9186,
+	0x0002, 0x0158, 0x9186, 0x0003, 0x0158, 0x0804, 0x73a8, 0x709b,
+	0x0022, 0x0040, 0x709b, 0x0021, 0x0028, 0x709b, 0x0023, 0x0010,
+	0x709b, 0x0024, 0x60e3, 0x0000, 0x6887, 0x0001, 0x2001, 0x0001,
+	0x080c, 0x2643, 0x080c, 0xa781, 0x0026, 0x080c, 0xaa49, 0x002e,
+	0x080c, 0xa79d, 0x7000, 0x908e, 0x0004, 0x0118, 0x602b, 0x0028,
+	0x0010, 0x602b, 0x0020, 0x0156, 0x0126, 0x2091, 0x8000, 0x20a9,
+	0x0005, 0x6024, 0xd0ac, 0x0150, 0x012e, 0x015e, 0x080c, 0xce35,
+	0x0118, 0x9006, 0x080c, 0x29fb, 0x0804, 0x73b4, 0x6800, 0x9084,
+	0x00a1, 0xc0bd, 0x6802, 0x080c, 0x29b7, 0x6904, 0xd1d4, 0x1140,
+	0x2001, 0x0100, 0x080c, 0x29d1, 0x1f04, 0x7359, 0x080c, 0x743b,
+	0x012e, 0x015e, 0x080c, 0x73f5, 0x0170, 0x6044, 0x9005, 0x0130,
+	0x080c, 0x743b, 0x9006, 0x8001, 0x1df0, 0x0028, 0x6804, 0xd0d4,
+	0x1110, 0x080c, 0x743b, 0x080c, 0xce35, 0x0118, 0x9006, 0x080c,
+	0x29fb, 0x0016, 0x0026, 0x7000, 0x908e, 0x0004, 0x0130, 0x2009,
+	0x00c8, 0x2011, 0x725a, 0x080c, 0x85d2, 0x002e, 0x001e, 0x080c,
+	0x8417, 0x7034, 0xc085, 0x7036, 0x2001, 0x197d, 0x2003, 0x0004,
+	0x080c, 0x70b3, 0x080c, 0x73f5, 0x0138, 0x6804, 0xd0d4, 0x1120,
+	0xd0dc, 0x1100, 0x080c, 0x76ed, 0x00ee, 0x00de, 0x00ce, 0x0005,
+	0x00c6, 0x00d6, 0x00e6, 0x2061, 0x0100, 0x2069, 0x0140, 0x2071,
+	0x1800, 0x080c, 0x842e, 0x080c, 0x8420, 0x080c, 0x76f7, 0x2001,
+	0x196d, 0x2003, 0x0000, 0x9006, 0x709a, 0x60e2, 0x6886, 0x080c,
+	0x2643, 0x9006, 0x080c, 0x29d1, 0x6043, 0x0090, 0x6043, 0x0010,
+	0x0026, 0x2011, 0xffff, 0x080c, 0x2a0b, 0x002e, 0x602b, 0x182c,
+	0x00ee, 0x00de, 0x00ce, 0x0005, 0x0006, 0x2001, 0x197c, 0x2004,
+	0x9086, 0xaaaa, 0x000e, 0x0005, 0x0006, 0x080c, 0x5600, 0x9084,
+	0x0030, 0x9086, 0x0000, 0x000e, 0x0005, 0x0006, 0x080c, 0x5600,
+	0x9084, 0x0030, 0x9086, 0x0030, 0x000e, 0x0005, 0x0006, 0x080c,
+	0x5600, 0x9084, 0x0030, 0x9086, 0x0010, 0x000e, 0x0005, 0x0006,
+	0x080c, 0x5600, 0x9084, 0x0030, 0x9086, 0x0020, 0x000e, 0x0005,
+	0x0036, 0x0016, 0x2001, 0x180c, 0x2004, 0x908c, 0x0013, 0x0180,
+	0x0020, 0x080c, 0x2663, 0x900e, 0x0028, 0x080c, 0x6962, 0x1dc8,
+	0x2009, 0x0002, 0x2019, 0x0028, 0x080c, 0x316a, 0x9006, 0x0019,
+	0x001e, 0x003e, 0x0005, 0x00e6, 0x2071, 0x180c, 0x2e04, 0x0130,
+	0x080c, 0xce2e, 0x1128, 0x9085, 0x0010, 0x0010, 0x9084, 0xffef,
+	0x2072, 0x00ee, 0x0005, 0x6050, 0x0006, 0x60ec, 0x0006, 0x600c,
+	0x0006, 0x6004, 0x0006, 0x6028, 0x0006, 0x602f, 0x0100, 0x602f,
+	0x0000, 0x602f, 0x0040, 0x602f, 0x0000, 0x20a9, 0x0002, 0x080c,
+	0x2998, 0x0026, 0x2011, 0x0040, 0x080c, 0x2a0b, 0x002e, 0x000e,
+	0x602a, 0x000e, 0x6006, 0x000e, 0x600e, 0x000e, 0x60ee, 0x60e3,
+	0x0000, 0x6887, 0x0001, 0x2001, 0x0001, 0x080c, 0x2643, 0x2001,
+	0x00a0, 0x0006, 0x080c, 0xce35, 0x000e, 0x0130, 0x080c, 0x29ef,
+	0x9006, 0x080c, 0x29fb, 0x0010, 0x080c, 0x29d1, 0x000e, 0x6052,
+	0x6050, 0x0006, 0xc0e5, 0x6052, 0x00f6, 0x2079, 0x0100, 0x080c,
+	0x2948, 0x00fe, 0x000e, 0x6052, 0x0005, 0x0156, 0x0016, 0x0026,
+	0x0036, 0x00c6, 0x00d6, 0x00e6, 0x2061, 0x0100, 0x2069, 0x0140,
+	0x2071, 0x1800, 0x080c, 0xa7df, 0x0158, 0x2001, 0x0386, 0x2004,
+	0xd0b4, 0x1130, 0x2001, 0x0016, 0x080c, 0xa772, 0x0804, 0x7518,
+	0x2001, 0x180c, 0x200c, 0xc1c4, 0x2102, 0x6028, 0x9084, 0xe1ff,
+	0x602a, 0x2011, 0x0200, 0x080c, 0x2a0b, 0x2001, 0x0090, 0x080c,
+	0x29d1, 0x20a9, 0x0366, 0x6024, 0xd0cc, 0x1558, 0x1d04, 0x74b3,
+	0x2091, 0x6000, 0x1f04, 0x74b3, 0x080c, 0xa781, 0x2011, 0x0003,
+	0x080c, 0xa0a6, 0x2011, 0x0002, 0x080c, 0xa0b0, 0x080c, 0x9f6f,
+	0x901e, 0x080c, 0x9fef, 0x2001, 0x0386, 0x2003, 0x7000, 0x080c,
+	0xa79d, 0x2001, 0x00a0, 0x080c, 0x29d1, 0x080c, 0x76e8, 0x080c,
+	0x5f41, 0x080c, 0xce35, 0x0110, 0x080c, 0x0ce9, 0x9085, 0x0001,
+	0x04e8, 0x2001, 0x0386, 0x2004, 0xd0ac, 0x0110, 0x080c, 0x1ac8,
+	0x60e3, 0x0000, 0x2001, 0x196d, 0x2004, 0x080c, 0x2643, 0x60e2,
+	0x2001, 0x0080, 0x080c, 0x29d1, 0x20a9, 0x0366, 0x2011, 0x1e00,
+	0x080c, 0x2a0b, 0x2009, 0x1e00, 0x080c, 0x29b7, 0x6024, 0x910c,
+	0x0140, 0x1d04, 0x74f6, 0x2091, 0x6000, 0x1f04, 0x74f6, 0x0804,
+	0x74bc, 0x2001, 0x0386, 0x2003, 0x7000, 0x6028, 0x9085, 0x1e00,
+	0x602a, 0x70b4, 0x9005, 0x1118, 0x6887, 0x0001, 0x0008, 0x6886,
+	0x080c, 0xce35, 0x0110, 0x080c, 0x0ce9, 0x9006, 0x00ee, 0x00de,
+	0x00ce, 0x003e, 0x002e, 0x001e, 0x015e, 0x0005, 0x0156, 0x0016,
+	0x0026, 0x0036, 0x00c6, 0x00d6, 0x00e6, 0x2061, 0x0100, 0x2071,
+	0x1800, 0x7000, 0x9086, 0x0003, 0x1168, 0x2001, 0x020b, 0x2004,
+	0x9084, 0x5540, 0x9086, 0x5540, 0x1128, 0x2069, 0x1a75, 0x2d04,
+	0x8000, 0x206a, 0x2069, 0x0140, 0x6020, 0x9084, 0x00c0, 0x0120,
+	0x6884, 0x9005, 0x1904, 0x758f, 0x2001, 0x0088, 0x080c, 0x29d1,
+	0x9006, 0x60e2, 0x6886, 0x080c, 0x2643, 0x2069, 0x0200, 0x6804,
+	0x9005, 0x1118, 0x6808, 0x9005, 0x01d0, 0x6028, 0x9084, 0xfbff,
+	0x602a, 0x2011, 0x0400, 0x080c, 0x2a0b, 0x2069, 0x198d, 0x7000,
+	0x206a, 0x709b, 0x0026, 0x7003, 0x0001, 0x20a9, 0x0002, 0x1d04,
+	0x756f, 0x2091, 0x6000, 0x1f04, 0x756f, 0x0804, 0x75c1, 0x2069,
+	0x0140, 0x20a9, 0x0384, 0x2011, 0x1e00, 0x080c, 0x2a0b, 0x2009,
+	0x1e00, 0x080c, 0x29b7, 0x6024, 0x910c, 0x0528, 0x9084, 0x1a00,
+	0x1510, 0x1d04, 0x757b, 0x2091, 0x6000, 0x1f04, 0x757b, 0x080c,
+	0xa781, 0x2011, 0x0003, 0x080c, 0xa0a6, 0x2011, 0x0002, 0x080c,
+	0xa0b0, 0x080c, 0x9f6f, 0x901e, 0x080c, 0x9fef, 0x080c, 0xa79d,
+	0x2001, 0x00a0, 0x080c, 0x29d1, 0x080c, 0x76e8, 0x080c, 0x5f41,
+	0x9085, 0x0001, 0x00b0, 0x2001, 0x0080, 0x080c, 0x29d1, 0x2069,
+	0x0140, 0x60e3, 0x0000, 0x70b4, 0x9005, 0x1118, 0x6887, 0x0001,
+	0x0008, 0x6886, 0x2001, 0x196d, 0x2004, 0x080c, 0x2643, 0x60e2,
+	0x9006, 0x00ee, 0x00de, 0x00ce, 0x003e, 0x002e, 0x001e, 0x015e,
+	0x0005, 0x0156, 0x0016, 0x0026, 0x0036, 0x00c6, 0x00d6, 0x00e6,
+	0x2061, 0x0100, 0x2071, 0x1800, 0x6020, 0x9084, 0x00c0, 0x01e8,
+	0x080c, 0xa781, 0x2011, 0x0003, 0x080c, 0xa0a6, 0x2011, 0x0002,
+	0x080c, 0xa0b0, 0x080c, 0x9f6f, 0x901e, 0x080c, 0x9fef, 0x080c,
+	0xa79d, 0x2069, 0x0140, 0x2001, 0x00a0, 0x080c, 0x29d1, 0x080c,
+	0x76e8, 0x080c, 0x5f41, 0x0804, 0x7664, 0x2001, 0x180c, 0x200c,
+	0xd1b4, 0x1160, 0xc1b5, 0x2102, 0x080c, 0x7242, 0x2069, 0x0140,
+	0x2001, 0x0080, 0x080c, 0x29d1, 0x60e3, 0x0000, 0x2069, 0x0200,
+	0x6804, 0x9005, 0x1118, 0x6808, 0x9005, 0x0190, 0x6028, 0x9084,
+	0xfdff, 0x602a, 0x2011, 0x0200, 0x080c, 0x2a0b, 0x2069, 0x198d,
+	0x7000, 0x206a, 0x709b, 0x0027, 0x7003, 0x0001, 0x0804, 0x7664,
+	0x2011, 0x1e00, 0x080c, 0x2a0b, 0x2009, 0x1e00, 0x080c, 0x29b7,
+	0x6024, 0x910c, 0x01c8, 0x9084, 0x1c00, 0x11b0, 0x1d04, 0x7620,
+	0x0006, 0x0016, 0x00c6, 0x00d6, 0x00e6, 0x080c, 0x845f, 0x00ee,
+	0x00de, 0x00ce, 0x001e, 0x000e, 0x00e6, 0x2071, 0x1a01, 0x7018,
+	0x00ee, 0x9005, 0x19e8, 0x0500, 0x0026, 0x2011, 0x725a, 0x080c,
+	0x850b, 0x2011, 0x724d, 0x080c, 0x8614, 0x002e, 0x2069, 0x0140,
+	0x60e3, 0x0000, 0x70b4, 0x9005, 0x1118, 0x6887, 0x0001, 0x0008,
+	0x6886, 0x2001, 0x196d, 0x2004, 0x080c, 0x2643, 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,
+	0xce2e, 0x1904, 0x76d2, 0x7130, 0xd184, 0x1170, 0x080c, 0x3328,
+	0x0138, 0xc18d, 0x7132, 0x2011, 0x1848, 0x2214, 0xd2ac, 0x1120,
+	0x7030, 0xd08c, 0x0904, 0x76d2, 0x2011, 0x1848, 0x220c, 0xd1a4,
+	0x0538, 0x0016, 0x2019, 0x000e, 0x080c, 0xe101, 0x0156, 0x00b6,
+	0x20a9, 0x007f, 0x900e, 0x9186, 0x007e, 0x01a0, 0x9186, 0x0080,
+	0x0188, 0x080c, 0x652d, 0x1170, 0x2120, 0x9006, 0x0016, 0x2009,
+	0x000e, 0x080c, 0xe191, 0x2009, 0x0001, 0x2011, 0x0100, 0x080c,
+	0x87b6, 0x001e, 0x8108, 0x1f04, 0x769b, 0x00be, 0x015e, 0x001e,
+	0xd1ac, 0x1148, 0x0016, 0x2009, 0x0002, 0x2019, 0x0004, 0x080c,
+	0x316a, 0x001e, 0x0078, 0x0156, 0x00b6, 0x20a9, 0x007f, 0x900e,
+	0x080c, 0x652d, 0x1110, 0x080c, 0x5f5b, 0x8108, 0x1f04, 0x76c8,
+	0x00be, 0x015e, 0x080c, 0x1ac8, 0x080c, 0xa781, 0x080c, 0xaa49,
+	0x080c, 0xa79d, 0x60e3, 0x0000, 0x080c, 0x5f41, 0x080c, 0x7315,
+	0x00ee, 0x00ce, 0x004e, 0x003e, 0x002e, 0x001e, 0x015e, 0x0005,
+	0x2001, 0x197d, 0x2003, 0x0001, 0x0005, 0x2001, 0x197d, 0x2003,
+	0x0000, 0x0005, 0x2001, 0x197c, 0x2003, 0xaaaa, 0x0005, 0x2001,
+	0x197c, 0x2003, 0x0000, 0x0005, 0x2071, 0x18fa, 0x7003, 0x0000,
+	0x7007, 0x0000, 0x080c, 0x1054, 0x090c, 0x0d7d, 0xa8ab, 0xdcb0,
+	0x2900, 0x704e, 0x080c, 0x1054, 0x090c, 0x0d7d, 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, 0x18fa, 0x6807, 0x0001, 0x00de, 0x080c, 0x7cdf, 0x9006,
+	0x00ee, 0x0005, 0x900e, 0x0156, 0x20a9, 0x0006, 0x8003, 0x818d,
+	0x1f04, 0x775e, 0x015e, 0x0005, 0x2079, 0x0040, 0x2071, 0x18fa,
+	0x7004, 0x0002, 0x7774, 0x7775, 0x77c0, 0x781b, 0x792b, 0x7772,
+	0x7772, 0x7955, 0x080c, 0x0d7d, 0x0005, 0x2079, 0x0040, 0x2001,
+	0x1dc0, 0x2003, 0x0000, 0x782c, 0x908c, 0x0780, 0x190c, 0x7dc1,
+	0xd0a4, 0x0570, 0x2001, 0x1dc0, 0x2004, 0x9082, 0x0080, 0x1640,
+	0x1d04, 0x7792, 0x2001, 0x1a04, 0x200c, 0x8109, 0x0508, 0x2091,
+	0x6000, 0x2102, 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, 0x1968, 0x080c, 0x781b,
+	0x782c, 0xd09c, 0x090c, 0x7cdf, 0x0005, 0x9082, 0x005a, 0x1218,
+	0x2100, 0x003b, 0x0c18, 0x080c, 0x7851, 0x0c90, 0x00e3, 0x08f0,
+	0x0005, 0x7851, 0x7851, 0x7851, 0x7851, 0x7851, 0x7851, 0x7851,
+	0x7851, 0x7873, 0x7851, 0x7851, 0x7851, 0x7851, 0x7851, 0x7851,
+	0x7851, 0x7851, 0x7851, 0x7851, 0x7851, 0x7851, 0x7851, 0x7851,
+	0x7851, 0x7851, 0x7851, 0x7851, 0x7851, 0x785d, 0x7851, 0x7a46,
+	0x7851, 0x7851, 0x7851, 0x7851, 0x7851, 0x785d, 0x7a87, 0x7ac8,
+	0x7b0f, 0x7b23, 0x7851, 0x7851, 0x7873, 0x785d, 0x7887, 0x7851,
+	0x78ff, 0x7bce, 0x7be9, 0x7851, 0x7873, 0x7851, 0x7887, 0x7851,
+	0x7851, 0x78f5, 0x7be9, 0x7851, 0x7851, 0x7851, 0x7851, 0x7851,
+	0x7851, 0x7851, 0x7851, 0x7851, 0x789b, 0x7851, 0x7851, 0x7851,
+	0x7851, 0x7851, 0x7851, 0x7851, 0x7851, 0x7851, 0x7d65, 0x7851,
+	0x7d0f, 0x7851, 0x7d0f, 0x7851, 0x78b0, 0x7851, 0x7851, 0x7851,
+	0x7851, 0x7851, 0x7851, 0x2079, 0x0040, 0x7004, 0x9086, 0x0003,
+	0x1198, 0x782c, 0x080c, 0x7d08, 0xd0a4, 0x0170, 0x7824, 0x2048,
+	0x9006, 0xa802, 0xa806, 0xa864, 0x9084, 0x00ff, 0x908a, 0x001a,
+	0x1210, 0x002b, 0x0c50, 0x00e9, 0x080c, 0x7cdf, 0x0005, 0x7851,
+	0x785d, 0x7a32, 0x7851, 0x785d, 0x7851, 0x785d, 0x785d, 0x7851,
+	0x785d, 0x7a32, 0x785d, 0x785d, 0x785d, 0x785d, 0x785d, 0x7851,
+	0x785d, 0x7a32, 0x7851, 0x7851, 0x785d, 0x7851, 0x7851, 0x7851,
+	0x785d, 0x00e6, 0x2071, 0x18fa, 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,
+	0x6c7f, 0x012e, 0x0005, 0xa864, 0x8007, 0x9084, 0x00ff, 0x0d08,
+	0x8001, 0x1120, 0x7007, 0x0001, 0x0804, 0x79d4, 0x7007, 0x0003,
+	0x7012, 0x2900, 0x7016, 0x701a, 0x704b, 0x79d4, 0x0005, 0xa864,
+	0x8007, 0x9084, 0x00ff, 0x0968, 0x8001, 0x1120, 0x7007, 0x0001,
+	0x0804, 0x79ef, 0x7007, 0x0003, 0x7012, 0x2900, 0x7016, 0x701a,
+	0x704b, 0x79ef, 0x0005, 0xa864, 0x8007, 0x9084, 0x00ff, 0x0904,
+	0x7859, 0x8001, 0x1120, 0x7007, 0x0001, 0x0804, 0x7a0b, 0x7007,
+	0x0003, 0x7012, 0x2900, 0x7016, 0x701a, 0x704b, 0x7a0b, 0x0005,
+	0xa864, 0x8007, 0x9084, 0x00ff, 0x9086, 0x0001, 0x1904, 0x7859,
+	0x7007, 0x0001, 0x2009, 0x1834, 0x210c, 0x81ff, 0x11a8, 0xa868,
+	0x9084, 0x00ff, 0xa86a, 0xa883, 0x0000, 0x080c, 0x61d1, 0x1108,
+	0x0005, 0x0126, 0x2091, 0x8000, 0xa867, 0x0139, 0xa87a, 0xa982,
+	0x080c, 0x6c7f, 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, 0x7c00, 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,
+	0x7861, 0xaab4, 0x928a, 0x0002, 0x1a04, 0x7861, 0x82ff, 0x1138,
+	0xa8b8, 0xa9bc, 0x9105, 0x0118, 0x2001, 0x7992, 0x0018, 0x9280,
+	0x7988, 0x2005, 0x7056, 0x7010, 0x9015, 0x0904, 0x7973, 0x080c,
+	0x1054, 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, 0x111b, 0xa06c, 0x908e, 0x0100,
+	0x0170, 0x9086, 0x0200, 0x0118, 0x7007, 0x0007, 0x0005, 0x7020,
+	0x2048, 0x080c, 0x106d, 0x7014, 0x2048, 0x0804, 0x7861, 0x7020,
+	0x2048, 0x7018, 0xa802, 0xa807, 0x0000, 0x2908, 0x2048, 0xa906,
+	0x711a, 0x0804, 0x792b, 0x7014, 0x2048, 0x7007, 0x0001, 0xa8b4,
+	0x9005, 0x1128, 0xa8b8, 0xa9bc, 0x9105, 0x0108, 0x00b9, 0xa864,
+	0x9084, 0x00ff, 0x9086, 0x001e, 0x0904, 0x7c00, 0x0804, 0x79d4,
+	0x798a, 0x798e, 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, 0x1834, 0x210c, 0x81ff,
+	0x1178, 0x080c, 0x5fd3, 0x1108, 0x0005, 0x080c, 0x6ebf, 0x0126,
+	0x2091, 0x8000, 0x080c, 0xca1a, 0x080c, 0x6c7f, 0x012e, 0x0ca0,
+	0x080c, 0xce2e, 0x1d70, 0x2001, 0x0028, 0x900e, 0x0c70, 0x2009,
+	0x1834, 0x210c, 0x81ff, 0x1188, 0xa888, 0x9005, 0x0188, 0xa883,
+	0x0000, 0x080c, 0x6061, 0x1108, 0x0005, 0xa87a, 0x0126, 0x2091,
+	0x8000, 0x080c, 0x6c7f, 0x012e, 0x0cb8, 0x2001, 0x0028, 0x0ca8,
+	0x2001, 0x0000, 0x0c90, 0x2009, 0x1834, 0x210c, 0x81ff, 0x11d8,
+	0xa888, 0x9005, 0x01e0, 0xa883, 0x0000, 0xa87c, 0xd0f4, 0x0120,
+	0x080c, 0x6133, 0x1138, 0x0005, 0x9006, 0xa87a, 0x080c, 0x60ae,
+	0x1108, 0x0005, 0x0126, 0x2091, 0x8000, 0xa87a, 0xa982, 0x080c,
+	0x6c7f, 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, 0x652d,
+	0x11b8, 0x0066, 0xae80, 0x080c, 0x663d, 0x006e, 0x0088, 0x0046,
+	0x2011, 0x180c, 0x2224, 0xc484, 0x2412, 0x004e, 0x00c6, 0x080c,
+	0x652d, 0x1110, 0x080c, 0x680c, 0x8108, 0x1f04, 0x7a6f, 0x00ce,
+	0xa87c, 0xd084, 0x1120, 0x080c, 0x106d, 0x00be, 0x0005, 0x0126,
+	0x2091, 0x8000, 0x080c, 0x6c7f, 0x012e, 0x00be, 0x0005, 0x0126,
+	0x2091, 0x8000, 0x7007, 0x0001, 0x080c, 0x6966, 0x0580, 0x2061,
+	0x1a6d, 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, 0x7cc9, 0x012e,
+	0x0804, 0x7cc3, 0x012e, 0x0804, 0x7cbd, 0x012e, 0x0804, 0x7cc0,
+	0x0126, 0x2091, 0x8000, 0x7007, 0x0001, 0x080c, 0x6966, 0x05e0,
+	0x2061, 0x1a6d, 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,
+	0x7cc9, 0x012e, 0x0804, 0x7cc6, 0x012e, 0x0804, 0x7cc3, 0x0126,
+	0x2091, 0x8000, 0x7007, 0x0001, 0x2061, 0x1a6d, 0x6300, 0xd38c,
+	0x1120, 0x6308, 0x8318, 0x0220, 0x630a, 0x012e, 0x0804, 0x7cd7,
+	0x012e, 0x0804, 0x7cc6, 0x00b6, 0x0126, 0x00c6, 0x2091, 0x8000,
+	0x7007, 0x0001, 0xa87c, 0xd0ac, 0x0148, 0x00c6, 0x2061, 0x1a6d,
+	0x6000, 0x9084, 0xfcff, 0x6002, 0x00ce, 0x0440, 0xa888, 0x9005,
+	0x05d8, 0xa88c, 0x9065, 0x0598, 0x2001, 0x1834, 0x2004, 0x9005,
+	0x0118, 0x080c, 0xab13, 0x0068, 0x6017, 0xf400, 0x6063, 0x0000,
+	0xa97c, 0xd1a4, 0x0110, 0xa980, 0x6162, 0x2009, 0x0041, 0x080c,
+	0xab77, 0xa988, 0x918c, 0xff00, 0x9186, 0x2000, 0x1138, 0x0026,
+	0x900e, 0x2011, 0xfdff, 0x080c, 0x87b6, 0x002e, 0xa87c, 0xd0c4,
+	0x0148, 0x2061, 0x1a6d, 0x6000, 0xd08c, 0x1120, 0x6008, 0x8000,
+	0x0208, 0x600a, 0x00ce, 0x012e, 0x00be, 0x0804, 0x7cc9, 0x00ce,
+	0x012e, 0x00be, 0x0804, 0x7cc3, 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, 0x652d,
+	0x1968, 0xb800, 0xc0e4, 0xb802, 0x0848, 0xa88c, 0x9065, 0x09b8,
+	0x6007, 0x0024, 0x2001, 0x1984, 0x2004, 0x601a, 0x0804, 0x7b5e,
+	0xa88c, 0x9065, 0x0960, 0x00e6, 0xa890, 0x9075, 0x2001, 0x1834,
+	0x2004, 0x9005, 0x0150, 0x080c, 0xab13, 0x8eff, 0x0118, 0x2e60,
+	0x080c, 0xab13, 0x00ee, 0x0804, 0x7b5e, 0x6024, 0xc0dc, 0xc0d5,
+	0x6026, 0x2e60, 0x6007, 0x003a, 0xa8a0, 0x9005, 0x0130, 0x6007,
+	0x003b, 0xa8a4, 0x602e, 0xa8a8, 0x6016, 0x6003, 0x0001, 0x2009,
+	0x8020, 0x080c, 0x90e8, 0x00ee, 0x0804, 0x7b5e, 0x2061, 0x1a6d,
+	0x6000, 0xd084, 0x0190, 0xd08c, 0x1904, 0x7cd7, 0x0126, 0x2091,
+	0x8000, 0x6204, 0x8210, 0x0220, 0x6206, 0x012e, 0x0804, 0x7cd7,
+	0x012e, 0xa883, 0x0016, 0x0804, 0x7cd0, 0xa883, 0x0007, 0x0804,
+	0x7cd0, 0xa864, 0x8007, 0x9084, 0x00ff, 0x0130, 0x8001, 0x1138,
+	0x7007, 0x0001, 0x0069, 0x0005, 0x080c, 0x7859, 0x0040, 0x7007,
+	0x0003, 0x7012, 0x2900, 0x7016, 0x701a, 0x704b, 0x7c00, 0x0005,
+	0x00b6, 0x00e6, 0x0126, 0x2091, 0x8000, 0x903e, 0x2061, 0x1800,
+	0x61d0, 0x81ff, 0x1904, 0x7c82, 0x6130, 0xd194, 0x1904, 0x7cac,
+	0xa878, 0x2070, 0x9e82, 0x1ddc, 0x0a04, 0x7c76, 0x6068, 0x9e02,
+	0x1a04, 0x7c76, 0x7120, 0x9186, 0x0006, 0x1904, 0x7c68, 0x7010,
+	0x905d, 0x0904, 0x7c82, 0xb800, 0xd0e4, 0x1904, 0x7ca6, 0x2061,
+	0x1a6d, 0x6100, 0x9184, 0x0301, 0x9086, 0x0001, 0x15a0, 0x7024,
+	0xd0dc, 0x1904, 0x7caf, 0xa883, 0x0000, 0xa803, 0x0000, 0x2908,
+	0x7014, 0x9005, 0x1198, 0x7116, 0xa87c, 0xd0f4, 0x1904, 0x7cb2,
+	0x080c, 0x55fc, 0xd09c, 0x1118, 0xa87c, 0xc0cc, 0xa87e, 0x2e60,
+	0x080c, 0x86a9, 0x012e, 0x00ee, 0x00be, 0x0005, 0x2048, 0xa800,
+	0x9005, 0x1de0, 0xa902, 0x2148, 0xa87c, 0xd0f4, 0x1904, 0x7cb2,
+	0x012e, 0x00ee, 0x00be, 0x0005, 0x012e, 0x00ee, 0xa883, 0x0006,
+	0x00be, 0x0804, 0x7cd0, 0xd184, 0x0db8, 0xd1c4, 0x1190, 0x00a0,
+	0xa974, 0x080c, 0x652d, 0x15d0, 0xb800, 0xd0e4, 0x15b8, 0x7120,
+	0x9186, 0x0007, 0x1118, 0xa883, 0x0002, 0x0490, 0xa883, 0x0008,
+	0x0478, 0xa883, 0x000e, 0x0460, 0xa883, 0x0017, 0x0448, 0xa883,
+	0x0035, 0x0430, 0x080c, 0x5600, 0xd0fc, 0x01e8, 0xa878, 0x2070,
+	0x9e82, 0x1ddc, 0x02c0, 0x6068, 0x9e02, 0x12a8, 0x7120, 0x9186,
+	0x0006, 0x1188, 0x7010, 0x905d, 0x0170, 0xb800, 0xd0bc, 0x0158,
+	0x2039, 0x0001, 0x7000, 0x9086, 0x0007, 0x1904, 0x7c0c, 0x7003,
+	0x0002, 0x0804, 0x7c0c, 0xa883, 0x0028, 0x0010, 0xa883, 0x0029,
+	0x012e, 0x00ee, 0x00be, 0x0420, 0xa883, 0x002a, 0x0cc8, 0xa883,
+	0x0045, 0x0cb0, 0x2e60, 0x2019, 0x0002, 0x601b, 0x0014, 0x080c,
+	0xdce5, 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, 0x6c7f, 0x012e, 0x0005, 0x080c,
+	0x106d, 0x0005, 0x00d6, 0x080c, 0x86a0, 0x00de, 0x0005, 0x00d6,
+	0x00e6, 0x0126, 0x2091, 0x8000, 0x2071, 0x0040, 0x702c, 0xd084,
+	0x01d8, 0x908c, 0x0780, 0x190c, 0x7dc1, 0xd09c, 0x11a8, 0x2071,
+	0x1800, 0x70c0, 0x90ea, 0x0020, 0x0278, 0x8001, 0x70c2, 0x702c,
+	0x2048, 0xa800, 0x702e, 0x9006, 0xa802, 0xa806, 0x2071, 0x0040,
+	0x2900, 0x7022, 0x702c, 0x0c28, 0x012e, 0x00ee, 0x00de, 0x0005,
+	0x0006, 0x9084, 0x0780, 0x190c, 0x7dc1, 0x000e, 0x0005, 0xa898,
+	0x9084, 0x0003, 0x05a8, 0x080c, 0xaa82, 0x05d8, 0x2900, 0x6016,
+	0xa864, 0x9084, 0x00ff, 0x9086, 0x0035, 0x1138, 0x6028, 0xc0fd,
+	0x602a, 0x2001, 0x196b, 0x2004, 0x0098, 0xa8a0, 0x9084, 0x00ff,
+	0xa99c, 0x918c, 0xff00, 0x9105, 0xa99c, 0x918c, 0x00ff, 0x080c,
+	0x25cf, 0x1540, 0x00b6, 0x080c, 0x652d, 0x2b00, 0x00be, 0x1510,
+	0x6012, 0x6023, 0x0001, 0x2009, 0x0040, 0xa864, 0x9084, 0x00ff,
+	0x9086, 0x0035, 0x0110, 0x2009, 0x0041, 0x080c, 0xab77, 0x0005,
+	0xa87b, 0x0101, 0x0126, 0x2091, 0x8000, 0x080c, 0x6c7f, 0x012e,
+	0x0005, 0xa87b, 0x002c, 0x0126, 0x2091, 0x8000, 0x080c, 0x6c7f,
+	0x012e, 0x0005, 0xa87b, 0x0028, 0x0126, 0x2091, 0x8000, 0x080c,
+	0x6c7f, 0x012e, 0x080c, 0xaad8, 0x0005, 0x00d6, 0x00c6, 0x0036,
+	0x0026, 0x0016, 0x00b6, 0x7007, 0x0001, 0xaa74, 0x9282, 0x0004,
+	0x1a04, 0x7db2, 0xa97c, 0x9188, 0x1000, 0x2104, 0x905d, 0xb804,
+	0xd284, 0x0140, 0x05e8, 0x8007, 0x9084, 0x00ff, 0x9084, 0x0006,
+	0x1108, 0x04b0, 0x2b10, 0x080c, 0xaa82, 0x1118, 0x080c, 0xab4a,
+	0x05a8, 0x6212, 0xa874, 0x0002, 0x7d90, 0x7d95, 0x7d98, 0x7d9e,
+	0x2019, 0x0002, 0x080c, 0xe101, 0x0060, 0x080c, 0xe091, 0x0048,
+	0x2019, 0x0002, 0xa980, 0x080c, 0xe0b0, 0x0018, 0xa980, 0x080c,
+	0xe091, 0x080c, 0xaad8, 0xa887, 0x0000, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x6c7f, 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, 0x7dc3, 0x0006, 0x0016, 0x2001,
+	0x8003, 0x0006, 0x0804, 0x0d86, 0x0005, 0x00f6, 0x2079, 0x0300,
+	0x2001, 0x0200, 0x200c, 0xc1e5, 0xc1dc, 0x2102, 0x2009, 0x0218,
+	0x210c, 0xd1ec, 0x1120, 0x080c, 0x15ff, 0x00fe, 0x0005, 0x2001,
+	0x020d, 0x2003, 0x0020, 0x781f, 0x0300, 0x00fe, 0x0005, 0x781c,
+	0xd08c, 0x0904, 0x7e2f, 0x68c0, 0x90aa, 0x0005, 0x0a04, 0x8417,
+	0x7d44, 0x7c40, 0xd59c, 0x190c, 0x0d7d, 0x9584, 0x00f6, 0x1508,
+	0x9484, 0x7000, 0x0138, 0x908a, 0x2000, 0x1258, 0x9584, 0x0700,
+	0x8007, 0x0470, 0x7000, 0x9084, 0xff00, 0x9086, 0x8100, 0x0db0,
+	0x00b0, 0x9484, 0x0fff, 0x1130, 0x7000, 0x9084, 0xff00, 0x9086,
+	0x8100, 0x11c0, 0x080c, 0xe573, 0x080c, 0x830e, 0x7817, 0x0140,
+	0x00a8, 0x9584, 0x0076, 0x1118, 0x080c, 0x836a, 0x19c8, 0xd5a4,
+	0x0148, 0x0046, 0x0056, 0x080c, 0x7e7f, 0x080c, 0x20e9, 0x005e,
+	0x004e, 0x0020, 0x080c, 0xe573, 0x7817, 0x0140, 0x0489, 0x0005,
+	0x0002, 0x7e3c, 0x8130, 0x7e39, 0x7e39, 0x7e39, 0x7e39, 0x7e39,
+	0x7e39, 0x7817, 0x0140, 0x0005, 0x7000, 0x908c, 0xff00, 0x9194,
+	0xf000, 0x810f, 0x9484, 0x0fff, 0x6892, 0x9286, 0x2000, 0x1150,
+	0x6800, 0x9086, 0x0001, 0x1118, 0x080c, 0x5653, 0x0070, 0x080c,
+	0x7e9f, 0x0058, 0x9286, 0x3000, 0x1118, 0x080c, 0x806d, 0x0028,
+	0x9286, 0x8000, 0x1110, 0x080c, 0x8244, 0x7817, 0x0140, 0x0005,
+	0x2001, 0x1810, 0x2004, 0xd08c, 0x0178, 0x2001, 0x1800, 0x2004,
+	0x9086, 0x0003, 0x1148, 0x0026, 0x0036, 0x2011, 0x8048, 0x2518,
+	0x080c, 0x4a38, 0x003e, 0x002e, 0x0005, 0x0036, 0x0046, 0x0056,
+	0x00f6, 0x2079, 0x0200, 0x2019, 0xfffe, 0x7c30, 0x0050, 0x0036,
+	0x0046, 0x0056, 0x00f6, 0x2079, 0x0200, 0x7d44, 0x7c40, 0x2019,
+	0xffff, 0x2001, 0x1810, 0x2004, 0xd08c, 0x0160, 0x2001, 0x1800,
+	0x2004, 0x9086, 0x0003, 0x1130, 0x0026, 0x2011, 0x8048, 0x080c,
+	0x4a38, 0x002e, 0x00fe, 0x005e, 0x004e, 0x003e, 0x0005, 0x00b6,
+	0x00c6, 0x7010, 0x9084, 0xff00, 0x8007, 0x9096, 0x0001, 0x0120,
+	0x9096, 0x0023, 0x1904, 0x803e, 0x9186, 0x0023, 0x15c0, 0x080c,
+	0x82d9, 0x0904, 0x803e, 0x6120, 0x9186, 0x0001, 0x0150, 0x9186,
+	0x0004, 0x0138, 0x9186, 0x0008, 0x0120, 0x9186, 0x000a, 0x1904,
+	0x803e, 0x7124, 0x610a, 0x7030, 0x908e, 0x0200, 0x1130, 0x2009,
+	0x0015, 0x080c, 0xab77, 0x0804, 0x803e, 0x908e, 0x0214, 0x0118,
+	0x908e, 0x0210, 0x1130, 0x2009, 0x0015, 0x080c, 0xab77, 0x0804,
+	0x803e, 0x908e, 0x0100, 0x1904, 0x803e, 0x7034, 0x9005, 0x1904,
+	0x803e, 0x2009, 0x0016, 0x080c, 0xab77, 0x0804, 0x803e, 0x9186,
+	0x0022, 0x1904, 0x803e, 0x7030, 0x908e, 0x0300, 0x1580, 0x68dc,
+	0xd0a4, 0x0528, 0xc0b5, 0x68de, 0x7100, 0x918c, 0x00ff, 0x697e,
+	0x7004, 0x6882, 0x00f6, 0x2079, 0x0100, 0x79e6, 0x78ea, 0x0006,
+	0x9084, 0x00ff, 0x0016, 0x2008, 0x080c, 0x2618, 0x7932, 0x7936,
+	0x001e, 0x000e, 0x00fe, 0x080c, 0x25cf, 0x695e, 0x703c, 0x00e6,
+	0x2071, 0x0140, 0x7086, 0x2071, 0x1800, 0x70b6, 0x00ee, 0x7034,
+	0x9005, 0x1904, 0x803e, 0x2009, 0x0017, 0x0804, 0x800b, 0x908e,
+	0x0400, 0x1190, 0x7034, 0x9005, 0x1904, 0x803e, 0x080c, 0x73e4,
+	0x0120, 0x2009, 0x001d, 0x0804, 0x800b, 0x68dc, 0xc0a5, 0x68de,
+	0x2009, 0x0030, 0x0804, 0x800b, 0x908e, 0x0500, 0x1140, 0x7034,
+	0x9005, 0x1904, 0x803e, 0x2009, 0x0018, 0x0804, 0x800b, 0x908e,
+	0x2010, 0x1120, 0x2009, 0x0019, 0x0804, 0x800b, 0x908e, 0x2110,
+	0x1120, 0x2009, 0x001a, 0x0804, 0x800b, 0x908e, 0x5200, 0x1140,
+	0x7034, 0x9005, 0x1904, 0x803e, 0x2009, 0x001b, 0x0804, 0x800b,
+	0x908e, 0x5000, 0x1140, 0x7034, 0x9005, 0x1904, 0x803e, 0x2009,
+	0x001c, 0x0804, 0x800b, 0x908e, 0x1300, 0x1120, 0x2009, 0x0034,
+	0x0804, 0x800b, 0x908e, 0x1200, 0x1140, 0x7034, 0x9005, 0x1904,
+	0x803e, 0x2009, 0x0024, 0x0804, 0x800b, 0x908c, 0xff00, 0x918e,
+	0x2400, 0x1170, 0x2009, 0x002d, 0x2001, 0x1810, 0x2004, 0xd09c,
+	0x0904, 0x800b, 0x080c, 0xd522, 0x1904, 0x803e, 0x0804, 0x8009,
+	0x908c, 0xff00, 0x918e, 0x5300, 0x1120, 0x2009, 0x002a, 0x0804,
+	0x800b, 0x908e, 0x0f00, 0x1120, 0x2009, 0x0020, 0x0804, 0x800b,
+	0x908e, 0x5300, 0x1108, 0x0448, 0x908e, 0x6104, 0x1530, 0x2029,
+	0x0205, 0x2011, 0x026d, 0x8208, 0x2204, 0x9082, 0x0004, 0x8004,
+	0x8004, 0x20a8, 0x2011, 0x8015, 0x211c, 0x8108, 0x0046, 0x2124,
+	0x080c, 0x4a38, 0x004e, 0x8108, 0x0f04, 0x7fbf, 0x9186, 0x0280,
+	0x1d88, 0x2504, 0x8000, 0x202a, 0x2009, 0x0260, 0x0c58, 0x202b,
+	0x0000, 0x2009, 0x0023, 0x0804, 0x800b, 0x908e, 0x6000, 0x1120,
+	0x2009, 0x003f, 0x0804, 0x800b, 0x908e, 0x5400, 0x1138, 0x080c,
+	0x83c7, 0x1904, 0x803e, 0x2009, 0x0046, 0x04a8, 0x908e, 0x5500,
+	0x1148, 0x080c, 0x83ef, 0x1118, 0x2009, 0x0041, 0x0460, 0x2009,
+	0x0042, 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, 0x6838, 0xd0d4,
+	0x0110, 0x2009, 0x004c, 0x0016, 0x2011, 0x0263, 0x2204, 0x8211,
+	0x220c, 0x080c, 0x25cf, 0x1568, 0x080c, 0x64cc, 0x1550, 0xbe12,
+	0xbd16, 0x001e, 0x0016, 0xb884, 0x9005, 0x1168, 0x9186, 0x0046,
+	0x1150, 0x687c, 0x9606, 0x1138, 0x6880, 0x9506, 0x9084, 0xff00,
+	0x1110, 0x001e, 0x0098, 0x080c, 0xaa82, 0x01a8, 0x2b08, 0x6112,
+	0x6023, 0x0004, 0x7120, 0x610a, 0x001e, 0x9186, 0x004c, 0x1110,
+	0x6023, 0x000a, 0x0016, 0x001e, 0x080c, 0xab77, 0x00ce, 0x00be,
+	0x0005, 0x001e, 0x0cd8, 0x2001, 0x180e, 0x2004, 0xd0ec, 0x0120,
+	0x2011, 0x8049, 0x080c, 0x4a38, 0x080c, 0xab4a, 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, 0x90ef, 0x08a0, 0x080c, 0x32f2, 0x1140,
+	0x7010, 0x9084, 0xff00, 0x8007, 0x908e, 0x0008, 0x1108, 0x0009,
+	0x0005, 0x00b6, 0x00c6, 0x0046, 0x7000, 0x908c, 0xff00, 0x810f,
+	0x9186, 0x0033, 0x11e8, 0x080c, 0x82d9, 0x0904, 0x80c8, 0x7124,
+	0x610a, 0x7030, 0x908e, 0x0200, 0x1140, 0x7034, 0x9005, 0x15c0,
+	0x2009, 0x0015, 0x080c, 0xab77, 0x0498, 0x908e, 0x0100, 0x1580,
+	0x7034, 0x9005, 0x1568, 0x2009, 0x0016, 0x080c, 0xab77, 0x0440,
+	0x9186, 0x0032, 0x1528, 0x7030, 0x908e, 0x1400, 0x1508, 0x2009,
+	0x0038, 0x0016, 0x2011, 0x0263, 0x2204, 0x8211, 0x220c, 0x080c,
+	0x25cf, 0x11a8, 0x080c, 0x64cc, 0x1190, 0xbe12, 0xbd16, 0x080c,
+	0xaa82, 0x0168, 0x2b08, 0x6112, 0x080c, 0xcbb0, 0x6023, 0x0004,
+	0x7120, 0x610a, 0x001e, 0x080c, 0xab77, 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, 0x812a, 0x9596,
+	0xfffe, 0x1120, 0x2009, 0x007e, 0x0804, 0x812a, 0x9596, 0xfffc,
+	0x1118, 0x2009, 0x0080, 0x04f0, 0x2011, 0x0000, 0x2019, 0x1837,
+	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, 0x80ff, 0x82ff, 0x1118, 0x9085, 0x0001, 0x0018,
+	0xc2fc, 0x2208, 0x9006, 0x00de, 0x00ee, 0x004e, 0x00be, 0x0005,
+	0x7000, 0x908c, 0xff00, 0x810f, 0x9184, 0x000f, 0x0002, 0x8147,
+	0x8147, 0x8147, 0x82eb, 0x8147, 0x814a, 0x816f, 0x81f8, 0x8147,
+	0x8147, 0x8147, 0x8147, 0x8147, 0x8147, 0x8147, 0x8147, 0x7817,
+	0x0140, 0x0005, 0x00b6, 0x7110, 0xd1bc, 0x01e8, 0x7120, 0x2160,
+	0x9c8c, 0x0003, 0x11c0, 0x9c8a, 0x1ddc, 0x02a8, 0x6868, 0x9c02,
+	0x1290, 0x7008, 0x9084, 0x00ff, 0x6110, 0x2158, 0xb910, 0x9106,
+	0x1150, 0x700c, 0xb914, 0x9106, 0x1130, 0x7124, 0x610a, 0x2009,
+	0x0046, 0x080c, 0xab77, 0x7817, 0x0140, 0x00be, 0x0005, 0x00b6,
+	0x00c6, 0x9484, 0x0fff, 0x0904, 0x81d4, 0x7110, 0xd1bc, 0x1904,
+	0x81d4, 0x7108, 0x700c, 0x2028, 0x918c, 0x00ff, 0x2130, 0x9094,
+	0xff00, 0x15c8, 0x81ff, 0x15b8, 0x9080, 0x3334, 0x200d, 0x918c,
+	0xff00, 0x810f, 0x2001, 0x0080, 0x9106, 0x0904, 0x81d4, 0x9182,
+	0x0801, 0x1a04, 0x81d4, 0x9190, 0x1000, 0x2204, 0x905d, 0x05e0,
+	0xbe12, 0xbd16, 0xb800, 0xd0ec, 0x15b8, 0xba04, 0x9294, 0xff00,
+	0x9286, 0x0600, 0x1190, 0x080c, 0xaa82, 0x0598, 0x2b08, 0x7028,
+	0x6052, 0x702c, 0x604e, 0x6112, 0x6023, 0x0006, 0x7120, 0x610a,
+	0x7130, 0x615e, 0x080c, 0xd784, 0x00f8, 0x080c, 0x696a, 0x1138,
+	0xb807, 0x0606, 0x0c40, 0x190c, 0x80cc, 0x11b0, 0x0880, 0x080c,
+	0xaa82, 0x2b08, 0x0188, 0x6112, 0x6023, 0x0004, 0x7120, 0x610a,
+	0x9286, 0x0400, 0x1118, 0x6007, 0x0005, 0x0010, 0x6007, 0x0001,
+	0x6003, 0x0001, 0x080c, 0x90ef, 0x7817, 0x0140, 0x00ce, 0x00be,
+	0x0005, 0x2001, 0x180e, 0x2004, 0xd0ec, 0x0120, 0x2011, 0x8049,
+	0x080c, 0x4a38, 0x080c, 0xab4a, 0x0d78, 0x2b08, 0x6112, 0x6023,
+	0x0006, 0x7120, 0x610a, 0x7130, 0x615e, 0x6017, 0xf300, 0x6003,
+	0x0001, 0x6007, 0x0041, 0x2009, 0xa022, 0x080c, 0x90e8, 0x08e0,
+	0x00b6, 0x7110, 0xd1bc, 0x05d0, 0x7020, 0x2060, 0x9c84, 0x0003,
+	0x15a8, 0x9c82, 0x1ddc, 0x0690, 0x6868, 0x9c02, 0x1678, 0x9484,
+	0x0fff, 0x9082, 0x000c, 0x0650, 0x7008, 0x9084, 0x00ff, 0x6110,
+	0x2158, 0xb910, 0x9106, 0x1510, 0x700c, 0xb914, 0x9106, 0x11f0,
+	0x7124, 0x610a, 0x601c, 0xd0fc, 0x11c8, 0x2001, 0x0271, 0x2004,
+	0x9005, 0x1180, 0x9484, 0x0fff, 0x9082, 0x000c, 0x0158, 0x0066,
+	0x2031, 0x0100, 0xa001, 0xa001, 0x8631, 0x1de0, 0x006e, 0x601c,
+	0xd0fc, 0x1120, 0x2009, 0x0045, 0x080c, 0xab77, 0x7817, 0x0140,
+	0x00be, 0x0005, 0x6120, 0x9186, 0x0002, 0x0128, 0x9186, 0x0005,
+	0x0110, 0x9085, 0x0001, 0x0005, 0x080c, 0x32f2, 0x1168, 0x7010,
+	0x9084, 0xff00, 0x8007, 0x9086, 0x0000, 0x1130, 0x9184, 0x000f,
+	0x908a, 0x0006, 0x1208, 0x000b, 0x0005, 0x825b, 0x825c, 0x825b,
+	0x825b, 0x82bb, 0x82ca, 0x0005, 0x00b6, 0x7110, 0xd1bc, 0x0120,
+	0x702c, 0xd084, 0x0904, 0x82b9, 0x700c, 0x7108, 0x080c, 0x25cf,
+	0x1904, 0x82b9, 0x080c, 0x64cc, 0x1904, 0x82b9, 0xbe12, 0xbd16,
+	0x7110, 0xd1bc, 0x01d8, 0x080c, 0x696a, 0x0118, 0x9086, 0x0004,
+	0x1588, 0x00c6, 0x080c, 0x82d9, 0x00ce, 0x05d8, 0x080c, 0xaa82,
+	0x2b08, 0x05b8, 0x6112, 0x080c, 0xcbb0, 0x6023, 0x0002, 0x7120,
+	0x610a, 0x2009, 0x0088, 0x080c, 0xab77, 0x0458, 0x080c, 0x696a,
+	0x0148, 0x9086, 0x0004, 0x0130, 0x080c, 0x6972, 0x0118, 0x9086,
+	0x0004, 0x1180, 0x080c, 0xaa82, 0x2b08, 0x01d8, 0x6112, 0x080c,
+	0xcbb0, 0x6023, 0x0005, 0x7120, 0x610a, 0x2009, 0x0088, 0x080c,
+	0xab77, 0x0078, 0x080c, 0xaa82, 0x2b08, 0x0158, 0x6112, 0x080c,
+	0xcbb0, 0x6023, 0x0004, 0x7120, 0x610a, 0x2009, 0x0001, 0x080c,
+	0xab77, 0x00be, 0x0005, 0x7110, 0xd1bc, 0x0158, 0x00d1, 0x0148,
+	0x080c, 0x823a, 0x1130, 0x7124, 0x610a, 0x2009, 0x0089, 0x080c,
+	0xab77, 0x0005, 0x7110, 0xd1bc, 0x0158, 0x0059, 0x0148, 0x080c,
+	0x823a, 0x1130, 0x7124, 0x610a, 0x2009, 0x008a, 0x080c, 0xab77,
+	0x0005, 0x7020, 0x2060, 0x9c84, 0x0003, 0x1158, 0x9c82, 0x1ddc,
+	0x0240, 0x2001, 0x181a, 0x2004, 0x9c02, 0x1218, 0x9085, 0x0001,
+	0x0005, 0x9006, 0x0ce8, 0x00b6, 0x7110, 0xd1bc, 0x11d8, 0x7024,
+	0x2060, 0x9c84, 0x0003, 0x11b0, 0x9c82, 0x1ddc, 0x0298, 0x6868,
+	0x9c02, 0x1280, 0x7008, 0x9084, 0x00ff, 0x6110, 0x2158, 0xb910,
+	0x9106, 0x1140, 0x700c, 0xb914, 0x9106, 0x1120, 0x2009, 0x0051,
+	0x080c, 0xab77, 0x7817, 0x0140, 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, 0x05c0, 0x080c,
+	0xaa82, 0x05a8, 0x0066, 0x00c6, 0x0046, 0x2011, 0x0263, 0x2204,
+	0x8211, 0x220c, 0x080c, 0x25cf, 0x1590, 0x080c, 0x64cc, 0x1578,
+	0xbe12, 0xbd16, 0x2b00, 0x004e, 0x00ce, 0x6012, 0x080c, 0xcbb0,
+	0x080c, 0x103b, 0x0500, 0x2900, 0x6062, 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, 0x90ef, 0x00fe,
+	0x009e, 0x00ce, 0x0005, 0x080c, 0xaad8, 0x006e, 0x0cc0, 0x004e,
+	0x00ce, 0x0cc8, 0x00c6, 0x7000, 0x908c, 0xff00, 0x9184, 0xf000,
+	0x810f, 0x9086, 0x2000, 0x1904, 0x83c1, 0x9186, 0x0022, 0x15f0,
+	0x2001, 0x0111, 0x2004, 0x9005, 0x1904, 0x83c3, 0x7030, 0x908e,
+	0x0400, 0x0904, 0x83c3, 0x908e, 0x6000, 0x05e8, 0x908e, 0x5400,
+	0x05d0, 0x908e, 0x0300, 0x11d8, 0x2009, 0x1837, 0x210c, 0xd18c,
+	0x1590, 0xd1a4, 0x1580, 0x080c, 0x6928, 0x0558, 0x68b0, 0x9084,
+	0x00ff, 0x7100, 0x918c, 0x00ff, 0x9106, 0x1518, 0x6880, 0x69b0,
+	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, 0x82d9, 0x0128, 0x6004, 0x9086, 0x0002, 0x0118,
+	0x0000, 0x9006, 0x0010, 0x9085, 0x0001, 0x00ce, 0x0005, 0x0156,
+	0x0046, 0x0016, 0x0036, 0x7038, 0x2020, 0x8427, 0x94a4, 0x0007,
+	0xd484, 0x0148, 0x20a9, 0x0004, 0x2019, 0x1805, 0x2011, 0x027a,
+	0x080c, 0xba99, 0x1178, 0xd48c, 0x0148, 0x20a9, 0x0004, 0x2019,
+	0x1801, 0x2011, 0x027e, 0x080c, 0xba99, 0x1120, 0xd494, 0x0110,
+	0x9085, 0x0001, 0x003e, 0x001e, 0x004e, 0x015e, 0x0005, 0x0156,
+	0x0046, 0x0016, 0x0036, 0x7038, 0x2020, 0x8427, 0x94a4, 0x0007,
+	0xd484, 0x0148, 0x20a9, 0x0004, 0x2019, 0x1805, 0x2011, 0x0272,
+	0x080c, 0xba99, 0x1178, 0xd48c, 0x0148, 0x20a9, 0x0004, 0x2019,
+	0x1801, 0x2011, 0x0276, 0x080c, 0xba99, 0x1120, 0xd494, 0x0110,
+	0x9085, 0x0001, 0x003e, 0x001e, 0x004e, 0x015e, 0x0005, 0x00f6,
+	0x2079, 0x0200, 0x7800, 0xc0e5, 0xc0cc, 0x7802, 0x00fe, 0x0005,
+	0x00f6, 0x2079, 0x1800, 0x7834, 0xd084, 0x1130, 0x2079, 0x0200,
+	0x7800, 0x9085, 0x1200, 0x7802, 0x00fe, 0x0005, 0x00e6, 0x2071,
+	0x1800, 0x7034, 0xc084, 0x7036, 0x00ee, 0x0005, 0x2071, 0x1a01,
+	0x7003, 0x0003, 0x700f, 0x0361, 0x9006, 0x701a, 0x7072, 0x7012,
+	0x7017, 0x1ddc, 0x7007, 0x0000, 0x7026, 0x702b, 0x9d2b, 0x7032,
+	0x7037, 0x9da8, 0x703f, 0xffff, 0x7042, 0x7047, 0x5493, 0x704a,
+	0x705b, 0x85db, 0x080c, 0x1054, 0x090c, 0x0d7d, 0x2900, 0x703a,
+	0xa867, 0x0003, 0xa86f, 0x0100, 0xa8ab, 0xdcb0, 0x0005, 0x2071,
+	0x1a01, 0x1d04, 0x84fa, 0x2091, 0x6000, 0x700c, 0x8001, 0x700e,
+	0x1590, 0x2001, 0x013c, 0x2004, 0x9005, 0x190c, 0x8685, 0x2001,
+	0x1869, 0x2004, 0xd0c4, 0x0158, 0x3a00, 0xd08c, 0x1140, 0x20d1,
+	0x0000, 0x20d1, 0x0001, 0x20d1, 0x0000, 0x080c, 0x0d7d, 0x700f,
+	0x0361, 0x7007, 0x0001, 0x0126, 0x2091, 0x8000, 0x2069, 0x1800,
+	0x69ec, 0xd1e4, 0x1138, 0xd1dc, 0x1118, 0x080c, 0x8649, 0x0010,
+	0x080c, 0x8620, 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, 0x9e44, 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, 0x8522, 0x8523, 0x854d, 0x00e6,
+	0x2071, 0x1a01, 0x7018, 0x9005, 0x1120, 0x711a, 0x721e, 0x700b,
+	0x0009, 0x00ee, 0x0005, 0x00e6, 0x0006, 0x2071, 0x1a01, 0x701c,
+	0x9206, 0x1120, 0x701a, 0x701e, 0x7072, 0x7076, 0x000e, 0x00ee,
+	0x0005, 0x00e6, 0x2071, 0x1a01, 0xb888, 0x9102, 0x0208, 0xb98a,
+	0x00ee, 0x0005, 0x0005, 0x00b6, 0x2031, 0x0010, 0x7110, 0x080c,
+	0x652d, 0x11a8, 0xb888, 0x8001, 0x0290, 0xb88a, 0x1180, 0x0126,
+	0x2091, 0x8000, 0x0066, 0xb8d0, 0x9005, 0x0138, 0x0026, 0xba3c,
+	0x0016, 0x080c, 0x6658, 0x001e, 0x002e, 0x006e, 0x012e, 0x8108,
+	0x9182, 0x0800, 0x1220, 0x8631, 0x0128, 0x7112, 0x0c00, 0x900e,
+	0x7007, 0x0002, 0x7112, 0x00be, 0x0005, 0x2031, 0x0010, 0x7014,
+	0x2060, 0x0126, 0x2091, 0x8000, 0x6048, 0x9005, 0x0128, 0x8001,
+	0x604a, 0x1110, 0x080c, 0xca31, 0x6018, 0x9005, 0x0904, 0x85a2,
+	0x00f6, 0x2079, 0x0300, 0x7918, 0xd1b4, 0x1904, 0x85b5, 0x781b,
+	0x2020, 0xa001, 0x7918, 0xd1b4, 0x0120, 0x781b, 0x2000, 0x0804,
+	0x85b5, 0x8001, 0x601a, 0x0106, 0x781b, 0x2000, 0xa001, 0x7918,
+	0xd1ac, 0x1dd0, 0x010e, 0x00fe, 0x1528, 0x6120, 0x9186, 0x0003,
+	0x0148, 0x9186, 0x0006, 0x0130, 0x9186, 0x0009, 0x11c8, 0x611c,
+	0xd1c4, 0x1100, 0x6014, 0x2048, 0xa884, 0x908a, 0x199a, 0x0280,
+	0x9082, 0x1999, 0xa886, 0x908a, 0x199a, 0x0210, 0x2001, 0x1999,
+	0x8003, 0x800b, 0x810b, 0x9108, 0x611a, 0x080c, 0xce61, 0x0110,
+	0x080c, 0xc421, 0x012e, 0x9c88, 0x001c, 0x7116, 0x2001, 0x181a,
+	0x2004, 0x9102, 0x1228, 0x8631, 0x0138, 0x2160, 0x0804, 0x8551,
+	0x7017, 0x1ddc, 0x7007, 0x0000, 0x0005, 0x00fe, 0x0c58, 0x00e6,
+	0x2071, 0x1a01, 0x7027, 0x07d0, 0x7023, 0x0009, 0x00ee, 0x0005,
+	0x2001, 0x1a0a, 0x2003, 0x0000, 0x0005, 0x00e6, 0x2071, 0x1a01,
+	0x7132, 0x702f, 0x0009, 0x00ee, 0x0005, 0x2011, 0x1a0d, 0x2013,
+	0x0000, 0x0005, 0x00e6, 0x2071, 0x1a01, 0x711a, 0x721e, 0x700b,
+	0x0009, 0x00ee, 0x0005, 0x0086, 0x0026, 0x7054, 0x8000, 0x7056,
+	0x2001, 0x1a0f, 0x2044, 0xa06c, 0x9086, 0x0000, 0x0150, 0x7068,
+	0xa09a, 0x7064, 0xa096, 0x7060, 0xa092, 0x705c, 0xa08e, 0x080c,
+	0x111b, 0x002e, 0x008e, 0x0005, 0x0006, 0x0016, 0x0096, 0x00a6,
+	0x00b6, 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x0156, 0x080c, 0x845f,
+	0x015e, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x00ae, 0x009e,
+	0x001e, 0x000e, 0x0005, 0x00e6, 0x2071, 0x1a01, 0x7172, 0x7276,
+	0x706f, 0x0009, 0x00ee, 0x0005, 0x00e6, 0x0006, 0x2071, 0x1a01,
+	0x7074, 0x9206, 0x1110, 0x7072, 0x7076, 0x000e, 0x00ee, 0x0005,
+	0x2069, 0x1800, 0x69ec, 0xd1e4, 0x1518, 0x0026, 0xd1ec, 0x0140,
+	0x6a54, 0x6874, 0x9202, 0x0288, 0x8117, 0x9294, 0x00c1, 0x0088,
+	0x9184, 0x0007, 0x01a0, 0x8109, 0x9184, 0x0007, 0x0110, 0x69ee,
+	0x0070, 0x8107, 0x9084, 0x0007, 0x910d, 0x8107, 0x9106, 0x9094,
+	0x00c1, 0x9184, 0xff3e, 0x9205, 0x68ee, 0x080c, 0x0f05, 0x002e,
+	0x0005, 0x69e8, 0x9184, 0x003f, 0x05b8, 0x8109, 0x9184, 0x003f,
+	0x01a8, 0x6a54, 0x6874, 0x9202, 0x0220, 0xd1bc, 0x0168, 0xc1bc,
+	0x0018, 0xd1bc, 0x1148, 0xc1bd, 0x2110, 0x00e6, 0x2071, 0x1800,
+	0x080c, 0x0f27, 0x00ee, 0x0400, 0x69ea, 0x00f0, 0x0026, 0x8107,
+	0x9094, 0x0007, 0x0128, 0x8001, 0x8007, 0x9085, 0x0007, 0x0050,
+	0x2010, 0x8004, 0x8004, 0x8004, 0x9084, 0x0007, 0x9205, 0x8007,
+	0x9085, 0x0028, 0x9086, 0x0040, 0x2010, 0x00e6, 0x2071, 0x1800,
+	0x080c, 0x0f27, 0x00ee, 0x002e, 0x0005, 0x0016, 0x00c6, 0x2009,
+	0xfffc, 0x210d, 0x2061, 0x0100, 0x60f0, 0x9100, 0x60f3, 0x0000,
+	0x2009, 0xfffc, 0x200f, 0x1220, 0x8108, 0x2105, 0x8000, 0x200f,
+	0x00ce, 0x001e, 0x0005, 0x00c6, 0x2061, 0x1a6d, 0x00ce, 0x0005,
+	0x9184, 0x000f, 0x8003, 0x8003, 0x8003, 0x9080, 0x1a6d, 0x2060,
+	0x0005, 0xa884, 0x908a, 0x199a, 0x1638, 0x9005, 0x1150, 0x00c6,
+	0x2061, 0x1a6d, 0x6014, 0x00ce, 0x9005, 0x1130, 0x2001, 0x001e,
+	0x0018, 0x908e, 0xffff, 0x01b0, 0x8003, 0x800b, 0x810b, 0x9108,
+	0x611a, 0xa87c, 0x908c, 0x00c0, 0x918e, 0x00c0, 0x0904, 0x8760,
+	0xd0b4, 0x1168, 0xd0bc, 0x1904, 0x8739, 0x2009, 0x0006, 0x080c,
+	0x878d, 0x0005, 0x900e, 0x0c60, 0x2001, 0x1999, 0x08b0, 0xd0fc,
+	0x05c8, 0x908c, 0x2023, 0x1550, 0x87ff, 0x1540, 0x6124, 0x918c,
+	0x0500, 0x1520, 0x6100, 0x918e, 0x0007, 0x1500, 0x2009, 0x1869,
+	0x210c, 0xd184, 0x11d8, 0x6003, 0x0003, 0x6007, 0x0043, 0x6047,
+	0xb035, 0x080c, 0x1be0, 0xa87c, 0xc0dd, 0xa87e, 0x600f, 0x0000,
+	0x00f6, 0x2079, 0x0380, 0x7818, 0xd0bc, 0x1de8, 0x7833, 0x0013,
+	0x2c00, 0x7836, 0x781b, 0x8080, 0x00fe, 0x0005, 0x908c, 0x0003,
+	0x0120, 0x918e, 0x0003, 0x1904, 0x8787, 0x908c, 0x2020, 0x918e,
+	0x2020, 0x01a8, 0x6024, 0xd0d4, 0x11e8, 0x2009, 0x1869, 0x2104,
+	0xd084, 0x1138, 0x87ff, 0x1120, 0x2009, 0x0043, 0x0804, 0xab77,
+	0x0005, 0x87ff, 0x1de8, 0x2009, 0x0042, 0x0804, 0xab77, 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, 0x8787, 0x908c, 0x2020, 0x918e, 0x2020, 0x0170, 0x0076,
+	0x00f6, 0x2c78, 0x080c, 0x1728, 0x00fe, 0x007e, 0x87ff, 0x1120,
+	0x2009, 0x0042, 0x080c, 0xab77, 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, 0xab77, 0x0005, 0x00b9, 0x0ce8, 0x87ff, 0x1dd8, 0x2009,
+	0x0043, 0x080c, 0xab77, 0x0cb0, 0x6110, 0x00b6, 0x2158, 0xb900,
+	0x00be, 0xd1ac, 0x0d20, 0x6124, 0xc1cd, 0x6126, 0x0c00, 0x2009,
+	0x0004, 0x0019, 0x0005, 0x2009, 0x0001, 0x0096, 0x080c, 0xc723,
+	0x0518, 0x6014, 0x2048, 0xa982, 0xa800, 0x6016, 0x9186, 0x0001,
+	0x1188, 0xa97c, 0x918c, 0x8100, 0x918e, 0x8100, 0x1158, 0x00c6,
+	0x2061, 0x1a6d, 0x6200, 0xd28c, 0x1120, 0x6204, 0x8210, 0x0208,
+	0x6206, 0x00ce, 0x080c, 0x6ab4, 0x6014, 0x904d, 0x0076, 0x2039,
+	0x0000, 0x190c, 0x86a9, 0x007e, 0x009e, 0x0005, 0x0156, 0x00c6,
+	0x2061, 0x1a6d, 0x6000, 0x81ff, 0x0110, 0x9205, 0x0008, 0x9204,
+	0x6002, 0x00ce, 0x015e, 0x0005, 0x6800, 0xd08c, 0x1138, 0x6808,
+	0x9005, 0x0120, 0x8001, 0x680a, 0x9085, 0x0001, 0x0005, 0x2071,
+	0x1923, 0x7003, 0x0006, 0x7007, 0x0000, 0x700f, 0x0000, 0x7013,
+	0x0001, 0x080c, 0x1054, 0x090c, 0x0d7d, 0xa867, 0x0006, 0xa86b,
+	0x0001, 0xa8ab, 0xdcb0, 0xa89f, 0x0000, 0x2900, 0x702e, 0x7033,
+	0x0000, 0x0005, 0x0096, 0x00e6, 0x2071, 0x1923, 0x702c, 0x2048,
+	0x6a2c, 0x721e, 0x6b30, 0x7322, 0x6834, 0x7026, 0xa896, 0x6838,
+	0x702a, 0xa89a, 0x6824, 0x7016, 0x683c, 0x701a, 0x2009, 0x0028,
+	0x200a, 0x9005, 0x0148, 0x900e, 0x9188, 0x000c, 0x8001, 0x1de0,
+	0x2100, 0x9210, 0x1208, 0x8318, 0xaa8e, 0xab92, 0x7010, 0xd084,
+	0x0178, 0xc084, 0x7007, 0x0001, 0x700f, 0x0000, 0x0006, 0x2009,
+	0x181d, 0x2104, 0x9082, 0x0007, 0x2009, 0x1b4c, 0x200a, 0x000e,
+	0xc095, 0x7012, 0x2008, 0x2001, 0x003b, 0x080c, 0x1670, 0x9006,
+	0x2071, 0x193c, 0x7002, 0x7006, 0x702a, 0x00ee, 0x009e, 0x0005,
+	0x00e6, 0x0126, 0x0156, 0x2091, 0x8000, 0x2071, 0x1800, 0x7154,
+	0x2001, 0x0008, 0x910a, 0x0638, 0x2001, 0x187d, 0x20ac, 0x9006,
+	0x9080, 0x0008, 0x1f04, 0x8840, 0x71c0, 0x9102, 0x02e0, 0x2071,
+	0x1877, 0x20a9, 0x0007, 0x00c6, 0x080c, 0xaa82, 0x6023, 0x0009,
+	0x6003, 0x0004, 0x601f, 0x0101, 0x0089, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x89c6, 0x012e, 0x1f04, 0x884c, 0x9006, 0x00ce, 0x015e,
+	0x012e, 0x00ee, 0x0005, 0x9085, 0x0001, 0x0cc8, 0x00e6, 0x00b6,
+	0x0096, 0x0086, 0x0056, 0x0046, 0x0026, 0x7118, 0x720c, 0x7620,
+	0x7004, 0xd084, 0x1128, 0x2021, 0x0024, 0x2029, 0x0002, 0x0020,
+	0x2021, 0x002c, 0x2029, 0x000a, 0x080c, 0x103b, 0x090c, 0x0d7d,
+	0x2900, 0x6016, 0x2058, 0xac66, 0x9006, 0xa802, 0xa806, 0xa86a,
+	0xa87a, 0xa8aa, 0xa887, 0x0005, 0xa87f, 0x0020, 0x7008, 0xa89a,
+	0x7010, 0xa89e, 0xae8a, 0xa8af, 0xffff, 0xa8b3, 0x0000, 0x8109,
+	0x0160, 0x080c, 0x103b, 0x090c, 0x0d7d, 0xad66, 0x2b00, 0xa802,
+	0x2900, 0xb806, 0x2058, 0x8109, 0x1da0, 0x002e, 0x004e, 0x005e,
+	0x008e, 0x009e, 0x00be, 0x00ee, 0x0005, 0x2079, 0x0000, 0x2071,
+	0x1923, 0x7004, 0x004b, 0x700c, 0x0002, 0x88b8, 0x88b1, 0x88b1,
+	0x0005, 0x88c2, 0x8923, 0x8923, 0x8923, 0x8924, 0x8935, 0x8935,
+	0x700c, 0x0cba, 0x0126, 0x2091, 0x8000, 0x78a0, 0x79a0, 0x9106,
+	0x0128, 0x78a0, 0x79a0, 0x9106, 0x1904, 0x8916, 0x2001, 0x0005,
+	0x2004, 0xd0bc, 0x0130, 0x2011, 0x0004, 0x2204, 0xc0c5, 0x2012,
+	0x0ca8, 0x012e, 0x7018, 0x910a, 0x1130, 0x7030, 0x9005, 0x05a8,
+	0x080c, 0x8964, 0x0490, 0x1210, 0x7114, 0x910a, 0x9192, 0x000a,
+	0x0210, 0x2009, 0x000a, 0x2001, 0x1888, 0x2014, 0x2001, 0x1935,
+	0x2004, 0x9100, 0x9202, 0x0e48, 0x080c, 0x8ab0, 0x2200, 0x9102,
+	0x0208, 0x2208, 0x0096, 0x702c, 0x2048, 0xa873, 0x0001, 0xa976,
+	0x080c, 0x8bb9, 0x2100, 0xa87e, 0xa86f, 0x0000, 0x009e, 0x0126,
+	0x2091, 0x8000, 0x2009, 0x1a1f, 0x2104, 0xc085, 0x200a, 0x700f,
+	0x0002, 0x012e, 0x080c, 0x113a, 0x1de8, 0x0005, 0x2001, 0x0005,
+	0x2004, 0xd0bc, 0x0130, 0x2011, 0x0004, 0x2204, 0xc0c5, 0x2012,
+	0x0ca8, 0x012e, 0x0005, 0x0005, 0x700c, 0x0002, 0x8929, 0x892c,
+	0x892b, 0x080c, 0x88c0, 0x0005, 0x8001, 0x700e, 0x0096, 0x702c,
+	0x2048, 0xa974, 0x009e, 0x0011, 0x0ca0, 0x0005, 0x0096, 0x702c,
+	0x2048, 0x7018, 0x9100, 0x7214, 0x921a, 0x1130, 0x701c, 0xa88e,
+	0x7020, 0xa892, 0x9006, 0x0068, 0x0006, 0x080c, 0x8bb9, 0x2100,
+	0xaa8c, 0x9210, 0xaa8e, 0x1220, 0xa890, 0x9081, 0x0000, 0xa892,
+	0x000e, 0x009e, 0x2f08, 0x9188, 0x0028, 0x200a, 0x701a, 0x0005,
+	0x00e6, 0x2071, 0x1923, 0x700c, 0x0002, 0x8962, 0x8962, 0x8960,
+	0x700f, 0x0001, 0x00ee, 0x0005, 0x0126, 0x2091, 0x8000, 0x7030,
+	0x9005, 0x0508, 0x2078, 0x7814, 0x2048, 0xae88, 0x00b6, 0x2059,
+	0x0000, 0x080c, 0x89cf, 0x00be, 0x01b0, 0x00e6, 0x2071, 0x193c,
+	0x080c, 0x8a16, 0x00ee, 0x0178, 0x0096, 0x080c, 0x1054, 0x2900,
+	0x009e, 0x0148, 0xa8aa, 0x04b9, 0x0041, 0x2001, 0x1946, 0x2003,
+	0x0000, 0x012e, 0x08c8, 0x012e, 0x0005, 0x00d6, 0x00c6, 0x0086,
+	0x00a6, 0x2940, 0x2650, 0x2600, 0x9005, 0x0180, 0xa864, 0x9084,
+	0x000f, 0x2068, 0x9d88, 0x1e31, 0x2165, 0x0056, 0x2029, 0x0000,
+	0x080c, 0x8b3e, 0x080c, 0x1e07, 0x1dd8, 0x005e, 0x00ae, 0x2001,
+	0x187f, 0x2004, 0xa88a, 0x080c, 0x1728, 0x781f, 0x0101, 0x7813,
+	0x0000, 0x0126, 0x2091, 0x8000, 0x080c, 0x8a25, 0x012e, 0x008e,
+	0x00ce, 0x00de, 0x0005, 0x7030, 0x9005, 0x0138, 0x2078, 0x780c,
+	0x7032, 0x2001, 0x1946, 0x2003, 0x0001, 0x0005, 0x00e6, 0x2071,
+	0x1923, 0x7030, 0x600e, 0x2c00, 0x7032, 0x00ee, 0x0005, 0x00d6,
+	0x00c6, 0x0026, 0x9b80, 0x8c98, 0x2005, 0x906d, 0x090c, 0x0d7d,
+	0x9b80, 0x8c90, 0x2005, 0x9065, 0x090c, 0x0d7d, 0x6114, 0x2600,
+	0x9102, 0x0248, 0x6828, 0x9102, 0x02f0, 0x9085, 0x0001, 0x002e,
+	0x00ce, 0x00de, 0x0005, 0x6804, 0xd094, 0x0148, 0x6854, 0xd084,
+	0x1178, 0xc085, 0x6856, 0x2011, 0x8026, 0x080c, 0x4a38, 0x684c,
+	0x0096, 0x904d, 0x090c, 0x0d7d, 0xa804, 0x8000, 0xa806, 0x009e,
+	0x9006, 0x2030, 0x0c20, 0x6854, 0xd08c, 0x1d08, 0xc08d, 0x6856,
+	0x2011, 0x8025, 0x080c, 0x4a38, 0x684c, 0x0096, 0x904d, 0x090c,
+	0x0d7d, 0xa800, 0x8000, 0xa802, 0x009e, 0x0888, 0x7000, 0x2019,
+	0x0008, 0x8319, 0x7104, 0x9102, 0x1118, 0x2300, 0x9005, 0x0020,
+	0x0210, 0x9302, 0x0008, 0x8002, 0x0005, 0x00d6, 0x7814, 0x9005,
+	0x090c, 0x0d7d, 0x781c, 0x9084, 0x0101, 0x9086, 0x0101, 0x190c,
+	0x0d7d, 0x2069, 0x193c, 0x6804, 0x9080, 0x193e, 0x2f08, 0x2102,
+	0x6904, 0x8108, 0x9182, 0x0008, 0x0208, 0x900e, 0x6906, 0x9180,
+	0x193e, 0x2003, 0x0000, 0x00de, 0x0005, 0x0096, 0x00c6, 0x2060,
+	0x6014, 0x2048, 0xa8a8, 0x0096, 0x2048, 0x9005, 0x190c, 0x106d,
+	0x009e, 0xa8ab, 0x0000, 0x080c, 0x0fed, 0x080c, 0xaad8, 0x00ce,
+	0x009e, 0x0005, 0x6020, 0x9086, 0x0009, 0x1128, 0x601c, 0xd0c4,
+	0x0110, 0x9006, 0x0005, 0x9085, 0x0001, 0x0005, 0x6000, 0x9086,
+	0x0000, 0x0178, 0x6010, 0x9005, 0x0150, 0x00b6, 0x2058, 0x080c,
+	0x8dcb, 0x00be, 0x6013, 0x0000, 0x601b, 0x0000, 0x0010, 0x2c00,
+	0x0861, 0x0005, 0x2009, 0x1927, 0x210c, 0xd194, 0x0005, 0x00e6,
+	0x2071, 0x1923, 0x7110, 0xc194, 0xd19c, 0x1118, 0xc185, 0x7007,
+	0x0000, 0x7112, 0x2001, 0x003b, 0x080c, 0x1670, 0x00ee, 0x0005,
+	0x0096, 0x00d6, 0x9006, 0x7006, 0x700e, 0x701a, 0x701e, 0x7022,
+	0x7016, 0x702a, 0x7026, 0x702f, 0x0000, 0x080c, 0x8c18, 0x0170,
+	0x080c, 0x8c4d, 0x0158, 0x2900, 0x7002, 0x700a, 0x701a, 0x7013,
+	0x0001, 0x701f, 0x000a, 0x00de, 0x009e, 0x0005, 0x900e, 0x0cd8,
+	0x00e6, 0x0096, 0x0086, 0x00d6, 0x00c6, 0x2071, 0x1930, 0x721c,
+	0x2100, 0x9202, 0x1618, 0x080c, 0x8c4d, 0x090c, 0x0d7d, 0x7018,
+	0x9005, 0x1160, 0x2900, 0x7002, 0x700a, 0x701a, 0x9006, 0x7006,
+	0x700e, 0xa806, 0xa802, 0x7012, 0x701e, 0x0038, 0x2040, 0xa806,
+	0x2900, 0xa002, 0x701a, 0xa803, 0x0000, 0x7010, 0x8000, 0x7012,
+	0x701c, 0x9080, 0x000a, 0x701e, 0x721c, 0x08d0, 0x721c, 0x00ce,
+	0x00de, 0x008e, 0x009e, 0x00ee, 0x0005, 0x0096, 0x0156, 0x0136,
+	0x0146, 0x00e6, 0x0126, 0x2091, 0x8000, 0x2071, 0x1930, 0x7300,
+	0x831f, 0x831e, 0x831e, 0x9384, 0x003f, 0x20e8, 0x939c, 0xffc0,
+	0x9398, 0x0003, 0x7104, 0x080c, 0x8bb9, 0x810c, 0x2100, 0x9318,
+	0x8003, 0x2228, 0x2021, 0x0078, 0x9402, 0x9532, 0x0208, 0x2028,
+	0x2500, 0x8004, 0x20a8, 0x23a0, 0xa001, 0xa001, 0x4005, 0x2508,
+	0x080c, 0x8bc2, 0x2130, 0x7014, 0x9600, 0x7016, 0x2600, 0x711c,
+	0x9102, 0x701e, 0x7004, 0x9600, 0x2008, 0x9082, 0x000a, 0x1190,
+	0x7000, 0x2048, 0xa800, 0x9005, 0x1148, 0x2009, 0x0001, 0x0026,
+	0x080c, 0x8ab0, 0x002e, 0x7000, 0x2048, 0xa800, 0x7002, 0x7007,
+	0x0000, 0x0008, 0x7106, 0x2500, 0x9212, 0x1904, 0x8aef, 0x012e,
+	0x00ee, 0x014e, 0x013e, 0x015e, 0x009e, 0x0005, 0x0016, 0x0026,
+	0x00e6, 0x0126, 0x2091, 0x8000, 0x9580, 0x8c90, 0x2005, 0x9075,
+	0x090c, 0x0d7d, 0x080c, 0x8b94, 0x012e, 0x9580, 0x8c8c, 0x2005,
+	0x9075, 0x090c, 0x0d7d, 0x0156, 0x0136, 0x01c6, 0x0146, 0x01d6,
+	0x831f, 0x831e, 0x831e, 0x9384, 0x003f, 0x20e0, 0x9384, 0xffc0,
+	0x9100, 0x2098, 0xa860, 0x20e8, 0xa95c, 0x2c05, 0x9100, 0x20a0,
+	0x20a9, 0x0002, 0x4003, 0x2e0c, 0x2d00, 0x0002, 0x8b7e, 0x8b7e,
+	0x8b80, 0x8b7e, 0x8b80, 0x8b7e, 0x8b7e, 0x8b7e, 0x8b7e, 0x8b7e,
+	0x8b86, 0x8b7e, 0x8b86, 0x8b7e, 0x8b7e, 0x8b7e, 0x080c, 0x0d7d,
+	0x4104, 0x20a9, 0x0002, 0x4002, 0x4003, 0x0028, 0x20a9, 0x0002,
+	0x4003, 0x4104, 0x4003, 0x01de, 0x014e, 0x01ce, 0x013e, 0x015e,
+	0x00ee, 0x002e, 0x001e, 0x0005, 0x0096, 0x7014, 0x8001, 0x7016,
+	0x710c, 0x2110, 0x00f1, 0x810c, 0x9188, 0x0003, 0x7308, 0x8210,
+	0x9282, 0x000a, 0x1198, 0x7008, 0x2048, 0xa800, 0x9005, 0x0158,
+	0x0006, 0x080c, 0x8c5c, 0x009e, 0xa807, 0x0000, 0x2900, 0x700a,
+	0x7010, 0x8001, 0x7012, 0x700f, 0x0000, 0x0008, 0x720e, 0x009e,
+	0x0005, 0x0006, 0x810b, 0x810b, 0x2100, 0x810b, 0x9100, 0x2008,
+	0x000e, 0x0005, 0x0006, 0x0026, 0x2100, 0x9005, 0x0158, 0x9092,
+	0x000c, 0x0240, 0x900e, 0x8108, 0x9082, 0x000c, 0x1de0, 0x002e,
+	0x000e, 0x0005, 0x900e, 0x0cd8, 0x2d00, 0x90b8, 0x0008, 0x690c,
+	0x6810, 0x2019, 0x0001, 0x2031, 0x8c02, 0x9112, 0x0220, 0x0118,
+	0x8318, 0x2208, 0x0cd0, 0x6808, 0x9005, 0x0108, 0x8318, 0x233a,
+	0x6804, 0xd084, 0x2300, 0x2021, 0x0001, 0x1150, 0x9082, 0x0003,
+	0x0967, 0x0a67, 0x8420, 0x9082, 0x0007, 0x0967, 0x0a67, 0x0cd0,
+	0x9082, 0x0002, 0x0967, 0x0a67, 0x8420, 0x9082, 0x0005, 0x0967,
+	0x0a67, 0x0cd0, 0x6c1a, 0x2d00, 0x90b8, 0x0007, 0x00e6, 0x2071,
+	0x1800, 0x7128, 0x6810, 0x2019, 0x0001, 0x910a, 0x0118, 0x0210,
+	0x8318, 0x0cd8, 0x2031, 0x8c15, 0x0870, 0x6c16, 0x00ee, 0x0005,
+	0x0096, 0x0046, 0x0126, 0x2091, 0x8000, 0x2b00, 0x9080, 0x8c94,
+	0x2005, 0x9005, 0x090c, 0x0d7d, 0x2004, 0x90a0, 0x000a, 0x080c,
+	0x1054, 0x01d0, 0x2900, 0x7026, 0xa803, 0x0000, 0xa807, 0x0000,
+	0x080c, 0x1054, 0x0188, 0x7024, 0xa802, 0xa807, 0x0000, 0x2900,
+	0x7026, 0x94a2, 0x000a, 0x0110, 0x0208, 0x0c90, 0x9085, 0x0001,
+	0x012e, 0x004e, 0x009e, 0x0005, 0x7024, 0x9005, 0x0dc8, 0x2048,
+	0xac00, 0x080c, 0x106d, 0x2400, 0x0cc0, 0x0126, 0x2091, 0x8000,
+	0x7024, 0x2048, 0x9005, 0x0130, 0xa800, 0x7026, 0xa803, 0x0000,
+	0xa807, 0x0000, 0x012e, 0x0005, 0x0126, 0x2091, 0x8000, 0x7024,
+	0xa802, 0x2900, 0x7026, 0x012e, 0x0005, 0x0096, 0x9e80, 0x0009,
+	0x2004, 0x9005, 0x0138, 0x2048, 0xa800, 0x0006, 0x080c, 0x106d,
+	0x000e, 0x0cb8, 0x009e, 0x0005, 0x0096, 0x7008, 0x9005, 0x0138,
+	0x2048, 0xa800, 0x0006, 0x080c, 0x106d, 0x000e, 0x0cb8, 0x9006,
+	0x7002, 0x700a, 0x7006, 0x700e, 0x701a, 0x701e, 0x7022, 0x702a,
+	0x7026, 0x702e, 0x009e, 0x0005, 0x1a6b, 0x0000, 0x0000, 0x0000,
+	0x1930, 0x0000, 0x0000, 0x0000, 0x1888, 0x0000, 0x0000, 0x0000,
+	0x1877, 0x0000, 0x0000, 0x0000, 0x00e6, 0x00c6, 0x00b6, 0x00a6,
+	0xa8a8, 0x2040, 0x2071, 0x1877, 0x080c, 0x8db6, 0xa067, 0x0023,
+	0x6010, 0x905d, 0x0904, 0x8d8b, 0xb814, 0xa06e, 0xb910, 0xa172,
+	0xb9a0, 0xa176, 0x2001, 0x0003, 0xa07e, 0xa834, 0xa082, 0xa07b,
+	0x0000, 0xa898, 0x9005, 0x0118, 0xa078, 0xc085, 0xa07a, 0x2858,
+	0x2031, 0x0018, 0xa068, 0x908a, 0x0019, 0x1a0c, 0x0d7d, 0x2020,
+	0x2050, 0x2940, 0xa864, 0x90bc, 0x00ff, 0x908c, 0x000f, 0x91e0,
+	0x1e31, 0x2c65, 0x9786, 0x0024, 0x2c05, 0x1590, 0x908a, 0x0036,
+	0x1a0c, 0x0d7d, 0x9082, 0x001b, 0x0002, 0x8cf8, 0x8cf8, 0x8cfa,
+	0x8cf8, 0x8cf8, 0x8cf8, 0x8cfc, 0x8cf8, 0x8cf8, 0x8cf8, 0x8cfe,
+	0x8cf8, 0x8cf8, 0x8cf8, 0x8d00, 0x8cf8, 0x8cf8, 0x8cf8, 0x8d02,
+	0x8cf8, 0x8cf8, 0x8cf8, 0x8d04, 0x8cf8, 0x8cf8, 0x8cf8, 0x8d06,
+	0x080c, 0x0d7d, 0xa180, 0x04b8, 0xa190, 0x04a8, 0xa1a0, 0x0498,
+	0xa1b0, 0x0488, 0xa1c0, 0x0478, 0xa1d0, 0x0468, 0xa1e0, 0x0458,
+	0x908a, 0x0034, 0x1a0c, 0x0d7d, 0x9082, 0x001b, 0x0002, 0x8d2a,
+	0x8d28, 0x8d28, 0x8d28, 0x8d28, 0x8d28, 0x8d2c, 0x8d28, 0x8d28,
+	0x8d28, 0x8d28, 0x8d28, 0x8d2e, 0x8d28, 0x8d28, 0x8d28, 0x8d28,
+	0x8d28, 0x8d30, 0x8d28, 0x8d28, 0x8d28, 0x8d28, 0x8d28, 0x8d32,
+	0x080c, 0x0d7d, 0xa180, 0x0038, 0xa198, 0x0028, 0xa1b0, 0x0018,
+	0xa1c8, 0x0008, 0xa1e0, 0x2600, 0x0002, 0x8d4e, 0x8d50, 0x8d52,
+	0x8d54, 0x8d56, 0x8d58, 0x8d5a, 0x8d5c, 0x8d5e, 0x8d60, 0x8d62,
+	0x8d64, 0x8d66, 0x8d68, 0x8d6a, 0x8d6c, 0x8d6e, 0x8d70, 0x8d72,
+	0x8d74, 0x8d76, 0x8d78, 0x8d7a, 0x8d7c, 0x8d7e, 0x080c, 0x0d7d,
+	0xb9e2, 0x0468, 0xb9de, 0x0458, 0xb9da, 0x0448, 0xb9d6, 0x0438,
+	0xb9d2, 0x0428, 0xb9ce, 0x0418, 0xb9ca, 0x0408, 0xb9c6, 0x00f8,
+	0xb9c2, 0x00e8, 0xb9be, 0x00d8, 0xb9ba, 0x00c8, 0xb9b6, 0x00b8,
+	0xb9b2, 0x00a8, 0xb9ae, 0x0098, 0xb9aa, 0x0088, 0xb9a6, 0x0078,
+	0xb9a2, 0x0068, 0xb99e, 0x0058, 0xb99a, 0x0048, 0xb996, 0x0038,
+	0xb992, 0x0028, 0xb98e, 0x0018, 0xb98a, 0x0008, 0xb986, 0x8631,
+	0x8421, 0x0120, 0x080c, 0x1e07, 0x0804, 0x8cd2, 0x00ae, 0x00be,
+	0x00ce, 0x00ee, 0x0005, 0xa86c, 0xa06e, 0xa870, 0xa072, 0xa077,
+	0x00ff, 0x9006, 0x0804, 0x8cb4, 0x0006, 0x0016, 0x00b6, 0x6010,
+	0x2058, 0xb810, 0x9005, 0x01b0, 0x2001, 0x1924, 0x2004, 0x9005,
+	0x0188, 0x2001, 0x1800, 0x2004, 0x9086, 0x0003, 0x1158, 0x0036,
+	0x0046, 0xbba0, 0x2021, 0x0004, 0x2011, 0x8014, 0x080c, 0x4a38,
+	0x004e, 0x003e, 0x00be, 0x001e, 0x000e, 0x0005, 0x9016, 0x710c,
+	0xa834, 0x910a, 0xa936, 0x7008, 0x9005, 0x0120, 0x8210, 0x910a,
+	0x0238, 0x0130, 0x7010, 0x8210, 0x910a, 0x0210, 0x0108, 0x0cd8,
+	0xaa8a, 0xa26a, 0x0005, 0x00f6, 0x00d6, 0x0036, 0x2079, 0x0300,
+	0x781b, 0x0200, 0x7818, 0xd094, 0x1dd8, 0x781b, 0x0202, 0xa001,
+	0xa001, 0x7818, 0xd094, 0x1da0, 0xb8ac, 0x9005, 0x01b8, 0x2068,
+	0x2079, 0x0000, 0x2c08, 0x911e, 0x1118, 0x680c, 0xb8ae, 0x0060,
+	0x9106, 0x0140, 0x2d00, 0x2078, 0x680c, 0x9005, 0x090c, 0x0d7d,
+	0x2068, 0x0cb0, 0x6b0c, 0x7b0e, 0x600f, 0x0000, 0x2079, 0x0300,
+	0x781b, 0x0200, 0x003e, 0x00de, 0x00fe, 0x0005, 0x00e6, 0x00d6,
+	0x0096, 0x00c6, 0x0036, 0x0126, 0x2091, 0x8000, 0x0156, 0x20a9,
+	0x01ff, 0x2071, 0x0300, 0x701b, 0x0200, 0x7018, 0xd094, 0x0110,
+	0x1f04, 0x8e0b, 0x701b, 0x0202, 0xa001, 0xa001, 0x7018, 0xd094,
+	0x1d90, 0xb8ac, 0x9005, 0x01d0, 0x2060, 0x600c, 0xb8ae, 0x6003,
+	0x0004, 0x601b, 0x0000, 0x6013, 0x0000, 0x601f, 0x0101, 0x6014,
+	0x2048, 0xa88b, 0x0000, 0xa8a8, 0xa8ab, 0x0000, 0x904d, 0x090c,
+	0x0d7d, 0x080c, 0x106d, 0x080c, 0x89c6, 0x0c18, 0x2071, 0x0300,
+	0x701b, 0x0200, 0x015e, 0x012e, 0x003e, 0x00ce, 0x009e, 0x00de,
+	0x00ee, 0x0005, 0x00c6, 0x00b6, 0x0016, 0x0006, 0x0156, 0x080c,
+	0x25cf, 0x015e, 0x11b0, 0x080c, 0x64cc, 0x190c, 0x0d7d, 0x000e,
+	0x001e, 0xb912, 0xb816, 0x080c, 0xaa82, 0x0140, 0x2b00, 0x6012,
+	0x6023, 0x0001, 0x2009, 0x0001, 0x080c, 0xab77, 0x00be, 0x00ce,
+	0x0005, 0x000e, 0x001e, 0x0cd0, 0x0066, 0x6000, 0x90b2, 0x0016,
+	0x1a0c, 0x0d7d, 0x0013, 0x006e, 0x0005, 0x8e7d, 0x8e7d, 0x8e7d,
+	0x8e7f, 0x8ec8, 0x8e7d, 0x8e7d, 0x8e7d, 0x8f2b, 0x8e7d, 0x8f63,
+	0x8e7d, 0x8e7d, 0x8e7d, 0x8e7d, 0x8e7d, 0x080c, 0x0d7d, 0x9182,
+	0x0040, 0x0002, 0x8e92, 0x8e92, 0x8e92, 0x8e92, 0x8e92, 0x8e92,
+	0x8e92, 0x8e92, 0x8e92, 0x8e94, 0x8ea5, 0x8e92, 0x8e92, 0x8e92,
+	0x8e92, 0x8eb6, 0x080c, 0x0d7d, 0x0096, 0x6114, 0x2148, 0xa87b,
+	0x0000, 0x6010, 0x00b6, 0x2058, 0xb8bb, 0x0500, 0x00be, 0x080c,
+	0x6a7f, 0x080c, 0xaad8, 0x009e, 0x0005, 0x080c, 0x9505, 0x00d6,
+	0x6114, 0x080c, 0xc723, 0x0130, 0x0096, 0x6114, 0x2148, 0x080c,
+	0x6c7f, 0x009e, 0x00de, 0x080c, 0xaad8, 0x0005, 0x080c, 0x9505,
+	0x080c, 0x31ab, 0x6114, 0x0096, 0x2148, 0x080c, 0xc723, 0x0120,
+	0xa87b, 0x0029, 0x080c, 0x6c7f, 0x009e, 0x080c, 0xaad8, 0x0005,
+	0x601b, 0x0000, 0x9182, 0x0040, 0x0096, 0x0002, 0x8ee3, 0x8ee3,
+	0x8ee3, 0x8ee3, 0x8ee3, 0x8ee3, 0x8ee3, 0x8ee3, 0x8ee5, 0x8ee3,
+	0x8ee3, 0x8ee3, 0x8f27, 0x8ee3, 0x8ee3, 0x8ee3, 0x8ee3, 0x8ee3,
+	0x8ee3, 0x8eeb, 0x8ee3, 0x080c, 0x0d7d, 0x6114, 0x2148, 0xa938,
+	0x918e, 0xffff, 0x05e0, 0x00e6, 0x6114, 0x2148, 0x080c, 0x8c9c,
+	0x0096, 0xa8a8, 0x2048, 0x080c, 0x6a17, 0x009e, 0xa8ab, 0x0000,
+	0x6010, 0x9005, 0x0128, 0x00b6, 0x2058, 0x080c, 0x8dcb, 0x00be,
+	0xae88, 0x00b6, 0x2059, 0x0000, 0x080c, 0x89cf, 0x00be, 0x01e0,
+	0x2071, 0x193c, 0x080c, 0x8a16, 0x01b8, 0x9086, 0x0001, 0x1128,
+	0x2001, 0x1946, 0x2004, 0x9005, 0x1178, 0x0096, 0x080c, 0x103b,
+	0x2900, 0x009e, 0x0148, 0xa8aa, 0x00f6, 0x2c78, 0x080c, 0x898d,
+	0x00fe, 0x00ee, 0x009e, 0x0005, 0x080c, 0x89c6, 0x0cd0, 0x080c,
+	0x8fdf, 0x009e, 0x0005, 0x9182, 0x0040, 0x0096, 0x0002, 0x8f3f,
+	0x8f3f, 0x8f3f, 0x8f41, 0x8f3f, 0x8f3f, 0x8f3f, 0x8f61, 0x8f3f,
+	0x8f3f, 0x8f3f, 0x8f3f, 0x8f3f, 0x8f3f, 0x8f3f, 0x8f3f, 0x080c,
+	0x0d7d, 0x6003, 0x0003, 0x6106, 0x6014, 0x2048, 0xa8ac, 0xa836,
+	0xa8b0, 0xa83a, 0xa847, 0x0000, 0xa84b, 0x0000, 0xa884, 0x9092,
+	0x199a, 0x0210, 0x2001, 0x1999, 0x8003, 0x8013, 0x8213, 0x9210,
+	0x621a, 0x080c, 0x1ba3, 0x2009, 0x8030, 0x080c, 0x912f, 0x009e,
+	0x0005, 0x080c, 0x0d7d, 0x080c, 0x9505, 0x6114, 0x2148, 0xa87b,
+	0x0000, 0x6010, 0x00b6, 0x2058, 0xb8bb, 0x0500, 0x00be, 0x080c,
+	0x6c7f, 0x080c, 0xaad8, 0x009e, 0x0005, 0x080c, 0xa781, 0x6144,
+	0xd1fc, 0x0120, 0xd1ac, 0x1110, 0x6003, 0x0003, 0x6000, 0x908a,
+	0x0016, 0x1a0c, 0x0d7d, 0x0096, 0x0023, 0x009e, 0x080c, 0xa79d,
+	0x0005, 0x8f99, 0x8f99, 0x8f99, 0x8f9b, 0x8fac, 0x8f99, 0x8f99,
+	0x8f99, 0x8f99, 0x8f99, 0x8f99, 0x8f99, 0x8f99, 0x8f99, 0x8f99,
+	0x8f99, 0x080c, 0x0d7d, 0x080c, 0xa915, 0x6114, 0x2148, 0xa87b,
+	0x0006, 0x6010, 0x00b6, 0x2058, 0xb8bb, 0x0500, 0x00be, 0x080c,
+	0x6c7f, 0x080c, 0xaad8, 0x0005, 0x0491, 0x0005, 0x080c, 0xa781,
+	0x6000, 0x6144, 0xd1fc, 0x0130, 0xd1ac, 0x1120, 0x6003, 0x0003,
+	0x2009, 0x0003, 0x908a, 0x0016, 0x1a0c, 0x0d7d, 0x0096, 0x0033,
+	0x009e, 0x0106, 0x080c, 0xa79d, 0x010e, 0x0005, 0x8fd6, 0x8fd6,
+	0x8fd6, 0x8fd8, 0x8fdf, 0x8fd6, 0x8fd6, 0x8fd6, 0x8fd6, 0x8fd6,
+	0x8fd6, 0x8fd6, 0x8fd6, 0x8fd6, 0x8fd6, 0x8fd6, 0x080c, 0x0d7d,
+	0x0036, 0x00e6, 0x080c, 0xa915, 0x00ee, 0x003e, 0x0005, 0x00f6,
+	0x00e6, 0x601b, 0x0000, 0x6014, 0x2048, 0x6010, 0x9005, 0x0128,
+	0x00b6, 0x2058, 0x080c, 0x8dcb, 0x00be, 0x2071, 0x193c, 0x080c,
+	0x8a16, 0x0160, 0x2001, 0x187f, 0x2004, 0xa88a, 0x2031, 0x0000,
+	0x2c78, 0x080c, 0x898d, 0x00ee, 0x00fe, 0x0005, 0x0096, 0xa88b,
+	0x0000, 0xa8a8, 0x2048, 0x080c, 0x106d, 0x009e, 0xa8ab, 0x0000,
+	0x080c, 0x89c6, 0x0c80, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+	0x0000, 0x0000, 0x0000, 0x0000, 0x187a, 0x0000, 0x0000, 0x0000,
+	0x0000, 0x0000, 0x0000, 0x0126, 0x2091, 0x8000, 0x0036, 0x0046,
+	0x20a9, 0x0010, 0x9006, 0x8004, 0x8086, 0x818e, 0x1208, 0x9200,
+	0x1f04, 0x9024, 0x8086, 0x818e, 0x004e, 0x003e, 0x012e, 0x0005,
+	0x0126, 0x2091, 0x8000, 0x0076, 0x0156, 0x20a9, 0x0010, 0x9005,
+	0x01c8, 0x911a, 0x12b8, 0x8213, 0x818d, 0x0228, 0x911a, 0x1220,
+	0x1f04, 0x903b, 0x0028, 0x911a, 0x2308, 0x8210, 0x1f04, 0x903b,
+	0x0006, 0x3200, 0x9084, 0xefff, 0x2080, 0x000e, 0x015e, 0x007e,
+	0x012e, 0x0005, 0x0006, 0x3200, 0x9085, 0x1000, 0x0ca8, 0x0126,
+	0x2091, 0x2800, 0x2079, 0x19e5, 0x012e, 0x00d6, 0x2069, 0x19e5,
+	0x6803, 0x0005, 0x0156, 0x0146, 0x01d6, 0x20e9, 0x0000, 0x2069,
+	0x0200, 0x080c, 0xa57b, 0x04a9, 0x080c, 0xa566, 0x0491, 0x080c,
+	0xa569, 0x0479, 0x080c, 0xa56c, 0x0461, 0x080c, 0xa56f, 0x0449,
+	0x080c, 0xa572, 0x0431, 0x080c, 0xa575, 0x0419, 0x080c, 0xa578,
+	0x0401, 0x01de, 0x014e, 0x015e, 0x6857, 0x0000, 0x00f6, 0x2079,
+	0x0380, 0x00f9, 0x7807, 0x0003, 0x7803, 0x0000, 0x7803, 0x0001,
+	0x2069, 0x0004, 0x2d04, 0x9084, 0xfffe, 0x9085, 0x8000, 0x206a,
+	0x2069, 0x0100, 0x6828, 0x9084, 0xfffc, 0x682a, 0x00fe, 0x00de,
+	0x0005, 0x20a9, 0x0020, 0x20a1, 0x0240, 0x2001, 0x0000, 0x4004,
+	0x0005, 0x00c6, 0x7803, 0x0000, 0x9006, 0x7827, 0x0030, 0x782b,
+	0x0400, 0x7827, 0x0031, 0x782b, 0x1aed, 0x781f, 0xff00, 0x781b,
+	0xff00, 0x2061, 0x1ae2, 0x602f, 0x19e5, 0x6033, 0x1800, 0x6037,
+	0x1a01, 0x603b, 0x1e31, 0x603f, 0x1e41, 0x6042, 0x6047, 0x1ab8,
+	0x00ce, 0x0005, 0x2001, 0x0382, 0x2004, 0x9084, 0x0007, 0x9086,
+	0x0001, 0x01b0, 0x00c6, 0x6146, 0x600f, 0x0000, 0x2c08, 0x2061,
+	0x19e5, 0x602c, 0x8000, 0x602e, 0x601c, 0x9005, 0x0130, 0x9080,
+	0x0003, 0x2102, 0x611e, 0x00ce, 0x0005, 0x6122, 0x611e, 0x0cd8,
+	0x6146, 0x2c08, 0x2001, 0x0012, 0x080c, 0xa772, 0x0005, 0x0016,
+	0x2009, 0x8020, 0x6146, 0x2c08, 0x2001, 0x0382, 0x2004, 0x9084,
+	0x0007, 0x9086, 0x0001, 0x1128, 0x2001, 0x0019, 0x080c, 0xa772,
+	0x0088, 0x00c6, 0x2061, 0x19e5, 0x602c, 0x8000, 0x602e, 0x600c,
+	0x9005, 0x0128, 0x9080, 0x0003, 0x2102, 0x610e, 0x0010, 0x6112,
+	0x610e, 0x00ce, 0x001e, 0x0005, 0x2001, 0x0382, 0x2004, 0x9084,
+	0x0007, 0x9086, 0x0001, 0x0198, 0x00c6, 0x6146, 0x600f, 0x0000,
+	0x2c08, 0x2061, 0x19e5, 0x6044, 0x9005, 0x0130, 0x9080, 0x0003,
+	0x2102, 0x6146, 0x00ce, 0x0005, 0x614a, 0x6146, 0x0cd8, 0x6146,
+	0x600f, 0x0000, 0x2c08, 0x2001, 0x0013, 0x080c, 0xa772, 0x0005,
+	0x6044, 0xd0dc, 0x0128, 0x9006, 0x7007, 0x0000, 0x700a, 0x7032,
+	0x0005, 0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x00b6, 0x0096, 0x0076,
+	0x0066, 0x0056, 0x0036, 0x0026, 0x0016, 0x0006, 0x0126, 0x902e,
+	0x2071, 0x19e5, 0x7648, 0x2660, 0x2678, 0x2091, 0x8000, 0x8cff,
+	0x0904, 0x91ba, 0x6010, 0x2058, 0xb8a0, 0x9206, 0x1904, 0x91b5,
+	0x87ff, 0x0120, 0x605c, 0x9106, 0x1904, 0x91b5, 0x704c, 0x9c06,
+	0x1178, 0x0036, 0x2019, 0x0001, 0x080c, 0x9fef, 0x703f, 0x0000,
+	0x9006, 0x704e, 0x706a, 0x7052, 0x706e, 0x003e, 0x2029, 0x0001,
+	0x080c, 0x9138, 0x7048, 0x9c36, 0x1110, 0x660c, 0x764a, 0x7044,
+	0x9c36, 0x1140, 0x2c00, 0x9f36, 0x0118, 0x2f00, 0x7046, 0x0010,
+	0x7047, 0x0000, 0x660c, 0x0066, 0x2c00, 0x9f06, 0x0110, 0x7e0e,
+	0x0008, 0x2678, 0x600f, 0x0000, 0x080c, 0xc723, 0x01c8, 0x6014,
+	0x2048, 0x6020, 0x9086, 0x0003, 0x1560, 0xa867, 0x0103, 0xab7a,
+	0xa877, 0x0000, 0x0016, 0x0036, 0x0076, 0x080c, 0xca1a, 0x080c,
+	0xe4e4, 0x080c, 0x6c7f, 0x007e, 0x003e, 0x001e, 0x080c, 0xc90b,
+	0x080c, 0xab13, 0x00ce, 0x0804, 0x9157, 0x2c78, 0x600c, 0x2060,
+	0x0804, 0x9157, 0x012e, 0x000e, 0x001e, 0x002e, 0x003e, 0x005e,
+	0x006e, 0x007e, 0x009e, 0x00be, 0x00ce, 0x00de, 0x00ee, 0x00fe,
+	0x0005, 0x6020, 0x9086, 0x0006, 0x1158, 0x0016, 0x0036, 0x0076,
+	0x080c, 0xe4e4, 0x080c, 0xe134, 0x007e, 0x003e, 0x001e, 0x08c0,
+	0x6020, 0x9086, 0x0009, 0x1168, 0xa87b, 0x0006, 0x0016, 0x0036,
+	0x0076, 0x080c, 0x6c7f, 0x080c, 0xaad8, 0x007e, 0x003e, 0x001e,
+	0x0848, 0x6020, 0x9086, 0x000a, 0x0904, 0x919f, 0x0804, 0x919d,
+	0x0006, 0x0066, 0x0096, 0x00c6, 0x00d6, 0x00f6, 0x9036, 0x0126,
+	0x2091, 0x8000, 0x2079, 0x19e5, 0x7848, 0x9065, 0x0904, 0x924f,
+	0x600c, 0x0006, 0x600f, 0x0000, 0x784c, 0x9c06, 0x11a0, 0x0036,
+	0x2019, 0x0001, 0x080c, 0x9fef, 0x783f, 0x0000, 0x901e, 0x7b4e,
+	0x7b6a, 0x7b52, 0x7b6e, 0x003e, 0x000e, 0x9005, 0x1118, 0x600c,
+	0x600f, 0x0000, 0x0006, 0x00e6, 0x2f70, 0x080c, 0x9138, 0x00ee,
+	0x080c, 0xc723, 0x0520, 0x6014, 0x2048, 0x6020, 0x9086, 0x0003,
+	0x1580, 0x3e08, 0x918e, 0x0002, 0x1188, 0x6010, 0x9005, 0x0170,
+	0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x0140, 0x6048, 0x9005,
+	0x1198, 0x2001, 0x1986, 0x2004, 0x604a, 0x0070, 0xa867, 0x0103,
+	0xab7a, 0xa877, 0x0000, 0x080c, 0x6c73, 0x080c, 0xc90b, 0x6044,
+	0xc0fc, 0x6046, 0x080c, 0xab13, 0x000e, 0x0804, 0x91fd, 0x7e4a,
+	0x7e46, 0x012e, 0x00fe, 0x00de, 0x00ce, 0x009e, 0x006e, 0x000e,
+	0x0005, 0x6020, 0x9086, 0x0006, 0x1118, 0x080c, 0xe134, 0x0c38,
+	0x6020, 0x9086, 0x0009, 0x1130, 0xab7a, 0x080c, 0x6c7f, 0x080c,
+	0xaad8, 0x0c10, 0x6020, 0x9086, 0x000a, 0x0990, 0x0878, 0x0016,
+	0x0026, 0x0086, 0x9046, 0x00a9, 0x080c, 0x9360, 0x008e, 0x002e,
+	0x001e, 0x0005, 0x00f6, 0x0126, 0x2079, 0x19e5, 0x2091, 0x8000,
+	0x080c, 0x93a9, 0x080c, 0x943d, 0x080c, 0x66ba, 0x012e, 0x00fe,
+	0x0005, 0x00b6, 0x0096, 0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x0066,
+	0x0016, 0x0006, 0x0126, 0x2091, 0x8000, 0x2071, 0x19e5, 0x7620,
+	0x2660, 0x2678, 0x8cff, 0x0904, 0x9325, 0x6010, 0x2058, 0xb8a0,
+	0x9206, 0x1904, 0x9320, 0x88ff, 0x0120, 0x605c, 0x9106, 0x1904,
+	0x9320, 0x7030, 0x9c06, 0x1570, 0x2069, 0x0100, 0x6820, 0xd0a4,
+	0x1508, 0x080c, 0x85c0, 0x080c, 0x9d09, 0x68c3, 0x0000, 0x080c,
+	0xa223, 0x7033, 0x0000, 0x0036, 0x2069, 0x0140, 0x6b04, 0x9384,
+	0x1000, 0x0138, 0x2001, 0x0100, 0x080c, 0x29d1, 0x9006, 0x080c,
+	0x29d1, 0x2069, 0x0100, 0x6824, 0xd084, 0x0110, 0x6827, 0x0001,
+	0x003e, 0x0040, 0x7008, 0xc0ad, 0x700a, 0x6003, 0x0009, 0x630a,
+	0x0804, 0x9320, 0x7020, 0x9c36, 0x1110, 0x660c, 0x7622, 0x701c,
+	0x9c36, 0x1140, 0x2c00, 0x9f36, 0x0118, 0x2f00, 0x701e, 0x0010,
+	0x701f, 0x0000, 0x660c, 0x0066, 0x2c00, 0x9f06, 0x0110, 0x7e0e,
+	0x0008, 0x2678, 0x600f, 0x0000, 0x6044, 0xc0fc, 0x6046, 0x6014,
+	0x2048, 0x080c, 0xc723, 0x01e8, 0x6020, 0x9086, 0x0003, 0x1580,
+	0x080c, 0xc931, 0x1118, 0x080c, 0xb4a0, 0x0098, 0xa867, 0x0103,
+	0xab7a, 0xa877, 0x0000, 0x0016, 0x0036, 0x0086, 0x080c, 0xca1a,
+	0x080c, 0xe4e4, 0x080c, 0x6c7f, 0x008e, 0x003e, 0x001e, 0x080c,
+	0xc90b, 0x080c, 0xab13, 0x080c, 0xa0f9, 0x00ce, 0x0804, 0x929a,
+	0x2c78, 0x600c, 0x2060, 0x0804, 0x929a, 0x012e, 0x000e, 0x001e,
+	0x006e, 0x00ce, 0x00de, 0x00ee, 0x00fe, 0x009e, 0x00be, 0x0005,
+	0x6020, 0x9086, 0x0006, 0x1158, 0x0016, 0x0036, 0x0086, 0x080c,
+	0xe4e4, 0x080c, 0xe134, 0x008e, 0x003e, 0x001e, 0x08d0, 0x080c,
+	0xb4a0, 0x6020, 0x9086, 0x0002, 0x1160, 0x6004, 0x0006, 0x9086,
+	0x0085, 0x000e, 0x0904, 0x9306, 0x9086, 0x008b, 0x0904, 0x9306,
+	0x0840, 0x6020, 0x9086, 0x0005, 0x1920, 0x6004, 0x0006, 0x9086,
+	0x0085, 0x000e, 0x09c8, 0x9086, 0x008b, 0x09b0, 0x0804, 0x9319,
+	0x0006, 0x00f6, 0x00e6, 0x0096, 0x00b6, 0x00c6, 0x0066, 0x0016,
+	0x0126, 0x2091, 0x8000, 0x9280, 0x1000, 0x2004, 0x905d, 0x2079,
+	0x19e5, 0x9036, 0x7828, 0x2060, 0x8cff, 0x0538, 0x6010, 0x9b06,
+	0x1500, 0x6043, 0xffff, 0x080c, 0xa960, 0x01d8, 0x610c, 0x0016,
+	0x080c, 0x9e79, 0x6014, 0x2048, 0xa867, 0x0103, 0xab7a, 0xa877,
+	0x0000, 0x0016, 0x0036, 0x0086, 0x080c, 0xca1a, 0x080c, 0xe4e4,
+	0x080c, 0x6c7f, 0x008e, 0x003e, 0x001e, 0x080c, 0xab13, 0x00ce,
+	0x08d8, 0x2c30, 0x600c, 0x2060, 0x08b8, 0x080c, 0x66d7, 0x012e,
+	0x001e, 0x006e, 0x00ce, 0x00be, 0x009e, 0x00ee, 0x00fe, 0x000e,
+	0x0005, 0x0096, 0x0006, 0x0066, 0x00c6, 0x00d6, 0x9036, 0x7820,
+	0x9065, 0x0904, 0x9410, 0x600c, 0x0006, 0x6044, 0xc0fc, 0x6046,
+	0x600f, 0x0000, 0x7830, 0x9c06, 0x1588, 0x2069, 0x0100, 0x6820,
+	0xd0a4, 0x1508, 0x080c, 0x85c0, 0x080c, 0x9d09, 0x68c3, 0x0000,
+	0x080c, 0xa223, 0x7833, 0x0000, 0x0036, 0x2069, 0x0140, 0x6b04,
+	0x9384, 0x1000, 0x0138, 0x2001, 0x0100, 0x080c, 0x29d1, 0x9006,
+	0x080c, 0x29d1, 0x2069, 0x0100, 0x6824, 0xd084, 0x0110, 0x6827,
+	0x0001, 0x003e, 0x0058, 0x080c, 0x6902, 0x1538, 0x6003, 0x0009,
+	0x630a, 0x7808, 0xc0ad, 0x780a, 0x2c30, 0x00f8, 0x6014, 0x2048,
+	0x080c, 0xc721, 0x01b0, 0x6020, 0x9086, 0x0003, 0x1508, 0x080c,
+	0xc931, 0x1118, 0x080c, 0xb4a0, 0x0060, 0x080c, 0x6902, 0x1168,
+	0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x080c, 0x6c7f, 0x080c,
+	0xc90b, 0x080c, 0xab13, 0x080c, 0xa0f9, 0x000e, 0x0804, 0x93b0,
+	0x7e22, 0x7e1e, 0x00de, 0x00ce, 0x006e, 0x000e, 0x009e, 0x0005,
+	0x6020, 0x9086, 0x0006, 0x1118, 0x080c, 0xe134, 0x0c50, 0x080c,
+	0xb4a0, 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, 0x0096, 0x00b6,
+	0x00c6, 0x0066, 0x9036, 0x7828, 0x9065, 0x0510, 0x6010, 0x2058,
+	0x600c, 0x0006, 0x3e08, 0x918e, 0x0002, 0x1118, 0xb800, 0xd0bc,
+	0x11a8, 0x6043, 0xffff, 0x080c, 0xa960, 0x0180, 0x610c, 0x080c,
+	0x9e79, 0x6014, 0x2048, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000,
+	0x080c, 0x6c7f, 0x080c, 0xab13, 0x000e, 0x08f0, 0x2c30, 0x0ce0,
+	0x006e, 0x00ce, 0x00be, 0x009e, 0x000e, 0x0005, 0x00e6, 0x00d6,
+	0x0096, 0x0066, 0x080c, 0x6053, 0x11b0, 0x2071, 0x19e5, 0x7030,
+	0x9080, 0x0005, 0x2004, 0x904d, 0x0170, 0xa878, 0x9606, 0x1158,
+	0x2071, 0x19e5, 0x7030, 0x9035, 0x0130, 0x9080, 0x0005, 0x2004,
+	0x9906, 0x1108, 0x0029, 0x006e, 0x009e, 0x00de, 0x00ee, 0x0005,
+	0x00c6, 0x2660, 0x6043, 0xffff, 0x080c, 0xa960, 0x0178, 0x080c,
+	0x9e79, 0x6014, 0x2048, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000,
+	0x080c, 0xca1a, 0x080c, 0x6c7f, 0x080c, 0xab13, 0x00ce, 0x0005,
+	0x00b6, 0x00e6, 0x00c6, 0x080c, 0xa7df, 0x0106, 0x190c, 0xa781,
+	0x2071, 0x0101, 0x2e04, 0xc0c4, 0x2072, 0x6044, 0xd0fc, 0x1138,
+	0x010e, 0x190c, 0xa79d, 0x00ce, 0x00ee, 0x00be, 0x0005, 0x2071,
+	0x19e5, 0x7030, 0x9005, 0x0da0, 0x9c06, 0x190c, 0x0d7d, 0x7036,
+	0x080c, 0x85c0, 0x7004, 0x9084, 0x0007, 0x0002, 0x94d8, 0x94da,
+	0x94e1, 0x94eb, 0x94f9, 0x94d8, 0x94e1, 0x94d6, 0x080c, 0x0d7d,
+	0x0428, 0x0005, 0x080c, 0xa94b, 0x7007, 0x0000, 0x7033, 0x0000,
+	0x00e8, 0x0066, 0x9036, 0x080c, 0x9e79, 0x006e, 0x7007, 0x0000,
+	0x7033, 0x0000, 0x0098, 0x080c, 0xa936, 0x0140, 0x080c, 0xa94b,
+	0x0128, 0x0066, 0x9036, 0x080c, 0x9e79, 0x006e, 0x7033, 0x0000,
+	0x0028, 0x080c, 0xa936, 0x080c, 0xa223, 0x0000, 0x010e, 0x190c,
+	0xa79d, 0x00ce, 0x00ee, 0x00be, 0x0005, 0x00d6, 0x00c6, 0x080c,
+	0xa7df, 0x0106, 0x190c, 0xa781, 0x6044, 0xd0fc, 0x1130, 0x010e,
+	0x190c, 0xa79d, 0x00ce, 0x00de, 0x0005, 0x2069, 0x19e5, 0x684c,
+	0x9005, 0x0da8, 0x9c06, 0x190c, 0x0d7d, 0x6852, 0x00e6, 0x2d70,
+	0x080c, 0x9138, 0x00ee, 0x080c, 0x85cd, 0x0016, 0x2009, 0x0040,
+	0x080c, 0x2184, 0x001e, 0x683c, 0x9084, 0x0003, 0x0002, 0x9535,
+	0x9536, 0x9554, 0x9533, 0x080c, 0x0d7d, 0x0460, 0x6868, 0x9086,
+	0x0001, 0x0190, 0x600c, 0x9015, 0x0160, 0x6a4a, 0x600f, 0x0000,
+	0x6044, 0xc0fc, 0x6046, 0x9006, 0x7042, 0x684e, 0x683f, 0x0000,
+	0x00c8, 0x684a, 0x6846, 0x0ca0, 0x686b, 0x0000, 0x6848, 0x9065,
+	0x0d78, 0x6003, 0x0002, 0x0c60, 0x9006, 0x686a, 0x6852, 0x686e,
+	0x600c, 0x9015, 0x0120, 0x6a4a, 0x600f, 0x0000, 0x0018, 0x684e,
+	0x684a, 0x6846, 0x684f, 0x0000, 0x010e, 0x190c, 0xa79d, 0x00ce,
+	0x00de, 0x0005, 0x0005, 0x6020, 0x9084, 0x000f, 0x000b, 0x0005,
+	0x9580, 0x9583, 0x99f1, 0x9a80, 0x9583, 0x99f1, 0x9a80, 0x9580,
+	0x9583, 0x9580, 0x9580, 0x9580, 0x9580, 0x9580, 0x9580, 0x9580,
+	0x080c, 0x94a8, 0x0005, 0x00b6, 0x0156, 0x0136, 0x0146, 0x01c6,
+	0x01d6, 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x2069, 0x0200, 0x2071,
+	0x0240, 0x6004, 0x908a, 0x0053, 0x1a0c, 0x0d7d, 0x6110, 0x2158,
+	0xb984, 0x2c78, 0x2061, 0x0100, 0x619a, 0x908a, 0x0040, 0x1a04,
+	0x95ef, 0x005b, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x01de, 0x01ce,
+	0x014e, 0x013e, 0x015e, 0x00be, 0x0005, 0x9774, 0x97af, 0x97d8,
+	0x9880, 0x98a2, 0x98a8, 0x98b5, 0x98bd, 0x98c9, 0x98cf, 0x98e0,
+	0x98cf, 0x9938, 0x98bd, 0x9944, 0x994a, 0x98c9, 0x994a, 0x9956,
+	0x95ed, 0x95ed, 0x95ed, 0x95ed, 0x95ed, 0x95ed, 0x95ed, 0x95ed,
+	0x95ed, 0x95ed, 0x95ed, 0x9e9a, 0x9ebd, 0x9ece, 0x9eee, 0x9f20,
+	0x98b5, 0x95ed, 0x98b5, 0x98cf, 0x95ed, 0x97d8, 0x9880, 0x95ed,
+	0xa316, 0x98cf, 0x95ed, 0xa332, 0x98cf, 0x95ed, 0x98c9, 0x976e,
+	0x9610, 0x95ed, 0xa34e, 0xa3bb, 0xa49b, 0x95ed, 0xa4a8, 0x98b2,
+	0xa4d3, 0x95ed, 0x9f2a, 0xa4df, 0x95ed, 0x080c, 0x0d7d, 0x2100,
+	0x005b, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x01de, 0x01ce, 0x014e,
+	0x013e, 0x015e, 0x00be, 0x0005, 0xa57f, 0xa631, 0x960e, 0x9637,
+	0x96e3, 0x96ee, 0x960e, 0x98b5, 0x960e, 0x9735, 0x9741, 0x9652,
+	0x960e, 0x966d, 0x96a1, 0xa9b6, 0xa9fb, 0x98cf, 0x080c, 0x0d7d,
+	0x00d6, 0x0096, 0x080c, 0x9969, 0x7003, 0x2414, 0x7007, 0x0018,
+	0x700b, 0x0800, 0x7814, 0x2048, 0xa83c, 0x700e, 0xa850, 0x7022,
+	0xa854, 0x7026, 0x60c3, 0x0018, 0x080c, 0x9cd9, 0x009e, 0x00de,
+	0x0005, 0x7810, 0x00b6, 0x2058, 0xb8a0, 0x00be, 0x080c, 0xaa42,
+	0x1118, 0x9084, 0xff80, 0x0110, 0x9085, 0x0001, 0x0005, 0x00d6,
+	0x0096, 0x080c, 0x9969, 0x7003, 0x0500, 0x7814, 0x2048, 0xa874,
+	0x700a, 0xa878, 0x700e, 0xa87c, 0x7012, 0xa880, 0x7016, 0xa884,
+	0x701a, 0xa888, 0x701e, 0x60c3, 0x0010, 0x080c, 0x9cd9, 0x009e,
+	0x00de, 0x0005, 0x00d6, 0x0096, 0x080c, 0x9969, 0x7003, 0x0500,
+	0x7814, 0x2048, 0xa8cc, 0x700a, 0xa8d0, 0x700e, 0xa8d4, 0x7012,
+	0xa8d8, 0x7016, 0xa8dc, 0x701a, 0xa8e0, 0x701e, 0x60c3, 0x0010,
+	0x080c, 0x9cd9, 0x009e, 0x00de, 0x0005, 0x00d6, 0x0096, 0x0126,
+	0x2091, 0x8000, 0x080c, 0x9969, 0x20e9, 0x0000, 0x2001, 0x19a1,
+	0x2003, 0x0000, 0x7814, 0x2048, 0xa814, 0x8003, 0x60c2, 0xa830,
+	0x20a8, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x001b, 0x2098, 0x2001,
+	0x19a1, 0x0016, 0x200c, 0x2001, 0x0001, 0x080c, 0x2169, 0x080c,
+	0xd484, 0x9006, 0x080c, 0x2169, 0x001e, 0xa804, 0x9005, 0x0110,
+	0x2048, 0x0c28, 0x04d9, 0x080c, 0x9cd9, 0x012e, 0x009e, 0x00de,
+	0x0005, 0x00d6, 0x0096, 0x0126, 0x2091, 0x8000, 0x080c, 0x99b4,
+	0x20e9, 0x0000, 0x2001, 0x19a1, 0x2003, 0x0000, 0x7814, 0x2048,
+	0xa86f, 0x0200, 0xa873, 0x0000, 0xa814, 0x8003, 0x60c2, 0xa830,
+	0x20a8, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x001b, 0x2098, 0x2001,
+	0x19a1, 0x0016, 0x200c, 0x080c, 0xd484, 0x001e, 0xa804, 0x9005,
+	0x0110, 0x2048, 0x0c60, 0x0051, 0x7814, 0x2048, 0x080c, 0x0fed,
+	0x080c, 0x9cd9, 0x012e, 0x009e, 0x00de, 0x0005, 0x60c0, 0x8004,
+	0x9084, 0x0003, 0x9005, 0x0130, 0x9082, 0x0004, 0x20a3, 0x0000,
+	0x8000, 0x1de0, 0x0005, 0x080c, 0x9969, 0x7003, 0x7800, 0x7808,
+	0x8007, 0x700a, 0x60c3, 0x0008, 0x0804, 0x9cd9, 0x00d6, 0x00e6,
+	0x080c, 0x99b4, 0x7814, 0x9084, 0xff00, 0x2073, 0x0200, 0x8e70,
+	0x8e70, 0x9095, 0x0010, 0x2272, 0x8e70, 0x2073, 0x0034, 0x8e70,
+	0x2069, 0x1805, 0x20a9, 0x0004, 0x2d76, 0x8d68, 0x8e70, 0x1f04,
+	0x9704, 0x2069, 0x1801, 0x20a9, 0x0004, 0x2d76, 0x8d68, 0x8e70,
+	0x1f04, 0x970d, 0x2069, 0x19b1, 0x9086, 0xdf00, 0x0110, 0x2069,
+	0x19cb, 0x20a9, 0x001a, 0x9e86, 0x0260, 0x1148, 0x00c6, 0x2061,
+	0x0200, 0x6010, 0x8000, 0x6012, 0x00ce, 0x2071, 0x0240, 0x2d04,
+	0x8007, 0x2072, 0x8d68, 0x8e70, 0x1f04, 0x971b, 0x60c3, 0x004c,
+	0x080c, 0x9cd9, 0x00ee, 0x00de, 0x0005, 0x080c, 0x9969, 0x7003,
+	0x6300, 0x7007, 0x0028, 0x7808, 0x700e, 0x60c3, 0x0008, 0x0804,
+	0x9cd9, 0x00d6, 0x0026, 0x0016, 0x080c, 0x99b4, 0x7003, 0x0200,
+	0x7814, 0x700e, 0x00e6, 0x9ef0, 0x0004, 0x2009, 0x0001, 0x2011,
+	0x000c, 0x2069, 0x1923, 0x6810, 0xd084, 0x1148, 0x2073, 0x0500,
+	0x8e70, 0x2073, 0x0000, 0x8e70, 0x8108, 0x9290, 0x0004, 0x2073,
+	0x0800, 0x8e70, 0x2073, 0x0000, 0x00ee, 0x7206, 0x710a, 0x62c2,
+	0x080c, 0x9cd9, 0x001e, 0x002e, 0x00de, 0x0005, 0x2001, 0x1818,
+	0x2004, 0x609a, 0x0804, 0x9cd9, 0x080c, 0x9969, 0x7003, 0x5200,
+	0x2069, 0x1847, 0x6804, 0xd084, 0x0130, 0x6828, 0x0016, 0x080c,
+	0x2602, 0x710e, 0x001e, 0x20a9, 0x0004, 0x20e1, 0x0001, 0x2099,
+	0x1805, 0x20e9, 0x0000, 0x20a1, 0x0250, 0x4003, 0x20a9, 0x0004,
+	0x2099, 0x1801, 0x20a1, 0x0254, 0x4003, 0x080c, 0xaa42, 0x1120,
+	0xb8a0, 0x9082, 0x007f, 0x0248, 0x2001, 0x181f, 0x2004, 0x7032,
+	0x2001, 0x1820, 0x2004, 0x7036, 0x0030, 0x2001, 0x1818, 0x2004,
+	0x9084, 0x00ff, 0x7036, 0x60c3, 0x001c, 0x0804, 0x9cd9, 0x080c,
+	0x9969, 0x7003, 0x0500, 0x080c, 0xaa42, 0x1120, 0xb8a0, 0x9082,
+	0x007f, 0x0248, 0x2001, 0x181f, 0x2004, 0x700a, 0x2001, 0x1820,
+	0x2004, 0x700e, 0x0030, 0x2001, 0x1818, 0x2004, 0x9084, 0x00ff,
+	0x700e, 0x20a9, 0x0004, 0x20e1, 0x0001, 0x2099, 0x1805, 0x20e9,
+	0x0000, 0x20a1, 0x0250, 0x4003, 0x60c3, 0x0010, 0x0804, 0x9cd9,
+	0x080c, 0x9969, 0x9006, 0x080c, 0x6934, 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, 0x9847, 0x00d6,
+	0x2069, 0x196c, 0x2001, 0x1837, 0x2004, 0xd0a4, 0x0188, 0x6800,
+	0x700a, 0x6808, 0x9084, 0x2000, 0x7012, 0x080c, 0xaa59, 0x680c,
+	0x7016, 0x701f, 0x2710, 0x6818, 0x7022, 0x681c, 0x7026, 0x0090,
+	0x6800, 0x700a, 0x6804, 0x700e, 0x6808, 0x080c, 0x73e4, 0x1118,
+	0x9084, 0x37ff, 0x0010, 0x9084, 0x3fff, 0x7012, 0x080c, 0xaa59,
+	0x680c, 0x7016, 0x00de, 0x20a9, 0x0004, 0x20e1, 0x0001, 0x2099,
+	0x1805, 0x20e9, 0x0000, 0x20a1, 0x0256, 0x4003, 0x20a9, 0x0004,
+	0x2099, 0x1801, 0x20a1, 0x025a, 0x4003, 0x00d6, 0x080c, 0xa566,
+	0x2069, 0x1974, 0x2071, 0x024e, 0x6800, 0xc0dd, 0x7002, 0x080c,
+	0x5600, 0xd0e4, 0x0110, 0x680c, 0x700e, 0x00de, 0x04a8, 0x2001,
+	0x1837, 0x2004, 0xd0a4, 0x0170, 0x0016, 0x2001, 0x196d, 0x200c,
+	0x60e0, 0x9106, 0x0130, 0x2100, 0x60e3, 0x0000, 0x080c, 0x2643,
+	0x61e2, 0x001e, 0x20e1, 0x0001, 0x2099, 0x196c, 0x20e9, 0x0000,
+	0x20a1, 0x024e, 0x20a9, 0x0008, 0x4003, 0x20a9, 0x0004, 0x2099,
+	0x1805, 0x20a1, 0x0256, 0x4003, 0x20a9, 0x0004, 0x2099, 0x1801,
+	0x20a1, 0x025a, 0x4003, 0x080c, 0xa566, 0x20a1, 0x024e, 0x20a9,
+	0x0008, 0x2099, 0x1974, 0x4003, 0x60c3, 0x0074, 0x0804, 0x9cd9,
+	0x080c, 0x9969, 0x7003, 0x2010, 0x7007, 0x0014, 0x700b, 0x0800,
+	0x700f, 0x2000, 0x9006, 0x00f6, 0x2079, 0x1847, 0x7904, 0x00fe,
+	0xd1ac, 0x1110, 0x9085, 0x0020, 0xd1a4, 0x0110, 0x9085, 0x0010,
+	0x9085, 0x0002, 0x00d6, 0x0804, 0x9919, 0x7026, 0x60c3, 0x0014,
+	0x0804, 0x9cd9, 0x080c, 0x9969, 0x7003, 0x5000, 0x0804, 0x97f2,
+	0x080c, 0x9969, 0x7003, 0x2110, 0x7007, 0x0014, 0x60c3, 0x0014,
+	0x0804, 0x9cd9, 0x080c, 0x99ab, 0x0010, 0x080c, 0x99b4, 0x7003,
+	0x0200, 0x60c3, 0x0004, 0x0804, 0x9cd9, 0x080c, 0x99b4, 0x7003,
+	0x0100, 0x700b, 0x0003, 0x700f, 0x2a00, 0x60c3, 0x0008, 0x0804,
+	0x9cd9, 0x080c, 0x99b4, 0x7003, 0x0200, 0x0804, 0x97f2, 0x080c,
+	0x99b4, 0x7003, 0x0100, 0x782c, 0x9005, 0x0110, 0x700a, 0x0010,
+	0x700b, 0x0003, 0x7814, 0x700e, 0x60c3, 0x0008, 0x0804, 0x9cd9,
+	0x00d6, 0x080c, 0x99b4, 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, 0x1847,
+	0x7904, 0x00fe, 0xd1ac, 0x1110, 0x9085, 0x0020, 0xd1a4, 0x0110,
+	0x9085, 0x0010, 0x2009, 0x1869, 0x210c, 0xd184, 0x1110, 0x9085,
+	0x0002, 0x0026, 0x2009, 0x1867, 0x210c, 0xd1e4, 0x0150, 0xc0c5,
+	0xbad4, 0xd28c, 0x1108, 0xc0cd, 0x9094, 0x0030, 0x9296, 0x0010,
+	0x0140, 0xd1ec, 0x0130, 0x9094, 0x0030, 0x9296, 0x0010, 0x0108,
+	0xc0bd, 0x002e, 0x7026, 0x60c3, 0x0014, 0x00de, 0x0804, 0x9cd9,
+	0x080c, 0x99b4, 0x7003, 0x0210, 0x7007, 0x0014, 0x700f, 0x0100,
+	0x60c3, 0x0014, 0x0804, 0x9cd9, 0x080c, 0x99b4, 0x7003, 0x0200,
+	0x0804, 0x9778, 0x080c, 0x99b4, 0x7003, 0x0100, 0x700b, 0x0003,
+	0x700f, 0x2a00, 0x60c3, 0x0008, 0x0804, 0x9cd9, 0x080c, 0x99b4,
+	0x7003, 0x0100, 0x700b, 0x000b, 0x60c3, 0x0008, 0x0804, 0x9cd9,
+	0x0026, 0x00d6, 0x0036, 0x0046, 0x2019, 0x3200, 0x2021, 0x0800,
+	0x0040, 0x0026, 0x00d6, 0x0036, 0x0046, 0x2019, 0x2200, 0x2021,
+	0x0100, 0x080c, 0xa57b, 0xb810, 0x9305, 0x7002, 0xb814, 0x7006,
+	0x2069, 0x1800, 0x687c, 0x700a, 0x6880, 0x700e, 0x9485, 0x0029,
+	0x7012, 0x004e, 0x003e, 0x00de, 0x080c, 0x9ccd, 0x721a, 0x9f95,
+	0x0000, 0x7222, 0x7027, 0xffff, 0x2071, 0x024c, 0x002e, 0x0005,
+	0x0026, 0x080c, 0xa57b, 0x7003, 0x02ff, 0x7007, 0xfffc, 0x00d6,
+	0x2069, 0x1800, 0x687c, 0x700a, 0x6880, 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, 0xa57b, 0xb810, 0x9305,
+	0x7002, 0xb814, 0x7006, 0x2069, 0x1800, 0xb810, 0x9005, 0x1140,
+	0xb814, 0x9005, 0x1128, 0x700b, 0x00ff, 0x700f, 0xfffe, 0x0020,
+	0x687c, 0x700a, 0x6880, 0x700e, 0x0000, 0x9485, 0x0098, 0x7012,
+	0x004e, 0x003e, 0x00de, 0x080c, 0x9ccd, 0x721a, 0x7a08, 0x7222,
+	0x2f10, 0x7226, 0x2071, 0x024c, 0x002e, 0x0005, 0x080c, 0x9ccd,
+	0x721a, 0x7a08, 0x7222, 0x7814, 0x7026, 0x2071, 0x024c, 0x002e,
+	0x0005, 0x00b6, 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x2069, 0x0200,
+	0x2071, 0x0240, 0x6004, 0x908a, 0x0085, 0x0a0c, 0x0d7d, 0x908a,
+	0x0092, 0x1a0c, 0x0d7d, 0x6110, 0x2158, 0xb984, 0x2c78, 0x2061,
+	0x0100, 0x619a, 0x9082, 0x0085, 0x0033, 0x00fe, 0x00ee, 0x00de,
+	0x00ce, 0x00be, 0x0005, 0x9a22, 0x9a31, 0x9a3c, 0x9a20, 0x9a20,
+	0x9a20, 0x9a22, 0x9a20, 0x9a20, 0x9a20, 0x9a20, 0x9a20, 0x9a20,
+	0x080c, 0x0d7d, 0x0411, 0x60c3, 0x0000, 0x0026, 0x080c, 0x2940,
+	0x0228, 0x2011, 0x0101, 0x2204, 0xc0c5, 0x2012, 0x002e, 0x0804,
+	0x9cd9, 0x0431, 0x7808, 0x700a, 0x7814, 0x700e, 0x7017, 0xffff,
+	0x60c3, 0x000c, 0x0804, 0x9cd9, 0x0479, 0x7003, 0x0003, 0x7007,
+	0x0300, 0x60c3, 0x0004, 0x0804, 0x9cd9, 0x0026, 0x080c, 0xa57b,
+	0xb810, 0x9085, 0x8100, 0x7002, 0xb814, 0x7006, 0x2069, 0x1800,
+	0x687c, 0x700a, 0x6880, 0x700e, 0x7013, 0x0009, 0x0804, 0x9984,
+	0x0026, 0x080c, 0xa57b, 0xb810, 0x9085, 0x8400, 0x7002, 0xb814,
+	0x7006, 0x2069, 0x1800, 0x687c, 0x700a, 0x6880, 0x700e, 0x2001,
+	0x0099, 0x7012, 0x0804, 0x99e6, 0x0026, 0x080c, 0xa57b, 0xb810,
+	0x9085, 0x8500, 0x7002, 0xb814, 0x7006, 0x2069, 0x1800, 0x687c,
+	0x700a, 0x6880, 0x700e, 0x2001, 0x0099, 0x7012, 0x0804, 0x99e6,
+	0x00b6, 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x2c78, 0x2069, 0x0200,
+	0x2071, 0x0240, 0x7804, 0x908a, 0x0040, 0x0a0c, 0x0d7d, 0x908a,
+	0x0057, 0x1a0c, 0x0d7d, 0x7910, 0x2158, 0xb984, 0x2061, 0x0100,
+	0x619a, 0x9082, 0x0040, 0x0033, 0x00fe, 0x00ee, 0x00de, 0x00ce,
+	0x00be, 0x0005, 0x9ab5, 0x9ab5, 0x9ab5, 0x9ad9, 0x9ab5, 0x9ab5,
+	0x9ab5, 0x9ab5, 0x9ab5, 0x9ab5, 0x9ab5, 0xa0c6, 0xa0d2, 0xa0de,
+	0xa0ea, 0x9ab5, 0x9ab5, 0x9ab5, 0xa0ba, 0x080c, 0x0d7d, 0x6813,
+	0x0008, 0xba8c, 0x8210, 0xb8d4, 0xd084, 0x0128, 0x7a4e, 0x7b14,
+	0x7b52, 0x722e, 0x732a, 0x9294, 0x00ff, 0xba8e, 0x8217, 0x721a,
+	0xba10, 0x9295, 0x0600, 0x7202, 0xba14, 0x7206, 0x6a7c, 0x720a,
+	0x6a80, 0x720e, 0x7013, 0x0829, 0x2f10, 0x7222, 0x7027, 0xffff,
+	0x0005, 0x0016, 0x7814, 0x9084, 0x0700, 0x8007, 0x0013, 0x001e,
+	0x0005, 0x9ae9, 0x9ae9, 0x9aeb, 0x9ae9, 0x9ae9, 0x9ae9, 0x9b05,
+	0x9ae9, 0x080c, 0x0d7d, 0x7914, 0x918c, 0x08ff, 0x918d, 0xf600,
+	0x7916, 0x2009, 0x0003, 0x00b9, 0x2069, 0x1847, 0x6804, 0xd0bc,
+	0x0130, 0x682c, 0x9084, 0x00ff, 0x8007, 0x7032, 0x0010, 0x7033,
+	0x3f00, 0x60c3, 0x0001, 0x0804, 0x9cd9, 0x2009, 0x0003, 0x0019,
+	0x7033, 0x7f00, 0x0cb0, 0x0016, 0x080c, 0xa57b, 0x001e, 0xb810,
+	0x9085, 0x0100, 0x7002, 0xb814, 0x7006, 0x2069, 0x1800, 0x6a7c,
+	0x720a, 0x6a80, 0x720e, 0x7013, 0x0888, 0x918d, 0x0008, 0x7116,
+	0x080c, 0x9ccd, 0x721a, 0x7a08, 0x7222, 0x2f10, 0x7226, 0x0005,
+	0x00b6, 0x00e6, 0x00d6, 0x00c6, 0x0066, 0x0056, 0x0046, 0x0036,
+	0x2061, 0x0100, 0x2071, 0x1800, 0x7160, 0x7810, 0x2058, 0x76dc,
+	0x96b4, 0x0028, 0x0110, 0x737c, 0x7480, 0x2500, 0x76dc, 0x96b4,
+	0x0028, 0x0140, 0x2001, 0x04ff, 0x6062, 0x6067, 0xffff, 0x636a,
+	0x646e, 0x0050, 0x2001, 0x00ff, 0x9085, 0x0400, 0x6062, 0x6067,
+	0xffff, 0x606b, 0x0000, 0x616e, 0xb8b8, 0x6073, 0x0530, 0x6077,
+	0x0008, 0xb88c, 0x8000, 0x9084, 0x00ff, 0xb88e, 0x8007, 0x9085,
+	0x0020, 0x607a, 0x607f, 0x0000, 0x2b00, 0x6082, 0x6087, 0xffff,
+	0x7814, 0x0096, 0x2048, 0xa848, 0x608a, 0xa844, 0x608e, 0xa838,
+	0x60c6, 0xa834, 0x60ca, 0x009e, 0xb86c, 0x60ce, 0x60ab, 0x0036,
+	0x60af, 0x95d5, 0x60d7, 0x0000, 0x2001, 0x1837, 0x2004, 0x9084,
+	0x0028, 0x0128, 0x609f, 0x0000, 0x2001, 0x0092, 0x0058, 0x6028,
+	0xc0bd, 0x602a, 0x609f, 0x00ff, 0x2011, 0xffff, 0x080c, 0x2a0b,
+	0x2001, 0x00b2, 0x2010, 0x900e, 0x080c, 0x2a1a, 0x2009, 0x07d0,
+	0x080c, 0x85c5, 0x003e, 0x004e, 0x005e, 0x006e, 0x00ce, 0x00de,
+	0x00ee, 0x00be, 0x0005, 0x00b6, 0x00e6, 0x00d6, 0x00c6, 0x0066,
+	0x0056, 0x0046, 0x0036, 0x2061, 0x0100, 0x2071, 0x1800, 0x7160,
+	0x7810, 0x2058, 0xb8a0, 0x2028, 0x76dc, 0xd6ac, 0x1168, 0x9582,
+	0x007e, 0x1250, 0x2500, 0x9094, 0xff80, 0x1130, 0x9080, 0x3334,
+	0x2015, 0x9294, 0x00ff, 0x0020, 0xb910, 0xba14, 0x737c, 0x7480,
+	0x70dc, 0xd0ac, 0x1130, 0x9582, 0x007e, 0x1218, 0x9584, 0xff80,
+	0x0138, 0x9185, 0x0400, 0x6062, 0x6266, 0x636a, 0x646e, 0x0030,
+	0x6063, 0x0400, 0x6266, 0x606b, 0x0000, 0x616e, 0xb8b8, 0x6072,
+	0x6077, 0x0000, 0xb864, 0xd0a4, 0x0110, 0x6077, 0x0008, 0xb88c,
+	0x8000, 0x9084, 0x00ff, 0xb88e, 0x8007, 0x9085, 0x0020, 0x607a,
+	0x607f, 0x0000, 0x2b00, 0x6082, 0x6087, 0xffff, 0x7814, 0x0096,
+	0x2048, 0xa848, 0x608a, 0xa844, 0x608e, 0xa838, 0x60c6, 0xa834,
+	0x60ca, 0x009e, 0xb86c, 0x60ce, 0x60ab, 0x0036, 0x60af, 0x95d5,
+	0x60d7, 0x0000, 0xba84, 0x629e, 0x00f6, 0x2079, 0x0140, 0x7803,
+	0x0000, 0x00fe, 0x900e, 0x2011, 0x0092, 0x080c, 0x2a1a, 0x2009,
+	0x07d0, 0x080c, 0x85c5, 0x003e, 0x004e, 0x005e, 0x006e, 0x00ce,
+	0x00de, 0x00ee, 0x00be, 0x0005, 0x00b6, 0x0096, 0x00e6, 0x00d6,
+	0x00c6, 0x0056, 0x0046, 0x0036, 0x2061, 0x0100, 0x2071, 0x1800,
+	0x7810, 0x2058, 0xb8a0, 0x2028, 0xb910, 0xba14, 0x737c, 0x7480,
+	0x7820, 0x0002, 0x9c49, 0x9c49, 0x9c49, 0x9c49, 0x9c49, 0x9c49,
+	0x9c49, 0x9c49, 0x9c49, 0x9c49, 0x9c4b, 0x9c49, 0x9c49, 0x9c49,
+	0x9c49, 0x080c, 0x0d7d, 0x609f, 0x0000, 0x7814, 0x2048, 0xa87c,
+	0xd0fc, 0x05d0, 0xaf90, 0x9784, 0xff00, 0x9105, 0x6062, 0x873f,
+	0x9784, 0xff00, 0x0006, 0x7814, 0x2048, 0xa878, 0xc0fc, 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,
+	0x1837, 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, 0xa848, 0x608a, 0xa844, 0x608e, 0xa838, 0x60c6, 0xa834,
+	0x60ca, 0xb86c, 0x60ce, 0x60af, 0x95d5, 0x60d7, 0x0000, 0x080c,
+	0xa55b, 0x2009, 0x07d0, 0x60c4, 0x9084, 0xfff0, 0x9005, 0x0110,
+	0x2009, 0x1b58, 0x080c, 0x85c5, 0x003e, 0x004e, 0x005e, 0x00ce,
+	0x00de, 0x00ee, 0x009e, 0x00be, 0x0005, 0x7a40, 0x9294, 0x00ff,
+	0x8217, 0x0005, 0x00d6, 0x2069, 0x19e5, 0x686b, 0x0001, 0x00de,
+	0x0005, 0x60a3, 0x0056, 0x60a7, 0x9575, 0x00f1, 0x080c, 0x85b7,
+	0x0005, 0x0016, 0x2001, 0x180c, 0x200c, 0x9184, 0x0600, 0x9086,
+	0x0600, 0x0128, 0x0089, 0x080c, 0x85b7, 0x001e, 0x0005, 0xc1e5,
+	0x2001, 0x180c, 0x2102, 0x2001, 0x19e6, 0x2003, 0x0000, 0x2001,
+	0x19f1, 0x2003, 0x0000, 0x0c88, 0x0006, 0x0016, 0x0026, 0x2009,
+	0x1804, 0x2011, 0x0009, 0x080c, 0x2a1a, 0x002e, 0x001e, 0x000e,
+	0x0005, 0x0016, 0x00c6, 0x0006, 0x080c, 0xa7df, 0x0106, 0x190c,
+	0xa781, 0x2061, 0x0100, 0x61a4, 0x60a7, 0x95f5, 0x0016, 0x0026,
+	0x2009, 0x1804, 0x2011, 0x0008, 0x080c, 0x2a1a, 0x002e, 0x001e,
+	0x010e, 0x190c, 0xa79d, 0x000e, 0xa001, 0xa001, 0xa001, 0x61a6,
+	0x00ce, 0x001e, 0x0005, 0x00c6, 0x00d6, 0x0016, 0x0026, 0x2061,
+	0x0100, 0x2069, 0x0140, 0x080c, 0x73e4, 0x1510, 0x2001, 0x1a0a,
+	0x2004, 0x9005, 0x1904, 0x9d8a, 0x080c, 0x7485, 0x11a8, 0x2069,
+	0x0380, 0x6843, 0x0101, 0x6844, 0xd084, 0x1de8, 0x2061, 0x0100,
+	0x6020, 0xd0b4, 0x1120, 0x6024, 0xd084, 0x090c, 0x0d7d, 0x6843,
+	0x0100, 0x080c, 0x85b7, 0x04b0, 0x00c6, 0x2061, 0x19e5, 0x00f0,
+	0x6904, 0x9194, 0x4000, 0x0598, 0x080c, 0x9d09, 0x080c, 0x29e1,
+	0x00c6, 0x2061, 0x19e5, 0x6134, 0x9192, 0x0008, 0x1278, 0x8108,
+	0x6136, 0x080c, 0xa781, 0x6130, 0x080c, 0xa79d, 0x00ce, 0x81ff,
+	0x01c8, 0x080c, 0x85b7, 0x080c, 0x9cfc, 0x00a0, 0x080c, 0xa781,
+	0x6130, 0x91e5, 0x0000, 0x0150, 0x080c, 0xe5b0, 0x080c, 0x85c0,
+	0x6003, 0x0001, 0x2009, 0x0014, 0x080c, 0xab77, 0x080c, 0xa79d,
+	0x00ce, 0x0000, 0x002e, 0x001e, 0x00de, 0x00ce, 0x0005, 0x2001,
+	0x1a0a, 0x2004, 0x9005, 0x1db0, 0x00c6, 0x2061, 0x19e5, 0x6134,
+	0x9192, 0x0003, 0x1ad8, 0x8108, 0x6136, 0x00ce, 0x080c, 0x85b7,
+	0x080c, 0x5dfc, 0x2009, 0x1846, 0x2114, 0x8210, 0x220a, 0x0c10,
+	0x0096, 0x00c6, 0x00d6, 0x00e6, 0x0016, 0x0026, 0x080c, 0x85cd,
+	0x080c, 0xa781, 0x2001, 0x0387, 0x2003, 0x0202, 0x2071, 0x19e5,
+	0x714c, 0x81ff, 0x0904, 0x9e32, 0x2061, 0x0100, 0x2069, 0x0140,
+	0x080c, 0x73e4, 0x1510, 0x0036, 0x2019, 0x0002, 0x080c, 0x9fef,
+	0x003e, 0x714c, 0x2160, 0x080c, 0xe5b0, 0x2009, 0x004a, 0x6220,
+	0x9296, 0x0009, 0x1130, 0x6114, 0x2148, 0xa87b, 0x0006, 0x2009,
+	0x004a, 0x6003, 0x0003, 0x080c, 0xab77, 0x2001, 0x0386, 0x2003,
+	0x5040, 0x080c, 0x7485, 0x0804, 0x9e32, 0x6904, 0xd1f4, 0x0904,
+	0x9e3f, 0x080c, 0x29e1, 0x00c6, 0x704c, 0x9065, 0x090c, 0x0d7d,
+	0x6020, 0x00ce, 0x9086, 0x0006, 0x1518, 0x61c8, 0x60c4, 0x9105,
+	0x11f8, 0x2009, 0x180c, 0x2104, 0xd0d4, 0x01d0, 0x6214, 0x9294,
+	0x1800, 0x1128, 0x6224, 0x9294, 0x0002, 0x1560, 0x0010, 0xc0d4,
+	0x200a, 0x6014, 0x9084, 0xe7fd, 0x9085, 0x0010, 0x6016, 0x704c,
+	0x2060, 0x080c, 0x9505, 0x2009, 0x0049, 0x080c, 0xab77, 0x00d0,
+	0x0036, 0x2019, 0x0001, 0x080c, 0x9fef, 0x003e, 0x714c, 0x2160,
+	0x080c, 0xe5b0, 0x2009, 0x004a, 0x6220, 0x9296, 0x0009, 0x1130,
+	0x6114, 0x2148, 0xa87b, 0x0006, 0x2009, 0x004a, 0x6003, 0x0003,
+	0x080c, 0xab77, 0x2001, 0x0387, 0x2003, 0x0200, 0x080c, 0xa79d,
+	0x002e, 0x001e, 0x00ee, 0x00de, 0x00ce, 0x009e, 0x0005, 0xd1ec,
+	0x1904, 0x9de9, 0x0804, 0x9deb, 0x0026, 0x00e6, 0x2071, 0x19e5,
+	0x706c, 0xd084, 0x01e8, 0xc084, 0x706e, 0x714c, 0x81ff, 0x01c0,
+	0x2071, 0x0100, 0x9188, 0x0008, 0x2114, 0x928e, 0x0006, 0x1138,
+	0x2009, 0x1984, 0x2011, 0x0012, 0x080c, 0x2a1a, 0x0048, 0x928e,
+	0x0009, 0x0db0, 0x2009, 0x1984, 0x2011, 0x0016, 0x080c, 0x2a1a,
+	0x00ee, 0x002e, 0x0005, 0x9036, 0x2001, 0x19ef, 0x2004, 0x9005,
+	0x0128, 0x9c06, 0x0128, 0x2c30, 0x600c, 0x0cc8, 0x9085, 0x0001,
+	0x0005, 0x00f6, 0x2079, 0x19e5, 0x610c, 0x9006, 0x600e, 0x6044,
+	0xc0fc, 0x6046, 0x86ff, 0x1140, 0x7824, 0x9c06, 0x1118, 0x7826,
+	0x782a, 0x0050, 0x792a, 0x0040, 0x00c6, 0x2660, 0x610e, 0x00ce,
+	0x7824, 0x9c06, 0x1108, 0x7e26, 0x080c, 0xa0f9, 0x080c, 0xc90b,
+	0x00fe, 0x0005, 0x080c, 0x9969, 0x7003, 0x1200, 0x7838, 0x7012,
+	0x783c, 0x7016, 0x00c6, 0x7820, 0x9086, 0x0004, 0x1148, 0x7810,
+	0x9005, 0x0130, 0x00b6, 0x2058, 0xb810, 0xb914, 0x00be, 0x0020,
+	0x2061, 0x1800, 0x607c, 0x6180, 0x9084, 0x00ff, 0x700a, 0x710e,
+	0x00ce, 0x60c3, 0x002c, 0x0804, 0x9cd9, 0x080c, 0x9969, 0x7003,
+	0x0f00, 0x7808, 0xd09c, 0x0128, 0xb810, 0x9084, 0x00ff, 0x700a,
+	0xb814, 0x700e, 0x60c3, 0x0008, 0x0804, 0x9cd9, 0x0156, 0x080c,
+	0x99b4, 0x7003, 0x0200, 0x080c, 0x8685, 0x20a9, 0x0006, 0x2011,
+	0xfff4, 0x2019, 0xfff5, 0x9ef0, 0x0002, 0x2305, 0x2072, 0x8e70,
+	0x2205, 0x2072, 0x8e70, 0x9398, 0x0002, 0x9290, 0x0002, 0x1f04,
+	0x9edd, 0x60c3, 0x001c, 0x015e, 0x0804, 0x9cd9, 0x0016, 0x0026,
+	0x080c, 0x9990, 0x080c, 0x99a2, 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, 0x9cd9, 0x002e, 0x001e, 0x0005, 0x20a9, 0x0010,
+	0x4003, 0x080c, 0xa566, 0x20a1, 0x0240, 0x22a8, 0x4003, 0x0c68,
+	0x080c, 0x9969, 0x7003, 0x6200, 0x7808, 0x700e, 0x60c3, 0x0008,
+	0x0804, 0x9cd9, 0x0016, 0x0026, 0x080c, 0x9969, 0x20e9, 0x0000,
+	0x20a1, 0x024c, 0x7814, 0x0096, 0x2048, 0xa800, 0x2048, 0xa860,
+	0x20e0, 0xa85c, 0x9080, 0x0023, 0x2098, 0x009e, 0x7808, 0x9088,
+	0x0002, 0x21a8, 0x4003, 0x8003, 0x60c2, 0x080c, 0x9cd9, 0x002e,
+	0x001e, 0x0005, 0x00e6, 0x00c6, 0x0006, 0x0126, 0x2091, 0x8000,
+	0x2071, 0x19e5, 0x7010, 0x2060, 0x8cff, 0x0188, 0x080c, 0xc931,
+	0x1110, 0x080c, 0xb4a0, 0x600c, 0x0006, 0x080c, 0xcba8, 0x600f,
+	0x0000, 0x080c, 0xaad8, 0x080c, 0xa0f9, 0x00ce, 0x0c68, 0x2c00,
+	0x7012, 0x700e, 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, 0x19e5, 0x7030,
+	0x2060, 0x8cff, 0x0548, 0x080c, 0x9d09, 0x6ac0, 0x68c3, 0x0000,
+	0x080c, 0x85c0, 0x00c6, 0x2061, 0x0100, 0x080c, 0xa6b7, 0x00ce,
+	0x20a9, 0x01f4, 0x04b1, 0x080c, 0x94a8, 0x6044, 0xd0ac, 0x1128,
+	0x2001, 0x1986, 0x2004, 0x604a, 0x0020, 0x2009, 0x0013, 0x080c,
+	0xab77, 0x000e, 0x001e, 0x002e, 0x006e, 0x00ce, 0x00de, 0x00ee,
+	0x00fe, 0x015e, 0x012e, 0x0005, 0x2001, 0x1800, 0x2004, 0x9096,
+	0x0001, 0x0d78, 0x9096, 0x0004, 0x0d60, 0x080c, 0x85c0, 0x6814,
+	0x9084, 0x0001, 0x0110, 0x68a7, 0x95f5, 0x6817, 0x0008, 0x68c3,
+	0x0000, 0x2011, 0x5da6, 0x080c, 0x850b, 0x20a9, 0x01f4, 0x0009,
+	0x08c0, 0x6824, 0xd094, 0x0140, 0x6827, 0x0004, 0x7804, 0x9084,
+	0x4000, 0x190c, 0x29e1, 0x0090, 0xd084, 0x0118, 0x6827, 0x0001,
+	0x0010, 0x1f04, 0x9fd1, 0x7804, 0x9084, 0x1000, 0x0138, 0x2001,
+	0x0100, 0x080c, 0x29d1, 0x9006, 0x080c, 0x29d1, 0x0005, 0x0126,
+	0x0156, 0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x0066, 0x0026, 0x0016,
+	0x0006, 0x2091, 0x8000, 0x2001, 0x180c, 0x200c, 0x918c, 0xdbff,
+	0x2102, 0x2069, 0x0100, 0x2079, 0x0140, 0x2071, 0x0380, 0x701c,
+	0x0006, 0x701f, 0x0202, 0x2071, 0x19e5, 0x704c, 0x2060, 0x8cff,
+	0x0904, 0xa094, 0x9386, 0x0002, 0x1128, 0x6814, 0x9084, 0x0002,
+	0x0904, 0xa094, 0x68af, 0x95f5, 0x6817, 0x0010, 0x2009, 0x00fa,
+	0x8109, 0x1df0, 0x69c6, 0x68cb, 0x0008, 0x080c, 0x85cd, 0x080c,
+	0x1db4, 0x0046, 0x2009, 0x00a5, 0x080c, 0x0e55, 0x2021, 0x0169,
+	0x2404, 0x9084, 0x000f, 0x9086, 0x0004, 0x11f8, 0x68af, 0x95f5,
+	0x68c6, 0x68cb, 0x0008, 0x00e6, 0x00f6, 0x2079, 0x0090, 0x2071,
+	0x19e5, 0x6814, 0x9084, 0x1984, 0x9085, 0x0012, 0x6816, 0x782b,
+	0x0008, 0x7057, 0x0000, 0x00fe, 0x00ee, 0x9386, 0x0002, 0x1128,
+	0x7884, 0x9005, 0x1110, 0x7887, 0x0001, 0x0016, 0x2009, 0x0040,
+	0x080c, 0x2184, 0x001e, 0x2009, 0x0000, 0x080c, 0x0e55, 0x004e,
+	0x20a9, 0x03e8, 0x6824, 0xd094, 0x0140, 0x6827, 0x0004, 0x7804,
+	0x9084, 0x4000, 0x190c, 0x29e1, 0x0090, 0xd08c, 0x0118, 0x6827,
+	0x0002, 0x0010, 0x1f04, 0xa062, 0x7804, 0x9084, 0x1000, 0x0138,
+	0x2001, 0x0100, 0x080c, 0x29d1, 0x9006, 0x080c, 0x29d1, 0x6827,
+	0x4000, 0x6824, 0x83ff, 0x1180, 0x2009, 0x0049, 0x6020, 0x9086,
+	0x0009, 0x0150, 0x080c, 0x9505, 0x6044, 0xd0ac, 0x1118, 0x6003,
+	0x0002, 0x0010, 0x080c, 0xab77, 0x000e, 0x2071, 0x0380, 0xd08c,
+	0x1110, 0x701f, 0x0200, 0x000e, 0x001e, 0x002e, 0x006e, 0x00ce,
+	0x00de, 0x00ee, 0x00fe, 0x015e, 0x012e, 0x0005, 0x00d6, 0x0126,
+	0x2091, 0x8000, 0x2069, 0x19e5, 0x6a06, 0x012e, 0x00de, 0x0005,
+	0x00d6, 0x0126, 0x2091, 0x8000, 0x2069, 0x19e5, 0x6a3e, 0x012e,
+	0x00de, 0x0005, 0x080c, 0x9ab7, 0x7814, 0x080c, 0x5604, 0x0108,
+	0x782c, 0x7032, 0x7042, 0x7047, 0x1000, 0x0478, 0x080c, 0x9ab7,
+	0x7814, 0x080c, 0x5604, 0x0108, 0x782c, 0x7032, 0x7042, 0x7047,
+	0x4000, 0x0418, 0x080c, 0x9ab7, 0x7814, 0x080c, 0x5604, 0x0108,
+	0x782c, 0x7032, 0x7042, 0x7047, 0x2000, 0x00b8, 0x080c, 0x9ab7,
+	0x7814, 0x080c, 0x5604, 0x0108, 0x782c, 0x7032, 0x7042, 0x7047,
+	0x0400, 0x0058, 0x080c, 0x9ab7, 0x7814, 0x080c, 0x5604, 0x0108,
+	0x782c, 0x7032, 0x7042, 0x7047, 0x0200, 0x60c3, 0x0020, 0x0804,
+	0x9cd9, 0x00e6, 0x2071, 0x19e5, 0x702c, 0x9005, 0x0110, 0x8001,
+	0x702e, 0x00ee, 0x0005, 0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x0076,
+	0x0066, 0x0006, 0x0126, 0x2091, 0x8000, 0x2071, 0x19e5, 0x7620,
+	0x2660, 0x2678, 0x2039, 0x0001, 0x87ff, 0x0904, 0xa19e, 0x8cff,
+	0x0904, 0xa19e, 0x6020, 0x9086, 0x0006, 0x1904, 0xa199, 0x88ff,
+	0x0138, 0x2800, 0x9c06, 0x1904, 0xa199, 0x2039, 0x0000, 0x0050,
+	0x6010, 0x9b06, 0x1904, 0xa199, 0x85ff, 0x0120, 0x605c, 0x9106,
+	0x1904, 0xa199, 0x7030, 0x9c06, 0x15b0, 0x2069, 0x0100, 0x68c0,
+	0x9005, 0x1160, 0x6824, 0xd084, 0x0148, 0x6827, 0x0001, 0x080c,
+	0x85c0, 0x080c, 0xa223, 0x7033, 0x0000, 0x0428, 0x080c, 0x85c0,
+	0x6820, 0xd0b4, 0x0110, 0x68a7, 0x95f5, 0x6817, 0x0008, 0x68c3,
+	0x0000, 0x080c, 0xa223, 0x7033, 0x0000, 0x0036, 0x2069, 0x0140,
+	0x6b04, 0x9384, 0x1000, 0x0138, 0x2001, 0x0100, 0x080c, 0x29d1,
+	0x9006, 0x080c, 0x29d1, 0x2069, 0x0100, 0x6824, 0xd084, 0x0110,
+	0x6827, 0x0001, 0x003e, 0x7020, 0x9c36, 0x1110, 0x660c, 0x7622,
+	0x701c, 0x9c36, 0x1140, 0x2c00, 0x9f36, 0x0118, 0x2f00, 0x701e,
+	0x0010, 0x701f, 0x0000, 0x660c, 0x0066, 0x2c00, 0x9f06, 0x0110,
+	0x7e0e, 0x0008, 0x2678, 0x89ff, 0x1168, 0x600f, 0x0000, 0x6014,
+	0x0096, 0x2048, 0x080c, 0xc721, 0x0110, 0x080c, 0xe134, 0x009e,
+	0x080c, 0xab13, 0x080c, 0xa0f9, 0x88ff, 0x1190, 0x00ce, 0x0804,
+	0xa114, 0x2c78, 0x600c, 0x2060, 0x0804, 0xa114, 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, 0x19e5, 0x7648, 0x2660, 0x2678, 0x8cff, 0x0904,
+	0xa212, 0x6020, 0x9086, 0x0006, 0x1904, 0xa20d, 0x87ff, 0x0128,
+	0x2700, 0x9c06, 0x1904, 0xa20d, 0x0040, 0x6010, 0x9b06, 0x15e8,
+	0x85ff, 0x0118, 0x605c, 0x9106, 0x15c0, 0x704c, 0x9c06, 0x1168,
+	0x0036, 0x2019, 0x0001, 0x080c, 0x9fef, 0x703f, 0x0000, 0x9006,
+	0x704e, 0x706a, 0x7052, 0x706e, 0x003e, 0x7048, 0x9c36, 0x1110,
+	0x660c, 0x764a, 0x7044, 0x9c36, 0x1140, 0x2c00, 0x9f36, 0x0118,
+	0x2f00, 0x7046, 0x0010, 0x7047, 0x0000, 0x660c, 0x0066, 0x2c00,
+	0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678, 0x600f, 0x0000, 0x6014,
+	0x2048, 0x080c, 0xc721, 0x0110, 0x080c, 0xe134, 0x080c, 0xab13,
+	0x87ff, 0x1198, 0x00ce, 0x0804, 0xa1be, 0x2c78, 0x600c, 0x2060,
+	0x0804, 0xa1be, 0x9006, 0x012e, 0x000e, 0x002e, 0x006e, 0x00ce,
+	0x009e, 0x00de, 0x00ee, 0x00fe, 0x0005, 0x601b, 0x0000, 0x00ce,
+	0x97bd, 0x0001, 0x0c80, 0x00e6, 0x2071, 0x19e5, 0x7033, 0x0000,
+	0x7004, 0x9086, 0x0003, 0x0158, 0x2001, 0x1800, 0x2004, 0x9086,
+	0x0002, 0x1118, 0x7007, 0x0005, 0x0010, 0x7007, 0x0000, 0x00ee,
+	0x0005, 0x00f6, 0x00e6, 0x00c6, 0x0066, 0x0026, 0x0006, 0x0126,
+	0x2091, 0x8000, 0x2071, 0x19e5, 0x2c10, 0x7648, 0x2660, 0x2678,
+	0x8cff, 0x0518, 0x2200, 0x9c06, 0x11e0, 0x7048, 0x9c36, 0x1110,
+	0x660c, 0x764a, 0x7044, 0x9c36, 0x1140, 0x2c00, 0x9f36, 0x0118,
+	0x2f00, 0x7046, 0x0010, 0x7047, 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, 0x19e5, 0x7610, 0x2660, 0x2678, 0x8cff, 0x0904, 0xa305,
+	0x6010, 0x00b6, 0x2058, 0xb8a0, 0x00be, 0x9206, 0x1904, 0xa300,
+	0x7030, 0x9c06, 0x1520, 0x2069, 0x0100, 0x68c0, 0x9005, 0x0904,
+	0xa2dc, 0x080c, 0x9d09, 0x68c3, 0x0000, 0x080c, 0xa223, 0x7033,
+	0x0000, 0x0036, 0x2069, 0x0140, 0x6b04, 0x9384, 0x1000, 0x0138,
+	0x2001, 0x0100, 0x080c, 0x29d1, 0x9006, 0x080c, 0x29d1, 0x2069,
+	0x0100, 0x6824, 0xd084, 0x0110, 0x6827, 0x0001, 0x003e, 0x7010,
+	0x9c36, 0x1110, 0x660c, 0x7612, 0x700c, 0x9c36, 0x1140, 0x2c00,
+	0x9f36, 0x0118, 0x2f00, 0x700e, 0x0010, 0x700f, 0x0000, 0x660c,
+	0x0066, 0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678, 0x600f,
+	0x0000, 0x080c, 0xc920, 0x1158, 0x080c, 0x31dc, 0x080c, 0xc931,
+	0x11f0, 0x080c, 0xb4a0, 0x00d8, 0x080c, 0xa223, 0x08c0, 0x080c,
+	0xc931, 0x1118, 0x080c, 0xb4a0, 0x0090, 0x6014, 0x2048, 0x080c,
+	0xc721, 0x0168, 0x6020, 0x9086, 0x0003, 0x1508, 0xa867, 0x0103,
+	0xab7a, 0xa877, 0x0000, 0x080c, 0x6c73, 0x080c, 0xc90b, 0x080c,
+	0xcba8, 0x080c, 0xab13, 0x080c, 0xa0f9, 0x00ce, 0x0804, 0xa285,
+	0x2c78, 0x600c, 0x2060, 0x0804, 0xa285, 0x012e, 0x000e, 0x002e,
+	0x006e, 0x00ce, 0x00de, 0x00ee, 0x00fe, 0x009e, 0x0005, 0x6020,
+	0x9086, 0x0006, 0x1d20, 0x080c, 0xe134, 0x0c08, 0x00d6, 0x080c,
+	0x99b4, 0x7003, 0x0200, 0x7007, 0x0014, 0x60c3, 0x0014, 0x20e1,
+	0x0001, 0x2099, 0x1987, 0x20e9, 0x0000, 0x20a1, 0x0250, 0x20a9,
+	0x0004, 0x4003, 0x7023, 0x0004, 0x7027, 0x7878, 0x080c, 0x9cd9,
+	0x00de, 0x0005, 0x080c, 0x99b4, 0x700b, 0x0800, 0x7814, 0x9084,
+	0xff00, 0x700e, 0x7814, 0x9084, 0x00ff, 0x7022, 0x782c, 0x7026,
+	0x7860, 0x9084, 0x00ff, 0x9085, 0x0200, 0x7002, 0x7860, 0x9084,
+	0xff00, 0x8007, 0x7006, 0x60c2, 0x0804, 0x9cd9, 0x00b6, 0x00d6,
+	0x0016, 0x00d6, 0x2f68, 0x2009, 0x0035, 0x080c, 0xcdad, 0x00de,
+	0x1904, 0xa3b3, 0x080c, 0x9969, 0x7003, 0x1300, 0x782c, 0x080c,
+	0xa4be, 0x2068, 0x6820, 0x9086, 0x0003, 0x0560, 0x7810, 0x2058,
+	0xbaa0, 0x080c, 0xaa42, 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, 0xb884,
+	0x700e, 0x00a8, 0x080c, 0xaa42, 0x1130, 0x7810, 0x2058, 0xb8a0,
+	0x9082, 0x007e, 0x0250, 0x00d6, 0x2069, 0x181f, 0x2d04, 0x700a,
+	0x8d68, 0x2d04, 0x700e, 0x00de, 0x0010, 0x6034, 0x700e, 0x7838,
+	0x7012, 0x783c, 0x7016, 0x60c3, 0x000c, 0x001e, 0x00de, 0x080c,
+	0x9cd9, 0x00be, 0x0005, 0x781b, 0x0001, 0x7803, 0x0006, 0x001e,
+	0x00de, 0x00be, 0x0005, 0x792c, 0x9180, 0x0008, 0x200c, 0x9186,
+	0x0006, 0x01c0, 0x9186, 0x0003, 0x0904, 0xa431, 0x9186, 0x0005,
+	0x0904, 0xa419, 0x9186, 0x0004, 0x05f0, 0x9186, 0x0008, 0x0904,
+	0xa422, 0x7807, 0x0037, 0x782f, 0x0003, 0x7817, 0x1700, 0x080c,
+	0xa49b, 0x0005, 0x080c, 0xa45c, 0x00d6, 0x0026, 0x792c, 0x2168,
+	0x2009, 0x4000, 0x6800, 0x6a44, 0xd2fc, 0x11f8, 0x0002, 0xa3fa,
+	0xa405, 0xa3fc, 0xa405, 0xa401, 0xa3fa, 0xa3fa, 0xa405, 0xa405,
+	0xa405, 0xa405, 0xa3fa, 0xa3fa, 0xa3fa, 0xa3fa, 0xa3fa, 0xa405,
+	0xa3fa, 0xa405, 0x080c, 0x0d7d, 0x6824, 0xd0e4, 0x0110, 0xd0cc,
+	0x0110, 0x900e, 0x0010, 0x2009, 0x2000, 0x682c, 0x7022, 0x6830,
+	0x7026, 0x0804, 0xa455, 0x080c, 0xa45c, 0x00d6, 0x0026, 0x792c,
+	0x2168, 0x2009, 0x4000, 0x6a00, 0x9286, 0x0002, 0x1108, 0x900e,
+	0x04e0, 0x080c, 0xa45c, 0x00d6, 0x0026, 0x792c, 0x2168, 0x2009,
+	0x4000, 0x0498, 0x04c9, 0x00d6, 0x0026, 0x792c, 0x2168, 0x2009,
+	0x4000, 0x9286, 0x0005, 0x0118, 0x9286, 0x0002, 0x1108, 0x900e,
+	0x0420, 0x0451, 0x00d6, 0x0026, 0x792c, 0x2168, 0x6814, 0x0096,
+	0x2048, 0xa9ac, 0xa834, 0x9112, 0xa9b0, 0xa838, 0x009e, 0x9103,
+	0x7022, 0x7226, 0x792c, 0x9180, 0x0011, 0x2004, 0xd0fc, 0x1148,
+	0x9180, 0x0000, 0x2004, 0x908e, 0x0002, 0x0130, 0x908e, 0x0004,
+	0x0118, 0x2009, 0x4000, 0x0008, 0x900e, 0x712a, 0x60c3, 0x0018,
+	0x002e, 0x00de, 0x0804, 0x9cd9, 0x00b6, 0x0036, 0x0046, 0x0056,
+	0x0066, 0x080c, 0x99b4, 0x9006, 0x7003, 0x0200, 0x7938, 0x710a,
+	0x793c, 0x710e, 0x7810, 0x2058, 0xb8a0, 0x080c, 0xaa42, 0x1118,
+	0x9092, 0x007e, 0x0268, 0x00d6, 0x2069, 0x181f, 0x2d2c, 0x8d68,
+	0x2d34, 0x90d8, 0x1000, 0x2b5c, 0xbb10, 0xbc14, 0x00de, 0x0028,
+	0x901e, 0xbc84, 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, 0x99b4, 0x7003, 0x0100, 0x782c,
+	0x700a, 0x7814, 0x700e, 0x700e, 0x60c3, 0x0008, 0x0804, 0x9cd9,
+	0x080c, 0x9960, 0x7003, 0x1400, 0x7838, 0x700a, 0x0079, 0x783c,
+	0x700e, 0x782c, 0x7012, 0x7830, 0x7016, 0x7834, 0x9084, 0x00ff,
+	0x8007, 0x701a, 0x60c3, 0x0010, 0x0804, 0x9cd9, 0x00e6, 0x2071,
+	0x0240, 0x0006, 0x00f6, 0x2078, 0x7810, 0x00b6, 0x2058, 0xb8d4,
+	0xd084, 0x0120, 0x7850, 0x702a, 0x784c, 0x702e, 0x00be, 0x00fe,
+	0x000e, 0x00ee, 0x0005, 0x080c, 0x99ab, 0x7003, 0x0100, 0x782c,
+	0x700a, 0x7814, 0x700e, 0x60c3, 0x0008, 0x0804, 0x9cd9, 0x00a9,
+	0x7914, 0x712a, 0x60c3, 0x0000, 0x60a7, 0x9575, 0x0026, 0x080c,
+	0x2940, 0x0228, 0x2011, 0x0101, 0x2204, 0xc0c5, 0x2012, 0x002e,
+	0x080c, 0x9cfc, 0x080c, 0x85b7, 0x0005, 0x0036, 0x0096, 0x00d6,
+	0x00e6, 0x7860, 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, 0xa57b, 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, 0x19b0, 0x210c, 0x009e,
+	0x918d, 0x0092, 0x0010, 0x2009, 0x0096, 0x60ab, 0x0036, 0x0026,
+	0x2110, 0x900e, 0x080c, 0x2a1a, 0x002e, 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, 0x080c,
+	0x9969, 0x0016, 0x0026, 0x0096, 0x00d6, 0x7814, 0x2048, 0x7013,
+	0x0138, 0x2001, 0x1837, 0x2004, 0x9084, 0x0028, 0x1138, 0x2001,
+	0x197c, 0x2004, 0x9086, 0xaaaa, 0x1904, 0xa620, 0x7003, 0x5400,
+	0x00c6, 0x2061, 0x1800, 0x607c, 0x9084, 0x00ff, 0xa998, 0x810f,
+	0x918c, 0xff00, 0x9105, 0x700a, 0x6080, 0x700e, 0xa998, 0x918c,
+	0xff00, 0x7112, 0x20a9, 0x0004, 0x2009, 0x1805, 0x2e10, 0x9290,
+	0x0006, 0x2104, 0x2012, 0x8108, 0x8210, 0x1f04, 0xa5b1, 0x20a9,
+	0x0004, 0x2009, 0x1801, 0x2104, 0x2012, 0x8108, 0x8210, 0x1f04,
+	0xa5bb, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x0029, 0x2098, 0x2009,
+	0x0006, 0x20a9, 0x0001, 0x4002, 0x8007, 0x2012, 0x8210, 0x8109,
+	0x1dc0, 0x00d6, 0x2069, 0x0200, 0x080c, 0xa566, 0x00de, 0x2071,
+	0x0240, 0x2011, 0x0240, 0x2009, 0x0002, 0x20a9, 0x0001, 0x4002,
+	0x8007, 0x2012, 0x8210, 0x8109, 0x1dc0, 0x2009, 0x0008, 0x20a9,
+	0x0001, 0x4002, 0x8007, 0x2012, 0x8210, 0x8109, 0x1dc0, 0xa85c,
+	0x9080, 0x0031, 0x2098, 0x2009, 0x0008, 0x20a9, 0x0001, 0x4002,
+	0x8007, 0x2012, 0x8210, 0x8109, 0x1dc0, 0x00ce, 0x60c3, 0x004c,
+	0x60a3, 0x0056, 0x60a7, 0x9575, 0x2001, 0x1837, 0x2004, 0x9084,
+	0x0028, 0x1168, 0x080c, 0x73e4, 0x0150, 0x6028, 0xc0bd, 0x602a,
+	0x2009, 0x1804, 0x2011, 0x0029, 0x080c, 0x2a1a, 0x0010, 0x080c,
+	0x9cd9, 0x080c, 0x85b7, 0x00de, 0x009e, 0x002e, 0x001e, 0x0005,
+	0x00e6, 0x2071, 0x0240, 0x2001, 0x2200, 0x9085, 0x00ff, 0x7002,
+	0x7007, 0xffff, 0x2071, 0x0100, 0x709b, 0x00ff, 0x00ee, 0x0804,
+	0xa596, 0x080c, 0x9969, 0x0016, 0x0026, 0x0096, 0x00d6, 0x7814,
+	0x2048, 0x7013, 0x0138, 0x7003, 0x5500, 0x00c6, 0xa89c, 0x9084,
+	0x00ff, 0xa998, 0x810f, 0x918c, 0xff00, 0x9105, 0x700a, 0xa99c,
+	0x918c, 0xff00, 0xa8a0, 0x9084, 0x00ff, 0x9105, 0x700e, 0xa998,
+	0x918c, 0xff00, 0x2061, 0x1800, 0x607c, 0x9084, 0x00ff, 0x910d,
+	0x7112, 0x6180, 0x7116, 0x2009, 0x0008, 0xa860, 0x20e0, 0xa85c,
+	0x9080, 0x0029, 0x2098, 0x2e10, 0x9290, 0x0006, 0x20a9, 0x0001,
+	0x4002, 0x8007, 0x2012, 0x8210, 0x8109, 0x1dc0, 0x20a9, 0x0004,
+	0x2009, 0x1805, 0x2104, 0x2012, 0x8108, 0x8210, 0x1f04, 0xa672,
+	0x20a9, 0x0002, 0x2009, 0x1801, 0x2104, 0x2012, 0x8108, 0x8210,
+	0x1f04, 0xa67c, 0x00d6, 0x0016, 0x2069, 0x0200, 0x080c, 0xa566,
+	0x001e, 0x00de, 0x2071, 0x0240, 0x20a9, 0x0002, 0x2009, 0x1803,
+	0x2011, 0x0240, 0x2104, 0x2012, 0x8108, 0x8210, 0x1f04, 0xa692,
+	0x2009, 0x0008, 0x4002, 0x8007, 0x2012, 0x8210, 0x8109, 0x1dd0,
+	0x9006, 0x20a9, 0x0008, 0x2012, 0x8210, 0x1f04, 0xa6a3, 0x00ce,
+	0x60c3, 0x004c, 0x60a3, 0x0056, 0x60a7, 0x9575, 0x080c, 0x9cd9,
+	0x080c, 0x85b7, 0x00de, 0x009e, 0x002e, 0x001e, 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, 0x00f6,
+	0x00e6, 0x00d6, 0x00c6, 0x00a6, 0x0096, 0x0066, 0x0126, 0x2091,
+	0x8000, 0x2071, 0x19e5, 0x7610, 0x2660, 0x2678, 0x8cff, 0x0904,
+	0xa75e, 0x7030, 0x9c06, 0x1520, 0x2069, 0x0100, 0x68c0, 0x9005,
+	0x0904, 0xa735, 0x080c, 0x9d09, 0x68c3, 0x0000, 0x080c, 0xa223,
+	0x7033, 0x0000, 0x0036, 0x2069, 0x0140, 0x6b04, 0x9384, 0x1000,
+	0x0138, 0x2001, 0x0100, 0x080c, 0x29d1, 0x9006, 0x080c, 0x29d1,
+	0x2069, 0x0100, 0x6824, 0xd084, 0x0110, 0x6827, 0x0001, 0x003e,
+	0x7010, 0x9c36, 0x1110, 0x660c, 0x7612, 0x700c, 0x9c36, 0x1140,
+	0x2c00, 0x9f36, 0x0118, 0x2f00, 0x700e, 0x0010, 0x700f, 0x0000,
+	0x660c, 0x0066, 0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678,
+	0x600f, 0x0000, 0x080c, 0xc920, 0x1158, 0x080c, 0x31dc, 0x080c,
+	0xc931, 0x11f0, 0x080c, 0xb4a0, 0x00d8, 0x080c, 0xa223, 0x08c0,
+	0x080c, 0xc931, 0x1118, 0x080c, 0xb4a0, 0x0090, 0x6014, 0x2048,
+	0x080c, 0xc721, 0x0168, 0x6020, 0x9086, 0x0003, 0x1520, 0xa867,
+	0x0103, 0xab7a, 0xa877, 0x0000, 0x080c, 0x6c7f, 0x080c, 0xc90b,
+	0x080c, 0xcba8, 0x080c, 0xab13, 0x080c, 0xa0f9, 0x00ce, 0x0804,
+	0xa6e6, 0x2c78, 0x600c, 0x2060, 0x0804, 0xa6e6, 0x7013, 0x0000,
+	0x700f, 0x0000, 0x012e, 0x006e, 0x009e, 0x00ae, 0x00ce, 0x00de,
+	0x00ee, 0x00fe, 0x0005, 0x6020, 0x9086, 0x0006, 0x1d08, 0x080c,
+	0xe134, 0x08f0, 0x00f6, 0x0036, 0x2079, 0x0380, 0x7b18, 0xd3bc,
+	0x1de8, 0x7832, 0x7936, 0x7a3a, 0x781b, 0x8080, 0x003e, 0x00fe,
+	0x0005, 0x0016, 0x2001, 0x0382, 0x2004, 0x9084, 0x0007, 0x9086,
+	0x0001, 0x1188, 0x2001, 0x0015, 0x0c29, 0x2009, 0x1000, 0x2001,
+	0x0382, 0x2004, 0x9084, 0x0007, 0x9086, 0x0003, 0x0120, 0x8109,
+	0x1db0, 0x080c, 0x0d7d, 0x001e, 0x0005, 0x2001, 0x0382, 0x2004,
+	0x9084, 0x0007, 0x9086, 0x0003, 0x1120, 0x2001, 0x0380, 0x2003,
+	0x0001, 0x0005, 0x0156, 0x0016, 0x0026, 0x00e6, 0x900e, 0x2071,
+	0x19e5, 0x0469, 0x0106, 0x0190, 0x7004, 0x9086, 0x0003, 0x0148,
+	0x20a9, 0x1000, 0x6044, 0xd0fc, 0x01d8, 0x1f04, 0xa7ba, 0x080c,
+	0x0d7d, 0x080c, 0xa781, 0x6044, 0xd0fc, 0x0190, 0x7030, 0x9c06,
+	0x1148, 0x080c, 0x94a8, 0x6044, 0xd0dc, 0x0150, 0xc0dc, 0x6046,
+	0x700a, 0x7042, 0x704c, 0x9c06, 0x190c, 0x0d7d, 0x080c, 0x9505,
+	0x010e, 0x1919, 0x00ee, 0x002e, 0x001e, 0x015e, 0x0005, 0x2001,
+	0x0382, 0x2004, 0x9084, 0x0007, 0x9086, 0x0003, 0x0005, 0x0126,
+	0x2091, 0x2400, 0x7808, 0xd0a4, 0x190c, 0x0d76, 0xd09c, 0x0128,
+	0x7820, 0x908c, 0xf000, 0x11b8, 0x0012, 0x012e, 0x0005, 0xa807,
+	0xa845, 0xa86c, 0xa8a3, 0xa8b3, 0xa8c4, 0xa8d3, 0xa8e1, 0xa90e,
+	0xa912, 0xa807, 0xa807, 0xa807, 0xa807, 0xa807, 0xa807, 0x080c,
+	0x0d7d, 0x012e, 0x0005, 0x2060, 0x6044, 0xd0bc, 0x0140, 0xc0bc,
+	0x6046, 0x6000, 0x908a, 0x0016, 0x1a0c, 0x0d7d, 0x0012, 0x012e,
+	0x0005, 0xa82c, 0xa82e, 0xa82c, 0xa834, 0xa82c, 0xa82c, 0xa82c,
+	0xa82c, 0xa82c, 0xa82e, 0xa82c, 0xa82e, 0xa82c, 0xa82e, 0xa82c,
+	0xa82c, 0xa82c, 0xa82e, 0xa82c, 0x080c, 0x0d7d, 0x2009, 0x0013,
+	0x080c, 0xab77, 0x012e, 0x0005, 0x6014, 0x2048, 0xa87c, 0xd0dc,
+	0x0130, 0x080c, 0x878b, 0x080c, 0xaad8, 0x012e, 0x0005, 0x2009,
+	0x0049, 0x080c, 0xab77, 0x012e, 0x0005, 0x080c, 0xa781, 0x2001,
+	0x1a0a, 0x2003, 0x0000, 0x7030, 0x9065, 0x090c, 0x0d7d, 0x7034,
+	0x9092, 0x00c8, 0x1258, 0x8000, 0x7036, 0x7004, 0x9086, 0x0003,
+	0x0110, 0x7007, 0x0000, 0x781f, 0x0808, 0x0040, 0x080c, 0xe5b0,
+	0x6003, 0x0001, 0x2009, 0x0014, 0x080c, 0xab77, 0x781f, 0x0100,
+	0x080c, 0xa79d, 0x012e, 0x0005, 0x080c, 0xa781, 0x714c, 0x81ff,
+	0x1128, 0x2011, 0x1a0d, 0x2013, 0x0000, 0x0438, 0x2061, 0x0100,
+	0x7150, 0x9192, 0x7530, 0x12f0, 0x8108, 0x7152, 0x714c, 0x9188,
+	0x0008, 0x210c, 0x918e, 0x0006, 0x1138, 0x6014, 0x9084, 0x1984,
+	0x9085, 0x0012, 0x6016, 0x0088, 0x714c, 0x9188, 0x0008, 0x210c,
+	0x918e, 0x0009, 0x0d90, 0x6014, 0x9084, 0x1984, 0x9085, 0x0016,
+	0x6016, 0x0018, 0x706c, 0xc085, 0x706e, 0x781f, 0x0200, 0x080c,
+	0xa79d, 0x012e, 0x0005, 0x080c, 0xa781, 0x714c, 0x2160, 0x6003,
+	0x0003, 0x2009, 0x004a, 0x080c, 0xab77, 0x781f, 0x0200, 0x080c,
+	0xa79d, 0x012e, 0x0005, 0x7808, 0xd09c, 0x0de8, 0x7820, 0x2060,
+	0x6003, 0x0003, 0x080c, 0xa781, 0x080c, 0x1d3c, 0x781f, 0x0400,
+	0x080c, 0xa79d, 0x012e, 0x0005, 0x7808, 0xd09c, 0x0de8, 0x7820,
+	0x2060, 0x080c, 0xa781, 0x080c, 0x1d84, 0x781f, 0x0400, 0x080c,
+	0xa79d, 0x012e, 0x0005, 0x7030, 0x9065, 0x0148, 0x6044, 0xc0bc,
+	0x6046, 0x7104, 0x9186, 0x0003, 0x0110, 0x080c, 0x956b, 0x012e,
+	0x0005, 0x00f6, 0x703c, 0x9086, 0x0002, 0x0528, 0x704c, 0x907d,
+	0x0510, 0x7844, 0xc0bc, 0x7846, 0x7820, 0x9086, 0x0009, 0x0118,
+	0x080c, 0x9c24, 0x00c0, 0x7828, 0xd0fc, 0x1118, 0x080c, 0x9ba3,
+	0x0090, 0x2001, 0x1837, 0x2004, 0x9084, 0x0028, 0x1130, 0x2001,
+	0x197c, 0x2004, 0x9086, 0xaaaa, 0x1120, 0x2001, 0x0387, 0x2003,
+	0x1000, 0x080c, 0x9b28, 0x00fe, 0x012e, 0x0005, 0x080c, 0x7485,
+	0x012e, 0x0005, 0x080c, 0x0d7d, 0x0005, 0x00e6, 0x2071, 0x19e5,
+	0x6044, 0xc0bc, 0x6046, 0xd0fc, 0x01b8, 0x704c, 0x9c06, 0x1190,
+	0x2019, 0x0001, 0x080c, 0x9fef, 0x704f, 0x0000, 0x2001, 0x0109,
+	0x2004, 0xd08c, 0x1138, 0x2001, 0x0108, 0x2004, 0xd0bc, 0x1110,
+	0x703f, 0x0000, 0x080c, 0xa239, 0x00ee, 0x0005, 0x0026, 0x7010,
+	0x9c06, 0x1178, 0x080c, 0xa0f9, 0x6044, 0xc0fc, 0x6046, 0x600c,
+	0x9015, 0x0120, 0x7212, 0x600f, 0x0000, 0x0010, 0x7212, 0x720e,
+	0x9006, 0x002e, 0x0005, 0x0026, 0x7020, 0x9c06, 0x1178, 0x080c,
+	0xa0f9, 0x6044, 0xc0fc, 0x6046, 0x600c, 0x9015, 0x0120, 0x7222,
+	0x600f, 0x0000, 0x0010, 0x7222, 0x721e, 0x9006, 0x002e, 0x0005,
+	0x00d6, 0x0036, 0x7830, 0x9c06, 0x1558, 0x2069, 0x0100, 0x68c0,
+	0x9005, 0x01f8, 0x080c, 0x85c0, 0x080c, 0x9d09, 0x68c3, 0x0000,
+	0x080c, 0xa223, 0x2069, 0x0140, 0x6b04, 0x9384, 0x1000, 0x0138,
+	0x2001, 0x0100, 0x080c, 0x29d1, 0x9006, 0x080c, 0x29d1, 0x2069,
+	0x0100, 0x6824, 0xd084, 0x0110, 0x6827, 0x0001, 0x9085, 0x0001,
+	0x0038, 0x7808, 0xc0ad, 0x780a, 0x6003, 0x0009, 0x630a, 0x9006,
+	0x003e, 0x00de, 0x0005, 0x0016, 0x0026, 0x0036, 0x6100, 0x2019,
+	0x0100, 0x2001, 0x0382, 0x2004, 0xd09c, 0x0190, 0x00c6, 0x0126,
+	0x2091, 0x2800, 0x0016, 0x0036, 0x080c, 0xa7e7, 0x003e, 0x001e,
+	0x012e, 0x00ce, 0x6200, 0x2200, 0x9106, 0x0d58, 0x2200, 0x0010,
+	0x8319, 0x1d38, 0x003e, 0x002e, 0x001e, 0x0005, 0x00d6, 0x0156,
+	0x080c, 0x99b4, 0x7a14, 0x82ff, 0x0138, 0x7003, 0x0100, 0x700b,
+	0x0003, 0x60c3, 0x0008, 0x0490, 0x7003, 0x0200, 0x7007, 0x0000,
+	0x2069, 0x1800, 0x901e, 0x6800, 0x9086, 0x0004, 0x1110, 0xc38d,
+	0x0060, 0x080c, 0x73e4, 0x1110, 0xc3ad, 0x0008, 0xc3a5, 0x6adc,
+	0xd29c, 0x1110, 0xd2ac, 0x0108, 0xc39d, 0x730e, 0x080c, 0x8685,
+	0x20a9, 0x0006, 0x2011, 0xfff4, 0x2019, 0xfff5, 0x2071, 0x0250,
+	0x2305, 0x2072, 0x8e70, 0x2205, 0x2072, 0x8e70, 0x9398, 0x0002,
+	0x9290, 0x0002, 0x1f04, 0xa9e8, 0x60c3, 0x0020, 0x080c, 0x9cd9,
+	0x015e, 0x00de, 0x0005, 0x0156, 0x080c, 0x99b4, 0x7a14, 0x82ff,
+	0x0168, 0x9286, 0xffff, 0x0118, 0x9282, 0x000e, 0x1238, 0x7003,
+	0x0100, 0x700b, 0x0003, 0x60c3, 0x0008, 0x0488, 0x7003, 0x0200,
+	0x7007, 0x001c, 0x700f, 0x0001, 0x2011, 0x19bb, 0x2204, 0x8007,
+	0x701a, 0x8210, 0x2204, 0x8007, 0x701e, 0x0421, 0x1120, 0xb8a0,
+	0x9082, 0x007f, 0x0248, 0x2001, 0x181f, 0x2004, 0x7022, 0x2001,
+	0x1820, 0x2004, 0x7026, 0x0030, 0x2001, 0x1818, 0x2004, 0x9084,
+	0x00ff, 0x7026, 0x20a9, 0x0004, 0x20e1, 0x0001, 0x2099, 0x1805,
+	0x20e9, 0x0000, 0x20a1, 0x0256, 0x4003, 0x60c3, 0x001c, 0x015e,
+	0x0804, 0x9cd9, 0x0006, 0x2001, 0x1837, 0x2004, 0xd0ac, 0x000e,
+	0x0005, 0x2011, 0x0003, 0x080c, 0xa0a6, 0x2011, 0x0002, 0x080c,
+	0xa0b0, 0x080c, 0x9f6f, 0x0036, 0x901e, 0x080c, 0x9fef, 0x003e,
+	0x0005, 0x080c, 0x332d, 0x0188, 0x0016, 0x00b6, 0x00c6, 0x7010,
+	0x9085, 0x0020, 0x7012, 0x2009, 0x007e, 0x080c, 0x652d, 0xb85c,
+	0xc0ac, 0xb85e, 0x00ce, 0x00be, 0x001e, 0x0005, 0x2071, 0x188d,
+	0x7000, 0x9005, 0x0140, 0x2001, 0x0812, 0x2071, 0x1800, 0x7076,
+	0x707a, 0x706b, 0xffd4, 0x2071, 0x1800, 0x7074, 0x7056, 0x705b,
+	0x1ddc, 0x0005, 0x00e6, 0x0126, 0x2071, 0x1800, 0x2091, 0x8000,
+	0x7554, 0x9582, 0x0010, 0x0608, 0x7058, 0x2060, 0x6000, 0x9086,
+	0x0000, 0x0148, 0x9ce0, 0x001c, 0x7068, 0x9c02, 0x1208, 0x0cb0,
+	0x2061, 0x1ddc, 0x0c98, 0x6003, 0x0008, 0x8529, 0x7556, 0x9ca8,
+	0x001c, 0x7068, 0x9502, 0x1230, 0x755a, 0x9085, 0x0001, 0x012e,
+	0x00ee, 0x0005, 0x705b, 0x1ddc, 0x0cc0, 0x9006, 0x0cc0, 0x00e6,
+	0x2071, 0x1800, 0x7554, 0x9582, 0x0010, 0x0600, 0x7058, 0x2060,
+	0x6000, 0x9086, 0x0000, 0x0148, 0x9ce0, 0x001c, 0x7068, 0x9c02,
+	0x1208, 0x0cb0, 0x2061, 0x1ddc, 0x0c98, 0x6003, 0x0008, 0x8529,
+	0x7556, 0x9ca8, 0x001c, 0x7068, 0x9502, 0x1228, 0x755a, 0x9085,
+	0x0001, 0x00ee, 0x0005, 0x705b, 0x1ddc, 0x0cc8, 0x9006, 0x0cc8,
+	0x9c82, 0x1ddc, 0x0a0c, 0x0d7d, 0x2001, 0x181a, 0x2004, 0x9c02,
+	0x1a0c, 0x0d7d, 0x9006, 0x6006, 0x600a, 0x600e, 0x6016, 0x601a,
+	0x6012, 0x6023, 0x0000, 0x6003, 0x0000, 0x601e, 0x605e, 0x6062,
+	0x6026, 0x602a, 0x602e, 0x6032, 0x6036, 0x603a, 0x603e, 0x604a,
+	0x602a, 0x6046, 0x6042, 0x2061, 0x1800, 0x6054, 0x8000, 0x6056,
+	0x0005, 0x9006, 0x600e, 0x6016, 0x601a, 0x6012, 0x6022, 0x6002,
+	0x601e, 0x605e, 0x6062, 0x604a, 0x6046, 0x2061, 0x1800, 0x6054,
+	0x8000, 0x6056, 0x0005, 0x0006, 0x6000, 0x9086, 0x0000, 0x01d0,
+	0x601c, 0xd084, 0x190c, 0x1a53, 0x6023, 0x0007, 0x2001, 0x1984,
+	0x2004, 0x0006, 0x9082, 0x0051, 0x000e, 0x0208, 0x8004, 0x601a,
+	0x080c, 0xe3e7, 0x604b, 0x0000, 0x6044, 0xd0fc, 0x1129, 0x9006,
+	0x6046, 0x6016, 0x000e, 0x0005, 0x080c, 0xa7df, 0x0106, 0x190c,
+	0xa781, 0x2001, 0x19f8, 0x2004, 0x9c06, 0x1130, 0x0036, 0x2019,
+	0x0001, 0x080c, 0x9fef, 0x003e, 0x080c, 0xa239, 0x010e, 0x190c,
+	0xa79d, 0x0005, 0x00e6, 0x0126, 0x2071, 0x1800, 0x2091, 0x8000,
+	0x7554, 0x9582, 0x0001, 0x0608, 0x7058, 0x2060, 0x6000, 0x9086,
+	0x0000, 0x0148, 0x9ce0, 0x001c, 0x7068, 0x9c02, 0x1208, 0x0cb0,
+	0x2061, 0x1ddc, 0x0c98, 0x6003, 0x0008, 0x8529, 0x7556, 0x9ca8,
+	0x001c, 0x7068, 0x9502, 0x1230, 0x755a, 0x9085, 0x0001, 0x012e,
+	0x00ee, 0x0005, 0x705b, 0x1ddc, 0x0cc0, 0x9006, 0x0cc0, 0x6020,
+	0x9084, 0x000f, 0x0002, 0xab8b, 0xab95, 0xabb0, 0xabcb, 0xce7f,
+	0xce9c, 0xceb7, 0xab8b, 0xab95, 0x8e64, 0xabe7, 0xab8b, 0xab8b,
+	0xab8b, 0xab8b, 0xab8b, 0x9186, 0x0013, 0x1130, 0x6044, 0xd0fc,
+	0x0110, 0x080c, 0x94a8, 0x0005, 0x0005, 0x0066, 0x6000, 0x90b2,
+	0x0016, 0x1a0c, 0x0d7d, 0x0013, 0x006e, 0x0005, 0xabae, 0xb30c,
+	0xb4e7, 0xabae, 0xb57d, 0xaeb0, 0xabae, 0xabae, 0xb28e, 0xbae5,
+	0xabae, 0xabae, 0xabae, 0xabae, 0xabae, 0xabae, 0x080c, 0x0d7d,
+	0x0066, 0x6000, 0x90b2, 0x0016, 0x1a0c, 0x0d7d, 0x0013, 0x006e,
+	0x0005, 0xabc9, 0xc0f0, 0xabc9, 0xabc9, 0xabc9, 0xabc9, 0xabc9,
+	0xabc9, 0xc095, 0xc273, 0xabc9, 0xc12d, 0xc1b1, 0xc12d, 0xc1b1,
+	0xabc9, 0x080c, 0x0d7d, 0x6000, 0x9082, 0x0016, 0x1a0c, 0x0d7d,
+	0x6000, 0x0002, 0xabe5, 0xbb2f, 0xbbc6, 0xbd46, 0xbdb5, 0xabe5,
+	0xabe5, 0xabe5, 0xbafe, 0xc016, 0xc019, 0xabe5, 0xabe5, 0xabe5,
+	0xabe5, 0xc049, 0xabe5, 0xabe5, 0xabe5, 0x080c, 0x0d7d, 0x0066,
+	0x6000, 0x90b2, 0x0016, 0x1a0c, 0x0d7d, 0x0013, 0x006e, 0x0005,
+	0xac00, 0xac00, 0xac3e, 0xacdd, 0xad5d, 0xac00, 0xac00, 0xac00,
+	0xac02, 0xac00, 0xac00, 0xac00, 0xac00, 0xac00, 0xac00, 0xac00,
+	0x080c, 0x0d7d, 0x9186, 0x004c, 0x0560, 0x9186, 0x0003, 0x190c,
+	0x0d7d, 0x0096, 0x601c, 0xc0ed, 0x601e, 0x6003, 0x0003, 0x6106,
+	0x6014, 0x2048, 0xa87c, 0x9084, 0xa000, 0xc0b5, 0xa87e, 0xa8ac,
+	0xa836, 0xa8b0, 0xa83a, 0x9006, 0xa846, 0xa84a, 0xa884, 0x9092,
+	0x199a, 0x0210, 0x2001, 0x1999, 0x8003, 0x8013, 0x8213, 0x9210,
+	0x621a, 0x009e, 0x080c, 0x1ba3, 0x2009, 0x8030, 0x080c, 0x912f,
+	0x0005, 0x6010, 0x00b6, 0x2058, 0xbca0, 0x00be, 0x2c00, 0x080c,
+	0xad7f, 0x080c, 0xce4d, 0x6003, 0x0007, 0x0005, 0x00d6, 0x0096,
+	0x00f6, 0x2079, 0x1800, 0x7a90, 0x6014, 0x2048, 0xa87c, 0xd0ec,
+	0x1110, 0x9290, 0x0018, 0xac78, 0xc4fc, 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,
+	0xaca5, 0xaca5, 0xaca0, 0xaca3, 0xaca5, 0xac9d, 0xac90, 0xac90,
+	0xac90, 0xac90, 0xac90, 0xac90, 0xac90, 0xac90, 0xac90, 0xac90,
+	0x00fe, 0x00ee, 0x00de, 0x00ce, 0x002e, 0x001e, 0x000e, 0x004e,
+	0x00fe, 0x009e, 0x00de, 0x080c, 0x0d7d, 0x080c, 0xb73a, 0x0028,
+	0x080c, 0xb81f, 0x0010, 0x080c, 0xb915, 0x00fe, 0x00ee, 0x00de,
+	0x00ce, 0x002e, 0x001e, 0x2c00, 0xa896, 0x000e, 0x080c, 0xae3d,
+	0x0530, 0xa804, 0xa80e, 0x00a6, 0x2050, 0xb100, 0x00ae, 0x8006,
+	0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x0002,
+	0xaacc, 0xabd0, 0xacd4, 0xadd8, 0x2031, 0x0000, 0x2041, 0x128f,
+	0x080c, 0xaffd, 0x0160, 0x000e, 0x9005, 0x0120, 0x00fe, 0x009e,
+	0x00de, 0x0005, 0x00fe, 0x009e, 0x00de, 0x0804, 0xaad8, 0x2001,
+	0x002c, 0x900e, 0x080c, 0xaea3, 0x0c70, 0x91b6, 0x0015, 0x0170,
+	0x91b6, 0x0016, 0x0158, 0x91b2, 0x0047, 0x0a0c, 0x0d7d, 0x91b2,
+	0x0050, 0x1a0c, 0x0d7d, 0x9182, 0x0047, 0x0042, 0x080c, 0xa993,
+	0x0120, 0x9086, 0x0002, 0x0904, 0xac3e, 0x0005, 0xacff, 0xacff,
+	0xad01, 0xad33, 0xacff, 0xacff, 0xacff, 0xacff, 0xad46, 0x080c,
+	0x0d7d, 0x00d6, 0x0016, 0x0096, 0x6003, 0x0004, 0x6114, 0x2148,
+	0xa87c, 0xd0fc, 0x01c0, 0xa878, 0xc0fc, 0x9005, 0x1158, 0xa894,
+	0x9005, 0x0140, 0x2001, 0x0000, 0x900e, 0x080c, 0xaea3, 0x080c,
+	0xaad8, 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, 0x9505, 0x00d6, 0x0096, 0x6114,
+	0x2148, 0x080c, 0xc723, 0x0120, 0xa87b, 0x0006, 0x080c, 0x6c7f,
+	0x009e, 0x00de, 0x080c, 0xaad8, 0x0804, 0x956a, 0x080c, 0x9505,
+	0x080c, 0x31ab, 0x080c, 0xce4a, 0x00d6, 0x0096, 0x6114, 0x2148,
+	0x080c, 0xc723, 0x0120, 0xa87b, 0x0029, 0x080c, 0x6c7f, 0x009e,
+	0x00de, 0x080c, 0xaad8, 0x0804, 0x956a, 0x9182, 0x0047, 0x0002,
+	0xad6d, 0xad6f, 0xad6d, 0xad6d, 0xad6d, 0xad6d, 0xad6d, 0xad6d,
+	0xad6d, 0xad6d, 0xad6d, 0xad6d, 0xad6f, 0x080c, 0x0d7d, 0x00d6,
+	0x0096, 0x601f, 0x0000, 0x6114, 0x2148, 0xa87b, 0x0000, 0xa883,
+	0x0000, 0x080c, 0x6c7f, 0x009e, 0x00de, 0x0804, 0xaad8, 0x0026,
+	0x0036, 0x0056, 0x0066, 0x0096, 0x00a6, 0x00f6, 0x0006, 0x080c,
+	0x103b, 0x000e, 0x090c, 0x0d7d, 0xa960, 0x21e8, 0xa95c, 0x9188,
+	0x0019, 0x21a0, 0x900e, 0x20a9, 0x0020, 0x4104, 0xa87a, 0x2079,
+	0x1800, 0x7990, 0x9188, 0x0018, 0x918c, 0x0fff, 0xa972, 0xac76,
+	0x2950, 0x00a6, 0x2001, 0x0205, 0x2003, 0x0000, 0x901e, 0x2029,
+	0x0001, 0x9182, 0x0034, 0x1228, 0x2011, 0x001f, 0x080c, 0xc2f6,
+	0x04c0, 0x2130, 0x2009, 0x0034, 0x2011, 0x001f, 0x080c, 0xc2f6,
+	0x96b2, 0x0034, 0xb004, 0x904d, 0x0110, 0x080c, 0x0fed, 0x080c,
+	0x103b, 0x01d0, 0x8528, 0xa867, 0x0110, 0xa86b, 0x0000, 0x2920,
+	0xb406, 0x968a, 0x003d, 0x1230, 0x2608, 0x2011, 0x001b, 0x080c,
+	0xc2f6, 0x00b8, 0x96b2, 0x003c, 0x2009, 0x003c, 0x2950, 0x2011,
+	0x001b, 0x080c, 0xc2f6, 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,
+	0x6c7f, 0x000e, 0x2048, 0x9005, 0x1db0, 0x00fe, 0x00ae, 0x009e,
+	0x006e, 0x005e, 0x003e, 0x002e, 0x0005, 0x00d6, 0x00f6, 0x0096,
+	0x0006, 0x080c, 0x103b, 0x000e, 0x090c, 0x0d7d, 0xa960, 0x21e8,
+	0xa95c, 0x9188, 0x0019, 0x21a0, 0x900e, 0x20a9, 0x0020, 0x4104,
+	0xaa66, 0xa87a, 0x2079, 0x1800, 0x7990, 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,
+	0x6c7f, 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,
+	0x103b, 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, 0xae52,
+	0x0804, 0xae54, 0x9085, 0x0001, 0x7817, 0x0000, 0x009e, 0x00fe,
+	0x00de, 0x001e, 0x0005, 0x00d6, 0x0036, 0x0096, 0x6314, 0x2348,
+	0xa87a, 0xa982, 0x080c, 0x6c73, 0x009e, 0x003e, 0x00de, 0x0005,
+	0x91b6, 0x0015, 0x1118, 0x080c, 0xaad8, 0x0030, 0x91b6, 0x0016,
+	0x190c, 0x0d7d, 0x080c, 0xaad8, 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, 0xc723, 0x0130, 0x6014, 0x2048, 0xa807, 0x0000,
+	0xa867, 0x0103, 0x009e, 0x0804, 0xaad8, 0x0096, 0x00d6, 0x0036,
+	0x7330, 0x9386, 0x0200, 0x11a8, 0x6010, 0x00b6, 0x2058, 0xb8d7,
+	0x0000, 0x00be, 0x6014, 0x9005, 0x0130, 0x2048, 0xa807, 0x0000,
+	0xa867, 0x0103, 0xab32, 0x080c, 0xaad8, 0x003e, 0x00de, 0x009e,
+	0x0005, 0x0011, 0x1d48, 0x0cc8, 0x0006, 0x0016, 0x080c, 0xce35,
+	0x0188, 0x6014, 0x9005, 0x1170, 0x600b, 0x0003, 0x601b, 0x0000,
+	0x604b, 0x0000, 0x2009, 0x0022, 0x080c, 0xb2e4, 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, 0xaad8, 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, 0xc2f6, 0x080c, 0xc723, 0x0140, 0x6014,
+	0x2048, 0xa807, 0x0000, 0xa864, 0xa8e2, 0xa867, 0x0103, 0x080c,
+	0xaad8, 0x001e, 0x009e, 0x0005, 0x0016, 0x2009, 0x0000, 0x7030,
+	0x9086, 0x0200, 0x0110, 0x2009, 0x0001, 0x0096, 0x6014, 0x904d,
+	0x090c, 0x0d7d, 0xa97a, 0x080c, 0x6c7f, 0x009e, 0x080c, 0xaad8,
+	0x001e, 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, 0xc2f6, 0x009e, 0x080c, 0xc723, 0x0148, 0xa804,
+	0x9005, 0x1158, 0xa807, 0x0000, 0xa864, 0xa8e2, 0xa867, 0x0103,
+	0x080c, 0xaad8, 0x009e, 0x001e, 0x0005, 0x0086, 0x2040, 0xa030,
+	0x8007, 0x9086, 0x0100, 0x1118, 0x080c, 0xb4a0, 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,
+	0x1275, 0x0019, 0x0d08, 0x008e, 0x0898, 0x0096, 0x0006, 0x080c,
+	0x103b, 0x000e, 0x01b0, 0xa8ab, 0x0dcb, 0xa876, 0x000e, 0xa8a2,
+	0x0006, 0xae6a, 0x2800, 0xa89e, 0xa97a, 0xaf72, 0xaa8e, 0xab92,
+	0xac96, 0xad9a, 0x0086, 0x2940, 0x080c, 0x111b, 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,
+	0x604b, 0x0000, 0x2c68, 0x0016, 0x2009, 0x0035, 0x080c, 0xcdad,
+	0x001e, 0x1158, 0x622c, 0x2268, 0x2071, 0x026c, 0x6b20, 0x9386,
+	0x0003, 0x0130, 0x9386, 0x0006, 0x0128, 0x080c, 0xaad8, 0x0020,
+	0x0039, 0x0010, 0x080c, 0xb119, 0x002e, 0x00de, 0x00ee, 0x0005,
+	0x0096, 0x6814, 0x2048, 0x9186, 0x0015, 0x0904, 0xb0f8, 0x918e,
+	0x0016, 0x1904, 0xb117, 0x700c, 0x908c, 0xff00, 0x9186, 0x1700,
+	0x0120, 0x9186, 0x0300, 0x1904, 0xb0d2, 0x89ff, 0x1138, 0x6800,
+	0x9086, 0x000f, 0x0904, 0xb0b4, 0x0804, 0xb115, 0x6808, 0x9086,
+	0xffff, 0x1904, 0xb0fa, 0xa87c, 0x9084, 0x0060, 0x9086, 0x0020,
+	0x1128, 0xa83c, 0xa940, 0x9105, 0x1904, 0xb0fa, 0x6824, 0xd0b4,
+	0x1904, 0xb0fa, 0x080c, 0xc90b, 0x6864, 0xa882, 0xa87c, 0xc0dc,
+	0xc0f4, 0xc0d4, 0xa87e, 0x0026, 0x900e, 0x6a18, 0x2001, 0x000a,
+	0x080c, 0x9030, 0xa884, 0x920a, 0x0208, 0x8011, 0xaa86, 0x82ff,
+	0x002e, 0x1138, 0x00c6, 0x2d60, 0x080c, 0xc449, 0x00ce, 0x0804,
+	0xb115, 0x00c6, 0xa868, 0xd0fc, 0x1118, 0x080c, 0x5fd3, 0x0010,
+	0x080c, 0x63c7, 0x00ce, 0x1904, 0xb0fa, 0x00c6, 0x2d60, 0x080c,
+	0xaad8, 0x00ce, 0x0804, 0xb115, 0x00c6, 0x080c, 0xab4a, 0x0198,
+	0x6017, 0x0000, 0x6810, 0x6012, 0x080c, 0xcbb0, 0x6023, 0x0003,
+	0x6904, 0x00c6, 0x2d60, 0x080c, 0xaad8, 0x00ce, 0x080c, 0xab77,
+	0x00ce, 0x0804, 0xb115, 0x2001, 0x1986, 0x2004, 0x684a, 0x00ce,
+	0x0804, 0xb115, 0x7008, 0x9086, 0x000b, 0x11c8, 0x6010, 0x00b6,
+	0x2058, 0xb900, 0xc1bc, 0xb902, 0x00be, 0x00c6, 0x2d60, 0xa87b,
+	0x0003, 0x080c, 0xcdef, 0x6007, 0x0085, 0x6003, 0x000b, 0x6023,
+	0x0002, 0x2009, 0x8020, 0x080c, 0x90e8, 0x00ce, 0x0430, 0x700c,
+	0x9086, 0x2a00, 0x1138, 0x2001, 0x1986, 0x2004, 0x684a, 0x00e8,
+	0x04c1, 0x00e8, 0x89ff, 0x090c, 0x0d7d, 0x00c6, 0x00d6, 0x2d60,
+	0xa867, 0x0103, 0xa87b, 0x0003, 0x080c, 0x6a95, 0x080c, 0xc90b,
+	0x080c, 0xab13, 0x0026, 0x6010, 0x00b6, 0x2058, 0xba3c, 0x080c,
+	0x6658, 0x00be, 0x002e, 0x00de, 0x00ce, 0x080c, 0xaad8, 0x009e,
+	0x0005, 0x9186, 0x0015, 0x1128, 0x2001, 0x1986, 0x2004, 0x684a,
+	0x0068, 0x918e, 0x0016, 0x1160, 0x00c6, 0x2d00, 0x2060, 0x080c,
+	0xe3e7, 0x080c, 0x878b, 0x080c, 0xaad8, 0x00ce, 0x080c, 0xaad8,
+	0x0005, 0x0026, 0x0036, 0x0046, 0x7228, 0xacb0, 0xabac, 0xd2f4,
+	0x0130, 0x2001, 0x1986, 0x2004, 0x684a, 0x0804, 0xb193, 0x00c6,
+	0x2d60, 0x080c, 0xc321, 0x00ce, 0x6804, 0x9086, 0x0050, 0x1168,
+	0x00c6, 0x2d00, 0x2060, 0x6003, 0x0001, 0x6007, 0x0050, 0x2009,
+	0x8023, 0x080c, 0x90e8, 0x00ce, 0x04f0, 0x6800, 0x9086, 0x000f,
+	0x01a8, 0x89ff, 0x090c, 0x0d7d, 0x6800, 0x9086, 0x0004, 0x1190,
+	0xa87c, 0xd0ac, 0x0178, 0xa843, 0x0fff, 0xa83f, 0x0fff, 0xa880,
+	0xc0fc, 0xa882, 0x2001, 0x0001, 0x6832, 0x0400, 0x2001, 0x0007,
+	0x6832, 0x00e0, 0xa87c, 0xd0b4, 0x1150, 0xd0ac, 0x0db8, 0x6824,
+	0xd0f4, 0x1d48, 0xa838, 0xa934, 0x9105, 0x0d80, 0x0c20, 0xd2ec,
+	0x1d68, 0x7024, 0x9306, 0x1118, 0x7020, 0x9406, 0x0d38, 0x7020,
+	0x683e, 0x7024, 0x683a, 0x2001, 0x0005, 0x6832, 0x080c, 0xca9a,
+	0x080c, 0x956a, 0x0010, 0x080c, 0xaad8, 0x004e, 0x003e, 0x002e,
+	0x0005, 0x00e6, 0x00d6, 0x0026, 0x7008, 0x9084, 0x00ff, 0x6210,
+	0x00b6, 0x2258, 0xba10, 0x00be, 0x9206, 0x1904, 0xb1fe, 0x700c,
+	0x6210, 0x00b6, 0x2258, 0xba14, 0x00be, 0x9206, 0x1904, 0xb1fe,
+	0x6038, 0x2068, 0x6824, 0xc0dc, 0x6826, 0x6a20, 0x9286, 0x0007,
+	0x0904, 0xb1fe, 0x9286, 0x0002, 0x0904, 0xb1fe, 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, 0xc723, 0x090c, 0x0d7d, 0xa87b,
+	0x0003, 0x009e, 0x080c, 0xcdef, 0x6007, 0x0085, 0x6003, 0x000b,
+	0x6023, 0x0002, 0x2009, 0x8020, 0x080c, 0x90e8, 0x00ce, 0x0030,
+	0x6038, 0x2070, 0x2001, 0x1986, 0x2004, 0x704a, 0x080c, 0xaad8,
+	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,
+	0xbaad, 0x002e, 0x003e, 0x015e, 0x009e, 0x1904, 0xb26d, 0x0096,
+	0x0156, 0x0036, 0x0026, 0x2b48, 0x9e90, 0x0014, 0x2019, 0x0006,
+	0x20a9, 0x0004, 0x080c, 0xbaad, 0x002e, 0x003e, 0x015e, 0x009e,
+	0x15a0, 0x7238, 0xba0a, 0x733c, 0xbb0e, 0xbc00, 0xc48d, 0xbc02,
+	0xa804, 0x9005, 0x1128, 0x00fe, 0x009e, 0x00be, 0x0804, 0xaee8,
+	0x0096, 0x2048, 0xaa12, 0xab16, 0xac0a, 0x009e, 0x8006, 0x8006,
+	0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x0002, 0x2009,
+	0x002b, 0xaaa0, 0xab9c, 0xaca8, 0xada4, 0x2031, 0x0000, 0x2041,
+	0x1275, 0x080c, 0xaffd, 0x0130, 0x00fe, 0x009e, 0x080c, 0xaad8,
+	0x00be, 0x0005, 0x080c, 0xb4a0, 0x0cb8, 0x2b78, 0x00f6, 0x080c,
+	0x31ab, 0x080c, 0xce4a, 0x00fe, 0x00c6, 0x080c, 0xaa82, 0x2f00,
+	0x6012, 0x6017, 0x0000, 0x6023, 0x0001, 0x6007, 0x0001, 0x6003,
+	0x0001, 0x2001, 0x0007, 0x080c, 0x647d, 0x080c, 0x64a9, 0x080c,
+	0x90ef, 0x080c, 0x956a, 0x00ce, 0x0804, 0xb240, 0x2100, 0x91b2,
+	0x0053, 0x1a0c, 0x0d7d, 0x91b2, 0x0040, 0x1a04, 0xb2f6, 0x0002,
+	0xb2e4, 0xb2e4, 0xb2da, 0xb2e4, 0xb2e4, 0xb2e4, 0xb2d8, 0xb2d8,
+	0xb2d8, 0xb2d8, 0xb2d8, 0xb2d8, 0xb2d8, 0xb2d8, 0xb2d8, 0xb2d8,
+	0xb2d8, 0xb2d8, 0xb2d8, 0xb2d8, 0xb2d8, 0xb2d8, 0xb2d8, 0xb2d8,
+	0xb2d8, 0xb2d8, 0xb2d8, 0xb2d8, 0xb2d8, 0xb2d8, 0xb2d8, 0xb2e4,
+	0xb2d8, 0xb2e4, 0xb2e4, 0xb2d8, 0xb2d8, 0xb2d8, 0xb2d8, 0xb2d8,
+	0xb2da, 0xb2d8, 0xb2d8, 0xb2d8, 0xb2d8, 0xb2d8, 0xb2d8, 0xb2d8,
+	0xb2d8, 0xb2d8, 0xb2e4, 0xb2e4, 0xb2d8, 0xb2d8, 0xb2d8, 0xb2d8,
+	0xb2d8, 0xb2d8, 0xb2d8, 0xb2d8, 0xb2d8, 0xb2e4, 0xb2d8, 0xb2d8,
+	0x080c, 0x0d7d, 0x0066, 0x00b6, 0x6610, 0x2658, 0xb8d4, 0xc08c,
+	0xb8d6, 0x00be, 0x006e, 0x0000, 0x6003, 0x0001, 0x6106, 0x9186,
+	0x0032, 0x0118, 0x080c, 0x90ef, 0x0010, 0x080c, 0x90e8, 0x0126,
+	0x2091, 0x8000, 0x080c, 0x956a, 0x012e, 0x0005, 0x2600, 0x0002,
+	0xb2e4, 0xb2e4, 0xb30a, 0xb2e4, 0xb2e4, 0xb30a, 0xb30a, 0xb30a,
+	0xb30a, 0xb2e4, 0xb30a, 0xb2e4, 0xb30a, 0xb2e4, 0xb30a, 0xb30a,
+	0xb30a, 0xb30a, 0x080c, 0x0d7d, 0x6004, 0x90b2, 0x0053, 0x1a0c,
+	0x0d7d, 0x91b6, 0x0013, 0x0904, 0xb3e1, 0x91b6, 0x0027, 0x1904,
+	0xb38d, 0x080c, 0x94a8, 0x6004, 0x080c, 0xc920, 0x01b0, 0x080c,
+	0xc931, 0x01a8, 0x908e, 0x0021, 0x0904, 0xb38a, 0x908e, 0x0022,
+	0x1130, 0x080c, 0xaf14, 0x0904, 0xb386, 0x0804, 0xb387, 0x908e,
+	0x003d, 0x0904, 0xb38a, 0x0804, 0xb380, 0x080c, 0x31dc, 0x2001,
+	0x0007, 0x080c, 0x647d, 0x6010, 0x00b6, 0x2058, 0xb9a0, 0x00be,
+	0x080c, 0xb4a0, 0x9186, 0x007e, 0x1148, 0x2001, 0x1837, 0x2014,
+	0xc285, 0x080c, 0x73e4, 0x1108, 0xc2ad, 0x2202, 0x080c, 0xa781,
+	0x0036, 0x0026, 0x2019, 0x0028, 0x2110, 0x080c, 0xe4f3, 0x002e,
+	0x003e, 0x0016, 0x0026, 0x0036, 0x2110, 0x2019, 0x0028, 0x080c,
+	0x926f, 0x0076, 0x903e, 0x080c, 0x9141, 0x6010, 0x00b6, 0x905d,
+	0x0100, 0x00be, 0x2c08, 0x080c, 0xdeb3, 0x007e, 0x003e, 0x002e,
+	0x001e, 0x080c, 0xa79d, 0x080c, 0xce4a, 0x0016, 0x080c, 0xcba8,
+	0x080c, 0xaad8, 0x001e, 0x080c, 0x32bc, 0x080c, 0x956a, 0x0030,
+	0x080c, 0xcba8, 0x080c, 0xaad8, 0x080c, 0x956a, 0x0005, 0x080c,
+	0xb4a0, 0x0cb0, 0x080c, 0xb4dc, 0x0c98, 0x9186, 0x0015, 0x0118,
+	0x9186, 0x0016, 0x1140, 0x080c, 0xa993, 0x0d80, 0x9086, 0x0002,
+	0x0904, 0xb4e7, 0x0c58, 0x9186, 0x0014, 0x1d40, 0x080c, 0x94a8,
+	0x6004, 0x908e, 0x0022, 0x1118, 0x080c, 0xaf14, 0x09f8, 0x080c,
+	0x31ab, 0x080c, 0xce4a, 0x080c, 0xc920, 0x1190, 0x080c, 0x31dc,
+	0x6010, 0x00b6, 0x2058, 0xb9a0, 0x00be, 0x080c, 0xb4a0, 0x9186,
+	0x007e, 0x1128, 0x2001, 0x1837, 0x200c, 0xc185, 0x2102, 0x0800,
+	0x080c, 0xc931, 0x1120, 0x080c, 0xb4a0, 0x0804, 0xb380, 0x6004,
+	0x908e, 0x0032, 0x1160, 0x00e6, 0x00f6, 0x2071, 0x189e, 0x2079,
+	0x0000, 0x080c, 0x3565, 0x00fe, 0x00ee, 0x0804, 0xb380, 0x6004,
+	0x908e, 0x0021, 0x0d40, 0x908e, 0x0022, 0x090c, 0xb4a0, 0x0804,
+	0xb380, 0x90b2, 0x0040, 0x1a04, 0xb480, 0x2008, 0x0002, 0xb429,
+	0xb42a, 0xb42d, 0xb430, 0xb433, 0xb436, 0xb427, 0xb427, 0xb427,
+	0xb427, 0xb427, 0xb427, 0xb427, 0xb427, 0xb427, 0xb427, 0xb427,
+	0xb427, 0xb427, 0xb427, 0xb427, 0xb427, 0xb427, 0xb427, 0xb427,
+	0xb427, 0xb427, 0xb427, 0xb427, 0xb427, 0xb439, 0xb442, 0xb427,
+	0xb443, 0xb442, 0xb427, 0xb427, 0xb427, 0xb427, 0xb427, 0xb442,
+	0xb442, 0xb427, 0xb427, 0xb427, 0xb427, 0xb427, 0xb427, 0xb427,
+	0xb427, 0xb46b, 0xb442, 0xb427, 0xb43e, 0xb427, 0xb427, 0xb427,
+	0xb43f, 0xb427, 0xb427, 0xb427, 0xb442, 0xb466, 0xb427, 0x080c,
+	0x0d7d, 0x00c0, 0x2001, 0x000b, 0x00e8, 0x2001, 0x0003, 0x00d0,
+	0x2001, 0x0005, 0x00b8, 0x2001, 0x0001, 0x00a0, 0x2001, 0x0009,
+	0x0088, 0x6003, 0x0005, 0x080c, 0x956a, 0x0058, 0x0018, 0x0010,
+	0x080c, 0x647d, 0x04b8, 0x080c, 0xce4d, 0x6003, 0x0004, 0x080c,
+	0x956a, 0x0005, 0x080c, 0x647d, 0x6003, 0x0002, 0x0036, 0x2019,
+	0x1852, 0x2304, 0x9084, 0xff00, 0x1120, 0x2001, 0x1984, 0x201c,
+	0x0040, 0x8007, 0x909a, 0x0004, 0x0ec0, 0x8003, 0x801b, 0x831b,
+	0x9318, 0x631a, 0x003e, 0x080c, 0x956a, 0x0c18, 0x080c, 0xcba8,
+	0x080c, 0xaad8, 0x08f0, 0x00e6, 0x00f6, 0x2071, 0x189e, 0x2079,
+	0x0000, 0x080c, 0x3565, 0x00fe, 0x00ee, 0x080c, 0x94a8, 0x080c,
+	0xaad8, 0x0878, 0x6003, 0x0002, 0x080c, 0xce4d, 0x0804, 0x956a,
+	0x2600, 0x2008, 0x0002, 0xb497, 0xb47a, 0xb495, 0xb47a, 0xb47a,
+	0xb495, 0xb495, 0xb495, 0xb495, 0xb47a, 0xb495, 0xb47a, 0xb495,
+	0xb47a, 0xb495, 0xb495, 0xb495, 0xb495, 0x080c, 0x0d7d, 0x0096,
+	0x6014, 0x2048, 0x080c, 0x6c7f, 0x009e, 0x080c, 0xaad8, 0x0005,
+	0x00e6, 0x0096, 0x0026, 0x0016, 0x080c, 0xc723, 0x0568, 0x6014,
+	0x2048, 0xa864, 0x9086, 0x0139, 0x11a8, 0xa894, 0x9086, 0x0056,
+	0x1148, 0x080c, 0x539d, 0x0130, 0x2001, 0x0000, 0x900e, 0x2011,
+	0x4000, 0x0028, 0x2001, 0x0030, 0x900e, 0x2011, 0x4005, 0x080c,
+	0xcd14, 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,
+	0x0d7d, 0x6604, 0x96b6, 0x004d, 0x1120, 0x080c, 0xcc34, 0x0804,
+	0xb56c, 0x6604, 0x96b6, 0x0043, 0x1120, 0x080c, 0xcc7d, 0x0804,
+	0xb56c, 0x6604, 0x96b6, 0x004b, 0x1120, 0x080c, 0xcca9, 0x0804,
+	0xb56c, 0x6604, 0x96b6, 0x0033, 0x1120, 0x080c, 0xcbca, 0x0804,
+	0xb56c, 0x6604, 0x96b6, 0x0028, 0x1120, 0x080c, 0xc96a, 0x0804,
+	0xb56c, 0x6604, 0x96b6, 0x0029, 0x1120, 0x080c, 0xc9ab, 0x0804,
+	0xb56c, 0x6604, 0x96b6, 0x001f, 0x1120, 0x080c, 0xaebd, 0x0804,
+	0xb56c, 0x6604, 0x96b6, 0x0000, 0x1118, 0x080c, 0xb204, 0x04e0,
+	0x6604, 0x96b6, 0x0022, 0x1118, 0x080c, 0xaef5, 0x04a8, 0x6604,
+	0x96b6, 0x0035, 0x1118, 0x080c, 0xb01b, 0x0470, 0x6604, 0x96b6,
+	0x0039, 0x1118, 0x080c, 0xb199, 0x0438, 0x6604, 0x96b6, 0x003d,
+	0x1118, 0x080c, 0xaf2d, 0x0400, 0x6604, 0x96b6, 0x0044, 0x1118,
+	0x080c, 0xaf69, 0x00c8, 0x6604, 0x96b6, 0x0049, 0x1118, 0x080c,
+	0xafaa, 0x0090, 0x6604, 0x96b6, 0x0041, 0x1118, 0x080c, 0xaf94,
+	0x0058, 0x91b6, 0x0015, 0x1110, 0x0063, 0x0030, 0x91b6, 0x0016,
+	0x1128, 0x00be, 0x0804, 0xb7c6, 0x00be, 0x0005, 0x080c, 0xab94,
+	0x0cd8, 0xb589, 0xb58c, 0xb589, 0xb5d3, 0xb589, 0xb73a, 0xb7d3,
+	0xb589, 0xb589, 0xb79c, 0xb589, 0xb7b2, 0x0096, 0x601f, 0x0000,
+	0x6014, 0x2048, 0xa800, 0x2048, 0xa867, 0x0103, 0x009e, 0x0804,
+	0xaad8, 0xa001, 0xa001, 0x0005, 0x00e6, 0x2071, 0x1800, 0x7090,
+	0x9086, 0x0074, 0x1540, 0x080c, 0xde84, 0x11b0, 0x6010, 0x00b6,
+	0x2058, 0x7030, 0xd08c, 0x0128, 0xb800, 0xd0bc, 0x0110, 0xc0c5,
+	0xb802, 0x00f9, 0x00be, 0x2001, 0x0006, 0x080c, 0x647d, 0x080c,
+	0x31dc, 0x080c, 0xaad8, 0x0098, 0x2001, 0x000a, 0x080c, 0x647d,
+	0x080c, 0x31dc, 0x6003, 0x0001, 0x6007, 0x0001, 0x080c, 0x90ef,
+	0x080c, 0x956a, 0x0020, 0x2001, 0x0001, 0x080c, 0xb70a, 0x00ee,
+	0x0005, 0x00d6, 0xb800, 0xd084, 0x0160, 0x9006, 0x080c, 0x6469,
+	0x2069, 0x1847, 0x6804, 0xd0a4, 0x0120, 0x2001, 0x0006, 0x080c,
+	0x64a9, 0x00de, 0x0005, 0x00b6, 0x0096, 0x00d6, 0x2011, 0x1824,
+	0x2204, 0x9086, 0x0074, 0x1904, 0xb6e1, 0x6010, 0x2058, 0xbaa0,
+	0x9286, 0x007e, 0x1120, 0x080c, 0xb920, 0x0804, 0xb645, 0x080c,
+	0xb915, 0x6010, 0x2058, 0xbaa0, 0x9286, 0x0080, 0x1510, 0x6014,
+	0x9005, 0x01a8, 0x2048, 0xa864, 0x9084, 0x00ff, 0x9086, 0x0039,
+	0x1140, 0x2001, 0x0000, 0x900e, 0x2011, 0x4000, 0x080c, 0xcd14,
+	0x0030, 0xa807, 0x0000, 0xa867, 0x0103, 0xa833, 0x0200, 0x2001,
+	0x0006, 0x080c, 0x647d, 0x080c, 0x31dc, 0x080c, 0xaad8, 0x0804,
+	0xb6e4, 0x080c, 0xb6f2, 0x6014, 0x9005, 0x0190, 0x2048, 0xa868,
+	0xd0f4, 0x01e8, 0xa864, 0x9084, 0x00ff, 0x9086, 0x0039, 0x1d08,
+	0x2001, 0x0000, 0x900e, 0x2011, 0x4000, 0x080c, 0xcd14, 0x08f8,
+	0x080c, 0xb6e8, 0x0160, 0x9006, 0x080c, 0x6469, 0x2001, 0x0004,
+	0x080c, 0x64a9, 0x2001, 0x0007, 0x080c, 0x647d, 0x08a0, 0x2001,
+	0x0004, 0x080c, 0x647d, 0x6003, 0x0001, 0x6007, 0x0003, 0x080c,
+	0x90ef, 0x080c, 0x956a, 0x0804, 0xb6e4, 0xb85c, 0xd0e4, 0x01d8,
+	0x080c, 0xcb42, 0x080c, 0x73e4, 0x0118, 0xd0dc, 0x1904, 0xb607,
+	0x2011, 0x1837, 0x2204, 0xc0ad, 0x2012, 0x2001, 0x196d, 0x2004,
+	0x00f6, 0x2079, 0x0100, 0x78e3, 0x0000, 0x080c, 0x2643, 0x78e2,
+	0x00fe, 0x0804, 0xb607, 0x080c, 0xcb83, 0x2011, 0x1837, 0x2204,
+	0xc0a5, 0x2012, 0x0006, 0x080c, 0xe014, 0x000e, 0x1904, 0xb607,
+	0xc0b5, 0x2012, 0x2001, 0x0006, 0x080c, 0x647d, 0x9006, 0x080c,
+	0x6469, 0x00c6, 0x2001, 0x180f, 0x2004, 0xd09c, 0x0520, 0x00f6,
+	0x2079, 0x0100, 0x00e6, 0x2071, 0x1800, 0x700c, 0x9084, 0x00ff,
+	0x78e6, 0x707e, 0x7010, 0x78ea, 0x7082, 0x908c, 0x00ff, 0x00ee,
+	0x780c, 0xc0b5, 0x780e, 0x00fe, 0x080c, 0x2618, 0x00f6, 0x2100,
+	0x900e, 0x080c, 0x25cf, 0x795e, 0x00fe, 0x9186, 0x0081, 0x01d8,
+	0x2009, 0x0081, 0x00c8, 0x2009, 0x00ef, 0x00f6, 0x2079, 0x0100,
+	0x79ea, 0x7932, 0x7936, 0x780c, 0xc0b5, 0x780e, 0x00fe, 0x080c,
+	0x2618, 0x00f6, 0x2079, 0x1800, 0x7982, 0x2100, 0x900e, 0x080c,
+	0x25cf, 0x795e, 0x00fe, 0x8108, 0x080c, 0x64cc, 0x2b00, 0x00ce,
+	0x1904, 0xb607, 0x6012, 0x2009, 0x180f, 0x210c, 0xd19c, 0x0150,
+	0x2009, 0x027c, 0x210c, 0x918c, 0x00ff, 0xb912, 0x2009, 0x027d,
+	0x210c, 0xb916, 0x2001, 0x0002, 0x080c, 0x647d, 0x6023, 0x0001,
+	0x6003, 0x0001, 0x6007, 0x0002, 0x080c, 0x90ef, 0x080c, 0x956a,
+	0x0018, 0x2001, 0x0001, 0x0431, 0x00de, 0x009e, 0x00be, 0x0005,
+	0x2001, 0x1810, 0x2004, 0xd0a4, 0x0120, 0x2001, 0x1848, 0x2004,
+	0xd0ac, 0x0005, 0x00e6, 0x080c, 0xe54c, 0x0190, 0x2071, 0x0260,
+	0x7108, 0x720c, 0x918c, 0x00ff, 0x1118, 0x9284, 0xff00, 0x0140,
+	0x6010, 0x2058, 0xb8a0, 0x9084, 0xff80, 0x1110, 0xb912, 0xba16,
+	0x00ee, 0x0005, 0x2030, 0x9005, 0x0158, 0x2001, 0x0007, 0x080c,
+	0x647d, 0x080c, 0x5610, 0x1120, 0x2001, 0x0007, 0x080c, 0x64a9,
+	0x2600, 0x9005, 0x11b0, 0x6014, 0x0096, 0x2048, 0xa868, 0x009e,
+	0xd0fc, 0x1178, 0x0036, 0x0046, 0x6010, 0x00b6, 0x2058, 0xbba0,
+	0x00be, 0x2021, 0x0004, 0x2011, 0x8014, 0x080c, 0x4a38, 0x004e,
+	0x003e, 0x080c, 0x31dc, 0x6020, 0x9086, 0x000a, 0x1108, 0x0005,
+	0x0804, 0xaad8, 0x00b6, 0x00e6, 0x0026, 0x0016, 0x2071, 0x1800,
+	0x7090, 0x9086, 0x0014, 0x1904, 0xb792, 0x080c, 0x5610, 0x1170,
+	0x6014, 0x9005, 0x1158, 0x0036, 0x0046, 0x6010, 0x2058, 0xbba0,
+	0x2021, 0x0006, 0x080c, 0x4bef, 0x004e, 0x003e, 0x00d6, 0x6010,
+	0x2058, 0x080c, 0x65c8, 0x080c, 0xb5c1, 0x00de, 0x080c, 0xb9e6,
+	0x1588, 0x6010, 0x2058, 0xb890, 0x9005, 0x0560, 0x2001, 0x0006,
+	0x080c, 0x647d, 0x0096, 0x6014, 0x904d, 0x01d0, 0xa864, 0x9084,
+	0x00ff, 0x9086, 0x0039, 0x1140, 0x2001, 0x0000, 0x900e, 0x2011,
+	0x4000, 0x080c, 0xcd14, 0x0060, 0xa864, 0x9084, 0x00ff, 0x9086,
+	0x0029, 0x0130, 0xa807, 0x0000, 0xa867, 0x0103, 0xa833, 0x0200,
+	0x009e, 0x080c, 0x31dc, 0x6020, 0x9086, 0x000a, 0x0140, 0x080c,
+	0xaad8, 0x0028, 0x080c, 0xb4a0, 0x9006, 0x080c, 0xb70a, 0x001e,
+	0x002e, 0x00ee, 0x00be, 0x0005, 0x2011, 0x1824, 0x2204, 0x9086,
+	0x0014, 0x1160, 0x2001, 0x0002, 0x080c, 0x647d, 0x6003, 0x0001,
+	0x6007, 0x0001, 0x080c, 0x90ef, 0x0804, 0x956a, 0x2001, 0x0001,
+	0x0804, 0xb70a, 0x2030, 0x2011, 0x1824, 0x2204, 0x9086, 0x0004,
+	0x1148, 0x96b6, 0x000b, 0x1120, 0x2001, 0x0007, 0x080c, 0x647d,
+	0x0804, 0xaad8, 0x2001, 0x0001, 0x0804, 0xb70a, 0x0002, 0xb589,
+	0xb7de, 0xb589, 0xb81f, 0xb589, 0xb8cc, 0xb7d3, 0xb589, 0xb589,
+	0xb8e0, 0xb589, 0xb8f2, 0x6604, 0x9686, 0x0003, 0x0904, 0xb73a,
+	0x96b6, 0x001e, 0x1110, 0x080c, 0xaad8, 0x0005, 0x00b6, 0x00d6,
+	0x00c6, 0x080c, 0xb904, 0x11a0, 0x9006, 0x080c, 0x6469, 0x080c,
+	0x31ab, 0x080c, 0xce4a, 0x2001, 0x0002, 0x080c, 0x647d, 0x6003,
+	0x0001, 0x6007, 0x0002, 0x080c, 0x90ef, 0x080c, 0x956a, 0x0418,
+	0x2009, 0x026e, 0x2104, 0x9086, 0x0009, 0x1160, 0x6010, 0x2058,
+	0xb840, 0x9084, 0x00ff, 0x9005, 0x0170, 0x8001, 0xb842, 0x601b,
+	0x000a, 0x0088, 0x2009, 0x026f, 0x2104, 0x9084, 0xff00, 0x9086,
+	0x1900, 0x1108, 0x08a0, 0x080c, 0x31ab, 0x080c, 0xce4a, 0x2001,
+	0x0001, 0x080c, 0xb70a, 0x00ce, 0x00de, 0x00be, 0x0005, 0x0096,
+	0x00b6, 0x0026, 0x9016, 0x080c, 0xb912, 0x00d6, 0x2069, 0x197c,
+	0x2d04, 0x9005, 0x0168, 0x6010, 0x2058, 0xb8a0, 0x9086, 0x007e,
+	0x1138, 0x2069, 0x1820, 0x2d04, 0x8000, 0x206a, 0x00de, 0x0010,
+	0x00de, 0x0088, 0x9006, 0x080c, 0x6469, 0x2001, 0x0002, 0x080c,
+	0x647d, 0x6003, 0x0001, 0x6007, 0x0002, 0x080c, 0x90ef, 0x080c,
+	0x956a, 0x0804, 0xb89c, 0x080c, 0xc723, 0x01b0, 0x6014, 0x2048,
+	0xa864, 0x2010, 0x9086, 0x0139, 0x1138, 0x6007, 0x0016, 0x2001,
+	0x0002, 0x080c, 0xcd6e, 0x00b0, 0x6014, 0x2048, 0xa864, 0xd0fc,
+	0x0118, 0x2001, 0x0001, 0x0ca8, 0x2001, 0x180e, 0x2004, 0xd0dc,
+	0x0148, 0x6010, 0x2058, 0xb840, 0x9084, 0x00ff, 0x9005, 0x1110,
+	0x9006, 0x0c38, 0x080c, 0xb4a0, 0x2009, 0x026e, 0x2134, 0x96b4,
+	0x00ff, 0x9686, 0x0005, 0x0520, 0x9686, 0x000b, 0x01c8, 0x2009,
+	0x026f, 0x2104, 0x9084, 0xff00, 0x1118, 0x9686, 0x0009, 0x01c0,
+	0x9086, 0x1900, 0x1168, 0x9686, 0x0009, 0x0190, 0x2001, 0x0004,
+	0x080c, 0x647d, 0x2001, 0x0028, 0x601a, 0x6007, 0x0052, 0x0020,
+	0x2001, 0x0001, 0x080c, 0xb70a, 0x002e, 0x00be, 0x009e, 0x0005,
+	0x9286, 0x0139, 0x0160, 0x6014, 0x2048, 0x080c, 0xc723, 0x0140,
+	0xa864, 0x9086, 0x0139, 0x0118, 0xa868, 0xd0fc, 0x0108, 0x0c40,
+	0x6010, 0x2058, 0xb840, 0x9084, 0x00ff, 0x9005, 0x0138, 0x8001,
+	0xb842, 0x601b, 0x000a, 0x6007, 0x0016, 0x08f0, 0xb8a0, 0x9086,
+	0x007e, 0x1138, 0x00e6, 0x2071, 0x1800, 0x080c, 0x5ed4, 0x00ee,
+	0x0010, 0x080c, 0x31ab, 0x0860, 0x080c, 0xb912, 0x1160, 0x2001,
+	0x0004, 0x080c, 0x647d, 0x6003, 0x0001, 0x6007, 0x0003, 0x080c,
+	0x90ef, 0x0804, 0x956a, 0x080c, 0xb4a0, 0x9006, 0x0804, 0xb70a,
+	0x0489, 0x1160, 0x2001, 0x0008, 0x080c, 0x647d, 0x6003, 0x0001,
+	0x6007, 0x0005, 0x080c, 0x90ef, 0x0804, 0x956a, 0x2001, 0x0001,
+	0x0804, 0xb70a, 0x00f9, 0x1160, 0x2001, 0x000a, 0x080c, 0x647d,
+	0x6003, 0x0001, 0x6007, 0x0001, 0x080c, 0x90ef, 0x0804, 0x956a,
+	0x2001, 0x0001, 0x0804, 0xb70a, 0x2009, 0x026e, 0x2104, 0x9086,
+	0x0003, 0x1138, 0x2009, 0x026f, 0x2104, 0x9084, 0xff00, 0x9086,
+	0x2a00, 0x0005, 0x9085, 0x0001, 0x0005, 0x00b6, 0x00c6, 0x0016,
+	0x6110, 0x2158, 0x080c, 0x653c, 0x001e, 0x00ce, 0x00be, 0x0005,
+	0x00b6, 0x00f6, 0x00e6, 0x00d6, 0x0036, 0x0016, 0x6010, 0x2058,
+	0x2009, 0x1837, 0x2104, 0x9085, 0x0003, 0x200a, 0x080c, 0xb9b8,
+	0x0560, 0x2009, 0x1837, 0x2104, 0xc0cd, 0x200a, 0x080c, 0x6966,
+	0x0158, 0x9006, 0x2020, 0x2009, 0x002a, 0x080c, 0xe191, 0x2001,
+	0x180c, 0x200c, 0xc195, 0x2102, 0x2019, 0x002a, 0x2009, 0x0001,
+	0x080c, 0x316a, 0x00e6, 0x2071, 0x1800, 0x080c, 0x2f79, 0x00ee,
+	0x00c6, 0x0156, 0x20a9, 0x0781, 0x2009, 0x007f, 0x080c, 0x32bc,
+	0x8108, 0x1f04, 0xb956, 0x015e, 0x00ce, 0x080c, 0xb915, 0x2071,
+	0x0260, 0x2079, 0x0200, 0x7817, 0x0001, 0x2001, 0x1837, 0x200c,
+	0xc1c5, 0x7018, 0xd0fc, 0x0110, 0xd0dc, 0x0118, 0x7038, 0xd0dc,
+	0x1108, 0xc1c4, 0x7817, 0x0000, 0x2001, 0x1837, 0x2102, 0x2079,
+	0x0100, 0x2e04, 0x9084, 0x00ff, 0x2069, 0x181f, 0x206a, 0x78e6,
+	0x0006, 0x8e70, 0x2e04, 0x2069, 0x1820, 0x206a, 0x78ea, 0x7832,
+	0x7836, 0x2010, 0x9084, 0xff00, 0x001e, 0x9105, 0x2009, 0x182c,
+	0x200a, 0x2200, 0x9084, 0x00ff, 0x2008, 0x080c, 0x2618, 0x080c,
+	0x73e4, 0x0170, 0x2071, 0x0260, 0x2069, 0x1980, 0x7048, 0x206a,
+	0x704c, 0x6806, 0x7050, 0x680a, 0x7054, 0x680e, 0x080c, 0xcb42,
+	0x0040, 0x2001, 0x0006, 0x080c, 0x647d, 0x080c, 0x31dc, 0x080c,
+	0xaad8, 0x001e, 0x003e, 0x00de, 0x00ee, 0x00fe, 0x00be, 0x0005,
+	0x0096, 0x0026, 0x0036, 0x00e6, 0x0156, 0x2019, 0x182c, 0x231c,
+	0x83ff, 0x01f0, 0x2071, 0x0260, 0x7200, 0x9294, 0x00ff, 0x7004,
+	0x9084, 0xff00, 0x9205, 0x9306, 0x1198, 0x2011, 0x0276, 0x20a9,
+	0x0004, 0x2b48, 0x2019, 0x000a, 0x080c, 0xbaad, 0x1148, 0x2011,
+	0x027a, 0x20a9, 0x0004, 0x2019, 0x0006, 0x080c, 0xbaad, 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,
+	0x19f1, 0x252c, 0x2021, 0x19f8, 0x2424, 0x2061, 0x1ddc, 0x2071,
+	0x1800, 0x7254, 0x7074, 0x9202, 0x1a04, 0xba79, 0x080c, 0x8a5a,
+	0x0904, 0xba72, 0x080c, 0xe1bd, 0x0904, 0xba72, 0x6720, 0x9786,
+	0x0007, 0x0904, 0xba72, 0x2500, 0x9c06, 0x0904, 0xba72, 0x2400,
+	0x9c06, 0x0904, 0xba72, 0x3e08, 0x9186, 0x0002, 0x1148, 0x6010,
+	0x9005, 0x0130, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x1590,
+	0x00c6, 0x6043, 0xffff, 0x6000, 0x9086, 0x0004, 0x1110, 0x080c,
+	0x1a53, 0x9786, 0x000a, 0x0148, 0x080c, 0xc931, 0x1130, 0x00ce,
+	0x080c, 0xb4a0, 0x080c, 0xab13, 0x00e8, 0x6014, 0x2048, 0x080c,
+	0xc723, 0x01a8, 0x9786, 0x0003, 0x1530, 0xa867, 0x0103, 0xab7a,
+	0xa877, 0x0000, 0xa87c, 0xd0cc, 0x0130, 0x0096, 0xa878, 0x2048,
+	0x080c, 0x0fed, 0x009e, 0x080c, 0x6c73, 0x080c, 0xc90b, 0x080c,
+	0xab13, 0x00ce, 0x9ce0, 0x001c, 0x7068, 0x9c02, 0x1210, 0x0804,
+	0xba19, 0x012e, 0x000e, 0x002e, 0x004e, 0x005e, 0x007e, 0x00ce,
+	0x009e, 0x00ee, 0x0005, 0x9786, 0x0006, 0x1118, 0x080c, 0xe134,
+	0x0c30, 0x9786, 0x0009, 0x1148, 0x6000, 0x9086, 0x0004, 0x0d08,
+	0x2009, 0x004c, 0x080c, 0xab77, 0x08e0, 0x9786, 0x000a, 0x0938,
+	0x0820, 0x220c, 0x2304, 0x9106, 0x1130, 0x8210, 0x8318, 0x1f04,
+	0xba99, 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, 0x220c,
+	0x810f, 0x2304, 0x9106, 0x1130, 0x8210, 0x8318, 0x1f04, 0xbad7,
+	0x9006, 0x0005, 0x918d, 0x0001, 0x0005, 0x6004, 0x908a, 0x0053,
+	0x1a0c, 0x0d7d, 0x080c, 0xc920, 0x0120, 0x080c, 0xc931, 0x0158,
+	0x0028, 0x080c, 0x31dc, 0x080c, 0xc931, 0x0128, 0x080c, 0x94a8,
+	0x080c, 0xaad8, 0x0005, 0x080c, 0xb4a0, 0x0cc0, 0x9182, 0x0057,
+	0x1220, 0x9182, 0x0040, 0x0208, 0x000a, 0x0005, 0xbb1d, 0xbb1d,
+	0xbb1d, 0xbb1d, 0xbb1d, 0xbb1d, 0xbb1d, 0xbb1d, 0xbb1d, 0xbb1d,
+	0xbb1d, 0xbb1f, 0xbb1f, 0xbb1f, 0xbb1f, 0xbb1d, 0xbb1d, 0xbb1d,
+	0xbb1f, 0xbb1d, 0xbb1d, 0xbb1d, 0xbb1d, 0x080c, 0x0d7d, 0x600b,
+	0xffff, 0x6003, 0x000f, 0x6106, 0x0126, 0x2091, 0x8000, 0x080c,
+	0xce4d, 0x2009, 0x8000, 0x080c, 0x90e8, 0x012e, 0x0005, 0x9186,
+	0x0013, 0x1128, 0x6004, 0x9082, 0x0040, 0x0804, 0xbba4, 0x9186,
+	0x0027, 0x1520, 0x080c, 0x94a8, 0x080c, 0x31ab, 0x080c, 0xce4a,
+	0x0096, 0x6114, 0x2148, 0x080c, 0xc723, 0x0198, 0x080c, 0xc931,
+	0x1118, 0x080c, 0xb4a0, 0x0068, 0xa867, 0x0103, 0xa87b, 0x0029,
+	0xa877, 0x0000, 0xa97c, 0xc1c5, 0xa97e, 0x080c, 0x6c7f, 0x080c,
+	0xc90b, 0x009e, 0x080c, 0xaad8, 0x0804, 0x956a, 0x9186, 0x0014,
+	0x1120, 0x6004, 0x9082, 0x0040, 0x0018, 0x080c, 0x0d7d, 0x0005,
+	0x0002, 0xbb82, 0xbb80, 0xbb80, 0xbb80, 0xbb80, 0xbb80, 0xbb80,
+	0xbb80, 0xbb80, 0xbb80, 0xbb80, 0xbb9b, 0xbb9b, 0xbb9b, 0xbb9b,
+	0xbb80, 0xbb9b, 0xbb80, 0xbb9b, 0xbb80, 0xbb80, 0xbb80, 0xbb80,
+	0x080c, 0x0d7d, 0x080c, 0x94a8, 0x0096, 0x6114, 0x2148, 0x080c,
+	0xc723, 0x0168, 0xa867, 0x0103, 0xa87b, 0x0006, 0xa877, 0x0000,
+	0xa880, 0xc0ec, 0xa882, 0x080c, 0x6c7f, 0x080c, 0xc90b, 0x009e,
+	0x080c, 0xaad8, 0x0005, 0x080c, 0x94a8, 0x080c, 0xc931, 0x090c,
+	0xb4a0, 0x080c, 0xaad8, 0x0005, 0x0002, 0xbbbe, 0xbbbc, 0xbbbc,
+	0xbbbc, 0xbbbc, 0xbbbc, 0xbbbc, 0xbbbc, 0xbbbc, 0xbbbc, 0xbbbc,
+	0xbbc0, 0xbbc0, 0xbbc0, 0xbbc0, 0xbbbc, 0xbbc2, 0xbbbc, 0xbbc0,
+	0xbbbc, 0xbbbc, 0xbbbc, 0xbbbc, 0x080c, 0x0d7d, 0x080c, 0x0d7d,
+	0x080c, 0x0d7d, 0x080c, 0xaad8, 0x0804, 0x956a, 0x9182, 0x0057,
+	0x1220, 0x9182, 0x0040, 0x0208, 0x000a, 0x0005, 0xbbe5, 0xbbe5,
+	0xbbe5, 0xbbe5, 0xbbe5, 0xbc1e, 0xbd0d, 0xbbe5, 0xbd19, 0xbbe5,
+	0xbbe5, 0xbbe5, 0xbbe5, 0xbbe5, 0xbbe5, 0xbbe5, 0xbbe5, 0xbbe5,
+	0xbbe5, 0xbd19, 0xbbe7, 0xbbe5, 0xbd17, 0x080c, 0x0d7d, 0x00b6,
+	0x0096, 0x6114, 0x2148, 0x6010, 0x2058, 0xb800, 0xd0bc, 0x1508,
+	0xa87b, 0x0000, 0xa867, 0x0103, 0xa877, 0x0000, 0xa87c, 0xd0ac,
+	0x0128, 0xa834, 0xa938, 0x9115, 0x190c, 0xbd9e, 0x080c, 0x6a95,
+	0x6210, 0x2258, 0xba3c, 0x82ff, 0x0110, 0x8211, 0xba3e, 0xb8d0,
+	0x9005, 0x0110, 0x080c, 0x6658, 0x080c, 0xaad8, 0x009e, 0x00be,
+	0x0005, 0xa87c, 0xd0ac, 0x09e0, 0xa838, 0xa934, 0x9105, 0x09c0,
+	0xa880, 0xd0bc, 0x19a8, 0x080c, 0xca61, 0x0c80, 0x00b6, 0x0096,
+	0x6114, 0x2148, 0x601c, 0xd0fc, 0x1110, 0x7644, 0x0008, 0x9036,
+	0x96b4, 0x0fff, 0x86ff, 0x1590, 0x6010, 0x2058, 0xb800, 0xd0bc,
+	0x1904, 0xbcfc, 0xa87b, 0x0000, 0xa867, 0x0103, 0xae76, 0xa87c,
+	0xd0ac, 0x0128, 0xa834, 0xa938, 0x9115, 0x190c, 0xbd9e, 0x080c,
+	0x6a95, 0x6210, 0x2258, 0xba3c, 0x82ff, 0x0110, 0x8211, 0xba3e,
+	0xb8d0, 0x9005, 0x0110, 0x080c, 0x6658, 0x601c, 0xd0fc, 0x1148,
+	0x7044, 0xd0e4, 0x1904, 0xbce0, 0x080c, 0xaad8, 0x009e, 0x00be,
+	0x0005, 0x2009, 0x0211, 0x210c, 0x080c, 0x0d7d, 0x968c, 0x0c00,
+	0x0150, 0x6010, 0x2058, 0xb800, 0xd0bc, 0x1904, 0xbce4, 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, 0xbc2a, 0x735c, 0xab86, 0x83ff, 0x0170, 0x938a, 0x0009,
+	0x0210, 0x2019, 0x0008, 0x0036, 0x2308, 0x2019, 0x0018, 0x2011,
+	0x0025, 0x080c, 0xc2f6, 0x003e, 0xd6cc, 0x0904, 0xbc3f, 0x7154,
+	0xa98a, 0x81ff, 0x0904, 0xbc3f, 0x9192, 0x0021, 0x1278, 0x8304,
+	0x9098, 0x0018, 0x2011, 0x0029, 0x080c, 0xc2f6, 0x2011, 0x0205,
+	0x2013, 0x0000, 0x080c, 0xcdda, 0x0804, 0xbc3f, 0xa868, 0xd0fc,
+	0x0120, 0x2009, 0x0020, 0xa98a, 0x0c50, 0x00a6, 0x2950, 0x080c,
+	0xc295, 0x00ae, 0x080c, 0xcdda, 0x080c, 0xc2e6, 0x0804, 0xbc41,
+	0x080c, 0xca24, 0x0804, 0xbc56, 0xa87c, 0xd0ac, 0x0904, 0xbc67,
+	0xa880, 0xd0bc, 0x1904, 0xbc67, 0x7348, 0xa838, 0x9306, 0x11c8,
+	0x734c, 0xa834, 0x931e, 0x0904, 0xbc67, 0xd6d4, 0x0190, 0xab38,
+	0x9305, 0x0904, 0xbc67, 0x0068, 0xa87c, 0xd0ac, 0x0904, 0xbc32,
+	0xa838, 0xa934, 0x9105, 0x0904, 0xbc32, 0xa880, 0xd0bc, 0x1904,
+	0xbc32, 0x080c, 0xca61, 0x0804, 0xbc56, 0x00f6, 0x2079, 0x026c,
+	0x7c04, 0x7b00, 0x7e0c, 0x7d08, 0x00fe, 0x0021, 0x0005, 0x0011,
+	0x0005, 0x0005, 0x0096, 0x6003, 0x0002, 0x6007, 0x0043, 0x6014,
+	0x2048, 0xa87c, 0xd0ac, 0x0128, 0x009e, 0x0005, 0x2130, 0x2228,
+	0x0058, 0x2400, 0xa9ac, 0x910a, 0x2300, 0xaab0, 0x9213, 0x2600,
+	0x9102, 0x2500, 0x9203, 0x0e90, 0xac46, 0xab4a, 0xae36, 0xad3a,
+	0x6044, 0xd0fc, 0x190c, 0xa7aa, 0x604b, 0x0000, 0x080c, 0x1c0c,
+	0x1118, 0x6144, 0x080c, 0x9114, 0x009e, 0x0005, 0x9182, 0x0057,
+	0x1220, 0x9182, 0x0040, 0x0208, 0x000a, 0x0005, 0xbd65, 0xbd65,
+	0xbd65, 0xbd65, 0xbd65, 0xbd65, 0xbd65, 0xbd65, 0xbd65, 0xbd65,
+	0xbd67, 0xbd65, 0xbd65, 0xbd65, 0xbd65, 0xbd78, 0xbd65, 0xbd65,
+	0xbd65, 0xbd65, 0xbd9c, 0xbd65, 0xbd65, 0x080c, 0x0d7d, 0x6004,
+	0x9086, 0x0040, 0x1110, 0x080c, 0x94a8, 0x2019, 0x0001, 0x080c,
+	0x9fef, 0x6003, 0x0002, 0x080c, 0xce52, 0x080c, 0x9505, 0x0005,
+	0x6004, 0x9086, 0x0040, 0x1110, 0x080c, 0x94a8, 0x2019, 0x0001,
+	0x080c, 0x9fef, 0x080c, 0x9505, 0x080c, 0x31ab, 0x080c, 0xce4a,
+	0x0096, 0x6114, 0x2148, 0x080c, 0xc723, 0x0150, 0xa867, 0x0103,
+	0xa87b, 0x0029, 0xa877, 0x0000, 0x080c, 0x6c7f, 0x080c, 0xc90b,
+	0x009e, 0x080c, 0xaad8, 0x0005, 0x080c, 0x0d7d, 0xa87b, 0x0015,
+	0xd1fc, 0x0180, 0xa87b, 0x0007, 0x8002, 0x8000, 0x810a, 0x9189,
+	0x0000, 0x0006, 0x0016, 0x2009, 0x1a76, 0x2104, 0x8000, 0x200a,
+	0x001e, 0x000e, 0xa992, 0xa88e, 0x0005, 0x9182, 0x0057, 0x1220,
+	0x9182, 0x0040, 0x0208, 0x000a, 0x0005, 0xbdd4, 0xbdd4, 0xbdd4,
+	0xbdd4, 0xbdd4, 0xbdd6, 0xbdd4, 0xbdd4, 0xbe93, 0xbdd4, 0xbdd4,
+	0xbdd4, 0xbdd4, 0xbdd4, 0xbdd4, 0xbdd4, 0xbdd4, 0xbdd4, 0xbdd4,
+	0xbfd7, 0xbdd4, 0xbfe1, 0xbdd4, 0x080c, 0x0d7d, 0x601c, 0xd0bc,
+	0x0178, 0xd084, 0x0168, 0xd0f4, 0x0120, 0xc084, 0x601e, 0x0804,
+	0xbbc6, 0x6114, 0x0096, 0x2148, 0xa87c, 0xc0e5, 0xa87e, 0x009e,
+	0x0076, 0x00a6, 0x00e6, 0x0096, 0x2071, 0x0260, 0x6114, 0x2150,
+	0x601c, 0xd0fc, 0x1110, 0x7644, 0x0008, 0x9036, 0xb676, 0x96b4,
+	0x0fff, 0xb77c, 0xc7e5, 0xb77e, 0x6210, 0x00b6, 0x2258, 0xba3c,
+	0x82ff, 0x0110, 0x8211, 0xba3e, 0x00be, 0x86ff, 0x0904, 0xbe8c,
+	0x9694, 0xff00, 0x9284, 0x0c00, 0x0120, 0x7048, 0xb092, 0x704c,
+	0xb08e, 0x9284, 0x0300, 0x0904, 0xbe8c, 0x9686, 0x0100, 0x1130,
+	0x7064, 0x9005, 0x1118, 0xc6c4, 0xb676, 0x0c38, 0x080c, 0x103b,
+	0x090c, 0x0d7d, 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, 0xc2f6, 0x003e, 0xd6cc, 0x01e8, 0x7154,
+	0xa98a, 0x81ff, 0x01c8, 0x9192, 0x0021, 0x1260, 0x8304, 0x9098,
+	0x0018, 0x2011, 0x0029, 0x080c, 0xc2f6, 0x2011, 0x0205, 0x2013,
+	0x0000, 0x0050, 0xb068, 0xd0fc, 0x0120, 0x2009, 0x0020, 0xa98a,
+	0x0c68, 0x2950, 0x080c, 0xc295, 0x080c, 0x1a31, 0x009e, 0x00ee,
+	0x00ae, 0x007e, 0x0005, 0x2001, 0x1986, 0x2004, 0x604a, 0x0096,
+	0x6114, 0x2148, 0xa83c, 0xa940, 0x9105, 0x1118, 0xa87c, 0xc0dc,
+	0xa87e, 0x6003, 0x0002, 0x080c, 0xce5b, 0x0904, 0xbfd2, 0x604b,
+	0x0000, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x1500,
+	0xd1cc, 0x0904, 0xbf91, 0xa978, 0xa868, 0xd0fc, 0x0904, 0xbf52,
+	0x0016, 0xa87c, 0x0006, 0xa880, 0x0006, 0x00a6, 0x2150, 0xb174,
+	0x9184, 0x00ff, 0x90b6, 0x0002, 0x0904, 0xbf20, 0x9086, 0x0028,
+	0x1904, 0xbf0c, 0xa87b, 0x001c, 0xb07b, 0x001c, 0x0804, 0xbf28,
+	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, 0x601c, 0xc0fc, 0x601e, 0x9006,
+	0xa876, 0xa892, 0xa88e, 0xa87c, 0xc0e4, 0xa87e, 0xd0cc, 0x0140,
+	0xc0cc, 0xa87e, 0x0096, 0xa878, 0x2048, 0x080c, 0x0fed, 0x009e,
+	0x080c, 0xca61, 0x0804, 0xbfd2, 0xd1dc, 0x0158, 0xa87b, 0x0015,
+	0xb07b, 0x0015, 0x080c, 0xccfd, 0x0118, 0xb174, 0xc1dc, 0xb176,
+	0x0078, 0xd1d4, 0x0128, 0xa87b, 0x0007, 0xb07b, 0x0007, 0x0040,
+	0xa87c, 0xd0ac, 0x0128, 0xa834, 0xa938, 0x9115, 0x190c, 0xbd9e,
+	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,
+	0xcdda, 0x001e, 0xa874, 0x0006, 0x2148, 0x080c, 0x0fed, 0x001e,
+	0x0804, 0xbfbe, 0x0016, 0x00a6, 0x2150, 0xb174, 0x9184, 0x00ff,
+	0x90b6, 0x0002, 0x01e0, 0x9086, 0x0028, 0x1128, 0xa87b, 0x001c,
+	0xb07b, 0x001c, 0x00e0, 0xd1dc, 0x0158, 0xa87b, 0x0015, 0xb07b,
+	0x0015, 0x080c, 0xccfd, 0x0118, 0xb174, 0xc1dc, 0xb176, 0x0078,
+	0xd1d4, 0x0128, 0xa87b, 0x0007, 0xb07b, 0x0007, 0x0040, 0xa87c,
+	0xd0ac, 0x0128, 0xa834, 0xa938, 0x9115, 0x190c, 0xbd9e, 0xa890,
+	0xb092, 0xa88c, 0xb08e, 0xa87c, 0xb07e, 0x00ae, 0x080c, 0x0fed,
+	0x009e, 0x080c, 0xcdda, 0xa974, 0x0016, 0x080c, 0xc2e6, 0x001e,
+	0x0468, 0xa867, 0x0103, 0xa974, 0x9184, 0x00ff, 0x90b6, 0x0002,
+	0x01b0, 0x9086, 0x0028, 0x1118, 0xa87b, 0x001c, 0x00d0, 0xd1dc,
+	0x0148, 0xa87b, 0x0015, 0x080c, 0xccfd, 0x0118, 0xa974, 0xc1dc,
+	0xa976, 0x0078, 0xd1d4, 0x0118, 0xa87b, 0x0007, 0x0050, 0xa87b,
+	0x0000, 0xa87c, 0xd0ac, 0x0128, 0xa834, 0xa938, 0x9115, 0x190c,
+	0xbd9e, 0xa974, 0x0016, 0x080c, 0x6a95, 0x001e, 0x6010, 0x00b6,
+	0x2058, 0xba3c, 0x82ff, 0x0110, 0x8211, 0xba3e, 0xb8d0, 0x9005,
+	0x0120, 0x0016, 0x080c, 0x6658, 0x001e, 0x00be, 0xd1e4, 0x1120,
+	0x080c, 0xaad8, 0x009e, 0x0005, 0x080c, 0xca24, 0x0cd8, 0x6114,
+	0x0096, 0x2148, 0xa97c, 0x080c, 0xce5b, 0x190c, 0x1a3f, 0x009e,
+	0x0005, 0x0096, 0x6114, 0x2148, 0xa83c, 0xa940, 0x9105, 0x01e8,
+	0xa877, 0x0000, 0xa87b, 0x0000, 0xa867, 0x0103, 0x00b6, 0x6010,
+	0x2058, 0xa834, 0xa938, 0x9115, 0x11a0, 0x080c, 0x6a95, 0xba3c,
+	0x8211, 0x0208, 0xba3e, 0xb8d0, 0x9005, 0x0110, 0x080c, 0x6658,
+	0x080c, 0xaad8, 0x00be, 0x009e, 0x0005, 0xa87c, 0xc0dc, 0xa87e,
+	0x08f8, 0xb800, 0xd0bc, 0x1120, 0xa834, 0x080c, 0xbd9e, 0x0c28,
+	0xa880, 0xd0bc, 0x1dc8, 0x080c, 0xca61, 0x0c60, 0x080c, 0x94a8,
+	0x0010, 0x080c, 0x9505, 0x601c, 0xd084, 0x0110, 0x080c, 0x1a53,
+	0x080c, 0xc723, 0x01f0, 0x0096, 0x6114, 0x2148, 0x080c, 0xc931,
+	0x1118, 0x080c, 0xb4a0, 0x00a0, 0xa867, 0x0103, 0x2009, 0x180c,
+	0x210c, 0xd18c, 0x1198, 0xd184, 0x1170, 0x6108, 0xa97a, 0x918e,
+	0x0029, 0x1110, 0x080c, 0xe4e4, 0xa877, 0x0000, 0x080c, 0x6c7f,
+	0x009e, 0x0804, 0xab13, 0xa87b, 0x0004, 0x0cb0, 0xa87b, 0x0004,
+	0x0c98, 0x9182, 0x0057, 0x1220, 0x9182, 0x0040, 0x0208, 0x000a,
+	0x0005, 0xc068, 0xc068, 0xc068, 0xc068, 0xc068, 0xc06a, 0xc068,
+	0xc068, 0xc068, 0xc068, 0xc068, 0xc068, 0xc068, 0xc068, 0xc068,
+	0xc068, 0xc068, 0xc068, 0xc068, 0xc068, 0xc08e, 0xc068, 0xc068,
+	0x080c, 0x0d7d, 0x080c, 0x5604, 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, 0x6c7f, 0x009e, 0x0804, 0xaad8, 0x080c, 0x5604,
+	0x0dd8, 0x6014, 0x900e, 0x9016, 0x0c10, 0x9182, 0x0085, 0x0002,
+	0xc0a7, 0xc0a5, 0xc0a5, 0xc0b3, 0xc0a5, 0xc0a5, 0xc0a5, 0xc0a5,
+	0xc0a5, 0xc0a5, 0xc0a5, 0xc0a5, 0xc0a5, 0x080c, 0x0d7d, 0x6003,
+	0x0001, 0x6106, 0x0126, 0x2091, 0x8000, 0x2009, 0x8020, 0x080c,
+	0x90e8, 0x012e, 0x0005, 0x0026, 0x0056, 0x00d6, 0x00e6, 0x2071,
+	0x0260, 0x7224, 0x6216, 0x7220, 0x080c, 0xc711, 0x01a0, 0x2268,
+	0x6800, 0x9086, 0x0000, 0x0178, 0x6010, 0x6d10, 0x952e, 0x1158,
+	0x00c6, 0x2d60, 0x080c, 0xc321, 0x00ce, 0x0128, 0x6803, 0x0002,
+	0x6007, 0x0086, 0x0010, 0x6007, 0x0087, 0x6003, 0x0001, 0x2009,
+	0x8020, 0x080c, 0x90e8, 0x9280, 0x0004, 0x00b6, 0x2058, 0xb800,
+	0x00be, 0xd0bc, 0x0140, 0x6824, 0xd0ec, 0x0128, 0x00c6, 0x2260,
+	0x080c, 0xca61, 0x00ce, 0x00ee, 0x00de, 0x005e, 0x002e, 0x0005,
+	0x9186, 0x0013, 0x1160, 0x6004, 0x908a, 0x0085, 0x0a0c, 0x0d7d,
+	0x908a, 0x0092, 0x1a0c, 0x0d7d, 0x9082, 0x0085, 0x00e2, 0x9186,
+	0x0027, 0x0120, 0x9186, 0x0014, 0x190c, 0x0d7d, 0x080c, 0x94a8,
+	0x0096, 0x6014, 0x2048, 0x080c, 0xc723, 0x0140, 0xa867, 0x0103,
+	0xa877, 0x0000, 0xa87b, 0x0029, 0x080c, 0x6c7f, 0x009e, 0x080c,
+	0xab13, 0x0804, 0x956a, 0xc128, 0xc12a, 0xc12a, 0xc128, 0xc128,
+	0xc128, 0xc128, 0xc128, 0xc128, 0xc128, 0xc128, 0xc128, 0xc128,
+	0x080c, 0x0d7d, 0x080c, 0xab13, 0x0005, 0x9186, 0x0013, 0x1130,
+	0x6004, 0x9082, 0x0085, 0x2008, 0x0804, 0xc179, 0x9186, 0x0027,
+	0x1558, 0x080c, 0x94a8, 0x080c, 0x31ab, 0x080c, 0xce4a, 0x0096,
+	0x6014, 0x2048, 0x080c, 0xc723, 0x0150, 0xa867, 0x0103, 0xa877,
+	0x0000, 0xa87b, 0x0029, 0x080c, 0x6c7f, 0x080c, 0xc90b, 0x009e,
+	0x080c, 0xaad8, 0x0005, 0x9186, 0x0089, 0x0118, 0x9186, 0x008a,
+	0x1140, 0x080c, 0xa993, 0x0128, 0x9086, 0x000c, 0x0904, 0xc1b1,
+	0x0000, 0x080c, 0xab94, 0x0c70, 0x9186, 0x0014, 0x1d60, 0x080c,
+	0x94a8, 0x0096, 0x6014, 0x2048, 0x080c, 0xc723, 0x0d00, 0xa867,
+	0x0103, 0xa877, 0x0000, 0xa87b, 0x0006, 0xa880, 0xc0ec, 0xa882,
+	0x0890, 0x0002, 0xc189, 0xc187, 0xc187, 0xc187, 0xc187, 0xc187,
+	0xc19d, 0xc187, 0xc187, 0xc187, 0xc187, 0xc187, 0xc187, 0x080c,
+	0x0d7d, 0x6034, 0x908c, 0xff00, 0x810f, 0x9186, 0x0039, 0x0118,
+	0x9186, 0x0035, 0x1118, 0x2001, 0x1984, 0x0010, 0x2001, 0x1985,
+	0x2004, 0x601a, 0x6003, 0x000c, 0x0005, 0x6034, 0x908c, 0xff00,
+	0x810f, 0x9186, 0x0039, 0x0118, 0x9186, 0x0035, 0x1118, 0x2001,
+	0x1984, 0x0010, 0x2001, 0x1985, 0x2004, 0x601a, 0x6003, 0x000e,
+	0x0005, 0x9182, 0x0092, 0x1220, 0x9182, 0x0085, 0x0208, 0x0012,
+	0x0804, 0xab94, 0xc1c7, 0xc1c7, 0xc1c7, 0xc1c7, 0xc1c9, 0xc216,
+	0xc1c7, 0xc1c7, 0xc1c7, 0xc1c7, 0xc1c7, 0xc1c7, 0xc1c7, 0x080c,
+	0x0d7d, 0x0096, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc,
+	0x0168, 0x6034, 0x908c, 0xff00, 0x810f, 0x9186, 0x0039, 0x0118,
+	0x9186, 0x0035, 0x1118, 0x009e, 0x0804, 0xc22a, 0x080c, 0xc723,
+	0x1118, 0x080c, 0xc90b, 0x0068, 0x6014, 0x2048, 0x080c, 0xce61,
+	0x1110, 0x080c, 0xc90b, 0xa867, 0x0103, 0x080c, 0xce15, 0x080c,
+	0x6c7f, 0x00d6, 0x2c68, 0x080c, 0xaa82, 0x01d0, 0x6003, 0x0001,
+	0x6007, 0x001e, 0x600b, 0xffff, 0x2009, 0x026e, 0x210c, 0x613a,
+	0x2009, 0x026f, 0x210c, 0x613e, 0x6910, 0x6112, 0x080c, 0xcbb0,
+	0x695c, 0x615e, 0x6023, 0x0001, 0x2009, 0x8020, 0x080c, 0x90e8,
+	0x2d60, 0x00de, 0x080c, 0xaad8, 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, 0xcdad, 0x11f0, 0x080c,
+	0xaa82, 0x01d8, 0x6106, 0x6003, 0x0001, 0x6023, 0x0001, 0x6910,
+	0x6112, 0x692c, 0x612e, 0x6930, 0x6132, 0x6934, 0x918c, 0x00ff,
+	0x6136, 0x6938, 0x613a, 0x693c, 0x613e, 0x695c, 0x615e, 0x080c,
+	0xcbb0, 0x2009, 0x8020, 0x080c, 0x90e8, 0x2d60, 0x00de, 0x0804,
+	0xaad8, 0x0096, 0x6014, 0x2048, 0x080c, 0xc723, 0x01c8, 0xa867,
+	0x0103, 0xa880, 0xd0b4, 0x0128, 0xc0ec, 0xa882, 0xa87b, 0x0006,
+	0x0048, 0xd0bc, 0x0118, 0xa87b, 0x0002, 0x0020, 0xa87b, 0x0005,
+	0x080c, 0xca20, 0xa877, 0x0000, 0x080c, 0x6c7f, 0x080c, 0xc90b,
+	0x009e, 0x0804, 0xaad8, 0x0016, 0x0096, 0x6014, 0x2048, 0x080c,
+	0xc723, 0x0140, 0xa867, 0x0103, 0xa87b, 0x0028, 0xa877, 0x0000,
+	0x080c, 0x6c7f, 0x009e, 0x001e, 0x9186, 0x0013, 0x0158, 0x9186,
+	0x0014, 0x0130, 0x9186, 0x0027, 0x0118, 0x080c, 0xab94, 0x0020,
+	0x080c, 0x94a8, 0x080c, 0xab13, 0x0005, 0x0056, 0x0066, 0x0096,
+	0x00a6, 0x2029, 0x0001, 0x9182, 0x0101, 0x1208, 0x0010, 0x2009,
+	0x0100, 0x2130, 0x8304, 0x9098, 0x0018, 0x2009, 0x0020, 0x2011,
+	0x0029, 0x080c, 0xc2f6, 0x96b2, 0x0020, 0xb004, 0x904d, 0x0110,
+	0x080c, 0x0fed, 0x080c, 0x103b, 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, 0x6c7f,
+	0x2a48, 0x0cb8, 0x080c, 0x6c7f, 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, 0xc373, 0xc373, 0xc36e, 0xc397, 0xc34b,
+	0xc36e, 0xc34d, 0xc36e, 0xc34b, 0x8fae, 0xc36e, 0xc36e, 0xc36e,
+	0xc34b, 0xc34b, 0xc34b, 0x080c, 0x0d7d, 0x6010, 0x9080, 0x0000,
+	0x2004, 0xd0bc, 0x190c, 0xc397, 0x0036, 0x6014, 0x0096, 0x2048,
+	0xa880, 0x009e, 0xd0cc, 0x0118, 0x2019, 0x000c, 0x0038, 0xd094,
+	0x0118, 0x2019, 0x000d, 0x0010, 0x2019, 0x0010, 0x080c, 0xdce5,
+	0x6023, 0x0006, 0x6003, 0x0007, 0x003e, 0x0005, 0x9006, 0x0005,
+	0x9085, 0x0001, 0x0005, 0x0096, 0x86ff, 0x11e8, 0x6014, 0x2048,
+	0x080c, 0xc723, 0x01d0, 0x6043, 0xffff, 0xa864, 0x9086, 0x0139,
+	0x1128, 0xa87b, 0x0005, 0xa883, 0x0000, 0x0028, 0x900e, 0x2001,
+	0x0005, 0x080c, 0x6ebf, 0x080c, 0xca20, 0x080c, 0x6c73, 0x080c,
+	0xab13, 0x9085, 0x0001, 0x009e, 0x0005, 0x9006, 0x0ce0, 0x080c,
+	0xa781, 0x080c, 0xce6f, 0x6000, 0x908a, 0x0016, 0x1a0c, 0x0d7d,
+	0x002b, 0x0106, 0x080c, 0xa79d, 0x010e, 0x0005, 0xc3b6, 0xc3e4,
+	0xc3b8, 0xc40b, 0xc3df, 0xc3b6, 0xc36e, 0xc373, 0xc373, 0xc36e,
+	0xc36e, 0xc36e, 0xc36e, 0xc36e, 0xc36e, 0xc36e, 0x080c, 0x0d7d,
+	0x86ff, 0x1510, 0x6020, 0x9086, 0x0006, 0x01f0, 0x0096, 0x6014,
+	0x2048, 0x080c, 0xc723, 0x0158, 0xa87c, 0xd0cc, 0x0130, 0x0096,
+	0xa878, 0x2048, 0x080c, 0x0fed, 0x009e, 0x080c, 0xca20, 0x009e,
+	0x080c, 0xcdef, 0x6007, 0x0085, 0x6003, 0x000b, 0x6023, 0x0002,
+	0x2009, 0x8020, 0x080c, 0x90ca, 0x9085, 0x0001, 0x0005, 0x0066,
+	0x080c, 0x1a53, 0x006e, 0x08a0, 0x00e6, 0x2071, 0x19e5, 0x7030,
+	0x9c06, 0x1120, 0x080c, 0x9f6f, 0x00ee, 0x0850, 0x6020, 0x9084,
+	0x000f, 0x9086, 0x0006, 0x1150, 0x0086, 0x0096, 0x2049, 0x0001,
+	0x2c40, 0x080c, 0xa103, 0x009e, 0x008e, 0x0040, 0x0066, 0x080c,
+	0x9e6b, 0x190c, 0x0d7d, 0x080c, 0x9e79, 0x006e, 0x00ee, 0x1904,
+	0xc3b8, 0x0804, 0xc36e, 0x0036, 0x00e6, 0x2071, 0x19e5, 0x704c,
+	0x9c06, 0x1138, 0x901e, 0x080c, 0x9fef, 0x00ee, 0x003e, 0x0804,
+	0xc3b8, 0x080c, 0xa239, 0x00ee, 0x003e, 0x1904, 0xc3b8, 0x0804,
+	0xc36e, 0x00c6, 0x0066, 0x6020, 0x9084, 0x000f, 0x001b, 0x006e,
+	0x00ce, 0x0005, 0xc441, 0xc503, 0xc66a, 0xc449, 0xab13, 0xc441,
+	0xdcd7, 0xce57, 0xc503, 0x8f75, 0xc6e9, 0xc43a, 0xc43a, 0xc43a,
+	0xc43a, 0xc43a, 0x080c, 0x0d7d, 0x080c, 0xc931, 0x1110, 0x080c,
+	0xb4a0, 0x0005, 0x080c, 0x94a8, 0x0804, 0xaad8, 0x601b, 0x0001,
+	0x0005, 0x080c, 0xc723, 0x0130, 0x6014, 0x0096, 0x2048, 0x2c00,
+	0xa896, 0x009e, 0x080c, 0xa781, 0x080c, 0xce6f, 0x6000, 0x908a,
+	0x0016, 0x1a0c, 0x0d7d, 0x0013, 0x0804, 0xa79d, 0xc46e, 0xc470,
+	0xc49a, 0xc4ae, 0xc4d9, 0xc46e, 0xc441, 0xc441, 0xc441, 0xc4b5,
+	0xc4b5, 0xc46e, 0xc46e, 0xc46e, 0xc46e, 0xc4bf, 0x080c, 0x0d7d,
+	0x00e6, 0x6014, 0x0096, 0x2048, 0xa880, 0xc0b5, 0xa882, 0x009e,
+	0x2071, 0x19e5, 0x7030, 0x9c06, 0x01d0, 0x0066, 0x080c, 0x9e6b,
+	0x190c, 0x0d7d, 0x080c, 0x9e79, 0x006e, 0x080c, 0xcdef, 0x6007,
+	0x0085, 0x6003, 0x000b, 0x6023, 0x0002, 0x2001, 0x1985, 0x2004,
+	0x601a, 0x2009, 0x8020, 0x080c, 0x90ca, 0x00ee, 0x0005, 0x601b,
+	0x0001, 0x0cd8, 0x0096, 0x6014, 0x2048, 0xa880, 0xc0b5, 0xa882,
+	0x009e, 0x080c, 0xcdef, 0x6007, 0x0085, 0x6003, 0x000b, 0x6023,
+	0x0002, 0x2009, 0x8020, 0x080c, 0x90ca, 0x0005, 0x080c, 0xa781,
+	0x080c, 0xa915, 0x080c, 0xa79d, 0x0c28, 0x0096, 0x601b, 0x0001,
+	0x6014, 0x2048, 0xa880, 0xc0b5, 0xa882, 0x009e, 0x0005, 0x080c,
+	0x5604, 0x01a8, 0x6014, 0x0096, 0x904d, 0x0180, 0xa864, 0xa867,
+	0x0103, 0xa87b, 0x0006, 0x9086, 0x0139, 0x1140, 0xa867, 0x0139,
+	0xa897, 0x4005, 0xa89b, 0x0004, 0x080c, 0x6c7f, 0x009e, 0x0804,
+	0xaad8, 0x6014, 0x0096, 0x904d, 0x0508, 0x080c, 0xce5b, 0x01f0,
+	0x080c, 0xa79d, 0x2001, 0x180f, 0x2004, 0xd0c4, 0x0110, 0x009e,
+	0x0005, 0xa884, 0x009e, 0x8003, 0x800b, 0x810b, 0x9108, 0x611a,
+	0x2001, 0x0037, 0x2c08, 0x080c, 0x1670, 0x6000, 0x9086, 0x0004,
+	0x1120, 0x2009, 0x0048, 0x080c, 0xab77, 0x0005, 0x009e, 0x080c,
+	0x1a53, 0x0804, 0xc49a, 0x6000, 0x908a, 0x0016, 0x1a0c, 0x0d7d,
+	0x000b, 0x0005, 0xc51a, 0xc446, 0xc51c, 0xc51a, 0xc51c, 0xc51c,
+	0xc442, 0xc51a, 0xc43c, 0xc43c, 0xc51a, 0xc51a, 0xc51a, 0xc51a,
+	0xc51a, 0xc51a, 0x080c, 0x0d7d, 0x6010, 0x00b6, 0x2058, 0xb804,
+	0x9084, 0x00ff, 0x00be, 0x908a, 0x000c, 0x1a0c, 0x0d7d, 0x00b6,
+	0x0013, 0x00be, 0x0005, 0xc537, 0xc604, 0xc539, 0xc579, 0xc539,
+	0xc579, 0xc539, 0xc547, 0xc537, 0xc579, 0xc537, 0xc568, 0x080c,
+	0x0d7d, 0x6004, 0x908e, 0x0016, 0x05c0, 0x908e, 0x0004, 0x05a8,
+	0x908e, 0x0002, 0x0590, 0x908e, 0x0052, 0x0904, 0xc600, 0x6004,
+	0x080c, 0xc931, 0x0904, 0xc61d, 0x908e, 0x0004, 0x1110, 0x080c,
+	0x31dc, 0x908e, 0x0021, 0x0904, 0xc621, 0x908e, 0x0022, 0x0904,
+	0xc665, 0x908e, 0x003d, 0x0904, 0xc621, 0x908e, 0x0039, 0x0904,
+	0xc625, 0x908e, 0x0035, 0x0904, 0xc625, 0x908e, 0x001e, 0x0178,
+	0x908e, 0x0001, 0x1140, 0x6010, 0x2058, 0xb804, 0x9084, 0x00ff,
+	0x9086, 0x0006, 0x0110, 0x080c, 0x31ab, 0x080c, 0xb4a0, 0x0804,
+	0xab13, 0x00c6, 0x00d6, 0x6104, 0x9186, 0x0016, 0x0904, 0xc5f1,
+	0x9186, 0x0002, 0x1904, 0xc5c6, 0x2001, 0x1837, 0x2004, 0xd08c,
+	0x11c8, 0x080c, 0x73e4, 0x11b0, 0x080c, 0xce35, 0x0138, 0x080c,
+	0x7407, 0x1120, 0x080c, 0x72ef, 0x0804, 0xc64e, 0x2001, 0x197d,
+	0x2003, 0x0001, 0x2001, 0x1800, 0x2003, 0x0001, 0x080c, 0x7315,
+	0x0804, 0xc64e, 0x6010, 0x2058, 0x2001, 0x1837, 0x2004, 0xd0ac,
+	0x1904, 0xc64e, 0xb8a0, 0x9084, 0xff80, 0x1904, 0xc64e, 0xb840,
+	0x9084, 0x00ff, 0x9005, 0x0190, 0x8001, 0xb842, 0x6017, 0x0000,
+	0x6023, 0x0007, 0x601b, 0x0398, 0x604b, 0x0000, 0x080c, 0xaa82,
+	0x0128, 0x2b00, 0x6012, 0x6023, 0x0001, 0x0458, 0x00de, 0x00ce,
+	0x6004, 0x908e, 0x0002, 0x11a0, 0x6010, 0x2058, 0xb8a0, 0x9086,
+	0x007e, 0x1170, 0x2009, 0x1837, 0x2104, 0xc085, 0x200a, 0x00e6,
+	0x2071, 0x1800, 0x080c, 0x5ed4, 0x00ee, 0x080c, 0xb4a0, 0x0030,
+	0x080c, 0xb4a0, 0x080c, 0x31ab, 0x080c, 0xce4a, 0x00e6, 0x0126,
+	0x2091, 0x8000, 0x080c, 0x31dc, 0x012e, 0x00ee, 0x080c, 0xab13,
+	0x0005, 0x2001, 0x0002, 0x080c, 0x647d, 0x6003, 0x0001, 0x6007,
+	0x0002, 0x080c, 0x90ef, 0x080c, 0x956a, 0x00de, 0x00ce, 0x0c80,
+	0x080c, 0x31dc, 0x0804, 0xc575, 0x00c6, 0x00d6, 0x6104, 0x9186,
+	0x0016, 0x0d38, 0x6010, 0x2058, 0xb840, 0x9084, 0x00ff, 0x9005,
+	0x0904, 0xc5c6, 0x8001, 0xb842, 0x6003, 0x0001, 0x080c, 0x90ef,
+	0x080c, 0x956a, 0x00de, 0x00ce, 0x0898, 0x080c, 0xb4a0, 0x0804,
+	0xc577, 0x080c, 0xb4dc, 0x0804, 0xc577, 0x00d6, 0x2c68, 0x6104,
+	0x080c, 0xcdad, 0x00de, 0x0118, 0x080c, 0xaad8, 0x00f0, 0x6004,
+	0x8007, 0x6134, 0x918c, 0x00ff, 0x9105, 0x6036, 0x6007, 0x0085,
+	0x6003, 0x000b, 0x6023, 0x0002, 0x603c, 0x600a, 0x2001, 0x1985,
+	0x2004, 0x601a, 0x602c, 0x2c08, 0x2060, 0x6024, 0xc0b5, 0x6026,
+	0x2160, 0x2009, 0x8020, 0x080c, 0x90e8, 0x0005, 0x00de, 0x00ce,
+	0x080c, 0xb4a0, 0x080c, 0x31ab, 0x00e6, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x31dc, 0x6017, 0x0000, 0x6023, 0x0007, 0x601b, 0x0398,
+	0x604b, 0x0000, 0x012e, 0x00ee, 0x0005, 0x080c, 0xaf14, 0x1904,
+	0xc61d, 0x0005, 0x6000, 0x908a, 0x0016, 0x1a0c, 0x0d7d, 0x0096,
+	0x00d6, 0x001b, 0x00de, 0x009e, 0x0005, 0xc685, 0xc685, 0xc685,
+	0xc685, 0xc685, 0xc685, 0xc685, 0xc685, 0xc685, 0xc441, 0xc685,
+	0xc446, 0xc687, 0xc446, 0xc694, 0xc685, 0x080c, 0x0d7d, 0x6004,
+	0x9086, 0x008b, 0x0148, 0x6007, 0x008b, 0x6003, 0x000d, 0x2009,
+	0x8020, 0x080c, 0x90e8, 0x0005, 0x080c, 0xce29, 0x0118, 0x080c,
+	0xce3c, 0x0010, 0x080c, 0xce4a, 0x080c, 0xc90b, 0x080c, 0xc723,
+	0x0570, 0x080c, 0x31ab, 0x080c, 0xc723, 0x0168, 0x6014, 0x2048,
+	0xa867, 0x0103, 0xa87b, 0x0006, 0xa877, 0x0000, 0xa880, 0xc0ed,
+	0xa882, 0x080c, 0x6c7f, 0x2c68, 0x080c, 0xaa82, 0x0150, 0x6810,
+	0x6012, 0x080c, 0xcbb0, 0x00c6, 0x2d60, 0x080c, 0xab13, 0x00ce,
+	0x0008, 0x2d60, 0x6017, 0x0000, 0x6023, 0x0001, 0x6007, 0x0001,
+	0x6003, 0x0001, 0x080c, 0x90ef, 0x080c, 0x956a, 0x00c8, 0x080c,
+	0xce29, 0x0138, 0x6034, 0x9086, 0x4000, 0x1118, 0x080c, 0x31ab,
+	0x08d0, 0x6034, 0x908c, 0xff00, 0x810f, 0x9186, 0x0039, 0x0118,
+	0x9186, 0x0035, 0x1118, 0x080c, 0x31ab, 0x0868, 0x080c, 0xab13,
+	0x0005, 0x6000, 0x908a, 0x0016, 0x1a0c, 0x0d7d, 0x0002, 0xc6ff,
+	0xc6ff, 0xc701, 0xc701, 0xc701, 0xc6ff, 0xc6ff, 0xab13, 0xc6ff,
+	0xc6ff, 0xc6ff, 0xc6ff, 0xc6ff, 0xc6ff, 0xc6ff, 0xc6ff, 0x080c,
+	0x0d7d, 0x080c, 0xa781, 0x080c, 0xa915, 0x080c, 0xa79d, 0x6114,
+	0x0096, 0x2148, 0xa87b, 0x0006, 0x080c, 0x6c7f, 0x009e, 0x0804,
+	0xaad8, 0x9284, 0x0003, 0x1158, 0x9282, 0x1ddc, 0x0240, 0x2001,
+	0x181a, 0x2004, 0x9202, 0x1218, 0x9085, 0x0001, 0x0005, 0x9006,
+	0x0ce8, 0x0096, 0x0028, 0x0096, 0x0006, 0x6014, 0x2048, 0x000e,
+	0x0006, 0x9984, 0xf000, 0x9086, 0xf000, 0x0110, 0x080c, 0x10e6,
+	0x000e, 0x009e, 0x0005, 0x00e6, 0x00c6, 0x0036, 0x0006, 0x0126,
+	0x2091, 0x8000, 0x2061, 0x1ddc, 0x2071, 0x1800, 0x7354, 0x7074,
+	0x9302, 0x1640, 0x6020, 0x9206, 0x11f8, 0x080c, 0xce35, 0x0180,
+	0x9286, 0x0001, 0x1168, 0x6004, 0x9086, 0x0004, 0x1148, 0x080c,
+	0x31ab, 0x080c, 0xce4a, 0x00c6, 0x080c, 0xab13, 0x00ce, 0x0060,
+	0x080c, 0xcb22, 0x0148, 0x080c, 0xc931, 0x1110, 0x080c, 0xb4a0,
+	0x00c6, 0x080c, 0xaad8, 0x00ce, 0x9ce0, 0x001c, 0x7068, 0x9c02,
+	0x1208, 0x08a0, 0x012e, 0x000e, 0x003e, 0x00ce, 0x00ee, 0x0005,
+	0x00e6, 0x00c6, 0x0016, 0x9188, 0x1000, 0x210c, 0x81ff, 0x0128,
+	0x2061, 0x1b30, 0x6112, 0x080c, 0x31ab, 0x9006, 0x0010, 0x9085,
+	0x0001, 0x001e, 0x00ce, 0x00ee, 0x0005, 0x00c6, 0x0126, 0x2091,
+	0x8000, 0x080c, 0xaa82, 0x01d8, 0x080c, 0x5604, 0x0110, 0x662e,
+	0x0008, 0x6616, 0x2b00, 0x6012, 0x080c, 0x5604, 0x0118, 0x080c,
+	0xc84d, 0x0168, 0x080c, 0xcbb0, 0x6023, 0x0003, 0x2009, 0x004b,
+	0x080c, 0xab77, 0x9085, 0x0001, 0x012e, 0x00ce, 0x0005, 0x9006,
+	0x0cd8, 0x00c6, 0x0126, 0x2091, 0x8000, 0xbaa0, 0x080c, 0xab4a,
+	0x05b0, 0x080c, 0x5604, 0x0118, 0x602f, 0x0000, 0x0010, 0x6017,
+	0x0000, 0x2b00, 0x6012, 0x080c, 0xcbb0, 0x6023, 0x0003, 0x0016,
+	0x080c, 0xa781, 0x080c, 0x926f, 0x0076, 0x903e, 0x080c, 0x9141,
+	0x2c08, 0x080c, 0xdeb3, 0x007e, 0x080c, 0xa79d, 0x001e, 0xd184,
+	0x0128, 0x080c, 0xaad8, 0x9085, 0x0001, 0x0070, 0x080c, 0x5604,
+	0x0128, 0xd18c, 0x1170, 0x080c, 0xc84d, 0x0148, 0x2009, 0x004c,
+	0x080c, 0xab77, 0x9085, 0x0001, 0x012e, 0x00ce, 0x0005, 0x9006,
+	0x0cd8, 0x2900, 0x6016, 0x0c90, 0x2009, 0x004d, 0x0010, 0x2009,
+	0x004e, 0x00f6, 0x00c6, 0x0046, 0x0016, 0x080c, 0xaa82, 0x2c78,
+	0x01d8, 0x080c, 0x5604, 0x0110, 0x7e2e, 0x0008, 0x7e16, 0x2b00,
+	0x7812, 0x7823, 0x0003, 0x2021, 0x0005, 0x080c, 0xc85f, 0x2f60,
+	0x080c, 0x5604, 0x0118, 0x080c, 0xc84d, 0x0130, 0x001e, 0x0016,
+	0x080c, 0xab77, 0x9085, 0x0001, 0x001e, 0x004e, 0x00ce, 0x00fe,
+	0x0005, 0x00f6, 0x00c6, 0x0046, 0x080c, 0xaa82, 0x2c78, 0x0530,
+	0x080c, 0x5604, 0x0110, 0x7e2e, 0x0008, 0x7e16, 0x2b00, 0x7812,
+	0x7823, 0x0003, 0x0096, 0x2021, 0x0004, 0x0489, 0x009e, 0x2001,
+	0x197e, 0x200c, 0xd1fc, 0x0120, 0x2f60, 0x080c, 0xaad8, 0x0060,
+	0x2f60, 0x080c, 0x5604, 0x0120, 0xd18c, 0x1160, 0x0071, 0x0130,
+	0x2009, 0x0052, 0x080c, 0xab77, 0x9085, 0x0001, 0x004e, 0x00ce,
+	0x00fe, 0x0005, 0x2900, 0x7816, 0x0c98, 0x00c6, 0x080c, 0x49d8,
+	0x00ce, 0x1120, 0x080c, 0xaad8, 0x9006, 0x0005, 0xa867, 0x0000,
+	0xa86b, 0x8000, 0x2900, 0x6016, 0x9085, 0x0001, 0x0005, 0x0096,
+	0x0076, 0x0126, 0x2091, 0x8000, 0x080c, 0xa781, 0x080c, 0x670c,
+	0x0158, 0x2001, 0xc866, 0x0006, 0x900e, 0x2400, 0x080c, 0x6ebf,
+	0x080c, 0x6c7f, 0x000e, 0x0807, 0x2418, 0x080c, 0x946e, 0xbaa0,
+	0x0086, 0x2041, 0x0001, 0x2039, 0x0001, 0x2608, 0x080c, 0x9289,
+	0x008e, 0x080c, 0x9141, 0x2f08, 0x2648, 0x080c, 0xdeb3, 0xb93c,
+	0x81ff, 0x090c, 0x9360, 0x080c, 0xa79d, 0x012e, 0x007e, 0x009e,
+	0x0005, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c, 0xaa82, 0x0190,
+	0x660a, 0x2b08, 0x6112, 0x080c, 0xcbb0, 0x6023, 0x0001, 0x2900,
+	0x6016, 0x2009, 0x001f, 0x080c, 0xab77, 0x9085, 0x0001, 0x012e,
+	0x00ce, 0x0005, 0x9006, 0x0cd8, 0x00c6, 0x0126, 0x2091, 0x8000,
+	0x080c, 0xab4a, 0x01b8, 0x660a, 0x2b08, 0x6112, 0x080c, 0xcbb0,
+	0x6023, 0x0008, 0x2900, 0x6016, 0x00f6, 0x2c78, 0x080c, 0x1728,
+	0x00fe, 0x2009, 0x0021, 0x080c, 0xab77, 0x9085, 0x0001, 0x012e,
+	0x00ce, 0x0005, 0x9006, 0x0cd8, 0x2009, 0x003d, 0x00c6, 0x0126,
+	0x0016, 0x2091, 0x8000, 0x080c, 0xaa82, 0x0198, 0x660a, 0x2b08,
+	0x6112, 0x080c, 0xcbb0, 0x6023, 0x0001, 0x2900, 0x6016, 0x001e,
+	0x0016, 0x080c, 0xab77, 0x9085, 0x0001, 0x001e, 0x012e, 0x00ce,
+	0x0005, 0x9006, 0x0cd0, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c,
+	0xab4a, 0x0188, 0x2b08, 0x6112, 0x080c, 0xcbb0, 0x6023, 0x0001,
+	0x2900, 0x6016, 0x2009, 0x0000, 0x080c, 0xab77, 0x9085, 0x0001,
+	0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x2009, 0x0044, 0x0830,
+	0x2009, 0x0049, 0x0818, 0x0026, 0x00b6, 0x6210, 0x2258, 0xba3c,
+	0x82ff, 0x0118, 0x8211, 0xba3e, 0x1140, 0xb8d0, 0x9005, 0x0128,
+	0xb888, 0x9005, 0x1110, 0xb88b, 0x0001, 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, 0xc723, 0x0168, 0xa864, 0x9086, 0x0139, 0x0158,
+	0x6020, 0x9086, 0x0003, 0x0128, 0xa868, 0xd0fc, 0x0110, 0x9006,
+	0x0010, 0x9085, 0x0001, 0x009e, 0x000e, 0x0005, 0x00c6, 0x0126,
+	0x2091, 0x8000, 0x080c, 0xab4a, 0x0198, 0x2b08, 0x6112, 0x080c,
+	0xcbb0, 0x6023, 0x0001, 0x2900, 0x6016, 0x080c, 0x31ab, 0x2009,
+	0x0028, 0x080c, 0xab77, 0x9085, 0x0001, 0x012e, 0x00ce, 0x0005,
+	0x9006, 0x0cd8, 0x9186, 0x0015, 0x11a8, 0x2011, 0x1824, 0x2204,
+	0x9086, 0x0074, 0x1178, 0x00b6, 0x080c, 0xb6f2, 0x00be, 0x080c,
+	0xb915, 0x6003, 0x0001, 0x6007, 0x0029, 0x080c, 0x90ef, 0x080c,
+	0x956a, 0x0078, 0x6014, 0x0096, 0x2048, 0xa868, 0x009e, 0xd0fc,
+	0x0148, 0x2001, 0x0001, 0x080c, 0xcd6e, 0x080c, 0xb4a0, 0x080c,
+	0xaad8, 0x0005, 0x0096, 0x6014, 0x904d, 0x090c, 0x0d7d, 0xa87b,
+	0x0030, 0xa883, 0x0000, 0xa897, 0x4005, 0xa89b, 0x0004, 0xa867,
+	0x0139, 0x0126, 0x2091, 0x8000, 0x080c, 0x6c7f, 0x012e, 0x009e,
+	0x080c, 0xaad8, 0x0c30, 0x0096, 0x9186, 0x0016, 0x1128, 0x2001,
+	0x0004, 0x080c, 0x647d, 0x00e8, 0x9186, 0x0015, 0x1510, 0x2011,
+	0x1824, 0x2204, 0x9086, 0x0014, 0x11e0, 0x6010, 0x00b6, 0x2058,
+	0x080c, 0x65c8, 0x00be, 0x080c, 0xb9e6, 0x1198, 0x6010, 0x00b6,
+	0x2058, 0xb890, 0x00be, 0x9005, 0x0160, 0x2001, 0x0006, 0x080c,
+	0x647d, 0x6014, 0x2048, 0xa868, 0xd0fc, 0x0170, 0x080c, 0xaee8,
+	0x0048, 0x6014, 0x2048, 0xa868, 0xd0fc, 0x0528, 0x080c, 0xb4a0,
+	0x080c, 0xaad8, 0x009e, 0x0005, 0x6014, 0x6310, 0x2358, 0x904d,
+	0x090c, 0x0d7d, 0xa87b, 0x0000, 0xa883, 0x0000, 0xa897, 0x4000,
+	0x900e, 0x080c, 0x681c, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108,
+	0xc18d, 0xa99a, 0x0126, 0x2091, 0x8000, 0x080c, 0x6c7f, 0x012e,
+	0x080c, 0xaad8, 0x08f8, 0x6014, 0x904d, 0x090c, 0x0d7d, 0xa87b,
+	0x0030, 0xa883, 0x0000, 0xa897, 0x4005, 0xa89b, 0x0004, 0xa867,
+	0x0139, 0x0126, 0x2091, 0x8000, 0x080c, 0x6c7f, 0x012e, 0x080c,
+	0xaad8, 0x0840, 0xa878, 0x9086, 0x0005, 0x1108, 0x0009, 0x0005,
+	0xa880, 0xc0ad, 0xa882, 0x0005, 0x604b, 0x0000, 0x6017, 0x0000,
+	0x6003, 0x0001, 0x6007, 0x0050, 0x2009, 0x8023, 0x080c, 0x90e8,
+	0x0005, 0x00c6, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc,
+	0x0130, 0x0066, 0x6020, 0x9084, 0x000f, 0x001b, 0x006e, 0x00ce,
+	0x0005, 0xc441, 0xca53, 0xca53, 0xca56, 0xe1db, 0xe1f6, 0xe1f9,
+	0xc441, 0xc441, 0xc441, 0xc441, 0xc441, 0xc441, 0xc441, 0xc441,
+	0xc441, 0x080c, 0x0d7d, 0xa001, 0xa001, 0x0005, 0x0096, 0x6014,
+	0x904d, 0x0118, 0xa87c, 0xd0e4, 0x1110, 0x009e, 0x0010, 0x009e,
+	0x0005, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x0550,
+	0x2001, 0x1834, 0x2004, 0x9005, 0x1540, 0x00f6, 0x2c78, 0x080c,
+	0xaa82, 0x0508, 0x7810, 0x6012, 0x080c, 0xcbb0, 0x7820, 0x9086,
+	0x0003, 0x0128, 0x7808, 0x603a, 0x2f00, 0x603e, 0x0020, 0x7808,
+	0x603e, 0x2f00, 0x603a, 0x602e, 0x6023, 0x0001, 0x6007, 0x0035,
+	0x6003, 0x0001, 0x795c, 0x615e, 0x2009, 0x8020, 0x080c, 0x90e8,
+	0x2f60, 0x00fe, 0x0005, 0x2f60, 0x00fe, 0x2001, 0x1986, 0x2004,
+	0x604a, 0x0005, 0x0016, 0x0096, 0x6814, 0x2048, 0x681c, 0xd0fc,
+	0xc0fc, 0x681e, 0xa87c, 0x1108, 0xd0e4, 0x0180, 0xc0e4, 0xa87e,
+	0xa877, 0x0000, 0xa893, 0x0000, 0xa88f, 0x0000, 0xd0cc, 0x0130,
+	0xc0cc, 0xa87e, 0xa878, 0x2048, 0x080c, 0x0fed, 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, 0x695c, 0x615e, 0x6023, 0x0001,
+	0x6007, 0x0039, 0x6003, 0x0001, 0x2009, 0x8020, 0x080c, 0x90e8,
+	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,
+	0x1980, 0x200c, 0x8000, 0x2014, 0x2001, 0x0032, 0x080c, 0x9030,
+	0x2001, 0x1984, 0x82ff, 0x1110, 0x2011, 0x0014, 0x2202, 0x2001,
+	0x1982, 0x200c, 0x8000, 0x2014, 0x2071, 0x196c, 0x711a, 0x721e,
+	0x2001, 0x0064, 0x080c, 0x9030, 0x2001, 0x1985, 0x82ff, 0x1110,
+	0x2011, 0x0014, 0x2202, 0x2001, 0x1986, 0x9288, 0x000a, 0x2102,
+	0x2001, 0x0017, 0x080c, 0xa772, 0x2001, 0x1a87, 0x2102, 0x2001,
+	0x0032, 0x080c, 0x1670, 0x080c, 0x694b, 0x00ee, 0x003e, 0x002e,
+	0x001e, 0x000e, 0x0005, 0x0006, 0x0016, 0x00e6, 0x2001, 0x1984,
+	0x2003, 0x0028, 0x2001, 0x1985, 0x2003, 0x0014, 0x2071, 0x196c,
+	0x701b, 0x0000, 0x701f, 0x07d0, 0x2001, 0x1986, 0x2009, 0x001e,
+	0x2102, 0x2001, 0x0017, 0x080c, 0xa772, 0x2001, 0x1a87, 0x2102,
+	0x2001, 0x0032, 0x080c, 0x1670, 0x00ee, 0x001e, 0x000e, 0x0005,
+	0x0096, 0x6060, 0x904d, 0x0110, 0x080c, 0x106d, 0x009e, 0x0005,
+	0x0005, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c, 0xaa82, 0x0180,
+	0x2b08, 0x6112, 0x0ca9, 0x6023, 0x0001, 0x2900, 0x6016, 0x2009,
+	0x0033, 0x080c, 0xab77, 0x9085, 0x0001, 0x012e, 0x00ce, 0x0005,
+	0x9006, 0x0cd8, 0x0096, 0x00e6, 0x00f6, 0x2071, 0x1800, 0x9186,
+	0x0015, 0x1500, 0x7090, 0x9086, 0x0018, 0x11e0, 0x6014, 0x2048,
+	0xaa3c, 0xd2e4, 0x1160, 0x2c78, 0x080c, 0x9629, 0x01d8, 0x707c,
+	0xaa50, 0x9206, 0x1160, 0x7080, 0xaa54, 0x9206, 0x1140, 0x6210,
+	0x00b6, 0x2258, 0xbaa0, 0x00be, 0x900e, 0x080c, 0x31fc, 0x080c,
+	0xaee8, 0x0020, 0x080c, 0xb4a0, 0x080c, 0xaad8, 0x00fe, 0x00ee,
+	0x009e, 0x0005, 0x7060, 0xaa54, 0x9206, 0x0d48, 0x0c80, 0x00c6,
+	0x0126, 0x2091, 0x8000, 0x080c, 0xaa82, 0x0188, 0x2b08, 0x6112,
+	0x080c, 0xcbb0, 0x6023, 0x0001, 0x2900, 0x6016, 0x2009, 0x004d,
+	0x080c, 0xab77, 0x9085, 0x0001, 0x012e, 0x00ce, 0x0005, 0x9006,
+	0x0cd8, 0x00c6, 0x0126, 0x2091, 0x8000, 0x0016, 0x080c, 0xaa82,
+	0x0180, 0x2b08, 0x6112, 0x080c, 0xcbb0, 0x6023, 0x0001, 0x2900,
+	0x6016, 0x001e, 0x080c, 0xab77, 0x9085, 0x0001, 0x012e, 0x00ce,
+	0x0005, 0x001e, 0x9006, 0x0cd0, 0x0016, 0x0026, 0x0036, 0x0046,
+	0x0056, 0x0066, 0x0096, 0x00e6, 0x00f6, 0x2071, 0x1800, 0x9186,
+	0x0015, 0x1568, 0x7190, 0x6014, 0x2048, 0xa814, 0x8003, 0x9106,
+	0x1530, 0x20e1, 0x0000, 0x2001, 0x199e, 0x2003, 0x0000, 0x6014,
+	0x2048, 0xa830, 0x20a8, 0x8906, 0x8006, 0x8007, 0x9094, 0x003f,
+	0x22e8, 0x9084, 0xffc0, 0x9080, 0x001b, 0x20a0, 0x2001, 0x199e,
+	0x0016, 0x200c, 0x080c, 0xd438, 0x001e, 0xa804, 0x9005, 0x0110,
+	0x2048, 0x0c38, 0x6014, 0x2048, 0xa867, 0x0103, 0x0010, 0x080c,
+	0xb4a0, 0x080c, 0xaad8, 0x00fe, 0x00ee, 0x009e, 0x006e, 0x005e,
+	0x004e, 0x003e, 0x002e, 0x001e, 0x0005, 0x0096, 0x00e6, 0x00f6,
+	0x2071, 0x1800, 0x9186, 0x0015, 0x11b8, 0x7090, 0x9086, 0x0004,
+	0x1198, 0x6014, 0x2048, 0x2c78, 0x080c, 0x9629, 0x01a8, 0x707c,
+	0xaa74, 0x9206, 0x1130, 0x7080, 0xaa78, 0x9206, 0x1110, 0x080c,
+	0x31ab, 0x080c, 0xaee8, 0x0020, 0x080c, 0xb4a0, 0x080c, 0xaad8,
+	0x00fe, 0x00ee, 0x009e, 0x0005, 0x7060, 0xaa78, 0x9206, 0x0d78,
+	0x0c80, 0x0096, 0x00e6, 0x00f6, 0x2071, 0x1800, 0x9186, 0x0015,
+	0x1550, 0x7090, 0x9086, 0x0004, 0x1530, 0x6014, 0x2048, 0x2c78,
+	0x080c, 0x9629, 0x05e8, 0x707c, 0xaacc, 0x9206, 0x1180, 0x7080,
+	0xaad0, 0x9206, 0x1160, 0x080c, 0x31ab, 0x0016, 0xa998, 0xaab0,
+	0x9284, 0x1000, 0xc0fd, 0x080c, 0x55b4, 0x001e, 0x0010, 0x080c,
+	0x539d, 0x080c, 0xc723, 0x0500, 0xa87b, 0x0000, 0xa883, 0x0000,
+	0xa897, 0x4000, 0x0078, 0x080c, 0x539d, 0x080c, 0xc723, 0x01a0,
+	0x6014, 0x2048, 0xa87b, 0x0030, 0xa883, 0x0000, 0xa897, 0x4005,
+	0xa89b, 0x0004, 0x0126, 0x2091, 0x8000, 0xa867, 0x0139, 0x080c,
+	0x6c7f, 0x012e, 0x080c, 0xaad8, 0x00fe, 0x00ee, 0x009e, 0x0005,
+	0x7060, 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,
+	0xc723, 0x0904, 0xcd6a, 0x0096, 0x6314, 0x2348, 0xa87a, 0xa982,
+	0x929e, 0x4000, 0x1580, 0x6310, 0x00c6, 0x2358, 0x2009, 0x0000,
+	0xa868, 0xd0f4, 0x1140, 0x080c, 0x681c, 0x1108, 0xc185, 0xb800,
+	0xd0bc, 0x0108, 0xc18d, 0xaa96, 0xa99a, 0x20a9, 0x0004, 0xa860,
+	0x20e8, 0xa85c, 0x9080, 0x0031, 0x20a0, 0xb8c4, 0x20e0, 0xb8c8,
+	0x9080, 0x0006, 0x2098, 0x080c, 0x0fb8, 0x20a9, 0x0004, 0xa85c,
+	0x9080, 0x0035, 0x20a0, 0xb8c8, 0x9080, 0x000a, 0x2098, 0x080c,
+	0x0fb8, 0x00ce, 0x0090, 0xaa96, 0x3918, 0x9398, 0x0007, 0x231c,
+	0x6004, 0x9086, 0x0016, 0x0110, 0xa89b, 0x0004, 0xaba2, 0x6310,
+	0x2358, 0xb804, 0x9084, 0x00ff, 0xa89e, 0x080c, 0x6c73, 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, 0x25cf, 0x2118, 0x831f, 0x939c, 0xff00, 0x7838,
+	0x9084, 0x00ff, 0x931d, 0x7c3c, 0x2011, 0x8018, 0x080c, 0x4a38,
+	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, 0xc711,
+	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, 0xbd9e, 0x0005, 0x0036,
+	0x2019, 0x0001, 0x0010, 0x0036, 0x901e, 0x0499, 0x01e0, 0x080c,
+	0xc723, 0x01c8, 0x080c, 0xc90b, 0x6037, 0x4000, 0x6014, 0x6017,
+	0x0000, 0x0096, 0x2048, 0xa87c, 0x080c, 0xc931, 0x1118, 0x080c,
+	0xb4a0, 0x0040, 0xa867, 0x0103, 0xa877, 0x0000, 0x83ff, 0x1129,
+	0x080c, 0x6c7f, 0x009e, 0x003e, 0x0005, 0xa880, 0xd0b4, 0x0128,
+	0xa87b, 0x0006, 0xc0ec, 0xa882, 0x0048, 0xd0bc, 0x0118, 0xa87b,
+	0x0002, 0x0020, 0xa87b, 0x0005, 0x080c, 0xca20, 0xa877, 0x0000,
+	0x0005, 0x2001, 0x1810, 0x2004, 0xd0ec, 0x0005, 0x0006, 0x2001,
+	0x1810, 0x2004, 0xd0f4, 0x000e, 0x0005, 0x0006, 0x2001, 0x1810,
+	0x2004, 0xd0e4, 0x000e, 0x0005, 0x0036, 0x0046, 0x6010, 0x00b6,
+	0x2058, 0xbba0, 0x00be, 0x2021, 0x0007, 0x080c, 0x4bef, 0x004e,
+	0x003e, 0x0005, 0x0c51, 0x1d81, 0x0005, 0x2001, 0x1984, 0x2004,
+	0x601a, 0x0005, 0x2001, 0x1986, 0x2004, 0x604a, 0x0005, 0x080c,
+	0xaad8, 0x0804, 0x956a, 0x611c, 0xd1fc, 0xa97c, 0x1108, 0xd1e4,
+	0x0005, 0x601c, 0xd0fc, 0xa87c, 0x1108, 0xd0e4, 0x0005, 0x601c,
+	0xd0fc, 0xc0fc, 0x601e, 0xa87c, 0x1108, 0xd0e4, 0x0005, 0x6044,
+	0xd0fc, 0x0160, 0xd0dc, 0x1128, 0x908c, 0x000f, 0x9186, 0x0005,
+	0x1118, 0x6003, 0x0003, 0x0010, 0x6003, 0x0001, 0x0005, 0x00b6,
+	0x0066, 0x6000, 0x90b2, 0x0016, 0x1a0c, 0x0d7d, 0x001b, 0x006e,
+	0x00be, 0x0005, 0xce9a, 0xd593, 0xd6e4, 0xce9a, 0xce9a, 0xce9a,
+	0xce9a, 0xce9a, 0xced1, 0xd762, 0xce9a, 0xce9a, 0xce9a, 0xce9a,
+	0xce9a, 0xce9a, 0x080c, 0x0d7d, 0x0066, 0x6000, 0x90b2, 0x0016,
+	0x1a0c, 0x0d7d, 0x0013, 0x006e, 0x0005, 0xceb5, 0xdc74, 0xceb5,
+	0xceb5, 0xceb5, 0xceb5, 0xceb5, 0xceb5, 0xdc23, 0xdcc6, 0xceb5,
+	0xe316, 0xe34a, 0xe316, 0xe34a, 0xceb5, 0x080c, 0x0d7d, 0x6000,
+	0x9082, 0x0016, 0x1a0c, 0x0d7d, 0x6000, 0x000a, 0x0005, 0xcecf,
+	0xd93e, 0xda07, 0xda29, 0xdaa4, 0xcecf, 0xdb9a, 0xdb2c, 0xd76c,
+	0xdbfb, 0xdc10, 0xcecf, 0xcecf, 0xcecf, 0xcecf, 0xcecf, 0x080c,
+	0x0d7d, 0x91b2, 0x0053, 0x1a0c, 0x0d7d, 0x2100, 0x91b2, 0x0040,
+	0x1a04, 0xd30b, 0x0002, 0xcf1b, 0xd0fc, 0xcf1b, 0xcf1b, 0xcf1b,
+	0xd105, 0xcf1b, 0xcf1b, 0xcf1b, 0xcf1b, 0xcf1b, 0xcf1b, 0xcf1b,
+	0xcf1b, 0xcf1b, 0xcf1b, 0xcf1b, 0xcf1b, 0xcf1b, 0xcf1b, 0xcf1b,
+	0xcf1b, 0xcf1b, 0xcf1d, 0xcf77, 0xcf86, 0xcfea, 0xd015, 0xd08e,
+	0xd0e7, 0xcf1b, 0xcf1b, 0xd108, 0xcf1b, 0xcf1b, 0xd11d, 0xd12a,
+	0xcf1b, 0xcf1b, 0xcf1b, 0xcf1b, 0xcf1b, 0xd1ad, 0xcf1b, 0xcf1b,
+	0xd1c1, 0xcf1b, 0xcf1b, 0xd17c, 0xcf1b, 0xcf1b, 0xcf1b, 0xd1d9,
+	0xcf1b, 0xcf1b, 0xcf1b, 0xd256, 0xcf1b, 0xcf1b, 0xcf1b, 0xcf1b,
+	0xcf1b, 0xcf1b, 0xd2d3, 0x080c, 0x0d7d, 0x080c, 0x6928, 0x1150,
+	0x2001, 0x1837, 0x2004, 0xd0cc, 0x1128, 0x9084, 0x0009, 0x9086,
+	0x0008, 0x1140, 0x6007, 0x0009, 0x602f, 0x0009, 0x6017, 0x0000,
+	0x0804, 0xd0f5, 0x080c, 0x68cd, 0x00e6, 0x00c6, 0x0036, 0x0026,
+	0x0016, 0x6210, 0x2258, 0xbaa0, 0x0026, 0x2019, 0x0029, 0x080c,
+	0xa781, 0x080c, 0x926f, 0x0076, 0x903e, 0x080c, 0x9141, 0x2c08,
+	0x080c, 0xdeb3, 0x007e, 0x001e, 0x080c, 0xa79d, 0x001e, 0x002e,
+	0x003e, 0x00ce, 0x00ee, 0x6610, 0x2658, 0x080c, 0x653c, 0xbe04,
+	0x9684, 0x00ff, 0x9082, 0x0006, 0x0278, 0x080c, 0xdde1, 0x1904,
+	0xcfe2, 0x080c, 0xdd7d, 0x1120, 0x6007, 0x0008, 0x0804, 0xd0f5,
+	0x6007, 0x0009, 0x0804, 0xd0f5, 0x080c, 0xe014, 0x0128, 0x080c,
+	0xdde1, 0x0d78, 0x0804, 0xcfe2, 0x6017, 0x1900, 0x0c88, 0x080c,
+	0x32f2, 0x1904, 0xd308, 0x6106, 0x080c, 0xdd30, 0x6007, 0x0006,
+	0x0804, 0xd0f5, 0x6007, 0x0007, 0x0804, 0xd0f5, 0x080c, 0xe386,
+	0x1904, 0xd308, 0x080c, 0x32f2, 0x1904, 0xd308, 0x00d6, 0x6610,
+	0x2658, 0xbe04, 0x9684, 0x00ff, 0x9082, 0x0006, 0x1220, 0x2001,
+	0x0001, 0x080c, 0x6469, 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, 0xde49, 0x1190, 0x9686, 0x0006, 0x1140, 0x0026, 0x6210,
+	0x2258, 0xbaa0, 0x900e, 0x080c, 0x31fc, 0x002e, 0x080c, 0x65c8,
+	0x6007, 0x000a, 0x00de, 0x0804, 0xd0f5, 0x6007, 0x000b, 0x00de,
+	0x0804, 0xd0f5, 0x080c, 0x31ab, 0x080c, 0xce4a, 0x6007, 0x0001,
+	0x0804, 0xd0f5, 0x080c, 0xe386, 0x1904, 0xd308, 0x080c, 0x32f2,
+	0x1904, 0xd308, 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, 0x31fc, 0x002e, 0x6007, 0x000c, 0x2001,
+	0x0001, 0x080c, 0xe553, 0x0804, 0xd0f5, 0x080c, 0x6928, 0x1140,
+	0x2001, 0x1837, 0x2004, 0x9084, 0x0009, 0x9086, 0x0008, 0x1110,
+	0x0804, 0xcf2a, 0x080c, 0x68cd, 0x6610, 0x2658, 0xbe04, 0x9684,
+	0x00ff, 0x9082, 0x0006, 0x06c8, 0x1138, 0x0026, 0x2001, 0x0006,
+	0x080c, 0x64a9, 0x002e, 0x0050, 0x96b4, 0xff00, 0x8637, 0x9686,
+	0x0004, 0x0120, 0x9686, 0x0006, 0x1904, 0xcfe2, 0x080c, 0xde56,
+	0x1120, 0x6007, 0x000e, 0x0804, 0xd0f5, 0x0046, 0x6410, 0x2458,
+	0xbca0, 0x0046, 0x080c, 0x31ab, 0x080c, 0xce4a, 0x004e, 0x0016,
+	0x9006, 0x2009, 0x1848, 0x210c, 0xd1a4, 0x0148, 0x2009, 0x0029,
+	0x080c, 0xe191, 0x6010, 0x2058, 0xb800, 0xc0e5, 0xb802, 0x001e,
+	0x004e, 0x6007, 0x0001, 0x0804, 0xd0f5, 0x2001, 0x0001, 0x080c,
+	0x6469, 0x0156, 0x0016, 0x0026, 0x0036, 0x20a9, 0x0004, 0x2019,
+	0x1805, 0x2011, 0x0270, 0x080c, 0xba99, 0x003e, 0x002e, 0x001e,
+	0x015e, 0x9005, 0x0168, 0x96b4, 0xff00, 0x8637, 0x9682, 0x0004,
+	0x0a04, 0xcfe2, 0x9682, 0x0007, 0x0a04, 0xd03e, 0x0804, 0xcfe2,
+	0x6017, 0x1900, 0x6007, 0x0009, 0x0804, 0xd0f5, 0x080c, 0x6928,
+	0x1140, 0x2001, 0x1837, 0x2004, 0x9084, 0x0009, 0x9086, 0x0008,
+	0x1110, 0x0804, 0xcf2a, 0x080c, 0x68cd, 0x6610, 0x2658, 0xbe04,
+	0x9684, 0x00ff, 0x9082, 0x0006, 0x0690, 0x96b4, 0xff00, 0x8637,
+	0x9686, 0x0004, 0x0120, 0x9686, 0x0006, 0x1904, 0xcfe2, 0x080c,
+	0xde84, 0x1130, 0x080c, 0xdd7d, 0x1118, 0x6007, 0x0010, 0x04e8,
+	0x0046, 0x6410, 0x2458, 0xbca0, 0x0046, 0x080c, 0x31ab, 0x080c,
+	0xce4a, 0x004e, 0x0016, 0x9006, 0x2009, 0x1848, 0x210c, 0xd1a4,
+	0x0148, 0x2009, 0x0029, 0x080c, 0xe191, 0x6010, 0x2058, 0xb800,
+	0xc0e5, 0xb802, 0x001e, 0x004e, 0x6007, 0x0001, 0x00f0, 0x080c,
+	0xe014, 0x0140, 0x96b4, 0xff00, 0x8637, 0x9686, 0x0006, 0x0978,
+	0x0804, 0xcfe2, 0x6017, 0x1900, 0x6007, 0x0009, 0x0070, 0x080c,
+	0x32f2, 0x1904, 0xd308, 0x080c, 0xe386, 0x1904, 0xd308, 0x080c,
+	0xd4d3, 0x1904, 0xcfe2, 0x6007, 0x0012, 0x6003, 0x0001, 0x080c,
+	0x90ef, 0x080c, 0x956a, 0x0005, 0x6007, 0x0001, 0x6003, 0x0001,
+	0x080c, 0x90ef, 0x080c, 0x956a, 0x0cb0, 0x6007, 0x0005, 0x0c68,
+	0x080c, 0xe386, 0x1904, 0xd308, 0x080c, 0x32f2, 0x1904, 0xd308,
+	0x080c, 0xd4d3, 0x1904, 0xcfe2, 0x6007, 0x0020, 0x6003, 0x0001,
+	0x080c, 0x90ef, 0x080c, 0x956a, 0x0005, 0x080c, 0x32f2, 0x1904,
+	0xd308, 0x6007, 0x0023, 0x6003, 0x0001, 0x080c, 0x90ef, 0x080c,
+	0x956a, 0x0005, 0x080c, 0xe386, 0x1904, 0xd308, 0x080c, 0x32f2,
+	0x1904, 0xd308, 0x080c, 0xd4d3, 0x1904, 0xcfe2, 0x0016, 0x0026,
+	0x00e6, 0x2071, 0x0260, 0x7244, 0x9286, 0xffff, 0x0180, 0x2c08,
+	0x080c, 0xc711, 0x01b0, 0x2260, 0x7240, 0x6008, 0x9206, 0x1188,
+	0x6010, 0x9190, 0x0004, 0x2214, 0x9206, 0x01b8, 0x0050, 0x7240,
+	0x2c08, 0x9006, 0x080c, 0xe15b, 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, 0xaad8, 0x2160,
+	0x6007, 0x0025, 0x6003, 0x0001, 0x080c, 0x90ef, 0x080c, 0x956a,
+	0x00ee, 0x002e, 0x001e, 0x0005, 0x2001, 0x0001, 0x080c, 0x6469,
+	0x0156, 0x0016, 0x0026, 0x0036, 0x20a9, 0x0004, 0x2019, 0x1805,
+	0x2011, 0x0276, 0x080c, 0xba99, 0x003e, 0x002e, 0x001e, 0x015e,
+	0x0120, 0x6007, 0x0031, 0x0804, 0xd0f5, 0x080c, 0xb70a, 0x080c,
+	0x73e4, 0x1190, 0x0006, 0x0026, 0x0036, 0x080c, 0x73fe, 0x1138,
+	0x080c, 0x76e8, 0x080c, 0x5f41, 0x080c, 0x7315, 0x0010, 0x080c,
+	0x73b8, 0x003e, 0x002e, 0x000e, 0x0005, 0x080c, 0x32f2, 0x1904,
+	0xd308, 0x080c, 0xd4d3, 0x1904, 0xcfe2, 0x6106, 0x080c, 0xd4ef,
+	0x1120, 0x6007, 0x002b, 0x0804, 0xd0f5, 0x6007, 0x002c, 0x0804,
+	0xd0f5, 0x080c, 0xe386, 0x1904, 0xd308, 0x080c, 0x32f2, 0x1904,
+	0xd308, 0x080c, 0xd4d3, 0x1904, 0xcfe2, 0x6106, 0x080c, 0xd4f4,
+	0x1120, 0x6007, 0x002e, 0x0804, 0xd0f5, 0x6007, 0x002f, 0x0804,
+	0xd0f5, 0x080c, 0x32f2, 0x1904, 0xd308, 0x00e6, 0x00d6, 0x00c6,
+	0x6010, 0x2058, 0xb904, 0x9184, 0x00ff, 0x9086, 0x0006, 0x0158,
+	0x9184, 0xff00, 0x8007, 0x9086, 0x0006, 0x0128, 0x00ce, 0x00de,
+	0x00ee, 0x0804, 0xd0fc, 0x080c, 0x5600, 0xd0e4, 0x0904, 0xd253,
+	0x2071, 0x026c, 0x7010, 0x603a, 0x7014, 0x603e, 0x7108, 0x720c,
+	0x080c, 0x6966, 0x0140, 0x6010, 0x2058, 0xb810, 0x9106, 0x1118,
+	0xb814, 0x9206, 0x0510, 0x080c, 0x6962, 0x15b8, 0x2069, 0x1800,
+	0x6880, 0x9206, 0x1590, 0x687c, 0x9106, 0x1578, 0x7210, 0x080c,
+	0xc711, 0x0590, 0x080c, 0xd3c0, 0x0578, 0x080c, 0xe208, 0x0560,
+	0x622e, 0x6007, 0x0036, 0x6003, 0x0001, 0x2009, 0x8020, 0x080c,
+	0x90e8, 0x00ce, 0x00de, 0x00ee, 0x0005, 0x7214, 0x9286, 0xffff,
+	0x0150, 0x080c, 0xc711, 0x01c0, 0x9280, 0x0002, 0x2004, 0x7110,
+	0x9106, 0x1190, 0x08e0, 0x7210, 0x2c08, 0x9085, 0x0001, 0x080c,
+	0xe15b, 0x2c10, 0x2160, 0x0140, 0x0890, 0x6007, 0x0037, 0x602f,
+	0x0009, 0x6017, 0x1500, 0x08b8, 0x6007, 0x0037, 0x602f, 0x0003,
+	0x6017, 0x1700, 0x0880, 0x6007, 0x0012, 0x0868, 0x080c, 0x32f2,
+	0x1904, 0xd308, 0x6010, 0x2058, 0xb804, 0x9084, 0xff00, 0x8007,
+	0x9086, 0x0006, 0x1904, 0xd0fc, 0x00e6, 0x00d6, 0x00c6, 0x080c,
+	0x5600, 0xd0e4, 0x0904, 0xd2cb, 0x2069, 0x1800, 0x2071, 0x026c,
+	0x7008, 0x603a, 0x720c, 0x623e, 0x9286, 0xffff, 0x1150, 0x7208,
+	0x00c6, 0x2c08, 0x9085, 0x0001, 0x080c, 0xe15b, 0x2c10, 0x00ce,
+	0x05e8, 0x080c, 0xc711, 0x05d0, 0x7108, 0x9280, 0x0002, 0x2004,
+	0x9106, 0x15a0, 0x00c6, 0x0026, 0x2260, 0x080c, 0xc321, 0x002e,
+	0x00ce, 0x7118, 0x918c, 0xff00, 0x810f, 0x9186, 0x0001, 0x0178,
+	0x9186, 0x0005, 0x0118, 0x9186, 0x0007, 0x1198, 0x9280, 0x0005,
+	0x2004, 0x9005, 0x0170, 0x080c, 0xd3c0, 0x0904, 0xd24c, 0x0056,
+	0x7510, 0x7614, 0x080c, 0xe221, 0x005e, 0x00ce, 0x00de, 0x00ee,
+	0x0005, 0x6007, 0x003b, 0x602f, 0x0009, 0x6017, 0x2a00, 0x6003,
+	0x0001, 0x2009, 0x8020, 0x080c, 0x90e8, 0x0c78, 0x6007, 0x003b,
+	0x602f, 0x0003, 0x6017, 0x0300, 0x6003, 0x0001, 0x2009, 0x8020,
+	0x080c, 0x90e8, 0x0c10, 0x6007, 0x003b, 0x602f, 0x000b, 0x6017,
+	0x0000, 0x0804, 0xd223, 0x00e6, 0x0026, 0x080c, 0x6928, 0x0550,
+	0x080c, 0x68cd, 0x080c, 0xe3f8, 0x1518, 0x2071, 0x1800, 0x70dc,
+	0x9085, 0x0003, 0x70de, 0x00f6, 0x2079, 0x0100, 0x72b0, 0x9284,
+	0x00ff, 0x707e, 0x78e6, 0x9284, 0xff00, 0x7280, 0x9205, 0x7082,
+	0x78ea, 0x00fe, 0x70e7, 0x0000, 0x080c, 0x6966, 0x0120, 0x2011,
+	0x1a07, 0x2013, 0x07d0, 0xd0ac, 0x1128, 0x080c, 0x2f79, 0x0010,
+	0x080c, 0xe42a, 0x002e, 0x00ee, 0x080c, 0xaad8, 0x0804, 0xd0fb,
+	0x080c, 0xaad8, 0x0005, 0x2600, 0x0002, 0xd31f, 0xd350, 0xd361,
+	0xd31f, 0xd31f, 0xd321, 0xd372, 0xd31f, 0xd31f, 0xd31f, 0xd33e,
+	0xd31f, 0xd31f, 0xd31f, 0xd37d, 0xd38a, 0xd3bb, 0xd31f, 0x080c,
+	0x0d7d, 0x080c, 0xe386, 0x1d20, 0x080c, 0x32f2, 0x1d08, 0x080c,
+	0xd4d3, 0x1148, 0x7038, 0x6016, 0x6007, 0x0045, 0x6003, 0x0001,
+	0x080c, 0x90ef, 0x0005, 0x080c, 0x31ab, 0x080c, 0xce4a, 0x6007,
+	0x0001, 0x6003, 0x0001, 0x080c, 0x90ef, 0x0005, 0x080c, 0xe386,
+	0x1938, 0x080c, 0x32f2, 0x1920, 0x080c, 0xd4d3, 0x1d60, 0x703c,
+	0x6016, 0x6007, 0x004a, 0x6003, 0x0001, 0x080c, 0x90ef, 0x0005,
+	0x080c, 0x32f2, 0x1904, 0xd308, 0x2009, 0x0041, 0x080c, 0xe433,
+	0x6007, 0x0047, 0x6003, 0x0001, 0x080c, 0x90ef, 0x080c, 0x956a,
+	0x0005, 0x080c, 0x32f2, 0x1904, 0xd308, 0x2009, 0x0042, 0x080c,
+	0xe433, 0x6007, 0x0047, 0x6003, 0x0001, 0x080c, 0x90ef, 0x080c,
+	0x956a, 0x0005, 0x080c, 0x32f2, 0x1904, 0xd308, 0x2009, 0x0046,
+	0x080c, 0xe433, 0x080c, 0xaad8, 0x0005, 0x080c, 0xd3db, 0x0904,
+	0xd308, 0x6007, 0x004e, 0x6003, 0x0001, 0x080c, 0x90ef, 0x080c,
+	0x956a, 0x0005, 0x6007, 0x004f, 0x6017, 0x0000, 0x7134, 0x918c,
+	0x00ff, 0x81ff, 0x0508, 0x9186, 0x0001, 0x1160, 0x7140, 0x2001,
+	0x19bb, 0x2004, 0x9106, 0x11b0, 0x7144, 0x2001, 0x19bc, 0x2004,
+	0x9106, 0x0190, 0x9186, 0x0002, 0x1168, 0x2011, 0x0276, 0x20a9,
+	0x0004, 0x6010, 0x0096, 0x2048, 0x2019, 0x000a, 0x080c, 0xbaad,
+	0x009e, 0x0110, 0x6017, 0x0001, 0x6003, 0x0001, 0x080c, 0x90ef,
+	0x080c, 0x956a, 0x0005, 0x6007, 0x0050, 0x703c, 0x6016, 0x0ca0,
+	0x00e6, 0x2071, 0x0260, 0x00b6, 0x00c6, 0x2260, 0x6010, 0x2058,
+	0xb8d4, 0xd084, 0x0150, 0x7128, 0x6050, 0x9106, 0x1120, 0x712c,
+	0x604c, 0x9106, 0x0110, 0x9006, 0x0010, 0x9085, 0x0001, 0x00ce,
+	0x00be, 0x00ee, 0x0005, 0x0016, 0x0096, 0x0086, 0x00e6, 0x01c6,
+	0x01d6, 0x0126, 0x2091, 0x8000, 0x2071, 0x1800, 0x7090, 0x908a,
+	0x00f9, 0x16e8, 0x20e1, 0x0000, 0x2001, 0x199e, 0x2003, 0x0000,
+	0x080c, 0x1054, 0x05a0, 0x2900, 0x6016, 0x7090, 0x8004, 0xa816,
+	0x908a, 0x001e, 0x02d0, 0xa833, 0x001e, 0x20a9, 0x001e, 0xa860,
+	0x20e8, 0xa85c, 0x9080, 0x001b, 0x20a0, 0x2001, 0x199e, 0x0016,
+	0x200c, 0x0471, 0x001e, 0x2940, 0x080c, 0x1054, 0x01c0, 0x2900,
+	0xa006, 0x2100, 0x81ff, 0x0180, 0x0c18, 0xa832, 0x20a8, 0xa860,
+	0x20e8, 0xa85c, 0x9080, 0x001b, 0x20a0, 0x2001, 0x199e, 0x0016,
+	0x200c, 0x00b1, 0x001e, 0x0000, 0x9085, 0x0001, 0x0048, 0x2071,
+	0x1800, 0x7093, 0x0000, 0x6014, 0x2048, 0x080c, 0x0fed, 0x9006,
+	0x012e, 0x01de, 0x01ce, 0x00ee, 0x008e, 0x009e, 0x001e, 0x0005,
+	0x0006, 0x0016, 0x0026, 0x0036, 0x00c6, 0x918c, 0xffff, 0x11a8,
+	0x080c, 0x215d, 0x2099, 0x026c, 0x2001, 0x0014, 0x3518, 0x9312,
+	0x1218, 0x23a8, 0x4003, 0x00f8, 0x20a8, 0x4003, 0x22a8, 0x8108,
+	0x080c, 0x215d, 0x2099, 0x0260, 0x0ca8, 0x080c, 0x215d, 0x2061,
+	0x199e, 0x6004, 0x2098, 0x6008, 0x3518, 0x9312, 0x1218, 0x23a8,
+	0x4003, 0x0048, 0x20a8, 0x4003, 0x22a8, 0x8108, 0x080c, 0x215d,
+	0x2099, 0x0260, 0x0ca8, 0x2061, 0x199e, 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, 0x2175, 0x20a1, 0x024c, 0x2001,
+	0x0014, 0x3518, 0x9312, 0x1218, 0x23a8, 0x4003, 0x0418, 0x20a8,
+	0x4003, 0x82ff, 0x01f8, 0x22a8, 0x8108, 0x080c, 0x2175, 0x20a1,
+	0x0240, 0x0c98, 0x080c, 0x2175, 0x2061, 0x19a1, 0x6004, 0x20a0,
+	0x6008, 0x3518, 0x9312, 0x1218, 0x23a8, 0x4003, 0x0058, 0x20a8,
+	0x4003, 0x82ff, 0x0138, 0x22a8, 0x8108, 0x080c, 0x2175, 0x20a1,
+	0x0240, 0x0c98, 0x2061, 0x19a1, 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, 0xd569, 0x00de, 0x0005, 0x00d6, 0x080c, 0xd576, 0x1520,
+	0x680c, 0x908c, 0xff00, 0x6820, 0x9084, 0x00ff, 0x9115, 0x6216,
+	0x6824, 0x602e, 0xd1e4, 0x0130, 0x9006, 0x080c, 0xe553, 0x2009,
+	0x0001, 0x0078, 0xd1ec, 0x0180, 0x6920, 0x918c, 0x00ff, 0x6824,
+	0x080c, 0x25cf, 0x1148, 0x2001, 0x0001, 0x080c, 0xe553, 0x2110,
+	0x900e, 0x080c, 0x31fc, 0x0018, 0x9085, 0x0001, 0x0008, 0x9006,
+	0x00de, 0x0005, 0x00b6, 0x00c6, 0x080c, 0xab4a, 0x0598, 0x0016,
+	0x0026, 0x00c6, 0x2011, 0x0263, 0x2204, 0x8211, 0x220c, 0x080c,
+	0x25cf, 0x1568, 0x080c, 0x64cc, 0x1550, 0xbe12, 0xbd16, 0x00ce,
+	0x002e, 0x001e, 0x2b00, 0x6012, 0x080c, 0xe386, 0x11c8, 0x080c,
+	0x32f2, 0x11b0, 0x080c, 0xd4d3, 0x0500, 0x2001, 0x0007, 0x080c,
+	0x647d, 0x2001, 0x0007, 0x080c, 0x64a9, 0x6017, 0x0000, 0x6023,
+	0x0001, 0x6007, 0x0001, 0x6003, 0x0001, 0x080c, 0x90ef, 0x0010,
+	0x080c, 0xaad8, 0x9085, 0x0001, 0x00ce, 0x00be, 0x0005, 0x080c,
+	0xaad8, 0x00ce, 0x002e, 0x001e, 0x0ca8, 0x080c, 0xaad8, 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, 0x6162, 0x908e, 0x0014, 0x0110,
+	0x908e, 0x0010, 0x0005, 0x6004, 0x90b2, 0x0053, 0x1a0c, 0x0d7d,
+	0x91b6, 0x0013, 0x1130, 0x2008, 0x91b2, 0x0040, 0x1a04, 0xd6b8,
+	0x0092, 0x91b6, 0x0027, 0x0120, 0x91b6, 0x0014, 0x190c, 0x0d7d,
+	0x2001, 0x0007, 0x080c, 0x64a9, 0x080c, 0x94a8, 0x080c, 0xab13,
+	0x080c, 0x956a, 0x0005, 0xd5f3, 0xd5f5, 0xd5f3, 0xd5f3, 0xd5f3,
+	0xd5f5, 0xd602, 0xd6b5, 0xd652, 0xd6b5, 0xd666, 0xd6b5, 0xd602,
+	0xd6b5, 0xd6ad, 0xd6b5, 0xd6ad, 0xd6b5, 0xd6b5, 0xd5f3, 0xd5f3,
+	0xd5f3, 0xd5f3, 0xd5f3, 0xd5f3, 0xd5f3, 0xd5f3, 0xd5f3, 0xd5f3,
+	0xd5f3, 0xd5f5, 0xd5f3, 0xd6b5, 0xd5f3, 0xd5f3, 0xd6b5, 0xd5f3,
+	0xd6b2, 0xd6b5, 0xd5f3, 0xd5f3, 0xd5f3, 0xd5f3, 0xd6b5, 0xd6b5,
+	0xd5f3, 0xd6b5, 0xd6b5, 0xd5f3, 0xd5fd, 0xd5f3, 0xd5f3, 0xd5f3,
+	0xd5f3, 0xd6b1, 0xd6b5, 0xd5f3, 0xd5f3, 0xd6b5, 0xd6b5, 0xd5f3,
+	0xd5f3, 0xd5f3, 0xd5f3, 0x080c, 0x0d7d, 0x080c, 0xce4d, 0x6003,
+	0x0002, 0x080c, 0x956a, 0x0804, 0xd6b7, 0x9006, 0x080c, 0x6469,
+	0x0804, 0xd6b5, 0x080c, 0x6962, 0x1904, 0xd6b5, 0x9006, 0x080c,
+	0x6469, 0x6010, 0x2058, 0xb810, 0x9086, 0x00ff, 0x1140, 0x00f6,
+	0x2079, 0x1800, 0x78a8, 0x8000, 0x78aa, 0x00fe, 0x0428, 0x6010,
+	0x2058, 0xb884, 0x9005, 0x1178, 0x080c, 0xce35, 0x1904, 0xd6b5,
+	0x0036, 0x0046, 0xbba0, 0x2021, 0x0007, 0x080c, 0x4bef, 0x004e,
+	0x003e, 0x0804, 0xd6b5, 0x080c, 0x3323, 0x1904, 0xd6b5, 0x2001,
+	0x1800, 0x2004, 0x9086, 0x0002, 0x1138, 0x00f6, 0x2079, 0x1800,
+	0x78a8, 0x8000, 0x78aa, 0x00fe, 0x2001, 0x0002, 0x080c, 0x647d,
+	0x6023, 0x0001, 0x6003, 0x0001, 0x6007, 0x0002, 0x080c, 0x90ef,
+	0x080c, 0x956a, 0x6110, 0x2158, 0x2009, 0x0001, 0x080c, 0x8519,
+	0x0804, 0xd6b7, 0x6610, 0x2658, 0xbe04, 0x96b4, 0xff00, 0x8637,
+	0x9686, 0x0006, 0x0904, 0xd6b5, 0x9686, 0x0004, 0x0904, 0xd6b5,
+	0x080c, 0x8d94, 0x2001, 0x0004, 0x0804, 0xd6b3, 0x2001, 0x1800,
+	0x2004, 0x9086, 0x0003, 0x1158, 0x0036, 0x0046, 0x6010, 0x2058,
+	0xbba0, 0x2021, 0x0006, 0x080c, 0x4bef, 0x004e, 0x003e, 0x2001,
+	0x0006, 0x080c, 0xd6d1, 0x6610, 0x2658, 0xbe04, 0x0066, 0x96b4,
+	0xff00, 0x8637, 0x9686, 0x0006, 0x006e, 0x0168, 0x2001, 0x0006,
+	0x080c, 0x64a9, 0x9284, 0x00ff, 0x908e, 0x0007, 0x1120, 0x2001,
+	0x0006, 0x080c, 0x647d, 0x080c, 0x6962, 0x11f8, 0x2001, 0x1837,
+	0x2004, 0xd0a4, 0x01d0, 0xbe04, 0x96b4, 0x00ff, 0x9686, 0x0006,
+	0x01a0, 0x00f6, 0x2079, 0x1800, 0x78a8, 0x8000, 0x78aa, 0x00fe,
+	0x0804, 0xd63c, 0x2001, 0x0004, 0x0030, 0x2001, 0x0006, 0x0409,
+	0x0020, 0x0018, 0x0010, 0x080c, 0x64a9, 0x080c, 0xaad8, 0x0005,
+	0x2600, 0x0002, 0xd6cc, 0xd6cc, 0xd6cc, 0xd6cc, 0xd6cc, 0xd6ce,
+	0xd6cc, 0xd6ce, 0xd6cc, 0xd6cc, 0xd6ce, 0xd6cc, 0xd6cc, 0xd6cc,
+	0xd6ce, 0xd6ce, 0xd6ce, 0xd6ce, 0x080c, 0x0d7d, 0x080c, 0xaad8,
+	0x0005, 0x0016, 0x00b6, 0x00d6, 0x6110, 0x2158, 0xb900, 0xd184,
+	0x0138, 0x080c, 0x647d, 0x9006, 0x080c, 0x6469, 0x080c, 0x31dc,
+	0x00de, 0x00be, 0x001e, 0x0005, 0x6610, 0x2658, 0xb804, 0x9084,
+	0xff00, 0x8007, 0x90b2, 0x000c, 0x1a0c, 0x0d7d, 0x91b6, 0x0015,
+	0x1110, 0x003b, 0x0028, 0x91b6, 0x0016, 0x190c, 0x0d7d, 0x006b,
+	0x0005, 0xb589, 0xb589, 0xb589, 0xb589, 0xb589, 0xb589, 0xd74c,
+	0xd711, 0xb589, 0xb589, 0xb589, 0xb589, 0xb589, 0xb589, 0xb589,
+	0xb589, 0xb589, 0xb589, 0xd74c, 0xd753, 0xb589, 0xb589, 0xb589,
+	0xb589, 0x00f6, 0x080c, 0x6962, 0x11d8, 0x080c, 0xce35, 0x11c0,
+	0x6010, 0x905d, 0x01a8, 0xb884, 0x9005, 0x0190, 0x9006, 0x080c,
+	0x6469, 0x2001, 0x0002, 0x080c, 0x647d, 0x6023, 0x0001, 0x6003,
+	0x0001, 0x6007, 0x0002, 0x080c, 0x90ef, 0x080c, 0x956a, 0x00d0,
+	0x2011, 0x0263, 0x2204, 0x8211, 0x220c, 0x080c, 0x25cf, 0x1190,
+	0x080c, 0x652d, 0x0118, 0x080c, 0xaad8, 0x0060, 0xb810, 0x0006,
+	0xb814, 0x0006, 0x080c, 0x5f5b, 0x000e, 0xb816, 0x000e, 0xb812,
+	0x080c, 0xaad8, 0x00fe, 0x0005, 0x6604, 0x96b6, 0x001e, 0x1110,
+	0x080c, 0xaad8, 0x0005, 0x080c, 0xb912, 0x1148, 0x6003, 0x0001,
+	0x6007, 0x0001, 0x080c, 0x90ef, 0x080c, 0x956a, 0x0010, 0x080c,
+	0xaad8, 0x0005, 0x6004, 0x908a, 0x0053, 0x1a0c, 0x0d7d, 0x080c,
+	0x94a8, 0x080c, 0xab13, 0x0005, 0x9182, 0x0040, 0x0002, 0xd782,
+	0xd782, 0xd782, 0xd782, 0xd784, 0xd782, 0xd782, 0xd782, 0xd782,
+	0xd782, 0xd782, 0xd782, 0xd782, 0xd782, 0xd782, 0xd782, 0xd782,
+	0xd782, 0xd782, 0x080c, 0x0d7d, 0x0096, 0x00b6, 0x00d6, 0x00e6,
+	0x00f6, 0x0046, 0x0026, 0x6210, 0x2258, 0xb8bc, 0x9005, 0x11b0,
+	0x6007, 0x0044, 0x2071, 0x0260, 0x7444, 0x94a4, 0xff00, 0x0904,
+	0xd7eb, 0x080c, 0xe547, 0x1170, 0x9486, 0x2000, 0x1158, 0x2009,
+	0x0001, 0x2011, 0x0200, 0x080c, 0x87b6, 0x0020, 0x9026, 0x080c,
+	0xe3cb, 0x0c30, 0x080c, 0x103b, 0x090c, 0x0d7d, 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,
+	0x6c7f, 0x001e, 0x080c, 0xe547, 0x1904, 0xd84b, 0x9486, 0x2000,
+	0x1130, 0x2019, 0x0017, 0x080c, 0xe101, 0x0804, 0xd84b, 0x9486,
+	0x0200, 0x1120, 0x080c, 0xe091, 0x0804, 0xd84b, 0x9486, 0x0400,
+	0x0120, 0x9486, 0x1000, 0x1904, 0xd84b, 0x2019, 0x0002, 0x080c,
+	0xe0b0, 0x0804, 0xd84b, 0x2069, 0x1a6d, 0x6a00, 0xd284, 0x0904,
+	0xd8b5, 0x9284, 0x0300, 0x1904, 0xd8ae, 0x6804, 0x9005, 0x0904,
+	0xd896, 0x2d78, 0x6003, 0x0007, 0x080c, 0x1054, 0x0904, 0xd857,
+	0x7800, 0xd08c, 0x1118, 0x7804, 0x8001, 0x7806, 0x6017, 0x0000,
+	0x2001, 0x180f, 0x2004, 0xd084, 0x1904, 0xd8b9, 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, 0xd853, 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, 0x6c82, 0x002e, 0x004e, 0x00fe, 0x00ee, 0x00de,
+	0x00be, 0x009e, 0x0005, 0x0000, 0x0080, 0x0040, 0x0000, 0x2001,
+	0x1810, 0x2004, 0xd084, 0x0120, 0x080c, 0x103b, 0x1904, 0xd800,
+	0x6017, 0xf100, 0x6003, 0x0001, 0x6007, 0x0041, 0x2009, 0xa022,
+	0x080c, 0x90e8, 0x0c00, 0x2069, 0x0260, 0x6848, 0x9084, 0xff00,
+	0x9086, 0x1200, 0x1198, 0x686c, 0x9084, 0x00ff, 0x0016, 0x6114,
+	0x918c, 0xf700, 0x910d, 0x6116, 0x001e, 0x6003, 0x0001, 0x6007,
+	0x0043, 0x2009, 0xa025, 0x080c, 0x90e8, 0x0828, 0x6868, 0x602e,
+	0x686c, 0x6032, 0x6017, 0xf200, 0x6003, 0x0001, 0x6007, 0x0041,
+	0x2009, 0xa022, 0x080c, 0x90e8, 0x0804, 0xd84b, 0x2001, 0x180e,
+	0x2004, 0xd0ec, 0x0120, 0x2011, 0x8049, 0x080c, 0x4a38, 0x6017,
+	0xf300, 0x0010, 0x6017, 0xf100, 0x6003, 0x0001, 0x6007, 0x0041,
+	0x2009, 0xa022, 0x080c, 0x90e8, 0x0804, 0xd84b, 0x6017, 0xf500,
+	0x0c98, 0x6017, 0xf600, 0x0804, 0xd86b, 0x6017, 0xf200, 0x0804,
+	0xd86b, 0xa867, 0x0146, 0xa86b, 0x0000, 0x6008, 0xa886, 0x2c00,
+	0xa87a, 0x7044, 0x9084, 0x0003, 0x9080, 0xd853, 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,
+	0x0d7d, 0x8210, 0x821c, 0x2001, 0x026c, 0x2098, 0xa860, 0x20e8,
+	0xa85c, 0x9080, 0x0029, 0x20a0, 0x2011, 0xd935, 0x2041, 0x0001,
+	0x223d, 0x9784, 0x00ff, 0x9322, 0x1208, 0x2300, 0x20a8, 0x4003,
+	0x931a, 0x0530, 0x8210, 0xd7fc, 0x1130, 0x8d68, 0x2d0a, 0x2001,
+	0x0260, 0x2098, 0x0c68, 0x2950, 0x080c, 0x1054, 0x0170, 0x2900,
+	0xb002, 0xa867, 0x0147, 0xa86b, 0x0000, 0xa860, 0x20e8, 0xa85c,
+	0x9080, 0x001b, 0x20a0, 0x8840, 0x08d8, 0x2548, 0xa800, 0x902d,
+	0x0118, 0x080c, 0x106d, 0x0cc8, 0x080c, 0x106d, 0x0804, 0xd857,
+	0x2548, 0x8847, 0x9885, 0x0046, 0xa866, 0x2009, 0x0205, 0x200b,
+	0x0000, 0x080c, 0xe134, 0x0804, 0xd84b, 0x8010, 0x0004, 0x801a,
+	0x0006, 0x8018, 0x0008, 0x8016, 0x000a, 0x8014, 0x9186, 0x0013,
+	0x1160, 0x6004, 0x908a, 0x0057, 0x1a0c, 0x0d7d, 0x9082, 0x0040,
+	0x0a0c, 0x0d7d, 0x2008, 0x0804, 0xd9c0, 0x9186, 0x0051, 0x0108,
+	0x0040, 0x080c, 0xa993, 0x01e8, 0x9086, 0x0002, 0x0904, 0xda07,
+	0x00c0, 0x9186, 0x0027, 0x0180, 0x9186, 0x0048, 0x0128, 0x9186,
+	0x0014, 0x0150, 0x190c, 0x0d7d, 0x080c, 0xa993, 0x0150, 0x9086,
+	0x0004, 0x0904, 0xdaa4, 0x0028, 0x6004, 0x9082, 0x0040, 0x2008,
+	0x001a, 0x080c, 0xab94, 0x0005, 0xd987, 0xd989, 0xd989, 0xd9b0,
+	0xd987, 0xd987, 0xd987, 0xd987, 0xd987, 0xd987, 0xd987, 0xd987,
+	0xd987, 0xd987, 0xd987, 0xd987, 0xd987, 0xd987, 0xd987, 0x080c,
+	0x0d7d, 0x080c, 0x94a8, 0x080c, 0x956a, 0x0036, 0x0096, 0x6014,
+	0x904d, 0x01d8, 0x080c, 0xc723, 0x01c0, 0x6003, 0x0002, 0x6010,
+	0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x1178, 0x2019, 0x0004,
+	0x080c, 0xe134, 0x6017, 0x0000, 0x6018, 0x9005, 0x1120, 0x2001,
+	0x1985, 0x2004, 0x601a, 0x6003, 0x0007, 0x009e, 0x003e, 0x0005,
+	0x0096, 0x080c, 0x94a8, 0x080c, 0x956a, 0x080c, 0xc723, 0x0120,
+	0x6014, 0x2048, 0x080c, 0x106d, 0x080c, 0xab13, 0x009e, 0x0005,
+	0x0002, 0xd9d4, 0xd9e9, 0xd9d6, 0xd9fe, 0xd9d4, 0xd9d4, 0xd9d4,
+	0xd9d4, 0xd9d4, 0xd9d4, 0xd9d4, 0xd9d4, 0xd9d4, 0xd9d4, 0xd9d4,
+	0xd9d4, 0xd9d4, 0xd9d4, 0xd9d4, 0x080c, 0x0d7d, 0x0096, 0x6014,
+	0x2048, 0xa87c, 0xd0b4, 0x0138, 0x6003, 0x0007, 0x2009, 0x0043,
+	0x080c, 0xab77, 0x0010, 0x6003, 0x0004, 0x080c, 0x956a, 0x009e,
+	0x0005, 0x080c, 0xc723, 0x0138, 0x6114, 0x0096, 0x2148, 0xa97c,
+	0x009e, 0xd1ec, 0x1138, 0x080c, 0x878b, 0x080c, 0xaad8, 0x080c,
+	0x956a, 0x0005, 0x080c, 0xe38f, 0x0db0, 0x0cc8, 0x6003, 0x0001,
+	0x6007, 0x0041, 0x2009, 0xa022, 0x080c, 0x90e8, 0x0005, 0x9182,
+	0x0040, 0x0002, 0xda1d, 0xda1f, 0xda1d, 0xda1d, 0xda1d, 0xda1d,
+	0xda1d, 0xda1d, 0xda1d, 0xda1d, 0xda1d, 0xda1d, 0xda1d, 0xda1d,
+	0xda1d, 0xda1d, 0xda1d, 0xda20, 0xda1d, 0x080c, 0x0d7d, 0x0005,
+	0x00d6, 0x080c, 0x878b, 0x00de, 0x080c, 0xe3e7, 0x080c, 0xaad8,
+	0x0005, 0x9182, 0x0040, 0x0002, 0xda3f, 0xda3f, 0xda3f, 0xda3f,
+	0xda3f, 0xda3f, 0xda3f, 0xda3f, 0xda3f, 0xda41, 0xda6c, 0xda3f,
+	0xda3f, 0xda3f, 0xda3f, 0xda6c, 0xda3f, 0xda3f, 0xda3f, 0x080c,
+	0x0d7d, 0x6014, 0x0096, 0x2048, 0xa87c, 0xd0fc, 0x0168, 0x908c,
+	0x0003, 0x918e, 0x0002, 0x0180, 0x6144, 0xd1e4, 0x1168, 0x2009,
+	0x0041, 0x009e, 0x0804, 0xdb2c, 0x6003, 0x0007, 0x601b, 0x0000,
+	0x080c, 0x878b, 0x009e, 0x0005, 0x6014, 0x2048, 0xa97c, 0xd1ec,
+	0x1130, 0x080c, 0x878b, 0x080c, 0xaad8, 0x009e, 0x0005, 0x080c,
+	0xe38f, 0x0db8, 0x009e, 0x0005, 0x2001, 0x180c, 0x200c, 0xc1d4,
+	0x2102, 0x0036, 0x080c, 0x9505, 0x080c, 0x956a, 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, 0xe134, 0x6018, 0x9005, 0x1128,
+	0x2001, 0x1985, 0x2004, 0x8003, 0x601a, 0x6017, 0x0000, 0x6003,
+	0x0007, 0x009e, 0x003e, 0x0005, 0x9182, 0x0040, 0x0002, 0xdabb,
+	0xdabb, 0xdabb, 0xdabb, 0xdabb, 0xdabb, 0xdabb, 0xdabb, 0xdabd,
+	0xdabb, 0xdabb, 0xdabb, 0xdabb, 0xdabb, 0xdabb, 0xdabb, 0xdabb,
+	0xdabb, 0xdabb, 0xdb08, 0x080c, 0x0d7d, 0x6014, 0x0096, 0x2048,
+	0xa834, 0xaa38, 0x6110, 0x00b6, 0x2058, 0xb900, 0x00be, 0xd1bc,
+	0x1190, 0x920d, 0x1518, 0xa87c, 0xd0fc, 0x0128, 0x2009, 0x0041,
+	0x009e, 0x0804, 0xdb2c, 0x6003, 0x0007, 0x601b, 0x0000, 0x080c,
+	0x878b, 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, 0x180e, 0x210c,
+	0xd19c, 0x0118, 0x6003, 0x0007, 0x0010, 0x6003, 0x0006, 0x00e9,
+	0x080c, 0x878d, 0x009e, 0x0005, 0x6003, 0x0002, 0x009e, 0x0005,
+	0x6024, 0xd0f4, 0x0128, 0x080c, 0x1667, 0x1904, 0xdabd, 0x0005,
+	0x6014, 0x0096, 0x2048, 0xa834, 0xa938, 0x009e, 0x9105, 0x1120,
+	0x080c, 0x1667, 0x1904, 0xdabd, 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, 0x0d7d, 0x6024,
+	0xd0dc, 0x090c, 0x0d7d, 0x0005, 0xdb4f, 0xdb5b, 0xdb67, 0xdb73,
+	0xdb4f, 0xdb4f, 0xdb4f, 0xdb4f, 0xdb56, 0xdb51, 0xdb51, 0xdb4f,
+	0xdb4f, 0xdb4f, 0xdb4f, 0xdb51, 0xdb4f, 0xdb51, 0xdb4f, 0x080c,
+	0x0d7d, 0x6024, 0xd0dc, 0x090c, 0x0d7d, 0x0005, 0x6014, 0x9005,
+	0x190c, 0x0d7d, 0x0005, 0x6003, 0x0001, 0x6106, 0x0126, 0x2091,
+	0x8000, 0x2009, 0xa022, 0x080c, 0x90ca, 0x012e, 0x0005, 0x6003,
+	0x0004, 0x6106, 0x0126, 0x2091, 0x8000, 0x2009, 0xa001, 0x080c,
+	0x90e8, 0x012e, 0x0005, 0x6003, 0x0003, 0x6106, 0x080c, 0x1be0,
+	0x0126, 0x2091, 0x8000, 0x6014, 0x0096, 0x2048, 0xa87c, 0x9084,
+	0x0003, 0x9086, 0x0002, 0x0198, 0x6024, 0xd0cc, 0x1148, 0xd0c4,
+	0x1138, 0xa8a8, 0x2004, 0x9005, 0x1118, 0x2009, 0xb035, 0x0010,
+	0x2009, 0xa035, 0x009e, 0x080c, 0x912f, 0x012e, 0x0005, 0x2009,
+	0xa032, 0x0cc0, 0x0126, 0x2091, 0x8000, 0x0036, 0x0096, 0x9182,
+	0x0040, 0x0023, 0x009e, 0x003e, 0x012e, 0x0005, 0xdbb6, 0xdbb8,
+	0xdbcd, 0xdbe7, 0xdbb6, 0xdbb6, 0xdbb6, 0xdbb6, 0xdbb6, 0xdbb6,
+	0xdbb6, 0xdbb6, 0xdbb6, 0xdbb6, 0xdbb6, 0xdbb6, 0x080c, 0x0d7d,
+	0x6014, 0x2048, 0xa87c, 0xd0fc, 0x0510, 0x909c, 0x0003, 0x939e,
+	0x0003, 0x01e8, 0x6003, 0x0001, 0x6106, 0x0126, 0x2091, 0x8000,
+	0x2009, 0xa022, 0x080c, 0x90e8, 0x0468, 0x6014, 0x2048, 0xa87c,
+	0xd0fc, 0x0168, 0x909c, 0x0003, 0x939e, 0x0003, 0x0140, 0x6003,
+	0x0001, 0x6106, 0x2009, 0xa001, 0x080c, 0x90e8, 0x00d8, 0x901e,
+	0x6316, 0x631a, 0x2019, 0x0004, 0x080c, 0xe134, 0x0098, 0x6014,
+	0x2048, 0xa87c, 0xd0fc, 0x0d98, 0x909c, 0x0003, 0x939e, 0x0003,
+	0x0d70, 0x6003, 0x0003, 0x6106, 0x080c, 0x1be0, 0x2009, 0xa035,
+	0x080c, 0x912f, 0x0005, 0x080c, 0x94a8, 0x6114, 0x81ff, 0x0158,
+	0x0096, 0x2148, 0x080c, 0xe4e4, 0x0036, 0x2019, 0x0029, 0x080c,
+	0xe134, 0x003e, 0x009e, 0x080c, 0xab13, 0x080c, 0x956a, 0x0005,
+	0x080c, 0x9505, 0x6114, 0x81ff, 0x0158, 0x0096, 0x2148, 0x080c,
+	0xe4e4, 0x0036, 0x2019, 0x0029, 0x080c, 0xe134, 0x003e, 0x009e,
+	0x080c, 0xab13, 0x0005, 0x9182, 0x0085, 0x0002, 0xdc35, 0xdc33,
+	0xdc33, 0xdc41, 0xdc33, 0xdc33, 0xdc33, 0xdc33, 0xdc33, 0xdc33,
+	0xdc33, 0xdc33, 0xdc33, 0x080c, 0x0d7d, 0x6003, 0x000b, 0x6106,
+	0x0126, 0x2091, 0x8000, 0x2009, 0x8020, 0x080c, 0x90e8, 0x012e,
+	0x0005, 0x0026, 0x00e6, 0x080c, 0xe386, 0x0118, 0x080c, 0xaad8,
+	0x0440, 0x2071, 0x0260, 0x7224, 0x6216, 0x2001, 0x180e, 0x2004,
+	0xd0e4, 0x0150, 0x6010, 0x00b6, 0x2058, 0xbca0, 0x00be, 0x2c00,
+	0x2011, 0x014e, 0x080c, 0xae05, 0x7220, 0x080c, 0xdfca, 0x0118,
+	0x6007, 0x0086, 0x0040, 0x6007, 0x0087, 0x7224, 0x9296, 0xffff,
+	0x1110, 0x6007, 0x0086, 0x6003, 0x0001, 0x2009, 0x8020, 0x080c,
+	0x90e8, 0x00ee, 0x002e, 0x0005, 0x9186, 0x0013, 0x1160, 0x6004,
+	0x908a, 0x0085, 0x0a0c, 0x0d7d, 0x908a, 0x0092, 0x1a0c, 0x0d7d,
+	0x9082, 0x0085, 0x00a2, 0x9186, 0x0027, 0x0130, 0x9186, 0x0014,
+	0x0118, 0x080c, 0xab94, 0x0050, 0x2001, 0x0007, 0x080c, 0x64a9,
+	0x080c, 0x94a8, 0x080c, 0xab13, 0x080c, 0x956a, 0x0005, 0xdca4,
+	0xdca6, 0xdca6, 0xdca4, 0xdca4, 0xdca4, 0xdca4, 0xdca4, 0xdca4,
+	0xdca4, 0xdca4, 0xdca4, 0xdca4, 0x080c, 0x0d7d, 0x080c, 0xab13,
+	0x080c, 0x956a, 0x0005, 0x9182, 0x0085, 0x0a0c, 0x0d7d, 0x9182,
+	0x0092, 0x1a0c, 0x0d7d, 0x9182, 0x0085, 0x0002, 0xdcc3, 0xdcc3,
+	0xdcc3, 0xdcc5, 0xdcc3, 0xdcc3, 0xdcc3, 0xdcc3, 0xdcc3, 0xdcc3,
+	0xdcc3, 0xdcc3, 0xdcc3, 0x080c, 0x0d7d, 0x0005, 0x9186, 0x0013,
+	0x0148, 0x9186, 0x0014, 0x0130, 0x9186, 0x0027, 0x0118, 0x080c,
+	0xab94, 0x0020, 0x080c, 0x94a8, 0x080c, 0xab13, 0x0005, 0x0036,
+	0x080c, 0xe3e7, 0x604b, 0x0000, 0x2019, 0x000b, 0x0031, 0x6023,
+	0x0006, 0x6003, 0x0007, 0x003e, 0x0005, 0x0126, 0x0036, 0x2091,
+	0x8000, 0x2001, 0x0382, 0x2004, 0x9084, 0x0007, 0x0006, 0x9086,
+	0x0003, 0x0110, 0x080c, 0xa781, 0x0086, 0x2c40, 0x0096, 0x904e,
+	0x080c, 0xa103, 0x009e, 0x008e, 0x1550, 0x0076, 0x2c38, 0x080c,
+	0xa1ae, 0x007e, 0x1520, 0x6000, 0x9086, 0x0000, 0x0500, 0x6020,
+	0x9086, 0x0007, 0x01e0, 0x0096, 0x601c, 0xd084, 0x0140, 0x080c,
+	0xe3e7, 0x080c, 0xce4d, 0x080c, 0x1a53, 0x6023, 0x0007, 0x6014,
+	0x2048, 0x080c, 0xc723, 0x0110, 0x080c, 0xe134, 0x009e, 0x6017,
+	0x0000, 0x080c, 0xe3e7, 0x6023, 0x0007, 0x080c, 0xce4d, 0x000e,
+	0x9086, 0x0003, 0x0110, 0x080c, 0xa79d, 0x003e, 0x012e, 0x0005,
+	0x00f6, 0x00c6, 0x00b6, 0x0036, 0x0156, 0x2079, 0x0260, 0x7938,
+	0x783c, 0x080c, 0x25cf, 0x15d8, 0x0016, 0x00c6, 0x080c, 0x652d,
+	0x15a0, 0x001e, 0x00c6, 0x2160, 0x080c, 0xce4a, 0x00ce, 0x002e,
+	0x0026, 0x0016, 0x080c, 0xa781, 0x2019, 0x0029, 0x080c, 0xa275,
+	0x080c, 0x926f, 0x0076, 0x903e, 0x080c, 0x9141, 0x007e, 0x001e,
+	0x0076, 0x903e, 0x080c, 0xdeb3, 0x007e, 0x080c, 0xa79d, 0x0026,
+	0xba04, 0x9294, 0xff00, 0x8217, 0x9286, 0x0006, 0x0118, 0x9286,
+	0x0004, 0x1118, 0xbaa0, 0x080c, 0x327e, 0x002e, 0x001e, 0x080c,
+	0x5f5b, 0xbe12, 0xbd16, 0x9006, 0x0010, 0x00ce, 0x001e, 0x015e,
+	0x003e, 0x00be, 0x00ce, 0x00fe, 0x0005, 0x00c6, 0x00d6, 0x00b6,
+	0x0016, 0x2009, 0x1824, 0x2104, 0x9086, 0x0074, 0x1904, 0xddd6,
+	0x2069, 0x0260, 0x6944, 0x9182, 0x0100, 0x06e0, 0x6940, 0x9184,
+	0x8000, 0x0904, 0xddd3, 0x2001, 0x197c, 0x2004, 0x9005, 0x1140,
+	0x6010, 0x2058, 0xb884, 0x9005, 0x0118, 0x9184, 0x0800, 0x0598,
+	0x6948, 0x918a, 0x0001, 0x0648, 0x080c, 0xe54c, 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, 0x653c, 0x0804, 0xde42, 0x2011, 0x0276,
+	0x20a9, 0x0004, 0x0096, 0x2b48, 0x2019, 0x000a, 0x080c, 0xbaad,
+	0x009e, 0x15c8, 0x2011, 0x027a, 0x20a9, 0x0004, 0x0096, 0x2b48,
+	0x2019, 0x0006, 0x080c, 0xbaad, 0x009e, 0x1568, 0x0046, 0x0016,
+	0xbaa0, 0x2220, 0x9006, 0x2009, 0x1848, 0x210c, 0xd1a4, 0x0138,
+	0x2009, 0x0029, 0x080c, 0xe191, 0xb800, 0xc0e5, 0xb802, 0x080c,
+	0xa781, 0x2019, 0x0029, 0x080c, 0x926f, 0x0076, 0x2039, 0x0000,
+	0x080c, 0x9141, 0x2c08, 0x080c, 0xdeb3, 0x007e, 0x080c, 0xa79d,
+	0x2001, 0x0007, 0x080c, 0x64a9, 0x2001, 0x0007, 0x080c, 0x647d,
+	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, 0x25cf, 0x11d0, 0x080c, 0x652d, 0x11b8, 0x2011, 0x0270,
+	0x20a9, 0x0004, 0x0096, 0x2b48, 0x2019, 0x000a, 0x080c, 0xbaad,
+	0x009e, 0x1158, 0x2011, 0x0274, 0x20a9, 0x0004, 0x0096, 0x2b48,
+	0x2019, 0x0006, 0x080c, 0xbaad, 0x009e, 0x015e, 0x003e, 0x002e,
+	0x001e, 0x00fe, 0x00be, 0x0005, 0x00b6, 0x0006, 0x0016, 0x0026,
+	0x0036, 0x0156, 0x2011, 0x0263, 0x2204, 0x8211, 0x220c, 0x080c,
+	0x25cf, 0x11d0, 0x080c, 0x652d, 0x11b8, 0x2011, 0x0276, 0x20a9,
+	0x0004, 0x0096, 0x2b48, 0x2019, 0x000a, 0x080c, 0xbaad, 0x009e,
+	0x1158, 0x2011, 0x027a, 0x20a9, 0x0004, 0x0096, 0x2b48, 0x2019,
+	0x0006, 0x080c, 0xbaad, 0x009e, 0x015e, 0x003e, 0x002e, 0x001e,
+	0x000e, 0x00be, 0x0005, 0x00e6, 0x00c6, 0x0086, 0x0076, 0x0066,
+	0x0056, 0x0046, 0x0026, 0x0126, 0x2091, 0x8000, 0x080c, 0xa7df,
+	0x0106, 0x190c, 0xa781, 0x2740, 0x2029, 0x19f1, 0x252c, 0x2021,
+	0x19f8, 0x2424, 0x2061, 0x1ddc, 0x2071, 0x1800, 0x7654, 0x7074,
+	0x81ff, 0x0150, 0x0006, 0x9186, 0x1b30, 0x000e, 0x0128, 0x8001,
+	0x9602, 0x1a04, 0xdf58, 0x0018, 0x9606, 0x0904, 0xdf58, 0x080c,
+	0x8a5a, 0x0904, 0xdf4f, 0x2100, 0x9c06, 0x0904, 0xdf4f, 0x080c,
+	0xe1cd, 0x1904, 0xdf4f, 0x080c, 0xe569, 0x0904, 0xdf4f, 0x080c,
+	0xe1bd, 0x0904, 0xdf4f, 0x6720, 0x9786, 0x0001, 0x1148, 0x080c,
+	0x3323, 0x0904, 0xdf9a, 0x6004, 0x9086, 0x0000, 0x1904, 0xdf9a,
+	0x9786, 0x0004, 0x0904, 0xdf9a, 0x9786, 0x0007, 0x0904, 0xdf4f,
+	0x2500, 0x9c06, 0x0904, 0xdf4f, 0x2400, 0x9c06, 0x0904, 0xdf4f,
+	0x88ff, 0x0118, 0x605c, 0x9906, 0x15d0, 0x0096, 0x6043, 0xffff,
+	0x6000, 0x9086, 0x0004, 0x1120, 0x0016, 0x080c, 0x1a53, 0x001e,
+	0x9786, 0x000a, 0x0148, 0x080c, 0xc931, 0x1130, 0x080c, 0xb4a0,
+	0x009e, 0x080c, 0xab13, 0x0418, 0x6014, 0x2048, 0x080c, 0xc723,
+	0x01d8, 0x9786, 0x0003, 0x1588, 0xa867, 0x0103, 0xab7a, 0xa877,
+	0x0000, 0xa87c, 0xd0cc, 0x0130, 0x0096, 0xa878, 0x2048, 0x080c,
+	0x0fed, 0x009e, 0x080c, 0xe4e4, 0x0016, 0x080c, 0xca1a, 0x080c,
+	0x6c73, 0x001e, 0x080c, 0xc90b, 0x009e, 0x080c, 0xab13, 0x9ce0,
+	0x001c, 0x2001, 0x181a, 0x2004, 0x9c02, 0x1210, 0x0804, 0xdecc,
+	0x010e, 0x190c, 0xa79d, 0x012e, 0x002e, 0x004e, 0x005e, 0x006e,
+	0x007e, 0x008e, 0x00ce, 0x00ee, 0x0005, 0x9786, 0x0006, 0x1150,
+	0x9386, 0x0005, 0x0128, 0x080c, 0xe4e4, 0x080c, 0xe134, 0x08e0,
+	0x009e, 0x08e8, 0x9786, 0x0009, 0x11f8, 0x6000, 0x9086, 0x0004,
+	0x01c0, 0x6000, 0x9086, 0x0003, 0x11a0, 0x080c, 0x9505, 0x0096,
+	0x6114, 0x2148, 0x080c, 0xc723, 0x0118, 0x6010, 0x080c, 0x6c7f,
+	0x009e, 0x00c6, 0x080c, 0xaad8, 0x00ce, 0x0036, 0x080c, 0x956a,
+	0x003e, 0x009e, 0x0804, 0xdf4f, 0x9786, 0x000a, 0x0904, 0xdf36,
+	0x0804, 0xdf34, 0x81ff, 0x0904, 0xdf4f, 0x9180, 0x0001, 0x2004,
+	0x9086, 0x0018, 0x0138, 0x9180, 0x0001, 0x2004, 0x9086, 0x002d,
+	0x1904, 0xdf4f, 0x6000, 0x9086, 0x0002, 0x1904, 0xdf4f, 0x080c,
+	0xc920, 0x0138, 0x080c, 0xc931, 0x1904, 0xdf4f, 0x080c, 0xb4a0,
+	0x0038, 0x080c, 0x31dc, 0x080c, 0xc931, 0x1110, 0x080c, 0xb4a0,
+	0x080c, 0xab13, 0x0804, 0xdf4f, 0xa864, 0x9084, 0x00ff, 0x9086,
+	0x0039, 0x0005, 0x00c6, 0x00e6, 0x0016, 0x2c08, 0x2170, 0x9006,
+	0x080c, 0xe15b, 0x001e, 0x0120, 0x6020, 0x9084, 0x000f, 0x001b,
+	0x00ee, 0x00ce, 0x0005, 0xdfe9, 0xdfe9, 0xdfe9, 0xdfe9, 0xdfe9,
+	0xdfe9, 0xdfeb, 0xdfe9, 0xdfe9, 0xdfe9, 0xdfe9, 0xab13, 0xab13,
+	0xdfe9, 0x9006, 0x0005, 0x0036, 0x0046, 0x0016, 0x7010, 0x00b6,
+	0x2058, 0xbca0, 0x00be, 0x2c00, 0x2009, 0x0020, 0x080c, 0xe191,
+	0x001e, 0x004e, 0x2019, 0x0002, 0x080c, 0xdce5, 0x003e, 0x9085,
+	0x0001, 0x0005, 0x0096, 0x080c, 0xc723, 0x0140, 0x6014, 0x904d,
+	0x080c, 0xc32e, 0x687b, 0x0005, 0x080c, 0x6c7f, 0x009e, 0x080c,
+	0xab13, 0x9085, 0x0001, 0x0005, 0x2001, 0x0001, 0x080c, 0x6469,
+	0x0156, 0x0016, 0x0026, 0x0036, 0x20a9, 0x0004, 0x2019, 0x1805,
+	0x2011, 0x0276, 0x080c, 0xba99, 0x003e, 0x002e, 0x001e, 0x015e,
+	0x9005, 0x0005, 0x00f6, 0x00e6, 0x00c6, 0x0086, 0x0076, 0x0066,
+	0x00b6, 0x0126, 0x2091, 0x8000, 0x2740, 0x2061, 0x1ddc, 0x2079,
+	0x0001, 0x8fff, 0x0904, 0xe084, 0x2071, 0x1800, 0x7654, 0x7074,
+	0x8001, 0x9602, 0x1a04, 0xe084, 0x88ff, 0x0120, 0x2800, 0x9c06,
+	0x1590, 0x2078, 0x080c, 0xe1bd, 0x0570, 0x2400, 0x9c06, 0x0558,
+	0x6720, 0x9786, 0x0006, 0x1538, 0x9786, 0x0007, 0x0520, 0x88ff,
+	0x1140, 0x6010, 0x9b06, 0x11f8, 0x85ff, 0x0118, 0x605c, 0x9106,
+	0x11d0, 0x0096, 0x601c, 0xd084, 0x0140, 0x080c, 0xe3e7, 0x080c,
+	0xce4d, 0x080c, 0x1a53, 0x6023, 0x0007, 0x6014, 0x2048, 0x080c,
+	0xc723, 0x0120, 0x0046, 0x080c, 0xe134, 0x004e, 0x009e, 0x080c,
+	0xab13, 0x88ff, 0x1198, 0x9ce0, 0x001c, 0x2001, 0x181a, 0x2004,
+	0x9c02, 0x1210, 0x0804, 0xe039, 0x9006, 0x012e, 0x00be, 0x006e,
+	0x007e, 0x008e, 0x00ce, 0x00ee, 0x00fe, 0x0005, 0x98c5, 0x0001,
+	0x0ca0, 0x080c, 0xa781, 0x00b6, 0x0076, 0x0056, 0x0086, 0x9046,
+	0x2029, 0x0001, 0x2c20, 0x2019, 0x0002, 0x6210, 0x2258, 0x0096,
+	0x904e, 0x080c, 0xa103, 0x009e, 0x008e, 0x903e, 0x080c, 0xa1ae,
+	0x080c, 0xe02a, 0x005e, 0x007e, 0x00be, 0x080c, 0xa79d, 0x0005,
+	0x080c, 0xa781, 0x00b6, 0x0046, 0x0056, 0x0076, 0x00c6, 0x0156,
+	0x2c20, 0x2128, 0x20a9, 0x007f, 0x900e, 0x0016, 0x0036, 0x080c,
+	0x652d, 0x1190, 0x0056, 0x0086, 0x9046, 0x2508, 0x2029, 0x0001,
+	0x0096, 0x904e, 0x080c, 0xa103, 0x009e, 0x008e, 0x903e, 0x080c,
+	0xa1ae, 0x080c, 0xe02a, 0x005e, 0x003e, 0x001e, 0x8108, 0x1f04,
+	0xe0bd, 0x015e, 0x00ce, 0x007e, 0x005e, 0x004e, 0x00be, 0x080c,
+	0xa79d, 0x0005, 0x080c, 0xa781, 0x00b6, 0x0076, 0x0056, 0x6210,
+	0x2258, 0x0086, 0x9046, 0x2029, 0x0001, 0x2019, 0x0048, 0x0096,
+	0x904e, 0x080c, 0xa103, 0x009e, 0x008e, 0x903e, 0x080c, 0xa1ae,
+	0x2c20, 0x080c, 0xe02a, 0x005e, 0x007e, 0x00be, 0x080c, 0xa79d,
+	0x0005, 0x080c, 0xa781, 0x00b6, 0x0046, 0x0056, 0x0076, 0x00c6,
+	0x0156, 0x2c20, 0x20a9, 0x0800, 0x900e, 0x0016, 0x0036, 0x080c,
+	0x652d, 0x11a0, 0x0086, 0x9046, 0x2828, 0x0046, 0x2021, 0x0001,
+	0x080c, 0xe3cb, 0x004e, 0x0096, 0x904e, 0x080c, 0xa103, 0x009e,
+	0x008e, 0x903e, 0x080c, 0xa1ae, 0x080c, 0xe02a, 0x003e, 0x001e,
+	0x8108, 0x1f04, 0xe10d, 0x015e, 0x00ce, 0x007e, 0x005e, 0x004e,
+	0x00be, 0x080c, 0xa79d, 0x0005, 0x0016, 0x00f6, 0x080c, 0xc721,
+	0x0198, 0xa864, 0x9084, 0x00ff, 0x9086, 0x0046, 0x0180, 0xa800,
+	0x907d, 0x0138, 0xa803, 0x0000, 0xab82, 0x080c, 0x6c7f, 0x2f48,
+	0x0cb0, 0xab82, 0x080c, 0x6c7f, 0x00fe, 0x001e, 0x0005, 0xa800,
+	0x907d, 0x0130, 0xa803, 0x0000, 0x080c, 0x6c7f, 0x2f48, 0x0cb8,
+	0x080c, 0x6c7f, 0x0c88, 0x00e6, 0x0046, 0x0036, 0x2061, 0x1ddc,
+	0x9005, 0x1138, 0x2071, 0x1800, 0x7454, 0x7074, 0x8001, 0x9402,
+	0x12f8, 0x2100, 0x9c06, 0x0188, 0x6000, 0x9086, 0x0000, 0x0168,
+	0x6008, 0x9206, 0x1150, 0x6320, 0x9386, 0x0009, 0x01b0, 0x6010,
+	0x91a0, 0x0004, 0x2424, 0x9406, 0x0140, 0x9ce0, 0x001c, 0x2001,
+	0x181a, 0x2004, 0x9c02, 0x1220, 0x0c20, 0x9085, 0x0001, 0x0008,
+	0x9006, 0x003e, 0x004e, 0x00ee, 0x0005, 0x631c, 0xd3c4, 0x1d68,
+	0x0c30, 0x0096, 0x0006, 0x080c, 0x103b, 0x000e, 0x090c, 0x0d7d,
+	0xa867, 0x010d, 0xa88e, 0x0026, 0x2010, 0x080c, 0xc711, 0x2001,
+	0x0000, 0x0120, 0x2200, 0x9080, 0x0017, 0x2004, 0x002e, 0xa87a,
+	0xa986, 0xac76, 0xa87f, 0x0000, 0x2001, 0x198c, 0x2004, 0xa882,
+	0x9006, 0xa8e2, 0xa802, 0xa86a, 0xa88a, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x6c7f, 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, 0x1985, 0x2004, 0x601a,
+	0x2009, 0x8020, 0x080c, 0x90e8, 0x001e, 0x0005, 0xa001, 0xa001,
+	0x0005, 0x6024, 0xd0e4, 0x0158, 0xd0cc, 0x0118, 0x080c, 0xca61,
+	0x0030, 0x080c, 0xe3e7, 0x080c, 0x878b, 0x080c, 0xaad8, 0x0005,
+	0x9280, 0x0008, 0x2004, 0x9084, 0x000f, 0x0002, 0xe21c, 0xe21c,
+	0xe21c, 0xe21e, 0xe21c, 0xe21e, 0xe21e, 0xe21c, 0xe21e, 0xe21c,
+	0xe21c, 0xe21c, 0xe21c, 0xe21c, 0x9006, 0x0005, 0x9085, 0x0001,
+	0x0005, 0x9280, 0x0008, 0x2004, 0x9084, 0x000f, 0x0002, 0xe235,
+	0xe235, 0xe235, 0xe235, 0xe235, 0xe235, 0xe242, 0xe235, 0xe235,
+	0xe235, 0xe235, 0xe235, 0xe235, 0xe235, 0x6007, 0x003b, 0x602f,
+	0x0009, 0x6017, 0x2a00, 0x6003, 0x0001, 0x2009, 0x8020, 0x080c,
+	0x90e8, 0x0005, 0x0096, 0x00c6, 0x2260, 0x080c, 0xe3e7, 0x604b,
+	0x0000, 0x6024, 0xc0f4, 0xc0e4, 0x6026, 0x603b, 0x0000, 0x00ce,
+	0x00d6, 0x2268, 0x9186, 0x0007, 0x1904, 0xe29b, 0x6814, 0x9005,
+	0x0138, 0x2048, 0xa87c, 0xd0fc, 0x1118, 0x00de, 0x009e, 0x08a8,
+	0x6007, 0x003a, 0x6003, 0x0001, 0x2009, 0x8020, 0x080c, 0x90e8,
+	0x00c6, 0x2d60, 0x6100, 0x9186, 0x0002, 0x1904, 0xe312, 0x6014,
+	0x9005, 0x1138, 0x6000, 0x9086, 0x0007, 0x190c, 0x0d7d, 0x0804,
+	0xe312, 0x2048, 0x080c, 0xc723, 0x1130, 0x0028, 0x2048, 0xa800,
+	0x9005, 0x1de0, 0x2900, 0x2048, 0xa87c, 0x9084, 0x0003, 0x9086,
+	0x0002, 0x1168, 0xa87c, 0xc0dc, 0xc0f4, 0xa87e, 0xa880, 0xc0fc,
+	0xa882, 0x2009, 0x0043, 0x080c, 0xdb2c, 0x0804, 0xe312, 0x2009,
+	0x0041, 0x0804, 0xe30c, 0x9186, 0x0005, 0x15a0, 0x6814, 0x2048,
+	0xa87c, 0xd0bc, 0x1120, 0x00de, 0x009e, 0x0804, 0xe235, 0xd0b4,
+	0x0128, 0xd0fc, 0x090c, 0x0d7d, 0x0804, 0xe256, 0x6007, 0x003a,
+	0x6003, 0x0001, 0x2009, 0x8020, 0x080c, 0x90e8, 0x00c6, 0x2d60,
+	0x6100, 0x9186, 0x0002, 0x0120, 0x9186, 0x0004, 0x1904, 0xe312,
+	0x6814, 0x2048, 0xa97c, 0xc1f4, 0xc1dc, 0xa97e, 0xa980, 0xc1fc,
+	0xc1bc, 0xa982, 0x00f6, 0x2c78, 0x080c, 0x1728, 0x00fe, 0x2009,
+	0x0042, 0x04d0, 0x0036, 0x080c, 0x103b, 0x090c, 0x0d7d, 0xa867,
+	0x010d, 0x9006, 0xa802, 0xa86a, 0xa88a, 0x2d18, 0xab8e, 0xa887,
+	0x0045, 0x2c00, 0xa892, 0x6038, 0xa8a2, 0x2360, 0x6024, 0xc0dd,
+	0x6026, 0x6010, 0x00b6, 0x2058, 0xb8a0, 0x00be, 0x2004, 0x635c,
+	0xab7a, 0xa876, 0x9006, 0xa87e, 0xa882, 0xad9a, 0xae96, 0xa89f,
+	0x0001, 0x080c, 0x6c7f, 0x2019, 0x0045, 0x6008, 0x2068, 0x080c,
+	0xdce5, 0x2d00, 0x600a, 0x6023, 0x0006, 0x6003, 0x0007, 0x901e,
+	0x631a, 0x634a, 0x003e, 0x0038, 0x604b, 0x0000, 0x6003, 0x0007,
+	0x080c, 0xdb2c, 0x00ce, 0x00de, 0x009e, 0x0005, 0x9186, 0x0013,
+	0x1128, 0x6004, 0x9082, 0x0085, 0x2008, 0x00c2, 0x9186, 0x0027,
+	0x1178, 0x080c, 0x94a8, 0x0036, 0x0096, 0x6014, 0x2048, 0x2019,
+	0x0004, 0x080c, 0xe134, 0x009e, 0x003e, 0x080c, 0x956a, 0x0005,
+	0x9186, 0x0014, 0x0d70, 0x080c, 0xab94, 0x0005, 0xe345, 0xe343,
+	0xe343, 0xe343, 0xe343, 0xe343, 0xe345, 0xe343, 0xe343, 0xe343,
+	0xe343, 0xe343, 0xe343, 0x080c, 0x0d7d, 0x6003, 0x000c, 0x080c,
+	0x956a, 0x0005, 0x9182, 0x0092, 0x1220, 0x9182, 0x0085, 0x0208,
+	0x001a, 0x080c, 0xab94, 0x0005, 0xe361, 0xe361, 0xe361, 0xe361,
+	0xe363, 0xe383, 0xe361, 0xe361, 0xe361, 0xe361, 0xe361, 0xe361,
+	0xe361, 0x080c, 0x0d7d, 0x00d6, 0x2c68, 0x080c, 0xaa82, 0x01b0,
+	0x6003, 0x0001, 0x6007, 0x001e, 0x2009, 0x026e, 0x210c, 0x613a,
+	0x2009, 0x026f, 0x210c, 0x613e, 0x600b, 0xffff, 0x6910, 0x6112,
+	0x6023, 0x0004, 0x2009, 0x8020, 0x080c, 0x90e8, 0x2d60, 0x080c,
+	0xaad8, 0x00de, 0x0005, 0x080c, 0xaad8, 0x0005, 0x00e6, 0x6010,
+	0x00b6, 0x2058, 0xb800, 0x00be, 0xd0ec, 0x00ee, 0x0005, 0x2009,
+	0x1867, 0x210c, 0xd1ec, 0x05b0, 0x6003, 0x0002, 0x6024, 0xc0e5,
+	0x6026, 0xd0cc, 0x0150, 0x2001, 0x1986, 0x2004, 0x604a, 0x2009,
+	0x1867, 0x210c, 0xd1f4, 0x1520, 0x00a0, 0x2009, 0x1867, 0x210c,
+	0xd1f4, 0x0128, 0x6024, 0xc0e4, 0x6026, 0x9006, 0x00d8, 0x2001,
+	0x1986, 0x200c, 0x2001, 0x1984, 0x2004, 0x9100, 0x9080, 0x000a,
+	0x604a, 0x6010, 0x00b6, 0x2058, 0xb8bc, 0x00be, 0x0008, 0x2104,
+	0x9005, 0x0118, 0x9088, 0x0003, 0x0cd0, 0x2c0a, 0x600f, 0x0000,
+	0x9085, 0x0001, 0x0005, 0x0016, 0x00c6, 0x00e6, 0x615c, 0xb8bc,
+	0x2060, 0x8cff, 0x0180, 0x84ff, 0x1118, 0x605c, 0x9106, 0x1138,
+	0x600c, 0x2072, 0x080c, 0x878b, 0x080c, 0xaad8, 0x0010, 0x9cf0,
+	0x0003, 0x2e64, 0x0c70, 0x00ee, 0x00ce, 0x001e, 0x0005, 0x00d6,
+	0x00b6, 0x6010, 0x2058, 0xb8bc, 0x2068, 0x9005, 0x0130, 0x9c06,
+	0x0110, 0x680c, 0x0cd0, 0x600c, 0x680e, 0x00be, 0x00de, 0x0005,
+	0x0026, 0x0036, 0x0156, 0x2011, 0x182c, 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, 0xbaad, 0x009e,
+	0x1168, 0x2011, 0x0274, 0x20a9, 0x0004, 0x6010, 0x0096, 0x2048,
+	0x2019, 0x0006, 0x080c, 0xbaad, 0x009e, 0x1100, 0x015e, 0x003e,
+	0x002e, 0x0005, 0x00e6, 0x2071, 0x1800, 0x080c, 0x5ed4, 0x080c,
+	0x2f79, 0x00ee, 0x0005, 0x0096, 0x0026, 0x080c, 0x103b, 0x090c,
+	0x0d7d, 0xa85c, 0x9080, 0x001a, 0x20a0, 0x20a9, 0x000c, 0xa860,
+	0x20e8, 0x9006, 0x4004, 0x9186, 0x0046, 0x1118, 0xa867, 0x0136,
+	0x0038, 0xa867, 0x0138, 0x9186, 0x0041, 0x0110, 0xa87b, 0x0001,
+	0x7038, 0x9084, 0xff00, 0x7240, 0x9294, 0xff00, 0x8007, 0x9215,
+	0xaa9a, 0x9186, 0x0046, 0x1168, 0x7038, 0x9084, 0x00ff, 0x723c,
+	0x9294, 0xff00, 0x9215, 0xaa9e, 0x723c, 0x9294, 0x00ff, 0xaaa2,
+	0x0060, 0x7040, 0x9084, 0x00ff, 0x7244, 0x9294, 0xff00, 0x9215,
+	0xaa9e, 0x7244, 0x9294, 0x00ff, 0xaaa2, 0x9186, 0x0046, 0x1118,
+	0x9e90, 0x0012, 0x0010, 0x9e90, 0x001a, 0x2204, 0x8007, 0xa8a6,
+	0x8210, 0x2204, 0x8007, 0xa8aa, 0x8210, 0x2204, 0x8007, 0xa8ae,
+	0x8210, 0x2204, 0x8007, 0xa8b2, 0x8210, 0x9186, 0x0046, 0x11b8,
+	0x9e90, 0x0016, 0x2204, 0x8007, 0xa8b6, 0x8210, 0x2204, 0x8007,
+	0xa8ba, 0x8210, 0x2204, 0x8007, 0xa8be, 0x8210, 0x2204, 0x8007,
+	0xa8c2, 0x8210, 0x2011, 0x0205, 0x2013, 0x0001, 0x00b0, 0x9e90,
+	0x001e, 0x2204, 0x8007, 0xa8b6, 0x8210, 0x2204, 0x8007, 0xa8ba,
+	0x2011, 0x0205, 0x2013, 0x0001, 0x2011, 0x0260, 0x2204, 0x8007,
+	0xa8be, 0x8210, 0x2204, 0x8007, 0xa8c2, 0x9186, 0x0046, 0x1118,
+	0x2011, 0x0262, 0x0010, 0x2011, 0x026a, 0x0146, 0x01d6, 0x0036,
+	0x20a9, 0x0001, 0x2019, 0x0008, 0xa860, 0x20e8, 0xa85c, 0x9080,
+	0x0031, 0x20a0, 0x2204, 0x8007, 0x4004, 0x8210, 0x8319, 0x1dd0,
+	0x003e, 0x01ce, 0x013e, 0x2011, 0x0205, 0x2013, 0x0000, 0x002e,
+	0x080c, 0x6c7f, 0x009e, 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,
+	0x19f1, 0x252c, 0x2021, 0x19f8, 0x2424, 0x2061, 0x1ddc, 0x2071,
+	0x1800, 0x7654, 0x7074, 0x9606, 0x0578, 0x6720, 0x9786, 0x0001,
+	0x0118, 0x9786, 0x0008, 0x1500, 0x2500, 0x9c06, 0x01e8, 0x2400,
+	0x9c06, 0x01d0, 0x080c, 0xe1bd, 0x01b8, 0x080c, 0xe1cd, 0x11a0,
+	0x6000, 0x9086, 0x0004, 0x1120, 0x0016, 0x080c, 0x1a53, 0x001e,
+	0x080c, 0xc920, 0x1110, 0x080c, 0x31dc, 0x080c, 0xc931, 0x1110,
+	0x080c, 0xb4a0, 0x080c, 0xab13, 0x9ce0, 0x001c, 0x2001, 0x181a,
+	0x2004, 0x9c02, 0x1208, 0x0858, 0x012e, 0x001e, 0x002e, 0x004e,
+	0x005e, 0x006e, 0x007e, 0x00ce, 0x00de, 0x00ee, 0x0005, 0x2001,
+	0x1810, 0x2004, 0xd0dc, 0x0005, 0x0006, 0x2001, 0x1837, 0x2004,
+	0xd09c, 0x000e, 0x0005, 0x0006, 0x0036, 0x0046, 0x080c, 0xce35,
+	0x0168, 0x2019, 0xffff, 0x9005, 0x0128, 0x6010, 0x00b6, 0x2058,
+	0xbba0, 0x00be, 0x2021, 0x0004, 0x080c, 0x4bef, 0x004e, 0x003e,
+	0x000e, 0x6004, 0x9086, 0x0001, 0x1128, 0x080c, 0xa275, 0x080c,
+	0xab13, 0x9006, 0x0005, 0x0126, 0x0006, 0x00e6, 0x0016, 0x2091,
+	0x8000, 0x2071, 0x1840, 0xd5a4, 0x0118, 0x7004, 0x8000, 0x7006,
+	0xd5b4, 0x0118, 0x7000, 0x8000, 0x7002, 0xd5ac, 0x0178, 0x2500,
+	0x9084, 0x0007, 0x908e, 0x0003, 0x0148, 0x908e, 0x0004, 0x0130,
+	0x908e, 0x0005, 0x0118, 0x2071, 0xfffe, 0x0089, 0x001e, 0x00ee,
+	0x000e, 0x012e, 0x0005, 0x0126, 0x0006, 0x00e6, 0x2091, 0x8000,
+	0x2071, 0xfff6, 0x0021, 0x00ee, 0x000e, 0x012e, 0x0005, 0x2e05,
+	0x8000, 0x2077, 0x1220, 0x8e70, 0x2e05, 0x8000, 0x2077, 0x0005,
+	0x00e6, 0x2071, 0xfff4, 0x0c99, 0x00ee, 0x0005, 0x00e6, 0x2071,
+	0xfff8, 0x0c69, 0x00ee, 0x0005, 0x0126, 0x0006, 0x00e6, 0x2091,
+	0x8000, 0x2071, 0x1840, 0x7014, 0x8000, 0x7016, 0x00ee, 0x000e,
+	0x012e, 0x0005, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020,
+	0x0040, 0x0080, 0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000,
+	0x4000, 0x8000, 0xd89f
+};
+#ifdef UNIQUE_FW_NAME
+unsigned short fw2322ipx_length01 = 0xdddb;
+#else
+unsigned short risc_code_length01 = 0xdddb;
+#endif
+
+/*
+ *
+ */
+
+unsigned long rseqipx_code_addr01 = 0x0001c000 ;
+unsigned short rseqipx_code01[] = { 
+0x000b, 0x0003, 0x0000, 0x09d8, 0x0001, 0xc000, 0x0008, 0x8064,
+	0x0000, 0x0010, 0x0000, 0x8066, 0x0008, 0x0101, 0x0003, 0xc007,
+	0x0008, 0x80e0, 0x0008, 0xff00, 0x0000, 0x80e2, 0x0008, 0xff00,
+	0x0008, 0x0162, 0x0000, 0x8066, 0x0008, 0xa101, 0x000b, 0xc00f,
+	0x0008, 0x0d02, 0x0000, 0x8060, 0x0000, 0x0400, 0x0003, 0x60c2,
+	0x0003, 0x5817, 0x000b, 0x7ae0, 0x000b, 0x521c, 0x000b, 0xc813,
+	0x0009, 0xbac0, 0x0000, 0x008a, 0x0003, 0x8813, 0x0000, 0x15fc,
+	0x000b, 0xb013, 0x0009, 0xc4c0, 0x0000, 0x7000, 0x0001, 0xffa0,
+	0x0000, 0x2000, 0x0003, 0x9394, 0x0008, 0x808c, 0x0000, 0x0001,
+	0x0007, 0x0000, 0x0007, 0x0000, 0x0000, 0x40d4, 0x000a, 0x4047,
+	0x0008, 0x808c, 0x0000, 0x0002, 0x0007, 0x0000, 0x0003, 0x082e,
+	0x0000, 0x4022, 0x0003, 0x0034, 0x0008, 0x4122, 0x0009, 0xeac0,
+	0x0008, 0xff00, 0x0009, 0xffe0, 0x0008, 0x0500, 0x0003, 0x0bbb,
+	0x0002, 0x4447, 0x000b, 0x8bb8, 0x0008, 0x0bfe, 0x0001, 0x11a0,
+	0x0003, 0x139a, 0x0001, 0x0ca0, 0x0003, 0x139a, 0x0001, 0x9180,
+	0x0000, 0x0004, 0x0000, 0x8060, 0x0000, 0x0400, 0x0008, 0x7f62,
+	0x0000, 0x8066, 0x0008, 0x0009, 0x000b, 0xc042, 0x0008, 0x808c,
+	0x0008, 0x0000, 0x0008, 0x0060, 0x0008, 0x8062, 0x0000, 0x0004,
+	0x0000, 0x8066, 0x0000, 0x0411, 0x0003, 0xc04a, 0x0000, 0x03fe,
+	0x0001, 0x43e0, 0x0003, 0x8b97, 0x0009, 0xc2c0, 0x0008, 0x00ff,
+	0x0001, 0x02e0, 0x0003, 0x8b97, 0x0001, 0x9180, 0x0008, 0x0005,
+	0x0000, 0x8060, 0x0000, 0x0400, 0x0008, 0x7f62, 0x0000, 0x8066,
+	0x0000, 0x0019, 0x000b, 0xc059, 0x0002, 0x0240, 0x000b, 0x0b94,
+	0x0008, 0x00fc, 0x0003, 0x3397, 0x000a, 0x0244, 0x000b, 0x086b,
+	0x000c, 0x01f5, 0x0001, 0x9180, 0x0000, 0x0007, 0x0008, 0x7f62,
+	0x0000, 0x8060, 0x0000, 0x0400, 0x0002, 0x0234, 0x0008, 0x7f04,
+	0x0000, 0x8066, 0x0000, 0x040a, 0x000b, 0xc06a, 0x000a, 0x0248,
+	0x000b, 0x0875, 0x0001, 0x9180, 0x0008, 0x0006, 0x0008, 0x7f62,
+	0x0008, 0x8002, 0x0008, 0x0003, 0x0000, 0x8066, 0x0000, 0x020a,
+	0x000b, 0xc074, 0x0000, 0x112a, 0x0008, 0x002e, 0x0008, 0x022c,
+	0x0002, 0x3a44, 0x0003, 0x8813, 0x0008, 0x808c, 0x0000, 0x0002,
+	0x0008, 0x1760, 0x0008, 0x8062, 0x0008, 0x000f, 0x0000, 0x8066,
+	0x0008, 0x0011, 0x000b, 0xc081, 0x0008, 0x01fe, 0x0009, 0x42e0,
+	0x000b, 0x8b87, 0x0000, 0x00fe, 0x0001, 0x43e0, 0x000b, 0x8b87,
+	0x0000, 0x1734, 0x0000, 0x1530, 0x0008, 0x1632, 0x0008, 0x0d2a,
+	0x0001, 0x9880, 0x0008, 0x0012, 0x0000, 0x8060, 0x0000, 0x0400,
+	0x0008, 0x7f62, 0x0000, 0x8066, 0x0008, 0x1e0a, 0x000b, 0xc093,
+	0x0008, 0x808a, 0x0008, 0x0003, 0x0000, 0x1a60, 0x0008, 0x8062,
+	0x0000, 0x0002, 0x0003, 0x5899, 0x0000, 0x8066, 0x0000, 0x3679,
+	0x000b, 0xc09c, 0x000b, 0x589d, 0x0008, 0x8054, 0x0008, 0x0011,
+	0x0000, 0x8074, 0x0008, 0x1010, 0x0008, 0x1efc, 0x0003, 0x3013,
+	0x0004, 0x00a6, 0x0003, 0x0013, 0x0000, 0x1c60, 0x0000, 0x1b62,
+	0x0000, 0x8066, 0x0008, 0x0231, 0x000b, 0xc0aa, 0x000b, 0x58ab,
+	0x0008, 0x0140, 0x0000, 0x0242, 0x0002, 0x1f43, 0x0003, 0x88b5,
+	0x0000, 0x0d44, 0x0008, 0x0d46, 0x0008, 0x0348, 0x0008, 0x044a,
+	0x0003, 0x00b9, 0x0008, 0x0344, 0x0008, 0x0446, 0x0008, 0x0548,
+	0x0000, 0x064a, 0x000a, 0x1948, 0x000b, 0x08bc, 0x0008, 0x0d4a,
+	0x000b, 0x58bc, 0x0008, 0x8054, 0x0000, 0x0001, 0x0000, 0x8074,
+	0x0008, 0x2020, 0x000f, 0x4000, 0x0000, 0x4820, 0x0008, 0x0bfe,
+	0x0009, 0x10a0, 0x0003, 0x1123, 0x0001, 0x0ca0, 0x0003, 0x1123,
+	0x0000, 0x8060, 0x0000, 0x0400, 0x0009, 0x9080, 0x0000, 0x0008,
+	0x0008, 0x7f62, 0x0000, 0x8066, 0x0008, 0x0009, 0x000b, 0xc0cf,
+	0x0001, 0x80e0, 0x0008, 0x0003, 0x000b, 0x8923, 0x0000, 0x49b4,
+	0x0002, 0x4b4e, 0x000b, 0x892c, 0x0008, 0x808a, 0x0000, 0x0004,
+	0x0000, 0x18fe, 0x0001, 0x10e0, 0x000b, 0x88dd, 0x0002, 0x192f,
+	0x0008, 0x7f32, 0x0008, 0x15fe, 0x0001, 0x10e0, 0x000b, 0x88e2,
+	0x0002, 0x162f, 0x0008, 0x7f2c, 0x0000, 0x8060, 0x0000, 0x0400,
+	0x0009, 0x9080, 0x0000, 0x0007, 0x0008, 0x7f62, 0x0000, 0x8066,
+	0x0008, 0x0009, 0x0003, 0xc0e9, 0x000a, 0x004f, 0x000b, 0x891a,
+	0x000a, 0x0040, 0x0003, 0x0904, 0x0002, 0x004e, 0x0003, 0x0904,
+	0x0002, 0x0030, 0x0002, 0x7f2f, 0x0000, 0x7f00, 0x0000, 0x8066,
+	0x0008, 0x000a, 0x000b, 0xc0f5, 0x0008, 0x1010, 0x0004, 0x01dc,
+	0x000b, 0xb0fd, 0x000c, 0x035b, 0x000c, 0x01c6, 0x000b, 0x7814,
+	0x0003, 0x0013, 0x0000, 0x0806, 0x0008, 0x8010, 0x0000, 0x001f,
+	0x000c, 0x035b, 0x0000, 0x0310, 0x000c, 0x035b, 0x0003, 0x00fb,
+	0x000a, 0x002f, 0x0000, 0x7f00, 0x0000, 0x8066, 0x0008, 0x000a,
+	0x000b, 0xc108, 0x000c, 0x019f, 0x000a, 0x0040, 0x000b, 0x091d,
+	0x000c, 0x020c, 0x0000, 0x8000, 0x0000, 0x0002, 0x0000, 0x8060,
+	0x0000, 0x0400, 0x0009, 0x9080, 0x0008, 0x0006, 0x0008, 0x7f62,
+	0x0000, 0x8066, 0x0008, 0x000a, 0x000b, 0xc116, 0x0000, 0x8072,
+	0x0000, 0x4000, 0x0003, 0x00fb, 0x0008, 0x8010, 0x0008, 0x001e,
+	0x000b, 0x011f, 0x0008, 0x8010, 0x0008, 0x001d, 0x000c, 0x035b,
+	0x0008, 0x1010, 0x000c, 0x035b, 0x000b, 0x0014, 0x0002, 0x4b4e,
+	0x0003, 0x0929, 0x0008, 0x808a, 0x0000, 0x0004, 0x000b, 0x6129,
+	0x000f, 0x8000, 0x0008, 0x808a, 0x0000, 0x0004, 0x000b, 0x0014,
+	0x0000, 0x8060, 0x0000, 0x0400, 0x0009, 0x9080, 0x0008, 0x0011,
+	0x0008, 0x7f62, 0x0000, 0x8066, 0x0008, 0x0009, 0x0003, 0xc133,
+	0x000a, 0x004f, 0x0003, 0x8990, 0x0000, 0x8060, 0x0000, 0x0400,
+	0x0009, 0x9080, 0x0008, 0x0005, 0x0008, 0x7f62, 0x0000, 0x8066,
+	0x0008, 0x0009, 0x000b, 0xc13d, 0x0008, 0x0060, 0x0008, 0x8062,
+	0x0000, 0x001f, 0x0000, 0x8066, 0x0000, 0x0209, 0x000b, 0xc143,
+	0x000a, 0x014b, 0x000b, 0x0990, 0x0008, 0x8062, 0x0008, 0x000f,
+	0x0000, 0x8066, 0x0000, 0x0211, 0x000b, 0xc14a, 0x0008, 0x01fe,
+	0x0001, 0x02d0, 0x0003, 0x8990, 0x0004, 0x01a8, 0x000b, 0x0990,
+	0x0008, 0x03a0, 0x0008, 0x8004, 0x0000, 0x0002, 0x0000, 0x8006,
+	0x0000, 0x0043, 0x0008, 0x4908, 0x0008, 0x808a, 0x0000, 0x0004,
+	0x0000, 0x8060, 0x0000, 0x0400, 0x0009, 0x9080, 0x0008, 0x0000,
+	0x0008, 0x7f62, 0x0000, 0x8066, 0x0008, 0x041a, 0x0003, 0xc15f,
+	0x000b, 0xe160, 0x0008, 0x4908, 0x0008, 0x480a, 0x0008, 0x808a,
+	0x0000, 0x0004, 0x0008, 0x0060, 0x0008, 0x8062, 0x0008, 0x002b,
+	0x0000, 0x8066, 0x0000, 0x0411, 0x0003, 0xc16a, 0x0008, 0x04fe,
+	0x0009, 0x02a0, 0x0003, 0x9171, 0x0002, 0x0500, 0x000b, 0x098d,
+	0x0003, 0x0172, 0x0000, 0x05fe, 0x0001, 0x03a0, 0x000b, 0x118d,
+	0x0000, 0x0d0c, 0x0008, 0x0d0e, 0x0008, 0x0d10, 0x0000, 0x0d12,
+	0x0008, 0x0060, 0x0008, 0x8062, 0x0000, 0x000d, 0x0000, 0x8066,
+	0x0008, 0x0832, 0x0003, 0xc17d, 0x0000, 0x800a, 0x0000, 0x8005,
+	0x0000, 0x8060, 0x0000, 0x0400, 0x0009, 0x9080, 0x0008, 0x0011,
+	0x0008, 0x7f62, 0x0000, 0x8066, 0x0008, 0x0a12, 0x0003, 0xc187,
+	0x0008, 0x5006, 0x0008, 0x100e, 0x0004, 0x01b3, 0x000b, 0x7814,
+	0x0003, 0x0013, 0x0008, 0x0208, 0x0008, 0x030a, 0x0003, 0x0174,
+	0x000c, 0x019f, 0x0008, 0x808a, 0x0000, 0x0004, 0x0008, 0x8010,
+	0x0008, 0x0021, 0x000c, 0x035b, 0x0008, 0x1010, 0x000c, 0x035b,
+	0x0000, 0x4810, 0x000c, 0x035b, 0x0008, 0x4910, 0x000c, 0x035b,
+	0x0008, 0x808a, 0x0000, 0x0004, 0x000b, 0x0014, 0x0000, 0x8060,
+	0x0000, 0x0400, 0x0009, 0x9080, 0x0000, 0x0002, 0x0008, 0x7f62,
+	0x0000, 0x8066, 0x0008, 0xb40a, 0x0003, 0xc1a6, 0x000f, 0x4000,
+	0x0000, 0x8060, 0x0000, 0x0400, 0x0000, 0x0a62, 0x0000, 0x8066,
+	0x0000, 0x0411, 0x000b, 0xc1ad, 0x0002, 0x0210, 0x0001, 0xffc0,
+	0x0000, 0x0007, 0x0009, 0x03e0, 0x000f, 0x4000, 0x0000, 0x8060,
+	0x0000, 0x0400, 0x0001, 0x8380, 0x0000, 0x0002, 0x0009, 0x0a80,
+	0x0008, 0x7f62, 0x0000, 0x8066, 0x0000, 0x0e0a, 0x0003, 0xc1bb,
+	0x0002, 0x0300, 0x0001, 0xffc0, 0x0000, 0x0007, 0x0000, 0x7f06,
+	0x0002, 0x0a00, 0x0008, 0x7f62, 0x0000, 0x8066, 0x0008, 0x060a,
+	0x000b, 0xc1c4, 0x000f, 0x4000, 0x0000, 0x0da0, 0x0008, 0x0da2,
+	0x0008, 0x0da4, 0x0009, 0x8880, 0x0000, 0x0001, 0x0008, 0x7f62,
+	0x0000, 0x8060, 0x0000, 0x0400, 0x0000, 0x8066, 0x0008, 0xa012,
+	0x0000, 0x0da6, 0x0008, 0x0da8, 0x0000, 0x0daa, 0x0000, 0x0dac,
+	0x0003, 0xc1d4, 0x0009, 0x8880, 0x0008, 0x0009, 0x0008, 0x7f62,
+	0x0000, 0x8066, 0x0008, 0xa03a, 0x000b, 0xc1da, 0x000f, 0x4000,
+	0x0009, 0x8880, 0x0008, 0x0005, 0x0000, 0x8060, 0x0000, 0x0400,
+	0x0008, 0x7f62, 0x0000, 0x8066, 0x0008, 0x0009, 0x000b, 0xc1e3,
+	0x0008, 0x0060, 0x0008, 0x8062, 0x0000, 0x000d, 0x0000, 0x8066,
+	0x0008, 0x0021, 0x000b, 0xc1e9, 0x0000, 0x00fe, 0x0001, 0x01d0,
+	0x000b, 0x89f2, 0x0008, 0x02fe, 0x0009, 0x03d0, 0x0003, 0x09f2,
+	0x0000, 0x0d06, 0x000f, 0x4000, 0x0000, 0x8006, 0x0000, 0x0001,
+	0x000f, 0x4000, 0x0008, 0x0060, 0x0008, 0x8062, 0x0008, 0x002b,
+	0x0000, 0x8066, 0x0008, 0xa041, 0x0003, 0xc1fa, 0x0002, 0x0243,
+	0x000b, 0x8a01, 0x0000, 0x54ac, 0x0000, 0x55ae, 0x0008, 0x0da8,
+	0x0000, 0x0daa, 0x0000, 0x50b0, 0x0000, 0x51b2, 0x0000, 0x0db4,
+	0x0008, 0x0db6, 0x0008, 0x0060, 0x0008, 0x8062, 0x0000, 0x0007,
+	0x0000, 0x8066, 0x0008, 0xa452, 0x0003, 0xc20a, 0x000f, 0x4000,
+	0x000a, 0x3945, 0x000b, 0x8a16, 0x0000, 0x8072, 0x0008, 0x4040,
+	0x0007, 0x0000, 0x000a, 0x3945, 0x0003, 0x8a14, 0x000f, 0x4000,
+	0x0000, 0x8072, 0x0000, 0x4000, 0x0007, 0x0000, 0x0007, 0x0000,
+	0x0007, 0x0000, 0x000a, 0x3945, 0x0003, 0x0a0e, 0x000b, 0x0216,
+	0x000a, 0x3a40, 0x000b, 0x8817, 0x0008, 0x2b24, 0x0008, 0x2b24,
+	0x0003, 0x5a20, 0x0008, 0x8054, 0x0000, 0x0002, 0x0002, 0x1242,
+	0x0003, 0x0a64, 0x000a, 0x3a45, 0x000b, 0x0a55, 0x000a, 0x1e10,
+	0x0000, 0x7f3c, 0x0003, 0x0a52, 0x0002, 0x1d00, 0x0000, 0x7f3a,
+	0x0000, 0x0d60, 0x0008, 0x7f62, 0x0000, 0x8066, 0x0008, 0x0009,
+	0x0003, 0xc230, 0x0008, 0x00fc, 0x0003, 0xb24f, 0x0000, 0x1c60,
+	0x0008, 0x8062, 0x0000, 0x0001, 0x0000, 0x8066, 0x0008, 0x0009,
+	0x000b, 0xc238, 0x0008, 0x00fc, 0x0003, 0x3370, 0x0000, 0x0038,
+	0x0008, 0x0060, 0x0008, 0x8062, 0x0000, 0x0019, 0x0000, 0x8066,
+	0x0008, 0x0009, 0x0003, 0xc241, 0x0009, 0x80c0, 0x0008, 0x00ff,
+	0x0008, 0x7f3e, 0x0000, 0x0d60, 0x0008, 0x0efe, 0x0001, 0x1f80,
+	0x0008, 0x7f62, 0x0000, 0x8066, 0x0008, 0x0009, 0x0003, 0xc24b,
+	0x0008, 0x003a, 0x0000, 0x1dfe, 0x000b, 0x022c, 0x0008, 0x0036,
+	0x0004, 0x00a6, 0x000b, 0x0264, 0x0000, 0x8074, 0x0000, 0x2000,
+	0x000b, 0x0264, 0x0002, 0x3a44, 0x000b, 0x0b9d, 0x0000, 0x8074,
+	0x0000, 0x1000, 0x0000, 0x2d0e, 0x0000, 0x2d0e, 0x000b, 0xb36d,
+	0x0008, 0x26fe, 0x0008, 0x26fe, 0x0008, 0x2700, 0x0008, 0x2700,
+	0x0009, 0x00d0, 0x0003, 0x8a74, 0x0000, 0x8074, 0x0008, 0x4040,
+	0x0003, 0x5a64, 0x000b, 0x521c, 0x000a, 0x3a46, 0x0003, 0x8a74,
+	0x0002, 0x3a47, 0x000b, 0x0a6f, 0x0008, 0x8054, 0x0000, 0x0004,
+	0x0000, 0x8074, 0x0000, 0x8000, 0x0003, 0x02d4, 0x0009, 0x92c0,
+	0x0000, 0x0fc8, 0x000b, 0x0813, 0x000a, 0x1246, 0x0003, 0x8b67,
+	0x0000, 0x1a60, 0x0008, 0x8062, 0x0000, 0x0002, 0x0000, 0x8066,
+	0x0000, 0x367a, 0x000b, 0xc279, 0x0009, 0x92c0, 0x0008, 0x0780,
+	0x000b, 0x8b81, 0x0002, 0x124b, 0x000b, 0x0a82, 0x0002, 0x2e4d,
+	0x0002, 0x2e4d, 0x000b, 0x0b6d, 0x000a, 0x3a46, 0x000b, 0x8a92,
+	0x000b, 0x5a84, 0x0008, 0x8054, 0x0000, 0x0004, 0x000a, 0x1243,
+	0x000b, 0x0ad2, 0x0008, 0x8010, 0x0000, 0x000d, 0x000c, 0x035b,
+	0x000a, 0x1948, 0x0003, 0x0a8f, 0x0004, 0x0350, 0x0000, 0x1810,
+	0x000c, 0x035b, 0x0003, 0x02d2, 0x000a, 0x1948, 0x000b, 0x0a96,
+	0x000a, 0x1243, 0x000b, 0x0b70, 0x000a, 0x194d, 0x000b, 0x0a9a,
+	0x000a, 0x1243, 0x0003, 0x0b77, 0x000b, 0x5a9a, 0x0008, 0x8054,
+	0x0000, 0x0004, 0x000a, 0x192e, 0x0008, 0x7f32, 0x000a, 0x1947,
+	0x000b, 0x0acc, 0x0002, 0x194f, 0x000b, 0x0aaa, 0x0004, 0x0350,
+	0x0000, 0x1810, 0x0004, 0x01dc, 0x000b, 0xb2c5, 0x000c, 0x035b,
+	0x000c, 0x01c6, 0x0003, 0x02d2, 0x0000, 0x1a60, 0x0008, 0x8062,
+	0x0000, 0x001f, 0x0000, 0x8066, 0x0008, 0x0009, 0x0003, 0xc2af,
+	0x000a, 0x004c, 0x0003, 0x8acc, 0x0000, 0x8060, 0x0000, 0x0400,
+	0x0001, 0x9880, 0x0000, 0x0007, 0x0008, 0x7f62, 0x0000, 0x8066,
+	0x0000, 0x320a, 0x000b, 0xc2b9, 0x0000, 0x8060, 0x0000, 0x0400,
+	0x0001, 0x9880, 0x0008, 0x0012, 0x0008, 0x7f62, 0x0000, 0x8066,
+	0x0008, 0x1e0a, 0x000b, 0xc2c1, 0x0000, 0x1826, 0x0000, 0x1928,
+	0x0003, 0x02d2, 0x0000, 0x0806, 0x0008, 0x8010, 0x0000, 0x001f,
+	0x000c, 0x035b, 0x0000, 0x0310, 0x000c, 0x035b, 0x0003, 0x02d2,
+	0x0004, 0x0350, 0x0008, 0x8010, 0x0000, 0x0001, 0x000c, 0x035b,
+	0x0000, 0x1810, 0x000c, 0x035b, 0x0000, 0x8074, 0x0008, 0xf000,
+	0x0000, 0x0d30, 0x0002, 0x3a42, 0x000b, 0x8ada, 0x0000, 0x15fc,
+	0x000b, 0xb07a, 0x0003, 0x0013, 0x0000, 0x8074, 0x0000, 0x0501,
+	0x0008, 0x8010, 0x0008, 0x000c, 0x000c, 0x035b, 0x0003, 0x0013,
+	0x0009, 0xbbe0, 0x0008, 0x0030, 0x0003, 0x8af6, 0x0000, 0x18fe,
+	0x0009, 0x3ce0, 0x000b, 0x0af3, 0x0008, 0x15fe, 0x0009, 0x3ce0,
+	0x000b, 0x0af3, 0x0008, 0x13fe, 0x0009, 0x3ce0, 0x000b, 0x8aef,
+	0x000c, 0x0349, 0x0008, 0x0d26, 0x0003, 0x02f0, 0x0004, 0x034b,
+	0x0008, 0x8076, 0x0000, 0x0040, 0x0003, 0x0346, 0x0008, 0x8076,
+	0x0008, 0x0041, 0x0003, 0x0346, 0x0009, 0xbbe0, 0x0000, 0x0032,
+	0x000b, 0x8afb, 0x0008, 0x3c1e, 0x0003, 0x0346, 0x0009, 0xbbe0,
+	0x0000, 0x003b, 0x000b, 0x8b00, 0x0000, 0x3cdc, 0x0003, 0x0346,
+	0x0009, 0xbbe0, 0x0008, 0x0035, 0x000b, 0x8b06, 0x0000, 0x8072,
+	0x0000, 0x8000, 0x0003, 0x04aa, 0x0009, 0xbbe0, 0x0008, 0x0036,
+	0x000b, 0x0bcd, 0x0009, 0xbbe0, 0x0000, 0x0037, 0x000b, 0x8b27,
+	0x0000, 0x18fe, 0x0009, 0x3ce0, 0x0003, 0x8af3, 0x0008, 0x8076,
+	0x0000, 0x0040, 0x0000, 0x1a60, 0x0008, 0x8062, 0x0000, 0x000d,
+	0x0008, 0x2604, 0x0008, 0x2604, 0x0008, 0x2706, 0x0008, 0x2706,
+	0x0000, 0x2808, 0x0000, 0x2808, 0x0000, 0x290a, 0x0000, 0x290a,
+	0x0000, 0x8066, 0x0000, 0x0422, 0x000b, 0xc31e, 0x0004, 0x0350,
+	0x0008, 0x8054, 0x0000, 0x0004, 0x0000, 0x8074, 0x0008, 0xf000,
+	0x0000, 0x8072, 0x0000, 0x8000, 0x0003, 0x02d4, 0x0009, 0xbbe0,
+	0x0000, 0x0038, 0x000b, 0x8b39, 0x0000, 0x18fe, 0x0009, 0x3ce0,
+	0x0003, 0x0b36, 0x0008, 0x15fe, 0x0009, 0x3ce0, 0x000b, 0x8ae9,
+	0x0004, 0x034b, 0x0008, 0x8076, 0x0000, 0x0040, 0x0000, 0x8072,
+	0x0000, 0x8000, 0x0003, 0x0394, 0x0008, 0x8076, 0x0008, 0x0042,
+	0x0003, 0x0346, 0x0009, 0xbbe0, 0x0000, 0x0016, 0x0003, 0x8b46,
+	0x0000, 0x8074, 0x0008, 0x0808, 0x0002, 0x3a44, 0x0003, 0x8816,
+	0x0000, 0x8074, 0x0000, 0x0800, 0x0000, 0x8072, 0x0000, 0x8000,
+	0x000f, 0x8000, 0x0003, 0x0013, 0x0000, 0x8072, 0x0000, 0x8000,
+	0x0003, 0x0013, 0x0002, 0x1430, 0x0003, 0x034c, 0x000a, 0x3d30,
+	0x0000, 0x7f00, 0x0001, 0xbc80, 0x0000, 0x0007, 0x0003, 0x0354,
+	0x000a, 0x1930, 0x0000, 0x7f00, 0x0001, 0x9880, 0x0000, 0x0007,
+	0x0000, 0x8060, 0x0000, 0x0400, 0x0008, 0x7f62, 0x0000, 0x8066,
+	0x0008, 0x000a, 0x000b, 0xc359, 0x000f, 0x4000, 0x000b, 0x235b,
+	0x0008, 0x0870, 0x000f, 0x4000, 0x0009, 0xbac0, 0x0008, 0x0090,
+	0x000b, 0x0b64, 0x0000, 0x8074, 0x0000, 0x0706, 0x000b, 0x0366,
+	0x0000, 0x8074, 0x0000, 0x0703, 0x000f, 0x4000, 0x0008, 0x8010,
+	0x0000, 0x0023, 0x0003, 0x03a2, 0x0008, 0x8010, 0x0000, 0x0008,
+	0x0003, 0x03a2, 0x0008, 0x8010, 0x0008, 0x0022, 0x0003, 0x03a2,
+	0x0004, 0x0350, 0x0008, 0x8010, 0x0000, 0x0007, 0x000c, 0x035b,
+	0x0000, 0x1810, 0x000c, 0x035b, 0x000b, 0x03ac, 0x0004, 0x0350,
+	0x0008, 0x8010, 0x0008, 0x001b, 0x000c, 0x035b, 0x0000, 0x1810,
+	0x000c, 0x035b, 0x0000, 0x8074, 0x0000, 0xf080, 0x0000, 0x0d30,
+	0x0003, 0x0013, 0x0008, 0x8010, 0x0008, 0x0009, 0x0003, 0x03a2,
+	0x0008, 0x8010, 0x0008, 0x0005, 0x0003, 0x03a2, 0x000a, 0x1648,
+	0x000b, 0x8888, 0x0008, 0x808c, 0x0000, 0x0001, 0x0007, 0x0000,
+	0x0008, 0x8010, 0x0000, 0x0004, 0x000a, 0x4143, 0x0003, 0x0888,
+	0x0002, 0x3a44, 0x0003, 0x8813, 0x0008, 0x0d2a, 0x0003, 0x03a2,
+	0x0008, 0x8010, 0x0008, 0x0003, 0x0003, 0x03a4, 0x0008, 0x8010,
+	0x0000, 0x000b, 0x0003, 0x03a4, 0x0008, 0x8010, 0x0000, 0x0002,
+	0x0003, 0x03a4, 0x0002, 0x3a47, 0x000b, 0x8a64, 0x0008, 0x8010,
+	0x0008, 0x0006, 0x0003, 0x03a4, 0x0000, 0x8074, 0x0008, 0xf000,
+	0x000c, 0x035b, 0x000c, 0x035e, 0x000a, 0x3a40, 0x000b, 0x0813,
+	0x0008, 0x8010, 0x0008, 0x000c, 0x000c, 0x035b, 0x0003, 0x0013,
+	0x0000, 0x8074, 0x0000, 0xf080, 0x0000, 0x0d30, 0x0002, 0x2e4d,
+	0x0002, 0x2e4d, 0x000b, 0x0bb5, 0x0008, 0x8054, 0x0000, 0x0019,
+	0x0003, 0x0013, 0x0008, 0x8054, 0x0008, 0x0009, 0x0003, 0x0013,
+	0x0002, 0x3a44, 0x0003, 0x8813, 0x0003, 0x0397, 0x0008, 0x808c,
+	0x0008, 0x0000, 0x0002, 0x4447, 0x0003, 0x0be1, 0x0001, 0xc0c0,
+	0x0008, 0x00ff, 0x0009, 0xffe0, 0x0008, 0x00ff, 0x000b, 0x8bb8,
+	0x0001, 0xc1e0, 0x0008, 0xffff, 0x000b, 0x8bb8, 0x0008, 0x8010,
+	0x0000, 0x0013, 0x000c, 0x035b, 0x0000, 0x8074, 0x0008, 0x0202,
+	0x0003, 0x0013, 0x000a, 0x3a40, 0x000b, 0x8bde, 0x0000, 0x8074,
+	0x0000, 0x0200, 0x0000, 0x3d00, 0x0000, 0x3cfe, 0x0000, 0x8072,
+	0x0000, 0x8000, 0x0001, 0x43e0, 0x0003, 0x8bdc, 0x0000, 0x42fe,
+	0x0001, 0xffc0, 0x0008, 0x00ff, 0x0009, 0x00e0, 0x0003, 0x0bb8,
+	0x0008, 0x0d08, 0x000b, 0x0431, 0x0000, 0x8072, 0x0000, 0x8000,
+	0x0003, 0x0013, 0x0004, 0x04b3, 0x0008, 0x808c, 0x0000, 0x0001,
+	0x0000, 0x04fc, 0x0003, 0x3496, 0x0000, 0x0460, 0x0008, 0x8062,
+	0x0000, 0x0001, 0x0000, 0x8066, 0x0008, 0x0009, 0x000b, 0xc3eb,
+	0x0000, 0x0004, 0x0009, 0x80c0, 0x0008, 0x00ff, 0x0000, 0x7f00,
+	0x0001, 0x80e0, 0x0000, 0x0004, 0x000b, 0x0c05, 0x0001, 0x80e0,
+	0x0008, 0x0005, 0x000b, 0x0c05, 0x0001, 0x80e0, 0x0008, 0x0006,
+	0x000b, 0x0c05, 0x0001, 0x82c0, 0x0008, 0xff00, 0x0008, 0x7f04,
+	0x0009, 0x82e0, 0x0008, 0x0600, 0x000b, 0x0c05, 0x0009, 0x82e0,
+	0x0008, 0x0500, 0x000b, 0x0c05, 0x0009, 0x82e0, 0x0000, 0x0400,
+	0x0003, 0x8c96, 0x0009, 0xc4c0, 0x0000, 0x7000, 0x0009, 0xffe0,
+	0x0000, 0x1000, 0x0003, 0x0c31, 0x0004, 0x04a4, 0x0002, 0x3941,
+	0x0003, 0x0c10, 0x0000, 0x8072, 0x0000, 0x0400, 0x0003, 0x0013,
+	0x0000, 0x0460, 0x0008, 0x80fe, 0x0008, 0x002b, 0x0008, 0x7f62,
+	0x0000, 0x8066, 0x0008, 0x2209, 0x000b, 0xc416, 0x0008, 0x11fc,
+	0x000b, 0x342c, 0x0001, 0x9180, 0x0000, 0x0002, 0x0000, 0x8060,
+	0x0000, 0x0400, 0x0008, 0x7f62, 0x0000, 0x8066, 0x0008, 0x0609,
+	0x000b, 0xc420, 0x0000, 0x42fe, 0x0001, 0xffc0, 0x0008, 0xff00,
+	0x0009, 0x03e0, 0x000b, 0x8c29, 0x0000, 0x8072, 0x0000, 0x0400,
+	0x0003, 0x0052, 0x0001, 0x9180, 0x0008, 0x0003, 0x000b, 0x0413,
+	0x0000, 0x8072, 0x0000, 0x0400, 0x0008, 0x8010, 0x0000, 0x0010,
+	0x000b, 0x0489, 0x0004, 0x04a4, 0x0002, 0x3941, 0x0003, 0x0c37,
+	0x0000, 0x8072, 0x0000, 0x0400, 0x0003, 0x0013, 0x0004, 0x046e,
+	0x0008, 0x11fc, 0x0003, 0x8c3f, 0x0000, 0x8072, 0x0000, 0x0400,
+	0x0008, 0x8010, 0x0000, 0x000e, 0x000b, 0x0489, 0x0000, 0x8060,
+	0x0000, 0x0400, 0x0000, 0x04fc, 0x000b, 0x8c54, 0x0008, 0x808c,
+	0x0008, 0x0000, 0x0001, 0x9180, 0x0008, 0x0005, 0x0008, 0x7f62,
+	0x0000, 0x8066, 0x0008, 0x0009, 0x000b, 0xc44a, 0x0008, 0x0060,
+	0x0008, 0x8062, 0x0008, 0x001b, 0x0008, 0x4304, 0x0008, 0x4206,
+	0x0000, 0x8066, 0x0000, 0x0412, 0x000b, 0xc452, 0x000b, 0x046b,
+	0x0008, 0x808c, 0x0000, 0x0001, 0x0000, 0x0460, 0x0008, 0x8062,
+	0x0008, 0x002b, 0x0000, 0x8066, 0x0008, 0x0609, 0x000b, 0xc45b,
+	0x0000, 0x8066, 0x0008, 0x220a, 0x000b, 0xc45e, 0x0000, 0x42fe,
+	0x0001, 0xffc0, 0x0008, 0xff00, 0x0008, 0x7f04, 0x0000, 0x8060,
+	0x0000, 0x0400, 0x0001, 0x9180, 0x0000, 0x0002, 0x0008, 0x7f62,
+	0x0000, 0x8066, 0x0008, 0x041a, 0x0003, 0xc46a, 0x0000, 0x8072,
+	0x0000, 0x0400, 0x0003, 0x0052, 0x0000, 0x8060, 0x0000, 0x0400,
+	0x0008, 0x6b62, 0x0000, 0x8066, 0x0000, 0x0411, 0x000b, 0xc473,
+	0x0008, 0x02fe, 0x0009, 0x03e0, 0x000b, 0x8c79, 0x0000, 0x0d22,
+	0x000f, 0x4000, 0x0009, 0x8280, 0x0000, 0x0002, 0x0001, 0x6b80,
+	0x0008, 0x7f62, 0x0000, 0x8066, 0x0008, 0x2209, 0x000b, 0xc47f,
+	0x000a, 0x0200, 0x0001, 0xffc0, 0x0000, 0x0007, 0x0000, 0x7f06,
+	0x0008, 0x6b62, 0x0000, 0x8066, 0x0008, 0x060a, 0x0003, 0xc487,
+	0x000f, 0x4000, 0x0002, 0x3a44, 0x0003, 0x8813, 0x000a, 0x2f44,
+	0x000a, 0x2f44, 0x0003, 0x8b97, 0x0008, 0x808a, 0x0008, 0x0003,
+	0x0000, 0x8074, 0x0000, 0xf080, 0x0003, 0x5c92, 0x0008, 0x8054,
+	0x0000, 0x0019, 0x0003, 0x0013, 0x0002, 0x3a44, 0x0003, 0x8813,
+	0x0008, 0x808c, 0x0008, 0x0000, 0x0008, 0x8010, 0x0008, 0x0011,
+	0x000c, 0x035b, 0x0000, 0x42fe, 0x0001, 0xffc0, 0x0008, 0x00ff,
+	0x0008, 0x7f10, 0x000c, 0x035b, 0x0008, 0x4310, 0x0003, 0x03a4,
+	0x0002, 0x3941, 0x0003, 0x0ca7, 0x000f, 0x4000, 0x0000, 0x8072,
+	0x0008, 0x0404, 0x000f, 0x4000, 0x0008, 0x8010, 0x0008, 0x0012,
+	0x000c, 0x035b, 0x0004, 0x046e, 0x0000, 0x1110, 0x000c, 0x035b,
+	0x0008, 0x11fc, 0x000b, 0x8cad, 0x0003, 0x0013, 0x0009, 0xc2c0,
+	0x0008, 0x00ff, 0x0000, 0x7f00, 0x0001, 0xc3c0, 0x0008, 0xff00,
+	0x0009, 0x00d0, 0x000b, 0x0cd8, 0x0000, 0x0d0a, 0x0001, 0x8580,
+	0x0000, 0x1000, 0x0008, 0x7f62, 0x0000, 0x8060, 0x0000, 0x0400,
+	0x0000, 0x8066, 0x0000, 0x0809, 0x000b, 0xc4c2, 0x0000, 0x04fc,
+	0x0003, 0x34d1, 0x0000, 0x0460, 0x0008, 0x8062, 0x0000, 0x0004,
+	0x0000, 0x8066, 0x0000, 0x0211, 0x0003, 0xc4ca, 0x0008, 0x01fe,
+	0x0009, 0x00e0, 0x0003, 0x8cd1, 0x0008, 0x02fe, 0x0001, 0x43e0,
+	0x000b, 0x0cd7, 0x0002, 0x0500, 0x0000, 0x7f0a, 0x0009, 0xffe0,
+	0x0000, 0x0800, 0x0003, 0x8cbb, 0x0008, 0x0d08, 0x000f, 0x4000,
+	0x0008, 0x43fe, 0x0001, 0x3e80, 0x0000, 0x0d60, 0x0008, 0x7f62,
+	0x0000, 0x8066, 0x0000, 0x0809, 0x0003, 0xc4de, 0x0000, 0x8060,
+	0x0000, 0x0400, 0x0001, 0x84c0, 0x0008, 0xff00, 0x0002, 0x7f70,
+	0x0009, 0xff80, 0x0000, 0x1000, 0x0008, 0x7f62, 0x0000, 0x8066,
+	0x0000, 0x0809, 0x000b, 0xc4e9, 0x000f, 0x4000, 0xe552, 0xe9f6
+};
+unsigned short rseqipx_code_length01 = 0x09d8;
+/*
+ *
+ */
+
+unsigned long xseqipx_code_addr01 = 0x0001e000 ;
+unsigned short xseqipx_code01[] = { 
+0x0013, 0x0003, 0x0000, 0x1082, 0x0001, 0xe000, 0x0005, 0x0032,
+	0x0000, 0x0010, 0x0015, 0x0033, 0x0010, 0xbb39, 0x000b, 0x8007,
+	0x0004, 0x010b, 0x0014, 0x011d, 0x0010, 0xc000, 0x0000, 0xc001,
+	0x0000, 0xc0b0, 0x0010, 0xc0b1, 0x0010, 0xc0b2, 0x0000, 0xc0b3,
+	0x0010, 0xc0b4, 0x0000, 0xc0b5, 0x0000, 0xc0b6, 0x0010, 0xc0b7,
+	0x0010, 0xc0b8, 0x0000, 0xc0b9, 0x0000, 0xc0ba, 0x0000, 0xc0c2,
+	0x0010, 0xc0c3, 0x0000, 0xc0c4, 0x0010, 0xc0c5, 0x0010, 0xc0c6,
+	0x0000, 0xc0c7, 0x0000, 0xc0c8, 0x0010, 0xc0c9, 0x0010, 0xc0ca,
+	0x0000, 0xc0cb, 0x0010, 0xc0cc, 0x0000, 0xc0cd, 0x0000, 0xc0ce,
+	0x0010, 0xc0cf, 0x0015, 0x0039, 0x0010, 0xff00, 0x0015, 0x003a,
+	0x0010, 0xff00, 0x0005, 0x00d0, 0x0010, 0xff00, 0x0015, 0x00d1,
+	0x0010, 0xff00, 0x0012, 0x3a40, 0x000b, 0x1031, 0x0002, 0x7940,
+	0x001b, 0x112f, 0x0002, 0x3a42, 0x001b, 0x1035, 0x0003, 0xb035,
+	0x0003, 0xa1d8, 0x0002, 0x3a41, 0x001b, 0x1039, 0x0012, 0x7941,
+	0x000b, 0x12f6, 0x0003, 0xe055, 0x0012, 0xd042, 0x0003, 0x103f,
+	0x0000, 0x75ff, 0x0002, 0xff41, 0x001b, 0x1055, 0x0000, 0x0cfe,
+	0x0003, 0x6049, 0x0002, 0x3a44, 0x000b, 0x1049, 0x0011, 0x02e8,
+	0x0010, 0x0000, 0x0013, 0x1383, 0x0011, 0x02e8, 0x0010, 0x0005,
+	0x0003, 0x1413, 0x0012, 0x3a46, 0x001b, 0x1055, 0x0012, 0xd042,
+	0x0003, 0x1050, 0x0000, 0x75ff, 0x0012, 0xff40, 0x001b, 0x1055,
+	0x0000, 0x12fe, 0x0013, 0x6055, 0x0001, 0x0fe8, 0x0010, 0x0000,
+	0x0013, 0x1619, 0x0015, 0x0030, 0x0000, 0x0400, 0x0010, 0xc131,
+	0x0015, 0x0033, 0x0010, 0xb211, 0x001b, 0x805a, 0x0010, 0xb2ff,
+	0x0001, 0xb3e0, 0x001c, 0x10cd, 0x000b, 0xf02d, 0x0011, 0x3be8,
+	0x0000, 0x0010, 0x001b, 0x1072, 0x0000, 0x0afe, 0x000b, 0x6066,
+	0x0000, 0x3c0b, 0x0003, 0x006e, 0x0015, 0x0030, 0x0000, 0x0400,
+	0x0001, 0x0a88, 0x0010, 0x0003, 0x0000, 0xff31, 0x0015, 0x0033,
+	0x0010, 0x3c0a, 0x000b, 0x806d, 0x0010, 0x3c0a, 0x0002, 0x0c00,
+	0x0010, 0xff0c, 0x0013, 0x00ca, 0x0011, 0x3be8, 0x0010, 0x0012,
+	0x000b, 0x1085, 0x0010, 0x08fe, 0x001b, 0x6079, 0x0010, 0x3c09,
+	0x0013, 0x0081, 0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x0888,
+	0x0010, 0x0003, 0x0000, 0xff31, 0x0015, 0x0033, 0x0010, 0x3c0a,
+	0x000b, 0x8080, 0x0000, 0x3c08, 0x0002, 0x0c00, 0x0010, 0xff0c,
+	0x0013, 0x00ca, 0x0011, 0x3be8, 0x0000, 0x0013, 0x001b, 0x108b,
+	0x0000, 0x3cb0, 0x0004, 0x00dd, 0x0013, 0x00ca, 0x0011, 0x3be8,
+	0x0000, 0x0019, 0x000b, 0x109e, 0x0010, 0x04fe, 0x001b, 0x6092,
+	0x0010, 0x3c05, 0x0013, 0x009a, 0x0015, 0x0030, 0x0000, 0x0400,
+	0x0011, 0x0488, 0x0010, 0x0003, 0x0000, 0xff31, 0x0015, 0x0033,
+	0x0010, 0x3c0a, 0x001b, 0x8099, 0x0000, 0x3c04, 0x0002, 0x0c00,
+	0x0010, 0xff0c, 0x0013, 0x00ca, 0x0011, 0x3be8, 0x0000, 0x0015,
+	0x001b, 0x10aa, 0x0014, 0x0114, 0x0004, 0x0126, 0x0015, 0x0039,
+	0x0000, 0x8000, 0x0017, 0x8000, 0x0004, 0x010b, 0x0014, 0x011d,
+	0x0004, 0x00f6, 0x0013, 0x002d, 0x0011, 0x3be8, 0x0000, 0x0016,
+	0x000b, 0x10bc, 0x0001, 0x0fe8, 0x0010, 0x0000, 0x0013, 0x10b6,
+	0x0001, 0x0fe8, 0x0000, 0x0002, 0x0013, 0x10b6, 0x0015, 0x0039,
+	0x0010, 0x1010, 0x0013, 0x00ca, 0x0015, 0x0039, 0x0000, 0x5040,
+	0x0015, 0x00b8, 0x0000, 0x0008, 0x0004, 0x083d, 0x0013, 0x00ca,
+	0x0011, 0x3be8, 0x0010, 0x0017, 0x000b, 0x10c1, 0x0010, 0x3cc3,
+	0x0013, 0x00ca, 0x0011, 0x3be8, 0x0010, 0x0018, 0x001b, 0x10c6,
+	0x0000, 0x3cc2, 0x0013, 0x00ca, 0x0005, 0x00ce, 0x0000, 0x0001,
+	0x0000, 0x3bcf, 0x0004, 0x0801, 0x0015, 0x0039, 0x0000, 0x8000,
+	0x0013, 0x002d, 0x0001, 0xb288, 0x0000, 0x0002, 0x0001, 0xc180,
+	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb009, 0x000b, 0x80d3,
+	0x0002, 0xb200, 0x0011, 0xffc8, 0x0000, 0x0007, 0x0010, 0xffb2,
+	0x0010, 0xc131, 0x0015, 0x0033, 0x0010, 0xb20a, 0x0001, 0xb0d0,
+	0x000b, 0x80dc, 0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0xb088,
+	0x0000, 0x0010, 0x0000, 0xff31, 0x0015, 0x0033, 0x0010, 0xb109,
+	0x001b, 0x80e4, 0x0001, 0xb1e8, 0x0010, 0xffff, 0x0003, 0x10f5,
+	0x0000, 0x11fe, 0x001b, 0x60ec, 0x0000, 0xb012, 0x0003, 0x00f4,
+	0x0015, 0x0030, 0x0000, 0x0400, 0x0001, 0x1188, 0x0010, 0x0003,
+	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb00a, 0x001b, 0x80f3,
+	0x0000, 0xb011, 0x0017, 0x4000, 0x0015, 0x0030, 0x0000, 0x0400,
+	0x0011, 0xbc88, 0x0000, 0x001f, 0x0000, 0xff31, 0x0015, 0x0033,
+	0x0000, 0xc411, 0x000b, 0x80fd, 0x0011, 0xbc88, 0x0010, 0x0018,
+	0x0000, 0xff31, 0x0015, 0x0033, 0x0010, 0xc609, 0x000b, 0x8103,
+	0x0011, 0xbc88, 0x0000, 0x0037, 0x0000, 0xff31, 0x0015, 0x0033,
+	0x0000, 0xc709, 0x000b, 0x8109, 0x0017, 0x4000, 0x0015, 0x0030,
+	0x0000, 0x0400, 0x0001, 0xbb88, 0x0000, 0x0001, 0x0000, 0xff31,
+	0x0015, 0x0033, 0x0000, 0x0269, 0x000b, 0x8112, 0x0017, 0x4000,
+	0x0015, 0x0030, 0x0000, 0x0400, 0x0001, 0xbb88, 0x0000, 0x0001,
+	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0x026a, 0x000b, 0x811b,
+	0x0017, 0x4000, 0x0015, 0x0030, 0x0000, 0x0400, 0x0001, 0xbb88,
+	0x0010, 0x000f, 0x0000, 0xff31, 0x0015, 0x0033, 0x0010, 0x0f59,
+	0x000b, 0x8124, 0x0017, 0x4000, 0x0015, 0x0030, 0x0000, 0x0400,
+	0x0001, 0xbb88, 0x0010, 0x000f, 0x0000, 0xff31, 0x0015, 0x0033,
+	0x0010, 0x0f5a, 0x000b, 0x812d, 0x0017, 0x4000, 0x0000, 0xd0ff,
+	0x0012, 0xff40, 0x000b, 0x1031, 0x0015, 0x00d1, 0x0010, 0x0101,
+	0x0013, 0x9134, 0x0005, 0x0079, 0x0000, 0x0001, 0x0013, 0x9137,
+	0x0015, 0x00d1, 0x0000, 0x0100, 0x0011, 0x02e8, 0x0000, 0x0002,
+	0x0003, 0x115d, 0x0011, 0x02e8, 0x0000, 0x0001, 0x0003, 0x1175,
+	0x0011, 0x02e8, 0x0000, 0x0004, 0x0013, 0x1193, 0x0011, 0x02e8,
+	0x0010, 0x0003, 0x0003, 0x11c4, 0x0005, 0x0002, 0x0010, 0x0000,
+	0x0000, 0xc00e, 0x0000, 0xc00d, 0x0010, 0xc003, 0x0015, 0x0030,
+	0x0000, 0x0400, 0x0001, 0xbd88, 0x0010, 0x0009, 0x0000, 0xff31,
+	0x0015, 0x0033, 0x0010, 0xc00a, 0x001b, 0x8152, 0x0012, 0x3a45,
+	0x0013, 0x115a, 0x0015, 0x003a, 0x0000, 0x2000, 0x0015, 0x003a,
+	0x0010, 0x1010, 0x0004, 0x0829, 0x0012, 0xd042, 0x0013, 0x1031,
+	0x0013, 0x0050, 0x0012, 0x7849, 0x0013, 0x11d2, 0x0010, 0x0dfe,
+	0x0003, 0x6148, 0x0012, 0x0c10, 0x0010, 0xff0c, 0x0015, 0x0030,
+	0x0000, 0x0400, 0x0011, 0x0d88, 0x0010, 0x0003, 0x0000, 0xff31,
+	0x0015, 0x0033, 0x0000, 0xb309, 0x000b, 0x816a, 0x0010, 0xb3fe,
+	0x0003, 0x6172, 0x0010, 0xb30b, 0x0015, 0x0033, 0x0010, 0xc00a,
+	0x001b, 0x8170, 0x0013, 0x01c7, 0x0000, 0xc00b, 0x0010, 0xc00a,
+	0x0013, 0x01c7, 0x0000, 0x78b0, 0x0012, 0xb044, 0x0013, 0x11d2,
+	0x0002, 0xb049, 0x0013, 0x11d2, 0x0010, 0x71ff, 0x0012, 0xff38,
+	0x0010, 0xff71, 0x0010, 0x0dfe, 0x0013, 0x6146, 0x0012, 0x0c10,
+	0x0010, 0xff0c, 0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x0d88,
+	0x0010, 0x0003, 0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb309,
+	0x000b, 0x8188, 0x0010, 0xb3fe, 0x0003, 0x6190, 0x0000, 0xb309,
+	0x0015, 0x0033, 0x0010, 0xc00a, 0x000b, 0x818e, 0x0013, 0x01c7,
+	0x0010, 0xc009, 0x0000, 0xc008, 0x0013, 0x01c7, 0x0000, 0x78b0,
+	0x0012, 0xb044, 0x0013, 0x11d2, 0x0002, 0xb049, 0x0013, 0x11d2,
+	0x0010, 0x71ff, 0x0012, 0xff38, 0x0010, 0xff71, 0x0010, 0x0dfe,
+	0x0013, 0x6146, 0x0012, 0x0c10, 0x0010, 0xff0c, 0x0015, 0x0030,
+	0x0000, 0x0400, 0x0011, 0x0d88, 0x0010, 0x0003, 0x0000, 0xff31,
+	0x0015, 0x0033, 0x0000, 0xb309, 0x000b, 0x81a6, 0x0010, 0xb3fe,
+	0x0013, 0x61ae, 0x0000, 0xb305, 0x0015, 0x0033, 0x0010, 0xc00a,
+	0x000b, 0x81ac, 0x0013, 0x01b0, 0x0010, 0xc005, 0x0000, 0xc004,
+	0x0002, 0x033f, 0x0002, 0xff27, 0x0000, 0x0db8, 0x0004, 0x0378,
+	0x0000, 0x0db8, 0x0004, 0x083d, 0x0015, 0x0030, 0x0000, 0x0400,
+	0x0011, 0xbc88, 0x0010, 0x0000, 0x0000, 0xff31, 0x0015, 0x0033,
+	0x0000, 0xb309, 0x000b, 0x81bd, 0x0011, 0xb3e8, 0x0000, 0x0002,
+	0x001b, 0x1146, 0x0005, 0x0002, 0x0010, 0x0005, 0x0003, 0x0148,
+	0x0012, 0x7849, 0x0013, 0x11d2, 0x0003, 0x0148, 0x0000, 0x0db8,
+	0x0012, 0x0345, 0x001b, 0x11cd, 0x0002, 0x033f, 0x0004, 0x0378,
+	0x0013, 0x0146, 0x0002, 0x033f, 0x0002, 0xff27, 0x0004, 0x0378,
+	0x0004, 0x083d, 0x0013, 0x0146, 0x0015, 0x00b8, 0x0000, 0x0001,
+	0x0015, 0x003a, 0x0010, 0x0101, 0x0004, 0x083d, 0x0003, 0x0153,
+	0x0000, 0x2bba, 0x0003, 0xb1d9, 0x0005, 0x002a, 0x0000, 0x0002,
+	0x0001, 0xbac8, 0x0000, 0x0700, 0x000b, 0x12b1, 0x0011, 0x15e8,
+	0x0000, 0x0002, 0x0003, 0x122c, 0x0011, 0x15e8, 0x0000, 0x0001,
+	0x0013, 0x11e8, 0x0005, 0x0015, 0x0010, 0x0000, 0x0003, 0x020f,
+	0x0005, 0x0015, 0x0010, 0x0000, 0x0002, 0xba43, 0x0003, 0x1210,
+	0x0003, 0xb1ec, 0x0005, 0x002a, 0x0000, 0x0004, 0x0012, 0xba42,
+	0x0003, 0x1216, 0x0012, 0x104b, 0x000b, 0x120f, 0x0000, 0x1a30,
+	0x0005, 0x0031, 0x0000, 0x0002, 0x0015, 0x0033, 0x0000, 0x1b2a,
+	0x001b, 0x81f8, 0x0010, 0x20b0, 0x0010, 0x21b1, 0x0010, 0x22b2,
+	0x0010, 0x23b3, 0x0010, 0x24b4, 0x0010, 0x25b5, 0x0010, 0x28b8,
+	0x0010, 0x29b9, 0x0000, 0x1a30, 0x0005, 0x0031, 0x0000, 0x0007,
+	0x0015, 0x0033, 0x0010, 0xb032, 0x000b, 0x8206, 0x0000, 0x1a30,
+	0x0005, 0x0031, 0x0010, 0x000f, 0x0015, 0x0033, 0x0010, 0xb812,
+	0x000b, 0x820c, 0x0005, 0x0015, 0x0010, 0x0000, 0x0013, 0x0035,
+	0x0000, 0x1efe, 0x0003, 0x6224, 0x0014, 0x0256, 0x0000, 0x1efe,
+	0x000c, 0x6256, 0x0003, 0x020f, 0x0000, 0x1a30, 0x0005, 0x0031,
+	0x0000, 0x0020, 0x0015, 0x0033, 0x0000, 0xb009, 0x000b, 0x821b,
+	0x0002, 0xb02f, 0x0000, 0xffb0, 0x0005, 0x0031, 0x0000, 0x0020,
+	0x0015, 0x0033, 0x0000, 0xb00a, 0x000b, 0x8222, 0x0003, 0x01f3,
+	0x0015, 0x00b8, 0x0010, 0x0005, 0x0004, 0x083d, 0x0000, 0x13b8,
+	0x0015, 0x003a, 0x0010, 0x0404, 0x0004, 0x083d, 0x0003, 0x020f,
+	0x0005, 0x0015, 0x0000, 0x0001, 0x0012, 0xba42, 0x0013, 0x1239,
+	0x0013, 0xb230, 0x0010, 0x2bff, 0x0012, 0xff4f, 0x000b, 0x11d8,
+	0x0002, 0xba43, 0x001b, 0x1216, 0x0000, 0x1efe, 0x000c, 0x6256,
+	0x0003, 0x020f, 0x0010, 0x28b8, 0x0010, 0x29b9, 0x0004, 0x02c7,
+	0x0002, 0x3a42, 0x000b, 0x120f, 0x0000, 0x1c30, 0x0015, 0x00ff,
+	0x0000, 0x0002, 0x0002, 0x1f43, 0x001b, 0x1246, 0x0001, 0xff88,
+	0x0000, 0x0002, 0x0003, 0x0248, 0x0001, 0xff88, 0x0000, 0x0004,
+	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb011, 0x000b, 0x824b,
+	0x0000, 0xb0ff, 0x0011, 0x16a0, 0x0000, 0xff16, 0x000b, 0x24e2,
+	0x0002, 0xb100, 0x0003, 0x0253, 0x0010, 0xb1ff, 0x0001, 0x17a0,
+	0x0010, 0xff17, 0x0013, 0x0216, 0x0000, 0x16ff, 0x0001, 0x18a0,
+	0x0010, 0xff00, 0x001b, 0x225d, 0x0002, 0x1700, 0x0003, 0x12b0,
+	0x0013, 0x025e, 0x0010, 0x17ff, 0x0011, 0x19a0, 0x0003, 0x22b0,
+	0x0011, 0x00d0, 0x0003, 0x12b0, 0x0000, 0x1c30, 0x0000, 0x1b31,
+	0x0015, 0x0033, 0x0000, 0xb131, 0x000b, 0x8266, 0x0003, 0xb267,
+	0x0000, 0xb120, 0x0010, 0xb221, 0x0002, 0x1f43, 0x001b, 0x1273,
+	0x0010, 0xc022, 0x0000, 0xc023, 0x0000, 0xb324, 0x0000, 0xb425,
+	0x0010, 0xb3b5, 0x0000, 0xb4b6, 0x0003, 0x0277, 0x0000, 0xb322,
+	0x0000, 0xb423, 0x0000, 0xb524, 0x0010, 0xb625, 0x0013, 0xb277,
+	0x0005, 0x002a, 0x0000, 0x0001, 0x0012, 0x1500, 0x0000, 0xff15,
+	0x0000, 0x16ff, 0x0001, 0xb580, 0x0000, 0xff16, 0x000b, 0x2282,
+	0x0002, 0x1700, 0x0013, 0x0283, 0x0010, 0x17ff, 0x0001, 0xb680,
+	0x0010, 0xff17, 0x0012, 0x1e10, 0x0010, 0xff1e, 0x0013, 0x62b0,
+	0x0002, 0x1d00, 0x0010, 0xff1d, 0x0010, 0xc030, 0x0000, 0xff31,
+	0x0015, 0x0033, 0x0000, 0xb009, 0x000b, 0x828e, 0x0010, 0xb0fe,
+	0x001b, 0x62af, 0x0000, 0x1c30, 0x0005, 0x0031, 0x0000, 0x0001,
+	0x0015, 0x0033, 0x0000, 0xb009, 0x000b, 0x8296, 0x0010, 0xb0fe,
+	0x001b, 0x629c, 0x0005, 0x00ce, 0x0010, 0x0005, 0x0013, 0x0801,
+	0x0010, 0xb01c, 0x0000, 0x1c30, 0x0005, 0x0031, 0x0000, 0x0019,
+	0x0015, 0x0033, 0x0000, 0xb009, 0x001b, 0x82a2, 0x0001, 0xb0c8,
+	0x0010, 0x00ff, 0x0000, 0xff1f, 0x0010, 0xc030, 0x0011, 0xbe80,
+	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb009, 0x001b, 0x82ab,
+	0x0000, 0xb01d, 0x0010, 0x1dff, 0x0013, 0x028a, 0x0000, 0xb01b,
+	0x0017, 0x4000, 0x0002, 0x3a41, 0x0003, 0x12b9, 0x0003, 0xb2b3,
+	0x0005, 0x002a, 0x0000, 0x0004, 0x0005, 0x0015, 0x0010, 0x0000,
+	0x0003, 0x020f, 0x0000, 0x1a30, 0x0005, 0x0031, 0x0000, 0x0002,
+	0x0015, 0x0033, 0x0000, 0x1b2a, 0x000b, 0x82be, 0x0015, 0x00b8,
+	0x0000, 0x0004, 0x0004, 0x083d, 0x0000, 0x13b8, 0x0015, 0x003a,
+	0x0010, 0x0404, 0x0004, 0x083d, 0x0013, 0x0039, 0x0002, 0x1e00,
+	0x0010, 0xff1e, 0x0012, 0x1d10, 0x0010, 0xff1d, 0x0010, 0xc030,
+	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb009, 0x000b, 0x82cf,
+	0x0010, 0xb0fe, 0x000b, 0x62f4, 0x0000, 0x1cff, 0x0001, 0x1ae0,
+	0x0013, 0x12de, 0x0000, 0x1c30, 0x0005, 0x0031, 0x0010, 0x0000,
+	0x0015, 0x0033, 0x0000, 0xb009, 0x001b, 0x82da, 0x0010, 0xb0fe,
+	0x001b, 0x62de, 0x0000, 0x1aff, 0x0000, 0xff1c, 0x0000, 0x1c30,
+	0x0005, 0x0031, 0x0000, 0x0019, 0x0015, 0x0033, 0x0000, 0xb009,
+	0x000b, 0x82e4, 0x0001, 0xb0c8, 0x0010, 0x000f, 0x0000, 0xff1f,
+	0x0001, 0xbf80, 0x0010, 0xff1d, 0x0010, 0xc030, 0x0000, 0xff31,
+	0x0015, 0x0033, 0x0000, 0xb009, 0x000b, 0x82ee, 0x0010, 0xb0fe,
+	0x000b, 0x62f4, 0x0005, 0x00ce, 0x0010, 0x0006, 0x0013, 0x0801,
+	0x0000, 0xb01b, 0x0017, 0x4000, 0x0010, 0x79b0, 0x0000, 0xd0ff,
+	0x0012, 0xff40, 0x001b, 0x1039, 0x0015, 0x00d1, 0x0010, 0x0101,
+	0x0003, 0x92fc, 0x0005, 0x0079, 0x0000, 0x0002, 0x0003, 0x92ff,
+	0x0015, 0x00d1, 0x0000, 0x0100, 0x0010, 0x13fe, 0x0003, 0x6334,
+	0x0012, 0xb04e, 0x001b, 0x1350, 0x0012, 0x784a, 0x0003, 0x1356,
+	0x0000, 0x75ff, 0x0011, 0xffc8, 0x0010, 0x1800, 0x001b, 0x1356,
+	0x0001, 0x0fe8, 0x0000, 0x0001, 0x001b, 0x1318, 0x0015, 0x0030,
+	0x0000, 0x0400, 0x0011, 0x1388, 0x0000, 0x000e, 0x0000, 0xff31,
+	0x0015, 0x0033, 0x0000, 0x8f0a, 0x000b, 0x8316, 0x0013, 0x035c,
+	0x0001, 0x0fe8, 0x0000, 0x0002, 0x000b, 0x1323, 0x0015, 0x0030,
+	0x0000, 0x0400, 0x0005, 0x0031, 0x0000, 0x001a, 0x0015, 0x0033,
+	0x0010, 0xc00a, 0x001b, 0x8321, 0x0013, 0x035c, 0x0001, 0x0fe8,
+	0x0010, 0x0000, 0x0013, 0x132a, 0x0005, 0x00ce, 0x0000, 0x0007,
+	0x0010, 0x0fcf, 0x0013, 0x07fb, 0x0000, 0x13b8, 0x0002, 0x1045,
+	0x0013, 0x1332, 0x0012, 0x103f, 0x0002, 0xff27, 0x0004, 0x0378,
+	0x0004, 0x083d, 0x0003, 0x0334, 0x0012, 0x103f, 0x0004, 0x0378,
+	0x0015, 0x000f, 0x0010, 0x0000, 0x0002, 0x3944, 0x0013, 0x133d,
+	0x0015, 0x0039, 0x0000, 0x5040, 0x0015, 0x00b8, 0x0000, 0x0008,
+	0x0004, 0x083d, 0x0015, 0x0030, 0x0000, 0x0400, 0x0001, 0xbd88,
+	0x0010, 0x000c, 0x0000, 0xff31, 0x0015, 0x0033, 0x0010, 0xc00a,
+	0x001b, 0x8344, 0x0010, 0xc014, 0x0000, 0xc013, 0x0000, 0xc010,
+	0x0002, 0x3a47, 0x0013, 0x134f, 0x0015, 0x003a, 0x0000, 0x8000,
+	0x0015, 0x003a, 0x0010, 0x4040, 0x0014, 0x0806, 0x0013, 0x0039,
+	0x0015, 0x00b8, 0x0010, 0x0003, 0x0015, 0x003a, 0x0010, 0x0202,
+	0x0004, 0x083d, 0x0013, 0x0348, 0x0015, 0x00b8, 0x0000, 0x0002,
+	0x0015, 0x003a, 0x0010, 0x0202, 0x0004, 0x083d, 0x0013, 0x0348,
+	0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x1388, 0x0010, 0x0003,
+	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb009, 0x001b, 0x8363,
+	0x0011, 0x1388, 0x0010, 0x0003, 0x0000, 0xff31, 0x0015, 0x0033,
+	0x0010, 0xc00a, 0x001b, 0x8369, 0x0010, 0xb0fe, 0x0003, 0x636e,
+	0x0000, 0xb012, 0x0003, 0x0370, 0x0010, 0xc012, 0x0010, 0xc011,
+	0x0012, 0x104b, 0x0013, 0x132a, 0x0002, 0x103b, 0x0010, 0xff03,
+	0x0005, 0x0002, 0x0010, 0x0000, 0x0000, 0xc00d, 0x0003, 0x032a,
+	0x0000, 0xffb0, 0x0010, 0xc3b1, 0x0015, 0x0030, 0x0000, 0x0400,
+	0x0001, 0xb888, 0x0010, 0x0011, 0x0000, 0xff31, 0x0015, 0x0033,
+	0x0000, 0xb012, 0x001b, 0x8381, 0x0017, 0x4000, 0x0012, 0x3a43,
+	0x0013, 0x1392, 0x0015, 0x003a, 0x0000, 0x0800, 0x0010, 0x0db0,
+	0x0003, 0x6392, 0x0000, 0x0bff, 0x0001, 0xb0e0, 0x0003, 0x13bb,
+	0x0010, 0x09ff, 0x0001, 0xb0e0, 0x0003, 0x139f, 0x0010, 0x05ff,
+	0x0001, 0xb0e0, 0x0003, 0x1396, 0x0000, 0xc00e, 0x0000, 0x05fe,
+	0x0013, 0x639c, 0x0000, 0x050d, 0x0005, 0x0002, 0x0000, 0x0004,
+	0x0014, 0x041d, 0x0002, 0x3a47, 0x001b, 0x141c, 0x0003, 0x03b6,
+	0x0000, 0x09fe, 0x0013, 0x63b8, 0x0000, 0x090d, 0x0005, 0x0002,
+	0x0000, 0x0001, 0x0014, 0x0436, 0x0015, 0x0030, 0x0000, 0x0400,
+	0x0011, 0x0d88, 0x0000, 0x0004, 0x0000, 0xff31, 0x0015, 0x0033,
+	0x0000, 0xba09, 0x001b, 0x83a9, 0x0011, 0x03c8, 0x0010, 0x000f,
+	0x0000, 0xffb6, 0x0011, 0xb6e8, 0x0000, 0x0001, 0x0013, 0x14ca,
+	0x0011, 0xb6e8, 0x0000, 0x0002, 0x0003, 0x14ec, 0x0011, 0xb6e8,
+	0x0010, 0x0003, 0x0003, 0x15d7, 0x0014, 0x0806, 0x0013, 0x041c,
+	0x0010, 0x0bfe, 0x0013, 0x641c, 0x0010, 0x0b0d, 0x0005, 0x0002,
+	0x0000, 0x0002, 0x0014, 0x0436, 0x0015, 0x0030, 0x0000, 0x0400,
+	0x0011, 0x0d88, 0x0000, 0x0004, 0x0000, 0xff31, 0x0015, 0x0033,
+	0x0000, 0xba09, 0x001b, 0x83c5, 0x0000, 0xb930, 0x0005, 0x0031,
+	0x0010, 0x0021, 0x0015, 0x0033, 0x0000, 0xb009, 0x000b, 0x83cb,
+	0x0001, 0xb0a8, 0x0000, 0x199a, 0x0003, 0x23d1, 0x0005, 0x00b0,
+	0x0000, 0x1999, 0x0012, 0xb050, 0x0000, 0xffb0, 0x0002, 0xff50,
+	0x0002, 0xff50, 0x0001, 0xb080, 0x0000, 0xffb0, 0x0015, 0x0030,
+	0x0000, 0x0400, 0x0011, 0x0d88, 0x0010, 0x0006, 0x0000, 0xff31,
+	0x0015, 0x0033, 0x0000, 0xb00a, 0x001b, 0x83de, 0x0000, 0xb930,
+	0x0005, 0x0031, 0x0000, 0x0019, 0x0015, 0x0033, 0x0000, 0xb009,
+	0x001b, 0x83e4, 0x0001, 0xb0c8, 0x0010, 0x00ff, 0x0001, 0xffe8,
+	0x0010, 0x0048, 0x001b, 0x1445, 0x0005, 0x0002, 0x0010, 0x0006,
+	0x0012, 0x0c10, 0x0010, 0xff0c, 0x0015, 0x0030, 0x0000, 0x0400,
+	0x0011, 0x0d88, 0x0010, 0x0003, 0x0000, 0xff31, 0x0015, 0x0033,
+	0x0010, 0xb109, 0x001b, 0x83f5, 0x0000, 0xb10b, 0x000b, 0x63f9,
+	0x0010, 0xb10a, 0x0015, 0x0033, 0x0010, 0xc00a, 0x000b, 0x83fb,
+	0x0002, 0x032b, 0x0010, 0xff03, 0x0011, 0x0d88, 0x0010, 0x0011,
+	0x0000, 0xff31, 0x0015, 0x0033, 0x0010, 0x030a, 0x000b, 0x8403,
+	0x0000, 0x11fe, 0x000b, 0x6408, 0x0000, 0x0d12, 0x0003, 0x0411,
+	0x0015, 0x0030, 0x0000, 0x0400, 0x0001, 0x1188, 0x0010, 0x0003,
+	0x0000, 0xff31, 0x0010, 0x0db0, 0x0015, 0x0033, 0x0000, 0xb00a,
+	0x001b, 0x8410, 0x0000, 0x0d11, 0x0013, 0x041c, 0x0000, 0x05fe,
+	0x0013, 0x641c, 0x0005, 0x0002, 0x0000, 0x0004, 0x0000, 0x050d,
+	0x0014, 0x041d, 0x0002, 0x3a47, 0x001b, 0x141c, 0x0014, 0x0806,
+	0x0003, 0x0049, 0x0001, 0xc7c8, 0x0010, 0x0028, 0x000b, 0x1435,
+	0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x0d88, 0x0010, 0x000a,
+	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb009, 0x000b, 0x8427,
+	0x0002, 0xb04f, 0x0013, 0x1435, 0x0001, 0x0fe8, 0x0010, 0x0000,
+	0x0013, 0x1433, 0x0001, 0x0fe8, 0x0000, 0x0002, 0x0013, 0x1433,
+	0x0015, 0x003a, 0x0010, 0x8080, 0x0003, 0x0435, 0x0015, 0x003a,
+	0x0010, 0x4040, 0x0017, 0x4000, 0x0015, 0x0030, 0x0000, 0x0400,
+	0x0011, 0x0d88, 0x0010, 0x0011, 0x0000, 0xff31, 0x0015, 0x0033,
+	0x0010, 0x0309, 0x001b, 0x843d, 0x0011, 0x0d88, 0x0010, 0x0005,
+	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb909, 0x001b, 0x8443,
+	0x0017, 0x4000, 0x0005, 0x00b6, 0x0010, 0x0600, 0x0014, 0x0607,
+	0x0014, 0x04b4, 0x0000, 0xb05a, 0x0000, 0xb15b, 0x0005, 0x0054,
+	0x0010, 0x0829, 0x0010, 0x0d58, 0x0015, 0x0059, 0x0010, 0xffff,
+	0x0000, 0xb930, 0x0005, 0x0031, 0x0010, 0x001e, 0x0015, 0x0033,
+	0x0000, 0xb009, 0x000b, 0x8455, 0x0000, 0xb05c, 0x0005, 0x0031,
+	0x0000, 0x001f, 0x0015, 0x0033, 0x0000, 0xb009, 0x001b, 0x845b,
+	0x0001, 0xb0c8, 0x0010, 0x000f, 0x001b, 0x1462, 0x0015, 0x00ff,
+	0x0010, 0x0005, 0x0003, 0x046a, 0x0002, 0xb040, 0x0003, 0x1467,
+	0x0015, 0x00ff, 0x0000, 0x0004, 0x0003, 0x046a, 0x0001, 0xb0c8,
+	0x0010, 0x0006, 0x0002, 0xff60, 0x0010, 0xffb2, 0x0011, 0x0d88,
+	0x0000, 0x0019, 0x0000, 0xff31, 0x0015, 0x0033, 0x0010, 0xb109,
+	0x001b, 0x8470, 0x0012, 0xb170, 0x0011, 0xffc8, 0x0010, 0xff00,
+	0x0011, 0xb2d0, 0x0010, 0xff60, 0x0002, 0xb045, 0x0013, 0x147b,
+	0x0015, 0x00b2, 0x0000, 0x0002, 0x0013, 0x0485, 0x0002, 0xb046,
+	0x0003, 0x1480, 0x0015, 0x00b2, 0x0000, 0x0001, 0x0013, 0x0485,
+	0x0015, 0x00b2, 0x0010, 0x0000, 0x0000, 0xc0b0, 0x0010, 0xc0b1,
+	0x0003, 0x048b, 0x0000, 0xb930, 0x0005, 0x0031, 0x0010, 0x002b,
+	0x0015, 0x0033, 0x0000, 0xb011, 0x001b, 0x848a, 0x0010, 0xb16a,
+	0x0010, 0xb06b, 0x0000, 0xb261, 0x0015, 0x0044, 0x0010, 0x0018,
+	0x0005, 0x0031, 0x0000, 0x0023, 0x0015, 0x0033, 0x0000, 0x6241,
+	0x001b, 0x8494, 0x0003, 0x9495, 0x0015, 0x00a0, 0x0000, 0x0020,
+	0x0012, 0xd041, 0x001b, 0x1498, 0x0015, 0x00d1, 0x0010, 0x0202,
+	0x0003, 0x949c, 0x0000, 0x75ff, 0x0011, 0xffc8, 0x0000, 0x1804,
+	0x0001, 0xffd8, 0x0010, 0x0009, 0x0013, 0x94a2, 0x0000, 0xff75,
+	0x0013, 0x94a4, 0x0015, 0x00d1, 0x0000, 0x0200, 0x0015, 0x0030,
+	0x0000, 0x0400, 0x0001, 0xbd88, 0x0000, 0x0008, 0x0000, 0xff31,
+	0x0015, 0x00b1, 0x0010, 0x07d0, 0x0005, 0x00b0, 0x0010, 0x0009,
+	0x0015, 0x0033, 0x0000, 0xb012, 0x000b, 0x84b2, 0x0013, 0x041c,
+	0x0000, 0xba30, 0x0005, 0x0031, 0x0010, 0x0035, 0x0015, 0x0033,
+	0x0000, 0xb009, 0x001b, 0x84b9, 0x0002, 0xb040, 0x0003, 0x14c7,
+	0x0000, 0xb7b0, 0x0000, 0xb9b1, 0x0015, 0x0030, 0x0000, 0x0400,
+	0x0011, 0x0d88, 0x0000, 0x0013, 0x0000, 0xff31, 0x0015, 0x0033,
+	0x0000, 0xb012, 0x000b, 0x84c5, 0x0003, 0x04c9, 0x0010, 0xc0b1,
+	0x0000, 0xc0b0, 0x0017, 0x4000, 0x0005, 0x00b6, 0x0010, 0x0500,
+	0x0014, 0x0607, 0x0005, 0x0054, 0x0010, 0x0889, 0x0015, 0x0030,
+	0x0000, 0x0400, 0x0011, 0x0d88, 0x0000, 0x0002, 0x0000, 0xff31,
+	0x0015, 0x0033, 0x0000, 0xb009, 0x001b, 0x84d6, 0x0010, 0xb058,
+	0x0000, 0x0d59, 0x0000, 0xb930, 0x0005, 0x0031, 0x0000, 0x0023,
+	0x0015, 0x0033, 0x0000, 0xb011, 0x000b, 0x84de, 0x0010, 0xb15c,
+	0x0010, 0xb05d, 0x0005, 0x0031, 0x0010, 0x002b, 0x0015, 0x0033,
+	0x0000, 0xb011, 0x001b, 0x84e5, 0x0000, 0xb15e, 0x0000, 0xb05f,
+	0x0003, 0x94e8, 0x0015, 0x00a0, 0x0010, 0x000c, 0x0003, 0x05ec,
+	0x0005, 0x00b6, 0x0000, 0x0700, 0x0014, 0x0607, 0x0015, 0x0030,
+	0x0000, 0x0400, 0x0011, 0x0d88, 0x0010, 0x0009, 0x0000, 0xff31,
+	0x0015, 0x0033, 0x0010, 0xb709, 0x000b, 0x84f6, 0x0012, 0xb749,
+	0x0013, 0x14fc, 0x0005, 0x0054, 0x0010, 0x0889, 0x0013, 0x04fe,
+	0x0005, 0x0054, 0x0010, 0x0898, 0x0015, 0x0030, 0x0000, 0x0400,
+	0x0011, 0x0d88, 0x0000, 0x0002, 0x0000, 0xff31, 0x0015, 0x0033,
+	0x0000, 0xb009, 0x001b, 0x8505, 0x0010, 0xb058, 0x0000, 0x0d59,
+	0x0001, 0xb9a8, 0x0010, 0x00f0, 0x000b, 0x252a, 0x0011, 0x0d88,
+	0x0010, 0x0005, 0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb009,
+	0x000b, 0x8510, 0x0001, 0xb0c8, 0x0000, 0xf700, 0x0000, 0xffb0,
+	0x0011, 0xb0e8, 0x0000, 0xf100, 0x0003, 0x1571, 0x0011, 0xb0e8,
+	0x0000, 0xf200, 0x0013, 0x1576, 0x0011, 0xb0e8, 0x0010, 0xf300,
+	0x0003, 0x1599, 0x0011, 0xb0e8, 0x0000, 0xf400, 0x0013, 0x159e,
+	0x0011, 0xb0e8, 0x0010, 0xf500, 0x0003, 0x1571, 0x0011, 0xb0e8,
+	0x0010, 0xf600, 0x0003, 0x15af, 0x0005, 0x00ce, 0x0010, 0x0009,
+	0x0000, 0xb0cf, 0x0013, 0x07fb, 0x0000, 0xb930, 0x0005, 0x0031,
+	0x0000, 0x0025, 0x0015, 0x0033, 0x0000, 0xb039, 0x000b, 0x852f,
+	0x0012, 0xb749, 0x0013, 0x1534, 0x0002, 0xb52c, 0x0000, 0xffb5,
+	0x0000, 0xb162, 0x0000, 0xb063, 0x0005, 0x0031, 0x0000, 0x001f,
+	0x0015, 0x0033, 0x0000, 0xb309, 0x001b, 0x853a, 0x0001, 0xb3c8,
+	0x0010, 0x0003, 0x0003, 0x1542, 0x0010, 0xffb2, 0x0001, 0xffe8,
+	0x0010, 0x0003, 0x001b, 0x1544, 0x0000, 0xc2b7, 0x0003, 0x05cb,
+	0x0001, 0xb2e8, 0x0000, 0x0001, 0x0003, 0x154b, 0x0005, 0x00ce,
+	0x0010, 0x000a, 0x0010, 0xb2cf, 0x0013, 0x07fb, 0x0010, 0xb465,
+	0x0010, 0xb667, 0x0015, 0x00b7, 0x0010, 0x0018, 0x0001, 0xb5c8,
+	0x0010, 0x0300, 0x0013, 0x1570, 0x0012, 0xb548, 0x0013, 0x1557,
+	0x0000, 0xb6ff, 0x0011, 0xb780, 0x0010, 0xffb7, 0x0002, 0xb549,
+	0x0003, 0x155c, 0x0010, 0xb4ff, 0x0011, 0xb780, 0x0010, 0xffb7,
+	0x0015, 0x0044, 0x0010, 0x0018, 0x0005, 0x0031, 0x0000, 0x002c,
+	0x0015, 0x0033, 0x0000, 0x6841, 0x000b, 0x8562, 0x0015, 0x0044,
+	0x0000, 0x0019, 0x0005, 0x0031, 0x0000, 0x0034, 0x0015, 0x0033,
+	0x0000, 0x5029, 0x001b, 0x8569, 0x0015, 0x0044, 0x0000, 0x0008,
+	0x0011, 0xb7c8, 0x0010, 0x0003, 0x0013, 0x1570, 0x0010, 0xff55,
+	0x0003, 0x05cb, 0x0005, 0x00b5, 0x0000, 0x0008, 0x0015, 0x00b7,
+	0x0010, 0x0018, 0x0003, 0x05cb, 0x0011, 0x0d88, 0x0000, 0x000b,
+	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb011, 0x001b, 0x857b,
+	0x0010, 0xb1ff, 0x0001, 0xb0d0, 0x0003, 0x1584, 0x0005, 0x00b5,
+	0x0010, 0x0b02, 0x0010, 0xb062, 0x0010, 0xb163, 0x0003, 0x0586,
+	0x0005, 0x00b5, 0x0000, 0x0302, 0x0015, 0x0065, 0x0010, 0x0012,
+	0x0005, 0x0067, 0x0000, 0x0008, 0x0015, 0x006c, 0x0000, 0x7000,
+	0x0005, 0x006d, 0x0010, 0x0500, 0x0015, 0x006f, 0x0010, 0x000a,
+	0x0015, 0x0044, 0x0000, 0x0001, 0x0005, 0x0052, 0x0000, 0x2500,
+	0x0015, 0x0044, 0x0000, 0x0008, 0x0015, 0x00b7, 0x0000, 0x0032,
+	0x0003, 0x05cb, 0x0005, 0x00b5, 0x0010, 0x0028, 0x0015, 0x00b7,
+	0x0010, 0x0018, 0x0003, 0x05cb, 0x0005, 0x00b5, 0x0000, 0x0100,
+	0x0005, 0x0067, 0x0000, 0x0008, 0x0015, 0x0030, 0x0000, 0x0400,
+	0x0011, 0x0d88, 0x0010, 0x0018, 0x0000, 0xff31, 0x0015, 0x0033,
+	0x0000, 0xb009, 0x001b, 0x85a9, 0x0001, 0xb0c8, 0x0010, 0x00ff,
+	0x0015, 0x00b7, 0x0000, 0x0020, 0x0003, 0x05cb, 0x0015, 0x0030,
+	0x0000, 0x0400, 0x0011, 0x0d88, 0x0010, 0x0005, 0x0000, 0xff31,
+	0x0015, 0x0033, 0x0000, 0xb609, 0x000b, 0x85b6, 0x0001, 0xb6c8,
+	0x0010, 0xff00, 0x0000, 0xffb0, 0x0015, 0x0033, 0x0000, 0xb00a,
+	0x000b, 0x85bc, 0x0001, 0xb6c8, 0x0010, 0x00ff, 0x0012, 0xff10,
+	0x001b, 0x15c5, 0x0000, 0xffb5, 0x0015, 0x00b7, 0x0010, 0x0018,
+	0x0003, 0x05cb, 0x0010, 0xff63, 0x0005, 0x00b5, 0x0000, 0x0800,
+	0x0015, 0x00b7, 0x0010, 0x0018, 0x0003, 0x05cb, 0x0015, 0x0030,
+	0x0000, 0x0400, 0x0011, 0x0d88, 0x0010, 0x0009, 0x0000, 0xff31,
+	0x0015, 0x0033, 0x0000, 0xb009, 0x001b, 0x85d2, 0x0010, 0xb561,
+	0x0013, 0x95d4, 0x0010, 0xb7a0, 0x0003, 0x05ec, 0x0005, 0x00b6,
+	0x0010, 0x0300, 0x0014, 0x0607, 0x0005, 0x0054, 0x0010, 0x0819,
+	0x0010, 0x0d58, 0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x0d88,
+	0x0000, 0x0002, 0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb009,
+	0x001b, 0x85e4, 0x0000, 0xb059, 0x0003, 0x95e6, 0x0010, 0xc0a0,
+	0x0010, 0x71ff, 0x0002, 0xff28, 0x0010, 0xff71, 0x0003, 0x05ec,
+	0x0012, 0xd041, 0x000b, 0x15ec, 0x0015, 0x00d1, 0x0010, 0x0202,
+	0x0000, 0x75ff, 0x0011, 0xffc8, 0x0000, 0x1804, 0x0001, 0xffd8,
+	0x0010, 0x0009, 0x0013, 0x95f5, 0x0000, 0xff75, 0x0003, 0x95f7,
+	0x0015, 0x00d1, 0x0000, 0x0200, 0x0015, 0x0030, 0x0000, 0x0400,
+	0x0001, 0xbd88, 0x0000, 0x0008, 0x0000, 0xff31, 0x0005, 0x00b0,
+	0x0010, 0x0009, 0x0015, 0x00b1, 0x0010, 0x07d0, 0x0015, 0x0033,
+	0x0000, 0xb012, 0x001b, 0x8605, 0x0013, 0x041c, 0x0015, 0x0044,
+	0x0000, 0x0008, 0x0005, 0x0098, 0x0010, 0x0056, 0x0015, 0x0099,
+	0x0000, 0x9575, 0x0004, 0x07c2, 0x0000, 0xb096, 0x0012, 0xb270,
+	0x0010, 0xff56, 0x0014, 0x07e4, 0x0010, 0xb052, 0x0010, 0xb153,
+	0x0000, 0xb6ff, 0x0011, 0xb2d0, 0x0010, 0xff50, 0x0010, 0xb351,
+	0x0017, 0x4000, 0x0015, 0x0030, 0x0000, 0x0400, 0x0001, 0x1288,
+	0x0010, 0x0011, 0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0x1009,
+	0x000b, 0x8620, 0x0015, 0x000f, 0x0000, 0x0001, 0x0010, 0xc014,
+	0x0000, 0x1213, 0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x1388,
+	0x0000, 0x0004, 0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xba09,
+	0x000b, 0x862c, 0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x1388,
+	0x0010, 0x0005, 0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0x1a09,
+	0x000b, 0x8634, 0x0012, 0x104b, 0x000b, 0x163d, 0x0000, 0x1a30,
+	0x0005, 0x0031, 0x0000, 0x000b, 0x0015, 0x0033, 0x0000, 0x1621,
+	0x001b, 0x863c, 0x0010, 0x15fe, 0x000b, 0x665c, 0x0014, 0x0683,
+	0x0002, 0x3a42, 0x001b, 0x1682, 0x0001, 0x10c8, 0x0010, 0x000f,
+	0x000b, 0x16e5, 0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x1388,
+	0x0000, 0x0008, 0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb009,
+	0x000b, 0x864c, 0x0011, 0xb0e8, 0x0010, 0x0009, 0x0003, 0x1653,
+	0x0011, 0xb0e8, 0x0000, 0x0001, 0x001b, 0x1681, 0x0011, 0x1388,
+	0x0010, 0x000a, 0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb009,
+	0x000b, 0x8658, 0x0002, 0xb04f, 0x001b, 0x1678, 0x0013, 0x0681,
+	0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x1388, 0x0010, 0x0003,
+	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb009, 0x001b, 0x8663,
+	0x0015, 0x0033, 0x0010, 0xc00a, 0x001b, 0x8666, 0x0010, 0xb0fe,
+	0x0003, 0x666b, 0x0000, 0xb012, 0x0003, 0x066d, 0x0010, 0xc012,
+	0x0010, 0xc011, 0x0015, 0x000f, 0x0010, 0x0000, 0x0002, 0x3944,
+	0x0013, 0x1676, 0x0015, 0x0039, 0x0000, 0x5040, 0x0015, 0x00b8,
+	0x0000, 0x0008, 0x0004, 0x083d, 0x0000, 0xc013, 0x0013, 0x0682,
+	0x0010, 0x02fe, 0x0013, 0x667d, 0x0015, 0x003a, 0x0010, 0x2020,
+	0x0013, 0x0682, 0x0015, 0x003a, 0x0000, 0x2000, 0x0015, 0x003a,
+	0x0010, 0x1010, 0x0004, 0x0829, 0x0013, 0x0055, 0x0013, 0xb683,
+	0x0005, 0x002a, 0x0000, 0x0004, 0x0000, 0xba30, 0x0005, 0x0031,
+	0x0010, 0x001b, 0x0015, 0x0033, 0x0000, 0xb009, 0x001b, 0x868b,
+	0x0000, 0xc02c, 0x0000, 0xb02d, 0x0012, 0x104b, 0x0003, 0x16a6,
+	0x0000, 0x1a30, 0x0005, 0x0031, 0x0000, 0x0023, 0x0015, 0x0033,
+	0x0000, 0xb129, 0x001b, 0x8695, 0x0000, 0xb120, 0x0010, 0xb221,
+	0x0000, 0xb322, 0x0000, 0xb423, 0x0000, 0xb524, 0x0000, 0xc025,
+	0x0010, 0xb526, 0x0010, 0xc027, 0x0010, 0xb516, 0x0010, 0xc017,
+	0x0000, 0xb518, 0x0000, 0xc019, 0x0010, 0xc028, 0x0000, 0xc029,
+	0x0010, 0xc01e, 0x0003, 0x06dc, 0x0012, 0x1044, 0x0013, 0x16d6,
+	0x0002, 0x1034, 0x0000, 0xff10, 0x0000, 0x1a30, 0x0005, 0x0031,
+	0x0000, 0x0002, 0x0015, 0x0033, 0x0000, 0x1b29, 0x001b, 0x86af,
+	0x0000, 0x1c30, 0x0000, 0x1b31, 0x0015, 0x0033, 0x0000, 0xb131,
+	0x001b, 0x86b4, 0x0002, 0x1f43, 0x001b, 0x16bb, 0x0010, 0xb3b5,
+	0x0000, 0xb4b6, 0x0000, 0xc0b3, 0x0010, 0xc0b4, 0x0000, 0xb120,
+	0x0010, 0xb221, 0x0000, 0xb322, 0x0000, 0xb423, 0x0000, 0xb524,
+	0x0010, 0xb625, 0x0010, 0xb516, 0x0000, 0xb617, 0x0000, 0x1826,
+	0x0000, 0x1927, 0x0000, 0x1a30, 0x0005, 0x0031, 0x0010, 0x000f,
+	0x0015, 0x0033, 0x0000, 0xb011, 0x001b, 0x86ca, 0x0000, 0xb028,
+	0x0000, 0xb129, 0x0012, 0x1e10, 0x0010, 0xff1e, 0x0003, 0x66dc,
+	0x0002, 0x1d00, 0x0010, 0xff1d, 0x0004, 0x028a, 0x0002, 0x3a42,
+	0x0013, 0x16dc, 0x0013, 0x06e4, 0x0000, 0x1a30, 0x0005, 0x0031,
+	0x0000, 0x0002, 0x0015, 0x0033, 0x0000, 0x1b79, 0x001b, 0x86db,
+	0x0013, 0xb6dc, 0x0005, 0x002a, 0x0000, 0x0001, 0x0005, 0x0015,
+	0x0000, 0x0001, 0x0000, 0x1efe, 0x0013, 0x66e4, 0x0003, 0x0256,
+	0x0017, 0x4000, 0x0000, 0xba30, 0x0005, 0x0031, 0x0010, 0x001b,
+	0x0015, 0x0033, 0x0010, 0xb051, 0x000b, 0x86ea, 0x0000, 0xb0a3,
+	0x0010, 0xb697, 0x0010, 0xb946, 0x0015, 0x00a5, 0x0000, 0x0010,
+	0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x1388, 0x0000, 0x0002,
+	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb509, 0x000b, 0x86f7,
+	0x0014, 0x07e4, 0x0004, 0x07d3, 0x0012, 0xb470, 0x0010, 0xffb4,
+	0x0010, 0xb48e, 0x0010, 0xb08a, 0x0010, 0xb18b, 0x0012, 0x104d,
+	0x0003, 0x1702, 0x0013, 0x072f, 0x0012, 0x104b, 0x0003, 0x1715,
+	0x0005, 0x008c, 0x0010, 0x0829, 0x0010, 0xc08d, 0x0001, 0xb2d8,
+	0x0010, 0x0600, 0x0010, 0xff88, 0x0010, 0xb389, 0x0000, 0x1390,
+	0x0010, 0xb591, 0x0000, 0xc08f, 0x0010, 0x1ab9, 0x0014, 0x04b4,
+	0x0013, 0x9710, 0x0010, 0xb092, 0x0010, 0xb193, 0x0013, 0x9713,
+	0x0013, 0x072a, 0x0005, 0x008c, 0x0000, 0x0809, 0x0015, 0x008d,
+	0x0000, 0x0008, 0x0001, 0xb2d8, 0x0000, 0x0100, 0x0010, 0xff88,
+	0x0010, 0xb389, 0x0000, 0x1390, 0x0010, 0xb591, 0x0000, 0xc08f,
+	0x0000, 0x1a30, 0x0005, 0x0031, 0x0010, 0x000f, 0x0015, 0x0033,
+	0x0000, 0xb011, 0x001b, 0x8725, 0x0013, 0x9726, 0x0000, 0xb192,
+	0x0000, 0xb093, 0x0013, 0x9729, 0x0010, 0x19a1, 0x0000, 0x18a2,
+	0x0015, 0x00b1, 0x0010, 0x0096, 0x0013, 0x079e, 0x0000, 0xb590,
+	0x0010, 0x1391, 0x0001, 0x10c8, 0x0010, 0x000f, 0x0001, 0xffe8,
+	0x0010, 0x0005, 0x0013, 0x1756, 0x0001, 0xb2d8, 0x0000, 0x0700,
+	0x0010, 0xff88, 0x0010, 0xb389, 0x0015, 0x0030, 0x0000, 0x0400,
+	0x0011, 0x1388, 0x0010, 0x0009, 0x0000, 0xff31, 0x0015, 0x0033,
+	0x0000, 0xb009, 0x000b, 0x8741, 0x0002, 0xb049, 0x0003, 0x1749,
+	0x0005, 0x008c, 0x0010, 0x0889, 0x0015, 0x00b1, 0x0010, 0x0096,
+	0x0003, 0x074d, 0x0005, 0x008c, 0x0010, 0x0898, 0x0015, 0x00b1,
+	0x0000, 0x0092, 0x0010, 0xc08d, 0x0000, 0xc08f, 0x0013, 0x974f,
+	0x0000, 0xc092, 0x0010, 0xc093, 0x0013, 0x9752, 0x0010, 0x19a1,
+	0x0000, 0x18a2, 0x0013, 0x079e, 0x0001, 0xb2d8, 0x0000, 0x0100,
+	0x0010, 0xff88, 0x0010, 0xb389, 0x0005, 0x008c, 0x0010, 0x0880,
+	0x0015, 0x008d, 0x0000, 0x0008, 0x0011, 0x1388, 0x0000, 0x000e,
+	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb009, 0x000b, 0x8763,
+	0x0010, 0xb08f, 0x0000, 0xb590, 0x0010, 0x1391, 0x0000, 0x1a30,
+	0x0005, 0x0031, 0x0000, 0x000d, 0x0015, 0x0033, 0x0000, 0xb021,
+	0x000b, 0x876c, 0x0013, 0x976d, 0x0010, 0xb392, 0x0010, 0xb293,
+	0x0013, 0x9770, 0x0000, 0xb1a1, 0x0010, 0xb0a2, 0x0015, 0x0030,
+	0x0000, 0x0400, 0x0011, 0x1388, 0x0000, 0x000b, 0x0000, 0xff31,
+	0x0015, 0x0033, 0x0010, 0xb211, 0x001b, 0x877a, 0x0000, 0xb3ff,
+	0x0001, 0xb080, 0x0000, 0xffb3, 0x000b, 0x2781, 0x0002, 0xb200,
+	0x0003, 0x0782, 0x0010, 0xb2ff, 0x0011, 0xb180, 0x0010, 0xffb2,
+	0x0011, 0x1388, 0x0000, 0x000b, 0x0000, 0xff31, 0x0015, 0x0033,
+	0x0010, 0xb212, 0x001b, 0x8789, 0x0015, 0x00b1, 0x0000, 0x0092,
+	0x0002, 0x104c, 0x0013, 0x179c, 0x0011, 0xc2e8, 0x0010, 0x000c,
+	0x001b, 0x1794, 0x0015, 0x00ff, 0x0000, 0x0800, 0x0003, 0x079c,
+	0x0011, 0xc2e8, 0x0000, 0x0020, 0x000b, 0x179a, 0x0015, 0x00ff,
+	0x0010, 0x1800, 0x0003, 0x079c, 0x0015, 0x00ff, 0x0000, 0x1000,
+	0x0011, 0xb1d0, 0x0010, 0xffb1, 0x0015, 0x009a, 0x0010, 0x0036,
+	0x0005, 0x009b, 0x0000, 0x95d5, 0x0012, 0xd041, 0x001b, 0x17a2,
+	0x0015, 0x00d1, 0x0010, 0x0202, 0x0003, 0x97a6, 0x0012, 0x104e,
+	0x0003, 0x17ab, 0x0012, 0xb12f, 0x0010, 0xffb1, 0x0000, 0xb175,
+	0x0003, 0x97ac, 0x0015, 0x00d1, 0x0000, 0x0200, 0x0001, 0x19c8,
+	0x0010, 0xfff0, 0x001b, 0x17b5, 0x0015, 0x00b1, 0x0010, 0x07d0,
+	0x0003, 0x07b7, 0x0015, 0x00b1, 0x0000, 0x1b58, 0x0005, 0x00b0,
+	0x0010, 0x0009, 0x0015, 0x0030, 0x0000, 0x0400, 0x0001, 0xbd88,
+	0x0000, 0x000b, 0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb012,
+	0x000b, 0x87c0, 0x0013, 0x0682, 0x0000, 0xba30, 0x0005, 0x0031,
+	0x0010, 0x0021, 0x0015, 0x0033, 0x0010, 0xb019, 0x001b, 0x87c7,
+	0x0002, 0xb200, 0x0011, 0xffc8, 0x0010, 0x00ff, 0x0010, 0xffb2,
+	0x0010, 0xb2b7, 0x0005, 0x0031, 0x0000, 0x0023, 0x0015, 0x0033,
+	0x0010, 0xb20a, 0x000b, 0x87d1, 0x0017, 0x4000, 0x0000, 0xba30,
+	0x0005, 0x0031, 0x0000, 0x0023, 0x0015, 0x0033, 0x0010, 0xb409,
+	0x000b, 0x87d8, 0x0002, 0xb400, 0x0011, 0xffc8, 0x0010, 0x00ff,
+	0x0010, 0xffb4, 0x0010, 0xb4b7, 0x0005, 0x0031, 0x0000, 0x0023,
+	0x0015, 0x0033, 0x0010, 0xb40a, 0x000b, 0x87e2, 0x0017, 0x4000,
+	0x0000, 0xba30, 0x0001, 0xc7c8, 0x0000, 0x0020, 0x000b, 0x17f0,
+	0x0005, 0x0031, 0x0010, 0x0028, 0x0015, 0x0033, 0x0010, 0xb209,
+	0x001b, 0x87ec, 0x0011, 0xb2c8, 0x0000, 0xff80, 0x0013, 0x17f3,
+	0x0010, 0xc4b0, 0x0010, 0xc5b1, 0x0003, 0x07f5, 0x0010, 0xc6b1,
+	0x0000, 0xc0b0, 0x0005, 0x0031, 0x0000, 0x0004, 0x0015, 0x0033,
+	0x0010, 0xb211, 0x000b, 0x87f9, 0x0017, 0x4000, 0x0015, 0x00b8,
+	0x0010, 0x0009, 0x0015, 0x003a, 0x0010, 0x0707, 0x0004, 0x083d,
+	0x0013, 0x002d, 0x0015, 0x00b8, 0x0010, 0x0009, 0x0015, 0x003a,
+	0x0010, 0x0707, 0x0013, 0x083d, 0x0014, 0x0114, 0x0015, 0x0030,
+	0x0000, 0x0400, 0x0011, 0x0d88, 0x0000, 0x0004, 0x0000, 0xff31,
+	0x0015, 0x0033, 0x0000, 0xba09, 0x001b, 0x880e, 0x0004, 0x07c2,
+	0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x0d88, 0x0000, 0x0010,
+	0x0000, 0xff31, 0x0015, 0x0033, 0x0010, 0xb20a, 0x000b, 0x8817,
+	0x0011, 0x0d88, 0x0010, 0x0011, 0x0000, 0xff31, 0x0015, 0x0033,
+	0x0010, 0x0309, 0x000b, 0x881d, 0x0002, 0x0327, 0x0010, 0xffb2,
+	0x0011, 0x0d88, 0x0010, 0x0011, 0x0000, 0xff31, 0x0015, 0x0033,
+	0x0010, 0xb20a, 0x001b, 0x8825, 0x0015, 0x00b8, 0x0010, 0x0006,
+	0x0013, 0x083d, 0x0004, 0x0126, 0x0004, 0x07c2, 0x0015, 0x0030,
+	0x0000, 0x0400, 0x0011, 0x1388, 0x0000, 0x0010, 0x0000, 0xff31,
+	0x0015, 0x0033, 0x0010, 0xb20a, 0x001b, 0x8832, 0x0012, 0x1027,
+	0x0010, 0xffb2, 0x0011, 0x1388, 0x0010, 0x0011, 0x0000, 0xff31,
+	0x0015, 0x0033, 0x0010, 0xb20a, 0x000b, 0x883a, 0x0015, 0x00b8,
+	0x0000, 0x0007, 0x0003, 0x483d, 0x0000, 0xb838, 0x0017, 0x4000,
+	0xa4bc, 0xa221
+};
+unsigned short xseqipx_code_length01 = 0x1082;
--- diff/drivers/scsi/qla2xxx/ql6312.c	1970-01-01 01:00:00.000000000 +0100
+++ source/drivers/scsi/qla2xxx/ql6312.c	2004-02-09 10:39:55.000000000 +0000
@@ -0,0 +1,90 @@
+/*
+ * QLogic ISP6312 device driver for Linux 2.6.x
+ * 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[] = "qla6312";
+
+extern unsigned char  fw2300flx_version[];
+extern unsigned char  fw2300flx_version_str[];
+extern unsigned short fw2300flx_addr01;
+extern unsigned short fw2300flx_code01[];
+extern unsigned short fw2300flx_length01;
+
+static struct qla_fw_info qla_fw_tbl[] = {
+	{
+		.addressing	= FW_INFO_ADDR_NORMAL,
+		.fwcode		= &fw2300flx_code01[0],
+		.fwlen		= &fw2300flx_length01,
+		.fwstart	= &fw2300flx_addr01,
+	},
+	{ FW_INFO_ADDR_NOMORE, },
+};
+
+static struct qla_board_info qla_board_tbl[] = {
+	{
+		.drv_name	= qla_driver_name,
+		.isp_name	= "ISP6312",
+		.fw_info	= qla_fw_tbl,
+	},
+};
+
+static struct pci_device_id qla6312_pci_tbl[] = {
+	{
+		.vendor		= PCI_VENDOR_ID_QLOGIC,
+		.device		= PCI_DEVICE_ID_QLOGIC_ISP6312,
+		.subvendor	= PCI_ANY_ID,
+		.subdevice	= PCI_ANY_ID,
+		.driver_data	= (unsigned long)&qla_board_tbl[0],
+	},
+	{0, 0},
+};
+MODULE_DEVICE_TABLE(pci, qla6312_pci_tbl);
+
+static int __devinit
+qla6312_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
+qla6312_remove_one(struct pci_dev *pdev)
+{
+	qla2x00_remove_one(pdev);
+}
+
+static struct pci_driver qla6312_pci_driver = {
+	.name		= "qla6312",
+	.id_table	= qla6312_pci_tbl,
+	.probe		= qla6312_probe_one,
+	.remove		= __devexit_p(qla6312_remove_one),
+};
+
+static int __init
+qla6312_init(void)
+{
+	return pci_module_init(&qla6312_pci_driver);
+}
+
+static void __exit
+qla6312_exit(void)
+{
+	pci_unregister_driver(&qla6312_pci_driver);
+}
+
+module_init(qla6312_init);
+module_exit(qla6312_exit);
+
+MODULE_AUTHOR("QLogic Corporation");
+MODULE_DESCRIPTION("QLogic ISP6312 FC-SCSI Host Bus Adapter driver");
+MODULE_LICENSE("GPL");
--- diff/drivers/scsi/qla2xxx/ql6312_fw.c	1970-01-01 01:00:00.000000000 +0100
+++ source/drivers/scsi/qla2xxx/ql6312_fw.c	2004-02-09 10:39:55.000000000 +0000
@@ -0,0 +1,6773 @@
+/**************************************************************************
+ *                  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.21 (16:22 Jan 19, 2004)
+ */
+
+#ifdef UNIQUE_FW_NAME
+unsigned short fw2300flx_version = 3*1024+2;
+#else
+unsigned short risc_code_version = 3*1024+2;
+#endif
+
+#ifdef UNIQUE_FW_NAME
+unsigned char fw2300flx_version_str[] = {3, 2,21};
+#else
+unsigned char firmware_version[] = {3, 2,21};
+#endif
+
+#ifdef UNIQUE_FW_NAME
+#define fw2300flx_VERSION_STRING "3.02.21"
+#else
+#define FW_VERSION_STRING "3.02.21"
+#endif
+
+#ifdef UNIQUE_FW_NAME
+unsigned short fw2300flx_addr01 = 0x0800 ;
+#else
+unsigned short risc_code_addr01 = 0x0800 ;
+#endif
+
+#ifdef UNIQUE_FW_NAME
+unsigned short fw2300flx_code01[] = { 
+#else
+unsigned short risc_code01[] = { 
+#endif
+	0x0470, 0x0000, 0x0000, 0xd1c9, 0x0000, 0x0003, 0x0002, 0x0015,
+	0x0317, 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, 0x2e32, 0x3120, 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, 0x20c9, 0x1bff, 0x2059, 0x0000, 0x2b78,
+	0x7883, 0x0004, 0x2089, 0x29f6, 0x2051, 0x1800, 0x2a70, 0x20e1,
+	0x0001, 0x20e9, 0x0001, 0x2009, 0x0000, 0x080c, 0x0e2f, 0x2029,
+	0x2480, 0x2031, 0xffff, 0x2039, 0x2450, 0x2021, 0x0050, 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, 0x756a, 0x766e, 0x7766, 0x7472, 0x7476,
+	0x00e6, 0x2071, 0x1a8f, 0x2472, 0x00ee, 0x20a1, 0x1cd0, 0x716c,
+	0x810d, 0x810d, 0x810d, 0x810d, 0x918c, 0x000f, 0x2001, 0x0001,
+	0x9112, 0x900e, 0x21a8, 0x4104, 0x8211, 0x1de0, 0x716c, 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, 0x0f04, 0x080c,
+	0x5aa2, 0x080c, 0x9a5e, 0x080c, 0x10bb, 0x080c, 0x1296, 0x080c,
+	0x19a1, 0x080c, 0x0d46, 0x080c, 0x1040, 0x080c, 0x30d9, 0x080c,
+	0x700c, 0x080c, 0x6383, 0x080c, 0x7c91, 0x080c, 0x21b2, 0x080c,
+	0x7fbb, 0x080c, 0x767b, 0x080c, 0x1fef, 0x080c, 0x2123, 0x080c,
+	0x21a7, 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, 0x117e, 0x2071, 0x1800, 0x7003,
+	0x0000, 0x2071, 0x1800, 0x7000, 0x908e, 0x0003, 0x1168, 0x080c,
+	0x477e, 0x080c, 0x3100, 0x080c, 0x707d, 0x080c, 0x6843, 0x080c,
+	0x7cba, 0x080c, 0x2960, 0x0c68, 0x000b, 0x0c88, 0x0940, 0x0941,
+	0x0ad8, 0x093e, 0x0b8f, 0x0d45, 0x0d45, 0x0d45, 0x080c, 0x0db4,
+	0x0005, 0x0126, 0x00f6, 0x2091, 0x8000, 0x7000, 0x9086, 0x0001,
+	0x1904, 0x0aab, 0x080c, 0x0e71, 0x080c, 0x6d14, 0x0150, 0x080c,
+	0x6d37, 0x15a0, 0x2079, 0x0100, 0x7828, 0x9085, 0x1800, 0x782a,
+	0x0468, 0x080c, 0x6c46, 0x7000, 0x9086, 0x0001, 0x1904, 0x0aab,
+	0x7094, 0x9086, 0x0028, 0x1904, 0x0aab, 0x080c, 0x7c89, 0x080c,
+	0x7c7b, 0x2001, 0x0161, 0x2003, 0x0001, 0x2079, 0x0100, 0x7827,
+	0xffff, 0x7a28, 0x9295, 0x5e2f, 0x7a2a, 0x2011, 0x6b95, 0x080c,
+	0x7d56, 0x2011, 0x6b88, 0x080c, 0x7e27, 0x2011, 0x58fd, 0x080c,
+	0x7d56, 0x2011, 0x8030, 0x901e, 0x7392, 0x04d0, 0x080c, 0x51aa,
+	0x2079, 0x0100, 0x7844, 0x9005, 0x1904, 0x0aab, 0x2011, 0x58fd,
+	0x080c, 0x7d56, 0x2011, 0x6b95, 0x080c, 0x7d56, 0x2011, 0x6b88,
+	0x080c, 0x7e27, 0x2001, 0x0265, 0x2001, 0x0205, 0x2003, 0x0000,
+	0x7840, 0x9084, 0xfffb, 0x7842, 0x2001, 0x1975, 0x2004, 0x9005,
+	0x1140, 0x00c6, 0x2061, 0x0100, 0x080c, 0x5a4a, 0x00ce, 0x0804,
+	0x0aab, 0x780f, 0x006b, 0x7a28, 0x080c, 0x6d1c, 0x0118, 0x9295,
+	0x5e2f, 0x0010, 0x9295, 0x402f, 0x7a2a, 0x2011, 0x8010, 0x73d4,
+	0x2001, 0x1976, 0x2003, 0x0001, 0x080c, 0x2826, 0x080c, 0x46b9,
+	0x7244, 0xc284, 0x7246, 0x2001, 0x180c, 0x200c, 0xc1ac, 0xc1cc,
+	0x2102, 0x080c, 0x92c1, 0x2011, 0x0004, 0x080c, 0xb7a3, 0x080c,
+	0x6214, 0x080c, 0x6d14, 0x1120, 0x080c, 0x286a, 0x02e0, 0x0400,
+	0x080c, 0x5a51, 0x0140, 0x7093, 0x0001, 0x70cf, 0x0000, 0x080c,
+	0x5377, 0x0804, 0x0aab, 0x080c, 0x5153, 0xd094, 0x0188, 0x2011,
+	0x180c, 0x2204, 0xc0cd, 0x2012, 0x080c, 0x5157, 0xd0d4, 0x1118,
+	0x080c, 0x286a, 0x1270, 0x2011, 0x180c, 0x2204, 0xc0bc, 0x0088,
+	0x080c, 0x5157, 0xd0d4, 0x1db8, 0x2011, 0x180c, 0x2204, 0xc0bd,
+	0x0040, 0x2011, 0x180c, 0x2204, 0xc0bd, 0x2012, 0x080c, 0x630d,
+	0x0008, 0x2012, 0x080c, 0x62d3, 0x0120, 0x7a0c, 0xc2b4, 0x7a0e,
+	0x00a8, 0x707b, 0x0000, 0x080c, 0x6d14, 0x1130, 0x70ac, 0x9005,
+	0x1168, 0x080c, 0xbbd8, 0x0050, 0x080c, 0xbbd8, 0x70d8, 0xd09c,
+	0x1128, 0x70ac, 0x9005, 0x0110, 0x080c, 0x5a27, 0x70e3, 0x0000,
+	0x70df, 0x0000, 0x70a3, 0x0000, 0x080c, 0x2872, 0x0228, 0x2011,
+	0x0101, 0x2204, 0xc0c4, 0x2012, 0x72d8, 0x080c, 0x6d14, 0x1178,
+	0x9016, 0x0016, 0x2009, 0x0002, 0x2019, 0x193e, 0x211a, 0x001e,
+	0x705b, 0xffff, 0x705f, 0x00ef, 0x707f, 0x0000, 0x0020, 0x2019,
+	0x193e, 0x201b, 0x0000, 0x2079, 0x1853, 0x7804, 0xd0ac, 0x0108,
+	0xc295, 0x72da, 0x080c, 0x6d14, 0x0118, 0x9296, 0x0004, 0x0548,
+	0x2011, 0x0001, 0x080c, 0xb7a3, 0x70a7, 0x0000, 0x70ab, 0xffff,
+	0x7003, 0x0002, 0x2079, 0x0100, 0x7827, 0x0003, 0x7828, 0x9085,
+	0x0003, 0x782a, 0x00fe, 0x080c, 0x2c63, 0x2011, 0x0005, 0x080c,
+	0x93f3, 0x080c, 0x868e, 0x080c, 0x6d14, 0x0148, 0x00c6, 0x2061,
+	0x0100, 0x0016, 0x2009, 0x0002, 0x61e2, 0x001e, 0x00ce, 0x012e,
+	0x0420, 0x70a7, 0x0000, 0x70ab, 0xffff, 0x7003, 0x0002, 0x00f6,
+	0x2079, 0x0100, 0x7827, 0x0003, 0x7828, 0x9085, 0x0003, 0x782a,
+	0x00fe, 0x2011, 0x0005, 0x080c, 0x93f3, 0x080c, 0x868e, 0x080c,
+	0x6d14, 0x0148, 0x00c6, 0x2061, 0x0100, 0x0016, 0x2009, 0x0002,
+	0x61e2, 0x001e, 0x00ce, 0x00fe, 0x012e, 0x0005, 0x00c6, 0x00b6,
+	0x080c, 0x6d14, 0x1118, 0x20a9, 0x0800, 0x0010, 0x20a9, 0x0782,
+	0x080c, 0x6d14, 0x1110, 0x900e, 0x0010, 0x2009, 0x007e, 0x86ff,
+	0x0138, 0x9180, 0x1000, 0x2004, 0x905d, 0x0110, 0xb800, 0xd0bc,
+	0x090c, 0x2f76, 0x8108, 0x1f04, 0x0abf, 0x707b, 0x0000, 0x707c,
+	0x9084, 0x00ff, 0x707e, 0x70af, 0x0000, 0x00be, 0x00ce, 0x0005,
+	0x00b6, 0x0126, 0x2091, 0x8000, 0x7000, 0x9086, 0x0002, 0x1904,
+	0x0b8c, 0x70a8, 0x9086, 0xffff, 0x0130, 0x080c, 0x2c63, 0x080c,
+	0x868e, 0x0804, 0x0b8c, 0x70d8, 0xd0ac, 0x1110, 0xd09c, 0x0540,
+	0xd084, 0x0530, 0x0006, 0x2001, 0x0103, 0x2003, 0x002b, 0x000e,
+	0xd08c, 0x01f0, 0x70dc, 0x9086, 0xffff, 0x01b0, 0x080c, 0x2deb,
+	0x080c, 0x868e, 0x70d8, 0xd094, 0x1904, 0x0b8c, 0x2011, 0x0001,
+	0x080c, 0xbe86, 0x0110, 0x2011, 0x0003, 0x901e, 0x080c, 0x2e25,
+	0x080c, 0x868e, 0x0804, 0x0b8c, 0x70e0, 0x9005, 0x1904, 0x0b8c,
+	0x70a4, 0x9005, 0x1904, 0x0b8c, 0x70d8, 0xd0a4, 0x0118, 0xd0b4,
+	0x0904, 0x0b8c, 0x080c, 0x62d3, 0x1904, 0x0b8c, 0x080c, 0x6326,
+	0x1904, 0x0b8c, 0x080c, 0x630d, 0x01c0, 0x0156, 0x00c6, 0x20a9,
+	0x007f, 0x900e, 0x0016, 0x080c, 0x5ff1, 0x1118, 0xb800, 0xd0ec,
+	0x1138, 0x001e, 0x8108, 0x1f04, 0x0b32, 0x00ce, 0x015e, 0x0028,
+	0x001e, 0x00ce, 0x015e, 0x0804, 0x0b8c, 0x0006, 0x2001, 0x0103,
+	0x2003, 0x006b, 0x000e, 0x2011, 0x1982, 0x080c, 0x0f74, 0x2011,
+	0x199c, 0x080c, 0x0f74, 0x7030, 0xc08c, 0x7032, 0x7003, 0x0003,
+	0x70ab, 0xffff, 0x080c, 0x0e53, 0x9006, 0x080c, 0x24b4, 0x0036,
+	0x0046, 0x2019, 0xffff, 0x2021, 0x0006, 0x080c, 0x4856, 0x004e,
+	0x003e, 0x00f6, 0x2079, 0x0100, 0x080c, 0x6d37, 0x0150, 0x080c,
+	0x6d14, 0x7828, 0x0118, 0x9084, 0xe1ff, 0x0010, 0x9084, 0xffdf,
+	0x782a, 0x00fe, 0x2001, 0x19b7, 0x2004, 0x9086, 0x0005, 0x1120,
+	0x2011, 0x0000, 0x080c, 0x93f3, 0x2011, 0x0000, 0x080c, 0x93fd,
+	0x080c, 0x868e, 0x080c, 0x8769, 0x012e, 0x00be, 0x0005, 0x0016,
+	0x0046, 0x00f6, 0x0126, 0x2091, 0x8000, 0x2079, 0x0100, 0x7904,
+	0x918c, 0xfffd, 0x7906, 0x2009, 0x00f7, 0x080c, 0x5a10, 0x7940,
+	0x918c, 0x0010, 0x7942, 0x7924, 0xd1b4, 0x0110, 0x7827, 0x0040,
+	0xd19c, 0x0110, 0x7827, 0x0008, 0x0006, 0x0036, 0x0156, 0x7954,
+	0xd1ac, 0x1904, 0x0c1c, 0x2001, 0x1976, 0x2004, 0x9005, 0x1518,
+	0x080c, 0x28ed, 0x1148, 0x2001, 0x0001, 0x080c, 0x2855, 0x2001,
+	0x0001, 0x080c, 0x2838, 0x00b8, 0x080c, 0x28f5, 0x1138, 0x9006,
+	0x080c, 0x2855, 0x9006, 0x080c, 0x2838, 0x0068, 0x080c, 0x28fd,
+	0x1d50, 0x2001, 0x1967, 0x2004, 0xd0fc, 0x0108, 0x0020, 0x080c,
+	0x264f, 0x0804, 0x0cfc, 0x080c, 0x6d25, 0x0148, 0x080c, 0x6d37,
+	0x1118, 0x080c, 0x7007, 0x0050, 0x080c, 0x6d1c, 0x0dd0, 0x080c,
+	0x7002, 0x080c, 0x6ff8, 0x080c, 0x6c46, 0x0058, 0x080c, 0x6d14,
+	0x0140, 0x2009, 0x00f8, 0x080c, 0x5a10, 0x7843, 0x0090, 0x7843,
+	0x0010, 0x20a9, 0x09c4, 0x7820, 0xd09c, 0x1138, 0x080c, 0x6d14,
+	0x0138, 0x7824, 0xd0ac, 0x1904, 0x0d01, 0x1f04, 0x0bfb, 0x0070,
+	0x7824, 0x080c, 0x6d2e, 0x0118, 0xd0ac, 0x1904, 0x0d01, 0x9084,
+	0x1800, 0x0d98, 0x7003, 0x0001, 0x0804, 0x0d01, 0x2001, 0x0001,
+	0x080c, 0x24b4, 0x0804, 0x0d14, 0x2001, 0x1976, 0x2004, 0x9005,
+	0x1518, 0x080c, 0x28ed, 0x1148, 0x2001, 0x0001, 0x080c, 0x2855,
+	0x2001, 0x0001, 0x080c, 0x2838, 0x00b8, 0x080c, 0x28f5, 0x1138,
+	0x9006, 0x080c, 0x2855, 0x9006, 0x080c, 0x2838, 0x0068, 0x080c,
+	0x28fd, 0x1d50, 0x2001, 0x1967, 0x2004, 0xd0fc, 0x0108, 0x0020,
+	0x080c, 0x264f, 0x0804, 0x0cfc, 0x7850, 0x9085, 0x0040, 0x7852,
+	0x7938, 0x7850, 0x9084, 0xfbcf, 0x7852, 0x080c, 0x2905, 0x9085,
+	0x2000, 0x7852, 0x793a, 0x20a9, 0x0046, 0x1d04, 0x0c55, 0x080c,
+	0x7e07, 0x1f04, 0x0c55, 0x7850, 0x9085, 0x0400, 0x9084, 0xdfbf,
+	0x7852, 0x793a, 0x080c, 0x6d25, 0x0148, 0x080c, 0x6d37, 0x1118,
+	0x080c, 0x7007, 0x0050, 0x080c, 0x6d1c, 0x0dd0, 0x080c, 0x7002,
+	0x080c, 0x6ff8, 0x080c, 0x6c46, 0x0020, 0x2009, 0x00f8, 0x080c,
+	0x5a10, 0x20a9, 0x0028, 0xa001, 0x1f04, 0x0c7b, 0x7850, 0x9085,
+	0x1400, 0x7852, 0x080c, 0x6d14, 0x0120, 0x7843, 0x0090, 0x7843,
+	0x0010, 0x2021, 0xe678, 0x2019, 0xea60, 0x0d0c, 0x7e07, 0x7820,
+	0xd09c, 0x1588, 0x080c, 0x6d14, 0x0904, 0x0ce1, 0x7824, 0xd0ac,
+	0x1904, 0x0d01, 0x080c, 0x6d37, 0x1530, 0x0046, 0x2021, 0x0320,
+	0x8421, 0x1df0, 0x004e, 0x7827, 0x1800, 0x080c, 0x2905, 0x7824,
+	0x9084, 0x1800, 0x1168, 0x9484, 0x0fff, 0x1140, 0x2001, 0x1810,
+	0x2004, 0x9084, 0x9000, 0x0110, 0x080c, 0x0d22, 0x8421, 0x1158,
+	0x1d04, 0x0cbc, 0x080c, 0x7e07, 0x080c, 0x7002, 0x080c, 0x6ff8,
+	0x7003, 0x0001, 0x04f0, 0x8319, 0x1940, 0x1d04, 0x0cc9, 0x080c,
+	0x7e07, 0x2009, 0x196a, 0x2104, 0x9005, 0x0118, 0x8001, 0x200a,
+	0x1178, 0x200b, 0x000a, 0x7827, 0x0048, 0x20a9, 0x0002, 0x080c,
+	0x28e6, 0x7924, 0x080c, 0x2905, 0xd19c, 0x0110, 0x080c, 0x2826,
+	0x00d8, 0x080c, 0x6d25, 0x1140, 0x94a2, 0x03e8, 0x1128, 0x080c,
+	0x6cec, 0x7003, 0x0001, 0x00a8, 0x7827, 0x1800, 0x080c, 0x2905,
+	0x7824, 0x080c, 0x6d2e, 0x0110, 0xd0ac, 0x1158, 0x9084, 0x1800,
+	0x0950, 0x7003, 0x0001, 0x0028, 0x2001, 0x0001, 0x080c, 0x24b4,
+	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, 0x7e07, 0x015e,
+	0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x004e, 0x003e, 0x001e,
+	0x000e, 0x0005, 0x00e6, 0x2071, 0x1894, 0x7004, 0x9086, 0x0001,
+	0x1110, 0x080c, 0x3100, 0x00ee, 0x0005, 0x0005, 0x2a70, 0x2061,
+	0x197a, 0x2063, 0x0003, 0x6007, 0x0002, 0x600b, 0x0015, 0x600f,
+	0x0317, 0x2001, 0x194d, 0x900e, 0x2102, 0x7192, 0x2001, 0x0100,
+	0x2004, 0x9082, 0x0002, 0x0218, 0x705b, 0xffff, 0x0008, 0x715a,
+	0x7063, 0xffff, 0x717a, 0x717e, 0x080c, 0xbbd8, 0x70e7, 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, 0x182b, 0x2102, 0x0005, 0x9016, 0x080c, 0x5ff1, 0x1178,
+	0xb804, 0x90c4, 0x00ff, 0x98c6, 0x0006, 0x0128, 0x90c4, 0xff00,
+	0x98c6, 0x0600, 0x1120, 0x9186, 0x0080, 0x0108, 0x8210, 0x8108,
+	0x9186, 0x0800, 0x1d50, 0x2208, 0x0005, 0x2091, 0x8000, 0x2079,
+	0x0000, 0x000e, 0x00f6, 0x0010, 0x2091, 0x8000, 0x0e04, 0x0db6,
+	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, 0x1a69, 0x7a08, 0x226a,
+	0x2069, 0x1a6a, 0x7a18, 0x226a, 0x8d68, 0x7a1c, 0x226a, 0x782c,
+	0x2019, 0x1a77, 0x201a, 0x2019, 0x1a7a, 0x9016, 0x7808, 0xd09c,
+	0x0168, 0x7820, 0x201a, 0x8210, 0x8318, 0x9386, 0x1a8f, 0x0108,
+	0x0ca8, 0x7808, 0xd09c, 0x0110, 0x2011, 0xdead, 0x2019, 0x1a78,
+	0x782c, 0x201a, 0x8318, 0x221a, 0x7803, 0x0000, 0x2069, 0x1a49,
+	0x901e, 0x20a9, 0x0020, 0x7b26, 0x7a28, 0x226a, 0x8d68, 0x8318,
+	0x1f04, 0x0e03, 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, 0x5162, 0x1108, 0x0099, 0x0cd8, 0x0005, 0x918c,
+	0x03ff, 0x2001, 0x0003, 0x2004, 0x9084, 0x0600, 0x1118, 0x918d,
+	0x2800, 0x0010, 0x918d, 0x2000, 0x2001, 0x017f, 0x2102, 0x0005,
+	0x0026, 0x0126, 0x2011, 0x0080, 0x080c, 0x0ecb, 0x20a9, 0x0900,
+	0x080c, 0x0eec, 0x2011, 0x0040, 0x080c, 0x0ecb, 0x20a9, 0x0900,
+	0x080c, 0x0eec, 0x0c78, 0x0026, 0x080c, 0x0ed8, 0x1118, 0x2011,
+	0x0040, 0x0098, 0x2011, 0x010e, 0x2214, 0x9294, 0x0007, 0x9296,
+	0x0007, 0x0118, 0x2011, 0xa880, 0x0010, 0x2011, 0x6840, 0xd0e4,
+	0x70eb, 0x0000, 0x1128, 0x70eb, 0x0fa0, 0x080c, 0x0edd, 0x002e,
+	0x0005, 0x0026, 0x080c, 0x0ed8, 0x0128, 0xd0a4, 0x1138, 0x2011,
+	0xcdd5, 0x0010, 0x2011, 0x0080, 0x080c, 0x0edd, 0x002e, 0x0005,
+	0x0026, 0x70eb, 0x0000, 0x080c, 0x0ed8, 0x1148, 0x080c, 0x28fd,
+	0x1118, 0x2011, 0x8484, 0x0058, 0x2011, 0x8282, 0x0040, 0x080c,
+	0x28fd, 0x1118, 0x2011, 0xcdc5, 0x0010, 0x2011, 0xcac2, 0x080c,
+	0x0edd, 0x002e, 0x0005, 0x00e6, 0x0006, 0x2071, 0x1800, 0xd0b4,
+	0x70e4, 0x1110, 0xc0e4, 0x0048, 0x0006, 0x3b00, 0x9084, 0xff3f,
+	0x20d8, 0x000e, 0x70eb, 0x0000, 0xc0e5, 0x0079, 0x000e, 0x00ee,
+	0x0005, 0x00e6, 0x2071, 0x1800, 0xd0e4, 0x70e4, 0x1110, 0xc0dc,
+	0x0008, 0xc0dd, 0x0011, 0x00ee, 0x0005, 0x70e6, 0x7000, 0x9084,
+	0x0007, 0x000b, 0x0005, 0x0e9a, 0x0e71, 0x0e71, 0x0e53, 0x0e80,
+	0x0e71, 0x0e71, 0x0e80, 0x0016, 0x3b08, 0x3a00, 0x9104, 0x918d,
+	0x00c0, 0x21d8, 0x9084, 0xff3f, 0x9205, 0x20d0, 0x001e, 0x0005,
+	0x2001, 0x1839, 0x2004, 0xd0dc, 0x0005, 0x9e86, 0x1800, 0x190c,
+	0x0db4, 0x70e4, 0xd0e4, 0x0108, 0xc2e5, 0x72e6, 0xd0e4, 0x1118,
+	0x9294, 0x00c0, 0x0c01, 0x0005, 0x1d04, 0x0eec, 0x2091, 0x6000,
+	0x1f04, 0x0eec, 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, 0x0ef3, 0x2100, 0x9300, 0x2098, 0x22e0, 0x009e, 0x002e,
+	0x001e, 0x0036, 0x3518, 0x20a9, 0x0001, 0x4002, 0x8007, 0x4004,
+	0x8319, 0x1dd8, 0x003e, 0x0005, 0x20e9, 0x0001, 0x71b4, 0x81ff,
+	0x11c0, 0x9006, 0x2009, 0x0200, 0x20a9, 0x0002, 0x9298, 0x0018,
+	0x23a0, 0x4001, 0x2009, 0x0700, 0x20a9, 0x0002, 0x9298, 0x0008,
+	0x23a0, 0x4001, 0x7078, 0x8007, 0x717c, 0x810f, 0x20a9, 0x0002,
+	0x4001, 0x9298, 0x000c, 0x23a0, 0x900e, 0x080c, 0x0d94, 0x2001,
+	0x0000, 0x810f, 0x20a9, 0x0002, 0x4001, 0x0005, 0x89ff, 0x0140,
+	0xa804, 0xa807, 0x0000, 0x0006, 0x080c, 0x101e, 0x009e, 0x0cb0,
+	0x0005, 0x00e6, 0x2071, 0x1800, 0x080c, 0x1097, 0x090c, 0x0db4,
+	0x00ee, 0x0005, 0x0086, 0x00e6, 0x0006, 0x0026, 0x0036, 0x0126,
+	0x2091, 0x8000, 0x00c9, 0x2071, 0x1800, 0x73bc, 0x702c, 0x9016,
+	0x9045, 0x0158, 0x8210, 0x9906, 0x090c, 0x0db4, 0x2300, 0x9202,
+	0x0120, 0x1a0c, 0x0db4, 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, 0x0db4, 0xa000, 0x0cc8, 0x012e,
+	0x000e, 0x00ee, 0x008e, 0x0005, 0x00e6, 0x2071, 0x1800, 0x0126,
+	0x2091, 0x8000, 0x70bc, 0x8001, 0x0270, 0x70be, 0x702c, 0x2048,
+	0x9085, 0x0001, 0xa800, 0x702e, 0xa803, 0x0000, 0xa807, 0x0000,
+	0x012e, 0x00ee, 0x0005, 0x904e, 0x0cd8, 0x00e6, 0x0126, 0x2091,
+	0x8000, 0x2071, 0x1800, 0x70bc, 0x90ca, 0x0040, 0x0268, 0x8001,
+	0x70be, 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,
+	0x70bc, 0x8000, 0x70be, 0x080c, 0x7c7b, 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, 0x0492, 0xa802, 0x2048,
+	0x2009, 0x2480, 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, 0x74ba, 0x74be, 0x0005, 0x00e6,
+	0x0016, 0x9984, 0xfc00, 0x01e8, 0x908c, 0xf800, 0x1168, 0x9982,
+	0x0400, 0x02b8, 0x9982, 0x0440, 0x0278, 0x9982, 0x0492, 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,
+	0x8044, 0x7012, 0x00ee, 0x0005, 0x0126, 0x2091, 0x8000, 0x00e6,
+	0xa06f, 0x0000, 0x2071, 0x19e7, 0x701c, 0x9088, 0x19f1, 0x280a,
+	0x8000, 0x9084, 0x003f, 0x701e, 0x7120, 0x9106, 0x090c, 0x0db4,
+	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, 0x110e, 0x110c, 0x110c, 0x110c,
+	0x1285, 0x1285, 0x1285, 0x1285, 0x080c, 0x0db4, 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, 0x10eb, 0x0005, 0x0016, 0x00e6,
+	0x2071, 0x19e7, 0x00f6, 0x2079, 0x0080, 0x792c, 0xd1bc, 0x190c,
+	0x0dad, 0x782b, 0x0002, 0xd1fc, 0x0120, 0x918c, 0x0700, 0x7004,
+	0x0023, 0x00fe, 0x00ee, 0x001e, 0x0005, 0x10fc, 0x11a4, 0x11d8,
+	0x0db4, 0x0db4, 0x1291, 0x0db4, 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, 0x1141, 0x0005, 0x7008, 0x0096,
+	0x2048, 0xa86f, 0x0100, 0x009e, 0x7007, 0x0000, 0x080c, 0x10fc,
+	0x0005, 0x7008, 0x0096, 0x2048, 0xa86f, 0x0200, 0x009e, 0x0ca0,
+	0x918c, 0x0700, 0x1150, 0x700c, 0x9005, 0x0180, 0x7800, 0x7802,
+	0x7804, 0x7806, 0x080c, 0x1156, 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, 0x10eb, 0x0005, 0x00de, 0x009e,
+	0x080c, 0x10eb, 0x0005, 0xa8a8, 0xd08c, 0x0005, 0x0096, 0xa0a0,
+	0x904d, 0x090c, 0x0db4, 0xa06c, 0x908e, 0x0100, 0x0130, 0xa87b,
+	0x0030, 0xa883, 0x0000, 0xa897, 0x4002, 0x080c, 0x65e5, 0xa09f,
+	0x0000, 0xa0a3, 0x0000, 0x2848, 0x080c, 0x101e, 0x009e, 0x0005,
+	0x00a6, 0xa0a0, 0x904d, 0x090c, 0x0db4, 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, 0x10cc, 0x00e8, 0xa97c, 0xa894,
+	0x0016, 0x0006, 0x080c, 0x65e5, 0x000e, 0x001e, 0xd1fc, 0x1138,
+	0xd1f4, 0x0128, 0x00c6, 0x2060, 0x080c, 0x9ac8, 0x00ce, 0x7008,
+	0x2048, 0xa89f, 0x0000, 0xa8a3, 0x0000, 0x080c, 0x101e, 0x7007,
+	0x0000, 0x080c, 0x10eb, 0x00ae, 0x0005, 0x0126, 0x2091, 0x8000,
+	0x782b, 0x1001, 0x7007, 0x0005, 0x7000, 0xc094, 0x7002, 0x012e,
+	0x0005, 0x7007, 0x0000, 0x080c, 0x10fc, 0x0005, 0x0126, 0x2091,
+	0x2200, 0x2079, 0x0300, 0x2071, 0x1a31, 0x7003, 0x0000, 0x78bf,
+	0x00f6, 0x00c1, 0x7803, 0x0003, 0x780f, 0x0000, 0x20a9, 0x0254,
+	0x2061, 0xd512, 0x2c0d, 0x7912, 0xe104, 0x9ce0, 0x0002, 0x7916,
+	0x1f04, 0x12aa, 0x7807, 0x0007, 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, 0x0007, 0x7827,
+	0x0030, 0x782b, 0x0400, 0x7827, 0x0031, 0x782b, 0x1a49, 0x781f,
+	0xff00, 0x781b, 0xff00, 0x2001, 0x0200, 0x2004, 0xd0dc, 0x0110,
+	0x781f, 0x0303, 0x2061, 0x1a49, 0x602f, 0x1cd0, 0x2001, 0x1819,
+	0x2004, 0x9082, 0x1cd0, 0x6032, 0x603b, 0x1dd6, 0x00ce, 0x0005,
+	0x0126, 0x2091, 0x2200, 0x7908, 0x9184, 0x0070, 0x190c, 0x0dad,
+	0xd19c, 0x0158, 0x7820, 0x908c, 0xf000, 0x15e8, 0x908a, 0x0024,
+	0x1a0c, 0x0db4, 0x0023, 0x012e, 0x0005, 0x012e, 0x0005, 0x132b,
+	0x132b, 0x1342, 0x1347, 0x134b, 0x1350, 0x1378, 0x137c, 0x138a,
+	0x138e, 0x132b, 0x1418, 0x141c, 0x147f, 0x132b, 0x132b, 0x132b,
+	0x132b, 0x132b, 0x132b, 0x132b, 0x132b, 0x132b, 0x132b, 0x132b,
+	0x132b, 0x132b, 0x1352, 0x132b, 0x132b, 0x132b, 0x132b, 0x132b,
+	0x132b, 0x132f, 0x132d, 0x080c, 0x0db4, 0x080c, 0x0dad, 0x080c,
+	0x1486, 0x2009, 0x1a48, 0x2104, 0x8000, 0x200a, 0x080c, 0x773e,
+	0x080c, 0x18a6, 0x0005, 0x2009, 0x0048, 0x2060, 0x080c, 0x9b42,
+	0x012e, 0x0005, 0x7004, 0xc085, 0xc0b5, 0x7006, 0x0005, 0x7004,
+	0xc085, 0x7006, 0x0005, 0x080c, 0x1486, 0x080c, 0x1543, 0x0005,
+	0x080c, 0x0db4, 0x080c, 0x1486, 0x2060, 0x6014, 0x0096, 0x2048,
+	0xa83b, 0xffff, 0x009e, 0x2009, 0x0048, 0x080c, 0x9b42, 0x2001,
+	0x015d, 0x2003, 0x0000, 0x2009, 0x03e8, 0x8109, 0x0160, 0x2001,
+	0x0201, 0x2004, 0x9005, 0x0dc8, 0x2001, 0x0218, 0x2004, 0xd0ec,
+	0x1110, 0x080c, 0x148b, 0x2001, 0x0307, 0x2003, 0x8000, 0x0005,
+	0x7004, 0xc095, 0x7006, 0x0005, 0x080c, 0x1486, 0x2060, 0x6014,
+	0x0096, 0x2048, 0xa83b, 0xffff, 0x009e, 0x2009, 0x0048, 0x080c,
+	0x9b42, 0x0005, 0x080c, 0x1486, 0x080c, 0x0db4, 0x080c, 0x1486,
+	0x080c, 0x1403, 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,
+	0x0db4, 0x2001, 0x020d, 0x2003, 0x0050, 0x2003, 0x0020, 0x0480,
+	0x78ab, 0x0004, 0x7803, 0x0001, 0x080c, 0x141c, 0x0005, 0x7828,
+	0x782b, 0x0000, 0x9065, 0x090c, 0x0db4, 0x6014, 0x2048, 0x78ab,
+	0x0004, 0x918c, 0x0700, 0x0198, 0x080c, 0x773e, 0x080c, 0x18a6,
+	0x080c, 0xb793, 0x0158, 0xa9ac, 0xa936, 0xa9b0, 0xa93a, 0xa83f,
+	0xffff, 0xa843, 0xffff, 0xa880, 0xc0bd, 0xa882, 0x0005, 0x6010,
+	0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x6024, 0x190c, 0xbb71,
+	0x2029, 0x00c8, 0x8529, 0x0128, 0x2001, 0x0201, 0x2004, 0x9005,
+	0x0dc8, 0x7dbc, 0x080c, 0xd4bb, 0xd5a4, 0x1118, 0x080c, 0x148b,
+	0x0005, 0x080c, 0x773e, 0x080c, 0x18a6, 0x0005, 0x781f, 0x0300,
+	0x7803, 0x0001, 0x0005, 0x0016, 0x0066, 0x0076, 0x00f6, 0x2079,
+	0x0300, 0x7908, 0x918c, 0x0007, 0x9186, 0x0003, 0x0120, 0x2001,
+	0x0016, 0x080c, 0x14fc, 0x00fe, 0x007e, 0x006e, 0x001e, 0x0005,
+	0x7004, 0xc09d, 0x7006, 0x0005, 0x7104, 0x9184, 0x0004, 0x190c,
+	0x0db4, 0xd184, 0x1189, 0xd19c, 0x0158, 0xc19c, 0x7106, 0x2001,
+	0x020d, 0x2003, 0x0050, 0x2003, 0x0020, 0x080c, 0x148b, 0x0005,
+	0x81ff, 0x190c, 0x0db4, 0x0005, 0xc184, 0xd1b4, 0xc1b4, 0x7106,
+	0x0016, 0x00e6, 0x15e0, 0x2071, 0x0200, 0x080c, 0x1537, 0x6014,
+	0x9005, 0x05a8, 0x0096, 0x2048, 0xa864, 0x009e, 0x9084, 0x00ff,
+	0x908e, 0x0029, 0x0160, 0x908e, 0x0048, 0x1548, 0x601c, 0xd084,
+	0x11d8, 0x00f6, 0x2c78, 0x080c, 0x15ad, 0x00fe, 0x00a8, 0x00f6,
+	0x2c78, 0x080c, 0x16ea, 0x00fe, 0x2009, 0x01f4, 0x8109, 0x0160,
+	0x2001, 0x0201, 0x2004, 0x9005, 0x0dc8, 0x2001, 0x0218, 0x2004,
+	0xd0ec, 0x1110, 0x0401, 0x0040, 0x2001, 0x020d, 0x2003, 0x0020,
+	0x080c, 0x12ba, 0x7803, 0x0001, 0x00ee, 0x001e, 0x0005, 0x2001,
+	0x020d, 0x2003, 0x0050, 0x2003, 0x0020, 0x0069, 0x0ca8, 0x0031,
+	0x2060, 0x2009, 0x0053, 0x080c, 0x9b42, 0x0005, 0x7808, 0xd09c,
+	0x0de8, 0x7820, 0x0005, 0x080c, 0x1403, 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, 0x14ee, 0x6827, 0x0001,
+	0x8109, 0x1dd0, 0x04d9, 0x6827, 0x0002, 0x04c1, 0x6804, 0x9005,
+	0x1130, 0x682c, 0xd0e4, 0x1500, 0x6804, 0x9005, 0x0de8, 0x79b8,
+	0xd1ec, 0x1130, 0x08c0, 0x080c, 0x773e, 0x080c, 0x18a6, 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, 0x12f0,
+	0x00ce, 0x002e, 0x001e, 0x000e, 0x0006, 0x7832, 0x7936, 0x7a3a,
+	0x781b, 0x8080, 0x0059, 0x1118, 0x000e, 0x00fe, 0x0005, 0x000e,
+	0x792c, 0x3900, 0x8000, 0x2004, 0x080c, 0x0db4, 0x2009, 0xff00,
+	0x8109, 0x0120, 0x7818, 0xd0bc, 0x1dd8, 0x0005, 0x9085, 0x0001,
+	0x0005, 0x7832, 0x7936, 0x7a3a, 0x781b, 0x8080, 0x0c79, 0x1108,
+	0x0005, 0x792c, 0x3900, 0x8000, 0x2004, 0x080c, 0x0db4, 0x7037,
+	0x0001, 0x7150, 0x7037, 0x0002, 0x7050, 0x2060, 0xd1bc, 0x1110,
+	0x7054, 0x2060, 0x0005, 0x00e6, 0x0016, 0x2071, 0x0200, 0x0c79,
+	0x6124, 0xd1dc, 0x01f8, 0x701c, 0xd08c, 0x0904, 0x15a2, 0x7017,
+	0x0000, 0x2001, 0x0264, 0x2004, 0xd0bc, 0x0904, 0x15a2, 0x2001,
+	0x0268, 0x00c6, 0x2064, 0x6104, 0x6038, 0x00ce, 0x918e, 0x0039,
+	0x1904, 0x15a2, 0x9c06, 0x15f0, 0x0126, 0x2091, 0x2600, 0x080c,
+	0x7696, 0x012e, 0x7358, 0x745c, 0x6014, 0x905d, 0x0598, 0x2b48,
+	0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x190c, 0xbb4c,
+	0xab42, 0xac3e, 0x2001, 0x1875, 0x2004, 0xd0b4, 0x1170, 0x601c,
+	0xd0e4, 0x1158, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc,
+	0x1120, 0xa83b, 0x7fff, 0xa837, 0xffff, 0x080c, 0x1df6, 0x1190,
+	0x080c, 0x1739, 0x2a00, 0xa816, 0x0130, 0x2800, 0xa80e, 0x2c05,
+	0xa80a, 0x2c00, 0xa812, 0x7037, 0x0020, 0x781f, 0x0300, 0x001e,
+	0x00ee, 0x0005, 0x7037, 0x0050, 0x7037, 0x0020, 0x001e, 0x00ee,
+	0x080c, 0x148b, 0x0005, 0x080c, 0x0db4, 0x0016, 0x2009, 0x00a0,
+	0x8109, 0xa001, 0xa001, 0xa001, 0x1dd8, 0x001e, 0x2ff0, 0x0126,
+	0x2091, 0x2200, 0x3e60, 0x6014, 0x2048, 0x2940, 0x903e, 0x2730,
+	0xa864, 0x2068, 0xa81a, 0x9d84, 0x000f, 0x9088, 0x1dd6, 0x2165,
+	0x0002, 0x15e0, 0x162d, 0x15e0, 0x15e0, 0x15e0, 0x160f, 0x15e0,
+	0x15e4, 0x15d9, 0x1624, 0x15e0, 0x15e0, 0x15e0, 0x16e8, 0x15f8,
+	0x15ee, 0xa964, 0x918c, 0x00ff, 0x918e, 0x0048, 0x0904, 0x1624,
+	0x9085, 0x0001, 0x0804, 0x16e0, 0xa87c, 0xd0bc, 0x0dc8, 0xa890,
+	0xa842, 0xa88c, 0xa83e, 0xa888, 0x0804, 0x1634, 0xa87c, 0xd0bc,
+	0x0d78, 0xa890, 0xa842, 0xa88c, 0xa83e, 0xa888, 0x0804, 0x1683,
+	0xa87c, 0xd0bc, 0x0d28, 0xa890, 0xa842, 0xa88c, 0xa83e, 0xa804,
+	0x9045, 0x090c, 0x0db4, 0xa164, 0xa91a, 0x91ec, 0x000f, 0x9d80,
+	0x1dd6, 0x2065, 0xa888, 0xd19c, 0x1904, 0x1683, 0x0428, 0xa87c,
+	0xd0ac, 0x0970, 0xa804, 0x9045, 0x090c, 0x0db4, 0xa164, 0xa91a,
+	0x91ec, 0x000f, 0x9d80, 0x1dd6, 0x2065, 0x9006, 0xa842, 0xa83e,
+	0xd19c, 0x1904, 0x1683, 0x0080, 0xa87c, 0xd0ac, 0x0904, 0x15e0,
+	0x9006, 0xa842, 0xa83e, 0x0804, 0x1683, 0xa87c, 0xd0ac, 0x0904,
+	0x15e0, 0x9006, 0xa842, 0xa83e, 0x2c05, 0x908a, 0x0036, 0x1a0c,
+	0x0db4, 0x9082, 0x001b, 0x0002, 0x1657, 0x1657, 0x1659, 0x1657,
+	0x1657, 0x1657, 0x165f, 0x1657, 0x1657, 0x1657, 0x1665, 0x1657,
+	0x1657, 0x1657, 0x166b, 0x1657, 0x1657, 0x1657, 0x1671, 0x1657,
+	0x1657, 0x1657, 0x1677, 0x1657, 0x1657, 0x1657, 0x167d, 0x080c,
+	0x0db4, 0xa574, 0xa478, 0xa37c, 0xa280, 0x0804, 0x16c8, 0xa584,
+	0xa488, 0xa38c, 0xa290, 0x0804, 0x16c8, 0xa594, 0xa498, 0xa39c,
+	0xa2a0, 0x0804, 0x16c8, 0xa5a4, 0xa4a8, 0xa3ac, 0xa2b0, 0x0804,
+	0x16c8, 0xa5b4, 0xa4b8, 0xa3bc, 0xa2c0, 0x0804, 0x16c8, 0xa5c4,
+	0xa4c8, 0xa3cc, 0xa2d0, 0x0804, 0x16c8, 0xa5d4, 0xa4d8, 0xa3dc,
+	0xa2e0, 0x0804, 0x16c8, 0x2c05, 0x908a, 0x0034, 0x1a0c, 0x0db4,
+	0x9082, 0x001b, 0x0002, 0x16a6, 0x16a4, 0x16a4, 0x16a4, 0x16a4,
+	0x16a4, 0x16ad, 0x16a4, 0x16a4, 0x16a4, 0x16a4, 0x16a4, 0x16b4,
+	0x16a4, 0x16a4, 0x16a4, 0x16a4, 0x16a4, 0x16bb, 0x16a4, 0x16a4,
+	0x16a4, 0x16a4, 0x16a4, 0x16c2, 0x080c, 0x0db4, 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, 0x15e0, 0x2ff0, 0x0126, 0x2091, 0x2200, 0x3e60, 0x6014,
+	0x2048, 0x2940, 0xa80e, 0x2061, 0x1dd1, 0xa813, 0x1dd1, 0x2c05,
+	0xa80a, 0xa964, 0xa91a, 0xa87c, 0xd0ac, 0x090c, 0x0db4, 0x9006,
+	0xa842, 0xa83e, 0x2c05, 0x908a, 0x0034, 0x1a0c, 0x0db4, 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, 0x0db4, 0xa80e, 0xa064, 0xa81a, 0x9084, 0x000f, 0x9080,
+	0x1dd6, 0x2015, 0x82ff, 0x090c, 0x0db4, 0xaa12, 0x2205, 0xa80a,
+	0x0c18, 0x903e, 0x2730, 0xa880, 0xd0fc, 0x1190, 0x2d00, 0x0002,
+	0x182e, 0x1790, 0x1790, 0x182e, 0x182e, 0x1828, 0x182e, 0x1790,
+	0x182e, 0x17df, 0x17df, 0x182e, 0x182e, 0x182e, 0x1825, 0x17df,
+	0xc0fc, 0xa882, 0xab2c, 0xaa30, 0xad1c, 0xac20, 0xdd9c, 0x0904,
+	0x1830, 0x2c05, 0x908a, 0x0034, 0x1a0c, 0x0db4, 0x9082, 0x001b,
+	0x0002, 0x177c, 0x177a, 0x177a, 0x177a, 0x177a, 0x177a, 0x1780,
+	0x177a, 0x177a, 0x177a, 0x177a, 0x177a, 0x1784, 0x177a, 0x177a,
+	0x177a, 0x177a, 0x177a, 0x1788, 0x177a, 0x177a, 0x177a, 0x177a,
+	0x177a, 0x178c, 0x080c, 0x0db4, 0xa774, 0xa678, 0x0804, 0x1830,
+	0xa78c, 0xa690, 0x0804, 0x1830, 0xa7a4, 0xa6a8, 0x0804, 0x1830,
+	0xa7bc, 0xa6c0, 0x0804, 0x1830, 0xa7d4, 0xa6d8, 0x0804, 0x1830,
+	0x2c05, 0x908a, 0x0036, 0x1a0c, 0x0db4, 0x9082, 0x001b, 0x0002,
+	0x17b3, 0x17b3, 0x17b5, 0x17b3, 0x17b3, 0x17b3, 0x17bb, 0x17b3,
+	0x17b3, 0x17b3, 0x17c1, 0x17b3, 0x17b3, 0x17b3, 0x17c7, 0x17b3,
+	0x17b3, 0x17b3, 0x17cd, 0x17b3, 0x17b3, 0x17b3, 0x17d3, 0x17b3,
+	0x17b3, 0x17b3, 0x17d9, 0x080c, 0x0db4, 0xa574, 0xa478, 0xa37c,
+	0xa280, 0x0804, 0x1830, 0xa584, 0xa488, 0xa38c, 0xa290, 0x0804,
+	0x1830, 0xa594, 0xa498, 0xa39c, 0xa2a0, 0x0804, 0x1830, 0xa5a4,
+	0xa4a8, 0xa3ac, 0xa2b0, 0x0804, 0x1830, 0xa5b4, 0xa4b8, 0xa3bc,
+	0xa2c0, 0x0804, 0x1830, 0xa5c4, 0xa4c8, 0xa3cc, 0xa2d0, 0x0804,
+	0x1830, 0xa5d4, 0xa4d8, 0xa3dc, 0xa2e0, 0x0804, 0x1830, 0x2c05,
+	0x908a, 0x0034, 0x1a0c, 0x0db4, 0x9082, 0x001b, 0x0002, 0x1802,
+	0x1800, 0x1800, 0x1800, 0x1800, 0x1800, 0x1809, 0x1800, 0x1800,
+	0x1800, 0x1800, 0x1800, 0x1810, 0x1800, 0x1800, 0x1800, 0x1800,
+	0x1800, 0x1817, 0x1800, 0x1800, 0x1800, 0x1800, 0x1800, 0x181e,
+	0x080c, 0x0db4, 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, 0x1d94, 0x1904, 0x1739, 0x900e, 0x0050, 0x080c, 0x0db4,
+	0xab2e, 0xaa32, 0xad1e, 0xac22, 0xaf26, 0xae2a, 0x080c, 0x1d94,
+	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, 0x9b42, 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, 0x12f0, 0x8631,
+	0x1db8, 0x00ce, 0x781f, 0x0800, 0x2031, 0x0168, 0x00c6, 0x7808,
+	0xd09c, 0x190c, 0x12f0, 0x00ce, 0x2001, 0x0038, 0x080c, 0x1933,
+	0x7930, 0x9186, 0x0040, 0x0160, 0x9186, 0x0042, 0x190c, 0x0db4,
+	0x2001, 0x001e, 0x8001, 0x1df0, 0x8631, 0x1d40, 0x080c, 0x1942,
+	0x000e, 0x6022, 0x012e, 0x0005, 0x080c, 0x192f, 0x7827, 0x0015,
+	0x7828, 0x9c06, 0x1db8, 0x782b, 0x0000, 0x0ca0, 0x00f6, 0x2079,
+	0x0300, 0x7803, 0x0000, 0x78ab, 0x0004, 0x00fe, 0x080c, 0x6d14,
+	0x11b0, 0x2001, 0x0138, 0x2003, 0x0000, 0x2001, 0x0160, 0x2003,
+	0x0000, 0x2011, 0x012c, 0xa001, 0xa001, 0x8211, 0x1de0, 0x0081,
+	0x0066, 0x2031, 0x0000, 0x080c, 0x6dc4, 0x006e, 0x0005, 0x0479,
+	0x0039, 0x2001, 0x0160, 0x2502, 0x2001, 0x0138, 0x2202, 0x0005,
+	0x00e6, 0x2071, 0x0200, 0x080c, 0x2911, 0x2009, 0x003c, 0x080c,
+	0x2110, 0x2001, 0x015d, 0x2003, 0x0000, 0x7000, 0x9084, 0x003c,
+	0x1de0, 0x080c, 0x7c7b, 0x70a0, 0x70a2, 0x7098, 0x709a, 0x709c,
+	0x709e, 0x2001, 0x020d, 0x2003, 0x0020, 0x00f6, 0x2079, 0x0300,
+	0x080c, 0x12ba, 0x7803, 0x0001, 0x00fe, 0x00ee, 0x0005, 0x2001,
+	0x0138, 0x2014, 0x2003, 0x0000, 0x2001, 0x0160, 0x202c, 0x2003,
+	0x0000, 0x080c, 0x6d14, 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, 0x14fc, 0x7930,
+	0x0005, 0x2c08, 0x621c, 0x080c, 0x1529, 0x7930, 0x0005, 0x8001,
+	0x1df0, 0x0005, 0x2031, 0x0005, 0x781c, 0x9084, 0x0007, 0x0170,
+	0x2001, 0x0038, 0x0c41, 0x9186, 0x0040, 0x0904, 0x19a0, 0x2001,
+	0x001e, 0x0c69, 0x8631, 0x1d80, 0x080c, 0x0db4, 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, 0x1939, 0x9186, 0x0040, 0x190c, 0x0db4,
+	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, 0x0db4, 0xa001, 0xa001, 0x781f, 0x0200,
+	0x0005, 0x0126, 0x2091, 0x2400, 0x2071, 0x1a34, 0x2079, 0x0090,
+	0x012e, 0x0005, 0x9280, 0x0005, 0x2004, 0x2048, 0xa97c, 0xd1dc,
+	0x1904, 0x1a25, 0xa964, 0x9184, 0x0007, 0x0002, 0x19be, 0x1a10,
+	0x19c5, 0x19c5, 0x19c5, 0x19f8, 0x19d8, 0x19c7, 0x2100, 0x9084,
+	0x00ff, 0x9086, 0x0048, 0x0904, 0x1a10, 0x080c, 0x0db4, 0xa87c,
+	0xd0b4, 0x0904, 0x1bd7, 0xa890, 0xa842, 0xa83a, 0xa88c, 0xa83e,
+	0xa836, 0xa8ac, 0xa846, 0xa8b0, 0xa84a, 0xa988, 0x0804, 0x1a18,
+	0xa864, 0x9084, 0x00ff, 0x9086, 0x001e, 0x1d38, 0xa87c, 0xd0b4,
+	0x0904, 0x1bd7, 0xa890, 0xa842, 0xa83a, 0xa88c, 0xa83e, 0xa836,
+	0xa8ac, 0xa846, 0xa8b0, 0xa84a, 0xa804, 0xa85a, 0x2040, 0xa064,
+	0x9084, 0x000f, 0x9080, 0x1dd6, 0x2005, 0xa812, 0xa988, 0x0448,
+	0x918c, 0x00ff, 0x9186, 0x0015, 0x1540, 0xa87c, 0xd0b4, 0x0904,
+	0x1bd7, 0xa804, 0xa85a, 0x2040, 0xa064, 0x9084, 0x000f, 0x9080,
+	0x1dd6, 0x2005, 0xa812, 0xa988, 0x9006, 0xa842, 0xa83e, 0x0088,
+	0xa87c, 0xd0b4, 0x0904, 0x1bd7, 0xa988, 0x9006, 0xa842, 0xa83e,
+	0x2900, 0xa85a, 0xa864, 0x9084, 0x000f, 0x9080, 0x1dd6, 0x2005,
+	0xa812, 0xa916, 0xa87c, 0xc0dd, 0xa87e, 0x0005, 0x00f6, 0x2079,
+	0x0090, 0x782c, 0xd0fc, 0x190c, 0x1c18, 0x00e6, 0x2071, 0x1a34,
+	0x7000, 0x9005, 0x1904, 0x1a7f, 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, 0x1df6,
+	0x004e, 0x003e, 0x0d50, 0x0c98, 0x9085, 0x0001, 0x0c80, 0x0076,
+	0x0066, 0x0056, 0x0046, 0x0036, 0x0026, 0x8aff, 0x0904, 0x1bd0,
+	0x700c, 0x7214, 0x923a, 0x7010, 0x7218, 0x9203, 0x0a04, 0x1bcf,
+	0x9705, 0x0904, 0x1bcf, 0x903e, 0x2730, 0xa880, 0xd0fc, 0x1190,
+	0x2d00, 0x0002, 0x1bb3, 0x1afa, 0x1afa, 0x1bb3, 0x1bb3, 0x1b96,
+	0x1bb3, 0x1afa, 0x1b9c, 0x1b49, 0x1b49, 0x1bb3, 0x1bb3, 0x1bb3,
+	0x1b90, 0x1b49, 0xc0fc, 0xa882, 0xab2c, 0xaa30, 0xad1c, 0xac20,
+	0xdd9c, 0x0904, 0x1bb5, 0x2c05, 0x908a, 0x0034, 0x1a0c, 0x0db4,
+	0x9082, 0x001b, 0x0002, 0x1ae6, 0x1ae4, 0x1ae4, 0x1ae4, 0x1ae4,
+	0x1ae4, 0x1aea, 0x1ae4, 0x1ae4, 0x1ae4, 0x1ae4, 0x1ae4, 0x1aee,
+	0x1ae4, 0x1ae4, 0x1ae4, 0x1ae4, 0x1ae4, 0x1af2, 0x1ae4, 0x1ae4,
+	0x1ae4, 0x1ae4, 0x1ae4, 0x1af6, 0x080c, 0x0db4, 0xa774, 0xa678,
+	0x0804, 0x1bb5, 0xa78c, 0xa690, 0x0804, 0x1bb5, 0xa7a4, 0xa6a8,
+	0x0804, 0x1bb5, 0xa7bc, 0xa6c0, 0x0804, 0x1bb5, 0xa7d4, 0xa6d8,
+	0x0804, 0x1bb5, 0x2c05, 0x908a, 0x0036, 0x1a0c, 0x0db4, 0x9082,
+	0x001b, 0x0002, 0x1b1d, 0x1b1d, 0x1b1f, 0x1b1d, 0x1b1d, 0x1b1d,
+	0x1b25, 0x1b1d, 0x1b1d, 0x1b1d, 0x1b2b, 0x1b1d, 0x1b1d, 0x1b1d,
+	0x1b31, 0x1b1d, 0x1b1d, 0x1b1d, 0x1b37, 0x1b1d, 0x1b1d, 0x1b1d,
+	0x1b3d, 0x1b1d, 0x1b1d, 0x1b1d, 0x1b43, 0x080c, 0x0db4, 0xa574,
+	0xa478, 0xa37c, 0xa280, 0x0804, 0x1bb5, 0xa584, 0xa488, 0xa38c,
+	0xa290, 0x0804, 0x1bb5, 0xa594, 0xa498, 0xa39c, 0xa2a0, 0x0804,
+	0x1bb5, 0xa5a4, 0xa4a8, 0xa3ac, 0xa2b0, 0x0804, 0x1bb5, 0xa5b4,
+	0xa4b8, 0xa3bc, 0xa2c0, 0x0804, 0x1bb5, 0xa5c4, 0xa4c8, 0xa3cc,
+	0xa2d0, 0x0804, 0x1bb5, 0xa5d4, 0xa4d8, 0xa3dc, 0xa2e0, 0x0804,
+	0x1bb5, 0x2c05, 0x908a, 0x0034, 0x1a0c, 0x0db4, 0x9082, 0x001b,
+	0x0002, 0x1b6c, 0x1b6a, 0x1b6a, 0x1b6a, 0x1b6a, 0x1b6a, 0x1b74,
+	0x1b6a, 0x1b6a, 0x1b6a, 0x1b6a, 0x1b6a, 0x1b7b, 0x1b6a, 0x1b6a,
+	0x1b6a, 0x1b6a, 0x1b6a, 0x1b82, 0x1b6a, 0x1b6a, 0x1b6a, 0x1b6a,
+	0x1b6a, 0x1b89, 0x080c, 0x0db4, 0xa56c, 0xa470, 0xa774, 0xa678,
+	0xa37c, 0xa280, 0x0804, 0x1bb5, 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, 0x1d94,
+	0x1904, 0x1a95, 0x900e, 0x04a0, 0xa864, 0x9084, 0x00ff, 0x9086,
+	0x0048, 0x190c, 0x0db4, 0x00c6, 0x7004, 0x2060, 0x6004, 0x9086,
+	0x0043, 0x00ce, 0x0904, 0x1b49, 0xab9c, 0x9016, 0xad8c, 0xac90,
+	0xaf94, 0xae98, 0x0010, 0x080c, 0x0db4, 0x7b12, 0x7a16, 0x7d02,
+	0x7c06, 0x7f0a, 0x7e0e, 0x782b, 0x0001, 0x7000, 0x8000, 0x7002,
+	0xa83c, 0x9300, 0xa83e, 0xa840, 0x9201, 0xa842, 0x700c, 0x9300,
+	0x700e, 0x7010, 0x9201, 0x7012, 0x080c, 0x1d94, 0x0008, 0x9006,
+	0x002e, 0x003e, 0x004e, 0x005e, 0x006e, 0x007e, 0x0005, 0x080c,
+	0x0db4, 0x0026, 0x2001, 0x0105, 0x2003, 0x0010, 0x782b, 0x0004,
+	0x7003, 0x0000, 0x7004, 0x2060, 0x6014, 0x2048, 0x080c, 0xb793,
+	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, 0xb3e0, 0x00ce, 0x2001, 0x19c5, 0x2004, 0x9c06,
+	0x1160, 0x2009, 0x0040, 0x080c, 0x2110, 0x080c, 0x9580, 0x2011,
+	0x0000, 0x080c, 0x93fd, 0x080c, 0x8769, 0x002e, 0x0804, 0x1d46,
+	0x0126, 0x2091, 0x2400, 0xa858, 0x2040, 0x792c, 0x782b, 0x0002,
+	0x9184, 0x0700, 0x1904, 0x1bd9, 0x7000, 0x0002, 0x1d46, 0x1c2a,
+	0x1c97, 0x1d44, 0x8001, 0x7002, 0xd19c, 0x1150, 0x8aff, 0x05b0,
+	0x080c, 0x1a8f, 0x0904, 0x1d46, 0x080c, 0x1a8f, 0x0804, 0x1d46,
+	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,
+	0x1dac, 0xa880, 0xc0fd, 0xa882, 0x2a00, 0xa816, 0x2800, 0xa85a,
+	0x2c00, 0xa812, 0x7003, 0x0000, 0x0804, 0x1d46, 0x00f6, 0x0026,
+	0x781c, 0x0006, 0x7818, 0x0006, 0x2079, 0x0100, 0x7a14, 0x9284,
+	0x1984, 0x9085, 0x0012, 0x7816, 0x0036, 0x2019, 0x1000, 0x8319,
+	0x090c, 0x0db4, 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, 0x1d46, 0x8001,
+	0x7002, 0xd194, 0x0170, 0x782c, 0xd0fc, 0x1904, 0x1c1d, 0xd19c,
+	0x1904, 0x1d42, 0x8aff, 0x0904, 0x1d46, 0x080c, 0x1a8f, 0x0804,
+	0x1d46, 0x0026, 0x0036, 0xab3c, 0xaa40, 0x080c, 0x1dac, 0xdd9c,
+	0x1904, 0x1d01, 0x2c05, 0x908a, 0x0036, 0x1a0c, 0x0db4, 0x9082,
+	0x001b, 0x0002, 0x1cd5, 0x1cd5, 0x1cd7, 0x1cd5, 0x1cd5, 0x1cd5,
+	0x1cdd, 0x1cd5, 0x1cd5, 0x1cd5, 0x1ce3, 0x1cd5, 0x1cd5, 0x1cd5,
+	0x1ce9, 0x1cd5, 0x1cd5, 0x1cd5, 0x1cef, 0x1cd5, 0x1cd5, 0x1cd5,
+	0x1cf5, 0x1cd5, 0x1cd5, 0x1cd5, 0x1cfb, 0x080c, 0x0db4, 0xa07c,
+	0x931a, 0xa080, 0x9213, 0x0804, 0x1c49, 0xa08c, 0x931a, 0xa090,
+	0x9213, 0x0804, 0x1c49, 0xa09c, 0x931a, 0xa0a0, 0x9213, 0x0804,
+	0x1c49, 0xa0ac, 0x931a, 0xa0b0, 0x9213, 0x0804, 0x1c49, 0xa0bc,
+	0x931a, 0xa0c0, 0x9213, 0x0804, 0x1c49, 0xa0cc, 0x931a, 0xa0d0,
+	0x9213, 0x0804, 0x1c49, 0xa0dc, 0x931a, 0xa0e0, 0x9213, 0x0804,
+	0x1c49, 0x2c05, 0x908a, 0x0034, 0x1a0c, 0x0db4, 0x9082, 0x001b,
+	0x0002, 0x1d24, 0x1d22, 0x1d22, 0x1d22, 0x1d22, 0x1d22, 0x1d2a,
+	0x1d22, 0x1d22, 0x1d22, 0x1d22, 0x1d22, 0x1d30, 0x1d22, 0x1d22,
+	0x1d22, 0x1d22, 0x1d22, 0x1d36, 0x1d22, 0x1d22, 0x1d22, 0x1d22,
+	0x1d22, 0x1d3c, 0x080c, 0x0db4, 0xa07c, 0x931a, 0xa080, 0x9213,
+	0x0804, 0x1c49, 0xa094, 0x931a, 0xa098, 0x9213, 0x0804, 0x1c49,
+	0xa0ac, 0x931a, 0xa0b0, 0x9213, 0x0804, 0x1c49, 0xa0c4, 0x931a,
+	0xa0c8, 0x9213, 0x0804, 0x1c49, 0xa0dc, 0x931a, 0xa0e0, 0x9213,
+	0x0804, 0x1c49, 0x0804, 0x1c45, 0x080c, 0x0db4, 0x012e, 0x0005,
+	0x00f6, 0x00e6, 0x2071, 0x1a34, 0x7000, 0x9086, 0x0000, 0x0904,
+	0x1d91, 0x2079, 0x0090, 0x2009, 0x0207, 0x210c, 0xd194, 0x01b8,
+	0x2009, 0x020c, 0x210c, 0x9184, 0x0003, 0x0188, 0x080c, 0xd504,
+	0x2001, 0x0133, 0x2004, 0x9005, 0x090c, 0x0db4, 0x0016, 0x2009,
+	0x0040, 0x080c, 0x2110, 0x001e, 0x2001, 0x020c, 0x2102, 0x2009,
+	0x0206, 0x2104, 0x2009, 0x0203, 0x210c, 0x9106, 0x1120, 0x2009,
+	0x0040, 0x080c, 0x2110, 0x782c, 0xd0fc, 0x09a8, 0x080c, 0x1c18,
+	0x7000, 0x9086, 0x0000, 0x1978, 0x782b, 0x0004, 0x782c, 0xd0ac,
+	0x1de8, 0x2009, 0x0040, 0x080c, 0x2110, 0x782b, 0x0002, 0x7003,
+	0x0000, 0x00ee, 0x00fe, 0x0005, 0x8c60, 0x2c05, 0x9005, 0x0110,
+	0x8a51, 0x0005, 0xa004, 0x9005, 0x0168, 0xa85a, 0x2040, 0xa064,
+	0x9084, 0x000f, 0x9080, 0x1dd6, 0x2065, 0x8cff, 0x090c, 0x0db4,
+	0x8a51, 0x0005, 0x2050, 0x0005, 0x8a50, 0x8c61, 0x2c05, 0x9005,
+	0x1190, 0x2800, 0x9906, 0x0120, 0xa000, 0x9005, 0x1108, 0x2900,
+	0x2040, 0xa85a, 0xa064, 0x9084, 0x000f, 0x9080, 0x1de6, 0x2065,
+	0x8cff, 0x090c, 0x0db4, 0x0005, 0x0000, 0x001d, 0x0021, 0x0025,
+	0x0029, 0x002d, 0x0031, 0x0035, 0x0000, 0x001b, 0x0021, 0x0027,
+	0x002d, 0x0033, 0x0000, 0x0000, 0x0023, 0x0000, 0x0000, 0x1dc9,
+	0x1dc5, 0x0000, 0x0000, 0x1dd3, 0x0000, 0x1dc9, 0x1dd0, 0x1dd0,
+	0x1dcd, 0x0000, 0x0000, 0x0000, 0x1dd3, 0x1dd0, 0x0000, 0x1dcb,
+	0x1dcb, 0x0000, 0x0000, 0x1dd3, 0x0000, 0x1dcb, 0x1dd1, 0x1dd1,
+	0x1dd1, 0x0000, 0x0000, 0x0000, 0x1dd3, 0x1dd1, 0x00c6, 0x00d6,
+	0x0086, 0xab42, 0xac3e, 0xa888, 0x9055, 0x0904, 0x1fcd, 0x2940,
+	0xa064, 0x90ec, 0x000f, 0x9de0, 0x1dd6, 0x9d86, 0x0007, 0x0130,
+	0x9d86, 0x000e, 0x0118, 0x9d86, 0x000f, 0x1120, 0xa08c, 0x9422,
+	0xa090, 0x931b, 0x2c05, 0x9065, 0x1140, 0x0310, 0x0804, 0x1fcd,
+	0xa004, 0x9045, 0x0904, 0x1fcd, 0x0c18, 0x2c05, 0x9005, 0x0904,
+	0x1eb5, 0xdd9c, 0x1904, 0x1e71, 0x908a, 0x0036, 0x1a0c, 0x0db4,
+	0x9082, 0x001b, 0x0002, 0x1e46, 0x1e46, 0x1e48, 0x1e46, 0x1e46,
+	0x1e46, 0x1e4e, 0x1e46, 0x1e46, 0x1e46, 0x1e54, 0x1e46, 0x1e46,
+	0x1e46, 0x1e5a, 0x1e46, 0x1e46, 0x1e46, 0x1e60, 0x1e46, 0x1e46,
+	0x1e46, 0x1e66, 0x1e46, 0x1e46, 0x1e46, 0x1e6c, 0x080c, 0x0db4,
+	0xa07c, 0x9422, 0xa080, 0x931b, 0x0804, 0x1eab, 0xa08c, 0x9422,
+	0xa090, 0x931b, 0x0804, 0x1eab, 0xa09c, 0x9422, 0xa0a0, 0x931b,
+	0x0804, 0x1eab, 0xa0ac, 0x9422, 0xa0b0, 0x931b, 0x0804, 0x1eab,
+	0xa0bc, 0x9422, 0xa0c0, 0x931b, 0x0804, 0x1eab, 0xa0cc, 0x9422,
+	0xa0d0, 0x931b, 0x0804, 0x1eab, 0xa0dc, 0x9422, 0xa0e0, 0x931b,
+	0x04d0, 0x908a, 0x0034, 0x1a0c, 0x0db4, 0x9082, 0x001b, 0x0002,
+	0x1e93, 0x1e91, 0x1e91, 0x1e91, 0x1e91, 0x1e91, 0x1e98, 0x1e91,
+	0x1e91, 0x1e91, 0x1e91, 0x1e91, 0x1e9d, 0x1e91, 0x1e91, 0x1e91,
+	0x1e91, 0x1e91, 0x1ea2, 0x1e91, 0x1e91, 0x1e91, 0x1e91, 0x1e91,
+	0x1ea7, 0x080c, 0x0db4, 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, 0x1fcd, 0x8c60, 0x0804, 0x1e1d, 0xa004, 0x9045, 0x0904,
+	0x1fcd, 0x0804, 0x1e00, 0x8a51, 0x0904, 0x1fcd, 0x8c60, 0x2c05,
+	0x9005, 0x1158, 0xa004, 0x9045, 0x0904, 0x1fcd, 0xa064, 0x90ec,
+	0x000f, 0x9de0, 0x1dd6, 0x2c05, 0x2060, 0xa880, 0xc0fc, 0xa882,
+	0x0804, 0x1fc2, 0x2c05, 0x8422, 0x8420, 0x831a, 0x9399, 0x0000,
+	0xac2e, 0xab32, 0xdd9c, 0x1904, 0x1f5f, 0x9082, 0x001b, 0x0002,
+	0x1efb, 0x1efb, 0x1efd, 0x1efb, 0x1efb, 0x1efb, 0x1f0b, 0x1efb,
+	0x1efb, 0x1efb, 0x1f19, 0x1efb, 0x1efb, 0x1efb, 0x1f27, 0x1efb,
+	0x1efb, 0x1efb, 0x1f35, 0x1efb, 0x1efb, 0x1efb, 0x1f43, 0x1efb,
+	0x1efb, 0x1efb, 0x1f51, 0x080c, 0x0db4, 0xa17c, 0x2400, 0x9122,
+	0xa180, 0x2300, 0x911b, 0x0a0c, 0x0db4, 0xa074, 0x9420, 0xa078,
+	0x9319, 0x0804, 0x1fbd, 0xa18c, 0x2400, 0x9122, 0xa190, 0x2300,
+	0x911b, 0x0a0c, 0x0db4, 0xa084, 0x9420, 0xa088, 0x9319, 0x0804,
+	0x1fbd, 0xa19c, 0x2400, 0x9122, 0xa1a0, 0x2300, 0x911b, 0x0a0c,
+	0x0db4, 0xa094, 0x9420, 0xa098, 0x9319, 0x0804, 0x1fbd, 0xa1ac,
+	0x2400, 0x9122, 0xa1b0, 0x2300, 0x911b, 0x0a0c, 0x0db4, 0xa0a4,
+	0x9420, 0xa0a8, 0x9319, 0x0804, 0x1fbd, 0xa1bc, 0x2400, 0x9122,
+	0xa1c0, 0x2300, 0x911b, 0x0a0c, 0x0db4, 0xa0b4, 0x9420, 0xa0b8,
+	0x9319, 0x0804, 0x1fbd, 0xa1cc, 0x2400, 0x9122, 0xa1d0, 0x2300,
+	0x911b, 0x0a0c, 0x0db4, 0xa0c4, 0x9420, 0xa0c8, 0x9319, 0x0804,
+	0x1fbd, 0xa1dc, 0x2400, 0x9122, 0xa1e0, 0x2300, 0x911b, 0x0a0c,
+	0x0db4, 0xa0d4, 0x9420, 0xa0d8, 0x9319, 0x0804, 0x1fbd, 0x9082,
+	0x001b, 0x0002, 0x1f7d, 0x1f7b, 0x1f7b, 0x1f7b, 0x1f7b, 0x1f7b,
+	0x1f8a, 0x1f7b, 0x1f7b, 0x1f7b, 0x1f7b, 0x1f7b, 0x1f97, 0x1f7b,
+	0x1f7b, 0x1f7b, 0x1f7b, 0x1f7b, 0x1fa4, 0x1f7b, 0x1f7b, 0x1f7b,
+	0x1f7b, 0x1f7b, 0x1fb1, 0x080c, 0x0db4, 0xa17c, 0x2400, 0x9122,
+	0xa180, 0x2300, 0x911b, 0x0a0c, 0x0db4, 0xa06c, 0x9420, 0xa070,
+	0x9319, 0x0498, 0xa194, 0x2400, 0x9122, 0xa198, 0x2300, 0x911b,
+	0x0a0c, 0x0db4, 0xa084, 0x9420, 0xa088, 0x9319, 0x0430, 0xa1ac,
+	0x2400, 0x9122, 0xa1b0, 0x2300, 0x911b, 0x0a0c, 0x0db4, 0xa09c,
+	0x9420, 0xa0a0, 0x9319, 0x00c8, 0xa1c4, 0x2400, 0x9122, 0xa1c8,
+	0x2300, 0x911b, 0x0a0c, 0x0db4, 0xa0b4, 0x9420, 0xa0b8, 0x9319,
+	0x0060, 0xa1dc, 0x2400, 0x9122, 0xa1e0, 0x2300, 0x911b, 0x0a0c,
+	0x0db4, 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, 0xd0bc, 0x190c,
+	0x0dad, 0x9084, 0x0007, 0x0002, 0x1fee, 0x1c18, 0x1fee, 0x1fe4,
+	0x1fe7, 0x1fea, 0x1fe7, 0x1fea, 0x080c, 0x1c18, 0x0005, 0x080c,
+	0x1186, 0x0005, 0x080c, 0x1c18, 0x080c, 0x1186, 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, 0x210d, 0x7900, 0xd1dc, 0x1118, 0x9084,
+	0x0006, 0x001a, 0x9084, 0x000e, 0x0002, 0x2035, 0x202d, 0x7696,
+	0x202d, 0x202f, 0x202f, 0x202f, 0x202f, 0x767c, 0x202d, 0x2031,
+	0x202d, 0x202f, 0x202d, 0x202f, 0x202d, 0x080c, 0x0db4, 0x0031,
+	0x0020, 0x080c, 0x767c, 0x080c, 0x7696, 0x0005, 0x0006, 0x0016,
+	0x0026, 0x080c, 0xd504, 0x7930, 0x9184, 0x0003, 0x01c0, 0x2001,
+	0x19c5, 0x2004, 0x9005, 0x0170, 0x2001, 0x0133, 0x2004, 0x9005,
+	0x090c, 0x0db4, 0x00c6, 0x2001, 0x19c5, 0x2064, 0x080c, 0xb3e0,
+	0x00ce, 0x00f8, 0x2009, 0x0040, 0x080c, 0x2110, 0x00d0, 0x9184,
+	0x0014, 0x01a0, 0x6a00, 0x9286, 0x0003, 0x0160, 0x080c, 0x6d14,
+	0x1138, 0x080c, 0x6ff8, 0x080c, 0x5a94, 0x080c, 0x6c46, 0x0010,
+	0x080c, 0x5953, 0x080c, 0x7734, 0x0041, 0x0018, 0x9184, 0x9540,
+	0x1dc8, 0x002e, 0x001e, 0x000e, 0x0005, 0x00e6, 0x0036, 0x0046,
+	0x0056, 0x2071, 0x1a31, 0x080c, 0x18a6, 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, 0x0dad,
+	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, 0x290b, 0x080c, 0x2826,
+	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, 0x286a, 0x1238, 0x939d, 0x4003, 0x94a5,
+	0x8603, 0x230a, 0x2412, 0x0030, 0x939d, 0x0203, 0x94a5, 0x8603,
+	0x230a, 0x2412, 0x9006, 0x080c, 0x2855, 0x9006, 0x080c, 0x2838,
+	0x20a9, 0x0012, 0x1d04, 0x2162, 0x2091, 0x6000, 0x1f04, 0x2162,
+	0x602f, 0x0100, 0x602f, 0x0000, 0x6050, 0x9085, 0x0400, 0x9084,
+	0xdfff, 0x6052, 0x6024, 0x6026, 0x080c, 0x2544, 0x2009, 0x00ef,
+	0x6132, 0x6136, 0x080c, 0x2554, 0x60e7, 0x0000, 0x61ea, 0x60e3,
+	0x0002, 0x604b, 0xf7f7, 0x6043, 0x0000, 0x602f, 0x0080, 0x602f,
+	0x0000, 0x6007, 0x149f, 0x60bb, 0x0000, 0x20a9, 0x0018, 0x60bf,
+	0x0000, 0x1f04, 0x218f, 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, 0x1834, 0x2003, 0x0000, 0x2001, 0x1833,
+	0x2003, 0x0001, 0x0005, 0x0126, 0x2091, 0x2800, 0x0006, 0x0016,
+	0x0026, 0x6124, 0x9184, 0x5e2c, 0x1118, 0x9184, 0x0007, 0x002a,
+	0x9195, 0x0004, 0x9284, 0x0007, 0x0002, 0x21ef, 0x21d5, 0x21d8,
+	0x21db, 0x21e0, 0x21e2, 0x21e6, 0x21ea, 0x080c, 0x7ff8, 0x00b8,
+	0x080c, 0x80c5, 0x00a0, 0x080c, 0x80c5, 0x080c, 0x7ff8, 0x0078,
+	0x0099, 0x0068, 0x080c, 0x7ff8, 0x0079, 0x0048, 0x080c, 0x80c5,
+	0x0059, 0x0028, 0x080c, 0x80c5, 0x080c, 0x7ff8, 0x0029, 0x002e,
+	0x001e, 0x000e, 0x012e, 0x0005, 0x00a6, 0x6124, 0x6028, 0xd09c,
+	0x0118, 0xd19c, 0x1904, 0x243d, 0xd1f4, 0x190c, 0x0dad, 0x080c,
+	0x6d14, 0x0904, 0x224a, 0x080c, 0xbe86, 0x1120, 0x7000, 0x9086,
+	0x0003, 0x0570, 0x6024, 0x9084, 0x1800, 0x0550, 0x080c, 0x6d37,
+	0x0118, 0x080c, 0x6d25, 0x1520, 0x6027, 0x0020, 0x6043, 0x0000,
+	0x080c, 0xbe86, 0x0168, 0x080c, 0x6d37, 0x1150, 0x2001, 0x1976,
+	0x2003, 0x0001, 0x6027, 0x1800, 0x080c, 0x6b95, 0x0804, 0x2440,
+	0x70a0, 0x9005, 0x1150, 0x70a3, 0x0001, 0x00d6, 0x2069, 0x0140,
+	0x080c, 0x6d6b, 0x00de, 0x1904, 0x2440, 0x080c, 0x7002, 0x0428,
+	0x080c, 0x6d37, 0x1590, 0x6024, 0x9084, 0x1800, 0x1108, 0x0468,
+	0x080c, 0x7002, 0x080c, 0x6ff8, 0x080c, 0x5a94, 0x080c, 0x6c46,
+	0x0804, 0x243d, 0xd1ac, 0x1508, 0x6024, 0xd0dc, 0x1170, 0xd0e4,
+	0x1178, 0xd0d4, 0x1190, 0xd0cc, 0x0130, 0x7094, 0x9086, 0x0028,
+	0x1110, 0x080c, 0x6ee7, 0x0804, 0x243d, 0x080c, 0x6ffd, 0x0048,
+	0x2001, 0x194e, 0x2003, 0x0002, 0x0020, 0x080c, 0x6e4d, 0x0804,
+	0x243d, 0x080c, 0x6f81, 0x0804, 0x243d, 0xd1ac, 0x0904, 0x235e,
+	0x080c, 0x6d14, 0x11c0, 0x6027, 0x0020, 0x0006, 0x0026, 0x0036,
+	0x080c, 0x6d2e, 0x1158, 0x080c, 0x6ff8, 0x080c, 0x5a94, 0x080c,
+	0x6c46, 0x003e, 0x002e, 0x000e, 0x00ae, 0x0005, 0x003e, 0x002e,
+	0x000e, 0x080c, 0x6cec, 0x0016, 0x0046, 0x00c6, 0x644c, 0x9486,
+	0xf0f0, 0x1138, 0x2061, 0x0100, 0x644a, 0x6043, 0x0090, 0x6043,
+	0x0010, 0x74d6, 0x948c, 0xff00, 0x7038, 0xd084, 0x0178, 0x9186,
+	0xf800, 0x1160, 0x7044, 0xd084, 0x1148, 0xc085, 0x7046, 0x0036,
+	0x2418, 0x2011, 0x8016, 0x080c, 0x46b9, 0x003e, 0x080c, 0xbe7f,
+	0x1904, 0x233b, 0x9196, 0xff00, 0x05a8, 0x705c, 0x9084, 0x00ff,
+	0x810f, 0x81ff, 0x0110, 0x9116, 0x0568, 0x7130, 0xd184, 0x1550,
+	0x080c, 0x2fd4, 0x0128, 0xc18d, 0x7132, 0x080c, 0x630d, 0x1510,
+	0x6240, 0x9294, 0x0010, 0x0130, 0x6248, 0x9294, 0xff00, 0x9296,
+	0xff00, 0x01c0, 0x7030, 0xd08c, 0x0904, 0x233b, 0x7038, 0xd08c,
+	0x1140, 0x2001, 0x180c, 0x200c, 0xd1ac, 0x1904, 0x233b, 0xc1ad,
+	0x2102, 0x0036, 0x73d4, 0x2011, 0x8013, 0x080c, 0x46b9, 0x003e,
+	0x0804, 0x233b, 0x7038, 0xd08c, 0x1140, 0x2001, 0x180c, 0x200c,
+	0xd1ac, 0x1904, 0x233b, 0xc1ad, 0x2102, 0x0036, 0x73d4, 0x2011,
+	0x8013, 0x080c, 0x46b9, 0x003e, 0x7130, 0xc185, 0x7132, 0x2011,
+	0x1854, 0x220c, 0x00f0, 0x0016, 0x2009, 0x0001, 0x2011, 0x0100,
+	0x080c, 0x7f4a, 0x2019, 0x000e, 0x00c6, 0x2061, 0x0000, 0x080c,
+	0xd104, 0x00ce, 0x9484, 0x00ff, 0x9080, 0x2fd9, 0x200d, 0x918c,
+	0xff00, 0x810f, 0x2120, 0x9006, 0x2009, 0x000e, 0x080c, 0xd188,
+	0x001e, 0xd1ac, 0x1148, 0x0016, 0x2009, 0x0002, 0x2019, 0x0004,
+	0x080c, 0x2e4a, 0x001e, 0x0078, 0x0156, 0x00b6, 0x20a9, 0x007f,
+	0x900e, 0x080c, 0x5ff1, 0x1110, 0x080c, 0x5aae, 0x8108, 0x1f04,
+	0x2331, 0x00be, 0x015e, 0x00ce, 0x004e, 0x080c, 0x9a4e, 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, 0x1825, 0x2003, 0x0000, 0x6027, 0x0020, 0xd194, 0x0904,
+	0x243d, 0x0016, 0x6220, 0xd2b4, 0x0904, 0x23e6, 0x080c, 0x7dd3,
+	0x080c, 0x90c1, 0x6027, 0x0004, 0x00f6, 0x2019, 0x19bf, 0x2304,
+	0x907d, 0x0904, 0x23b5, 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, 0x29cc, 0x2001,
+	0x001e, 0x8001, 0x0240, 0x20a9, 0x0009, 0x080c, 0x28e6, 0x6904,
+	0xd1dc, 0x1140, 0x0cb0, 0x2001, 0x0100, 0x080c, 0x29bc, 0x9006,
+	0x080c, 0x29bc, 0x080c, 0x8589, 0x080c, 0x868e, 0x7814, 0x2048,
+	0xa867, 0x0103, 0x2f60, 0x080c, 0x9ac8, 0x009e, 0x00ee, 0x00ce,
+	0x00de, 0x00fe, 0x001e, 0x00ae, 0x0005, 0x00fe, 0x00d6, 0x2069,
+	0x0140, 0x6804, 0x9084, 0x4000, 0x0110, 0x080c, 0x29cc, 0x00de,
+	0x00c6, 0x2061, 0x19b6, 0x6028, 0x080c, 0xbe86, 0x0120, 0x909a,
+	0x0003, 0x1258, 0x0018, 0x909a, 0x00c8, 0x1238, 0x8000, 0x602a,
+	0x00ce, 0x080c, 0x909d, 0x0804, 0x243c, 0x2061, 0x0100, 0x62c0,
+	0x080c, 0x98d9, 0x2019, 0x19bf, 0x2304, 0x9065, 0x0120, 0x2009,
+	0x0027, 0x080c, 0x9b42, 0x00ce, 0x0804, 0x243c, 0xd2bc, 0x0904,
+	0x2429, 0x080c, 0x7de0, 0x6014, 0x9084, 0x1984, 0x9085, 0x0010,
+	0x6016, 0x6027, 0x0004, 0x00d6, 0x2069, 0x0140, 0x6804, 0x9084,
+	0x4000, 0x0110, 0x080c, 0x29cc, 0x00de, 0x00c6, 0x2061, 0x19b6,
+	0x6044, 0x080c, 0xbe86, 0x0120, 0x909a, 0x0003, 0x1628, 0x0018,
+	0x909a, 0x00c8, 0x1608, 0x8000, 0x6046, 0x603c, 0x00ce, 0x9005,
+	0x0558, 0x2009, 0x07d0, 0x080c, 0x7dd8, 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,
+	0x935a, 0x003e, 0x2019, 0x19c5, 0x2304, 0x9065, 0x0120, 0x2009,
+	0x004f, 0x080c, 0x9b42, 0x00ce, 0x001e, 0xd19c, 0x0904, 0x24af,
+	0x7038, 0xd0ac, 0x1904, 0x2484, 0x0016, 0x0156, 0x6027, 0x0008,
+	0x6050, 0x9085, 0x0040, 0x6052, 0x6050, 0x9084, 0xfbcf, 0x6052,
+	0x080c, 0x2905, 0x9085, 0x2000, 0x6052, 0x20a9, 0x0012, 0x1d04,
+	0x2457, 0x080c, 0x7e07, 0x1f04, 0x2457, 0x6050, 0x9085, 0x0400,
+	0x9084, 0xdfbf, 0x6052, 0x20a9, 0x0028, 0xa001, 0x1f04, 0x2465,
+	0x6150, 0x9185, 0x1400, 0x6052, 0x20a9, 0x0366, 0x1d04, 0x246e,
+	0x080c, 0x7e07, 0x6020, 0xd09c, 0x1130, 0x015e, 0x6152, 0x001e,
+	0x6027, 0x0008, 0x04a0, 0x080c, 0x28cd, 0x1f04, 0x246e, 0x015e,
+	0x6152, 0x001e, 0x6027, 0x0008, 0x0016, 0x6028, 0xc09c, 0x602a,
+	0x080c, 0x9a4e, 0x60e3, 0x0000, 0x080c, 0xd4e3, 0x080c, 0xd4fe,
+	0x080c, 0x5157, 0xd0fc, 0x1138, 0x080c, 0xbe7f, 0x1120, 0x9085,
+	0x0001, 0x080c, 0x6d5b, 0x9006, 0x080c, 0x29bc, 0x2009, 0x0002,
+	0x080c, 0x290b, 0x00e6, 0x2071, 0x1800, 0x7003, 0x0004, 0x080c,
+	0x0e80, 0x00ee, 0x6027, 0x0008, 0x080c, 0x0b8f, 0x001e, 0x918c,
+	0xffd0, 0x6126, 0x00ae, 0x0005, 0x0006, 0x0016, 0x0026, 0x0036,
+	0x00e6, 0x00f6, 0x0126, 0x2091, 0x8000, 0x2071, 0x1800, 0x71cc,
+	0x70ce, 0x9116, 0x0904, 0x2503, 0x81ff, 0x01a0, 0x2009, 0x0000,
+	0x080c, 0x290b, 0x2011, 0x8011, 0x2019, 0x010e, 0x231c, 0x939e,
+	0x0007, 0x1118, 0x2019, 0x0001, 0x0010, 0x2019, 0x0000, 0x080c,
+	0x46b9, 0x0448, 0x2001, 0x1977, 0x200c, 0x81ff, 0x1140, 0x2001,
+	0x0109, 0x2004, 0xd0b4, 0x0118, 0x2019, 0x0003, 0x0008, 0x2118,
+	0x2011, 0x8012, 0x080c, 0x46b9, 0x080c, 0x0e80, 0x080c, 0x5157,
+	0xd0fc, 0x1188, 0x080c, 0xbe7f, 0x1170, 0x00c6, 0x080c, 0x259f,
+	0x080c, 0x92c1, 0x2061, 0x0100, 0x2019, 0x0028, 0x2009, 0x0002,
+	0x080c, 0x2e4a, 0x00ce, 0x012e, 0x00fe, 0x00ee, 0x003e, 0x002e,
+	0x001e, 0x000e, 0x0005, 0x2028, 0x918c, 0x00ff, 0x2130, 0x9094,
+	0xff00, 0x11f0, 0x2011, 0x1836, 0x2214, 0xd2ac, 0x11c8, 0x81ff,
+	0x01e8, 0x2011, 0x181e, 0x2204, 0x9106, 0x1190, 0x2011, 0x181f,
+	0x2214, 0x9294, 0xff00, 0x9584, 0xff00, 0x9206, 0x1148, 0x2011,
+	0x181f, 0x2214, 0x9294, 0x00ff, 0x9584, 0x00ff, 0x9206, 0x1120,
+	0x2500, 0x080c, 0x7975, 0x0048, 0x9584, 0x00ff, 0x9080, 0x2fd9,
+	0x200d, 0x918c, 0xff00, 0x810f, 0x9006, 0x0005, 0x9080, 0x2fd9,
+	0x200d, 0x918c, 0x00ff, 0x0005, 0x00d6, 0x2069, 0x0140, 0x2001,
+	0x1817, 0x2003, 0x00ef, 0x20a9, 0x0010, 0x9006, 0x6852, 0x6856,
+	0x1f04, 0x254f, 0x00de, 0x0005, 0x0006, 0x00d6, 0x0026, 0x2069,
+	0x0140, 0x2001, 0x1817, 0x2102, 0x8114, 0x8214, 0x8214, 0x8214,
+	0x20a9, 0x0010, 0x6853, 0x0000, 0x9006, 0x82ff, 0x1128, 0x9184,
+	0x000f, 0x9080, 0xd9b8, 0x2005, 0x6856, 0x8211, 0x1f04, 0x2564,
+	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, 0x2594, 0x680f,
+	0x0000, 0x000e, 0x001e, 0x002e, 0x00de, 0x015e, 0x0005, 0x080c,
+	0x5153, 0xd0c4, 0x0150, 0xd0a4, 0x0140, 0x9006, 0x0046, 0x2020,
+	0x2009, 0x002e, 0x080c, 0xd188, 0x004e, 0x0005, 0x00f6, 0x0016,
+	0x0026, 0x2079, 0x0140, 0x78c4, 0xd0dc, 0x0904, 0x260b, 0x080c,
+	0x286a, 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, 0x7f8b, 0x928c, 0xff00, 0x0110, 0x2011,
+	0x00ff, 0x2200, 0x8007, 0x9085, 0x004c, 0x78c2, 0x2009, 0x0138,
+	0x220a, 0x080c, 0x6d14, 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, 0x0dad, 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, 0x0db4, 0x0033, 0x00ee, 0x002e, 0x001e, 0x000e,
+	0x015e, 0x0005, 0x2669, 0x2687, 0x26ab, 0x26ad, 0x26d6, 0x26d8,
+	0x26da, 0x2001, 0x0001, 0x080c, 0x24b4, 0x080c, 0x28c8, 0x2001,
+	0x1961, 0x2003, 0x0000, 0x7828, 0x9084, 0xe1d7, 0x782a, 0x9006,
+	0x20a9, 0x0009, 0x080c, 0x2886, 0x2001, 0x195f, 0x2003, 0x0006,
+	0x2009, 0x001e, 0x2011, 0x26db, 0x080c, 0x7de5, 0x0005, 0x2009,
+	0x1964, 0x200b, 0x0000, 0x2001, 0x1969, 0x2003, 0x0036, 0x2001,
+	0x1968, 0x2003, 0x002a, 0x2001, 0x1961, 0x2003, 0x0001, 0x9006,
+	0x080c, 0x2838, 0x2001, 0xffff, 0x20a9, 0x0009, 0x080c, 0x2886,
+	0x2001, 0x195f, 0x2003, 0x0006, 0x2009, 0x001e, 0x2011, 0x26db,
+	0x080c, 0x7de5, 0x0005, 0x080c, 0x0db4, 0x2001, 0x1969, 0x2003,
+	0x0036, 0x2001, 0x1961, 0x2003, 0x0003, 0x7a38, 0x9294, 0x0005,
+	0x9296, 0x0004, 0x0110, 0x9006, 0x0010, 0x2001, 0x0001, 0x080c,
+	0x2838, 0x2001, 0x1965, 0x2003, 0x0000, 0x2001, 0xffff, 0x20a9,
+	0x0009, 0x080c, 0x2886, 0x2001, 0x195f, 0x2003, 0x0006, 0x2009,
+	0x001e, 0x2011, 0x26db, 0x080c, 0x7de5, 0x0005, 0x080c, 0x0db4,
+	0x080c, 0x0db4, 0x0005, 0x0006, 0x0016, 0x0026, 0x00e6, 0x00f6,
+	0x0156, 0x0126, 0x2091, 0x8000, 0x2079, 0x0100, 0x2001, 0x1961,
+	0x2004, 0x908a, 0x0007, 0x1a0c, 0x0db4, 0x0043, 0x012e, 0x015e,
+	0x00fe, 0x00ee, 0x002e, 0x001e, 0x000e, 0x0005, 0x26fd, 0x271d,
+	0x275d, 0x278d, 0x27b1, 0x27c1, 0x27c3, 0x080c, 0x287a, 0x11b0,
+	0x7850, 0x9084, 0xefff, 0x7852, 0x2009, 0x1967, 0x2104, 0x7a38,
+	0x9294, 0x0005, 0x9296, 0x0004, 0x0110, 0xc08d, 0x0008, 0xc085,
+	0x200a, 0x2001, 0x195f, 0x2003, 0x0001, 0x0030, 0x080c, 0x27e7,
+	0x2001, 0xffff, 0x080c, 0x2678, 0x0005, 0x080c, 0x27c5, 0x05e0,
+	0x2009, 0x1968, 0x2104, 0x8001, 0x200a, 0x080c, 0x287a, 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,
+	0x27cd, 0x00c0, 0x200b, 0x0000, 0x7a38, 0x9294, 0x0006, 0x9296,
+	0x0004, 0x0110, 0x9006, 0x0010, 0x2001, 0x0001, 0x080c, 0x2855,
+	0x2001, 0x1961, 0x2003, 0x0002, 0x0028, 0x2001, 0x195f, 0x2003,
+	0x0003, 0x0010, 0x080c, 0x269a, 0x0005, 0x080c, 0x27c5, 0x0560,
+	0x2009, 0x1968, 0x2104, 0x8001, 0x200a, 0x080c, 0x287a, 0x1168,
+	0x7850, 0x9084, 0xefff, 0x7852, 0x2001, 0x195f, 0x2003, 0x0003,
+	0x2001, 0x1960, 0x2003, 0x0000, 0x00b8, 0x2009, 0x1968, 0x2104,
+	0x9005, 0x1118, 0x080c, 0x280a, 0x0010, 0x080c, 0x27da, 0x080c,
+	0x27cd, 0x2009, 0x1964, 0x200b, 0x0000, 0x2001, 0x1961, 0x2003,
+	0x0001, 0x080c, 0x269a, 0x0000, 0x0005, 0x04b9, 0x0508, 0x080c,
+	0x287a, 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, 0x26c5,
+	0x0005, 0x0099, 0x0168, 0x080c, 0x287a, 0x1138, 0x7850, 0x9084,
+	0xefff, 0x7852, 0x080c, 0x26b1, 0x0018, 0x0079, 0x080c, 0x26c5,
+	0x0005, 0x080c, 0x0db4, 0x080c, 0x0db4, 0x2009, 0x1969, 0x2104,
+	0x8001, 0x200a, 0x090c, 0x2826, 0x0005, 0x7a38, 0x9294, 0x0005,
+	0x9296, 0x0005, 0x0110, 0x9006, 0x0010, 0x2001, 0x0001, 0x080c,
+	0x2855, 0x0005, 0x7a38, 0x9294, 0x0006, 0x9296, 0x0006, 0x0110,
+	0x9006, 0x0010, 0x2001, 0x0001, 0x080c, 0x2838, 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,
+	0x2855, 0x0005, 0x0086, 0x2001, 0x1967, 0x2004, 0x9084, 0x7fff,
+	0x090c, 0x0db4, 0x2009, 0x1966, 0x2144, 0x8846, 0x280a, 0x9844,
+	0x0dd8, 0xd08c, 0x1120, 0xd084, 0x1120, 0x080c, 0x0db4, 0x9006,
+	0x0010, 0x2001, 0x0001, 0x00a1, 0x008e, 0x0005, 0x0006, 0x0156,
+	0x2001, 0x195f, 0x20a9, 0x0009, 0x2003, 0x0000, 0x8000, 0x1f04,
+	0x282c, 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, 0x2905,
+	0xd09c, 0x1110, 0x1f04, 0x287d, 0x015e, 0x0005, 0x0126, 0x0016,
+	0x0006, 0x2091, 0x8000, 0x7850, 0x9085, 0x0040, 0x7852, 0x7850,
+	0x9084, 0xfbcf, 0x7852, 0x080c, 0x2905, 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, 0x28b3, 0x080c, 0x7e07, 0x1f04,
+	0x28b3, 0x7850, 0x9085, 0x0400, 0x9084, 0xdfbf, 0x7852, 0x080c,
+	0x2905, 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, 0x28d7, 0x0028, 0x7854, 0xd08c, 0x1110,
+	0x1f04, 0x28dd, 0x00fe, 0x015e, 0x000e, 0x0005, 0x1d04, 0x28e6,
+	0x080c, 0x7e07, 0x1f04, 0x28e6, 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, 0x00a2, 0x080c, 0x0e2f,
+	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, 0x2009, 0x0000, 0x080c, 0x0e2f, 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, 0x6d2e,
+	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, 0x1128, 0x080c, 0x6d2e, 0x0110, 0xc0bc,
+	0x0008, 0xc0bd, 0x200a, 0x001e, 0x000e, 0x0005, 0x2c62, 0x2c62,
+	0x2a86, 0x2a86, 0x2a92, 0x2a92, 0x2a9e, 0x2a9e, 0x2aac, 0x2aac,
+	0x2ab8, 0x2ab8, 0x2ac6, 0x2ac6, 0x2ad4, 0x2ad4, 0x2ae6, 0x2ae6,
+	0x2af2, 0x2af2, 0x2b00, 0x2b00, 0x2b1e, 0x2b1e, 0x2b3e, 0x2b3e,
+	0x2b0e, 0x2b0e, 0x2b2e, 0x2b2e, 0x2b4c, 0x2b4c, 0x2ae4, 0x2ae4,
+	0x2ae4, 0x2ae4, 0x2ae4, 0x2ae4, 0x2ae4, 0x2ae4, 0x2ae4, 0x2ae4,
+	0x2ae4, 0x2ae4, 0x2ae4, 0x2ae4, 0x2ae4, 0x2ae4, 0x2ae4, 0x2ae4,
+	0x2ae4, 0x2ae4, 0x2ae4, 0x2ae4, 0x2ae4, 0x2ae4, 0x2ae4, 0x2ae4,
+	0x2ae4, 0x2ae4, 0x2ae4, 0x2ae4, 0x2ae4, 0x2ae4, 0x2b5e, 0x2b5e,
+	0x2b6a, 0x2b6a, 0x2b78, 0x2b78, 0x2b86, 0x2b86, 0x2b96, 0x2b96,
+	0x2ba4, 0x2ba4, 0x2bb4, 0x2bb4, 0x2bc4, 0x2bc4, 0x2bd6, 0x2bd6,
+	0x2be4, 0x2be4, 0x2bf4, 0x2bf4, 0x2c16, 0x2c16, 0x2c38, 0x2c38,
+	0x2c04, 0x2c04, 0x2c27, 0x2c27, 0x2c47, 0x2c47, 0x2ae4, 0x2ae4,
+	0x2ae4, 0x2ae4, 0x2ae4, 0x2ae4, 0x2ae4, 0x2ae4, 0x2ae4, 0x2ae4,
+	0x2ae4, 0x2ae4, 0x2ae4, 0x2ae4, 0x2ae4, 0x2ae4, 0x2ae4, 0x2ae4,
+	0x2ae4, 0x2ae4, 0x2ae4, 0x2ae4, 0x2ae4, 0x2ae4, 0x2ae4, 0x2ae4,
+	0x2ae4, 0x2ae4, 0x2ae4, 0x2ae4, 0x2ae4, 0x2ae4, 0x2ae4, 0x2ae4,
+	0x2ae4, 0x2ae4, 0x2ae4, 0x2ae4, 0x2ae4, 0x2ae4, 0x2ae4, 0x2ae4,
+	0x2ae4, 0x2ae4, 0x2ae4, 0x2ae4, 0x2ae4, 0x2ae4, 0x0106, 0x0006,
+	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x21bb,
+	0x0804, 0x2c5a, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
+	0x0146, 0x0156, 0x080c, 0x1fd3, 0x0804, 0x2c5a, 0x0106, 0x0006,
+	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x1fd3,
+	0x080c, 0x21bb, 0x0804, 0x2c5a, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x200e, 0x0804, 0x2c5a,
+	0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156,
+	0x080c, 0x21bb, 0x080c, 0x200e, 0x0804, 0x2c5a, 0x0106, 0x0006,
+	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x1fd3,
+	0x080c, 0x200e, 0x0804, 0x2c5a, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x1fd3, 0x080c, 0x21bb,
+	0x080c, 0x200e, 0x0804, 0x2c5a, 0xa001, 0x0cf0, 0x0106, 0x0006,
+	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x12f0,
+	0x0804, 0x2c5a, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
+	0x0146, 0x0156, 0x080c, 0x21bb, 0x080c, 0x12f0, 0x0804, 0x2c5a,
+	0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156,
+	0x080c, 0x1fd3, 0x080c, 0x12f0, 0x0804, 0x2c5a, 0x0106, 0x0006,
+	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x21bb,
+	0x080c, 0x12f0, 0x080c, 0x200e, 0x0804, 0x2c5a, 0x0106, 0x0006,
+	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x1fd3,
+	0x080c, 0x21bb, 0x080c, 0x12f0, 0x0804, 0x2c5a, 0x0106, 0x0006,
+	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x1fd3,
+	0x080c, 0x12f0, 0x080c, 0x200e, 0x0804, 0x2c5a, 0x0106, 0x0006,
+	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x12f0,
+	0x080c, 0x200e, 0x0804, 0x2c5a, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x1fd3, 0x080c, 0x21bb,
+	0x080c, 0x12f0, 0x080c, 0x200e, 0x0804, 0x2c5a, 0x0106, 0x0006,
+	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x260e,
+	0x0804, 0x2c5a, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
+	0x0146, 0x0156, 0x080c, 0x260e, 0x080c, 0x21bb, 0x0804, 0x2c5a,
+	0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156,
+	0x080c, 0x260e, 0x080c, 0x1fd3, 0x0804, 0x2c5a, 0x0106, 0x0006,
+	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x260e,
+	0x080c, 0x1fd3, 0x080c, 0x21bb, 0x0804, 0x2c5a, 0x0106, 0x0006,
+	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x260e,
+	0x080c, 0x200e, 0x0804, 0x2c5a, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x260e, 0x080c, 0x21bb,
+	0x080c, 0x200e, 0x0804, 0x2c5a, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x260e, 0x080c, 0x1fd3,
+	0x080c, 0x200e, 0x0804, 0x2c5a, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x260e, 0x080c, 0x1fd3,
+	0x080c, 0x21bb, 0x080c, 0x200e, 0x0804, 0x2c5a, 0x0106, 0x0006,
+	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x260e,
+	0x080c, 0x12f0, 0x0804, 0x2c5a, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x260e, 0x080c, 0x21bb,
+	0x080c, 0x12f0, 0x0804, 0x2c5a, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x260e, 0x080c, 0x1fd3,
+	0x080c, 0x12f0, 0x0804, 0x2c5a, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x260e, 0x080c, 0x21bb,
+	0x080c, 0x12f0, 0x080c, 0x200e, 0x0804, 0x2c5a, 0x0106, 0x0006,
+	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x260e,
+	0x080c, 0x1fd3, 0x080c, 0x21bb, 0x080c, 0x12f0, 0x0498, 0x0106,
+	0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c,
+	0x260e, 0x080c, 0x1fd3, 0x080c, 0x12f0, 0x080c, 0x200e, 0x0410,
+	0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156,
+	0x080c, 0x260e, 0x080c, 0x12f0, 0x080c, 0x200e, 0x0098, 0x0106,
+	0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c,
+	0x260e, 0x080c, 0x1fd3, 0x080c, 0x21bb, 0x080c, 0x12f0, 0x080c,
+	0x200e, 0x0000, 0x015e, 0x014e, 0x013e, 0x01de, 0x01ce, 0x012e,
+	0x000e, 0x010e, 0x000d, 0x00b6, 0x00c6, 0x0026, 0x0046, 0x9026,
+	0x080c, 0x62d3, 0x1904, 0x2d66, 0x72d8, 0x2001, 0x194d, 0x2004,
+	0x9005, 0x1110, 0xd29c, 0x0148, 0xd284, 0x1138, 0xd2bc, 0x1904,
+	0x2d66, 0x080c, 0x2d6b, 0x0804, 0x2d66, 0xd2cc, 0x1904, 0x2d66,
+	0x080c, 0x6d14, 0x1120, 0x70ab, 0xffff, 0x0804, 0x2d66, 0xd294,
+	0x0120, 0x70ab, 0xffff, 0x0804, 0x2d66, 0x080c, 0x2fcf, 0x0160,
+	0x080c, 0xbe86, 0x0128, 0x2001, 0x1817, 0x203c, 0x0804, 0x2cf8,
+	0x70ab, 0xffff, 0x0804, 0x2d66, 0x2001, 0x1817, 0x203c, 0x7290,
+	0xd284, 0x0904, 0x2cf8, 0xd28c, 0x1904, 0x2cf8, 0x0036, 0x73a8,
+	0x938e, 0xffff, 0x1110, 0x2019, 0x0001, 0x8314, 0x92e0, 0x1c80,
+	0x2c04, 0x938c, 0x0001, 0x0120, 0x9084, 0xff00, 0x8007, 0x0010,
+	0x9084, 0x00ff, 0x970e, 0x0590, 0x908e, 0x0000, 0x0578, 0x908e,
+	0x00ff, 0x1150, 0x7230, 0xd284, 0x1570, 0x7290, 0xc28d, 0x7292,
+	0x70ab, 0xffff, 0x003e, 0x0460, 0x0026, 0x2011, 0x0010, 0x080c,
+	0x6339, 0x002e, 0x0118, 0x70ab, 0xffff, 0x00f8, 0x900e, 0x080c,
+	0x250b, 0x080c, 0x5f91, 0x11a8, 0x080c, 0x6315, 0x1150, 0x7030,
+	0xd08c, 0x0118, 0xb800, 0xd0bc, 0x0120, 0x080c, 0x2d84, 0x0148,
+	0x0028, 0x080c, 0x2ec0, 0x080c, 0x2db0, 0x0118, 0x8318, 0x0804,
+	0x2cad, 0x73aa, 0x0010, 0x70ab, 0xffff, 0x003e, 0x0804, 0x2d66,
+	0x9780, 0x2fd9, 0x203d, 0x97bc, 0xff00, 0x873f, 0x2041, 0x007e,
+	0x70a8, 0x9096, 0xffff, 0x1118, 0x900e, 0x28a8, 0x0050, 0x9812,
+	0x0220, 0x2008, 0x9802, 0x20a8, 0x0020, 0x70ab, 0xffff, 0x0804,
+	0x2d66, 0x2700, 0x0156, 0x0016, 0x9106, 0x0904, 0x2d5b, 0x0026,
+	0x2011, 0x0010, 0x080c, 0x6339, 0x002e, 0x0120, 0x2009, 0xffff,
+	0x0804, 0x2d63, 0xc484, 0x080c, 0x5ff1, 0x0138, 0x080c, 0xbe86,
+	0x1590, 0x080c, 0x5f91, 0x15b8, 0x0008, 0xc485, 0x080c, 0x6315,
+	0x1130, 0x7030, 0xd08c, 0x01f8, 0xb800, 0xd0bc, 0x11e0, 0x7290,
+	0xd28c, 0x0180, 0x080c, 0x6315, 0x9082, 0x0006, 0x02e0, 0xd484,
+	0x1118, 0x080c, 0x5fb5, 0x0028, 0x080c, 0x2f4b, 0x01a0, 0x080c,
+	0x2f76, 0x0088, 0x080c, 0x2ec0, 0x080c, 0xbe86, 0x1160, 0x080c,
+	0x2db0, 0x0188, 0x0040, 0x080c, 0xbe86, 0x1118, 0x080c, 0x2f4b,
+	0x0110, 0x0451, 0x0140, 0x001e, 0x8108, 0x015e, 0x1f04, 0x2d11,
+	0x70ab, 0xffff, 0x0018, 0x001e, 0x015e, 0x71aa, 0x004e, 0x002e,
+	0x00ce, 0x00be, 0x0005, 0x00c6, 0x0016, 0x70ab, 0x0001, 0x2009,
+	0x007e, 0x080c, 0x5f91, 0x1168, 0xb813, 0x00ff, 0xb817, 0xfffe,
+	0x080c, 0x2ec0, 0x04a9, 0x0128, 0x70d8, 0xc0bd, 0x70da, 0x080c,
+	0xbbd8, 0x001e, 0x00ce, 0x0005, 0x0016, 0x0076, 0x00d6, 0x00c6,
+	0x2001, 0x1858, 0x2004, 0x9084, 0x00ff, 0xb842, 0x080c, 0x9b15,
+	0x01d0, 0x2b00, 0x6012, 0x080c, 0xbc01, 0x6023, 0x0001, 0x9006,
+	0x080c, 0x5f2e, 0x2001, 0x0000, 0x080c, 0x5f42, 0x0126, 0x2091,
+	0x8000, 0x70a4, 0x8000, 0x70a6, 0x012e, 0x2009, 0x0004, 0x080c,
+	0x9b42, 0x9085, 0x0001, 0x00ce, 0x00de, 0x007e, 0x001e, 0x0005,
+	0x0016, 0x0076, 0x00d6, 0x00c6, 0x2001, 0x1858, 0x2004, 0x9084,
+	0x00ff, 0xb842, 0x080c, 0x9b15, 0x0548, 0x2b00, 0x6012, 0xb800,
+	0xc0c4, 0xb802, 0xb8a0, 0x9086, 0x007e, 0x0140, 0xb804, 0x9084,
+	0x00ff, 0x9086, 0x0006, 0x1110, 0x080c, 0x2e7f, 0x080c, 0xbc01,
+	0x6023, 0x0001, 0x9006, 0x080c, 0x5f2e, 0x2001, 0x0002, 0x080c,
+	0x5f42, 0x0126, 0x2091, 0x8000, 0x70a4, 0x8000, 0x70a6, 0x012e,
+	0x2009, 0x0002, 0x080c, 0x9b42, 0x9085, 0x0001, 0x00ce, 0x00de,
+	0x007e, 0x001e, 0x0005, 0x00b6, 0x00c6, 0x0026, 0x2009, 0x0080,
+	0x080c, 0x5f91, 0x1140, 0xb813, 0x00ff, 0xb817, 0xfffc, 0x0039,
+	0x0110, 0x70df, 0xffff, 0x002e, 0x00ce, 0x00be, 0x0005, 0x0016,
+	0x0076, 0x00d6, 0x00c6, 0x080c, 0x9a72, 0x01d0, 0x2b00, 0x6012,
+	0x080c, 0xbc01, 0x6023, 0x0001, 0x9006, 0x080c, 0x5f2e, 0x2001,
+	0x0002, 0x080c, 0x5f42, 0x0126, 0x2091, 0x8000, 0x70e0, 0x8000,
+	0x70e2, 0x012e, 0x2009, 0x0002, 0x080c, 0x9b42, 0x9085, 0x0001,
+	0x00ce, 0x00de, 0x007e, 0x001e, 0x0005, 0x00c6, 0x00d6, 0x0126,
+	0x2091, 0x8000, 0x2009, 0x007f, 0x080c, 0x5f91, 0x11b8, 0xb813,
+	0x00ff, 0xb817, 0xfffd, 0xb8bf, 0x0004, 0x080c, 0x9a72, 0x0170,
+	0x2b00, 0x6012, 0x6316, 0x6023, 0x0001, 0x620a, 0x080c, 0xbc01,
+	0x2009, 0x0022, 0x080c, 0x9b42, 0x9085, 0x0001, 0x012e, 0x00de,
+	0x00ce, 0x0005, 0x00e6, 0x00c6, 0x0066, 0x0036, 0x0026, 0x00b6,
+	0x21f0, 0x080c, 0x8297, 0x080c, 0x8226, 0x080c, 0x9920, 0x080c,
+	0xaa0d, 0x3e08, 0x2130, 0x81ff, 0x0120, 0x20a9, 0x007e, 0x900e,
+	0x0018, 0x20a9, 0x007f, 0x900e, 0x0016, 0x080c, 0x5ff1, 0x1140,
+	0x9686, 0x0002, 0x1118, 0xb800, 0xd0bc, 0x1110, 0x080c, 0x5aae,
+	0x001e, 0x8108, 0x1f04, 0x2e64, 0x9686, 0x0001, 0x190c, 0x2fa3,
+	0x00be, 0x002e, 0x003e, 0x006e, 0x00ce, 0x00ee, 0x0005, 0x00e6,
+	0x00c6, 0x0036, 0x0026, 0x0016, 0x00b6, 0x6210, 0x2258, 0xbaa0,
+	0x0026, 0x2019, 0x0029, 0x080c, 0x828c, 0x0076, 0x2039, 0x0000,
+	0x080c, 0x8184, 0x2c08, 0x080c, 0xcef9, 0x007e, 0x001e, 0xba10,
+	0xbb14, 0x080c, 0x5aae, 0xba12, 0xbb16, 0x00be, 0x001e, 0x002e,
+	0x003e, 0x00ce, 0x00ee, 0x0005, 0x00e6, 0x0006, 0x00b6, 0x6010,
+	0x2058, 0xb8a0, 0x00be, 0x9086, 0x0080, 0x0150, 0x2071, 0x1800,
+	0x70a4, 0x9005, 0x0110, 0x8001, 0x70a6, 0x000e, 0x00ee, 0x0005,
+	0x2071, 0x1800, 0x70e0, 0x9005, 0x0dc0, 0x8001, 0x70e2, 0x0ca8,
+	0xb800, 0xc08c, 0xb802, 0x0005, 0x00f6, 0x00e6, 0x00c6, 0x00b6,
+	0x0036, 0x0026, 0x0016, 0x0156, 0x2178, 0x81ff, 0x1118, 0x20a9,
+	0x0001, 0x0080, 0x080c, 0x5153, 0xd0c4, 0x0148, 0x0040, 0x9006,
+	0x0046, 0x2020, 0x2009, 0x002d, 0x080c, 0xd188, 0x004e, 0x20a9,
+	0x0800, 0x9016, 0x0026, 0x928e, 0x007e, 0x0904, 0x2f2b, 0x928e,
+	0x007f, 0x0904, 0x2f2b, 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, 0x62df, 0x00ce, 0x00be, 0x2019,
+	0x0029, 0x080c, 0x828c, 0x0076, 0x2039, 0x0000, 0x080c, 0x8184,
+	0x00b6, 0x00c6, 0x0026, 0x2158, 0xba04, 0x9294, 0x00ff, 0x9286,
+	0x0006, 0x1118, 0xb807, 0x0404, 0x0028, 0x2001, 0x0004, 0x8007,
+	0x9215, 0xba06, 0x002e, 0x00ce, 0x00be, 0x0016, 0x2c08, 0x080c,
+	0xcef9, 0x001e, 0x007e, 0x002e, 0x8210, 0x1f04, 0x2ee2, 0x015e,
+	0x001e, 0x002e, 0x003e, 0x00be, 0x00ce, 0x00ee, 0x00fe, 0x0005,
+	0x0046, 0x0026, 0x0016, 0x080c, 0x5153, 0xd0c4, 0x0140, 0xd0a4,
+	0x0130, 0x9006, 0x2220, 0x2009, 0x0029, 0x080c, 0xd188, 0x001e,
+	0x002e, 0x004e, 0x0005, 0x0016, 0x0026, 0x0036, 0x00c6, 0x7290,
+	0x82ff, 0x01e8, 0x080c, 0x630d, 0x11d0, 0x2100, 0x080c, 0x253e,
+	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,
+	0x1a77, 0x001e, 0x6112, 0x080c, 0x2e7f, 0x001e, 0x080c, 0x5fb5,
+	0x012e, 0x00ce, 0x001e, 0x0005, 0x0016, 0x0026, 0x2110, 0x080c,
+	0x95bc, 0x080c, 0xd43b, 0x002e, 0x001e, 0x0005, 0x2001, 0x1836,
+	0x2004, 0xd0cc, 0x0005, 0x00c6, 0x00b6, 0x080c, 0x6d14, 0x1118,
+	0x20a9, 0x0800, 0x0010, 0x20a9, 0x0782, 0x080c, 0x6d14, 0x1110,
+	0x900e, 0x0010, 0x2009, 0x007e, 0x9180, 0x1000, 0x2004, 0x905d,
+	0x0130, 0x86ff, 0x0110, 0xb800, 0xd0bc, 0x090c, 0x5fb5, 0x8108,
+	0x1f04, 0x2fb4, 0x2061, 0x1800, 0x607b, 0x0000, 0x607c, 0x9084,
+	0x00ff, 0x607e, 0x60af, 0x0000, 0x00be, 0x00ce, 0x0005, 0x2001,
+	0x1875, 0x2004, 0xd0bc, 0x0005, 0x2011, 0x1854, 0x2214, 0xd2ec,
+	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, 0x1005, 0x090c, 0x0db4, 0x2900,
+	0x706a, 0xa867, 0x0002, 0xa8ab, 0xdcb0, 0x080c, 0x1005, 0x090c,
+	0x0db4, 0x2900, 0x706e, 0xa867, 0x0002, 0xa8ab, 0xdcb0, 0x0005,
+	0x2071, 0x1894, 0x7004, 0x0002, 0x3108, 0x3109, 0x311c, 0x3130,
+	0x0005, 0x1004, 0x3119, 0x0e04, 0x3119, 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,
+	0x3204, 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, 0x61cc, 0x0042, 0x2100, 0x908a,
+	0x003f, 0x1a04, 0x3201, 0x61cc, 0x0804, 0x3196, 0x31d8, 0x3210,
+	0x321a, 0x321e, 0x3228, 0x322e, 0x3232, 0x3242, 0x3245, 0x324f,
+	0x3254, 0x3259, 0x3264, 0x326f, 0x327e, 0x328d, 0x329b, 0x32b2,
+	0x32cd, 0x3201, 0x3376, 0x33b4, 0x345a, 0x346b, 0x348e, 0x3201,
+	0x3201, 0x3201, 0x34c6, 0x34e2, 0x34eb, 0x351a, 0x3520, 0x3201,
+	0x3566, 0x3201, 0x3201, 0x3201, 0x3201, 0x3201, 0x3571, 0x357a,
+	0x3582, 0x3584, 0x3201, 0x3201, 0x3201, 0x3201, 0x3201, 0x3201,
+	0x35b0, 0x3201, 0x3201, 0x3201, 0x3201, 0x3201, 0x35cd, 0x3628,
+	0x3201, 0x3201, 0x3201, 0x3201, 0x3201, 0x3201, 0x0002, 0x3652,
+	0x3655, 0x36b4, 0x36cd, 0x36fd, 0x399b, 0x3201, 0x4d2c, 0x3201,
+	0x3201, 0x3201, 0x3201, 0x3201, 0x3201, 0x3201, 0x3201, 0x324f,
+	0x3254, 0x3ebc, 0x5177, 0x3ed2, 0x4dbb, 0x4e0c, 0x4f0f, 0x3201,
+	0x4f71, 0x4fad, 0x4fde, 0x50e2, 0x500b, 0x5062, 0x3201, 0x3ed6,
+	0x4077, 0x408d, 0x40b2, 0x4117, 0x418b, 0x41ab, 0x4222, 0x4233,
+	0x424b, 0x424e, 0x4273, 0x42e6, 0x434c, 0x4354, 0x4486, 0x45e3,
+	0x4617, 0x4861, 0x3201, 0x487f, 0x493e, 0x4a14, 0x3201, 0x3201,
+	0x3201, 0x3201, 0x4a7a, 0x4a95, 0x4354, 0x4cdb, 0x714c, 0x0000,
+	0x2021, 0x4000, 0x080c, 0x4695, 0x0126, 0x2091, 0x8000, 0x0e04,
+	0x31e2, 0x0010, 0x012e, 0x0cc0, 0x7c36, 0x9486, 0x4000, 0x0118,
+	0x7833, 0x0011, 0x0010, 0x7833, 0x0010, 0x7c82, 0x7986, 0x7a8a,
+	0x7b8e, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c,
+	0x117e, 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, 0x46a2, 0x7883, 0x0004, 0x7884, 0x0807, 0x2039, 0x0001,
+	0x902e, 0x2520, 0x7b88, 0x7a8c, 0x7884, 0x7990, 0x0804, 0x46a5,
+	0x7984, 0x7888, 0x2114, 0x200a, 0x0804, 0x31d8, 0x7984, 0x2114,
+	0x0804, 0x31d8, 0x20e1, 0x0000, 0x2099, 0x0021, 0x20e9, 0x0000,
+	0x20a1, 0x0021, 0x20a9, 0x001f, 0x4003, 0x7984, 0x7a88, 0x7b8c,
+	0x0804, 0x31d8, 0x7884, 0x2060, 0x04d8, 0x2009, 0x0003, 0x2011,
+	0x0002, 0x2019, 0x0015, 0x789b, 0x0317, 0x0804, 0x31d8, 0x2039,
+	0x0001, 0x7d98, 0x7c9c, 0x0800, 0x2039, 0x0001, 0x7d98, 0x7c9c,
+	0x0848, 0x79a0, 0x9182, 0x0040, 0x0210, 0x0804, 0x320d, 0x2138,
+	0x7d98, 0x7c9c, 0x0804, 0x3214, 0x79a0, 0x9182, 0x0040, 0x0210,
+	0x0804, 0x320d, 0x2138, 0x7d98, 0x7c9c, 0x0804, 0x3222, 0x79a0,
+	0x9182, 0x0040, 0x0210, 0x0804, 0x320d, 0x21e8, 0x7984, 0x7888,
+	0x20a9, 0x0001, 0x21a0, 0x4004, 0x0804, 0x31d8, 0x2061, 0x0800,
+	0xe10c, 0x9006, 0x2c15, 0x9200, 0x8c60, 0x8109, 0x1dd8, 0x2010,
+	0x9005, 0x0904, 0x31d8, 0x0804, 0x3207, 0x79a0, 0x9182, 0x0040,
+	0x0210, 0x0804, 0x320d, 0x21e0, 0x20a9, 0x0001, 0x7984, 0x2198,
+	0x4012, 0x0804, 0x31d8, 0x2069, 0x1853, 0x7884, 0x7990, 0x911a,
+	0x1a04, 0x320d, 0x8019, 0x0904, 0x320d, 0x684a, 0x6942, 0x788c,
+	0x6852, 0x7888, 0x6856, 0x9006, 0x685a, 0x685e, 0x080c, 0x7029,
+	0x0804, 0x31d8, 0x2069, 0x1853, 0x7884, 0x7994, 0x911a, 0x1a04,
+	0x320d, 0x8019, 0x0904, 0x320d, 0x684e, 0x6946, 0x788c, 0x6862,
+	0x7888, 0x6866, 0x9006, 0x686a, 0x686e, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x63ca, 0x012e, 0x0804, 0x31d8, 0x902e, 0x2520, 0x81ff,
+	0x0120, 0x2009, 0x0001, 0x0804, 0x320a, 0x7984, 0x7b88, 0x7a8c,
+	0x20a9, 0x0005, 0x20e9, 0x0001, 0x20a1, 0x189c, 0x4101, 0x080c,
+	0x4659, 0x1120, 0x2009, 0x0002, 0x0804, 0x320a, 0x2009, 0x0020,
+	0xa85c, 0x9080, 0x0019, 0xaf60, 0x080c, 0x46a2, 0x701f, 0x32f1,
+	0x0005, 0xa864, 0x2008, 0x9084, 0x00ff, 0x9096, 0x0011, 0x0168,
+	0x9096, 0x0019, 0x0150, 0x9096, 0x0015, 0x0138, 0x9096, 0x0048,
+	0x0120, 0x9096, 0x0029, 0x1904, 0x320a, 0x810f, 0x918c, 0x00ff,
+	0x0904, 0x320a, 0x7112, 0x7010, 0x8001, 0x0560, 0x7012, 0x080c,
+	0x4659, 0x1120, 0x2009, 0x0002, 0x0804, 0x320a, 0x2009, 0x0020,
+	0x7068, 0x2040, 0xa28c, 0xa390, 0xa494, 0xa598, 0x9290, 0x0040,
+	0x9399, 0x0000, 0x94a1, 0x0000, 0x95a9, 0x0000, 0xa85c, 0x9080,
+	0x0019, 0xaf60, 0x080c, 0x46a2, 0x701f, 0x332f, 0x0005, 0xa864,
+	0x9084, 0x00ff, 0x9096, 0x0002, 0x0120, 0x9096, 0x000a, 0x1904,
+	0x320a, 0x0888, 0x7014, 0x2048, 0xa868, 0xc0fd, 0xa86a, 0xa864,
+	0x9084, 0x00ff, 0x9096, 0x0029, 0x1160, 0xc2fd, 0xaa7a, 0x080c,
+	0x5ba0, 0x0150, 0x0126, 0x2091, 0x8000, 0xa87a, 0xa982, 0x012e,
+	0x0050, 0x080c, 0x5ea7, 0x1128, 0x7007, 0x0003, 0x701f, 0x335b,
+	0x0005, 0x080c, 0x682c, 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, 0x46a5, 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, 0x320a, 0x7984,
+	0x080c, 0x5ff1, 0x1904, 0x320d, 0x7e98, 0x9684, 0x3fff, 0x9082,
+	0x4000, 0x1a04, 0x320d, 0x7c88, 0x7d8c, 0x080c, 0x6154, 0x080c,
+	0x6123, 0x0000, 0x1518, 0x2061, 0x1cd0, 0x0126, 0x2091, 0x8000,
+	0x6000, 0x9086, 0x0000, 0x0148, 0x6014, 0x904d, 0x0130, 0xa86c,
+	0x9406, 0x1118, 0xa870, 0x9506, 0x0150, 0x012e, 0x9ce0, 0x0018,
+	0x2001, 0x1819, 0x2004, 0x9c02, 0x1a04, 0x320a, 0x0c30, 0x080c,
+	0xb3e0, 0x012e, 0x0904, 0x320a, 0x0804, 0x31d8, 0x900e, 0x2001,
+	0x0005, 0x080c, 0x682c, 0x0126, 0x2091, 0x8000, 0x080c, 0xba81,
+	0x080c, 0x65f2, 0x012e, 0x0804, 0x31d8, 0x00a6, 0x2950, 0xb198,
+	0x080c, 0x5ff1, 0x1904, 0x3447, 0xb6a4, 0x9684, 0x3fff, 0x9082,
+	0x4000, 0x16e8, 0xb49c, 0xb5a0, 0x080c, 0x6154, 0x080c, 0x6123,
+	0x1520, 0x2061, 0x1cd0, 0x0126, 0x2091, 0x8000, 0x6000, 0x9086,
+	0x0000, 0x0148, 0x6014, 0x904d, 0x0130, 0xa86c, 0x9406, 0x1118,
+	0xa870, 0x9506, 0x0158, 0x012e, 0x9ce0, 0x0018, 0x2001, 0x1819,
+	0x2004, 0x9c02, 0x2009, 0x000d, 0x12b0, 0x0c28, 0x080c, 0xb3e0,
+	0x012e, 0x2009, 0x0003, 0x0178, 0x00e0, 0x900e, 0x2001, 0x0005,
+	0x080c, 0x682c, 0x0126, 0x2091, 0x8000, 0x080c, 0xba81, 0x080c,
+	0x65e5, 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, 0x320a, 0x080c, 0x4670, 0x0904,
+	0x320d, 0x080c, 0x60b8, 0x0904, 0x320a, 0x080c, 0x615a, 0x0904,
+	0x320a, 0x0804, 0x41a2, 0x81ff, 0x1904, 0x320a, 0x080c, 0x468c,
+	0x0904, 0x320d, 0x080c, 0x61e8, 0x0904, 0x320a, 0x2019, 0x0005,
+	0x79a8, 0x080c, 0x6175, 0x0904, 0x320a, 0x7888, 0x908a, 0x1000,
+	0x1a04, 0x320d, 0x8003, 0x800b, 0x810b, 0x9108, 0x080c, 0x7d64,
+	0x7984, 0xd184, 0x1904, 0x31d8, 0x0804, 0x41a2, 0x0126, 0x2091,
+	0x8000, 0x81ff, 0x0118, 0x2009, 0x0001, 0x0450, 0x2029, 0x07ff,
+	0x6458, 0x2400, 0x9506, 0x01f8, 0x2508, 0x080c, 0x5ff1, 0x11d8,
+	0x080c, 0x61e8, 0x1128, 0x2009, 0x0002, 0x62bc, 0x2518, 0x00c0,
+	0x2019, 0x0004, 0x900e, 0x080c, 0x6175, 0x1118, 0x2009, 0x0006,
+	0x0078, 0x7884, 0x908a, 0x1000, 0x1270, 0x8003, 0x800b, 0x810b,
+	0x9108, 0x080c, 0x7d64, 0x8529, 0x1ae0, 0x012e, 0x0804, 0x31d8,
+	0x012e, 0x0804, 0x320a, 0x012e, 0x0804, 0x320d, 0x080c, 0x4670,
+	0x0904, 0x320d, 0x080c, 0x60b8, 0x0904, 0x320a, 0xbaa0, 0x2019,
+	0x0005, 0x00c6, 0x9066, 0x080c, 0x828c, 0x0076, 0x903e, 0x080c,
+	0x8184, 0x900e, 0x080c, 0xcef9, 0x007e, 0x00ce, 0x080c, 0x6154,
+	0x0804, 0x31d8, 0x080c, 0x4670, 0x0904, 0x320d, 0x080c, 0x6154,
+	0x2208, 0x0804, 0x31d8, 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, 0x34fc, 0x2300, 0x9218, 0x00ee,
+	0x00de, 0x015e, 0x0804, 0x31d8, 0x00f6, 0x0016, 0x907d, 0x0138,
+	0x9006, 0x8000, 0x2f0c, 0x81ff, 0x0110, 0x2178, 0x0cd0, 0x001e,
+	0x00fe, 0x0005, 0x2069, 0x1906, 0x6910, 0x62b8, 0x0804, 0x31d8,
+	0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x320a, 0x0126, 0x2091,
+	0x8000, 0x080c, 0x5167, 0x0128, 0x2009, 0x0007, 0x012e, 0x0804,
+	0x320a, 0x012e, 0x6158, 0x9190, 0x2fd9, 0x2215, 0x9294, 0x00ff,
+	0x6378, 0x83ff, 0x0108, 0x627c, 0x67d8, 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, 0x6d14, 0x1118,
+	0x2031, 0x0004, 0x0038, 0xd79c, 0x0120, 0x2009, 0x0005, 0x0804,
+	0x320a, 0x9036, 0x7e9a, 0x7f9e, 0x0804, 0x31d8, 0x6148, 0x624c,
+	0x2019, 0x1955, 0x231c, 0x2001, 0x1956, 0x2004, 0x789a, 0x0804,
+	0x31d8, 0x0126, 0x2091, 0x8000, 0x6138, 0x623c, 0x6340, 0x012e,
+	0x0804, 0x31d8, 0x080c, 0x468c, 0x0904, 0x320d, 0xba44, 0xbb38,
+	0x0804, 0x31d8, 0x080c, 0x0db4, 0x080c, 0x468c, 0x2110, 0x0904,
+	0x320d, 0xb804, 0x908c, 0x00ff, 0x918e, 0x0006, 0x0140, 0x9084,
+	0xff00, 0x9086, 0x0600, 0x2009, 0x0009, 0x1904, 0x320a, 0x0126,
+	0x2091, 0x8000, 0x2019, 0x0005, 0x00c6, 0x9066, 0x080c, 0x95bc,
+	0x080c, 0x828c, 0x0076, 0x903e, 0x080c, 0x8184, 0x900e, 0x080c,
+	0xcef9, 0x007e, 0x00ce, 0xb807, 0x0407, 0x012e, 0x0804, 0x31d8,
+	0x6148, 0x624c, 0x7884, 0x604a, 0x7b88, 0x634e, 0x2069, 0x1853,
+	0x831f, 0x9305, 0x6816, 0x788c, 0x2069, 0x1955, 0x2d1c, 0x206a,
+	0x7e98, 0x9682, 0x0014, 0x1210, 0x2031, 0x07d0, 0x2069, 0x1956,
+	0x2d04, 0x266a, 0x789a, 0x0804, 0x31d8, 0x0126, 0x2091, 0x8000,
+	0x6138, 0x7884, 0x603a, 0x910e, 0xd1b4, 0x190c, 0x0e9b, 0xd0c4,
+	0x01a8, 0x00d6, 0x78a8, 0x2009, 0x196c, 0x200a, 0x78ac, 0x2011,
+	0x196d, 0x2012, 0x2069, 0x0100, 0x6838, 0x9086, 0x0007, 0x1118,
+	0x2214, 0x6a5a, 0x0010, 0x210c, 0x695a, 0x00de, 0x7888, 0x603e,
+	0x2011, 0x0114, 0x220c, 0x7888, 0xd08c, 0x0118, 0x918d, 0x0080,
+	0x0010, 0x918c, 0xff7f, 0x2112, 0x6140, 0x788c, 0x6042, 0x910e,
+	0xd1e4, 0x190c, 0x0eb1, 0x6040, 0xd0cc, 0x0120, 0x78b0, 0x2011,
+	0x0114, 0x2012, 0x012e, 0x0804, 0x31d8, 0x00f6, 0x2079, 0x1800,
+	0x7a38, 0xa898, 0x9084, 0xfebf, 0x9215, 0xa89c, 0x9084, 0xfebf,
+	0x8002, 0x9214, 0x7838, 0x9084, 0x0140, 0x9215, 0x7a3a, 0xa897,
+	0x4000, 0x900e, 0x9085, 0x0001, 0x2001, 0x0000, 0x00fe, 0x0005,
+	0x7898, 0x9005, 0x01a8, 0x7888, 0x9025, 0x0904, 0x320d, 0x788c,
+	0x902d, 0x0904, 0x320d, 0x900e, 0x080c, 0x5ff1, 0x1120, 0xba44,
+	0xbb38, 0xbc46, 0xbd3a, 0x9186, 0x07ff, 0x0190, 0x8108, 0x0ca0,
+	0x080c, 0x468c, 0x0904, 0x320d, 0x7888, 0x900d, 0x0904, 0x320d,
+	0x788c, 0x9005, 0x0904, 0x320d, 0xba44, 0xb946, 0xbb38, 0xb83a,
+	0x0804, 0x31d8, 0x2011, 0xbc09, 0x0010, 0x2011, 0xbc05, 0x080c,
+	0x5167, 0x1904, 0x320a, 0x00c6, 0x2061, 0x0100, 0x7984, 0x9186,
+	0x00ff, 0x1130, 0x2001, 0x1817, 0x2004, 0x9085, 0xff00, 0x0088,
+	0x9182, 0x007f, 0x16e0, 0x9188, 0x2fd9, 0x210d, 0x918c, 0x00ff,
+	0x2001, 0x1817, 0x2004, 0x0026, 0x9116, 0x002e, 0x0580, 0x810f,
+	0x9105, 0x0126, 0x2091, 0x8000, 0x0006, 0x080c, 0x9a72, 0x000e,
+	0x0510, 0x602e, 0x620a, 0x7984, 0x00b6, 0x080c, 0x5f97, 0x2b08,
+	0x00be, 0x1500, 0x6112, 0x6023, 0x0001, 0x080c, 0x4659, 0x01d0,
+	0x9006, 0xa866, 0x7007, 0x0003, 0xa832, 0xa868, 0xc0fd, 0xa86a,
+	0x701f, 0x36ad, 0x2900, 0x6016, 0x2009, 0x0032, 0x080c, 0x9b42,
+	0x012e, 0x00ce, 0x0005, 0x012e, 0x00ce, 0x0804, 0x320a, 0x00ce,
+	0x0804, 0x320d, 0x080c, 0x9ac8, 0x0cb0, 0xa830, 0x9086, 0x0100,
+	0x0904, 0x320a, 0x0804, 0x31d8, 0x2061, 0x1a3e, 0x0126, 0x2091,
+	0x8000, 0x6000, 0xd084, 0x0170, 0x6104, 0x6208, 0x2061, 0x1800,
+	0x6350, 0x6070, 0x789a, 0x60bc, 0x789e, 0x60b8, 0x78aa, 0x012e,
+	0x0804, 0x31d8, 0x900e, 0x2110, 0x0c88, 0x81ff, 0x1904, 0x320a,
+	0x080c, 0x6d14, 0x0904, 0x320a, 0x0126, 0x2091, 0x8000, 0x6250,
+	0x6070, 0x9202, 0x0248, 0x9085, 0x0001, 0x080c, 0x2574, 0x080c,
+	0x5377, 0x012e, 0x0804, 0x31d8, 0x012e, 0x0804, 0x320d, 0x0006,
+	0x0016, 0x00c6, 0x00e6, 0x2001, 0x1978, 0x2070, 0x2061, 0x1853,
+	0x6008, 0x2072, 0x900e, 0x2011, 0x1400, 0x080c, 0x7f8b, 0x7206,
+	0x00ee, 0x00ce, 0x001e, 0x000e, 0x0005, 0x0126, 0x2091, 0x8000,
+	0x81ff, 0x0128, 0x012e, 0x2021, 0x400b, 0x0804, 0x31da, 0x7884,
+	0xd0fc, 0x0148, 0x2001, 0x002a, 0x2004, 0x9082, 0x00e1, 0x0288,
+	0x012e, 0x0804, 0x320d, 0x2001, 0x002a, 0x2004, 0x2069, 0x1853,
+	0x6908, 0x9102, 0x1230, 0x012e, 0x0804, 0x320d, 0x012e, 0x0804,
+	0x320a, 0x080c, 0x9a47, 0x0dd0, 0x7884, 0xd0fc, 0x0904, 0x3778,
+	0x00c6, 0x080c, 0x4659, 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, 0x38fe,
+	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, 0x46a2, 0x701f, 0x383b, 0x7023, 0x0001, 0x012e, 0x0005,
+	0x0046, 0x0086, 0x0096, 0x00a6, 0x00b6, 0x00c6, 0x00d6, 0x00e6,
+	0x00f6, 0x080c, 0x36e7, 0x2001, 0x196e, 0x2003, 0x0000, 0x2021,
+	0x000a, 0x2061, 0x0100, 0x6104, 0x0016, 0x60bb, 0x0000, 0x60bf,
+	0x32e1, 0x60bf, 0x0012, 0x080c, 0x396d, 0x080c, 0x392c, 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, 0x3d00, 0x008e, 0x00ee, 0x00fe, 0x080c, 0x3c2d, 0x080c,
+	0x3b32, 0x05b8, 0x2001, 0x020b, 0x2004, 0x9084, 0x0140, 0x1db8,
+	0x080c, 0x3d74, 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, 0x181f, 0x2004, 0x9106,
+	0x1168, 0x00c6, 0x2061, 0x0100, 0x6024, 0x9084, 0x1e00, 0x00ce,
+	0x0138, 0x080c, 0x3b3c, 0x080c, 0x3927, 0x0058, 0x080c, 0x3927,
+	0x080c, 0x3c98, 0x080c, 0x3c23, 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, 0x1296, 0x2009, 0x0028, 0x080c,
+	0x2110, 0x2001, 0x0227, 0x200c, 0x2102, 0x00fe, 0x00ee, 0x00de,
+	0x00ce, 0x00be, 0x00ae, 0x009e, 0x008e, 0x004e, 0x2001, 0x196e,
+	0x2004, 0x9005, 0x1118, 0x012e, 0x0804, 0x31d8, 0x012e, 0x2021,
+	0x400c, 0x0804, 0x31da, 0x0016, 0x0026, 0x0036, 0x0046, 0x0056,
+	0x0076, 0x0086, 0x0096, 0x00d6, 0x0156, 0x7014, 0x2048, 0x7020,
+	0x20a8, 0x8000, 0x7022, 0xa804, 0x9005, 0x0904, 0x3897, 0x2048,
+	0x1f04, 0x384b, 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, 0x46a2, 0x701f, 0x383b, 0x00b0, 0x8906, 0x8006,
+	0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x001b, 0x21a8,
+	0x27e0, 0x2098, 0x27e8, 0x20a0, 0x0006, 0x080c, 0x0f69, 0x000e,
+	0x080c, 0x46a5, 0x701f, 0x383b, 0x015e, 0x00de, 0x009e, 0x008e,
+	0x007e, 0x005e, 0x004e, 0x003e, 0x002e, 0x001e, 0x0005, 0x7014,
+	0x2048, 0xa864, 0x9086, 0x0103, 0x1118, 0x701f, 0x38fc, 0x0450,
+	0x7014, 0x2048, 0xa868, 0xc0fd, 0xa86a, 0x2009, 0x007f, 0x080c,
+	0x5f91, 0x0110, 0x9006, 0x0030, 0xb813, 0x00ff, 0xb817, 0xfffd,
+	0x080c, 0xbc50, 0x015e, 0x00de, 0x009e, 0x008e, 0x007e, 0x005e,
+	0x004e, 0x003e, 0x002e, 0x001e, 0x0904, 0x320a, 0x0016, 0x0026,
+	0x0036, 0x0046, 0x0056, 0x0076, 0x0086, 0x0096, 0x00d6, 0x0156,
+	0x701f, 0x38ce, 0x7007, 0x0003, 0x0804, 0x388c, 0xa830, 0x9086,
+	0x0100, 0x2021, 0x400c, 0x0904, 0x31da, 0x0076, 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, 0x0f69, 0x000e, 0x080c, 0x46a5, 0x007e, 0x701f,
+	0x383b, 0x7023, 0x0001, 0x0005, 0x0804, 0x31d8, 0x0156, 0x00c6,
+	0xa814, 0x908a, 0x001e, 0x0218, 0xa833, 0x001e, 0x0010, 0xa832,
+	0x0078, 0x81ff, 0x0168, 0x0016, 0x080c, 0x4659, 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, 0x4659,
+	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, 0x2110, 0x2001, 0x002a, 0x2004, 0x9084, 0xfff8, 0xa86e,
+	0x601a, 0xa873, 0x0000, 0x601f, 0x0000, 0x78ca, 0x9006, 0x600a,
+	0x600e, 0x00ce, 0x00ee, 0x00fe, 0x0005, 0x00e6, 0x080c, 0x4659,
+	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, 0x28fd, 0x1130, 0x9006, 0x080c, 0x2855, 0x9006, 0x080c,
+	0x2838, 0x7884, 0x9084, 0x0007, 0x0002, 0x39b8, 0x39c1, 0x39ca,
+	0x39b5, 0x39b5, 0x39b5, 0x39b5, 0x39b5, 0x012e, 0x0804, 0x320d,
+	0x2009, 0x0114, 0x2104, 0x9085, 0x0800, 0x200a, 0x080c, 0x3b86,
+	0x00c0, 0x2009, 0x0114, 0x2104, 0x9085, 0x4000, 0x200a, 0x080c,
+	0x3b86, 0x0078, 0x080c, 0x6d14, 0x1128, 0x012e, 0x2009, 0x0016,
+	0x0804, 0x320a, 0x81ff, 0x0128, 0x012e, 0x2021, 0x400b, 0x0804,
+	0x31da, 0x0086, 0x0096, 0x00a6, 0x00b6, 0x00c6, 0x00d6, 0x00e6,
+	0x00f6, 0x080c, 0x36e7, 0x2009, 0x0101, 0x210c, 0x0016, 0x7ec8,
+	0x7dcc, 0x9006, 0x2068, 0x2060, 0x2058, 0x080c, 0x3e4f, 0x080c,
+	0x3d9f, 0x903e, 0x2720, 0x00f6, 0x00e6, 0x0086, 0x2940, 0x2071,
+	0x1a34, 0x2079, 0x0090, 0x00d6, 0x2069, 0x0000, 0x6884, 0xd0b4,
+	0x0120, 0x68d4, 0x780e, 0x68d0, 0x780a, 0x00de, 0x2011, 0x0001,
+	0x080c, 0x3d00, 0x080c, 0x2905, 0x080c, 0x2905, 0x080c, 0x2905,
+	0x080c, 0x2905, 0x080c, 0x3d00, 0x008e, 0x00ee, 0x00fe, 0x080c,
+	0x3c2d, 0x2009, 0x9c40, 0x8109, 0x11b0, 0x080c, 0x3b3c, 0x2001,
+	0x0004, 0x200c, 0x918c, 0xfffd, 0x2102, 0x001e, 0x00fe, 0x00ee,
+	0x00de, 0x00ce, 0x00be, 0x00ae, 0x009e, 0x008e, 0x2009, 0x0017,
+	0x080c, 0x320a, 0x0cf8, 0x2001, 0x020b, 0x2004, 0x9084, 0x0140,
+	0x1d10, 0x00f6, 0x2079, 0x0000, 0x7884, 0x00fe, 0xd0bc, 0x0178,
+	0x2001, 0x0201, 0x200c, 0x81ff, 0x0150, 0x080c, 0x3c0b, 0x2d00,
+	0x9c05, 0x9b05, 0x0120, 0x080c, 0x3b3c, 0x0804, 0x3ae9, 0x080c,
+	0x3d74, 0x080c, 0x3c98, 0x080c, 0x3bee, 0x080c, 0x3c23, 0x00f6,
+	0x2079, 0x0100, 0x7824, 0xd0ac, 0x0130, 0x8b58, 0x080c, 0x3b3c,
+	0x00fe, 0x0804, 0x3ae9, 0x00fe, 0x080c, 0x3b32, 0x1150, 0x8d68,
+	0x2001, 0x0032, 0x2602, 0x2001, 0x0033, 0x2502, 0x080c, 0x3b3c,
+	0x0080, 0x87ff, 0x0138, 0x2001, 0x0201, 0x2004, 0x9005, 0x1908,
+	0x8739, 0x0038, 0x2001, 0x1a31, 0x2004, 0x9086, 0x0000, 0x1904,
+	0x3a39, 0x2001, 0x032f, 0x2003, 0x00f6, 0x8631, 0x1208, 0x8529,
+	0x2500, 0x9605, 0x0904, 0x3ae9, 0x7884, 0xd0bc, 0x0128, 0x2d00,
+	0x9c05, 0x9b05, 0x1904, 0x3ae9, 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, 0x2110, 0x2900, 0xa85a, 0xa813, 0x0019, 0x7884, 0xd0a4,
+	0x1180, 0xa817, 0x0000, 0x00c6, 0x20a9, 0x0004, 0x2061, 0x0090,
+	0x602b, 0x0008, 0x2001, 0x0203, 0x2004, 0x1f04, 0x3ac0, 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,
+	0x39f3, 0x001e, 0x00c6, 0x2001, 0x032a, 0x2003, 0x0004, 0x2061,
+	0x0100, 0x6027, 0x0002, 0x6106, 0x2011, 0x020d, 0x2013, 0x0020,
+	0x2001, 0x0004, 0x200c, 0x918c, 0xfffd, 0x2102, 0x080c, 0x1296,
+	0x7884, 0x9084, 0x0003, 0x9086, 0x0002, 0x01a0, 0x2009, 0x0028,
+	0x080c, 0x2110, 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, 0x31d8, 0x012e, 0x2021, 0x400c,
+	0x0804, 0x31da, 0x9085, 0x0001, 0x1d04, 0x3b3b, 0x2091, 0x6000,
+	0x8420, 0x9486, 0x0064, 0x0005, 0x2001, 0x0105, 0x2003, 0x0010,
+	0x2001, 0x032a, 0x2003, 0x0004, 0x2001, 0x1a31, 0x2003, 0x0000,
+	0x0071, 0x2009, 0x0048, 0x080c, 0x2110, 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, 0x2110, 0x782c, 0xd0fc, 0x0d88,
+	0x080c, 0x3d74, 0x7000, 0x9086, 0x0000, 0x1d58, 0x782b, 0x0004,
+	0x782c, 0xd0ac, 0x1de8, 0x2009, 0x0040, 0x080c, 0x2110, 0x782b,
+	0x0002, 0x7003, 0x0000, 0x00ee, 0x00fe, 0x0005, 0x00f6, 0x2079,
+	0x0100, 0x2001, 0x1817, 0x200c, 0x7932, 0x7936, 0x080c, 0x2554,
+	0x7850, 0x9084, 0xfbff, 0x9085, 0x0030, 0x7852, 0x2019, 0x01f4,
+	0x8319, 0x1df0, 0x9084, 0xffcf, 0x9085, 0x2000, 0x7852, 0x20a9,
+	0x0046, 0x1d04, 0x3ba1, 0x2091, 0x6000, 0x1f04, 0x3ba1, 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, 0x3bc1, 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, 0x29bc, 0x7827, 0x0020, 0x7843, 0x0000, 0x9006,
+	0x080c, 0x29bc, 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, 0x391d, 0x1188, 0x2001,
+	0x181f, 0x2004, 0x2009, 0x181e, 0x210c, 0x918c, 0x00ff, 0x706e,
+	0x716a, 0x7066, 0x918d, 0x3200, 0x7162, 0x7073, 0xe109, 0x0080,
+	0x702c, 0x9085, 0x0002, 0x702e, 0x2009, 0x1817, 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, 0x3d74, 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,
+	0x3d00, 0x2011, 0x0001, 0x080c, 0x3d00, 0x00fe, 0x00ee, 0x0005,
+	0x00f6, 0x00e6, 0x2071, 0x1a31, 0x2079, 0x0320, 0x792c, 0xd1fc,
+	0x0904, 0x3cfd, 0x782b, 0x0002, 0x9026, 0xd19c, 0x1904, 0x3cf9,
+	0x7000, 0x0002, 0x3cfd, 0x3cae, 0x3cde, 0x3cf9, 0xd1bc, 0x1170,
+	0xd1dc, 0x1190, 0x8001, 0x7002, 0x2011, 0x0001, 0x080c, 0x3d00,
+	0x0904, 0x3cfd, 0x080c, 0x3d00, 0x0804, 0x3cfd, 0x00f6, 0x2079,
+	0x0300, 0x78bf, 0x0000, 0x00fe, 0x7810, 0x7914, 0x782b, 0x0004,
+	0x7812, 0x7916, 0x2001, 0x0201, 0x200c, 0x81ff, 0x0de8, 0x080c,
+	0x3c0b, 0x2009, 0x0001, 0x00f6, 0x2079, 0x0300, 0x78b8, 0x00fe,
+	0xd0ec, 0x0110, 0x2009, 0x0011, 0x792a, 0x00f8, 0x8001, 0x7002,
+	0x9184, 0x0880, 0x1140, 0x782c, 0xd0fc, 0x1904, 0x3ca2, 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, 0x0db4, 0x9398, 0x3d2e, 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, 0x3d6b, 0x3d62,
+	0x3d59, 0x3d50, 0x3d47, 0x3d3e, 0x3d35, 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, 0x3d9b, 0x3d87, 0x3d92, 0x8001,
+	0x7002, 0xd19c, 0x1180, 0x2011, 0x0001, 0x080c, 0x3d00, 0x190c,
+	0x3d00, 0x0048, 0x8001, 0x7002, 0x782c, 0xd0fc, 0x1d38, 0x2011,
+	0x0001, 0x080c, 0x3d00, 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, 0x4659,
+	0xa813, 0x0019, 0xaf16, 0x2900, 0xa85a, 0x978a, 0x0007, 0x0220,
+	0x2138, 0x2009, 0x0007, 0x0010, 0x2708, 0x903e, 0x0096, 0xa858,
+	0x2048, 0xa85c, 0x9080, 0x0019, 0x009e, 0x080c, 0x3e17, 0x1d68,
+	0x2900, 0xa85a, 0x00d0, 0x080c, 0x4659, 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,
+	0x2110, 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,
+	0x4659, 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, 0x4659, 0x2940, 0xa813,
+	0x0019, 0xaf16, 0x2900, 0xa85a, 0x978a, 0x0007, 0x0220, 0x2138,
+	0x2009, 0x0007, 0x0010, 0x2708, 0x903e, 0x0096, 0xa858, 0x2048,
+	0xa85c, 0x9080, 0x0019, 0x009e, 0x080c, 0x3e17, 0x1d68, 0x2900,
+	0xa85a, 0x00d8, 0x080c, 0x4659, 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, 0x31d8, 0x7d98, 0x7c9c, 0x0804, 0x32cf, 0x080c, 0x6d14,
+	0x190c, 0x5a59, 0x2069, 0x1853, 0x2d00, 0x2009, 0x0030, 0x7a8c,
+	0x7b88, 0x7c9c, 0x7d98, 0x2039, 0x0001, 0x080c, 0x46a2, 0x701f,
+	0x3eea, 0x0005, 0x080c, 0x5162, 0x1130, 0x3b00, 0x3a08, 0xc194,
+	0xc095, 0x20d8, 0x21d0, 0x2069, 0x1853, 0x6800, 0x9005, 0x0904,
+	0x320d, 0x6804, 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, 0x320d, 0x9288,
+	0x2fd9, 0x210d, 0x918c, 0x00ff, 0x6162, 0xd0dc, 0x0130, 0x6828,
+	0x908a, 0x007f, 0x1a04, 0x320d, 0x605a, 0x6888, 0x9084, 0x0030,
+	0x8004, 0x8004, 0x8004, 0x8004, 0x0006, 0x2009, 0x1980, 0x9080,
+	0x2647, 0x2005, 0x200a, 0x000e, 0x2009, 0x1981, 0x9080, 0x264b,
+	0x2005, 0x200a, 0x6808, 0x908a, 0x0100, 0x0a04, 0x320d, 0x908a,
+	0x0841, 0x1a04, 0x320d, 0x9084, 0x0007, 0x1904, 0x320d, 0x680c,
+	0x9005, 0x0904, 0x320d, 0x6810, 0x9005, 0x0904, 0x320d, 0x6848,
+	0x6940, 0x910a, 0x1a04, 0x320d, 0x8001, 0x0904, 0x320d, 0x684c,
+	0x6944, 0x910a, 0x1a04, 0x320d, 0x8001, 0x0904, 0x320d, 0x2009,
+	0x1950, 0x200b, 0x0000, 0x2001, 0x1875, 0x2004, 0xd0c4, 0x0140,
+	0x7884, 0x200a, 0x2009, 0x017f, 0x200a, 0x3b00, 0xc085, 0x20d8,
+	0x6814, 0x908c, 0x00ff, 0x614a, 0x8007, 0x9084, 0x00ff, 0x604e,
+	0x080c, 0x7029, 0x080c, 0x6395, 0x080c, 0x63ca, 0x6808, 0x602a,
+	0x080c, 0x2082, 0x2009, 0x0170, 0x200b, 0x0080, 0xa001, 0xa001,
+	0x200b, 0x0000, 0x0036, 0x6b08, 0x080c, 0x25ae, 0x003e, 0x6000,
+	0x9086, 0x0000, 0x1904, 0x4067, 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, 0x7e5c, 0x00c6, 0x900e,
+	0x20a9, 0x0001, 0x6b70, 0xd384, 0x0510, 0x0068, 0x2009, 0x0100,
+	0x210c, 0x918e, 0x0008, 0x1110, 0x839d, 0x0010, 0x83f5, 0x3e18,
+	0x12b0, 0x3508, 0x8109, 0x080c, 0x75df, 0x6878, 0x6016, 0x6874,
+	0x2008, 0x9084, 0xff00, 0x8007, 0x600a, 0x9184, 0x00ff, 0x6006,
+	0x8108, 0x1118, 0x6003, 0x0003, 0x0010, 0x6003, 0x0001, 0x1f04,
+	0x3fd6, 0x00ce, 0x00c6, 0x2061, 0x196b, 0x2063, 0x0001, 0x9006,
+	0x080c, 0x2855, 0x9006, 0x080c, 0x2838, 0x0000, 0x00ce, 0x00e6,
+	0x2c70, 0x080c, 0x0e80, 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, 0x2623, 0x2001, 0x193e, 0x2102, 0x0008, 0x2102, 0x00c6,
+	0x2061, 0x0100, 0x602f, 0x0040, 0x602f, 0x0000, 0x00ce, 0x080c,
+	0x6d14, 0x0128, 0x080c, 0x4a6e, 0x0110, 0x080c, 0x2574, 0x60d0,
+	0x9005, 0x01c0, 0x6003, 0x0001, 0x2009, 0x404f, 0x00d0, 0x080c,
+	0x6d14, 0x1168, 0x2011, 0x6b95, 0x080c, 0x7d56, 0x2011, 0x6b88,
+	0x080c, 0x7e27, 0x080c, 0x6ffd, 0x080c, 0x6c46, 0x0040, 0x080c,
+	0x5953, 0x0028, 0x6003, 0x0004, 0x2009, 0x4067, 0x0010, 0x0804,
+	0x31d8, 0x2001, 0x0170, 0x2004, 0x9084, 0x00ff, 0x9086, 0x004c,
+	0x1118, 0x2091, 0x30bd, 0x0817, 0x2091, 0x303d, 0x0817, 0x6000,
+	0x9086, 0x0000, 0x0904, 0x320a, 0x2069, 0x1853, 0x7890, 0x6842,
+	0x7894, 0x6846, 0x2d00, 0x2009, 0x0030, 0x7a8c, 0x7b88, 0x7c9c,
+	0x7d98, 0x2039, 0x0001, 0x0804, 0x46a5, 0x9006, 0x080c, 0x2574,
+	0x81ff, 0x1904, 0x320a, 0x080c, 0x6d14, 0x11b0, 0x080c, 0x6ff8,
+	0x080c, 0x5a94, 0x080c, 0x2fd4, 0x0118, 0x6130, 0xc18d, 0x6132,
+	0x080c, 0xbe86, 0x0130, 0x080c, 0x6d37, 0x1118, 0x080c, 0x6cec,
+	0x0038, 0x080c, 0x6c46, 0x0020, 0x080c, 0x5a59, 0x080c, 0x5953,
+	0x0804, 0x31d8, 0x81ff, 0x1904, 0x320a, 0x080c, 0x6d14, 0x1110,
+	0x0804, 0x320a, 0x6190, 0x81ff, 0x01a8, 0x704f, 0x0000, 0x2001,
+	0x1c80, 0x2009, 0x0040, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x0126,
+	0x2091, 0x8000, 0x2039, 0x0001, 0x080c, 0x46a5, 0x701f, 0x31d6,
+	0x012e, 0x0005, 0x704f, 0x0001, 0x00d6, 0x2069, 0x1c80, 0x20a9,
+	0x0040, 0x20e9, 0x0001, 0x20a1, 0x1c80, 0x2019, 0xffff, 0x4304,
+	0x6558, 0x9588, 0x2fd9, 0x210d, 0x918c, 0x00ff, 0x216a, 0x900e,
+	0x2011, 0x0002, 0x2100, 0x9506, 0x01a8, 0x080c, 0x5ff1, 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, 0x59e4, 0x0804, 0x40bf, 0x080c,
+	0x468c, 0x0904, 0x320d, 0x080c, 0x4659, 0x1120, 0x2009, 0x0002,
+	0x0804, 0x320a, 0x080c, 0x5153, 0xd0b4, 0x0558, 0x7884, 0x908e,
+	0x007e, 0x0538, 0x908e, 0x007f, 0x0520, 0x908e, 0x0080, 0x0508,
+	0x080c, 0x2fcf, 0x1148, 0xb800, 0xd08c, 0x11d8, 0xb804, 0x9084,
+	0x00ff, 0x9086, 0x0006, 0x11a8, 0xa867, 0x0000, 0xa868, 0xc0fd,
+	0xa86a, 0x080c, 0xb955, 0x1120, 0x2009, 0x0003, 0x0804, 0x320a,
+	0x7007, 0x0003, 0x701f, 0x414d, 0x0005, 0x080c, 0x468c, 0x0904,
+	0x320d, 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, 0x0f69, 0x0070, 0x20a9, 0x0004, 0xa85c, 0x9080,
+	0x000a, 0x20a0, 0xb8b4, 0x20e0, 0xb8b8, 0x9080, 0x000a, 0x2098,
+	0x080c, 0x0f69, 0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084,
+	0xffc0, 0x9080, 0x0002, 0x2009, 0x002b, 0x7a8c, 0x7b88, 0x7c9c,
+	0x7d98, 0x0804, 0x46a5, 0x81ff, 0x1904, 0x320a, 0x080c, 0x4670,
+	0x0904, 0x320d, 0x080c, 0x6163, 0x0904, 0x320a, 0x0058, 0xa878,
+	0x9005, 0x0120, 0x2009, 0x0004, 0x0804, 0x320a, 0xa974, 0xaa94,
+	0x0804, 0x31d8, 0x080c, 0x515b, 0x0904, 0x31d8, 0x701f, 0x4197,
+	0x7007, 0x0003, 0x0005, 0x81ff, 0x1904, 0x320a, 0x7888, 0x908a,
+	0x1000, 0x1a04, 0x320d, 0x080c, 0x468c, 0x0904, 0x320d, 0x080c,
+	0x6315, 0x0120, 0x080c, 0x631d, 0x1904, 0x320d, 0x080c, 0x61e8,
+	0x0904, 0x320a, 0x2019, 0x0004, 0x900e, 0x080c, 0x6175, 0x0904,
+	0x320a, 0x7984, 0x7a88, 0x04c9, 0x08a8, 0xa89c, 0x908a, 0x1000,
+	0x12f8, 0x080c, 0x468a, 0x01e0, 0x080c, 0x6315, 0x0118, 0x080c,
+	0x631d, 0x11b0, 0x080c, 0x61e8, 0x2009, 0x0002, 0x0168, 0x2009,
+	0x0002, 0x2019, 0x0004, 0x080c, 0x6175, 0x2009, 0x0003, 0x0120,
+	0xa998, 0xaa9c, 0x00d1, 0x0060, 0xa897, 0x4005, 0xa99a, 0x0010,
+	0xa897, 0x4006, 0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x0005,
+	0xa897, 0x4000, 0x080c, 0x515b, 0x0110, 0x9006, 0x0018, 0x900e,
+	0x9085, 0x0001, 0x2001, 0x0000, 0x0005, 0x9186, 0x00ff, 0x0110,
+	0x0071, 0x0060, 0x2029, 0x007e, 0x2061, 0x1800, 0x6458, 0x2400,
+	0x9506, 0x0110, 0x2508, 0x0019, 0x8529, 0x1ec8, 0x0005, 0x080c,
+	0x5ff1, 0x1138, 0x2200, 0x8003, 0x800b, 0x810b, 0x9108, 0x080c,
+	0x7d64, 0x0005, 0x81ff, 0x1904, 0x320a, 0x080c, 0x4670, 0x0904,
+	0x320d, 0x080c, 0x60b8, 0x0904, 0x320a, 0x080c, 0x616c, 0x0904,
+	0x320a, 0x0804, 0x41a2, 0x81ff, 0x1904, 0x320a, 0x080c, 0x4670,
+	0x0904, 0x320d, 0x080c, 0x6315, 0x0120, 0x080c, 0x631d, 0x1904,
+	0x320d, 0x080c, 0x60b8, 0x0904, 0x320a, 0x080c, 0x615a, 0x0904,
+	0x320a, 0x0804, 0x41a2, 0x6100, 0x0804, 0x31d8, 0x080c, 0x468c,
+	0x0904, 0x320d, 0x080c, 0x5167, 0x1904, 0x320a, 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, 0x31d8, 0x78a8, 0x909c, 0x0003, 0xd0b4, 0x1140,
+	0x939a, 0x0003, 0x1a04, 0x320a, 0x6258, 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, 0x46a5, 0x000e,
+	0x2031, 0x0000, 0x2061, 0x18ae, 0x2c44, 0xa66a, 0xa17a, 0xa772,
+	0xa076, 0xa28e, 0xa392, 0xa496, 0xa59a, 0x080c, 0x10cc, 0x7007,
+	0x0002, 0x701f, 0x42cc, 0x0005, 0x81ff, 0x1904, 0x320a, 0x080c,
+	0x468c, 0x0904, 0x320d, 0x080c, 0x6315, 0x1904, 0x320a, 0x00c6,
+	0x080c, 0x4659, 0x00ce, 0x0904, 0x320a, 0xa867, 0x0000, 0xa868,
+	0xc0fd, 0xa86a, 0x7ea8, 0x080c, 0xb8fb, 0x0904, 0x320a, 0x7007,
+	0x0003, 0x701f, 0x42d0, 0x0005, 0x080c, 0x3ebc, 0x0804, 0x31d8,
+	0xa830, 0x9086, 0x0100, 0x0904, 0x320a, 0x8906, 0x8006, 0x8007,
+	0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x001b, 0x2009, 0x000c,
+	0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x0804, 0x46a5, 0x9006, 0x080c,
+	0x2574, 0x78a8, 0x9084, 0x00ff, 0x9086, 0x00ff, 0x0118, 0x81ff,
+	0x1904, 0x320a, 0x080c, 0x6d14, 0x0110, 0x080c, 0x5a59, 0x7888,
+	0x908a, 0x1000, 0x1a04, 0x320d, 0x7984, 0x9186, 0x00ff, 0x0138,
+	0x9182, 0x007f, 0x1a04, 0x320d, 0x2100, 0x080c, 0x253e, 0x0026,
+	0x00c6, 0x0126, 0x2091, 0x8000, 0x2061, 0x19c9, 0x601b, 0x0000,
+	0x601f, 0x0000, 0x6073, 0x0000, 0x6077, 0x0000, 0x080c, 0x6d14,
+	0x1158, 0x080c, 0x6ff8, 0x080c, 0x5a94, 0x9085, 0x0001, 0x080c,
+	0x6d5b, 0x080c, 0x6c46, 0x00d0, 0x080c, 0x9a4e, 0x2061, 0x0100,
+	0x2001, 0x1817, 0x2004, 0x9084, 0x00ff, 0x810f, 0x9105, 0x604a,
+	0x6043, 0x0090, 0x6043, 0x0010, 0x2009, 0x1968, 0x200b, 0x0000,
+	0x2009, 0x002d, 0x2011, 0x597f, 0x080c, 0x7de5, 0x7984, 0x080c,
+	0x6d14, 0x1110, 0x2009, 0x00ff, 0x7a88, 0x080c, 0x4205, 0x012e,
+	0x00ce, 0x002e, 0x0804, 0x31d8, 0x7984, 0x080c, 0x5f91, 0x2b08,
+	0x1904, 0x320d, 0x0804, 0x31d8, 0x81ff, 0x0120, 0x2009, 0x0001,
+	0x0804, 0x320a, 0x60d8, 0xd0ac, 0x1130, 0xd09c, 0x1120, 0x2009,
+	0x0005, 0x0804, 0x320a, 0x080c, 0x4659, 0x1120, 0x2009, 0x0002,
+	0x0804, 0x320a, 0x7984, 0x9192, 0x0021, 0x1a04, 0x320d, 0x7a8c,
+	0x7b88, 0x7c9c, 0x7d98, 0xa85c, 0x9080, 0x0019, 0x702a, 0xaf60,
+	0x7736, 0x080c, 0x46a2, 0x701f, 0x4384, 0x7880, 0x9086, 0x006e,
+	0x0110, 0x701f, 0x4c20, 0x0005, 0x2009, 0x0080, 0x080c, 0x5ff1,
+	0x1118, 0x080c, 0x6315, 0x0120, 0x2021, 0x400a, 0x0804, 0x31da,
+	0x00d6, 0x0096, 0xa964, 0xaa6c, 0xab70, 0xac74, 0xad78, 0xae7c,
+	0xa884, 0x90be, 0x0100, 0x0904, 0x441d, 0x90be, 0x0112, 0x0904,
+	0x441d, 0x90be, 0x0113, 0x0904, 0x441d, 0x90be, 0x0114, 0x0904,
+	0x441d, 0x90be, 0x0117, 0x0904, 0x441d, 0x90be, 0x011a, 0x0904,
+	0x441d, 0x90be, 0x011c, 0x0904, 0x441d, 0x90be, 0x0121, 0x0904,
+	0x4404, 0x90be, 0x0131, 0x0904, 0x4404, 0x90be, 0x0171, 0x0904,
+	0x441d, 0x90be, 0x0173, 0x0904, 0x441d, 0x90be, 0x01a1, 0x1128,
+	0xa894, 0x8007, 0xa896, 0x0804, 0x4428, 0x90be, 0x0212, 0x0904,
+	0x4411, 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, 0x320d, 0x7028, 0x9080, 0x0010, 0x2098, 0x20a0,
+	0x7034, 0x20e0, 0x20e8, 0x20a9, 0x0007, 0x080c, 0x4466, 0x7028,
+	0x9080, 0x000e, 0x2098, 0x20a0, 0x7034, 0x20e0, 0x20e8, 0x20a9,
+	0x0001, 0x080c, 0x4466, 0x00c8, 0x7028, 0x9080, 0x000c, 0x2098,
+	0x20a0, 0x7034, 0x20e0, 0x20e8, 0x20a9, 0x0001, 0x080c, 0x4473,
+	0x00b8, 0x7028, 0x9080, 0x000e, 0x2098, 0x20a0, 0x7034, 0x20e0,
+	0x20e8, 0x20a9, 0x0001, 0x080c, 0x4473, 0x7028, 0x9080, 0x000c,
+	0x2098, 0x20a0, 0x7034, 0x20e0, 0x20e8, 0x20a9, 0x0001, 0x04f1,
+	0x00c6, 0x080c, 0x4659, 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, 0xb916, 0x1120, 0x2009, 0x0003, 0x0804,
+	0x320a, 0x7007, 0x0003, 0x701f, 0x445d, 0x0005, 0x00ce, 0x009e,
+	0x00de, 0x2009, 0x0002, 0x0804, 0x320a, 0xa820, 0x9086, 0x8001,
+	0x1904, 0x31d8, 0x2009, 0x0004, 0x0804, 0x320a, 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, 0x320a, 0x60d8, 0xd0ac, 0x1160, 0xd09c,
+	0x0120, 0x2009, 0x0016, 0x0804, 0x320a, 0xd09c, 0x1120, 0x2009,
+	0x0005, 0x0804, 0x320a, 0x7984, 0x78a8, 0x2040, 0x080c, 0x9a47,
+	0x1120, 0x9182, 0x007f, 0x0a04, 0x320d, 0x9186, 0x00ff, 0x0904,
+	0x320d, 0x9182, 0x0800, 0x1a04, 0x320d, 0x7a8c, 0x7b88, 0x6078,
+	0x9306, 0x1140, 0x607c, 0x924e, 0x0904, 0x320d, 0x99cc, 0xff00,
+	0x0904, 0x320d, 0x0126, 0x2091, 0x8000, 0x0026, 0x2011, 0x8008,
+	0x080c, 0x6339, 0x002e, 0x0118, 0x2001, 0x4009, 0x0458, 0x080c,
+	0x4573, 0x0560, 0x90c6, 0x4000, 0x1170, 0x00c6, 0x0006, 0x900e,
+	0x080c, 0x6211, 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, 0x31da, 0x2b00, 0x7026,
+	0x0016, 0x00b6, 0x00c6, 0x00e6, 0x2c70, 0x080c, 0x9b15, 0x0904,
+	0x4540, 0x2b00, 0x6012, 0x080c, 0xbc01, 0x2e58, 0x00ee, 0x00e6,
+	0x00c6, 0x080c, 0x4659, 0x00ce, 0x2b70, 0x1158, 0x080c, 0x9ac8,
+	0x00ee, 0x00ce, 0x00be, 0x001e, 0x012e, 0x2009, 0x0002, 0x0804,
+	0x320a, 0x900e, 0xa966, 0xa96a, 0x2900, 0x6016, 0xa932, 0xa868,
+	0xc0fd, 0xd88c, 0x0108, 0xc0f5, 0xa86a, 0x080c, 0x2e7f, 0x6023,
+	0x0001, 0x9006, 0x080c, 0x5f2e, 0x2001, 0x0002, 0x080c, 0x5f42,
+	0x2009, 0x0002, 0x080c, 0x9b42, 0x78a8, 0xd094, 0x0138, 0x00ee,
+	0x7024, 0x00e6, 0x2058, 0xb8bc, 0xc08d, 0xb8be, 0x9085, 0x0001,
+	0x00ee, 0x00ce, 0x00be, 0x001e, 0x012e, 0x1120, 0x2009, 0x0003,
+	0x0804, 0x320a, 0x7007, 0x0003, 0x701f, 0x454f, 0x0005, 0xa830,
+	0x2008, 0x918e, 0xdead, 0x1120, 0x2021, 0x4009, 0x0804, 0x31da,
+	0x9086, 0x0100, 0x7024, 0x2058, 0x1138, 0x2009, 0x0004, 0xba04,
+	0x9294, 0x00ff, 0x0804, 0x50b0, 0x900e, 0xa868, 0xd0f4, 0x1904,
+	0x31d8, 0x080c, 0x6211, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108,
+	0xc18d, 0x0804, 0x31d8, 0x00e6, 0x00d6, 0x0096, 0x83ff, 0x0904,
+	0x45bb, 0x902e, 0x080c, 0x9a47, 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, 0x6315, 0x1540, 0x2001, 0x4000, 0x0430,
+	0x2001, 0x4007, 0x0418, 0x2001, 0x4006, 0x0400, 0x2400, 0x9106,
+	0x1158, 0xbe14, 0x87ff, 0x1128, 0x86ff, 0x0948, 0x080c, 0x9a47,
+	0x1930, 0x2001, 0x4008, 0x0090, 0x8420, 0x8e70, 0x1f04, 0x4589,
+	0x85ff, 0x1130, 0x2001, 0x4009, 0x0048, 0x2001, 0x0001, 0x0030,
+	0x080c, 0x5f91, 0x1dd0, 0xbb12, 0xba16, 0x9006, 0x9005, 0x009e,
+	0x00de, 0x00ee, 0x0005, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804,
+	0x320a, 0x080c, 0x4659, 0x1120, 0x2009, 0x0002, 0x0804, 0x320a,
+	0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a, 0x7884, 0x9005, 0x0904,
+	0x320d, 0x9096, 0x00ff, 0x0120, 0x9092, 0x0004, 0x1a04, 0x320d,
+	0x2010, 0x2918, 0x080c, 0x2e25, 0x1120, 0x2009, 0x0003, 0x0804,
+	0x320a, 0x7007, 0x0003, 0x701f, 0x460e, 0x0005, 0xa830, 0x9086,
+	0x0100, 0x1904, 0x31d8, 0x2009, 0x0004, 0x0804, 0x320a, 0x7984,
+	0x080c, 0x9a47, 0x1120, 0x9182, 0x007f, 0x0a04, 0x320d, 0x9186,
+	0x00ff, 0x0904, 0x320d, 0x9182, 0x0800, 0x1a04, 0x320d, 0x2001,
+	0x9000, 0x080c, 0x510b, 0x1904, 0x320a, 0x0804, 0x31d8, 0xa998,
+	0x080c, 0x9a47, 0x1118, 0x9182, 0x007f, 0x0280, 0x9186, 0x00ff,
+	0x0168, 0x9182, 0x0800, 0x1250, 0x2001, 0x9000, 0x080c, 0x510b,
+	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, 0x0fec, 0x0198, 0x9006, 0xa802, 0x7014, 0x9005,
+	0x1120, 0x2900, 0x7016, 0x701a, 0x0040, 0x7018, 0xa802, 0x0086,
+	0x2040, 0x2900, 0xa006, 0x701a, 0x008e, 0x9085, 0x0001, 0x0005,
+	0x7984, 0x080c, 0x5ff1, 0x1130, 0x7e88, 0x9684, 0x3fff, 0x9082,
+	0x4000, 0x0208, 0x905e, 0x8bff, 0x0005, 0xa998, 0x080c, 0x5ff1,
+	0x1130, 0xae9c, 0x9684, 0x3fff, 0x9082, 0x4000, 0x0208, 0x905e,
+	0x8bff, 0x0005, 0xae98, 0x0008, 0x7e84, 0x2608, 0x080c, 0x5ff1,
+	0x1108, 0x0008, 0x905e, 0x8bff, 0x0005, 0x0016, 0x7114, 0x81ff,
+	0x0128, 0x2148, 0xa904, 0x080c, 0x101e, 0x0cc8, 0x7116, 0x711a,
+	0x001e, 0x0005, 0x2031, 0x0001, 0x0010, 0x2031, 0x0000, 0x2061,
+	0x18ae, 0x2c44, 0xa66a, 0xa17a, 0xa772, 0xa076, 0xa28e, 0xa392,
+	0xa496, 0xa59a, 0x080c, 0x10cc, 0x7007, 0x0002, 0x701f, 0x31d8,
+	0x0005, 0x00f6, 0x0126, 0x2091, 0x8000, 0x2079, 0x0000, 0x2001,
+	0x18a6, 0x2004, 0x9005, 0x1190, 0x0e04, 0x46d6, 0x7a36, 0x7833,
+	0x0012, 0x7a82, 0x7b86, 0x7c8a, 0x2091, 0x4080, 0x2001, 0x0089,
+	0x2004, 0xd084, 0x190c, 0x117e, 0x0804, 0x473c, 0x0016, 0x0086,
+	0x0096, 0x00c6, 0x00e6, 0x2071, 0x1894, 0x7044, 0x9005, 0x1540,
+	0x7148, 0x9182, 0x0010, 0x0288, 0x7038, 0x2060, 0x080c, 0x0fec,
+	0x0904, 0x4734, 0xa84b, 0x0000, 0x2900, 0x7046, 0x2001, 0x0002,
+	0x9080, 0x1dd6, 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, 0x0db4, 0x2060, 0x001e, 0x8108, 0x2105,
+	0x9005, 0xa146, 0x1520, 0x080c, 0x0fec, 0x1130, 0x8109, 0xa946,
+	0x7148, 0x8109, 0x714a, 0x00d8, 0x9006, 0xa806, 0xa84a, 0xa046,
+	0x2800, 0xa802, 0x2900, 0xa006, 0x7046, 0x2001, 0x0002, 0x9080,
+	0x1dd6, 0x2005, 0xa846, 0x0058, 0x2262, 0x6306, 0x640a, 0x00ee,
+	0x00ce, 0x009e, 0x008e, 0x001e, 0x012e, 0x00fe, 0x0005, 0x2c00,
+	0x9082, 0x001b, 0x0002, 0x475e, 0x475e, 0x4760, 0x475e, 0x475e,
+	0x475e, 0x4764, 0x475e, 0x475e, 0x475e, 0x4768, 0x475e, 0x475e,
+	0x475e, 0x476c, 0x475e, 0x475e, 0x475e, 0x4770, 0x475e, 0x475e,
+	0x475e, 0x4774, 0x475e, 0x475e, 0x475e, 0x4779, 0x080c, 0x0db4,
+	0xa276, 0xa37a, 0xa47e, 0x0898, 0xa286, 0xa38a, 0xa48e, 0x0878,
+	0xa296, 0xa39a, 0xa49e, 0x0858, 0xa2a6, 0xa3aa, 0xa4ae, 0x0838,
+	0xa2b6, 0xa3ba, 0xa4be, 0x0818, 0xa2c6, 0xa3ca, 0xa4ce, 0x0804,
+	0x4737, 0xa2d6, 0xa3da, 0xa4de, 0x0804, 0x4737, 0x00e6, 0x2071,
+	0x1894, 0x7048, 0x9005, 0x0904, 0x4810, 0x0126, 0x2091, 0x8000,
+	0x0e04, 0x480f, 0x00f6, 0x2079, 0x0000, 0x00c6, 0x0096, 0x0086,
+	0x0076, 0x9006, 0x2038, 0x7040, 0x2048, 0x9005, 0x0500, 0xa948,
+	0x2105, 0x0016, 0x908a, 0x0036, 0x1a0c, 0x0db4, 0x2060, 0x001e,
+	0x8108, 0x2105, 0x9005, 0xa94a, 0x1904, 0x4812, 0xa804, 0x9005,
+	0x090c, 0x0db4, 0x7042, 0x2938, 0x2040, 0xa003, 0x0000, 0x2001,
+	0x0002, 0x9080, 0x1dd6, 0x2005, 0xa04a, 0x0804, 0x4812, 0x703c,
+	0x2060, 0x2c14, 0x6304, 0x6408, 0x650c, 0x2200, 0x7836, 0x7833,
+	0x0012, 0x7882, 0x2300, 0x7886, 0x2400, 0x788a, 0x2091, 0x4080,
+	0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x117e, 0x87ff, 0x0118,
+	0x2748, 0x080c, 0x101e, 0x7048, 0x8001, 0x704a, 0x9005, 0x1170,
+	0x7040, 0x2048, 0x9005, 0x0128, 0x080c, 0x101e, 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, 0x0db4, 0x2048, 0xa800, 0x9005,
+	0x1de0, 0x2900, 0x7042, 0x2001, 0x0002, 0x9080, 0x1dd6, 0x2005,
+	0xa84a, 0x0000, 0x007e, 0x008e, 0x009e, 0x00ce, 0x00fe, 0x012e,
+	0x00ee, 0x0005, 0x2c00, 0x9082, 0x001b, 0x0002, 0x4831, 0x4831,
+	0x4833, 0x4831, 0x4831, 0x4831, 0x4838, 0x4831, 0x4831, 0x4831,
+	0x483d, 0x4831, 0x4831, 0x4831, 0x4842, 0x4831, 0x4831, 0x4831,
+	0x4847, 0x4831, 0x4831, 0x4831, 0x484c, 0x4831, 0x4831, 0x4831,
+	0x4851, 0x080c, 0x0db4, 0xaa74, 0xab78, 0xac7c, 0x0804, 0x47bd,
+	0xaa84, 0xab88, 0xac8c, 0x0804, 0x47bd, 0xaa94, 0xab98, 0xac9c,
+	0x0804, 0x47bd, 0xaaa4, 0xaba8, 0xacac, 0x0804, 0x47bd, 0xaab4,
+	0xabb8, 0xacbc, 0x0804, 0x47bd, 0xaac4, 0xabc8, 0xaccc, 0x0804,
+	0x47bd, 0xaad4, 0xabd8, 0xacdc, 0x0804, 0x47bd, 0x0026, 0x080c,
+	0x5153, 0xd0c4, 0x0120, 0x2011, 0x8014, 0x080c, 0x46b9, 0x002e,
+	0x0005, 0x81ff, 0x1904, 0x320a, 0x0126, 0x2091, 0x8000, 0x6030,
+	0xc08d, 0xc085, 0xc0ac, 0x6032, 0x080c, 0x6d14, 0x1158, 0x080c,
+	0x6ff8, 0x080c, 0x5a94, 0x9085, 0x0001, 0x080c, 0x6d5b, 0x080c,
+	0x6c46, 0x0010, 0x080c, 0x5953, 0x012e, 0x0804, 0x31d8, 0x81ff,
+	0x0120, 0x2009, 0x0001, 0x0804, 0x320a, 0x080c, 0x5167, 0x0120,
+	0x2009, 0x0007, 0x0804, 0x320a, 0x080c, 0x630d, 0x0120, 0x2009,
+	0x0008, 0x0804, 0x320a, 0x0026, 0x2011, 0x0010, 0x080c, 0x6339,
+	0x002e, 0x0120, 0x2009, 0x4009, 0x0804, 0x320a, 0x080c, 0x2fcf,
+	0x0128, 0x7984, 0x080c, 0x5f91, 0x1904, 0x320d, 0x080c, 0x468c,
+	0x0904, 0x320d, 0x2b00, 0x7026, 0x080c, 0x6315, 0x7888, 0x1170,
+	0x9084, 0x0005, 0x1158, 0x900e, 0x080c, 0x6211, 0x1108, 0xc185,
+	0xb800, 0xd0bc, 0x0108, 0xc18d, 0x0804, 0x31d8, 0x080c, 0x4659,
+	0x0904, 0x320a, 0x9006, 0xa866, 0xa832, 0xa868, 0xc0fd, 0xa86a,
+	0x080c, 0xb9af, 0x0904, 0x320a, 0x7888, 0xd094, 0x0118, 0xb8bc,
+	0xc08d, 0xb8be, 0x7007, 0x0003, 0x701f, 0x4923, 0x0005, 0x2061,
+	0x1800, 0x080c, 0x5167, 0x2009, 0x0007, 0x1578, 0x080c, 0x630d,
+	0x0118, 0x2009, 0x0008, 0x0448, 0x080c, 0x2fcf, 0x0120, 0xa998,
+	0x080c, 0x5f91, 0x1530, 0x080c, 0x468a, 0x0518, 0x080c, 0x6315,
+	0xa89c, 0x1168, 0x9084, 0x0005, 0x1150, 0x900e, 0x080c, 0x6211,
+	0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d, 0x00d0, 0xa868,
+	0xc0fc, 0xa86a, 0x080c, 0xb9af, 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, 0x2008, 0x918e, 0xdead, 0x1120,
+	0x2021, 0x4009, 0x0804, 0x31da, 0x9086, 0x0100, 0x7024, 0x2058,
+	0x1110, 0x0804, 0x50b0, 0x900e, 0x080c, 0x6211, 0x1108, 0xc185,
+	0xb800, 0xd0bc, 0x0108, 0xc18d, 0x0804, 0x31d8, 0x080c, 0x5167,
+	0x0120, 0x2009, 0x0007, 0x0804, 0x320a, 0x7f84, 0x7a8c, 0x7b88,
+	0x7c9c, 0x7d98, 0x080c, 0x4659, 0x1120, 0x2009, 0x0002, 0x0804,
+	0x320a, 0x900e, 0x2130, 0x7126, 0x7132, 0xa860, 0x20e8, 0x7036,
+	0xa85c, 0x9080, 0x0005, 0x702a, 0x20a0, 0x080c, 0x5ff1, 0x1904,
+	0x49c1, 0x080c, 0x6315, 0x0120, 0x080c, 0x631d, 0x1904, 0x49c1,
+	0x080c, 0x630d, 0x1130, 0x080c, 0x6211, 0x1118, 0xd79c, 0x0904,
+	0x49c1, 0xd794, 0x1110, 0xd784, 0x01a8, 0xb8b4, 0x20e0, 0xb8b8,
+	0x9080, 0x0006, 0x2098, 0x3400, 0xd794, 0x0160, 0x20a9, 0x0008,
+	0x4003, 0x2098, 0x20a0, 0x3d00, 0x20e0, 0x20a9, 0x0002, 0x080c,
+	0x4473, 0x0048, 0x20a9, 0x0004, 0x4003, 0x2098, 0x20a0, 0x3d00,
+	0x20e0, 0x080c, 0x4473, 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, 0x4466, 0x9c80, 0x0026, 0x2098, 0xb8b4, 0x20e0,
+	0x20a9, 0x0002, 0x4003, 0xd794, 0x0110, 0x96b0, 0x000b, 0x96b0,
+	0x0005, 0x8108, 0x080c, 0x9a47, 0x0118, 0x9186, 0x0800, 0x0040,
+	0xd78c, 0x0120, 0x9186, 0x0800, 0x0170, 0x0018, 0x9186, 0x007e,
+	0x0150, 0xd794, 0x0118, 0x9686, 0x0020, 0x0010, 0x9686, 0x0028,
+	0x0150, 0x0804, 0x495d, 0x86ff, 0x1120, 0x7124, 0x810b, 0x0804,
+	0x31d8, 0x7033, 0x0001, 0x7122, 0x7024, 0x9600, 0x7026, 0x772e,
+	0x2061, 0x18ae, 0x2c44, 0xa06b, 0x0000, 0xa67a, 0x7034, 0xa072,
+	0x7028, 0xa076, 0xa28e, 0xa392, 0xa496, 0xa59a, 0x080c, 0x10cc,
+	0x7007, 0x0002, 0x701f, 0x49fd, 0x0005, 0x7030, 0x9005, 0x1180,
+	0x7120, 0x7028, 0x20a0, 0x772c, 0x9036, 0x7034, 0x20e8, 0x2061,
+	0x18ae, 0x2c44, 0xa28c, 0xa390, 0xa494, 0xa598, 0x0804, 0x495d,
+	0x7124, 0x810b, 0x0804, 0x31d8, 0x2029, 0x007e, 0x7984, 0x7a88,
+	0x7b8c, 0x7c98, 0x9184, 0xff00, 0x8007, 0x90e2, 0x0020, 0x0a04,
+	0x320d, 0x9502, 0x0a04, 0x320d, 0x9184, 0x00ff, 0x90e2, 0x0020,
+	0x0a04, 0x320d, 0x9502, 0x0a04, 0x320d, 0x9284, 0xff00, 0x8007,
+	0x90e2, 0x0020, 0x0a04, 0x320d, 0x9502, 0x0a04, 0x320d, 0x9284,
+	0x00ff, 0x90e2, 0x0020, 0x0a04, 0x320d, 0x9502, 0x0a04, 0x320d,
+	0x9384, 0xff00, 0x8007, 0x90e2, 0x0020, 0x0a04, 0x320d, 0x9502,
+	0x0a04, 0x320d, 0x9384, 0x00ff, 0x90e2, 0x0020, 0x0a04, 0x320d,
+	0x9502, 0x0a04, 0x320d, 0x9484, 0xff00, 0x8007, 0x90e2, 0x0020,
+	0x0a04, 0x320d, 0x9502, 0x0a04, 0x320d, 0x9484, 0x00ff, 0x90e2,
+	0x0020, 0x0a04, 0x320d, 0x9502, 0x0a04, 0x320d, 0x2061, 0x1958,
+	0x6102, 0x6206, 0x630a, 0x640e, 0x0804, 0x31d8, 0x0006, 0x080c,
+	0x5153, 0xd0cc, 0x000e, 0x0005, 0x0006, 0x080c, 0x5157, 0xd0bc,
+	0x000e, 0x0005, 0x6170, 0x7a84, 0x6300, 0x82ff, 0x1118, 0x7986,
+	0x0804, 0x31d8, 0x83ff, 0x1904, 0x320d, 0x2001, 0xfff0, 0x9200,
+	0x1a04, 0x320d, 0x2019, 0xffff, 0x6074, 0x9302, 0x9200, 0x0a04,
+	0x320d, 0x7986, 0x6272, 0x0804, 0x31d8, 0x080c, 0x5167, 0x1904,
+	0x320a, 0x7c88, 0x7d84, 0x7e98, 0x7f8c, 0x080c, 0x4659, 0x0904,
+	0x320a, 0x900e, 0x901e, 0x7326, 0x7332, 0xa860, 0x20e8, 0x7036,
+	0xa85c, 0x9080, 0x0003, 0x702a, 0x20a0, 0x91d8, 0x1000, 0x2b5c,
+	0x8bff, 0x0178, 0x080c, 0x6315, 0x0118, 0x080c, 0x631d, 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,
+	0x7f8b, 0x2208, 0x0804, 0x31d8, 0x7033, 0x0001, 0x7122, 0x7024,
+	0x9300, 0x7026, 0x2061, 0x18ae, 0x2c44, 0xa06b, 0x0000, 0xa37a,
+	0x7028, 0xa076, 0x7034, 0xa072, 0xa48e, 0xa592, 0xa696, 0xa79a,
+	0x080c, 0x10cc, 0x7007, 0x0002, 0x701f, 0x4aef, 0x0005, 0x7030,
+	0x9005, 0x1178, 0x7120, 0x7028, 0x20a0, 0x901e, 0x7034, 0x20e8,
+	0x2061, 0x18ae, 0x2c44, 0xa48c, 0xa590, 0xa694, 0xa798, 0x0804,
+	0x4aad, 0x7224, 0x900e, 0x2001, 0x0003, 0x080c, 0x7f8b, 0x2208,
+	0x0804, 0x31d8, 0x00f6, 0x00e6, 0x080c, 0x5167, 0x2009, 0x0007,
+	0x1904, 0x4b82, 0x2071, 0x1894, 0x745c, 0x84ff, 0x2009, 0x000e,
+	0x1904, 0x4b82, 0xac9c, 0xad98, 0xaea4, 0xafa0, 0x0096, 0x080c,
+	0x1005, 0x2009, 0x0002, 0x0904, 0x4b82, 0x2900, 0x705e, 0x900e,
+	0x901e, 0x7356, 0x7362, 0xa860, 0x7066, 0xa85c, 0x9080, 0x0003,
+	0x705a, 0x20a0, 0x91d8, 0x1000, 0x2b5c, 0x8bff, 0x0178, 0x080c,
+	0x6315, 0x0118, 0x080c, 0x631d, 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, 0x7f8b, 0x2208, 0x009e,
+	0xa897, 0x4000, 0xa99a, 0x715c, 0x81ff, 0x090c, 0x0db4, 0x2148,
+	0x080c, 0x101e, 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, 0x4b8e, 0x000e, 0xa0a2, 0x080c, 0x10cc,
+	0x9006, 0x0048, 0x009e, 0xa897, 0x4005, 0xa99a, 0x900e, 0x9085,
+	0x0001, 0x2001, 0x0030, 0x00ee, 0x00fe, 0x0005, 0x00f6, 0xa0a0,
+	0x904d, 0x090c, 0x0db4, 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, 0x7f8b, 0xaa9a, 0x715c, 0x81ff, 0x090c, 0x0db4,
+	0x2148, 0x080c, 0x101e, 0x705f, 0x0000, 0xa0a0, 0x2048, 0x0126,
+	0x2091, 0x8000, 0x080c, 0x65f2, 0x012e, 0xa09f, 0x0000, 0xa0a3,
+	0x0000, 0x00ee, 0x00fe, 0x0005, 0x91d8, 0x1000, 0x2b5c, 0x8bff,
+	0x0178, 0x080c, 0x6315, 0x0118, 0x080c, 0x631d, 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, 0x0db4, 0x2148, 0x080c, 0x101e, 0x9006, 0x705e,
+	0x918d, 0x0001, 0x2008, 0xa0a0, 0x2048, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x65f2, 0x012e, 0xa09f, 0x0000, 0xa0a3, 0x0000, 0x0070,
+	0x7063, 0x0001, 0x7152, 0x7054, 0x9300, 0x7056, 0xa37a, 0xa48e,
+	0xa592, 0xa696, 0xa79a, 0x080c, 0x10cc, 0x9006, 0x00ee, 0x0005,
+	0x0096, 0xa88c, 0x90be, 0x7000, 0x0148, 0x90be, 0x7100, 0x0130,
+	0x90be, 0x7200, 0x0118, 0x009e, 0x0804, 0x320d, 0xa884, 0xa988,
+	0x080c, 0x250b, 0x1518, 0x080c, 0x5f91, 0x1500, 0x7126, 0xbe12,
+	0xbd16, 0xae7c, 0x080c, 0x4659, 0x01c8, 0x080c, 0x4659, 0x01b0,
+	0x009e, 0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a, 0xa823, 0x0000,
+	0xa804, 0x2048, 0x080c, 0xb936, 0x1120, 0x2009, 0x0003, 0x0804,
+	0x320a, 0x7007, 0x0003, 0x701f, 0x4c5b, 0x0005, 0x009e, 0x2009,
+	0x0002, 0x0804, 0x320a, 0x7124, 0x080c, 0x2f76, 0xa820, 0x9086,
+	0x8001, 0x1120, 0x2009, 0x0004, 0x0804, 0x320a, 0x2900, 0x7022,
+	0xa804, 0x0096, 0x2048, 0x8906, 0x8006, 0x8007, 0x90bc, 0x003f,
+	0x9084, 0xffc0, 0x009e, 0x9080, 0x0002, 0x0076, 0x0006, 0x2098,
+	0x20a0, 0x27e0, 0x27e8, 0x20a9, 0x002a, 0x080c, 0x0f69, 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,
+	0x46a5, 0x97c6, 0x7200, 0x11b8, 0x96c2, 0x0054, 0x02a0, 0x000e,
+	0x007e, 0x2061, 0x18ae, 0x2c44, 0xa076, 0xa772, 0xa07b, 0x002a,
+	0xa28e, 0xa392, 0xa496, 0xa59a, 0x080c, 0x10cc, 0x7007, 0x0002,
+	0x701f, 0x4cb7, 0x0005, 0x000e, 0x007e, 0x0804, 0x320d, 0x7020,
+	0x2048, 0xa804, 0x2048, 0xa804, 0x2048, 0x8906, 0x8006, 0x8007,
+	0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x0002, 0x2098, 0x20a0,
+	0x27e0, 0x27e8, 0x20a9, 0x002a, 0x080c, 0x0f69, 0x2100, 0x2238,
+	0x2061, 0x18ae, 0x2c44, 0xa28c, 0xa390, 0xa494, 0xa598, 0x2009,
+	0x002a, 0x0804, 0x46a5, 0x81ff, 0x1904, 0x320a, 0x798c, 0x2001,
+	0x194f, 0x2102, 0x080c, 0x4670, 0x0904, 0x320d, 0x080c, 0x6315,
+	0x0120, 0x080c, 0x631d, 0x1904, 0x320d, 0x080c, 0x60b8, 0x0904,
+	0x320a, 0x0126, 0x2091, 0x8000, 0x080c, 0x617e, 0x012e, 0x0904,
+	0x320a, 0x0804, 0x41a2, 0xa9a0, 0x2001, 0x194f, 0xc18d, 0x2102,
+	0x080c, 0x467d, 0x01a0, 0x080c, 0x6315, 0x0118, 0x080c, 0x631d,
+	0x1170, 0x080c, 0x60b8, 0x2009, 0x0002, 0x0128, 0x080c, 0x617e,
+	0x1170, 0x2009, 0x0003, 0xa897, 0x4005, 0xa99a, 0x0010, 0xa897,
+	0x4006, 0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x0005, 0xa897,
+	0x4000, 0x080c, 0x515b, 0x0110, 0x9006, 0x0018, 0x900e, 0x9085,
+	0x0001, 0x2001, 0x0000, 0x0005, 0x78a8, 0xd08c, 0x1118, 0xd084,
+	0x0904, 0x4117, 0x080c, 0x468c, 0x0904, 0x320d, 0x080c, 0x4659,
+	0x1120, 0x2009, 0x0002, 0x0804, 0x320a, 0x080c, 0x6315, 0x0130,
+	0x908e, 0x0004, 0x0118, 0x908e, 0x0005, 0x15a0, 0x78a8, 0xd08c,
+	0x0120, 0xb800, 0xc08c, 0xb802, 0x0028, 0x080c, 0x5153, 0xd0b4,
+	0x0904, 0x4151, 0x7884, 0x908e, 0x007e, 0x0904, 0x4151, 0x908e,
+	0x007f, 0x0904, 0x4151, 0x908e, 0x0080, 0x0904, 0x4151, 0xb800,
+	0xd08c, 0x1904, 0x4151, 0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a,
+	0x080c, 0xb955, 0x1120, 0x2009, 0x0003, 0x0804, 0x320a, 0x7007,
+	0x0003, 0x701f, 0x4d74, 0x0005, 0x080c, 0x468c, 0x0904, 0x320d,
+	0x0804, 0x4151, 0x080c, 0x2fcf, 0x0108, 0x0005, 0x2009, 0x1833,
+	0x210c, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x320a, 0x080c,
+	0x5167, 0x0120, 0x2009, 0x0007, 0x0804, 0x320a, 0x080c, 0x630d,
+	0x0120, 0x2009, 0x0008, 0x0804, 0x320a, 0xb89c, 0xd0a4, 0x1118,
+	0xd0ac, 0x1904, 0x4151, 0x9006, 0xa866, 0xa832, 0xa868, 0xc0fd,
+	0xa86a, 0x080c, 0xb9af, 0x1120, 0x2009, 0x0003, 0x0804, 0x320a,
+	0x7007, 0x0003, 0x701f, 0x4dad, 0x0005, 0xa830, 0x9086, 0x0100,
+	0x1120, 0x2009, 0x0004, 0x0804, 0x50b0, 0x080c, 0x468c, 0x0904,
+	0x320d, 0x0804, 0x4d46, 0x81ff, 0x2009, 0x0001, 0x1904, 0x320a,
+	0x080c, 0x5167, 0x2009, 0x0007, 0x1904, 0x320a, 0x080c, 0x630d,
+	0x0120, 0x2009, 0x0008, 0x0804, 0x320a, 0x080c, 0x468c, 0x0904,
+	0x320d, 0x080c, 0x6315, 0x2009, 0x0009, 0x1904, 0x320a, 0x080c,
+	0x4659, 0x2009, 0x0002, 0x0904, 0x320a, 0x9006, 0xa866, 0xa832,
+	0xa868, 0xc0fd, 0xa86a, 0x7988, 0x9194, 0xff00, 0x918c, 0x00ff,
+	0x9006, 0x82ff, 0x1128, 0xc0ed, 0xa952, 0x798c, 0xa956, 0x0038,
+	0x928e, 0x0100, 0x1904, 0x320d, 0xc0e5, 0xa952, 0xa956, 0xa83e,
+	0x080c, 0xbc02, 0x2009, 0x0003, 0x0904, 0x320a, 0x7007, 0x0003,
+	0x701f, 0x4e03, 0x0005, 0xa830, 0x9086, 0x0100, 0x2009, 0x0004,
+	0x0904, 0x320a, 0x0804, 0x31d8, 0x7aa8, 0x9284, 0xc000, 0x0148,
+	0xd2ec, 0x01a0, 0x080c, 0x5167, 0x1188, 0x2009, 0x0014, 0x0804,
+	0x320a, 0xd2dc, 0x1568, 0x81ff, 0x2009, 0x0001, 0x1904, 0x320a,
+	0x080c, 0x5167, 0x2009, 0x0007, 0x1904, 0x320a, 0xd2f4, 0x0130,
+	0x9284, 0x5000, 0x080c, 0x512e, 0x0804, 0x31d8, 0xd2fc, 0x0158,
+	0x080c, 0x468c, 0x0904, 0x320d, 0x7984, 0x9284, 0x9000, 0x080c,
+	0x510b, 0x0804, 0x31d8, 0x080c, 0x468c, 0x0904, 0x320d, 0xb804,
+	0x9084, 0x00ff, 0x9086, 0x0006, 0x2009, 0x0009, 0x1904, 0x4eec,
+	0x080c, 0x4659, 0x2009, 0x0002, 0x0904, 0x4eec, 0xa85c, 0x9080,
+	0x001b, 0xaf60, 0x2009, 0x0008, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98,
+	0x080c, 0x46a2, 0x701f, 0x4e5d, 0x0005, 0xa86c, 0x9086, 0x0500,
+	0x1138, 0xa870, 0x9005, 0x1120, 0xa874, 0x9084, 0xff00, 0x0110,
+	0x1904, 0x320d, 0xa866, 0xa832, 0xa868, 0xc0fd, 0xa86a, 0x080c,
+	0x468c, 0x1110, 0x0804, 0x320d, 0x2009, 0x0043, 0x080c, 0xbc6a,
+	0x2009, 0x0003, 0x0904, 0x4eec, 0x7007, 0x0003, 0x701f, 0x4e81,
+	0x0005, 0xa830, 0x9086, 0x0100, 0x2009, 0x0004, 0x0904, 0x4eec,
+	0x7984, 0x7aa8, 0x9284, 0x1000, 0x080c, 0x510b, 0x0804, 0x31d8,
+	0x00c6, 0xaab0, 0x9284, 0xc000, 0x0140, 0xd2ec, 0x0168, 0x080c,
+	0x5167, 0x1150, 0x2009, 0x0014, 0x04f0, 0x2061, 0x1800, 0x080c,
+	0x5167, 0x2009, 0x0007, 0x15b8, 0xd2f4, 0x0128, 0x9284, 0x5000,
+	0x080c, 0x512e, 0x0050, 0xd2fc, 0x0178, 0x080c, 0x468a, 0x0588,
+	0xa998, 0x9284, 0x9000, 0x080c, 0x510b, 0xa87b, 0x0000, 0xa883,
+	0x0000, 0xa897, 0x4000, 0x0438, 0x080c, 0x468a, 0x0510, 0x080c,
+	0x6315, 0x2009, 0x0009, 0x11b8, 0xa8c4, 0x9086, 0x0500, 0x11c8,
+	0xa8c8, 0x9005, 0x11b0, 0xa8cc, 0x9084, 0xff00, 0x1190, 0x080c,
+	0x468a, 0x1108, 0x0070, 0x2009, 0x004b, 0x080c, 0xbc6a, 0x2009,
+	0x0003, 0x0108, 0x0078, 0x0429, 0x19c0, 0xa897, 0x4005, 0xa99a,
+	0x0010, 0xa897, 0x4006, 0x900e, 0x9085, 0x0001, 0x2001, 0x0030,
+	0x00ce, 0x0005, 0x9006, 0x0ce0, 0x7aa8, 0xd2dc, 0x0904, 0x320a,
+	0x0016, 0x7984, 0x9284, 0x1000, 0xc0fd, 0x080c, 0x510b, 0x001e,
+	0x1904, 0x320a, 0x0804, 0x31d8, 0x00f6, 0x2d78, 0x0011, 0x00fe,
+	0x0005, 0xaab0, 0xd2dc, 0x0150, 0x0016, 0xa998, 0x9284, 0x1000,
+	0xc0fd, 0x080c, 0x510b, 0x001e, 0x9085, 0x0001, 0x0005, 0x81ff,
+	0x0120, 0x2009, 0x0001, 0x0804, 0x320a, 0x080c, 0x5167, 0x0120,
+	0x2009, 0x0007, 0x0804, 0x320a, 0x7984, 0x7ea8, 0x96b4, 0x00ff,
+	0x080c, 0x5ff1, 0x1904, 0x320d, 0x9186, 0x007f, 0x0138, 0x080c,
+	0x6315, 0x0120, 0x2009, 0x0009, 0x0804, 0x320a, 0x080c, 0x4659,
+	0x1120, 0x2009, 0x0002, 0x0804, 0x320a, 0xa867, 0x0000, 0xa868,
+	0xc0fd, 0xa86a, 0x2001, 0x0100, 0x8007, 0xa80a, 0x080c, 0xb96f,
+	0x1120, 0x2009, 0x0003, 0x0804, 0x320a, 0x7007, 0x0003, 0x701f,
+	0x4f4a, 0x0005, 0xa808, 0x8007, 0x9086, 0x0100, 0x1120, 0x2009,
+	0x0004, 0x0804, 0x320a, 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,
+	0x46a5, 0x080c, 0x4659, 0x1120, 0x2009, 0x0002, 0x0804, 0x320a,
+	0x7984, 0x9194, 0xff00, 0x918c, 0x00ff, 0x8217, 0x82ff, 0x1118,
+	0x7023, 0x1982, 0x0040, 0x92c6, 0x0001, 0x1118, 0x7023, 0x199c,
+	0x0010, 0x0804, 0x320d, 0x2009, 0x001a, 0x7a8c, 0x7b88, 0x7c9c,
+	0x7d98, 0xa85c, 0x9080, 0x0019, 0xaf60, 0x080c, 0x46a2, 0x701f,
+	0x4f9a, 0x0005, 0x2001, 0x182d, 0x2003, 0x0001, 0xa85c, 0x9080,
+	0x0019, 0x2098, 0xa860, 0x20e0, 0x20a9, 0x001a, 0x7020, 0x20a0,
+	0x20e9, 0x0001, 0x4003, 0x0804, 0x31d8, 0x080c, 0x4659, 0x1120,
+	0x2009, 0x0002, 0x0804, 0x320a, 0x7984, 0x9194, 0xff00, 0x918c,
+	0x00ff, 0x8217, 0x82ff, 0x1118, 0x2099, 0x1982, 0x0040, 0x92c6,
+	0x0001, 0x1118, 0x2099, 0x199c, 0x0010, 0x0804, 0x320d, 0xa85c,
+	0x9080, 0x0019, 0x20a0, 0xa860, 0x20e8, 0x20a9, 0x001a, 0x20e1,
+	0x0001, 0x4003, 0x2009, 0x001a, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98,
+	0xa85c, 0x9080, 0x0019, 0xaf60, 0x0804, 0x46a5, 0x7884, 0x908a,
+	0x1000, 0x1a04, 0x320d, 0x0126, 0x2091, 0x8000, 0x8003, 0x800b,
+	0x810b, 0x9108, 0x00c6, 0x2061, 0x19c9, 0x6142, 0x00ce, 0x012e,
+	0x0804, 0x31d8, 0x00c6, 0x080c, 0x6d14, 0x1160, 0x080c, 0x6ff8,
+	0x080c, 0x5a94, 0x9085, 0x0001, 0x080c, 0x6d5b, 0x080c, 0x6c46,
+	0x080c, 0x0db4, 0x2061, 0x1800, 0x6030, 0xc09d, 0x6032, 0x080c,
+	0x5953, 0x00ce, 0x0005, 0x00c6, 0x2001, 0x1800, 0x2004, 0x908e,
+	0x0000, 0x0904, 0x320a, 0x7884, 0x9005, 0x0188, 0x7888, 0x2061,
+	0x196b, 0x2c0c, 0x2062, 0x080c, 0x28ed, 0x01a0, 0x080c, 0x28f5,
+	0x0188, 0x080c, 0x28fd, 0x0170, 0x2162, 0x0804, 0x320d, 0x2061,
+	0x0100, 0x6038, 0x9086, 0x0007, 0x1118, 0x2009, 0x0001, 0x0010,
+	0x2009, 0x0000, 0x7884, 0x9086, 0x0002, 0x1548, 0x2061, 0x0100,
+	0x6028, 0xc09c, 0x602a, 0x0026, 0x2011, 0x0003, 0x080c, 0x93f3,
+	0x2011, 0x0002, 0x080c, 0x93fd, 0x002e, 0x080c, 0x92e4, 0x0036,
+	0x901e, 0x080c, 0x935a, 0x003e, 0x60e3, 0x0000, 0x080c, 0xd4e3,
+	0x080c, 0xd4fe, 0x9085, 0x0001, 0x080c, 0x6d5b, 0x9006, 0x080c,
+	0x29bc, 0x2001, 0x1800, 0x2003, 0x0004, 0x6027, 0x0008, 0x00ce,
+	0x0804, 0x31d8, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x320a,
+	0x080c, 0x5167, 0x0120, 0x2009, 0x0007, 0x0804, 0x320a, 0x7984,
+	0x7ea8, 0x96b4, 0x00ff, 0x080c, 0x5ff1, 0x1904, 0x320d, 0x9186,
+	0x007f, 0x0138, 0x080c, 0x6315, 0x0120, 0x2009, 0x0009, 0x0804,
+	0x320a, 0x080c, 0x4659, 0x1120, 0x2009, 0x0002, 0x0804, 0x320a,
+	0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a, 0x080c, 0xb972, 0x1120,
+	0x2009, 0x0003, 0x0804, 0x320a, 0x7007, 0x0003, 0x701f, 0x5099,
+	0x0005, 0xa830, 0x9086, 0x0100, 0x1120, 0x2009, 0x0004, 0x0804,
+	0x320a, 0xa8e0, 0xa866, 0xa834, 0x8007, 0x800c, 0xa85c, 0x9080,
+	0x000c, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0xaf60, 0x0804, 0x46a5,
+	0xa898, 0x9086, 0x000d, 0x1904, 0x320a, 0x2021, 0x4005, 0x0126,
+	0x2091, 0x8000, 0x0e04, 0x50bd, 0x0010, 0x012e, 0x0cc0, 0x7c36,
+	0x9486, 0x4000, 0x0118, 0x7833, 0x0011, 0x0010, 0x7833, 0x0010,
+	0x7883, 0x4005, 0xa998, 0x7986, 0xa9a4, 0x799a, 0xa9a8, 0x799e,
+	0x080c, 0x4695, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084,
+	0x190c, 0x117e, 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, 0x31d8, 0x0126, 0x2091, 0x8000, 0x00b6, 0x00c6,
+	0x90e4, 0xc000, 0x0128, 0x0006, 0x080c, 0xb7e0, 0x000e, 0x1198,
+	0xd0e4, 0x0160, 0x9180, 0x1000, 0x2004, 0x905d, 0x0160, 0x080c,
+	0x5aae, 0x080c, 0x9a47, 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, 0x5136,
+	0x015e, 0x012e, 0x0005, 0x2001, 0x1854, 0x2004, 0x0005, 0x2001,
+	0x1873, 0x2004, 0x0005, 0x0006, 0x2001, 0x1810, 0x2004, 0xd0d4,
+	0x000e, 0x0005, 0x2001, 0x180e, 0x2004, 0xd0b4, 0x0005, 0x2001,
+	0x1800, 0x2004, 0x9086, 0x0003, 0x0005, 0x0016, 0x00e6, 0x2071,
+	0x1894, 0x7108, 0x910d, 0x710a, 0x00ee, 0x001e, 0x0005, 0x080c,
+	0x4659, 0x080c, 0x0ef3, 0x2100, 0x2238, 0x7d84, 0x7c88, 0x7b8c,
+	0x7a90, 0x79a4, 0x9182, 0x0081, 0x1a04, 0x320d, 0x810c, 0x080c,
+	0x46a2, 0x701f, 0x518c, 0x0005, 0x2079, 0x0000, 0x7d94, 0x7c98,
+	0x7ba8, 0x7aac, 0x79a4, 0x810c, 0x2061, 0x18ae, 0x2c44, 0xa770,
+	0xa074, 0x2071, 0x1894, 0x080c, 0x46a5, 0x701f, 0x51a0, 0x0005,
+	0x2061, 0x18ae, 0x2c44, 0xa074, 0x2048, 0x9006, 0xa802, 0xa806,
+	0x0804, 0x31d8, 0x0126, 0x0156, 0x0136, 0x0146, 0x01c6, 0x01d6,
+	0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x2061, 0x0100, 0x2069, 0x0200,
+	0x2071, 0x1800, 0x6044, 0xd0a4, 0x11e8, 0xd084, 0x0118, 0x080c,
+	0x5353, 0x0068, 0xd08c, 0x0118, 0x080c, 0x525c, 0x0040, 0xd094,
+	0x0118, 0x080c, 0x522c, 0x0018, 0xd09c, 0x0108, 0x0099, 0x00fe,
+	0x00ee, 0x00de, 0x00ce, 0x01de, 0x01ce, 0x014e, 0x013e, 0x015e,
+	0x012e, 0x0005, 0x0016, 0x6128, 0xd19c, 0x1110, 0xc19d, 0x612a,
+	0x001e, 0x0c68, 0x0006, 0x7094, 0x9005, 0x000e, 0x0120, 0x7097,
+	0x0000, 0x708f, 0x0000, 0x624c, 0x9286, 0xf0f0, 0x1150, 0x6048,
+	0x9086, 0xf0f0, 0x0130, 0x624a, 0x6043, 0x0090, 0x6043, 0x0010,
+	0x0490, 0x9294, 0xff00, 0x9296, 0xf700, 0x0178, 0x7138, 0xd1a4,
+	0x1160, 0x6240, 0x9295, 0x0100, 0x6242, 0x9294, 0x0010, 0x0128,
+	0x2009, 0x00f7, 0x080c, 0x5a10, 0x00f0, 0x6040, 0x9084, 0x0010,
+	0x9085, 0x0140, 0x6042, 0x6043, 0x0000, 0x7083, 0x0000, 0x709f,
+	0x0001, 0x70c3, 0x0000, 0x70db, 0x0000, 0x2009, 0x1c80, 0x200b,
+	0x0000, 0x7093, 0x0000, 0x7087, 0x000f, 0x2009, 0x000f, 0x2011,
+	0x58f6, 0x080c, 0x7de5, 0x0005, 0x2001, 0x1875, 0x2004, 0xd08c,
+	0x0110, 0x705b, 0xffff, 0x7084, 0x9005, 0x1528, 0x2011, 0x58f6,
+	0x080c, 0x7d56, 0x6040, 0x9094, 0x0010, 0x9285, 0x0020, 0x6042,
+	0x20a9, 0x00c8, 0x6044, 0xd08c, 0x1168, 0x1f04, 0x5242, 0x6242,
+	0x7097, 0x0000, 0x6040, 0x9094, 0x0010, 0x9285, 0x0080, 0x6042,
+	0x6242, 0x0048, 0x6242, 0x7097, 0x0000, 0x708b, 0x0000, 0x9006,
+	0x080c, 0x5a99, 0x0000, 0x0005, 0x7088, 0x908a, 0x0003, 0x1a0c,
+	0x0db4, 0x000b, 0x0005, 0x5266, 0x52b7, 0x5352, 0x00f6, 0x0016,
+	0x6900, 0x918c, 0x0800, 0x708b, 0x0001, 0x2001, 0x015d, 0x2003,
+	0x0000, 0x6803, 0x00fc, 0x20a9, 0x0004, 0x6800, 0x9084, 0x00fc,
+	0x0120, 0x1f04, 0x5275, 0x080c, 0x0db4, 0x68a0, 0x68a2, 0x689c,
+	0x689e, 0x6898, 0x689a, 0xa001, 0x918d, 0x1600, 0x6902, 0x001e,
+	0x6837, 0x0020, 0x080c, 0x5a75, 0x2079, 0x1c00, 0x7833, 0x1101,
+	0x7837, 0x0000, 0x20e1, 0x0001, 0x2099, 0x1805, 0x20e9, 0x0001,
+	0x20a1, 0x1c0e, 0x20a9, 0x0004, 0x4003, 0x080c, 0x98d5, 0x20e1,
+	0x0001, 0x2099, 0x1c00, 0x20e9, 0x0000, 0x20a1, 0x0240, 0x20a9,
+	0x0014, 0x4003, 0x60c3, 0x000c, 0x600f, 0x0000, 0x080c, 0x5927,
+	0x00fe, 0x9006, 0x708e, 0x6043, 0x0008, 0x6042, 0x0005, 0x00f6,
+	0x708c, 0x708f, 0x0000, 0x9025, 0x0904, 0x532f, 0x6020, 0xd0b4,
+	0x1904, 0x532d, 0x719c, 0x81ff, 0x0904, 0x531b, 0x9486, 0x000c,
+	0x1904, 0x5328, 0x9480, 0x0018, 0x8004, 0x20a8, 0x080c, 0x5a6e,
+	0x2011, 0x0260, 0x2019, 0x1c00, 0x220c, 0x2304, 0x9106, 0x11e8,
+	0x8210, 0x8318, 0x1f04, 0x52d4, 0x6043, 0x0004, 0x2061, 0x0140,
+	0x605b, 0xbc94, 0x605f, 0xf0f0, 0x2061, 0x0100, 0x6043, 0x0006,
+	0x708b, 0x0002, 0x7097, 0x0002, 0x2009, 0x07d0, 0x2011, 0x58fd,
+	0x080c, 0x7de5, 0x080c, 0x5a75, 0x04c0, 0x080c, 0x5a6e, 0x2079,
+	0x0260, 0x7930, 0x918e, 0x1101, 0x1558, 0x7834, 0x9005, 0x1540,
+	0x7900, 0x918c, 0x00ff, 0x1118, 0x7804, 0x9005, 0x0190, 0x080c,
+	0x5a6e, 0x2011, 0x026e, 0x2019, 0x1805, 0x20a9, 0x0004, 0x220c,
+	0x2304, 0x9102, 0x0230, 0x11a0, 0x8210, 0x8318, 0x1f04, 0x530f,
+	0x0078, 0x709f, 0x0000, 0x080c, 0x5a6e, 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, 0x98d5,
+	0x20e1, 0x0001, 0x2099, 0x1c00, 0x20e9, 0x0000, 0x20a1, 0x0240,
+	0x20a9, 0x0014, 0x4003, 0x60c3, 0x000c, 0x2011, 0x19c0, 0x2013,
+	0x0000, 0x708f, 0x0000, 0x60a3, 0x0056, 0x60a7, 0x9575, 0x080c,
+	0x90b8, 0x08d8, 0x0005, 0x7094, 0x908a, 0x001d, 0x1a0c, 0x0db4,
+	0x000b, 0x0005, 0x5384, 0x5397, 0x53c0, 0x53e0, 0x5406, 0x5435,
+	0x545b, 0x5493, 0x54b9, 0x54e7, 0x5522, 0x555a, 0x5578, 0x55a3,
+	0x55c5, 0x55e0, 0x55ea, 0x561e, 0x5644, 0x5673, 0x5699, 0x56d1,
+	0x5715, 0x5752, 0x5773, 0x57cc, 0x57ee, 0x581c, 0x581c, 0x00c6,
+	0x2061, 0x1800, 0x6003, 0x0007, 0x2061, 0x0100, 0x6004, 0x9084,
+	0xfff9, 0x6006, 0x00ce, 0x0005, 0x2061, 0x0140, 0x605b, 0xbc94,
+	0x605f, 0xf0f0, 0x2061, 0x0100, 0x6043, 0x0002, 0x7097, 0x0001,
+	0x2009, 0x07d0, 0x2011, 0x58fd, 0x080c, 0x7de5, 0x0005, 0x00f6,
+	0x708c, 0x9086, 0x0014, 0x1510, 0x6042, 0x6020, 0xd0b4, 0x11f0,
+	0x080c, 0x5a6e, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1102, 0x11a0,
+	0x7834, 0x9005, 0x1188, 0x7a38, 0xd2fc, 0x0128, 0x70c0, 0x9005,
+	0x1110, 0x70c3, 0x0001, 0x2011, 0x58fd, 0x080c, 0x7d56, 0x7097,
+	0x0010, 0x080c, 0x55ea, 0x0010, 0x708f, 0x0000, 0x00fe, 0x0005,
+	0x00f6, 0x7097, 0x0003, 0x6043, 0x0004, 0x2011, 0x58fd, 0x080c,
+	0x7d56, 0x080c, 0x59f2, 0x2079, 0x0240, 0x7833, 0x1102, 0x7837,
+	0x0000, 0x20a9, 0x0008, 0x9f88, 0x000e, 0x200b, 0x0000, 0x8108,
+	0x1f04, 0x53d5, 0x60c3, 0x0014, 0x080c, 0x5927, 0x00fe, 0x0005,
+	0x00f6, 0x708c, 0x9005, 0x0500, 0x2011, 0x58fd, 0x080c, 0x7d56,
+	0x9086, 0x0014, 0x11b8, 0x080c, 0x5a6e, 0x2079, 0x0260, 0x7a30,
+	0x9296, 0x1102, 0x1178, 0x7834, 0x9005, 0x1160, 0x7a38, 0xd2fc,
+	0x0128, 0x70c0, 0x9005, 0x1110, 0x70c3, 0x0001, 0x7097, 0x0004,
+	0x0029, 0x0010, 0x080c, 0x5a4a, 0x00fe, 0x0005, 0x00f6, 0x7097,
+	0x0005, 0x080c, 0x59f2, 0x2079, 0x0240, 0x7833, 0x1103, 0x7837,
+	0x0000, 0x080c, 0x5a6e, 0x080c, 0x5a51, 0x1170, 0x7080, 0x9005,
+	0x1158, 0x7158, 0x9186, 0xffff, 0x0138, 0x2011, 0x0008, 0x080c,
+	0x58aa, 0x0168, 0x080c, 0x5a27, 0x20a9, 0x0008, 0x20e1, 0x0000,
+	0x2099, 0x026e, 0x20e9, 0x0000, 0x20a1, 0x024e, 0x4003, 0x60c3,
+	0x0014, 0x080c, 0x5927, 0x00fe, 0x0005, 0x00f6, 0x708c, 0x9005,
+	0x0500, 0x2011, 0x58fd, 0x080c, 0x7d56, 0x9086, 0x0014, 0x11b8,
+	0x080c, 0x5a6e, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1103, 0x1178,
+	0x7834, 0x9005, 0x1160, 0x7a38, 0xd2fc, 0x0128, 0x70c0, 0x9005,
+	0x1110, 0x70c3, 0x0001, 0x7097, 0x0006, 0x0029, 0x0010, 0x080c,
+	0x5a4a, 0x00fe, 0x0005, 0x00f6, 0x7097, 0x0007, 0x080c, 0x59f2,
+	0x2079, 0x0240, 0x7833, 0x1104, 0x7837, 0x0000, 0x080c, 0x5a6e,
+	0x080c, 0x5a51, 0x11b8, 0x7080, 0x9005, 0x11a0, 0x7160, 0x9186,
+	0xffff, 0x0180, 0x9180, 0x2fd9, 0x200d, 0x918c, 0xff00, 0x810f,
+	0x2011, 0x0008, 0x080c, 0x58aa, 0x0180, 0x080c, 0x4a74, 0x0110,
+	0x080c, 0x2574, 0x20a9, 0x0008, 0x20e1, 0x0000, 0x2099, 0x026e,
+	0x20e9, 0x0000, 0x20a1, 0x024e, 0x4003, 0x60c3, 0x0014, 0x080c,
+	0x5927, 0x00fe, 0x0005, 0x00f6, 0x708c, 0x9005, 0x0500, 0x2011,
+	0x58fd, 0x080c, 0x7d56, 0x9086, 0x0014, 0x11b8, 0x080c, 0x5a6e,
+	0x2079, 0x0260, 0x7a30, 0x9296, 0x1104, 0x1178, 0x7834, 0x9005,
+	0x1160, 0x7a38, 0xd2fc, 0x0128, 0x70c0, 0x9005, 0x1110, 0x70c3,
+	0x0001, 0x7097, 0x0008, 0x0029, 0x0010, 0x080c, 0x5a4a, 0x00fe,
+	0x0005, 0x00f6, 0x7097, 0x0009, 0x080c, 0x59f2, 0x2079, 0x0240,
+	0x7833, 0x1105, 0x7837, 0x0100, 0x080c, 0x5a51, 0x1150, 0x7080,
+	0x9005, 0x1138, 0x080c, 0x581d, 0x1188, 0x9085, 0x0001, 0x080c,
+	0x2574, 0x20a9, 0x0008, 0x080c, 0x5a6e, 0x20e1, 0x0000, 0x2099,
+	0x026e, 0x20e9, 0x0000, 0x20a1, 0x024e, 0x4003, 0x60c3, 0x0014,
+	0x080c, 0x5927, 0x0010, 0x080c, 0x5377, 0x00fe, 0x0005, 0x00f6,
+	0x708c, 0x9005, 0x05a8, 0x2011, 0x58fd, 0x080c, 0x7d56, 0x9086,
+	0x0014, 0x1560, 0x080c, 0x5a6e, 0x2079, 0x0260, 0x7a30, 0x9296,
+	0x1105, 0x1520, 0x7834, 0x9084, 0x0100, 0x2011, 0x0100, 0x921e,
+	0x1160, 0x7a38, 0xd2fc, 0x0128, 0x70c0, 0x9005, 0x1110, 0x70c3,
+	0x0001, 0x7097, 0x000a, 0x00b1, 0x0098, 0x9005, 0x1178, 0x7a38,
+	0xd2fc, 0x0128, 0x70c0, 0x9005, 0x1110, 0x70c3, 0x0001, 0x7093,
+	0x0000, 0x7097, 0x000e, 0x080c, 0x55c5, 0x0010, 0x080c, 0x5a4a,
+	0x00fe, 0x0005, 0x00f6, 0x7097, 0x000b, 0x2011, 0x1c0e, 0x20e9,
+	0x0001, 0x22a0, 0x20a9, 0x0040, 0x2019, 0xffff, 0x4304, 0x080c,
+	0x59f2, 0x2079, 0x0240, 0x7833, 0x1106, 0x7837, 0x0000, 0x080c,
+	0x5a51, 0x0118, 0x2013, 0x0000, 0x0020, 0x705c, 0x9085, 0x0100,
+	0x2012, 0x20a9, 0x0040, 0x2009, 0x024e, 0x2011, 0x1c0e, 0x220e,
+	0x8210, 0x8108, 0x9186, 0x0260, 0x1128, 0x6810, 0x8000, 0x6812,
+	0x2009, 0x0240, 0x1f04, 0x5547, 0x60c3, 0x0084, 0x080c, 0x5927,
+	0x00fe, 0x0005, 0x00f6, 0x708c, 0x9005, 0x01c0, 0x2011, 0x58fd,
+	0x080c, 0x7d56, 0x9086, 0x0084, 0x1178, 0x080c, 0x5a6e, 0x2079,
+	0x0260, 0x7a30, 0x9296, 0x1106, 0x1138, 0x7834, 0x9005, 0x1120,
+	0x7097, 0x000c, 0x0029, 0x0010, 0x080c, 0x5a4a, 0x00fe, 0x0005,
+	0x00f6, 0x7097, 0x000d, 0x080c, 0x59f2, 0x2079, 0x0240, 0x7833,
+	0x1107, 0x7837, 0x0000, 0x080c, 0x5a6e, 0x20a9, 0x0040, 0x2011,
+	0x026e, 0x2009, 0x024e, 0x220e, 0x8210, 0x8108, 0x9186, 0x0260,
+	0x1150, 0x6810, 0x8000, 0x6812, 0x2009, 0x0240, 0x6814, 0x8000,
+	0x6816, 0x2011, 0x0260, 0x1f04, 0x558b, 0x60c3, 0x0084, 0x080c,
+	0x5927, 0x00fe, 0x0005, 0x00f6, 0x708c, 0x9005, 0x01e0, 0x2011,
+	0x58fd, 0x080c, 0x7d56, 0x9086, 0x0084, 0x1198, 0x080c, 0x5a6e,
+	0x2079, 0x0260, 0x7a30, 0x9296, 0x1107, 0x1158, 0x7834, 0x9005,
+	0x1140, 0x7093, 0x0001, 0x080c, 0x59c4, 0x7097, 0x000e, 0x0029,
+	0x0010, 0x080c, 0x5a4a, 0x00fe, 0x0005, 0x918d, 0x0001, 0x080c,
+	0x5a99, 0x7097, 0x000f, 0x708f, 0x0000, 0x2061, 0x0140, 0x605b,
+	0xbc85, 0x605f, 0xb5b5, 0x2061, 0x0100, 0x6043, 0x0005, 0x6043,
+	0x0004, 0x2009, 0x07d0, 0x2011, 0x58fd, 0x080c, 0x7d4a, 0x0005,
+	0x708c, 0x9005, 0x0130, 0x2011, 0x58fd, 0x080c, 0x7d56, 0x7097,
+	0x0000, 0x0005, 0x7097, 0x0011, 0x080c, 0x98d5, 0x080c, 0x5a6e,
+	0x20e1, 0x0000, 0x2099, 0x0260, 0x20e9, 0x0000, 0x20a1, 0x0240,
+	0x748c, 0x9480, 0x0018, 0x9080, 0x0007, 0x9084, 0x03f8, 0x8004,
+	0x20a8, 0x4003, 0x080c, 0x5a51, 0x11a0, 0x7178, 0x81ff, 0x0188,
+	0x900e, 0x707c, 0x9084, 0x00ff, 0x0160, 0x080c, 0x250b, 0x9186,
+	0x007e, 0x0138, 0x9186, 0x0080, 0x0120, 0x2011, 0x0008, 0x080c,
+	0x58aa, 0x60c3, 0x0014, 0x080c, 0x5927, 0x0005, 0x00f6, 0x708c,
+	0x9005, 0x0500, 0x2011, 0x58fd, 0x080c, 0x7d56, 0x9086, 0x0014,
+	0x11b8, 0x080c, 0x5a6e, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1103,
+	0x1178, 0x7834, 0x9005, 0x1160, 0x7a38, 0xd2fc, 0x0128, 0x70c0,
+	0x9005, 0x1110, 0x70c3, 0x0001, 0x7097, 0x0012, 0x0029, 0x0010,
+	0x708f, 0x0000, 0x00fe, 0x0005, 0x00f6, 0x7097, 0x0013, 0x080c,
+	0x5a00, 0x2079, 0x0240, 0x7833, 0x1103, 0x7837, 0x0000, 0x080c,
+	0x5a6e, 0x080c, 0x5a51, 0x1170, 0x7080, 0x9005, 0x1158, 0x7158,
+	0x9186, 0xffff, 0x0138, 0x2011, 0x0008, 0x080c, 0x58aa, 0x0168,
+	0x080c, 0x5a27, 0x20a9, 0x0008, 0x20e1, 0x0000, 0x2099, 0x026e,
+	0x20e9, 0x0000, 0x20a1, 0x024e, 0x4003, 0x60c3, 0x0014, 0x080c,
+	0x5927, 0x00fe, 0x0005, 0x00f6, 0x708c, 0x9005, 0x0500, 0x2011,
+	0x58fd, 0x080c, 0x7d56, 0x9086, 0x0014, 0x11b8, 0x080c, 0x5a6e,
+	0x2079, 0x0260, 0x7a30, 0x9296, 0x1104, 0x1178, 0x7834, 0x9005,
+	0x1160, 0x7a38, 0xd2fc, 0x0128, 0x70c0, 0x9005, 0x1110, 0x70c3,
+	0x0001, 0x7097, 0x0014, 0x0029, 0x0010, 0x708f, 0x0000, 0x00fe,
+	0x0005, 0x00f6, 0x7097, 0x0015, 0x080c, 0x5a00, 0x2079, 0x0240,
+	0x7833, 0x1104, 0x7837, 0x0000, 0x080c, 0x5a6e, 0x080c, 0x5a51,
+	0x11b8, 0x7080, 0x9005, 0x11a0, 0x7160, 0x9186, 0xffff, 0x0180,
+	0x9180, 0x2fd9, 0x200d, 0x918c, 0xff00, 0x810f, 0x2011, 0x0008,
+	0x080c, 0x58aa, 0x0180, 0x080c, 0x4a74, 0x0110, 0x080c, 0x2574,
+	0x20a9, 0x0008, 0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9, 0x0000,
+	0x20a1, 0x024e, 0x4003, 0x60c3, 0x0014, 0x080c, 0x5927, 0x00fe,
+	0x0005, 0x00f6, 0x708c, 0x9005, 0x05f0, 0x2011, 0x58fd, 0x080c,
+	0x7d56, 0x9086, 0x0014, 0x15a8, 0x080c, 0x5a6e, 0x2079, 0x0260,
+	0x7a30, 0x9296, 0x1105, 0x1568, 0x7834, 0x9084, 0x0100, 0x2011,
+	0x0100, 0x921e, 0x1168, 0x9085, 0x0001, 0x080c, 0x5a99, 0x7a38,
+	0xd2fc, 0x0128, 0x70c0, 0x9005, 0x1110, 0x70c3, 0x0001, 0x0080,
+	0x9005, 0x11b8, 0x7a38, 0xd2fc, 0x0128, 0x70c0, 0x9005, 0x1110,
+	0x70c3, 0x0001, 0x9085, 0x0001, 0x080c, 0x5a99, 0x7093, 0x0000,
+	0x7a38, 0xd2f4, 0x0110, 0x70db, 0x0008, 0x7097, 0x0016, 0x0029,
+	0x0010, 0x708f, 0x0000, 0x00fe, 0x0005, 0x080c, 0x98d5, 0x080c,
+	0x5a6e, 0x20e1, 0x0000, 0x2099, 0x0260, 0x20e9, 0x0000, 0x20a1,
+	0x0240, 0x20a9, 0x000e, 0x4003, 0x2011, 0x026d, 0x2204, 0x9084,
+	0x0100, 0x2011, 0x024d, 0x2012, 0x2011, 0x026e, 0x7097, 0x0017,
+	0x080c, 0x5a51, 0x1150, 0x7080, 0x9005, 0x1138, 0x080c, 0x581d,
+	0x1188, 0x9085, 0x0001, 0x080c, 0x2574, 0x20a9, 0x0008, 0x080c,
+	0x5a6e, 0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9, 0x0000, 0x20a1,
+	0x024e, 0x4003, 0x60c3, 0x0014, 0x080c, 0x5927, 0x0010, 0x080c,
+	0x5377, 0x0005, 0x00f6, 0x708c, 0x9005, 0x01d8, 0x2011, 0x58fd,
+	0x080c, 0x7d56, 0x9086, 0x0084, 0x1190, 0x080c, 0x5a6e, 0x2079,
+	0x0260, 0x7a30, 0x9296, 0x1106, 0x1150, 0x7834, 0x9005, 0x1138,
+	0x9006, 0x080c, 0x5a99, 0x7097, 0x0018, 0x0029, 0x0010, 0x708f,
+	0x0000, 0x00fe, 0x0005, 0x00f6, 0x7097, 0x0019, 0x080c, 0x5a00,
+	0x2079, 0x0240, 0x7833, 0x1106, 0x7837, 0x0000, 0x080c, 0x5a6e,
+	0x2009, 0x026e, 0x2039, 0x1c0e, 0x20a9, 0x0040, 0x213e, 0x8738,
+	0x8108, 0x9186, 0x0280, 0x1128, 0x6814, 0x8000, 0x6816, 0x2009,
+	0x0260, 0x1f04, 0x5786, 0x2039, 0x1c0e, 0x080c, 0x5a51, 0x11e8,
+	0x2728, 0x2514, 0x8207, 0x9084, 0x00ff, 0x8000, 0x2018, 0x9294,
+	0x00ff, 0x8007, 0x9205, 0x202a, 0x705c, 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, 0x57b9, 0x60c3, 0x0084,
+	0x080c, 0x5927, 0x00fe, 0x0005, 0x00f6, 0x708c, 0x9005, 0x01e0,
+	0x2011, 0x58fd, 0x080c, 0x7d56, 0x9086, 0x0084, 0x1198, 0x080c,
+	0x5a6e, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1107, 0x1158, 0x7834,
+	0x9005, 0x1140, 0x7093, 0x0001, 0x080c, 0x59c4, 0x7097, 0x001a,
+	0x0029, 0x0010, 0x708f, 0x0000, 0x00fe, 0x0005, 0x9085, 0x0001,
+	0x080c, 0x5a99, 0x7097, 0x001b, 0x080c, 0x98d5, 0x080c, 0x5a6e,
+	0x2011, 0x0260, 0x2009, 0x0240, 0x748c, 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, 0x5805, 0x60c3,
+	0x0084, 0x080c, 0x5927, 0x0005, 0x0005, 0x0086, 0x0096, 0x2029,
+	0x1854, 0x252c, 0x20a9, 0x0008, 0x2041, 0x1c0e, 0x20e9, 0x0001,
+	0x28a0, 0x080c, 0x5a6e, 0x20e1, 0x0000, 0x2099, 0x026e, 0x4003,
+	0x20a9, 0x0008, 0x2011, 0x0007, 0xd5d4, 0x0108, 0x9016, 0x2800,
+	0x9200, 0x200c, 0x91a6, 0xffff, 0x1148, 0xd5d4, 0x0110, 0x8210,
+	0x0008, 0x8211, 0x1f04, 0x5837, 0x0804, 0x58a6, 0x82ff, 0x1160,
+	0xd5d4, 0x0120, 0x91a6, 0x3fff, 0x0d90, 0x0020, 0x91a6, 0x3fff,
+	0x0904, 0x58a6, 0x918d, 0xc000, 0x20a9, 0x0010, 0x2019, 0x0001,
+	0xd5d4, 0x0110, 0x2019, 0x0010, 0x2120, 0xd5d4, 0x0110, 0x8423,
+	0x0008, 0x8424, 0x1240, 0xd5d4, 0x0110, 0x8319, 0x0008, 0x8318,
+	0x1f04, 0x585d, 0x04d8, 0x23a8, 0x2021, 0x0001, 0x8426, 0x8425,
+	0x1f04, 0x586f, 0x2328, 0x8529, 0x92be, 0x0007, 0x0158, 0x0006,
+	0x2039, 0x0007, 0x2200, 0x973a, 0x000e, 0x27a8, 0x95a8, 0x0010,
+	0x1f04, 0x587e, 0x755a, 0x95c8, 0x2fd9, 0x292d, 0x95ac, 0x00ff,
+	0x757e, 0x6532, 0x6536, 0x0016, 0x2508, 0x080c, 0x2554, 0x001e,
+	0x60e7, 0x0000, 0x65ea, 0x2018, 0x2304, 0x9405, 0x201a, 0x7083,
+	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,
+	0x715a, 0x91a0, 0x2fd9, 0x242d, 0x95ac, 0x00ff, 0x757e, 0x6532,
+	0x6536, 0x0016, 0x2508, 0x080c, 0x2554, 0x001e, 0x60e7, 0x0000,
+	0x65ea, 0x7083, 0x0001, 0x9084, 0x0000, 0x0005, 0x00e6, 0x2071,
+	0x1800, 0x7087, 0x0000, 0x00ee, 0x0005, 0x00e6, 0x00f6, 0x2079,
+	0x0100, 0x2071, 0x0140, 0x080c, 0x59b3, 0x080c, 0x90c1, 0x7004,
+	0x9084, 0x4000, 0x0110, 0x080c, 0x29cc, 0x0126, 0x2091, 0x8000,
+	0x2071, 0x1825, 0x2073, 0x0000, 0x7840, 0x0026, 0x0016, 0x2009,
+	0x00f7, 0x080c, 0x5a10, 0x001e, 0x9094, 0x0010, 0x9285, 0x0080,
+	0x7842, 0x7a42, 0x002e, 0x012e, 0x00fe, 0x00ee, 0x0005, 0x0126,
+	0x2091, 0x8000, 0x080c, 0x2872, 0x0228, 0x2011, 0x0101, 0x2204,
+	0xc0c5, 0x2012, 0x2011, 0x19c0, 0x2013, 0x0000, 0x708f, 0x0000,
+	0x012e, 0x60a3, 0x0056, 0x60a7, 0x9575, 0x080c, 0x90b8, 0x6144,
+	0xd184, 0x0120, 0x7194, 0x918d, 0x2000, 0x0018, 0x7188, 0x918d,
+	0x1000, 0x2011, 0x1968, 0x2112, 0x2009, 0x07d0, 0x2011, 0x58fd,
+	0x080c, 0x7de5, 0x0005, 0x0016, 0x0026, 0x00c6, 0x0126, 0x2091,
+	0x8000, 0x080c, 0x9a4e, 0x2009, 0x00f7, 0x080c, 0x5a10, 0x2061,
+	0x19c9, 0x900e, 0x611a, 0x611e, 0x6172, 0x6176, 0x2061, 0x1800,
+	0x6003, 0x0001, 0x2061, 0x0100, 0x6043, 0x0090, 0x6043, 0x0010,
+	0x2009, 0x1968, 0x200b, 0x0000, 0x2009, 0x002d, 0x2011, 0x597f,
+	0x080c, 0x7d4a, 0x012e, 0x00ce, 0x002e, 0x001e, 0x0005, 0x00e6,
+	0x0006, 0x0126, 0x2091, 0x8000, 0x0471, 0x2071, 0x0100, 0x080c,
+	0x90c1, 0x2071, 0x0140, 0x7004, 0x9084, 0x4000, 0x0110, 0x080c,
+	0x29cc, 0x080c, 0x6d1c, 0x0188, 0x080c, 0x6d37, 0x1170, 0x080c,
+	0x7002, 0x0016, 0x080c, 0x2623, 0x2001, 0x193e, 0x2102, 0x001e,
+	0x080c, 0x6ffd, 0x080c, 0x6c46, 0x0050, 0x2009, 0x0001, 0x080c,
+	0x290b, 0x2001, 0x0001, 0x080c, 0x24b4, 0x080c, 0x5953, 0x012e,
+	0x000e, 0x00ee, 0x0005, 0x2001, 0x180e, 0x2004, 0xd0bc, 0x0158,
+	0x0026, 0x0036, 0x2011, 0x8017, 0x2001, 0x1968, 0x201c, 0x080c,
+	0x46b9, 0x003e, 0x002e, 0x0005, 0x20a9, 0x0012, 0x20e9, 0x0001,
+	0x20a1, 0x1c80, 0x080c, 0x5a6e, 0x20e9, 0x0000, 0x2099, 0x026e,
+	0x0099, 0x20a9, 0x0020, 0x080c, 0x5a68, 0x2099, 0x0260, 0x20a1,
+	0x1c92, 0x0051, 0x20a9, 0x000e, 0x080c, 0x5a6b, 0x2099, 0x0260,
+	0x20a1, 0x1cb2, 0x0009, 0x0005, 0x0016, 0x0026, 0x3410, 0x3308,
+	0x2104, 0x8007, 0x2012, 0x8108, 0x8210, 0x1f04, 0x59e8, 0x002e,
+	0x001e, 0x0005, 0x080c, 0x98d5, 0x20e1, 0x0001, 0x2099, 0x1c00,
+	0x20e9, 0x0000, 0x20a1, 0x0240, 0x20a9, 0x000c, 0x4003, 0x0005,
+	0x080c, 0x98d5, 0x080c, 0x5a6e, 0x20e1, 0x0000, 0x2099, 0x0260,
+	0x20e9, 0x0000, 0x20a1, 0x0240, 0x20a9, 0x000c, 0x4003, 0x0005,
+	0x00c6, 0x0006, 0x2061, 0x0100, 0x810f, 0x2001, 0x1833, 0x2004,
+	0x9005, 0x1138, 0x2001, 0x1817, 0x2004, 0x9084, 0x00ff, 0x9105,
+	0x0010, 0x9185, 0x00f7, 0x604a, 0x000e, 0x00ce, 0x0005, 0x0016,
+	0x0046, 0x080c, 0x6311, 0x0158, 0x9006, 0x2020, 0x2009, 0x002a,
+	0x080c, 0xd188, 0x2001, 0x180c, 0x200c, 0xc195, 0x2102, 0x2019,
+	0x002a, 0x900e, 0x080c, 0x2e4a, 0x080c, 0xbe86, 0x0140, 0x0036,
+	0x2019, 0xffff, 0x2021, 0x0007, 0x080c, 0x4856, 0x003e, 0x004e,
+	0x001e, 0x0005, 0x080c, 0x5953, 0x7097, 0x0000, 0x708f, 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, 0x5aa8, 0x015e, 0x0005, 0x00d6, 0x0036,
+	0x0156, 0x0136, 0x0146, 0x2069, 0x1853, 0x9006, 0xb802, 0xb8be,
+	0xb807, 0x0707, 0xb80a, 0xb80e, 0xb812, 0x9198, 0x2fd9, 0x231d,
+	0x939c, 0x00ff, 0xbb16, 0x0016, 0x0026, 0xb8b2, 0x080c, 0x9a47,
+	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, 0x101e, 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, 0x5b7e, 0x9182, 0x0800, 0x1a04, 0x5b82, 0x2001,
+	0x180c, 0x2004, 0x9084, 0x0003, 0x1904, 0x5b88, 0x9188, 0x1000,
+	0x2104, 0x905d, 0x0518, 0xb804, 0x9084, 0x00ff, 0x908e, 0x0006,
+	0x1508, 0xb8a4, 0x900d, 0x1904, 0x5b9a, 0xb850, 0x900d, 0x1148,
+	0xa802, 0x2900, 0xb852, 0xb84e, 0x080c, 0x8129, 0x9006, 0x012e,
+	0x0005, 0x00a6, 0x2150, 0x2900, 0xb002, 0xa803, 0x0000, 0x00ae,
+	0xb852, 0x0c90, 0x2001, 0x0005, 0x900e, 0x04b8, 0x2001, 0x0028,
+	0x900e, 0x0498, 0x9082, 0x0006, 0x1290, 0x080c, 0x9a47, 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, 0x6315, 0x1990, 0xb800, 0xd0bc, 0x0978,
+	0x0804, 0x5b31, 0x080c, 0x618d, 0x0904, 0x5b4a, 0x0804, 0x5b35,
+	0x00b6, 0x00e6, 0x0126, 0x2091, 0x8000, 0xa974, 0x9182, 0x0800,
+	0x1a04, 0x5c1b, 0x9188, 0x1000, 0x2104, 0x905d, 0x0904, 0x5bf3,
+	0xb8a0, 0x9086, 0x007f, 0x0178, 0x080c, 0x631d, 0x0160, 0xa994,
+	0x81ff, 0x0130, 0x908e, 0x0004, 0x0130, 0x908e, 0x0005, 0x0118,
+	0x080c, 0x6315, 0x1598, 0xa87c, 0xd0fc, 0x01e0, 0xa894, 0x9005,
+	0x01c8, 0x2060, 0x0026, 0x2010, 0x080c, 0xb781, 0x002e, 0x1120,
+	0x2001, 0x0008, 0x0804, 0x5c1d, 0x6020, 0x9086, 0x000a, 0x0120,
+	0x2001, 0x0008, 0x0804, 0x5c1d, 0x601a, 0x6003, 0x0008, 0x2900,
+	0x6016, 0x0058, 0x080c, 0x9a72, 0x05e8, 0x2b00, 0x6012, 0x2900,
+	0x6016, 0x600b, 0xffff, 0x6023, 0x000a, 0x2009, 0x0003, 0x080c,
+	0x9b42, 0x9006, 0x0458, 0x2001, 0x0028, 0x0438, 0x9082, 0x0006,
+	0x1290, 0x080c, 0x9a47, 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, 0x5cb2, 0x5c6d, 0x5c84,
+	0x5cb2, 0x5cb2, 0x5cb2, 0x5cb2, 0x5cb2, 0x2100, 0x9082, 0x007e,
+	0x1278, 0x080c, 0x5f91, 0x0148, 0x9046, 0xb810, 0x9306, 0x1904,
+	0x5cba, 0xb814, 0x9206, 0x15f0, 0x0028, 0xbb12, 0xba16, 0x0010,
+	0x080c, 0x4573, 0x0150, 0x04b0, 0x080c, 0x5ff1, 0x1598, 0xb810,
+	0x9306, 0x1580, 0xb814, 0x9206, 0x1568, 0x080c, 0x9a72, 0x0530,
+	0x2b00, 0x6012, 0x080c, 0xbc01, 0x2900, 0x6016, 0x600b, 0xffff,
+	0x6023, 0x000a, 0xa878, 0x9086, 0x0001, 0x1170, 0x080c, 0x2e7f,
+	0x9006, 0x080c, 0x5f2e, 0x2001, 0x0002, 0x080c, 0x5f42, 0x2001,
+	0x0200, 0xb86e, 0xb893, 0x0002, 0x2009, 0x0003, 0x080c, 0x9b42,
+	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, 0x5e87, 0x90c6, 0x0056,
+	0x0904, 0x5e8b, 0x90c6, 0x0066, 0x0904, 0x5e8f, 0x90c6, 0x0071,
+	0x0904, 0x5e93, 0x90c6, 0x0074, 0x0904, 0x5e97, 0x90c6, 0x007c,
+	0x0904, 0x5e9b, 0x90c6, 0x007e, 0x0904, 0x5e9f, 0x90c6, 0x0037,
+	0x0904, 0x5ea3, 0x9016, 0x2079, 0x1800, 0xa974, 0x9186, 0x00ff,
+	0x0904, 0x5e82, 0x9182, 0x0800, 0x1a04, 0x5e82, 0x080c, 0x5ff1,
+	0x1198, 0xb804, 0x9084, 0x00ff, 0x9082, 0x0006, 0x1268, 0xa894,
+	0x90c6, 0x006f, 0x0148, 0x080c, 0x9a47, 0x1904, 0x5e6b, 0xb8a0,
+	0x9084, 0xff80, 0x1904, 0x5e6b, 0xa894, 0x90c6, 0x006f, 0x0158,
+	0x90c6, 0x005e, 0x0904, 0x5dcb, 0x90c6, 0x0064, 0x0904, 0x5df4,
+	0x2008, 0x0804, 0x5d8e, 0xa998, 0xa8b0, 0x2040, 0x080c, 0x9a47,
+	0x1120, 0x9182, 0x007f, 0x0a04, 0x5d8e, 0x9186, 0x00ff, 0x0904,
+	0x5d8e, 0x9182, 0x0800, 0x1a04, 0x5d8e, 0xaaa0, 0xab9c, 0x7878,
+	0x9306, 0x1188, 0x787c, 0x0096, 0x924e, 0x1128, 0x2208, 0x2310,
+	0x009e, 0x0804, 0x5d8e, 0x99cc, 0xff00, 0x009e, 0x1120, 0x2208,
+	0x2310, 0x0804, 0x5d8e, 0x080c, 0x4573, 0x0904, 0x5d97, 0x900e,
+	0x9016, 0x90c6, 0x4000, 0x1558, 0x0006, 0x080c, 0x6211, 0x1108,
+	0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d, 0x20a9, 0x0004, 0xa860,
+	0x20e8, 0xa85c, 0x9080, 0x0031, 0x20a0, 0xb8b4, 0x20e0, 0xb8b8,
+	0x9080, 0x0006, 0x2098, 0x080c, 0x0f69, 0x20a9, 0x0004, 0xa860,
+	0x20e8, 0xa85c, 0x9080, 0x0035, 0x20a0, 0xb8b4, 0x20e0, 0xb8b8,
+	0x9080, 0x000a, 0x2098, 0x080c, 0x0f69, 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,
+	0x9a72, 0x1130, 0x2001, 0x4005, 0x2009, 0x0003, 0x9016, 0x0c80,
+	0x2b00, 0x6012, 0x080c, 0xbc01, 0x2900, 0x6016, 0x6023, 0x0001,
+	0xa868, 0xd88c, 0x0108, 0xc0f5, 0xa86a, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x2e7f, 0x012e, 0x9006, 0x080c, 0x5f2e, 0x2001, 0x0002,
+	0x080c, 0x5f42, 0x2009, 0x0002, 0x080c, 0x9b42, 0xa8b0, 0xd094,
+	0x0118, 0xb8bc, 0xc08d, 0xb8be, 0x9006, 0x9005, 0x012e, 0x00ee,
+	0x00fe, 0x00be, 0x0005, 0x080c, 0x5167, 0x0118, 0x2009, 0x0007,
+	0x00f8, 0xa998, 0xaeb0, 0x080c, 0x5ff1, 0x1904, 0x5d89, 0x9186,
+	0x007f, 0x0130, 0x080c, 0x6315, 0x0118, 0x2009, 0x0009, 0x0080,
+	0x0096, 0x080c, 0x0fec, 0x1120, 0x009e, 0x2009, 0x0002, 0x0040,
+	0x2900, 0x009e, 0xa806, 0x080c, 0xb972, 0x19b0, 0x2009, 0x0003,
+	0x2001, 0x4005, 0x0804, 0x5d90, 0xa998, 0xaeb0, 0x080c, 0x5ff1,
+	0x1904, 0x5d89, 0x0096, 0x080c, 0x0fec, 0x1128, 0x009e, 0x2009,
+	0x0002, 0x0804, 0x5e48, 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, 0x0f69,
+	0x009e, 0xa87b, 0x0000, 0xa883, 0x0000, 0xa897, 0x4000, 0xd684,
+	0x1168, 0x080c, 0x5153, 0xd0b4, 0x1118, 0xa89b, 0x000b, 0x00e0,
+	0xb800, 0xd08c, 0x0118, 0xa89b, 0x000c, 0x00b0, 0x080c, 0x6315,
+	0x0118, 0xa89b, 0x0009, 0x0080, 0x080c, 0x5167, 0x0118, 0xa89b,
+	0x0007, 0x0050, 0x080c, 0xb955, 0x1904, 0x5dc4, 0x2009, 0x0003,
+	0x2001, 0x4005, 0x0804, 0x5d90, 0xa87b, 0x0030, 0xa897, 0x4005,
+	0xa804, 0x8006, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0,
+	0x9080, 0x0002, 0x2009, 0x002b, 0xaaa0, 0xab9c, 0xaca8, 0xada4,
+	0x2031, 0x0000, 0x2041, 0x1226, 0x080c, 0x9fca, 0x1904, 0x5dc4,
+	0x2009, 0x0002, 0x08e8, 0x2001, 0x0028, 0x900e, 0x0804, 0x5dc5,
+	0x2009, 0x180c, 0x210c, 0xd18c, 0x0118, 0x2001, 0x0004, 0x0038,
+	0xd184, 0x0118, 0x2001, 0x0004, 0x0010, 0x2001, 0x0029, 0x900e,
+	0x0804, 0x5dc5, 0x2001, 0x0029, 0x900e, 0x0804, 0x5dc5, 0x080c,
+	0x33fd, 0x0804, 0x5dc6, 0x080c, 0x4e90, 0x0804, 0x5dc6, 0x080c,
+	0x41cd, 0x0804, 0x5dc6, 0x080c, 0x462f, 0x0804, 0x5dc6, 0x080c,
+	0x48d7, 0x0804, 0x5dc6, 0x080c, 0x4b0a, 0x0804, 0x5dc6, 0x080c,
+	0x4cfb, 0x0804, 0x5dc6, 0x080c, 0x360d, 0x0804, 0x5dc6, 0x00b6,
+	0xa974, 0xae78, 0x9684, 0x3fff, 0x9082, 0x4000, 0x1618, 0x9182,
+	0x0800, 0x1268, 0x9188, 0x1000, 0x2104, 0x905d, 0x0140, 0x080c,
+	0x6315, 0x1148, 0x00e9, 0x080c, 0x611c, 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, 0x6311, 0x0140, 0x9284, 0xff00, 0x8007, 0x9086,
+	0x0007, 0x1110, 0x2011, 0x0600, 0x000e, 0x9294, 0xff00, 0x9215,
+	0xba06, 0x0006, 0x9086, 0x0006, 0x1120, 0xba90, 0x82ff, 0x090c,
+	0x0db4, 0x000e, 0x00ce, 0x012e, 0x00be, 0x0005, 0x00b6, 0x0126,
+	0x00c6, 0x2091, 0x8000, 0x6210, 0x2258, 0xba04, 0x0006, 0x9086,
+	0x0006, 0x1168, 0xb89c, 0xd0a4, 0x0150, 0x080c, 0x630d, 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,
+	0x0fec, 0x2958, 0x009e, 0x0160, 0x2b00, 0x2012, 0xb85c, 0xb8ba,
+	0xb860, 0xb8b6, 0x9006, 0xb8a6, 0x080c, 0x5aae, 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, 0x101e, 0x00d6, 0x00c6,
+	0xb8ac, 0x2060, 0x8cff, 0x0168, 0x600c, 0x0006, 0x6014, 0x2048,
+	0x080c, 0xb793, 0x0110, 0x080c, 0x0f9e, 0x080c, 0x9ac8, 0x00ce,
+	0x0c88, 0x00ce, 0x00de, 0x2b48, 0xb8b8, 0xb85e, 0xb8b4, 0xb862,
+	0x080c, 0x102e, 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, 0x6d14, 0x1510, 0xb8a0, 0x9086, 0x007e,
+	0x0120, 0x080c, 0x9a47, 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, 0x68b2, 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,
+	0x0db4, 0x3c00, 0x20e8, 0x3300, 0x8001, 0x20a0, 0x4604, 0x8210,
+	0xaa06, 0x01de, 0x01ce, 0x014e, 0x013e, 0x0060, 0x080c, 0x0fec,
+	0x0170, 0x2900, 0xb8a6, 0xa803, 0x0000, 0x080c, 0x61ad, 0xa807,
+	0x0001, 0xae12, 0x9085, 0x0001, 0x012e, 0x009e, 0x0005, 0x9006,
+	0x0cd8, 0x0126, 0x2091, 0x8000, 0x0096, 0xb8a4, 0x904d, 0x0188,
+	0xa800, 0x9005, 0x1150, 0x080c, 0x61bc, 0x1158, 0xa804, 0x908a,
+	0x0002, 0x0218, 0x8001, 0xa806, 0x0020, 0x080c, 0x101e, 0xb8a7,
+	0x0000, 0x009e, 0x012e, 0x0005, 0x0126, 0x2091, 0x8000, 0x080c,
+	0x8129, 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, 0x9446, 0xaa00, 0xb84c, 0x9906, 0x1110,
+	0xba4e, 0x0020, 0x00a6, 0x2150, 0xb202, 0x00ae, 0x82ff, 0x1110,
+	0xb952, 0x89ff, 0x012e, 0x0005, 0x9016, 0x0489, 0x1110, 0x2011,
+	0x0001, 0x0005, 0x080c, 0x6211, 0x0128, 0x080c, 0xb85b, 0x0010,
+	0x9085, 0x0001, 0x0005, 0x080c, 0x6211, 0x0128, 0x080c, 0xb7f5,
+	0x0010, 0x9085, 0x0001, 0x0005, 0x080c, 0x6211, 0x0128, 0x080c,
+	0xb858, 0x0010, 0x9085, 0x0001, 0x0005, 0x080c, 0x6211, 0x0128,
+	0x080c, 0xb819, 0x0010, 0x9085, 0x0001, 0x0005, 0x080c, 0x6211,
+	0x0128, 0x080c, 0xb885, 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,
+	0x0fec, 0x0168, 0x2900, 0xb8a6, 0x080c, 0x61ad, 0xa803, 0x0001,
+	0xa807, 0x0000, 0x9085, 0x0001, 0x012e, 0x009e, 0x0005, 0x9006,
+	0x0cd8, 0x0096, 0x0126, 0x2091, 0x8000, 0xb8a4, 0x904d, 0x0130,
+	0xb8a7, 0x0000, 0x080c, 0x101e, 0x9085, 0x0001, 0x012e, 0x009e,
+	0x0005, 0xb89c, 0xd0a4, 0x0005, 0x00b6, 0x00f6, 0x080c, 0x6d14,
+	0x01b0, 0x71c0, 0x81ff, 0x1198, 0x71d8, 0xd19c, 0x0180, 0x2001,
+	0x007e, 0x9080, 0x1000, 0x2004, 0x905d, 0x0148, 0xb804, 0x9084,
+	0x00ff, 0x9086, 0x0006, 0x1118, 0xb800, 0xc0ed, 0xb802, 0x2079,
+	0x1853, 0x7804, 0x00d0, 0x0156, 0x20a9, 0x007f, 0x900e, 0x0016,
+	0x080c, 0x5ff1, 0x1168, 0xb804, 0x9084, 0xff00, 0x8007, 0x9096,
+	0x0004, 0x0118, 0x9086, 0x0006, 0x1118, 0xb800, 0xc0ed, 0xb802,
+	0x001e, 0x8108, 0x1f04, 0x6237, 0x015e, 0x080c, 0x62d3, 0x0120,
+	0x2001, 0x1954, 0x200c, 0x0030, 0x2079, 0x1853, 0x7804, 0x0030,
+	0x2009, 0x07d0, 0x2011, 0x6261, 0x080c, 0x7de5, 0x00fe, 0x00be,
+	0x0005, 0x00b6, 0x2011, 0x6261, 0x080c, 0x7d56, 0x080c, 0x62d3,
+	0x01d8, 0x2001, 0x107e, 0x2004, 0x2058, 0xb900, 0xc1ec, 0xb902,
+	0x080c, 0x6311, 0x0130, 0x2009, 0x07d0, 0x2011, 0x6261, 0x080c,
+	0x7de5, 0x00e6, 0x2071, 0x1800, 0x9006, 0x707a, 0x705c, 0x707e,
+	0x080c, 0x2c63, 0x00ee, 0x04b0, 0x0156, 0x00c6, 0x20a9, 0x007f,
+	0x900e, 0x0016, 0x080c, 0x5ff1, 0x1538, 0xb800, 0xd0ec, 0x0520,
+	0x0046, 0xbaa0, 0x2220, 0x9006, 0x2009, 0x0029, 0x080c, 0xd188,
+	0xb800, 0xc0e5, 0xc0ec, 0xb802, 0x080c, 0x630d, 0x2001, 0x0707,
+	0x1128, 0xb804, 0x9084, 0x00ff, 0x9085, 0x0700, 0xb806, 0x2019,
+	0x0029, 0x080c, 0x828c, 0x0076, 0x903e, 0x080c, 0x8184, 0x900e,
+	0x080c, 0xcef9, 0x007e, 0x004e, 0x001e, 0x8108, 0x1f04, 0x6289,
+	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, 0x0db4, 0x000e, 0xba00, 0x9005, 0x0110, 0xc2fd,
+	0x0008, 0xc2fc, 0xba02, 0x002e, 0x012e, 0x0005, 0x2011, 0x1836,
+	0x2204, 0xd0cc, 0x0138, 0x2001, 0x1952, 0x200c, 0x2011, 0x6303,
+	0x080c, 0x7de5, 0x0005, 0x2011, 0x6303, 0x080c, 0x7d56, 0x2011,
+	0x1836, 0x2204, 0xc0cc, 0x2012, 0x0005, 0x080c, 0x5153, 0xd0ac,
+	0x0005, 0x080c, 0x5153, 0xd0a4, 0x0005, 0x0016, 0xb904, 0x9184,
+	0x00ff, 0x908e, 0x0006, 0x001e, 0x0005, 0x0016, 0xb904, 0x9184,
+	0xff00, 0x8007, 0x908e, 0x0006, 0x001e, 0x0005, 0x00b6, 0x00f6,
+	0x080c, 0xbe86, 0x0158, 0x70d8, 0x9084, 0x0028, 0x0138, 0x2001,
+	0x107f, 0x2004, 0x905d, 0x0110, 0xb8bc, 0xd094, 0x00fe, 0x00be,
+	0x0005, 0x0006, 0x0016, 0x0036, 0x0046, 0x0076, 0x00b6, 0x2001,
+	0x1817, 0x203c, 0x9780, 0x2fd9, 0x203d, 0x97bc, 0xff00, 0x873f,
+	0x9006, 0x2018, 0x2008, 0x9284, 0x8000, 0x0110, 0x2019, 0x0001,
+	0x9294, 0x7fff, 0x2100, 0x9706, 0x0190, 0x91a0, 0x1000, 0x2404,
+	0x905d, 0x0168, 0xb804, 0x9084, 0x00ff, 0x9086, 0x0006, 0x1138,
+	0x83ff, 0x0118, 0xb89c, 0xd0a4, 0x0110, 0x8211, 0x0158, 0x8108,
+	0x83ff, 0x0120, 0x9182, 0x0800, 0x0e28, 0x0068, 0x9182, 0x007e,
+	0x0e08, 0x0048, 0x00be, 0x007e, 0x004e, 0x003e, 0x001e, 0x9085,
+	0x0001, 0x000e, 0x0005, 0x00be, 0x007e, 0x004e, 0x003e, 0x001e,
+	0x9006, 0x000e, 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, 0x5153, 0xd0fc, 0x1140, 0x080c,
+	0x5153, 0x900e, 0xd09c, 0x0108, 0x8108, 0x7102, 0x0400, 0x2001,
+	0x1873, 0x200c, 0x9184, 0x0007, 0x9006, 0x0002, 0x639f, 0x639f,
+	0x639f, 0x639f, 0x639f, 0x63b6, 0x63c4, 0x639f, 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, 0x706a, 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, 0x65f7,
+	0xa87c, 0xd0bc, 0x1904, 0x65f7, 0xa978, 0xa874, 0x9105, 0x1904,
+	0x65f7, 0x2001, 0x191a, 0x2004, 0x0002, 0x65f7, 0x6450, 0x648c,
+	0x648c, 0x65f7, 0x648c, 0x0005, 0xa868, 0xd0fc, 0x1500, 0x00e6,
+	0x0026, 0x2009, 0x191a, 0x210c, 0x81ff, 0x0904, 0x65f7, 0xa87c,
+	0xd0cc, 0x0904, 0x65f7, 0xa880, 0x9084, 0x00ff, 0x9086, 0x0001,
+	0x1904, 0x65f7, 0x9186, 0x0003, 0x0904, 0x648c, 0x9186, 0x0005,
+	0x0904, 0x648c, 0xa84f, 0x8021, 0xa853, 0x0017, 0x0028, 0x0005,
+	0xa84f, 0x8020, 0xa853, 0x0016, 0x2071, 0x1906, 0x701c, 0x9005,
+	0x1904, 0x67b7, 0x0e04, 0x6802, 0x2071, 0x0000, 0xa84c, 0x7082,
+	0xa850, 0x7032, 0xa86c, 0x7086, 0x7036, 0xa870, 0x708a, 0x2091,
+	0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x117e, 0x2071,
+	0x1800, 0x2011, 0x0001, 0xa804, 0x900d, 0x702c, 0x1158, 0xa802,
+	0x2900, 0x702e, 0x70bc, 0x9200, 0x70be, 0x080c, 0x7c7b, 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,
+	0x657b, 0x782c, 0x908c, 0x0780, 0x190c, 0x6929, 0x8004, 0x8004,
+	0x8004, 0x9084, 0x0003, 0x0002, 0x64aa, 0x657b, 0x64cf, 0x6516,
+	0x080c, 0x0db4, 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, 0x70bc, 0x9200, 0x70be, 0x080c, 0x7c7b, 0x0c10, 0x2071,
+	0x1800, 0x2900, 0x7822, 0xa804, 0x900d, 0x1580, 0x7824, 0x00e6,
+	0x2071, 0x0040, 0x712c, 0xd19c, 0x1148, 0x2009, 0x182f, 0x210c,
+	0x918a, 0x0040, 0x0218, 0x7022, 0x00ee, 0x0058, 0x00ee, 0x2048,
+	0x702c, 0xa802, 0x2900, 0x702e, 0x70bc, 0x8000, 0x70be, 0x080c,
+	0x7c7b, 0x782c, 0x9094, 0x0780, 0x190c, 0x6929, 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,
+	0x70bc, 0x9200, 0x70be, 0x080c, 0x7c7b, 0x0800, 0x0096, 0x00e6,
+	0x7824, 0x2048, 0x2071, 0x1800, 0x702c, 0xa802, 0x2900, 0x702e,
+	0x70bc, 0x8000, 0x70be, 0x080c, 0x7c7b, 0x782c, 0x9094, 0x0780,
+	0x190c, 0x6929, 0xd0a4, 0x1d60, 0x00ee, 0x782c, 0x9094, 0x0780,
+	0x190c, 0x6929, 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, 0x70bc, 0x9200, 0x70be, 0x080c, 0x7c7b, 0x00fe,
+	0x002e, 0x00ee, 0x0005, 0x2908, 0x7010, 0x8000, 0x7012, 0x7018,
+	0x904d, 0x711a, 0x0110, 0xa902, 0x0008, 0x711e, 0x2148, 0xa804,
+	0x900d, 0x1904, 0x65d0, 0x782c, 0x9094, 0x0780, 0x190c, 0x6929,
+	0xd09c, 0x1198, 0x701c, 0x904d, 0x0180, 0x7010, 0x8001, 0x7012,
+	0x1108, 0x701a, 0xa800, 0x701e, 0x2900, 0x7822, 0x782c, 0x9094,
+	0x0780, 0x190c, 0x6929, 0xd09c, 0x0d68, 0x782c, 0x9094, 0x0780,
+	0x190c, 0x6929, 0xd0a4, 0x01b0, 0x00e6, 0x7824, 0x2048, 0x2071,
+	0x1800, 0x702c, 0xa802, 0x2900, 0x702e, 0x70bc, 0x8000, 0x70be,
+	0x080c, 0x7c7b, 0x782c, 0x9094, 0x0780, 0x190c, 0x6929, 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, 0x70bc, 0x9200, 0x70be,
+	0x080c, 0x7c7b, 0x00ee, 0x0804, 0x658b, 0xa868, 0xd0fc, 0x1904,
+	0x6633, 0x0096, 0xa804, 0xa807, 0x0000, 0x904d, 0x190c, 0x0f9e,
+	0x009e, 0x0018, 0xa868, 0xd0fc, 0x15f0, 0x00e6, 0x0026, 0xa84f,
+	0x0000, 0x00f6, 0x2079, 0x0050, 0x2071, 0x1800, 0x70e8, 0x8001,
+	0x01d0, 0x1678, 0x2071, 0x1906, 0xa803, 0x0000, 0x7010, 0x9005,
+	0x1904, 0x6731, 0x782c, 0x908c, 0x0780, 0x190c, 0x6929, 0x8004,
+	0x8004, 0x8004, 0x9084, 0x0003, 0x0002, 0x6634, 0x6731, 0x664f,
+	0x66c0, 0x080c, 0x0db4, 0x70eb, 0x0fa0, 0x71e4, 0x8107, 0x9106,
+	0x9094, 0x00c0, 0x9184, 0xff3f, 0x9205, 0x70e6, 0x3b08, 0x3a00,
+	0x9104, 0x918d, 0x00c0, 0x21d8, 0x9084, 0xff3f, 0x9205, 0x20d0,
+	0x0888, 0x70ea, 0x0878, 0x0005, 0x2071, 0x1800, 0x2900, 0x7822,
+	0xa804, 0x900d, 0x1120, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x9016,
+	0x702c, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8,
+	0x702e, 0x70bc, 0x9200, 0x70be, 0x080c, 0x7c7b, 0x0c60, 0x2071,
+	0x1800, 0x2900, 0x7822, 0xa804, 0x900d, 0x1904, 0x66af, 0x7830,
+	0x8007, 0x9084, 0x001f, 0x9082, 0x0005, 0x1220, 0x00fe, 0x002e,
+	0x00ee, 0x0005, 0x7824, 0x00e6, 0x2071, 0x0040, 0x712c, 0xd19c,
+	0x1148, 0x2009, 0x182f, 0x210c, 0x918a, 0x0040, 0x0218, 0x7022,
+	0x00ee, 0x0058, 0x00ee, 0x2048, 0x702c, 0xa802, 0x2900, 0x702e,
+	0x70bc, 0x8000, 0x70be, 0x080c, 0x7c7b, 0x782c, 0x9094, 0x0780,
+	0x190c, 0x6929, 0xd0a4, 0x19f0, 0x0e04, 0x66a6, 0x7838, 0x7938,
+	0x910e, 0x1de0, 0x00d6, 0x2069, 0x0000, 0x6836, 0x6833, 0x0013,
+	0x00de, 0x2001, 0x1917, 0x200c, 0xc184, 0x2102, 0x2091, 0x4080,
+	0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x117e, 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, 0x70bc, 0x9200, 0x70be, 0x080c, 0x7c7b, 0x0804, 0x6662,
+	0x0096, 0x00e6, 0x7824, 0x2048, 0x2071, 0x1800, 0x702c, 0xa802,
+	0x2900, 0x702e, 0x70bc, 0x8000, 0x70be, 0x080c, 0x7c7b, 0x782c,
+	0x9094, 0x0780, 0x190c, 0x6929, 0xd0a4, 0x1d60, 0x00ee, 0x0e04,
+	0x6704, 0x7838, 0x7938, 0x910e, 0x1de0, 0x00d6, 0x2069, 0x0000,
+	0x6836, 0x6833, 0x0013, 0x00de, 0x7044, 0xc084, 0x7046, 0x2091,
+	0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x117e, 0x2009,
+	0x1919, 0x200b, 0x0000, 0x782c, 0x9094, 0x0780, 0x190c, 0x6929,
+	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,
+	0x70bc, 0x9200, 0x70be, 0x080c, 0x7c7b, 0x00fe, 0x002e, 0x00ee,
+	0x0005, 0x2908, 0x7010, 0x8000, 0x7012, 0x7018, 0x904d, 0x711a,
+	0x0110, 0xa902, 0x0008, 0x711e, 0x2148, 0xa804, 0x900d, 0x1904,
+	0x67a2, 0x782c, 0x9094, 0x0780, 0x190c, 0x6929, 0xd09c, 0x11b0,
+	0x701c, 0x904d, 0x0198, 0xa84c, 0x9005, 0x1180, 0x7010, 0x8001,
+	0x7012, 0x1108, 0x701a, 0xa800, 0x701e, 0x2900, 0x7822, 0x782c,
+	0x9094, 0x0780, 0x190c, 0x6929, 0xd09c, 0x0d50, 0x782c, 0x9094,
+	0x0780, 0x190c, 0x6929, 0xd0a4, 0x05c8, 0x00e6, 0x7824, 0x2048,
+	0x2071, 0x1800, 0x702c, 0xa802, 0x2900, 0x702e, 0x70bc, 0x8000,
+	0x70be, 0x080c, 0x7c7b, 0x782c, 0x9094, 0x0780, 0x190c, 0x6929,
+	0xd0a4, 0x1d60, 0x00ee, 0x0e04, 0x679b, 0x7838, 0x7938, 0x910e,
+	0x1de0, 0x00d6, 0x2069, 0x0000, 0x6836, 0x6833, 0x0013, 0x00de,
+	0x7044, 0xc084, 0x7046, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004,
+	0xd084, 0x190c, 0x117e, 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, 0x70bc,
+	0x9200, 0x70be, 0x080c, 0x7c7b, 0x00ee, 0x0804, 0x6741, 0x2071,
+	0x1906, 0xa803, 0x0000, 0x2908, 0x7010, 0x8000, 0x7012, 0x7018,
+	0x904d, 0x711a, 0x0110, 0xa902, 0x0008, 0x711e, 0x2148, 0xa804,
+	0x900d, 0x1128, 0x1e04, 0x67e2, 0x002e, 0x00ee, 0x0005, 0x2071,
+	0x1800, 0x9016, 0x702c, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900,
+	0x81ff, 0x1dc8, 0x702e, 0x70bc, 0x9200, 0x70be, 0x080c, 0x7c7b,
+	0x0e04, 0x67cc, 0x2071, 0x1906, 0x701c, 0x2048, 0xa84c, 0x900d,
+	0x0d18, 0x2071, 0x0000, 0x7182, 0xa850, 0x7032, 0xa86c, 0x7086,
+	0x7036, 0xa870, 0x708a, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004,
+	0xd084, 0x190c, 0x117e, 0x2071, 0x1906, 0x080c, 0x6915, 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, 0x70bc, 0x9200, 0x70be, 0x080c,
+	0x7c7b, 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, 0x684d,
+	0x684e, 0x6914, 0x684e, 0x0db4, 0x6914, 0x0005, 0x2001, 0x191a,
+	0x2004, 0x0002, 0x6858, 0x6858, 0x68ad, 0x68ae, 0x6858, 0x68ae,
+	0x0126, 0x2091, 0x8000, 0x1e0c, 0x6934, 0x701c, 0x904d, 0x01e0,
+	0xa84c, 0x9005, 0x01d8, 0x0e04, 0x687c, 0xa94c, 0x2071, 0x0000,
+	0x7182, 0xa850, 0x7032, 0xa86c, 0x7086, 0x7036, 0xa870, 0x708a,
+	0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x117e,
+	0x2071, 0x1906, 0x080c, 0x6915, 0x012e, 0x0470, 0x2001, 0x005b,
+	0x2004, 0x9094, 0x0780, 0x190c, 0x6929, 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, 0x1814, 0x2004, 0x2009, 0x1a8f, 0x210c, 0x9102,
+	0x1500, 0x0126, 0x2091, 0x8000, 0x2069, 0x0050, 0x693c, 0x6838,
+	0x9106, 0x0190, 0x0e04, 0x68e0, 0x2069, 0x0000, 0x6837, 0x8040,
+	0x6833, 0x0012, 0x6883, 0x8040, 0x2091, 0x4080, 0x2001, 0x0089,
+	0x2004, 0xd084, 0x190c, 0x117e, 0x2069, 0x19c9, 0x683f, 0xffff,
+	0x012e, 0x00de, 0x0126, 0x2091, 0x8000, 0x1e0c, 0x69a5, 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, 0x101e, 0x0005, 0x012e,
+	0x0005, 0x2091, 0x8000, 0x0e04, 0x692b, 0x0006, 0x0016, 0x2001,
+	0x8004, 0x0006, 0x0804, 0x0dbd, 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, 0x117e,
+	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,
+	0x182f, 0x210c, 0x918a, 0x0040, 0x0218, 0x7022, 0x00ee, 0x0058,
+	0x00ee, 0x2048, 0x702c, 0xa802, 0x2900, 0x702e, 0x70bc, 0x8000,
+	0x70be, 0x080c, 0x7c7b, 0x782c, 0x9094, 0x0780, 0x190c, 0x6929,
+	0xd0a4, 0x19f0, 0x7838, 0x7938, 0x910e, 0x1de0, 0x00d6, 0x2069,
+	0x0000, 0x6836, 0x6833, 0x0013, 0x00de, 0x2091, 0x4080, 0x2001,
+	0x0089, 0x2004, 0xd084, 0x190c, 0x117e, 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, 0x117e,
+	0x00fe, 0x0005, 0x782c, 0x9094, 0x0780, 0x190c, 0x6929, 0xd0a4,
+	0x0db8, 0x00e6, 0x2071, 0x1800, 0x7824, 0x2048, 0x702c, 0xa802,
+	0x2900, 0x702e, 0x70bc, 0x8000, 0x70be, 0x080c, 0x7c7b, 0x782c,
+	0x9094, 0x0780, 0x190c, 0x6929, 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, 0x7094, 0x908a,
+	0x0029, 0x1a0c, 0x0db4, 0x9082, 0x001d, 0x001b, 0x6027, 0x1e00,
+	0x0005, 0x6ac9, 0x6a53, 0x6a6f, 0x6a97, 0x6ab8, 0x6af8, 0x6b0a,
+	0x6a6f, 0x6ae0, 0x6a0e, 0x6a3c, 0x6a0d, 0x0005, 0x00d6, 0x2069,
+	0x0200, 0x6804, 0x9005, 0x1180, 0x6808, 0x9005, 0x1518, 0x7097,
+	0x0028, 0x2069, 0x195e, 0x2d04, 0x7002, 0x080c, 0x6e4d, 0x6028,
+	0x9085, 0x0600, 0x602a, 0x00b0, 0x7097, 0x0028, 0x2069, 0x195e,
+	0x2d04, 0x7002, 0x6028, 0x9085, 0x0600, 0x602a, 0x00e6, 0x0036,
+	0x0046, 0x0056, 0x2071, 0x1a31, 0x080c, 0x18a6, 0x005e, 0x004e,
+	0x003e, 0x00ee, 0x00de, 0x0005, 0x00d6, 0x2069, 0x0200, 0x6804,
+	0x9005, 0x1178, 0x6808, 0x9005, 0x1160, 0x7097, 0x0028, 0x2069,
+	0x195e, 0x2d04, 0x7002, 0x080c, 0x6ee7, 0x6028, 0x9085, 0x0600,
+	0x602a, 0x00de, 0x0005, 0x0006, 0x2001, 0x0090, 0x080c, 0x29bc,
+	0x000e, 0x6124, 0xd1e4, 0x1190, 0x080c, 0x6b77, 0xd1d4, 0x1160,
+	0xd1dc, 0x1138, 0xd1cc, 0x0150, 0x7097, 0x0020, 0x080c, 0x6b77,
+	0x0028, 0x7097, 0x001d, 0x0010, 0x7097, 0x001f, 0x0005, 0x2001,
+	0x0088, 0x080c, 0x29bc, 0x6124, 0xd1cc, 0x11d8, 0xd1dc, 0x11b0,
+	0xd1e4, 0x1188, 0x9184, 0x1e00, 0x11c8, 0x60e3, 0x0001, 0x600c,
+	0xc0b4, 0x600e, 0x080c, 0x6d40, 0x2001, 0x0080, 0x080c, 0x29bc,
+	0x7097, 0x0028, 0x0058, 0x7097, 0x001e, 0x0040, 0x7097, 0x001d,
+	0x0028, 0x7097, 0x0020, 0x0010, 0x7097, 0x001f, 0x0005, 0x60e3,
+	0x0001, 0x600c, 0xc0b4, 0x600e, 0x080c, 0x6d40, 0x2001, 0x0080,
+	0x080c, 0x29bc, 0x6124, 0xd1d4, 0x1180, 0xd1dc, 0x1158, 0xd1e4,
+	0x1130, 0x9184, 0x1e00, 0x1158, 0x7097, 0x0028, 0x0040, 0x7097,
+	0x001e, 0x0028, 0x7097, 0x001d, 0x0010, 0x7097, 0x001f, 0x0005,
+	0x2001, 0x00a0, 0x080c, 0x29bc, 0x6124, 0xd1dc, 0x1138, 0xd1e4,
+	0x0138, 0x080c, 0x18d0, 0x7097, 0x001e, 0x0010, 0x7097, 0x001d,
+	0x0005, 0x080c, 0x6bfa, 0x6124, 0xd1dc, 0x1188, 0x080c, 0x6b77,
+	0x0016, 0x080c, 0x18d0, 0x001e, 0xd1d4, 0x1128, 0xd1e4, 0x0138,
+	0x7097, 0x001e, 0x0020, 0x7097, 0x001f, 0x080c, 0x6b77, 0x0005,
+	0x0006, 0x2001, 0x00a0, 0x080c, 0x29bc, 0x000e, 0x6124, 0xd1d4,
+	0x1160, 0xd1cc, 0x1150, 0xd1dc, 0x1128, 0xd1e4, 0x0140, 0x7097,
+	0x001e, 0x0028, 0x7097, 0x001d, 0x0010, 0x7097, 0x0021, 0x0005,
+	0x080c, 0x6bfa, 0x6124, 0xd1d4, 0x1150, 0xd1dc, 0x1128, 0xd1e4,
+	0x0140, 0x7097, 0x001e, 0x0028, 0x7097, 0x001d, 0x0010, 0x7097,
+	0x001f, 0x0005, 0x0006, 0x2001, 0x0090, 0x080c, 0x29bc, 0x000e,
+	0x6124, 0xd1d4, 0x1178, 0xd1cc, 0x1150, 0xd1dc, 0x1128, 0xd1e4,
+	0x0158, 0x7097, 0x001e, 0x0040, 0x7097, 0x001d, 0x0028, 0x7097,
+	0x0020, 0x0010, 0x7097, 0x001f, 0x0005, 0x0016, 0x00c6, 0x00d6,
+	0x00e6, 0x0126, 0x2061, 0x0100, 0x2069, 0x0140, 0x2071, 0x1800,
+	0x2091, 0x8000, 0x080c, 0x6d14, 0x11d8, 0x2001, 0x180c, 0x200c,
+	0xd1b4, 0x01b0, 0xc1b4, 0x2102, 0x6027, 0x0200, 0x080c, 0x2905,
+	0x6024, 0xd0cc, 0x0148, 0x2001, 0x00a0, 0x080c, 0x29bc, 0x080c,
+	0x6ff8, 0x080c, 0x5a94, 0x0428, 0x6028, 0xc0cd, 0x602a, 0x0408,
+	0x080c, 0x6d2e, 0x0150, 0x080c, 0x6d25, 0x1138, 0x2001, 0x0001,
+	0x080c, 0x24b4, 0x080c, 0x6cec, 0x00a0, 0x080c, 0x6bf7, 0x0178,
+	0x2001, 0x0001, 0x080c, 0x24b4, 0x7094, 0x9086, 0x001e, 0x0120,
+	0x7094, 0x9086, 0x0022, 0x1118, 0x7097, 0x0025, 0x0010, 0x7097,
+	0x0021, 0x012e, 0x00ee, 0x00de, 0x00ce, 0x001e, 0x0005, 0x0026,
+	0x2011, 0x6b88, 0x080c, 0x7e27, 0x002e, 0x0016, 0x0026, 0x2009,
+	0x0064, 0x2011, 0x6b88, 0x080c, 0x7e1e, 0x002e, 0x001e, 0x0005,
+	0x00e6, 0x00f6, 0x0016, 0x080c, 0x90c1, 0x2071, 0x1800, 0x080c,
+	0x6b25, 0x001e, 0x00fe, 0x00ee, 0x0005, 0x0016, 0x0026, 0x0036,
+	0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x0126, 0x080c, 0x90c1, 0x2061,
+	0x0100, 0x2069, 0x0140, 0x2071, 0x1800, 0x2091, 0x8000, 0x6028,
+	0xc09c, 0x602a, 0x2011, 0x0003, 0x080c, 0x93f3, 0x2011, 0x0002,
+	0x080c, 0x93fd, 0x080c, 0x92e4, 0x080c, 0x7dd3, 0x0036, 0x901e,
+	0x080c, 0x935a, 0x003e, 0x60e3, 0x0000, 0x080c, 0xd4e3, 0x080c,
+	0xd4fe, 0x2009, 0x0004, 0x080c, 0x290b, 0x080c, 0x2826, 0x2001,
+	0x1800, 0x2003, 0x0004, 0x6027, 0x0008, 0x2011, 0x6b88, 0x080c,
+	0x7e27, 0x080c, 0x6d2e, 0x0118, 0x9006, 0x080c, 0x29bc, 0x080c,
+	0x0b8f, 0x2001, 0x0001, 0x080c, 0x24b4, 0x012e, 0x00fe, 0x00ee,
+	0x00de, 0x00ce, 0x003e, 0x002e, 0x001e, 0x0005, 0x0026, 0x00e6,
+	0x2011, 0x6b95, 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, 0x29bc, 0x0156, 0x20a9, 0x002d, 0x1d04,
+	0x6c07, 0x2091, 0x6000, 0x1f04, 0x6c07, 0x015e, 0x00d6, 0x2069,
+	0x1800, 0x6898, 0x8001, 0x0220, 0x0118, 0x689a, 0x00de, 0x0005,
+	0x689b, 0x0014, 0x68e4, 0xd0dc, 0x0dc8, 0x6800, 0x9086, 0x0001,
+	0x1da8, 0x080c, 0x7e33, 0x0c90, 0x00c6, 0x00d6, 0x00e6, 0x2061,
+	0x0100, 0x2069, 0x0140, 0x2071, 0x1800, 0x080c, 0x7007, 0x2001,
+	0x193e, 0x2003, 0x0000, 0x9006, 0x7096, 0x60e2, 0x6886, 0x080c,
+	0x257f, 0x9006, 0x080c, 0x29bc, 0x080c, 0x5953, 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, 0x6cdc,
+	0x7097, 0x0022, 0x0040, 0x7097, 0x0021, 0x0028, 0x7097, 0x0023,
+	0x0010, 0x7097, 0x0024, 0x60e3, 0x0000, 0x6887, 0x0001, 0x2001,
+	0x0001, 0x080c, 0x257f, 0x0026, 0x080c, 0x9a4e, 0x002e, 0x7000,
+	0x908e, 0x0004, 0x0118, 0x602b, 0x0028, 0x0010, 0x602b, 0x0020,
+	0x0156, 0x0126, 0x2091, 0x8000, 0x20a9, 0x0005, 0x6024, 0xd0ac,
+	0x0150, 0x012e, 0x015e, 0x080c, 0xbe86, 0x0118, 0x9006, 0x080c,
+	0x29e6, 0x0804, 0x6ce8, 0x6800, 0x9084, 0x00a1, 0xc0bd, 0x6802,
+	0x080c, 0x2905, 0x6904, 0xd1d4, 0x1140, 0x2001, 0x0100, 0x080c,
+	0x29bc, 0x1f04, 0x6c86, 0x080c, 0x6d6b, 0x012e, 0x015e, 0x080c,
+	0x6d25, 0x01a8, 0x6044, 0x9005, 0x0168, 0x6050, 0x0006, 0x9085,
+	0x0020, 0x6052, 0x080c, 0x6d6b, 0x9006, 0x8001, 0x1df0, 0x000e,
+	0x6052, 0x0028, 0x6804, 0xd0d4, 0x1110, 0x080c, 0x6d6b, 0x080c,
+	0xbe86, 0x0118, 0x9006, 0x080c, 0x29e6, 0x0016, 0x0026, 0x7000,
+	0x908e, 0x0004, 0x0130, 0x2009, 0x00c8, 0x2011, 0x6b95, 0x080c,
+	0x7de5, 0x002e, 0x001e, 0x080c, 0x7c72, 0x7034, 0xc085, 0x7036,
+	0x2001, 0x194e, 0x2003, 0x0004, 0x080c, 0x69f6, 0x080c, 0x6d25,
+	0x0138, 0x6804, 0xd0d4, 0x1120, 0xd0dc, 0x1100, 0x080c, 0x6ffd,
+	0x00ee, 0x00de, 0x00ce, 0x0005, 0x00c6, 0x00d6, 0x00e6, 0x2061,
+	0x0100, 0x2069, 0x0140, 0x2071, 0x1800, 0x080c, 0x7c89, 0x080c,
+	0x7c7b, 0x080c, 0x7007, 0x2001, 0x193e, 0x2003, 0x0000, 0x9006,
+	0x7096, 0x60e2, 0x6886, 0x080c, 0x257f, 0x9006, 0x080c, 0x29bc,
+	0x6043, 0x0090, 0x6043, 0x0010, 0x6027, 0xffff, 0x602b, 0x182f,
+	0x00ee, 0x00de, 0x00ce, 0x0005, 0x0006, 0x2001, 0x194d, 0x2004,
+	0x9086, 0xaaaa, 0x000e, 0x0005, 0x0006, 0x080c, 0x5157, 0x9084,
+	0x0030, 0x9086, 0x0000, 0x000e, 0x0005, 0x0006, 0x080c, 0x5157,
+	0x9084, 0x0030, 0x9086, 0x0030, 0x000e, 0x0005, 0x0006, 0x080c,
+	0x5157, 0x9084, 0x0030, 0x9086, 0x0010, 0x000e, 0x0005, 0x0006,
+	0x080c, 0x5157, 0x9084, 0x0030, 0x9086, 0x0020, 0x000e, 0x0005,
+	0x0036, 0x0016, 0x2001, 0x180c, 0x2004, 0x908c, 0x0013, 0x0180,
+	0x0020, 0x080c, 0x259f, 0x900e, 0x0028, 0x080c, 0x630d, 0x1dc8,
+	0x2009, 0x0002, 0x2019, 0x0028, 0x080c, 0x2e4a, 0x9006, 0x0019,
+	0x001e, 0x003e, 0x0005, 0x00e6, 0x2071, 0x180c, 0x2e04, 0x0130,
+	0x080c, 0xbe7f, 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, 0x6d80, 0x2091, 0x6000, 0x1f04, 0x6d80, 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, 0x257f, 0x2001, 0x00a0,
+	0x0006, 0x080c, 0xbe86, 0x000e, 0x0130, 0x080c, 0x29da, 0x9006,
+	0x080c, 0x29e6, 0x0010, 0x080c, 0x29bc, 0x000e, 0x6052, 0x6050,
+	0x0006, 0xc0e5, 0x6052, 0x00f6, 0x2079, 0x0100, 0x080c, 0x287a,
+	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, 0x6e3f, 0x2001, 0x180c, 0x200c, 0xc1c4,
+	0x2102, 0x6028, 0x9084, 0xe1ff, 0x602a, 0x6027, 0x0200, 0x2001,
+	0x0090, 0x080c, 0x29bc, 0x20a9, 0x0366, 0x6024, 0xd0cc, 0x1518,
+	0x1d04, 0x6ded, 0x2091, 0x6000, 0x1f04, 0x6ded, 0x2011, 0x0003,
+	0x080c, 0x93f3, 0x2011, 0x0002, 0x080c, 0x93fd, 0x080c, 0x92e4,
+	0x901e, 0x080c, 0x935a, 0x2001, 0x00a0, 0x080c, 0x29bc, 0x080c,
+	0x6ff8, 0x080c, 0x5a94, 0x080c, 0xbe86, 0x0110, 0x080c, 0x0d22,
+	0x9085, 0x0001, 0x0490, 0x86ff, 0x1110, 0x080c, 0x18d0, 0x60e3,
+	0x0000, 0x2001, 0x0002, 0x080c, 0x257f, 0x60e2, 0x2001, 0x0080,
+	0x080c, 0x29bc, 0x20a9, 0x0366, 0x6027, 0x1e00, 0x2009, 0x1e00,
+	0x080c, 0x2905, 0x6024, 0x910c, 0x0138, 0x1d04, 0x6e24, 0x2091,
+	0x6000, 0x1f04, 0x6e24, 0x0810, 0x6028, 0x9085, 0x1e00, 0x602a,
+	0x70b0, 0x9005, 0x1118, 0x6887, 0x0001, 0x0008, 0x6886, 0x080c,
+	0xbe86, 0x0110, 0x080c, 0x0d22, 0x9006, 0x00ee, 0x00de, 0x00ce,
+	0x003e, 0x002e, 0x001e, 0x015e, 0x0005, 0x0156, 0x0016, 0x0026,
+	0x0036, 0x00c6, 0x00d6, 0x00e6, 0x2061, 0x0100, 0x2071, 0x1800,
+	0x7000, 0x9086, 0x0003, 0x1168, 0x2001, 0x020b, 0x2004, 0x9084,
+	0x5540, 0x9086, 0x5540, 0x1128, 0x2069, 0x1a46, 0x2d04, 0x8000,
+	0x206a, 0x2069, 0x0140, 0x6020, 0x9084, 0x00c0, 0x0120, 0x6884,
+	0x9005, 0x1904, 0x6eb2, 0x2001, 0x0088, 0x080c, 0x29bc, 0x9006,
+	0x60e2, 0x6886, 0x080c, 0x257f, 0x2069, 0x0200, 0x6804, 0x9005,
+	0x1118, 0x6808, 0x9005, 0x01c0, 0x6028, 0x9084, 0xfbff, 0x602a,
+	0x6027, 0x0400, 0x2069, 0x195e, 0x7000, 0x206a, 0x7097, 0x0026,
+	0x7003, 0x0001, 0x20a9, 0x0002, 0x1d04, 0x6e94, 0x2091, 0x6000,
+	0x1f04, 0x6e94, 0x0804, 0x6edf, 0x2069, 0x0140, 0x20a9, 0x0384,
+	0x6027, 0x1e00, 0x2009, 0x1e00, 0x080c, 0x2905, 0x6024, 0x910c,
+	0x0508, 0x9084, 0x1a00, 0x11f0, 0x1d04, 0x6ea0, 0x2091, 0x6000,
+	0x1f04, 0x6ea0, 0x2011, 0x0003, 0x080c, 0x93f3, 0x2011, 0x0002,
+	0x080c, 0x93fd, 0x080c, 0x92e4, 0x901e, 0x080c, 0x935a, 0x2001,
+	0x00a0, 0x080c, 0x29bc, 0x080c, 0x6ff8, 0x080c, 0x5a94, 0x9085,
+	0x0001, 0x00a8, 0x2001, 0x0080, 0x080c, 0x29bc, 0x2069, 0x0140,
+	0x60e3, 0x0000, 0x70b0, 0x9005, 0x1118, 0x6887, 0x0001, 0x0008,
+	0x6886, 0x2001, 0x0002, 0x080c, 0x257f, 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, 0x93f3, 0x2011, 0x0002, 0x080c, 0x93fd, 0x080c, 0x92e4,
+	0x901e, 0x080c, 0x935a, 0x2069, 0x0140, 0x2001, 0x00a0, 0x080c,
+	0x29bc, 0x080c, 0x6ff8, 0x080c, 0x5a94, 0x0804, 0x6f79, 0x2001,
+	0x180c, 0x200c, 0xd1b4, 0x1160, 0xc1b5, 0x2102, 0x080c, 0x6b7d,
+	0x2069, 0x0140, 0x2001, 0x0080, 0x080c, 0x29bc, 0x60e3, 0x0000,
+	0x2069, 0x0200, 0x6804, 0x9005, 0x1118, 0x6808, 0x9005, 0x0180,
+	0x6028, 0x9084, 0xfdff, 0x602a, 0x6027, 0x0200, 0x2069, 0x195e,
+	0x7000, 0x206a, 0x7097, 0x0027, 0x7003, 0x0001, 0x0804, 0x6f79,
+	0x6027, 0x1e00, 0x2009, 0x1e00, 0x080c, 0x2905, 0x6024, 0x910c,
+	0x01c8, 0x9084, 0x1c00, 0x11b0, 0x1d04, 0x6f38, 0x0006, 0x0016,
+	0x00c6, 0x00d6, 0x00e6, 0x080c, 0x7cba, 0x00ee, 0x00de, 0x00ce,
+	0x001e, 0x000e, 0x00e6, 0x2071, 0x19c9, 0x7018, 0x00ee, 0x9005,
+	0x19f8, 0x01f8, 0x0026, 0x2011, 0x6b95, 0x080c, 0x7d56, 0x2011,
+	0x6b88, 0x080c, 0x7e27, 0x002e, 0x2069, 0x0140, 0x60e3, 0x0000,
+	0x70b0, 0x9005, 0x1118, 0x6887, 0x0001, 0x0008, 0x6886, 0x2001,
+	0x0002, 0x080c, 0x257f, 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, 0xbe7f, 0x1904, 0x6fe6,
+	0x7130, 0xd184, 0x1170, 0x080c, 0x2fd4, 0x0138, 0xc18d, 0x7132,
+	0x2011, 0x1854, 0x2214, 0xd2ac, 0x1120, 0x7030, 0xd08c, 0x0904,
+	0x6fe6, 0x2011, 0x1854, 0x220c, 0x0438, 0x0016, 0x2019, 0x000e,
+	0x080c, 0xd104, 0x0156, 0x00b6, 0x20a9, 0x007f, 0x900e, 0x9186,
+	0x007e, 0x01a0, 0x9186, 0x0080, 0x0188, 0x080c, 0x5ff1, 0x1170,
+	0x2120, 0x9006, 0x0016, 0x2009, 0x000e, 0x080c, 0xd188, 0x2009,
+	0x0001, 0x2011, 0x0100, 0x080c, 0x7f4a, 0x001e, 0x8108, 0x1f04,
+	0x6faf, 0x00be, 0x015e, 0x001e, 0xd1ac, 0x1148, 0x0016, 0x2009,
+	0x0002, 0x2019, 0x0004, 0x080c, 0x2e4a, 0x001e, 0x0078, 0x0156,
+	0x00b6, 0x20a9, 0x007f, 0x900e, 0x080c, 0x5ff1, 0x1110, 0x080c,
+	0x5aae, 0x8108, 0x1f04, 0x6fdc, 0x00be, 0x015e, 0x080c, 0x18d0,
+	0x080c, 0x9a4e, 0x60e3, 0x0000, 0x080c, 0x5a94, 0x080c, 0x6c46,
+	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, 0x1005, 0x090c, 0x0db4, 0xa8ab, 0xdcb0,
+	0x2900, 0x704e, 0x080c, 0x1005, 0x090c, 0x0db4, 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, 0x75e4, 0x9006,
+	0x00ee, 0x0005, 0x900e, 0x0156, 0x20a9, 0x0006, 0x8003, 0x2011,
+	0x0100, 0x2214, 0x9296, 0x0008, 0x1110, 0x818d, 0x0010, 0x81f5,
+	0x3e08, 0x1f04, 0x706e, 0x015e, 0x0005, 0x2079, 0x0040, 0x2071,
+	0x18f0, 0x7004, 0x0002, 0x708d, 0x708e, 0x70c5, 0x7120, 0x724c,
+	0x708b, 0x708b, 0x7276, 0x080c, 0x0db4, 0x0005, 0x2079, 0x0040,
+	0x782c, 0x908c, 0x0780, 0x190c, 0x7670, 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, 0x7120, 0x782c, 0xd09c, 0x090c,
+	0x75e4, 0x0005, 0x9082, 0x005a, 0x1218, 0x2100, 0x003b, 0x0c18,
+	0x080c, 0x7156, 0x0c90, 0x00e3, 0x08f0, 0x0005, 0x7156, 0x7156,
+	0x7156, 0x7156, 0x7156, 0x7156, 0x7156, 0x7156, 0x7178, 0x7156,
+	0x7156, 0x7156, 0x7156, 0x7156, 0x7156, 0x7156, 0x7156, 0x7156,
+	0x7156, 0x7156, 0x7156, 0x7156, 0x7156, 0x7156, 0x7156, 0x7156,
+	0x7156, 0x7156, 0x7162, 0x7156, 0x734b, 0x7156, 0x7156, 0x7156,
+	0x7156, 0x7156, 0x7162, 0x738c, 0x73cd, 0x7414, 0x7428, 0x7156,
+	0x7156, 0x7178, 0x7162, 0x7156, 0x7156, 0x7220, 0x74d3, 0x74ee,
+	0x7156, 0x7178, 0x7156, 0x7156, 0x7156, 0x7156, 0x7216, 0x74ee,
+	0x7156, 0x7156, 0x7156, 0x7156, 0x7156, 0x7156, 0x7156, 0x7156,
+	0x7156, 0x718c, 0x7156, 0x7156, 0x7156, 0x7156, 0x7156, 0x7156,
+	0x7156, 0x7156, 0x7156, 0x7614, 0x7156, 0x7156, 0x7156, 0x7156,
+	0x7156, 0x71a0, 0x7156, 0x7156, 0x7156, 0x7156, 0x7156, 0x7156,
+	0x2079, 0x0040, 0x7004, 0x9086, 0x0003, 0x1198, 0x782c, 0x080c,
+	0x760d, 0xd0a4, 0x0170, 0x7824, 0x2048, 0x9006, 0xa802, 0xa806,
+	0xa864, 0x9084, 0x00ff, 0x908a, 0x001a, 0x1210, 0x002b, 0x0c50,
+	0x00e9, 0x080c, 0x75e4, 0x0005, 0x7156, 0x7162, 0x7337, 0x7156,
+	0x7162, 0x7156, 0x7162, 0x7162, 0x7156, 0x7162, 0x7337, 0x7162,
+	0x7162, 0x7162, 0x7162, 0x7162, 0x7156, 0x7162, 0x7337, 0x7156,
+	0x7156, 0x7162, 0x7156, 0x7156, 0x7156, 0x7162, 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, 0x65f2, 0x012e, 0x0005,
+	0xa864, 0x8007, 0x9084, 0x00ff, 0x0d08, 0x8001, 0x1120, 0x7007,
+	0x0001, 0x0804, 0x72f5, 0x7007, 0x0003, 0x7012, 0x2900, 0x7016,
+	0x701a, 0x704b, 0x72f5, 0x0005, 0xa864, 0x8007, 0x9084, 0x00ff,
+	0x0968, 0x8001, 0x1120, 0x7007, 0x0001, 0x0804, 0x7310, 0x7007,
+	0x0003, 0x7012, 0x2900, 0x7016, 0x701a, 0x704b, 0x7310, 0x0005,
+	0xa864, 0x8007, 0x9084, 0x00ff, 0x9086, 0x0001, 0x1904, 0x715e,
+	0x7007, 0x0001, 0x2009, 0x1833, 0x210c, 0x81ff, 0x15f0, 0xa994,
+	0x9186, 0x006f, 0x0158, 0x9186, 0x0074, 0x1510, 0x0026, 0x2011,
+	0x0010, 0x080c, 0x6339, 0x002e, 0x01d8, 0x0090, 0x080c, 0x6d14,
+	0x0140, 0xa897, 0x4005, 0xa89b, 0x0016, 0x2001, 0x0030, 0x900e,
+	0x00c8, 0x0026, 0x2011, 0x8008, 0x080c, 0x6339, 0x002e, 0x0140,
+	0xa897, 0x4005, 0xa89b, 0x4009, 0x2001, 0x0030, 0x900e, 0x0050,
+	0xa868, 0x9084, 0x00ff, 0xa86a, 0xa883, 0x0000, 0x080c, 0x5cc3,
+	0x1108, 0x0005, 0x0126, 0x2091, 0x8000, 0xa867, 0x0139, 0xa87a,
+	0xa982, 0x080c, 0x65f2, 0x012e, 0x0ca0, 0xa994, 0x9186, 0x0071,
+	0x0904, 0x71af, 0x9186, 0x0064, 0x0904, 0x71af, 0x9186, 0x007c,
+	0x0904, 0x71af, 0x9186, 0x0028, 0x0904, 0x71af, 0x9186, 0x0038,
+	0x0904, 0x71af, 0x9186, 0x0078, 0x0904, 0x71af, 0x9186, 0x005f,
+	0x0904, 0x71af, 0x9186, 0x0056, 0x0904, 0x71af, 0xa897, 0x4005,
+	0xa89b, 0x0001, 0x2001, 0x0030, 0x900e, 0x0860, 0xa87c, 0x9084,
+	0x00c0, 0x9086, 0x00c0, 0x1120, 0x7007, 0x0001, 0x0804, 0x7505,
+	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, 0x7166, 0xaab4, 0x928a, 0x0002, 0x1a04, 0x7166, 0x82ff,
+	0x1138, 0xa8b8, 0xa9bc, 0x9105, 0x0118, 0x2001, 0x72b3, 0x0018,
+	0x9280, 0x72a9, 0x2005, 0x7056, 0x7010, 0x9015, 0x0904, 0x7294,
+	0x080c, 0x1005, 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, 0x10cc, 0xa06c, 0x908e,
+	0x0100, 0x0170, 0x9086, 0x0200, 0x0118, 0x7007, 0x0007, 0x0005,
+	0x7020, 0x2048, 0x080c, 0x101e, 0x7014, 0x2048, 0x0804, 0x7166,
+	0x7020, 0x2048, 0x7018, 0xa802, 0xa807, 0x0000, 0x2908, 0x2048,
+	0xa906, 0x711a, 0x0804, 0x724c, 0x7014, 0x2048, 0x7007, 0x0001,
+	0xa8b4, 0x9005, 0x1128, 0xa8b8, 0xa9bc, 0x9105, 0x0108, 0x00b9,
+	0xa864, 0x9084, 0x00ff, 0x9086, 0x001e, 0x0904, 0x7505, 0x0804,
+	0x72f5, 0x72ab, 0x72af, 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, 0x1833, 0x210c,
+	0x81ff, 0x1178, 0x080c, 0x5b10, 0x1108, 0x0005, 0x080c, 0x682c,
+	0x0126, 0x2091, 0x8000, 0x080c, 0xba7b, 0x080c, 0x65f2, 0x012e,
+	0x0ca0, 0x080c, 0xbe7f, 0x1d70, 0x2001, 0x0028, 0x900e, 0x0c70,
+	0x2009, 0x1833, 0x210c, 0x81ff, 0x11d8, 0xa888, 0x9005, 0x01e0,
+	0xa883, 0x0000, 0xa87c, 0xd0f4, 0x0120, 0x080c, 0x5c25, 0x1138,
+	0x0005, 0x9006, 0xa87a, 0x080c, 0x5ba0, 0x1108, 0x0005, 0x0126,
+	0x2091, 0x8000, 0xa87a, 0xa982, 0x080c, 0x65f2, 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, 0x5ff1, 0x11b8, 0x0066, 0xae80,
+	0x080c, 0x6101, 0x006e, 0x0088, 0x0046, 0x2011, 0x180c, 0x2224,
+	0xc484, 0x2412, 0x004e, 0x00c6, 0x080c, 0x5ff1, 0x1110, 0x080c,
+	0x6201, 0x8108, 0x1f04, 0x7374, 0x00ce, 0xa87c, 0xd084, 0x1120,
+	0x080c, 0x101e, 0x00be, 0x0005, 0x0126, 0x2091, 0x8000, 0x080c,
+	0x65f2, 0x012e, 0x00be, 0x0005, 0x0126, 0x2091, 0x8000, 0x7007,
+	0x0001, 0x080c, 0x6311, 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, 0x75ce, 0x012e, 0x0804, 0x75c8, 0x012e,
+	0x0804, 0x75c2, 0x012e, 0x0804, 0x75c5, 0x0126, 0x2091, 0x8000,
+	0x7007, 0x0001, 0x080c, 0x6311, 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, 0x75ce, 0x012e, 0x0804,
+	0x75cb, 0x012e, 0x0804, 0x75c8, 0x0126, 0x2091, 0x8000, 0x7007,
+	0x0001, 0x2061, 0x1a3e, 0x6300, 0xd38c, 0x1120, 0x6308, 0x8318,
+	0x0220, 0x630a, 0x012e, 0x0804, 0x75dc, 0x012e, 0x0804, 0x75cb,
+	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, 0x1833, 0x2004, 0x9005, 0x0118, 0x080c, 0x9af8,
+	0x0068, 0x6017, 0xf400, 0x605b, 0x0000, 0xa97c, 0xd1a4, 0x0110,
+	0xa980, 0x615a, 0x2009, 0x0041, 0x080c, 0x9b42, 0xa988, 0x918c,
+	0xff00, 0x9186, 0x2000, 0x1138, 0x0026, 0x900e, 0x2011, 0xfdff,
+	0x080c, 0x7f4a, 0x002e, 0xa87c, 0xd0c4, 0x0148, 0x2061, 0x1a3e,
+	0x6000, 0xd08c, 0x1120, 0x6008, 0x8000, 0x0208, 0x600a, 0x00ce,
+	0x012e, 0x00be, 0x0804, 0x75ce, 0x00ce, 0x012e, 0x00be, 0x0804,
+	0x75c8, 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, 0x5ff1, 0x1968, 0xb800, 0xc0e4,
+	0xb802, 0x0848, 0xa88c, 0x9065, 0x09b8, 0x6007, 0x0024, 0x2001,
+	0x1955, 0x2004, 0x601a, 0x0804, 0x7463, 0xa88c, 0x9065, 0x0960,
+	0x00e6, 0xa890, 0x9075, 0x2001, 0x1833, 0x2004, 0x9005, 0x0150,
+	0x080c, 0x9af8, 0x8eff, 0x0118, 0x2e60, 0x080c, 0x9af8, 0x00ee,
+	0x0804, 0x7463, 0x6024, 0xc0dc, 0xc0d5, 0x6026, 0x2e60, 0x6007,
+	0x003a, 0xa8a0, 0x9005, 0x0130, 0x6007, 0x003b, 0xa8a4, 0x602e,
+	0xa8a8, 0x6016, 0x6003, 0x0001, 0x080c, 0x810c, 0x080c, 0x868e,
+	0x00ee, 0x0804, 0x7463, 0x2061, 0x1a3e, 0x6000, 0xd084, 0x0190,
+	0xd08c, 0x1904, 0x75dc, 0x0126, 0x2091, 0x8000, 0x6204, 0x8210,
+	0x0220, 0x6206, 0x012e, 0x0804, 0x75dc, 0x012e, 0xa883, 0x0016,
+	0x0804, 0x75d5, 0xa883, 0x0007, 0x0804, 0x75d5, 0xa864, 0x8007,
+	0x9084, 0x00ff, 0x0130, 0x8001, 0x1138, 0x7007, 0x0001, 0x0069,
+	0x0005, 0x080c, 0x715e, 0x0040, 0x7007, 0x0003, 0x7012, 0x2900,
+	0x7016, 0x701a, 0x704b, 0x7505, 0x0005, 0x00b6, 0x00e6, 0x0126,
+	0x2091, 0x8000, 0x903e, 0x2061, 0x1800, 0x61cc, 0x81ff, 0x1904,
+	0x7587, 0x6130, 0xd194, 0x1904, 0x75b1, 0xa878, 0x2070, 0x9e82,
+	0x1cd0, 0x0a04, 0x757b, 0x6064, 0x9e02, 0x1a04, 0x757b, 0x7120,
+	0x9186, 0x0006, 0x1904, 0x756d, 0x7010, 0x905d, 0x0904, 0x7587,
+	0xb800, 0xd0e4, 0x1904, 0x75ab, 0x2061, 0x1a3e, 0x6100, 0x9184,
+	0x0301, 0x9086, 0x0001, 0x15a0, 0x7024, 0xd0dc, 0x1904, 0x75b4,
+	0xa883, 0x0000, 0xa803, 0x0000, 0x2908, 0x7014, 0x9005, 0x1198,
+	0x7116, 0xa87c, 0xd0f4, 0x1904, 0x75b7, 0x080c, 0x5153, 0xd09c,
+	0x1118, 0xa87c, 0xc0cc, 0xa87e, 0x2e60, 0x080c, 0x7e6a, 0x012e,
+	0x00ee, 0x00be, 0x0005, 0x2048, 0xa800, 0x9005, 0x1de0, 0xa902,
+	0x2148, 0xa87c, 0xd0f4, 0x1904, 0x75b7, 0x012e, 0x00ee, 0x00be,
+	0x0005, 0x012e, 0x00ee, 0xa883, 0x0006, 0x00be, 0x0804, 0x75d5,
+	0xd184, 0x0db8, 0xd1c4, 0x1190, 0x00a0, 0xa974, 0x080c, 0x5ff1,
+	0x15d0, 0xb800, 0xd0e4, 0x15b8, 0x7120, 0x9186, 0x0007, 0x1118,
+	0xa883, 0x0002, 0x0490, 0xa883, 0x0008, 0x0478, 0xa883, 0x000e,
+	0x0460, 0xa883, 0x0017, 0x0448, 0xa883, 0x0035, 0x0430, 0x080c,
+	0x5157, 0xd0fc, 0x01e8, 0xa878, 0x2070, 0x9e82, 0x1cd0, 0x02c0,
+	0x6064, 0x9e02, 0x12a8, 0x7120, 0x9186, 0x0006, 0x1188, 0x7010,
+	0x905d, 0x0170, 0xb800, 0xd0bc, 0x0158, 0x2039, 0x0001, 0x7000,
+	0x9086, 0x0007, 0x1904, 0x7511, 0x7003, 0x0002, 0x0804, 0x7511,
+	0xa883, 0x0028, 0x0010, 0xa883, 0x0029, 0x012e, 0x00ee, 0x00be,
+	0x0420, 0xa883, 0x002a, 0x0cc8, 0xa883, 0x0045, 0x0cb0, 0x2e60,
+	0x2019, 0x0002, 0x601b, 0x0014, 0x080c, 0xcd45, 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, 0x65f2, 0x012e, 0x0005, 0x080c, 0x101e, 0x0005, 0x00d6,
+	0x080c, 0x7e61, 0x00de, 0x0005, 0x00d6, 0x00e6, 0x0126, 0x2091,
+	0x8000, 0x2071, 0x0040, 0x702c, 0xd084, 0x01d8, 0x908c, 0x0780,
+	0x190c, 0x7670, 0xd09c, 0x11a8, 0x2071, 0x1800, 0x70bc, 0x90ea,
+	0x0040, 0x0278, 0x8001, 0x70be, 0x702c, 0x2048, 0xa800, 0x702e,
+	0x9006, 0xa802, 0xa806, 0x2071, 0x0040, 0x2900, 0x7022, 0x702c,
+	0x0c28, 0x012e, 0x00ee, 0x00de, 0x0005, 0x0006, 0x9084, 0x0780,
+	0x190c, 0x7670, 0x000e, 0x0005, 0x00d6, 0x00c6, 0x0036, 0x0026,
+	0x0016, 0x00b6, 0x7007, 0x0001, 0xaa74, 0x9282, 0x0004, 0x1a04,
+	0x7661, 0xa97c, 0x9188, 0x1000, 0x2104, 0x905d, 0xb804, 0xd284,
+	0x0140, 0x05e8, 0x8007, 0x9084, 0x00ff, 0x9084, 0x0006, 0x1108,
+	0x04b0, 0x2b10, 0x080c, 0x9a72, 0x1118, 0x080c, 0x9b15, 0x05a8,
+	0x6212, 0xa874, 0x0002, 0x763f, 0x7644, 0x7647, 0x764d, 0x2019,
+	0x0002, 0x080c, 0xd104, 0x0060, 0x080c, 0xd0a0, 0x0048, 0x2019,
+	0x0002, 0xa980, 0x080c, 0xd0bb, 0x0018, 0xa980, 0x080c, 0xd0a0,
+	0x080c, 0x9ac8, 0xa887, 0x0000, 0x0126, 0x2091, 0x8000, 0x080c,
+	0x65f2, 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, 0x7672, 0x0006, 0x0016, 0x2001, 0x8003,
+	0x0006, 0x0804, 0x0dbd, 0x0005, 0x00f6, 0x2079, 0x0300, 0x2001,
+	0x0200, 0x200c, 0xc1e5, 0xc1dc, 0x2102, 0x2009, 0x0218, 0x210c,
+	0xd1ec, 0x1120, 0x080c, 0x148b, 0x00fe, 0x0005, 0x2001, 0x020d,
+	0x2003, 0x0020, 0x781f, 0x0300, 0x00fe, 0x0005, 0x781c, 0xd08c,
+	0x0904, 0x76dc, 0x68bc, 0x90aa, 0x0005, 0x0a04, 0x7c72, 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, 0xd4bb,
+	0x080c, 0x7bb7, 0x7817, 0x0140, 0x00a8, 0x9584, 0x0076, 0x1118,
+	0x080c, 0x7c15, 0x19c8, 0xd5a4, 0x0148, 0x0046, 0x0056, 0x080c,
+	0x773e, 0x080c, 0x2075, 0x005e, 0x004e, 0x0020, 0x080c, 0xd4bb,
+	0x7817, 0x0140, 0x080c, 0x771f, 0x2001, 0x19bf, 0x2004, 0x9005,
+	0x090c, 0x868e, 0x0005, 0x0002, 0x76f5, 0x79d9, 0x76ec, 0x76ec,
+	0x76ec, 0x76ec, 0x76ec, 0x76ec, 0x7817, 0x0140, 0x2001, 0x19bf,
+	0x2004, 0x9005, 0x090c, 0x868e, 0x0005, 0x7000, 0x908c, 0xff00,
+	0x9194, 0xf000, 0x810f, 0x9484, 0x0fff, 0x688e, 0x9286, 0x2000,
+	0x1150, 0x6800, 0x9086, 0x0001, 0x1118, 0x080c, 0x51aa, 0x0070,
+	0x080c, 0x775e, 0x0058, 0x9286, 0x3000, 0x1118, 0x080c, 0x7914,
+	0x0028, 0x9286, 0x8000, 0x1110, 0x080c, 0x7ae7, 0x7817, 0x0140,
+	0x2001, 0x19bf, 0x2004, 0x9005, 0x090c, 0x868e, 0x0005, 0x2001,
+	0x1810, 0x2004, 0xd08c, 0x0178, 0x2001, 0x1800, 0x2004, 0x9086,
+	0x0003, 0x1148, 0x0026, 0x0036, 0x2011, 0x8048, 0x2518, 0x080c,
+	0x46b9, 0x003e, 0x002e, 0x0005, 0x0036, 0x0046, 0x0056, 0x00f6,
+	0x2079, 0x0200, 0x2019, 0xfffe, 0x7c30, 0x0050, 0x0036, 0x0046,
+	0x0056, 0x00f6, 0x2079, 0x0200, 0x7d44, 0x7c40, 0x2019, 0xffff,
+	0x2001, 0x1810, 0x2004, 0xd08c, 0x0160, 0x2001, 0x1800, 0x2004,
+	0x9086, 0x0003, 0x1130, 0x0026, 0x2011, 0x8048, 0x080c, 0x46b9,
+	0x002e, 0x00fe, 0x005e, 0x004e, 0x003e, 0x0005, 0x00b6, 0x00c6,
+	0x7010, 0x9084, 0xff00, 0x8007, 0x9096, 0x0001, 0x0120, 0x9096,
+	0x0023, 0x1904, 0x78e5, 0x9186, 0x0023, 0x15c0, 0x080c, 0x7b7c,
+	0x0904, 0x78e5, 0x6120, 0x9186, 0x0001, 0x0150, 0x9186, 0x0004,
+	0x0138, 0x9186, 0x0008, 0x0120, 0x9186, 0x000a, 0x1904, 0x78e5,
+	0x7124, 0x610a, 0x7030, 0x908e, 0x0200, 0x1130, 0x2009, 0x0015,
+	0x080c, 0x9b42, 0x0804, 0x78e5, 0x908e, 0x0214, 0x0118, 0x908e,
+	0x0210, 0x1130, 0x2009, 0x0015, 0x080c, 0x9b42, 0x0804, 0x78e5,
+	0x908e, 0x0100, 0x1904, 0x78e5, 0x7034, 0x9005, 0x1904, 0x78e5,
+	0x2009, 0x0016, 0x080c, 0x9b42, 0x0804, 0x78e5, 0x9186, 0x0022,
+	0x1904, 0x78e5, 0x7030, 0x908e, 0x0300, 0x1580, 0x68d8, 0xd0a4,
+	0x0528, 0xc0b5, 0x68da, 0x7100, 0x918c, 0x00ff, 0x697a, 0x7004,
+	0x687e, 0x00f6, 0x2079, 0x0100, 0x79e6, 0x78ea, 0x0006, 0x9084,
+	0x00ff, 0x0016, 0x2008, 0x080c, 0x2554, 0x7932, 0x7936, 0x001e,
+	0x000e, 0x00fe, 0x080c, 0x250b, 0x695a, 0x703c, 0x00e6, 0x2071,
+	0x0140, 0x7086, 0x2071, 0x1800, 0x70b2, 0x00ee, 0x7034, 0x9005,
+	0x1904, 0x78e5, 0x2009, 0x0017, 0x0804, 0x78b2, 0x908e, 0x0400,
+	0x1190, 0x7034, 0x9005, 0x1904, 0x78e5, 0x080c, 0x6d14, 0x0120,
+	0x2009, 0x001d, 0x0804, 0x78b2, 0x68d8, 0xc0a5, 0x68da, 0x2009,
+	0x0030, 0x0804, 0x78b2, 0x908e, 0x0500, 0x1140, 0x7034, 0x9005,
+	0x1904, 0x78e5, 0x2009, 0x0018, 0x0804, 0x78b2, 0x908e, 0x2010,
+	0x1120, 0x2009, 0x0019, 0x0804, 0x78b2, 0x908e, 0x2110, 0x1120,
+	0x2009, 0x001a, 0x0804, 0x78b2, 0x908e, 0x5200, 0x1140, 0x7034,
+	0x9005, 0x1904, 0x78e5, 0x2009, 0x001b, 0x0804, 0x78b2, 0x908e,
+	0x5000, 0x1140, 0x7034, 0x9005, 0x1904, 0x78e5, 0x2009, 0x001c,
+	0x0804, 0x78b2, 0x908e, 0x1300, 0x1120, 0x2009, 0x0034, 0x0804,
+	0x78b2, 0x908e, 0x1200, 0x1140, 0x7034, 0x9005, 0x1904, 0x78e5,
+	0x2009, 0x0024, 0x0804, 0x78b2, 0x908c, 0xff00, 0x918e, 0x2400,
+	0x1170, 0x2009, 0x002d, 0x2001, 0x1810, 0x2004, 0xd09c, 0x0904,
+	0x78b2, 0x080c, 0xc51c, 0x1904, 0x78e5, 0x0804, 0x78b0, 0x908c,
+	0xff00, 0x918e, 0x5300, 0x1120, 0x2009, 0x002a, 0x0804, 0x78b2,
+	0x908e, 0x0f00, 0x1120, 0x2009, 0x0020, 0x0804, 0x78b2, 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,
+	0x46b9, 0x004e, 0x8108, 0x0f04, 0x787e, 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, 0x6838, 0xd0d4, 0x0110,
+	0x2009, 0x004c, 0x0016, 0x2011, 0x0263, 0x2204, 0x8211, 0x220c,
+	0x080c, 0x250b, 0x1568, 0x080c, 0x5f91, 0x1550, 0xbe12, 0xbd16,
+	0x001e, 0x0016, 0xb8b0, 0x9005, 0x1168, 0x9186, 0x0046, 0x1150,
+	0x6878, 0x9606, 0x1138, 0x687c, 0x9506, 0x9084, 0xff00, 0x1110,
+	0x001e, 0x0098, 0x080c, 0x9a72, 0x01a8, 0x2b08, 0x6112, 0x6023,
+	0x0004, 0x7120, 0x610a, 0x001e, 0x9186, 0x004c, 0x1110, 0x6023,
+	0x000a, 0x0016, 0x001e, 0x080c, 0x9b42, 0x00ce, 0x00be, 0x0005,
+	0x001e, 0x0cd8, 0x2001, 0x180e, 0x2004, 0xd0ec, 0x0120, 0x2011,
+	0x8049, 0x080c, 0x46b9, 0x080c, 0x9b15, 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, 0x8154, 0x08a0, 0x080c, 0x2f9e, 0x1140, 0x7010,
+	0x9084, 0xff00, 0x8007, 0x908e, 0x0008, 0x1108, 0x0009, 0x0005,
+	0x00b6, 0x00c6, 0x0046, 0x7000, 0x908c, 0xff00, 0x810f, 0x9186,
+	0x0033, 0x11e8, 0x080c, 0x7b7c, 0x0904, 0x7971, 0x7124, 0x610a,
+	0x7030, 0x908e, 0x0200, 0x1140, 0x7034, 0x9005, 0x15d0, 0x2009,
+	0x0015, 0x080c, 0x9b42, 0x04a8, 0x908e, 0x0100, 0x1590, 0x7034,
+	0x9005, 0x1578, 0x2009, 0x0016, 0x080c, 0x9b42, 0x0450, 0x9186,
+	0x0032, 0x1538, 0x7030, 0x908e, 0x1400, 0x1518, 0x2009, 0x0038,
+	0x0016, 0x2011, 0x0263, 0x2204, 0x8211, 0x220c, 0x080c, 0x250b,
+	0x11b8, 0x080c, 0x5f91, 0x11a0, 0xbe12, 0xbd16, 0x080c, 0x9a72,
+	0x0178, 0x2b08, 0x6112, 0x080c, 0xbc01, 0x6023, 0x0004, 0x7120,
+	0x610a, 0x001e, 0x080c, 0x9b42, 0x080c, 0x868e, 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, 0x79d3,
+	0x9596, 0xfffe, 0x1120, 0x2009, 0x007e, 0x0804, 0x79d3, 0x9596,
+	0xfffc, 0x1118, 0x2009, 0x0080, 0x04f0, 0x2011, 0x0000, 0x2019,
+	0x1836, 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, 0x79a8, 0x82ff, 0x1118, 0x9085, 0x0001,
+	0x0018, 0xc2fc, 0x2208, 0x9006, 0x00de, 0x00ee, 0x004e, 0x00be,
+	0x0005, 0x7000, 0x908c, 0xff00, 0x810f, 0x9184, 0x000f, 0x0002,
+	0x79f0, 0x79f0, 0x79f0, 0x7b8e, 0x79f0, 0x79f9, 0x7a24, 0x7ab2,
+	0x79f0, 0x79f0, 0x79f0, 0x79f0, 0x79f0, 0x79f0, 0x79f0, 0x79f0,
+	0x7817, 0x0140, 0x2001, 0x19bf, 0x2004, 0x9005, 0x090c, 0x868e,
+	0x0005, 0x00b6, 0x7110, 0xd1bc, 0x01e8, 0x7120, 0x2160, 0x9c8c,
+	0x0007, 0x11c0, 0x9c8a, 0x1cd0, 0x02a8, 0x6864, 0x9c02, 0x1290,
+	0x7008, 0x9084, 0x00ff, 0x6110, 0x2158, 0xb910, 0x9106, 0x1150,
+	0x700c, 0xb914, 0x9106, 0x1130, 0x7124, 0x610a, 0x2009, 0x0046,
+	0x080c, 0x9b42, 0x7817, 0x0140, 0x2001, 0x19bf, 0x2004, 0x9005,
+	0x090c, 0x868e, 0x00be, 0x0005, 0x00b6, 0x00c6, 0x9484, 0x0fff,
+	0x0904, 0x7a88, 0x7110, 0xd1bc, 0x1904, 0x7a88, 0x7108, 0x700c,
+	0x2028, 0x918c, 0x00ff, 0x2130, 0x9094, 0xff00, 0x15b0, 0x81ff,
+	0x15a0, 0x9080, 0x2fd9, 0x200d, 0x918c, 0xff00, 0x810f, 0x2001,
+	0x0080, 0x9106, 0x0904, 0x7a88, 0x080c, 0x5f91, 0x1904, 0x7a88,
+	0xbe12, 0xbd16, 0xb800, 0xd0ec, 0x15d8, 0xba04, 0x9294, 0xff00,
+	0x9286, 0x0600, 0x11a0, 0x080c, 0x9a72, 0x05e8, 0x2b08, 0x7028,
+	0x604a, 0x702c, 0x6046, 0x6112, 0x6023, 0x0006, 0x7120, 0x610a,
+	0x7130, 0x6156, 0x2009, 0x0044, 0x080c, 0xc774, 0x0408, 0x080c,
+	0x6315, 0x1138, 0xb807, 0x0606, 0x0c30, 0x190c, 0x7975, 0x11c0,
+	0x0898, 0x080c, 0x9a72, 0x2b08, 0x0198, 0x6112, 0x6023, 0x0004,
+	0x7120, 0x610a, 0x9286, 0x0400, 0x1118, 0x6007, 0x0005, 0x0010,
+	0x6007, 0x0001, 0x6003, 0x0001, 0x080c, 0x8154, 0x080c, 0x868e,
+	0x7817, 0x0140, 0x2001, 0x19bf, 0x2004, 0x9005, 0x090c, 0x868e,
+	0x00ce, 0x00be, 0x0005, 0x2001, 0x180e, 0x2004, 0xd0ec, 0x0120,
+	0x2011, 0x8049, 0x080c, 0x46b9, 0x080c, 0x9b15, 0x0d48, 0x2b08,
+	0x6112, 0x6023, 0x0006, 0x7120, 0x610a, 0x7130, 0x6156, 0x6017,
+	0xf300, 0x6003, 0x0001, 0x6007, 0x0041, 0x080c, 0x810c, 0x080c,
+	0x868e, 0x08b0, 0x00b6, 0x7110, 0xd1bc, 0x01e8, 0x7020, 0x2060,
+	0x9c84, 0x0007, 0x11c0, 0x9c82, 0x1cd0, 0x02a8, 0x6864, 0x9c02,
+	0x1290, 0x7008, 0x9084, 0x00ff, 0x6110, 0x2158, 0xb910, 0x9106,
+	0x1150, 0x700c, 0xb914, 0x9106, 0x1130, 0x7124, 0x610a, 0x2009,
+	0x0045, 0x080c, 0x9b42, 0x7817, 0x0140, 0x2001, 0x19bf, 0x2004,
+	0x9005, 0x090c, 0x868e, 0x00be, 0x0005, 0x6120, 0x9186, 0x0002,
+	0x0128, 0x9186, 0x0005, 0x0110, 0x9085, 0x0001, 0x0005, 0x080c,
+	0x2f9e, 0x1168, 0x7010, 0x9084, 0xff00, 0x8007, 0x9086, 0x0000,
+	0x1130, 0x9184, 0x000f, 0x908a, 0x0006, 0x1208, 0x000b, 0x0005,
+	0x7afe, 0x7aff, 0x7afe, 0x7afe, 0x7b5e, 0x7b6d, 0x0005, 0x00b6,
+	0x7110, 0xd1bc, 0x0120, 0x702c, 0xd084, 0x0904, 0x7b5c, 0x700c,
+	0x7108, 0x080c, 0x250b, 0x1904, 0x7b5c, 0x080c, 0x5f91, 0x1904,
+	0x7b5c, 0xbe12, 0xbd16, 0x7110, 0xd1bc, 0x01d8, 0x080c, 0x6315,
+	0x0118, 0x9086, 0x0004, 0x1588, 0x00c6, 0x080c, 0x7b7c, 0x00ce,
+	0x05d8, 0x080c, 0x9a72, 0x2b08, 0x05b8, 0x6112, 0x080c, 0xbc01,
+	0x6023, 0x0002, 0x7120, 0x610a, 0x2009, 0x0088, 0x080c, 0x9b42,
+	0x0458, 0x080c, 0x6315, 0x0148, 0x9086, 0x0004, 0x0130, 0x080c,
+	0x631d, 0x0118, 0x9086, 0x0004, 0x1180, 0x080c, 0x9a72, 0x2b08,
+	0x01d8, 0x6112, 0x080c, 0xbc01, 0x6023, 0x0005, 0x7120, 0x610a,
+	0x2009, 0x0088, 0x080c, 0x9b42, 0x0078, 0x080c, 0x9a72, 0x2b08,
+	0x0158, 0x6112, 0x080c, 0xbc01, 0x6023, 0x0004, 0x7120, 0x610a,
+	0x2009, 0x0001, 0x080c, 0x9b42, 0x00be, 0x0005, 0x7110, 0xd1bc,
+	0x0158, 0x00d1, 0x0148, 0x080c, 0x7add, 0x1130, 0x7124, 0x610a,
+	0x2009, 0x0089, 0x080c, 0x9b42, 0x0005, 0x7110, 0xd1bc, 0x0158,
+	0x0059, 0x0148, 0x080c, 0x7add, 0x1130, 0x7124, 0x610a, 0x2009,
+	0x008a, 0x080c, 0x9b42, 0x0005, 0x7020, 0x2060, 0x9c84, 0x0007,
+	0x1158, 0x9c82, 0x1cd0, 0x0240, 0x2001, 0x1819, 0x2004, 0x9c02,
+	0x1218, 0x9085, 0x0001, 0x0005, 0x9006, 0x0ce8, 0x00b6, 0x7110,
+	0xd1bc, 0x11d8, 0x7024, 0x2060, 0x9c84, 0x0007, 0x11b0, 0x9c82,
+	0x1cd0, 0x0298, 0x6864, 0x9c02, 0x1280, 0x7008, 0x9084, 0x00ff,
+	0x6110, 0x2158, 0xb910, 0x9106, 0x1140, 0x700c, 0xb914, 0x9106,
+	0x1120, 0x2009, 0x0051, 0x080c, 0x9b42, 0x7817, 0x0140, 0x2001,
+	0x19bf, 0x2004, 0x9005, 0x090c, 0x868e, 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, 0x9a72, 0x05b8, 0x0066, 0x00c6, 0x0046, 0x2011, 0x0263,
+	0x2204, 0x8211, 0x220c, 0x080c, 0x250b, 0x15a0, 0x080c, 0x5f91,
+	0x1588, 0xbe12, 0xbd16, 0x2b00, 0x004e, 0x00ce, 0x6012, 0x080c,
+	0xbc01, 0x080c, 0x0fec, 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, 0x8154,
+	0x080c, 0x868e, 0x00fe, 0x009e, 0x00ce, 0x0005, 0x080c, 0x9ac8,
+	0x006e, 0x0cc0, 0x004e, 0x00ce, 0x0cc8, 0x00c6, 0x7000, 0x908c,
+	0xff00, 0x9184, 0xf000, 0x810f, 0x9086, 0x2000, 0x1904, 0x7c6c,
+	0x9186, 0x0022, 0x15f0, 0x2001, 0x0111, 0x2004, 0x9005, 0x1904,
+	0x7c6e, 0x7030, 0x908e, 0x0400, 0x0904, 0x7c6e, 0x908e, 0x6000,
+	0x05e8, 0x908e, 0x5400, 0x05d0, 0x908e, 0x0300, 0x11d8, 0x2009,
+	0x1836, 0x210c, 0xd18c, 0x1590, 0xd1a4, 0x1580, 0x080c, 0x62d3,
+	0x0558, 0x68ac, 0x9084, 0x00ff, 0x7100, 0x918c, 0x00ff, 0x9106,
+	0x1518, 0x687c, 0x69ac, 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, 0x7b7c, 0x0128, 0x6004,
+	0x9086, 0x0002, 0x0118, 0x0000, 0x9006, 0x0010, 0x9085, 0x0001,
+	0x00ce, 0x0005, 0x00f6, 0x2079, 0x0200, 0x7800, 0xc0e5, 0xc0cc,
+	0x7802, 0x00fe, 0x0005, 0x00f6, 0x2079, 0x1800, 0x7834, 0xd084,
+	0x1130, 0x2079, 0x0200, 0x7800, 0x9085, 0x1200, 0x7802, 0x00fe,
+	0x0005, 0x00e6, 0x2071, 0x1800, 0x7034, 0xc084, 0x7036, 0x00ee,
+	0x0005, 0x2071, 0x19c9, 0x7003, 0x0003, 0x700f, 0x0361, 0x9006,
+	0x701a, 0x7072, 0x7012, 0x7017, 0x1cd0, 0x7007, 0x0000, 0x7026,
+	0x702b, 0x90d7, 0x7032, 0x7037, 0x9145, 0x703f, 0xffff, 0x7042,
+	0x7047, 0x4ff2, 0x704a, 0x705b, 0x7dee, 0x080c, 0x1005, 0x090c,
+	0x0db4, 0x2900, 0x703a, 0xa867, 0x0003, 0xa86f, 0x0100, 0xa8ab,
+	0xdcb0, 0x0005, 0x2071, 0x19c9, 0x1d04, 0x7d45, 0x2091, 0x6000,
+	0x700c, 0x8001, 0x700e, 0x1510, 0x2001, 0x1875, 0x2004, 0xd0c4,
+	0x0158, 0x3a00, 0xd08c, 0x1140, 0x20d1, 0x0000, 0x20d1, 0x0001,
+	0x20d1, 0x0000, 0x080c, 0x0db4, 0x700f, 0x0361, 0x7007, 0x0001,
+	0x0126, 0x2091, 0x8000, 0x080c, 0x7e33, 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, 0x91bf, 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, 0x7d6d,
+	0x7d6e, 0x7d8a, 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, 0x5ff1, 0x1168, 0xb888, 0x8001, 0x0250, 0xb88a, 0x1140,
+	0x0126, 0x2091, 0x8000, 0x0016, 0x080c, 0x868e, 0x001e, 0x012e,
+	0x8108, 0x9182, 0x0800, 0x0218, 0x900e, 0x7007, 0x0002, 0x7112,
+	0x00be, 0x0005, 0x7014, 0x2060, 0x0126, 0x2091, 0x8000, 0x6040,
+	0x9005, 0x0128, 0x8001, 0x6042, 0x1110, 0x080c, 0xba92, 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, 0xb4ab, 0x012e, 0x9c88, 0x0018, 0x7116,
+	0x2001, 0x1819, 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, 0x10cc, 0x002e, 0x008e, 0x0005, 0x0006,
+	0x0016, 0x0096, 0x00a6, 0x00b6, 0x00c6, 0x00d6, 0x00e6, 0x00f6,
+	0x0156, 0x080c, 0x7cba, 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, 0x69e4, 0xd1e4, 0x1518,
+	0x0026, 0xd1ec, 0x0140, 0x6a50, 0x6870, 0x9202, 0x0288, 0x8117,
+	0x9294, 0x00c0, 0x0088, 0x9184, 0x0007, 0x01a0, 0x8109, 0x9184,
+	0x0007, 0x0110, 0x69e6, 0x0070, 0x8107, 0x9084, 0x0007, 0x910d,
+	0x8107, 0x9106, 0x9094, 0x00c0, 0x9184, 0xff3f, 0x9205, 0x68e6,
+	0x080c, 0x0ecb, 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,
+	0x7ef4, 0xd0b4, 0x1168, 0xd0bc, 0x1904, 0x7ecd, 0x2009, 0x0006,
+	0x080c, 0x7f21, 0x0005, 0x900e, 0x0c60, 0x2001, 0x1999, 0x08b0,
+	0xd0fc, 0x0160, 0x908c, 0x0003, 0x0120, 0x918e, 0x0003, 0x1904,
+	0x7f1b, 0x908c, 0x2020, 0x918e, 0x2020, 0x01a8, 0x6024, 0xd0d4,
+	0x11e8, 0x2009, 0x1875, 0x2104, 0xd084, 0x1138, 0x87ff, 0x1120,
+	0x2009, 0x0043, 0x0804, 0x9b42, 0x0005, 0x87ff, 0x1de8, 0x2009,
+	0x0042, 0x0804, 0x9b42, 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, 0x7f1b, 0x908c, 0x2020,
+	0x918e, 0x2020, 0x0170, 0x0076, 0x00f6, 0x2c78, 0x080c, 0x15ad,
+	0x00fe, 0x007e, 0x87ff, 0x1120, 0x2009, 0x0042, 0x080c, 0x9b42,
+	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, 0x9b42, 0x0005, 0x00b9,
+	0x0ce8, 0x87ff, 0x1dd8, 0x2009, 0x0043, 0x080c, 0x9b42, 0x0cb0,
+	0x6110, 0x00b6, 0x2158, 0xb900, 0x00be, 0xd1ac, 0x0d20, 0x6124,
+	0xc1cd, 0x6126, 0x0c00, 0x2009, 0x0004, 0x0019, 0x0005, 0x2009,
+	0x0001, 0x0096, 0x080c, 0xb793, 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, 0x642c,
+	0x6014, 0x904d, 0x0076, 0x2039, 0x0000, 0x190c, 0x7e6a, 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, 0x7f6c, 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, 0x7f96, 0x0028, 0x911a,
+	0x2308, 0x8210, 0x1f04, 0x7f96, 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, 0x98d5, 0x0401,
+	0x080c, 0x98c0, 0x00e9, 0x080c, 0x98c3, 0x00d1, 0x080c, 0x98c6,
+	0x00b9, 0x080c, 0x98c9, 0x00a1, 0x080c, 0x98cc, 0x0089, 0x080c,
+	0x98cf, 0x0071, 0x080c, 0x98d2, 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, 0x8009,
+	0x802d, 0x806c, 0x800f, 0x802d, 0x8009, 0x8007, 0x8007, 0x080c,
+	0x0db4, 0x080c, 0x7dd3, 0x080c, 0x868e, 0x00ce, 0x0005, 0x62c0,
+	0x82ff, 0x1110, 0x00ce, 0x0005, 0x2011, 0x58fd, 0x080c, 0x7d56,
+	0x7828, 0x9092, 0x00c8, 0x1228, 0x8000, 0x782a, 0x080c, 0x593d,
+	0x0c88, 0x62c0, 0x080c, 0x98d9, 0x080c, 0x58fd, 0x7807, 0x0003,
+	0x7827, 0x0000, 0x782b, 0x0000, 0x0c28, 0x080c, 0x7dd3, 0x6220,
+	0xd2a4, 0x0160, 0x782b, 0x0000, 0x7824, 0x9065, 0x090c, 0x0db4,
+	0x2009, 0x0013, 0x080c, 0x9b42, 0x00ce, 0x0005, 0x00c6, 0x7824,
+	0x9065, 0x090c, 0x0db4, 0x7828, 0x9092, 0xc350, 0x12c0, 0x8000,
+	0x782a, 0x00ce, 0x080c, 0x2872, 0x0278, 0x00c6, 0x7924, 0x2160,
+	0x6010, 0x906d, 0x090c, 0x0db4, 0x7807, 0x0000, 0x7827, 0x0000,
+	0x00ce, 0x080c, 0x868e, 0x0c00, 0x080c, 0x909d, 0x08e8, 0x2011,
+	0x0130, 0x2214, 0x080c, 0x98d9, 0x080c, 0xd4f8, 0x2009, 0x0014,
+	0x080c, 0x9b42, 0x00ce, 0x0880, 0x2001, 0x19d2, 0x2003, 0x0000,
+	0x62c0, 0x82ff, 0x1160, 0x782b, 0x0000, 0x7824, 0x9065, 0x090c,
+	0x0db4, 0x2009, 0x0013, 0x080c, 0x9b94, 0x00ce, 0x0005, 0x00b6,
+	0x00c6, 0x00d6, 0x7824, 0x9005, 0x090c, 0x0db4, 0x7828, 0x9092,
+	0xc350, 0x1648, 0x8000, 0x782a, 0x00de, 0x00ce, 0x00be, 0x080c,
+	0x2872, 0x02f0, 0x00b6, 0x00c6, 0x00d6, 0x781c, 0x905d, 0x090c,
+	0x0db4, 0xb800, 0xc0dc, 0xb802, 0x7924, 0x2160, 0x080c, 0x9ac8,
+	0xb93c, 0x81ff, 0x090c, 0x0db4, 0x8109, 0xb93e, 0x7807, 0x0000,
+	0x7827, 0x0000, 0x00de, 0x00ce, 0x00be, 0x080c, 0x868e, 0x0868,
+	0x080c, 0x909d, 0x0850, 0x2011, 0x0130, 0x2214, 0x080c, 0x98d9,
+	0x080c, 0xd4f8, 0x7824, 0x9065, 0x2009, 0x0014, 0x080c, 0x9b42,
+	0x00de, 0x00ce, 0x00be, 0x0804, 0x807d, 0x00c6, 0x2001, 0x009b,
+	0x2004, 0xd0fc, 0x190c, 0x1c18, 0x6024, 0x6027, 0x0002, 0xd0f4,
+	0x1580, 0x62c8, 0x60c4, 0x9205, 0x1170, 0x783c, 0x9065, 0x0130,
+	0x2009, 0x0049, 0x080c, 0x9b42, 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, 0x9b42, 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, 0x868e, 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, 0x81fb, 0x6010, 0x2058, 0xb8a0,
+	0x9206, 0x1904, 0x81f6, 0x87ff, 0x0120, 0x6054, 0x9106, 0x1904,
+	0x81f6, 0x703c, 0x9c06, 0x1178, 0x0036, 0x2019, 0x0001, 0x080c,
+	0x935a, 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, 0xb793, 0x01c8,
+	0x6014, 0x2048, 0x6020, 0x9086, 0x0003, 0x1590, 0xa867, 0x0103,
+	0xab7a, 0xa877, 0x0000, 0x0016, 0x0036, 0x0076, 0x080c, 0xba7b,
+	0x080c, 0xd42c, 0x080c, 0x65f2, 0x007e, 0x003e, 0x001e, 0x080c,
+	0xb975, 0x080c, 0x9af8, 0x00ce, 0x0804, 0x819a, 0x2c78, 0x600c,
+	0x2060, 0x0804, 0x819a, 0x85ff, 0x0120, 0x0036, 0x080c, 0x8769,
+	0x003e, 0x012e, 0x000e, 0x001e, 0x002e, 0x003e, 0x005e, 0x006e,
+	0x007e, 0x009e, 0x00be, 0x00ce, 0x00de, 0x00ee, 0x00fe, 0x0005,
+	0x6020, 0x9086, 0x0006, 0x1158, 0x0016, 0x0036, 0x0076, 0x080c,
+	0xd42c, 0x080c, 0xd133, 0x007e, 0x003e, 0x001e, 0x0890, 0x6020,
+	0x9086, 0x000a, 0x0904, 0x81e0, 0x0804, 0x81de, 0x0006, 0x0066,
+	0x0096, 0x00c6, 0x00d6, 0x00f6, 0x9036, 0x0126, 0x2091, 0x8000,
+	0x2079, 0x19b6, 0x7838, 0x9065, 0x0904, 0x8276, 0x600c, 0x0006,
+	0x600f, 0x0000, 0x783c, 0x9c06, 0x1168, 0x0036, 0x2019, 0x0001,
+	0x080c, 0x935a, 0x7833, 0x0000, 0x901e, 0x7b3e, 0x7b42, 0x7b46,
+	0x7b4a, 0x003e, 0x080c, 0xb793, 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, 0x65e5, 0x080c,
+	0xb975, 0x080c, 0x9af8, 0x000e, 0x0804, 0x8233, 0x7e3a, 0x7e36,
+	0x012e, 0x00fe, 0x00de, 0x00ce, 0x009e, 0x006e, 0x000e, 0x0005,
+	0x6020, 0x9086, 0x0006, 0x1118, 0x080c, 0xd133, 0x0c50, 0x6020,
+	0x9086, 0x000a, 0x09f8, 0x08e0, 0x0016, 0x0026, 0x0086, 0x9046,
+	0x0099, 0x080c, 0x8375, 0x008e, 0x002e, 0x001e, 0x0005, 0x00f6,
+	0x0126, 0x2079, 0x19b6, 0x2091, 0x8000, 0x080c, 0x840c, 0x080c,
+	0x849a, 0x012e, 0x00fe, 0x0005, 0x00b6, 0x0096, 0x00f6, 0x00e6,
+	0x00d6, 0x00c6, 0x0066, 0x0016, 0x0006, 0x0126, 0x2091, 0x8000,
+	0x2071, 0x19b6, 0x7614, 0x2660, 0x2678, 0x8cff, 0x0904, 0x833a,
+	0x6010, 0x2058, 0xb8a0, 0x9206, 0x1904, 0x8335, 0x88ff, 0x0120,
+	0x6054, 0x9106, 0x1904, 0x8335, 0x7024, 0x9c06, 0x1558, 0x2069,
+	0x0100, 0x6820, 0xd0a4, 0x1508, 0x080c, 0x7dd3, 0x080c, 0x90c1,
+	0x68c3, 0x0000, 0x080c, 0x9570, 0x7027, 0x0000, 0x0036, 0x2069,
+	0x0140, 0x6b04, 0x9384, 0x1000, 0x0138, 0x2001, 0x0100, 0x080c,
+	0x29bc, 0x9006, 0x080c, 0x29bc, 0x2069, 0x0100, 0x6824, 0xd084,
+	0x0110, 0x6827, 0x0001, 0x003e, 0x0028, 0x6003, 0x0009, 0x630a,
+	0x0804, 0x8335, 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, 0xb793,
+	0x01e8, 0x6020, 0x9086, 0x0003, 0x1580, 0x080c, 0xb992, 0x1118,
+	0x080c, 0xa456, 0x0098, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000,
+	0x0016, 0x0036, 0x0086, 0x080c, 0xba7b, 0x080c, 0xd42c, 0x080c,
+	0x65f2, 0x008e, 0x003e, 0x001e, 0x080c, 0xb975, 0x080c, 0x9af8,
+	0x080c, 0x9446, 0x00ce, 0x0804, 0x82b5, 0x2c78, 0x600c, 0x2060,
+	0x0804, 0x82b5, 0x012e, 0x000e, 0x001e, 0x006e, 0x00ce, 0x00de,
+	0x00ee, 0x00fe, 0x009e, 0x00be, 0x0005, 0x6020, 0x9086, 0x0006,
+	0x1158, 0x0016, 0x0036, 0x0086, 0x080c, 0xd42c, 0x080c, 0xd133,
+	0x008e, 0x003e, 0x001e, 0x08d0, 0x080c, 0xa456, 0x6020, 0x9086,
+	0x0002, 0x1160, 0x6004, 0x0006, 0x9086, 0x0085, 0x000e, 0x0904,
+	0x831b, 0x9086, 0x008b, 0x0904, 0x831b, 0x0840, 0x6020, 0x9086,
+	0x0005, 0x1920, 0x6004, 0x0006, 0x9086, 0x0085, 0x000e, 0x09c8,
+	0x9086, 0x008b, 0x09b0, 0x0804, 0x832e, 0x00b6, 0x00a6, 0x0096,
+	0x00c6, 0x0006, 0x0126, 0x2091, 0x8000, 0x9280, 0x1000, 0x2004,
+	0x905d, 0x0904, 0x8405, 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, 0x5f24, 0x0904, 0x8401, 0x7624, 0x86ff, 0x0904, 0x83f0,
+	0x9680, 0x0005, 0x2004, 0x9906, 0x15d8, 0x00d6, 0x2069, 0x0100,
+	0x68c0, 0x9005, 0x0560, 0x080c, 0x7dd3, 0x080c, 0x90c1, 0x68c3,
+	0x0000, 0x080c, 0x9570, 0x7027, 0x0000, 0x0036, 0x2069, 0x0140,
+	0x6b04, 0x9384, 0x1000, 0x0138, 0x2001, 0x0100, 0x080c, 0x29bc,
+	0x9006, 0x080c, 0x29bc, 0x2069, 0x0100, 0x6824, 0xd084, 0x0110,
+	0x6827, 0x0001, 0x003e, 0x00de, 0x00c6, 0xb83c, 0x9005, 0x0110,
+	0x8001, 0xb83e, 0x2660, 0x080c, 0x9af8, 0x00ce, 0x0048, 0x00de,
+	0x00c6, 0x2660, 0x6003, 0x0009, 0x630a, 0x00ce, 0x0804, 0x83a8,
+	0x89ff, 0x0158, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x080c,
+	0xba7b, 0x080c, 0xd42c, 0x080c, 0x65f2, 0x080c, 0x9446, 0x0804,
+	0x83a8, 0x006e, 0x00de, 0x00ee, 0x00fe, 0x012e, 0x000e, 0x00ce,
+	0x009e, 0x00ae, 0x00be, 0x0005, 0x0096, 0x0006, 0x0066, 0x00c6,
+	0x00d6, 0x9036, 0x7814, 0x9065, 0x0904, 0x846d, 0x600c, 0x0006,
+	0x600f, 0x0000, 0x7824, 0x9c06, 0x1570, 0x2069, 0x0100, 0x6820,
+	0xd0a4, 0x1508, 0x080c, 0x7dd3, 0x080c, 0x90c1, 0x68c3, 0x0000,
+	0x080c, 0x9570, 0x7827, 0x0000, 0x0036, 0x2069, 0x0140, 0x6b04,
+	0x9384, 0x1000, 0x0138, 0x2001, 0x0100, 0x080c, 0x29bc, 0x9006,
+	0x080c, 0x29bc, 0x2069, 0x0100, 0x6824, 0xd084, 0x0110, 0x6827,
+	0x0001, 0x003e, 0x0040, 0x080c, 0x62cb, 0x1520, 0x6003, 0x0009,
+	0x630a, 0x2c30, 0x00f8, 0x6014, 0x2048, 0x080c, 0xb791, 0x01b0,
+	0x6020, 0x9086, 0x0003, 0x1508, 0x080c, 0xb992, 0x1118, 0x080c,
+	0xa456, 0x0060, 0x080c, 0x62cb, 0x1168, 0xa867, 0x0103, 0xab7a,
+	0xa877, 0x0000, 0x080c, 0x65f2, 0x080c, 0xb975, 0x080c, 0x9af8,
+	0x080c, 0x9446, 0x000e, 0x0804, 0x8413, 0x7e16, 0x7e12, 0x00de,
+	0x00ce, 0x006e, 0x000e, 0x009e, 0x0005, 0x6020, 0x9086, 0x0006,
+	0x1118, 0x080c, 0xd133, 0x0c50, 0x080c, 0xa456, 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, 0x851a, 0xb854, 0x0006, 0x9006, 0xb856,
+	0xb85a, 0xb800, 0xc0d4, 0xc0dc, 0xb802, 0x080c, 0x5f24, 0x0904,
+	0x8517, 0x7e24, 0x86ff, 0x0904, 0x850a, 0x9680, 0x0005, 0x2004,
+	0x9906, 0x1904, 0x850a, 0x00d6, 0x2069, 0x0100, 0x68c0, 0x9005,
+	0x0904, 0x8501, 0x080c, 0x7dd3, 0x080c, 0x90c1, 0x68c3, 0x0000,
+	0x080c, 0x9570, 0x7827, 0x0000, 0x0036, 0x2069, 0x0140, 0x6b04,
+	0x9384, 0x1000, 0x0138, 0x2001, 0x0100, 0x080c, 0x29bc, 0x9006,
+	0x080c, 0x29bc, 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, 0x9af8, 0x00ce,
+	0x0048, 0x00de, 0x00c6, 0x2660, 0x6003, 0x0009, 0x630a, 0x00ce,
+	0x0804, 0x84ad, 0x89ff, 0x0138, 0xa867, 0x0103, 0xab7a, 0xa877,
+	0x0000, 0x080c, 0x65f2, 0x080c, 0x9446, 0x0804, 0x84ad, 0x000e,
+	0x0804, 0x84a1, 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, 0x90c1, 0x78c3, 0x0000, 0x080c, 0x9570, 0x7027, 0x0000,
+	0x0036, 0x2079, 0x0140, 0x7b04, 0x9384, 0x1000, 0x0138, 0x2001,
+	0x0100, 0x080c, 0x29bc, 0x9006, 0x080c, 0x29bc, 0x2079, 0x0100,
+	0x7824, 0xd084, 0x0110, 0x7827, 0x0001, 0x080c, 0x9570, 0x003e,
+	0x080c, 0x5f24, 0x00c6, 0xb83c, 0x9005, 0x0110, 0x8001, 0xb83e,
+	0x2660, 0x080c, 0x9ac8, 0x00ce, 0xa867, 0x0103, 0xab7a, 0xa877,
+	0x0000, 0x080c, 0xba7b, 0x080c, 0x65f2, 0x080c, 0x9446, 0x00fe,
+	0x0005, 0x00b6, 0x00e6, 0x00c6, 0x2011, 0x0101, 0x2204, 0xc0c4,
+	0x2012, 0x2001, 0x180c, 0x2014, 0xc2e4, 0x2202, 0x2071, 0x19b6,
+	0x7004, 0x9084, 0x0007, 0x0002, 0x85a6, 0x85aa, 0x85c1, 0x85ea,
+	0x8628, 0x85a6, 0x85c1, 0x85a4, 0x080c, 0x0db4, 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, 0x5f24, 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, 0x868e, 0x0ca8,
+	0x7218, 0x721e, 0x080c, 0x868e, 0x0c80, 0xc2ec, 0x2202, 0x080c,
+	0x8769, 0x0c58, 0x7024, 0x9065, 0x05b8, 0x700c, 0x9c06, 0x1160,
+	0x080c, 0x9446, 0x600c, 0x9015, 0x0120, 0x720e, 0x600f, 0x0000,
+	0x0448, 0x720e, 0x720a, 0x0430, 0x7014, 0x9c06, 0x1160, 0x080c,
+	0x9446, 0x600c, 0x9015, 0x0120, 0x7216, 0x600f, 0x0000, 0x00d0,
+	0x7216, 0x7212, 0x00b8, 0x6020, 0x9086, 0x0003, 0x1198, 0x6010,
+	0x2058, 0x080c, 0x5f24, 0xb800, 0xc0dc, 0xb802, 0x080c, 0x9446,
+	0x701c, 0x9065, 0x0138, 0xb854, 0x9015, 0x0110, 0x721e, 0x0010,
+	0x7218, 0x721e, 0x7027, 0x0000, 0x00ce, 0x00ee, 0x00be, 0x0005,
+	0x7024, 0x9065, 0x0140, 0x080c, 0x9446, 0x600c, 0x9015, 0x0158,
+	0x720e, 0x600f, 0x0000, 0x080c, 0x9570, 0x7027, 0x0000, 0x00ce,
+	0x00ee, 0x00be, 0x0005, 0x720e, 0x720a, 0x0ca8, 0x00d6, 0x2069,
+	0x19b6, 0x6830, 0x9084, 0x0003, 0x0002, 0x864b, 0x864d, 0x8671,
+	0x8649, 0x080c, 0x0db4, 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, 0x8769, 0x2001,
+	0x19c2, 0x2004, 0x9086, 0x0001, 0x0d58, 0x00d6, 0x2069, 0x19b6,
+	0x6804, 0x9084, 0x0007, 0x0002, 0x86ae, 0x8751, 0x8751, 0x8751,
+	0x8751, 0x8753, 0x8751, 0x86ac, 0x080c, 0x0db4, 0x6820, 0x9005,
+	0x1110, 0x00de, 0x0005, 0x00c6, 0x680c, 0x9065, 0x0150, 0x6807,
+	0x0004, 0x6826, 0x682b, 0x0000, 0x080c, 0x87bf, 0x00ce, 0x00de,
+	0x0005, 0x6814, 0x9065, 0x0150, 0x6807, 0x0001, 0x6826, 0x682b,
+	0x0000, 0x080c, 0x87bf, 0x00ce, 0x00de, 0x0005, 0x00b6, 0x00e6,
+	0x6a1c, 0x92dd, 0x0000, 0x0904, 0x873d, 0xb84c, 0x900d, 0x0118,
+	0xb888, 0x9005, 0x01a0, 0xb854, 0x905d, 0x0120, 0x920e, 0x0904,
+	0x873d, 0x0028, 0x6818, 0x920e, 0x0904, 0x873d, 0x2058, 0xb84c,
+	0x900d, 0x0d88, 0xb888, 0x9005, 0x1d70, 0x2b00, 0x681e, 0xbb3c,
+	0xb838, 0x9302, 0x1e40, 0x080c, 0x9a9f, 0x0904, 0x873d, 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, 0x8cf7, 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, 0x98f9, 0x00ee, 0x00be, 0x00ce, 0x00de,
+	0x0005, 0x00de, 0x0005, 0x00c6, 0x680c, 0x9065, 0x0138, 0x6807,
+	0x0004, 0x6826, 0x682b, 0x0000, 0x080c, 0x87bf, 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, 0x869d, 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, 0x1a26, 0x1178, 0x012e,
+	0x080c, 0x8f0f, 0x00de, 0x00fe, 0x0005, 0xc1c4, 0x2102, 0x0066,
+	0x2031, 0x0001, 0x080c, 0x6dc4, 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, 0x8761, 0x6020,
+	0x9084, 0x000f, 0x000b, 0x0005, 0x87d3, 0x87d8, 0x8c31, 0x8cc0,
+	0x87d8, 0x8c31, 0x8cc0, 0x87d3, 0x87d8, 0x87d3, 0x87d3, 0x87d3,
+	0x87d3, 0x87d3, 0x87d3, 0x080c, 0x8589, 0x080c, 0x868e, 0x0005,
+	0x00b6, 0x0156, 0x0136, 0x0146, 0x01c6, 0x01d6, 0x00c6, 0x00d6,
+	0x00e6, 0x00f6, 0x2069, 0x0200, 0x2071, 0x0240, 0x6004, 0x908a,
+	0x0053, 0x1a0c, 0x0db4, 0x6110, 0x2158, 0xb9b0, 0x2c78, 0x2061,
+	0x0100, 0x619a, 0x908a, 0x0040, 0x1a04, 0x8844, 0x005b, 0x00fe,
+	0x00ee, 0x00de, 0x00ce, 0x01de, 0x01ce, 0x014e, 0x013e, 0x015e,
+	0x00be, 0x0005, 0x89bb, 0x89f6, 0x8a1f, 0x8ac2, 0x8ae3, 0x8ae9,
+	0x8af6, 0x8afe, 0x8b0a, 0x8b10, 0x8b21, 0x8b10, 0x8b78, 0x8afe,
+	0x8b84, 0x8b8a, 0x8b0a, 0x8b8a, 0x8b96, 0x8842, 0x8842, 0x8842,
+	0x8842, 0x8842, 0x8842, 0x8842, 0x8842, 0x8842, 0x8842, 0x8842,
+	0x9211, 0x9234, 0x9245, 0x9265, 0x9297, 0x8af6, 0x8842, 0x8af6,
+	0x8b10, 0x8842, 0x8a1f, 0x8ac2, 0x8842, 0x965d, 0x8b10, 0x8842,
+	0x9679, 0x8b10, 0x8842, 0x8b0a, 0x89b5, 0x8865, 0x8842, 0x9695,
+	0x9702, 0x97d9, 0x8842, 0x97e6, 0x8af3, 0x9811, 0x8842, 0x92a1,
+	0x983e, 0x8842, 0x080c, 0x0db4, 0x2100, 0x005b, 0x00fe, 0x00ee,
+	0x00de, 0x00ce, 0x01de, 0x01ce, 0x014e, 0x013e, 0x015e, 0x00be,
+	0x0005, 0x8863, 0x8863, 0x8863, 0x888c, 0x8938, 0x8943, 0x8863,
+	0x8863, 0x8863, 0x898a, 0x8996, 0x88a7, 0x8863, 0x88c2, 0x88f6,
+	0x99bb, 0x9a00, 0x8b10, 0x080c, 0x0db4, 0x00d6, 0x0096, 0x080c,
+	0x8ba9, 0x7003, 0x2414, 0x7007, 0x0018, 0x700b, 0x0800, 0x7814,
+	0x2048, 0xa83c, 0x700e, 0xa850, 0x7022, 0xa854, 0x7026, 0x60c3,
+	0x0018, 0x080c, 0x9095, 0x009e, 0x00de, 0x0005, 0x7810, 0x00b6,
+	0x2058, 0xb8a0, 0x00be, 0x080c, 0x9a47, 0x1118, 0x9084, 0xff80,
+	0x0110, 0x9085, 0x0001, 0x0005, 0x00d6, 0x0096, 0x080c, 0x8ba9,
+	0x7003, 0x0500, 0x7814, 0x2048, 0xa874, 0x700a, 0xa878, 0x700e,
+	0xa87c, 0x7012, 0xa880, 0x7016, 0xa884, 0x701a, 0xa888, 0x701e,
+	0x60c3, 0x0010, 0x080c, 0x9095, 0x009e, 0x00de, 0x0005, 0x00d6,
+	0x0096, 0x080c, 0x8ba9, 0x7003, 0x0500, 0x7814, 0x2048, 0xa8cc,
+	0x700a, 0xa8d0, 0x700e, 0xa8d4, 0x7012, 0xa8d8, 0x7016, 0xa8dc,
+	0x701a, 0xa8e0, 0x701e, 0x60c3, 0x0010, 0x080c, 0x9095, 0x009e,
+	0x00de, 0x0005, 0x00d6, 0x0096, 0x0126, 0x2091, 0x8000, 0x080c,
+	0x8ba9, 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, 0x20f5, 0x080c, 0xc47e, 0x9006, 0x080c,
+	0x20f5, 0x001e, 0xa804, 0x9005, 0x0110, 0x2048, 0x0c28, 0x04d9,
+	0x080c, 0x9095, 0x012e, 0x009e, 0x00de, 0x0005, 0x00d6, 0x0096,
+	0x0126, 0x2091, 0x8000, 0x080c, 0x8bf4, 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, 0xc47e, 0x001e, 0xa804, 0x9005, 0x0110, 0x2048, 0x0c60,
+	0x0051, 0x7814, 0x2048, 0x080c, 0x0f9e, 0x080c, 0x9095, 0x012e,
+	0x009e, 0x00de, 0x0005, 0x60c0, 0x8004, 0x9084, 0x0003, 0x9005,
+	0x0130, 0x9082, 0x0004, 0x20a3, 0x0000, 0x8000, 0x1de0, 0x0005,
+	0x080c, 0x8ba9, 0x7003, 0x7800, 0x7808, 0x8007, 0x700a, 0x60c3,
+	0x0008, 0x0804, 0x9095, 0x00d6, 0x00e6, 0x080c, 0x8bf4, 0x7814,
+	0x9084, 0xff00, 0x2073, 0x0200, 0x8e70, 0x8e70, 0x9095, 0x0010,
+	0x2272, 0x8e70, 0x2073, 0x0034, 0x8e70, 0x2069, 0x1805, 0x20a9,
+	0x0004, 0x2d76, 0x8d68, 0x8e70, 0x1f04, 0x8959, 0x2069, 0x1801,
+	0x20a9, 0x0004, 0x2d76, 0x8d68, 0x8e70, 0x1f04, 0x8962, 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, 0x8970, 0x60c3, 0x004c, 0x080c, 0x9095, 0x00ee,
+	0x00de, 0x0005, 0x080c, 0x8ba9, 0x7003, 0x6300, 0x7007, 0x0028,
+	0x7808, 0x700e, 0x60c3, 0x0008, 0x0804, 0x9095, 0x00d6, 0x0026,
+	0x0016, 0x080c, 0x8bf4, 0x7003, 0x0200, 0x7814, 0x700e, 0x00e6,
+	0x9ef0, 0x0004, 0x2009, 0x0001, 0x2011, 0x000c, 0x2073, 0x0800,
+	0x8e70, 0x2073, 0x0000, 0x00ee, 0x7206, 0x710a, 0x62c2, 0x080c,
+	0x9095, 0x001e, 0x002e, 0x00de, 0x0005, 0x2001, 0x1817, 0x2004,
+	0x609a, 0x0804, 0x9095, 0x080c, 0x8ba9, 0x7003, 0x5200, 0x2069,
+	0x1853, 0x6804, 0xd084, 0x0130, 0x6828, 0x0016, 0x080c, 0x253e,
+	0x710e, 0x001e, 0x20a9, 0x0004, 0x20e1, 0x0001, 0x2099, 0x1805,
+	0x20e9, 0x0000, 0x20a1, 0x0250, 0x4003, 0x20a9, 0x0004, 0x2099,
+	0x1801, 0x20a1, 0x0254, 0x4003, 0x080c, 0x9a47, 0x1120, 0xb8a0,
+	0x9082, 0x007f, 0x0248, 0x2001, 0x181e, 0x2004, 0x7032, 0x2001,
+	0x181f, 0x2004, 0x7036, 0x0030, 0x2001, 0x1817, 0x2004, 0x9084,
+	0x00ff, 0x7036, 0x60c3, 0x001c, 0x0804, 0x9095, 0x080c, 0x8ba9,
+	0x7003, 0x0500, 0x080c, 0x9a47, 0x1120, 0xb8a0, 0x9082, 0x007f,
+	0x0248, 0x2001, 0x181e, 0x2004, 0x700a, 0x2001, 0x181f, 0x2004,
+	0x700e, 0x0030, 0x2001, 0x1817, 0x2004, 0x9084, 0x00ff, 0x700e,
+	0x20a9, 0x0004, 0x20e1, 0x0001, 0x2099, 0x1805, 0x20e9, 0x0000,
+	0x20a1, 0x0250, 0x4003, 0x60c3, 0x0010, 0x0804, 0x9095, 0x080c,
+	0x8ba9, 0x9006, 0x080c, 0x62df, 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, 0x8a8a, 0x00d6, 0x2069,
+	0x193d, 0x2001, 0x1836, 0x2004, 0xd0a4, 0x0178, 0x6800, 0x700a,
+	0x6808, 0x9084, 0x2000, 0x7012, 0x680c, 0x7016, 0x701f, 0x2710,
+	0x6818, 0x7022, 0x681c, 0x7026, 0x0080, 0x6800, 0x700a, 0x6804,
+	0x700e, 0x6808, 0x080c, 0x6d14, 0x1118, 0x9084, 0x37ff, 0x0010,
+	0x9084, 0x3fff, 0x7012, 0x680c, 0x7016, 0x00de, 0x20a9, 0x0004,
+	0x20e1, 0x0001, 0x2099, 0x1805, 0x20e9, 0x0000, 0x20a1, 0x0256,
+	0x4003, 0x20a9, 0x0004, 0x2099, 0x1801, 0x20a1, 0x025a, 0x4003,
+	0x00d6, 0x080c, 0x98c0, 0x2069, 0x1945, 0x2071, 0x024e, 0x6800,
+	0xc0dd, 0x7002, 0x080c, 0x5157, 0xd0e4, 0x0110, 0x680c, 0x700e,
+	0x00de, 0x04a0, 0x2001, 0x1836, 0x2004, 0xd0a4, 0x0168, 0x0016,
+	0x2009, 0x0002, 0x60e0, 0x9106, 0x0130, 0x2100, 0x60e3, 0x0000,
+	0x080c, 0x257f, 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, 0x98c0, 0x20a1,
+	0x024e, 0x20a9, 0x0008, 0x2099, 0x1945, 0x4003, 0x60c3, 0x0074,
+	0x0804, 0x9095, 0x080c, 0x8ba9, 0x7003, 0x2010, 0x7007, 0x0014,
+	0x700b, 0x0800, 0x700f, 0x2000, 0x9006, 0x00f6, 0x2079, 0x1853,
+	0x7904, 0x00fe, 0xd1ac, 0x1110, 0x9085, 0x0020, 0x0010, 0x9085,
+	0x0010, 0x9085, 0x0002, 0x00d6, 0x0804, 0x8b59, 0x7026, 0x60c3,
+	0x0014, 0x0804, 0x9095, 0x080c, 0x8ba9, 0x7003, 0x5000, 0x0804,
+	0x8a39, 0x080c, 0x8ba9, 0x7003, 0x2110, 0x7007, 0x0014, 0x60c3,
+	0x0014, 0x0804, 0x9095, 0x080c, 0x8beb, 0x0010, 0x080c, 0x8bf4,
+	0x7003, 0x0200, 0x60c3, 0x0004, 0x0804, 0x9095, 0x080c, 0x8bf4,
+	0x7003, 0x0100, 0x700b, 0x0003, 0x700f, 0x2a00, 0x60c3, 0x0008,
+	0x0804, 0x9095, 0x080c, 0x8bf4, 0x7003, 0x0200, 0x0804, 0x8a39,
+	0x080c, 0x8bf4, 0x7003, 0x0100, 0x782c, 0x9005, 0x0110, 0x700a,
+	0x0010, 0x700b, 0x0003, 0x7814, 0x700e, 0x60c3, 0x0008, 0x0804,
+	0x9095, 0x00d6, 0x080c, 0x8bf4, 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, 0x0010,
+	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, 0x9095,
+	0x080c, 0x8bf4, 0x7003, 0x0210, 0x7007, 0x0014, 0x700f, 0x0100,
+	0x60c3, 0x0014, 0x0804, 0x9095, 0x080c, 0x8bf4, 0x7003, 0x0200,
+	0x0804, 0x89bf, 0x080c, 0x8bf4, 0x7003, 0x0100, 0x700b, 0x0003,
+	0x700f, 0x2a00, 0x60c3, 0x0008, 0x0804, 0x9095, 0x080c, 0x8bf4,
+	0x7003, 0x0100, 0x700b, 0x000b, 0x60c3, 0x0008, 0x0804, 0x9095,
+	0x0026, 0x00d6, 0x0036, 0x0046, 0x2019, 0x3200, 0x2021, 0x0800,
+	0x0040, 0x0026, 0x00d6, 0x0036, 0x0046, 0x2019, 0x2200, 0x2021,
+	0x0100, 0x080c, 0x98d5, 0xb810, 0x9305, 0x7002, 0xb814, 0x7006,
+	0x2069, 0x1800, 0x6878, 0x700a, 0x687c, 0x700e, 0x9485, 0x0029,
+	0x7012, 0x004e, 0x003e, 0x00de, 0x080c, 0x9083, 0x721a, 0x9f95,
+	0x0000, 0x7222, 0x7027, 0xffff, 0x2071, 0x024c, 0x002e, 0x0005,
+	0x0026, 0x080c, 0x98d5, 0x7003, 0x02ff, 0x7007, 0xfffc, 0x00d6,
+	0x2069, 0x1800, 0x6878, 0x700a, 0x687c, 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, 0x98d5, 0xb810, 0x9305,
+	0x7002, 0xb814, 0x7006, 0x2069, 0x1800, 0xb810, 0x9005, 0x1140,
+	0xb814, 0x9005, 0x1128, 0x700b, 0x00ff, 0x700f, 0xfffe, 0x0020,
+	0x6878, 0x700a, 0x687c, 0x700e, 0x0000, 0x9485, 0x0098, 0x7012,
+	0x004e, 0x003e, 0x00de, 0x080c, 0x9083, 0x721a, 0x7a08, 0x7222,
+	0x2f10, 0x7226, 0x2071, 0x024c, 0x002e, 0x0005, 0x080c, 0x9083,
+	0x721a, 0x7a08, 0x7222, 0x7814, 0x7026, 0x2071, 0x024c, 0x002e,
+	0x0005, 0x00b6, 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x2069, 0x0200,
+	0x2071, 0x0240, 0x6004, 0x908a, 0x0085, 0x0a0c, 0x0db4, 0x908a,
+	0x0092, 0x1a0c, 0x0db4, 0x6110, 0x2158, 0xb9b0, 0x2c78, 0x2061,
+	0x0100, 0x619a, 0x9082, 0x0085, 0x0033, 0x00fe, 0x00ee, 0x00de,
+	0x00ce, 0x00be, 0x0005, 0x8c62, 0x8c71, 0x8c7c, 0x8c60, 0x8c60,
+	0x8c60, 0x8c62, 0x8c60, 0x8c60, 0x8c60, 0x8c60, 0x8c60, 0x8c60,
+	0x080c, 0x0db4, 0x0411, 0x60c3, 0x0000, 0x0026, 0x080c, 0x2872,
+	0x0228, 0x2011, 0x0101, 0x2204, 0xc0c5, 0x2012, 0x002e, 0x0804,
+	0x9095, 0x0431, 0x7808, 0x700a, 0x7814, 0x700e, 0x7017, 0xffff,
+	0x60c3, 0x000c, 0x0804, 0x9095, 0x0479, 0x7003, 0x0003, 0x7007,
+	0x0300, 0x60c3, 0x0004, 0x0804, 0x9095, 0x0026, 0x080c, 0x98d5,
+	0xb810, 0x9085, 0x8100, 0x7002, 0xb814, 0x7006, 0x2069, 0x1800,
+	0x6878, 0x700a, 0x687c, 0x700e, 0x7013, 0x0009, 0x0804, 0x8bc4,
+	0x0026, 0x080c, 0x98d5, 0xb810, 0x9085, 0x8400, 0x7002, 0xb814,
+	0x7006, 0x2069, 0x1800, 0x6878, 0x700a, 0x687c, 0x700e, 0x2001,
+	0x0099, 0x7012, 0x0804, 0x8c26, 0x0026, 0x080c, 0x98d5, 0xb810,
+	0x9085, 0x8500, 0x7002, 0xb814, 0x7006, 0x2069, 0x1800, 0x6878,
+	0x700a, 0x687c, 0x700e, 0x2001, 0x0099, 0x7012, 0x0804, 0x8c26,
+	0x00b6, 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x2c78, 0x2069, 0x0200,
+	0x2071, 0x0240, 0x7804, 0x908a, 0x0040, 0x0a0c, 0x0db4, 0x908a,
+	0x0054, 0x1a0c, 0x0db4, 0x7910, 0x2158, 0xb9b0, 0x2061, 0x0100,
+	0x619a, 0x9082, 0x0040, 0x0033, 0x00fe, 0x00ee, 0x00de, 0x00ce,
+	0x00be, 0x0005, 0x8cf7, 0x8d9e, 0x8d71, 0x8ec0, 0x8cf5, 0x8cf5,
+	0x8cf5, 0x8cf5, 0x8cf5, 0x8cf5, 0x8cf5, 0x9413, 0x941f, 0x942b,
+	0x9437, 0x8cf5, 0x981d, 0x8cf5, 0x9407, 0x080c, 0x0db4, 0x0096,
+	0x780b, 0xffff, 0x080c, 0x8d4d, 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, 0x15ad, 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, 0x6a78, 0x720a,
+	0x6a7c, 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, 0x9095, 0x6813, 0x0008, 0xb810, 0x9085,
+	0x0500, 0x7002, 0xb814, 0x7006, 0x2069, 0x1800, 0x6878, 0x700a,
+	0x687c, 0x700e, 0x7013, 0x0889, 0x080c, 0x9083, 0x721a, 0x7a08,
+	0x7222, 0x2f10, 0x7226, 0x2071, 0x024c, 0x0005, 0x00d6, 0x0096,
+	0x080c, 0x8e9e, 0x7814, 0x2048, 0x080c, 0xb791, 0x1130, 0x7814,
+	0x9084, 0x0700, 0x8007, 0x0033, 0x0010, 0x9006, 0x001b, 0x009e,
+	0x00de, 0x0005, 0x8dbc, 0x8e25, 0x8e35, 0x8e5b, 0x8e67, 0x8e78,
+	0x8e80, 0x8dba, 0x080c, 0x0db4, 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, 0x9095, 0xc3e5, 0x0c88,
+	0x9186, 0x0001, 0x190c, 0x0db4, 0xaba8, 0x7824, 0xd0cc, 0x1904,
+	0x8e22, 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, 0x9095, 0xc3e5, 0x0804, 0x8de1, 0x2011, 0x0008, 0x2001,
+	0x180f, 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, 0x9095, 0x2011, 0x0028, 0x7824, 0xd0cc, 0x1128,
+	0x7216, 0x60c3, 0x0018, 0x0804, 0x9095, 0x0cd0, 0xc2e5, 0x2011,
+	0x0100, 0x7824, 0xd0cc, 0x0108, 0xc2e5, 0x7216, 0x702f, 0x0008,
+	0x7858, 0x9084, 0x00ff, 0x7036, 0x60c3, 0x0020, 0x0804, 0x9095,
+	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, 0x6878, 0x700a, 0x687c, 0x700e, 0x7824, 0xd0cc, 0x1168,
+	0x7013, 0x0898, 0x080c, 0x9083, 0x721a, 0x7a08, 0x7222, 0x2f10,
+	0x7226, 0x2071, 0x024c, 0x00de, 0x0005, 0x7013, 0x0889, 0x0c90,
+	0x0016, 0x7814, 0x9084, 0x0700, 0x8007, 0x0013, 0x001e, 0x0005,
+	0x8ed0, 0x8ed0, 0x8ed2, 0x8ed0, 0x8ed0, 0x8ed0, 0x8eec, 0x8ed0,
+	0x080c, 0x0db4, 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, 0x9095, 0x2009, 0x0003, 0x0019, 0x7033,
+	0x7f00, 0x0cb0, 0x0016, 0x080c, 0x98d5, 0x001e, 0xb810, 0x9085,
+	0x0100, 0x7002, 0xb814, 0x7006, 0x2069, 0x1800, 0x6a78, 0x720a,
+	0x6a7c, 0x720e, 0x7013, 0x0888, 0x918d, 0x0008, 0x7116, 0x080c,
+	0x9083, 0x721a, 0x7a08, 0x7222, 0x2f10, 0x7226, 0x0005, 0x00b6,
+	0x0096, 0x00e6, 0x00d6, 0x00c6, 0x0056, 0x0046, 0x0036, 0x2061,
+	0x0100, 0x2071, 0x1800, 0x7810, 0x2058, 0xb8a0, 0x2028, 0xb910,
+	0xba14, 0x7378, 0x747c, 0x7820, 0x90be, 0x0006, 0x0904, 0x8ff2,
+	0x90be, 0x000a, 0x1904, 0x8fae, 0x609f, 0x0000, 0x7814, 0x2048,
+	0xa87c, 0xd0fc, 0x05d0, 0xaf90, 0x9784, 0xff00, 0x9105, 0x6062,
+	0x873f, 0x9784, 0xff00, 0x0006, 0x7814, 0x2048, 0xa878, 0xc0fc,
+	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, 0x1836, 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, 0x98ba, 0x2009, 0x07d0, 0x60c4, 0x9084, 0xfff0, 0x9005,
+	0x0110, 0x2009, 0x1b58, 0x080c, 0x7dd8, 0x003e, 0x004e, 0x005e,
+	0x00ce, 0x00de, 0x00ee, 0x009e, 0x00be, 0x0005, 0x7804, 0x9086,
+	0x0040, 0x0904, 0x902e, 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, 0x98ba, 0x2009, 0x07d0,
+	0x60c4, 0x9084, 0xfff0, 0x9005, 0x0110, 0x2009, 0x1b58, 0x080c,
+	0x7dd8, 0x003e, 0x004e, 0x005e, 0x00ce, 0x00de, 0x00ee, 0x009e,
+	0x00be, 0x0005, 0x7814, 0x2048, 0xa87c, 0x9084, 0x0003, 0x9086,
+	0x0002, 0x0904, 0x904a, 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, 0x9897, 0x0804, 0x8fde, 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, 0x8fc1, 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, 0x98ba, 0x0804, 0x8fde, 0x080c,
+	0x9897, 0x0804, 0x8fde, 0x7a10, 0x00b6, 0x2258, 0xba8c, 0x8210,
+	0x9294, 0x00ff, 0xba8e, 0x00be, 0x8217, 0x0005, 0x00d6, 0x2069,
+	0x19b6, 0x6843, 0x0001, 0x00de, 0x0005, 0x60a3, 0x0056, 0x60a7,
+	0x9575, 0x00f1, 0x080c, 0x7dca, 0x0005, 0x0016, 0x2001, 0x180c,
+	0x200c, 0x9184, 0x0600, 0x9086, 0x0600, 0x0128, 0x0089, 0x080c,
+	0x7dca, 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,
+	0x6d14, 0x11e8, 0x2001, 0x19d2, 0x2004, 0x9005, 0x1904, 0x9127,
+	0x0066, 0x2031, 0x0001, 0x080c, 0x6dc4, 0x006e, 0x1160, 0x2061,
+	0x0100, 0x6020, 0xd0b4, 0x1120, 0x6024, 0xd084, 0x090c, 0x0db4,
+	0x080c, 0x7dca, 0x0460, 0x00c6, 0x2061, 0x19b6, 0x00d0, 0x6904,
+	0x9194, 0x4000, 0x0548, 0x080c, 0x90c1, 0x080c, 0x29cc, 0x00c6,
+	0x2061, 0x19b6, 0x6128, 0x9192, 0x0008, 0x1258, 0x8108, 0x612a,
+	0x6124, 0x00ce, 0x81ff, 0x0198, 0x080c, 0x7dca, 0x080c, 0x90b8,
+	0x0070, 0x6124, 0x91e5, 0x0000, 0x0140, 0x080c, 0xd4f8, 0x080c,
+	0x7dd3, 0x2009, 0x0014, 0x080c, 0x9b42, 0x00ce, 0x0000, 0x002e,
+	0x001e, 0x00de, 0x00ce, 0x0005, 0x2001, 0x19d2, 0x2004, 0x9005,
+	0x1db0, 0x00c6, 0x2061, 0x19b6, 0x6128, 0x9192, 0x0003, 0x1e08,
+	0x8108, 0x612a, 0x00ce, 0x080c, 0x7dca, 0x080c, 0x5953, 0x2009,
+	0x1852, 0x2114, 0x8210, 0x220a, 0x0c10, 0x0096, 0x00c6, 0x00d6,
+	0x00e6, 0x0016, 0x0026, 0x080c, 0x7de0, 0x2071, 0x19b6, 0x713c,
+	0x81ff, 0x0904, 0x91b3, 0x2061, 0x0100, 0x2069, 0x0140, 0x080c,
+	0x6d14, 0x11b0, 0x0036, 0x2019, 0x0002, 0x080c, 0x935a, 0x003e,
+	0x713c, 0x2160, 0x080c, 0xd4f8, 0x2009, 0x004a, 0x080c, 0x9b42,
+	0x0066, 0x2031, 0x0001, 0x080c, 0x6dc4, 0x006e, 0x0804, 0x91b3,
+	0x6904, 0xd1f4, 0x0904, 0x91ba, 0x080c, 0x29cc, 0x00c6, 0x703c,
+	0x9065, 0x090c, 0x0db4, 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, 0x291f,
+	0x6014, 0x9084, 0xe7fd, 0x9085, 0x0010, 0x6016, 0x703c, 0x2060,
+	0x2009, 0x0049, 0x080c, 0x9b42, 0x0070, 0x0036, 0x2019, 0x0001,
+	0x080c, 0x935a, 0x003e, 0x713c, 0x2160, 0x080c, 0xd4f8, 0x2009,
+	0x004a, 0x080c, 0x9b42, 0x002e, 0x001e, 0x00ee, 0x00de, 0x00ce,
+	0x009e, 0x0005, 0xd1ec, 0x1904, 0x9174, 0x0804, 0x9176, 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, 0x6123, 0x0110, 0x9085, 0x0001, 0x012e,
+	0x000e, 0x004e, 0x005e, 0x006e, 0x00ce, 0x00de, 0x00ee, 0x00be,
+	0x0005, 0x080c, 0x8ba9, 0x7003, 0x1200, 0x7838, 0x7012, 0x783c,
+	0x7016, 0x00c6, 0x7820, 0x9086, 0x0004, 0x1148, 0x7810, 0x9005,
+	0x0130, 0x00b6, 0x2058, 0xb810, 0xb914, 0x00be, 0x0020, 0x2061,
+	0x1800, 0x6078, 0x617c, 0x9084, 0x00ff, 0x700a, 0x710e, 0x00ce,
+	0x60c3, 0x002c, 0x0804, 0x9095, 0x080c, 0x8ba9, 0x7003, 0x0f00,
+	0x7808, 0xd09c, 0x0128, 0xb810, 0x9084, 0x00ff, 0x700a, 0xb814,
+	0x700e, 0x60c3, 0x0008, 0x0804, 0x9095, 0x0156, 0x080c, 0x8bf4,
+	0x7003, 0x0200, 0x2011, 0x1848, 0x63f0, 0x2312, 0x20a9, 0x0006,
+	0x2011, 0x1840, 0x2019, 0x1841, 0x9ef0, 0x0002, 0x2376, 0x8e70,
+	0x2276, 0x8e70, 0x9398, 0x0002, 0x9290, 0x0002, 0x1f04, 0x9256,
+	0x60c3, 0x001c, 0x015e, 0x0804, 0x9095, 0x0016, 0x0026, 0x080c,
+	0x8bd0, 0x080c, 0x8be2, 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, 0x9095, 0x002e, 0x001e, 0x0005, 0x20a9, 0x0010, 0x4003,
+	0x080c, 0x98c0, 0x20a1, 0x0240, 0x22a8, 0x4003, 0x0c68, 0x080c,
+	0x8ba9, 0x7003, 0x6200, 0x7808, 0x700e, 0x60c3, 0x0008, 0x0804,
+	0x9095, 0x0016, 0x0026, 0x080c, 0x8ba9, 0x20e9, 0x0000, 0x20a1,
+	0x024c, 0x7814, 0x0096, 0x2048, 0xa800, 0x2048, 0xa860, 0x20e0,
+	0xa85c, 0x9080, 0x0023, 0x2098, 0x009e, 0x7808, 0x9088, 0x0002,
+	0x21a8, 0x4003, 0x8003, 0x60c2, 0x080c, 0x9095, 0x002e, 0x001e,
+	0x0005, 0x00e6, 0x00c6, 0x0006, 0x0126, 0x2091, 0x8000, 0x2071,
+	0x19b6, 0x700c, 0x2060, 0x8cff, 0x0178, 0x080c, 0xb992, 0x1110,
+	0x080c, 0xa456, 0x600c, 0x0006, 0x080c, 0xbbf9, 0x080c, 0x9ac8,
+	0x080c, 0x9446, 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, 0x90c1, 0x6ac0, 0x68c3, 0x0000, 0x080c, 0x7dd3, 0x00c6,
+	0x2061, 0x0100, 0x080c, 0x98d9, 0x00ce, 0x20a9, 0x01f4, 0x0461,
+	0x2009, 0x0013, 0x080c, 0x9b42, 0x000e, 0x001e, 0x002e, 0x006e,
+	0x00ce, 0x00de, 0x00ee, 0x00fe, 0x015e, 0x012e, 0x0005, 0x2001,
+	0x1800, 0x2004, 0x9096, 0x0001, 0x0d78, 0x9096, 0x0004, 0x0d60,
+	0x080c, 0x7dd3, 0x6814, 0x9084, 0x0001, 0x0110, 0x68a7, 0x95f5,
+	0x6817, 0x0008, 0x68c3, 0x0000, 0x2011, 0x58fd, 0x080c, 0x7d56,
+	0x20a9, 0x01f4, 0x0009, 0x08c0, 0x6824, 0xd094, 0x0140, 0x6827,
+	0x0004, 0x7804, 0x9084, 0x4000, 0x190c, 0x29cc, 0x0090, 0xd084,
+	0x0118, 0x6827, 0x0001, 0x0010, 0x1f04, 0x933c, 0x7804, 0x9084,
+	0x1000, 0x0138, 0x2001, 0x0100, 0x080c, 0x29bc, 0x9006, 0x080c,
+	0x29bc, 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, 0x93e8, 0x9386,
+	0x0002, 0x1128, 0x6814, 0x9084, 0x0002, 0x0904, 0x93e8, 0x68af,
+	0x95f5, 0x6817, 0x0010, 0x2009, 0x00fa, 0x8109, 0x1df0, 0x69c6,
+	0x68cb, 0x0008, 0x080c, 0x7de0, 0x080c, 0x1d48, 0x0046, 0x2009,
+	0x00a5, 0x080c, 0x0e2f, 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, 0x200c, 0x080c, 0x0e2f, 0x004e,
+	0x20a9, 0x03e8, 0x6824, 0xd094, 0x0140, 0x6827, 0x0004, 0x7804,
+	0x9084, 0x4000, 0x190c, 0x29cc, 0x0090, 0xd08c, 0x0118, 0x6827,
+	0x0002, 0x0010, 0x1f04, 0x93c2, 0x7804, 0x9084, 0x1000, 0x0138,
+	0x2001, 0x0100, 0x080c, 0x29bc, 0x9006, 0x080c, 0x29bc, 0x6827,
+	0x4000, 0x6824, 0x83ff, 0x1120, 0x2009, 0x0049, 0x080c, 0x9b42,
+	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,
+	0x8d4d, 0x7814, 0x080c, 0x515b, 0x0108, 0x782c, 0x7032, 0x7042,
+	0x7047, 0x1000, 0x0478, 0x080c, 0x8d4d, 0x7814, 0x080c, 0x515b,
+	0x0108, 0x782c, 0x7032, 0x7042, 0x7047, 0x4000, 0x0418, 0x080c,
+	0x8d4d, 0x7814, 0x080c, 0x515b, 0x0108, 0x782c, 0x7032, 0x7042,
+	0x7047, 0x2000, 0x00b8, 0x080c, 0x8d4d, 0x7814, 0x080c, 0x515b,
+	0x0108, 0x782c, 0x7032, 0x7042, 0x7047, 0x0400, 0x0058, 0x080c,
+	0x8d4d, 0x7814, 0x080c, 0x515b, 0x0108, 0x782c, 0x7032, 0x7042,
+	0x7047, 0x0200, 0x60c3, 0x0020, 0x0804, 0x9095, 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, 0x94eb, 0x8cff, 0x0904, 0x94eb, 0x6020,
+	0x9086, 0x0006, 0x1904, 0x94e6, 0x88ff, 0x0138, 0x2800, 0x9c06,
+	0x1904, 0x94e6, 0x2039, 0x0000, 0x0050, 0x6010, 0x9b06, 0x1904,
+	0x94e6, 0x85ff, 0x0120, 0x6054, 0x9106, 0x1904, 0x94e6, 0x7024,
+	0x9c06, 0x15b0, 0x2069, 0x0100, 0x68c0, 0x9005, 0x1160, 0x6824,
+	0xd084, 0x0148, 0x6827, 0x0001, 0x080c, 0x7dd3, 0x080c, 0x9570,
+	0x7027, 0x0000, 0x0428, 0x080c, 0x7dd3, 0x6820, 0xd0b4, 0x0110,
+	0x68a7, 0x95f5, 0x6817, 0x0008, 0x68c3, 0x0000, 0x080c, 0x9570,
+	0x7027, 0x0000, 0x0036, 0x2069, 0x0140, 0x6b04, 0x9384, 0x1000,
+	0x0138, 0x2001, 0x0100, 0x080c, 0x29bc, 0x9006, 0x080c, 0x29bc,
+	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,
+	0xb791, 0x0110, 0x080c, 0xd133, 0x009e, 0x080c, 0x9af8, 0x080c,
+	0x9446, 0x88ff, 0x1190, 0x00ce, 0x0804, 0x9461, 0x2c78, 0x600c,
+	0x2060, 0x0804, 0x9461, 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, 0x955f, 0x6020, 0x9086,
+	0x0006, 0x1904, 0x955a, 0x87ff, 0x0128, 0x2700, 0x9c06, 0x1904,
+	0x955a, 0x0040, 0x6010, 0x9b06, 0x15e8, 0x85ff, 0x0118, 0x6054,
+	0x9106, 0x15c0, 0x703c, 0x9c06, 0x1168, 0x0036, 0x2019, 0x0001,
+	0x080c, 0x935a, 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, 0xb791,
+	0x0110, 0x080c, 0xd133, 0x080c, 0x9af8, 0x87ff, 0x1198, 0x00ce,
+	0x0804, 0x950b, 0x2c78, 0x600c, 0x2060, 0x0804, 0x950b, 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, 0x964c, 0x6010,
+	0x00b6, 0x2058, 0xb8a0, 0x00be, 0x9206, 0x1904, 0x9647, 0x7024,
+	0x9c06, 0x1520, 0x2069, 0x0100, 0x68c0, 0x9005, 0x0904, 0x9623,
+	0x080c, 0x90c1, 0x68c3, 0x0000, 0x080c, 0x9570, 0x7027, 0x0000,
+	0x0036, 0x2069, 0x0140, 0x6b04, 0x9384, 0x1000, 0x0138, 0x2001,
+	0x0100, 0x080c, 0x29bc, 0x9006, 0x080c, 0x29bc, 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, 0xb981, 0x1158, 0x080c, 0x2ea4, 0x080c, 0xb992, 0x11f0,
+	0x080c, 0xa456, 0x00d8, 0x080c, 0x9570, 0x08c0, 0x080c, 0xb992,
+	0x1118, 0x080c, 0xa456, 0x0090, 0x6014, 0x2048, 0x080c, 0xb791,
+	0x0168, 0x6020, 0x9086, 0x0003, 0x1508, 0xa867, 0x0103, 0xab7a,
+	0xa877, 0x0000, 0x080c, 0x65e5, 0x080c, 0xb975, 0x080c, 0xbbf9,
+	0x080c, 0x9af8, 0x080c, 0x9446, 0x00ce, 0x0804, 0x95cc, 0x2c78,
+	0x600c, 0x2060, 0x0804, 0x95cc, 0x012e, 0x000e, 0x002e, 0x006e,
+	0x00ce, 0x00de, 0x00ee, 0x00fe, 0x009e, 0x0005, 0x6020, 0x9086,
+	0x0006, 0x1d20, 0x080c, 0xd133, 0x0c08, 0x00d6, 0x080c, 0x8bf4,
+	0x7003, 0x0200, 0x7007, 0x0014, 0x60c3, 0x0014, 0x20e1, 0x0001,
+	0x2099, 0x1958, 0x20e9, 0x0000, 0x20a1, 0x0250, 0x20a9, 0x0004,
+	0x4003, 0x7023, 0x0004, 0x7027, 0x7878, 0x080c, 0x9095, 0x00de,
+	0x0005, 0x080c, 0x8bf4, 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, 0x9095, 0x00b6, 0x00d6, 0x0016,
+	0x00d6, 0x2f68, 0x2009, 0x0035, 0x080c, 0xbdfe, 0x00de, 0x1904,
+	0x96fa, 0x080c, 0x8ba9, 0x7003, 0x1300, 0x782c, 0x080c, 0x97fc,
+	0x2068, 0x6820, 0x9086, 0x0003, 0x0560, 0x7810, 0x2058, 0xbaa0,
+	0x080c, 0x9a47, 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, 0x9a47, 0x1130, 0x7810, 0x2058, 0xb8a0, 0x9082,
+	0x007e, 0x0250, 0x00d6, 0x2069, 0x181e, 0x2d04, 0x700a, 0x8d68,
+	0x2d04, 0x700e, 0x00de, 0x0010, 0x6034, 0x700e, 0x7838, 0x7012,
+	0x783c, 0x7016, 0x60c3, 0x000c, 0x001e, 0x00de, 0x080c, 0x9095,
+	0x00be, 0x0005, 0x781b, 0x0001, 0x7803, 0x0006, 0x001e, 0x00de,
+	0x00be, 0x0005, 0x792c, 0x9180, 0x0008, 0x200c, 0x9186, 0x0006,
+	0x01c0, 0x9186, 0x0003, 0x0904, 0x9774, 0x9186, 0x0005, 0x0904,
+	0x975d, 0x9186, 0x0004, 0x05d8, 0x9186, 0x0008, 0x0904, 0x9765,
+	0x7807, 0x0037, 0x782f, 0x0003, 0x7817, 0x1700, 0x080c, 0x97d9,
+	0x0005, 0x080c, 0x979a, 0x00d6, 0x0026, 0x792c, 0x2168, 0x2009,
+	0x4000, 0x6800, 0x0002, 0x973e, 0x9749, 0x9740, 0x9749, 0x9745,
+	0x973e, 0x973e, 0x9749, 0x9749, 0x9749, 0x9749, 0x973e, 0x973e,
+	0x973e, 0x973e, 0x973e, 0x9749, 0x973e, 0x9749, 0x080c, 0x0db4,
+	0x6824, 0xd0e4, 0x0110, 0xd0cc, 0x0110, 0x900e, 0x0010, 0x2009,
+	0x2000, 0x682c, 0x7022, 0x6830, 0x7026, 0x0804, 0x9793, 0x080c,
+	0x979a, 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, 0x9095, 0x00b6, 0x0036, 0x0046, 0x0056, 0x0066, 0x080c,
+	0x8bf4, 0x9006, 0x7003, 0x0200, 0x7938, 0x710a, 0x793c, 0x710e,
+	0x7810, 0x2058, 0xb8a0, 0x080c, 0x9a47, 0x1118, 0x9092, 0x007e,
+	0x0268, 0x00d6, 0x2069, 0x181e, 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, 0x8bf4, 0x7003, 0x0100, 0x782c, 0x700a, 0x7814,
+	0x700e, 0x700e, 0x60c3, 0x0008, 0x0804, 0x9095, 0x080c, 0x8ba0,
+	0x7003, 0x1400, 0x7838, 0x700a, 0x0079, 0x783c, 0x700e, 0x782c,
+	0x7012, 0x7830, 0x7016, 0x7834, 0x9084, 0x00ff, 0x8007, 0x701a,
+	0x60c3, 0x0010, 0x0804, 0x9095, 0x00e6, 0x2071, 0x0240, 0x0006,
+	0x00f6, 0x2078, 0x7810, 0x00b6, 0x2058, 0xb8bc, 0xd084, 0x0120,
+	0x7848, 0x702a, 0x7844, 0x702e, 0x00be, 0x00fe, 0x000e, 0x00ee,
+	0x0005, 0x080c, 0x8beb, 0x7003, 0x0100, 0x782c, 0x700a, 0x7814,
+	0x700e, 0x60c3, 0x0008, 0x0804, 0x9095, 0x0021, 0x60c3, 0x0000,
+	0x0804, 0x9095, 0x00d6, 0x080c, 0x98d5, 0xb810, 0x9085, 0x0300,
+	0x7002, 0xb814, 0x7006, 0x2069, 0x1800, 0x6878, 0x700a, 0x687c,
+	0x700e, 0x7013, 0x0819, 0x080c, 0x9083, 0x721a, 0x2f10, 0x7222,
+	0x7a08, 0x7226, 0x2071, 0x024c, 0x00de, 0x0005, 0x00a9, 0x7914,
+	0x712a, 0x60c3, 0x0000, 0x60a7, 0x9575, 0x0026, 0x080c, 0x2872,
+	0x0228, 0x2011, 0x0101, 0x2204, 0xc0c5, 0x2012, 0x002e, 0x080c,
+	0x90b8, 0x080c, 0x7dca, 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, 0x98d5, 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, 0x1dd4, 0x080c, 0x8171, 0x0126,
+	0x2091, 0x8000, 0x080c, 0x8769, 0x012e, 0x009e, 0x00de, 0x0005,
+	0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x00a6, 0x0096, 0x0066, 0x0126,
+	0x2091, 0x8000, 0x2071, 0x19b6, 0x760c, 0x2660, 0x2678, 0x8cff,
+	0x0904, 0x99a7, 0x7024, 0x9c06, 0x1520, 0x2069, 0x0100, 0x68c0,
+	0x9005, 0x0904, 0x997e, 0x080c, 0x90c1, 0x68c3, 0x0000, 0x080c,
+	0x9570, 0x7027, 0x0000, 0x0036, 0x2069, 0x0140, 0x6b04, 0x9384,
+	0x1000, 0x0138, 0x2001, 0x0100, 0x080c, 0x29bc, 0x9006, 0x080c,
+	0x29bc, 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, 0xb981, 0x1158, 0x080c, 0x2ea4,
+	0x080c, 0xb992, 0x11f0, 0x080c, 0xa456, 0x00d8, 0x080c, 0x9570,
+	0x08c0, 0x080c, 0xb992, 0x1118, 0x080c, 0xa456, 0x0090, 0x6014,
+	0x2048, 0x080c, 0xb791, 0x0168, 0x6020, 0x9086, 0x0003, 0x1520,
+	0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x080c, 0x65f2, 0x080c,
+	0xb975, 0x080c, 0xbbf9, 0x080c, 0x9af8, 0x080c, 0x9446, 0x00ce,
+	0x0804, 0x992f, 0x2c78, 0x600c, 0x2060, 0x0804, 0x992f, 0x700f,
+	0x0000, 0x700b, 0x0000, 0x012e, 0x006e, 0x009e, 0x00ae, 0x00ce,
+	0x00de, 0x00ee, 0x00fe, 0x0005, 0x6020, 0x9086, 0x0006, 0x1d08,
+	0x080c, 0xd133, 0x08f0, 0x00d6, 0x0156, 0x080c, 0x8bf4, 0x7a14,
+	0x82ff, 0x0138, 0x7003, 0x0100, 0x700b, 0x0003, 0x60c3, 0x0008,
+	0x0490, 0x7003, 0x0200, 0x7007, 0x0000, 0x2069, 0x1800, 0x901e,
+	0x6800, 0x9086, 0x0004, 0x1110, 0xc38d, 0x0060, 0x080c, 0x6d14,
+	0x1110, 0xc3ad, 0x0008, 0xc3a5, 0x6ad8, 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,
+	0x99ef, 0x60c3, 0x0020, 0x080c, 0x9095, 0x015e, 0x00de, 0x0005,
+	0x0156, 0x080c, 0x8bf4, 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, 0x181e, 0x2004, 0x7022, 0x2001, 0x181f, 0x2004, 0x7026,
+	0x0030, 0x2001, 0x1817, 0x2004, 0x9084, 0x00ff, 0x7026, 0x20a9,
+	0x0004, 0x20e1, 0x0001, 0x2099, 0x1805, 0x20e9, 0x0000, 0x20a1,
+	0x0256, 0x4003, 0x60c3, 0x001c, 0x015e, 0x0804, 0x9095, 0x0006,
+	0x2001, 0x1836, 0x2004, 0xd0ac, 0x000e, 0x0005, 0x2011, 0x0003,
+	0x080c, 0x93f3, 0x2011, 0x0002, 0x080c, 0x93fd, 0x080c, 0x92e4,
+	0x0036, 0x901e, 0x080c, 0x935a, 0x003e, 0x0005, 0x2071, 0x1883,
+	0x7000, 0x9005, 0x0140, 0x2001, 0x0976, 0x2071, 0x1800, 0x7072,
+	0x7076, 0x7067, 0xffe0, 0x2071, 0x1800, 0x7070, 0x7052, 0x7057,
+	0x1cd0, 0x0005, 0x00e6, 0x0126, 0x2071, 0x1800, 0x2091, 0x8000,
+	0x7550, 0x9582, 0x0010, 0x0608, 0x7054, 0x2060, 0x6000, 0x9086,
+	0x0000, 0x0148, 0x9ce0, 0x0018, 0x7064, 0x9c02, 0x1208, 0x0cb0,
+	0x2061, 0x1cd0, 0x0c98, 0x6003, 0x0008, 0x8529, 0x7552, 0x9ca8,
+	0x0018, 0x7064, 0x9502, 0x1230, 0x7556, 0x9085, 0x0001, 0x012e,
+	0x00ee, 0x0005, 0x7057, 0x1cd0, 0x0cc0, 0x9006, 0x0cc0, 0x00e6,
+	0x2071, 0x1800, 0x7550, 0x9582, 0x0010, 0x0600, 0x7054, 0x2060,
+	0x6000, 0x9086, 0x0000, 0x0148, 0x9ce0, 0x0018, 0x7064, 0x9c02,
+	0x1208, 0x0cb0, 0x2061, 0x1cd0, 0x0c98, 0x6003, 0x0008, 0x8529,
+	0x7552, 0x9ca8, 0x0018, 0x7064, 0x9502, 0x1228, 0x7556, 0x9085,
+	0x0001, 0x00ee, 0x0005, 0x7057, 0x1cd0, 0x0cc8, 0x9006, 0x0cc8,
+	0x9c82, 0x1cd0, 0x0a0c, 0x0db4, 0x2001, 0x1819, 0x2004, 0x9c02,
+	0x1a0c, 0x0db4, 0x9006, 0x6006, 0x600a, 0x600e, 0x6016, 0x601a,
+	0x6012, 0x6023, 0x0000, 0x6003, 0x0000, 0x601e, 0x6056, 0x605a,
+	0x6026, 0x602a, 0x602e, 0x6032, 0x6036, 0x603a, 0x603e, 0x6042,
+	0x2061, 0x1800, 0x6050, 0x8000, 0x6052, 0x9086, 0x0001, 0x0108,
+	0x0005, 0x0126, 0x2091, 0x8000, 0x080c, 0x868e, 0x012e, 0x0cc0,
+	0x0006, 0x6000, 0x9086, 0x0000, 0x01b0, 0x601c, 0xd084, 0x190c,
+	0x185b, 0x6017, 0x0000, 0x6023, 0x0007, 0x2001, 0x1955, 0x2004,
+	0x0006, 0x9082, 0x0051, 0x000e, 0x0208, 0x8004, 0x601a, 0x080c,
+	0xd3e0, 0x6043, 0x0000, 0x000e, 0x0005, 0x00e6, 0x0126, 0x2071,
+	0x1800, 0x2091, 0x8000, 0x7550, 0x9582, 0x0001, 0x0608, 0x7054,
+	0x2060, 0x6000, 0x9086, 0x0000, 0x0148, 0x9ce0, 0x0018, 0x7064,
+	0x9c02, 0x1208, 0x0cb0, 0x2061, 0x1cd0, 0x0c98, 0x6003, 0x0008,
+	0x8529, 0x7552, 0x9ca8, 0x0018, 0x7064, 0x9502, 0x1230, 0x7556,
+	0x9085, 0x0001, 0x012e, 0x00ee, 0x0005, 0x7057, 0x1cd0, 0x0cc0,
+	0x9006, 0x0cc0, 0x6020, 0x9084, 0x000f, 0x0002, 0x9b55, 0x9b5e,
+	0x9b79, 0x9b94, 0xbeac, 0xbec9, 0xbee4, 0x9b55, 0x9b5e, 0x9b55,
+	0x9bb0, 0x9b55, 0x9b55, 0x9b55, 0x9b55, 0x9186, 0x0013, 0x1128,
+	0x080c, 0x8589, 0x080c, 0x868e, 0x0005, 0x0005, 0x0066, 0x6000,
+	0x90b2, 0x0016, 0x1a0c, 0x0db4, 0x0013, 0x006e, 0x0005, 0x9b77,
+	0xa2cf, 0xa49d, 0x9b77, 0xa52b, 0x9e93, 0x9b77, 0x9b77, 0xa251,
+	0xaacd, 0x9b77, 0x9b77, 0x9b77, 0x9b77, 0x9b77, 0x9b77, 0x080c,
+	0x0db4, 0x0066, 0x6000, 0x90b2, 0x0016, 0x1a0c, 0x0db4, 0x0013,
+	0x006e, 0x0005, 0x9b92, 0xb1a1, 0x9b92, 0x9b92, 0x9b92, 0x9b92,
+	0x9b92, 0x9b92, 0xb146, 0xb323, 0x9b92, 0xb1e2, 0xb261, 0xb1e2,
+	0xb261, 0x9b92, 0x080c, 0x0db4, 0x6000, 0x9082, 0x0016, 0x1a0c,
+	0x0db4, 0x6000, 0x0002, 0x9bae, 0xab14, 0xabf9, 0xad29, 0xaed4,
+	0x9bae, 0x9bae, 0x9bae, 0xaae8, 0xb0d2, 0xb0d5, 0x9bae, 0x9bae,
+	0x9bae, 0x9bae, 0xb104, 0x9bae, 0x9bae, 0x9bae, 0x080c, 0x0db4,
+	0x0066, 0x6000, 0x90b2, 0x0016, 0x1a0c, 0x0db4, 0x0013, 0x006e,
+	0x0005, 0x9bc9, 0x9bc9, 0x9c0c, 0x9cab, 0x9d40, 0x9bc9, 0x9bc9,
+	0x9bc9, 0x9bcb, 0x9bc9, 0x9bc9, 0x9bc9, 0x9bc9, 0x9bc9, 0x9bc9,
+	0x9bc9, 0x080c, 0x0db4, 0x9186, 0x004c, 0x0588, 0x9186, 0x0003,
+	0x190c, 0x0db4, 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, 0x19aa, 0x080c, 0x8171,
+	0x0126, 0x2091, 0x8000, 0x080c, 0x8769, 0x012e, 0x0005, 0x6010,
+	0x00b6, 0x2058, 0xbca0, 0x00be, 0x2c00, 0x080c, 0x9d62, 0x080c,
+	0xbe9e, 0x6003, 0x0007, 0x0005, 0x00d6, 0x0096, 0x00f6, 0x2079,
+	0x1800, 0x7a8c, 0x6014, 0x2048, 0xa87c, 0xd0ec, 0x1110, 0x9290,
+	0x0018, 0xac78, 0xc4fc, 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, 0x9c73, 0x9c73,
+	0x9c6e, 0x9c71, 0x9c73, 0x9c6b, 0x9c5e, 0x9c5e, 0x9c5e, 0x9c5e,
+	0x9c5e, 0x9c5e, 0x9c5e, 0x9c5e, 0x9c5e, 0x9c5e, 0x00fe, 0x00ee,
+	0x00de, 0x00ce, 0x002e, 0x001e, 0x000e, 0x004e, 0x00fe, 0x009e,
+	0x00de, 0x080c, 0x0db4, 0x080c, 0xa70c, 0x0028, 0x080c, 0xa82f,
+	0x0010, 0x080c, 0xa91e, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x002e,
+	0x001e, 0x2c00, 0xa896, 0x000e, 0x080c, 0x9e20, 0x0530, 0xa804,
+	0xa80e, 0x00a6, 0x2050, 0xb100, 0x00ae, 0x8006, 0x8006, 0x8007,
+	0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x0002, 0xaacc, 0xabd0,
+	0xacd4, 0xadd8, 0x2031, 0x0000, 0x2041, 0x1240, 0x080c, 0x9fca,
+	0x0160, 0x000e, 0x9005, 0x0120, 0x00fe, 0x009e, 0x00de, 0x0005,
+	0x00fe, 0x009e, 0x00de, 0x0804, 0x9ac8, 0x2001, 0x002c, 0x900e,
+	0x080c, 0x9e86, 0x0c70, 0x91b6, 0x0015, 0x0170, 0x91b6, 0x0016,
+	0x0158, 0x91b2, 0x0047, 0x0a0c, 0x0db4, 0x91b2, 0x0050, 0x1a0c,
+	0x0db4, 0x9182, 0x0047, 0x00ca, 0x2001, 0x0109, 0x2004, 0xd08c,
+	0x0198, 0x0126, 0x2091, 0x2800, 0x0006, 0x0016, 0x0026, 0x080c,
+	0x80c5, 0x002e, 0x001e, 0x000e, 0x012e, 0xa001, 0x6000, 0x9086,
+	0x0002, 0x1110, 0x0804, 0x9c0c, 0x0005, 0x9cde, 0x9cde, 0x9ce0,
+	0x9d16, 0x9cde, 0x9cde, 0x9cde, 0x9cde, 0x9d29, 0x080c, 0x0db4,
+	0x00d6, 0x0016, 0x0096, 0x080c, 0x863e, 0x080c, 0x8769, 0x6003,
+	0x0004, 0x6114, 0x2148, 0xa87c, 0xd0fc, 0x01c0, 0xa878, 0xc0fc,
+	0x9005, 0x1158, 0xa894, 0x9005, 0x0140, 0x2001, 0x0000, 0x900e,
+	0x080c, 0x9e86, 0x080c, 0x9ac8, 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, 0x863e,
+	0x00d6, 0x0096, 0x6114, 0x2148, 0x080c, 0xb793, 0x0120, 0xa87b,
+	0x0006, 0x080c, 0x65f2, 0x009e, 0x00de, 0x080c, 0x9ac8, 0x0804,
+	0x8769, 0x080c, 0x863e, 0x080c, 0x2e7f, 0x080c, 0xbe9b, 0x00d6,
+	0x0096, 0x6114, 0x2148, 0x080c, 0xb793, 0x0120, 0xa87b, 0x0029,
+	0x080c, 0x65f2, 0x009e, 0x00de, 0x080c, 0x9ac8, 0x0804, 0x8769,
+	0x9182, 0x0047, 0x0002, 0x9d50, 0x9d52, 0x9d50, 0x9d50, 0x9d50,
+	0x9d50, 0x9d50, 0x9d50, 0x9d50, 0x9d50, 0x9d50, 0x9d50, 0x9d52,
+	0x080c, 0x0db4, 0x00d6, 0x0096, 0x080c, 0x14f3, 0x6114, 0x2148,
+	0xa87b, 0x0000, 0xa883, 0x0000, 0x080c, 0x65f2, 0x009e, 0x00de,
+	0x0804, 0x9ac8, 0x0026, 0x0036, 0x0056, 0x0066, 0x0096, 0x00a6,
+	0x00f6, 0x0006, 0x080c, 0x0fec, 0x000e, 0x090c, 0x0db4, 0xa960,
+	0x21e8, 0xa95c, 0x9188, 0x0019, 0x21a0, 0x900e, 0x20a9, 0x0020,
+	0x4104, 0xa87a, 0x2079, 0x1800, 0x798c, 0x9188, 0x0018, 0x918c,
+	0x0fff, 0xa972, 0xac76, 0x2950, 0x00a6, 0x2001, 0x0205, 0x2003,
+	0x0000, 0x901e, 0x2029, 0x0001, 0x9182, 0x0034, 0x1228, 0x2011,
+	0x001f, 0x080c, 0xb3a8, 0x04c0, 0x2130, 0x2009, 0x0034, 0x2011,
+	0x001f, 0x080c, 0xb3a8, 0x96b2, 0x0034, 0xb004, 0x904d, 0x0110,
+	0x080c, 0x0f9e, 0x080c, 0x0fec, 0x01d0, 0x8528, 0xa867, 0x0110,
+	0xa86b, 0x0000, 0x2920, 0xb406, 0x968a, 0x003d, 0x1230, 0x2608,
+	0x2011, 0x001b, 0x080c, 0xb3a8, 0x00b8, 0x96b2, 0x003c, 0x2009,
+	0x003c, 0x2950, 0x2011, 0x001b, 0x080c, 0xb3a8, 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, 0x65f2, 0x000e, 0x2048, 0x9005, 0x1db0,
+	0x00fe, 0x00ae, 0x009e, 0x006e, 0x005e, 0x003e, 0x002e, 0x0005,
+	0x00d6, 0x00f6, 0x0096, 0x0006, 0x080c, 0x0fec, 0x000e, 0x090c,
+	0x0db4, 0xa960, 0x21e8, 0xa95c, 0x9188, 0x0019, 0x21a0, 0x900e,
+	0x20a9, 0x0020, 0x4104, 0xaa66, 0xa87a, 0x2079, 0x1800, 0x798c,
+	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, 0x65f2, 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, 0x0fec, 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, 0x9e35, 0x0804, 0x9e37, 0x9085, 0x0001, 0x7817,
+	0x0000, 0x009e, 0x00fe, 0x00de, 0x001e, 0x0005, 0x00d6, 0x0036,
+	0x0096, 0x6314, 0x2348, 0xa87a, 0xa982, 0x080c, 0x65e5, 0x009e,
+	0x003e, 0x00de, 0x0005, 0x91b6, 0x0015, 0x1118, 0x080c, 0x9ac8,
+	0x0030, 0x91b6, 0x0016, 0x190c, 0x0db4, 0x080c, 0x9ac8, 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, 0xb793, 0x0130, 0x6014,
+	0x2048, 0xa807, 0x0000, 0xa867, 0x0103, 0x009e, 0x0804, 0x9ac8,
+	0x0096, 0x00d6, 0x0036, 0x7330, 0x9386, 0x0200, 0x11a8, 0x6010,
+	0x00b6, 0x2058, 0xb8bf, 0x0000, 0x00be, 0x6014, 0x9005, 0x0130,
+	0x2048, 0xa807, 0x0000, 0xa867, 0x0103, 0xab32, 0x080c, 0x9ac8,
+	0x003e, 0x00de, 0x009e, 0x0005, 0x0011, 0x1d48, 0x0cc8, 0x0006,
+	0x0016, 0x080c, 0xbe86, 0x0188, 0x6014, 0x9005, 0x1170, 0x600b,
+	0x0003, 0x601b, 0x0000, 0x6043, 0x0000, 0x2009, 0x0022, 0x080c,
+	0xa2a7, 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,
+	0x9ac8, 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, 0xb3a8, 0x080c,
+	0xb793, 0x0140, 0x6014, 0x2048, 0xa807, 0x0000, 0xa864, 0xa8e2,
+	0xa867, 0x0103, 0x080c, 0x9ac8, 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, 0xb3a8,
+	0x009e, 0x080c, 0xb793, 0x0148, 0xa804, 0x9005, 0x1158, 0xa807,
+	0x0000, 0xa864, 0xa8e2, 0xa867, 0x0103, 0x080c, 0x9ac8, 0x009e,
+	0x001e, 0x0005, 0x0086, 0x2040, 0xa030, 0x8007, 0x9086, 0x0100,
+	0x1118, 0x080c, 0xa456, 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, 0x1226, 0x0019, 0x0d08,
+	0x008e, 0x0898, 0x0096, 0x0006, 0x080c, 0x0fec, 0x000e, 0x01b0,
+	0xa8ab, 0x0dcb, 0xa876, 0x000e, 0xa8a2, 0x0006, 0xae6a, 0x2800,
+	0xa89e, 0xa97a, 0xaf72, 0xaa8e, 0xab92, 0xac96, 0xad9a, 0x0086,
+	0x2940, 0x080c, 0x10cc, 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, 0xbdfe, 0x001e, 0x1158, 0x622c,
+	0x2268, 0x2071, 0x026c, 0x6b20, 0x9386, 0x0003, 0x0130, 0x9386,
+	0x0006, 0x0128, 0x080c, 0x9ac8, 0x0020, 0x0039, 0x0010, 0x080c,
+	0xa0dc, 0x002e, 0x00de, 0x00ee, 0x0005, 0x0096, 0x6814, 0x2048,
+	0x9186, 0x0015, 0x0904, 0xa0c4, 0x918e, 0x0016, 0x1904, 0xa0da,
+	0x700c, 0x908c, 0xff00, 0x9186, 0x1700, 0x0120, 0x9186, 0x0300,
+	0x1904, 0xa09e, 0x89ff, 0x1138, 0x6800, 0x9086, 0x000f, 0x0904,
+	0xa081, 0x0804, 0xa0d8, 0x6808, 0x9086, 0xffff, 0x1904, 0xa0c6,
+	0xa87c, 0x9084, 0x0060, 0x9086, 0x0020, 0x1128, 0xa83c, 0xa940,
+	0x9105, 0x1904, 0xa0c6, 0x6824, 0xd0b4, 0x1904, 0xa0c6, 0x080c,
+	0xb975, 0x685c, 0xa882, 0xa87c, 0xc0dc, 0xc0f4, 0xc0d4, 0xa87e,
+	0x0026, 0x900e, 0x6a18, 0x2001, 0x000a, 0x080c, 0x7f8b, 0xa884,
+	0x920a, 0x0208, 0x8011, 0xaa86, 0x82ff, 0x002e, 0x1138, 0x00c6,
+	0x2d60, 0x080c, 0xb4d2, 0x00ce, 0x0804, 0xa0d8, 0x00c6, 0xa868,
+	0xd0fc, 0x1118, 0x080c, 0x5b10, 0x0010, 0x080c, 0x5ea7, 0x00ce,
+	0x1904, 0xa0c6, 0x00c6, 0x2d60, 0x080c, 0x9ac8, 0x00ce, 0x0804,
+	0xa0d8, 0x00c6, 0x080c, 0x9b15, 0x0198, 0x6017, 0x0000, 0x6810,
+	0x6012, 0x080c, 0xbc01, 0x6023, 0x0003, 0x6904, 0x00c6, 0x2d60,
+	0x080c, 0x9ac8, 0x00ce, 0x080c, 0x9b42, 0x00ce, 0x0804, 0xa0d8,
+	0x2001, 0x1957, 0x2004, 0x6842, 0x00ce, 0x04d0, 0x7008, 0x9086,
+	0x000b, 0x11c8, 0x6010, 0x00b6, 0x2058, 0xb900, 0xc1bc, 0xb902,
+	0x00be, 0x00c6, 0x2d60, 0xa87b, 0x0003, 0x080c, 0xbe40, 0x6007,
+	0x0085, 0x6003, 0x000b, 0x6023, 0x0002, 0x080c, 0x810c, 0x080c,
+	0x868e, 0x00ce, 0x00e8, 0x700c, 0x9086, 0x2a00, 0x1138, 0x2001,
+	0x1957, 0x2004, 0x6842, 0x00a0, 0x0479, 0x00a0, 0x89ff, 0x090c,
+	0x0db4, 0x00c6, 0x00d6, 0x2d60, 0xa867, 0x0103, 0xa87b, 0x0003,
+	0x080c, 0x640d, 0x080c, 0xb975, 0x080c, 0x9af8, 0x00de, 0x00ce,
+	0x080c, 0x9ac8, 0x009e, 0x0005, 0x9186, 0x0015, 0x1128, 0x2001,
+	0x1957, 0x2004, 0x6842, 0x0068, 0x918e, 0x0016, 0x1160, 0x00c6,
+	0x2d00, 0x2060, 0x080c, 0xd3e0, 0x080c, 0x7f1f, 0x080c, 0x9ac8,
+	0x00ce, 0x080c, 0x9ac8, 0x0005, 0x0026, 0x0036, 0x0046, 0x7228,
+	0xacb0, 0xabac, 0xd2f4, 0x0130, 0x2001, 0x1957, 0x2004, 0x6842,
+	0x0804, 0xa156, 0x00c6, 0x2d60, 0x080c, 0xb3d3, 0x00ce, 0x6804,
+	0x9086, 0x0050, 0x1168, 0x00c6, 0x2d00, 0x2060, 0x6003, 0x0001,
+	0x6007, 0x0050, 0x080c, 0x810c, 0x080c, 0x868e, 0x00ce, 0x04f0,
+	0x6800, 0x9086, 0x000f, 0x01a8, 0x89ff, 0x090c, 0x0db4, 0x6800,
+	0x9086, 0x0004, 0x1190, 0xa87c, 0xd0ac, 0x0178, 0xa843, 0x0fff,
+	0xa83f, 0x0fff, 0xa880, 0xc0fc, 0xa882, 0x2001, 0x0001, 0x6832,
+	0x0400, 0x2001, 0x0007, 0x6832, 0x00e0, 0xa87c, 0xd0b4, 0x1150,
+	0xd0ac, 0x0db8, 0x6824, 0xd0f4, 0x1d48, 0xa838, 0xa934, 0x9105,
+	0x0d80, 0x0c20, 0xd2ec, 0x1d68, 0x7024, 0x9306, 0x1118, 0x7020,
+	0x9406, 0x0d38, 0x7020, 0x683e, 0x7024, 0x683a, 0x2001, 0x0005,
+	0x6832, 0x080c, 0xbaf8, 0x080c, 0x868e, 0x0010, 0x080c, 0x9ac8,
+	0x004e, 0x003e, 0x002e, 0x0005, 0x00e6, 0x00d6, 0x0026, 0x7008,
+	0x9084, 0x00ff, 0x6210, 0x00b6, 0x2258, 0xba10, 0x00be, 0x9206,
+	0x1904, 0xa1c1, 0x700c, 0x6210, 0x00b6, 0x2258, 0xba14, 0x00be,
+	0x9206, 0x1904, 0xa1c1, 0x6038, 0x2068, 0x6824, 0xc0dc, 0x6826,
+	0x6a20, 0x9286, 0x0007, 0x0904, 0xa1c1, 0x9286, 0x0002, 0x0904,
+	0xa1c1, 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, 0xb793,
+	0x090c, 0x0db4, 0xa87b, 0x0003, 0x009e, 0x080c, 0xbe40, 0x6007,
+	0x0085, 0x6003, 0x000b, 0x6023, 0x0002, 0x080c, 0x810c, 0x080c,
+	0x868e, 0x00ce, 0x0030, 0x6038, 0x2070, 0x2001, 0x1957, 0x2004,
+	0x7042, 0x080c, 0x9ac8, 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, 0xaaa3, 0x002e, 0x003e, 0x015e, 0x009e,
+	0x1904, 0xa230, 0x0096, 0x0156, 0x0036, 0x0026, 0x2b48, 0x9e90,
+	0x0014, 0x2019, 0x0006, 0x20a9, 0x0004, 0x080c, 0xaaa3, 0x002e,
+	0x003e, 0x015e, 0x009e, 0x15a0, 0x7238, 0xba0a, 0x733c, 0xbb0e,
+	0xbc00, 0xc48d, 0xbc02, 0xa804, 0x9005, 0x1128, 0x00fe, 0x009e,
+	0x00be, 0x0804, 0x9ecb, 0x0096, 0x2048, 0xaa12, 0xab16, 0xac0a,
+	0x009e, 0x8006, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0,
+	0x9080, 0x0002, 0x2009, 0x002b, 0xaaa0, 0xab9c, 0xaca8, 0xada4,
+	0x2031, 0x0000, 0x2041, 0x1226, 0x080c, 0x9fca, 0x0130, 0x00fe,
+	0x009e, 0x080c, 0x9ac8, 0x00be, 0x0005, 0x080c, 0xa456, 0x0cb8,
+	0x2b78, 0x00f6, 0x080c, 0x2e7f, 0x080c, 0xbe9b, 0x00fe, 0x00c6,
+	0x080c, 0x9a72, 0x2f00, 0x6012, 0x6017, 0x0000, 0x6023, 0x0001,
+	0x6007, 0x0001, 0x6003, 0x0001, 0x2001, 0x0007, 0x080c, 0x5f42,
+	0x080c, 0x5f6e, 0x080c, 0x8154, 0x080c, 0x868e, 0x00ce, 0x0804,
+	0xa203, 0x2100, 0x91b2, 0x0053, 0x1a0c, 0x0db4, 0x91b2, 0x0040,
+	0x1a04, 0xa2b9, 0x0002, 0xa2a7, 0xa2a7, 0xa29d, 0xa2a7, 0xa2a7,
+	0xa2a7, 0xa29b, 0xa29b, 0xa29b, 0xa29b, 0xa29b, 0xa29b, 0xa29b,
+	0xa29b, 0xa29b, 0xa29b, 0xa29b, 0xa29b, 0xa29b, 0xa29b, 0xa29b,
+	0xa29b, 0xa29b, 0xa29b, 0xa29b, 0xa29b, 0xa29b, 0xa29b, 0xa29b,
+	0xa29b, 0xa29b, 0xa2a7, 0xa29b, 0xa2a7, 0xa2a7, 0xa29b, 0xa29b,
+	0xa29b, 0xa29b, 0xa29b, 0xa29d, 0xa29b, 0xa29b, 0xa29b, 0xa29b,
+	0xa29b, 0xa29b, 0xa29b, 0xa29b, 0xa29b, 0xa2a7, 0xa2a7, 0xa29b,
+	0xa29b, 0xa29b, 0xa29b, 0xa29b, 0xa29b, 0xa29b, 0xa29b, 0xa29b,
+	0xa2a7, 0xa29b, 0xa29b, 0x080c, 0x0db4, 0x0066, 0x00b6, 0x6610,
+	0x2658, 0xb8bc, 0xc08c, 0xb8be, 0x00be, 0x006e, 0x0000, 0x6003,
+	0x0001, 0x6106, 0x9186, 0x0032, 0x0118, 0x080c, 0x8154, 0x0010,
+	0x080c, 0x810c, 0x0126, 0x2091, 0x8000, 0x080c, 0x868e, 0x012e,
+	0x0005, 0x2600, 0x0002, 0xa2cd, 0xa2cd, 0xa2cd, 0xa2a7, 0xa2a7,
+	0xa2cd, 0xa2cd, 0xa2cd, 0xa2cd, 0xa2a7, 0xa2cd, 0xa2a7, 0xa2cd,
+	0xa2a7, 0xa2cd, 0xa2cd, 0xa2cd, 0xa2cd, 0x080c, 0x0db4, 0x6004,
+	0x90b2, 0x0053, 0x1a0c, 0x0db4, 0x91b6, 0x0013, 0x0904, 0xa391,
+	0x91b6, 0x0027, 0x1904, 0xa34c, 0x080c, 0x8589, 0x6004, 0x080c,
+	0xb981, 0x01b0, 0x080c, 0xb992, 0x01a8, 0x908e, 0x0021, 0x0904,
+	0xa349, 0x908e, 0x0022, 0x1130, 0x080c, 0x9ef7, 0x0904, 0xa345,
+	0x0804, 0xa346, 0x908e, 0x003d, 0x0904, 0xa349, 0x0804, 0xa33f,
+	0x080c, 0x2ea4, 0x2001, 0x0007, 0x080c, 0x5f42, 0x6010, 0x00b6,
+	0x2058, 0xb9a0, 0x00be, 0x080c, 0xa456, 0x9186, 0x007e, 0x1148,
+	0x2001, 0x1836, 0x2014, 0xc285, 0x080c, 0x6d14, 0x1108, 0xc2ad,
+	0x2202, 0x0036, 0x0026, 0x2019, 0x0028, 0x2110, 0x080c, 0xd43b,
+	0x002e, 0x003e, 0x0016, 0x0026, 0x0036, 0x2110, 0x2019, 0x0028,
+	0x080c, 0x828c, 0x0076, 0x903e, 0x080c, 0x8184, 0x6010, 0x00b6,
+	0x905d, 0x0100, 0x00be, 0x2c08, 0x080c, 0xcef9, 0x007e, 0x003e,
+	0x002e, 0x001e, 0x080c, 0xbe9b, 0x0016, 0x080c, 0xbbf9, 0x080c,
+	0x9ac8, 0x001e, 0x080c, 0x2f76, 0x080c, 0x868e, 0x0030, 0x080c,
+	0xbbf9, 0x080c, 0x9ac8, 0x080c, 0x868e, 0x0005, 0x080c, 0xa456,
+	0x0cb0, 0x080c, 0xa492, 0x0c98, 0x9186, 0x0014, 0x1db0, 0x080c,
+	0x8589, 0x6004, 0x908e, 0x0022, 0x1118, 0x080c, 0x9ef7, 0x0d68,
+	0x080c, 0x2e7f, 0x080c, 0xbe9b, 0x080c, 0xb981, 0x1190, 0x080c,
+	0x2ea4, 0x6010, 0x00b6, 0x2058, 0xb9a0, 0x00be, 0x080c, 0xa456,
+	0x9186, 0x007e, 0x1128, 0x2001, 0x1836, 0x200c, 0xc185, 0x2102,
+	0x0870, 0x080c, 0xb992, 0x1118, 0x080c, 0xa456, 0x0840, 0x6004,
+	0x908e, 0x0032, 0x1160, 0x00e6, 0x00f6, 0x2071, 0x1894, 0x2079,
+	0x0000, 0x080c, 0x320a, 0x00fe, 0x00ee, 0x0804, 0xa33f, 0x6004,
+	0x908e, 0x0021, 0x0d48, 0x908e, 0x0022, 0x090c, 0xa456, 0x0804,
+	0xa33f, 0x90b2, 0x0040, 0x1a04, 0xa43f, 0x2008, 0x0002, 0xa3d9,
+	0xa3da, 0xa3dd, 0xa3e0, 0xa3e3, 0xa3e6, 0xa3d7, 0xa3d7, 0xa3d7,
+	0xa3d7, 0xa3d7, 0xa3d7, 0xa3d7, 0xa3d7, 0xa3d7, 0xa3d7, 0xa3d7,
+	0xa3d7, 0xa3d7, 0xa3d7, 0xa3d7, 0xa3d7, 0xa3d7, 0xa3d7, 0xa3d7,
+	0xa3d7, 0xa3d7, 0xa3d7, 0xa3d7, 0xa3d7, 0xa3e9, 0xa3f4, 0xa3d7,
+	0xa3f6, 0xa3f4, 0xa3d7, 0xa3d7, 0xa3d7, 0xa3d7, 0xa3d7, 0xa3f4,
+	0xa3f4, 0xa3d7, 0xa3d7, 0xa3d7, 0xa3d7, 0xa3d7, 0xa3d7, 0xa3d7,
+	0xa3d7, 0xa426, 0xa3f4, 0xa3d7, 0xa3f0, 0xa3d7, 0xa3d7, 0xa3d7,
+	0xa3f1, 0xa3d7, 0xa3d7, 0xa3d7, 0xa3f4, 0xa41d, 0xa3d7, 0x080c,
+	0x0db4, 0x00d0, 0x2001, 0x000b, 0x0410, 0x2001, 0x0003, 0x00f8,
+	0x2001, 0x0005, 0x00e0, 0x2001, 0x0001, 0x00c8, 0x2001, 0x0009,
+	0x00b0, 0x080c, 0x8589, 0x6003, 0x0005, 0x080c, 0x868e, 0x0070,
+	0x0018, 0x0010, 0x080c, 0x5f42, 0x0804, 0xa437, 0x080c, 0x8589,
+	0x080c, 0xbe9e, 0x6003, 0x0004, 0x080c, 0x868e, 0x0005, 0x080c,
+	0x5f42, 0x080c, 0x8589, 0x6003, 0x0002, 0x0036, 0x2019, 0x185e,
+	0x2304, 0x9084, 0xff00, 0x1120, 0x2001, 0x1955, 0x201c, 0x0040,
+	0x8007, 0x909a, 0x0004, 0x0ec0, 0x8003, 0x801b, 0x831b, 0x9318,
+	0x631a, 0x003e, 0x080c, 0x868e, 0x0c08, 0x080c, 0x8589, 0x080c,
+	0xbbf9, 0x080c, 0x9ac8, 0x080c, 0x868e, 0x08c0, 0x00e6, 0x00f6,
+	0x2071, 0x1894, 0x2079, 0x0000, 0x080c, 0x320a, 0x00fe, 0x00ee,
+	0x080c, 0x8589, 0x080c, 0x9ac8, 0x080c, 0x868e, 0x0838, 0x080c,
+	0x8589, 0x6003, 0x0002, 0x080c, 0xbe9e, 0x0804, 0x868e, 0x2600,
+	0x2008, 0x0002, 0xa454, 0xa454, 0xa454, 0xa437, 0xa437, 0xa454,
+	0xa454, 0xa454, 0xa454, 0xa437, 0xa454, 0xa437, 0xa454, 0xa437,
+	0xa454, 0xa454, 0xa454, 0xa454, 0x080c, 0x0db4, 0x00e6, 0x0096,
+	0x0026, 0x0016, 0x080c, 0xb793, 0x0568, 0x6014, 0x2048, 0xa864,
+	0x9086, 0x0139, 0x11a8, 0xa894, 0x9086, 0x0056, 0x1148, 0x080c,
+	0x4efc, 0x0130, 0x2001, 0x0000, 0x900e, 0x2011, 0x4000, 0x0028,
+	0x2001, 0x0030, 0x900e, 0x2011, 0x4005, 0x080c, 0xbd65, 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, 0x0db4, 0x6604,
+	0x96b6, 0x004d, 0x1120, 0x080c, 0xbc85, 0x0804, 0xa51a, 0x6604,
+	0x96b6, 0x0043, 0x1120, 0x080c, 0xbcce, 0x0804, 0xa51a, 0x6604,
+	0x96b6, 0x004b, 0x1120, 0x080c, 0xbcfa, 0x0804, 0xa51a, 0x6604,
+	0x96b6, 0x0033, 0x1120, 0x080c, 0xbc1b, 0x0804, 0xa51a, 0x6604,
+	0x96b6, 0x0028, 0x1120, 0x080c, 0xb9cb, 0x0804, 0xa51a, 0x6604,
+	0x96b6, 0x0029, 0x1120, 0x080c, 0xba0c, 0x0804, 0xa51a, 0x6604,
+	0x96b6, 0x001f, 0x1118, 0x080c, 0x9ea0, 0x04e0, 0x6604, 0x96b6,
+	0x0000, 0x1118, 0x080c, 0xa1c7, 0x04a8, 0x6604, 0x96b6, 0x0022,
+	0x1118, 0x080c, 0x9ed8, 0x0470, 0x6604, 0x96b6, 0x0035, 0x1118,
+	0x080c, 0x9fe8, 0x0438, 0x6604, 0x96b6, 0x0039, 0x1118, 0x080c,
+	0xa15c, 0x0400, 0x6604, 0x96b6, 0x003d, 0x1118, 0x080c, 0x9f10,
+	0x00c8, 0x6604, 0x96b6, 0x0044, 0x1118, 0x080c, 0x9f4c, 0x0090,
+	0x6604, 0x96b6, 0x0049, 0x1118, 0x080c, 0x9f77, 0x0058, 0x91b6,
+	0x0015, 0x1110, 0x0063, 0x0030, 0x91b6, 0x0016, 0x1128, 0x00be,
+	0x0804, 0xa7d8, 0x00be, 0x0005, 0x080c, 0x9b5d, 0x0cd8, 0xa537,
+	0xa53a, 0xa537, 0xa57e, 0xa537, 0xa70c, 0xa7e5, 0xa537, 0xa537,
+	0xa7b2, 0xa537, 0xa7c6, 0x0096, 0x080c, 0x14f3, 0x6014, 0x2048,
+	0xa800, 0x2048, 0xa867, 0x0103, 0x009e, 0x0804, 0x9ac8, 0xa001,
+	0xa001, 0x0005, 0x00e6, 0x2071, 0x1800, 0x708c, 0x9086, 0x0074,
+	0x1540, 0x080c, 0xceca, 0x11b0, 0x6010, 0x00b6, 0x2058, 0x7030,
+	0xd08c, 0x0128, 0xb800, 0xd0bc, 0x0110, 0xc0c5, 0xb802, 0x00e9,
+	0x00be, 0x2001, 0x0006, 0x080c, 0x5f42, 0x080c, 0x2ea4, 0x080c,
+	0x9ac8, 0x0088, 0x2001, 0x000a, 0x080c, 0x5f42, 0x080c, 0x2ea4,
+	0x6003, 0x0001, 0x6007, 0x0001, 0x080c, 0x8154, 0x080c, 0x868e,
+	0x0010, 0x080c, 0xa6f7, 0x00ee, 0x0005, 0x00d6, 0xb800, 0xd084,
+	0x0158, 0x9006, 0x080c, 0x5f2e, 0x2069, 0x1853, 0x6804, 0x0020,
+	0x2001, 0x0006, 0x080c, 0x5f6e, 0x00de, 0x0005, 0x00b6, 0x0096,
+	0x00d6, 0x2011, 0x1823, 0x2204, 0x9086, 0x0074, 0x1904, 0xa6d0,
+	0x6010, 0x2058, 0xbaa0, 0x9286, 0x007e, 0x1120, 0x080c, 0xa929,
+	0x0804, 0xa635, 0x00d6, 0x080c, 0x6d14, 0x0198, 0x0026, 0x2011,
+	0x0010, 0x080c, 0x6339, 0x002e, 0x05c8, 0x080c, 0x5167, 0x1540,
+	0x6014, 0x2048, 0xa807, 0x0000, 0xa867, 0x0103, 0xa833, 0xdead,
+	0x00f8, 0x0026, 0x2011, 0x8008, 0x080c, 0x6339, 0x002e, 0x0530,
+	0x6014, 0x2048, 0xa864, 0x9084, 0x00ff, 0x9086, 0x0039, 0x1140,
+	0x2001, 0x0030, 0x900e, 0x2011, 0x4009, 0x080c, 0xbd65, 0x0040,
+	0x6014, 0x2048, 0xa807, 0x0000, 0xa867, 0x0103, 0xa833, 0xdead,
+	0x6010, 0x2058, 0xb9a0, 0x0016, 0x080c, 0x2ea4, 0x080c, 0x9ac8,
+	0x001e, 0x080c, 0x2f76, 0x00de, 0x0804, 0xa6d1, 0x00de, 0x080c,
+	0xa91e, 0x6010, 0x2058, 0xbaa0, 0x9286, 0x0080, 0x1510, 0x6014,
+	0x9005, 0x01a8, 0x2048, 0xa864, 0x9084, 0x00ff, 0x9086, 0x0039,
+	0x1140, 0x2001, 0x0000, 0x900e, 0x2011, 0x4000, 0x080c, 0xbd65,
+	0x0030, 0xa807, 0x0000, 0xa867, 0x0103, 0xa833, 0x0200, 0x2001,
+	0x0006, 0x080c, 0x5f42, 0x080c, 0x2ea4, 0x080c, 0x9ac8, 0x0804,
+	0xa6d1, 0x080c, 0xa6df, 0x6014, 0x9005, 0x0190, 0x2048, 0xa868,
+	0xd0f4, 0x01e8, 0xa864, 0x9084, 0x00ff, 0x9086, 0x0039, 0x1d08,
+	0x2001, 0x0000, 0x900e, 0x2011, 0x4000, 0x080c, 0xbd65, 0x08f8,
+	0x080c, 0xa6d5, 0x0160, 0x9006, 0x080c, 0x5f2e, 0x2001, 0x0004,
+	0x080c, 0x5f6e, 0x2001, 0x0007, 0x080c, 0x5f42, 0x08a0, 0x2001,
+	0x0004, 0x080c, 0x5f42, 0x6003, 0x0001, 0x6007, 0x0003, 0x080c,
+	0x8154, 0x080c, 0x868e, 0x0804, 0xa6d1, 0xb85c, 0xd0e4, 0x01d0,
+	0x080c, 0xbb9b, 0x080c, 0x6d14, 0x0118, 0xd0dc, 0x1904, 0xa5f7,
+	0x2011, 0x1836, 0x2204, 0xc0ad, 0x2012, 0x2001, 0x0002, 0x00f6,
+	0x2079, 0x0100, 0x78e3, 0x0000, 0x080c, 0x257f, 0x78e2, 0x00fe,
+	0x0804, 0xa5f7, 0x080c, 0xbbd8, 0x2011, 0x1836, 0x2204, 0xc0a5,
+	0x2012, 0x0006, 0x080c, 0xd023, 0x000e, 0x1904, 0xa5f7, 0xc0b5,
+	0x2012, 0x2001, 0x0006, 0x080c, 0x5f42, 0x9006, 0x080c, 0x5f2e,
+	0x00c6, 0x2001, 0x180f, 0x2004, 0xd09c, 0x0520, 0x00f6, 0x2079,
+	0x0100, 0x00e6, 0x2071, 0x1800, 0x700c, 0x9084, 0x00ff, 0x78e6,
+	0x707a, 0x7010, 0x78ea, 0x707e, 0x908c, 0x00ff, 0x00ee, 0x780c,
+	0xc0b5, 0x780e, 0x00fe, 0x080c, 0x2554, 0x00f6, 0x2100, 0x900e,
+	0x080c, 0x250b, 0x795a, 0x00fe, 0x9186, 0x0081, 0x01d8, 0x2009,
+	0x0081, 0x00c8, 0x2009, 0x00ef, 0x00f6, 0x2079, 0x0100, 0x79ea,
+	0x7932, 0x7936, 0x780c, 0xc0b5, 0x780e, 0x00fe, 0x080c, 0x2554,
+	0x00f6, 0x2079, 0x1800, 0x797e, 0x2100, 0x900e, 0x080c, 0x250b,
+	0x795a, 0x00fe, 0x8108, 0x080c, 0x5f91, 0x2b00, 0x00ce, 0x1904,
+	0xa5f7, 0x6012, 0x2009, 0x180f, 0x210c, 0xd19c, 0x0150, 0x2009,
+	0x027c, 0x210c, 0x918c, 0x00ff, 0xb912, 0x2009, 0x027d, 0x210c,
+	0xb916, 0x2001, 0x0002, 0x080c, 0x5f42, 0x6023, 0x0001, 0x6003,
+	0x0001, 0x6007, 0x0002, 0x080c, 0x8154, 0x080c, 0x868e, 0x0008,
+	0x0431, 0x00de, 0x009e, 0x00be, 0x0005, 0x2001, 0x1810, 0x2004,
+	0xd0a4, 0x0120, 0x2001, 0x1854, 0x2004, 0xd0ac, 0x0005, 0x00e6,
+	0x080c, 0xd494, 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, 0x5f42, 0x080c, 0x5167, 0x1120, 0x2001,
+	0x0007, 0x080c, 0x5f6e, 0x080c, 0x2ea4, 0x6020, 0x9086, 0x000a,
+	0x1108, 0x0005, 0x0804, 0x9ac8, 0x00b6, 0x00e6, 0x0026, 0x0016,
+	0x2071, 0x1800, 0x708c, 0x9086, 0x0014, 0x1904, 0xa7a9, 0x00d6,
+	0x080c, 0x6d14, 0x0198, 0x0026, 0x2011, 0x0010, 0x080c, 0x6339,
+	0x002e, 0x05c8, 0x080c, 0x5167, 0x1540, 0x6014, 0x2048, 0xa807,
+	0x0000, 0xa867, 0x0103, 0xa833, 0xdead, 0x00f8, 0x0026, 0x2011,
+	0x8008, 0x080c, 0x6339, 0x002e, 0x0530, 0x6014, 0x2048, 0xa864,
+	0x9084, 0x00ff, 0x9086, 0x0039, 0x1140, 0x2001, 0x0030, 0x900e,
+	0x2011, 0x4009, 0x080c, 0xbd65, 0x0040, 0x6014, 0x2048, 0xa807,
+	0x0000, 0xa867, 0x0103, 0xa833, 0xdead, 0x6010, 0x2058, 0xb9a0,
+	0x0016, 0x080c, 0x2ea4, 0x080c, 0x9ac8, 0x001e, 0x080c, 0x2f76,
+	0x00de, 0x0804, 0xa7ad, 0x00de, 0x080c, 0x5167, 0x1170, 0x6014,
+	0x9005, 0x1158, 0x0036, 0x0046, 0x6010, 0x2058, 0xbba0, 0x2021,
+	0x0006, 0x080c, 0x4856, 0x004e, 0x003e, 0x00d6, 0x6010, 0x2058,
+	0x080c, 0x608c, 0x080c, 0xa56d, 0x00de, 0x080c, 0xa9ef, 0x1588,
+	0x6010, 0x2058, 0xb890, 0x9005, 0x0560, 0x2001, 0x0006, 0x080c,
+	0x5f42, 0x0096, 0x6014, 0x904d, 0x01d0, 0xa864, 0x9084, 0x00ff,
+	0x9086, 0x0039, 0x1140, 0x2001, 0x0000, 0x900e, 0x2011, 0x4000,
+	0x080c, 0xbd65, 0x0060, 0xa864, 0x9084, 0x00ff, 0x9086, 0x0029,
+	0x0130, 0xa807, 0x0000, 0xa867, 0x0103, 0xa833, 0x0200, 0x009e,
+	0x080c, 0x2ea4, 0x6020, 0x9086, 0x000a, 0x0138, 0x080c, 0x9ac8,
+	0x0020, 0x080c, 0xa456, 0x080c, 0xa6f7, 0x001e, 0x002e, 0x00ee,
+	0x00be, 0x0005, 0x2011, 0x1823, 0x2204, 0x9086, 0x0014, 0x1160,
+	0x2001, 0x0002, 0x080c, 0x5f42, 0x6003, 0x0001, 0x6007, 0x0001,
+	0x080c, 0x8154, 0x0804, 0x868e, 0x0804, 0xa6f7, 0x2030, 0x2011,
+	0x1823, 0x2204, 0x9086, 0x0004, 0x1148, 0x96b6, 0x000b, 0x1120,
+	0x2001, 0x0007, 0x080c, 0x5f42, 0x0804, 0x9ac8, 0x0804, 0xa6f7,
+	0x0002, 0xa537, 0xa7f0, 0xa537, 0xa82f, 0xa537, 0xa8da, 0xa7e5,
+	0xa537, 0xa537, 0xa8ed, 0xa537, 0xa8fd, 0x6604, 0x9686, 0x0003,
+	0x0904, 0xa70c, 0x96b6, 0x001e, 0x1110, 0x080c, 0x9ac8, 0x0005,
+	0x00b6, 0x00d6, 0x00c6, 0x080c, 0xa90d, 0x11a0, 0x9006, 0x080c,
+	0x5f2e, 0x080c, 0x2e7f, 0x080c, 0xbe9b, 0x2001, 0x0002, 0x080c,
+	0x5f42, 0x6003, 0x0001, 0x6007, 0x0002, 0x080c, 0x8154, 0x080c,
+	0x868e, 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, 0x2e7f, 0x080c,
+	0xbe9b, 0x080c, 0xa6f7, 0x00ce, 0x00de, 0x00be, 0x0005, 0x0096,
+	0x00b6, 0x0026, 0x9016, 0x080c, 0xa91b, 0x00d6, 0x2069, 0x194d,
+	0x2d04, 0x9005, 0x0168, 0x6010, 0x2058, 0xb8a0, 0x9086, 0x007e,
+	0x1138, 0x2069, 0x181f, 0x2d04, 0x8000, 0x206a, 0x00de, 0x0010,
+	0x00de, 0x0088, 0x9006, 0x080c, 0x5f2e, 0x2001, 0x0002, 0x080c,
+	0x5f42, 0x6003, 0x0001, 0x6007, 0x0002, 0x080c, 0x8154, 0x080c,
+	0x868e, 0x0804, 0xa8aa, 0x080c, 0xb793, 0x01b0, 0x6014, 0x2048,
+	0xa864, 0x2010, 0x9086, 0x0139, 0x1138, 0x6007, 0x0016, 0x2001,
+	0x0002, 0x080c, 0xbdbf, 0x00b0, 0x6014, 0x2048, 0xa864, 0xd0fc,
+	0x0118, 0x2001, 0x0001, 0x0ca8, 0x2001, 0x180e, 0x2004, 0xd0dc,
+	0x0148, 0x6010, 0x2058, 0xb840, 0x9084, 0x00ff, 0x9005, 0x1110,
+	0x9006, 0x0c38, 0x080c, 0xa456, 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, 0x5f42, 0x2001, 0x0028, 0x601a, 0x6007, 0x0052, 0x0010,
+	0x080c, 0xa6f7, 0x002e, 0x00be, 0x009e, 0x0005, 0x9286, 0x0139,
+	0x0160, 0x6014, 0x2048, 0x080c, 0xb793, 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, 0x5a27, 0x00ee, 0x0010, 0x080c,
+	0x2e7f, 0x0870, 0x080c, 0xa91b, 0x1160, 0x2001, 0x0004, 0x080c,
+	0x5f42, 0x6003, 0x0001, 0x6007, 0x0003, 0x080c, 0x8154, 0x0804,
+	0x868e, 0x080c, 0xa456, 0x0804, 0xa6f7, 0x0469, 0x1160, 0x2001,
+	0x0008, 0x080c, 0x5f42, 0x6003, 0x0001, 0x6007, 0x0005, 0x080c,
+	0x8154, 0x0804, 0x868e, 0x0804, 0xa6f7, 0x00e9, 0x1160, 0x2001,
+	0x000a, 0x080c, 0x5f42, 0x6003, 0x0001, 0x6007, 0x0001, 0x080c,
+	0x8154, 0x0804, 0x868e, 0x0804, 0xa6f7, 0x2009, 0x026e, 0x2104,
+	0x9086, 0x0003, 0x1138, 0x2009, 0x026f, 0x2104, 0x9084, 0xff00,
+	0x9086, 0x2a00, 0x0005, 0x9085, 0x0001, 0x0005, 0x00b6, 0x00c6,
+	0x0016, 0x6110, 0x2158, 0x080c, 0x6000, 0x001e, 0x00ce, 0x00be,
+	0x0005, 0x00b6, 0x00f6, 0x00e6, 0x00d6, 0x0036, 0x0016, 0x6010,
+	0x2058, 0x2009, 0x1836, 0x2104, 0x9085, 0x0003, 0x200a, 0x080c,
+	0xa9c1, 0x0560, 0x2009, 0x1836, 0x2104, 0xc0cd, 0x200a, 0x080c,
+	0x6311, 0x0158, 0x9006, 0x2020, 0x2009, 0x002a, 0x080c, 0xd188,
+	0x2001, 0x180c, 0x200c, 0xc195, 0x2102, 0x2019, 0x002a, 0x2009,
+	0x0001, 0x080c, 0x2e4a, 0x00e6, 0x2071, 0x1800, 0x080c, 0x2c63,
+	0x00ee, 0x00c6, 0x0156, 0x20a9, 0x0781, 0x2009, 0x007f, 0x080c,
+	0x2f76, 0x8108, 0x1f04, 0xa95f, 0x015e, 0x00ce, 0x080c, 0xa91e,
+	0x2071, 0x0260, 0x2079, 0x0200, 0x7817, 0x0001, 0x2001, 0x1836,
+	0x200c, 0xc1c5, 0x7018, 0xd0fc, 0x0110, 0xd0dc, 0x0118, 0x7038,
+	0xd0dc, 0x1108, 0xc1c4, 0x7817, 0x0000, 0x2001, 0x1836, 0x2102,
+	0x2079, 0x0100, 0x2e04, 0x9084, 0x00ff, 0x2069, 0x181e, 0x206a,
+	0x78e6, 0x0006, 0x8e70, 0x2e04, 0x2069, 0x181f, 0x206a, 0x78ea,
+	0x7832, 0x7836, 0x2010, 0x9084, 0xff00, 0x001e, 0x9105, 0x2009,
+	0x182b, 0x200a, 0x2200, 0x9084, 0x00ff, 0x2008, 0x080c, 0x2554,
+	0x080c, 0x6d14, 0x0170, 0x2071, 0x0260, 0x2069, 0x1951, 0x7048,
+	0x206a, 0x704c, 0x6806, 0x7050, 0x680a, 0x7054, 0x680e, 0x080c,
+	0xbb9b, 0x0040, 0x2001, 0x0006, 0x080c, 0x5f42, 0x080c, 0x2ea4,
+	0x080c, 0x9ac8, 0x001e, 0x003e, 0x00de, 0x00ee, 0x00fe, 0x00be,
+	0x0005, 0x0096, 0x0026, 0x0036, 0x00e6, 0x0156, 0x2019, 0x182b,
+	0x231c, 0x83ff, 0x01f0, 0x2071, 0x0260, 0x7200, 0x9294, 0x00ff,
+	0x7004, 0x9084, 0xff00, 0x9205, 0x9306, 0x1198, 0x2011, 0x0276,
+	0x20a9, 0x0004, 0x2b48, 0x2019, 0x000a, 0x080c, 0xaaa3, 0x1148,
+	0x2011, 0x027a, 0x20a9, 0x0004, 0x2019, 0x0006, 0x080c, 0xaaa3,
+	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, 0x7250, 0x7070, 0x9202, 0x1a04, 0xaa7b, 0x080c,
+	0xd1b4, 0x0904, 0xaa74, 0x6720, 0x9786, 0x0007, 0x0904, 0xaa74,
+	0x2500, 0x9c06, 0x0904, 0xaa74, 0x2400, 0x9c06, 0x05e8, 0x3e08,
+	0x9186, 0x0002, 0x1148, 0x6010, 0x9005, 0x0130, 0x00b6, 0x2058,
+	0xb800, 0x00be, 0xd0bc, 0x1580, 0x00c6, 0x6000, 0x9086, 0x0004,
+	0x1110, 0x080c, 0x185b, 0x9786, 0x000a, 0x0148, 0x080c, 0xb992,
+	0x1130, 0x00ce, 0x080c, 0xa456, 0x080c, 0x9af8, 0x00e8, 0x6014,
+	0x2048, 0x080c, 0xb793, 0x01a8, 0x9786, 0x0003, 0x1530, 0xa867,
+	0x0103, 0xab7a, 0xa877, 0x0000, 0xa87c, 0xd0cc, 0x0130, 0x0096,
+	0xa878, 0x2048, 0x080c, 0x0f9e, 0x009e, 0x080c, 0x65e5, 0x080c,
+	0xb975, 0x080c, 0x9af8, 0x00ce, 0x9ce0, 0x0018, 0x7064, 0x9c02,
+	0x1210, 0x0804, 0xaa22, 0x012e, 0x000e, 0x002e, 0x004e, 0x005e,
+	0x007e, 0x00ce, 0x009e, 0x00ee, 0x0005, 0x9786, 0x0006, 0x1118,
+	0x080c, 0xd133, 0x0c30, 0x9786, 0x000a, 0x0998, 0x0880, 0x220c,
+	0x2304, 0x9106, 0x1130, 0x8210, 0x8318, 0x1f04, 0xaa8f, 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, 0x0db4, 0x080c, 0xb981, 0x0120, 0x080c, 0xb992, 0x0168,
+	0x0028, 0x080c, 0x2ea4, 0x080c, 0xb992, 0x0138, 0x080c, 0x8589,
+	0x080c, 0x9ac8, 0x080c, 0x868e, 0x0005, 0x080c, 0xa456, 0x0cb0,
+	0x9182, 0x0054, 0x1220, 0x9182, 0x0040, 0x0208, 0x000a, 0x0005,
+	0xab04, 0xab04, 0xab04, 0xab04, 0xab04, 0xab04, 0xab04, 0xab04,
+	0xab04, 0xab04, 0xab04, 0xab06, 0xab06, 0xab06, 0xab06, 0xab04,
+	0xab04, 0xab04, 0xab06, 0xab04, 0x080c, 0x0db4, 0x600b, 0xffff,
+	0x6003, 0x0001, 0x6106, 0x080c, 0x810c, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x868e, 0x012e, 0x0005, 0x9186, 0x0013, 0x1128, 0x6004,
+	0x9082, 0x0040, 0x0804, 0xabbb, 0x9186, 0x0027, 0x1520, 0x080c,
+	0x8589, 0x080c, 0x2e7f, 0x080c, 0xbe9b, 0x0096, 0x6114, 0x2148,
+	0x080c, 0xb793, 0x0198, 0x080c, 0xb992, 0x1118, 0x080c, 0xa456,
+	0x0068, 0xa867, 0x0103, 0xa87b, 0x0029, 0xa877, 0x0000, 0xa97c,
+	0xc1c5, 0xa97e, 0x080c, 0x65f2, 0x080c, 0xb975, 0x009e, 0x080c,
+	0x9ac8, 0x0804, 0x868e, 0x9186, 0x0014, 0x1120, 0x6004, 0x9082,
+	0x0040, 0x04a0, 0x9186, 0x0046, 0x0150, 0x9186, 0x0045, 0x0138,
+	0x9186, 0x0053, 0x0120, 0x9186, 0x0048, 0x190c, 0x0db4, 0x2001,
+	0x0109, 0x2004, 0xd084, 0x0508, 0x0126, 0x2091, 0x2800, 0x0006,
+	0x0016, 0x0026, 0x0036, 0x00f6, 0x00e6, 0x00c6, 0x2079, 0x19b6,
+	0x2071, 0x1800, 0x2061, 0x0100, 0x080c, 0x7ff8, 0x00ce, 0x00ee,
+	0x00fe, 0x003e, 0x002e, 0x001e, 0x000e, 0x012e, 0xa001, 0x6000,
+	0x9086, 0x0002, 0x1110, 0x0804, 0xabf9, 0x0005, 0x0002, 0xab95,
+	0xab93, 0xab93, 0xab93, 0xab93, 0xab93, 0xab93, 0xab93, 0xab93,
+	0xab93, 0xab93, 0xabb0, 0xabb0, 0xabb0, 0xabb0, 0xab93, 0xabb0,
+	0xab93, 0xabb0, 0xab93, 0x080c, 0x0db4, 0x080c, 0x8589, 0x0096,
+	0x6114, 0x2148, 0x080c, 0xb793, 0x0168, 0xa867, 0x0103, 0xa87b,
+	0x0006, 0xa877, 0x0000, 0xa880, 0xc0ec, 0xa882, 0x080c, 0x65f2,
+	0x080c, 0xb975, 0x009e, 0x080c, 0x9ac8, 0x080c, 0x868e, 0x0005,
+	0x080c, 0x8589, 0x080c, 0xb992, 0x090c, 0xa456, 0x080c, 0x9ac8,
+	0x080c, 0x868e, 0x0005, 0x0002, 0xabd2, 0xabd0, 0xabd0, 0xabd0,
+	0xabd0, 0xabd0, 0xabd0, 0xabd0, 0xabd0, 0xabd0, 0xabd0, 0xabe9,
+	0xabe9, 0xabe9, 0xabe9, 0xabd0, 0xabf3, 0xabd0, 0xabe9, 0xabd0,
+	0x080c, 0x0db4, 0x0096, 0x080c, 0x8589, 0x6014, 0x2048, 0x2001,
+	0x1957, 0x2004, 0x6042, 0xa97c, 0xd1ac, 0x0140, 0x6003, 0x0004,
+	0xa87c, 0x9085, 0x0400, 0xa87e, 0x009e, 0x0005, 0x6003, 0x0002,
+	0x0cb8, 0x080c, 0x8589, 0x080c, 0xbe9e, 0x080c, 0xbea3, 0x6003,
+	0x000f, 0x0804, 0x868e, 0x080c, 0x8589, 0x080c, 0x9ac8, 0x0804,
+	0x868e, 0x9182, 0x0054, 0x1220, 0x9182, 0x0040, 0x0208, 0x000a,
+	0x0005, 0xac15, 0xac15, 0xac15, 0xac15, 0xac15, 0xac17, 0xacf4,
+	0xac15, 0xad28, 0xac15, 0xac15, 0xac15, 0xac15, 0xac15, 0xac15,
+	0xac15, 0xac15, 0xac15, 0xac15, 0xad28, 0x080c, 0x0db4, 0x00b6,
+	0x0096, 0x6114, 0x2148, 0x7644, 0x96b4, 0x0fff, 0x86ff, 0x1528,
+	0x6010, 0x2058, 0xb800, 0xd0bc, 0x1904, 0xace3, 0xa87b, 0x0000,
+	0xa867, 0x0103, 0xae76, 0xa87c, 0xd0ac, 0x0128, 0xa834, 0xa938,
+	0x9115, 0x190c, 0xaebd, 0x080c, 0x640d, 0x6210, 0x2258, 0xba3c,
+	0x82ff, 0x0110, 0x8211, 0xba3e, 0x7044, 0xd0e4, 0x1904, 0xacc7,
+	0x080c, 0x9ac8, 0x009e, 0x00be, 0x0005, 0x968c, 0x0c00, 0x0150,
+	0x6010, 0x2058, 0xb800, 0xd0bc, 0x1904, 0xaccb, 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,
+	0xac1e, 0x735c, 0xab86, 0x83ff, 0x0170, 0x938a, 0x0009, 0x0210,
+	0x2019, 0x0008, 0x0036, 0x2308, 0x2019, 0x0018, 0x2011, 0x0025,
+	0x080c, 0xb3a8, 0x003e, 0xd6cc, 0x0904, 0xac33, 0x7154, 0xa98a,
+	0x81ff, 0x0904, 0xac33, 0x9192, 0x0021, 0x1278, 0x8304, 0x9098,
+	0x0018, 0x2011, 0x0029, 0x080c, 0xb3a8, 0x2011, 0x0205, 0x2013,
+	0x0000, 0x080c, 0xbe2b, 0x0804, 0xac33, 0xa868, 0xd0fc, 0x0120,
+	0x2009, 0x0020, 0xa98a, 0x0c50, 0x00a6, 0x2950, 0x080c, 0xb347,
+	0x00ae, 0x080c, 0xbe2b, 0x080c, 0xb398, 0x0804, 0xac35, 0x080c,
+	0xba85, 0x0804, 0xac42, 0xa87c, 0xd0ac, 0x0904, 0xac4e, 0xa880,
+	0xd0bc, 0x1904, 0xac4e, 0x7348, 0xa838, 0x9306, 0x11c8, 0x734c,
+	0xa834, 0x931e, 0x0904, 0xac4e, 0xd6d4, 0x0190, 0xab38, 0x9305,
+	0x0904, 0xac4e, 0x0068, 0xa87c, 0xd0ac, 0x0904, 0xac26, 0xa838,
+	0xa934, 0x9105, 0x0904, 0xac26, 0xa880, 0xd0bc, 0x1904, 0xac26,
+	0x080c, 0xbabf, 0x0804, 0xac42, 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, 0x19aa, 0x080c, 0x8171, 0x080c, 0x8769, 0x009e, 0x0005,
+	0x0005, 0x9182, 0x0054, 0x1220, 0x9182, 0x0040, 0x0208, 0x000a,
+	0x0005, 0xad45, 0xad45, 0xad45, 0xad45, 0xad45, 0xad47, 0xaddd,
+	0xad45, 0xad45, 0xadf4, 0xae80, 0xad45, 0xad45, 0xad45, 0xad45,
+	0xae95, 0xad45, 0xad45, 0xad45, 0xad45, 0x080c, 0x0db4, 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, 0xadd8, 0x9694, 0xff00, 0x9284, 0x0c00, 0x0120, 0x7048,
+	0xb092, 0x704c, 0xb08e, 0x9284, 0x0300, 0x0904, 0xadd8, 0x080c,
+	0x0fec, 0x090c, 0x0db4, 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, 0xb3a8,
+	0x003e, 0xd6cc, 0x01e8, 0x7154, 0xa98a, 0x81ff, 0x01c8, 0x9192,
+	0x0021, 0x1260, 0x8304, 0x9098, 0x0018, 0x2011, 0x0029, 0x080c,
+	0xb3a8, 0x2011, 0x0205, 0x2013, 0x0000, 0x0050, 0xb068, 0xd0fc,
+	0x0120, 0x2009, 0x0020, 0xa98a, 0x0c68, 0x2950, 0x080c, 0xb347,
+	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, 0x19aa, 0x0804, 0x908e, 0x6003, 0x0002, 0x6004, 0x9086,
+	0x0040, 0x11c8, 0x0096, 0x6014, 0x2048, 0xa87c, 0xd0ac, 0x0160,
+	0x601c, 0xd084, 0x1130, 0x00f6, 0x2c00, 0x2078, 0x080c, 0x15ad,
+	0x00fe, 0x6003, 0x0004, 0x0010, 0x6003, 0x0002, 0x009e, 0x080c,
+	0x8589, 0x080c, 0x868e, 0x0096, 0x2001, 0x1957, 0x2004, 0x6042,
+	0x080c, 0x863e, 0x080c, 0x8769, 0x6114, 0x2148, 0xa97c, 0xd1e4,
+	0x0904, 0xae7b, 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, 0x0f9e, 0x001e, 0x0440, 0x0016,
+	0x080c, 0x0f9e, 0x009e, 0xa974, 0x0016, 0x080c, 0xb398, 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, 0x640d, 0x001e, 0xd1e4,
+	0x1120, 0x080c, 0x9ac8, 0x009e, 0x0005, 0x080c, 0xba85, 0x0cd8,
+	0x6004, 0x9086, 0x0040, 0x1120, 0x080c, 0x8589, 0x080c, 0x868e,
+	0x2019, 0x0001, 0x080c, 0x935a, 0x6003, 0x0002, 0x080c, 0xbea3,
+	0x080c, 0x863e, 0x080c, 0x8769, 0x0005, 0x6004, 0x9086, 0x0040,
+	0x1120, 0x080c, 0x8589, 0x080c, 0x868e, 0x2019, 0x0001, 0x080c,
+	0x935a, 0x080c, 0x863e, 0x080c, 0x2e7f, 0x080c, 0xbe9b, 0x0096,
+	0x6114, 0x2148, 0x080c, 0xb793, 0x0150, 0xa867, 0x0103, 0xa87b,
+	0x0029, 0xa877, 0x0000, 0x080c, 0x65f2, 0x080c, 0xb975, 0x009e,
+	0x080c, 0x9ac8, 0x080c, 0x8769, 0x0005, 0xa87b, 0x0015, 0xd1fc,
+	0x0180, 0xa87b, 0x0007, 0x8002, 0x8000, 0x810a, 0x9189, 0x0000,
+	0x0006, 0x0016, 0x2009, 0x1a47, 0x2104, 0x8000, 0x200a, 0x001e,
+	0x000e, 0xa992, 0xa88e, 0x0005, 0x9182, 0x0054, 0x1220, 0x9182,
+	0x0040, 0x0208, 0x000a, 0x0005, 0xaef0, 0xaef0, 0xaef0, 0xaef0,
+	0xaef0, 0xaef2, 0xaef0, 0xaef0, 0xaf98, 0xaef0, 0xaef0, 0xaef0,
+	0xaef0, 0xaef0, 0xaef0, 0xaef0, 0xaef0, 0xaef0, 0xaef0, 0xb0c9,
+	0x080c, 0x0db4, 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, 0xaf91, 0x9694, 0xff00, 0x9284,
+	0x0c00, 0x0120, 0x7048, 0xb092, 0x704c, 0xb08e, 0x9284, 0x0300,
+	0x0904, 0xaf91, 0x9686, 0x0100, 0x1130, 0x7064, 0x9005, 0x1118,
+	0xc6c4, 0xb676, 0x0c38, 0x080c, 0x0fec, 0x090c, 0x0db4, 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,
+	0xb3a8, 0x003e, 0xd6cc, 0x01e8, 0x7154, 0xa98a, 0x81ff, 0x01c8,
+	0x9192, 0x0021, 0x1260, 0x8304, 0x9098, 0x0018, 0x2011, 0x0029,
+	0x080c, 0xb3a8, 0x2011, 0x0205, 0x2013, 0x0000, 0x0050, 0xb068,
+	0xd0fc, 0x0120, 0x2009, 0x0020, 0xa98a, 0x0c68, 0x2950, 0x080c,
+	0xb347, 0x080c, 0x1839, 0x009e, 0x00ee, 0x00ae, 0x007e, 0x0005,
+	0x2001, 0x1957, 0x2004, 0x6042, 0x0096, 0x6114, 0x2148, 0xa83c,
+	0xa940, 0x9105, 0x1118, 0xa87c, 0xc0dc, 0xa87e, 0x6003, 0x0002,
+	0xa97c, 0xd1e4, 0x0904, 0xb0c4, 0x6043, 0x0000, 0x6010, 0x00b6,
+	0x2058, 0xb800, 0x00be, 0xd0bc, 0x1500, 0xd1cc, 0x0904, 0xb093,
+	0xa978, 0xa868, 0xd0fc, 0x0904, 0xb054, 0x0016, 0xa87c, 0x0006,
+	0xa880, 0x0006, 0x00a6, 0x2150, 0xb174, 0x9184, 0x00ff, 0x90b6,
+	0x0002, 0x0904, 0xb022, 0x9086, 0x0028, 0x1904, 0xb00e, 0xa87b,
+	0x001c, 0xb07b, 0x001c, 0x0804, 0xb02a, 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,
+	0x0f9e, 0x009e, 0x080c, 0xbabf, 0x0804, 0xb0c4, 0xd1dc, 0x0158,
+	0xa87b, 0x0015, 0xb07b, 0x0015, 0x080c, 0xbd4e, 0x0118, 0xb174,
+	0xc1dc, 0xb176, 0x0078, 0xd1d4, 0x0128, 0xa87b, 0x0007, 0xb07b,
+	0x0007, 0x0040, 0xa87c, 0xd0ac, 0x0128, 0xa834, 0xa938, 0x9115,
+	0x190c, 0xaebd, 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, 0xbe2b, 0x001e, 0xa874, 0x0006, 0x2148, 0x080c,
+	0x0f9e, 0x001e, 0x0804, 0xb0c0, 0x0016, 0x00a6, 0x2150, 0xb174,
+	0x9184, 0x00ff, 0x90b6, 0x0002, 0x01e0, 0x9086, 0x0028, 0x1128,
+	0xa87b, 0x001c, 0xb07b, 0x001c, 0x00e0, 0xd1dc, 0x0158, 0xa87b,
+	0x0015, 0xb07b, 0x0015, 0x080c, 0xbd4e, 0x0118, 0xb174, 0xc1dc,
+	0xb176, 0x0078, 0xd1d4, 0x0128, 0xa87b, 0x0007, 0xb07b, 0x0007,
+	0x0040, 0xa87c, 0xd0ac, 0x0128, 0xa834, 0xa938, 0x9115, 0x190c,
+	0xaebd, 0xa890, 0xb092, 0xa88c, 0xb08e, 0xa87c, 0xb07e, 0x00ae,
+	0x080c, 0x0f9e, 0x009e, 0x080c, 0xbe2b, 0xa974, 0x0016, 0x080c,
+	0xb398, 0x001e, 0x0468, 0xa867, 0x0103, 0xa974, 0x9184, 0x00ff,
+	0x90b6, 0x0002, 0x01b0, 0x9086, 0x0028, 0x1118, 0xa87b, 0x001c,
+	0x00d0, 0xd1dc, 0x0148, 0xa87b, 0x0015, 0x080c, 0xbd4e, 0x0118,
+	0xa974, 0xc1dc, 0xa976, 0x0078, 0xd1d4, 0x0118, 0xa87b, 0x0007,
+	0x0050, 0xa87b, 0x0000, 0xa87c, 0xd0ac, 0x0128, 0xa834, 0xa938,
+	0x9115, 0x190c, 0xaebd, 0xa974, 0x0016, 0x080c, 0x640d, 0x001e,
+	0xd1e4, 0x1120, 0x080c, 0x9ac8, 0x009e, 0x0005, 0x080c, 0xba85,
+	0x0cd8, 0x6114, 0x0096, 0x2148, 0xa97c, 0xd1e4, 0x190c, 0x1847,
+	0x009e, 0x0005, 0x080c, 0x8589, 0x0010, 0x080c, 0x863e, 0x080c,
+	0xb793, 0x01f0, 0x0096, 0x6114, 0x2148, 0x080c, 0xb992, 0x1118,
+	0x080c, 0xa456, 0x00a0, 0xa867, 0x0103, 0x2009, 0x180c, 0x210c,
+	0xd18c, 0x11b8, 0xd184, 0x1190, 0x6108, 0xa97a, 0x918e, 0x0029,
+	0x1110, 0x080c, 0xd42c, 0xa877, 0x0000, 0x080c, 0x65f2, 0x009e,
+	0x080c, 0x9ac8, 0x080c, 0x868e, 0x0804, 0x8769, 0xa87b, 0x0004,
+	0x0c90, 0xa87b, 0x0004, 0x0c78, 0x9182, 0x0054, 0x1220, 0x9182,
+	0x0040, 0x0208, 0x000a, 0x0005, 0xb120, 0xb120, 0xb120, 0xb120,
+	0xb120, 0xb122, 0xb120, 0xb120, 0xb120, 0xb120, 0xb120, 0xb120,
+	0xb120, 0xb120, 0xb120, 0xb120, 0xb120, 0xb120, 0xb120, 0xb120,
+	0x080c, 0x0db4, 0x080c, 0x515b, 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, 0x65f2, 0x009e, 0x0804, 0x9ac8, 0x9182, 0x0085,
+	0x0002, 0xb158, 0xb156, 0xb156, 0xb164, 0xb156, 0xb156, 0xb156,
+	0xb156, 0xb156, 0xb156, 0xb156, 0xb156, 0xb156, 0x080c, 0x0db4,
+	0x6003, 0x0001, 0x6106, 0x080c, 0x810c, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x868e, 0x012e, 0x0005, 0x0026, 0x0056, 0x00d6, 0x00e6,
+	0x2071, 0x0260, 0x7224, 0x6216, 0x7220, 0x080c, 0xb781, 0x01a0,
+	0x2268, 0x6800, 0x9086, 0x0000, 0x0178, 0x6010, 0x6d10, 0x952e,
+	0x1158, 0x00c6, 0x2d60, 0x080c, 0xb3d3, 0x00ce, 0x0128, 0x6803,
+	0x0002, 0x6007, 0x0086, 0x0010, 0x6007, 0x0087, 0x6003, 0x0001,
+	0x080c, 0x810c, 0x080c, 0x868e, 0x9280, 0x0004, 0x00b6, 0x2058,
+	0xb800, 0x00be, 0xd0bc, 0x0140, 0x6824, 0xd0ec, 0x0128, 0x00c6,
+	0x2260, 0x080c, 0xbabf, 0x00ce, 0x00ee, 0x00de, 0x005e, 0x002e,
+	0x0005, 0x9186, 0x0013, 0x1160, 0x6004, 0x908a, 0x0085, 0x0a0c,
+	0x0db4, 0x908a, 0x0092, 0x1a0c, 0x0db4, 0x9082, 0x0085, 0x00e2,
+	0x9186, 0x0027, 0x0120, 0x9186, 0x0014, 0x190c, 0x0db4, 0x080c,
+	0x8589, 0x0096, 0x6014, 0x2048, 0x080c, 0xb793, 0x0140, 0xa867,
+	0x0103, 0xa877, 0x0000, 0xa87b, 0x0029, 0x080c, 0x65f2, 0x009e,
+	0x080c, 0x9af8, 0x0804, 0x868e, 0xb1d9, 0xb1db, 0xb1db, 0xb1d9,
+	0xb1d9, 0xb1d9, 0xb1d9, 0xb1d9, 0xb1d9, 0xb1d9, 0xb1d9, 0xb1d9,
+	0xb1d9, 0x080c, 0x0db4, 0x080c, 0x8589, 0x080c, 0x9af8, 0x080c,
+	0x868e, 0x0005, 0x9186, 0x0013, 0x1128, 0x6004, 0x9082, 0x0085,
+	0x2008, 0x04b8, 0x9186, 0x0027, 0x11f8, 0x080c, 0x8589, 0x080c,
+	0x2e7f, 0x080c, 0xbe9b, 0x0096, 0x6014, 0x2048, 0x080c, 0xb793,
+	0x0150, 0xa867, 0x0103, 0xa877, 0x0000, 0xa87b, 0x0029, 0x080c,
+	0x65f2, 0x080c, 0xb975, 0x009e, 0x080c, 0x9ac8, 0x080c, 0x868e,
+	0x0005, 0x080c, 0x9b5d, 0x0ce0, 0x9186, 0x0014, 0x1dd0, 0x080c,
+	0x8589, 0x0096, 0x6014, 0x2048, 0x080c, 0xb793, 0x0d60, 0xa867,
+	0x0103, 0xa877, 0x0000, 0xa87b, 0x0006, 0xa880, 0xc0ec, 0xa882,
+	0x08f0, 0x0002, 0xb231, 0xb22f, 0xb22f, 0xb22f, 0xb22f, 0xb22f,
+	0xb249, 0xb22f, 0xb22f, 0xb22f, 0xb22f, 0xb22f, 0xb22f, 0x080c,
+	0x0db4, 0x080c, 0x8589, 0x6034, 0x908c, 0xff00, 0x810f, 0x9186,
+	0x0039, 0x0118, 0x9186, 0x0035, 0x1118, 0x2001, 0x1955, 0x0010,
+	0x2001, 0x1956, 0x2004, 0x601a, 0x6003, 0x000c, 0x080c, 0x868e,
+	0x0005, 0x080c, 0x8589, 0x6034, 0x908c, 0xff00, 0x810f, 0x9186,
+	0x0039, 0x0118, 0x9186, 0x0035, 0x1118, 0x2001, 0x1955, 0x0010,
+	0x2001, 0x1956, 0x2004, 0x601a, 0x6003, 0x000e, 0x080c, 0x868e,
+	0x0005, 0x9182, 0x0092, 0x1220, 0x9182, 0x0085, 0x0208, 0x0012,
+	0x0804, 0x9b5d, 0xb277, 0xb277, 0xb277, 0xb277, 0xb279, 0xb2c6,
+	0xb277, 0xb277, 0xb277, 0xb277, 0xb277, 0xb277, 0xb277, 0x080c,
+	0x0db4, 0x0096, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc,
+	0x0168, 0x6034, 0x908c, 0xff00, 0x810f, 0x9186, 0x0039, 0x0118,
+	0x9186, 0x0035, 0x1118, 0x009e, 0x0804, 0xb2da, 0x080c, 0xb793,
+	0x1118, 0x080c, 0xb975, 0x0068, 0x6014, 0x2048, 0xa87c, 0xd0e4,
+	0x1110, 0x080c, 0xb975, 0xa867, 0x0103, 0x080c, 0xbe66, 0x080c,
+	0x65f2, 0x00d6, 0x2c68, 0x080c, 0x9a72, 0x01d0, 0x6003, 0x0001,
+	0x6007, 0x001e, 0x600b, 0xffff, 0x2009, 0x026e, 0x210c, 0x613a,
+	0x2009, 0x026f, 0x210c, 0x613e, 0x6910, 0x6112, 0x080c, 0xbc01,
+	0x6954, 0x6156, 0x6023, 0x0001, 0x080c, 0x810c, 0x080c, 0x868e,
+	0x2d60, 0x00de, 0x080c, 0x9ac8, 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, 0xbdfe, 0x11f0, 0x080c,
+	0x9a72, 0x01d8, 0x6106, 0x6003, 0x0001, 0x6023, 0x0001, 0x6910,
+	0x6112, 0x692c, 0x612e, 0x6930, 0x6132, 0x6934, 0x918c, 0x00ff,
+	0x6136, 0x6938, 0x613a, 0x693c, 0x613e, 0x6954, 0x6156, 0x080c,
+	0xbc01, 0x080c, 0x810c, 0x080c, 0x868e, 0x2d60, 0x00de, 0x0804,
+	0x9ac8, 0x0096, 0x6014, 0x2048, 0x080c, 0xb793, 0x01c8, 0xa867,
+	0x0103, 0xa880, 0xd0b4, 0x0128, 0xc0ec, 0xa882, 0xa87b, 0x0006,
+	0x0048, 0xd0bc, 0x0118, 0xa87b, 0x0002, 0x0020, 0xa87b, 0x0005,
+	0x080c, 0xba81, 0xa877, 0x0000, 0x080c, 0x65f2, 0x080c, 0xb975,
+	0x009e, 0x0804, 0x9ac8, 0x0016, 0x0096, 0x6014, 0x2048, 0x080c,
+	0xb793, 0x0140, 0xa867, 0x0103, 0xa87b, 0x0028, 0xa877, 0x0000,
+	0x080c, 0x65f2, 0x009e, 0x001e, 0x9186, 0x0013, 0x0148, 0x9186,
+	0x0014, 0x0130, 0x9186, 0x0027, 0x0118, 0x080c, 0x9b5d, 0x0030,
+	0x080c, 0x8589, 0x080c, 0x9af8, 0x080c, 0x868e, 0x0005, 0x0056,
+	0x0066, 0x0096, 0x00a6, 0x2029, 0x0001, 0x9182, 0x0101, 0x1208,
+	0x0010, 0x2009, 0x0100, 0x2130, 0x8304, 0x9098, 0x0018, 0x2009,
+	0x0020, 0x2011, 0x0029, 0x080c, 0xb3a8, 0x96b2, 0x0020, 0xb004,
+	0x904d, 0x0110, 0x080c, 0x0f9e, 0x080c, 0x0fec, 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, 0x65f2, 0x2a48, 0x0cb8, 0x080c, 0x65f2, 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, 0xb40e, 0xb40e, 0xb409,
+	0xb430, 0xb3fc, 0xb409, 0xb430, 0xb409, 0xb3fc, 0xb3fc, 0xb409,
+	0xb409, 0xb409, 0xb3fc, 0xb3fc, 0x080c, 0x0db4, 0x0036, 0x2019,
+	0x0010, 0x080c, 0xcd45, 0x6023, 0x0006, 0x6003, 0x0007, 0x003e,
+	0x0005, 0x9006, 0x0005, 0x9085, 0x0001, 0x0005, 0x0096, 0x86ff,
+	0x11d8, 0x6014, 0x2048, 0x080c, 0xb793, 0x01c0, 0xa864, 0x9086,
+	0x0139, 0x1128, 0xa87b, 0x0005, 0xa883, 0x0000, 0x0028, 0x900e,
+	0x2001, 0x0005, 0x080c, 0x682c, 0x080c, 0xba81, 0x080c, 0x65e5,
+	0x080c, 0x9af8, 0x9085, 0x0001, 0x009e, 0x0005, 0x9006, 0x0ce0,
+	0x6000, 0x908a, 0x0016, 0x1a0c, 0x0db4, 0x0002, 0xb446, 0xb474,
+	0xb448, 0xb495, 0xb46f, 0xb446, 0xb409, 0xb40e, 0xb40e, 0xb409,
+	0xb409, 0xb409, 0xb409, 0xb409, 0xb409, 0xb409, 0x080c, 0x0db4,
+	0x86ff, 0x1510, 0x6020, 0x9086, 0x0006, 0x01f0, 0x0096, 0x6014,
+	0x2048, 0x080c, 0xb793, 0x0158, 0xa87c, 0xd0cc, 0x0130, 0x0096,
+	0xa878, 0x2048, 0x080c, 0x0f9e, 0x009e, 0x080c, 0xba81, 0x009e,
+	0x080c, 0xbe40, 0x6007, 0x0085, 0x6003, 0x000b, 0x6023, 0x0002,
+	0x080c, 0x810c, 0x080c, 0x868e, 0x9085, 0x0001, 0x0005, 0x0066,
+	0x080c, 0x185b, 0x006e, 0x08a0, 0x00e6, 0x2071, 0x19b6, 0x7024,
+	0x9c06, 0x1120, 0x080c, 0x92e4, 0x00ee, 0x0850, 0x6020, 0x9084,
+	0x000f, 0x9086, 0x0006, 0x1150, 0x0086, 0x0096, 0x2049, 0x0001,
+	0x2c40, 0x080c, 0x9450, 0x009e, 0x008e, 0x0010, 0x080c, 0x91e1,
+	0x00ee, 0x1904, 0xb448, 0x0804, 0xb409, 0x0036, 0x00e6, 0x2071,
+	0x19b6, 0x703c, 0x9c06, 0x1138, 0x901e, 0x080c, 0x935a, 0x00ee,
+	0x003e, 0x0804, 0xb448, 0x080c, 0x9580, 0x00ee, 0x003e, 0x1904,
+	0xb448, 0x0804, 0xb409, 0x00c6, 0x6020, 0x9084, 0x000f, 0x0013,
+	0x00ce, 0x0005, 0xb4c8, 0xb577, 0xb6de, 0xb4d2, 0x9af8, 0xb4c8,
+	0xcd37, 0xbea8, 0xb577, 0xb4c1, 0xb75d, 0xb4c1, 0xb4c1, 0xb4c1,
+	0xb4c1, 0x080c, 0x0db4, 0x080c, 0xb992, 0x1110, 0x080c, 0xa456,
+	0x0005, 0x080c, 0x8589, 0x080c, 0x868e, 0x0804, 0x9ac8, 0x601b,
+	0x0001, 0x0005, 0x080c, 0xb793, 0x0130, 0x6014, 0x0096, 0x2048,
+	0x2c00, 0xa896, 0x009e, 0x6000, 0x908a, 0x0016, 0x1a0c, 0x0db4,
+	0x0002, 0xb4f1, 0xb4f3, 0xb517, 0xb52b, 0xb54f, 0xb4f1, 0xb4c8,
+	0xb4c8, 0xb4c8, 0xb52b, 0xb52b, 0xb4f1, 0xb4f1, 0xb4f1, 0xb4f1,
+	0xb535, 0x080c, 0x0db4, 0x00e6, 0x6014, 0x0096, 0x2048, 0xa880,
+	0xc0b5, 0xa882, 0x009e, 0x2071, 0x19b6, 0x7024, 0x9c06, 0x01a0,
+	0x080c, 0x91e1, 0x080c, 0xbe40, 0x6007, 0x0085, 0x6003, 0x000b,
+	0x6023, 0x0002, 0x2001, 0x1956, 0x2004, 0x601a, 0x080c, 0x810c,
+	0x080c, 0x868e, 0x00ee, 0x0005, 0x601b, 0x0001, 0x0cd8, 0x0096,
+	0x6014, 0x2048, 0xa880, 0xc0b5, 0xa882, 0x009e, 0x080c, 0xbe40,
+	0x6007, 0x0085, 0x6003, 0x000b, 0x6023, 0x0002, 0x080c, 0x810c,
+	0x080c, 0x868e, 0x0005, 0x0096, 0x601b, 0x0001, 0x6014, 0x2048,
+	0xa880, 0xc0b5, 0xa882, 0x009e, 0x0005, 0x080c, 0x515b, 0x01a8,
+	0x6014, 0x0096, 0x904d, 0x0180, 0xa864, 0xa867, 0x0103, 0xa87b,
+	0x0006, 0x9086, 0x0139, 0x1140, 0xa867, 0x0139, 0xa897, 0x4005,
+	0xa89b, 0x0004, 0x080c, 0x65f2, 0x009e, 0x0804, 0x9ac8, 0x6014,
+	0x0096, 0x904d, 0x01f8, 0xa97c, 0xd1e4, 0x01e0, 0x2001, 0x180f,
+	0x2004, 0xd0c4, 0x0110, 0x009e, 0x0005, 0xa884, 0x009e, 0x8003,
+	0x800b, 0x810b, 0x9108, 0x611a, 0x2001, 0x0037, 0x2c08, 0x080c,
+	0x14fc, 0x6000, 0x9086, 0x0004, 0x1120, 0x2009, 0x0048, 0x080c,
+	0x9b42, 0x0005, 0x009e, 0x080c, 0x185b, 0x0804, 0xb517, 0x6000,
+	0x908a, 0x0016, 0x1a0c, 0x0db4, 0x000b, 0x0005, 0xb58e, 0xb4cf,
+	0xb590, 0xb58e, 0xb590, 0xb590, 0xb4c9, 0xb58e, 0xb4c3, 0xb4c3,
+	0xb58e, 0xb58e, 0xb58e, 0xb58e, 0xb58e, 0xb58e, 0x080c, 0x0db4,
+	0x6010, 0x00b6, 0x2058, 0xb804, 0x9084, 0x00ff, 0x00be, 0x908a,
+	0x000c, 0x1a0c, 0x0db4, 0x00b6, 0x0013, 0x00be, 0x0005, 0xb5ab,
+	0xb678, 0xb5ad, 0xb5ed, 0xb5ad, 0xb5ed, 0xb5ad, 0xb5bb, 0xb5ab,
+	0xb5ed, 0xb5ab, 0xb5dc, 0x080c, 0x0db4, 0x6004, 0x908e, 0x0016,
+	0x05c0, 0x908e, 0x0004, 0x05a8, 0x908e, 0x0002, 0x0590, 0x908e,
+	0x0052, 0x0904, 0xb674, 0x6004, 0x080c, 0xb992, 0x0904, 0xb691,
+	0x908e, 0x0004, 0x1110, 0x080c, 0x2ea4, 0x908e, 0x0021, 0x0904,
+	0xb695, 0x908e, 0x0022, 0x0904, 0xb6d9, 0x908e, 0x003d, 0x0904,
+	0xb695, 0x908e, 0x0039, 0x0904, 0xb699, 0x908e, 0x0035, 0x0904,
+	0xb699, 0x908e, 0x001e, 0x0178, 0x908e, 0x0001, 0x1140, 0x6010,
+	0x2058, 0xb804, 0x9084, 0x00ff, 0x9086, 0x0006, 0x0110, 0x080c,
+	0x2e7f, 0x080c, 0xa456, 0x0804, 0x9af8, 0x00c6, 0x00d6, 0x6104,
+	0x9186, 0x0016, 0x0904, 0xb665, 0x9186, 0x0002, 0x1904, 0xb63a,
+	0x2001, 0x1836, 0x2004, 0xd08c, 0x11c8, 0x080c, 0x6d14, 0x11b0,
+	0x080c, 0xbe86, 0x0138, 0x080c, 0x6d37, 0x1120, 0x080c, 0x6c24,
+	0x0804, 0xb6c2, 0x2001, 0x194e, 0x2003, 0x0001, 0x2001, 0x1800,
+	0x2003, 0x0001, 0x080c, 0x6c46, 0x0804, 0xb6c2, 0x6010, 0x2058,
+	0x2001, 0x1836, 0x2004, 0xd0ac, 0x1904, 0xb6c2, 0xb8a0, 0x9084,
+	0xff80, 0x1904, 0xb6c2, 0xb840, 0x9084, 0x00ff, 0x9005, 0x0190,
+	0x8001, 0xb842, 0x6017, 0x0000, 0x6023, 0x0007, 0x601b, 0x0398,
+	0x6043, 0x0000, 0x080c, 0x9a72, 0x0128, 0x2b00, 0x6012, 0x6023,
+	0x0001, 0x0458, 0x00de, 0x00ce, 0x6004, 0x908e, 0x0002, 0x11a0,
+	0x6010, 0x2058, 0xb8a0, 0x9086, 0x007e, 0x1170, 0x2009, 0x1836,
+	0x2104, 0xc085, 0x200a, 0x00e6, 0x2071, 0x1800, 0x080c, 0x5a27,
+	0x00ee, 0x080c, 0xa456, 0x0030, 0x080c, 0xa456, 0x080c, 0x2e7f,
+	0x080c, 0xbe9b, 0x00e6, 0x0126, 0x2091, 0x8000, 0x080c, 0x2ea4,
+	0x012e, 0x00ee, 0x080c, 0x9af8, 0x0005, 0x2001, 0x0002, 0x080c,
+	0x5f42, 0x6003, 0x0001, 0x6007, 0x0002, 0x080c, 0x8154, 0x080c,
+	0x868e, 0x00de, 0x00ce, 0x0c80, 0x080c, 0x2ea4, 0x0804, 0xb5e9,
+	0x00c6, 0x00d6, 0x6104, 0x9186, 0x0016, 0x0d38, 0x6010, 0x2058,
+	0xb840, 0x9084, 0x00ff, 0x9005, 0x0904, 0xb63a, 0x8001, 0xb842,
+	0x6003, 0x0001, 0x080c, 0x8154, 0x080c, 0x868e, 0x00de, 0x00ce,
+	0x0898, 0x080c, 0xa456, 0x0804, 0xb5eb, 0x080c, 0xa492, 0x0804,
+	0xb5eb, 0x00d6, 0x2c68, 0x6104, 0x080c, 0xbdfe, 0x00de, 0x0118,
+	0x080c, 0x9ac8, 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, 0x810c, 0x080c,
+	0x868e, 0x0005, 0x00de, 0x00ce, 0x080c, 0xa456, 0x080c, 0x2e7f,
+	0x00e6, 0x0126, 0x2091, 0x8000, 0x080c, 0x2ea4, 0x6017, 0x0000,
+	0x6023, 0x0007, 0x601b, 0x0398, 0x6043, 0x0000, 0x012e, 0x00ee,
+	0x0005, 0x080c, 0x9ef7, 0x1904, 0xb691, 0x0005, 0x6000, 0x908a,
+	0x0016, 0x1a0c, 0x0db4, 0x0096, 0x00d6, 0x001b, 0x00de, 0x009e,
+	0x0005, 0xb6f9, 0xb6f9, 0xb6f9, 0xb6f9, 0xb6f9, 0xb6f9, 0xb6f9,
+	0xb6f9, 0xb6f9, 0xb4c8, 0xb6f9, 0xb4cf, 0xb6fb, 0xb4cf, 0xb708,
+	0xb6f9, 0x080c, 0x0db4, 0x6004, 0x9086, 0x008b, 0x0148, 0x6007,
+	0x008b, 0x6003, 0x000d, 0x080c, 0x810c, 0x080c, 0x868e, 0x0005,
+	0x080c, 0xbe7a, 0x0118, 0x080c, 0xbe8d, 0x0010, 0x080c, 0xbe9b,
+	0x080c, 0xb975, 0x080c, 0xb793, 0x0570, 0x080c, 0x2e7f, 0x080c,
+	0xb793, 0x0168, 0x6014, 0x2048, 0xa867, 0x0103, 0xa87b, 0x0006,
+	0xa877, 0x0000, 0xa880, 0xc0ed, 0xa882, 0x080c, 0x65f2, 0x2c68,
+	0x080c, 0x9a72, 0x0150, 0x6810, 0x6012, 0x080c, 0xbc01, 0x00c6,
+	0x2d60, 0x080c, 0x9af8, 0x00ce, 0x0008, 0x2d60, 0x6017, 0x0000,
+	0x6023, 0x0001, 0x6007, 0x0001, 0x6003, 0x0001, 0x080c, 0x8154,
+	0x080c, 0x868e, 0x00c8, 0x080c, 0xbe7a, 0x0138, 0x6034, 0x9086,
+	0x4000, 0x1118, 0x080c, 0x2e7f, 0x08d0, 0x6034, 0x908c, 0xff00,
+	0x810f, 0x9186, 0x0039, 0x0118, 0x9186, 0x0035, 0x1118, 0x080c,
+	0x2e7f, 0x0868, 0x080c, 0x9af8, 0x0005, 0x6000, 0x908a, 0x0016,
+	0x1a0c, 0x0db4, 0x0002, 0xb773, 0xb773, 0xb775, 0xb775, 0xb775,
+	0xb773, 0xb773, 0x9af8, 0xb773, 0xb773, 0xb773, 0xb773, 0xb773,
+	0xb773, 0xb773, 0xb773, 0x080c, 0x0db4, 0x080c, 0x9580, 0x6114,
+	0x0096, 0x2148, 0xa87b, 0x0006, 0x080c, 0x65f2, 0x009e, 0x0804,
+	0x9ac8, 0x9284, 0x0007, 0x1158, 0x9282, 0x1cd0, 0x0240, 0x2001,
+	0x1819, 0x2004, 0x9202, 0x1218, 0x9085, 0x0001, 0x0005, 0x9006,
+	0x0ce8, 0x0096, 0x0028, 0x0096, 0x0006, 0x6014, 0x2048, 0x000e,
+	0x0006, 0x9984, 0xf000, 0x9086, 0xf000, 0x0110, 0x080c, 0x1097,
+	0x000e, 0x009e, 0x0005, 0x00e6, 0x00c6, 0x0036, 0x0006, 0x0126,
+	0x2091, 0x8000, 0x2061, 0x1cd0, 0x2071, 0x1800, 0x7350, 0x7070,
+	0x9302, 0x1640, 0x6020, 0x9206, 0x11f8, 0x080c, 0xbe86, 0x0180,
+	0x9286, 0x0001, 0x1168, 0x6004, 0x9086, 0x0004, 0x1148, 0x080c,
+	0x2e7f, 0x080c, 0xbe9b, 0x00c6, 0x080c, 0x9af8, 0x00ce, 0x0060,
+	0x080c, 0xbb7b, 0x0148, 0x080c, 0xb992, 0x1110, 0x080c, 0xa456,
+	0x00c6, 0x080c, 0x9ac8, 0x00ce, 0x9ce0, 0x0018, 0x7064, 0x9c02,
+	0x1208, 0x08a0, 0x012e, 0x000e, 0x003e, 0x00ce, 0x00ee, 0x0005,
+	0x00e6, 0x00c6, 0x0016, 0x9188, 0x1000, 0x210c, 0x81ff, 0x0128,
+	0x2061, 0x1a77, 0x6112, 0x080c, 0x2e7f, 0x9006, 0x0010, 0x9085,
+	0x0001, 0x001e, 0x00ce, 0x00ee, 0x0005, 0x00c6, 0x0126, 0x2091,
+	0x8000, 0x080c, 0x9a72, 0x01d8, 0x080c, 0x515b, 0x0110, 0x662e,
+	0x0008, 0x6616, 0x2b00, 0x6012, 0x080c, 0x515b, 0x0118, 0x080c,
+	0xb8b9, 0x0168, 0x080c, 0xbc01, 0x6023, 0x0003, 0x2009, 0x004b,
+	0x080c, 0x9b42, 0x9085, 0x0001, 0x012e, 0x00ce, 0x0005, 0x9006,
+	0x0cd8, 0x00c6, 0x0126, 0x2091, 0x8000, 0xbaa0, 0x080c, 0x9b15,
+	0x0590, 0x080c, 0x515b, 0x0118, 0x602f, 0x0000, 0x0010, 0x6017,
+	0x0000, 0x2b00, 0x6012, 0x080c, 0xbc01, 0x6023, 0x0003, 0x0016,
+	0x080c, 0x828c, 0x0076, 0x903e, 0x080c, 0x8184, 0x2c08, 0x080c,
+	0xcef9, 0x007e, 0x001e, 0xd184, 0x0128, 0x080c, 0x9ac8, 0x9085,
+	0x0001, 0x0070, 0x080c, 0x515b, 0x0128, 0xd18c, 0x1170, 0x080c,
+	0xb8b9, 0x0148, 0x2009, 0x004c, 0x080c, 0x9b42, 0x9085, 0x0001,
+	0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x2900, 0x6016, 0x0c90,
+	0x2009, 0x004d, 0x0010, 0x2009, 0x004e, 0x00f6, 0x00c6, 0x0046,
+	0x0016, 0x080c, 0x9a72, 0x2c78, 0x01d8, 0x080c, 0x515b, 0x0110,
+	0x7e2e, 0x0008, 0x7e16, 0x2b00, 0x7812, 0x7823, 0x0003, 0x2021,
+	0x0005, 0x080c, 0xb8cb, 0x2f60, 0x080c, 0x515b, 0x0118, 0x080c,
+	0xb8b9, 0x0130, 0x001e, 0x0016, 0x080c, 0x9b42, 0x9085, 0x0001,
+	0x001e, 0x004e, 0x00ce, 0x00fe, 0x0005, 0x00f6, 0x00c6, 0x0046,
+	0x080c, 0x9a72, 0x2c78, 0x0530, 0x080c, 0x515b, 0x0110, 0x7e2e,
+	0x0008, 0x7e16, 0x2b00, 0x7812, 0x7823, 0x0003, 0x0096, 0x2021,
+	0x0004, 0x0489, 0x009e, 0x2001, 0x194f, 0x200c, 0xd1fc, 0x0120,
+	0x2f60, 0x080c, 0x9ac8, 0x0060, 0x2f60, 0x080c, 0x515b, 0x0120,
+	0xd18c, 0x1160, 0x0071, 0x0130, 0x2009, 0x0052, 0x080c, 0x9b42,
+	0x9085, 0x0001, 0x004e, 0x00ce, 0x00fe, 0x0005, 0x2900, 0x7816,
+	0x0c98, 0x00c6, 0x080c, 0x4659, 0x00ce, 0x1120, 0x080c, 0x9ac8,
+	0x9006, 0x0005, 0xa867, 0x0000, 0xa86b, 0x8000, 0x2900, 0x6016,
+	0x9085, 0x0001, 0x0005, 0x0096, 0x0076, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x6125, 0x0158, 0x2001, 0xb8d0, 0x0006, 0x900e, 0x2400,
+	0x080c, 0x682c, 0x080c, 0x65f2, 0x000e, 0x0807, 0x2418, 0x080c,
+	0x8523, 0xbaa0, 0x0086, 0x2041, 0x0001, 0x2039, 0x0001, 0x2608,
+	0x080c, 0x82a4, 0x008e, 0x080c, 0x8184, 0x2f08, 0x2648, 0x080c,
+	0xcef9, 0xb93c, 0x81ff, 0x090c, 0x8375, 0x080c, 0x868e, 0x012e,
+	0x007e, 0x009e, 0x0005, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c,
+	0x9a72, 0x0190, 0x660a, 0x2b08, 0x6112, 0x080c, 0xbc01, 0x6023,
+	0x0001, 0x2900, 0x6016, 0x2009, 0x001f, 0x080c, 0x9b42, 0x9085,
+	0x0001, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x00c6, 0x0126,
+	0x2091, 0x8000, 0x080c, 0x9b15, 0x01b8, 0x660a, 0x2b08, 0x6112,
+	0x080c, 0xbc01, 0x6023, 0x0008, 0x2900, 0x6016, 0x00f6, 0x2c78,
+	0x080c, 0x15ad, 0x00fe, 0x2009, 0x0021, 0x080c, 0x9b42, 0x9085,
+	0x0001, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x2009, 0x003d,
+	0x00c6, 0x0126, 0x0016, 0x2091, 0x8000, 0x080c, 0x9a72, 0x0198,
+	0x660a, 0x2b08, 0x6112, 0x080c, 0xbc01, 0x6023, 0x0001, 0x2900,
+	0x6016, 0x001e, 0x0016, 0x080c, 0x9b42, 0x9085, 0x0001, 0x001e,
+	0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd0, 0x00c6, 0x0126, 0x2091,
+	0x8000, 0x080c, 0x9b15, 0x0188, 0x2b08, 0x6112, 0x080c, 0xbc01,
+	0x6023, 0x0001, 0x2900, 0x6016, 0x2009, 0x0000, 0x080c, 0x9b42,
+	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, 0xb793, 0x0168, 0xa864, 0x9086, 0x0139,
+	0x0158, 0x6020, 0x9086, 0x0003, 0x0128, 0xa868, 0xd0fc, 0x0110,
+	0x9006, 0x0010, 0x9085, 0x0001, 0x009e, 0x000e, 0x0005, 0x00c6,
+	0x0126, 0x2091, 0x8000, 0x080c, 0x9b15, 0x0198, 0x2b08, 0x6112,
+	0x080c, 0xbc01, 0x6023, 0x0001, 0x2900, 0x6016, 0x080c, 0x2e7f,
+	0x2009, 0x0028, 0x080c, 0x9b42, 0x9085, 0x0001, 0x012e, 0x00ce,
+	0x0005, 0x9006, 0x0cd8, 0x9186, 0x0015, 0x11a8, 0x2011, 0x1823,
+	0x2204, 0x9086, 0x0074, 0x1178, 0x00b6, 0x080c, 0xa6df, 0x00be,
+	0x080c, 0xa91e, 0x6003, 0x0001, 0x6007, 0x0029, 0x080c, 0x8154,
+	0x080c, 0x868e, 0x0078, 0x6014, 0x0096, 0x2048, 0xa868, 0x009e,
+	0xd0fc, 0x0148, 0x2001, 0x0001, 0x080c, 0xbdbf, 0x080c, 0xa456,
+	0x080c, 0x9ac8, 0x0005, 0x0096, 0x6014, 0x904d, 0x090c, 0x0db4,
+	0xa87b, 0x0030, 0xa883, 0x0000, 0xa897, 0x4005, 0xa89b, 0x0004,
+	0xa867, 0x0139, 0x0126, 0x2091, 0x8000, 0x080c, 0x65f2, 0x012e,
+	0x009e, 0x080c, 0x9ac8, 0x0c30, 0x0096, 0x9186, 0x0016, 0x1128,
+	0x2001, 0x0004, 0x080c, 0x5f42, 0x00e8, 0x9186, 0x0015, 0x1510,
+	0x2011, 0x1823, 0x2204, 0x9086, 0x0014, 0x11e0, 0x6010, 0x00b6,
+	0x2058, 0x080c, 0x608c, 0x00be, 0x080c, 0xa9ef, 0x1198, 0x6010,
+	0x00b6, 0x2058, 0xb890, 0x00be, 0x9005, 0x0160, 0x2001, 0x0006,
+	0x080c, 0x5f42, 0x6014, 0x2048, 0xa868, 0xd0fc, 0x0170, 0x080c,
+	0x9ecb, 0x0048, 0x6014, 0x2048, 0xa868, 0xd0fc, 0x0528, 0x080c,
+	0xa456, 0x080c, 0x9ac8, 0x009e, 0x0005, 0x6014, 0x6310, 0x2358,
+	0x904d, 0x090c, 0x0db4, 0xa87b, 0x0000, 0xa883, 0x0000, 0xa897,
+	0x4000, 0x900e, 0x080c, 0x6211, 0x1108, 0xc185, 0xb800, 0xd0bc,
+	0x0108, 0xc18d, 0xa99a, 0x0126, 0x2091, 0x8000, 0x080c, 0x65f2,
+	0x012e, 0x080c, 0x9ac8, 0x08f8, 0x6014, 0x904d, 0x090c, 0x0db4,
+	0xa87b, 0x0030, 0xa883, 0x0000, 0xa897, 0x4005, 0xa89b, 0x0004,
+	0xa867, 0x0139, 0x0126, 0x2091, 0x8000, 0x080c, 0x65f2, 0x012e,
+	0x080c, 0x9ac8, 0x0840, 0xa878, 0x9086, 0x0005, 0x1108, 0x0009,
+	0x0005, 0xa880, 0xc0ad, 0xa882, 0x0005, 0x6043, 0x0000, 0x6017,
+	0x0000, 0x6003, 0x0001, 0x6007, 0x0050, 0x080c, 0x810c, 0x080c,
+	0x868e, 0x0005, 0x00c6, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be,
+	0xd0bc, 0x0120, 0x6020, 0x9084, 0x000f, 0x0013, 0x00ce, 0x0005,
+	0xb4c8, 0xbab1, 0xbab1, 0xbab4, 0xd1d2, 0xd1ed, 0xd1f0, 0xb4c8,
+	0xb4c8, 0xb4c8, 0xb4c8, 0xb4c8, 0xb4c8, 0xb4c8, 0xb4c8, 0x080c,
+	0x0db4, 0xa001, 0xa001, 0x0005, 0x0096, 0x6014, 0x904d, 0x0118,
+	0xa87c, 0xd0e4, 0x1110, 0x009e, 0x0010, 0x009e, 0x0005, 0x6010,
+	0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x0550, 0x2001, 0x1833,
+	0x2004, 0x9005, 0x1540, 0x00f6, 0x2c78, 0x080c, 0x9a72, 0x0508,
+	0x7810, 0x6012, 0x080c, 0xbc01, 0x7820, 0x9086, 0x0003, 0x0128,
+	0x7808, 0x603a, 0x2f00, 0x603e, 0x0020, 0x7808, 0x603e, 0x2f00,
+	0x603a, 0x602e, 0x6023, 0x0001, 0x6007, 0x0035, 0x6003, 0x0001,
+	0x7954, 0x6156, 0x080c, 0x810c, 0x080c, 0x868e, 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, 0x0f9e, 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, 0x810c, 0x080c,
+	0x868e, 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,
+	0x7f8b, 0x2001, 0x1955, 0x82ff, 0x1110, 0x2011, 0x0014, 0x2202,
+	0x2001, 0x1953, 0x200c, 0x8000, 0x2014, 0x2071, 0x193d, 0x711a,
+	0x721e, 0x2001, 0x0064, 0x080c, 0x7f8b, 0x2001, 0x1956, 0x82ff,
+	0x1110, 0x2011, 0x0014, 0x2202, 0x2001, 0x1957, 0x9288, 0x000a,
+	0x2102, 0x2001, 0x1a58, 0x2102, 0x2001, 0x0032, 0x080c, 0x14fc,
+	0x080c, 0x62f6, 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, 0x1a58,
+	0x2102, 0x2001, 0x0032, 0x080c, 0x14fc, 0x00ee, 0x001e, 0x000e,
+	0x0005, 0x0096, 0x6058, 0x904d, 0x0110, 0x080c, 0x101e, 0x009e,
+	0x0005, 0x0005, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c, 0x9a72,
+	0x0180, 0x2b08, 0x6112, 0x0ca9, 0x6023, 0x0001, 0x2900, 0x6016,
+	0x2009, 0x0033, 0x080c, 0x9b42, 0x9085, 0x0001, 0x012e, 0x00ce,
+	0x0005, 0x9006, 0x0cd8, 0x0096, 0x00e6, 0x00f6, 0x2071, 0x1800,
+	0x9186, 0x0015, 0x1500, 0x708c, 0x9086, 0x0018, 0x11e0, 0x6014,
+	0x2048, 0xaa3c, 0xd2e4, 0x1160, 0x2c78, 0x080c, 0x887e, 0x01d8,
+	0x7078, 0xaa50, 0x9206, 0x1160, 0x707c, 0xaa54, 0x9206, 0x1140,
+	0x6210, 0x00b6, 0x2258, 0xbaa0, 0x00be, 0x900e, 0x080c, 0x2ec4,
+	0x080c, 0x9ecb, 0x0020, 0x080c, 0xa456, 0x080c, 0x9ac8, 0x00fe,
+	0x00ee, 0x009e, 0x0005, 0x705c, 0xaa54, 0x9206, 0x0d48, 0x0c80,
+	0x00c6, 0x0126, 0x2091, 0x8000, 0x080c, 0x9a72, 0x0188, 0x2b08,
+	0x6112, 0x080c, 0xbc01, 0x6023, 0x0001, 0x2900, 0x6016, 0x2009,
+	0x004d, 0x080c, 0x9b42, 0x9085, 0x0001, 0x012e, 0x00ce, 0x0005,
+	0x9006, 0x0cd8, 0x00c6, 0x0126, 0x2091, 0x8000, 0x0016, 0x080c,
+	0x9a72, 0x0180, 0x2b08, 0x6112, 0x080c, 0xbc01, 0x6023, 0x0001,
+	0x2900, 0x6016, 0x001e, 0x080c, 0x9b42, 0x9085, 0x0001, 0x012e,
+	0x00ce, 0x0005, 0x001e, 0x9006, 0x0cd0, 0x0016, 0x0026, 0x0036,
+	0x0046, 0x0056, 0x0066, 0x0096, 0x00e6, 0x00f6, 0x2071, 0x1800,
+	0x9186, 0x0015, 0x1568, 0x718c, 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, 0xc432, 0x001e, 0xa804, 0x9005,
+	0x0110, 0x2048, 0x0c38, 0x6014, 0x2048, 0xa867, 0x0103, 0x0010,
+	0x080c, 0xa456, 0x080c, 0x9ac8, 0x00fe, 0x00ee, 0x009e, 0x006e,
+	0x005e, 0x004e, 0x003e, 0x002e, 0x001e, 0x0005, 0x0096, 0x00e6,
+	0x00f6, 0x2071, 0x1800, 0x9186, 0x0015, 0x11b8, 0x708c, 0x9086,
+	0x0004, 0x1198, 0x6014, 0x2048, 0x2c78, 0x080c, 0x887e, 0x01a8,
+	0x7078, 0xaa74, 0x9206, 0x1130, 0x707c, 0xaa78, 0x9206, 0x1110,
+	0x080c, 0x2e7f, 0x080c, 0x9ecb, 0x0020, 0x080c, 0xa456, 0x080c,
+	0x9ac8, 0x00fe, 0x00ee, 0x009e, 0x0005, 0x705c, 0xaa78, 0x9206,
+	0x0d78, 0x0c80, 0x0096, 0x00e6, 0x00f6, 0x2071, 0x1800, 0x9186,
+	0x0015, 0x1550, 0x708c, 0x9086, 0x0004, 0x1530, 0x6014, 0x2048,
+	0x2c78, 0x080c, 0x887e, 0x05e8, 0x7078, 0xaacc, 0x9206, 0x1180,
+	0x707c, 0xaad0, 0x9206, 0x1160, 0x080c, 0x2e7f, 0x0016, 0xa998,
+	0xaab0, 0x9284, 0x1000, 0xc0fd, 0x080c, 0x510b, 0x001e, 0x0010,
+	0x080c, 0x4efc, 0x080c, 0xb793, 0x0500, 0xa87b, 0x0000, 0xa883,
+	0x0000, 0xa897, 0x4000, 0x0078, 0x080c, 0x4efc, 0x080c, 0xb793,
+	0x01a0, 0x6014, 0x2048, 0xa87b, 0x0030, 0xa883, 0x0000, 0xa897,
+	0x4005, 0xa89b, 0x0004, 0x0126, 0x2091, 0x8000, 0xa867, 0x0139,
+	0x080c, 0x65f2, 0x012e, 0x080c, 0x9ac8, 0x00fe, 0x00ee, 0x009e,
+	0x0005, 0x705c, 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, 0xb793, 0x0904, 0xbdbb, 0x0096, 0x6314, 0x2348, 0xa87a,
+	0xa982, 0x929e, 0x4000, 0x1580, 0x6310, 0x00c6, 0x2358, 0x2009,
+	0x0000, 0xa868, 0xd0f4, 0x1140, 0x080c, 0x6211, 0x1108, 0xc185,
+	0xb800, 0xd0bc, 0x0108, 0xc18d, 0xaa96, 0xa99a, 0x20a9, 0x0004,
+	0xa860, 0x20e8, 0xa85c, 0x9080, 0x0031, 0x20a0, 0xb8b4, 0x20e0,
+	0xb8b8, 0x9080, 0x0006, 0x2098, 0x080c, 0x0f69, 0x20a9, 0x0004,
+	0xa85c, 0x9080, 0x0035, 0x20a0, 0xb8b8, 0x9080, 0x000a, 0x2098,
+	0x080c, 0x0f69, 0x00ce, 0x0090, 0xaa96, 0x3918, 0x9398, 0x0007,
+	0x231c, 0x6004, 0x9086, 0x0016, 0x0110, 0xa89b, 0x0004, 0xaba2,
+	0x6310, 0x2358, 0xb804, 0x9084, 0x00ff, 0xa89e, 0x080c, 0x65e5,
+	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, 0x250b, 0x2118, 0x831f, 0x939c, 0xff00,
+	0x7838, 0x9084, 0x00ff, 0x931d, 0x7c3c, 0x2011, 0x8018, 0x080c,
+	0x46b9, 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,
+	0xb781, 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, 0xaebd, 0x0005,
+	0x0036, 0x2019, 0x0001, 0x0010, 0x0036, 0x901e, 0x0499, 0x01e0,
+	0x080c, 0xb793, 0x01c8, 0x080c, 0xb975, 0x6037, 0x4000, 0x6014,
+	0x6017, 0x0000, 0x0096, 0x2048, 0xa87c, 0x080c, 0xb992, 0x1118,
+	0x080c, 0xa456, 0x0040, 0xa867, 0x0103, 0xa877, 0x0000, 0x83ff,
+	0x1129, 0x080c, 0x65f2, 0x009e, 0x003e, 0x0005, 0xa880, 0xd0b4,
+	0x0128, 0xa87b, 0x0006, 0xc0ec, 0xa882, 0x0048, 0xd0bc, 0x0118,
+	0xa87b, 0x0002, 0x0020, 0xa87b, 0x0005, 0x080c, 0xba81, 0xa877,
+	0x0000, 0x0005, 0x2001, 0x1810, 0x2004, 0xd0ec, 0x0005, 0x0006,
+	0x2001, 0x1810, 0x2004, 0xd0f4, 0x000e, 0x0005, 0x0006, 0x2001,
+	0x1810, 0x2004, 0xd0e4, 0x000e, 0x0005, 0x0036, 0x0046, 0x6010,
+	0x00b6, 0x2058, 0xbba0, 0x00be, 0x2021, 0x0007, 0x080c, 0x4856,
+	0x004e, 0x003e, 0x0005, 0x0c51, 0x1d81, 0x0005, 0x2001, 0x1955,
+	0x2004, 0x601a, 0x0005, 0x2001, 0x1957, 0x2004, 0x6042, 0x0005,
+	0x080c, 0x9ac8, 0x0804, 0x868e, 0x00b6, 0x0066, 0x6000, 0x90b2,
+	0x0016, 0x1a0c, 0x0db4, 0x001b, 0x006e, 0x00be, 0x0005, 0xbec7,
+	0xc58f, 0xc6ea, 0xbec7, 0xbec7, 0xbec7, 0xbec7, 0xbec7, 0xbefe,
+	0xc768, 0xbec7, 0xbec7, 0xbec7, 0xbec7, 0xbec7, 0xbec7, 0x080c,
+	0x0db4, 0x0066, 0x6000, 0x90b2, 0x0016, 0x1a0c, 0x0db4, 0x0013,
+	0x006e, 0x0005, 0xbee2, 0xccd0, 0xbee2, 0xbee2, 0xbee2, 0xbee2,
+	0xbee2, 0xbee2, 0xcc7d, 0xcd24, 0xbee2, 0xd30d, 0xd343, 0xd30d,
+	0xd343, 0xbee2, 0x080c, 0x0db4, 0x6000, 0x9082, 0x0016, 0x1a0c,
+	0x0db4, 0x6000, 0x000a, 0x0005, 0xbefc, 0xc945, 0xca35, 0xca57,
+	0xcb16, 0xbefc, 0xcbf4, 0xcb9e, 0xc774, 0xcc53, 0xcc68, 0xbefc,
+	0xbefc, 0xbefc, 0xbefc, 0xbefc, 0x080c, 0x0db4, 0x91b2, 0x0053,
+	0x1a0c, 0x0db4, 0x2100, 0x91b2, 0x0040, 0x1a04, 0xc332, 0x0002,
+	0xbf48, 0xc123, 0xbf48, 0xbf48, 0xbf48, 0xc12c, 0xbf48, 0xbf48,
+	0xbf48, 0xbf48, 0xbf48, 0xbf48, 0xbf48, 0xbf48, 0xbf48, 0xbf48,
+	0xbf48, 0xbf48, 0xbf48, 0xbf48, 0xbf48, 0xbf48, 0xbf48, 0xbf4a,
+	0xbfa0, 0xbfaf, 0xc013, 0xc03e, 0xc0b6, 0xc10e, 0xbf48, 0xbf48,
+	0xc12f, 0xbf48, 0xbf48, 0xc144, 0xc151, 0xbf48, 0xbf48, 0xbf48,
+	0xbf48, 0xbf48, 0xc1d4, 0xbf48, 0xbf48, 0xc1e8, 0xbf48, 0xbf48,
+	0xc1a3, 0xbf48, 0xbf48, 0xbf48, 0xc200, 0xbf48, 0xbf48, 0xbf48,
+	0xc27d, 0xbf48, 0xbf48, 0xbf48, 0xbf48, 0xbf48, 0xbf48, 0xc2fa,
+	0x080c, 0x0db4, 0x080c, 0x62d3, 0x1150, 0x2001, 0x1836, 0x2004,
+	0xd0cc, 0x1128, 0x9084, 0x0009, 0x9086, 0x0008, 0x1140, 0x6007,
+	0x0009, 0x602f, 0x0009, 0x6017, 0x0000, 0x0804, 0xc11c, 0x080c,
+	0x62bc, 0x00e6, 0x00c6, 0x0036, 0x0026, 0x0016, 0x6210, 0x2258,
+	0xbaa0, 0x0026, 0x2019, 0x0029, 0x080c, 0x828c, 0x0076, 0x903e,
+	0x080c, 0x8184, 0x2c08, 0x080c, 0xcef9, 0x007e, 0x001e, 0x001e,
+	0x002e, 0x003e, 0x00ce, 0x00ee, 0x6610, 0x2658, 0x080c, 0x6000,
+	0xbe04, 0x9684, 0x00ff, 0x9082, 0x0006, 0x0278, 0x080c, 0xce2c,
+	0x1904, 0xc00b, 0x080c, 0xcdc8, 0x1120, 0x6007, 0x0008, 0x0804,
+	0xc11c, 0x6007, 0x0009, 0x0804, 0xc11c, 0x080c, 0xd023, 0x0128,
+	0x080c, 0xce2c, 0x0d78, 0x0804, 0xc00b, 0x6017, 0x1900, 0x0c88,
+	0x080c, 0x2f9e, 0x1904, 0xc32f, 0x6106, 0x080c, 0xcd7f, 0x6007,
+	0x0006, 0x0804, 0xc11c, 0x6007, 0x0007, 0x0804, 0xc11c, 0x080c,
+	0xd37f, 0x1904, 0xc32f, 0x080c, 0x2f9e, 0x1904, 0xc32f, 0x00d6,
+	0x6610, 0x2658, 0xbe04, 0x9684, 0x00ff, 0x9082, 0x0006, 0x1220,
+	0x2001, 0x0001, 0x080c, 0x5f2e, 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, 0xce8f, 0x1190, 0x9686, 0x0006, 0x1140, 0x0026,
+	0x6210, 0x2258, 0xbaa0, 0x900e, 0x080c, 0x2ec4, 0x002e, 0x080c,
+	0x608c, 0x6007, 0x000a, 0x00de, 0x0804, 0xc11c, 0x6007, 0x000b,
+	0x00de, 0x0804, 0xc11c, 0x080c, 0x2e7f, 0x080c, 0xbe9b, 0x6007,
+	0x0001, 0x0804, 0xc11c, 0x080c, 0xd37f, 0x1904, 0xc32f, 0x080c,
+	0x2f9e, 0x1904, 0xc32f, 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, 0x2ec4, 0x002e, 0x6007, 0x000c,
+	0x2001, 0x0001, 0x080c, 0xd49b, 0x0804, 0xc11c, 0x080c, 0x62d3,
+	0x1140, 0x2001, 0x1836, 0x2004, 0x9084, 0x0009, 0x9086, 0x0008,
+	0x1110, 0x0804, 0xbf57, 0x080c, 0x62bc, 0x6610, 0x2658, 0xbe04,
+	0x9684, 0x00ff, 0x9082, 0x0006, 0x06c0, 0x1138, 0x0026, 0x2001,
+	0x0006, 0x080c, 0x5f6e, 0x002e, 0x0050, 0x96b4, 0xff00, 0x8637,
+	0x9686, 0x0004, 0x0120, 0x9686, 0x0006, 0x1904, 0xc00b, 0x080c,
+	0xce9c, 0x1120, 0x6007, 0x000e, 0x0804, 0xc11c, 0x0046, 0x6410,
+	0x2458, 0xbca0, 0x0046, 0x080c, 0x2e7f, 0x080c, 0xbe9b, 0x004e,
+	0x0016, 0x9006, 0x2009, 0x1854, 0x210c, 0x0048, 0x2009, 0x0029,
+	0x080c, 0xd188, 0x6010, 0x2058, 0xb800, 0xc0e5, 0xb802, 0x001e,
+	0x004e, 0x6007, 0x0001, 0x0804, 0xc11c, 0x2001, 0x0001, 0x080c,
+	0x5f2e, 0x0156, 0x0016, 0x0026, 0x0036, 0x20a9, 0x0004, 0x2019,
+	0x1805, 0x2011, 0x0270, 0x080c, 0xaa8f, 0x003e, 0x002e, 0x001e,
+	0x015e, 0x9005, 0x0168, 0x96b4, 0xff00, 0x8637, 0x9682, 0x0004,
+	0x0a04, 0xc00b, 0x9682, 0x0007, 0x0a04, 0xc067, 0x0804, 0xc00b,
+	0x6017, 0x1900, 0x6007, 0x0009, 0x0804, 0xc11c, 0x080c, 0x62d3,
+	0x1140, 0x2001, 0x1836, 0x2004, 0x9084, 0x0009, 0x9086, 0x0008,
+	0x1110, 0x0804, 0xbf57, 0x080c, 0x62bc, 0x6610, 0x2658, 0xbe04,
+	0x9684, 0x00ff, 0x9082, 0x0006, 0x0688, 0x96b4, 0xff00, 0x8637,
+	0x9686, 0x0004, 0x0120, 0x9686, 0x0006, 0x1904, 0xc00b, 0x080c,
+	0xceca, 0x1130, 0x080c, 0xcdc8, 0x1118, 0x6007, 0x0010, 0x04e0,
+	0x0046, 0x6410, 0x2458, 0xbca0, 0x0046, 0x080c, 0x2e7f, 0x080c,
+	0xbe9b, 0x004e, 0x0016, 0x9006, 0x2009, 0x1854, 0x210c, 0x0048,
+	0x2009, 0x0029, 0x080c, 0xd188, 0x6010, 0x2058, 0xb800, 0xc0e5,
+	0xb802, 0x001e, 0x004e, 0x6007, 0x0001, 0x00f0, 0x080c, 0xd023,
+	0x0140, 0x96b4, 0xff00, 0x8637, 0x9686, 0x0006, 0x0980, 0x0804,
+	0xc00b, 0x6017, 0x1900, 0x6007, 0x0009, 0x0070, 0x080c, 0x2f9e,
+	0x1904, 0xc32f, 0x080c, 0xd37f, 0x1904, 0xc32f, 0x080c, 0xc4cd,
+	0x1904, 0xc00b, 0x6007, 0x0012, 0x6003, 0x0001, 0x080c, 0x8154,
+	0x080c, 0x868e, 0x0005, 0x6007, 0x0001, 0x6003, 0x0001, 0x080c,
+	0x8154, 0x080c, 0x868e, 0x0cb0, 0x6007, 0x0005, 0x0c68, 0x080c,
+	0xd37f, 0x1904, 0xc32f, 0x080c, 0x2f9e, 0x1904, 0xc32f, 0x080c,
+	0xc4cd, 0x1904, 0xc00b, 0x6007, 0x0020, 0x6003, 0x0001, 0x080c,
+	0x8154, 0x080c, 0x868e, 0x0005, 0x080c, 0x2f9e, 0x1904, 0xc32f,
+	0x6007, 0x0023, 0x6003, 0x0001, 0x080c, 0x8154, 0x080c, 0x868e,
+	0x0005, 0x080c, 0xd37f, 0x1904, 0xc32f, 0x080c, 0x2f9e, 0x1904,
+	0xc32f, 0x080c, 0xc4cd, 0x1904, 0xc00b, 0x0016, 0x0026, 0x00e6,
+	0x2071, 0x0260, 0x7244, 0x9286, 0xffff, 0x0180, 0x2c08, 0x080c,
+	0xb781, 0x01b0, 0x2260, 0x7240, 0x6008, 0x9206, 0x1188, 0x6010,
+	0x9190, 0x0004, 0x2214, 0x9206, 0x01b8, 0x0050, 0x7240, 0x2c08,
+	0x9006, 0x080c, 0xd15a, 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, 0x9ac8, 0x2160, 0x6007,
+	0x0025, 0x6003, 0x0001, 0x080c, 0x8154, 0x080c, 0x868e, 0x00ee,
+	0x002e, 0x001e, 0x0005, 0x2001, 0x0001, 0x080c, 0x5f2e, 0x0156,
+	0x0016, 0x0026, 0x0036, 0x20a9, 0x0004, 0x2019, 0x1805, 0x2011,
+	0x0276, 0x080c, 0xaa8f, 0x003e, 0x002e, 0x001e, 0x015e, 0x0120,
+	0x6007, 0x0031, 0x0804, 0xc11c, 0x080c, 0xa6f7, 0x080c, 0x6d14,
+	0x1190, 0x0006, 0x0026, 0x0036, 0x080c, 0x6d2e, 0x1138, 0x080c,
+	0x6ff8, 0x080c, 0x5a94, 0x080c, 0x6c46, 0x0010, 0x080c, 0x6cec,
+	0x003e, 0x002e, 0x000e, 0x0005, 0x080c, 0x2f9e, 0x1904, 0xc32f,
+	0x080c, 0xc4cd, 0x1904, 0xc00b, 0x6106, 0x080c, 0xc4e9, 0x1120,
+	0x6007, 0x002b, 0x0804, 0xc11c, 0x6007, 0x002c, 0x0804, 0xc11c,
+	0x080c, 0xd37f, 0x1904, 0xc32f, 0x080c, 0x2f9e, 0x1904, 0xc32f,
+	0x080c, 0xc4cd, 0x1904, 0xc00b, 0x6106, 0x080c, 0xc4ee, 0x1120,
+	0x6007, 0x002e, 0x0804, 0xc11c, 0x6007, 0x002f, 0x0804, 0xc11c,
+	0x080c, 0x2f9e, 0x1904, 0xc32f, 0x00e6, 0x00d6, 0x00c6, 0x6010,
+	0x2058, 0xb904, 0x9184, 0x00ff, 0x9086, 0x0006, 0x0158, 0x9184,
+	0xff00, 0x8007, 0x9086, 0x0006, 0x0128, 0x00ce, 0x00de, 0x00ee,
+	0x0804, 0xc123, 0x080c, 0x5157, 0xd0e4, 0x0904, 0xc27a, 0x2071,
+	0x026c, 0x7010, 0x603a, 0x7014, 0x603e, 0x7108, 0x720c, 0x080c,
+	0x6311, 0x0140, 0x6010, 0x2058, 0xb810, 0x9106, 0x1118, 0xb814,
+	0x9206, 0x0510, 0x080c, 0x630d, 0x15b8, 0x2069, 0x1800, 0x687c,
+	0x9206, 0x1590, 0x6878, 0x9106, 0x1578, 0x7210, 0x080c, 0xb781,
+	0x0590, 0x080c, 0xc3ba, 0x0578, 0x080c, 0xd1ff, 0x0560, 0x622e,
+	0x6007, 0x0036, 0x6003, 0x0001, 0x080c, 0x810c, 0x080c, 0x868e,
+	0x00ce, 0x00de, 0x00ee, 0x0005, 0x7214, 0x9286, 0xffff, 0x0150,
+	0x080c, 0xb781, 0x01c0, 0x9280, 0x0002, 0x2004, 0x7110, 0x9106,
+	0x1190, 0x08e0, 0x7210, 0x2c08, 0x9085, 0x0001, 0x080c, 0xd15a,
+	0x2c10, 0x2160, 0x0140, 0x0890, 0x6007, 0x0037, 0x602f, 0x0009,
+	0x6017, 0x1500, 0x08b8, 0x6007, 0x0037, 0x602f, 0x0003, 0x6017,
+	0x1700, 0x0880, 0x6007, 0x0012, 0x0868, 0x080c, 0x2f9e, 0x1904,
+	0xc32f, 0x6010, 0x2058, 0xb804, 0x9084, 0xff00, 0x8007, 0x9086,
+	0x0006, 0x1904, 0xc123, 0x00e6, 0x00d6, 0x00c6, 0x080c, 0x5157,
+	0xd0e4, 0x0904, 0xc2f2, 0x2069, 0x1800, 0x2071, 0x026c, 0x7008,
+	0x603a, 0x720c, 0x623e, 0x9286, 0xffff, 0x1150, 0x7208, 0x00c6,
+	0x2c08, 0x9085, 0x0001, 0x080c, 0xd15a, 0x2c10, 0x00ce, 0x05e8,
+	0x080c, 0xb781, 0x05d0, 0x7108, 0x9280, 0x0002, 0x2004, 0x9106,
+	0x15a0, 0x00c6, 0x0026, 0x2260, 0x080c, 0xb3d3, 0x002e, 0x00ce,
+	0x7118, 0x918c, 0xff00, 0x810f, 0x9186, 0x0001, 0x0178, 0x9186,
+	0x0005, 0x0118, 0x9186, 0x0007, 0x1198, 0x9280, 0x0005, 0x2004,
+	0x9005, 0x0170, 0x080c, 0xc3ba, 0x0904, 0xc273, 0x0056, 0x7510,
+	0x7614, 0x080c, 0xd218, 0x005e, 0x00ce, 0x00de, 0x00ee, 0x0005,
+	0x6007, 0x003b, 0x602f, 0x0009, 0x6017, 0x2a00, 0x6003, 0x0001,
+	0x080c, 0x810c, 0x080c, 0x868e, 0x0c78, 0x6007, 0x003b, 0x602f,
+	0x0003, 0x6017, 0x0300, 0x6003, 0x0001, 0x080c, 0x810c, 0x080c,
+	0x868e, 0x0c10, 0x6007, 0x003b, 0x602f, 0x000b, 0x6017, 0x0000,
+	0x0804, 0xc24a, 0x00e6, 0x0026, 0x080c, 0x62d3, 0x0550, 0x080c,
+	0x62bc, 0x080c, 0xd3f1, 0x1518, 0x2071, 0x1800, 0x70d8, 0x9085,
+	0x0003, 0x70da, 0x00f6, 0x2079, 0x0100, 0x72ac, 0x9284, 0x00ff,
+	0x707a, 0x78e6, 0x9284, 0xff00, 0x727c, 0x9205, 0x707e, 0x78ea,
+	0x00fe, 0x70e3, 0x0000, 0x080c, 0x6311, 0x0120, 0x2011, 0x19cf,
+	0x2013, 0x07d0, 0xd0ac, 0x1128, 0x080c, 0x2c63, 0x0010, 0x080c,
+	0xd423, 0x002e, 0x00ee, 0x080c, 0x9ac8, 0x0804, 0xc122, 0x080c,
+	0x9ac8, 0x0005, 0x2600, 0x0002, 0xc346, 0xc346, 0xc346, 0xc346,
+	0xc346, 0xc348, 0xc346, 0xc346, 0xc346, 0xc346, 0xc365, 0xc346,
+	0xc346, 0xc346, 0xc377, 0xc384, 0xc3b5, 0xc346, 0x080c, 0x0db4,
+	0x080c, 0xd37f, 0x1d20, 0x080c, 0x2f9e, 0x1d08, 0x080c, 0xc4cd,
+	0x1148, 0x7038, 0x6016, 0x6007, 0x0045, 0x6003, 0x0001, 0x080c,
+	0x8154, 0x0005, 0x080c, 0x2e7f, 0x080c, 0xbe9b, 0x6007, 0x0001,
+	0x6003, 0x0001, 0x080c, 0x8154, 0x0005, 0x080c, 0xd37f, 0x1938,
+	0x080c, 0x2f9e, 0x1920, 0x080c, 0xc4cd, 0x1d60, 0x703c, 0x6016,
+	0x6007, 0x004a, 0x6003, 0x0001, 0x080c, 0x8154, 0x0005, 0x080c,
+	0xc3d5, 0x0904, 0xc32f, 0x6007, 0x004e, 0x6003, 0x0001, 0x080c,
+	0x8154, 0x080c, 0x868e, 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, 0xaaa3, 0x009e, 0x0110, 0x6017, 0x0001, 0x6003, 0x0001,
+	0x080c, 0x8154, 0x080c, 0x868e, 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,
+	0x708c, 0x908a, 0x00f9, 0x16e8, 0x20e1, 0x0000, 0x2001, 0x196f,
+	0x2003, 0x0000, 0x080c, 0x1005, 0x05a0, 0x2900, 0x6016, 0x708c,
+	0x8004, 0xa816, 0x908a, 0x001e, 0x02d0, 0xa833, 0x001e, 0x20a9,
+	0x001e, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x001b, 0x20a0, 0x2001,
+	0x196f, 0x0016, 0x200c, 0x0471, 0x001e, 0x2940, 0x080c, 0x1005,
+	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, 0x708f, 0x0000, 0x6014, 0x2048, 0x080c,
+	0x0f9e, 0x9006, 0x012e, 0x01de, 0x01ce, 0x00ee, 0x008e, 0x009e,
+	0x001e, 0x0005, 0x0006, 0x0016, 0x0026, 0x0036, 0x00c6, 0x918c,
+	0xffff, 0x11a8, 0x080c, 0x20e9, 0x2099, 0x026c, 0x2001, 0x0014,
+	0x3518, 0x9312, 0x1218, 0x23a8, 0x4003, 0x00f8, 0x20a8, 0x4003,
+	0x22a8, 0x8108, 0x080c, 0x20e9, 0x2099, 0x0260, 0x0ca8, 0x080c,
+	0x20e9, 0x2061, 0x196f, 0x6004, 0x2098, 0x6008, 0x3518, 0x9312,
+	0x1218, 0x23a8, 0x4003, 0x0048, 0x20a8, 0x4003, 0x22a8, 0x8108,
+	0x080c, 0x20e9, 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, 0x2101, 0x20a1,
+	0x024c, 0x2001, 0x0014, 0x3518, 0x9312, 0x1218, 0x23a8, 0x4003,
+	0x0418, 0x20a8, 0x4003, 0x82ff, 0x01f8, 0x22a8, 0x8108, 0x080c,
+	0x2101, 0x20a1, 0x0240, 0x0c98, 0x080c, 0x2101, 0x2061, 0x1972,
+	0x6004, 0x20a0, 0x6008, 0x3518, 0x9312, 0x1218, 0x23a8, 0x4003,
+	0x0058, 0x20a8, 0x4003, 0x82ff, 0x0138, 0x22a8, 0x8108, 0x080c,
+	0x2101, 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, 0xc565, 0x00de, 0x0005, 0x00d6, 0x080c,
+	0xc572, 0x1520, 0x680c, 0x908c, 0xff00, 0x6820, 0x9084, 0x00ff,
+	0x9115, 0x6216, 0x6824, 0x602e, 0xd1e4, 0x0130, 0x9006, 0x080c,
+	0xd49b, 0x2009, 0x0001, 0x0078, 0xd1ec, 0x0180, 0x6920, 0x918c,
+	0x00ff, 0x6824, 0x080c, 0x250b, 0x1148, 0x2001, 0x0001, 0x080c,
+	0xd49b, 0x2110, 0x900e, 0x080c, 0x2ec4, 0x0018, 0x9085, 0x0001,
+	0x0008, 0x9006, 0x00de, 0x0005, 0x00b6, 0x00c6, 0x080c, 0x9b15,
+	0x05a8, 0x0016, 0x0026, 0x00c6, 0x2011, 0x0263, 0x2204, 0x8211,
+	0x220c, 0x080c, 0x250b, 0x1578, 0x080c, 0x5f91, 0x1560, 0xbe12,
+	0xbd16, 0x00ce, 0x002e, 0x001e, 0x2b00, 0x6012, 0x080c, 0xd37f,
+	0x11d8, 0x080c, 0x2f9e, 0x11c0, 0x080c, 0xc4cd, 0x0510, 0x2001,
+	0x0007, 0x080c, 0x5f42, 0x2001, 0x0007, 0x080c, 0x5f6e, 0x6017,
+	0x0000, 0x6023, 0x0001, 0x6007, 0x0001, 0x6003, 0x0001, 0x080c,
+	0x8154, 0x080c, 0x868e, 0x0010, 0x080c, 0x9ac8, 0x9085, 0x0001,
+	0x00ce, 0x00be, 0x0005, 0x080c, 0x9ac8, 0x00ce, 0x002e, 0x001e,
+	0x0ca8, 0x080c, 0x9ac8, 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, 0x0db4, 0x91b6, 0x0013, 0x1130, 0x2008,
+	0x91b2, 0x0040, 0x1a04, 0xc6ba, 0x0092, 0x91b6, 0x0027, 0x0120,
+	0x91b6, 0x0014, 0x190c, 0x0db4, 0x2001, 0x0007, 0x080c, 0x5f6e,
+	0x080c, 0x8589, 0x080c, 0x9af8, 0x080c, 0x868e, 0x0005, 0xc5ef,
+	0xc5f1, 0xc5ef, 0xc5ef, 0xc5ef, 0xc5f1, 0xc600, 0xc6b3, 0xc652,
+	0xc6b3, 0xc664, 0xc6b3, 0xc600, 0xc6b3, 0xc6ab, 0xc6b3, 0xc6ab,
+	0xc6b3, 0xc6b3, 0xc5ef, 0xc5ef, 0xc5ef, 0xc5ef, 0xc5ef, 0xc5ef,
+	0xc5ef, 0xc5ef, 0xc5ef, 0xc5ef, 0xc5ef, 0xc5f1, 0xc5ef, 0xc6b3,
+	0xc5ef, 0xc5ef, 0xc6b3, 0xc5ef, 0xc6b0, 0xc6b3, 0xc5ef, 0xc5ef,
+	0xc5ef, 0xc5ef, 0xc6b3, 0xc6b3, 0xc5ef, 0xc6b3, 0xc6b3, 0xc5ef,
+	0xc5fb, 0xc5ef, 0xc5ef, 0xc5ef, 0xc5ef, 0xc6af, 0xc6b3, 0xc5ef,
+	0xc5ef, 0xc6b3, 0xc6b3, 0xc5ef, 0xc5ef, 0xc5ef, 0xc5ef, 0x080c,
+	0x0db4, 0x080c, 0x8589, 0x080c, 0xbe9e, 0x6003, 0x0002, 0x080c,
+	0x868e, 0x0804, 0xc6b9, 0x9006, 0x080c, 0x5f2e, 0x0804, 0xc6b3,
+	0x080c, 0x630d, 0x1904, 0xc6b3, 0x9006, 0x080c, 0x5f2e, 0x6010,
+	0x2058, 0xb810, 0x9086, 0x00ff, 0x1140, 0x00f6, 0x2079, 0x1800,
+	0x78a4, 0x8000, 0x78a6, 0x00fe, 0x0428, 0x6010, 0x2058, 0xb8b0,
+	0x9005, 0x1178, 0x080c, 0xbe86, 0x1904, 0xc6b3, 0x0036, 0x0046,
+	0xbba0, 0x2021, 0x0007, 0x080c, 0x4856, 0x004e, 0x003e, 0x0804,
+	0xc6b3, 0x080c, 0x2fcf, 0x1904, 0xc6b3, 0x2001, 0x1800, 0x2004,
+	0x9086, 0x0002, 0x1138, 0x00f6, 0x2079, 0x1800, 0x78a4, 0x8000,
+	0x78a6, 0x00fe, 0x2001, 0x0002, 0x080c, 0x5f42, 0x080c, 0x8589,
+	0x6023, 0x0001, 0x6003, 0x0001, 0x6007, 0x0002, 0x080c, 0x8154,
+	0x080c, 0x868e, 0x6110, 0x2158, 0x2009, 0x0001, 0x080c, 0x7d64,
+	0x0804, 0xc6b9, 0x6610, 0x2658, 0xbe04, 0x96b4, 0xff00, 0x8637,
+	0x9686, 0x0006, 0x0904, 0xc6b3, 0x9686, 0x0004, 0x0904, 0xc6b3,
+	0x2001, 0x0004, 0x0804, 0xc6b1, 0x2001, 0x1800, 0x2004, 0x9086,
+	0x0003, 0x1158, 0x0036, 0x0046, 0x6010, 0x2058, 0xbba0, 0x2021,
+	0x0006, 0x080c, 0x4856, 0x004e, 0x003e, 0x2001, 0x0006, 0x080c,
+	0xc6d7, 0x6610, 0x2658, 0xbe04, 0x0066, 0x96b4, 0xff00, 0x8637,
+	0x9686, 0x0006, 0x006e, 0x0168, 0x2001, 0x0006, 0x080c, 0x5f6e,
+	0x9284, 0x00ff, 0x908e, 0x0007, 0x1120, 0x2001, 0x0006, 0x080c,
+	0x5f42, 0x080c, 0x630d, 0x11f8, 0x2001, 0x1836, 0x2004, 0xd0a4,
+	0x01d0, 0xbe04, 0x96b4, 0x00ff, 0x9686, 0x0006, 0x01a0, 0x00f6,
+	0x2079, 0x1800, 0x78a4, 0x8000, 0x78a6, 0x00fe, 0x0804, 0xc63a,
+	0x2001, 0x0004, 0x0030, 0x2001, 0x0006, 0x0449, 0x0020, 0x0018,
+	0x0010, 0x080c, 0x5f6e, 0x080c, 0x8589, 0x080c, 0x9ac8, 0x080c,
+	0x868e, 0x0005, 0x2600, 0x0002, 0xc6ce, 0xc6ce, 0xc6ce, 0xc6ce,
+	0xc6ce, 0xc6d0, 0xc6ce, 0xc6ce, 0xc6ce, 0xc6ce, 0xc6d0, 0xc6ce,
+	0xc6ce, 0xc6ce, 0xc6d0, 0xc6d0, 0xc6d0, 0xc6d0, 0x080c, 0x0db4,
+	0x080c, 0x8589, 0x080c, 0x9ac8, 0x080c, 0x868e, 0x0005, 0x0016,
+	0x00b6, 0x00d6, 0x6110, 0x2158, 0xb900, 0xd184, 0x0138, 0x080c,
+	0x5f42, 0x9006, 0x080c, 0x5f2e, 0x080c, 0x2ea4, 0x00de, 0x00be,
+	0x001e, 0x0005, 0x6610, 0x2658, 0xb804, 0x9084, 0xff00, 0x8007,
+	0x90b2, 0x000c, 0x1a0c, 0x0db4, 0x91b6, 0x0015, 0x1110, 0x003b,
+	0x0028, 0x91b6, 0x0016, 0x190c, 0x0db4, 0x006b, 0x0005, 0xa537,
+	0xa537, 0xa537, 0xa537, 0xa537, 0xa537, 0xc752, 0xc717, 0xa537,
+	0xa537, 0xa537, 0xa537, 0xa537, 0xa537, 0xa537, 0xa537, 0xa537,
+	0xa537, 0xc752, 0xc759, 0xa537, 0xa537, 0xa537, 0xa537, 0x00f6,
+	0x080c, 0x630d, 0x11d8, 0x080c, 0xbe86, 0x11c0, 0x6010, 0x905d,
+	0x01a8, 0xb8b0, 0x9005, 0x0190, 0x9006, 0x080c, 0x5f2e, 0x2001,
+	0x0002, 0x080c, 0x5f42, 0x6023, 0x0001, 0x6003, 0x0001, 0x6007,
+	0x0002, 0x080c, 0x8154, 0x080c, 0x868e, 0x00d0, 0x2011, 0x0263,
+	0x2204, 0x8211, 0x220c, 0x080c, 0x250b, 0x1190, 0x080c, 0x5ff1,
+	0x0118, 0x080c, 0x9ac8, 0x0060, 0xb810, 0x0006, 0xb814, 0x0006,
+	0x080c, 0x5aae, 0x000e, 0xb816, 0x000e, 0xb812, 0x080c, 0x9ac8,
+	0x00fe, 0x0005, 0x6604, 0x96b6, 0x001e, 0x1110, 0x080c, 0x9ac8,
+	0x0005, 0x080c, 0xa91b, 0x1148, 0x6003, 0x0001, 0x6007, 0x0001,
+	0x080c, 0x8154, 0x080c, 0x868e, 0x0010, 0x080c, 0x9ac8, 0x0005,
+	0x6004, 0x908a, 0x0053, 0x1a0c, 0x0db4, 0x080c, 0x8589, 0x080c,
+	0x9af8, 0x080c, 0x868e, 0x0005, 0x9182, 0x0040, 0x0002, 0xc78a,
+	0xc78a, 0xc78a, 0xc78a, 0xc78c, 0xc78a, 0xc78a, 0xc78a, 0xc78a,
+	0xc78a, 0xc78a, 0xc78a, 0xc78a, 0xc78a, 0xc78a, 0xc78a, 0xc78a,
+	0xc78a, 0xc78a, 0x080c, 0x0db4, 0x0096, 0x00b6, 0x00d6, 0x00e6,
+	0x00f6, 0x0046, 0x0026, 0x6210, 0x2258, 0xb8ac, 0x9005, 0x11a8,
+	0x6106, 0x2071, 0x0260, 0x7444, 0x94a4, 0xff00, 0x0904, 0xc7f2,
+	0x080c, 0xd48f, 0x1170, 0x9486, 0x2000, 0x1158, 0x2009, 0x0001,
+	0x2011, 0x0200, 0x080c, 0x7f4a, 0x0020, 0x9026, 0x080c, 0xd3c4,
+	0x0c38, 0x080c, 0x0fec, 0x090c, 0x0db4, 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, 0x65f2,
+	0x001e, 0x080c, 0xd48f, 0x1904, 0xc852, 0x9486, 0x2000, 0x1130,
+	0x2019, 0x0017, 0x080c, 0xd104, 0x0804, 0xc852, 0x9486, 0x0200,
+	0x1120, 0x080c, 0xd0a0, 0x0804, 0xc852, 0x9486, 0x0400, 0x0120,
+	0x9486, 0x1000, 0x1904, 0xc852, 0x2019, 0x0002, 0x080c, 0xd0bb,
+	0x0804, 0xc852, 0x2069, 0x1a3e, 0x6a00, 0xd284, 0x0904, 0xc8bc,
+	0x9284, 0x0300, 0x1904, 0xc8b5, 0x6804, 0x9005, 0x0904, 0xc89d,
+	0x2d78, 0x6003, 0x0007, 0x080c, 0x1005, 0x0904, 0xc85e, 0x7800,
+	0xd08c, 0x1118, 0x7804, 0x8001, 0x7806, 0x6017, 0x0000, 0x2001,
+	0x180f, 0x2004, 0xd084, 0x1904, 0xc8c0, 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, 0xc85a, 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, 0x65f2, 0x002e, 0x004e, 0x00fe, 0x00ee, 0x00de, 0x00be,
+	0x009e, 0x0005, 0x0000, 0x0080, 0x0040, 0x0000, 0x2001, 0x1810,
+	0x2004, 0xd084, 0x0120, 0x080c, 0x0fec, 0x1904, 0xc807, 0x6017,
+	0xf100, 0x6003, 0x0001, 0x6007, 0x0041, 0x080c, 0x810c, 0x080c,
+	0x868e, 0x0c00, 0x2069, 0x0260, 0x6848, 0x9084, 0xff00, 0x9086,
+	0x1200, 0x1198, 0x686c, 0x9084, 0x00ff, 0x0016, 0x6114, 0x918c,
+	0xf700, 0x910d, 0x6116, 0x001e, 0x6003, 0x0001, 0x6007, 0x0043,
+	0x080c, 0x810c, 0x080c, 0x868e, 0x0828, 0x6868, 0x602e, 0x686c,
+	0x6032, 0x6017, 0xf200, 0x6003, 0x0001, 0x6007, 0x0041, 0x080c,
+	0x810c, 0x080c, 0x868e, 0x0804, 0xc852, 0x2001, 0x180e, 0x2004,
+	0xd0ec, 0x0120, 0x2011, 0x8049, 0x080c, 0x46b9, 0x6017, 0xf300,
+	0x0010, 0x6017, 0xf100, 0x6003, 0x0001, 0x6007, 0x0041, 0x080c,
+	0x810c, 0x080c, 0x868e, 0x0804, 0xc852, 0x6017, 0xf500, 0x0c98,
+	0x6017, 0xf600, 0x0804, 0xc872, 0x6017, 0xf200, 0x0804, 0xc872,
+	0xa867, 0x0146, 0xa86b, 0x0000, 0x6008, 0xa886, 0x2c00, 0xa87a,
+	0x7044, 0x9084, 0x0003, 0x9080, 0xc85a, 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, 0x0db4,
+	0x8210, 0x821c, 0x2001, 0x026c, 0x2098, 0xa860, 0x20e8, 0xa85c,
+	0x9080, 0x0029, 0x20a0, 0x2011, 0xc93c, 0x2041, 0x0001, 0x223d,
+	0x9784, 0x00ff, 0x9322, 0x1208, 0x2300, 0x20a8, 0x4003, 0x931a,
+	0x0530, 0x8210, 0xd7fc, 0x1130, 0x8d68, 0x2d0a, 0x2001, 0x0260,
+	0x2098, 0x0c68, 0x2950, 0x080c, 0x1005, 0x0170, 0x2900, 0xb002,
+	0xa867, 0x0147, 0xa86b, 0x0000, 0xa860, 0x20e8, 0xa85c, 0x9080,
+	0x001b, 0x20a0, 0x8840, 0x08d8, 0x2548, 0xa800, 0x902d, 0x0118,
+	0x080c, 0x101e, 0x0cc8, 0x080c, 0x101e, 0x0804, 0xc85e, 0x2548,
+	0x8847, 0x9885, 0x0046, 0xa866, 0x2009, 0x0205, 0x200b, 0x0000,
+	0x080c, 0xd133, 0x0804, 0xc852, 0x8010, 0x0004, 0x801a, 0x0006,
+	0x8018, 0x0008, 0x8016, 0x000a, 0x8014, 0x9186, 0x0013, 0x1160,
+	0x6004, 0x908a, 0x0054, 0x1a0c, 0x0db4, 0x9082, 0x0040, 0x0a0c,
+	0x0db4, 0x2008, 0x0804, 0xc9ed, 0x9186, 0x0051, 0x0108, 0x00c0,
+	0x2001, 0x0109, 0x2004, 0xd084, 0x0904, 0xc99e, 0x0126, 0x2091,
+	0x2800, 0x0006, 0x0016, 0x0026, 0x080c, 0x7ff8, 0x002e, 0x001e,
+	0x000e, 0x012e, 0x6000, 0x9086, 0x0002, 0x1580, 0x0804, 0xca35,
+	0x9186, 0x0027, 0x0530, 0x9186, 0x0048, 0x0128, 0x9186, 0x0014,
+	0x0500, 0x190c, 0x0db4, 0x2001, 0x0109, 0x2004, 0xd084, 0x01f0,
+	0x00c6, 0x0126, 0x2091, 0x2800, 0x00c6, 0x2061, 0x0100, 0x0006,
+	0x0016, 0x0026, 0x080c, 0x7ff8, 0x002e, 0x001e, 0x000e, 0x00ce,
+	0x012e, 0x00ce, 0x6000, 0x9086, 0x0004, 0x190c, 0x0db4, 0x0804,
+	0xcb16, 0x6004, 0x9082, 0x0040, 0x2008, 0x001a, 0x080c, 0x9b5d,
+	0x0005, 0xc9b4, 0xc9b6, 0xc9b6, 0xc9dd, 0xc9b4, 0xc9b4, 0xc9b4,
+	0xc9b4, 0xc9b4, 0xc9b4, 0xc9b4, 0xc9b4, 0xc9b4, 0xc9b4, 0xc9b4,
+	0xc9b4, 0xc9b4, 0xc9b4, 0xc9b4, 0x080c, 0x0db4, 0x080c, 0x8589,
+	0x080c, 0x868e, 0x0036, 0x0096, 0x6014, 0x904d, 0x01d8, 0x080c,
+	0xb793, 0x01c0, 0x6003, 0x0002, 0x6010, 0x00b6, 0x2058, 0xb800,
+	0x00be, 0xd0bc, 0x1178, 0x2019, 0x0004, 0x080c, 0xd133, 0x6017,
+	0x0000, 0x6018, 0x9005, 0x1120, 0x2001, 0x1956, 0x2004, 0x601a,
+	0x6003, 0x0007, 0x009e, 0x003e, 0x0005, 0x0096, 0x080c, 0x8589,
+	0x080c, 0x868e, 0x080c, 0xb793, 0x0120, 0x6014, 0x2048, 0x080c,
+	0x101e, 0x080c, 0x9af8, 0x009e, 0x0005, 0x0002, 0xca01, 0xca18,
+	0xca03, 0xca2f, 0xca01, 0xca01, 0xca01, 0xca01, 0xca01, 0xca01,
+	0xca01, 0xca01, 0xca01, 0xca01, 0xca01, 0xca01, 0xca01, 0xca01,
+	0xca01, 0x080c, 0x0db4, 0x0096, 0x080c, 0x8589, 0x6014, 0x2048,
+	0xa87c, 0xd0b4, 0x0138, 0x6003, 0x0007, 0x2009, 0x0043, 0x080c,
+	0x9b42, 0x0010, 0x6003, 0x0004, 0x080c, 0x868e, 0x009e, 0x0005,
+	0x080c, 0x8589, 0x080c, 0xb793, 0x0138, 0x6114, 0x0096, 0x2148,
+	0xa97c, 0x009e, 0xd1ec, 0x1138, 0x080c, 0x7f1f, 0x080c, 0x9ac8,
+	0x080c, 0x868e, 0x0005, 0x080c, 0xd388, 0x0db0, 0x0cc8, 0x080c,
+	0x8589, 0x2009, 0x0041, 0x0804, 0xcb9e, 0x9182, 0x0040, 0x0002,
+	0xca4b, 0xca4d, 0xca4b, 0xca4b, 0xca4b, 0xca4b, 0xca4b, 0xca4b,
+	0xca4b, 0xca4b, 0xca4b, 0xca4b, 0xca4b, 0xca4b, 0xca4b, 0xca4b,
+	0xca4b, 0xca4e, 0xca4b, 0x080c, 0x0db4, 0x0005, 0x00d6, 0x080c,
+	0x7f1f, 0x00de, 0x080c, 0xd3e0, 0x080c, 0x9ac8, 0x0005, 0x9182,
+	0x0040, 0x0002, 0xca6d, 0xca6d, 0xca6d, 0xca6d, 0xca6d, 0xca6d,
+	0xca6d, 0xca6d, 0xca6d, 0xca6f, 0xcade, 0xca6d, 0xca6d, 0xca6d,
+	0xca6d, 0xcade, 0xca6d, 0xca6d, 0xca6d, 0x080c, 0x0db4, 0x2001,
+	0x0105, 0x2004, 0x9084, 0x1800, 0x01c8, 0x2001, 0x0132, 0x200c,
+	0x2001, 0x0131, 0x2004, 0x9105, 0x1904, 0xcade, 0x2009, 0x180c,
+	0x2104, 0xd0d4, 0x0904, 0xcade, 0xc0d4, 0x200a, 0x2009, 0x0105,
+	0x2104, 0x9084, 0xe7fd, 0x9085, 0x0010, 0x200a, 0x2001, 0x1873,
+	0x2004, 0xd0e4, 0x1528, 0x603b, 0x0000, 0x080c, 0x863e, 0x6014,
+	0x0096, 0x2048, 0xa87c, 0xd0fc, 0x0188, 0x908c, 0x0003, 0x918e,
+	0x0002, 0x0508, 0x2001, 0x180c, 0x2004, 0xd0d4, 0x11e0, 0x080c,
+	0x8769, 0x2009, 0x0041, 0x009e, 0x0804, 0xcb9e, 0x080c, 0x8769,
+	0x6003, 0x0007, 0x601b, 0x0000, 0x080c, 0x7f1f, 0x009e, 0x0005,
+	0x2001, 0x0100, 0x2004, 0x9082, 0x0005, 0x0aa8, 0x2001, 0x011f,
+	0x2004, 0x603a, 0x0890, 0x2001, 0x180c, 0x200c, 0xc1d4, 0x2102,
+	0xd1cc, 0x0110, 0x080c, 0x291f, 0x080c, 0x8769, 0x6014, 0x2048,
+	0xa97c, 0xd1ec, 0x1130, 0x080c, 0x7f1f, 0x080c, 0x9ac8, 0x009e,
+	0x0005, 0x080c, 0xd388, 0x0db8, 0x009e, 0x0005, 0x2001, 0x180c,
+	0x200c, 0xc1d4, 0x2102, 0x0036, 0x080c, 0x863e, 0x080c, 0x8769,
+	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, 0xd133, 0x6018,
+	0x9005, 0x1128, 0x2001, 0x1956, 0x2004, 0x8003, 0x601a, 0x6017,
+	0x0000, 0x6003, 0x0007, 0x009e, 0x003e, 0x0005, 0x9182, 0x0040,
+	0x0002, 0xcb2d, 0xcb2d, 0xcb2d, 0xcb2d, 0xcb2d, 0xcb2d, 0xcb2d,
+	0xcb2d, 0xcb2f, 0xcb2d, 0xcb2d, 0xcb2d, 0xcb2d, 0xcb2d, 0xcb2d,
+	0xcb2d, 0xcb2d, 0xcb2d, 0xcb2d, 0xcb7a, 0x080c, 0x0db4, 0x6014,
+	0x0096, 0x2048, 0xa834, 0xaa38, 0x6110, 0x00b6, 0x2058, 0xb900,
+	0x00be, 0xd1bc, 0x1190, 0x920d, 0x1518, 0xa87c, 0xd0fc, 0x0128,
+	0x2009, 0x0041, 0x009e, 0x0804, 0xcb9e, 0x6003, 0x0007, 0x601b,
+	0x0000, 0x080c, 0x7f1f, 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,
+	0x180e, 0x210c, 0xd19c, 0x0118, 0x6003, 0x0007, 0x0010, 0x6003,
+	0x0006, 0x00e9, 0x080c, 0x7f21, 0x009e, 0x0005, 0x6003, 0x0002,
+	0x009e, 0x0005, 0x6024, 0xd0f4, 0x0128, 0x080c, 0x14f3, 0x1904,
+	0xcb2f, 0x0005, 0x6014, 0x0096, 0x2048, 0xa834, 0xa938, 0x009e,
+	0x9105, 0x1120, 0x080c, 0x14f3, 0x1904, 0xcb2f, 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,
+	0x0db4, 0x6024, 0xd0dc, 0x090c, 0x0db4, 0x0005, 0xcbc1, 0xcbcd,
+	0xcbd9, 0xcbe5, 0xcbc1, 0xcbc1, 0xcbc1, 0xcbc1, 0xcbc8, 0xcbc3,
+	0xcbc3, 0xcbc1, 0xcbc1, 0xcbc1, 0xcbc1, 0xcbc3, 0xcbc1, 0xcbc3,
+	0xcbc1, 0x080c, 0x0db4, 0x6024, 0xd0dc, 0x090c, 0x0db4, 0x0005,
+	0x6014, 0x9005, 0x190c, 0x0db4, 0x0005, 0x6003, 0x0001, 0x6106,
+	0x080c, 0x810c, 0x0126, 0x2091, 0x8000, 0x080c, 0x868e, 0x012e,
+	0x0005, 0x6003, 0x0001, 0x6106, 0x080c, 0x810c, 0x0126, 0x2091,
+	0x8000, 0x080c, 0x868e, 0x012e, 0x0005, 0x6003, 0x0003, 0x6106,
+	0x2c10, 0x080c, 0x19aa, 0x0126, 0x2091, 0x8000, 0x080c, 0x8171,
+	0x080c, 0x8769, 0x012e, 0x0005, 0x0126, 0x2091, 0x8000, 0x0036,
+	0x0096, 0x9182, 0x0040, 0x0023, 0x009e, 0x003e, 0x012e, 0x0005,
+	0xcc10, 0xcc12, 0xcc24, 0xcc3e, 0xcc10, 0xcc10, 0xcc10, 0xcc10,
+	0xcc10, 0xcc10, 0xcc10, 0xcc10, 0xcc10, 0xcc10, 0xcc10, 0xcc10,
+	0x080c, 0x0db4, 0x6014, 0x2048, 0xa87c, 0xd0fc, 0x01f8, 0x909c,
+	0x0003, 0x939e, 0x0003, 0x01d0, 0x6003, 0x0001, 0x6106, 0x080c,
+	0x810c, 0x080c, 0x868e, 0x0470, 0x6014, 0x2048, 0xa87c, 0xd0fc,
+	0x0168, 0x909c, 0x0003, 0x939e, 0x0003, 0x0140, 0x6003, 0x0001,
+	0x6106, 0x080c, 0x810c, 0x080c, 0x868e, 0x00e0, 0x901e, 0x6316,
+	0x631a, 0x2019, 0x0004, 0x080c, 0xd133, 0x00a0, 0x6014, 0x2048,
+	0xa87c, 0xd0fc, 0x0d98, 0x909c, 0x0003, 0x939e, 0x0003, 0x0d70,
+	0x6003, 0x0003, 0x6106, 0x2c10, 0x080c, 0x19aa, 0x080c, 0x8171,
+	0x080c, 0x8769, 0x0005, 0x080c, 0x8589, 0x6114, 0x81ff, 0x0158,
+	0x0096, 0x2148, 0x080c, 0xd42c, 0x0036, 0x2019, 0x0029, 0x080c,
+	0xd133, 0x003e, 0x009e, 0x080c, 0x9af8, 0x080c, 0x868e, 0x0005,
+	0x080c, 0x863e, 0x6114, 0x81ff, 0x0158, 0x0096, 0x2148, 0x080c,
+	0xd42c, 0x0036, 0x2019, 0x0029, 0x080c, 0xd133, 0x003e, 0x009e,
+	0x080c, 0x9af8, 0x080c, 0x8769, 0x0005, 0x9182, 0x0085, 0x0002,
+	0xcc8f, 0xcc8d, 0xcc8d, 0xcc9b, 0xcc8d, 0xcc8d, 0xcc8d, 0xcc8d,
+	0xcc8d, 0xcc8d, 0xcc8d, 0xcc8d, 0xcc8d, 0x080c, 0x0db4, 0x6003,
+	0x000b, 0x6106, 0x080c, 0x810c, 0x0126, 0x2091, 0x8000, 0x080c,
+	0x868e, 0x012e, 0x0005, 0x0026, 0x00e6, 0x080c, 0xd37f, 0x0118,
+	0x080c, 0x9ac8, 0x0450, 0x2071, 0x0260, 0x7224, 0x6216, 0x2001,
+	0x180e, 0x2004, 0xd0e4, 0x0150, 0x6010, 0x00b6, 0x2058, 0xbca0,
+	0x00be, 0x2c00, 0x2011, 0x014e, 0x080c, 0x9de8, 0x7220, 0x080c,
+	0xcfd9, 0x0118, 0x6007, 0x0086, 0x0040, 0x6007, 0x0087, 0x7224,
+	0x9296, 0xffff, 0x1110, 0x6007, 0x0086, 0x6003, 0x0001, 0x080c,
+	0x810c, 0x080c, 0x868e, 0x080c, 0x8769, 0x00ee, 0x002e, 0x0005,
+	0x9186, 0x0013, 0x1160, 0x6004, 0x908a, 0x0085, 0x0a0c, 0x0db4,
+	0x908a, 0x0092, 0x1a0c, 0x0db4, 0x9082, 0x0085, 0x00a2, 0x9186,
+	0x0027, 0x0130, 0x9186, 0x0014, 0x0118, 0x080c, 0x9b5d, 0x0050,
+	0x2001, 0x0007, 0x080c, 0x5f6e, 0x080c, 0x8589, 0x080c, 0x9af8,
+	0x080c, 0x868e, 0x0005, 0xcd00, 0xcd02, 0xcd02, 0xcd00, 0xcd00,
+	0xcd00, 0xcd00, 0xcd00, 0xcd00, 0xcd00, 0xcd00, 0xcd00, 0xcd00,
+	0x080c, 0x0db4, 0x080c, 0x8589, 0x080c, 0x9af8, 0x080c, 0x868e,
+	0x0005, 0x9182, 0x0085, 0x0a0c, 0x0db4, 0x9182, 0x0092, 0x1a0c,
+	0x0db4, 0x9182, 0x0085, 0x0002, 0xcd21, 0xcd21, 0xcd21, 0xcd23,
+	0xcd21, 0xcd21, 0xcd21, 0xcd21, 0xcd21, 0xcd21, 0xcd21, 0xcd21,
+	0xcd21, 0x080c, 0x0db4, 0x0005, 0x9186, 0x0013, 0x0148, 0x9186,
+	0x0014, 0x0130, 0x9186, 0x0027, 0x0118, 0x080c, 0x9b5d, 0x0030,
+	0x080c, 0x8589, 0x080c, 0x9af8, 0x080c, 0x868e, 0x0005, 0x0036,
+	0x080c, 0xd3e0, 0x6043, 0x0000, 0x2019, 0x000b, 0x0031, 0x6023,
+	0x0006, 0x6003, 0x0007, 0x003e, 0x0005, 0x0126, 0x0036, 0x2091,
+	0x8000, 0x0086, 0x2c40, 0x0096, 0x904e, 0x080c, 0x9450, 0x009e,
+	0x008e, 0x1550, 0x0076, 0x2c38, 0x080c, 0x94fb, 0x007e, 0x1520,
+	0x6000, 0x9086, 0x0000, 0x0500, 0x6020, 0x9086, 0x0007, 0x01e0,
+	0x0096, 0x601c, 0xd084, 0x0140, 0x080c, 0xd3e0, 0x080c, 0xbe9e,
+	0x080c, 0x185b, 0x6023, 0x0007, 0x6014, 0x2048, 0x080c, 0xb793,
+	0x0110, 0x080c, 0xd133, 0x009e, 0x6017, 0x0000, 0x080c, 0xd3e0,
+	0x6023, 0x0007, 0x080c, 0xbe9e, 0x003e, 0x012e, 0x0005, 0x00f6,
+	0x00c6, 0x00b6, 0x0036, 0x0156, 0x2079, 0x0260, 0x7938, 0x783c,
+	0x080c, 0x250b, 0x15b8, 0x0016, 0x00c6, 0x080c, 0x5ff1, 0x1580,
+	0x001e, 0x00c6, 0x2160, 0x080c, 0xbe9b, 0x00ce, 0x002e, 0x0026,
+	0x0016, 0x2019, 0x0029, 0x080c, 0x95bc, 0x080c, 0x828c, 0x0076,
+	0x903e, 0x080c, 0x8184, 0x007e, 0x001e, 0x0076, 0x903e, 0x080c,
+	0xcef9, 0x007e, 0x0026, 0xba04, 0x9294, 0xff00, 0x8217, 0x9286,
+	0x0006, 0x0118, 0x9286, 0x0004, 0x1118, 0xbaa0, 0x080c, 0x2f38,
+	0x002e, 0x001e, 0x080c, 0x5aae, 0xbe12, 0xbd16, 0x9006, 0x0010,
+	0x00ce, 0x001e, 0x015e, 0x003e, 0x00be, 0x00ce, 0x00fe, 0x0005,
+	0x00c6, 0x00d6, 0x00b6, 0x0016, 0x2009, 0x1823, 0x2104, 0x9086,
+	0x0074, 0x1904, 0xce21, 0x2069, 0x0260, 0x6944, 0x9182, 0x0100,
+	0x06e0, 0x6940, 0x9184, 0x8000, 0x0904, 0xce1e, 0x2001, 0x194d,
+	0x2004, 0x9005, 0x1140, 0x6010, 0x2058, 0xb8b0, 0x9005, 0x0118,
+	0x9184, 0x0800, 0x0598, 0x6948, 0x918a, 0x0001, 0x0648, 0x080c,
+	0xd494, 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, 0x6000, 0x0804,
+	0xce88, 0x2011, 0x0276, 0x20a9, 0x0004, 0x0096, 0x2b48, 0x2019,
+	0x000a, 0x080c, 0xaaa3, 0x009e, 0x15a0, 0x2011, 0x027a, 0x20a9,
+	0x0004, 0x0096, 0x2b48, 0x2019, 0x0006, 0x080c, 0xaaa3, 0x009e,
+	0x1540, 0x0046, 0x0016, 0xbaa0, 0x2220, 0x9006, 0x2009, 0x1854,
+	0x210c, 0x0038, 0x2009, 0x0029, 0x080c, 0xd188, 0xb800, 0xc0e5,
+	0xb802, 0x2019, 0x0029, 0x080c, 0x828c, 0x0076, 0x2039, 0x0000,
+	0x080c, 0x8184, 0x2c08, 0x080c, 0xcef9, 0x007e, 0x2001, 0x0007,
+	0x080c, 0x5f6e, 0x2001, 0x0007, 0x080c, 0x5f42, 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, 0x250b,
+	0x11d0, 0x080c, 0x5ff1, 0x11b8, 0x2011, 0x0270, 0x20a9, 0x0004,
+	0x0096, 0x2b48, 0x2019, 0x000a, 0x080c, 0xaaa3, 0x009e, 0x1158,
+	0x2011, 0x0274, 0x20a9, 0x0004, 0x0096, 0x2b48, 0x2019, 0x0006,
+	0x080c, 0xaaa3, 0x009e, 0x015e, 0x003e, 0x002e, 0x001e, 0x00fe,
+	0x00be, 0x0005, 0x00b6, 0x0006, 0x0016, 0x0026, 0x0036, 0x0156,
+	0x2011, 0x0263, 0x2204, 0x8211, 0x220c, 0x080c, 0x250b, 0x11d0,
+	0x080c, 0x5ff1, 0x11b8, 0x2011, 0x0276, 0x20a9, 0x0004, 0x0096,
+	0x2b48, 0x2019, 0x000a, 0x080c, 0xaaa3, 0x009e, 0x1158, 0x2011,
+	0x027a, 0x20a9, 0x0004, 0x0096, 0x2b48, 0x2019, 0x0006, 0x080c,
+	0xaaa3, 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, 0x7650,
+	0x7070, 0x81ff, 0x0150, 0x0006, 0x9186, 0x1a77, 0x000e, 0x0128,
+	0x8001, 0x9602, 0x1a04, 0xcf92, 0x0018, 0x9606, 0x0904, 0xcf92,
+	0x2100, 0x9c06, 0x0904, 0xcf89, 0x080c, 0xd1c4, 0x1904, 0xcf89,
+	0x080c, 0xd4b1, 0x0904, 0xcf89, 0x080c, 0xd1b4, 0x0904, 0xcf89,
+	0x6720, 0x9786, 0x0001, 0x1148, 0x080c, 0x2fcf, 0x0904, 0xcfad,
+	0x6004, 0x9086, 0x0000, 0x1904, 0xcfad, 0x9786, 0x0004, 0x0904,
+	0xcfad, 0x9786, 0x0007, 0x0904, 0xcf89, 0x2500, 0x9c06, 0x0904,
+	0xcf89, 0x2400, 0x9c06, 0x05e8, 0x88ff, 0x0118, 0x6054, 0x9906,
+	0x15c0, 0x0096, 0x6000, 0x9086, 0x0004, 0x1120, 0x0016, 0x080c,
+	0x185b, 0x001e, 0x9786, 0x000a, 0x0148, 0x080c, 0xb992, 0x1130,
+	0x080c, 0xa456, 0x009e, 0x080c, 0x9af8, 0x0418, 0x6014, 0x2048,
+	0x080c, 0xb793, 0x01d8, 0x9786, 0x0003, 0x1570, 0xa867, 0x0103,
+	0xab7a, 0xa877, 0x0000, 0xa87c, 0xd0cc, 0x0130, 0x0096, 0xa878,
+	0x2048, 0x080c, 0x0f9e, 0x009e, 0x080c, 0xd42c, 0x0016, 0x080c,
+	0xba7b, 0x080c, 0x65e5, 0x001e, 0x080c, 0xb975, 0x009e, 0x080c,
+	0x9af8, 0x9ce0, 0x0018, 0x2001, 0x1819, 0x2004, 0x9c02, 0x1210,
+	0x0804, 0xcf0d, 0x012e, 0x002e, 0x004e, 0x005e, 0x006e, 0x007e,
+	0x008e, 0x00ce, 0x00ee, 0x0005, 0x9786, 0x0006, 0x1150, 0x9386,
+	0x0005, 0x0128, 0x080c, 0xd42c, 0x080c, 0xd133, 0x08f8, 0x009e,
+	0x0c00, 0x9786, 0x000a, 0x0920, 0x0808, 0x81ff, 0x09d0, 0x9180,
+	0x0001, 0x2004, 0x9086, 0x0018, 0x0130, 0x9180, 0x0001, 0x2004,
+	0x9086, 0x002d, 0x1970, 0x6000, 0x9086, 0x0002, 0x1950, 0x080c,
+	0xb981, 0x0130, 0x080c, 0xb992, 0x1920, 0x080c, 0xa456, 0x0038,
+	0x080c, 0x2ea4, 0x080c, 0xb992, 0x1110, 0x080c, 0xa456, 0x080c,
+	0x9af8, 0x0804, 0xcf89, 0xa864, 0x9084, 0x00ff, 0x9086, 0x0039,
+	0x0005, 0x00c6, 0x00e6, 0x0016, 0x2c08, 0x2170, 0x9006, 0x080c,
+	0xd15a, 0x001e, 0x0120, 0x6020, 0x9084, 0x000f, 0x001b, 0x00ee,
+	0x00ce, 0x0005, 0xcff8, 0xcff8, 0xcff8, 0xcff8, 0xcff8, 0xcff8,
+	0xcffa, 0xcff8, 0xcff8, 0xcff8, 0xcff8, 0x9af8, 0x9af8, 0xcff8,
+	0x9006, 0x0005, 0x0036, 0x0046, 0x0016, 0x7010, 0x00b6, 0x2058,
+	0xbca0, 0x00be, 0x2c00, 0x2009, 0x0020, 0x080c, 0xd188, 0x001e,
+	0x004e, 0x2019, 0x0002, 0x080c, 0xcd45, 0x003e, 0x9085, 0x0001,
+	0x0005, 0x0096, 0x080c, 0xb793, 0x0140, 0x6014, 0x904d, 0x080c,
+	0xb3e0, 0x687b, 0x0005, 0x080c, 0x65f2, 0x009e, 0x080c, 0x9af8,
+	0x9085, 0x0001, 0x0005, 0x2001, 0x0001, 0x080c, 0x5f2e, 0x0156,
+	0x0016, 0x0026, 0x0036, 0x20a9, 0x0004, 0x2019, 0x1805, 0x2011,
+	0x0276, 0x080c, 0xaa8f, 0x003e, 0x002e, 0x001e, 0x015e, 0x9005,
+	0x0005, 0x00f6, 0x00e6, 0x00c6, 0x0086, 0x0076, 0x0066, 0x00b6,
+	0x0126, 0x2091, 0x8000, 0x2740, 0x2061, 0x1cd0, 0x2079, 0x0001,
+	0x8fff, 0x0904, 0xd093, 0x2071, 0x1800, 0x7650, 0x7070, 0x8001,
+	0x9602, 0x1a04, 0xd093, 0x88ff, 0x0120, 0x2800, 0x9c06, 0x1590,
+	0x2078, 0x080c, 0xd1b4, 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, 0xd3e0, 0x080c, 0xbe9e,
+	0x080c, 0x185b, 0x6023, 0x0007, 0x6014, 0x2048, 0x080c, 0xb793,
+	0x0120, 0x0046, 0x080c, 0xd133, 0x004e, 0x009e, 0x080c, 0x9af8,
+	0x88ff, 0x1198, 0x9ce0, 0x0018, 0x2001, 0x1819, 0x2004, 0x9c02,
+	0x1210, 0x0804, 0xd048, 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, 0x9450,
+	0x009e, 0x008e, 0x903e, 0x080c, 0x94fb, 0x080c, 0xd039, 0x005e,
+	0x007e, 0x00be, 0x0005, 0x00b6, 0x0046, 0x0056, 0x0076, 0x00c6,
+	0x0156, 0x2c20, 0x2128, 0x20a9, 0x007f, 0x900e, 0x0016, 0x0036,
+	0x080c, 0x5ff1, 0x1190, 0x0056, 0x0086, 0x9046, 0x2508, 0x2029,
+	0x0001, 0x0096, 0x904e, 0x080c, 0x9450, 0x009e, 0x008e, 0x903e,
+	0x080c, 0x94fb, 0x080c, 0xd039, 0x005e, 0x003e, 0x001e, 0x8108,
+	0x1f04, 0xd0c6, 0x015e, 0x00ce, 0x007e, 0x005e, 0x004e, 0x00be,
+	0x0005, 0x00b6, 0x0076, 0x0056, 0x6210, 0x2258, 0x0086, 0x9046,
+	0x2029, 0x0001, 0x2019, 0x0048, 0x0096, 0x904e, 0x080c, 0x9450,
+	0x009e, 0x008e, 0x903e, 0x080c, 0x94fb, 0x2c20, 0x080c, 0xd039,
+	0x005e, 0x007e, 0x00be, 0x0005, 0x00b6, 0x0046, 0x0056, 0x0076,
+	0x00c6, 0x0156, 0x2c20, 0x20a9, 0x0800, 0x900e, 0x0016, 0x0036,
+	0x080c, 0x5ff1, 0x11a0, 0x0086, 0x9046, 0x2828, 0x0046, 0x2021,
+	0x0001, 0x080c, 0xd3c4, 0x004e, 0x0096, 0x904e, 0x080c, 0x9450,
+	0x009e, 0x008e, 0x903e, 0x080c, 0x94fb, 0x080c, 0xd039, 0x003e,
+	0x001e, 0x8108, 0x1f04, 0xd10e, 0x015e, 0x00ce, 0x007e, 0x005e,
+	0x004e, 0x00be, 0x0005, 0x0016, 0x00f6, 0x080c, 0xb791, 0x0198,
+	0xa864, 0x9084, 0x00ff, 0x9086, 0x0046, 0x0180, 0xa800, 0x907d,
+	0x0138, 0xa803, 0x0000, 0xab82, 0x080c, 0x65f2, 0x2f48, 0x0cb0,
+	0xab82, 0x080c, 0x65f2, 0x00fe, 0x001e, 0x0005, 0xa800, 0x907d,
+	0x0130, 0xa803, 0x0000, 0x080c, 0x65f2, 0x2f48, 0x0cb8, 0x080c,
+	0x65f2, 0x0c88, 0x00e6, 0x0046, 0x0036, 0x2061, 0x1cd0, 0x9005,
+	0x1138, 0x2071, 0x1800, 0x7450, 0x7070, 0x8001, 0x9402, 0x12d8,
+	0x2100, 0x9c06, 0x0168, 0x6000, 0x9086, 0x0000, 0x0148, 0x6008,
+	0x9206, 0x1130, 0x6010, 0x91a0, 0x0004, 0x2424, 0x9406, 0x0140,
+	0x9ce0, 0x0018, 0x2001, 0x1819, 0x2004, 0x9c02, 0x1220, 0x0c40,
+	0x9085, 0x0001, 0x0008, 0x9006, 0x003e, 0x004e, 0x00ee, 0x0005,
+	0x0096, 0x0006, 0x080c, 0x0fec, 0x000e, 0x090c, 0x0db4, 0xa867,
+	0x010d, 0xa88e, 0x0026, 0x2010, 0x080c, 0xb781, 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,
+	0x65f2, 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,
+	0x810c, 0x080c, 0x868e, 0x001e, 0x0005, 0xa001, 0xa001, 0x0005,
+	0x6024, 0xd0e4, 0x0158, 0xd0cc, 0x0118, 0x080c, 0xbabf, 0x0030,
+	0x080c, 0xd3e0, 0x080c, 0x7f1f, 0x080c, 0x9ac8, 0x0005, 0x9280,
+	0x0008, 0x2004, 0x9084, 0x000f, 0x0002, 0xd213, 0xd213, 0xd213,
+	0xd215, 0xd213, 0xd215, 0xd215, 0xd213, 0xd215, 0xd213, 0xd213,
+	0xd213, 0xd213, 0xd213, 0x9006, 0x0005, 0x9085, 0x0001, 0x0005,
+	0x9280, 0x0008, 0x2004, 0x9084, 0x000f, 0x0002, 0xd22c, 0xd22c,
+	0xd22c, 0xd22c, 0xd22c, 0xd22c, 0xd239, 0xd22c, 0xd22c, 0xd22c,
+	0xd22c, 0xd22c, 0xd22c, 0xd22c, 0x6007, 0x003b, 0x602f, 0x0009,
+	0x6017, 0x2a00, 0x6003, 0x0001, 0x080c, 0x810c, 0x080c, 0x868e,
+	0x0005, 0x0096, 0x00c6, 0x2260, 0x080c, 0xd3e0, 0x6043, 0x0000,
+	0x6024, 0xc0f4, 0xc0e4, 0x6026, 0x603b, 0x0000, 0x00ce, 0x00d6,
+	0x2268, 0x9186, 0x0007, 0x1904, 0xd292, 0x6814, 0x9005, 0x0138,
+	0x2048, 0xa87c, 0xd0fc, 0x1118, 0x00de, 0x009e, 0x08a8, 0x6007,
+	0x003a, 0x6003, 0x0001, 0x080c, 0x810c, 0x080c, 0x868e, 0x00c6,
+	0x2d60, 0x6100, 0x9186, 0x0002, 0x1904, 0xd309, 0x6014, 0x9005,
+	0x1138, 0x6000, 0x9086, 0x0007, 0x190c, 0x0db4, 0x0804, 0xd309,
+	0x2048, 0x080c, 0xb793, 0x1130, 0x0028, 0x2048, 0xa800, 0x9005,
+	0x1de0, 0x2900, 0x2048, 0xa87c, 0x9084, 0x0003, 0x9086, 0x0002,
+	0x1168, 0xa87c, 0xc0dc, 0xc0f4, 0xa87e, 0xa880, 0xc0fc, 0xa882,
+	0x2009, 0x0043, 0x080c, 0xcb9e, 0x0804, 0xd309, 0x2009, 0x0041,
+	0x0804, 0xd303, 0x9186, 0x0005, 0x15a0, 0x6814, 0x2048, 0xa87c,
+	0xd0bc, 0x1120, 0x00de, 0x009e, 0x0804, 0xd22c, 0xd0b4, 0x0128,
+	0xd0fc, 0x090c, 0x0db4, 0x0804, 0xd24d, 0x6007, 0x003a, 0x6003,
+	0x0001, 0x080c, 0x810c, 0x080c, 0x868e, 0x00c6, 0x2d60, 0x6100,
+	0x9186, 0x0002, 0x0120, 0x9186, 0x0004, 0x1904, 0xd309, 0x6814,
+	0x2048, 0xa97c, 0xc1f4, 0xc1dc, 0xa97e, 0xa980, 0xc1fc, 0xc1bc,
+	0xa982, 0x00f6, 0x2c78, 0x080c, 0x15ad, 0x00fe, 0x2009, 0x0042,
+	0x04d0, 0x0036, 0x080c, 0x0fec, 0x090c, 0x0db4, 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, 0x65f2, 0x2019, 0x0045, 0x6008, 0x2068, 0x080c, 0xcd45,
+	0x2d00, 0x600a, 0x6023, 0x0006, 0x6003, 0x0007, 0x901e, 0x631a,
+	0x6342, 0x003e, 0x0038, 0x6043, 0x0000, 0x6003, 0x0007, 0x080c,
+	0xcb9e, 0x00ce, 0x00de, 0x009e, 0x0005, 0x9186, 0x0013, 0x1128,
+	0x6004, 0x9082, 0x0085, 0x2008, 0x00c2, 0x9186, 0x0027, 0x1178,
+	0x080c, 0x8589, 0x0036, 0x0096, 0x6014, 0x2048, 0x2019, 0x0004,
+	0x080c, 0xd133, 0x009e, 0x003e, 0x080c, 0x868e, 0x0005, 0x9186,
+	0x0014, 0x0d70, 0x080c, 0x9b5d, 0x0005, 0xd33c, 0xd33a, 0xd33a,
+	0xd33a, 0xd33a, 0xd33a, 0xd33c, 0xd33a, 0xd33a, 0xd33a, 0xd33a,
+	0xd33a, 0xd33a, 0x080c, 0x0db4, 0x080c, 0x8589, 0x6003, 0x000c,
+	0x080c, 0x868e, 0x0005, 0x9182, 0x0092, 0x1220, 0x9182, 0x0085,
+	0x0208, 0x001a, 0x080c, 0x9b5d, 0x0005, 0xd35a, 0xd35a, 0xd35a,
+	0xd35a, 0xd35c, 0xd37c, 0xd35a, 0xd35a, 0xd35a, 0xd35a, 0xd35a,
+	0xd35a, 0xd35a, 0x080c, 0x0db4, 0x00d6, 0x2c68, 0x080c, 0x9a72,
+	0x01b0, 0x6003, 0x0001, 0x6007, 0x001e, 0x2009, 0x026e, 0x210c,
+	0x613a, 0x2009, 0x026f, 0x210c, 0x613e, 0x600b, 0xffff, 0x6910,
+	0x6112, 0x6023, 0x0004, 0x080c, 0x810c, 0x080c, 0x868e, 0x2d60,
+	0x080c, 0x9ac8, 0x00de, 0x0005, 0x080c, 0x9ac8, 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, 0x7f1f, 0x080c, 0x9ac8, 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, 0x182b, 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, 0xaaa3,
+	0x009e, 0x1168, 0x2011, 0x0274, 0x20a9, 0x0004, 0x6010, 0x0096,
+	0x2048, 0x2019, 0x0006, 0x080c, 0xaaa3, 0x009e, 0x1100, 0x015e,
+	0x003e, 0x002e, 0x0005, 0x00e6, 0x2071, 0x1800, 0x080c, 0x5a27,
+	0x080c, 0x2c63, 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, 0x7650, 0x7070, 0x9606, 0x0578, 0x6720, 0x9786, 0x0001,
+	0x0118, 0x9786, 0x0008, 0x1500, 0x2500, 0x9c06, 0x01e8, 0x2400,
+	0x9c06, 0x01d0, 0x080c, 0xd1b4, 0x01b8, 0x080c, 0xd1c4, 0x11a0,
+	0x6000, 0x9086, 0x0004, 0x1120, 0x0016, 0x080c, 0x185b, 0x001e,
+	0x080c, 0xb981, 0x1110, 0x080c, 0x2ea4, 0x080c, 0xb992, 0x1110,
+	0x080c, 0xa456, 0x080c, 0x9af8, 0x9ce0, 0x0018, 0x2001, 0x1819,
+	0x2004, 0x9c02, 0x1208, 0x0858, 0x012e, 0x001e, 0x002e, 0x004e,
+	0x005e, 0x006e, 0x007e, 0x00ce, 0x00de, 0x00ee, 0x0005, 0x2001,
+	0x1810, 0x2004, 0xd0dc, 0x0005, 0x0006, 0x2001, 0x1836, 0x2004,
+	0xd09c, 0x000e, 0x0005, 0x0006, 0x0036, 0x0046, 0x080c, 0xbe86,
+	0x0168, 0x2019, 0xffff, 0x9005, 0x0128, 0x6010, 0x00b6, 0x2058,
+	0xbba0, 0x00be, 0x2021, 0x0004, 0x080c, 0x4856, 0x004e, 0x003e,
+	0x000e, 0x6004, 0x9086, 0x0001, 0x1128, 0x080c, 0x95bc, 0x080c,
+	0x9af8, 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, 0x0003, 0x000b, 0x04a6, 0x0000, 0xc000, 0x0001,
+	0x8064, 0x0008, 0x0010, 0x0000, 0x8066, 0x0000, 0x0101, 0x0008,
+	0x4407, 0x0003, 0x8060, 0x0000, 0x0400, 0x0000, 0x580d, 0x000b,
+	0x798e, 0x0003, 0x50db, 0x000b, 0x4c0a, 0x0003, 0xbac0, 0x0009,
+	0x008a, 0x0000, 0x0c0a, 0x000b, 0x15fe, 0x0008, 0x340a, 0x0003,
+	0xc4c0, 0x0009, 0x7000, 0x0000, 0xffa0, 0x0001, 0x2000, 0x0000,
+	0x1627, 0x0003, 0x808c, 0x0008, 0x0001, 0x0000, 0x0000, 0x0007,
+	0x4047, 0x000a, 0x808c, 0x0008, 0x0002, 0x0000, 0x0821, 0x0003,
+	0x4022, 0x0000, 0x0022, 0x000b, 0x4122, 0x0008, 0x4447, 0x0002,
+	0x0e4f, 0x000b, 0x0bfe, 0x0008, 0x11a0, 0x0001, 0x122d, 0x000b,
+	0x0ca0, 0x0001, 0x122d, 0x000b, 0x9180, 0x0001, 0x0004, 0x0000,
+	0x8060, 0x0000, 0x0400, 0x0000, 0x7f62, 0x0008, 0x8066, 0x0000,
+	0x0009, 0x0008, 0x4430, 0x000b, 0x808c, 0x0008, 0x0000, 0x0008,
+	0x0060, 0x0008, 0x8062, 0x0008, 0x0004, 0x0000, 0x8066, 0x0000,
+	0x0411, 0x0000, 0x4438, 0x0003, 0x03fe, 0x0000, 0x43e0, 0x0001,
+	0x0e2a, 0x000b, 0xc2c0, 0x0009, 0x00ff, 0x0008, 0x02e0, 0x0001,
+	0x0e2a, 0x000b, 0x9180, 0x0001, 0x0005, 0x0008, 0x8060, 0x0000,
+	0x0400, 0x0000, 0x7f62, 0x0008, 0x8066, 0x0000, 0x0019, 0x0000,
+	0x4447, 0x000b, 0x0240, 0x0002, 0x0a27, 0x000b, 0x00fe, 0x0000,
+	0x322a, 0x000b, 0x112a, 0x0000, 0x002e, 0x0008, 0x022c, 0x0008,
+	0x3a44, 0x0002, 0x0c0a, 0x000b, 0x808c, 0x0008, 0x0002, 0x0000,
+	0x1760, 0x0008, 0x8062, 0x0008, 0x000f, 0x0008, 0x8066, 0x0000,
+	0x0011, 0x0008, 0x4458, 0x0003, 0x01fe, 0x0008, 0x42e0, 0x0009,
+	0x0e1d, 0x0003, 0x00fe, 0x0000, 0x43e0, 0x0001, 0x0e1d, 0x0003,
+	0x1734, 0x0000, 0x1530, 0x0000, 0x1632, 0x0008, 0x0d2a, 0x0008,
+	0x9880, 0x0001, 0x0010, 0x0000, 0x8060, 0x0000, 0x0400, 0x0000,
+	0x7f62, 0x0008, 0x8066, 0x0000, 0x1e0a, 0x0008, 0x446a, 0x000b,
+	0x808a, 0x0008, 0x0003, 0x0008, 0x1a60, 0x0000, 0x8062, 0x0008,
+	0x0002, 0x0000, 0x5870, 0x000b, 0x8066, 0x0000, 0x3679, 0x0000,
+	0x4473, 0x0003, 0x5874, 0x0003, 0x3efe, 0x0008, 0x7f4f, 0x0002,
+	0x087a, 0x000b, 0x0d00, 0x0000, 0x0082, 0x0004, 0x8054, 0x0008,
+	0x0011, 0x0008, 0x8074, 0x0000, 0x1010, 0x0008, 0x1efe, 0x0000,
+	0x300a, 0x000b, 0x00b8, 0x0004, 0x000a, 0x000b, 0x00fe, 0x0000,
+	0x348a, 0x000b, 0x1a60, 0x0000, 0x8062, 0x0008, 0x0007, 0x0000,
+	0x8066, 0x0000, 0x0231, 0x0008, 0x4489, 0x0003, 0x03fe, 0x0000,
+	0x04d0, 0x0001, 0x0cb0, 0x0003, 0x82c0, 0x0001, 0x1f00, 0x0000,
+	0xffa0, 0x0001, 0x0400, 0x0000, 0x089f, 0x0003, 0x14b0, 0x0003,
+	0x01fe, 0x0008, 0x0580, 0x0009, 0x7f06, 0x0000, 0x02fe, 0x0008,
+	0xffc0, 0x0001, 0x00ff, 0x0008, 0x0690, 0x0001, 0x109f, 0x0003,
+	0x7f08, 0x0008, 0x84c0, 0x0001, 0xff00, 0x0008, 0x08b0, 0x000b,
+	0x00fe, 0x0000, 0x34a6, 0x0003, 0x8072, 0x0000, 0x1010, 0x0008,
+	0x3944, 0x0002, 0x08a1, 0x000b, 0x00aa, 0x000b, 0x8072, 0x0000,
+	0x2020, 0x0008, 0x3945, 0x000a, 0x08a6, 0x0003, 0x3946, 0x000a,
+	0x0cb7, 0x000b, 0x0000, 0x0007, 0x3943, 0x000a, 0x08b7, 0x0003,
+	0x00aa, 0x000b, 0x00fe, 0x0000, 0x34b5, 0x000b, 0x8072, 0x0000,
+	0x1000, 0x0000, 0x00b7, 0x000b, 0x8072, 0x0000, 0x2000, 0x0000,
+	0x4000, 0x000f, 0x1c60, 0x0000, 0x1b62, 0x0000, 0x8066, 0x0000,
+	0x0231, 0x0008, 0x44bc, 0x0003, 0x58bd, 0x0003, 0x0140, 0x0008,
+	0x0242, 0x0000, 0x1f43, 0x0002, 0x0ccb, 0x0003, 0x0d44, 0x0000,
+	0x0d46, 0x0008, 0x0348, 0x0008, 0x044a, 0x0008, 0x030a, 0x0008,
+	0x040c, 0x0000, 0x0d06, 0x0000, 0x0d08, 0x0008, 0x00cf, 0x000b,
+	0x0344, 0x0008, 0x0446, 0x0008, 0x0548, 0x0008, 0x064a, 0x0000,
+	0x58cf, 0x0003, 0x3efe, 0x0008, 0x7f4f, 0x0002, 0x08d6, 0x000b,
+	0x8000, 0x0000, 0x0001, 0x0000, 0x0082, 0x0004, 0x8054, 0x0008,
+	0x0001, 0x0000, 0x8074, 0x0000, 0x2020, 0x0008, 0x4000, 0x000f,
+	0x3a40, 0x000a, 0x0c0d, 0x0003, 0x2b24, 0x0008, 0x2b24, 0x0008,
+	0x58df, 0x000b, 0x8054, 0x0008, 0x0002, 0x0000, 0x1242, 0x0002,
+	0x092d, 0x000b, 0x3a45, 0x000a, 0x091c, 0x0003, 0x8072, 0x0000,
+	0x1000, 0x0000, 0x3945, 0x000a, 0x08ec, 0x000b, 0x8072, 0x0000,
+	0x3010, 0x0000, 0x1e10, 0x000a, 0x7f3c, 0x0000, 0x0917, 0x000b,
+	0x1d00, 0x0002, 0x7f3a, 0x0000, 0x0d60, 0x0000, 0x7f62, 0x0008,
+	0x8066, 0x0000, 0x0009, 0x0008, 0x44f5, 0x000b, 0x00fe, 0x0000,
+	0x3514, 0x000b, 0x1c60, 0x0000, 0x8062, 0x0008, 0x0001, 0x0000,
+	0x8066, 0x0000, 0x0009, 0x0008, 0x44fd, 0x0003, 0x00fe, 0x0000,
+	0x3204, 0x000b, 0x0038, 0x0000, 0x0060, 0x0008, 0x8062, 0x0008,
+	0x0019, 0x0000, 0x8066, 0x0000, 0x0009, 0x0008, 0x4506, 0x0003,
+	0x80c0, 0x0009, 0x00ff, 0x0008, 0x7f3e, 0x0008, 0x0d60, 0x0000,
+	0x0efe, 0x0008, 0x1f80, 0x0001, 0x7f62, 0x0008, 0x8066, 0x0000,
+	0x0009, 0x0008, 0x4510, 0x000b, 0x003a, 0x0008, 0x1dfe, 0x0000,
+	0x00f1, 0x0003, 0x0036, 0x0008, 0x00b8, 0x0004, 0x012d, 0x0003,
+	0x8074, 0x0000, 0x2000, 0x0000, 0x8072, 0x0000, 0x2000, 0x0000,
+	0x012d, 0x0003, 0x3a44, 0x0002, 0x0a30, 0x000b, 0x8074, 0x0000,
+	0x1000, 0x0000, 0x8072, 0x0000, 0x1000, 0x0000, 0x2d0e, 0x0000,
+	0x2d0e, 0x0000, 0x3601, 0x0003, 0x26fe, 0x0008, 0x26fe, 0x0008,
+	0x2700, 0x0008, 0x2700, 0x0008, 0x00d0, 0x0009, 0x0d3f, 0x0003,
+	0x8074, 0x0000, 0x4040, 0x0008, 0x592d, 0x000b, 0x50db, 0x000b,
+	0x3a46, 0x000a, 0x0d3f, 0x0003, 0x3a47, 0x0002, 0x093a, 0x000b,
+	0x8054, 0x0008, 0x0004, 0x0000, 0x8074, 0x0000, 0x8000, 0x0000,
+	0x8072, 0x0000, 0x3000, 0x0008, 0x0182, 0x0003, 0x92c0, 0x0009,
+	0x0fc8, 0x0000, 0x080a, 0x0003, 0x1246, 0x000a, 0x0dfb, 0x000b,
+	0x1a60, 0x0000, 0x8062, 0x0008, 0x0002, 0x0000, 0x8066, 0x0000,
+	0x362a, 0x0000, 0x4544, 0x0003, 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, 0x455e, 0x000b,
+	0x92c0, 0x0009, 0x0780, 0x0008, 0x0e17, 0x0003, 0x124b, 0x0002,
+	0x0967, 0x0003, 0x2e4d, 0x0002, 0x2e4d, 0x0002, 0x0a01, 0x0003,
+	0x3a46, 0x000a, 0x0d74, 0x0003, 0x5969, 0x000b, 0x8054, 0x0008,
+	0x0004, 0x0000, 0x1243, 0x000a, 0x097e, 0x000b, 0x8010, 0x0008,
+	0x000d, 0x0000, 0x01ef, 0x0004, 0x1810, 0x0000, 0x01ef, 0x0004,
+	0x017e, 0x0003, 0x194d, 0x000a, 0x0978, 0x000b, 0x1243, 0x000a,
+	0x0a0b, 0x0003, 0x5978, 0x000b, 0x8054, 0x0008, 0x0004, 0x0000,
+	0x01e4, 0x000c, 0x1810, 0x0000, 0x01ef, 0x0004, 0x8074, 0x0000,
+	0xf000, 0x0008, 0x8072, 0x0000, 0x3000, 0x0008, 0x0d30, 0x0000,
+	0x3a42, 0x0002, 0x0d88, 0x0003, 0x15fe, 0x0008, 0x3451, 0x000b,
+	0x000a, 0x000b, 0x8074, 0x0000, 0x0501, 0x0000, 0x8010, 0x0008,
+	0x000c, 0x0008, 0x01ef, 0x0004, 0x000a, 0x000b, 0xbbe0, 0x0009,
+	0x0030, 0x0008, 0x0d9e, 0x000b, 0x18fe, 0x0000, 0x3ce0, 0x0009,
+	0x099b, 0x0003, 0x15fe, 0x0008, 0x3ce0, 0x0009, 0x099b, 0x0003,
+	0x01df, 0x0004, 0x8076, 0x0008, 0x0040, 0x0000, 0x01dc, 0x000b,
+	0x8076, 0x0008, 0x0041, 0x0008, 0x01dc, 0x000b, 0xbbe0, 0x0009,
+	0x0032, 0x0000, 0x0da3, 0x0003, 0x3c1e, 0x0008, 0x01dc, 0x000b,
+	0xbbe0, 0x0009, 0x0037, 0x0000, 0x0dc1, 0x000b, 0x18fe, 0x0000,
+	0x3ce0, 0x0009, 0x0d9b, 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, 0x45b8, 0x0003, 0x01e4, 0x000c, 0x8054, 0x0008,
+	0x0004, 0x0000, 0x8074, 0x0000, 0xf000, 0x0008, 0x8072, 0x0000,
+	0xb000, 0x0000, 0x0182, 0x0003, 0xbbe0, 0x0009, 0x0038, 0x0000,
+	0x0dd3, 0x000b, 0x18fe, 0x0000, 0x3ce0, 0x0009, 0x09d0, 0x0003,
+	0x15fe, 0x0008, 0x3ce0, 0x0009, 0x0d97, 0x000b, 0x01df, 0x0004,
+	0x8076, 0x0008, 0x0040, 0x0000, 0x8072, 0x0000, 0x8000, 0x0000,
+	0x0227, 0x0003, 0x8076, 0x0008, 0x0042, 0x0008, 0x01dc, 0x000b,
+	0xbbe0, 0x0009, 0x0016, 0x0000, 0x0ddc, 0x000b, 0x3a44, 0x0002,
+	0x0c0c, 0x000b, 0x8072, 0x0000, 0x8000, 0x0000, 0x8000, 0x000f,
+	0x000a, 0x000b, 0x8072, 0x0000, 0x8000, 0x0000, 0x000a, 0x000b,
+	0x3d30, 0x000a, 0x7f00, 0x0000, 0xbc80, 0x0001, 0x0007, 0x0000,
+	0x01e8, 0x0003, 0x1930, 0x000a, 0x7f00, 0x0000, 0x9880, 0x0001,
+	0x0007, 0x0000, 0x8060, 0x0000, 0x0400, 0x0000, 0x7f62, 0x0008,
+	0x8066, 0x0000, 0x000a, 0x0008, 0x45ed, 0x0003, 0x4000, 0x000f,
+	0x21ef, 0x0003, 0x0870, 0x0008, 0x4000, 0x000f, 0xbac0, 0x0009,
+	0x0090, 0x0008, 0x09f8, 0x0003, 0x8074, 0x0000, 0x0706, 0x0000,
+	0x01fa, 0x0003, 0x8074, 0x0000, 0x0703, 0x0000, 0x4000, 0x000f,
+	0x8010, 0x0008, 0x0023, 0x0000, 0x0235, 0x0003, 0x8010, 0x0008,
+	0x0008, 0x0000, 0x0235, 0x0003, 0x8010, 0x0008, 0x0022, 0x0008,
+	0x0235, 0x0003, 0x01e4, 0x000c, 0x8010, 0x0008, 0x0007, 0x0000,
+	0x01ef, 0x0004, 0x1810, 0x0000, 0x01ef, 0x0004, 0x0241, 0x0003,
+	0x01e4, 0x000c, 0x8010, 0x0008, 0x001b, 0x0008, 0x01ef, 0x0004,
+	0x1810, 0x0000, 0x01ef, 0x0004, 0x8074, 0x0000, 0xf080, 0x0000,
+	0x8072, 0x0000, 0x3000, 0x0008, 0x0d30, 0x0000, 0x000a, 0x000b,
+	0x8010, 0x0008, 0x0009, 0x0008, 0x0235, 0x0003, 0x8010, 0x0008,
+	0x0005, 0x0008, 0x0235, 0x0003, 0x808c, 0x0008, 0x0001, 0x0000,
+	0x8010, 0x0008, 0x0004, 0x0000, 0x4143, 0x000a, 0x085f, 0x0003,
+	0x3a44, 0x0002, 0x0c0a, 0x000b, 0x0d2a, 0x0008, 0x0235, 0x0003,
+	0x8010, 0x0008, 0x0003, 0x0008, 0x0239, 0x0003, 0x8010, 0x0008,
+	0x000b, 0x0000, 0x0239, 0x0003, 0x8010, 0x0008, 0x0002, 0x0000,
+	0x0239, 0x0003, 0x3a47, 0x0002, 0x0d2d, 0x0003, 0x8010, 0x0008,
+	0x0006, 0x0008, 0x0239, 0x0003, 0x8074, 0x0000, 0xf000, 0x0008,
+	0x8072, 0x0000, 0x3000, 0x0008, 0x01ef, 0x0004, 0x01f2, 0x0004,
+	0x3a40, 0x000a, 0x080a, 0x0003, 0x8010, 0x0008, 0x000c, 0x0008,
+	0x01ef, 0x0004, 0x000a, 0x000b, 0x8074, 0x0000, 0xf080, 0x0000,
+	0x8072, 0x0000, 0x3000, 0x0008, 0x0d30, 0x0000, 0x2e4d, 0x0002,
+	0x2e4d, 0x0002, 0x0a4c, 0x0003, 0x8054, 0x0008, 0x0019, 0x0000,
+	0x000a, 0x000b, 0x8054, 0x0008, 0x0009, 0x0008, 0x000a, 0x000b,
+	0x3a44, 0x0002, 0x0c0a, 0x000b, 0x022a, 0x000b, 0x15b6, 0xf4ac,
+	0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080,
+	0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000, 0x8000,
+	0x9298
+};
+#ifdef UNIQUE_FW_NAME
+unsigned short fw2300flx_length01 = 0xd1c9;
+#else
+unsigned short risc_code_length01 = 0xd1c9;
+#endif
+
--- diff/drivers/scsi/qla2xxx/ql6322.c	1970-01-01 01:00:00.000000000 +0100
+++ source/drivers/scsi/qla2xxx/ql6322.c	2004-02-09 10:39:55.000000000 +0000
@@ -0,0 +1,108 @@
+/*
+ * QLogic ISP6322 device driver for Linux 2.6.x
+ * 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[] = "qla6322";
+
+extern unsigned char  fw2322flx_version[];
+extern unsigned char  fw2322flx_version_str[];
+extern unsigned short fw2322flx_addr01;
+extern unsigned short fw2322flx_code01[];
+extern unsigned short fw2322flx_length01;
+extern unsigned long rseqflx_code_addr01;
+extern unsigned short rseqflx_code01[];
+extern unsigned short rseqflx_code_length01;
+extern unsigned long xseqflx_code_addr01;
+extern unsigned short xseqflx_code01[];
+extern unsigned short xseqflx_code_length01;
+
+static struct qla_fw_info qla_fw_tbl[] = {
+	{
+		.addressing	= FW_INFO_ADDR_NORMAL,
+		.fwcode		= &fw2322flx_code01[0],
+		.fwlen		= &fw2322flx_length01,
+		.fwstart	= &fw2322flx_addr01,
+	},
+	{
+		.addressing	= FW_INFO_ADDR_EXTENDED,
+		.fwcode		= &rseqflx_code01[0],
+		.fwlen		= &rseqflx_code_length01,
+		.lfwstart	= &rseqflx_code_addr01,
+	},
+	{
+		.addressing	= FW_INFO_ADDR_EXTENDED,
+		.fwcode		= &xseqflx_code01[0],
+		.fwlen		= &xseqflx_code_length01,
+		.lfwstart	= &xseqflx_code_addr01,
+	},
+	{ FW_INFO_ADDR_NOMORE, },
+};
+
+static struct qla_board_info qla_board_tbl[] = {
+	{
+		.drv_name	= qla_driver_name,
+		.isp_name	= "ISP6322",
+		.fw_info	= qla_fw_tbl,
+	},
+};
+
+static struct pci_device_id qla6322_pci_tbl[] = {
+	{
+		.vendor		= PCI_VENDOR_ID_QLOGIC,
+		.device		= PCI_DEVICE_ID_QLOGIC_ISP6322,
+		.subvendor	= PCI_ANY_ID,
+		.subdevice	= PCI_ANY_ID,
+		.driver_data	= (unsigned long)&qla_board_tbl[0],
+	},
+	{0, 0},
+};
+MODULE_DEVICE_TABLE(pci, qla6322_pci_tbl);
+
+static int __devinit
+qla6322_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
+qla6322_remove_one(struct pci_dev *pdev)
+{
+	qla2x00_remove_one(pdev);
+}
+
+static struct pci_driver qla6322_pci_driver = {
+	.name		= "qla6322",
+	.id_table	= qla6322_pci_tbl,
+	.probe		= qla6322_probe_one,
+	.remove		= __devexit_p(qla6322_remove_one),
+};
+
+static int __init
+qla6322_init(void)
+{
+	return pci_module_init(&qla6322_pci_driver);
+}
+
+static void __exit
+qla6322_exit(void)
+{
+	pci_unregister_driver(&qla6322_pci_driver);
+}
+
+module_init(qla6322_init);
+module_exit(qla6322_exit);
+
+MODULE_AUTHOR("QLogic Corporation");
+MODULE_DESCRIPTION("QLogic ISP6322 FC-SCSI Host Bus Adapter driver");
+MODULE_LICENSE("GPL");
--- diff/drivers/scsi/qla2xxx/ql6322_fw.c	1970-01-01 01:00:00.000000000 +0100
+++ source/drivers/scsi/qla2xxx/ql6322_fw.c	2004-02-09 10:39:55.000000000 +0000
@@ -0,0 +1,7353 @@
+/**************************************************************************
+ *                  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.21 (16:27 Jan 19, 2004)
+ */
+
+#ifdef UNIQUE_FW_NAME
+unsigned short fw2322flx_version = 3*1024+2;
+#else
+unsigned short risc_code_version = 3*1024+2;
+#endif
+
+#ifdef UNIQUE_FW_NAME
+unsigned char fw2322flx_version_str[] = {3, 2,21};
+#else
+unsigned char firmware_version[] = {3, 2,21};
+#endif
+
+#ifdef UNIQUE_FW_NAME
+#define fw2322flx_VERSION_STRING "3.02.21"
+#else
+#define FW_VERSION_STRING "3.02.21"
+#endif
+
+#ifdef UNIQUE_FW_NAME
+unsigned short fw2322flx_addr01 = 0x0800 ;
+#else
+unsigned short risc_code_addr01 = 0x0800 ;
+#endif
+
+#ifdef UNIQUE_FW_NAME
+unsigned short fw2322flx_code01[] = { 
+#else
+unsigned short risc_code01[] = { 
+#endif
+	0x0470, 0x0000, 0x0000, 0xcc67, 0x0000, 0x0003, 0x0002, 0x0015,
+	0x0317, 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, 0x2e32, 0x3120, 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, 0x20c9, 0x1cff, 0x2059, 0x0000, 0x2b78,
+	0x7883, 0x0004, 0x2089, 0x289c, 0x2051, 0x1800, 0x2a70, 0x20e1,
+	0x0001, 0x20e9, 0x0001, 0x2009, 0x0000, 0x080c, 0x0e3d, 0x00f6,
+	0x7888, 0x9005, 0x11f8, 0x2061, 0xc000, 0x080c, 0x1ec7, 0x1170,
+	0x2079, 0x0300, 0x080c, 0x1edd, 0x2061, 0xe000, 0x080c, 0x1ec7,
+	0x1128, 0x2079, 0x0380, 0x080c, 0x1edd, 0x0060, 0x00fe, 0x7883,
+	0x4010, 0x7837, 0x4010, 0x7833, 0x0010, 0x2091, 0x5000, 0x2091,
+	0x4080, 0x0cf8, 0x00fe, 0x2029, 0x26c0, 0x2031, 0xffff, 0x2039,
+	0x269c, 0x2021, 0x0050, 0x20e9, 0x0001, 0x20a1, 0x0000, 0x20a9,
+	0x0800, 0x900e, 0x4104, 0x20e9, 0x0001, 0x20a1, 0x1000, 0x900e,
+	0x2001, 0x0dc1, 0x9084, 0x0fff, 0x20a8, 0x4104, 0x2001, 0x0000,
+	0x9086, 0x0000, 0x0120, 0x21a8, 0x4104, 0x8001, 0x1de0, 0x756a,
+	0x766e, 0x7766, 0x7472, 0x7476, 0x00e6, 0x2071, 0x1b1c, 0x2472,
+	0x00ee, 0x20a1, 0x1ddc, 0x716c, 0x810d, 0x810d, 0x810d, 0x810d,
+	0x918c, 0x000f, 0x2001, 0x0001, 0x9112, 0x900e, 0x21a8, 0x4104,
+	0x8211, 0x1de0, 0x716c, 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, 0x0f3b, 0x080c, 0x5bf0, 0x080c, 0x99fb, 0x080c,
+	0x10f2, 0x080c, 0x12cd, 0x080c, 0x1a3a, 0x080c, 0x829d, 0x080c,
+	0x0cf7, 0x080c, 0x1077, 0x080c, 0x3242, 0x080c, 0x7270, 0x080c,
+	0x65cb, 0x080c, 0x7eec, 0x080c, 0x20a8, 0x080c, 0x78ea, 0x080c,
+	0x1ef6, 0x080c, 0x2030, 0x080c, 0x209d, 0x2091, 0x3009, 0x7883,
+	0x0000, 0x1004, 0x0941, 0x7880, 0x9086, 0x0002, 0x1190, 0x7883,
+	0x4000, 0x7837, 0x4000, 0x7833, 0x0010, 0x0e04, 0x0935, 0x2091,
+	0x5000, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c,
+	0x11b5, 0x2071, 0x1800, 0x7003, 0x0000, 0x2071, 0x1800, 0x7000,
+	0x908e, 0x0003, 0x1158, 0x080c, 0x48c0, 0x080c, 0x3269, 0x080c,
+	0x72d8, 0x080c, 0x6a73, 0x080c, 0x7f15, 0x0c78, 0x000b, 0x0c98,
+	0x0962, 0x0963, 0x0afa, 0x0960, 0x0bab, 0x0cf6, 0x0cf6, 0x0cf6,
+	0x080c, 0x0d65, 0x0005, 0x0126, 0x00f6, 0x2091, 0x8000, 0x7000,
+	0x9086, 0x0001, 0x1904, 0x0acd, 0x080c, 0x0e8d, 0x080c, 0x6f5c,
+	0x0150, 0x080c, 0x6f7f, 0x15b0, 0x2079, 0x0100, 0x7828, 0x9085,
+	0x1800, 0x782a, 0x0478, 0x080c, 0x6e8d, 0x7000, 0x9086, 0x0001,
+	0x1904, 0x0acd, 0x7094, 0x9086, 0x0028, 0x1904, 0x0acd, 0x080c,
+	0x7ee4, 0x080c, 0x7ed6, 0x2001, 0x0161, 0x2003, 0x0001, 0x2079,
+	0x0100, 0x2011, 0xffff, 0x080c, 0x282b, 0x7a28, 0x9295, 0x5e2c,
+	0x7a2a, 0x2011, 0x6dd2, 0x080c, 0x7fbb, 0x2011, 0x6dc5, 0x080c,
+	0x80bc, 0x2011, 0x5a47, 0x080c, 0x7fbb, 0x2011, 0x8030, 0x901e,
+	0x7392, 0x04d0, 0x080c, 0x52f4, 0x2079, 0x0100, 0x7844, 0x9005,
+	0x1904, 0x0acd, 0x2011, 0x5a47, 0x080c, 0x7fbb, 0x2011, 0x6dd2,
+	0x080c, 0x7fbb, 0x2011, 0x6dc5, 0x080c, 0x80bc, 0x2001, 0x0265,
+	0x2001, 0x0205, 0x2003, 0x0000, 0x7840, 0x9084, 0xfffb, 0x7842,
+	0x2001, 0x1975, 0x2004, 0x9005, 0x1140, 0x00c6, 0x2061, 0x0100,
+	0x080c, 0x5b98, 0x00ce, 0x0804, 0x0acd, 0x780f, 0x006b, 0x7a28,
+	0x080c, 0x6f64, 0x0118, 0x9295, 0x5e2c, 0x0010, 0x9295, 0x402c,
+	0x7a2a, 0x2011, 0x8010, 0x73d4, 0x2001, 0x1976, 0x2003, 0x0001,
+	0x080c, 0x270a, 0x080c, 0x47fb, 0x7244, 0xc284, 0x7246, 0x2001,
+	0x180c, 0x200c, 0xc1ac, 0xc1cc, 0x2102, 0x2001, 0x0390, 0x2003,
+	0x0400, 0x080c, 0x9746, 0x080c, 0x904b, 0x2011, 0x0004, 0x080c,
+	0xb6d5, 0x080c, 0x9762, 0x080c, 0x6458, 0x080c, 0x6f5c, 0x1120,
+	0x080c, 0x2758, 0x0600, 0x0420, 0x080c, 0x5b9f, 0x0140, 0x7093,
+	0x0001, 0x70cf, 0x0000, 0x080c, 0x54c1, 0x0804, 0x0acd, 0x080c,
+	0x529d, 0xd094, 0x01a8, 0x2001, 0x0390, 0x2003, 0x0404, 0x2011,
+	0x180c, 0x2204, 0xc0cd, 0x2012, 0x080c, 0x52a1, 0xd0d4, 0x1118,
+	0x080c, 0x2758, 0x1270, 0x2011, 0x180c, 0x2204, 0xc0bc, 0x0088,
+	0x080c, 0x52a1, 0xd0d4, 0x1db8, 0x2011, 0x180c, 0x2204, 0xc0bd,
+	0x0040, 0x2011, 0x180c, 0x2204, 0xc0bd, 0x2012, 0x080c, 0x6555,
+	0x0008, 0x2012, 0x080c, 0x651b, 0x0120, 0x7a0c, 0xc2b4, 0x7a0e,
+	0x00a8, 0x707b, 0x0000, 0x080c, 0x6f5c, 0x1130, 0x70ac, 0x9005,
+	0x1168, 0x080c, 0xbb25, 0x0050, 0x080c, 0xbb25, 0x70d8, 0xd09c,
+	0x1128, 0x70ac, 0x9005, 0x0110, 0x080c, 0x5b75, 0x70e3, 0x0000,
+	0x70df, 0x0000, 0x70a3, 0x0000, 0x080c, 0x2760, 0x0228, 0x2011,
+	0x0101, 0x2204, 0xc0c4, 0x2012, 0x72d8, 0x080c, 0x6f5c, 0x1178,
+	0x9016, 0x0016, 0x2009, 0x0002, 0x2019, 0x193e, 0x211a, 0x001e,
+	0x705b, 0xffff, 0x705f, 0x00ef, 0x707f, 0x0000, 0x0020, 0x2019,
+	0x193e, 0x201b, 0x0000, 0x2079, 0x1853, 0x7804, 0xd0ac, 0x0108,
+	0xc295, 0x72da, 0x080c, 0x6f5c, 0x0118, 0x9296, 0x0004, 0x0518,
+	0x2011, 0x0001, 0x080c, 0xb6d5, 0x70a7, 0x0000, 0x70ab, 0xffff,
+	0x7003, 0x0002, 0x00fe, 0x080c, 0x2d99, 0x080c, 0x9746, 0x2011,
+	0x0005, 0x080c, 0x91a3, 0x080c, 0x9762, 0x080c, 0x6f5c, 0x0148,
+	0x00c6, 0x2061, 0x0100, 0x0016, 0x2009, 0x0002, 0x61e2, 0x001e,
+	0x00ce, 0x012e, 0x00e0, 0x70a7, 0x0000, 0x70ab, 0xffff, 0x7003,
+	0x0002, 0x080c, 0x9746, 0x2011, 0x0005, 0x080c, 0x91a3, 0x080c,
+	0x9762, 0x080c, 0x6f5c, 0x0148, 0x00c6, 0x2061, 0x0100, 0x0016,
+	0x2009, 0x0002, 0x61e2, 0x001e, 0x00ce, 0x00fe, 0x012e, 0x0005,
+	0x00c6, 0x00b6, 0x080c, 0x6f5c, 0x1118, 0x20a9, 0x0800, 0x0010,
+	0x20a9, 0x0782, 0x080c, 0x6f5c, 0x1110, 0x900e, 0x0010, 0x2009,
+	0x007e, 0x86ff, 0x0138, 0x9180, 0x1000, 0x2004, 0x905d, 0x0110,
+	0xb800, 0xd0bc, 0x090c, 0x30d1, 0x8108, 0x1f04, 0x0ae1, 0x707b,
+	0x0000, 0x707c, 0x9084, 0x00ff, 0x707e, 0x70af, 0x0000, 0x00be,
+	0x00ce, 0x0005, 0x00b6, 0x0126, 0x2091, 0x8000, 0x7000, 0x9086,
+	0x0002, 0x1904, 0x0ba8, 0x70a8, 0x9086, 0xffff, 0x0120, 0x080c,
+	0x2d99, 0x0804, 0x0ba8, 0x70d8, 0xd0ac, 0x1110, 0xd09c, 0x0520,
+	0xd084, 0x0510, 0x0006, 0x2001, 0x0103, 0x2003, 0x002b, 0x000e,
+	0xd08c, 0x01d0, 0x70dc, 0x9086, 0xffff, 0x0190, 0x080c, 0x2f21,
+	0x70d8, 0xd094, 0x1904, 0x0ba8, 0x2011, 0x0001, 0x080c, 0xbdd7,
+	0x0110, 0x2011, 0x0003, 0x901e, 0x080c, 0x2f5b, 0x0804, 0x0ba8,
+	0x70e0, 0x9005, 0x1904, 0x0ba8, 0x70a4, 0x9005, 0x1904, 0x0ba8,
+	0x70d8, 0xd0a4, 0x0118, 0xd0b4, 0x0904, 0x0ba8, 0x080c, 0x651b,
+	0x1904, 0x0ba8, 0x080c, 0x656e, 0x1904, 0x0ba8, 0x080c, 0x6555,
+	0x01c0, 0x0156, 0x00c6, 0x20a9, 0x007f, 0x900e, 0x0016, 0x080c,
+	0x6166, 0x1118, 0xb800, 0xd0ec, 0x1138, 0x001e, 0x8108, 0x1f04,
+	0x0b4e, 0x00ce, 0x015e, 0x0028, 0x001e, 0x00ce, 0x015e, 0x0804,
+	0x0ba8, 0x0006, 0x2001, 0x0103, 0x2003, 0x006b, 0x000e, 0x2011,
+	0x1982, 0x080c, 0x0fab, 0x2011, 0x199c, 0x080c, 0x0fab, 0x7030,
+	0xc08c, 0x7032, 0x7003, 0x0003, 0x70ab, 0xffff, 0x080c, 0x0e61,
+	0x9006, 0x080c, 0x2394, 0x0036, 0x0046, 0x2019, 0xffff, 0x2021,
+	0x0006, 0x080c, 0x4998, 0x004e, 0x003e, 0x00f6, 0x2079, 0x0100,
+	0x080c, 0x6f7f, 0x0150, 0x080c, 0x6f5c, 0x7828, 0x0118, 0x9084,
+	0xe1ff, 0x0010, 0x9084, 0xffdf, 0x782a, 0x00fe, 0x080c, 0x9746,
+	0x2001, 0x19b7, 0x2004, 0x9086, 0x0005, 0x1120, 0x2011, 0x0000,
+	0x080c, 0x91a3, 0x2011, 0x0000, 0x080c, 0x91ad, 0x080c, 0x9762,
+	0x012e, 0x00be, 0x0005, 0x0016, 0x0026, 0x0046, 0x00f6, 0x0126,
+	0x2091, 0x8000, 0x2079, 0x0100, 0x7904, 0x918c, 0xfffd, 0x7906,
+	0x2009, 0x00f7, 0x080c, 0x5b5e, 0x7940, 0x918c, 0x0010, 0x7942,
+	0x7924, 0xd1b4, 0x0120, 0x2011, 0x0040, 0x080c, 0x282b, 0xd19c,
+	0x0120, 0x2011, 0x0008, 0x080c, 0x282b, 0x0006, 0x0036, 0x0156,
+	0x0000, 0x2001, 0x1976, 0x2004, 0x9005, 0x1518, 0x080c, 0x27bf,
+	0x1148, 0x2001, 0x0001, 0x080c, 0x2739, 0x2001, 0x0001, 0x080c,
+	0x271c, 0x00b8, 0x080c, 0x27c7, 0x1138, 0x9006, 0x080c, 0x2739,
+	0x9006, 0x080c, 0x271c, 0x0068, 0x080c, 0x27cf, 0x1d50, 0x2001,
+	0x1967, 0x2004, 0xd0fc, 0x0108, 0x0020, 0x080c, 0x2533, 0x0804,
+	0x0ca9, 0x080c, 0x284e, 0x080c, 0x2892, 0x20a9, 0x003a, 0x1d04,
+	0x0bff, 0x080c, 0x809c, 0x1f04, 0x0bff, 0x080c, 0x6f6d, 0x0148,
+	0x080c, 0x6f7f, 0x1118, 0x080c, 0x726b, 0x0050, 0x080c, 0x6f64,
+	0x0dd0, 0x080c, 0x7266, 0x080c, 0x725c, 0x080c, 0x6e8d, 0x0020,
+	0x2009, 0x00f8, 0x080c, 0x5b5e, 0x7850, 0xc0e5, 0x7852, 0x080c,
+	0x6f5c, 0x0120, 0x7843, 0x0090, 0x7843, 0x0010, 0x2021, 0xe678,
+	0x2019, 0xea60, 0x0d0c, 0x809c, 0x7820, 0xd09c, 0x15a0, 0x080c,
+	0x6f5c, 0x0904, 0x0c8b, 0x7824, 0xd0ac, 0x1904, 0x0cae, 0x080c,
+	0x6f7f, 0x1548, 0x0046, 0x2021, 0x0320, 0x8421, 0x1df0, 0x004e,
+	0x2011, 0x1800, 0x080c, 0x282b, 0x080c, 0x27d7, 0x7824, 0x9084,
+	0x1800, 0x1168, 0x9484, 0x0fff, 0x1140, 0x2001, 0x1810, 0x2004,
+	0x9084, 0x9000, 0x0110, 0x080c, 0x0cd1, 0x8421, 0x1160, 0x1d04,
+	0x0c5b, 0x080c, 0x809c, 0x080c, 0x7266, 0x080c, 0x725c, 0x7003,
+	0x0001, 0x0804, 0x0cae, 0x8319, 0x1928, 0x2001, 0x1810, 0x2004,
+	0x9084, 0x9000, 0x0110, 0x080c, 0x0cd1, 0x1d04, 0x0c71, 0x080c,
+	0x809c, 0x2009, 0x196a, 0x2104, 0x9005, 0x0118, 0x8001, 0x200a,
+	0x1188, 0x200b, 0x000a, 0x2011, 0x0048, 0x080c, 0x282b, 0x20a9,
+	0x0002, 0x080c, 0x27b8, 0x7924, 0x080c, 0x27d7, 0xd19c, 0x0110,
+	0x080c, 0x270a, 0x00f0, 0x080c, 0x6f6d, 0x1140, 0x94a2, 0x03e8,
+	0x1128, 0x080c, 0x6f30, 0x7003, 0x0001, 0x00c0, 0x2011, 0x1800,
+	0x080c, 0x282b, 0x080c, 0x27d7, 0x7824, 0x080c, 0x6f76, 0x0110,
+	0xd0ac, 0x1160, 0x9084, 0x1800, 0x0904, 0x0c63, 0x7003, 0x0001,
+	0x0028, 0x2001, 0x0001, 0x080c, 0x2394, 0x00a0, 0x7850, 0xc0e4,
+	0x7852, 0x2009, 0x180c, 0x210c, 0xd19c, 0x1120, 0x7904, 0x918d,
+	0x0002, 0x7906, 0x2011, 0x0048, 0x080c, 0x282b, 0x7828, 0x9085,
+	0x0028, 0x782a, 0x2001, 0x1976, 0x2003, 0x0000, 0x9006, 0x78f2,
+	0x015e, 0x003e, 0x000e, 0x012e, 0x00fe, 0x004e, 0x002e, 0x001e,
+	0x0005, 0x0006, 0x0016, 0x0026, 0x0036, 0x0046, 0x00b6, 0x00c6,
+	0x00d6, 0x00e6, 0x00f6, 0x0156, 0x0071, 0x0d0c, 0x809c, 0x015e,
+	0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x004e, 0x003e, 0x002e,
+	0x001e, 0x000e, 0x0005, 0x00e6, 0x2071, 0x1894, 0x7004, 0x9086,
+	0x0001, 0x1110, 0x080c, 0x3269, 0x00ee, 0x0005, 0x0005, 0x2a70,
+	0x2061, 0x197a, 0x2063, 0x0003, 0x6007, 0x0002, 0x600b, 0x0015,
+	0x600f, 0x0317, 0x2001, 0x194d, 0x900e, 0x2102, 0x7192, 0x2001,
+	0x0100, 0x2004, 0x9082, 0x0002, 0x0218, 0x705b, 0xffff, 0x0008,
+	0x715a, 0x7063, 0xffff, 0x717a, 0x717e, 0x080c, 0xbb25, 0x70eb,
+	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, 0x182b, 0x2102, 0x0005, 0x9016, 0x080c, 0x6166,
+	0x1178, 0xb804, 0x90c4, 0x00ff, 0x98c6, 0x0006, 0x0128, 0x90c4,
+	0xff00, 0x98c6, 0x0600, 0x1120, 0x9186, 0x0080, 0x0108, 0x8210,
+	0x8108, 0x9186, 0x0800, 0x1d50, 0x2208, 0x0005, 0x2091, 0x8000,
+	0x2079, 0x0000, 0x000e, 0x00f6, 0x0010, 0x2091, 0x8000, 0x0e04,
+	0x0d67, 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, 0x1af2, 0x7a08,
+	0x226a, 0x2069, 0x1af3, 0x7a18, 0x226a, 0x8d68, 0x7a1c, 0x226a,
+	0x782c, 0x2019, 0x1b00, 0x201a, 0x2019, 0x1b03, 0x9016, 0x7808,
+	0xd09c, 0x0168, 0x7820, 0x201a, 0x8210, 0x8318, 0x9386, 0x1b1c,
+	0x0108, 0x0ca8, 0x7808, 0xd09c, 0x0110, 0x2011, 0xdead, 0x2019,
+	0x1b01, 0x782c, 0x201a, 0x8318, 0x221a, 0x7803, 0x0000, 0x2069,
+	0x1a48, 0x901e, 0x20a9, 0x0020, 0x7b26, 0x7a28, 0x226a, 0x8d68,
+	0x8318, 0x1f04, 0x0db4, 0x0491, 0x002e, 0x003e, 0x00de, 0x015e,
+	0x2079, 0x1800, 0x7803, 0x0005, 0x2091, 0x4080, 0x2001, 0x0089,
+	0x2004, 0xd084, 0x0180, 0x2001, 0x19f1, 0x2004, 0x9005, 0x0128,
+	0x2001, 0x008b, 0x2004, 0xd0fc, 0x0dd8, 0x2001, 0x008a, 0x2003,
+	0x0002, 0x2003, 0x1001, 0x080c, 0x52ac, 0x1170, 0x080c, 0x0efb,
+	0x0110, 0x080c, 0x0e4e, 0x080c, 0x52ac, 0x1130, 0x2071, 0x1800,
+	0x2011, 0x8000, 0x080c, 0x0f0f, 0x0c70, 0x0005, 0x2001, 0x0382,
+	0x2004, 0x9084, 0x0007, 0x9086, 0x0001, 0x1120, 0x2001, 0x0015,
+	0x080c, 0x9737, 0x2079, 0x0380, 0x2069, 0x1ad2, 0x7818, 0x6802,
+	0x781c, 0x6806, 0x7840, 0x680a, 0x7844, 0x680e, 0x782c, 0x6812,
+	0x2019, 0x1add, 0x9016, 0x7808, 0xd09c, 0x0150, 0x7820, 0x201a,
+	0x8210, 0x8318, 0x8210, 0x9282, 0x0011, 0x0ea8, 0x2011, 0xdead,
+	0x6a2a, 0x7830, 0x681a, 0x7834, 0x681e, 0x7838, 0x6822, 0x783c,
+	0x6826, 0x7803, 0x0000, 0x2069, 0x1a92, 0x901e, 0x20a9, 0x0020,
+	0x7b26, 0x7828, 0x206a, 0x8d68, 0x8318, 0x1f04, 0x0e28, 0x2069,
+	0x1ab2, 0x2019, 0x00b0, 0x20a9, 0x0020, 0x7b26, 0x7828, 0x206a,
+	0x8d68, 0x8318, 0x1f04, 0x0e35, 0x0005, 0x918c, 0x03ff, 0x2001,
+	0x0003, 0x2004, 0x9084, 0x0600, 0x1118, 0x918d, 0x6c00, 0x0010,
+	0x918d, 0x6400, 0x2001, 0x017f, 0x2102, 0x0005, 0x0026, 0x0126,
+	0x2011, 0x0080, 0x080c, 0x0eed, 0x20a9, 0x0900, 0x080c, 0x0f23,
+	0x2011, 0x0040, 0x080c, 0x0eed, 0x20a9, 0x0900, 0x080c, 0x0f23,
+	0x0c78, 0x0026, 0x080c, 0x0efb, 0x1188, 0x2011, 0x010e, 0x2214,
+	0x9294, 0x0007, 0x9296, 0x0007, 0x0118, 0x2011, 0x0947, 0x0010,
+	0x2011, 0x1b47, 0x080c, 0x0f0f, 0x002e, 0x0005, 0x2011, 0x010e,
+	0x2214, 0x9294, 0x0007, 0x9296, 0x0007, 0x0118, 0x2011, 0xa880,
+	0x0010, 0x2011, 0x6840, 0xd0e4, 0x70ef, 0x0000, 0x1128, 0x70ef,
+	0x0fa0, 0x080c, 0x0f00, 0x002e, 0x0005, 0x0026, 0x080c, 0x0efb,
+	0x0148, 0xd0a4, 0x1138, 0x2011, 0xcdd5, 0x0010, 0x2011, 0x0080,
+	0x080c, 0x0f00, 0x002e, 0x0005, 0x0026, 0x70ef, 0x0000, 0x080c,
+	0x0efb, 0x1130, 0x2011, 0x8040, 0x080c, 0x0f0f, 0x002e, 0x0005,
+	0x080c, 0x27cf, 0x1118, 0x2011, 0xcdc5, 0x0010, 0x2011, 0xcac2,
+	0x080c, 0x0f00, 0x002e, 0x0005, 0x00e6, 0x0016, 0x0006, 0x2071,
+	0x1800, 0xd0b4, 0x70e8, 0x71e4, 0x1118, 0xc0e4, 0xc1f4, 0x0050,
+	0x0006, 0x3b00, 0x9084, 0xff3e, 0x20d8, 0x000e, 0x70ef, 0x0000,
+	0xc0e5, 0xc1f5, 0x0099, 0x000e, 0x001e, 0x00ee, 0x0005, 0x00e6,
+	0x2071, 0x1800, 0xd0e4, 0x70e8, 0x1110, 0xc0dc, 0x0008, 0xc0dd,
+	0x0016, 0x71e4, 0x0019, 0x001e, 0x00ee, 0x0005, 0x70ea, 0x71e6,
+	0x7000, 0x9084, 0x0007, 0x000b, 0x0005, 0x0eb3, 0x0e8d, 0x0e8d,
+	0x0e61, 0x0e9c, 0x0e8d, 0x0e8d, 0x0e9c, 0xc284, 0x0016, 0x3b08,
+	0x3a00, 0x9104, 0x918d, 0x00c1, 0x21d8, 0x9084, 0xff3e, 0x9205,
+	0x20d0, 0x001e, 0x0005, 0x2001, 0x183a, 0x2004, 0xd0dc, 0x0005,
+	0x9e86, 0x1800, 0x190c, 0x0d65, 0x70e8, 0xd0e4, 0x0108, 0xc2e5,
+	0x72ea, 0xd0e4, 0x1118, 0x9294, 0x00c1, 0x08f9, 0x0005, 0x9e86,
+	0x1800, 0x190c, 0x0d65, 0x70e4, 0xd0f4, 0x0108, 0xc2f5, 0x72e6,
+	0xd0f4, 0x1140, 0x9284, 0x8000, 0x8005, 0xc284, 0x9215, 0x9294,
+	0x00c1, 0x0861, 0x0005, 0x1d04, 0x0f23, 0x2091, 0x6000, 0x1f04,
+	0x0f23, 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,
+	0x0f2a, 0x2100, 0x9300, 0x2098, 0x22e0, 0x009e, 0x002e, 0x001e,
+	0x0036, 0x3518, 0x20a9, 0x0001, 0x4002, 0x8007, 0x4004, 0x8319,
+	0x1dd8, 0x003e, 0x0005, 0x20e9, 0x0001, 0x71b4, 0x81ff, 0x11c0,
+	0x9006, 0x2009, 0x0200, 0x20a9, 0x0002, 0x9298, 0x0018, 0x23a0,
+	0x4001, 0x2009, 0x0700, 0x20a9, 0x0002, 0x9298, 0x0008, 0x23a0,
+	0x4001, 0x7078, 0x8007, 0x717c, 0x810f, 0x20a9, 0x0002, 0x4001,
+	0x9298, 0x000c, 0x23a0, 0x900e, 0x080c, 0x0d45, 0x2001, 0x0000,
+	0x810f, 0x20a9, 0x0002, 0x4001, 0x0005, 0x89ff, 0x0140, 0xa804,
+	0xa807, 0x0000, 0x0006, 0x080c, 0x1055, 0x009e, 0x0cb0, 0x0005,
+	0x00e6, 0x2071, 0x1800, 0x080c, 0x10ce, 0x090c, 0x0d65, 0x00ee,
+	0x0005, 0x0086, 0x00e6, 0x0006, 0x0026, 0x0036, 0x0126, 0x2091,
+	0x8000, 0x00c9, 0x2071, 0x1800, 0x73bc, 0x702c, 0x9016, 0x9045,
+	0x0158, 0x8210, 0x9906, 0x090c, 0x0d65, 0x2300, 0x9202, 0x0120,
+	0x1a0c, 0x0d65, 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, 0x0d65, 0xa000, 0x0cc8, 0x012e, 0x000e,
+	0x00ee, 0x008e, 0x0005, 0x00e6, 0x2071, 0x1800, 0x0126, 0x2091,
+	0x8000, 0x70bc, 0x8001, 0x0270, 0x70be, 0x702c, 0x2048, 0x9085,
+	0x0001, 0xa800, 0x702e, 0xa803, 0x0000, 0xa807, 0x0000, 0x012e,
+	0x00ee, 0x0005, 0x904e, 0x0cd8, 0x00e6, 0x0126, 0x2091, 0x8000,
+	0x2071, 0x1800, 0x70bc, 0x90ca, 0x0040, 0x0268, 0x8001, 0x70be,
+	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, 0x70bc,
+	0x8000, 0x70be, 0x080c, 0x7ed6, 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, 0x049b, 0xa802, 0x2048, 0x2009,
+	0x26c0, 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, 0x74ba, 0x74be, 0x0005, 0x00e6, 0x0016,
+	0x9984, 0xfc00, 0x01e8, 0x908c, 0xf800, 0x1168, 0x9982, 0x0400,
+	0x02b8, 0x9982, 0x0440, 0x0278, 0x9982, 0x049b, 0x0288, 0x9982,
+	0x0800, 0x1270, 0x0040, 0x9982, 0x0800, 0x0250, 0x2071, 0x1883,
+	0x7010, 0x9902, 0x1228, 0x9085, 0x0001, 0x001e, 0x00ee, 0x0005,
+	0x9006, 0x0cd8, 0x00e6, 0x2071, 0x19f0, 0x7007, 0x0000, 0x9006,
+	0x701e, 0x7022, 0x7002, 0x2071, 0x0000, 0x7010, 0x9085, 0x8044,
+	0x7012, 0x00ee, 0x0005, 0x0126, 0x2091, 0x8000, 0x00e6, 0xa06f,
+	0x0000, 0x2071, 0x19f0, 0x701c, 0x9088, 0x19fa, 0x280a, 0x8000,
+	0x9084, 0x003f, 0x701e, 0x7120, 0x9106, 0x090c, 0x0d65, 0x7004,
+	0x9005, 0x1128, 0x00f6, 0x2079, 0x0080, 0x00a9, 0x00fe, 0x00ee,
+	0x012e, 0x0005, 0x0126, 0x2091, 0x8000, 0x00e6, 0x2071, 0x19f0,
+	0x7004, 0x9005, 0x1128, 0x00f6, 0x2079, 0x0080, 0x0021, 0x00fe,
+	0x00ee, 0x012e, 0x0005, 0x7004, 0x9086, 0x0000, 0x1110, 0x7007,
+	0x0006, 0x7000, 0x0002, 0x1145, 0x1143, 0x1143, 0x1143, 0x12bc,
+	0x12bc, 0x12bc, 0x12bc, 0x080c, 0x0d65, 0x701c, 0x7120, 0x9106,
+	0x1148, 0x792c, 0x9184, 0x0001, 0x1120, 0xd1fc, 0x1110, 0x7007,
+	0x0000, 0x0005, 0x0096, 0x9180, 0x19fa, 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, 0x19f0, 0x2104,
+	0xc095, 0x200a, 0x080c, 0x1122, 0x0005, 0x0016, 0x00e6, 0x2071,
+	0x19f0, 0x00f6, 0x2079, 0x0080, 0x792c, 0xd1bc, 0x190c, 0x0d5e,
+	0x782b, 0x0002, 0xd1fc, 0x0120, 0x918c, 0x0700, 0x7004, 0x0023,
+	0x00fe, 0x00ee, 0x001e, 0x0005, 0x1133, 0x11db, 0x120f, 0x0d65,
+	0x0d65, 0x12c8, 0x0d65, 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, 0x1178, 0x0005, 0x7008, 0x0096, 0x2048,
+	0xa86f, 0x0100, 0x009e, 0x7007, 0x0000, 0x080c, 0x1133, 0x0005,
+	0x7008, 0x0096, 0x2048, 0xa86f, 0x0200, 0x009e, 0x0ca0, 0x918c,
+	0x0700, 0x1150, 0x700c, 0x9005, 0x0180, 0x7800, 0x7802, 0x7804,
+	0x7806, 0x080c, 0x118d, 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, 0x1122, 0x0005, 0x00de, 0x009e, 0x080c,
+	0x1122, 0x0005, 0xa8a8, 0xd08c, 0x0005, 0x0096, 0xa0a0, 0x904d,
+	0x090c, 0x0d65, 0xa06c, 0x908e, 0x0100, 0x0130, 0xa87b, 0x0030,
+	0xa883, 0x0000, 0xa897, 0x4002, 0x080c, 0x6833, 0xa09f, 0x0000,
+	0xa0a3, 0x0000, 0x2848, 0x080c, 0x1055, 0x009e, 0x0005, 0x00a6,
+	0xa0a0, 0x904d, 0x090c, 0x0d65, 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, 0x1103, 0x00e8, 0xa97c, 0xa894, 0x0016,
+	0x0006, 0x080c, 0x6833, 0x000e, 0x001e, 0xd1fc, 0x1138, 0xd1f4,
+	0x0128, 0x00c6, 0x2060, 0x080c, 0x9a65, 0x00ce, 0x7008, 0x2048,
+	0xa89f, 0x0000, 0xa8a3, 0x0000, 0x080c, 0x1055, 0x7007, 0x0000,
+	0x080c, 0x1122, 0x00ae, 0x0005, 0x0126, 0x2091, 0x8000, 0x782b,
+	0x1001, 0x7007, 0x0005, 0x7000, 0xc094, 0x7002, 0x012e, 0x0005,
+	0x7007, 0x0000, 0x080c, 0x1133, 0x0005, 0x0126, 0x2091, 0x2200,
+	0x2079, 0x0300, 0x2071, 0x1a3a, 0x7003, 0x0000, 0x78bf, 0x00f6,
+	0x0041, 0x7807, 0x0007, 0x7803, 0x0000, 0x7803, 0x0001, 0x012e,
+	0x0005, 0x00c6, 0x7803, 0x0000, 0x2001, 0x0165, 0x2003, 0x4198,
+	0x7808, 0xd09c, 0x0110, 0x7820, 0x0cd8, 0x2001, 0x1a3b, 0x2003,
+	0x0000, 0x78ab, 0x0004, 0x78ac, 0xd0ac, 0x1de8, 0x78ab, 0x0002,
+	0x7807, 0x0007, 0x7827, 0x0030, 0x782b, 0x0400, 0x7827, 0x0031,
+	0x782b, 0x1a48, 0x781f, 0xff00, 0x781b, 0xff00, 0x2001, 0x0200,
+	0x2004, 0xd0dc, 0x0110, 0x781f, 0x0303, 0x2061, 0x1a48, 0x602f,
+	0x1ddc, 0x2001, 0x1819, 0x2004, 0x9082, 0x1ddc, 0x6032, 0x603b,
+	0x1cca, 0x602b, 0x1a88, 0x6007, 0x1a68, 0x2061, 0x1a68, 0x00ce,
+	0x0005, 0x0126, 0x2091, 0x2200, 0x7908, 0x9184, 0x0070, 0x190c,
+	0x0d5e, 0xd19c, 0x05a0, 0x7820, 0x908c, 0xf000, 0x0540, 0x2060,
+	0x6020, 0x9086, 0x0003, 0x1550, 0x6000, 0x9086, 0x0004, 0x1530,
+	0x6114, 0x2148, 0xa876, 0xa87a, 0xa867, 0x0103, 0x080c, 0x6655,
+	0x00b6, 0x6010, 0x2058, 0xba3c, 0x8211, 0x0208, 0xba3e, 0xb8c0,
+	0x9005, 0x190c, 0x6291, 0x00be, 0x6044, 0xd0fc, 0x190c, 0x976f,
+	0x080c, 0x9a8d, 0x7808, 0xd09c, 0x19b0, 0x012e, 0x0005, 0x908a,
+	0x0024, 0x1a0c, 0x0d65, 0x002b, 0x012e, 0x0005, 0x04b0, 0x012e,
+	0x0005, 0x1385, 0x13ab, 0x13db, 0x13e0, 0x13e4, 0x13e9, 0x1411,
+	0x1415, 0x1423, 0x1427, 0x1385, 0x14b1, 0x14b5, 0x1518, 0x1385,
+	0x1385, 0x1385, 0x1385, 0x1385, 0x1385, 0x1385, 0x1385, 0x1385,
+	0x1385, 0x1385, 0x1385, 0x1385, 0x13eb, 0x1385, 0x13b3, 0x13d8,
+	0x139f, 0x1385, 0x13bf, 0x1389, 0x1387, 0x080c, 0x0d65, 0x080c,
+	0x0d5e, 0x080c, 0x151f, 0x2009, 0x1a47, 0x2104, 0x8000, 0x200a,
+	0x080c, 0x799d, 0x080c, 0x193f, 0x0005, 0x6044, 0xd0fc, 0x190c,
+	0x976f, 0x2009, 0x0055, 0x080c, 0x9b03, 0x012e, 0x0005, 0x080c,
+	0x151f, 0x2060, 0x6044, 0xd0fc, 0x190c, 0x976f, 0x2009, 0x0055,
+	0x080c, 0x9b03, 0x0005, 0x2009, 0x0048, 0x080c, 0x151f, 0x2060,
+	0x080c, 0x9b03, 0x0005, 0x2009, 0x0054, 0x080c, 0x151f, 0x2060,
+	0x6044, 0xd0fc, 0x190c, 0x976f, 0x080c, 0x9b03, 0x0005, 0x080c,
+	0x151f, 0x2060, 0x0056, 0x0066, 0x080c, 0x151f, 0x2028, 0x080c,
+	0x151f, 0x2030, 0x0036, 0x0046, 0x2021, 0x0000, 0x2418, 0x2009,
+	0x0056, 0x080c, 0x9b03, 0x004e, 0x003e, 0x006e, 0x005e, 0x0005,
+	0x080c, 0x151f, 0x0005, 0x7004, 0xc085, 0xc0b5, 0x7006, 0x0005,
+	0x7004, 0xc085, 0x7006, 0x0005, 0x080c, 0x151f, 0x080c, 0x15dc,
+	0x0005, 0x080c, 0x0d65, 0x080c, 0x151f, 0x2060, 0x6014, 0x0096,
+	0x2048, 0xa83b, 0xffff, 0x009e, 0x2009, 0x0048, 0x080c, 0x9b03,
+	0x2001, 0x015d, 0x2003, 0x0000, 0x2009, 0x03e8, 0x8109, 0x0160,
+	0x2001, 0x0201, 0x2004, 0x9005, 0x0dc8, 0x2001, 0x0218, 0x2004,
+	0xd0ec, 0x1110, 0x080c, 0x1524, 0x2001, 0x0307, 0x2003, 0x8000,
+	0x0005, 0x7004, 0xc095, 0x7006, 0x0005, 0x080c, 0x151f, 0x2060,
+	0x6014, 0x0096, 0x2048, 0xa83b, 0xffff, 0x009e, 0x2009, 0x0048,
+	0x080c, 0x9b03, 0x0005, 0x080c, 0x151f, 0x080c, 0x0d65, 0x080c,
+	0x151f, 0x080c, 0x149c, 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, 0x0d65, 0x2001, 0x020d, 0x2003, 0x0050, 0x2003, 0x0020,
+	0x0480, 0x78ab, 0x0004, 0x7803, 0x0001, 0x080c, 0x14b5, 0x0005,
+	0x7828, 0x782b, 0x0000, 0x9065, 0x090c, 0x0d65, 0x6014, 0x2048,
+	0x78ab, 0x0004, 0x918c, 0x0700, 0x0198, 0x080c, 0x799d, 0x080c,
+	0x193f, 0x080c, 0xb6c5, 0x0158, 0xa9ac, 0xa936, 0xa9b0, 0xa93a,
+	0xa83f, 0xffff, 0xa843, 0xffff, 0xa880, 0xc0bd, 0xa882, 0x0005,
+	0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x6024, 0x190c,
+	0xbaba, 0x2029, 0x00c8, 0x8529, 0x0128, 0x2001, 0x0201, 0x2004,
+	0x9005, 0x0dc8, 0x7dbc, 0x080c, 0xd3ff, 0xd5a4, 0x1118, 0x080c,
+	0x1524, 0x0005, 0x080c, 0x799d, 0x080c, 0x193f, 0x0005, 0x781f,
+	0x0300, 0x7803, 0x0001, 0x0005, 0x0016, 0x0066, 0x0076, 0x00f6,
+	0x2079, 0x0300, 0x7908, 0x918c, 0x0007, 0x9186, 0x0003, 0x0120,
+	0x2001, 0x0016, 0x080c, 0x1595, 0x00fe, 0x007e, 0x006e, 0x001e,
+	0x0005, 0x7004, 0xc09d, 0x7006, 0x0005, 0x7104, 0x9184, 0x0004,
+	0x190c, 0x0d65, 0xd184, 0x1189, 0xd19c, 0x0158, 0xc19c, 0x7106,
+	0x2001, 0x020d, 0x2003, 0x0050, 0x2003, 0x0020, 0x080c, 0x1524,
+	0x0005, 0x81ff, 0x190c, 0x0d65, 0x0005, 0xc184, 0xd1b4, 0xc1b4,
+	0x7106, 0x0016, 0x00e6, 0x15e0, 0x2071, 0x0200, 0x080c, 0x15d0,
+	0x6014, 0x9005, 0x05a8, 0x0096, 0x2048, 0xa864, 0x009e, 0x9084,
+	0x00ff, 0x908e, 0x0029, 0x0160, 0x908e, 0x0048, 0x1548, 0x601c,
+	0xd084, 0x11d8, 0x00f6, 0x2c78, 0x080c, 0x1646, 0x00fe, 0x00a8,
+	0x00f6, 0x2c78, 0x080c, 0x1783, 0x00fe, 0x2009, 0x01f4, 0x8109,
+	0x0160, 0x2001, 0x0201, 0x2004, 0x9005, 0x0dc8, 0x2001, 0x0218,
+	0x2004, 0xd0ec, 0x1110, 0x0401, 0x0040, 0x2001, 0x020d, 0x2003,
+	0x0020, 0x080c, 0x12e1, 0x7803, 0x0001, 0x00ee, 0x001e, 0x0005,
+	0x2001, 0x020d, 0x2003, 0x0050, 0x2003, 0x0020, 0x0069, 0x0ca8,
+	0x0031, 0x2060, 0x2009, 0x0053, 0x080c, 0x9b03, 0x0005, 0x7808,
+	0xd09c, 0x0de8, 0x7820, 0x0005, 0x080c, 0x149c, 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, 0x1587, 0x6827,
+	0x0001, 0x8109, 0x1dd0, 0x04d9, 0x6827, 0x0002, 0x04c1, 0x6804,
+	0x9005, 0x1130, 0x682c, 0xd0e4, 0x1500, 0x6804, 0x9005, 0x0de8,
+	0x79b8, 0xd1ec, 0x1130, 0x08c0, 0x080c, 0x799d, 0x080c, 0x193f,
+	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,
+	0x1321, 0x00ce, 0x002e, 0x001e, 0x000e, 0x0006, 0x7832, 0x7936,
+	0x7a3a, 0x781b, 0x8080, 0x0059, 0x1118, 0x000e, 0x00fe, 0x0005,
+	0x000e, 0x792c, 0x3900, 0x8000, 0x2004, 0x080c, 0x0d65, 0x2009,
+	0xff00, 0x8109, 0x0120, 0x7818, 0xd0bc, 0x1dd8, 0x0005, 0x9085,
+	0x0001, 0x0005, 0x7832, 0x7936, 0x7a3a, 0x781b, 0x8080, 0x0c79,
+	0x1108, 0x0005, 0x792c, 0x3900, 0x8000, 0x2004, 0x080c, 0x0d65,
+	0x7037, 0x0001, 0x7150, 0x7037, 0x0002, 0x7050, 0x2060, 0xd1bc,
+	0x1110, 0x7054, 0x2060, 0x0005, 0x00e6, 0x0016, 0x2071, 0x0200,
+	0x0c79, 0x6124, 0xd1dc, 0x01f8, 0x701c, 0xd08c, 0x0904, 0x163b,
+	0x7017, 0x0000, 0x2001, 0x0264, 0x2004, 0xd0bc, 0x0904, 0x163b,
+	0x2001, 0x0268, 0x00c6, 0x2064, 0x6104, 0x6038, 0x00ce, 0x918e,
+	0x0039, 0x1904, 0x163b, 0x9c06, 0x15f0, 0x0126, 0x2091, 0x2600,
+	0x080c, 0x7905, 0x012e, 0x7358, 0x745c, 0x6014, 0x905d, 0x0598,
+	0x2b48, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x190c,
+	0xba95, 0xab42, 0xac3e, 0x2001, 0x1875, 0x2004, 0xd0b4, 0x1170,
+	0x601c, 0xd0e4, 0x1158, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be,
+	0xd0bc, 0x1120, 0xa83b, 0x7fff, 0xa837, 0xffff, 0x080c, 0x1cea,
+	0x1190, 0x080c, 0x17d2, 0x2a00, 0xa816, 0x0130, 0x2800, 0xa80e,
+	0x2c05, 0xa80a, 0x2c00, 0xa812, 0x7037, 0x0020, 0x781f, 0x0300,
+	0x001e, 0x00ee, 0x0005, 0x7037, 0x0050, 0x7037, 0x0020, 0x001e,
+	0x00ee, 0x080c, 0x1524, 0x0005, 0x080c, 0x0d65, 0x0016, 0x2009,
+	0x00a0, 0x8109, 0xa001, 0xa001, 0xa001, 0x1dd8, 0x001e, 0x2cf0,
+	0x0126, 0x2091, 0x2200, 0x3e60, 0x6014, 0x2048, 0x2940, 0x903e,
+	0x2730, 0xa864, 0x2068, 0xa81a, 0x9d84, 0x000f, 0x9088, 0x1cca,
+	0x2165, 0x0002, 0x1679, 0x16c6, 0x1679, 0x1679, 0x1679, 0x16a8,
+	0x1679, 0x167d, 0x1672, 0x16bd, 0x1679, 0x1679, 0x1679, 0x1781,
+	0x1691, 0x1687, 0xa964, 0x918c, 0x00ff, 0x918e, 0x0048, 0x0904,
+	0x16bd, 0x9085, 0x0001, 0x0804, 0x1779, 0xa87c, 0xd0bc, 0x0dc8,
+	0xa890, 0xa842, 0xa88c, 0xa83e, 0xa888, 0x0804, 0x16cd, 0xa87c,
+	0xd0bc, 0x0d78, 0xa890, 0xa842, 0xa88c, 0xa83e, 0xa888, 0x0804,
+	0x171c, 0xa87c, 0xd0bc, 0x0d28, 0xa890, 0xa842, 0xa88c, 0xa83e,
+	0xa804, 0x9045, 0x090c, 0x0d65, 0xa164, 0xa91a, 0x91ec, 0x000f,
+	0x9d80, 0x1cca, 0x2065, 0xa888, 0xd19c, 0x1904, 0x171c, 0x0428,
+	0xa87c, 0xd0ac, 0x0970, 0xa804, 0x9045, 0x090c, 0x0d65, 0xa164,
+	0xa91a, 0x91ec, 0x000f, 0x9d80, 0x1cca, 0x2065, 0x9006, 0xa842,
+	0xa83e, 0xd19c, 0x1904, 0x171c, 0x0080, 0xa87c, 0xd0ac, 0x0904,
+	0x1679, 0x9006, 0xa842, 0xa83e, 0x0804, 0x171c, 0xa87c, 0xd0ac,
+	0x0904, 0x1679, 0x9006, 0xa842, 0xa83e, 0x2c05, 0x908a, 0x0036,
+	0x1a0c, 0x0d65, 0x9082, 0x001b, 0x0002, 0x16f0, 0x16f0, 0x16f2,
+	0x16f0, 0x16f0, 0x16f0, 0x16f8, 0x16f0, 0x16f0, 0x16f0, 0x16fe,
+	0x16f0, 0x16f0, 0x16f0, 0x1704, 0x16f0, 0x16f0, 0x16f0, 0x170a,
+	0x16f0, 0x16f0, 0x16f0, 0x1710, 0x16f0, 0x16f0, 0x16f0, 0x1716,
+	0x080c, 0x0d65, 0xa574, 0xa478, 0xa37c, 0xa280, 0x0804, 0x1761,
+	0xa584, 0xa488, 0xa38c, 0xa290, 0x0804, 0x1761, 0xa594, 0xa498,
+	0xa39c, 0xa2a0, 0x0804, 0x1761, 0xa5a4, 0xa4a8, 0xa3ac, 0xa2b0,
+	0x0804, 0x1761, 0xa5b4, 0xa4b8, 0xa3bc, 0xa2c0, 0x0804, 0x1761,
+	0xa5c4, 0xa4c8, 0xa3cc, 0xa2d0, 0x0804, 0x1761, 0xa5d4, 0xa4d8,
+	0xa3dc, 0xa2e0, 0x0804, 0x1761, 0x2c05, 0x908a, 0x0034, 0x1a0c,
+	0x0d65, 0x9082, 0x001b, 0x0002, 0x173f, 0x173d, 0x173d, 0x173d,
+	0x173d, 0x173d, 0x1746, 0x173d, 0x173d, 0x173d, 0x173d, 0x173d,
+	0x174d, 0x173d, 0x173d, 0x173d, 0x173d, 0x173d, 0x1754, 0x173d,
+	0x173d, 0x173d, 0x173d, 0x173d, 0x175b, 0x080c, 0x0d65, 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, 0x1679, 0x2ff0, 0x0126, 0x2091, 0x2200, 0x3e60,
+	0x6014, 0x2048, 0x2940, 0xa80e, 0x2061, 0x1cc5, 0xa813, 0x1cc5,
+	0x2c05, 0xa80a, 0xa964, 0xa91a, 0xa87c, 0xd0ac, 0x090c, 0x0d65,
+	0x9006, 0xa842, 0xa83e, 0x2c05, 0x908a, 0x0034, 0x1a0c, 0x0d65,
+	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, 0x0d65, 0xa80e, 0xa064, 0xa81a, 0x9084, 0x000f,
+	0x9080, 0x1cca, 0x2015, 0x82ff, 0x090c, 0x0d65, 0xaa12, 0x2205,
+	0xa80a, 0x0c18, 0x903e, 0x2730, 0xa880, 0xd0fc, 0x1190, 0x2d00,
+	0x0002, 0x18c7, 0x1829, 0x1829, 0x18c7, 0x18c7, 0x18c1, 0x18c7,
+	0x1829, 0x18c7, 0x1878, 0x1878, 0x18c7, 0x18c7, 0x18c7, 0x18be,
+	0x1878, 0xc0fc, 0xa882, 0xab2c, 0xaa30, 0xad1c, 0xac20, 0xdd9c,
+	0x0904, 0x18c9, 0x2c05, 0x908a, 0x0034, 0x1a0c, 0x0d65, 0x9082,
+	0x001b, 0x0002, 0x1815, 0x1813, 0x1813, 0x1813, 0x1813, 0x1813,
+	0x1819, 0x1813, 0x1813, 0x1813, 0x1813, 0x1813, 0x181d, 0x1813,
+	0x1813, 0x1813, 0x1813, 0x1813, 0x1821, 0x1813, 0x1813, 0x1813,
+	0x1813, 0x1813, 0x1825, 0x080c, 0x0d65, 0xa774, 0xa678, 0x0804,
+	0x18c9, 0xa78c, 0xa690, 0x0804, 0x18c9, 0xa7a4, 0xa6a8, 0x0804,
+	0x18c9, 0xa7bc, 0xa6c0, 0x0804, 0x18c9, 0xa7d4, 0xa6d8, 0x0804,
+	0x18c9, 0x2c05, 0x908a, 0x0036, 0x1a0c, 0x0d65, 0x9082, 0x001b,
+	0x0002, 0x184c, 0x184c, 0x184e, 0x184c, 0x184c, 0x184c, 0x1854,
+	0x184c, 0x184c, 0x184c, 0x185a, 0x184c, 0x184c, 0x184c, 0x1860,
+	0x184c, 0x184c, 0x184c, 0x1866, 0x184c, 0x184c, 0x184c, 0x186c,
+	0x184c, 0x184c, 0x184c, 0x1872, 0x080c, 0x0d65, 0xa574, 0xa478,
+	0xa37c, 0xa280, 0x0804, 0x18c9, 0xa584, 0xa488, 0xa38c, 0xa290,
+	0x0804, 0x18c9, 0xa594, 0xa498, 0xa39c, 0xa2a0, 0x0804, 0x18c9,
+	0xa5a4, 0xa4a8, 0xa3ac, 0xa2b0, 0x0804, 0x18c9, 0xa5b4, 0xa4b8,
+	0xa3bc, 0xa2c0, 0x0804, 0x18c9, 0xa5c4, 0xa4c8, 0xa3cc, 0xa2d0,
+	0x0804, 0x18c9, 0xa5d4, 0xa4d8, 0xa3dc, 0xa2e0, 0x0804, 0x18c9,
+	0x2c05, 0x908a, 0x0034, 0x1a0c, 0x0d65, 0x9082, 0x001b, 0x0002,
+	0x189b, 0x1899, 0x1899, 0x1899, 0x1899, 0x1899, 0x18a2, 0x1899,
+	0x1899, 0x1899, 0x1899, 0x1899, 0x18a9, 0x1899, 0x1899, 0x1899,
+	0x1899, 0x1899, 0x18b0, 0x1899, 0x1899, 0x1899, 0x1899, 0x1899,
+	0x18b7, 0x080c, 0x0d65, 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, 0x1ca0, 0x1904, 0x17d2, 0x900e, 0x0050, 0x080c,
+	0x0d65, 0xab2e, 0xaa32, 0xad1e, 0xac22, 0xaf26, 0xae2a, 0x080c,
+	0x1ca0, 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, 0x9b03, 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, 0x1321,
+	0x8631, 0x1db8, 0x00ce, 0x781f, 0x0800, 0x2031, 0x0168, 0x00c6,
+	0x7808, 0xd09c, 0x190c, 0x1321, 0x00ce, 0x2001, 0x0038, 0x080c,
+	0x19cc, 0x7930, 0x9186, 0x0040, 0x0160, 0x9186, 0x0042, 0x190c,
+	0x0d65, 0x2001, 0x001e, 0x8001, 0x1df0, 0x8631, 0x1d40, 0x080c,
+	0x19db, 0x000e, 0x6022, 0x012e, 0x0005, 0x080c, 0x19c8, 0x7827,
+	0x0015, 0x7828, 0x9c06, 0x1db8, 0x782b, 0x0000, 0x0ca0, 0x00f6,
+	0x2079, 0x0300, 0x7803, 0x0000, 0x78ab, 0x0004, 0x00fe, 0x080c,
+	0x6f5c, 0x11b0, 0x2001, 0x0138, 0x2003, 0x0000, 0x2001, 0x0160,
+	0x2003, 0x0000, 0x2011, 0x012c, 0xa001, 0xa001, 0x8211, 0x1de0,
+	0x0081, 0x2001, 0x0386, 0x2003, 0x2020, 0x080c, 0x6ffd, 0x0005,
+	0x0479, 0x0039, 0x2001, 0x0160, 0x2502, 0x2001, 0x0138, 0x2202,
+	0x0005, 0x00e6, 0x2071, 0x0200, 0x080c, 0x27e3, 0x2009, 0x003c,
+	0x080c, 0x201d, 0x2001, 0x015d, 0x2003, 0x0000, 0x7000, 0x9084,
+	0x003c, 0x1de0, 0x080c, 0x7ed6, 0x70a0, 0x70a2, 0x7098, 0x709a,
+	0x709c, 0x709e, 0x2001, 0x020d, 0x2003, 0x0020, 0x00f6, 0x2079,
+	0x0300, 0x080c, 0x12e1, 0x7803, 0x0001, 0x00fe, 0x00ee, 0x0005,
+	0x2001, 0x0138, 0x2014, 0x2003, 0x0000, 0x2001, 0x0160, 0x202c,
+	0x2003, 0x0000, 0x080c, 0x6f5c, 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, 0x1595,
+	0x7930, 0x0005, 0x2c08, 0x621c, 0x080c, 0x15c2, 0x7930, 0x0005,
+	0x8001, 0x1df0, 0x0005, 0x2031, 0x0005, 0x781c, 0x9084, 0x0007,
+	0x0170, 0x2001, 0x0038, 0x0c41, 0x9186, 0x0040, 0x0904, 0x1a39,
+	0x2001, 0x001e, 0x0c69, 0x8631, 0x1d80, 0x080c, 0x0d65, 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, 0x19d2, 0x9186, 0x0040, 0x190c,
+	0x0d65, 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, 0x0d65, 0xa001, 0xa001, 0x781f,
+	0x0200, 0x0005, 0x0126, 0x2091, 0x2400, 0x2079, 0x0380, 0x2001,
+	0x19b6, 0x2070, 0x012e, 0x0005, 0x2cf0, 0x0126, 0x2091, 0x2400,
+	0x3e60, 0x6014, 0x2048, 0xa964, 0xa91a, 0x918c, 0x00ff, 0x9184,
+	0x000f, 0x0002, 0x1a62, 0x1a62, 0x1a62, 0x1a62, 0x1a62, 0x1a62,
+	0x1a62, 0x1a62, 0x1a62, 0x1a64, 0x1a62, 0x1a62, 0x1a62, 0x1a62,
+	0x1a62, 0x1a62, 0x080c, 0x0d65, 0xa87c, 0xd0b4, 0x0904, 0x1bd3,
+	0x9184, 0x000f, 0x9080, 0x1cca, 0x2015, 0x2205, 0xab88, 0x2908,
+	0xa80a, 0xa90e, 0xaa12, 0xab16, 0x9006, 0xa842, 0xa83e, 0x012e,
+	0x0005, 0x2cf0, 0x0126, 0x2091, 0x2400, 0x3e60, 0x6014, 0x2048,
+	0xa88c, 0xa990, 0xaaac, 0xabb0, 0xaa36, 0xab3a, 0xa83e, 0xa942,
+	0xa846, 0xa94a, 0xa964, 0x918c, 0x00ff, 0x9186, 0x001e, 0x0190,
+	0x2940, 0xa064, 0xa81a, 0x90ec, 0x000f, 0x9d80, 0x1cca, 0x2065,
+	0x2c05, 0x2808, 0x2c10, 0xab88, 0xa80a, 0xa90e, 0xaa12, 0xab16,
+	0x012e, 0x0005, 0xa804, 0x2040, 0x0c60, 0x2cf0, 0x0126, 0x2091,
+	0x2400, 0x3e60, 0x6014, 0x2048, 0xa97c, 0x2950, 0xd1dc, 0x1904,
+	0x1b9d, 0xc1dd, 0xa97e, 0x9006, 0xa842, 0xa83e, 0xa988, 0x8109,
+	0xa916, 0xa964, 0xa91a, 0x9184, 0x000f, 0x9088, 0x1cca, 0x2145,
+	0x0002, 0x1ad1, 0x1adf, 0x1ad1, 0x1ad1, 0x1ad1, 0x1ad3, 0x1ad1,
+	0x1ad1, 0x1b34, 0x1b34, 0x1ad1, 0x1ad1, 0x1ad1, 0x1b32, 0x1ad1,
+	0x1ad1, 0x080c, 0x0d65, 0xa804, 0x2050, 0xb164, 0xa91a, 0x9184,
+	0x000f, 0x9080, 0x1cca, 0x2045, 0xd19c, 0x1904, 0x1b34, 0x9036,
+	0x2638, 0x2805, 0x908a, 0x0036, 0x1a0c, 0x0d65, 0x9082, 0x001b,
+	0x0002, 0x1b04, 0x1b04, 0x1b06, 0x1b04, 0x1b04, 0x1b04, 0x1b0c,
+	0x1b04, 0x1b04, 0x1b04, 0x1b12, 0x1b04, 0x1b04, 0x1b04, 0x1b18,
+	0x1b04, 0x1b04, 0x1b04, 0x1b1e, 0x1b04, 0x1b04, 0x1b04, 0x1b24,
+	0x1b04, 0x1b04, 0x1b04, 0x1b2a, 0x080c, 0x0d65, 0xb574, 0xb478,
+	0xb37c, 0xb280, 0x0804, 0x1b79, 0xb584, 0xb488, 0xb38c, 0xb290,
+	0x0804, 0x1b79, 0xb594, 0xb498, 0xb39c, 0xb2a0, 0x0804, 0x1b79,
+	0xb5a4, 0xb4a8, 0xb3ac, 0xb2b0, 0x0804, 0x1b79, 0xb5b4, 0xb4b8,
+	0xb3bc, 0xb2c0, 0x0804, 0x1b79, 0xb5c4, 0xb4c8, 0xb3cc, 0xb2d0,
+	0x0804, 0x1b79, 0xb5d4, 0xb4d8, 0xb3dc, 0xb2e0, 0x0804, 0x1b79,
+	0x0804, 0x1b79, 0x080c, 0x0d65, 0x2805, 0x908a, 0x0034, 0x1a0c,
+	0x0d65, 0x9082, 0x001b, 0x0002, 0x1b57, 0x1b55, 0x1b55, 0x1b55,
+	0x1b55, 0x1b55, 0x1b5e, 0x1b55, 0x1b55, 0x1b55, 0x1b55, 0x1b55,
+	0x1b65, 0x1b55, 0x1b55, 0x1b55, 0x1b55, 0x1b55, 0x1b6c, 0x1b55,
+	0x1b55, 0x1b55, 0x1b55, 0x1b55, 0x1b73, 0x080c, 0x0d65, 0xb56c,
+	0xb470, 0xb774, 0xb678, 0xb37c, 0xb280, 0x00d8, 0xb584, 0xb488,
+	0xb78c, 0xb690, 0xb394, 0xb298, 0x00a0, 0xb59c, 0xb4a0, 0xb7a4,
+	0xb6a8, 0xb3ac, 0xb2b0, 0x0068, 0xb5b4, 0xb4b8, 0xb7bc, 0xb6c0,
+	0xb3c4, 0xb2c8, 0x0030, 0xb5cc, 0xb4d0, 0xb7d4, 0xb6d8, 0xb3dc,
+	0xb2e0, 0xab2e, 0xaa32, 0xad1e, 0xac22, 0xaf26, 0xae2a, 0xa988,
+	0x8109, 0xa916, 0x1118, 0x9006, 0x012e, 0x0005, 0x8840, 0x2805,
+	0x9005, 0x1168, 0xb004, 0x9005, 0x090c, 0x0d65, 0x2050, 0xb164,
+	0xa91a, 0x9184, 0x000f, 0x9080, 0x1cca, 0x2045, 0x2805, 0x2810,
+	0x2a08, 0xa80a, 0xa90e, 0xaa12, 0x0c30, 0x3e60, 0x6344, 0xd3fc,
+	0x190c, 0x0d65, 0xa93c, 0xaa40, 0xa844, 0x9106, 0x1118, 0xa848,
+	0x9206, 0x0508, 0x2958, 0xab48, 0xac44, 0x2940, 0x080c, 0x1cea,
+	0x1998, 0x2850, 0x2c40, 0xab14, 0xa880, 0xd0fc, 0x1140, 0xa810,
+	0x2005, 0xa80a, 0x2a00, 0xa80e, 0x2009, 0x8015, 0x0070, 0x00c6,
+	0x3e60, 0x6044, 0xc0a4, 0x9085, 0x8005, 0x6046, 0x00ce, 0x8319,
+	0xab16, 0x1904, 0x1b86, 0x2009, 0x8005, 0x3e60, 0x6044, 0x9105,
+	0x6046, 0x0804, 0x1b83, 0x080c, 0x0d65, 0x00f6, 0x00e6, 0x0096,
+	0x00c6, 0x0026, 0x704c, 0x9c06, 0x190c, 0x0d65, 0x2079, 0x0090,
+	0x2001, 0x0105, 0x2003, 0x0010, 0x782b, 0x0004, 0x7057, 0x0000,
+	0x6014, 0x2048, 0x080c, 0xb6c5, 0x0118, 0xa880, 0xc0bd, 0xa882,
+	0x6020, 0x9086, 0x0006, 0x1170, 0x2061, 0x0100, 0x62c8, 0x2001,
+	0x00fa, 0x8001, 0x1df0, 0x60c8, 0x9206, 0x1dc0, 0x60c4, 0xa89a,
+	0x60c8, 0xa896, 0x704c, 0x2060, 0x00c6, 0x080c, 0xb2d0, 0x080c,
+	0x9746, 0x00ce, 0x704c, 0x9c06, 0x1150, 0x2009, 0x0040, 0x080c,
+	0x201d, 0x080c, 0x9336, 0x2011, 0x0000, 0x080c, 0x91ad, 0x002e,
+	0x00ce, 0x009e, 0x00ee, 0x00fe, 0x0005, 0x00f6, 0x2079, 0x0090,
+	0x781c, 0x0006, 0x7818, 0x0006, 0x2079, 0x0100, 0x7a14, 0x9284,
+	0x1984, 0x9085, 0x0012, 0x7816, 0x2019, 0x1000, 0x8319, 0x090c,
+	0x0d65, 0x7820, 0xd0bc, 0x1dd0, 0x79c8, 0x000e, 0x9102, 0x001e,
+	0x0006, 0x0016, 0x79c4, 0x000e, 0x9103, 0x78c6, 0x000e, 0x78ca,
+	0x9284, 0x1984, 0x9085, 0x0012, 0x7816, 0x2079, 0x0090, 0x782b,
+	0x0008, 0x7057, 0x0000, 0x00fe, 0x0005, 0x00f6, 0x00e6, 0x2071,
+	0x19b6, 0x7054, 0x9086, 0x0000, 0x0904, 0x1c9b, 0x2079, 0x0090,
+	0x2009, 0x0207, 0x210c, 0xd194, 0x01b8, 0x2009, 0x020c, 0x210c,
+	0x9184, 0x0003, 0x0188, 0x080c, 0xd448, 0x2001, 0x0133, 0x2004,
+	0x9005, 0x090c, 0x0d65, 0x0016, 0x2009, 0x0040, 0x080c, 0x201d,
+	0x001e, 0x2001, 0x020c, 0x2102, 0x2009, 0x0206, 0x2104, 0x2009,
+	0x0203, 0x210c, 0x9106, 0x1120, 0x2009, 0x0040, 0x080c, 0x201d,
+	0x782c, 0xd0fc, 0x09a8, 0x080c, 0x9762, 0x782c, 0xd0fc, 0x1de8,
+	0x080c, 0x9746, 0x7054, 0x9086, 0x0000, 0x1950, 0x782b, 0x0004,
+	0x782c, 0xd0ac, 0x1de8, 0x2009, 0x0040, 0x080c, 0x201d, 0x782b,
+	0x0002, 0x7057, 0x0000, 0x00ee, 0x00fe, 0x0005, 0x080c, 0x0d65,
+	0x8c60, 0x2c05, 0x9005, 0x0110, 0x8a51, 0x0005, 0xa004, 0x9005,
+	0x0168, 0xa85a, 0x2040, 0xa064, 0x9084, 0x000f, 0x9080, 0x1cca,
+	0x2065, 0x8cff, 0x090c, 0x0d65, 0x8a51, 0x0005, 0x2050, 0x0005,
+	0x0000, 0x001d, 0x0021, 0x0025, 0x0029, 0x002d, 0x0031, 0x0035,
+	0x0000, 0x001b, 0x0021, 0x0027, 0x002d, 0x0033, 0x0000, 0x0000,
+	0x0023, 0x0000, 0x0000, 0x1cbd, 0x1cb9, 0x0000, 0x0000, 0x1cc7,
+	0x0000, 0x1cbd, 0x1cc4, 0x1cc4, 0x1cc1, 0x0000, 0x0000, 0x0000,
+	0x1cc7, 0x1cc4, 0x0000, 0x1cbf, 0x1cbf, 0x0000, 0x0000, 0x1cc7,
+	0x0000, 0x1cbf, 0x1cc5, 0x1cc5, 0x1cc5, 0x0000, 0x0000, 0x0000,
+	0x1cc7, 0x1cc5, 0x00c6, 0x00d6, 0x0086, 0xab42, 0xac3e, 0xa888,
+	0x9055, 0x0904, 0x1ec1, 0x2940, 0xa064, 0x90ec, 0x000f, 0x9de0,
+	0x1cca, 0x9d86, 0x0007, 0x0130, 0x9d86, 0x000e, 0x0118, 0x9d86,
+	0x000f, 0x1120, 0xa08c, 0x9422, 0xa090, 0x931b, 0x2c05, 0x9065,
+	0x1140, 0x0310, 0x0804, 0x1ec1, 0xa004, 0x9045, 0x0904, 0x1ec1,
+	0x0c18, 0x2c05, 0x9005, 0x0904, 0x1da9, 0xdd9c, 0x1904, 0x1d65,
+	0x908a, 0x0036, 0x1a0c, 0x0d65, 0x9082, 0x001b, 0x0002, 0x1d3a,
+	0x1d3a, 0x1d3c, 0x1d3a, 0x1d3a, 0x1d3a, 0x1d42, 0x1d3a, 0x1d3a,
+	0x1d3a, 0x1d48, 0x1d3a, 0x1d3a, 0x1d3a, 0x1d4e, 0x1d3a, 0x1d3a,
+	0x1d3a, 0x1d54, 0x1d3a, 0x1d3a, 0x1d3a, 0x1d5a, 0x1d3a, 0x1d3a,
+	0x1d3a, 0x1d60, 0x080c, 0x0d65, 0xa07c, 0x9422, 0xa080, 0x931b,
+	0x0804, 0x1d9f, 0xa08c, 0x9422, 0xa090, 0x931b, 0x0804, 0x1d9f,
+	0xa09c, 0x9422, 0xa0a0, 0x931b, 0x0804, 0x1d9f, 0xa0ac, 0x9422,
+	0xa0b0, 0x931b, 0x0804, 0x1d9f, 0xa0bc, 0x9422, 0xa0c0, 0x931b,
+	0x0804, 0x1d9f, 0xa0cc, 0x9422, 0xa0d0, 0x931b, 0x0804, 0x1d9f,
+	0xa0dc, 0x9422, 0xa0e0, 0x931b, 0x04d0, 0x908a, 0x0034, 0x1a0c,
+	0x0d65, 0x9082, 0x001b, 0x0002, 0x1d87, 0x1d85, 0x1d85, 0x1d85,
+	0x1d85, 0x1d85, 0x1d8c, 0x1d85, 0x1d85, 0x1d85, 0x1d85, 0x1d85,
+	0x1d91, 0x1d85, 0x1d85, 0x1d85, 0x1d85, 0x1d85, 0x1d96, 0x1d85,
+	0x1d85, 0x1d85, 0x1d85, 0x1d85, 0x1d9b, 0x080c, 0x0d65, 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, 0x1ec1, 0x8c60, 0x0804,
+	0x1d11, 0xa004, 0x9045, 0x0904, 0x1ec1, 0x0804, 0x1cf4, 0x8a51,
+	0x0904, 0x1ec1, 0x8c60, 0x2c05, 0x9005, 0x1158, 0xa004, 0x9045,
+	0x0904, 0x1ec1, 0xa064, 0x90ec, 0x000f, 0x9de0, 0x1cca, 0x2c05,
+	0x2060, 0xa880, 0xc0fc, 0xa882, 0x0804, 0x1eb6, 0x2c05, 0x8422,
+	0x8420, 0x831a, 0x9399, 0x0000, 0xac2e, 0xab32, 0xdd9c, 0x1904,
+	0x1e53, 0x9082, 0x001b, 0x0002, 0x1def, 0x1def, 0x1df1, 0x1def,
+	0x1def, 0x1def, 0x1dff, 0x1def, 0x1def, 0x1def, 0x1e0d, 0x1def,
+	0x1def, 0x1def, 0x1e1b, 0x1def, 0x1def, 0x1def, 0x1e29, 0x1def,
+	0x1def, 0x1def, 0x1e37, 0x1def, 0x1def, 0x1def, 0x1e45, 0x080c,
+	0x0d65, 0xa17c, 0x2400, 0x9122, 0xa180, 0x2300, 0x911b, 0x0a0c,
+	0x0d65, 0xa074, 0x9420, 0xa078, 0x9319, 0x0804, 0x1eb1, 0xa18c,
+	0x2400, 0x9122, 0xa190, 0x2300, 0x911b, 0x0a0c, 0x0d65, 0xa084,
+	0x9420, 0xa088, 0x9319, 0x0804, 0x1eb1, 0xa19c, 0x2400, 0x9122,
+	0xa1a0, 0x2300, 0x911b, 0x0a0c, 0x0d65, 0xa094, 0x9420, 0xa098,
+	0x9319, 0x0804, 0x1eb1, 0xa1ac, 0x2400, 0x9122, 0xa1b0, 0x2300,
+	0x911b, 0x0a0c, 0x0d65, 0xa0a4, 0x9420, 0xa0a8, 0x9319, 0x0804,
+	0x1eb1, 0xa1bc, 0x2400, 0x9122, 0xa1c0, 0x2300, 0x911b, 0x0a0c,
+	0x0d65, 0xa0b4, 0x9420, 0xa0b8, 0x9319, 0x0804, 0x1eb1, 0xa1cc,
+	0x2400, 0x9122, 0xa1d0, 0x2300, 0x911b, 0x0a0c, 0x0d65, 0xa0c4,
+	0x9420, 0xa0c8, 0x9319, 0x0804, 0x1eb1, 0xa1dc, 0x2400, 0x9122,
+	0xa1e0, 0x2300, 0x911b, 0x0a0c, 0x0d65, 0xa0d4, 0x9420, 0xa0d8,
+	0x9319, 0x0804, 0x1eb1, 0x9082, 0x001b, 0x0002, 0x1e71, 0x1e6f,
+	0x1e6f, 0x1e6f, 0x1e6f, 0x1e6f, 0x1e7e, 0x1e6f, 0x1e6f, 0x1e6f,
+	0x1e6f, 0x1e6f, 0x1e8b, 0x1e6f, 0x1e6f, 0x1e6f, 0x1e6f, 0x1e6f,
+	0x1e98, 0x1e6f, 0x1e6f, 0x1e6f, 0x1e6f, 0x1e6f, 0x1ea5, 0x080c,
+	0x0d65, 0xa17c, 0x2400, 0x9122, 0xa180, 0x2300, 0x911b, 0x0a0c,
+	0x0d65, 0xa06c, 0x9420, 0xa070, 0x9319, 0x0498, 0xa194, 0x2400,
+	0x9122, 0xa198, 0x2300, 0x911b, 0x0a0c, 0x0d65, 0xa084, 0x9420,
+	0xa088, 0x9319, 0x0430, 0xa1ac, 0x2400, 0x9122, 0xa1b0, 0x2300,
+	0x911b, 0x0a0c, 0x0d65, 0xa09c, 0x9420, 0xa0a0, 0x9319, 0x00c8,
+	0xa1c4, 0x2400, 0x9122, 0xa1c8, 0x2300, 0x911b, 0x0a0c, 0x0d65,
+	0xa0b4, 0x9420, 0xa0b8, 0x9319, 0x0060, 0xa1dc, 0x2400, 0x9122,
+	0xa1e0, 0x2300, 0x911b, 0x0a0c, 0x0d65, 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, 0x00c6,
+	0x610c, 0x0016, 0x9026, 0x2410, 0x6004, 0x9420, 0x9291, 0x0000,
+	0x2c04, 0x9210, 0x9ce0, 0x0002, 0x918a, 0x0002, 0x1da8, 0x9284,
+	0x000f, 0x9405, 0x001e, 0x00ce, 0x0005, 0x7803, 0x0003, 0x780f,
+	0x0000, 0x6004, 0x7812, 0x2c04, 0x7816, 0x9ce0, 0x0002, 0x918a,
+	0x0002, 0x1db8, 0x0005, 0x2001, 0x0005, 0x2004, 0xd0bc, 0x190c,
+	0x0d5e, 0xd094, 0x0110, 0x080c, 0x11bd, 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, 0x201a, 0x7900, 0xd1dc, 0x1118, 0x9084, 0x0006,
+	0x001a, 0x9084, 0x000e, 0x0002, 0x1f3c, 0x1f34, 0x7905, 0x1f34,
+	0x1f36, 0x1f36, 0x1f36, 0x1f36, 0x78eb, 0x1f34, 0x1f38, 0x1f34,
+	0x1f36, 0x1f34, 0x1f36, 0x1f34, 0x080c, 0x0d65, 0x0031, 0x0020,
+	0x080c, 0x78eb, 0x080c, 0x7905, 0x0005, 0x0006, 0x0016, 0x0026,
+	0x080c, 0xd448, 0x7930, 0x9184, 0x0003, 0x01f0, 0x080c, 0x9746,
+	0x2001, 0x19c9, 0x2004, 0x9005, 0x0180, 0x2001, 0x0133, 0x2004,
+	0x9005, 0x090c, 0x0d65, 0x00c6, 0x2001, 0x19c9, 0x2064, 0x080c,
+	0x9762, 0x080c, 0xb2d0, 0x00ce, 0x0408, 0x2009, 0x0040, 0x080c,
+	0x201d, 0x080c, 0x9762, 0x00d0, 0x9184, 0x0014, 0x01a0, 0x6a00,
+	0x9286, 0x0003, 0x0160, 0x080c, 0x6f5c, 0x1138, 0x080c, 0x725c,
+	0x080c, 0x5be2, 0x080c, 0x6e8d, 0x0010, 0x080c, 0x5a9d, 0x080c,
+	0x7993, 0x0041, 0x0018, 0x9184, 0x9540, 0x1dc8, 0x002e, 0x001e,
+	0x000e, 0x0005, 0x00e6, 0x0036, 0x0046, 0x0056, 0x2071, 0x1a3a,
+	0x080c, 0x193f, 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, 0x0d5e, 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, 0x27dd, 0x080c, 0x270a, 0x080c, 0x284e, 0x9006,
+	0x080c, 0x2739, 0x9006, 0x080c, 0x271c, 0x20a9, 0x0012, 0x1d04,
+	0x2047, 0x2091, 0x6000, 0x1f04, 0x2047, 0x602f, 0x0100, 0x602f,
+	0x0000, 0x6050, 0x9085, 0x0400, 0x9084, 0xdfff, 0x6052, 0x6224,
+	0x080c, 0x282b, 0x080c, 0x2428, 0x2009, 0x00ef, 0x6132, 0x6136,
+	0x080c, 0x2438, 0x60e7, 0x0000, 0x61ea, 0x60e3, 0x0002, 0x604b,
+	0xf7f7, 0x6043, 0x0000, 0x602f, 0x0080, 0x602f, 0x0000, 0x6007,
+	0x149f, 0x00c6, 0x2061, 0x0140, 0x608b, 0x000b, 0x608f, 0x10b8,
+	0x6093, 0x0000, 0x6097, 0x0198, 0x00ce, 0x6004, 0x9085, 0x8000,
+	0x6006, 0x60bb, 0x0000, 0x20a9, 0x0018, 0x60bf, 0x0000, 0x1f04,
+	0x2085, 0x60bb, 0x0000, 0x60bf, 0x0108, 0x60bf, 0x0012, 0x60bf,
+	0x0320, 0x60bf, 0x0018, 0x601b, 0x00f0, 0x601f, 0x001e, 0x600f,
+	0x006b, 0x602b, 0x402c, 0x012e, 0x0005, 0x00f6, 0x2079, 0x0140,
+	0x78c3, 0x0080, 0x78c3, 0x0083, 0x78c3, 0x0000, 0x00fe, 0x0005,
+	0x2001, 0x1834, 0x2003, 0x0000, 0x2001, 0x1833, 0x2003, 0x0001,
+	0x0005, 0x0126, 0x2091, 0x2800, 0x0006, 0x0016, 0x0026, 0x6124,
+	0x6028, 0x910c, 0x9184, 0x5e2c, 0x1118, 0x9184, 0x0007, 0x002a,
+	0x9195, 0x0004, 0x9284, 0x0007, 0x0002, 0x20d0, 0x20cd, 0x20cd,
+	0x20cd, 0x20cf, 0x20cd, 0x20cd, 0x20cd, 0x080c, 0x0d65, 0x0029,
+	0x002e, 0x001e, 0x000e, 0x012e, 0x0005, 0x00a6, 0x6124, 0x6028,
+	0xd09c, 0x0118, 0xd19c, 0x1904, 0x232f, 0xd1f4, 0x190c, 0x0d5e,
+	0x080c, 0x6f5c, 0x0904, 0x212d, 0x080c, 0xbdd7, 0x1120, 0x7000,
+	0x9086, 0x0003, 0x0580, 0x6024, 0x9084, 0x1800, 0x0560, 0x080c,
+	0x6f7f, 0x0118, 0x080c, 0x6f6d, 0x1530, 0x2011, 0x0020, 0x080c,
+	0x282b, 0x6043, 0x0000, 0x080c, 0xbdd7, 0x0168, 0x080c, 0x6f7f,
+	0x1150, 0x2001, 0x1976, 0x2003, 0x0001, 0x6027, 0x1800, 0x080c,
+	0x6dd2, 0x0804, 0x2332, 0x70a0, 0x9005, 0x1150, 0x70a3, 0x0001,
+	0x00d6, 0x2069, 0x0140, 0x080c, 0x6fb3, 0x00de, 0x1904, 0x2332,
+	0x080c, 0x7266, 0x0428, 0x080c, 0x6f7f, 0x1590, 0x6024, 0x9084,
+	0x1800, 0x1108, 0x0468, 0x080c, 0x7266, 0x080c, 0x725c, 0x080c,
+	0x5be2, 0x080c, 0x6e8d, 0x0804, 0x232f, 0xd1ac, 0x1508, 0x6024,
+	0xd0dc, 0x1170, 0xd0e4, 0x1178, 0xd0d4, 0x1190, 0xd0cc, 0x0130,
+	0x7094, 0x9086, 0x0028, 0x1110, 0x080c, 0x713f, 0x0804, 0x232f,
+	0x080c, 0x7261, 0x0048, 0x2001, 0x194e, 0x2003, 0x0002, 0x0020,
+	0x080c, 0x709d, 0x0804, 0x232f, 0x080c, 0x71e1, 0x0804, 0x232f,
+	0xd1ac, 0x0904, 0x2249, 0x080c, 0x6f5c, 0x11d0, 0x2011, 0x0020,
+	0x080c, 0x282b, 0x0006, 0x0026, 0x0036, 0x080c, 0x6f76, 0x1158,
+	0x080c, 0x725c, 0x080c, 0x5be2, 0x080c, 0x6e8d, 0x003e, 0x002e,
+	0x000e, 0x00ae, 0x0005, 0x003e, 0x002e, 0x000e, 0x080c, 0x6f30,
+	0x0016, 0x0046, 0x00c6, 0x644c, 0x9486, 0xf0f0, 0x1138, 0x2061,
+	0x0100, 0x644a, 0x6043, 0x0090, 0x6043, 0x0010, 0x74d6, 0x948c,
+	0xff00, 0x7038, 0xd084, 0x0178, 0x9186, 0xf800, 0x1160, 0x7044,
+	0xd084, 0x1148, 0xc085, 0x7046, 0x0036, 0x2418, 0x2011, 0x8016,
+	0x080c, 0x47fb, 0x003e, 0x080c, 0xbdd0, 0x1904, 0x2220, 0x9196,
+	0xff00, 0x05a8, 0x705c, 0x9084, 0x00ff, 0x810f, 0x81ff, 0x0110,
+	0x9116, 0x0568, 0x7130, 0xd184, 0x1550, 0x080c, 0x313d, 0x0128,
+	0xc18d, 0x7132, 0x080c, 0x6555, 0x1510, 0x6240, 0x9294, 0x0010,
+	0x0130, 0x6248, 0x9294, 0xff00, 0x9296, 0xff00, 0x01c0, 0x7030,
+	0xd08c, 0x0904, 0x2220, 0x7038, 0xd08c, 0x1140, 0x2001, 0x180c,
+	0x200c, 0xd1ac, 0x1904, 0x2220, 0xc1ad, 0x2102, 0x0036, 0x73d4,
+	0x2011, 0x8013, 0x080c, 0x47fb, 0x003e, 0x0804, 0x2220, 0x7038,
+	0xd08c, 0x1140, 0x2001, 0x180c, 0x200c, 0xd1ac, 0x1904, 0x2220,
+	0xc1ad, 0x2102, 0x0036, 0x73d4, 0x2011, 0x8013, 0x080c, 0x47fb,
+	0x003e, 0x7130, 0xc185, 0x7132, 0x2011, 0x1854, 0x220c, 0x00f0,
+	0x0016, 0x2009, 0x0001, 0x2011, 0x0100, 0x080c, 0x8248, 0x2019,
+	0x000e, 0x00c6, 0x2061, 0x0000, 0x080c, 0xd046, 0x00ce, 0x9484,
+	0x00ff, 0x9080, 0x3142, 0x200d, 0x918c, 0xff00, 0x810f, 0x2120,
+	0x9006, 0x2009, 0x000e, 0x080c, 0xd0ce, 0x001e, 0xd1ac, 0x1148,
+	0x0016, 0x2009, 0x0002, 0x2019, 0x0004, 0x080c, 0x2f80, 0x001e,
+	0x0078, 0x0156, 0x00b6, 0x20a9, 0x007f, 0x900e, 0x080c, 0x6166,
+	0x1110, 0x080c, 0x5bfc, 0x8108, 0x1f04, 0x2216, 0x00be, 0x015e,
+	0x00ce, 0x004e, 0x080c, 0x9746, 0x080c, 0x99eb, 0x080c, 0x9762,
+	0x60e3, 0x0000, 0x001e, 0x2001, 0x1800, 0x2014, 0x9296, 0x0004,
+	0x1170, 0xd19c, 0x11b0, 0x2011, 0x180c, 0x2214, 0xd29c, 0x1120,
+	0x6204, 0x9295, 0x0002, 0x6206, 0x6228, 0xc29d, 0x622a, 0x2003,
+	0x0001, 0x2001, 0x1825, 0x2003, 0x0000, 0x2011, 0x0020, 0x080c,
+	0x282b, 0xd194, 0x0904, 0x232f, 0x0016, 0x080c, 0x9746, 0x6220,
+	0xd2b4, 0x0904, 0x22d7, 0x080c, 0x8068, 0x080c, 0x8e21, 0x2011,
+	0x0004, 0x080c, 0x282b, 0x00f6, 0x2019, 0x19c2, 0x2304, 0x907d,
+	0x0904, 0x22a4, 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, 0x2801, 0x2001, 0x001e,
+	0x8001, 0x0240, 0x20a9, 0x0009, 0x080c, 0x27b8, 0x6904, 0xd1dc,
+	0x1140, 0x0cb0, 0x2001, 0x0100, 0x080c, 0x27f1, 0x9006, 0x080c,
+	0x27f1, 0x080c, 0x86d1, 0x080c, 0x9762, 0x7814, 0x2048, 0xa867,
+	0x0103, 0x2f60, 0x080c, 0x9a65, 0x009e, 0x00ee, 0x00ce, 0x00de,
+	0x00fe, 0x001e, 0x00ae, 0x0005, 0x00fe, 0x00d6, 0x2069, 0x0140,
+	0x6804, 0x9084, 0x4000, 0x0110, 0x080c, 0x2801, 0x00de, 0x00c6,
+	0x2061, 0x19b6, 0x6034, 0x080c, 0xbdd7, 0x0120, 0x909a, 0x0003,
+	0x1258, 0x0018, 0x909a, 0x00c8, 0x1238, 0x8000, 0x6036, 0x00ce,
+	0x080c, 0x8df9, 0x0804, 0x232c, 0x2061, 0x0100, 0x62c0, 0x080c,
+	0x967c, 0x2019, 0x19c2, 0x2304, 0x9065, 0x0130, 0x6003, 0x0001,
+	0x2009, 0x0027, 0x080c, 0x9b03, 0x00ce, 0x0804, 0x232c, 0xd2bc,
+	0x05e0, 0x080c, 0x8075, 0x2011, 0x0004, 0x080c, 0x282b, 0x00d6,
+	0x2069, 0x0140, 0x6804, 0x9084, 0x4000, 0x0110, 0x080c, 0x2801,
+	0x00de, 0x00c6, 0x2061, 0x19b6, 0x6050, 0x080c, 0xbdd7, 0x0120,
+	0x909a, 0x0003, 0x1638, 0x0018, 0x909a, 0x00c8, 0x1618, 0x8000,
+	0x6052, 0x604c, 0x00ce, 0x9005, 0x0578, 0x2009, 0x07d0, 0x080c,
+	0x806d, 0x9080, 0x0008, 0x2004, 0x9086, 0x0006, 0x1138, 0x2009,
+	0x1984, 0x2011, 0x0012, 0x080c, 0x283a, 0x00f0, 0x2009, 0x1984,
+	0x2011, 0x0016, 0x080c, 0x283a, 0x00b8, 0x2011, 0x0004, 0x080c,
+	0x282b, 0x0090, 0x0036, 0x2019, 0x0001, 0x080c, 0x90f0, 0x003e,
+	0x2019, 0x19c9, 0x2304, 0x9065, 0x0130, 0x2009, 0x004f, 0x6003,
+	0x0003, 0x080c, 0x9b03, 0x00ce, 0x080c, 0x9762, 0x001e, 0xd19c,
+	0x0904, 0x238d, 0x7038, 0xd0ac, 0x1538, 0x0016, 0x0156, 0x2011,
+	0x0008, 0x080c, 0x282b, 0x6050, 0xc0e5, 0x6052, 0x20a9, 0x0367,
+	0x1f04, 0x235a, 0x1d04, 0x2342, 0x080c, 0x809c, 0x6020, 0xd09c,
+	0x1db8, 0x00f6, 0x2079, 0x0100, 0x080c, 0x2768, 0x00fe, 0x1d80,
+	0x6050, 0xc0e4, 0x6052, 0x2011, 0x0008, 0x080c, 0x282b, 0x015e,
+	0x001e, 0x0498, 0x015e, 0x001e, 0x0016, 0x6028, 0xc09c, 0x602a,
+	0x080c, 0x9746, 0x080c, 0x99eb, 0x080c, 0x9762, 0x60e3, 0x0000,
+	0x080c, 0xd427, 0x080c, 0xd442, 0x080c, 0x52a1, 0xd0fc, 0x1138,
+	0x080c, 0xbdd0, 0x1120, 0x9085, 0x0001, 0x080c, 0x6fa3, 0x9006,
+	0x080c, 0x27f1, 0x2009, 0x0002, 0x080c, 0x27dd, 0x00e6, 0x2071,
+	0x1800, 0x7003, 0x0004, 0x080c, 0x0e9c, 0x00ee, 0x2011, 0x0008,
+	0x080c, 0x282b, 0x080c, 0x0bab, 0x001e, 0x918c, 0xffd0, 0x2110,
+	0x080c, 0x282b, 0x00ae, 0x0005, 0x0006, 0x0016, 0x0026, 0x0036,
+	0x00e6, 0x00f6, 0x0126, 0x2091, 0x8000, 0x2071, 0x1800, 0x71cc,
+	0x70ce, 0x9116, 0x0904, 0x23e7, 0x81ff, 0x01a0, 0x2009, 0x0000,
+	0x080c, 0x27dd, 0x2011, 0x8011, 0x2019, 0x010e, 0x231c, 0x939e,
+	0x0007, 0x1118, 0x2019, 0x0001, 0x0010, 0x2019, 0x0000, 0x080c,
+	0x47fb, 0x0468, 0x2001, 0x1977, 0x200c, 0x81ff, 0x1140, 0x2001,
+	0x0109, 0x2004, 0xd0b4, 0x0118, 0x2019, 0x0003, 0x0008, 0x2118,
+	0x2011, 0x8012, 0x080c, 0x47fb, 0x080c, 0x0e9c, 0x080c, 0x52a1,
+	0xd0fc, 0x11a8, 0x080c, 0xbdd0, 0x1190, 0x00c6, 0x080c, 0x2483,
+	0x080c, 0x9746, 0x080c, 0x904b, 0x080c, 0x9762, 0x2061, 0x0100,
+	0x2019, 0x0028, 0x2009, 0x0002, 0x080c, 0x2f80, 0x00ce, 0x012e,
+	0x00fe, 0x00ee, 0x003e, 0x002e, 0x001e, 0x000e, 0x0005, 0x2028,
+	0x918c, 0x00ff, 0x2130, 0x9094, 0xff00, 0x11f0, 0x2011, 0x1836,
+	0x2214, 0xd2ac, 0x11c8, 0x81ff, 0x01e8, 0x2011, 0x181e, 0x2204,
+	0x9106, 0x1190, 0x2011, 0x181f, 0x2214, 0x9294, 0xff00, 0x9584,
+	0xff00, 0x9206, 0x1148, 0x2011, 0x181f, 0x2214, 0x9294, 0x00ff,
+	0x9584, 0x00ff, 0x9206, 0x1120, 0x2500, 0x080c, 0x7bd2, 0x0048,
+	0x9584, 0x00ff, 0x9080, 0x3142, 0x200d, 0x918c, 0xff00, 0x810f,
+	0x9006, 0x0005, 0x9080, 0x3142, 0x200d, 0x918c, 0x00ff, 0x0005,
+	0x00d6, 0x2069, 0x0140, 0x2001, 0x1817, 0x2003, 0x00ef, 0x20a9,
+	0x0010, 0x9006, 0x6852, 0x6856, 0x1f04, 0x2433, 0x00de, 0x0005,
+	0x0006, 0x00d6, 0x0026, 0x2069, 0x0140, 0x2001, 0x1817, 0x2102,
+	0x8114, 0x8214, 0x8214, 0x8214, 0x20a9, 0x0010, 0x6853, 0x0000,
+	0x9006, 0x82ff, 0x1128, 0x9184, 0x000f, 0x9080, 0xd456, 0x2005,
+	0x6856, 0x8211, 0x1f04, 0x2448, 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, 0x2478, 0x680f, 0x0000, 0x000e, 0x001e, 0x002e,
+	0x00de, 0x015e, 0x0005, 0x080c, 0x529d, 0xd0c4, 0x0150, 0xd0a4,
+	0x0140, 0x9006, 0x0046, 0x2020, 0x2009, 0x002e, 0x080c, 0xd0ce,
+	0x004e, 0x0005, 0x00f6, 0x0016, 0x0026, 0x2079, 0x0140, 0x78c4,
+	0xd0dc, 0x0904, 0x24ef, 0x080c, 0x2758, 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, 0x8276,
+	0x928c, 0xff00, 0x0110, 0x2011, 0x00ff, 0x2200, 0x8007, 0x9085,
+	0x004c, 0x78c2, 0x2009, 0x0138, 0x220a, 0x080c, 0x6f5c, 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, 0x0d5e, 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, 0x0d65, 0x0033,
+	0x00ee, 0x002e, 0x001e, 0x000e, 0x015e, 0x0005, 0x254d, 0x256b,
+	0x258f, 0x2591, 0x25ba, 0x25bc, 0x25be, 0x2001, 0x0001, 0x080c,
+	0x2394, 0x080c, 0x27a2, 0x2001, 0x1961, 0x2003, 0x0000, 0x7828,
+	0x9084, 0xe1d7, 0x782a, 0x9006, 0x20a9, 0x0009, 0x080c, 0x2774,
+	0x2001, 0x195f, 0x2003, 0x0006, 0x2009, 0x001e, 0x2011, 0x25bf,
+	0x080c, 0x807a, 0x0005, 0x2009, 0x1964, 0x200b, 0x0000, 0x2001,
+	0x1969, 0x2003, 0x0036, 0x2001, 0x1968, 0x2003, 0x002a, 0x2001,
+	0x1961, 0x2003, 0x0001, 0x9006, 0x080c, 0x271c, 0x2001, 0xffff,
+	0x20a9, 0x0009, 0x080c, 0x2774, 0x2001, 0x195f, 0x2003, 0x0006,
+	0x2009, 0x001e, 0x2011, 0x25bf, 0x080c, 0x807a, 0x0005, 0x080c,
+	0x0d65, 0x2001, 0x1969, 0x2003, 0x0036, 0x2001, 0x1961, 0x2003,
+	0x0003, 0x7a38, 0x9294, 0x0005, 0x9296, 0x0004, 0x0110, 0x9006,
+	0x0010, 0x2001, 0x0001, 0x080c, 0x271c, 0x2001, 0x1965, 0x2003,
+	0x0000, 0x2001, 0xffff, 0x20a9, 0x0009, 0x080c, 0x2774, 0x2001,
+	0x195f, 0x2003, 0x0006, 0x2009, 0x001e, 0x2011, 0x25bf, 0x080c,
+	0x807a, 0x0005, 0x080c, 0x0d65, 0x080c, 0x0d65, 0x0005, 0x0006,
+	0x0016, 0x0026, 0x00e6, 0x00f6, 0x0156, 0x0126, 0x2091, 0x8000,
+	0x2079, 0x0100, 0x2001, 0x1961, 0x2004, 0x908a, 0x0007, 0x1a0c,
+	0x0d65, 0x0043, 0x012e, 0x015e, 0x00fe, 0x00ee, 0x002e, 0x001e,
+	0x000e, 0x0005, 0x25e1, 0x2601, 0x2641, 0x2671, 0x2695, 0x26a5,
+	0x26a7, 0x080c, 0x2768, 0x11b0, 0x7850, 0x9084, 0xefff, 0x7852,
+	0x2009, 0x1967, 0x2104, 0x7a38, 0x9294, 0x0005, 0x9296, 0x0004,
+	0x0110, 0xc08d, 0x0008, 0xc085, 0x200a, 0x2001, 0x195f, 0x2003,
+	0x0001, 0x0030, 0x080c, 0x26cb, 0x2001, 0xffff, 0x080c, 0x255c,
+	0x0005, 0x080c, 0x26a9, 0x05e0, 0x2009, 0x1968, 0x2104, 0x8001,
+	0x200a, 0x080c, 0x2768, 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, 0x26b1, 0x00c0, 0x200b, 0x0000,
+	0x7a38, 0x9294, 0x0006, 0x9296, 0x0004, 0x0110, 0x9006, 0x0010,
+	0x2001, 0x0001, 0x080c, 0x2739, 0x2001, 0x1961, 0x2003, 0x0002,
+	0x0028, 0x2001, 0x195f, 0x2003, 0x0003, 0x0010, 0x080c, 0x257e,
+	0x0005, 0x080c, 0x26a9, 0x0560, 0x2009, 0x1968, 0x2104, 0x8001,
+	0x200a, 0x080c, 0x2768, 0x1168, 0x7850, 0x9084, 0xefff, 0x7852,
+	0x2001, 0x195f, 0x2003, 0x0003, 0x2001, 0x1960, 0x2003, 0x0000,
+	0x00b8, 0x2009, 0x1968, 0x2104, 0x9005, 0x1118, 0x080c, 0x26ee,
+	0x0010, 0x080c, 0x26be, 0x080c, 0x26b1, 0x2009, 0x1964, 0x200b,
+	0x0000, 0x2001, 0x1961, 0x2003, 0x0001, 0x080c, 0x257e, 0x0000,
+	0x0005, 0x04b9, 0x0508, 0x080c, 0x2768, 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, 0x25a9, 0x0005, 0x0099, 0x0168, 0x080c,
+	0x2768, 0x1138, 0x7850, 0x9084, 0xefff, 0x7852, 0x080c, 0x2595,
+	0x0018, 0x0079, 0x080c, 0x25a9, 0x0005, 0x080c, 0x0d65, 0x080c,
+	0x0d65, 0x2009, 0x1969, 0x2104, 0x8001, 0x200a, 0x090c, 0x270a,
+	0x0005, 0x7a38, 0x9294, 0x0005, 0x9296, 0x0005, 0x0110, 0x9006,
+	0x0010, 0x2001, 0x0001, 0x080c, 0x2739, 0x0005, 0x7a38, 0x9294,
+	0x0006, 0x9296, 0x0006, 0x0110, 0x9006, 0x0010, 0x2001, 0x0001,
+	0x080c, 0x271c, 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, 0x2739, 0x0005, 0x0086, 0x2001,
+	0x1967, 0x2004, 0x9084, 0x7fff, 0x090c, 0x0d65, 0x2009, 0x1966,
+	0x2144, 0x8846, 0x280a, 0x9844, 0x0dd8, 0xd08c, 0x1120, 0xd084,
+	0x1120, 0x080c, 0x0d65, 0x9006, 0x0010, 0x2001, 0x0001, 0x00a1,
+	0x008e, 0x0005, 0x0006, 0x0156, 0x2001, 0x195f, 0x20a9, 0x0009,
+	0x2003, 0x0000, 0x8000, 0x1f04, 0x2710, 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, 0x0158, 0x7838,
+	0x9084, 0xfffa, 0x9085, 0x0004, 0x783a, 0x7850, 0x9084, 0xfff0,
+	0x7852, 0x0060, 0x7838, 0x9084, 0xfffb, 0x9085, 0x0005, 0x783a,
+	0x7850, 0x9084, 0xfff0, 0x9085, 0x0000, 0x7852, 0x00fe, 0x0005,
+	0x0006, 0x2001, 0x0100, 0x2004, 0x9082, 0x0007, 0x000e, 0x0005,
+	0x0006, 0x2001, 0x0100, 0x2004, 0x9082, 0x0009, 0x000e, 0x0005,
+	0x0156, 0x20a9, 0x0064, 0x7820, 0x080c, 0x27d7, 0xd09c, 0x1110,
+	0x1f04, 0x276b, 0x015e, 0x0005, 0x0126, 0x0016, 0x0006, 0x2091,
+	0x8000, 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, 0x2794, 0x080c, 0x809c,
+	0x1f04, 0x2794, 0x7850, 0x9085, 0x1000, 0x7852, 0x000e, 0x001e,
+	0x012e, 0x0005, 0x080c, 0x2892, 0x0005, 0x0006, 0x0156, 0x00f6,
+	0x2079, 0x0100, 0x20a9, 0x000a, 0x7854, 0xd0ac, 0x1100, 0x7854,
+	0xd08c, 0x1110, 0x1f04, 0x27af, 0x00fe, 0x015e, 0x000e, 0x0005,
+	0x1d04, 0x27b8, 0x080c, 0x809c, 0x1f04, 0x27b8, 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, 0x0016, 0x0026, 0x080c, 0x6f76, 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,
+	0x1128, 0x080c, 0x6f76, 0x0110, 0xc0bc, 0x0008, 0xc0bd, 0x200a,
+	0x001e, 0x000e, 0x0005, 0x00f6, 0x2079, 0x0380, 0x7843, 0x0101,
+	0x7844, 0xd084, 0x1de8, 0x2001, 0x0109, 0x2202, 0x7843, 0x0100,
+	0x00fe, 0x0005, 0x00f6, 0x2079, 0x0380, 0x7843, 0x0202, 0x7844,
+	0xd08c, 0x1de8, 0x2079, 0x0100, 0x7814, 0x9104, 0x9205, 0x7a16,
+	0x2079, 0x0380, 0x7843, 0x0200, 0x00fe, 0x0005, 0x0016, 0x0026,
+	0x0036, 0x00c6, 0x2061, 0x0100, 0x6050, 0x9084, 0xfbff, 0x9085,
+	0x0040, 0x6052, 0x20a9, 0x0002, 0x080c, 0x27b8, 0x6050, 0x9085,
+	0x0400, 0x9084, 0xff9f, 0x6052, 0x20a9, 0x0005, 0x080c, 0x27b8,
+	0x6054, 0xd0bc, 0x090c, 0x0d65, 0x20a9, 0x0005, 0x080c, 0x27b8,
+	0x6054, 0xd0ac, 0x090c, 0x0d65, 0x2009, 0x197e, 0x9084, 0x7e00,
+	0x8007, 0x8004, 0x8004, 0x200a, 0x9085, 0x0000, 0x605a, 0x2009,
+	0x196c, 0x2011, 0x196d, 0x6358, 0x939c, 0x38df, 0x2320, 0x939d,
+	0x0000, 0x94a5, 0x0000, 0x230a, 0x2412, 0x00ce, 0x003e, 0x002e,
+	0x001e, 0x0005, 0x0006, 0x00c6, 0x2061, 0x0100, 0x6050, 0xc0cd,
+	0x6052, 0x00ce, 0x000e, 0x0005, 0x2d98, 0x2d98, 0x299c, 0x299c,
+	0x29a8, 0x29a8, 0x29b4, 0x29b4, 0x29c2, 0x29c2, 0x29ce, 0x29ce,
+	0x29dc, 0x29dc, 0x29ea, 0x29ea, 0x29fc, 0x29fc, 0x2a08, 0x2a08,
+	0x2a16, 0x2a16, 0x2a34, 0x2a34, 0x2a54, 0x2a54, 0x2a24, 0x2a24,
+	0x2a44, 0x2a44, 0x2a62, 0x2a62, 0x29fa, 0x29fa, 0x29fa, 0x29fa,
+	0x29fa, 0x29fa, 0x29fa, 0x29fa, 0x29fa, 0x29fa, 0x29fa, 0x29fa,
+	0x29fa, 0x29fa, 0x29fa, 0x29fa, 0x29fa, 0x29fa, 0x29fa, 0x29fa,
+	0x29fa, 0x29fa, 0x29fa, 0x29fa, 0x29fa, 0x29fa, 0x29fa, 0x29fa,
+	0x29fa, 0x29fa, 0x29fa, 0x29fa, 0x2a74, 0x2a74, 0x2a80, 0x2a80,
+	0x2a8e, 0x2a8e, 0x2a9c, 0x2a9c, 0x2aac, 0x2aac, 0x2aba, 0x2aba,
+	0x2aca, 0x2aca, 0x2ada, 0x2ada, 0x2aec, 0x2aec, 0x2afa, 0x2afa,
+	0x2b0a, 0x2b0a, 0x2b2c, 0x2b2c, 0x2b50, 0x2b50, 0x2b1a, 0x2b1a,
+	0x2b3e, 0x2b3e, 0x2b60, 0x2b60, 0x29fa, 0x29fa, 0x29fa, 0x29fa,
+	0x29fa, 0x29fa, 0x29fa, 0x29fa, 0x29fa, 0x29fa, 0x29fa, 0x29fa,
+	0x29fa, 0x29fa, 0x29fa, 0x29fa, 0x29fa, 0x29fa, 0x29fa, 0x29fa,
+	0x29fa, 0x29fa, 0x29fa, 0x29fa, 0x29fa, 0x29fa, 0x29fa, 0x29fa,
+	0x29fa, 0x29fa, 0x29fa, 0x29fa, 0x2b74, 0x2b74, 0x2b80, 0x2b80,
+	0x2b8e, 0x2b8e, 0x2b9c, 0x2b9c, 0x2bac, 0x2bac, 0x2bba, 0x2bba,
+	0x2bca, 0x2bca, 0x2bda, 0x2bda, 0x2bec, 0x2bec, 0x2bfa, 0x2bfa,
+	0x2c0a, 0x2c0a, 0x2c1a, 0x2c1a, 0x2c2c, 0x2c2c, 0x2c3c, 0x2c3c,
+	0x2c4e, 0x2c4e, 0x2c60, 0x2c60, 0x29fa, 0x29fa, 0x29fa, 0x29fa,
+	0x29fa, 0x29fa, 0x29fa, 0x29fa, 0x29fa, 0x29fa, 0x29fa, 0x29fa,
+	0x29fa, 0x29fa, 0x29fa, 0x29fa, 0x29fa, 0x29fa, 0x29fa, 0x29fa,
+	0x29fa, 0x29fa, 0x29fa, 0x29fa, 0x29fa, 0x29fa, 0x29fa, 0x29fa,
+	0x29fa, 0x29fa, 0x29fa, 0x29fa, 0x2c74, 0x2c74, 0x2c82, 0x2c82,
+	0x2c92, 0x2c92, 0x2ca2, 0x2ca2, 0x2cb4, 0x2cb4, 0x2cc4, 0x2cc4,
+	0x2cd6, 0x2cd6, 0x2ce8, 0x2ce8, 0x2cfc, 0x2cfc, 0x2d0c, 0x2d0c,
+	0x2d1e, 0x2d1e, 0x2d30, 0x2d30, 0x2d44, 0x2d44, 0x2d55, 0x2d55,
+	0x2d68, 0x2d68, 0x2d7b, 0x2d7b, 0x29fa, 0x29fa, 0x29fa, 0x29fa,
+	0x29fa, 0x29fa, 0x29fa, 0x29fa, 0x29fa, 0x29fa, 0x29fa, 0x29fa,
+	0x29fa, 0x29fa, 0x29fa, 0x29fa, 0x29fa, 0x29fa, 0x29fa, 0x29fa,
+	0x29fa, 0x29fa, 0x29fa, 0x29fa, 0x29fa, 0x29fa, 0x29fa, 0x29fa,
+	0x29fa, 0x29fa, 0x29fa, 0x29fa, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x20b1, 0x0804, 0x2d90,
+	0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156,
+	0x080c, 0x1eeb, 0x0804, 0x2d90, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x1eeb, 0x080c, 0x20b1,
+	0x0804, 0x2d90, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
+	0x0146, 0x0156, 0x080c, 0x1f15, 0x0804, 0x2d90, 0x0106, 0x0006,
+	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x20b1,
+	0x080c, 0x1f15, 0x0804, 0x2d90, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x1eeb, 0x080c, 0x1f15,
+	0x0804, 0x2d90, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
+	0x0146, 0x0156, 0x080c, 0x1eeb, 0x080c, 0x20b1, 0x080c, 0x1f15,
+	0x0804, 0x2d90, 0xa001, 0x0cf0, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x1321, 0x0804, 0x2d90,
+	0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156,
+	0x080c, 0x20b1, 0x080c, 0x1321, 0x0804, 0x2d90, 0x0106, 0x0006,
+	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x1eeb,
+	0x080c, 0x1321, 0x0804, 0x2d90, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x20b1, 0x080c, 0x1321,
+	0x080c, 0x1f15, 0x0804, 0x2d90, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x1eeb, 0x080c, 0x20b1,
+	0x080c, 0x1321, 0x0804, 0x2d90, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x1eeb, 0x080c, 0x1321,
+	0x080c, 0x1f15, 0x0804, 0x2d90, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x1321, 0x080c, 0x1f15,
+	0x0804, 0x2d90, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
+	0x0146, 0x0156, 0x080c, 0x1eeb, 0x080c, 0x20b1, 0x080c, 0x1321,
+	0x080c, 0x1f15, 0x0804, 0x2d90, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x24f2, 0x0804, 0x2d90,
+	0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156,
+	0x080c, 0x24f2, 0x080c, 0x20b1, 0x0804, 0x2d90, 0x0106, 0x0006,
+	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x24f2,
+	0x080c, 0x1eeb, 0x0804, 0x2d90, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x24f2, 0x080c, 0x1eeb,
+	0x080c, 0x20b1, 0x0804, 0x2d90, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x24f2, 0x080c, 0x1f15,
+	0x0804, 0x2d90, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
+	0x0146, 0x0156, 0x080c, 0x24f2, 0x080c, 0x20b1, 0x080c, 0x1f15,
+	0x0804, 0x2d90, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
+	0x0146, 0x0156, 0x080c, 0x24f2, 0x080c, 0x1eeb, 0x080c, 0x1f15,
+	0x0804, 0x2d90, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
+	0x0146, 0x0156, 0x080c, 0x24f2, 0x080c, 0x1eeb, 0x080c, 0x20b1,
+	0x080c, 0x1f15, 0x0804, 0x2d90, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x24f2, 0x080c, 0x1321,
+	0x0804, 0x2d90, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
+	0x0146, 0x0156, 0x080c, 0x24f2, 0x080c, 0x20b1, 0x080c, 0x1321,
+	0x0804, 0x2d90, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
+	0x0146, 0x0156, 0x080c, 0x24f2, 0x080c, 0x1eeb, 0x080c, 0x1321,
+	0x0804, 0x2d90, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
+	0x0146, 0x0156, 0x080c, 0x24f2, 0x080c, 0x20b1, 0x080c, 0x1321,
+	0x080c, 0x1f15, 0x0804, 0x2d90, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x24f2, 0x080c, 0x1eeb,
+	0x080c, 0x20b1, 0x080c, 0x1321, 0x0804, 0x2d90, 0x0106, 0x0006,
+	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x24f2,
+	0x080c, 0x1eeb, 0x080c, 0x1321, 0x080c, 0x1f15, 0x0804, 0x2d90,
+	0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156,
+	0x080c, 0x24f2, 0x080c, 0x1321, 0x080c, 0x1f15, 0x0804, 0x2d90,
+	0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156,
+	0x080c, 0x24f2, 0x080c, 0x1eeb, 0x080c, 0x20b1, 0x080c, 0x1321,
+	0x080c, 0x1f15, 0x0804, 0x2d90, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x97ac, 0x0804, 0x2d90,
+	0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156,
+	0x080c, 0x97ac, 0x080c, 0x20b1, 0x0804, 0x2d90, 0x0106, 0x0006,
+	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x1eeb,
+	0x080c, 0x97ac, 0x0804, 0x2d90, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x1eeb, 0x080c, 0x97ac,
+	0x080c, 0x20b1, 0x0804, 0x2d90, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x97ac, 0x080c, 0x1f15,
+	0x0804, 0x2d90, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
+	0x0146, 0x0156, 0x080c, 0x97ac, 0x080c, 0x20b1, 0x080c, 0x1f15,
+	0x0804, 0x2d90, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
+	0x0146, 0x0156, 0x080c, 0x1eeb, 0x080c, 0x97ac, 0x080c, 0x1f15,
+	0x0804, 0x2d90, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
+	0x0146, 0x0156, 0x080c, 0x1eeb, 0x080c, 0x97ac, 0x080c, 0x20b1,
+	0x080c, 0x1f15, 0x0804, 0x2d90, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x97ac, 0x080c, 0x1321,
+	0x0804, 0x2d90, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
+	0x0146, 0x0156, 0x080c, 0x97ac, 0x080c, 0x20b1, 0x080c, 0x1321,
+	0x0804, 0x2d90, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
+	0x0146, 0x0156, 0x080c, 0x1eeb, 0x080c, 0x97ac, 0x080c, 0x1321,
+	0x0804, 0x2d90, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
+	0x0146, 0x0156, 0x080c, 0x1eeb, 0x080c, 0x97ac, 0x080c, 0x20b1,
+	0x080c, 0x1321, 0x0804, 0x2d90, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x97ac, 0x080c, 0x1321,
+	0x080c, 0x1f15, 0x0804, 0x2d90, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x97ac, 0x080c, 0x20b1,
+	0x080c, 0x1321, 0x080c, 0x1f15, 0x0804, 0x2d90, 0x0106, 0x0006,
+	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x1eeb,
+	0x080c, 0x97ac, 0x080c, 0x1321, 0x080c, 0x1f15, 0x0804, 0x2d90,
+	0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156,
+	0x080c, 0x1eeb, 0x080c, 0x97ac, 0x080c, 0x20b1, 0x080c, 0x1321,
+	0x080c, 0x1f15, 0x0804, 0x2d90, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x24f2, 0x080c, 0x97ac,
+	0x0804, 0x2d90, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
+	0x0146, 0x0156, 0x080c, 0x24f2, 0x080c, 0x97ac, 0x080c, 0x20b1,
+	0x0804, 0x2d90, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
+	0x0146, 0x0156, 0x080c, 0x24f2, 0x080c, 0x1eeb, 0x080c, 0x97ac,
+	0x0804, 0x2d90, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
+	0x0146, 0x0156, 0x080c, 0x24f2, 0x080c, 0x1eeb, 0x080c, 0x97ac,
+	0x080c, 0x20b1, 0x0804, 0x2d90, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x24f2, 0x080c, 0x97ac,
+	0x080c, 0x1f15, 0x0804, 0x2d90, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x24f2, 0x080c, 0x97ac,
+	0x080c, 0x20b1, 0x080c, 0x1f15, 0x0804, 0x2d90, 0x0106, 0x0006,
+	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x24f2,
+	0x080c, 0x1eeb, 0x080c, 0x97ac, 0x080c, 0x1f15, 0x0804, 0x2d90,
+	0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156,
+	0x080c, 0x24f2, 0x080c, 0x1eeb, 0x080c, 0x97ac, 0x080c, 0x20b1,
+	0x080c, 0x1f15, 0x0804, 0x2d90, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x24f2, 0x080c, 0x97ac,
+	0x080c, 0x1321, 0x0804, 0x2d90, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x24f2, 0x080c, 0x97ac,
+	0x080c, 0x20b1, 0x080c, 0x1321, 0x0804, 0x2d90, 0x0106, 0x0006,
+	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x24f2,
+	0x080c, 0x1eeb, 0x080c, 0x97ac, 0x080c, 0x1321, 0x0804, 0x2d90,
+	0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156,
+	0x080c, 0x24f2, 0x080c, 0x1eeb, 0x080c, 0x97ac, 0x080c, 0x20b1,
+	0x080c, 0x1321, 0x0804, 0x2d90, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x24f2, 0x080c, 0x97ac,
+	0x080c, 0x1321, 0x080c, 0x1f15, 0x04d8, 0x0106, 0x0006, 0x0126,
+	0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x24f2, 0x080c,
+	0x97ac, 0x080c, 0x20b1, 0x080c, 0x1321, 0x080c, 0x1f15, 0x0440,
+	0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156,
+	0x080c, 0x24f2, 0x080c, 0x1eeb, 0x080c, 0x1321, 0x080c, 0x97ac,
+	0x080c, 0x1f15, 0x00a8, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
+	0x0136, 0x0146, 0x0156, 0x080c, 0x24f2, 0x080c, 0x1eeb, 0x080c,
+	0x97ac, 0x080c, 0x20b1, 0x080c, 0x1321, 0x080c, 0x1f15, 0x0000,
+	0x015e, 0x014e, 0x013e, 0x01de, 0x01ce, 0x012e, 0x000e, 0x010e,
+	0x000d, 0x00b6, 0x00c6, 0x0026, 0x0046, 0x9026, 0x080c, 0x651b,
+	0x1904, 0x2e9c, 0x72d8, 0x2001, 0x194d, 0x2004, 0x9005, 0x1110,
+	0xd29c, 0x0148, 0xd284, 0x1138, 0xd2bc, 0x1904, 0x2e9c, 0x080c,
+	0x2ea1, 0x0804, 0x2e9c, 0xd2cc, 0x1904, 0x2e9c, 0x080c, 0x6f5c,
+	0x1120, 0x70ab, 0xffff, 0x0804, 0x2e9c, 0xd294, 0x0120, 0x70ab,
+	0xffff, 0x0804, 0x2e9c, 0x080c, 0x3138, 0x0160, 0x080c, 0xbdd7,
+	0x0128, 0x2001, 0x1817, 0x203c, 0x0804, 0x2e2e, 0x70ab, 0xffff,
+	0x0804, 0x2e9c, 0x2001, 0x1817, 0x203c, 0x7290, 0xd284, 0x0904,
+	0x2e2e, 0xd28c, 0x1904, 0x2e2e, 0x0036, 0x73a8, 0x938e, 0xffff,
+	0x1110, 0x2019, 0x0001, 0x8314, 0x92e0, 0x1d80, 0x2c04, 0x938c,
+	0x0001, 0x0120, 0x9084, 0xff00, 0x8007, 0x0010, 0x9084, 0x00ff,
+	0x970e, 0x0590, 0x908e, 0x0000, 0x0578, 0x908e, 0x00ff, 0x1150,
+	0x7230, 0xd284, 0x1570, 0x7290, 0xc28d, 0x7292, 0x70ab, 0xffff,
+	0x003e, 0x0460, 0x0026, 0x2011, 0x0010, 0x080c, 0x6581, 0x002e,
+	0x0118, 0x70ab, 0xffff, 0x00f8, 0x900e, 0x080c, 0x23ef, 0x080c,
+	0x6106, 0x11a8, 0x080c, 0x655d, 0x1150, 0x7030, 0xd08c, 0x0118,
+	0xb800, 0xd0bc, 0x0120, 0x080c, 0x2eba, 0x0148, 0x0028, 0x080c,
+	0x300e, 0x080c, 0x2ee6, 0x0118, 0x8318, 0x0804, 0x2de3, 0x73aa,
+	0x0010, 0x70ab, 0xffff, 0x003e, 0x0804, 0x2e9c, 0x9780, 0x3142,
+	0x203d, 0x97bc, 0xff00, 0x873f, 0x2041, 0x007e, 0x70a8, 0x9096,
+	0xffff, 0x1118, 0x900e, 0x28a8, 0x0050, 0x9812, 0x0220, 0x2008,
+	0x9802, 0x20a8, 0x0020, 0x70ab, 0xffff, 0x0804, 0x2e9c, 0x2700,
+	0x0156, 0x0016, 0x9106, 0x0904, 0x2e91, 0x0026, 0x2011, 0x0010,
+	0x080c, 0x6581, 0x002e, 0x0120, 0x2009, 0xffff, 0x0804, 0x2e99,
+	0xc484, 0x080c, 0x6166, 0x0138, 0x080c, 0xbdd7, 0x1590, 0x080c,
+	0x6106, 0x15b8, 0x0008, 0xc485, 0x080c, 0x655d, 0x1130, 0x7030,
+	0xd08c, 0x01f8, 0xb800, 0xd0bc, 0x11e0, 0x7290, 0xd28c, 0x0180,
+	0x080c, 0x655d, 0x9082, 0x0006, 0x02e0, 0xd484, 0x1118, 0x080c,
+	0x612a, 0x0028, 0x080c, 0x30a6, 0x01a0, 0x080c, 0x30d1, 0x0088,
+	0x080c, 0x300e, 0x080c, 0xbdd7, 0x1160, 0x080c, 0x2ee6, 0x0188,
+	0x0040, 0x080c, 0xbdd7, 0x1118, 0x080c, 0x30a6, 0x0110, 0x0451,
+	0x0140, 0x001e, 0x8108, 0x015e, 0x1f04, 0x2e47, 0x70ab, 0xffff,
+	0x0018, 0x001e, 0x015e, 0x71aa, 0x004e, 0x002e, 0x00ce, 0x00be,
+	0x0005, 0x00c6, 0x0016, 0x70ab, 0x0001, 0x2009, 0x007e, 0x080c,
+	0x6106, 0x1168, 0xb813, 0x00ff, 0xb817, 0xfffe, 0x080c, 0x300e,
+	0x04a9, 0x0128, 0x70d8, 0xc0bd, 0x70da, 0x080c, 0xbb25, 0x001e,
+	0x00ce, 0x0005, 0x0016, 0x0076, 0x00d6, 0x00c6, 0x2001, 0x1858,
+	0x2004, 0x9084, 0x00ff, 0xb842, 0x080c, 0x9ad6, 0x01d0, 0x2b00,
+	0x6012, 0x080c, 0xbb52, 0x6023, 0x0001, 0x9006, 0x080c, 0x60a3,
+	0x2001, 0x0000, 0x080c, 0x60b7, 0x0126, 0x2091, 0x8000, 0x70a4,
+	0x8000, 0x70a6, 0x012e, 0x2009, 0x0004, 0x080c, 0x9b03, 0x9085,
+	0x0001, 0x00ce, 0x00de, 0x007e, 0x001e, 0x0005, 0x0016, 0x0076,
+	0x00d6, 0x00c6, 0x2001, 0x1858, 0x2004, 0x9084, 0x00ff, 0xb842,
+	0x080c, 0x9ad6, 0x0548, 0x2b00, 0x6012, 0xb800, 0xc0c4, 0xb802,
+	0xb8a0, 0x9086, 0x007e, 0x0140, 0xb804, 0x9084, 0x00ff, 0x9086,
+	0x0006, 0x1110, 0x080c, 0x2fc1, 0x080c, 0xbb52, 0x6023, 0x0001,
+	0x9006, 0x080c, 0x60a3, 0x2001, 0x0002, 0x080c, 0x60b7, 0x0126,
+	0x2091, 0x8000, 0x70a4, 0x8000, 0x70a6, 0x012e, 0x2009, 0x0002,
+	0x080c, 0x9b03, 0x9085, 0x0001, 0x00ce, 0x00de, 0x007e, 0x001e,
+	0x0005, 0x00b6, 0x00c6, 0x0026, 0x2009, 0x0080, 0x080c, 0x6106,
+	0x1140, 0xb813, 0x00ff, 0xb817, 0xfffc, 0x0039, 0x0110, 0x70df,
+	0xffff, 0x002e, 0x00ce, 0x00be, 0x0005, 0x0016, 0x0076, 0x00d6,
+	0x00c6, 0x080c, 0x9a0f, 0x01d0, 0x2b00, 0x6012, 0x080c, 0xbb52,
+	0x6023, 0x0001, 0x9006, 0x080c, 0x60a3, 0x2001, 0x0002, 0x080c,
+	0x60b7, 0x0126, 0x2091, 0x8000, 0x70e0, 0x8000, 0x70e2, 0x012e,
+	0x2009, 0x0002, 0x080c, 0x9b03, 0x9085, 0x0001, 0x00ce, 0x00de,
+	0x007e, 0x001e, 0x0005, 0x00c6, 0x00d6, 0x0126, 0x2091, 0x8000,
+	0x2009, 0x007f, 0x080c, 0x6106, 0x11b8, 0xb813, 0x00ff, 0xb817,
+	0xfffd, 0xb8c7, 0x0004, 0x080c, 0x9a0f, 0x0170, 0x2b00, 0x6012,
+	0x6316, 0x6023, 0x0001, 0x620a, 0x080c, 0xbb52, 0x2009, 0x0022,
+	0x080c, 0x9b03, 0x9085, 0x0001, 0x012e, 0x00de, 0x00ce, 0x0005,
+	0x00e6, 0x00c6, 0x0066, 0x0036, 0x0026, 0x00b6, 0x21f0, 0x9036,
+	0x080c, 0x9746, 0x1110, 0x2031, 0x0001, 0x0066, 0x080c, 0x84a3,
+	0x080c, 0x8423, 0x080c, 0x969c, 0x080c, 0xa9c4, 0x006e, 0x86ff,
+	0x0110, 0x080c, 0x9762, 0x3e08, 0x2130, 0x81ff, 0x0120, 0x20a9,
+	0x007e, 0x900e, 0x0018, 0x20a9, 0x007f, 0x900e, 0x0016, 0x080c,
+	0x6166, 0x1140, 0x9686, 0x0002, 0x1118, 0xb800, 0xd0bc, 0x1110,
+	0x080c, 0x5bfc, 0x001e, 0x8108, 0x1f04, 0x2fa6, 0x9686, 0x0001,
+	0x190c, 0x310c, 0x00be, 0x002e, 0x003e, 0x006e, 0x00ce, 0x00ee,
+	0x0005, 0x00e6, 0x00c6, 0x0036, 0x0026, 0x0016, 0x00b6, 0x9016,
+	0x080c, 0x9746, 0x1110, 0x2011, 0x0001, 0x0026, 0x6210, 0x2258,
+	0xbaa0, 0x0026, 0x2019, 0x0029, 0x080c, 0x8498, 0x0076, 0x2039,
+	0x0000, 0x080c, 0x8387, 0x2c08, 0x080c, 0xce23, 0x007e, 0x001e,
+	0x002e, 0x82ff, 0x0110, 0x080c, 0x9762, 0xba10, 0xbb14, 0x080c,
+	0x5bfc, 0xba12, 0xbb16, 0x00be, 0x001e, 0x002e, 0x003e, 0x00ce,
+	0x00ee, 0x0005, 0x00e6, 0x0006, 0x00b6, 0x6010, 0x2058, 0xb8a0,
+	0x00be, 0x9086, 0x0080, 0x0150, 0x2071, 0x1800, 0x70a4, 0x9005,
+	0x0110, 0x8001, 0x70a6, 0x000e, 0x00ee, 0x0005, 0x2071, 0x1800,
+	0x70e0, 0x9005, 0x0dc0, 0x8001, 0x70e2, 0x0ca8, 0xb800, 0xc08c,
+	0xb802, 0x0005, 0x00f6, 0x00e6, 0x00c6, 0x00b6, 0x0036, 0x0026,
+	0x0016, 0x0156, 0x2178, 0x9016, 0x080c, 0x9746, 0x1110, 0x2011,
+	0x0001, 0x0026, 0x81ff, 0x1118, 0x20a9, 0x0001, 0x0080, 0x080c,
+	0x529d, 0xd0c4, 0x0148, 0x0040, 0x9006, 0x0046, 0x2020, 0x2009,
+	0x002d, 0x080c, 0xd0ce, 0x004e, 0x20a9, 0x0800, 0x9016, 0x0026,
+	0x928e, 0x007e, 0x0904, 0x3081, 0x928e, 0x007f, 0x0904, 0x3081,
+	0x928e, 0x0080, 0x05f0, 0x9288, 0x1000, 0x210c, 0x81ff, 0x05c8,
+	0x8fff, 0x1150, 0x2001, 0x195d, 0x0006, 0x2003, 0x0001, 0x080c,
+	0x3093, 0x000e, 0x2003, 0x0000, 0x00b6, 0x00c6, 0x2158, 0x2001,
+	0x0001, 0x080c, 0x6527, 0x00ce, 0x00be, 0x2019, 0x0029, 0x080c,
+	0x8498, 0x0076, 0x2039, 0x0000, 0x080c, 0x8387, 0x00b6, 0x00c6,
+	0x0026, 0x2158, 0xba04, 0x9294, 0x00ff, 0x9286, 0x0006, 0x1118,
+	0xb807, 0x0404, 0x0028, 0x2001, 0x0004, 0x8007, 0x9215, 0xba06,
+	0x002e, 0x00ce, 0x00be, 0x0016, 0x2c08, 0x080c, 0xce23, 0x001e,
+	0x007e, 0x002e, 0x8210, 0x1f04, 0x3037, 0x002e, 0x82ff, 0x0110,
+	0x080c, 0x9762, 0x015e, 0x001e, 0x002e, 0x003e, 0x00be, 0x00ce,
+	0x00ee, 0x00fe, 0x0005, 0x0046, 0x0026, 0x0016, 0x080c, 0x529d,
+	0xd0c4, 0x0140, 0xd0a4, 0x0130, 0x9006, 0x2220, 0x2009, 0x0029,
+	0x080c, 0xd0ce, 0x001e, 0x002e, 0x004e, 0x0005, 0x0016, 0x0026,
+	0x0036, 0x00c6, 0x7290, 0x82ff, 0x01e8, 0x080c, 0x6555, 0x11d0,
+	0x2100, 0x080c, 0x2422, 0x81ff, 0x01b8, 0x2019, 0x0001, 0x8314,
+	0x92e0, 0x1d80, 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, 0x0066, 0x9036,
+	0x080c, 0x9746, 0x1110, 0x2031, 0x0001, 0x0066, 0x0036, 0x2019,
+	0x0029, 0x00d9, 0x003e, 0x006e, 0x86ff, 0x0110, 0x080c, 0x9762,
+	0x006e, 0x9180, 0x1000, 0x2004, 0x9065, 0x0158, 0x0016, 0x00c6,
+	0x2061, 0x1b00, 0x001e, 0x6112, 0x080c, 0x2fc1, 0x001e, 0x080c,
+	0x612a, 0x012e, 0x00ce, 0x001e, 0x0005, 0x0016, 0x0026, 0x2110,
+	0x080c, 0x9372, 0x080c, 0xd37f, 0x002e, 0x001e, 0x0005, 0x2001,
+	0x1836, 0x2004, 0xd0cc, 0x0005, 0x00c6, 0x00b6, 0x080c, 0x6f5c,
+	0x1118, 0x20a9, 0x0800, 0x0010, 0x20a9, 0x0782, 0x080c, 0x6f5c,
+	0x1110, 0x900e, 0x0010, 0x2009, 0x007e, 0x9180, 0x1000, 0x2004,
+	0x905d, 0x0130, 0x86ff, 0x0110, 0xb800, 0xd0bc, 0x090c, 0x612a,
+	0x8108, 0x1f04, 0x311d, 0x2061, 0x1800, 0x607b, 0x0000, 0x607c,
+	0x9084, 0x00ff, 0x607e, 0x60af, 0x0000, 0x00be, 0x00ce, 0x0005,
+	0x2001, 0x1875, 0x2004, 0xd0bc, 0x0005, 0x2011, 0x1854, 0x2214,
+	0xd2ec, 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, 0x103c, 0x090c, 0x0d65,
+	0x2900, 0x706a, 0xa867, 0x0002, 0xa8ab, 0xdcb0, 0x080c, 0x103c,
+	0x090c, 0x0d65, 0x2900, 0x706e, 0xa867, 0x0002, 0xa8ab, 0xdcb0,
+	0x0005, 0x2071, 0x1894, 0x7004, 0x0002, 0x3271, 0x3272, 0x3285,
+	0x3299, 0x0005, 0x1004, 0x3282, 0x0e04, 0x3282, 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, 0x336d, 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, 0x61cc, 0x0042, 0x2100,
+	0x908a, 0x003f, 0x1a04, 0x336a, 0x61cc, 0x0804, 0x32ff, 0x3341,
+	0x3379, 0x3383, 0x3387, 0x3391, 0x3397, 0x339b, 0x33ab, 0x33ae,
+	0x33b8, 0x33bd, 0x33c2, 0x33cd, 0x33d8, 0x33e7, 0x33f6, 0x3404,
+	0x341b, 0x3436, 0x336a, 0x34df, 0x351d, 0x35c2, 0x35d3, 0x35f6,
+	0x336a, 0x336a, 0x336a, 0x362e, 0x364e, 0x3657, 0x3683, 0x3689,
+	0x336a, 0x36cf, 0x336a, 0x336a, 0x336a, 0x336a, 0x336a, 0x36da,
+	0x36e3, 0x36eb, 0x36ed, 0x336a, 0x336a, 0x336a, 0x336a, 0x336a,
+	0x336a, 0x371d, 0x336a, 0x336a, 0x336a, 0x336a, 0x336a, 0x373a,
+	0x3795, 0x336a, 0x336a, 0x336a, 0x336a, 0x336a, 0x336a, 0x0002,
+	0x37bf, 0x37c2, 0x3821, 0x383a, 0x386a, 0x3b0c, 0x336a, 0x4e6e,
+	0x336a, 0x336a, 0x336a, 0x336a, 0x336a, 0x336a, 0x336a, 0x336a,
+	0x33b8, 0x33bd, 0x400b, 0x52c1, 0x4021, 0x4efd, 0x4f4e, 0x5051,
+	0x336a, 0x50b3, 0x50ef, 0x5120, 0x522c, 0x514d, 0x51ac, 0x336a,
+	0x4025, 0x41b5, 0x41cb, 0x41f0, 0x4255, 0x42c9, 0x42e9, 0x4360,
+	0x4371, 0x4389, 0x438c, 0x43b1, 0x4424, 0x448e, 0x4496, 0x45c8,
+	0x4725, 0x4759, 0x49a3, 0x336a, 0x49c1, 0x4a80, 0x4b56, 0x336a,
+	0x336a, 0x336a, 0x336a, 0x4bbc, 0x4bd7, 0x4496, 0x4e1d, 0x714c,
+	0x0000, 0x2021, 0x4000, 0x080c, 0x47d7, 0x0126, 0x2091, 0x8000,
+	0x0e04, 0x334b, 0x0010, 0x012e, 0x0cc0, 0x7c36, 0x9486, 0x4000,
+	0x0118, 0x7833, 0x0011, 0x0010, 0x7833, 0x0010, 0x7c82, 0x7986,
+	0x7a8a, 0x7b8e, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084,
+	0x190c, 0x11b5, 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, 0x47e4, 0x7883, 0x0004, 0x7884, 0x0807, 0x2039,
+	0x0001, 0x902e, 0x2520, 0x7b88, 0x7a8c, 0x7884, 0x7990, 0x0804,
+	0x47e7, 0x7984, 0x7888, 0x2114, 0x200a, 0x0804, 0x3341, 0x7984,
+	0x2114, 0x0804, 0x3341, 0x20e1, 0x0000, 0x2099, 0x0021, 0x20e9,
+	0x0000, 0x20a1, 0x0021, 0x20a9, 0x001f, 0x4003, 0x7984, 0x7a88,
+	0x7b8c, 0x0804, 0x3341, 0x7884, 0x2060, 0x04d8, 0x2009, 0x0003,
+	0x2011, 0x0002, 0x2019, 0x0015, 0x789b, 0x0317, 0x0804, 0x3341,
+	0x2039, 0x0001, 0x7d98, 0x7c9c, 0x0800, 0x2039, 0x0001, 0x7d98,
+	0x7c9c, 0x0848, 0x79a0, 0x9182, 0x0040, 0x0210, 0x0804, 0x3376,
+	0x2138, 0x7d98, 0x7c9c, 0x0804, 0x337d, 0x79a0, 0x9182, 0x0040,
+	0x0210, 0x0804, 0x3376, 0x2138, 0x7d98, 0x7c9c, 0x0804, 0x338b,
+	0x79a0, 0x9182, 0x0040, 0x0210, 0x0804, 0x3376, 0x21e8, 0x7984,
+	0x7888, 0x20a9, 0x0001, 0x21a0, 0x4004, 0x0804, 0x3341, 0x2061,
+	0x0800, 0xe10c, 0x9006, 0x2c15, 0x9200, 0x8c60, 0x8109, 0x1dd8,
+	0x2010, 0x9005, 0x0904, 0x3341, 0x0804, 0x3370, 0x79a0, 0x9182,
+	0x0040, 0x0210, 0x0804, 0x3376, 0x21e0, 0x20a9, 0x0001, 0x7984,
+	0x2198, 0x4012, 0x0804, 0x3341, 0x2069, 0x1853, 0x7884, 0x7990,
+	0x911a, 0x1a04, 0x3376, 0x8019, 0x0904, 0x3376, 0x684a, 0x6942,
+	0x788c, 0x6852, 0x7888, 0x6856, 0x9006, 0x685a, 0x685e, 0x080c,
+	0x728d, 0x0804, 0x3341, 0x2069, 0x1853, 0x7884, 0x7994, 0x911a,
+	0x1a04, 0x3376, 0x8019, 0x0904, 0x3376, 0x684e, 0x6946, 0x788c,
+	0x6862, 0x7888, 0x6866, 0x9006, 0x686a, 0x686e, 0x0126, 0x2091,
+	0x8000, 0x080c, 0x6612, 0x012e, 0x0804, 0x3341, 0x902e, 0x2520,
+	0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x3373, 0x7984, 0x7b88,
+	0x7a8c, 0x20a9, 0x0005, 0x20e9, 0x0001, 0x20a1, 0x189c, 0x4101,
+	0x080c, 0x479b, 0x1120, 0x2009, 0x0002, 0x0804, 0x3373, 0x2009,
+	0x0020, 0xa85c, 0x9080, 0x0019, 0xaf60, 0x080c, 0x47e4, 0x701f,
+	0x345a, 0x0005, 0xa864, 0x2008, 0x9084, 0x00ff, 0x9096, 0x0011,
+	0x0168, 0x9096, 0x0019, 0x0150, 0x9096, 0x0015, 0x0138, 0x9096,
+	0x0048, 0x0120, 0x9096, 0x0029, 0x1904, 0x3373, 0x810f, 0x918c,
+	0x00ff, 0x0904, 0x3373, 0x7112, 0x7010, 0x8001, 0x0560, 0x7012,
+	0x080c, 0x479b, 0x1120, 0x2009, 0x0002, 0x0804, 0x3373, 0x2009,
+	0x0020, 0x7068, 0x2040, 0xa28c, 0xa390, 0xa494, 0xa598, 0x9290,
+	0x0040, 0x9399, 0x0000, 0x94a1, 0x0000, 0x95a9, 0x0000, 0xa85c,
+	0x9080, 0x0019, 0xaf60, 0x080c, 0x47e4, 0x701f, 0x3498, 0x0005,
+	0xa864, 0x9084, 0x00ff, 0x9096, 0x0002, 0x0120, 0x9096, 0x000a,
+	0x1904, 0x3373, 0x0888, 0x7014, 0x2048, 0xa868, 0xc0fd, 0xa86a,
+	0xa864, 0x9084, 0x00ff, 0x9096, 0x0029, 0x1160, 0xc2fd, 0xaa7a,
+	0x080c, 0x5cea, 0x0150, 0x0126, 0x2091, 0x8000, 0xa87a, 0xa982,
+	0x012e, 0x0050, 0x080c, 0x5ff1, 0x1128, 0x7007, 0x0003, 0x701f,
+	0x34c4, 0x0005, 0x080c, 0x6a5c, 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, 0x47e7, 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, 0x19f1, 0x2004, 0x9005, 0x0128, 0x2001, 0x008b,
+	0x2004, 0xd0fc, 0x0dd8, 0x2001, 0x008a, 0x2003, 0x0002, 0x2003,
+	0x1001, 0x2071, 0x0080, 0x0804, 0x0427, 0x81ff, 0x1904, 0x3373,
+	0x7984, 0x080c, 0x6166, 0x1904, 0x3376, 0x7e98, 0x9684, 0x3fff,
+	0x9082, 0x4000, 0x1a04, 0x3376, 0x7c88, 0x7d8c, 0x080c, 0x6398,
+	0x080c, 0x6329, 0x1518, 0x2061, 0x1ddc, 0x0126, 0x2091, 0x8000,
+	0x6000, 0x9086, 0x0000, 0x0148, 0x6014, 0x904d, 0x0130, 0xa86c,
+	0x9406, 0x1118, 0xa870, 0x9506, 0x0150, 0x012e, 0x9ce0, 0x001c,
+	0x2001, 0x1819, 0x2004, 0x9c02, 0x1a04, 0x3373, 0x0c30, 0x080c,
+	0xb2d0, 0x012e, 0x0904, 0x3373, 0x0804, 0x3341, 0x900e, 0x2001,
+	0x0005, 0x080c, 0x6a5c, 0x0126, 0x2091, 0x8000, 0x080c, 0xb9c2,
+	0x080c, 0x683f, 0x012e, 0x0804, 0x3341, 0x00a6, 0x2950, 0xb198,
+	0x080c, 0x6166, 0x1904, 0x35af, 0xb6a4, 0x9684, 0x3fff, 0x9082,
+	0x4000, 0x16e8, 0xb49c, 0xb5a0, 0x080c, 0x6398, 0x080c, 0x6343,
+	0x1520, 0x2061, 0x1ddc, 0x0126, 0x2091, 0x8000, 0x6000, 0x9086,
+	0x0000, 0x0148, 0x6014, 0x904d, 0x0130, 0xa86c, 0x9406, 0x1118,
+	0xa870, 0x9506, 0x0158, 0x012e, 0x9ce0, 0x001c, 0x2001, 0x1819,
+	0x2004, 0x9c02, 0x2009, 0x000d, 0x12b0, 0x0c28, 0x080c, 0xb2d0,
+	0x012e, 0x2009, 0x0003, 0x0178, 0x00e0, 0x900e, 0x2001, 0x0005,
+	0x080c, 0x6a5c, 0x0126, 0x2091, 0x8000, 0x080c, 0xb9c2, 0x080c,
+	0x6833, 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, 0x3373, 0x080c, 0x47b2, 0x0904,
+	0x3376, 0x080c, 0x622d, 0x0904, 0x3373, 0x080c, 0x639e, 0x0904,
+	0x3373, 0x0804, 0x42e0, 0x81ff, 0x1904, 0x3373, 0x080c, 0x47ce,
+	0x0904, 0x3376, 0x080c, 0x642c, 0x0904, 0x3373, 0x2019, 0x0005,
+	0x79a8, 0x080c, 0x63b9, 0x0904, 0x3373, 0x7888, 0x908a, 0x1000,
+	0x1a04, 0x3376, 0x8003, 0x800b, 0x810b, 0x9108, 0x080c, 0x7fc9,
+	0x7984, 0xd184, 0x1904, 0x3341, 0x0804, 0x42e0, 0x0126, 0x2091,
+	0x8000, 0x81ff, 0x0118, 0x2009, 0x0001, 0x0450, 0x2029, 0x07ff,
+	0x6458, 0x2400, 0x9506, 0x01f8, 0x2508, 0x080c, 0x6166, 0x11d8,
+	0x080c, 0x642c, 0x1128, 0x2009, 0x0002, 0x62bc, 0x2518, 0x00c0,
+	0x2019, 0x0004, 0x900e, 0x080c, 0x63b9, 0x1118, 0x2009, 0x0006,
+	0x0078, 0x7884, 0x908a, 0x1000, 0x1270, 0x8003, 0x800b, 0x810b,
+	0x9108, 0x080c, 0x7fc9, 0x8529, 0x1ae0, 0x012e, 0x0804, 0x3341,
+	0x012e, 0x0804, 0x3373, 0x012e, 0x0804, 0x3376, 0x080c, 0x47b2,
+	0x0904, 0x3376, 0x080c, 0x622d, 0x0904, 0x3373, 0x080c, 0x9746,
+	0xbaa0, 0x2019, 0x0005, 0x00c6, 0x9066, 0x080c, 0x8498, 0x0076,
+	0x903e, 0x080c, 0x8387, 0x900e, 0x080c, 0xce23, 0x007e, 0x00ce,
+	0x080c, 0x9762, 0x080c, 0x6398, 0x0804, 0x3341, 0x080c, 0x47b2,
+	0x0904, 0x3376, 0x080c, 0x6398, 0x2208, 0x0804, 0x3341, 0x0156,
+	0x00d6, 0x00e6, 0x00c6, 0x2069, 0x1906, 0x6810, 0x6914, 0x910a,
+	0x1208, 0x900e, 0x6816, 0x9016, 0x901e, 0x2071, 0x19b6, 0x7028,
+	0x9065, 0x0118, 0x8210, 0x600c, 0x0cd8, 0x2300, 0x9218, 0x00ce,
+	0x00ee, 0x00de, 0x015e, 0x0804, 0x3341, 0x00f6, 0x0016, 0x907d,
+	0x0138, 0x9006, 0x8000, 0x2f0c, 0x81ff, 0x0110, 0x2178, 0x0cd0,
+	0x001e, 0x00fe, 0x0005, 0x2069, 0x1906, 0x6910, 0x62b8, 0x0804,
+	0x3341, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x3373, 0x0126,
+	0x2091, 0x8000, 0x080c, 0x52b1, 0x0128, 0x2009, 0x0007, 0x012e,
+	0x0804, 0x3373, 0x012e, 0x6158, 0x9190, 0x3142, 0x2215, 0x9294,
+	0x00ff, 0x6378, 0x83ff, 0x0108, 0x627c, 0x67d8, 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, 0x6f5c,
+	0x1118, 0x2031, 0x0004, 0x0038, 0xd79c, 0x0120, 0x2009, 0x0005,
+	0x0804, 0x3373, 0x9036, 0x7e9a, 0x7f9e, 0x0804, 0x3341, 0x6148,
+	0x624c, 0x2019, 0x1955, 0x231c, 0x2001, 0x1956, 0x2004, 0x789a,
+	0x0804, 0x3341, 0x0126, 0x2091, 0x8000, 0x6138, 0x623c, 0x6340,
+	0x012e, 0x0804, 0x3341, 0x080c, 0x47ce, 0x0904, 0x3376, 0xba44,
+	0xbb38, 0x0804, 0x3341, 0x080c, 0x0d65, 0x080c, 0x47ce, 0x2110,
+	0x0904, 0x3376, 0xb804, 0x908c, 0x00ff, 0x918e, 0x0006, 0x0140,
+	0x9084, 0xff00, 0x9086, 0x0600, 0x2009, 0x0009, 0x1904, 0x3373,
+	0x0126, 0x2091, 0x8000, 0x2019, 0x0005, 0x00c6, 0x9066, 0x080c,
+	0x9746, 0x080c, 0x9372, 0x080c, 0x8498, 0x0076, 0x903e, 0x080c,
+	0x8387, 0x900e, 0x080c, 0xce23, 0x007e, 0x00ce, 0x080c, 0x9762,
+	0xb807, 0x0407, 0x012e, 0x0804, 0x3341, 0x6148, 0x624c, 0x7884,
+	0x604a, 0x7b88, 0x634e, 0x2069, 0x1853, 0x831f, 0x9305, 0x6816,
+	0x788c, 0x2069, 0x1955, 0x2d1c, 0x206a, 0x7e98, 0x9682, 0x0014,
+	0x1210, 0x2031, 0x07d0, 0x2069, 0x1956, 0x2d04, 0x266a, 0x789a,
+	0x0804, 0x3341, 0x0126, 0x2091, 0x8000, 0x6138, 0x7884, 0x603a,
+	0x910e, 0xd1b4, 0x190c, 0x0eb4, 0xd0c4, 0x01a8, 0x00d6, 0x78a8,
+	0x2009, 0x196c, 0x200a, 0x78ac, 0x2011, 0x196d, 0x2012, 0x2069,
+	0x0100, 0x6838, 0x9086, 0x0007, 0x1118, 0x2214, 0x6a5a, 0x0010,
+	0x210c, 0x695a, 0x00de, 0x7888, 0x603e, 0x2011, 0x0116, 0x220c,
+	0x7888, 0xd08c, 0x0118, 0x918d, 0x0040, 0x0010, 0x918c, 0xff7f,
+	0x2112, 0x6140, 0x788c, 0x6042, 0x910e, 0xd1e4, 0x190c, 0x0ecf,
+	0x6040, 0xd0cc, 0x0120, 0x78b0, 0x2011, 0x0114, 0x2012, 0x012e,
+	0x0804, 0x3341, 0x00f6, 0x2079, 0x1800, 0x7a38, 0xa898, 0x9084,
+	0xfebf, 0x9215, 0xa89c, 0x9084, 0xfebf, 0x8002, 0x9214, 0x7838,
+	0x9084, 0x0140, 0x9215, 0x7a3a, 0xa897, 0x4000, 0x900e, 0x9085,
+	0x0001, 0x2001, 0x0000, 0x00fe, 0x0005, 0x7898, 0x9005, 0x01a8,
+	0x7888, 0x9025, 0x0904, 0x3376, 0x788c, 0x902d, 0x0904, 0x3376,
+	0x900e, 0x080c, 0x6166, 0x1120, 0xba44, 0xbb38, 0xbc46, 0xbd3a,
+	0x9186, 0x07ff, 0x0190, 0x8108, 0x0ca0, 0x080c, 0x47ce, 0x0904,
+	0x3376, 0x7888, 0x900d, 0x0904, 0x3376, 0x788c, 0x9005, 0x0904,
+	0x3376, 0xba44, 0xb946, 0xbb38, 0xb83a, 0x0804, 0x3341, 0x2011,
+	0xbc09, 0x0010, 0x2011, 0xbc05, 0x080c, 0x52b1, 0x1904, 0x3373,
+	0x00c6, 0x2061, 0x0100, 0x7984, 0x9186, 0x00ff, 0x1130, 0x2001,
+	0x1817, 0x2004, 0x9085, 0xff00, 0x0088, 0x9182, 0x007f, 0x16e0,
+	0x9188, 0x3142, 0x210d, 0x918c, 0x00ff, 0x2001, 0x1817, 0x2004,
+	0x0026, 0x9116, 0x002e, 0x0580, 0x810f, 0x9105, 0x0126, 0x2091,
+	0x8000, 0x0006, 0x080c, 0x9a0f, 0x000e, 0x0510, 0x602e, 0x620a,
+	0x7984, 0x00b6, 0x080c, 0x610c, 0x2b08, 0x00be, 0x1500, 0x6112,
+	0x6023, 0x0001, 0x080c, 0x479b, 0x01d0, 0x9006, 0xa866, 0x7007,
+	0x0003, 0xa832, 0xa868, 0xc0fd, 0xa86a, 0x701f, 0x381a, 0x2900,
+	0x6016, 0x2009, 0x0032, 0x080c, 0x9b03, 0x012e, 0x00ce, 0x0005,
+	0x012e, 0x00ce, 0x0804, 0x3373, 0x00ce, 0x0804, 0x3376, 0x080c,
+	0x9a65, 0x0cb0, 0xa830, 0x9086, 0x0100, 0x0904, 0x3373, 0x0804,
+	0x3341, 0x2061, 0x1a3d, 0x0126, 0x2091, 0x8000, 0x6000, 0xd084,
+	0x0170, 0x6104, 0x6208, 0x2061, 0x1800, 0x6350, 0x6070, 0x789a,
+	0x60bc, 0x789e, 0x60b8, 0x78aa, 0x012e, 0x0804, 0x3341, 0x900e,
+	0x2110, 0x0c88, 0x81ff, 0x1904, 0x3373, 0x080c, 0x6f5c, 0x0904,
+	0x3373, 0x0126, 0x2091, 0x8000, 0x6250, 0x6070, 0x9202, 0x0248,
+	0x9085, 0x0001, 0x080c, 0x2458, 0x080c, 0x54c1, 0x012e, 0x0804,
+	0x3341, 0x012e, 0x0804, 0x3376, 0x0006, 0x0016, 0x00c6, 0x00e6,
+	0x2001, 0x1978, 0x2070, 0x2061, 0x1853, 0x6008, 0x2072, 0x900e,
+	0x2011, 0x1400, 0x080c, 0x8276, 0x7206, 0x00ee, 0x00ce, 0x001e,
+	0x000e, 0x0005, 0x0126, 0x2091, 0x8000, 0x81ff, 0x0128, 0x012e,
+	0x2021, 0x400b, 0x0804, 0x3343, 0x7884, 0xd0fc, 0x0148, 0x2001,
+	0x002a, 0x2004, 0x9082, 0x00e1, 0x0288, 0x012e, 0x0804, 0x3376,
+	0x2001, 0x002a, 0x2004, 0x2069, 0x1853, 0x6908, 0x9102, 0x1230,
+	0x012e, 0x0804, 0x3376, 0x012e, 0x0804, 0x3373, 0x080c, 0x99e4,
+	0x0dd0, 0x7884, 0xd0fc, 0x0904, 0x38e5, 0x00c6, 0x080c, 0x479b,
+	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, 0x3a6f, 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, 0x47e4, 0x701f,
+	0x39ac, 0x7023, 0x0001, 0x012e, 0x0005, 0x080c, 0x9746, 0x0046,
+	0x0086, 0x0096, 0x00a6, 0x00b6, 0x00c6, 0x00d6, 0x00e6, 0x00f6,
+	0x080c, 0x3854, 0x2001, 0x196e, 0x2003, 0x0000, 0x2021, 0x000a,
+	0x2061, 0x0100, 0x6104, 0x0016, 0x60bb, 0x0000, 0x60bf, 0x32e1,
+	0x60bf, 0x0012, 0x080c, 0x3ade, 0x080c, 0x3a9d, 0x00f6, 0x00e6,
+	0x0086, 0x2940, 0x2071, 0x19b6, 0x2079, 0x0090, 0x00d6, 0x2069,
+	0x0000, 0x6884, 0xd0b4, 0x0140, 0x2001, 0x0035, 0x2004, 0x780e,
+	0x2001, 0x0034, 0x2004, 0x780a, 0x00de, 0x2011, 0x0001, 0x080c,
+	0x3e4f, 0x008e, 0x00ee, 0x00fe, 0x080c, 0x3d7c, 0x080c, 0x3ca9,
+	0x05b8, 0x2001, 0x020b, 0x2004, 0x9084, 0x0140, 0x1db8, 0x080c,
+	0x3ec3, 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, 0x181f, 0x2004, 0x9106, 0x1168,
+	0x00c6, 0x2061, 0x0100, 0x6024, 0x9084, 0x1e00, 0x00ce, 0x0138,
+	0x080c, 0x3cb3, 0x080c, 0x3a98, 0x0058, 0x080c, 0x3a98, 0x080c,
+	0x3de7, 0x080c, 0x3d72, 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, 0x12cd, 0x2009, 0x0028, 0x080c, 0x201d,
+	0x2001, 0x0227, 0x200c, 0x2102, 0x080c, 0x9762, 0x00fe, 0x00ee,
+	0x00de, 0x00ce, 0x00be, 0x00ae, 0x009e, 0x008e, 0x004e, 0x2001,
+	0x196e, 0x2004, 0x9005, 0x1118, 0x012e, 0x0804, 0x3341, 0x012e,
+	0x2021, 0x400c, 0x0804, 0x3343, 0x0016, 0x0026, 0x0036, 0x0046,
+	0x0056, 0x0076, 0x0086, 0x0096, 0x00d6, 0x0156, 0x7014, 0x2048,
+	0x7020, 0x20a8, 0x8000, 0x7022, 0xa804, 0x9005, 0x0904, 0x3a08,
+	0x2048, 0x1f04, 0x39bc, 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, 0x47e4, 0x701f, 0x39ac, 0x00b0, 0x8906,
+	0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x001b,
+	0x21a8, 0x27e0, 0x2098, 0x27e8, 0x20a0, 0x0006, 0x080c, 0x0fa0,
+	0x000e, 0x080c, 0x47e7, 0x701f, 0x39ac, 0x015e, 0x00de, 0x009e,
+	0x008e, 0x007e, 0x005e, 0x004e, 0x003e, 0x002e, 0x001e, 0x0005,
+	0x7014, 0x2048, 0xa864, 0x9086, 0x0103, 0x1118, 0x701f, 0x3a6d,
+	0x0450, 0x7014, 0x2048, 0xa868, 0xc0fd, 0xa86a, 0x2009, 0x007f,
+	0x080c, 0x6106, 0x0110, 0x9006, 0x0030, 0xb813, 0x00ff, 0xb817,
+	0xfffd, 0x080c, 0xbba1, 0x015e, 0x00de, 0x009e, 0x008e, 0x007e,
+	0x005e, 0x004e, 0x003e, 0x002e, 0x001e, 0x0904, 0x3373, 0x0016,
+	0x0026, 0x0036, 0x0046, 0x0056, 0x0076, 0x0086, 0x0096, 0x00d6,
+	0x0156, 0x701f, 0x3a3f, 0x7007, 0x0003, 0x0804, 0x39fd, 0xa830,
+	0x9086, 0x0100, 0x2021, 0x400c, 0x0904, 0x3343, 0x0076, 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, 0x0fa0, 0x000e, 0x080c, 0x47e7, 0x007e,
+	0x701f, 0x39ac, 0x7023, 0x0001, 0x0005, 0x0804, 0x3341, 0x0156,
+	0x00c6, 0xa814, 0x908a, 0x001e, 0x0218, 0xa833, 0x001e, 0x0010,
+	0xa832, 0x0078, 0x81ff, 0x0168, 0x0016, 0x080c, 0x479b, 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,
+	0x479b, 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, 0x201d, 0x2001, 0x002a, 0x2004, 0x9084, 0xfff8,
+	0xa86e, 0x601a, 0xa873, 0x0000, 0x601f, 0x0000, 0x78ca, 0x9006,
+	0x600a, 0x600e, 0x00ce, 0x00ee, 0x00fe, 0x0005, 0x00e6, 0x080c,
+	0x479b, 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, 0x27cf, 0x1130, 0x9006, 0x080c, 0x2739, 0x9006,
+	0x080c, 0x271c, 0x7884, 0x9084, 0x0007, 0x0002, 0x3b29, 0x3b32,
+	0x3b3b, 0x3b26, 0x3b26, 0x3b26, 0x3b26, 0x3b26, 0x012e, 0x0804,
+	0x3376, 0x2009, 0x0114, 0x2104, 0x9085, 0x0800, 0x200a, 0x080c,
+	0x3cfd, 0x00c0, 0x2009, 0x0114, 0x2104, 0x9085, 0x4000, 0x200a,
+	0x080c, 0x3cfd, 0x0078, 0x080c, 0x6f5c, 0x1128, 0x012e, 0x2009,
+	0x0016, 0x0804, 0x3373, 0x81ff, 0x0128, 0x012e, 0x2021, 0x400b,
+	0x0804, 0x3343, 0x080c, 0x9746, 0x0086, 0x0096, 0x00a6, 0x00b6,
+	0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x080c, 0x3854, 0x2009, 0x0101,
+	0x210c, 0x0016, 0x7ec8, 0x7dcc, 0x9006, 0x2068, 0x2060, 0x2058,
+	0x080c, 0x3f9e, 0x080c, 0x3eee, 0x903e, 0x2720, 0x00f6, 0x00e6,
+	0x0086, 0x2940, 0x2071, 0x19b6, 0x2079, 0x0090, 0x00d6, 0x2069,
+	0x0000, 0x6884, 0xd0b4, 0x0120, 0x68d4, 0x780e, 0x68d0, 0x780a,
+	0x00de, 0x2011, 0x0001, 0x080c, 0x3e4f, 0x080c, 0x27d7, 0x080c,
+	0x27d7, 0x080c, 0x27d7, 0x080c, 0x27d7, 0x080c, 0x3e4f, 0x008e,
+	0x00ee, 0x00fe, 0x080c, 0x3d7c, 0x2009, 0x9c40, 0x8109, 0x11b0,
+	0x080c, 0x3cb3, 0x2001, 0x0004, 0x200c, 0x918c, 0xfffd, 0x2102,
+	0x001e, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x00ae, 0x009e,
+	0x008e, 0x2009, 0x0017, 0x080c, 0x3373, 0x0cf8, 0x2001, 0x020b,
+	0x2004, 0x9084, 0x0140, 0x1d10, 0x00f6, 0x2079, 0x0000, 0x7884,
+	0x00fe, 0xd0bc, 0x0178, 0x2001, 0x0201, 0x200c, 0x81ff, 0x0150,
+	0x080c, 0x3d5a, 0x2d00, 0x9c05, 0x9b05, 0x0120, 0x080c, 0x3cb3,
+	0x0804, 0x3c5c, 0x080c, 0x3ec3, 0x080c, 0x3de7, 0x080c, 0x3d3d,
+	0x080c, 0x3d72, 0x00f6, 0x2079, 0x0100, 0x7824, 0xd0ac, 0x0130,
+	0x8b58, 0x080c, 0x3cb3, 0x00fe, 0x0804, 0x3c5c, 0x00fe, 0x080c,
+	0x3ca9, 0x1150, 0x8d68, 0x2001, 0x0032, 0x2602, 0x2001, 0x0033,
+	0x2502, 0x080c, 0x3cb3, 0x0080, 0x87ff, 0x0138, 0x2001, 0x0201,
+	0x2004, 0x9005, 0x1908, 0x8739, 0x0038, 0x2001, 0x1a3a, 0x2004,
+	0x9086, 0x0000, 0x1904, 0x3bac, 0x2001, 0x032f, 0x2003, 0x00f6,
+	0x8631, 0x1208, 0x8529, 0x2500, 0x9605, 0x0904, 0x3c5c, 0x7884,
+	0xd0bc, 0x0128, 0x2d00, 0x9c05, 0x9b05, 0x1904, 0x3c5c, 0xa013,
+	0x0019, 0x2001, 0x032a, 0x2003, 0x0004, 0x7884, 0xd0ac, 0x1148,
+	0x2001, 0x1a3a, 0x2003, 0x0003, 0x2001, 0x032a, 0x2003, 0x0009,
+	0x0030, 0xa017, 0x0001, 0x78b4, 0x9005, 0x0108, 0xa016, 0x2800,
+	0xa05a, 0x2009, 0x0040, 0x080c, 0x201d, 0x2900, 0xa85a, 0xa813,
+	0x0019, 0x7884, 0xd0a4, 0x1180, 0xa817, 0x0000, 0x00c6, 0x20a9,
+	0x0004, 0x2061, 0x0090, 0x602b, 0x0008, 0x2001, 0x0203, 0x2004,
+	0x1f04, 0x3c33, 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, 0x3b66, 0x001e, 0x00c6, 0x2001, 0x032a,
+	0x2003, 0x0004, 0x2061, 0x0100, 0x6027, 0x0002, 0x6106, 0x2011,
+	0x020d, 0x2013, 0x0020, 0x2001, 0x0004, 0x200c, 0x918c, 0xfffd,
+	0x2102, 0x080c, 0x12cd, 0x7884, 0x9084, 0x0003, 0x9086, 0x0002,
+	0x01b0, 0x2009, 0x0028, 0x080c, 0x201d, 0x2001, 0x0227, 0x200c,
+	0x2102, 0x6050, 0x9084, 0xb7ff, 0x080c, 0x2892, 0x6052, 0x602f,
+	0x0000, 0x604b, 0xf7f7, 0x6043, 0x0090, 0x6043, 0x0010, 0x080c,
+	0x9762, 0x00ce, 0x2d08, 0x2c10, 0x2b18, 0x2b00, 0x9c05, 0x9d05,
+	0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x00ae, 0x009e, 0x008e,
+	0x1118, 0x012e, 0x0804, 0x3341, 0x012e, 0x2021, 0x400c, 0x0804,
+	0x3343, 0x9085, 0x0001, 0x1d04, 0x3cb2, 0x2091, 0x6000, 0x8420,
+	0x9486, 0x0064, 0x0005, 0x2001, 0x0105, 0x2003, 0x0010, 0x2001,
+	0x032a, 0x2003, 0x0004, 0x2001, 0x1a3a, 0x2003, 0x0000, 0x0071,
+	0x2009, 0x0048, 0x080c, 0x201d, 0x2001, 0x0227, 0x2024, 0x2402,
+	0x2001, 0x0109, 0x2003, 0x4000, 0x9026, 0x0005, 0x00f6, 0x00e6,
+	0x2071, 0x19b6, 0x7054, 0x9086, 0x0000, 0x0520, 0x2079, 0x0090,
+	0x2009, 0x0206, 0x2104, 0x2009, 0x0203, 0x210c, 0x9106, 0x1120,
+	0x2009, 0x0040, 0x080c, 0x201d, 0x782c, 0xd0fc, 0x0d88, 0x080c,
+	0x3ec3, 0x7054, 0x9086, 0x0000, 0x1d58, 0x782b, 0x0004, 0x782c,
+	0xd0ac, 0x1de8, 0x2009, 0x0040, 0x080c, 0x201d, 0x782b, 0x0002,
+	0x7057, 0x0000, 0x00ee, 0x00fe, 0x0005, 0x00f6, 0x2079, 0x0100,
+	0x2001, 0x1817, 0x200c, 0x7932, 0x7936, 0x080c, 0x2438, 0x080c,
+	0x284e, 0x080c, 0x2892, 0x784b, 0xf7f7, 0x7843, 0x0090, 0x7843,
+	0x0010, 0x7850, 0xc0e5, 0x7852, 0x2019, 0x61a8, 0x7820, 0xd09c,
+	0x0110, 0x8319, 0x1dd8, 0x7850, 0xc0e4, 0x7852, 0x2011, 0x0048,
+	0x080c, 0x282b, 0x7843, 0x0040, 0x2019, 0x01f4, 0xa001, 0xa001,
+	0x8319, 0x1de0, 0x2001, 0x0100, 0x080c, 0x27f1, 0x2011, 0x0020,
+	0x080c, 0x282b, 0x7843, 0x0000, 0x9006, 0x080c, 0x27f1, 0x2011,
+	0x0048, 0x080c, 0x282b, 0x00fe, 0x0005, 0x7884, 0xd0ac, 0x11c8,
+	0x00f6, 0x00e6, 0x2071, 0x1a3a, 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, 0x3a8e, 0x1188, 0x2001, 0x181f,
+	0x2004, 0x2009, 0x181e, 0x210c, 0x918c, 0x00ff, 0x706e, 0x716a,
+	0x7066, 0x918d, 0x3200, 0x7162, 0x7073, 0xe109, 0x0080, 0x702c,
+	0x9085, 0x0002, 0x702e, 0x2009, 0x1817, 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, 0x3ec3, 0x00f6, 0x2071, 0x1a3a, 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, 0x3e4f,
+	0x2011, 0x0001, 0x080c, 0x3e4f, 0x00fe, 0x00ee, 0x0005, 0x00f6,
+	0x00e6, 0x2071, 0x1a3a, 0x2079, 0x0320, 0x792c, 0xd1fc, 0x0904,
+	0x3e4c, 0x782b, 0x0002, 0x9026, 0xd19c, 0x1904, 0x3e48, 0x7000,
+	0x0002, 0x3e4c, 0x3dfd, 0x3e2d, 0x3e48, 0xd1bc, 0x1170, 0xd1dc,
+	0x1190, 0x8001, 0x7002, 0x2011, 0x0001, 0x080c, 0x3e4f, 0x0904,
+	0x3e4c, 0x080c, 0x3e4f, 0x0804, 0x3e4c, 0x00f6, 0x2079, 0x0300,
+	0x78bf, 0x0000, 0x00fe, 0x7810, 0x7914, 0x782b, 0x0004, 0x7812,
+	0x7916, 0x2001, 0x0201, 0x200c, 0x81ff, 0x0de8, 0x080c, 0x3d5a,
+	0x2009, 0x0001, 0x00f6, 0x2079, 0x0300, 0x78b8, 0x00fe, 0xd0ec,
+	0x0110, 0x2009, 0x0011, 0x792a, 0x00f8, 0x8001, 0x7002, 0x9184,
+	0x0880, 0x1140, 0x782c, 0xd0fc, 0x1904, 0x3df1, 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, 0x0d65, 0x9398, 0x3e7d, 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, 0x3eba, 0x3eb1, 0x3ea8,
+	0x3e9f, 0x3e96, 0x3e8d, 0x3e84, 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, 0x19b6,
+	0x2079, 0x0090, 0x792c, 0xd1fc, 0x01e8, 0x782b, 0x0002, 0x2940,
+	0x9026, 0x7054, 0x0002, 0x3eea, 0x3ed6, 0x3ee1, 0x8001, 0x7056,
+	0xd19c, 0x1180, 0x2011, 0x0001, 0x080c, 0x3e4f, 0x190c, 0x3e4f,
+	0x0048, 0x8001, 0x7056, 0x782c, 0xd0fc, 0x1d38, 0x2011, 0x0001,
+	0x080c, 0x3e4f, 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, 0x479b, 0xa813,
+	0x0019, 0xaf16, 0x2900, 0xa85a, 0x978a, 0x0007, 0x0220, 0x2138,
+	0x2009, 0x0007, 0x0010, 0x2708, 0x903e, 0x0096, 0xa858, 0x2048,
+	0xa85c, 0x9080, 0x0019, 0x009e, 0x080c, 0x3f66, 0x1d68, 0x2900,
+	0xa85a, 0x00d0, 0x080c, 0x479b, 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, 0x201d,
+	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, 0x479b,
+	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, 0x479b, 0x2940, 0xa813, 0x0019,
+	0xaf16, 0x2900, 0xa85a, 0x978a, 0x0007, 0x0220, 0x2138, 0x2009,
+	0x0007, 0x0010, 0x2708, 0x903e, 0x0096, 0xa858, 0x2048, 0xa85c,
+	0x9080, 0x0019, 0x009e, 0x080c, 0x3f66, 0x1d68, 0x2900, 0xa85a,
+	0x00d8, 0x080c, 0x479b, 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, 0x1a3a, 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,
+	0x3341, 0x7d98, 0x7c9c, 0x0804, 0x3438, 0x080c, 0x6f5c, 0x190c,
+	0x5ba7, 0x2069, 0x1853, 0x2d00, 0x2009, 0x0030, 0x7a8c, 0x7b88,
+	0x7c9c, 0x7d98, 0x2039, 0x0001, 0x080c, 0x47e4, 0x701f, 0x4039,
+	0x0005, 0x080c, 0x52ac, 0x1130, 0x3b00, 0x3a08, 0xc194, 0xc095,
+	0x20d8, 0x21d0, 0x2069, 0x1853, 0x6800, 0x9005, 0x0904, 0x3376,
+	0x6804, 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, 0x3376, 0x9288, 0x3142,
+	0x210d, 0x918c, 0x00ff, 0x6162, 0xd0dc, 0x0130, 0x6828, 0x908a,
+	0x007f, 0x1a04, 0x3376, 0x605a, 0x6888, 0x9084, 0x0030, 0x8004,
+	0x8004, 0x8004, 0x8004, 0x0006, 0x2009, 0x1980, 0x9080, 0x252b,
+	0x2005, 0x200a, 0x2008, 0x2001, 0x0018, 0x080c, 0x9737, 0x2009,
+	0x0390, 0x200b, 0x0400, 0x000e, 0x2009, 0x1981, 0x9080, 0x252f,
+	0x2005, 0x200a, 0x6808, 0x908a, 0x0100, 0x0a04, 0x3376, 0x908a,
+	0x0841, 0x1a04, 0x3376, 0x9084, 0x0007, 0x1904, 0x3376, 0x680c,
+	0x9005, 0x0904, 0x3376, 0x6810, 0x9005, 0x0904, 0x3376, 0x6848,
+	0x6940, 0x910a, 0x1a04, 0x3376, 0x8001, 0x0904, 0x3376, 0x684c,
+	0x6944, 0x910a, 0x1a04, 0x3376, 0x8001, 0x0904, 0x3376, 0x6814,
+	0x908c, 0x00ff, 0x614a, 0x8007, 0x9084, 0x00ff, 0x604e, 0x080c,
+	0x728d, 0x080c, 0x65dd, 0x080c, 0x6612, 0x6808, 0x602a, 0x080c,
+	0x1f8f, 0x2009, 0x0170, 0x200b, 0x0080, 0xa001, 0xa001, 0x200b,
+	0x0000, 0x0036, 0x6b08, 0x080c, 0x2492, 0x003e, 0x6000, 0x9086,
+	0x0000, 0x1904, 0x41a5, 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, 0x812d, 0x00c6, 0x900e, 0x20a9,
+	0x0001, 0x6b70, 0xd384, 0x01c8, 0x0020, 0x839d, 0x12b0, 0x3508,
+	0x8109, 0x080c, 0x784e, 0x6878, 0x6016, 0x6874, 0x2008, 0x9084,
+	0xff00, 0x8007, 0x600a, 0x9184, 0x00ff, 0x6006, 0x8108, 0x1118,
+	0x6003, 0x0003, 0x0010, 0x6003, 0x0001, 0x1f04, 0x411d, 0x00ce,
+	0x00c6, 0x2061, 0x196b, 0x2063, 0x0001, 0x9006, 0x080c, 0x2739,
+	0x9006, 0x080c, 0x271c, 0x0000, 0x00ce, 0x00e6, 0x2c70, 0x080c,
+	0x0e9c, 0x00ee, 0x6888, 0xd0ec, 0x0130, 0x2011, 0x0114, 0x2204,
+	0x9085, 0x0180, 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, 0x2507,
+	0x2001, 0x193e, 0x2102, 0x0008, 0x2102, 0x00c6, 0x2061, 0x0100,
+	0x602f, 0x0040, 0x602f, 0x0000, 0x00ce, 0x080c, 0x6f5c, 0x0128,
+	0x080c, 0x4bb0, 0x0110, 0x080c, 0x2458, 0x60d0, 0x9005, 0x01c0,
+	0x6003, 0x0001, 0x2009, 0x418d, 0x00d0, 0x080c, 0x6f5c, 0x1168,
+	0x2011, 0x6dd2, 0x080c, 0x7fbb, 0x2011, 0x6dc5, 0x080c, 0x80bc,
+	0x080c, 0x7261, 0x080c, 0x6e8d, 0x0040, 0x080c, 0x5a9d, 0x0028,
+	0x6003, 0x0004, 0x2009, 0x41a5, 0x0010, 0x0804, 0x3341, 0x2001,
+	0x0170, 0x2004, 0x9084, 0x00ff, 0x9086, 0x004c, 0x1118, 0x2091,
+	0x31bd, 0x0817, 0x2091, 0x313d, 0x0817, 0x6000, 0x9086, 0x0000,
+	0x0904, 0x3373, 0x2069, 0x1853, 0x7890, 0x6842, 0x7894, 0x6846,
+	0x2d00, 0x2009, 0x0030, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x2039,
+	0x0001, 0x0804, 0x47e7, 0x9006, 0x080c, 0x2458, 0x81ff, 0x1904,
+	0x3373, 0x080c, 0x6f5c, 0x11b0, 0x080c, 0x725c, 0x080c, 0x5be2,
+	0x080c, 0x313d, 0x0118, 0x6130, 0xc18d, 0x6132, 0x080c, 0xbdd7,
+	0x0130, 0x080c, 0x6f7f, 0x1118, 0x080c, 0x6f30, 0x0038, 0x080c,
+	0x6e8d, 0x0020, 0x080c, 0x5ba7, 0x080c, 0x5a9d, 0x0804, 0x3341,
+	0x81ff, 0x1904, 0x3373, 0x080c, 0x6f5c, 0x1110, 0x0804, 0x3373,
+	0x6190, 0x81ff, 0x01a8, 0x704f, 0x0000, 0x2001, 0x1d80, 0x2009,
+	0x0040, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x0126, 0x2091, 0x8000,
+	0x2039, 0x0001, 0x080c, 0x47e7, 0x701f, 0x333f, 0x012e, 0x0005,
+	0x704f, 0x0001, 0x00d6, 0x2069, 0x1d80, 0x20a9, 0x0040, 0x20e9,
+	0x0001, 0x20a1, 0x1d80, 0x2019, 0xffff, 0x4304, 0x6558, 0x9588,
+	0x3142, 0x210d, 0x918c, 0x00ff, 0x216a, 0x900e, 0x2011, 0x0002,
+	0x2100, 0x9506, 0x01a8, 0x080c, 0x6166, 0x1190, 0xb814, 0x821c,
+	0x0238, 0x9398, 0x1d80, 0x9085, 0xff00, 0x8007, 0x201a, 0x0038,
+	0x9398, 0x1d80, 0x2324, 0x94a4, 0xff00, 0x9405, 0x201a, 0x8210,
+	0x8108, 0x9182, 0x0080, 0x1208, 0x0c18, 0x8201, 0x8007, 0x2d0c,
+	0x9105, 0x206a, 0x00de, 0x20a9, 0x0040, 0x20a1, 0x1d80, 0x2099,
+	0x1d80, 0x080c, 0x5b32, 0x0804, 0x41fd, 0x080c, 0x47ce, 0x0904,
+	0x3376, 0x080c, 0x479b, 0x1120, 0x2009, 0x0002, 0x0804, 0x3373,
+	0x080c, 0x529d, 0xd0b4, 0x0558, 0x7884, 0x908e, 0x007e, 0x0538,
+	0x908e, 0x007f, 0x0520, 0x908e, 0x0080, 0x0508, 0x080c, 0x3138,
+	0x1148, 0xb800, 0xd08c, 0x11d8, 0xb804, 0x9084, 0x00ff, 0x9086,
+	0x0006, 0x11a8, 0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a, 0x080c,
+	0xb88d, 0x1120, 0x2009, 0x0003, 0x0804, 0x3373, 0x7007, 0x0003,
+	0x701f, 0x428b, 0x0005, 0x080c, 0x47ce, 0x0904, 0x3376, 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,
+	0x0fa0, 0x0070, 0x20a9, 0x0004, 0xa85c, 0x9080, 0x000a, 0x20a0,
+	0xb8b4, 0x20e0, 0xb8b8, 0x9080, 0x000a, 0x2098, 0x080c, 0x0fa0,
+	0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080,
+	0x0002, 0x2009, 0x002b, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x0804,
+	0x47e7, 0x81ff, 0x1904, 0x3373, 0x080c, 0x47b2, 0x0904, 0x3376,
+	0x080c, 0x63a7, 0x0904, 0x3373, 0x0058, 0xa878, 0x9005, 0x0120,
+	0x2009, 0x0004, 0x0804, 0x3373, 0xa974, 0xaa94, 0x0804, 0x3341,
+	0x080c, 0x52a5, 0x0904, 0x3341, 0x701f, 0x42d5, 0x7007, 0x0003,
+	0x0005, 0x81ff, 0x1904, 0x3373, 0x7888, 0x908a, 0x1000, 0x1a04,
+	0x3376, 0x080c, 0x47ce, 0x0904, 0x3376, 0x080c, 0x655d, 0x0120,
+	0x080c, 0x6565, 0x1904, 0x3376, 0x080c, 0x642c, 0x0904, 0x3373,
+	0x2019, 0x0004, 0x900e, 0x080c, 0x63b9, 0x0904, 0x3373, 0x7984,
+	0x7a88, 0x04c9, 0x08a8, 0xa89c, 0x908a, 0x1000, 0x12f8, 0x080c,
+	0x47cc, 0x01e0, 0x080c, 0x655d, 0x0118, 0x080c, 0x6565, 0x11b0,
+	0x080c, 0x642c, 0x2009, 0x0002, 0x0168, 0x2009, 0x0002, 0x2019,
+	0x0004, 0x080c, 0x63b9, 0x2009, 0x0003, 0x0120, 0xa998, 0xaa9c,
+	0x00d1, 0x0060, 0xa897, 0x4005, 0xa99a, 0x0010, 0xa897, 0x4006,
+	0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x0005, 0xa897, 0x4000,
+	0x080c, 0x52a5, 0x0110, 0x9006, 0x0018, 0x900e, 0x9085, 0x0001,
+	0x2001, 0x0000, 0x0005, 0x9186, 0x00ff, 0x0110, 0x0071, 0x0060,
+	0x2029, 0x007e, 0x2061, 0x1800, 0x6458, 0x2400, 0x9506, 0x0110,
+	0x2508, 0x0019, 0x8529, 0x1ec8, 0x0005, 0x080c, 0x6166, 0x1138,
+	0x2200, 0x8003, 0x800b, 0x810b, 0x9108, 0x080c, 0x7fc9, 0x0005,
+	0x81ff, 0x1904, 0x3373, 0x080c, 0x47b2, 0x0904, 0x3376, 0x080c,
+	0x622d, 0x0904, 0x3373, 0x080c, 0x63b0, 0x0904, 0x3373, 0x0804,
+	0x42e0, 0x81ff, 0x1904, 0x3373, 0x080c, 0x47b2, 0x0904, 0x3376,
+	0x080c, 0x655d, 0x0120, 0x080c, 0x6565, 0x1904, 0x3376, 0x080c,
+	0x622d, 0x0904, 0x3373, 0x080c, 0x639e, 0x0904, 0x3373, 0x0804,
+	0x42e0, 0x6100, 0x0804, 0x3341, 0x080c, 0x47ce, 0x0904, 0x3376,
+	0x080c, 0x52b1, 0x1904, 0x3373, 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,
+	0x3341, 0x78a8, 0x909c, 0x0003, 0xd0b4, 0x1140, 0x939a, 0x0003,
+	0x1a04, 0x3373, 0x6258, 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, 0x47e7, 0x000e, 0x2031, 0x0000,
+	0x2061, 0x18ae, 0x2c44, 0xa66a, 0xa17a, 0xa772, 0xa076, 0xa28e,
+	0xa392, 0xa496, 0xa59a, 0x080c, 0x1103, 0x7007, 0x0002, 0x701f,
+	0x440a, 0x0005, 0x81ff, 0x1904, 0x3373, 0x080c, 0x47ce, 0x0904,
+	0x3376, 0x080c, 0x655d, 0x1904, 0x3373, 0x00c6, 0x080c, 0x479b,
+	0x00ce, 0x0904, 0x3373, 0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a,
+	0x7ea8, 0x080c, 0xb833, 0x0904, 0x3373, 0x7007, 0x0003, 0x701f,
+	0x440e, 0x0005, 0x080c, 0x400b, 0x0804, 0x3341, 0xa830, 0x9086,
+	0x0100, 0x0904, 0x3373, 0x8906, 0x8006, 0x8007, 0x90bc, 0x003f,
+	0x9084, 0xffc0, 0x9080, 0x001b, 0x2009, 0x000c, 0x7a8c, 0x7b88,
+	0x7c9c, 0x7d98, 0x0804, 0x47e7, 0x9006, 0x080c, 0x2458, 0x78a8,
+	0x9084, 0x00ff, 0x9086, 0x00ff, 0x0118, 0x81ff, 0x1904, 0x3373,
+	0x080c, 0x6f5c, 0x0110, 0x080c, 0x5ba7, 0x7888, 0x908a, 0x1000,
+	0x1a04, 0x3376, 0x7984, 0x9186, 0x00ff, 0x0138, 0x9182, 0x007f,
+	0x1a04, 0x3376, 0x2100, 0x080c, 0x2422, 0x0026, 0x00c6, 0x0126,
+	0x2091, 0x8000, 0x2061, 0x19d2, 0x601b, 0x0000, 0x601f, 0x0000,
+	0x6073, 0x0000, 0x6077, 0x0000, 0x080c, 0x6f5c, 0x1158, 0x080c,
+	0x725c, 0x080c, 0x5be2, 0x9085, 0x0001, 0x080c, 0x6fa3, 0x080c,
+	0x6e8d, 0x00f0, 0x080c, 0x9746, 0x080c, 0x99eb, 0x080c, 0x9762,
+	0x2061, 0x0100, 0x2001, 0x1817, 0x2004, 0x9084, 0x00ff, 0x810f,
+	0x9105, 0x604a, 0x6043, 0x0090, 0x6043, 0x0010, 0x2009, 0x1968,
+	0x200b, 0x0000, 0x2009, 0x002d, 0x2011, 0x5acd, 0x080c, 0x807a,
+	0x7984, 0x080c, 0x6f5c, 0x1110, 0x2009, 0x00ff, 0x7a88, 0x080c,
+	0x4343, 0x012e, 0x00ce, 0x002e, 0x0804, 0x3341, 0x7984, 0x080c,
+	0x6106, 0x2b08, 0x1904, 0x3376, 0x0804, 0x3341, 0x81ff, 0x0120,
+	0x2009, 0x0001, 0x0804, 0x3373, 0x60d8, 0xd0ac, 0x1130, 0xd09c,
+	0x1120, 0x2009, 0x0005, 0x0804, 0x3373, 0x080c, 0x479b, 0x1120,
+	0x2009, 0x0002, 0x0804, 0x3373, 0x7984, 0x9192, 0x0021, 0x1a04,
+	0x3376, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0xa85c, 0x9080, 0x0019,
+	0x702a, 0xaf60, 0x7736, 0x080c, 0x47e4, 0x701f, 0x44c6, 0x7880,
+	0x9086, 0x006e, 0x0110, 0x701f, 0x4d62, 0x0005, 0x2009, 0x0080,
+	0x080c, 0x6166, 0x1118, 0x080c, 0x655d, 0x0120, 0x2021, 0x400a,
+	0x0804, 0x3343, 0x00d6, 0x0096, 0xa964, 0xaa6c, 0xab70, 0xac74,
+	0xad78, 0xae7c, 0xa884, 0x90be, 0x0100, 0x0904, 0x455f, 0x90be,
+	0x0112, 0x0904, 0x455f, 0x90be, 0x0113, 0x0904, 0x455f, 0x90be,
+	0x0114, 0x0904, 0x455f, 0x90be, 0x0117, 0x0904, 0x455f, 0x90be,
+	0x011a, 0x0904, 0x455f, 0x90be, 0x011c, 0x0904, 0x455f, 0x90be,
+	0x0121, 0x0904, 0x4546, 0x90be, 0x0131, 0x0904, 0x4546, 0x90be,
+	0x0171, 0x0904, 0x455f, 0x90be, 0x0173, 0x0904, 0x455f, 0x90be,
+	0x01a1, 0x1128, 0xa894, 0x8007, 0xa896, 0x0804, 0x456a, 0x90be,
+	0x0212, 0x0904, 0x4553, 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, 0x3376, 0x7028, 0x9080, 0x0010,
+	0x2098, 0x20a0, 0x7034, 0x20e0, 0x20e8, 0x20a9, 0x0007, 0x080c,
+	0x45a8, 0x7028, 0x9080, 0x000e, 0x2098, 0x20a0, 0x7034, 0x20e0,
+	0x20e8, 0x20a9, 0x0001, 0x080c, 0x45a8, 0x00c8, 0x7028, 0x9080,
+	0x000c, 0x2098, 0x20a0, 0x7034, 0x20e0, 0x20e8, 0x20a9, 0x0001,
+	0x080c, 0x45b5, 0x00b8, 0x7028, 0x9080, 0x000e, 0x2098, 0x20a0,
+	0x7034, 0x20e0, 0x20e8, 0x20a9, 0x0001, 0x080c, 0x45b5, 0x7028,
+	0x9080, 0x000c, 0x2098, 0x20a0, 0x7034, 0x20e0, 0x20e8, 0x20a9,
+	0x0001, 0x04f1, 0x00c6, 0x080c, 0x479b, 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, 0xb84e, 0x1120, 0x2009,
+	0x0003, 0x0804, 0x3373, 0x7007, 0x0003, 0x701f, 0x459f, 0x0005,
+	0x00ce, 0x009e, 0x00de, 0x2009, 0x0002, 0x0804, 0x3373, 0xa820,
+	0x9086, 0x8001, 0x1904, 0x3341, 0x2009, 0x0004, 0x0804, 0x3373,
+	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, 0x3373, 0x60d8, 0xd0ac,
+	0x1160, 0xd09c, 0x0120, 0x2009, 0x0016, 0x0804, 0x3373, 0xd09c,
+	0x1120, 0x2009, 0x0005, 0x0804, 0x3373, 0x7984, 0x78a8, 0x2040,
+	0x080c, 0x99e4, 0x1120, 0x9182, 0x007f, 0x0a04, 0x3376, 0x9186,
+	0x00ff, 0x0904, 0x3376, 0x9182, 0x0800, 0x1a04, 0x3376, 0x7a8c,
+	0x7b88, 0x6078, 0x9306, 0x1140, 0x607c, 0x924e, 0x0904, 0x3376,
+	0x99cc, 0xff00, 0x0904, 0x3376, 0x0126, 0x2091, 0x8000, 0x0026,
+	0x2011, 0x8008, 0x080c, 0x6581, 0x002e, 0x0118, 0x2001, 0x4009,
+	0x0458, 0x080c, 0x46b5, 0x0560, 0x90c6, 0x4000, 0x1170, 0x00c6,
+	0x0006, 0x900e, 0x080c, 0x6455, 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, 0x3343,
+	0x2b00, 0x7026, 0x0016, 0x00b6, 0x00c6, 0x00e6, 0x2c70, 0x080c,
+	0x9ad6, 0x0904, 0x4682, 0x2b00, 0x6012, 0x080c, 0xbb52, 0x2e58,
+	0x00ee, 0x00e6, 0x00c6, 0x080c, 0x479b, 0x00ce, 0x2b70, 0x1158,
+	0x080c, 0x9a65, 0x00ee, 0x00ce, 0x00be, 0x001e, 0x012e, 0x2009,
+	0x0002, 0x0804, 0x3373, 0x900e, 0xa966, 0xa96a, 0x2900, 0x6016,
+	0xa932, 0xa868, 0xc0fd, 0xd88c, 0x0108, 0xc0f5, 0xa86a, 0x080c,
+	0x2fc1, 0x6023, 0x0001, 0x9006, 0x080c, 0x60a3, 0x2001, 0x0002,
+	0x080c, 0x60b7, 0x2009, 0x0002, 0x080c, 0x9b03, 0x78a8, 0xd094,
+	0x0138, 0x00ee, 0x7024, 0x00e6, 0x2058, 0xb8c4, 0xc08d, 0xb8c6,
+	0x9085, 0x0001, 0x00ee, 0x00ce, 0x00be, 0x001e, 0x012e, 0x1120,
+	0x2009, 0x0003, 0x0804, 0x3373, 0x7007, 0x0003, 0x701f, 0x4691,
+	0x0005, 0xa830, 0x2008, 0x918e, 0xdead, 0x1120, 0x2021, 0x4009,
+	0x0804, 0x3343, 0x9086, 0x0100, 0x7024, 0x2058, 0x1138, 0x2009,
+	0x0004, 0xba04, 0x9294, 0x00ff, 0x0804, 0x51fa, 0x900e, 0xa868,
+	0xd0f4, 0x1904, 0x3341, 0x080c, 0x6455, 0x1108, 0xc185, 0xb800,
+	0xd0bc, 0x0108, 0xc18d, 0x0804, 0x3341, 0x00e6, 0x00d6, 0x0096,
+	0x83ff, 0x0904, 0x46fd, 0x902e, 0x080c, 0x99e4, 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, 0x655d, 0x1540, 0x2001,
+	0x4000, 0x0430, 0x2001, 0x4007, 0x0418, 0x2001, 0x4006, 0x0400,
+	0x2400, 0x9106, 0x1158, 0xbe14, 0x87ff, 0x1128, 0x86ff, 0x0948,
+	0x080c, 0x99e4, 0x1930, 0x2001, 0x4008, 0x0090, 0x8420, 0x8e70,
+	0x1f04, 0x46cb, 0x85ff, 0x1130, 0x2001, 0x4009, 0x0048, 0x2001,
+	0x0001, 0x0030, 0x080c, 0x6106, 0x1dd0, 0xbb12, 0xba16, 0x9006,
+	0x9005, 0x009e, 0x00de, 0x00ee, 0x0005, 0x81ff, 0x0120, 0x2009,
+	0x0001, 0x0804, 0x3373, 0x080c, 0x479b, 0x1120, 0x2009, 0x0002,
+	0x0804, 0x3373, 0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a, 0x7884,
+	0x9005, 0x0904, 0x3376, 0x9096, 0x00ff, 0x0120, 0x9092, 0x0004,
+	0x1a04, 0x3376, 0x2010, 0x2918, 0x080c, 0x2f5b, 0x1120, 0x2009,
+	0x0003, 0x0804, 0x3373, 0x7007, 0x0003, 0x701f, 0x4750, 0x0005,
+	0xa830, 0x9086, 0x0100, 0x1904, 0x3341, 0x2009, 0x0004, 0x0804,
+	0x3373, 0x7984, 0x080c, 0x99e4, 0x1120, 0x9182, 0x007f, 0x0a04,
+	0x3376, 0x9186, 0x00ff, 0x0904, 0x3376, 0x9182, 0x0800, 0x1a04,
+	0x3376, 0x2001, 0x9000, 0x080c, 0x5255, 0x1904, 0x3373, 0x0804,
+	0x3341, 0xa998, 0x080c, 0x99e4, 0x1118, 0x9182, 0x007f, 0x0280,
+	0x9186, 0x00ff, 0x0168, 0x9182, 0x0800, 0x1250, 0x2001, 0x9000,
+	0x080c, 0x5255, 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, 0x1023, 0x0198, 0x9006, 0xa802,
+	0x7014, 0x9005, 0x1120, 0x2900, 0x7016, 0x701a, 0x0040, 0x7018,
+	0xa802, 0x0086, 0x2040, 0x2900, 0xa006, 0x701a, 0x008e, 0x9085,
+	0x0001, 0x0005, 0x7984, 0x080c, 0x6166, 0x1130, 0x7e88, 0x9684,
+	0x3fff, 0x9082, 0x4000, 0x0208, 0x905e, 0x8bff, 0x0005, 0xa998,
+	0x080c, 0x6166, 0x1130, 0xae9c, 0x9684, 0x3fff, 0x9082, 0x4000,
+	0x0208, 0x905e, 0x8bff, 0x0005, 0xae98, 0x0008, 0x7e84, 0x2608,
+	0x080c, 0x6166, 0x1108, 0x0008, 0x905e, 0x8bff, 0x0005, 0x0016,
+	0x7114, 0x81ff, 0x0128, 0x2148, 0xa904, 0x080c, 0x1055, 0x0cc8,
+	0x7116, 0x711a, 0x001e, 0x0005, 0x2031, 0x0001, 0x0010, 0x2031,
+	0x0000, 0x2061, 0x18ae, 0x2c44, 0xa66a, 0xa17a, 0xa772, 0xa076,
+	0xa28e, 0xa392, 0xa496, 0xa59a, 0x080c, 0x1103, 0x7007, 0x0002,
+	0x701f, 0x3341, 0x0005, 0x00f6, 0x0126, 0x2091, 0x8000, 0x2079,
+	0x0000, 0x2001, 0x18a6, 0x2004, 0x9005, 0x1190, 0x0e04, 0x4818,
+	0x7a36, 0x7833, 0x0012, 0x7a82, 0x7b86, 0x7c8a, 0x2091, 0x4080,
+	0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x11b5, 0x0804, 0x487e,
+	0x0016, 0x0086, 0x0096, 0x00c6, 0x00e6, 0x2071, 0x1894, 0x7044,
+	0x9005, 0x1540, 0x7148, 0x9182, 0x0010, 0x0288, 0x7038, 0x2060,
+	0x080c, 0x1023, 0x0904, 0x4876, 0xa84b, 0x0000, 0x2900, 0x7046,
+	0x2001, 0x0002, 0x9080, 0x1cca, 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, 0x0d65, 0x2060, 0x001e,
+	0x8108, 0x2105, 0x9005, 0xa146, 0x1520, 0x080c, 0x1023, 0x1130,
+	0x8109, 0xa946, 0x7148, 0x8109, 0x714a, 0x00d8, 0x9006, 0xa806,
+	0xa84a, 0xa046, 0x2800, 0xa802, 0x2900, 0xa006, 0x7046, 0x2001,
+	0x0002, 0x9080, 0x1cca, 0x2005, 0xa846, 0x0058, 0x2262, 0x6306,
+	0x640a, 0x00ee, 0x00ce, 0x009e, 0x008e, 0x001e, 0x012e, 0x00fe,
+	0x0005, 0x2c00, 0x9082, 0x001b, 0x0002, 0x48a0, 0x48a0, 0x48a2,
+	0x48a0, 0x48a0, 0x48a0, 0x48a6, 0x48a0, 0x48a0, 0x48a0, 0x48aa,
+	0x48a0, 0x48a0, 0x48a0, 0x48ae, 0x48a0, 0x48a0, 0x48a0, 0x48b2,
+	0x48a0, 0x48a0, 0x48a0, 0x48b6, 0x48a0, 0x48a0, 0x48a0, 0x48bb,
+	0x080c, 0x0d65, 0xa276, 0xa37a, 0xa47e, 0x0898, 0xa286, 0xa38a,
+	0xa48e, 0x0878, 0xa296, 0xa39a, 0xa49e, 0x0858, 0xa2a6, 0xa3aa,
+	0xa4ae, 0x0838, 0xa2b6, 0xa3ba, 0xa4be, 0x0818, 0xa2c6, 0xa3ca,
+	0xa4ce, 0x0804, 0x4879, 0xa2d6, 0xa3da, 0xa4de, 0x0804, 0x4879,
+	0x00e6, 0x2071, 0x1894, 0x7048, 0x9005, 0x0904, 0x4952, 0x0126,
+	0x2091, 0x8000, 0x0e04, 0x4951, 0x00f6, 0x2079, 0x0000, 0x00c6,
+	0x0096, 0x0086, 0x0076, 0x9006, 0x2038, 0x7040, 0x2048, 0x9005,
+	0x0500, 0xa948, 0x2105, 0x0016, 0x908a, 0x0036, 0x1a0c, 0x0d65,
+	0x2060, 0x001e, 0x8108, 0x2105, 0x9005, 0xa94a, 0x1904, 0x4954,
+	0xa804, 0x9005, 0x090c, 0x0d65, 0x7042, 0x2938, 0x2040, 0xa003,
+	0x0000, 0x2001, 0x0002, 0x9080, 0x1cca, 0x2005, 0xa04a, 0x0804,
+	0x4954, 0x703c, 0x2060, 0x2c14, 0x6304, 0x6408, 0x650c, 0x2200,
+	0x7836, 0x7833, 0x0012, 0x7882, 0x2300, 0x7886, 0x2400, 0x788a,
+	0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x11b5,
+	0x87ff, 0x0118, 0x2748, 0x080c, 0x1055, 0x7048, 0x8001, 0x704a,
+	0x9005, 0x1170, 0x7040, 0x2048, 0x9005, 0x0128, 0x080c, 0x1055,
+	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, 0x0d65, 0x2048,
+	0xa800, 0x9005, 0x1de0, 0x2900, 0x7042, 0x2001, 0x0002, 0x9080,
+	0x1cca, 0x2005, 0xa84a, 0x0000, 0x007e, 0x008e, 0x009e, 0x00ce,
+	0x00fe, 0x012e, 0x00ee, 0x0005, 0x2c00, 0x9082, 0x001b, 0x0002,
+	0x4973, 0x4973, 0x4975, 0x4973, 0x4973, 0x4973, 0x497a, 0x4973,
+	0x4973, 0x4973, 0x497f, 0x4973, 0x4973, 0x4973, 0x4984, 0x4973,
+	0x4973, 0x4973, 0x4989, 0x4973, 0x4973, 0x4973, 0x498e, 0x4973,
+	0x4973, 0x4973, 0x4993, 0x080c, 0x0d65, 0xaa74, 0xab78, 0xac7c,
+	0x0804, 0x48ff, 0xaa84, 0xab88, 0xac8c, 0x0804, 0x48ff, 0xaa94,
+	0xab98, 0xac9c, 0x0804, 0x48ff, 0xaaa4, 0xaba8, 0xacac, 0x0804,
+	0x48ff, 0xaab4, 0xabb8, 0xacbc, 0x0804, 0x48ff, 0xaac4, 0xabc8,
+	0xaccc, 0x0804, 0x48ff, 0xaad4, 0xabd8, 0xacdc, 0x0804, 0x48ff,
+	0x0026, 0x080c, 0x529d, 0xd0c4, 0x0120, 0x2011, 0x8014, 0x080c,
+	0x47fb, 0x002e, 0x0005, 0x81ff, 0x1904, 0x3373, 0x0126, 0x2091,
+	0x8000, 0x6030, 0xc08d, 0xc085, 0xc0ac, 0x6032, 0x080c, 0x6f5c,
+	0x1158, 0x080c, 0x725c, 0x080c, 0x5be2, 0x9085, 0x0001, 0x080c,
+	0x6fa3, 0x080c, 0x6e8d, 0x0010, 0x080c, 0x5a9d, 0x012e, 0x0804,
+	0x3341, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x3373, 0x080c,
+	0x52b1, 0x0120, 0x2009, 0x0007, 0x0804, 0x3373, 0x080c, 0x6555,
+	0x0120, 0x2009, 0x0008, 0x0804, 0x3373, 0x0026, 0x2011, 0x0010,
+	0x080c, 0x6581, 0x002e, 0x0120, 0x2009, 0x4009, 0x0804, 0x3373,
+	0x080c, 0x3138, 0x0128, 0x7984, 0x080c, 0x6106, 0x1904, 0x3376,
+	0x080c, 0x47ce, 0x0904, 0x3376, 0x2b00, 0x7026, 0x080c, 0x655d,
+	0x7888, 0x1170, 0x9084, 0x0005, 0x1158, 0x900e, 0x080c, 0x6455,
+	0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d, 0x0804, 0x3341,
+	0x080c, 0x479b, 0x0904, 0x3373, 0x9006, 0xa866, 0xa832, 0xa868,
+	0xc0fd, 0xa86a, 0x080c, 0xb8f0, 0x0904, 0x3373, 0x7888, 0xd094,
+	0x0118, 0xb8c4, 0xc08d, 0xb8c6, 0x7007, 0x0003, 0x701f, 0x4a65,
+	0x0005, 0x2061, 0x1800, 0x080c, 0x52b1, 0x2009, 0x0007, 0x1578,
+	0x080c, 0x6555, 0x0118, 0x2009, 0x0008, 0x0448, 0x080c, 0x3138,
+	0x0120, 0xa998, 0x080c, 0x6106, 0x1530, 0x080c, 0x47cc, 0x0518,
+	0x080c, 0x655d, 0xa89c, 0x1168, 0x9084, 0x0005, 0x1150, 0x900e,
+	0x080c, 0x6455, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d,
+	0x00d0, 0xa868, 0xc0fc, 0xa86a, 0x080c, 0xb8f0, 0x11e0, 0xa89c,
+	0xd094, 0x0118, 0xb8c4, 0xc08d, 0xb8c6, 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, 0x2008, 0x918e,
+	0xdead, 0x1120, 0x2021, 0x4009, 0x0804, 0x3343, 0x9086, 0x0100,
+	0x7024, 0x2058, 0x1110, 0x0804, 0x51fa, 0x900e, 0x080c, 0x6455,
+	0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d, 0x0804, 0x3341,
+	0x080c, 0x52b1, 0x0120, 0x2009, 0x0007, 0x0804, 0x3373, 0x7f84,
+	0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x080c, 0x479b, 0x1120, 0x2009,
+	0x0002, 0x0804, 0x3373, 0x900e, 0x2130, 0x7126, 0x7132, 0xa860,
+	0x20e8, 0x7036, 0xa85c, 0x9080, 0x0005, 0x702a, 0x20a0, 0x080c,
+	0x6166, 0x1904, 0x4b03, 0x080c, 0x655d, 0x0120, 0x080c, 0x6565,
+	0x1904, 0x4b03, 0x080c, 0x6555, 0x1130, 0x080c, 0x6455, 0x1118,
+	0xd79c, 0x0904, 0x4b03, 0xd794, 0x1110, 0xd784, 0x01a8, 0xb8b4,
+	0x20e0, 0xb8b8, 0x9080, 0x0006, 0x2098, 0x3400, 0xd794, 0x0160,
+	0x20a9, 0x0008, 0x4003, 0x2098, 0x20a0, 0x3d00, 0x20e0, 0x20a9,
+	0x0002, 0x080c, 0x45b5, 0x0048, 0x20a9, 0x0004, 0x4003, 0x2098,
+	0x20a0, 0x3d00, 0x20e0, 0x080c, 0x45b5, 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, 0x45a8, 0x9c80, 0x0026, 0x2098,
+	0xb8b4, 0x20e0, 0x20a9, 0x0002, 0x4003, 0xd794, 0x0110, 0x96b0,
+	0x000b, 0x96b0, 0x0005, 0x8108, 0x080c, 0x99e4, 0x0118, 0x9186,
+	0x0800, 0x0040, 0xd78c, 0x0120, 0x9186, 0x0800, 0x0170, 0x0018,
+	0x9186, 0x007e, 0x0150, 0xd794, 0x0118, 0x9686, 0x0020, 0x0010,
+	0x9686, 0x0028, 0x0150, 0x0804, 0x4a9f, 0x86ff, 0x1120, 0x7124,
+	0x810b, 0x0804, 0x3341, 0x7033, 0x0001, 0x7122, 0x7024, 0x9600,
+	0x7026, 0x772e, 0x2061, 0x18ae, 0x2c44, 0xa06b, 0x0000, 0xa67a,
+	0x7034, 0xa072, 0x7028, 0xa076, 0xa28e, 0xa392, 0xa496, 0xa59a,
+	0x080c, 0x1103, 0x7007, 0x0002, 0x701f, 0x4b3f, 0x0005, 0x7030,
+	0x9005, 0x1180, 0x7120, 0x7028, 0x20a0, 0x772c, 0x9036, 0x7034,
+	0x20e8, 0x2061, 0x18ae, 0x2c44, 0xa28c, 0xa390, 0xa494, 0xa598,
+	0x0804, 0x4a9f, 0x7124, 0x810b, 0x0804, 0x3341, 0x2029, 0x007e,
+	0x7984, 0x7a88, 0x7b8c, 0x7c98, 0x9184, 0xff00, 0x8007, 0x90e2,
+	0x0020, 0x0a04, 0x3376, 0x9502, 0x0a04, 0x3376, 0x9184, 0x00ff,
+	0x90e2, 0x0020, 0x0a04, 0x3376, 0x9502, 0x0a04, 0x3376, 0x9284,
+	0xff00, 0x8007, 0x90e2, 0x0020, 0x0a04, 0x3376, 0x9502, 0x0a04,
+	0x3376, 0x9284, 0x00ff, 0x90e2, 0x0020, 0x0a04, 0x3376, 0x9502,
+	0x0a04, 0x3376, 0x9384, 0xff00, 0x8007, 0x90e2, 0x0020, 0x0a04,
+	0x3376, 0x9502, 0x0a04, 0x3376, 0x9384, 0x00ff, 0x90e2, 0x0020,
+	0x0a04, 0x3376, 0x9502, 0x0a04, 0x3376, 0x9484, 0xff00, 0x8007,
+	0x90e2, 0x0020, 0x0a04, 0x3376, 0x9502, 0x0a04, 0x3376, 0x9484,
+	0x00ff, 0x90e2, 0x0020, 0x0a04, 0x3376, 0x9502, 0x0a04, 0x3376,
+	0x2061, 0x1958, 0x6102, 0x6206, 0x630a, 0x640e, 0x0804, 0x3341,
+	0x0006, 0x080c, 0x529d, 0xd0cc, 0x000e, 0x0005, 0x0006, 0x080c,
+	0x52a1, 0xd0bc, 0x000e, 0x0005, 0x6170, 0x7a84, 0x6300, 0x82ff,
+	0x1118, 0x7986, 0x0804, 0x3341, 0x83ff, 0x1904, 0x3376, 0x2001,
+	0xfff0, 0x9200, 0x1a04, 0x3376, 0x2019, 0xffff, 0x6074, 0x9302,
+	0x9200, 0x0a04, 0x3376, 0x7986, 0x6272, 0x0804, 0x3341, 0x080c,
+	0x52b1, 0x1904, 0x3373, 0x7c88, 0x7d84, 0x7e98, 0x7f8c, 0x080c,
+	0x479b, 0x0904, 0x3373, 0x900e, 0x901e, 0x7326, 0x7332, 0xa860,
+	0x20e8, 0x7036, 0xa85c, 0x9080, 0x0003, 0x702a, 0x20a0, 0x91d8,
+	0x1000, 0x2b5c, 0x8bff, 0x0178, 0x080c, 0x655d, 0x0118, 0x080c,
+	0x6565, 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, 0x8276, 0x2208, 0x0804, 0x3341, 0x7033, 0x0001,
+	0x7122, 0x7024, 0x9300, 0x7026, 0x2061, 0x18ae, 0x2c44, 0xa06b,
+	0x0000, 0xa37a, 0x7028, 0xa076, 0x7034, 0xa072, 0xa48e, 0xa592,
+	0xa696, 0xa79a, 0x080c, 0x1103, 0x7007, 0x0002, 0x701f, 0x4c31,
+	0x0005, 0x7030, 0x9005, 0x1178, 0x7120, 0x7028, 0x20a0, 0x901e,
+	0x7034, 0x20e8, 0x2061, 0x18ae, 0x2c44, 0xa48c, 0xa590, 0xa694,
+	0xa798, 0x0804, 0x4bef, 0x7224, 0x900e, 0x2001, 0x0003, 0x080c,
+	0x8276, 0x2208, 0x0804, 0x3341, 0x00f6, 0x00e6, 0x080c, 0x52b1,
+	0x2009, 0x0007, 0x1904, 0x4cc4, 0x2071, 0x1894, 0x745c, 0x84ff,
+	0x2009, 0x000e, 0x1904, 0x4cc4, 0xac9c, 0xad98, 0xaea4, 0xafa0,
+	0x0096, 0x080c, 0x103c, 0x2009, 0x0002, 0x0904, 0x4cc4, 0x2900,
+	0x705e, 0x900e, 0x901e, 0x7356, 0x7362, 0xa860, 0x7066, 0xa85c,
+	0x9080, 0x0003, 0x705a, 0x20a0, 0x91d8, 0x1000, 0x2b5c, 0x8bff,
+	0x0178, 0x080c, 0x655d, 0x0118, 0x080c, 0x6565, 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, 0x8276,
+	0x2208, 0x009e, 0xa897, 0x4000, 0xa99a, 0x715c, 0x81ff, 0x090c,
+	0x0d65, 0x2148, 0x080c, 0x1055, 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, 0x4cd0, 0x000e, 0xa0a2,
+	0x080c, 0x1103, 0x9006, 0x0048, 0x009e, 0xa897, 0x4005, 0xa99a,
+	0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x00ee, 0x00fe, 0x0005,
+	0x00f6, 0xa0a0, 0x904d, 0x090c, 0x0d65, 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, 0x8276, 0xaa9a, 0x715c, 0x81ff,
+	0x090c, 0x0d65, 0x2148, 0x080c, 0x1055, 0x705f, 0x0000, 0xa0a0,
+	0x2048, 0x0126, 0x2091, 0x8000, 0x080c, 0x683f, 0x012e, 0xa09f,
+	0x0000, 0xa0a3, 0x0000, 0x00ee, 0x00fe, 0x0005, 0x91d8, 0x1000,
+	0x2b5c, 0x8bff, 0x0178, 0x080c, 0x655d, 0x0118, 0x080c, 0x6565,
+	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, 0x0d65, 0x2148, 0x080c, 0x1055,
+	0x9006, 0x705e, 0x918d, 0x0001, 0x2008, 0xa0a0, 0x2048, 0x0126,
+	0x2091, 0x8000, 0x080c, 0x683f, 0x012e, 0xa09f, 0x0000, 0xa0a3,
+	0x0000, 0x0070, 0x7063, 0x0001, 0x7152, 0x7054, 0x9300, 0x7056,
+	0xa37a, 0xa48e, 0xa592, 0xa696, 0xa79a, 0x080c, 0x1103, 0x9006,
+	0x00ee, 0x0005, 0x0096, 0xa88c, 0x90be, 0x7000, 0x0148, 0x90be,
+	0x7100, 0x0130, 0x90be, 0x7200, 0x0118, 0x009e, 0x0804, 0x3376,
+	0xa884, 0xa988, 0x080c, 0x23ef, 0x1518, 0x080c, 0x6106, 0x1500,
+	0x7126, 0xbe12, 0xbd16, 0xae7c, 0x080c, 0x479b, 0x01c8, 0x080c,
+	0x479b, 0x01b0, 0x009e, 0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a,
+	0xa823, 0x0000, 0xa804, 0x2048, 0x080c, 0xb86e, 0x1120, 0x2009,
+	0x0003, 0x0804, 0x3373, 0x7007, 0x0003, 0x701f, 0x4d9d, 0x0005,
+	0x009e, 0x2009, 0x0002, 0x0804, 0x3373, 0x7124, 0x080c, 0x30d1,
+	0xa820, 0x9086, 0x8001, 0x1120, 0x2009, 0x0004, 0x0804, 0x3373,
+	0x2900, 0x7022, 0xa804, 0x0096, 0x2048, 0x8906, 0x8006, 0x8007,
+	0x90bc, 0x003f, 0x9084, 0xffc0, 0x009e, 0x9080, 0x0002, 0x0076,
+	0x0006, 0x2098, 0x20a0, 0x27e0, 0x27e8, 0x20a9, 0x002a, 0x080c,
+	0x0fa0, 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, 0x47e7, 0x97c6, 0x7200, 0x11b8, 0x96c2, 0x0054,
+	0x02a0, 0x000e, 0x007e, 0x2061, 0x18ae, 0x2c44, 0xa076, 0xa772,
+	0xa07b, 0x002a, 0xa28e, 0xa392, 0xa496, 0xa59a, 0x080c, 0x1103,
+	0x7007, 0x0002, 0x701f, 0x4df9, 0x0005, 0x000e, 0x007e, 0x0804,
+	0x3376, 0x7020, 0x2048, 0xa804, 0x2048, 0xa804, 0x2048, 0x8906,
+	0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x0002,
+	0x2098, 0x20a0, 0x27e0, 0x27e8, 0x20a9, 0x002a, 0x080c, 0x0fa0,
+	0x2100, 0x2238, 0x2061, 0x18ae, 0x2c44, 0xa28c, 0xa390, 0xa494,
+	0xa598, 0x2009, 0x002a, 0x0804, 0x47e7, 0x81ff, 0x1904, 0x3373,
+	0x798c, 0x2001, 0x194f, 0x2102, 0x080c, 0x47b2, 0x0904, 0x3376,
+	0x080c, 0x655d, 0x0120, 0x080c, 0x6565, 0x1904, 0x3376, 0x080c,
+	0x622d, 0x0904, 0x3373, 0x0126, 0x2091, 0x8000, 0x080c, 0x63c2,
+	0x012e, 0x0904, 0x3373, 0x0804, 0x42e0, 0xa9a0, 0x2001, 0x194f,
+	0xc18d, 0x2102, 0x080c, 0x47bf, 0x01a0, 0x080c, 0x655d, 0x0118,
+	0x080c, 0x6565, 0x1170, 0x080c, 0x622d, 0x2009, 0x0002, 0x0128,
+	0x080c, 0x63c2, 0x1170, 0x2009, 0x0003, 0xa897, 0x4005, 0xa99a,
+	0x0010, 0xa897, 0x4006, 0x900e, 0x9085, 0x0001, 0x2001, 0x0030,
+	0x0005, 0xa897, 0x4000, 0x080c, 0x52a5, 0x0110, 0x9006, 0x0018,
+	0x900e, 0x9085, 0x0001, 0x2001, 0x0000, 0x0005, 0x78a8, 0xd08c,
+	0x1118, 0xd084, 0x0904, 0x4255, 0x080c, 0x47ce, 0x0904, 0x3376,
+	0x080c, 0x479b, 0x1120, 0x2009, 0x0002, 0x0804, 0x3373, 0x080c,
+	0x655d, 0x0130, 0x908e, 0x0004, 0x0118, 0x908e, 0x0005, 0x15a0,
+	0x78a8, 0xd08c, 0x0120, 0xb800, 0xc08c, 0xb802, 0x0028, 0x080c,
+	0x529d, 0xd0b4, 0x0904, 0x428f, 0x7884, 0x908e, 0x007e, 0x0904,
+	0x428f, 0x908e, 0x007f, 0x0904, 0x428f, 0x908e, 0x0080, 0x0904,
+	0x428f, 0xb800, 0xd08c, 0x1904, 0x428f, 0xa867, 0x0000, 0xa868,
+	0xc0fd, 0xa86a, 0x080c, 0xb88d, 0x1120, 0x2009, 0x0003, 0x0804,
+	0x3373, 0x7007, 0x0003, 0x701f, 0x4eb6, 0x0005, 0x080c, 0x47ce,
+	0x0904, 0x3376, 0x0804, 0x428f, 0x080c, 0x3138, 0x0108, 0x0005,
+	0x2009, 0x1833, 0x210c, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804,
+	0x3373, 0x080c, 0x52b1, 0x0120, 0x2009, 0x0007, 0x0804, 0x3373,
+	0x080c, 0x6555, 0x0120, 0x2009, 0x0008, 0x0804, 0x3373, 0xb89c,
+	0xd0a4, 0x1118, 0xd0ac, 0x1904, 0x428f, 0x9006, 0xa866, 0xa832,
+	0xa868, 0xc0fd, 0xa86a, 0x080c, 0xb8f0, 0x1120, 0x2009, 0x0003,
+	0x0804, 0x3373, 0x7007, 0x0003, 0x701f, 0x4eef, 0x0005, 0xa830,
+	0x9086, 0x0100, 0x1120, 0x2009, 0x0004, 0x0804, 0x51fa, 0x080c,
+	0x47ce, 0x0904, 0x3376, 0x0804, 0x4e88, 0x81ff, 0x2009, 0x0001,
+	0x1904, 0x3373, 0x080c, 0x52b1, 0x2009, 0x0007, 0x1904, 0x3373,
+	0x080c, 0x6555, 0x0120, 0x2009, 0x0008, 0x0804, 0x3373, 0x080c,
+	0x47ce, 0x0904, 0x3376, 0x080c, 0x655d, 0x2009, 0x0009, 0x1904,
+	0x3373, 0x080c, 0x479b, 0x2009, 0x0002, 0x0904, 0x3373, 0x9006,
+	0xa866, 0xa832, 0xa868, 0xc0fd, 0xa86a, 0x7988, 0x9194, 0xff00,
+	0x918c, 0x00ff, 0x9006, 0x82ff, 0x1128, 0xc0ed, 0xa952, 0x798c,
+	0xa956, 0x0038, 0x928e, 0x0100, 0x1904, 0x3376, 0xc0e5, 0xa952,
+	0xa956, 0xa83e, 0x080c, 0xbb53, 0x2009, 0x0003, 0x0904, 0x3373,
+	0x7007, 0x0003, 0x701f, 0x4f45, 0x0005, 0xa830, 0x9086, 0x0100,
+	0x2009, 0x0004, 0x0904, 0x3373, 0x0804, 0x3341, 0x7aa8, 0x9284,
+	0xc000, 0x0148, 0xd2ec, 0x01a0, 0x080c, 0x52b1, 0x1188, 0x2009,
+	0x0014, 0x0804, 0x3373, 0xd2dc, 0x1568, 0x81ff, 0x2009, 0x0001,
+	0x1904, 0x3373, 0x080c, 0x52b1, 0x2009, 0x0007, 0x1904, 0x3373,
+	0xd2f4, 0x0130, 0x9284, 0x5000, 0x080c, 0x5278, 0x0804, 0x3341,
+	0xd2fc, 0x0158, 0x080c, 0x47ce, 0x0904, 0x3376, 0x7984, 0x9284,
+	0x9000, 0x080c, 0x5255, 0x0804, 0x3341, 0x080c, 0x47ce, 0x0904,
+	0x3376, 0xb804, 0x9084, 0x00ff, 0x9086, 0x0006, 0x2009, 0x0009,
+	0x1904, 0x502e, 0x080c, 0x479b, 0x2009, 0x0002, 0x0904, 0x502e,
+	0xa85c, 0x9080, 0x001b, 0xaf60, 0x2009, 0x0008, 0x7a8c, 0x7b88,
+	0x7c9c, 0x7d98, 0x080c, 0x47e4, 0x701f, 0x4f9f, 0x0005, 0xa86c,
+	0x9086, 0x0500, 0x1138, 0xa870, 0x9005, 0x1120, 0xa874, 0x9084,
+	0xff00, 0x0110, 0x1904, 0x3376, 0xa866, 0xa832, 0xa868, 0xc0fd,
+	0xa86a, 0x080c, 0x47ce, 0x1110, 0x0804, 0x3376, 0x2009, 0x0043,
+	0x080c, 0xbbbb, 0x2009, 0x0003, 0x0904, 0x502e, 0x7007, 0x0003,
+	0x701f, 0x4fc3, 0x0005, 0xa830, 0x9086, 0x0100, 0x2009, 0x0004,
+	0x0904, 0x502e, 0x7984, 0x7aa8, 0x9284, 0x1000, 0x080c, 0x5255,
+	0x0804, 0x3341, 0x00c6, 0xaab0, 0x9284, 0xc000, 0x0140, 0xd2ec,
+	0x0168, 0x080c, 0x52b1, 0x1150, 0x2009, 0x0014, 0x04f0, 0x2061,
+	0x1800, 0x080c, 0x52b1, 0x2009, 0x0007, 0x15b8, 0xd2f4, 0x0128,
+	0x9284, 0x5000, 0x080c, 0x5278, 0x0050, 0xd2fc, 0x0178, 0x080c,
+	0x47cc, 0x0588, 0xa998, 0x9284, 0x9000, 0x080c, 0x5255, 0xa87b,
+	0x0000, 0xa883, 0x0000, 0xa897, 0x4000, 0x0438, 0x080c, 0x47cc,
+	0x0510, 0x080c, 0x655d, 0x2009, 0x0009, 0x11b8, 0xa8c4, 0x9086,
+	0x0500, 0x11c8, 0xa8c8, 0x9005, 0x11b0, 0xa8cc, 0x9084, 0xff00,
+	0x1190, 0x080c, 0x47cc, 0x1108, 0x0070, 0x2009, 0x004b, 0x080c,
+	0xbbbb, 0x2009, 0x0003, 0x0108, 0x0078, 0x0429, 0x19c0, 0xa897,
+	0x4005, 0xa99a, 0x0010, 0xa897, 0x4006, 0x900e, 0x9085, 0x0001,
+	0x2001, 0x0030, 0x00ce, 0x0005, 0x9006, 0x0ce0, 0x7aa8, 0xd2dc,
+	0x0904, 0x3373, 0x0016, 0x7984, 0x9284, 0x1000, 0xc0fd, 0x080c,
+	0x5255, 0x001e, 0x1904, 0x3373, 0x0804, 0x3341, 0x00f6, 0x2d78,
+	0x0011, 0x00fe, 0x0005, 0xaab0, 0xd2dc, 0x0150, 0x0016, 0xa998,
+	0x9284, 0x1000, 0xc0fd, 0x080c, 0x5255, 0x001e, 0x9085, 0x0001,
+	0x0005, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x3373, 0x080c,
+	0x52b1, 0x0120, 0x2009, 0x0007, 0x0804, 0x3373, 0x7984, 0x7ea8,
+	0x96b4, 0x00ff, 0x080c, 0x6166, 0x1904, 0x3376, 0x9186, 0x007f,
+	0x0138, 0x080c, 0x655d, 0x0120, 0x2009, 0x0009, 0x0804, 0x3373,
+	0x080c, 0x479b, 0x1120, 0x2009, 0x0002, 0x0804, 0x3373, 0xa867,
+	0x0000, 0xa868, 0xc0fd, 0xa86a, 0x2001, 0x0100, 0x8007, 0xa80a,
+	0x080c, 0xb8a7, 0x1120, 0x2009, 0x0003, 0x0804, 0x3373, 0x7007,
+	0x0003, 0x701f, 0x508c, 0x0005, 0xa808, 0x8007, 0x9086, 0x0100,
+	0x1120, 0x2009, 0x0004, 0x0804, 0x3373, 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, 0x47e7, 0x080c, 0x479b, 0x1120, 0x2009, 0x0002,
+	0x0804, 0x3373, 0x7984, 0x9194, 0xff00, 0x918c, 0x00ff, 0x8217,
+	0x82ff, 0x1118, 0x7023, 0x1982, 0x0040, 0x92c6, 0x0001, 0x1118,
+	0x7023, 0x199c, 0x0010, 0x0804, 0x3376, 0x2009, 0x001a, 0x7a8c,
+	0x7b88, 0x7c9c, 0x7d98, 0xa85c, 0x9080, 0x0019, 0xaf60, 0x080c,
+	0x47e4, 0x701f, 0x50dc, 0x0005, 0x2001, 0x182d, 0x2003, 0x0001,
+	0xa85c, 0x9080, 0x0019, 0x2098, 0xa860, 0x20e0, 0x20a9, 0x001a,
+	0x7020, 0x20a0, 0x20e9, 0x0001, 0x4003, 0x0804, 0x3341, 0x080c,
+	0x479b, 0x1120, 0x2009, 0x0002, 0x0804, 0x3373, 0x7984, 0x9194,
+	0xff00, 0x918c, 0x00ff, 0x8217, 0x82ff, 0x1118, 0x2099, 0x1982,
+	0x0040, 0x92c6, 0x0001, 0x1118, 0x2099, 0x199c, 0x0010, 0x0804,
+	0x3376, 0xa85c, 0x9080, 0x0019, 0x20a0, 0xa860, 0x20e8, 0x20a9,
+	0x001a, 0x20e1, 0x0001, 0x4003, 0x2009, 0x001a, 0x7a8c, 0x7b88,
+	0x7c9c, 0x7d98, 0xa85c, 0x9080, 0x0019, 0xaf60, 0x0804, 0x47e7,
+	0x7884, 0x908a, 0x1000, 0x1a04, 0x3376, 0x0126, 0x2091, 0x8000,
+	0x8003, 0x800b, 0x810b, 0x9108, 0x00c6, 0x2061, 0x19d2, 0x6142,
+	0x00ce, 0x012e, 0x0804, 0x3341, 0x00c6, 0x080c, 0x6f5c, 0x1160,
+	0x080c, 0x725c, 0x080c, 0x5be2, 0x9085, 0x0001, 0x080c, 0x6fa3,
+	0x080c, 0x6e8d, 0x080c, 0x0d65, 0x2061, 0x1800, 0x6030, 0xc09d,
+	0x6032, 0x080c, 0x5a9d, 0x00ce, 0x0005, 0x00c6, 0x2001, 0x1800,
+	0x2004, 0x908e, 0x0000, 0x0904, 0x3373, 0x7884, 0x9005, 0x0188,
+	0x7888, 0x2061, 0x196b, 0x2c0c, 0x2062, 0x080c, 0x27bf, 0x01a0,
+	0x080c, 0x27c7, 0x0188, 0x080c, 0x27cf, 0x0170, 0x2162, 0x0804,
+	0x3376, 0x2061, 0x0100, 0x6038, 0x9086, 0x0007, 0x1118, 0x2009,
+	0x0001, 0x0010, 0x2009, 0x0000, 0x7884, 0x9086, 0x0002, 0x1588,
+	0x2061, 0x0100, 0x6028, 0xc09c, 0x602a, 0x080c, 0x9746, 0x0026,
+	0x2011, 0x0003, 0x080c, 0x91a3, 0x2011, 0x0002, 0x080c, 0x91ad,
+	0x002e, 0x080c, 0x9070, 0x0036, 0x901e, 0x080c, 0x90f0, 0x003e,
+	0x080c, 0x9762, 0x60e3, 0x0000, 0x080c, 0xd427, 0x080c, 0xd442,
+	0x9085, 0x0001, 0x080c, 0x6fa3, 0x9006, 0x080c, 0x27f1, 0x2001,
+	0x1800, 0x2003, 0x0004, 0x0026, 0x2011, 0x0008, 0x080c, 0x282b,
+	0x002e, 0x00ce, 0x0804, 0x3341, 0x81ff, 0x0120, 0x2009, 0x0001,
+	0x0804, 0x3373, 0x080c, 0x52b1, 0x0120, 0x2009, 0x0007, 0x0804,
+	0x3373, 0x7984, 0x7ea8, 0x96b4, 0x00ff, 0x080c, 0x6166, 0x1904,
+	0x3376, 0x9186, 0x007f, 0x0138, 0x080c, 0x655d, 0x0120, 0x2009,
+	0x0009, 0x0804, 0x3373, 0x080c, 0x479b, 0x1120, 0x2009, 0x0002,
+	0x0804, 0x3373, 0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a, 0x080c,
+	0xb8aa, 0x1120, 0x2009, 0x0003, 0x0804, 0x3373, 0x7007, 0x0003,
+	0x701f, 0x51e3, 0x0005, 0xa830, 0x9086, 0x0100, 0x1120, 0x2009,
+	0x0004, 0x0804, 0x3373, 0xa8e0, 0xa866, 0xa834, 0x8007, 0x800c,
+	0xa85c, 0x9080, 0x000c, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0xaf60,
+	0x0804, 0x47e7, 0xa898, 0x9086, 0x000d, 0x1904, 0x3373, 0x2021,
+	0x4005, 0x0126, 0x2091, 0x8000, 0x0e04, 0x5207, 0x0010, 0x012e,
+	0x0cc0, 0x7c36, 0x9486, 0x4000, 0x0118, 0x7833, 0x0011, 0x0010,
+	0x7833, 0x0010, 0x7883, 0x4005, 0xa998, 0x7986, 0xa9a4, 0x799a,
+	0xa9a8, 0x799e, 0x080c, 0x47d7, 0x2091, 0x4080, 0x2001, 0x0089,
+	0x2004, 0xd084, 0x190c, 0x11b5, 0x7007, 0x0001, 0x2091, 0x5000,
+	0x700f, 0x0000, 0x012e, 0x0005, 0x0126, 0x2091, 0x8000, 0x00c6,
+	0x2061, 0x19d2, 0x7984, 0x6152, 0x614e, 0x6057, 0x0000, 0x604b,
+	0x0009, 0x7898, 0x606a, 0x789c, 0x6066, 0x7888, 0x6062, 0x788c,
+	0x605e, 0x2001, 0x19e0, 0x2044, 0x2001, 0x19e7, 0xa076, 0xa060,
+	0xa072, 0xa07b, 0x0001, 0xa07f, 0x0002, 0xa06b, 0x0000, 0xa09f,
+	0x0000, 0x00ce, 0x012e, 0x0804, 0x3341, 0x0126, 0x2091, 0x8000,
+	0x00b6, 0x00c6, 0x90e4, 0xc000, 0x0128, 0x0006, 0x080c, 0xb712,
+	0x000e, 0x1198, 0xd0e4, 0x0160, 0x9180, 0x1000, 0x2004, 0x905d,
+	0x0160, 0x080c, 0x5bfc, 0x080c, 0x99e4, 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, 0x5280, 0x015e, 0x012e, 0x0005, 0x2001, 0x1854, 0x2004,
+	0x0005, 0x2001, 0x1873, 0x2004, 0x0005, 0x0006, 0x2001, 0x1810,
+	0x2004, 0xd0d4, 0x000e, 0x0005, 0x2001, 0x180e, 0x2004, 0xd0b4,
+	0x0005, 0x2001, 0x1800, 0x2004, 0x9086, 0x0003, 0x0005, 0x0016,
+	0x00e6, 0x2071, 0x1894, 0x7108, 0x910d, 0x710a, 0x00ee, 0x001e,
+	0x0005, 0x080c, 0x479b, 0x080c, 0x0f2a, 0x2100, 0x2238, 0x7d84,
+	0x7c88, 0x7b8c, 0x7a90, 0x79a4, 0x9182, 0x0081, 0x1a04, 0x3376,
+	0x810c, 0x080c, 0x47e4, 0x701f, 0x52d6, 0x0005, 0x2079, 0x0000,
+	0x7d94, 0x7c98, 0x7ba8, 0x7aac, 0x79a4, 0x810c, 0x2061, 0x18ae,
+	0x2c44, 0xa770, 0xa074, 0x2071, 0x1894, 0x080c, 0x47e7, 0x701f,
+	0x52ea, 0x0005, 0x2061, 0x18ae, 0x2c44, 0xa074, 0x2048, 0x9006,
+	0xa802, 0xa806, 0x0804, 0x3341, 0x0126, 0x0156, 0x0136, 0x0146,
+	0x01c6, 0x01d6, 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x2061, 0x0100,
+	0x2069, 0x0200, 0x2071, 0x1800, 0x6044, 0xd0a4, 0x11e8, 0xd084,
+	0x0118, 0x080c, 0x549d, 0x0068, 0xd08c, 0x0118, 0x080c, 0x53a6,
+	0x0040, 0xd094, 0x0118, 0x080c, 0x5376, 0x0018, 0xd09c, 0x0108,
+	0x0099, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x01de, 0x01ce, 0x014e,
+	0x013e, 0x015e, 0x012e, 0x0005, 0x0016, 0x6128, 0xd19c, 0x1110,
+	0xc19d, 0x612a, 0x001e, 0x0c68, 0x0006, 0x7094, 0x9005, 0x000e,
+	0x0120, 0x7097, 0x0000, 0x708f, 0x0000, 0x624c, 0x9286, 0xf0f0,
+	0x1150, 0x6048, 0x9086, 0xf0f0, 0x0130, 0x624a, 0x6043, 0x0090,
+	0x6043, 0x0010, 0x0490, 0x9294, 0xff00, 0x9296, 0xf700, 0x0178,
+	0x7138, 0xd1a4, 0x1160, 0x6240, 0x9295, 0x0100, 0x6242, 0x9294,
+	0x0010, 0x0128, 0x2009, 0x00f7, 0x080c, 0x5b5e, 0x00f0, 0x6040,
+	0x9084, 0x0010, 0x9085, 0x0140, 0x6042, 0x6043, 0x0000, 0x7083,
+	0x0000, 0x709f, 0x0001, 0x70c3, 0x0000, 0x70db, 0x0000, 0x2009,
+	0x1d80, 0x200b, 0x0000, 0x7093, 0x0000, 0x7087, 0x000f, 0x2009,
+	0x000f, 0x2011, 0x5a40, 0x080c, 0x807a, 0x0005, 0x2001, 0x1875,
+	0x2004, 0xd08c, 0x0110, 0x705b, 0xffff, 0x7084, 0x9005, 0x1528,
+	0x2011, 0x5a40, 0x080c, 0x7fbb, 0x6040, 0x9094, 0x0010, 0x9285,
+	0x0020, 0x6042, 0x20a9, 0x00c8, 0x6044, 0xd08c, 0x1168, 0x1f04,
+	0x538c, 0x6242, 0x7097, 0x0000, 0x6040, 0x9094, 0x0010, 0x9285,
+	0x0080, 0x6042, 0x6242, 0x0048, 0x6242, 0x7097, 0x0000, 0x708b,
+	0x0000, 0x9006, 0x080c, 0x5be7, 0x0000, 0x0005, 0x7088, 0x908a,
+	0x0003, 0x1a0c, 0x0d65, 0x000b, 0x0005, 0x53b0, 0x5401, 0x549c,
+	0x00f6, 0x0016, 0x6900, 0x918c, 0x0800, 0x708b, 0x0001, 0x2001,
+	0x015d, 0x2003, 0x0000, 0x6803, 0x00fc, 0x20a9, 0x0004, 0x6800,
+	0x9084, 0x00fc, 0x0120, 0x1f04, 0x53bf, 0x080c, 0x0d65, 0x68a0,
+	0x68a2, 0x689c, 0x689e, 0x6898, 0x689a, 0xa001, 0x918d, 0x1600,
+	0x6902, 0x001e, 0x6837, 0x0020, 0x080c, 0x5bc3, 0x2079, 0x1d00,
+	0x7833, 0x1101, 0x7837, 0x0000, 0x20e1, 0x0001, 0x2099, 0x1805,
+	0x20e9, 0x0001, 0x20a1, 0x1d0e, 0x20a9, 0x0004, 0x4003, 0x080c,
+	0x9678, 0x20e1, 0x0001, 0x2099, 0x1d00, 0x20e9, 0x0000, 0x20a1,
+	0x0240, 0x20a9, 0x0014, 0x4003, 0x60c3, 0x000c, 0x600f, 0x0000,
+	0x080c, 0x5a71, 0x00fe, 0x9006, 0x708e, 0x6043, 0x0008, 0x6042,
+	0x0005, 0x00f6, 0x708c, 0x708f, 0x0000, 0x9025, 0x0904, 0x5479,
+	0x6020, 0xd0b4, 0x1904, 0x5477, 0x719c, 0x81ff, 0x0904, 0x5465,
+	0x9486, 0x000c, 0x1904, 0x5472, 0x9480, 0x0018, 0x8004, 0x20a8,
+	0x080c, 0x5bbc, 0x2011, 0x0260, 0x2019, 0x1d00, 0x220c, 0x2304,
+	0x9106, 0x11e8, 0x8210, 0x8318, 0x1f04, 0x541e, 0x6043, 0x0004,
+	0x2061, 0x0140, 0x605b, 0xbc94, 0x605f, 0xf0f0, 0x2061, 0x0100,
+	0x6043, 0x0006, 0x708b, 0x0002, 0x7097, 0x0002, 0x2009, 0x07d0,
+	0x2011, 0x5a47, 0x080c, 0x807a, 0x080c, 0x5bc3, 0x04c0, 0x080c,
+	0x5bbc, 0x2079, 0x0260, 0x7930, 0x918e, 0x1101, 0x1558, 0x7834,
+	0x9005, 0x1540, 0x7900, 0x918c, 0x00ff, 0x1118, 0x7804, 0x9005,
+	0x0190, 0x080c, 0x5bbc, 0x2011, 0x026e, 0x2019, 0x1805, 0x20a9,
+	0x0004, 0x220c, 0x2304, 0x9102, 0x0230, 0x11a0, 0x8210, 0x8318,
+	0x1f04, 0x5459, 0x0078, 0x709f, 0x0000, 0x080c, 0x5bbc, 0x20e1,
+	0x0000, 0x2099, 0x0260, 0x20e9, 0x0001, 0x20a1, 0x1d00, 0x20a9,
+	0x0014, 0x4003, 0x6043, 0x0008, 0x6043, 0x0000, 0x0010, 0x00fe,
+	0x0005, 0x6040, 0x9085, 0x0100, 0x6042, 0x6020, 0xd0b4, 0x1db8,
+	0x080c, 0x9678, 0x20e1, 0x0001, 0x2099, 0x1d00, 0x20e9, 0x0000,
+	0x20a1, 0x0240, 0x20a9, 0x0014, 0x4003, 0x60c3, 0x000c, 0x2011,
+	0x19c3, 0x2013, 0x0000, 0x708f, 0x0000, 0x60a3, 0x0056, 0x60a7,
+	0x9575, 0x080c, 0x8e14, 0x08d8, 0x0005, 0x7094, 0x908a, 0x001d,
+	0x1a0c, 0x0d65, 0x000b, 0x0005, 0x54ce, 0x54e1, 0x550a, 0x552a,
+	0x5550, 0x557f, 0x55a5, 0x55dd, 0x5603, 0x5631, 0x566c, 0x56a4,
+	0x56c2, 0x56ed, 0x570f, 0x572a, 0x5734, 0x5768, 0x578e, 0x57bd,
+	0x57e3, 0x581b, 0x585f, 0x589c, 0x58bd, 0x5916, 0x5938, 0x5966,
+	0x5966, 0x00c6, 0x2061, 0x1800, 0x6003, 0x0007, 0x2061, 0x0100,
+	0x6004, 0x9084, 0xfff9, 0x6006, 0x00ce, 0x0005, 0x2061, 0x0140,
+	0x605b, 0xbc94, 0x605f, 0xf0f0, 0x2061, 0x0100, 0x6043, 0x0002,
+	0x7097, 0x0001, 0x2009, 0x07d0, 0x2011, 0x5a47, 0x080c, 0x807a,
+	0x0005, 0x00f6, 0x708c, 0x9086, 0x0014, 0x1510, 0x6042, 0x6020,
+	0xd0b4, 0x11f0, 0x080c, 0x5bbc, 0x2079, 0x0260, 0x7a30, 0x9296,
+	0x1102, 0x11a0, 0x7834, 0x9005, 0x1188, 0x7a38, 0xd2fc, 0x0128,
+	0x70c0, 0x9005, 0x1110, 0x70c3, 0x0001, 0x2011, 0x5a47, 0x080c,
+	0x7fbb, 0x7097, 0x0010, 0x080c, 0x5734, 0x0010, 0x708f, 0x0000,
+	0x00fe, 0x0005, 0x00f6, 0x7097, 0x0003, 0x6043, 0x0004, 0x2011,
+	0x5a47, 0x080c, 0x7fbb, 0x080c, 0x5b40, 0x2079, 0x0240, 0x7833,
+	0x1102, 0x7837, 0x0000, 0x20a9, 0x0008, 0x9f88, 0x000e, 0x200b,
+	0x0000, 0x8108, 0x1f04, 0x551f, 0x60c3, 0x0014, 0x080c, 0x5a71,
+	0x00fe, 0x0005, 0x00f6, 0x708c, 0x9005, 0x0500, 0x2011, 0x5a47,
+	0x080c, 0x7fbb, 0x9086, 0x0014, 0x11b8, 0x080c, 0x5bbc, 0x2079,
+	0x0260, 0x7a30, 0x9296, 0x1102, 0x1178, 0x7834, 0x9005, 0x1160,
+	0x7a38, 0xd2fc, 0x0128, 0x70c0, 0x9005, 0x1110, 0x70c3, 0x0001,
+	0x7097, 0x0004, 0x0029, 0x0010, 0x080c, 0x5b98, 0x00fe, 0x0005,
+	0x00f6, 0x7097, 0x0005, 0x080c, 0x5b40, 0x2079, 0x0240, 0x7833,
+	0x1103, 0x7837, 0x0000, 0x080c, 0x5bbc, 0x080c, 0x5b9f, 0x1170,
+	0x7080, 0x9005, 0x1158, 0x7158, 0x9186, 0xffff, 0x0138, 0x2011,
+	0x0008, 0x080c, 0x59f4, 0x0168, 0x080c, 0x5b75, 0x20a9, 0x0008,
+	0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9, 0x0000, 0x20a1, 0x024e,
+	0x4003, 0x60c3, 0x0014, 0x080c, 0x5a71, 0x00fe, 0x0005, 0x00f6,
+	0x708c, 0x9005, 0x0500, 0x2011, 0x5a47, 0x080c, 0x7fbb, 0x9086,
+	0x0014, 0x11b8, 0x080c, 0x5bbc, 0x2079, 0x0260, 0x7a30, 0x9296,
+	0x1103, 0x1178, 0x7834, 0x9005, 0x1160, 0x7a38, 0xd2fc, 0x0128,
+	0x70c0, 0x9005, 0x1110, 0x70c3, 0x0001, 0x7097, 0x0006, 0x0029,
+	0x0010, 0x080c, 0x5b98, 0x00fe, 0x0005, 0x00f6, 0x7097, 0x0007,
+	0x080c, 0x5b40, 0x2079, 0x0240, 0x7833, 0x1104, 0x7837, 0x0000,
+	0x080c, 0x5bbc, 0x080c, 0x5b9f, 0x11b8, 0x7080, 0x9005, 0x11a0,
+	0x7160, 0x9186, 0xffff, 0x0180, 0x9180, 0x3142, 0x200d, 0x918c,
+	0xff00, 0x810f, 0x2011, 0x0008, 0x080c, 0x59f4, 0x0180, 0x080c,
+	0x4bb6, 0x0110, 0x080c, 0x2458, 0x20a9, 0x0008, 0x20e1, 0x0000,
+	0x2099, 0x026e, 0x20e9, 0x0000, 0x20a1, 0x024e, 0x4003, 0x60c3,
+	0x0014, 0x080c, 0x5a71, 0x00fe, 0x0005, 0x00f6, 0x708c, 0x9005,
+	0x0500, 0x2011, 0x5a47, 0x080c, 0x7fbb, 0x9086, 0x0014, 0x11b8,
+	0x080c, 0x5bbc, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1104, 0x1178,
+	0x7834, 0x9005, 0x1160, 0x7a38, 0xd2fc, 0x0128, 0x70c0, 0x9005,
+	0x1110, 0x70c3, 0x0001, 0x7097, 0x0008, 0x0029, 0x0010, 0x080c,
+	0x5b98, 0x00fe, 0x0005, 0x00f6, 0x7097, 0x0009, 0x080c, 0x5b40,
+	0x2079, 0x0240, 0x7833, 0x1105, 0x7837, 0x0100, 0x080c, 0x5b9f,
+	0x1150, 0x7080, 0x9005, 0x1138, 0x080c, 0x5967, 0x1188, 0x9085,
+	0x0001, 0x080c, 0x2458, 0x20a9, 0x0008, 0x080c, 0x5bbc, 0x20e1,
+	0x0000, 0x2099, 0x026e, 0x20e9, 0x0000, 0x20a1, 0x024e, 0x4003,
+	0x60c3, 0x0014, 0x080c, 0x5a71, 0x0010, 0x080c, 0x54c1, 0x00fe,
+	0x0005, 0x00f6, 0x708c, 0x9005, 0x05a8, 0x2011, 0x5a47, 0x080c,
+	0x7fbb, 0x9086, 0x0014, 0x1560, 0x080c, 0x5bbc, 0x2079, 0x0260,
+	0x7a30, 0x9296, 0x1105, 0x1520, 0x7834, 0x9084, 0x0100, 0x2011,
+	0x0100, 0x921e, 0x1160, 0x7a38, 0xd2fc, 0x0128, 0x70c0, 0x9005,
+	0x1110, 0x70c3, 0x0001, 0x7097, 0x000a, 0x00b1, 0x0098, 0x9005,
+	0x1178, 0x7a38, 0xd2fc, 0x0128, 0x70c0, 0x9005, 0x1110, 0x70c3,
+	0x0001, 0x7093, 0x0000, 0x7097, 0x000e, 0x080c, 0x570f, 0x0010,
+	0x080c, 0x5b98, 0x00fe, 0x0005, 0x00f6, 0x7097, 0x000b, 0x2011,
+	0x1d0e, 0x20e9, 0x0001, 0x22a0, 0x20a9, 0x0040, 0x2019, 0xffff,
+	0x4304, 0x080c, 0x5b40, 0x2079, 0x0240, 0x7833, 0x1106, 0x7837,
+	0x0000, 0x080c, 0x5b9f, 0x0118, 0x2013, 0x0000, 0x0020, 0x705c,
+	0x9085, 0x0100, 0x2012, 0x20a9, 0x0040, 0x2009, 0x024e, 0x2011,
+	0x1d0e, 0x220e, 0x8210, 0x8108, 0x9186, 0x0260, 0x1128, 0x6810,
+	0x8000, 0x6812, 0x2009, 0x0240, 0x1f04, 0x5691, 0x60c3, 0x0084,
+	0x080c, 0x5a71, 0x00fe, 0x0005, 0x00f6, 0x708c, 0x9005, 0x01c0,
+	0x2011, 0x5a47, 0x080c, 0x7fbb, 0x9086, 0x0084, 0x1178, 0x080c,
+	0x5bbc, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1106, 0x1138, 0x7834,
+	0x9005, 0x1120, 0x7097, 0x000c, 0x0029, 0x0010, 0x080c, 0x5b98,
+	0x00fe, 0x0005, 0x00f6, 0x7097, 0x000d, 0x080c, 0x5b40, 0x2079,
+	0x0240, 0x7833, 0x1107, 0x7837, 0x0000, 0x080c, 0x5bbc, 0x20a9,
+	0x0040, 0x2011, 0x026e, 0x2009, 0x024e, 0x220e, 0x8210, 0x8108,
+	0x9186, 0x0260, 0x1150, 0x6810, 0x8000, 0x6812, 0x2009, 0x0240,
+	0x6814, 0x8000, 0x6816, 0x2011, 0x0260, 0x1f04, 0x56d5, 0x60c3,
+	0x0084, 0x080c, 0x5a71, 0x00fe, 0x0005, 0x00f6, 0x708c, 0x9005,
+	0x01e0, 0x2011, 0x5a47, 0x080c, 0x7fbb, 0x9086, 0x0084, 0x1198,
+	0x080c, 0x5bbc, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1107, 0x1158,
+	0x7834, 0x9005, 0x1140, 0x7093, 0x0001, 0x080c, 0x5b12, 0x7097,
+	0x000e, 0x0029, 0x0010, 0x080c, 0x5b98, 0x00fe, 0x0005, 0x918d,
+	0x0001, 0x080c, 0x5be7, 0x7097, 0x000f, 0x708f, 0x0000, 0x2061,
+	0x0140, 0x605b, 0xbc85, 0x605f, 0xb5b5, 0x2061, 0x0100, 0x6043,
+	0x0005, 0x6043, 0x0004, 0x2009, 0x07d0, 0x2011, 0x5a47, 0x080c,
+	0x7faf, 0x0005, 0x708c, 0x9005, 0x0130, 0x2011, 0x5a47, 0x080c,
+	0x7fbb, 0x7097, 0x0000, 0x0005, 0x7097, 0x0011, 0x080c, 0x9678,
+	0x080c, 0x5bbc, 0x20e1, 0x0000, 0x2099, 0x0260, 0x20e9, 0x0000,
+	0x20a1, 0x0240, 0x748c, 0x9480, 0x0018, 0x9080, 0x0007, 0x9084,
+	0x03f8, 0x8004, 0x20a8, 0x4003, 0x080c, 0x5b9f, 0x11a0, 0x7178,
+	0x81ff, 0x0188, 0x900e, 0x707c, 0x9084, 0x00ff, 0x0160, 0x080c,
+	0x23ef, 0x9186, 0x007e, 0x0138, 0x9186, 0x0080, 0x0120, 0x2011,
+	0x0008, 0x080c, 0x59f4, 0x60c3, 0x0014, 0x080c, 0x5a71, 0x0005,
+	0x00f6, 0x708c, 0x9005, 0x0500, 0x2011, 0x5a47, 0x080c, 0x7fbb,
+	0x9086, 0x0014, 0x11b8, 0x080c, 0x5bbc, 0x2079, 0x0260, 0x7a30,
+	0x9296, 0x1103, 0x1178, 0x7834, 0x9005, 0x1160, 0x7a38, 0xd2fc,
+	0x0128, 0x70c0, 0x9005, 0x1110, 0x70c3, 0x0001, 0x7097, 0x0012,
+	0x0029, 0x0010, 0x708f, 0x0000, 0x00fe, 0x0005, 0x00f6, 0x7097,
+	0x0013, 0x080c, 0x5b4e, 0x2079, 0x0240, 0x7833, 0x1103, 0x7837,
+	0x0000, 0x080c, 0x5bbc, 0x080c, 0x5b9f, 0x1170, 0x7080, 0x9005,
+	0x1158, 0x7158, 0x9186, 0xffff, 0x0138, 0x2011, 0x0008, 0x080c,
+	0x59f4, 0x0168, 0x080c, 0x5b75, 0x20a9, 0x0008, 0x20e1, 0x0000,
+	0x2099, 0x026e, 0x20e9, 0x0000, 0x20a1, 0x024e, 0x4003, 0x60c3,
+	0x0014, 0x080c, 0x5a71, 0x00fe, 0x0005, 0x00f6, 0x708c, 0x9005,
+	0x0500, 0x2011, 0x5a47, 0x080c, 0x7fbb, 0x9086, 0x0014, 0x11b8,
+	0x080c, 0x5bbc, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1104, 0x1178,
+	0x7834, 0x9005, 0x1160, 0x7a38, 0xd2fc, 0x0128, 0x70c0, 0x9005,
+	0x1110, 0x70c3, 0x0001, 0x7097, 0x0014, 0x0029, 0x0010, 0x708f,
+	0x0000, 0x00fe, 0x0005, 0x00f6, 0x7097, 0x0015, 0x080c, 0x5b4e,
+	0x2079, 0x0240, 0x7833, 0x1104, 0x7837, 0x0000, 0x080c, 0x5bbc,
+	0x080c, 0x5b9f, 0x11b8, 0x7080, 0x9005, 0x11a0, 0x7160, 0x9186,
+	0xffff, 0x0180, 0x9180, 0x3142, 0x200d, 0x918c, 0xff00, 0x810f,
+	0x2011, 0x0008, 0x080c, 0x59f4, 0x0180, 0x080c, 0x4bb6, 0x0110,
+	0x080c, 0x2458, 0x20a9, 0x0008, 0x20e1, 0x0000, 0x2099, 0x026e,
+	0x20e9, 0x0000, 0x20a1, 0x024e, 0x4003, 0x60c3, 0x0014, 0x080c,
+	0x5a71, 0x00fe, 0x0005, 0x00f6, 0x708c, 0x9005, 0x05f0, 0x2011,
+	0x5a47, 0x080c, 0x7fbb, 0x9086, 0x0014, 0x15a8, 0x080c, 0x5bbc,
+	0x2079, 0x0260, 0x7a30, 0x9296, 0x1105, 0x1568, 0x7834, 0x9084,
+	0x0100, 0x2011, 0x0100, 0x921e, 0x1168, 0x9085, 0x0001, 0x080c,
+	0x5be7, 0x7a38, 0xd2fc, 0x0128, 0x70c0, 0x9005, 0x1110, 0x70c3,
+	0x0001, 0x0080, 0x9005, 0x11b8, 0x7a38, 0xd2fc, 0x0128, 0x70c0,
+	0x9005, 0x1110, 0x70c3, 0x0001, 0x9085, 0x0001, 0x080c, 0x5be7,
+	0x7093, 0x0000, 0x7a38, 0xd2f4, 0x0110, 0x70db, 0x0008, 0x7097,
+	0x0016, 0x0029, 0x0010, 0x708f, 0x0000, 0x00fe, 0x0005, 0x080c,
+	0x9678, 0x080c, 0x5bbc, 0x20e1, 0x0000, 0x2099, 0x0260, 0x20e9,
+	0x0000, 0x20a1, 0x0240, 0x20a9, 0x000e, 0x4003, 0x2011, 0x026d,
+	0x2204, 0x9084, 0x0100, 0x2011, 0x024d, 0x2012, 0x2011, 0x026e,
+	0x7097, 0x0017, 0x080c, 0x5b9f, 0x1150, 0x7080, 0x9005, 0x1138,
+	0x080c, 0x5967, 0x1188, 0x9085, 0x0001, 0x080c, 0x2458, 0x20a9,
+	0x0008, 0x080c, 0x5bbc, 0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9,
+	0x0000, 0x20a1, 0x024e, 0x4003, 0x60c3, 0x0014, 0x080c, 0x5a71,
+	0x0010, 0x080c, 0x54c1, 0x0005, 0x00f6, 0x708c, 0x9005, 0x01d8,
+	0x2011, 0x5a47, 0x080c, 0x7fbb, 0x9086, 0x0084, 0x1190, 0x080c,
+	0x5bbc, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1106, 0x1150, 0x7834,
+	0x9005, 0x1138, 0x9006, 0x080c, 0x5be7, 0x7097, 0x0018, 0x0029,
+	0x0010, 0x708f, 0x0000, 0x00fe, 0x0005, 0x00f6, 0x7097, 0x0019,
+	0x080c, 0x5b4e, 0x2079, 0x0240, 0x7833, 0x1106, 0x7837, 0x0000,
+	0x080c, 0x5bbc, 0x2009, 0x026e, 0x2039, 0x1d0e, 0x20a9, 0x0040,
+	0x213e, 0x8738, 0x8108, 0x9186, 0x0280, 0x1128, 0x6814, 0x8000,
+	0x6816, 0x2009, 0x0260, 0x1f04, 0x58d0, 0x2039, 0x1d0e, 0x080c,
+	0x5b9f, 0x11e8, 0x2728, 0x2514, 0x8207, 0x9084, 0x00ff, 0x8000,
+	0x2018, 0x9294, 0x00ff, 0x8007, 0x9205, 0x202a, 0x705c, 0x2310,
+	0x8214, 0x92a0, 0x1d0e, 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, 0x5903,
+	0x60c3, 0x0084, 0x080c, 0x5a71, 0x00fe, 0x0005, 0x00f6, 0x708c,
+	0x9005, 0x01e0, 0x2011, 0x5a47, 0x080c, 0x7fbb, 0x9086, 0x0084,
+	0x1198, 0x080c, 0x5bbc, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1107,
+	0x1158, 0x7834, 0x9005, 0x1140, 0x7093, 0x0001, 0x080c, 0x5b12,
+	0x7097, 0x001a, 0x0029, 0x0010, 0x708f, 0x0000, 0x00fe, 0x0005,
+	0x9085, 0x0001, 0x080c, 0x5be7, 0x7097, 0x001b, 0x080c, 0x9678,
+	0x080c, 0x5bbc, 0x2011, 0x0260, 0x2009, 0x0240, 0x748c, 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,
+	0x594f, 0x60c3, 0x0084, 0x080c, 0x5a71, 0x0005, 0x0005, 0x0086,
+	0x0096, 0x2029, 0x1854, 0x252c, 0x20a9, 0x0008, 0x2041, 0x1d0e,
+	0x20e9, 0x0001, 0x28a0, 0x080c, 0x5bbc, 0x20e1, 0x0000, 0x2099,
+	0x026e, 0x4003, 0x20a9, 0x0008, 0x2011, 0x0007, 0xd5d4, 0x0108,
+	0x9016, 0x2800, 0x9200, 0x200c, 0x91a6, 0xffff, 0x1148, 0xd5d4,
+	0x0110, 0x8210, 0x0008, 0x8211, 0x1f04, 0x5981, 0x0804, 0x59f0,
+	0x82ff, 0x1160, 0xd5d4, 0x0120, 0x91a6, 0x3fff, 0x0d90, 0x0020,
+	0x91a6, 0x3fff, 0x0904, 0x59f0, 0x918d, 0xc000, 0x20a9, 0x0010,
+	0x2019, 0x0001, 0xd5d4, 0x0110, 0x2019, 0x0010, 0x2120, 0xd5d4,
+	0x0110, 0x8423, 0x0008, 0x8424, 0x1240, 0xd5d4, 0x0110, 0x8319,
+	0x0008, 0x8318, 0x1f04, 0x59a7, 0x04d8, 0x23a8, 0x2021, 0x0001,
+	0x8426, 0x8425, 0x1f04, 0x59b9, 0x2328, 0x8529, 0x92be, 0x0007,
+	0x0158, 0x0006, 0x2039, 0x0007, 0x2200, 0x973a, 0x000e, 0x27a8,
+	0x95a8, 0x0010, 0x1f04, 0x59c8, 0x755a, 0x95c8, 0x3142, 0x292d,
+	0x95ac, 0x00ff, 0x757e, 0x6532, 0x6536, 0x0016, 0x2508, 0x080c,
+	0x2438, 0x001e, 0x60e7, 0x0000, 0x65ea, 0x2018, 0x2304, 0x9405,
+	0x201a, 0x7083, 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, 0x715a, 0x91a0, 0x3142, 0x242d, 0x95ac, 0x00ff,
+	0x757e, 0x6532, 0x6536, 0x0016, 0x2508, 0x080c, 0x2438, 0x001e,
+	0x60e7, 0x0000, 0x65ea, 0x7083, 0x0001, 0x9084, 0x0000, 0x0005,
+	0x00e6, 0x2071, 0x1800, 0x7087, 0x0000, 0x00ee, 0x0005, 0x00e6,
+	0x00f6, 0x2079, 0x0100, 0x2071, 0x0140, 0x080c, 0x5b01, 0x080c,
+	0x8e21, 0x7004, 0x9084, 0x4000, 0x0110, 0x080c, 0x2801, 0x0126,
+	0x2091, 0x8000, 0x2071, 0x1825, 0x2073, 0x0000, 0x7840, 0x0026,
+	0x0016, 0x2009, 0x00f7, 0x080c, 0x5b5e, 0x001e, 0x9094, 0x0010,
+	0x9285, 0x0080, 0x7842, 0x7a42, 0x002e, 0x012e, 0x00fe, 0x00ee,
+	0x0005, 0x0126, 0x2091, 0x8000, 0x080c, 0x2760, 0x0228, 0x2011,
+	0x0101, 0x2204, 0xc0c5, 0x2012, 0x2011, 0x19c3, 0x2013, 0x0000,
+	0x708f, 0x0000, 0x012e, 0x60a3, 0x0056, 0x60a7, 0x9575, 0x080c,
+	0x8e14, 0x6144, 0xd184, 0x0120, 0x7194, 0x918d, 0x2000, 0x0018,
+	0x7188, 0x918d, 0x1000, 0x2011, 0x1968, 0x2112, 0x2009, 0x07d0,
+	0x2011, 0x5a47, 0x080c, 0x807a, 0x0005, 0x0016, 0x0026, 0x00c6,
+	0x0126, 0x2091, 0x8000, 0x080c, 0x9746, 0x080c, 0x99eb, 0x080c,
+	0x9762, 0x2009, 0x00f7, 0x080c, 0x5b5e, 0x2061, 0x19d2, 0x900e,
+	0x611a, 0x611e, 0x6172, 0x6176, 0x2061, 0x1800, 0x6003, 0x0001,
+	0x2061, 0x0100, 0x6043, 0x0090, 0x6043, 0x0010, 0x2009, 0x1968,
+	0x200b, 0x0000, 0x2009, 0x002d, 0x2011, 0x5acd, 0x080c, 0x7faf,
+	0x012e, 0x00ce, 0x002e, 0x001e, 0x0005, 0x00e6, 0x0006, 0x0126,
+	0x2091, 0x8000, 0x0471, 0x2071, 0x0100, 0x080c, 0x8e21, 0x2071,
+	0x0140, 0x7004, 0x9084, 0x4000, 0x0110, 0x080c, 0x2801, 0x080c,
+	0x6f64, 0x0188, 0x080c, 0x6f7f, 0x1170, 0x080c, 0x7266, 0x0016,
+	0x080c, 0x2507, 0x2001, 0x193e, 0x2102, 0x001e, 0x080c, 0x7261,
+	0x080c, 0x6e8d, 0x0050, 0x2009, 0x0001, 0x080c, 0x27dd, 0x2001,
+	0x0001, 0x080c, 0x2394, 0x080c, 0x5a9d, 0x012e, 0x000e, 0x00ee,
+	0x0005, 0x2001, 0x180e, 0x2004, 0xd0bc, 0x0158, 0x0026, 0x0036,
+	0x2011, 0x8017, 0x2001, 0x1968, 0x201c, 0x080c, 0x47fb, 0x003e,
+	0x002e, 0x0005, 0x20a9, 0x0012, 0x20e9, 0x0001, 0x20a1, 0x1d80,
+	0x080c, 0x5bbc, 0x20e9, 0x0000, 0x2099, 0x026e, 0x0099, 0x20a9,
+	0x0020, 0x080c, 0x5bb6, 0x2099, 0x0260, 0x20a1, 0x1d92, 0x0051,
+	0x20a9, 0x000e, 0x080c, 0x5bb9, 0x2099, 0x0260, 0x20a1, 0x1db2,
+	0x0009, 0x0005, 0x0016, 0x0026, 0x3410, 0x3308, 0x2104, 0x8007,
+	0x2012, 0x8108, 0x8210, 0x1f04, 0x5b36, 0x002e, 0x001e, 0x0005,
+	0x080c, 0x9678, 0x20e1, 0x0001, 0x2099, 0x1d00, 0x20e9, 0x0000,
+	0x20a1, 0x0240, 0x20a9, 0x000c, 0x4003, 0x0005, 0x080c, 0x9678,
+	0x080c, 0x5bbc, 0x20e1, 0x0000, 0x2099, 0x0260, 0x20e9, 0x0000,
+	0x20a1, 0x0240, 0x20a9, 0x000c, 0x4003, 0x0005, 0x00c6, 0x0006,
+	0x2061, 0x0100, 0x810f, 0x2001, 0x1833, 0x2004, 0x9005, 0x1138,
+	0x2001, 0x1817, 0x2004, 0x9084, 0x00ff, 0x9105, 0x0010, 0x9185,
+	0x00f7, 0x604a, 0x000e, 0x00ce, 0x0005, 0x0016, 0x0046, 0x080c,
+	0x6559, 0x0158, 0x9006, 0x2020, 0x2009, 0x002a, 0x080c, 0xd0ce,
+	0x2001, 0x180c, 0x200c, 0xc195, 0x2102, 0x2019, 0x002a, 0x900e,
+	0x080c, 0x2f80, 0x080c, 0xbdd7, 0x0140, 0x0036, 0x2019, 0xffff,
+	0x2021, 0x0007, 0x080c, 0x4998, 0x003e, 0x004e, 0x001e, 0x0005,
+	0x080c, 0x5a9d, 0x7097, 0x0000, 0x708f, 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, 0x1d00, 0x4004, 0x2079,
+	0x1d00, 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, 0x5bf6, 0x015e, 0x0005, 0x00d6, 0x0036, 0x0156, 0x0136,
+	0x0146, 0x2069, 0x1853, 0x9006, 0xb802, 0xb8c6, 0xb807, 0x0707,
+	0xb80a, 0xb80e, 0xb812, 0x9198, 0x3142, 0x231d, 0x939c, 0x00ff,
+	0xbb16, 0x0016, 0x0026, 0xb886, 0x080c, 0x99e4, 0x1120, 0x9192,
+	0x007e, 0x1208, 0xbb86, 0x20a9, 0x0004, 0xb8b4, 0x20e8, 0xb9b8,
+	0x9198, 0x0006, 0x9006, 0x23a0, 0x4004, 0x20a9, 0x0004, 0x9198,
+	0x000a, 0x23a0, 0x4004, 0x002e, 0x001e, 0xb83e, 0xb842, 0xb8be,
+	0xb8c2, 0xb85e, 0xb862, 0xb866, 0xb86a, 0xb86f, 0x0100, 0xb872,
+	0xb876, 0xb87a, 0xb88a, 0xb88e, 0xb893, 0x0008, 0xb896, 0xb89a,
+	0xb89e, 0xb8ae, 0xb9a2, 0x0096, 0xb8a4, 0x904d, 0x0110, 0x080c,
+	0x1055, 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, 0x5cba, 0x9182,
+	0x0800, 0x1a04, 0x5cbe, 0x2001, 0x180c, 0x2004, 0x9084, 0x0003,
+	0x1904, 0x5cc4, 0x9188, 0x1000, 0x2104, 0x905d, 0x0198, 0xb804,
+	0x9084, 0x00ff, 0x908e, 0x0006, 0x1188, 0xb8a4, 0x900d, 0x1904,
+	0x5cd6, 0x080c, 0x6020, 0x9006, 0x012e, 0x0005, 0x2001, 0x0005,
+	0x900e, 0x04b8, 0x2001, 0x0028, 0x900e, 0x0498, 0x9082, 0x0006,
+	0x1290, 0x080c, 0x99e4, 0x1160, 0xb8a0, 0x9084, 0xff80, 0x1140,
+	0xb900, 0xd1fc, 0x0d10, 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, 0x9065, 0x09a8, 0x080c, 0x655d,
+	0x1990, 0xb800, 0xd0bc, 0x0978, 0x0804, 0x5c7d, 0x080c, 0x63d1,
+	0x0904, 0x5c86, 0x0804, 0x5c81, 0x00e6, 0x2071, 0x19b6, 0x7004,
+	0x9086, 0x0002, 0x1128, 0x7030, 0x9080, 0x0004, 0x2004, 0x9b06,
+	0x00ee, 0x0005, 0x00b6, 0x00e6, 0x0126, 0x2091, 0x8000, 0xa974,
+	0x9182, 0x0800, 0x1a04, 0x5d65, 0x9188, 0x1000, 0x2104, 0x905d,
+	0x0904, 0x5d3d, 0xb8a0, 0x9086, 0x007f, 0x0178, 0x080c, 0x6565,
+	0x0160, 0xa994, 0x81ff, 0x0130, 0x908e, 0x0004, 0x0130, 0x908e,
+	0x0005, 0x0118, 0x080c, 0x655d, 0x1598, 0xa87c, 0xd0fc, 0x01e0,
+	0xa894, 0x9005, 0x01c8, 0x2060, 0x0026, 0x2010, 0x080c, 0xb6b3,
+	0x002e, 0x1120, 0x2001, 0x0008, 0x0804, 0x5d67, 0x6020, 0x9086,
+	0x000a, 0x0120, 0x2001, 0x0008, 0x0804, 0x5d67, 0x601a, 0x6003,
+	0x0008, 0x2900, 0x6016, 0x0058, 0x080c, 0x9a0f, 0x05e8, 0x2b00,
+	0x6012, 0x2900, 0x6016, 0x600b, 0xffff, 0x6023, 0x000a, 0x2009,
+	0x0003, 0x080c, 0x9b03, 0x9006, 0x0458, 0x2001, 0x0028, 0x0438,
+	0x9082, 0x0006, 0x1290, 0x080c, 0x99e4, 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, 0x5dfc,
+	0x5db7, 0x5dce, 0x5dfc, 0x5dfc, 0x5dfc, 0x5dfc, 0x5dfc, 0x2100,
+	0x9082, 0x007e, 0x1278, 0x080c, 0x6106, 0x0148, 0x9046, 0xb810,
+	0x9306, 0x1904, 0x5e04, 0xb814, 0x9206, 0x15f0, 0x0028, 0xbb12,
+	0xba16, 0x0010, 0x080c, 0x46b5, 0x0150, 0x04b0, 0x080c, 0x6166,
+	0x1598, 0xb810, 0x9306, 0x1580, 0xb814, 0x9206, 0x1568, 0x080c,
+	0x9a0f, 0x0530, 0x2b00, 0x6012, 0x080c, 0xbb52, 0x2900, 0x6016,
+	0x600b, 0xffff, 0x6023, 0x000a, 0xa878, 0x9086, 0x0001, 0x1170,
+	0x080c, 0x2fc1, 0x9006, 0x080c, 0x60a3, 0x2001, 0x0002, 0x080c,
+	0x60b7, 0x2001, 0x0200, 0xb86e, 0xb893, 0x0002, 0x2009, 0x0003,
+	0x080c, 0x9b03, 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, 0x5fd1,
+	0x90c6, 0x0056, 0x0904, 0x5fd5, 0x90c6, 0x0066, 0x0904, 0x5fd9,
+	0x90c6, 0x0071, 0x0904, 0x5fdd, 0x90c6, 0x0074, 0x0904, 0x5fe1,
+	0x90c6, 0x007c, 0x0904, 0x5fe5, 0x90c6, 0x007e, 0x0904, 0x5fe9,
+	0x90c6, 0x0037, 0x0904, 0x5fed, 0x9016, 0x2079, 0x1800, 0xa974,
+	0x9186, 0x00ff, 0x0904, 0x5fcc, 0x9182, 0x0800, 0x1a04, 0x5fcc,
+	0x080c, 0x6166, 0x1198, 0xb804, 0x9084, 0x00ff, 0x9082, 0x0006,
+	0x1268, 0xa894, 0x90c6, 0x006f, 0x0148, 0x080c, 0x99e4, 0x1904,
+	0x5fb5, 0xb8a0, 0x9084, 0xff80, 0x1904, 0x5fb5, 0xa894, 0x90c6,
+	0x006f, 0x0158, 0x90c6, 0x005e, 0x0904, 0x5f15, 0x90c6, 0x0064,
+	0x0904, 0x5f3e, 0x2008, 0x0804, 0x5ed8, 0xa998, 0xa8b0, 0x2040,
+	0x080c, 0x99e4, 0x1120, 0x9182, 0x007f, 0x0a04, 0x5ed8, 0x9186,
+	0x00ff, 0x0904, 0x5ed8, 0x9182, 0x0800, 0x1a04, 0x5ed8, 0xaaa0,
+	0xab9c, 0x7878, 0x9306, 0x1188, 0x787c, 0x0096, 0x924e, 0x1128,
+	0x2208, 0x2310, 0x009e, 0x0804, 0x5ed8, 0x99cc, 0xff00, 0x009e,
+	0x1120, 0x2208, 0x2310, 0x0804, 0x5ed8, 0x080c, 0x46b5, 0x0904,
+	0x5ee1, 0x900e, 0x9016, 0x90c6, 0x4000, 0x1558, 0x0006, 0x080c,
+	0x6455, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d, 0x20a9,
+	0x0004, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0031, 0x20a0, 0xb8b4,
+	0x20e0, 0xb8b8, 0x9080, 0x0006, 0x2098, 0x080c, 0x0fa0, 0x20a9,
+	0x0004, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0035, 0x20a0, 0xb8b4,
+	0x20e0, 0xb8b8, 0x9080, 0x000a, 0x2098, 0x080c, 0x0fa0, 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, 0x9a0f, 0x1130, 0x2001, 0x4005, 0x2009, 0x0003,
+	0x9016, 0x0c80, 0x2b00, 0x6012, 0x080c, 0xbb52, 0x2900, 0x6016,
+	0x6023, 0x0001, 0xa868, 0xd88c, 0x0108, 0xc0f5, 0xa86a, 0x0126,
+	0x2091, 0x8000, 0x080c, 0x2fc1, 0x012e, 0x9006, 0x080c, 0x60a3,
+	0x2001, 0x0002, 0x080c, 0x60b7, 0x2009, 0x0002, 0x080c, 0x9b03,
+	0xa8b0, 0xd094, 0x0118, 0xb8c4, 0xc08d, 0xb8c6, 0x9006, 0x9005,
+	0x012e, 0x00ee, 0x00fe, 0x00be, 0x0005, 0x080c, 0x52b1, 0x0118,
+	0x2009, 0x0007, 0x00f8, 0xa998, 0xaeb0, 0x080c, 0x6166, 0x1904,
+	0x5ed3, 0x9186, 0x007f, 0x0130, 0x080c, 0x655d, 0x0118, 0x2009,
+	0x0009, 0x0080, 0x0096, 0x080c, 0x1023, 0x1120, 0x009e, 0x2009,
+	0x0002, 0x0040, 0x2900, 0x009e, 0xa806, 0x080c, 0xb8aa, 0x19b0,
+	0x2009, 0x0003, 0x2001, 0x4005, 0x0804, 0x5eda, 0xa998, 0xaeb0,
+	0x080c, 0x6166, 0x1904, 0x5ed3, 0x0096, 0x080c, 0x1023, 0x1128,
+	0x009e, 0x2009, 0x0002, 0x0804, 0x5f92, 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, 0x0fa0, 0x009e, 0xa87b, 0x0000, 0xa883, 0x0000, 0xa897,
+	0x4000, 0xd684, 0x1168, 0x080c, 0x529d, 0xd0b4, 0x1118, 0xa89b,
+	0x000b, 0x00e0, 0xb800, 0xd08c, 0x0118, 0xa89b, 0x000c, 0x00b0,
+	0x080c, 0x655d, 0x0118, 0xa89b, 0x0009, 0x0080, 0x080c, 0x52b1,
+	0x0118, 0xa89b, 0x0007, 0x0050, 0x080c, 0xb88d, 0x1904, 0x5f0e,
+	0x2009, 0x0003, 0x2001, 0x4005, 0x0804, 0x5eda, 0xa87b, 0x0030,
+	0xa897, 0x4005, 0xa804, 0x8006, 0x8006, 0x8007, 0x90bc, 0x003f,
+	0x9084, 0xffc0, 0x9080, 0x0002, 0x2009, 0x002b, 0xaaa0, 0xab9c,
+	0xaca8, 0xada4, 0x2031, 0x0000, 0x2041, 0x125d, 0x080c, 0x9f73,
+	0x1904, 0x5f0e, 0x2009, 0x0002, 0x08e8, 0x2001, 0x0028, 0x900e,
+	0x0804, 0x5f0f, 0x2009, 0x180c, 0x210c, 0xd18c, 0x0118, 0x2001,
+	0x0004, 0x0038, 0xd184, 0x0118, 0x2001, 0x0004, 0x0010, 0x2001,
+	0x0029, 0x900e, 0x0804, 0x5f0f, 0x2001, 0x0029, 0x900e, 0x0804,
+	0x5f0f, 0x080c, 0x3565, 0x0804, 0x5f10, 0x080c, 0x4fd2, 0x0804,
+	0x5f10, 0x080c, 0x430b, 0x0804, 0x5f10, 0x080c, 0x4771, 0x0804,
+	0x5f10, 0x080c, 0x4a19, 0x0804, 0x5f10, 0x080c, 0x4c4c, 0x0804,
+	0x5f10, 0x080c, 0x4e3d, 0x0804, 0x5f10, 0x080c, 0x377a, 0x0804,
+	0x5f10, 0x00b6, 0xa974, 0xae78, 0x9684, 0x3fff, 0x9082, 0x4000,
+	0x1608, 0x9182, 0x0800, 0x1258, 0x9188, 0x1000, 0x2104, 0x905d,
+	0x0130, 0x080c, 0x655d, 0x1138, 0x00d9, 0x9006, 0x00b0, 0x2001,
+	0x0028, 0x900e, 0x0090, 0x9082, 0x0006, 0x1240, 0xb900, 0xd1fc,
+	0x0d98, 0x2001, 0x0029, 0x2009, 0x1000, 0x0038, 0x2001, 0x0029,
+	0x900e, 0x0018, 0x2001, 0x0029, 0x900e, 0x9005, 0x00be, 0x0005,
+	0xa877, 0x0000, 0xb8c0, 0x9005, 0x1904, 0x6097, 0xb888, 0x9005,
+	0x1904, 0x6097, 0xb838, 0xb93c, 0x9102, 0x1a04, 0x6097, 0x2b10,
+	0x080c, 0x9a3c, 0x0904, 0x6093, 0x8108, 0xb93e, 0x6212, 0x2900,
+	0x6016, 0x6023, 0x0003, 0x600b, 0xffff, 0x6007, 0x0040, 0xa878,
+	0x605e, 0xa880, 0x9084, 0x00ff, 0x6066, 0xa883, 0x0000, 0xa87c,
+	0xd0ac, 0x05c0, 0xc0dd, 0xa87e, 0xa888, 0x8001, 0x1568, 0x2001,
+	0x00f8, 0x8001, 0xa001, 0xa001, 0xa001, 0x1dd8, 0xa816, 0xa864,
+	0x9094, 0x00f7, 0x9296, 0x0011, 0x11f8, 0x9084, 0x00ff, 0xc0bd,
+	0x601e, 0xa8ac, 0xaab0, 0xa836, 0xaa3a, 0x2001, 0x000f, 0x8001,
+	0x1df0, 0x2001, 0x8004, 0x6003, 0x0004, 0x6046, 0x00f6, 0x2079,
+	0x0380, 0x7818, 0xd0bc, 0x1de8, 0x7833, 0x0010, 0x2c00, 0x7836,
+	0x781b, 0x8080, 0x00fe, 0x0005, 0x080c, 0x1646, 0x601c, 0xc0bd,
+	0x601e, 0x0c38, 0x0006, 0x2001, 0x00e8, 0x8001, 0xa001, 0xa001,
+	0xa001, 0x1dd8, 0x000e, 0xd0b4, 0x190c, 0x1aa5, 0x2001, 0x8004,
+	0x6003, 0x0002, 0x08d0, 0x81ff, 0x1110, 0xb88b, 0x0001, 0x2908,
+	0xb8bc, 0xb9be, 0x9005, 0x1110, 0xb9c2, 0x0020, 0x0096, 0x2048,
+	0xa902, 0x009e, 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, 0x6559,
+	0x0140, 0x9284, 0xff00, 0x8007, 0x9086, 0x0007, 0x1110, 0x2011,
+	0x0600, 0x000e, 0x9294, 0xff00, 0x9215, 0xba06, 0x0006, 0x9086,
+	0x0006, 0x1120, 0xba90, 0x82ff, 0x090c, 0x0d65, 0x000e, 0x00ce,
+	0x012e, 0x00be, 0x0005, 0x00b6, 0x0126, 0x00c6, 0x2091, 0x8000,
+	0x6210, 0x2258, 0xba04, 0x0006, 0x9086, 0x0006, 0x1168, 0xb89c,
+	0xd0a4, 0x0150, 0x080c, 0x6555, 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, 0x1023, 0x2958, 0x009e,
+	0x0160, 0x2b00, 0x2012, 0xb85c, 0xb8ba, 0xb860, 0xb8b6, 0x9006,
+	0xb8a6, 0x080c, 0x5bfc, 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, 0x1055, 0x00d6, 0x00c6, 0xb8ac, 0x2060, 0x8cff,
+	0x0168, 0x600c, 0x0006, 0x6014, 0x2048, 0x080c, 0xb6c5, 0x0110,
+	0x080c, 0x0fd5, 0x080c, 0x9a65, 0x00ce, 0x0c88, 0x00ce, 0x00de,
+	0x2b48, 0xb8b8, 0xb85e, 0xb8b4, 0xb862, 0x080c, 0x1065, 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,
+	0x6f5c, 0x1510, 0xb8a0, 0x9086, 0x007e, 0x0120, 0x080c, 0x99e4,
+	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, 0x68b2, 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, 0xbbc4, 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, 0xbbc6,
+	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, 0x0d65, 0x3c00, 0x20e8,
+	0x3300, 0x8001, 0x20a0, 0x4604, 0x8210, 0xaa06, 0x01de, 0x01ce,
+	0x014e, 0x013e, 0x0060, 0x080c, 0x1023, 0x0170, 0x2900, 0xb8a6,
+	0xa803, 0x0000, 0x080c, 0x63f1, 0xa807, 0x0001, 0xae12, 0x9085,
+	0x0001, 0x012e, 0x009e, 0x0005, 0x9006, 0x0cd8, 0x0126, 0x2091,
+	0x8000, 0x0096, 0xb8a4, 0x904d, 0x0188, 0xa800, 0x9005, 0x1150,
+	0x080c, 0x6400, 0x1158, 0xa804, 0x908a, 0x0002, 0x0218, 0x8001,
+	0xa806, 0x0020, 0x080c, 0x1055, 0xb8a7, 0x0000, 0x009e, 0x012e,
+	0x0005, 0x0096, 0x00c6, 0xb888, 0x9005, 0x1904, 0x62ea, 0xb8c0,
+	0x904d, 0x0904, 0x62ea, 0x080c, 0x9a3c, 0x0904, 0x62e6, 0x8210,
+	0xba3e, 0xa800, 0xb8c2, 0x9005, 0x1108, 0xb8be, 0x2b00, 0x6012,
+	0x2900, 0x6016, 0x6023, 0x0003, 0x600b, 0xffff, 0x6007, 0x0040,
+	0xa878, 0x605e, 0xa880, 0x9084, 0x00ff, 0x6066, 0xa883, 0x0000,
+	0xa87c, 0xd0ac, 0x01c8, 0xc0dd, 0xa87e, 0xa888, 0x8001, 0x1568,
+	0xa816, 0xa864, 0x9094, 0x00f7, 0x9296, 0x0011, 0x1530, 0x9084,
+	0x00ff, 0xc0bd, 0x601e, 0xa8ac, 0xaab0, 0xa836, 0xaa3a, 0x2001,
+	0x8004, 0x6003, 0x0004, 0x0030, 0x080c, 0x1aa5, 0x2001, 0x8004,
+	0x6003, 0x0002, 0x6046, 0x2001, 0x0010, 0x2c08, 0x080c, 0x9737,
+	0xb838, 0xba3c, 0x9202, 0x0a04, 0x6297, 0x0020, 0x82ff, 0x1110,
+	0xb88b, 0x0001, 0x00ce, 0x009e, 0x0005, 0x080c, 0x1646, 0x601c,
+	0xc0bd, 0x601e, 0x08e0, 0x00b6, 0x0096, 0x0016, 0x20a9, 0x0800,
+	0x900e, 0x0016, 0x080c, 0x6166, 0x1158, 0xb8c0, 0x904d, 0x0140,
+	0x3e00, 0x9086, 0x0002, 0x1118, 0xb800, 0xd0bc, 0x1108, 0x0041,
+	0x001e, 0x8108, 0x1f04, 0x62f9, 0x001e, 0x00be, 0x009e, 0x0005,
+	0x0096, 0x0016, 0xb8c0, 0x904d, 0x0188, 0xa800, 0xb8c2, 0x9005,
+	0x1108, 0xb8be, 0x9006, 0xa802, 0xa867, 0x0103, 0xab7a, 0xa877,
+	0x0000, 0x080c, 0xb9bc, 0x080c, 0x683f, 0x0c60, 0x001e, 0x009e,
+	0x0005, 0x0086, 0x9046, 0xb8c0, 0x904d, 0x0198, 0xa86c, 0x9406,
+	0x1118, 0xa870, 0x9506, 0x0128, 0x2940, 0xa800, 0x904d, 0x0148,
+	0x0ca8, 0xa800, 0x88ff, 0x1110, 0xb8c2, 0x0008, 0xa002, 0xa803,
+	0x0000, 0x008e, 0x0005, 0x901e, 0x0010, 0x2019, 0x0001, 0x00e6,
+	0x0096, 0x00c6, 0x0086, 0x0026, 0x0126, 0x2091, 0x8000, 0x2071,
+	0x19b6, 0x9046, 0x7028, 0x9065, 0x01e8, 0x6014, 0x2068, 0x83ff,
+	0x0120, 0x605c, 0x9606, 0x0158, 0x0030, 0xa86c, 0x9406, 0x1118,
+	0xa870, 0x9506, 0x0120, 0x2c40, 0x600c, 0x2060, 0x0c60, 0x600c,
+	0x0006, 0x0066, 0x2830, 0x080c, 0x8f7a, 0x006e, 0x000e, 0x83ff,
+	0x0508, 0x0c08, 0x9046, 0xb8c0, 0x904d, 0x01e0, 0x83ff, 0x0120,
+	0xa878, 0x9606, 0x0158, 0x0030, 0xa86c, 0x9406, 0x1118, 0xa870,
+	0x9506, 0x0120, 0x2940, 0xa800, 0x2048, 0x0c70, 0xb8c0, 0xaa00,
+	0x0026, 0x9906, 0x1110, 0xbac2, 0x0008, 0xa202, 0x000e, 0x83ff,
+	0x0108, 0x0c10, 0x002e, 0x008e, 0x00ce, 0x009e, 0x00ee, 0x0005,
+	0x9016, 0x0489, 0x1110, 0x2011, 0x0001, 0x0005, 0x080c, 0x6455,
+	0x0128, 0x080c, 0xb791, 0x0010, 0x9085, 0x0001, 0x0005, 0x080c,
+	0x6455, 0x0128, 0x080c, 0xb727, 0x0010, 0x9085, 0x0001, 0x0005,
+	0x080c, 0x6455, 0x0128, 0x080c, 0xb78e, 0x0010, 0x9085, 0x0001,
+	0x0005, 0x080c, 0x6455, 0x0128, 0x080c, 0xb74b, 0x0010, 0x9085,
+	0x0001, 0x0005, 0x080c, 0x6455, 0x0128, 0x080c, 0xb7bb, 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, 0x1023, 0x0168, 0x2900, 0xb8a6,
+	0x080c, 0x63f1, 0xa803, 0x0001, 0xa807, 0x0000, 0x9085, 0x0001,
+	0x012e, 0x009e, 0x0005, 0x9006, 0x0cd8, 0x0096, 0x0126, 0x2091,
+	0x8000, 0xb8a4, 0x904d, 0x0130, 0xb8a7, 0x0000, 0x080c, 0x1055,
+	0x9085, 0x0001, 0x012e, 0x009e, 0x0005, 0xb89c, 0xd0a4, 0x0005,
+	0x00b6, 0x00f6, 0x080c, 0x6f5c, 0x01b0, 0x71c0, 0x81ff, 0x1198,
+	0x71d8, 0xd19c, 0x0180, 0x2001, 0x007e, 0x9080, 0x1000, 0x2004,
+	0x905d, 0x0148, 0xb804, 0x9084, 0x00ff, 0x9086, 0x0006, 0x1118,
+	0xb800, 0xc0ed, 0xb802, 0x2079, 0x1853, 0x7804, 0x00d0, 0x0156,
+	0x20a9, 0x007f, 0x900e, 0x0016, 0x080c, 0x6166, 0x1168, 0xb804,
+	0x9084, 0xff00, 0x8007, 0x9096, 0x0004, 0x0118, 0x9086, 0x0006,
+	0x1118, 0xb800, 0xc0ed, 0xb802, 0x001e, 0x8108, 0x1f04, 0x647b,
+	0x015e, 0x080c, 0x651b, 0x0120, 0x2001, 0x1954, 0x200c, 0x0030,
+	0x2079, 0x1853, 0x7804, 0x0030, 0x2009, 0x07d0, 0x2011, 0x64a5,
+	0x080c, 0x807a, 0x00fe, 0x00be, 0x0005, 0x00b6, 0x2011, 0x64a5,
+	0x080c, 0x7fbb, 0x080c, 0x651b, 0x01d8, 0x2001, 0x107e, 0x2004,
+	0x2058, 0xb900, 0xc1ec, 0xb902, 0x080c, 0x6559, 0x0130, 0x2009,
+	0x07d0, 0x2011, 0x64a5, 0x080c, 0x807a, 0x00e6, 0x2071, 0x1800,
+	0x9006, 0x707a, 0x705c, 0x707e, 0x080c, 0x2d99, 0x00ee, 0x04d0,
+	0x0156, 0x00c6, 0x20a9, 0x007f, 0x900e, 0x0016, 0x080c, 0x6166,
+	0x1558, 0xb800, 0xd0ec, 0x0540, 0x0046, 0xbaa0, 0x2220, 0x9006,
+	0x2009, 0x0029, 0x080c, 0xd0ce, 0xb800, 0xc0e5, 0xc0ec, 0xb802,
+	0x080c, 0x6555, 0x2001, 0x0707, 0x1128, 0xb804, 0x9084, 0x00ff,
+	0x9085, 0x0700, 0xb806, 0x080c, 0x9746, 0x2019, 0x0029, 0x080c,
+	0x8498, 0x0076, 0x903e, 0x080c, 0x8387, 0x900e, 0x080c, 0xce23,
+	0x007e, 0x004e, 0x080c, 0x9762, 0x001e, 0x8108, 0x1f04, 0x64cd,
+	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, 0x0d65, 0x000e, 0xba00, 0x9005, 0x0110, 0xc2fd,
+	0x0008, 0xc2fc, 0xba02, 0x002e, 0x012e, 0x0005, 0x2011, 0x1836,
+	0x2204, 0xd0cc, 0x0138, 0x2001, 0x1952, 0x200c, 0x2011, 0x654b,
+	0x080c, 0x807a, 0x0005, 0x2011, 0x654b, 0x080c, 0x7fbb, 0x2011,
+	0x1836, 0x2204, 0xc0cc, 0x2012, 0x0005, 0x080c, 0x529d, 0xd0ac,
+	0x0005, 0x080c, 0x529d, 0xd0a4, 0x0005, 0x0016, 0xb904, 0x9184,
+	0x00ff, 0x908e, 0x0006, 0x001e, 0x0005, 0x0016, 0xb904, 0x9184,
+	0xff00, 0x8007, 0x908e, 0x0006, 0x001e, 0x0005, 0x00b6, 0x00f6,
+	0x080c, 0xbdd7, 0x0158, 0x70d8, 0x9084, 0x0028, 0x0138, 0x2001,
+	0x107f, 0x2004, 0x905d, 0x0110, 0xb8c4, 0xd094, 0x00fe, 0x00be,
+	0x0005, 0x0006, 0x0016, 0x0036, 0x0046, 0x0076, 0x00b6, 0x2001,
+	0x1817, 0x203c, 0x9780, 0x3142, 0x203d, 0x97bc, 0xff00, 0x873f,
+	0x9006, 0x2018, 0x2008, 0x9284, 0x8000, 0x0110, 0x2019, 0x0001,
+	0x9294, 0x7fff, 0x2100, 0x9706, 0x0190, 0x91a0, 0x1000, 0x2404,
+	0x905d, 0x0168, 0xb804, 0x9084, 0x00ff, 0x9086, 0x0006, 0x1138,
+	0x83ff, 0x0118, 0xb89c, 0xd0a4, 0x0110, 0x8211, 0x0158, 0x8108,
+	0x83ff, 0x0120, 0x9182, 0x0800, 0x0e28, 0x0068, 0x9182, 0x007e,
+	0x0e08, 0x0048, 0x00be, 0x007e, 0x004e, 0x003e, 0x001e, 0x9085,
+	0x0001, 0x000e, 0x0005, 0x00be, 0x007e, 0x004e, 0x003e, 0x001e,
+	0x9006, 0x000e, 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, 0x529d, 0xd0fc, 0x1140, 0x080c,
+	0x529d, 0x900e, 0xd09c, 0x0108, 0x8108, 0x7102, 0x0400, 0x2001,
+	0x1873, 0x200c, 0x9184, 0x0007, 0x9006, 0x0002, 0x65e7, 0x65e7,
+	0x65e7, 0x65e7, 0x65e7, 0x65fe, 0x660c, 0x65e7, 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, 0x72ce, 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, 0x6844,
+	0xa87c, 0xd0bc, 0x1904, 0x6844, 0xa978, 0xa874, 0x9105, 0x1904,
+	0x6844, 0x2001, 0x191a, 0x2004, 0x0002, 0x6844, 0x6698, 0x66d4,
+	0x66d4, 0x6844, 0x66d4, 0x0005, 0xa868, 0xd0fc, 0x1500, 0x00e6,
+	0x0026, 0x2009, 0x191a, 0x210c, 0x81ff, 0x0904, 0x6844, 0xa87c,
+	0xd0cc, 0x0904, 0x6844, 0xa880, 0x9084, 0x00ff, 0x9086, 0x0001,
+	0x1904, 0x6844, 0x9186, 0x0003, 0x0904, 0x66d4, 0x9186, 0x0005,
+	0x0904, 0x66d4, 0xa84f, 0x8021, 0xa853, 0x0017, 0x0028, 0x0005,
+	0xa84f, 0x8020, 0xa853, 0x0016, 0x2071, 0x1906, 0x701c, 0x9005,
+	0x1904, 0x69e7, 0x0e04, 0x6a32, 0x2071, 0x0000, 0xa84c, 0x7082,
+	0xa850, 0x7032, 0xa86c, 0x7086, 0x7036, 0xa870, 0x708a, 0x2091,
+	0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x11b5, 0x2071,
+	0x1800, 0x2011, 0x0001, 0xa804, 0x900d, 0x702c, 0x1158, 0xa802,
+	0x2900, 0x702e, 0x70bc, 0x9200, 0x70be, 0x080c, 0x7ed6, 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,
+	0x67c9, 0x782c, 0x908c, 0x0780, 0x190c, 0x6b59, 0x8004, 0x8004,
+	0x8004, 0x9084, 0x0003, 0x0002, 0x66f2, 0x67c9, 0x6717, 0x6764,
+	0x080c, 0x0d65, 0x2071, 0x1800, 0x2900, 0x7822, 0xa804, 0x900d,
+	0x1170, 0x2071, 0x19d2, 0x703c, 0x9005, 0x1328, 0x2001, 0x191b,
+	0x2004, 0x8005, 0x703e, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x9016,
+	0x702c, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8,
+	0x702e, 0x70bc, 0x9200, 0x70be, 0x080c, 0x7ed6, 0x0c10, 0x2071,
+	0x1800, 0x2900, 0x7822, 0xa804, 0x900d, 0x15a8, 0x7824, 0x00e6,
+	0x2071, 0x0040, 0x712c, 0xd19c, 0x1170, 0x2009, 0x182f, 0x210c,
+	0x918a, 0x0040, 0x0240, 0x7022, 0x2001, 0x1dc0, 0x200c, 0x8108,
+	0x2102, 0x00ee, 0x0058, 0x00ee, 0x2048, 0x702c, 0xa802, 0x2900,
+	0x702e, 0x70bc, 0x8000, 0x70be, 0x080c, 0x7ed6, 0x782c, 0x9094,
+	0x0780, 0x190c, 0x6b59, 0xd0a4, 0x19c8, 0x2071, 0x19d2, 0x703c,
+	0x9005, 0x1328, 0x2001, 0x191b, 0x2004, 0x8005, 0x703e, 0x00fe,
+	0x002e, 0x00ee, 0x0005, 0x9016, 0x702c, 0x2148, 0xa904, 0xa802,
+	0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e, 0x70bc, 0x9200, 0x70be,
+	0x080c, 0x7ed6, 0x0804, 0x671e, 0x0096, 0x00e6, 0x7824, 0x2048,
+	0x2071, 0x1800, 0x702c, 0xa802, 0x2900, 0x702e, 0x70bc, 0x8000,
+	0x70be, 0x080c, 0x7ed6, 0x782c, 0x9094, 0x0780, 0x190c, 0x6b59,
+	0xd0a4, 0x1d60, 0x00ee, 0x782c, 0x9094, 0x0780, 0x190c, 0x6b59,
+	0xd09c, 0x11a0, 0x009e, 0x2900, 0x7822, 0xa804, 0x900d, 0x1560,
+	0x2071, 0x19d2, 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, 0x19d2,
+	0x703c, 0x9005, 0x1328, 0x2001, 0x191b, 0x2004, 0x8005, 0x703e,
+	0x00fe, 0x002e, 0x00ee, 0x0005, 0x2071, 0x1800, 0x9016, 0x702c,
+	0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e,
+	0x70bc, 0x9200, 0x70be, 0x080c, 0x7ed6, 0x00fe, 0x002e, 0x00ee,
+	0x0005, 0x2908, 0x7010, 0x8000, 0x7012, 0x7018, 0x904d, 0x711a,
+	0x0110, 0xa902, 0x0008, 0x711e, 0x2148, 0xa804, 0x900d, 0x1904,
+	0x681e, 0x782c, 0x9094, 0x0780, 0x190c, 0x6b59, 0xd09c, 0x1198,
+	0x701c, 0x904d, 0x0180, 0x7010, 0x8001, 0x7012, 0x1108, 0x701a,
+	0xa800, 0x701e, 0x2900, 0x7822, 0x782c, 0x9094, 0x0780, 0x190c,
+	0x6b59, 0xd09c, 0x0d68, 0x782c, 0x9094, 0x0780, 0x190c, 0x6b59,
+	0xd0a4, 0x01b0, 0x00e6, 0x7824, 0x2048, 0x2071, 0x1800, 0x702c,
+	0xa802, 0x2900, 0x702e, 0x70bc, 0x8000, 0x70be, 0x080c, 0x7ed6,
+	0x782c, 0x9094, 0x0780, 0x190c, 0x6b59, 0xd0a4, 0x1d60, 0x00ee,
+	0x2071, 0x19d2, 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, 0x70bc, 0x9200, 0x70be, 0x080c, 0x7ed6,
+	0x00ee, 0x0804, 0x67d9, 0xa868, 0xd0fc, 0x1560, 0x0096, 0xa804,
+	0xa807, 0x0000, 0x904d, 0x190c, 0x0fd5, 0x009e, 0x0018, 0xa868,
+	0xd0fc, 0x1500, 0x00e6, 0x0026, 0xa84f, 0x0000, 0x00f6, 0x2079,
+	0x0050, 0x2071, 0x1906, 0xa803, 0x0000, 0x7010, 0x9005, 0x1904,
+	0x6961, 0x782c, 0x908c, 0x0780, 0x190c, 0x6b59, 0x8004, 0x8004,
+	0x8004, 0x9084, 0x0003, 0x0002, 0x6863, 0x6961, 0x687e, 0x68f0,
+	0x080c, 0x0d65, 0x0005, 0x2071, 0x1800, 0x2900, 0x7822, 0xa804,
+	0x900d, 0x1120, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x9016, 0x702c,
+	0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e,
+	0x70bc, 0x9200, 0x70be, 0x080c, 0x7ed6, 0x0c60, 0x2071, 0x1800,
+	0x2900, 0x7822, 0xa804, 0x900d, 0x1904, 0x68df, 0x7830, 0xd0dc,
+	0x1120, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x7824, 0x00e6, 0x2071,
+	0x0040, 0x712c, 0xd19c, 0x1170, 0x2009, 0x182f, 0x210c, 0x918a,
+	0x0040, 0x0240, 0x7022, 0x2001, 0x1dc0, 0x200c, 0x8108, 0x2102,
+	0x00ee, 0x0058, 0x00ee, 0x2048, 0x702c, 0xa802, 0x2900, 0x702e,
+	0x70bc, 0x8000, 0x70be, 0x080c, 0x7ed6, 0x782c, 0x9094, 0x0780,
+	0x190c, 0x6b59, 0xd0a4, 0x19c8, 0x0e04, 0x68d6, 0x7838, 0x7938,
+	0x910e, 0x1de0, 0x00d6, 0x2069, 0x0000, 0x6836, 0x6833, 0x0013,
+	0x00de, 0x2001, 0x1917, 0x200c, 0xc184, 0x2102, 0x2091, 0x4080,
+	0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x11b5, 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, 0x70bc, 0x9200, 0x70be, 0x080c, 0x7ed6, 0x0804, 0x688d,
+	0x0096, 0x00e6, 0x7824, 0x2048, 0x2071, 0x1800, 0x702c, 0xa802,
+	0x2900, 0x702e, 0x70bc, 0x8000, 0x70be, 0x080c, 0x7ed6, 0x782c,
+	0x9094, 0x0780, 0x190c, 0x6b59, 0xd0a4, 0x1d60, 0x00ee, 0x0e04,
+	0x6934, 0x7838, 0x7938, 0x910e, 0x1de0, 0x00d6, 0x2069, 0x0000,
+	0x6836, 0x6833, 0x0013, 0x00de, 0x7044, 0xc084, 0x7046, 0x2091,
+	0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x11b5, 0x2009,
+	0x1919, 0x200b, 0x0000, 0x782c, 0x9094, 0x0780, 0x190c, 0x6b59,
+	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,
+	0x70bc, 0x9200, 0x70be, 0x080c, 0x7ed6, 0x00fe, 0x002e, 0x00ee,
+	0x0005, 0x2908, 0x7010, 0x8000, 0x7012, 0x7018, 0x904d, 0x711a,
+	0x0110, 0xa902, 0x0008, 0x711e, 0x2148, 0xa804, 0x900d, 0x1904,
+	0x69d2, 0x782c, 0x9094, 0x0780, 0x190c, 0x6b59, 0xd09c, 0x11b0,
+	0x701c, 0x904d, 0x0198, 0xa84c, 0x9005, 0x1180, 0x7010, 0x8001,
+	0x7012, 0x1108, 0x701a, 0xa800, 0x701e, 0x2900, 0x7822, 0x782c,
+	0x9094, 0x0780, 0x190c, 0x6b59, 0xd09c, 0x0d50, 0x782c, 0x9094,
+	0x0780, 0x190c, 0x6b59, 0xd0a4, 0x05c8, 0x00e6, 0x7824, 0x2048,
+	0x2071, 0x1800, 0x702c, 0xa802, 0x2900, 0x702e, 0x70bc, 0x8000,
+	0x70be, 0x080c, 0x7ed6, 0x782c, 0x9094, 0x0780, 0x190c, 0x6b59,
+	0xd0a4, 0x1d60, 0x00ee, 0x0e04, 0x69cb, 0x7838, 0x7938, 0x910e,
+	0x1de0, 0x00d6, 0x2069, 0x0000, 0x6836, 0x6833, 0x0013, 0x00de,
+	0x7044, 0xc084, 0x7046, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004,
+	0xd084, 0x190c, 0x11b5, 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, 0x70bc,
+	0x9200, 0x70be, 0x080c, 0x7ed6, 0x00ee, 0x0804, 0x6971, 0x2071,
+	0x1906, 0xa803, 0x0000, 0x2908, 0x7010, 0x8000, 0x7012, 0x7018,
+	0x904d, 0x711a, 0x0110, 0xa902, 0x0008, 0x711e, 0x2148, 0xa804,
+	0x900d, 0x1128, 0x1e04, 0x6a12, 0x002e, 0x00ee, 0x0005, 0x2071,
+	0x1800, 0x9016, 0x702c, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900,
+	0x81ff, 0x1dc8, 0x702e, 0x70bc, 0x9200, 0x70be, 0x080c, 0x7ed6,
+	0x0e04, 0x69fc, 0x2071, 0x1906, 0x701c, 0x2048, 0xa84c, 0x900d,
+	0x0d18, 0x2071, 0x0000, 0x7182, 0xa850, 0x7032, 0xa86c, 0x7086,
+	0x7036, 0xa870, 0x708a, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004,
+	0xd084, 0x190c, 0x11b5, 0x2071, 0x1906, 0x080c, 0x6b45, 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, 0x70bc, 0x9200, 0x70be, 0x080c,
+	0x7ed6, 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, 0x6a7d,
+	0x6a7e, 0x6b44, 0x6a7e, 0x0d65, 0x6b44, 0x0005, 0x2001, 0x191a,
+	0x2004, 0x0002, 0x6a88, 0x6a88, 0x6add, 0x6ade, 0x6a88, 0x6ade,
+	0x0126, 0x2091, 0x8000, 0x1e0c, 0x6b64, 0x701c, 0x904d, 0x01e0,
+	0xa84c, 0x9005, 0x01d8, 0x0e04, 0x6aac, 0xa94c, 0x2071, 0x0000,
+	0x7182, 0xa850, 0x7032, 0xa86c, 0x7086, 0x7036, 0xa870, 0x708a,
+	0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x11b5,
+	0x2071, 0x1906, 0x080c, 0x6b45, 0x012e, 0x0470, 0x2001, 0x005b,
+	0x2004, 0x9094, 0x0780, 0x190c, 0x6b59, 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, 0x19d2, 0x683c, 0x9005, 0x0760, 0x0158, 0x9186, 0x0003,
+	0x0540, 0x2001, 0x1814, 0x2004, 0x2009, 0x1b1c, 0x210c, 0x9102,
+	0x1500, 0x0126, 0x2091, 0x8000, 0x2069, 0x0050, 0x693c, 0x6838,
+	0x9106, 0x0190, 0x0e04, 0x6b10, 0x2069, 0x0000, 0x6837, 0x8040,
+	0x6833, 0x0012, 0x6883, 0x8040, 0x2091, 0x4080, 0x2001, 0x0089,
+	0x2004, 0xd084, 0x190c, 0x11b5, 0x2069, 0x19d2, 0x683f, 0xffff,
+	0x012e, 0x00de, 0x0126, 0x2091, 0x8000, 0x1e0c, 0x6bda, 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, 0x1055, 0x0005, 0x012e,
+	0x0005, 0x2091, 0x8000, 0x0e04, 0x6b5b, 0x0006, 0x0016, 0x2001,
+	0x8004, 0x0006, 0x0804, 0x0d6e, 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, 0x11b5,
+	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, 0x1170, 0x2009,
+	0x182f, 0x210c, 0x918a, 0x0040, 0x0240, 0x7022, 0x2001, 0x1dc0,
+	0x200c, 0x8108, 0x2102, 0x00ee, 0x0058, 0x00ee, 0x2048, 0x702c,
+	0xa802, 0x2900, 0x702e, 0x70bc, 0x8000, 0x70be, 0x080c, 0x7ed6,
+	0x782c, 0x9094, 0x0780, 0x190c, 0x6b59, 0xd0a4, 0x19c8, 0x7838,
+	0x7938, 0x910e, 0x1de0, 0x00d6, 0x2069, 0x0000, 0x6836, 0x6833,
+	0x0013, 0x00de, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084,
+	0x190c, 0x11b5, 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, 0x11b5, 0x00fe, 0x0005, 0x782c,
+	0x9094, 0x0780, 0x190c, 0x6b59, 0xd0a4, 0x0db8, 0x00e6, 0x2071,
+	0x1800, 0x7824, 0x2048, 0x702c, 0xa802, 0x2900, 0x702e, 0x70bc,
+	0x8000, 0x70be, 0x080c, 0x7ed6, 0x782c, 0x9094, 0x0780, 0x190c,
+	0x6b59, 0xd0a4, 0x1d70, 0x00d6, 0x2069, 0x0050, 0x693c, 0x2069,
+	0x191a, 0x6808, 0x690a, 0x2069, 0x19d2, 0x9102, 0x1118, 0x683c,
+	0x9005, 0x1328, 0x2001, 0x191b, 0x200c, 0x810d, 0x693e, 0x00de,
+	0x00ee, 0x00fe, 0x0005, 0x7094, 0x908a, 0x0029, 0x1a0c, 0x0d65,
+	0x9082, 0x001d, 0x003b, 0x0026, 0x2011, 0x1e00, 0x080c, 0x282b,
+	0x002e, 0x0005, 0x6d02, 0x6c8c, 0x6ca8, 0x6cd0, 0x6cf1, 0x6d31,
+	0x6d43, 0x6ca8, 0x6d19, 0x6c47, 0x6c75, 0x6c46, 0x0005, 0x00d6,
+	0x2069, 0x0200, 0x6804, 0x9005, 0x1180, 0x6808, 0x9005, 0x1518,
+	0x7097, 0x0028, 0x2069, 0x195e, 0x2d04, 0x7002, 0x080c, 0x709d,
+	0x6028, 0x9085, 0x0600, 0x602a, 0x00b0, 0x7097, 0x0028, 0x2069,
+	0x195e, 0x2d04, 0x7002, 0x6028, 0x9085, 0x0600, 0x602a, 0x00e6,
+	0x0036, 0x0046, 0x0056, 0x2071, 0x1a3a, 0x080c, 0x193f, 0x005e,
+	0x004e, 0x003e, 0x00ee, 0x00de, 0x0005, 0x00d6, 0x2069, 0x0200,
+	0x6804, 0x9005, 0x1178, 0x6808, 0x9005, 0x1160, 0x7097, 0x0028,
+	0x2069, 0x195e, 0x2d04, 0x7002, 0x080c, 0x713f, 0x6028, 0x9085,
+	0x0600, 0x602a, 0x00de, 0x0005, 0x0006, 0x2001, 0x0090, 0x080c,
+	0x27f1, 0x000e, 0x6124, 0xd1e4, 0x1190, 0x080c, 0x6db4, 0xd1d4,
+	0x1160, 0xd1dc, 0x1138, 0xd1cc, 0x0150, 0x7097, 0x0020, 0x080c,
+	0x6db4, 0x0028, 0x7097, 0x001d, 0x0010, 0x7097, 0x001f, 0x0005,
+	0x2001, 0x0088, 0x080c, 0x27f1, 0x6124, 0xd1cc, 0x11d8, 0xd1dc,
+	0x11b0, 0xd1e4, 0x1188, 0x9184, 0x1e00, 0x11c8, 0x60e3, 0x0001,
+	0x600c, 0xc0b4, 0x600e, 0x080c, 0x6f88, 0x2001, 0x0080, 0x080c,
+	0x27f1, 0x7097, 0x0028, 0x0058, 0x7097, 0x001e, 0x0040, 0x7097,
+	0x001d, 0x0028, 0x7097, 0x0020, 0x0010, 0x7097, 0x001f, 0x0005,
+	0x60e3, 0x0001, 0x600c, 0xc0b4, 0x600e, 0x080c, 0x6f88, 0x2001,
+	0x0080, 0x080c, 0x27f1, 0x6124, 0xd1d4, 0x1180, 0xd1dc, 0x1158,
+	0xd1e4, 0x1130, 0x9184, 0x1e00, 0x1158, 0x7097, 0x0028, 0x0040,
+	0x7097, 0x001e, 0x0028, 0x7097, 0x001d, 0x0010, 0x7097, 0x001f,
+	0x0005, 0x2001, 0x00a0, 0x080c, 0x27f1, 0x6124, 0xd1dc, 0x1138,
+	0xd1e4, 0x0138, 0x080c, 0x1969, 0x7097, 0x001e, 0x0010, 0x7097,
+	0x001d, 0x0005, 0x080c, 0x6e3d, 0x6124, 0xd1dc, 0x1188, 0x080c,
+	0x6db4, 0x0016, 0x080c, 0x1969, 0x001e, 0xd1d4, 0x1128, 0xd1e4,
+	0x0138, 0x7097, 0x001e, 0x0020, 0x7097, 0x001f, 0x080c, 0x6db4,
+	0x0005, 0x0006, 0x2001, 0x00a0, 0x080c, 0x27f1, 0x000e, 0x6124,
+	0xd1d4, 0x1160, 0xd1cc, 0x1150, 0xd1dc, 0x1128, 0xd1e4, 0x0140,
+	0x7097, 0x001e, 0x0028, 0x7097, 0x001d, 0x0010, 0x7097, 0x0021,
+	0x0005, 0x080c, 0x6e3d, 0x6124, 0xd1d4, 0x1150, 0xd1dc, 0x1128,
+	0xd1e4, 0x0140, 0x7097, 0x001e, 0x0028, 0x7097, 0x001d, 0x0010,
+	0x7097, 0x001f, 0x0005, 0x0006, 0x2001, 0x0090, 0x080c, 0x27f1,
+	0x000e, 0x6124, 0xd1d4, 0x1178, 0xd1cc, 0x1150, 0xd1dc, 0x1128,
+	0xd1e4, 0x0158, 0x7097, 0x001e, 0x0040, 0x7097, 0x001d, 0x0028,
+	0x7097, 0x0020, 0x0010, 0x7097, 0x001f, 0x0005, 0x0016, 0x00c6,
+	0x00d6, 0x00e6, 0x0126, 0x2061, 0x0100, 0x2069, 0x0140, 0x2071,
+	0x1800, 0x2091, 0x8000, 0x080c, 0x6f5c, 0x11f8, 0x2001, 0x180c,
+	0x200c, 0xd1b4, 0x01d0, 0xc1b4, 0x2102, 0x0026, 0x2011, 0x0200,
+	0x080c, 0x282b, 0x002e, 0x080c, 0x27d7, 0x6024, 0xd0cc, 0x0148,
+	0x2001, 0x00a0, 0x080c, 0x27f1, 0x080c, 0x725c, 0x080c, 0x5be2,
+	0x0428, 0x6028, 0xc0cd, 0x602a, 0x0408, 0x080c, 0x6f76, 0x0150,
+	0x080c, 0x6f6d, 0x1138, 0x2001, 0x0001, 0x080c, 0x2394, 0x080c,
+	0x6f30, 0x00a0, 0x080c, 0x6e3a, 0x0178, 0x2001, 0x0001, 0x080c,
+	0x2394, 0x7094, 0x9086, 0x001e, 0x0120, 0x7094, 0x9086, 0x0022,
+	0x1118, 0x7097, 0x0025, 0x0010, 0x7097, 0x0021, 0x012e, 0x00ee,
+	0x00de, 0x00ce, 0x001e, 0x0005, 0x0026, 0x2011, 0x6dc5, 0x080c,
+	0x80bc, 0x002e, 0x0016, 0x0026, 0x2009, 0x0064, 0x2011, 0x6dc5,
+	0x080c, 0x80b3, 0x002e, 0x001e, 0x0005, 0x00e6, 0x00f6, 0x0016,
+	0x080c, 0x8e21, 0x2071, 0x1800, 0x080c, 0x6d5e, 0x001e, 0x00fe,
+	0x00ee, 0x0005, 0x0016, 0x0026, 0x0036, 0x00c6, 0x00d6, 0x00e6,
+	0x00f6, 0x0126, 0x080c, 0x8e21, 0x2061, 0x0100, 0x2069, 0x0140,
+	0x2071, 0x1800, 0x2091, 0x8000, 0x6028, 0xc09c, 0x602a, 0x080c,
+	0x9746, 0x2011, 0x0003, 0x080c, 0x91a3, 0x2011, 0x0002, 0x080c,
+	0x91ad, 0x080c, 0x9070, 0x080c, 0x8068, 0x0036, 0x901e, 0x080c,
+	0x90f0, 0x003e, 0x080c, 0x9762, 0x60e3, 0x0000, 0x080c, 0xd427,
+	0x080c, 0xd442, 0x2009, 0x0004, 0x080c, 0x27dd, 0x080c, 0x270a,
+	0x2001, 0x1800, 0x2003, 0x0004, 0x2011, 0x0008, 0x080c, 0x282b,
+	0x2011, 0x6dc5, 0x080c, 0x80bc, 0x080c, 0x6f76, 0x0118, 0x9006,
+	0x080c, 0x27f1, 0x080c, 0x0bab, 0x2001, 0x0001, 0x080c, 0x2394,
+	0x012e, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x003e, 0x002e, 0x001e,
+	0x0005, 0x0026, 0x00e6, 0x2011, 0x6dd2, 0x2071, 0x19d2, 0x701c,
+	0x9206, 0x1118, 0x7018, 0x9005, 0x0110, 0x9085, 0x0001, 0x00ee,
+	0x002e, 0x0005, 0x6020, 0xd09c, 0x0005, 0x6800, 0x9084, 0xfffe,
+	0x9086, 0x00c0, 0x01b8, 0x2001, 0x00c0, 0x080c, 0x27f1, 0x0156,
+	0x20a9, 0x002d, 0x1d04, 0x6e4a, 0x2091, 0x6000, 0x1f04, 0x6e4a,
+	0x015e, 0x00d6, 0x2069, 0x1800, 0x6898, 0x8001, 0x0220, 0x0118,
+	0x689a, 0x00de, 0x0005, 0x689b, 0x0014, 0x68e8, 0xd0dc, 0x0dc8,
+	0x6800, 0x9086, 0x0001, 0x1da8, 0x080c, 0x80c8, 0x0c90, 0x00c6,
+	0x00d6, 0x00e6, 0x2061, 0x0100, 0x2069, 0x0140, 0x2071, 0x1800,
+	0x080c, 0x726b, 0x2001, 0x193e, 0x2003, 0x0000, 0x9006, 0x7096,
+	0x60e2, 0x6886, 0x080c, 0x2463, 0x9006, 0x080c, 0x27f1, 0x080c,
+	0x5a9d, 0x0026, 0x2011, 0xffff, 0x080c, 0x282b, 0x002e, 0x602b,
+	0x182c, 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, 0x6f20, 0x7097,
+	0x0022, 0x0040, 0x7097, 0x0021, 0x0028, 0x7097, 0x0023, 0x0010,
+	0x7097, 0x0024, 0x60e3, 0x0000, 0x6887, 0x0001, 0x2001, 0x0001,
+	0x080c, 0x2463, 0x080c, 0x9746, 0x0026, 0x080c, 0x99eb, 0x002e,
+	0x080c, 0x9762, 0x7000, 0x908e, 0x0004, 0x0118, 0x602b, 0x0028,
+	0x0010, 0x602b, 0x0020, 0x0156, 0x0126, 0x2091, 0x8000, 0x20a9,
+	0x0005, 0x6024, 0xd0ac, 0x0150, 0x012e, 0x015e, 0x080c, 0xbdd7,
+	0x0118, 0x9006, 0x080c, 0x281b, 0x0804, 0x6f2c, 0x6800, 0x9084,
+	0x00a1, 0xc0bd, 0x6802, 0x080c, 0x27d7, 0x6904, 0xd1d4, 0x1140,
+	0x2001, 0x0100, 0x080c, 0x27f1, 0x1f04, 0x6ed1, 0x080c, 0x6fb3,
+	0x012e, 0x015e, 0x080c, 0x6f6d, 0x0170, 0x6044, 0x9005, 0x0130,
+	0x080c, 0x6fb3, 0x9006, 0x8001, 0x1df0, 0x0028, 0x6804, 0xd0d4,
+	0x1110, 0x080c, 0x6fb3, 0x080c, 0xbdd7, 0x0118, 0x9006, 0x080c,
+	0x281b, 0x0016, 0x0026, 0x7000, 0x908e, 0x0004, 0x0130, 0x2009,
+	0x00c8, 0x2011, 0x6dd2, 0x080c, 0x807a, 0x002e, 0x001e, 0x080c,
+	0x7ecd, 0x7034, 0xc085, 0x7036, 0x2001, 0x194e, 0x2003, 0x0004,
+	0x080c, 0x6c2b, 0x080c, 0x6f6d, 0x0138, 0x6804, 0xd0d4, 0x1120,
+	0xd0dc, 0x1100, 0x080c, 0x7261, 0x00ee, 0x00de, 0x00ce, 0x0005,
+	0x00c6, 0x00d6, 0x00e6, 0x2061, 0x0100, 0x2069, 0x0140, 0x2071,
+	0x1800, 0x080c, 0x7ee4, 0x080c, 0x7ed6, 0x080c, 0x726b, 0x2001,
+	0x193e, 0x2003, 0x0000, 0x9006, 0x7096, 0x60e2, 0x6886, 0x080c,
+	0x2463, 0x9006, 0x080c, 0x27f1, 0x6043, 0x0090, 0x6043, 0x0010,
+	0x0026, 0x2011, 0xffff, 0x080c, 0x282b, 0x002e, 0x602b, 0x182c,
+	0x00ee, 0x00de, 0x00ce, 0x0005, 0x0006, 0x2001, 0x194d, 0x2004,
+	0x9086, 0xaaaa, 0x000e, 0x0005, 0x0006, 0x080c, 0x52a1, 0x9084,
+	0x0030, 0x9086, 0x0000, 0x000e, 0x0005, 0x0006, 0x080c, 0x52a1,
+	0x9084, 0x0030, 0x9086, 0x0030, 0x000e, 0x0005, 0x0006, 0x080c,
+	0x52a1, 0x9084, 0x0030, 0x9086, 0x0010, 0x000e, 0x0005, 0x0006,
+	0x080c, 0x52a1, 0x9084, 0x0030, 0x9086, 0x0020, 0x000e, 0x0005,
+	0x0036, 0x0016, 0x2001, 0x180c, 0x2004, 0x908c, 0x0013, 0x0180,
+	0x0020, 0x080c, 0x2483, 0x900e, 0x0028, 0x080c, 0x6555, 0x1dc8,
+	0x2009, 0x0002, 0x2019, 0x0028, 0x080c, 0x2f80, 0x9006, 0x0019,
+	0x001e, 0x003e, 0x0005, 0x00e6, 0x2071, 0x180c, 0x2e04, 0x0130,
+	0x080c, 0xbdd0, 0x1128, 0x9085, 0x0010, 0x0010, 0x9084, 0xffef,
+	0x2072, 0x00ee, 0x0005, 0x6050, 0x0006, 0x60ec, 0x0006, 0x600c,
+	0x0006, 0x6004, 0x0006, 0x6028, 0x0006, 0x602f, 0x0100, 0x602f,
+	0x0000, 0x602f, 0x0040, 0x602f, 0x0000, 0x20a9, 0x0002, 0x080c,
+	0x27b8, 0x0026, 0x2011, 0x0040, 0x080c, 0x282b, 0x002e, 0x000e,
+	0x602a, 0x000e, 0x6006, 0x000e, 0x600e, 0x000e, 0x60ee, 0x60e3,
+	0x0000, 0x6887, 0x0001, 0x2001, 0x0001, 0x080c, 0x2463, 0x2001,
+	0x00a0, 0x0006, 0x080c, 0xbdd7, 0x000e, 0x0130, 0x080c, 0x280f,
+	0x9006, 0x080c, 0x281b, 0x0010, 0x080c, 0x27f1, 0x000e, 0x6052,
+	0x6050, 0x0006, 0xc0e5, 0x6052, 0x00f6, 0x2079, 0x0100, 0x080c,
+	0x2768, 0x00fe, 0x000e, 0x6052, 0x0005, 0x0156, 0x0016, 0x0026,
+	0x0036, 0x00c6, 0x00d6, 0x00e6, 0x2061, 0x0100, 0x2069, 0x0140,
+	0x2071, 0x1800, 0x080c, 0x97a4, 0x0158, 0x2001, 0x0386, 0x2004,
+	0xd0b4, 0x1130, 0x2001, 0x0016, 0x080c, 0x9737, 0x0804, 0x708f,
+	0x2001, 0x180c, 0x200c, 0xc1c4, 0x2102, 0x6028, 0x9084, 0xe1ff,
+	0x602a, 0x2011, 0x0200, 0x080c, 0x282b, 0x2001, 0x0090, 0x080c,
+	0x27f1, 0x20a9, 0x0366, 0x6024, 0xd0cc, 0x1558, 0x1d04, 0x702b,
+	0x2091, 0x6000, 0x1f04, 0x702b, 0x080c, 0x9746, 0x2011, 0x0003,
+	0x080c, 0x91a3, 0x2011, 0x0002, 0x080c, 0x91ad, 0x080c, 0x9070,
+	0x901e, 0x080c, 0x90f0, 0x2001, 0x0386, 0x2003, 0x7000, 0x080c,
+	0x9762, 0x2001, 0x00a0, 0x080c, 0x27f1, 0x080c, 0x725c, 0x080c,
+	0x5be2, 0x080c, 0xbdd7, 0x0110, 0x080c, 0x0cd1, 0x9085, 0x0001,
+	0x04e0, 0x2001, 0x0386, 0x2004, 0xd0ac, 0x0110, 0x080c, 0x1969,
+	0x60e3, 0x0000, 0x2001, 0x0002, 0x080c, 0x2463, 0x60e2, 0x2001,
+	0x0080, 0x080c, 0x27f1, 0x20a9, 0x0366, 0x2011, 0x1e00, 0x080c,
+	0x282b, 0x2009, 0x1e00, 0x080c, 0x27d7, 0x6024, 0x910c, 0x0140,
+	0x1d04, 0x706d, 0x2091, 0x6000, 0x1f04, 0x706d, 0x0804, 0x7034,
+	0x2001, 0x0386, 0x2003, 0x7000, 0x6028, 0x9085, 0x1e00, 0x602a,
+	0x70b0, 0x9005, 0x1118, 0x6887, 0x0001, 0x0008, 0x6886, 0x080c,
+	0xbdd7, 0x0110, 0x080c, 0x0cd1, 0x9006, 0x00ee, 0x00de, 0x00ce,
+	0x003e, 0x002e, 0x001e, 0x015e, 0x0005, 0x0156, 0x0016, 0x0026,
+	0x0036, 0x00c6, 0x00d6, 0x00e6, 0x2061, 0x0100, 0x2071, 0x1800,
+	0x7000, 0x9086, 0x0003, 0x1168, 0x2001, 0x020b, 0x2004, 0x9084,
+	0x5540, 0x9086, 0x5540, 0x1128, 0x2069, 0x1a45, 0x2d04, 0x8000,
+	0x206a, 0x2069, 0x0140, 0x6020, 0x9084, 0x00c0, 0x0120, 0x6884,
+	0x9005, 0x1904, 0x7106, 0x2001, 0x0088, 0x080c, 0x27f1, 0x9006,
+	0x60e2, 0x6886, 0x080c, 0x2463, 0x2069, 0x0200, 0x6804, 0x9005,
+	0x1118, 0x6808, 0x9005, 0x01d0, 0x6028, 0x9084, 0xfbff, 0x602a,
+	0x2011, 0x0400, 0x080c, 0x282b, 0x2069, 0x195e, 0x7000, 0x206a,
+	0x7097, 0x0026, 0x7003, 0x0001, 0x20a9, 0x0002, 0x1d04, 0x70e6,
+	0x2091, 0x6000, 0x1f04, 0x70e6, 0x0804, 0x7137, 0x2069, 0x0140,
+	0x20a9, 0x0384, 0x2011, 0x1e00, 0x080c, 0x282b, 0x2009, 0x1e00,
+	0x080c, 0x27d7, 0x6024, 0x910c, 0x0528, 0x9084, 0x1a00, 0x1510,
+	0x1d04, 0x70f2, 0x2091, 0x6000, 0x1f04, 0x70f2, 0x080c, 0x9746,
+	0x2011, 0x0003, 0x080c, 0x91a3, 0x2011, 0x0002, 0x080c, 0x91ad,
+	0x080c, 0x9070, 0x901e, 0x080c, 0x90f0, 0x080c, 0x9762, 0x2001,
+	0x00a0, 0x080c, 0x27f1, 0x080c, 0x725c, 0x080c, 0x5be2, 0x9085,
+	0x0001, 0x00a8, 0x2001, 0x0080, 0x080c, 0x27f1, 0x2069, 0x0140,
+	0x60e3, 0x0000, 0x70b0, 0x9005, 0x1118, 0x6887, 0x0001, 0x0008,
+	0x6886, 0x2001, 0x0002, 0x080c, 0x2463, 0x60e2, 0x9006, 0x00ee,
+	0x00de, 0x00ce, 0x003e, 0x002e, 0x001e, 0x015e, 0x0005, 0x0156,
+	0x0016, 0x0026, 0x0036, 0x00c6, 0x00d6, 0x00e6, 0x2061, 0x0100,
+	0x2071, 0x1800, 0x6020, 0x9084, 0x00c0, 0x01e8, 0x080c, 0x9746,
+	0x2011, 0x0003, 0x080c, 0x91a3, 0x2011, 0x0002, 0x080c, 0x91ad,
+	0x080c, 0x9070, 0x901e, 0x080c, 0x90f0, 0x080c, 0x9762, 0x2069,
+	0x0140, 0x2001, 0x00a0, 0x080c, 0x27f1, 0x080c, 0x725c, 0x080c,
+	0x5be2, 0x0804, 0x71d9, 0x2001, 0x180c, 0x200c, 0xd1b4, 0x1160,
+	0xc1b5, 0x2102, 0x080c, 0x6dba, 0x2069, 0x0140, 0x2001, 0x0080,
+	0x080c, 0x27f1, 0x60e3, 0x0000, 0x2069, 0x0200, 0x6804, 0x9005,
+	0x1118, 0x6808, 0x9005, 0x0190, 0x6028, 0x9084, 0xfdff, 0x602a,
+	0x2011, 0x0200, 0x080c, 0x282b, 0x2069, 0x195e, 0x7000, 0x206a,
+	0x7097, 0x0027, 0x7003, 0x0001, 0x0804, 0x71d9, 0x2011, 0x1e00,
+	0x080c, 0x282b, 0x2009, 0x1e00, 0x080c, 0x27d7, 0x6024, 0x910c,
+	0x01c8, 0x9084, 0x1c00, 0x11b0, 0x1d04, 0x7196, 0x0006, 0x0016,
+	0x00c6, 0x00d6, 0x00e6, 0x080c, 0x7f15, 0x00ee, 0x00de, 0x00ce,
+	0x001e, 0x000e, 0x00e6, 0x2071, 0x19d2, 0x7018, 0x00ee, 0x9005,
+	0x19e8, 0x01f8, 0x0026, 0x2011, 0x6dd2, 0x080c, 0x7fbb, 0x2011,
+	0x6dc5, 0x080c, 0x80bc, 0x002e, 0x2069, 0x0140, 0x60e3, 0x0000,
+	0x70b0, 0x9005, 0x1118, 0x6887, 0x0001, 0x0008, 0x6886, 0x2001,
+	0x0002, 0x080c, 0x2463, 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, 0xbdd0, 0x1904, 0x7246,
+	0x7130, 0xd184, 0x1170, 0x080c, 0x313d, 0x0138, 0xc18d, 0x7132,
+	0x2011, 0x1854, 0x2214, 0xd2ac, 0x1120, 0x7030, 0xd08c, 0x0904,
+	0x7246, 0x2011, 0x1854, 0x220c, 0x0438, 0x0016, 0x2019, 0x000e,
+	0x080c, 0xd046, 0x0156, 0x00b6, 0x20a9, 0x007f, 0x900e, 0x9186,
+	0x007e, 0x01a0, 0x9186, 0x0080, 0x0188, 0x080c, 0x6166, 0x1170,
+	0x2120, 0x9006, 0x0016, 0x2009, 0x000e, 0x080c, 0xd0ce, 0x2009,
+	0x0001, 0x2011, 0x0100, 0x080c, 0x8248, 0x001e, 0x8108, 0x1f04,
+	0x720f, 0x00be, 0x015e, 0x001e, 0xd1ac, 0x1148, 0x0016, 0x2009,
+	0x0002, 0x2019, 0x0004, 0x080c, 0x2f80, 0x001e, 0x0078, 0x0156,
+	0x00b6, 0x20a9, 0x007f, 0x900e, 0x080c, 0x6166, 0x1110, 0x080c,
+	0x5bfc, 0x8108, 0x1f04, 0x723c, 0x00be, 0x015e, 0x080c, 0x1969,
+	0x080c, 0x9746, 0x080c, 0x99eb, 0x080c, 0x9762, 0x60e3, 0x0000,
+	0x080c, 0x5be2, 0x080c, 0x6e8d, 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, 0x103c,
+	0x090c, 0x0d65, 0xa8ab, 0xdcb0, 0x2900, 0x704e, 0x080c, 0x103c,
+	0x090c, 0x0d65, 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, 0x7853, 0x9006, 0x00ee, 0x0005, 0x900e, 0x0156,
+	0x20a9, 0x0006, 0x8003, 0x818d, 0x1f04, 0x72d2, 0x015e, 0x0005,
+	0x2079, 0x0040, 0x2071, 0x18f0, 0x7004, 0x0002, 0x72e8, 0x72e9,
+	0x7334, 0x738f, 0x74bb, 0x72e6, 0x72e6, 0x74e5, 0x080c, 0x0d65,
+	0x0005, 0x2079, 0x0040, 0x2001, 0x1dc0, 0x2003, 0x0000, 0x782c,
+	0x908c, 0x0780, 0x190c, 0x78df, 0xd0a4, 0x0570, 0x2001, 0x1dc0,
+	0x2004, 0x9082, 0x0080, 0x1640, 0x1d04, 0x7306, 0x2001, 0x19d5,
+	0x200c, 0x8109, 0x0508, 0x2091, 0x6000, 0x2102, 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, 0x1968, 0x080c, 0x738f, 0x782c, 0xd09c, 0x090c, 0x7853,
+	0x0005, 0x9082, 0x005a, 0x1218, 0x2100, 0x003b, 0x0c18, 0x080c,
+	0x73c5, 0x0c90, 0x00e3, 0x08f0, 0x0005, 0x73c5, 0x73c5, 0x73c5,
+	0x73c5, 0x73c5, 0x73c5, 0x73c5, 0x73c5, 0x73e7, 0x73c5, 0x73c5,
+	0x73c5, 0x73c5, 0x73c5, 0x73c5, 0x73c5, 0x73c5, 0x73c5, 0x73c5,
+	0x73c5, 0x73c5, 0x73c5, 0x73c5, 0x73c5, 0x73c5, 0x73c5, 0x73c5,
+	0x73c5, 0x73d1, 0x73c5, 0x75ba, 0x73c5, 0x73c5, 0x73c5, 0x73c5,
+	0x73c5, 0x73d1, 0x75fb, 0x763c, 0x7683, 0x7697, 0x73c5, 0x73c5,
+	0x73e7, 0x73d1, 0x73c5, 0x73c5, 0x748f, 0x7742, 0x775d, 0x73c5,
+	0x73e7, 0x73c5, 0x73c5, 0x73c5, 0x73c5, 0x7485, 0x775d, 0x73c5,
+	0x73c5, 0x73c5, 0x73c5, 0x73c5, 0x73c5, 0x73c5, 0x73c5, 0x73c5,
+	0x73fb, 0x73c5, 0x73c5, 0x73c5, 0x73c5, 0x73c5, 0x73c5, 0x73c5,
+	0x73c5, 0x73c5, 0x7883, 0x73c5, 0x73c5, 0x73c5, 0x73c5, 0x73c5,
+	0x740f, 0x73c5, 0x73c5, 0x73c5, 0x73c5, 0x73c5, 0x73c5, 0x2079,
+	0x0040, 0x7004, 0x9086, 0x0003, 0x1198, 0x782c, 0x080c, 0x787c,
+	0xd0a4, 0x0170, 0x7824, 0x2048, 0x9006, 0xa802, 0xa806, 0xa864,
+	0x9084, 0x00ff, 0x908a, 0x001a, 0x1210, 0x002b, 0x0c50, 0x00e9,
+	0x080c, 0x7853, 0x0005, 0x73c5, 0x73d1, 0x75a6, 0x73c5, 0x73d1,
+	0x73c5, 0x73d1, 0x73d1, 0x73c5, 0x73d1, 0x75a6, 0x73d1, 0x73d1,
+	0x73d1, 0x73d1, 0x73d1, 0x73c5, 0x73d1, 0x75a6, 0x73c5, 0x73c5,
+	0x73d1, 0x73c5, 0x73c5, 0x73c5, 0x73d1, 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, 0x683f, 0x012e, 0x0005, 0xa864,
+	0x8007, 0x9084, 0x00ff, 0x0d08, 0x8001, 0x1120, 0x7007, 0x0001,
+	0x0804, 0x7564, 0x7007, 0x0003, 0x7012, 0x2900, 0x7016, 0x701a,
+	0x704b, 0x7564, 0x0005, 0xa864, 0x8007, 0x9084, 0x00ff, 0x0968,
+	0x8001, 0x1120, 0x7007, 0x0001, 0x0804, 0x757f, 0x7007, 0x0003,
+	0x7012, 0x2900, 0x7016, 0x701a, 0x704b, 0x757f, 0x0005, 0xa864,
+	0x8007, 0x9084, 0x00ff, 0x9086, 0x0001, 0x1904, 0x73cd, 0x7007,
+	0x0001, 0x2009, 0x1833, 0x210c, 0x81ff, 0x15f0, 0xa994, 0x9186,
+	0x006f, 0x0158, 0x9186, 0x0074, 0x1510, 0x0026, 0x2011, 0x0010,
+	0x080c, 0x6581, 0x002e, 0x01d8, 0x0090, 0x080c, 0x6f5c, 0x0140,
+	0xa897, 0x4005, 0xa89b, 0x0016, 0x2001, 0x0030, 0x900e, 0x00c8,
+	0x0026, 0x2011, 0x8008, 0x080c, 0x6581, 0x002e, 0x0140, 0xa897,
+	0x4005, 0xa89b, 0x4009, 0x2001, 0x0030, 0x900e, 0x0050, 0xa868,
+	0x9084, 0x00ff, 0xa86a, 0xa883, 0x0000, 0x080c, 0x5e0d, 0x1108,
+	0x0005, 0x0126, 0x2091, 0x8000, 0xa867, 0x0139, 0xa87a, 0xa982,
+	0x080c, 0x683f, 0x012e, 0x0ca0, 0xa994, 0x9186, 0x0071, 0x0904,
+	0x741e, 0x9186, 0x0064, 0x0904, 0x741e, 0x9186, 0x007c, 0x0904,
+	0x741e, 0x9186, 0x0028, 0x0904, 0x741e, 0x9186, 0x0038, 0x0904,
+	0x741e, 0x9186, 0x0078, 0x0904, 0x741e, 0x9186, 0x005f, 0x0904,
+	0x741e, 0x9186, 0x0056, 0x0904, 0x741e, 0xa897, 0x4005, 0xa89b,
+	0x0001, 0x2001, 0x0030, 0x900e, 0x0860, 0xa87c, 0x9084, 0x00c0,
+	0x9086, 0x00c0, 0x1120, 0x7007, 0x0001, 0x0804, 0x7774, 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,
+	0x73d5, 0xaab4, 0x928a, 0x0002, 0x1a04, 0x73d5, 0x82ff, 0x1138,
+	0xa8b8, 0xa9bc, 0x9105, 0x0118, 0x2001, 0x7522, 0x0018, 0x9280,
+	0x7518, 0x2005, 0x7056, 0x7010, 0x9015, 0x0904, 0x7503, 0x080c,
+	0x103c, 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, 0x1103, 0xa06c, 0x908e, 0x0100,
+	0x0170, 0x9086, 0x0200, 0x0118, 0x7007, 0x0007, 0x0005, 0x7020,
+	0x2048, 0x080c, 0x1055, 0x7014, 0x2048, 0x0804, 0x73d5, 0x7020,
+	0x2048, 0x7018, 0xa802, 0xa807, 0x0000, 0x2908, 0x2048, 0xa906,
+	0x711a, 0x0804, 0x74bb, 0x7014, 0x2048, 0x7007, 0x0001, 0xa8b4,
+	0x9005, 0x1128, 0xa8b8, 0xa9bc, 0x9105, 0x0108, 0x00b9, 0xa864,
+	0x9084, 0x00ff, 0x9086, 0x001e, 0x0904, 0x7774, 0x0804, 0x7564,
+	0x751a, 0x751e, 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, 0x1833, 0x210c, 0x81ff,
+	0x1178, 0x080c, 0x5c5c, 0x1108, 0x0005, 0x080c, 0x6a5c, 0x0126,
+	0x2091, 0x8000, 0x080c, 0xb9bc, 0x080c, 0x683f, 0x012e, 0x0ca0,
+	0x080c, 0xbdd0, 0x1d70, 0x2001, 0x0028, 0x900e, 0x0c70, 0x2009,
+	0x1833, 0x210c, 0x81ff, 0x11d8, 0xa888, 0x9005, 0x01e0, 0xa883,
+	0x0000, 0xa87c, 0xd0f4, 0x0120, 0x080c, 0x5d6f, 0x1138, 0x0005,
+	0x9006, 0xa87a, 0x080c, 0x5cea, 0x1108, 0x0005, 0x0126, 0x2091,
+	0x8000, 0xa87a, 0xa982, 0x080c, 0x683f, 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, 0x6166, 0x11b8, 0x0066, 0xae80, 0x080c,
+	0x6276, 0x006e, 0x0088, 0x0046, 0x2011, 0x180c, 0x2224, 0xc484,
+	0x2412, 0x004e, 0x00c6, 0x080c, 0x6166, 0x1110, 0x080c, 0x6445,
+	0x8108, 0x1f04, 0x75e3, 0x00ce, 0xa87c, 0xd084, 0x1120, 0x080c,
+	0x1055, 0x00be, 0x0005, 0x0126, 0x2091, 0x8000, 0x080c, 0x683f,
+	0x012e, 0x00be, 0x0005, 0x0126, 0x2091, 0x8000, 0x7007, 0x0001,
+	0x080c, 0x6559, 0x0580, 0x2061, 0x1a3d, 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, 0x783d, 0x012e, 0x0804, 0x7837, 0x012e, 0x0804,
+	0x7831, 0x012e, 0x0804, 0x7834, 0x0126, 0x2091, 0x8000, 0x7007,
+	0x0001, 0x080c, 0x6559, 0x05e0, 0x2061, 0x1a3d, 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, 0x783d, 0x012e, 0x0804, 0x783a,
+	0x012e, 0x0804, 0x7837, 0x0126, 0x2091, 0x8000, 0x7007, 0x0001,
+	0x2061, 0x1a3d, 0x6300, 0xd38c, 0x1120, 0x6308, 0x8318, 0x0220,
+	0x630a, 0x012e, 0x0804, 0x784b, 0x012e, 0x0804, 0x783a, 0x00b6,
+	0x0126, 0x00c6, 0x2091, 0x8000, 0x7007, 0x0001, 0xa87c, 0xd0ac,
+	0x0148, 0x00c6, 0x2061, 0x1a3d, 0x6000, 0x9084, 0xfcff, 0x6002,
+	0x00ce, 0x0440, 0xa888, 0x9005, 0x05d8, 0xa88c, 0x9065, 0x0598,
+	0x2001, 0x1833, 0x2004, 0x9005, 0x0118, 0x080c, 0x9a9f, 0x0068,
+	0x6017, 0xf400, 0x6063, 0x0000, 0xa97c, 0xd1a4, 0x0110, 0xa980,
+	0x6162, 0x2009, 0x0041, 0x080c, 0x9b03, 0xa988, 0x918c, 0xff00,
+	0x9186, 0x2000, 0x1138, 0x0026, 0x900e, 0x2011, 0xfdff, 0x080c,
+	0x8248, 0x002e, 0xa87c, 0xd0c4, 0x0148, 0x2061, 0x1a3d, 0x6000,
+	0xd08c, 0x1120, 0x6008, 0x8000, 0x0208, 0x600a, 0x00ce, 0x012e,
+	0x00be, 0x0804, 0x783d, 0x00ce, 0x012e, 0x00be, 0x0804, 0x7837,
+	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, 0x6166, 0x1968, 0xb800, 0xc0e4, 0xb802,
+	0x0848, 0xa88c, 0x9065, 0x09b8, 0x6007, 0x0024, 0x2001, 0x1955,
+	0x2004, 0x601a, 0x0804, 0x76d2, 0xa88c, 0x9065, 0x0960, 0x00e6,
+	0xa890, 0x9075, 0x2001, 0x1833, 0x2004, 0x9005, 0x0150, 0x080c,
+	0x9a9f, 0x8eff, 0x0118, 0x2e60, 0x080c, 0x9a9f, 0x00ee, 0x0804,
+	0x76d2, 0x6024, 0xc0dc, 0xc0d5, 0x6026, 0x2e60, 0x6007, 0x003a,
+	0xa8a0, 0x9005, 0x0130, 0x6007, 0x003b, 0xa8a4, 0x602e, 0xa8a8,
+	0x6016, 0x6003, 0x0001, 0x2009, 0x8020, 0x080c, 0x832e, 0x00ee,
+	0x0804, 0x76d2, 0x2061, 0x1a3d, 0x6000, 0xd084, 0x0190, 0xd08c,
+	0x1904, 0x784b, 0x0126, 0x2091, 0x8000, 0x6204, 0x8210, 0x0220,
+	0x6206, 0x012e, 0x0804, 0x784b, 0x012e, 0xa883, 0x0016, 0x0804,
+	0x7844, 0xa883, 0x0007, 0x0804, 0x7844, 0xa864, 0x8007, 0x9084,
+	0x00ff, 0x0130, 0x8001, 0x1138, 0x7007, 0x0001, 0x0069, 0x0005,
+	0x080c, 0x73cd, 0x0040, 0x7007, 0x0003, 0x7012, 0x2900, 0x7016,
+	0x701a, 0x704b, 0x7774, 0x0005, 0x00b6, 0x00e6, 0x0126, 0x2091,
+	0x8000, 0x903e, 0x2061, 0x1800, 0x61cc, 0x81ff, 0x1904, 0x77f6,
+	0x6130, 0xd194, 0x1904, 0x7820, 0xa878, 0x2070, 0x9e82, 0x1ddc,
+	0x0a04, 0x77ea, 0x6064, 0x9e02, 0x1a04, 0x77ea, 0x7120, 0x9186,
+	0x0006, 0x1904, 0x77dc, 0x7010, 0x905d, 0x0904, 0x77f6, 0xb800,
+	0xd0e4, 0x1904, 0x781a, 0x2061, 0x1a3d, 0x6100, 0x9184, 0x0301,
+	0x9086, 0x0001, 0x15a0, 0x7024, 0xd0dc, 0x1904, 0x7823, 0xa883,
+	0x0000, 0xa803, 0x0000, 0x2908, 0x7014, 0x9005, 0x1198, 0x7116,
+	0xa87c, 0xd0f4, 0x1904, 0x7826, 0x080c, 0x529d, 0xd09c, 0x1118,
+	0xa87c, 0xc0cc, 0xa87e, 0x2e60, 0x080c, 0x813b, 0x012e, 0x00ee,
+	0x00be, 0x0005, 0x2048, 0xa800, 0x9005, 0x1de0, 0xa902, 0x2148,
+	0xa87c, 0xd0f4, 0x1904, 0x7826, 0x012e, 0x00ee, 0x00be, 0x0005,
+	0x012e, 0x00ee, 0xa883, 0x0006, 0x00be, 0x0804, 0x7844, 0xd184,
+	0x0db8, 0xd1c4, 0x1190, 0x00a0, 0xa974, 0x080c, 0x6166, 0x15d0,
+	0xb800, 0xd0e4, 0x15b8, 0x7120, 0x9186, 0x0007, 0x1118, 0xa883,
+	0x0002, 0x0490, 0xa883, 0x0008, 0x0478, 0xa883, 0x000e, 0x0460,
+	0xa883, 0x0017, 0x0448, 0xa883, 0x0035, 0x0430, 0x080c, 0x52a1,
+	0xd0fc, 0x01e8, 0xa878, 0x2070, 0x9e82, 0x1ddc, 0x02c0, 0x6064,
+	0x9e02, 0x12a8, 0x7120, 0x9186, 0x0006, 0x1188, 0x7010, 0x905d,
+	0x0170, 0xb800, 0xd0bc, 0x0158, 0x2039, 0x0001, 0x7000, 0x9086,
+	0x0007, 0x1904, 0x7780, 0x7003, 0x0002, 0x0804, 0x7780, 0xa883,
+	0x0028, 0x0010, 0xa883, 0x0029, 0x012e, 0x00ee, 0x00be, 0x0420,
+	0xa883, 0x002a, 0x0cc8, 0xa883, 0x0045, 0x0cb0, 0x2e60, 0x2019,
+	0x0002, 0x601b, 0x0014, 0x080c, 0xcc56, 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,
+	0x683f, 0x012e, 0x0005, 0x080c, 0x1055, 0x0005, 0x00d6, 0x080c,
+	0x8132, 0x00de, 0x0005, 0x00d6, 0x00e6, 0x0126, 0x2091, 0x8000,
+	0x2071, 0x0040, 0x702c, 0xd084, 0x01d8, 0x908c, 0x0780, 0x190c,
+	0x78df, 0xd09c, 0x11a8, 0x2071, 0x1800, 0x70bc, 0x90ea, 0x0040,
+	0x0278, 0x8001, 0x70be, 0x702c, 0x2048, 0xa800, 0x702e, 0x9006,
+	0xa802, 0xa806, 0x2071, 0x0040, 0x2900, 0x7022, 0x702c, 0x0c28,
+	0x012e, 0x00ee, 0x00de, 0x0005, 0x0006, 0x9084, 0x0780, 0x190c,
+	0x78df, 0x000e, 0x0005, 0x00d6, 0x00c6, 0x0036, 0x0026, 0x0016,
+	0x00b6, 0x7007, 0x0001, 0xaa74, 0x9282, 0x0004, 0x1a04, 0x78d0,
+	0xa97c, 0x9188, 0x1000, 0x2104, 0x905d, 0xb804, 0xd284, 0x0140,
+	0x05e8, 0x8007, 0x9084, 0x00ff, 0x9084, 0x0006, 0x1108, 0x04b0,
+	0x2b10, 0x080c, 0x9a0f, 0x1118, 0x080c, 0x9ad6, 0x05a8, 0x6212,
+	0xa874, 0x0002, 0x78ae, 0x78b3, 0x78b6, 0x78bc, 0x2019, 0x0002,
+	0x080c, 0xd046, 0x0060, 0x080c, 0xcfd6, 0x0048, 0x2019, 0x0002,
+	0xa980, 0x080c, 0xcff5, 0x0018, 0xa980, 0x080c, 0xcfd6, 0x080c,
+	0x9a65, 0xa887, 0x0000, 0x0126, 0x2091, 0x8000, 0x080c, 0x683f,
+	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, 0x78e1, 0x0006, 0x0016, 0x2001, 0x8003, 0x0006,
+	0x0804, 0x0d6e, 0x0005, 0x00f6, 0x2079, 0x0300, 0x2001, 0x0200,
+	0x200c, 0xc1e5, 0xc1dc, 0x2102, 0x2009, 0x0218, 0x210c, 0xd1ec,
+	0x1120, 0x080c, 0x1524, 0x00fe, 0x0005, 0x2001, 0x020d, 0x2003,
+	0x0020, 0x781f, 0x0300, 0x00fe, 0x0005, 0x781c, 0xd08c, 0x0904,
+	0x794d, 0x68bc, 0x90aa, 0x0005, 0x0a04, 0x7ecd, 0x7d44, 0x7c40,
+	0xd59c, 0x190c, 0x0d65, 0x9584, 0x00f6, 0x1508, 0x9484, 0x7000,
+	0x0138, 0x908a, 0x2000, 0x1258, 0x9584, 0x0700, 0x8007, 0x0470,
+	0x7000, 0x9084, 0xff00, 0x9086, 0x8100, 0x0db0, 0x00b0, 0x9484,
+	0x0fff, 0x1130, 0x7000, 0x9084, 0xff00, 0x9086, 0x8100, 0x11c0,
+	0x080c, 0xd3ff, 0x080c, 0x7e14, 0x7817, 0x0140, 0x00a8, 0x9584,
+	0x0076, 0x1118, 0x080c, 0x7e70, 0x19c8, 0xd5a4, 0x0148, 0x0046,
+	0x0056, 0x080c, 0x799d, 0x080c, 0x1f82, 0x005e, 0x004e, 0x0020,
+	0x080c, 0xd3ff, 0x7817, 0x0140, 0x0489, 0x0005, 0x0002, 0x795a,
+	0x7c36, 0x7957, 0x7957, 0x7957, 0x7957, 0x7957, 0x7957, 0x7817,
+	0x0140, 0x0005, 0x7000, 0x908c, 0xff00, 0x9194, 0xf000, 0x810f,
+	0x9484, 0x0fff, 0x688e, 0x9286, 0x2000, 0x1150, 0x6800, 0x9086,
+	0x0001, 0x1118, 0x080c, 0x52f4, 0x0070, 0x080c, 0x79bd, 0x0058,
+	0x9286, 0x3000, 0x1118, 0x080c, 0x7b73, 0x0028, 0x9286, 0x8000,
+	0x1110, 0x080c, 0x7d4a, 0x7817, 0x0140, 0x0005, 0x2001, 0x1810,
+	0x2004, 0xd08c, 0x0178, 0x2001, 0x1800, 0x2004, 0x9086, 0x0003,
+	0x1148, 0x0026, 0x0036, 0x2011, 0x8048, 0x2518, 0x080c, 0x47fb,
+	0x003e, 0x002e, 0x0005, 0x0036, 0x0046, 0x0056, 0x00f6, 0x2079,
+	0x0200, 0x2019, 0xfffe, 0x7c30, 0x0050, 0x0036, 0x0046, 0x0056,
+	0x00f6, 0x2079, 0x0200, 0x7d44, 0x7c40, 0x2019, 0xffff, 0x2001,
+	0x1810, 0x2004, 0xd08c, 0x0160, 0x2001, 0x1800, 0x2004, 0x9086,
+	0x0003, 0x1130, 0x0026, 0x2011, 0x8048, 0x080c, 0x47fb, 0x002e,
+	0x00fe, 0x005e, 0x004e, 0x003e, 0x0005, 0x00b6, 0x00c6, 0x7010,
+	0x9084, 0xff00, 0x8007, 0x9096, 0x0001, 0x0120, 0x9096, 0x0023,
+	0x1904, 0x7b44, 0x9186, 0x0023, 0x15c0, 0x080c, 0x7ddf, 0x0904,
+	0x7b44, 0x6120, 0x9186, 0x0001, 0x0150, 0x9186, 0x0004, 0x0138,
+	0x9186, 0x0008, 0x0120, 0x9186, 0x000a, 0x1904, 0x7b44, 0x7124,
+	0x610a, 0x7030, 0x908e, 0x0200, 0x1130, 0x2009, 0x0015, 0x080c,
+	0x9b03, 0x0804, 0x7b44, 0x908e, 0x0214, 0x0118, 0x908e, 0x0210,
+	0x1130, 0x2009, 0x0015, 0x080c, 0x9b03, 0x0804, 0x7b44, 0x908e,
+	0x0100, 0x1904, 0x7b44, 0x7034, 0x9005, 0x1904, 0x7b44, 0x2009,
+	0x0016, 0x080c, 0x9b03, 0x0804, 0x7b44, 0x9186, 0x0022, 0x1904,
+	0x7b44, 0x7030, 0x908e, 0x0300, 0x1580, 0x68d8, 0xd0a4, 0x0528,
+	0xc0b5, 0x68da, 0x7100, 0x918c, 0x00ff, 0x697a, 0x7004, 0x687e,
+	0x00f6, 0x2079, 0x0100, 0x79e6, 0x78ea, 0x0006, 0x9084, 0x00ff,
+	0x0016, 0x2008, 0x080c, 0x2438, 0x7932, 0x7936, 0x001e, 0x000e,
+	0x00fe, 0x080c, 0x23ef, 0x695a, 0x703c, 0x00e6, 0x2071, 0x0140,
+	0x7086, 0x2071, 0x1800, 0x70b2, 0x00ee, 0x7034, 0x9005, 0x1904,
+	0x7b44, 0x2009, 0x0017, 0x0804, 0x7b11, 0x908e, 0x0400, 0x1190,
+	0x7034, 0x9005, 0x1904, 0x7b44, 0x080c, 0x6f5c, 0x0120, 0x2009,
+	0x001d, 0x0804, 0x7b11, 0x68d8, 0xc0a5, 0x68da, 0x2009, 0x0030,
+	0x0804, 0x7b11, 0x908e, 0x0500, 0x1140, 0x7034, 0x9005, 0x1904,
+	0x7b44, 0x2009, 0x0018, 0x0804, 0x7b11, 0x908e, 0x2010, 0x1120,
+	0x2009, 0x0019, 0x0804, 0x7b11, 0x908e, 0x2110, 0x1120, 0x2009,
+	0x001a, 0x0804, 0x7b11, 0x908e, 0x5200, 0x1140, 0x7034, 0x9005,
+	0x1904, 0x7b44, 0x2009, 0x001b, 0x0804, 0x7b11, 0x908e, 0x5000,
+	0x1140, 0x7034, 0x9005, 0x1904, 0x7b44, 0x2009, 0x001c, 0x0804,
+	0x7b11, 0x908e, 0x1300, 0x1120, 0x2009, 0x0034, 0x0804, 0x7b11,
+	0x908e, 0x1200, 0x1140, 0x7034, 0x9005, 0x1904, 0x7b44, 0x2009,
+	0x0024, 0x0804, 0x7b11, 0x908c, 0xff00, 0x918e, 0x2400, 0x1170,
+	0x2009, 0x002d, 0x2001, 0x1810, 0x2004, 0xd09c, 0x0904, 0x7b11,
+	0x080c, 0xc495, 0x1904, 0x7b44, 0x0804, 0x7b0f, 0x908c, 0xff00,
+	0x918e, 0x5300, 0x1120, 0x2009, 0x002a, 0x0804, 0x7b11, 0x908e,
+	0x0f00, 0x1120, 0x2009, 0x0020, 0x0804, 0x7b11, 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, 0x47fb,
+	0x004e, 0x8108, 0x0f04, 0x7add, 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, 0x6838, 0xd0d4, 0x0110, 0x2009,
+	0x004c, 0x0016, 0x2011, 0x0263, 0x2204, 0x8211, 0x220c, 0x080c,
+	0x23ef, 0x1568, 0x080c, 0x6106, 0x1550, 0xbe12, 0xbd16, 0x001e,
+	0x0016, 0xb884, 0x9005, 0x1168, 0x9186, 0x0046, 0x1150, 0x6878,
+	0x9606, 0x1138, 0x687c, 0x9506, 0x9084, 0xff00, 0x1110, 0x001e,
+	0x0098, 0x080c, 0x9a0f, 0x01a8, 0x2b08, 0x6112, 0x6023, 0x0004,
+	0x7120, 0x610a, 0x001e, 0x9186, 0x004c, 0x1110, 0x6023, 0x000a,
+	0x0016, 0x001e, 0x080c, 0x9b03, 0x00ce, 0x00be, 0x0005, 0x001e,
+	0x0cd8, 0x2001, 0x180e, 0x2004, 0xd0ec, 0x0120, 0x2011, 0x8049,
+	0x080c, 0x47fb, 0x080c, 0x9ad6, 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, 0x8335, 0x08a0, 0x080c, 0x3107, 0x1140, 0x7010, 0x9084,
+	0xff00, 0x8007, 0x908e, 0x0008, 0x1108, 0x0009, 0x0005, 0x00b6,
+	0x00c6, 0x0046, 0x7000, 0x908c, 0xff00, 0x810f, 0x9186, 0x0033,
+	0x11e8, 0x080c, 0x7ddf, 0x0904, 0x7bce, 0x7124, 0x610a, 0x7030,
+	0x908e, 0x0200, 0x1140, 0x7034, 0x9005, 0x15c0, 0x2009, 0x0015,
+	0x080c, 0x9b03, 0x0498, 0x908e, 0x0100, 0x1580, 0x7034, 0x9005,
+	0x1568, 0x2009, 0x0016, 0x080c, 0x9b03, 0x0440, 0x9186, 0x0032,
+	0x1528, 0x7030, 0x908e, 0x1400, 0x1508, 0x2009, 0x0038, 0x0016,
+	0x2011, 0x0263, 0x2204, 0x8211, 0x220c, 0x080c, 0x23ef, 0x11a8,
+	0x080c, 0x6106, 0x1190, 0xbe12, 0xbd16, 0x080c, 0x9a0f, 0x0168,
+	0x2b08, 0x6112, 0x080c, 0xbb52, 0x6023, 0x0004, 0x7120, 0x610a,
+	0x001e, 0x080c, 0x9b03, 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, 0x7c30, 0x9596, 0xfffe, 0x1120,
+	0x2009, 0x007e, 0x0804, 0x7c30, 0x9596, 0xfffc, 0x1118, 0x2009,
+	0x0080, 0x04f0, 0x2011, 0x0000, 0x2019, 0x1836, 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,
+	0x7c05, 0x82ff, 0x1118, 0x9085, 0x0001, 0x0018, 0xc2fc, 0x2208,
+	0x9006, 0x00de, 0x00ee, 0x004e, 0x00be, 0x0005, 0x7000, 0x908c,
+	0xff00, 0x810f, 0x9184, 0x000f, 0x0002, 0x7c4d, 0x7c4d, 0x7c4d,
+	0x7df1, 0x7c4d, 0x7c50, 0x7c75, 0x7cfe, 0x7c4d, 0x7c4d, 0x7c4d,
+	0x7c4d, 0x7c4d, 0x7c4d, 0x7c4d, 0x7c4d, 0x7817, 0x0140, 0x0005,
+	0x00b6, 0x7110, 0xd1bc, 0x01e8, 0x7120, 0x2160, 0x9c8c, 0x0003,
+	0x11c0, 0x9c8a, 0x1ddc, 0x02a8, 0x6864, 0x9c02, 0x1290, 0x7008,
+	0x9084, 0x00ff, 0x6110, 0x2158, 0xb910, 0x9106, 0x1150, 0x700c,
+	0xb914, 0x9106, 0x1130, 0x7124, 0x610a, 0x2009, 0x0046, 0x080c,
+	0x9b03, 0x7817, 0x0140, 0x00be, 0x0005, 0x00b6, 0x00c6, 0x9484,
+	0x0fff, 0x0904, 0x7cda, 0x7110, 0xd1bc, 0x1904, 0x7cda, 0x7108,
+	0x700c, 0x2028, 0x918c, 0x00ff, 0x2130, 0x9094, 0xff00, 0x15c8,
+	0x81ff, 0x15b8, 0x9080, 0x3142, 0x200d, 0x918c, 0xff00, 0x810f,
+	0x2001, 0x0080, 0x9106, 0x0904, 0x7cda, 0x9182, 0x0801, 0x1a04,
+	0x7cda, 0x9190, 0x1000, 0x2204, 0x905d, 0x05e0, 0xbe12, 0xbd16,
+	0xb800, 0xd0ec, 0x15b8, 0xba04, 0x9294, 0xff00, 0x9286, 0x0600,
+	0x1190, 0x080c, 0x9a0f, 0x0598, 0x2b08, 0x7028, 0x6052, 0x702c,
+	0x604e, 0x6112, 0x6023, 0x0006, 0x7120, 0x610a, 0x7130, 0x615e,
+	0x080c, 0xc6f5, 0x00f8, 0x080c, 0x655d, 0x1138, 0xb807, 0x0606,
+	0x0c40, 0x190c, 0x7bd2, 0x11b0, 0x0880, 0x080c, 0x9a0f, 0x2b08,
+	0x0188, 0x6112, 0x6023, 0x0004, 0x7120, 0x610a, 0x9286, 0x0400,
+	0x1118, 0x6007, 0x0005, 0x0010, 0x6007, 0x0001, 0x6003, 0x0001,
+	0x080c, 0x8335, 0x7817, 0x0140, 0x00ce, 0x00be, 0x0005, 0x2001,
+	0x180e, 0x2004, 0xd0ec, 0x0120, 0x2011, 0x8049, 0x080c, 0x47fb,
+	0x080c, 0x9ad6, 0x0d78, 0x2b08, 0x6112, 0x6023, 0x0006, 0x7120,
+	0x610a, 0x7130, 0x615e, 0x6017, 0xf300, 0x6003, 0x0001, 0x6007,
+	0x0041, 0x2009, 0xa022, 0x080c, 0x832e, 0x08e0, 0x00b6, 0x7110,
+	0xd1bc, 0x05d0, 0x7020, 0x2060, 0x9c84, 0x0003, 0x15a8, 0x9c82,
+	0x1ddc, 0x0690, 0x6864, 0x9c02, 0x1678, 0x9484, 0x0fff, 0x9082,
+	0x000c, 0x0650, 0x7008, 0x9084, 0x00ff, 0x6110, 0x2158, 0xb910,
+	0x9106, 0x1510, 0x700c, 0xb914, 0x9106, 0x11f0, 0x7124, 0x610a,
+	0x601c, 0xd0fc, 0x11c8, 0x2001, 0x0271, 0x2004, 0x9005, 0x1180,
+	0x9484, 0x0fff, 0x9082, 0x000c, 0x0158, 0x0066, 0x2031, 0x0100,
+	0xa001, 0xa001, 0x8631, 0x1de0, 0x006e, 0x601c, 0xd0fc, 0x1120,
+	0x2009, 0x0045, 0x080c, 0x9b03, 0x7817, 0x0140, 0x00be, 0x0005,
+	0x6120, 0x9186, 0x0002, 0x0128, 0x9186, 0x0005, 0x0110, 0x9085,
+	0x0001, 0x0005, 0x080c, 0x3107, 0x1168, 0x7010, 0x9084, 0xff00,
+	0x8007, 0x9086, 0x0000, 0x1130, 0x9184, 0x000f, 0x908a, 0x0006,
+	0x1208, 0x000b, 0x0005, 0x7d61, 0x7d62, 0x7d61, 0x7d61, 0x7dc1,
+	0x7dd0, 0x0005, 0x00b6, 0x7110, 0xd1bc, 0x0120, 0x702c, 0xd084,
+	0x0904, 0x7dbf, 0x700c, 0x7108, 0x080c, 0x23ef, 0x1904, 0x7dbf,
+	0x080c, 0x6106, 0x1904, 0x7dbf, 0xbe12, 0xbd16, 0x7110, 0xd1bc,
+	0x01d8, 0x080c, 0x655d, 0x0118, 0x9086, 0x0004, 0x1588, 0x00c6,
+	0x080c, 0x7ddf, 0x00ce, 0x05d8, 0x080c, 0x9a0f, 0x2b08, 0x05b8,
+	0x6112, 0x080c, 0xbb52, 0x6023, 0x0002, 0x7120, 0x610a, 0x2009,
+	0x0088, 0x080c, 0x9b03, 0x0458, 0x080c, 0x655d, 0x0148, 0x9086,
+	0x0004, 0x0130, 0x080c, 0x6565, 0x0118, 0x9086, 0x0004, 0x1180,
+	0x080c, 0x9a0f, 0x2b08, 0x01d8, 0x6112, 0x080c, 0xbb52, 0x6023,
+	0x0005, 0x7120, 0x610a, 0x2009, 0x0088, 0x080c, 0x9b03, 0x0078,
+	0x080c, 0x9a0f, 0x2b08, 0x0158, 0x6112, 0x080c, 0xbb52, 0x6023,
+	0x0004, 0x7120, 0x610a, 0x2009, 0x0001, 0x080c, 0x9b03, 0x00be,
+	0x0005, 0x7110, 0xd1bc, 0x0158, 0x00d1, 0x0148, 0x080c, 0x7d40,
+	0x1130, 0x7124, 0x610a, 0x2009, 0x0089, 0x080c, 0x9b03, 0x0005,
+	0x7110, 0xd1bc, 0x0158, 0x0059, 0x0148, 0x080c, 0x7d40, 0x1130,
+	0x7124, 0x610a, 0x2009, 0x008a, 0x080c, 0x9b03, 0x0005, 0x7020,
+	0x2060, 0x9c84, 0x0003, 0x1158, 0x9c82, 0x1ddc, 0x0240, 0x2001,
+	0x1819, 0x2004, 0x9c02, 0x1218, 0x9085, 0x0001, 0x0005, 0x9006,
+	0x0ce8, 0x00b6, 0x7110, 0xd1bc, 0x11d8, 0x7024, 0x2060, 0x9c84,
+	0x0003, 0x11b0, 0x9c82, 0x1ddc, 0x0298, 0x6864, 0x9c02, 0x1280,
+	0x7008, 0x9084, 0x00ff, 0x6110, 0x2158, 0xb910, 0x9106, 0x1140,
+	0x700c, 0xb914, 0x9106, 0x1120, 0x2009, 0x0051, 0x080c, 0x9b03,
+	0x7817, 0x0140, 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, 0x05c0, 0x080c, 0x9a0f, 0x05a8,
+	0x0066, 0x00c6, 0x0046, 0x2011, 0x0263, 0x2204, 0x8211, 0x220c,
+	0x080c, 0x23ef, 0x1590, 0x080c, 0x6106, 0x1578, 0xbe12, 0xbd16,
+	0x2b00, 0x004e, 0x00ce, 0x6012, 0x080c, 0xbb52, 0x080c, 0x1023,
+	0x0500, 0x2900, 0x6062, 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, 0x8335, 0x00fe, 0x009e, 0x00ce,
+	0x0005, 0x080c, 0x9a65, 0x006e, 0x0cc0, 0x004e, 0x00ce, 0x0cc8,
+	0x00c6, 0x7000, 0x908c, 0xff00, 0x9184, 0xf000, 0x810f, 0x9086,
+	0x2000, 0x1904, 0x7ec7, 0x9186, 0x0022, 0x15f0, 0x2001, 0x0111,
+	0x2004, 0x9005, 0x1904, 0x7ec9, 0x7030, 0x908e, 0x0400, 0x0904,
+	0x7ec9, 0x908e, 0x6000, 0x05e8, 0x908e, 0x5400, 0x05d0, 0x908e,
+	0x0300, 0x11d8, 0x2009, 0x1836, 0x210c, 0xd18c, 0x1590, 0xd1a4,
+	0x1580, 0x080c, 0x651b, 0x0558, 0x68ac, 0x9084, 0x00ff, 0x7100,
+	0x918c, 0x00ff, 0x9106, 0x1518, 0x687c, 0x69ac, 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,
+	0x7ddf, 0x0128, 0x6004, 0x9086, 0x0002, 0x0118, 0x0000, 0x9006,
+	0x0010, 0x9085, 0x0001, 0x00ce, 0x0005, 0x00f6, 0x2079, 0x0200,
+	0x7800, 0xc0e5, 0xc0cc, 0x7802, 0x00fe, 0x0005, 0x00f6, 0x2079,
+	0x1800, 0x7834, 0xd084, 0x1130, 0x2079, 0x0200, 0x7800, 0x9085,
+	0x1200, 0x7802, 0x00fe, 0x0005, 0x00e6, 0x2071, 0x1800, 0x7034,
+	0xc084, 0x7036, 0x00ee, 0x0005, 0x2071, 0x19d2, 0x7003, 0x0003,
+	0x700f, 0x0361, 0x9006, 0x701a, 0x7072, 0x7012, 0x7017, 0x1ddc,
+	0x7007, 0x0000, 0x7026, 0x702b, 0x8e43, 0x7032, 0x7037, 0x8ec0,
+	0x703f, 0xffff, 0x7042, 0x7047, 0x5134, 0x704a, 0x705b, 0x8083,
+	0x080c, 0x103c, 0x090c, 0x0d65, 0x2900, 0x703a, 0xa867, 0x0003,
+	0xa86f, 0x0100, 0xa8ab, 0xdcb0, 0x0005, 0x2071, 0x19d2, 0x1d04,
+	0x7faa, 0x2091, 0x6000, 0x700c, 0x8001, 0x700e, 0x1560, 0x2001,
+	0x1875, 0x2004, 0xd0c4, 0x0158, 0x3a00, 0xd08c, 0x1140, 0x20d1,
+	0x0000, 0x20d1, 0x0001, 0x20d1, 0x0000, 0x080c, 0x0d65, 0x700f,
+	0x0361, 0x7007, 0x0001, 0x0126, 0x2091, 0x8000, 0x2069, 0x1800,
+	0x69e8, 0xd1e4, 0x1138, 0xd1dc, 0x1118, 0x080c, 0x80f1, 0x0010,
+	0x080c, 0x80c8, 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, 0x8f48, 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, 0x7fd2, 0x7fd3, 0x7ffd, 0x00e6,
+	0x2071, 0x19d2, 0x7018, 0x9005, 0x1120, 0x711a, 0x721e, 0x700b,
+	0x0009, 0x00ee, 0x0005, 0x00e6, 0x0006, 0x2071, 0x19d2, 0x701c,
+	0x9206, 0x1120, 0x701a, 0x701e, 0x7072, 0x7076, 0x000e, 0x00ee,
+	0x0005, 0x00e6, 0x2071, 0x19d2, 0xb888, 0x9102, 0x0208, 0xb98a,
+	0x00ee, 0x0005, 0x0005, 0x00b6, 0x2031, 0x0010, 0x7110, 0x080c,
+	0x6166, 0x11a8, 0xb888, 0x8001, 0x0290, 0xb88a, 0x1180, 0x0126,
+	0x2091, 0x8000, 0x0066, 0xb8c0, 0x9005, 0x0138, 0x0026, 0xba3c,
+	0x0016, 0x080c, 0x6291, 0x001e, 0x002e, 0x006e, 0x012e, 0x8108,
+	0x9182, 0x0800, 0x1220, 0x8631, 0x0128, 0x7112, 0x0c00, 0x900e,
+	0x7007, 0x0002, 0x7112, 0x00be, 0x0005, 0x2031, 0x0010, 0x7014,
+	0x2060, 0x0126, 0x2091, 0x8000, 0x6048, 0x9005, 0x0128, 0x8001,
+	0x604a, 0x1110, 0x080c, 0xb9d3, 0x6018, 0x9005, 0x05d8, 0x00f6,
+	0x2079, 0x0300, 0x7918, 0xd1b4, 0x1904, 0x805d, 0x781b, 0x2020,
+	0xa001, 0x7918, 0xd1b4, 0x0118, 0x781b, 0x2000, 0x04f0, 0x8001,
+	0x601a, 0x0106, 0x781b, 0x2000, 0xa001, 0x7918, 0xd1ac, 0x1dd0,
+	0x010e, 0x00fe, 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, 0x080c, 0xbe03, 0x0110,
+	0x080c, 0xb3c3, 0x012e, 0x9c88, 0x001c, 0x7116, 0x2001, 0x1819,
+	0x2004, 0x9102, 0x1228, 0x8631, 0x0138, 0x2160, 0x0804, 0x8001,
+	0x7017, 0x1ddc, 0x7007, 0x0000, 0x0005, 0x00fe, 0x0c58, 0x00e6,
+	0x2071, 0x19d2, 0x7027, 0x07d0, 0x7023, 0x0009, 0x00ee, 0x0005,
+	0x2001, 0x19db, 0x2003, 0x0000, 0x0005, 0x00e6, 0x2071, 0x19d2,
+	0x7132, 0x702f, 0x0009, 0x00ee, 0x0005, 0x2011, 0x19de, 0x2013,
+	0x0000, 0x0005, 0x00e6, 0x2071, 0x19d2, 0x711a, 0x721e, 0x700b,
+	0x0009, 0x00ee, 0x0005, 0x0086, 0x0026, 0x7054, 0x8000, 0x7056,
+	0x2001, 0x19e0, 0x2044, 0xa06c, 0x9086, 0x0000, 0x0150, 0x7068,
+	0xa09a, 0x7064, 0xa096, 0x7060, 0xa092, 0x705c, 0xa08e, 0x080c,
+	0x1103, 0x002e, 0x008e, 0x0005, 0x0006, 0x0016, 0x0096, 0x00a6,
+	0x00b6, 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x0156, 0x080c, 0x7f15,
+	0x015e, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x00ae, 0x009e,
+	0x001e, 0x000e, 0x0005, 0x00e6, 0x2071, 0x19d2, 0x7172, 0x7276,
+	0x706f, 0x0009, 0x00ee, 0x0005, 0x00e6, 0x0006, 0x2071, 0x19d2,
+	0x7074, 0x9206, 0x1110, 0x7072, 0x7076, 0x000e, 0x00ee, 0x0005,
+	0x2069, 0x1800, 0x69e8, 0xd1e4, 0x1518, 0x0026, 0xd1ec, 0x0140,
+	0x6a50, 0x6870, 0x9202, 0x0288, 0x8117, 0x9294, 0x00c1, 0x0088,
+	0x9184, 0x0007, 0x01a0, 0x8109, 0x9184, 0x0007, 0x0110, 0x69ea,
+	0x0070, 0x8107, 0x9084, 0x0007, 0x910d, 0x8107, 0x9106, 0x9094,
+	0x00c1, 0x9184, 0xff3e, 0x9205, 0x68ea, 0x080c, 0x0eed, 0x002e,
+	0x0005, 0x69e4, 0x9184, 0x003f, 0x05b8, 0x8109, 0x9184, 0x003f,
+	0x01a8, 0x6a50, 0x6870, 0x9202, 0x0220, 0xd1bc, 0x0168, 0xc1bc,
+	0x0018, 0xd1bc, 0x1148, 0xc1bd, 0x2110, 0x00e6, 0x2071, 0x1800,
+	0x080c, 0x0f0f, 0x00ee, 0x0400, 0x69e6, 0x00f0, 0x0026, 0x8107,
+	0x9094, 0x0007, 0x0128, 0x8001, 0x8007, 0x9085, 0x0007, 0x0050,
+	0x2010, 0x8004, 0x8004, 0x8004, 0x9084, 0x0007, 0x9205, 0x8007,
+	0x9085, 0x0028, 0x9086, 0x0040, 0x2010, 0x00e6, 0x2071, 0x1800,
+	0x080c, 0x0f0f, 0x00ee, 0x002e, 0x0005, 0x00c6, 0x2061, 0x1a3d,
+	0x00ce, 0x0005, 0x9184, 0x000f, 0x8003, 0x8003, 0x8003, 0x9080,
+	0x1a3d, 0x2060, 0x0005, 0xa884, 0x908a, 0x199a, 0x1638, 0x9005,
+	0x1150, 0x00c6, 0x2061, 0x1a3d, 0x6014, 0x00ce, 0x9005, 0x1130,
+	0x2001, 0x001e, 0x0018, 0x908e, 0xffff, 0x01b0, 0x8003, 0x800b,
+	0x810b, 0x9108, 0x611a, 0xa87c, 0x908c, 0x00c0, 0x918e, 0x00c0,
+	0x0904, 0x81f2, 0xd0b4, 0x1168, 0xd0bc, 0x1904, 0x81cb, 0x2009,
+	0x0006, 0x080c, 0x821f, 0x0005, 0x900e, 0x0c60, 0x2001, 0x1999,
+	0x08b0, 0xd0fc, 0x05c8, 0x908c, 0x2023, 0x1550, 0x87ff, 0x1540,
+	0x6124, 0x918c, 0x0500, 0x1520, 0x6100, 0x918e, 0x0007, 0x1500,
+	0x2009, 0x1875, 0x210c, 0xd184, 0x11d8, 0x6003, 0x0003, 0x6007,
+	0x0043, 0x6047, 0xb035, 0x080c, 0x1a79, 0xa87c, 0xc0dd, 0xa87e,
+	0x600f, 0x0000, 0x00f6, 0x2079, 0x0380, 0x7818, 0xd0bc, 0x1de8,
+	0x7833, 0x0013, 0x2c00, 0x7836, 0x781b, 0x8080, 0x00fe, 0x0005,
+	0x908c, 0x0003, 0x0120, 0x918e, 0x0003, 0x1904, 0x8219, 0x908c,
+	0x2020, 0x918e, 0x2020, 0x01a8, 0x6024, 0xd0d4, 0x11e8, 0x2009,
+	0x1875, 0x2104, 0xd084, 0x1138, 0x87ff, 0x1120, 0x2009, 0x0043,
+	0x0804, 0x9b03, 0x0005, 0x87ff, 0x1de8, 0x2009, 0x0042, 0x0804,
+	0x9b03, 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, 0x8219, 0x908c, 0x2020, 0x918e, 0x2020,
+	0x0170, 0x0076, 0x00f6, 0x2c78, 0x080c, 0x1646, 0x00fe, 0x007e,
+	0x87ff, 0x1120, 0x2009, 0x0042, 0x080c, 0x9b03, 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, 0x9b03, 0x0005, 0x00b9, 0x0ce8, 0x87ff,
+	0x1dd8, 0x2009, 0x0043, 0x080c, 0x9b03, 0x0cb0, 0x6110, 0x00b6,
+	0x2158, 0xb900, 0x00be, 0xd1ac, 0x0d20, 0x6124, 0xc1cd, 0x6126,
+	0x0c00, 0x2009, 0x0004, 0x0019, 0x0005, 0x2009, 0x0001, 0x0096,
+	0x080c, 0xb6c5, 0x0518, 0x6014, 0x2048, 0xa982, 0xa800, 0x6016,
+	0x9186, 0x0001, 0x1188, 0xa97c, 0x918c, 0x8100, 0x918e, 0x8100,
+	0x1158, 0x00c6, 0x2061, 0x1a3d, 0x6200, 0xd28c, 0x1120, 0x6204,
+	0x8210, 0x0208, 0x6206, 0x00ce, 0x080c, 0x6674, 0x6014, 0x904d,
+	0x0076, 0x2039, 0x0000, 0x190c, 0x813b, 0x007e, 0x009e, 0x0005,
+	0x0156, 0x00c6, 0x2061, 0x1a3d, 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, 0x8086, 0x818e, 0x1208, 0x9200, 0x1f04, 0x826a,
+	0x8086, 0x818e, 0x004e, 0x003e, 0x012e, 0x0005, 0x0126, 0x2091,
+	0x8000, 0x0076, 0x0156, 0x20a9, 0x0010, 0x9005, 0x01c8, 0x911a,
+	0x12b8, 0x8213, 0x818d, 0x0228, 0x911a, 0x1220, 0x1f04, 0x8281,
+	0x0028, 0x911a, 0x2308, 0x8210, 0x1f04, 0x8281, 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,
+	0x9678, 0x04a9, 0x080c, 0x9663, 0x0491, 0x080c, 0x9666, 0x0479,
+	0x080c, 0x9669, 0x0461, 0x080c, 0x966c, 0x0449, 0x080c, 0x966f,
+	0x0431, 0x080c, 0x9672, 0x0419, 0x080c, 0x9675, 0x0401, 0x01de,
+	0x014e, 0x015e, 0x6857, 0x0000, 0x00f6, 0x2079, 0x0380, 0x00f9,
+	0x7807, 0x0003, 0x7803, 0x0000, 0x7803, 0x0001, 0x2069, 0x0004,
+	0x2d04, 0x9084, 0xfffe, 0x9085, 0x8000, 0x206a, 0x2069, 0x0100,
+	0x6828, 0x9084, 0xfffc, 0x682a, 0x00fe, 0x00de, 0x0005, 0x20a9,
+	0x0020, 0x20a1, 0x0240, 0x2001, 0x0000, 0x4004, 0x0005, 0x00c6,
+	0x7803, 0x0000, 0x9006, 0x7827, 0x0030, 0x782b, 0x0400, 0x7827,
+	0x0031, 0x782b, 0x1abd, 0x781f, 0xff00, 0x781b, 0xff00, 0x2061,
+	0x1ab2, 0x602f, 0x19b6, 0x6033, 0x1800, 0x6037, 0x19d2, 0x603b,
+	0x1cca, 0x603f, 0x1cda, 0x6042, 0x6047, 0x1a88, 0x00ce, 0x0005,
+	0x2001, 0x0382, 0x2004, 0x9084, 0x0007, 0x9086, 0x0001, 0x01b0,
+	0x00c6, 0x6146, 0x600f, 0x0000, 0x2c08, 0x2061, 0x19b6, 0x602c,
+	0x8000, 0x602e, 0x601c, 0x9005, 0x0130, 0x9080, 0x0003, 0x2102,
+	0x611e, 0x00ce, 0x0005, 0x6122, 0x611e, 0x0cd8, 0x6146, 0x2c08,
+	0x2001, 0x0012, 0x080c, 0x9737, 0x0005, 0x0016, 0x2009, 0x8020,
+	0x6146, 0x2c08, 0x2001, 0x0382, 0x2004, 0x9084, 0x0007, 0x9086,
+	0x0001, 0x1128, 0x2001, 0x0019, 0x080c, 0x9737, 0x0088, 0x00c6,
+	0x2061, 0x19b6, 0x602c, 0x8000, 0x602e, 0x600c, 0x9005, 0x0128,
+	0x9080, 0x0003, 0x2102, 0x610e, 0x0010, 0x6112, 0x610e, 0x00ce,
+	0x001e, 0x0005, 0x2001, 0x0382, 0x2004, 0x9084, 0x0007, 0x9086,
+	0x0001, 0x0198, 0x00c6, 0x6146, 0x600f, 0x0000, 0x2c08, 0x2061,
+	0x19b6, 0x6044, 0x9005, 0x0130, 0x9080, 0x0003, 0x2102, 0x6146,
+	0x00ce, 0x0005, 0x614a, 0x6146, 0x0cd8, 0x6146, 0x600f, 0x0000,
+	0x2c08, 0x2001, 0x0013, 0x080c, 0x9737, 0x0005, 0x6044, 0xd0dc,
+	0x0128, 0x9006, 0x7007, 0x0000, 0x700a, 0x7032, 0x0005, 0x00f6,
+	0x00e6, 0x00d6, 0x00c6, 0x00b6, 0x0096, 0x0076, 0x0066, 0x0056,
+	0x0036, 0x0026, 0x0016, 0x0006, 0x0126, 0x902e, 0x2071, 0x19b6,
+	0x7648, 0x2660, 0x2678, 0x2091, 0x8000, 0x8cff, 0x0904, 0x8400,
+	0x6010, 0x2058, 0xb8a0, 0x9206, 0x1904, 0x83fb, 0x87ff, 0x0120,
+	0x605c, 0x9106, 0x1904, 0x83fb, 0x704c, 0x9c06, 0x1178, 0x0036,
+	0x2019, 0x0001, 0x080c, 0x90f0, 0x703f, 0x0000, 0x9006, 0x704e,
+	0x706a, 0x7052, 0x706e, 0x003e, 0x2029, 0x0001, 0x080c, 0x837e,
+	0x7048, 0x9c36, 0x1110, 0x660c, 0x764a, 0x7044, 0x9c36, 0x1140,
+	0x2c00, 0x9f36, 0x0118, 0x2f00, 0x7046, 0x0010, 0x7047, 0x0000,
+	0x660c, 0x0066, 0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678,
+	0x600f, 0x0000, 0x080c, 0xb6c5, 0x01c8, 0x6014, 0x2048, 0x6020,
+	0x9086, 0x0003, 0x1560, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000,
+	0x0016, 0x0036, 0x0076, 0x080c, 0xb9bc, 0x080c, 0xd370, 0x080c,
+	0x683f, 0x007e, 0x003e, 0x001e, 0x080c, 0xb8ad, 0x080c, 0x9a9f,
+	0x00ce, 0x0804, 0x839d, 0x2c78, 0x600c, 0x2060, 0x0804, 0x839d,
+	0x012e, 0x000e, 0x001e, 0x002e, 0x003e, 0x005e, 0x006e, 0x007e,
+	0x009e, 0x00be, 0x00ce, 0x00de, 0x00ee, 0x00fe, 0x0005, 0x6020,
+	0x9086, 0x0006, 0x1158, 0x0016, 0x0036, 0x0076, 0x080c, 0xd370,
+	0x080c, 0xd079, 0x007e, 0x003e, 0x001e, 0x08c0, 0x6020, 0x9086,
+	0x000a, 0x0918, 0x0800, 0x0006, 0x0066, 0x0096, 0x00c6, 0x00d6,
+	0x00f6, 0x9036, 0x0126, 0x2091, 0x8000, 0x2079, 0x19b6, 0x7848,
+	0x9065, 0x0904, 0x8482, 0x600c, 0x0006, 0x600f, 0x0000, 0x784c,
+	0x9c06, 0x11a0, 0x0036, 0x2019, 0x0001, 0x080c, 0x90f0, 0x783f,
+	0x0000, 0x901e, 0x7b4e, 0x7b6a, 0x7b52, 0x7b6e, 0x003e, 0x000e,
+	0x9005, 0x1118, 0x600c, 0x600f, 0x0000, 0x0006, 0x00e6, 0x2f70,
+	0x080c, 0x837e, 0x00ee, 0x080c, 0xb6c5, 0x0520, 0x6014, 0x2048,
+	0x6020, 0x9086, 0x0003, 0x1580, 0x3e08, 0x918e, 0x0002, 0x1188,
+	0x6010, 0x9005, 0x0170, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc,
+	0x0140, 0x6048, 0x9005, 0x1198, 0x2001, 0x1957, 0x2004, 0x604a,
+	0x0070, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x080c, 0x6833,
+	0x080c, 0xb8ad, 0x6044, 0xc0fc, 0x6046, 0x080c, 0x9a9f, 0x000e,
+	0x0804, 0x8430, 0x7e4a, 0x7e46, 0x012e, 0x00fe, 0x00de, 0x00ce,
+	0x009e, 0x006e, 0x000e, 0x0005, 0x6020, 0x9086, 0x0006, 0x1118,
+	0x080c, 0xd079, 0x0c38, 0x6020, 0x9086, 0x000a, 0x09e0, 0x08c8,
+	0x0016, 0x0026, 0x0086, 0x9046, 0x00a9, 0x080c, 0x8589, 0x008e,
+	0x002e, 0x001e, 0x0005, 0x00f6, 0x0126, 0x2079, 0x19b6, 0x2091,
+	0x8000, 0x080c, 0x85d2, 0x080c, 0x8666, 0x080c, 0x62f3, 0x012e,
+	0x00fe, 0x0005, 0x00b6, 0x0096, 0x00f6, 0x00e6, 0x00d6, 0x00c6,
+	0x0066, 0x0016, 0x0006, 0x0126, 0x2091, 0x8000, 0x2071, 0x19b6,
+	0x7620, 0x2660, 0x2678, 0x8cff, 0x0904, 0x854e, 0x6010, 0x2058,
+	0xb8a0, 0x9206, 0x1904, 0x8549, 0x88ff, 0x0120, 0x605c, 0x9106,
+	0x1904, 0x8549, 0x7030, 0x9c06, 0x1570, 0x2069, 0x0100, 0x6820,
+	0xd0a4, 0x1508, 0x080c, 0x8068, 0x080c, 0x8e21, 0x68c3, 0x0000,
+	0x080c, 0x9320, 0x7033, 0x0000, 0x0036, 0x2069, 0x0140, 0x6b04,
+	0x9384, 0x1000, 0x0138, 0x2001, 0x0100, 0x080c, 0x27f1, 0x9006,
+	0x080c, 0x27f1, 0x2069, 0x0100, 0x6824, 0xd084, 0x0110, 0x6827,
+	0x0001, 0x003e, 0x0040, 0x7008, 0xc0ad, 0x700a, 0x6003, 0x0009,
+	0x630a, 0x0804, 0x8549, 0x7020, 0x9c36, 0x1110, 0x660c, 0x7622,
+	0x701c, 0x9c36, 0x1140, 0x2c00, 0x9f36, 0x0118, 0x2f00, 0x701e,
+	0x0010, 0x701f, 0x0000, 0x660c, 0x0066, 0x2c00, 0x9f06, 0x0110,
+	0x7e0e, 0x0008, 0x2678, 0x600f, 0x0000, 0x6044, 0xc0fc, 0x6046,
+	0x6014, 0x2048, 0x080c, 0xb6c5, 0x01e8, 0x6020, 0x9086, 0x0003,
+	0x1580, 0x080c, 0xb8d3, 0x1118, 0x080c, 0xa40d, 0x0098, 0xa867,
+	0x0103, 0xab7a, 0xa877, 0x0000, 0x0016, 0x0036, 0x0086, 0x080c,
+	0xb9bc, 0x080c, 0xd370, 0x080c, 0x683f, 0x008e, 0x003e, 0x001e,
+	0x080c, 0xb8ad, 0x080c, 0x9a9f, 0x080c, 0x91f6, 0x00ce, 0x0804,
+	0x84c3, 0x2c78, 0x600c, 0x2060, 0x0804, 0x84c3, 0x012e, 0x000e,
+	0x001e, 0x006e, 0x00ce, 0x00de, 0x00ee, 0x00fe, 0x009e, 0x00be,
+	0x0005, 0x6020, 0x9086, 0x0006, 0x1158, 0x0016, 0x0036, 0x0086,
+	0x080c, 0xd370, 0x080c, 0xd079, 0x008e, 0x003e, 0x001e, 0x08d0,
+	0x080c, 0xa40d, 0x6020, 0x9086, 0x0002, 0x1160, 0x6004, 0x0006,
+	0x9086, 0x0085, 0x000e, 0x0904, 0x852f, 0x9086, 0x008b, 0x0904,
+	0x852f, 0x0840, 0x6020, 0x9086, 0x0005, 0x1920, 0x6004, 0x0006,
+	0x9086, 0x0085, 0x000e, 0x09c8, 0x9086, 0x008b, 0x09b0, 0x0804,
+	0x8542, 0x0006, 0x00f6, 0x00e6, 0x0096, 0x00b6, 0x00c6, 0x0066,
+	0x0016, 0x0126, 0x2091, 0x8000, 0x9280, 0x1000, 0x2004, 0x905d,
+	0x2079, 0x19b6, 0x9036, 0x7828, 0x2060, 0x8cff, 0x0538, 0x6010,
+	0x9b06, 0x1500, 0x6043, 0xffff, 0x080c, 0x9902, 0x01d8, 0x610c,
+	0x0016, 0x080c, 0x8f7a, 0x6014, 0x2048, 0xa867, 0x0103, 0xab7a,
+	0xa877, 0x0000, 0x0016, 0x0036, 0x0086, 0x080c, 0xb9bc, 0x080c,
+	0xd370, 0x080c, 0x683f, 0x008e, 0x003e, 0x001e, 0x080c, 0x9a9f,
+	0x00ce, 0x08d8, 0x2c30, 0x600c, 0x2060, 0x08b8, 0x080c, 0x6310,
+	0x012e, 0x001e, 0x006e, 0x00ce, 0x00be, 0x009e, 0x00ee, 0x00fe,
+	0x000e, 0x0005, 0x0096, 0x0006, 0x0066, 0x00c6, 0x00d6, 0x9036,
+	0x7820, 0x9065, 0x0904, 0x8639, 0x600c, 0x0006, 0x6044, 0xc0fc,
+	0x6046, 0x600f, 0x0000, 0x7830, 0x9c06, 0x1588, 0x2069, 0x0100,
+	0x6820, 0xd0a4, 0x1508, 0x080c, 0x8068, 0x080c, 0x8e21, 0x68c3,
+	0x0000, 0x080c, 0x9320, 0x7833, 0x0000, 0x0036, 0x2069, 0x0140,
+	0x6b04, 0x9384, 0x1000, 0x0138, 0x2001, 0x0100, 0x080c, 0x27f1,
+	0x9006, 0x080c, 0x27f1, 0x2069, 0x0100, 0x6824, 0xd084, 0x0110,
+	0x6827, 0x0001, 0x003e, 0x0058, 0x080c, 0x6513, 0x1538, 0x6003,
+	0x0009, 0x630a, 0x7808, 0xc0ad, 0x780a, 0x2c30, 0x00f8, 0x6014,
+	0x2048, 0x080c, 0xb6c3, 0x01b0, 0x6020, 0x9086, 0x0003, 0x1508,
+	0x080c, 0xb8d3, 0x1118, 0x080c, 0xa40d, 0x0060, 0x080c, 0x6513,
+	0x1168, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x080c, 0x683f,
+	0x080c, 0xb8ad, 0x080c, 0x9a9f, 0x080c, 0x91f6, 0x000e, 0x0804,
+	0x85d9, 0x7e22, 0x7e1e, 0x00de, 0x00ce, 0x006e, 0x000e, 0x009e,
+	0x0005, 0x6020, 0x9086, 0x0006, 0x1118, 0x080c, 0xd079, 0x0c50,
+	0x080c, 0xa40d, 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, 0x0096,
+	0x00b6, 0x00c6, 0x0066, 0x9036, 0x7828, 0x9065, 0x0510, 0x6010,
+	0x2058, 0x600c, 0x0006, 0x3e08, 0x918e, 0x0002, 0x1118, 0xb800,
+	0xd0bc, 0x11a8, 0x6043, 0xffff, 0x080c, 0x9902, 0x0180, 0x610c,
+	0x080c, 0x8f7a, 0x6014, 0x2048, 0xa867, 0x0103, 0xab7a, 0xa877,
+	0x0000, 0x080c, 0x683f, 0x080c, 0x9a9f, 0x000e, 0x08f0, 0x2c30,
+	0x0ce0, 0x006e, 0x00ce, 0x00be, 0x009e, 0x000e, 0x0005, 0x00e6,
+	0x00d6, 0x0096, 0x0066, 0x080c, 0x5cdc, 0x11b0, 0x2071, 0x19b6,
+	0x7030, 0x9080, 0x0005, 0x2004, 0x904d, 0x0170, 0xa878, 0x9606,
+	0x1158, 0x2071, 0x19b6, 0x7030, 0x9035, 0x0130, 0x9080, 0x0005,
+	0x2004, 0x9906, 0x1108, 0x0029, 0x006e, 0x009e, 0x00de, 0x00ee,
+	0x0005, 0x00c6, 0x2660, 0x6043, 0xffff, 0x080c, 0x9902, 0x0178,
+	0x080c, 0x8f7a, 0x6014, 0x2048, 0xa867, 0x0103, 0xab7a, 0xa877,
+	0x0000, 0x080c, 0xb9bc, 0x080c, 0x683f, 0x080c, 0x9a9f, 0x00ce,
+	0x0005, 0x00b6, 0x00e6, 0x00c6, 0x080c, 0x97a4, 0x0106, 0x190c,
+	0x9746, 0x2071, 0x0101, 0x2e04, 0xc0c4, 0x2072, 0x6044, 0xd0fc,
+	0x1138, 0x010e, 0x190c, 0x9762, 0x00ce, 0x00ee, 0x00be, 0x0005,
+	0x2071, 0x19b6, 0x7030, 0x9005, 0x0da0, 0x9c06, 0x190c, 0x0d65,
+	0x7036, 0x080c, 0x8068, 0x7004, 0x9084, 0x0007, 0x0002, 0x8701,
+	0x8703, 0x870a, 0x8714, 0x8722, 0x8701, 0x870a, 0x86ff, 0x080c,
+	0x0d65, 0x0428, 0x0005, 0x080c, 0x98ed, 0x7007, 0x0000, 0x7033,
+	0x0000, 0x00e8, 0x0066, 0x9036, 0x080c, 0x8f7a, 0x006e, 0x7007,
+	0x0000, 0x7033, 0x0000, 0x0098, 0x080c, 0x98d8, 0x0140, 0x080c,
+	0x98ed, 0x0128, 0x0066, 0x9036, 0x080c, 0x8f7a, 0x006e, 0x7033,
+	0x0000, 0x0028, 0x080c, 0x98d8, 0x080c, 0x9320, 0x0000, 0x010e,
+	0x190c, 0x9762, 0x00ce, 0x00ee, 0x00be, 0x0005, 0x00d6, 0x00c6,
+	0x080c, 0x97a4, 0x0106, 0x190c, 0x9746, 0x6044, 0xd0fc, 0x1130,
+	0x010e, 0x190c, 0x9762, 0x00ce, 0x00de, 0x0005, 0x2069, 0x19b6,
+	0x684c, 0x9005, 0x0da8, 0x9c06, 0x190c, 0x0d65, 0x6852, 0x00e6,
+	0x2d70, 0x080c, 0x837e, 0x00ee, 0x080c, 0x8075, 0x0016, 0x2009,
+	0x0040, 0x080c, 0x201d, 0x001e, 0x683c, 0x9084, 0x0003, 0x0002,
+	0x875e, 0x875f, 0x877d, 0x875c, 0x080c, 0x0d65, 0x0460, 0x6868,
+	0x9086, 0x0001, 0x0190, 0x600c, 0x9015, 0x0160, 0x6a4a, 0x600f,
+	0x0000, 0x6044, 0xc0fc, 0x6046, 0x9006, 0x7042, 0x684e, 0x683f,
+	0x0000, 0x00c8, 0x684a, 0x6846, 0x0ca0, 0x686b, 0x0000, 0x6848,
+	0x9065, 0x0d78, 0x6003, 0x0002, 0x0c60, 0x9006, 0x686a, 0x6852,
+	0x686e, 0x600c, 0x9015, 0x0120, 0x6a4a, 0x600f, 0x0000, 0x0018,
+	0x684e, 0x684a, 0x6846, 0x684f, 0x0000, 0x010e, 0x190c, 0x9762,
+	0x00ce, 0x00de, 0x0005, 0x0005, 0x6020, 0x9084, 0x000f, 0x000b,
+	0x0005, 0x87a9, 0x87ac, 0x8c05, 0x8c94, 0x87ac, 0x8c05, 0x8c94,
+	0x87a9, 0x87ac, 0x87a9, 0x87a9, 0x87a9, 0x87a9, 0x87a9, 0x87a9,
+	0x87a9, 0x080c, 0x86d1, 0x0005, 0x00b6, 0x0156, 0x0136, 0x0146,
+	0x01c6, 0x01d6, 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x2069, 0x0200,
+	0x2071, 0x0240, 0x6004, 0x908a, 0x0053, 0x1a0c, 0x0d65, 0x6110,
+	0x2158, 0xb984, 0x2c78, 0x2061, 0x0100, 0x619a, 0x908a, 0x0040,
+	0x1a04, 0x8818, 0x005b, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x01de,
+	0x01ce, 0x014e, 0x013e, 0x015e, 0x00be, 0x0005, 0x898f, 0x89ca,
+	0x89f3, 0x8a96, 0x8ab7, 0x8abd, 0x8aca, 0x8ad2, 0x8ade, 0x8ae4,
+	0x8af5, 0x8ae4, 0x8b4c, 0x8ad2, 0x8b58, 0x8b5e, 0x8ade, 0x8b5e,
+	0x8b6a, 0x8816, 0x8816, 0x8816, 0x8816, 0x8816, 0x8816, 0x8816,
+	0x8816, 0x8816, 0x8816, 0x8816, 0x8f9b, 0x8fbe, 0x8fcf, 0x8fef,
+	0x9021, 0x8aca, 0x8816, 0x8aca, 0x8ae4, 0x8816, 0x89f3, 0x8a96,
+	0x8816, 0x9413, 0x8ae4, 0x8816, 0x942f, 0x8ae4, 0x8816, 0x8ade,
+	0x8989, 0x8839, 0x8816, 0x944b, 0x94b8, 0x9598, 0x8816, 0x95a5,
+	0x8ac7, 0x95d0, 0x8816, 0x902b, 0x95dc, 0x8816, 0x080c, 0x0d65,
+	0x2100, 0x005b, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x01de, 0x01ce,
+	0x014e, 0x013e, 0x015e, 0x00be, 0x0005, 0x8837, 0x8837, 0x8837,
+	0x8860, 0x890c, 0x8917, 0x8837, 0x8837, 0x8837, 0x895e, 0x896a,
+	0x887b, 0x8837, 0x8896, 0x88ca, 0x9958, 0x999d, 0x8ae4, 0x080c,
+	0x0d65, 0x00d6, 0x0096, 0x080c, 0x8b7d, 0x7003, 0x2414, 0x7007,
+	0x0018, 0x700b, 0x0800, 0x7814, 0x2048, 0xa83c, 0x700e, 0xa850,
+	0x7022, 0xa854, 0x7026, 0x60c3, 0x0018, 0x080c, 0x8df1, 0x009e,
+	0x00de, 0x0005, 0x7810, 0x00b6, 0x2058, 0xb8a0, 0x00be, 0x080c,
+	0x99e4, 0x1118, 0x9084, 0xff80, 0x0110, 0x9085, 0x0001, 0x0005,
+	0x00d6, 0x0096, 0x080c, 0x8b7d, 0x7003, 0x0500, 0x7814, 0x2048,
+	0xa874, 0x700a, 0xa878, 0x700e, 0xa87c, 0x7012, 0xa880, 0x7016,
+	0xa884, 0x701a, 0xa888, 0x701e, 0x60c3, 0x0010, 0x080c, 0x8df1,
+	0x009e, 0x00de, 0x0005, 0x00d6, 0x0096, 0x080c, 0x8b7d, 0x7003,
+	0x0500, 0x7814, 0x2048, 0xa8cc, 0x700a, 0xa8d0, 0x700e, 0xa8d4,
+	0x7012, 0xa8d8, 0x7016, 0xa8dc, 0x701a, 0xa8e0, 0x701e, 0x60c3,
+	0x0010, 0x080c, 0x8df1, 0x009e, 0x00de, 0x0005, 0x00d6, 0x0096,
+	0x0126, 0x2091, 0x8000, 0x080c, 0x8b7d, 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, 0x2002,
+	0x080c, 0xc3f7, 0x9006, 0x080c, 0x2002, 0x001e, 0xa804, 0x9005,
+	0x0110, 0x2048, 0x0c28, 0x04d9, 0x080c, 0x8df1, 0x012e, 0x009e,
+	0x00de, 0x0005, 0x00d6, 0x0096, 0x0126, 0x2091, 0x8000, 0x080c,
+	0x8bc8, 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, 0xc3f7, 0x001e, 0xa804,
+	0x9005, 0x0110, 0x2048, 0x0c60, 0x0051, 0x7814, 0x2048, 0x080c,
+	0x0fd5, 0x080c, 0x8df1, 0x012e, 0x009e, 0x00de, 0x0005, 0x60c0,
+	0x8004, 0x9084, 0x0003, 0x9005, 0x0130, 0x9082, 0x0004, 0x20a3,
+	0x0000, 0x8000, 0x1de0, 0x0005, 0x080c, 0x8b7d, 0x7003, 0x7800,
+	0x7808, 0x8007, 0x700a, 0x60c3, 0x0008, 0x0804, 0x8df1, 0x00d6,
+	0x00e6, 0x080c, 0x8bc8, 0x7814, 0x9084, 0xff00, 0x2073, 0x0200,
+	0x8e70, 0x8e70, 0x9095, 0x0010, 0x2272, 0x8e70, 0x2073, 0x0034,
+	0x8e70, 0x2069, 0x1805, 0x20a9, 0x0004, 0x2d76, 0x8d68, 0x8e70,
+	0x1f04, 0x892d, 0x2069, 0x1801, 0x20a9, 0x0004, 0x2d76, 0x8d68,
+	0x8e70, 0x1f04, 0x8936, 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, 0x8944, 0x60c3,
+	0x004c, 0x080c, 0x8df1, 0x00ee, 0x00de, 0x0005, 0x080c, 0x8b7d,
+	0x7003, 0x6300, 0x7007, 0x0028, 0x7808, 0x700e, 0x60c3, 0x0008,
+	0x0804, 0x8df1, 0x00d6, 0x0026, 0x0016, 0x080c, 0x8bc8, 0x7003,
+	0x0200, 0x7814, 0x700e, 0x00e6, 0x9ef0, 0x0004, 0x2009, 0x0001,
+	0x2011, 0x000c, 0x2073, 0x0800, 0x8e70, 0x2073, 0x0000, 0x00ee,
+	0x7206, 0x710a, 0x62c2, 0x080c, 0x8df1, 0x001e, 0x002e, 0x00de,
+	0x0005, 0x2001, 0x1817, 0x2004, 0x609a, 0x0804, 0x8df1, 0x080c,
+	0x8b7d, 0x7003, 0x5200, 0x2069, 0x1853, 0x6804, 0xd084, 0x0130,
+	0x6828, 0x0016, 0x080c, 0x2422, 0x710e, 0x001e, 0x20a9, 0x0004,
+	0x20e1, 0x0001, 0x2099, 0x1805, 0x20e9, 0x0000, 0x20a1, 0x0250,
+	0x4003, 0x20a9, 0x0004, 0x2099, 0x1801, 0x20a1, 0x0254, 0x4003,
+	0x080c, 0x99e4, 0x1120, 0xb8a0, 0x9082, 0x007f, 0x0248, 0x2001,
+	0x181e, 0x2004, 0x7032, 0x2001, 0x181f, 0x2004, 0x7036, 0x0030,
+	0x2001, 0x1817, 0x2004, 0x9084, 0x00ff, 0x7036, 0x60c3, 0x001c,
+	0x0804, 0x8df1, 0x080c, 0x8b7d, 0x7003, 0x0500, 0x080c, 0x99e4,
+	0x1120, 0xb8a0, 0x9082, 0x007f, 0x0248, 0x2001, 0x181e, 0x2004,
+	0x700a, 0x2001, 0x181f, 0x2004, 0x700e, 0x0030, 0x2001, 0x1817,
+	0x2004, 0x9084, 0x00ff, 0x700e, 0x20a9, 0x0004, 0x20e1, 0x0001,
+	0x2099, 0x1805, 0x20e9, 0x0000, 0x20a1, 0x0250, 0x4003, 0x60c3,
+	0x0010, 0x0804, 0x8df1, 0x080c, 0x8b7d, 0x9006, 0x080c, 0x6527,
+	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, 0x8a5e, 0x00d6, 0x2069, 0x193d, 0x2001, 0x1836, 0x2004,
+	0xd0a4, 0x0178, 0x6800, 0x700a, 0x6808, 0x9084, 0x2000, 0x7012,
+	0x680c, 0x7016, 0x701f, 0x2710, 0x6818, 0x7022, 0x681c, 0x7026,
+	0x0080, 0x6800, 0x700a, 0x6804, 0x700e, 0x6808, 0x080c, 0x6f5c,
+	0x1118, 0x9084, 0x37ff, 0x0010, 0x9084, 0x3fff, 0x7012, 0x680c,
+	0x7016, 0x00de, 0x20a9, 0x0004, 0x20e1, 0x0001, 0x2099, 0x1805,
+	0x20e9, 0x0000, 0x20a1, 0x0256, 0x4003, 0x20a9, 0x0004, 0x2099,
+	0x1801, 0x20a1, 0x025a, 0x4003, 0x00d6, 0x080c, 0x9663, 0x2069,
+	0x1945, 0x2071, 0x024e, 0x6800, 0xc0dd, 0x7002, 0x080c, 0x52a1,
+	0xd0e4, 0x0110, 0x680c, 0x700e, 0x00de, 0x04a0, 0x2001, 0x1836,
+	0x2004, 0xd0a4, 0x0168, 0x0016, 0x2009, 0x0002, 0x60e0, 0x9106,
+	0x0130, 0x2100, 0x60e3, 0x0000, 0x080c, 0x2463, 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, 0x9663, 0x20a1, 0x024e, 0x20a9, 0x0008, 0x2099,
+	0x1945, 0x4003, 0x60c3, 0x0074, 0x0804, 0x8df1, 0x080c, 0x8b7d,
+	0x7003, 0x2010, 0x7007, 0x0014, 0x700b, 0x0800, 0x700f, 0x2000,
+	0x9006, 0x00f6, 0x2079, 0x1853, 0x7904, 0x00fe, 0xd1ac, 0x1110,
+	0x9085, 0x0020, 0x0010, 0x9085, 0x0010, 0x9085, 0x0002, 0x00d6,
+	0x0804, 0x8b2d, 0x7026, 0x60c3, 0x0014, 0x0804, 0x8df1, 0x080c,
+	0x8b7d, 0x7003, 0x5000, 0x0804, 0x8a0d, 0x080c, 0x8b7d, 0x7003,
+	0x2110, 0x7007, 0x0014, 0x60c3, 0x0014, 0x0804, 0x8df1, 0x080c,
+	0x8bbf, 0x0010, 0x080c, 0x8bc8, 0x7003, 0x0200, 0x60c3, 0x0004,
+	0x0804, 0x8df1, 0x080c, 0x8bc8, 0x7003, 0x0100, 0x700b, 0x0003,
+	0x700f, 0x2a00, 0x60c3, 0x0008, 0x0804, 0x8df1, 0x080c, 0x8bc8,
+	0x7003, 0x0200, 0x0804, 0x8a0d, 0x080c, 0x8bc8, 0x7003, 0x0100,
+	0x782c, 0x9005, 0x0110, 0x700a, 0x0010, 0x700b, 0x0003, 0x7814,
+	0x700e, 0x60c3, 0x0008, 0x0804, 0x8df1, 0x00d6, 0x080c, 0x8bc8,
+	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, 0x0010, 0x9085, 0x0010, 0x2009, 0x1875,
+	0x210c, 0xd184, 0x1110, 0x9085, 0x0002, 0x0026, 0x2009, 0x1873,
+	0x210c, 0xd1e4, 0x0150, 0xc0c5, 0xbac4, 0xd28c, 0x1108, 0xc0cd,
+	0x9094, 0x0030, 0x9296, 0x0010, 0x0140, 0xd1ec, 0x0130, 0x9094,
+	0x0030, 0x9296, 0x0010, 0x0108, 0xc0bd, 0x002e, 0x7026, 0x60c3,
+	0x0014, 0x00de, 0x0804, 0x8df1, 0x080c, 0x8bc8, 0x7003, 0x0210,
+	0x7007, 0x0014, 0x700f, 0x0100, 0x60c3, 0x0014, 0x0804, 0x8df1,
+	0x080c, 0x8bc8, 0x7003, 0x0200, 0x0804, 0x8993, 0x080c, 0x8bc8,
+	0x7003, 0x0100, 0x700b, 0x0003, 0x700f, 0x2a00, 0x60c3, 0x0008,
+	0x0804, 0x8df1, 0x080c, 0x8bc8, 0x7003, 0x0100, 0x700b, 0x000b,
+	0x60c3, 0x0008, 0x0804, 0x8df1, 0x0026, 0x00d6, 0x0036, 0x0046,
+	0x2019, 0x3200, 0x2021, 0x0800, 0x0040, 0x0026, 0x00d6, 0x0036,
+	0x0046, 0x2019, 0x2200, 0x2021, 0x0100, 0x080c, 0x9678, 0xb810,
+	0x9305, 0x7002, 0xb814, 0x7006, 0x2069, 0x1800, 0x6878, 0x700a,
+	0x687c, 0x700e, 0x9485, 0x0029, 0x7012, 0x004e, 0x003e, 0x00de,
+	0x080c, 0x8de5, 0x721a, 0x9f95, 0x0000, 0x7222, 0x7027, 0xffff,
+	0x2071, 0x024c, 0x002e, 0x0005, 0x0026, 0x080c, 0x9678, 0x7003,
+	0x02ff, 0x7007, 0xfffc, 0x00d6, 0x2069, 0x1800, 0x6878, 0x700a,
+	0x687c, 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, 0x9678, 0xb810, 0x9305, 0x7002, 0xb814, 0x7006, 0x2069,
+	0x1800, 0xb810, 0x9005, 0x1140, 0xb814, 0x9005, 0x1128, 0x700b,
+	0x00ff, 0x700f, 0xfffe, 0x0020, 0x6878, 0x700a, 0x687c, 0x700e,
+	0x0000, 0x9485, 0x0098, 0x7012, 0x004e, 0x003e, 0x00de, 0x080c,
+	0x8de5, 0x721a, 0x7a08, 0x7222, 0x2f10, 0x7226, 0x2071, 0x024c,
+	0x002e, 0x0005, 0x080c, 0x8de5, 0x721a, 0x7a08, 0x7222, 0x7814,
+	0x7026, 0x2071, 0x024c, 0x002e, 0x0005, 0x00b6, 0x00c6, 0x00d6,
+	0x00e6, 0x00f6, 0x2069, 0x0200, 0x2071, 0x0240, 0x6004, 0x908a,
+	0x0085, 0x0a0c, 0x0d65, 0x908a, 0x0092, 0x1a0c, 0x0d65, 0x6110,
+	0x2158, 0xb984, 0x2c78, 0x2061, 0x0100, 0x619a, 0x9082, 0x0085,
+	0x0033, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x0005, 0x8c36,
+	0x8c45, 0x8c50, 0x8c34, 0x8c34, 0x8c34, 0x8c36, 0x8c34, 0x8c34,
+	0x8c34, 0x8c34, 0x8c34, 0x8c34, 0x080c, 0x0d65, 0x0411, 0x60c3,
+	0x0000, 0x0026, 0x080c, 0x2760, 0x0228, 0x2011, 0x0101, 0x2204,
+	0xc0c5, 0x2012, 0x002e, 0x0804, 0x8df1, 0x0431, 0x7808, 0x700a,
+	0x7814, 0x700e, 0x7017, 0xffff, 0x60c3, 0x000c, 0x0804, 0x8df1,
+	0x0479, 0x7003, 0x0003, 0x7007, 0x0300, 0x60c3, 0x0004, 0x0804,
+	0x8df1, 0x0026, 0x080c, 0x9678, 0xb810, 0x9085, 0x8100, 0x7002,
+	0xb814, 0x7006, 0x2069, 0x1800, 0x6878, 0x700a, 0x687c, 0x700e,
+	0x7013, 0x0009, 0x0804, 0x8b98, 0x0026, 0x080c, 0x9678, 0xb810,
+	0x9085, 0x8400, 0x7002, 0xb814, 0x7006, 0x2069, 0x1800, 0x6878,
+	0x700a, 0x687c, 0x700e, 0x2001, 0x0099, 0x7012, 0x0804, 0x8bfa,
+	0x0026, 0x080c, 0x9678, 0xb810, 0x9085, 0x8500, 0x7002, 0xb814,
+	0x7006, 0x2069, 0x1800, 0x6878, 0x700a, 0x687c, 0x700e, 0x2001,
+	0x0099, 0x7012, 0x0804, 0x8bfa, 0x00b6, 0x00c6, 0x00d6, 0x00e6,
+	0x00f6, 0x2c78, 0x2069, 0x0200, 0x2071, 0x0240, 0x7804, 0x908a,
+	0x0040, 0x0a0c, 0x0d65, 0x908a, 0x0057, 0x1a0c, 0x0d65, 0x7910,
+	0x2158, 0xb984, 0x2061, 0x0100, 0x619a, 0x9082, 0x0040, 0x0033,
+	0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x0005, 0x8cc9, 0x8cc9,
+	0x8cc9, 0x8ced, 0x8cc9, 0x8cc9, 0x8cc9, 0x8cc9, 0x8cc9, 0x8cc9,
+	0x8cc9, 0x91c3, 0x91cf, 0x91db, 0x91e7, 0x8cc9, 0x8cc9, 0x8cc9,
+	0x91b7, 0x080c, 0x0d65, 0x6813, 0x0008, 0xba8c, 0x8210, 0xb8c4,
+	0xd084, 0x0128, 0x7a4e, 0x7b14, 0x7b52, 0x722e, 0x732a, 0x9294,
+	0x00ff, 0xba8e, 0x8217, 0x721a, 0xba10, 0x9295, 0x0600, 0x7202,
+	0xba14, 0x7206, 0x6a78, 0x720a, 0x6a7c, 0x720e, 0x7013, 0x0829,
+	0x2f10, 0x7222, 0x7027, 0xffff, 0x0005, 0x0016, 0x7814, 0x9084,
+	0x0700, 0x8007, 0x0013, 0x001e, 0x0005, 0x8cfd, 0x8cfd, 0x8cff,
+	0x8cfd, 0x8cfd, 0x8cfd, 0x8d19, 0x8cfd, 0x080c, 0x0d65, 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,
+	0x8df1, 0x2009, 0x0003, 0x0019, 0x7033, 0x7f00, 0x0cb0, 0x0016,
+	0x080c, 0x9678, 0x001e, 0xb810, 0x9085, 0x0100, 0x7002, 0xb814,
+	0x7006, 0x2069, 0x1800, 0x6a78, 0x720a, 0x6a7c, 0x720e, 0x7013,
+	0x0888, 0x918d, 0x0008, 0x7116, 0x080c, 0x8de5, 0x721a, 0x7a08,
+	0x7222, 0x2f10, 0x7226, 0x0005, 0x00b6, 0x0096, 0x00e6, 0x00d6,
+	0x00c6, 0x0056, 0x0046, 0x0036, 0x2061, 0x0100, 0x2071, 0x1800,
+	0x7810, 0x2058, 0xb8a0, 0x2028, 0xb910, 0xba14, 0x7378, 0x747c,
+	0x7820, 0x0002, 0x8d61, 0x8d61, 0x8d61, 0x8d61, 0x8d61, 0x8d61,
+	0x8d61, 0x8d61, 0x8d61, 0x8d61, 0x8d63, 0x8d61, 0x8d61, 0x8d61,
+	0x8d61, 0x080c, 0x0d65, 0x609f, 0x0000, 0x7814, 0x2048, 0xa87c,
+	0xd0fc, 0x05d0, 0xaf90, 0x9784, 0xff00, 0x9105, 0x6062, 0x873f,
+	0x9784, 0xff00, 0x0006, 0x7814, 0x2048, 0xa878, 0xc0fc, 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,
+	0x1836, 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, 0xa848, 0x608a, 0xa844, 0x608e, 0xa838, 0x60c6, 0xa834,
+	0x60ca, 0xb86c, 0x60ce, 0x60af, 0x95d5, 0x60d7, 0x0000, 0x080c,
+	0x9658, 0x2009, 0x07d0, 0x60c4, 0x9084, 0xfff0, 0x9005, 0x0110,
+	0x2009, 0x1b58, 0x080c, 0x806d, 0x003e, 0x004e, 0x005e, 0x00ce,
+	0x00de, 0x00ee, 0x009e, 0x00be, 0x0005, 0x7a40, 0x9294, 0x00ff,
+	0x8217, 0x0005, 0x00d6, 0x2069, 0x19b6, 0x686b, 0x0001, 0x00de,
+	0x0005, 0x60a3, 0x0056, 0x60a7, 0x9575, 0x00f1, 0x080c, 0x805f,
+	0x0005, 0x0016, 0x2001, 0x180c, 0x200c, 0x9184, 0x0600, 0x9086,
+	0x0600, 0x0128, 0x0089, 0x080c, 0x805f, 0x001e, 0x0005, 0xc1e5,
+	0x2001, 0x180c, 0x2102, 0x2001, 0x19b7, 0x2003, 0x0000, 0x2001,
+	0x19c2, 0x2003, 0x0000, 0x0c88, 0x0006, 0x0016, 0x0026, 0x2009,
+	0x1804, 0x2011, 0x0009, 0x080c, 0x283a, 0x002e, 0x001e, 0x000e,
+	0x0005, 0x0016, 0x00c6, 0x0006, 0x080c, 0x97a4, 0x0106, 0x190c,
+	0x9746, 0x2061, 0x0100, 0x61a4, 0x60a7, 0x95f5, 0x0016, 0x0026,
+	0x2009, 0x1804, 0x2011, 0x0008, 0x080c, 0x283a, 0x002e, 0x001e,
+	0x010e, 0x190c, 0x9762, 0x000e, 0xa001, 0xa001, 0xa001, 0x61a6,
+	0x00ce, 0x001e, 0x0005, 0x00c6, 0x00d6, 0x0016, 0x0026, 0x2061,
+	0x0100, 0x2069, 0x0140, 0x080c, 0x6f5c, 0x1510, 0x2001, 0x19db,
+	0x2004, 0x9005, 0x1904, 0x8ea2, 0x080c, 0x6ffd, 0x11a8, 0x2069,
+	0x0380, 0x6843, 0x0101, 0x6844, 0xd084, 0x1de8, 0x2061, 0x0100,
+	0x6020, 0xd0b4, 0x1120, 0x6024, 0xd084, 0x090c, 0x0d65, 0x6843,
+	0x0100, 0x080c, 0x805f, 0x04b0, 0x00c6, 0x2061, 0x19b6, 0x00f0,
+	0x6904, 0x9194, 0x4000, 0x0598, 0x080c, 0x8e21, 0x080c, 0x2801,
+	0x00c6, 0x2061, 0x19b6, 0x6134, 0x9192, 0x0008, 0x1278, 0x8108,
+	0x6136, 0x080c, 0x9746, 0x6130, 0x080c, 0x9762, 0x00ce, 0x81ff,
+	0x01c8, 0x080c, 0x805f, 0x080c, 0x8e14, 0x00a0, 0x080c, 0x9746,
+	0x6130, 0x91e5, 0x0000, 0x0150, 0x080c, 0xd43c, 0x080c, 0x8068,
+	0x6003, 0x0001, 0x2009, 0x0014, 0x080c, 0x9b03, 0x080c, 0x9762,
+	0x00ce, 0x0000, 0x002e, 0x001e, 0x00de, 0x00ce, 0x0005, 0x2001,
+	0x19db, 0x2004, 0x9005, 0x1db0, 0x00c6, 0x2061, 0x19b6, 0x6134,
+	0x9192, 0x0003, 0x1ad8, 0x8108, 0x6136, 0x00ce, 0x080c, 0x805f,
+	0x080c, 0x5a9d, 0x2009, 0x1852, 0x2114, 0x8210, 0x220a, 0x0c10,
+	0x0096, 0x00c6, 0x00d6, 0x00e6, 0x0016, 0x0026, 0x080c, 0x8075,
+	0x080c, 0x9746, 0x2001, 0x0387, 0x2003, 0x0202, 0x2071, 0x19b6,
+	0x714c, 0x81ff, 0x0904, 0x8f36, 0x2061, 0x0100, 0x2069, 0x0140,
+	0x080c, 0x6f5c, 0x11c0, 0x0036, 0x2019, 0x0002, 0x080c, 0x90f0,
+	0x003e, 0x714c, 0x2160, 0x080c, 0xd43c, 0x2009, 0x004a, 0x6003,
+	0x0003, 0x080c, 0x9b03, 0x2001, 0x0386, 0x2003, 0x5040, 0x080c,
+	0x6ffd, 0x0804, 0x8f36, 0x6904, 0xd1f4, 0x0904, 0x8f43, 0x080c,
+	0x2801, 0x00c6, 0x704c, 0x9065, 0x090c, 0x0d65, 0x6020, 0x00ce,
+	0x9086, 0x0006, 0x1518, 0x61c8, 0x60c4, 0x9105, 0x11f8, 0x2009,
+	0x180c, 0x2104, 0xd0d4, 0x01d0, 0x6214, 0x9294, 0x1800, 0x1128,
+	0x6224, 0x9294, 0x0002, 0x1510, 0x0010, 0xc0d4, 0x200a, 0x6014,
+	0x9084, 0xe7fd, 0x9085, 0x0010, 0x6016, 0x704c, 0x2060, 0x080c,
+	0x872e, 0x2009, 0x0049, 0x080c, 0x9b03, 0x0080, 0x0036, 0x2019,
+	0x0001, 0x080c, 0x90f0, 0x003e, 0x714c, 0x2160, 0x080c, 0xd43c,
+	0x2009, 0x004a, 0x6003, 0x0003, 0x080c, 0x9b03, 0x2001, 0x0387,
+	0x2003, 0x0200, 0x080c, 0x9762, 0x002e, 0x001e, 0x00ee, 0x00de,
+	0x00ce, 0x009e, 0x0005, 0xd1ec, 0x1904, 0x8ef7, 0x0804, 0x8ef9,
+	0x0026, 0x00e6, 0x2071, 0x19b6, 0x706c, 0xd084, 0x01d0, 0xc084,
+	0x706e, 0x714c, 0x81ff, 0x01a8, 0x2071, 0x0100, 0x9188, 0x0008,
+	0x2114, 0x928e, 0x0006, 0x1138, 0x2009, 0x1984, 0x2011, 0x0012,
+	0x080c, 0x283a, 0x0030, 0x2009, 0x1984, 0x2011, 0x0016, 0x080c,
+	0x283a, 0x00ee, 0x002e, 0x0005, 0x9036, 0x2001, 0x19c0, 0x2004,
+	0x9005, 0x0128, 0x9c06, 0x0128, 0x2c30, 0x600c, 0x0cc8, 0x9085,
+	0x0001, 0x0005, 0x00f6, 0x2079, 0x19b6, 0x610c, 0x9006, 0x600e,
+	0x6044, 0xc0fc, 0x6046, 0x86ff, 0x1140, 0x7824, 0x9c06, 0x1118,
+	0x7826, 0x782a, 0x0050, 0x792a, 0x0040, 0x00c6, 0x2660, 0x610e,
+	0x00ce, 0x7824, 0x9c06, 0x1108, 0x7e26, 0x080c, 0x91f6, 0x080c,
+	0xb8ad, 0x00fe, 0x0005, 0x080c, 0x8b7d, 0x7003, 0x1200, 0x7838,
+	0x7012, 0x783c, 0x7016, 0x00c6, 0x7820, 0x9086, 0x0004, 0x1148,
+	0x7810, 0x9005, 0x0130, 0x00b6, 0x2058, 0xb810, 0xb914, 0x00be,
+	0x0020, 0x2061, 0x1800, 0x6078, 0x617c, 0x9084, 0x00ff, 0x700a,
+	0x710e, 0x00ce, 0x60c3, 0x002c, 0x0804, 0x8df1, 0x080c, 0x8b7d,
+	0x7003, 0x0f00, 0x7808, 0xd09c, 0x0128, 0xb810, 0x9084, 0x00ff,
+	0x700a, 0xb814, 0x700e, 0x60c3, 0x0008, 0x0804, 0x8df1, 0x0156,
+	0x080c, 0x8bc8, 0x7003, 0x0200, 0x2011, 0x1848, 0x63f0, 0x2312,
+	0x20a9, 0x0006, 0x2011, 0x1840, 0x2019, 0x1841, 0x9ef0, 0x0002,
+	0x2376, 0x8e70, 0x2276, 0x8e70, 0x9398, 0x0002, 0x9290, 0x0002,
+	0x1f04, 0x8fe0, 0x60c3, 0x001c, 0x015e, 0x0804, 0x8df1, 0x0016,
+	0x0026, 0x080c, 0x8ba4, 0x080c, 0x8bb6, 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, 0x8df1, 0x002e, 0x001e, 0x0005, 0x20a9,
+	0x0010, 0x4003, 0x080c, 0x9663, 0x20a1, 0x0240, 0x22a8, 0x4003,
+	0x0c68, 0x080c, 0x8b7d, 0x7003, 0x6200, 0x7808, 0x700e, 0x60c3,
+	0x0008, 0x0804, 0x8df1, 0x0016, 0x0026, 0x080c, 0x8b7d, 0x20e9,
+	0x0000, 0x20a1, 0x024c, 0x7814, 0x0096, 0x2048, 0xa800, 0x2048,
+	0xa860, 0x20e0, 0xa85c, 0x9080, 0x0023, 0x2098, 0x009e, 0x7808,
+	0x9088, 0x0002, 0x21a8, 0x4003, 0x8003, 0x60c2, 0x080c, 0x8df1,
+	0x002e, 0x001e, 0x0005, 0x00e6, 0x00c6, 0x0006, 0x0126, 0x2091,
+	0x8000, 0x2071, 0x19b6, 0x7010, 0x2060, 0x8cff, 0x0188, 0x080c,
+	0xb8d3, 0x1110, 0x080c, 0xa40d, 0x600c, 0x0006, 0x080c, 0xbb4a,
+	0x600f, 0x0000, 0x080c, 0x9a65, 0x080c, 0x91f6, 0x00ce, 0x0c68,
+	0x2c00, 0x7012, 0x700e, 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,
+	0x7030, 0x2060, 0x8cff, 0x0548, 0x080c, 0x8e21, 0x6ac0, 0x68c3,
+	0x0000, 0x080c, 0x8068, 0x00c6, 0x2061, 0x0100, 0x080c, 0x967c,
+	0x00ce, 0x20a9, 0x01f4, 0x04b1, 0x080c, 0x86d1, 0x6044, 0xd0ac,
+	0x1128, 0x2001, 0x1957, 0x2004, 0x604a, 0x0020, 0x2009, 0x0013,
+	0x080c, 0x9b03, 0x000e, 0x001e, 0x002e, 0x006e, 0x00ce, 0x00de,
+	0x00ee, 0x00fe, 0x015e, 0x012e, 0x0005, 0x2001, 0x1800, 0x2004,
+	0x9096, 0x0001, 0x0d78, 0x9096, 0x0004, 0x0d60, 0x080c, 0x8068,
+	0x6814, 0x9084, 0x0001, 0x0110, 0x68a7, 0x95f5, 0x6817, 0x0008,
+	0x68c3, 0x0000, 0x2011, 0x5a47, 0x080c, 0x7fbb, 0x20a9, 0x01f4,
+	0x0009, 0x08c0, 0x6824, 0xd094, 0x0140, 0x6827, 0x0004, 0x7804,
+	0x9084, 0x4000, 0x190c, 0x2801, 0x0090, 0xd084, 0x0118, 0x6827,
+	0x0001, 0x0010, 0x1f04, 0x90d2, 0x7804, 0x9084, 0x1000, 0x0138,
+	0x2001, 0x0100, 0x080c, 0x27f1, 0x9006, 0x080c, 0x27f1, 0x0005,
+	0x0126, 0x0156, 0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x0066, 0x0026,
+	0x0016, 0x0006, 0x2091, 0x8000, 0x2001, 0x180c, 0x200c, 0x918c,
+	0xdbff, 0x2102, 0x2069, 0x0100, 0x2079, 0x0140, 0x2071, 0x0380,
+	0x701c, 0x0006, 0x701f, 0x0202, 0x2071, 0x19b6, 0x704c, 0x2060,
+	0x8cff, 0x0904, 0x9191, 0x9386, 0x0002, 0x1128, 0x6814, 0x9084,
+	0x0002, 0x0904, 0x9191, 0x68af, 0x95f5, 0x6817, 0x0010, 0x2009,
+	0x00fa, 0x8109, 0x1df0, 0x69c6, 0x68cb, 0x0008, 0x080c, 0x8075,
+	0x080c, 0x1c4d, 0x0046, 0x2009, 0x00a5, 0x080c, 0x0e3d, 0x2021,
+	0x0169, 0x2404, 0x9084, 0x000f, 0x9086, 0x0004, 0x11f8, 0x68af,
+	0x95f5, 0x68c6, 0x68cb, 0x0008, 0x00e6, 0x00f6, 0x2079, 0x0090,
+	0x2071, 0x19b6, 0x6814, 0x9084, 0x1984, 0x9085, 0x0012, 0x6816,
+	0x782b, 0x0008, 0x7057, 0x0000, 0x00fe, 0x00ee, 0x9386, 0x0002,
+	0x1128, 0x7884, 0x9005, 0x1110, 0x7887, 0x0001, 0x0016, 0x2009,
+	0x0040, 0x080c, 0x201d, 0x001e, 0x2009, 0x0000, 0x080c, 0x0e3d,
+	0x004e, 0x20a9, 0x03e8, 0x6824, 0xd094, 0x0140, 0x6827, 0x0004,
+	0x7804, 0x9084, 0x4000, 0x190c, 0x2801, 0x0090, 0xd08c, 0x0118,
+	0x6827, 0x0002, 0x0010, 0x1f04, 0x9163, 0x7804, 0x9084, 0x1000,
+	0x0138, 0x2001, 0x0100, 0x080c, 0x27f1, 0x9006, 0x080c, 0x27f1,
+	0x6827, 0x4000, 0x6824, 0x83ff, 0x1160, 0x2009, 0x0049, 0x080c,
+	0x872e, 0x6044, 0xd0ac, 0x1118, 0x6003, 0x0002, 0x0010, 0x080c,
+	0x9b03, 0x000e, 0x2071, 0x0380, 0xd08c, 0x1110, 0x701f, 0x0200,
+	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, 0x6a3e, 0x012e, 0x00de, 0x0005, 0x080c,
+	0x8ccb, 0x7814, 0x080c, 0x52a5, 0x0108, 0x782c, 0x7032, 0x7042,
+	0x7047, 0x1000, 0x0478, 0x080c, 0x8ccb, 0x7814, 0x080c, 0x52a5,
+	0x0108, 0x782c, 0x7032, 0x7042, 0x7047, 0x4000, 0x0418, 0x080c,
+	0x8ccb, 0x7814, 0x080c, 0x52a5, 0x0108, 0x782c, 0x7032, 0x7042,
+	0x7047, 0x2000, 0x00b8, 0x080c, 0x8ccb, 0x7814, 0x080c, 0x52a5,
+	0x0108, 0x782c, 0x7032, 0x7042, 0x7047, 0x0400, 0x0058, 0x080c,
+	0x8ccb, 0x7814, 0x080c, 0x52a5, 0x0108, 0x782c, 0x7032, 0x7042,
+	0x7047, 0x0200, 0x60c3, 0x0020, 0x0804, 0x8df1, 0x00e6, 0x2071,
+	0x19b6, 0x702c, 0x9005, 0x0110, 0x8001, 0x702e, 0x00ee, 0x0005,
+	0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x0076, 0x0066, 0x0006, 0x0126,
+	0x2091, 0x8000, 0x2071, 0x19b6, 0x7620, 0x2660, 0x2678, 0x2039,
+	0x0001, 0x87ff, 0x0904, 0x929b, 0x8cff, 0x0904, 0x929b, 0x6020,
+	0x9086, 0x0006, 0x1904, 0x9296, 0x88ff, 0x0138, 0x2800, 0x9c06,
+	0x1904, 0x9296, 0x2039, 0x0000, 0x0050, 0x6010, 0x9b06, 0x1904,
+	0x9296, 0x85ff, 0x0120, 0x605c, 0x9106, 0x1904, 0x9296, 0x7030,
+	0x9c06, 0x15b0, 0x2069, 0x0100, 0x68c0, 0x9005, 0x1160, 0x6824,
+	0xd084, 0x0148, 0x6827, 0x0001, 0x080c, 0x8068, 0x080c, 0x9320,
+	0x7033, 0x0000, 0x0428, 0x080c, 0x8068, 0x6820, 0xd0b4, 0x0110,
+	0x68a7, 0x95f5, 0x6817, 0x0008, 0x68c3, 0x0000, 0x080c, 0x9320,
+	0x7033, 0x0000, 0x0036, 0x2069, 0x0140, 0x6b04, 0x9384, 0x1000,
+	0x0138, 0x2001, 0x0100, 0x080c, 0x27f1, 0x9006, 0x080c, 0x27f1,
+	0x2069, 0x0100, 0x6824, 0xd084, 0x0110, 0x6827, 0x0001, 0x003e,
+	0x7020, 0x9c36, 0x1110, 0x660c, 0x7622, 0x701c, 0x9c36, 0x1140,
+	0x2c00, 0x9f36, 0x0118, 0x2f00, 0x701e, 0x0010, 0x701f, 0x0000,
+	0x660c, 0x0066, 0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678,
+	0x89ff, 0x1168, 0x600f, 0x0000, 0x6014, 0x0096, 0x2048, 0x080c,
+	0xb6c3, 0x0110, 0x080c, 0xd079, 0x009e, 0x080c, 0x9a9f, 0x080c,
+	0x91f6, 0x88ff, 0x1190, 0x00ce, 0x0804, 0x9211, 0x2c78, 0x600c,
+	0x2060, 0x0804, 0x9211, 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,
+	0x7648, 0x2660, 0x2678, 0x8cff, 0x0904, 0x930f, 0x6020, 0x9086,
+	0x0006, 0x1904, 0x930a, 0x87ff, 0x0128, 0x2700, 0x9c06, 0x1904,
+	0x930a, 0x0040, 0x6010, 0x9b06, 0x15e8, 0x85ff, 0x0118, 0x605c,
+	0x9106, 0x15c0, 0x704c, 0x9c06, 0x1168, 0x0036, 0x2019, 0x0001,
+	0x080c, 0x90f0, 0x703f, 0x0000, 0x9006, 0x704e, 0x706a, 0x7052,
+	0x706e, 0x003e, 0x7048, 0x9c36, 0x1110, 0x660c, 0x764a, 0x7044,
+	0x9c36, 0x1140, 0x2c00, 0x9f36, 0x0118, 0x2f00, 0x7046, 0x0010,
+	0x7047, 0x0000, 0x660c, 0x0066, 0x2c00, 0x9f06, 0x0110, 0x7e0e,
+	0x0008, 0x2678, 0x600f, 0x0000, 0x6014, 0x2048, 0x080c, 0xb6c3,
+	0x0110, 0x080c, 0xd079, 0x080c, 0x9a9f, 0x87ff, 0x1198, 0x00ce,
+	0x0804, 0x92bb, 0x2c78, 0x600c, 0x2060, 0x0804, 0x92bb, 0x9006,
+	0x012e, 0x000e, 0x002e, 0x006e, 0x00ce, 0x009e, 0x00de, 0x00ee,
+	0x00fe, 0x0005, 0x601b, 0x0000, 0x00ce, 0x97bd, 0x0001, 0x0c80,
+	0x00e6, 0x2071, 0x19b6, 0x7033, 0x0000, 0x7004, 0x9086, 0x0003,
+	0x0158, 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, 0x7648, 0x2660, 0x2678, 0x8cff, 0x0518, 0x2200,
+	0x9c06, 0x11e0, 0x7048, 0x9c36, 0x1110, 0x660c, 0x764a, 0x7044,
+	0x9c36, 0x1140, 0x2c00, 0x9f36, 0x0118, 0x2f00, 0x7046, 0x0010,
+	0x7047, 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, 0x7610,
+	0x2660, 0x2678, 0x8cff, 0x0904, 0x9402, 0x6010, 0x00b6, 0x2058,
+	0xb8a0, 0x00be, 0x9206, 0x1904, 0x93fd, 0x7030, 0x9c06, 0x1520,
+	0x2069, 0x0100, 0x68c0, 0x9005, 0x0904, 0x93d9, 0x080c, 0x8e21,
+	0x68c3, 0x0000, 0x080c, 0x9320, 0x7033, 0x0000, 0x0036, 0x2069,
+	0x0140, 0x6b04, 0x9384, 0x1000, 0x0138, 0x2001, 0x0100, 0x080c,
+	0x27f1, 0x9006, 0x080c, 0x27f1, 0x2069, 0x0100, 0x6824, 0xd084,
+	0x0110, 0x6827, 0x0001, 0x003e, 0x7010, 0x9c36, 0x1110, 0x660c,
+	0x7612, 0x700c, 0x9c36, 0x1140, 0x2c00, 0x9f36, 0x0118, 0x2f00,
+	0x700e, 0x0010, 0x700f, 0x0000, 0x660c, 0x0066, 0x2c00, 0x9f06,
+	0x0110, 0x7e0e, 0x0008, 0x2678, 0x600f, 0x0000, 0x080c, 0xb8c2,
+	0x1158, 0x080c, 0x2ff2, 0x080c, 0xb8d3, 0x11f0, 0x080c, 0xa40d,
+	0x00d8, 0x080c, 0x9320, 0x08c0, 0x080c, 0xb8d3, 0x1118, 0x080c,
+	0xa40d, 0x0090, 0x6014, 0x2048, 0x080c, 0xb6c3, 0x0168, 0x6020,
+	0x9086, 0x0003, 0x1508, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000,
+	0x080c, 0x6833, 0x080c, 0xb8ad, 0x080c, 0xbb4a, 0x080c, 0x9a9f,
+	0x080c, 0x91f6, 0x00ce, 0x0804, 0x9382, 0x2c78, 0x600c, 0x2060,
+	0x0804, 0x9382, 0x012e, 0x000e, 0x002e, 0x006e, 0x00ce, 0x00de,
+	0x00ee, 0x00fe, 0x009e, 0x0005, 0x6020, 0x9086, 0x0006, 0x1d20,
+	0x080c, 0xd079, 0x0c08, 0x00d6, 0x080c, 0x8bc8, 0x7003, 0x0200,
+	0x7007, 0x0014, 0x60c3, 0x0014, 0x20e1, 0x0001, 0x2099, 0x1958,
+	0x20e9, 0x0000, 0x20a1, 0x0250, 0x20a9, 0x0004, 0x4003, 0x7023,
+	0x0004, 0x7027, 0x7878, 0x080c, 0x8df1, 0x00de, 0x0005, 0x080c,
+	0x8bc8, 0x700b, 0x0800, 0x7814, 0x9084, 0xff00, 0x700e, 0x7814,
+	0x9084, 0x00ff, 0x7022, 0x782c, 0x7026, 0x7860, 0x9084, 0x00ff,
+	0x9085, 0x0200, 0x7002, 0x7860, 0x9084, 0xff00, 0x8007, 0x7006,
+	0x60c2, 0x0804, 0x8df1, 0x00b6, 0x00d6, 0x0016, 0x00d6, 0x2f68,
+	0x2009, 0x0035, 0x080c, 0xbd4f, 0x00de, 0x1904, 0x94b0, 0x080c,
+	0x8b7d, 0x7003, 0x1300, 0x782c, 0x080c, 0x95bb, 0x2068, 0x6820,
+	0x9086, 0x0003, 0x0560, 0x7810, 0x2058, 0xbaa0, 0x080c, 0x99e4,
+	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, 0xb884, 0x700e, 0x00a8, 0x080c,
+	0x99e4, 0x1130, 0x7810, 0x2058, 0xb8a0, 0x9082, 0x007e, 0x0250,
+	0x00d6, 0x2069, 0x181e, 0x2d04, 0x700a, 0x8d68, 0x2d04, 0x700e,
+	0x00de, 0x0010, 0x6034, 0x700e, 0x7838, 0x7012, 0x783c, 0x7016,
+	0x60c3, 0x000c, 0x001e, 0x00de, 0x080c, 0x8df1, 0x00be, 0x0005,
+	0x781b, 0x0001, 0x7803, 0x0006, 0x001e, 0x00de, 0x00be, 0x0005,
+	0x792c, 0x9180, 0x0008, 0x200c, 0x9186, 0x0006, 0x01c0, 0x9186,
+	0x0003, 0x0904, 0x952e, 0x9186, 0x0005, 0x0904, 0x9516, 0x9186,
+	0x0004, 0x05f0, 0x9186, 0x0008, 0x0904, 0x951f, 0x7807, 0x0037,
+	0x782f, 0x0003, 0x7817, 0x1700, 0x080c, 0x9598, 0x0005, 0x080c,
+	0x9559, 0x00d6, 0x0026, 0x792c, 0x2168, 0x2009, 0x4000, 0x6800,
+	0x6a44, 0xd2fc, 0x11f8, 0x0002, 0x94f7, 0x9502, 0x94f9, 0x9502,
+	0x94fe, 0x94f7, 0x94f7, 0x9502, 0x9502, 0x9502, 0x9502, 0x94f7,
+	0x94f7, 0x94f7, 0x94f7, 0x94f7, 0x9502, 0x94f7, 0x9502, 0x080c,
+	0x0d65, 0x6824, 0xd0e4, 0x0110, 0xd0cc, 0x0110, 0x900e, 0x0010,
+	0x2009, 0x2000, 0x682c, 0x7022, 0x6830, 0x7026, 0x0804, 0x9552,
+	0x080c, 0x9559, 0x00d6, 0x0026, 0x792c, 0x2168, 0x2009, 0x4000,
+	0x6a00, 0x9286, 0x0002, 0x1108, 0x900e, 0x04e0, 0x080c, 0x9559,
+	0x00d6, 0x0026, 0x792c, 0x2168, 0x2009, 0x4000, 0x0498, 0x04c9,
+	0x00d6, 0x0026, 0x792c, 0x2168, 0x2009, 0x4000, 0x9286, 0x0005,
+	0x0118, 0x9286, 0x0002, 0x1108, 0x900e, 0x0420, 0x0451, 0x00d6,
+	0x0026, 0x792c, 0x2168, 0x6814, 0x0096, 0x2048, 0xa9ac, 0xa834,
+	0x9112, 0xa9b0, 0xa838, 0x009e, 0x9103, 0x7022, 0x7226, 0x792c,
+	0x9180, 0x0011, 0x2004, 0xd0fc, 0x1148, 0x9180, 0x0000, 0x2004,
+	0x908e, 0x0002, 0x0130, 0x908e, 0x0004, 0x0118, 0x2009, 0x4000,
+	0x0008, 0x900e, 0x712a, 0x60c3, 0x0018, 0x002e, 0x00de, 0x0804,
+	0x8df1, 0x00b6, 0x0036, 0x0046, 0x0056, 0x0066, 0x080c, 0x8bc8,
+	0x9006, 0x7003, 0x0200, 0x7938, 0x710a, 0x793c, 0x710e, 0x7810,
+	0x2058, 0xb8a0, 0x080c, 0x99e4, 0x1118, 0x9092, 0x007e, 0x0268,
+	0x00d6, 0x2069, 0x181e, 0x2d2c, 0x8d68, 0x2d34, 0x90d8, 0x1000,
+	0x2b5c, 0xbb10, 0xbc14, 0x00de, 0x0028, 0x901e, 0xbc84, 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, 0x8bc8, 0x7003, 0x0100, 0x782c, 0x700a, 0x7814, 0x700e,
+	0x700e, 0x60c3, 0x0008, 0x0804, 0x8df1, 0x080c, 0x8b74, 0x7003,
+	0x1400, 0x7838, 0x700a, 0x0079, 0x783c, 0x700e, 0x782c, 0x7012,
+	0x7830, 0x7016, 0x7834, 0x9084, 0x00ff, 0x8007, 0x701a, 0x60c3,
+	0x0010, 0x0804, 0x8df1, 0x00e6, 0x2071, 0x0240, 0x0006, 0x00f6,
+	0x2078, 0x7810, 0x00b6, 0x2058, 0xb8c4, 0xd084, 0x0120, 0x7850,
+	0x702a, 0x784c, 0x702e, 0x00be, 0x00fe, 0x000e, 0x00ee, 0x0005,
+	0x080c, 0x8bbf, 0x7003, 0x0100, 0x782c, 0x700a, 0x7814, 0x700e,
+	0x60c3, 0x0008, 0x0804, 0x8df1, 0x00a9, 0x7914, 0x712a, 0x60c3,
+	0x0000, 0x60a7, 0x9575, 0x0026, 0x080c, 0x2760, 0x0228, 0x2011,
+	0x0101, 0x2204, 0xc0c5, 0x2012, 0x002e, 0x080c, 0x8e14, 0x080c,
+	0x805f, 0x0005, 0x0036, 0x0096, 0x00d6, 0x00e6, 0x7860, 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, 0x9678,
+	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, 0x0026, 0x2110, 0x900e, 0x080c,
+	0x283a, 0x002e, 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, 0x00f6, 0x00e6, 0x00d6, 0x00c6,
+	0x00a6, 0x0096, 0x0066, 0x0126, 0x2091, 0x8000, 0x2071, 0x19b6,
+	0x7610, 0x2660, 0x2678, 0x8cff, 0x0904, 0x9723, 0x7030, 0x9c06,
+	0x1520, 0x2069, 0x0100, 0x68c0, 0x9005, 0x0904, 0x96fa, 0x080c,
+	0x8e21, 0x68c3, 0x0000, 0x080c, 0x9320, 0x7033, 0x0000, 0x0036,
+	0x2069, 0x0140, 0x6b04, 0x9384, 0x1000, 0x0138, 0x2001, 0x0100,
+	0x080c, 0x27f1, 0x9006, 0x080c, 0x27f1, 0x2069, 0x0100, 0x6824,
+	0xd084, 0x0110, 0x6827, 0x0001, 0x003e, 0x7010, 0x9c36, 0x1110,
+	0x660c, 0x7612, 0x700c, 0x9c36, 0x1140, 0x2c00, 0x9f36, 0x0118,
+	0x2f00, 0x700e, 0x0010, 0x700f, 0x0000, 0x660c, 0x0066, 0x2c00,
+	0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678, 0x600f, 0x0000, 0x080c,
+	0xb8c2, 0x1158, 0x080c, 0x2ff2, 0x080c, 0xb8d3, 0x11f0, 0x080c,
+	0xa40d, 0x00d8, 0x080c, 0x9320, 0x08c0, 0x080c, 0xb8d3, 0x1118,
+	0x080c, 0xa40d, 0x0090, 0x6014, 0x2048, 0x080c, 0xb6c3, 0x0168,
+	0x6020, 0x9086, 0x0003, 0x1520, 0xa867, 0x0103, 0xab7a, 0xa877,
+	0x0000, 0x080c, 0x683f, 0x080c, 0xb8ad, 0x080c, 0xbb4a, 0x080c,
+	0x9a9f, 0x080c, 0x91f6, 0x00ce, 0x0804, 0x96ab, 0x2c78, 0x600c,
+	0x2060, 0x0804, 0x96ab, 0x7013, 0x0000, 0x700f, 0x0000, 0x012e,
+	0x006e, 0x009e, 0x00ae, 0x00ce, 0x00de, 0x00ee, 0x00fe, 0x0005,
+	0x6020, 0x9086, 0x0006, 0x1d08, 0x080c, 0xd079, 0x08f0, 0x00f6,
+	0x0036, 0x2079, 0x0380, 0x7b18, 0xd3bc, 0x1de8, 0x7832, 0x7936,
+	0x7a3a, 0x781b, 0x8080, 0x003e, 0x00fe, 0x0005, 0x0016, 0x2001,
+	0x0382, 0x2004, 0x9084, 0x0007, 0x9086, 0x0001, 0x1188, 0x2001,
+	0x0015, 0x0c29, 0x2009, 0x1000, 0x2001, 0x0382, 0x2004, 0x9084,
+	0x0007, 0x9086, 0x0003, 0x0120, 0x8109, 0x1db0, 0x080c, 0x0d65,
+	0x001e, 0x0005, 0x2001, 0x0382, 0x2004, 0x9084, 0x0007, 0x9086,
+	0x0003, 0x1120, 0x2001, 0x0380, 0x2003, 0x0001, 0x0005, 0x0156,
+	0x0016, 0x0026, 0x00e6, 0x900e, 0x2071, 0x19b6, 0x0469, 0x0106,
+	0x0190, 0x7004, 0x9086, 0x0003, 0x0148, 0x20a9, 0x1000, 0x6044,
+	0xd0fc, 0x01d8, 0x1f04, 0x977f, 0x080c, 0x0d65, 0x080c, 0x9746,
+	0x6044, 0xd0fc, 0x0190, 0x7030, 0x9c06, 0x1148, 0x080c, 0x86d1,
+	0x6044, 0xd0dc, 0x0150, 0xc0dc, 0x6046, 0x700a, 0x7042, 0x704c,
+	0x9c06, 0x190c, 0x0d65, 0x080c, 0x872e, 0x010e, 0x1919, 0x00ee,
+	0x002e, 0x001e, 0x015e, 0x0005, 0x2001, 0x0382, 0x2004, 0x9084,
+	0x0007, 0x9086, 0x0003, 0x0005, 0x0126, 0x2091, 0x2400, 0x7808,
+	0xd0a4, 0x190c, 0x0d5e, 0xd09c, 0x0128, 0x7820, 0x908c, 0xf000,
+	0x11b8, 0x0012, 0x012e, 0x0005, 0x97cc, 0x980a, 0x9831, 0x9861,
+	0x9871, 0x9882, 0x9891, 0x989f, 0x98b0, 0x98b4, 0x97cc, 0x97cc,
+	0x97cc, 0x97cc, 0x97cc, 0x97cc, 0x080c, 0x0d65, 0x012e, 0x0005,
+	0x2060, 0x6044, 0xd0bc, 0x0140, 0xc0bc, 0x6046, 0x6000, 0x908a,
+	0x0016, 0x1a0c, 0x0d65, 0x0012, 0x012e, 0x0005, 0x97f1, 0x97f3,
+	0x97f1, 0x97f9, 0x97f1, 0x97f1, 0x97f1, 0x97f1, 0x97f1, 0x97f3,
+	0x97f1, 0x97f3, 0x97f1, 0x97f3, 0x97f1, 0x97f1, 0x97f1, 0x97f3,
+	0x97f1, 0x080c, 0x0d65, 0x2009, 0x0013, 0x080c, 0x9b03, 0x012e,
+	0x0005, 0x6014, 0x2048, 0xa87c, 0xd0dc, 0x0130, 0x080c, 0x821d,
+	0x080c, 0x9a65, 0x012e, 0x0005, 0x2009, 0x0049, 0x080c, 0x9b03,
+	0x012e, 0x0005, 0x080c, 0x9746, 0x2001, 0x19db, 0x2003, 0x0000,
+	0x7030, 0x9065, 0x090c, 0x0d65, 0x7034, 0x9092, 0x00c8, 0x1258,
+	0x8000, 0x7036, 0x7004, 0x9086, 0x0003, 0x0110, 0x7007, 0x0000,
+	0x781f, 0x0808, 0x0040, 0x080c, 0xd43c, 0x6003, 0x0001, 0x2009,
+	0x0014, 0x080c, 0x9b03, 0x781f, 0x0100, 0x080c, 0x9762, 0x012e,
+	0x0005, 0x080c, 0x9746, 0x714c, 0x81ff, 0x1128, 0x2011, 0x19de,
+	0x2013, 0x0000, 0x0400, 0x2061, 0x0100, 0x7150, 0x9192, 0x7530,
+	0x12b8, 0x8108, 0x7152, 0x714c, 0x9188, 0x0008, 0x210c, 0x918e,
+	0x0006, 0x1138, 0x6014, 0x9084, 0x1984, 0x9085, 0x0012, 0x6016,
+	0x0050, 0x6014, 0x9084, 0x1984, 0x9085, 0x0016, 0x6016, 0x0018,
+	0x706c, 0xc085, 0x706e, 0x781f, 0x0200, 0x080c, 0x9762, 0x012e,
+	0x0005, 0x080c, 0x9746, 0x714c, 0x2160, 0x6003, 0x0003, 0x2009,
+	0x004a, 0x080c, 0x9b03, 0x781f, 0x0200, 0x080c, 0x9762, 0x012e,
+	0x0005, 0x7808, 0xd09c, 0x0de8, 0x7820, 0x2060, 0x6003, 0x0003,
+	0x080c, 0x9746, 0x080c, 0x1bd5, 0x781f, 0x0400, 0x080c, 0x9762,
+	0x012e, 0x0005, 0x7808, 0xd09c, 0x0de8, 0x7820, 0x2060, 0x080c,
+	0x9746, 0x080c, 0x1c1d, 0x781f, 0x0400, 0x080c, 0x9762, 0x012e,
+	0x0005, 0x7030, 0x9065, 0x0148, 0x6044, 0xc0bc, 0x6046, 0x7104,
+	0x9186, 0x0003, 0x0110, 0x080c, 0x8794, 0x012e, 0x0005, 0x00f6,
+	0x703c, 0x9086, 0x0002, 0x0148, 0x704c, 0x907d, 0x0130, 0x7844,
+	0xc0bc, 0x7846, 0x080c, 0x8d3c, 0x0000, 0x00fe, 0x012e, 0x0005,
+	0x080c, 0x6ffd, 0x012e, 0x0005, 0x080c, 0x0d65, 0x0005, 0x00e6,
+	0x2071, 0x19b6, 0x6044, 0xc0bc, 0x6046, 0xd0fc, 0x01b8, 0x704c,
+	0x9c06, 0x1190, 0x2019, 0x0001, 0x080c, 0x90f0, 0x704f, 0x0000,
+	0x2001, 0x0109, 0x2004, 0xd08c, 0x1138, 0x2001, 0x0108, 0x2004,
+	0xd0bc, 0x1110, 0x703f, 0x0000, 0x080c, 0x9336, 0x00ee, 0x0005,
+	0x0026, 0x7010, 0x9c06, 0x1178, 0x080c, 0x91f6, 0x6044, 0xc0fc,
+	0x6046, 0x600c, 0x9015, 0x0120, 0x7212, 0x600f, 0x0000, 0x0010,
+	0x7212, 0x720e, 0x9006, 0x002e, 0x0005, 0x0026, 0x7020, 0x9c06,
+	0x1178, 0x080c, 0x91f6, 0x6044, 0xc0fc, 0x6046, 0x600c, 0x9015,
+	0x0120, 0x7222, 0x600f, 0x0000, 0x0010, 0x7222, 0x721e, 0x9006,
+	0x002e, 0x0005, 0x00d6, 0x0036, 0x7830, 0x9c06, 0x1558, 0x2069,
+	0x0100, 0x68c0, 0x9005, 0x01f8, 0x080c, 0x8068, 0x080c, 0x8e21,
+	0x68c3, 0x0000, 0x080c, 0x9320, 0x2069, 0x0140, 0x6b04, 0x9384,
+	0x1000, 0x0138, 0x2001, 0x0100, 0x080c, 0x27f1, 0x9006, 0x080c,
+	0x27f1, 0x2069, 0x0100, 0x6824, 0xd084, 0x0110, 0x6827, 0x0001,
+	0x9085, 0x0001, 0x0038, 0x7808, 0xc0ad, 0x780a, 0x6003, 0x0009,
+	0x630a, 0x9006, 0x003e, 0x00de, 0x0005, 0x0016, 0x0026, 0x0036,
+	0x6100, 0x2019, 0x0100, 0x2001, 0x0382, 0x2004, 0xd09c, 0x0190,
+	0x00c6, 0x0126, 0x2091, 0x2800, 0x0016, 0x0036, 0x080c, 0x97ac,
+	0x003e, 0x001e, 0x012e, 0x00ce, 0x6200, 0x2200, 0x9106, 0x0d58,
+	0x2200, 0x0010, 0x8319, 0x1d38, 0x003e, 0x002e, 0x001e, 0x0005,
+	0x00d6, 0x0156, 0x080c, 0x8bc8, 0x7a14, 0x82ff, 0x0138, 0x7003,
+	0x0100, 0x700b, 0x0003, 0x60c3, 0x0008, 0x0490, 0x7003, 0x0200,
+	0x7007, 0x0000, 0x2069, 0x1800, 0x901e, 0x6800, 0x9086, 0x0004,
+	0x1110, 0xc38d, 0x0060, 0x080c, 0x6f5c, 0x1110, 0xc3ad, 0x0008,
+	0xc3a5, 0x6ad8, 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, 0x998c, 0x60c3, 0x0020,
+	0x080c, 0x8df1, 0x015e, 0x00de, 0x0005, 0x0156, 0x080c, 0x8bc8,
+	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, 0x181e, 0x2004,
+	0x7022, 0x2001, 0x181f, 0x2004, 0x7026, 0x0030, 0x2001, 0x1817,
+	0x2004, 0x9084, 0x00ff, 0x7026, 0x20a9, 0x0004, 0x20e1, 0x0001,
+	0x2099, 0x1805, 0x20e9, 0x0000, 0x20a1, 0x0256, 0x4003, 0x60c3,
+	0x001c, 0x015e, 0x0804, 0x8df1, 0x0006, 0x2001, 0x1836, 0x2004,
+	0xd0ac, 0x000e, 0x0005, 0x2011, 0x0003, 0x080c, 0x91a3, 0x2011,
+	0x0002, 0x080c, 0x91ad, 0x080c, 0x9070, 0x0036, 0x901e, 0x080c,
+	0x90f0, 0x003e, 0x0005, 0x2071, 0x1883, 0x7000, 0x9005, 0x0140,
+	0x2001, 0x0812, 0x2071, 0x1800, 0x7072, 0x7076, 0x7067, 0xffd4,
+	0x2071, 0x1800, 0x7070, 0x7052, 0x7057, 0x1ddc, 0x0005, 0x00e6,
+	0x0126, 0x2071, 0x1800, 0x2091, 0x8000, 0x7550, 0x9582, 0x0010,
+	0x0608, 0x7054, 0x2060, 0x6000, 0x9086, 0x0000, 0x0148, 0x9ce0,
+	0x001c, 0x7064, 0x9c02, 0x1208, 0x0cb0, 0x2061, 0x1ddc, 0x0c98,
+	0x6003, 0x0008, 0x8529, 0x7552, 0x9ca8, 0x001c, 0x7064, 0x9502,
+	0x1230, 0x7556, 0x9085, 0x0001, 0x012e, 0x00ee, 0x0005, 0x7057,
+	0x1ddc, 0x0cc0, 0x9006, 0x0cc0, 0x00e6, 0x2071, 0x1800, 0x7550,
+	0x9582, 0x0010, 0x0600, 0x7054, 0x2060, 0x6000, 0x9086, 0x0000,
+	0x0148, 0x9ce0, 0x001c, 0x7064, 0x9c02, 0x1208, 0x0cb0, 0x2061,
+	0x1ddc, 0x0c98, 0x6003, 0x0008, 0x8529, 0x7552, 0x9ca8, 0x001c,
+	0x7064, 0x9502, 0x1228, 0x7556, 0x9085, 0x0001, 0x00ee, 0x0005,
+	0x7057, 0x1ddc, 0x0cc8, 0x9006, 0x0cc8, 0x9c82, 0x1ddc, 0x0a0c,
+	0x0d65, 0x2001, 0x1819, 0x2004, 0x9c02, 0x1a0c, 0x0d65, 0x9006,
+	0x6006, 0x600a, 0x600e, 0x6016, 0x601a, 0x6012, 0x6023, 0x0000,
+	0x6003, 0x0000, 0x601e, 0x605e, 0x6062, 0x6026, 0x602a, 0x602e,
+	0x6032, 0x6036, 0x603a, 0x603e, 0x604a, 0x6046, 0x6042, 0x2061,
+	0x1800, 0x6050, 0x8000, 0x6052, 0x0005, 0x9006, 0x600e, 0x6016,
+	0x601a, 0x6012, 0x6022, 0x6002, 0x601e, 0x605e, 0x6062, 0x604a,
+	0x6046, 0x2061, 0x1800, 0x6050, 0x8000, 0x6052, 0x0005, 0x0006,
+	0x6000, 0x9086, 0x0000, 0x01d0, 0x601c, 0xd084, 0x190c, 0x18f4,
+	0x6023, 0x0007, 0x2001, 0x1955, 0x2004, 0x0006, 0x9082, 0x0051,
+	0x000e, 0x0208, 0x8004, 0x601a, 0x080c, 0xd324, 0x604b, 0x0000,
+	0x6044, 0xd0fc, 0x1129, 0x9006, 0x6046, 0x6016, 0x000e, 0x0005,
+	0x080c, 0x97a4, 0x0106, 0x190c, 0x9746, 0x2001, 0x19c9, 0x2004,
+	0x9c06, 0x1130, 0x0036, 0x2019, 0x0001, 0x080c, 0x90f0, 0x003e,
+	0x080c, 0x9336, 0x010e, 0x190c, 0x9762, 0x0005, 0x00e6, 0x0126,
+	0x2071, 0x1800, 0x2091, 0x8000, 0x7550, 0x9582, 0x0001, 0x0608,
+	0x7054, 0x2060, 0x6000, 0x9086, 0x0000, 0x0148, 0x9ce0, 0x001c,
+	0x7064, 0x9c02, 0x1208, 0x0cb0, 0x2061, 0x1ddc, 0x0c98, 0x6003,
+	0x0008, 0x8529, 0x7552, 0x9ca8, 0x001c, 0x7064, 0x9502, 0x1230,
+	0x7556, 0x9085, 0x0001, 0x012e, 0x00ee, 0x0005, 0x7057, 0x1ddc,
+	0x0cc0, 0x9006, 0x0cc0, 0x6020, 0x9084, 0x000f, 0x0002, 0x9b17,
+	0x9b21, 0x9b3c, 0x9b57, 0xbe21, 0xbe3e, 0xbe59, 0x9b17, 0x9b21,
+	0x9b17, 0x9b73, 0x9b17, 0x9b17, 0x9b17, 0x9b17, 0x9b17, 0x9186,
+	0x0013, 0x1130, 0x6044, 0xd0fc, 0x0110, 0x080c, 0x86d1, 0x0005,
+	0x0005, 0x0066, 0x6000, 0x90b2, 0x0016, 0x1a0c, 0x0d65, 0x0013,
+	0x006e, 0x0005, 0x9b3a, 0xa282, 0xa454, 0x9b3a, 0xa4e2, 0x9e3c,
+	0x9b3a, 0x9b3a, 0xa204, 0xaa87, 0x9b3a, 0x9b3a, 0x9b3a, 0x9b3a,
+	0x9b3a, 0x9b3a, 0x080c, 0x0d65, 0x0066, 0x6000, 0x90b2, 0x0016,
+	0x1a0c, 0x0d65, 0x0013, 0x006e, 0x0005, 0x9b55, 0xb092, 0x9b55,
+	0x9b55, 0x9b55, 0x9b55, 0x9b55, 0x9b55, 0xb037, 0xb215, 0x9b55,
+	0xb0cf, 0xb153, 0xb0cf, 0xb153, 0x9b55, 0x080c, 0x0d65, 0x6000,
+	0x9082, 0x0016, 0x1a0c, 0x0d65, 0x6000, 0x0002, 0x9b71, 0xaad1,
+	0xab68, 0xace8, 0xad57, 0x9b71, 0x9b71, 0x9b71, 0xaaa0, 0xafb8,
+	0xafbb, 0x9b71, 0x9b71, 0x9b71, 0x9b71, 0xafeb, 0x9b71, 0x9b71,
+	0x9b71, 0x080c, 0x0d65, 0x0066, 0x6000, 0x90b2, 0x0016, 0x1a0c,
+	0x0d65, 0x0013, 0x006e, 0x0005, 0x9b8c, 0x9b8c, 0x9bca, 0x9c69,
+	0x9ce9, 0x9b8c, 0x9b8c, 0x9b8c, 0x9b8e, 0x9b8c, 0x9b8c, 0x9b8c,
+	0x9b8c, 0x9b8c, 0x9b8c, 0x9b8c, 0x080c, 0x0d65, 0x9186, 0x004c,
+	0x0560, 0x9186, 0x0003, 0x190c, 0x0d65, 0x0096, 0x601c, 0xc0ed,
+	0x601e, 0x6003, 0x0003, 0x6106, 0x6014, 0x2048, 0xa87c, 0x9084,
+	0xa000, 0xc0b5, 0xa87e, 0xa8ac, 0xa836, 0xa8b0, 0xa83a, 0x9006,
+	0xa846, 0xa84a, 0xa884, 0x9092, 0x199a, 0x0210, 0x2001, 0x1999,
+	0x8003, 0x8013, 0x8213, 0x9210, 0x621a, 0x009e, 0x080c, 0x1a44,
+	0x2009, 0x8030, 0x080c, 0x8375, 0x0005, 0x6010, 0x00b6, 0x2058,
+	0xbca0, 0x00be, 0x2c00, 0x080c, 0x9d0b, 0x080c, 0xbdef, 0x6003,
+	0x0007, 0x0005, 0x00d6, 0x0096, 0x00f6, 0x2079, 0x1800, 0x7a8c,
+	0x6014, 0x2048, 0xa87c, 0xd0ec, 0x1110, 0x9290, 0x0018, 0xac78,
+	0xc4fc, 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, 0x9c31, 0x9c31, 0x9c2c, 0x9c2f,
+	0x9c31, 0x9c29, 0x9c1c, 0x9c1c, 0x9c1c, 0x9c1c, 0x9c1c, 0x9c1c,
+	0x9c1c, 0x9c1c, 0x9c1c, 0x9c1c, 0x00fe, 0x00ee, 0x00de, 0x00ce,
+	0x002e, 0x001e, 0x000e, 0x004e, 0x00fe, 0x009e, 0x00de, 0x080c,
+	0x0d65, 0x080c, 0xa6c3, 0x0028, 0x080c, 0xa7e6, 0x0010, 0x080c,
+	0xa8d5, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x002e, 0x001e, 0x2c00,
+	0xa896, 0x000e, 0x080c, 0x9dc9, 0x0530, 0xa804, 0xa80e, 0x00a6,
+	0x2050, 0xb100, 0x00ae, 0x8006, 0x8006, 0x8007, 0x90bc, 0x003f,
+	0x9084, 0xffc0, 0x9080, 0x0002, 0xaacc, 0xabd0, 0xacd4, 0xadd8,
+	0x2031, 0x0000, 0x2041, 0x1277, 0x080c, 0x9f73, 0x0160, 0x000e,
+	0x9005, 0x0120, 0x00fe, 0x009e, 0x00de, 0x0005, 0x00fe, 0x009e,
+	0x00de, 0x0804, 0x9a65, 0x2001, 0x002c, 0x900e, 0x080c, 0x9e2f,
+	0x0c70, 0x91b6, 0x0015, 0x0170, 0x91b6, 0x0016, 0x0158, 0x91b2,
+	0x0047, 0x0a0c, 0x0d65, 0x91b2, 0x0050, 0x1a0c, 0x0d65, 0x9182,
+	0x0047, 0x0042, 0x080c, 0x9935, 0x0120, 0x9086, 0x0002, 0x0904,
+	0x9bca, 0x0005, 0x9c8b, 0x9c8b, 0x9c8d, 0x9cbf, 0x9c8b, 0x9c8b,
+	0x9c8b, 0x9c8b, 0x9cd2, 0x080c, 0x0d65, 0x00d6, 0x0016, 0x0096,
+	0x6003, 0x0004, 0x6114, 0x2148, 0xa87c, 0xd0fc, 0x01c0, 0xa878,
+	0xc0fc, 0x9005, 0x1158, 0xa894, 0x9005, 0x0140, 0x2001, 0x0000,
+	0x900e, 0x080c, 0x9e2f, 0x080c, 0x9a65, 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,
+	0x872e, 0x00d6, 0x0096, 0x6114, 0x2148, 0x080c, 0xb6c5, 0x0120,
+	0xa87b, 0x0006, 0x080c, 0x683f, 0x009e, 0x00de, 0x080c, 0x9a65,
+	0x0804, 0x8793, 0x080c, 0x872e, 0x080c, 0x2fc1, 0x080c, 0xbdec,
+	0x00d6, 0x0096, 0x6114, 0x2148, 0x080c, 0xb6c5, 0x0120, 0xa87b,
+	0x0029, 0x080c, 0x683f, 0x009e, 0x00de, 0x080c, 0x9a65, 0x0804,
+	0x8793, 0x9182, 0x0047, 0x0002, 0x9cf9, 0x9cfb, 0x9cf9, 0x9cf9,
+	0x9cf9, 0x9cf9, 0x9cf9, 0x9cf9, 0x9cf9, 0x9cf9, 0x9cf9, 0x9cf9,
+	0x9cfb, 0x080c, 0x0d65, 0x00d6, 0x0096, 0x080c, 0x158c, 0x6114,
+	0x2148, 0xa87b, 0x0000, 0xa883, 0x0000, 0x080c, 0x683f, 0x009e,
+	0x00de, 0x0804, 0x9a65, 0x0026, 0x0036, 0x0056, 0x0066, 0x0096,
+	0x00a6, 0x00f6, 0x0006, 0x080c, 0x1023, 0x000e, 0x090c, 0x0d65,
+	0xa960, 0x21e8, 0xa95c, 0x9188, 0x0019, 0x21a0, 0x900e, 0x20a9,
+	0x0020, 0x4104, 0xa87a, 0x2079, 0x1800, 0x798c, 0x9188, 0x0018,
+	0x918c, 0x0fff, 0xa972, 0xac76, 0x2950, 0x00a6, 0x2001, 0x0205,
+	0x2003, 0x0000, 0x901e, 0x2029, 0x0001, 0x9182, 0x0034, 0x1228,
+	0x2011, 0x001f, 0x080c, 0xb298, 0x04c0, 0x2130, 0x2009, 0x0034,
+	0x2011, 0x001f, 0x080c, 0xb298, 0x96b2, 0x0034, 0xb004, 0x904d,
+	0x0110, 0x080c, 0x0fd5, 0x080c, 0x1023, 0x01d0, 0x8528, 0xa867,
+	0x0110, 0xa86b, 0x0000, 0x2920, 0xb406, 0x968a, 0x003d, 0x1230,
+	0x2608, 0x2011, 0x001b, 0x080c, 0xb298, 0x00b8, 0x96b2, 0x003c,
+	0x2009, 0x003c, 0x2950, 0x2011, 0x001b, 0x080c, 0xb298, 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, 0x683f, 0x000e, 0x2048, 0x9005,
+	0x1db0, 0x00fe, 0x00ae, 0x009e, 0x006e, 0x005e, 0x003e, 0x002e,
+	0x0005, 0x00d6, 0x00f6, 0x0096, 0x0006, 0x080c, 0x1023, 0x000e,
+	0x090c, 0x0d65, 0xa960, 0x21e8, 0xa95c, 0x9188, 0x0019, 0x21a0,
+	0x900e, 0x20a9, 0x0020, 0x4104, 0xaa66, 0xa87a, 0x2079, 0x1800,
+	0x798c, 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, 0x683f, 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, 0x1023, 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, 0x9dde, 0x0804, 0x9de0, 0x9085, 0x0001,
+	0x7817, 0x0000, 0x009e, 0x00fe, 0x00de, 0x001e, 0x0005, 0x00d6,
+	0x0036, 0x0096, 0x6314, 0x2348, 0xa87a, 0xa982, 0x080c, 0x6833,
+	0x009e, 0x003e, 0x00de, 0x0005, 0x91b6, 0x0015, 0x1118, 0x080c,
+	0x9a65, 0x0030, 0x91b6, 0x0016, 0x190c, 0x0d65, 0x080c, 0x9a65,
+	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, 0xb6c5, 0x0130,
+	0x6014, 0x2048, 0xa807, 0x0000, 0xa867, 0x0103, 0x009e, 0x0804,
+	0x9a65, 0x0096, 0x00d6, 0x0036, 0x7330, 0x9386, 0x0200, 0x11a8,
+	0x6010, 0x00b6, 0x2058, 0xb8c7, 0x0000, 0x00be, 0x6014, 0x9005,
+	0x0130, 0x2048, 0xa807, 0x0000, 0xa867, 0x0103, 0xab32, 0x080c,
+	0x9a65, 0x003e, 0x00de, 0x009e, 0x0005, 0x0011, 0x1d48, 0x0cc8,
+	0x0006, 0x0016, 0x080c, 0xbdd7, 0x0188, 0x6014, 0x9005, 0x1170,
+	0x600b, 0x0003, 0x601b, 0x0000, 0x604b, 0x0000, 0x2009, 0x0022,
+	0x080c, 0xa25a, 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, 0x9a65, 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, 0xb298,
+	0x080c, 0xb6c5, 0x0140, 0x6014, 0x2048, 0xa807, 0x0000, 0xa864,
+	0xa8e2, 0xa867, 0x0103, 0x080c, 0x9a65, 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,
+	0xb298, 0x009e, 0x080c, 0xb6c5, 0x0148, 0xa804, 0x9005, 0x1158,
+	0xa807, 0x0000, 0xa864, 0xa8e2, 0xa867, 0x0103, 0x080c, 0x9a65,
+	0x009e, 0x001e, 0x0005, 0x0086, 0x2040, 0xa030, 0x8007, 0x9086,
+	0x0100, 0x1118, 0x080c, 0xa40d, 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, 0x125d, 0x0019,
+	0x0d08, 0x008e, 0x0898, 0x0096, 0x0006, 0x080c, 0x1023, 0x000e,
+	0x01b0, 0xa8ab, 0x0dcb, 0xa876, 0x000e, 0xa8a2, 0x0006, 0xae6a,
+	0x2800, 0xa89e, 0xa97a, 0xaf72, 0xaa8e, 0xab92, 0xac96, 0xad9a,
+	0x0086, 0x2940, 0x080c, 0x1103, 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, 0x604b, 0x0000,
+	0x2c68, 0x0016, 0x2009, 0x0035, 0x080c, 0xbd4f, 0x001e, 0x1158,
+	0x622c, 0x2268, 0x2071, 0x026c, 0x6b20, 0x9386, 0x0003, 0x0130,
+	0x9386, 0x0006, 0x0128, 0x080c, 0x9a65, 0x0020, 0x0039, 0x0010,
+	0x080c, 0xa08f, 0x002e, 0x00de, 0x00ee, 0x0005, 0x0096, 0x6814,
+	0x2048, 0x9186, 0x0015, 0x0904, 0xa06e, 0x918e, 0x0016, 0x1904,
+	0xa08d, 0x700c, 0x908c, 0xff00, 0x9186, 0x1700, 0x0120, 0x9186,
+	0x0300, 0x1904, 0xa048, 0x89ff, 0x1138, 0x6800, 0x9086, 0x000f,
+	0x0904, 0xa02a, 0x0804, 0xa08b, 0x6808, 0x9086, 0xffff, 0x1904,
+	0xa070, 0xa87c, 0x9084, 0x0060, 0x9086, 0x0020, 0x1128, 0xa83c,
+	0xa940, 0x9105, 0x1904, 0xa070, 0x6824, 0xd0b4, 0x1904, 0xa070,
+	0x080c, 0xb8ad, 0x6864, 0xa882, 0xa87c, 0xc0dc, 0xc0f4, 0xc0d4,
+	0xa87e, 0x0026, 0x900e, 0x6a18, 0x2001, 0x000a, 0x080c, 0x8276,
+	0xa884, 0x920a, 0x0208, 0x8011, 0xaa86, 0x82ff, 0x002e, 0x1138,
+	0x00c6, 0x2d60, 0x080c, 0xb3eb, 0x00ce, 0x0804, 0xa08b, 0x00c6,
+	0xa868, 0xd0fc, 0x1118, 0x080c, 0x5c5c, 0x0010, 0x080c, 0x5ff1,
+	0x00ce, 0x1904, 0xa070, 0x00c6, 0x2d60, 0x080c, 0x9a65, 0x00ce,
+	0x0804, 0xa08b, 0x00c6, 0x080c, 0x9ad6, 0x0198, 0x6017, 0x0000,
+	0x6810, 0x6012, 0x080c, 0xbb52, 0x6023, 0x0003, 0x6904, 0x00c6,
+	0x2d60, 0x080c, 0x9a65, 0x00ce, 0x080c, 0x9b03, 0x00ce, 0x0804,
+	0xa08b, 0x2001, 0x1957, 0x2004, 0x684a, 0x00ce, 0x0804, 0xa08b,
+	0x7008, 0x9086, 0x000b, 0x11c8, 0x6010, 0x00b6, 0x2058, 0xb900,
+	0xc1bc, 0xb902, 0x00be, 0x00c6, 0x2d60, 0xa87b, 0x0003, 0x080c,
+	0xbd91, 0x6007, 0x0085, 0x6003, 0x000b, 0x6023, 0x0002, 0x2009,
+	0x8020, 0x080c, 0x832e, 0x00ce, 0x0430, 0x700c, 0x9086, 0x2a00,
+	0x1138, 0x2001, 0x1957, 0x2004, 0x684a, 0x00e8, 0x04c1, 0x00e8,
+	0x89ff, 0x090c, 0x0d65, 0x00c6, 0x00d6, 0x2d60, 0xa867, 0x0103,
+	0xa87b, 0x0003, 0x080c, 0x6655, 0x080c, 0xb8ad, 0x080c, 0x9a9f,
+	0x0026, 0x6010, 0x00b6, 0x2058, 0xba3c, 0x080c, 0x6291, 0x00be,
+	0x002e, 0x00de, 0x00ce, 0x080c, 0x9a65, 0x009e, 0x0005, 0x9186,
+	0x0015, 0x1128, 0x2001, 0x1957, 0x2004, 0x684a, 0x0068, 0x918e,
+	0x0016, 0x1160, 0x00c6, 0x2d00, 0x2060, 0x080c, 0xd324, 0x080c,
+	0x821d, 0x080c, 0x9a65, 0x00ce, 0x080c, 0x9a65, 0x0005, 0x0026,
+	0x0036, 0x0046, 0x7228, 0xacb0, 0xabac, 0xd2f4, 0x0130, 0x2001,
+	0x1957, 0x2004, 0x684a, 0x0804, 0xa109, 0x00c6, 0x2d60, 0x080c,
+	0xb2c3, 0x00ce, 0x6804, 0x9086, 0x0050, 0x1168, 0x00c6, 0x2d00,
+	0x2060, 0x6003, 0x0001, 0x6007, 0x0050, 0x2009, 0x8023, 0x080c,
+	0x832e, 0x00ce, 0x04f0, 0x6800, 0x9086, 0x000f, 0x01a8, 0x89ff,
+	0x090c, 0x0d65, 0x6800, 0x9086, 0x0004, 0x1190, 0xa87c, 0xd0ac,
+	0x0178, 0xa843, 0x0fff, 0xa83f, 0x0fff, 0xa880, 0xc0fc, 0xa882,
+	0x2001, 0x0001, 0x6832, 0x0400, 0x2001, 0x0007, 0x6832, 0x00e0,
+	0xa87c, 0xd0b4, 0x1150, 0xd0ac, 0x0db8, 0x6824, 0xd0f4, 0x1d48,
+	0xa838, 0xa934, 0x9105, 0x0d80, 0x0c20, 0xd2ec, 0x1d68, 0x7024,
+	0x9306, 0x1118, 0x7020, 0x9406, 0x0d38, 0x7020, 0x683e, 0x7024,
+	0x683a, 0x2001, 0x0005, 0x6832, 0x080c, 0xba3c, 0x080c, 0x8793,
+	0x0010, 0x080c, 0x9a65, 0x004e, 0x003e, 0x002e, 0x0005, 0x00e6,
+	0x00d6, 0x0026, 0x7008, 0x9084, 0x00ff, 0x6210, 0x00b6, 0x2258,
+	0xba10, 0x00be, 0x9206, 0x1904, 0xa174, 0x700c, 0x6210, 0x00b6,
+	0x2258, 0xba14, 0x00be, 0x9206, 0x1904, 0xa174, 0x6038, 0x2068,
+	0x6824, 0xc0dc, 0x6826, 0x6a20, 0x9286, 0x0007, 0x0904, 0xa174,
+	0x9286, 0x0002, 0x0904, 0xa174, 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, 0xb6c5, 0x090c, 0x0d65, 0xa87b, 0x0003, 0x009e,
+	0x080c, 0xbd91, 0x6007, 0x0085, 0x6003, 0x000b, 0x6023, 0x0002,
+	0x2009, 0x8020, 0x080c, 0x832e, 0x00ce, 0x0030, 0x6038, 0x2070,
+	0x2001, 0x1957, 0x2004, 0x704a, 0x080c, 0x9a65, 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, 0xaa5d, 0x002e,
+	0x003e, 0x015e, 0x009e, 0x1904, 0xa1e3, 0x0096, 0x0156, 0x0036,
+	0x0026, 0x2b48, 0x9e90, 0x0014, 0x2019, 0x0006, 0x20a9, 0x0004,
+	0x080c, 0xaa5d, 0x002e, 0x003e, 0x015e, 0x009e, 0x15a0, 0x7238,
+	0xba0a, 0x733c, 0xbb0e, 0xbc00, 0xc48d, 0xbc02, 0xa804, 0x9005,
+	0x1128, 0x00fe, 0x009e, 0x00be, 0x0804, 0x9e74, 0x0096, 0x2048,
+	0xaa12, 0xab16, 0xac0a, 0x009e, 0x8006, 0x8006, 0x8007, 0x90bc,
+	0x003f, 0x9084, 0xffc0, 0x9080, 0x0002, 0x2009, 0x002b, 0xaaa0,
+	0xab9c, 0xaca8, 0xada4, 0x2031, 0x0000, 0x2041, 0x125d, 0x080c,
+	0x9f73, 0x0130, 0x00fe, 0x009e, 0x080c, 0x9a65, 0x00be, 0x0005,
+	0x080c, 0xa40d, 0x0cb8, 0x2b78, 0x00f6, 0x080c, 0x2fc1, 0x080c,
+	0xbdec, 0x00fe, 0x00c6, 0x080c, 0x9a0f, 0x2f00, 0x6012, 0x6017,
+	0x0000, 0x6023, 0x0001, 0x6007, 0x0001, 0x6003, 0x0001, 0x2001,
+	0x0007, 0x080c, 0x60b7, 0x080c, 0x60e3, 0x080c, 0x8335, 0x080c,
+	0x8793, 0x00ce, 0x0804, 0xa1b6, 0x2100, 0x91b2, 0x0053, 0x1a0c,
+	0x0d65, 0x91b2, 0x0040, 0x1a04, 0xa26c, 0x0002, 0xa25a, 0xa25a,
+	0xa250, 0xa25a, 0xa25a, 0xa25a, 0xa24e, 0xa24e, 0xa24e, 0xa24e,
+	0xa24e, 0xa24e, 0xa24e, 0xa24e, 0xa24e, 0xa24e, 0xa24e, 0xa24e,
+	0xa24e, 0xa24e, 0xa24e, 0xa24e, 0xa24e, 0xa24e, 0xa24e, 0xa24e,
+	0xa24e, 0xa24e, 0xa24e, 0xa24e, 0xa24e, 0xa25a, 0xa24e, 0xa25a,
+	0xa25a, 0xa24e, 0xa24e, 0xa24e, 0xa24e, 0xa24e, 0xa250, 0xa24e,
+	0xa24e, 0xa24e, 0xa24e, 0xa24e, 0xa24e, 0xa24e, 0xa24e, 0xa24e,
+	0xa25a, 0xa25a, 0xa24e, 0xa24e, 0xa24e, 0xa24e, 0xa24e, 0xa24e,
+	0xa24e, 0xa24e, 0xa24e, 0xa25a, 0xa24e, 0xa24e, 0x080c, 0x0d65,
+	0x0066, 0x00b6, 0x6610, 0x2658, 0xb8c4, 0xc08c, 0xb8c6, 0x00be,
+	0x006e, 0x0000, 0x6003, 0x0001, 0x6106, 0x9186, 0x0032, 0x0118,
+	0x080c, 0x8335, 0x0010, 0x080c, 0x832e, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x8793, 0x012e, 0x0005, 0x2600, 0x0002, 0xa280, 0xa280,
+	0xa280, 0xa25a, 0xa25a, 0xa280, 0xa280, 0xa280, 0xa280, 0xa25a,
+	0xa280, 0xa25a, 0xa280, 0xa25a, 0xa280, 0xa280, 0xa280, 0xa280,
+	0x080c, 0x0d65, 0x6004, 0x90b2, 0x0053, 0x1a0c, 0x0d65, 0x91b6,
+	0x0013, 0x0904, 0xa357, 0x91b6, 0x0027, 0x1904, 0xa303, 0x080c,
+	0x86d1, 0x6004, 0x080c, 0xb8c2, 0x01b0, 0x080c, 0xb8d3, 0x01a8,
+	0x908e, 0x0021, 0x0904, 0xa300, 0x908e, 0x0022, 0x1130, 0x080c,
+	0x9ea0, 0x0904, 0xa2fc, 0x0804, 0xa2fd, 0x908e, 0x003d, 0x0904,
+	0xa300, 0x0804, 0xa2f6, 0x080c, 0x2ff2, 0x2001, 0x0007, 0x080c,
+	0x60b7, 0x6010, 0x00b6, 0x2058, 0xb9a0, 0x00be, 0x080c, 0xa40d,
+	0x9186, 0x007e, 0x1148, 0x2001, 0x1836, 0x2014, 0xc285, 0x080c,
+	0x6f5c, 0x1108, 0xc2ad, 0x2202, 0x080c, 0x9746, 0x0036, 0x0026,
+	0x2019, 0x0028, 0x2110, 0x080c, 0xd37f, 0x002e, 0x003e, 0x0016,
+	0x0026, 0x0036, 0x2110, 0x2019, 0x0028, 0x080c, 0x8498, 0x0076,
+	0x903e, 0x080c, 0x8387, 0x6010, 0x00b6, 0x905d, 0x0100, 0x00be,
+	0x2c08, 0x080c, 0xce23, 0x007e, 0x003e, 0x002e, 0x001e, 0x080c,
+	0x9762, 0x080c, 0xbdec, 0x0016, 0x080c, 0xbb4a, 0x080c, 0x9a65,
+	0x001e, 0x080c, 0x30d1, 0x080c, 0x8793, 0x0030, 0x080c, 0xbb4a,
+	0x080c, 0x9a65, 0x080c, 0x8793, 0x0005, 0x080c, 0xa40d, 0x0cb0,
+	0x080c, 0xa449, 0x0c98, 0x9186, 0x0015, 0x0118, 0x9186, 0x0016,
+	0x1140, 0x080c, 0x9935, 0x0d80, 0x9086, 0x0002, 0x0904, 0xa454,
+	0x0c58, 0x9186, 0x0014, 0x1d40, 0x080c, 0x86d1, 0x6004, 0x908e,
+	0x0022, 0x1118, 0x080c, 0x9ea0, 0x09f8, 0x080c, 0x2fc1, 0x080c,
+	0xbdec, 0x080c, 0xb8c2, 0x1190, 0x080c, 0x2ff2, 0x6010, 0x00b6,
+	0x2058, 0xb9a0, 0x00be, 0x080c, 0xa40d, 0x9186, 0x007e, 0x1128,
+	0x2001, 0x1836, 0x200c, 0xc185, 0x2102, 0x0800, 0x080c, 0xb8d3,
+	0x1120, 0x080c, 0xa40d, 0x0804, 0xa2f6, 0x6004, 0x908e, 0x0032,
+	0x1160, 0x00e6, 0x00f6, 0x2071, 0x1894, 0x2079, 0x0000, 0x080c,
+	0x3373, 0x00fe, 0x00ee, 0x0804, 0xa2f6, 0x6004, 0x908e, 0x0021,
+	0x0d40, 0x908e, 0x0022, 0x090c, 0xa40d, 0x0804, 0xa2f6, 0x90b2,
+	0x0040, 0x1a04, 0xa3f6, 0x2008, 0x0002, 0xa39f, 0xa3a0, 0xa3a3,
+	0xa3a6, 0xa3a9, 0xa3ac, 0xa39d, 0xa39d, 0xa39d, 0xa39d, 0xa39d,
+	0xa39d, 0xa39d, 0xa39d, 0xa39d, 0xa39d, 0xa39d, 0xa39d, 0xa39d,
+	0xa39d, 0xa39d, 0xa39d, 0xa39d, 0xa39d, 0xa39d, 0xa39d, 0xa39d,
+	0xa39d, 0xa39d, 0xa39d, 0xa3af, 0xa3b8, 0xa39d, 0xa3b9, 0xa3b8,
+	0xa39d, 0xa39d, 0xa39d, 0xa39d, 0xa39d, 0xa3b8, 0xa3b8, 0xa39d,
+	0xa39d, 0xa39d, 0xa39d, 0xa39d, 0xa39d, 0xa39d, 0xa39d, 0xa3e1,
+	0xa3b8, 0xa39d, 0xa3b4, 0xa39d, 0xa39d, 0xa39d, 0xa3b5, 0xa39d,
+	0xa39d, 0xa39d, 0xa3b8, 0xa3dc, 0xa39d, 0x080c, 0x0d65, 0x00c0,
+	0x2001, 0x000b, 0x00e8, 0x2001, 0x0003, 0x00d0, 0x2001, 0x0005,
+	0x00b8, 0x2001, 0x0001, 0x00a0, 0x2001, 0x0009, 0x0088, 0x6003,
+	0x0005, 0x080c, 0x8793, 0x0058, 0x0018, 0x0010, 0x080c, 0x60b7,
+	0x04b8, 0x080c, 0xbdef, 0x6003, 0x0004, 0x080c, 0x8793, 0x0005,
+	0x080c, 0x60b7, 0x6003, 0x0002, 0x0036, 0x2019, 0x185e, 0x2304,
+	0x9084, 0xff00, 0x1120, 0x2001, 0x1955, 0x201c, 0x0040, 0x8007,
+	0x909a, 0x0004, 0x0ec0, 0x8003, 0x801b, 0x831b, 0x9318, 0x631a,
+	0x003e, 0x080c, 0x8793, 0x0c18, 0x080c, 0xbb4a, 0x080c, 0x9a65,
+	0x08f0, 0x00e6, 0x00f6, 0x2071, 0x1894, 0x2079, 0x0000, 0x080c,
+	0x3373, 0x00fe, 0x00ee, 0x080c, 0x86d1, 0x080c, 0x9a65, 0x0878,
+	0x6003, 0x0002, 0x080c, 0xbdef, 0x0804, 0x8793, 0x2600, 0x2008,
+	0x0002, 0xa40b, 0xa40b, 0xa40b, 0xa3f0, 0xa3f0, 0xa40b, 0xa40b,
+	0xa40b, 0xa40b, 0xa3f0, 0xa40b, 0xa3f0, 0xa40b, 0xa3f0, 0xa40b,
+	0xa40b, 0xa40b, 0xa40b, 0x080c, 0x0d65, 0x00e6, 0x0096, 0x0026,
+	0x0016, 0x080c, 0xb6c5, 0x0568, 0x6014, 0x2048, 0xa864, 0x9086,
+	0x0139, 0x11a8, 0xa894, 0x9086, 0x0056, 0x1148, 0x080c, 0x503e,
+	0x0130, 0x2001, 0x0000, 0x900e, 0x2011, 0x4000, 0x0028, 0x2001,
+	0x0030, 0x900e, 0x2011, 0x4005, 0x080c, 0xbcb6, 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, 0x0d65, 0x6604, 0x96b6,
+	0x004d, 0x1120, 0x080c, 0xbbd6, 0x0804, 0xa4d1, 0x6604, 0x96b6,
+	0x0043, 0x1120, 0x080c, 0xbc1f, 0x0804, 0xa4d1, 0x6604, 0x96b6,
+	0x004b, 0x1120, 0x080c, 0xbc4b, 0x0804, 0xa4d1, 0x6604, 0x96b6,
+	0x0033, 0x1120, 0x080c, 0xbb6c, 0x0804, 0xa4d1, 0x6604, 0x96b6,
+	0x0028, 0x1120, 0x080c, 0xb90c, 0x0804, 0xa4d1, 0x6604, 0x96b6,
+	0x0029, 0x1120, 0x080c, 0xb94d, 0x0804, 0xa4d1, 0x6604, 0x96b6,
+	0x001f, 0x1118, 0x080c, 0x9e49, 0x04e0, 0x6604, 0x96b6, 0x0000,
+	0x1118, 0x080c, 0xa17a, 0x04a8, 0x6604, 0x96b6, 0x0022, 0x1118,
+	0x080c, 0x9e81, 0x0470, 0x6604, 0x96b6, 0x0035, 0x1118, 0x080c,
+	0x9f91, 0x0438, 0x6604, 0x96b6, 0x0039, 0x1118, 0x080c, 0xa10f,
+	0x0400, 0x6604, 0x96b6, 0x003d, 0x1118, 0x080c, 0x9eb9, 0x00c8,
+	0x6604, 0x96b6, 0x0044, 0x1118, 0x080c, 0x9ef5, 0x0090, 0x6604,
+	0x96b6, 0x0049, 0x1118, 0x080c, 0x9f20, 0x0058, 0x91b6, 0x0015,
+	0x1110, 0x0063, 0x0030, 0x91b6, 0x0016, 0x1128, 0x00be, 0x0804,
+	0xa78f, 0x00be, 0x0005, 0x080c, 0x9b20, 0x0cd8, 0xa4ee, 0xa4f1,
+	0xa4ee, 0xa535, 0xa4ee, 0xa6c3, 0xa79c, 0xa4ee, 0xa4ee, 0xa769,
+	0xa4ee, 0xa77d, 0x0096, 0x080c, 0x158c, 0x6014, 0x2048, 0xa800,
+	0x2048, 0xa867, 0x0103, 0x009e, 0x0804, 0x9a65, 0xa001, 0xa001,
+	0x0005, 0x00e6, 0x2071, 0x1800, 0x708c, 0x9086, 0x0074, 0x1540,
+	0x080c, 0xcdf4, 0x11b0, 0x6010, 0x00b6, 0x2058, 0x7030, 0xd08c,
+	0x0128, 0xb800, 0xd0bc, 0x0110, 0xc0c5, 0xb802, 0x00e9, 0x00be,
+	0x2001, 0x0006, 0x080c, 0x60b7, 0x080c, 0x2ff2, 0x080c, 0x9a65,
+	0x0088, 0x2001, 0x000a, 0x080c, 0x60b7, 0x080c, 0x2ff2, 0x6003,
+	0x0001, 0x6007, 0x0001, 0x080c, 0x8335, 0x080c, 0x8793, 0x0010,
+	0x080c, 0xa6ae, 0x00ee, 0x0005, 0x00d6, 0xb800, 0xd084, 0x0158,
+	0x9006, 0x080c, 0x60a3, 0x2069, 0x1853, 0x6804, 0x0020, 0x2001,
+	0x0006, 0x080c, 0x60e3, 0x00de, 0x0005, 0x00b6, 0x0096, 0x00d6,
+	0x2011, 0x1823, 0x2204, 0x9086, 0x0074, 0x1904, 0xa687, 0x6010,
+	0x2058, 0xbaa0, 0x9286, 0x007e, 0x1120, 0x080c, 0xa8e0, 0x0804,
+	0xa5ec, 0x00d6, 0x080c, 0x6f5c, 0x0198, 0x0026, 0x2011, 0x0010,
+	0x080c, 0x6581, 0x002e, 0x05c8, 0x080c, 0x52b1, 0x1540, 0x6014,
+	0x2048, 0xa807, 0x0000, 0xa867, 0x0103, 0xa833, 0xdead, 0x00f8,
+	0x0026, 0x2011, 0x8008, 0x080c, 0x6581, 0x002e, 0x0530, 0x6014,
+	0x2048, 0xa864, 0x9084, 0x00ff, 0x9086, 0x0039, 0x1140, 0x2001,
+	0x0030, 0x900e, 0x2011, 0x4009, 0x080c, 0xbcb6, 0x0040, 0x6014,
+	0x2048, 0xa807, 0x0000, 0xa867, 0x0103, 0xa833, 0xdead, 0x6010,
+	0x2058, 0xb9a0, 0x0016, 0x080c, 0x2ff2, 0x080c, 0x9a65, 0x001e,
+	0x080c, 0x30d1, 0x00de, 0x0804, 0xa688, 0x00de, 0x080c, 0xa8d5,
+	0x6010, 0x2058, 0xbaa0, 0x9286, 0x0080, 0x1510, 0x6014, 0x9005,
+	0x01a8, 0x2048, 0xa864, 0x9084, 0x00ff, 0x9086, 0x0039, 0x1140,
+	0x2001, 0x0000, 0x900e, 0x2011, 0x4000, 0x080c, 0xbcb6, 0x0030,
+	0xa807, 0x0000, 0xa867, 0x0103, 0xa833, 0x0200, 0x2001, 0x0006,
+	0x080c, 0x60b7, 0x080c, 0x2ff2, 0x080c, 0x9a65, 0x0804, 0xa688,
+	0x080c, 0xa696, 0x6014, 0x9005, 0x0190, 0x2048, 0xa868, 0xd0f4,
+	0x01e8, 0xa864, 0x9084, 0x00ff, 0x9086, 0x0039, 0x1d08, 0x2001,
+	0x0000, 0x900e, 0x2011, 0x4000, 0x080c, 0xbcb6, 0x08f8, 0x080c,
+	0xa68c, 0x0160, 0x9006, 0x080c, 0x60a3, 0x2001, 0x0004, 0x080c,
+	0x60e3, 0x2001, 0x0007, 0x080c, 0x60b7, 0x08a0, 0x2001, 0x0004,
+	0x080c, 0x60b7, 0x6003, 0x0001, 0x6007, 0x0003, 0x080c, 0x8335,
+	0x080c, 0x8793, 0x0804, 0xa688, 0xb85c, 0xd0e4, 0x01d0, 0x080c,
+	0xbae4, 0x080c, 0x6f5c, 0x0118, 0xd0dc, 0x1904, 0xa5ae, 0x2011,
+	0x1836, 0x2204, 0xc0ad, 0x2012, 0x2001, 0x0002, 0x00f6, 0x2079,
+	0x0100, 0x78e3, 0x0000, 0x080c, 0x2463, 0x78e2, 0x00fe, 0x0804,
+	0xa5ae, 0x080c, 0xbb25, 0x2011, 0x1836, 0x2204, 0xc0a5, 0x2012,
+	0x0006, 0x080c, 0xcf59, 0x000e, 0x1904, 0xa5ae, 0xc0b5, 0x2012,
+	0x2001, 0x0006, 0x080c, 0x60b7, 0x9006, 0x080c, 0x60a3, 0x00c6,
+	0x2001, 0x180f, 0x2004, 0xd09c, 0x0520, 0x00f6, 0x2079, 0x0100,
+	0x00e6, 0x2071, 0x1800, 0x700c, 0x9084, 0x00ff, 0x78e6, 0x707a,
+	0x7010, 0x78ea, 0x707e, 0x908c, 0x00ff, 0x00ee, 0x780c, 0xc0b5,
+	0x780e, 0x00fe, 0x080c, 0x2438, 0x00f6, 0x2100, 0x900e, 0x080c,
+	0x23ef, 0x795a, 0x00fe, 0x9186, 0x0081, 0x01d8, 0x2009, 0x0081,
+	0x00c8, 0x2009, 0x00ef, 0x00f6, 0x2079, 0x0100, 0x79ea, 0x7932,
+	0x7936, 0x780c, 0xc0b5, 0x780e, 0x00fe, 0x080c, 0x2438, 0x00f6,
+	0x2079, 0x1800, 0x797e, 0x2100, 0x900e, 0x080c, 0x23ef, 0x795a,
+	0x00fe, 0x8108, 0x080c, 0x6106, 0x2b00, 0x00ce, 0x1904, 0xa5ae,
+	0x6012, 0x2009, 0x180f, 0x210c, 0xd19c, 0x0150, 0x2009, 0x027c,
+	0x210c, 0x918c, 0x00ff, 0xb912, 0x2009, 0x027d, 0x210c, 0xb916,
+	0x2001, 0x0002, 0x080c, 0x60b7, 0x6023, 0x0001, 0x6003, 0x0001,
+	0x6007, 0x0002, 0x080c, 0x8335, 0x080c, 0x8793, 0x0008, 0x0431,
+	0x00de, 0x009e, 0x00be, 0x0005, 0x2001, 0x1810, 0x2004, 0xd0a4,
+	0x0120, 0x2001, 0x1854, 0x2004, 0xd0ac, 0x0005, 0x00e6, 0x080c,
+	0xd3d8, 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, 0x60b7, 0x080c, 0x52b1, 0x1120, 0x2001, 0x0007,
+	0x080c, 0x60e3, 0x080c, 0x2ff2, 0x6020, 0x9086, 0x000a, 0x1108,
+	0x0005, 0x0804, 0x9a65, 0x00b6, 0x00e6, 0x0026, 0x0016, 0x2071,
+	0x1800, 0x708c, 0x9086, 0x0014, 0x1904, 0xa760, 0x00d6, 0x080c,
+	0x6f5c, 0x0198, 0x0026, 0x2011, 0x0010, 0x080c, 0x6581, 0x002e,
+	0x05c8, 0x080c, 0x52b1, 0x1540, 0x6014, 0x2048, 0xa807, 0x0000,
+	0xa867, 0x0103, 0xa833, 0xdead, 0x00f8, 0x0026, 0x2011, 0x8008,
+	0x080c, 0x6581, 0x002e, 0x0530, 0x6014, 0x2048, 0xa864, 0x9084,
+	0x00ff, 0x9086, 0x0039, 0x1140, 0x2001, 0x0030, 0x900e, 0x2011,
+	0x4009, 0x080c, 0xbcb6, 0x0040, 0x6014, 0x2048, 0xa807, 0x0000,
+	0xa867, 0x0103, 0xa833, 0xdead, 0x6010, 0x2058, 0xb9a0, 0x0016,
+	0x080c, 0x2ff2, 0x080c, 0x9a65, 0x001e, 0x080c, 0x30d1, 0x00de,
+	0x0804, 0xa764, 0x00de, 0x080c, 0x52b1, 0x1170, 0x6014, 0x9005,
+	0x1158, 0x0036, 0x0046, 0x6010, 0x2058, 0xbba0, 0x2021, 0x0006,
+	0x080c, 0x4998, 0x004e, 0x003e, 0x00d6, 0x6010, 0x2058, 0x080c,
+	0x6201, 0x080c, 0xa524, 0x00de, 0x080c, 0xa9a6, 0x1588, 0x6010,
+	0x2058, 0xb890, 0x9005, 0x0560, 0x2001, 0x0006, 0x080c, 0x60b7,
+	0x0096, 0x6014, 0x904d, 0x01d0, 0xa864, 0x9084, 0x00ff, 0x9086,
+	0x0039, 0x1140, 0x2001, 0x0000, 0x900e, 0x2011, 0x4000, 0x080c,
+	0xbcb6, 0x0060, 0xa864, 0x9084, 0x00ff, 0x9086, 0x0029, 0x0130,
+	0xa807, 0x0000, 0xa867, 0x0103, 0xa833, 0x0200, 0x009e, 0x080c,
+	0x2ff2, 0x6020, 0x9086, 0x000a, 0x0138, 0x080c, 0x9a65, 0x0020,
+	0x080c, 0xa40d, 0x080c, 0xa6ae, 0x001e, 0x002e, 0x00ee, 0x00be,
+	0x0005, 0x2011, 0x1823, 0x2204, 0x9086, 0x0014, 0x1160, 0x2001,
+	0x0002, 0x080c, 0x60b7, 0x6003, 0x0001, 0x6007, 0x0001, 0x080c,
+	0x8335, 0x0804, 0x8793, 0x0804, 0xa6ae, 0x2030, 0x2011, 0x1823,
+	0x2204, 0x9086, 0x0004, 0x1148, 0x96b6, 0x000b, 0x1120, 0x2001,
+	0x0007, 0x080c, 0x60b7, 0x0804, 0x9a65, 0x0804, 0xa6ae, 0x0002,
+	0xa4ee, 0xa7a7, 0xa4ee, 0xa7e6, 0xa4ee, 0xa891, 0xa79c, 0xa4ee,
+	0xa4ee, 0xa8a4, 0xa4ee, 0xa8b4, 0x6604, 0x9686, 0x0003, 0x0904,
+	0xa6c3, 0x96b6, 0x001e, 0x1110, 0x080c, 0x9a65, 0x0005, 0x00b6,
+	0x00d6, 0x00c6, 0x080c, 0xa8c4, 0x11a0, 0x9006, 0x080c, 0x60a3,
+	0x080c, 0x2fc1, 0x080c, 0xbdec, 0x2001, 0x0002, 0x080c, 0x60b7,
+	0x6003, 0x0001, 0x6007, 0x0002, 0x080c, 0x8335, 0x080c, 0x8793,
+	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, 0x2fc1, 0x080c, 0xbdec,
+	0x080c, 0xa6ae, 0x00ce, 0x00de, 0x00be, 0x0005, 0x0096, 0x00b6,
+	0x0026, 0x9016, 0x080c, 0xa8d2, 0x00d6, 0x2069, 0x194d, 0x2d04,
+	0x9005, 0x0168, 0x6010, 0x2058, 0xb8a0, 0x9086, 0x007e, 0x1138,
+	0x2069, 0x181f, 0x2d04, 0x8000, 0x206a, 0x00de, 0x0010, 0x00de,
+	0x0088, 0x9006, 0x080c, 0x60a3, 0x2001, 0x0002, 0x080c, 0x60b7,
+	0x6003, 0x0001, 0x6007, 0x0002, 0x080c, 0x8335, 0x080c, 0x8793,
+	0x0804, 0xa861, 0x080c, 0xb6c5, 0x01b0, 0x6014, 0x2048, 0xa864,
+	0x2010, 0x9086, 0x0139, 0x1138, 0x6007, 0x0016, 0x2001, 0x0002,
+	0x080c, 0xbd10, 0x00b0, 0x6014, 0x2048, 0xa864, 0xd0fc, 0x0118,
+	0x2001, 0x0001, 0x0ca8, 0x2001, 0x180e, 0x2004, 0xd0dc, 0x0148,
+	0x6010, 0x2058, 0xb840, 0x9084, 0x00ff, 0x9005, 0x1110, 0x9006,
+	0x0c38, 0x080c, 0xa40d, 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,
+	0x60b7, 0x2001, 0x0028, 0x601a, 0x6007, 0x0052, 0x0010, 0x080c,
+	0xa6ae, 0x002e, 0x00be, 0x009e, 0x0005, 0x9286, 0x0139, 0x0160,
+	0x6014, 0x2048, 0x080c, 0xb6c5, 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, 0x5b75, 0x00ee, 0x0010, 0x080c, 0x2fc1,
+	0x0870, 0x080c, 0xa8d2, 0x1160, 0x2001, 0x0004, 0x080c, 0x60b7,
+	0x6003, 0x0001, 0x6007, 0x0003, 0x080c, 0x8335, 0x0804, 0x8793,
+	0x080c, 0xa40d, 0x0804, 0xa6ae, 0x0469, 0x1160, 0x2001, 0x0008,
+	0x080c, 0x60b7, 0x6003, 0x0001, 0x6007, 0x0005, 0x080c, 0x8335,
+	0x0804, 0x8793, 0x0804, 0xa6ae, 0x00e9, 0x1160, 0x2001, 0x000a,
+	0x080c, 0x60b7, 0x6003, 0x0001, 0x6007, 0x0001, 0x080c, 0x8335,
+	0x0804, 0x8793, 0x0804, 0xa6ae, 0x2009, 0x026e, 0x2104, 0x9086,
+	0x0003, 0x1138, 0x2009, 0x026f, 0x2104, 0x9084, 0xff00, 0x9086,
+	0x2a00, 0x0005, 0x9085, 0x0001, 0x0005, 0x00b6, 0x00c6, 0x0016,
+	0x6110, 0x2158, 0x080c, 0x6175, 0x001e, 0x00ce, 0x00be, 0x0005,
+	0x00b6, 0x00f6, 0x00e6, 0x00d6, 0x0036, 0x0016, 0x6010, 0x2058,
+	0x2009, 0x1836, 0x2104, 0x9085, 0x0003, 0x200a, 0x080c, 0xa978,
+	0x0560, 0x2009, 0x1836, 0x2104, 0xc0cd, 0x200a, 0x080c, 0x6559,
+	0x0158, 0x9006, 0x2020, 0x2009, 0x002a, 0x080c, 0xd0ce, 0x2001,
+	0x180c, 0x200c, 0xc195, 0x2102, 0x2019, 0x002a, 0x2009, 0x0001,
+	0x080c, 0x2f80, 0x00e6, 0x2071, 0x1800, 0x080c, 0x2d99, 0x00ee,
+	0x00c6, 0x0156, 0x20a9, 0x0781, 0x2009, 0x007f, 0x080c, 0x30d1,
+	0x8108, 0x1f04, 0xa916, 0x015e, 0x00ce, 0x080c, 0xa8d5, 0x2071,
+	0x0260, 0x2079, 0x0200, 0x7817, 0x0001, 0x2001, 0x1836, 0x200c,
+	0xc1c5, 0x7018, 0xd0fc, 0x0110, 0xd0dc, 0x0118, 0x7038, 0xd0dc,
+	0x1108, 0xc1c4, 0x7817, 0x0000, 0x2001, 0x1836, 0x2102, 0x2079,
+	0x0100, 0x2e04, 0x9084, 0x00ff, 0x2069, 0x181e, 0x206a, 0x78e6,
+	0x0006, 0x8e70, 0x2e04, 0x2069, 0x181f, 0x206a, 0x78ea, 0x7832,
+	0x7836, 0x2010, 0x9084, 0xff00, 0x001e, 0x9105, 0x2009, 0x182b,
+	0x200a, 0x2200, 0x9084, 0x00ff, 0x2008, 0x080c, 0x2438, 0x080c,
+	0x6f5c, 0x0170, 0x2071, 0x0260, 0x2069, 0x1951, 0x7048, 0x206a,
+	0x704c, 0x6806, 0x7050, 0x680a, 0x7054, 0x680e, 0x080c, 0xbae4,
+	0x0040, 0x2001, 0x0006, 0x080c, 0x60b7, 0x080c, 0x2ff2, 0x080c,
+	0x9a65, 0x001e, 0x003e, 0x00de, 0x00ee, 0x00fe, 0x00be, 0x0005,
+	0x0096, 0x0026, 0x0036, 0x00e6, 0x0156, 0x2019, 0x182b, 0x231c,
+	0x83ff, 0x01f0, 0x2071, 0x0260, 0x7200, 0x9294, 0x00ff, 0x7004,
+	0x9084, 0xff00, 0x9205, 0x9306, 0x1198, 0x2011, 0x0276, 0x20a9,
+	0x0004, 0x2b48, 0x2019, 0x000a, 0x080c, 0xaa5d, 0x1148, 0x2011,
+	0x027a, 0x20a9, 0x0004, 0x2019, 0x0006, 0x080c, 0xaa5d, 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,
+	0x19c2, 0x252c, 0x2021, 0x19c9, 0x2424, 0x2061, 0x1ddc, 0x2071,
+	0x1800, 0x7250, 0x7070, 0x9202, 0x1a04, 0xaa35, 0x080c, 0xd0fa,
+	0x0904, 0xaa2e, 0x6720, 0x9786, 0x0007, 0x0904, 0xaa2e, 0x2500,
+	0x9c06, 0x0904, 0xaa2e, 0x2400, 0x9c06, 0x0904, 0xaa2e, 0x3e08,
+	0x9186, 0x0002, 0x1148, 0x6010, 0x9005, 0x0130, 0x00b6, 0x2058,
+	0xb800, 0x00be, 0xd0bc, 0x1590, 0x00c6, 0x6043, 0xffff, 0x6000,
+	0x9086, 0x0004, 0x1110, 0x080c, 0x18f4, 0x9786, 0x000a, 0x0148,
+	0x080c, 0xb8d3, 0x1130, 0x00ce, 0x080c, 0xa40d, 0x080c, 0x9a9f,
+	0x00e8, 0x6014, 0x2048, 0x080c, 0xb6c5, 0x01a8, 0x9786, 0x0003,
+	0x1530, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0xa87c, 0xd0cc,
+	0x0130, 0x0096, 0xa878, 0x2048, 0x080c, 0x0fd5, 0x009e, 0x080c,
+	0x6833, 0x080c, 0xb8ad, 0x080c, 0x9a9f, 0x00ce, 0x9ce0, 0x001c,
+	0x7064, 0x9c02, 0x1210, 0x0804, 0xa9d9, 0x012e, 0x000e, 0x002e,
+	0x004e, 0x005e, 0x007e, 0x00ce, 0x009e, 0x00ee, 0x0005, 0x9786,
+	0x0006, 0x1118, 0x080c, 0xd079, 0x0c30, 0x9786, 0x000a, 0x0998,
+	0x0880, 0x220c, 0x2304, 0x9106, 0x1130, 0x8210, 0x8318, 0x1f04,
+	0xaa49, 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, 0x0d65, 0x080c, 0xb8c2, 0x0120, 0x080c,
+	0xb8d3, 0x0158, 0x0028, 0x080c, 0x2ff2, 0x080c, 0xb8d3, 0x0128,
+	0x080c, 0x86d1, 0x080c, 0x9a65, 0x0005, 0x080c, 0xa40d, 0x0cc0,
+	0x9182, 0x0057, 0x1220, 0x9182, 0x0040, 0x0208, 0x000a, 0x0005,
+	0xaabf, 0xaabf, 0xaabf, 0xaabf, 0xaabf, 0xaabf, 0xaabf, 0xaabf,
+	0xaabf, 0xaabf, 0xaabf, 0xaac1, 0xaac1, 0xaac1, 0xaac1, 0xaabf,
+	0xaabf, 0xaabf, 0xaac1, 0xaabf, 0xaabf, 0xaabf, 0xaabf, 0x080c,
+	0x0d65, 0x600b, 0xffff, 0x6003, 0x000f, 0x6106, 0x0126, 0x2091,
+	0x8000, 0x080c, 0xbdef, 0x2009, 0x8000, 0x080c, 0x832e, 0x012e,
+	0x0005, 0x9186, 0x0013, 0x1128, 0x6004, 0x9082, 0x0040, 0x0804,
+	0xab46, 0x9186, 0x0027, 0x1520, 0x080c, 0x86d1, 0x080c, 0x2fc1,
+	0x080c, 0xbdec, 0x0096, 0x6114, 0x2148, 0x080c, 0xb6c5, 0x0198,
+	0x080c, 0xb8d3, 0x1118, 0x080c, 0xa40d, 0x0068, 0xa867, 0x0103,
+	0xa87b, 0x0029, 0xa877, 0x0000, 0xa97c, 0xc1c5, 0xa97e, 0x080c,
+	0x683f, 0x080c, 0xb8ad, 0x009e, 0x080c, 0x9a65, 0x0804, 0x8793,
+	0x9186, 0x0014, 0x1120, 0x6004, 0x9082, 0x0040, 0x0018, 0x080c,
+	0x0d65, 0x0005, 0x0002, 0xab24, 0xab22, 0xab22, 0xab22, 0xab22,
+	0xab22, 0xab22, 0xab22, 0xab22, 0xab22, 0xab22, 0xab3d, 0xab3d,
+	0xab3d, 0xab3d, 0xab22, 0xab3d, 0xab22, 0xab3d, 0xab22, 0xab22,
+	0xab22, 0xab22, 0x080c, 0x0d65, 0x080c, 0x86d1, 0x0096, 0x6114,
+	0x2148, 0x080c, 0xb6c5, 0x0168, 0xa867, 0x0103, 0xa87b, 0x0006,
+	0xa877, 0x0000, 0xa880, 0xc0ec, 0xa882, 0x080c, 0x683f, 0x080c,
+	0xb8ad, 0x009e, 0x080c, 0x9a65, 0x0005, 0x080c, 0x86d1, 0x080c,
+	0xb8d3, 0x090c, 0xa40d, 0x080c, 0x9a65, 0x0005, 0x0002, 0xab60,
+	0xab5e, 0xab5e, 0xab5e, 0xab5e, 0xab5e, 0xab5e, 0xab5e, 0xab5e,
+	0xab5e, 0xab5e, 0xab62, 0xab62, 0xab62, 0xab62, 0xab5e, 0xab64,
+	0xab5e, 0xab62, 0xab5e, 0xab5e, 0xab5e, 0xab5e, 0x080c, 0x0d65,
+	0x080c, 0x0d65, 0x080c, 0x0d65, 0x080c, 0x9a65, 0x0804, 0x8793,
+	0x9182, 0x0057, 0x1220, 0x9182, 0x0040, 0x0208, 0x000a, 0x0005,
+	0xab87, 0xab87, 0xab87, 0xab87, 0xab87, 0xabc0, 0xacaf, 0xab87,
+	0xacbb, 0xab87, 0xab87, 0xab87, 0xab87, 0xab87, 0xab87, 0xab87,
+	0xab87, 0xab87, 0xab87, 0xacbb, 0xab89, 0xab87, 0xacb9, 0x080c,
+	0x0d65, 0x00b6, 0x0096, 0x6114, 0x2148, 0x6010, 0x2058, 0xb800,
+	0xd0bc, 0x1508, 0xa87b, 0x0000, 0xa867, 0x0103, 0xa877, 0x0000,
+	0xa87c, 0xd0ac, 0x0128, 0xa834, 0xa938, 0x9115, 0x190c, 0xad40,
+	0x080c, 0x6655, 0x6210, 0x2258, 0xba3c, 0x82ff, 0x0110, 0x8211,
+	0xba3e, 0xb8c0, 0x9005, 0x0110, 0x080c, 0x6291, 0x080c, 0x9a65,
+	0x009e, 0x00be, 0x0005, 0xa87c, 0xd0ac, 0x09e0, 0xa838, 0xa934,
+	0x9105, 0x09c0, 0xa880, 0xd0bc, 0x19a8, 0x080c, 0xba03, 0x0c80,
+	0x00b6, 0x0096, 0x6114, 0x2148, 0x601c, 0xd0fc, 0x1110, 0x7644,
+	0x0008, 0x9036, 0x96b4, 0x0fff, 0x86ff, 0x1590, 0x6010, 0x2058,
+	0xb800, 0xd0bc, 0x1904, 0xac9e, 0xa87b, 0x0000, 0xa867, 0x0103,
+	0xae76, 0xa87c, 0xd0ac, 0x0128, 0xa834, 0xa938, 0x9115, 0x190c,
+	0xad40, 0x080c, 0x6655, 0x6210, 0x2258, 0xba3c, 0x82ff, 0x0110,
+	0x8211, 0xba3e, 0xb8c0, 0x9005, 0x0110, 0x080c, 0x6291, 0x601c,
+	0xd0fc, 0x1148, 0x7044, 0xd0e4, 0x1904, 0xac82, 0x080c, 0x9a65,
+	0x009e, 0x00be, 0x0005, 0x2009, 0x0211, 0x210c, 0x080c, 0x0d65,
+	0x968c, 0x0c00, 0x0150, 0x6010, 0x2058, 0xb800, 0xd0bc, 0x1904,
+	0xac86, 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, 0xabcc, 0x735c, 0xab86, 0x83ff, 0x0170,
+	0x938a, 0x0009, 0x0210, 0x2019, 0x0008, 0x0036, 0x2308, 0x2019,
+	0x0018, 0x2011, 0x0025, 0x080c, 0xb298, 0x003e, 0xd6cc, 0x0904,
+	0xabe1, 0x7154, 0xa98a, 0x81ff, 0x0904, 0xabe1, 0x9192, 0x0021,
+	0x1278, 0x8304, 0x9098, 0x0018, 0x2011, 0x0029, 0x080c, 0xb298,
+	0x2011, 0x0205, 0x2013, 0x0000, 0x080c, 0xbd7c, 0x0804, 0xabe1,
+	0xa868, 0xd0fc, 0x0120, 0x2009, 0x0020, 0xa98a, 0x0c50, 0x00a6,
+	0x2950, 0x080c, 0xb237, 0x00ae, 0x080c, 0xbd7c, 0x080c, 0xb288,
+	0x0804, 0xabe3, 0x080c, 0xb9c6, 0x0804, 0xabf8, 0xa87c, 0xd0ac,
+	0x0904, 0xac09, 0xa880, 0xd0bc, 0x1904, 0xac09, 0x7348, 0xa838,
+	0x9306, 0x11c8, 0x734c, 0xa834, 0x931e, 0x0904, 0xac09, 0xd6d4,
+	0x0190, 0xab38, 0x9305, 0x0904, 0xac09, 0x0068, 0xa87c, 0xd0ac,
+	0x0904, 0xabd4, 0xa838, 0xa934, 0x9105, 0x0904, 0xabd4, 0xa880,
+	0xd0bc, 0x1904, 0xabd4, 0x080c, 0xba03, 0x0804, 0xabf8, 0x00f6,
+	0x2079, 0x026c, 0x7c04, 0x7b00, 0x7e0c, 0x7d08, 0x00fe, 0x0021,
+	0x0005, 0x0011, 0x0005, 0x0005, 0x0096, 0x6003, 0x0002, 0x6007,
+	0x0043, 0x6014, 0x2048, 0xa87c, 0xd0ac, 0x0128, 0x009e, 0x0005,
+	0x2130, 0x2228, 0x0058, 0x2400, 0xa9ac, 0x910a, 0x2300, 0xaab0,
+	0x9213, 0x2600, 0x9102, 0x2500, 0x9203, 0x0e90, 0xac46, 0xab4a,
+	0xae36, 0xad3a, 0x6044, 0xd0fc, 0x190c, 0x976f, 0x604b, 0x0000,
+	0x080c, 0x1aa5, 0x1118, 0x6144, 0x080c, 0x835a, 0x009e, 0x0005,
+	0x9182, 0x0057, 0x1220, 0x9182, 0x0040, 0x0208, 0x000a, 0x0005,
+	0xad07, 0xad07, 0xad07, 0xad07, 0xad07, 0xad07, 0xad07, 0xad07,
+	0xad07, 0xad07, 0xad09, 0xad07, 0xad07, 0xad07, 0xad07, 0xad1a,
+	0xad07, 0xad07, 0xad07, 0xad07, 0xad3e, 0xad07, 0xad07, 0x080c,
+	0x0d65, 0x6004, 0x9086, 0x0040, 0x1110, 0x080c, 0x86d1, 0x2019,
+	0x0001, 0x080c, 0x90f0, 0x6003, 0x0002, 0x080c, 0xbdf4, 0x080c,
+	0x872e, 0x0005, 0x6004, 0x9086, 0x0040, 0x1110, 0x080c, 0x86d1,
+	0x2019, 0x0001, 0x080c, 0x90f0, 0x080c, 0x872e, 0x080c, 0x2fc1,
+	0x080c, 0xbdec, 0x0096, 0x6114, 0x2148, 0x080c, 0xb6c5, 0x0150,
+	0xa867, 0x0103, 0xa87b, 0x0029, 0xa877, 0x0000, 0x080c, 0x683f,
+	0x080c, 0xb8ad, 0x009e, 0x080c, 0x9a65, 0x0005, 0x080c, 0x0d65,
+	0xa87b, 0x0015, 0xd1fc, 0x0180, 0xa87b, 0x0007, 0x8002, 0x8000,
+	0x810a, 0x9189, 0x0000, 0x0006, 0x0016, 0x2009, 0x1a46, 0x2104,
+	0x8000, 0x200a, 0x001e, 0x000e, 0xa992, 0xa88e, 0x0005, 0x9182,
+	0x0057, 0x1220, 0x9182, 0x0040, 0x0208, 0x000a, 0x0005, 0xad76,
+	0xad76, 0xad76, 0xad76, 0xad76, 0xad78, 0xad76, 0xad76, 0xae35,
+	0xad76, 0xad76, 0xad76, 0xad76, 0xad76, 0xad76, 0xad76, 0xad76,
+	0xad76, 0xad76, 0xaf79, 0xad76, 0xaf83, 0xad76, 0x080c, 0x0d65,
+	0x601c, 0xd0bc, 0x0178, 0xd084, 0x0168, 0xd0f4, 0x0120, 0xc084,
+	0x601e, 0x0804, 0xab68, 0x6114, 0x0096, 0x2148, 0xa87c, 0xc0e5,
+	0xa87e, 0x009e, 0x0076, 0x00a6, 0x00e6, 0x0096, 0x2071, 0x0260,
+	0x6114, 0x2150, 0x601c, 0xd0fc, 0x1110, 0x7644, 0x0008, 0x9036,
+	0xb676, 0x96b4, 0x0fff, 0xb77c, 0xc7e5, 0xb77e, 0x6210, 0x00b6,
+	0x2258, 0xba3c, 0x82ff, 0x0110, 0x8211, 0xba3e, 0x00be, 0x86ff,
+	0x0904, 0xae2e, 0x9694, 0xff00, 0x9284, 0x0c00, 0x0120, 0x7048,
+	0xb092, 0x704c, 0xb08e, 0x9284, 0x0300, 0x0904, 0xae2e, 0x9686,
+	0x0100, 0x1130, 0x7064, 0x9005, 0x1118, 0xc6c4, 0xb676, 0x0c38,
+	0x080c, 0x1023, 0x090c, 0x0d65, 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, 0xb298, 0x003e, 0xd6cc,
+	0x01e8, 0x7154, 0xa98a, 0x81ff, 0x01c8, 0x9192, 0x0021, 0x1260,
+	0x8304, 0x9098, 0x0018, 0x2011, 0x0029, 0x080c, 0xb298, 0x2011,
+	0x0205, 0x2013, 0x0000, 0x0050, 0xb068, 0xd0fc, 0x0120, 0x2009,
+	0x0020, 0xa98a, 0x0c68, 0x2950, 0x080c, 0xb237, 0x080c, 0x18d2,
+	0x009e, 0x00ee, 0x00ae, 0x007e, 0x0005, 0x2001, 0x1957, 0x2004,
+	0x604a, 0x0096, 0x6114, 0x2148, 0xa83c, 0xa940, 0x9105, 0x1118,
+	0xa87c, 0xc0dc, 0xa87e, 0x6003, 0x0002, 0x080c, 0xbdfd, 0x0904,
+	0xaf74, 0x604b, 0x0000, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be,
+	0xd0bc, 0x1500, 0xd1cc, 0x0904, 0xaf33, 0xa978, 0xa868, 0xd0fc,
+	0x0904, 0xaef4, 0x0016, 0xa87c, 0x0006, 0xa880, 0x0006, 0x00a6,
+	0x2150, 0xb174, 0x9184, 0x00ff, 0x90b6, 0x0002, 0x0904, 0xaec2,
+	0x9086, 0x0028, 0x1904, 0xaeae, 0xa87b, 0x001c, 0xb07b, 0x001c,
+	0x0804, 0xaeca, 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, 0x601c, 0xc0fc,
+	0x601e, 0x9006, 0xa876, 0xa892, 0xa88e, 0xa87c, 0xc0e4, 0xa87e,
+	0xd0cc, 0x0140, 0xc0cc, 0xa87e, 0x0096, 0xa878, 0x2048, 0x080c,
+	0x0fd5, 0x009e, 0x080c, 0xba03, 0x0804, 0xaf74, 0xd1dc, 0x0158,
+	0xa87b, 0x0015, 0xb07b, 0x0015, 0x080c, 0xbc9f, 0x0118, 0xb174,
+	0xc1dc, 0xb176, 0x0078, 0xd1d4, 0x0128, 0xa87b, 0x0007, 0xb07b,
+	0x0007, 0x0040, 0xa87c, 0xd0ac, 0x0128, 0xa834, 0xa938, 0x9115,
+	0x190c, 0xad40, 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, 0xbd7c, 0x001e, 0xa874, 0x0006, 0x2148, 0x080c,
+	0x0fd5, 0x001e, 0x0804, 0xaf60, 0x0016, 0x00a6, 0x2150, 0xb174,
+	0x9184, 0x00ff, 0x90b6, 0x0002, 0x01e0, 0x9086, 0x0028, 0x1128,
+	0xa87b, 0x001c, 0xb07b, 0x001c, 0x00e0, 0xd1dc, 0x0158, 0xa87b,
+	0x0015, 0xb07b, 0x0015, 0x080c, 0xbc9f, 0x0118, 0xb174, 0xc1dc,
+	0xb176, 0x0078, 0xd1d4, 0x0128, 0xa87b, 0x0007, 0xb07b, 0x0007,
+	0x0040, 0xa87c, 0xd0ac, 0x0128, 0xa834, 0xa938, 0x9115, 0x190c,
+	0xad40, 0xa890, 0xb092, 0xa88c, 0xb08e, 0xa87c, 0xb07e, 0x00ae,
+	0x080c, 0x0fd5, 0x009e, 0x080c, 0xbd7c, 0xa974, 0x0016, 0x080c,
+	0xb288, 0x001e, 0x0468, 0xa867, 0x0103, 0xa974, 0x9184, 0x00ff,
+	0x90b6, 0x0002, 0x01b0, 0x9086, 0x0028, 0x1118, 0xa87b, 0x001c,
+	0x00d0, 0xd1dc, 0x0148, 0xa87b, 0x0015, 0x080c, 0xbc9f, 0x0118,
+	0xa974, 0xc1dc, 0xa976, 0x0078, 0xd1d4, 0x0118, 0xa87b, 0x0007,
+	0x0050, 0xa87b, 0x0000, 0xa87c, 0xd0ac, 0x0128, 0xa834, 0xa938,
+	0x9115, 0x190c, 0xad40, 0xa974, 0x0016, 0x080c, 0x6655, 0x001e,
+	0x6010, 0x00b6, 0x2058, 0xba3c, 0x82ff, 0x0110, 0x8211, 0xba3e,
+	0xb8c0, 0x9005, 0x0120, 0x0016, 0x080c, 0x6291, 0x001e, 0x00be,
+	0xd1e4, 0x1120, 0x080c, 0x9a65, 0x009e, 0x0005, 0x080c, 0xb9c6,
+	0x0cd8, 0x6114, 0x0096, 0x2148, 0xa97c, 0x080c, 0xbdfd, 0x190c,
+	0x18e0, 0x009e, 0x0005, 0x0096, 0x6114, 0x2148, 0xa83c, 0xa940,
+	0x9105, 0x01e8, 0xa877, 0x0000, 0xa87b, 0x0000, 0xa867, 0x0103,
+	0x00b6, 0x6010, 0x2058, 0xa834, 0xa938, 0x9115, 0x11a0, 0x080c,
+	0x6655, 0xba3c, 0x8211, 0x0208, 0xba3e, 0xb8c0, 0x9005, 0x0110,
+	0x080c, 0x6291, 0x080c, 0x9a65, 0x00be, 0x009e, 0x0005, 0xa87c,
+	0xc0dc, 0xa87e, 0x08f8, 0xb800, 0xd0bc, 0x1120, 0xa834, 0x080c,
+	0xad40, 0x0c28, 0xa880, 0xd0bc, 0x1dc8, 0x080c, 0xba03, 0x0c60,
+	0x080c, 0x86d1, 0x0010, 0x080c, 0x872e, 0x601c, 0xd084, 0x0110,
+	0x080c, 0x18f4, 0x080c, 0xb6c5, 0x01f0, 0x0096, 0x6114, 0x2148,
+	0x080c, 0xb8d3, 0x1118, 0x080c, 0xa40d, 0x00a0, 0xa867, 0x0103,
+	0x2009, 0x180c, 0x210c, 0xd18c, 0x1198, 0xd184, 0x1170, 0x6108,
+	0xa97a, 0x918e, 0x0029, 0x1110, 0x080c, 0xd370, 0xa877, 0x0000,
+	0x080c, 0x683f, 0x009e, 0x0804, 0x9a9f, 0xa87b, 0x0004, 0x0cb0,
+	0xa87b, 0x0004, 0x0c98, 0x9182, 0x0057, 0x1220, 0x9182, 0x0040,
+	0x0208, 0x000a, 0x0005, 0xb00a, 0xb00a, 0xb00a, 0xb00a, 0xb00a,
+	0xb00c, 0xb00a, 0xb00a, 0xb00a, 0xb00a, 0xb00a, 0xb00a, 0xb00a,
+	0xb00a, 0xb00a, 0xb00a, 0xb00a, 0xb00a, 0xb00a, 0xb00a, 0xb030,
+	0xb00a, 0xb00a, 0x080c, 0x0d65, 0x080c, 0x52a5, 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, 0x683f, 0x009e, 0x0804, 0x9a65,
+	0x080c, 0x52a5, 0x0dd8, 0x6014, 0x900e, 0x9016, 0x0c10, 0x9182,
+	0x0085, 0x0002, 0xb049, 0xb047, 0xb047, 0xb055, 0xb047, 0xb047,
+	0xb047, 0xb047, 0xb047, 0xb047, 0xb047, 0xb047, 0xb047, 0x080c,
+	0x0d65, 0x6003, 0x0001, 0x6106, 0x0126, 0x2091, 0x8000, 0x2009,
+	0x8020, 0x080c, 0x832e, 0x012e, 0x0005, 0x0026, 0x0056, 0x00d6,
+	0x00e6, 0x2071, 0x0260, 0x7224, 0x6216, 0x7220, 0x080c, 0xb6b3,
+	0x01a0, 0x2268, 0x6800, 0x9086, 0x0000, 0x0178, 0x6010, 0x6d10,
+	0x952e, 0x1158, 0x00c6, 0x2d60, 0x080c, 0xb2c3, 0x00ce, 0x0128,
+	0x6803, 0x0002, 0x6007, 0x0086, 0x0010, 0x6007, 0x0087, 0x6003,
+	0x0001, 0x2009, 0x8020, 0x080c, 0x832e, 0x9280, 0x0004, 0x00b6,
+	0x2058, 0xb800, 0x00be, 0xd0bc, 0x0140, 0x6824, 0xd0ec, 0x0128,
+	0x00c6, 0x2260, 0x080c, 0xba03, 0x00ce, 0x00ee, 0x00de, 0x005e,
+	0x002e, 0x0005, 0x9186, 0x0013, 0x1160, 0x6004, 0x908a, 0x0085,
+	0x0a0c, 0x0d65, 0x908a, 0x0092, 0x1a0c, 0x0d65, 0x9082, 0x0085,
+	0x00e2, 0x9186, 0x0027, 0x0120, 0x9186, 0x0014, 0x190c, 0x0d65,
+	0x080c, 0x86d1, 0x0096, 0x6014, 0x2048, 0x080c, 0xb6c5, 0x0140,
+	0xa867, 0x0103, 0xa877, 0x0000, 0xa87b, 0x0029, 0x080c, 0x683f,
+	0x009e, 0x080c, 0x9a9f, 0x0804, 0x8793, 0xb0ca, 0xb0cc, 0xb0cc,
+	0xb0ca, 0xb0ca, 0xb0ca, 0xb0ca, 0xb0ca, 0xb0ca, 0xb0ca, 0xb0ca,
+	0xb0ca, 0xb0ca, 0x080c, 0x0d65, 0x080c, 0x9a9f, 0x0005, 0x9186,
+	0x0013, 0x1130, 0x6004, 0x9082, 0x0085, 0x2008, 0x0804, 0xb11b,
+	0x9186, 0x0027, 0x1558, 0x080c, 0x86d1, 0x080c, 0x2fc1, 0x080c,
+	0xbdec, 0x0096, 0x6014, 0x2048, 0x080c, 0xb6c5, 0x0150, 0xa867,
+	0x0103, 0xa877, 0x0000, 0xa87b, 0x0029, 0x080c, 0x683f, 0x080c,
+	0xb8ad, 0x009e, 0x080c, 0x9a65, 0x0005, 0x9186, 0x0089, 0x0118,
+	0x9186, 0x008a, 0x1140, 0x080c, 0x9935, 0x0128, 0x9086, 0x000c,
+	0x0904, 0xb153, 0x0000, 0x080c, 0x9b20, 0x0c70, 0x9186, 0x0014,
+	0x1d60, 0x080c, 0x86d1, 0x0096, 0x6014, 0x2048, 0x080c, 0xb6c5,
+	0x0d00, 0xa867, 0x0103, 0xa877, 0x0000, 0xa87b, 0x0006, 0xa880,
+	0xc0ec, 0xa882, 0x0890, 0x0002, 0xb12b, 0xb129, 0xb129, 0xb129,
+	0xb129, 0xb129, 0xb13f, 0xb129, 0xb129, 0xb129, 0xb129, 0xb129,
+	0xb129, 0x080c, 0x0d65, 0x6034, 0x908c, 0xff00, 0x810f, 0x9186,
+	0x0039, 0x0118, 0x9186, 0x0035, 0x1118, 0x2001, 0x1955, 0x0010,
+	0x2001, 0x1956, 0x2004, 0x601a, 0x6003, 0x000c, 0x0005, 0x6034,
+	0x908c, 0xff00, 0x810f, 0x9186, 0x0039, 0x0118, 0x9186, 0x0035,
+	0x1118, 0x2001, 0x1955, 0x0010, 0x2001, 0x1956, 0x2004, 0x601a,
+	0x6003, 0x000e, 0x0005, 0x9182, 0x0092, 0x1220, 0x9182, 0x0085,
+	0x0208, 0x0012, 0x0804, 0x9b20, 0xb169, 0xb169, 0xb169, 0xb169,
+	0xb16b, 0xb1b8, 0xb169, 0xb169, 0xb169, 0xb169, 0xb169, 0xb169,
+	0xb169, 0x080c, 0x0d65, 0x0096, 0x6010, 0x00b6, 0x2058, 0xb800,
+	0x00be, 0xd0bc, 0x0168, 0x6034, 0x908c, 0xff00, 0x810f, 0x9186,
+	0x0039, 0x0118, 0x9186, 0x0035, 0x1118, 0x009e, 0x0804, 0xb1cc,
+	0x080c, 0xb6c5, 0x1118, 0x080c, 0xb8ad, 0x0068, 0x6014, 0x2048,
+	0x080c, 0xbe03, 0x1110, 0x080c, 0xb8ad, 0xa867, 0x0103, 0x080c,
+	0xbdb7, 0x080c, 0x683f, 0x00d6, 0x2c68, 0x080c, 0x9a0f, 0x01d0,
+	0x6003, 0x0001, 0x6007, 0x001e, 0x600b, 0xffff, 0x2009, 0x026e,
+	0x210c, 0x613a, 0x2009, 0x026f, 0x210c, 0x613e, 0x6910, 0x6112,
+	0x080c, 0xbb52, 0x695c, 0x615e, 0x6023, 0x0001, 0x2009, 0x8020,
+	0x080c, 0x832e, 0x2d60, 0x00de, 0x080c, 0x9a65, 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, 0xbd4f,
+	0x11f0, 0x080c, 0x9a0f, 0x01d8, 0x6106, 0x6003, 0x0001, 0x6023,
+	0x0001, 0x6910, 0x6112, 0x692c, 0x612e, 0x6930, 0x6132, 0x6934,
+	0x918c, 0x00ff, 0x6136, 0x6938, 0x613a, 0x693c, 0x613e, 0x695c,
+	0x615e, 0x080c, 0xbb52, 0x2009, 0x8020, 0x080c, 0x832e, 0x2d60,
+	0x00de, 0x0804, 0x9a65, 0x0096, 0x6014, 0x2048, 0x080c, 0xb6c5,
+	0x01c8, 0xa867, 0x0103, 0xa880, 0xd0b4, 0x0128, 0xc0ec, 0xa882,
+	0xa87b, 0x0006, 0x0048, 0xd0bc, 0x0118, 0xa87b, 0x0002, 0x0020,
+	0xa87b, 0x0005, 0x080c, 0xb9c2, 0xa877, 0x0000, 0x080c, 0x683f,
+	0x080c, 0xb8ad, 0x009e, 0x0804, 0x9a65, 0x0016, 0x0096, 0x6014,
+	0x2048, 0x080c, 0xb6c5, 0x0140, 0xa867, 0x0103, 0xa87b, 0x0028,
+	0xa877, 0x0000, 0x080c, 0x683f, 0x009e, 0x001e, 0x9186, 0x0013,
+	0x0158, 0x9186, 0x0014, 0x0130, 0x9186, 0x0027, 0x0118, 0x080c,
+	0x9b20, 0x0020, 0x080c, 0x86d1, 0x080c, 0x9a9f, 0x0005, 0x0056,
+	0x0066, 0x0096, 0x00a6, 0x2029, 0x0001, 0x9182, 0x0101, 0x1208,
+	0x0010, 0x2009, 0x0100, 0x2130, 0x8304, 0x9098, 0x0018, 0x2009,
+	0x0020, 0x2011, 0x0029, 0x080c, 0xb298, 0x96b2, 0x0020, 0xb004,
+	0x904d, 0x0110, 0x080c, 0x0fd5, 0x080c, 0x1023, 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, 0x683f, 0x2a48, 0x0cb8, 0x080c, 0x683f, 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, 0xb315, 0xb315, 0xb310,
+	0xb339, 0xb2ed, 0xb310, 0xb2ef, 0xb310, 0xb2ed, 0xb2ed, 0xb310,
+	0xb310, 0xb310, 0xb2ed, 0xb2ed, 0xb2ed, 0x080c, 0x0d65, 0x6010,
+	0x9080, 0x0000, 0x2004, 0xd0bc, 0x190c, 0xb339, 0x0036, 0x6014,
+	0x0096, 0x2048, 0xa880, 0x009e, 0xd0cc, 0x0118, 0x2019, 0x000c,
+	0x0038, 0xd094, 0x0118, 0x2019, 0x000d, 0x0010, 0x2019, 0x0010,
+	0x080c, 0xcc56, 0x6023, 0x0006, 0x6003, 0x0007, 0x003e, 0x0005,
+	0x9006, 0x0005, 0x9085, 0x0001, 0x0005, 0x0096, 0x86ff, 0x11e8,
+	0x6014, 0x2048, 0x080c, 0xb6c5, 0x01d0, 0x6043, 0xffff, 0xa864,
+	0x9086, 0x0139, 0x1128, 0xa87b, 0x0005, 0xa883, 0x0000, 0x0028,
+	0x900e, 0x2001, 0x0005, 0x080c, 0x6a5c, 0x080c, 0xb9c2, 0x080c,
+	0x6833, 0x080c, 0x9a9f, 0x9085, 0x0001, 0x009e, 0x0005, 0x9006,
+	0x0ce0, 0x080c, 0x9746, 0x080c, 0xbe11, 0x6000, 0x908a, 0x0016,
+	0x1a0c, 0x0d65, 0x002b, 0x0106, 0x080c, 0x9762, 0x010e, 0x0005,
+	0xb358, 0xb386, 0xb35a, 0xb3ad, 0xb381, 0xb358, 0xb310, 0xb315,
+	0xb315, 0xb310, 0xb310, 0xb310, 0xb310, 0xb310, 0xb310, 0xb310,
+	0x080c, 0x0d65, 0x86ff, 0x1510, 0x6020, 0x9086, 0x0006, 0x01f0,
+	0x0096, 0x6014, 0x2048, 0x080c, 0xb6c5, 0x0158, 0xa87c, 0xd0cc,
+	0x0130, 0x0096, 0xa878, 0x2048, 0x080c, 0x0fd5, 0x009e, 0x080c,
+	0xb9c2, 0x009e, 0x080c, 0xbd91, 0x6007, 0x0085, 0x6003, 0x000b,
+	0x6023, 0x0002, 0x2009, 0x8020, 0x080c, 0x8310, 0x9085, 0x0001,
+	0x0005, 0x0066, 0x080c, 0x18f4, 0x006e, 0x08a0, 0x00e6, 0x2071,
+	0x19b6, 0x7030, 0x9c06, 0x1120, 0x080c, 0x9070, 0x00ee, 0x0850,
+	0x6020, 0x9084, 0x000f, 0x9086, 0x0006, 0x1150, 0x0086, 0x0096,
+	0x2049, 0x0001, 0x2c40, 0x080c, 0x9200, 0x009e, 0x008e, 0x0040,
+	0x0066, 0x080c, 0x8f6c, 0x190c, 0x0d65, 0x080c, 0x8f7a, 0x006e,
+	0x00ee, 0x1904, 0xb35a, 0x0804, 0xb310, 0x0036, 0x00e6, 0x2071,
+	0x19b6, 0x704c, 0x9c06, 0x1138, 0x901e, 0x080c, 0x90f0, 0x00ee,
+	0x003e, 0x0804, 0xb35a, 0x080c, 0x9336, 0x00ee, 0x003e, 0x1904,
+	0xb35a, 0x0804, 0xb310, 0x00c6, 0x0066, 0x6020, 0x9084, 0x000f,
+	0x001b, 0x006e, 0x00ce, 0x0005, 0xb3e3, 0xb4a5, 0xb60c, 0xb3eb,
+	0x9a9f, 0xb3e3, 0xcc48, 0xbdf9, 0xb4a5, 0xb3dc, 0xb68b, 0xb3dc,
+	0xb3dc, 0xb3dc, 0xb3dc, 0xb3dc, 0x080c, 0x0d65, 0x080c, 0xb8d3,
+	0x1110, 0x080c, 0xa40d, 0x0005, 0x080c, 0x86d1, 0x0804, 0x9a65,
+	0x601b, 0x0001, 0x0005, 0x080c, 0xb6c5, 0x0130, 0x6014, 0x0096,
+	0x2048, 0x2c00, 0xa896, 0x009e, 0x080c, 0x9746, 0x080c, 0xbe11,
+	0x6000, 0x908a, 0x0016, 0x1a0c, 0x0d65, 0x0013, 0x0804, 0x9762,
+	0xb410, 0xb412, 0xb43c, 0xb450, 0xb47b, 0xb410, 0xb3e3, 0xb3e3,
+	0xb3e3, 0xb457, 0xb457, 0xb410, 0xb410, 0xb410, 0xb410, 0xb461,
+	0x080c, 0x0d65, 0x00e6, 0x6014, 0x0096, 0x2048, 0xa880, 0xc0b5,
+	0xa882, 0x009e, 0x2071, 0x19b6, 0x7030, 0x9c06, 0x01d0, 0x0066,
+	0x080c, 0x8f6c, 0x190c, 0x0d65, 0x080c, 0x8f7a, 0x006e, 0x080c,
+	0xbd91, 0x6007, 0x0085, 0x6003, 0x000b, 0x6023, 0x0002, 0x2001,
+	0x1956, 0x2004, 0x601a, 0x2009, 0x8020, 0x080c, 0x8310, 0x00ee,
+	0x0005, 0x601b, 0x0001, 0x0cd8, 0x0096, 0x6014, 0x2048, 0xa880,
+	0xc0b5, 0xa882, 0x009e, 0x080c, 0xbd91, 0x6007, 0x0085, 0x6003,
+	0x000b, 0x6023, 0x0002, 0x2009, 0x8020, 0x080c, 0x8310, 0x0005,
+	0x080c, 0x9746, 0x080c, 0x98b7, 0x080c, 0x9762, 0x0c28, 0x0096,
+	0x601b, 0x0001, 0x6014, 0x2048, 0xa880, 0xc0b5, 0xa882, 0x009e,
+	0x0005, 0x080c, 0x52a5, 0x01a8, 0x6014, 0x0096, 0x904d, 0x0180,
+	0xa864, 0xa867, 0x0103, 0xa87b, 0x0006, 0x9086, 0x0139, 0x1140,
+	0xa867, 0x0139, 0xa897, 0x4005, 0xa89b, 0x0004, 0x080c, 0x683f,
+	0x009e, 0x0804, 0x9a65, 0x6014, 0x0096, 0x904d, 0x0508, 0x080c,
+	0xbdfd, 0x01f0, 0x080c, 0x9762, 0x2001, 0x180f, 0x2004, 0xd0c4,
+	0x0110, 0x009e, 0x0005, 0xa884, 0x009e, 0x8003, 0x800b, 0x810b,
+	0x9108, 0x611a, 0x2001, 0x0037, 0x2c08, 0x080c, 0x1595, 0x6000,
+	0x9086, 0x0004, 0x1120, 0x2009, 0x0048, 0x080c, 0x9b03, 0x0005,
+	0x009e, 0x080c, 0x18f4, 0x0804, 0xb43c, 0x6000, 0x908a, 0x0016,
+	0x1a0c, 0x0d65, 0x000b, 0x0005, 0xb4bc, 0xb3e8, 0xb4be, 0xb4bc,
+	0xb4be, 0xb4be, 0xb3e4, 0xb4bc, 0xb3de, 0xb3de, 0xb4bc, 0xb4bc,
+	0xb4bc, 0xb4bc, 0xb4bc, 0xb4bc, 0x080c, 0x0d65, 0x6010, 0x00b6,
+	0x2058, 0xb804, 0x9084, 0x00ff, 0x00be, 0x908a, 0x000c, 0x1a0c,
+	0x0d65, 0x00b6, 0x0013, 0x00be, 0x0005, 0xb4d9, 0xb5a6, 0xb4db,
+	0xb51b, 0xb4db, 0xb51b, 0xb4db, 0xb4e9, 0xb4d9, 0xb51b, 0xb4d9,
+	0xb50a, 0x080c, 0x0d65, 0x6004, 0x908e, 0x0016, 0x05c0, 0x908e,
+	0x0004, 0x05a8, 0x908e, 0x0002, 0x0590, 0x908e, 0x0052, 0x0904,
+	0xb5a2, 0x6004, 0x080c, 0xb8d3, 0x0904, 0xb5bf, 0x908e, 0x0004,
+	0x1110, 0x080c, 0x2ff2, 0x908e, 0x0021, 0x0904, 0xb5c3, 0x908e,
+	0x0022, 0x0904, 0xb607, 0x908e, 0x003d, 0x0904, 0xb5c3, 0x908e,
+	0x0039, 0x0904, 0xb5c7, 0x908e, 0x0035, 0x0904, 0xb5c7, 0x908e,
+	0x001e, 0x0178, 0x908e, 0x0001, 0x1140, 0x6010, 0x2058, 0xb804,
+	0x9084, 0x00ff, 0x9086, 0x0006, 0x0110, 0x080c, 0x2fc1, 0x080c,
+	0xa40d, 0x0804, 0x9a9f, 0x00c6, 0x00d6, 0x6104, 0x9186, 0x0016,
+	0x0904, 0xb593, 0x9186, 0x0002, 0x1904, 0xb568, 0x2001, 0x1836,
+	0x2004, 0xd08c, 0x11c8, 0x080c, 0x6f5c, 0x11b0, 0x080c, 0xbdd7,
+	0x0138, 0x080c, 0x6f7f, 0x1120, 0x080c, 0x6e67, 0x0804, 0xb5f0,
+	0x2001, 0x194e, 0x2003, 0x0001, 0x2001, 0x1800, 0x2003, 0x0001,
+	0x080c, 0x6e8d, 0x0804, 0xb5f0, 0x6010, 0x2058, 0x2001, 0x1836,
+	0x2004, 0xd0ac, 0x1904, 0xb5f0, 0xb8a0, 0x9084, 0xff80, 0x1904,
+	0xb5f0, 0xb840, 0x9084, 0x00ff, 0x9005, 0x0190, 0x8001, 0xb842,
+	0x6017, 0x0000, 0x6023, 0x0007, 0x601b, 0x0398, 0x604b, 0x0000,
+	0x080c, 0x9a0f, 0x0128, 0x2b00, 0x6012, 0x6023, 0x0001, 0x0458,
+	0x00de, 0x00ce, 0x6004, 0x908e, 0x0002, 0x11a0, 0x6010, 0x2058,
+	0xb8a0, 0x9086, 0x007e, 0x1170, 0x2009, 0x1836, 0x2104, 0xc085,
+	0x200a, 0x00e6, 0x2071, 0x1800, 0x080c, 0x5b75, 0x00ee, 0x080c,
+	0xa40d, 0x0030, 0x080c, 0xa40d, 0x080c, 0x2fc1, 0x080c, 0xbdec,
+	0x00e6, 0x0126, 0x2091, 0x8000, 0x080c, 0x2ff2, 0x012e, 0x00ee,
+	0x080c, 0x9a9f, 0x0005, 0x2001, 0x0002, 0x080c, 0x60b7, 0x6003,
+	0x0001, 0x6007, 0x0002, 0x080c, 0x8335, 0x080c, 0x8793, 0x00de,
+	0x00ce, 0x0c80, 0x080c, 0x2ff2, 0x0804, 0xb517, 0x00c6, 0x00d6,
+	0x6104, 0x9186, 0x0016, 0x0d38, 0x6010, 0x2058, 0xb840, 0x9084,
+	0x00ff, 0x9005, 0x0904, 0xb568, 0x8001, 0xb842, 0x6003, 0x0001,
+	0x080c, 0x8335, 0x080c, 0x8793, 0x00de, 0x00ce, 0x0898, 0x080c,
+	0xa40d, 0x0804, 0xb519, 0x080c, 0xa449, 0x0804, 0xb519, 0x00d6,
+	0x2c68, 0x6104, 0x080c, 0xbd4f, 0x00de, 0x0118, 0x080c, 0x9a65,
+	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, 0x2009, 0x8020, 0x080c, 0x832e, 0x0005,
+	0x00de, 0x00ce, 0x080c, 0xa40d, 0x080c, 0x2fc1, 0x00e6, 0x0126,
+	0x2091, 0x8000, 0x080c, 0x2ff2, 0x6017, 0x0000, 0x6023, 0x0007,
+	0x601b, 0x0398, 0x604b, 0x0000, 0x012e, 0x00ee, 0x0005, 0x080c,
+	0x9ea0, 0x1904, 0xb5bf, 0x0005, 0x6000, 0x908a, 0x0016, 0x1a0c,
+	0x0d65, 0x0096, 0x00d6, 0x001b, 0x00de, 0x009e, 0x0005, 0xb627,
+	0xb627, 0xb627, 0xb627, 0xb627, 0xb627, 0xb627, 0xb627, 0xb627,
+	0xb3e3, 0xb627, 0xb3e8, 0xb629, 0xb3e8, 0xb636, 0xb627, 0x080c,
+	0x0d65, 0x6004, 0x9086, 0x008b, 0x0148, 0x6007, 0x008b, 0x6003,
+	0x000d, 0x2009, 0x8020, 0x080c, 0x832e, 0x0005, 0x080c, 0xbdcb,
+	0x0118, 0x080c, 0xbdde, 0x0010, 0x080c, 0xbdec, 0x080c, 0xb8ad,
+	0x080c, 0xb6c5, 0x0570, 0x080c, 0x2fc1, 0x080c, 0xb6c5, 0x0168,
+	0x6014, 0x2048, 0xa867, 0x0103, 0xa87b, 0x0006, 0xa877, 0x0000,
+	0xa880, 0xc0ed, 0xa882, 0x080c, 0x683f, 0x2c68, 0x080c, 0x9a0f,
+	0x0150, 0x6810, 0x6012, 0x080c, 0xbb52, 0x00c6, 0x2d60, 0x080c,
+	0x9a9f, 0x00ce, 0x0008, 0x2d60, 0x6017, 0x0000, 0x6023, 0x0001,
+	0x6007, 0x0001, 0x6003, 0x0001, 0x080c, 0x8335, 0x080c, 0x8793,
+	0x00c8, 0x080c, 0xbdcb, 0x0138, 0x6034, 0x9086, 0x4000, 0x1118,
+	0x080c, 0x2fc1, 0x08d0, 0x6034, 0x908c, 0xff00, 0x810f, 0x9186,
+	0x0039, 0x0118, 0x9186, 0x0035, 0x1118, 0x080c, 0x2fc1, 0x0868,
+	0x080c, 0x9a9f, 0x0005, 0x6000, 0x908a, 0x0016, 0x1a0c, 0x0d65,
+	0x0002, 0xb6a1, 0xb6a1, 0xb6a3, 0xb6a3, 0xb6a3, 0xb6a1, 0xb6a1,
+	0x9a9f, 0xb6a1, 0xb6a1, 0xb6a1, 0xb6a1, 0xb6a1, 0xb6a1, 0xb6a1,
+	0xb6a1, 0x080c, 0x0d65, 0x080c, 0x9746, 0x080c, 0x98b7, 0x080c,
+	0x9762, 0x6114, 0x0096, 0x2148, 0xa87b, 0x0006, 0x080c, 0x683f,
+	0x009e, 0x0804, 0x9a65, 0x9284, 0x0003, 0x1158, 0x9282, 0x1ddc,
+	0x0240, 0x2001, 0x1819, 0x2004, 0x9202, 0x1218, 0x9085, 0x0001,
+	0x0005, 0x9006, 0x0ce8, 0x0096, 0x0028, 0x0096, 0x0006, 0x6014,
+	0x2048, 0x000e, 0x0006, 0x9984, 0xf000, 0x9086, 0xf000, 0x0110,
+	0x080c, 0x10ce, 0x000e, 0x009e, 0x0005, 0x00e6, 0x00c6, 0x0036,
+	0x0006, 0x0126, 0x2091, 0x8000, 0x2061, 0x1ddc, 0x2071, 0x1800,
+	0x7350, 0x7070, 0x9302, 0x1640, 0x6020, 0x9206, 0x11f8, 0x080c,
+	0xbdd7, 0x0180, 0x9286, 0x0001, 0x1168, 0x6004, 0x9086, 0x0004,
+	0x1148, 0x080c, 0x2fc1, 0x080c, 0xbdec, 0x00c6, 0x080c, 0x9a9f,
+	0x00ce, 0x0060, 0x080c, 0xbac4, 0x0148, 0x080c, 0xb8d3, 0x1110,
+	0x080c, 0xa40d, 0x00c6, 0x080c, 0x9a65, 0x00ce, 0x9ce0, 0x001c,
+	0x7064, 0x9c02, 0x1208, 0x08a0, 0x012e, 0x000e, 0x003e, 0x00ce,
+	0x00ee, 0x0005, 0x00e6, 0x00c6, 0x0016, 0x9188, 0x1000, 0x210c,
+	0x81ff, 0x0128, 0x2061, 0x1b00, 0x6112, 0x080c, 0x2fc1, 0x9006,
+	0x0010, 0x9085, 0x0001, 0x001e, 0x00ce, 0x00ee, 0x0005, 0x00c6,
+	0x0126, 0x2091, 0x8000, 0x080c, 0x9a0f, 0x01d8, 0x080c, 0x52a5,
+	0x0110, 0x662e, 0x0008, 0x6616, 0x2b00, 0x6012, 0x080c, 0x52a5,
+	0x0118, 0x080c, 0xb7ef, 0x0168, 0x080c, 0xbb52, 0x6023, 0x0003,
+	0x2009, 0x004b, 0x080c, 0x9b03, 0x9085, 0x0001, 0x012e, 0x00ce,
+	0x0005, 0x9006, 0x0cd8, 0x00c6, 0x0126, 0x2091, 0x8000, 0xbaa0,
+	0x080c, 0x9ad6, 0x05b0, 0x080c, 0x52a5, 0x0118, 0x602f, 0x0000,
+	0x0010, 0x6017, 0x0000, 0x2b00, 0x6012, 0x080c, 0xbb52, 0x6023,
+	0x0003, 0x0016, 0x080c, 0x9746, 0x080c, 0x8498, 0x0076, 0x903e,
+	0x080c, 0x8387, 0x2c08, 0x080c, 0xce23, 0x007e, 0x080c, 0x9762,
+	0x001e, 0xd184, 0x0128, 0x080c, 0x9a65, 0x9085, 0x0001, 0x0070,
+	0x080c, 0x52a5, 0x0128, 0xd18c, 0x1170, 0x080c, 0xb7ef, 0x0148,
+	0x2009, 0x004c, 0x080c, 0x9b03, 0x9085, 0x0001, 0x012e, 0x00ce,
+	0x0005, 0x9006, 0x0cd8, 0x2900, 0x6016, 0x0c90, 0x2009, 0x004d,
+	0x0010, 0x2009, 0x004e, 0x00f6, 0x00c6, 0x0046, 0x0016, 0x080c,
+	0x9a0f, 0x2c78, 0x01d8, 0x080c, 0x52a5, 0x0110, 0x7e2e, 0x0008,
+	0x7e16, 0x2b00, 0x7812, 0x7823, 0x0003, 0x2021, 0x0005, 0x080c,
+	0xb801, 0x2f60, 0x080c, 0x52a5, 0x0118, 0x080c, 0xb7ef, 0x0130,
+	0x001e, 0x0016, 0x080c, 0x9b03, 0x9085, 0x0001, 0x001e, 0x004e,
+	0x00ce, 0x00fe, 0x0005, 0x00f6, 0x00c6, 0x0046, 0x080c, 0x9a0f,
+	0x2c78, 0x0530, 0x080c, 0x52a5, 0x0110, 0x7e2e, 0x0008, 0x7e16,
+	0x2b00, 0x7812, 0x7823, 0x0003, 0x0096, 0x2021, 0x0004, 0x0489,
+	0x009e, 0x2001, 0x194f, 0x200c, 0xd1fc, 0x0120, 0x2f60, 0x080c,
+	0x9a65, 0x0060, 0x2f60, 0x080c, 0x52a5, 0x0120, 0xd18c, 0x1160,
+	0x0071, 0x0130, 0x2009, 0x0052, 0x080c, 0x9b03, 0x9085, 0x0001,
+	0x004e, 0x00ce, 0x00fe, 0x0005, 0x2900, 0x7816, 0x0c98, 0x00c6,
+	0x080c, 0x479b, 0x00ce, 0x1120, 0x080c, 0x9a65, 0x9006, 0x0005,
+	0xa867, 0x0000, 0xa86b, 0x8000, 0x2900, 0x6016, 0x9085, 0x0001,
+	0x0005, 0x0096, 0x0076, 0x0126, 0x2091, 0x8000, 0x080c, 0x9746,
+	0x080c, 0x6345, 0x0158, 0x2001, 0xb808, 0x0006, 0x900e, 0x2400,
+	0x080c, 0x6a5c, 0x080c, 0x683f, 0x000e, 0x0807, 0x2418, 0x080c,
+	0x8697, 0xbaa0, 0x0086, 0x2041, 0x0001, 0x2039, 0x0001, 0x2608,
+	0x080c, 0x84b2, 0x008e, 0x080c, 0x8387, 0x2f08, 0x2648, 0x080c,
+	0xce23, 0xb93c, 0x81ff, 0x090c, 0x8589, 0x080c, 0x9762, 0x012e,
+	0x007e, 0x009e, 0x0005, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c,
+	0x9a0f, 0x0190, 0x660a, 0x2b08, 0x6112, 0x080c, 0xbb52, 0x6023,
+	0x0001, 0x2900, 0x6016, 0x2009, 0x001f, 0x080c, 0x9b03, 0x9085,
+	0x0001, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x00c6, 0x0126,
+	0x2091, 0x8000, 0x080c, 0x9ad6, 0x01b8, 0x660a, 0x2b08, 0x6112,
+	0x080c, 0xbb52, 0x6023, 0x0008, 0x2900, 0x6016, 0x00f6, 0x2c78,
+	0x080c, 0x1646, 0x00fe, 0x2009, 0x0021, 0x080c, 0x9b03, 0x9085,
+	0x0001, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x2009, 0x003d,
+	0x00c6, 0x0126, 0x0016, 0x2091, 0x8000, 0x080c, 0x9a0f, 0x0198,
+	0x660a, 0x2b08, 0x6112, 0x080c, 0xbb52, 0x6023, 0x0001, 0x2900,
+	0x6016, 0x001e, 0x0016, 0x080c, 0x9b03, 0x9085, 0x0001, 0x001e,
+	0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd0, 0x00c6, 0x0126, 0x2091,
+	0x8000, 0x080c, 0x9ad6, 0x0188, 0x2b08, 0x6112, 0x080c, 0xbb52,
+	0x6023, 0x0001, 0x2900, 0x6016, 0x2009, 0x0000, 0x080c, 0x9b03,
+	0x9085, 0x0001, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x2009,
+	0x0044, 0x0830, 0x2009, 0x0049, 0x0818, 0x0026, 0x00b6, 0x6210,
+	0x2258, 0xba3c, 0x82ff, 0x0118, 0x8211, 0xba3e, 0x1140, 0xb8c0,
+	0x9005, 0x0128, 0xb888, 0x9005, 0x1110, 0xb88b, 0x0001, 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, 0xb6c5, 0x0168, 0xa864, 0x9086,
+	0x0139, 0x0158, 0x6020, 0x9086, 0x0003, 0x0128, 0xa868, 0xd0fc,
+	0x0110, 0x9006, 0x0010, 0x9085, 0x0001, 0x009e, 0x000e, 0x0005,
+	0x00c6, 0x0126, 0x2091, 0x8000, 0x080c, 0x9ad6, 0x0198, 0x2b08,
+	0x6112, 0x080c, 0xbb52, 0x6023, 0x0001, 0x2900, 0x6016, 0x080c,
+	0x2fc1, 0x2009, 0x0028, 0x080c, 0x9b03, 0x9085, 0x0001, 0x012e,
+	0x00ce, 0x0005, 0x9006, 0x0cd8, 0x9186, 0x0015, 0x11a8, 0x2011,
+	0x1823, 0x2204, 0x9086, 0x0074, 0x1178, 0x00b6, 0x080c, 0xa696,
+	0x00be, 0x080c, 0xa8d5, 0x6003, 0x0001, 0x6007, 0x0029, 0x080c,
+	0x8335, 0x080c, 0x8793, 0x0078, 0x6014, 0x0096, 0x2048, 0xa868,
+	0x009e, 0xd0fc, 0x0148, 0x2001, 0x0001, 0x080c, 0xbd10, 0x080c,
+	0xa40d, 0x080c, 0x9a65, 0x0005, 0x0096, 0x6014, 0x904d, 0x090c,
+	0x0d65, 0xa87b, 0x0030, 0xa883, 0x0000, 0xa897, 0x4005, 0xa89b,
+	0x0004, 0xa867, 0x0139, 0x0126, 0x2091, 0x8000, 0x080c, 0x683f,
+	0x012e, 0x009e, 0x080c, 0x9a65, 0x0c30, 0x0096, 0x9186, 0x0016,
+	0x1128, 0x2001, 0x0004, 0x080c, 0x60b7, 0x00e8, 0x9186, 0x0015,
+	0x1510, 0x2011, 0x1823, 0x2204, 0x9086, 0x0014, 0x11e0, 0x6010,
+	0x00b6, 0x2058, 0x080c, 0x6201, 0x00be, 0x080c, 0xa9a6, 0x1198,
+	0x6010, 0x00b6, 0x2058, 0xb890, 0x00be, 0x9005, 0x0160, 0x2001,
+	0x0006, 0x080c, 0x60b7, 0x6014, 0x2048, 0xa868, 0xd0fc, 0x0170,
+	0x080c, 0x9e74, 0x0048, 0x6014, 0x2048, 0xa868, 0xd0fc, 0x0528,
+	0x080c, 0xa40d, 0x080c, 0x9a65, 0x009e, 0x0005, 0x6014, 0x6310,
+	0x2358, 0x904d, 0x090c, 0x0d65, 0xa87b, 0x0000, 0xa883, 0x0000,
+	0xa897, 0x4000, 0x900e, 0x080c, 0x6455, 0x1108, 0xc185, 0xb800,
+	0xd0bc, 0x0108, 0xc18d, 0xa99a, 0x0126, 0x2091, 0x8000, 0x080c,
+	0x683f, 0x012e, 0x080c, 0x9a65, 0x08f8, 0x6014, 0x904d, 0x090c,
+	0x0d65, 0xa87b, 0x0030, 0xa883, 0x0000, 0xa897, 0x4005, 0xa89b,
+	0x0004, 0xa867, 0x0139, 0x0126, 0x2091, 0x8000, 0x080c, 0x683f,
+	0x012e, 0x080c, 0x9a65, 0x0840, 0xa878, 0x9086, 0x0005, 0x1108,
+	0x0009, 0x0005, 0xa880, 0xc0ad, 0xa882, 0x0005, 0x604b, 0x0000,
+	0x6017, 0x0000, 0x6003, 0x0001, 0x6007, 0x0050, 0x2009, 0x8023,
+	0x080c, 0x832e, 0x0005, 0x00c6, 0x6010, 0x00b6, 0x2058, 0xb800,
+	0x00be, 0xd0bc, 0x0130, 0x0066, 0x6020, 0x9084, 0x000f, 0x001b,
+	0x006e, 0x00ce, 0x0005, 0xb3e3, 0xb9f5, 0xb9f5, 0xb9f8, 0xd118,
+	0xd133, 0xd136, 0xb3e3, 0xb3e3, 0xb3e3, 0xb3e3, 0xb3e3, 0xb3e3,
+	0xb3e3, 0xb3e3, 0xb3e3, 0x080c, 0x0d65, 0xa001, 0xa001, 0x0005,
+	0x0096, 0x6014, 0x904d, 0x0118, 0xa87c, 0xd0e4, 0x1110, 0x009e,
+	0x0010, 0x009e, 0x0005, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be,
+	0xd0bc, 0x0550, 0x2001, 0x1833, 0x2004, 0x9005, 0x1540, 0x00f6,
+	0x2c78, 0x080c, 0x9a0f, 0x0508, 0x7810, 0x6012, 0x080c, 0xbb52,
+	0x7820, 0x9086, 0x0003, 0x0128, 0x7808, 0x603a, 0x2f00, 0x603e,
+	0x0020, 0x7808, 0x603e, 0x2f00, 0x603a, 0x602e, 0x6023, 0x0001,
+	0x6007, 0x0035, 0x6003, 0x0001, 0x795c, 0x615e, 0x2009, 0x8020,
+	0x080c, 0x832e, 0x2f60, 0x00fe, 0x0005, 0x2f60, 0x00fe, 0x2001,
+	0x1957, 0x2004, 0x604a, 0x0005, 0x0016, 0x0096, 0x6814, 0x2048,
+	0x681c, 0xd0fc, 0xc0fc, 0x681e, 0xa87c, 0x1108, 0xd0e4, 0x0180,
+	0xc0e4, 0xa87e, 0xa877, 0x0000, 0xa893, 0x0000, 0xa88f, 0x0000,
+	0xd0cc, 0x0130, 0xc0cc, 0xa87e, 0xa878, 0x2048, 0x080c, 0x0fd5,
+	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, 0x695c, 0x615e,
+	0x6023, 0x0001, 0x6007, 0x0039, 0x6003, 0x0001, 0x2009, 0x8020,
+	0x080c, 0x832e, 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, 0x8276, 0x2001, 0x1955, 0x82ff, 0x1110, 0x2011, 0x0014,
+	0x2202, 0x2001, 0x1953, 0x200c, 0x8000, 0x2014, 0x2071, 0x193d,
+	0x711a, 0x721e, 0x2001, 0x0064, 0x080c, 0x8276, 0x2001, 0x1956,
+	0x82ff, 0x1110, 0x2011, 0x0014, 0x2202, 0x2001, 0x1957, 0x9288,
+	0x000a, 0x2102, 0x2001, 0x0017, 0x080c, 0x9737, 0x2001, 0x1a57,
+	0x2102, 0x2001, 0x0032, 0x080c, 0x1595, 0x080c, 0x653e, 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, 0x0017, 0x080c, 0x9737, 0x2001,
+	0x1a57, 0x2102, 0x2001, 0x0032, 0x080c, 0x1595, 0x00ee, 0x001e,
+	0x000e, 0x0005, 0x0096, 0x6060, 0x904d, 0x0110, 0x080c, 0x1055,
+	0x009e, 0x0005, 0x0005, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c,
+	0x9a0f, 0x0180, 0x2b08, 0x6112, 0x0ca9, 0x6023, 0x0001, 0x2900,
+	0x6016, 0x2009, 0x0033, 0x080c, 0x9b03, 0x9085, 0x0001, 0x012e,
+	0x00ce, 0x0005, 0x9006, 0x0cd8, 0x0096, 0x00e6, 0x00f6, 0x2071,
+	0x1800, 0x9186, 0x0015, 0x1500, 0x708c, 0x9086, 0x0018, 0x11e0,
+	0x6014, 0x2048, 0xaa3c, 0xd2e4, 0x1160, 0x2c78, 0x080c, 0x8852,
+	0x01d8, 0x7078, 0xaa50, 0x9206, 0x1160, 0x707c, 0xaa54, 0x9206,
+	0x1140, 0x6210, 0x00b6, 0x2258, 0xbaa0, 0x00be, 0x900e, 0x080c,
+	0x3012, 0x080c, 0x9e74, 0x0020, 0x080c, 0xa40d, 0x080c, 0x9a65,
+	0x00fe, 0x00ee, 0x009e, 0x0005, 0x705c, 0xaa54, 0x9206, 0x0d48,
+	0x0c80, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c, 0x9a0f, 0x0188,
+	0x2b08, 0x6112, 0x080c, 0xbb52, 0x6023, 0x0001, 0x2900, 0x6016,
+	0x2009, 0x004d, 0x080c, 0x9b03, 0x9085, 0x0001, 0x012e, 0x00ce,
+	0x0005, 0x9006, 0x0cd8, 0x00c6, 0x0126, 0x2091, 0x8000, 0x0016,
+	0x080c, 0x9a0f, 0x0180, 0x2b08, 0x6112, 0x080c, 0xbb52, 0x6023,
+	0x0001, 0x2900, 0x6016, 0x001e, 0x080c, 0x9b03, 0x9085, 0x0001,
+	0x012e, 0x00ce, 0x0005, 0x001e, 0x9006, 0x0cd0, 0x0016, 0x0026,
+	0x0036, 0x0046, 0x0056, 0x0066, 0x0096, 0x00e6, 0x00f6, 0x2071,
+	0x1800, 0x9186, 0x0015, 0x1568, 0x718c, 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, 0xc3ab, 0x001e, 0xa804,
+	0x9005, 0x0110, 0x2048, 0x0c38, 0x6014, 0x2048, 0xa867, 0x0103,
+	0x0010, 0x080c, 0xa40d, 0x080c, 0x9a65, 0x00fe, 0x00ee, 0x009e,
+	0x006e, 0x005e, 0x004e, 0x003e, 0x002e, 0x001e, 0x0005, 0x0096,
+	0x00e6, 0x00f6, 0x2071, 0x1800, 0x9186, 0x0015, 0x11b8, 0x708c,
+	0x9086, 0x0004, 0x1198, 0x6014, 0x2048, 0x2c78, 0x080c, 0x8852,
+	0x01a8, 0x7078, 0xaa74, 0x9206, 0x1130, 0x707c, 0xaa78, 0x9206,
+	0x1110, 0x080c, 0x2fc1, 0x080c, 0x9e74, 0x0020, 0x080c, 0xa40d,
+	0x080c, 0x9a65, 0x00fe, 0x00ee, 0x009e, 0x0005, 0x705c, 0xaa78,
+	0x9206, 0x0d78, 0x0c80, 0x0096, 0x00e6, 0x00f6, 0x2071, 0x1800,
+	0x9186, 0x0015, 0x1550, 0x708c, 0x9086, 0x0004, 0x1530, 0x6014,
+	0x2048, 0x2c78, 0x080c, 0x8852, 0x05e8, 0x7078, 0xaacc, 0x9206,
+	0x1180, 0x707c, 0xaad0, 0x9206, 0x1160, 0x080c, 0x2fc1, 0x0016,
+	0xa998, 0xaab0, 0x9284, 0x1000, 0xc0fd, 0x080c, 0x5255, 0x001e,
+	0x0010, 0x080c, 0x503e, 0x080c, 0xb6c5, 0x0500, 0xa87b, 0x0000,
+	0xa883, 0x0000, 0xa897, 0x4000, 0x0078, 0x080c, 0x503e, 0x080c,
+	0xb6c5, 0x01a0, 0x6014, 0x2048, 0xa87b, 0x0030, 0xa883, 0x0000,
+	0xa897, 0x4005, 0xa89b, 0x0004, 0x0126, 0x2091, 0x8000, 0xa867,
+	0x0139, 0x080c, 0x683f, 0x012e, 0x080c, 0x9a65, 0x00fe, 0x00ee,
+	0x009e, 0x0005, 0x705c, 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, 0xb6c5, 0x0904, 0xbd0c, 0x0096, 0x6314, 0x2348,
+	0xa87a, 0xa982, 0x929e, 0x4000, 0x1580, 0x6310, 0x00c6, 0x2358,
+	0x2009, 0x0000, 0xa868, 0xd0f4, 0x1140, 0x080c, 0x6455, 0x1108,
+	0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d, 0xaa96, 0xa99a, 0x20a9,
+	0x0004, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0031, 0x20a0, 0xb8b4,
+	0x20e0, 0xb8b8, 0x9080, 0x0006, 0x2098, 0x080c, 0x0fa0, 0x20a9,
+	0x0004, 0xa85c, 0x9080, 0x0035, 0x20a0, 0xb8b8, 0x9080, 0x000a,
+	0x2098, 0x080c, 0x0fa0, 0x00ce, 0x0090, 0xaa96, 0x3918, 0x9398,
+	0x0007, 0x231c, 0x6004, 0x9086, 0x0016, 0x0110, 0xa89b, 0x0004,
+	0xaba2, 0x6310, 0x2358, 0xb804, 0x9084, 0x00ff, 0xa89e, 0x080c,
+	0x6833, 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, 0x23ef, 0x2118, 0x831f, 0x939c,
+	0xff00, 0x7838, 0x9084, 0x00ff, 0x931d, 0x7c3c, 0x2011, 0x8018,
+	0x080c, 0x47fb, 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, 0xb6b3, 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, 0xad40,
+	0x0005, 0x0036, 0x2019, 0x0001, 0x0010, 0x0036, 0x901e, 0x0499,
+	0x01e0, 0x080c, 0xb6c5, 0x01c8, 0x080c, 0xb8ad, 0x6037, 0x4000,
+	0x6014, 0x6017, 0x0000, 0x0096, 0x2048, 0xa87c, 0x080c, 0xb8d3,
+	0x1118, 0x080c, 0xa40d, 0x0040, 0xa867, 0x0103, 0xa877, 0x0000,
+	0x83ff, 0x1129, 0x080c, 0x683f, 0x009e, 0x003e, 0x0005, 0xa880,
+	0xd0b4, 0x0128, 0xa87b, 0x0006, 0xc0ec, 0xa882, 0x0048, 0xd0bc,
+	0x0118, 0xa87b, 0x0002, 0x0020, 0xa87b, 0x0005, 0x080c, 0xb9c2,
+	0xa877, 0x0000, 0x0005, 0x2001, 0x1810, 0x2004, 0xd0ec, 0x0005,
+	0x0006, 0x2001, 0x1810, 0x2004, 0xd0f4, 0x000e, 0x0005, 0x0006,
+	0x2001, 0x1810, 0x2004, 0xd0e4, 0x000e, 0x0005, 0x0036, 0x0046,
+	0x6010, 0x00b6, 0x2058, 0xbba0, 0x00be, 0x2021, 0x0007, 0x080c,
+	0x4998, 0x004e, 0x003e, 0x0005, 0x0c51, 0x1d81, 0x0005, 0x2001,
+	0x1955, 0x2004, 0x601a, 0x0005, 0x2001, 0x1957, 0x2004, 0x604a,
+	0x0005, 0x080c, 0x9a65, 0x0804, 0x8793, 0x611c, 0xd1fc, 0xa97c,
+	0x1108, 0xd1e4, 0x0005, 0x601c, 0xd0fc, 0xa87c, 0x1108, 0xd0e4,
+	0x0005, 0x601c, 0xd0fc, 0xc0fc, 0x601e, 0xa87c, 0x1108, 0xd0e4,
+	0x0005, 0x6044, 0xd0fc, 0x0160, 0xd0dc, 0x1128, 0x908c, 0x000f,
+	0x9186, 0x0005, 0x1118, 0x6003, 0x0003, 0x0010, 0x6003, 0x0001,
+	0x0005, 0x00b6, 0x0066, 0x6000, 0x90b2, 0x0016, 0x1a0c, 0x0d65,
+	0x001b, 0x006e, 0x00be, 0x0005, 0xbe3c, 0xc506, 0xc655, 0xbe3c,
+	0xbe3c, 0xbe3c, 0xbe3c, 0xbe3c, 0xbe73, 0xc6d3, 0xbe3c, 0xbe3c,
+	0xbe3c, 0xbe3c, 0xbe3c, 0xbe3c, 0x080c, 0x0d65, 0x0066, 0x6000,
+	0x90b2, 0x0016, 0x1a0c, 0x0d65, 0x0013, 0x006e, 0x0005, 0xbe57,
+	0xcbe5, 0xbe57, 0xbe57, 0xbe57, 0xbe57, 0xbe57, 0xbe57, 0xcb94,
+	0xcc37, 0xbe57, 0xd253, 0xd287, 0xd253, 0xd287, 0xbe57, 0x080c,
+	0x0d65, 0x6000, 0x9082, 0x0016, 0x1a0c, 0x0d65, 0x6000, 0x000a,
+	0x0005, 0xbe71, 0xc8af, 0xc978, 0xc99a, 0xca15, 0xbe71, 0xcb0b,
+	0xca9d, 0xc6dd, 0xcb6c, 0xcb81, 0xbe71, 0xbe71, 0xbe71, 0xbe71,
+	0xbe71, 0x080c, 0x0d65, 0x91b2, 0x0053, 0x1a0c, 0x0d65, 0x2100,
+	0x91b2, 0x0040, 0x1a04, 0xc2ab, 0x0002, 0xbebd, 0xc09c, 0xbebd,
+	0xbebd, 0xbebd, 0xc0a5, 0xbebd, 0xbebd, 0xbebd, 0xbebd, 0xbebd,
+	0xbebd, 0xbebd, 0xbebd, 0xbebd, 0xbebd, 0xbebd, 0xbebd, 0xbebd,
+	0xbebd, 0xbebd, 0xbebd, 0xbebd, 0xbebf, 0xbf19, 0xbf28, 0xbf8c,
+	0xbfb7, 0xc02f, 0xc087, 0xbebd, 0xbebd, 0xc0a8, 0xbebd, 0xbebd,
+	0xc0bd, 0xc0ca, 0xbebd, 0xbebd, 0xbebd, 0xbebd, 0xbebd, 0xc14d,
+	0xbebd, 0xbebd, 0xc161, 0xbebd, 0xbebd, 0xc11c, 0xbebd, 0xbebd,
+	0xbebd, 0xc179, 0xbebd, 0xbebd, 0xbebd, 0xc1f6, 0xbebd, 0xbebd,
+	0xbebd, 0xbebd, 0xbebd, 0xbebd, 0xc273, 0x080c, 0x0d65, 0x080c,
+	0x651b, 0x1150, 0x2001, 0x1836, 0x2004, 0xd0cc, 0x1128, 0x9084,
+	0x0009, 0x9086, 0x0008, 0x1140, 0x6007, 0x0009, 0x602f, 0x0009,
+	0x6017, 0x0000, 0x0804, 0xc095, 0x080c, 0x6504, 0x00e6, 0x00c6,
+	0x0036, 0x0026, 0x0016, 0x6210, 0x2258, 0xbaa0, 0x0026, 0x2019,
+	0x0029, 0x080c, 0x9746, 0x080c, 0x8498, 0x0076, 0x903e, 0x080c,
+	0x8387, 0x2c08, 0x080c, 0xce23, 0x007e, 0x001e, 0x080c, 0x9762,
+	0x001e, 0x002e, 0x003e, 0x00ce, 0x00ee, 0x6610, 0x2658, 0x080c,
+	0x6175, 0xbe04, 0x9684, 0x00ff, 0x9082, 0x0006, 0x0278, 0x080c,
+	0xcd52, 0x1904, 0xbf84, 0x080c, 0xccee, 0x1120, 0x6007, 0x0008,
+	0x0804, 0xc095, 0x6007, 0x0009, 0x0804, 0xc095, 0x080c, 0xcf59,
+	0x0128, 0x080c, 0xcd52, 0x0d78, 0x0804, 0xbf84, 0x6017, 0x1900,
+	0x0c88, 0x080c, 0x3107, 0x1904, 0xc2a8, 0x6106, 0x080c, 0xcca1,
+	0x6007, 0x0006, 0x0804, 0xc095, 0x6007, 0x0007, 0x0804, 0xc095,
+	0x080c, 0xd2c3, 0x1904, 0xc2a8, 0x080c, 0x3107, 0x1904, 0xc2a8,
+	0x00d6, 0x6610, 0x2658, 0xbe04, 0x9684, 0x00ff, 0x9082, 0x0006,
+	0x1220, 0x2001, 0x0001, 0x080c, 0x60a3, 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, 0xcdb9, 0x1190, 0x9686, 0x0006, 0x1140,
+	0x0026, 0x6210, 0x2258, 0xbaa0, 0x900e, 0x080c, 0x3012, 0x002e,
+	0x080c, 0x6201, 0x6007, 0x000a, 0x00de, 0x0804, 0xc095, 0x6007,
+	0x000b, 0x00de, 0x0804, 0xc095, 0x080c, 0x2fc1, 0x080c, 0xbdec,
+	0x6007, 0x0001, 0x0804, 0xc095, 0x080c, 0xd2c3, 0x1904, 0xc2a8,
+	0x080c, 0x3107, 0x1904, 0xc2a8, 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, 0x3012, 0x002e, 0x6007,
+	0x000c, 0x2001, 0x0001, 0x080c, 0xd3df, 0x0804, 0xc095, 0x080c,
+	0x651b, 0x1140, 0x2001, 0x1836, 0x2004, 0x9084, 0x0009, 0x9086,
+	0x0008, 0x1110, 0x0804, 0xbecc, 0x080c, 0x6504, 0x6610, 0x2658,
+	0xbe04, 0x9684, 0x00ff, 0x9082, 0x0006, 0x06c0, 0x1138, 0x0026,
+	0x2001, 0x0006, 0x080c, 0x60e3, 0x002e, 0x0050, 0x96b4, 0xff00,
+	0x8637, 0x9686, 0x0004, 0x0120, 0x9686, 0x0006, 0x1904, 0xbf84,
+	0x080c, 0xcdc6, 0x1120, 0x6007, 0x000e, 0x0804, 0xc095, 0x0046,
+	0x6410, 0x2458, 0xbca0, 0x0046, 0x080c, 0x2fc1, 0x080c, 0xbdec,
+	0x004e, 0x0016, 0x9006, 0x2009, 0x1854, 0x210c, 0x0048, 0x2009,
+	0x0029, 0x080c, 0xd0ce, 0x6010, 0x2058, 0xb800, 0xc0e5, 0xb802,
+	0x001e, 0x004e, 0x6007, 0x0001, 0x0804, 0xc095, 0x2001, 0x0001,
+	0x080c, 0x60a3, 0x0156, 0x0016, 0x0026, 0x0036, 0x20a9, 0x0004,
+	0x2019, 0x1805, 0x2011, 0x0270, 0x080c, 0xaa49, 0x003e, 0x002e,
+	0x001e, 0x015e, 0x9005, 0x0168, 0x96b4, 0xff00, 0x8637, 0x9682,
+	0x0004, 0x0a04, 0xbf84, 0x9682, 0x0007, 0x0a04, 0xbfe0, 0x0804,
+	0xbf84, 0x6017, 0x1900, 0x6007, 0x0009, 0x0804, 0xc095, 0x080c,
+	0x651b, 0x1140, 0x2001, 0x1836, 0x2004, 0x9084, 0x0009, 0x9086,
+	0x0008, 0x1110, 0x0804, 0xbecc, 0x080c, 0x6504, 0x6610, 0x2658,
+	0xbe04, 0x9684, 0x00ff, 0x9082, 0x0006, 0x0688, 0x96b4, 0xff00,
+	0x8637, 0x9686, 0x0004, 0x0120, 0x9686, 0x0006, 0x1904, 0xbf84,
+	0x080c, 0xcdf4, 0x1130, 0x080c, 0xccee, 0x1118, 0x6007, 0x0010,
+	0x04e0, 0x0046, 0x6410, 0x2458, 0xbca0, 0x0046, 0x080c, 0x2fc1,
+	0x080c, 0xbdec, 0x004e, 0x0016, 0x9006, 0x2009, 0x1854, 0x210c,
+	0x0048, 0x2009, 0x0029, 0x080c, 0xd0ce, 0x6010, 0x2058, 0xb800,
+	0xc0e5, 0xb802, 0x001e, 0x004e, 0x6007, 0x0001, 0x00f0, 0x080c,
+	0xcf59, 0x0140, 0x96b4, 0xff00, 0x8637, 0x9686, 0x0006, 0x0980,
+	0x0804, 0xbf84, 0x6017, 0x1900, 0x6007, 0x0009, 0x0070, 0x080c,
+	0x3107, 0x1904, 0xc2a8, 0x080c, 0xd2c3, 0x1904, 0xc2a8, 0x080c,
+	0xc446, 0x1904, 0xbf84, 0x6007, 0x0012, 0x6003, 0x0001, 0x080c,
+	0x8335, 0x080c, 0x8793, 0x0005, 0x6007, 0x0001, 0x6003, 0x0001,
+	0x080c, 0x8335, 0x080c, 0x8793, 0x0cb0, 0x6007, 0x0005, 0x0c68,
+	0x080c, 0xd2c3, 0x1904, 0xc2a8, 0x080c, 0x3107, 0x1904, 0xc2a8,
+	0x080c, 0xc446, 0x1904, 0xbf84, 0x6007, 0x0020, 0x6003, 0x0001,
+	0x080c, 0x8335, 0x080c, 0x8793, 0x0005, 0x080c, 0x3107, 0x1904,
+	0xc2a8, 0x6007, 0x0023, 0x6003, 0x0001, 0x080c, 0x8335, 0x080c,
+	0x8793, 0x0005, 0x080c, 0xd2c3, 0x1904, 0xc2a8, 0x080c, 0x3107,
+	0x1904, 0xc2a8, 0x080c, 0xc446, 0x1904, 0xbf84, 0x0016, 0x0026,
+	0x00e6, 0x2071, 0x0260, 0x7244, 0x9286, 0xffff, 0x0180, 0x2c08,
+	0x080c, 0xb6b3, 0x01b0, 0x2260, 0x7240, 0x6008, 0x9206, 0x1188,
+	0x6010, 0x9190, 0x0004, 0x2214, 0x9206, 0x01b8, 0x0050, 0x7240,
+	0x2c08, 0x9006, 0x080c, 0xd0a0, 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, 0x9a65, 0x2160,
+	0x6007, 0x0025, 0x6003, 0x0001, 0x080c, 0x8335, 0x080c, 0x8793,
+	0x00ee, 0x002e, 0x001e, 0x0005, 0x2001, 0x0001, 0x080c, 0x60a3,
+	0x0156, 0x0016, 0x0026, 0x0036, 0x20a9, 0x0004, 0x2019, 0x1805,
+	0x2011, 0x0276, 0x080c, 0xaa49, 0x003e, 0x002e, 0x001e, 0x015e,
+	0x0120, 0x6007, 0x0031, 0x0804, 0xc095, 0x080c, 0xa6ae, 0x080c,
+	0x6f5c, 0x1190, 0x0006, 0x0026, 0x0036, 0x080c, 0x6f76, 0x1138,
+	0x080c, 0x725c, 0x080c, 0x5be2, 0x080c, 0x6e8d, 0x0010, 0x080c,
+	0x6f30, 0x003e, 0x002e, 0x000e, 0x0005, 0x080c, 0x3107, 0x1904,
+	0xc2a8, 0x080c, 0xc446, 0x1904, 0xbf84, 0x6106, 0x080c, 0xc462,
+	0x1120, 0x6007, 0x002b, 0x0804, 0xc095, 0x6007, 0x002c, 0x0804,
+	0xc095, 0x080c, 0xd2c3, 0x1904, 0xc2a8, 0x080c, 0x3107, 0x1904,
+	0xc2a8, 0x080c, 0xc446, 0x1904, 0xbf84, 0x6106, 0x080c, 0xc467,
+	0x1120, 0x6007, 0x002e, 0x0804, 0xc095, 0x6007, 0x002f, 0x0804,
+	0xc095, 0x080c, 0x3107, 0x1904, 0xc2a8, 0x00e6, 0x00d6, 0x00c6,
+	0x6010, 0x2058, 0xb904, 0x9184, 0x00ff, 0x9086, 0x0006, 0x0158,
+	0x9184, 0xff00, 0x8007, 0x9086, 0x0006, 0x0128, 0x00ce, 0x00de,
+	0x00ee, 0x0804, 0xc09c, 0x080c, 0x52a1, 0xd0e4, 0x0904, 0xc1f3,
+	0x2071, 0x026c, 0x7010, 0x603a, 0x7014, 0x603e, 0x7108, 0x720c,
+	0x080c, 0x6559, 0x0140, 0x6010, 0x2058, 0xb810, 0x9106, 0x1118,
+	0xb814, 0x9206, 0x0510, 0x080c, 0x6555, 0x15b8, 0x2069, 0x1800,
+	0x687c, 0x9206, 0x1590, 0x6878, 0x9106, 0x1578, 0x7210, 0x080c,
+	0xb6b3, 0x0590, 0x080c, 0xc333, 0x0578, 0x080c, 0xd145, 0x0560,
+	0x622e, 0x6007, 0x0036, 0x6003, 0x0001, 0x2009, 0x8020, 0x080c,
+	0x832e, 0x00ce, 0x00de, 0x00ee, 0x0005, 0x7214, 0x9286, 0xffff,
+	0x0150, 0x080c, 0xb6b3, 0x01c0, 0x9280, 0x0002, 0x2004, 0x7110,
+	0x9106, 0x1190, 0x08e0, 0x7210, 0x2c08, 0x9085, 0x0001, 0x080c,
+	0xd0a0, 0x2c10, 0x2160, 0x0140, 0x0890, 0x6007, 0x0037, 0x602f,
+	0x0009, 0x6017, 0x1500, 0x08b8, 0x6007, 0x0037, 0x602f, 0x0003,
+	0x6017, 0x1700, 0x0880, 0x6007, 0x0012, 0x0868, 0x080c, 0x3107,
+	0x1904, 0xc2a8, 0x6010, 0x2058, 0xb804, 0x9084, 0xff00, 0x8007,
+	0x9086, 0x0006, 0x1904, 0xc09c, 0x00e6, 0x00d6, 0x00c6, 0x080c,
+	0x52a1, 0xd0e4, 0x0904, 0xc26b, 0x2069, 0x1800, 0x2071, 0x026c,
+	0x7008, 0x603a, 0x720c, 0x623e, 0x9286, 0xffff, 0x1150, 0x7208,
+	0x00c6, 0x2c08, 0x9085, 0x0001, 0x080c, 0xd0a0, 0x2c10, 0x00ce,
+	0x05e8, 0x080c, 0xb6b3, 0x05d0, 0x7108, 0x9280, 0x0002, 0x2004,
+	0x9106, 0x15a0, 0x00c6, 0x0026, 0x2260, 0x080c, 0xb2c3, 0x002e,
+	0x00ce, 0x7118, 0x918c, 0xff00, 0x810f, 0x9186, 0x0001, 0x0178,
+	0x9186, 0x0005, 0x0118, 0x9186, 0x0007, 0x1198, 0x9280, 0x0005,
+	0x2004, 0x9005, 0x0170, 0x080c, 0xc333, 0x0904, 0xc1ec, 0x0056,
+	0x7510, 0x7614, 0x080c, 0xd15e, 0x005e, 0x00ce, 0x00de, 0x00ee,
+	0x0005, 0x6007, 0x003b, 0x602f, 0x0009, 0x6017, 0x2a00, 0x6003,
+	0x0001, 0x2009, 0x8020, 0x080c, 0x832e, 0x0c78, 0x6007, 0x003b,
+	0x602f, 0x0003, 0x6017, 0x0300, 0x6003, 0x0001, 0x2009, 0x8020,
+	0x080c, 0x832e, 0x0c10, 0x6007, 0x003b, 0x602f, 0x000b, 0x6017,
+	0x0000, 0x0804, 0xc1c3, 0x00e6, 0x0026, 0x080c, 0x651b, 0x0550,
+	0x080c, 0x6504, 0x080c, 0xd335, 0x1518, 0x2071, 0x1800, 0x70d8,
+	0x9085, 0x0003, 0x70da, 0x00f6, 0x2079, 0x0100, 0x72ac, 0x9284,
+	0x00ff, 0x707a, 0x78e6, 0x9284, 0xff00, 0x727c, 0x9205, 0x707e,
+	0x78ea, 0x00fe, 0x70e3, 0x0000, 0x080c, 0x6559, 0x0120, 0x2011,
+	0x19d8, 0x2013, 0x07d0, 0xd0ac, 0x1128, 0x080c, 0x2d99, 0x0010,
+	0x080c, 0xd367, 0x002e, 0x00ee, 0x080c, 0x9a65, 0x0804, 0xc09b,
+	0x080c, 0x9a65, 0x0005, 0x2600, 0x0002, 0xc2bf, 0xc2bf, 0xc2bf,
+	0xc2bf, 0xc2bf, 0xc2c1, 0xc2bf, 0xc2bf, 0xc2bf, 0xc2bf, 0xc2de,
+	0xc2bf, 0xc2bf, 0xc2bf, 0xc2f0, 0xc2fd, 0xc32e, 0xc2bf, 0x080c,
+	0x0d65, 0x080c, 0xd2c3, 0x1d20, 0x080c, 0x3107, 0x1d08, 0x080c,
+	0xc446, 0x1148, 0x7038, 0x6016, 0x6007, 0x0045, 0x6003, 0x0001,
+	0x080c, 0x8335, 0x0005, 0x080c, 0x2fc1, 0x080c, 0xbdec, 0x6007,
+	0x0001, 0x6003, 0x0001, 0x080c, 0x8335, 0x0005, 0x080c, 0xd2c3,
+	0x1938, 0x080c, 0x3107, 0x1920, 0x080c, 0xc446, 0x1d60, 0x703c,
+	0x6016, 0x6007, 0x004a, 0x6003, 0x0001, 0x080c, 0x8335, 0x0005,
+	0x080c, 0xc34e, 0x0904, 0xc2a8, 0x6007, 0x004e, 0x6003, 0x0001,
+	0x080c, 0x8335, 0x080c, 0x8793, 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, 0xaa5d, 0x009e, 0x0110, 0x6017, 0x0001, 0x6003,
+	0x0001, 0x080c, 0x8335, 0x080c, 0x8793, 0x0005, 0x6007, 0x0050,
+	0x703c, 0x6016, 0x0ca0, 0x00e6, 0x2071, 0x0260, 0x00b6, 0x00c6,
+	0x2260, 0x6010, 0x2058, 0xb8c4, 0xd084, 0x0150, 0x7128, 0x6050,
+	0x9106, 0x1120, 0x712c, 0x604c, 0x9106, 0x0110, 0x9006, 0x0010,
+	0x9085, 0x0001, 0x00ce, 0x00be, 0x00ee, 0x0005, 0x0016, 0x0096,
+	0x0086, 0x00e6, 0x01c6, 0x01d6, 0x0126, 0x2091, 0x8000, 0x2071,
+	0x1800, 0x708c, 0x908a, 0x00f9, 0x16e8, 0x20e1, 0x0000, 0x2001,
+	0x196f, 0x2003, 0x0000, 0x080c, 0x103c, 0x05a0, 0x2900, 0x6016,
+	0x708c, 0x8004, 0xa816, 0x908a, 0x001e, 0x02d0, 0xa833, 0x001e,
+	0x20a9, 0x001e, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x001b, 0x20a0,
+	0x2001, 0x196f, 0x0016, 0x200c, 0x0471, 0x001e, 0x2940, 0x080c,
+	0x103c, 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, 0x708f, 0x0000, 0x6014, 0x2048,
+	0x080c, 0x0fd5, 0x9006, 0x012e, 0x01de, 0x01ce, 0x00ee, 0x008e,
+	0x009e, 0x001e, 0x0005, 0x0006, 0x0016, 0x0026, 0x0036, 0x00c6,
+	0x918c, 0xffff, 0x11a8, 0x080c, 0x1ff6, 0x2099, 0x026c, 0x2001,
+	0x0014, 0x3518, 0x9312, 0x1218, 0x23a8, 0x4003, 0x00f8, 0x20a8,
+	0x4003, 0x22a8, 0x8108, 0x080c, 0x1ff6, 0x2099, 0x0260, 0x0ca8,
+	0x080c, 0x1ff6, 0x2061, 0x196f, 0x6004, 0x2098, 0x6008, 0x3518,
+	0x9312, 0x1218, 0x23a8, 0x4003, 0x0048, 0x20a8, 0x4003, 0x22a8,
+	0x8108, 0x080c, 0x1ff6, 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, 0x200e,
+	0x20a1, 0x024c, 0x2001, 0x0014, 0x3518, 0x9312, 0x1218, 0x23a8,
+	0x4003, 0x0418, 0x20a8, 0x4003, 0x82ff, 0x01f8, 0x22a8, 0x8108,
+	0x080c, 0x200e, 0x20a1, 0x0240, 0x0c98, 0x080c, 0x200e, 0x2061,
+	0x1972, 0x6004, 0x20a0, 0x6008, 0x3518, 0x9312, 0x1218, 0x23a8,
+	0x4003, 0x0058, 0x20a8, 0x4003, 0x82ff, 0x0138, 0x22a8, 0x8108,
+	0x080c, 0x200e, 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, 0xc4dc, 0x00de, 0x0005, 0x00d6,
+	0x080c, 0xc4e9, 0x1520, 0x680c, 0x908c, 0xff00, 0x6820, 0x9084,
+	0x00ff, 0x9115, 0x6216, 0x6824, 0x602e, 0xd1e4, 0x0130, 0x9006,
+	0x080c, 0xd3df, 0x2009, 0x0001, 0x0078, 0xd1ec, 0x0180, 0x6920,
+	0x918c, 0x00ff, 0x6824, 0x080c, 0x23ef, 0x1148, 0x2001, 0x0001,
+	0x080c, 0xd3df, 0x2110, 0x900e, 0x080c, 0x3012, 0x0018, 0x9085,
+	0x0001, 0x0008, 0x9006, 0x00de, 0x0005, 0x00b6, 0x00c6, 0x080c,
+	0x9ad6, 0x0598, 0x0016, 0x0026, 0x00c6, 0x2011, 0x0263, 0x2204,
+	0x8211, 0x220c, 0x080c, 0x23ef, 0x1568, 0x080c, 0x6106, 0x1550,
+	0xbe12, 0xbd16, 0x00ce, 0x002e, 0x001e, 0x2b00, 0x6012, 0x080c,
+	0xd2c3, 0x11c8, 0x080c, 0x3107, 0x11b0, 0x080c, 0xc446, 0x0500,
+	0x2001, 0x0007, 0x080c, 0x60b7, 0x2001, 0x0007, 0x080c, 0x60e3,
+	0x6017, 0x0000, 0x6023, 0x0001, 0x6007, 0x0001, 0x6003, 0x0001,
+	0x080c, 0x8335, 0x0010, 0x080c, 0x9a65, 0x9085, 0x0001, 0x00ce,
+	0x00be, 0x0005, 0x080c, 0x9a65, 0x00ce, 0x002e, 0x001e, 0x0ca8,
+	0x080c, 0x9a65, 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, 0x6162,
+	0x908e, 0x0014, 0x0110, 0x908e, 0x0010, 0x0005, 0x6004, 0x90b2,
+	0x0053, 0x1a0c, 0x0d65, 0x91b6, 0x0013, 0x1130, 0x2008, 0x91b2,
+	0x0040, 0x1a04, 0xc629, 0x0092, 0x91b6, 0x0027, 0x0120, 0x91b6,
+	0x0014, 0x190c, 0x0d65, 0x2001, 0x0007, 0x080c, 0x60e3, 0x080c,
+	0x86d1, 0x080c, 0x9a9f, 0x080c, 0x8793, 0x0005, 0xc566, 0xc568,
+	0xc566, 0xc566, 0xc566, 0xc568, 0xc575, 0xc626, 0xc5c5, 0xc626,
+	0xc5d7, 0xc626, 0xc575, 0xc626, 0xc61e, 0xc626, 0xc61e, 0xc626,
+	0xc626, 0xc566, 0xc566, 0xc566, 0xc566, 0xc566, 0xc566, 0xc566,
+	0xc566, 0xc566, 0xc566, 0xc566, 0xc568, 0xc566, 0xc626, 0xc566,
+	0xc566, 0xc626, 0xc566, 0xc623, 0xc626, 0xc566, 0xc566, 0xc566,
+	0xc566, 0xc626, 0xc626, 0xc566, 0xc626, 0xc626, 0xc566, 0xc570,
+	0xc566, 0xc566, 0xc566, 0xc566, 0xc622, 0xc626, 0xc566, 0xc566,
+	0xc626, 0xc626, 0xc566, 0xc566, 0xc566, 0xc566, 0x080c, 0x0d65,
+	0x080c, 0xbdef, 0x6003, 0x0002, 0x080c, 0x8793, 0x0804, 0xc628,
+	0x9006, 0x080c, 0x60a3, 0x0804, 0xc626, 0x080c, 0x6555, 0x1904,
+	0xc626, 0x9006, 0x080c, 0x60a3, 0x6010, 0x2058, 0xb810, 0x9086,
+	0x00ff, 0x1140, 0x00f6, 0x2079, 0x1800, 0x78a4, 0x8000, 0x78a6,
+	0x00fe, 0x0428, 0x6010, 0x2058, 0xb884, 0x9005, 0x1178, 0x080c,
+	0xbdd7, 0x1904, 0xc626, 0x0036, 0x0046, 0xbba0, 0x2021, 0x0007,
+	0x080c, 0x4998, 0x004e, 0x003e, 0x0804, 0xc626, 0x080c, 0x3138,
+	0x1904, 0xc626, 0x2001, 0x1800, 0x2004, 0x9086, 0x0002, 0x1138,
+	0x00f6, 0x2079, 0x1800, 0x78a4, 0x8000, 0x78a6, 0x00fe, 0x2001,
+	0x0002, 0x080c, 0x60b7, 0x6023, 0x0001, 0x6003, 0x0001, 0x6007,
+	0x0002, 0x080c, 0x8335, 0x080c, 0x8793, 0x6110, 0x2158, 0x2009,
+	0x0001, 0x080c, 0x7fc9, 0x0804, 0xc628, 0x6610, 0x2658, 0xbe04,
+	0x96b4, 0xff00, 0x8637, 0x9686, 0x0006, 0x0904, 0xc626, 0x9686,
+	0x0004, 0x0904, 0xc626, 0x2001, 0x0004, 0x0804, 0xc624, 0x2001,
+	0x1800, 0x2004, 0x9086, 0x0003, 0x1158, 0x0036, 0x0046, 0x6010,
+	0x2058, 0xbba0, 0x2021, 0x0006, 0x080c, 0x4998, 0x004e, 0x003e,
+	0x2001, 0x0006, 0x080c, 0xc642, 0x6610, 0x2658, 0xbe04, 0x0066,
+	0x96b4, 0xff00, 0x8637, 0x9686, 0x0006, 0x006e, 0x0168, 0x2001,
+	0x0006, 0x080c, 0x60e3, 0x9284, 0x00ff, 0x908e, 0x0007, 0x1120,
+	0x2001, 0x0006, 0x080c, 0x60b7, 0x080c, 0x6555, 0x11f8, 0x2001,
+	0x1836, 0x2004, 0xd0a4, 0x01d0, 0xbe04, 0x96b4, 0x00ff, 0x9686,
+	0x0006, 0x01a0, 0x00f6, 0x2079, 0x1800, 0x78a4, 0x8000, 0x78a6,
+	0x00fe, 0x0804, 0xc5af, 0x2001, 0x0004, 0x0030, 0x2001, 0x0006,
+	0x0409, 0x0020, 0x0018, 0x0010, 0x080c, 0x60e3, 0x080c, 0x9a65,
+	0x0005, 0x2600, 0x0002, 0xc63d, 0xc63d, 0xc63d, 0xc63d, 0xc63d,
+	0xc63f, 0xc63d, 0xc63d, 0xc63d, 0xc63d, 0xc63f, 0xc63d, 0xc63d,
+	0xc63d, 0xc63f, 0xc63f, 0xc63f, 0xc63f, 0x080c, 0x0d65, 0x080c,
+	0x9a65, 0x0005, 0x0016, 0x00b6, 0x00d6, 0x6110, 0x2158, 0xb900,
+	0xd184, 0x0138, 0x080c, 0x60b7, 0x9006, 0x080c, 0x60a3, 0x080c,
+	0x2ff2, 0x00de, 0x00be, 0x001e, 0x0005, 0x6610, 0x2658, 0xb804,
+	0x9084, 0xff00, 0x8007, 0x90b2, 0x000c, 0x1a0c, 0x0d65, 0x91b6,
+	0x0015, 0x1110, 0x003b, 0x0028, 0x91b6, 0x0016, 0x190c, 0x0d65,
+	0x006b, 0x0005, 0xa4ee, 0xa4ee, 0xa4ee, 0xa4ee, 0xa4ee, 0xa4ee,
+	0xc6bd, 0xc682, 0xa4ee, 0xa4ee, 0xa4ee, 0xa4ee, 0xa4ee, 0xa4ee,
+	0xa4ee, 0xa4ee, 0xa4ee, 0xa4ee, 0xc6bd, 0xc6c4, 0xa4ee, 0xa4ee,
+	0xa4ee, 0xa4ee, 0x00f6, 0x080c, 0x6555, 0x11d8, 0x080c, 0xbdd7,
+	0x11c0, 0x6010, 0x905d, 0x01a8, 0xb884, 0x9005, 0x0190, 0x9006,
+	0x080c, 0x60a3, 0x2001, 0x0002, 0x080c, 0x60b7, 0x6023, 0x0001,
+	0x6003, 0x0001, 0x6007, 0x0002, 0x080c, 0x8335, 0x080c, 0x8793,
+	0x00d0, 0x2011, 0x0263, 0x2204, 0x8211, 0x220c, 0x080c, 0x23ef,
+	0x1190, 0x080c, 0x6166, 0x0118, 0x080c, 0x9a65, 0x0060, 0xb810,
+	0x0006, 0xb814, 0x0006, 0x080c, 0x5bfc, 0x000e, 0xb816, 0x000e,
+	0xb812, 0x080c, 0x9a65, 0x00fe, 0x0005, 0x6604, 0x96b6, 0x001e,
+	0x1110, 0x080c, 0x9a65, 0x0005, 0x080c, 0xa8d2, 0x1148, 0x6003,
+	0x0001, 0x6007, 0x0001, 0x080c, 0x8335, 0x080c, 0x8793, 0x0010,
+	0x080c, 0x9a65, 0x0005, 0x6004, 0x908a, 0x0053, 0x1a0c, 0x0d65,
+	0x080c, 0x86d1, 0x080c, 0x9a9f, 0x0005, 0x9182, 0x0040, 0x0002,
+	0xc6f3, 0xc6f3, 0xc6f3, 0xc6f3, 0xc6f5, 0xc6f3, 0xc6f3, 0xc6f3,
+	0xc6f3, 0xc6f3, 0xc6f3, 0xc6f3, 0xc6f3, 0xc6f3, 0xc6f3, 0xc6f3,
+	0xc6f3, 0xc6f3, 0xc6f3, 0x080c, 0x0d65, 0x0096, 0x00b6, 0x00d6,
+	0x00e6, 0x00f6, 0x0046, 0x0026, 0x6210, 0x2258, 0xb8ac, 0x9005,
+	0x11b0, 0x6007, 0x0044, 0x2071, 0x0260, 0x7444, 0x94a4, 0xff00,
+	0x0904, 0xc75c, 0x080c, 0xd3d3, 0x1170, 0x9486, 0x2000, 0x1158,
+	0x2009, 0x0001, 0x2011, 0x0200, 0x080c, 0x8248, 0x0020, 0x9026,
+	0x080c, 0xd308, 0x0c30, 0x080c, 0x1023, 0x090c, 0x0d65, 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, 0x683f, 0x001e, 0x080c, 0xd3d3, 0x1904, 0xc7bc, 0x9486,
+	0x2000, 0x1130, 0x2019, 0x0017, 0x080c, 0xd046, 0x0804, 0xc7bc,
+	0x9486, 0x0200, 0x1120, 0x080c, 0xcfd6, 0x0804, 0xc7bc, 0x9486,
+	0x0400, 0x0120, 0x9486, 0x1000, 0x1904, 0xc7bc, 0x2019, 0x0002,
+	0x080c, 0xcff5, 0x0804, 0xc7bc, 0x2069, 0x1a3d, 0x6a00, 0xd284,
+	0x0904, 0xc826, 0x9284, 0x0300, 0x1904, 0xc81f, 0x6804, 0x9005,
+	0x0904, 0xc807, 0x2d78, 0x6003, 0x0007, 0x080c, 0x103c, 0x0904,
+	0xc7c8, 0x7800, 0xd08c, 0x1118, 0x7804, 0x8001, 0x7806, 0x6017,
+	0x0000, 0x2001, 0x180f, 0x2004, 0xd084, 0x1904, 0xc82a, 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, 0xc7c4, 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, 0x6842, 0x002e, 0x004e, 0x00fe, 0x00ee,
+	0x00de, 0x00be, 0x009e, 0x0005, 0x0000, 0x0080, 0x0040, 0x0000,
+	0x2001, 0x1810, 0x2004, 0xd084, 0x0120, 0x080c, 0x1023, 0x1904,
+	0xc771, 0x6017, 0xf100, 0x6003, 0x0001, 0x6007, 0x0041, 0x2009,
+	0xa022, 0x080c, 0x832e, 0x0c00, 0x2069, 0x0260, 0x6848, 0x9084,
+	0xff00, 0x9086, 0x1200, 0x1198, 0x686c, 0x9084, 0x00ff, 0x0016,
+	0x6114, 0x918c, 0xf700, 0x910d, 0x6116, 0x001e, 0x6003, 0x0001,
+	0x6007, 0x0043, 0x2009, 0xa025, 0x080c, 0x832e, 0x0828, 0x6868,
+	0x602e, 0x686c, 0x6032, 0x6017, 0xf200, 0x6003, 0x0001, 0x6007,
+	0x0041, 0x2009, 0xa022, 0x080c, 0x832e, 0x0804, 0xc7bc, 0x2001,
+	0x180e, 0x2004, 0xd0ec, 0x0120, 0x2011, 0x8049, 0x080c, 0x47fb,
+	0x6017, 0xf300, 0x0010, 0x6017, 0xf100, 0x6003, 0x0001, 0x6007,
+	0x0041, 0x2009, 0xa022, 0x080c, 0x832e, 0x0804, 0xc7bc, 0x6017,
+	0xf500, 0x0c98, 0x6017, 0xf600, 0x0804, 0xc7dc, 0x6017, 0xf200,
+	0x0804, 0xc7dc, 0xa867, 0x0146, 0xa86b, 0x0000, 0x6008, 0xa886,
+	0x2c00, 0xa87a, 0x7044, 0x9084, 0x0003, 0x9080, 0xc7c4, 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, 0x0d65, 0x8210, 0x821c, 0x2001, 0x026c, 0x2098, 0xa860,
+	0x20e8, 0xa85c, 0x9080, 0x0029, 0x20a0, 0x2011, 0xc8a6, 0x2041,
+	0x0001, 0x223d, 0x9784, 0x00ff, 0x9322, 0x1208, 0x2300, 0x20a8,
+	0x4003, 0x931a, 0x0530, 0x8210, 0xd7fc, 0x1130, 0x8d68, 0x2d0a,
+	0x2001, 0x0260, 0x2098, 0x0c68, 0x2950, 0x080c, 0x103c, 0x0170,
+	0x2900, 0xb002, 0xa867, 0x0147, 0xa86b, 0x0000, 0xa860, 0x20e8,
+	0xa85c, 0x9080, 0x001b, 0x20a0, 0x8840, 0x08d8, 0x2548, 0xa800,
+	0x902d, 0x0118, 0x080c, 0x1055, 0x0cc8, 0x080c, 0x1055, 0x0804,
+	0xc7c8, 0x2548, 0x8847, 0x9885, 0x0046, 0xa866, 0x2009, 0x0205,
+	0x200b, 0x0000, 0x080c, 0xd079, 0x0804, 0xc7bc, 0x8010, 0x0004,
+	0x801a, 0x0006, 0x8018, 0x0008, 0x8016, 0x000a, 0x8014, 0x9186,
+	0x0013, 0x1160, 0x6004, 0x908a, 0x0057, 0x1a0c, 0x0d65, 0x9082,
+	0x0040, 0x0a0c, 0x0d65, 0x2008, 0x0804, 0xc931, 0x9186, 0x0051,
+	0x0108, 0x0040, 0x080c, 0x9935, 0x01e8, 0x9086, 0x0002, 0x0904,
+	0xc978, 0x00c0, 0x9186, 0x0027, 0x0180, 0x9186, 0x0048, 0x0128,
+	0x9186, 0x0014, 0x0150, 0x190c, 0x0d65, 0x080c, 0x9935, 0x0150,
+	0x9086, 0x0004, 0x0904, 0xca15, 0x0028, 0x6004, 0x9082, 0x0040,
+	0x2008, 0x001a, 0x080c, 0x9b20, 0x0005, 0xc8f8, 0xc8fa, 0xc8fa,
+	0xc921, 0xc8f8, 0xc8f8, 0xc8f8, 0xc8f8, 0xc8f8, 0xc8f8, 0xc8f8,
+	0xc8f8, 0xc8f8, 0xc8f8, 0xc8f8, 0xc8f8, 0xc8f8, 0xc8f8, 0xc8f8,
+	0x080c, 0x0d65, 0x080c, 0x86d1, 0x080c, 0x8793, 0x0036, 0x0096,
+	0x6014, 0x904d, 0x01d8, 0x080c, 0xb6c5, 0x01c0, 0x6003, 0x0002,
+	0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x1178, 0x2019,
+	0x0004, 0x080c, 0xd079, 0x6017, 0x0000, 0x6018, 0x9005, 0x1120,
+	0x2001, 0x1956, 0x2004, 0x601a, 0x6003, 0x0007, 0x009e, 0x003e,
+	0x0005, 0x0096, 0x080c, 0x86d1, 0x080c, 0x8793, 0x080c, 0xb6c5,
+	0x0120, 0x6014, 0x2048, 0x080c, 0x1055, 0x080c, 0x9a9f, 0x009e,
+	0x0005, 0x0002, 0xc945, 0xc95a, 0xc947, 0xc96f, 0xc945, 0xc945,
+	0xc945, 0xc945, 0xc945, 0xc945, 0xc945, 0xc945, 0xc945, 0xc945,
+	0xc945, 0xc945, 0xc945, 0xc945, 0xc945, 0x080c, 0x0d65, 0x0096,
+	0x6014, 0x2048, 0xa87c, 0xd0b4, 0x0138, 0x6003, 0x0007, 0x2009,
+	0x0043, 0x080c, 0x9b03, 0x0010, 0x6003, 0x0004, 0x080c, 0x8793,
+	0x009e, 0x0005, 0x080c, 0xb6c5, 0x0138, 0x6114, 0x0096, 0x2148,
+	0xa97c, 0x009e, 0xd1ec, 0x1138, 0x080c, 0x821d, 0x080c, 0x9a65,
+	0x080c, 0x8793, 0x0005, 0x080c, 0xd2cc, 0x0db0, 0x0cc8, 0x6003,
+	0x0001, 0x6007, 0x0041, 0x2009, 0xa022, 0x080c, 0x832e, 0x0005,
+	0x9182, 0x0040, 0x0002, 0xc98e, 0xc990, 0xc98e, 0xc98e, 0xc98e,
+	0xc98e, 0xc98e, 0xc98e, 0xc98e, 0xc98e, 0xc98e, 0xc98e, 0xc98e,
+	0xc98e, 0xc98e, 0xc98e, 0xc98e, 0xc991, 0xc98e, 0x080c, 0x0d65,
+	0x0005, 0x00d6, 0x080c, 0x821d, 0x00de, 0x080c, 0xd324, 0x080c,
+	0x9a65, 0x0005, 0x9182, 0x0040, 0x0002, 0xc9b0, 0xc9b0, 0xc9b0,
+	0xc9b0, 0xc9b0, 0xc9b0, 0xc9b0, 0xc9b0, 0xc9b0, 0xc9b2, 0xc9dd,
+	0xc9b0, 0xc9b0, 0xc9b0, 0xc9b0, 0xc9dd, 0xc9b0, 0xc9b0, 0xc9b0,
+	0x080c, 0x0d65, 0x6014, 0x0096, 0x2048, 0xa87c, 0xd0fc, 0x0168,
+	0x908c, 0x0003, 0x918e, 0x0002, 0x0180, 0x6144, 0xd1e4, 0x1168,
+	0x2009, 0x0041, 0x009e, 0x0804, 0xca9d, 0x6003, 0x0007, 0x601b,
+	0x0000, 0x080c, 0x821d, 0x009e, 0x0005, 0x6014, 0x2048, 0xa97c,
+	0xd1ec, 0x1130, 0x080c, 0x821d, 0x080c, 0x9a65, 0x009e, 0x0005,
+	0x080c, 0xd2cc, 0x0db8, 0x009e, 0x0005, 0x2001, 0x180c, 0x200c,
+	0xc1d4, 0x2102, 0x0036, 0x080c, 0x872e, 0x080c, 0x8793, 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, 0xd079, 0x6018, 0x9005,
+	0x1128, 0x2001, 0x1956, 0x2004, 0x8003, 0x601a, 0x6017, 0x0000,
+	0x6003, 0x0007, 0x009e, 0x003e, 0x0005, 0x9182, 0x0040, 0x0002,
+	0xca2c, 0xca2c, 0xca2c, 0xca2c, 0xca2c, 0xca2c, 0xca2c, 0xca2c,
+	0xca2e, 0xca2c, 0xca2c, 0xca2c, 0xca2c, 0xca2c, 0xca2c, 0xca2c,
+	0xca2c, 0xca2c, 0xca2c, 0xca79, 0x080c, 0x0d65, 0x6014, 0x0096,
+	0x2048, 0xa834, 0xaa38, 0x6110, 0x00b6, 0x2058, 0xb900, 0x00be,
+	0xd1bc, 0x1190, 0x920d, 0x1518, 0xa87c, 0xd0fc, 0x0128, 0x2009,
+	0x0041, 0x009e, 0x0804, 0xca9d, 0x6003, 0x0007, 0x601b, 0x0000,
+	0x080c, 0x821d, 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, 0x180e,
+	0x210c, 0xd19c, 0x0118, 0x6003, 0x0007, 0x0010, 0x6003, 0x0006,
+	0x00e9, 0x080c, 0x821f, 0x009e, 0x0005, 0x6003, 0x0002, 0x009e,
+	0x0005, 0x6024, 0xd0f4, 0x0128, 0x080c, 0x158c, 0x1904, 0xca2e,
+	0x0005, 0x6014, 0x0096, 0x2048, 0xa834, 0xa938, 0x009e, 0x9105,
+	0x1120, 0x080c, 0x158c, 0x1904, 0xca2e, 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, 0x0d65,
+	0x6024, 0xd0dc, 0x090c, 0x0d65, 0x0005, 0xcac0, 0xcacc, 0xcad8,
+	0xcae4, 0xcac0, 0xcac0, 0xcac0, 0xcac0, 0xcac7, 0xcac2, 0xcac2,
+	0xcac0, 0xcac0, 0xcac0, 0xcac0, 0xcac2, 0xcac0, 0xcac2, 0xcac0,
+	0x080c, 0x0d65, 0x6024, 0xd0dc, 0x090c, 0x0d65, 0x0005, 0x6014,
+	0x9005, 0x190c, 0x0d65, 0x0005, 0x6003, 0x0001, 0x6106, 0x0126,
+	0x2091, 0x8000, 0x2009, 0xa022, 0x080c, 0x8310, 0x012e, 0x0005,
+	0x6003, 0x0004, 0x6106, 0x0126, 0x2091, 0x8000, 0x2009, 0xa001,
+	0x080c, 0x832e, 0x012e, 0x0005, 0x6003, 0x0003, 0x6106, 0x080c,
+	0x1a79, 0x0126, 0x2091, 0x8000, 0x6014, 0x0096, 0x2048, 0xa87c,
+	0x9084, 0x0003, 0x9086, 0x0002, 0x0198, 0x6024, 0xd0cc, 0x1148,
+	0xd0c4, 0x1138, 0xa8a8, 0x2004, 0x9005, 0x1118, 0x2009, 0xb035,
+	0x0010, 0x2009, 0xa035, 0x009e, 0x080c, 0x8375, 0x012e, 0x0005,
+	0x2009, 0xa032, 0x0cc0, 0x0126, 0x2091, 0x8000, 0x0036, 0x0096,
+	0x9182, 0x0040, 0x0023, 0x009e, 0x003e, 0x012e, 0x0005, 0xcb27,
+	0xcb29, 0xcb3e, 0xcb58, 0xcb27, 0xcb27, 0xcb27, 0xcb27, 0xcb27,
+	0xcb27, 0xcb27, 0xcb27, 0xcb27, 0xcb27, 0xcb27, 0xcb27, 0x080c,
+	0x0d65, 0x6014, 0x2048, 0xa87c, 0xd0fc, 0x0510, 0x909c, 0x0003,
+	0x939e, 0x0003, 0x01e8, 0x6003, 0x0001, 0x6106, 0x0126, 0x2091,
+	0x8000, 0x2009, 0xa022, 0x080c, 0x832e, 0x0468, 0x6014, 0x2048,
+	0xa87c, 0xd0fc, 0x0168, 0x909c, 0x0003, 0x939e, 0x0003, 0x0140,
+	0x6003, 0x0001, 0x6106, 0x2009, 0xa001, 0x080c, 0x832e, 0x00d8,
+	0x901e, 0x6316, 0x631a, 0x2019, 0x0004, 0x080c, 0xd079, 0x0098,
+	0x6014, 0x2048, 0xa87c, 0xd0fc, 0x0d98, 0x909c, 0x0003, 0x939e,
+	0x0003, 0x0d70, 0x6003, 0x0003, 0x6106, 0x080c, 0x1a79, 0x2009,
+	0xa035, 0x080c, 0x8375, 0x0005, 0x080c, 0x86d1, 0x6114, 0x81ff,
+	0x0158, 0x0096, 0x2148, 0x080c, 0xd370, 0x0036, 0x2019, 0x0029,
+	0x080c, 0xd079, 0x003e, 0x009e, 0x080c, 0x9a9f, 0x080c, 0x8793,
+	0x0005, 0x080c, 0x872e, 0x6114, 0x81ff, 0x0158, 0x0096, 0x2148,
+	0x080c, 0xd370, 0x0036, 0x2019, 0x0029, 0x080c, 0xd079, 0x003e,
+	0x009e, 0x080c, 0x9a9f, 0x0005, 0x9182, 0x0085, 0x0002, 0xcba6,
+	0xcba4, 0xcba4, 0xcbb2, 0xcba4, 0xcba4, 0xcba4, 0xcba4, 0xcba4,
+	0xcba4, 0xcba4, 0xcba4, 0xcba4, 0x080c, 0x0d65, 0x6003, 0x000b,
+	0x6106, 0x0126, 0x2091, 0x8000, 0x2009, 0x8020, 0x080c, 0x832e,
+	0x012e, 0x0005, 0x0026, 0x00e6, 0x080c, 0xd2c3, 0x0118, 0x080c,
+	0x9a65, 0x0440, 0x2071, 0x0260, 0x7224, 0x6216, 0x2001, 0x180e,
+	0x2004, 0xd0e4, 0x0150, 0x6010, 0x00b6, 0x2058, 0xbca0, 0x00be,
+	0x2c00, 0x2011, 0x014e, 0x080c, 0x9d91, 0x7220, 0x080c, 0xcf0f,
+	0x0118, 0x6007, 0x0086, 0x0040, 0x6007, 0x0087, 0x7224, 0x9296,
+	0xffff, 0x1110, 0x6007, 0x0086, 0x6003, 0x0001, 0x2009, 0x8020,
+	0x080c, 0x832e, 0x00ee, 0x002e, 0x0005, 0x9186, 0x0013, 0x1160,
+	0x6004, 0x908a, 0x0085, 0x0a0c, 0x0d65, 0x908a, 0x0092, 0x1a0c,
+	0x0d65, 0x9082, 0x0085, 0x00a2, 0x9186, 0x0027, 0x0130, 0x9186,
+	0x0014, 0x0118, 0x080c, 0x9b20, 0x0050, 0x2001, 0x0007, 0x080c,
+	0x60e3, 0x080c, 0x86d1, 0x080c, 0x9a9f, 0x080c, 0x8793, 0x0005,
+	0xcc15, 0xcc17, 0xcc17, 0xcc15, 0xcc15, 0xcc15, 0xcc15, 0xcc15,
+	0xcc15, 0xcc15, 0xcc15, 0xcc15, 0xcc15, 0x080c, 0x0d65, 0x080c,
+	0x9a9f, 0x080c, 0x8793, 0x0005, 0x9182, 0x0085, 0x0a0c, 0x0d65,
+	0x9182, 0x0092, 0x1a0c, 0x0d65, 0x9182, 0x0085, 0x0002, 0xcc34,
+	0xcc34, 0xcc34, 0xcc36, 0xcc34, 0xcc34, 0xcc34, 0xcc34, 0xcc34,
+	0xcc34, 0xcc34, 0xcc34, 0xcc34, 0x080c, 0x0d65, 0x0005, 0x9186,
+	0x0013, 0x0148, 0x9186, 0x0014, 0x0130, 0x9186, 0x0027, 0x0118,
+	0x080c, 0x9b20, 0x0020, 0x080c, 0x86d1, 0x080c, 0x9a9f, 0x0005,
+	0x0036, 0x080c, 0xd324, 0x604b, 0x0000, 0x2019, 0x000b, 0x0031,
+	0x6023, 0x0006, 0x6003, 0x0007, 0x003e, 0x0005, 0x0126, 0x0036,
+	0x2091, 0x8000, 0x2001, 0x0382, 0x2004, 0x9084, 0x0007, 0x0006,
+	0x9086, 0x0003, 0x0110, 0x080c, 0x9746, 0x0086, 0x2c40, 0x0096,
+	0x904e, 0x080c, 0x9200, 0x009e, 0x008e, 0x1550, 0x0076, 0x2c38,
+	0x080c, 0x92ab, 0x007e, 0x1520, 0x6000, 0x9086, 0x0000, 0x0500,
+	0x6020, 0x9086, 0x0007, 0x01e0, 0x0096, 0x601c, 0xd084, 0x0140,
+	0x080c, 0xd324, 0x080c, 0xbdef, 0x080c, 0x18f4, 0x6023, 0x0007,
+	0x6014, 0x2048, 0x080c, 0xb6c5, 0x0110, 0x080c, 0xd079, 0x009e,
+	0x6017, 0x0000, 0x080c, 0xd324, 0x6023, 0x0007, 0x080c, 0xbdef,
+	0x000e, 0x9086, 0x0003, 0x0110, 0x080c, 0x9762, 0x003e, 0x012e,
+	0x0005, 0x00f6, 0x00c6, 0x00b6, 0x0036, 0x0156, 0x2079, 0x0260,
+	0x7938, 0x783c, 0x080c, 0x23ef, 0x15d8, 0x0016, 0x00c6, 0x080c,
+	0x6166, 0x15a0, 0x001e, 0x00c6, 0x2160, 0x080c, 0xbdec, 0x00ce,
+	0x002e, 0x0026, 0x0016, 0x080c, 0x9746, 0x2019, 0x0029, 0x080c,
+	0x9372, 0x080c, 0x8498, 0x0076, 0x903e, 0x080c, 0x8387, 0x007e,
+	0x001e, 0x0076, 0x903e, 0x080c, 0xce23, 0x007e, 0x080c, 0x9762,
+	0x0026, 0xba04, 0x9294, 0xff00, 0x8217, 0x9286, 0x0006, 0x0118,
+	0x9286, 0x0004, 0x1118, 0xbaa0, 0x080c, 0x3093, 0x002e, 0x001e,
+	0x080c, 0x5bfc, 0xbe12, 0xbd16, 0x9006, 0x0010, 0x00ce, 0x001e,
+	0x015e, 0x003e, 0x00be, 0x00ce, 0x00fe, 0x0005, 0x00c6, 0x00d6,
+	0x00b6, 0x0016, 0x2009, 0x1823, 0x2104, 0x9086, 0x0074, 0x1904,
+	0xcd47, 0x2069, 0x0260, 0x6944, 0x9182, 0x0100, 0x06e0, 0x6940,
+	0x9184, 0x8000, 0x0904, 0xcd44, 0x2001, 0x194d, 0x2004, 0x9005,
+	0x1140, 0x6010, 0x2058, 0xb884, 0x9005, 0x0118, 0x9184, 0x0800,
+	0x0598, 0x6948, 0x918a, 0x0001, 0x0648, 0x080c, 0xd3d8, 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, 0x6175, 0x0804, 0xcdb2, 0x2011,
+	0x0276, 0x20a9, 0x0004, 0x0096, 0x2b48, 0x2019, 0x000a, 0x080c,
+	0xaa5d, 0x009e, 0x15c0, 0x2011, 0x027a, 0x20a9, 0x0004, 0x0096,
+	0x2b48, 0x2019, 0x0006, 0x080c, 0xaa5d, 0x009e, 0x1560, 0x0046,
+	0x0016, 0xbaa0, 0x2220, 0x9006, 0x2009, 0x1854, 0x210c, 0x0038,
+	0x2009, 0x0029, 0x080c, 0xd0ce, 0xb800, 0xc0e5, 0xb802, 0x080c,
+	0x9746, 0x2019, 0x0029, 0x080c, 0x8498, 0x0076, 0x2039, 0x0000,
+	0x080c, 0x8387, 0x2c08, 0x080c, 0xce23, 0x007e, 0x080c, 0x9762,
+	0x2001, 0x0007, 0x080c, 0x60e3, 0x2001, 0x0007, 0x080c, 0x60b7,
+	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, 0x23ef, 0x11d0, 0x080c, 0x6166, 0x11b8, 0x2011, 0x0270,
+	0x20a9, 0x0004, 0x0096, 0x2b48, 0x2019, 0x000a, 0x080c, 0xaa5d,
+	0x009e, 0x1158, 0x2011, 0x0274, 0x20a9, 0x0004, 0x0096, 0x2b48,
+	0x2019, 0x0006, 0x080c, 0xaa5d, 0x009e, 0x015e, 0x003e, 0x002e,
+	0x001e, 0x00fe, 0x00be, 0x0005, 0x00b6, 0x0006, 0x0016, 0x0026,
+	0x0036, 0x0156, 0x2011, 0x0263, 0x2204, 0x8211, 0x220c, 0x080c,
+	0x23ef, 0x11d0, 0x080c, 0x6166, 0x11b8, 0x2011, 0x0276, 0x20a9,
+	0x0004, 0x0096, 0x2b48, 0x2019, 0x000a, 0x080c, 0xaa5d, 0x009e,
+	0x1158, 0x2011, 0x027a, 0x20a9, 0x0004, 0x0096, 0x2b48, 0x2019,
+	0x0006, 0x080c, 0xaa5d, 0x009e, 0x015e, 0x003e, 0x002e, 0x001e,
+	0x000e, 0x00be, 0x0005, 0x00e6, 0x00c6, 0x0086, 0x0076, 0x0066,
+	0x0056, 0x0046, 0x0026, 0x0126, 0x2091, 0x8000, 0x080c, 0x97a4,
+	0x0106, 0x190c, 0x9746, 0x2740, 0x2029, 0x19c2, 0x252c, 0x2021,
+	0x19c9, 0x2424, 0x2061, 0x1ddc, 0x2071, 0x1800, 0x7650, 0x7070,
+	0x81ff, 0x0150, 0x0006, 0x9186, 0x1b00, 0x000e, 0x0128, 0x8001,
+	0x9602, 0x1a04, 0xcec4, 0x0018, 0x9606, 0x0904, 0xcec4, 0x2100,
+	0x9c06, 0x0904, 0xcebb, 0x080c, 0xd10a, 0x1904, 0xcebb, 0x080c,
+	0xd3f5, 0x0904, 0xcebb, 0x080c, 0xd0fa, 0x0904, 0xcebb, 0x6720,
+	0x9786, 0x0001, 0x1148, 0x080c, 0x3138, 0x0904, 0xcee3, 0x6004,
+	0x9086, 0x0000, 0x1904, 0xcee3, 0x9786, 0x0004, 0x0904, 0xcee3,
+	0x9786, 0x0007, 0x0904, 0xcebb, 0x2500, 0x9c06, 0x0904, 0xcebb,
+	0x2400, 0x9c06, 0x0904, 0xcebb, 0x88ff, 0x0118, 0x605c, 0x9906,
+	0x15d0, 0x0096, 0x6043, 0xffff, 0x6000, 0x9086, 0x0004, 0x1120,
+	0x0016, 0x080c, 0x18f4, 0x001e, 0x9786, 0x000a, 0x0148, 0x080c,
+	0xb8d3, 0x1130, 0x080c, 0xa40d, 0x009e, 0x080c, 0x9a9f, 0x0418,
+	0x6014, 0x2048, 0x080c, 0xb6c5, 0x01d8, 0x9786, 0x0003, 0x1588,
+	0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0xa87c, 0xd0cc, 0x0130,
+	0x0096, 0xa878, 0x2048, 0x080c, 0x0fd5, 0x009e, 0x080c, 0xd370,
+	0x0016, 0x080c, 0xb9bc, 0x080c, 0x6833, 0x001e, 0x080c, 0xb8ad,
+	0x009e, 0x080c, 0x9a9f, 0x9ce0, 0x001c, 0x2001, 0x1819, 0x2004,
+	0x9c02, 0x1210, 0x0804, 0xce3c, 0x010e, 0x190c, 0x9762, 0x012e,
+	0x002e, 0x004e, 0x005e, 0x006e, 0x007e, 0x008e, 0x00ce, 0x00ee,
+	0x0005, 0x9786, 0x0006, 0x1150, 0x9386, 0x0005, 0x0128, 0x080c,
+	0xd370, 0x080c, 0xd079, 0x08e0, 0x009e, 0x08e8, 0x9786, 0x000a,
+	0x0908, 0x0804, 0xcea0, 0x81ff, 0x09b0, 0x9180, 0x0001, 0x2004,
+	0x9086, 0x0018, 0x0130, 0x9180, 0x0001, 0x2004, 0x9086, 0x002d,
+	0x1950, 0x6000, 0x9086, 0x0002, 0x1930, 0x080c, 0xb8c2, 0x0130,
+	0x080c, 0xb8d3, 0x1900, 0x080c, 0xa40d, 0x0038, 0x080c, 0x2ff2,
+	0x080c, 0xb8d3, 0x1110, 0x080c, 0xa40d, 0x080c, 0x9a9f, 0x0804,
+	0xcebb, 0xa864, 0x9084, 0x00ff, 0x9086, 0x0039, 0x0005, 0x00c6,
+	0x00e6, 0x0016, 0x2c08, 0x2170, 0x9006, 0x080c, 0xd0a0, 0x001e,
+	0x0120, 0x6020, 0x9084, 0x000f, 0x001b, 0x00ee, 0x00ce, 0x0005,
+	0xcf2e, 0xcf2e, 0xcf2e, 0xcf2e, 0xcf2e, 0xcf2e, 0xcf30, 0xcf2e,
+	0xcf2e, 0xcf2e, 0xcf2e, 0x9a9f, 0x9a9f, 0xcf2e, 0x9006, 0x0005,
+	0x0036, 0x0046, 0x0016, 0x7010, 0x00b6, 0x2058, 0xbca0, 0x00be,
+	0x2c00, 0x2009, 0x0020, 0x080c, 0xd0ce, 0x001e, 0x004e, 0x2019,
+	0x0002, 0x080c, 0xcc56, 0x003e, 0x9085, 0x0001, 0x0005, 0x0096,
+	0x080c, 0xb6c5, 0x0140, 0x6014, 0x904d, 0x080c, 0xb2d0, 0x687b,
+	0x0005, 0x080c, 0x683f, 0x009e, 0x080c, 0x9a9f, 0x9085, 0x0001,
+	0x0005, 0x2001, 0x0001, 0x080c, 0x60a3, 0x0156, 0x0016, 0x0026,
+	0x0036, 0x20a9, 0x0004, 0x2019, 0x1805, 0x2011, 0x0276, 0x080c,
+	0xaa49, 0x003e, 0x002e, 0x001e, 0x015e, 0x9005, 0x0005, 0x00f6,
+	0x00e6, 0x00c6, 0x0086, 0x0076, 0x0066, 0x00b6, 0x0126, 0x2091,
+	0x8000, 0x2740, 0x2061, 0x1ddc, 0x2079, 0x0001, 0x8fff, 0x0904,
+	0xcfc9, 0x2071, 0x1800, 0x7650, 0x7070, 0x8001, 0x9602, 0x1a04,
+	0xcfc9, 0x88ff, 0x0120, 0x2800, 0x9c06, 0x1590, 0x2078, 0x080c,
+	0xd0fa, 0x0570, 0x2400, 0x9c06, 0x0558, 0x6720, 0x9786, 0x0006,
+	0x1538, 0x9786, 0x0007, 0x0520, 0x88ff, 0x1140, 0x6010, 0x9b06,
+	0x11f8, 0x85ff, 0x0118, 0x605c, 0x9106, 0x11d0, 0x0096, 0x601c,
+	0xd084, 0x0140, 0x080c, 0xd324, 0x080c, 0xbdef, 0x080c, 0x18f4,
+	0x6023, 0x0007, 0x6014, 0x2048, 0x080c, 0xb6c5, 0x0120, 0x0046,
+	0x080c, 0xd079, 0x004e, 0x009e, 0x080c, 0x9a9f, 0x88ff, 0x1198,
+	0x9ce0, 0x001c, 0x2001, 0x1819, 0x2004, 0x9c02, 0x1210, 0x0804,
+	0xcf7e, 0x9006, 0x012e, 0x00be, 0x006e, 0x007e, 0x008e, 0x00ce,
+	0x00ee, 0x00fe, 0x0005, 0x98c5, 0x0001, 0x0ca0, 0x080c, 0x9746,
+	0x00b6, 0x0076, 0x0056, 0x0086, 0x9046, 0x2029, 0x0001, 0x2c20,
+	0x2019, 0x0002, 0x6210, 0x2258, 0x0096, 0x904e, 0x080c, 0x9200,
+	0x009e, 0x008e, 0x903e, 0x080c, 0x92ab, 0x080c, 0xcf6f, 0x005e,
+	0x007e, 0x00be, 0x080c, 0x9762, 0x0005, 0x080c, 0x9746, 0x00b6,
+	0x0046, 0x0056, 0x0076, 0x00c6, 0x0156, 0x2c20, 0x2128, 0x20a9,
+	0x007f, 0x900e, 0x0016, 0x0036, 0x080c, 0x6166, 0x1190, 0x0056,
+	0x0086, 0x9046, 0x2508, 0x2029, 0x0001, 0x0096, 0x904e, 0x080c,
+	0x9200, 0x009e, 0x008e, 0x903e, 0x080c, 0x92ab, 0x080c, 0xcf6f,
+	0x005e, 0x003e, 0x001e, 0x8108, 0x1f04, 0xd002, 0x015e, 0x00ce,
+	0x007e, 0x005e, 0x004e, 0x00be, 0x080c, 0x9762, 0x0005, 0x080c,
+	0x9746, 0x00b6, 0x0076, 0x0056, 0x6210, 0x2258, 0x0086, 0x9046,
+	0x2029, 0x0001, 0x2019, 0x0048, 0x0096, 0x904e, 0x080c, 0x9200,
+	0x009e, 0x008e, 0x903e, 0x080c, 0x92ab, 0x2c20, 0x080c, 0xcf6f,
+	0x005e, 0x007e, 0x00be, 0x080c, 0x9762, 0x0005, 0x080c, 0x9746,
+	0x00b6, 0x0046, 0x0056, 0x0076, 0x00c6, 0x0156, 0x2c20, 0x20a9,
+	0x0800, 0x900e, 0x0016, 0x0036, 0x080c, 0x6166, 0x11a0, 0x0086,
+	0x9046, 0x2828, 0x0046, 0x2021, 0x0001, 0x080c, 0xd308, 0x004e,
+	0x0096, 0x904e, 0x080c, 0x9200, 0x009e, 0x008e, 0x903e, 0x080c,
+	0x92ab, 0x080c, 0xcf6f, 0x003e, 0x001e, 0x8108, 0x1f04, 0xd052,
+	0x015e, 0x00ce, 0x007e, 0x005e, 0x004e, 0x00be, 0x080c, 0x9762,
+	0x0005, 0x0016, 0x00f6, 0x080c, 0xb6c3, 0x0198, 0xa864, 0x9084,
+	0x00ff, 0x9086, 0x0046, 0x0180, 0xa800, 0x907d, 0x0138, 0xa803,
+	0x0000, 0xab82, 0x080c, 0x683f, 0x2f48, 0x0cb0, 0xab82, 0x080c,
+	0x683f, 0x00fe, 0x001e, 0x0005, 0xa800, 0x907d, 0x0130, 0xa803,
+	0x0000, 0x080c, 0x683f, 0x2f48, 0x0cb8, 0x080c, 0x683f, 0x0c88,
+	0x00e6, 0x0046, 0x0036, 0x2061, 0x1ddc, 0x9005, 0x1138, 0x2071,
+	0x1800, 0x7450, 0x7070, 0x8001, 0x9402, 0x12d8, 0x2100, 0x9c06,
+	0x0168, 0x6000, 0x9086, 0x0000, 0x0148, 0x6008, 0x9206, 0x1130,
+	0x6010, 0x91a0, 0x0004, 0x2424, 0x9406, 0x0140, 0x9ce0, 0x001c,
+	0x2001, 0x1819, 0x2004, 0x9c02, 0x1220, 0x0c40, 0x9085, 0x0001,
+	0x0008, 0x9006, 0x003e, 0x004e, 0x00ee, 0x0005, 0x0096, 0x0006,
+	0x080c, 0x1023, 0x000e, 0x090c, 0x0d65, 0xa867, 0x010d, 0xa88e,
+	0x0026, 0x2010, 0x080c, 0xb6b3, 0x2001, 0x0000, 0x0120, 0x2200,
+	0x9080, 0x0017, 0x2004, 0x002e, 0xa87a, 0xa986, 0xac76, 0xa87f,
+	0x0000, 0x2001, 0x195d, 0x2004, 0xa882, 0x9006, 0xa8e2, 0xa802,
+	0xa86a, 0xa88a, 0x0126, 0x2091, 0x8000, 0x080c, 0x683f, 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, 0x2009, 0x8020, 0x080c,
+	0x832e, 0x001e, 0x0005, 0xa001, 0xa001, 0x0005, 0x6024, 0xd0e4,
+	0x0158, 0xd0cc, 0x0118, 0x080c, 0xba03, 0x0030, 0x080c, 0xd324,
+	0x080c, 0x821d, 0x080c, 0x9a65, 0x0005, 0x9280, 0x0008, 0x2004,
+	0x9084, 0x000f, 0x0002, 0xd159, 0xd159, 0xd159, 0xd15b, 0xd159,
+	0xd15b, 0xd15b, 0xd159, 0xd15b, 0xd159, 0xd159, 0xd159, 0xd159,
+	0xd159, 0x9006, 0x0005, 0x9085, 0x0001, 0x0005, 0x9280, 0x0008,
+	0x2004, 0x9084, 0x000f, 0x0002, 0xd172, 0xd172, 0xd172, 0xd172,
+	0xd172, 0xd172, 0xd17f, 0xd172, 0xd172, 0xd172, 0xd172, 0xd172,
+	0xd172, 0xd172, 0x6007, 0x003b, 0x602f, 0x0009, 0x6017, 0x2a00,
+	0x6003, 0x0001, 0x2009, 0x8020, 0x080c, 0x832e, 0x0005, 0x0096,
+	0x00c6, 0x2260, 0x080c, 0xd324, 0x604b, 0x0000, 0x6024, 0xc0f4,
+	0xc0e4, 0x6026, 0x603b, 0x0000, 0x00ce, 0x00d6, 0x2268, 0x9186,
+	0x0007, 0x1904, 0xd1d8, 0x6814, 0x9005, 0x0138, 0x2048, 0xa87c,
+	0xd0fc, 0x1118, 0x00de, 0x009e, 0x08a8, 0x6007, 0x003a, 0x6003,
+	0x0001, 0x2009, 0x8020, 0x080c, 0x832e, 0x00c6, 0x2d60, 0x6100,
+	0x9186, 0x0002, 0x1904, 0xd24f, 0x6014, 0x9005, 0x1138, 0x6000,
+	0x9086, 0x0007, 0x190c, 0x0d65, 0x0804, 0xd24f, 0x2048, 0x080c,
+	0xb6c5, 0x1130, 0x0028, 0x2048, 0xa800, 0x9005, 0x1de0, 0x2900,
+	0x2048, 0xa87c, 0x9084, 0x0003, 0x9086, 0x0002, 0x1168, 0xa87c,
+	0xc0dc, 0xc0f4, 0xa87e, 0xa880, 0xc0fc, 0xa882, 0x2009, 0x0043,
+	0x080c, 0xca9d, 0x0804, 0xd24f, 0x2009, 0x0041, 0x0804, 0xd249,
+	0x9186, 0x0005, 0x15a0, 0x6814, 0x2048, 0xa87c, 0xd0bc, 0x1120,
+	0x00de, 0x009e, 0x0804, 0xd172, 0xd0b4, 0x0128, 0xd0fc, 0x090c,
+	0x0d65, 0x0804, 0xd193, 0x6007, 0x003a, 0x6003, 0x0001, 0x2009,
+	0x8020, 0x080c, 0x832e, 0x00c6, 0x2d60, 0x6100, 0x9186, 0x0002,
+	0x0120, 0x9186, 0x0004, 0x1904, 0xd24f, 0x6814, 0x2048, 0xa97c,
+	0xc1f4, 0xc1dc, 0xa97e, 0xa980, 0xc1fc, 0xc1bc, 0xa982, 0x00f6,
+	0x2c78, 0x080c, 0x1646, 0x00fe, 0x2009, 0x0042, 0x04d0, 0x0036,
+	0x080c, 0x1023, 0x090c, 0x0d65, 0xa867, 0x010d, 0x9006, 0xa802,
+	0xa86a, 0xa88a, 0x2d18, 0xab8e, 0xa887, 0x0045, 0x2c00, 0xa892,
+	0x6038, 0xa8a2, 0x2360, 0x6024, 0xc0dd, 0x6026, 0x6010, 0x00b6,
+	0x2058, 0xb8a0, 0x00be, 0x2004, 0x635c, 0xab7a, 0xa876, 0x9006,
+	0xa87e, 0xa882, 0xad9a, 0xae96, 0xa89f, 0x0001, 0x080c, 0x683f,
+	0x2019, 0x0045, 0x6008, 0x2068, 0x080c, 0xcc56, 0x2d00, 0x600a,
+	0x6023, 0x0006, 0x6003, 0x0007, 0x901e, 0x631a, 0x634a, 0x003e,
+	0x0038, 0x604b, 0x0000, 0x6003, 0x0007, 0x080c, 0xca9d, 0x00ce,
+	0x00de, 0x009e, 0x0005, 0x9186, 0x0013, 0x1128, 0x6004, 0x9082,
+	0x0085, 0x2008, 0x00c2, 0x9186, 0x0027, 0x1178, 0x080c, 0x86d1,
+	0x0036, 0x0096, 0x6014, 0x2048, 0x2019, 0x0004, 0x080c, 0xd079,
+	0x009e, 0x003e, 0x080c, 0x8793, 0x0005, 0x9186, 0x0014, 0x0d70,
+	0x080c, 0x9b20, 0x0005, 0xd282, 0xd280, 0xd280, 0xd280, 0xd280,
+	0xd280, 0xd282, 0xd280, 0xd280, 0xd280, 0xd280, 0xd280, 0xd280,
+	0x080c, 0x0d65, 0x6003, 0x000c, 0x080c, 0x8793, 0x0005, 0x9182,
+	0x0092, 0x1220, 0x9182, 0x0085, 0x0208, 0x001a, 0x080c, 0x9b20,
+	0x0005, 0xd29e, 0xd29e, 0xd29e, 0xd29e, 0xd2a0, 0xd2c0, 0xd29e,
+	0xd29e, 0xd29e, 0xd29e, 0xd29e, 0xd29e, 0xd29e, 0x080c, 0x0d65,
+	0x00d6, 0x2c68, 0x080c, 0x9a0f, 0x01b0, 0x6003, 0x0001, 0x6007,
+	0x001e, 0x2009, 0x026e, 0x210c, 0x613a, 0x2009, 0x026f, 0x210c,
+	0x613e, 0x600b, 0xffff, 0x6910, 0x6112, 0x6023, 0x0004, 0x2009,
+	0x8020, 0x080c, 0x832e, 0x2d60, 0x080c, 0x9a65, 0x00de, 0x0005,
+	0x080c, 0x9a65, 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, 0x604a, 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, 0x604a, 0x6010, 0x00b6,
+	0x2058, 0xb8ac, 0x00be, 0x0008, 0x2104, 0x9005, 0x0118, 0x9088,
+	0x0003, 0x0cd0, 0x2c0a, 0x600f, 0x0000, 0x9085, 0x0001, 0x0005,
+	0x0016, 0x00c6, 0x00e6, 0x615c, 0xb8ac, 0x2060, 0x8cff, 0x0180,
+	0x84ff, 0x1118, 0x605c, 0x9106, 0x1138, 0x600c, 0x2072, 0x080c,
+	0x821d, 0x080c, 0x9a65, 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, 0x182b, 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, 0xaa5d, 0x009e, 0x1168, 0x2011, 0x0274,
+	0x20a9, 0x0004, 0x6010, 0x0096, 0x2048, 0x2019, 0x0006, 0x080c,
+	0xaa5d, 0x009e, 0x1100, 0x015e, 0x003e, 0x002e, 0x0005, 0x00e6,
+	0x2071, 0x1800, 0x080c, 0x5b75, 0x080c, 0x2d99, 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, 0x19c2, 0x252c, 0x2021, 0x19c9,
+	0x2424, 0x2061, 0x1ddc, 0x2071, 0x1800, 0x7650, 0x7070, 0x9606,
+	0x0578, 0x6720, 0x9786, 0x0001, 0x0118, 0x9786, 0x0008, 0x1500,
+	0x2500, 0x9c06, 0x01e8, 0x2400, 0x9c06, 0x01d0, 0x080c, 0xd0fa,
+	0x01b8, 0x080c, 0xd10a, 0x11a0, 0x6000, 0x9086, 0x0004, 0x1120,
+	0x0016, 0x080c, 0x18f4, 0x001e, 0x080c, 0xb8c2, 0x1110, 0x080c,
+	0x2ff2, 0x080c, 0xb8d3, 0x1110, 0x080c, 0xa40d, 0x080c, 0x9a9f,
+	0x9ce0, 0x001c, 0x2001, 0x1819, 0x2004, 0x9c02, 0x1208, 0x0858,
+	0x012e, 0x001e, 0x002e, 0x004e, 0x005e, 0x006e, 0x007e, 0x00ce,
+	0x00de, 0x00ee, 0x0005, 0x2001, 0x1810, 0x2004, 0xd0dc, 0x0005,
+	0x0006, 0x2001, 0x1836, 0x2004, 0xd09c, 0x000e, 0x0005, 0x0006,
+	0x0036, 0x0046, 0x080c, 0xbdd7, 0x0168, 0x2019, 0xffff, 0x9005,
+	0x0128, 0x6010, 0x00b6, 0x2058, 0xbba0, 0x00be, 0x2021, 0x0004,
+	0x080c, 0x4998, 0x004e, 0x003e, 0x000e, 0x6004, 0x9086, 0x0001,
+	0x1128, 0x080c, 0x9372, 0x080c, 0x9a9f, 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, 0x0001, 0x0002,
+	0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080, 0x0100, 0x0200,
+	0x0400, 0x0800, 0x1000, 0x2000, 0x4000, 0x8000, 0x931a
+};
+#ifdef UNIQUE_FW_NAME
+unsigned short fw2322flx_length01 = 0xcc67;
+#else
+unsigned short risc_code_length01 = 0xcc67;
+#endif
+
+/*
+ *
+ */
+
+unsigned long rseqflx_code_addr01 = 0x0001c000 ;
+unsigned short rseqflx_code01[] = { 
+0x000b, 0x0003, 0x0000, 0x071c, 0x0001, 0xc000, 0x0008, 0x8064,
+	0x0000, 0x0010, 0x0000, 0x8066, 0x0008, 0x0101, 0x0003, 0xc007,
+	0x0008, 0x80e0, 0x0008, 0xff00, 0x0000, 0x80e2, 0x0008, 0xff00,
+	0x0008, 0x0162, 0x0000, 0x8066, 0x0008, 0xa101, 0x000b, 0xc00f,
+	0x0008, 0x0d02, 0x0000, 0x8060, 0x0000, 0x0400, 0x000b, 0x60af,
+	0x0003, 0x5817, 0x0003, 0x7ac6, 0x0003, 0x5209, 0x000b, 0xc813,
+	0x0009, 0xbac0, 0x0000, 0x008a, 0x0003, 0x8813, 0x0000, 0x15fc,
+	0x000b, 0xb013, 0x0009, 0xc4c0, 0x0000, 0x7000, 0x0001, 0xffa0,
+	0x0000, 0x2000, 0x000b, 0x9366, 0x0008, 0x808c, 0x0000, 0x0001,
+	0x0007, 0x0000, 0x0007, 0x0000, 0x000a, 0x4047, 0x0008, 0x808c,
+	0x0000, 0x0002, 0x0007, 0x0000, 0x0003, 0x082d, 0x0000, 0x4022,
+	0x000b, 0x002e, 0x0008, 0x4122, 0x0002, 0x4447, 0x0003, 0x8b8a,
+	0x0008, 0x0bfe, 0x0001, 0x11a0, 0x0003, 0x136c, 0x0001, 0x0ca0,
+	0x0003, 0x136c, 0x0001, 0x9180, 0x0000, 0x0004, 0x0000, 0x8060,
+	0x0000, 0x0400, 0x0008, 0x7f62, 0x0000, 0x8066, 0x0008, 0x0009,
+	0x000b, 0xc03c, 0x0008, 0x808c, 0x0008, 0x0000, 0x0008, 0x0060,
+	0x0008, 0x8062, 0x0000, 0x0004, 0x0000, 0x8066, 0x0000, 0x0411,
+	0x000b, 0xc044, 0x0000, 0x03fe, 0x0001, 0x43e0, 0x000b, 0x8b69,
+	0x0009, 0xc2c0, 0x0008, 0x00ff, 0x0001, 0x02e0, 0x000b, 0x8b69,
+	0x0001, 0x9180, 0x0008, 0x0005, 0x0000, 0x8060, 0x0000, 0x0400,
+	0x0008, 0x7f62, 0x0000, 0x8066, 0x0000, 0x0019, 0x000b, 0xc053,
+	0x0002, 0x0240, 0x0003, 0x0b66, 0x0008, 0x00fc, 0x000b, 0x3369,
+	0x000a, 0x0244, 0x0003, 0x0865, 0x000c, 0x01e2, 0x0001, 0x9180,
+	0x0000, 0x0007, 0x0008, 0x7f62, 0x0000, 0x8060, 0x0000, 0x0400,
+	0x0002, 0x0234, 0x0008, 0x7f04, 0x0000, 0x8066, 0x0000, 0x040a,
+	0x0003, 0xc064, 0x0000, 0x112a, 0x0008, 0x002e, 0x0008, 0x022c,
+	0x0002, 0x3a44, 0x0003, 0x8813, 0x0008, 0x808c, 0x0000, 0x0002,
+	0x0008, 0x1760, 0x0008, 0x8062, 0x0008, 0x000f, 0x0000, 0x8066,
+	0x0008, 0x0011, 0x000b, 0xc071, 0x0008, 0x01fe, 0x0009, 0x42e0,
+	0x0003, 0x8b5b, 0x0000, 0x00fe, 0x0001, 0x43e0, 0x0003, 0x8b5b,
+	0x0000, 0x1734, 0x0000, 0x1530, 0x0008, 0x1632, 0x0008, 0x0d2a,
+	0x0001, 0x9880, 0x0008, 0x0012, 0x0000, 0x8060, 0x0000, 0x0400,
+	0x0008, 0x7f62, 0x0000, 0x8066, 0x0008, 0x1e0a, 0x0003, 0xc083,
+	0x0008, 0x808a, 0x0008, 0x0003, 0x0000, 0x1a60, 0x0008, 0x8062,
+	0x0000, 0x0002, 0x000b, 0x5889, 0x0000, 0x8066, 0x0000, 0x3679,
+	0x0003, 0xc08c, 0x0003, 0x588d, 0x0008, 0x8054, 0x0008, 0x0011,
+	0x0000, 0x8074, 0x0008, 0x1010, 0x0008, 0x1efc, 0x0003, 0x3013,
+	0x0004, 0x0096, 0x0003, 0x0013, 0x0000, 0x1c60, 0x0000, 0x1b62,
+	0x0000, 0x8066, 0x0008, 0x0231, 0x000b, 0xc09a, 0x000b, 0x589b,
+	0x0008, 0x0140, 0x0000, 0x0242, 0x0002, 0x1f43, 0x000b, 0x88a5,
+	0x0000, 0x0d44, 0x0008, 0x0d46, 0x0008, 0x0348, 0x0008, 0x044a,
+	0x000b, 0x00a9, 0x0008, 0x0344, 0x0008, 0x0446, 0x0008, 0x0548,
+	0x0000, 0x064a, 0x0003, 0x58a9, 0x0008, 0x8054, 0x0000, 0x0001,
+	0x0000, 0x8074, 0x0008, 0x2020, 0x000f, 0x4000, 0x0000, 0x4820,
+	0x0008, 0x0bfe, 0x0009, 0x10a0, 0x0003, 0x1110, 0x0001, 0x0ca0,
+	0x0003, 0x1110, 0x0000, 0x8060, 0x0000, 0x0400, 0x0009, 0x9080,
+	0x0000, 0x0008, 0x0008, 0x7f62, 0x0000, 0x8066, 0x0008, 0x0009,
+	0x0003, 0xc0bc, 0x0001, 0x80e0, 0x0008, 0x0003, 0x000b, 0x8910,
+	0x0000, 0x49b4, 0x0002, 0x4b4e, 0x000b, 0x8919, 0x0008, 0x808a,
+	0x0000, 0x0004, 0x0000, 0x18fe, 0x0001, 0x10e0, 0x000b, 0x88ca,
+	0x0002, 0x192f, 0x0008, 0x7f32, 0x0008, 0x15fe, 0x0001, 0x10e0,
+	0x000b, 0x88cf, 0x0002, 0x162f, 0x0008, 0x7f2c, 0x0000, 0x8060,
+	0x0000, 0x0400, 0x0009, 0x9080, 0x0000, 0x0007, 0x0008, 0x7f62,
+	0x0000, 0x8066, 0x0008, 0x0009, 0x0003, 0xc0d6, 0x000a, 0x004f,
+	0x000b, 0x8907, 0x000a, 0x0040, 0x000b, 0x08f1, 0x0002, 0x004e,
+	0x000b, 0x08f1, 0x0002, 0x0030, 0x0002, 0x7f2f, 0x0000, 0x7f00,
+	0x0000, 0x8066, 0x0008, 0x000a, 0x000b, 0xc0e2, 0x0008, 0x1010,
+	0x000c, 0x01c9, 0x000b, 0xb0ea, 0x000c, 0x032f, 0x0004, 0x01b3,
+	0x000b, 0x7814, 0x0003, 0x0013, 0x0000, 0x0806, 0x0008, 0x8010,
+	0x0000, 0x001f, 0x000c, 0x032f, 0x0000, 0x0310, 0x000c, 0x032f,
+	0x000b, 0x00e8, 0x000a, 0x002f, 0x0000, 0x7f00, 0x0000, 0x8066,
+	0x0008, 0x000a, 0x000b, 0xc0f5, 0x0004, 0x018c, 0x000a, 0x0040,
+	0x000b, 0x090a, 0x000c, 0x01f9, 0x0000, 0x8000, 0x0000, 0x0002,
+	0x0000, 0x8060, 0x0000, 0x0400, 0x0009, 0x9080, 0x0008, 0x0006,
+	0x0008, 0x7f62, 0x0000, 0x8066, 0x0008, 0x000a, 0x0003, 0xc103,
+	0x0000, 0x8072, 0x0000, 0x4000, 0x000b, 0x00e8, 0x0008, 0x8010,
+	0x0008, 0x001e, 0x0003, 0x010c, 0x0008, 0x8010, 0x0008, 0x001d,
+	0x000c, 0x032f, 0x0008, 0x1010, 0x000c, 0x032f, 0x000b, 0x0014,
+	0x0002, 0x4b4e, 0x0003, 0x0916, 0x0008, 0x808a, 0x0000, 0x0004,
+	0x000b, 0x6116, 0x000f, 0x8000, 0x0008, 0x808a, 0x0000, 0x0004,
+	0x000b, 0x0014, 0x0000, 0x8060, 0x0000, 0x0400, 0x0009, 0x9080,
+	0x0008, 0x0011, 0x0008, 0x7f62, 0x0000, 0x8066, 0x0008, 0x0009,
+	0x000b, 0xc120, 0x000a, 0x004f, 0x0003, 0x897d, 0x0000, 0x8060,
+	0x0000, 0x0400, 0x0009, 0x9080, 0x0008, 0x0005, 0x0008, 0x7f62,
+	0x0000, 0x8066, 0x0008, 0x0009, 0x000b, 0xc12a, 0x0008, 0x0060,
+	0x0008, 0x8062, 0x0000, 0x001f, 0x0000, 0x8066, 0x0000, 0x0209,
+	0x0003, 0xc130, 0x000a, 0x014b, 0x000b, 0x097d, 0x0008, 0x8062,
+	0x0008, 0x000f, 0x0000, 0x8066, 0x0000, 0x0211, 0x000b, 0xc137,
+	0x0008, 0x01fe, 0x0001, 0x02d0, 0x0003, 0x897d, 0x000c, 0x0195,
+	0x000b, 0x097d, 0x0008, 0x03a0, 0x0008, 0x8004, 0x0000, 0x0002,
+	0x0000, 0x8006, 0x0000, 0x0043, 0x0008, 0x4908, 0x0008, 0x808a,
+	0x0000, 0x0004, 0x0000, 0x8060, 0x0000, 0x0400, 0x0009, 0x9080,
+	0x0008, 0x0000, 0x0008, 0x7f62, 0x0000, 0x8066, 0x0008, 0x041a,
+	0x000b, 0xc14c, 0x000b, 0xe14d, 0x0008, 0x4908, 0x0008, 0x480a,
+	0x0008, 0x808a, 0x0000, 0x0004, 0x0008, 0x0060, 0x0008, 0x8062,
+	0x0008, 0x002b, 0x0000, 0x8066, 0x0000, 0x0411, 0x000b, 0xc157,
+	0x0008, 0x04fe, 0x0009, 0x02a0, 0x000b, 0x915e, 0x0002, 0x0500,
+	0x0003, 0x097a, 0x0003, 0x015f, 0x0000, 0x05fe, 0x0001, 0x03a0,
+	0x0003, 0x117a, 0x0000, 0x0d0c, 0x0008, 0x0d0e, 0x0008, 0x0d10,
+	0x0000, 0x0d12, 0x0008, 0x0060, 0x0008, 0x8062, 0x0000, 0x000d,
+	0x0000, 0x8066, 0x0008, 0x0832, 0x0003, 0xc16a, 0x0000, 0x800a,
+	0x0000, 0x8005, 0x0000, 0x8060, 0x0000, 0x0400, 0x0009, 0x9080,
+	0x0008, 0x0011, 0x0008, 0x7f62, 0x0000, 0x8066, 0x0008, 0x0a12,
+	0x0003, 0xc174, 0x0008, 0x5006, 0x0008, 0x100e, 0x000c, 0x01a0,
+	0x000b, 0x7814, 0x0003, 0x0013, 0x0008, 0x0208, 0x0008, 0x030a,
+	0x000b, 0x0161, 0x0004, 0x018c, 0x0008, 0x808a, 0x0000, 0x0004,
+	0x0008, 0x8010, 0x0008, 0x0021, 0x000c, 0x032f, 0x0008, 0x1010,
+	0x000c, 0x032f, 0x0000, 0x4810, 0x000c, 0x032f, 0x0008, 0x4910,
+	0x000c, 0x032f, 0x0008, 0x808a, 0x0000, 0x0004, 0x000b, 0x0014,
+	0x0000, 0x8060, 0x0000, 0x0400, 0x0009, 0x9080, 0x0000, 0x0002,
+	0x0008, 0x7f62, 0x0000, 0x8066, 0x0008, 0xb40a, 0x0003, 0xc193,
+	0x000f, 0x4000, 0x0000, 0x8060, 0x0000, 0x0400, 0x0000, 0x0a62,
+	0x0000, 0x8066, 0x0000, 0x0411, 0x0003, 0xc19a, 0x0002, 0x0210,
+	0x0001, 0xffc0, 0x0000, 0x0007, 0x0009, 0x03e0, 0x000f, 0x4000,
+	0x0000, 0x8060, 0x0000, 0x0400, 0x0001, 0x8380, 0x0000, 0x0002,
+	0x0009, 0x0a80, 0x0008, 0x7f62, 0x0000, 0x8066, 0x0000, 0x0e0a,
+	0x000b, 0xc1a8, 0x0002, 0x0300, 0x0001, 0xffc0, 0x0000, 0x0007,
+	0x0000, 0x7f06, 0x0002, 0x0a00, 0x0008, 0x7f62, 0x0000, 0x8066,
+	0x0008, 0x060a, 0x0003, 0xc1b1, 0x000f, 0x4000, 0x0000, 0x0da0,
+	0x0008, 0x0da2, 0x0008, 0x0da4, 0x0009, 0x8880, 0x0000, 0x0001,
+	0x0008, 0x7f62, 0x0000, 0x8060, 0x0000, 0x0400, 0x0000, 0x8066,
+	0x0008, 0xa012, 0x0000, 0x0da6, 0x0008, 0x0da8, 0x0000, 0x0daa,
+	0x0000, 0x0dac, 0x000b, 0xc1c1, 0x0009, 0x8880, 0x0008, 0x0009,
+	0x0008, 0x7f62, 0x0000, 0x8066, 0x0008, 0xa03a, 0x000b, 0xc1c7,
+	0x000f, 0x4000, 0x0009, 0x8880, 0x0008, 0x0005, 0x0000, 0x8060,
+	0x0000, 0x0400, 0x0008, 0x7f62, 0x0000, 0x8066, 0x0008, 0x0009,
+	0x000b, 0xc1d0, 0x0008, 0x0060, 0x0008, 0x8062, 0x0000, 0x000d,
+	0x0000, 0x8066, 0x0008, 0x0021, 0x000b, 0xc1d6, 0x0000, 0x00fe,
+	0x0001, 0x01d0, 0x000b, 0x89df, 0x0008, 0x02fe, 0x0009, 0x03d0,
+	0x0003, 0x09df, 0x0000, 0x0d06, 0x000f, 0x4000, 0x0000, 0x8006,
+	0x0000, 0x0001, 0x000f, 0x4000, 0x0008, 0x0060, 0x0008, 0x8062,
+	0x0008, 0x002b, 0x0000, 0x8066, 0x0008, 0xa041, 0x0003, 0xc1e7,
+	0x0002, 0x0243, 0x0003, 0x89ee, 0x0000, 0x54ac, 0x0000, 0x55ae,
+	0x0008, 0x0da8, 0x0000, 0x0daa, 0x0000, 0x50b0, 0x0000, 0x51b2,
+	0x0000, 0x0db4, 0x0008, 0x0db6, 0x0008, 0x0060, 0x0008, 0x8062,
+	0x0000, 0x0007, 0x0000, 0x8066, 0x0008, 0xa452, 0x000b, 0xc1f7,
+	0x000f, 0x4000, 0x000a, 0x3945, 0x0003, 0x8a03, 0x0000, 0x8072,
+	0x0008, 0x4040, 0x0007, 0x0000, 0x000a, 0x3945, 0x000b, 0x8a01,
+	0x000f, 0x4000, 0x0000, 0x8072, 0x0000, 0x4000, 0x0007, 0x0000,
+	0x0007, 0x0000, 0x0007, 0x0000, 0x000a, 0x3945, 0x0003, 0x09fb,
+	0x0003, 0x0203, 0x000a, 0x3a40, 0x000b, 0x8817, 0x0008, 0x2b24,
+	0x0008, 0x2b24, 0x0003, 0x5a0d, 0x0008, 0x8054, 0x0000, 0x0002,
+	0x0002, 0x1242, 0x0003, 0x0a51, 0x000a, 0x3a45, 0x000b, 0x0a42,
+	0x000a, 0x1e10, 0x0000, 0x7f3c, 0x000b, 0x0a3f, 0x0002, 0x1d00,
+	0x0000, 0x7f3a, 0x0000, 0x0d60, 0x0008, 0x7f62, 0x0000, 0x8066,
+	0x0008, 0x0009, 0x0003, 0xc21d, 0x0008, 0x00fc, 0x000b, 0xb23c,
+	0x0000, 0x1c60, 0x0008, 0x8062, 0x0000, 0x0001, 0x0000, 0x8066,
+	0x0008, 0x0009, 0x000b, 0xc225, 0x0008, 0x00fc, 0x000b, 0x3344,
+	0x0000, 0x0038, 0x0008, 0x0060, 0x0008, 0x8062, 0x0000, 0x0019,
+	0x0000, 0x8066, 0x0008, 0x0009, 0x0003, 0xc22e, 0x0009, 0x80c0,
+	0x0008, 0x00ff, 0x0008, 0x7f3e, 0x0000, 0x0d60, 0x0008, 0x0efe,
+	0x0001, 0x1f80, 0x0008, 0x7f62, 0x0000, 0x8066, 0x0008, 0x0009,
+	0x000b, 0xc238, 0x0008, 0x003a, 0x0000, 0x1dfe, 0x000b, 0x0219,
+	0x0008, 0x0036, 0x0004, 0x0096, 0x000b, 0x0251, 0x0000, 0x8074,
+	0x0000, 0x2000, 0x000b, 0x0251, 0x0002, 0x3a44, 0x0003, 0x0b6f,
+	0x0000, 0x8074, 0x0000, 0x1000, 0x0000, 0x2d0e, 0x0000, 0x2d0e,
+	0x0003, 0xb341, 0x0008, 0x26fe, 0x0008, 0x26fe, 0x0008, 0x2700,
+	0x0008, 0x2700, 0x0009, 0x00d0, 0x000b, 0x8a61, 0x0000, 0x8074,
+	0x0008, 0x4040, 0x0003, 0x5a51, 0x0003, 0x5209, 0x000a, 0x3a46,
+	0x000b, 0x8a61, 0x0002, 0x3a47, 0x000b, 0x0a5c, 0x0008, 0x8054,
+	0x0000, 0x0004, 0x0000, 0x8074, 0x0000, 0x8000, 0x000b, 0x02ba,
+	0x0009, 0x92c0, 0x0000, 0x0fc8, 0x000b, 0x0813, 0x000a, 0x1246,
+	0x0003, 0x8b3b, 0x0000, 0x1a60, 0x0008, 0x8062, 0x0000, 0x0002,
+	0x0000, 0x8066, 0x0000, 0x367a, 0x0003, 0xc266, 0x0009, 0x92c0,
+	0x0008, 0x0780, 0x000b, 0x8b55, 0x0002, 0x124b, 0x000b, 0x0a6f,
+	0x0002, 0x2e4d, 0x0002, 0x2e4d, 0x0003, 0x0b41, 0x000a, 0x3a46,
+	0x000b, 0x8a7c, 0x000b, 0x5a71, 0x0008, 0x8054, 0x0000, 0x0004,
+	0x000a, 0x1243, 0x000b, 0x0ab8, 0x0008, 0x8010, 0x0000, 0x000d,
+	0x000c, 0x032f, 0x0000, 0x1810, 0x000c, 0x032f, 0x0003, 0x02b8,
+	0x000a, 0x194d, 0x0003, 0x0a80, 0x000a, 0x1243, 0x0003, 0x0b4b,
+	0x0003, 0x5a80, 0x0008, 0x8054, 0x0000, 0x0004, 0x000a, 0x192e,
+	0x0008, 0x7f32, 0x000a, 0x1947, 0x000b, 0x0ab2, 0x0002, 0x194f,
+	0x000b, 0x0a90, 0x0004, 0x0324, 0x0000, 0x1810, 0x000c, 0x01c9,
+	0x0003, 0xb2ab, 0x000c, 0x032f, 0x0004, 0x01b3, 0x0003, 0x02b8,
+	0x0000, 0x1a60, 0x0008, 0x8062, 0x0000, 0x001f, 0x0000, 0x8066,
+	0x0008, 0x0009, 0x0003, 0xc295, 0x000a, 0x004c, 0x0003, 0x8ab2,
+	0x0000, 0x8060, 0x0000, 0x0400, 0x0001, 0x9880, 0x0000, 0x0007,
+	0x0008, 0x7f62, 0x0000, 0x8066, 0x0000, 0x320a, 0x0003, 0xc29f,
+	0x0000, 0x8060, 0x0000, 0x0400, 0x0001, 0x9880, 0x0008, 0x0012,
+	0x0008, 0x7f62, 0x0000, 0x8066, 0x0008, 0x1e0a, 0x000b, 0xc2a7,
+	0x0000, 0x1826, 0x0000, 0x1928, 0x0003, 0x02b8, 0x0000, 0x0806,
+	0x0008, 0x8010, 0x0000, 0x001f, 0x000c, 0x032f, 0x0000, 0x0310,
+	0x000c, 0x032f, 0x0003, 0x02b8, 0x0004, 0x0324, 0x0008, 0x8010,
+	0x0000, 0x0001, 0x000c, 0x032f, 0x0000, 0x1810, 0x000c, 0x032f,
+	0x0000, 0x8074, 0x0008, 0xf000, 0x0000, 0x0d30, 0x0002, 0x3a42,
+	0x0003, 0x8ac0, 0x0000, 0x15fc, 0x0003, 0xb06a, 0x0003, 0x0013,
+	0x0000, 0x8074, 0x0000, 0x0501, 0x0008, 0x8010, 0x0008, 0x000c,
+	0x000c, 0x032f, 0x0003, 0x0013, 0x0009, 0xbbe0, 0x0008, 0x0030,
+	0x000b, 0x8adc, 0x0000, 0x18fe, 0x0009, 0x3ce0, 0x0003, 0x0ad9,
+	0x0008, 0x15fe, 0x0009, 0x3ce0, 0x0003, 0x0ad9, 0x0008, 0x13fe,
+	0x0009, 0x3ce0, 0x000b, 0x8ad5, 0x0004, 0x031d, 0x0008, 0x0d26,
+	0x000b, 0x02d6, 0x000c, 0x031f, 0x0008, 0x8076, 0x0000, 0x0040,
+	0x0003, 0x031a, 0x0008, 0x8076, 0x0008, 0x0041, 0x0003, 0x031a,
+	0x0009, 0xbbe0, 0x0000, 0x0032, 0x0003, 0x8ae1, 0x0008, 0x3c1e,
+	0x0003, 0x031a, 0x0009, 0xbbe0, 0x0000, 0x0037, 0x0003, 0x8aff,
+	0x0000, 0x18fe, 0x0009, 0x3ce0, 0x000b, 0x8ad9, 0x0008, 0x8076,
+	0x0000, 0x0040, 0x0000, 0x1a60, 0x0008, 0x8062, 0x0000, 0x000d,
+	0x0008, 0x2604, 0x0008, 0x2604, 0x0008, 0x2706, 0x0008, 0x2706,
+	0x0000, 0x2808, 0x0000, 0x2808, 0x0000, 0x290a, 0x0000, 0x290a,
+	0x0000, 0x8066, 0x0000, 0x0422, 0x0003, 0xc2f6, 0x0004, 0x0324,
+	0x0008, 0x8054, 0x0000, 0x0004, 0x0000, 0x8074, 0x0008, 0xf000,
+	0x0000, 0x8072, 0x0000, 0x8000, 0x000b, 0x02ba, 0x0009, 0xbbe0,
+	0x0000, 0x0038, 0x000b, 0x8b11, 0x0000, 0x18fe, 0x0009, 0x3ce0,
+	0x000b, 0x0b0e, 0x0008, 0x15fe, 0x0009, 0x3ce0, 0x0003, 0x8acf,
+	0x000c, 0x031f, 0x0008, 0x8076, 0x0000, 0x0040, 0x0000, 0x8072,
+	0x0000, 0x8000, 0x000b, 0x0366, 0x0008, 0x8076, 0x0008, 0x0042,
+	0x0003, 0x031a, 0x0009, 0xbbe0, 0x0000, 0x0016, 0x0003, 0x8b1a,
+	0x0002, 0x3a44, 0x0003, 0x8816, 0x0000, 0x8072, 0x0000, 0x8000,
+	0x000f, 0x8000, 0x0003, 0x0013, 0x0000, 0x8072, 0x0000, 0x8000,
+	0x0003, 0x0013, 0x0002, 0x1430, 0x0003, 0x0320, 0x000a, 0x3d30,
+	0x0000, 0x7f00, 0x0001, 0xbc80, 0x0000, 0x0007, 0x000b, 0x0328,
+	0x000a, 0x1930, 0x0000, 0x7f00, 0x0001, 0x9880, 0x0000, 0x0007,
+	0x0000, 0x8060, 0x0000, 0x0400, 0x0008, 0x7f62, 0x0000, 0x8066,
+	0x0008, 0x000a, 0x000b, 0xc32d, 0x000f, 0x4000, 0x000b, 0x232f,
+	0x0008, 0x0870, 0x000f, 0x4000, 0x0009, 0xbac0, 0x0008, 0x0090,
+	0x000b, 0x0b38, 0x0000, 0x8074, 0x0000, 0x0706, 0x000b, 0x033a,
+	0x0000, 0x8074, 0x0000, 0x0703, 0x000f, 0x4000, 0x0008, 0x8010,
+	0x0000, 0x0023, 0x000b, 0x0374, 0x0008, 0x8010, 0x0000, 0x0008,
+	0x000b, 0x0374, 0x0008, 0x8010, 0x0008, 0x0022, 0x000b, 0x0374,
+	0x0004, 0x0324, 0x0008, 0x8010, 0x0000, 0x0007, 0x000c, 0x032f,
+	0x0000, 0x1810, 0x000c, 0x032f, 0x000b, 0x037e, 0x0004, 0x0324,
+	0x0008, 0x8010, 0x0008, 0x001b, 0x000c, 0x032f, 0x0000, 0x1810,
+	0x000c, 0x032f, 0x0000, 0x8074, 0x0000, 0xf080, 0x0000, 0x0d30,
+	0x0003, 0x0013, 0x0008, 0x8010, 0x0008, 0x0009, 0x000b, 0x0374,
+	0x0008, 0x8010, 0x0008, 0x0005, 0x000b, 0x0374, 0x0008, 0x808c,
+	0x0000, 0x0001, 0x0007, 0x0000, 0x0008, 0x8010, 0x0000, 0x0004,
+	0x000a, 0x4143, 0x0003, 0x0878, 0x0002, 0x3a44, 0x0003, 0x8813,
+	0x0008, 0x0d2a, 0x000b, 0x0374, 0x0008, 0x8010, 0x0008, 0x0003,
+	0x0003, 0x0376, 0x0008, 0x8010, 0x0000, 0x000b, 0x0003, 0x0376,
+	0x0008, 0x8010, 0x0000, 0x0002, 0x0003, 0x0376, 0x0002, 0x3a47,
+	0x000b, 0x8a51, 0x0008, 0x8010, 0x0008, 0x0006, 0x0003, 0x0376,
+	0x0000, 0x8074, 0x0008, 0xf000, 0x000c, 0x032f, 0x000c, 0x0332,
+	0x000a, 0x3a40, 0x000b, 0x0813, 0x0008, 0x8010, 0x0008, 0x000c,
+	0x000c, 0x032f, 0x0003, 0x0013, 0x0000, 0x8074, 0x0000, 0xf080,
+	0x0000, 0x0d30, 0x0002, 0x2e4d, 0x0002, 0x2e4d, 0x0003, 0x0b87,
+	0x0008, 0x8054, 0x0000, 0x0019, 0x0003, 0x0013, 0x0008, 0x8054,
+	0x0008, 0x0009, 0x0003, 0x0013, 0x0002, 0x3a44, 0x0003, 0x8813,
+	0x000b, 0x0369, 0xec89, 0x9da0
+};
+unsigned short rseqflx_code_length01 = 0x071c;
+/*
+ *
+ */
+
+unsigned long xseqflx_code_addr01 = 0x0001e000 ;
+unsigned short xseqflx_code01[] = { 
+0x0013, 0x0003, 0x0000, 0x0fe2, 0x0001, 0xe000, 0x0005, 0x0032,
+	0x0000, 0x0010, 0x0015, 0x0033, 0x0010, 0xbb39, 0x000b, 0x8007,
+	0x0004, 0x0107, 0x0004, 0x0119, 0x0010, 0xc000, 0x0000, 0xc001,
+	0x0000, 0xc0b0, 0x0010, 0xc0b1, 0x0010, 0xc0b2, 0x0000, 0xc0b3,
+	0x0010, 0xc0b4, 0x0000, 0xc0b5, 0x0000, 0xc0b6, 0x0010, 0xc0b7,
+	0x0010, 0xc0b8, 0x0000, 0xc0b9, 0x0000, 0xc0ba, 0x0000, 0xc0c2,
+	0x0010, 0xc0c3, 0x0000, 0xc0c4, 0x0010, 0xc0c5, 0x0010, 0xc0c6,
+	0x0000, 0xc0c7, 0x0000, 0xc0c8, 0x0010, 0xc0c9, 0x0010, 0xc0ca,
+	0x0000, 0xc0cb, 0x0010, 0xc0cc, 0x0000, 0xc0cd, 0x0000, 0xc0ce,
+	0x0010, 0xc0cf, 0x0015, 0x0039, 0x0010, 0xff00, 0x0015, 0x003a,
+	0x0010, 0xff00, 0x0005, 0x00d0, 0x0010, 0xff00, 0x0015, 0x00d1,
+	0x0010, 0xff00, 0x0012, 0x3a40, 0x000b, 0x1031, 0x0002, 0x7940,
+	0x000b, 0x112b, 0x0002, 0x3a42, 0x001b, 0x1035, 0x0003, 0xb035,
+	0x0013, 0xa1cd, 0x0002, 0x3a41, 0x001b, 0x1039, 0x0012, 0x7941,
+	0x000b, 0x12eb, 0x0013, 0xe051, 0x0012, 0xd042, 0x0003, 0x103f,
+	0x0000, 0x75ff, 0x0002, 0xff41, 0x000b, 0x1051, 0x0000, 0x0cfe,
+	0x0013, 0x6047, 0x0011, 0x02e8, 0x0010, 0x0000, 0x0003, 0x1371,
+	0x0011, 0x02e8, 0x0010, 0x0005, 0x0013, 0x13fe, 0x0012, 0xd042,
+	0x0013, 0x104c, 0x0000, 0x75ff, 0x0012, 0xff40, 0x000b, 0x1051,
+	0x0000, 0x12fe, 0x0003, 0x6051, 0x0001, 0x0fe8, 0x0010, 0x0000,
+	0x0003, 0x15e8, 0x0015, 0x0030, 0x0000, 0x0400, 0x0010, 0xc131,
+	0x0015, 0x0033, 0x0010, 0xb211, 0x001b, 0x8056, 0x0010, 0xb2ff,
+	0x0001, 0xb3e0, 0x000c, 0x10c9, 0x000b, 0xf02d, 0x0011, 0x3be8,
+	0x0000, 0x0010, 0x000b, 0x106e, 0x0000, 0x0afe, 0x001b, 0x6062,
+	0x0000, 0x3c0b, 0x0013, 0x006a, 0x0015, 0x0030, 0x0000, 0x0400,
+	0x0001, 0x0a88, 0x0010, 0x0003, 0x0000, 0xff31, 0x0015, 0x0033,
+	0x0010, 0x3c0a, 0x001b, 0x8069, 0x0010, 0x3c0a, 0x0002, 0x0c00,
+	0x0010, 0xff0c, 0x0013, 0x00c6, 0x0011, 0x3be8, 0x0010, 0x0012,
+	0x001b, 0x1081, 0x0010, 0x08fe, 0x001b, 0x6075, 0x0010, 0x3c09,
+	0x0013, 0x007d, 0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x0888,
+	0x0010, 0x0003, 0x0000, 0xff31, 0x0015, 0x0033, 0x0010, 0x3c0a,
+	0x000b, 0x807c, 0x0000, 0x3c08, 0x0002, 0x0c00, 0x0010, 0xff0c,
+	0x0013, 0x00c6, 0x0011, 0x3be8, 0x0000, 0x0013, 0x001b, 0x1087,
+	0x0000, 0x3cb0, 0x0014, 0x00d9, 0x0013, 0x00c6, 0x0011, 0x3be8,
+	0x0000, 0x0019, 0x001b, 0x109a, 0x0010, 0x04fe, 0x000b, 0x608e,
+	0x0010, 0x3c05, 0x0013, 0x0096, 0x0015, 0x0030, 0x0000, 0x0400,
+	0x0011, 0x0488, 0x0010, 0x0003, 0x0000, 0xff31, 0x0015, 0x0033,
+	0x0010, 0x3c0a, 0x001b, 0x8095, 0x0000, 0x3c04, 0x0002, 0x0c00,
+	0x0010, 0xff0c, 0x0013, 0x00c6, 0x0011, 0x3be8, 0x0000, 0x0015,
+	0x001b, 0x10a6, 0x0004, 0x0110, 0x0014, 0x0122, 0x0015, 0x0039,
+	0x0000, 0x8000, 0x0017, 0x8000, 0x0004, 0x0107, 0x0004, 0x0119,
+	0x0014, 0x00f2, 0x0013, 0x002d, 0x0011, 0x3be8, 0x0000, 0x0016,
+	0x001b, 0x10b8, 0x0001, 0x0fe8, 0x0010, 0x0000, 0x0003, 0x10b2,
+	0x0001, 0x0fe8, 0x0000, 0x0002, 0x0003, 0x10b2, 0x0015, 0x0039,
+	0x0010, 0x1010, 0x0013, 0x00c6, 0x0015, 0x0039, 0x0000, 0x5040,
+	0x0015, 0x00b8, 0x0000, 0x0008, 0x0014, 0x07ed, 0x0013, 0x00c6,
+	0x0011, 0x3be8, 0x0010, 0x0017, 0x001b, 0x10bd, 0x0010, 0x3cc3,
+	0x0013, 0x00c6, 0x0011, 0x3be8, 0x0010, 0x0018, 0x000b, 0x10c2,
+	0x0000, 0x3cc2, 0x0013, 0x00c6, 0x0005, 0x00ce, 0x0000, 0x0001,
+	0x0000, 0x3bcf, 0x0014, 0x07b1, 0x0015, 0x0039, 0x0000, 0x8000,
+	0x0013, 0x002d, 0x0001, 0xb288, 0x0000, 0x0002, 0x0001, 0xc180,
+	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb009, 0x001b, 0x80cf,
+	0x0002, 0xb200, 0x0011, 0xffc8, 0x0000, 0x0007, 0x0010, 0xffb2,
+	0x0010, 0xc131, 0x0015, 0x0033, 0x0010, 0xb20a, 0x0001, 0xb0d0,
+	0x001b, 0x80d8, 0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0xb088,
+	0x0000, 0x0010, 0x0000, 0xff31, 0x0015, 0x0033, 0x0010, 0xb109,
+	0x000b, 0x80e0, 0x0001, 0xb1e8, 0x0010, 0xffff, 0x0013, 0x10f1,
+	0x0000, 0x11fe, 0x000b, 0x60e8, 0x0000, 0xb012, 0x0013, 0x00f0,
+	0x0015, 0x0030, 0x0000, 0x0400, 0x0001, 0x1188, 0x0010, 0x0003,
+	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb00a, 0x000b, 0x80ef,
+	0x0000, 0xb011, 0x0017, 0x4000, 0x0015, 0x0030, 0x0000, 0x0400,
+	0x0011, 0xbc88, 0x0010, 0x001e, 0x0000, 0xff31, 0x0015, 0x0033,
+	0x0000, 0xc411, 0x001b, 0x80f9, 0x0011, 0xbc88, 0x0010, 0x0017,
+	0x0000, 0xff31, 0x0015, 0x0033, 0x0010, 0xc609, 0x001b, 0x80ff,
+	0x0011, 0xbc88, 0x0010, 0x0036, 0x0000, 0xff31, 0x0015, 0x0033,
+	0x0000, 0xc709, 0x000b, 0x8105, 0x0017, 0x4000, 0x0015, 0x0030,
+	0x0000, 0x0400, 0x0001, 0xbb88, 0x0000, 0x0001, 0x0000, 0xff31,
+	0x0015, 0x0033, 0x0000, 0x0269, 0x001b, 0x810e, 0x0017, 0x4000,
+	0x0015, 0x0030, 0x0000, 0x0400, 0x0001, 0xbb88, 0x0000, 0x0001,
+	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0x026a, 0x000b, 0x8117,
+	0x0017, 0x4000, 0x0015, 0x0030, 0x0000, 0x0400, 0x0001, 0xbb88,
+	0x0010, 0x000f, 0x0000, 0xff31, 0x0015, 0x0033, 0x0010, 0x0f59,
+	0x001b, 0x8120, 0x0017, 0x4000, 0x0015, 0x0030, 0x0000, 0x0400,
+	0x0001, 0xbb88, 0x0010, 0x000f, 0x0000, 0xff31, 0x0015, 0x0033,
+	0x0010, 0x0f5a, 0x001b, 0x8129, 0x0017, 0x4000, 0x0000, 0xd0ff,
+	0x0012, 0xff40, 0x000b, 0x1031, 0x0015, 0x00d1, 0x0010, 0x0101,
+	0x0003, 0x9130, 0x0005, 0x0079, 0x0000, 0x0001, 0x0003, 0x9133,
+	0x0015, 0x00d1, 0x0000, 0x0100, 0x0011, 0x02e8, 0x0000, 0x0002,
+	0x0003, 0x1152, 0x0011, 0x02e8, 0x0000, 0x0001, 0x0013, 0x116a,
+	0x0011, 0x02e8, 0x0000, 0x0004, 0x0013, 0x1188, 0x0011, 0x02e8,
+	0x0010, 0x0003, 0x0003, 0x11b9, 0x0005, 0x0002, 0x0010, 0x0000,
+	0x0000, 0xc00e, 0x0000, 0xc00d, 0x0010, 0xc003, 0x0015, 0x0030,
+	0x0000, 0x0400, 0x0001, 0xbd88, 0x0010, 0x0009, 0x0000, 0xff31,
+	0x0015, 0x0033, 0x0010, 0xc00a, 0x000b, 0x814e, 0x0012, 0xd042,
+	0x0013, 0x1031, 0x0003, 0x004c, 0x0012, 0x7849, 0x0003, 0x11c7,
+	0x0010, 0x0dfe, 0x0003, 0x6144, 0x0012, 0x0c10, 0x0010, 0xff0c,
+	0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x0d88, 0x0010, 0x0003,
+	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb309, 0x000b, 0x815f,
+	0x0010, 0xb3fe, 0x0013, 0x6167, 0x0010, 0xb30b, 0x0015, 0x0033,
+	0x0010, 0xc00a, 0x000b, 0x8165, 0x0013, 0x01bc, 0x0000, 0xc00b,
+	0x0010, 0xc00a, 0x0013, 0x01bc, 0x0000, 0x78b0, 0x0012, 0xb044,
+	0x0003, 0x11c7, 0x0002, 0xb049, 0x0003, 0x11c7, 0x0010, 0x71ff,
+	0x0012, 0xff38, 0x0010, 0xff71, 0x0010, 0x0dfe, 0x0003, 0x6142,
+	0x0012, 0x0c10, 0x0010, 0xff0c, 0x0015, 0x0030, 0x0000, 0x0400,
+	0x0011, 0x0d88, 0x0010, 0x0003, 0x0000, 0xff31, 0x0015, 0x0033,
+	0x0000, 0xb309, 0x000b, 0x817d, 0x0010, 0xb3fe, 0x0013, 0x6185,
+	0x0000, 0xb309, 0x0015, 0x0033, 0x0010, 0xc00a, 0x001b, 0x8183,
+	0x0013, 0x01bc, 0x0010, 0xc009, 0x0000, 0xc008, 0x0013, 0x01bc,
+	0x0000, 0x78b0, 0x0012, 0xb044, 0x0003, 0x11c7, 0x0002, 0xb049,
+	0x0003, 0x11c7, 0x0010, 0x71ff, 0x0012, 0xff38, 0x0010, 0xff71,
+	0x0010, 0x0dfe, 0x0003, 0x6142, 0x0012, 0x0c10, 0x0010, 0xff0c,
+	0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x0d88, 0x0010, 0x0003,
+	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb309, 0x001b, 0x819b,
+	0x0010, 0xb3fe, 0x0003, 0x61a3, 0x0000, 0xb305, 0x0015, 0x0033,
+	0x0010, 0xc00a, 0x001b, 0x81a1, 0x0003, 0x01a5, 0x0010, 0xc005,
+	0x0000, 0xc004, 0x0002, 0x033f, 0x0002, 0xff27, 0x0000, 0x0db8,
+	0x0004, 0x0366, 0x0000, 0x0db8, 0x0014, 0x07ed, 0x0015, 0x0030,
+	0x0000, 0x0400, 0x0011, 0xbc88, 0x0010, 0x0000, 0x0000, 0xff31,
+	0x0015, 0x0033, 0x0000, 0xb309, 0x000b, 0x81b2, 0x0011, 0xb3e8,
+	0x0000, 0x0002, 0x000b, 0x1142, 0x0005, 0x0002, 0x0010, 0x0005,
+	0x0003, 0x0144, 0x0012, 0x7849, 0x0003, 0x11c7, 0x0003, 0x0144,
+	0x0000, 0x0db8, 0x0012, 0x0345, 0x001b, 0x11c2, 0x0002, 0x033f,
+	0x0004, 0x0366, 0x0003, 0x0142, 0x0002, 0x033f, 0x0002, 0xff27,
+	0x0004, 0x0366, 0x0014, 0x07ed, 0x0003, 0x0142, 0x0015, 0x00b8,
+	0x0000, 0x0001, 0x0015, 0x003a, 0x0010, 0x0101, 0x0014, 0x07ed,
+	0x0013, 0x014f, 0x0000, 0x2bba, 0x0003, 0xb1ce, 0x0005, 0x002a,
+	0x0000, 0x0002, 0x0001, 0xbac8, 0x0000, 0x0700, 0x000b, 0x12a6,
+	0x0011, 0x15e8, 0x0000, 0x0002, 0x0013, 0x1221, 0x0011, 0x15e8,
+	0x0000, 0x0001, 0x0013, 0x11dd, 0x0005, 0x0015, 0x0010, 0x0000,
+	0x0013, 0x0204, 0x0005, 0x0015, 0x0010, 0x0000, 0x0002, 0xba43,
+	0x0013, 0x1205, 0x0013, 0xb1e1, 0x0005, 0x002a, 0x0000, 0x0004,
+	0x0012, 0xba42, 0x0003, 0x120b, 0x0012, 0x104b, 0x001b, 0x1204,
+	0x0000, 0x1a30, 0x0005, 0x0031, 0x0000, 0x0002, 0x0015, 0x0033,
+	0x0000, 0x1b2a, 0x000b, 0x81ed, 0x0010, 0x20b0, 0x0010, 0x21b1,
+	0x0010, 0x22b2, 0x0010, 0x23b3, 0x0010, 0x24b4, 0x0010, 0x25b5,
+	0x0010, 0x28b8, 0x0010, 0x29b9, 0x0000, 0x1a30, 0x0005, 0x0031,
+	0x0000, 0x0007, 0x0015, 0x0033, 0x0010, 0xb032, 0x001b, 0x81fb,
+	0x0000, 0x1a30, 0x0005, 0x0031, 0x0010, 0x000f, 0x0015, 0x0033,
+	0x0010, 0xb812, 0x001b, 0x8201, 0x0005, 0x0015, 0x0010, 0x0000,
+	0x0013, 0x0035, 0x0000, 0x1efe, 0x0013, 0x6219, 0x0014, 0x024b,
+	0x0000, 0x1efe, 0x000c, 0x624b, 0x0013, 0x0204, 0x0000, 0x1a30,
+	0x0005, 0x0031, 0x0000, 0x0020, 0x0015, 0x0033, 0x0000, 0xb009,
+	0x001b, 0x8210, 0x0002, 0xb02f, 0x0000, 0xffb0, 0x0005, 0x0031,
+	0x0000, 0x0020, 0x0015, 0x0033, 0x0000, 0xb00a, 0x000b, 0x8217,
+	0x0003, 0x01e8, 0x0015, 0x00b8, 0x0010, 0x0005, 0x0014, 0x07ed,
+	0x0000, 0x13b8, 0x0015, 0x003a, 0x0010, 0x0404, 0x0014, 0x07ed,
+	0x0013, 0x0204, 0x0005, 0x0015, 0x0000, 0x0001, 0x0012, 0xba42,
+	0x0013, 0x122e, 0x0003, 0xb225, 0x0010, 0x2bff, 0x0012, 0xff4f,
+	0x001b, 0x11cd, 0x0002, 0xba43, 0x001b, 0x120b, 0x0000, 0x1efe,
+	0x000c, 0x624b, 0x0013, 0x0204, 0x0010, 0x28b8, 0x0010, 0x29b9,
+	0x0004, 0x02bc, 0x0002, 0x3a42, 0x001b, 0x1204, 0x0000, 0x1c30,
+	0x0015, 0x00ff, 0x0000, 0x0002, 0x0002, 0x1f43, 0x001b, 0x123b,
+	0x0001, 0xff88, 0x0000, 0x0002, 0x0013, 0x023d, 0x0001, 0xff88,
+	0x0000, 0x0004, 0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb011,
+	0x001b, 0x8240, 0x0000, 0xb0ff, 0x0011, 0x16a0, 0x0000, 0xff16,
+	0x000b, 0x24e2, 0x0002, 0xb100, 0x0003, 0x0248, 0x0010, 0xb1ff,
+	0x0001, 0x17a0, 0x0010, 0xff17, 0x0013, 0x020b, 0x0000, 0x16ff,
+	0x0001, 0x18a0, 0x0010, 0xff00, 0x001b, 0x2252, 0x0002, 0x1700,
+	0x0013, 0x12a5, 0x0003, 0x0253, 0x0010, 0x17ff, 0x0011, 0x19a0,
+	0x0013, 0x22a5, 0x0011, 0x00d0, 0x0013, 0x12a5, 0x0000, 0x1c30,
+	0x0000, 0x1b31, 0x0015, 0x0033, 0x0000, 0xb131, 0x001b, 0x825b,
+	0x0013, 0xb25c, 0x0000, 0xb120, 0x0010, 0xb221, 0x0002, 0x1f43,
+	0x001b, 0x1268, 0x0010, 0xc022, 0x0000, 0xc023, 0x0000, 0xb324,
+	0x0000, 0xb425, 0x0010, 0xb3b5, 0x0000, 0xb4b6, 0x0003, 0x026c,
+	0x0000, 0xb322, 0x0000, 0xb423, 0x0000, 0xb524, 0x0010, 0xb625,
+	0x0013, 0xb26c, 0x0005, 0x002a, 0x0000, 0x0001, 0x0012, 0x1500,
+	0x0000, 0xff15, 0x0000, 0x16ff, 0x0001, 0xb580, 0x0000, 0xff16,
+	0x000b, 0x2277, 0x0002, 0x1700, 0x0003, 0x0278, 0x0010, 0x17ff,
+	0x0001, 0xb680, 0x0010, 0xff17, 0x0012, 0x1e10, 0x0010, 0xff1e,
+	0x0003, 0x62a5, 0x0002, 0x1d00, 0x0010, 0xff1d, 0x0010, 0xc030,
+	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb009, 0x001b, 0x8283,
+	0x0010, 0xb0fe, 0x000b, 0x62a4, 0x0000, 0x1c30, 0x0005, 0x0031,
+	0x0000, 0x0001, 0x0015, 0x0033, 0x0000, 0xb009, 0x000b, 0x828b,
+	0x0010, 0xb0fe, 0x000b, 0x6291, 0x0005, 0x00ce, 0x0010, 0x0005,
+	0x0003, 0x07b1, 0x0010, 0xb01c, 0x0000, 0x1c30, 0x0005, 0x0031,
+	0x0000, 0x0019, 0x0015, 0x0033, 0x0000, 0xb009, 0x001b, 0x8297,
+	0x0001, 0xb0c8, 0x0010, 0x00ff, 0x0000, 0xff1f, 0x0010, 0xc030,
+	0x0011, 0xbe80, 0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb009,
+	0x000b, 0x82a0, 0x0000, 0xb01d, 0x0010, 0x1dff, 0x0013, 0x027f,
+	0x0000, 0xb01b, 0x0017, 0x4000, 0x0002, 0x3a41, 0x0003, 0x12ae,
+	0x0003, 0xb2a8, 0x0005, 0x002a, 0x0000, 0x0004, 0x0005, 0x0015,
+	0x0010, 0x0000, 0x0013, 0x0204, 0x0000, 0x1a30, 0x0005, 0x0031,
+	0x0000, 0x0002, 0x0015, 0x0033, 0x0000, 0x1b2a, 0x001b, 0x82b3,
+	0x0015, 0x00b8, 0x0000, 0x0004, 0x0014, 0x07ed, 0x0000, 0x13b8,
+	0x0015, 0x003a, 0x0010, 0x0404, 0x0014, 0x07ed, 0x0013, 0x0039,
+	0x0002, 0x1e00, 0x0010, 0xff1e, 0x0012, 0x1d10, 0x0010, 0xff1d,
+	0x0010, 0xc030, 0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb009,
+	0x001b, 0x82c4, 0x0010, 0xb0fe, 0x000b, 0x62e9, 0x0000, 0x1cff,
+	0x0001, 0x1ae0, 0x0003, 0x12d3, 0x0000, 0x1c30, 0x0005, 0x0031,
+	0x0010, 0x0000, 0x0015, 0x0033, 0x0000, 0xb009, 0x000b, 0x82cf,
+	0x0010, 0xb0fe, 0x000b, 0x62d3, 0x0000, 0x1aff, 0x0000, 0xff1c,
+	0x0000, 0x1c30, 0x0005, 0x0031, 0x0000, 0x0019, 0x0015, 0x0033,
+	0x0000, 0xb009, 0x001b, 0x82d9, 0x0001, 0xb0c8, 0x0010, 0x000f,
+	0x0000, 0xff1f, 0x0001, 0xbf80, 0x0010, 0xff1d, 0x0010, 0xc030,
+	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb009, 0x001b, 0x82e3,
+	0x0010, 0xb0fe, 0x000b, 0x62e9, 0x0005, 0x00ce, 0x0010, 0x0006,
+	0x0003, 0x07b1, 0x0000, 0xb01b, 0x0017, 0x4000, 0x0010, 0x79b0,
+	0x0000, 0xd0ff, 0x0012, 0xff40, 0x001b, 0x1039, 0x0015, 0x00d1,
+	0x0010, 0x0101, 0x0013, 0x92f1, 0x0005, 0x0079, 0x0000, 0x0002,
+	0x0013, 0x92f4, 0x0015, 0x00d1, 0x0000, 0x0100, 0x0010, 0x13fe,
+	0x0003, 0x6329, 0x0012, 0xb04e, 0x000b, 0x133e, 0x0012, 0x784a,
+	0x0003, 0x1344, 0x0000, 0x75ff, 0x0011, 0xffc8, 0x0010, 0x1800,
+	0x001b, 0x1344, 0x0001, 0x0fe8, 0x0000, 0x0001, 0x000b, 0x130d,
+	0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x1388, 0x0000, 0x000e,
+	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0x8f0a, 0x000b, 0x830b,
+	0x0003, 0x034a, 0x0001, 0x0fe8, 0x0000, 0x0002, 0x001b, 0x1318,
+	0x0015, 0x0030, 0x0000, 0x0400, 0x0005, 0x0031, 0x0000, 0x001a,
+	0x0015, 0x0033, 0x0010, 0xc00a, 0x000b, 0x8316, 0x0003, 0x034a,
+	0x0001, 0x0fe8, 0x0010, 0x0000, 0x0013, 0x131f, 0x0005, 0x00ce,
+	0x0000, 0x0007, 0x0010, 0x0fcf, 0x0013, 0x07ab, 0x0000, 0x13b8,
+	0x0002, 0x1045, 0x0003, 0x1327, 0x0012, 0x103f, 0x0002, 0xff27,
+	0x0004, 0x0366, 0x0014, 0x07ed, 0x0003, 0x0329, 0x0012, 0x103f,
+	0x0004, 0x0366, 0x0015, 0x000f, 0x0010, 0x0000, 0x0002, 0x3944,
+	0x0013, 0x1332, 0x0015, 0x0039, 0x0000, 0x5040, 0x0015, 0x00b8,
+	0x0000, 0x0008, 0x0014, 0x07ed, 0x0015, 0x0030, 0x0000, 0x0400,
+	0x0001, 0xbd88, 0x0010, 0x000c, 0x0000, 0xff31, 0x0015, 0x0033,
+	0x0010, 0xc00a, 0x001b, 0x8339, 0x0010, 0xc014, 0x0000, 0xc013,
+	0x0000, 0xc010, 0x0013, 0x0039, 0x0015, 0x00b8, 0x0010, 0x0003,
+	0x0015, 0x003a, 0x0010, 0x0202, 0x0014, 0x07ed, 0x0003, 0x033d,
+	0x0015, 0x00b8, 0x0000, 0x0002, 0x0015, 0x003a, 0x0010, 0x0202,
+	0x0014, 0x07ed, 0x0003, 0x033d, 0x0015, 0x0030, 0x0000, 0x0400,
+	0x0011, 0x1388, 0x0010, 0x0003, 0x0000, 0xff31, 0x0015, 0x0033,
+	0x0000, 0xb009, 0x000b, 0x8351, 0x0011, 0x1388, 0x0010, 0x0003,
+	0x0000, 0xff31, 0x0015, 0x0033, 0x0010, 0xc00a, 0x000b, 0x8357,
+	0x0010, 0xb0fe, 0x0013, 0x635c, 0x0000, 0xb012, 0x0003, 0x035e,
+	0x0010, 0xc012, 0x0010, 0xc011, 0x0012, 0x104b, 0x0013, 0x131f,
+	0x0002, 0x103b, 0x0010, 0xff03, 0x0005, 0x0002, 0x0010, 0x0000,
+	0x0000, 0xc00d, 0x0003, 0x031f, 0x0000, 0xffb0, 0x0010, 0xc3b1,
+	0x0015, 0x0030, 0x0000, 0x0400, 0x0001, 0xb888, 0x0010, 0x0011,
+	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb012, 0x001b, 0x836f,
+	0x0017, 0x4000, 0x0012, 0x3a43, 0x0013, 0x1380, 0x0015, 0x003a,
+	0x0000, 0x0800, 0x0010, 0x0db0, 0x0003, 0x6380, 0x0000, 0x0bff,
+	0x0001, 0xb0e0, 0x0003, 0x13a6, 0x0010, 0x09ff, 0x0001, 0xb0e0,
+	0x0013, 0x138a, 0x0010, 0x05ff, 0x0001, 0xb0e0, 0x0003, 0x1384,
+	0x0000, 0xc00e, 0x0000, 0x05fe, 0x0013, 0x6387, 0x0000, 0x050d,
+	0x0005, 0x0002, 0x0000, 0x0004, 0x0003, 0x03a1, 0x0000, 0x09fe,
+	0x0013, 0x63a3, 0x0000, 0x090d, 0x0005, 0x0002, 0x0000, 0x0001,
+	0x0014, 0x0405, 0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x0d88,
+	0x0000, 0x0004, 0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xba09,
+	0x000b, 0x8394, 0x0011, 0x03c8, 0x0010, 0x000f, 0x0000, 0xffb6,
+	0x0011, 0xb6e8, 0x0000, 0x0001, 0x0013, 0x1499, 0x0011, 0xb6e8,
+	0x0000, 0x0002, 0x0013, 0x14bb, 0x0011, 0xb6e8, 0x0010, 0x0003,
+	0x0003, 0x15a6, 0x0004, 0x07b6, 0x0013, 0x0404, 0x0010, 0x0bfe,
+	0x0013, 0x6404, 0x0010, 0x0b0d, 0x0005, 0x0002, 0x0000, 0x0002,
+	0x0014, 0x0405, 0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x0d88,
+	0x0000, 0x0004, 0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xba09,
+	0x000b, 0x83b0, 0x0000, 0xb930, 0x0005, 0x0031, 0x0010, 0x0021,
+	0x0015, 0x0033, 0x0000, 0xb009, 0x000b, 0x83b6, 0x0001, 0xb0a8,
+	0x0000, 0x199a, 0x0013, 0x23bc, 0x0005, 0x00b0, 0x0000, 0x1999,
+	0x0012, 0xb050, 0x0000, 0xffb0, 0x0002, 0xff50, 0x0002, 0xff50,
+	0x0001, 0xb080, 0x0000, 0xffb0, 0x0015, 0x0030, 0x0000, 0x0400,
+	0x0011, 0x0d88, 0x0010, 0x0006, 0x0000, 0xff31, 0x0015, 0x0033,
+	0x0000, 0xb00a, 0x001b, 0x83c9, 0x0000, 0xb930, 0x0005, 0x0031,
+	0x0000, 0x0019, 0x0015, 0x0033, 0x0000, 0xb009, 0x001b, 0x83cf,
+	0x0001, 0xb0c8, 0x0010, 0x00ff, 0x0001, 0xffe8, 0x0010, 0x0048,
+	0x000b, 0x1414, 0x0005, 0x0002, 0x0010, 0x0006, 0x0012, 0x0c10,
+	0x0010, 0xff0c, 0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x0d88,
+	0x0010, 0x0003, 0x0000, 0xff31, 0x0015, 0x0033, 0x0010, 0xb109,
+	0x000b, 0x83e0, 0x0000, 0xb10b, 0x000b, 0x63e4, 0x0010, 0xb10a,
+	0x0015, 0x0033, 0x0010, 0xc00a, 0x000b, 0x83e6, 0x0002, 0x032b,
+	0x0010, 0xff03, 0x0011, 0x0d88, 0x0010, 0x0011, 0x0000, 0xff31,
+	0x0015, 0x0033, 0x0010, 0x030a, 0x001b, 0x83ee, 0x0000, 0x11fe,
+	0x000b, 0x63f3, 0x0000, 0x0d12, 0x0013, 0x03fc, 0x0015, 0x0030,
+	0x0000, 0x0400, 0x0001, 0x1188, 0x0010, 0x0003, 0x0000, 0xff31,
+	0x0010, 0x0db0, 0x0015, 0x0033, 0x0000, 0xb00a, 0x000b, 0x83fb,
+	0x0000, 0x0d11, 0x0013, 0x0404, 0x0000, 0x05fe, 0x0013, 0x6404,
+	0x0005, 0x0002, 0x0000, 0x0004, 0x0000, 0x050d, 0x0004, 0x07b6,
+	0x0013, 0x0047, 0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x0d88,
+	0x0010, 0x0011, 0x0000, 0xff31, 0x0015, 0x0033, 0x0010, 0x0309,
+	0x000b, 0x840c, 0x0011, 0x0d88, 0x0010, 0x0005, 0x0000, 0xff31,
+	0x0015, 0x0033, 0x0000, 0xb909, 0x000b, 0x8412, 0x0017, 0x4000,
+	0x0005, 0x00b6, 0x0010, 0x0600, 0x0014, 0x05d6, 0x0004, 0x0483,
+	0x0000, 0xb05a, 0x0000, 0xb15b, 0x0005, 0x0054, 0x0010, 0x0829,
+	0x0010, 0x0d58, 0x0015, 0x0059, 0x0010, 0xffff, 0x0000, 0xb930,
+	0x0005, 0x0031, 0x0010, 0x001e, 0x0015, 0x0033, 0x0000, 0xb009,
+	0x000b, 0x8424, 0x0000, 0xb05c, 0x0005, 0x0031, 0x0000, 0x001f,
+	0x0015, 0x0033, 0x0000, 0xb009, 0x001b, 0x842a, 0x0001, 0xb0c8,
+	0x0010, 0x000f, 0x001b, 0x1431, 0x0015, 0x00ff, 0x0010, 0x0005,
+	0x0003, 0x0439, 0x0002, 0xb040, 0x0013, 0x1436, 0x0015, 0x00ff,
+	0x0000, 0x0004, 0x0003, 0x0439, 0x0001, 0xb0c8, 0x0010, 0x0006,
+	0x0002, 0xff60, 0x0010, 0xffb2, 0x0011, 0x0d88, 0x0000, 0x0019,
+	0x0000, 0xff31, 0x0015, 0x0033, 0x0010, 0xb109, 0x000b, 0x843f,
+	0x0012, 0xb170, 0x0011, 0xffc8, 0x0010, 0xff00, 0x0011, 0xb2d0,
+	0x0010, 0xff60, 0x0002, 0xb045, 0x0003, 0x144a, 0x0015, 0x00b2,
+	0x0000, 0x0002, 0x0013, 0x0454, 0x0002, 0xb046, 0x0003, 0x144f,
+	0x0015, 0x00b2, 0x0000, 0x0001, 0x0013, 0x0454, 0x0015, 0x00b2,
+	0x0010, 0x0000, 0x0000, 0xc0b0, 0x0010, 0xc0b1, 0x0003, 0x045a,
+	0x0000, 0xb930, 0x0005, 0x0031, 0x0010, 0x002b, 0x0015, 0x0033,
+	0x0000, 0xb011, 0x000b, 0x8459, 0x0010, 0xb16a, 0x0010, 0xb06b,
+	0x0000, 0xb261, 0x0015, 0x0044, 0x0010, 0x0018, 0x0005, 0x0031,
+	0x0000, 0x0023, 0x0015, 0x0033, 0x0000, 0x6241, 0x000b, 0x8463,
+	0x0013, 0x9464, 0x0015, 0x00a0, 0x0000, 0x0020, 0x0012, 0xd041,
+	0x001b, 0x1467, 0x0015, 0x00d1, 0x0010, 0x0202, 0x0013, 0x946b,
+	0x0000, 0x75ff, 0x0011, 0xffc8, 0x0000, 0x1804, 0x0001, 0xffd8,
+	0x0010, 0x0009, 0x0003, 0x9471, 0x0000, 0xff75, 0x0013, 0x9473,
+	0x0015, 0x00d1, 0x0000, 0x0200, 0x0015, 0x0030, 0x0000, 0x0400,
+	0x0001, 0xbd88, 0x0000, 0x0008, 0x0000, 0xff31, 0x0015, 0x00b1,
+	0x0010, 0x07d0, 0x0005, 0x00b0, 0x0010, 0x0009, 0x0015, 0x0033,
+	0x0000, 0xb012, 0x000b, 0x8481, 0x0013, 0x0404, 0x0000, 0xba30,
+	0x0005, 0x0031, 0x0000, 0x0031, 0x0015, 0x0033, 0x0000, 0xb009,
+	0x000b, 0x8488, 0x0002, 0xb040, 0x0013, 0x1496, 0x0000, 0xb7b0,
+	0x0000, 0xb9b1, 0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x0d88,
+	0x0000, 0x0013, 0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb012,
+	0x001b, 0x8494, 0x0013, 0x0498, 0x0010, 0xc0b1, 0x0000, 0xc0b0,
+	0x0017, 0x4000, 0x0005, 0x00b6, 0x0010, 0x0500, 0x0014, 0x05d6,
+	0x0005, 0x0054, 0x0010, 0x0889, 0x0015, 0x0030, 0x0000, 0x0400,
+	0x0011, 0x0d88, 0x0000, 0x0002, 0x0000, 0xff31, 0x0015, 0x0033,
+	0x0000, 0xb009, 0x000b, 0x84a5, 0x0010, 0xb058, 0x0000, 0x0d59,
+	0x0000, 0xb930, 0x0005, 0x0031, 0x0000, 0x0023, 0x0015, 0x0033,
+	0x0000, 0xb011, 0x001b, 0x84ad, 0x0010, 0xb15c, 0x0010, 0xb05d,
+	0x0005, 0x0031, 0x0010, 0x002b, 0x0015, 0x0033, 0x0000, 0xb011,
+	0x000b, 0x84b4, 0x0000, 0xb15e, 0x0000, 0xb05f, 0x0003, 0x94b7,
+	0x0015, 0x00a0, 0x0010, 0x000c, 0x0013, 0x05bb, 0x0005, 0x00b6,
+	0x0000, 0x0700, 0x0014, 0x05d6, 0x0015, 0x0030, 0x0000, 0x0400,
+	0x0011, 0x0d88, 0x0010, 0x0009, 0x0000, 0xff31, 0x0015, 0x0033,
+	0x0010, 0xb709, 0x000b, 0x84c5, 0x0012, 0xb749, 0x0003, 0x14cb,
+	0x0005, 0x0054, 0x0010, 0x0889, 0x0013, 0x04cd, 0x0005, 0x0054,
+	0x0010, 0x0898, 0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x0d88,
+	0x0000, 0x0002, 0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb009,
+	0x000b, 0x84d4, 0x0010, 0xb058, 0x0000, 0x0d59, 0x0001, 0xb9a8,
+	0x0010, 0x00f0, 0x000b, 0x24f9, 0x0011, 0x0d88, 0x0010, 0x0005,
+	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb009, 0x001b, 0x84df,
+	0x0001, 0xb0c8, 0x0000, 0xf700, 0x0000, 0xffb0, 0x0011, 0xb0e8,
+	0x0000, 0xf100, 0x0013, 0x1540, 0x0011, 0xb0e8, 0x0000, 0xf200,
+	0x0013, 0x1545, 0x0011, 0xb0e8, 0x0010, 0xf300, 0x0013, 0x1568,
+	0x0011, 0xb0e8, 0x0000, 0xf400, 0x0013, 0x156d, 0x0011, 0xb0e8,
+	0x0010, 0xf500, 0x0013, 0x1540, 0x0011, 0xb0e8, 0x0010, 0xf600,
+	0x0003, 0x157e, 0x0005, 0x00ce, 0x0010, 0x0009, 0x0000, 0xb0cf,
+	0x0013, 0x07ab, 0x0000, 0xb930, 0x0005, 0x0031, 0x0000, 0x0025,
+	0x0015, 0x0033, 0x0000, 0xb039, 0x001b, 0x84fe, 0x0012, 0xb749,
+	0x0003, 0x1503, 0x0002, 0xb52c, 0x0000, 0xffb5, 0x0000, 0xb162,
+	0x0000, 0xb063, 0x0005, 0x0031, 0x0000, 0x001f, 0x0015, 0x0033,
+	0x0000, 0xb309, 0x001b, 0x8509, 0x0001, 0xb3c8, 0x0010, 0x0003,
+	0x0003, 0x1511, 0x0010, 0xffb2, 0x0001, 0xffe8, 0x0010, 0x0003,
+	0x000b, 0x1513, 0x0000, 0xc2b7, 0x0013, 0x059a, 0x0001, 0xb2e8,
+	0x0000, 0x0001, 0x0013, 0x151a, 0x0005, 0x00ce, 0x0010, 0x000a,
+	0x0010, 0xb2cf, 0x0013, 0x07ab, 0x0010, 0xb465, 0x0010, 0xb667,
+	0x0015, 0x00b7, 0x0010, 0x0018, 0x0001, 0xb5c8, 0x0010, 0x0300,
+	0x0003, 0x153f, 0x0012, 0xb548, 0x0013, 0x1526, 0x0000, 0xb6ff,
+	0x0011, 0xb780, 0x0010, 0xffb7, 0x0002, 0xb549, 0x0003, 0x152b,
+	0x0010, 0xb4ff, 0x0011, 0xb780, 0x0010, 0xffb7, 0x0015, 0x0044,
+	0x0010, 0x0018, 0x0005, 0x0031, 0x0000, 0x002c, 0x0015, 0x0033,
+	0x0000, 0x6841, 0x000b, 0x8531, 0x0015, 0x0044, 0x0000, 0x0019,
+	0x0005, 0x0031, 0x0000, 0x0034, 0x0015, 0x0033, 0x0000, 0x5029,
+	0x000b, 0x8538, 0x0015, 0x0044, 0x0000, 0x0008, 0x0011, 0xb7c8,
+	0x0010, 0x0003, 0x0003, 0x153f, 0x0010, 0xff55, 0x0013, 0x059a,
+	0x0005, 0x00b5, 0x0000, 0x0008, 0x0015, 0x00b7, 0x0010, 0x0018,
+	0x0013, 0x059a, 0x0011, 0x0d88, 0x0000, 0x000b, 0x0000, 0xff31,
+	0x0015, 0x0033, 0x0000, 0xb011, 0x000b, 0x854a, 0x0010, 0xb1ff,
+	0x0001, 0xb0d0, 0x0003, 0x1553, 0x0005, 0x00b5, 0x0010, 0x0b02,
+	0x0010, 0xb062, 0x0010, 0xb163, 0x0013, 0x0555, 0x0005, 0x00b5,
+	0x0000, 0x0302, 0x0015, 0x0065, 0x0010, 0x0012, 0x0005, 0x0067,
+	0x0000, 0x0008, 0x0015, 0x006c, 0x0000, 0x7000, 0x0005, 0x006d,
+	0x0010, 0x0500, 0x0015, 0x006f, 0x0010, 0x000a, 0x0015, 0x0044,
+	0x0000, 0x0001, 0x0005, 0x0052, 0x0000, 0x2500, 0x0015, 0x0044,
+	0x0000, 0x0008, 0x0015, 0x00b7, 0x0000, 0x0032, 0x0013, 0x059a,
+	0x0005, 0x00b5, 0x0010, 0x0028, 0x0015, 0x00b7, 0x0010, 0x0018,
+	0x0013, 0x059a, 0x0005, 0x00b5, 0x0000, 0x0100, 0x0005, 0x0067,
+	0x0000, 0x0008, 0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x0d88,
+	0x0010, 0x0018, 0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb009,
+	0x001b, 0x8578, 0x0001, 0xb0c8, 0x0010, 0x00ff, 0x0015, 0x00b7,
+	0x0000, 0x0020, 0x0013, 0x059a, 0x0015, 0x0030, 0x0000, 0x0400,
+	0x0011, 0x0d88, 0x0010, 0x0005, 0x0000, 0xff31, 0x0015, 0x0033,
+	0x0000, 0xb609, 0x000b, 0x8585, 0x0001, 0xb6c8, 0x0010, 0xff00,
+	0x0000, 0xffb0, 0x0015, 0x0033, 0x0000, 0xb00a, 0x001b, 0x858b,
+	0x0001, 0xb6c8, 0x0010, 0x00ff, 0x0012, 0xff10, 0x000b, 0x1594,
+	0x0000, 0xffb5, 0x0015, 0x00b7, 0x0010, 0x0018, 0x0013, 0x059a,
+	0x0010, 0xff63, 0x0005, 0x00b5, 0x0000, 0x0800, 0x0015, 0x00b7,
+	0x0010, 0x0018, 0x0013, 0x059a, 0x0015, 0x0030, 0x0000, 0x0400,
+	0x0011, 0x0d88, 0x0010, 0x0009, 0x0000, 0xff31, 0x0015, 0x0033,
+	0x0000, 0xb009, 0x000b, 0x85a1, 0x0010, 0xb561, 0x0013, 0x95a3,
+	0x0010, 0xb7a0, 0x0013, 0x05bb, 0x0005, 0x00b6, 0x0010, 0x0300,
+	0x0014, 0x05d6, 0x0005, 0x0054, 0x0010, 0x0819, 0x0010, 0x0d58,
+	0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x0d88, 0x0000, 0x0002,
+	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb009, 0x000b, 0x85b3,
+	0x0000, 0xb059, 0x0003, 0x95b5, 0x0010, 0xc0a0, 0x0010, 0x71ff,
+	0x0002, 0xff28, 0x0010, 0xff71, 0x0013, 0x05bb, 0x0012, 0xd041,
+	0x001b, 0x15bb, 0x0015, 0x00d1, 0x0010, 0x0202, 0x0000, 0x75ff,
+	0x0011, 0xffc8, 0x0000, 0x1804, 0x0001, 0xffd8, 0x0010, 0x0009,
+	0x0003, 0x95c4, 0x0000, 0xff75, 0x0013, 0x95c6, 0x0015, 0x00d1,
+	0x0000, 0x0200, 0x0015, 0x0030, 0x0000, 0x0400, 0x0001, 0xbd88,
+	0x0000, 0x0008, 0x0000, 0xff31, 0x0005, 0x00b0, 0x0010, 0x0009,
+	0x0015, 0x00b1, 0x0010, 0x07d0, 0x0015, 0x0033, 0x0000, 0xb012,
+	0x001b, 0x85d4, 0x0013, 0x0404, 0x0015, 0x0044, 0x0000, 0x0008,
+	0x0005, 0x0098, 0x0010, 0x0056, 0x0015, 0x0099, 0x0000, 0x9575,
+	0x0014, 0x0772, 0x0000, 0xb096, 0x0012, 0xb270, 0x0010, 0xff56,
+	0x0004, 0x0794, 0x0010, 0xb052, 0x0010, 0xb153, 0x0000, 0xb6ff,
+	0x0011, 0xb2d0, 0x0010, 0xff50, 0x0010, 0xb351, 0x0017, 0x4000,
+	0x0015, 0x0030, 0x0000, 0x0400, 0x0001, 0x1288, 0x0010, 0x0011,
+	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0x1009, 0x000b, 0x85ef,
+	0x0015, 0x000f, 0x0000, 0x0001, 0x0010, 0xc014, 0x0000, 0x1213,
+	0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x1388, 0x0000, 0x0004,
+	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xba09, 0x000b, 0x85fb,
+	0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x1388, 0x0010, 0x0005,
+	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0x1a09, 0x001b, 0x8603,
+	0x0012, 0x104b, 0x001b, 0x160c, 0x0000, 0x1a30, 0x0005, 0x0031,
+	0x0000, 0x000b, 0x0015, 0x0033, 0x0000, 0x1621, 0x000b, 0x860b,
+	0x0010, 0x15fe, 0x001b, 0x6615, 0x0004, 0x0633, 0x0002, 0x3a42,
+	0x000b, 0x1632, 0x0001, 0x10c8, 0x0010, 0x000f, 0x001b, 0x1695,
+	0x0003, 0x0631, 0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x1388,
+	0x0010, 0x0003, 0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb009,
+	0x000b, 0x861c, 0x0015, 0x0033, 0x0010, 0xc00a, 0x000b, 0x861f,
+	0x0010, 0xb0fe, 0x0013, 0x6624, 0x0000, 0xb012, 0x0003, 0x0626,
+	0x0010, 0xc012, 0x0010, 0xc011, 0x0015, 0x000f, 0x0010, 0x0000,
+	0x0002, 0x3944, 0x0013, 0x162f, 0x0015, 0x0039, 0x0000, 0x5040,
+	0x0015, 0x00b8, 0x0000, 0x0008, 0x0014, 0x07ed, 0x0000, 0xc013,
+	0x0003, 0x0632, 0x0004, 0x07d9, 0x0003, 0x0051, 0x0003, 0xb633,
+	0x0005, 0x002a, 0x0000, 0x0004, 0x0000, 0xba30, 0x0005, 0x0031,
+	0x0010, 0x001b, 0x0015, 0x0033, 0x0000, 0xb009, 0x000b, 0x863b,
+	0x0000, 0xc02c, 0x0000, 0xb02d, 0x0012, 0x104b, 0x0003, 0x1656,
+	0x0000, 0x1a30, 0x0005, 0x0031, 0x0000, 0x0023, 0x0015, 0x0033,
+	0x0000, 0xb129, 0x000b, 0x8645, 0x0000, 0xb120, 0x0010, 0xb221,
+	0x0000, 0xb322, 0x0000, 0xb423, 0x0000, 0xb524, 0x0000, 0xc025,
+	0x0010, 0xb526, 0x0010, 0xc027, 0x0010, 0xb516, 0x0010, 0xc017,
+	0x0000, 0xb518, 0x0000, 0xc019, 0x0010, 0xc028, 0x0000, 0xc029,
+	0x0010, 0xc01e, 0x0003, 0x068c, 0x0012, 0x1044, 0x0013, 0x1686,
+	0x0002, 0x1034, 0x0000, 0xff10, 0x0000, 0x1a30, 0x0005, 0x0031,
+	0x0000, 0x0002, 0x0015, 0x0033, 0x0000, 0x1b29, 0x001b, 0x865f,
+	0x0000, 0x1c30, 0x0000, 0x1b31, 0x0015, 0x0033, 0x0000, 0xb131,
+	0x000b, 0x8664, 0x0002, 0x1f43, 0x000b, 0x166b, 0x0010, 0xb3b5,
+	0x0000, 0xb4b6, 0x0000, 0xc0b3, 0x0010, 0xc0b4, 0x0000, 0xb120,
+	0x0010, 0xb221, 0x0000, 0xb322, 0x0000, 0xb423, 0x0000, 0xb524,
+	0x0010, 0xb625, 0x0010, 0xb516, 0x0000, 0xb617, 0x0000, 0x1826,
+	0x0000, 0x1927, 0x0000, 0x1a30, 0x0005, 0x0031, 0x0010, 0x000f,
+	0x0015, 0x0033, 0x0000, 0xb011, 0x000b, 0x867a, 0x0000, 0xb028,
+	0x0000, 0xb129, 0x0012, 0x1e10, 0x0010, 0xff1e, 0x0003, 0x668c,
+	0x0002, 0x1d00, 0x0010, 0xff1d, 0x0004, 0x027f, 0x0002, 0x3a42,
+	0x0013, 0x168c, 0x0003, 0x0694, 0x0000, 0x1a30, 0x0005, 0x0031,
+	0x0000, 0x0002, 0x0015, 0x0033, 0x0000, 0x1b79, 0x001b, 0x868b,
+	0x0013, 0xb68c, 0x0005, 0x002a, 0x0000, 0x0001, 0x0005, 0x0015,
+	0x0000, 0x0001, 0x0000, 0x1efe, 0x0003, 0x6694, 0x0003, 0x024b,
+	0x0017, 0x4000, 0x0000, 0xba30, 0x0005, 0x0031, 0x0010, 0x001b,
+	0x0015, 0x0033, 0x0010, 0xb051, 0x001b, 0x869a, 0x0000, 0xb0a3,
+	0x0010, 0xb697, 0x0010, 0xb946, 0x0015, 0x00a5, 0x0000, 0x0010,
+	0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x1388, 0x0000, 0x0002,
+	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb509, 0x000b, 0x86a7,
+	0x0004, 0x0794, 0x0004, 0x0783, 0x0012, 0xb470, 0x0010, 0xffb4,
+	0x0010, 0xb48e, 0x0010, 0xb08a, 0x0010, 0xb18b, 0x0012, 0x104d,
+	0x0003, 0x16b2, 0x0003, 0x06df, 0x0012, 0x104b, 0x0003, 0x16c5,
+	0x0005, 0x008c, 0x0010, 0x0829, 0x0010, 0xc08d, 0x0001, 0xb2d8,
+	0x0010, 0x0600, 0x0010, 0xff88, 0x0010, 0xb389, 0x0000, 0x1390,
+	0x0010, 0xb591, 0x0000, 0xc08f, 0x0010, 0x1ab9, 0x0004, 0x0483,
+	0x0013, 0x96c0, 0x0010, 0xb092, 0x0010, 0xb193, 0x0013, 0x96c3,
+	0x0003, 0x06da, 0x0005, 0x008c, 0x0000, 0x0809, 0x0015, 0x008d,
+	0x0000, 0x0008, 0x0001, 0xb2d8, 0x0000, 0x0100, 0x0010, 0xff88,
+	0x0010, 0xb389, 0x0000, 0x1390, 0x0010, 0xb591, 0x0000, 0xc08f,
+	0x0000, 0x1a30, 0x0005, 0x0031, 0x0010, 0x000f, 0x0015, 0x0033,
+	0x0000, 0xb011, 0x000b, 0x86d5, 0x0003, 0x96d6, 0x0000, 0xb192,
+	0x0000, 0xb093, 0x0003, 0x96d9, 0x0010, 0x19a1, 0x0000, 0x18a2,
+	0x0015, 0x00b1, 0x0010, 0x0096, 0x0003, 0x074e, 0x0000, 0xb590,
+	0x0010, 0x1391, 0x0001, 0x10c8, 0x0010, 0x000f, 0x0001, 0xffe8,
+	0x0010, 0x0005, 0x0013, 0x1706, 0x0001, 0xb2d8, 0x0000, 0x0700,
+	0x0010, 0xff88, 0x0010, 0xb389, 0x0015, 0x0030, 0x0000, 0x0400,
+	0x0011, 0x1388, 0x0010, 0x0009, 0x0000, 0xff31, 0x0015, 0x0033,
+	0x0000, 0xb009, 0x000b, 0x86f1, 0x0002, 0xb049, 0x0003, 0x16f9,
+	0x0005, 0x008c, 0x0010, 0x0889, 0x0015, 0x00b1, 0x0010, 0x0096,
+	0x0003, 0x06fd, 0x0005, 0x008c, 0x0010, 0x0898, 0x0015, 0x00b1,
+	0x0000, 0x0092, 0x0010, 0xc08d, 0x0000, 0xc08f, 0x0013, 0x96ff,
+	0x0000, 0xc092, 0x0010, 0xc093, 0x0013, 0x9702, 0x0010, 0x19a1,
+	0x0000, 0x18a2, 0x0003, 0x074e, 0x0001, 0xb2d8, 0x0000, 0x0100,
+	0x0010, 0xff88, 0x0010, 0xb389, 0x0005, 0x008c, 0x0010, 0x0880,
+	0x0015, 0x008d, 0x0000, 0x0008, 0x0011, 0x1388, 0x0000, 0x000e,
+	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb009, 0x001b, 0x8713,
+	0x0010, 0xb08f, 0x0000, 0xb590, 0x0010, 0x1391, 0x0000, 0x1a30,
+	0x0005, 0x0031, 0x0000, 0x000d, 0x0015, 0x0033, 0x0000, 0xb021,
+	0x001b, 0x871c, 0x0003, 0x971d, 0x0010, 0xb392, 0x0010, 0xb293,
+	0x0013, 0x9720, 0x0000, 0xb1a1, 0x0010, 0xb0a2, 0x0015, 0x0030,
+	0x0000, 0x0400, 0x0011, 0x1388, 0x0000, 0x000b, 0x0000, 0xff31,
+	0x0015, 0x0033, 0x0010, 0xb211, 0x001b, 0x872a, 0x0000, 0xb3ff,
+	0x0001, 0xb080, 0x0000, 0xffb3, 0x001b, 0x2731, 0x0002, 0xb200,
+	0x0013, 0x0732, 0x0010, 0xb2ff, 0x0011, 0xb180, 0x0010, 0xffb2,
+	0x0011, 0x1388, 0x0000, 0x000b, 0x0000, 0xff31, 0x0015, 0x0033,
+	0x0010, 0xb212, 0x000b, 0x8739, 0x0015, 0x00b1, 0x0000, 0x0092,
+	0x0002, 0x104c, 0x0003, 0x174c, 0x0011, 0xc2e8, 0x0010, 0x000c,
+	0x000b, 0x1744, 0x0015, 0x00ff, 0x0000, 0x0800, 0x0013, 0x074c,
+	0x0011, 0xc2e8, 0x0000, 0x0020, 0x001b, 0x174a, 0x0015, 0x00ff,
+	0x0010, 0x1800, 0x0013, 0x074c, 0x0015, 0x00ff, 0x0000, 0x1000,
+	0x0011, 0xb1d0, 0x0010, 0xffb1, 0x0015, 0x009a, 0x0010, 0x0036,
+	0x0005, 0x009b, 0x0000, 0x95d5, 0x0012, 0xd041, 0x001b, 0x1752,
+	0x0015, 0x00d1, 0x0010, 0x0202, 0x0003, 0x9756, 0x0012, 0x104e,
+	0x0003, 0x175b, 0x0012, 0xb12f, 0x0010, 0xffb1, 0x0000, 0xb175,
+	0x0003, 0x975c, 0x0015, 0x00d1, 0x0000, 0x0200, 0x0001, 0x19c8,
+	0x0010, 0xfff0, 0x000b, 0x1765, 0x0015, 0x00b1, 0x0010, 0x07d0,
+	0x0013, 0x0767, 0x0015, 0x00b1, 0x0000, 0x1b58, 0x0005, 0x00b0,
+	0x0010, 0x0009, 0x0015, 0x0030, 0x0000, 0x0400, 0x0001, 0xbd88,
+	0x0000, 0x000b, 0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb012,
+	0x001b, 0x8770, 0x0003, 0x0632, 0x0000, 0xba30, 0x0005, 0x0031,
+	0x0010, 0x0021, 0x0015, 0x0033, 0x0010, 0xb019, 0x000b, 0x8777,
+	0x0002, 0xb200, 0x0011, 0xffc8, 0x0010, 0x00ff, 0x0010, 0xffb2,
+	0x0010, 0xb2b7, 0x0005, 0x0031, 0x0000, 0x0023, 0x0015, 0x0033,
+	0x0010, 0xb20a, 0x000b, 0x8781, 0x0017, 0x4000, 0x0000, 0xba30,
+	0x0005, 0x0031, 0x0000, 0x0023, 0x0015, 0x0033, 0x0010, 0xb409,
+	0x000b, 0x8788, 0x0002, 0xb400, 0x0011, 0xffc8, 0x0010, 0x00ff,
+	0x0010, 0xffb4, 0x0010, 0xb4b7, 0x0005, 0x0031, 0x0000, 0x0023,
+	0x0015, 0x0033, 0x0010, 0xb40a, 0x001b, 0x8792, 0x0017, 0x4000,
+	0x0000, 0xba30, 0x0001, 0xc7c8, 0x0000, 0x0020, 0x000b, 0x17a0,
+	0x0005, 0x0031, 0x0010, 0x0028, 0x0015, 0x0033, 0x0010, 0xb209,
+	0x000b, 0x879c, 0x0011, 0xb2c8, 0x0000, 0xff80, 0x0013, 0x17a3,
+	0x0010, 0xc4b0, 0x0010, 0xc5b1, 0x0003, 0x07a5, 0x0010, 0xc6b1,
+	0x0000, 0xc0b0, 0x0005, 0x0031, 0x0000, 0x0004, 0x0015, 0x0033,
+	0x0010, 0xb211, 0x000b, 0x87a9, 0x0017, 0x4000, 0x0015, 0x00b8,
+	0x0010, 0x0009, 0x0015, 0x003a, 0x0010, 0x0707, 0x0014, 0x07ed,
+	0x0013, 0x002d, 0x0015, 0x00b8, 0x0010, 0x0009, 0x0015, 0x003a,
+	0x0010, 0x0707, 0x0003, 0x07ed, 0x0004, 0x0110, 0x0015, 0x0030,
+	0x0000, 0x0400, 0x0011, 0x0d88, 0x0000, 0x0004, 0x0000, 0xff31,
+	0x0015, 0x0033, 0x0000, 0xba09, 0x000b, 0x87be, 0x0014, 0x0772,
+	0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x0d88, 0x0000, 0x0010,
+	0x0000, 0xff31, 0x0015, 0x0033, 0x0010, 0xb20a, 0x001b, 0x87c7,
+	0x0011, 0x0d88, 0x0010, 0x0011, 0x0000, 0xff31, 0x0015, 0x0033,
+	0x0010, 0x0309, 0x001b, 0x87cd, 0x0002, 0x0327, 0x0010, 0xffb2,
+	0x0011, 0x0d88, 0x0010, 0x0011, 0x0000, 0xff31, 0x0015, 0x0033,
+	0x0010, 0xb20a, 0x001b, 0x87d5, 0x0015, 0x00b8, 0x0010, 0x0006,
+	0x0003, 0x07ed, 0x0014, 0x0122, 0x0014, 0x0772, 0x0015, 0x0030,
+	0x0000, 0x0400, 0x0011, 0x1388, 0x0000, 0x0010, 0x0000, 0xff31,
+	0x0015, 0x0033, 0x0010, 0xb20a, 0x000b, 0x87e2, 0x0012, 0x1027,
+	0x0010, 0xffb2, 0x0011, 0x1388, 0x0010, 0x0011, 0x0000, 0xff31,
+	0x0015, 0x0033, 0x0010, 0xb20a, 0x001b, 0x87ea, 0x0015, 0x00b8,
+	0x0000, 0x0007, 0x0013, 0x47ed, 0x0000, 0xb838, 0x0017, 0x4000,
+	0xa85a, 0x97da
+};
+unsigned short xseqflx_code_length01 = 0x0fe2;
--- diff/include/asm-alpha/lockmeter.h	1970-01-01 01:00:00.000000000 +0100
+++ source/include/asm-alpha/lockmeter.h	2004-02-09 10:39:56.000000000 +0000
@@ -0,0 +1,90 @@
+/*
+ *  Written by John Hawkes (hawkes@sgi.com)
+ *  Based on klstat.h by Jack Steiner (steiner@sgi.com)
+ *
+ *  Modified by Peter Rival (frival@zk3.dec.com)
+ */
+
+#ifndef _ALPHA_LOCKMETER_H
+#define _ALPHA_LOCKMETER_H
+
+#include <asm/hwrpb.h>
+#define CPU_CYCLE_FREQUENCY	hwrpb->cycle_freq
+
+#define get_cycles64()		get_cycles()
+
+#define THIS_CPU_NUMBER		smp_processor_id()
+
+#include <linux/version.h>
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0)
+#define local_irq_save(x) \
+	__save_and_cli(x)
+#define local_irq_restore(x) \
+	__restore_flags(x)
+#endif	/* Linux version 2.2.x */
+
+#define SPINLOCK_MAGIC_INIT /**/
+
+/*
+ * Macros to cache and retrieve an index value inside of a lock
+ * these macros assume that there are less than 65536 simultaneous
+ * (read mode) holders of a rwlock.
+ * We also assume that the hash table has less than 32767 entries.
+ * the high order bit is used for write locking a rw_lock
+ * Note: although these defines and macros are the same as what is being used
+ *       in include/asm-i386/lockmeter.h, they are present here to easily
+ *	 allow an alternate Alpha implementation.
+ */
+/*
+ * instrumented spinlock structure -- never used to allocate storage
+ * only used in macros below to overlay a spinlock_t
+ */
+typedef struct inst_spinlock_s {
+	/* remember, Alpha is little endian */
+	unsigned short lock;
+	unsigned short index;
+} inst_spinlock_t;
+#define PUT_INDEX(lock_ptr,indexv)	((inst_spinlock_t *)(lock_ptr))->index = indexv
+#define GET_INDEX(lock_ptr)		((inst_spinlock_t *)(lock_ptr))->index
+
+/*
+ * macros to cache and retrieve an index value in a read/write lock
+ * as well as the cpu where a reader busy period started
+ * we use the 2nd word (the debug word) for this, so require the
+ * debug word to be present
+ */
+/*
+ * instrumented rwlock structure -- never used to allocate storage
+ * only used in macros below to overlay a rwlock_t
+ */
+typedef struct inst_rwlock_s {
+	volatile int lock;
+	unsigned short index;
+	unsigned short cpu;
+} inst_rwlock_t;
+#define PUT_RWINDEX(rwlock_ptr,indexv)	((inst_rwlock_t *)(rwlock_ptr))->index = indexv
+#define GET_RWINDEX(rwlock_ptr)		((inst_rwlock_t *)(rwlock_ptr))->index
+#define PUT_RW_CPU(rwlock_ptr,cpuv)	((inst_rwlock_t *)(rwlock_ptr))->cpu = cpuv
+#define GET_RW_CPU(rwlock_ptr)		((inst_rwlock_t *)(rwlock_ptr))->cpu
+
+/*
+ * return true if rwlock is write locked
+ * (note that other lock attempts can cause the lock value to be negative)
+ */
+#define RWLOCK_IS_WRITE_LOCKED(rwlock_ptr) (((inst_rwlock_t *)rwlock_ptr)->lock & 1)
+#define IABS(x) ((x) > 0 ? (x) : -(x))
+
+#define RWLOCK_READERS(rwlock_ptr)	rwlock_readers(rwlock_ptr)
+extern inline int rwlock_readers(rwlock_t *rwlock_ptr)
+{
+	int tmp = (int) ((inst_rwlock_t *)rwlock_ptr)->lock;
+	/* readers subtract 2, so we have to:		*/
+	/* 	- andnot off a possible writer (bit 0)	*/
+	/*	- get the absolute value		*/
+	/*	- divide by 2 (right shift by one)	*/
+	/* to find the number of readers		*/
+	if (tmp == 0) return(0);
+	else return(IABS(tmp & ~1)>>1);
+}
+
+#endif /* _ALPHA_LOCKMETER_H */
--- diff/include/asm-generic/compat_signal.h	1970-01-01 01:00:00.000000000 +0100
+++ source/include/asm-generic/compat_signal.h	2004-02-09 10:39:56.000000000 +0000
@@ -0,0 +1,25 @@
+#ifndef _ASM_GENERIC_COMPAT_SIGNAL_H
+#define _ASM_GENERIC_COMPAT_SIGNAL_H
+
+#ifndef __ASSEMBLY__
+#include <linux/compat.h>
+
+typedef compat_uptr_t compat_sighandler_t;
+
+typedef struct compat_sigaltstack {
+	compat_uptr_t ss_sp;
+	compat_int_t ss_flags;
+	compat_size_t ss_size;
+} compat_stack_t;
+
+/* Most things should be clean enough to redefine this at will, if care
+   is taken to make libc match.  */
+
+struct compat_sigaction {
+	compat_sighandler_t sa_handler;
+	compat_uint_t sa_flags;
+	compat_sigset_t sa_mask;		/* mask last for extensibility */
+};
+
+#endif /* !__ASSEMBLY__ */
+#endif /* !_ASM_GENERIC_COMPAT_SIGNAL_H */
--- diff/include/asm-i386/atomic_kmap.h	1970-01-01 01:00:00.000000000 +0100
+++ source/include/asm-i386/atomic_kmap.h	2004-02-09 10:39:56.000000000 +0000
@@ -0,0 +1,95 @@
+/*
+ * atomic_kmap.h: temporary virtual kernel memory mappings
+ *
+ * Copyright (C) 2003 Ingo Molnar <mingo@redhat.com>
+ */
+
+#ifndef _ASM_ATOMIC_KMAP_H
+#define _ASM_ATOMIC_KMAP_H
+
+#ifdef __KERNEL__
+
+#include <linux/config.h>
+#include <asm/tlbflush.h>
+
+#ifdef CONFIG_DEBUG_HIGHMEM
+#define HIGHMEM_DEBUG 1
+#else
+#define HIGHMEM_DEBUG 0
+#endif
+
+extern pte_t *kmap_pte;
+#define kmap_prot PAGE_KERNEL
+
+#define PKMAP_BASE (0xff000000UL)
+#define NR_SHARED_PMDS ((0xffffffff-PKMAP_BASE+1)/PMD_SIZE)
+
+static inline unsigned long __kmap_atomic_vaddr(enum km_type type)
+{
+	enum fixed_addresses idx;
+
+	idx = type + KM_TYPE_NR*smp_processor_id();
+	return __fix_to_virt(FIX_KMAP_BEGIN + idx);
+}
+
+static inline void *__kmap_atomic_noflush(struct page *page, enum km_type type)
+{
+	enum fixed_addresses idx;
+	unsigned long vaddr;
+
+	idx = type + KM_TYPE_NR*smp_processor_id();
+	vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
+	/*
+	 * NOTE: entries that rely on some secondary TLB-flush
+	 * effect must not be global:
+	 */
+	set_pte(kmap_pte-idx, mk_pte(page, PAGE_KERNEL));
+
+	return (void*) vaddr;
+}
+
+static inline void *__kmap_atomic(struct page *page, enum km_type type)
+{
+	enum fixed_addresses idx;
+	unsigned long vaddr;
+
+	idx = type + KM_TYPE_NR*smp_processor_id();
+	vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
+#if HIGHMEM_DEBUG
+	BUG_ON(!pte_none(*(kmap_pte-idx)));
+#else
+	/*
+	 * Performance optimization - do not flush if the new
+	 * pte is the same as the old one:
+	 */
+	if (pte_val(*(kmap_pte-idx)) == pte_val(mk_pte(page, kmap_prot)))
+		return (void *) vaddr;
+#endif
+	set_pte(kmap_pte-idx, mk_pte(page, kmap_prot));
+	__flush_tlb_one(vaddr);
+
+	return (void*) vaddr;
+}
+
+static inline void __kunmap_atomic(void *kvaddr, enum km_type type)
+{
+#if HIGHMEM_DEBUG
+	unsigned long vaddr = (unsigned long) kvaddr & PAGE_MASK;
+	enum fixed_addresses idx = type + KM_TYPE_NR*smp_processor_id();
+
+	BUG_ON(vaddr != __fix_to_virt(FIX_KMAP_BEGIN+idx));
+	/*
+	 * force other mappings to Oops if they'll try to access
+	 * this pte without first remap it
+	 */
+	pte_clear(kmap_pte-idx);
+	__flush_tlb_one(vaddr);
+#endif
+}
+
+#define __kunmap_atomic_type(type) \
+		__kunmap_atomic((void *)__kmap_atomic_vaddr(type), (type))
+
+#endif /* __KERNEL__ */
+
+#endif /* _ASM_ATOMIC_KMAP_H */
--- diff/include/asm-i386/kgdb.h	1970-01-01 01:00:00.000000000 +0100
+++ source/include/asm-i386/kgdb.h	2004-02-09 10:39:56.000000000 +0000
@@ -0,0 +1,69 @@
+#ifndef __KGDB
+#define __KGDB
+
+/*
+ * This file should not include ANY others.  This makes it usable
+ * most anywhere without the fear of include order or inclusion.
+ * Make it so!
+ *
+ * This file may be included all the time.  It is only active if
+ * CONFIG_KGDB is defined, otherwise it stubs out all the macros
+ * and entry points.
+ */
+#if defined(CONFIG_KGDB) && !defined(__ASSEMBLY__)
+
+extern void breakpoint(void);
+#define INIT_KGDB_INTS kgdb_enable_ints()
+
+#ifndef BREAKPOINT
+#define BREAKPOINT   asm("   int $3")
+#endif
+
+extern void kgdb_schedule_breakpoint(void);
+extern void kgdb_process_breakpoint(void);
+
+extern int kgdb_tty_hook(void);
+extern int kgdb_eth_hook(void);
+extern int kgdboe;
+
+/*
+ * GDB debug stub (or any debug stub) can point the 'linux_debug_hook'
+ * pointer to its routine and it will be entered as the first thing
+ * when a trap occurs.
+ *
+ * Return values are, at present, undefined.
+ *
+ * The debug hook routine does not necessarily return to its caller.
+ * It has the register image and thus may choose to resume execution
+ * anywhere it pleases.
+ */
+struct pt_regs;
+
+extern int kgdb_handle_exception(int trapno,
+				 int signo, int err_code, struct pt_regs *regs);
+extern int in_kgdb(struct pt_regs *regs);
+
+#ifdef CONFIG_KGDB_TS
+void kgdb_tstamp(int line, char *source, int data0, int data1);
+/*
+ * This is the time stamp function.  The macro adds the source info and
+ * does a cast on the data to allow most any 32-bit value.
+ */
+
+#define kgdb_ts(data0,data1) kgdb_tstamp(__LINE__,__FILE__,(int)data0,(int)data1)
+#else
+#define kgdb_ts(data0,data1)
+#endif
+#else				/* CONFIG_KGDB  && ! __ASSEMBLY__ ,stubs follow... */
+#ifndef BREAKPOINT
+#define BREAKPOINT
+#endif
+#define kgdb_ts(data0,data1)
+#define in_kgdb
+#define kgdb_handle_exception
+#define breakpoint
+#define INIT_KGDB_INTS
+#define kgdb_process_breakpoint() do {} while(0)
+
+#endif
+#endif				/* __KGDB */
--- diff/include/asm-i386/kgdb_local.h	1970-01-01 01:00:00.000000000 +0100
+++ source/include/asm-i386/kgdb_local.h	2004-02-09 10:39:56.000000000 +0000
@@ -0,0 +1,102 @@
+#ifndef __KGDB_LOCAL
+#define ___KGDB_LOCAL
+#include <linux/config.h>
+#include <linux/types.h>
+#include <linux/serial.h>
+#include <linux/serialP.h>
+#include <linux/spinlock.h>
+#include <asm/processor.h>
+#include <asm/msr.h>
+#include <asm/kgdb.h>
+
+#define PORT 0x3f8
+#ifdef CONFIG_KGDB_PORT
+#undef PORT
+#define PORT CONFIG_KGDB_PORT
+#endif
+#define IRQ 4
+#ifdef CONFIG_KGDB_IRQ
+#undef IRQ
+#define IRQ CONFIG_KGDB_IRQ
+#endif
+#define SB_CLOCK 1843200
+#define SB_BASE (SB_CLOCK/16)
+#define SB_BAUD9600 SB_BASE/9600
+#define SB_BAUD192  SB_BASE/19200
+#define SB_BAUD384  SB_BASE/38400
+#define SB_BAUD576  SB_BASE/57600
+#define SB_BAUD1152 SB_BASE/115200
+#ifdef CONFIG_KGDB_9600BAUD
+#define SB_BAUD SB_BAUD9600
+#endif
+#ifdef CONFIG_KGDB_19200BAUD
+#define SB_BAUD SB_BAUD192
+#endif
+#ifdef CONFIG_KGDB_38400BAUD
+#define SB_BAUD SB_BAUD384
+#endif
+#ifdef CONFIG_KGDB_57600BAUD
+#define SB_BAUD SB_BAUD576
+#endif
+#ifdef CONFIG_KGDB_115200BAUD
+#define SB_BAUD SB_BAUD1152
+#endif
+#ifndef SB_BAUD
+#define SB_BAUD SB_BAUD1152	/* Start with this if not given */
+#endif
+
+#ifndef CONFIG_X86_TSC
+#undef rdtsc
+#define rdtsc(a,b) if (a++ > 10000){a = 0; b++;}
+#undef rdtscll
+#define rdtscll(s) s++
+#endif
+
+#ifdef _raw_read_unlock		/* must use a name that is "define"ed, not an inline */
+#undef spin_lock
+#undef spin_trylock
+#undef spin_unlock
+#define spin_lock	 _raw_spin_lock
+#define spin_trylock	 _raw_spin_trylock
+#define spin_unlock	 _raw_spin_unlock
+#else
+#endif
+#undef spin_unlock_wait
+#define spin_unlock_wait(x)  do { cpu_relax(); barrier();} \
+                                     while(spin_is_locked(x))
+
+#define SB_IER 1
+#define SB_MCR UART_MCR_OUT2 | UART_MCR_DTR | UART_MCR_RTS
+
+#define FLAGS 0
+#define SB_STATE { \
+     magic: SSTATE_MAGIC, \
+     baud_base: SB_BASE,  \
+     port:      PORT,     \
+     irq:       IRQ,      \
+     flags:     FLAGS,    \
+     custom_divisor:SB_BAUD}
+#define SB_INFO  { \
+      magic: SERIAL_MAGIC, \
+      port:  PORT,0,FLAGS, \
+      state: &state,       \
+      tty:   (struct tty_struct *)&state, \
+      IER:   SB_IER,       \
+      MCR:   SB_MCR}
+extern void putDebugChar(int);
+/* RTAI support needs us to really stop/start interrupts */
+
+#define kgdb_sti() __asm__ __volatile__("sti": : :"memory")
+#define kgdb_cli() __asm__ __volatile__("cli": : :"memory")
+#define kgdb_local_save_flags(x) __asm__ __volatile__(\
+                                   "pushfl ; popl %0":"=g" (x): /* no input */)
+#define kgdb_local_irq_restore(x) __asm__ __volatile__(\
+                                   "pushl %0 ; popfl": \
+                                     /* no output */ :"g" (x):"memory", "cc")
+#define kgdb_local_irq_save(x) kgdb_local_save_flags(x); kgdb_cli()
+
+#ifdef CONFIG_SERIAL
+extern void shutdown_for_kgdb(struct async_struct *info);
+#endif
+#define INIT_KDEBUG putDebugChar("+");
+#endif				/* __KGDB_LOCAL */
--- diff/include/asm-i386/lockmeter.h	1970-01-01 01:00:00.000000000 +0100
+++ source/include/asm-i386/lockmeter.h	2004-02-09 10:39:56.000000000 +0000
@@ -0,0 +1,123 @@
+/*
+ *  Copyright (C) 1999,2000 Silicon Graphics, Inc.
+ *
+ *  Written by John Hawkes (hawkes@sgi.com)
+ *  Based on klstat.h by Jack Steiner (steiner@sgi.com)
+ *
+ *  Modified by Ray Bryant (raybry@us.ibm.com)
+ *  Changes Copyright (C) 2000 IBM, Inc.
+ *  Added save of index in spinlock_t to improve efficiency
+ *  of "hold" time reporting for spinlocks.
+ *  Added support for hold time statistics for read and write
+ *  locks.
+ *  Moved machine dependent code here from include/lockmeter.h.
+ *
+ */
+
+#ifndef _I386_LOCKMETER_H
+#define _I386_LOCKMETER_H
+
+#include <asm/spinlock.h>
+#include <asm/rwlock.h>
+
+#include <linux/version.h>
+
+#ifdef __KERNEL__
+extern unsigned long cpu_khz;
+#define CPU_CYCLE_FREQUENCY	(cpu_khz * 1000)
+#else
+#define CPU_CYCLE_FREQUENCY	450000000
+#endif
+
+#define THIS_CPU_NUMBER		smp_processor_id()
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0)
+#define local_irq_save(x) \
+    __asm__ __volatile__("pushfl ; popl %0 ; cli":"=g" (x): /* no input */ :"memory")
+
+#define local_irq_restore(x) \
+    __asm__ __volatile__("pushl %0 ; popfl": /* no output */ :"g" (x):"memory")
+#endif	/* Linux version 2.2.x */
+
+/*
+ * macros to cache and retrieve an index value inside of a spin lock
+ * these macros assume that there are less than 65536 simultaneous
+ * (read mode) holders of a rwlock.  Not normally a problem!!
+ * we also assume that the hash table has less than 65535 entries.
+ */
+/*
+ * instrumented spinlock structure -- never used to allocate storage
+ * only used in macros below to overlay a spinlock_t
+ */
+typedef struct inst_spinlock_s {
+	/* remember, Intel is little endian */
+	unsigned short lock;
+	unsigned short index;
+} inst_spinlock_t;
+#define PUT_INDEX(lock_ptr,indexv) ((inst_spinlock_t *)(lock_ptr))->index = indexv
+#define GET_INDEX(lock_ptr)        ((inst_spinlock_t *)(lock_ptr))->index
+
+/*
+ * macros to cache and retrieve an index value in a read/write lock
+ * as well as the cpu where a reader busy period started
+ * we use the 2nd word (the debug word) for this, so require the
+ * debug word to be present
+ */
+/*
+ * instrumented rwlock structure -- never used to allocate storage
+ * only used in macros below to overlay a rwlock_t
+ */
+typedef struct inst_rwlock_s {
+	volatile int lock;
+	unsigned short index;
+	unsigned short cpu;
+} inst_rwlock_t;
+#define PUT_RWINDEX(rwlock_ptr,indexv) ((inst_rwlock_t *)(rwlock_ptr))->index = indexv
+#define GET_RWINDEX(rwlock_ptr)        ((inst_rwlock_t *)(rwlock_ptr))->index
+#define PUT_RW_CPU(rwlock_ptr,cpuv)    ((inst_rwlock_t *)(rwlock_ptr))->cpu = cpuv
+#define GET_RW_CPU(rwlock_ptr)         ((inst_rwlock_t *)(rwlock_ptr))->cpu
+
+/*
+ * return the number of readers for a rwlock_t
+ */
+#define RWLOCK_READERS(rwlock_ptr)   rwlock_readers(rwlock_ptr)
+
+extern inline int rwlock_readers(rwlock_t *rwlock_ptr)
+{
+	int tmp = (int) rwlock_ptr->lock;
+	/* read and write lock attempts may cause the lock value to temporarily */
+	/* be negative.  Until it is >= 0 we know nothing (i. e. can't tell if  */
+	/* is -1 because it was write locked and somebody tried to read lock it */
+	/* or if it is -1 because it was read locked and somebody tried to write*/
+	/* lock it. ........................................................... */
+	do {
+		tmp = (int) rwlock_ptr->lock;
+	} while (tmp < 0);
+	if (tmp == 0) return(0);
+	else return(RW_LOCK_BIAS-tmp);
+}
+
+/*
+ * return true if rwlock is write locked
+ * (note that other lock attempts can cause the lock value to be negative)
+ */
+#define RWLOCK_IS_WRITE_LOCKED(rwlock_ptr) ((rwlock_ptr)->lock <= 0)
+#define IABS(x) ((x) > 0 ? (x) : -(x))
+#define RWLOCK_IS_READ_LOCKED(rwlock_ptr)  ((IABS((rwlock_ptr)->lock) % RW_LOCK_BIAS) != 0)
+
+/* this is a lot of typing just to get gcc to emit "rdtsc" */
+static inline long long get_cycles64 (void)
+{
+	union longlong_u {
+		long long intlong;
+		struct intint_s {
+			uint32_t eax;
+			uint32_t edx;
+		} intint;
+	} longlong;
+
+	rdtsc(longlong.intint.eax,longlong.intint.edx);
+	return longlong.intlong;
+}
+
+#endif /* _I386_LOCKMETER_H */
--- diff/include/asm-ia64/lockmeter.h	1970-01-01 01:00:00.000000000 +0100
+++ source/include/asm-ia64/lockmeter.h	2004-02-09 10:39:56.000000000 +0000
@@ -0,0 +1,72 @@
+/*
+ *  Copyright (C) 1999,2000 Silicon Graphics, Inc.
+ *
+ *  Written by John Hawkes (hawkes@sgi.com)
+ *  Based on klstat.h by Jack Steiner (steiner@sgi.com)
+ */
+
+#ifndef _IA64_LOCKMETER_H
+#define _IA64_LOCKMETER_H
+
+#ifdef local_cpu_data
+#define CPU_CYCLE_FREQUENCY	local_cpu_data->itc_freq
+#else
+#define CPU_CYCLE_FREQUENCY	my_cpu_data.itc_freq
+#endif
+#define get_cycles64()		get_cycles()
+
+#define THIS_CPU_NUMBER		smp_processor_id()
+
+/*
+ * macros to cache and retrieve an index value inside of a lock
+ * these macros assume that there are less than 65536 simultaneous
+ * (read mode) holders of a rwlock.
+ * we also assume that the hash table has less than 32767 entries.
+ */
+/*
+ * instrumented spinlock structure -- never used to allocate storage
+ * only used in macros below to overlay a spinlock_t
+ */
+typedef struct inst_spinlock_s {
+	/* remember, Intel is little endian */
+	volatile unsigned short lock;
+	volatile unsigned short index;
+} inst_spinlock_t;
+#define PUT_INDEX(lock_ptr,indexv) ((inst_spinlock_t *)(lock_ptr))->index = indexv
+#define GET_INDEX(lock_ptr)        ((inst_spinlock_t *)(lock_ptr))->index
+
+/*
+ * macros to cache and retrieve an index value in a read/write lock
+ * as well as the cpu where a reader busy period started
+ * we use the 2nd word (the debug word) for this, so require the
+ * debug word to be present
+ */
+/*
+ * instrumented rwlock structure -- never used to allocate storage
+ * only used in macros below to overlay a rwlock_t
+ */
+typedef struct inst_rwlock_s {
+	volatile int read_counter:31;
+	volatile int write_lock:1;
+	volatile unsigned short index;
+	volatile unsigned short cpu;
+} inst_rwlock_t;
+#define PUT_RWINDEX(rwlock_ptr,indexv) ((inst_rwlock_t *)(rwlock_ptr))->index = indexv
+#define GET_RWINDEX(rwlock_ptr)        ((inst_rwlock_t *)(rwlock_ptr))->index
+#define PUT_RW_CPU(rwlock_ptr,cpuv)    ((inst_rwlock_t *)(rwlock_ptr))->cpu = cpuv
+#define GET_RW_CPU(rwlock_ptr)         ((inst_rwlock_t *)(rwlock_ptr))->cpu
+
+/*
+ * return the number of readers for a rwlock_t
+ */
+#define RWLOCK_READERS(rwlock_ptr)	((rwlock_ptr)->read_counter)
+
+/*
+ * return true if rwlock is write locked
+ * (note that other lock attempts can cause the lock value to be negative)
+ */
+#define RWLOCK_IS_WRITE_LOCKED(rwlock_ptr) ((rwlock_ptr)->write_lock)
+#define RWLOCK_IS_READ_LOCKED(rwlock_ptr)  ((rwlock_ptr)->read_counter)
+
+#endif /* _IA64_LOCKMETER_H */
+
--- diff/include/asm-mips/lockmeter.h	1970-01-01 01:00:00.000000000 +0100
+++ source/include/asm-mips/lockmeter.h	2004-02-09 10:39:57.000000000 +0000
@@ -0,0 +1,126 @@
+/*
+ *  Copyright (C) 1999,2000 Silicon Graphics, Inc.
+ *
+ *  Written by John Hawkes (hawkes@sgi.com)
+ *  Based on klstat.h by Jack Steiner (steiner@sgi.com)
+ *  Ported to mips32 for Asita Technologies
+ *   by D.J. Barrow ( dj.barrow@asitatechnologies.com )
+ */
+#ifndef _ASM_LOCKMETER_H
+#define _ASM_LOCKMETER_H
+
+/* do_gettimeoffset is a function pointer on mips */
+/* & it is not included by <linux/time.h> */
+#include <asm/time.h>
+#include <linux/time.h>
+#include <asm/div64.h>
+
+#define SPINLOCK_MAGIC_INIT	/* */
+
+#define CPU_CYCLE_FREQUENCY	get_cpu_cycle_frequency()
+
+#define THIS_CPU_NUMBER		smp_processor_id()
+
+static uint32_t cpu_cycle_frequency = 0;
+
+static uint32_t get_cpu_cycle_frequency(void)
+{
+    /* a total hack, slow and invasive, but ... it works */
+    int sec;
+    uint32_t start_cycles;
+    struct timeval tv;
+
+    if (cpu_cycle_frequency == 0) {	/* uninitialized */
+	do_gettimeofday(&tv);
+	sec = tv.tv_sec;	/* set up to catch the tv_sec rollover */
+	while (sec == tv.tv_sec) { do_gettimeofday(&tv); }
+	sec = tv.tv_sec;	/* rolled over to a new sec value */
+	start_cycles = get_cycles();
+	while (sec == tv.tv_sec) { do_gettimeofday(&tv); }
+	cpu_cycle_frequency = get_cycles() - start_cycles;
+    }
+
+    return cpu_cycle_frequency;
+}
+
+extern struct timeval xtime;
+
+static uint64_t get_cycles64(void)
+{
+    static uint64_t last_get_cycles64 = 0;
+    uint64_t ret;
+    unsigned long sec;
+    unsigned long usec, usec_offset;
+
+again:
+    sec  = xtime.tv_sec;
+    usec = xtime.tv_usec;
+    usec_offset = do_gettimeoffset();
+    if ((xtime.tv_sec != sec)  ||
+	(xtime.tv_usec != usec)||
+	(usec_offset >= 20000))
+	goto again;
+
+    ret = ((uint64_t)(usec + usec_offset) * cpu_cycle_frequency);
+    /* We can't do a normal 64 bit division on mips without libgcc.a */
+    do_div(ret,1000000);
+    ret +=  ((uint64_t)sec * cpu_cycle_frequency);
+
+    /* XXX why does time go backwards?  do_gettimeoffset?  general time adj? */
+    if (ret <= last_get_cycles64)
+	ret  = last_get_cycles64+1;
+    last_get_cycles64 = ret;
+
+    return ret;
+}
+
+/*
+ * macros to cache and retrieve an index value inside of a lock
+ * these macros assume that there are less than 65536 simultaneous
+ * (read mode) holders of a rwlock.
+ * we also assume that the hash table has less than 32767 entries.
+ * the high order bit is used for write locking a rw_lock
+ */
+#define INDEX_MASK   0x7FFF0000
+#define READERS_MASK 0x0000FFFF
+#define INDEX_SHIFT 16
+#define PUT_INDEX(lockp,index)   \
+        lockp->lock = (((lockp->lock) & ~INDEX_MASK) | (index) << INDEX_SHIFT)
+#define GET_INDEX(lockp) \
+        (((lockp->lock) & INDEX_MASK) >> INDEX_SHIFT)
+
+/*
+ * macros to cache and retrieve an index value in a read/write lock
+ * as well as the cpu where a reader busy period started
+ * we use the 2nd word (the debug word) for this, so require the
+ * debug word to be present
+ */
+/*
+ * instrumented rwlock structure -- never used to allocate storage
+ * only used in macros below to overlay a rwlock_t
+ */
+typedef struct inst_rwlock_s {
+	volatile int lock;
+	unsigned short index;
+	unsigned short cpu;
+} inst_rwlock_t;
+#define PUT_RWINDEX(rwlock_ptr,indexv) ((inst_rwlock_t *)(rwlock_ptr))->index = indexv
+#define GET_RWINDEX(rwlock_ptr)        ((inst_rwlock_t *)(rwlock_ptr))->index
+#define PUT_RW_CPU(rwlock_ptr,cpuv)    ((inst_rwlock_t *)(rwlock_ptr))->cpu = cpuv
+#define GET_RW_CPU(rwlock_ptr)         ((inst_rwlock_t *)(rwlock_ptr))->cpu
+
+/*
+ * return the number of readers for a rwlock_t
+ */
+#define RWLOCK_READERS(rwlock_ptr)   rwlock_readers(rwlock_ptr)
+
+extern inline int rwlock_readers(rwlock_t *rwlock_ptr)
+{
+	int tmp = (int) rwlock_ptr->lock;
+	return (tmp >= 0) ? tmp : 0;
+}
+
+#define RWLOCK_IS_WRITE_LOCKED(rwlock_ptr) ((rwlock_ptr)->lock < 0)
+#define RWLOCK_IS_READ_LOCKED(rwlock_ptr)  ((rwlock_ptr)->lock > 0)
+
+#endif /* _ASM_LOCKMETER_H */
--- diff/include/asm-ppc/pmac_low_i2c.h	1970-01-01 01:00:00.000000000 +0100
+++ source/include/asm-ppc/pmac_low_i2c.h	2004-02-09 10:39:57.000000000 +0000
@@ -0,0 +1,43 @@
+/* 
+ *  include/asm-ppc/pmac_low_i2c.h
+ *
+ *  Copyright (C) 2003 Ben. Herrenschmidt (benh@kernel.crashing.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.
+ *
+ */
+#ifndef __PMAC_LOW_I2C_H__
+#define __PMAC_LOW_I2C_H__
+
+/* i2c mode (based on the platform functions format) */
+enum {
+	pmac_low_i2c_mode_dumb		= 1,
+	pmac_low_i2c_mode_std		= 2,
+	pmac_low_i2c_mode_stdsub	= 3,
+	pmac_low_i2c_mode_combined	= 4,
+};
+
+/* RW bit in address */
+enum {
+	pmac_low_i2c_read		= 0x01,
+	pmac_low_i2c_write		= 0x00
+};
+
+/* Init, called early during boot */
+extern void pmac_init_low_i2c(void);
+
+/* Locking functions exposed to i2c-keywest */
+int pmac_low_i2c_lock(struct device_node *np);
+int pmac_low_i2c_unlock(struct device_node *np);
+
+/* Access functions for platform code */
+int pmac_low_i2c_open(struct device_node *np, int channel);
+int pmac_low_i2c_close(struct device_node *np);
+int pmac_low_i2c_setmode(struct device_node *np, int mode);
+int pmac_low_i2c_xfer(struct device_node *np, u8 addrdir, u8 subaddr, u8 *data, int len);
+
+
+#endif /* __PMAC_LOW_I2C_H__ */
--- diff/include/asm-ppc64/hvconsole.h	1970-01-01 01:00:00.000000000 +0100
+++ source/include/asm-ppc64/hvconsole.h	2004-02-09 10:39:57.000000000 +0000
@@ -0,0 +1,30 @@
+/*
+ * hvconsole.h
+ * Copyright (C) 2004 Ryan S Arnold, IBM Corporation
+ *
+ * LPAR console support.
+ *
+ * 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 _PPC64_HVCONSOLE_H
+#define _PPC64_HVCONSOLE_H
+
+extern int hvc_get_chars(int index, char *buf, int count);
+extern int hvc_put_chars(int index, const char *buf, int count);
+extern int hvc_count(int *start_termno);
+
+#endif /* _PPC64_HVCONSOLE_H */
+
--- diff/include/asm-sparc64/lockmeter.h	1970-01-01 01:00:00.000000000 +0100
+++ source/include/asm-sparc64/lockmeter.h	2004-02-09 10:39:57.000000000 +0000
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2000 Anton Blanchard (anton@linuxcare.com)
+ * Copyright (C) 2003 David S. Miller (davem@redhat.com)
+ */
+
+#ifndef _SPARC64_LOCKMETER_H
+#define _SPARC64_LOCKMETER_H
+
+#include <linux/smp.h>
+#include <asm/spinlock.h>
+#include <asm/timer.h>
+#include <asm/timex.h>
+
+/* Actually, this is not the CPU frequency by the system tick
+ * frequency which is good enough for lock metering.
+ */
+#define CPU_CYCLE_FREQUENCY	(timer_tick_offset * HZ)
+#define THIS_CPU_NUMBER		smp_processor_id()
+
+#define PUT_INDEX(lock_ptr,indexv)	(lock_ptr)->index = (indexv)
+#define GET_INDEX(lock_ptr)		(lock_ptr)->index
+
+#define PUT_RWINDEX(rwlock_ptr,indexv) (rwlock_ptr)->index = (indexv)
+#define GET_RWINDEX(rwlock_ptr)        (rwlock_ptr)->index
+#define PUT_RW_CPU(rwlock_ptr,cpuv)    (rwlock_ptr)->cpu = (cpuv)
+#define GET_RW_CPU(rwlock_ptr)         (rwlock_ptr)->cpu
+
+#define RWLOCK_READERS(rwlock_ptr)	rwlock_readers(rwlock_ptr)
+
+extern inline int rwlock_readers(rwlock_t *rwlock_ptr)
+{
+	signed int tmp = rwlock_ptr->lock;
+
+	if (tmp > 0)
+		return tmp;
+	else
+		return 0;
+}
+
+#define RWLOCK_IS_WRITE_LOCKED(rwlock_ptr)	((signed int)((rwlock_ptr)->lock) < 0)
+#define RWLOCK_IS_READ_LOCKED(rwlock_ptr)	((signed int)((rwlock_ptr)->lock) > 0)
+
+#define get_cycles64()	get_cycles()
+
+#endif /* _SPARC64_LOCKMETER_H */
--- diff/include/asm-um/cpufeature.h	1970-01-01 01:00:00.000000000 +0100
+++ source/include/asm-um/cpufeature.h	2004-02-09 10:39:57.000000000 +0000
@@ -0,0 +1,6 @@
+#ifndef __UM_CPUFEATURE_H
+#define __UM_CPUFEATURE_H
+
+#include "asm/arch/cpufeature.h"
+
+#endif
--- diff/include/asm-um/local.h	1970-01-01 01:00:00.000000000 +0100
+++ source/include/asm-um/local.h	2004-02-09 10:39:57.000000000 +0000
@@ -0,0 +1,6 @@
+#ifndef __UM_LOCAL_H
+#define __UM_LOCAL_H
+
+#include "asm/arch/local.h"
+
+#endif
--- diff/include/asm-um/module-generic.h	1970-01-01 01:00:00.000000000 +0100
+++ source/include/asm-um/module-generic.h	2004-02-09 10:39:57.000000000 +0000
@@ -0,0 +1,6 @@
+#ifndef __UM_MODULE_GENERIC_H
+#define __UM_MODULE_GENERIC_H
+
+#include "asm/arch/module.h"
+
+#endif
--- diff/include/asm-um/module-i386.h	1970-01-01 01:00:00.000000000 +0100
+++ source/include/asm-um/module-i386.h	2004-02-09 10:39:57.000000000 +0000
@@ -0,0 +1,13 @@
+#ifndef __UM_MODULE_I386_H
+#define __UM_MODULE_I386_H
+
+/* UML is simple */
+struct mod_arch_specific
+{
+};
+
+#define Elf_Shdr Elf32_Shdr
+#define Elf_Sym Elf32_Sym
+#define Elf_Ehdr Elf32_Ehdr
+
+#endif
--- diff/include/asm-um/sections.h	1970-01-01 01:00:00.000000000 +0100
+++ source/include/asm-um/sections.h	2004-02-09 10:39:57.000000000 +0000
@@ -0,0 +1,7 @@
+#ifndef _UM_SECTIONS_H
+#define _UM_SECTIONS_H
+
+/* nothing to see, move along */
+#include <asm-generic/sections.h>
+
+#endif
--- diff/include/asm-x86_64/kgdb.h	1970-01-01 01:00:00.000000000 +0100
+++ source/include/asm-x86_64/kgdb.h	2004-02-09 10:39:57.000000000 +0000
@@ -0,0 +1,71 @@
+#ifndef __KGDB
+#define __KGDB
+
+/*
+ * This file should not include ANY others.  This makes it usable
+ * most anywhere without the fear of include order or inclusion.
+ * Make it so!
+ *
+ * This file may be included all the time.  It is only active if
+ * CONFIG_KGDB is defined, otherwise it stubs out all the macros
+ * and entry points.
+ */
+#if defined(CONFIG_KGDB) && !defined(__ASSEMBLY__)
+
+extern void breakpoint(void);
+#define INIT_KGDB_INTS kgdb_enable_ints()
+
+#ifndef BREAKPOINT
+#define BREAKPOINT   asm("   int $3")
+#endif
+
+extern void kgdb_schedule_breakpoint(void);
+extern void kgdb_process_breakpoint(void);
+
+extern int kgdb_tty_hook(void);
+extern int kgdb_eth_hook(void);
+extern int kgdboe;
+
+/*
+ * GDB debug stub (or any debug stub) can point the 'linux_debug_hook'
+ * pointer to its routine and it will be entered as the first thing
+ * when a trap occurs.
+ *
+ * Return values are, at present, undefined.
+ *
+ * The debug hook routine does not necessarily return to its caller.
+ * It has the register image and thus may choose to resume execution
+ * anywhere it pleases.
+ */
+struct pt_regs;
+
+extern int kgdb_handle_exception(int trapno,
+				 int signo, int err_code, struct pt_regs *regs);
+extern int in_kgdb(struct pt_regs *regs);
+
+extern void set_debug_traps(void);
+
+#ifdef CONFIG_KGDB_TS
+void kgdb_tstamp(int line, char *source, int data0, int data1);
+/*
+ * This is the time stamp function.  The macro adds the source info and
+ * does a cast on the data to allow most any 32-bit value.
+ */
+
+#define kgdb_ts(data0,data1) kgdb_tstamp(__LINE__,__FILE__,(int)data0,(int)data1)
+#else
+#define kgdb_ts(data0,data1)
+#endif
+#else				/* CONFIG_KGDB  && ! __ASSEMBLY__ ,stubs follow... */
+#ifndef BREAKPOINT
+#define BREAKPOINT
+#endif
+#define kgdb_ts(data0,data1)
+#define in_kgdb	(0)
+#define kgdb_handle_exception
+#define breakpoint
+#define INIT_KGDB_INTS
+#define kgdb_process_breakpoint() do {} while(0)
+
+#endif
+#endif				/* __KGDB */
--- diff/include/asm-x86_64/kgdb_local.h	1970-01-01 01:00:00.000000000 +0100
+++ source/include/asm-x86_64/kgdb_local.h	2004-02-09 10:39:57.000000000 +0000
@@ -0,0 +1,102 @@
+#ifndef __KGDB_LOCAL
+#define ___KGDB_LOCAL
+#include <linux/config.h>
+#include <linux/types.h>
+#include <linux/serial.h>
+#include <linux/serialP.h>
+#include <linux/spinlock.h>
+#include <asm/processor.h>
+#include <asm/msr.h>
+#include <asm/kgdb.h>
+
+#define PORT 0x3f8
+#ifdef CONFIG_KGDB_PORT
+#undef PORT
+#define PORT CONFIG_KGDB_PORT
+#endif
+#define IRQ 4
+#ifdef CONFIG_KGDB_IRQ
+#undef IRQ
+#define IRQ CONFIG_KGDB_IRQ
+#endif
+#define SB_CLOCK 1843200
+#define SB_BASE (SB_CLOCK/16)
+#define SB_BAUD9600 SB_BASE/9600
+#define SB_BAUD192  SB_BASE/19200
+#define SB_BAUD384  SB_BASE/38400
+#define SB_BAUD576  SB_BASE/57600
+#define SB_BAUD1152 SB_BASE/115200
+#ifdef CONFIG_KGDB_9600BAUD
+#define SB_BAUD SB_BAUD9600
+#endif
+#ifdef CONFIG_KGDB_19200BAUD
+#define SB_BAUD SB_BAUD192
+#endif
+#ifdef CONFIG_KGDB_38400BAUD
+#define SB_BAUD SB_BAUD384
+#endif
+#ifdef CONFIG_KGDB_57600BAUD
+#define SB_BAUD SB_BAUD576
+#endif
+#ifdef CONFIG_KGDB_115200BAUD
+#define SB_BAUD SB_BAUD1152
+#endif
+#ifndef SB_BAUD
+#define SB_BAUD SB_BAUD1152	/* Start with this if not given */
+#endif
+
+#ifndef CONFIG_X86_TSC
+#undef rdtsc
+#define rdtsc(a,b) if (a++ > 10000){a = 0; b++;}
+#undef rdtscll
+#define rdtscll(s) s++
+#endif
+
+#ifdef _raw_read_unlock		/* must use a name that is "define"ed, not an inline */
+#undef spin_lock
+#undef spin_trylock
+#undef spin_unlock
+#define spin_lock	 _raw_spin_lock
+#define spin_trylock	 _raw_spin_trylock
+#define spin_unlock	 _raw_spin_unlock
+#else
+#endif
+#undef spin_unlock_wait
+#define spin_unlock_wait(x)  do { cpu_relax(); barrier();} \
+                                     while(spin_is_locked(x))
+
+#define SB_IER 1
+#define SB_MCR UART_MCR_OUT2 | UART_MCR_DTR | UART_MCR_RTS
+
+#define FLAGS 0
+#define SB_STATE { \
+     magic: SSTATE_MAGIC, \
+     baud_base: SB_BASE,  \
+     port:      PORT,     \
+     irq:       IRQ,      \
+     flags:     FLAGS,    \
+     custom_divisor:SB_BAUD}
+#define SB_INFO  { \
+      magic: SERIAL_MAGIC, \
+      port:  PORT,0,FLAGS, \
+      state: &state,       \
+      tty:   (struct tty_struct *)&state, \
+      IER:   SB_IER,       \
+      MCR:   SB_MCR}
+extern void putDebugChar(int);
+/* RTAI support needs us to really stop/start interrupts */
+
+#define kgdb_sti() __asm__ __volatile__("sti": : :"memory")
+#define kgdb_cli() __asm__ __volatile__("cli": : :"memory")
+#define kgdb_local_save_flags(x) __asm__ __volatile__(\
+                                   "pushfl ; popl %0":"=g" (x): /* no input */)
+#define kgdb_local_irq_restore(x) __asm__ __volatile__(\
+                                   "pushl %0 ; popfl": \
+                                     /* no output */ :"g" (x):"memory", "cc")
+#define kgdb_local_irq_save(x) kgdb_local_save_flags(x); kgdb_cli()
+
+#ifdef CONFIG_SERIAL
+extern void shutdown_for_kgdb(struct async_struct *info);
+#endif
+#define INIT_KDEBUG putDebugChar("+");
+#endif				/* __KGDB_LOCAL */
--- diff/include/linux/compat_siginfo.h	1970-01-01 01:00:00.000000000 +0100
+++ source/include/linux/compat_siginfo.h	2004-02-09 10:39:57.000000000 +0000
@@ -0,0 +1,170 @@
+#ifndef _ASM_GENERIC_COMPAT_SIGINFO_H
+#define _ASM_GENERIC_COMPAT_SIGINFO_H
+
+#include <linux/config.h>
+#include <linux/compat.h>
+
+#ifndef CONFIG_COMPAT
+
+/* No compatibility layer required, add empty definitions for the compiler */
+
+typedef struct compat_siginfo{
+} compat_siginfo_t;
+
+static inline int compat_copy_siginfo_to_user(compat_siginfo_t __user *to,
+						struct siginfo *from)
+{
+	return -1;
+}
+
+#else
+
+#include <linux/compiler.h>
+#include <asm/siginfo.h>
+
+/* compat view of sigval_t */
+typedef union compat_sigval {
+	compat_int_t sival_int;
+	compat_uptr_t sival_ptr;
+} compat_sigval_t;
+
+/*
+ * This is the size (including padding) of the part of the
+ * struct siginfo that is before the union.
+ */
+#ifndef __ARCH_SI_COMPAT_PREAMBLE_SIZE
+#define __ARCH_SI_COMPAT_PREAMBLE_SIZE	(3 * sizeof(int))
+#endif
+
+#define SI_COMPAT_MAX_SIZE	128
+#ifndef SI_COMPAT_PAD_SIZE
+#define SI_COMPAT_PAD_SIZE	((SI_COMPAT_MAX_SIZE - __ARCH_SI_COMPAT_PREAMBLE_SIZE) / sizeof(int))
+#endif
+
+/* 32-bit view of si.uid_t */
+#ifndef __ARCH_SI_COMPAT_UID_T
+#define __ARCH_SI_COMPAT_UID_T compat_uid_t
+#endif
+
+/* 32-bit view of si.band_t */
+#ifndef __ARCH_SI_COMPAT_BAND_T
+#define __ARCH_SI_COMPAT_BAND_T compat_int_t
+#endif
+
+#ifndef HAVE_ARCH_COMPAT_SIGINFO_T
+
+/* Compat view of siginfo_t */
+typedef struct compat_siginfo {
+	compat_int_t si_signo;
+	compat_int_t si_errno;
+	compat_int_t si_code;
+
+	union {
+		compat_int_t _pad[SI_COMPAT_PAD_SIZE];
+
+		/* kill() */
+		struct {
+			compat_pid_t _pid;	/* sender's pid */
+			__ARCH_SI_COMPAT_UID_T _uid;	/* sender's uid */
+		} _kill;
+
+		/* POSIX.1b timers */
+		struct {
+			compat_timer_t _tid;	/* timer id */
+			compat_int_t _overrun;		/* overrun count */
+			char _pad[sizeof( __ARCH_SI_UID_T) - sizeof(int)];
+			compat_sigval_t _sigval;	/* same as below */
+			compat_int_t _sys_private;       /* not to be passed to user */
+		} _timer;
+
+		/* POSIX.1b signals */
+		struct {
+			compat_pid_t _pid;		/* sender's pid */
+			__ARCH_SI_COMPAT_UID_T _uid;	/* sender's uid */
+			compat_sigval_t _sigval;
+		} _rt;
+
+		/* SIGCHLD */
+		struct {
+			compat_pid_t _pid;		/* which child */
+			__ARCH_SI_COMPAT_UID_T _uid;	/* sender's uid */
+			compat_int_t _status;		/* exit code */
+			compat_clock_t _utime;
+			compat_clock_t _stime;
+		} _sigchld;
+
+		/* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
+		struct {
+			compat_uptr_t _addr; /* faulting insn/memory ref. */
+#ifdef __ARCH_SI_COMPAT_TRAPNO
+			compat_int_t _trapno;	/* TRAP # which caused the signal */
+#endif
+		} _sigfault;
+
+		/* SIGPOLL */
+		struct {
+			__ARCH_SI_COMPAT_BAND_T _band;	/* POLL_IN, POLL_OUT, POLL_MSG */
+			compat_int_t _fd;
+		} _sigpoll;
+	} _sifields;
+} compat_siginfo_t;
+#endif /* !HAVE_ARCH_COMPAT_SIGINFO_T */
+
+#ifdef __ARCH_SI_COMPAT_TRAPNO
+#define si_trapno	_sifields._sigfault._trapno
+#endif
+
+/*
+ * sigevent definitions
+ *
+ * It seems likely that SIGEV_THREAD will have to be handled from
+ * userspace, libpthread transmuting it to SIGEV_SIGNAL, which the
+ * thread manager then catches and does the appropriate nonsense.
+ * However, everything is written out here so as to not get lost.
+ */
+
+#define SIGEV_COMPAT_MAX_SIZE	64
+#ifndef SIGEV_COMPAT_PAD_SIZE
+#define SIGEV_COMPAT_PAD_SIZE	((SIGEV_COMPAT_MAX_SIZE/sizeof(int)) - 3)
+#endif
+
+#ifndef HAVE_ARCH_COMPAT_SIGEVENT_T
+
+/* 32-bit view of sigevent_t */
+typedef struct compat_sigevent {
+	compat_sigval_t sigev_value;
+	compat_int_t sigev_signo;
+	compat_int_t sigev_notify;
+	union {
+		compat_int_t _pad[SIGEV_COMPAT_PAD_SIZE];
+		compat_int_t _tid;
+
+		struct {
+			compat_uptr_t _function;
+			compat_uptr_t _attribute;	/* really pthread_attr_t */
+		} _sigev_thread;
+	} _sigev_un;
+} compat_sigevent_t;
+
+#endif /* HAVE_ARCH_COMPAT_SIGEVENT_T */
+
+#ifndef HAVE_ARCH_COMPAT_COPY_SIGINFO
+
+#include <linux/string.h>
+
+static inline void compat_copy_siginfo(struct compat_siginfo *to, struct compat_siginfo *from)
+{
+	if (from->si_code < 0)
+		memcpy(to, from, sizeof(*to));
+	else
+		/* _sigchld is currently the largest know union member */
+		memcpy(to, from, __ARCH_SI_COMPAT_PREAMBLE_SIZE + sizeof(from->_sifields._sigchld));
+}
+
+#endif /* !HAVE_ARCH_COMPAT_COPY_SIGINFO */
+
+extern int compat_copy_siginfo_to_user(compat_siginfo_t __user *to, struct siginfo *from);
+
+#endif /* CONFIG_COMPAT */
+#endif /* _ASM_GENERIC_COMPAT_SIGINFO_H */
+
--- diff/include/linux/dmapool.h	1970-01-01 01:00:00.000000000 +0100
+++ source/include/linux/dmapool.h	2004-02-09 10:39:57.000000000 +0000
@@ -0,0 +1,27 @@
+/*
+ * include/linux/dmapool.h
+ *
+ * Allocation pools for DMAable (coherent) memory.
+ *
+ * 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.
+ */
+
+#ifndef LINUX_DMAPOOL_H
+#define	LINUX_DMAPOOL_H
+
+#include <asm/io.h>
+#include <asm/scatterlist.h>
+
+struct dma_pool *dma_pool_create(const char *name, struct device *dev, 
+			size_t size, size_t align, size_t allocation);
+
+void dma_pool_destroy(struct dma_pool *pool);
+
+void *dma_pool_alloc(struct dma_pool *pool, int mem_flags, dma_addr_t *handle);
+
+void dma_pool_free(struct dma_pool *pool, void *vaddr, dma_addr_t addr);
+
+#endif
+
--- diff/include/linux/dwarf2-lang.h	1970-01-01 01:00:00.000000000 +0100
+++ source/include/linux/dwarf2-lang.h	2004-02-09 10:39:57.000000000 +0000
@@ -0,0 +1,132 @@
+#ifndef DWARF2_LANG
+#define DWARF2_LANG
+#include <linux/dwarf2.h>
+
+/*
+ * This 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 file defines macros that allow generation of DWARF debug records
+ * for asm files.  This file is platform independent.  Register numbers
+ * (which are about the only thing that is platform dependent) are to be
+ * supplied by a platform defined file.
+ */
+#define DWARF_preamble()	.section	.debug_frame,"",@progbits
+/*
+ * This macro starts a debug frame section.  The debug_frame describes
+ * where to find the registers that the enclosing function saved on
+ * entry.
+ *
+ * ORD is use by the label generator and should be the same as what is
+ * passed to CFI_postamble.
+ *
+ * pc,	pc register gdb ordinal.
+ *
+ * code_align this is the factor used to define locations or regions
+ * where the given definitions apply.  If you use labels to define these
+ * this should be 1.
+ *
+ * data_align this is the factor used to define register offsets.  If
+ * you use struct offset, this should be the size of the register in
+ * bytes or the negative of that.  This is how it is used: you will
+ * define a register as the reference register, say the stack pointer,
+ * then you will say where a register is located relative to this
+ * reference registers value, say 40 for register 3 (the gdb register
+ * number).  The <40> will be multiplied by <data_align> to define the
+ * byte offset of the given register (3, in this example).  So if your
+ * <40> is the byte offset and the reference register points at the
+ * begining, you would want 1 for the data_offset.  If <40> was the 40th
+ * 4-byte element in that structure you would want 4.  And if your
+ * reference register points at the end of the structure you would want
+ * a negative data_align value(and you would have to do other math as
+ * well).
+ */
+
+#define CFI_preamble(ORD, pc, code_align, data_align)	\
+.section	.debug_frame,"",@progbits ;		\
+frame/**/_/**/ORD:						\
+	.long end/**/_/**/ORD-start/**/_/**/ORD;			\
+start/**/_/**/ORD:						\
+	.long	DW_CIE_ID;				\
+	.byte	DW_CIE_VERSION;			\
+	.byte 0	 ;				\
+	.uleb128 code_align;				\
+	.sleb128 data_align;				\
+	.byte pc;
+
+/*
+ * After the above macro and prior to the CFI_postamble, you need to
+ * define the initial state.  This starts with defining the reference
+ * register and, usually the pc.  Here are some helper macros:
+ */
+
+#define CFA_define_reference(reg, offset)	\
+	.byte DW_CFA_def_cfa;			\
+	.uleb128 reg;				\
+	.uleb128 (offset);
+
+#define CFA_define_offset(reg, offset)		\
+	.byte (DW_CFA_offset + reg);		\
+	.uleb128 (offset);
+
+#define CFI_postamble(ORD)			\
+	.align 4;				\
+end/**/_/**/ORD:
+/*
+ * So now your code pushs stuff on the stack, you need a new location
+ * and the rules for what to do.  This starts a running description of
+ * the call frame.  You need to describe what changes with respect to
+ * the call registers as the location of the pc moves through the code.
+ * The following builds an FDE (fram descriptor entry?).  Like the
+ * above, it has a preamble and a postamble.  It also is tied to the CFI
+ * above.
+ * The first entry after the preamble must be the location in the code
+ * that the call frame is being described for.
+ */
+#define FDE_preamble(ORD, fde_no, initial_address, length)	\
+	.long FDE_end/**/_/**/fde_no-FDE_start/**/_/**/fde_no;		\
+FDE_start/**/_/**/fde_no:						\
+	.long frame/**/_/**/ORD;					\
+	.long initial_address;					\
+	.long length;
+
+#define FDE_postamble(fde_no)			\
+	.align 4;				\
+FDE_end/**/_/**/fde_no:
+/*
+ * That done, you can now add registers, subtract registers, move the
+ * reference and even change the reference.  You can also define a new
+ * area of code the info applies to.  For discontinuous bits you should
+ * start a new FDE.  You may have as many as you like.
+ */
+
+/*
+ * To advance the address by <bytes>
+ */
+
+#define FDE_advance(bytes)			\
+	.byte DW_CFA_advance_loc4		\
+	.long bytes
+
+
+
+/*
+ * With the above you can define all the register locations.  But
+ * suppose the reference register moves... Takes the new offset NOT an
+ * increment.  This is how esp is tracked if it is not saved.
+ */
+
+#define CFA_define_cfa_offset(offset) \
+	.byte $DW_CFA_def_cfa_offset; \
+	.uleb128 (offset);
+/*
+ * Or suppose you want to use a different reference register...
+ */
+#define CFA_define_cfa_register(reg)		\
+	.byte DW_CFA_def_cfa_register;		\
+	.uleb128 reg;
+
+#endif
--- diff/include/linux/dwarf2.h	1970-01-01 01:00:00.000000000 +0100
+++ source/include/linux/dwarf2.h	2004-02-09 10:39:57.000000000 +0000
@@ -0,0 +1,738 @@
+/* Declarations and definitions of codes relating to the DWARF2 symbolic
+   debugging information format.
+   Copyright (C) 1992, 1993, 1995, 1996, 1997, 1999, 2000, 2001, 2002
+   Free Software Foundation, Inc.
+
+   Written by Gary Funck (gary@intrepid.com) The Ada Joint Program
+   Office (AJPO), Florida State Unviversity and Silicon Graphics Inc.
+   provided support for this effort -- June 21, 1995.
+
+   Derived from the DWARF 1 implementation written by Ron Guilmette
+   (rfg@netcom.com), November 1990.
+
+   This file is part of GCC.
+
+   GCC 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.
+
+   GCC 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 GCC; see the file COPYING.  If not, write to the Free
+   Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+   02111-1307, USA.  */
+
+/* This file is derived from the DWARF specification (a public document)
+   Revision 2.0.0 (July 27, 1993) developed by the UNIX International
+   Programming Languages Special Interest Group (UI/PLSIG) and distributed
+   by UNIX International.  Copies of this specification are available from
+   UNIX International, 20 Waterview Boulevard, Parsippany, NJ, 07054.
+
+   This file also now contains definitions from the DWARF 3 specification.  */
+
+/* This file is shared between GCC and GDB, and should not contain
+   prototypes.	*/
+
+#ifndef _ELF_DWARF2_H
+#define _ELF_DWARF2_H
+
+/* Structure found in the .debug_line section.	*/
+#ifndef __ASSEMBLY__
+typedef struct
+{
+  unsigned char li_length	   [4];
+  unsigned char li_version	   [2];
+  unsigned char li_prologue_length [4];
+  unsigned char li_min_insn_length [1];
+  unsigned char li_default_is_stmt [1];
+  unsigned char li_line_base	   [1];
+  unsigned char li_line_range	   [1];
+  unsigned char li_opcode_base	   [1];
+}
+DWARF2_External_LineInfo;
+
+typedef struct
+{
+  unsigned long  li_length;
+  unsigned short li_version;
+  unsigned int	 li_prologue_length;
+  unsigned char  li_min_insn_length;
+  unsigned char  li_default_is_stmt;
+  int		 li_line_base;
+  unsigned char  li_line_range;
+  unsigned char  li_opcode_base;
+}
+DWARF2_Internal_LineInfo;
+
+/* Structure found in .debug_pubnames section.	*/
+typedef struct
+{
+  unsigned char pn_length  [4];
+  unsigned char pn_version [2];
+  unsigned char pn_offset  [4];
+  unsigned char pn_size    [4];
+}
+DWARF2_External_PubNames;
+
+typedef struct
+{
+  unsigned long  pn_length;
+  unsigned short pn_version;
+  unsigned long  pn_offset;
+  unsigned long  pn_size;
+}
+DWARF2_Internal_PubNames;
+
+/* Structure found in .debug_info section.  */
+typedef struct
+{
+  unsigned char  cu_length	  [4];
+  unsigned char  cu_version	  [2];
+  unsigned char  cu_abbrev_offset [4];
+  unsigned char  cu_pointer_size  [1];
+}
+DWARF2_External_CompUnit;
+
+typedef struct
+{
+  unsigned long  cu_length;
+  unsigned short cu_version;
+  unsigned long  cu_abbrev_offset;
+  unsigned char  cu_pointer_size;
+}
+DWARF2_Internal_CompUnit;
+
+typedef struct
+{
+  unsigned char  ar_length	 [4];
+  unsigned char  ar_version	 [2];
+  unsigned char  ar_info_offset  [4];
+  unsigned char  ar_pointer_size [1];
+  unsigned char  ar_segment_size [1];
+}
+DWARF2_External_ARange;
+
+typedef struct
+{
+  unsigned long  ar_length;
+  unsigned short ar_version;
+  unsigned long  ar_info_offset;
+  unsigned char  ar_pointer_size;
+  unsigned char  ar_segment_size;
+}
+DWARF2_Internal_ARange;
+
+#define ENUM(name) enum name {
+#define IF_NOT_ASM(a) a
+#define COMMA ,
+#else
+#define ENUM(name)
+#define IF_NOT_ASM(a)
+#define COMMA
+
+#endif
+
+/* Tag names and codes.  */
+ENUM(dwarf_tag)
+
+    DW_TAG_padding = 0x00 COMMA
+    DW_TAG_array_type = 0x01 COMMA
+    DW_TAG_class_type = 0x02 COMMA
+    DW_TAG_entry_point = 0x03 COMMA
+    DW_TAG_enumeration_type = 0x04 COMMA
+    DW_TAG_formal_parameter = 0x05 COMMA
+    DW_TAG_imported_declaration = 0x08 COMMA
+    DW_TAG_label = 0x0a COMMA
+    DW_TAG_lexical_block = 0x0b COMMA
+    DW_TAG_member = 0x0d COMMA
+    DW_TAG_pointer_type = 0x0f COMMA
+    DW_TAG_reference_type = 0x10 COMMA
+    DW_TAG_compile_unit = 0x11 COMMA
+    DW_TAG_string_type = 0x12 COMMA
+    DW_TAG_structure_type = 0x13 COMMA
+    DW_TAG_subroutine_type = 0x15 COMMA
+    DW_TAG_typedef = 0x16 COMMA
+    DW_TAG_union_type = 0x17 COMMA
+    DW_TAG_unspecified_parameters = 0x18 COMMA
+    DW_TAG_variant = 0x19 COMMA
+    DW_TAG_common_block = 0x1a COMMA
+    DW_TAG_common_inclusion = 0x1b COMMA
+    DW_TAG_inheritance = 0x1c COMMA
+    DW_TAG_inlined_subroutine = 0x1d COMMA
+    DW_TAG_module = 0x1e COMMA
+    DW_TAG_ptr_to_member_type = 0x1f COMMA
+    DW_TAG_set_type = 0x20 COMMA
+    DW_TAG_subrange_type = 0x21 COMMA
+    DW_TAG_with_stmt = 0x22 COMMA
+    DW_TAG_access_declaration = 0x23 COMMA
+    DW_TAG_base_type = 0x24 COMMA
+    DW_TAG_catch_block = 0x25 COMMA
+    DW_TAG_const_type = 0x26 COMMA
+    DW_TAG_constant = 0x27 COMMA
+    DW_TAG_enumerator = 0x28 COMMA
+    DW_TAG_file_type = 0x29 COMMA
+    DW_TAG_friend = 0x2a COMMA
+    DW_TAG_namelist = 0x2b COMMA
+    DW_TAG_namelist_item = 0x2c COMMA
+    DW_TAG_packed_type = 0x2d COMMA
+    DW_TAG_subprogram = 0x2e COMMA
+    DW_TAG_template_type_param = 0x2f COMMA
+    DW_TAG_template_value_param = 0x30 COMMA
+    DW_TAG_thrown_type = 0x31 COMMA
+    DW_TAG_try_block = 0x32 COMMA
+    DW_TAG_variant_part = 0x33 COMMA
+    DW_TAG_variable = 0x34 COMMA
+    DW_TAG_volatile_type = 0x35 COMMA
+    /* DWARF 3.  */
+    DW_TAG_dwarf_procedure = 0x36 COMMA
+    DW_TAG_restrict_type = 0x37 COMMA
+    DW_TAG_interface_type = 0x38 COMMA
+    DW_TAG_namespace = 0x39 COMMA
+    DW_TAG_imported_module = 0x3a COMMA
+    DW_TAG_unspecified_type = 0x3b COMMA
+    DW_TAG_partial_unit = 0x3c COMMA
+    DW_TAG_imported_unit = 0x3d COMMA
+    /* SGI/MIPS Extensions.  */
+    DW_TAG_MIPS_loop = 0x4081 COMMA
+    /* GNU extensions.	*/
+    DW_TAG_format_label = 0x4101 COMMA	/* For FORTRAN 77 and Fortran 90.  */
+    DW_TAG_function_template = 0x4102 COMMA	/* For C++.  */
+    DW_TAG_class_template = 0x4103 COMMA	/* For C++.  */
+    DW_TAG_GNU_BINCL = 0x4104 COMMA
+    DW_TAG_GNU_EINCL = 0x4105 COMMA
+    /* Extensions for UPC.  See: http://upc.gwu.edu/~upc.  */
+    DW_TAG_upc_shared_type = 0x8765 COMMA
+    DW_TAG_upc_strict_type = 0x8766 COMMA
+    DW_TAG_upc_relaxed_type = 0x8767
+IF_NOT_ASM(};)
+
+#define DW_TAG_lo_user	0x4080
+#define DW_TAG_hi_user	0xffff
+
+/* Flag that tells whether entry has a child or not.  */
+#define DW_children_no	 0
+#define	DW_children_yes  1
+
+/* Form names and codes.  */
+ENUM(dwarf_form)
+
+    DW_FORM_addr = 0x01 COMMA
+    DW_FORM_block2 = 0x03 COMMA
+    DW_FORM_block4 = 0x04 COMMA
+    DW_FORM_data2 = 0x05 COMMA
+    DW_FORM_data4 = 0x06 COMMA
+    DW_FORM_data8 = 0x07 COMMA
+    DW_FORM_string = 0x08 COMMA
+    DW_FORM_block = 0x09 COMMA
+    DW_FORM_block1 = 0x0a COMMA
+    DW_FORM_data1 = 0x0b COMMA
+    DW_FORM_flag = 0x0c COMMA
+    DW_FORM_sdata = 0x0d COMMA
+    DW_FORM_strp = 0x0e COMMA
+    DW_FORM_udata = 0x0f COMMA
+    DW_FORM_ref_addr = 0x10 COMMA
+    DW_FORM_ref1 = 0x11 COMMA
+    DW_FORM_ref2 = 0x12 COMMA
+    DW_FORM_ref4 = 0x13 COMMA
+    DW_FORM_ref8 = 0x14 COMMA
+    DW_FORM_ref_udata = 0x15 COMMA
+    DW_FORM_indirect = 0x16
+IF_NOT_ASM(};)
+
+/* Attribute names and codes.  */
+
+ENUM(dwarf_attribute)
+
+    DW_AT_sibling = 0x01 COMMA
+    DW_AT_location = 0x02 COMMA
+    DW_AT_name = 0x03 COMMA
+    DW_AT_ordering = 0x09 COMMA
+    DW_AT_subscr_data = 0x0a COMMA
+    DW_AT_byte_size = 0x0b COMMA
+    DW_AT_bit_offset = 0x0c COMMA
+    DW_AT_bit_size = 0x0d COMMA
+    DW_AT_element_list = 0x0f COMMA
+    DW_AT_stmt_list = 0x10 COMMA
+    DW_AT_low_pc = 0x11 COMMA
+    DW_AT_high_pc = 0x12 COMMA
+    DW_AT_language = 0x13 COMMA
+    DW_AT_member = 0x14 COMMA
+    DW_AT_discr = 0x15 COMMA
+    DW_AT_discr_value = 0x16 COMMA
+    DW_AT_visibility = 0x17 COMMA
+    DW_AT_import = 0x18 COMMA
+    DW_AT_string_length = 0x19 COMMA
+    DW_AT_common_reference = 0x1a COMMA
+    DW_AT_comp_dir = 0x1b COMMA
+    DW_AT_const_value = 0x1c COMMA
+    DW_AT_containing_type = 0x1d COMMA
+    DW_AT_default_value = 0x1e COMMA
+    DW_AT_inline = 0x20 COMMA
+    DW_AT_is_optional = 0x21 COMMA
+    DW_AT_lower_bound = 0x22 COMMA
+    DW_AT_producer = 0x25 COMMA
+    DW_AT_prototyped = 0x27 COMMA
+    DW_AT_return_addr = 0x2a COMMA
+    DW_AT_start_scope = 0x2c COMMA
+    DW_AT_stride_size = 0x2e COMMA
+    DW_AT_upper_bound = 0x2f COMMA
+    DW_AT_abstract_origin = 0x31 COMMA
+    DW_AT_accessibility = 0x32 COMMA
+    DW_AT_address_class = 0x33 COMMA
+    DW_AT_artificial = 0x34 COMMA
+    DW_AT_base_types = 0x35 COMMA
+    DW_AT_calling_convention = 0x36 COMMA
+    DW_AT_count = 0x37 COMMA
+    DW_AT_data_member_location = 0x38 COMMA
+    DW_AT_decl_column = 0x39 COMMA
+    DW_AT_decl_file = 0x3a COMMA
+    DW_AT_decl_line = 0x3b COMMA
+    DW_AT_declaration = 0x3c COMMA
+    DW_AT_discr_list = 0x3d COMMA
+    DW_AT_encoding = 0x3e COMMA
+    DW_AT_external = 0x3f COMMA
+    DW_AT_frame_base = 0x40 COMMA
+    DW_AT_friend = 0x41 COMMA
+    DW_AT_identifier_case = 0x42 COMMA
+    DW_AT_macro_info = 0x43 COMMA
+    DW_AT_namelist_items = 0x44 COMMA
+    DW_AT_priority = 0x45 COMMA
+    DW_AT_segment = 0x46 COMMA
+    DW_AT_specification = 0x47 COMMA
+    DW_AT_static_link = 0x48 COMMA
+    DW_AT_type = 0x49 COMMA
+    DW_AT_use_location = 0x4a COMMA
+    DW_AT_variable_parameter = 0x4b COMMA
+    DW_AT_virtuality = 0x4c COMMA
+    DW_AT_vtable_elem_location = 0x4d COMMA
+    /* DWARF 3 values.	*/
+    DW_AT_allocated	= 0x4e COMMA
+    DW_AT_associated	= 0x4f COMMA
+    DW_AT_data_location = 0x50 COMMA
+    DW_AT_stride	= 0x51 COMMA
+    DW_AT_entry_pc	= 0x52 COMMA
+    DW_AT_use_UTF8	= 0x53 COMMA
+    DW_AT_extension	= 0x54 COMMA
+    DW_AT_ranges	= 0x55 COMMA
+    DW_AT_trampoline	= 0x56 COMMA
+    DW_AT_call_column	= 0x57 COMMA
+    DW_AT_call_file	= 0x58 COMMA
+    DW_AT_call_line	= 0x59 COMMA
+    /* SGI/MIPS extensions.  */
+    DW_AT_MIPS_fde = 0x2001 COMMA
+    DW_AT_MIPS_loop_begin = 0x2002 COMMA
+    DW_AT_MIPS_tail_loop_begin = 0x2003 COMMA
+    DW_AT_MIPS_epilog_begin = 0x2004 COMMA
+    DW_AT_MIPS_loop_unroll_factor = 0x2005 COMMA
+    DW_AT_MIPS_software_pipeline_depth = 0x2006 COMMA
+    DW_AT_MIPS_linkage_name = 0x2007 COMMA
+    DW_AT_MIPS_stride = 0x2008 COMMA
+    DW_AT_MIPS_abstract_name = 0x2009 COMMA
+    DW_AT_MIPS_clone_origin = 0x200a COMMA
+    DW_AT_MIPS_has_inlines = 0x200b COMMA
+    /* GNU extensions.	*/
+    DW_AT_sf_names   = 0x2101 COMMA
+    DW_AT_src_info   = 0x2102 COMMA
+    DW_AT_mac_info   = 0x2103 COMMA
+    DW_AT_src_coords = 0x2104 COMMA
+    DW_AT_body_begin = 0x2105 COMMA
+    DW_AT_body_end   = 0x2106 COMMA
+    DW_AT_GNU_vector = 0x2107 COMMA
+    /* VMS extensions.	*/
+    DW_AT_VMS_rtnbeg_pd_address = 0x2201 COMMA
+    /* UPC extension.  */
+    DW_AT_upc_threads_scaled = 0x3210
+IF_NOT_ASM(};)
+
+#define DW_AT_lo_user	0x2000	/* Implementation-defined range start.	*/
+#define DW_AT_hi_user	0x3ff0	/* Implementation-defined range end.  */
+
+/* Location atom names and codes.  */
+ENUM(dwarf_location_atom)
+
+    DW_OP_addr = 0x03 COMMA
+    DW_OP_deref = 0x06 COMMA
+    DW_OP_const1u = 0x08 COMMA
+    DW_OP_const1s = 0x09 COMMA
+    DW_OP_const2u = 0x0a COMMA
+    DW_OP_const2s = 0x0b COMMA
+    DW_OP_const4u = 0x0c COMMA
+    DW_OP_const4s = 0x0d COMMA
+    DW_OP_const8u = 0x0e COMMA
+    DW_OP_const8s = 0x0f COMMA
+    DW_OP_constu = 0x10 COMMA
+    DW_OP_consts = 0x11 COMMA
+    DW_OP_dup = 0x12 COMMA
+    DW_OP_drop = 0x13 COMMA
+    DW_OP_over = 0x14 COMMA
+    DW_OP_pick = 0x15 COMMA
+    DW_OP_swap = 0x16 COMMA
+    DW_OP_rot = 0x17 COMMA
+    DW_OP_xderef = 0x18 COMMA
+    DW_OP_abs = 0x19 COMMA
+    DW_OP_and = 0x1a COMMA
+    DW_OP_div = 0x1b COMMA
+    DW_OP_minus = 0x1c COMMA
+    DW_OP_mod = 0x1d COMMA
+    DW_OP_mul = 0x1e COMMA
+    DW_OP_neg = 0x1f COMMA
+    DW_OP_not = 0x20 COMMA
+    DW_OP_or = 0x21 COMMA
+    DW_OP_plus = 0x22 COMMA
+    DW_OP_plus_uconst = 0x23 COMMA
+    DW_OP_shl = 0x24 COMMA
+    DW_OP_shr = 0x25 COMMA
+    DW_OP_shra = 0x26 COMMA
+    DW_OP_xor = 0x27 COMMA
+    DW_OP_bra = 0x28 COMMA
+    DW_OP_eq = 0x29 COMMA
+    DW_OP_ge = 0x2a COMMA
+    DW_OP_gt = 0x2b COMMA
+    DW_OP_le = 0x2c COMMA
+    DW_OP_lt = 0x2d COMMA
+    DW_OP_ne = 0x2e COMMA
+    DW_OP_skip = 0x2f COMMA
+    DW_OP_lit0 = 0x30 COMMA
+    DW_OP_lit1 = 0x31 COMMA
+    DW_OP_lit2 = 0x32 COMMA
+    DW_OP_lit3 = 0x33 COMMA
+    DW_OP_lit4 = 0x34 COMMA
+    DW_OP_lit5 = 0x35 COMMA
+    DW_OP_lit6 = 0x36 COMMA
+    DW_OP_lit7 = 0x37 COMMA
+    DW_OP_lit8 = 0x38 COMMA
+    DW_OP_lit9 = 0x39 COMMA
+    DW_OP_lit10 = 0x3a COMMA
+    DW_OP_lit11 = 0x3b COMMA
+    DW_OP_lit12 = 0x3c COMMA
+    DW_OP_lit13 = 0x3d COMMA
+    DW_OP_lit14 = 0x3e COMMA
+    DW_OP_lit15 = 0x3f COMMA
+    DW_OP_lit16 = 0x40 COMMA
+    DW_OP_lit17 = 0x41 COMMA
+    DW_OP_lit18 = 0x42 COMMA
+    DW_OP_lit19 = 0x43 COMMA
+    DW_OP_lit20 = 0x44 COMMA
+    DW_OP_lit21 = 0x45 COMMA
+    DW_OP_lit22 = 0x46 COMMA
+    DW_OP_lit23 = 0x47 COMMA
+    DW_OP_lit24 = 0x48 COMMA
+    DW_OP_lit25 = 0x49 COMMA
+    DW_OP_lit26 = 0x4a COMMA
+    DW_OP_lit27 = 0x4b COMMA
+    DW_OP_lit28 = 0x4c COMMA
+    DW_OP_lit29 = 0x4d COMMA
+    DW_OP_lit30 = 0x4e COMMA
+    DW_OP_lit31 = 0x4f COMMA
+    DW_OP_reg0 = 0x50 COMMA
+    DW_OP_reg1 = 0x51 COMMA
+    DW_OP_reg2 = 0x52 COMMA
+    DW_OP_reg3 = 0x53 COMMA
+    DW_OP_reg4 = 0x54 COMMA
+    DW_OP_reg5 = 0x55 COMMA
+    DW_OP_reg6 = 0x56 COMMA
+    DW_OP_reg7 = 0x57 COMMA
+    DW_OP_reg8 = 0x58 COMMA
+    DW_OP_reg9 = 0x59 COMMA
+    DW_OP_reg10 = 0x5a COMMA
+    DW_OP_reg11 = 0x5b COMMA
+    DW_OP_reg12 = 0x5c COMMA
+    DW_OP_reg13 = 0x5d COMMA
+    DW_OP_reg14 = 0x5e COMMA
+    DW_OP_reg15 = 0x5f COMMA
+    DW_OP_reg16 = 0x60 COMMA
+    DW_OP_reg17 = 0x61 COMMA
+    DW_OP_reg18 = 0x62 COMMA
+    DW_OP_reg19 = 0x63 COMMA
+    DW_OP_reg20 = 0x64 COMMA
+    DW_OP_reg21 = 0x65 COMMA
+    DW_OP_reg22 = 0x66 COMMA
+    DW_OP_reg23 = 0x67 COMMA
+    DW_OP_reg24 = 0x68 COMMA
+    DW_OP_reg25 = 0x69 COMMA
+    DW_OP_reg26 = 0x6a COMMA
+    DW_OP_reg27 = 0x6b COMMA
+    DW_OP_reg28 = 0x6c COMMA
+    DW_OP_reg29 = 0x6d COMMA
+    DW_OP_reg30 = 0x6e COMMA
+    DW_OP_reg31 = 0x6f COMMA
+    DW_OP_breg0 = 0x70 COMMA
+    DW_OP_breg1 = 0x71 COMMA
+    DW_OP_breg2 = 0x72 COMMA
+    DW_OP_breg3 = 0x73 COMMA
+    DW_OP_breg4 = 0x74 COMMA
+    DW_OP_breg5 = 0x75 COMMA
+    DW_OP_breg6 = 0x76 COMMA
+    DW_OP_breg7 = 0x77 COMMA
+    DW_OP_breg8 = 0x78 COMMA
+    DW_OP_breg9 = 0x79 COMMA
+    DW_OP_breg10 = 0x7a COMMA
+    DW_OP_breg11 = 0x7b COMMA
+    DW_OP_breg12 = 0x7c COMMA
+    DW_OP_breg13 = 0x7d COMMA
+    DW_OP_breg14 = 0x7e COMMA
+    DW_OP_breg15 = 0x7f COMMA
+    DW_OP_breg16 = 0x80 COMMA
+    DW_OP_breg17 = 0x81 COMMA
+    DW_OP_breg18 = 0x82 COMMA
+    DW_OP_breg19 = 0x83 COMMA
+    DW_OP_breg20 = 0x84 COMMA
+    DW_OP_breg21 = 0x85 COMMA
+    DW_OP_breg22 = 0x86 COMMA
+    DW_OP_breg23 = 0x87 COMMA
+    DW_OP_breg24 = 0x88 COMMA
+    DW_OP_breg25 = 0x89 COMMA
+    DW_OP_breg26 = 0x8a COMMA
+    DW_OP_breg27 = 0x8b COMMA
+    DW_OP_breg28 = 0x8c COMMA
+    DW_OP_breg29 = 0x8d COMMA
+    DW_OP_breg30 = 0x8e COMMA
+    DW_OP_breg31 = 0x8f COMMA
+    DW_OP_regx = 0x90 COMMA
+    DW_OP_fbreg = 0x91 COMMA
+    DW_OP_bregx = 0x92 COMMA
+    DW_OP_piece = 0x93 COMMA
+    DW_OP_deref_size = 0x94 COMMA
+    DW_OP_xderef_size = 0x95 COMMA
+    DW_OP_nop = 0x96 COMMA
+    /* DWARF 3 extensions.  */
+    DW_OP_push_object_address = 0x97 COMMA
+    DW_OP_call2 = 0x98 COMMA
+    DW_OP_call4 = 0x99 COMMA
+    DW_OP_call_ref = 0x9a COMMA
+    /* GNU extensions.	*/
+    DW_OP_GNU_push_tls_address = 0xe0
+IF_NOT_ASM(};)
+
+#define DW_OP_lo_user	0xe0	/* Implementation-defined range start.	*/
+#define DW_OP_hi_user	0xff	/* Implementation-defined range end.  */
+
+/* Type encodings.  */
+ENUM(dwarf_type)
+
+    DW_ATE_void = 0x0 COMMA
+    DW_ATE_address = 0x1 COMMA
+    DW_ATE_boolean = 0x2 COMMA
+    DW_ATE_complex_float = 0x3 COMMA
+    DW_ATE_float = 0x4 COMMA
+    DW_ATE_signed = 0x5 COMMA
+    DW_ATE_signed_char = 0x6 COMMA
+    DW_ATE_unsigned = 0x7 COMMA
+    DW_ATE_unsigned_char = 0x8 COMMA
+    /* DWARF 3.  */
+    DW_ATE_imaginary_float = 0x9
+IF_NOT_ASM(};)
+
+#define	DW_ATE_lo_user 0x80
+#define	DW_ATE_hi_user 0xff
+
+/* Array ordering names and codes.  */
+ENUM(dwarf_array_dim_ordering)
+
+    DW_ORD_row_major = 0 COMMA
+    DW_ORD_col_major = 1
+IF_NOT_ASM(};)
+
+/* Access attribute.  */
+ENUM(dwarf_access_attribute)
+
+    DW_ACCESS_public = 1 COMMA
+    DW_ACCESS_protected = 2 COMMA
+    DW_ACCESS_private = 3
+IF_NOT_ASM(};)
+
+/* Visibility.	*/
+ENUM(dwarf_visibility_attribute)
+
+    DW_VIS_local = 1 COMMA
+    DW_VIS_exported = 2 COMMA
+    DW_VIS_qualified = 3
+IF_NOT_ASM(};)
+
+/* Virtuality.	*/
+ENUM(dwarf_virtuality_attribute)
+
+    DW_VIRTUALITY_none = 0 COMMA
+    DW_VIRTUALITY_virtual = 1 COMMA
+    DW_VIRTUALITY_pure_virtual = 2
+IF_NOT_ASM(};)
+
+/* Case sensitivity.  */
+ENUM(dwarf_id_case)
+
+    DW_ID_case_sensitive = 0 COMMA
+    DW_ID_up_case = 1 COMMA
+    DW_ID_down_case = 2 COMMA
+    DW_ID_case_insensitive = 3
+IF_NOT_ASM(};)
+
+/* Calling convention.	*/
+ENUM(dwarf_calling_convention)
+
+    DW_CC_normal = 0x1 COMMA
+    DW_CC_program = 0x2 COMMA
+    DW_CC_nocall = 0x3
+IF_NOT_ASM(};)
+
+#define DW_CC_lo_user 0x40
+#define DW_CC_hi_user 0xff
+
+/* Inline attribute.  */
+ENUM(dwarf_inline_attribute)
+
+    DW_INL_not_inlined = 0 COMMA
+    DW_INL_inlined = 1 COMMA
+    DW_INL_declared_not_inlined = 2 COMMA
+    DW_INL_declared_inlined = 3
+IF_NOT_ASM(};)
+
+/* Discriminant lists.	*/
+ENUM(dwarf_discrim_list)
+
+    DW_DSC_label = 0 COMMA
+    DW_DSC_range = 1
+IF_NOT_ASM(};)
+
+/* Line number opcodes.  */
+ENUM(dwarf_line_number_ops)
+
+    DW_LNS_extended_op = 0 COMMA
+    DW_LNS_copy = 1 COMMA
+    DW_LNS_advance_pc = 2 COMMA
+    DW_LNS_advance_line = 3 COMMA
+    DW_LNS_set_file = 4 COMMA
+    DW_LNS_set_column = 5 COMMA
+    DW_LNS_negate_stmt = 6 COMMA
+    DW_LNS_set_basic_block = 7 COMMA
+    DW_LNS_const_add_pc = 8 COMMA
+    DW_LNS_fixed_advance_pc = 9 COMMA
+    /* DWARF 3.  */
+    DW_LNS_set_prologue_end = 10 COMMA
+    DW_LNS_set_epilogue_begin = 11 COMMA
+    DW_LNS_set_isa = 12
+IF_NOT_ASM(};)
+
+/* Line number extended opcodes.  */
+ENUM(dwarf_line_number_x_ops)
+
+    DW_LNE_end_sequence = 1 COMMA
+    DW_LNE_set_address = 2 COMMA
+    DW_LNE_define_file = 3
+IF_NOT_ASM(};)
+
+/* Call frame information.  */
+ENUM(dwarf_call_frame_info)
+
+    DW_CFA_advance_loc = 0x40 COMMA
+    DW_CFA_offset = 0x80 COMMA
+    DW_CFA_restore = 0xc0 COMMA
+    DW_CFA_nop = 0x00 COMMA
+    DW_CFA_set_loc = 0x01 COMMA
+    DW_CFA_advance_loc1 = 0x02 COMMA
+    DW_CFA_advance_loc2 = 0x03 COMMA
+    DW_CFA_advance_loc4 = 0x04 COMMA
+    DW_CFA_offset_extended = 0x05 COMMA
+    DW_CFA_restore_extended = 0x06 COMMA
+    DW_CFA_undefined = 0x07 COMMA
+    DW_CFA_same_value = 0x08 COMMA
+    DW_CFA_register = 0x09 COMMA
+    DW_CFA_remember_state = 0x0a COMMA
+    DW_CFA_restore_state = 0x0b COMMA
+    DW_CFA_def_cfa = 0x0c COMMA
+    DW_CFA_def_cfa_register = 0x0d COMMA
+    DW_CFA_def_cfa_offset = 0x0e COMMA
+
+    /* DWARF 3.  */
+    DW_CFA_def_cfa_expression = 0x0f COMMA
+    DW_CFA_expression = 0x10 COMMA
+    DW_CFA_offset_extended_sf = 0x11 COMMA
+    DW_CFA_def_cfa_sf = 0x12 COMMA
+    DW_CFA_def_cfa_offset_sf = 0x13 COMMA
+
+    /* SGI/MIPS specific.  */
+    DW_CFA_MIPS_advance_loc8 = 0x1d COMMA
+
+    /* GNU extensions.	*/
+    DW_CFA_GNU_window_save = 0x2d COMMA
+    DW_CFA_GNU_args_size = 0x2e COMMA
+    DW_CFA_GNU_negative_offset_extended = 0x2f
+IF_NOT_ASM(};)
+
+#define DW_CIE_ID	  0xffffffff
+#define DW_CIE_VERSION	  1
+
+#define DW_CFA_extended   0
+#define DW_CFA_lo_user	  0x1c
+#define DW_CFA_hi_user	  0x3f
+
+#define DW_CHILDREN_no		     0x00
+#define DW_CHILDREN_yes		     0x01
+
+#define DW_ADDR_none		0
+
+/* Source language names and codes.  */
+ENUM(dwarf_source_language)
+
+    DW_LANG_C89 = 0x0001 COMMA
+    DW_LANG_C = 0x0002 COMMA
+    DW_LANG_Ada83 = 0x0003 COMMA
+    DW_LANG_C_plus_plus = 0x0004 COMMA
+    DW_LANG_Cobol74 = 0x0005 COMMA
+    DW_LANG_Cobol85 = 0x0006 COMMA
+    DW_LANG_Fortran77 = 0x0007 COMMA
+    DW_LANG_Fortran90 = 0x0008 COMMA
+    DW_LANG_Pascal83 = 0x0009 COMMA
+    DW_LANG_Modula2 = 0x000a COMMA
+    DW_LANG_Java = 0x000b COMMA
+    /* DWARF 3.  */
+    DW_LANG_C99 = 0x000c COMMA
+    DW_LANG_Ada95 = 0x000d COMMA
+    DW_LANG_Fortran95 = 0x000e COMMA
+    /* MIPS.  */
+    DW_LANG_Mips_Assembler = 0x8001 COMMA
+    /* UPC.  */
+    DW_LANG_Upc = 0x8765
+IF_NOT_ASM(};)
+
+#define DW_LANG_lo_user 0x8000	/* Implementation-defined range start.	*/
+#define DW_LANG_hi_user 0xffff	/* Implementation-defined range start.	*/
+
+/* Names and codes for macro information.  */
+ENUM(dwarf_macinfo_record_type)
+
+    DW_MACINFO_define = 1 COMMA
+    DW_MACINFO_undef = 2 COMMA
+    DW_MACINFO_start_file = 3 COMMA
+    DW_MACINFO_end_file = 4 COMMA
+    DW_MACINFO_vendor_ext = 255
+IF_NOT_ASM(};)
+
+/* @@@ For use with GNU frame unwind information.  */
+
+#define DW_EH_PE_absptr		0x00
+#define DW_EH_PE_omit		0xff
+
+#define DW_EH_PE_uleb128	0x01
+#define DW_EH_PE_udata2		0x02
+#define DW_EH_PE_udata4		0x03
+#define DW_EH_PE_udata8		0x04
+#define DW_EH_PE_sleb128	0x09
+#define DW_EH_PE_sdata2		0x0A
+#define DW_EH_PE_sdata4		0x0B
+#define DW_EH_PE_sdata8		0x0C
+#define DW_EH_PE_signed		0x08
+
+#define DW_EH_PE_pcrel		0x10
+#define DW_EH_PE_textrel	0x20
+#define DW_EH_PE_datarel	0x30
+#define DW_EH_PE_funcrel	0x40
+#define DW_EH_PE_aligned	0x50
+
+#define DW_EH_PE_indirect	0x80
+
+#endif /* _ELF_DWARF2_H */
--- diff/include/linux/ghash.h	1970-01-01 01:00:00.000000000 +0100
+++ source/include/linux/ghash.h	2004-02-09 10:39:57.000000000 +0000
@@ -0,0 +1,236 @@
+/*
+ * include/linux/ghash.h -- generic hashing with fuzzy retrieval
+ *
+ * (C) 1997 Thomas Schoebel-Theuer
+ *
+ * The algorithms implemented here seem to be a completely new invention,
+ * and I'll publish the fundamentals in a paper.
+ */
+
+#ifndef _GHASH_H
+#define _GHASH_H
+/* HASHSIZE _must_ be a power of two!!! */
+
+
+#define DEF_HASH_FUZZY_STRUCTS(NAME,HASHSIZE,TYPE) \
+\
+struct NAME##_table {\
+	TYPE * hashtable[HASHSIZE];\
+	TYPE * sorted_list;\
+	int nr_entries;\
+};\
+\
+struct NAME##_ptrs {\
+	TYPE * next_hash;\
+	TYPE * prev_hash;\
+	TYPE * next_sorted;\
+	TYPE * prev_sorted;\
+};
+
+#define DEF_HASH_FUZZY(LINKAGE,NAME,HASHSIZE,TYPE,PTRS,KEYTYPE,KEY,KEYCMP,KEYEQ,HASHFN)\
+\
+LINKAGE void insert_##NAME##_hash(struct NAME##_table * tbl, TYPE * elem)\
+{\
+	int ix = HASHFN(elem->KEY);\
+	TYPE ** base = &tbl->hashtable[ix];\
+	TYPE * ptr = *base;\
+	TYPE * prev = NULL;\
+\
+	tbl->nr_entries++;\
+	while(ptr && KEYCMP(ptr->KEY, elem->KEY)) {\
+		base = &ptr->PTRS.next_hash;\
+		prev = ptr;\
+		ptr = *base;\
+	}\
+	elem->PTRS.next_hash = ptr;\
+	elem->PTRS.prev_hash = prev;\
+	if(ptr) {\
+		ptr->PTRS.prev_hash = elem;\
+	}\
+	*base = elem;\
+\
+	ptr = prev;\
+	if(!ptr) {\
+		ptr = tbl->sorted_list;\
+		prev = NULL;\
+	} else {\
+		prev = ptr->PTRS.prev_sorted;\
+	}\
+	while(ptr) {\
+		TYPE * next = ptr->PTRS.next_hash;\
+		if(next && KEYCMP(next->KEY, elem->KEY)) {\
+			prev = ptr;\
+			ptr = next;\
+		} else if(KEYCMP(ptr->KEY, elem->KEY)) {\
+			prev = ptr;\
+			ptr = ptr->PTRS.next_sorted;\
+		} else\
+			break;\
+	}\
+	elem->PTRS.next_sorted = ptr;\
+	elem->PTRS.prev_sorted = prev;\
+	if(ptr) {\
+		ptr->PTRS.prev_sorted = elem;\
+	}\
+	if(prev) {\
+		prev->PTRS.next_sorted = elem;\
+	} else {\
+		tbl->sorted_list = elem;\
+	}\
+}\
+\
+LINKAGE void remove_##NAME##_hash(struct NAME##_table * tbl, TYPE * elem)\
+{\
+	TYPE * next = elem->PTRS.next_hash;\
+	TYPE * prev = elem->PTRS.prev_hash;\
+\
+	tbl->nr_entries--;\
+	if(next)\
+		next->PTRS.prev_hash = prev;\
+	if(prev)\
+		prev->PTRS.next_hash = next;\
+	else {\
+		int ix = HASHFN(elem->KEY);\
+		tbl->hashtable[ix] = next;\
+	}\
+\
+	next = elem->PTRS.next_sorted;\
+	prev = elem->PTRS.prev_sorted;\
+	if(next)\
+		next->PTRS.prev_sorted = prev;\
+	if(prev)\
+		prev->PTRS.next_sorted = next;\
+	else\
+		tbl->sorted_list = next;\
+}\
+\
+LINKAGE TYPE * find_##NAME##_hash(struct NAME##_table * tbl, KEYTYPE pos)\
+{\
+	int ix = hashfn(pos);\
+	TYPE * ptr = tbl->hashtable[ix];\
+	while(ptr && KEYCMP(ptr->KEY, pos))\
+		ptr = ptr->PTRS.next_hash;\
+	if(ptr && !KEYEQ(ptr->KEY, pos))\
+		ptr = NULL;\
+	return ptr;\
+}\
+\
+LINKAGE TYPE * find_##NAME##_hash_fuzzy(struct NAME##_table * tbl, KEYTYPE pos)\
+{\
+	int ix;\
+	int offset;\
+	TYPE * ptr;\
+	TYPE * next;\
+\
+	ptr = tbl->sorted_list;\
+	if(!ptr || KEYCMP(pos, ptr->KEY))\
+		return NULL;\
+	ix = HASHFN(pos);\
+	offset = HASHSIZE;\
+	do {\
+		offset >>= 1;\
+		next = tbl->hashtable[(ix+offset) & ((HASHSIZE)-1)];\
+		if(next && (KEYCMP(next->KEY, pos) || KEYEQ(next->KEY, pos))\
+		   && KEYCMP(ptr->KEY, next->KEY))\
+			ptr = next;\
+	} while(offset);\
+\
+	for(;;) {\
+		next = ptr->PTRS.next_hash;\
+		if(next) {\
+			if(KEYCMP(next->KEY, pos)) {\
+				ptr = next;\
+				continue;\
+			}\
+		}\
+		next = ptr->PTRS.next_sorted;\
+		if(next && KEYCMP(next->KEY, pos)) {\
+			ptr = next;\
+			continue;\
+		}\
+		return ptr;\
+	}\
+	return NULL;\
+}
+
+/* LINKAGE - empty or "static", depending on whether you want the definitions to
+ *	be public or not
+ * NAME - a string to stick in names to make this hash table type distinct from
+ * 	any others
+ * HASHSIZE - number of buckets
+ * TYPE - type of data contained in the buckets - must be a structure, one
+ * 	field is of type NAME_ptrs, another is the hash key
+ * PTRS - TYPE must contain a field of type NAME_ptrs, PTRS is the name of that
+ * 	field
+ * KEYTYPE - type of the key field within TYPE
+ * KEY - name of the key field within TYPE
+ * KEYCMP - pointer to function that compares KEYTYPEs to each other - the
+ * 	prototype is int KEYCMP(KEYTYPE, KEYTYPE), it returns zero for equal,
+ * 	non-zero for not equal
+ * HASHFN - the hash function - the prototype is int HASHFN(KEYTYPE),
+ * 	it returns a number in the range 0 ... HASHSIZE - 1
+ * Call DEF_HASH_STRUCTS, define your hash table as a NAME_table, then call
+ * DEF_HASH.
+ */
+
+#define DEF_HASH_STRUCTS(NAME,HASHSIZE,TYPE) \
+\
+struct NAME##_table {\
+	TYPE * hashtable[HASHSIZE];\
+	int nr_entries;\
+};\
+\
+struct NAME##_ptrs {\
+	TYPE * next_hash;\
+	TYPE * prev_hash;\
+};
+
+#define DEF_HASH(LINKAGE,NAME,TYPE,PTRS,KEYTYPE,KEY,KEYCMP,HASHFN)\
+\
+LINKAGE void insert_##NAME##_hash(struct NAME##_table * tbl, TYPE * elem)\
+{\
+	int ix = HASHFN(elem->KEY);\
+	TYPE ** base = &tbl->hashtable[ix];\
+	TYPE * ptr = *base;\
+	TYPE * prev = NULL;\
+\
+	tbl->nr_entries++;\
+	while(ptr && KEYCMP(ptr->KEY, elem->KEY)) {\
+		base = &ptr->PTRS.next_hash;\
+		prev = ptr;\
+		ptr = *base;\
+	}\
+	elem->PTRS.next_hash = ptr;\
+	elem->PTRS.prev_hash = prev;\
+	if(ptr) {\
+		ptr->PTRS.prev_hash = elem;\
+	}\
+	*base = elem;\
+}\
+\
+LINKAGE void remove_##NAME##_hash(struct NAME##_table * tbl, TYPE * elem)\
+{\
+	TYPE * next = elem->PTRS.next_hash;\
+	TYPE * prev = elem->PTRS.prev_hash;\
+\
+	tbl->nr_entries--;\
+	if(next)\
+		next->PTRS.prev_hash = prev;\
+	if(prev)\
+		prev->PTRS.next_hash = next;\
+	else {\
+		int ix = HASHFN(elem->KEY);\
+		tbl->hashtable[ix] = next;\
+	}\
+}\
+\
+LINKAGE TYPE * find_##NAME##_hash(struct NAME##_table * tbl, KEYTYPE pos)\
+{\
+	int ix = HASHFN(pos);\
+	TYPE * ptr = tbl->hashtable[ix];\
+	while(ptr && KEYCMP(ptr->KEY, pos))\
+		ptr = ptr->PTRS.next_hash;\
+	return ptr;\
+}
+
+#endif
--- diff/include/linux/kthread.h	1970-01-01 01:00:00.000000000 +0100
+++ source/include/linux/kthread.h	2004-02-09 10:39:57.000000000 +0000
@@ -0,0 +1,71 @@
+#ifndef _LINUX_KTHREAD_H
+#define _LINUX_KTHREAD_H
+/* Simple interface for creating and stopping kernel threads without mess. */
+#include <linux/err.h>
+#include <linux/sched.h>
+
+/**
+ * kthread_create: create a kthread.
+ * @threadfn: the function to run until signal_pending(current).
+ * @data: data ptr for @threadfn.
+ * @namefmt: printf-style name for the thread.
+ *
+ * Description: This helper function creates and names a kernel
+ * thread.  The thread will be stopped: use wake_up_process() to start
+ * it.  See also kthread_run(), kthread_create_on_cpu().
+ *
+ * When woken, the thread will run @threadfn() with @data as its
+ * argument. @threadfn can either call do_exit() directly if it is a
+ * standalone thread for which noone will call kthread_stop(), or
+ * return when 'signal_pending(current)' is true (which means
+ * kthread_stop() has been called).  The return value should be zero
+ * or a negative error number: it will be passed to kthread_stop().
+ *
+ * Returns a task_struct or ERR_PTR(-ENOMEM).
+ */
+struct task_struct *kthread_create(int (*threadfn)(void *data),
+				   void *data,
+				   const char namefmt[], ...);
+
+/**
+ * kthread_run: create and wake a thread.
+ * @threadfn: the function to run until signal_pending(current).
+ * @data: data ptr for @threadfn.
+ * @namefmt: printf-style name for the thread.
+ *
+ * Description: Convenient wrapper for kthread_create() followed by
+ * wake_up_process().  Returns the kthread, or ERR_PTR(-ENOMEM). */
+#define kthread_run(threadfn, data, namefmt, ...)			   \
+({									   \
+	struct task_struct *__k						   \
+		= kthread_create(threadfn, data, namefmt, ## __VA_ARGS__); \
+	if (!IS_ERR(__k))						   \
+		wake_up_process(__k);					   \
+	__k;								   \
+})
+
+/**
+ * kthread_bind: bind a just-created kthread to a cpu.
+ * @k: thread created by kthread_create().
+ * @cpu: cpu (might not be online, must be possible) for @k to run on.
+ *
+ * Description: This function is equivalent to set_cpus_allowed(),
+ * except that @cpu doesn't need to be online, and the thread must be
+ * stopped (ie. just returned from kthread_create().
+ */
+void kthread_bind(struct task_struct *k, unsigned int cpu);
+
+/**
+ * kthread_stop: stop a thread created by kthread_create().
+ * @k: thread created by kthread_create().
+ *
+ * Sends a signal to @k, and waits for it to exit.  Your threadfn()
+ * must not call do_exit() itself if you use this function!  This can
+ * also be called after kthread_create() instead of calling
+ * wake_up_process(): the thread will exit without calling threadfn().
+ *
+ * Returns the result of threadfn(), or -EINTR if wake_up_process()
+ * was never called. */
+int kthread_stop(struct task_struct *k);
+
+#endif /* _LINUX_KTHREAD_H */
--- diff/include/linux/lockmeter.h	1970-01-01 01:00:00.000000000 +0100
+++ source/include/linux/lockmeter.h	2004-02-09 10:39:57.000000000 +0000
@@ -0,0 +1,320 @@
+/*
+ *  Copyright (C) 1999-2002 Silicon Graphics, Inc.
+ *
+ *  Written by John Hawkes (hawkes@sgi.com)
+ *  Based on klstat.h by Jack Steiner (steiner@sgi.com)
+ *
+ *  Modified by Ray Bryant (raybry@us.ibm.com) Feb-Apr 2000
+ *  Changes Copyright (C) 2000 IBM, Inc.
+ *  Added save of index in spinlock_t to improve efficiency
+ *  of "hold" time reporting for spinlocks
+ *  Added support for hold time statistics for read and write
+ *  locks.
+ *  Moved machine dependent code to include/asm/lockmeter.h.
+ *
+ */
+
+#ifndef _LINUX_LOCKMETER_H
+#define _LINUX_LOCKMETER_H
+
+
+/*---------------------------------------------------
+ *	architecture-independent lockmeter.h
+ *-------------------------------------------------*/
+
+/*
+ * raybry -- version 2: added efficient hold time statistics
+ *           requires lstat recompile, so flagged as new version
+ * raybry -- version 3: added global reader lock data
+ * hawkes -- version 4: removed some unnecessary fields to simplify mips64 port
+ */
+#define LSTAT_VERSION	5
+
+int	lstat_update(void*, void*, int);
+int	lstat_update_time(void*, void*, int, uint32_t);
+
+/*
+ * Currently, the mips64 and sparc64 kernels talk to a 32-bit lockstat, so we
+ * need to force compatibility in the inter-communication data structure.
+ */
+
+#if defined(CONFIG_MIPS32_COMPAT)
+#define TIME_T		uint32_t
+#elif defined(CONFIG_SPARC) || defined(CONFIG_SPARC64)
+#define TIME_T		uint64_t
+#else
+#define TIME_T		time_t
+#endif
+
+#if defined(__KERNEL__) || (!defined(CONFIG_MIPS32_COMPAT) && !defined(CONFIG_SPARC) && !defined(CONFIG_SPARC64)) || (_MIPS_SZLONG==32)
+#define POINTER		void *
+#else
+#define	POINTER		int64_t
+#endif
+
+/*
+ * Values for the "action" parameter passed to lstat_update.
+ *	ZZZ - do we want a try-success status here???
+ */
+#define LSTAT_ACT_NO_WAIT	0
+#define LSTAT_ACT_SPIN		1
+#define LSTAT_ACT_REJECT	2
+#define LSTAT_ACT_WW_SPIN       3
+#define LSTAT_ACT_SLEPT		4 /* UNUSED */
+
+#define LSTAT_ACT_MAX_VALUES	4 /* NOTE: Increase to 5 if use ACT_SLEPT */
+
+/*
+ * Special values for the low 2 bits of an RA passed to
+ * lstat_update.
+ */
+/* we use these values to figure out what kind of lock data */
+/* is stored in the statistics table entry at index ....... */
+#define LSTAT_RA_SPIN           0  /* spin lock data */
+#define LSTAT_RA_READ           1  /* read lock statistics */
+#define LSTAT_RA_SEMA		2  /* RESERVED */
+#define LSTAT_RA_WRITE          3  /* write lock statistics*/
+
+#define LSTAT_RA(n)	\
+	((void*)( ((unsigned long)__builtin_return_address(0) & ~3) | n) )
+
+/*
+ * Constants used for lock addresses in the lstat_directory
+ * to indicate special values of the lock address.
+ */
+#define	LSTAT_MULTI_LOCK_ADDRESS	NULL
+
+/*
+ * Maximum size of the lockstats tables. Increase this value
+ * if its not big enough. (Nothing bad happens if its not
+ * big enough although some locks will not be monitored.)
+ * We record overflows of this quantity in lstat_control.dir_overflows
+ *
+ * Note:  The max value here must fit into the field set
+ * and obtained by the macro's PUT_INDEX() and GET_INDEX().
+ * This value depends on how many bits are available in the
+ * lock word in the particular machine implementation we are on.
+ */
+#define LSTAT_MAX_STAT_INDEX		2000
+
+/*
+ * Size and mask for the hash table into the directory.
+ */
+#define LSTAT_HASH_TABLE_SIZE		4096		/* must be 2**N */
+#define LSTAT_HASH_TABLE_MASK		(LSTAT_HASH_TABLE_SIZE-1)
+
+#define DIRHASH(ra)      ((unsigned long)(ra)>>2 & LSTAT_HASH_TABLE_MASK)
+
+/*
+ *	This defines an entry in the lockstat directory. It contains
+ *	information about a lock being monitored.
+ *	A directory entry only contains the lock identification -
+ *	counts on usage of the lock are kept elsewhere in a per-cpu
+ *	data structure to minimize cache line pinging.
+ */
+typedef struct {
+	POINTER	caller_ra;		  /* RA of code that set lock */
+	POINTER	lock_ptr;		  /* lock address */
+	ushort	next_stat_index;  /* Used to link multiple locks that have the same hash table value */
+} lstat_directory_entry_t;
+
+/*
+ *	A multi-dimensioned array used to contain counts for lock accesses.
+ *	The array is 3-dimensional:
+ *		- CPU number. Keep from thrashing cache lines between CPUs
+ *		- Directory entry index. Identifies the lock
+ *		- Action. Indicates what kind of contention occurred on an
+ *		  access to the lock.
+ *
+ *	The index of an entry in the directory is the same as the 2nd index
+ *	of the entry in the counts array.
+ */
+/*
+ *  This table contains data for spin_locks, write locks, and read locks
+ *  Not all data is used for all cases.  In particular, the hold time
+ *  information is not stored here for read locks since that is a global
+ *  (e. g. cannot be separated out by return address) quantity.
+ *  See the lstat_read_lock_counts_t structure for the global read lock
+ *  hold time.
+ */
+typedef struct {
+	uint64_t    cum_wait_ticks;	/* sum of wait times               */
+	                                /* for write locks, sum of time a  */
+					/* writer is waiting for a reader  */
+	int64_t	    cum_hold_ticks;	/* cumulative sum of holds         */
+	                                /* not used for read mode locks    */
+					/* must be signed. ............... */
+	uint32_t    max_wait_ticks;	/* max waiting time                */
+	uint32_t    max_hold_ticks;	/* max holding time                */
+	uint64_t    cum_wait_ww_ticks;  /* sum times writer waits on writer*/
+	uint32_t    max_wait_ww_ticks;  /* max wait time writer vs writer  */
+	                                /* prev 2 only used for write locks*/
+	uint32_t    acquire_time;       /* time lock acquired this CPU     */
+	uint32_t    count[LSTAT_ACT_MAX_VALUES];
+} lstat_lock_counts_t;
+
+typedef lstat_lock_counts_t	lstat_cpu_counts_t[LSTAT_MAX_STAT_INDEX];
+
+/*
+ * User request to:
+ *	- turn statistic collection on/off, or to reset
+ */
+#define LSTAT_OFF	 0
+#define LSTAT_ON	 1
+#define LSTAT_RESET      2
+#define LSTAT_RELEASE    3
+
+#define LSTAT_MAX_READ_LOCK_INDEX 1000
+typedef struct {
+	POINTER	    lock_ptr;            /* address of lock for output stats */
+	uint32_t    read_lock_count;
+	int64_t     cum_hold_ticks;       /* sum of read lock hold times over */
+	                                  /* all callers. ....................*/
+	uint32_t    write_index;          /* last write lock hash table index */
+	uint32_t    busy_periods;         /* count of busy periods ended this */
+	uint64_t    start_busy;           /* time this busy period started. ..*/
+	uint64_t    busy_ticks;           /* sum of busy periods this lock. ..*/
+	uint64_t    max_busy;             /* longest busy period for this lock*/
+	uint32_t    max_readers;          /* maximum number of readers ...... */
+#ifdef USER_MODE_TESTING
+	rwlock_t    entry_lock;           /* lock for this read lock entry... */
+	                                  /* avoid having more than one rdr at*/
+	                                  /* needed for user space testing... */
+	                                  /* not needed for kernel 'cause it  */
+					  /* is non-preemptive. ............. */
+#endif
+} lstat_read_lock_counts_t;
+typedef lstat_read_lock_counts_t	lstat_read_lock_cpu_counts_t[LSTAT_MAX_READ_LOCK_INDEX];
+
+#if defined(__KERNEL__) || defined(USER_MODE_TESTING)
+
+#ifndef USER_MODE_TESTING
+#include <asm/lockmeter.h>
+#else
+#include "asm_newlockmeter.h"
+#endif
+
+/*
+ * Size and mask for the hash table into the directory.
+ */
+#define LSTAT_HASH_TABLE_SIZE		4096		/* must be 2**N */
+#define LSTAT_HASH_TABLE_MASK		(LSTAT_HASH_TABLE_SIZE-1)
+
+#define DIRHASH(ra)      ((unsigned long)(ra)>>2 & LSTAT_HASH_TABLE_MASK)
+
+/*
+ * This version eliminates the per processor lock stack.  What we do is to
+ * store the index of the lock hash structure in unused bits in the lock
+ * itself.  Then on unlock we can find the statistics record without doing
+ * any additional hash or lock stack lookup.  This works for spin_locks.
+ * Hold time reporting is now basically as cheap as wait time reporting
+ * so we ignore the difference between LSTAT_ON_HOLD and LSTAT_ON_WAIT
+ * as in version 1.1.* of lockmeter.
+ *
+ * For rw_locks, we store the index of a global reader stats structure in
+ * the lock and the writer index is stored in the latter structure.
+ * For read mode locks we hash at the time of the lock to find an entry
+ * in the directory for reader wait time and the like.
+ * At unlock time for read mode locks, we update just the global structure
+ * so we don't need to know the reader directory index value at unlock time.
+ *
+ */
+
+/*
+ * Protocol to change lstat_control.state
+ *   This is complicated because we don't want the cum_hold_time for
+ * a rw_lock to be decremented in _read_lock_ without making sure it
+ * is incremented in _read_lock_ and vice versa.  So here is the
+ * way we change the state of lstat_control.state:
+ * I.  To Turn Statistics On
+ *     After allocating storage, set lstat_control.state non-zero.
+ * This works because we don't start updating statistics for in use
+ * locks until the reader lock count goes to zero.
+ * II. To Turn Statistics Off:
+ * (0)  Disable interrupts on this CPU
+ * (1)  Seize the lstat_control.directory_lock
+ * (2)  Obtain the current value of lstat_control.next_free_read_lock_index
+ * (3)  Store a zero in lstat_control.state.
+ * (4)  Release the lstat_control.directory_lock
+ * (5)  For each lock in the read lock list up to the saved value
+ *      (well, -1) of the next_free_read_lock_index, do the following:
+ *      (a)  Check validity of the stored lock address
+ *           by making sure that the word at the saved addr
+ *           has an index that matches this entry.  If not
+ *           valid, then skip this entry.
+ *      (b)  If there is a write lock already set on this lock,
+ *           skip to (d) below.
+ *      (c)  Set a non-metered write lock on the lock
+ *      (d)  set the cached INDEX in the lock to zero
+ *      (e)  Release the non-metered write lock.
+ * (6)  Re-enable interrupts
+ *
+ * These rules ensure that a read lock will not have its statistics
+ * partially updated even though the global lock recording state has
+ * changed.  See put_lockmeter_info() for implementation.
+ *
+ * The reason for (b) is that there may be write locks set on the
+ * syscall path to put_lockmeter_info() from user space.  If we do
+ * not do this check, then we can deadlock.  A similar problem would
+ * occur if the lock was read locked by the current CPU.  At the
+ * moment this does not appear to happen.
+ */
+
+/*
+ * Main control structure for lockstat. Used to turn statistics on/off
+ * and to maintain directory info.
+ */
+typedef struct {
+	int				state;
+	spinlock_t		control_lock;		/* used to serialize turning statistics on/off   */
+	spinlock_t		directory_lock;		/* for serialize adding entries to directory     */
+	volatile int	next_free_dir_index;/* next free entry in the directory */
+	/* FIXME not all of these fields are used / needed .............. */
+                /* the following fields represent data since     */
+		/* first "lstat on" or most recent "lstat reset" */
+	TIME_T      first_started_time;     /* time when measurement first enabled */
+	TIME_T      started_time;           /* time when measurement last started  */
+	TIME_T      ending_time;            /* time when measurement last disabled */
+	uint64_t    started_cycles64;       /* cycles when measurement last started          */
+	uint64_t    ending_cycles64;        /* cycles when measurement last disabled         */
+	uint64_t    enabled_cycles64;       /* total cycles with measurement enabled         */
+	int         intervals;              /* number of measurement intervals recorded      */
+	                                    /* i. e. number of times did lstat on;lstat off  */
+	lstat_directory_entry_t	*dir;		/* directory */
+	int         dir_overflow;           /* count of times ran out of space in directory  */
+	int         rwlock_overflow;        /* count of times we couldn't allocate a rw block*/
+	ushort		*hashtab;		 	    /* hash table for quick dir scans */
+	lstat_cpu_counts_t	*counts[NR_CPUS];	 /* Array of pointers to per-cpu stats */
+    int         next_free_read_lock_index;   /* next rwlock reader (global) stats block  */
+    lstat_read_lock_cpu_counts_t *read_lock_counts[NR_CPUS]; /* per cpu read lock stats  */
+} lstat_control_t;
+
+#endif	/* defined(__KERNEL__) || defined(USER_MODE_TESTING) */
+
+typedef struct {
+	short		lstat_version;		/* version of the data */
+	short		state;			/* the current state is returned */
+	int		maxcpus;		/* Number of cpus present */
+	int		next_free_dir_index;	/* index of the next free directory entry */
+	TIME_T          first_started_time;	/* when measurement enabled for first time */
+	TIME_T          started_time;		/* time in secs since 1969 when stats last turned on  */
+	TIME_T		ending_time;		/* time in secs since 1969 when stats last turned off */
+	uint32_t	cycleval;		/* cycles per second */
+#ifdef notyet
+	void		*kernel_magic_addr;	/* address of kernel_magic */
+	void		*kernel_end_addr;	/* contents of kernel magic (points to "end") */
+#endif
+	int              next_free_read_lock_index; /* index of next (global) read lock stats struct */
+	uint64_t         started_cycles64;	/* cycles when measurement last started        */
+	uint64_t         ending_cycles64;	/* cycles when stats last turned off           */
+	uint64_t         enabled_cycles64;	/* total cycles with measurement enabled       */
+	int              intervals;		/* number of measurement intervals recorded      */
+						/* i.e. number of times we did lstat on;lstat off*/
+	int              dir_overflow;		/* number of times we wanted more space in directory */
+	int              rwlock_overflow;	/* # of times we wanted more space in read_locks_count */
+	struct new_utsname   uts;		/* info about machine where stats are measured */
+						/* -T option of lockstat allows data to be     */
+						/* moved to another machine. ................. */
+} lstat_user_request_t;
+
+#endif /* _LINUX_LOCKMETER_H */
--- diff/include/linux/netpoll.h	1970-01-01 01:00:00.000000000 +0100
+++ source/include/linux/netpoll.h	2004-02-09 10:39:57.000000000 +0000
@@ -0,0 +1,38 @@
+/*
+ * Common code for low-level network console, dump, and debugger code
+ *
+ * Derived from netconsole, kgdb-over-ethernet, and netdump patches
+ */
+
+#ifndef _LINUX_NETPOLL_H
+#define _LINUX_NETPOLL_H
+
+#include <linux/netdevice.h>
+#include <linux/interrupt.h>
+#include <linux/irq.h>
+#include <linux/list.h>
+
+struct netpoll;
+
+struct netpoll {
+	struct net_device *dev;
+	char dev_name[16], *name;
+	void (*rx_hook)(struct netpoll *, int, char *, int);
+	u32 local_ip, remote_ip;
+	u16 local_port, remote_port;
+	unsigned char local_mac[6], remote_mac[6];
+	struct list_head rx_list;
+};
+
+void netpoll_poll(struct netpoll *np);
+void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb);
+void netpoll_send_udp(struct netpoll *np, const char *msg, int len);
+int netpoll_parse_options(struct netpoll *np, char *opt);
+int netpoll_setup(struct netpoll *np);
+int netpoll_trap(void);
+void netpoll_set_trap(int trap);
+void netpoll_cleanup(struct netpoll *np);
+int netpoll_rx(struct sk_buff *skb);
+
+
+#endif
--- diff/kernel/compat_signal.c	1970-01-01 01:00:00.000000000 +0100
+++ source/kernel/compat_signal.c	2004-02-09 10:39:57.000000000 +0000
@@ -0,0 +1,124 @@
+/*
+ *  Copyright (C) 2003 Carlos O'Donell
+ *
+ *  2003-12-20  Carlos O'Donell
+ *              Copied linux/kernel/compat_signal.c (copy_siginfo_to_user)
+ *              and modified to use compat_siginfo_t for thunking down to
+ *              32-bit userspace from a 64-bit kernel.
+ *
+ * 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, GOOD TITLE or
+ * NON INFRINGEMENT.  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/compat_siginfo.h>
+#include <asm/errno.h>
+#include <asm/uaccess.h>
+#include <asm/siginfo.h>
+
+#ifndef HAVE_ARCH_COMPAT_COPY_SIGINFO_TO_USER
+
+int compat_copy_siginfo_to_user(compat_siginfo_t __user *to, siginfo_t *from)
+{
+	int err;
+	compat_siginfo_t compat_from;
+
+	if (!access_ok (VERIFY_WRITE, to, sizeof(compat_siginfo_t)))
+		return -EFAULT;
+
+	/*
+	 * If you change compat_siginfo_t structure *or* siginfo_t,
+	 * please be sure this code is fixed accordingly.
+	 * 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.
+	 */
+
+	/* Convert structure, don't leak anything in the copy */
+	memset(&compat_from,'\0',sizeof(compat_siginfo_t));
+	compat_from.si_signo = (compat_int_t)(from->si_signo);
+	compat_from.si_errno = (compat_int_t)(from->si_errno);
+	compat_from.si_code = (compat_int_t)(from->si_code);
+
+	if (from->si_code < 0)
+		return __copy_to_user(to, &compat_from, sizeof(compat_siginfo_t))
+			? -EFAULT : 0;
+
+	err = __put_user(compat_from.si_signo, &to->si_signo);
+	err |= __put_user(compat_from.si_errno, &to->si_errno);
+	err |= __put_user(compat_from.si_code, &to->si_code);
+
+	switch (from->si_code & __SI_MASK) {
+	case __SI_KILL:
+		compat_from.si_pid = (compat_pid_t)(from->si_pid);
+		compat_from.si_uid = (__ARCH_SI_COMPAT_UID_T)(from->si_uid);
+		err |= __put_user(compat_from.si_pid, &to->si_pid);
+		err |= __put_user(compat_from.si_uid, &to->si_uid);
+		break;
+	case __SI_TIMER:
+		compat_from.si_pid = (compat_timer_t)(from->si_tid);
+		compat_from.si_overrun = (compat_int_t)(from->si_overrun);
+		compat_from.si_ptr = (compat_uptr_t)((u64)(from->si_ptr) & 0xffffffffUL);
+		err |= __put_user(compat_from.si_tid, &to->si_tid);
+		err |= __put_user(compat_from.si_overrun, &to->si_overrun);
+		err |= __put_user(compat_from.si_ptr, &to->si_ptr);
+		break;
+	case __SI_POLL:
+		compat_from.si_band = (__ARCH_SI_COMPAT_BAND_T)(from->si_band);
+		compat_from.si_fd = (compat_int_t)(from->si_fd);
+		err |= __put_user(compat_from.si_band, &to->si_band);
+		err |= __put_user(compat_from.si_fd, &to->si_fd);
+		break;
+	case __SI_FAULT:
+		compat_from.si_addr = (compat_uptr_t)((u64)(from->si_addr) & 0xffffffffUL);
+		err |= __put_user(compat_from.si_addr, &to->si_addr);
+#ifdef __ARCH_SI_COMPAT_TRAPNO
+		compat_from.si_trapno = (compat_int_t)(from->si_addr);
+		err |= __put_user(compat_from.si_trapno, &to->si_trapno);
+#endif
+		break;
+	case __SI_CHLD:
+		compat_from.si_pid = (compat_pid_t)(from->si_pid);
+		compat_from.si_uid = (__ARCH_SI_COMPAT_UID_T)(from->si_uid);
+		compat_from.si_status = (compat_int_t)(from->si_status);
+		compat_from.si_utime = (compat_clock_t)(from->si_utime);
+		compat_from.si_stime = (compat_clock_t)(from->si_stime);
+		err |= __put_user(compat_from.si_pid, &to->si_pid);
+		err |= __put_user(compat_from.si_uid, &to->si_uid);
+		err |= __put_user(compat_from.si_status, &to->si_status);
+		err |= __put_user(compat_from.si_utime, &to->si_utime);
+		err |= __put_user(compat_from.si_stime, &to->si_stime);
+		break;
+	case __SI_RT: /* This is not generated by the kernel as of now. */
+		compat_from.si_pid = (compat_pid_t)(from->si_pid);
+		compat_from.si_uid = (__ARCH_SI_COMPAT_UID_T)(from->si_uid);
+		compat_from.si_int = (compat_int_t)(from->si_int);
+		compat_from.si_ptr = (compat_uptr_t)((u64)(from->si_ptr) & 0xffffffffUL);
+		err |= __put_user(compat_from.si_pid, &to->si_pid);
+		err |= __put_user(compat_from.si_uid, &to->si_uid);
+		err |= __put_user(compat_from.si_int, &to->si_int);
+		err |= __put_user(compat_from.si_ptr, &to->si_ptr);
+		break;
+	default: /* this is just in case for now ... */
+		compat_from.si_pid = (compat_pid_t)(from->si_pid);
+		compat_from.si_uid = (__ARCH_SI_COMPAT_UID_T)(from->si_uid);
+		err |= __put_user(compat_from.si_pid, &to->si_pid);
+		err |= __put_user(compat_from.si_uid, &to->si_uid);
+		break;
+	}
+	return err;
+}
+
+#endif
--- diff/kernel/kthread.c	1970-01-01 01:00:00.000000000 +0100
+++ source/kernel/kthread.c	2004-02-09 10:39:57.000000000 +0000
@@ -0,0 +1,193 @@
+/* Kernel thread helper functions.
+ *   Copyright (C) 2004 IBM Corporation, Rusty Russell.
+ *
+ * Everything is done via keventd, so that we get a clean environment
+ * even if we're invoked from userspace (think modprobe, hotplug cpu,
+ * etc.).  Also, it allows us to wait for dying kthreads without side
+ * effects involved in adopting kthreads to random processes.
+ */
+#define __KERNEL_SYSCALLS__
+#include <linux/sched.h>
+#include <linux/kthread.h>
+#include <linux/completion.h>
+#include <linux/err.h>
+#include <linux/unistd.h>
+#include <linux/cpu.h>
+#include <asm/semaphore.h>
+
+struct kthread_create_info
+{
+	/* Information passed to kthread() from keventd. */
+	int (*threadfn)(void *data);
+	void *data;
+	struct completion started;
+
+	/* Result passed back to kthread_create() from keventd. */
+	struct task_struct *result;
+	struct completion done;
+};
+
+/* Returns so that WEXITSTATUS(ret) == errno. */
+static int kthread(void *_create)
+{
+	struct kthread_create_info *create = _create;
+	int (*threadfn)(void *data);
+	void *data;
+	sigset_t blocked;
+	int ret = -EINTR;
+	static cpumask_t all_cpus = CPU_MASK_ALL;
+
+	/* Copy data: it's on keventd's stack */
+	threadfn = create->threadfn;
+	data = create->data;
+
+	/* Block and flush all signals. */
+	sigfillset(&blocked);
+	sigprocmask(SIG_BLOCK, &blocked, NULL);
+	flush_signals(current);
+
+	/* By default we can run anywhere, unlike keventd. */
+	set_cpus_allowed(current, all_cpus);
+
+	/* As a kernel thread which was bound to a specific cpu,
+	   migrate_all_tasks wouldn't touch us.  Avoid running on
+	   dying CPU. */
+	if (cpu_is_offline(smp_processor_id()))
+		migrate_to_cpu(any_online_cpu(all_cpus));
+
+	/* OK, tell user we're spawned, wait for stop or wakeup */
+	__set_current_state(TASK_INTERRUPTIBLE);
+	complete(&create->started);
+	schedule();
+
+	while (!signal_pending(current))
+		ret = threadfn(data);
+
+	return (-ret) << 8;
+}
+
+/* We are keventd: create a thread. */
+static void keventd_create_kthread(void *_create)
+{
+	struct kthread_create_info *create = _create;
+	int pid;
+
+	/* We want our own signal handler (we take no signals by default). */
+	pid = kernel_thread(kthread, create, CLONE_FS | CLONE_FILES | SIGCHLD);
+	if (pid < 0) {
+		create->result = ERR_PTR(pid);
+	} else {
+		wait_for_completion(&create->started);
+		create->result = find_task_by_pid(pid);
+		wait_task_inactive(create->result);
+	}
+	complete(&create->done);
+}
+
+struct kthread_stop_info
+{
+	struct task_struct *k;
+	int result;
+	struct completion done;
+};
+
+/* "to look upon me as her own dad -- in a very real, and legally
+   binding sense." - Michael Palin */
+static void adopt_kthread(struct task_struct *k)
+{
+	write_lock_irq(&tasklist_lock);
+	REMOVE_LINKS(k);
+	k->parent = current;
+	k->real_parent = current;
+	SET_LINKS(k);
+	write_unlock_irq(&tasklist_lock);
+}
+
+/* We are keventd: stop the thread. */
+static void keventd_stop_kthread(void *_stop)
+{
+	struct kthread_stop_info *stop = _stop;
+	int status, pid;
+	sigset_t blocked;
+	struct k_sigaction sa;
+
+	/* Install a handler so SIGCHLD is actually delivered */
+	sa.sa.sa_handler = SIG_DFL;
+	sa.sa.sa_flags = 0;
+	siginitset(&sa.sa.sa_mask, sigmask(SIGCHLD));
+	do_sigaction(SIGCHLD, &sa, (struct k_sigaction *)0);
+	allow_signal(SIGCHLD);
+
+	adopt_kthread(stop->k);
+	/* Grab pid now: after waitpid(), stop->k is invalid. */
+	pid = stop->k->tgid;
+
+	/* All signals are blocked, hence the force. */
+	force_sig(SIGTERM, stop->k);
+	/* Other threads might exit: if we ask for one pid that
+	 * returns -ERESTARTSYS. */
+	while (waitpid(-1, &status, __WALL) != pid)
+		flush_signals(current);
+	stop->result = -((status >> 8) & 0xFF);
+	complete(&stop->done);
+
+	/* Back to normal: block and flush all signals */
+	sigfillset(&blocked);
+	sigprocmask(SIG_BLOCK, &blocked, NULL);
+	flush_signals(current);
+	sa.sa.sa_handler = SIG_IGN;
+	do_sigaction(SIGCHLD, &sa, (struct k_sigaction *)0);
+	while (waitpid(-1, &status, __WALL|WNOHANG) > 0);
+}
+
+struct task_struct *kthread_create(int (*threadfn)(void *data),
+				   void *data,
+				   const char namefmt[],
+				   ...)
+{
+	struct kthread_create_info create;
+	DECLARE_WORK(work, keventd_create_kthread, &create);
+
+	create.threadfn = threadfn;
+	create.data = data;
+	init_completion(&create.started);
+	init_completion(&create.done);
+
+	/* If we're being called to start the first workqueue, we
+	 * can't use keventd. */
+	if (!keventd_up())
+		work.func(work.data);
+	else {
+		schedule_work(&work);
+		wait_for_completion(&create.done);
+	}
+	if (!IS_ERR(create.result)) {
+		va_list args;
+		va_start(args, namefmt);
+		vsnprintf(create.result->comm, sizeof(create.result->comm),
+			  namefmt, args);
+		va_end(args);
+	}
+
+	return create.result;
+}
+
+void kthread_bind(struct task_struct *k, unsigned int cpu)
+{
+	BUG_ON(k->state != TASK_INTERRUPTIBLE);
+	k->thread_info->cpu = cpu;
+	k->cpus_allowed = cpumask_of_cpu(cpu);
+}
+
+int kthread_stop(struct task_struct *k)
+{
+	struct kthread_stop_info stop;
+	DECLARE_WORK(work, keventd_stop_kthread, &stop);
+
+	stop.k = k;
+	init_completion(&stop.done);
+
+	schedule_work(&work);
+	wait_for_completion(&stop.done);
+	return stop.result;
+}
--- diff/kernel/lockmeter.c	1970-01-01 01:00:00.000000000 +0100
+++ source/kernel/lockmeter.c	2004-02-09 10:39:57.000000000 +0000
@@ -0,0 +1,1178 @@
+/*
+ *  Copyright (C) 1999,2000 Silicon Graphics, Inc.
+ *
+ *  Written by John Hawkes (hawkes@sgi.com)
+ *  Based on klstat.c by Jack Steiner (steiner@sgi.com)
+ *
+ *  Modified by Ray Bryant (raybry@us.ibm.com)
+ *  Changes Copyright (C) 2000 IBM, Inc.
+ *  Added save of index in spinlock_t to improve efficiency
+ *  of "hold" time reporting for spinlocks
+ *  Added support for hold time statistics for read and write
+ *  locks.
+ */
+
+#include <linux/config.h>
+#include <linux/types.h>
+#include <linux/errno.h>
+#include <linux/slab.h>
+#include <linux/sched.h>
+#include <linux/smp.h>
+#include <linux/threads.h>
+#include <linux/version.h>
+#include <linux/vmalloc.h>
+#include <linux/spinlock.h>
+#include <linux/utsname.h>
+#include <linux/module.h>
+#include <asm/system.h>
+#include <asm/uaccess.h>
+
+#include <linux/lockmeter.h>
+
+#define ASSERT(cond)
+#define bzero(loc,size)		memset(loc,0,size)
+
+/*<---------------------------------------------------*/
+/*              lockmeter.c                           */
+/*>---------------------------------------------------*/
+
+static lstat_control_t lstat_control __cacheline_aligned =
+	{ LSTAT_OFF, SPIN_LOCK_UNLOCKED, SPIN_LOCK_UNLOCKED,
+	  19 * 0, NR_CPUS * 0, 0, NR_CPUS * 0 };
+
+static ushort lstat_make_dir_entry(void *, void *);
+
+/*
+ * lstat_lookup
+ *
+ * Given a RA, locate the directory entry for the lock.
+ */
+static ushort
+lstat_lookup(void *lock_ptr, void *caller_ra)
+{
+	ushort index;
+	lstat_directory_entry_t *dirp;
+
+	dirp = lstat_control.dir;
+
+	index = lstat_control.hashtab[DIRHASH(caller_ra)];
+	while (dirp[index].caller_ra != caller_ra) {
+		if (index == 0) {
+			return lstat_make_dir_entry(lock_ptr, caller_ra);
+		}
+		index = dirp[index].next_stat_index;
+	}
+
+	if (dirp[index].lock_ptr != NULL && dirp[index].lock_ptr != lock_ptr) {
+		dirp[index].lock_ptr = NULL;
+	}
+
+	return index;
+}
+
+/*
+ * lstat_make_dir_entry
+ * Called to add a new lock to the lock directory.
+ */
+static ushort
+lstat_make_dir_entry(void *lock_ptr, void *caller_ra)
+{
+	lstat_directory_entry_t *dirp;
+	ushort index, hindex;
+	unsigned long flags;
+
+	/* lock the table without recursively reentering this metering code */
+	local_irq_save(flags);
+	_raw_spin_lock(&lstat_control.directory_lock);
+
+	hindex = DIRHASH(caller_ra);
+	index = lstat_control.hashtab[hindex];
+	dirp = lstat_control.dir;
+	while (index && dirp[index].caller_ra != caller_ra)
+		index = dirp[index].next_stat_index;
+
+	if (index == 0) {
+		if (lstat_control.next_free_dir_index < LSTAT_MAX_STAT_INDEX) {
+			index = lstat_control.next_free_dir_index++;
+			lstat_control.dir[index].caller_ra = caller_ra;
+			lstat_control.dir[index].lock_ptr = lock_ptr;
+			lstat_control.dir[index].next_stat_index =
+				lstat_control.hashtab[hindex];
+			lstat_control.hashtab[hindex] = index;
+		} else {
+			lstat_control.dir_overflow++;
+		}
+	}
+	_raw_spin_unlock(&lstat_control.directory_lock);
+	local_irq_restore(flags);
+	return index;
+}
+
+int
+lstat_update(void *lock_ptr, void *caller_ra, int action)
+{
+	int index;
+	int cpu;
+
+	ASSERT(action < LSTAT_ACT_MAX_VALUES);
+
+	if (lstat_control.state == LSTAT_OFF)
+		return 0;
+
+	index = lstat_lookup(lock_ptr, caller_ra);
+	cpu = THIS_CPU_NUMBER;
+	(*lstat_control.counts[cpu])[index].count[action]++;
+	(*lstat_control.counts[cpu])[index].acquire_time = get_cycles();
+
+	return index;
+}
+
+int
+lstat_update_time(void *lock_ptr, void *caller_ra, int action, uint32_t ticks)
+{
+	ushort index;
+	int cpu;
+
+	ASSERT(action < LSTAT_ACT_MAX_VALUES);
+
+	if (lstat_control.state == LSTAT_OFF)
+		return 0;
+
+	index = lstat_lookup(lock_ptr, caller_ra);
+	cpu = THIS_CPU_NUMBER;
+	(*lstat_control.counts[cpu])[index].count[action]++;
+	(*lstat_control.counts[cpu])[index].cum_wait_ticks += (uint64_t) ticks;
+	if ((*lstat_control.counts[cpu])[index].max_wait_ticks < ticks)
+		(*lstat_control.counts[cpu])[index].max_wait_ticks = ticks;
+
+	(*lstat_control.counts[cpu])[index].acquire_time = get_cycles();
+
+	return index;
+}
+
+void
+_metered_spin_lock(spinlock_t * lock_ptr)
+{
+	if (lstat_control.state == LSTAT_OFF) {
+		_raw_spin_lock(lock_ptr);	/* do the real lock */
+		PUT_INDEX(lock_ptr, 0);	/* clean index in case lockmetering  */
+		/* gets turned on before unlock */
+	} else {
+		void *this_pc = LSTAT_RA(LSTAT_RA_SPIN);
+		int index;
+
+		if (_raw_spin_trylock(lock_ptr)) {
+			index = lstat_update(lock_ptr, this_pc,
+						LSTAT_ACT_NO_WAIT);
+		} else {
+			uint32_t start_cycles = get_cycles();
+			_raw_spin_lock(lock_ptr);	/* do the real lock */
+			index = lstat_update_time(lock_ptr, this_pc,
+				LSTAT_ACT_SPIN, get_cycles() - start_cycles);
+		}
+		/* save the index in the lock itself for use in spin unlock */
+		PUT_INDEX(lock_ptr, index);
+	}
+}
+
+int
+_metered_spin_trylock(spinlock_t * lock_ptr)
+{
+	if (lstat_control.state == LSTAT_OFF) {
+		return _raw_spin_trylock(lock_ptr);
+	} else {
+		int retval;
+		void *this_pc = LSTAT_RA(LSTAT_RA_SPIN);
+
+		if ((retval = _raw_spin_trylock(lock_ptr))) {
+			int index = lstat_update(lock_ptr, this_pc,
+						LSTAT_ACT_NO_WAIT);
+			/*
+			 * save the index in the lock itself for use in spin
+			 * unlock
+			 */
+			PUT_INDEX(lock_ptr, index);
+		} else {
+			lstat_update(lock_ptr, this_pc, LSTAT_ACT_REJECT);
+		}
+
+		return retval;
+	}
+}
+
+void
+_metered_spin_unlock(spinlock_t * lock_ptr)
+{
+	int index = -1;
+
+	if (lstat_control.state != LSTAT_OFF) {
+		index = GET_INDEX(lock_ptr);
+		/*
+		 * If statistics were turned off when we set the lock,
+		 * then the index can be zero.  If that is the case,
+		 * then collect no stats on this call.
+		 */
+		if (index > 0) {
+			uint32_t hold_time;
+			int cpu = THIS_CPU_NUMBER;
+			hold_time = get_cycles() -
+			 (*lstat_control.counts[cpu])[index].acquire_time;
+			(*lstat_control.counts[cpu])[index].cum_hold_ticks +=
+				(uint64_t) hold_time;
+			if ((*lstat_control.counts[cpu])[index].max_hold_ticks <
+			    hold_time)
+				(*lstat_control.counts[cpu])[index].
+				    max_hold_ticks = hold_time;
+		}
+	}
+
+	/* make sure we don't have a stale index value saved */
+	PUT_INDEX(lock_ptr, 0);
+	_raw_spin_unlock(lock_ptr);	/* do the real unlock */
+}
+
+/*
+ * allocate the next global read lock structure and store its index
+ * in the rwlock at "lock_ptr".
+ */
+uint32_t
+alloc_rwlock_struct(rwlock_t * rwlock_ptr)
+{
+	int index;
+	unsigned long flags;
+	int cpu = THIS_CPU_NUMBER;
+
+	/* If we've already overflowed, then do a quick exit */
+	if (lstat_control.next_free_read_lock_index >
+			LSTAT_MAX_READ_LOCK_INDEX) {
+		lstat_control.rwlock_overflow++;
+		return 0;
+	}
+
+	local_irq_save(flags);
+	_raw_spin_lock(&lstat_control.directory_lock);
+
+	/* It is possible this changed while we were waiting for the directory_lock */
+	if (lstat_control.state == LSTAT_OFF) {
+		index = 0;
+		goto unlock;
+	}
+
+	/* It is possible someone else got here first and set the index */
+	if ((index = GET_RWINDEX(rwlock_ptr)) == 0) {
+		/*
+		 * we can't turn on read stats for this lock while there are
+		 * readers (this would mess up the running hold time sum at
+		 * unlock time)
+		 */
+		if (RWLOCK_READERS(rwlock_ptr) != 0) {
+			index = 0;
+			goto unlock;
+		}
+
+		/*
+		 * if stats are turned on after being off, we may need to
+		 * return an old index from when the statistics were on last
+		 * time.
+		 */
+		for (index = 1; index < lstat_control.next_free_read_lock_index;
+				index++)
+			if ((*lstat_control.read_lock_counts[cpu])[index].
+					lock_ptr == rwlock_ptr)
+				goto put_index_and_unlock;
+
+		/* allocate the next global read lock structure */
+		if (lstat_control.next_free_read_lock_index >=
+		    LSTAT_MAX_READ_LOCK_INDEX) {
+			lstat_control.rwlock_overflow++;
+			index = 0;
+			goto unlock;
+		}
+		index = lstat_control.next_free_read_lock_index++;
+
+		/*
+		 * initialize the global read stats data structure for each
+		 * cpu
+		 */
+		for (cpu = 0; cpu < num_online_cpus(); cpu++) {
+			(*lstat_control.read_lock_counts[cpu])[index].lock_ptr =
+				rwlock_ptr;
+		}
+put_index_and_unlock:
+		/* store the index for the read lock structure into the lock */
+		PUT_RWINDEX(rwlock_ptr, index);
+	}
+
+unlock:
+	_raw_spin_unlock(&lstat_control.directory_lock);
+	local_irq_restore(flags);
+	return index;
+}
+
+void
+_metered_read_lock(rwlock_t * rwlock_ptr)
+{
+	void *this_pc;
+	uint32_t start_cycles;
+	int index;
+	int cpu;
+	unsigned long flags;
+	int readers_before, readers_after;
+	uint64_t cycles64;
+
+	if (lstat_control.state == LSTAT_OFF) {
+		_raw_read_lock(rwlock_ptr);
+		/* clean index in case lockmetering turns on before an unlock */
+		PUT_RWINDEX(rwlock_ptr, 0);
+		return;
+	}
+
+	this_pc = LSTAT_RA(LSTAT_RA_READ);
+	cpu = THIS_CPU_NUMBER;
+	index = GET_RWINDEX(rwlock_ptr);
+
+	/* allocate the global stats entry for this lock, if needed */
+	if (index == 0)
+		index = alloc_rwlock_struct(rwlock_ptr);
+
+	readers_before = RWLOCK_READERS(rwlock_ptr);
+	if (_raw_read_trylock(rwlock_ptr)) {
+		/*
+		 * We have decremented the lock to count a new reader,
+		 * and have confirmed that no writer has it locked.
+		 */
+		/* update statistics if enabled */
+		if (index > 0) {
+			local_irq_save(flags);
+			lstat_update((void *) rwlock_ptr, this_pc,
+					LSTAT_ACT_NO_WAIT);
+			/* preserve value of TSC so cum_hold_ticks and start_busy use same value */
+			cycles64 = get_cycles64();
+			(*lstat_control.read_lock_counts[cpu])[index].
+				cum_hold_ticks -= cycles64;
+
+			/* record time and cpu of start of busy period */
+			/* this is not perfect (some race conditions are possible) */
+			if (readers_before == 0) {
+				(*lstat_control.read_lock_counts[cpu])[index].
+					start_busy = cycles64;
+				PUT_RW_CPU(rwlock_ptr, cpu);
+			}
+			readers_after = RWLOCK_READERS(rwlock_ptr);
+			if (readers_after >
+				(*lstat_control.read_lock_counts[cpu])[index].
+					max_readers)
+				(*lstat_control.read_lock_counts[cpu])[index].
+					max_readers = readers_after;
+			local_irq_restore(flags);
+		}
+
+		return;
+	}
+	/* If we get here, then we could not quickly grab the read lock */
+
+	start_cycles = get_cycles();	/* start counting the wait time */
+
+	/* Now spin until read_lock is successful */
+	_raw_read_lock(rwlock_ptr);
+
+	lstat_update_time((void *) rwlock_ptr, this_pc, LSTAT_ACT_SPIN,
+			  get_cycles() - start_cycles);
+
+	/* update statistics if they are enabled for this lock */
+	if (index > 0) {
+		local_irq_save(flags);
+		cycles64 = get_cycles64();
+		(*lstat_control.read_lock_counts[cpu])[index].cum_hold_ticks -=
+				cycles64;
+
+		/* this is not perfect (some race conditions are possible) */
+		if (readers_before == 0) {
+			(*lstat_control.read_lock_counts[cpu])[index].
+				start_busy = cycles64;
+			PUT_RW_CPU(rwlock_ptr, cpu);
+		}
+		readers_after = RWLOCK_READERS(rwlock_ptr);
+		if (readers_after >
+		    (*lstat_control.read_lock_counts[cpu])[index].max_readers)
+			(*lstat_control.read_lock_counts[cpu])[index].
+				max_readers = readers_after;
+		local_irq_restore(flags);
+	}
+}
+
+void
+_metered_read_unlock(rwlock_t * rwlock_ptr)
+{
+	int index;
+	int cpu;
+	unsigned long flags;
+	uint64_t busy_length;
+	uint64_t cycles64;
+
+	if (lstat_control.state == LSTAT_OFF) {
+		_raw_read_unlock(rwlock_ptr);
+		return;
+	}
+
+	index = GET_RWINDEX(rwlock_ptr);
+	cpu = THIS_CPU_NUMBER;
+
+	if (index > 0) {
+		local_irq_save(flags);
+		/*
+		 * preserve value of TSC so cum_hold_ticks and busy_ticks are
+		 * consistent.
+		 */
+		cycles64 = get_cycles64();
+		(*lstat_control.read_lock_counts[cpu])[index].cum_hold_ticks +=
+			cycles64;
+		(*lstat_control.read_lock_counts[cpu])[index].read_lock_count++;
+
+		/*
+		 * once again, this is not perfect (some race conditions are
+		 * possible)
+		 */
+		if (RWLOCK_READERS(rwlock_ptr) == 1) {
+			int cpu1 = GET_RW_CPU(rwlock_ptr);
+			uint64_t last_start_busy =
+				(*lstat_control.read_lock_counts[cpu1])[index].
+					start_busy;
+			(*lstat_control.read_lock_counts[cpu])[index].
+				busy_periods++;
+			if (cycles64 > last_start_busy) {
+				busy_length = cycles64 - last_start_busy;
+				(*lstat_control.read_lock_counts[cpu])[index].
+					busy_ticks += busy_length;
+				if (busy_length >
+					(*lstat_control.
+						read_lock_counts[cpu])[index].
+							max_busy)
+					(*lstat_control.
+					 read_lock_counts[cpu])[index].
+						max_busy = busy_length;
+			}
+		}
+		local_irq_restore(flags);
+	}
+	_raw_read_unlock(rwlock_ptr);
+}
+
+void
+_metered_write_lock(rwlock_t * rwlock_ptr)
+{
+	uint32_t start_cycles;
+	void *this_pc;
+	uint32_t spin_ticks = 0; /* in anticipation of a potential wait */
+	int index;
+	int write_index = 0;
+	int cpu;
+	enum {
+		writer_writer_conflict,
+		writer_reader_conflict
+	} why_wait = writer_writer_conflict;
+
+	if (lstat_control.state == LSTAT_OFF) {
+		_raw_write_lock(rwlock_ptr);
+		/* clean index in case lockmetering turns on before an unlock */
+		PUT_RWINDEX(rwlock_ptr, 0);
+		return;
+	}
+
+	this_pc = LSTAT_RA(LSTAT_RA_WRITE);
+	cpu = THIS_CPU_NUMBER;
+	index = GET_RWINDEX(rwlock_ptr);
+
+	/* allocate the global stats entry for this lock, if needed */
+	if (index == 0) {
+		index = alloc_rwlock_struct(rwlock_ptr);
+	}
+
+	if (_raw_write_trylock(rwlock_ptr)) {
+		/* We acquired the lock on the first try */
+		write_index = lstat_update((void *) rwlock_ptr, this_pc,
+					LSTAT_ACT_NO_WAIT);
+		/* save the write_index for use in unlock if stats enabled */
+		if (index > 0)
+			(*lstat_control.read_lock_counts[cpu])[index].
+				write_index = write_index;
+		return;
+	}
+
+	/* If we get here, then we could not quickly grab the write lock */
+	start_cycles = get_cycles();	/* start counting the wait time */
+
+	why_wait = RWLOCK_READERS(rwlock_ptr) ?
+			writer_reader_conflict : writer_writer_conflict;
+
+	/* Now set the lock and wait for conflicts to disappear */
+	_raw_write_lock(rwlock_ptr);
+
+	spin_ticks = get_cycles() - start_cycles;
+
+	/* update stats -- if enabled */
+	if (index > 0 && spin_ticks) {
+		if (why_wait == writer_reader_conflict) {
+			/* waited due to a reader holding the lock */
+			write_index = lstat_update_time((void *)rwlock_ptr,
+					this_pc, LSTAT_ACT_SPIN, spin_ticks);
+		} else {
+			/*
+			 * waited due to another writer holding the lock
+			 */
+			write_index = lstat_update_time((void *)rwlock_ptr,
+				this_pc, LSTAT_ACT_WW_SPIN, spin_ticks);
+			(*lstat_control.counts[cpu])[write_index].
+				cum_wait_ww_ticks += spin_ticks;
+			if (spin_ticks >
+				(*lstat_control.counts[cpu])[write_index].
+					max_wait_ww_ticks) {
+				(*lstat_control.counts[cpu])[write_index].
+					max_wait_ww_ticks = spin_ticks;
+			}
+		}
+
+		/* save the directory index for use on write_unlock */
+		(*lstat_control.read_lock_counts[cpu])[index].
+			write_index = write_index;
+	}
+}
+
+void
+_metered_write_unlock(rwlock_t * rwlock_ptr)
+{
+	int index;
+	int cpu;
+	int write_index;
+	uint32_t hold_time;
+
+	if (lstat_control.state == LSTAT_OFF) {
+		_raw_write_unlock(rwlock_ptr);
+		return;
+	}
+
+	cpu = THIS_CPU_NUMBER;
+	index = GET_RWINDEX(rwlock_ptr);
+
+	/* update statistics if stats enabled for this lock */
+	if (index > 0) {
+		write_index =
+		    (*lstat_control.read_lock_counts[cpu])[index].write_index;
+
+		hold_time = get_cycles() -
+			(*lstat_control.counts[cpu])[write_index].acquire_time;
+		(*lstat_control.counts[cpu])[write_index].cum_hold_ticks +=
+			(uint64_t) hold_time;
+		if ((*lstat_control.counts[cpu])[write_index].max_hold_ticks <
+				hold_time)
+			(*lstat_control.counts[cpu])[write_index].
+				max_hold_ticks = hold_time;
+	}
+	_raw_write_unlock(rwlock_ptr);
+}
+
+int
+_metered_write_trylock(rwlock_t * rwlock_ptr)
+{
+	int retval;
+	void *this_pc = LSTAT_RA(LSTAT_RA_WRITE);
+
+	if ((retval = _raw_write_trylock(rwlock_ptr))) {
+		lstat_update(rwlock_ptr, this_pc, LSTAT_ACT_NO_WAIT);
+	} else {
+		lstat_update(rwlock_ptr, this_pc, LSTAT_ACT_REJECT);
+	}
+
+	return retval;
+}
+
+static void
+init_control_space(void)
+{
+	/* Set all control space pointers to null and indices to "empty" */
+	int cpu;
+
+	/*
+	 * Access CPU_CYCLE_FREQUENCY at the outset, which in some
+	 * architectures may trigger a runtime calculation that uses a
+	 * spinlock.  Let's do this before lockmetering is turned on.
+	 */
+	if (CPU_CYCLE_FREQUENCY == 0)
+		BUG();
+
+	lstat_control.hashtab = NULL;
+	lstat_control.dir = NULL;
+	for (cpu = 0; cpu < NR_CPUS; cpu++) {
+		lstat_control.counts[cpu] = NULL;
+		lstat_control.read_lock_counts[cpu] = NULL;
+	}
+}
+
+static int
+reset_lstat_data(void)
+{
+	int cpu, flags;
+
+	flags = 0;
+	lstat_control.next_free_dir_index = 1;	/* 0 is for overflows */
+	lstat_control.next_free_read_lock_index = 1;
+	lstat_control.dir_overflow = 0;
+	lstat_control.rwlock_overflow = 0;
+
+	lstat_control.started_cycles64 = 0;
+	lstat_control.ending_cycles64 = 0;
+	lstat_control.enabled_cycles64 = 0;
+	lstat_control.first_started_time = 0;
+	lstat_control.started_time = 0;
+	lstat_control.ending_time = 0;
+	lstat_control.intervals = 0;
+
+	/*
+	 * paranoia -- in case someone does a "lockstat reset" before
+	 * "lockstat on"
+	 */
+	if (lstat_control.hashtab) {
+		bzero(lstat_control.hashtab,
+			LSTAT_HASH_TABLE_SIZE * sizeof (short));
+		bzero(lstat_control.dir, LSTAT_MAX_STAT_INDEX *
+				sizeof (lstat_directory_entry_t));
+
+		for (cpu = 0; cpu < num_online_cpus(); cpu++) {
+			bzero(lstat_control.counts[cpu],
+				sizeof (lstat_cpu_counts_t));
+			bzero(lstat_control.read_lock_counts[cpu],
+				sizeof (lstat_read_lock_cpu_counts_t));
+		}
+	}
+#ifdef NOTDEF
+	_raw_spin_unlock(&lstat_control.directory_lock);
+	local_irq_restore(flags);
+#endif
+	return 1;
+}
+
+static void
+release_control_space(void)
+{
+	/*
+	 * Called when either (1) allocation of kmem
+	 * or (2) when user writes LSTAT_RELEASE to /pro/lockmeter.
+	 * Assume that all pointers have been initialized to zero,
+	 * i.e., nonzero pointers are valid addresses.
+	 */
+	int cpu;
+
+	if (lstat_control.hashtab) {
+		kfree(lstat_control.hashtab);
+		lstat_control.hashtab = NULL;
+	}
+
+	if (lstat_control.dir) {
+		vfree(lstat_control.dir);
+		lstat_control.dir = NULL;
+	}
+
+	for (cpu = 0; cpu < NR_CPUS; cpu++) {
+		if (lstat_control.counts[cpu]) {
+			vfree(lstat_control.counts[cpu]);
+			lstat_control.counts[cpu] = NULL;
+		}
+		if (lstat_control.read_lock_counts[cpu]) {
+			kfree(lstat_control.read_lock_counts[cpu]);
+			lstat_control.read_lock_counts[cpu] = NULL;
+		}
+	}
+}
+
+int
+get_lockmeter_info_size(void)
+{
+	return sizeof (lstat_user_request_t)
+		+ num_online_cpus() * sizeof (lstat_cpu_counts_t)
+		+ num_online_cpus() * sizeof (lstat_read_lock_cpu_counts_t)
+		+ (LSTAT_MAX_STAT_INDEX * sizeof (lstat_directory_entry_t));
+}
+
+ssize_t
+get_lockmeter_info(char *buffer, size_t max_len, loff_t * last_index)
+{
+	lstat_user_request_t req;
+	struct timeval tv;
+	ssize_t next_ret_bcount;
+	ssize_t actual_ret_bcount = 0;
+	int cpu;
+
+	*last_index = 0;	/* a one-shot read */
+
+	req.lstat_version = LSTAT_VERSION;
+	req.state = lstat_control.state;
+	req.maxcpus = num_online_cpus();
+	req.cycleval = CPU_CYCLE_FREQUENCY;
+#ifdef notyet
+	req.kernel_magic_addr = (void *) &_etext;
+	req.kernel_end_addr = (void *) &_etext;
+#endif
+	req.uts = system_utsname;
+	req.intervals = lstat_control.intervals;
+
+	req.first_started_time = lstat_control.first_started_time;
+	req.started_time = lstat_control.started_time;
+	req.started_cycles64 = lstat_control.started_cycles64;
+
+	req.next_free_dir_index = lstat_control.next_free_dir_index;
+	req.next_free_read_lock_index = lstat_control.next_free_read_lock_index;
+	req.dir_overflow = lstat_control.dir_overflow;
+	req.rwlock_overflow = lstat_control.rwlock_overflow;
+
+	if (lstat_control.state == LSTAT_OFF) {
+		if (req.intervals == 0) {
+			/* mesasurement is off and no valid data present */
+			next_ret_bcount = sizeof (lstat_user_request_t);
+			req.enabled_cycles64 = 0;
+
+			if ((actual_ret_bcount + next_ret_bcount) > max_len)
+				return actual_ret_bcount;
+
+			copy_to_user(buffer, (void *) &req, next_ret_bcount);
+			actual_ret_bcount += next_ret_bcount;
+			return actual_ret_bcount;
+		} else {
+			/*
+			 * measurement is off but valid data present
+			 * fetch time info from lstat_control
+			 */
+			req.ending_time = lstat_control.ending_time;
+			req.ending_cycles64 = lstat_control.ending_cycles64;
+			req.enabled_cycles64 = lstat_control.enabled_cycles64;
+		}
+	} else {
+		/*
+		 * this must be a read while data active--use current time,
+		 * etc
+		 */
+		do_gettimeofday(&tv);
+		req.ending_time = tv.tv_sec;
+		req.ending_cycles64 = get_cycles64();
+		req.enabled_cycles64 = req.ending_cycles64 -
+			req.started_cycles64 + lstat_control.enabled_cycles64;
+	}
+
+	next_ret_bcount = sizeof (lstat_user_request_t);
+	if ((actual_ret_bcount + next_ret_bcount) > max_len)
+		return actual_ret_bcount;
+
+	copy_to_user(buffer, (void *) &req, next_ret_bcount);
+	actual_ret_bcount += next_ret_bcount;
+
+	if (!lstat_control.counts[0])	/* not initialized? */
+		return actual_ret_bcount;
+
+	next_ret_bcount = sizeof (lstat_cpu_counts_t);
+	for (cpu = 0; cpu < num_online_cpus(); cpu++) {
+		if ((actual_ret_bcount + next_ret_bcount) > max_len)
+			return actual_ret_bcount;	/* leave early */
+		copy_to_user(buffer + actual_ret_bcount,
+				lstat_control.counts[cpu], next_ret_bcount);
+		actual_ret_bcount += next_ret_bcount;
+	}
+
+	next_ret_bcount = LSTAT_MAX_STAT_INDEX *
+			sizeof (lstat_directory_entry_t);
+	if (((actual_ret_bcount + next_ret_bcount) > max_len)
+			|| !lstat_control.dir)
+		return actual_ret_bcount;	/* leave early */
+
+	copy_to_user(buffer + actual_ret_bcount, lstat_control.dir,
+			next_ret_bcount);
+	actual_ret_bcount += next_ret_bcount;
+
+	next_ret_bcount = sizeof (lstat_read_lock_cpu_counts_t);
+	for (cpu = 0; cpu < num_online_cpus(); cpu++) {
+		if (actual_ret_bcount + next_ret_bcount > max_len)
+			return actual_ret_bcount;
+		copy_to_user(buffer + actual_ret_bcount,
+				lstat_control.read_lock_counts[cpu],
+				next_ret_bcount);
+		actual_ret_bcount += next_ret_bcount;
+	}
+
+	return actual_ret_bcount;
+}
+
+/*
+ *  Writing to the /proc lockmeter node enables or disables metering.
+ *  based upon the first byte of the "written" data.
+ *  The following values are defined:
+ *  LSTAT_ON: 1st call: allocates storage, intializes and turns on measurement
+ *            subsequent calls just turn on measurement
+ *  LSTAT_OFF: turns off measurement
+ *  LSTAT_RESET: resets statistics
+ *  LSTAT_RELEASE: releases statistics storage
+ *
+ *  This allows one to accumulate statistics over several lockstat runs:
+ *
+ *  lockstat on
+ *  lockstat off
+ *  ...repeat above as desired...
+ *  lockstat get
+ *  ...now start a new set of measurements...
+ *  lockstat reset
+ *  lockstat on
+ *  ...
+ *
+ */
+ssize_t
+put_lockmeter_info(const char *buffer, size_t len)
+{
+	int error = 0;
+	int dirsize, countsize, read_lock_countsize, hashsize;
+	int cpu;
+	char put_char;
+	int i, read_lock_blocks;
+	unsigned long flags;
+	rwlock_t *lock_ptr;
+	struct timeval tv;
+
+	if (len <= 0)
+		return -EINVAL;
+
+	_raw_spin_lock(&lstat_control.control_lock);
+
+	get_user(put_char, buffer);
+	switch (put_char) {
+
+	case LSTAT_OFF:
+		if (lstat_control.state != LSTAT_OFF) {
+			/*
+			 * To avoid seeing read lock hold times in an
+			 * inconsisent state, we have to follow this protocol
+			 * to turn off statistics
+			 */
+			local_irq_save(flags);
+			/*
+			 * getting this lock will stop any read lock block
+			 * allocations
+			 */
+			_raw_spin_lock(&lstat_control.directory_lock);
+			/*
+			 * keep any more read lock blocks from being
+			 * allocated
+			 */
+			lstat_control.state = LSTAT_OFF;
+			/* record how may read lock blocks there are */
+			read_lock_blocks =
+				lstat_control.next_free_read_lock_index;
+			_raw_spin_unlock(&lstat_control.directory_lock);
+			/* now go through the list of read locks */
+			cpu = THIS_CPU_NUMBER;
+			for (i = 1; i < read_lock_blocks; i++) {
+				lock_ptr =
+				    (*lstat_control.read_lock_counts[cpu])[i].
+				    lock_ptr;
+				/* is this saved lock address still valid? */
+				if (GET_RWINDEX(lock_ptr) == i) {
+					/*
+					 * lock address appears to still be
+					 * valid because we only hold one lock
+					 * at a time, this can't cause a
+					 * deadlock unless this is a lock held
+					 * as part of the current system call
+					 * path. At the moment there
+					 * are no READ mode locks held to get
+					 * here from user space, so we solve
+					 * this by skipping locks held in
+					 * write mode.
+					 */
+					if (RWLOCK_IS_WRITE_LOCKED(lock_ptr)) {
+						PUT_RWINDEX(lock_ptr, 0);
+						continue;
+					}
+					/*
+					 * now we know there are no read
+					 * holders of this lock! stop
+					 * statistics collection for this
+					 * lock
+					 */
+					_raw_write_lock(lock_ptr);
+					PUT_RWINDEX(lock_ptr, 0);
+					_raw_write_unlock(lock_ptr);
+				}
+				/*
+				 * it may still be possible for the hold time
+				 * sum to be negative e.g. if a lock is
+				 * reallocated while "busy" we will have to fix
+				 * this up in the data reduction program.
+				 */
+			}
+			local_irq_restore(flags);
+			lstat_control.intervals++;
+			lstat_control.ending_cycles64 = get_cycles64();
+			lstat_control.enabled_cycles64 +=
+				lstat_control.ending_cycles64 -
+				lstat_control.started_cycles64;
+			do_gettimeofday(&tv);
+			lstat_control.ending_time = tv.tv_sec;
+			/*
+			 * don't deallocate the structures -- we may do a
+			 * lockstat on to add to the data that is already
+			 * there. Use LSTAT_RELEASE to release storage
+			 */
+		} else {
+			error = -EBUSY;	/* already OFF */
+		}
+		break;
+
+	case LSTAT_ON:
+		if (lstat_control.state == LSTAT_OFF) {
+#ifdef DEBUG_LOCKMETER
+			printk("put_lockmeter_info(cpu=%d): LSTAT_ON\n",
+				THIS_CPU_NUMBER);
+#endif
+			lstat_control.next_free_dir_index = 1;	/* 0 is for overflows */
+
+			dirsize = LSTAT_MAX_STAT_INDEX *
+					sizeof (lstat_directory_entry_t);
+			hashsize =
+				(1 + LSTAT_HASH_TABLE_SIZE) * sizeof (ushort);
+			countsize = sizeof (lstat_cpu_counts_t);
+			read_lock_countsize =
+				sizeof (lstat_read_lock_cpu_counts_t);
+#ifdef DEBUG_LOCKMETER
+			printk(" dirsize:%d", dirsize);
+			printk(" hashsize:%d", hashsize);
+			printk(" countsize:%d", countsize);
+			printk(" read_lock_countsize:%d\n",
+				read_lock_countsize);
+#endif
+#ifdef DEBUG_LOCKMETER
+			{
+				int secs;
+				unsigned long cycles;
+				uint64_t cycles64;
+
+				do_gettimeofday(&tv);
+				secs = tv.tv_sec;
+				do {
+					do_gettimeofday(&tv);
+				} while (secs == tv.tv_sec);
+				cycles = get_cycles();
+				cycles64 = get_cycles64();
+				secs = tv.tv_sec;
+				do {
+					do_gettimeofday(&tv);
+				} while (secs == tv.tv_sec);
+				cycles = get_cycles() - cycles;
+				cycles64 = get_cycles64() - cycles;
+				printk("lockmeter: cycleFrequency:%d "
+					"cycles:%d cycles64:%d\n",
+					CPU_CYCLE_FREQUENCY, cycles, cycles64);
+			}
+#endif
+
+			/*
+			 * if this is the first call, allocate storage and
+			 * initialize
+			 */
+			if (!lstat_control.hashtab) {
+
+				spin_lock_init(&lstat_control.directory_lock);
+
+				/* guarantee all pointers at zero */
+				init_control_space();
+
+				lstat_control.hashtab =
+				    kmalloc(hashsize, GFP_KERNEL);
+				if (!lstat_control.hashtab) {
+					error = -ENOSPC;
+#ifdef DEBUG_LOCKMETER
+					printk("!!error kmalloc of hashtab\n");
+#endif
+				}
+				lstat_control.dir = vmalloc(dirsize);
+				if (!lstat_control.dir) {
+					error = -ENOSPC;
+#ifdef DEBUG_LOCKMETER
+					printk("!!error kmalloc of dir\n");
+#endif
+				}
+
+				for (cpu = 0; cpu < num_online_cpus(); cpu++) {
+					lstat_control.counts[cpu] =
+						vmalloc(countsize);
+					if (!lstat_control.counts[cpu]) {
+						error = -ENOSPC;
+#ifdef DEBUG_LOCKMETER
+						printk("!!error vmalloc of "
+							"counts[%d]\n", cpu);
+#endif
+					}
+					lstat_control.read_lock_counts[cpu] =
+						(lstat_read_lock_cpu_counts_t *)
+						kmalloc(read_lock_countsize,
+							GFP_KERNEL);
+					if (!lstat_control.
+							read_lock_counts[cpu]) {
+						error = -ENOSPC;
+#ifdef DEBUG_LOCKMETER
+						printk("!!error kmalloc of "
+						  "read_lock_counts[%d]\n",
+							cpu);
+#endif
+					}
+				}
+			}
+
+			if (error) {
+				/*
+				 * One or more kmalloc failures -- free
+				 * everything
+				 */
+				release_control_space();
+			} else {
+
+				if (!reset_lstat_data()) {
+					error = -EINVAL;
+					break;
+				};
+
+				/*
+				 * record starting and ending times and the
+				 * like
+				 */
+				if (lstat_control.intervals == 0) {
+					do_gettimeofday(&tv);
+					lstat_control.first_started_time =
+						tv.tv_sec;
+				}
+				lstat_control.started_cycles64 = get_cycles64();
+				do_gettimeofday(&tv);
+				lstat_control.started_time = tv.tv_sec;
+
+				lstat_control.state = LSTAT_ON;
+			}
+		} else {
+			error = -EBUSY;	/* already ON */
+		}
+		break;
+
+	case LSTAT_RESET:
+		if (lstat_control.state == LSTAT_OFF) {
+			if (!reset_lstat_data())
+				error = -EINVAL;
+		} else {
+			error = -EBUSY;	/* still on; can't reset */
+		}
+		break;
+
+	case LSTAT_RELEASE:
+		if (lstat_control.state == LSTAT_OFF) {
+			release_control_space();
+			lstat_control.intervals = 0;
+			lstat_control.enabled_cycles64 = 0;
+		} else {
+			error = -EBUSY;
+		}
+		break;
+
+	default:
+		error = -EINVAL;
+	}			/* switch */
+
+	_raw_spin_unlock(&lstat_control.control_lock);
+	return error ? error : len;
+}
+
+#ifdef USER_MODE_TESTING
+/* following used for user mode testing */
+void
+lockmeter_init()
+{
+	int dirsize, hashsize, countsize, read_lock_countsize, cpu;
+
+	printf("lstat_control is at %x size=%d\n", &lstat_control,
+		sizeof (lstat_control));
+	printf("sizeof(spinlock_t)=%d\n", sizeof (spinlock_t));
+	lstat_control.state = LSTAT_ON;
+
+	lstat_control.directory_lock = SPIN_LOCK_UNLOCKED;
+	lstat_control.next_free_dir_index = 1;	/* 0 is for overflows */
+	lstat_control.next_free_read_lock_index = 1;
+
+	dirsize = LSTAT_MAX_STAT_INDEX * sizeof (lstat_directory_entry_t);
+	hashsize = (1 + LSTAT_HASH_TABLE_SIZE) * sizeof (ushort);
+	countsize = sizeof (lstat_cpu_counts_t);
+	read_lock_countsize = sizeof (lstat_read_lock_cpu_counts_t);
+
+	lstat_control.hashtab = (ushort *) malloc(hashsize);
+
+	if (lstat_control.hashtab == 0) {
+		printf("malloc failure for at line %d in lockmeter.c\n",
+			__LINE__);
+		exit(0);
+	}
+
+	lstat_control.dir = (lstat_directory_entry_t *) malloc(dirsize);
+
+	if (lstat_control.dir == 0) {
+		printf("malloc failure for at line %d in lockmeter.c\n", cpu,
+			__LINE__);
+		exit(0);
+	}
+
+	for (cpu = 0; cpu < num_online_cpus(); cpu++) {
+		int j, k;
+		j = (int) (lstat_control.counts[cpu] =
+			   (lstat_cpu_counts_t *) malloc(countsize));
+		k = (int) (lstat_control.read_lock_counts[cpu] =
+			   (lstat_read_lock_cpu_counts_t *)
+			   malloc(read_lock_countsize));
+		if (j * k == 0) {
+			printf("malloc failure for cpu=%d at line %d in "
+				"lockmeter.c\n", cpu, __LINE__);
+			exit(0);
+		}
+	}
+
+	memset(lstat_control.hashtab, 0, hashsize);
+	memset(lstat_control.dir, 0, dirsize);
+
+	for (cpu = 0; cpu < num_online_cpus(); cpu++) {
+		memset(lstat_control.counts[cpu], 0, countsize);
+		memset(lstat_control.read_lock_counts[cpu], 0,
+			read_lock_countsize);
+	}
+}
+
+asm(" \
+.align	4 \
+.globl	__write_lock_failed \
+__write_lock_failed: \
+	" LOCK "addl	$" RW_LOCK_BIAS_STR ",(%eax) \
+1:	cmpl	$" RW_LOCK_BIAS_STR ",(%eax) \
+	jne	1b \
+\
+	" LOCK "subl	$" RW_LOCK_BIAS_STR ",(%eax) \
+	jnz	__write_lock_failed \
+	ret \
+\
+\
+.align	4 \
+.globl	__read_lock_failed \
+__read_lock_failed: \
+	lock ; incl	(%eax) \
+1:	cmpl	$1,(%eax) \
+	js	1b \
+\
+	lock ; decl	(%eax) \
+	js	__read_lock_failed \
+	ret \
+");
+#endif
+
+EXPORT_SYMBOL(_metered_spin_lock);
+EXPORT_SYMBOL(_metered_spin_unlock);
+EXPORT_SYMBOL(_metered_spin_trylock);
+EXPORT_SYMBOL(_metered_read_lock);
+EXPORT_SYMBOL(_metered_read_unlock);
+EXPORT_SYMBOL(_metered_write_lock);
+EXPORT_SYMBOL(_metered_write_unlock);
--- diff/mm/usercopy.c	1970-01-01 01:00:00.000000000 +0100
+++ source/mm/usercopy.c	2004-02-09 10:39:57.000000000 +0000
@@ -0,0 +1,291 @@
+/*
+ * linux/mm/usercopy.c
+ *
+ * (C) Copyright 2003 Ingo Molnar
+ *
+ * Generic implementation of all the user-VM access functions, without
+ * relying on being able to access the VM directly.
+ */
+
+#include <linux/module.h>
+#include <linux/sched.h>
+#include <linux/errno.h>
+#include <linux/mm.h>
+#include <linux/highmem.h>
+#include <linux/pagemap.h>
+#include <linux/smp_lock.h>
+#include <linux/ptrace.h>
+#include <linux/interrupt.h>
+
+#include <asm/pgtable.h>
+#include <asm/uaccess.h>
+#include <asm/atomic_kmap.h>
+
+/*
+ * Get kernel address of the user page and pin it.
+ */
+static inline struct page *pin_page(unsigned long addr, int write)
+{
+	struct mm_struct *mm = current->mm ? : &init_mm;
+	struct page *page = NULL;
+	int ret;
+
+	/*
+	 * Do a quick atomic lookup first - this is the fastpath.
+	 */
+retry:
+	page = follow_page(mm, addr, write);
+	if (likely(page != NULL)) {
+		if (!PageReserved(page))
+			get_page(page);
+		return page;
+	}
+
+	/*
+	 * No luck - bad address or need to fault in the page:
+	 */
+
+	/* Release the lock so get_user_pages can sleep */
+	spin_unlock(&mm->page_table_lock);
+
+	/*
+	 * In the context of filemap_copy_from_user(), we are not allowed
+	 * to sleep.  We must fail this usercopy attempt and allow
+	 * filemap_copy_from_user() to recover: drop its atomic kmap and use
+	 * a sleeping kmap instead.
+	 */
+	if (in_atomic()) {
+		spin_lock(&mm->page_table_lock);
+		return NULL;
+	}
+
+	down_read(&mm->mmap_sem);
+	ret = get_user_pages(current, mm, addr, 1, write, 0, NULL, NULL);
+	up_read(&mm->mmap_sem);
+	spin_lock(&mm->page_table_lock);
+
+	if (ret <= 0)
+		return NULL;
+
+	/*
+	 * Go try the follow_page again.
+	 */
+	goto retry;
+}
+
+static inline void unpin_page(struct page *page)
+{
+	put_page(page);
+}
+
+/*
+ * Access another process' address space.
+ * Source/target buffer must be kernel space,
+ * Do not walk the page table directly, use get_user_pages
+ */
+static int rw_vm(unsigned long addr, void *buf, int len, int write)
+{
+	struct mm_struct *mm = current->mm ? : &init_mm;
+
+	if (!len)
+		return 0;
+
+	spin_lock(&mm->page_table_lock);
+
+	/* ignore errors, just check how much was sucessfully transfered */
+	while (len) {
+		struct page *page = NULL;
+		int bytes, offset;
+		void *maddr;
+
+		page = pin_page(addr, write);
+		if (!page)
+			break;
+
+		bytes = len;
+		offset = addr & (PAGE_SIZE-1);
+		if (bytes > PAGE_SIZE-offset)
+			bytes = PAGE_SIZE-offset;
+
+		maddr = kmap_atomic(page, KM_USER_COPY);
+
+#define HANDLE_TYPE(type) \
+	case sizeof(type): *(type *)(maddr+offset) = *(type *)(buf); break;
+
+		if (write) {
+			switch (bytes) {
+			HANDLE_TYPE(char);
+			HANDLE_TYPE(int);
+			HANDLE_TYPE(long long);
+			default:
+				memcpy(maddr + offset, buf, bytes);
+			}
+		} else {
+#undef HANDLE_TYPE
+#define HANDLE_TYPE(type) \
+	case sizeof(type): *(type *)(buf) = *(type *)(maddr+offset); break;
+			switch (bytes) {
+			HANDLE_TYPE(char);
+			HANDLE_TYPE(int);
+			HANDLE_TYPE(long long);
+			default:
+				memcpy(buf, maddr + offset, bytes);
+			}
+#undef HANDLE_TYPE
+		}
+		kunmap_atomic(maddr, KM_USER_COPY);
+		unpin_page(page);
+		len -= bytes;
+		buf += bytes;
+		addr += bytes;
+	}
+	spin_unlock(&mm->page_table_lock);
+
+	return len;
+}
+
+static int str_vm(unsigned long addr, void *buf0, int len, int copy)
+{
+	struct mm_struct *mm = current->mm ? : &init_mm;
+	struct page *page;
+	void *buf = buf0;
+
+	if (!len)
+		return len;
+
+	spin_lock(&mm->page_table_lock);
+
+	/* ignore errors, just check how much was sucessfully transfered */
+	while (len) {
+		int bytes, offset, left, copied;
+		char *maddr;
+
+		page = pin_page(addr, copy == 2);
+		if (!page) {
+			spin_unlock(&mm->page_table_lock);
+			return -EFAULT;
+		}
+		bytes = len;
+		offset = addr & (PAGE_SIZE-1);
+		if (bytes > PAGE_SIZE-offset)
+			bytes = PAGE_SIZE-offset;
+
+		maddr = kmap_atomic(page, KM_USER_COPY);
+		if (copy == 2) {
+			memset(maddr + offset, 0, bytes);
+			copied = bytes;
+			left = 0;
+		} else if (copy == 1) {
+			left = strncpy_count(buf, maddr + offset, bytes);
+			copied = bytes - left;
+		} else {
+			copied = strnlen(maddr + offset, bytes);
+			left = bytes - copied;
+		}
+		BUG_ON(bytes < 0 || copied < 0);
+		kunmap_atomic(maddr, KM_USER_COPY);
+		unpin_page(page);
+		len -= copied;
+		buf += copied;
+		addr += copied;
+		if (left)
+			break;
+	}
+	spin_unlock(&mm->page_table_lock);
+
+	return len;
+}
+
+/*
+ * Copies memory from userspace (ptr) into kernelspace (val).
+ *
+ * returns # of bytes not copied.
+ */
+int get_user_size(unsigned int size, void *val, const void *ptr)
+{
+	int ret;
+
+	if (unlikely(segment_eq(get_fs(), KERNEL_DS)))
+		ret = __direct_copy_from_user(val, ptr, size);
+	else
+		ret = rw_vm((unsigned long)ptr, val, size, 0);
+	if (ret)
+		/*
+		 * Zero the rest:
+		 */
+		memset(val + size - ret, 0, ret);
+	return ret;
+}
+
+/*
+ * Copies memory from kernelspace (val) into userspace (ptr).
+ *
+ * returns # of bytes not copied.
+ */
+int put_user_size(unsigned int size, const void *val, void *ptr)
+{
+	if (unlikely(segment_eq(get_fs(), KERNEL_DS)))
+		return __direct_copy_to_user(ptr, val, size);
+	else
+		return rw_vm((unsigned long)ptr, (void *)val, size, 1);
+}
+
+int copy_str_fromuser_size(unsigned int size, void *val, const void *ptr)
+{
+	int copied, left;
+
+	if (unlikely(segment_eq(get_fs(), KERNEL_DS))) {
+		left = strncpy_count(val, ptr, size);
+		copied = size - left;
+		BUG_ON(copied < 0);
+
+		return copied;
+	}
+	left = str_vm((unsigned long)ptr, val, size, 1);
+	if (left < 0)
+		return left;
+	copied = size - left;
+	BUG_ON(copied < 0);
+
+	return copied;
+}
+
+int strlen_fromuser_size(unsigned int size, const void *ptr)
+{
+	int copied, left;
+
+	if (unlikely(segment_eq(get_fs(), KERNEL_DS))) {
+		copied = strnlen(ptr, size) + 1;
+		BUG_ON(copied < 0);
+
+		return copied;
+	}
+	left = str_vm((unsigned long)ptr, NULL, size, 0);
+	if (left < 0)
+		return 0;
+	copied = size - left + 1;
+	BUG_ON(copied < 0);
+
+	return copied;
+}
+
+int zero_user_size(unsigned int size, void *ptr)
+{
+	int left;
+
+	if (unlikely(segment_eq(get_fs(), KERNEL_DS))) {
+		memset(ptr, 0, size);
+		return 0;
+	}
+	left = str_vm((unsigned long)ptr, NULL, size, 2);
+	if (left < 0)
+		return size;
+	return left;
+}
+
+EXPORT_SYMBOL(get_user_size);
+EXPORT_SYMBOL(put_user_size);
+EXPORT_SYMBOL(zero_user_size);
+EXPORT_SYMBOL(copy_str_fromuser_size);
+EXPORT_SYMBOL(strlen_fromuser_size);
+
--- diff/net/core/netpoll.c	1970-01-01 01:00:00.000000000 +0100
+++ source/net/core/netpoll.c	2004-02-09 10:39:57.000000000 +0000
@@ -0,0 +1,651 @@
+/*
+ * Common framework for low-level network console, dump, and debugger code
+ *
+ * Sep 8 2003  Matt Mackall <mpm@selenic.com>
+ */
+
+#include <linux/smp_lock.h>
+#include <linux/netdevice.h>
+#include <linux/etherdevice.h>
+#include <linux/string.h>
+#include <linux/inetdevice.h>
+#include <linux/inet.h>
+#include <linux/interrupt.h>
+#include <linux/netpoll.h>
+#include <linux/sched.h>
+#include <net/tcp.h>
+#include <net/udp.h>
+
+/*
+ * We maintain a small pool of fully-sized skbs, to make sure the
+ * message gets out even in extreme OOM situations.
+ */
+
+#define MAX_SKBS 32
+#define MAX_UDP_CHUNK 1460
+
+static spinlock_t skb_list_lock = SPIN_LOCK_UNLOCKED;
+static int nr_skbs;
+static struct sk_buff *skbs;
+
+static spinlock_t rx_list_lock = SPIN_LOCK_UNLOCKED;
+static LIST_HEAD(rx_list);
+
+static int trapped;
+
+#define MAX_SKB_SIZE \
+		(MAX_UDP_CHUNK + sizeof(struct udphdr) + \
+				sizeof(struct iphdr) + sizeof(struct ethhdr))
+
+static void zap_completion_queue(void);
+
+static int checksum_udp(struct sk_buff *skb, struct udphdr *uh,
+			     unsigned short ulen, u32 saddr, u32 daddr)
+{
+	if (uh->check == 0)
+		return 0;
+
+	if (skb->ip_summed == CHECKSUM_HW)
+		return csum_tcpudp_magic(
+			saddr, daddr, ulen, IPPROTO_UDP, skb->csum);
+
+	skb->csum = csum_tcpudp_nofold(saddr, daddr, ulen, IPPROTO_UDP, 0);
+
+	return csum_fold(skb_checksum(skb, 0, skb->len, skb->csum));
+}
+
+void netpoll_poll(struct netpoll *np)
+{
+	int budget = 1;
+
+	if(!np->dev || !netif_running(np->dev) || !np->dev->poll_controller)
+		return;
+
+	/* Process pending work on NIC */
+	np->dev->poll_controller(np->dev);
+
+	/* If scheduling is stopped, tickle NAPI bits */
+	if(trapped && np->dev->poll &&
+	   test_bit(__LINK_STATE_RX_SCHED, &np->dev->state))
+		np->dev->poll(np->dev, &budget);
+	zap_completion_queue();
+}
+
+static void refill_skbs(void)
+{
+	struct sk_buff *skb;
+	unsigned long flags;
+
+	spin_lock_irqsave(&skb_list_lock, flags);
+	while (nr_skbs < MAX_SKBS) {
+		skb = alloc_skb(MAX_SKB_SIZE, GFP_ATOMIC);
+		if (!skb)
+			break;
+
+		skb->next = skbs;
+		skbs = skb;
+		nr_skbs++;
+	}
+	spin_unlock_irqrestore(&skb_list_lock, flags);
+}
+
+static void zap_completion_queue(void)
+{
+	unsigned long flags;
+	struct softnet_data *sd = &get_cpu_var(softnet_data);
+
+	if (sd->completion_queue) {
+		struct sk_buff *clist;
+
+		local_irq_save(flags);
+		clist = sd->completion_queue;
+		sd->completion_queue = NULL;
+		local_irq_restore(flags);
+
+		while (clist != NULL) {
+			struct sk_buff *skb = clist;
+			clist = clist->next;
+			__kfree_skb(skb);
+		}
+	}
+
+	put_cpu_var(softnet_data);
+}
+
+static struct sk_buff * find_skb(struct netpoll *np, int len, int reserve)
+{
+	int once = 1, count = 0;
+	unsigned long flags;
+	struct sk_buff *skb = NULL;
+
+	zap_completion_queue();
+repeat:
+	if (nr_skbs < MAX_SKBS)
+		refill_skbs();
+
+	skb = alloc_skb(len, GFP_ATOMIC);
+
+	if (!skb) {
+		spin_lock_irqsave(&skb_list_lock, flags);
+		skb = skbs;
+		if (skb)
+			skbs = skb->next;
+		skb->next = NULL;
+		nr_skbs--;
+		spin_unlock_irqrestore(&skb_list_lock, flags);
+	}
+
+	if(!skb) {
+		count++;
+		if (once && (count == 1000000)) {
+			printk("out of netpoll skbs!\n");
+			once = 0;
+		}
+		netpoll_poll(np);
+		goto repeat;
+	}
+
+	atomic_set(&skb->users, 1);
+	skb_reserve(skb, reserve);
+	return skb;
+}
+
+void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb)
+{
+	int status;
+
+repeat:
+	if(!np || !np->dev || !netif_running(np->dev)) {
+		__kfree_skb(skb);
+		return;
+	}
+
+	spin_lock(&np->dev->xmit_lock);
+	np->dev->xmit_lock_owner = smp_processor_id();
+
+	if (netif_queue_stopped(np->dev)) {
+		np->dev->xmit_lock_owner = -1;
+		spin_unlock(&np->dev->xmit_lock);
+
+		netpoll_poll(np);
+		goto repeat;
+	}
+
+	status = np->dev->hard_start_xmit(skb, np->dev);
+	np->dev->xmit_lock_owner = -1;
+	spin_unlock(&np->dev->xmit_lock);
+
+	/* transmit busy */
+	if(status)
+		goto repeat;
+}
+
+void netpoll_send_udp(struct netpoll *np, const char *msg, int len)
+{
+	int total_len, eth_len, ip_len, udp_len;
+	struct sk_buff *skb;
+	struct udphdr *udph;
+	struct iphdr *iph;
+	struct ethhdr *eth;
+
+	udp_len = len + sizeof(*udph);
+	ip_len = eth_len = udp_len + sizeof(*iph);
+	total_len = eth_len + ETH_HLEN;
+
+	skb = find_skb(np, total_len, total_len - len);
+	if (!skb)
+		return;
+
+	memcpy(skb->data, msg, len);
+	skb->len += len;
+
+	udph = (struct udphdr *) skb_push(skb, sizeof(*udph));
+	udph->source = htons(np->local_port);
+	udph->dest = htons(np->remote_port);
+	udph->len = htons(udp_len);
+	udph->check = 0;
+
+	iph = (struct iphdr *)skb_push(skb, sizeof(*iph));
+
+	iph->version  = 4;
+	iph->ihl      = 5;
+	iph->tos      = 0;
+	iph->tot_len  = htons(ip_len);
+	iph->id       = 0;
+	iph->frag_off = 0;
+	iph->ttl      = 64;
+	iph->protocol = IPPROTO_UDP;
+	iph->check    = 0;
+	iph->saddr    = htonl(np->local_ip);
+	iph->daddr    = htonl(np->remote_ip);
+	iph->check    = ip_fast_csum((unsigned char *)iph, iph->ihl);
+
+	eth = (struct ethhdr *) skb_push(skb, ETH_HLEN);
+
+	eth->h_proto = htons(ETH_P_IP);
+	memcpy(eth->h_source, np->local_mac, 6);
+	memcpy(eth->h_dest, np->remote_mac, 6);
+
+	netpoll_send_skb(np, skb);
+}
+
+static void arp_reply(struct sk_buff *skb)
+{
+	struct in_device *in_dev = (struct in_device *) skb->dev->ip_ptr;
+	struct arphdr *arp;
+	unsigned char *arp_ptr, *sha, *tha;
+	int size, type = ARPOP_REPLY, ptype = ETH_P_ARP;
+	u32 sip, tip;
+	struct sk_buff *send_skb;
+	unsigned long flags;
+	struct list_head *p;
+	struct netpoll *np = 0;
+
+	spin_lock_irqsave(&rx_list_lock, flags);
+	list_for_each(p, &rx_list) {
+		np = list_entry(p, struct netpoll, rx_list);
+		if ( np->dev == skb->dev )
+			break;
+		np = 0;
+	}
+	spin_unlock_irqrestore(&rx_list_lock, flags);
+
+	if (!np) return;
+
+	/* No arp on this interface */
+	if (!in_dev || skb->dev->flags & IFF_NOARP)
+		return;
+
+	if (!pskb_may_pull(skb, (sizeof(struct arphdr) +
+				 (2 * skb->dev->addr_len) +
+				 (2 * sizeof(u32)))))
+		return;
+
+	skb->h.raw = skb->nh.raw = skb->data;
+	arp = skb->nh.arph;
+
+	if ((arp->ar_hrd != htons(ARPHRD_ETHER) &&
+	     arp->ar_hrd != htons(ARPHRD_IEEE802)) ||
+	    arp->ar_pro != htons(ETH_P_IP) ||
+	    arp->ar_op != htons(ARPOP_REQUEST))
+		return;
+
+	arp_ptr= (unsigned char *)(arp+1);
+	sha = arp_ptr;
+	arp_ptr += skb->dev->addr_len;
+	memcpy(&sip, arp_ptr, 4);
+	arp_ptr += 4;
+	tha = arp_ptr;
+	arp_ptr += skb->dev->addr_len;
+	memcpy(&tip, arp_ptr, 4);
+
+	/* Should we ignore arp? */
+	if (tip != in_dev->ifa_list->ifa_address ||
+	    LOOPBACK(tip) || MULTICAST(tip))
+		return;
+
+
+	size = sizeof(struct arphdr) + 2 * (skb->dev->addr_len + 4);
+	send_skb = find_skb(np, size + LL_RESERVED_SPACE(np->dev),
+			    LL_RESERVED_SPACE(np->dev));
+
+	if (!send_skb)
+		return;
+
+	send_skb->nh.raw = send_skb->data;
+	arp = (struct arphdr *) skb_put(send_skb, size);
+	send_skb->dev = skb->dev;
+	send_skb->protocol = htons(ETH_P_ARP);
+
+	/* Fill the device header for the ARP frame */
+
+	if (np->dev->hard_header &&
+	    np->dev->hard_header(send_skb, skb->dev, ptype,
+				       np->remote_mac, np->local_mac,
+				       send_skb->len) < 0) {
+		kfree_skb(send_skb);
+		return;
+	}
+
+	/*
+	 * Fill out the arp protocol part.
+	 *
+	 * we only support ethernet device type,
+	 * which (according to RFC 1390) should always equal 1 (Ethernet).
+	 */
+
+	arp->ar_hrd = htons(np->dev->type);
+	arp->ar_pro = htons(ETH_P_IP);
+	arp->ar_hln = np->dev->addr_len;
+	arp->ar_pln = 4;
+	arp->ar_op = htons(type);
+
+	arp_ptr=(unsigned char *)(arp + 1);
+	memcpy(arp_ptr, np->dev->dev_addr, np->dev->addr_len);
+	arp_ptr += np->dev->addr_len;
+	memcpy(arp_ptr, &tip, 4);
+	arp_ptr += 4;
+	memcpy(arp_ptr, np->local_mac, np->dev->addr_len);
+	arp_ptr += np->dev->addr_len;
+	memcpy(arp_ptr, &sip, 4);
+
+	netpoll_send_skb(np, send_skb);
+}
+
+int netpoll_rx(struct sk_buff *skb)
+{
+	int proto, len, ulen;
+	struct iphdr *iph;
+	struct udphdr *uh;
+	struct netpoll *np;
+	struct list_head *p;
+	unsigned long flags;
+
+	if (skb->dev->type != ARPHRD_ETHER)
+		goto out;
+
+	/* check if netpoll clients need ARP */
+	if (skb->protocol == __constant_htons(ETH_P_ARP) && trapped) {
+		arp_reply(skb);
+		return 1;
+	}
+
+	proto = ntohs(skb->mac.ethernet->h_proto);
+	if (proto != ETH_P_IP)
+		goto out;
+	if (skb->pkt_type == PACKET_OTHERHOST)
+		goto out;
+	if (skb_shared(skb))
+		goto out;
+
+	iph = (struct iphdr *)skb->data;
+	if (!pskb_may_pull(skb, sizeof(struct iphdr)))
+		goto out;
+	if (iph->ihl < 5 || iph->version != 4)
+		goto out;
+	if (!pskb_may_pull(skb, iph->ihl*4))
+		goto out;
+	if (ip_fast_csum((u8 *)iph, iph->ihl) != 0)
+		goto out;
+
+	len = ntohs(iph->tot_len);
+	if (skb->len < len || len < iph->ihl*4)
+		goto out;
+
+	if (iph->protocol != IPPROTO_UDP)
+		goto out;
+
+	len -= iph->ihl*4;
+	uh = (struct udphdr *)(((char *)iph) + iph->ihl*4);
+	ulen = ntohs(uh->len);
+
+	if (ulen != len)
+		goto out;
+	if (checksum_udp(skb, uh, ulen, iph->saddr, iph->daddr) < 0)
+		goto out;
+
+	spin_lock_irqsave(&rx_list_lock, flags);
+	list_for_each(p, &rx_list) {
+		np = list_entry(p, struct netpoll, rx_list);
+		if (np->dev && np->dev != skb->dev)
+			continue;
+		if (np->local_ip && np->local_ip != ntohl(iph->daddr))
+			continue;
+		if (np->remote_ip && np->remote_ip != ntohl(iph->saddr))
+			continue;
+		if (np->local_port && np->local_port != ntohs(uh->dest))
+			continue;
+
+		spin_unlock_irqrestore(&rx_list_lock, flags);
+
+		if (np->rx_hook)
+			np->rx_hook(np, ntohs(uh->source),
+				    (char *)(uh+1),
+				    ulen - sizeof(struct udphdr));
+
+		return 1;
+	}
+	spin_unlock_irqrestore(&rx_list_lock, flags);
+
+out:
+	return trapped;
+}
+
+int netpoll_parse_options(struct netpoll *np, char *opt)
+{
+	char *cur=opt, *delim;
+
+	if(*cur != '@') {
+		if ((delim = strchr(cur, '@')) == NULL)
+			goto parse_failed;
+		*delim=0;
+		np->local_port=simple_strtol(cur, 0, 10);
+		cur=delim;
+	}
+	cur++;
+	printk(KERN_INFO "%s: local port %d\n", np->name, np->local_port);
+
+	if(*cur != '/') {
+		if ((delim = strchr(cur, '/')) == NULL)
+			goto parse_failed;
+		*delim=0;
+		np->local_ip=ntohl(in_aton(cur));
+		cur=delim;
+
+		printk(KERN_INFO "%s: local IP %d.%d.%d.%d\n",
+		       np->name, HIPQUAD(np->local_ip));
+	}
+	cur++;
+
+	if ( *cur != ',') {
+		/* parse out dev name */
+		if ((delim = strchr(cur, ',')) == NULL)
+			goto parse_failed;
+		*delim=0;
+		strlcpy(np->dev_name, cur, sizeof(np->dev_name));
+		cur=delim;
+	}
+	cur++;
+
+	printk(KERN_INFO "%s: interface %s\n", np->name, np->dev_name);
+
+	if ( *cur != '@' ) {
+		/* dst port */
+		if ((delim = strchr(cur, '@')) == NULL)
+			goto parse_failed;
+		*delim=0;
+		np->remote_port=simple_strtol(cur, 0, 10);
+		cur=delim;
+	}
+	cur++;
+	printk(KERN_INFO "%s: remote port %d\n", np->name, np->remote_port);
+
+	/* dst ip */
+	if ((delim = strchr(cur, '/')) == NULL)
+		goto parse_failed;
+	*delim=0;
+	np->remote_ip=ntohl(in_aton(cur));
+	cur=delim+1;
+
+	printk(KERN_INFO "%s: remote IP %d.%d.%d.%d\n",
+		       np->name, HIPQUAD(np->remote_ip));
+
+	if( *cur != 0 )
+	{
+		/* MAC address */
+		if ((delim = strchr(cur, ':')) == NULL)
+			goto parse_failed;
+		*delim=0;
+		np->remote_mac[0]=simple_strtol(cur, 0, 16);
+		cur=delim+1;
+		if ((delim = strchr(cur, ':')) == NULL)
+			goto parse_failed;
+		*delim=0;
+		np->remote_mac[1]=simple_strtol(cur, 0, 16);
+		cur=delim+1;
+		if ((delim = strchr(cur, ':')) == NULL)
+			goto parse_failed;
+		*delim=0;
+		np->remote_mac[2]=simple_strtol(cur, 0, 16);
+		cur=delim+1;
+		if ((delim = strchr(cur, ':')) == NULL)
+			goto parse_failed;
+		*delim=0;
+		np->remote_mac[3]=simple_strtol(cur, 0, 16);
+		cur=delim+1;
+		if ((delim = strchr(cur, ':')) == NULL)
+			goto parse_failed;
+		*delim=0;
+		np->remote_mac[4]=simple_strtol(cur, 0, 16);
+		cur=delim+1;
+		np->remote_mac[5]=simple_strtol(cur, 0, 16);
+	}
+
+	printk(KERN_INFO "%s: remote ethernet address "
+	       "%02x:%02x:%02x:%02x:%02x:%02x\n",
+	       np->name,
+	       np->remote_mac[0],
+	       np->remote_mac[1],
+	       np->remote_mac[2],
+	       np->remote_mac[3],
+	       np->remote_mac[4],
+	       np->remote_mac[5]);
+
+	return 0;
+
+ parse_failed:
+	printk(KERN_INFO "%s: couldn't parse config at %s!\n",
+	       np->name, cur);
+	return -1;
+}
+
+int netpoll_setup(struct netpoll *np)
+{
+	struct net_device *ndev = NULL;
+	struct in_device *in_dev;
+
+	if (np->dev_name)
+		ndev = dev_get_by_name(np->dev_name);
+	if (!ndev) {
+		printk(KERN_ERR "%s: %s doesn't exist, aborting.\n",
+		       np->name, np->dev_name);
+		return -1;
+	}
+	if (!ndev->poll_controller) {
+		printk(KERN_ERR "%s: %s doesn't support polling, aborting.\n",
+		       np->name, np->dev_name);
+		goto release;
+	}
+
+	if (!(ndev->flags & IFF_UP)) {
+		unsigned short oflags;
+		unsigned long atmost, atleast;
+
+		printk(KERN_INFO "%s: device %s not up yet, forcing it\n",
+		       np->name, np->dev_name);
+
+		oflags = ndev->flags;
+
+		rtnl_shlock();
+		if (dev_change_flags(ndev, oflags | IFF_UP) < 0) {
+			printk(KERN_ERR "%s: failed to open %s\n",
+			       np->name, np->dev_name);
+			rtnl_shunlock();
+			goto release;
+		}
+		rtnl_shunlock();
+
+		atleast = jiffies + HZ/10;
+ 		atmost = jiffies + 10*HZ;
+		while (!netif_carrier_ok(ndev)) {
+			if (time_after(jiffies, atmost)) {
+				printk(KERN_NOTICE
+				       "%s: timeout waiting for carrier\n",
+				       np->name);
+				break;
+			}
+			cond_resched();
+		}
+
+		if (time_before(jiffies, atleast)) {
+			printk(KERN_NOTICE "%s: carrier detect appears flaky,"
+			       " waiting 10 seconds\n",
+			       np->name);
+			while (time_before(jiffies, atmost))
+				cond_resched();
+		}
+	}
+
+	if (!memcmp(np->local_mac, "\0\0\0\0\0\0", 6) && ndev->dev_addr)
+		memcpy(np->local_mac, ndev->dev_addr, 6);
+
+	if (!np->local_ip) {
+		in_dev = in_dev_get(ndev);
+
+		if (!in_dev) {
+			printk(KERN_ERR "%s: no IP address for %s, aborting\n",
+			       np->name, np->dev_name);
+			goto release;
+		}
+
+		np->local_ip = ntohl(in_dev->ifa_list->ifa_local);
+		in_dev_put(in_dev);
+		printk(KERN_INFO "%s: local IP %d.%d.%d.%d\n",
+		       np->name, HIPQUAD(np->local_ip));
+	}
+
+	np->dev = ndev;
+
+	if(np->rx_hook) {
+		unsigned long flags;
+
+#ifdef CONFIG_NETPOLL_RX
+		np->dev->netpoll_rx = 1;
+#endif
+
+		spin_lock_irqsave(&rx_list_lock, flags);
+		list_add(&np->rx_list, &rx_list);
+		spin_unlock_irqrestore(&rx_list_lock, flags);
+	}
+
+	return 0;
+ release:
+	dev_put(ndev);
+	return -1;
+}
+
+void netpoll_cleanup(struct netpoll *np)
+{
+	if(np->rx_hook) {
+		unsigned long flags;
+
+		spin_lock_irqsave(&rx_list_lock, flags);
+		list_del(&np->rx_list);
+#ifdef CONFIG_NETPOLL_RX
+		np->dev->netpoll_rx = 0;
+#endif
+		spin_unlock_irqrestore(&rx_list_lock, flags);
+	}
+
+	dev_put(np->dev);
+	np->dev = 0;
+}
+
+int netpoll_trap()
+{
+	return trapped;
+}
+
+void netpoll_set_trap(int trap)
+{
+	trapped = trap;
+}
+
+EXPORT_SYMBOL(netpoll_set_trap);
+EXPORT_SYMBOL(netpoll_trap);
+EXPORT_SYMBOL(netpoll_parse_options);
+EXPORT_SYMBOL(netpoll_setup);
+EXPORT_SYMBOL(netpoll_cleanup);
+EXPORT_SYMBOL(netpoll_send_skb);
+EXPORT_SYMBOL(netpoll_send_udp);
+EXPORT_SYMBOL(netpoll_poll);
--- diff/scripts/gcc-version.sh	1970-01-01 01:00:00.000000000 +0100
+++ source/scripts/gcc-version.sh	2004-02-09 10:39:57.000000000 +0000
@@ -0,0 +1,14 @@
+#!/bin/sh
+#
+# gcc-version gcc-command
+#
+# Prints the gcc version of `gcc-command' in a canonical 4-digit form
+# such as `0295' for gcc-2.95, `0303' for gcc-3.3, etc.
+#
+
+compiler="$*"
+
+MAJOR=$(echo __GNUC__ | $compiler -E -xc - | tail -n 1)
+MINOR=$(echo __GNUC_MINOR__ | $compiler -E -xc - | tail -n 1)
+printf "%02d%02d\\n" $MAJOR $MINOR
+
--- diff/sound/pci/ac97/ac97_pcm.c	1970-01-01 01:00:00.000000000 +0100
+++ source/sound/pci/ac97/ac97_pcm.c	2004-02-09 10:39:58.000000000 +0000
@@ -0,0 +1,593 @@
+/*
+ *  Copyright (c) by Jaroslav Kysela <perex@suse.cz>
+ *  Universal interface for Audio Codec '97
+ *
+ *  For more details look to AC '97 component specification revision 2.2
+ *  by Intel Corporation (http://developer.intel.com) and to datasheets
+ *  for specific codecs.
+ *
+ *
+ *   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 <sound/driver.h>
+#include <linux/delay.h>
+#include <linux/init.h>
+#include <linux/slab.h>
+#include <sound/core.h>
+#include <sound/pcm.h>
+#include <sound/control.h>
+#include <sound/ac97_codec.h>
+#include "ac97_patch.h"
+#include "ac97_id.h"
+#include "ac97_local.h"
+
+#define chip_t ac97_t
+
+/*
+ *  PCM support
+ */
+
+static unsigned char rate_reg_tables[2][4][9] = {
+{
+  /* standard rates */
+  {
+  	/* 3&4 front, 7&8 rear, 6&9 center/lfe */
+	AC97_PCM_FRONT_DAC_RATE,	/* slot 3 */
+	AC97_PCM_FRONT_DAC_RATE,	/* slot 4 */
+	0xff,				/* slot 5 */
+	AC97_PCM_LFE_DAC_RATE,		/* slot 6 */
+	AC97_PCM_SURR_DAC_RATE,		/* slot 7 */
+	AC97_PCM_SURR_DAC_RATE,		/* slot 8 */
+	AC97_PCM_LFE_DAC_RATE,		/* slot 9 */
+	0xff,				/* slot 10 */
+	0xff,				/* slot 11 */
+  },
+  {
+  	/* 7&8 front, 6&9 rear, 10&11 center/lfe */
+	0xff,				/* slot 3 */
+	0xff,				/* slot 4 */
+	0xff,				/* slot 5 */
+	AC97_PCM_SURR_DAC_RATE,		/* slot 6 */
+	AC97_PCM_FRONT_DAC_RATE,	/* slot 7 */
+	AC97_PCM_FRONT_DAC_RATE,	/* slot 8 */
+	AC97_PCM_SURR_DAC_RATE,		/* slot 9 */
+	AC97_PCM_LFE_DAC_RATE,		/* slot 10 */
+	AC97_PCM_LFE_DAC_RATE,		/* slot 11 */
+  },
+  {
+  	/* 6&9 front, 10&11 rear, 3&4 center/lfe */
+	AC97_PCM_LFE_DAC_RATE,		/* slot 3 */
+	AC97_PCM_LFE_DAC_RATE,		/* slot 4 */
+	0xff,				/* slot 5 */
+	AC97_PCM_FRONT_DAC_RATE,	/* slot 6 */
+	0xff,				/* slot 7 */
+	0xff,				/* slot 8 */
+	AC97_PCM_FRONT_DAC_RATE,	/* slot 9 */
+	AC97_PCM_SURR_DAC_RATE,		/* slot 10 */
+	AC97_PCM_SURR_DAC_RATE,		/* slot 11 */
+  },
+  {
+  	/* 10&11 front, 3&4 rear, 7&8 center/lfe */
+	AC97_PCM_SURR_DAC_RATE,		/* slot 3 */
+	AC97_PCM_SURR_DAC_RATE,		/* slot 4 */
+	0xff,				/* slot 5 */
+	0xff,				/* slot 6 */
+	AC97_PCM_LFE_DAC_RATE,		/* slot 7 */
+	AC97_PCM_LFE_DAC_RATE,		/* slot 8 */
+	AC97_PCM_FRONT_DAC_RATE,	/* slot 9 */
+	AC97_PCM_FRONT_DAC_RATE,	/* slot 10 */
+	AC97_PCM_FRONT_DAC_RATE,	/* slot 11 */
+  },
+},
+{
+  /* FIXME: double rates */
+  {
+  	/* 3&4 front, 7&8 rear, 6&9 center/lfe */
+	AC97_PCM_FRONT_DAC_RATE,	/* slot 3 */
+	AC97_PCM_FRONT_DAC_RATE,	/* slot 4 */
+	0xff,				/* slot 5 */
+	AC97_PCM_LFE_DAC_RATE,		/* slot 6 */
+	AC97_PCM_SURR_DAC_RATE,		/* slot 7 */
+	AC97_PCM_SURR_DAC_RATE,		/* slot 8 */
+	AC97_PCM_LFE_DAC_RATE,		/* slot 9 */
+	0xff,				/* slot 10 */
+	0xff,				/* slot 11 */
+  },
+  {
+  	/* 7&8 front, 6&9 rear, 10&11 center/lfe */
+	0xff,				/* slot 3 */
+	0xff,				/* slot 4 */
+	0xff,				/* slot 5 */
+	AC97_PCM_SURR_DAC_RATE,		/* slot 6 */
+	AC97_PCM_FRONT_DAC_RATE,	/* slot 7 */
+	AC97_PCM_FRONT_DAC_RATE,	/* slot 8 */
+	AC97_PCM_SURR_DAC_RATE,		/* slot 9 */
+	AC97_PCM_LFE_DAC_RATE,		/* slot 10 */
+	AC97_PCM_LFE_DAC_RATE,		/* slot 11 */
+  },
+  {
+  	/* 6&9 front, 10&11 rear, 3&4 center/lfe */
+	AC97_PCM_LFE_DAC_RATE,		/* slot 3 */
+	AC97_PCM_LFE_DAC_RATE,		/* slot 4 */
+	0xff,				/* slot 5 */
+	AC97_PCM_FRONT_DAC_RATE,	/* slot 6 */
+	0xff,				/* slot 7 */
+	0xff,				/* slot 8 */
+	AC97_PCM_FRONT_DAC_RATE,	/* slot 9 */
+	AC97_PCM_SURR_DAC_RATE,		/* slot 10 */
+	AC97_PCM_SURR_DAC_RATE,		/* slot 11 */
+  },
+  {
+  	/* 10&11 front, 3&4 rear, 7&8 center/lfe */
+	AC97_PCM_SURR_DAC_RATE,		/* slot 3 */
+	AC97_PCM_SURR_DAC_RATE,		/* slot 4 */
+	0xff,				/* slot 5 */
+	0xff,				/* slot 6 */
+	AC97_PCM_LFE_DAC_RATE,		/* slot 7 */
+	AC97_PCM_LFE_DAC_RATE,		/* slot 8 */
+	AC97_PCM_FRONT_DAC_RATE,	/* slot 9 */
+	AC97_PCM_FRONT_DAC_RATE,	/* slot 10 */
+	AC97_PCM_FRONT_DAC_RATE,	/* slot 11 */
+  }
+}};
+
+/* FIXME: more various mappings for ADC? */
+static unsigned char rate_cregs[9] = {
+	AC97_PCM_LR_ADC_RATE,	/* 3 */
+	AC97_PCM_LR_ADC_RATE,	/* 4 */
+	0xff,			/* 5 */
+	AC97_PCM_MIC_ADC_RATE,	/* 6 */
+	0xff,			/* 7 */
+	0xff,			/* 8 */
+	0xff,			/* 9 */
+	0xff,			/* 10 */
+	0xff,			/* 11 */
+};
+
+static unsigned char get_slot_reg(struct ac97_pcm *pcm, unsigned short cidx,
+				  unsigned short slot, int dbl)
+{
+	if (slot < 3)
+		return 0xff;
+	if (slot > 11)
+		return 0xff;
+	if (pcm->spdif)
+		return AC97_SPDIF; /* pseudo register */
+	if (pcm->stream == SNDRV_PCM_STREAM_PLAYBACK)
+		return rate_reg_tables[dbl][pcm->r[dbl].rate_table[cidx]][slot - 3];
+	else
+		return rate_cregs[slot - 3];
+}
+
+static int set_spdif_rate(ac97_t *ac97, unsigned short rate)
+{
+	unsigned short old, bits, reg, mask;
+
+	if (! (ac97->ext_id & AC97_EI_SPDIF))
+		return -ENODEV;
+
+	if (ac97->flags & AC97_CS_SPDIF) {
+		switch (rate) {
+		case 48000: bits = 0; break;
+		case 44100: bits = 1 << AC97_SC_SPSR_SHIFT; break;
+		default: /* invalid - disable output */
+			snd_ac97_update_bits(ac97, AC97_EXTENDED_STATUS, AC97_EA_SPDIF, 0);
+			return -EINVAL;
+		}
+		reg = AC97_CSR_SPDIF;
+		mask = 1 << AC97_SC_SPSR_SHIFT;
+	} else {
+		if (ac97->id == AC97_ID_CM9739 && rate != 48000) {
+			snd_ac97_update_bits(ac97, AC97_EXTENDED_STATUS, AC97_EA_SPDIF, 0);
+			return -EINVAL;
+		}
+		switch (rate) {
+		case 44100: bits = AC97_SC_SPSR_44K; break;
+		case 48000: bits = AC97_SC_SPSR_48K; break;
+		case 32000: bits = AC97_SC_SPSR_32K; break;
+		default: /* invalid - disable output */
+			snd_ac97_update_bits(ac97, AC97_EXTENDED_STATUS, AC97_EA_SPDIF, 0);
+			return -EINVAL;
+		}
+		reg = AC97_SPDIF;
+		mask = AC97_SC_SPSR_MASK;
+	}
+
+	spin_lock(&ac97->reg_lock);
+	old = ac97->regs[reg] & mask;
+	spin_unlock(&ac97->reg_lock);
+	if (old != bits) {
+		snd_ac97_update_bits(ac97, AC97_EXTENDED_STATUS, AC97_EA_SPDIF, 0);
+		snd_ac97_update_bits(ac97, reg, mask, bits);
+	}
+	snd_ac97_update_bits(ac97, AC97_EXTENDED_STATUS, AC97_EA_SPDIF, AC97_EA_SPDIF);
+	return 0;
+}
+
+/**
+ * snd_ac97_set_rate - change the rate of the given input/output.
+ * @ac97: the ac97 instance
+ * @reg: the register to change
+ * @rate: the sample rate to set
+ *
+ * Changes the rate of the given input/output on the codec.
+ * If the codec doesn't support VAR, the rate must be 48000 (except
+ * for SPDIF).
+ *
+ * The valid registers are AC97_PMC_MIC_ADC_RATE,
+ * AC97_PCM_FRONT_DAC_RATE, AC97_PCM_LR_ADC_RATE.
+ * AC97_PCM_SURR_DAC_RATE and AC97_PCM_LFE_DAC_RATE are accepted
+ * if the codec supports them.
+ * AC97_SPDIF is accepted as a pseudo register to modify the SPDIF
+ * status bits.
+ *
+ * Returns zero if successful, or a negative error code on failure.
+ */
+int snd_ac97_set_rate(ac97_t *ac97, int reg, unsigned short rate)
+{
+	unsigned int tmp;
+	
+	switch (reg) {
+	case AC97_PCM_MIC_ADC_RATE:
+		if ((ac97->regs[AC97_EXTENDED_STATUS] & AC97_EA_VRM) == 0)	/* MIC VRA */
+			if (rate != 48000)
+				return -EINVAL;
+		break;
+	case AC97_PCM_FRONT_DAC_RATE:
+	case AC97_PCM_LR_ADC_RATE:
+		if ((ac97->regs[AC97_EXTENDED_STATUS] & AC97_EA_VRA) == 0)	/* VRA */
+			if (rate != 48000)
+				return -EINVAL;
+		break;
+	case AC97_PCM_SURR_DAC_RATE:
+		if (! (ac97->scaps & AC97_SCAP_SURROUND_DAC))
+			return -EINVAL;
+		break;
+	case AC97_PCM_LFE_DAC_RATE:
+		if (! (ac97->scaps & AC97_SCAP_CENTER_LFE_DAC))
+			return -EINVAL;
+		break;
+	case AC97_SPDIF:
+		/* special case */
+		return set_spdif_rate(ac97, rate);
+	default:
+		return -EINVAL;
+	}
+	tmp = ((unsigned int)rate * ac97->bus->clock) / 48000;
+	if (tmp > 65535)
+		return -EINVAL;
+	snd_ac97_update(ac97, reg, tmp & 0xffff);
+	snd_ac97_read(ac97, reg);
+	return 0;
+}
+
+static unsigned short get_pslots(ac97_t *ac97, unsigned char *rate_table, unsigned short *spdif_slots)
+{
+	if (!ac97_is_audio(ac97))
+		return 0;
+	if (ac97_is_rev22(ac97) || ac97_can_amap(ac97)) {
+		unsigned short slots = 0;
+		if (ac97_is_rev22(ac97)) {
+			/* Note: it's simply emulation of AMAP behaviour */
+			u16 es;
+			es = ac97->regs[AC97_EXTENDED_STATUS] &= ~AC97_EI_DACS_SLOT_MASK;
+			switch (ac97->addr) {
+			case 1:
+			case 2: es |= (1<<AC97_EI_DACS_SLOT_SHIFT); break;
+			case 3: es |= (2<<AC97_EI_DACS_SLOT_SHIFT); break;
+			}
+			snd_ac97_write_cache(ac97, AC97_EXTENDED_STATUS, es);
+		}
+		switch (ac97->addr) {
+		case 0:
+			slots |= (1<<AC97_SLOT_PCM_LEFT)|(1<<AC97_SLOT_PCM_RIGHT);
+			if (ac97->scaps & AC97_SCAP_SURROUND_DAC)
+				slots |= (1<<AC97_SLOT_PCM_SLEFT)|(1<<AC97_SLOT_PCM_SRIGHT);
+			if (ac97->scaps & AC97_SCAP_CENTER_LFE_DAC)
+				slots |= (1<<AC97_SLOT_PCM_CENTER)|(1<<AC97_SLOT_LFE);
+			if (ac97->ext_id & AC97_EI_SPDIF) {
+				if (!(ac97->scaps & AC97_SCAP_SURROUND_DAC))
+					*spdif_slots = (1<<AC97_SLOT_SPDIF_LEFT)|(1<<AC97_SLOT_SPDIF_RIGHT);
+				else if (!(ac97->scaps & AC97_SCAP_CENTER_LFE_DAC))
+					*spdif_slots = (1<<AC97_SLOT_SPDIF_LEFT1)|(1<<AC97_SLOT_SPDIF_RIGHT1);
+				else
+					*spdif_slots = (1<<AC97_SLOT_SPDIF_LEFT2)|(1<<AC97_SLOT_SPDIF_RIGHT2);
+			}
+			*rate_table = 0;
+			break;
+		case 1:
+		case 2:
+			slots |= (1<<AC97_SLOT_PCM_SLEFT)|(1<<AC97_SLOT_PCM_SRIGHT);
+			if (ac97->scaps & AC97_SCAP_SURROUND_DAC)
+				slots |= (1<<AC97_SLOT_PCM_CENTER)|(1<<AC97_SLOT_LFE);
+			if (ac97->ext_id & AC97_EI_SPDIF) {
+				if (!(ac97->scaps & AC97_SCAP_SURROUND_DAC))
+					*spdif_slots = (1<<AC97_SLOT_SPDIF_LEFT1)|(1<<AC97_SLOT_SPDIF_RIGHT1);
+				else
+					*spdif_slots = (1<<AC97_SLOT_SPDIF_LEFT2)|(1<<AC97_SLOT_SPDIF_RIGHT2);
+			}
+			*rate_table = 1;
+			break;
+		case 3:
+			slots |= (1<<AC97_SLOT_PCM_CENTER)|(1<<AC97_SLOT_LFE);
+			if (ac97->ext_id & AC97_EI_SPDIF)
+				*spdif_slots = (1<<AC97_SLOT_SPDIF_LEFT2)|(1<<AC97_SLOT_SPDIF_RIGHT2);
+			*rate_table = 2;
+			break;
+		}
+		return slots;
+	} else {
+		unsigned short slots;
+		slots = (1<<AC97_SLOT_PCM_LEFT)|(1<<AC97_SLOT_PCM_RIGHT);
+		if (ac97->scaps & AC97_SCAP_SURROUND_DAC)
+			slots |= (1<<AC97_SLOT_PCM_SLEFT)|(1<<AC97_SLOT_PCM_SRIGHT);
+		if (ac97->scaps & AC97_SCAP_CENTER_LFE_DAC)
+			slots |= (1<<AC97_SLOT_PCM_CENTER)|(1<<AC97_SLOT_LFE);
+		if (ac97->ext_id & AC97_EI_SPDIF) {
+			if (!(ac97->scaps & AC97_SCAP_SURROUND_DAC))
+				*spdif_slots = (1<<AC97_SLOT_SPDIF_LEFT)|(1<<AC97_SLOT_SPDIF_RIGHT);
+			else if (!(ac97->scaps & AC97_SCAP_CENTER_LFE_DAC))
+				*spdif_slots = (1<<AC97_SLOT_SPDIF_LEFT1)|(1<<AC97_SLOT_SPDIF_RIGHT1);
+			else
+				*spdif_slots = (1<<AC97_SLOT_SPDIF_LEFT2)|(1<<AC97_SLOT_SPDIF_RIGHT2);
+		}
+		*rate_table = 0;
+		return slots;
+	}
+}
+
+static unsigned short get_cslots(ac97_t *ac97)
+{
+	unsigned short slots;
+
+	if (!ac97_is_audio(ac97))
+		return 0;
+	slots = (1<<AC97_SLOT_PCM_LEFT)|(1<<AC97_SLOT_PCM_RIGHT);
+	slots |= (1<<AC97_SLOT_MIC);
+	return slots;
+}
+
+static unsigned int get_rates(struct ac97_pcm *pcm, unsigned int cidx, unsigned short slots, int dbl)
+{
+	int i, idx;
+	unsigned int rates = ~0;
+	unsigned char reg;
+
+	for (i = 3; i < 12; i++) {
+		if (!(slots & (1 << i)))
+			continue;
+		reg = get_slot_reg(pcm, cidx, i, dbl);
+		switch (reg) {
+		case AC97_PCM_FRONT_DAC_RATE:	idx = AC97_RATES_FRONT_DAC; break;
+		case AC97_PCM_SURR_DAC_RATE:	idx = AC97_RATES_SURR_DAC; break;
+		case AC97_PCM_LFE_DAC_RATE:	idx = AC97_RATES_LFE_DAC; break;
+		case AC97_PCM_LR_ADC_RATE:	idx = AC97_RATES_ADC; break;
+		case AC97_PCM_MIC_ADC_RATE:	idx = AC97_RATES_MIC_ADC; break;
+		default:			idx = AC97_RATES_SPDIF; break;
+		}
+		rates &= pcm->r[dbl].codec[cidx]->rates[idx];
+	}
+	return rates;
+}
+
+/**
+ * snd_ac97_pcm_assign - assign AC97 slots to given PCM streams
+ * @bus: the ac97 bus instance
+ * @pcms_count: count of PCMs to be assigned
+ * @pcms: PCMs to be assigned
+ *
+ * It assigns available AC97 slots for given PCMs. If none or only
+ * some slots are available, pcm->xxx.slots and pcm->xxx.rslots[] members
+ * are reduced and might be zero.
+ */
+int snd_ac97_pcm_assign(ac97_bus_t *bus,
+			unsigned short pcms_count,
+			const struct ac97_pcm *pcms)
+{
+	int i, j, k;
+	const struct ac97_pcm *pcm;
+	struct ac97_pcm *rpcms, *rpcm;
+	unsigned short avail_slots[2][4];
+	unsigned char rate_table[2][4];
+	unsigned short tmp, slots;
+	unsigned short spdif_slots[4];
+	unsigned int rates;
+	ac97_t *codec;
+
+	rpcms = snd_kcalloc(sizeof(struct ac97_pcm) * pcms_count, GFP_KERNEL);
+	if (rpcms == NULL)
+		return -ENOMEM;
+	memset(avail_slots, 0, sizeof(avail_slots));
+	memset(rate_table, 0, sizeof(rate_table));
+	memset(spdif_slots, 0, sizeof(spdif_slots));
+	for (i = 0; i < 4; i++) {
+		codec = bus->codec[i];
+		if (!codec)
+			continue;
+		avail_slots[0][i] = get_pslots(codec, &rate_table[0][i], &spdif_slots[i]);
+		avail_slots[1][i] = get_cslots(codec);
+		if (!(codec->scaps & AC97_SCAP_INDEP_SDIN)) {
+			for (j = 0; j < i; j++) {
+				if (bus->codec[j])
+					avail_slots[1][i] &= ~avail_slots[1][j];
+			}
+		}
+	}
+	/* FIXME: add double rate allocation */
+	/* first step - exclusive devices */
+	for (i = 0; i < pcms_count; i++) {
+		pcm = &pcms[i];
+		rpcm = &rpcms[i];
+		/* low-level driver thinks that it's more clever */
+		if (pcm->copy_flag) {
+			*rpcm = *pcm;
+			continue;
+		}
+		rpcm->stream = pcm->stream;
+		rpcm->exclusive = pcm->exclusive;
+		rpcm->spdif = pcm->spdif;
+		rpcm->private_value = pcm->private_value;
+		rpcm->bus = bus;
+		rpcm->rates = ~0;
+		slots = pcm->r[0].slots;
+		for (j = 0; j < 4 && slots; j++) {
+			if (!bus->codec[j])
+				continue;
+			rates = ~0;
+			if (pcm->spdif && pcm->stream == 0)
+				tmp = spdif_slots[j];
+			else
+				tmp = avail_slots[pcm->stream][j];
+			if (pcm->exclusive) {
+				/* exclusive access */
+				tmp &= slots;
+				for (k = 0; k < i; k++) {
+					if (rpcm->stream == rpcms[k].stream)
+						tmp &= ~rpcms[k].r[0].rslots[j];
+				}
+			} else {
+				/* non-exclusive access */
+				tmp &= pcm->r[0].slots;
+			}
+			if (tmp) {
+				rpcm->r[0].rslots[j] = tmp;
+				rpcm->r[0].codec[j] = bus->codec[j];
+				rpcm->r[0].rate_table[j] = rate_table[pcm->stream][j];
+				rates = get_rates(rpcm, j, tmp, 0);
+				if (pcm->exclusive)
+					avail_slots[pcm->stream][j] &= ~tmp;
+			}
+			slots &= ~tmp;
+			rpcm->r[0].slots |= tmp;
+			rpcm->rates &= rates;
+		}
+		if (rpcm->rates == ~0)
+			rpcm->rates = 0; /* not used */
+	}
+	bus->pcms_count = pcms_count;
+	bus->pcms = rpcms;
+	return 0;
+}
+
+/**
+ * snd_ac97_pcm_open - opens the given AC97 pcm
+ * @pcm: the ac97 pcm instance
+ * @rate: rate in Hz, if codec does not support VRA, this value must be 48000Hz
+ * @cfg: output stream characteristics
+ * @slots: a subset of allocated slots (snd_ac97_pcm_assign) for this pcm
+ *
+ * It locks the specified slots and sets the given rate to AC97 registers.
+ */
+int snd_ac97_pcm_open(struct ac97_pcm *pcm, unsigned int rate,
+		      enum ac97_pcm_cfg cfg, unsigned short slots)
+{
+	ac97_bus_t *bus;
+	int i, cidx, r = 0, ok_flag;
+	unsigned int reg_ok = 0;
+	unsigned char reg;
+	int err = 0;
+
+	if (rate > 48000)	/* FIXME: add support for double rate */
+		return -EINVAL;
+	bus = pcm->bus;
+	if (cfg == AC97_PCM_CFG_SPDIF) {
+		int err;
+		for (cidx = 0; cidx < 4; cidx++)
+			if (bus->codec[cidx] && (bus->codec[cidx]->ext_id & AC97_EI_SPDIF)) {
+				err = set_spdif_rate(bus->codec[cidx], rate);
+				if (err < 0)
+					return err;
+			}
+	}
+	spin_lock_irq(&pcm->bus->bus_lock);
+	for (i = 3; i < 12; i++) {
+		if (!(slots & (1 << i)))
+			continue;
+		ok_flag = 0;
+		for (cidx = 0; cidx < 4; cidx++) {
+			if (bus->used_slots[pcm->stream][cidx] & (1 << i)) {
+				spin_unlock_irq(&pcm->bus->bus_lock);
+				err = -EBUSY;
+				goto error;
+			}
+			if (pcm->r[r].rslots[cidx] & (1 << i)) {
+				bus->used_slots[pcm->stream][cidx] |= (1 << i);
+				ok_flag++;
+			}
+		}
+		if (!ok_flag) {
+			spin_unlock_irq(&pcm->bus->bus_lock);
+			snd_printk(KERN_ERR "cannot find configuration for AC97 slot %i\n", i);
+			err = -EAGAIN;
+			goto error;
+		}
+	}
+	spin_unlock_irq(&pcm->bus->bus_lock);
+	for (i = 3; i < 12; i++) {
+		if (!(slots & (1 << i)))
+			continue;
+		for (cidx = 0; cidx < 4; cidx++) {
+			if (pcm->r[r].rslots[cidx] & (1 << i)) {
+				reg = get_slot_reg(pcm, cidx, i, r);
+				if (reg == 0xff) {
+					snd_printk(KERN_ERR "invalid AC97 slot %i?\n", i);
+					continue;
+				}
+				if (reg_ok & (1 << (reg - AC97_PCM_FRONT_DAC_RATE)))
+					continue;
+				//printk(KERN_DEBUG "setting ac97 reg 0x%x to rate %d\n", reg, rate);
+				err = snd_ac97_set_rate(pcm->r[r].codec[cidx], reg, rate);
+				if (err < 0)
+					snd_printk(KERN_ERR "error in snd_ac97_set_rate: cidx=%d, reg=0x%x, rate=%d, err=%d\n", cidx, reg, rate, err);
+				else
+					reg_ok |= (1 << (reg - AC97_PCM_FRONT_DAC_RATE));
+			}
+		}
+	}
+	pcm->aslots = slots;
+	return 0;
+
+ error:
+	pcm->aslots = slots;
+	snd_ac97_pcm_close(pcm);
+	return err;
+}
+
+/**
+ * snd_ac97_pcm_close - closes the given AC97 pcm
+ * @pcm: the ac97 pcm instance
+ *
+ * It frees the locked AC97 slots.
+ */
+int snd_ac97_pcm_close(struct ac97_pcm *pcm)
+{
+	ac97_bus_t *bus;
+	unsigned short slots = pcm->aslots;
+	int i, cidx;
+
+	bus = pcm->bus;
+	spin_lock_irq(&pcm->bus->bus_lock);
+	for (i = 3; i < 12; i++) {
+		if (!(slots & (1 << i)))
+			continue;
+		for (cidx = 0; cidx < 4; cidx++)
+			bus->used_slots[pcm->stream][cidx] &= ~(1 << i);
+	}
+	pcm->aslots = 0;
+	spin_unlock_irq(&pcm->bus->bus_lock);
+	return 0;
+}
--- diff/sound/pci/ice1712/prodigy.c	1970-01-01 01:00:00.000000000 +0100
+++ source/sound/pci/ice1712/prodigy.c	2004-02-09 10:39:58.000000000 +0000
@@ -0,0 +1,662 @@
+/*
+ *   ALSA driver for ICEnsemble VT1724 (Envy24HT)
+ *
+ *   Lowlevel functions for AudioTrak Prodigy 7.1 (and possibly 192) cards
+ *      Copyright (c) 2003 Dimitromanolakis Apostolos <apostol@cs.utoronto.ca>
+ *	based on the aureon.c code (c) 2003 by Takashi Iwai <tiwai@suse.de>
+ *
+ *   version 0.82: Stable / not all features work yet (no communication with AC97 secondary)
+ *       added 64x/128x oversampling switch (should be 64x only for 96khz)
+ *       fixed some recording labels (still need to check the rest)
+ *       recording is working probably thanks to correct wm8770 initialization
+ *
+ *   version 0.5: Initial release:
+ *           working: analog output, mixer, headphone amplifier switch
+ *       not working: prety much everything else, at least i could verify that
+ *                    we have no digital output, no capture, pretty bad clicks and poops
+ *                    on mixer switch and other coll stuff.
+ *
+ *   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
+ *
+ *
+ * NOTES:
+ *
+ *
+ *
+ * - we reuse the akm4xxx_t record for storing the wm8770 codec data.
+ *   both wm and akm codecs are pretty similar, so we can integrate
+ *   both controls in the future, once if wm codecs are reused in
+ *   many boards.
+ *
+ * - writing over SPI is implemented but reading is not yet.
+ *   the SPDIF-in channel status, etc. can be read from CS chip.
+ *
+ * - DAC digital volumes are not implemented in the mixer.
+ *   if they show better response than DAC analog volumes, we can use them
+ *   instead.
+ *
+ * - Prodigy boards are equipped with AC97 STAC9744 chip , too.  it's used to do
+ *   the analog mixing but not easily controllable (it's not connected
+ *   directly from envy24ht chip).  so let's leave it as it is.
+ *
+ */
+
+#define REVISION 0.82b
+
+#include <sound/driver.h>
+#include <asm/io.h>
+#include <linux/delay.h>
+#include <linux/interrupt.h>
+#include <linux/init.h>
+#include <linux/slab.h>
+#include <sound/core.h>
+
+#include "ice1712.h"
+#include "envy24ht.h"
+#include "prodigy.h"
+
+
+static int prodigy_set_headphone_amp(ice1712_t *ice, int enable)
+{
+	unsigned int tmp, tmp2;
+
+	tmp2 = tmp = snd_ice1712_gpio_read(ice);
+	if (enable)
+		tmp |= PRODIGY_HP_AMP_EN;
+	else
+		tmp &= ~ PRODIGY_HP_AMP_EN;
+	if (tmp != tmp2) {
+		snd_ice1712_gpio_write(ice, tmp);
+		return 1;
+	}
+	return 0;
+}
+
+
+static int prodigy_get_headphone_amp(ice1712_t *ice)
+{
+	unsigned int tmp = snd_ice1712_gpio_read(ice);
+
+	return ( tmp & PRODIGY_HP_AMP_EN )!= 0;
+}
+
+
+/*
+ * write data in the SPI mode
+ */
+static void prodigy_spi_write(ice1712_t *ice, unsigned int cs, unsigned int data, int bits)
+{
+	unsigned int tmp;
+	int i;
+
+	tmp = snd_ice1712_gpio_read(ice);
+
+	snd_ice1712_gpio_set_mask(ice, ~(PRODIGY_WM_RW|PRODIGY_WM_DATA|PRODIGY_WM_CLK|
+					 PRODIGY_WM_CS|PRODIGY_CS8415_CS|PRODIGY_HP_AMP_EN));
+	tmp |= PRODIGY_WM_RW;
+	tmp &= ~cs;
+	snd_ice1712_gpio_write(ice, tmp);
+	udelay(1);
+
+	for (i = bits - 1; i >= 0; i--) {
+		tmp &= ~PRODIGY_WM_CLK;
+		snd_ice1712_gpio_write(ice, tmp);
+		udelay(1);
+		if (data & (1 << i))
+			tmp |= PRODIGY_WM_DATA;
+		else
+			tmp &= ~PRODIGY_WM_DATA;
+		snd_ice1712_gpio_write(ice, tmp);
+		udelay(1);
+		tmp |= PRODIGY_WM_CLK;
+		snd_ice1712_gpio_write(ice, tmp);
+		udelay(1);
+	}
+
+	tmp &= ~PRODIGY_WM_CLK;
+	tmp |= cs;
+	snd_ice1712_gpio_write(ice, tmp);
+	udelay(1);
+	tmp |= PRODIGY_WM_CLK;
+	snd_ice1712_gpio_write(ice, tmp);
+	udelay(1);
+}
+
+
+/*
+ * get the current register value of WM codec
+ */
+static unsigned short wm_get(ice1712_t *ice, int reg)
+{
+	reg <<= 1;
+	return ((unsigned short)ice->akm[0].images[reg] << 8) |
+		ice->akm[0].images[reg + 1];
+}
+
+/*
+ * set the register value of WM codec and remember it
+ */
+static void wm_put(ice1712_t *ice, int reg, unsigned short val)
+{
+	prodigy_spi_write(ice, PRODIGY_WM_CS, (reg << 9) | (val & 0x1ff), 16);
+	reg <<= 1;
+	ice->akm[0].images[reg] = val >> 8;
+	ice->akm[0].images[reg + 1] = val;
+}
+
+
+/*********************************
+ ********* Controls section ******
+ *********************************/
+
+#define PRODIGY_CON_HPAMP \
+        {                                            \
+                .iface = SNDRV_CTL_ELEM_IFACE_MIXER,      \
+                .name =  "Headphone Amplifier", \
+                .info =  prodigy_hpamp_info,         \
+                .get =   prodigy_hpamp_get, \
+                .put =   prodigy_hpamp_put  \
+        }
+
+static int prodigy_hpamp_info(snd_kcontrol_t *k, snd_ctl_elem_info_t *uinfo)
+{
+	static char *texts[2] = {
+		"Off", "On"
+	};
+
+	uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
+	uinfo->count = 1;
+	uinfo->value.enumerated.items = 2;
+
+	if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items)
+		uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1;
+	strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
+
+        return 0;
+}
+
+
+static int prodigy_hpamp_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+{
+	ice1712_t *ice = snd_kcontrol_chip(kcontrol);
+
+	ucontrol->value.integer.value[0] = prodigy_get_headphone_amp(ice);
+	return 0;
+}
+
+
+static int prodigy_hpamp_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+{
+	ice1712_t *ice = snd_kcontrol_chip(kcontrol);
+
+	return prodigy_set_headphone_amp(ice,ucontrol->value.integer.value[0]);
+}
+
+
+
+#define PRODIGY_CON_DEEMP \
+        {                                            \
+                .iface = SNDRV_CTL_ELEM_IFACE_MIXER,      \
+                .name =  "DAC De-emphasis", \
+                .info =  prodigy_deemp_info,         \
+                .get =   prodigy_deemp_get, \
+                .put =   prodigy_deemp_put  \
+        }
+
+static int prodigy_deemp_info(snd_kcontrol_t *k, snd_ctl_elem_info_t *uinfo)
+{
+	static char *texts[2] = { "Off", "On" };
+
+	uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
+	uinfo->count = 1;
+	uinfo->value.enumerated.items = 2;
+
+	if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items)
+		uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1;
+	strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
+
+        return 0;
+}
+
+static int prodigy_deemp_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+{
+	ice1712_t *ice = snd_kcontrol_chip(kcontrol);
+	ucontrol->value.integer.value[0] = (wm_get(ice, 0x15) & 0xf) == 0xf;
+	return 0;
+}
+
+static int prodigy_deemp_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+{
+	ice1712_t *ice = snd_kcontrol_chip(kcontrol);
+	int temp, temp2;
+	temp2 = temp = wm_get(ice, 0x15);
+	temp = (temp & ~0xf) | ((ucontrol->value.integer.value[0])*0xf);
+	if (temp != temp2) {
+		wm_put(ice,0x15,temp);
+		return 1;
+	}
+	return 0;
+}
+
+
+#define PRODIGY_CON_OVERSAMPLING \
+        {                                            \
+                .iface = SNDRV_CTL_ELEM_IFACE_MIXER,      \
+                .name =  "ADC Oversampling", \
+                .info =  prodigy_oversampling_info,         \
+                .get =   prodigy_oversampling_get, \
+                .put =   prodigy_oversampling_put  \
+        }
+
+static int prodigy_oversampling_info(snd_kcontrol_t *k, snd_ctl_elem_info_t *uinfo)
+{
+	static char *texts[2] = { "128x", "64x"	};
+
+	uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
+	uinfo->count = 1;
+	uinfo->value.enumerated.items = 2;
+
+	if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items)
+		uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1;
+	strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
+
+        return 0;
+}
+
+static int prodigy_oversampling_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+{
+	ice1712_t *ice = snd_kcontrol_chip(kcontrol);
+	ucontrol->value.integer.value[0] = (wm_get(ice, 0x17) & 0x8) == 0x8;
+	return 0;
+}
+
+static int prodigy_oversampling_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+{
+	int temp, temp2;
+	ice1712_t *ice = snd_kcontrol_chip(kcontrol);
+
+	temp2 = temp = wm_get(ice, 0x17);
+
+	if( ucontrol->value.integer.value[0] ) {
+		temp |= 0x8;
+	} else {
+		temp &= ~0x8;
+	}
+
+	if (temp != temp2) {
+		wm_put(ice,0x17,temp);
+		return 1;
+	}
+	return 0;
+}
+
+
+
+
+/*
+ * DAC volume attenuation mixer control
+ */
+static int wm_dac_vol_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo)
+{
+	uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
+	uinfo->count = 1;
+	uinfo->value.integer.min = 0;		/* mute */
+	uinfo->value.integer.max = 101;		/* 0dB */
+	return 0;
+}
+
+static int wm_dac_vol_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+{
+	ice1712_t *ice = snd_kcontrol_chip(kcontrol);
+	int idx;
+	unsigned short vol;
+
+	down(&ice->gpio_mutex);
+	if (kcontrol->private_value)
+		idx = WM_DAC_MASTER_ATTEN;
+	else
+		idx  = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id) + WM_DAC_ATTEN;
+	vol = wm_get(ice, idx) & 0x7f;
+	if (vol <= 0x1a)
+		ucontrol->value.integer.value[0] = 0;
+	else
+		ucontrol->value.integer.value[0] = vol - 0x1a;
+	up(&ice->gpio_mutex);
+
+	return 0;
+}
+
+static int wm_dac_vol_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+{
+	ice1712_t *ice = snd_kcontrol_chip(kcontrol);
+	int idx;
+	unsigned short ovol, nvol;
+	int change;
+
+	snd_ice1712_save_gpio_status(ice);
+	if (kcontrol->private_value)
+		idx = WM_DAC_MASTER_ATTEN;
+	else
+		idx  = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id) + WM_DAC_ATTEN;
+	nvol = ucontrol->value.integer.value[0] + 0x1a;
+	ovol = wm_get(ice, idx) & 0x7f;
+	change = (ovol != nvol);
+	if (change) {
+		if (nvol <= 0x1a && ovol <= 0x1a)
+			change = 0;
+		else
+			wm_put(ice, idx, nvol | 0x180); /* update on zero detect */
+	}
+	snd_ice1712_restore_gpio_status(ice);
+	return change;
+}
+
+/*
+ * ADC gain mixer control
+ */
+static int wm_adc_vol_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo)
+{
+	uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
+	uinfo->count = 1;
+	uinfo->value.integer.min = 0;		/* -12dB */
+	uinfo->value.integer.max = 0x1f;	/* 19dB */
+	return 0;
+}
+
+static int wm_adc_vol_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+{
+	ice1712_t *ice = snd_kcontrol_chip(kcontrol);
+	int idx;
+	unsigned short vol;
+
+	down(&ice->gpio_mutex);
+	idx  = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id) + WM_ADC_GAIN;
+	vol = wm_get(ice, idx) & 0x1f;
+	ucontrol->value.integer.value[0] = vol;
+	up(&ice->gpio_mutex);
+	return 0;
+}
+
+static int wm_adc_vol_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+{
+	ice1712_t *ice = snd_kcontrol_chip(kcontrol);
+	int idx;
+	unsigned short ovol, nvol;
+	int change;
+
+	snd_ice1712_save_gpio_status(ice);
+	idx  = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id) + WM_ADC_GAIN;
+	nvol = ucontrol->value.integer.value[0];
+	ovol = wm_get(ice, idx) & 0x1f;
+	change = (ovol != nvol);
+	if (change)
+		wm_put(ice, idx, nvol);
+	snd_ice1712_restore_gpio_status(ice);
+	return change;
+}
+
+/*
+ * ADC input mux mixer control
+ */
+static int wm_adc_mux_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo)
+{
+	static char *texts[] = {
+		"CD Left",
+		"CD Right",
+		"Line Left",
+		"Line Right",
+		"Aux Left",
+		"Aux Right",
+		"Mic Left",
+		"Mic Right",
+	};
+	uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
+	uinfo->count = 2;
+	uinfo->value.enumerated.items = 8;
+	if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items)
+		uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1;
+	strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
+	return 0;
+}
+
+static int wm_adc_mux_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t *ucontrol)
+{
+	ice1712_t *ice = snd_kcontrol_chip(kcontrol);
+	unsigned short val;
+
+	down(&ice->gpio_mutex);
+	val = wm_get(ice, WM_ADC_MUX);
+	ucontrol->value.integer.value[0] = val & 7;
+	ucontrol->value.integer.value[1] = (val >> 4) & 7;
+	up(&ice->gpio_mutex);
+	return 0;
+}
+
+static int wm_adc_mux_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t *ucontrol)
+{
+	ice1712_t *ice = snd_kcontrol_chip(kcontrol);
+	unsigned short oval, nval;
+	int change;
+
+	snd_ice1712_save_gpio_status(ice);
+	oval = wm_get(ice, WM_ADC_MUX);
+	nval = oval & ~0x77;
+	nval |= ucontrol->value.integer.value[0] & 7;
+	nval |= (ucontrol->value.integer.value[1] & 7) << 4;
+	change = (oval != nval);
+	if (change)
+		wm_put(ice, WM_ADC_MUX, nval);
+	snd_ice1712_restore_gpio_status(ice);
+	return 0;
+}
+
+/*
+ * mixers
+ */
+
+static snd_kcontrol_new_t prodigy71_dac_control __devinitdata = {
+	.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+	.name = "DAC Volume",
+	.count = 8,
+	.info = wm_dac_vol_info,
+	.get = wm_dac_vol_get,
+	.put = wm_dac_vol_put,
+};
+
+static snd_kcontrol_new_t wm_controls[] __devinitdata = {
+	{
+		.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+		.name = "Master Playback Volume",
+		.info = wm_dac_vol_info,
+		.get = wm_dac_vol_get,
+		.put = wm_dac_vol_put,
+		.private_value = 1,
+	},
+	{
+		.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+		.name = "ADC Volume",
+		.count = 2,
+		.info = wm_adc_vol_info,
+		.get = wm_adc_vol_get,
+		.put = wm_adc_vol_put,
+	},
+	{
+		.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+		.name = "Capture Route",
+		.info = wm_adc_mux_info,
+		.get = wm_adc_mux_get,
+		.put = wm_adc_mux_put,
+	},
+	PRODIGY_CON_HPAMP ,
+	PRODIGY_CON_DEEMP ,
+	PRODIGY_CON_OVERSAMPLING
+};
+
+
+static int __devinit prodigy_add_controls(ice1712_t *ice)
+{
+	unsigned int i;
+	int err;
+
+	err = snd_ctl_add(ice->card, snd_ctl_new1(&prodigy71_dac_control, ice));
+	if (err < 0)
+		return err;
+
+	for (i = 0; i < ARRAY_SIZE(wm_controls); i++) {
+		err = snd_ctl_add(ice->card, snd_ctl_new1(&wm_controls[i], ice));
+		if (err < 0)
+			return err;
+	}
+	return 0;
+}
+
+
+/*
+ * initialize the chip
+ */
+static int __devinit prodigy_init(ice1712_t *ice)
+{
+	static unsigned short wm_inits[] = {
+
+		/* These come first to reduce init pop noise */
+		0x1b, 0x000,		/* ADC Mux */
+		0x1c, 0x009,		/* Out Mux1 */
+		0x1d, 0x009,		/* Out Mux2 */
+
+		0x18, 0x000,		/* All power-up */
+
+		0x16, 0x022,		/* I2S, normal polarity, 24bit, high-pass on */
+		0x17, 0x006,		/* 128fs, slave mode */
+
+		0x00, 0,		/* DAC1 analog mute */
+		0x01, 0,		/* DAC2 analog mute */
+		0x02, 0,		/* DAC3 analog mute */
+		0x03, 0,		/* DAC4 analog mute */
+		0x04, 0,		/* DAC5 analog mute */
+		0x05, 0,		/* DAC6 analog mute */
+		0x06, 0,		/* DAC7 analog mute */
+		0x07, 0,		/* DAC8 analog mute */
+		0x08, 0x100,		/* master analog mute */
+
+		0x09, 0x7f,		/* DAC1 digital full */
+		0x0a, 0x7f,		/* DAC2 digital full */
+		0x0b, 0x7f,		/* DAC3 digital full */
+		0x0c, 0x7f,		/* DAC4 digital full */
+		0x0d, 0x7f,		/* DAC5 digital full */
+		0x0e, 0x7f,		/* DAC6 digital full */
+		0x0f, 0x7f,		/* DAC7 digital full */
+		0x10, 0x7f,		/* DAC8 digital full */
+		0x11, 0x1FF,		/* master digital full */
+
+		0x12, 0x000,		/* phase normal */
+		0x13, 0x090,		/* unmute DAC L/R */
+		0x14, 0x000,		/* all unmute */
+		0x15, 0x000,		/* no deemphasis, no ZFLG */
+
+		0x19, 0x000,		/* -12dB ADC/L */
+		0x1a, 0x000		/* -12dB ADC/R */
+
+	};
+
+	static unsigned short cs_inits[] = {
+		0x0441, /* RUN */
+		0x0100, /* no mute */
+		0x0200, /* */
+		0x0600, /* slave, 24bit */
+	};
+
+	unsigned int tmp;
+	unsigned int i;
+
+	printk(KERN_INFO "ice1724: AudioTrak Prodigy 7.1 driver rev. 0.82b\n");
+	printk(KERN_INFO "ice1724:   This driver is in beta stage. Forsuccess/failure reporting contact\n");
+	printk(KERN_INFO "ice1724:   Apostolos Dimitromanolakis <apostol@cs.utoronto.ca>\n");
+
+	ice->num_total_dacs = 8;
+
+	/* to remeber the register values */
+	ice->akm = snd_kcalloc(sizeof(akm4xxx_t), GFP_KERNEL);
+	if (! ice->akm)
+		return -ENOMEM;
+	ice->akm_codecs = 1;
+
+	snd_ice1712_gpio_set_dir(ice, 0xbfffff); /* fix this for the time being */
+
+	/* reset the wm codec as the SPI mode */
+	snd_ice1712_save_gpio_status(ice);
+	snd_ice1712_gpio_set_mask(ice,~( PRODIGY_WM_RESET|PRODIGY_WM_CS|
+		PRODIGY_CS8415_CS|PRODIGY_HP_AMP_EN ));
+
+	tmp = snd_ice1712_gpio_read(ice);
+	tmp &= ~PRODIGY_WM_RESET;
+	snd_ice1712_gpio_write(ice, tmp);
+	udelay(1);
+	tmp |= PRODIGY_WM_CS | PRODIGY_CS8415_CS;
+	snd_ice1712_gpio_write(ice, tmp);
+	udelay(1);
+	tmp |= PRODIGY_WM_RESET;
+	snd_ice1712_gpio_write(ice, tmp);
+	udelay(1);
+
+	/* initialize WM8770 codec */
+	for (i = 0; i < ARRAY_SIZE(wm_inits); i += 2)
+		wm_put(ice, wm_inits[i], wm_inits[i+1]);
+
+	/* initialize CS8415A codec */
+	for (i = 0; i < ARRAY_SIZE(cs_inits); i++)
+		prodigy_spi_write(ice, PRODIGY_CS8415_CS,
+				 cs_inits[i] | 0x200000, 24);
+
+
+	prodigy_set_headphone_amp(ice, 1);
+
+	snd_ice1712_restore_gpio_status(ice);
+
+	return 0;
+}
+
+/*
+ * Prodigy boards don't provide the EEPROM data except for the vendor IDs.
+ * hence the driver needs to sets up it properly.
+ */
+
+static unsigned char prodigy71_eeprom[] __devinitdata = {
+	0x2b,	/* SYSCONF: clock 512, mpu401, spdif-in/ADC, 4DACs */
+	0x80,	/* ACLINK: I2S */
+	0xf8,	/* I2S: vol, 96k, 24bit, 192k */
+	0xc3,	/* SPDIF: out-en, out-int, spdif-in */
+	0xff,	/* GPIO_DIR */
+	0xff,	/* GPIO_DIR1 */
+	0xbf,	/* GPIO_DIR2 */
+	0x00,	/* GPIO_MASK */
+	0x00,	/* GPIO_MASK1 */
+	0x00,	/* GPIO_MASK2 */
+	0x00,	/* GPIO_STATE */
+	0x00,	/* GPIO_STATE1 */
+	0x00,	/* GPIO_STATE2 */
+};
+
+/* entry point */
+struct snd_ice1712_card_info snd_vt1724_prodigy_cards[] __devinitdata = {
+	{
+		.subvendor = VT1724_SUBDEVICE_PRODIGY71,
+		.name = "Audiotrak Prodigy 7.1",
+		.chip_init = prodigy_init,
+		.build_controls = prodigy_add_controls,
+		.eeprom_size = sizeof(prodigy71_eeprom),
+		.eeprom_data = prodigy71_eeprom,
+	},
+	{ } /* terminator */
+};
--- diff/sound/pci/ice1712/prodigy.h	1970-01-01 01:00:00.000000000 +0100
+++ source/sound/pci/ice1712/prodigy.h	2004-02-09 10:39:58.000000000 +0000
@@ -0,0 +1,67 @@
+#ifndef __SOUND_PRODIGY_H
+#define __SOUND_PRODIGY_H
+
+/*
+ *   ALSA driver for VIA VT1724 (Envy24HT)
+ *
+ *   Lowlevel functions for Terratec PRODIGY cards
+ *
+ *	Copyright (c) 2003 Takashi Iwai <tiwai@suse.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
+ *
+ */      
+
+#define  PRODIGY_DEVICE_DESC 	       "{AudioTrak,Prodigy 7.1},"
+
+#define VT1724_SUBDEVICE_PRODIGY71	0x33495345	/* PRODIGY 7.1 */
+
+extern struct snd_ice1712_card_info  snd_vt1724_prodigy_cards[];
+
+/* GPIO bits */
+#define PRODIGY_CS8415_CS	(1 << 23)
+#define PRODIGY_CS8415_CDTO	(1 << 22)
+#define PRODIGY_WM_RESET	(1 << 20)
+#define PRODIGY_WM_CLK		(1 << 19)
+#define PRODIGY_WM_DATA		(1 << 18)
+#define PRODIGY_WM_RW		(1 << 17)
+#define PRODIGY_AC97_RESET	(1 << 16)
+#define PRODIGY_DIGITAL_SEL1	(1 << 15)
+// #define PRODIGY_HP_SEL		(1 << 14)
+#define PRODIGY_WM_CS		(1 << 12)
+
+#define PRODIGY_HP_AMP_EN	(1 << 14)
+
+
+/* WM8770 registers */
+#define WM_DAC_ATTEN		0x00	/* DAC1-8 analog attenuation */
+#define WM_DAC_MASTER_ATTEN	0x08	/* DAC master analog attenuation */
+#define WM_DAC_DIG_ATTEN	0x09	/* DAC1-8 digital attenuation */
+#define WM_DAC_DIG_MATER_ATTEN	0x11	/* DAC master digital attenuation */
+#define WM_PHASE_SWAP		0x12	/* DAC phase */
+#define WM_DAC_CTRL1		0x13	/* DAC control bits */
+#define WM_MUTE			0x14	/* mute controls */
+#define WM_DAC_CTRL2		0x15	/* de-emphasis and zefo-flag */
+#define WM_INT_CTRL		0x16	/* interface control */
+#define WM_MASTER		0x17	/* master clock and mode */
+#define WM_POWERDOWN		0x18	/* power-down controls */
+#define WM_ADC_GAIN		0x19	/* ADC gain L(19)/R(1a) */
+#define WM_ADC_MUX		0x1b	/* input MUX */
+#define WM_OUT_MUX1		0x1c	/* output MUX */
+#define WM_OUT_MUX2		0x1e	/* output MUX */
+#define WM_RESET		0x1f	/* software reset */
+
+
+#endif /* __SOUND_PRODIGY_H */
--- diff/sound/synth/emux/emux_hwdep.c	1970-01-01 01:00:00.000000000 +0100
+++ source/sound/synth/emux/emux_hwdep.c	2004-02-09 10:39:58.000000000 +0000
@@ -0,0 +1,171 @@
+/*
+ *  Interface for hwdep device
+ *
+ *  Copyright (C) 2004 Takashi Iwai <tiwai@suse.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 <sound/driver.h>
+#include <sound/core.h>
+#include <sound/hwdep.h>
+#include <asm/uaccess.h>
+#include "emux_voice.h"
+
+/*
+ * open the hwdep device
+ */
+static int
+snd_emux_hwdep_open(snd_hwdep_t *hw, struct file *file)
+{
+	return 0;
+}
+
+
+/*
+ * close the device
+ */
+static int
+snd_emux_hwdep_release(snd_hwdep_t *hw, struct file *file)
+{
+	return 0;
+}
+
+
+#define TMP_CLIENT_ID	0x1001
+
+/*
+ * load patch
+ */
+static int
+snd_emux_hwdep_load_patch(snd_emux_t *emu, void __user *arg)
+{
+	int err;
+	soundfont_patch_info_t patch;
+
+	if (copy_from_user(&patch, arg, sizeof(patch)))
+		return -EFAULT;
+
+	if (patch.type >= SNDRV_SFNT_LOAD_INFO &&
+	    patch.type <= SNDRV_SFNT_PROBE_DATA) {
+		err = snd_soundfont_load(emu->sflist, arg, patch.len + sizeof(patch), TMP_CLIENT_ID);
+		if (err < 0)
+			return err;
+	} else {
+		if (emu->ops.load_fx)
+			return emu->ops.load_fx(emu, patch.type, patch.optarg, arg, patch.len + sizeof(patch));
+		else
+			return -EINVAL;
+	}
+	return 0;
+}
+
+/*
+ * set misc mode
+ */
+static int
+snd_emux_hwdep_misc_mode(snd_emux_t *emu, void __user *arg)
+{
+	struct sndrv_emux_misc_mode info;
+	int i;
+
+	if (copy_from_user(&info, arg, sizeof(info)))
+		return -EFAULT;
+	if (info.mode < 0 || info.mode >= EMUX_MD_END)
+		return -EINVAL;
+
+	if (info.port < 0) {
+		for (i = 0; i < emu->num_ports; i++)
+			emu->portptrs[i]->ctrls[info.mode] = info.value;
+	} else {
+		if (info.port < emu->num_ports)
+			emu->portptrs[info.port]->ctrls[info.mode] = info.value;
+	}
+	return 0;
+}
+
+
+/*
+ * ioctl
+ */
+static int
+snd_emux_hwdep_ioctl(snd_hwdep_t * hw, struct file *file, unsigned int cmd, unsigned long arg)
+{
+	snd_emux_t *emu = snd_magic_cast(snd_emux_t, hw->private_data, return -ENXIO);
+
+	switch (cmd) {
+	case SNDRV_EMUX_IOCTL_VERSION:
+		return put_user(SNDRV_EMUX_VERSION, (unsigned int __user *)arg);
+	case SNDRV_EMUX_IOCTL_LOAD_PATCH:
+		return snd_emux_hwdep_load_patch(emu, (void __user *)arg);
+	case SNDRV_EMUX_IOCTL_RESET_SAMPLES:
+		snd_soundfont_remove_samples(emu->sflist);
+		break;
+	case SNDRV_EMUX_IOCTL_REMOVE_LAST_SAMPLES:
+		snd_soundfont_remove_unlocked(emu->sflist);
+		break;
+	case SNDRV_EMUX_IOCTL_MEM_AVAIL:
+		if (emu->memhdr) {
+			int size = snd_util_mem_avail(emu->memhdr);
+			return put_user(size, (unsigned int __user *)arg);
+		}
+		break;
+	case SNDRV_EMUX_IOCTL_MISC_MODE:
+		return snd_emux_hwdep_misc_mode(emu, (void __user *)arg);
+	}
+
+	return 0;
+}
+
+
+/*
+ * register hwdep device
+ */
+
+int
+snd_emux_init_hwdep(snd_emux_t *emu)
+{
+	snd_hwdep_t *hw;
+	int err;
+
+	if ((err = snd_hwdep_new(emu->card, SNDRV_EMUX_HWDEP_NAME, emu->hwdep_idx, &hw)) < 0)
+		return err;
+	emu->hwdep = hw;
+	strcpy(hw->name, SNDRV_EMUX_HWDEP_NAME);
+	hw->iface = SNDRV_HWDEP_IFACE_EMUX_WAVETABLE;
+	hw->ops.open = snd_emux_hwdep_open;
+	hw->ops.release = snd_emux_hwdep_release;
+	hw->ops.ioctl = snd_emux_hwdep_ioctl;
+	hw->exclusive = 1;
+	hw->private_data = emu;
+	if ((err = snd_card_register(emu->card)) < 0)
+		return err;
+
+	return 0;
+}
+
+
+/*
+ * unregister
+ */
+void
+snd_emux_delete_hwdep(snd_emux_t *emu)
+{
+	if (emu->hwdep) {
+		snd_device_free(emu->card, emu->hwdep);
+		emu->hwdep = NULL;
+	}
+}
--- diff/Documentation/networking/8139too.txt	2003-08-26 10:00:51.000000000 +0100
+++ source/Documentation/networking/8139too.txt	1970-01-01 01:00:00.000000000 +0100
@@ -1,449 +0,0 @@
-
-		"8139too" Fast Ethernet driver for Linux
-	 RTL-8139, -8129, and -8130 10/100 Fast Ethernet adapters
-
-	Copyright 2000,2001 Jeff Garzik <jgarzik@pobox.com>
-
-                http://sourceforge.net/projects/gkernel/
-
-
-	      Architectures supported (all PCI platforms):
-		    x86, Alpha AXP, PowerPC, Sparc64
-
-		    Kernel versions supported: 2.4.x
-
-
-
-Disclaimer
-----------
-
-DO NOT CONTACT DONALD BECKER FOR SUPPORT OF THIS DRIVER, his driver is
-completely different and maintained independently of the 8139too code base.
-
-
-
-Requirements
-------------
-Kernel 2.4.3 or later.
-A Fast Ethernet adapter containing an RTL8139-based chip.
-
-
-
-Introduction
-------------
-
-The "8139too" Fast Ethernet driver for Linux 2.4.0 is a substantial
-modification of the experimental rtl8139 driver from Donald Becker,
-some versions of which appeared in 2.2.x and 2.3.x kernels.  The
-RTL-8139 is a very low-cost Fast Ethernet chip, which makes it very
-popular.
-
-The step from 2.2.x to 2.4.x kernels brings many new features to Linux
-device drivers.  Features for MMIO resources, a standard hot-plug API,
-and other interfaces are now becoming requirements, as drivers move
-off the x86 platform.  With that in mind, I have begun updating the
-RTL-8139 driver to current 2.3.x (2.4) kernel standards and APIs, and
-fixing the problems that users have been encountering.
-
-
-
-Features of 8139too
--------------------
-[note - this list intended for people familiar with kernel drivers]
-
-** 100% MMIO, for full speed operation.  All users (so far) have
-reported performance increases over their existing RTL drivers.
-
-** Multi-platform support:  x86, Alpha, PPC, ...
-
-** Use proper SMP spinlocking, fixing SMP interrupt bugs, making the
-driver portable to non-x86 SMP platforms in the process.
-
-** Use new PCI driver API for seamless, low-maintenance hot-plug support
-
-** Several bugs fixes from original rtl8139 1.08r (October 5, 1999),
-including the very common "transmit timeout" problem.
-
-* Use new resource allocation API, required for hot-plug support
-* Use new register read/write macros
-* initcall support (module_init/exit)
-* vastly improved debug tracing support
-* code formatting in many places for readability
-* use new init_etherdev() facilities
-
-...and probably some other less important changes which I forgot.
-
-
-
-Installation
-------------
-
-OPTION 1: Build inside kernel tree (into kernel image, or as module)
-
-	(overwrite 8139too driver in kernel tree with different version)
-	1) cp 8139too.c $my_source_tree/drivers/net/8139too.c
-
-OPTION 2: Build outside kernel tree
-
-	Use the included Makefile.
-
-
-
-Tested Adapters
----------------
-AOpen ALN-325C
-AT-2500TX 10/100 PCI Fast Ethernet Network Adapter Card
-D-Link DFE-530TX
-Cnet CNF401 'SinglePoint' 10/100 Base-TX
-Genius GF 100TXR4 Fast Ethernet 10/100M PCI Network Card
-KTI KF-230TX
-KTI KF-230TX/2
-Lantech FastNet TX
-Ovislink Fast Ethernet
-Planet ENW-9504 (V.4) 10/100
-SDT Jeoun Fast PCI-TX
-SMC EZNET 10/100
-UNEX NexNIC ND012C
-
-(please add your adapter model to this list)
-
-
-
-Status of Platform Support
---------------------------
-
-(see errata below for details)
-
-x86:		tested, stable
-Alpha AXP:	tested, stable
-PowerPC:	tested, unstable
-Sparc64:	not tested
-
-
-
-Special Thanks
---------------
-The following people contributed invaluable testing time, feedback
-and/or patches during the development of this driver.  Thanks to all
-of them.
-
-Donald Becker, Alan Cox, Richard Stallman, Linus Torvalds - inspiration
-
-Alan Cox, Gerard Roudier - insight on posted MMIO writes
-
-Martin Mares - code review
-
-Tigran Aivazian - testing, code review, and a bug fix
-
-Chmouel Boudjnah, Alexander Dietrich, Oleg Drokin,
-James Fidell, Taso Hatzi, Peter K - intrepid test team
-
-And thanks to every supporter free software.
-
-(see top of 8139too.c for further credits and kudos)
-
-
-
-Submitting Bug Reports
-----------------------
-Obtain and compile the modified rtl8139-diag source code from the
-8139too driver Web site, http://sourceforge.net/projects/gkernel/
-This diagnostics programs, originally from Donald Becker, has been
-modified to display all registers on your RTL8139 chip, not just the
-first 0x80.
-
-If possible, send the output of a working and broken driver with
-	rtl8139-diag -mmaaavvveefN > my-output-file.txt
-
-Send "lspci -vvv" or "cat /proc/pci" output for PCI information.
-
-
-
-Known Bugs / Errata / To-Do
----------------------------
-The following issues are known, and are actively being pursued.  Patches
-to resolve these issues is welcome.  If a problem occurs which is not in
-the list, please report it.  That's why we do beta releases, after all...
-
-
-
-1) Work with Donald to merge fixes and updates into his driver.
-
-2) ETHTOOL_SSET support
-
-3) PPC platform has stability problems. (XXX: verify this is still true)
-
-4) Sparc64 platform not tested at all.
-
-8) Much improved command line / module parameter setup.  (patches and
-suggestions welcome)  (WIP)
-
-9) Better documentation.  (patches welcome)
-
-12) 10base-T support flaky or slow (todo: verify this is still true)
-
-
-
-
-Change History
---------------
-
-Version 0.9.26 - August 9, 2002
-
-* Fix MII ioctl phy id corruption.
-* Fix big-endian multicast bug.
-* Support register dumps via ethtool.
-* Fix several uses of 'len' after potential skb free, in dev->hard_start_xmit
-* Replace several "magic numbers" with their proper representation
-  constants in linux/mii.h.
-* Support ethtool media interface via generic kernel MII API
-* Export NIC-specific statistics via ethtool.
-* Proper support for RTL8139 rev K. (can be disabled via
-  compile-time conditional)
-* Add PCI ids for new 8139 boards.
-* Use ethernet crc via generic linux/crc32.h kernel API.
-* Better RX reset.  Old rx-reset method still available via
-  a compile-time conditional.
-* Only account specific RX errors if rx_status is !OK
-
-
-Version 0.9.22 - November 8, 2001
-
-* Additional retries before aborting Tx
-* Do not write other TxConfig bits when writing clear-abort bit.
-* Ack TxErr intr status after each Tx abort, too.
-* Fix oops in interface restart
-
-
-Version 0.9.21 - November 1, 2001
-
-* Disable early Rx, it hurts performance and creates races.
-* Remove DPRINTK macro function tracing.
-* Better interrupt sharing behavior.
-* Acknowledge PCI errors.
-* Remove early-Rx acknowledgement, unnecessary
-* Remove code for uncommon case where Tx packets are
-  properly aligned, and do not need to be copied.
-  Tx packets are now always copied into a static DMA buffer,
-  which is allocated at interface open.
-* Fix problems with kernel thread exit.
-
-
-Version 0.9.20 - October 18, 2001
-
-* Print out notice when 8139C+ chip is detected
-* Add id for D-Link DFE690TXD pcmcia cardbus card (Gert Dewit)
-
-
-Version 0.9.19 - October 9, 2001
-
-* Eliminate buffer copy for unaligned Tx's (manfred)
-* Better RX error recovery (manfred)
-* Wake-On-LAN and ETHTOOL_GSET support (Kalle Niemitalo)
-* Fix assertion in PIO mode (various)
-
-
-Version 0.9.18 - July 6, 2001
-
-* Fix race leading to crashes on some machines.
-* Minimize race leading to low performance.
-* Correct interrupt acknowledgement to cover all three
-  relevant Rx events.
-* Add ethtool driver info support.
-* Collect additional driver-internal statistics.
-* Add descriptions for module parameters.
-* Support new SIOCxMIIxxx ioctls added in kernel 2.4.6.
-* Multicast filter big endian fix.
-* Support new PCI PM API added in kernel 2.4.6.
-
-
-Version 0.9.17 - May 7, 2001
-
-* Fix chipset wakeup bug which prevent media connection for 8139B
-* Print out "media is unconnected..." instead of
-  "partner ability 0000"
-
-
-Version 0.9.16 - April 14, 2001
-
-* Complete MMIO audit, disable read-after-every-write
-* Update Rx interrupt handling
-* Enable Early Rx thresholds, highly recommended to reduce
-  Rx FIFO overflow
-* Make 8129 support conditional
-* Support for new 2.4.3 kernel APIs
-* More correct PIO/MMIO PCI BAR region size checking
-* Add check for totally dead/missing hardware
-* Disable media timer code to "set full duplex"
-* s/spin_lock_irq/spin_lock_irqsave/
-* Only set AcceptMulticast if more than one mc address
-* Only set rx_mode if changed, in set_rx_mode
-* Only suspend/resume if interface is up
-* Always print out version upon module load, even if no devices found
-
-
-Version 0.9.15 - February 20, 2001
-
-* Call pci_enable_device to wake up/assign resource to device,
-  before actually using it.
-* Support wacky clone PCI ids (report from Norival Toniato Junior)
-* Text spelling corrections
-* Make sure tp->phys[] is signed
-* Always wake queue after hw restart, in tx_timeout
-* Record time of last received packet
-
-
-Version 0.9.14 - January 11, 2001
-
-* Merge some changes from Becker version 1.13:
-	* Add DFE 538TX PCI id
-	* MII read/write functions updated
-	* Cfg93[45]6 lock/unlock fix
-	* RTL-8129 (MII) support
-* Clean up spinlocking
-
-
-Version 0.9.13 - December, 2000
-
-* Clear blocked signals, avoid buffer overrun setting current->comm
-* Remove bogus PCI BAR length assertions
-* Remove unused 'debug' module parameter
-
-
-Version 0.9.12 - November 23, 2000
-
-* Kill major Tx stop/wake queue race
-* Use SET_MODULE_OWNER and fix module unload race
-* Fix cable length ("Twister") tuning
-* Proper media[] array length checking
-* Replace timer with kernel thread for twister tuning state machine
-  and media checking.  Fixes mdio_xxx locking, now mdio_xxx is always
-  protected by rtnl_lock semaphore.
-* Correct some sledgehammer a.k.a. overzealous spin-locks
-* Performance: Eliminate atomic_t for Tx counters, we don't need it
-* Performance: Don't copy Tx buffer if the rare case occurs where it
-  is aligned perfectly for us.
-* Eliminate needless casting of dev->priv
-* PIO mode selection and Twister tuning are now CONFIG_xxx options
-  (though purposefully not in net/Config.in... yet)
-
-
-Version 0.9.11 - October 28, 2000
-
-* Do not fail when PIO and MMIO region lengths do not match.
-  (They don't on some CardBus models, at least)
-* Sanity check Rx packet status and size (Tobias)
-* When handling a Tx timeout, disable Tx ASAP if not already.
-* Do not inline Tx interrupt handler (better register usage)
-* Handle dirty_tx signed integer wrap
-* Do not abort Rx processing on lack of memory, keep going
-  until the current Rx ring is completely handling. (Tobias)
-* Clean up rtl8139_close
-* Whitespace correction for dev_kfree_skb_irq call
-
-
-Version 0.9.10 - September 12, 2000
-
-* Never wrap an Rx packet (faster Rx interrupt handling)
-* Clear all TxAborted conditions (bug fix)
-* Correct copyright
-* More credits
-* Update NWay doc URL
-* Clean up commonly used ifdef switches
-* Reorg info displayed at bootup/modprobe time
-* Remove some unneeded spinlocks
-* Misc cosmetic code cleanup
-* Always print interrupt status for abnormal interrupts
-* Use RealTek-recommended FIFO and DMA burst settings (1024 bytes)
-
-
-Version 0.9.9 - September 9, 2000
-
-* Fix oops-able bug in Rx ring wrap calculation (David Ford)
-* Use PIO instead of MMIO when USE_IO_OPS is defined
-* Move Rx error handling out of Rx interrupt handler, resulting in
-  tighter Rx interrupt processing
-
-
-Version 0.9.8 - September 7, 2000
-
-* Propagate request_irq error value (andrew morton)
-* Correct potential oops bug in PCI DMA unmap code
-* Fix bugs related to counting/discounting of 32-bit CRC in each Rx packet
-* Fix 16/32-bit bug in interrupt status check
-* Timer cleanups (andrew morton)
-
-
-Version 0.9.7 - June 11, 2000
-
-* Fix support for older chips (RTL8139 early chips should now work again)
-
-
-Version 0.9.6 - May 30, 2000
-
-* Fix 4-extra-bytes bug
-  (thanks to Markus Westergren, via Santiago Garcia Mantinan)
-* Yet more improved chip recognition
-
-
-Version 0.9.5 - May 17, 2000
-
-* Improved chip version recognition
-* Continue banging away at receiver hang problem
-* Use spin_lock_irq in another spot
-* Don't print anything on pci_enable_device, it does so for us
-* Disable buggy NWay code
-* Define TxConfig bitmasks
-
-
-Version 0.9.4.1 - April 27, 2000 - third public beta release
-
-* Replace several "magic numbers" with symbolic constants
-* Differentiate between board-specific info and chip-specific info
-  (allows for easier support of specific boards or chips)
-* Move some of the transmit side outside of the spinlock
-  by using atomic variables.  Use spin_lock_irq instead of
-  spin_lock_irq{save,restore} in select places, for better performance.
-* New module option "media" for forcing media selection.  Functions the
-  same as "options" in other drivers, and will soon be renamed
-  'options' to be homogeneous.
-* New power management wake-up code
-* Slightly more verbose chip id messages in kernel log
-* Add/correct chip register constant list
-* New chipset wake up (open) logic
-* No longer locks CONFIGx updates
-* Do not set Interfame Gap (IFG) bits in TxConfig
-* Better Rx reset logic in case of Rx FIFO Overflow
-* For chips which support it, enable bit to automatically clear Rx
-  FIFO overflow
-* No longer enable and disable interrupts in interrupt handler
-  (technique borrowed from BSD driver, appears to have problems
-   with some chips)
-* H/W spinlock now protects ioctl
-* Chipset-dependent RxConfig settings
-
-
-Version 0.9.3.3.2 - Feb 22, 2000 - second public beta release
-
-* Begin integration of Daniel Kobras' MMIO flush patch (disabled for now)
-* Softnet logic updates to fix bugs and improve performance
-* Dynamic sizing of I/O resources (0x80 for older chips, 0xFF for newer ones)
-* Remove bogus SiS entries from PCI probe table
-* Add support for cards
-	"Delta Electronics 8139 10/100BaseTX"
-	"Addtron Technolgy 8139 10/100BaseTX"
-* Fix major bug with rx ring buffer size (also present in rtl8139.c 1.08r)
-* PCI DMA mapping by Dave Miller
-* Complete rewrite of SMP locking logic
-* Hotplug support
-* Call rtl8139_hw_start from rtl8139_open, and remove duplicated code
-  from rtl8139_open
-* Reset NWay registers to sane defaults on rtl8139_open/hw_start
-* Miscellaneous code cleanup
-
-
-Version 0.7.0 - Feb 7, 2000 - first public beta release
-* Initial public version, derived from Donald Becker's rtl8139.c v1.08r
-
-[EOF]
-
--- diff/Documentation/scsi/AM53C974.txt	2002-11-18 10:11:54.000000000 +0000
+++ source/Documentation/scsi/AM53C974.txt	1970-01-01 01:00:00.000000000 +0100
@@ -1,246 +0,0 @@
-SUBJECT
--------
-AM53/79C974 PC-SCSI Driver
-
-
-DISCLAIMER
-----------
-***  THIS SHOULD BE CONSIDERED AS BETA SOFTWARE  ***
-***  USE AT YOUR OWN RISK!                       ***
-
-
-Copyright
----------
-The architecture and much of the code of this device driver was 
-originally developed by Drew Eckhardt for the NCR5380. The 
-following copyrights apply:
-
-For the architecture and all pieces of code which can also be found 
-in the NCR5380 device driver:
-Copyright 1993, Drew Eckhardt
-  Visionary Computing 
-  (Unix and Linux consulting and custom programming)
-  drew@colorado.edu
-  +1 (303) 666-5836
- 
-The AM53C974_nobios_detect code was originally developed by
-Robin Cutshaw (robin@xfree86.org) and is used here in a 
-slightly modified form.
- 
-For the remaining code:
-  Copyright 1994, D. Frieauff
-  EMail: fri@rsx42sun0.dofn.de
-  Phone: x49-7545-8-2256 , x49-7541-42305
-
-
-Version
--------
-AM53/79C974 (PC-SCSI) Linux driver ALPHA release 0.5, 19 November 1995
-
-
-Changelog
----------
-0.1 -> 0.2: 
-  - Extended message handling re-written to eliminate 'invalid message 17' bug
-  - Parameters of AM53C974_intr adapted
-  - Debug messages structured
-  - Spelling improved
-0.2 -> 0.3:
-  - README file updated -- please read this file up to the end!
-  - Automatic scanning of io_port and irq implemented; no need for BIOS32 
-    anymore
-  - Improved configuration (now via LILO parameter string)
-  - Cleanup of probing and initialization code
-  - Improved sync. negotiation (can be setup individually for every device)
-  - Improved/ debugged code for reception of ext. messages
-0.3 -> 0.4:
-  - Improved PCI probing and initialization code
-  - Compatibility changes for Linux 1.3.x
-0.4 -> 0.5:
-  - Compatibility changes for Linux 1.3.42
-
-
-Bugs & Todo
------------
- - Add proc info function
- - Support SCSI-2 tagged queuing
- - Finalize abort code 
-
-
-Features
---------
-This driver supports asynchronous and synchronous SCSI-I and SCSI-II
-devices.  It is capable of transfer rate and synchronous negotiation
-(see below).  The driver supports scatter-gather.  Transfers are DMA
-based, but do not (yet) make use of the AM53/79C974 MDL mode.
-Max. transfer rate is 10MHz (whatever this is in real life).  The
-transfer rate is negotiated with each device (see dmesg output).  The
-AM53/79C974 has a 96-byte DMA FIFO to the PCI bus and a 16-byte SCSI
-FIFO.  It provides active negation and glitch suppression functions.
-Burst DMA transfer rate is 132 MBytes/sec.
-
-
-Configuration
--------------
-
-The following communication characteristics can be set individually
-for every SCSI device on the bus:
-
-  - enable/disable sync. negotiation
-  - transfer rate
-  - asynchronous or synchronous communication
-  - in case of sync. communication, the sync. offset
-
-The sync. offset specifies the number of bytes that can be sent or 
-received from the SCSI bus without ACK resp. REQ signal.
-CAUTION: USING SYNCHRONOUS MODE ON LONG SCSI CABLES MAY CAUSE 
-         COMMUNICATION PROBLEMS LEADING TO LOSS OF DATA. 
-
-The default setting of the SCSI communication parameters is as follows:
-  - no negotiation
-  - 5.0 MHz transfer rate
-  - asynchronous mode
-  - zero offset
-
-The parameters can be modified by passing a string with the following
-syntax to the kernel:
-
-	AM53C974=host-scsi-id,target-scsi-id,max-rate,max-offset
-
-The parameters will be used by the driver as negotiation basis.  The
-range of the rate parameter is 3 to 10 MHz.  The range of the
-sync. offset parameter is 0 to 15 bytes. A value of 0 denotes
-asynchronous comm. mode.  If the target cannot cope with the specified
-transfer rate, sync. mode or sync.  offset, the negotiation result
-will differ from the specified values.  The negotiation result is
-printed out at the end of the negotiation process (to read it, use the
-dmesg program or the appropriate syslog).  The parameter strings
-(blank separated) can be passed to the kernel at the LILO prompt, or
-as part of the LILO configuration file.
-
-For example, the string "AM53C974=7,2,8,15" would be interpreted as
-follows:
-
-For communication between the controller with SCSI-ID 7 and the
-device with SCSI-ID 2 a transfer rate of 8MHz in synchronous mode with
-max. 15 bytes offset should be negotiated.
-
-As an example, here my LILO configuration file:
-  boot = /dev/sda
-  compact
-  #prompt
-  delay = 50	# optional, for systems that boot very quickly
-  vga = normal	# force sane state
-  ramdisk = 0	# paranoia setting
-  root = current  # use "current" root
-  image = /usr/src/linux/arch/i386/boot/zImage
-    label = linux
-    append = "AM53C974=7,0,10,0 AM53C974=7,1,10,0 AM53C974=7,2,10,15 AM53C974=7,4,10,0 AM53C974=7,5,10,0"
-    read-only
-  other = /dev/sda4
-    label = os2
-  other = /dev/sdb3
-    loader = /boot/any_d.b
-    table = /dev/sdb
-    label = setup
-
-The same parameters at the LILO prompt:
-
-  LILO boot: linux AM53C974=7,0,10,0 AM53C974=7,1,10,0 AM53C974=7,2,10,15 AM53C974=7,4,10,0 AM53C974=7,5,10,0
-
-You can override parameters specified in the LILO configuration file
-by parameters specified on the LILO command line.
-
-
-BIOS usage
-----------
-Version 0.4 of the driver will use the BIOS, if available. Otherwise
-it will try its internal PCI scan and access routines.  The driver
-assumes that the controller's SCSI-ID (usually 7) has been correctly
-loaded by the BIOS into the controller's register during system
-boot. If the driver detects that the controller's SCSI ID is not '7'
-it will print out a warning. If this happens to you please correct
-setting of the controller's SCSI-ID. If it is wrong, then edit the
-AM53C974_SCSI_ID definition in file AM53C974.h accordingly.
-
-
-Test environment
-----------------
-This driver was tested on a Compaq XL566 with the following SCSI configuration:
-2 x HP C2247 fixed disk (internal, rate=10MHz, async.)
-1 x Micropolis 1624 fixed disk (external, rate=8MHz, sync., offset=15 bytes)
-1 x Wangtek W5525ES cartridge streamer (internal, rate=5MHz, async.)
-1 x Toshiba XM-3301B CD-ROM (external, rate=5MHz, async.)
-
-
-Known problems
---------------
- - Compaq/Matsushita CD-ROM:
-   Use of this device with AM53C974 driver version 0.2 caused the kernel to
-   hang during Linux boot. If you encounter the problem, don't enable sync.
-   negotiation with the CD-ROM, i.e. simply don't specify comm. parameters 
-   for this device on the LILO command line or configuration file. 
-   The driver will thus use its default for the CD-ROM, which is 5MHz 
-   transfer rate async and no sync. negotiation.
- - Some disks cause problems.
-
-
-What to do if there is a SCSI problem possibly related to the driver
---------------------------------------------------------------------
-
-Read Klaus Liedl's WWW page (http://www-c724.uibk.ac.at/XL/).  In case
-this does not help: Send me a complete description of the problem,
-including your SCSI configuration plus as much debugging information
-as possible.  Don't wait until I ask you for this information. To
-enable the generation of debugging output, remove the comments from
-the following definitions in the AM53C974.h file:
-
-    AM53C974_DEBUG
-    AM53C974_DEBUG_MSG
-    AM53C974_DEBUG_KEYWAIT
-    AM53C974_DEBUG_INFO
-    AM53C974_DEBUG_INTR
-
-With these definitions enabled, the driver will enter single-step mode
-during Linux boot. Use the spacebar for stepping.  Take note of at
-least the last 10 printout sections (marked by dashes) before the
-crash/hangup or whatever happens and send me all of this information
-via email. If the system can boot, use the syslogd daemon to record
-the debugging output. Maybe you can use the ramdisk for this purpose
-too (if necessary, kindly ask K. Liedl (Klaus.Liedl@uibk.ac.at) for
-support, he knows how to do it -- I never tried). Stay in email
-contact with me. Be aware that the following weeks/months could be the
-worst of your life.  Note: If single-stepping takes up too much time,
-you can try to let the driver catch the problem by pressing the 'r'
-key. The driver will automatically enter single-step mode if it has
-detected something weird.
-
-
-Author's Contact Address
------------------------
-Email: fri@rsx42sun0.dofn.de
-Phone: x49-7545-2256 (office), x49-7541-42305 (home)
-Home address: D. Frieauff, Stockerholzstr. 27, 88048 Friedrichshafen, Germany
-
-
-!!!! Important Notice !!!!
------------------------------
-- Klaus Liedl maintains an excellent WWW page about Linux on Compaq XL.
-  It includes an FAQ, lots of tips & tricks as well as downloadable 
-  boot disk images. The URL is: http://www-c724.uibk.ac.at/XL/
-- Volunteer wanted for further maintenance of this driver software. I
-  don't have the time anymore to do serious support as some of you will know.
-
-
-Literature
-----------
- - AMD AM53C974 PC-SCSI Technical Manual, publication #18624B
- - Amendment to the AMD AM53C974 PC-SCSI Technical Manual
- - AMD AM79C974 PC-NET Datasheet, publication #18681
- - Amendment to the AMD AM79C974 PC-NET Datasheet
-
-
-THANKS to
----------
- - Drew Eckhardt, Robin Cutshaw, K. Liedl, Robert J. Pappas, A. Grenier, 
-   Mark Stockton, David C. Niemi, Ben Craft, and many others who have helped
--- diff/drivers/base/memblk.c	2003-09-17 12:28:03.000000000 +0100
+++ source/drivers/base/memblk.c	1970-01-01 01:00:00.000000000 +0100
@@ -1,43 +0,0 @@
-/*
- * drivers/base/memblk.c - basic Memory Block class support
- */
-
-#include <linux/module.h>
-#include <linux/init.h>
-#include <linux/memblk.h>
-#include <linux/node.h>
-#include <linux/topology.h>
-
-
-static struct sysdev_class memblk_class = {
-	set_kset_name("memblk"),
-};
-
-/*
- * register_memblk - Setup a driverfs device for a MemBlk
- * @num - MemBlk number to use when creating the device.
- *
- * Initialize and register the MemBlk device.
- */
-int __init register_memblk(struct memblk *memblk, int num, struct node *root)
-{
-	int error;
-
-	memblk->node_id = memblk_to_node(num);
-	memblk->sysdev.cls = &memblk_class,
-	memblk->sysdev.id = num;
-
-	error = sys_device_register(&memblk->sysdev);
-	if (!error) 
-		error = sysfs_create_link(&root->sysdev.kobj,
-					  &memblk->sysdev.kobj,
-					  kobject_name(&memblk->sysdev.kobj));
-	return error;
-}
-
-
-int __init register_memblk_type(void)
-{
-	return sysdev_class_register(&memblk_class);
-}
-postcore_initcall(register_memblk_type);
--- diff/drivers/input/misc/gsc_ps2.c	2003-07-22 18:54:27.000000000 +0100
+++ source/drivers/input/misc/gsc_ps2.c	1970-01-01 01:00:00.000000000 +0100
@@ -1,712 +0,0 @@
-/*
- * drivers/input/misc/gsc_ps2.c
- *
- * Copyright (c) 2002 Laurent Canet <canetl@esiee.fr>
- * Copyright (c) 2002 Thibaut Varene <varenet@esiee.fr>
- *
- * Pieces of code 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 Keyboard, found in PA/RISC Workstations
- * very similar to AT keyboards, but without i8042
- *
- * 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.
- *
- * 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.
- * 
- * STATUS:
- * 11/09: lc: Only basic keyboard is supported, mouse still needs to be done.
- * 11/12: tv: switching iomapping; cleaning code; improving module stuff.
- * 11/13: lc & tv: leds aren't working. auto_repeat/meta are. Generaly good behavior.
- * 11/15: tv: 2AM: leds ARE working !
- * 11/16: tv: 3AM: escaped keycodes emulation *handled*, some keycodes are
- *	  still deliberately ignored (18), what are they used for ?
- * 11/21: lc: mouse is now working
- * 11/29: tv: first try for error handling in init sequence
- *
- * TODO:
- * Error handling in init sequence
- * SysRq handling
- * Pause key handling
- * Intellimouse & other rodents handling (at least send an error when
- * such a mouse is plugged : it will totally fault)
- * Mouse: set scaling / Dino testing
- * Bug chasing...
- *
- */
-
-#include <linux/input.h>
-#include <linux/module.h>
-#include <linux/init.h>
-#include <linux/ptrace.h>       /* interrupt.h wants struct pt_regs defined */
-#include <linux/interrupt.h>
-#include <linux/sched.h>        /* for request_irq/free_irq */        
-#include <linux/spinlock.h>
-#include <linux/delay.h>
-#include <linux/ioport.h>
-#include <linux/kd.h>
-#include <linux/pci_ids.h>
-
-#include <asm/irq.h>
-#include <asm/io.h>
-#include <asm/parisc-device.h>
-
-/* Debugging stuff */
-#undef KBD_DEBUG
-#ifdef KBD_DEBUG
-	#define DPRINTK(fmt,args...) printk(KERN_DEBUG __FILE__ ":" fmt, ##args)
-#else 
-	#define DPRINTK(x,...)
-#endif
-
-
-/* 
- * Driver constants
- */
-
-/* PS/2 keyboard and mouse constants */
-#define AUX_RECONNECT		0xAA	/* PS/2 Mouse end of test successful */
-#define AUX_REPLY_ACK		0xFA
-#define AUX_ENABLE_DEV		0xF4	/* Enables aux device */
-
-/* Order of the mouse bytes coming to the host */
-#define PACKET_X		1
-#define PACKET_Y		2
-#define PACKET_CTRL		0
-
-#define GSC_MOUSE_OFFSET	0x0100	/* offset from keyboard to mouse port */
-#define GSC_DINO_OFFSET		0x800	/* offset for DINO controller versus LASI one */
-
-#define GSC_ID			0x00	/* ID and reset port offsets */
-#define GSC_RESET		0x00
-#define GSC_RCVDATA		0x04	/* receive and transmit port offsets */
-#define GSC_XMTDATA		0x04
-#define GSC_CONTROL		0x08	/* see: control register bits */
-#define GSC_STATUS		0x0C	/* see: status register bits */
-
-/* Control register bits */
-#define GSC_CTRL_ENBL		0x01	/* enable interface */
-#define GSC_CTRL_LPBXR		0x02	/* loopback operation */
-#define GSC_CTRL_DIAG		0x20	/* directly control clock/data line */
-#define GSC_CTRL_DATDIR		0x40	/* data line direct control */
-#define GSC_CTRL_CLKDIR		0x80	/* clock line direct control */
-
-/* Status register bits */
-#define GSC_STAT_RBNE		0x01	/* Receive Buffer Not Empty */
-#define GSC_STAT_TBNE		0x02	/* Transmit Buffer Not Empty */
-#define GSC_STAT_TERR		0x04	/* Timeout Error */
-#define GSC_STAT_PERR		0x08	/* Parity Error */
-#define GSC_STAT_CMPINTR	0x10	/* Composite Interrupt */
-#define GSC_STAT_DATSHD		0x40	/* Data Line Shadow */
-#define GSC_STAT_CLKSHD		0x80	/* Clock Line Shadow */
-
-/* Keycode map */
-#define KBD_ESCAPE0		0xe0
-#define KBD_ESCAPE1		0xe1
-#define KBD_RELEASE		0xf0
-#define KBD_ACK			0xfa
-#define KBD_RESEND		0xfe
-#define KBD_UNKNOWN		0
-
-#define KBD_TBLSIZE		512
-
-/* Mouse */
-#define MOUSE_LEFTBTN		0x1
-#define MOUSE_MIDBTN		0x4
-#define MOUSE_RIGHTBTN		0x2
-#define MOUSE_ALWAYS1		0x8
-#define MOUSE_XSIGN		0x10
-#define MOUSE_YSIGN		0x20
-#define MOUSE_XOVFLOW		0x40
-#define MOUSE_YOVFLOW		0x80
-
-/* Remnant of pc_keyb.h */
-#define KBD_CMD_SET_LEDS	0xED	/* Sets keyboard leds */
-#define KBD_CMD_SET_RATE	0xF3	/* Sets typematic rate */
-#define KBD_CMD_ENABLE		0xF4	/* Enables scanning */
-#define KBD_CMD_DISABLE		0xF5
-#define KBD_CMD_RESET		0xFF
-
-static unsigned char hpkeyb_keycode[KBD_TBLSIZE] =
-{
-	/* 00 */  KBD_UNKNOWN,  KEY_F9,        KBD_UNKNOWN,   KEY_F5,        KEY_F3,        KEY_F1,       KEY_F2,        KEY_F12,
-	/* 08 */  KBD_UNKNOWN,  KEY_F10,       KEY_F8,        KEY_F6,        KEY_F4,        KEY_TAB,      KEY_GRAVE,     KBD_UNKNOWN,
-	/* 10 */  KBD_UNKNOWN,  KEY_LEFTALT,   KEY_LEFTSHIFT, KBD_UNKNOWN,   KEY_LEFTCTRL,  KEY_Q,        KEY_1,         KBD_UNKNOWN,
-	/* 18 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KEY_Z,         KEY_S,         KEY_A,         KEY_W,        KEY_2,         KBD_UNKNOWN,
-	/* 20 */  KBD_UNKNOWN,  KEY_C,         KEY_X,         KEY_D,         KEY_E,         KEY_4,        KEY_3,         KBD_UNKNOWN,
-	/* 28 */  KBD_UNKNOWN,  KEY_SPACE,     KEY_V,         KEY_F,         KEY_T,         KEY_R,        KEY_5,         KBD_UNKNOWN,
-	/* 30 */  KBD_UNKNOWN,  KEY_N,         KEY_B,         KEY_H,         KEY_G,         KEY_Y,        KEY_6,         KBD_UNKNOWN,
-	/* 38 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KEY_M,         KEY_J,         KEY_U,         KEY_7,        KEY_8,         KBD_UNKNOWN,
-	/* 40 */  KBD_UNKNOWN,  KEY_COMMA,     KEY_K,         KEY_I,         KEY_O,         KEY_0,        KEY_9,         KBD_UNKNOWN,
-	/* 48 */  KBD_UNKNOWN,  KEY_DOT,       KEY_SLASH,     KEY_L,         KEY_SEMICOLON, KEY_P,        KEY_MINUS,     KBD_UNKNOWN,
-	/* 50 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KEY_APOSTROPHE,KBD_UNKNOWN,   KEY_LEFTBRACE, KEY_EQUAL,    KBD_UNKNOWN,   KBD_UNKNOWN,
-	/* 58 */  KEY_CAPSLOCK, KEY_RIGHTSHIFT,KEY_ENTER,     KEY_RIGHTBRACE,KBD_UNKNOWN,   KEY_BACKSLASH,KBD_UNKNOWN,   KBD_UNKNOWN,
-	/* 60 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KEY_BACKSPACE, KBD_UNKNOWN,
-	/* 68 */  KBD_UNKNOWN,  KEY_KP1,       KBD_UNKNOWN,   KEY_KP4,       KEY_KP7,       KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
-	/* 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,   KEY_F7,        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_ESCAPE0,  KBD_ESCAPE1,   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_RELEASE,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
-	/* f8 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_ACK,       KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_RESEND,    KBD_UNKNOWN,
-/* These are offset for escaped keycodes */
-	/* 00 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
-	/* 08 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   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_RELEASE,  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
-};
-
-
-/* Keyboard struct */
-static struct {
-	struct input_dev dev;
-	char * addr;
-	unsigned int irq;
-	unsigned int scancode;
-	unsigned int escaped;
-	unsigned int released;
-	unsigned int initialized;
-}
-hpkeyb = {
-	.escaped = 0,
-	.released = 0,
-	.initialized = 0
-};
-
-/* Mouse struct */
-static struct {
-   	struct input_dev dev;
-	char * addr;
-	unsigned long irq;
-	unsigned long initialized;
-	int nbread;
-	unsigned char bytes[3];
-	unsigned long last;
-}
-hpmouse = {
-	.initialized = 0,
-	.nbread = 0
-};
-
-static spinlock_t gscps2_lock = SPIN_LOCK_UNLOCKED;
-
-
-/*
- * Various HW level routines
- */
-
-#define gscps2_readb_input(x)		readb(x+GSC_RCVDATA)
-#define gscps2_readb_control(x)		readb(x+GSC_CONTROL)
-#define gscps2_readb_status(x)		readb(x+GSC_STATUS)
-#define gscps2_writeb_control(x, y)	writeb(x, y+GSC_CONTROL)
-
-static inline void gscps2_writeb_output(u8 val, char * addr)
-{
-	int wait = 250;			/* Keyboard is expected to react within 250ms */
-
-	while (gscps2_readb_status(addr) & GSC_STAT_TBNE) {
-		if (!--wait)
-			return;		/* This should not happen */
-		mdelay(1);
-	}
-	writeb(val, addr+GSC_XMTDATA);
-}
-
-static inline unsigned char gscps2_wait_input(char * addr)
-{
-	int wait = 250;			/* Keyboard is expected to react within 250ms */
-
-	while (!(gscps2_readb_status(addr) & GSC_STAT_RBNE)) {
-		if (!--wait)
-			return 0;	/* This should not happen */
-		mdelay(1);
-	}
-	return gscps2_readb_input(addr);
-}
-
-static int gscps2_writeb_safe_output(u8 val)
-{
-	/* This function waits for keyboard's ACK */
-	u8 scanread = KBD_UNKNOWN;
-	int loop = 5;
-	
-	while (hpkeyb_keycode[scanread]!=KBD_ACK && --loop > 0) {	
-		gscps2_writeb_output(val, hpkeyb.addr);
-		mdelay(5);
-		scanread = gscps2_wait_input(hpkeyb.addr);
-	}
-	
-	if (loop <= 0)
-		return -1;
-	
-	return 0;
-}
-
-/* Reset the PS2 port */
-static void __init gscps2_reset(char * addr)
-{
-	/* reset the interface */
-	writeb(0xff, addr+GSC_RESET);
-	writeb(0x0 , addr+GSC_RESET);
-
-	/* enable it */
-	gscps2_writeb_control(gscps2_readb_control(addr) | GSC_CTRL_ENBL, addr);
-}
-
-
-/**
- * gscps2_kbd_docode() - PS2 Keyboard basic handler
- *
- * Receives a keyboard scancode, analyses it and sends it to the input layer.
- */
-
-static void gscps2_kbd_docode(struct pt_regs *regs)
-{
-	int scancode = gscps2_readb_input(hpkeyb.addr);
-	DPRINTK("rel=%d scancode=%d, esc=%d ", hpkeyb.released, scancode, hpkeyb.escaped);
-
-	/* Handle previously escaped scancodes */
-	if (hpkeyb.escaped == KBD_ESCAPE0)
-		scancode |= 0x100;	/* jump to the next 256 chars of the table */
-		
-	switch (hpkeyb_keycode[scancode]) {
-		case KBD_RELEASE:
-			DPRINTK("release\n");
-			hpkeyb.released = 1;
-			break;
-		case KBD_RESEND:
-			DPRINTK("resend request\n");
-			break;
-		case KBD_ACK:
-			DPRINTK("ACK\n");
-			break;
-		case KBD_ESCAPE0:
-		case KBD_ESCAPE1:
-			DPRINTK("escape code %d\n", hpkeyb_keycode[scancode]);
-			hpkeyb.escaped = hpkeyb_keycode[scancode];
-			break;
-		case KBD_UNKNOWN:
-			DPRINTK("received unknown scancode %d, escape %d.\n",
-				scancode, hpkeyb.escaped);	/* This is a DPRINTK atm since we do not handle escaped scancodes cleanly */
-			if (hpkeyb.escaped)
-			hpkeyb.escaped = 0;
-			if (hpkeyb.released)
-				hpkeyb.released = 0;
-			return;
-		default:
-			hpkeyb.scancode = scancode;
-			DPRINTK("sent=%d, rel=%d\n",hpkeyb.scancode, hpkeyb.released);
-			/*input_regs(regs);*/
-			input_report_key(&hpkeyb.dev, hpkeyb_keycode[hpkeyb.scancode], !hpkeyb.released);
-			input_sync(&hpkeyb.dev);
-			if (hpkeyb.escaped)
-				hpkeyb.escaped = 0;
-			if (hpkeyb.released) 
-				hpkeyb.released = 0;
-			break;	
-	}
-}
-
-
-/**
- * gscps2_mouse_docode() - PS2 Mouse basic handler
- *
- * Receives mouse codes, processes them by packets of three, and sends
- * correct events to the input layer.
- */
-
-static void gscps2_mouse_docode(struct pt_regs *regs)
-{
-	int xrel, yrel;
-
-	/* process BAT (end of basic tests) command */
-	if ((hpmouse.nbread == 1) && (hpmouse.bytes[0] == AUX_RECONNECT))
-		hpmouse.nbread--;
-
-	/* stolen from psmouse.c */
-	if (hpmouse.nbread && time_after(jiffies, hpmouse.last + HZ/2)) {
-		printk(KERN_DEBUG "%s:%d : Lost mouse synchronization, throwing %d bytes away.\n", __FILE__, __LINE__,
-				hpmouse.nbread);
-		hpmouse.nbread = 0;
-	}
-
-	hpmouse.last = jiffies;
-	hpmouse.bytes[hpmouse.nbread++] = gscps2_readb_input(hpmouse.addr);
-	
-	/* process packet */
-	if (hpmouse.nbread == 3) {
-		
-		if (!(hpmouse.bytes[PACKET_CTRL] & MOUSE_ALWAYS1))
-			DPRINTK("Mouse: error on packet always1 bit checking\n");
-			/* XXX should exit now, bad data on the line! */
-		
-		if ((hpmouse.bytes[PACKET_CTRL] & (MOUSE_XOVFLOW | MOUSE_YOVFLOW)))
-			DPRINTK("Mouse: position overflow\n");
-		
-		/*input_regs(regs);*/
-
-		input_report_key(&hpmouse.dev, BTN_LEFT, hpmouse.bytes[PACKET_CTRL] & MOUSE_LEFTBTN);
-		input_report_key(&hpmouse.dev, BTN_MIDDLE, hpmouse.bytes[PACKET_CTRL] & MOUSE_MIDBTN);
-		input_report_key(&hpmouse.dev, BTN_RIGHT, hpmouse.bytes[PACKET_CTRL] & MOUSE_RIGHTBTN);
-		
-		xrel = hpmouse.bytes[PACKET_X];
-		yrel = hpmouse.bytes[PACKET_Y];
-		
-		/* Data sent by mouse are 9-bit signed, the sign bit is in the control packet */
-		if (xrel && (hpmouse.bytes[PACKET_CTRL] & MOUSE_XSIGN))
-			xrel = xrel - 0x100;
-		if (yrel && (hpmouse.bytes[PACKET_CTRL] & MOUSE_YSIGN))
-			yrel = yrel - 0x100;
-		
-		input_report_rel(&hpmouse.dev, REL_X, xrel);
-		input_report_rel(&hpmouse.dev, REL_Y, -yrel);	/* Y axis is received upside-down */
-		
-		input_sync(&hpmouse.dev);
-		
-		hpmouse.nbread = 0;
-	}
-}
-
-
-/**
- * gscps2_interrupt() - Interruption service routine
- *
- * This processes the list of scancodes queued and sends appropriate
- * key value to the system.
- */
-
-static irqreturn_t gscps2_interrupt(int irq, void *dev, struct pt_regs *reg)
-{
-	/* process mouse actions */
-	while (gscps2_readb_status(hpmouse.addr) & GSC_STAT_RBNE)
-		gscps2_mouse_docode(reg);
-	
-	/* process keyboard scancode */
-	while (gscps2_readb_status(hpkeyb.addr) & GSC_STAT_RBNE)
-		gscps2_kbd_docode(reg);
-
-	return IRQ_HANDLED;
-}
-
-
-/**
- * gscps2_hpkeyb_event() - Event handler
- * @return: success/error report
- *
- * Currently only updates leds on keyboard
- */
-
-int gscps2_hpkeyb_event(struct input_dev *dev, unsigned int type, unsigned int code, int value)
-{
-	DPRINTK("Calling %s, type=%d, code=%d, value=%d\n",
-			__FUNCTION__, type, code, value);
-
-	if (!hpkeyb.initialized)
-		return -1;
-
-	if (type == EV_LED) {
-		u8 leds[2];
-
-		if (gscps2_writeb_safe_output(KBD_CMD_SET_LEDS)) {
-			printk(KERN_ERR "gsckbd_leds: timeout\n");
-			return -1;
-		}
-		DPRINTK("KBD_CMD_SET_LEDS\n");
-
-		*leds = (test_bit(LED_SCROLLL, dev->led) ? LED_SCR : 0)
-			| (test_bit(LED_NUML,    dev->led) ? LED_NUM : 0)
-			| (test_bit(LED_CAPSL,   dev->led) ? LED_CAP : 0);
-		DPRINTK("Sending leds=%x\n", *leds);
-		
-		if (gscps2_writeb_safe_output(*leds)) {
-			printk(KERN_ERR "gsckbd_leds: timeout\n");
-			return -1;
-		}
-		DPRINTK("leds sent\n");
-		
-		if (gscps2_writeb_safe_output(KBD_CMD_ENABLE)) {
-			printk(KERN_ERR "gsckbd_leds: timeout\n");
-			return -1;
-		}
-		DPRINTK("End\n");
-
-		return 0;
-
-	}
-	return -1;
-}
-
-
-/**
- * gscps2_kbd_probe() - Probes keyboard device and init input_dev structure
- * @return: number of device initialized (1, 0 on error)
- */
-
-static int __init gscps2_kbd_probe(void)
-{
-	int i, res = 0;
-	unsigned long flags;
-
-	if (hpkeyb.initialized) {
-		printk(KERN_ERR "GSC PS/2 keyboard driver already registered\n");
-		return 0;
-	}
-	
-	spin_lock_irqsave(&gscps2_lock, flags);
- 
-	if (!gscps2_writeb_safe_output(KBD_CMD_SET_LEDS)	&&
-	    !gscps2_writeb_safe_output(0)			&&
-	    !gscps2_writeb_safe_output(KBD_CMD_ENABLE))
-		res = 1;
- 
-	spin_unlock_irqrestore(&gscps2_lock, flags);
-
-	if (!res)
-		printk(KERN_ERR "Keyboard initialization sequence failled\n");
-	
-	init_input_dev(&hpkeyb.dev);
-	
-	for (i = 0; i < KBD_TBLSIZE; i++)
-		if (hpkeyb_keycode[i] != KBD_UNKNOWN)
-			set_bit(hpkeyb_keycode[i], hpkeyb.dev.keybit);
-		
-	hpkeyb.dev.evbit[0]	= BIT(EV_KEY) | BIT(EV_LED) | BIT(EV_REP);
-	hpkeyb.dev.ledbit[0]	= BIT(LED_NUML) | BIT(LED_CAPSL) | BIT(LED_SCROLLL);
-	hpkeyb.dev.keycode	= hpkeyb_keycode;
-	hpkeyb.dev.keycodesize	= sizeof(unsigned char);
-	hpkeyb.dev.keycodemax	= KBD_TBLSIZE;
-	hpkeyb.dev.name		= "GSC Keyboard";
-	hpkeyb.dev.phys		= "hpkbd/input0";
-
-	hpkeyb.dev.event	= gscps2_hpkeyb_event;
-	
-	/* TODO These need some adjustement, are they really useful ? */
-	hpkeyb.dev.id.bustype	= BUS_GSC;
-	hpkeyb.dev.id.vendor	= PCI_VENDOR_ID_HP;
-	hpkeyb.dev.id.product	= 0x0001;
-	hpkeyb.dev.id.version	= 0x0010;
-	hpkeyb.initialized	= 1;
-
-	return 1;
-}
-
-
-/**
- * gscps2_mouse_probe() - Probes mouse device and init input_dev structure
- * @return: number of device initialized (1, 0 on error)
- *
- * Currently no check on initialization is performed
- */
-
-static int __init gscps2_mouse_probe(void)
-{
-	if (hpmouse.initialized) {
-		printk(KERN_ERR "GSC PS/2 Mouse driver already registered\n");
-		return 0;
-	}
-	
-	init_input_dev(&hpmouse.dev);
-	
-	hpmouse.dev.name	= "GSC Mouse";
-	hpmouse.dev.phys	= "hpmouse/input0";
-   	hpmouse.dev.evbit[0] 	= BIT(EV_KEY) | BIT(EV_REL);
-	hpmouse.dev.keybit[LONG(BTN_MOUSE)] = BIT(BTN_LEFT) | BIT(BTN_MIDDLE) | BIT(BTN_RIGHT);
-	hpmouse.dev.relbit[0] 	= BIT(REL_X) | BIT(REL_Y);
-	hpmouse.last 		= 0;
-
-	gscps2_writeb_output(AUX_ENABLE_DEV, hpmouse.addr);
-	/* Try it a second time, this will give status if the device is available */
-	gscps2_writeb_output(AUX_ENABLE_DEV, hpmouse.addr);
-	
-	/* TODO These need some adjustement, are they really useful ? */
-	hpmouse.dev.id.bustype	= BUS_GSC;
-	hpmouse.dev.id.vendor	= 0x0001;
-	hpmouse.dev.id.product	= 0x0001;
-	hpmouse.dev.id.version	= 0x0010;
-	hpmouse.initialized = 1;
-	return 1;	/* XXX: we don't check if initialization failed */
-}
-
-
-/**
- * gscps2_probe() - Probes PS2 devices
- * @return: success/error report
- */
-
-static int __init gscps2_probe(struct parisc_device *dev)
-{
-	u8 id;
-	char *addr, *name;
-	int ret = 0, device_found = 0;
-	unsigned long hpa = dev->hpa;
-
-	if (!dev->irq)
-		goto fail_pitifully;
-	
-	/* Offset for DINO PS/2. Works with LASI even */
-	if (dev->id.sversion == 0x96)
-		hpa += GSC_DINO_OFFSET;
-
-	addr = ioremap(hpa, 256);
-	
-	if (!hpmouse.initialized || !hpkeyb.initialized)
-		gscps2_reset(addr);
-
-	ret = -EINVAL;
-	id = readb(addr+GSC_ID) & 0x0f;
-	switch (id) {
-		case 0:				/* keyboard */
-			hpkeyb.addr = addr;
-			name = "keyboard";
-			device_found = gscps2_kbd_probe();
-			break;
-		case 1:				/* mouse */
-			hpmouse.addr = addr;
-			name = "mouse";
-			device_found = gscps2_mouse_probe();
-			break;
-		default:
-			printk(KERN_WARNING "%s: Unsupported PS/2 port (id=%d) ignored\n",
-		    		__FUNCTION__, id);
-			goto fail_miserably;
-	}
-
-	/* No valid device found */
-	ret = -ENODEV;
-	if (!device_found)
-		goto fail_miserably;
-
-	/* Here we claim only if we have a device attached */
-	/* Allocate the irq and memory region for that device */
-	ret = -EBUSY;
-	if (request_irq(dev->irq, gscps2_interrupt, 0, name, NULL))
-		goto fail_miserably;
-
-	if (!request_mem_region(hpa, GSC_STATUS + 4, name))
-		goto fail_request_mem;
-	
-	/* Finalize input struct and register it */
-	switch (id) {
-		case 0:				/* keyboard */
-			hpkeyb.irq = dev->irq;
-			input_register_device(&hpkeyb.dev);	
-			break;
-		case 1:				/* mouse */
-			hpmouse.irq = dev->irq;
-			input_register_device(&hpmouse.dev);
-			break;
-		default:
-			break;
-	}
-
-	printk(KERN_INFO "input: PS/2 %s port at 0x%08lx (irq %d) found and attached\n",
-			name, hpa, dev->irq);
-
-	return 0;
-	
-fail_request_mem: free_irq(dev->irq, NULL);
-fail_miserably: iounmap(addr);
-fail_pitifully:	return ret;
-}
-
-
-
-static struct parisc_device_id gscps2_device_tbl[] = {
-	{ HPHW_FIO, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x00084 }, /* LASI PS/2 */
-/*	{ HPHW_FIO, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x00096 },  DINO PS/2 (XXX Not yet tested) */
-	{ 0, }	/* 0 terminated list */
-};
-
-static struct parisc_driver gscps2_driver = {
-	.name		= "GSC PS2",
-	.id_table	= gscps2_device_tbl,
-	.probe		= gscps2_probe,
-};
-
-static int __init gscps2_init(void)
-{
-	if (register_parisc_driver(&gscps2_driver))
-		return -EBUSY;
-	return 0;
-}
-
-static void __exit gscps2_exit(void)
-{
-	/* TODO this is probably not very good and needs to be checked */
-	if (hpkeyb.initialized) {
-		free_irq(hpkeyb.irq, gscps2_interrupt);
-		iounmap(hpkeyb.addr);
-		hpkeyb.initialized = 0;
-		input_unregister_device(&hpkeyb.dev);
-	}
-	if (hpmouse.initialized) {
-		free_irq(hpmouse.irq, gscps2_interrupt);
-		iounmap(hpmouse.addr);
-		hpmouse.initialized = 0;
-		input_unregister_device(&hpmouse.dev);
-	}
-	unregister_parisc_driver(&gscps2_driver);
-}
-
-
-MODULE_AUTHOR("Laurent Canet <canetl@esiee.fr>, Thibaut Varene <varenet@esiee.fr>");
-MODULE_DESCRIPTION("GSC PS/2 keyboard/mouse driver");
-MODULE_LICENSE("GPL");
-MODULE_DEVICE_TABLE(parisc, gscps2_device_tbl);
-
-
-module_init(gscps2_init);
-module_exit(gscps2_exit);
--- diff/drivers/macintosh/nvram.c	2003-06-30 10:07:21.000000000 +0100
+++ source/drivers/macintosh/nvram.c	1970-01-01 01:00:00.000000000 +0100
@@ -1,131 +0,0 @@
-/*
- * /dev/nvram driver for Power Macintosh.
- */
-
-#define NVRAM_VERSION "1.0"
-
-#include <linux/module.h>
-
-#include <linux/types.h>
-#include <linux/errno.h>
-#include <linux/fs.h>
-#include <linux/miscdevice.h>
-#include <linux/fcntl.h>
-#include <linux/nvram.h>
-#include <linux/init.h>
-#include <linux/smp_lock.h>
-#include <asm/uaccess.h>
-#include <asm/nvram.h>
-
-#define NVRAM_SIZE	8192
-
-static loff_t nvram_llseek(struct file *file, loff_t offset, int origin)
-{
-	lock_kernel();
-	switch (origin) {
-	case 1:
-		offset += file->f_pos;
-		break;
-	case 2:
-		offset += NVRAM_SIZE;
-		break;
-	}
-	if (offset < 0) {
-		unlock_kernel();
-		return -EINVAL;
-	}
-	file->f_pos = offset;
-	unlock_kernel();
-	return file->f_pos;
-}
-
-static ssize_t read_nvram(struct file *file, char __user *buf,
-			  size_t count, loff_t *ppos)
-{
-	unsigned int i;
-	char __user *p = buf;
-
-	if (verify_area(VERIFY_WRITE, buf, count))
-		return -EFAULT;
-	if (*ppos >= NVRAM_SIZE)
-		return 0;
-	for (i = *ppos; count > 0 && i < NVRAM_SIZE; ++i, ++p, --count)
-		if (__put_user(nvram_read_byte(i), p))
-			return -EFAULT;
-	*ppos = i;
-	return p - buf;
-}
-
-static ssize_t write_nvram(struct file *file, const char __user *buf,
-			   size_t count, loff_t *ppos)
-{
-	unsigned int i;
-	const char __user *p = buf;
-	char c;
-
-	if (verify_area(VERIFY_READ, buf, count))
-		return -EFAULT;
-	if (*ppos >= NVRAM_SIZE)
-		return 0;
-	for (i = *ppos; count > 0 && i < NVRAM_SIZE; ++i, ++p, --count) {
-		if (__get_user(c, p))
-			return -EFAULT;
-		nvram_write_byte(c, i);
-	}
-	*ppos = i;
-	return p - buf;
-}
-
-static int nvram_ioctl(struct inode *inode, struct file *file,
-	unsigned int cmd, unsigned long arg)
-{
-	switch(cmd) {
-		case PMAC_NVRAM_GET_OFFSET:
-		{
-			int part, offset;
-			if (copy_from_user(&part, (void __user*)arg, sizeof(part)) != 0)
-				return -EFAULT;
-			if (part < pmac_nvram_OF || part > pmac_nvram_NR)
-				return -EINVAL;
-			offset = pmac_get_partition(part);
-			if (copy_to_user((void __user*)arg, &offset, sizeof(offset)) != 0)
-				return -EFAULT;
-			break;
-		}
-
-		default:
-			return -EINVAL;
-	}
-
-	return 0;
-}
-
-struct file_operations nvram_fops = {
-	.owner		= THIS_MODULE,
-	.llseek		= nvram_llseek,
-	.read		= read_nvram,
-	.write		= write_nvram,
-	.ioctl		= nvram_ioctl,
-};
-
-static struct miscdevice nvram_dev = {
-	NVRAM_MINOR,
-	"nvram",
-	&nvram_fops
-};
-
-int __init nvram_init(void)
-{
-	printk(KERN_INFO "Macintosh non-volatile memory driver v%s\n",
-		NVRAM_VERSION);
-	return misc_register(&nvram_dev);
-}
-
-void __exit nvram_cleanup(void)
-{
-        misc_deregister( &nvram_dev );
-}
-
-module_init(nvram_init);
-module_exit(nvram_cleanup);
-MODULE_LICENSE("GPL");
--- diff/drivers/net/e100/LICENSE	2002-10-16 04:28:27.000000000 +0100
+++ source/drivers/net/e100/LICENSE	1970-01-01 01:00:00.000000000 +0100
@@ -1,339 +0,0 @@
-
-"This software program is licensed subject to the GNU General Public License 
-(GPL). Version 2, June 1991, available at 
-<http://www.fsf.org/copyleft/gpl.html>"
-
-GNU General Public License 
-
-Version 2, June 1991
-
-Copyright (C) 1989, 1991 Free Software Foundation, Inc.  
-59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
-
-Everyone is permitted to copy and distribute verbatim copies of this license
-document, but changing it is not allowed.
-
-Preamble
-
-The licenses for most software are designed to take away your freedom to 
-share and change it. By contrast, the GNU General Public License is intended
-to guarantee your freedom to share and change free software--to make sure 
-the software is free for all its users. This General Public License applies 
-to most of the Free Software Foundation's software and to any other program 
-whose authors commit to using it. (Some other Free Software Foundation 
-software is covered by the GNU Library General Public License instead.) You 
-can apply it to your programs, too.
-
-When we speak of free software, we are referring to freedom, not price. Our
-General Public Licenses are designed to make sure that you have the freedom 
-to distribute copies of free software (and charge for this service if you 
-wish), that you receive source code or can get it if you want it, that you 
-can change the software or use pieces of it in new free programs; and that 
-you know you can do these things.
-
-To protect your rights, we need to make restrictions that forbid anyone to 
-deny you these rights or to ask you to surrender the rights. These 
-restrictions translate to certain responsibilities for you if you distribute
-copies of the software, or if you modify it.
-
-For example, if you distribute copies of such a program, whether gratis or 
-for a fee, you must give the recipients all the rights that you have. You 
-must make sure that they, too, receive or can get the source code. And you 
-must show them these terms so they know their rights.
- 
-We protect your rights with two steps: (1) copyright the software, and (2) 
-offer you this license which gives you legal permission to copy, distribute 
-and/or modify the software. 
-
-Also, for each author's protection and ours, we want to make certain that 
-everyone understands that there is no warranty for this free software. If 
-the software is modified by someone else and passed on, we want its 
-recipients to know that what they have is not the original, so that any 
-problems introduced by others will not reflect on the original authors' 
-reputations. 
-
-Finally, any free program is threatened constantly by software patents. We 
-wish to avoid the danger that redistributors of a free program will 
-individually obtain patent licenses, in effect making the program 
-proprietary. To prevent this, we have made it clear that any patent must be 
-licensed for everyone's free use or not licensed at all. 
-
-The precise terms and conditions for copying, distribution and modification 
-follow. 
-
-TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-0. This License applies to any program or other work which contains a notice
-   placed by the copyright holder saying it may be distributed under the 
-   terms of this General Public License. The "Program", below, refers to any
-   such program or work, and a "work based on the Program" means either the 
-   Program or any derivative work under copyright law: that is to say, a 
-   work containing the Program or a portion of it, either verbatim or with 
-   modifications and/or translated into another language. (Hereinafter, 
-   translation is included without limitation in the term "modification".) 
-   Each licensee is addressed as "you". 
-
-   Activities other than copying, distribution and modification are not 
-   covered by this License; they are outside its scope. The act of running 
-   the Program is not restricted, and the output from the Program is covered 
-   only if its contents constitute a work based on the Program (independent 
-   of having been made by running the Program). Whether that is true depends
-   on what the Program does. 
-
-1. You may copy and distribute verbatim copies of the Program's source code 
-   as you receive it, in any medium, provided that you conspicuously and 
-   appropriately publish on each copy an appropriate copyright notice and 
-   disclaimer of warranty; keep intact all the notices that refer to this 
-   License and to the absence of any warranty; and give any other recipients 
-   of the Program a copy of this License along with the Program. 
-
-   You may charge a fee for the physical act of transferring a copy, and you 
-   may at your option offer warranty protection in exchange for a fee. 
-
-2. You may modify your copy or copies of the Program or any portion of it, 
-   thus forming a work based on the Program, and copy and distribute such 
-   modifications or work under the terms of Section 1 above, provided that 
-   you also meet all of these conditions: 
-
-   * a) You must cause the modified files to carry prominent notices stating 
-        that you changed the files and the date of any change. 
-
-   * b) You must cause any work that you distribute or publish, that in 
-        whole or in part contains or is derived from the Program or any part 
-        thereof, to be licensed as a whole at no charge to all third parties
-        under the terms of this License. 
-
-   * c) If the modified program normally reads commands interactively when 
-        run, you must cause it, when started running for such interactive 
-        use in the most ordinary way, to print or display an announcement 
-        including an appropriate copyright notice and a notice that there is
-        no warranty (or else, saying that you provide a warranty) and that 
-        users may redistribute the program under these conditions, and 
-        telling the user how to view a copy of this License. (Exception: if 
-        the Program itself is interactive but does not normally print such 
-        an announcement, your work based on the Program is not required to 
-        print an announcement.) 
-
-   These requirements apply to the modified work as a whole. If identifiable 
-   sections of that work are not derived from the Program, and can be 
-   reasonably considered independent and separate works in themselves, then 
-   this License, and its terms, do not apply to those sections when you 
-   distribute them as separate works. But when you distribute the same 
-   sections as part of a whole which is a work based on the Program, the 
-   distribution of the whole must be on the terms of this License, whose 
-   permissions for other licensees extend to the entire whole, and thus to 
-   each and every part regardless of who wrote it. 
-
-   Thus, it is not the intent of this section to claim rights or contest 
-   your rights to work written entirely by you; rather, the intent is to 
-   exercise the right to control the distribution of derivative or 
-   collective works based on the Program. 
-
-   In addition, mere aggregation of another work not based on the Program 
-   with the Program (or with a work based on the Program) on a volume of a 
-   storage or distribution medium does not bring the other work under the 
-   scope of this License. 
-
-3. You may copy and distribute the Program (or a work based on it, under 
-   Section 2) in object code or executable form under the terms of Sections 
-   1 and 2 above provided that you also do one of the following: 
-
-   * a) Accompany it with the complete corresponding machine-readable source 
-        code, which must be distributed under the terms of Sections 1 and 2 
-        above on a medium customarily used for software interchange; or, 
-
-   * b) Accompany it with a written offer, valid for at least three years, 
-        to give any third party, for a charge no more than your cost of 
-        physically performing source distribution, a complete machine-
-        readable copy of the corresponding source code, to be distributed 
-        under the terms of Sections 1 and 2 above on a medium customarily 
-        used for software interchange; or, 
-
-   * c) Accompany it with the information you received as to the offer to 
-        distribute corresponding source code. (This alternative is allowed 
-        only for noncommercial distribution and only if you received the 
-        program in object code or executable form with such an offer, in 
-        accord with Subsection b above.) 
-
-   The source code for a work means the preferred form of the work for 
-   making modifications to it. For an executable work, complete source code 
-   means all the source code for all modules it contains, plus any 
-   associated interface definition files, plus the scripts used to control 
-   compilation and installation of the executable. However, as a special 
-   exception, the source code distributed need not include anything that is 
-   normally distributed (in either source or binary form) with the major 
-   components (compiler, kernel, and so on) of the operating system on which
-   the executable runs, unless that component itself accompanies the 
-   executable. 
-
-   If distribution of executable or object code is made by offering access 
-   to copy from a designated place, then offering equivalent access to copy 
-   the source code from the same place counts as distribution of the source 
-   code, even though third parties are not compelled to copy the source 
-   along with the object code. 
-
-4. You may not copy, modify, sublicense, or distribute the Program except as
-   expressly provided under this License. Any attempt otherwise to copy, 
-   modify, sublicense or distribute the Program is void, and will 
-   automatically terminate your rights under this License. However, parties 
-   who have received copies, or rights, from you under this License will not
-   have their licenses terminated so long as such parties remain in full 
-   compliance. 
-
-5. You are not required to accept this License, since you have not signed 
-   it. However, nothing else grants you permission to modify or distribute 
-   the Program or its derivative works. These actions are prohibited by law 
-   if you do not accept this License. Therefore, by modifying or 
-   distributing the Program (or any work based on the Program), you 
-   indicate your acceptance of this License to do so, and all its terms and
-   conditions for copying, distributing or modifying the Program or works 
-   based on it. 
-
-6. Each time you redistribute the Program (or any work based on the 
-   Program), the recipient automatically receives a license from the 
-   original licensor to copy, distribute or modify the Program subject to 
-   these terms and conditions. You may not impose any further restrictions 
-   on the recipients' exercise of the rights granted herein. You are not 
-   responsible for enforcing compliance by third parties to this License. 
-
-7. If, as a consequence of a court judgment or allegation of patent 
-   infringement or for any other reason (not limited to patent issues), 
-   conditions are imposed on you (whether by court order, agreement or 
-   otherwise) that contradict the conditions of this License, they do not 
-   excuse you from the conditions of this License. If you cannot distribute 
-   so as to satisfy simultaneously your obligations under this License and 
-   any other pertinent obligations, then as a consequence you may not 
-   distribute the Program at all. For example, if a patent license would 
-   not permit royalty-free redistribution of the Program by all those who 
-   receive copies directly or indirectly through you, then the only way you 
-   could satisfy both it and this License would be to refrain entirely from 
-   distribution of the Program. 
-
-   If any portion of this section is held invalid or unenforceable under any
-   particular circumstance, the balance of the section is intended to apply
-   and the section as a whole is intended to apply in other circumstances. 
-
-   It is not the purpose of this section to induce you to infringe any 
-   patents or other property right claims or to contest validity of any 
-   such claims; this section has the sole purpose of protecting the 
-   integrity of the free software distribution system, which is implemented 
-   by public license practices. Many people have made generous contributions
-   to the wide range of software distributed through that system in 
-   reliance on consistent application of that system; it is up to the 
-   author/donor to decide if he or she is willing to distribute software 
-   through any other system and a licensee cannot impose that choice. 
-
-   This section is intended to make thoroughly clear what is believed to be 
-   a consequence of the rest of this License. 
-
-8. If the distribution and/or use of the Program is restricted in certain 
-   countries either by patents or by copyrighted interfaces, the original 
-   copyright holder who places the Program under this License may add an 
-   explicit geographical distribution limitation excluding those countries, 
-   so that distribution is permitted only in or among countries not thus 
-   excluded. In such case, this License incorporates the limitation as if 
-   written in the body of this License. 
-
-9. The Free Software Foundation may publish revised and/or new versions of 
-   the General Public License from time to time. Such new versions will be 
-   similar in spirit to the present version, but may differ in detail to 
-   address new problems or concerns. 
-
-   Each version is given a distinguishing version number. If the Program 
-   specifies a version number of this License which applies to it and "any 
-   later version", you have the option of following the terms and 
-   conditions either of that version or of any later version published by 
-   the Free Software Foundation. If the Program does not specify a version 
-   number of this License, you may choose any version ever published by the 
-   Free Software Foundation. 
-
-10. If you wish to incorporate parts of the Program into other free programs
-    whose distribution conditions are different, write to the author to ask 
-    for permission. For software which is copyrighted by the Free Software 
-    Foundation, write to the Free Software Foundation; we sometimes make 
-    exceptions for this. Our decision will be guided by the two goals of 
-    preserving the free status of all derivatives of our free software and 
-    of promoting the sharing and reuse of software generally. 
-
-   NO WARRANTY
-
-11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 
-    FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 
-    OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 
-    PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER 
-    EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
-    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE 
-    ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH 
-    YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL 
-    NECESSARY SERVICING, REPAIR OR CORRECTION. 
-
-12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 
-    WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 
-    REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR 
-    DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL 
-    DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM 
-    (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED 
-    INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF 
-    THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR 
-    OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 
-
-END OF TERMS AND CONDITIONS
-
-How to Apply These Terms to Your New Programs
-
-If you develop a new program, and you want it to be of the greatest 
-possible use to the public, the best way to achieve this is to make it free 
-software which everyone can redistribute and change under these terms. 
-
-To do so, attach the following notices to the program. It is safest to 
-attach them to the start of each source file to most effectively convey the
-exclusion of warranty; and each file should have at least the "copyright" 
-line and a pointer to where the full notice is found. 
-
-one line to give the program's name and an idea of what it does.
-Copyright (C) yyyy  name of author
-
-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.
-
-Also add information on how to contact you by electronic and paper mail. 
-
-If the program is interactive, make it output a short notice like this when 
-it starts in an interactive mode: 
-
-Gnomovision version 69, Copyright (C) year name of author Gnomovision comes 
-with ABSOLUTELY NO WARRANTY; for details type 'show w'.  This is free 
-software, and you are welcome to redistribute it under certain conditions; 
-type 'show c' for details.
-
-The hypothetical commands 'show w' and 'show c' should show the appropriate 
-parts of the General Public License. Of course, the commands you use may be 
-called something other than 'show w' and 'show c'; they could even be 
-mouse-clicks or menu items--whatever suits your program. 
-
-You should also get your employer (if you work as a programmer) or your 
-school, if any, to sign a "copyright disclaimer" for the program, if 
-necessary. Here is a sample; alter the names: 
-
-Yoyodyne, Inc., hereby disclaims all copyright interest in the program 
-'Gnomovision' (which makes passes at compilers) written by James Hacker.
-
-signature of Ty Coon, 1 April 1989
-Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into 
-proprietary programs. If your program is a subroutine library, you may 
-consider it more useful to permit linking proprietary applications with the 
-library. If this is what you want to do, use the GNU Library General Public 
-License instead of this License.
--- diff/drivers/net/e100/Makefile	2003-02-13 11:46:52.000000000 +0000
+++ source/drivers/net/e100/Makefile	1970-01-01 01:00:00.000000000 +0100
@@ -1,8 +0,0 @@
-#
-# Makefile for the Intel's E100 ethernet driver
-#
-
-obj-$(CONFIG_E100) += e100.o
-
-e100-objs := e100_main.o e100_config.o e100_phy.o \
-	     e100_eeprom.o e100_test.o
--- diff/drivers/net/e100/e100.h	2003-09-30 15:46:15.000000000 +0100
+++ source/drivers/net/e100/e100.h	1970-01-01 01:00:00.000000000 +0100
@@ -1,999 +0,0 @@
-/*******************************************************************************
-
-  
-  Copyright(c) 1999 - 2003 Intel Corporation. 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.
-  
-  The full GNU General Public License is included in this distribution in the
-  file called LICENSE.
-  
-  Contact Information:
-  Linux NICS <linux.nics@intel.com>
-  Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
-*******************************************************************************/
-
-#ifndef _E100_INC_
-#define _E100_INC_
-
-#include <linux/module.h>
-#include <linux/types.h>
-#include <linux/init.h>
-#include <linux/mm.h>
-#include <linux/errno.h>
-#include <linux/ioport.h>
-#include <linux/pci.h>
-#include <linux/kernel.h>
-#include <linux/netdevice.h>
-#include <linux/etherdevice.h>
-#include <linux/skbuff.h>
-#include <linux/delay.h>
-#include <linux/timer.h>
-#include <linux/slab.h>
-#include <linux/interrupt.h>
-#include <linux/string.h>
-#include <linux/wait.h>
-#include <linux/reboot.h>
-#include <asm/io.h>
-#include <asm/unaligned.h>
-#include <asm/processor.h>
-#include <linux/ethtool.h>
-#include <linux/inetdevice.h>
-#include <linux/bitops.h>
-
-#include <linux/if.h>
-#include <asm/uaccess.h>
-#include <linux/ip.h>
-#include <linux/if_vlan.h>
-#include <linux/mii.h>
-
-#define E100_CABLE_UNKNOWN	0
-#define E100_CABLE_OK		1		
-#define E100_CABLE_OPEN_NEAR	2	/* Open Circuit Near End  */
-#define E100_CABLE_OPEN_FAR	3	/* Open Circuit Far End   */
-#define E100_CABLE_SHORT_NEAR	4	/* Short Circuit Near End */
-#define E100_CABLE_SHORT_FAR	5	/* Short Circuit Far End  */
-
-#define E100_REGS_LEN 2
-/*
- *  Configure parameters for buffers per controller.
- *  If the machine this is being used on is a faster machine (i.e. > 150MHz)
- *  and running on a 10MBS network then more queueing of data occurs. This
- *  may indicate the some of the numbers below should be adjusted.  Here are
- *  some typical numbers:
- *                             MAX_TCB 64
- *                             MAX_RFD 64
- *  The default numbers give work well on most systems tests so no real
- *  adjustments really need to take place.  Also, if the machine is connected
- *  to a 100MBS network the numbers described above can be lowered from the
- *  defaults as considerably less data will be queued.
- */
-
-#define TX_FRAME_CNT   8	/* consecutive transmit frames per interrupt */
-/* TX_FRAME_CNT must be less than MAX_TCB    */
-
-#define E100_DEFAULT_TCB   64
-#define E100_MIN_TCB       2*TX_FRAME_CNT + 3	/* make room for at least 2 interrupts */
-#define E100_MAX_TCB       1024
-
-#define E100_DEFAULT_RFD   64
-#define E100_MIN_RFD       8
-#define E100_MAX_RFD       1024
-
-#define E100_DEFAULT_XSUM         true
-#define E100_DEFAULT_BER          ZLOCK_MAX_ERRORS
-#define E100_DEFAULT_SPEED_DUPLEX 0
-#define E100_DEFAULT_FC           0
-#define E100_DEFAULT_IFS          true
-#define E100_DEFAULT_UCODE        true
-
-#define TX_THRSHLD     8
-
-/* IFS parameters */
-#define MIN_NUMBER_OF_TRANSMITS_100 1000
-#define MIN_NUMBER_OF_TRANSMITS_10  100
-
-#define E100_MAX_NIC 16
-
-#define E100_MAX_SCB_WAIT	100	/* Max udelays in wait_scb */
-#define E100_MAX_CU_IDLE_WAIT	50	/* Max udelays in wait_cus_idle */
-
-/* HWI feature related constant */
-#define HWI_REGISTER_GRANULARITY        80	/* register granularity = 80 Cm */
-#define HWI_NEAR_END_BOUNDARY           1000	/* Near end is defined as < 10 meters */
-
-/* CPUSAVER_BUNDLE_MAX: Sets the maximum number of frames that will be bundled.
- * In some situations, such as the TCP windowing algorithm, it may be
- * better to limit the growth of the bundle size than let it go as
- * high as it can, because that could cause too much added latency.
- * The default is six, because this is the number of packets in the
- * default TCP window size.  A value of 1 would make CPUSaver indicate
- * an interrupt for every frame received.  If you do not want to put
- * a limit on the bundle size, set this value to xFFFF.
- */
-#define E100_DEFAULT_CPUSAVER_BUNDLE_MAX	6
-#define E100_DEFAULT_CPUSAVER_INTERRUPT_DELAY	0x600
-#define E100_DEFAULT_BUNDLE_SMALL_FR		false
-
-/* end of configurables */
-
-/* ====================================================================== */
-/*                                hw                                      */
-/* ====================================================================== */
-
-/* timeout for command completion */
-#define E100_CMD_WAIT   100	/* iterations */
-
-struct driver_stats {
-	struct net_device_stats net_stats;
-
-	unsigned long tx_late_col;
-	unsigned long tx_ok_defrd;
-	unsigned long tx_one_retry;
-	unsigned long tx_mt_one_retry;
-	unsigned long rcv_cdt_frames;
-	unsigned long xmt_fc_pkts;
-	unsigned long rcv_fc_pkts;
-	unsigned long rcv_fc_unsupported;
-	unsigned long xmt_tco_pkts;
-	unsigned long rcv_tco_pkts;
-	unsigned long rx_intr_pkts;
-};
-
-/* TODO: kill me when we can do C99 */
-#define false		(0)
-#define true		(1)
-
-/* Changed for 82558 and 82559 enhancements */
-/* defines for 82558/9 flow control CSR values */
-#define DFLT_FC_THLD       0x00	/* Rx FIFO threshold of 0.5KB free  */
-#define DFLT_FC_CMD        0x00	/* FC Command in CSR */
-
-/* ====================================================================== */
-/*                              equates                                   */
-/* ====================================================================== */
-
-/*
- * These are general purpose defines 
- */
-
-/* Bit Mask definitions */
-#define BIT_0       0x0001
-#define BIT_1       0x0002
-#define BIT_2       0x0004
-#define BIT_3       0x0008
-#define BIT_4       0x0010
-#define BIT_5       0x0020
-#define BIT_6       0x0040
-#define BIT_7       0x0080
-#define BIT_8       0x0100
-#define BIT_9       0x0200
-#define BIT_10      0x0400
-#define BIT_11      0x0800
-#define BIT_12      0x1000
-#define BIT_13      0x2000
-#define BIT_14      0x4000
-#define BIT_15      0x8000
-#define BIT_28      0x10000000
-
-#define BIT_0_2     0x0007
-#define BIT_0_3     0x000F
-#define BIT_0_4     0x001F
-#define BIT_0_5     0x003F
-#define BIT_0_6     0x007F
-#define BIT_0_7     0x00FF
-#define BIT_0_8     0x01FF
-#define BIT_0_13    0x3FFF
-#define BIT_0_15    0xFFFF
-#define BIT_1_2     0x0006
-#define BIT_1_3     0x000E
-#define BIT_2_5     0x003C
-#define BIT_3_4     0x0018
-#define BIT_4_5     0x0030
-#define BIT_4_6     0x0070
-#define BIT_4_7     0x00F0
-#define BIT_5_7     0x00E0
-#define BIT_5_12    0x1FE0
-#define BIT_5_15    0xFFE0
-#define BIT_6_7     0x00c0
-#define BIT_7_11    0x0F80
-#define BIT_8_10    0x0700
-#define BIT_9_13    0x3E00
-#define BIT_12_15   0xF000
-#define BIT_8_15    0xFF00
-
-#define BIT_16_20   0x001F0000
-#define BIT_21_25   0x03E00000
-#define BIT_26_27   0x0C000000
-
-/* Transmit Threshold related constants */
-#define DEFAULT_TX_PER_UNDERRUN         20000
-
-#define MAX_MULTICAST_ADDRS             64
-#define MAX_FILTER                      16
-
-#define FULL_DUPLEX      2
-#define HALF_DUPLEX      1
-
-/*
- * These defines are specific to the 82557 
- */
-
-/* E100 PORT functions -- lower 4 bits */
-#define PORT_SOFTWARE_RESET         0
-#define PORT_SELFTEST               1
-#define PORT_SELECTIVE_RESET        2
-#define PORT_DUMP                   3
-
-/* SCB Status Word bit definitions */
-/* Interrupt status/ack fields */
-/* ER and FCP interrupts for 82558 masks  */
-#define SCB_STATUS_ACK_MASK        BIT_8_15	/* Status Mask */
-#define SCB_STATUS_ACK_CX          BIT_15	/* CU Completed Action Cmd */
-#define SCB_STATUS_ACK_FR          BIT_14	/* RU Received A Frame */
-#define SCB_STATUS_ACK_CNA         BIT_13	/* CU Became Inactive (IDLE) */
-#define SCB_STATUS_ACK_RNR         BIT_12	/* RU Became Not Ready */
-#define SCB_STATUS_ACK_MDI         BIT_11	/* MDI read or write done */
-#define SCB_STATUS_ACK_SWI         BIT_10	/* S/W generated interrupt */
-#define SCB_STATUS_ACK_ER          BIT_9	/* Early Receive */
-#define SCB_STATUS_ACK_FCP         BIT_8	/* Flow Control Pause */
-
-/*- CUS Fields */
-#define SCB_CUS_MASK            (BIT_6 | BIT_7)	/* CUS 2-bit Mask */
-#define SCB_CUS_IDLE            0	/* CU Idle */
-#define SCB_CUS_SUSPEND         BIT_6	/* CU Suspended */
-#define SCB_CUS_ACTIVE          BIT_7	/* CU Active */
-
-/*- RUS Fields */
-#define SCB_RUS_IDLE            0	/* RU Idle */
-#define SCB_RUS_MASK            BIT_2_5	/* RUS 3-bit Mask */
-#define SCB_RUS_SUSPEND         BIT_2	/* RU Suspended */
-#define SCB_RUS_NO_RESOURCES    BIT_3	/* RU Out Of Resources */
-#define SCB_RUS_READY           BIT_4	/* RU Ready */
-#define SCB_RUS_SUSP_NO_RBDS    (BIT_2 | BIT_5)	/* RU No More RBDs */
-#define SCB_RUS_NO_RBDS         (BIT_3 | BIT_5)	/* RU No More RBDs */
-#define SCB_RUS_READY_NO_RBDS   (BIT_4 | BIT_5)	/* RU Ready, No RBDs */
-
-/* SCB Command Word bit definitions */
-/*- CUC fields */
-/* Changing mask to 4 bits */
-#define SCB_CUC_MASK            BIT_4_7	/* CUC 4-bit Mask */
-#define SCB_CUC_NOOP            0
-#define SCB_CUC_START           BIT_4	/* CU Start */
-#define SCB_CUC_RESUME          BIT_5	/* CU Resume */
-#define SCB_CUC_UNKNOWN         BIT_7	/* CU unknown command */
-/* Changed for 82558 enhancements */
-#define SCB_CUC_STATIC_RESUME   (BIT_5 | BIT_7)	/* 82558/9 Static Resume */
-#define SCB_CUC_DUMP_ADDR       BIT_6	/* CU Dump Counters Address */
-#define SCB_CUC_DUMP_STAT       (BIT_4 | BIT_6)	/* CU Dump stat. counters */
-#define SCB_CUC_LOAD_BASE       (BIT_5 | BIT_6)	/* Load the CU base */
-/* Below was defined as BIT_4_7 */
-#define SCB_CUC_DUMP_RST_STAT   BIT_4_6	/* CU Dump & reset statistics cntrs */
-
-/*- RUC fields */
-#define SCB_RUC_MASK            BIT_0_2	/* RUC 3-bit Mask */
-#define SCB_RUC_START           BIT_0	/* RU Start */
-#define SCB_RUC_RESUME          BIT_1	/* RU Resume */
-#define SCB_RUC_ABORT           BIT_2	/* RU Abort */
-#define SCB_RUC_LOAD_HDS        (BIT_0 | BIT_2)	/* Load RFD Header Data Size */
-#define SCB_RUC_LOAD_BASE       (BIT_1 | BIT_2)	/* Load the RU base */
-#define SCB_RUC_RBD_RESUME      BIT_0_2	/* RBD resume */
-
-/* Interrupt fields (assuming byte addressing) */
-#define SCB_INT_MASK            BIT_0	/* Mask interrupts */
-#define SCB_SOFT_INT            BIT_1	/* Generate a S/W interrupt */
-/*  Specific Interrupt Mask Bits (upper byte of SCB Command word) */
-#define SCB_FCP_INT_MASK        BIT_2	/* Flow Control Pause */
-#define SCB_ER_INT_MASK         BIT_3	/* Early Receive */
-#define SCB_RNR_INT_MASK        BIT_4	/* RU Not Ready */
-#define SCB_CNA_INT_MASK        BIT_5	/* CU Not Active */
-#define SCB_FR_INT_MASK         BIT_6	/* Frame Received */
-#define SCB_CX_INT_MASK         BIT_7	/* CU eXecution w/ I-bit done */
-#define SCB_BACHELOR_INT_MASK   BIT_2_7	/* 82558 interrupt mask bits */
-
-#define SCB_GCR2_EEPROM_ACCESS_SEMAPHORE BIT_7
-
-/* EEPROM bit definitions */
-/*- EEPROM control register bits */
-#define EEPROM_FLAG_ASF  0x8000
-#define EEPROM_FLAG_GCL  0x4000
-
-#define EN_TRNF          0x10	/* Enable turnoff */
-#define EEDO             0x08	/* EEPROM data out */
-#define EEDI             0x04	/* EEPROM data in (set for writing data) */
-#define EECS             0x02	/* EEPROM chip select (1=hi, 0=lo) */
-#define EESK             0x01	/* EEPROM shift clock (1=hi, 0=lo) */
-
-/*- EEPROM opcodes */
-#define EEPROM_READ_OPCODE          06
-#define EEPROM_WRITE_OPCODE         05
-#define EEPROM_ERASE_OPCODE         07
-#define EEPROM_EWEN_OPCODE          19	/* Erase/write enable */
-#define EEPROM_EWDS_OPCODE          16	/* Erase/write disable */
-
-/*- EEPROM data locations */
-#define EEPROM_NODE_ADDRESS_BYTE_0      0
-#define EEPROM_COMPATIBILITY_WORD       3
-#define EEPROM_PWA_NO                   8
-#define EEPROM_ID_WORD			0x0A
-#define EEPROM_CONFIG_ASF		0x0D
-#define EEPROM_SMBUS_ADDR		0x90
-
-#define EEPROM_SUM                      0xbaba
-
-// Zero Locking Algorithm definitions:
-#define ZLOCK_ZERO_MASK		0x00F0
-#define ZLOCK_MAX_READS		50	
-#define ZLOCK_SET_ZERO		0x2010
-#define ZLOCK_MAX_SLEEP		300 * HZ	
-#define ZLOCK_MAX_ERRORS	300
-
-/* E100 Action Commands */
-#define CB_IA_ADDRESS           1
-#define CB_CONFIGURE            2
-#define CB_MULTICAST            3
-#define CB_TRANSMIT             4
-#define CB_LOAD_MICROCODE       5
-#define CB_LOAD_FILTER		8
-#define CB_MAX_NONTX_CMD        9
-#define CB_IPCB_TRANSMIT        9
-
-/* Pre-defined Filter Bits */
-#define CB_FILTER_EL            0x80000000
-#define CB_FILTER_FIX           0x40000000
-#define CB_FILTER_ARP           0x08000000
-#define CB_FILTER_IA_MATCH      0x02000000
-
-/* Command Block (CB) Field Definitions */
-/*- CB Command Word */
-#define CB_EL_BIT           BIT_15	/* CB EL Bit */
-#define CB_S_BIT            BIT_14	/* CB Suspend Bit */
-#define CB_I_BIT            BIT_13	/* CB Interrupt Bit */
-#define CB_TX_SF_BIT        BIT_3	/* TX CB Flexible Mode */
-#define CB_CMD_MASK         BIT_0_3	/* CB 4-bit CMD Mask */
-#define CB_CID_DEFAULT      (0x1f << 8)	/* CB 5-bit CID (max value) */
-
-/*- CB Status Word */
-#define CB_STATUS_MASK          BIT_12_15	/* CB Status Mask (4-bits) */
-#define CB_STATUS_COMPLETE      BIT_15	/* CB Complete Bit */
-#define CB_STATUS_OK            BIT_13	/* CB OK Bit */
-#define CB_STATUS_VLAN          BIT_12 /* CB Valn detected Bit */
-#define CB_STATUS_FAIL          BIT_11	/* CB Fail (F) Bit */
-
-/*misc command bits */
-#define CB_TX_EOF_BIT           BIT_15	/* TX CB/TBD EOF Bit */
-
-/* Config params */
-#define CB_CFIG_BYTE_COUNT          22	/* 22 config bytes */
-#define CB_CFIG_D102_BYTE_COUNT    10
-
-/* Receive Frame Descriptor Fields */
-
-/*- RFD Status Bits */
-#define RFD_RECEIVE_COLLISION   BIT_0	/* Collision detected on Receive */
-#define RFD_IA_MATCH            BIT_1	/* Indv Address Match Bit */
-#define RFD_RX_ERR              BIT_4	/* RX_ERR pin on Phy was set */
-#define RFD_FRAME_TOO_SHORT     BIT_7	/* Receive Frame Short */
-#define RFD_DMA_OVERRUN         BIT_8	/* Receive DMA Overrun */
-#define RFD_NO_RESOURCES        BIT_9	/* No Buffer Space */
-#define RFD_ALIGNMENT_ERROR     BIT_10	/* Alignment Error */
-#define RFD_CRC_ERROR           BIT_11	/* CRC Error */
-#define RFD_STATUS_OK           BIT_13	/* RFD OK Bit */
-#define RFD_STATUS_COMPLETE     BIT_15	/* RFD Complete Bit */
-
-/*- RFD Command Bits*/
-#define RFD_EL_BIT      BIT_15	/* RFD EL Bit */
-#define RFD_S_BIT       BIT_14	/* RFD Suspend Bit */
-#define RFD_H_BIT       BIT_4	/* Header RFD Bit */
-#define RFD_SF_BIT      BIT_3	/* RFD Flexible Mode */
-
-/*- RFD misc bits*/
-#define RFD_EOF_BIT         BIT_15	/* RFD End-Of-Frame Bit */
-#define RFD_F_BIT           BIT_14	/* RFD Buffer Fetch Bit */
-#define RFD_ACT_COUNT_MASK  BIT_0_13	/* RFD Actual Count Mask */
-
-/* Receive Buffer Descriptor Fields*/
-#define RBD_EOF_BIT             BIT_15	/* RBD End-Of-Frame Bit */
-#define RBD_F_BIT               BIT_14	/* RBD Buffer Fetch Bit */
-#define RBD_ACT_COUNT_MASK      BIT_0_13	/* RBD Actual Count Mask */
-
-#define SIZE_FIELD_MASK     BIT_0_13	/* Size of the associated buffer */
-#define RBD_EL_BIT          BIT_15	/* RBD EL Bit */
-
-/* Self Test Results*/
-#define CB_SELFTEST_FAIL_BIT        BIT_12
-#define CB_SELFTEST_DIAG_BIT        BIT_5
-#define CB_SELFTEST_REGISTER_BIT    BIT_3
-#define CB_SELFTEST_ROM_BIT         BIT_2
-
-#define CB_SELFTEST_ERROR_MASK ( \
-                CB_SELFTEST_FAIL_BIT | CB_SELFTEST_DIAG_BIT | \
-                CB_SELFTEST_REGISTER_BIT | CB_SELFTEST_ROM_BIT)
-
-/* adapter vendor & device ids */
-#define PCI_OHIO_BOARD   0x10f0	/* subdevice ID, Ohio dual port nic */
-
-/* Values for PCI_REV_ID_REGISTER values */
-#define D101A4_REV_ID      4	/* 82558 A4 stepping */
-#define D101B0_REV_ID      5	/* 82558 B0 stepping */
-#define D101MA_REV_ID      8	/* 82559 A0 stepping */
-#define D101S_REV_ID      9	/* 82559S A-step */
-#define D102_REV_ID      12
-#define D102C_REV_ID     13	/* 82550 step C */
-#define D102E_REV_ID     15
-
-/* ############Start of 82555 specific defines################## */
-
-#define PHY_82555_LED_SWITCH_CONTROL    	0x1b	/* 82555 led switch control register */
-
-/* 82555 led switch control reg. opcodes */
-#define PHY_82555_LED_NORMAL_CONTROL    0	// control back to the 8255X
-#define PHY_82555_LED_DRIVER_CONTROL    BIT_2	// the driver is in control
-#define PHY_82555_LED_OFF               BIT_2	// activity LED is off
-#define PHY_82555_LED_ON_559           (BIT_0 | BIT_2)	// activity LED is on for 559 and later
-#define PHY_82555_LED_ON_PRE_559       (BIT_0 | BIT_1 | BIT_2)	// activity LED is on for 558 and before
-
-// Describe the state of the phy led.
-// needed for the function : 'e100_blink_timer'
-enum led_state_e {
-	LED_OFF = 0,
-	LED_ON,
-};
-
-/* ############End of 82555 specific defines##################### */
-
-#define RFD_PARSE_BIT			BIT_3
-#define RFD_TCP_PACKET			0x00
-#define RFD_UDP_PACKET			0x01
-#define TCPUDP_CHECKSUM_BIT_VALID	BIT_4
-#define TCPUDP_CHECKSUM_VALID		BIT_5
-#define CHECKSUM_PROTOCOL_MASK		0x03
-
-#define VLAN_SIZE   4
-#define CHKSUM_SIZE 2
-#define RFD_DATA_SIZE (ETH_FRAME_LEN + CHKSUM_SIZE + VLAN_SIZE)
-
-/* Bits for bdp->flags */
-#define DF_LINK_FC_CAP     0x00000001	/* Link is flow control capable */
-#define DF_CSUM_OFFLOAD    0x00000002
-#define DF_UCODE_LOADED    0x00000004
-#define USE_IPCB           0x00000008	/* set if using ipcb for transmits */
-#define IS_BACHELOR        0x00000010	/* set if 82558 or newer board */
-#define IS_ICH             0x00000020
-#define DF_SPEED_FORCED    0x00000040	/* set if speed is forced */
-#define LED_IS_ON	   0x00000080	/* LED is turned ON by the driver */
-#define DF_LINK_FC_TX_ONLY 0x00000100	/* Received PAUSE frames are honored*/
-
-typedef struct net_device_stats net_dev_stats_t;
-
-/* needed macros */
-/* These macros use the bdp pointer. If you use them it better be defined */
-#define PREV_TCB_USED(X)  ((X).tail ? (X).tail - 1 : bdp->params.TxDescriptors - 1)
-#define NEXT_TCB_TOUSE(X) ((((X) + 1) >= bdp->params.TxDescriptors) ? 0 : (X) + 1)
-#define TCB_TO_USE(X)     ((X).tail)
-#define TCBS_AVAIL(X)     (NEXT_TCB_TOUSE( NEXT_TCB_TOUSE((X).tail)) != (X).head)
-
-#define RFD_POINTER(skb,bdp)      ((rfd_t *) (((unsigned char *)((skb)->data))-((bdp)->rfd_size)))
-#define SKB_RFD_STATUS(skb,bdp)   ((RFD_POINTER((skb),(bdp)))->rfd_header.cb_status)
-
-/* ====================================================================== */
-/*                              82557                                     */
-/* ====================================================================== */
-
-/* Changed for 82558 enhancement */
-typedef struct _d101_scb_ext_t {
-	u32 scb_rx_dma_cnt;	/* Rx DMA byte count */
-	u8 scb_early_rx_int;	/* Early Rx DMA byte count */
-	u8 scb_fc_thld;	/* Flow Control threshold */
-	u8 scb_fc_xon_xoff;	/* Flow Control XON/XOFF values */
-	u8 scb_pmdr;	/* Power Mgmt. Driver Reg */
-} d101_scb_ext __attribute__ ((__packed__));
-
-/* Changed for 82559 enhancement */
-typedef struct _d101m_scb_ext_t {
-	u32 scb_rx_dma_cnt;	/* Rx DMA byte count */
-	u8 scb_early_rx_int;	/* Early Rx DMA byte count */
-	u8 scb_fc_thld;	/* Flow Control threshold */
-	u8 scb_fc_xon_xoff;	/* Flow Control XON/XOFF values */
-	u8 scb_pmdr;	/* Power Mgmt. Driver Reg */
-	u8 scb_gen_ctrl;	/* General Control */
-	u8 scb_gen_stat;	/* General Status */
-	u16 scb_reserved;	/* Reserved */
-	u32 scb_function_event;	/* Cardbus Function Event */
-	u32 scb_function_event_mask;	/* Cardbus Function Mask */
-	u32 scb_function_present_state;	/* Cardbus Function state */
-	u32 scb_force_event;	/* Cardbus Force Event */
-} d101m_scb_ext __attribute__ ((__packed__));
-
-/* Changed for 82550 enhancement */
-typedef struct _d102_scb_ext_t {
-	u32 scb_rx_dma_cnt;	/* Rx DMA byte count */
-	u8 scb_early_rx_int;	/* Early Rx DMA byte count */
-	u8 scb_fc_thld;	/* Flow Control threshold */
-	u8 scb_fc_xon_xoff;	/* Flow Control XON/XOFF values */
-	u8 scb_pmdr;	/* Power Mgmt. Driver Reg */
-	u8 scb_gen_ctrl;	/* General Control */
-	u8 scb_gen_stat;	/* General Status */
-	u8 scb_gen_ctrl2;
-	u8 scb_reserved;	/* Reserved */
-	u32 scb_scheduling_reg;
-	u32 scb_reserved2;
-	u32 scb_function_event;	/* Cardbus Function Event */
-	u32 scb_function_event_mask;	/* Cardbus Function Mask */
-	u32 scb_function_present_state;	/* Cardbus Function state */
-	u32 scb_force_event;	/* Cardbus Force Event */
-} d102_scb_ext __attribute__ ((__packed__));
-
-/*
- * 82557 status control block. this will be memory mapped & will hang of the
- * the bdp, which hangs of the bdp. This is the brain of it.
- */
-typedef struct _scb_t {
-	u16 scb_status;	/* SCB Status register */
-	u8 scb_cmd_low;	/* SCB Command register (low byte) */
-	u8 scb_cmd_hi;	/* SCB Command register (high byte) */
-	u32 scb_gen_ptr;	/* SCB General pointer */
-	u32 scb_port;	/* PORT register */
-	u16 scb_flsh_cntrl;	/* Flash Control register */
-	u16 scb_eprm_cntrl;	/* EEPROM control register */
-	u32 scb_mdi_cntrl;	/* MDI Control Register */
-	/* Changed for 82558 enhancement */
-	union {
-		u32 scb_rx_dma_cnt;	/* Rx DMA byte count */
-		d101_scb_ext d101_scb;	/* 82558/9 specific fields */
-		d101m_scb_ext d101m_scb;	/* 82559 specific fields */
-		d102_scb_ext d102_scb;
-	} scb_ext;
-} scb_t __attribute__ ((__packed__));
-
-/* Self test
- * This is used to dump results of the self test 
- */
-typedef struct _self_test_t {
-	u32 st_sign;	/* Self Test Signature */
-	u32 st_result;	/* Self Test Results */
-} self_test_t __attribute__ ((__packed__));
-
-/* 
- *  Statistical Counters 
- */
-/* 82557 counters */
-typedef struct _basic_cntr_t {
-	u32 xmt_gd_frames;	/* Good frames transmitted */
-	u32 xmt_max_coll;	/* Fatal frames -- had max collisions */
-	u32 xmt_late_coll;	/* Fatal frames -- had a late coll. */
-	u32 xmt_uruns;	/* Xmit underruns (fatal or re-transmit) */
-	u32 xmt_lost_crs;	/* Frames transmitted without CRS */
-	u32 xmt_deferred;	/* Deferred transmits */
-	u32 xmt_sngl_coll;	/* Transmits that had 1 and only 1 coll. */
-	u32 xmt_mlt_coll;	/* Transmits that had multiple coll. */
-	u32 xmt_ttl_coll;	/* Transmits that had 1+ collisions. */
-	u32 rcv_gd_frames;	/* Good frames received */
-	u32 rcv_crc_errs;	/* Aligned frames that had a CRC error */
-	u32 rcv_algn_errs;	/* Receives that had alignment errors */
-	u32 rcv_rsrc_err;	/* Good frame dropped cuz no resources */
-	u32 rcv_oruns;	/* Overrun errors - bus was busy */
-	u32 rcv_err_coll;	/* Received frms. that encountered coll. */
-	u32 rcv_shrt_frames;	/* Received frames that were to short */
-} basic_cntr_t;
-
-/* 82558 extended statistic counters */
-typedef struct _ext_cntr_t {
-	u32 xmt_fc_frames;
-	u32 rcv_fc_frames;
-	u32 rcv_fc_unsupported;
-} ext_cntr_t;
-
-/* 82559 TCO statistic counters */
-typedef struct _tco_cntr_t {
-	u16 xmt_tco_frames;
-	u16 rcv_tco_frames;
-} tco_cntr_t;
-
-/* Structures to access thet physical dump area */
-/* Use one of these types, according to the statisitcal counters mode,
-   to cast the pointer to the physical dump area and access the cmd_complete
-   DWORD. */
-
-/* 557-mode : only basic counters + cmd_complete */
-typedef struct _err_cntr_557_t {
-	basic_cntr_t basic_stats;
-	u32 cmd_complete;
-} err_cntr_557_t;
-
-/* 558-mode : basic + extended counters + cmd_complete */
-typedef struct _err_cntr_558_t {
-	basic_cntr_t basic_stats;
-	ext_cntr_t extended_stats;
-	u32 cmd_complete;
-} err_cntr_558_t;
-
-/* 559-mode : basic + extended + TCO counters + cmd_complete */
-typedef struct _err_cntr_559_t {
-	basic_cntr_t basic_stats;
-	ext_cntr_t extended_stats;
-	tco_cntr_t tco_stats;
-	u32 cmd_complete;
-} err_cntr_559_t;
-
-/* This typedef defines the struct needed to hold the largest number of counters */
-typedef err_cntr_559_t max_counters_t;
-
-/* Different statistical-counters mode the controller may be in */
-typedef enum _stat_mode_t {
-	E100_BASIC_STATS = 0,	/* 82557 stats : 16 counters / 16 dw */
-	E100_EXTENDED_STATS,	/* 82558 stats : 19 counters / 19 dw */
-	E100_TCO_STATS		/* 82559 stats : 21 counters / 20 dw */
-} stat_mode_t;
-
-/* dump statistical counters complete codes */
-#define DUMP_STAT_COMPLETED	0xA005
-#define DUMP_RST_STAT_COMPLETED	0xA007
-
-/* Command Block (CB) Generic Header Structure*/
-typedef struct _cb_header_t {
-	u16 cb_status;	/* Command Block Status */
-	u16 cb_cmd;	/* Command Block Command */
-	u32 cb_lnk_ptr;	/* Link To Next CB */
-} cb_header_t __attribute__ ((__packed__));
-
-//* Individual Address Command Block (IA_CB)*/
-typedef struct _ia_cb_t {
-	cb_header_t ia_cb_hdr;
-	u8 ia_addr[ETH_ALEN];
-} ia_cb_t __attribute__ ((__packed__));
-
-/* Configure Command Block (CONFIG_CB)*/
-typedef struct _config_cb_t {
-	cb_header_t cfg_cbhdr;
-	u8 cfg_byte[CB_CFIG_BYTE_COUNT + CB_CFIG_D102_BYTE_COUNT];
-} config_cb_t __attribute__ ((__packed__));
-
-/* MultiCast Command Block (MULTICAST_CB)*/
-typedef struct _multicast_cb_t {
-	cb_header_t mc_cbhdr;
-	u16 mc_count;	/* Number of multicast addresses */
-	u8 mc_addr[(ETH_ALEN * MAX_MULTICAST_ADDRS)];
-} mltcst_cb_t __attribute__ ((__packed__));
-
-#define UCODE_MAX_DWORDS	134
-/* Load Microcode Command Block (LOAD_UCODE_CB)*/
-typedef struct _load_ucode_cb_t {
-	cb_header_t load_ucode_cbhdr;
-	u32 ucode_dword[UCODE_MAX_DWORDS];
-} load_ucode_cb_t __attribute__ ((__packed__));
-
-/* Load Programmable Filter Data*/
-typedef struct _filter_cb_t {
-	cb_header_t filter_cb_hdr;
-	u32 filter_data[MAX_FILTER];
-} filter_cb_t __attribute__ ((__packed__));
-
-/* NON_TRANSMIT_CB -- Generic Non-Transmit Command Block 
- */
-typedef struct _nxmit_cb_t {
-	union {
-		config_cb_t config;
-		ia_cb_t setup;
-		load_ucode_cb_t load_ucode;
-		mltcst_cb_t multicast;
-		filter_cb_t filter;
-	} ntcb;
-} nxmit_cb_t __attribute__ ((__packed__));
-
-/*Block for queuing for postponed execution of the non-transmit commands*/
-typedef struct _nxmit_cb_entry_t {
-	struct list_head list_elem;
-	nxmit_cb_t *non_tx_cmd;
-	dma_addr_t dma_addr;
-	unsigned long expiration_time;
-} nxmit_cb_entry_t;
-
-/* States for postponed non tx commands execution */
-typedef enum _non_tx_cmd_state_t {
-	E100_NON_TX_IDLE = 0,	/* No queued NON-TX commands */
-	E100_WAIT_TX_FINISH,	/* Wait for completion of the TX activities */
-	E100_WAIT_NON_TX_FINISH	/* Wait for completion of the non TX command */
-} non_tx_cmd_state_t;
-
-/* some defines for the ipcb */
-#define IPCB_IP_CHECKSUM_ENABLE 	BIT_4
-#define IPCB_TCPUDP_CHECKSUM_ENABLE	BIT_5
-#define IPCB_TCP_PACKET 		BIT_6
-#define IPCB_LARGESEND_ENABLE 		BIT_7
-#define IPCB_HARDWAREPARSING_ENABLE	BIT_0
-#define IPCB_INSERTVLAN_ENABLE 		BIT_1
-#define IPCB_IP_ACTIVATION_DEFAULT      IPCB_HARDWAREPARSING_ENABLE
-
-/* Transmit Buffer Descriptor (TBD)*/
-typedef struct _tbd_t {
-	u32 tbd_buf_addr;	/* Physical Transmit Buffer Address */
-	u16 tbd_buf_cnt;	/* Actual Count Of Bytes */
-	u16 padd;
-} tbd_t __attribute__ ((__packed__));
-
-/* d102 specific fields */
-typedef struct _tcb_ipcb_t {
-	u16 schedule_low;
-	u8 ip_schedule;
-	u8 ip_activation_high;
-	u16 vlan;
-	u8 ip_header_offset;
-	u8 tcp_header_offset;
-	union {
-		u32 sec_rec_phys_addr;
-		u32 tbd_zero_address;
-	} tbd_sec_addr;
-	union {
-		u16 sec_rec_size;
-		u16 tbd_zero_size;
-	} tbd_sec_size;
-	u16 total_tcp_payload;
-} tcb_ipcb_t __attribute__ ((__packed__));
-
-#define E100_TBD_ARRAY_SIZE (2+MAX_SKB_FRAGS)
-
-/* Transmit Command Block (TCB)*/
-struct _tcb_t {
-	cb_header_t tcb_hdr;
-	u32 tcb_tbd_ptr;	/* TBD address */
-	u16 tcb_cnt;	/* Data Bytes In TCB past header */
-	u8 tcb_thrshld;	/* TX Threshold for FIFO Extender */
-	u8 tcb_tbd_num;
-
-	union {
-		tcb_ipcb_t ipcb;	/* d102 ipcb fields */
-		tbd_t tbd_array[E100_TBD_ARRAY_SIZE];
-	} tcbu;
-
-	/* From here onward we can dump anything we want as long as the
-	 * size of the total structure is a multiple of a paragraph
-	 * boundary ( i.e. -16 bit aligned ).
-	 */
-	tbd_t *tbd_ptr;
-
-	u32 tcb_tbd_dflt_ptr;	/* TBD address for non-segmented packet */
-	u32 tcb_tbd_expand_ptr;	/* TBD address for segmented packet */
-
-	struct sk_buff *tcb_skb;	/* the associated socket buffer */
-	dma_addr_t tcb_phys;	/* phys addr of the TCB */
-} __attribute__ ((__packed__));
-
-#define _TCB_T_
-typedef struct _tcb_t tcb_t;
-
-/* Receive Frame Descriptor (RFD) - will be using the simple model*/
-struct _rfd_t {
-	/* 8255x */
-	cb_header_t rfd_header;
-	u32 rfd_rbd_ptr;	/* Receive Buffer Descriptor Addr */
-	u16 rfd_act_cnt;	/* Number Of Bytes Received */
-	u16 rfd_sz;	/* Number Of Bytes In RFD */
-	/* D102 aka Gamla */
-	u16 vlanid;
-	u8 rcvparserstatus;
-	u8 reserved;
-	u16 securitystatus;
-	u8 checksumstatus;
-	u8 zerocopystatus;
-	u8 pad[8];	/* data should be 16 byte aligned */
-	u8 data[RFD_DATA_SIZE];
-
-} __attribute__ ((__packed__));
-
-#define _RFD_T_
-typedef struct _rfd_t rfd_t;
-
-/* Receive Buffer Descriptor (RBD)*/
-typedef struct _rbd_t {
-	u16 rbd_act_cnt;	/* Number Of Bytes Received */
-	u16 rbd_filler;
-	u32 rbd_lnk_addr;	/* Link To Next RBD */
-	u32 rbd_rcb_addr;	/* Receive Buffer Address */
-	u16 rbd_sz;	/* Receive Buffer Size */
-	u16 rbd_filler1;
-} rbd_t __attribute__ ((__packed__));
-
-/*
- * This structure is used to maintain a FIFO access to a resource that is 
- * maintained as a circular queue. The resource to be maintained is pointed
- * to by the "data" field in the structure below. In this driver the TCBs', 
- * TBDs' & RFDs' are maintained  as a circular queue & are managed thru this
- * structure.
- */
-typedef struct _buf_pool_t {
-	unsigned int head;	/* index to first used resource */
-	unsigned int tail;	/* index to last used resource */
-	void *data;		/* points to resource pool */
-} buf_pool_t;
-
-/*Rx skb holding structure*/
-struct rx_list_elem {
-	struct list_head list_elem;
-	dma_addr_t dma_addr;
-	struct sk_buff *skb;
-};
-
-enum next_cu_cmd_e { RESUME_NO_WAIT = 0, RESUME_WAIT, START_WAIT };
-enum zlock_state_e { ZLOCK_INITIAL, ZLOCK_READING, ZLOCK_SLEEPING };
-enum tx_queue_stop_type { LONG_STOP = 0, SHORT_STOP };
-
-/* 64 bit aligned size */
-#define E100_SIZE_64A(X) ((sizeof(X) + 7) & ~0x7)
-
-typedef struct _bd_dma_able_t {
-	char selftest[E100_SIZE_64A(self_test_t)];
-	char stats_counters[E100_SIZE_64A(max_counters_t)];
-} bd_dma_able_t;
-
-/* bit masks for bool parameters */
-#define PRM_XSUMRX       0x00000001
-#define PRM_UCODE        0x00000002
-#define PRM_FC           0x00000004
-#define PRM_IFS          0x00000008
-#define PRM_BUNDLE_SMALL 0x00000010
-
-struct cfg_params {
-	int e100_speed_duplex;
-	int RxDescriptors;
-	int TxDescriptors;
-	int IntDelay;
-	int BundleMax;
-	int ber;
-	u32 b_params;
-};
-struct ethtool_lpbk_data{
-        dma_addr_t dma_handle;
-        tcb_t *tcb;
-        rfd_t *rfd;
-
-};
-
-struct e100_private {
-	struct vlan_group *vlgrp;
-	u32 flags;		/* board management flags */
-	u32 tx_per_underrun;	/* number of good tx frames per underrun */
-	unsigned int tx_count;	/* count of tx frames, so we can request an interrupt */
-	u8 tx_thld;		/* stores transmit threshold */
-	u16 eeprom_size;
-	u32 pwa_no;		/* PWA: xxxxxx-0xx */
-	u8 perm_node_address[ETH_ALEN];
-	struct list_head active_rx_list;	/* list of rx buffers */
-	struct list_head rx_struct_pool;	/* pool of rx buffer struct headers */
-	u16 rfd_size;			/* size of the adapter's RFD struct */
-	int skb_req;			/* number of skbs neede by the adapter */
-	u8 intr_mask;			/* mask for interrupt status */
-
-	void *dma_able;			/* dma allocated structs */
-	dma_addr_t dma_able_phys;
-	self_test_t *selftest;		/* pointer to self test area */
-	dma_addr_t selftest_phys;	/* phys addr of selftest */
-	max_counters_t *stats_counters;	/* pointer to stats table */
-	dma_addr_t stat_cnt_phys;	/* phys addr of stat counter area */
-
-	stat_mode_t stat_mode;	/* statistics mode: extended, TCO, basic */
-	scb_t *scb;		/* memory mapped ptr to 82557 scb */
-
-	tcb_t *last_tcb;	/* pointer to last tcb sent */
-	buf_pool_t tcb_pool;	/* adapter's TCB array */
-	dma_addr_t tcb_phys;	/* phys addr of start of TCBs */
-
-	u16 cur_line_speed;
-	u16 cur_dplx_mode;
-
-	struct net_device *device;
-	struct pci_dev *pdev;
-	struct driver_stats drv_stats;
-
-	u8 rev_id;		/* adapter PCI revision ID */
-
-	unsigned int phy_addr;	/* address of PHY component */
-	unsigned int PhyId;	/* ID of PHY component */
-	unsigned int PhyState;	/* state for the fix squelch algorithm */
-	unsigned int PhyDelay;	/* delay for the fix squelch algorithm */
-
-	/* Lock defintions for the driver */
-	spinlock_t bd_lock;		/* board lock */
-	spinlock_t bd_non_tx_lock;	/* Non transmit command lock  */
-	spinlock_t config_lock;		/* config block lock */
-	spinlock_t mdi_access_lock;	/* mdi lock */
-
-	struct timer_list watchdog_timer;	/* watchdog timer id */
-
-	/* non-tx commands parameters */
-	struct timer_list nontx_timer_id;	/* non-tx timer id */
-	struct list_head non_tx_cmd_list;
-	non_tx_cmd_state_t non_tx_command_state;
-	nxmit_cb_entry_t *same_cmd_entry[CB_MAX_NONTX_CMD];
-
-	enum next_cu_cmd_e next_cu_cmd;
-
-	/* Zero Locking Algorithm data members */
-	enum zlock_state_e zlock_state;
-	u8 zlock_read_data[16];	/* number of times each value 0-15 was read */
-	u16 zlock_read_cnt;	/* counts number of reads */
-	ulong zlock_sleep_cnt;	/* keeps track of "sleep" time */
-
-	u8 config[CB_CFIG_BYTE_COUNT + CB_CFIG_D102_BYTE_COUNT];
-
-	/* IFS params */
-	u8 ifs_state;
-	u8 ifs_value;
-
-	struct cfg_params params;	/* adapter's command line parameters */
-
-	u32 speed_duplex_caps;	/* adapter's speed/duplex capabilities */
-
-	/* WOL params for ethtool */
-	u32 wolsupported;
-	u32 wolopts;
-	u16 ip_lbytes;
-	struct ethtool_lpbk_data loopback;
-	struct timer_list blink_timer;	/* led blink timer id */
-
-#ifdef CONFIG_PM
-	u32 pci_state[16];
-#endif
-#ifdef E100_CU_DEBUG	
-	u8 last_cmd;
-	u8 last_sub_cmd;
-#endif	
-};
-
-#define E100_AUTONEG        0
-#define E100_SPEED_10_HALF  1
-#define E100_SPEED_10_FULL  2
-#define E100_SPEED_100_HALF 3
-#define E100_SPEED_100_FULL 4
-
-/********* function prototypes *************/
-extern int e100_open(struct net_device *);
-extern int e100_close(struct net_device *);
-extern void e100_isolate_driver(struct e100_private *bdp);
-extern unsigned char e100_hw_init(struct e100_private *);
-extern void e100_sw_reset(struct e100_private *bdp, u32 reset_cmd);
-extern u8 e100_start_cu(struct e100_private *bdp, tcb_t *tcb);
-extern void e100_free_non_tx_cmd(struct e100_private *bdp,
-				 nxmit_cb_entry_t *non_tx_cmd);
-extern nxmit_cb_entry_t *e100_alloc_non_tx_cmd(struct e100_private *bdp);
-extern unsigned char e100_exec_non_cu_cmd(struct e100_private *bdp,
-					  nxmit_cb_entry_t *cmd);
-extern unsigned char e100_selftest(struct e100_private *bdp, u32 *st_timeout,
-				   u32 *st_result);
-extern unsigned char e100_get_link_state(struct e100_private *bdp);
-extern unsigned char e100_wait_scb(struct e100_private *bdp);
-
-extern void e100_deisolate_driver(struct e100_private *bdp, u8 full_reset);
-extern unsigned char e100_configure_device(struct e100_private *bdp);
-#ifdef E100_CU_DEBUG
-extern unsigned char e100_cu_unknown_state(struct e100_private *bdp);
-#endif
-
-#define ROM_TEST_FAIL		0x01
-#define REGISTER_TEST_FAIL	0x02
-#define SELF_TEST_FAIL		0x04
-#define TEST_TIMEOUT		0x08
-
-enum test_offsets {
-	test_link,
-	test_eeprom,
-	test_self_test,
-	test_loopback_mac,
-	test_loopback_phy,
-	cable_diag,
-	max_test_res,  /* must be last */
-};
-
-#endif
--- diff/drivers/net/e100/e100_config.c	2004-01-19 10:22:57.000000000 +0000
+++ source/drivers/net/e100/e100_config.c	1970-01-01 01:00:00.000000000 +0100
@@ -1,639 +0,0 @@
-/*******************************************************************************
-
-  
-  Copyright(c) 1999 - 2003 Intel Corporation. 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.
-  
-  The full GNU General Public License is included in this distribution in the
-  file called LICENSE.
-  
-  Contact Information:
-  Linux NICS <linux.nics@intel.com>
-  Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
-*******************************************************************************/
-
-/**********************************************************************
-*                                                                     *
-* INTEL CORPORATION                                                   *
-*                                                                     *
-* This software is supplied under the terms of the license included   *
-* above.  All use of this driver must be in accordance with the terms *
-* of that license.                                                    *
-*                                                                     *
-* Module Name:  e100_config.c                                         *
-*                                                                     *
-* Abstract:     Functions for configuring the network adapter.        *
-*                                                                     *
-* Environment:  This file is intended to be specific to the Linux     *
-*               operating system.                                     *
-*                                                                     *
-**********************************************************************/
-#include "e100_config.h"
-
-static void e100_config_long_rx(struct e100_private *bdp, unsigned char enable);
-
-static const u8 def_config[] = {
-	CB_CFIG_BYTE_COUNT,
-	0x08, 0x00, 0x00, 0x00, 0x00, 0x32, 0x07, 0x01,
-	0x00, 0x2e, 0x00, 0x60, 0x00, 0xf2, 0xc8, 0x00,
-	0x40, 0xf2, 0x80, 0x3f, 0x05
-};
-
-/**
- * e100_config_init_82557 - config the 82557 adapter
- * @bdp: atapter's private data struct
- *
- * This routine will initialize the 82557 configure block.
- * All other init functions will only set values that are
- * different from the 82557 default.
- */
-void
-e100_config_init_82557(struct e100_private *bdp)
-{
-	/* initialize config block */
-	memcpy(bdp->config, def_config, sizeof (def_config));
-	bdp->config[0] = CB_CFIG_BYTE_COUNT;	/* just in case */
-
-	e100_config_ifs(bdp);
-
-	/*
-	 * Enable extended statistical counters (82558 and up) and TCO counters
-	 * (82559 and up) and set the statistical counters' mode in bdp 
-	 *  
-	 *  stat. mode      |    TCO stat. bit (2)  |  Extended stat. bit (5)
-	 * ------------------------------------------------------------------
-	 *  Basic (557)     |       0               |         1
-	 * ------------------------------------------------------------------
-	 *  Extended (558)  |       0               |         0
-	 * ------------------------------------------------------------------
-	 *  TCO (559)       |       1               |         1
-	 * ------------------------------------------------------------------
-	 *  Reserved        |       1               |         0
-	 * ------------------------------------------------------------------
-	 */
-	bdp->config[6] &= ~CB_CFIG_TCO_STAT;
-	bdp->config[6] |= CB_CFIG_EXT_STAT_DIS;
-	bdp->stat_mode = E100_BASIC_STATS;
-
-	/* Setup for MII or 503 operation.  The CRS+CDT bit should only be set */
-	/* when operating in 503 mode. */
-	if (bdp->phy_addr == 32) {
-		bdp->config[8] &= ~CB_CFIG_503_MII;
-		bdp->config[15] |= CB_CFIG_CRS_OR_CDT;
-	} else {
-		bdp->config[8] |= CB_CFIG_503_MII;
-		bdp->config[15] &= ~CB_CFIG_CRS_OR_CDT;
-	}
-
-	e100_config_fc(bdp);
-	e100_config_force_dplx(bdp);
-	e100_config_promisc(bdp, false);
-	e100_config_mulcast_enbl(bdp, false);
-}
-
-static void
-e100_config_init_82558(struct e100_private *bdp)
-{
-	/* MWI enable. This should be turned on only if the adapter is a 82558/9
-	 * and if the PCI command reg. has enabled the MWI bit. */
-	bdp->config[3] |= CB_CFIG_MWI_EN;
-
-	bdp->config[6] &= ~CB_CFIG_EXT_TCB_DIS;
-
-	if (bdp->rev_id >= D101MA_REV_ID) {
-		/* this is 82559 and up - enable TCO counters */
-		bdp->config[6] |= CB_CFIG_TCO_STAT;
-		bdp->config[6] |= CB_CFIG_EXT_STAT_DIS;
-		bdp->stat_mode = E100_TCO_STATS;
-
-		if ((bdp->rev_id < D102_REV_ID) &&
-		    (bdp->params.b_params & PRM_XSUMRX) &&
-		    (bdp->pdev->device != 0x1209)) {
-
-			bdp->flags |= DF_CSUM_OFFLOAD;
-			bdp->config[9] |= 1;
-		}
-	} else {
-		/* this is 82558 */
-		bdp->config[6] &= ~CB_CFIG_TCO_STAT;
-		bdp->config[6] &= ~CB_CFIG_EXT_STAT_DIS;
-		bdp->stat_mode = E100_EXTENDED_STATS;
-	}
-
-	e100_config_long_rx(bdp, true);
-}
-
-static void
-e100_config_init_82550(struct e100_private *bdp)
-{
-	/* The D102 chip allows for 32 config bytes.  This value is
-	 * supposed to be in Byte 0.  Just add the extra bytes to
-	 * what was already setup in the block. */
-	bdp->config[0] += CB_CFIG_D102_BYTE_COUNT;
-
-	/* now we need to enable the extended RFD.  When this is
-	 * enabled, the immediated receive data buffer starts at offset
-	 * 32 from the RFD base address, instead of at offset 16. */
-	bdp->config[7] |= CB_CFIG_EXTENDED_RFD;
-
-	/* put the chip into D102 receive mode.  This is necessary
-	 * for any parsing and offloading features. */
-	bdp->config[22] = CB_CFIG_RECEIVE_GAMLA_MODE;
-
-	/* set the flag if checksum offloading was enabled */
-	if (bdp->params.b_params & PRM_XSUMRX) {
-		bdp->flags |= DF_CSUM_OFFLOAD;
-	}
-}
-
-/* Initialize the adapter's configure block */
-void
-e100_config_init(struct e100_private *bdp)
-{
-	e100_config_init_82557(bdp);
-
-	if (bdp->flags & IS_BACHELOR)
-		e100_config_init_82558(bdp);
-
-	if (bdp->rev_id >= D102_REV_ID)
-		e100_config_init_82550(bdp);
-}
-
-/**
- * e100_force_config - force a configure command
- * @bdp: atapter's private data struct
- *
- * This routine will force a configure command to the adapter.
- * The command will be executed in polled mode as interrupts
- * are _disabled_ at this time.
- *
- * Returns:
- *      true: if the configure command was successfully issued and completed
- *      false: otherwise
- */
-unsigned char
-e100_force_config(struct e100_private *bdp)
-{
-	spin_lock_bh(&(bdp->config_lock));
-
-	bdp->config[0] = CB_CFIG_BYTE_COUNT;
-	if (bdp->rev_id >= D102_REV_ID) {
-		/* The D102 chip allows for 32 config bytes.  This value is
-		   supposed to be in Byte 0.  Just add the extra bytes to
-		   what was already setup in the block. */
-		bdp->config[0] += CB_CFIG_D102_BYTE_COUNT;
-	}
-
-	spin_unlock_bh(&(bdp->config_lock));
-
-	// although we call config outside the lock, there is no
-	// race condition because config byte count has maximum value
-	return e100_config(bdp);
-}
-
-/**
- * e100_config - issue a configure command
- * @bdp: atapter's private data struct
- *
- * This routine will issue a configure command to the 82557.
- * This command will be executed in polled mode as interrupts
- * are _disabled_ at this time.
- *
- * Returns:
- *      true: if the configure command was successfully issued and completed
- *      false: otherwise
- */
-unsigned char
-e100_config(struct e100_private *bdp)
-{
-	cb_header_t *pntcb_hdr;
-	unsigned char res = true;
-	nxmit_cb_entry_t *cmd;
-
-	if (bdp->config[0] == 0) {
-		goto exit;
-	}
-
-	if ((cmd = e100_alloc_non_tx_cmd(bdp)) == NULL) {
-		res = false;
-		goto exit;
-	}
-
-	pntcb_hdr = (cb_header_t *) cmd->non_tx_cmd;
-	pntcb_hdr->cb_cmd = __constant_cpu_to_le16(CB_CONFIGURE);
-
-	spin_lock_bh(&bdp->config_lock);
-
-	if (bdp->config[0] < CB_CFIG_MIN_PARAMS) {
-		bdp->config[0] = CB_CFIG_MIN_PARAMS;
-	}
-
-	/* Copy the device's config block to the device's memory */
-	memcpy(cmd->non_tx_cmd->ntcb.config.cfg_byte, bdp->config,
-	       bdp->config[0]);
-	/* reset number of bytes to config next time */
-	bdp->config[0] = 0;
-
-	spin_unlock_bh(&bdp->config_lock);
-
-	res = e100_exec_non_cu_cmd(bdp, cmd);
-
-exit:
-	if (netif_running(bdp->device))
-		netif_wake_queue(bdp->device);
-	return res;
-}
-
-/**
- * e100_config_fc - config flow-control state
- * @bdp: adapter's private data struct
- *
- * This routine will enable or disable flow control support in the adapter's
- * config block. Flow control will be enable only if requested using the command
- * line option, and if the link is flow-contorl capable (both us and the link
- * partner). But, if link partner is capable of autoneg, but not capable of
- * flow control, received PAUSE	frames are still honored.
- */
-void
-e100_config_fc(struct e100_private *bdp)
-{
-	unsigned char enable = false;
-	/* 82557 doesn't support fc. Don't touch this option */
-	if (!(bdp->flags & IS_BACHELOR))
-		return;
-
-	/* Enable fc if requested and if the link supports it */
-	if ((bdp->params.b_params & PRM_FC) && (bdp->flags & 
-		(DF_LINK_FC_CAP | DF_LINK_FC_TX_ONLY))) {
-		enable = true;
-	}
-
-	spin_lock_bh(&(bdp->config_lock));
-
-	if (enable) {
-		if (bdp->flags & DF_LINK_FC_TX_ONLY) {
-			/* If link partner is capable of autoneg, but  */
-			/* not capable of flow control, Received PAUSE */
-			/* frames are still honored, i.e.,             */
-			/* transmitted frames would be paused by       */
-			/* incoming PAUSE frames                       */
-			bdp->config[16] = DFLT_NO_FC_DELAY_LSB;
-			bdp->config[17] = DFLT_NO_FC_DELAY_MSB;
-			bdp->config[19] &= ~(CB_CFIG_FC_RESTOP | CB_CFIG_FC_RESTART);
-			bdp->config[19] |= CB_CFIG_FC_REJECT;
-			bdp->config[19] &= ~CB_CFIG_TX_FC_DIS;
-		} else {
-			bdp->config[16] = DFLT_FC_DELAY_LSB;
-			bdp->config[17] = DFLT_FC_DELAY_MSB;
-			bdp->config[19] |= CB_CFIG_FC_OPTS;
-			bdp->config[19] &= ~CB_CFIG_TX_FC_DIS;
-		}
-	} else {
-		bdp->config[16] = DFLT_NO_FC_DELAY_LSB;
-		bdp->config[17] = DFLT_NO_FC_DELAY_MSB;
-		bdp->config[19] &= ~CB_CFIG_FC_OPTS;
-		bdp->config[19] |= CB_CFIG_TX_FC_DIS;
-	}
-	E100_CONFIG(bdp, 19);
-	spin_unlock_bh(&(bdp->config_lock));
-
-	return;
-}
-
-/**
- * e100_config_promisc - configure promiscuous mode
- * @bdp: atapter's private data struct
- * @enable: should we enable this option or not
- *
- * This routine will enable or disable promiscuous mode
- * in the adapter's config block.
- */
-void
-e100_config_promisc(struct e100_private *bdp, unsigned char enable)
-{
-	spin_lock_bh(&(bdp->config_lock));
-
-	/* if in promiscuous mode, save bad frames */
-	if (enable) {
-
-		if (!(bdp->config[6] & CB_CFIG_SAVE_BAD_FRAMES)) {
-			bdp->config[6] |= CB_CFIG_SAVE_BAD_FRAMES;
-			E100_CONFIG(bdp, 6);
-		}
-
-		if (bdp->config[7] & (u8) BIT_0) {
-			bdp->config[7] &= (u8) (~BIT_0);
-			E100_CONFIG(bdp, 7);
-		}
-
-		if (!(bdp->config[15] & CB_CFIG_PROMISCUOUS)) {
-			bdp->config[15] |= CB_CFIG_PROMISCUOUS;
-			E100_CONFIG(bdp, 15);
-		}
-
-	} else {		/* not in promiscuous mode */
-
-		if (bdp->config[6] & CB_CFIG_SAVE_BAD_FRAMES) {
-			bdp->config[6] &= ~CB_CFIG_SAVE_BAD_FRAMES;
-			E100_CONFIG(bdp, 6);
-		}
-
-		if (!(bdp->config[7] & (u8) BIT_0)) {
-			bdp->config[7] |= (u8) (BIT_0);
-			E100_CONFIG(bdp, 7);
-		}
-
-		if (bdp->config[15] & CB_CFIG_PROMISCUOUS) {
-			bdp->config[15] &= ~CB_CFIG_PROMISCUOUS;
-			E100_CONFIG(bdp, 15);
-		}
-	}
-
-	spin_unlock_bh(&(bdp->config_lock));
-}
-
-/**
- * e100_config_mulcast_enbl - configure allmulti mode
- * @bdp: atapter's private data struct
- * @enable: should we enable this option or not
- *
- * This routine will enable or disable reception of all multicast packets
- * in the adapter's config block.
- */
-void
-e100_config_mulcast_enbl(struct e100_private *bdp, unsigned char enable)
-{
-	spin_lock_bh(&(bdp->config_lock));
-
-	/* this flag is used to enable receiving all multicast packet */
-	if (enable) {
-		if (!(bdp->config[21] & CB_CFIG_MULTICAST_ALL)) {
-			bdp->config[21] |= CB_CFIG_MULTICAST_ALL;
-			E100_CONFIG(bdp, 21);
-		}
-
-	} else {
-		if (bdp->config[21] & CB_CFIG_MULTICAST_ALL) {
-			bdp->config[21] &= ~CB_CFIG_MULTICAST_ALL;
-			E100_CONFIG(bdp, 21);
-		}
-	}
-
-	spin_unlock_bh(&(bdp->config_lock));
-}
-
-/**
- * e100_config_ifs - configure the IFS parameter
- * @bdp: atapter's private data struct
- *
- * This routine will configure the adaptive IFS value
- * in the adapter's config block. IFS values are only
- * relevant in half duplex, so set to 0 in full duplex.
- */
-void
-e100_config_ifs(struct e100_private *bdp)
-{
-	u8 value = 0;
-
-	spin_lock_bh(&(bdp->config_lock));
-
-	/* IFS value is only needed to be specified at half-duplex mode */
-	if (bdp->cur_dplx_mode == HALF_DUPLEX) {
-		value = (u8) bdp->ifs_value;
-	}
-
-	if (bdp->config[2] != value) {
-		bdp->config[2] = value;
-		E100_CONFIG(bdp, 2);
-	}
-
-	spin_unlock_bh(&(bdp->config_lock));
-}
-
-/**
- * e100_config_force_dplx - configure the forced full duplex mode
- * @bdp: atapter's private data struct
- *
- * This routine will enable or disable force full duplex
- * in the adapter's config block. If the PHY is 503, and
- * the duplex is full, consider the adapter forced.
- */
-void
-e100_config_force_dplx(struct e100_private *bdp)
-{
-	spin_lock_bh(&(bdp->config_lock));
-
-	/* We must force full duplex on if we are using PHY 0, and we are */
-	/* supposed to run in FDX mode. We do this because the e100 has only */
-	/* one FDX# input pin, and that pin will be connected to PHY 1. */
-	/* Changed the 'if' condition below to fix performance problem * at 10
-	 * full. The Phy was getting forced to full duplex while the MAC * was
-	 * not, because the cur_dplx_mode was not being set to 2 by SetupPhy. *
-	 * This is how the condition was, initially. * This has been changed so
-	 * that the MAC gets forced to full duplex * simply if the user has
-	 * forced full duplex. * * if (( bdp->phy_addr == 0 ) && (
-	 * bdp->cur_dplx_mode == 2 )) */
-	/* The rest of the fix is in the PhyDetect code. */
-	if ((bdp->params.e100_speed_duplex == E100_SPEED_10_FULL) ||
-	    (bdp->params.e100_speed_duplex == E100_SPEED_100_FULL) ||
-	    ((bdp->phy_addr == 32) && (bdp->cur_dplx_mode == FULL_DUPLEX))) {
-		if (!(bdp->config[19] & (u8) CB_CFIG_FORCE_FDX)) {
-			bdp->config[19] |= (u8) CB_CFIG_FORCE_FDX;
-			E100_CONFIG(bdp, 19);
-		}
-
-	} else {
-		if (bdp->config[19] & (u8) CB_CFIG_FORCE_FDX) {
-			bdp->config[19] &= (u8) (~CB_CFIG_FORCE_FDX);
-			E100_CONFIG(bdp, 19);
-		}
-	}
-
-	spin_unlock_bh(&(bdp->config_lock));
-}
-
-/**
- * e100_config_long_rx
- * @bdp: atapter's private data struct
- * @enable: should we enable this option or not
- *
- * This routine will enable or disable reception of larger packets.
- * This is needed by VLAN implementations.
- */
-static void
-e100_config_long_rx(struct e100_private *bdp, unsigned char enable)
-{
-	if (enable) {
-		if (!(bdp->config[18] & CB_CFIG_LONG_RX_OK)) {
-			bdp->config[18] |= CB_CFIG_LONG_RX_OK;
-			E100_CONFIG(bdp, 18);
-		}
-
-	} else {
-		if ((bdp->config[18] & CB_CFIG_LONG_RX_OK)) {
-			bdp->config[18] &= ~CB_CFIG_LONG_RX_OK;
-			E100_CONFIG(bdp, 18);
-		}
-	}
-}
-
-/**
- * e100_config_wol
- * @bdp: atapter's private data struct
- *
- * This sets configuration options for PHY and Magic Packet WoL 
- */
-void
-e100_config_wol(struct e100_private *bdp)
-{
-	spin_lock_bh(&(bdp->config_lock));
-
-	if (bdp->wolopts & WAKE_PHY) {
-		bdp->config[9] |= CB_LINK_STATUS_WOL;
-	}
-	else {
-		/* Disable PHY WoL */
-		bdp->config[9] &= ~CB_LINK_STATUS_WOL;
-	}
-
-	if (bdp->wolopts & WAKE_MAGIC) {
-		bdp->config[19] &= ~CB_DISABLE_MAGPAK_WAKE;
-	}
-	else {
-		/* Disable Magic Packet WoL */
-		bdp->config[19] |= CB_DISABLE_MAGPAK_WAKE;
-	}
-
-	E100_CONFIG(bdp, 19);
-	spin_unlock_bh(&(bdp->config_lock));
-}
-
-void
-e100_config_vlan_drop(struct e100_private *bdp, unsigned char enable)
-{
-	spin_lock_bh(&(bdp->config_lock));
-	if (enable) {
-		if (!(bdp->config[22] & CB_CFIG_VLAN_DROP_ENABLE)) {
-			bdp->config[22] |= CB_CFIG_VLAN_DROP_ENABLE;
-			E100_CONFIG(bdp, 22);
-		}
-
-	} else {
-		if ((bdp->config[22] & CB_CFIG_VLAN_DROP_ENABLE)) {
-			bdp->config[22] &= ~CB_CFIG_VLAN_DROP_ENABLE;
-			E100_CONFIG(bdp, 22);
-		}
-	}
-	spin_unlock_bh(&(bdp->config_lock));
-}
-
-/**
- * e100_config_loopback_mode
- * @bdp: atapter's private data struct
- * @mode: loopback mode(phy/mac/none)
- *
- */
-unsigned char
-e100_config_loopback_mode(struct e100_private *bdp, u8 mode)
-{
-	unsigned char bc_changed = false;
-	u8 config_byte;
-
-	spin_lock_bh(&(bdp->config_lock));
-
-	switch (mode) {
-	case NO_LOOPBACK:
-		config_byte = CB_CFIG_LOOPBACK_NORMAL;
-		break;
-	case MAC_LOOPBACK:
-		config_byte = CB_CFIG_LOOPBACK_INTERNAL;
-		break;
-	case PHY_LOOPBACK:
-		config_byte = CB_CFIG_LOOPBACK_EXTERNAL;
-		break;
-	default:
-		printk(KERN_NOTICE "e100: e100_config_loopback_mode: "
-		       "Invalid argument 'mode': %d\n", mode);
-		goto exit;
-	}
-
-	if ((bdp->config[10] & CB_CFIG_LOOPBACK_MODE) != config_byte) {
-
-		bdp->config[10] &= (~CB_CFIG_LOOPBACK_MODE);
-		bdp->config[10] |= config_byte;
-		E100_CONFIG(bdp, 10);
-		bc_changed = true;
-	}
-
-exit:
-	spin_unlock_bh(&(bdp->config_lock));
-	return bc_changed;
-}
-unsigned char
-e100_config_tcb_ext_enable(struct e100_private *bdp, unsigned char enable)
-{
-        unsigned char bc_changed = false;
- 
-        spin_lock_bh(&(bdp->config_lock));
- 
-        if (enable) {
-                if (bdp->config[6] & CB_CFIG_EXT_TCB_DIS) {
- 
-                        bdp->config[6] &= (~CB_CFIG_EXT_TCB_DIS);
-                        E100_CONFIG(bdp, 6);
-                        bc_changed = true;
-                }
- 
-        } else {
-                if (!(bdp->config[6] & CB_CFIG_EXT_TCB_DIS)) {
- 
-                        bdp->config[6] |= CB_CFIG_EXT_TCB_DIS;
-                        E100_CONFIG(bdp, 6);
-                        bc_changed = true;
-                }
-        }
-        spin_unlock_bh(&(bdp->config_lock));
- 
-        return bc_changed;
-}
-unsigned char
-e100_config_dynamic_tbd(struct e100_private *bdp, unsigned char enable)
-{
-        unsigned char bc_changed = false;
- 
-        spin_lock_bh(&(bdp->config_lock));
- 
-        if (enable) {
-                if (!(bdp->config[7] & CB_CFIG_DYNTBD_EN)) {
- 
-                        bdp->config[7] |= CB_CFIG_DYNTBD_EN;
-                        E100_CONFIG(bdp, 7);
-                        bc_changed = true;
-                }
- 
-        } else {
-                if (bdp->config[7] & CB_CFIG_DYNTBD_EN) {
- 
-                        bdp->config[7] &= (~CB_CFIG_DYNTBD_EN);
-                        E100_CONFIG(bdp, 7);
-                        bc_changed = true;
-                }
-        }
-        spin_unlock_bh(&(bdp->config_lock));
- 
-        return bc_changed;
-}
-
--- diff/drivers/net/e100/e100_config.h	2003-09-30 15:46:15.000000000 +0100
+++ source/drivers/net/e100/e100_config.h	1970-01-01 01:00:00.000000000 +0100
@@ -1,168 +0,0 @@
-/*******************************************************************************
-
-  
-  Copyright(c) 1999 - 2003 Intel Corporation. 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.
-  
-  The full GNU General Public License is included in this distribution in the
-  file called LICENSE.
-  
-  Contact Information:
-  Linux NICS <linux.nics@intel.com>
-  Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
-*******************************************************************************/
-
-#ifndef _E100_CONFIG_INC_
-#define _E100_CONFIG_INC_
-
-#include "e100.h"
-
-#define E100_CONFIG(bdp, X) ((bdp)->config[0] = max_t(u8, (bdp)->config[0], (X)+1))
-
-#define CB_CFIG_MIN_PARAMS         8
-
-/* byte 0 bit definitions*/
-#define CB_CFIG_BYTE_COUNT_MASK     BIT_0_5	/* Byte count occupies bit 5-0 */
-
-/* byte 1 bit definitions*/
-#define CB_CFIG_RXFIFO_LIMIT_MASK   BIT_0_4	/* RxFifo limit mask */
-#define CB_CFIG_TXFIFO_LIMIT_MASK   BIT_4_7	/* TxFifo limit mask */
-
-/* byte 2 bit definitions -- ADAPTIVE_IFS*/
-
-/* word 3 bit definitions -- RESERVED*/
-/* Changed for 82558 enhancements */
-/* byte 3 bit definitions */
-#define CB_CFIG_MWI_EN      BIT_0	/* Enable MWI on PCI bus */
-#define CB_CFIG_TYPE_EN     BIT_1	/* Type Enable */
-#define CB_CFIG_READAL_EN   BIT_2	/* Enable Read Align */
-#define CB_CFIG_TERMCL_EN   BIT_3	/* Cache line write  */
-
-/* byte 4 bit definitions*/
-#define CB_CFIG_RX_MIN_DMA_MASK     BIT_0_6	/* Rx minimum DMA count mask */
-
-/* byte 5 bit definitions*/
-#define CB_CFIG_TX_MIN_DMA_MASK BIT_0_6	/* Tx minimum DMA count mask */
-#define CB_CFIG_DMBC_EN         BIT_7	/* Enable Tx/Rx min. DMA counts */
-
-/* Changed for 82558 enhancements */
-/* byte 6 bit definitions*/
-#define CB_CFIG_LATE_SCB           BIT_0	/* Update SCB After New Tx Start */
-#define CB_CFIG_DIRECT_DMA_DIS     BIT_1	/* Direct DMA mode */
-#define CB_CFIG_TNO_INT            BIT_2	/* Tx Not OK Interrupt */
-#define CB_CFIG_TCO_STAT           BIT_2	/* TCO statistics in 559 and above */
-#define CB_CFIG_CI_INT             BIT_3	/* Command Complete Interrupt */
-#define CB_CFIG_EXT_TCB_DIS        BIT_4	/* Extended TCB */
-#define CB_CFIG_EXT_STAT_DIS       BIT_5	/* Extended Stats */
-#define CB_CFIG_SAVE_BAD_FRAMES    BIT_7	/* Save Bad Frames Enabled */
-
-/* byte 7 bit definitions*/
-#define CB_CFIG_DISC_SHORT_FRAMES   BIT_0	/* Discard Short Frames */
-#define CB_CFIG_DYNTBD_EN           BIT_7	/* Enable dynamic TBD */
-/* Enable extended RFD's on D102 */
-#define CB_CFIG_EXTENDED_RFD        BIT_5
-
-/* byte 8 bit definitions*/
-#define CB_CFIG_503_MII             BIT_0	/* 503 vs. MII mode */
-
-/* byte 9 bit definitions -- pre-defined all zeros*/
-#define CB_LINK_STATUS_WOL	BIT_5
-
-/* byte 10 bit definitions*/
-#define CB_CFIG_NO_SRCADR       BIT_3	/* No Source Address Insertion */
-#define CB_CFIG_PREAMBLE_LEN    BIT_4_5	/* Preamble Length */
-#define CB_CFIG_LOOPBACK_MODE   BIT_6_7	/* Loopback Mode */
-#define CB_CFIG_LOOPBACK_NORMAL 0
-#define CB_CFIG_LOOPBACK_INTERNAL BIT_6
-#define CB_CFIG_LOOPBACK_EXTERNAL BIT_6_7
-
-/* byte 11 bit definitions*/
-#define CB_CFIG_LINEAR_PRIORITY     BIT_0_2	/* Linear Priority */
-
-/* byte 12 bit definitions*/
-#define CB_CFIG_LINEAR_PRI_MODE     BIT_0	/* Linear Priority mode */
-#define CB_CFIG_IFS_MASK            BIT_4_7	/* Interframe Spacing mask */
-
-/* byte 13 bit definitions -- pre-defined all zeros*/
-
-/* byte 14 bit definitions -- pre-defined 0xf2*/
-
-/* byte 15 bit definitions*/
-#define CB_CFIG_PROMISCUOUS         BIT_0	/* Promiscuous Mode Enable */
-#define CB_CFIG_BROADCAST_DIS       BIT_1	/* Broadcast Mode Disable */
-#define CB_CFIG_CRS_OR_CDT          BIT_7	/* CRS Or CDT */
-
-/* byte 16 bit definitions -- pre-defined all zeros*/
-#define DFLT_FC_DELAY_LSB  0x1f	/* Delay for outgoing Pause frames */
-#define DFLT_NO_FC_DELAY_LSB  0x00	/* no flow control default value */
-
-/* byte 17 bit definitions -- pre-defined 0x40*/
-#define DFLT_FC_DELAY_MSB  0x01	/* Delay for outgoing Pause frames */
-#define DFLT_NO_FC_DELAY_MSB  0x40	/* no flow control default value */
-
-/* byte 18 bit definitions*/
-#define CB_CFIG_STRIPPING           BIT_0	/* Padding Disabled */
-#define CB_CFIG_PADDING             BIT_1	/* Padding Disabled */
-#define CB_CFIG_CRC_IN_MEM          BIT_2	/* Transfer CRC To Memory */
-
-/* byte 19 bit definitions*/
-#define CB_CFIG_TX_ADDR_WAKE        BIT_0	/* Address Wakeup */
-#define CB_DISABLE_MAGPAK_WAKE      BIT_1	/* Magic Packet Wakeup disable */
-/* Changed TX_FC_EN to TX_FC_DIS because 0 enables, 1 disables. Jul 8, 1999 */
-#define CB_CFIG_TX_FC_DIS           BIT_2	/* Tx Flow Control Disable */
-#define CB_CFIG_FC_RESTOP           BIT_3	/* Rx Flow Control Restop */
-#define CB_CFIG_FC_RESTART          BIT_4	/* Rx Flow Control Restart */
-#define CB_CFIG_FC_REJECT           BIT_5	/* Rx Flow Control Restart */
-#define CB_CFIG_FC_OPTS (CB_CFIG_FC_RESTOP | CB_CFIG_FC_RESTART | CB_CFIG_FC_REJECT)
-
-/* end 82558/9 specifics */
-
-#define CB_CFIG_FORCE_FDX           BIT_6	/* Force Full Duplex */
-#define CB_CFIG_FDX_ENABLE          BIT_7	/* Full Duplex Enabled */
-
-/* byte 20 bit definitions*/
-#define CB_CFIG_MULTI_IA            BIT_6	/* Multiple IA Addr */
-
-/* byte 21 bit definitions*/
-#define CB_CFIG_MULTICAST_ALL       BIT_3	/* Multicast All */
-
-/* byte 22 bit defines */
-#define CB_CFIG_RECEIVE_GAMLA_MODE  BIT_0	/* D102 receive mode */
-#define CB_CFIG_VLAN_DROP_ENABLE    BIT_1	/* vlan stripping */
-
-#define CB_CFIG_LONG_RX_OK	    BIT_3
-
-#define NO_LOOPBACK	0	
-#define MAC_LOOPBACK	0x01
-#define PHY_LOOPBACK	0x02
-
-/* function prototypes */
-extern void e100_config_init(struct e100_private *bdp);
-extern void e100_config_init_82557(struct e100_private *bdp);
-extern unsigned char e100_force_config(struct e100_private *bdp);
-extern unsigned char e100_config(struct e100_private *bdp);
-extern void e100_config_fc(struct e100_private *bdp);
-extern void e100_config_promisc(struct e100_private *bdp, unsigned char enable);
-extern void e100_config_brdcast_dsbl(struct e100_private *bdp);
-extern void e100_config_mulcast_enbl(struct e100_private *bdp,
-				     unsigned char enable);
-extern void e100_config_ifs(struct e100_private *bdp);
-extern void e100_config_force_dplx(struct e100_private *bdp);
-extern u8 e100_config_loopback_mode(struct e100_private *bdp, u8 mode);
-extern u8 e100_config_dynamic_tbd(struct e100_private *bdp, u8 enable);
-extern u8 e100_config_tcb_ext_enable(struct e100_private *bdp, u8 enable);
-extern void e100_config_vlan_drop(struct e100_private *bdp, unsigned char enable);
-#endif /* _E100_CONFIG_INC_ */
--- diff/drivers/net/e100/e100_eeprom.c	2003-05-21 11:49:55.000000000 +0100
+++ source/drivers/net/e100/e100_eeprom.c	1970-01-01 01:00:00.000000000 +0100
@@ -1,565 +0,0 @@
-/*******************************************************************************
-
-  
-  Copyright(c) 1999 - 2003 Intel Corporation. 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.
-  
-  The full GNU General Public License is included in this distribution in the
-  file called LICENSE.
-  
-  Contact Information:
-  Linux NICS <linux.nics@intel.com>
-  Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
-*******************************************************************************/
-
-/**********************************************************************
-*                                                                     *
-* INTEL CORPORATION                                                   *
-*                                                                     *
-* This software is supplied under the terms of the license included   *
-* above.  All use of this driver must be in accordance with the terms *
-* of that license.                                                    *
-*                                                                     *
-* Module Name:  e100_eeprom.c                                         *
-*                                                                     *
-* Abstract:     This module contains routines to read and write to a  *
-*               serial EEPROM                                         *
-*                                                                     *
-* Environment:  This file is intended to be specific to the Linux     *
-*               operating system.                                     *
-*                                                                     *
-**********************************************************************/
-#include "e100.h"
-
-#define CSR_EEPROM_CONTROL_FIELD(bdp) ((bdp)->scb->scb_eprm_cntrl)
-
-#define CSR_GENERAL_CONTROL2_FIELD(bdp) \
-	           ((bdp)->scb->scb_ext.d102_scb.scb_gen_ctrl2)
-
-#define EEPROM_STALL_TIME	4
-#define EEPROM_CHECKSUM		((u16) 0xBABA)
-#define EEPROM_MAX_WORD_SIZE	256
-
-void e100_eeprom_cleanup(struct e100_private *adapter);
-u16 e100_eeprom_calculate_chksum(struct e100_private *adapter);
-static void e100_eeprom_write_word(struct e100_private *adapter, u16 reg,
-				   u16 data);
-void e100_eeprom_write_block(struct e100_private *adapter, u16 start, u16 *data,
-			     u16 size);
-u16 e100_eeprom_size(struct e100_private *adapter);
-u16 e100_eeprom_read(struct e100_private *adapter, u16 reg);
-
-static void shift_out_bits(struct e100_private *adapter, u16 data, u16 count);
-static u16 shift_in_bits(struct e100_private *adapter);
-static void raise_clock(struct e100_private *adapter, u16 *x);
-static void lower_clock(struct e100_private *adapter, u16 *x);
-static u16 eeprom_wait_cmd_done(struct e100_private *adapter);
-static void eeprom_stand_by(struct e100_private *adapter);
-
-//----------------------------------------------------------------------------------------
-// Procedure:   eeprom_set_semaphore
-//
-// Description: This function set (write 1) Gamla EEPROM semaphore bit (bit 23 word 0x1C in the CSR).
-//
-// Arguments:
-//      Adapter                 - Adapter context
-//
-// Returns:  true if success
-//           else return false 
-//
-//----------------------------------------------------------------------------------------
-
-inline u8
-eeprom_set_semaphore(struct e100_private *adapter)
-{
-	u16 data = 0;
-	unsigned long expiration_time = jiffies + HZ / 100 + 1;
-
-	do {
-		// Get current value of General Control 2
-		data = readb(&CSR_GENERAL_CONTROL2_FIELD(adapter));
-
-		// Set bit 23 word 0x1C in the CSR.
-		data |= SCB_GCR2_EEPROM_ACCESS_SEMAPHORE;
-		writeb(data, &CSR_GENERAL_CONTROL2_FIELD(adapter));
-
-		// Check to see if this bit set or not.
-		data = readb(&CSR_GENERAL_CONTROL2_FIELD(adapter));
-
-		if (data & SCB_GCR2_EEPROM_ACCESS_SEMAPHORE) {
-			return true;
-		}
-
-		if (time_before(jiffies, expiration_time))
-			yield();
-		else
-			return false;
-
-	} while (true);
-}
-
-//----------------------------------------------------------------------------------------
-// Procedure:   eeprom_reset_semaphore
-//
-// Description: This function reset (write 0) Gamla EEPROM semaphore bit 
-//              (bit 23 word 0x1C in the CSR).
-//
-// Arguments:  struct e100_private * adapter - Adapter context
-//----------------------------------------------------------------------------------------
-
-inline void
-eeprom_reset_semaphore(struct e100_private *adapter)
-{
-	u16 data = 0;
-
-	data = readb(&CSR_GENERAL_CONTROL2_FIELD(adapter));
-	data &= ~(SCB_GCR2_EEPROM_ACCESS_SEMAPHORE);
-	writeb(data, &CSR_GENERAL_CONTROL2_FIELD(adapter));
-}
-
-//----------------------------------------------------------------------------------------
-// Procedure:   e100_eeprom_size
-//
-// Description: This routine determines the size of the EEPROM.  This value should be
-//              checked for validity - ie. is it too big or too small.  The size returned
-//              is then passed to the read/write functions.
-//
-// Returns:
-//      Size of the eeprom, or zero if an error occurred
-//----------------------------------------------------------------------------------------
-u16
-e100_eeprom_size(struct e100_private *adapter)
-{
-	u16 x, size = 1;	// must be one to accumulate a product
-
-	// if we've already stored this data, read from memory
-	if (adapter->eeprom_size) {
-		return adapter->eeprom_size;
-	}
-	// otherwise, read from the eeprom
-	// Set EEPROM semaphore.
-	if (adapter->rev_id >= D102_REV_ID) {
-		if (!eeprom_set_semaphore(adapter))
-			return 0;
-	}
-	// enable the eeprom by setting EECS.
-	x = readw(&CSR_EEPROM_CONTROL_FIELD(adapter));
-	x &= ~(EEDI | EEDO | EESK);
-	x |= EECS;
-	writew(x, &CSR_EEPROM_CONTROL_FIELD(adapter));
-
-	// write the read opcode
-	shift_out_bits(adapter, EEPROM_READ_OPCODE, 3);
-
-	// experiment to discover the size of the eeprom.  request register zero
-	// and wait for the eeprom to tell us it has accepted the entire address.
-	x = readw(&CSR_EEPROM_CONTROL_FIELD(adapter));
-	do {
-		size *= 2;	// each bit of address doubles eeprom size
-		x |= EEDO;	// set bit to detect "dummy zero"
-		x &= ~EEDI;	// address consists of all zeros
-
-		writew(x, &CSR_EEPROM_CONTROL_FIELD(adapter));
-		readw(&(adapter->scb->scb_status));
-		udelay(EEPROM_STALL_TIME);
-		raise_clock(adapter, &x);
-		lower_clock(adapter, &x);
-
-		// check for "dummy zero"
-		x = readw(&CSR_EEPROM_CONTROL_FIELD(adapter));
-		if (size > EEPROM_MAX_WORD_SIZE) {
-			size = 0;
-			break;
-		}
-	} while (x & EEDO);
-
-	// read in the value requested
-	(void) shift_in_bits(adapter);
-	e100_eeprom_cleanup(adapter);
-
-	// Clear EEPROM Semaphore.
-	if (adapter->rev_id >= D102_REV_ID) {
-		eeprom_reset_semaphore(adapter);
-	}
-
-	return size;
-}
-
-//----------------------------------------------------------------------------------------
-// Procedure:   eeprom_address_size
-//
-// Description: determines the number of bits in an address for the eeprom acceptable
-//              values are 64, 128, and 256
-// Arguments: size of the eeprom
-// Returns: bits in an address for that size eeprom
-//----------------------------------------------------------------------------------------
-
-static inline int
-eeprom_address_size(u16 size)
-{
-	int isize = size;
-	
-	return (ffs(isize) - 1);
-}
-
-//----------------------------------------------------------------------------------------
-// Procedure:   e100_eeprom_read
-//
-// Description: This routine serially reads one word out of the EEPROM.
-//
-// Arguments:
-//      adapter - our adapter context
-//      reg - EEPROM word to read.
-//
-// Returns:
-//      Contents of EEPROM word (reg).
-//----------------------------------------------------------------------------------------
-
-u16
-e100_eeprom_read(struct e100_private *adapter, u16 reg)
-{
-	u16 x, data, bits;
-
-	// Set EEPROM semaphore.
-	if (adapter->rev_id >= D102_REV_ID) {
-		if (!eeprom_set_semaphore(adapter))
-			return 0;
-	}
-	// eeprom size is initialized to zero
-	if (!adapter->eeprom_size)
-		adapter->eeprom_size = e100_eeprom_size(adapter);
-
-	bits = eeprom_address_size(adapter->eeprom_size);
-
-	// select EEPROM, reset bits, set EECS
-	x = readw(&CSR_EEPROM_CONTROL_FIELD(adapter));
-
-	x &= ~(EEDI | EEDO | EESK);
-	x |= EECS;
-	writew(x, &CSR_EEPROM_CONTROL_FIELD(adapter));
-
-	// write the read opcode and register number in that order
-	// The opcode is 3bits in length, reg is 'bits' bits long
-	shift_out_bits(adapter, EEPROM_READ_OPCODE, 3);
-	shift_out_bits(adapter, reg, bits);
-
-	// Now read the data (16 bits) in from the selected EEPROM word
-	data = shift_in_bits(adapter);
-
-	e100_eeprom_cleanup(adapter);
-
-	// Clear EEPROM Semaphore.
-	if (adapter->rev_id >= D102_REV_ID) {
-		eeprom_reset_semaphore(adapter);
-	}
-
-	return data;
-}
-
-//----------------------------------------------------------------------------------------
-// Procedure:   shift_out_bits
-//
-// Description: This routine shifts data bits out to the EEPROM.
-//
-// Arguments:
-//      data - data to send to the EEPROM.
-//      count - number of data bits to shift out.
-//
-// Returns: (none)
-//----------------------------------------------------------------------------------------
-
-static void
-shift_out_bits(struct e100_private *adapter, u16 data, u16 count)
-{
-	u16 x, mask;
-
-	mask = 1 << (count - 1);
-	x = readw(&CSR_EEPROM_CONTROL_FIELD(adapter));
-	x &= ~(EEDO | EEDI);
-
-	do {
-		x &= ~EEDI;
-		if (data & mask)
-			x |= EEDI;
-
-		writew(x, &CSR_EEPROM_CONTROL_FIELD(adapter));
-		readw(&(adapter->scb->scb_status)); /* flush command to card */
-		udelay(EEPROM_STALL_TIME);
-		raise_clock(adapter, &x);
-		lower_clock(adapter, &x);
-		mask = mask >> 1;
-	} while (mask);
-
-	x &= ~EEDI;
-	writew(x, &CSR_EEPROM_CONTROL_FIELD(adapter));
-}
-
-//----------------------------------------------------------------------------------------
-// Procedure:   raise_clock
-//
-// Description: This routine raises the EEPROM's clock input (EESK)
-//
-// Arguments:
-//      x - Ptr to the EEPROM control register's current value
-//
-// Returns: (none)
-//----------------------------------------------------------------------------------------
-
-void
-raise_clock(struct e100_private *adapter, u16 *x)
-{
-	*x = *x | EESK;
-	writew(*x, &CSR_EEPROM_CONTROL_FIELD(adapter));
-	readw(&(adapter->scb->scb_status)); /* flush command to card */
-	udelay(EEPROM_STALL_TIME);
-}
-
-//----------------------------------------------------------------------------------------
-// Procedure:   lower_clock
-//
-// Description: This routine lower's the EEPROM's clock input (EESK)
-//
-// Arguments:
-//      x - Ptr to the EEPROM control register's current value
-//
-// Returns: (none)
-//----------------------------------------------------------------------------------------
-
-void
-lower_clock(struct e100_private *adapter, u16 *x)
-{
-	*x = *x & ~EESK;
-	writew(*x, &CSR_EEPROM_CONTROL_FIELD(adapter));
-	readw(&(adapter->scb->scb_status)); /* flush command to card */
-	udelay(EEPROM_STALL_TIME);
-}
-
-//----------------------------------------------------------------------------------------
-// Procedure:   shift_in_bits
-//
-// Description: This routine shifts data bits in from the EEPROM.
-//
-// Arguments:
-//
-// Returns:
-//      The contents of that particular EEPROM word
-//----------------------------------------------------------------------------------------
-
-static u16
-shift_in_bits(struct e100_private *adapter)
-{
-	u16 x, d, i;
-
-	x = readw(&CSR_EEPROM_CONTROL_FIELD(adapter));
-	x &= ~(EEDO | EEDI);
-	d = 0;
-
-	for (i = 0; i < 16; i++) {
-		d <<= 1;
-		raise_clock(adapter, &x);
-
-		x = readw(&CSR_EEPROM_CONTROL_FIELD(adapter));
-
-		x &= ~EEDI;
-		if (x & EEDO)
-			d |= 1;
-
-		lower_clock(adapter, &x);
-	}
-
-	return d;
-}
-
-//----------------------------------------------------------------------------------------
-// Procedure:   e100_eeprom_cleanup
-//
-// Description: This routine returns the EEPROM to an idle state
-//----------------------------------------------------------------------------------------
-
-void
-e100_eeprom_cleanup(struct e100_private *adapter)
-{
-	u16 x;
-
-	x = readw(&CSR_EEPROM_CONTROL_FIELD(adapter));
-
-	x &= ~(EECS | EEDI);
-	writew(x, &CSR_EEPROM_CONTROL_FIELD(adapter));
-
-	raise_clock(adapter, &x);
-	lower_clock(adapter, &x);
-}
-
-//**********************************************************************************
-// Procedure:   e100_eeprom_update_chksum
-//
-// Description: Calculates the checksum and writes it to the EEProm. 
-//              It calculates the checksum accroding to the formula: 
-//                              Checksum = 0xBABA - (sum of first 63 words).
-//
-//-----------------------------------------------------------------------------------
-u16
-e100_eeprom_calculate_chksum(struct e100_private *adapter)
-{
-	u16 idx, xsum_index, checksum = 0;
-
-	// eeprom size is initialized to zero
-	if (!adapter->eeprom_size)
-		adapter->eeprom_size = e100_eeprom_size(adapter);
-
-	xsum_index = adapter->eeprom_size - 1;
-	for (idx = 0; idx < xsum_index; idx++)
-		checksum += e100_eeprom_read(adapter, idx);
-
-	checksum = EEPROM_CHECKSUM - checksum;
-	return checksum;
-}
-
-//----------------------------------------------------------------------------------------
-// Procedure:   e100_eeprom_write_word
-//
-// Description: This routine writes a word to a specific EEPROM location without.
-//              taking EEPROM semaphore and updating checksum. 
-//              Use e100_eeprom_write_block for the EEPROM update
-// Arguments: reg - The EEPROM word that we are going to write to.
-//            data - The data (word) that we are going to write to the EEPROM.
-//----------------------------------------------------------------------------------------
-static void
-e100_eeprom_write_word(struct e100_private *adapter, u16 reg, u16 data)
-{
-	u16 x;
-	u16 bits;
-
-	bits = eeprom_address_size(adapter->eeprom_size);
-
-	/* select EEPROM, mask off ASIC and reset bits, set EECS */
-	x = readw(&CSR_EEPROM_CONTROL_FIELD(adapter));
-	x &= ~(EEDI | EEDO | EESK);
-	writew(x, &CSR_EEPROM_CONTROL_FIELD(adapter));
-	readw(&(adapter->scb->scb_status)); /* flush command to card */
-	udelay(EEPROM_STALL_TIME);
-	x |= EECS;
-	writew(x, &CSR_EEPROM_CONTROL_FIELD(adapter));
-
-	shift_out_bits(adapter, EEPROM_EWEN_OPCODE, 5);
-	shift_out_bits(adapter, reg, (u16) (bits - 2));
-	if (!eeprom_wait_cmd_done(adapter))
-		return;
-
-	/* write the new word to the EEPROM & send the write opcode the EEPORM */
-	shift_out_bits(adapter, EEPROM_WRITE_OPCODE, 3);
-
-	/* select which word in the EEPROM that we are writing to */
-	shift_out_bits(adapter, reg, bits);
-
-	/* write the data to the selected EEPROM word */
-	shift_out_bits(adapter, data, 16);
-	if (!eeprom_wait_cmd_done(adapter))
-		return;
-
-	shift_out_bits(adapter, EEPROM_EWDS_OPCODE, 5);
-	shift_out_bits(adapter, reg, (u16) (bits - 2));
-	if (!eeprom_wait_cmd_done(adapter))
-		return;
-
-	e100_eeprom_cleanup(adapter);
-}
-
-//----------------------------------------------------------------------------------------
-// Procedure:   e100_eeprom_write_block
-//
-// Description: This routine writes a block of words starting from specified EEPROM 
-//              location and updates checksum
-// Arguments: reg - The EEPROM word that we are going to write to.
-//            data - The data (word) that we are going to write to the EEPROM.
-//----------------------------------------------------------------------------------------
-void
-e100_eeprom_write_block(struct e100_private *adapter, u16 start, u16 *data,
-			u16 size)
-{
-	u16 checksum;
-	u16 i;
-
-	if (!adapter->eeprom_size)
-		adapter->eeprom_size = e100_eeprom_size(adapter);
-
-	// Set EEPROM semaphore.
-	if (adapter->rev_id >= D102_REV_ID) {
-		if (!eeprom_set_semaphore(adapter))
-			return;
-	}
-
-	for (i = 0; i < size; i++) {
-		e100_eeprom_write_word(adapter, start + i, data[i]);
-	}
-	//Update checksum
-	checksum = e100_eeprom_calculate_chksum(adapter);
-	e100_eeprom_write_word(adapter, (adapter->eeprom_size - 1), checksum);
-
-	// Clear EEPROM Semaphore.
-	if (adapter->rev_id >= D102_REV_ID) {
-		eeprom_reset_semaphore(adapter);
-	}
-}
-
-//----------------------------------------------------------------------------------------
-// Procedure:   eeprom_wait_cmd_done
-//
-// Description: This routine waits for the the EEPROM to finish its command.  
-//                              Specifically, it waits for EEDO (data out) to go high.
-// Returns:     true - If the command finished
-//              false - If the command never finished (EEDO stayed low)
-//----------------------------------------------------------------------------------------
-static u16
-eeprom_wait_cmd_done(struct e100_private *adapter)
-{
-	u16 x;
-	unsigned long expiration_time = jiffies + HZ / 100 + 1;
-
-	eeprom_stand_by(adapter);
-
-	do {
-		rmb();
-		x = readw(&CSR_EEPROM_CONTROL_FIELD(adapter));
-		if (x & EEDO)
-			return true;
-		if (time_before(jiffies, expiration_time))
-			yield();
-		else
-			return false;
-	} while (true);
-}
-
-//----------------------------------------------------------------------------------------
-// Procedure:   eeprom_stand_by
-//
-// Description: This routine lowers the EEPROM chip select (EECS) for a few microseconds.
-//----------------------------------------------------------------------------------------
-static void
-eeprom_stand_by(struct e100_private *adapter)
-{
-	u16 x;
-
-	x = readw(&CSR_EEPROM_CONTROL_FIELD(adapter));
-	x &= ~(EECS | EESK);
-	writew(x, &CSR_EEPROM_CONTROL_FIELD(adapter));
-	readw(&(adapter->scb->scb_status)); /* flush command to card */
-	udelay(EEPROM_STALL_TIME);
-	x |= EECS;
-	writew(x, &CSR_EEPROM_CONTROL_FIELD(adapter));
-	readw(&(adapter->scb->scb_status)); /* flush command to card */
-	udelay(EEPROM_STALL_TIME);
-}
--- diff/drivers/net/e100/e100_main.c	2004-01-19 10:22:57.000000000 +0000
+++ source/drivers/net/e100/e100_main.c	1970-01-01 01:00:00.000000000 +0100
@@ -1,4343 +0,0 @@
-/*******************************************************************************
-
-  
-  Copyright(c) 1999 - 2003 Intel Corporation. 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.
-  
-  The full GNU General Public License is included in this distribution in the
-  file called LICENSE.
-  
-  Contact Information:
-  Linux NICS <linux.nics@intel.com>
-  Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
-*******************************************************************************/
-
-/**********************************************************************
-*                                                                     *
-* INTEL CORPORATION                                                   *
-*                                                                     *
-* This software is supplied under the terms of the license included   *
-* above.  All use of this driver must be in accordance with the terms *
-* of that license.                                                    *
-*                                                                     *
-* Module Name:  e100_main.c                                           *
-*                                                                     *
-* Abstract:     Functions for the driver entry points like load,      *
-*               unload, open and close. All board specific calls made *
-*               by the network interface section of the driver.       *
-*                                                                     *
-* Environment:  This file is intended to be specific to the Linux     *
-*               operating system.                                     *
-*                                                                     *
-**********************************************************************/
-
-/* Change Log
- * 
- * 2.3.30       09/21/03
- * o Bug fix (Bugzilla 97908): Loading e100 was causing crash on Itanium2
- *   with HP chipset
- * o Bug fix (Bugzilla 101583): e100 can't pass traffic with ipv6
- * o Bug fix (Bugzilla 101360): PRO/10+ can't pass traffic
- * 
- * 2.3.27       08/08/03
- * o Bug fix: read skb->len after freeing skb
- *   [Andrew Morton] akpm@zip.com.au
- * o Bug fix: 82557 (with National PHY) timeout during init
- *   [Adam Kropelin] akropel1@rochester.rr.com
- * o Feature add: allow to change Wake On LAN when EEPROM disabled
- * 
- * 2.3.13       05/08/03
- */
- 
-#include <linux/config.h>
-#include <net/checksum.h>
-#include <linux/tcp.h>
-#include <linux/udp.h>
-#include "e100.h"
-#include "e100_ucode.h"
-#include "e100_config.h"
-#include "e100_phy.h"
-
-extern void e100_force_speed_duplex_to_phy(struct e100_private *bdp);
-
-static char e100_gstrings_stats[][ETH_GSTRING_LEN] = {
-	"rx_packets", "tx_packets", "rx_bytes", "tx_bytes", "rx_errors",
-	"tx_errors", "rx_dropped", "tx_dropped", "multicast", "collisions",
-	"rx_length_errors", "rx_over_errors", "rx_crc_errors",
-	"rx_frame_errors", "rx_fifo_errors", "rx_missed_errors",
-	"tx_aborted_errors", "tx_carrier_errors", "tx_fifo_errors",
-	"tx_heartbeat_errors", "tx_window_errors",
-};
-#define E100_STATS_LEN	sizeof(e100_gstrings_stats) / ETH_GSTRING_LEN
-
-static int e100_do_ethtool_ioctl(struct net_device *, struct ifreq *);
-static void e100_get_speed_duplex_caps(struct e100_private *);
-static int e100_ethtool_get_settings(struct net_device *, struct ifreq *);
-static int e100_ethtool_set_settings(struct net_device *, struct ifreq *);
-
-static int e100_ethtool_get_drvinfo(struct net_device *, struct ifreq *);
-static int e100_ethtool_eeprom(struct net_device *, struct ifreq *);
-
-#define E100_EEPROM_MAGIC 0x1234
-static int e100_ethtool_glink(struct net_device *, struct ifreq *);
-static int e100_ethtool_gregs(struct net_device *, struct ifreq *);
-static int e100_ethtool_nway_rst(struct net_device *, struct ifreq *);
-static int e100_ethtool_wol(struct net_device *, struct ifreq *);
-#ifdef CONFIG_PM
-static unsigned char e100_setup_filter(struct e100_private *bdp);
-static void e100_do_wol(struct pci_dev *pcid, struct e100_private *bdp);
-#endif
-static u16 e100_get_ip_lbytes(struct net_device *dev);
-extern void e100_config_wol(struct e100_private *bdp);
-extern u32 e100_run_diag(struct net_device *dev, u64 *test_info, u32 flags);
-static int e100_ethtool_test(struct net_device *, struct ifreq *);
-static int e100_ethtool_gstrings(struct net_device *, struct ifreq *);
-static char test_strings[][ETH_GSTRING_LEN] = {
-	"Link test     (on/offline)",
-	"Eeprom test   (on/offline)",
-	"Self test        (offline)",
-	"Mac loopback     (offline)",
-	"Phy loopback     (offline)",
-	"Cable diagnostic (offline)"
-};
-
-static int e100_ethtool_led_blink(struct net_device *, struct ifreq *);
-
-static int e100_mii_ioctl(struct net_device *, struct ifreq *, int);
-
-static unsigned char e100_delayed_exec_non_cu_cmd(struct e100_private *,
-						  nxmit_cb_entry_t *);
-static void e100_free_nontx_list(struct e100_private *);
-static void e100_non_tx_background(unsigned long);
-static inline void e100_tx_skb_free(struct e100_private *bdp, tcb_t *tcb);
-/* Global Data structures and variables */
-char e100_copyright[] = "Copyright (c) 2003 Intel Corporation";
-char e100_driver_version[]="2.3.30-k1";
-const char *e100_full_driver_name = "Intel(R) PRO/100 Network Driver";
-char e100_short_driver_name[] = "e100";
-static int e100nics = 0;
-static void e100_vlan_rx_register(struct net_device *netdev, struct vlan_group
-		*grp);
-static void e100_vlan_rx_add_vid(struct net_device *netdev, u16 vid);
-static void e100_vlan_rx_kill_vid(struct net_device *netdev, u16 vid);
-
-#ifdef CONFIG_PM
-static int e100_notify_reboot(struct notifier_block *, unsigned long event, void *ptr);
-static int e100_suspend(struct pci_dev *pcid, u32 state);
-static int e100_resume(struct pci_dev *pcid);
-static unsigned char e100_asf_enabled(struct e100_private *bdp);
-struct notifier_block e100_notifier_reboot = {
-        .notifier_call  = e100_notify_reboot,
-        .next           = NULL,
-        .priority       = 0
-};
-#endif
-
-/*********************************************************************/
-/*! This is a GCC extension to ANSI C.
- *  See the item "Labeled Elements in Initializers" in the section
- *  "Extensions to the C Language Family" of the GCC documentation.
- *********************************************************************/
-#define E100_PARAM_INIT { [0 ... E100_MAX_NIC] = -1 }
-
-/* All parameters are treated the same, as an integer array of values.
- * This macro just reduces the need to repeat the same declaration code
- * over and over (plus this helps to avoid typo bugs).
- */
-#define E100_PARAM(X, S)                                        \
-        static const int X[E100_MAX_NIC + 1] = E100_PARAM_INIT; \
-        MODULE_PARM(X, "1-" __MODULE_STRING(E100_MAX_NIC) "i"); \
-        MODULE_PARM_DESC(X, S);
-
-/* ====================================================================== */
-static u8 e100_D101M_checksum(struct e100_private *, struct sk_buff *);
-static u8 e100_D102_check_checksum(rfd_t *);
-static int e100_ioctl(struct net_device *, struct ifreq *, int);
-static int e100_change_mtu(struct net_device *, int);
-static int e100_xmit_frame(struct sk_buff *, struct net_device *);
-static unsigned char e100_init(struct e100_private *);
-static int e100_set_mac(struct net_device *, void *);
-struct net_device_stats *e100_get_stats(struct net_device *);
-
-static irqreturn_t e100intr(int, void *, struct pt_regs *);
-static void e100_print_brd_conf(struct e100_private *);
-static void e100_set_multi(struct net_device *);
-
-static u8 e100_pci_setup(struct pci_dev *, struct e100_private *);
-static u8 e100_sw_init(struct e100_private *);
-static void e100_tco_workaround(struct e100_private *);
-static unsigned char e100_alloc_space(struct e100_private *);
-static void e100_dealloc_space(struct e100_private *);
-static int e100_alloc_tcb_pool(struct e100_private *);
-static void e100_setup_tcb_pool(tcb_t *, unsigned int, struct e100_private *);
-static void e100_free_tcb_pool(struct e100_private *);
-static int e100_alloc_rfd_pool(struct e100_private *);
-static void e100_free_rfd_pool(struct e100_private *);
-
-static void e100_rd_eaddr(struct e100_private *);
-static void e100_rd_pwa_no(struct e100_private *);
-extern u16 e100_eeprom_read(struct e100_private *, u16);
-extern void e100_eeprom_write_block(struct e100_private *, u16, u16 *, u16);
-extern u16 e100_eeprom_size(struct e100_private *);
-u16 e100_eeprom_calculate_chksum(struct e100_private *adapter);
-
-static unsigned char e100_clr_cntrs(struct e100_private *);
-static unsigned char e100_load_microcode(struct e100_private *);
-static unsigned char e100_setup_iaaddr(struct e100_private *, u8 *);
-static unsigned char e100_update_stats(struct e100_private *bdp);
-
-static void e100_start_ru(struct e100_private *);
-static void e100_dump_stats_cntrs(struct e100_private *);
-
-static void e100_check_options(int board, struct e100_private *bdp);
-static void e100_set_int_option(int *, int, int, int, int, char *);
-static void e100_set_bool_option(struct e100_private *bdp, int, u32, int,
-				 char *);
-unsigned char e100_wait_exec_cmplx(struct e100_private *, u32, u8, u8);
-void e100_exec_cmplx(struct e100_private *, u32, u8);
-
-/**
- * e100_get_rx_struct - retrieve cell to hold skb buff from the pool
- * @bdp: atapter's private data struct
- *
- * Returns the new cell to hold sk_buff or %NULL.
- */
-static inline struct rx_list_elem *
-e100_get_rx_struct(struct e100_private *bdp)
-{
-	struct rx_list_elem *rx_struct = NULL;
-
-	if (!list_empty(&(bdp->rx_struct_pool))) {
-		rx_struct = list_entry(bdp->rx_struct_pool.next,
-				       struct rx_list_elem, list_elem);
-		list_del(&(rx_struct->list_elem));
-	}
-
-	return rx_struct;
-}
-
-/**
- * e100_alloc_skb - allocate an skb for the adapter
- * @bdp: atapter's private data struct
- *
- * Allocates skb with enough room for rfd, and data, and reserve non-data space.
- * Returns the new cell with sk_buff or %NULL.
- */
-static inline struct rx_list_elem *
-e100_alloc_skb(struct e100_private *bdp)
-{
-	struct sk_buff *new_skb;
-	u32 skb_size = sizeof (rfd_t);
-	struct rx_list_elem *rx_struct;
-
-	new_skb = (struct sk_buff *) dev_alloc_skb(skb_size);
-	if (new_skb) {
-		/* The IP data should be 
-		   DWORD aligned. since the ethernet header is 14 bytes long, 
-		   we need to reserve 2 extra bytes so that the TCP/IP headers
-		   will be DWORD aligned. */
-		skb_reserve(new_skb, 2);
-		if ((rx_struct = e100_get_rx_struct(bdp)) == NULL)
-			goto err;
-		rx_struct->skb = new_skb;
-		rx_struct->dma_addr = pci_map_single(bdp->pdev, new_skb->data,
-						     sizeof (rfd_t),
-						     PCI_DMA_FROMDEVICE);
-		if (!rx_struct->dma_addr)
-			goto err;
-		skb_reserve(new_skb, bdp->rfd_size);
-		return rx_struct;
-	} else {
-		return NULL;
-	}
-
-err:
-	dev_kfree_skb_irq(new_skb);
-	return NULL;
-}
-
-/**
- * e100_add_skb_to_end - add an skb to the end of our rfd list
- * @bdp: atapter's private data struct
- * @rx_struct: rx_list_elem with the new skb
- *
- * Adds a newly allocated skb to the end of our rfd list.
- */
-inline void
-e100_add_skb_to_end(struct e100_private *bdp, struct rx_list_elem *rx_struct)
-{
-	rfd_t *rfdn;		/* The new rfd */
-	rfd_t *rfd;		/* The old rfd */
-	struct rx_list_elem *rx_struct_last;
-
-	(rx_struct->skb)->dev = bdp->device;
-	rfdn = RFD_POINTER(rx_struct->skb, bdp);
-	rfdn->rfd_header.cb_status = 0;
-	rfdn->rfd_header.cb_cmd = __constant_cpu_to_le16(RFD_EL_BIT);
-	rfdn->rfd_act_cnt = 0;
-	rfdn->rfd_sz = __constant_cpu_to_le16(RFD_DATA_SIZE);
-
-	pci_dma_sync_single(bdp->pdev, rx_struct->dma_addr, bdp->rfd_size,
-			    PCI_DMA_TODEVICE);
-
-	if (!list_empty(&(bdp->active_rx_list))) {
-		rx_struct_last = list_entry(bdp->active_rx_list.prev,
-					    struct rx_list_elem, list_elem);
-		rfd = RFD_POINTER(rx_struct_last->skb, bdp);
-		pci_dma_sync_single(bdp->pdev, rx_struct_last->dma_addr,
-				    4, PCI_DMA_FROMDEVICE);
-		put_unaligned(cpu_to_le32(rx_struct->dma_addr),
-			      ((u32 *) (&(rfd->rfd_header.cb_lnk_ptr))));
-
-		pci_dma_sync_single(bdp->pdev, rx_struct_last->dma_addr,
-				    8, PCI_DMA_TODEVICE);
-		rfd->rfd_header.cb_cmd &=
-			__constant_cpu_to_le16((u16) ~RFD_EL_BIT);
-
-		pci_dma_sync_single(bdp->pdev, rx_struct_last->dma_addr,
-				    4, PCI_DMA_TODEVICE);
-	}
-
-	list_add_tail(&(rx_struct->list_elem), &(bdp->active_rx_list));
-}
-
-static inline void
-e100_alloc_skbs(struct e100_private *bdp)
-{
-	for (; bdp->skb_req > 0; bdp->skb_req--) {
-		struct rx_list_elem *rx_struct;
-
-		if ((rx_struct = e100_alloc_skb(bdp)) == NULL)
-			return;
-
-		e100_add_skb_to_end(bdp, rx_struct);
-	}
-}
-
-void e100_tx_srv(struct e100_private *);
-u32 e100_rx_srv(struct e100_private *);
-
-void e100_watchdog(struct net_device *);
-void e100_refresh_txthld(struct e100_private *);
-void e100_manage_adaptive_ifs(struct e100_private *);
-void e100_clear_pools(struct e100_private *);
-static void e100_clear_structs(struct net_device *);
-static inline tcb_t *e100_prepare_xmit_buff(struct e100_private *,
-					    struct sk_buff *);
-static void e100_set_multi_exec(struct net_device *dev);
-
-MODULE_AUTHOR("Intel Corporation, <linux.nics@intel.com>");
-MODULE_DESCRIPTION("Intel(R) PRO/100 Network Driver");
-MODULE_LICENSE("GPL");
-
-E100_PARAM(TxDescriptors, "Number of transmit descriptors");
-E100_PARAM(RxDescriptors, "Number of receive descriptors");
-E100_PARAM(XsumRX, "Disable or enable Receive Checksum offload");
-E100_PARAM(e100_speed_duplex, "Speed and Duplex settings");
-E100_PARAM(ucode, "Disable or enable microcode loading");
-E100_PARAM(ber, "Value for the BER correction algorithm");
-E100_PARAM(flow_control, "Disable or enable Ethernet PAUSE frames processing");
-E100_PARAM(IntDelay, "Value for CPU saver's interrupt delay");
-E100_PARAM(BundleSmallFr, "Disable or enable interrupt bundling of small frames");
-E100_PARAM(BundleMax, "Maximum number for CPU saver's packet bundling");
-E100_PARAM(IFS, "Disable or enable the adaptive IFS algorithm");
-
-/**
- * e100_exec_cmd - issue a comand
- * @bdp: atapter's private data struct
- * @scb_cmd_low: the command that is to be issued
- *
- * This general routine will issue a command to the e100.
- */
-static inline void
-e100_exec_cmd(struct e100_private *bdp, u8 cmd_low)
-{
-	writeb(cmd_low, &(bdp->scb->scb_cmd_low));
-	readw(&(bdp->scb->scb_status));	/* flushes last write, read-safe */
-}
-
-/**
- * e100_wait_scb - wait for SCB to clear
- * @bdp: atapter's private data struct
- *
- * This routine checks to see if the e100 has accepted a command.
- * It does so by checking the command field in the SCB, which will
- * be zeroed by the e100 upon accepting a command.  The loop waits
- * for up to 1 millisecond for command acceptance.
- *
- * Returns:
- *      true if the SCB cleared within 1 millisecond.
- *      false if it didn't clear within 1 millisecond
- */
-unsigned char
-e100_wait_scb(struct e100_private *bdp)
-{
-	int i;
-
-	/* loop on the scb for a few times */
-	for (i = 0; i < 100; i++) {
-		if (!readb(&bdp->scb->scb_cmd_low))
-			return true;
-		cpu_relax();
-	}
-
-	/* it didn't work. do it the slow way using udelay()s */
-	for (i = 0; i < E100_MAX_SCB_WAIT; i++) {
-		if (!readb(&bdp->scb->scb_cmd_low))
-			return true;
-		cpu_relax();
-		udelay(1);
-	}
-
-	return false;
-}
-
-/**
- * e100_wait_exec_simple - issue a command
- * @bdp: atapter's private data struct
- * @scb_cmd_low: the command that is to be issued
- *
- * This general routine will issue a command to the e100 after waiting for
- * the previous command to finish.
- *
- * Returns:
- *      true if the command was issued to the chip successfully
- *      false if the command was not issued to the chip
- */
-inline unsigned char
-e100_wait_exec_simple(struct e100_private *bdp, u8 scb_cmd_low)
-{
-	if (!e100_wait_scb(bdp)) {
-		printk(KERN_DEBUG "e100: %s: e100_wait_exec_simple: failed\n",
-		       bdp->device->name);
-#ifdef E100_CU_DEBUG		
-		printk(KERN_ERR "e100: %s: Last command (%x/%x) "
-			"timeout\n", bdp->device->name, 
-			bdp->last_cmd, bdp->last_sub_cmd);
-		printk(KERN_ERR "e100: %s: Current simple command (%x) "
-			"can't be executed\n", 
-			bdp->device->name, scb_cmd_low);
-#endif		
-		return false;
-	}
-	e100_exec_cmd(bdp, scb_cmd_low);
-#ifdef E100_CU_DEBUG	
-	bdp->last_cmd = scb_cmd_low;
-	bdp->last_sub_cmd = 0;
-#endif	
-	return true;
-}
-
-void
-e100_exec_cmplx(struct e100_private *bdp, u32 phys_addr, u8 cmd)
-{
-	writel(phys_addr, &(bdp->scb->scb_gen_ptr));
-	readw(&(bdp->scb->scb_status));	/* flushes last write, read-safe */
-	e100_exec_cmd(bdp, cmd);
-}
-
-unsigned char
-e100_wait_exec_cmplx(struct e100_private *bdp, u32 phys_addr, u8 cmd, u8 sub_cmd)
-{
-	if (!e100_wait_scb(bdp)) {
-#ifdef E100_CU_DEBUG		
-		printk(KERN_ERR "e100: %s: Last command (%x/%x) "
-			"timeout\n", bdp->device->name, 
-			bdp->last_cmd, bdp->last_sub_cmd);
-		printk(KERN_ERR "e100: %s: Current complex command "
-			"(%x/%x) can't be executed\n", 
-			bdp->device->name, cmd, sub_cmd);
-#endif		
-		return false;
-	}
-	e100_exec_cmplx(bdp, phys_addr, cmd);
-#ifdef E100_CU_DEBUG	
-	bdp->last_cmd = cmd;
-	bdp->last_sub_cmd = sub_cmd;
-#endif	
-	return true;
-}
-
-inline u8
-e100_wait_cus_idle(struct e100_private *bdp)
-{
-	int i;
-
-	/* loop on the scb for a few times */
-	for (i = 0; i < 100; i++) {
-		if (((readw(&(bdp->scb->scb_status)) & SCB_CUS_MASK) !=
-		     SCB_CUS_ACTIVE)) {
-			return true;
-		}
-		cpu_relax();
-	}
-
-	for (i = 0; i < E100_MAX_CU_IDLE_WAIT; i++) {
-		if (((readw(&(bdp->scb->scb_status)) & SCB_CUS_MASK) !=
-		     SCB_CUS_ACTIVE)) {
-			return true;
-		}
-		cpu_relax();
-		udelay(1);
-	}
-
-	return false;
-}
-
-/**
- * e100_disable_clear_intr - disable and clear/ack interrupts
- * @bdp: atapter's private data struct
- *
- * This routine disables interrupts at the hardware, by setting
- * the M (mask) bit in the adapter's CSR SCB command word.
- * It also clear/ack interrupts.
- */
-static inline void
-e100_disable_clear_intr(struct e100_private *bdp)
-{
-	u16 intr_status;
-	/* Disable interrupts on our PCI board by setting the mask bit */
-	writeb(SCB_INT_MASK, &bdp->scb->scb_cmd_hi);
-	intr_status = readw(&bdp->scb->scb_status);
-	/* ack and clear intrs */
-	writew(intr_status, &bdp->scb->scb_status);
-	readw(&bdp->scb->scb_status);
-}
-
-/**
- * e100_set_intr_mask - set interrupts
- * @bdp: atapter's private data struct
- *
- * This routine sets interrupts at the hardware, by resetting
- * the M (mask) bit in the adapter's CSR SCB command word
- */
-static inline void
-e100_set_intr_mask(struct e100_private *bdp)
-{
-	writeb(bdp->intr_mask, &bdp->scb->scb_cmd_hi);
-	readw(&(bdp->scb->scb_status)); /* flushes last write, read-safe */
-}
-
-static inline void
-e100_trigger_SWI(struct e100_private *bdp)
-{
-	/* Trigger interrupt on our PCI board by asserting SWI bit */
-	writeb(SCB_SOFT_INT, &bdp->scb->scb_cmd_hi);
-	readw(&(bdp->scb->scb_status));	/* flushes last write, read-safe */
-}
-
-static int
-e100_found1(struct pci_dev *pcid, const struct pci_device_id *ent)
-{
-	static int first_time = true;
-	struct net_device *dev = NULL;
-	struct e100_private *bdp = NULL;
-	int rc = 0;
-	u16 cal_checksum, read_checksum;
-
-	dev = alloc_etherdev(sizeof (struct e100_private));
-	if (dev == NULL) {
-		printk(KERN_ERR "e100: Not able to alloc etherdev struct\n");
-		rc = -ENODEV;
-		goto out;
-	}
-
-	SET_MODULE_OWNER(dev);
-
-	if (first_time) {
-		first_time = false;
-        	printk(KERN_NOTICE "%s - version %s\n",
-	               e100_full_driver_name, e100_driver_version);
-		printk(KERN_NOTICE "%s\n", e100_copyright);
-		printk(KERN_NOTICE "\n");
-	}
-
-	bdp = dev->priv;
-	bdp->pdev = pcid;
-	bdp->device = dev;
-
-	pci_set_drvdata(pcid, dev);
-	SET_NETDEV_DEV(dev, &pcid->dev);
-
-	bdp->flags = 0;
-	bdp->ifs_state = 0;
-	bdp->ifs_value = 0;
-	bdp->scb = 0;
-
-	init_timer(&bdp->nontx_timer_id);
-	bdp->nontx_timer_id.data = (unsigned long) bdp;
-	bdp->nontx_timer_id.function = (void *) &e100_non_tx_background;
-	INIT_LIST_HEAD(&(bdp->non_tx_cmd_list));
-	bdp->non_tx_command_state = E100_NON_TX_IDLE;
-
-	init_timer(&bdp->watchdog_timer);
-	bdp->watchdog_timer.data = (unsigned long) dev;
-	bdp->watchdog_timer.function = (void *) &e100_watchdog;
-
-	if ((rc = e100_pci_setup(pcid, bdp)) != 0) {
-		goto err_dev;
-	}
-
-	if ((rc = e100_alloc_space(bdp)) != 0) {
-		goto err_pci;
-	}
-
-	if (((bdp->pdev->device > 0x1030)
-	       && (bdp->pdev->device < 0x103F))
-	    || ((bdp->pdev->device >= 0x1050)
-	       && (bdp->pdev->device <= 0x1057))
-	    || (bdp->pdev->device == 0x2449)
-	    || (bdp->pdev->device == 0x2459)
-	    || (bdp->pdev->device == 0x245D)) {
-		bdp->rev_id = D101MA_REV_ID;	/* workaround for ICH3 */
-		bdp->flags |= IS_ICH;
-	}
-
-	if (bdp->rev_id == 0xff)
-		bdp->rev_id = 1;
-
-	if ((u8) bdp->rev_id >= D101A4_REV_ID)
-		bdp->flags |= IS_BACHELOR;
-
-	if ((u8) bdp->rev_id >= D102_REV_ID) {
-		bdp->flags |= USE_IPCB;
-		bdp->rfd_size = 32;
-	} else {
-		bdp->rfd_size = 16;
-	}
-
-	dev->vlan_rx_register = e100_vlan_rx_register;
-	dev->vlan_rx_add_vid = e100_vlan_rx_add_vid;
-	dev->vlan_rx_kill_vid = e100_vlan_rx_kill_vid;
-	dev->irq = pcid->irq;
-	dev->open = &e100_open;
-	dev->hard_start_xmit = &e100_xmit_frame;
-	dev->stop = &e100_close;
-	dev->change_mtu = &e100_change_mtu;
-	dev->get_stats = &e100_get_stats;
-	dev->set_multicast_list = &e100_set_multi;
-	dev->set_mac_address = &e100_set_mac;
-	dev->do_ioctl = &e100_ioctl;
-
-	if (bdp->flags & USE_IPCB)
-	dev->features = NETIF_F_SG | NETIF_F_IP_CSUM |
-			NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
-		
-	if ((rc = register_netdev(dev)) != 0) {
-		goto err_dealloc;
-	}
-
-	e100_check_options(e100nics, bdp);
-
-	if (!e100_init(bdp)) {
-		printk(KERN_ERR "e100: Failed to initialize, instance #%d\n",
-		       e100nics);
-		rc = -ENODEV;
-		goto err_unregister_netdev;
-	}
-
-	/* Check if checksum is valid */
-	cal_checksum = e100_eeprom_calculate_chksum(bdp);
-	read_checksum = e100_eeprom_read(bdp, (bdp->eeprom_size - 1));
-	if (cal_checksum != read_checksum) {
-                printk(KERN_ERR "e100: Corrupted EEPROM on instance #%d\n",
-		       e100nics);
-                rc = -ENODEV;
-                goto err_unregister_netdev;
-	}
-	
-	e100nics++;
-
-	e100_get_speed_duplex_caps(bdp);
-
-	printk(KERN_NOTICE
-	       "e100: %s: %s\n", 
-	       bdp->device->name, "Intel(R) PRO/100 Network Connection");
-	e100_print_brd_conf(bdp);
-
-	bdp->wolsupported = 0;
-	bdp->wolopts = 0;
-	if (bdp->rev_id >= D101A4_REV_ID)
-		bdp->wolsupported = WAKE_PHY | WAKE_MAGIC;
-	if (bdp->rev_id >= D101MA_REV_ID)
-		bdp->wolsupported |= WAKE_UCAST | WAKE_ARP;
-	
-	/* Check if WoL is enabled on EEPROM */
-	if (e100_eeprom_read(bdp, EEPROM_ID_WORD) & BIT_5) {
-		/* Magic Packet WoL is enabled on device by default */
-		/* if EEPROM WoL bit is TRUE                        */
-		bdp->wolopts = WAKE_MAGIC;
-	}
-
-	printk(KERN_NOTICE "\n");
-
-	goto out;
-
-err_unregister_netdev:
-	unregister_netdev(dev);
-err_dealloc:
-	e100_dealloc_space(bdp);
-err_pci:
-	iounmap(bdp->scb);
-	pci_release_regions(pcid);
-	pci_disable_device(pcid);
-err_dev:
-	pci_set_drvdata(pcid, NULL);
-	kfree(dev);
-out:
-	return rc;
-}
-
-/**
- * e100_clear_structs - free resources
- * @dev: adapter's net_device struct
- *
- * Free all device specific structs, unmap i/o address, etc.
- */
-static void __devexit
-e100_clear_structs(struct net_device *dev)
-{
-	struct e100_private *bdp = dev->priv;
-
-	iounmap(bdp->scb);
-	pci_release_regions(bdp->pdev);
-	pci_disable_device(bdp->pdev);
-
-	e100_dealloc_space(bdp);
-	pci_set_drvdata(bdp->pdev, NULL);
-	free_netdev(dev);
-}
-
-static void __devexit
-e100_remove1(struct pci_dev *pcid)
-{
-	struct net_device *dev;
-	struct e100_private *bdp;
-
-	if (!(dev = (struct net_device *) pci_get_drvdata(pcid)))
-		return;
-
-	bdp = dev->priv;
-
-	unregister_netdev(dev);
-
-	e100_sw_reset(bdp, PORT_SELECTIVE_RESET);
-
-	if (bdp->non_tx_command_state != E100_NON_TX_IDLE) {
-		del_timer_sync(&bdp->nontx_timer_id);
-		e100_free_nontx_list(bdp);
-		bdp->non_tx_command_state = E100_NON_TX_IDLE;
-	}
-
-	e100_clear_structs(dev);
-
-	--e100nics;
-}
-
-static struct pci_device_id e100_id_table[] = {
-	{0x8086, 0x1229, PCI_ANY_ID, PCI_ANY_ID, 0, 0, },
-	{0x8086, 0x2449, PCI_ANY_ID, PCI_ANY_ID, 0, 0, },
-	{0x8086, 0x1059, PCI_ANY_ID, PCI_ANY_ID, 0, 0, },
-	{0x8086, 0x1209, PCI_ANY_ID, PCI_ANY_ID, 0, 0, },
-  	{0x8086, 0x1029, PCI_ANY_ID, PCI_ANY_ID, 0, 0, },
-	{0x8086, 0x1030, PCI_ANY_ID, PCI_ANY_ID, 0, 0, },	
-	{0x8086, 0x1031, PCI_ANY_ID, PCI_ANY_ID, 0, 0, }, 
-	{0x8086, 0x1032, PCI_ANY_ID, PCI_ANY_ID, 0, 0, },
-	{0x8086, 0x1033, PCI_ANY_ID, PCI_ANY_ID, 0, 0, }, 
-	{0x8086, 0x1034, PCI_ANY_ID, PCI_ANY_ID, 0, 0, }, 
-	{0x8086, 0x1038, PCI_ANY_ID, PCI_ANY_ID, 0, 0, },
-	{0x8086, 0x1039, PCI_ANY_ID, PCI_ANY_ID, 0, 0, },
-	{0x8086, 0x103A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, },
-	{0x8086, 0x103B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, },
-	{0x8086, 0x103C, PCI_ANY_ID, PCI_ANY_ID, 0, 0, },
-	{0x8086, 0x103D, PCI_ANY_ID, PCI_ANY_ID, 0, 0, },
-	{0x8086, 0x103E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, },
-	{0x8086, 0x1050, PCI_ANY_ID, PCI_ANY_ID, 0, 0, },
-	{0x8086, 0x1051, PCI_ANY_ID, PCI_ANY_ID, 0, 0, },
-	{0x8086, 0x1052, PCI_ANY_ID, PCI_ANY_ID, 0, 0, },
-	{0x8086, 0x1053, PCI_ANY_ID, PCI_ANY_ID, 0, 0, },
-	{0x8086, 0x1054, PCI_ANY_ID, PCI_ANY_ID, 0, 0, },
-	{0x8086, 0x1055, PCI_ANY_ID, PCI_ANY_ID, 0, 0, },
-	{0x8086, 0x2459, PCI_ANY_ID, PCI_ANY_ID, 0, 0, },
-	{0x8086, 0x245D, PCI_ANY_ID, PCI_ANY_ID, 0, 0, },
-	{0,} /* This has to be the last entry*/
-};
-MODULE_DEVICE_TABLE(pci, e100_id_table);
-
-static struct pci_driver e100_driver = {
-	.name         = "e100",
-	.id_table     = e100_id_table,
-	.probe        = e100_found1,
-	.remove       = __devexit_p(e100_remove1),
-#ifdef CONFIG_PM
-	.suspend      = e100_suspend,
-	.resume       = e100_resume,
-#endif
-};
-
-static int __init
-e100_init_module(void)
-{
-	int ret;
-        ret = pci_module_init(&e100_driver);
-
-	if(ret >= 0) {
-#ifdef CONFIG_PM
-		register_reboot_notifier(&e100_notifier_reboot);
-#endif 
-	}
-
-	return ret;
-}
-
-static void __exit
-e100_cleanup_module(void)
-{
-#ifdef CONFIG_PM	
-	unregister_reboot_notifier(&e100_notifier_reboot);
-#endif 
-
-	pci_unregister_driver(&e100_driver);
-}
-
-module_init(e100_init_module);
-module_exit(e100_cleanup_module);
-
-/**
- * e100_check_options - check command line options
- * @board: board number
- * @bdp: atapter's private data struct
- *
- * This routine does range checking on command-line options
- */
-void
-e100_check_options(int board, struct e100_private *bdp)
-{
-	if (board >= E100_MAX_NIC) {
-		printk(KERN_NOTICE 
-		       "e100: No configuration available for board #%d\n",
-		       board);
-		printk(KERN_NOTICE "e100: Using defaults for all values\n");
-		board = E100_MAX_NIC;
-	}
-
-	e100_set_int_option(&(bdp->params.TxDescriptors), TxDescriptors[board],
-			    E100_MIN_TCB, E100_MAX_TCB, E100_DEFAULT_TCB,
-			    "TxDescriptor count");
-
-	e100_set_int_option(&(bdp->params.RxDescriptors), RxDescriptors[board],
-			    E100_MIN_RFD, E100_MAX_RFD, E100_DEFAULT_RFD,
-			    "RxDescriptor count");
-
-	e100_set_int_option(&(bdp->params.e100_speed_duplex),
-			    e100_speed_duplex[board], 0, 4,
-			    E100_DEFAULT_SPEED_DUPLEX, "speed/duplex mode");
-
-	e100_set_int_option(&(bdp->params.ber), ber[board], 0, ZLOCK_MAX_ERRORS,
-			    E100_DEFAULT_BER, "Bit Error Rate count");
-
-	e100_set_bool_option(bdp, XsumRX[board], PRM_XSUMRX, E100_DEFAULT_XSUM,
-			     "XsumRX value");
-
-	/* Default ucode value depended on controller revision */
-	if (bdp->rev_id >= D101MA_REV_ID) {
-		e100_set_bool_option(bdp, ucode[board], PRM_UCODE,
-				     E100_DEFAULT_UCODE, "ucode value");
-	} else {
-		e100_set_bool_option(bdp, ucode[board], PRM_UCODE, false,
-				     "ucode value");
-	}
-
-	e100_set_bool_option(bdp, flow_control[board], PRM_FC, E100_DEFAULT_FC,
-			     "flow control value");
-
-	e100_set_bool_option(bdp, IFS[board], PRM_IFS, E100_DEFAULT_IFS,
-			     "IFS value");
-
-	e100_set_bool_option(bdp, BundleSmallFr[board], PRM_BUNDLE_SMALL,
-			     E100_DEFAULT_BUNDLE_SMALL_FR,
-			     "CPU saver bundle small frames value");
-
-	e100_set_int_option(&(bdp->params.IntDelay), IntDelay[board], 0x0,
-			    0xFFFF, E100_DEFAULT_CPUSAVER_INTERRUPT_DELAY,
-			    "CPU saver interrupt delay value");
-
-	e100_set_int_option(&(bdp->params.BundleMax), BundleMax[board], 0x1,
-			    0xFFFF, E100_DEFAULT_CPUSAVER_BUNDLE_MAX,
-			    "CPU saver bundle max value");
-
-}
-
-/**
- * e100_set_int_option - check and set an integer option
- * @option: a pointer to the relevant option field
- * @val: the value specified
- * @min: the minimum valid value
- * @max: the maximum valid value
- * @default_val: the default value
- * @name: the name of the option
- *
- * This routine does range checking on a command-line option.
- * If the option's value is '-1' use the specified default.
- * Otherwise, if the value is invalid, change it to the default.
- */
-void
-e100_set_int_option(int *option, int val, int min, int max, int default_val,
-		    char *name)
-{
-	if (val == -1) {	/* no value specified. use default */
-		*option = default_val;
-
-	} else if ((val < min) || (val > max)) {
-		printk(KERN_NOTICE
-		       "e100: Invalid %s specified (%i). "
-		       "Valid range is %i-%i\n",
-		       name, val, min, max);
-		printk(KERN_NOTICE "e100: Using default %s of %i\n", name,
-		       default_val);
-		*option = default_val;
-	} else {
-		printk(KERN_INFO "e100: Using specified %s of %i\n", name, val);
-		*option = val;
-	}
-}
-
-/**
- * e100_set_bool_option - check and set a boolean option
- * @bdp: atapter's private data struct
- * @val: the value specified
- * @mask: the mask for the relevant option
- * @default_val: the default value
- * @name: the name of the option
- *
- * This routine checks a boolean command-line option.
- * If the option's value is '-1' use the specified default.
- * Otherwise, if the value is invalid (not 0 or 1), 
- * change it to the default.
- */
-void
-e100_set_bool_option(struct e100_private *bdp, int val, u32 mask,
-		     int default_val, char *name)
-{
-	if (val == -1) {
-		if (default_val)
-			bdp->params.b_params |= mask;
-
-	} else if ((val != true) && (val != false)) {
-		printk(KERN_NOTICE
-		       "e100: Invalid %s specified (%i). "
-		       "Valid values are %i/%i\n",
-		       name, val, false, true);
-		printk(KERN_NOTICE "e100: Using default %s of %i\n", name,
-		       default_val);
-
-		if (default_val)
-			bdp->params.b_params |= mask;
-	} else {
-		printk(KERN_INFO "e100: Using specified %s of %i\n", name, val);
-		if (val)
-			bdp->params.b_params |= mask;
-	}
-}
-
-int
-e100_open(struct net_device *dev)
-{
-	struct e100_private *bdp;
-	int rc = 0;
-
-	bdp = dev->priv;
-
-	/* setup the tcb pool */
-	if (!e100_alloc_tcb_pool(bdp)) {
-		rc = -ENOMEM;
-		goto err_exit;
-	}
-	bdp->last_tcb = NULL;
-
-	bdp->tcb_pool.head = 0;
-	bdp->tcb_pool.tail = 1;	
-
-	e100_setup_tcb_pool((tcb_t *) bdp->tcb_pool.data,
-			    bdp->params.TxDescriptors, bdp);
-
-	if (!e100_alloc_rfd_pool(bdp)) {
-		rc = -ENOMEM;
-		goto err_exit;
-	}
-
-	if (!e100_wait_exec_cmplx(bdp, 0, SCB_CUC_LOAD_BASE, 0)) {
-		rc = -EAGAIN;
-		goto err_exit;
-	}
-
-	if (!e100_wait_exec_cmplx(bdp, 0, SCB_RUC_LOAD_BASE, 0)) {
-		rc = -EAGAIN;
-		goto err_exit;
-	}
-
-	mod_timer(&(bdp->watchdog_timer), jiffies + (2 * HZ));
-
-	if (dev->flags & IFF_UP)
-		/* Otherwise process may sleep forever */
-		netif_wake_queue(dev);
-	else
-		netif_start_queue(dev);
-
-	e100_start_ru(bdp);
-	if ((rc = request_irq(dev->irq, &e100intr, SA_SHIRQ,
-			      dev->name, dev)) != 0) {
-		del_timer_sync(&bdp->watchdog_timer);
-		goto err_exit;
-	}
-	bdp->intr_mask = 0;
-	e100_set_intr_mask(bdp);
-
-	e100_force_config(bdp);
-
-	goto exit;
-
-err_exit:
-	e100_clear_pools(bdp);
-exit:
-	return rc;
-}
-
-int
-e100_close(struct net_device *dev)
-{
-	struct e100_private *bdp = dev->priv;
-
-	e100_disable_clear_intr(bdp);
-	free_irq(dev->irq, dev);
-	bdp->intr_mask = SCB_INT_MASK;
-	e100_isolate_driver(bdp);
-
-	netif_carrier_off(bdp->device);
-	bdp->cur_line_speed = 0;
-	bdp->cur_dplx_mode = 0;
-	e100_clear_pools(bdp);
-
-	return 0;
-}
-
-static int
-e100_change_mtu(struct net_device *dev, int new_mtu)
-{
-	if ((new_mtu < 68) || (new_mtu > (ETH_DATA_LEN + VLAN_SIZE)))
-		return -EINVAL;
-
-	dev->mtu = new_mtu;
-	return 0;
-}
-
-static int
-e100_xmit_frame(struct sk_buff *skb, struct net_device *dev)
-{
-	int rc = 0;
-	int notify_stop = false;
-	struct e100_private *bdp = dev->priv;
-
-	if (!spin_trylock(&bdp->bd_non_tx_lock)) {
-		notify_stop = true;
-		rc = 1;
-		goto exit2;
-	}
-
-	/* tcb list may be empty temporarily during releasing resources */
-	if (!TCBS_AVAIL(bdp->tcb_pool) || (bdp->tcb_phys == 0) ||
-	    (bdp->non_tx_command_state != E100_NON_TX_IDLE)) {
-		notify_stop = true;
-		rc = 1;
-		goto exit1;
-	}
-
-	bdp->drv_stats.net_stats.tx_bytes += skb->len;
-
-	e100_prepare_xmit_buff(bdp, skb);
-
-	dev->trans_start = jiffies;
-
-exit1:
-	spin_unlock(&bdp->bd_non_tx_lock);
-exit2:
-	if (notify_stop) {
-		netif_stop_queue(dev);
-	}
-
-	return rc;
-}
-
-/**
- * e100_get_stats - get driver statistics
- * @dev: adapter's net_device struct
- *
- * This routine is called when the OS wants the adapter's stats returned.
- * It returns the address of the net_device_stats stucture for the device.
- * If the statistics are currently being updated, then they might be incorrect
- * for a short while. However, since this cannot actually cause damage, no
- * locking is used.
- */
-struct net_device_stats *
-e100_get_stats(struct net_device *dev)
-{
-	struct e100_private *bdp = dev->priv;
-
-	bdp->drv_stats.net_stats.tx_errors =
-		bdp->drv_stats.net_stats.tx_carrier_errors +
-		bdp->drv_stats.net_stats.tx_aborted_errors;
-
-	bdp->drv_stats.net_stats.rx_errors =
-		bdp->drv_stats.net_stats.rx_crc_errors +
-		bdp->drv_stats.net_stats.rx_frame_errors +
-		bdp->drv_stats.net_stats.rx_length_errors +
-		bdp->drv_stats.rcv_cdt_frames;
-
-	return &(bdp->drv_stats.net_stats);
-}
-
-/**
- * e100_set_mac - set the MAC address
- * @dev: adapter's net_device struct
- * @addr: the new address
- *
- * This routine sets the ethernet address of the board
- * Returns:
- * 0  - if successful
- * -1 - otherwise
- */
-static int
-e100_set_mac(struct net_device *dev, void *addr)
-{
-	struct e100_private *bdp;
-	int rc = -1;
-	struct sockaddr *p_sockaddr = (struct sockaddr *) addr;
-
-	if (!is_valid_ether_addr(p_sockaddr->sa_data))
-		return -EADDRNOTAVAIL;
-	bdp = dev->priv;
-
-	if (e100_setup_iaaddr(bdp, (u8 *) (p_sockaddr->sa_data))) {
-		memcpy(&(dev->dev_addr[0]), p_sockaddr->sa_data, ETH_ALEN);
-		rc = 0;
-	}
-
-	return rc;
-}
-
-static void
-e100_set_multi_exec(struct net_device *dev)
-{
-	struct e100_private *bdp = dev->priv;
-	mltcst_cb_t *mcast_buff;
-	cb_header_t *cb_hdr;
-	struct dev_mc_list *mc_list;
-	unsigned int i;
-	nxmit_cb_entry_t *cmd = e100_alloc_non_tx_cmd(bdp);
-
-	if (cmd != NULL) {
-		mcast_buff = &((cmd->non_tx_cmd)->ntcb.multicast);
-		cb_hdr = &((cmd->non_tx_cmd)->ntcb.multicast.mc_cbhdr);
-	} else {
-		return;
-	}
-
-	/* initialize the multi cast command */
-	cb_hdr->cb_cmd = __constant_cpu_to_le16(CB_MULTICAST);
-
-	/* now fill in the rest of the multicast command */
-	*(u16 *) (&(mcast_buff->mc_count)) = cpu_to_le16(dev->mc_count * 6);
-	for (i = 0, mc_list = dev->mc_list;
-	     (i < dev->mc_count) && (i < MAX_MULTICAST_ADDRS);
-	     i++, mc_list = mc_list->next) {
-		/* copy into the command */
-		memcpy(&(mcast_buff->mc_addr[i * ETH_ALEN]),
-		       (u8 *) &(mc_list->dmi_addr), ETH_ALEN);
-	}
-
-	if (!e100_exec_non_cu_cmd(bdp, cmd)) {
-		printk(KERN_WARNING "e100: %s: Multicast setup failed\n", 
-		       dev->name);
-	}
-}
-
-/**
- * e100_set_multi - set multicast status
- * @dev: adapter's net_device struct
- *
- * This routine is called to add or remove multicast addresses, and/or to
- * change the adapter's promiscuous state.
- */
-static void
-e100_set_multi(struct net_device *dev)
-{
-	struct e100_private *bdp = dev->priv;
-	unsigned char promisc_enbl;
-	unsigned char mulcast_enbl;
-
-	promisc_enbl = ((dev->flags & IFF_PROMISC) == IFF_PROMISC);
-	mulcast_enbl = ((dev->flags & IFF_ALLMULTI) ||
-			(dev->mc_count > MAX_MULTICAST_ADDRS));
-
-	e100_config_promisc(bdp, promisc_enbl);
-	e100_config_mulcast_enbl(bdp, mulcast_enbl);
-
-	/* reconfigure the chip if something has changed in its config space */
-	e100_config(bdp);
-
-	if (promisc_enbl || mulcast_enbl) {
-		return;	/* no need for Multicast Cmd */
-	}
-
-	/* get the multicast CB */
-	e100_set_multi_exec(dev);
-}
-
-static int
-e100_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
-{
-
-	switch (cmd) {
-
-	case SIOCETHTOOL:
-		return e100_do_ethtool_ioctl(dev, ifr);
-		break;
-
-	case SIOCGMIIPHY:	/* Get address of MII PHY in use. */
-	case SIOCGMIIREG:	/* Read MII PHY register. */
-	case SIOCSMIIREG:	/* Write to MII PHY register. */
-		return e100_mii_ioctl(dev, ifr, cmd);
-		break;
-
-	default:
-		return -EOPNOTSUPP;
-	}
-	return 0;
-
-}
-
-/**
- * e100init - initialize the adapter
- * @bdp: atapter's private data struct
- *
- * This routine is called when this driver is loaded. This is the initialization
- * routine which allocates memory, configures the adapter and determines the
- * system resources.
- *
- * Returns:
- *      true: if successful
- *      false: otherwise
- */
-static unsigned char
-e100_init(struct e100_private *bdp)
-{
-	u32 st_timeout = 0;
-	u32 st_result = 0;
-	e100_sw_init(bdp);
-
-	if (!e100_selftest(bdp, &st_timeout, &st_result)) {
-        	if (st_timeout) {
-			printk(KERN_ERR "e100: selftest timeout\n");
-		} else {
-			printk(KERN_ERR "e100: selftest failed. Results: %x\n",
-					st_result);
-		}
-		return false;
-	}
-	else
-		printk(KERN_DEBUG "e100: selftest OK.\n");
-
-	/* read the MAC address from the eprom */
-	e100_rd_eaddr(bdp);
-	if (!is_valid_ether_addr(bdp->device->dev_addr)) {
-		printk(KERN_ERR "e100: Invalid Ethernet address\n");
-		return false;
-	}
-	/* read NIC's part number */
-	e100_rd_pwa_no(bdp);
-
-	if (!e100_hw_init(bdp))
-		return false;
-	/* Interrupts are enabled after device reset */
-	e100_disable_clear_intr(bdp);
-
-	return true;
-}
-
-/**
- * e100_sw_init - initialize software structs
- * @bdp: atapter's private data struct
- * 
- * This routine initializes all software structures. Sets up the
- * circular structures for the RFD's & TCB's. Allocates the per board
- * structure for storing adapter information. The CSR is also memory 
- * mapped in this routine.
- *
- * Returns :
- *      true: if S/W was successfully initialized
- *      false: otherwise
- */
-static unsigned char
-e100_sw_init(struct e100_private *bdp)
-{
-	bdp->next_cu_cmd = START_WAIT;	// init the next cu state
-
-	/* 
-	 * Set the value for # of good xmits per underrun. the value assigned
-	 * here is an intelligent  suggested default. Nothing magical about it.
-	 */
-	bdp->tx_per_underrun = DEFAULT_TX_PER_UNDERRUN;
-
-	/* get the default transmit threshold value */
-	bdp->tx_thld = TX_THRSHLD;
-
-	/* get the EPROM size */
-	bdp->eeprom_size = e100_eeprom_size(bdp);
-
-	/* Initialize our spinlocks */
-	spin_lock_init(&(bdp->bd_lock));
-	spin_lock_init(&(bdp->bd_non_tx_lock));
-	spin_lock_init(&(bdp->config_lock));
-	spin_lock_init(&(bdp->mdi_access_lock));
-	/* Initialize configuration data */
-	e100_config_init(bdp);
-
-	return 1;
-}
-
-static void
-e100_tco_workaround(struct e100_private *bdp)
-{
-	int i;
-
-	/* Do software reset */
-	e100_sw_reset(bdp, PORT_SOFTWARE_RESET);
-
-	/* Do a dummy LOAD CU BASE command. */
-	/* This gets us out of pre-driver to post-driver. */
-	e100_exec_cmplx(bdp, 0, SCB_CUC_LOAD_BASE);
-
-	/* Wait 20 msec for reset to take effect */
-	set_current_state(TASK_UNINTERRUPTIBLE);
-	schedule_timeout(HZ / 50 + 1);
-
-	/* disable interrupts since they are enabled */
-	/* after device reset                        */
-	e100_disable_clear_intr(bdp);
-
-	/* Wait for command to be cleared up to 1 sec */
-	for (i=0; i<100; i++) {
-		if (!readb(&bdp->scb->scb_cmd_low))
-			break;
-		set_current_state(TASK_UNINTERRUPTIBLE);
-		schedule_timeout(HZ / 100 + 1);
-	}
-
-	/* Wait for TCO request bit in PMDR register to be clear */
-	for (i=0; i<50; i++) {
-		if (!(readb(&bdp->scb->scb_ext.d101m_scb.scb_pmdr) & BIT_1))
-			break;
-		set_current_state(TASK_UNINTERRUPTIBLE);
-		schedule_timeout(HZ / 100 + 1);
-	}
-}
-
-/**
- * e100_hw_init - initialized tthe hardware
- * @bdp: atapter's private data struct
- *
- * This routine performs a reset on the adapter, and configures the adapter.
- * This includes configuring the 82557 LAN controller, validating and setting
- * the node address, detecting and configuring the Phy chip on the adapter,
- * and initializing all of the on chip counters.
- *
- * Returns:
- *      true - If the adapter was initialized
- *      false - If the adapter failed initialization
- */
-unsigned char
-e100_hw_init(struct e100_private *bdp)
-{
-	if (!e100_phy_init(bdp))
-		goto err;
-
-	e100_sw_reset(bdp, PORT_SELECTIVE_RESET);
-
-	/* Only 82559 or above needs TCO workaround */
-	if (bdp->rev_id >= D101MA_REV_ID)
-		e100_tco_workaround(bdp);
-
-	/* Load the CU BASE (set to 0, because we use linear mode) */
-	if (!e100_wait_exec_cmplx(bdp, 0, SCB_CUC_LOAD_BASE, 0))
-		goto err;
-
-	if (!e100_wait_exec_cmplx(bdp, 0, SCB_RUC_LOAD_BASE, 0))
-		goto err;
-
-	/* Load interrupt microcode  */
-	if (e100_load_microcode(bdp)) {
-		bdp->flags |= DF_UCODE_LOADED;
-	}
-
-	if ((u8) bdp->rev_id < D101A4_REV_ID)
-		e100_config_init_82557(bdp);
-		
-	if (!e100_config(bdp))
-		goto err;
-
-	if (!e100_setup_iaaddr(bdp, bdp->device->dev_addr))
-		goto err;
-
-	/* Clear the internal counters */
-	if (!e100_clr_cntrs(bdp))
-		goto err;
-
-	/* Change for 82558 enhancement */
-	/* If 82558/9 and if the user has enabled flow control, set up the
-	 * Flow Control Reg. in the CSR */
-	if ((bdp->flags & IS_BACHELOR)
-	    && (bdp->params.b_params & PRM_FC)) {
-		writeb(DFLT_FC_THLD, &bdp->scb->scb_ext.d101_scb.scb_fc_thld);
-		writeb(DFLT_FC_CMD,
-		       &bdp->scb->scb_ext.d101_scb.scb_fc_xon_xoff);
-	}
-
-	return true;
-err:
-	printk(KERN_ERR "e100: hw init failed\n");
-	return false;
-}
-
-/**
- * e100_setup_tcb_pool - setup TCB circular list
- * @head: Pointer to head of the allocated TCBs
- * @qlen: Number of elements in the queue
- * @bdp: atapter's private data struct
- * 
- * This routine arranges the contigiously allocated TCB's in a circular list.
- * Also does the one time initialization of the TCBs.
- */
-static void
-e100_setup_tcb_pool(tcb_t *head, unsigned int qlen, struct e100_private *bdp)
-{
-	int ele_no;
-	tcb_t *pcurr_tcb;	/* point to current tcb */
-	u32 next_phys;		/* the next phys addr */
-	u16 txcommand = CB_S_BIT | CB_TX_SF_BIT;
-
-	bdp->tx_count = 0;
-	if (bdp->flags & USE_IPCB) {
-		txcommand |= CB_IPCB_TRANSMIT | CB_CID_DEFAULT;
-	} else if (bdp->flags & IS_BACHELOR) {
-		txcommand |= CB_TRANSMIT | CB_CID_DEFAULT;
-	} else {
-		txcommand |= CB_TRANSMIT;
-	}
-
-	for (ele_no = 0, next_phys = bdp->tcb_phys, pcurr_tcb = head;
-	     ele_no < qlen; ele_no++, pcurr_tcb++) {
-
-		/* set the phys addr for this TCB, next_phys has not incr. yet */
-		pcurr_tcb->tcb_phys = next_phys;
-		next_phys += sizeof (tcb_t);
-
-		/* set the link to next tcb */
-		if (ele_no == (qlen - 1))
-			pcurr_tcb->tcb_hdr.cb_lnk_ptr =
-				cpu_to_le32(bdp->tcb_phys);
-		else
-			pcurr_tcb->tcb_hdr.cb_lnk_ptr = cpu_to_le32(next_phys);
-
-		pcurr_tcb->tcb_hdr.cb_status = 0;
-		pcurr_tcb->tcb_hdr.cb_cmd = cpu_to_le16(txcommand);
-		pcurr_tcb->tcb_cnt = 0;	
-		pcurr_tcb->tcb_thrshld = bdp->tx_thld;	
-		if (ele_no < 2) {
-			pcurr_tcb->tcb_hdr.cb_status =
-				cpu_to_le16(CB_STATUS_COMPLETE);
-		}
-		pcurr_tcb->tcb_tbd_num = 1;
-
-		if (bdp->flags & IS_BACHELOR) {
-			pcurr_tcb->tcb_tbd_ptr =
-				__constant_cpu_to_le32(0xFFFFFFFF);
-		} else {
-			pcurr_tcb->tcb_tbd_ptr =
-				cpu_to_le32(pcurr_tcb->tcb_phys + 0x10);
-		}
-
-		if (bdp->flags & IS_BACHELOR) {
-			pcurr_tcb->tcb_tbd_expand_ptr =
-				cpu_to_le32(pcurr_tcb->tcb_phys + 0x20);
-		} else {
-			pcurr_tcb->tcb_tbd_expand_ptr =
-				cpu_to_le32(pcurr_tcb->tcb_phys + 0x10);
-		}
-		pcurr_tcb->tcb_tbd_dflt_ptr = pcurr_tcb->tcb_tbd_ptr;
-
-		if (bdp->flags & USE_IPCB) {
-			pcurr_tcb->tbd_ptr = &(pcurr_tcb->tcbu.tbd_array[1]);
-			pcurr_tcb->tcbu.ipcb.ip_activation_high =
-				IPCB_IP_ACTIVATION_DEFAULT;
-			pcurr_tcb->tcbu.ipcb.vlan = 0;
-		} else {
-			pcurr_tcb->tbd_ptr = &(pcurr_tcb->tcbu.tbd_array[0]);
-		}
-
-		pcurr_tcb->tcb_skb = NULL;
-	}
-
-	wmb();
-}
-
-/***************************************************************************/
-/***************************************************************************/
-/*       Memory Management Routines                                        */
-/***************************************************************************/
-
-/**
- * e100_alloc_space - allocate private driver data
- * @bdp: atapter's private data struct
- *
- * This routine allocates memory for the driver. Memory allocated is for the
- * selftest and statistics structures.
- *
- * Returns:
- *      0: if the operation was successful
- *      %-ENOMEM: if memory allocation failed
- */
-unsigned char
-e100_alloc_space(struct e100_private *bdp)
-{
-	unsigned long off;
-
-	/* allocate all the dma-able structures in one call:
-	 * selftest results, adapter stats, and non-tx cb commands */
-	if (!(bdp->dma_able =
-	      pci_alloc_consistent(bdp->pdev, sizeof (bd_dma_able_t),
-				   &(bdp->dma_able_phys)))) {
-		goto err;
-	}
-
-	/* now assign the various pointers into the struct we've just allocated */
-	off = offsetof(bd_dma_able_t, selftest);
-
-	bdp->selftest = (self_test_t *) (bdp->dma_able + off);
-	bdp->selftest_phys = bdp->dma_able_phys + off;
-
-	off = offsetof(bd_dma_able_t, stats_counters);
-
-	bdp->stats_counters = (max_counters_t *) (bdp->dma_able + off);
-	bdp->stat_cnt_phys = bdp->dma_able_phys + off;
-
-	return 0;
-
-err:
-	printk(KERN_ERR
-	       "e100: Failed to allocate memory\n");
-	return -ENOMEM;
-}
-
-/**
- * e100_alloc_tcb_pool - allocate TCB circular list
- * @bdp: atapter's private data struct
- *
- * This routine allocates memory for the circular list of transmit descriptors.
- *
- * Returns:
- *       0: if allocation has failed.
- *       1: Otherwise. 
- */
-int
-e100_alloc_tcb_pool(struct e100_private *bdp)
-{
-	int stcb = sizeof (tcb_t) * bdp->params.TxDescriptors;
-
-	/* allocate space for the TCBs */
-	if (!(bdp->tcb_pool.data =
-	      pci_alloc_consistent(bdp->pdev, stcb, &bdp->tcb_phys)))
-		return 0;
-
-	memset(bdp->tcb_pool.data, 0x00, stcb);
-
-	return 1;
-}
-
-void
-e100_free_tcb_pool(struct e100_private *bdp)
-{
-	tcb_t *tcb;
-	int i;
-	/* Return tx skbs */ 
-	for (i = 0; i < bdp->params.TxDescriptors; i++) {
-	  	tcb = bdp->tcb_pool.data;
-		tcb += bdp->tcb_pool.head;
-  		e100_tx_skb_free(bdp, tcb);
-		if (NEXT_TCB_TOUSE(bdp->tcb_pool.head) == bdp->tcb_pool.tail)
-		  	break;
-		bdp->tcb_pool.head = NEXT_TCB_TOUSE(bdp->tcb_pool.head);
-	}
-	pci_free_consistent(bdp->pdev,
-			    sizeof (tcb_t) * bdp->params.TxDescriptors,
-			    bdp->tcb_pool.data, bdp->tcb_phys);
-	bdp->tcb_pool.head = 0;
-	bdp->tcb_pool.tail = 1;	
-	bdp->tcb_phys = 0;
-}
-
-static void
-e100_dealloc_space(struct e100_private *bdp)
-{
-	if (bdp->dma_able) {
-		pci_free_consistent(bdp->pdev, sizeof (bd_dma_able_t),
-				    bdp->dma_able, bdp->dma_able_phys);
-	}
-
-	bdp->selftest_phys = 0;
-	bdp->stat_cnt_phys = 0;
-	bdp->dma_able_phys = 0;
-	bdp->dma_able = 0;
-}
-
-static void
-e100_free_rfd_pool(struct e100_private *bdp)
-{
-	struct rx_list_elem *rx_struct;
-
-	while (!list_empty(&(bdp->active_rx_list))) {
-
-		rx_struct = list_entry(bdp->active_rx_list.next,
-				       struct rx_list_elem, list_elem);
-		list_del(&(rx_struct->list_elem));
-		pci_unmap_single(bdp->pdev, rx_struct->dma_addr,
-				 sizeof (rfd_t), PCI_DMA_TODEVICE);
-		dev_kfree_skb(rx_struct->skb);
-		kfree(rx_struct);
-	}
-
-	while (!list_empty(&(bdp->rx_struct_pool))) {
-		rx_struct = list_entry(bdp->rx_struct_pool.next,
-				       struct rx_list_elem, list_elem);
-		list_del(&(rx_struct->list_elem));
-		kfree(rx_struct);
-	}
-}
-
-/**
- * e100_alloc_rfd_pool - allocate RFDs
- * @bdp: atapter's private data struct
- *
- * Allocates initial pool of skb which holds both rfd and data,
- * and return a pointer to the head of the list
- */
-static int
-e100_alloc_rfd_pool(struct e100_private *bdp)
-{
-	struct rx_list_elem *rx_struct;
-	int i;
-
-	INIT_LIST_HEAD(&(bdp->active_rx_list));
-	INIT_LIST_HEAD(&(bdp->rx_struct_pool));
-	bdp->skb_req = bdp->params.RxDescriptors;
-	for (i = 0; i < bdp->skb_req; i++) {
-		rx_struct = kmalloc(sizeof (struct rx_list_elem), GFP_ATOMIC);
-		list_add(&(rx_struct->list_elem), &(bdp->rx_struct_pool));
-	}
-	e100_alloc_skbs(bdp);
-	return !list_empty(&(bdp->active_rx_list));
-
-}
-
-void
-e100_clear_pools(struct e100_private *bdp)
-{
-	bdp->last_tcb = NULL;
-	e100_free_rfd_pool(bdp);
-	e100_free_tcb_pool(bdp);
-}
-
-/*****************************************************************************/
-/*****************************************************************************/
-/*      Run Time Functions                                                   */
-/*****************************************************************************/
-
-/**
- * e100_watchdog
- * @dev: adapter's net_device struct
- *
- * This routine runs every 2 seconds and updates our statitics and link state,
- * and refreshs txthld value.
- */
-void
-e100_watchdog(struct net_device *dev)
-{
-	struct e100_private *bdp = dev->priv;
-
-#ifdef E100_CU_DEBUG
-	if (e100_cu_unknown_state(bdp)) {
-		printk(KERN_ERR "e100: %s: CU unknown state in e100_watchdog\n",
-			dev->name);
-	}
-#endif	
-	if (!netif_running(dev)) {
-		return;
-	}
-
-	/* check if link state has changed */
-	if (e100_phy_check(bdp)) {
-		if (netif_carrier_ok(dev)) {
-			printk(KERN_ERR
-			       "e100: %s NIC Link is Up %d Mbps %s duplex\n",
-			       bdp->device->name, bdp->cur_line_speed,
-			       (bdp->cur_dplx_mode == HALF_DUPLEX) ?
-			       "Half" : "Full");
-
-			e100_config_fc(bdp);
-			e100_config(bdp);  
-
-		} else {
-			printk(KERN_ERR "e100: %s NIC Link is Down\n",
-			       bdp->device->name);
-		}
-	}
-
-	// toggle the tx queue according to link status
-	// this also resolves a race condition between tx & non-cu cmd flows
-	if (netif_carrier_ok(dev)) {
-		if (netif_running(dev))
-			netif_wake_queue(dev);
-	} else {
-		if (netif_running(dev))
-			netif_stop_queue(dev);
-		/* When changing to non-autoneg, device may lose  */
-		/* link with some switches. e100 will try to      */
-		/* revover link by sending command to PHY layer   */
-		if (bdp->params.e100_speed_duplex != E100_AUTONEG)
-			e100_force_speed_duplex_to_phy(bdp);
-	}
-
-	rmb();
-
-	if (e100_update_stats(bdp)) {
-
-		/* Check if a change in the IFS parameter is needed,
-		   and configure the device accordingly */
-		if (bdp->params.b_params & PRM_IFS)
-			e100_manage_adaptive_ifs(bdp);
-
-		/* Now adjust our dynamic tx threshold value */
-		e100_refresh_txthld(bdp);
-
-		/* Now if we are on a 557 and we havn't received any frames then we
-		 * should issue a multicast command to reset the RU */
-		if (bdp->rev_id < D101A4_REV_ID) {
-			if (!(bdp->stats_counters->basic_stats.rcv_gd_frames)) {
-				e100_set_multi(dev);
-			}
-		}
-	}
-	/* Issue command to dump statistics from device.        */
-	/* Check for command completion on next watchdog timer. */
-	e100_dump_stats_cntrs(bdp);
-
-	wmb();
-
-	/* relaunch watchdog timer in 2 sec */
-	mod_timer(&(bdp->watchdog_timer), jiffies + (2 * HZ));
-
-	if (list_empty(&bdp->active_rx_list))
-		e100_trigger_SWI(bdp);
-}
-
-/**
- * e100_manage_adaptive_ifs
- * @bdp: atapter's private data struct
- *
- * This routine manages the adaptive Inter-Frame Spacing algorithm
- * using a state machine.
- */
-void
-e100_manage_adaptive_ifs(struct e100_private *bdp)
-{
-	static u16 state_table[9][4] = {	// rows are states
-		{2, 0, 0, 0},	// state0   // column0: next state if increasing
-		{2, 0, 5, 30},	// state1   // column1: next state if decreasing
-		{5, 1, 5, 30},	// state2   // column2: IFS value for 100 mbit
-		{5, 3, 0, 0},	// state3   // column3: IFS value for 10 mbit
-		{5, 3, 10, 60},	// state4
-		{8, 4, 10, 60},	// state5
-		{8, 6, 0, 0},	// state6
-		{8, 6, 20, 60},	// state7
-		{8, 7, 20, 60}	// state8
-	};
-
-	u32 transmits =
-		le32_to_cpu(bdp->stats_counters->basic_stats.xmt_gd_frames);
-	u32 collisions =
-		le32_to_cpu(bdp->stats_counters->basic_stats.xmt_ttl_coll);
-	u32 state = bdp->ifs_state;
-	u32 old_value = bdp->ifs_value;
-	int next_col;
-	u32 min_transmits;
-
-	if (bdp->cur_dplx_mode == FULL_DUPLEX) {
-		bdp->ifs_state = 0;
-		bdp->ifs_value = 0;
-
-	} else {		/* Half Duplex */
-		/* Set speed specific parameters */
-		if (bdp->cur_line_speed == 100) {
-			next_col = 2;
-			min_transmits = MIN_NUMBER_OF_TRANSMITS_100;
-
-		} else {	/* 10 Mbps */
-			next_col = 3;
-			min_transmits = MIN_NUMBER_OF_TRANSMITS_10;
-		}
-
-		if ((transmits / 32 < collisions)
-		    && (transmits > min_transmits)) {
-			state = state_table[state][0];	/* increment */
-
-		} else if (transmits < min_transmits) {
-			state = state_table[state][1];	/* decrement */
-		}
-
-		bdp->ifs_value = state_table[state][next_col];
-		bdp->ifs_state = state;
-	}
-
-	/* If the IFS value has changed, configure the device */
-	if (bdp->ifs_value != old_value) {
-		e100_config_ifs(bdp);
-		e100_config(bdp);
-	}
-}
-
-/**
- * e100intr - interrupt handler
- * @irq: the IRQ number
- * @dev_inst: the net_device struct
- * @regs: registers (unused)
- *
- * This routine is the ISR for the e100 board. It services
- * the RX & TX queues & starts the RU if it has stopped due
- * to no resources.
- */
-irqreturn_t
-e100intr(int irq, void *dev_inst, struct pt_regs *regs)
-{
-	struct net_device *dev;
-	struct e100_private *bdp;
-	u16 intr_status;
-
-	dev = dev_inst;
-	bdp = dev->priv;
-
-	intr_status = readw(&bdp->scb->scb_status);
-	/* If not my interrupt, just return */
-	if (!(intr_status & SCB_STATUS_ACK_MASK) || (intr_status == 0xffff)) {
-		return IRQ_NONE;
-	}
-
-	/* disable and ack intr */
-	e100_disable_clear_intr(bdp);
-
-	/* the device is closed, don't continue or else bad things may happen. */
-	if (!netif_running(dev)) {
-		e100_set_intr_mask(bdp);
-		return IRQ_NONE;
-	}
-
-	/* SWI intr (triggered by watchdog) is signal to allocate new skb buffers */
-	if (intr_status & SCB_STATUS_ACK_SWI) {
-		e100_alloc_skbs(bdp);
-	}
-
-	/* do recv work if any */
-	if (intr_status &
-	    (SCB_STATUS_ACK_FR | SCB_STATUS_ACK_RNR | SCB_STATUS_ACK_SWI)) 
-		bdp->drv_stats.rx_intr_pkts += e100_rx_srv(bdp);
-
-	/* clean up after tx'ed packets */
-	if (intr_status & (SCB_STATUS_ACK_CNA | SCB_STATUS_ACK_CX))
-		e100_tx_srv(bdp);
-
-	e100_set_intr_mask(bdp);
-	return IRQ_HANDLED;
-}
-
-/**
- * e100_tx_skb_free - free TX skbs resources
- * @bdp: atapter's private data struct
- * @tcb: associated tcb of the freed skb
- *
- * This routine frees resources of TX skbs.
- */
-static inline void
-e100_tx_skb_free(struct e100_private *bdp, tcb_t *tcb)
-{
-	if (tcb->tcb_skb) {
-		int i;
-		tbd_t *tbd_arr = tcb->tbd_ptr;
-		int frags = skb_shinfo(tcb->tcb_skb)->nr_frags;
-
-		for (i = 0; i <= frags; i++, tbd_arr++) {
-			pci_unmap_single(bdp->pdev,
-					 le32_to_cpu(tbd_arr->tbd_buf_addr),
-					 le16_to_cpu(tbd_arr->tbd_buf_cnt),
-					 PCI_DMA_TODEVICE);
-		}
-		dev_kfree_skb_irq(tcb->tcb_skb);
-		tcb->tcb_skb = NULL;
-	}
-}
-
-/**
- * e100_tx_srv - service TX queues
- * @bdp: atapter's private data struct
- *
- * This routine services the TX queues. It reclaims the TCB's & TBD's & other
- * resources used during the transmit of this buffer. It is called from the ISR.
- * We don't need a tx_lock since we always access buffers which were already
- * prepared.
- */
-void
-e100_tx_srv(struct e100_private *bdp)
-{
-	tcb_t *tcb;
-	int i;
-
-	/* go over at most TxDescriptors buffers */
-	for (i = 0; i < bdp->params.TxDescriptors; i++) {
-		tcb = bdp->tcb_pool.data;
-		tcb += bdp->tcb_pool.head;
-
-		rmb();
-
-		/* if the buffer at 'head' is not complete, break */
-		if (!(tcb->tcb_hdr.cb_status &
-		      __constant_cpu_to_le16(CB_STATUS_COMPLETE)))
-			break;
-
-		/* service next buffer, clear the out of resource condition */
-		e100_tx_skb_free(bdp, tcb);
-
-		if (netif_running(bdp->device))
-			netif_wake_queue(bdp->device);
-
-		/* if we've caught up with 'tail', break */
-		if (NEXT_TCB_TOUSE(bdp->tcb_pool.head) == bdp->tcb_pool.tail) {
-			break;
-		}
-
-		bdp->tcb_pool.head = NEXT_TCB_TOUSE(bdp->tcb_pool.head);
-	}
-}
-
-/**
- * e100_rx_srv - service RX queue
- * @bdp: atapter's private data struct
- * @max_number_of_rfds: max number of RFDs to process
- * @rx_congestion: flag pointer, to inform the calling function of congestion.
- *
- * This routine processes the RX interrupt & services the RX queues.
- * For each successful RFD, it allocates a new msg block, links that
- * into the RFD list, and sends the old msg upstream.
- * The new RFD is then put at the end of the free list of RFD's.
- * It returns the number of serviced RFDs.
- */
-u32
-e100_rx_srv(struct e100_private *bdp)
-{
-	rfd_t *rfd;		/* new rfd, received rfd */
-	int i;
-	u16 rfd_status;
-	struct sk_buff *skb;
-	struct net_device *dev;
-	unsigned int data_sz;
-	struct rx_list_elem *rx_struct;
-	u32 rfd_cnt = 0;
-
-	dev = bdp->device;
-
-	/* current design of rx is as following:
-	 * 1. socket buffer (skb) used to pass network packet to upper layer
-	 * 2. all HW host memory structures (like RFDs, RBDs and data buffers)
-	 *    are placed in a skb's data room
-	 * 3. when rx process is complete, we change skb internal pointers to exclude
-	 *    from data area all unrelated things (RFD, RDB) and to leave
-	 *    just rx'ed packet netto
-	 * 4. for each skb passed to upper layer, new one is allocated instead.
-	 * 5. if no skb left, in 2 sec another atempt to allocate skbs will be made
-	 *    (watchdog trigger SWI intr and isr should allocate new skbs)
-	 */
-	for (i = 0; i < bdp->params.RxDescriptors; i++) {
-		if (list_empty(&(bdp->active_rx_list))) {
-			break;
-		}
-
-		rx_struct = list_entry(bdp->active_rx_list.next,
-				       struct rx_list_elem, list_elem);
-		skb = rx_struct->skb;
-
-		rfd = RFD_POINTER(skb, bdp);	/* locate RFD within skb */
-
-		// sync only the RFD header
-		pci_dma_sync_single(bdp->pdev, rx_struct->dma_addr,
-				    bdp->rfd_size, PCI_DMA_FROMDEVICE);
-		rfd_status = le16_to_cpu(rfd->rfd_header.cb_status);	/* get RFD's status */
-		if (!(rfd_status & RFD_STATUS_COMPLETE))	/* does not contains data yet - exit */
-			break;
-
-		/* to allow manipulation with current skb we need to unlink it */
-		list_del(&(rx_struct->list_elem));
-
-		/* do not free & unmap badly received packet.
-		 * move it to the end of skb list for reuse */
-		if (!(rfd_status & RFD_STATUS_OK)) {
-			e100_add_skb_to_end(bdp, rx_struct);
-			continue;
-		}
-
-		data_sz = min_t(u16, (le16_to_cpu(rfd->rfd_act_cnt) & 0x3fff),
-				(sizeof (rfd_t) - bdp->rfd_size));
-
-		/* now sync all the data */
-		pci_dma_sync_single(bdp->pdev, rx_struct->dma_addr,
-				    (data_sz + bdp->rfd_size),
-				    PCI_DMA_FROMDEVICE);
-
-		pci_unmap_single(bdp->pdev, rx_struct->dma_addr,
-				 sizeof (rfd_t), PCI_DMA_FROMDEVICE);
-
-		list_add(&(rx_struct->list_elem), &(bdp->rx_struct_pool));
-
-		/* end of dma access to rfd */
-		bdp->skb_req++;	/* incr number of requested skbs */
-		e100_alloc_skbs(bdp);	/* and get them */
-
-		/* set packet size, excluding checksum (2 last bytes) if it is present */
-		if ((bdp->flags & DF_CSUM_OFFLOAD)
-		    && (bdp->rev_id < D102_REV_ID))
-			skb_put(skb, (int) data_sz - 2);
-		else
-			skb_put(skb, (int) data_sz);
-
-		/* set the protocol */
-		skb->protocol = eth_type_trans(skb, dev);
-
-		/* set the checksum info */
-		if (bdp->flags & DF_CSUM_OFFLOAD) {
-			if (bdp->rev_id >= D102_REV_ID) {
-				skb->ip_summed = e100_D102_check_checksum(rfd);
-			} else {
-				skb->ip_summed = e100_D101M_checksum(bdp, skb);
-			}
-		} else {
-			skb->ip_summed = CHECKSUM_NONE;
-		}
-
-		bdp->drv_stats.net_stats.rx_bytes += skb->len;
-
-		if(bdp->vlgrp && (rfd_status & CB_STATUS_VLAN)) {
-			vlan_hwaccel_rx(skb, bdp->vlgrp, be16_to_cpu(rfd->vlanid));
-		} else {
-			netif_rx(skb);
-		}
-		dev->last_rx = jiffies;
-		
-		rfd_cnt++;
-	}			/* end of rfd loop */
-
-	/* restart the RU if it has stopped */
-	if ((readw(&bdp->scb->scb_status) & SCB_RUS_MASK) != SCB_RUS_READY) {
-		e100_start_ru(bdp);
-	}
-
-	return rfd_cnt;
-}
-
-void
-e100_refresh_txthld(struct e100_private *bdp)
-{
-	basic_cntr_t *pstat = &(bdp->stats_counters->basic_stats);
-
-	/* as long as tx_per_underrun is not 0, we can go about dynamically *
-	 * adjusting the xmit threshold. we stop doing that & resort to defaults
-	 * * once the adjustments become meaningless. the value is adjusted by *
-	 * dumping the error counters & checking the # of xmit underrun errors *
-	 * we've had. */
-	if (bdp->tx_per_underrun) {
-		/* We are going to last values dumped from the dump statistics
-		 * command */
-		if (le32_to_cpu(pstat->xmt_gd_frames)) {
-			if (le32_to_cpu(pstat->xmt_uruns)) {
-				/* 
-				 * if we have had more than one underrun per "DEFAULT #
-				 * OF XMITS ALLOWED PER UNDERRUN" good xmits, raise the
-				 * THRESHOLD.
-				 */
-				if ((le32_to_cpu(pstat->xmt_gd_frames) /
-				     le32_to_cpu(pstat->xmt_uruns)) <
-				    bdp->tx_per_underrun) {
-					bdp->tx_thld += 3;
-				}
-			}
-
-			/* 
-			 * if we've had less than one underrun per the DEFAULT number of
-			 * of good xmits allowed, lower the THOLD but not less than 0 
-			 */
-			if (le32_to_cpu(pstat->xmt_gd_frames) >
-			    bdp->tx_per_underrun) {
-				bdp->tx_thld--;
-
-				if (bdp->tx_thld < 6)
-					bdp->tx_thld = 6;
-
-			}
-		}
-
-		/* end good xmits */
-		/* 
-		 * * if our adjustments are becoming unresonable, stop adjusting &
-		 * resort * to defaults & pray. A THOLD value > 190 means that the
-		 * adapter will * wait for 190*8=1520 bytes in TX FIFO before it
-		 * starts xmit. Since * MTU is 1514, it doesn't make any sense for
-		 * further increase. */
-		if (bdp->tx_thld >= 190) {
-			bdp->tx_per_underrun = 0;
-			bdp->tx_thld = 189;
-		}
-	}			/* end underrun check */
-}
-
-/**
- * e100_prepare_xmit_buff - prepare a buffer for transmission
- * @bdp: atapter's private data struct
- * @skb: skb to send
- *
- * This routine prepare a buffer for transmission. It checks
- * the message length for the appropiate size. It picks up a
- * free tcb from the TCB pool and sets up the corresponding
- * TBD's. If the number of fragments are more than the number
- * of TBD/TCB it copies all the fragments in a coalesce buffer.
- * It returns a pointer to the prepared TCB.
- */
-static inline tcb_t *
-e100_prepare_xmit_buff(struct e100_private *bdp, struct sk_buff *skb)
-{
-	tcb_t *tcb, *prev_tcb;
-
-	tcb = bdp->tcb_pool.data;
-	tcb += TCB_TO_USE(bdp->tcb_pool);
-
-	if (bdp->flags & USE_IPCB) {
-		tcb->tcbu.ipcb.ip_activation_high = IPCB_IP_ACTIVATION_DEFAULT;
-		tcb->tcbu.ipcb.ip_schedule &= ~IPCB_TCP_PACKET;
-		tcb->tcbu.ipcb.ip_schedule &= ~IPCB_TCPUDP_CHECKSUM_ENABLE;
-	}
-
-	if(bdp->vlgrp && vlan_tx_tag_present(skb)) {
-		(tcb->tcbu).ipcb.ip_activation_high |= IPCB_INSERTVLAN_ENABLE;
-		(tcb->tcbu).ipcb.vlan = cpu_to_be16(vlan_tx_tag_get(skb));
-	}
-	
-	tcb->tcb_hdr.cb_status = 0;
-	tcb->tcb_thrshld = bdp->tx_thld;
-	tcb->tcb_hdr.cb_cmd |= __constant_cpu_to_le16(CB_S_BIT);
-
-	/* Set I (Interrupt) bit on every (TX_FRAME_CNT)th packet */
-	if (!(++bdp->tx_count % TX_FRAME_CNT))
-		tcb->tcb_hdr.cb_cmd |= __constant_cpu_to_le16(CB_I_BIT);
-	else
-		/* Clear I bit on other packets */
-		tcb->tcb_hdr.cb_cmd &= ~__constant_cpu_to_le16(CB_I_BIT);
-
-	tcb->tcb_skb = skb;
-
-	if (skb->ip_summed == CHECKSUM_HW) {
-		const struct iphdr *ip = skb->nh.iph;
-
-		if ((ip->protocol == IPPROTO_TCP) ||
-		    (ip->protocol == IPPROTO_UDP)) {
-
-			tcb->tcbu.ipcb.ip_activation_high |=
-				IPCB_HARDWAREPARSING_ENABLE;
-			tcb->tcbu.ipcb.ip_schedule |=
-				IPCB_TCPUDP_CHECKSUM_ENABLE;
-
-			if (ip->protocol == IPPROTO_TCP)
-				tcb->tcbu.ipcb.ip_schedule |= IPCB_TCP_PACKET;
-		}
-	}
-
-	if (!skb_shinfo(skb)->nr_frags) {
-		(tcb->tbd_ptr)->tbd_buf_addr =
-			cpu_to_le32(pci_map_single(bdp->pdev, skb->data,
-						   skb->len, PCI_DMA_TODEVICE));
-		(tcb->tbd_ptr)->tbd_buf_cnt = cpu_to_le16(skb->len);
-		tcb->tcb_tbd_num = 1;
-		tcb->tcb_tbd_ptr = tcb->tcb_tbd_dflt_ptr;
-	} else {
-		int i;
-		void *addr;
-		tbd_t *tbd_arr_ptr = &(tcb->tbd_ptr[1]);
-		skb_frag_t *frag = &skb_shinfo(skb)->frags[0];
-
-		(tcb->tbd_ptr)->tbd_buf_addr =
-			cpu_to_le32(pci_map_single(bdp->pdev, skb->data,
-						   skb_headlen(skb),
-						   PCI_DMA_TODEVICE));
-		(tcb->tbd_ptr)->tbd_buf_cnt =
-			cpu_to_le16(skb_headlen(skb));
-
-		for (i = 0; i < skb_shinfo(skb)->nr_frags;
-		     i++, tbd_arr_ptr++, frag++) {
-
-			addr = ((void *) page_address(frag->page) +
-				frag->page_offset);
-
-			tbd_arr_ptr->tbd_buf_addr =
-				cpu_to_le32(pci_map_single(bdp->pdev,
-							   addr, frag->size,
-							   PCI_DMA_TODEVICE));
-			tbd_arr_ptr->tbd_buf_cnt = cpu_to_le16(frag->size);
-		}
-		tcb->tcb_tbd_num = skb_shinfo(skb)->nr_frags + 1;
-		tcb->tcb_tbd_ptr = tcb->tcb_tbd_expand_ptr;
-	}
-
-	/* clear the S-BIT on the previous tcb */
-	prev_tcb = bdp->tcb_pool.data;
-	prev_tcb += PREV_TCB_USED(bdp->tcb_pool);
-	prev_tcb->tcb_hdr.cb_cmd &= __constant_cpu_to_le16((u16) ~CB_S_BIT);
-
-	bdp->tcb_pool.tail = NEXT_TCB_TOUSE(bdp->tcb_pool.tail);
-
-	wmb();
-
-	e100_start_cu(bdp, tcb);
-
-	return tcb;
-}
-
-/* Changed for 82558 enhancement */
-/**
- * e100_start_cu - start the adapter's CU
- * @bdp: atapter's private data struct
- * @tcb: TCB to be transmitted
- *
- * This routine issues a CU Start or CU Resume command to the 82558/9.
- * This routine was added because the prepare_ext_xmit_buff takes advantage
- * of the 82558/9's Dynamic TBD chaining feature and has to start the CU as
- * soon as the first TBD is ready. 
- *
- * e100_start_cu must be called while holding the tx_lock ! 
- */
-u8
-e100_start_cu(struct e100_private *bdp, tcb_t *tcb)
-{
-	unsigned long lock_flag;
-	u8 ret = true;
-
-	spin_lock_irqsave(&(bdp->bd_lock), lock_flag);
-	switch (bdp->next_cu_cmd) {
-	case RESUME_NO_WAIT:
-		/*last cu command was a CU_RESMUE if this is a 558 or newer we don't need to
-		 * wait for command word to clear, we reach here only if we are bachlor
-		 */
-		e100_exec_cmd(bdp, SCB_CUC_RESUME);
-		break;
-
-	case RESUME_WAIT:
-		if ((bdp->flags & IS_ICH) &&
-		    (bdp->cur_line_speed == 10) &&
-		    (bdp->cur_dplx_mode == HALF_DUPLEX)) {
-			e100_wait_exec_simple(bdp, SCB_CUC_NOOP);
-			udelay(1);
-		}
-		if ((e100_wait_exec_simple(bdp, SCB_CUC_RESUME)) &&
-		    (bdp->flags & IS_BACHELOR) && (!(bdp->flags & IS_ICH))) {
-			bdp->next_cu_cmd = RESUME_NO_WAIT;
-		}
-		break;
-
-	case START_WAIT:
-		// The last command was a non_tx CU command
-		if (!e100_wait_cus_idle(bdp))
-			printk(KERN_DEBUG
-			       "e100: %s: cu_start: timeout waiting for cu\n",
-			       bdp->device->name);
-		if (!e100_wait_exec_cmplx(bdp, (u32) (tcb->tcb_phys),
-					  SCB_CUC_START, CB_TRANSMIT)) {
-			printk(KERN_DEBUG
-			       "e100: %s: cu_start: timeout waiting for scb\n",
-			       bdp->device->name);
-			e100_exec_cmplx(bdp, (u32) (tcb->tcb_phys),
-					SCB_CUC_START);
-			ret = false;
-		}
-
-		bdp->next_cu_cmd = RESUME_WAIT;
-
-		break;
-	}
-
-	/* save the last tcb */
-	bdp->last_tcb = tcb;
-
-	spin_unlock_irqrestore(&(bdp->bd_lock), lock_flag);
-	return ret;
-}
-
-/* ====================================================================== */
-/* hw                                                                     */
-/* ====================================================================== */
-
-/**
- * e100_selftest - perform H/W self test
- * @bdp: atapter's private data struct
- * @st_timeout: address to return timeout value, if fails
- * @st_result: address to return selftest result, if fails
- *
- * This routine will issue PORT Self-test command to test the e100.
- * The self-test will fail if the adapter's master-enable bit is not
- * set in the PCI Command Register, or if the adapter is not seated
- * in a PCI master-enabled slot. we also disable interrupts when the
- * command is completed.
- *
- * Returns:
- *      true: if adapter passes self_test
- *      false: otherwise
- */
-unsigned char
-e100_selftest(struct e100_private *bdp, u32 *st_timeout, u32 *st_result)
-{
-	u32 selftest_cmd;
-
-	/* initialize the nic state before running test */
-	e100_sw_reset(bdp, PORT_SOFTWARE_RESET);
-	/* Setup the address of the self_test area */
-	selftest_cmd = bdp->selftest_phys;
-
-	/* Setup SELF TEST Command Code in D3 - D0 */
-	selftest_cmd |= PORT_SELFTEST;
-
-	/* Initialize the self-test signature and results DWORDS */
-	bdp->selftest->st_sign = 0;
-	bdp->selftest->st_result = 0xffffffff;
-
-	/* Do the port command */
-	writel(selftest_cmd, &bdp->scb->scb_port);
-	readw(&(bdp->scb->scb_status));	/* flushes last write, read-safe */
-
-	/* Wait at least 10 milliseconds for the self-test to complete */
-	set_current_state(TASK_UNINTERRUPTIBLE);
-	schedule_timeout(HZ / 100 + 1);
-
-	/* disable interrupts since they are enabled */
-	/* after device reset during selftest        */
-	e100_disable_clear_intr(bdp);
-
-	/* if The First Self Test DWORD Still Zero, We've timed out. If the
-	 * second DWORD is not zero then we have an error. */
-	if ((bdp->selftest->st_sign == 0) || (bdp->selftest->st_result != 0)) {
-
-		if (st_timeout)
-			*st_timeout = !(le32_to_cpu(bdp->selftest->st_sign));
-
-		if (st_result)
-			*st_result = le32_to_cpu(bdp->selftest->st_result);
-
-		return false;
-	}
-
-	return true;
-}
-
-/**
- * e100_setup_iaaddr - issue IA setup sommand
- * @bdp: atapter's private data struct
- * @eaddr: new ethernet address
- *
- * This routine will issue the IA setup command. This command
- * will notify the 82557 (e100) of what its individual (node)
- * address is. This command will be executed in polled mode.
- *
- * Returns:
- *      true: if the IA setup command was successfully issued and completed
- *      false: otherwise
- */
-unsigned char
-e100_setup_iaaddr(struct e100_private *bdp, u8 *eaddr)
-{
-	unsigned int i;
-	cb_header_t *ntcb_hdr;
-	unsigned char res;
-	nxmit_cb_entry_t *cmd;
-
-	if ((cmd = e100_alloc_non_tx_cmd(bdp)) == NULL) {
-		res = false;
-		goto exit;
-	}
-
-	ntcb_hdr = (cb_header_t *) cmd->non_tx_cmd;
-	ntcb_hdr->cb_cmd = __constant_cpu_to_le16(CB_IA_ADDRESS);
-
-	for (i = 0; i < ETH_ALEN; i++) {
-		(cmd->non_tx_cmd)->ntcb.setup.ia_addr[i] = eaddr[i];
-	}
-
-	res = e100_exec_non_cu_cmd(bdp, cmd);
-	if (!res)
-		printk(KERN_WARNING "e100: %s: IA setup failed\n", 
-		       bdp->device->name);
-
-exit:
-	return res;
-}
-
-/**
- * e100_start_ru - start the RU if needed
- * @bdp: atapter's private data struct
- *
- * This routine checks the status of the 82557's receive unit(RU),
- * and starts the RU if it was not already active.  However,
- * before restarting the RU, the driver gives the RU the buffers
- * it freed up during the servicing of the ISR. If there are
- * no free buffers to give to the RU, (i.e. we have reached a
- * no resource condition) the RU will not be started till the
- * next ISR.
- */
-void
-e100_start_ru(struct e100_private *bdp)
-{
-	struct rx_list_elem *rx_struct = NULL;
-	int buffer_found = 0;
-	struct list_head *entry_ptr;
-
-	list_for_each(entry_ptr, &(bdp->active_rx_list)) {
-		rx_struct =
-			list_entry(entry_ptr, struct rx_list_elem, list_elem);
-		pci_dma_sync_single(bdp->pdev, rx_struct->dma_addr,
-				    bdp->rfd_size, PCI_DMA_FROMDEVICE);
-		if (!((SKB_RFD_STATUS(rx_struct->skb, bdp) &
-		       __constant_cpu_to_le16(RFD_STATUS_COMPLETE)))) {
-			buffer_found = 1;
-			break;
-		}
-	}
-
-	/* No available buffers */
-	if (!buffer_found) {
-		return;
-	}
-
-	spin_lock(&bdp->bd_lock);
-
-	if (!e100_wait_exec_cmplx(bdp, rx_struct->dma_addr, SCB_RUC_START, 0)) {
-		printk(KERN_DEBUG
-		       "e100: %s: start_ru: wait_scb failed\n", 
-		       bdp->device->name);
-		e100_exec_cmplx(bdp, rx_struct->dma_addr, SCB_RUC_START);
-	}
-	if (bdp->next_cu_cmd == RESUME_NO_WAIT) {
-		bdp->next_cu_cmd = RESUME_WAIT;
-	}
-	spin_unlock(&bdp->bd_lock);
-}
-
-/**
- * e100_cmd_complete_location
- * @bdp: atapter's private data struct
- *
- * This routine returns a pointer to the location of the command-complete
- * DWord in the dump statistical counters area, according to the statistical
- * counters mode (557 - basic, 558 - extended, or 559 - TCO mode).
- * See e100_config_init() for the setting of the statistical counters mode.
- */
-static u32 *
-e100_cmd_complete_location(struct e100_private *bdp)
-{
-	u32 *cmd_complete;
-	max_counters_t *stats = bdp->stats_counters;
-
-	switch (bdp->stat_mode) {
-	case E100_EXTENDED_STATS:
-		cmd_complete =
-			(u32 *) &(((err_cntr_558_t *) (stats))->cmd_complete);
-		break;
-
-	case E100_TCO_STATS:
-		cmd_complete =
-			(u32 *) &(((err_cntr_559_t *) (stats))->cmd_complete);
-		break;
-
-	case E100_BASIC_STATS:
-	default:		
-		cmd_complete =
-			(u32 *) &(((err_cntr_557_t *) (stats))->cmd_complete);
-		break;
-	}
-
-	return cmd_complete;
-}
-
-/**
- * e100_clr_cntrs - clear statistics counters
- * @bdp: atapter's private data struct
- *
- * This routine will clear the adapter error statistic counters.
- *
- * Returns:
- *      true: if successfully cleared stat counters
- *      false: otherwise
- */
-static unsigned char
-e100_clr_cntrs(struct e100_private *bdp)
-{
-	volatile u32 *pcmd_complete;
-
-	/* clear the dump counter complete word */
-	pcmd_complete = e100_cmd_complete_location(bdp);
-	*pcmd_complete = 0;
-	wmb();
-
-	if (!e100_wait_exec_cmplx(bdp, bdp->stat_cnt_phys, SCB_CUC_DUMP_ADDR, 0))
-		return false;
-
-	/* wait 10 microseconds for the command to complete */
-	udelay(10);
-
-	if (!e100_wait_exec_simple(bdp, SCB_CUC_DUMP_RST_STAT))
-		return false;
-
-	if (bdp->next_cu_cmd == RESUME_NO_WAIT) {
-		bdp->next_cu_cmd = RESUME_WAIT;
-	}
-
-	return true;
-}
-
-static unsigned char
-e100_update_stats(struct e100_private *bdp)
-{
-	u32 *pcmd_complete;
-	basic_cntr_t *pstat = &(bdp->stats_counters->basic_stats);
-
-	// check if last dump command completed
-	pcmd_complete = e100_cmd_complete_location(bdp);
-	if (*pcmd_complete != le32_to_cpu(DUMP_RST_STAT_COMPLETED) &&
-	    *pcmd_complete != le32_to_cpu(DUMP_STAT_COMPLETED)) {
-		*pcmd_complete = 0;
-		return false;
-	}
-
-	/* increment the statistics */
-	bdp->drv_stats.net_stats.rx_packets +=
-		le32_to_cpu(pstat->rcv_gd_frames);
-	bdp->drv_stats.net_stats.tx_packets +=
-		le32_to_cpu(pstat->xmt_gd_frames);
-	bdp->drv_stats.net_stats.rx_dropped += le32_to_cpu(pstat->rcv_rsrc_err);
-	bdp->drv_stats.net_stats.collisions += le32_to_cpu(pstat->xmt_ttl_coll);
-	bdp->drv_stats.net_stats.rx_length_errors +=
-		le32_to_cpu(pstat->rcv_shrt_frames);
-	bdp->drv_stats.net_stats.rx_over_errors +=
-		le32_to_cpu(pstat->rcv_rsrc_err);
-	bdp->drv_stats.net_stats.rx_crc_errors +=
-		le32_to_cpu(pstat->rcv_crc_errs);
-	bdp->drv_stats.net_stats.rx_frame_errors +=
-		le32_to_cpu(pstat->rcv_algn_errs);
-	bdp->drv_stats.net_stats.rx_fifo_errors +=
-		le32_to_cpu(pstat->rcv_oruns);
-	bdp->drv_stats.net_stats.tx_aborted_errors +=
-		le32_to_cpu(pstat->xmt_max_coll);
-	bdp->drv_stats.net_stats.tx_carrier_errors +=
-		le32_to_cpu(pstat->xmt_lost_crs);
-	bdp->drv_stats.net_stats.tx_fifo_errors +=
-		le32_to_cpu(pstat->xmt_uruns);
-
-	bdp->drv_stats.tx_late_col += le32_to_cpu(pstat->xmt_late_coll);
-	bdp->drv_stats.tx_ok_defrd += le32_to_cpu(pstat->xmt_deferred);
-	bdp->drv_stats.tx_one_retry += le32_to_cpu(pstat->xmt_sngl_coll);
-	bdp->drv_stats.tx_mt_one_retry += le32_to_cpu(pstat->xmt_mlt_coll);
-	bdp->drv_stats.rcv_cdt_frames += le32_to_cpu(pstat->rcv_err_coll);
-
-	if (bdp->stat_mode != E100_BASIC_STATS) {
-		ext_cntr_t *pex_stat = &bdp->stats_counters->extended_stats;
-
-		bdp->drv_stats.xmt_fc_pkts +=
-			le32_to_cpu(pex_stat->xmt_fc_frames);
-		bdp->drv_stats.rcv_fc_pkts +=
-			le32_to_cpu(pex_stat->rcv_fc_frames);
-		bdp->drv_stats.rcv_fc_unsupported +=
-			le32_to_cpu(pex_stat->rcv_fc_unsupported);
-	}
-
-	if (bdp->stat_mode == E100_TCO_STATS) {
-		tco_cntr_t *ptco_stat = &bdp->stats_counters->tco_stats;
-
-		bdp->drv_stats.xmt_tco_pkts +=
-			le16_to_cpu(ptco_stat->xmt_tco_frames);
-		bdp->drv_stats.rcv_tco_pkts +=
-			le16_to_cpu(ptco_stat->rcv_tco_frames);
-	}
-
-	*pcmd_complete = 0;
-	return true;
-}
-
-/**
- * e100_dump_stat_cntrs
- * @bdp: atapter's private data struct
- *
- * This routine will dump the board statistical counters without waiting
- * for stat_dump to complete. Any access to this stats should verify the completion
- * of the command
- */
-void
-e100_dump_stats_cntrs(struct e100_private *bdp)
-{
-	unsigned long lock_flag_bd;
-
-	spin_lock_irqsave(&(bdp->bd_lock), lock_flag_bd);
-
-	/* dump h/w stats counters */
-	if (e100_wait_exec_simple(bdp, SCB_CUC_DUMP_RST_STAT)) {
-		if (bdp->next_cu_cmd == RESUME_NO_WAIT) {
-			bdp->next_cu_cmd = RESUME_WAIT;
-		}
-	}
-
-	spin_unlock_irqrestore(&(bdp->bd_lock), lock_flag_bd);
-}
-
-/**
- * e100_exec_non_cu_cmd
- * @bdp: atapter's private data struct
- * @command: the non-cu command to execute
- *
- * This routine will submit a command block to be executed,
- */
-unsigned char
-e100_exec_non_cu_cmd(struct e100_private *bdp, nxmit_cb_entry_t *command)
-{
-	cb_header_t *ntcb_hdr;
-	unsigned long lock_flag;
-	unsigned long expiration_time;
-	unsigned char rc = true;
-	u8 sub_cmd;
-
-	ntcb_hdr = (cb_header_t *) command->non_tx_cmd;	/* get hdr of non tcb cmd */
-	sub_cmd = cpu_to_le16(ntcb_hdr->cb_cmd);
-
-	/* Set the Command Block to be the last command block */
-	ntcb_hdr->cb_cmd |= __constant_cpu_to_le16(CB_EL_BIT);
-	ntcb_hdr->cb_status = 0;
-	ntcb_hdr->cb_lnk_ptr = 0;
-
-	wmb();
-	if (in_interrupt())
-		return e100_delayed_exec_non_cu_cmd(bdp, command);
-
-	if (netif_running(bdp->device) && netif_carrier_ok(bdp->device))
-		return e100_delayed_exec_non_cu_cmd(bdp, command);
-
-	spin_lock_bh(&(bdp->bd_non_tx_lock));
-
-	if (bdp->non_tx_command_state != E100_NON_TX_IDLE) {
-		goto delayed_exec;
-	}
-
-	if (bdp->last_tcb) {
-		rmb();
-		if ((bdp->last_tcb->tcb_hdr.cb_status &
-		     __constant_cpu_to_le16(CB_STATUS_COMPLETE)) == 0)
-			goto delayed_exec;
-	}
-
-	if ((readw(&bdp->scb->scb_status) & SCB_CUS_MASK) == SCB_CUS_ACTIVE) {
-		goto delayed_exec;
-	}
-
-	spin_lock_irqsave(&bdp->bd_lock, lock_flag);
-
-	if (!e100_wait_exec_cmplx(bdp, command->dma_addr, SCB_CUC_START, sub_cmd)) {
-		spin_unlock_irqrestore(&(bdp->bd_lock), lock_flag);
-		rc = false;
-		goto exit;
-	}
-
-	bdp->next_cu_cmd = START_WAIT;
-	spin_unlock_irqrestore(&(bdp->bd_lock), lock_flag);
-
-	/* now wait for completion of non-cu CB up to 20 msec */
-	expiration_time = jiffies + HZ / 50 + 1;
-	rmb();
-	while (!(ntcb_hdr->cb_status &
-		     __constant_cpu_to_le16(CB_STATUS_COMPLETE))) {
-
-		if (time_before(jiffies, expiration_time)) {
-			spin_unlock_bh(&(bdp->bd_non_tx_lock));
-			yield();
-			spin_lock_bh(&(bdp->bd_non_tx_lock));
-		} else {
-#ifdef E100_CU_DEBUG			
-			printk(KERN_ERR "e100: %s: non-TX command (%x) "
-				"timeout\n", bdp->device->name, sub_cmd);
-#endif			
-			rc = false;
-			goto exit;
-		}
-		rmb();
-	}
-
-exit:
-	e100_free_non_tx_cmd(bdp, command);
-
-	if (netif_running(bdp->device))
-		netif_wake_queue(bdp->device);
-
-	spin_unlock_bh(&(bdp->bd_non_tx_lock));
-	return rc;
-
-delayed_exec:
-	spin_unlock_bh(&(bdp->bd_non_tx_lock));
-	return e100_delayed_exec_non_cu_cmd(bdp, command);
-}
-
-/**
- * e100_sw_reset
- * @bdp: atapter's private data struct
- * @reset_cmd: s/w reset or selective reset
- *
- * This routine will issue a software reset to the adapter. It 
- * will also disable interrupts, as the are enabled after reset.
- */
-void
-e100_sw_reset(struct e100_private *bdp, u32 reset_cmd)
-{
-	/* Do  a selective reset first to avoid a potential PCI hang */
-	writel(PORT_SELECTIVE_RESET, &bdp->scb->scb_port);
-	readw(&(bdp->scb->scb_status));	/* flushes last write, read-safe */
-
-	/* wait for the reset to take effect */
-	udelay(20);
-	if (reset_cmd == PORT_SOFTWARE_RESET) {
-		writel(PORT_SOFTWARE_RESET, &bdp->scb->scb_port);
-
-		/* wait 20 micro seconds for the reset to take effect */
-		udelay(20);
-	}
-
-	/* Mask off our interrupt line -- it is unmasked after reset */
-	e100_disable_clear_intr(bdp);
-#ifdef E100_CU_DEBUG	
-	bdp->last_cmd = 0;
-	bdp->last_sub_cmd = 0;
-#endif	
-}
-
-/**
- * e100_load_microcode - Download microsocde to controller.
- * @bdp: atapter's private data struct
- *
- * This routine downloads microcode on to the controller. This
- * microcode is available for the 82558/9, 82550. Currently the
- * microcode handles interrupt bundling and TCO workaround.
- *
- * Returns:
- *      true: if successfull
- *      false: otherwise
- */
-static unsigned char
-e100_load_microcode(struct e100_private *bdp)
-{
-	static struct {
-		u8 rev_id;
-		u32 ucode[UCODE_MAX_DWORDS + 1];
-		int timer_dword;
-		int bundle_dword;
-		int min_size_dword;
-	} ucode_opts[] = {
-		{ D101A4_REV_ID,
-		  D101_A_RCVBUNDLE_UCODE,
-		  D101_CPUSAVER_TIMER_DWORD,
-		  D101_CPUSAVER_BUNDLE_DWORD,
-		  D101_CPUSAVER_MIN_SIZE_DWORD },
-		{ D101B0_REV_ID,
-		  D101_B0_RCVBUNDLE_UCODE,
-		  D101_CPUSAVER_TIMER_DWORD,
-		  D101_CPUSAVER_BUNDLE_DWORD,
-		  D101_CPUSAVER_MIN_SIZE_DWORD },
-		{ D101MA_REV_ID,
-		  D101M_B_RCVBUNDLE_UCODE,
-		  D101M_CPUSAVER_TIMER_DWORD,
-		  D101M_CPUSAVER_BUNDLE_DWORD,
-		  D101M_CPUSAVER_MIN_SIZE_DWORD },
-		{ D101S_REV_ID,
-		  D101S_RCVBUNDLE_UCODE,
-		  D101S_CPUSAVER_TIMER_DWORD,
-		  D101S_CPUSAVER_BUNDLE_DWORD,
-		  D101S_CPUSAVER_MIN_SIZE_DWORD },
-		{ D102_REV_ID,
-		  D102_B_RCVBUNDLE_UCODE,
-		  D102_B_CPUSAVER_TIMER_DWORD,
-		  D102_B_CPUSAVER_BUNDLE_DWORD,
-		  D102_B_CPUSAVER_MIN_SIZE_DWORD },
-		{ D102C_REV_ID,
-		  D102_C_RCVBUNDLE_UCODE,
-		  D102_C_CPUSAVER_TIMER_DWORD,
-		  D102_C_CPUSAVER_BUNDLE_DWORD,
-		  D102_C_CPUSAVER_MIN_SIZE_DWORD },
-		{ D102E_REV_ID,
-		  D102_E_RCVBUNDLE_UCODE,
-		  D102_E_CPUSAVER_TIMER_DWORD,
-		  D102_E_CPUSAVER_BUNDLE_DWORD,
-		  D102_E_CPUSAVER_MIN_SIZE_DWORD },
-		{ 0, {0}, 0, 0, 0}
-	}, *opts;
-
-	opts = ucode_opts;
-
-	/* User turned ucode loading off */
-	if (!(bdp->params.b_params & PRM_UCODE))
-		return false;
-
-	/* These controllers do not need ucode */
-	if (bdp->flags & IS_ICH)
-		return false;
-
-	/* Search for ucode match against h/w rev_id */
-	while (opts->rev_id) {
-		if (bdp->rev_id == opts->rev_id) {
-			int i;
-			u32 *ucode_dword;
-			load_ucode_cb_t *ucode_cmd_ptr;
-			nxmit_cb_entry_t *cmd = e100_alloc_non_tx_cmd(bdp);
-
-			if (cmd != NULL) {
-				ucode_cmd_ptr =
-					(load_ucode_cb_t *) cmd->non_tx_cmd;
-				ucode_dword = ucode_cmd_ptr->ucode_dword;
-			} else {
-				return false;
-			}
-
-			memcpy(ucode_dword, opts->ucode, sizeof (opts->ucode));
-
-			/* Insert user-tunable settings */
-			ucode_dword[opts->timer_dword] &= 0xFFFF0000;
-			ucode_dword[opts->timer_dword] |=
-				(u16) bdp->params.IntDelay;
-			ucode_dword[opts->bundle_dword] &= 0xFFFF0000;
-			ucode_dword[opts->bundle_dword] |=
-				(u16) bdp->params.BundleMax;
-			ucode_dword[opts->min_size_dword] &= 0xFFFF0000;
-			ucode_dword[opts->min_size_dword] |=
-				(bdp->params.b_params & PRM_BUNDLE_SMALL) ?
-				0xFFFF : 0xFF80;
-
-			for (i = 0; i < UCODE_MAX_DWORDS; i++)
-				cpu_to_le32s(&(ucode_dword[i]));
-
-			ucode_cmd_ptr->load_ucode_cbhdr.cb_cmd =
-				__constant_cpu_to_le16(CB_LOAD_MICROCODE);
-
-			return e100_exec_non_cu_cmd(bdp, cmd);
-		}
-		opts++;
-	}
-
-	return false;
-}
-
-/***************************************************************************/
-/***************************************************************************/
-/*       EEPROM  Functions                                                 */
-/***************************************************************************/
-
-/* Read PWA (printed wired assembly) number */
-void
-e100_rd_pwa_no(struct e100_private *bdp)
-{
-	bdp->pwa_no = e100_eeprom_read(bdp, EEPROM_PWA_NO);
-	bdp->pwa_no <<= 16;
-	bdp->pwa_no |= e100_eeprom_read(bdp, EEPROM_PWA_NO + 1);
-}
-
-/* Read the permanent ethernet address from the eprom. */
-void
-e100_rd_eaddr(struct e100_private *bdp)
-{
-	int i;
-	u16 eeprom_word;
-
-	for (i = 0; i < 6; i += 2) {
-		eeprom_word =
-			e100_eeprom_read(bdp,
-					 EEPROM_NODE_ADDRESS_BYTE_0 + (i / 2));
-
-		bdp->device->dev_addr[i] =
-			bdp->perm_node_address[i] = (u8) eeprom_word;
-		bdp->device->dev_addr[i + 1] =
-			bdp->perm_node_address[i + 1] = (u8) (eeprom_word >> 8);
-	}
-}
-
-/* Check the D102 RFD flags to see if the checksum passed */
-static unsigned char
-e100_D102_check_checksum(rfd_t *rfd)
-{
-	if (((le16_to_cpu(rfd->rfd_header.cb_status)) & RFD_PARSE_BIT)
-	    && (((rfd->rcvparserstatus & CHECKSUM_PROTOCOL_MASK) ==
-		 RFD_TCP_PACKET)
-		|| ((rfd->rcvparserstatus & CHECKSUM_PROTOCOL_MASK) ==
-		    RFD_UDP_PACKET))
-	    && (rfd->checksumstatus & TCPUDP_CHECKSUM_BIT_VALID)
-	    && (rfd->checksumstatus & TCPUDP_CHECKSUM_VALID)) {
-		return CHECKSUM_UNNECESSARY;
-	}
-	return CHECKSUM_NONE;
-}
-
-/**
- * e100_D101M_checksum
- * @bdp: atapter's private data struct
- * @skb: skb received
- *
- * Sets the skb->csum value from D101 csum found at the end of the Rx frame. The
- * D101M sums all words in frame excluding the ethernet II header (14 bytes) so
- * in case the packet is ethernet II and the protocol is IP, all is need is to
- * assign this value to skb->csum.
- */
-static unsigned char
-e100_D101M_checksum(struct e100_private *bdp, struct sk_buff *skb)
-{
-	unsigned short proto = (skb->protocol);
-
-	if (proto == __constant_htons(ETH_P_IP)) {
-
-		skb->csum = get_unaligned((u16 *) (skb->tail));
-		return CHECKSUM_HW;
-	}
-	return CHECKSUM_NONE;
-}
-
-/***************************************************************************/
-/***************************************************************************/
-/***************************************************************************/
-/***************************************************************************/
-/*       Auxilary Functions                                                */
-/***************************************************************************/
-
-/* Print the board's configuration */
-void
-e100_print_brd_conf(struct e100_private *bdp)
-{
-	/* Print the string if checksum Offloading was enabled */
-	if (bdp->flags & DF_CSUM_OFFLOAD)
-		printk(KERN_NOTICE "  Hardware receive checksums enabled\n");
-	else {
-		if (bdp->rev_id >= D101MA_REV_ID) 
-			printk(KERN_NOTICE "  Hardware receive checksums disabled\n");
-	}
-
-	if ((bdp->flags & DF_UCODE_LOADED))
-		printk(KERN_NOTICE "  cpu cycle saver enabled\n");
-}
-
-/**
- * e100_pci_setup - setup the adapter's PCI information
- * @pcid: adapter's pci_dev struct
- * @bdp: atapter's private data struct
- *
- * This routine sets up all PCI information for the adapter. It enables the bus
- * master bit (some BIOS don't do this), requests memory ans I/O regions, and
- * calls ioremap() on the adapter's memory region.
- *
- * Returns:
- *      true: if successfull
- *      false: otherwise
- */
-static unsigned char
-e100_pci_setup(struct pci_dev *pcid, struct e100_private *bdp)
-{
-	struct net_device *dev = bdp->device;
-	int rc = 0;
-
-	if ((rc = pci_enable_device(pcid)) != 0) {
-		goto err;
-	}
-
-	/* dev and ven ID have already been checked so it is our device */
-	pci_read_config_byte(pcid, PCI_REVISION_ID, (u8 *) &(bdp->rev_id));
-
-	/* address #0 is a memory region */
-	dev->mem_start = pci_resource_start(pcid, 0);
-	dev->mem_end = dev->mem_start + sizeof (scb_t);
-
-	/* address #1 is a IO region */
-	dev->base_addr = pci_resource_start(pcid, 1);
-
-	if ((rc = pci_request_regions(pcid, e100_short_driver_name)) != 0) {
-		goto err_disable;
-	}
-
-	pci_enable_wake(pcid, 0, 0);
-
-	/* if Bus Mastering is off, turn it on! */
-	pci_set_master(pcid);
-
-	/* address #0 is a memory mapping */
-	bdp->scb = (scb_t *) ioremap_nocache(dev->mem_start, sizeof (scb_t));
-
-	if (!bdp->scb) {
-		printk(KERN_ERR "e100: %s: Failed to map PCI address 0x%lX\n",
-		       dev->name, pci_resource_start(pcid, 0));
-		rc = -ENOMEM;
-		goto err_region;
-	}
-
-	return 0;
-
-err_region:
-	pci_release_regions(pcid);
-err_disable:
-	pci_disable_device(pcid);
-err:
-	return rc;
-}
-
-void
-e100_isolate_driver(struct e100_private *bdp)
-{
-
-	/* Check if interface is up                              */
-	/* NOTE: Can't use netif_running(bdp->device) because    */
-	/* dev_close clears __LINK_STATE_START before calling    */
-	/* e100_close (aka dev->stop)                            */
-	if (bdp->device->flags & IFF_UP) {
-		e100_disable_clear_intr(bdp);
-		del_timer_sync(&bdp->watchdog_timer);
-		netif_carrier_off(bdp->device);
-		netif_stop_queue(bdp->device); 
-		bdp->last_tcb = NULL;
-	} 
-	e100_sw_reset(bdp, PORT_SELECTIVE_RESET);
-}
-
-static void
-e100_tcb_add_C_bit(struct e100_private *bdp)
-{
-	tcb_t *tcb = (tcb_t *) bdp->tcb_pool.data;
-	int i;
-
-	for (i = 0; i < bdp->params.TxDescriptors; i++, tcb++) {
-		tcb->tcb_hdr.cb_status |= cpu_to_le16(CB_STATUS_COMPLETE);
-	}
-}
-
-/* 
- * Procedure:   e100_configure_device
- *
- * Description: This routine will configure device
- *
- * Arguments:
- *      bdp - Ptr to this card's e100_bdconfig structure
- *
- * Returns:
- *        true upon success
- *        false upon failure
- */
-unsigned char
-e100_configure_device(struct e100_private *bdp)
-{
-	/*load CU & RU base */
-	if (!e100_wait_exec_cmplx(bdp, 0, SCB_CUC_LOAD_BASE, 0))
-		return false;
-
-	if (e100_load_microcode(bdp))
-		bdp->flags |= DF_UCODE_LOADED;
-
-	if (!e100_wait_exec_cmplx(bdp, 0, SCB_RUC_LOAD_BASE, 0))
-		return false;
-
-	/* Issue the load dump counters address command */
-	if (!e100_wait_exec_cmplx(bdp, bdp->stat_cnt_phys, SCB_CUC_DUMP_ADDR, 0))
-		return false;
-
-	if (!e100_setup_iaaddr(bdp, bdp->device->dev_addr)) {
-		printk(KERN_ERR "e100: e100_configure_device: "
-			"setup iaaddr failed\n");
-		return false;
-	}
-
-	e100_set_multi_exec(bdp->device);
-
-	/* Change for 82558 enhancement                                */
-	/* If 82558/9 and if the user has enabled flow control, set up */
-	/* flow Control Reg. in the CSR                                */
-	if ((bdp->flags & IS_BACHELOR)
-	    && (bdp->params.b_params & PRM_FC)) {
-		writeb(DFLT_FC_THLD,
-			&bdp->scb->scb_ext.d101_scb.scb_fc_thld);
-		writeb(DFLT_FC_CMD,
-			&bdp->scb->scb_ext.d101_scb.scb_fc_xon_xoff);
-	}
-
-	e100_force_config(bdp);
-
-	return true;
-}
-
-void
-e100_deisolate_driver(struct e100_private *bdp, u8 full_reset)
-{
-	u32 cmd = full_reset ? PORT_SOFTWARE_RESET : PORT_SELECTIVE_RESET;
-	e100_sw_reset(bdp, cmd);
-	if (cmd == PORT_SOFTWARE_RESET) {
-		if (!e100_configure_device(bdp))
-			printk(KERN_ERR "e100: e100_deisolate_driver:" 
-		       		" device configuration failed\n");
-	} 
-
-	if (netif_running(bdp->device)) {
-
-		bdp->next_cu_cmd = START_WAIT;
-		bdp->last_tcb = NULL;
-
-		e100_start_ru(bdp);
-
-		/* relaunch watchdog timer in 2 sec */
-		mod_timer(&(bdp->watchdog_timer), jiffies + (2 * HZ));
-
-		// we must clear tcbs since we may have lost Tx intrrupt
-		// or have unsent frames on the tcb chain
-		e100_tcb_add_C_bit(bdp);
-		e100_tx_srv(bdp);
-		netif_wake_queue(bdp->device);
-		e100_set_intr_mask(bdp);
-	}
-}
-
-static int
-e100_do_ethtool_ioctl(struct net_device *dev, struct ifreq *ifr)
-{
-	struct ethtool_cmd ecmd;
-	int rc = -EOPNOTSUPP;
-
-	if (copy_from_user(&ecmd, ifr->ifr_data, sizeof (ecmd.cmd)))
-		return -EFAULT;
-
-	switch (ecmd.cmd) {
-	case ETHTOOL_GSET:
-		rc = e100_ethtool_get_settings(dev, ifr);
-		break;
-	case ETHTOOL_SSET:
-		rc = e100_ethtool_set_settings(dev, ifr);
-		break;
-	case ETHTOOL_GDRVINFO:
-		rc = e100_ethtool_get_drvinfo(dev, ifr);
-		break;
-	case ETHTOOL_GREGS:
-		rc = e100_ethtool_gregs(dev, ifr);
-		break;
-	case ETHTOOL_NWAY_RST:
-		rc = e100_ethtool_nway_rst(dev, ifr);
-		break;
-	case ETHTOOL_GLINK:
-		rc = e100_ethtool_glink(dev, ifr);
-		break;
-	case ETHTOOL_GEEPROM:
-	case ETHTOOL_SEEPROM:
-		rc = e100_ethtool_eeprom(dev, ifr);
-		break;
-	case ETHTOOL_GSTATS: {
-		struct {
-			struct ethtool_stats cmd;
-			uint64_t data[E100_STATS_LEN];
-		} stats = { {ETHTOOL_GSTATS, E100_STATS_LEN} };
-		struct e100_private *bdp = dev->priv;
-		void *addr = ifr->ifr_data;
-		int i;
-
-		for(i = 0; i < E100_STATS_LEN; i++)
-			stats.data[i] =
-				((unsigned long *)&bdp->drv_stats.net_stats)[i];
-		if(copy_to_user(addr, &stats, sizeof(stats)))
-			return -EFAULT;
-		return 0;
-	}
-	case ETHTOOL_GWOL:
-	case ETHTOOL_SWOL:
-		rc = e100_ethtool_wol(dev, ifr);
-		break;
-	case ETHTOOL_TEST:
-		rc = e100_ethtool_test(dev, ifr);
-		break;
-	case ETHTOOL_GSTRINGS:
-		rc = e100_ethtool_gstrings(dev,ifr);
-		break;
-	case ETHTOOL_PHYS_ID:
-		rc = e100_ethtool_led_blink(dev,ifr);
-		break;
-#ifdef	ETHTOOL_GRINGPARAM
-	case ETHTOOL_GRINGPARAM: {
-		struct ethtool_ringparam ering;
-		struct e100_private *bdp = dev->priv;
-		memset((void *) &ering, 0, sizeof(ering));
-		ering.rx_max_pending = E100_MAX_RFD;
-		ering.tx_max_pending = E100_MAX_TCB;
-		ering.rx_pending = bdp->params.RxDescriptors;
-		ering.tx_pending = bdp->params.TxDescriptors;
-		rc = copy_to_user(ifr->ifr_data, &ering, sizeof(ering))
-			? -EFAULT : 0;
-		return rc;
-	}
-#endif
-#ifdef	ETHTOOL_SRINGPARAM
-	case ETHTOOL_SRINGPARAM: {
-		struct ethtool_ringparam ering;
-		struct e100_private *bdp = dev->priv;
-		if (copy_from_user(&ering, ifr->ifr_data, sizeof(ering)))
-			return -EFAULT;
-		if (ering.rx_pending > E100_MAX_RFD 
-		    || ering.rx_pending < E100_MIN_RFD)
-			return -EINVAL;
-		if (ering.tx_pending > E100_MAX_TCB 
-		    || ering.tx_pending < E100_MIN_TCB)
-			return -EINVAL;
-		if (netif_running(dev)) {
-			spin_lock_bh(&dev->xmit_lock);
-			e100_close(dev);
-			spin_unlock_bh(&dev->xmit_lock);
-			/* Use new values to open interface */
-			bdp->params.RxDescriptors = ering.rx_pending;
-			bdp->params.TxDescriptors = ering.tx_pending;
-			e100_hw_init(bdp);
-			e100_open(dev);
-		}
-		else {
-			bdp->params.RxDescriptors = ering.rx_pending;
-			bdp->params.TxDescriptors = ering.tx_pending;
-		}
-		return 0;
-	}
-#endif
-#ifdef	ETHTOOL_GPAUSEPARAM
-	case ETHTOOL_GPAUSEPARAM: {
-		struct ethtool_pauseparam epause;
-		struct e100_private *bdp = dev->priv;
-		memset((void *) &epause, 0, sizeof(epause));
-		if ((bdp->flags & IS_BACHELOR)
-		    && (bdp->params.b_params & PRM_FC)) {
-			epause.autoneg = 1;
-			if (bdp->flags && DF_LINK_FC_CAP) {
-				epause.rx_pause = 1;
-				epause.tx_pause = 1;
-			}
-			if (bdp->flags && DF_LINK_FC_TX_ONLY)
-				epause.tx_pause = 1;
-		}
-		rc = copy_to_user(ifr->ifr_data, &epause, sizeof(epause))
-			? -EFAULT : 0;
-		return rc;
-	}
-#endif
-#ifdef	ETHTOOL_SPAUSEPARAM
-	case ETHTOOL_SPAUSEPARAM: {
-		struct ethtool_pauseparam epause;
-		struct e100_private *bdp = dev->priv;
-		if (!(bdp->flags & IS_BACHELOR))
-			return -EINVAL;
-		if (copy_from_user(&epause, ifr->ifr_data, sizeof(epause)))
-			return -EFAULT;
-		if (epause.autoneg == 1)
-			bdp->params.b_params |= PRM_FC;
-		else
-			bdp->params.b_params &= ~PRM_FC;
-		if (netif_running(dev)) {
-			spin_lock_bh(&dev->xmit_lock);
-			e100_close(dev);
-			spin_unlock_bh(&dev->xmit_lock);
-			e100_hw_init(bdp);
-			e100_open(dev);
-		}
-		return 0;
-	}
-#endif
-#ifdef	ETHTOOL_GRXCSUM
-	case ETHTOOL_GRXCSUM:
-	case ETHTOOL_GTXCSUM:
-	case ETHTOOL_GSG:
-	{	struct ethtool_value eval;
-		struct e100_private *bdp = dev->priv;
-		memset((void *) &eval, 0, sizeof(eval));
-		if ((ecmd.cmd == ETHTOOL_GRXCSUM) 
-		    && (bdp->params.b_params & PRM_XSUMRX))
-			eval.data = 1;
-		else
-			eval.data = 0;
-		rc = copy_to_user(ifr->ifr_data, &eval, sizeof(eval))
-			? -EFAULT : 0;
-		return rc;
-	}
-#endif
-#ifdef	ETHTOOL_SRXCSUM
-	case ETHTOOL_SRXCSUM:
-	case ETHTOOL_STXCSUM:
-	case ETHTOOL_SSG:
-	{	struct ethtool_value eval;
-		struct e100_private *bdp = dev->priv;
-		if (copy_from_user(&eval, ifr->ifr_data, sizeof(eval)))
-			return -EFAULT;
-		if (ecmd.cmd == ETHTOOL_SRXCSUM) {
-			if (eval.data == 1) { 
-				if (bdp->rev_id >= D101MA_REV_ID)
-					bdp->params.b_params |= PRM_XSUMRX;
-				else
-					return -EINVAL;
-			} else {
-				if (bdp->rev_id >= D101MA_REV_ID)
-					bdp->params.b_params &= ~PRM_XSUMRX;
-				else
-					return 0;
-			}
-		} else {
-			if (eval.data == 1)
-				return -EINVAL;
-			else
-				return 0;
-		}
-		if (netif_running(dev)) {
-			spin_lock_bh(&dev->xmit_lock);
-			e100_close(dev);
-			spin_unlock_bh(&dev->xmit_lock);
-			e100_hw_init(bdp);
-			e100_open(dev);
-		}
-		return 0;
-	}
-#endif
-	default:
-		break;
-	}			//switch
-	return rc;
-}
-
-static int
-e100_ethtool_get_settings(struct net_device *dev, struct ifreq *ifr)
-{
-	struct e100_private *bdp;
-	struct ethtool_cmd ecmd;
-	u16 advert = 0;
-
-	memset((void *) &ecmd, 0, sizeof (ecmd));
-
-	bdp = dev->priv;
-
-	ecmd.supported = bdp->speed_duplex_caps;
-
-	ecmd.port =
-		(bdp->speed_duplex_caps & SUPPORTED_TP) ? PORT_TP : PORT_FIBRE;
-	ecmd.transceiver = XCVR_INTERNAL;
-	ecmd.phy_address = bdp->phy_addr;
-
-	if (netif_carrier_ok(bdp->device)) {
-		ecmd.speed = bdp->cur_line_speed;
-		ecmd.duplex =
-			(bdp->cur_dplx_mode == HALF_DUPLEX) ? DUPLEX_HALF : DUPLEX_FULL;
-	}
-	else {
-		ecmd.speed = -1;
-		ecmd.duplex = -1;
-	}
-
-	ecmd.advertising = ADVERTISED_TP;
-
-	if (bdp->params.e100_speed_duplex == E100_AUTONEG) {
-		ecmd.autoneg = AUTONEG_ENABLE;
-		ecmd.advertising |= ADVERTISED_Autoneg;
-	} else {
-		ecmd.autoneg = AUTONEG_DISABLE;
-	}
-
-	if (bdp->speed_duplex_caps & SUPPORTED_MII) {
-		e100_mdi_read(bdp, MII_ADVERTISE, bdp->phy_addr, &advert);
-
-		if (advert & ADVERTISE_10HALF)
-			ecmd.advertising |= ADVERTISED_10baseT_Half;
-		if (advert & ADVERTISE_10FULL)
-			ecmd.advertising |= ADVERTISED_10baseT_Full;
-		if (advert & ADVERTISE_100HALF)
-			ecmd.advertising |= ADVERTISED_100baseT_Half;
-		if (advert & ADVERTISE_100FULL)
-			ecmd.advertising |= ADVERTISED_100baseT_Full;
-	} else {
-		ecmd.autoneg = AUTONEG_DISABLE;
-		ecmd.advertising &= ~ADVERTISED_Autoneg;
-	}
-
-	if (copy_to_user(ifr->ifr_data, &ecmd, sizeof (ecmd)))
-		return -EFAULT;
-
-	return 0;
-}
-
-static int
-e100_ethtool_set_settings(struct net_device *dev, struct ifreq *ifr)
-{
-	struct e100_private *bdp;
-	int e100_new_speed_duplex;
-	int ethtool_new_speed_duplex;
-	struct ethtool_cmd ecmd;
-
-	bdp = dev->priv;
-	if (copy_from_user(&ecmd, ifr->ifr_data, sizeof (ecmd))) {
-		return -EFAULT;
-	}
-
-	if ((ecmd.autoneg == AUTONEG_ENABLE)
-	    && (bdp->speed_duplex_caps & SUPPORTED_Autoneg)) {
-		bdp->params.e100_speed_duplex = E100_AUTONEG;
-		if (netif_running(dev)) {
-			spin_lock_bh(&dev->xmit_lock);
-			e100_close(dev);
-			spin_unlock_bh(&dev->xmit_lock);
-			e100_hw_init(bdp);
-			e100_open(dev);
-		}
-	} else {
-		if (ecmd.speed == SPEED_10) {
-			if (ecmd.duplex == DUPLEX_HALF) {
-				e100_new_speed_duplex =
-					E100_SPEED_10_HALF;
-				ethtool_new_speed_duplex =
-					SUPPORTED_10baseT_Half;
-			} else { 
-				e100_new_speed_duplex =
-					E100_SPEED_10_FULL;
-				ethtool_new_speed_duplex =
-					SUPPORTED_10baseT_Full;
-			} 
-		} else { 
-			if (ecmd.duplex == DUPLEX_HALF) {
-				e100_new_speed_duplex =
-					E100_SPEED_100_HALF;
-				ethtool_new_speed_duplex =
-					SUPPORTED_100baseT_Half;
-			} else { 
-				e100_new_speed_duplex =
-					E100_SPEED_100_FULL;
-				ethtool_new_speed_duplex =
-					SUPPORTED_100baseT_Full;
-			} 
-		}
-
-		if (bdp->speed_duplex_caps & ethtool_new_speed_duplex) {
-			bdp->params.e100_speed_duplex =
-				e100_new_speed_duplex;
-			if (netif_running(dev)) {
-				spin_lock_bh(&dev->xmit_lock);
-				e100_close(dev);
-				spin_unlock_bh(&dev->xmit_lock);
-				e100_hw_init(bdp);
-				e100_open(dev);
-			}
-		} else {
-			return -EOPNOTSUPP;
-		} 
-	}
-
-	return 0;
-}
-
-static int
-e100_ethtool_glink(struct net_device *dev, struct ifreq *ifr)
-{
-	struct e100_private *bdp;
-	struct ethtool_value info;
-
-	memset((void *) &info, 0, sizeof (info));
-
-	bdp = dev->priv;
-	info.cmd = ETHTOOL_GLINK;
-
-	/* Consider both PHY link and netif_running */
-	info.data = e100_update_link_state(bdp);
-
-	if (copy_to_user(ifr->ifr_data, &info, sizeof (info)))
-		return -EFAULT;
-
-	return 0;
-}
-
-static int
-e100_ethtool_test(struct net_device *dev, struct ifreq *ifr)
-{
-	struct ethtool_test *info;
-	int rc = -EFAULT;
-
-	info = kmalloc(sizeof(*info) + max_test_res * sizeof(u64),
-		       GFP_ATOMIC);
-
-	if (!info)
-		return -ENOMEM;
-
-	memset((void *) info, 0, sizeof(*info) +
-				 max_test_res * sizeof(u64));
-
-	if (copy_from_user(info, ifr->ifr_data, sizeof(*info)))
-		goto exit;
-
-	info->flags = e100_run_diag(dev, info->data, info->flags);
-
-	if (!copy_to_user(ifr->ifr_data, info,
-			 sizeof(*info) + max_test_res * sizeof(u64)))
-		rc = 0;
-exit:
-	kfree(info);
-	return rc;
-}
-
-static int
-e100_ethtool_gregs(struct net_device *dev, struct ifreq *ifr)
-{
-	struct e100_private *bdp;
-	u32 regs_buff[E100_REGS_LEN];
-	struct ethtool_regs regs = {ETHTOOL_GREGS};
-	void *addr = ifr->ifr_data;
-	u16 mdi_reg;
-
-	bdp = dev->priv;
-
-	if(copy_from_user(&regs, addr, sizeof(regs)))
-		return -EFAULT;
-
-	regs.version = (1 << 24) | bdp->rev_id;
-	regs_buff[0] = readb(&(bdp->scb->scb_cmd_hi)) << 24 |
-		readb(&(bdp->scb->scb_cmd_low)) << 16 |
-		readw(&(bdp->scb->scb_status));
-	e100_mdi_read(bdp, MII_NCONFIG, bdp->phy_addr, &mdi_reg);
-	regs_buff[1] = mdi_reg;
-
-	if(copy_to_user(addr, &regs, sizeof(regs)))
-		return -EFAULT;
-
-	addr += offsetof(struct ethtool_regs, data);
-	if(copy_to_user(addr, regs_buff, regs.len))
-		return -EFAULT;
-
-	return 0;
-}
-
-static int
-e100_ethtool_nway_rst(struct net_device *dev, struct ifreq *ifr)
-{
-	struct e100_private *bdp;
-
-	bdp = dev->priv;
-
-	if ((bdp->speed_duplex_caps & SUPPORTED_Autoneg) &&
-	    (bdp->params.e100_speed_duplex == E100_AUTONEG)) {
-		if (netif_running(dev)) {
-			spin_lock_bh(&dev->xmit_lock);
-			e100_close(dev);
-			spin_unlock_bh(&dev->xmit_lock);
-			e100_hw_init(bdp);
-			e100_open(dev);
-		}
-	} else {
-		return -EFAULT;
-	}
-	return 0;
-}
-
-static int
-e100_ethtool_get_drvinfo(struct net_device *dev, struct ifreq *ifr)
-{
-	struct e100_private *bdp;
-	struct ethtool_drvinfo info;
-
-	memset((void *) &info, 0, sizeof (info));
-
-	bdp = dev->priv;
-
-	strncpy(info.driver, e100_short_driver_name, sizeof (info.driver) - 1);
-	strncpy(info.version, e100_driver_version, sizeof (info.version) - 1);
-	strncpy(info.fw_version, "N/A",
-		sizeof (info.fw_version) - 1);
-	strncpy(info.bus_info, pci_name(bdp->pdev),
-		sizeof (info.bus_info) - 1);
-	info.n_stats = E100_STATS_LEN;
-	info.regdump_len  = E100_REGS_LEN * sizeof(u32);
-	info.eedump_len = (bdp->eeprom_size << 1);	
-	info.testinfo_len = max_test_res;
-	if (copy_to_user(ifr->ifr_data, &info, sizeof (info)))
-		return -EFAULT;
-
-	return 0;
-}
-
-static int
-e100_ethtool_eeprom(struct net_device *dev, struct ifreq *ifr)
-{
-	struct e100_private *bdp;
-	struct ethtool_eeprom ecmd;
-	u16 eeprom_data[256];
-	u16 *usr_eeprom_ptr;
-	u16 first_word, last_word;
-	int i, max_len;
-	void *ptr;
-	u8 *eeprom_data_bytes = (u8 *)eeprom_data;
-
-	bdp = dev->priv;
-
-	if (copy_from_user(&ecmd, ifr->ifr_data, sizeof (ecmd)))
-		return -EFAULT;
-
-	usr_eeprom_ptr =
-		(u16 *) (ifr->ifr_data + offsetof(struct ethtool_eeprom, data));
-
-        max_len = bdp->eeprom_size * 2;
-        
-        if (ecmd.offset > ecmd.offset + ecmd.len)
-        	return -EINVAL;
-        	
-	if ((ecmd.offset + ecmd.len) > max_len)
-		ecmd.len = (max_len - ecmd.offset);
-
-	first_word = ecmd.offset >> 1;
-	last_word = (ecmd.offset + ecmd.len - 1) >> 1;
-		
-	if (first_word >= bdp->eeprom_size)
-		return -EFAULT;
-
-	if (ecmd.cmd == ETHTOOL_GEEPROM) {
-        	for(i = 0; i <= (last_word - first_word); i++)
-			eeprom_data[i] = e100_eeprom_read(bdp, first_word + i);
-
-		ecmd.magic = E100_EEPROM_MAGIC;
-
-		if (copy_to_user(ifr->ifr_data, &ecmd, sizeof (ecmd)))
-			return -EFAULT;
-
-		if(ecmd.offset & 1)
-			eeprom_data_bytes++;
-		if (copy_to_user(usr_eeprom_ptr, eeprom_data_bytes, ecmd.len))
-			return -EFAULT;
-	} else {
-		if (ecmd.magic != E100_EEPROM_MAGIC)
-			return -EFAULT;
-
-		ptr = (void *)eeprom_data;
-        	if(ecmd.offset & 1) {
-                	/* need modification of first changed EEPROM word */
-                	/* only the second byte of the word is being modified */
-			eeprom_data[0] = e100_eeprom_read(bdp, first_word);
-                	ptr++;
-        	}
-        	if((ecmd.offset + ecmd.len) & 1) {
-	                /* need modification of last changed EEPROM word */
-	                /* only the first byte of the word is being modified */
-			eeprom_data[last_word - first_word] = 
-				e100_eeprom_read(bdp, last_word);
-		}
-        	if(copy_from_user(ptr, usr_eeprom_ptr, ecmd.len))
-	                return -EFAULT;
-
-		e100_eeprom_write_block(bdp, first_word, eeprom_data,
-					last_word - first_word + 1);
-
-		if (copy_to_user(ifr->ifr_data, &ecmd, sizeof (ecmd)))
-			return -EFAULT;
-	}
-	return 0;
-}
-
-#define E100_BLINK_INTERVAL	(HZ/4)
-/**
- * e100_led_control
- * @bdp: atapter's private data struct
- * @led_mdi_op: led operation
- *
- * Software control over adapter's led. The possible operations are:
- * TURN LED OFF, TURN LED ON and RETURN LED CONTROL TO HARDWARE.
- */
-static void
-e100_led_control(struct e100_private *bdp, u16 led_mdi_op)
-{
-	e100_mdi_write(bdp, PHY_82555_LED_SWITCH_CONTROL,
-		       bdp->phy_addr, led_mdi_op);
-
-}
-/**
- * e100_led_blink_callback
- * @data: pointer to atapter's private data struct
- *
- * Blink timer callback function. Toggles ON/OFF led status bit and calls
- * led hardware access function. 
- */
-static void
-e100_led_blink_callback(unsigned long data)
-{
-	struct e100_private *bdp = (struct e100_private *) data;
-
-	if(bdp->flags & LED_IS_ON) {
-		bdp->flags &= ~LED_IS_ON;
-		e100_led_control(bdp, PHY_82555_LED_OFF);
-	} else {
-		bdp->flags |= LED_IS_ON;
-		if (bdp->rev_id >= D101MA_REV_ID)
-			e100_led_control(bdp, PHY_82555_LED_ON_559);
-		else
-			e100_led_control(bdp, PHY_82555_LED_ON_PRE_559);
-	}
-
-	mod_timer(&bdp->blink_timer, jiffies + E100_BLINK_INTERVAL);
-}
-/**
- * e100_ethtool_led_blink
- * @dev: pointer to atapter's net_device struct
- * @ifr: pointer to ioctl request structure
- *
- * Blink led ioctl handler. Initialtes blink timer and sleeps until
- * blink period expires. Than it kills timer and returns. The led control
- * is returned back to hardware when blink timer is killed.
- */
-static int
-e100_ethtool_led_blink(struct net_device *dev, struct ifreq *ifr)
-{
-	struct e100_private *bdp;
-	struct ethtool_value ecmd;
-
-	bdp = dev->priv;
-
-	if (copy_from_user(&ecmd, ifr->ifr_data, sizeof (ecmd)))
-		return -EFAULT;
-
-	if(!bdp->blink_timer.function) {
-		init_timer(&bdp->blink_timer);
-		bdp->blink_timer.function = e100_led_blink_callback;
-		bdp->blink_timer.data = (unsigned long) bdp;
-	}
-
-	mod_timer(&bdp->blink_timer, jiffies);
-
-	set_current_state(TASK_INTERRUPTIBLE);
-
-	if ((!ecmd.data) || (ecmd.data > (u32)(MAX_SCHEDULE_TIMEOUT / HZ)))
-		ecmd.data = (u32)(MAX_SCHEDULE_TIMEOUT / HZ);
-
-	schedule_timeout(ecmd.data * HZ);
-
-	del_timer_sync(&bdp->blink_timer);
-
-	e100_led_control(bdp, PHY_82555_LED_NORMAL_CONTROL);
-
-	return 0;
-}
-
-static inline int
-e100_10BaseT_adapter(struct e100_private *bdp)
-{
-	return ((bdp->pdev->device == 0x1229) &&
-		(bdp->pdev->subsystem_vendor == 0x8086) &&
-		(bdp->pdev->subsystem_device == 0x0003));
-}
-
-static void
-e100_get_speed_duplex_caps(struct e100_private *bdp)
-{
-	u16 status;
-
-	e100_mdi_read(bdp, MII_BMSR, bdp->phy_addr, &status);
-
-	bdp->speed_duplex_caps = 0;
-
-	bdp->speed_duplex_caps |=
-		(status & BMSR_ANEGCAPABLE) ? SUPPORTED_Autoneg : 0;
-
-	bdp->speed_duplex_caps |=
-		(status & BMSR_10HALF) ? SUPPORTED_10baseT_Half : 0;
-
-	bdp->speed_duplex_caps |=
-		(status & BMSR_10FULL) ? SUPPORTED_10baseT_Full : 0;
-
-	bdp->speed_duplex_caps |=
-		(status & BMSR_100HALF) ? SUPPORTED_100baseT_Half : 0;
-
-	bdp->speed_duplex_caps |=
-		(status & BMSR_100FULL) ? SUPPORTED_100baseT_Full : 0;
-
-	if (IS_NC3133(bdp))
-		bdp->speed_duplex_caps =
-			(SUPPORTED_FIBRE | SUPPORTED_100baseT_Full);
-	else
-		bdp->speed_duplex_caps |= SUPPORTED_TP;
-
-	if ((status == 0xFFFF) && e100_10BaseT_adapter(bdp)) {
-		bdp->speed_duplex_caps =
-			(SUPPORTED_10baseT_Half | SUPPORTED_TP);
-	} else {
-		bdp->speed_duplex_caps |= SUPPORTED_MII;
-	}
-
-}
-
-#ifdef CONFIG_PM
-static unsigned char
-e100_setup_filter(struct e100_private *bdp)
-{
-	cb_header_t *ntcb_hdr;
-	unsigned char res = false;
-	nxmit_cb_entry_t *cmd;
-
-	if ((cmd = e100_alloc_non_tx_cmd(bdp)) == NULL) {
-		goto exit;
-	}
-
-	ntcb_hdr = (cb_header_t *) cmd->non_tx_cmd;
-	ntcb_hdr->cb_cmd = __constant_cpu_to_le16(CB_LOAD_FILTER);
-
-	/* Set EL and FIX bit */
-	(cmd->non_tx_cmd)->ntcb.filter.filter_data[0] =
-		__constant_cpu_to_le32(CB_FILTER_EL | CB_FILTER_FIX);
-
-	if (bdp->wolopts & WAKE_UCAST) {
-		(cmd->non_tx_cmd)->ntcb.filter.filter_data[0] |=
-			__constant_cpu_to_le32(CB_FILTER_IA_MATCH);
-	}
-
-	if (bdp->wolopts & WAKE_ARP) {
-		/* Setup ARP bit and lower IP parts */
-		/* bdp->ip_lbytes contains 2 lower bytes of IP address in network byte order */
-		(cmd->non_tx_cmd)->ntcb.filter.filter_data[0] |=
-			cpu_to_le32(CB_FILTER_ARP | bdp->ip_lbytes);
-	}
-
-	res = e100_exec_non_cu_cmd(bdp, cmd);
-	if (!res)
-		printk(KERN_WARNING "e100: %s: Filter setup failed\n",
-		       bdp->device->name);
-
-exit:
-	return res;
-
-}
-
-static void
-e100_do_wol(struct pci_dev *pcid, struct e100_private *bdp)
-{
-	e100_config_wol(bdp);
-
-	if (e100_config(bdp)) {
-		if (bdp->wolopts & (WAKE_UCAST | WAKE_ARP))
-			if (!e100_setup_filter(bdp))
-				printk(KERN_ERR
-				       "e100: WOL options failed\n");
-	} else {
-		printk(KERN_ERR "e100: config WOL failed\n");
-	}
-}
-#endif
-
-static u16
-e100_get_ip_lbytes(struct net_device *dev)
-{
-	struct in_ifaddr *ifa;
-	struct in_device *in_dev;
-	u32 res = 0;
-
-	in_dev = (struct in_device *) dev->ip_ptr;
-	/* Check if any in_device bound to interface */
-	if (in_dev) {
-		/* Check if any IP address is bound to interface */
-		if ((ifa = in_dev->ifa_list) != NULL) {
-			res = __constant_ntohl(ifa->ifa_address);
-			res = __constant_htons(res & 0x0000ffff);
-		}
-	}
-	return res;
-}
-
-static int
-e100_ethtool_wol(struct net_device *dev, struct ifreq *ifr)
-{
-	struct e100_private *bdp;
-	struct ethtool_wolinfo wolinfo;
-	int res = 0;
-
-	bdp = dev->priv;
-
-	if (copy_from_user(&wolinfo, ifr->ifr_data, sizeof (wolinfo))) {
-		return -EFAULT;
-	}
-
-	switch (wolinfo.cmd) {
-	case ETHTOOL_GWOL:
-		wolinfo.supported = bdp->wolsupported;
-		wolinfo.wolopts = bdp->wolopts;
-		if (copy_to_user(ifr->ifr_data, &wolinfo, sizeof (wolinfo)))
-			res = -EFAULT;
-		break;
-	case ETHTOOL_SWOL:
-		/* If ALL requests are supported or request is DISABLE wol */
-		if (((wolinfo.wolopts & bdp->wolsupported) == wolinfo.wolopts)
-		    || (wolinfo.wolopts == 0)) {
-			bdp->wolopts = wolinfo.wolopts;
-		} else {
-			res = -EOPNOTSUPP;
-		}
-		if (wolinfo.wolopts & WAKE_ARP)
-			bdp->ip_lbytes = e100_get_ip_lbytes(dev);
-		break;
-	default:
-		break;
-	}
-	return res;
-}
-
-static int e100_ethtool_gstrings(struct net_device *dev, struct ifreq *ifr)
-{
-	struct ethtool_gstrings info;
-	char *strings = NULL;
-	char *usr_strings;
-	int i;
-
-	memset((void *) &info, 0, sizeof(info));
-
-	usr_strings = (u8 *) (ifr->ifr_data + 
-			      offsetof(struct ethtool_gstrings, data));
-
-	if (copy_from_user(&info, ifr->ifr_data, sizeof (info)))
-		return -EFAULT;
-
-	switch (info.string_set) {
-	case ETH_SS_TEST: {
-		int ret = 0;
-		if (info.len > max_test_res)
-			info.len = max_test_res;
-		strings = kmalloc(info.len * ETH_GSTRING_LEN, GFP_ATOMIC);
-		if (!strings)
-			return -ENOMEM;
-		memset(strings, 0, info.len * ETH_GSTRING_LEN);
-
-		for (i = 0; i < info.len; i++) {
-			sprintf(strings + i * ETH_GSTRING_LEN, "%s",
-				test_strings[i]);
-		}
-		if (copy_to_user(ifr->ifr_data, &info, sizeof (info)))
-			ret = -EFAULT;
-		if (copy_to_user(usr_strings, strings, info.len * ETH_GSTRING_LEN))
-			ret = -EFAULT;
-		kfree(strings);
-		return ret;
-	}
-	case ETH_SS_STATS: {
-		char *strings = NULL;
-		void *addr = ifr->ifr_data;
-		info.len = E100_STATS_LEN;
-		strings = *e100_gstrings_stats;
-		if(copy_to_user(ifr->ifr_data, &info, sizeof(info)))
-			return -EFAULT;
-		addr += offsetof(struct ethtool_gstrings, data);
-		if(copy_to_user(addr, strings,
-		   info.len * ETH_GSTRING_LEN))
-			return -EFAULT;
-		return 0;
-	}
-	default:
-		return -EOPNOTSUPP;
-	}
-}
-
-static int
-e100_mii_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
-{
-	struct e100_private *bdp;
-	struct mii_ioctl_data *data_ptr =
-		(struct mii_ioctl_data *) &(ifr->ifr_data);
-
-	bdp = dev->priv;
-
-	switch (cmd) {
-	case SIOCGMIIPHY:
-		data_ptr->phy_id = bdp->phy_addr & 0x1f;
-		break;
-
-	case SIOCGMIIREG:
-		if (!capable(CAP_NET_ADMIN))
-			return -EPERM;
-		e100_mdi_read(bdp, data_ptr->reg_num & 0x1f, bdp->phy_addr,
-			      &(data_ptr->val_out));
-		break;
-
-	case SIOCSMIIREG:
-		if (!capable(CAP_NET_ADMIN))
-			return -EPERM;
-		/* If reg = 0 && change speed/duplex */
-		if (data_ptr->reg_num == 0 && 
-			(data_ptr->val_in == (BMCR_ANENABLE | BMCR_ANRESTART) /* restart cmd */
-			|| data_ptr->val_in == (BMCR_RESET) /* reset cmd */ 
-			|| data_ptr->val_in & (BMCR_SPEED100 | BMCR_FULLDPLX) 
-			|| data_ptr->val_in == 0)) {
-				if (data_ptr->val_in == (BMCR_ANENABLE | BMCR_ANRESTART)
-					|| data_ptr->val_in == (BMCR_RESET))
-					bdp->params.e100_speed_duplex = E100_AUTONEG;
-				else if (data_ptr->val_in == (BMCR_SPEED100 | BMCR_FULLDPLX))
-					bdp->params.e100_speed_duplex = E100_SPEED_100_FULL;
-				else if (data_ptr->val_in == (BMCR_SPEED100))
-					bdp->params.e100_speed_duplex = E100_SPEED_100_HALF;
-				else if (data_ptr->val_in == (BMCR_FULLDPLX))
-					bdp->params.e100_speed_duplex = E100_SPEED_10_FULL;
-				else
-					bdp->params.e100_speed_duplex = E100_SPEED_10_HALF;
-				if (netif_running(dev)) {
-					spin_lock_bh(&dev->xmit_lock);
-					e100_close(dev);
-					spin_unlock_bh(&dev->xmit_lock);
-					e100_hw_init(bdp);
-					e100_open(dev);
-				}
-		}
-		else 
-			/* Only allows changing speed/duplex */
-			return -EINVAL;
-		
-		break;
-
-	default:
-		return -EOPNOTSUPP;
-	}
-	return 0;
-}
-
-nxmit_cb_entry_t *
-e100_alloc_non_tx_cmd(struct e100_private *bdp)
-{
-	nxmit_cb_entry_t *non_tx_cmd_elem;
-
-	if (!(non_tx_cmd_elem = (nxmit_cb_entry_t *)
-	      kmalloc(sizeof (nxmit_cb_entry_t), GFP_ATOMIC))) {
-		return NULL;
-	}
-	non_tx_cmd_elem->non_tx_cmd =
-		pci_alloc_consistent(bdp->pdev, sizeof (nxmit_cb_t),
-				     &(non_tx_cmd_elem->dma_addr));
-	if (non_tx_cmd_elem->non_tx_cmd == NULL) {
-		kfree(non_tx_cmd_elem);
-		return NULL;
-	}
-	return non_tx_cmd_elem;
-}
-
-void
-e100_free_non_tx_cmd(struct e100_private *bdp,
-		     nxmit_cb_entry_t *non_tx_cmd_elem)
-{
-	pci_free_consistent(bdp->pdev, sizeof (nxmit_cb_t),
-			    non_tx_cmd_elem->non_tx_cmd,
-			    non_tx_cmd_elem->dma_addr);
-	kfree(non_tx_cmd_elem);
-}
-
-static void
-e100_free_nontx_list(struct e100_private *bdp)
-{
-	nxmit_cb_entry_t *command;
-	int i;
-
-	while (!list_empty(&bdp->non_tx_cmd_list)) {
-		command = list_entry(bdp->non_tx_cmd_list.next,
-				     nxmit_cb_entry_t, list_elem);
-		list_del(&(command->list_elem));
-		e100_free_non_tx_cmd(bdp, command);
-	}
-
-	for (i = 0; i < CB_MAX_NONTX_CMD; i++) {
-		bdp->same_cmd_entry[i] = NULL;
-	}
-}
-
-static unsigned char
-e100_delayed_exec_non_cu_cmd(struct e100_private *bdp,
-			     nxmit_cb_entry_t *command)
-{
-	nxmit_cb_entry_t *same_command;
-	cb_header_t *ntcb_hdr;
-	u16 cmd;
-
-	ntcb_hdr = (cb_header_t *) command->non_tx_cmd;
-
-	cmd = CB_CMD_MASK & le16_to_cpu(ntcb_hdr->cb_cmd);
-
-	spin_lock_bh(&(bdp->bd_non_tx_lock));
-
-	same_command = bdp->same_cmd_entry[cmd];
-
-	if (same_command != NULL) {
-		memcpy((void *) (same_command->non_tx_cmd),
-		       (void *) (command->non_tx_cmd), sizeof (nxmit_cb_t));
-		e100_free_non_tx_cmd(bdp, command);
-	} else {
-		list_add_tail(&(command->list_elem), &(bdp->non_tx_cmd_list));
-		bdp->same_cmd_entry[cmd] = command;
-	}
-
-	if (bdp->non_tx_command_state == E100_NON_TX_IDLE) {
-		bdp->non_tx_command_state = E100_WAIT_TX_FINISH;
-		mod_timer(&(bdp->nontx_timer_id), jiffies + 1);
-	}
-
-	spin_unlock_bh(&(bdp->bd_non_tx_lock));
-	return true;
-}
-
-static void
-e100_non_tx_background(unsigned long ptr)
-{
-	struct e100_private *bdp = (struct e100_private *) ptr;
-	nxmit_cb_entry_t *active_command;
-	int restart = true;
-	cb_header_t *non_tx_cmd;
-	u8 sub_cmd;
-
-	spin_lock_bh(&(bdp->bd_non_tx_lock));
-
-	switch (bdp->non_tx_command_state) {
-	case E100_WAIT_TX_FINISH:
-		if (bdp->last_tcb != NULL) {
-			rmb();
-			if ((bdp->last_tcb->tcb_hdr.cb_status &
-			     __constant_cpu_to_le16(CB_STATUS_COMPLETE)) == 0)
-				goto exit;
-		}
-		if ((readw(&bdp->scb->scb_status) & SCB_CUS_MASK) ==
-		    SCB_CUS_ACTIVE) {
-			goto exit;
-		}
-		break;
-
-	case E100_WAIT_NON_TX_FINISH:
-		active_command = list_entry(bdp->non_tx_cmd_list.next,
-					    nxmit_cb_entry_t, list_elem);
-		rmb();
-
-		if (((((cb_header_t *) (active_command->non_tx_cmd))->cb_status
-		      & __constant_cpu_to_le16(CB_STATUS_COMPLETE)) == 0)
-		    && time_before(jiffies, active_command->expiration_time)) {
-			goto exit;
-		} else {
-			non_tx_cmd = (cb_header_t *) active_command->non_tx_cmd;
-			sub_cmd = CB_CMD_MASK & le16_to_cpu(non_tx_cmd->cb_cmd);
-#ifdef E100_CU_DEBUG			
-			if (!(non_tx_cmd->cb_status 
-			    & __constant_cpu_to_le16(CB_STATUS_COMPLETE)))
-				printk(KERN_ERR "e100: %s: Queued "
-					"command (%x) timeout\n", 
-					bdp->device->name, sub_cmd);
-#endif			
-			list_del(&(active_command->list_elem));
-			e100_free_non_tx_cmd(bdp, active_command);
-		}
-		break;
-
-	default:
-		break;
-	}			//switch
-
-	if (list_empty(&bdp->non_tx_cmd_list)) {
-		bdp->non_tx_command_state = E100_NON_TX_IDLE;
-		spin_lock_irq(&(bdp->bd_lock));
-		bdp->next_cu_cmd = START_WAIT;
-		spin_unlock_irq(&(bdp->bd_lock));
-		restart = false;
-		goto exit;
-	} else {
-		u16 cmd_type;
-
-		bdp->non_tx_command_state = E100_WAIT_NON_TX_FINISH;
-		active_command = list_entry(bdp->non_tx_cmd_list.next,
-					    nxmit_cb_entry_t, list_elem);
-		sub_cmd = ((cb_header_t *) active_command->non_tx_cmd)->cb_cmd;
-		spin_lock_irq(&(bdp->bd_lock));
-		e100_wait_exec_cmplx(bdp, active_command->dma_addr,
-				     SCB_CUC_START, sub_cmd);
-		spin_unlock_irq(&(bdp->bd_lock));
-		active_command->expiration_time = jiffies + HZ;
-		cmd_type = CB_CMD_MASK &
-			le16_to_cpu(((cb_header_t *)
-				     (active_command->non_tx_cmd))->cb_cmd);
-		bdp->same_cmd_entry[cmd_type] = NULL;
-	}
-
-exit:
-	if (restart) {
-		mod_timer(&(bdp->nontx_timer_id), jiffies + 1);
-	} else {
-		if (netif_running(bdp->device))
-			netif_wake_queue(bdp->device);
-	}
-	spin_unlock_bh(&(bdp->bd_non_tx_lock));
-}
-
-static void
-e100_vlan_rx_register(struct net_device *netdev, struct vlan_group *grp)
-{
-	struct e100_private *bdp = netdev->priv;
-
-	e100_disable_clear_intr(bdp);
-	bdp->vlgrp = grp;
-
-	if(grp) {
-		/* enable VLAN tag insert/strip */
-		e100_config_vlan_drop(bdp, true);
-
-	} else {
-		/* disable VLAN tag insert/strip */
-		e100_config_vlan_drop(bdp, false);
-	}
-
-	e100_config(bdp);
-	e100_set_intr_mask(bdp);
-}
-
-static void
-e100_vlan_rx_add_vid(struct net_device *netdev, u16 vid)
-{
-	/* We don't do Vlan filtering */
-	return;
-}
-
-static void
-e100_vlan_rx_kill_vid(struct net_device *netdev, u16 vid)
-{
-	struct e100_private *bdp = netdev->priv;
-
-	if(bdp->vlgrp)
-		bdp->vlgrp->vlan_devices[vid] = NULL;
-	/* We don't do Vlan filtering */
-	return;
-}
-
-#ifdef CONFIG_PM
-static int
-e100_notify_reboot(struct notifier_block *nb, unsigned long event, void *p)
-{
-        struct pci_dev *pdev = NULL;
-	
-        switch(event) {
-        case SYS_DOWN:
-        case SYS_HALT:
-        case SYS_POWER_OFF:
-		while ((pdev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, pdev)) != NULL) {
-                        if(pci_dev_driver(pdev) == &e100_driver) {
-				/* If net_device struct is allocated? */
-                                if (pci_get_drvdata(pdev))
-					e100_suspend(pdev, 3);
-
-			}
-		}
-        }
-        return NOTIFY_DONE;
-}
-
-static int
-e100_suspend(struct pci_dev *pcid, u32 state)
-{
-	struct net_device *netdev = pci_get_drvdata(pcid);
-	struct e100_private *bdp = netdev->priv;
-
-	e100_isolate_driver(bdp);
-	pci_save_state(pcid, bdp->pci_state);
-
-	/* Enable or disable WoL */
-	e100_do_wol(pcid, bdp);
-	
-	/* If wol is enabled */
-	if (bdp->wolopts || e100_asf_enabled(bdp)) {
-		pci_enable_wake(pcid, 3, 1);	/* Enable PME for power state D3 */
-		pci_set_power_state(pcid, 3);	/* Set power state to D3.        */
-	} else {
-		/* Disable bus mastering */
-		pci_disable_device(pcid);
-		pci_set_power_state(pcid, state);
-	}
-	return 0;
-}
-
-static int
-e100_resume(struct pci_dev *pcid)
-{
-	struct net_device *netdev = pci_get_drvdata(pcid);
-	struct e100_private *bdp = netdev->priv;
-
-	pci_set_power_state(pcid, 0);
-	pci_enable_wake(pcid, 0, 0);	/* Clear PME status and disable PME */
-	pci_restore_state(pcid, bdp->pci_state);
-
-	/* Also do device full reset because device was in D3 state */
-	e100_deisolate_driver(bdp, true);
-
-	return 0;
-}
-
-/**
- * e100_asf_enabled - checks if ASF is configured on the current adaper
- *                    by reading registers 0xD and 0x90 in the EEPROM 
- * @bdp: atapter's private data struct
- *
- * Returns: true if ASF is enabled
- */
-static unsigned char
-e100_asf_enabled(struct e100_private *bdp)
-{
-	u16 asf_reg;
-	u16 smbus_addr_reg;
-	if ((bdp->pdev->device >= 0x1050) && (bdp->pdev->device <= 0x1055)) {
-		asf_reg = e100_eeprom_read(bdp, EEPROM_CONFIG_ASF);
-		if ((asf_reg & EEPROM_FLAG_ASF)
-		    && !(asf_reg & EEPROM_FLAG_GCL)) {
-			smbus_addr_reg = 
-				e100_eeprom_read(bdp, EEPROM_SMBUS_ADDR);
-			if ((smbus_addr_reg & 0xFF) != 0xFE) 
-				return true;
-		}
-	}
-	return false;
-}
-#endif /* CONFIG_PM */
-
-#ifdef E100_CU_DEBUG
-unsigned char
-e100_cu_unknown_state(struct e100_private *bdp)
-{
-	u8 scb_cmd_low;
-	u16 scb_status;
-	scb_cmd_low = bdp->scb->scb_cmd_low;
-	scb_status = le16_to_cpu(bdp->scb->scb_status);
-	/* If CU is active and executing unknown cmd */
-	if (scb_status & SCB_CUS_ACTIVE && scb_cmd_low & SCB_CUC_UNKNOWN)
-		return true;
-	else
-		return false;
-}
-#endif
-
--- diff/drivers/net/e100/e100_phy.c	2004-01-19 10:22:57.000000000 +0000
+++ source/drivers/net/e100/e100_phy.c	1970-01-01 01:00:00.000000000 +0100
@@ -1,1163 +0,0 @@
-/*******************************************************************************
-
-  
-  Copyright(c) 1999 - 2003 Intel Corporation. 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.
-  
-  The full GNU General Public License is included in this distribution in the
-  file called LICENSE.
-  
-  Contact Information:
-  Linux NICS <linux.nics@intel.com>
-  Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
-*******************************************************************************/
-
-#include "e100_phy.h"
-
-void e100_handle_zlock(struct e100_private *bdp);
-
-/* 
- * Procedure:	e100_mdi_write
- *
- * Description: This routine will write a value to the specified MII register
- *		of an external MDI compliant device (e.g. PHY 100).  The
- *		command will execute in polled mode.
- *
- * Arguments:
- *	bdp - Ptr to this card's e100_bdconfig structure
- *	reg_addr - The MII register that we are writing to
- *	phy_addr - The MDI address of the Phy component.
- *	data - The value that we are writing to the MII register.
- *
- * Returns:
- *	NOTHING
- */
-int
-e100_mdi_write(struct e100_private *bdp, u32 reg_addr, u32 phy_addr, u16 data)
-{
-	int e100_retry;
-	u32 temp_val;
-	unsigned int mdi_cntrl;
-
-	spin_lock_bh(&bdp->mdi_access_lock);
-	temp_val = (((u32) data) | (reg_addr << 16) |
-		    (phy_addr << 21) | (MDI_WRITE << 26));
-	writel(temp_val, &bdp->scb->scb_mdi_cntrl);
-	readw(&bdp->scb->scb_status);
-
-	/* wait 20usec before checking status */
-	udelay(20);
-
-	/* poll for the mdi write to complete */
-	e100_retry = E100_CMD_WAIT;
-	while ((!((mdi_cntrl = readl(&bdp->scb->scb_mdi_cntrl)) & MDI_PHY_READY)) && (e100_retry)) {
-
-		udelay(20);
-		e100_retry--;
-	}
-	spin_unlock_bh(&bdp->mdi_access_lock);
-	if (mdi_cntrl & MDI_PHY_READY) 
-		return 0;
-	else {
-		printk(KERN_ERR "e100: MDI write timeout\n");
-		return 1;
-	}
-}
-
-/* 
- * Procedure:	e100_mdi_read
- *
- * Description: This routine will read a value from the specified MII register
- *		of an external MDI compliant device (e.g. PHY 100), and return
- *		it to the calling routine.  The command will execute in polled
- *		mode.
- *
- * Arguments:
- *	bdp - Ptr to this card's e100_bdconfig structure
- *	reg_addr - The MII register that we are reading from
- *	phy_addr - The MDI address of the Phy component.
- *
- * Results:
- *	data - The value that we read from the MII register.
- *
- * Returns:
- *	NOTHING
- */
-int
-e100_mdi_read(struct e100_private *bdp, u32 reg_addr, u32 phy_addr, u16 *data)
-{
-	int e100_retry;
-	u32 temp_val;
-	unsigned int mdi_cntrl;
-
-	spin_lock_bh(&bdp->mdi_access_lock);
-	/* Issue the read command to the MDI control register. */
-	temp_val = ((reg_addr << 16) | (phy_addr << 21) | (MDI_READ << 26));
-	writel(temp_val, &bdp->scb->scb_mdi_cntrl);
-	readw(&bdp->scb->scb_status);
-
-	/* wait 20usec before checking status */
-	udelay(20);
-
-	/* poll for the mdi read to complete */
-	e100_retry = E100_CMD_WAIT;
-	while ((!((mdi_cntrl = readl(&bdp->scb->scb_mdi_cntrl)) & MDI_PHY_READY)) && (e100_retry)) {
-
-		udelay(20);
-		e100_retry--;
-	}
-
-	spin_unlock_bh(&bdp->mdi_access_lock);
-	if (mdi_cntrl & MDI_PHY_READY) {
-		/* return the lower word */
-		*data = (u16) mdi_cntrl;
-		return 0;
-	}
-	else {
-		printk(KERN_ERR "e100: MDI read timeout\n");
-		return 1;
-	}
-}
-
-static unsigned char
-e100_phy_valid(struct e100_private *bdp, unsigned int phy_address)
-{
-	u16 ctrl_reg, stat_reg;
-
-	/* Read the MDI control register */
-	e100_mdi_read(bdp, MII_BMCR, phy_address, &ctrl_reg);
-
-	/* Read the status register twice, bacause of sticky bits */
-	e100_mdi_read(bdp, MII_BMSR, phy_address, &stat_reg);
-	e100_mdi_read(bdp, MII_BMSR, phy_address, &stat_reg);
-
-	if ((ctrl_reg == 0xffff) || ((stat_reg == 0) && (ctrl_reg == 0)))
-		return false;
-
-	return true;
-}
-
-static void
-e100_phy_address_detect(struct e100_private *bdp)
-{
-	unsigned int addr;
-	unsigned char valid_phy_found = false;
-
-	if (IS_NC3133(bdp)) {
-		bdp->phy_addr = 0;
-		return;
-	}
-
-	if (e100_phy_valid(bdp, PHY_DEFAULT_ADDRESS)) {
-		bdp->phy_addr = PHY_DEFAULT_ADDRESS;
-		valid_phy_found = true;
-
-	} else {
-		for (addr = MIN_PHY_ADDR; addr <= MAX_PHY_ADDR; addr++) {
-			if (e100_phy_valid(bdp, addr)) {
-				bdp->phy_addr = addr;
-				valid_phy_found = true;
-				break;
-			}
-		}
-	}
-
-	if (!valid_phy_found) {
-		bdp->phy_addr = PHY_ADDRESS_503;
-	}
-}
-
-static void
-e100_phy_id_detect(struct e100_private *bdp)
-{
-	u16 low_id_reg, high_id_reg;
-
-	if (bdp->phy_addr == PHY_ADDRESS_503) {
-		bdp->PhyId = PHY_503;
-		return;
-	}
-	if (!(bdp->flags & IS_ICH)) {
-		if (bdp->rev_id >= D102_REV_ID) {
-			bdp->PhyId = PHY_82562ET;
-			return;
-		}
-	}
-
-	/* Read phy id from the MII register */
-	e100_mdi_read(bdp, MII_PHYSID1, bdp->phy_addr, &low_id_reg);
-	e100_mdi_read(bdp, MII_PHYSID2, bdp->phy_addr, &high_id_reg);
-
-	bdp->PhyId = ((unsigned int) low_id_reg |
-		      ((unsigned int) high_id_reg << 16));
-}
-
-static void
-e100_phy_isolate(struct e100_private *bdp)
-{
-	unsigned int phy_address;
-	u16 ctrl_reg;
-
-	/* Go over all phy addresses. Deisolate the selected one, and isolate
-	 * all the rest */
-	for (phy_address = 0; phy_address <= MAX_PHY_ADDR; phy_address++) {
-		if (phy_address != bdp->phy_addr) {
-			e100_mdi_write(bdp, MII_BMCR, phy_address,
-				       BMCR_ISOLATE);
-
-		} else {
-			e100_mdi_read(bdp, MII_BMCR, bdp->phy_addr, &ctrl_reg);
-			ctrl_reg &= ~BMCR_ISOLATE;
-			e100_mdi_write(bdp, MII_BMCR, bdp->phy_addr, ctrl_reg);
-		}
-
-		udelay(100);
-	}
-}
-
-static unsigned char
-e100_phy_specific_setup(struct e100_private *bdp)
-{
-	u16 misc_reg;
-
-	if (bdp->phy_addr == PHY_ADDRESS_503) {
-		switch (bdp->params.e100_speed_duplex) {
-		case E100_AUTONEG:
-			/* The adapter can't autoneg. so set to 10/HALF */
-			printk(KERN_INFO
-			       "e100: 503 serial component detected which "
-			       "cannot autonegotiate\n");
-			printk(KERN_INFO
-			       "e100: speed/duplex forced to "
-			       "10Mbps / Half duplex\n");
-			bdp->params.e100_speed_duplex = E100_SPEED_10_HALF;
-			break;
-
-		case E100_SPEED_100_HALF:
-		case E100_SPEED_100_FULL:
-			printk(KERN_ERR
-			       "e100: 503 serial component detected "
-			       "which does not support 100Mbps\n");
-			printk(KERN_ERR
-			       "e100: Change the forced speed/duplex "
-			       "to a supported setting\n");
-			return false;
-		}
-
-		return true;
-	}
-
-	if (IS_NC3133(bdp)) {
-		u16 int_reg;
-
-		/* enable 100BASE fiber interface */
-		e100_mdi_write(bdp, MDI_NC3133_CONFIG_REG, bdp->phy_addr,
-			       MDI_NC3133_100FX_ENABLE);
-
-		if ((bdp->params.e100_speed_duplex != E100_AUTONEG) &&
-		    (bdp->params.e100_speed_duplex != E100_SPEED_100_FULL)) {
-			/* just inform user about 100 full */
-			printk(KERN_ERR "e100: NC3133 NIC can only run "
-			       "at 100Mbps full duplex\n");
-		}
-
-		bdp->params.e100_speed_duplex = E100_SPEED_100_FULL;
-
-		/* enable interrupts */
-		e100_mdi_read(bdp, MDI_NC3133_INT_ENABLE_REG,
-			      bdp->phy_addr, &int_reg);
-		int_reg |= MDI_NC3133_INT_ENABLE;
-		e100_mdi_write(bdp, MDI_NC3133_INT_ENABLE_REG,
-			       bdp->phy_addr, int_reg);
-	}
-
-	/* Handle the National TX */
-	if ((bdp->PhyId & PHY_MODEL_REV_ID_MASK) == PHY_NSC_TX) {
-		e100_mdi_read(bdp, NSC_CONG_CONTROL_REG,
-			      bdp->phy_addr, &misc_reg);
-
-		misc_reg |= NSC_TX_CONG_TXREADY;
-
-		/* disable the congestion control bit in the National Phy */
-		misc_reg &= ~NSC_TX_CONG_ENABLE;
-
-		e100_mdi_write(bdp, NSC_CONG_CONTROL_REG,
-			       bdp->phy_addr, misc_reg);
-	}
-
-	return true;
-}
-
-/* 
- * Procedure:	e100_phy_fix_squelch
- *
- * Description:
- *	Help find link on certain rare scenarios.
- *	NOTE: This routine must be called once per watchdog,
- *	      and *after* setting the current link state.
- *
- * Arguments:
- *	bdp - Ptr to this card's e100_bdconfig structure
- *
- * Returns:
- *	NOTHING
- */
-static void
-e100_phy_fix_squelch(struct e100_private *bdp)
-{
-	if ((bdp->PhyId != PHY_82555_TX) || (bdp->flags & DF_SPEED_FORCED))
-		return;
-
-	if (netif_carrier_ok(bdp->device)) {
-		switch (bdp->PhyState) {
-		case 0:
-			break;
-		case 1:
-			e100_mdi_write(bdp, PHY_82555_SPECIAL_CONTROL,
-				       bdp->phy_addr, 0x0000);
-			break;
-		case 2:
-			e100_mdi_write(bdp, PHY_82555_MDI_EQUALIZER_CSR,
-				       bdp->phy_addr, 0x3000);
-			break;
-		}
-		bdp->PhyState = 0;
-		bdp->PhyDelay = 0;
-
-	} else if (!bdp->PhyDelay--) {
-		switch (bdp->PhyState) {
-		case 0:
-			e100_mdi_write(bdp, PHY_82555_SPECIAL_CONTROL,
-				       bdp->phy_addr, EXTENDED_SQUELCH_BIT);
-			bdp->PhyState = 1;
-			break;
-		case 1:
-			e100_mdi_write(bdp, PHY_82555_SPECIAL_CONTROL,
-				       bdp->phy_addr, 0x0000);
-			e100_mdi_write(bdp, PHY_82555_MDI_EQUALIZER_CSR,
-				       bdp->phy_addr, 0x2010);
-			bdp->PhyState = 2;
-			break;
-		case 2:
-			e100_mdi_write(bdp, PHY_82555_MDI_EQUALIZER_CSR,
-				       bdp->phy_addr, 0x3000);
-			bdp->PhyState = 0;
-			break;
-		}
-
-		e100_mdi_write(bdp, MII_BMCR, bdp->phy_addr,
-			       BMCR_ANENABLE | BMCR_ANRESTART);
-		bdp->PhyDelay = 3;
-	}
-}
-
-/* 
- * Procedure:	e100_fix_polarity
- *
- * Description:
- *	Fix for 82555 auto-polarity toggle problem. With a short cable 
- *	connecting an 82555 with an 840A link partner, if the medium is noisy,
- *	the 82555 sometime thinks that the polarity might be wrong and so 
- *	toggles polarity. This happens repeatedly and results in a high bit 
- *	error rate.
- *	NOTE: This happens only at 10 Mbps
- *
- * Arguments:
- *	bdp - Ptr to this card's e100_bdconfig structure
- *
- * Returns:
- *	NOTHING
- */
-static void
-e100_fix_polarity(struct e100_private *bdp)
-{
-	u16 status;
-	u16 errors;
-	u16 misc_reg;
-	int speed;
-
-	if ((bdp->PhyId != PHY_82555_TX) && (bdp->PhyId != PHY_82562ET) &&
-	    (bdp->PhyId != PHY_82562EM))
-		return;
-
-	/* If the user wants auto-polarity disabled, do only that and nothing *
-	 * else. * e100_autopolarity == 0 means disable --- we do just the
-	 * disabling * e100_autopolarity == 1 means enable  --- we do nothing at
-	 * all * e100_autopolarity >= 2 means we do the workaround code. */
-	/* Change for 82558 enhancement */
-	switch (E100_AUTOPOLARITY) {
-	case 0:
-		e100_mdi_read(bdp, PHY_82555_SPECIAL_CONTROL,
-			      bdp->phy_addr, &misc_reg);
-		e100_mdi_write(bdp, PHY_82555_SPECIAL_CONTROL, bdp->phy_addr,
-			       (u16) (misc_reg | DISABLE_AUTO_POLARITY));
-		break;
-
-	case 1:
-		e100_mdi_read(bdp, PHY_82555_SPECIAL_CONTROL,
-			      bdp->phy_addr, &misc_reg);
-		e100_mdi_write(bdp, PHY_82555_SPECIAL_CONTROL, bdp->phy_addr,
-			       (u16) (misc_reg & ~DISABLE_AUTO_POLARITY));
-		break;
-
-	case 2:
-		/* we do this only if link is up */
-		if (!netif_carrier_ok(bdp->device)) {
-			break;
-		}
-
-		e100_mdi_read(bdp, PHY_82555_CSR, bdp->phy_addr, &status);
-		speed = (status & PHY_82555_SPEED_BIT) ? 100 : 10;
-
-		/* we need to do this only if speed is 10 */
-		if (speed != 10) {
-			break;
-		}
-
-		/* see if we have any end of frame errors */
-		e100_mdi_read(bdp, PHY_82555_EOF_COUNTER,
-			      bdp->phy_addr, &errors);
-
-		/* if non-zero, wait for 100 ms before reading again */
-		if (errors) {
-			udelay(200);
-			e100_mdi_read(bdp, PHY_82555_EOF_COUNTER,
-				      bdp->phy_addr, &errors);
-
-			/* if non-zero again, we disable polarity */
-			if (errors) {
-				e100_mdi_read(bdp, PHY_82555_SPECIAL_CONTROL,
-					      bdp->phy_addr, &misc_reg);
-				e100_mdi_write(bdp, PHY_82555_SPECIAL_CONTROL,
-					       bdp->phy_addr,
-					       (u16) (misc_reg |
-						      DISABLE_AUTO_POLARITY));
-			}
-		}
-
-		if (!errors) {
-			/* it is safe to read the polarity now */
-			e100_mdi_read(bdp, PHY_82555_CSR,
-				      bdp->phy_addr, &status);
-
-			/* if polarity is normal, disable polarity */
-			if (!(status & PHY_82555_POLARITY_BIT)) {
-				e100_mdi_read(bdp, PHY_82555_SPECIAL_CONTROL,
-					      bdp->phy_addr, &misc_reg);
-				e100_mdi_write(bdp, PHY_82555_SPECIAL_CONTROL,
-					       bdp->phy_addr,
-					       (u16) (misc_reg |
-						      DISABLE_AUTO_POLARITY));
-			}
-		}
-		break;
-
-	default:
-		break;
-	}
-}
-
-/* 
- * Procedure:	e100_find_speed_duplex
- *
- * Description: This routine will figure out what line speed and duplex mode
- *		the PHY is currently using.
- *
- * Arguments:
- *	bdp - Ptr to this card's e100_bdconfig structure
- *
- * Returns:
- *	NOTHING
- */
-static void
-e100_find_speed_duplex(struct e100_private *bdp)
-{
-	unsigned int PhyId;
-	u16 stat_reg, misc_reg;
-	u16 ad_reg, lp_ad_reg;
-
-	PhyId = bdp->PhyId & PHY_MODEL_REV_ID_MASK;
-
-	/* First we should check to see if we have link */
-	/* If we don't have a link no reason to print a speed and duplex */
-	if (!e100_update_link_state(bdp)) {
-		bdp->cur_line_speed = 0;
-		bdp->cur_dplx_mode = 0;
-		return;
-	}
-
-	/* On the 82559 and later controllers, speed/duplex is part of the *
-	 * SCB. So, we save an mdi_read and get these from the SCB. * */
-	if (bdp->rev_id >= D101MA_REV_ID) {
-		/* Read speed */
-		if (readb(&bdp->scb->scb_ext.d101m_scb.scb_gen_stat) & BIT_1)
-			bdp->cur_line_speed = 100;
-		else
-			bdp->cur_line_speed = 10;
-
-		/* Read duplex */
-		if (readb(&bdp->scb->scb_ext.d101m_scb.scb_gen_stat) & BIT_2)
-			bdp->cur_dplx_mode = FULL_DUPLEX;
-		else
-			bdp->cur_dplx_mode = HALF_DUPLEX;
-
-		return;
-	}
-
-	/* If this is a Phy 100, then read bits 1 and 0 of extended register 0,
-	 * to get the current speed and duplex settings. */
-	if ((PhyId == PHY_100_A) || (PhyId == PHY_100_C) ||
-	    (PhyId == PHY_82555_TX)) {
-
-		/* Read Phy 100 extended register 0 */
-		e100_mdi_read(bdp, EXTENDED_REG_0, bdp->phy_addr, &misc_reg);
-
-		/* Get current speed setting */
-		if (misc_reg & PHY_100_ER0_SPEED_INDIC)
-			bdp->cur_line_speed = 100;
-		else
-			bdp->cur_line_speed = 10;
-
-		/* Get current duplex setting -- FDX enabled if bit is set */
-		if (misc_reg & PHY_100_ER0_FDX_INDIC)
-			bdp->cur_dplx_mode = FULL_DUPLEX;
-		else
-			bdp->cur_dplx_mode = HALF_DUPLEX;
-
-		return;
-	}
-
-	/* See if link partner is capable of Auto-Negotiation (bit 0, reg 6) */
-	e100_mdi_read(bdp, MII_EXPANSION, bdp->phy_addr, &misc_reg);
-
-	/* See if Auto-Negotiation was complete (bit 5, reg 1) */
-	e100_mdi_read(bdp, MII_BMSR, bdp->phy_addr, &stat_reg);
-
-	/* If a True NWAY connection was made, then we can detect speed/dplx
-	 * by ANDing our adapter's advertised abilities with our link partner's
-	 * advertised ablilities, and then assuming that the highest common
-	 * denominator was chosed by NWAY. */
-	if ((misc_reg & EXPANSION_NWAY) && (stat_reg & BMSR_ANEGCOMPLETE)) {
-
-		/* Read our advertisement register */
-		e100_mdi_read(bdp, MII_ADVERTISE, bdp->phy_addr, &ad_reg);
-
-		/* Read our link partner's advertisement register */
-		e100_mdi_read(bdp, MII_LPA, bdp->phy_addr, &lp_ad_reg);
-
-		/* AND the two advertisement registers together, and get rid
-		 * of any extraneous bits. */
-		ad_reg &= (lp_ad_reg & NWAY_LP_ABILITY);
-
-		/* Get speed setting */
-		if (ad_reg &
-		    (ADVERTISE_100HALF | ADVERTISE_100FULL |
-		     ADVERTISE_100BASE4))
-
-			bdp->cur_line_speed = 100;
-		else
-			bdp->cur_line_speed = 10;
-
-		/* Get duplex setting -- use priority resolution algorithm */
-		if (ad_reg & ADVERTISE_100BASE4) {
-			bdp->cur_dplx_mode = HALF_DUPLEX;
-		} else if (ad_reg & ADVERTISE_100FULL) {
-			bdp->cur_dplx_mode = FULL_DUPLEX;
-		} else if (ad_reg & ADVERTISE_100HALF) {
-			bdp->cur_dplx_mode = HALF_DUPLEX;
-		} else if (ad_reg & ADVERTISE_10FULL) {
-			bdp->cur_dplx_mode = FULL_DUPLEX;
-		} else {
-			bdp->cur_dplx_mode = HALF_DUPLEX;
-		}
-
-		return;
-	}
-
-	/* If we are connected to a dumb (non-NWAY) repeater or hub, and the
-	 * line speed was determined automatically by parallel detection, then
-	 * we have no way of knowing exactly what speed the PHY is set to
-	 * unless that PHY has a propietary register which indicates speed in
-	 * this situation. The NSC TX PHY does have such a register. Also,
-	 * since NWAY didn't establish the connection, the duplex setting
-	 * should HALF duplex. */
-	bdp->cur_dplx_mode = HALF_DUPLEX;
-
-	if (PhyId == PHY_NSC_TX) {
-		/* Read register 25 to get the SPEED_10 bit */
-		e100_mdi_read(bdp, NSC_SPEED_IND_REG, bdp->phy_addr, &misc_reg);
-
-		/* If bit 6 was set then we're at 10Mbps */
-		if (misc_reg & NSC_TX_SPD_INDC_SPEED)
-			bdp->cur_line_speed = 10;
-		else
-			bdp->cur_line_speed = 100;
-
-	} else {
-		/* If we don't know the line speed, default to 10Mbps */
-		bdp->cur_line_speed = 10;
-	}
-}
-
-/* 
- * Procedure: e100_force_speed_duplex
- *
- * Description: This routine forces line speed and duplex mode of the
- * adapter based on the values the user has set in e100.c.
- *
- * Arguments:  bdp - Pointer to the e100_private structure for the board
- *
- * Returns: void
- *
- */
-void
-e100_force_speed_duplex(struct e100_private *bdp)
-{
-	u16 control;
-	unsigned long expires;
-
-	bdp->flags |= DF_SPEED_FORCED;
-
-	e100_mdi_read(bdp, MII_BMCR, bdp->phy_addr, &control);
-	control &= ~BMCR_ANENABLE;
-	control &= ~BMCR_LOOPBACK;
-
-	switch (bdp->params.e100_speed_duplex) {
-	case E100_SPEED_10_HALF:
-		control &= ~BMCR_SPEED100;
-		control &= ~BMCR_FULLDPLX;
-		bdp->cur_line_speed = 10;
-		bdp->cur_dplx_mode = HALF_DUPLEX;
-		break;
-
-	case E100_SPEED_10_FULL:
-		control &= ~BMCR_SPEED100;
-		control |= BMCR_FULLDPLX;
-		bdp->cur_line_speed = 10;
-		bdp->cur_dplx_mode = FULL_DUPLEX;
-		break;
-
-	case E100_SPEED_100_HALF:
-		control |= BMCR_SPEED100;
-		control &= ~BMCR_FULLDPLX;
-		bdp->cur_line_speed = 100;
-		bdp->cur_dplx_mode = HALF_DUPLEX;
-		break;
-
-	case E100_SPEED_100_FULL:
-		control |= BMCR_SPEED100;
-		control |= BMCR_FULLDPLX;
-		bdp->cur_line_speed = 100;
-		bdp->cur_dplx_mode = FULL_DUPLEX;
-		break;
-	}
-
-	e100_mdi_write(bdp, MII_BMCR, bdp->phy_addr, control);
-
-	/* loop must run at least once */
-	expires = jiffies + 2 * HZ;
-	do {
-		if (e100_update_link_state(bdp) || 
-		    time_after(jiffies, expires)) {
-			break;
-		} else {
-			yield();
-		}
-
-	} while (true);
-}
-
-void
-e100_force_speed_duplex_to_phy(struct e100_private *bdp)
-{
-	u16 control;
-
-	e100_mdi_read(bdp, MII_BMCR, bdp->phy_addr, &control);
-	control &= ~BMCR_ANENABLE;
-	control &= ~BMCR_LOOPBACK;
-
-	switch (bdp->params.e100_speed_duplex) {
-	case E100_SPEED_10_HALF:
-		control &= ~BMCR_SPEED100;
-		control &= ~BMCR_FULLDPLX;
-		break;
-
-	case E100_SPEED_10_FULL:
-		control &= ~BMCR_SPEED100;
-		control |= BMCR_FULLDPLX;
-		break;
-
-	case E100_SPEED_100_HALF:
-		control |= BMCR_SPEED100;
-		control &= ~BMCR_FULLDPLX;
-		break;
-
-	case E100_SPEED_100_FULL:
-		control |= BMCR_SPEED100;
-		control |= BMCR_FULLDPLX;
-		break;
-	}
-
-	/* Send speed/duplex command to PHY layer. */
-	e100_mdi_write(bdp, MII_BMCR, bdp->phy_addr, control);
-}
-
-/* 
- * Procedure: e100_set_fc
- *
- * Description: Checks the link's capability for flow control.
- * 
- * Arguments:  bdp - Pointer to the e100_private structure for the board
- *		    
- * Returns: void
- *
- */
-static void
-e100_set_fc(struct e100_private *bdp)
-{
-	u16 ad_reg;
-	u16 lp_ad_reg;
-	u16 exp_reg;
-
-	/* no flow control for 82557, forced links or half duplex */
-	if (!netif_carrier_ok(bdp->device) || (bdp->flags & DF_SPEED_FORCED) ||
-	    (bdp->cur_dplx_mode == HALF_DUPLEX) ||
-	    !(bdp->flags & IS_BACHELOR)) {
-
-		bdp->flags &= ~DF_LINK_FC_CAP;
-		return;
-	}
-
-	/* See if link partner is capable of Auto-Negotiation (bit 0, reg 6) */
-	e100_mdi_read(bdp, MII_EXPANSION, bdp->phy_addr, &exp_reg);
-
-	if (exp_reg & EXPANSION_NWAY) {
-		/* Read our advertisement register */
-		e100_mdi_read(bdp, MII_ADVERTISE, bdp->phy_addr, &ad_reg);
-
-		/* Read our link partner's advertisement register */
-		e100_mdi_read(bdp, MII_LPA, bdp->phy_addr, &lp_ad_reg);
-
-		ad_reg &= lp_ad_reg;	/* AND the 2 ad registers */
-
-		if (ad_reg & NWAY_AD_FC_SUPPORTED)
-			bdp->flags |= DF_LINK_FC_CAP;
-		else
-			/* If link partner is capable of autoneg, but  */
-			/* not capable of flow control, Received PAUSE */
-			/* frames are still honored, i.e.,             */
-		        /* transmitted frames would be paused */
-			/* by incoming PAUSE frames           */
-			bdp->flags |= DF_LINK_FC_TX_ONLY;
-
-	} else {
-		bdp->flags &= ~DF_LINK_FC_CAP;
-	}
-}
-
-/* 
- * Procedure: e100_phy_check
- * 
- * Arguments:  bdp - Pointer to the e100_private structure for the board
- *
- * Returns: true if link state was changed
- *	   false otherwise
- *
- */
-unsigned char
-e100_phy_check(struct e100_private *bdp)
-{
-	unsigned char old_link;
-	unsigned char changed = false;
-
-	old_link = netif_carrier_ok(bdp->device) ? 1 : 0;
-	e100_find_speed_duplex(bdp);
-
-	if (!old_link && netif_carrier_ok(bdp->device)) {
-		e100_set_fc(bdp);
-		changed = true;
-	}
-
-	if (old_link && !netif_carrier_ok(bdp->device)) {
-		/* reset the zero lock state */
-		bdp->zlock_state = ZLOCK_INITIAL;
-
-		// set auto lock for phy auto-negotiation on link up
-		if ((bdp->PhyId & PHY_MODEL_REV_ID_MASK) == PHY_82555_TX)
-			e100_mdi_write(bdp, PHY_82555_MDI_EQUALIZER_CSR,
-				       bdp->phy_addr, 0);
-		changed = true;
-	}
-
-	e100_phy_fix_squelch(bdp);
-	e100_handle_zlock(bdp);
-
-	return changed;
-}
-
-/* 
- * Procedure:	e100_auto_neg
- *
- * Description: This routine will start autonegotiation and wait
- *		     for it to complete
- *
- * Arguments:
- *	bdp		- pointer to this card's e100_bdconfig structure
- *	force_restart	- defines if autoneg should be restarted even if it
- *			has been completed before
- * Returns:
- *	NOTHING
- */
-static void
-e100_auto_neg(struct e100_private *bdp, unsigned char force_restart)
-{
-	u16 stat_reg;
-	unsigned long expires;
-
-	bdp->flags &= ~DF_SPEED_FORCED;
-
-	e100_mdi_read(bdp, MII_BMSR, bdp->phy_addr, &stat_reg);
-	e100_mdi_read(bdp, MII_BMSR, bdp->phy_addr, &stat_reg);
-
-	/* if we are capable of performing autoneg then we restart if needed */
-	if ((stat_reg != 0xFFFF) && (stat_reg & BMSR_ANEGCAPABLE)) {
-
-		if ((!force_restart) &&
-		    (stat_reg & BMSR_ANEGCOMPLETE)) {
-			goto exit;
-		}
-
-		e100_mdi_write(bdp, MII_BMCR, bdp->phy_addr,
-			       BMCR_ANENABLE | BMCR_ANRESTART);
-
-		/* wait for autoneg to complete (up to 3 seconds) */
-		expires = jiffies + HZ * 3;
-		do {
-			/* now re-read the value. Sticky so read twice */
-			e100_mdi_read(bdp, MII_BMSR, bdp->phy_addr, &stat_reg);
-			e100_mdi_read(bdp, MII_BMSR, bdp->phy_addr, &stat_reg);
-
-			if ((stat_reg & BMSR_ANEGCOMPLETE) ||
-			    time_after(jiffies, expires) ) {
-				goto exit;
-			} else {
-				yield();
-			}
-		} while (true);
-	}
-
-exit:
-	e100_find_speed_duplex(bdp);
-}
-
-void
-e100_phy_set_speed_duplex(struct e100_private *bdp, unsigned char force_restart)
-{
-	if (bdp->params.e100_speed_duplex == E100_AUTONEG) {
-        	if (bdp->rev_id >= D102_REV_ID) 
-			/* Enable MDI/MDI-X auto switching */
-                	e100_mdi_write(bdp, MII_NCONFIG, bdp->phy_addr,
-		                       MDI_MDIX_AUTO_SWITCH_ENABLE);
-		e100_auto_neg(bdp, force_restart);
-
-	} else {
-        	if (bdp->rev_id >= D102_REV_ID) 
-			/* Disable MDI/MDI-X auto switching */
-                	e100_mdi_write(bdp, MII_NCONFIG, bdp->phy_addr,
-		                       MDI_MDIX_RESET_ALL_MASK);
-		e100_force_speed_duplex(bdp);
-	}
-
-	e100_set_fc(bdp);
-}
-
-void
-e100_phy_autoneg(struct e100_private *bdp)
-{
-	u16 ctrl_reg;
-
-	ctrl_reg = BMCR_ANENABLE | BMCR_ANRESTART | BMCR_RESET;
-
-	e100_mdi_write(bdp, MII_BMCR, bdp->phy_addr, ctrl_reg);
-
-	udelay(100);
-}
-
-void
-e100_phy_set_loopback(struct e100_private *bdp)
-{
-	u16 ctrl_reg;
-	ctrl_reg = BMCR_LOOPBACK;
-	e100_mdi_write(bdp, MII_BMCR, bdp->phy_addr, ctrl_reg);
-		udelay(100);
-}
-	
-void
-e100_phy_reset(struct e100_private *bdp)
-{
-	u16 ctrl_reg;
-	ctrl_reg = BMCR_RESET;
-	e100_mdi_write(bdp, MII_BMCR, bdp->phy_addr, ctrl_reg);
-	/* ieee 802.3 : The reset process shall be completed       */
-	/* within 0.5 seconds from the settting of PHY reset bit.  */
-	set_current_state(TASK_UNINTERRUPTIBLE);
-	schedule_timeout(HZ / 2);
-}
-
-unsigned char
-e100_phy_init(struct e100_private *bdp)
-{
-	e100_phy_reset(bdp);
-	e100_phy_address_detect(bdp);
-	e100_phy_isolate(bdp);
-	e100_phy_id_detect(bdp);
-
-	if (!e100_phy_specific_setup(bdp))
-		return false;
-
-	bdp->PhyState = 0;
-	bdp->PhyDelay = 0;
-	bdp->zlock_state = ZLOCK_INITIAL;
-
-	e100_phy_set_speed_duplex(bdp, false);
-	e100_fix_polarity(bdp);
-
-	return true;
-}
-
-/* 
- * Procedure: e100_get_link_state
- * 
- * Description: This routine checks the link status of the adapter
- *
- * Arguments:  bdp - Pointer to the e100_private structure for the board
- *		    
- *
- * Returns: true - If a link is found
- *		false - If there is no link
- *
- */
-unsigned char
-e100_get_link_state(struct e100_private *bdp)
-{
-	unsigned char link = false;
-	u16 status;
-
-	/* Check link status */
-	/* If the controller is a 82559 or later one, link status is available
-	 * from the CSR. This avoids the mdi_read. */
-	if (bdp->rev_id >= D101MA_REV_ID) {
-		if (readb(&bdp->scb->scb_ext.d101m_scb.scb_gen_stat) & BIT_0) {
-			link = true;
-		} else {
-			link = false;
-		}
-
-	} else {
-		/* Read the status register twice because of sticky bits */
-		e100_mdi_read(bdp, MII_BMSR, bdp->phy_addr, &status);
-		e100_mdi_read(bdp, MII_BMSR, bdp->phy_addr, &status);
-
-		if (status & BMSR_LSTATUS) {
-			link = true;
-		} else {
-			link = false;
-		}
-	}
-
-	return link;
-}
-
-/* 
- * Procedure: e100_update_link_state
- * 
- * Description: This routine updates the link status of the adapter,
- * 		also considering netif_running
- *
- * Arguments:  bdp - Pointer to the e100_private structure for the board
- *		    
- *
- * Returns: true - If a link is found
- *		false - If there is no link
- *
- */
-unsigned char
-e100_update_link_state(struct e100_private *bdp)
-{
-	unsigned char link;
-
-	/* Logical AND PHY link & netif_running */
-	link = e100_get_link_state(bdp) && netif_running(bdp->device);
-
-	if (link) {
-		if (!netif_carrier_ok(bdp->device))
-			netif_carrier_on(bdp->device);
-	} else {
-		if (netif_carrier_ok(bdp->device))
-			netif_carrier_off(bdp->device);
-	}
-
-	return link;
-}
-
-/**************************************************************************\
- **
- ** PROC NAME:     e100_handle_zlock
- **    This function manages a state machine that controls
- **    the driver's zero locking algorithm.
- **    This function is called by e100_watchdog() every ~2 second.
- ** States:
- **    The current link handling state is stored in 
- **    bdp->zlock_state, and is one of:
- **    ZLOCK_INITIAL, ZLOCK_READING, ZLOCK_SLEEPING
- **    Detailed description of the states and the transitions
- **    between states is found below.
- **    Note that any time the link is down / there is a reset
- **    state will be changed outside this function to ZLOCK_INITIAL
- ** Algorithm:
- **    1. If link is up & 100 Mbps continue else stay in #1:
- **    2. Set 'auto lock'
- **    3. Read & Store 100 times 'Zero' locked in 1 sec interval
- **    4. If max zero read >= 0xB continue else goto 1
- **    5. Set most popular 'Zero' read in #3
- **    6. Sleep 5 minutes
- **    7. Read number of errors, if it is > 300 goto 2 else goto 6
- ** Data Structures (in DRIVER_DATA):
- **    zlock_state           - current state of the algorithm
- **    zlock_read_cnt        - counts number of reads (up to 100)
- **    zlock_read_data[i]    - counts number of times 'Zero' read was i, 0 <= i <= 15
- **    zlock_sleep_cnt       - keeps track of "sleep" time (up to 300 secs = 5 minutes)
- **                                
- ** Parameters:    DRIVER_DATA    *bdp
- **
- **                bdp  - Pointer to HSM's adapter data space
- **
- ** Return Value:  NONE
- **
- ** See Also:      e100_watchdog()
- **
- \**************************************************************************/
-void
-e100_handle_zlock(struct e100_private *bdp)
-{
-	u16 pos;
-	u16 eq_reg;
-	u16 err_cnt;
-	u8 mpz;			/* Most Popular Zero */
-
-	switch (bdp->zlock_state) {
-	case ZLOCK_INITIAL:
-
-		if (((u8) bdp->rev_id <= D102_REV_ID) ||
-		    !(bdp->cur_line_speed == 100) ||
-		    !netif_carrier_ok(bdp->device)) {
-			break;
-		}
-
-		/* initialize hw and sw and start reading */
-		e100_mdi_write(bdp, PHY_82555_MDI_EQUALIZER_CSR,
-			       bdp->phy_addr, 0);
-		/* reset read counters: */
-		bdp->zlock_read_cnt = 0;
-		for (pos = 0; pos < 16; pos++)
-			bdp->zlock_read_data[pos] = 0;
-		/* start reading in the next call back: */
-		bdp->zlock_state = ZLOCK_READING;
-
-		/* FALL THROUGH !! */
-
-	case ZLOCK_READING:
-		/* state: reading (100 times) zero locked in 1 sec interval
-		 * prev states: ZLOCK_INITIAL
-		 * next states: ZLOCK_INITIAL, ZLOCK_SLEEPING */
-
-		e100_mdi_read(bdp, PHY_82555_MDI_EQUALIZER_CSR,
-			      bdp->phy_addr, &eq_reg);
-		pos = (eq_reg & ZLOCK_ZERO_MASK) >> 4;
-		bdp->zlock_read_data[pos]++;
-		bdp->zlock_read_cnt++;
-
-		if (bdp->zlock_read_cnt == ZLOCK_MAX_READS) {
-			/* check if we read a 'Zero' value of 0xB or greater */
-			if ((bdp->zlock_read_data[0xB]) ||
-			    (bdp->zlock_read_data[0xC]) ||
-			    (bdp->zlock_read_data[0xD]) ||
-			    (bdp->zlock_read_data[0xE]) ||
-			    (bdp->zlock_read_data[0xF])) {
-
-				/* we've read 'Zero' value of 0xB or greater,
-				 * find most popular 'Zero' value and lock it */
-				mpz = 0;
-				/* this loop finds the most popular 'Zero': */
-				for (pos = 1; pos < 16; pos++) {
-					if (bdp->zlock_read_data[pos] >
-					    bdp->zlock_read_data[mpz])
-
-						mpz = pos;
-				}
-				/* now lock the most popular 'Zero': */
-				eq_reg = (ZLOCK_SET_ZERO | mpz);
-				e100_mdi_write(bdp,
-					       PHY_82555_MDI_EQUALIZER_CSR,
-					       bdp->phy_addr, eq_reg);
-
-				/* sleep for 5 minutes: */
-				bdp->zlock_sleep_cnt = jiffies;
-				bdp->zlock_state = ZLOCK_SLEEPING;
-				/* we will be reading the # of errors after 5
-				 * minutes, so we need to reset the error
-				 * counters - these registers are self clearing
-				 * on read, so read them */
-				e100_mdi_read(bdp, PHY_82555_SYMBOL_ERR,
-					      bdp->phy_addr, &err_cnt);
-
-			} else {
-				/* we did not read a 'Zero' value of 0xB or
-				 * above. go back to the start */
-				bdp->zlock_state = ZLOCK_INITIAL;
-			}
-
-		}
-		break;
-
-	case ZLOCK_SLEEPING:
-		/* state: sleeping for 5 minutes
-		 * prev states: ZLOCK_READING
-		 * next states: ZLOCK_READING, ZLOCK_SLEEPING */
-
-		/* if 5 minutes have passed: */
-		if ((jiffies - bdp->zlock_sleep_cnt) >= ZLOCK_MAX_SLEEP) {
-			/* read and sum up the number of errors:  */
-			e100_mdi_read(bdp, PHY_82555_SYMBOL_ERR,
-				      bdp->phy_addr, &err_cnt);
-			/* if we've more than 300 errors (this number was
-			 * calculated according to the spec max allowed errors
-			 * (80 errors per 1 million frames) for 5 minutes in
-			 * 100 Mbps (or the user specified max BER number) */
-			if (err_cnt > bdp->params.ber) {
-				/* start again in the next callback: */
-				bdp->zlock_state = ZLOCK_INITIAL;
-			} else {
-				/* we don't have more errors than allowed,
-				 * sleep for 5 minutes */
-				bdp->zlock_sleep_cnt = jiffies;
-			}
-		}
-		break;
-
-	default:
-		break;
-	}
-}
--- diff/drivers/net/e100/e100_phy.h	2003-05-21 11:49:55.000000000 +0100
+++ source/drivers/net/e100/e100_phy.h	1970-01-01 01:00:00.000000000 +0100
@@ -1,158 +0,0 @@
-/*******************************************************************************
-
-  
-  Copyright(c) 1999 - 2003 Intel Corporation. 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.
-  
-  The full GNU General Public License is included in this distribution in the
-  file called LICENSE.
-  
-  Contact Information:
-  Linux NICS <linux.nics@intel.com>
-  Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
-*******************************************************************************/
-
-#ifndef _E100_PHY_INC_
-#define _E100_PHY_INC_
-
-#include "e100.h"
-
-/*
- * Auto-polarity enable/disable
- * e100_autopolarity = 0 => disable auto-polarity
- * e100_autopolarity = 1 => enable auto-polarity
- * e100_autopolarity = 2 => let software determine
- */
-#define E100_AUTOPOLARITY 2
-
-#define IS_NC3133(bdp) (((bdp)->pdev->subsystem_vendor == 0x0E11) && \
-                        ((bdp)->pdev->subsystem_device == 0xB0E1))
-
-#define PHY_503                 0
-#define PHY_100_A               0x000003E0
-#define PHY_100_C               0x035002A8
-#define PHY_NSC_TX              0x5c002000
-#define PHY_82562ET             0x033002A8
-#define PHY_82562EM             0x032002A8
-#define PHY_82562EH             0x017002A8
-#define PHY_82555_TX            0x015002a8	/* added this for 82555 */
-#define PHY_OTHER               0xFFFF
-#define MAX_PHY_ADDR            31
-#define MIN_PHY_ADDR            0
-
-#define PHY_MODEL_REV_ID_MASK   0xFFF0FFFF
-
-#define PHY_DEFAULT_ADDRESS 1
-#define PHY_ADDRESS_503 32
-
-/* MDI Control register bit definitions */
-#define MDI_PHY_READY	    BIT_28	/* PHY is ready for next MDI cycle */
-
-#define MDI_NC3133_CONFIG_REG           0x19
-#define MDI_NC3133_100FX_ENABLE         BIT_2
-#define MDI_NC3133_INT_ENABLE_REG       0x17
-#define MDI_NC3133_INT_ENABLE           BIT_1
-
-/* MDI Control register opcode definitions */
-#define MDI_WRITE 1		/* Phy Write */
-#define MDI_READ  2		/* Phy read */
-
-/* MDI register set*/
-#define AUTO_NEG_NEXT_PAGE_REG	    0x07	/* Auto-negotiation next page xmit */
-#define EXTENDED_REG_0		    0x10	/* Extended reg 0 (Phy 100 modes) */
-#define EXTENDED_REG_1		    0x14	/* Extended reg 1 (Phy 100 error indications) */
-#define NSC_CONG_CONTROL_REG	    0x17	/* National (TX) congestion control */
-#define NSC_SPEED_IND_REG	    0x19	/* National (TX) speed indication */
-
-#define HWI_CONTROL_REG             0x1D	/* HWI Control register */
-/* MDI/MDI-X Control Register bit definitions */
-#define MDI_MDIX_RES_TIMER          BIT_0_3	/* minimum slot time for resolution timer */
-#define MDI_MDIX_CONFIG_IS_OK       BIT_4	/* 1 = resolution algorithm completes OK */
-#define MDI_MDIX_STATUS             BIT_5	/* 1 = MDIX (croos over), 0 = MDI (straight through) */
-#define MDI_MDIX_SWITCH             BIT_6	/* 1 = Forces to MDIX, 0 = Forces to MDI */
-#define MDI_MDIX_AUTO_SWITCH_ENABLE BIT_7	/* 1 = MDI/MDI-X feature enabled */
-#define MDI_MDIX_CONCT_CONFIG       BIT_8	/* Sets the MDI/MDI-X connectivity configuration (test prupose only) */
-#define MDI_MDIX_CONCT_TEST_ENABLE  BIT_9	/* 1 = Enables connectivity testing */
-#define MDI_MDIX_RESET_ALL_MASK     0x0000
-
-/* HWI Control Register bit definitions */
-#define HWI_TEST_DISTANCE           BIT_0_8	/* distance to cable problem */
-#define HWI_TEST_HIGHZ_PROBLEM      BIT_9	/* 1 = Open Circuit */
-#define HWI_TEST_LOWZ_PROBLEM       BIT_10	/* 1 = Short Circuit */
-#define HWI_TEST_RESERVED           (BIT_11 | BIT_12)	/* reserved */
-#define HWI_TEST_EXECUTE            BIT_13	/* 1 = Execute the HWI test on the PHY */
-#define HWI_TEST_ABILITY            BIT_14	/* 1 = test passed */
-#define HWI_TEST_ENABLE             BIT_15	/* 1 = Enables the HWI feature */
-#define HWI_RESET_ALL_MASK          0x0000
-
-/* ############Start of 82555 specific defines################## */
-
-/* Intel 82555 specific registers */
-#define PHY_82555_CSR		    0x10	/* 82555 CSR */
-#define PHY_82555_SPECIAL_CONTROL   0x11	/* 82555 special control register */
-
-#define PHY_82555_RCV_ERR	    0x15	/* 82555 100BaseTx Receive Error
-						 * Frame Counter */
-#define PHY_82555_SYMBOL_ERR	    0x16	/* 82555 RCV Symbol Error Counter */
-#define PHY_82555_PREM_EOF_ERR	    0x17	/* 82555 100BaseTx RCV Premature End
-						 * of Frame Error Counter */
-#define PHY_82555_EOF_COUNTER	    0x18	/* 82555 end of frame error counter */
-#define PHY_82555_MDI_EQUALIZER_CSR 0x1a	/* 82555 specific equalizer reg. */
-
-/* 82555 CSR bits */
-#define PHY_82555_SPEED_BIT    BIT_1
-#define PHY_82555_POLARITY_BIT BIT_8
-
-/* 82555 equalizer reg. opcodes */
-#define ENABLE_ZERO_FORCING  0x2010	/* write to ASD conf. reg. 0 */
-#define DISABLE_ZERO_FORCING 0x2000	/* write to ASD conf. reg. 0 */
-
-/* 82555 special control reg. opcodes */
-#define DISABLE_AUTO_POLARITY 0x0010
-#define EXTENDED_SQUELCH_BIT  BIT_2
-
-/* ############End of 82555 specific defines##################### */
-
-/* Auto-Negotiation advertisement register bit definitions*/
-#define NWAY_AD_FC_SUPPORTED    0x0400	/* Flow Control supported */
-
-/* Auto-Negotiation link partner ability register bit definitions*/
-#define NWAY_LP_ABILITY	        0x07e0	/* technologies supported */
-
-/* PHY 100 Extended Register 0 bit definitions*/
-#define PHY_100_ER0_FDX_INDIC	BIT_0	/* 1 = FDX, 0 = half duplex */
-#define PHY_100_ER0_SPEED_INDIC BIT_1	/* 1 = 100Mbps, 0= 10Mbps */
-
-/* National Semiconductor TX phy congestion control register bit definitions*/
-#define NSC_TX_CONG_TXREADY  BIT_10	/* Makes TxReady an input */
-#define NSC_TX_CONG_ENABLE   BIT_8	/* Enables congestion control */
-
-/* National Semiconductor TX phy speed indication register bit definitions*/
-#define NSC_TX_SPD_INDC_SPEED BIT_6	/* 0 = 100Mbps, 1=10Mbps */
-
-/************* function prototypes ************/
-extern unsigned char e100_phy_init(struct e100_private *bdp);
-extern unsigned char e100_update_link_state(struct e100_private *bdp);
-extern unsigned char e100_phy_check(struct e100_private *bdp);
-extern void e100_phy_set_speed_duplex(struct e100_private *bdp,
-				      unsigned char force_restart);
-extern void e100_phy_autoneg(struct e100_private *bdp);
-extern void e100_phy_reset(struct e100_private *bdp);
-extern void e100_phy_set_loopback(struct e100_private *bdp);
-extern int e100_mdi_write(struct e100_private *, u32, u32, u16);
-extern int e100_mdi_read(struct e100_private *, u32, u32, u16 *);
-
-#endif
--- diff/drivers/net/e100/e100_test.c	2003-06-09 14:18:19.000000000 +0100
+++ source/drivers/net/e100/e100_test.c	1970-01-01 01:00:00.000000000 +0100
@@ -1,500 +0,0 @@
-/*******************************************************************************
-
-  
-  Copyright(c) 1999 - 2003 Intel Corporation. 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.
-  
-  The full GNU General Public License is included in this distribution in the
-  file called LICENSE.
-  
-  Contact Information:
-  Linux NICS <linux.nics@intel.com>
-  Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
-*******************************************************************************/
-
-#include "e100_phy.h"
-#include "e100_config.h"
-
-extern u16 e100_eeprom_read(struct e100_private *, u16);
-extern int e100_wait_exec_cmplx(struct e100_private *, u32,u8, u8);
-extern void e100_phy_reset(struct e100_private *bdp);
-extern void e100_phy_autoneg(struct e100_private *bdp);
-extern void e100_phy_set_loopback(struct e100_private *bdp);
-extern void e100_force_speed_duplex(struct e100_private *bdp);
-
-static u8 e100_diag_selftest(struct net_device *);
-static u8 e100_diag_eeprom(struct net_device *);
-static u8 e100_diag_loopback(struct net_device *);
-
-static u8 e100_diag_one_loopback (struct net_device *, u8);
-static u8 e100_diag_rcv_loopback_pkt(struct e100_private *);
-static void e100_diag_config_loopback(struct e100_private *, u8, u8, u8 *,u8 *);
-static u8 e100_diag_loopback_alloc(struct e100_private *);
-static void e100_diag_loopback_cu_ru_exec(struct e100_private *);
-static u8 e100_diag_check_pkt(u8 *);
-static void e100_diag_loopback_free(struct e100_private *);
-static int e100_cable_diag(struct e100_private *bdp);
-
-#define LB_PACKET_SIZE 1500
-
-/**
- * e100_run_diag - main test execution handler - checks mask of requests and calls the diag routines  
- * @dev: atapter's net device data struct
- * @test_info: array with test request mask also used to store test results
- *
- * RETURNS: updated flags field of struct ethtool_test
- */
-u32
-e100_run_diag(struct net_device *dev, u64 *test_info, u32 flags)
-{
-	struct e100_private* bdp = dev->priv;
-	u8 test_result = 0;
-
-	if (!e100_get_link_state(bdp)) {
-		test_result = ETH_TEST_FL_FAILED;
-		test_info[test_link] = true;
-	}
-	if (!e100_diag_eeprom(dev)) {
-		test_result = ETH_TEST_FL_FAILED;
-		test_info[test_eeprom] = true;
-	}
-	if (flags & ETH_TEST_FL_OFFLINE) {
-		u8 fail_mask;
-		if (netif_running(dev)) {
-			spin_lock_bh(&dev->xmit_lock);
-			e100_close(dev);
-			spin_unlock_bh(&dev->xmit_lock);
-		}
-		if (e100_diag_selftest(dev)) {
-			test_result = ETH_TEST_FL_FAILED;
-			test_info[test_self_test] = true;
-		}
-
-		fail_mask = e100_diag_loopback(dev);
-		if (fail_mask) {
-			test_result = ETH_TEST_FL_FAILED;
-			if (fail_mask & PHY_LOOPBACK)
-				test_info[test_loopback_phy] = true;
-			if (fail_mask & MAC_LOOPBACK)
-				test_info[test_loopback_mac] = true;
-		}
-
-		test_info[cable_diag] = e100_cable_diag(bdp);
-		/* Need hw init regardless of netif_running */
-		e100_hw_init(bdp);
-		if (netif_running(dev)) {
-			e100_open(dev);
-		}
-	}
-	else {
-		test_info[test_self_test] = false;
-		test_info[test_loopback_phy] = false;
-		test_info[test_loopback_mac] = false;
-		test_info[cable_diag] = false;
-	}
-
-	return flags | test_result;
-}
-
-/**
- * e100_diag_selftest - run hardware selftest 
- * @dev: atapter's net device data struct
- */
-static u8
-e100_diag_selftest(struct net_device *dev)
-{
-	struct e100_private *bdp = dev->priv;
-	u32 st_timeout, st_result;
-	u8 retval = 0;
-
-	if (!e100_selftest(bdp, &st_timeout, &st_result)) {
-		if (!st_timeout) {
-			if (st_result & CB_SELFTEST_REGISTER_BIT)
-				retval |= REGISTER_TEST_FAIL;
-			if (st_result & CB_SELFTEST_DIAG_BIT)
-				retval |= SELF_TEST_FAIL;
-			if (st_result & CB_SELFTEST_ROM_BIT)
-				retval |= ROM_TEST_FAIL;
-		} else {
-            		retval = TEST_TIMEOUT;
-		}
-	}
-
-	return retval;
-}
-
-/**
- * e100_diag_eeprom - validate eeprom checksum correctness
- * @dev: atapter's net device data struct
- *
- */
-static u8
-e100_diag_eeprom (struct net_device *dev)
-{
-	struct e100_private *bdp = dev->priv;
-	u16 i, eeprom_sum, eeprom_actual_csm;
-
-	for (i = 0, eeprom_sum = 0; i < (bdp->eeprom_size - 1); i++) {
-		eeprom_sum += e100_eeprom_read(bdp, i);
-	}
-
-	eeprom_actual_csm = e100_eeprom_read(bdp, bdp->eeprom_size - 1);
-
-	if (eeprom_actual_csm == (u16)(EEPROM_SUM - eeprom_sum)) {
-		return true;
-	}
-
-	return false;
-}
-
-/**
- * e100_diag_loopback - performs loopback test  
- * @dev: atapter's net device data struct
- */
-static u8
-e100_diag_loopback (struct net_device *dev)
-{
-	u8 rc = 0;
-
-	printk(KERN_DEBUG "%s: PHY loopback test starts\n", dev->name);
-	e100_hw_init(dev->priv);
-	if (!e100_diag_one_loopback(dev, PHY_LOOPBACK)) {
-		rc |= PHY_LOOPBACK;
-	}
-	printk(KERN_DEBUG "%s: PHY loopback test ends\n", dev->name);
-
-	printk(KERN_DEBUG "%s: MAC loopback test starts\n", dev->name);
-	e100_hw_init(dev->priv);
-	if (!e100_diag_one_loopback(dev, MAC_LOOPBACK)) {
-		rc |= MAC_LOOPBACK;
-	}
-	printk(KERN_DEBUG "%s: MAC loopback test ends\n", dev->name);
-
-	return rc;
-}
-
-/**
- * e100_diag_loopback - performs loopback test  
- * @dev: atapter's net device data struct
- * @mode: lopback test type
- */
-static u8
-e100_diag_one_loopback (struct net_device *dev, u8 mode)
-{
-        struct e100_private *bdp = dev->priv;
-        u8 res = false;
-   	u8 saved_dynamic_tbd = false;
-   	u8 saved_extended_tcb = false;
-
-	if (!e100_diag_loopback_alloc(bdp))
-		return false;
-
-	/* change the config block to standard tcb and the correct loopback */
-        e100_diag_config_loopback(bdp, true, mode,
-				  &saved_extended_tcb, &saved_dynamic_tbd);
-
-	e100_diag_loopback_cu_ru_exec(bdp);
-
-        if (e100_diag_rcv_loopback_pkt(bdp)) {
-		res = true;
-	}
-
-        e100_diag_loopback_free(bdp);
-
-        /* change the config block to previous tcb mode and the no loopback */
-        e100_diag_config_loopback(bdp, false, mode,
-				  &saved_extended_tcb, &saved_dynamic_tbd);
-	return res;
-}
-
-/**
- * e100_diag_config_loopback - setup/clear loopback before/after lpbk test
- * @bdp: atapter's private data struct
- * @set_loopback: true if the function is called to set lb
- * @loopback_mode: the loopback mode(MAC or PHY)
- * @tcb_extended: true if need to set extended tcb mode after clean loopback
- * @dynamic_tbd: true if needed to set dynamic tbd mode after clean loopback
- *
- */
-void
-e100_diag_config_loopback(struct e100_private* bdp,
-			  u8 set_loopback,
-			  u8 loopback_mode,
-			  u8* tcb_extended,
-			  u8* dynamic_tbd)
-{
-	/* if set_loopback == true - we want to clear tcb_extended/dynamic_tbd.
-	 * the previous values are saved in the params tcb_extended/dynamic_tbd
-	 * if set_loopback == false - we want to restore previous value.
-	 */
-	if (set_loopback || (*tcb_extended))
-		  *tcb_extended = e100_config_tcb_ext_enable(bdp,*tcb_extended);
-
-	if (set_loopback || (*dynamic_tbd))
-		 *dynamic_tbd = e100_config_dynamic_tbd(bdp,*dynamic_tbd);
-
-	if (set_loopback) {
-		/* ICH PHY loopback is broken */
-		if (bdp->flags & IS_ICH && loopback_mode == PHY_LOOPBACK)
-			loopback_mode = MAC_LOOPBACK;
-		/* Configure loopback on MAC */
-		e100_config_loopback_mode(bdp,loopback_mode);
-	} else {
-		e100_config_loopback_mode(bdp,NO_LOOPBACK);
-	}
-
-	e100_config(bdp);
-
-	if (loopback_mode == PHY_LOOPBACK) {
-		if (set_loopback)
-                        /* Set PHY loopback mode */
-                        e100_phy_set_loopback(bdp);
-		else
-			/* Reset PHY loopback mode */
-			e100_phy_reset(bdp);	
-		/* Wait for PHY state change */
-		set_current_state(TASK_UNINTERRUPTIBLE);
-                schedule_timeout(HZ);
-	} else { /* For MAC loopback wait 500 msec to take effect */
-		set_current_state(TASK_UNINTERRUPTIBLE);
-		schedule_timeout(HZ / 2);
-	}
-}
-  
-/**
- * e100_diag_loopback_alloc - alloc & initate tcb and rfd for the loopback
- * @bdp: atapter's private data struct
- *
- */
-static u8
-e100_diag_loopback_alloc(struct e100_private *bdp)
-{
-	dma_addr_t dma_handle;
-	tcb_t *tcb;
-	rfd_t *rfd;
-	tbd_t *tbd;
-
-	/* tcb, tbd and transmit buffer are allocated */
-	tcb = pci_alloc_consistent(bdp->pdev,
-				   (sizeof (tcb_t) + sizeof (tbd_t) +
-				    LB_PACKET_SIZE),
-				   &dma_handle);
-        if (tcb == NULL)
-		return false;
-
-	memset(tcb, 0x00, sizeof (tcb_t) + sizeof (tbd_t) + LB_PACKET_SIZE);
-	tcb->tcb_phys = dma_handle;
-	tcb->tcb_hdr.cb_status = 0;
-	tcb->tcb_hdr.cb_cmd =
-		cpu_to_le16(CB_EL_BIT | CB_TRANSMIT | CB_TX_SF_BIT);
-	/* Next command is null */
-	tcb->tcb_hdr.cb_lnk_ptr = cpu_to_le32(0xffffffff);
-	tcb->tcb_cnt = 0;
-	tcb->tcb_thrshld = bdp->tx_thld;
-	tcb->tcb_tbd_num = 1;
-	/* Set up tcb tbd pointer */
-	tcb->tcb_tbd_ptr = cpu_to_le32(tcb->tcb_phys + sizeof (tcb_t));
-	tbd = (tbd_t *) ((u8 *) tcb + sizeof (tcb_t));
-	/* Set up tbd transmit buffer */
-	tbd->tbd_buf_addr =
-		cpu_to_le32(le32_to_cpu(tcb->tcb_tbd_ptr) + sizeof (tbd_t));
-	tbd->tbd_buf_cnt = __constant_cpu_to_le16(1024);
-	/* The value of first 512 bytes is FF */
-	memset((void *) ((u8 *) tbd + sizeof (tbd_t)), 0xFF, 512);
-	/* The value of second 512 bytes is BA */
-	memset((void *) ((u8 *) tbd + sizeof (tbd_t) + 512), 0xBA, 512);
-	wmb();
-	rfd = pci_alloc_consistent(bdp->pdev, sizeof (rfd_t), &dma_handle);
-
-	if (rfd == NULL) {
-		pci_free_consistent(bdp->pdev,
-				    sizeof (tcb_t) + sizeof (tbd_t) +
-				    LB_PACKET_SIZE, tcb, tcb->tcb_phys);
-		return false;
-	}
-
-	memset(rfd, 0x00, sizeof (rfd_t));
-
-	/* init all fields in rfd */
-	rfd->rfd_header.cb_cmd = cpu_to_le16(RFD_EL_BIT);
-	rfd->rfd_sz = cpu_to_le16(ETH_FRAME_LEN + CHKSUM_SIZE);
-	/* dma_handle is physical address of rfd */
-	bdp->loopback.dma_handle = dma_handle;
-	bdp->loopback.tcb = tcb;
-	bdp->loopback.rfd = rfd;
-	wmb();
-	return true;
-}
-
-/**
- * e100_diag_loopback_cu_ru_exec - activates cu and ru to send & receive the pkt
- * @bdp: atapter's private data struct
- *
- */
-static void
-e100_diag_loopback_cu_ru_exec(struct e100_private *bdp)
-{
-	/*load CU & RU base */ 
-	if(!e100_wait_exec_cmplx(bdp, bdp->loopback.dma_handle, SCB_RUC_START, 0))
-		printk(KERN_ERR "e100: SCB_RUC_START failed!\n");
-
-	bdp->next_cu_cmd = START_WAIT;
-	e100_start_cu(bdp, bdp->loopback.tcb);
-	bdp->last_tcb = NULL;
-	rmb();
-}
-/**
- * e100_diag_check_pkt - checks if a given packet is a loopback packet
- * @bdp: atapter's private data struct
- *
- * Returns true if OK false otherwise.
- */
-static u8
-e100_diag_check_pkt(u8 *datap)
-{
-	int i;
-	for (i = 0; i<512; i++) {
-		if( !((*datap)==0xFF && (*(datap + 512) == 0xBA)) ) {
-			printk (KERN_ERR "e100: check loopback packet failed at: %x\n", i);
-			return false;
-			}
-	}
-	printk (KERN_DEBUG "e100: Check received loopback packet OK\n");
-	return true;
-}
-
-/**
- * e100_diag_rcv_loopback_pkt - waits for receive and checks lpbk packet
- * @bdp: atapter's private data struct
- *
- * Returns true if OK false otherwise.
- */
-static u8
-e100_diag_rcv_loopback_pkt(struct e100_private* bdp) 
-{    
-	rfd_t *rfdp;
-	u16 rfd_status;
-	unsigned long expires = jiffies + HZ * 2;
-
-        rfdp =bdp->loopback.rfd;
-
-        rfd_status = le16_to_cpu(rfdp->rfd_header.cb_status);
-
-        while (!(rfd_status & RFD_STATUS_COMPLETE)) { 
-		if (time_before(jiffies, expires)) {
-			yield();
-			rmb();
-			rfd_status = le16_to_cpu(rfdp->rfd_header.cb_status);
-		} else {
-			break;
-		}
-        }
-
-        if (rfd_status & RFD_STATUS_COMPLETE) {
-		printk(KERN_DEBUG "e100: Loopback packet received\n");
-                return e100_diag_check_pkt(((u8 *)rfdp+bdp->rfd_size));
-	}
-	else {
-		printk(KERN_ERR "e100: Loopback packet not received\n");
-		return false;
-	}
-}
-
-/**
- * e100_diag_loopback_free - free data allocated for loopback pkt send/receive
- * @bdp: atapter's private data struct
- *
- */
-static void
-e100_diag_loopback_free (struct e100_private *bdp)
-{
-        pci_free_consistent(bdp->pdev,
-			    sizeof(tcb_t) + sizeof(tbd_t) + LB_PACKET_SIZE,
-			    bdp->loopback.tcb, bdp->loopback.tcb->tcb_phys);
-
-        pci_free_consistent(bdp->pdev, sizeof(rfd_t), bdp->loopback.rfd,
-			    bdp->loopback.dma_handle);
-}
-
-static int
-e100_cable_diag(struct e100_private *bdp)
-{	
-	int saved_open_circut = 0xffff;
-	int saved_short_circut = 0xffff;
-	int saved_distance = 0xffff;
-	int saved_same = 0;
-	int cable_status = E100_CABLE_UNKNOWN;
-	int i;
-	
-	/* If we have link, */	
-	if (e100_get_link_state(bdp))
-		return E100_CABLE_OK;
-	
-	if (bdp->rev_id < D102_REV_ID)
-		return E100_CABLE_UNKNOWN;
-
-	/* Disable MDI/MDI-X auto switching */
-        e100_mdi_write(bdp, MII_NCONFIG, bdp->phy_addr,
-		MDI_MDIX_RESET_ALL_MASK);
-	/* Set to 100 Full as required by cable test */
-	e100_mdi_write(bdp, MII_BMCR, bdp->phy_addr,
-		BMCR_SPEED100 | BMCR_FULLDPLX);
-
-	/* Test up to 100 times */
-	for (i = 0; i < 100; i++) {
-		u16 ctrl_reg;
-		int distance, open_circut, short_circut, near_end;
-
-		/* Enable and execute cable test */
-		e100_mdi_write(bdp, HWI_CONTROL_REG, bdp->phy_addr,
-			(HWI_TEST_ENABLE | HWI_TEST_EXECUTE));
-		/* Wait for cable test finished */
-		set_current_state(TASK_UNINTERRUPTIBLE);
-		schedule_timeout(HZ/100 + 1);
-		/* Read results */
-		e100_mdi_read(bdp, HWI_CONTROL_REG, bdp->phy_addr, &ctrl_reg);
-		distance = ctrl_reg & HWI_TEST_DISTANCE;
-		open_circut = ctrl_reg & HWI_TEST_HIGHZ_PROBLEM;
-		short_circut = ctrl_reg & HWI_TEST_LOWZ_PROBLEM;
-
-		if ((distance == saved_distance) &&
-	    	    (open_circut == saved_open_circut) &&
-	    	    (short_circut == saved_short_circut)) 
-			saved_same++;
-		else {
-			saved_same = 0;
-			saved_distance = distance;
-			saved_open_circut = open_circut;
-			saved_short_circut = short_circut;
-		}
-		/* If results are the same 3 times */
-		if (saved_same == 3) {
-			near_end = ((distance * HWI_REGISTER_GRANULARITY) <
-			       HWI_NEAR_END_BOUNDARY);
-			if (open_circut)
-				cable_status = (near_end) ? 
-					E100_CABLE_OPEN_NEAR : E100_CABLE_OPEN_FAR;
-			if (short_circut)
-				cable_status = (near_end) ?
-					E100_CABLE_SHORT_NEAR : E100_CABLE_SHORT_FAR;
-			break;
-		}
-	}
-	/* Reset cable test */
-        e100_mdi_write(bdp, HWI_CONTROL_REG, bdp->phy_addr,					       HWI_RESET_ALL_MASK);
-	return cable_status;
-}
-
--- diff/drivers/net/e100/e100_ucode.h	2003-05-21 11:49:55.000000000 +0100
+++ source/drivers/net/e100/e100_ucode.h	1970-01-01 01:00:00.000000000 +0100
@@ -1,365 +0,0 @@
-/*******************************************************************************
-
-  
-  Copyright(c) 1999 - 2003 Intel Corporation. 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.
-  
-  The full GNU General Public License is included in this distribution in the
-  file called LICENSE.
-  
-  Contact Information:
-  Linux NICS <linux.nics@intel.com>
-  Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
-*******************************************************************************/
-
-#ifndef _E100_UCODE_H_
-#define _E100_UCODE_H_
-
-/*
-e100_ucode.h
-
-This file contains the loadable micro code arrays to implement receive 
-bundling on the D101 A-step, D101 B-step, D101M (B-step only), D101S, 
-D102 B-step, D102 B-step with TCO work around and D102 C-step.
-
-Each controller has its own specific micro code array.  The array for one 
-controller is totally incompatible with any other controller, and if used 
-will most likely cause the controller to lock up and stop responding to 
-the driver.  Each micro code array has its own parameter offsets (described 
-below), and they each have their own version number.
-*/
-
-/*************************************************************************
-*  CPUSaver parameters
-*
-*  All CPUSaver parameters are 16-bit literals that are part of a
-*  "move immediate value" instruction.  By changing the value of
-*  the literal in the instruction before the code is loaded, the
-*  driver can change algorithm.
-*
-*  CPUSAVER_DWORD - This is the location of the instruction that loads
-*    the dead-man timer with its inital value.  By writing a 16-bit
-*    value to the low word of this instruction, the driver can change
-*    the timer value.  The current default is either x600 or x800;
-*    experiments show that the value probably should stay within the
-*    range of x200 - x1000.
-*
-*  CPUSAVER_BUNDLE_MAX_DWORD - This is the location of the instruction
-*    that sets the maximum number of frames that will be bundled.  In
-*    some situations, such as the TCP windowing algorithm, it may be
-*    better to limit the growth of the bundle size than let it go as
-*    high as it can, because that could cause too much added latency.
-*    The default is six, because this is the number of packets in the
-*    default TCP window size.  A value of 1 would make CPUSaver indicate
-*    an interrupt for every frame received.  If you do not want to put
-*    a limit on the bundle size, set this value to xFFFF.
-*
-*  CPUSAVER_MIN_SIZE_DWORD - This is the location of the instruction
-*    that contains a bit-mask describing the minimum size frame that
-*    will be bundled.  The default masks the lower 7 bits, which means
-*    that any frame less than 128 bytes in length will not be bundled,
-*    but will instead immediately generate an interrupt.  This does
-*    not affect the current bundle in any way.  Any frame that is 128
-*    bytes or large will be bundled normally.  This feature is meant
-*    to provide immediate indication of ACK frames in a TCP environment.
-*    Customers were seeing poor performance when a machine with CPUSaver
-*    enabled was sending but not receiving.  The delay introduced when
-*    the ACKs were received was enough to reduce total throughput, because
-*    the sender would sit idle until the ACK was finally seen.
-*
-*    The current default is 0xFF80, which masks out the lower 7 bits.
-*    This means that any frame which is x7F (127) bytes or smaller
-*    will cause an immediate interrupt.  Because this value must be a 
-*    bit mask, there are only a few valid values that can be used.  To
-*    turn this feature off, the driver can write the value xFFFF to the
-*    lower word of this instruction (in the same way that the other
-*    parameters are used).  Likewise, a value of 0xF800 (2047) would
-*    cause an interrupt to be generated for every frame, because all
-*    standard Ethernet frames are <= 2047 bytes in length.
-*************************************************************************/
-
-#ifndef UCODE_MAX_DWORDS
-#define UCODE_MAX_DWORDS	134
-#endif
-
-/********************************************************/
-/*  CPUSaver micro code for the D101A                   */
-/********************************************************/
-
-/*  Version 2.0  */
-
-/*  This value is the same for both A and B step of 558.  */
-
-#define D101_CPUSAVER_TIMER_DWORD		72
-#define D101_CPUSAVER_BUNDLE_DWORD		UCODE_MAX_DWORDS
-#define D101_CPUSAVER_MIN_SIZE_DWORD		UCODE_MAX_DWORDS
-
-#define     D101_A_RCVBUNDLE_UCODE \
-{\
-0x03B301BB, 0x0046FFFF, 0xFFFFFFFF, 0x051DFFFF, 0xFFFFFFFF, 0xFFFFFFFF, \
-0x000C0001, 0x00101212, 0x000C0008, 0x003801BC, \
-0x00000000, 0x00124818, 0x000C1000, 0x00220809, \
-0x00010200, 0x00124818, 0x000CFFFC, 0x003803B5, \
-0x00000000, 0x00000000, 0x00000000, 0x00000000, \
-0x0010009C, 0x0024B81D, 0x00130836, 0x000C0001, \
-0x0026081C, 0x0020C81B, 0x00130824, 0x00222819, \
-0x00101213, 0x00041000, 0x003A03B3, 0x00010200, \
-0x00101B13, 0x00238081, 0x00213049, 0x0038003B, \
-0x00000000, 0x00000000, 0x00000000, 0x00000000, \
-0x00000000, 0x00000000, 0x00000000, 0x00000000, \
-0x00000000, 0x00000000, 0x00000000, 0x00000000, \
-0x00000000, 0x00000000, 0x00000000, 0x00000000, \
-0x0010009C, 0x0024B83E, 0x00130826, 0x000C0001, \
-0x0026083B, 0x00010200, 0x00134824, 0x000C0001, \
-0x00101213, 0x00041000, 0x0038051E, 0x00101313, \
-0x00010400, 0x00380521, 0x00050600, 0x00100824, \
-0x00101310, 0x00041000, 0x00080600, 0x00101B10, \
-0x0038051E, 0x00000000, 0x00000000, 0x00000000  \
-}
-
-/********************************************************/
-/*  CPUSaver micro code for the D101B                   */
-/********************************************************/
-
-/*  Version 2.0  */
-
-#define     D101_B0_RCVBUNDLE_UCODE \
-{\
-0x03B401BC, 0x0047FFFF, 0xFFFFFFFF, 0x051EFFFF, 0xFFFFFFFF, 0xFFFFFFFF, \
-0x000C0001, 0x00101B92, 0x000C0008, 0x003801BD, \
-0x00000000, 0x00124818, 0x000C1000, 0x00220809, \
-0x00010200, 0x00124818, 0x000CFFFC, 0x003803B6, \
-0x00000000, 0x00000000, 0x00000000, 0x00000000, \
-0x0010009C, 0x0024B81D, 0x0013082F, 0x000C0001, \
-0x0026081C, 0x0020C81B, 0x00130837, 0x00222819, \
-0x00101B93, 0x00041000, 0x003A03B4, 0x00010200, \
-0x00101793, 0x00238082, 0x0021304A, 0x0038003C, \
-0x00000000, 0x00000000, 0x00000000, 0x00000000, \
-0x00000000, 0x00000000, 0x00000000, 0x00000000, \
-0x00000000, 0x00000000, 0x00000000, 0x00000000, \
-0x00000000, 0x00000000, 0x00000000, 0x00000000, \
-0x0010009C, 0x0024B83E, 0x00130826, 0x000C0001, \
-0x0026083B, 0x00010200, 0x00134837, 0x000C0001, \
-0x00101B93, 0x00041000, 0x0038051F, 0x00101313, \
-0x00010400, 0x00380522, 0x00050600, 0x00100837, \
-0x00101310, 0x00041000, 0x00080600, 0x00101790, \
-0x0038051F, 0x00000000, 0x00000000, 0x00000000  \
-}
-
-/********************************************************/
-/*  CPUSaver micro code for the D101M (B-step only)     */
-/********************************************************/
-
-/*  Version 2.10.1  */
-
-/*  Parameter values for the D101M B-step  */
-#define D101M_CPUSAVER_TIMER_DWORD		78
-#define D101M_CPUSAVER_BUNDLE_DWORD		65
-#define D101M_CPUSAVER_MIN_SIZE_DWORD		126
-
-#define D101M_B_RCVBUNDLE_UCODE \
-{\
-0x00550215, 0xFFFF0437, 0xFFFFFFFF, 0x06A70789, 0xFFFFFFFF, 0x0558FFFF, \
-0x000C0001, 0x00101312, 0x000C0008, 0x00380216, \
-0x0010009C, 0x00204056, 0x002380CC, 0x00380056, \
-0x0010009C, 0x00244C0B, 0x00000800, 0x00124818, \
-0x00380438, 0x00000000, 0x00140000, 0x00380555, \
-0x00308000, 0x00100662, 0x00100561, 0x000E0408, \
-0x00134861, 0x000C0002, 0x00103093, 0x00308000, \
-0x00100624, 0x00100561, 0x000E0408, 0x00100861, \
-0x000C007E, 0x00222C21, 0x000C0002, 0x00103093, \
-0x00380C7A, 0x00080000, 0x00103090, 0x00380C7A, \
-0x00000000, 0x00000000, 0x00000000, 0x00000000, \
-0x0010009C, 0x00244C2D, 0x00010004, 0x00041000, \
-0x003A0437, 0x00044010, 0x0038078A, 0x00000000, \
-0x00100099, 0x00206C7A, 0x0010009C, 0x00244C48, \
-0x00130824, 0x000C0001, 0x00101213, 0x00260C75, \
-0x00041000, 0x00010004, 0x00130826, 0x000C0006, \
-0x002206A8, 0x0013C926, 0x00101313, 0x003806A8, \
-0x00000000, 0x00000000, 0x00000000, 0x00000000, \
-0x00000000, 0x00000000, 0x00000000, 0x00000000, \
-0x00080600, 0x00101B10, 0x00050004, 0x00100826, \
-0x00101210, 0x00380C34, 0x00000000, 0x00000000, \
-0x0021155B, 0x00100099, 0x00206559, 0x0010009C, \
-0x00244559, 0x00130836, 0x000C0000, 0x00220C62, \
-0x000C0001, 0x00101B13, 0x00229C0E, 0x00210C0E, \
-0x00226C0E, 0x00216C0E, 0x0022FC0E, 0x00215C0E, \
-0x00214C0E, 0x00380555, 0x00010004, 0x00041000, \
-0x00278C67, 0x00040800, 0x00018100, 0x003A0437, \
-0x00130826, 0x000C0001, 0x00220559, 0x00101313, \
-0x00380559, 0x00000000, 0x00000000, 0x00000000, \
-0x00000000, 0x00000000, 0x00000000, 0x00000000, \
-0x00000000, 0x00130831, 0x0010090B, 0x00124813, \
-0x000CFF80, 0x002606AB, 0x00041000, 0x00010004, \
-0x003806A8, 0x00000000, 0x00000000, 0x00000000, \
-}
-
-/********************************************************/
-/*  CPUSaver micro code for the D101S                   */
-/********************************************************/
-
-/*  Version 1.20.1  */
-
-/*  Parameter values for the D101S  */
-#define D101S_CPUSAVER_TIMER_DWORD		78
-#define D101S_CPUSAVER_BUNDLE_DWORD		67
-#define D101S_CPUSAVER_MIN_SIZE_DWORD		128
-
-#define D101S_RCVBUNDLE_UCODE \
-{\
-0x00550242, 0xFFFF047E, 0xFFFFFFFF, 0x06FF0818, 0xFFFFFFFF, 0x05A6FFFF, \
-0x000C0001, 0x00101312, 0x000C0008, 0x00380243, \
-0x0010009C, 0x00204056, 0x002380D0, 0x00380056, \
-0x0010009C, 0x00244F8B, 0x00000800, 0x00124818, \
-0x0038047F, 0x00000000, 0x00140000, 0x003805A3, \
-0x00308000, 0x00100610, 0x00100561, 0x000E0408, \
-0x00134861, 0x000C0002, 0x00103093, 0x00308000, \
-0x00100624, 0x00100561, 0x000E0408, 0x00100861, \
-0x000C007E, 0x00222FA1, 0x000C0002, 0x00103093, \
-0x00380F90, 0x00080000, 0x00103090, 0x00380F90, \
-0x00000000, 0x00000000, 0x00000000, 0x00000000, \
-0x0010009C, 0x00244FAD, 0x00010004, 0x00041000, \
-0x003A047E, 0x00044010, 0x00380819, 0x00000000, \
-0x00100099, 0x00206FFD, 0x0010009A, 0x0020AFFD, \
-0x0010009C, 0x00244FC8, 0x00130824, 0x000C0001, \
-0x00101213, 0x00260FF7, 0x00041000, 0x00010004, \
-0x00130826, 0x000C0006, 0x00220700, 0x0013C926, \
-0x00101313, 0x00380700, 0x00000000, 0x00000000, \
-0x00000000, 0x00000000, 0x00000000, 0x00000000, \
-0x00080600, 0x00101B10, 0x00050004, 0x00100826, \
-0x00101210, 0x00380FB6, 0x00000000, 0x00000000, \
-0x002115A9, 0x00100099, 0x002065A7, 0x0010009A, \
-0x0020A5A7, 0x0010009C, 0x002445A7, 0x00130836, \
-0x000C0000, 0x00220FE4, 0x000C0001, 0x00101B13, \
-0x00229F8E, 0x00210F8E, 0x00226F8E, 0x00216F8E, \
-0x0022FF8E, 0x00215F8E, 0x00214F8E, 0x003805A3, \
-0x00010004, 0x00041000, 0x00278FE9, 0x00040800, \
-0x00018100, 0x003A047E, 0x00130826, 0x000C0001, \
-0x002205A7, 0x00101313, 0x003805A7, 0x00000000, \
-0x00000000, 0x00000000, 0x00000000, 0x00000000, \
-0x00000000, 0x00000000, 0x00000000, 0x00130831, \
-0x0010090B, 0x00124813, 0x000CFF80, 0x00260703, \
-0x00041000, 0x00010004, 0x00380700  \
-}
-
-/********************************************************/
-/*  CPUSaver micro code for the D102 B-step             */
-/********************************************************/
-
-/*  Version 2.0  */
-/*  Parameter values for the D102 B-step  */
-#define D102_B_CPUSAVER_TIMER_DWORD		82
-#define D102_B_CPUSAVER_BUNDLE_DWORD		106
-#define D102_B_CPUSAVER_MIN_SIZE_DWORD		70
-
-#define     D102_B_RCVBUNDLE_UCODE \
-{\
-0x006F0276, 0x0EF71FFF, 0x0ED30F86, 0x0D250ED9, 0x1FFF1FFF, 0x1FFF04D2, \
-0x00300001, 0x0140D871, 0x00300008, 0x00E00277, \
-0x01406C57, 0x00816073, 0x008700FA, 0x00E00070, \
-0x00000000, 0x00000000, 0x00000000, 0x00000000, \
-0x00000000, 0x00000000, 0x00000000, 0x00000000, \
-0x01406CBA, 0x00807F9A, 0x00901F9A, 0x0024FFFF, \
-0x014B6F6F, 0x0030FFFE, 0x01407172, 0x01496FBA, \
-0x014B6F72, 0x00308000, 0x01406C52, 0x00912EFC, \
-0x00E00EF8, 0x00000000, 0x00000000, 0x00000000, \
-0x00906F8C, 0x00900F8C, 0x00E00F87, 0x00000000, \
-0x00906ED8, 0x01406C55, 0x00E00ED4, 0x00000000, \
-0x01406C51, 0x0080DFC2, 0x01406C52, 0x00815FC2, \
-0x01406C57, 0x00917FCC, 0x00E01FDD, 0x00000000, \
-0x00822D30, 0x01406C51, 0x0080CD26, 0x01406C52, \
-0x00814D26, 0x01406C57, 0x00916D26, 0x014C6FD7, \
-0x00300000, 0x00841FD2, 0x00300001, 0x0140D772, \
-0x00E012B3, 0x014C6F91, 0x0150710B, 0x01496F72, \
-0x0030FF80, 0x00940EDD, 0x00102000, 0x00038400, \
-0x00E00EDA, 0x00000000, 0x00000000, 0x00000000, \
-0x01406C57, 0x00917FE9, 0x00001000, 0x00E01FE9, \
-0x00200600, 0x0140D76F, 0x00138400, 0x01406FD8, \
-0x0140D96F, 0x00E01FDD, 0x00038400, 0x00102000, \
-0x00971FD7, 0x00101000, 0x00050200, 0x00E804D2, \
-0x014C6FD8, 0x00300001, 0x00840D26, 0x0140D872, \
-0x00E00D26, 0x014C6FD9, 0x00300001, 0x0140D972, \
-0x00941FBD, 0x00102000, 0x00038400, 0x014C6FD8, \
-0x00300006, 0x00840EDA, 0x014F71D8, 0x0140D872, \
-0x00E00EDA, 0x01496F50, 0x00E004D3, 0x00000000, \
-}
-
-/********************************************************/
-/*  Micro code for the D102 C-step                      */
-/********************************************************/
-
-/*  Parameter values for the D102 C-step  */
-#define D102_C_CPUSAVER_TIMER_DWORD		46
-#define D102_C_CPUSAVER_BUNDLE_DWORD		74
-#define D102_C_CPUSAVER_MIN_SIZE_DWORD		54
-
-#define     D102_C_RCVBUNDLE_UCODE \
-{ \
-0x00700279, 0x0E6604E2, 0x02BF0CAE, 0x1508150C, 0x15190E5B, 0x0E840F13, \
-0x00E014D8, 0x00000000, 0x00000000, 0x00000000, \
-0x00E014DC, 0x00000000, 0x00000000, 0x00000000, \
-0x00E014F4, 0x00000000, 0x00000000, 0x00000000, \
-0x00000000, 0x00000000, 0x00000000, 0x00000000, \
-0x00E014E0, 0x00000000, 0x00000000, 0x00000000, \
-0x00000000, 0x00000000, 0x00000000, 0x00000000, \
-0x00000000, 0x00000000, 0x00000000, 0x00000000, \
-0x00000000, 0x00000000, 0x00000000, 0x00000000, \
-0x00E014E7, 0x00000000, 0x00000000, 0x00000000, \
-0x00141000, 0x015D6F0D, 0x00E002C0, 0x00000000, \
-0x00200600, 0x00E0150D, 0x00000000, 0x00000000, \
-0x00000000, 0x00000000, 0x00000000, 0x00000000, \
-0x0030FF80, 0x00940E6A, 0x00038200, 0x00102000, \
-0x00E00E67, 0x00000000, 0x00000000, 0x00000000, \
-0x00000000, 0x00000000, 0x00000000, 0x00000000, \
-0x00000000, 0x00000000, 0x00000000, 0x00000000, \
-0x00906E65, 0x00800E60, 0x00E00E5D, 0x00000000, \
-0x00300006, 0x00E0151A, 0x00000000, 0x00000000, \
-0x00906F19, 0x00900F19, 0x00E00F14, 0x00000000, \
-0x00000000, 0x00000000, 0x00000000, 0x00000000, \
-0x01406CBA, 0x00807FDA, 0x00901FDA, 0x0024FFFF, \
-0x014B6F6F, 0x0030FFFE, 0x01407172, 0x01496FBA, \
-0x014B6F72, 0x00308000, 0x01406C52, 0x00912E89, \
-0x00E00E85, 0x00000000, 0x00000000, 0x00000000  \
-}
-
-/********************************************************/
-/*  Micro code for the D102 E-step                      */
-/********************************************************/
-
-/*  Parameter values for the D102 E-step  */
-#define D102_E_CPUSAVER_TIMER_DWORD		42
-#define D102_E_CPUSAVER_BUNDLE_DWORD		54
-#define D102_E_CPUSAVER_MIN_SIZE_DWORD		46
-
-#define     D102_E_RCVBUNDLE_UCODE \
-{\
-0x007D028F, 0x0E4204F9, 0x14ED0C85, 0x14FA14E9, 0x1FFF1FFF, 0x1FFF1FFF, \
-0x00E014B9, 0x00000000, 0x00000000, 0x00000000, \
-0x00E014BD, 0x00000000, 0x00000000, 0x00000000, \
-0x00E014D5, 0x00000000, 0x00000000, 0x00000000, \
-0x00000000, 0x00000000, 0x00000000, 0x00000000, \
-0x00E014C1, 0x00000000, 0x00000000, 0x00000000, \
-0x00000000, 0x00000000, 0x00000000, 0x00000000, \
-0x00000000, 0x00000000, 0x00000000, 0x00000000, \
-0x00000000, 0x00000000, 0x00000000, 0x00000000, \
-0x00E014C8, 0x00000000, 0x00000000, 0x00000000, \
-0x00200600, 0x00E014EE, 0x00000000, 0x00000000, \
-0x0030FF80, 0x00940E46, 0x00038200, 0x00102000, \
-0x00E00E43, 0x00000000, 0x00000000, 0x00000000, \
-0x00300006, 0x00E014FB, 0x00000000, 0x00000000  \
-}
-
-#endif /* _E100_UCODE_H_ */
--- diff/drivers/pci/pool.c	2003-10-09 09:47:34.000000000 +0100
+++ source/drivers/pci/pool.c	1970-01-01 01:00:00.000000000 +0100
@@ -1,404 +0,0 @@
-#include <linux/pci.h>
-#include <linux/slab.h>
-#include <linux/module.h>
-
-/*
- * Pool allocator ... wraps the pci_alloc_consistent page allocator, so
- * small blocks are easily used by drivers for bus mastering controllers.
- * This should probably be sharing the guts of the slab allocator.
- */
-
-struct pci_pool {	/* the pool */
-	struct list_head	page_list;
-	spinlock_t		lock;
-	size_t			blocks_per_page;
-	size_t			size;
-	struct pci_dev		*dev;
-	size_t			allocation;
-	char			name [32];
-	wait_queue_head_t	waitq;
-	struct list_head	pools;
-};
-
-struct pci_page {	/* cacheable header for 'allocation' bytes */
-	struct list_head	page_list;
-	void			*vaddr;
-	dma_addr_t		dma;
-	unsigned		in_use;
-	unsigned long		bitmap [0];
-};
-
-#define	POOL_TIMEOUT_JIFFIES	((100 /* msec */ * HZ) / 1000)
-#define	POOL_POISON_FREED	0xa7	/* !inuse */
-#define	POOL_POISON_ALLOCATED	0xa9	/* !initted */
-
-static DECLARE_MUTEX (pools_lock);
-
-static ssize_t
-show_pools (struct device *dev, char *buf)
-{
-	struct pci_dev		*pdev;
-	unsigned		temp, size;
-	char			*next;
-	struct list_head	*i, *j;
-
-	pdev = container_of (dev, struct pci_dev, dev);
-	next = buf;
-	size = PAGE_SIZE;
-
-	temp = snprintf (next, size, "poolinfo - 0.1\n");
-	size -= temp;
-	next += temp;
-
-	down (&pools_lock);
-	list_for_each (i, &pdev->pools) {
-		struct pci_pool	*pool;
-		unsigned	pages = 0, blocks = 0;
-
-		pool = list_entry (i, struct pci_pool, pools);
-
-		list_for_each (j, &pool->page_list) {
-			struct pci_page	*page;
-
-			page = list_entry (j, struct pci_page, page_list);
-			pages++;
-			blocks += page->in_use;
-		}
-
-		/* per-pool info, no real statistics yet */
-		temp = snprintf (next, size, "%-16s %4u %4Zu %4Zu %2u\n",
-				pool->name,
-				blocks, pages * pool->blocks_per_page,
-				pool->size, pages);
-		size -= temp;
-		next += temp;
-	}
-	up (&pools_lock);
-
-	return PAGE_SIZE - size;
-}
-static DEVICE_ATTR (pools, S_IRUGO, show_pools, NULL);
-
-/**
- * pci_pool_create - Creates a pool of pci consistent memory blocks, for dma.
- * @name: name of pool, for diagnostics
- * @pdev: pci device that will be doing the DMA
- * @size: size of the blocks in this pool.
- * @align: alignment requirement for blocks; must be a power of two
- * @allocation: returned blocks won't cross this boundary (or zero)
- * Context: !in_interrupt()
- *
- * Returns a pci allocation pool with the requested characteristics, or
- * null if one can't be created.  Given one of these pools, pci_pool_alloc()
- * may be used to allocate memory.  Such memory will all have "consistent"
- * DMA mappings, accessible by the device and its driver without using
- * cache flushing primitives.  The actual size of blocks allocated may be
- * larger than requested because of alignment.
- *
- * If allocation is nonzero, objects returned from pci_pool_alloc() won't
- * cross that size boundary.  This is useful for devices which have
- * addressing restrictions on individual DMA transfers, such as not crossing
- * boundaries of 4KBytes.
- */
-struct pci_pool *
-pci_pool_create (const char *name, struct pci_dev *pdev,
-	size_t size, size_t align, size_t allocation)
-{
-	struct pci_pool		*retval;
-
-	if (align == 0)
-		align = 1;
-	if (size == 0)
-		return 0;
-	else if (size < align)
-		size = align;
-	else if ((size % align) != 0) {
-		size += align + 1;
-		size &= ~(align - 1);
-	}
-
-	if (allocation == 0) {
-		if (PAGE_SIZE < size)
-			allocation = size;
-		else
-			allocation = PAGE_SIZE;
-		// FIXME: round up for less fragmentation
-	} else if (allocation < size)
-		return 0;
-
-	if (!(retval = kmalloc (sizeof *retval, SLAB_KERNEL)))
-		return retval;
-
-	strlcpy (retval->name, name, sizeof retval->name);
-
-	retval->dev = pdev;
-
-	INIT_LIST_HEAD (&retval->page_list);
-	spin_lock_init (&retval->lock);
-	retval->size = size;
-	retval->allocation = allocation;
-	retval->blocks_per_page = allocation / size;
-	init_waitqueue_head (&retval->waitq);
-
-	if (pdev) {
-		down (&pools_lock);
-		if (list_empty (&pdev->pools))
-			device_create_file (&pdev->dev, &dev_attr_pools);
-		/* note:  not currently insisting "name" be unique */
-		list_add (&retval->pools, &pdev->pools);
-		up (&pools_lock);
-	} else
-		INIT_LIST_HEAD (&retval->pools);
-
-	return retval;
-}
-
-
-static struct pci_page *
-pool_alloc_page (struct pci_pool *pool, int mem_flags)
-{
-	struct pci_page	*page;
-	int		mapsize;
-
-	mapsize = pool->blocks_per_page;
-	mapsize = (mapsize + BITS_PER_LONG - 1) / BITS_PER_LONG;
-	mapsize *= sizeof (long);
-
-	page = (struct pci_page *) kmalloc (mapsize + sizeof *page, mem_flags);
-	if (!page)
-		return 0;
-	page->vaddr = pci_alloc_consistent (pool->dev,
-					    pool->allocation,
-					    &page->dma);
-	if (page->vaddr) {
-		memset (page->bitmap, 0xff, mapsize);	// bit set == free
-#ifdef	CONFIG_DEBUG_SLAB
-		memset (page->vaddr, POOL_POISON_FREED, pool->allocation);
-#endif
-		list_add (&page->page_list, &pool->page_list);
-		page->in_use = 0;
-	} else {
-		kfree (page);
-		page = 0;
-	}
-	return page;
-}
-
-
-static inline int
-is_page_busy (int blocks, unsigned long *bitmap)
-{
-	while (blocks > 0) {
-		if (*bitmap++ != ~0UL)
-			return 1;
-		blocks -= BITS_PER_LONG;
-	}
-	return 0;
-}
-
-static void
-pool_free_page (struct pci_pool *pool, struct pci_page *page)
-{
-	dma_addr_t	dma = page->dma;
-
-#ifdef	CONFIG_DEBUG_SLAB
-	memset (page->vaddr, POOL_POISON_FREED, pool->allocation);
-#endif
-	pci_free_consistent (pool->dev, pool->allocation, page->vaddr, dma);
-	list_del (&page->page_list);
-	kfree (page);
-}
-
-
-/**
- * pci_pool_destroy - destroys a pool of pci memory blocks.
- * @pool: pci pool that will be destroyed
- * Context: !in_interrupt()
- *
- * Caller guarantees that no more memory from the pool is in use,
- * and that nothing will try to use the pool after this call.
- */
-void
-pci_pool_destroy (struct pci_pool *pool)
-{
-	down (&pools_lock);
-	list_del (&pool->pools);
-	if (pool->dev && list_empty (&pool->dev->pools))
-		device_remove_file (&pool->dev->dev, &dev_attr_pools);
-	up (&pools_lock);
-
-	while (!list_empty (&pool->page_list)) {
-		struct pci_page		*page;
-		page = list_entry (pool->page_list.next,
-				struct pci_page, page_list);
-		if (is_page_busy (pool->blocks_per_page, page->bitmap)) {
-			printk (KERN_ERR "pci_pool_destroy %s/%s, %p busy\n",
-				pool->dev ? pci_name(pool->dev) : NULL,
-				pool->name, page->vaddr);
-			/* leak the still-in-use consistent memory */
-			list_del (&page->page_list);
-			kfree (page);
-		} else
-			pool_free_page (pool, page);
-	}
-
-	kfree (pool);
-}
-
-
-/**
- * pci_pool_alloc - get a block of consistent memory
- * @pool: pci pool that will produce the block
- * @mem_flags: SLAB_KERNEL or SLAB_ATOMIC
- * @handle: pointer to dma address of block
- *
- * This returns the kernel virtual address of a currently unused block,
- * and reports its dma address through the handle.
- * If such a memory block can't be allocated, null is returned.
- */
-void *
-pci_pool_alloc (struct pci_pool *pool, int mem_flags, dma_addr_t *handle)
-{
-	unsigned long		flags;
-	struct list_head	*entry;
-	struct pci_page		*page;
-	int			map, block;
-	size_t			offset;
-	void			*retval;
-
-restart:
-	spin_lock_irqsave (&pool->lock, flags);
-	list_for_each (entry, &pool->page_list) {
-		int		i;
-		page = list_entry (entry, struct pci_page, page_list);
-		/* only cachable accesses here ... */
-		for (map = 0, i = 0;
-				i < pool->blocks_per_page;
-				i += BITS_PER_LONG, map++) {
-			if (page->bitmap [map] == 0)
-				continue;
-			block = ffz (~ page->bitmap [map]);
-			if ((i + block) < pool->blocks_per_page) {
-				clear_bit (block, &page->bitmap [map]);
-				offset = (BITS_PER_LONG * map) + block;
-				offset *= pool->size;
-				goto ready;
-			}
-		}
-	}
-	if (!(page = pool_alloc_page (pool, SLAB_ATOMIC))) {
-		if (mem_flags == SLAB_KERNEL) {
-			DECLARE_WAITQUEUE (wait, current);
-
-			current->state = TASK_INTERRUPTIBLE;
-			add_wait_queue (&pool->waitq, &wait);
-			spin_unlock_irqrestore (&pool->lock, flags);
-
-			schedule_timeout (POOL_TIMEOUT_JIFFIES);
-
-			remove_wait_queue (&pool->waitq, &wait);
-			goto restart;
-		}
-		retval = 0;
-		goto done;
-	}
-
-	clear_bit (0, &page->bitmap [0]);
-	offset = 0;
-ready:
-	page->in_use++;
-	retval = offset + page->vaddr;
-	*handle = offset + page->dma;
-#ifdef	CONFIG_DEBUG_SLAB
-	memset (retval, POOL_POISON_ALLOCATED, pool->size);
-#endif
-done:
-	spin_unlock_irqrestore (&pool->lock, flags);
-	return retval;
-}
-
-
-static struct pci_page *
-pool_find_page (struct pci_pool *pool, dma_addr_t dma)
-{
-	unsigned long		flags;
-	struct list_head	*entry;
-	struct pci_page		*page;
-
-	spin_lock_irqsave (&pool->lock, flags);
-	list_for_each (entry, &pool->page_list) {
-		page = list_entry (entry, struct pci_page, page_list);
-		if (dma < page->dma)
-			continue;
-		if (dma < (page->dma + pool->allocation))
-			goto done;
-	}
-	page = 0;
-done:
-	spin_unlock_irqrestore (&pool->lock, flags);
-	return page;
-}
-
-
-/**
- * pci_pool_free - put block back into pci pool
- * @pool: the pci pool holding the block
- * @vaddr: virtual address of block
- * @dma: dma address of block
- *
- * Caller promises neither device nor driver will again touch this block
- * unless it is first re-allocated.
- */
-void
-pci_pool_free (struct pci_pool *pool, void *vaddr, dma_addr_t dma)
-{
-	struct pci_page		*page;
-	unsigned long		flags;
-	int			map, block;
-
-	if ((page = pool_find_page (pool, dma)) == 0) {
-		printk (KERN_ERR "pci_pool_free %s/%s, %p/%lx (bad dma)\n",
-			pool->dev ? pci_name(pool->dev) : NULL,
-			pool->name, vaddr, (unsigned long) dma);
-		return;
-	}
-
-	block = dma - page->dma;
-	block /= pool->size;
-	map = block / BITS_PER_LONG;
-	block %= BITS_PER_LONG;
-
-#ifdef	CONFIG_DEBUG_SLAB
-	if (((dma - page->dma) + (void *)page->vaddr) != vaddr) {
-		printk (KERN_ERR "pci_pool_free %s/%s, %p (bad vaddr)/%Lx\n",
-			pool->dev ? pci_name(pool->dev) : NULL,
-			pool->name, vaddr, (unsigned long long) dma);
-		return;
-	}
-	if (page->bitmap [map] & (1UL << block)) {
-		printk (KERN_ERR "pci_pool_free %s/%s, dma %Lx already free\n",
-			pool->dev ? pci_name(pool->dev) : NULL,
-			pool->name, (unsigned long long)dma);
-		return;
-	}
-	memset (vaddr, POOL_POISON_FREED, pool->size);
-#endif
-
-	spin_lock_irqsave (&pool->lock, flags);
-	page->in_use--;
-	set_bit (block, &page->bitmap [map]);
-	if (waitqueue_active (&pool->waitq))
-		wake_up (&pool->waitq);
-	/*
-	 * Resist a temptation to do
-	 *    if (!is_page_busy(bpp, page->bitmap)) pool_free_page(pool, page);
-	 * it is not interrupt safe. Better have empty pages hang around.
-	 */
-	spin_unlock_irqrestore (&pool->lock, flags);
-}
-
-
-EXPORT_SYMBOL (pci_pool_create);
-EXPORT_SYMBOL (pci_pool_destroy);
-EXPORT_SYMBOL (pci_pool_alloc);
-EXPORT_SYMBOL (pci_pool_free);
--- diff/drivers/scsi/AM53C974.c	2003-09-17 12:28:09.000000000 +0100
+++ source/drivers/scsi/AM53C974.c	1970-01-01 01:00:00.000000000 +0100
@@ -1,2463 +0,0 @@
-#error Please convert me to Documentation/DMA-mapping.txt
-
-#include <linux/module.h>
-#include <linux/delay.h>
-#include <linux/signal.h>
-#include <linux/sched.h>
-#include <linux/errno.h>
-#include <linux/pci.h>
-#include <linux/string.h>
-#include <linux/blkdev.h>
-#include <linux/init.h>
-#include <linux/spinlock.h>
-
-#include <asm/io.h>
-#include <asm/system.h>
-
-#include "scsi.h"
-#include "hosts.h"
-#include "AM53C974.h"
-
-/* AM53/79C974 (PCscsi) driver release 0.5
-
- * The architecture and much of the code of this device
- * driver was originally developed by Drew Eckhardt for
- * the NCR5380. The following copyrights apply:
- *  For the architecture and all pieces of code which can also be found 
- *    in the NCR5380 device driver:
- *   Copyright 1993, Drew Eckhardt
- *      Visionary Computing 
- *      (Unix and Linux consulting and custom programming)
- *      drew@colorado.edu
- *      +1 (303) 666-5836
- *
- *  The AM53C974_nobios_detect code was originally developed by
- *   Robin Cutshaw (robin@xfree86.org) and is used here in a 
- *   slightly modified form.
- *
- *  PCI detection rewritten by Martin Mares <mj@atrey.karlin.mff.cuni.cz>
- *
- *  For the remaining code:
- *    Copyright 1994, D. Frieauff
- *    EMail: fri@rsx42sun0.dofn.de
- *    Phone: x49-7545-8-2256 , x49-7541-42305
- */
-
-/*
- * $Log: AM53C974.c,v $
- */
-
-#ifdef AM53C974_DEBUG
-#define DEB(x) x
-#ifdef AM53C974_DEBUG_KEYWAIT
-#define KEYWAIT() AM53C974_keywait()
-#else
-#define KEYWAIT()
-#endif
-#ifdef AM53C974_DEBUG_INIT
-#define DEB_INIT(x) x
-#else
-#define DEB_INIT(x)
-#endif
-#ifdef AM53C974_DEBUG_MSG
-#define DEB_MSG(x) x
-#else
-#define DEB_MSG(x)
-#endif
-#ifdef AM53C974_DEB_RESEL
-#define DEB_RESEL(x) x
-#else
-#define DEB_RESEL(x)
-#endif
-#ifdef AM53C974_DEBUG_QUEUE
-#define DEB_QUEUE(x) x
-#define LIST(x,y) {printk("LINE:%d   Adding %p to %p\n", __LINE__, (void*)(x), (void*)(y)); if ((x)==(y)) udelay(5); }
-#define REMOVE(w,x,y,z) {printk("LINE:%d   Removing: %p->%p  %p->%p \n", __LINE__, (void*)(w), (void*)(x), (void*)(y), (void*)(z)); if ((x)==(y)) udelay(5); }
-#else
-#define DEB_QUEUE(x)
-#define LIST(x,y)
-#define REMOVE(w,x,y,z)
-#endif
-#ifdef AM53C974_DEBUG_INFO
-#define DEB_INFO(x) x
-#else
-#define DEB_INFO(x)
-#endif
-#ifdef AM53C974_DEBUG_LINKED
-#define DEB_LINKED(x) x
-#else
-#define DEB_LINKED(x)
-#endif
-#ifdef AM53C974_DEBUG_INTR
-#define DEB_INTR(x) x
-#else
-#define DEB_INTR(x)
-#endif
-#else
-#define DEB_INIT(x)
-#define DEB(x)
-#define DEB_QUEUE(x)
-#define LIST(x,y)
-#define REMOVE(w,x,y,z)
-#define DEB_INFO(x)
-#define DEB_LINKED(x)
-#define DEB_INTR(x)
-#define DEB_MSG(x)
-#define DEB_RESEL(x)
-#define KEYWAIT()
-#endif
-#ifdef AM53C974_DEBUG_ABORT
-#define DEB_ABORT(x) x
-#else
-#define DEB_ABORT(x)
-#endif
-
-#ifdef VERBOSE_AM53C974_DEBUG
-#define VDEB(x) x
-#else
-#define VDEB(x)
-#endif
-
-#define INSIDE(x,l,h) ( ((x) >= (l)) && ((x) <= (h)) )
-
-
-#include <scsi/scsicam.h>
-
-/***************************************************************************************
-* Default setting of the controller's SCSI id. Edit and uncomment this only if your    *
-* BIOS does not correctly initialize the controller's SCSI id.                         *
-* If you don't get a warning during boot, it is correctly initialized.                 *
-****************************************************************************************/
-/* #define AM53C974_SCSI_ID 7 */
-
-/***************************************************************************************
-* Default settings for sync. negotiation enable, transfer rate and sync. offset.       *
-* These settings can be replaced by LILO overrides (append) with the following syntax:          *
-* AM53C974=host-scsi-id, target-scsi-id, max-rate, max-offset                          *
-* Sync. negotiation is disabled by default and will be enabled for those targets which *
-* are specified in the LILO override                                                   *
-****************************************************************************************/
-#define DEFAULT_SYNC_NEGOTIATION_ENABLED 0	/* 0 or 1 */
-#define DEFAULT_RATE			 5	/* MHz, min: 3; max: 10 */
-#define DEFAULT_SYNC_OFFSET		 0	/* bytes, min: 0; max: 15; use 0 for async. mode */
-
-/***************************************************************************************
-* If defined, don't allow targets to disconnect during commands.  This will reduce     *
-* performance, but may be worthwhile if you suspect the driver of corrupting data when *
-* a disconnect happens.                                                                *
-***************************************************************************************/
-#define AM53C974_PROHIBIT_DISCONNECT
-
-/* --------------------- don't edit below here  --------------------- */
-
-#define AM53C974_DRIVER_REVISION_MAJOR 0
-#define AM53C974_DRIVER_REVISION_MINOR 5
-#define SEPARATOR_LINE  \
-"--------------------------------------------------------------------------\n"
-
-/* debug control */
-/* #define AM53C974_DEBUG */
-/* #define AM53C974_DEBUG_MSG */
-/* #define AM53C974_DEBUG_KEYWAIT */
-/* #define AM53C974_DEBUG_INIT */
-/* #define AM53C974_DEBUG_QUEUE */
-/* #define AM53C974_DEBUG_INFO */
-/* #define AM53C974_DEBUG_LINKED */
-/* #define VERBOSE_AM53C974_DEBUG */
-/* #define AM53C974_DEBUG_INTR */
-/* #define AM53C974_DEB_RESEL */
-#define AM53C974_DEBUG_ABORT
-/* #define AM53C974_OPTION_DEBUG_PROBE_ONLY */
-
-/* special options/constants */
-#define DEF_CLK                 40	/* chip clock freq. in MHz */
-#define MIN_PERIOD               4	/* for negotiation: min. number of clocks per cycle */
-#define MAX_PERIOD              13	/* for negotiation: max. number of clocks per cycle */
-#define MAX_OFFSET              15	/* for negotiation: max. offset (0=async) */
-
-#define DEF_SCSI_TIMEOUT        245	/* STIMREG value, 40 Mhz */
-#define DEF_STP                 8	/* STPREG value assuming 5.0 MB/sec, FASTCLK, FASTSCSI */
-#define DEF_SOF_RAD             0	/* REQ/ACK deassertion delay */
-#define DEF_SOF_RAA             0	/* REQ/ACK assertion delay */
-#define DEF_ETM                 0	/* CNTLREG1, ext. timing mode */
-#define DEF_PERE                1	/* CNTLREG1, parity error reporting */
-#define DEF_CLKF                0	/* CLKFREG,  0=40 Mhz */
-#define DEF_ENF                 1	/* CNTLREG2, enable features */
-#define DEF_ADIDCHK             0	/* CNTLREG3, additional ID check */
-#define DEF_FASTSCSI            1	/* CNTLREG3, fast SCSI */
-#define DEF_FASTCLK             1	/* CNTLREG3, fast clocking, 5 MB/sec at 40MHz chip clk */
-#define DEF_GLITCH              1	/* CNTLREG4, glitch eater, 0=12ns, 1=35ns, 2=25ns, 3=off */
-#define DEF_PWD                 0	/* CNTLREG4, reduced power feature */
-#define DEF_RAE                 0	/* CNTLREG4, RAE active negation on REQ, ACK only */
-#define DEF_RADE                1	/* 1CNTLREG4, active negation on REQ, ACK and data */
-
-/*** SCSI block ***/
-#define CTCLREG		    	0x00	/* r      current transf. count, low byte    */
-#define CTCMREG		   	0x04	/* r      current transf. count, middle byte */
-#define CTCHREG		    	0x38	/* r      current transf. count, high byte   */
-#define STCLREG		    	0x00	/* w      start transf. count, low byte      */
-#define STCMREG		    	0x04	/* w      start transf. count, middle byte   */
-#define STCHREG		    	0x38	/* w      start transf. count, high byte     */
-#define FFREG		    	0x08	/* rw     SCSI FIFO reg.                     */
-#define STIMREG		    	0x14	/* w      SCSI timeout reg.                  */
-
-#define SDIDREG		    	0x10	/* w      SCSI destination ID reg.           */
-#define SDIREG_MASK		0x07	/* mask                                      */
-
-#define STPREG		    	0x18	/* w      synchronous transf. period reg.    */
-#define STPREG_STP		0x1F	/* synchr. transfer period                   */
-
-#define CLKFREG		    	0x24	/* w      clock factor reg.                  */
-#define CLKFREG_MASK		0x07	/* mask                                      */
-
-#define CMDREG		    	0x0C	/* rw     SCSI command reg.                  */
-#define CMDREG_DMA         	0x80	/* set DMA mode (set together with opcodes below) */
-#define CMDREG_IT          	0x10	/* information transfer              */
-#define CMDREG_ICCS		0x11	/* initiator command complete steps          */
-#define CMDREG_MA		0x12	/* message accepted                          */
-#define CMDREG_TPB		0x98	/* transfer pad bytes, DMA mode only         */
-#define CMDREG_SATN		0x1A	/* set ATN                                   */
-#define CMDREG_RATN		0x1B	/* reset ATN                                 */
-#define CMDREG_SOAS		0x41	/* select without ATN steps                  */
-#define CMDREG_SAS		0x42	/* select with ATN steps (1 msg byte)        */
-#define CMDREG_SASS		0x43	/* select with ATN and stop steps            */
-#define CMDREG_ESR		0x44	/* enable selection/reselection      */
-#define CMDREG_DSR		0x45	/* disable selection/reselection     */
-#define CMDREG_SA3S		0x46	/* select with ATN 3 steps  (3 msg bytes)  */
-#define CMDREG_NOP		0x00	/* no operation                      */
-#define CMDREG_CFIFO		0x01	/* clear FIFO                                */
-#define CMDREG_RDEV		0x02	/* reset device                      */
-#define CMDREG_RBUS		0x03	/* reset SCSI bus                            */
-
-#define STATREG		    	0x10	/* r      SCSI status reg.                   */
-#define STATREG_INT		0x80	/* SCSI interrupt condition detected         */
-#define STATREG_IOE		0x40	/* SCSI illegal operation error detected   */
-#define STATREG_PE		0x20	/* SCSI parity error detected                */
-#define STATREG_CTZ		0x10	/* CTC reg decremented to zero               */
-#define STATREG_MSG		0x04	/* SCSI MSG phase (latched?)                 */
-#define STATREG_CD		0x02	/* SCSI C/D phase (latched?)                 */
-#define STATREG_IO		0x01	/* SCSI I/O phase (latched?)                 */
-#define STATREG_PHASE           0x07	/* SCSI phase mask                           */
-
-#define INSTREG		    	0x14	/* r      interrupt status reg.              */
-#define INSTREG_SRST		0x80	/* SCSI reset detected                       */
-#define INSTREG_ICMD		0x40	/* SCSI invalid command detected     */
-#define INSTREG_DIS		0x20	/* target disconnected or sel/resel timeout */
-#define INSTREG_SR		0x10	/* device on bus has service request       */
-#define INSTREG_SO		0x08	/* successful operation                      */
-#define INSTREG_RESEL		0x04	/* device reselected as initiator    */
-
-#define ISREG		    	0x18	/* r      internal state reg.                */
-#define ISREG_SOF		0x08	/* synchronous offset flag (act. low)        */
-#define ISREG_IS		0x07	/* status of intermediate op.                */
-#define ISREG_OK_NO_STOP        0x04	/* selection successful                    */
-#define ISREG_OK_STOP           0x01	/* selection successful                    */
-
-#define CFIREG		    	0x1C	/* r      current FIFO/internal state reg.   */
-#define CFIREG_IS		0xE0	/* status of intermediate op.                */
-#define CFIREG_CF		0x1F	/* number of bytes in SCSI FIFO              */
-
-#define SOFREG		    	0x1C	/* w      synchr. offset reg.                */
-#define SOFREG_RAD		0xC0	/* REQ/ACK deassertion delay (sync.)         */
-#define SOFREG_RAA		0x30	/* REQ/ACK assertion delay (sync.)           */
-#define SOFREG_SO		0x0F	/* synch. offset (sync.)             */
-
-#define CNTLREG1	    	0x20	/* rw     control register one               */
-#define CNTLREG1_ETM		0x80	/* set extended timing mode                  */
-#define CNTLREG1_DISR		0x40	/* disable interrupt on SCSI reset           */
-#define CNTLREG1_PERE		0x10	/* enable parity error reporting     */
-#define CNTLREG1_SID		0x07	/* host adapter SCSI ID                      */
-
-#define CNTLREG2	    	0x2C	/* rw     control register two               */
-#define CNTLREG2_ENF		0x40	/* enable features                           */
-
-#define CNTLREG3	    	0x30	/* rw     control register three             */
-#define CNTLREG3_ADIDCHK	0x80	/* additional ID check                       */
-#define CNTLREG3_FASTSCSI	0x10	/* fast SCSI                                 */
-#define CNTLREG3_FASTCLK	0x08	/* fast SCSI clocking                        */
-
-#define CNTLREG4	    	0x34	/* rw     control register four              */
-#define CNTLREG4_GLITCH		0xC0	/* glitch eater                              */
-#define CNTLREG4_PWD		0x20	/* reduced power feature             */
-#define CNTLREG4_RAE		0x08	/* write only, active negot. ctrl.           */
-#define CNTLREG4_RADE		0x04	/* active negot. ctrl.                       */
-#define CNTLREG4_RES		0x10	/* reserved bit, must be 1                   */
-
-/*** DMA block ***/
-#define DMACMD		    	0x40	/* rw     command                            */
-#define DMACMD_DIR		0x80	/* transfer direction (1=read from device) */
-#define DMACMD_INTE_D		0x40	/* DMA transfer interrupt enable     */
-#define DMACMD_INTE_P		0x20	/* page transfer interrupt enable            */
-#define DMACMD_MDL		0x10	/* map to memory descriptor list     */
-#define DMACMD_DIAG		0x04	/* diagnostics, set to 0             */
-#define DMACMD_IDLE 		0x00	/* idle cmd                                  */
-#define DMACMD_BLAST		0x01	/* flush FIFO to memory                      */
-#define DMACMD_ABORT		0x02	/* terminate DMA                     */
-#define DMACMD_START		0x03	/* start DMA                                 */
-
-#define DMASTATUS	      	0x54	/* r      status register                    */
-#define DMASTATUS_BCMPLT	0x20	/* BLAST complete                    */
-#define DMASTATUS_SCSIINT	0x10	/* SCSI interrupt pending            */
-#define DMASTATUS_DONE		0x08	/* DMA transfer terminated                   */
-#define DMASTATUS_ABORT		0x04	/* DMA transfer aborted                      */
-#define DMASTATUS_ERROR		0x02	/* DMA transfer error                        */
-#define DMASTATUS_PWDN		0x02	/* power down indicator                      */
-
-#define DMASTC		    	0x44	/* rw     starting transfer count            */
-#define DMASPA		    	0x48	/* rw     starting physical address          */
-#define DMAWBC		    	0x4C	/* r      working byte counter               */
-#define DMAWAC		    	0x50	/* r      working address counter            */
-#define DMASMDLA	    	0x58	/* rw     starting MDL address               */
-#define DMAWMAC		    	0x5C	/* r      working MDL counter                */
-
-/*** SCSI phases ***/
-#define PHASE_MSGIN             0x07
-#define PHASE_MSGOUT            0x06
-#define PHASE_RES_1             0x05
-#define PHASE_RES_0             0x04
-#define PHASE_STATIN            0x03
-#define PHASE_CMDOUT            0x02
-#define PHASE_DATAIN            0x01
-#define PHASE_DATAOUT           0x00
-
-
-#define AM53C974_local_declare()	unsigned long io_port
-#define AM53C974_setio(instance)	io_port = instance->io_port
-#define AM53C974_read_8(addr)           inb(io_port + (addr))
-#define AM53C974_write_8(addr,x)        outb((x), io_port + (addr))
-#define AM53C974_read_16(addr)          inw(io_port + (addr))
-#define AM53C974_write_16(addr,x)       outw((x), io_port + (addr))
-#define AM53C974_read_32(addr)          inl(io_port + (addr))
-#define AM53C974_write_32(addr,x)       outl((x), io_port + (addr))
-
-#define AM53C974_poll_int()             { do { statreg = AM53C974_read_8(STATREG); } \
-                                             while (!(statreg & STATREG_INT)) ; \
-                                          AM53C974_read_8(INSTREG) ; }	/* clear int */
-#define AM53C974_cfifo()		(AM53C974_read_8(CFIREG) & CFIREG_CF)
-
-/* These are "special" values for the tag parameter passed to AM53C974_select. */
-#define TAG_NEXT	-1	/* Use next free tag */
-#define TAG_NONE	-2	/* Establish I_T_L nexus instead of I_T_L_Q
-				   * even on SCSI-II devices */
-
-/************ LILO overrides *************/
-typedef struct _override_t {
-	int host_scsi_id;	/* SCSI id of the bus controller */
-	int target_scsi_id;	/* SCSI id of target */
-	int max_rate;		/* max. transfer rate */
-	int max_offset;		/* max. sync. offset, 0 = asynchronous */
-} override_t;
-
-
-#ifdef AM53C974_DEBUG
-static void AM53C974_print_phase(struct Scsi_Host *instance);
-static void AM53C974_print_queues(struct Scsi_Host *instance);
-#endif				/* AM53C974_DEBUG */
-static void AM53C974_print(struct Scsi_Host *instance);
-static void AM53C974_keywait(void);
-static __inline__ int AM53C974_pci_detect(Scsi_Host_Template * tpnt);
-static int AM53C974_init(Scsi_Host_Template * tpnt, struct pci_dev *pdev);
-static void AM53C974_config_after_reset(struct Scsi_Host *instance);
-static __inline__ void initialize_SCp(Scsi_Cmnd * cmd);
-static __inline__ void run_main(void);
-static void AM53C974_main(void);
-static void AM53C974_intr(int irq, void *dev_id, struct pt_regs *regs);
-static void do_AM53C974_intr(int irq, void *dev_id, struct pt_regs *regs);
-static void AM53C974_intr_disconnect(struct Scsi_Host *instance);
-static int AM53C974_sync_neg(struct Scsi_Host *instance, int target, unsigned char *msg);
-static __inline__ void AM53C974_set_async(struct Scsi_Host *instance, int target);
-static __inline__ void AM53C974_set_sync(struct Scsi_Host *instance, int target);
-static void AM53C974_information_transfer(struct Scsi_Host *instance,
-			      unsigned char statreg, unsigned char isreg,
-			      unsigned char instreg, unsigned char cfifo,
-					  unsigned char dmastatus);
-static int AM53C974_message(struct Scsi_Host *instance, Scsi_Cmnd * cmd, unsigned char msg);
-static void AM53C974_select(struct Scsi_Host *instance, Scsi_Cmnd * cmd, int tag);
-static void AM53C974_intr_reselect(struct Scsi_Host *instance, unsigned char statreg);
-static __inline__ void AM53C974_transfer_dma(struct Scsi_Host *instance, short dir,
-				       unsigned long length, char *data);
-static void AM53C974_dma_blast(struct Scsi_Host *instance, unsigned char dmastatus,
-			       unsigned char statreg);
-static void AM53C974_intr_bus_reset(struct Scsi_Host *instance);
-
-static struct Scsi_Host *first_instance;
-static Scsi_Host_Template *the_template;
-static struct Scsi_Host *first_host;	/* Head of list of AMD boards */
-static volatile int main_running;
-static int commandline_current;
-override_t overrides[7] =
-{
-	{-1, 0, 0, 0},};	/* LILO overrides */
-
-#ifdef AM53C974_DEBUG
-static int deb_stop = 1;
-
-static struct {
-	unsigned char value;
-	char *name;
-} phases[] = {
-
-	{
-		PHASE_DATAOUT, "DATAOUT"
-	}, {
-		PHASE_DATAIN, "DATAIN"
-	}, {
-		PHASE_CMDOUT, "CMDOUT"
-	},
-	{
-		PHASE_STATIN, "STATIN"
-	}, {
-		PHASE_MSGOUT, "MSGOUT"
-	}, {
-		PHASE_MSGIN, "MSGIN"
-	},
-	{
-		PHASE_RES_0, "RESERVED 0"
-	}, {
-		PHASE_RES_1, "RESERVED 1"
-	}
-};
-
-/************************************************************************** 
- * Function : void AM53C974_print_phase(struct Scsi_Host *instance)
- *
- * Purpose : print the current SCSI phase for debugging purposes
- *
- * Input : instance - which AM53C974
- **************************************************************************/
-static void AM53C974_print_phase(struct Scsi_Host *instance)
-{
-	AM53C974_local_declare();
-	unsigned char statreg, latched;
-	int i;
-	AM53C974_setio(instance);
-
-	latched = (AM53C974_read_8(CNTLREG2)) & CNTLREG2_ENF;
-	statreg = AM53C974_read_8(STATREG);
-	for (i = 0; (phases[i].value != PHASE_RES_1) &&
-	     (phases[i].value != (statreg & STATREG_PHASE)); ++i);
-	if (latched)
-		printk("scsi%d : phase %s, latched at end of last command\n", instance->host_no, phases[i].name);
-	else
-		printk("scsi%d : phase %s, real time\n", instance->host_no, phases[i].name);
-}
-
-/**************************************************************************
- * Function : void AM53C974_print_queues(struct Scsi_Host *instance)
- *
- * Purpose : print commands in the various queues
- *
- * Inputs : instance - which AM53C974
- **************************************************************************/
-static void AM53C974_print_queues(struct Scsi_Host *instance)
-{
-	unsigned long flags;
-	struct AM53C974_hostdata *hostdata = (struct AM53C974_hostdata *) instance->hostdata;
-	Scsi_Cmnd *ptr;
-
-	printk("AM53C974: coroutine is%s running.\n", main_running ? "" : "n't");
-
-	save_flags(flags);
-	cli();
-
-	if (!hostdata->connected) {
-		printk("scsi%d: no currently connected command\n", instance->host_no);
-	} else {
-		print_Scsi_Cmnd((Scsi_Cmnd *) hostdata->connected);
-	}
-	if (!hostdata->sel_cmd) {
-		printk("scsi%d: no currently arbitrating command\n", instance->host_no);
-	} else {
-		print_Scsi_Cmnd((Scsi_Cmnd *) hostdata->sel_cmd);
-	}
-
-	printk("scsi%d: issue_queue ", instance->host_no);
-	if (!hostdata->issue_queue)
-		printk("empty\n");
-	else {
-		printk(":\n");
-		for (ptr = (Scsi_Cmnd *) hostdata->issue_queue; ptr; ptr = (Scsi_Cmnd *) ptr->host_scribble)
-			print_Scsi_Cmnd(ptr);
-	}
-
-	printk("scsi%d: disconnected_queue ", instance->host_no);
-	if (!hostdata->disconnected_queue)
-		printk("empty\n");
-	else {
-		printk(":\n");
-		for (ptr = (Scsi_Cmnd *) hostdata->disconnected_queue; ptr; ptr = (Scsi_Cmnd *) ptr->host_scribble)
-			print_Scsi_Cmnd(ptr);
-	}
-
-	restore_flags(flags);
-}
-
-#endif				/* AM53C974_DEBUG */
-
-/**************************************************************************
- * Function : void AM53C974_print(struct Scsi_Host *instance)
- *
- * Purpose : dump the chip registers for debugging purposes
- *
- * Input : instance - which AM53C974
- **************************************************************************/
-static void AM53C974_print(struct Scsi_Host *instance)
-{
-	AM53C974_local_declare();
-	unsigned long flags;
-	unsigned long ctcreg, dmastc, dmaspa, dmawbc, dmawac;
-	unsigned char cmdreg, statreg, isreg, cfireg, cntlreg[4], dmacmd,
-	 dmastatus;
-	AM53C974_setio(instance);
-
-	save_flags(flags);
-	cli();
-	ctcreg = AM53C974_read_8(CTCHREG) << 16;
-	ctcreg |= AM53C974_read_8(CTCMREG) << 8;
-	ctcreg |= AM53C974_read_8(CTCLREG);
-	cmdreg = AM53C974_read_8(CMDREG);
-	statreg = AM53C974_read_8(STATREG);
-	isreg = AM53C974_read_8(ISREG);
-	cfireg = AM53C974_read_8(CFIREG);
-	cntlreg[0] = AM53C974_read_8(CNTLREG1);
-	cntlreg[1] = AM53C974_read_8(CNTLREG2);
-	cntlreg[2] = AM53C974_read_8(CNTLREG3);
-	cntlreg[3] = AM53C974_read_8(CNTLREG4);
-	dmacmd = AM53C974_read_8(DMACMD);
-	dmastc = AM53C974_read_32(DMASTC);
-	dmaspa = AM53C974_read_32(DMASPA);
-	dmawbc = AM53C974_read_32(DMAWBC);
-	dmawac = AM53C974_read_32(DMAWAC);
-	dmastatus = AM53C974_read_8(DMASTATUS);
-	restore_flags(flags);
-
-	printk("AM53C974 register dump:\n");
-	printk("IO base: 0x%04lx; CTCREG: 0x%04lx; CMDREG: 0x%02x; STATREG: 0x%02x; ISREG: 0x%02x\n",
-	       io_port, ctcreg, cmdreg, statreg, isreg);
-	printk("CFIREG: 0x%02x; CNTLREG1-4: 0x%02x; 0x%02x; 0x%02x; 0x%02x\n",
-	       cfireg, cntlreg[0], cntlreg[1], cntlreg[2], cntlreg[3]);
-	printk("DMACMD: 0x%02x; DMASTC: 0x%04lx; DMASPA: 0x%04lx\n", dmacmd, dmastc, dmaspa);
-	printk("DMAWBC: 0x%04lx; DMAWAC: 0x%04lx; DMASTATUS: 0x%02x\n", dmawbc, dmawac, dmastatus);
-	printk("---------------------------------------------------------\n");
-}
-
-/**************************************************************************
-* Function : void AM53C974_keywait(void)
-*
-* Purpose : wait until a key is pressed, if it was the 'r' key leave singlestep mode;
-*           this function is used for debugging only
-*
-* Input : none
-**************************************************************************/
-static void AM53C974_keywait(void)
-{
-	unsigned long flags;
-#ifdef AM53C974_DEBUG
-	int key;
-
-	if (!deb_stop)
-		return;
-#endif
-
-	save_flags(flags);
-	cli();
-	while ((inb_p(0x64) & 0x01) != 0x01);
-#ifdef AM53C974_DEBUG
-	key = inb(0x60);
-	if (key == 0x93)
-		deb_stop = 0;	/* don't stop if 'r' was pressed */
-#endif
-	restore_flags(flags);
-}
-
-#ifndef MODULE
-/**************************************************************************
-* Function : AM53C974_setup(char *str)
-*
-* Purpose : LILO command line initialization of the overrides array,
-* 
-* Input : str - parameter string.
-*
-* Returns : 1.
-*
-* NOTE : this function needs to be declared as an external function
-*         in init/main.c and included there in the bootsetups list
-***************************************************************************/
-static int AM53C974_setup(char *str)
-{
-	int ints[5];
-
-	get_options(str, ARRAY_SIZE(ints), ints);
-
-	if (ints[0] < 4)
-		printk("AM53C974_setup: wrong number of parameters;\n correct syntax is: AM53C974=host-scsi-id, target-scsi-id, max-rate, max-offset\n");
-	else {
-		if (commandline_current < (sizeof(overrides) / sizeof(override_t))) {
-			if ((ints[1] < 0) || (ints[1] > 7) ||
-			    (ints[2] < 0) || (ints[2] > 7) ||
-			    (ints[1] == ints[2]) ||
-			    (ints[3] < (DEF_CLK / MAX_PERIOD)) || (ints[3] > (DEF_CLK / MIN_PERIOD)) ||
-			    (ints[4] < 0) || (ints[4] > MAX_OFFSET))
-				printk("AM53C974_setup: invalid parameter\n");
-			else {
-				overrides[commandline_current].host_scsi_id = ints[1];
-				overrides[commandline_current].target_scsi_id = ints[2];
-				overrides[commandline_current].max_rate = ints[3];
-				overrides[commandline_current].max_offset = ints[4];
-				commandline_current++;
-			}
-		} else
-			printk("AM53C974_setup: too many overrides\n");
-	}
-
-	return 1;
-}
-__setup("AM53C974=", AM53C974_setup);
-
-#endif /* !MODULE */
-
-/**************************************************************************
-* Function : int AM53C974_pci_detect(Scsi_Host_Template *tpnt)
-*
-* Purpose : detects and initializes AM53C974 SCSI chips with PCI Bios
-*
-* Inputs : tpnt - host template
-* 
-* Returns : number of host adapters detected
-**************************************************************************/
-static int __init AM53C974_pci_detect(Scsi_Host_Template * tpnt)
-{
-	int count = 0;		/* number of boards detected */
-	struct pci_dev *pdev = NULL;
-	unsigned short command;
-
-	while ((pdev = pci_find_device(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_SCSI, pdev))) {
-		if (pci_enable_device(pdev))
-			continue;
-		pci_read_config_word(pdev, PCI_COMMAND, &command);
-
-		/* check whether device is I/O mapped -- should be */
-		if (!(command & PCI_COMMAND_IO))
-			continue;
-
-		pci_set_master (pdev);
-
-		/* everything seems OK now, so initialize */
-		if (AM53C974_init(tpnt, pdev))
-			count++;
-	}
-	return (count);
-}
-
-/**************************************************************************
-* Function : int AM53C974_init(Scsi_Host_Template *tpnt, struct pci_dev *pdev)
-*
-* Purpose : initializes instance and corresponding AM53/79C974 chip,
-*
-* Inputs : tpnt - template, pci_config - PCI configuration,
-* 
-* Returns : 1 on success, 0 on failure.
-* 
-* NOTE: If no override for the controller's SCSI id is given and AM53C974_SCSI_ID 
-*       is not defined we assume that the SCSI address of this controller is correctly
-*       set up by the BIOS (as reflected by contents of register CNTLREG1).
-*       This is the only BIOS assistance we need.
-**************************************************************************/
-static int __init  AM53C974_init(Scsi_Host_Template * tpnt, struct pci_dev *pdev)
-{
-	AM53C974_local_declare();
-	int i, j;
-	struct Scsi_Host *instance, *search;
-	struct AM53C974_hostdata *hostdata;
-
-#ifdef AM53C974_OPTION_DEBUG_PROBE_ONLY
-	printk("AM53C974: probe only enabled, aborting initialization\n");
-	return 0;
-#endif
-
-	instance = scsi_register(tpnt, sizeof(struct AM53C974_hostdata));
-	if (!instance) {
-		printk(KERN_WARNING "AM53C974: Unable to register host, aborting.\n");
-		return 0;
-	}
-	scsi_set_device(instance, &pdev->dev);
-	hostdata = (struct AM53C974_hostdata *) instance->hostdata;
-	instance->base = 0;
-	instance->io_port = pci_resource_start(pdev, 0);
-	instance->irq = pdev->irq;
-	instance->dma_channel = -1;
-	AM53C974_setio(instance);
-
-#ifdef AM53C974_SCSI_ID
-	instance->this_id = AM53C974_SCSI_ID;
-	AM53C974_write_8(CNTLREG1, instance->this_id & CNTLREG1_SID);
-#else
-	instance->this_id = AM53C974_read_8(CNTLREG1) & CNTLREG1_SID;
-	if (instance->this_id != 7)
-		printk("scsi%d: WARNING: unusual hostadapter SCSI id %d; please verify!\n",
-		       instance->host_no, instance->this_id);
-#endif
-
-	for (i = 0; i < sizeof(hostdata->msgout); i++) {
-		hostdata->msgout[i] = NOP;
-		hostdata->last_message[i] = NOP;
-	}
-	for (i = 0; i < 8; i++) {
-		hostdata->busy[i] = 0;
-		hostdata->sync_per[i] = DEF_STP;
-		hostdata->sync_off[i] = 0;
-		hostdata->sync_neg[i] = 0;
-		hostdata->sync_en[i] = DEFAULT_SYNC_NEGOTIATION_ENABLED;
-		hostdata->max_rate[i] = DEFAULT_RATE;
-		hostdata->max_offset[i] = DEFAULT_SYNC_OFFSET;
-	}
-
-/* overwrite defaults by LILO overrides */
-	for (i = 0; i < commandline_current; i++) {
-		if (overrides[i].host_scsi_id == instance->this_id) {
-			j = overrides[i].target_scsi_id;
-			hostdata->sync_en[j] = 1;
-			hostdata->max_rate[j] = overrides[i].max_rate;
-			hostdata->max_offset[j] = overrides[i].max_offset;
-		}
-	}
-
-	hostdata->sel_cmd = NULL;
-	hostdata->connected = NULL;
-	hostdata->issue_queue = NULL;
-	hostdata->disconnected_queue = NULL;
-	hostdata->in_reset = 0;
-	hostdata->aborted = 0;
-	hostdata->selecting = 0;
-	hostdata->disconnecting = 0;
-	hostdata->dma_busy = 0;
-
-	if (!request_region (instance->io_port, 128, "AM53C974")) {
-		printk ("AM53C974 (scsi%d): Could not get IO region %04lx.\n",
-			instance->host_no, instance->io_port);
-		scsi_unregister(instance);
-		return 0;
-	}
-/* Set up an interrupt handler if we aren't already sharing an IRQ with another board */
-	for (search = first_host;
-	     search && (((the_template != NULL) && (search->hostt != the_template)) ||
-		 (search->irq != instance->irq) || (search == instance));
-	     search = search->next);
-	if (!search) {
-		if (request_irq(instance->irq, do_AM53C974_intr, SA_SHIRQ, "AM53C974", instance)) {
-			printk("scsi%d: IRQ%d not free, detaching\n", instance->host_no, instance->irq);
-			scsi_unregister(instance);
-			return 0;
-		}
-	} else {
-		printk("scsi%d: using interrupt handler previously installed for scsi%d\n",
-		       instance->host_no, search->host_no);
-	}
-
-	if (!the_template) {
-		the_template = instance->hostt;
-		first_instance = instance;
-	}
-/* do hard reset */
-	AM53C974_write_8(CMDREG, CMDREG_RDEV);	/* reset device */
-	udelay(5);
-	AM53C974_write_8(CMDREG, CMDREG_NOP);
-	AM53C974_write_8(CNTLREG1, CNTLREG1_DISR | instance->this_id);
-	AM53C974_write_8(CMDREG, CMDREG_RBUS);	/* reset SCSI bus */
-	udelay(10);
-	AM53C974_config_after_reset(instance);
-	mdelay(500);
-	return (1);
-}
-
-/*********************************************************************
-* Function : AM53C974_config_after_reset(struct Scsi_Host *instance) *
-*                                                                    *
-* Purpose : initializes chip registers after reset                   *
-*                                                                    *
-* Inputs : instance - which AM53C974                                 *
-*                                                                    *
-* Returns : nothing                                                  *
-**********************************************************************/
-static void AM53C974_config_after_reset(struct Scsi_Host *instance)
-{
-	AM53C974_local_declare();
-	AM53C974_setio(instance);
-
-/* clear SCSI FIFO */
-	AM53C974_write_8(CMDREG, CMDREG_CFIFO);
-
-/* configure device */
-	AM53C974_write_8(STIMREG, DEF_SCSI_TIMEOUT);
-	AM53C974_write_8(STPREG, DEF_STP & STPREG_STP);
-	AM53C974_write_8(SOFREG, (DEF_SOF_RAD << 6) | (DEF_SOF_RAA << 4));
-	AM53C974_write_8(CLKFREG, DEF_CLKF & CLKFREG_MASK);
-	AM53C974_write_8(CNTLREG1, (DEF_ETM << 7) | CNTLREG1_DISR | (DEF_PERE << 4) | instance->this_id);
-	AM53C974_write_8(CNTLREG2, (DEF_ENF << 6));
-	AM53C974_write_8(CNTLREG3, (DEF_ADIDCHK << 7) | (DEF_FASTSCSI << 4) | (DEF_FASTCLK << 3));
-	AM53C974_write_8(CNTLREG4, (DEF_GLITCH << 6) | (DEF_PWD << 5) | (DEF_RAE << 3) | (DEF_RADE << 2) | CNTLREG4_RES);
-}
-
-/***********************************************************************
-* Function : const char *AM53C974_info(struct Scsi_Host *instance)     *
-*                                                                      *
-* Purpose : return device driver information                           *
-*                                                                      *
-* Inputs : instance - which AM53C974                                   *
-*                                                                      *
-* Returns : info string                                                *
-************************************************************************/
-static const char *AM53C974_info(struct Scsi_Host *instance)
-{
-	static char info[100];
-
-	sprintf(info, "AM53/79C974 PCscsi driver rev. %d.%d; host I/O address: 0x%lx; irq: %d\n",
-	  AM53C974_DRIVER_REVISION_MAJOR, AM53C974_DRIVER_REVISION_MINOR,
-		instance->io_port, instance->irq);
-	return (info);
-}
-
-/**************************************************************************
-* Function : void initialize_SCp(Scsi_Cmnd *cmd)                          *
-*                                                                         *
-* Purpose : initialize the saved data pointers for cmd to point to the    *
-*	    start of the buffer.                                          *                              
-*                                                                         *
-* Inputs : cmd - Scsi_Cmnd structure to have pointers reset.              *
-*                                                                         *
-* Returns : nothing                                                       *
-**************************************************************************/
-static __inline__ void initialize_SCp(Scsi_Cmnd * cmd)
-{
-	if (cmd->use_sg) {
-		cmd->SCp.buffer = (struct scatterlist *) cmd->buffer;
-		cmd->SCp.buffers_residual = cmd->use_sg - 1;
-		cmd->SCp.ptr = (char *) cmd->SCp.buffer->address;
-		cmd->SCp.this_residual = cmd->SCp.buffer->length;
-	} else {
-		cmd->SCp.buffer = NULL;
-		cmd->SCp.buffers_residual = 0;
-		cmd->SCp.ptr = (char *) cmd->request_buffer;
-		cmd->SCp.this_residual = cmd->request_bufflen;
-	}
-}
-
-/**************************************************************************
-* Function : run_main(void)                                               *
-*                                                                         *
-* Purpose : insure that the coroutine is running and will process our     *
-* 	    request.  main_running is checked/set here (in an inline      *
-*           function rather than in AM53C974_main itself to reduce the    *
-*           chances of stack overflow.                                    *
-*                                                                         *
-*                                                                         *
-* Inputs : none                                                           *
-*                                                                         *
-* Returns : nothing                                                       *
-**************************************************************************/
-static __inline__ void run_main(void)
-{
-	unsigned long flags;
-	save_flags(flags);
-	cli();
-	if (!main_running) {
-		/* main_running is cleared in AM53C974_main once it can't do 
-		   more work, and AM53C974_main exits with interrupts disabled. */
-		main_running = 1;
-		AM53C974_main();
-	}
-	restore_flags(flags);
-}
-
-/************************************************************************** 
-* Function : int AM53C974_queue_command(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *))
-*
-* Purpose : writes SCSI command into AM53C974 FIFO 
-*
-* Inputs : cmd - SCSI command, done - function called on completion, with
-*	a pointer to the command descriptor.
-* 
-* Returns : status, see hosts.h for details
-*
-* Side effects : 
-*      cmd is added to the per instance issue_queue, with minor 
-*	twiddling done to the host specific fields of cmd.  If the 
-*	main coroutine is not running, it is restarted.
-**************************************************************************/
-static int AM53C974_queue_command(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *))
-{
-	unsigned long flags;
-	struct Scsi_Host *instance = cmd->device->host;
-	struct AM53C974_hostdata *hostdata = (struct AM53C974_hostdata *) instance->hostdata;
-	Scsi_Cmnd *tmp;
-
-	save_flags(flags);
-	cli();
-	DEB_QUEUE(printk(SEPARATOR_LINE));
-	DEB_QUEUE(printk("scsi%d: AM53C974_queue_command called\n", instance->host_no));
-	DEB_QUEUE(printk("cmd=%02x target=%02x lun=%02x bufflen=%d use_sg = %02x\n",
-			 cmd->cmnd[0], cmd->target, cmd->device->lun, cmd->request_bufflen, cmd->use_sg));
-
-/* We use the host_scribble field as a pointer to the next command in a queue */
-	cmd->host_scribble = NULL;
-	cmd->scsi_done = done;
-	cmd->result = 0;
-	cmd->device->disconnect = 0;
-
-/* Insert the cmd into the issue queue. Note that REQUEST SENSE 
- * commands are added to the head of the queue since any command will
- * clear the contingent allegiance condition that exists and the 
- * sense data is only guaranteed to be valid while the condition exists. */
-	if (!(hostdata->issue_queue) || (cmd->cmnd[0] == REQUEST_SENSE)) {
-		LIST(cmd, hostdata->issue_queue);
-		cmd->host_scribble = (unsigned char *) hostdata->issue_queue;
-		hostdata->issue_queue = cmd;
-	} else {
-		for (tmp = (Scsi_Cmnd *) hostdata->issue_queue; tmp->host_scribble;
-		     tmp = (Scsi_Cmnd *) tmp->host_scribble);
-		LIST(cmd, tmp);
-		tmp->host_scribble = (unsigned char *) cmd;
-	}
-
-	DEB_QUEUE(printk("scsi%d : command added to %s of queue\n", instance->host_no,
-		     (cmd->cmnd[0] == REQUEST_SENSE) ? "head" : "tail"));
-
-/* Run the coroutine if it isn't already running. */
-	run_main();
-	restore_flags(flags);
-	return 0;
-}
-
-/**************************************************************************
- * Function : AM53C974_main (void) 
- *
- * Purpose : AM53C974_main is a coroutine that runs as long as more work can 
- *	be done on the AM53C974 host adapters in a system.  Both 
- *	AM53C974_queue_command() and AM53C974_intr() will try to start it 
- *	in case it is not running.
- * 
- * NOTE : AM53C974_main exits with interrupts *disabled*, the caller should 
- *  reenable them.  This prevents reentrancy and kernel stack overflow.
- **************************************************************************/
-static void AM53C974_main(void)
-{
-	AM53C974_local_declare();
-	unsigned long flags;
-	Scsi_Cmnd *tmp, *prev;
-	struct Scsi_Host *instance;
-	struct AM53C974_hostdata *hostdata;
-	int done;
-
-/* We run (with interrupts disabled) until we're sure that none of 
- * the host adapters have anything that can be done, at which point 
- * we set main_running to 0 and exit. */
-
-	save_flags(flags);
-	cli();		/* Freeze request queues */
-	do {
-		done = 1;
-		for (instance = first_instance; instance && instance->hostt == the_template;
-		     instance = instance->next) {
-			hostdata = (struct AM53C974_hostdata *) instance->hostdata;
-			AM53C974_setio(instance);
-			/* start to select target if we are not connected and not in the 
-			   selection process */
-			if (!hostdata->connected && !hostdata->sel_cmd) {
-				/* Search through the issue_queue for a command destined for a target 
-				   that is not busy. */
-				for (tmp = (Scsi_Cmnd *) hostdata->issue_queue, prev = NULL; tmp;
-				     prev = tmp, tmp = (Scsi_Cmnd *) tmp->host_scribble) {
-					/*  When we find one, remove it from the issue queue. */
-					if (!(hostdata->busy[tmp->device->id] & (1 << tmp->device->lun))) {
-						if (prev) {
-							REMOVE(prev, (Scsi_Cmnd *) (prev->host_scribble), tmp,
-							       (Scsi_Cmnd *) (tmp->host_scribble));
-							prev->host_scribble = tmp->host_scribble;
-						} else {
-							REMOVE(-1, hostdata->issue_queue, tmp, tmp->host_scribble);
-							hostdata->issue_queue = (Scsi_Cmnd *) tmp->host_scribble;
-						}
-						tmp->host_scribble = NULL;
-
-						/* go into selection mode, disable reselection and wait for
-						   SO interrupt which will continue with the selection process */
-						hostdata->selecting = 1;
-						hostdata->sel_cmd = tmp;
-						AM53C974_write_8(CMDREG, CMDREG_DSR);
-						break;
-					}	/* if target/lun is not busy */
-				}	/* for */
-			}
-			/* if (!hostdata->connected) */ 
-			else {
-				DEB(printk("main: connected; cmd = 0x%lx, sel_cmd = 0x%lx\n",
-					   (long) hostdata->connected, (long) hostdata->sel_cmd));
-			}
-		}		/* for instance */
-	} while (!done);
-	main_running = 0;
-	restore_flags(flags);
-}
-
-/************************************************************************
-* Function : AM53C974_intr(int irq, void *dev_id, struct pt_regs *regs) *
-*                                                                       *
-* Purpose : interrupt handler                                           *
-*                                                                       *
-* Inputs : irq - interrupt line, regs - ?                               *
-*                                                                       *
-* Returns : nothing                                                     *
-************************************************************************/
-static void do_AM53C974_intr(int irq, void *dev_id, struct pt_regs *regs)
-{
-	unsigned long flags;
-	struct Scsi_Host *dev = dev_id;
-	
-	spin_lock_irqsave(dev->host_lock, flags);
-	AM53C974_intr(irq, dev_id, regs);
-	spin_unlock_irqrestore(dev->host_lock, flags);
-}
-
-/************************************************************************
-* Function : AM53C974_intr(int irq, void *dev_id, struct pt_regs *regs) *
-*                                                                       *
-* Purpose : interrupt handler                                           *
-*                                                                       *
-* Inputs : irq - interrupt line, regs - ?                               *
-*                                                                       *
-* Returns : nothing                                                     *
-************************************************************************/
-static void AM53C974_intr(int irq, void *dev_id, struct pt_regs *regs)
-{
-	AM53C974_local_declare();
-	struct Scsi_Host *instance;
-	struct AM53C974_hostdata *hostdata;
-	unsigned char cmdreg, dmastatus, statreg, isreg, instreg, cfifo;
-
-/* find AM53C974 hostadapter responsible for this interrupt */
-	for (instance = first_instance; instance; instance = instance->next)
-		if ((instance->irq == irq) && (instance->hostt == the_template))
-			goto FOUND;
-	return;
-
-/* found; now decode and process */
-	FOUND:
-	    hostdata = (struct AM53C974_hostdata *) instance->hostdata;
-	AM53C974_setio(instance);
-	dmastatus = AM53C974_read_8(DMASTATUS);
-
-	DEB_INTR(printk(SEPARATOR_LINE));
-	DEB_INTR(printk("AM53C974 interrupt; dmastatus=0x%02x\n", dmastatus));
-	KEYWAIT();
-
-/*** DMA related interrupts ***/
-	if (hostdata->connected && (dmastatus & (DMASTATUS_ERROR | DMASTATUS_PWDN |
-						 DMASTATUS_ABORT))) {
-		/* DMA error or POWERDOWN */
-		printk("scsi%d: DMA error or powerdown; dmastatus: 0x%02x\n",
-		       instance->host_no, dmastatus);
-#ifdef AM53C974_DEBUG
-		deb_stop = 1;
-#endif
-		panic("scsi%d: cannot recover\n", instance->host_no);
-	}
-	if (hostdata->connected && (dmastatus & DMASTATUS_DONE)) {
-		/* DMA transfer done */
-		unsigned long residual;
-		unsigned long flags;
-		save_flags(flags);
-		cli();
-		if (!(AM53C974_read_8(DMACMD) & DMACMD_DIR)) {
-			do {
-				dmastatus = AM53C974_read_8(DMASTATUS);
-				residual = AM53C974_read_8(CTCLREG) | (AM53C974_read_8(CTCMREG) << 8) |
-				    (AM53C974_read_8(CTCHREG) << 16);
-				residual += AM53C974_read_8(CFIREG) & CFIREG_CF;
-			} while (!(dmastatus & DMASTATUS_SCSIINT) && residual);
-			residual = AM53C974_read_8(CTCLREG) | (AM53C974_read_8(CTCMREG) << 8) |
-			    (AM53C974_read_8(CTCHREG) << 16);
-			residual += AM53C974_read_8(CFIREG) & CFIREG_CF;
-		} else
-			residual = 0;
-		hostdata->connected->SCp.ptr += hostdata->connected->SCp.this_residual - residual;
-		hostdata->connected->SCp.this_residual = residual;
-
-		AM53C974_write_8(DMACMD, DMACMD_IDLE);
-
-		/* if service request missed before, process it now (ugly) */
-		if (hostdata->dma_busy) {
-			hostdata->dma_busy = 0;
-			cmdreg = AM53C974_read_8(CMDREG);
-			statreg = AM53C974_read_8(STATREG);
-			isreg = AM53C974_read_8(ISREG);
-			instreg = AM53C974_read_8(INSTREG);
-			cfifo = AM53C974_cfifo();
-			AM53C974_information_transfer(instance, statreg, isreg, instreg, cfifo,
-						      dmastatus);
-		}
-		restore_flags(flags);
-	}
-	if (!(dmastatus & DMASTATUS_SCSIINT)) {
-		return;
-	}
-/*** SCSI related interrupts ***/
-	cmdreg = AM53C974_read_8(CMDREG);
-	statreg = AM53C974_read_8(STATREG);
-	isreg = AM53C974_read_8(ISREG);
-	instreg = AM53C974_read_8(INSTREG);
-	cfifo = AM53C974_cfifo();
-
-	DEB_INTR(printk("scsi%d: statreg: 0x%02x; isreg: 0x%02x; instreg: 0x%02x; cfifo: 0x%02x\n",
-		     instance->host_no, statreg, isreg, instreg, cfifo));
-
-	if (statreg & STATREG_PE) {
-		/* parity error */
-#ifdef AM53C974_DEBUG
-		deb_stop = 1;
-#endif
-		printk("scsi%d : PARITY error\n", instance->host_no);
-		if (hostdata->connected)
-			hostdata->sync_off[hostdata->connected->device->id] = 0;	/* setup asynchronous transfer */
-		hostdata->aborted = 1;
-	}
-	if (statreg & STATREG_IOE) {
-		/* illegal operation error */
-#ifdef AM53C974_DEBUG
-		deb_stop = 1;
-#endif
-		printk("scsi%d : ILLEGAL OPERATION error\n", instance->host_no);
-		printk("cmdreg:  0x%02x; dmacmd:  0x%02x; statreg: 0x%02x; \n"
-		   "isreg:   0x%02x; instreg: 0x%02x; cfifo:   0x%02x\n",
-		       cmdreg, AM53C974_read_8(DMACMD), statreg, isreg, instreg, cfifo);
-	}
-	if (hostdata->in_reset && (instreg & INSTREG_SRST)) {
-		unsigned long flags;
-		/* RESET INTERRUPT */
-#ifdef AM53C974_DEBUG
-		deb_stop = 1;
-#endif
-		DEB(printk("Bus reset interrupt received\n"));
-		AM53C974_intr_bus_reset(instance);
-		save_flags(flags);
-		cli();
-		if (hostdata->connected) {
-			hostdata->connected->result = DID_RESET << 16;
-			hostdata->connected->scsi_done((Scsi_Cmnd *) hostdata->connected);
-			hostdata->connected = NULL;
-		} else {
-			if (hostdata->sel_cmd) {
-				hostdata->sel_cmd->result = DID_RESET << 16;
-				hostdata->sel_cmd->scsi_done((Scsi_Cmnd *) hostdata->sel_cmd);
-				hostdata->sel_cmd = NULL;
-			}
-		}
-		restore_flags(flags);
-		if (hostdata->in_reset == 1)
-			goto EXIT;
-		else
-			return;
-	}
-	if (instreg & INSTREG_ICMD) {
-		/* INVALID COMMAND INTERRUPT */
-#ifdef AM53C974_DEBUG
-		deb_stop = 1;
-#endif
-		printk("scsi%d: Invalid command interrupt\n", instance->host_no);
-		printk("cmdreg:  0x%02x; dmacmd:  0x%02x; statreg: 0x%02x; dmastatus: 0x%02x; \n"
-		   "isreg:   0x%02x; instreg: 0x%02x; cfifo:   0x%02x\n",
-		       cmdreg, AM53C974_read_8(DMACMD), statreg, dmastatus, isreg, instreg, cfifo);
-		panic("scsi%d: cannot recover\n", instance->host_no);
-	}
-	if (instreg & INSTREG_DIS) {
-		unsigned long flags;
-		/* DISCONNECT INTERRUPT */
-		DEB_INTR(printk("Disconnect interrupt received; "));
-		save_flags(flags);
-		cli();
-		AM53C974_intr_disconnect(instance);
-		restore_flags(flags);
-		goto EXIT;
-	}
-	if (instreg & INSTREG_RESEL) {
-		unsigned long flags;
-		/* RESELECTION INTERRUPT */
-		DEB_INTR(printk("Reselection interrupt received\n"));
-		save_flags(flags);
-		cli();
-		AM53C974_intr_reselect(instance, statreg);
-		restore_flags(flags);
-		goto EXIT;
-	}
-	if (instreg & INSTREG_SO) {
-		DEB_INTR(printk("Successful operation interrupt received\n"));
-		if (hostdata->selecting) {
-			unsigned long flags;
-			DEB_INTR(printk("DSR completed, starting select\n"));
-			save_flags(flags);
-			cli();
-			AM53C974_select(instance, (Scsi_Cmnd *) hostdata->sel_cmd,
-			  (hostdata->sel_cmd->cmnd[0] == REQUEST_SENSE) ?
-					TAG_NONE : TAG_NEXT);
-			hostdata->selecting = 0;
-			AM53C974_set_sync(instance, hostdata->sel_cmd->device->id);
-			restore_flags(flags);
-			return;
-		}
-		if (hostdata->sel_cmd != NULL) {
-			if (((isreg & ISREG_IS) != ISREG_OK_NO_STOP) &&
-			    ((isreg & ISREG_IS) != ISREG_OK_STOP)) {
-				unsigned long flags;
-				/* UNSUCCESSFUL SELECTION */
-				DEB_INTR(printk("unsuccessful selection\n"));
-				save_flags(flags);
-				cli();
-				hostdata->dma_busy = 0;
-				LIST(hostdata->sel_cmd, hostdata->issue_queue);
-				hostdata->sel_cmd->host_scribble = (unsigned char *) hostdata->issue_queue;
-				hostdata->issue_queue = hostdata->sel_cmd;
-				hostdata->sel_cmd = NULL;
-				hostdata->selecting = 0;
-				restore_flags(flags);
-				goto EXIT;
-			} else {
-				unsigned long flags;
-				/* SUCCESSFUL SELECTION */
-				DEB(printk("successful selection; cmd=0x%02lx\n", (long) hostdata->sel_cmd));
-				save_flags(flags);
-				cli();
-				hostdata->dma_busy = 0;
-				hostdata->disconnecting = 0;
-				hostdata->connected = hostdata->sel_cmd;
-				hostdata->sel_cmd = NULL;
-				hostdata->selecting = 0;
-#ifdef SCSI2
-				if (!hostdata->conneted->device->simple_tags)
-#else
-					hostdata->busy[hostdata->connected->device->id] |= (1 << hostdata->connected->device->lun);
-				/* very strange -- use_sg is sometimes nonzero for request sense commands !! */
-				if ((hostdata->connected->cmnd[0] == REQUEST_SENSE) && hostdata->connected->use_sg) {
-					DEB(printk("scsi%d: REQUEST_SENSE command with nonzero use_sg\n", instance->host_no));
-					KEYWAIT();
-					hostdata->connected->use_sg = 0;
-				}
-				initialize_SCp((Scsi_Cmnd *) hostdata->connected);
-				hostdata->connected->SCp.phase = PHASE_CMDOUT;
-				AM53C974_information_transfer(instance, statreg, isreg, instreg, cfifo, dmastatus);
-				restore_flags(flags);
-				return;
-			}
-		} else {
-			unsigned long flags;
-			save_flags(flags);
-			cli();
-			AM53C974_information_transfer(instance, statreg, isreg, instreg, cfifo, dmastatus);
-			restore_flags(flags);
-			return;
-		}
-	}
-	if (instreg & INSTREG_SR) {
-		DEB_INTR(printk("Service request interrupt received, "));
-		if (hostdata->connected) {
-			unsigned long flags;
-			DEB_INTR(printk("calling information_transfer\n"));
-			save_flags(flags);
-			cli();
-			AM53C974_information_transfer(instance, statreg, isreg, instreg, cfifo, dmastatus);
-			restore_flags(flags);
-		} else {
-			printk("scsi%d: weird: service request when no command connected\n", instance->host_no);
-			AM53C974_write_8(CMDREG, CMDREG_CFIFO);
-		}		/* clear FIFO */
-		return;
-	}
-	EXIT:
-	    DEB_INTR(printk("intr: starting main\n"));
-	run_main();
-	DEB_INTR(printk("end of intr\n"));
-}
-
-/************************************************************************** 
-* Function : AM53C974_intr_disconnect(struct Scsi_Host *instance)
-*
-* Purpose : manage target disconnection
-*
-* Inputs : instance -- which AM53C974
-* 
-* Returns : nothing
-**************************************************************************/
-static void AM53C974_intr_disconnect(struct Scsi_Host *instance)
-{
-	AM53C974_local_declare();
-	struct AM53C974_hostdata *hostdata = (struct AM53C974_hostdata *) instance->hostdata;
-	Scsi_Cmnd *cmd;
-	AM53C974_setio(instance);
-
-	if (hostdata->sel_cmd != NULL) {
-		/* normal selection timeout, typical for nonexisting targets */
-		cmd = (Scsi_Cmnd *) hostdata->sel_cmd;
-		DEB_INTR(printk("bad target\n"));
-		cmd->result = DID_BAD_TARGET << 16;
-		goto EXIT_FINISHED;
-	}
-	if (!hostdata->connected) {
-		/* can happen if controller was reset, a device tried to reconnect,
-		   failed and disconnects now */
-		AM53C974_write_8(CMDREG, CMDREG_CFIFO);
-		return;
-	}
-	if (hostdata->disconnecting) {
-		/* target sent disconnect message, so we are prepared */
-		cmd = (Scsi_Cmnd *) hostdata->connected;
-		AM53C974_set_async(instance, cmd->device->id);
-		DEB_INTR(printk("scsi%d : disc. from cmnd %d for ta %d, lun %d\n",
-		instance->host_no, cmd->cmnd[0], cmd->target, cmd->device->lun));
-		if (cmd->device->disconnect) {
-			/* target wants to reselect later */
-			DEB_INTR(printk("ok, re-enabling selection\n"));
-			LIST(cmd, hostdata->disconnected_queue);
-			cmd->host_scribble = (unsigned char *) hostdata->disconnected_queue;
-			hostdata->disconnected_queue = cmd;
-			DEB_QUEUE(printk("scsi%d : command for target %d lun %d this %d was moved from connected to"
-					 "  the disconnected_queue\n", instance->host_no, cmd->target,
-					 cmd->device->lun, hostdata->disconnected_queue->SCp.this_residual));
-			DEB_QUEUE(AM53C974_print_queues(instance));
-			goto EXIT_UNFINISHED;
-		} else {
-			/* target does not want to reselect later, we are really finished */
-#ifdef AM53C974_DEBUG
-			if (cmd->cmnd[0] == REQUEST_SENSE) {
-				int i;
-				printk("Request sense data dump:\n");
-				for (i = 0; i < cmd->request_bufflen; i++) {
-					printk("%02x ", *((char *) (cmd->request_buffer) + i));
-					if (i && !(i % 16))
-						printk("\n");
-				}
-				printk("\n");
-			}
-#endif
-			goto EXIT_FINISHED;
-		}		/* !cmd->device->disconnect */
-	}			/* if (hostdata->disconnecting) */
-	/* no disconnect message received; unexpected disconnection */
-	cmd = (Scsi_Cmnd *) hostdata->connected;
-	if (cmd) {
-#ifdef AM53C974_DEBUG
-		deb_stop = 1;
-#endif
-		AM53C974_set_async(instance, cmd->device->id);
-		printk("scsi%d: Unexpected disconnect; phase: %d; target: %d; this_residual: %d; buffers_residual: %d; message: %d\n",
-		       instance->host_no, cmd->SCp.phase, cmd->device->id, cmd->SCp.this_residual, cmd->SCp.buffers_residual,
-		       cmd->SCp.Message);
-		printk("cmdreg: 0x%02x; statreg: 0x%02x; isreg: 0x%02x; cfifo: 0x%02x\n",
-		       AM53C974_read_8(CMDREG), AM53C974_read_8(STATREG), AM53C974_read_8(ISREG),
-		       AM53C974_read_8(CFIREG) & CFIREG_CF);
-
-		if ((hostdata->last_message[0] == EXTENDED_MESSAGE) &&
-		    (hostdata->last_message[2] == EXTENDED_SDTR)) {
-			/* sync. negotiation was aborted, setup asynchronous transfer with target */
-			hostdata->sync_off[cmd->device->id] = 0;
-		}
-		if (hostdata->aborted || hostdata->msgout[0] == ABORT)
-			cmd->result = DID_ABORT << 16;
-		else
-			cmd->result = DID_ERROR << 16;
-		goto EXIT_FINISHED;
-	}
-	EXIT_FINISHED:
-	    hostdata->aborted = 0;
-	hostdata->msgout[0] = NOP;
-	hostdata->sel_cmd = NULL;
-	hostdata->connected = NULL;
-	hostdata->selecting = 0;
-	hostdata->disconnecting = 0;
-	hostdata->dma_busy = 0;
-	hostdata->busy[cmd->device->id] &= ~(1 << cmd->device->lun);
-	AM53C974_write_8(CMDREG, CMDREG_CFIFO);
-	DEB(printk("disconnect; issue_queue: 0x%lx, disconnected_queue: 0x%lx\n",
-		   (long) hostdata->issue_queue, (long) hostdata->disconnected_queue));
-	cmd->scsi_done(cmd);
-
-	if (!hostdata->selecting) {
-		AM53C974_set_async(instance, cmd->device->id);
-		AM53C974_write_8(CMDREG, CMDREG_ESR);
-	}			/* allow reselect */
-	return;
-
-	EXIT_UNFINISHED:
-	    hostdata->msgout[0] = NOP;
-	hostdata->sel_cmd = NULL;
-	hostdata->connected = NULL;
-	hostdata->aborted = 0;
-	hostdata->selecting = 0;
-	hostdata->disconnecting = 0;
-	hostdata->dma_busy = 0;
-	DEB(printk("disconnect; issue_queue: 0x%lx, disconnected_queue: 0x%lx\n",
-		   (long) hostdata->issue_queue, (long) hostdata->disconnected_queue));
-	if (!hostdata->selecting) {
-		AM53C974_set_async(instance, cmd->device->id);
-		AM53C974_write_8(CMDREG, CMDREG_ESR);
-	}			/* allow reselect */
-	return;
-}
-
-/************************************************************************** 
-* Function : int AM53C974_sync_neg(struct Scsi_Host *instance, int target, unsigned char *msg)
-*
-* Purpose : setup message string for sync. negotiation
-*
-* Inputs : instance -- which AM53C974
-*          target -- which SCSI target to deal with
-*          msg -- input message string
-* 
-* Returns : 0 if parameters accepted or 1 if not accepted
-*
-* Side effects: hostdata is changed
-*
-* Note: we assume here that fastclk is enabled
-**************************************************************************/
-static int AM53C974_sync_neg(struct Scsi_Host *instance, int target, unsigned char *msg)
-{
-	AM53C974_local_declare();
-	struct AM53C974_hostdata *hostdata = (struct AM53C974_hostdata *) instance->hostdata;
-	int period, offset, i, rate, rate_rem;
-	AM53C974_setio(instance);
-
-	period = (DEF_CLK * msg[3] * 8 + 1000) / 2000;
-	if (period < MIN_PERIOD) {
-		period = MIN_PERIOD;
-		hostdata->msgout[3] = period / 4;
-	} else if (period > MAX_PERIOD) {
-		period = MAX_PERIOD;
-		hostdata->msgout[3] = period / 4;
-	} else
-		hostdata->msgout[3] = msg[3];
-	offset = msg[4];
-	if (offset > MAX_OFFSET)
-		offset = MAX_OFFSET;
-	hostdata->msgout[4] = offset;
-	hostdata->sync_per[target] = period;
-	hostdata->sync_off[target] = offset;
-	for (i = 0; i < 3; i++)
-		hostdata->msgout[i] = msg[i];
-	if ((hostdata->msgout[3] != msg[3]) || (msg[4] != offset))
-		return (1);
-
-	rate = DEF_CLK / period;
-	rate_rem = 10 * (DEF_CLK - period * rate) / period;
-
-	if (offset)
-		printk("\ntarget %d: rate=%d.%d Mhz, synchronous, sync offset=%d bytes\n",
-		       target, rate, rate_rem, offset);
-	else
-		printk("\ntarget %d: rate=%d.%d Mhz, asynchronous\n", target, rate, rate_rem);
-
-	return (0);
-}
-
-/************************************************************************** 
-* Function : AM53C974_set_async(struct Scsi_Host *instance, int target)
-*
-* Purpose : put controller into async. mode
-*
-* Inputs : instance -- which AM53C974
-*          target -- which SCSI target to deal with
-* 
-* Returns : nothing
-**************************************************************************/
-static __inline__ void AM53C974_set_async(struct Scsi_Host *instance, int target)
-{
-	AM53C974_local_declare();
-	struct AM53C974_hostdata *hostdata = (struct AM53C974_hostdata *) instance->hostdata;
-	AM53C974_setio(instance);
-
-	AM53C974_write_8(STPREG, hostdata->sync_per[target]);
-	AM53C974_write_8(SOFREG, (DEF_SOF_RAD << 6) | (DEF_SOF_RAA << 4));
-}
-
-/************************************************************************** 
-* Function : AM53C974_set_sync(struct Scsi_Host *instance, int target)
-*
-* Purpose : put controller into sync. mode
-*
-* Inputs : instance -- which AM53C974
-*          target -- which SCSI target to deal with
-* 
-* Returns : nothing
-**************************************************************************/
-static __inline__ void AM53C974_set_sync(struct Scsi_Host *instance, int target)
-{
-	AM53C974_local_declare();
-	struct AM53C974_hostdata *hostdata = (struct AM53C974_hostdata *) instance->hostdata;
-	AM53C974_setio(instance);
-
-	AM53C974_write_8(STPREG, hostdata->sync_per[target]);
-	AM53C974_write_8(SOFREG, (SOFREG_SO & hostdata->sync_off[target]) |
-			 (DEF_SOF_RAD << 6) | (DEF_SOF_RAA << 4));
-}
-
-/***********************************************************************
-* Function : AM53C974_information_transfer(struct Scsi_Host *instance, *
-*                          unsigned char statreg, unsigned char isreg, *
-*                         unsigned char instreg, unsigned char cfifo,  *
-*                         unsigned char dmastatus)                     *
-*                                                                      *
-* Purpose : handle phase changes                                       *
-*                                                                      *
-* Inputs : instance - which AM53C974                                   *
-*          statreg - status register                                     *
-*          isreg - internal state register                             *
-*          instreg - interrupt status register                         *
-*          cfifo - number of bytes in FIFO                             *
-*          dmastatus - dma status register                             *
-*                                                                      *
-* Returns : nothing                                                    *
-************************************************************************/
-static void AM53C974_information_transfer(struct Scsi_Host *instance,
-			      unsigned char statreg, unsigned char isreg,
-			      unsigned char instreg, unsigned char cfifo,
-					  unsigned char dmastatus)
-{
-	AM53C974_local_declare();
-	struct AM53C974_hostdata *hostdata = (struct AM53C974_hostdata *) instance->hostdata;
-	Scsi_Cmnd *cmd = (Scsi_Cmnd *) hostdata->connected;
-	int ret, i, len, residual = -1;
-	AM53C974_setio(instance);
-
-	DEB_INFO(printk(SEPARATOR_LINE));
-	switch (statreg & STATREG_PHASE) {	/* scsi phase */
-		case PHASE_DATAOUT:
-		    DEB_INFO(printk("Dataout phase; cmd=0x%lx, sel_cmd=0x%lx, this_residual=%d, buffers_residual=%d\n",
-				    (long) hostdata->connected, (long) hostdata->sel_cmd, cmd->SCp.this_residual, cmd->SCp.buffers_residual));
-		cmd->SCp.phase = PHASE_DATAOUT;
-		goto PHASE_DATA_IO;
-
-		case PHASE_DATAIN:
-		    DEB_INFO(printk("Datain phase; cmd=0x%lx, sel_cmd=0x%lx, this_residual=%d, buffers_residual=%d\n",
-				    (long) hostdata->connected, (long) hostdata->sel_cmd, cmd->SCp.this_residual, cmd->SCp.buffers_residual));
-		cmd->SCp.phase = PHASE_DATAIN;
-		PHASE_DATA_IO:
-		    if (hostdata->aborted) {
-			AM53C974_write_8(DMACMD, DMACMD_IDLE);
-			AM53C974_write_8(CMDREG, CMDREG_CFIFO);
-			AM53C974_write_8(CMDREG, CMDREG_SATN);
-			return;
-		}
-		if ((!cmd->SCp.this_residual) && cmd->SCp.buffers_residual) {
-			cmd->SCp.buffer++;
-			cmd->SCp.buffers_residual--;
-			cmd->SCp.ptr = (unsigned char *) cmd->SCp.buffer->address;
-			cmd->SCp.this_residual = cmd->SCp.buffer->length;
-		}
-		if (cmd->SCp.this_residual) {
-			if (!(AM53C974_read_8(DMACMD) & DMACMD_START)) {
-				hostdata->dma_busy = 0;
-				AM53C974_transfer_dma(instance, statreg & STATREG_IO,
-				  (unsigned long) cmd->SCp.this_residual,
-						      cmd->SCp.ptr);
-			} else
-				hostdata->dma_busy = 1;
-		}
-		return;
-
-		case PHASE_MSGIN:
-		    DEB_INFO(printk("Message-In phase; cmd=0x%lx, sel_cmd=0x%lx\n",
-		  (long) hostdata->connected, (long) hostdata->sel_cmd));
-		AM53C974_set_async(instance, cmd->device->id);
-		if (cmd->SCp.phase == PHASE_DATAIN)
-			AM53C974_dma_blast(instance, dmastatus, statreg);
-		if ((cmd->SCp.phase == PHASE_DATAOUT) && (AM53C974_read_8(DMACMD) & DMACMD_START)) {
-			AM53C974_write_8(DMACMD, DMACMD_IDLE);
-			residual = cfifo + (AM53C974_read_8(CTCLREG) | (AM53C974_read_8(CTCMREG) << 8) |
-				       (AM53C974_read_8(CTCHREG) << 16));
-			cmd->SCp.ptr += cmd->SCp.this_residual - residual;
-			cmd->SCp.this_residual = residual;
-			if (cfifo) {
-				AM53C974_write_8(CMDREG, CMDREG_CFIFO);
-				cfifo = 0;
-			}
-		}
-		if (cmd->SCp.phase == PHASE_STATIN) {
-			while ((AM53C974_read_8(CFIREG) & CFIREG_CF) < 2);
-			cmd->SCp.Status = AM53C974_read_8(FFREG);
-			cmd->SCp.Message = AM53C974_read_8(FFREG);
-			DEB_INFO(printk("Message-In phase; status=0x%02x, message=0x%02x\n",
-				     cmd->SCp.Status, cmd->SCp.Message));
-			ret = AM53C974_message(instance, cmd, cmd->SCp.Message);
-		} else {
-			if (!cfifo) {
-				AM53C974_write_8(CMDREG, CMDREG_IT);
-				AM53C974_poll_int();
-				cmd->SCp.Message = AM53C974_read_8(FFREG);
-			}
-			ret = AM53C974_message(instance, cmd, cmd->SCp.Message);
-		}
-		cmd->SCp.phase = PHASE_MSGIN;
-		AM53C974_set_sync(instance, cmd->device->id);
-		break;
-		case PHASE_MSGOUT:
-		    DEB_INFO(printk("Message-Out phase; cfifo=%d; msgout[0]=0x%02x\n",
-				    AM53C974_read_8(CFIREG) & CFIREG_CF, hostdata->msgout[0]));
-		AM53C974_write_8(DMACMD, DMACMD_IDLE);
-		AM53C974_set_async(instance, cmd->device->id);
-		for (i = 0; i < sizeof(hostdata->last_message); i++)
-			hostdata->last_message[i] = hostdata->msgout[i];
-		if ((hostdata->msgout[0] == 0) || INSIDE(hostdata->msgout[0], 0x02, 0x1F) ||
-		    INSIDE(hostdata->msgout[0], 0x80, 0xFF))
-			len = 1;
-		else {
-			if (hostdata->msgout[0] == EXTENDED_MESSAGE) {
-#ifdef AM53C974_DEBUG_INFO
-				printk("Extended message dump:\n");
-				for (i = 0; i < hostdata->msgout[1] + 2; i++) {
-					printk("%02x ", hostdata->msgout[i]);
-					if (i && !(i % 16))
-						printk("\n");
-				}
-				printk("\n");
-#endif
-				len = hostdata->msgout[1] + 2;
-			} else
-				len = 2;
-		}
-		for (i = 0; i < len; i++)
-			AM53C974_write_8(FFREG, hostdata->msgout[i]);
-		AM53C974_write_8(CMDREG, CMDREG_IT);
-		cmd->SCp.phase = PHASE_MSGOUT;
-		hostdata->msgout[0] = NOP;
-		AM53C974_set_sync(instance, cmd->device->id);
-		break;
-
-		case PHASE_CMDOUT:
-		    DEB_INFO(printk("Command-Out phase\n"));
-		AM53C974_set_async(instance, cmd->device->id);
-		for (i = 0; i < cmd->cmd_len; i++)
-			AM53C974_write_8(FFREG, cmd->cmnd[i]);
-		AM53C974_write_8(CMDREG, CMDREG_IT);
-		cmd->SCp.phase = PHASE_CMDOUT;
-		AM53C974_set_sync(instance, cmd->device->id);
-		break;
-
-		case PHASE_STATIN:
-		    DEB_INFO(printk("Status phase\n"));
-		if (cmd->SCp.phase == PHASE_DATAIN)
-			AM53C974_dma_blast(instance, dmastatus, statreg);
-		AM53C974_set_async(instance, cmd->device->id);
-		if (cmd->SCp.phase == PHASE_DATAOUT) {
-			unsigned long residual;
-
-			if (AM53C974_read_8(DMACMD) & DMACMD_START) {
-				AM53C974_write_8(DMACMD, DMACMD_IDLE);
-				residual = cfifo + (AM53C974_read_8(CTCLREG) | (AM53C974_read_8(CTCMREG) << 8) |
-				       (AM53C974_read_8(CTCHREG) << 16));
-				cmd->SCp.ptr += cmd->SCp.this_residual - residual;
-				cmd->SCp.this_residual = residual;
-			}
-			if (cfifo) {
-				AM53C974_write_8(CMDREG, CMDREG_CFIFO);
-				cfifo = 0;
-			}
-		}
-		cmd->SCp.phase = PHASE_STATIN;
-		AM53C974_write_8(CMDREG, CMDREG_ICCS);	/* command complete */
-		break;
-
-		case PHASE_RES_0:
-		    case PHASE_RES_1:
-#ifdef AM53C974_DEBUG
-		    deb_stop = 1;
-#endif
-		DEB_INFO(printk("Reserved phase\n"));
-		break;
-	}
-	KEYWAIT();
-}
-
-/******************************************************************************
-* Function : int AM53C974_message(struct Scsi_Host *instance, Scsi_Cmnd *cmd,
-*                                 unsigned char msg)                
-*
-* Purpose : handle SCSI messages
-*
-* Inputs : instance -- which AM53C974
-*          cmd -- SCSI command the message belongs to
-*          msg -- message id byte
-* 
-* Returns : 1 on success, 0 on failure.
-**************************************************************************/
-static int AM53C974_message(struct Scsi_Host *instance, Scsi_Cmnd * cmd,
-			    unsigned char msg)
-{
-	AM53C974_local_declare();
-	static unsigned char extended_msg[10];
-	unsigned char statreg;
-	int len, ret = 0;
-	unsigned char *p;
-#ifdef AM53C974_DEBUG_MSG
-	int j;
-#endif
-	struct AM53C974_hostdata *hostdata = (struct AM53C974_hostdata *) instance->hostdata;
-	AM53C974_setio(instance);
-
-	DEB_MSG(printk(SEPARATOR_LINE));
-
-/* Linking lets us reduce the time required to get the 
- * next command out to the device, hopefully this will
- * mean we don't waste another revolution due to the delays
- * required by ARBITRATION and another SELECTION.
- * In the current implementation proposal, low level drivers
- * merely have to start the next command, pointed to by 
- * next_link, done() is called as with unlinked commands. */
-	switch (msg) {
-#ifdef LINKED
-		case LINKED_CMD_COMPLETE:
-		    case LINKED_FLG_CMD_COMPLETE:
-		/* Accept message by releasing ACK */
-		    DEB_LINKED(printk("scsi%d : target %d lun %d linked command complete.\n",
-			      instance->host_no, cmd->device->id, cmd->device->lun));
-		/* Sanity check : A linked command should only terminate with
-		 * one of these messages if there are more linked commands available. */
-		if (!cmd->next_link) {
-			printk("scsi%d : target %d lun %d linked command complete, no next_link\n"
-			       instance->host_no, cmd->device->id, cmd->device->lun);
-			hostdata->aborted = 1;
-			AM53C974_write_8(CMDREG, CMDREG_SATN);
-			AM53C974_write_8(CMDREG, CMDREG_MA);
-			break;
-		}
-		if (hostdata->aborted) {
-			DEB_ABORT(printk("ATN set for cmnd %d upon reception of LINKED_CMD_COMPLETE or"
-					 "LINKED_FLG_CMD_COMPLETE message\n", cmd->cmnd[0]));
-			AM53C974_write_8(CMDREG, CMDREG_SATN);
-		}
-		AM53C974_write_8(CMDREG, CMDREG_MA);
-
-		initialize_SCp(cmd->next_link);
-		/* The next command is still part of this process */
-		cmd->next_link->tag = cmd->tag;
-		cmd->result = cmd->SCp.Status | (cmd->SCp.Message << 8);
-		DEB_LINKED(printk("scsi%d : target %d lun %d linked request done, calling scsi_done().\n",
-			      instance->host_no, cmd->device->id, cmd->device->lun));
-		cmd->scsi_done(cmd);
-		cmd = hostdata->connected;
-		break;
-
-#endif				/* def LINKED */
-
-		case ABORT:
-		    case COMMAND_COMPLETE:
-		    DEB_MSG(printk("scsi%d: command complete message received; cmd %d for target %d, lun %d\n",
-		instance->host_no, cmd->cmnd[0], cmd->device->id, cmd->device->lun));
-		hostdata->disconnecting = 1;
-		cmd->device->disconnect = 0;
-
-		/* I'm not sure what the correct thing to do here is : 
-
-		 * If the command that just executed is NOT a request 
-		 * sense, the obvious thing to do is to set the result
-		 * code to the values of the stored parameters.
-		 * If it was a REQUEST SENSE command, we need some way 
-		 * to differentiate between the failure code of the original
-		 * and the failure code of the REQUEST sense - the obvious
-		 * case is success, where we fall through and leave the result
-		 * code unchanged.
-		 * 
-		 * The non-obvious place is where the REQUEST SENSE failed  */
-		if (cmd->cmnd[0] != REQUEST_SENSE)
-			cmd->result = cmd->SCp.Status | (cmd->SCp.Message << 8);
-		else if (cmd->SCp.Status != GOOD)
-			cmd->result = (cmd->result & 0x00ffff) | (DID_ERROR << 16);
-		if (hostdata->aborted) {
-			AM53C974_write_8(CMDREG, CMDREG_SATN);
-			AM53C974_write_8(CMDREG, CMDREG_MA);
-			DEB_ABORT(printk("ATN set for cmnd %d upon reception of ABORT or"
-			    "COMMAND_COMPLETE message\n", cmd->cmnd[0]));
-			break;
-		}
-		if ((cmd->cmnd[0] != REQUEST_SENSE) && (cmd->SCp.Status == CHECK_CONDITION)) {
-			DEB_MSG(printk("scsi%d : performing request sense\n", instance->host_no));
-			cmd->cmnd[0] = REQUEST_SENSE;
-			cmd->cmnd[1] &= 0xe0;
-			cmd->cmnd[2] = 0;
-			cmd->cmnd[3] = 0;
-			cmd->cmnd[4] = sizeof(cmd->sense_buffer);
-			cmd->cmnd[5] = 0;
-			cmd->SCp.buffer = NULL;
-			cmd->SCp.buffers_residual = 0;
-			cmd->SCp.ptr = (char *) cmd->sense_buffer;
-			cmd->SCp.this_residual = sizeof(cmd->sense_buffer);
-			LIST(cmd, hostdata->issue_queue);
-			cmd->host_scribble = (unsigned char *) hostdata->issue_queue;
-			hostdata->issue_queue = (Scsi_Cmnd *) cmd;
-			DEB_MSG(printk("scsi%d : REQUEST SENSE added to head of issue queue\n", instance->host_no));
-		}
-		/* Accept message by clearing ACK */
-		AM53C974_write_8(CMDREG, CMDREG_MA);
-		break;
-
-		case MESSAGE_REJECT:
-		    DEB_MSG(printk("scsi%d: reject message received; cmd %d for target %d, lun %d\n",
-		instance->host_no, cmd->cmnd[0], cmd->device->id, cmd->device->lun));
-		switch (hostdata->last_message[0]) {
-			case EXTENDED_MESSAGE:
-			    if (hostdata->last_message[2] == EXTENDED_SDTR) {
-				/* sync. negotiation was rejected, setup asynchronous transfer with target */
-				printk("\ntarget %d: rate=%d Mhz, asynchronous (sync. negotiation rejected)\n",
-				       cmd->device->id, DEF_CLK / DEF_STP);
-				hostdata->sync_off[cmd->device->id] = 0;
-				hostdata->sync_per[cmd->device->id] = DEF_STP;
-			}
-			break;
-			case HEAD_OF_QUEUE_TAG:
-			    case ORDERED_QUEUE_TAG:
-			    case SIMPLE_QUEUE_TAG:
-			    cmd->device->simple_tags = 0;
-			hostdata->busy[cmd->device->id] |= (1 << cmd->device->lun);
-			break;
-			default:
-			    break;
-		}
-		if (hostdata->aborted)
-			AM53C974_write_8(CMDREG, CMDREG_SATN);
-		AM53C974_write_8(CMDREG, CMDREG_MA);
-		break;
-
-		case DISCONNECT:
-		    DEB_MSG(printk("scsi%d: disconnect message received; cmd %d for target %d, lun %d\n",
-		instance->host_no, cmd->cmnd[0], cmd->device->id, cmd->device->lun));
-		cmd->device->disconnect = 1;
-		hostdata->disconnecting = 1;
-		AM53C974_write_8(CMDREG, CMDREG_MA);	/* Accept message by clearing ACK */
-		break;
-
-		case SAVE_POINTERS:
-		    case RESTORE_POINTERS:
-		    DEB_MSG(printk("scsi%d: save/restore pointers message received; cmd %d for target %d, lun %d\n",
-		instance->host_no, cmd->cmnd[0], cmd->device->id, cmd->device->lun));
-		/* The SCSI data pointer is *IMPLICITLY* saved on a disconnect
-		 * operation, in violation of the SCSI spec so we can safely 
-		 * ignore SAVE/RESTORE pointers calls.
-		 *
-		 * Unfortunately, some disks violate the SCSI spec and 
-		 * don't issue the required SAVE_POINTERS message before
-		 * disconnecting, and we have to break spec to remain 
-		 * compatible. */
-		if (hostdata->aborted) {
-			DEB_ABORT(printk("ATN set for cmnd %d upon reception of SAVE/REST. POINTERS message\n",
-					 cmd->cmnd[0]));
-			AM53C974_write_8(CMDREG, CMDREG_SATN);
-		}
-		AM53C974_write_8(CMDREG, CMDREG_MA);
-		break;
-
-		case EXTENDED_MESSAGE:
-		    DEB_MSG(printk("scsi%d: extended message received; cmd %d for target %d, lun %d\n",
-		instance->host_no, cmd->cmnd[0], cmd->device->id, cmd->device->lun));
-		/* Extended messages are sent in the following format :
-		 * Byte    
-		 * 0           EXTENDED_MESSAGE == 1
-		 * 1           length (includes one byte for code, doesn't include first two bytes)
-		 * 2           code
-		 * 3..length+1 arguments
-		 */
-		/* BEWARE!! THIS CODE IS EXTREMELY UGLY */
-		extended_msg[0] = EXTENDED_MESSAGE;
-		AM53C974_read_8(INSTREG);	/* clear int */
-		AM53C974_write_8(CMDREG, CMDREG_MA);	/* ack. msg byte, then wait for SO */
-		AM53C974_poll_int();
-		/* get length */
-		AM53C974_write_8(CMDREG, CMDREG_IT);
-		AM53C974_poll_int();
-		AM53C974_write_8(CMDREG, CMDREG_MA);	/* ack. msg byte, then wait for SO */
-		AM53C974_poll_int();
-		extended_msg[1] = len = AM53C974_read_8(FFREG);		/* get length */
-		p = extended_msg + 2;
-		/* read the remaining (len) bytes */
-		while (len) {
-			AM53C974_write_8(CMDREG, CMDREG_IT);
-			AM53C974_poll_int();
-			if (len > 1) {
-				AM53C974_write_8(CMDREG, CMDREG_MA);	/* ack. msg byte, then wait for SO */
-				AM53C974_poll_int();
-			}
-			*p = AM53C974_read_8(FFREG);
-			p++;
-			len--;
-		}
-
-#ifdef AM53C974_DEBUG_MSG
-		printk("scsi%d: received extended message: ", instance->host_no);
-		for (j = 0; j < extended_msg[1] + 2; j++) {
-			printk("0x%02x ", extended_msg[j]);
-			if (j && !(j % 16))
-				printk("\n");
-		}
-		printk("\n");
-#endif
-
-		/* check message */
-		if (extended_msg[2] == EXTENDED_SDTR)
-			ret = AM53C974_sync_neg(instance, cmd->device->id, extended_msg);
-		if (ret || hostdata->aborted)
-			AM53C974_write_8(CMDREG, CMDREG_SATN);
-
-		AM53C974_write_8(CMDREG, CMDREG_MA);
-		break;
-
-		default:
-		    printk("scsi%d: unknown message 0x%02x received\n", instance->host_no, msg);
-#ifdef AM53C974_DEBUG
-		deb_stop = 1;
-#endif
-		/* reject message */
-		hostdata->msgout[0] = MESSAGE_REJECT;
-		AM53C974_write_8(CMDREG, CMDREG_SATN);
-		AM53C974_write_8(CMDREG, CMDREG_MA);
-		return (0);
-		break;
-
-	}			/* switch (msg) */
-	KEYWAIT();
-	return (1);
-}
-
-/************************************************************************** 
-* Function : AM53C974_select(struct Scsi_Host *instance, Scsi_Cmnd *cmd, int tag)
-*
-* Purpose : try to establish nexus for the command;
-*           start sync negotiation via start stop and transfer the command in 
-*           cmdout phase in case of an inquiry or req. sense command with no 
-*           sync. neg. performed yet
-*
-* Inputs : instance -- which AM53C974
-*          cmd -- command which requires the selection
-*          tag -- tagged queueing
-* 
-* Returns : nothing
-*        
-* Note: this function initializes the selection process, which is continued 
-*       in the interrupt handler
-**************************************************************************/
-static void AM53C974_select(struct Scsi_Host *instance, Scsi_Cmnd * cmd, int tag)
-{
-	AM53C974_local_declare();
-	struct AM53C974_hostdata *hostdata = (struct AM53C974_hostdata *) instance->hostdata;
-	unsigned char cfifo, tmp[3];
-	unsigned int i, len, cmd_size = COMMAND_SIZE(cmd->cmnd[0]);
-	AM53C974_setio(instance);
-
-	cfifo = AM53C974_cfifo();
-	if (cfifo) {
-		printk("scsi%d: select error; %d residual bytes in FIFO\n", instance->host_no, cfifo);
-		AM53C974_write_8(CMDREG, CMDREG_CFIFO);		/* clear FIFO */
-	}
-#ifdef AM53C974_PROHIBIT_DISCONNECT
-	tmp[0] = IDENTIFY(0, cmd->device->lun);
-#else
-	tmp[0] = IDENTIFY(1, cmd->device->lun);
-#endif
-
-#ifdef SCSI2
-	if (cmd->device->simple_tags && (tag != TAG_NONE)) {
-		tmp[1] = SIMPLE_QUEUE_TAG;
-		if (tag == TAG_NEXT) {
-			/* 0 is TAG_NONE, used to imply no tag for this command */
-			if (cmd->device->current_tag == 0)
-				cmd->device->current_tag = 1;
-			cmd->tag = cmd->device->current_tag;
-			cmd->device->current_tag++;
-		} else
-			cmd->tag = (unsigned char) tag;
-		tmp[2] = cmd->tag;
-		hostdata->last_message[0] = SIMPLE_QUEUE_TAG;
-		len = 3;
-		AM53C974_write_8(FFREG, tmp[0]);
-		AM53C974_write_8(FFREG, tmp[1]);
-		AM53C974_write_8(FFREG, tmp[2]);
-	} else
-#endif				/* def SCSI2 */
-	{
-		len = 1;
-		AM53C974_write_8(FFREG, tmp[0]);
-		cmd->tag = 0;
-	}
-
-/* in case of an inquiry or req. sense command with no sync. neg performed yet, we start
-   sync negotiation via start stops and transfer the command in cmdout phase */
-	if (((cmd->cmnd[0] == INQUIRY) || (cmd->cmnd[0] == REQUEST_SENSE)) &&
-	    !(hostdata->sync_neg[cmd->device->id]) && hostdata->sync_en[cmd->device->id]) {
-		hostdata->sync_neg[cmd->device->id] = 1;
-		hostdata->msgout[0] = EXTENDED_MESSAGE;
-		hostdata->msgout[1] = 3;
-		hostdata->msgout[2] = EXTENDED_SDTR;
-		hostdata->msgout[3] = 250 / (int) hostdata->max_rate[cmd->device->id];
-		hostdata->msgout[4] = hostdata->max_offset[cmd->device->id];
-		len += 5;
-	}
-	AM53C974_write_8(SDIDREG, SDIREG_MASK & cmd->device->id);	/* setup dest. id  */
-	AM53C974_write_8(STIMREG, DEF_SCSI_TIMEOUT);	/* setup timeout reg */
-	switch (len) {
-	case 1:
-		for (i = 0; i < cmd_size; i++)
-			AM53C974_write_8(FFREG, cmd->cmnd[i]);
-		AM53C974_write_8(CMDREG, CMDREG_SAS);	/* select with ATN, 1 msg byte */
-		hostdata->msgout[0] = NOP;
-		break;
-	case 3:
-		for (i = 0; i < cmd_size; i++)
-			AM53C974_write_8(FFREG, cmd->cmnd[i]);
-		AM53C974_write_8(CMDREG, CMDREG_SA3S);	/* select with ATN, 3 msg bytes */
-		hostdata->msgout[0] = NOP;
-		break;
-		default:
-		    AM53C974_write_8(CMDREG, CMDREG_SASS);	/* select with ATN, stop steps; continue in message out phase */
-		break;
-	}
-}
-
-/************************************************************************** 
-* Function : AM53C974_intr_select(struct Scsi_Host *instance, unsigned char statreg)
-*
-* Purpose : handle reselection 
-*
-* Inputs : instance -- which AM53C974
-*          statreg -- status register
-* 
-* Returns : nothing
-*
-* side effects: manipulates hostdata
-**************************************************************************/
-static void AM53C974_intr_reselect(struct Scsi_Host *instance, unsigned char statreg)
-{
-	AM53C974_local_declare();
-	struct AM53C974_hostdata *hostdata = (struct AM53C974_hostdata *) instance->hostdata;
-	unsigned char cfifo, msg[3], lun, t, target = 0;
-#ifdef SCSI2
-	unsigned char tag;
-#endif
-	Scsi_Cmnd *tmp = NULL, *prev;
-	AM53C974_setio(instance);
-
-	cfifo = AM53C974_cfifo();
-
-	if (hostdata->selecting) {
-		/* caught reselect interrupt in selection process;
-		   put selecting command back into the issue queue and continue with the
-		   reselecting command */
-		DEB_RESEL(printk("AM53C974_intr_reselect: in selection process\n"));
-		LIST(hostdata->sel_cmd, hostdata->issue_queue);
-		hostdata->sel_cmd->host_scribble = (unsigned char *) hostdata->issue_queue;
-		hostdata->issue_queue = hostdata->sel_cmd;
-		hostdata->sel_cmd = NULL;
-		hostdata->selecting = 0;
-	}
-/* 2 bytes must be in the FIFO now */
-	if (cfifo != 2) {
-		printk("scsi %d: error: %d bytes in fifo, 2 expected\n", instance->host_no, cfifo);
-		hostdata->aborted = 1;
-		goto EXIT_ABORT;
-	}
-/* determine target which reselected */
-	t = AM53C974_read_8(FFREG);
-	if (!(t & (1 << instance->this_id))) {
-		printk("scsi %d: error: invalid host id\n", instance->host_no);
-		hostdata->aborted = 1;
-		goto EXIT_ABORT;
-	}
-	t ^= (1 << instance->this_id);
-	target = 0;
-	while (t != 1) {
-		t >>= 1;
-		target++;
-	}
-	DEB_RESEL(printk("scsi %d: reselect; target: %d\n", instance->host_no, target));
-
-	if (hostdata->aborted)
-		goto EXIT_ABORT;
-
-	if ((statreg & STATREG_PHASE) != PHASE_MSGIN) {
-		printk("scsi %d: error: upon reselection interrupt not in MSGIN\n", instance->host_no);
-		hostdata->aborted = 1;
-		goto EXIT_ABORT;
-	}
-	msg[0] = AM53C974_read_8(FFREG);
-	if (!(msg[0] & 0x80)) {
-		printk("scsi%d: error: expecting IDENTIFY message, got ", instance->host_no);
-		print_msg(msg);
-		hostdata->aborted = 1;
-		goto EXIT_ABORT;
-	}
-	lun = (msg[0] & 0x07);
-
-/* We need to add code for SCSI-II to track which devices have
- * I_T_L_Q nexuses established, and which have simple I_T_L
- * nexuses so we can chose to do additional data transfer. */
-#ifdef SCSI2
-#error "SCSI-II tagged queueing is not supported yet"
-#endif
-
-/* Find the command corresponding to the I_T_L or I_T_L_Q  nexus we 
- * just reestablished, and remove it from the disconnected queue. */
-	for (tmp = (Scsi_Cmnd *) hostdata->disconnected_queue, prev = NULL;
-	     tmp; prev = tmp, tmp = (Scsi_Cmnd *) tmp->host_scribble)
-		if ((target == tmp->device->id) && (lun == tmp->device->lun)
-#ifdef SCSI2
-		    && (tag == tmp->tag)
-#endif
-		    ) {
-			if (prev) {
-				REMOVE(prev, (Scsi_Cmnd *) (prev->host_scribble), tmp,
-				     (Scsi_Cmnd *) (tmp->host_scribble));
-				prev->host_scribble = tmp->host_scribble;
-			} else {
-				REMOVE(-1, hostdata->disconnected_queue, tmp, tmp->host_scribble);
-				hostdata->disconnected_queue = (Scsi_Cmnd *) tmp->host_scribble;
-			}
-			tmp->host_scribble = NULL;
-			hostdata->connected = tmp;
-			break;
-		}
-	if (!tmp) {
-#ifdef SCSI2
-		printk("scsi%d: warning : target %d lun %d tag %d not in disconnect_queue.\n",
-		       instance->host_no, target, lun, tag);
-#else
-		printk("scsi%d: warning : target %d lun %d not in disconnect_queue.\n",
-		       instance->host_no, target, lun);
-#endif
-		/* Since we have an established nexus that we can't do anything with, we must abort it. */
-		hostdata->aborted = 1;
-		DEB(AM53C974_keywait());
-		goto EXIT_ABORT;
-	} else
-		goto EXIT_OK;
-
-	EXIT_ABORT:
-	    AM53C974_write_8(CMDREG, CMDREG_SATN);
-	AM53C974_write_8(CMDREG, CMDREG_MA);
-	return;
-
-	EXIT_OK:
-	    DEB_RESEL(printk("scsi%d: nexus established, target = %d, lun = %d, tag = %d\n",
-			 instance->host_no, target, tmp->lun, tmp->tag));
-	AM53C974_set_sync(instance, target);
-	AM53C974_write_8(SDIDREG, SDIREG_MASK & target);	/* setup dest. id  */
-	AM53C974_write_8(CMDREG, CMDREG_MA);
-	hostdata->dma_busy = 0;
-	hostdata->connected->SCp.phase = PHASE_CMDOUT;
-}
-
-/************************************************************************** 
-* Function : AM53C974_transfer_dma(struct Scsi_Host *instance, short dir,
-*                                  unsigned long length, char *data)
-*
-* Purpose : setup DMA transfer
-*
-* Inputs : instance -- which AM53C974
-*          dir -- direction flag, 0: write to device, read from memory; 
-*                                 1: read from device, write to memory
-*          length -- number of bytes to transfer to from buffer
-*          data -- pointer to data buffer
-* 
-* Returns : nothing
-**************************************************************************/
-static __inline__ void AM53C974_transfer_dma(struct Scsi_Host *instance, short dir,
-					unsigned long length, char *data)
-{
-	AM53C974_local_declare();
-	AM53C974_setio(instance);
-
-	AM53C974_write_8(CMDREG, CMDREG_NOP);
-	AM53C974_write_8(DMACMD, (dir << 7) | DMACMD_INTE_D);	/* idle command */
-	AM53C974_write_8(STCLREG, (unsigned char) (length & 0xff));
-	AM53C974_write_8(STCMREG, (unsigned char) ((length & 0xff00) >> 8));
-	AM53C974_write_8(STCHREG, (unsigned char) ((length & 0xff0000) >> 16));
-	AM53C974_write_32(DMASTC, length & 0xffffff);
-	AM53C974_write_32(DMASPA, virt_to_bus(data));
-	AM53C974_write_8(CMDREG, CMDREG_IT | CMDREG_DMA);
-	AM53C974_write_8(DMACMD, (dir << 7) | DMACMD_INTE_D | DMACMD_START);
-}
-
-/************************************************************************** 
-* Function : AM53C974_dma_blast(struct Scsi_Host *instance, unsigned char dmastatus,
-*                               unsigned char statreg)
-*
-* Purpose : cleanup DMA transfer
-*
-* Inputs : instance -- which AM53C974
-*          dmastatus -- dma status register
-*          statreg -- status register
-* 
-* Returns : nothing
-**************************************************************************/
-static void AM53C974_dma_blast(struct Scsi_Host *instance, unsigned char dmastatus,
-			       unsigned char statreg)
-{
-	AM53C974_local_declare();
-	struct AM53C974_hostdata *hostdata = (struct AM53C974_hostdata *) instance->hostdata;
-	unsigned long ctcreg;
-	int dir = statreg & STATREG_IO;
-	int cfifo, pio, i = 0;
-	AM53C974_setio(instance);
-
-	do {
-		cfifo = AM53C974_cfifo();
-		i++;
-	} while (cfifo && (i < 50000));
-	pio = (i == 50000) ? 1 : 0;
-
-	if (statreg & STATREG_CTZ) {
-		AM53C974_write_8(DMACMD, DMACMD_IDLE);
-		return;
-	}
-	if (dmastatus & DMASTATUS_DONE) {
-		AM53C974_write_8(DMACMD, DMACMD_IDLE);
-		return;
-	}
-	AM53C974_write_8(DMACMD, ((dir << 7) & DMACMD_DIR) | DMACMD_BLAST);
-	while (!(AM53C974_read_8(DMASTATUS) & DMASTATUS_BCMPLT));
-	AM53C974_write_8(DMACMD, DMACMD_IDLE);
-
-	if (pio) {
-		/* transfer residual bytes via PIO */
-		unsigned char *wac = (unsigned char *) AM53C974_read_32(DMAWAC);
-		printk("pio mode, residual=%d\n", AM53C974_read_8(CFIREG) & CFIREG_CF);
-		while (AM53C974_read_8(CFIREG) & CFIREG_CF)
-			*(wac++) = AM53C974_read_8(FFREG);
-	}
-	ctcreg = AM53C974_read_8(CTCLREG) | (AM53C974_read_8(CTCMREG) << 8) |
-	    (AM53C974_read_8(CTCHREG) << 16);
-
-	hostdata->connected->SCp.ptr += hostdata->connected->SCp.this_residual - ctcreg;
-	hostdata->connected->SCp.this_residual = ctcreg;
-}
-
-/************************************************************************** 
-* Function : AM53C974_intr_bus_reset(struct Scsi_Host *instance)
-*
-* Purpose : handle bus reset interrupt
-*
-* Inputs : instance -- which AM53C974
-* 
-* Returns : nothing
-**************************************************************************/
-static void AM53C974_intr_bus_reset(struct Scsi_Host *instance)
-{
-	AM53C974_local_declare();
-	unsigned char cntlreg1;
-	AM53C974_setio(instance);
-
-	AM53C974_write_8(CMDREG, CMDREG_CFIFO);
-	AM53C974_write_8(CMDREG, CMDREG_NOP);
-
-	cntlreg1 = AM53C974_read_8(CNTLREG1);
-	AM53C974_write_8(CNTLREG1, cntlreg1 | CNTLREG1_DISR);
-}
-
-/**************************************************************************
-* Function : int AM53C974_abort(Scsi_Cmnd *cmd)
-*
-* Purpose : abort a command
-*
-* Inputs : cmd - the Scsi_Cmnd to abort, code - code to set the 
-* 	host byte of the result field to, if zero DID_ABORTED is 
-*	used.
-*
-* Returns : 0 - success, -1 on failure.
- **************************************************************************/
-static int AM53C974_abort(Scsi_Cmnd * cmd)
-{
-	AM53C974_local_declare();
-	unsigned long flags;
-	struct Scsi_Host *instance = cmd->device->host;
-	struct AM53C974_hostdata *hostdata = (struct AM53C974_hostdata *) instance->hostdata;
-	Scsi_Cmnd *tmp, **prev;
-
-#ifdef AM53C974_DEBUG
-	deb_stop = 1;
-#endif
-	save_flags(flags);
-	cli();
-	AM53C974_setio(instance);
-
-	DEB_ABORT(printk(SEPARATOR_LINE));
-	DEB_ABORT(printk("scsi%d : AM53C974_abort called -- trouble starts!!\n", instance->host_no));
-	DEB_ABORT(AM53C974_print(instance));
-	DEB_ABORT(AM53C974_keywait());
-
-/* Case 1 : If the command is the currently executing command, 
-   we'll set the aborted flag and return control so that the
-   information transfer routine can exit cleanly. */
-	if ((hostdata->connected == cmd) || (hostdata->sel_cmd == cmd)) {
-		DEB_ABORT(printk("scsi%d: aborting connected command\n", instance->host_no));
-		hostdata->aborted = 1;
-		hostdata->msgout[0] = ABORT;
-		restore_flags(flags);
-		return (SCSI_ABORT_PENDING);
-	}
-/* Case 2 : If the command hasn't been issued yet,
-   we simply remove it from the issue queue. */
-	for (prev = (Scsi_Cmnd **) & (hostdata->issue_queue),
-	     tmp = (Scsi_Cmnd *) hostdata->issue_queue; tmp;
-	     prev = (Scsi_Cmnd **) & (tmp->host_scribble),
-	     tmp = (Scsi_Cmnd *) tmp->host_scribble) {
-		if (cmd == tmp) {
-			DEB_ABORT(printk("scsi%d : abort removed command from issue queue.\n", instance->host_no));
-			REMOVE(5, *prev, tmp, tmp->host_scribble);
-			(*prev) = (Scsi_Cmnd *) tmp->host_scribble;
-			tmp->host_scribble = NULL;
-			tmp->result = DID_ABORT << 16;
-			restore_flags(flags);
-			tmp->done(tmp);
-			return (SCSI_ABORT_SUCCESS);
-		}
-#ifdef AM53C974_DEBUG_ABORT
-		else {
-			if (prev == (Scsi_Cmnd **) tmp)
-				printk("scsi%d : LOOP\n", instance->host_no);
-		}
-#endif
-	}
-
-/* Case 3 : If any commands are connected, we're going to fail the abort
- *        and let the high level SCSI driver retry at a later time or 
- *          issue a reset.
- *
- *          Timeouts, and therefore aborted commands, will be highly unlikely
- *          and handling them cleanly in this situation would make the common
- *          case of noresets less efficient, and would pollute our code.  So,
- *          we fail. */
-	if (hostdata->connected || hostdata->sel_cmd) {
-		DEB_ABORT(printk("scsi%d : abort failed, other command connected.\n", instance->host_no));
-		restore_flags(flags);
-		return (SCSI_ABORT_NOT_RUNNING);
-	}
-/* Case 4: If the command is currently disconnected from the bus, and 
- *       there are no connected commands, we reconnect the I_T_L or 
- *         I_T_L_Q nexus associated with it, go into message out, and send 
- *         an abort message. */
-	for (tmp = (Scsi_Cmnd *) hostdata->disconnected_queue; tmp;
-	     tmp = (Scsi_Cmnd *) tmp->host_scribble) {
-		if (cmd == tmp) {
-			DEB_ABORT(printk("scsi%d: aborting disconnected command\n", instance->host_no));
-			hostdata->aborted = 1;
-			hostdata->msgout[0] = ABORT;
-			hostdata->selecting = 1;
-			hostdata->sel_cmd = tmp;
-			AM53C974_write_8(CMDREG, CMDREG_DSR);
-			restore_flags(flags);
-			return (SCSI_ABORT_PENDING);
-		}
-	}
-
-/* Case 5 : If we reached this point, the command was not found in any of 
- *        the queues.
- *
- * We probably reached this point because of an unlikely race condition
- * between the command completing successfully and the abortion code,
- * so we won't panic, but we will notify the user in case something really
- * broke. */
-	DEB_ABORT(printk("scsi%d : abort failed, command not found.\n", instance->host_no));
-	restore_flags(flags);
-	return (SCSI_ABORT_NOT_RUNNING);
-}
-
-/************************************************************************** 
-* Function : int AM53C974_reset(Scsi_Cmnd *cmd)
-*
-* Purpose : reset the SCSI controller and bus
-*
-* Inputs : cmd -- which command within the command block was responsible for the reset
-* 
-* Returns : status (SCSI_ABORT_SUCCESS)
-* 
-* FIXME(eric) the reset_flags are ignored.
-**************************************************************************/
-static int AM53C974_reset(Scsi_Cmnd * cmd, unsigned int reset_flags)
-{
-	AM53C974_local_declare();
-	unsigned long flags;
-	int i;
-	struct Scsi_Host *instance = cmd->device->host;
-	struct AM53C974_hostdata *hostdata = (struct AM53C974_hostdata *) instance->hostdata;
-	AM53C974_setio(instance);
-
-	save_flags(flags);
-	cli();
-	DEB(printk("AM53C974_reset called; "));
-
-	printk("AM53C974_reset called\n");
-	AM53C974_print(instance);
-	AM53C974_keywait();
-
-/* do hard reset */
-	AM53C974_write_8(CMDREG, CMDREG_RDEV);
-	AM53C974_write_8(CMDREG, CMDREG_NOP);
-	hostdata->msgout[0] = NOP;
-	for (i = 0; i < 8; i++) {
-		hostdata->busy[i] = 0;
-		hostdata->sync_per[i] = DEF_STP;
-		hostdata->sync_off[i] = 0;
-		hostdata->sync_neg[i] = 0;
-	}
-	hostdata->last_message[0] = NOP;
-	hostdata->sel_cmd = NULL;
-	hostdata->connected = NULL;
-	hostdata->issue_queue = NULL;
-	hostdata->disconnected_queue = NULL;
-	hostdata->in_reset = 0;
-	hostdata->aborted = 0;
-	hostdata->selecting = 0;
-	hostdata->disconnecting = 0;
-	hostdata->dma_busy = 0;
-
-/* reset bus */
-	AM53C974_write_8(CNTLREG1, CNTLREG1_DISR | instance->this_id);	/* disable interrupt upon SCSI RESET */
-	AM53C974_write_8(CMDREG, CMDREG_RBUS);	/* reset SCSI bus */
-	udelay(40);
-	AM53C974_config_after_reset(instance);
-
-	restore_flags(flags);
-	cmd->result = DID_RESET << 16;
-	cmd->scsi_done(cmd);
-	return SCSI_ABORT_SUCCESS;
-}
-
-
-/*
- * AM53C974_release()
- *
- * Release resources allocated for a single AM53C974 adapter.
- */
-static int AM53C974_release(struct Scsi_Host *shp)
-{
-	free_irq(shp->irq, shp);
-	release_region(shp->io_port, 128);
-	scsi_unregister(shp);
-	return 0;
-}
-
-
-/* You can specify overrides=a,b,c,d in the same format at AM53C974=a,b,c,d
-   on boot up */
-MODULE_PARM(overrides, "1-32i");
-MODULE_LICENSE("GPL");
-
-
-static Scsi_Host_Template driver_template = {
-	.proc_name		= "am53c974",
-	.name           	= "AM53C974",
-	.detect         	= AM53C974_pci_detect,
-	.release        	= AM53C974_release,	
-	.info			= AM53C974_info,
-	.queuecommand		= AM53C974_queue_command,
-	.abort			= AM53C974_abort,
-	.reset			= AM53C974_reset,
-	.can_queue		= 12,
-	.this_id		= -1,
-	.sg_tablesize		= SG_ALL,
-	.cmd_per_lun		= 1,
-	.use_clustering		= DISABLE_CLUSTERING,
-};
-
-#include "scsi_module.c"
--- diff/drivers/scsi/AM53C974.h	2003-06-09 14:18:19.000000000 +0100
+++ source/drivers/scsi/AM53C974.h	1970-01-01 01:00:00.000000000 +0100
@@ -1,61 +0,0 @@
-/* AM53/79C974 (PCscsi) driver release 0.5
-
- * The architecture and much of the code of this device
- * driver was originally developed by Drew Eckhardt for
- * the NCR5380. The following copyrights apply:
- *  For the architecture and all parts similar to the NCR5380:
- *    Copyright 1993, Drew Eckhardt
- *      Visionary Computing 
- *      (Unix and Linux consulting and custom programming)
- *      drew@colorado.edu
- *      +1 (303) 666-5836
- *
- *  The AM53C974_nobios_detect code was originally developed by
- *   Robin Cutshaw (robin@xfree86.org) and is used here in a 
- *   modified form.
- *
- *  For the other parts:
- *    Copyright 1994, D. Frieauff
- *    EMail: fri@rsx42sun0.dofn.de
- *    Phone: x49-7545-8-2256 , x49-7541-42305
- */
-
-/*
- * $Log: AM53C974.h,v $
- */
-
-#ifndef AM53C974_H
-#define AM53C974_H
-
-#include <scsi/scsicam.h>
-
-struct AM53C974_hostdata {
-	volatile unsigned in_reset:1;	/* flag, says bus reset pending */
-	volatile unsigned aborted:1;	/* flag, says aborted */
-	volatile unsigned selecting:1;	/* selection started, but not yet finished */
-	volatile unsigned disconnecting: 1;	/* disconnection started, but not yet finished */
-	volatile unsigned dma_busy:1;	/* dma busy when service request for info transfer received */
-	volatile unsigned char msgout[10];	/* message to output in MSGOUT_PHASE */
-	volatile unsigned char last_message[10];	/* last message OUT */
-	volatile Scsi_Cmnd *issue_queue;	/* waiting to be issued */
-	volatile Scsi_Cmnd *disconnected_queue;		/* waiting for reconnect */
-	volatile Scsi_Cmnd *sel_cmd;	/* command for selection */
-	volatile Scsi_Cmnd *connected;	/* currently connected command */
-	volatile unsigned char busy[8];		/* index = target, bit = lun */
-	unsigned char sync_per[8];	/* synchronous transfer period (in effect) */
-	unsigned char sync_off[8];	/* synchronous offset (in effect) */
-	unsigned char sync_neg[8];	/* sync. negotiation performed (in effect) */
-	unsigned char sync_en[8];	/* sync. negotiation performed (in effect) */
-	unsigned char max_rate[8];	/* max. transfer rate (setup) */
-	unsigned char max_offset[8];	/* max. sync. offset (setup), only valid if corresponding sync_en is nonzero */
-};
-
-static int AM53C974_pci_detect(Scsi_Host_Template * tpnt);
-static int AM53C974_release(struct Scsi_Host *shp);
-static const char *AM53C974_info(struct Scsi_Host *);
-static int AM53C974_command(Scsi_Cmnd * SCpnt);
-static int AM53C974_queue_command(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *));
-static int AM53C974_abort(Scsi_Cmnd * cmd);
-static int AM53C974_reset(Scsi_Cmnd * cmd, unsigned int);
-
-#endif				/* AM53C974_H */
--- diff/drivers/scsi/mac_NCR5380.c	2003-08-26 10:00:54.000000000 +0100
+++ source/drivers/scsi/mac_NCR5380.c	1970-01-01 01:00:00.000000000 +0100
@@ -1,3127 +0,0 @@
-/* 
- * NCR 5380 generic driver routines.  These should make it *trivial*
- * 	to implement 5380 SCSI drivers under Linux with a non-trantor
- *	architecture.
- *
- *	Note that these routines also work with NR53c400 family chips.
- *
- * Copyright 1993, Drew Eckhardt
- *	Visionary Computing 
- *	(Unix and Linux consulting and custom programming)
- * 	drew@colorado.edu
- *	+1 (303) 666-5836
- *
- * DISTRIBUTION RELEASE 6. 
- *
- * For more information, please consult 
- *
- * NCR 5380 Family
- * SCSI Protocol Controller
- * Databook
- *
- * NCR Microelectronics
- * 1635 Aeroplaza Drive
- * Colorado Springs, CO 80916
- * 1+ (719) 578-3400
- * 1+ (800) 334-5454
- */
-
-/*
- * ++roman: To port the 5380 driver to the Atari, I had to do some changes in
- * this file, too:
- *
- *  - Some of the debug statements were incorrect (undefined variables and the
- *    like). I fixed that.
- *
- *  - In information_transfer(), I think a #ifdef was wrong. Looking at the
- *    possible DMA transfer size should also happen for REAL_DMA. I added this
- *    in the #if statement.
- *
- *  - When using real DMA, information_transfer() should return in a DATAOUT
- *    phase after starting the DMA. It has nothing more to do.
- *
- *  - The interrupt service routine should run main after end of DMA, too (not
- *    only after RESELECTION interrupts). Additionally, it should _not_ test
- *    for more interrupts after running main, since a DMA process may have
- *    been started and interrupts are turned on now. The new int could happen
- *    inside the execution of NCR5380_intr(), leading to recursive
- *    calls.
- *
- *  - I've added a function merge_contiguous_buffers() that tries to
- *    merge scatter-gather buffers that are located at contiguous
- *    physical addresses and can be processed with the same DMA setup.
- *    Since most scatter-gather operations work on a page (4K) of
- *    4 buffers (1K), in more than 90% of all cases three interrupts and
- *    DMA setup actions are saved.
- *
- * - I've deleted all the stuff for AUTOPROBE_IRQ, REAL_DMA_POLL, PSEUDO_DMA
- *    and USLEEP, because these were messing up readability and will never be
- *    needed for Atari SCSI.
- * 
- * - I've revised the NCR5380_main() calling scheme (relax the 'main_running'
- *   stuff), and 'main' is executed in a bottom half if awoken by an
- *   interrupt.
- *
- * - The code was quite cluttered up by "#if (NDEBUG & NDEBUG_*) printk..."
- *   constructs. In my eyes, this made the source rather unreadable, so I
- *   finally replaced that by the *_PRINTK() macros.
- *
- */
-
-/*
- * Further development / testing that should be done : 
- * 1.  Test linked command handling code after Eric is ready with 
- *     the high level code.
- */
-
-/* 
- * Michael: To port Romans driver to the Macintosh, I've left most of the code 
- * unchanged, in order to make later implemantation of REAL_DMA easier. 
- *
- * Alan: In order to make it easier to read and as the 5380 based Mac's never
- *	  have DMA I took the real DMA out of mac_scsi.c but not this file.
- *
- *	With luck we can merge this back with the ST folks in time.
- *
- * Changes:
- * 
- * - all Falcon-specific stuff (ST-DMA locking) was removed
- *
- * 
- */
-
-#if (NDEBUG & NDEBUG_LISTS)
-#define LIST(x,y) \
-  { printk("LINE:%d   Adding %p to %p\n", __LINE__, (void*)(x), (void*)(y)); \
-    if ((x)==(y)) udelay(5); }
-#define REMOVE(w,x,y,z) \
-  { printk("LINE:%d   Removing: %p->%p  %p->%p \n", __LINE__, \
-	   (void*)(w), (void*)(x), (void*)(y), (void*)(z)); \
-    if ((x)==(y)) udelay(5); }
-#else
-#define LIST(x,y)
-#define REMOVE(w,x,y,z)
-#endif
-
-#ifndef notyet
-#undef LINKED
-#endif
-
-/*
- * Design
- * Issues :
- *
- * The other Linux SCSI drivers were written when Linux was Intel PC-only,
- * and specifically for each board rather than each chip.  This makes their
- * adaptation to platforms like the Mac (Some of which use NCR5380's)
- * more difficult than it has to be.
- *
- * Also, many of the SCSI drivers were written before the command queuing
- * routines were implemented, meaning their implementations of queued 
- * commands were hacked on rather than designed in from the start.
- *
- * When I designed the Linux SCSI drivers I figured that 
- * while having two different SCSI boards in a system might be useful
- * for debugging things, two of the same type wouldn't be used.
- * Well, I was wrong and a number of users have mailed me about running
- * multiple high-performance SCSI boards in a server.
- *
- * Finally, when I get questions from users, I have no idea what 
- * revision of my driver they are running.
- *
- * This driver attempts to address these problems :
- * This is a generic 5380 driver.  To use it on a different platform, 
- * one simply writes appropriate system specific macros (ie, data
- * transfer - some PC's will use the I/O bus, 68K's must use 
- * memory mapped) and drops this file in their 'C' wrapper.
- *
- * As far as command queueing, two queues are maintained for 
- * each 5380 in the system - commands that haven't been issued yet,
- * and commands that are currently executing.  This means that an 
- * unlimited number of commands may be queued, letting 
- * more commands propagate from the higher driver levels giving higher 
- * throughput.  Note that both I_T_L and I_T_L_Q nexuses are supported, 
- * allowing multiple commands to propagate all the way to a SCSI-II device 
- * while a command is already executing.
- *
- * To solve the multiple-boards-in-the-same-system problem, 
- * there is a separate instance structure for each instance
- * of a 5380 in the system.  So, multiple NCR5380 drivers will
- * be able to coexist with appropriate changes to the high level
- * SCSI code.  
- *
- * A NCR5380_PUBLIC_REVISION macro is provided, with the release
- * number (updated for each public release) printed by the 
- * NCR5380_print_options command, which should be called from the 
- * wrapper detect function, so that I know what release of the driver
- * users are using.
- *
- * Issues specific to the NCR5380 : 
- *
- * When used in a PIO or pseudo-dma mode, the NCR5380 is a braindead 
- * piece of hardware that requires you to sit in a loop polling for 
- * the REQ signal as long as you are connected.  Some devices are 
- * brain dead (ie, many TEXEL CD ROM drives) and won't disconnect 
- * while doing long seek operations.
- * 
- * The workaround for this is to keep track of devices that have
- * disconnected.  If the device hasn't disconnected, for commands that
- * should disconnect, we do something like 
- *
- * while (!REQ is asserted) { sleep for N usecs; poll for M usecs }
- * 
- * Some tweaking of N and M needs to be done.  An algorithm based 
- * on "time to data" would give the best results as long as short time
- * to datas (ie, on the same track) were considered, however these 
- * broken devices are the exception rather than the rule and I'd rather
- * spend my time optimizing for the normal case.
- *
- * Architecture :
- *
- * At the heart of the design is a coroutine, NCR5380_main,
- * which is started when not running by the interrupt handler,
- * timer, and queue command function.  It attempts to establish
- * I_T_L or I_T_L_Q nexuses by removing the commands from the 
- * issue queue and calling NCR5380_select() if a nexus 
- * is not established. 
- *
- * Once a nexus is established, the NCR5380_information_transfer()
- * phase goes through the various phases as instructed by the target.
- * if the target goes into MSG IN and sends a DISCONNECT message,
- * the command structure is placed into the per instance disconnected
- * queue, and NCR5380_main tries to find more work.  If USLEEP
- * was defined, and the target is idle for too long, the system
- * will try to sleep.
- *
- * If a command has disconnected, eventually an interrupt will trigger,
- * calling NCR5380_intr()  which will in turn call NCR5380_reselect
- * to reestablish a nexus.  This will run main if necessary.
- *
- * On command termination, the done function will be called as 
- * appropriate.
- *
- * SCSI pointers are maintained in the SCp field of SCSI command 
- * structures, being initialized after the command is connected
- * in NCR5380_select, and set as appropriate in NCR5380_information_transfer.
- * Note that in violation of the standard, an implicit SAVE POINTERS operation
- * is done, since some BROKEN disks fail to issue an explicit SAVE POINTERS.
- */
-
-/*
- * Using this file :
- * This file a skeleton Linux SCSI driver for the NCR 5380 series
- * of chips.  To use it, you write a architecture specific functions 
- * and macros and include this file in your driver.
- *
- * These macros control options : 
- * AUTOSENSE - if defined, REQUEST SENSE will be performed automatically
- *	for commands that return with a CHECK CONDITION status. 
- *
- * LINKED - if defined, linked commands are supported.
- *
- * PSEUDO_DMA - if defined, PSEUDO DMA is used during the data transfer phases.
- *
- * REAL_DMA - if defined, REAL DMA is used during the data transfer phases.
- *
- * SUPPORT_TAGS - if defined, SCSI-2 tagged queuing is used where possible
- *
- * These macros MUST be defined :
- * 
- * NCR5380_read(register)  - read from the specified register
- *
- * NCR5380_write(register, value) - write to the specific register 
- *
- * Either real DMA *or* pseudo DMA may be implemented
- * REAL functions : 
- * NCR5380_REAL_DMA should be defined if real DMA is to be used.
- * Note that the DMA setup functions should return the number of bytes 
- *	that they were able to program the controller for.
- *
- * Also note that generic i386/PC versions of these macros are 
- *	available as NCR5380_i386_dma_write_setup,
- *	NCR5380_i386_dma_read_setup, and NCR5380_i386_dma_residual.
- *
- * NCR5380_dma_write_setup(instance, src, count) - initialize
- * NCR5380_dma_read_setup(instance, dst, count) - initialize
- * NCR5380_dma_residual(instance); - residual count
- *
- * PSEUDO functions :
- * NCR5380_pwrite(instance, src, count)
- * NCR5380_pread(instance, dst, count);
- *
- * If nothing specific to this implementation needs doing (ie, with external
- * hardware), you must also define 
- *  
- * NCR5380_queue_command
- * NCR5380_reset
- * NCR5380_abort
- * NCR5380_proc_info
- *
- * to be the global entry points into the specific driver, ie 
- * #define NCR5380_queue_command t128_queue_command.
- *
- * If this is not done, the routines will be defined as static functions
- * with the NCR5380* names and the user must provide a globally
- * accessible wrapper function.
- *
- * The generic driver is initialized by calling NCR5380_init(instance),
- * after setting the appropriate host specific fields and ID.  If the 
- * driver wishes to autoprobe for an IRQ line, the NCR5380_probe_irq(instance,
- * possible) function may be used.  Before the specific driver initialization
- * code finishes, NCR5380_print_options should be called.
- */
-
-static struct Scsi_Host *first_instance = NULL;
-static Scsi_Host_Template *the_template = NULL;
-
-/* Macros ease life... :-) */
-#define	SETUP_HOSTDATA(in)				\
-    struct NCR5380_hostdata *hostdata =			\
-	(struct NCR5380_hostdata *)(in)->hostdata
-#define	HOSTDATA(in) ((struct NCR5380_hostdata *)(in)->hostdata)
-
-#define	NEXT(cmd)	((Scsi_Cmnd *)((cmd)->host_scribble))
-#define	NEXTADDR(cmd)	((Scsi_Cmnd **)&((cmd)->host_scribble))
-
-#define	HOSTNO		instance->host_no
-#define	H_NO(cmd)	(cmd)->host->host_no
-
-#ifdef SUPPORT_TAGS
-
-/*
- * Functions for handling tagged queuing
- * =====================================
- *
- * ++roman (01/96): Now I've implemented SCSI-2 tagged queuing. Some notes:
- *
- * Using consecutive numbers for the tags is no good idea in my eyes. There
- * could be wrong re-usings if the counter (8 bit!) wraps and some early
- * command has been preempted for a long time. My solution: a bitfield for
- * remembering used tags.
- *
- * There's also the problem that each target has a certain queue size, but we
- * cannot know it in advance :-( We just see a QUEUE_FULL status being
- * returned. So, in this case, the driver internal queue size assumption is
- * reduced to the number of active tags if QUEUE_FULL is returned by the
- * target. The command is returned to the mid-level, but with status changed
- * to BUSY, since --as I've seen-- the mid-level can't handle QUEUE_FULL
- * correctly.
- *
- * We're also not allowed running tagged commands as long as an untagged
- * command is active. And REQUEST SENSE commands after a contingent allegiance
- * condition _must_ be untagged. To keep track whether an untagged command has
- * been issued, the host->busy array is still employed, as it is without
- * support for tagged queuing.
- *
- * One could suspect that there are possible race conditions between
- * is_lun_busy(), cmd_get_tag() and cmd_free_tag(). But I think this isn't the
- * case: is_lun_busy() and cmd_get_tag() are both called from NCR5380_main(),
- * which already guaranteed to be running at most once. It is also the only
- * place where tags/LUNs are allocated. So no other allocation can slip
- * between that pair, there could only happen a reselection, which can free a
- * tag, but that doesn't hurt. Only the sequence in cmd_free_tag() becomes
- * important: the tag bit must be cleared before 'nr_allocated' is decreased.
- */
-
-/* -1 for TAG_NONE is not possible with unsigned char cmd->tag */
-#undef TAG_NONE
-#define TAG_NONE 0xff
-
-/* For the m68k, the number of bits in 'allocated' must be a multiple of 32! */
-#if (MAX_TAGS % 32) != 0
-#error "MAX_TAGS must be a multiple of 32!"
-#endif
-
-typedef struct {
-    char	allocated[MAX_TAGS/8];
-    int		nr_allocated;
-    int		queue_size;
-} TAG_ALLOC;
-
-static TAG_ALLOC TagAlloc[8][8]; /* 8 targets and 8 LUNs */
-
-
-static void init_tags( void )
-{
-    int target, lun;
-    TAG_ALLOC *ta;
-    
-    if (!setup_use_tagged_queuing)
-	return;
-    
-    for( target = 0; target < 8; ++target ) {
-	for( lun = 0; lun < 8; ++lun ) {
-	    ta = &TagAlloc[target][lun];
-	    memset( &ta->allocated, 0, MAX_TAGS/8 );
-	    ta->nr_allocated = 0;
-	    /* At the beginning, assume the maximum queue size we could
-	     * support (MAX_TAGS). This value will be decreased if the target
-	     * returns QUEUE_FULL status.
-	     */
-	    ta->queue_size = MAX_TAGS;
-	}
-    }
-}
-
-
-/* Check if we can issue a command to this LUN: First see if the LUN is marked
- * busy by an untagged command. If the command should use tagged queuing, also
- * check that there is a free tag and the target's queue won't overflow. This
- * function should be called with interrupts disabled to avoid race
- * conditions.
- */ 
-
-static int is_lun_busy( Scsi_Cmnd *cmd, int should_be_tagged )
-{
-    SETUP_HOSTDATA(cmd->host);
-
-    if (hostdata->busy[cmd->target] & (1 << cmd->lun))
-	return( 1 );
-    if (!should_be_tagged ||
-	!setup_use_tagged_queuing || !cmd->device->tagged_supported)
-	return( 0 );
-    if (TagAlloc[cmd->target][cmd->lun].nr_allocated >=
-	TagAlloc[cmd->target][cmd->lun].queue_size ) {
-	TAG_PRINTK( "scsi%d: target %d lun %d: no free tags\n",
-		    H_NO(cmd), cmd->target, cmd->lun );
-	return( 1 );
-    }
-    return( 0 );
-}
-
-
-/* Allocate a tag for a command (there are no checks anymore, check_lun_busy()
- * must be called before!), or reserve the LUN in 'busy' if the command is
- * untagged.
- */
-
-static void cmd_get_tag( Scsi_Cmnd *cmd, int should_be_tagged )
-{
-    SETUP_HOSTDATA(cmd->host);
-
-    /* If we or the target don't support tagged queuing, allocate the LUN for
-     * an untagged command.
-     */
-    if (!should_be_tagged ||
-	!setup_use_tagged_queuing || !cmd->device->tagged_supported) {
-	cmd->tag = TAG_NONE;
-	hostdata->busy[cmd->target] |= (1 << cmd->lun);
-	TAG_PRINTK( "scsi%d: target %d lun %d now allocated by untagged "
-		    "command\n", H_NO(cmd), cmd->target, cmd->lun );
-    }
-    else {
-	TAG_ALLOC *ta = &TagAlloc[cmd->target][cmd->lun];
-
-	cmd->tag = find_first_zero_bit( &ta->allocated, MAX_TAGS );
-	set_bit( cmd->tag, &ta->allocated );
-	ta->nr_allocated++;
-	TAG_PRINTK( "scsi%d: using tag %d for target %d lun %d "
-		    "(now %d tags in use)\n",
-		    H_NO(cmd), cmd->tag, cmd->target, cmd->lun,
-		    ta->nr_allocated );
-    }
-}
-
-
-/* Mark the tag of command 'cmd' as free, or in case of an untagged command,
- * unlock the LUN.
- */
-
-static void cmd_free_tag( Scsi_Cmnd *cmd )
-{
-    SETUP_HOSTDATA(cmd->host);
-
-    if (cmd->tag == TAG_NONE) {
-	hostdata->busy[cmd->target] &= ~(1 << cmd->lun);
-	TAG_PRINTK( "scsi%d: target %d lun %d untagged cmd finished\n",
-		    H_NO(cmd), cmd->target, cmd->lun );
-    }
-    else if (cmd->tag >= MAX_TAGS) {
-	printk(KERN_NOTICE "scsi%d: trying to free bad tag %d!\n",
-		H_NO(cmd), cmd->tag );
-    }
-    else {
-	TAG_ALLOC *ta = &TagAlloc[cmd->target][cmd->lun];
-	clear_bit( cmd->tag, &ta->allocated );
-	ta->nr_allocated--;
-	TAG_PRINTK( "scsi%d: freed tag %d for target %d lun %d\n",
-		    H_NO(cmd), cmd->tag, cmd->target, cmd->lun );
-    }
-}
-
-
-static void free_all_tags( void )
-{
-    int target, lun;
-    TAG_ALLOC *ta;
-
-    if (!setup_use_tagged_queuing)
-	return;
-    
-    for( target = 0; target < 8; ++target ) {
-	for( lun = 0; lun < 8; ++lun ) {
-	    ta = &TagAlloc[target][lun];
-	    memset( &ta->allocated, 0, MAX_TAGS/8 );
-	    ta->nr_allocated = 0;
-	}
-    }
-}
-
-#endif /* SUPPORT_TAGS */
-
-
-/*
- * Function: void merge_contiguous_buffers( Scsi_Cmnd *cmd )
- *
- * Purpose: Try to merge several scatter-gather requests into one DMA
- *    transfer. This is possible if the scatter buffers lie on
- *    physical contiguous addresses.
- *
- * Parameters: Scsi_Cmnd *cmd
- *    The command to work on. The first scatter buffer's data are
- *    assumed to be already transfered into ptr/this_residual.
- */
-
-static void merge_contiguous_buffers( Scsi_Cmnd *cmd )
-{
-    unsigned long endaddr;
-#if (NDEBUG & NDEBUG_MERGING)
-    unsigned long oldlen = cmd->SCp.this_residual;
-    int		  cnt = 1;
-#endif
-
-    for (endaddr = virt_to_phys(cmd->SCp.ptr + cmd->SCp.this_residual - 1) + 1;
-	 cmd->SCp.buffers_residual &&
-	 virt_to_phys(cmd->SCp.buffer[1].address) == endaddr; ) {
-	
-	MER_PRINTK("VTOP(%p) == %08lx -> merging\n",
-		   cmd->SCp.buffer[1].address, endaddr);
-#if (NDEBUG & NDEBUG_MERGING)
-	++cnt;
-#endif
-	++cmd->SCp.buffer;
-	--cmd->SCp.buffers_residual;
-	cmd->SCp.this_residual += cmd->SCp.buffer->length;
-	endaddr += cmd->SCp.buffer->length;
-    }
-#if (NDEBUG & NDEBUG_MERGING)
-    if (oldlen != cmd->SCp.this_residual)
-	MER_PRINTK("merged %d buffers from %p, new length %08x\n",
-		   cnt, cmd->SCp.ptr, cmd->SCp.this_residual);
-#endif
-}
-
-/*
- * Function : void initialize_SCp(Scsi_Cmnd *cmd)
- *
- * Purpose : initialize the saved data pointers for cmd to point to the 
- *	start of the buffer.
- *
- * Inputs : cmd - Scsi_Cmnd structure to have pointers reset.
- */
-
-static __inline__ void initialize_SCp(Scsi_Cmnd *cmd)
-{
-    /* 
-     * Initialize the Scsi Pointer field so that all of the commands in the 
-     * various queues are valid.
-     */
-
-    if (cmd->use_sg) {
-	cmd->SCp.buffer = (struct scatterlist *) cmd->buffer;
-	cmd->SCp.buffers_residual = cmd->use_sg - 1;
-	cmd->SCp.ptr = (char *) cmd->SCp.buffer->address;
-	cmd->SCp.this_residual = cmd->SCp.buffer->length;
-	/* ++roman: Try to merge some scatter-buffers if they are at
-	 * contiguous physical addresses.
-	 */
-	merge_contiguous_buffers( cmd );
-    } else {
-	cmd->SCp.buffer = NULL;
-	cmd->SCp.buffers_residual = 0;
-	cmd->SCp.ptr = (char *) cmd->request_buffer;
-	cmd->SCp.this_residual = cmd->request_bufflen;
-    }
-}
-
-#include <linux/config.h>
-#include <linux/delay.h>
-
-#if 1
-static struct {
-    unsigned char mask;
-    const char * name;} 
-signals[] = {{ SR_DBP, "PARITY"}, { SR_RST, "RST" }, { SR_BSY, "BSY" }, 
-    { SR_REQ, "REQ" }, { SR_MSG, "MSG" }, { SR_CD,  "CD" }, { SR_IO, "IO" }, 
-    { SR_SEL, "SEL" }, {0, NULL}}, 
-basrs[] = {{BASR_ATN, "ATN"}, {BASR_ACK, "ACK"}, {0, NULL}},
-icrs[] = {{ICR_ASSERT_RST, "ASSERT RST"},{ICR_ASSERT_ACK, "ASSERT ACK"},
-    {ICR_ASSERT_BSY, "ASSERT BSY"}, {ICR_ASSERT_SEL, "ASSERT SEL"}, 
-    {ICR_ASSERT_ATN, "ASSERT ATN"}, {ICR_ASSERT_DATA, "ASSERT DATA"}, 
-    {0, NULL}},
-mrs[] = {{MR_BLOCK_DMA_MODE, "MODE BLOCK DMA"}, {MR_TARGET, "MODE TARGET"}, 
-    {MR_ENABLE_PAR_CHECK, "MODE PARITY CHECK"}, {MR_ENABLE_PAR_INTR, 
-    "MODE PARITY INTR"}, {MR_ENABLE_EOP_INTR,"MODE EOP INTR"},
-    {MR_MONITOR_BSY, "MODE MONITOR BSY"},
-    {MR_DMA_MODE, "MODE DMA"}, {MR_ARBITRATE, "MODE ARBITRATION"}, 
-    {0, NULL}};
-
-/*
- * Function : void NCR5380_print(struct Scsi_Host *instance)
- *
- * Purpose : print the SCSI bus signals for debugging purposes
- *
- * Input : instance - which NCR5380
- */
-
-static void NCR5380_print(struct Scsi_Host *instance) {
-    unsigned char status, data, basr, mr, icr, i;
-    unsigned long flags;
-
-    local_irq_save(flags);
-    data = NCR5380_read(CURRENT_SCSI_DATA_REG);
-    status = NCR5380_read(STATUS_REG);
-    mr = NCR5380_read(MODE_REG);
-    icr = NCR5380_read(INITIATOR_COMMAND_REG);
-    basr = NCR5380_read(BUS_AND_STATUS_REG);
-    local_irq_restore(flags);
-    printk("STATUS_REG: %02x ", status);
-    for (i = 0; signals[i].mask ; ++i) 
-	if (status & signals[i].mask)
-	    printk(",%s", signals[i].name);
-    printk("\nBASR: %02x ", basr);
-    for (i = 0; basrs[i].mask ; ++i) 
-	if (basr & basrs[i].mask)
-	    printk(",%s", basrs[i].name);
-    printk("\nICR: %02x ", icr);
-    for (i = 0; icrs[i].mask; ++i) 
-	if (icr & icrs[i].mask)
-	    printk(",%s", icrs[i].name);
-    printk("\nMODE: %02x ", mr);
-    for (i = 0; mrs[i].mask; ++i) 
-	if (mr & mrs[i].mask)
-	    printk(",%s", mrs[i].name);
-    printk("\n");
-}
-
-static struct {
-    unsigned char value;
-    const char *name;
-} phases[] = {
-    {PHASE_DATAOUT, "DATAOUT"}, {PHASE_DATAIN, "DATAIN"}, {PHASE_CMDOUT, "CMDOUT"},
-    {PHASE_STATIN, "STATIN"}, {PHASE_MSGOUT, "MSGOUT"}, {PHASE_MSGIN, "MSGIN"},
-    {PHASE_UNKNOWN, "UNKNOWN"}};
-
-/* 
- * Function : void NCR5380_print_phase(struct Scsi_Host *instance)
- *
- * Purpose : print the current SCSI phase for debugging purposes
- *
- * Input : instance - which NCR5380
- */
-
-static void NCR5380_print_phase(struct Scsi_Host *instance)
-{
-    unsigned char status;
-    int i;
-
-    status = NCR5380_read(STATUS_REG);
-    if (!(status & SR_REQ)) 
-	printk(KERN_DEBUG "scsi%d: REQ not asserted, phase unknown.\n", HOSTNO);
-    else {
-	for (i = 0; (phases[i].value != PHASE_UNKNOWN) && 
-	    (phases[i].value != (status & PHASE_MASK)); ++i); 
-	printk(KERN_DEBUG "scsi%d: phase %s\n", HOSTNO, phases[i].name);
-    }
-}
-
-#else /* !NDEBUG */
-
-/* dummies... */
-__inline__ void NCR5380_print(struct Scsi_Host *instance) { };
-__inline__ void NCR5380_print_phase(struct Scsi_Host *instance) { };
-
-#endif
-
-/*
- * ++roman: New scheme of calling NCR5380_main()
- * 
- * If we're not in an interrupt, we can call our main directly, it cannot be
- * already running. Else, we queue it on a task queue, if not 'main_running'
- * tells us that a lower level is already executing it. This way,
- * 'main_running' needs not be protected in a special way.
- *
- * queue_main() is a utility function for putting our main onto the task
- * queue, if main_running is false. It should be called only from a
- * interrupt or bottom half.
- */
-
-#include <linux/workqueue.h>
-#include <linux/interrupt.h>
-
-static volatile int main_running = 0;
-static DECLARE_WORK(NCR5380_tqueue, (void (*)(void*))NCR5380_main, NULL);
-
-static __inline__ void queue_main(void)
-{
-    if (!main_running) {
-	/* If in interrupt and NCR5380_main() not already running,
-	   queue it on the 'immediate' task queue, to be processed
-	   immediately after the current interrupt processing has
-	   finished. */
-	schedule_work(&NCR5380_tqueue);
-    }
-    /* else: nothing to do: the running NCR5380_main() will pick up
-       any newly queued command. */
-}
-
-
-static void NCR5380_all_init (void)
-{
-    static int done = 0;
-    if (!done) {
-	INI_PRINTK("scsi : NCR5380_all_init()\n");
-	done = 1;
-    }
-}
-
- 
-/*
- * Function : void NCR58380_print_options (struct Scsi_Host *instance)
- *
- * Purpose : called by probe code indicating the NCR5380 driver
- *	     options that were selected.
- *
- * Inputs : instance, pointer to this instance.  Unused.
- */
-
-static void NCR5380_print_options (struct Scsi_Host *instance)
-{
-    printk(" generic options"
-#ifdef AUTOSENSE 
-    " AUTOSENSE"
-#endif
-#ifdef REAL_DMA
-    " REAL DMA"
-#endif
-#ifdef PSEUDO_DMA
-    " PSEUDO DMA"
-#endif
-#ifdef PARITY
-    " PARITY"
-#endif
-#ifdef SUPPORT_TAGS
-    " SCSI-2 TAGGED QUEUING"
-#endif
-    );
-    printk(" generic release=%d", NCR5380_PUBLIC_RELEASE);
-}
-
-/*
- * Function : void NCR5380_print_status (struct Scsi_Host *instance)
- *
- * Purpose : print commands in the various queues, called from
- *	NCR5380_abort and NCR5380_debug to aid debugging.
- *
- * Inputs : instance, pointer to this instance.  
- */
-
-static void NCR5380_print_status (struct Scsi_Host *instance)
-{
-    char *pr_bfr;
-    char *start;
-    int len;
-
-    NCR_PRINT(NDEBUG_ANY);
-    NCR_PRINT_PHASE(NDEBUG_ANY);
-
-    pr_bfr = (char *) __get_free_page(GFP_ATOMIC);
-    if (!pr_bfr) {
-	printk("NCR5380_print_status: no memory for print buffer\n");
-	return;
-    }
-    len = NCR5380_proc_info(instance, pr_bfr, &start, 0, PAGE_SIZE, 0);
-    pr_bfr[len] = 0;
-    printk("\n%s\n", pr_bfr);
-    free_page((unsigned long) pr_bfr);
-}
-
-
-/******************************************/
-/*
- * /proc/scsi/[dtc pas16 t128 generic]/[0-ASC_NUM_BOARD_SUPPORTED]
- *
- * *buffer: I/O buffer
- * **start: if inout == FALSE pointer into buffer where user read should start
- * offset: current offset
- * length: length of buffer
- * hostno: Scsi_Host host_no
- * inout: TRUE - user is writing; FALSE - user is reading
- *
- * Return the number of bytes read from or written
-*/
-
-#undef SPRINTF
-#define SPRINTF(fmt,args...) \
-  do { if (pos + strlen(fmt) + 20 /* slop */ < buffer + length) \
-	 pos += sprintf(pos, fmt , ## args); } while(0)
-static
-char *lprint_Scsi_Cmnd (Scsi_Cmnd *cmd, char *pos, char *buffer, int length);
-
-static
-int NCR5380_proc_info (struct Scsi_Host *instance, char *buffer, char **start, off_t offset,
-		       int length, int inout)
-{
-    char *pos = buffer;
-    struct NCR5380_hostdata *hostdata;
-    Scsi_Cmnd *ptr;
-    unsigned long flags;
-    off_t begin = 0;
-#define check_offset()				\
-    do {					\
-	if (pos - buffer < offset - begin) {	\
-	    begin += pos - buffer;		\
-	    pos = buffer;			\
-	}					\
-    } while (0)
-
-    if (inout) { /* Has data been written to the file ? */
-	return(-ENOSYS);  /* Currently this is a no-op */
-    }
-    SPRINTF("NCR5380 core release=%d.\n", NCR5380_PUBLIC_RELEASE);
-    check_offset();
-    local_irq_save(flags);
-    SPRINTF("NCR5380: coroutine is%s running.\n", main_running ? "" : "n't");
-    check_offset();
-    if (!hostdata->connected)
-	SPRINTF("scsi%d: no currently connected command\n", HOSTNO);
-    else
-	pos = lprint_Scsi_Cmnd ((Scsi_Cmnd *) hostdata->connected,
-				pos, buffer, length);
-    SPRINTF("scsi%d: issue_queue\n", HOSTNO);
-    check_offset();
-    for (ptr = (Scsi_Cmnd *) hostdata->issue_queue; ptr; ptr = NEXT(ptr)) {
-	pos = lprint_Scsi_Cmnd (ptr, pos, buffer, length);
-	check_offset();
-    }
-
-    SPRINTF("scsi%d: disconnected_queue\n", HOSTNO);
-    check_offset();
-    for (ptr = (Scsi_Cmnd *) hostdata->disconnected_queue; ptr;
-	 ptr = NEXT(ptr)) {
-	pos = lprint_Scsi_Cmnd (ptr, pos, buffer, length);
-	check_offset();
-    }
-
-    local_irq_restore(flags);
-    *start = buffer + (offset - begin);
-    if (pos - buffer < offset - begin)
-	return 0;
-    else if (pos - buffer - (offset - begin) < length)
-	return pos - buffer - (offset - begin);
-    return length;
-}
-
-static char *
-lprint_Scsi_Cmnd (Scsi_Cmnd *cmd, char *pos, char *buffer, int length)
-{
-    int i, s;
-    unsigned char *command;
-    SPRINTF("scsi%d: destination target %d, lun %d\n",
-	    H_NO(cmd), cmd->target, cmd->lun);
-    SPRINTF("        command = ");
-    command = cmd->cmnd;
-    SPRINTF("%2d (0x%02x)", command[0], command[0]);
-    for (i = 1, s = COMMAND_SIZE(command[0]); i < s; ++i)
-	SPRINTF(" %02x", command[i]);
-    SPRINTF("\n");
-    return pos;
-}
-
-
-/* 
- * Function : void NCR5380_init (struct Scsi_Host *instance, int flags)
- *
- * Purpose : initializes *instance and corresponding 5380 chip.
- *
- * Inputs : instance - instantiation of the 5380 driver.  
- *
- * Notes : I assume that the host, hostno, and id bits have been
- * 	set correctly.  I don't care about the irq and other fields. 
- * 
- */
-
-static int NCR5380_init (struct Scsi_Host *instance, int flags)
-{
-    int i;
-    SETUP_HOSTDATA(instance);
-
-    NCR5380_all_init();
-
-    hostdata->aborted = 0;
-    hostdata->id_mask = 1 << instance->this_id;
-    hostdata->id_higher_mask = 0;
-    for (i = hostdata->id_mask; i <= 0x80; i <<= 1)
-	if (i > hostdata->id_mask)
-	    hostdata->id_higher_mask |= i;
-    for (i = 0; i < 8; ++i)
-	hostdata->busy[i] = 0;
-#ifdef SUPPORT_TAGS
-    init_tags();
-#endif
-#if defined (REAL_DMA)
-    hostdata->dma_len = 0;
-#endif
-    hostdata->targets_present = 0;
-    hostdata->connected = NULL;
-    hostdata->issue_queue = NULL;
-    hostdata->disconnected_queue = NULL;
-    hostdata->flags = FLAG_CHECK_LAST_BYTE_SENT;
-
-    if (!the_template) {
-	the_template = instance->hostt;
-	first_instance = instance;
-    }
-	
-
-#ifndef AUTOSENSE
-    if ((instance->cmd_per_lun > 1) || (instance->can_queue > 1))
-	 printk("scsi%d: WARNING : support for multiple outstanding commands enabled\n"
-	        "        without AUTOSENSE option, contingent allegiance conditions may\n"
-	        "        be incorrectly cleared.\n", HOSTNO);
-#endif /* def AUTOSENSE */
-
-    NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE);
-    NCR5380_write(MODE_REG, MR_BASE);
-    NCR5380_write(TARGET_COMMAND_REG, 0);
-    NCR5380_write(SELECT_ENABLE_REG, 0);
-
-    return 0;
-}
-
-/* 
- * Function : int NCR5380_queue_command (Scsi_Cmnd *cmd, 
- *	void (*done)(Scsi_Cmnd *)) 
- *
- * Purpose :  enqueues a SCSI command
- *
- * Inputs : cmd - SCSI command, done - function called on completion, with
- *	a pointer to the command descriptor.
- * 
- * Returns : 0
- *
- * Side effects : 
- *      cmd is added to the per instance issue_queue, with minor 
- *	twiddling done to the host specific fields of cmd.  If the 
- *	main coroutine is not running, it is restarted.
- *
- */
-
-static
-int NCR5380_queue_command (Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *))
-{
-    SETUP_HOSTDATA(cmd->host);
-    Scsi_Cmnd *tmp;
-    int oldto;
-    unsigned long flags;
-
-#if (NDEBUG & NDEBUG_NO_WRITE)
-    switch (cmd->cmnd[0]) {
-    case WRITE_6:
-    case WRITE_10:
-	printk(KERN_NOTICE "scsi%d: WRITE attempted with NO_WRITE debugging flag set\n",
-	       H_NO(cmd));
-	cmd->result = (DID_ERROR << 16);
-	done(cmd);
-	return 0;
-    }
-#endif /* (NDEBUG & NDEBUG_NO_WRITE) */
-
-
-#ifdef NCR5380_STATS
-# if 0
-    if (!hostdata->connected && !hostdata->issue_queue &&
-	!hostdata->disconnected_queue) {
-	hostdata->timebase = jiffies;
-    }
-# endif
-# ifdef NCR5380_STAT_LIMIT
-    if (cmd->request_bufflen > NCR5380_STAT_LIMIT)
-# endif
-	switch (cmd->cmnd[0])
-	{
-	    case WRITE:
-	    case WRITE_6:
-	    case WRITE_10:
-		hostdata->time_write[cmd->target] -= (jiffies - hostdata->timebase);
-		hostdata->bytes_write[cmd->target] += cmd->request_bufflen;
-		hostdata->pendingw++;
-		break;
-	    case READ:
-	    case READ_6:
-	    case READ_10:
-		hostdata->time_read[cmd->target] -= (jiffies - hostdata->timebase);
-		hostdata->bytes_read[cmd->target] += cmd->request_bufflen;
-		hostdata->pendingr++;
-		break;
-	}
-#endif
-
-    /* 
-     * We use the host_scribble field as a pointer to the next command  
-     * in a queue 
-     */
-
-    NEXT(cmd) = NULL;
-    cmd->scsi_done = done;
-
-    cmd->result = 0;
-
-
-    /* 
-     * Insert the cmd into the issue queue. Note that REQUEST SENSE 
-     * commands are added to the head of the queue since any command will
-     * clear the contingent allegiance condition that exists and the 
-     * sense data is only guaranteed to be valid while the condition exists.
-     */
-
-    local_irq_save(flags);
-
-    if (!(hostdata->issue_queue) || (cmd->cmnd[0] == REQUEST_SENSE)) {
-	LIST(cmd, hostdata->issue_queue);
-	NEXT(cmd) = hostdata->issue_queue;
-	hostdata->issue_queue = cmd;
-    } else {
-	for (tmp = (Scsi_Cmnd *)hostdata->issue_queue;
-	     NEXT(tmp); tmp = NEXT(tmp))
-	    ;
-	LIST(cmd, tmp);
-	NEXT(tmp) = cmd;
-    }
-    local_irq_restore(flags);
-
-    QU_PRINTK("scsi%d: command added to %s of queue\n", H_NO(cmd),
-	      (cmd->cmnd[0] == REQUEST_SENSE) ? "head" : "tail");
-
-    /* If queue_command() is called from an interrupt (real one or bottom
-     * half), we let queue_main() do the job of taking care about main. If it
-     * is already running, this is a no-op, else main will be queued.
-     *
-     * If we're not in an interrupt, we can call NCR5380_main()
-     * unconditionally, because it cannot be already running.
-     */
-    if (in_interrupt() > 0 || ((flags >> 8) & 7) >= 6)
-	queue_main();
-    else
-	NCR5380_main(NULL);
-    return 0;
-}
-
-/*
- * Function : NCR5380_main (void *bl)
- *
- * Purpose : NCR5380_main is a coroutine that runs as long as more work can 
- *	be done on the NCR5380 host adapters in a system.  Both 
- *	NCR5380_queue_command() and NCR5380_intr() will try to start it 
- *	in case it is not running.
- * 
- * NOTE : NCR5380_main exits with interrupts *disabled*, the caller should 
- *  reenable them.  This prevents reentrancy and kernel stack overflow.
- */ 	
-    
-static void NCR5380_main (void *bl)
-{
-    Scsi_Cmnd *tmp, *prev;
-    struct Scsi_Host *instance = first_instance;
-    struct NCR5380_hostdata *hostdata = HOSTDATA(instance);
-    int done;
-    unsigned long flags;
-    
-    /*
-     * We run (with interrupts disabled) until we're sure that none of 
-     * the host adapters have anything that can be done, at which point 
-     * we set main_running to 0 and exit.
-     *
-     * Interrupts are enabled before doing various other internal 
-     * instructions, after we've decided that we need to run through
-     * the loop again.
-     *
-     * this should prevent any race conditions.
-     * 
-     * ++roman: Just disabling the NCR interrupt isn't sufficient here,
-     * because also a timer int can trigger an abort or reset, which can
-     * alter queues and touch the Falcon lock.
-     */
-
-    /* Tell int handlers main() is now already executing.  Note that
-       no races are possible here. If an int comes in before
-       'main_running' is set here, and queues/executes main via the
-       task queue, it doesn't do any harm, just this instance of main
-       won't find any work left to do. */
-    if (main_running)
-    	return;
-    main_running = 1;
-
-    local_save_flags(flags);
-    do {
-	local_irq_disable(); /* Freeze request queues */
-	done = 1;
-	
-	if (!hostdata->connected) {
-	    MAIN_PRINTK( "scsi%d: not connected\n", HOSTNO );
-	    /*
-	     * Search through the issue_queue for a command destined
-	     * for a target that's not busy.
-	     */
-#if (NDEBUG & NDEBUG_LISTS)
-	    for (tmp = (Scsi_Cmnd *) hostdata->issue_queue, prev = NULL;
-		 tmp && (tmp != prev); prev = tmp, tmp = NEXT(tmp))
-		;
-		/*printk("%p  ", tmp);*/
-	    if ((tmp == prev) && tmp) printk(" LOOP\n");/* else printk("\n");*/
-#endif
-	    for (tmp = (Scsi_Cmnd *) hostdata->issue_queue, 
-		 prev = NULL; tmp; prev = tmp, tmp = NEXT(tmp) ) {
-
-#if (NDEBUG & NDEBUG_LISTS)
-		if (prev != tmp)
-		    printk("MAIN tmp=%p   target=%d   busy=%d lun=%d\n",
-			   tmp, tmp->target, hostdata->busy[tmp->target],
-			   tmp->lun);
-#endif
-		/*  When we find one, remove it from the issue queue. */
-		if (
-#ifdef SUPPORT_TAGS
-		    !is_lun_busy( tmp, tmp->cmnd[0] != REQUEST_SENSE)
-#else
-		    !(hostdata->busy[tmp->target] & (1 << tmp->lun))
-#endif
-		    ) {
-		    /* ++guenther: just to be sure, this must be atomic */
-		    local_irq_disable();
-		    if (prev) {
-		        REMOVE(prev, NEXT(prev), tmp, NEXT(tmp));
-			NEXT(prev) = NEXT(tmp);
-		    } else {
-		        REMOVE(-1, hostdata->issue_queue, tmp, NEXT(tmp));
-			hostdata->issue_queue = NEXT(tmp);
-		    }
-		    NEXT(tmp) = NULL;
-		    
-		    /* reenable interrupts after finding one */
-		    local_irq_restore(flags);
-		    
-		    /* 
-		     * Attempt to establish an I_T_L nexus here. 
-		     * On success, instance->hostdata->connected is set.
-		     * On failure, we must add the command back to the
-		     *   issue queue so we can keep trying.	
-		     */
-		    MAIN_PRINTK("scsi%d: main(): command for target %d "
-				"lun %d removed from issue_queue\n",
-				HOSTNO, tmp->target, tmp->lun);
-		    /* 
-		     * REQUEST SENSE commands are issued without tagged
-		     * queueing, even on SCSI-II devices because the 
-		     * contingent allegiance condition exists for the 
-		     * entire unit.
-		     */
-		    /* ++roman: ...and the standard also requires that
-		     * REQUEST SENSE command are untagged.
-		     */
-		    
-#ifdef SUPPORT_TAGS
-		    cmd_get_tag( tmp, tmp->cmnd[0] != REQUEST_SENSE );
-#endif
-		    if (!NCR5380_select(instance, tmp, 
-			    (tmp->cmnd[0] == REQUEST_SENSE) ? TAG_NONE : 
-			    TAG_NEXT)) {
-			break;
-		    } else {
-			local_irq_disable();
-			LIST(tmp, hostdata->issue_queue);
-			NEXT(tmp) = hostdata->issue_queue;
-			hostdata->issue_queue = tmp;
-#ifdef SUPPORT_TAGS
-			cmd_free_tag( tmp );
-#endif
-			local_irq_restore(flags);
-			MAIN_PRINTK("scsi%d: main(): select() failed, "
-				    "returned to issue_queue\n", HOSTNO);
-			if (hostdata->connected)
-			    break;
-		    }
-		} /* if target/lun/target queue is not busy */
-	    } /* for issue_queue */
-	} /* if (!hostdata->connected) */
-		
-	if (hostdata->connected 
-#ifdef REAL_DMA
-	    && !hostdata->dma_len
-#endif
-	    ) {
-	    local_irq_restore(flags);
-	    MAIN_PRINTK("scsi%d: main: performing information transfer\n",
-			HOSTNO);
-	    NCR5380_information_transfer(instance);
-	    MAIN_PRINTK("scsi%d: main: done set false\n", HOSTNO);
-	    done = 0;
-	}
-    } while (!done);
-
-    /* Better allow ints _after_ 'main_running' has been cleared, else
-       an interrupt could believe we'll pick up the work it left for
-       us, but we won't see it anymore here... */
-    main_running = 0;
-    local_irq_restore(flags);
-}
-
-
-#ifdef REAL_DMA
-/*
- * Function : void NCR5380_dma_complete (struct Scsi_Host *instance)
- *
- * Purpose : Called by interrupt handler when DMA finishes or a phase
- *	mismatch occurs (which would finish the DMA transfer).  
- *
- * Inputs : instance - this instance of the NCR5380.
- *
- */
-
-static void NCR5380_dma_complete( struct Scsi_Host *instance )
-{
-    SETUP_HOSTDATA(instance);
-    int           transfered, saved_data = 0, overrun = 0, cnt, toPIO;
-    unsigned char **data, p;
-    volatile int  *count;
-
-    if (!hostdata->connected) {
-	printk(KERN_WARNING "scsi%d: received end of DMA interrupt with "
-	       "no connected cmd\n", HOSTNO);
-	return;
-    }
-    
-    if (mac_read_overruns) {
-	p = hostdata->connected->SCp.phase;
-	if (p & SR_IO) {
-	    udelay(10);
-	    if ((((NCR5380_read(BUS_AND_STATUS_REG)) &
-		  (BASR_PHASE_MATCH|BASR_ACK)) ==
-		 (BASR_PHASE_MATCH|BASR_ACK))) {
-		saved_data = NCR5380_read(INPUT_DATA_REG);
-		overrun = 1;
-		DMA_PRINTK("scsi%d: read overrun handled\n", HOSTNO);
-	    }
-	}
-    }
-
-    DMA_PRINTK("scsi%d: real DMA transfer complete, basr 0x%X, sr 0x%X\n",
-	       HOSTNO, NCR5380_read(BUS_AND_STATUS_REG),
-	       NCR5380_read(STATUS_REG));
-
-    (void) NCR5380_read(RESET_PARITY_INTERRUPT_REG);
-    NCR5380_write(MODE_REG, MR_BASE);
-    NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE);
-
-    transfered = hostdata->dma_len - NCR5380_dma_residual(instance);
-    hostdata->dma_len = 0;
-
-    data = (unsigned char **) &(hostdata->connected->SCp.ptr);
-    count = &(hostdata->connected->SCp.this_residual);
-    *data += transfered;
-    *count -= transfered;
-
-    if (mac_read_overruns) {
-	if ((NCR5380_read(STATUS_REG) & PHASE_MASK) == p && (p & SR_IO)) {
-	    cnt = toPIO = mac_read_overruns;
-	    if (overrun) {
-		DMA_PRINTK("Got an input overrun, using saved byte\n");
-		*(*data)++ = saved_data;
-		(*count)--;
-		cnt--;
-		toPIO--;
-	    }
-	    DMA_PRINTK("Doing %d-byte PIO to 0x%08lx\n", cnt, (long)*data);
-	    NCR5380_transfer_pio(instance, &p, &cnt, data);
-	    *count -= toPIO - cnt;
-	}
-    }
-}
-#endif /* REAL_DMA */
-
-
-/*
- * Function : void NCR5380_intr (int irq)
- * 
- * Purpose : handle interrupts, reestablishing I_T_L or I_T_L_Q nexuses
- *	from the disconnected queue, and restarting NCR5380_main() 
- *	as required.
- *
- * Inputs : int irq, irq that caused this interrupt.
- *
- */
-
-static void NCR5380_intr (int irq, void *dev_id, struct pt_regs *regs)
-{
-    struct Scsi_Host *instance = first_instance;
-    int done = 1, handled = 0;
-    unsigned char basr;
-
-    INT_PRINTK("scsi%d: NCR5380 irq triggered\n", HOSTNO);
-
-    /* Look for pending interrupts */
-    basr = NCR5380_read(BUS_AND_STATUS_REG);
-    INT_PRINTK("scsi%d: BASR=%02x\n", HOSTNO, basr);
-    /* dispatch to appropriate routine if found and done=0 */
-    if (basr & BASR_IRQ) {
-	NCR_PRINT(NDEBUG_INTR);
-	if ((NCR5380_read(STATUS_REG) & (SR_SEL|SR_IO)) == (SR_SEL|SR_IO)) {
-	    done = 0;
-	    ENABLE_IRQ();
-	    INT_PRINTK("scsi%d: SEL interrupt\n", HOSTNO);
-	    NCR5380_reselect(instance);
-	    (void) NCR5380_read(RESET_PARITY_INTERRUPT_REG);
-	}
-	else if (basr & BASR_PARITY_ERROR) {
-	    INT_PRINTK("scsi%d: PARITY interrupt\n", HOSTNO);
-	    (void) NCR5380_read(RESET_PARITY_INTERRUPT_REG);
-	}
-	else if ((NCR5380_read(STATUS_REG) & SR_RST) == SR_RST) {
-	    INT_PRINTK("scsi%d: RESET interrupt\n", HOSTNO);
-	    (void)NCR5380_read(RESET_PARITY_INTERRUPT_REG);
-	}
-	else {
-	    /*  
-	     * The rest of the interrupt conditions can occur only during a
-	     * DMA transfer
-	     */
-
-#if defined(REAL_DMA)
-	    /*
-	     * We should only get PHASE MISMATCH and EOP interrupts if we have
-	     * DMA enabled, so do a sanity check based on the current setting
-	     * of the MODE register.
-	     */
-
-	    if ((NCR5380_read(MODE_REG) & MR_DMA_MODE) &&
-		((basr & BASR_END_DMA_TRANSFER) || 
-		 !(basr & BASR_PHASE_MATCH))) {
-		    
-		INT_PRINTK("scsi%d: PHASE MISM or EOP interrupt\n", HOSTNO);
-		NCR5380_dma_complete( instance );
-		done = 0;
-		ENABLE_IRQ();
-	    } else
-#endif /* REAL_DMA */
-	    {
-/* MS: Ignore unknown phase mismatch interrupts (caused by EOP interrupt) */
-		if (basr & BASR_PHASE_MATCH)
-		    printk(KERN_NOTICE "scsi%d: unknown interrupt, "
-			   "BASR 0x%x, MR 0x%x, SR 0x%x\n",
-			   HOSTNO, basr, NCR5380_read(MODE_REG),
-			   NCR5380_read(STATUS_REG));
-		(void) NCR5380_read(RESET_PARITY_INTERRUPT_REG);
-	    }
-	} /* if !(SELECTION || PARITY) */
-	handled = 1;
-    } /* BASR & IRQ */
-    else {
-	printk(KERN_NOTICE "scsi%d: interrupt without IRQ bit set in BASR, "
-	       "BASR 0x%X, MR 0x%X, SR 0x%x\n", HOSTNO, basr,
-	       NCR5380_read(MODE_REG), NCR5380_read(STATUS_REG));
-	(void) NCR5380_read(RESET_PARITY_INTERRUPT_REG);
-    }
-    
-    if (!done) {
-	INT_PRINTK("scsi%d: in int routine, calling main\n", HOSTNO);
-	/* Put a call to NCR5380_main() on the queue... */
-	queue_main();
-    }
-    return IRQ_RETVAL(handled);
-}
-
-#ifdef NCR5380_STATS
-static void collect_stats(struct NCR5380_hostdata* hostdata, Scsi_Cmnd* cmd)
-{
-# ifdef NCR5380_STAT_LIMIT
-    if (cmd->request_bufflen > NCR5380_STAT_LIMIT)
-# endif
-	switch (cmd->cmnd[0])
-	{
-	    case WRITE:
-	    case WRITE_6:
-	    case WRITE_10:
-		hostdata->time_write[cmd->target] += (jiffies - hostdata->timebase);
-		/*hostdata->bytes_write[cmd->target] += cmd->request_bufflen;*/
-		hostdata->pendingw--;
-		break;
-	    case READ:
-	    case READ_6:
-	    case READ_10:
-		hostdata->time_read[cmd->target] += (jiffies - hostdata->timebase);
-		/*hostdata->bytes_read[cmd->target] += cmd->request_bufflen;*/
-		hostdata->pendingr--;
-		break;
-	}
-}
-#endif
-
-/* 
- * Function : int NCR5380_select (struct Scsi_Host *instance, Scsi_Cmnd *cmd, 
- *	int tag);
- *
- * Purpose : establishes I_T_L or I_T_L_Q nexus for new or existing command,
- *	including ARBITRATION, SELECTION, and initial message out for 
- *	IDENTIFY and queue messages. 
- *
- * Inputs : instance - instantiation of the 5380 driver on which this 
- * 	target lives, cmd - SCSI command to execute, tag - set to TAG_NEXT for 
- *	new tag, TAG_NONE for untagged queueing, otherwise set to the tag for 
- *	the command that is presently connected.
- * 
- * Returns : -1 if selection could not execute for some reason,
- *	0 if selection succeeded or failed because the target 
- * 	did not respond.
- *
- * Side effects : 
- * 	If bus busy, arbitration failed, etc, NCR5380_select() will exit 
- *		with registers as they should have been on entry - ie
- *		SELECT_ENABLE will be set appropriately, the NCR5380
- *		will cease to drive any SCSI bus signals.
- *
- *	If successful : I_T_L or I_T_L_Q nexus will be established, 
- *		instance->connected will be set to cmd.  
- * 		SELECT interrupt will be disabled.
- *
- *	If failed (no target) : cmd->scsi_done() will be called, and the 
- *		cmd->result host byte set to DID_BAD_TARGET.
- */
-
-static int NCR5380_select (struct Scsi_Host *instance, Scsi_Cmnd *cmd, int tag)
-{
-    SETUP_HOSTDATA(instance);
-    unsigned char tmp[3], phase;
-    unsigned char *data;
-    int len;
-    unsigned long timeout;
-    unsigned long flags;
-
-    hostdata->restart_select = 0;
-    NCR_PRINT(NDEBUG_ARBITRATION);
-    ARB_PRINTK("scsi%d: starting arbitration, id = %d\n", HOSTNO,
-	       instance->this_id);
-
-    /* 
-     * Set the phase bits to 0, otherwise the NCR5380 won't drive the 
-     * data bus during SELECTION.
-     */
-
-    local_irq_save(flags);
-    if (hostdata->connected) {
-	local_irq_restore(flags);
-	return -1;
-    }
-    NCR5380_write(TARGET_COMMAND_REG, 0);
-
-
-    /* 
-     * Start arbitration.
-     */
-    
-    NCR5380_write(OUTPUT_DATA_REG, hostdata->id_mask);
-    NCR5380_write(MODE_REG, MR_ARBITRATE);
-
-    local_irq_restore(flags);
-
-    /* Wait for arbitration logic to complete */
-#if NCR_TIMEOUT
-    {
-      unsigned long timeout = jiffies + 2*NCR_TIMEOUT;
-
-      while (!(NCR5380_read(INITIATOR_COMMAND_REG) & ICR_ARBITRATION_PROGRESS)
-	   && time_before(jiffies, timeout) && !hostdata->connected)
-	;
-      if (time_after_eq(jiffies, timeout))
-      {
-	printk("scsi : arbitration timeout at %d\n", __LINE__);
-	NCR5380_write(MODE_REG, MR_BASE);
-	NCR5380_write(SELECT_ENABLE_REG, hostdata->id_mask);
-	return -1;
-      }
-    }
-#else /* NCR_TIMEOUT */
-    while (!(NCR5380_read(INITIATOR_COMMAND_REG) & ICR_ARBITRATION_PROGRESS)
-	 && !hostdata->connected);
-#endif
-
-    ARB_PRINTK("scsi%d: arbitration complete\n", HOSTNO);
-
-    if (hostdata->connected) {
-	NCR5380_write(MODE_REG, MR_BASE); 
-	return -1;
-    }
-    /* 
-     * The arbitration delay is 2.2us, but this is a minimum and there is 
-     * no maximum so we can safely sleep for ceil(2.2) usecs to accommodate
-     * the integral nature of udelay().
-     *
-     */
-
-    udelay(3);
-
-    /* Check for lost arbitration */
-    if ((NCR5380_read(INITIATOR_COMMAND_REG) & ICR_ARBITRATION_LOST) ||
-	(NCR5380_read(CURRENT_SCSI_DATA_REG) & hostdata->id_higher_mask) ||
-	(NCR5380_read(INITIATOR_COMMAND_REG) & ICR_ARBITRATION_LOST) ||
-	hostdata->connected) {
-	NCR5380_write(MODE_REG, MR_BASE); 
-	ARB_PRINTK("scsi%d: lost arbitration, deasserting MR_ARBITRATE\n",
-		   HOSTNO);
-	return -1;
-    }
-
-     /* after/during arbitration, BSY should be asserted.
-	IBM DPES-31080 Version S31Q works now */
-     /* Tnx to Thomas_Roesch@m2.maus.de for finding this! (Roman) */
-    NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE | ICR_ASSERT_SEL |
-					 ICR_ASSERT_BSY ) ;
-    
-    if ((NCR5380_read(INITIATOR_COMMAND_REG) & ICR_ARBITRATION_LOST) ||
-	hostdata->connected) {
-	NCR5380_write(MODE_REG, MR_BASE);
-	NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE);
-	ARB_PRINTK("scsi%d: lost arbitration, deasserting ICR_ASSERT_SEL\n",
-		   HOSTNO);
-	return -1;
-    }
-
-    /* 
-     * Again, bus clear + bus settle time is 1.2us, however, this is 
-     * a minimum so we'll udelay ceil(1.2)
-     */
-
-#ifdef CONFIG_ATARI_SCSI_TOSHIBA_DELAY
-    /* ++roman: But some targets (see above :-) seem to need a bit more... */
-    udelay(15);
-#else
-    udelay(2);
-#endif
-    
-    if (hostdata->connected) {
-	NCR5380_write(MODE_REG, MR_BASE);
-	NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE);
-	return -1;
-    }
-
-    ARB_PRINTK("scsi%d: won arbitration\n", HOSTNO);
-
-    /* 
-     * Now that we have won arbitration, start Selection process, asserting 
-     * the host and target ID's on the SCSI bus.
-     */
-
-    NCR5380_write(OUTPUT_DATA_REG, (hostdata->id_mask | (1 << cmd->target)));
-
-    /* 
-     * Raise ATN while SEL is true before BSY goes false from arbitration,
-     * since this is the only way to guarantee that we'll get a MESSAGE OUT
-     * phase immediately after selection.
-     */
-
-    NCR5380_write(INITIATOR_COMMAND_REG, (ICR_BASE | ICR_ASSERT_BSY | 
-	ICR_ASSERT_DATA | ICR_ASSERT_ATN | ICR_ASSERT_SEL ));
-    NCR5380_write(MODE_REG, MR_BASE);
-
-    /* 
-     * Reselect interrupts must be turned off prior to the dropping of BSY,
-     * otherwise we will trigger an interrupt.
-     */
-
-    if (hostdata->connected) {
-	NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE);
-	return -1;
-    }
-
-    NCR5380_write(SELECT_ENABLE_REG, 0);
-
-    /*
-     * The initiator shall then wait at least two deskew delays and release 
-     * the BSY signal.
-     */
-    udelay(1);        /* wingel -- wait two bus deskew delay >2*45ns */
-
-    /* Reset BSY */
-    NCR5380_write(INITIATOR_COMMAND_REG, (ICR_BASE | ICR_ASSERT_DATA | 
-	ICR_ASSERT_ATN | ICR_ASSERT_SEL));
-
-    /* 
-     * Something weird happens when we cease to drive BSY - looks
-     * like the board/chip is letting us do another read before the 
-     * appropriate propagation delay has expired, and we're confusing
-     * a BSY signal from ourselves as the target's response to SELECTION.
-     *
-     * A small delay (the 'C++' frontend breaks the pipeline with an
-     * unnecessary jump, making it work on my 386-33/Trantor T128, the
-     * tighter 'C' code breaks and requires this) solves the problem - 
-     * the 1 us delay is arbitrary, and only used because this delay will 
-     * be the same on other platforms and since it works here, it should 
-     * work there.
-     *
-     * wingel suggests that this could be due to failing to wait
-     * one deskew delay.
-     */
-
-    udelay(1);
-
-    SEL_PRINTK("scsi%d: selecting target %d\n", HOSTNO, cmd->target);
-
-    /* 
-     * The SCSI specification calls for a 250 ms timeout for the actual 
-     * selection.
-     */
-
-    timeout = jiffies + 25; 
-
-    /* 
-     * XXX very interesting - we're seeing a bounce where the BSY we 
-     * asserted is being reflected / still asserted (propagation delay?)
-     * and it's detecting as true.  Sigh.
-     */
-
-#if 0
-    /* ++roman: If a target conformed to the SCSI standard, it wouldn't assert
-     * IO while SEL is true. But again, there are some disks out the in the
-     * world that do that nevertheless. (Somebody claimed that this announces
-     * reselection capability of the target.) So we better skip that test and
-     * only wait for BSY... (Famous german words: Der Klügere gibt nach :-)
-     */
-
-    while (time_before(jiffies, timeout) && !(NCR5380_read(STATUS_REG) & 
-	(SR_BSY | SR_IO)));
-
-    if ((NCR5380_read(STATUS_REG) & (SR_SEL | SR_IO)) == 
-	    (SR_SEL | SR_IO)) {
-	    NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE);
-	    NCR5380_reselect(instance);
-	    printk (KERN_ERR "scsi%d: reselection after won arbitration?\n",
-		    HOSTNO);
-	    NCR5380_write(SELECT_ENABLE_REG, hostdata->id_mask);
-	    return -1;
-    }
-#else
-    while (time_before(jiffies, timeout) && !(NCR5380_read(STATUS_REG) & SR_BSY));
-#endif
-
-    /* 
-     * No less than two deskew delays after the initiator detects the 
-     * BSY signal is true, it shall release the SEL signal and may 
-     * change the DATA BUS.                                     -wingel
-     */
-
-    udelay(1);
-
-    NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE | ICR_ASSERT_ATN);
-
-    if (!(NCR5380_read(STATUS_REG) & SR_BSY)) {
-	NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE);
-	if (hostdata->targets_present & (1 << cmd->target)) {
-	    printk(KERN_ERR "scsi%d: weirdness\n", HOSTNO);
-	    if (hostdata->restart_select)
-		printk(KERN_NOTICE "\trestart select\n");
-	    NCR_PRINT(NDEBUG_ANY);
-	    NCR5380_write(SELECT_ENABLE_REG, hostdata->id_mask);
-	    return -1;
-	}
-	cmd->result = DID_BAD_TARGET << 16;
-#ifdef NCR5380_STATS
-	collect_stats(hostdata, cmd);
-#endif
-#ifdef SUPPORT_TAGS
-	cmd_free_tag( cmd );
-#endif
-	cmd->scsi_done(cmd);
-	NCR5380_write(SELECT_ENABLE_REG, hostdata->id_mask);
-	SEL_PRINTK("scsi%d: target did not respond within 250ms\n", HOSTNO);
-	NCR5380_write(SELECT_ENABLE_REG, hostdata->id_mask);
-	return 0;
-    } 
-
-    hostdata->targets_present |= (1 << cmd->target);
-
-    /*
-     * Since we followed the SCSI spec, and raised ATN while SEL 
-     * was true but before BSY was false during selection, the information
-     * transfer phase should be a MESSAGE OUT phase so that we can send the
-     * IDENTIFY message.
-     * 
-     * If SCSI-II tagged queuing is enabled, we also send a SIMPLE_QUEUE_TAG
-     * message (2 bytes) with a tag ID that we increment with every command
-     * until it wraps back to 0.
-     *
-     * XXX - it turns out that there are some broken SCSI-II devices,
-     *	     which claim to support tagged queuing but fail when more than
-     *	     some number of commands are issued at once.
-     */
-
-    /* Wait for start of REQ/ACK handshake */
-    while (!(NCR5380_read(STATUS_REG) & SR_REQ));
-
-    SEL_PRINTK("scsi%d: target %d selected, going into MESSAGE OUT phase.\n",
-	       HOSTNO, cmd->target);
-    tmp[0] = IDENTIFY(1, cmd->lun);
-
-#ifdef SUPPORT_TAGS
-    if (cmd->tag != TAG_NONE) {
-	tmp[1] = hostdata->last_message = SIMPLE_QUEUE_TAG;
-	tmp[2] = cmd->tag;
-	len = 3;
-    } else 
-	len = 1;
-#else
-    len = 1;
-    cmd->tag=0;
-#endif /* SUPPORT_TAGS */
-
-    /* Send message(s) */
-    data = tmp;
-    phase = PHASE_MSGOUT;
-    NCR5380_transfer_pio(instance, &phase, &len, &data);
-    SEL_PRINTK("scsi%d: nexus established.\n", HOSTNO);
-    /* XXX need to handle errors here */
-    hostdata->connected = cmd;
-#ifndef SUPPORT_TAGS
-    hostdata->busy[cmd->target] |= (1 << cmd->lun);
-#endif    
-
-    initialize_SCp(cmd);
-
-
-    return 0;
-}
-
-/* 
- * Function : int NCR5380_transfer_pio (struct Scsi_Host *instance, 
- *      unsigned char *phase, int *count, unsigned char **data)
- *
- * Purpose : transfers data in given phase using polled I/O
- *
- * Inputs : instance - instance of driver, *phase - pointer to 
- *	what phase is expected, *count - pointer to number of 
- *	bytes to transfer, **data - pointer to data pointer.
- * 
- * Returns : -1 when different phase is entered without transferring
- *	maximum number of bytes, 0 if all bytes are transfered or exit
- *	is in same phase.
- *
- * 	Also, *phase, *count, *data are modified in place.
- *
- * XXX Note : handling for bus free may be useful.
- */
-
-/*
- * Note : this code is not as quick as it could be, however it 
- * IS 100% reliable, and for the actual data transfer where speed
- * counts, we will always do a pseudo DMA or DMA transfer.
- */
-
-static int NCR5380_transfer_pio( struct Scsi_Host *instance, 
-				 unsigned char *phase, int *count,
-				 unsigned char **data)
-{
-    register unsigned char p = *phase, tmp;
-    register int c = *count;
-    register unsigned char *d = *data;
-
-    /* 
-     * The NCR5380 chip will only drive the SCSI bus when the 
-     * phase specified in the appropriate bits of the TARGET COMMAND
-     * REGISTER match the STATUS REGISTER
-     */
-
-    NCR5380_write(TARGET_COMMAND_REG, PHASE_SR_TO_TCR(p));
-
-    do {
-	/* 
-	 * Wait for assertion of REQ, after which the phase bits will be 
-	 * valid 
-	 */
-	while (!((tmp = NCR5380_read(STATUS_REG)) & SR_REQ));
-
-	HSH_PRINTK("scsi%d: REQ detected\n", HOSTNO);
-
-	/* Check for phase mismatch */	
-	if ((tmp & PHASE_MASK) != p) {
-	    PIO_PRINTK("scsi%d: phase mismatch\n", HOSTNO);
-	    NCR_PRINT_PHASE(NDEBUG_PIO);
-	    break;
-	}
-
-	/* Do actual transfer from SCSI bus to / from memory */
-	if (!(p & SR_IO)) 
-	    NCR5380_write(OUTPUT_DATA_REG, *d);
-	else 
-	    *d = NCR5380_read(CURRENT_SCSI_DATA_REG);
-
-	++d;
-
-	/* 
-	 * The SCSI standard suggests that in MSGOUT phase, the initiator
-	 * should drop ATN on the last byte of the message phase
-	 * after REQ has been asserted for the handshake but before
-	 * the initiator raises ACK.
-	 */
-
-	if (!(p & SR_IO)) {
-	    if (!((p & SR_MSG) && c > 1)) {
-		NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE | 
-		    ICR_ASSERT_DATA);
-		NCR_PRINT(NDEBUG_PIO);
-		NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE | 
-			ICR_ASSERT_DATA | ICR_ASSERT_ACK);
-	    } else {
-		NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE |
-		    ICR_ASSERT_DATA | ICR_ASSERT_ATN);
-		NCR_PRINT(NDEBUG_PIO);
-		NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE | 
-		    ICR_ASSERT_DATA | ICR_ASSERT_ATN | ICR_ASSERT_ACK);
-	    }
-	} else {
-	    NCR_PRINT(NDEBUG_PIO);
-	    NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE | ICR_ASSERT_ACK);
-	}
-
-	while (NCR5380_read(STATUS_REG) & SR_REQ);
-
-	HSH_PRINTK("scsi%d: req false, handshake complete\n", HOSTNO);
-
-/*
- * We have several special cases to consider during REQ/ACK handshaking : 
- * 1.  We were in MSGOUT phase, and we are on the last byte of the 
- *	message.  ATN must be dropped as ACK is dropped.
- *
- * 2.  We are in a MSGIN phase, and we are on the last byte of the  
- *	message.  We must exit with ACK asserted, so that the calling
- *	code may raise ATN before dropping ACK to reject the message.
- *
- * 3.  ACK and ATN are clear and the target may proceed as normal.
- */
-	if (!(p == PHASE_MSGIN && c == 1)) {  
-	    if (p == PHASE_MSGOUT && c > 1)
-		NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE | ICR_ASSERT_ATN);
-	    else
-		NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE);
-	} 
-    } while (--c);
-
-    PIO_PRINTK("scsi%d: residual %d\n", HOSTNO, c);
-
-    *count = c;
-    *data = d;
-    tmp = NCR5380_read(STATUS_REG);
-    /* The phase read from the bus is valid if either REQ is (already)
-     * asserted or if ACK hasn't been released yet. The latter is the case if
-     * we're in MSGIN and all wanted bytes have been received. */
-    if ((tmp & SR_REQ) || (p == PHASE_MSGIN && c == 0))
-	*phase = tmp & PHASE_MASK;
-    else 
-	*phase = PHASE_UNKNOWN;
-
-    if (!c || (*phase == p))
-	return 0;
-    else 
-	return -1;
-}
-
-/*
- * Function : do_abort (Scsi_Host *host)
- * 
- * Purpose : abort the currently established nexus.  Should only be 
- * 	called from a routine which can drop into a 
- * 
- * Returns : 0 on success, -1 on failure.
- */
-
-static int do_abort (struct Scsi_Host *host) 
-{
-    unsigned char tmp, *msgptr, phase;
-    int len;
-
-    /* Request message out phase */
-    NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE | ICR_ASSERT_ATN);
-
-    /* 
-     * Wait for the target to indicate a valid phase by asserting 
-     * REQ.  Once this happens, we'll have either a MSGOUT phase 
-     * and can immediately send the ABORT message, or we'll have some 
-     * other phase and will have to source/sink data.
-     * 
-     * We really don't care what value was on the bus or what value
-     * the target sees, so we just handshake.
-     */
-    
-    while (!(tmp = NCR5380_read(STATUS_REG)) & SR_REQ);
-
-    NCR5380_write(TARGET_COMMAND_REG, PHASE_SR_TO_TCR(tmp));
-
-    if ((tmp & PHASE_MASK) != PHASE_MSGOUT) {
-	NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE | ICR_ASSERT_ATN | 
-		      ICR_ASSERT_ACK);
-	while (NCR5380_read(STATUS_REG) & SR_REQ);
-	NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE | ICR_ASSERT_ATN);
-    }
-   
-    tmp = ABORT;
-    msgptr = &tmp;
-    len = 1;
-    phase = PHASE_MSGOUT;
-    NCR5380_transfer_pio (host, &phase, &len, &msgptr);
-
-    /*
-     * If we got here, and the command completed successfully,
-     * we're about to go into bus free state.
-     */
-
-    return len ? -1 : 0;
-}
-
-#if defined(REAL_DMA) || defined(PSEUDO_DMA)
-/* 
- * Function : int NCR5380_transfer_dma (struct Scsi_Host *instance, 
- *      unsigned char *phase, int *count, unsigned char **data)
- *
- * Purpose : transfers data in given phase using either real
- *	or pseudo DMA.
- *
- * Inputs : instance - instance of driver, *phase - pointer to 
- *	what phase is expected, *count - pointer to number of 
- *	bytes to transfer, **data - pointer to data pointer.
- * 
- * Returns : -1 when different phase is entered without transferring
- *	maximum number of bytes, 0 if all bytes or transfered or exit
- *	is in same phase.
- *
- * 	Also, *phase, *count, *data are modified in place.
- *
- */
-
-
-static int NCR5380_transfer_dma( struct Scsi_Host *instance, 
-				 unsigned char *phase, int *count,
-				 unsigned char **data)
-{
-    SETUP_HOSTDATA(instance);
-    register int c = *count;
-    register unsigned char p = *phase;
-    register unsigned char *d = *data;
-    register int foo;
-    unsigned char tmp;
-    unsigned long flags;
-
-
-    if ((tmp = (NCR5380_read(STATUS_REG) & PHASE_MASK)) != p) {
-        *phase = tmp;
-        return -1;
-    }
-
-    if (mac_read_overruns && (p & SR_IO)) {
-	c -= mac_read_overruns;
-    }
-
-    DMA_PRINTK("scsi%d: initializing DMA for %s, %d bytes %s %p\n",
-	       HOSTNO, (p & SR_IO) ? "reading" : "writing",
-	       c, (p & SR_IO) ? "to" : "from", d);
-
-    NCR5380_write(TARGET_COMMAND_REG, PHASE_SR_TO_TCR(p));
-
-#ifdef REAL_DMA
-    NCR5380_write(MODE_REG, MR_BASE | MR_DMA_MODE | MR_ENABLE_EOP_INTR | MR_MONITOR_BSY);
-#else /* PSEUDO_DMA! */
-#if defined(PSEUDO_DMA) && !defined(UNSAFE)
-    local_irq_save(flags);
-#endif
-    /* KLL May need eop and parity in 53c400 */
-    if (hostdata->flags & FLAG_NCR53C400)
-	NCR5380_write(MODE_REG, MR_BASE | MR_DMA_MODE | MR_ENABLE_PAR_CHECK
-	| MR_ENABLE_PAR_INTR | MR_ENABLE_EOP_INTR | MR_DMA_MODE
-	| MR_MONITOR_BSY);
-    else
-#ifndef EMULATE_PSEUDO_DMA
-	NCR5380_write(MODE_REG, MR_BASE | MR_DMA_MODE);
-#else
-        NCR5380_write(MODE_REG, MR_BASE);
-#endif
-#endif /* def REAL_DMA  */
-
-#ifdef REAL_DMA
-    /* On the Medusa, it is a must to initialize the DMA before
-     * starting the NCR. This is also the cleaner way for the TT.
-     */
-    local_irq_save(flags);
-    hostdata->dma_len = (p & SR_IO) ?
-        NCR5380_dma_read_setup(instance, d, c) : 
-        NCR5380_dma_write_setup(instance, d, c);
-    local_irq_restore(flags);
-#endif /* def REAL_DMA */
-
-#ifndef EMULATE_PSEUDO_DMA
-    if (p & SR_IO)
-	NCR5380_write(START_DMA_INITIATOR_RECEIVE_REG, 0);
-    else {
-	NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE | ICR_ASSERT_DATA);
-	NCR5380_write(START_DMA_SEND_REG, 0);
-    }
-#else
-    hostdata->dma_len = c;
-#endif
-
-#if defined(REAL_DMA)
-    return 0;
-#else /* defined(PSEUDO_DMA) */
-    if (p & SR_IO) {
-#ifdef DMA_WORKS_RIGHT
-        foo = NCR5380_pread(instance, d, c);
-#else
-	int diff = 1;
-	if (hostdata->flags & FLAG_NCR53C400) {
-	    diff=0;
-	}
-
-	if (!(foo = NCR5380_pread(instance, d, c - diff))) {
-	    /*
-	     * We can't disable DMA mode after successfully transferring 
-	     * what we plan to be the last byte, since that would open up
-	     * a race condition where if the target asserted REQ before 
-	     * we got the DMA mode reset, the NCR5380 would have latched
-	     * an additional byte into the INPUT DATA register and we'd
-	     * have dropped it.
-	     * 
-	     * The workaround was to transfer one fewer bytes than we 
-	     * intended to with the pseudo-DMA read function, wait for 
-	     * the chip to latch the last byte, read it, and then disable
-	     * pseudo-DMA mode.
-	     * 
-	     * After REQ is asserted, the NCR5380 asserts DRQ and ACK.
-	     * REQ is deasserted when ACK is asserted, and not reasserted
-	     * until ACK goes false.  Since the NCR5380 won't lower ACK
-	     * until DACK is asserted, which won't happen unless we twiddle
-	     * the DMA port or we take the NCR5380 out of DMA mode, we 
-	     * can guarantee that we won't handshake another extra 
-	     * byte.
-    	     */
-
-	    if (!(hostdata->flags & FLAG_NCR53C400)) {
-		while (!(NCR5380_read(BUS_AND_STATUS_REG) & BASR_DRQ));
-		/* Wait for clean handshake */
-		while (NCR5380_read(STATUS_REG) & SR_REQ);
-		d[c - 1] = NCR5380_read(INPUT_DATA_REG);
-	    }
-	}
-#endif
-    } else {
-#ifdef DMA_WORKS_RIGHT
-        foo = NCR5380_pwrite(instance, d, c);
-#else
-        int timeout;
-#if (NDEBUG & NDEBUG_C400_PWRITE)
-	printk("About to pwrite %d bytes\n", c);
-#endif
-	if (!(foo = NCR5380_pwrite(instance, d, c))) {
-	    /*
-	     * Wait for the last byte to be sent.  If REQ is being asserted for 
-	     * the byte we're interested, we'll ACK it and it will go false.  
-	     */
-	    if (!(hostdata->flags & FLAG_HAS_LAST_BYTE_SENT)) {
-		timeout = 20000;
-#if 1
-#if 1
-		while (!(NCR5380_read(BUS_AND_STATUS_REG) & 
-			BASR_DRQ) && (NCR5380_read(BUS_AND_STATUS_REG) &
-			BASR_PHASE_MATCH));
-#else
-		if (NCR5380_read(STATUS_REG) & SR_REQ) {
-		    for (; timeout && 
-			!(NCR5380_read(BUS_AND_STATUS_REG) & BASR_ACK); 
-			--timeout);
-		    for (; timeout && (NCR5380_read(STATUS_REG) & SR_REQ);
-			--timeout);
-		} 
-#endif
-	
-
-#if (NDEBUG & NDEBUG_LAST_BYTE_SENT)
-		if (!timeout) 
-		    printk("scsi%d : timed out on last byte\n",
-			    instance->host_no);
-#endif
-
-
-		if (hostdata->flags & FLAG_CHECK_LAST_BYTE_SENT) {
-		    hostdata->flags &= ~FLAG_CHECK_LAST_BYTE_SENT;
-		    if (NCR5380_read(TARGET_COMMAND_REG) & TCR_LAST_BYTE_SENT) {
-			hostdata->flags |= FLAG_HAS_LAST_BYTE_SENT;
-#if (NDEBUG & NDEBUG_LAST_BYTE_SENT)
-			printk("scsi%d : last bit sent works\n", 
-			    instance->host_no);
-#endif
-		    }
-		}
-	    } else  {
-#if (NDEBUG & NDEBUG_C400_PWRITE)
-		printk("Waiting for LASTBYTE\n");
-#endif
-		while (!(NCR5380_read(TARGET_COMMAND_REG) & TCR_LAST_BYTE_SENT));
-#if (NDEBUG & NDEBUG_C400_PWRITE)
-		printk("Got LASTBYTE\n");
-#endif
-	    }
-#else
-	    udelay (5);
-#endif
-	}
-#endif
-    }
-
-    NCR5380_write(MODE_REG, MR_BASE);
-    NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE);
-
-    if ((!(p & SR_IO)) && (hostdata->flags & FLAG_NCR53C400)) {
-#if (NDEBUG & NDEBUG_C400_PWRITE)
-	printk("53C400w: Checking for IRQ\n");
-#endif
-	if (NCR5380_read(BUS_AND_STATUS_REG) & BASR_IRQ) {
-#if (NDEBUG & NDEBUG_C400_PWRITE)
-	    printk("53C400w:    got it, reading reset interrupt reg\n");
-#endif
-	    NCR5380_read(RESET_PARITY_INTERRUPT_REG);
-	} else {
-	    printk("53C400w:    IRQ NOT THERE!\n");
-	}
-    }
-
-    *data = d + c;
-    *count = 0;
-    *phase = NCR5380_read(STATUS_REG) & PHASE_MASK;
-#if 0
-    NCR5380_print_phase(instance);
-#endif
-#if defined(PSEUDO_DMA) && !defined(UNSAFE)
-    local_irq_restore(flags);
-#endif /* defined(REAL_DMA_POLL) */
-    return foo;
-#endif /* def REAL_DMA */
-}
-#endif /* defined(REAL_DMA) || defined(PSEUDO_DMA) */
-
-
-/*
- * Function : NCR5380_information_transfer (struct Scsi_Host *instance)
- *
- * Purpose : run through the various SCSI phases and do as the target 
- * 	directs us to.  Operates on the currently connected command, 
- *	instance->connected.
- *
- * Inputs : instance, instance for which we are doing commands
- *
- * Side effects : SCSI things happen, the disconnected queue will be 
- *	modified if a command disconnects, *instance->connected will
- *	change.
- *
- * XXX Note : we need to watch for bus free or a reset condition here 
- * 	to recover from an unexpected bus free condition.
- */
- 
-static void NCR5380_information_transfer (struct Scsi_Host *instance)
-{
-    SETUP_HOSTDATA(instance);
-    unsigned long flags;
-    unsigned char msgout = NOP;
-    int sink = 0;
-    int len;
-#if defined(PSEUDO_DMA) || defined(REAL_DMA_POLL)
-    int transfersize;
-#endif
-    unsigned char *data;
-    unsigned char phase, tmp, extended_msg[10], old_phase=0xff;
-    Scsi_Cmnd *cmd = (Scsi_Cmnd *) hostdata->connected;
-
-    while (1) {
-	tmp = NCR5380_read(STATUS_REG);
-	/* We only have a valid SCSI phase when REQ is asserted */
-	if (tmp & SR_REQ) {
-	    phase = (tmp & PHASE_MASK); 
-	    if (phase != old_phase) {
-		old_phase = phase;
-		NCR_PRINT_PHASE(NDEBUG_INFORMATION);
-	    }
-	    
-	    if (sink && (phase != PHASE_MSGOUT)) {
-		NCR5380_write(TARGET_COMMAND_REG, PHASE_SR_TO_TCR(tmp));
-
-		NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE | ICR_ASSERT_ATN | 
-		    ICR_ASSERT_ACK);
-		while (NCR5380_read(STATUS_REG) & SR_REQ);
-		NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE | 
-		    ICR_ASSERT_ATN);
-		sink = 0;
-		continue;
-	    }
-
-	    switch (phase) {
-	    case PHASE_DATAOUT:
-#if (NDEBUG & NDEBUG_NO_DATAOUT)
-		printk("scsi%d: NDEBUG_NO_DATAOUT set, attempted DATAOUT "
-		       "aborted\n", HOSTNO);
-		sink = 1;
-		do_abort(instance);
-		cmd->result = DID_ERROR  << 16;
-		cmd->done(cmd);
-		return;
-#endif
-	    case PHASE_DATAIN:
-		/* 
-		 * If there is no room left in the current buffer in the
-		 * scatter-gather list, move onto the next one.
-		 */
-
-		if (!cmd->SCp.this_residual && cmd->SCp.buffers_residual) {
-		    ++cmd->SCp.buffer;
-		    --cmd->SCp.buffers_residual;
-		    cmd->SCp.this_residual = cmd->SCp.buffer->length;
-		    cmd->SCp.ptr = cmd->SCp.buffer->address;
-		    /* ++roman: Try to merge some scatter-buffers if
-		     * they are at contiguous physical addresses.
-		     */
-		    merge_contiguous_buffers( cmd );
-		    INF_PRINTK("scsi%d: %d bytes and %d buffers left\n",
-			       HOSTNO, cmd->SCp.this_residual,
-			       cmd->SCp.buffers_residual);
-		}
-
-		/*
-		 * The preferred transfer method is going to be 
-		 * PSEUDO-DMA for systems that are strictly PIO,
-		 * since we can let the hardware do the handshaking.
-		 *
-		 * For this to work, we need to know the transfersize
-		 * ahead of time, since the pseudo-DMA code will sit
-		 * in an unconditional loop.
-		 */
-
-/* ++roman: I suggest, this should be
- *   #if def(REAL_DMA)
- * instead of leaving REAL_DMA out.
- */
-
-#if defined(REAL_DMA) || defined(PSEUDO_DMA)
-		if (!cmd->device->borken &&
-		    !(hostdata->flags & FLAG_NO_PSEUDO_DMA) &&
-		    (transfersize = NCR5380_dma_xfer_len(instance,cmd,phase)) > 31) {
-
-		    len = transfersize;
-		    cmd->SCp.phase = phase;
-		    if (NCR5380_transfer_dma(instance, &phase,
-			&len, (unsigned char **) &cmd->SCp.ptr)) {
-			/*
-			 * If the watchdog timer fires, all future
-			 * accesses to this device will use the
-			 * polled-IO. */ 
-			printk(KERN_NOTICE "scsi%d: switching target %d "
-			       "lun %d to slow handshake\n", HOSTNO,
-			       cmd->target, cmd->lun);
-			cmd->device->borken = 1;
-			NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE | 
-			    ICR_ASSERT_ATN);
-			sink = 1;
-			do_abort(instance);
-			cmd->result = DID_ERROR  << 16;
-			cmd->done(cmd);
-			/* XXX - need to source or sink data here, as appropriate */
-		    } else {
-#ifdef REAL_DMA
-			/* ++roman: When using real DMA,
-			 * information_transfer() should return after
-			 * starting DMA since it has nothing more to
-			 * do.
-			 */
-			return;
-#else			
-			/* Michael: When using pseudo-DMA emulation, we must 
-			 * take care to take into account the residual from 
-			 * the current transfer as determined by either the 
-			 * interrupt routine ot the pseudo-transfer functions
-			 * (whichever notices it first).
-			 */
-			if (mac_pdma_residual)
-			  len -= mac_pdma_residual;
-			cmd->SCp.this_residual -= transfersize - len;
-#endif
-		    }
-		} else
-#endif /* defined(REAL_DMA) || defined(PSEUDO_DMA) */
-		  NCR5380_transfer_pio(instance, &phase, 
-		    (int *) &cmd->SCp.this_residual, (unsigned char **)
-		    &cmd->SCp.ptr);
-		break;
-	    case PHASE_MSGIN:
-		len = 1;
-		data = &tmp;
-		NCR5380_write(SELECT_ENABLE_REG, 0); 	/* disable reselects */
-		NCR5380_transfer_pio(instance, &phase, &len, &data);
-		cmd->SCp.Message = tmp;
-
-		switch (tmp) {
-		/*
-		 * Linking lets us reduce the time required to get the 
-		 * next command out to the device, hopefully this will
-		 * mean we don't waste another revolution due to the delays
-		 * required by ARBITRATION and another SELECTION.
-		 *
-		 * In the current implementation proposal, low level drivers
-		 * merely have to start the next command, pointed to by 
-		 * next_link, done() is called as with unlinked commands.
-		 */
-#ifdef LINKED
-		case LINKED_CMD_COMPLETE:
-		case LINKED_FLG_CMD_COMPLETE:
-		    /* Accept message by clearing ACK */
-		    NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE);
-		    
-		    LNK_PRINTK("scsi%d: target %d lun %d linked command "
-			       "complete.\n", HOSTNO, cmd->target, cmd->lun);
-
-		    /* Enable reselect interrupts */
-		    NCR5380_write(SELECT_ENABLE_REG, hostdata->id_mask);
-		    /*
-		     * Sanity check : A linked command should only terminate
-		     * with one of these messages if there are more linked
-		     * commands available.
-		     */
-
-		    if (!cmd->next_link) {
-			 printk(KERN_NOTICE "scsi%d: target %d lun %d "
-				"linked command complete, no next_link\n",
-				HOSTNO, cmd->target, cmd->lun);
-			    sink = 1;
-			    do_abort (instance);
-			    return;
-		    }
-
-		    initialize_SCp(cmd->next_link);
-		    /* The next command is still part of this process; copy it
-		     * and don't free it! */
-		    cmd->next_link->tag = cmd->tag;
-		    cmd->result = cmd->SCp.Status | (cmd->SCp.Message << 8); 
-		    LNK_PRINTK("scsi%d: target %d lun %d linked request "
-			       "done, calling scsi_done().\n",
-			       HOSTNO, cmd->target, cmd->lun);
-#ifdef NCR5380_STATS
-		    collect_stats(hostdata, cmd);
-#endif
-		    cmd->scsi_done(cmd);
-		    cmd = hostdata->connected;
-		    break;
-#endif /* def LINKED */
-		case ABORT:
-		case COMMAND_COMPLETE: 
-		    /* Accept message by clearing ACK */
-		    NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE);
-		    hostdata->connected = NULL;
-		    QU_PRINTK("scsi%d: command for target %d, lun %d "
-			      "completed\n", HOSTNO, cmd->target, cmd->lun);
-#ifdef SUPPORT_TAGS
-		    cmd_free_tag( cmd );
-		    if (status_byte(cmd->SCp.Status) == QUEUE_FULL) {
-			/* Turn a QUEUE FULL status into BUSY, I think the
-			 * mid level cannot handle QUEUE FULL :-( (The
-			 * command is retried after BUSY). Also update our
-			 * queue size to the number of currently issued
-			 * commands now.
-			 */
-			/* ++Andreas: the mid level code knows about
-			   QUEUE_FULL now. */
-			TAG_ALLOC *ta = &TagAlloc[cmd->target][cmd->lun];
-			TAG_PRINTK("scsi%d: target %d lun %d returned "
-				   "QUEUE_FULL after %d commands\n",
-				   HOSTNO, cmd->target, cmd->lun,
-				   ta->nr_allocated);
-			if (ta->queue_size > ta->nr_allocated)
-			    ta->nr_allocated = ta->queue_size;
-		    }
-#else
-		    hostdata->busy[cmd->target] &= ~(1 << cmd->lun);
-#endif
-		    /* Enable reselect interrupts */
-		    NCR5380_write(SELECT_ENABLE_REG, hostdata->id_mask);
-
-		    /* 
-		     * I'm not sure what the correct thing to do here is : 
-		     * 
-		     * If the command that just executed is NOT a request 
-		     * sense, the obvious thing to do is to set the result
-		     * code to the values of the stored parameters.
-		     * 
-		     * If it was a REQUEST SENSE command, we need some way to
-		     * differentiate between the failure code of the original
-		     * and the failure code of the REQUEST sense - the obvious
-		     * case is success, where we fall through and leave the
-		     * result code unchanged.
-		     * 
-		     * The non-obvious place is where the REQUEST SENSE failed
-		     */
-
-		    if (cmd->cmnd[0] != REQUEST_SENSE) 
-			cmd->result = cmd->SCp.Status | (cmd->SCp.Message << 8); 
-		    else if (status_byte(cmd->SCp.Status) != GOOD)
-			cmd->result = (cmd->result & 0x00ffff) | (DID_ERROR << 16);
-		    
-#ifdef AUTOSENSE
-		    if ((cmd->cmnd[0] != REQUEST_SENSE) && 
-			(status_byte(cmd->SCp.Status) == CHECK_CONDITION)) {
-			ASEN_PRINTK("scsi%d: performing request sense\n",
-				    HOSTNO);
-			cmd->cmnd[0] = REQUEST_SENSE;
-			cmd->cmnd[1] &= 0xe0;
-			cmd->cmnd[2] = 0;
-			cmd->cmnd[3] = 0;
-			cmd->cmnd[4] = sizeof(cmd->sense_buffer);
-			cmd->cmnd[5] = 0;
-			cmd->cmd_len = COMMAND_SIZE(cmd->cmnd[0]);
-
-			cmd->use_sg = 0;
-			/* this is initialized from initialize_SCp 
-			cmd->SCp.buffer = NULL;
-			cmd->SCp.buffers_residual = 0;
-			*/
-			cmd->request_buffer = (char *) cmd->sense_buffer;
-			cmd->request_bufflen = sizeof(cmd->sense_buffer);
-
-			local_irq_save(flags);
-			LIST(cmd,hostdata->issue_queue);
-			NEXT(cmd) = hostdata->issue_queue;
-		        hostdata->issue_queue = (Scsi_Cmnd *) cmd;
-		        local_irq_restore(flags);
-			QU_PRINTK("scsi%d: REQUEST SENSE added to head of "
-				  "issue queue\n", H_NO(cmd));
-		   } else
-#endif /* def AUTOSENSE */
-		   {
-#ifdef NCR5380_STATS
-		       collect_stats(hostdata, cmd);
-#endif
-		       cmd->scsi_done(cmd);
-		    }
-
-		    NCR5380_write(SELECT_ENABLE_REG, hostdata->id_mask);
-		    /* 
-		     * Restore phase bits to 0 so an interrupted selection, 
-		     * arbitration can resume.
-		     */
-		    NCR5380_write(TARGET_COMMAND_REG, 0);
-		    
-		    while ((NCR5380_read(STATUS_REG) & SR_BSY) && !hostdata->connected)
-			barrier();
-
-		    return;
-		case MESSAGE_REJECT:
-		    /* Accept message by clearing ACK */
-		    NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE);
-		    /* Enable reselect interrupts */
-		    NCR5380_write(SELECT_ENABLE_REG, hostdata->id_mask);
-		    switch (hostdata->last_message) {
-		    case HEAD_OF_QUEUE_TAG:
-		    case ORDERED_QUEUE_TAG:
-		    case SIMPLE_QUEUE_TAG:
-			/* The target obviously doesn't support tagged
-			 * queuing, even though it announced this ability in
-			 * its INQUIRY data ?!? (maybe only this LUN?) Ok,
-			 * clear 'tagged_supported' and lock the LUN, since
-			 * the command is treated as untagged further on.
-			 */
-			cmd->device->tagged_supported = 0;
-			hostdata->busy[cmd->target] |= (1 << cmd->lun);
-			cmd->tag = TAG_NONE;
-			TAG_PRINTK("scsi%d: target %d lun %d rejected "
-				   "QUEUE_TAG message; tagged queuing "
-				   "disabled\n",
-				   HOSTNO, cmd->target, cmd->lun);
-			break;
-		    }
-		    break;
-		case DISCONNECT:
-		    /* Accept message by clearing ACK */
-		    NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE);
-		    local_irq_save(flags);
-		    cmd->device->disconnect = 1;
-		    LIST(cmd,hostdata->disconnected_queue);
-		    NEXT(cmd) = hostdata->disconnected_queue;
-		    hostdata->connected = NULL;
-		    hostdata->disconnected_queue = cmd;
-		    local_irq_restore(flags);
-		    QU_PRINTK("scsi%d: command for target %d lun %d was "
-			      "moved from connected to the "
-			      "disconnected_queue\n", HOSTNO, 
-			      cmd->target, cmd->lun);
-		    /* 
-		     * Restore phase bits to 0 so an interrupted selection, 
-		     * arbitration can resume.
-		     */
-		    NCR5380_write(TARGET_COMMAND_REG, 0);
-
-		    /* Enable reselect interrupts */
-		    NCR5380_write(SELECT_ENABLE_REG, hostdata->id_mask);
-		    /* Wait for bus free to avoid nasty timeouts */
-		    while ((NCR5380_read(STATUS_REG) & SR_BSY) && !hostdata->connected)
-		    	barrier();
-		    return;
-		/* 
-		 * The SCSI data pointer is *IMPLICITLY* saved on a disconnect
-		 * operation, in violation of the SCSI spec so we can safely 
-		 * ignore SAVE/RESTORE pointers calls.
-		 *
-		 * Unfortunately, some disks violate the SCSI spec and 
-		 * don't issue the required SAVE_POINTERS message before
-		 * disconnecting, and we have to break spec to remain 
-		 * compatible.
-		 */
-		case SAVE_POINTERS:
-		case RESTORE_POINTERS:
-		    /* Accept message by clearing ACK */
-		    NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE);
-		    /* Enable reselect interrupts */
-		    NCR5380_write(SELECT_ENABLE_REG, hostdata->id_mask);
-		    break;
-		case EXTENDED_MESSAGE:
-/* 
- * Extended messages are sent in the following format :
- * Byte 	
- * 0		EXTENDED_MESSAGE == 1
- * 1		length (includes one byte for code, doesn't 
- *		include first two bytes)
- * 2 		code
- * 3..length+1	arguments
- *
- * Start the extended message buffer with the EXTENDED_MESSAGE
- * byte, since print_msg() wants the whole thing.  
- */
-		    extended_msg[0] = EXTENDED_MESSAGE;
-		    /* Accept first byte by clearing ACK */
-		    NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE);
-
-		    EXT_PRINTK("scsi%d: receiving extended message\n", HOSTNO);
-
-		    len = 2;
-		    data = extended_msg + 1;
-		    phase = PHASE_MSGIN;
-		    NCR5380_transfer_pio(instance, &phase, &len, &data);
-		    EXT_PRINTK("scsi%d: length=%d, code=0x%02x\n", HOSTNO,
-			       (int)extended_msg[1], (int)extended_msg[2]);
-
-		    if (!len && extended_msg[1] <= 
-			(sizeof (extended_msg) - 1)) {
-			/* Accept third byte by clearing ACK */
-			NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE);
-			len = extended_msg[1] - 1;
-			data = extended_msg + 3;
-			phase = PHASE_MSGIN;
-
-			NCR5380_transfer_pio(instance, &phase, &len, &data);
-			EXT_PRINTK("scsi%d: message received, residual %d\n",
-				   HOSTNO, len);
-
-			switch (extended_msg[2]) {
-			case EXTENDED_SDTR:
-			case EXTENDED_WDTR:
-			case EXTENDED_MODIFY_DATA_POINTER:
-			case EXTENDED_EXTENDED_IDENTIFY:
-			    tmp = 0;
-			}
-		    } else if (len) {
-			printk(KERN_NOTICE "scsi%d: error receiving "
-			       "extended message\n", HOSTNO);
-			tmp = 0;
-		    } else {
-			printk(KERN_NOTICE "scsi%d: extended message "
-			       "code %02x length %d is too long\n",
-			       HOSTNO, extended_msg[2], extended_msg[1]);
-			tmp = 0;
-		    }
-		/* Fall through to reject message */
-
-		/* 
-  		 * If we get something weird that we aren't expecting, 
- 		 * reject it.
-		 */
-		default:
-		    if (!tmp) {
-			printk(KERN_DEBUG "scsi%d: rejecting message ", HOSTNO);
-			print_msg (extended_msg);
-			printk("\n");
-		    } else if (tmp != EXTENDED_MESSAGE)
-			printk(KERN_DEBUG "scsi%d: rejecting unknown "
-			       "message %02x from target %d, lun %d\n",
-			       HOSTNO, tmp, cmd->target, cmd->lun);
-		    else
-			printk(KERN_DEBUG "scsi%d: rejecting unknown "
-			       "extended message "
-			       "code %02x, length %d from target %d, lun %d\n",
-			       HOSTNO, extended_msg[1], extended_msg[0],
-			       cmd->target, cmd->lun);
-   
-
-		    msgout = MESSAGE_REJECT;
-		    NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE | 
-			ICR_ASSERT_ATN);
-		    break;
-		} /* switch (tmp) */
-		break;
-	    case PHASE_MSGOUT:
-		len = 1;
-		data = &msgout;
-		hostdata->last_message = msgout;
-		NCR5380_transfer_pio(instance, &phase, &len, &data);
-		if (msgout == ABORT) {
-#ifdef SUPPORT_TAGS
-		    cmd_free_tag( cmd );
-#else
-		    hostdata->busy[cmd->target] &= ~(1 << cmd->lun);
-#endif
-		    hostdata->connected = NULL;
-		    cmd->result = DID_ERROR << 16;
-#ifdef NCR5380_STATS
-		    collect_stats(hostdata, cmd);
-#endif
-		    cmd->scsi_done(cmd);
-		    NCR5380_write(SELECT_ENABLE_REG, hostdata->id_mask);
-		    return;
-		}
-		msgout = NOP;
-		break;
-	    case PHASE_CMDOUT:
-		len = cmd->cmd_len;
-		data = cmd->cmnd;
-		/* 
-		 * XXX for performance reasons, on machines with a 
-		 * PSEUDO-DMA architecture we should probably 
-		 * use the dma transfer function.  
-		 */
-		NCR5380_transfer_pio(instance, &phase, &len, 
-		    &data);
-		break;
-	    case PHASE_STATIN:
-		len = 1;
-		data = &tmp;
-		NCR5380_transfer_pio(instance, &phase, &len, &data);
-		cmd->SCp.Status = tmp;
-		break;
-	    default:
-		printk("scsi%d: unknown phase\n", HOSTNO);
-		NCR_PRINT(NDEBUG_ANY);
-	    } /* switch(phase) */
-	} /* if (tmp * SR_REQ) */ 
-    } /* while (1) */
-}
-
-/*
- * Function : void NCR5380_reselect (struct Scsi_Host *instance)
- *
- * Purpose : does reselection, initializing the instance->connected 
- *	field to point to the Scsi_Cmnd for which the I_T_L or I_T_L_Q 
- *	nexus has been reestablished,
- *	
- * Inputs : instance - this instance of the NCR5380.
- *
- */
-
-
-static void NCR5380_reselect (struct Scsi_Host *instance)
-{
-    SETUP_HOSTDATA(instance);
-    unsigned char target_mask;
-    unsigned char lun, phase;
-    int len;
-#ifdef SUPPORT_TAGS
-    unsigned char tag;
-#endif
-    unsigned char msg[3];
-    unsigned char *data;
-    Scsi_Cmnd *tmp = NULL, *prev;
-/*    unsigned long flags; */
-
-    /*
-     * Disable arbitration, etc. since the host adapter obviously
-     * lost, and tell an interrupted NCR5380_select() to restart.
-     */
-
-    NCR5380_write(MODE_REG, MR_BASE);
-    hostdata->restart_select = 1;
-
-    target_mask = NCR5380_read(CURRENT_SCSI_DATA_REG) & ~(hostdata->id_mask);
-
-    RSL_PRINTK("scsi%d: reselect\n", HOSTNO);
-
-    /* 
-     * At this point, we have detected that our SCSI ID is on the bus,
-     * SEL is true and BSY was false for at least one bus settle delay
-     * (400 ns).
-     *
-     * We must assert BSY ourselves, until the target drops the SEL
-     * signal.
-     */
-
-    NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE | ICR_ASSERT_BSY);
-    
-    while (NCR5380_read(STATUS_REG) & SR_SEL);
-    NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE);
-
-    /*
-     * Wait for target to go into MSGIN.
-     */
-
-    while (!(NCR5380_read(STATUS_REG) & SR_REQ));
-
-    len = 1;
-    data = msg;
-    phase = PHASE_MSGIN;
-    NCR5380_transfer_pio(instance, &phase, &len, &data);
-
-    if (!(msg[0] & 0x80)) {
-	printk(KERN_DEBUG "scsi%d: expecting IDENTIFY message, got ", HOSTNO);
-	print_msg(msg);
-	do_abort(instance);
-	return;
-    }
-    lun = (msg[0] & 0x07);
-
-#ifdef SUPPORT_TAGS
-    /* If the phase is still MSGIN, the target wants to send some more
-     * messages. In case it supports tagged queuing, this is probably a
-     * SIMPLE_QUEUE_TAG for the I_T_L_Q nexus.
-     */
-    tag = TAG_NONE;
-    if (phase == PHASE_MSGIN && setup_use_tagged_queuing) {
-	/* Accept previous IDENTIFY message by clearing ACK */
-	NCR5380_write( INITIATOR_COMMAND_REG, ICR_BASE );
-	len = 2;
-	data = msg+1;
-	if (!NCR5380_transfer_pio(instance, &phase, &len, &data) &&
-	    msg[1] == SIMPLE_QUEUE_TAG)
-	    tag = msg[2];
-	TAG_PRINTK("scsi%d: target mask %02x, lun %d sent tag %d at "
-		   "reselection\n", HOSTNO, target_mask, lun, tag);
-    }
-#endif
-    
-    /* 
-     * Find the command corresponding to the I_T_L or I_T_L_Q  nexus we 
-     * just reestablished, and remove it from the disconnected queue.
-     */
-
-    for (tmp = (Scsi_Cmnd *) hostdata->disconnected_queue, prev = NULL; 
-	 tmp; prev = tmp, tmp = NEXT(tmp) ) {
-	if ((target_mask == (1 << tmp->target)) && (lun == tmp->lun)
-#ifdef SUPPORT_TAGS
-	    && (tag == tmp->tag) 
-#endif
-	    ) {
-	    if (prev) {
-		REMOVE(prev, NEXT(prev), tmp, NEXT(tmp));
-		NEXT(prev) = NEXT(tmp);
-	    } else {
-		REMOVE(-1, hostdata->disconnected_queue, tmp, NEXT(tmp));
-		hostdata->disconnected_queue = NEXT(tmp);
-	    }
-	    NEXT(tmp) = NULL;
-	    break;
-	}
-    }
-    
-    if (!tmp) {
-	printk(KERN_WARNING "scsi%d: warning: target bitmask %02x lun %d "
-#ifdef SUPPORT_TAGS
-		"tag %d "
-#endif
-		"not in disconnect_queue.\n",
-		HOSTNO, target_mask, lun
-#ifdef SUPPORT_TAGS
-		, tag
-#endif
-		);
-	/* 
-	 * Since we have an established nexus that we can't do anything
-	 * with, we must abort it.  
-	 */
-	do_abort(instance);
-	return;
-    }
-
-    /* Accept message by clearing ACK */
-    NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE);
-
-    hostdata->connected = tmp;
-    RSL_PRINTK("scsi%d: nexus established, target = %d, lun = %d, tag = %d\n",
-	       HOSTNO, tmp->target, tmp->lun, tmp->tag);
-}
-
-
-/*
- * Function : int NCR5380_abort (Scsi_Cmnd *cmd)
- *
- * Purpose : abort a command
- *
- * Inputs : cmd - the Scsi_Cmnd to abort, code - code to set the 
- * 	host byte of the result field to, if zero DID_ABORTED is 
- *	used.
- *
- * Returns : 0 - success, -1 on failure.
- *
- * XXX - there is no way to abort the command that is currently 
- * 	 connected, you have to wait for it to complete.  If this is 
- *	 a problem, we could implement longjmp() / setjmp(), setjmp()
- * 	 called where the loop started in NCR5380_main().
- */
-
-int NCR5380_abort (Scsi_Cmnd *cmd)
-{
-    struct Scsi_Host *instance = cmd->host;
-    SETUP_HOSTDATA(instance);
-    Scsi_Cmnd *tmp, **prev;
-    unsigned long flags;
-
-    printk(KERN_NOTICE "scsi%d: aborting command\n", HOSTNO);
-    print_Scsi_Cmnd (cmd);
-
-    NCR5380_print_status (instance);
-
-    local_irq_save(flags);
-    
-    ABRT_PRINTK("scsi%d: abort called basr 0x%02x, sr 0x%02x\n", HOSTNO,
-		NCR5380_read(BUS_AND_STATUS_REG),
-		NCR5380_read(STATUS_REG));
-
-#if 1
-/* 
- * Case 1 : If the command is the currently executing command, 
- * we'll set the aborted flag and return control so that 
- * information transfer routine can exit cleanly.
- */
-
-    if (hostdata->connected == cmd) {
-
-	ABRT_PRINTK("scsi%d: aborting connected command\n", HOSTNO);
-/*
- * We should perform BSY checking, and make sure we haven't slipped
- * into BUS FREE.
- */
-
-/*	NCR5380_write(INITIATOR_COMMAND_REG, ICR_ASSERT_ATN); */
-/* 
- * Since we can't change phases until we've completed the current 
- * handshake, we have to source or sink a byte of data if the current
- * phase is not MSGOUT.
- */
-
-/* 
- * Return control to the executing NCR drive so we can clear the
- * aborted flag and get back into our main loop.
- */ 
-
-	if (do_abort(instance) == 0) {
-	  hostdata->aborted = 1;
-	  hostdata->connected = NULL;
-	  cmd->result = DID_ABORT << 16;
-#ifdef SUPPORT_TAGS
-	  cmd_free_tag( cmd );
-#else
-	  hostdata->busy[cmd->target] &= ~(1 << cmd->lun);
-#endif
-	  local_irq_restore(flags);
-	  cmd->scsi_done(cmd);
-	  return SCSI_ABORT_SUCCESS;
-	} else {
-/*	  local_irq_restore(flags); */
-	  printk("scsi%d: abort of connected command failed!\n", HOSTNO);
-	  return SCSI_ABORT_ERROR;
-	} 
-   }
-#endif
-
-/* 
- * Case 2 : If the command hasn't been issued yet, we simply remove it 
- * 	    from the issue queue.
- */
-    for (prev = (Scsi_Cmnd **) &(hostdata->issue_queue), 
-	tmp = (Scsi_Cmnd *) hostdata->issue_queue;
-	tmp; prev = NEXTADDR(tmp), tmp = NEXT(tmp) )
-	if (cmd == tmp) {
-	    REMOVE(5, *prev, tmp, NEXT(tmp));
-	    (*prev) = NEXT(tmp);
-	    NEXT(tmp) = NULL;
-	    tmp->result = DID_ABORT << 16;
-	    local_irq_restore(flags);
-	    ABRT_PRINTK("scsi%d: abort removed command from issue queue.\n",
-			HOSTNO);
-	    /* Tagged queuing note: no tag to free here, hasn't been assigned
-	     * yet... */
-	    tmp->scsi_done(tmp);
-	    return SCSI_ABORT_SUCCESS;
-	}
-
-/* 
- * Case 3 : If any commands are connected, we're going to fail the abort
- *	    and let the high level SCSI driver retry at a later time or 
- *	    issue a reset.
- *
- *	    Timeouts, and therefore aborted commands, will be highly unlikely
- *          and handling them cleanly in this situation would make the common
- *	    case of noresets less efficient, and would pollute our code.  So,
- *	    we fail.
- */
-
-    if (hostdata->connected) {
-	local_irq_restore(flags);
-	ABRT_PRINTK("scsi%d: abort failed, command connected.\n", HOSTNO);
-        return SCSI_ABORT_SNOOZE;
-    }
-
-/*
- * Case 4: If the command is currently disconnected from the bus, and 
- * 	there are no connected commands, we reconnect the I_T_L or 
- *	I_T_L_Q nexus associated with it, go into message out, and send 
- *      an abort message.
- *
- * This case is especially ugly. In order to reestablish the nexus, we
- * need to call NCR5380_select().  The easiest way to implement this 
- * function was to abort if the bus was busy, and let the interrupt
- * handler triggered on the SEL for reselect take care of lost arbitrations
- * where necessary, meaning interrupts need to be enabled.
- *
- * When interrupts are enabled, the queues may change - so we 
- * can't remove it from the disconnected queue before selecting it
- * because that could cause a failure in hashing the nexus if that 
- * device reselected.
- * 
- * Since the queues may change, we can't use the pointers from when we
- * first locate it.
- *
- * So, we must first locate the command, and if NCR5380_select()
- * succeeds, then issue the abort, relocate the command and remove
- * it from the disconnected queue.
- */
-
-    for (tmp = (Scsi_Cmnd *) hostdata->disconnected_queue; tmp;
-	 tmp = NEXT(tmp)) 
-        if (cmd == tmp) {
-            local_irq_restore(flags);
-	    ABRT_PRINTK("scsi%d: aborting disconnected command.\n", HOSTNO);
-  
-            if (NCR5380_select (instance, cmd, (int) cmd->tag)) 
-		return SCSI_ABORT_BUSY;
-
-	    ABRT_PRINTK("scsi%d: nexus reestablished.\n", HOSTNO);
-
-	    do_abort (instance);
-
-	    local_irq_save(flags);
-	    for (prev = (Scsi_Cmnd **) &(hostdata->disconnected_queue), 
-		tmp = (Scsi_Cmnd *) hostdata->disconnected_queue;
-		tmp; prev = NEXTADDR(tmp), tmp = NEXT(tmp) )
-		    if (cmd == tmp) {
-		    REMOVE(5, *prev, tmp, NEXT(tmp));
-		    *prev = NEXT(tmp);
-		    NEXT(tmp) = NULL;
-		    tmp->result = DID_ABORT << 16;
-		    /* We must unlock the tag/LUN immediately here, since the
-		     * target goes to BUS FREE and doesn't send us another
-		     * message (COMMAND_COMPLETE or the like)
-		     */
-#ifdef SUPPORT_TAGS
-		    cmd_free_tag( tmp );
-#else
-		    hostdata->busy[cmd->target] &= ~(1 << cmd->lun);
-#endif
-		    local_irq_restore(flags);
-		    tmp->scsi_done(tmp);
-		    return SCSI_ABORT_SUCCESS;
-		}
-	}
-
-/*
- * Case 5 : If we reached this point, the command was not found in any of 
- *	    the queues.
- *
- * We probably reached this point because of an unlikely race condition
- * between the command completing successfully and the abortion code,
- * so we won't panic, but we will notify the user in case something really
- * broke.
- */
-
-    local_irq_restore(flags);
-    printk(KERN_INFO "scsi%d: warning : SCSI command probably completed successfully\n"
-           KERN_INFO "        before abortion\n", HOSTNO); 
-
-/* Maybe it is sufficient just to release the ST-DMA lock... (if
- * possible at all) At least, we should check if the lock could be
- * released after the abort, in case it is kept due to some bug.
- */
-
-    return SCSI_ABORT_NOT_RUNNING;
-}
-
-
-/* 
- * Function : int NCR5380_bus_reset (Scsi_Cmnd *cmd)
- * 
- * Purpose : reset the SCSI bus.
- *
- * Returns : SCSI_RESET_WAKEUP
- *
- */ 
-
-static int NCR5380_bus_reset( Scsi_Cmnd *cmd)
-{
-    SETUP_HOSTDATA(cmd->host);
-    int           i;
-    unsigned long flags;
-#if 1
-    Scsi_Cmnd *connected, *disconnected_queue;
-#endif
-
-    NCR5380_print_status (cmd->host);
-
-    /* get in phase */
-    NCR5380_write( TARGET_COMMAND_REG,
-		   PHASE_SR_TO_TCR( NCR5380_read(STATUS_REG) ));
-    /* assert RST */
-    NCR5380_write( INITIATOR_COMMAND_REG, ICR_BASE | ICR_ASSERT_RST );
-    udelay (40);
-    /* reset NCR registers */
-    NCR5380_write( INITIATOR_COMMAND_REG, ICR_BASE );
-    NCR5380_write( MODE_REG, MR_BASE );
-    NCR5380_write( TARGET_COMMAND_REG, 0 );
-    NCR5380_write( SELECT_ENABLE_REG, 0 );
-    /* ++roman: reset interrupt condition! otherwise no interrupts don't get
-     * through anymore ... */
-    (void)NCR5380_read( RESET_PARITY_INTERRUPT_REG );
-
-#if 1 /* XXX Should now be done by midlevel code, but it's broken XXX */
-      /* XXX see below                                            XXX */
-
-    /* MSch: old-style reset: actually abort all command processing here */
-
-    /* After the reset, there are no more connected or disconnected commands
-     * and no busy units; to avoid problems with re-inserting the commands
-     * into the issue_queue (via scsi_done()), the aborted commands are
-     * remembered in local variables first.
-     */
-    local_irq_save(flags);
-    connected = (Scsi_Cmnd *)hostdata->connected;
-    hostdata->connected = NULL;
-    disconnected_queue = (Scsi_Cmnd *)hostdata->disconnected_queue;
-    hostdata->disconnected_queue = NULL;
-#ifdef SUPPORT_TAGS
-    free_all_tags();
-#endif
-    for( i = 0; i < 8; ++i )
-	hostdata->busy[i] = 0;
-#ifdef REAL_DMA
-    hostdata->dma_len = 0;
-#endif
-    local_irq_restore(flags);
-
-    /* In order to tell the mid-level code which commands were aborted, 
-     * set the command status to DID_RESET and call scsi_done() !!!
-     * This ultimately aborts processing of these commands in the mid-level.
-     */
-
-    if ((cmd = connected)) {
-	ABRT_PRINTK("scsi%d: reset aborted a connected command\n", H_NO(cmd));
-	cmd->result = (cmd->result & 0xffff) | (DID_RESET << 16);
-	cmd->scsi_done( cmd );
-    }
-
-    for (i = 0; (cmd = disconnected_queue); ++i) {
-	disconnected_queue = NEXT(cmd);
-	NEXT(cmd) = NULL;
-	cmd->result = (cmd->result & 0xffff) | (DID_RESET << 16);
-	cmd->scsi_done( cmd );
-    }
-    if (i > 0)
-	ABRT_PRINTK("scsi: reset aborted %d disconnected command(s)\n", i);
-
-    /* since all commands have been explicitly terminated, we need to tell
-     * the midlevel code that the reset was SUCCESSFUL, and there is no 
-     * need to 'wake up' the commands by a request_sense
-     */
-    return SCSI_RESET_SUCCESS | SCSI_RESET_BUS_RESET;
-#else /* 1 */
-
-    /* MSch: new-style reset handling: let the mid-level do what it can */
-
-    /* ++guenther: MID-LEVEL IS STILL BROKEN.
-     * Mid-level is supposed to requeue all commands that were active on the
-     * various low-level queues. In fact it does this, but that's not enough
-     * because all these commands are subject to timeout. And if a timeout
-     * happens for any removed command, *_abort() is called but all queues
-     * are now empty. Abort then gives up the falcon lock, which is fatal,
-     * since the mid-level will queue more commands and must have the lock
-     * (it's all happening inside timer interrupt handler!!).
-     * Even worse, abort will return NOT_RUNNING for all those commands not
-     * on any queue, so they won't be retried ...
-     *
-     * Conclusion: either scsi.c disables timeout for all resetted commands
-     * immediately, or we lose!  As of linux-2.0.20 it doesn't.
-     */
-
-    /* After the reset, there are no more connected or disconnected commands
-     * and no busy units; so clear the low-level status here to avoid 
-     * conflicts when the mid-level code tries to wake up the affected 
-     * commands!
-     */
-
-    if (hostdata->issue_queue)
-	ABRT_PRINTK("scsi%d: reset aborted issued command(s)\n", H_NO(cmd));
-    if (hostdata->connected) 
-	ABRT_PRINTK("scsi%d: reset aborted a connected command\n", H_NO(cmd));
-    if (hostdata->disconnected_queue)
-	ABRT_PRINTK("scsi%d: reset aborted disconnected command(s)\n", H_NO(cmd));
-
-    local_irq_save(flags);
-    hostdata->issue_queue = NULL;
-    hostdata->connected = NULL;
-    hostdata->disconnected_queue = NULL;
-#ifdef SUPPORT_TAGS
-    free_all_tags();
-#endif
-    for( i = 0; i < 8; ++i )
-	hostdata->busy[i] = 0;
-#ifdef REAL_DMA
-    hostdata->dma_len = 0;
-#endif
-    local_irq_restore(flags);
-
-    /* we did no complete reset of all commands, so a wakeup is required */
-    return SCSI_RESET_WAKEUP | SCSI_RESET_BUS_RESET;
-#endif /* 1 */
-}
-
-static Scsi_Host_Template driver_template = {
-	.name			= "Macintosh NCR5380 SCSI",
-	.detect			= macscsi_detect,
-	.release		= macscsi_release,
-	.info			= macscsi_info,
-	.queuecommand		= macscsi_queue_command,
-	.abort			= macscsi_abort,
-	.reset			= macscsi_reset,
-	.can_queue		= CAN_QUEUE,
-	.this_id		= 7,
-	.sg_tablesize		= SG_ALL,
-	.cmd_per_lun		= CMD_PER_LUN,
-	.use_clustering		= DISABLE_CLUSTERING
-};
-
-
-#include "scsi_module.c"
-
-/* Local Variables: */
-/* tab-width: 8     */
-/* End:             */
--- diff/drivers/scsi/qlogicfc.c	2003-10-09 09:47:34.000000000 +0100
+++ source/drivers/scsi/qlogicfc.c	1970-01-01 01:00:00.000000000 +0100
@@ -1,2236 +0,0 @@
-/*
- * QLogic ISP2x00 SCSI-FCP
- * Written by Erik H. Moe, ehm@cris.com
- * Copyright 1995, Erik H. Moe
- *
- * 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.
- */
-
-/* Renamed and updated to 1.3.x by Michael Griffith <grif@cs.ucr.edu> */
-
-/* This is a version of the isp1020 driver which was modified by
- * Chris Loveland <cwl@iol.unh.edu> to support the isp2100 and isp2200
- *
- * Big endian support and dynamic DMA mapping added
- * by Jakub Jelinek <jakub@redhat.com>.
- *
- * Conversion to final pci64 DMA interfaces
- * by David S. Miller <davem@redhat.com>.
- */
-
-/*
- * $Date: 1995/09/22 02:23:15 $
- * $Revision: 0.5 $
- *
- * $Log: isp1020.c,v $
- * Revision 0.5  1995/09/22  02:23:15  root
- * do auto request sense
- *
- * Revision 0.4  1995/08/07  04:44:33  root
- * supply firmware with driver.
- * numerous bug fixes/general cleanup of code.
- *
- * Revision 0.3  1995/07/16  16:15:39  root
- * added reset/abort code.
- *
- * Revision 0.2  1995/06/29  03:14:19  root
- * fixed biosparam.
- * added queue protocol.
- *
- * Revision 0.1  1995/06/25  01:55:45  root
- * Initial release.
- *
- */
-
-#include <linux/blkdev.h>
-#include <linux/kernel.h>
-#include <linux/string.h>
-#include <linux/ioport.h>
-#include <linux/sched.h>
-#include <linux/types.h>
-#include <linux/pci.h>
-#include <linux/delay.h>
-#include <linux/unistd.h>
-#include <linux/spinlock.h>
-#include <linux/interrupt.h>
-#include <asm/io.h>
-#include <asm/irq.h>
-#include "scsi.h"
-#include "hosts.h"
-
-#define pci64_dma_hi32(a) ((u32) (0xffffffff & (((u64)(a))>>32)))
-#define pci64_dma_lo32(a) ((u32) (0xffffffff & (((u64)(a)))))
-#define pci64_dma_build(hi,lo) \
-	((dma_addr_t)(((u64)(lo))|(((u64)(hi))<<32)))
-
-#include "qlogicfc.h"
-
-/* Configuration section **************************************************** */
-
-/* Set the following macro to 1 to reload the ISP2x00's firmware.  This is
-   version 1.17.30 of the isp2100's firmware and version 2.00.40 of the 
-   isp2200's firmware. 
-*/
-
-#define USE_NVRAM_DEFAULTS      1
-
-#define ISP2x00_PORTDB          1
-
-/* Set the following to 1 to include fabric support, fabric support is 
- * currently not as well tested as the other aspects of the driver */
-
-#define ISP2x00_FABRIC          1
-
-/*  Macros used for debugging */
-#define DEBUG_ISP2x00		0
-#define DEBUG_ISP2x00_INT	0
-#define DEBUG_ISP2x00_INTR	0
-#define DEBUG_ISP2x00_SETUP	0
-#define DEBUG_ISP2x00_FABRIC    0
-#define TRACE_ISP 		0 
-
-
-#define DEFAULT_LOOP_COUNT	1000000000
-
-/* End Configuration section ************************************************ */
-
-#include <linux/module.h>
-
-#if TRACE_ISP
-
-#define TRACE_BUF_LEN	(32*1024)
-
-struct {
-	u_long next;
-	struct {
-		u_long time;
-		u_int index;
-		u_int addr;
-		u_char *name;
-	} buf[TRACE_BUF_LEN];
-} trace;
-
-#define TRACE(w, i, a)						\
-{								\
-	unsigned long flags;					\
-								\
-	save_flags(flags);					\
-	cli();							\
-	trace.buf[trace.next].name  = (w);			\
-	trace.buf[trace.next].time  = jiffies;			\
-	trace.buf[trace.next].index = (i);			\
-	trace.buf[trace.next].addr  = (long) (a);		\
-	trace.next = (trace.next + 1) & (TRACE_BUF_LEN - 1);	\
-	restore_flags(flags);					\
-}
-
-#else
-#define TRACE(w, i, a)
-#endif
-
-#if DEBUG_ISP2x00_FABRIC
-#define DEBUG_FABRIC(x)	x
-#else
-#define DEBUG_FABRIC(x)
-#endif				/* DEBUG_ISP2x00_FABRIC */
-
-
-#if DEBUG_ISP2x00
-#define ENTER(x)	printk("isp2x00 : entering %s()\n", x);
-#define LEAVE(x)	printk("isp2x00 : leaving %s()\n", x);
-#define DEBUG(x)	x
-#else
-#define ENTER(x)
-#define LEAVE(x)
-#define DEBUG(x)
-#endif				/* DEBUG_ISP2x00 */
-
-#if DEBUG_ISP2x00_INTR
-#define ENTER_INTR(x)	printk("isp2x00 : entering %s()\n", x);
-#define LEAVE_INTR(x)	printk("isp2x00 : leaving %s()\n", x);
-#define DEBUG_INTR(x)	x
-#else
-#define ENTER_INTR(x)
-#define LEAVE_INTR(x)
-#define DEBUG_INTR(x)
-#endif				/* DEBUG ISP2x00_INTR */
-
-
-#define ISP2100_REV_ID1	       1
-#define ISP2100_REV_ID3        3
-#define ISP2200_REV_ID5        5
-
-/* host configuration and control registers */
-#define HOST_HCCR	0xc0	/* host command and control */
-
-/* pci bus interface registers */
-#define FLASH_BIOS_ADDR	0x00
-#define FLASH_BIOS_DATA	0x02
-#define ISP_CTRL_STATUS	0x06	/* configuration register #1 */
-#define PCI_INTER_CTL	0x08	/* pci interrupt control */
-#define PCI_INTER_STS	0x0a	/* pci interrupt status */
-#define PCI_SEMAPHORE	0x0c	/* pci semaphore */
-#define PCI_NVRAM	0x0e	/* pci nvram interface */
-
-/* mailbox registers */
-#define MBOX0		0x10	/* mailbox 0 */
-#define MBOX1		0x12	/* mailbox 1 */
-#define MBOX2		0x14	/* mailbox 2 */
-#define MBOX3		0x16	/* mailbox 3 */
-#define MBOX4		0x18	/* mailbox 4 */
-#define MBOX5		0x1a	/* mailbox 5 */
-#define MBOX6		0x1c	/* mailbox 6 */
-#define MBOX7		0x1e	/* mailbox 7 */
-
-/* mailbox command complete status codes */
-#define MBOX_COMMAND_COMPLETE		0x4000
-#define INVALID_COMMAND			0x4001
-#define HOST_INTERFACE_ERROR		0x4002
-#define TEST_FAILED			0x4003
-#define COMMAND_ERROR			0x4005
-#define COMMAND_PARAM_ERROR		0x4006
-#define PORT_ID_USED                    0x4007
-#define LOOP_ID_USED                    0x4008
-#define ALL_IDS_USED                    0x4009
-
-/* async event status codes */
-#define RESET_DETECTED  		0x8001
-#define SYSTEM_ERROR			0x8002
-#define REQUEST_TRANSFER_ERROR		0x8003
-#define RESPONSE_TRANSFER_ERROR		0x8004
-#define REQUEST_QUEUE_WAKEUP		0x8005
-#define LIP_OCCURRED                     0x8010
-#define LOOP_UP                         0x8011
-#define LOOP_DOWN                       0x8012
-#define LIP_RECEIVED                    0x8013
-#define PORT_DB_CHANGED                 0x8014
-#define CHANGE_NOTIFICATION             0x8015
-#define SCSI_COMMAND_COMPLETE           0x8020
-#define POINT_TO_POINT_UP               0x8030
-#define CONNECTION_MODE                 0x8036
-
-struct Entry_header {
-	u_char entry_type;
-	u_char entry_cnt;
-	u_char sys_def_1;
-	u_char flags;
-};
-
-/* entry header type commands */
-#define ENTRY_COMMAND		0x19
-#define ENTRY_CONTINUATION	0x0a
-
-#define ENTRY_STATUS		0x03
-#define ENTRY_MARKER		0x04
-
-
-/* entry header flag definitions */
-#define EFLAG_BUSY		2
-#define EFLAG_BAD_HEADER	4
-#define EFLAG_BAD_PAYLOAD	8
-
-struct dataseg {
-	u_int d_base;
-	u_int d_base_hi;
-	u_int d_count;
-};
-
-struct Command_Entry {
-	struct Entry_header hdr;
-	u_int handle;
-	u_char target_lun;
-	u_char target_id;
-	u_short expanded_lun;
-	u_short control_flags;
-	u_short rsvd2;
-	u_short time_out;
-	u_short segment_cnt;
-	u_char cdb[16];
-	u_int total_byte_cnt;
-	struct dataseg dataseg[DATASEGS_PER_COMMAND];
-};
-
-/* command entry control flag definitions */
-#define CFLAG_NODISC		0x01
-#define CFLAG_HEAD_TAG		0x02
-#define CFLAG_ORDERED_TAG	0x04
-#define CFLAG_SIMPLE_TAG	0x08
-#define CFLAG_TAR_RTN		0x10
-#define CFLAG_READ		0x20
-#define CFLAG_WRITE		0x40
-
-struct Continuation_Entry {
-	struct Entry_header hdr;
-	struct dataseg dataseg[DATASEGS_PER_CONT];
-};
-
-struct Marker_Entry {
-	struct Entry_header hdr;
-	u_int reserved;
-	u_char target_lun;
-	u_char target_id;
-	u_char modifier;
-	u_char expanded_lun;
-	u_char rsvds[52];
-};
-
-/* marker entry modifier definitions */
-#define SYNC_DEVICE	0
-#define SYNC_TARGET	1
-#define SYNC_ALL	2
-
-struct Status_Entry {
-	struct Entry_header hdr;
-	u_int handle;
-	u_short scsi_status;
-	u_short completion_status;
-	u_short state_flags;
-	u_short status_flags;
-	u_short res_info_len;
-	u_short req_sense_len;
-	u_int residual;
-	u_char res_info[8];
-	u_char req_sense_data[32];
-};
-
-/* status entry completion status definitions */
-#define CS_COMPLETE			0x0000
-#define CS_DMA_ERROR			0x0002
-#define CS_RESET_OCCURRED		0x0004
-#define CS_ABORTED			0x0005
-#define CS_TIMEOUT			0x0006
-#define CS_DATA_OVERRUN			0x0007
-#define CS_DATA_UNDERRUN		0x0015
-#define CS_QUEUE_FULL			0x001c
-#define CS_PORT_UNAVAILABLE             0x0028
-#define CS_PORT_LOGGED_OUT              0x0029
-#define CS_PORT_CONFIG_CHANGED		0x002a
-
-/* status entry state flag definitions */
-#define SF_SENT_CDB			0x0400
-#define SF_TRANSFERRED_DATA		0x0800
-#define SF_GOT_STATUS			0x1000
-
-/* status entry status flag definitions */
-#define STF_BUS_RESET			0x0008
-#define STF_DEVICE_RESET		0x0010
-#define STF_ABORTED			0x0020
-#define STF_TIMEOUT			0x0040
-
-/* interrupt control commands */
-#define ISP_EN_INT			0x8000
-#define ISP_EN_RISC			0x0008
-
-/* host control commands */
-#define HCCR_NOP			0x0000
-#define HCCR_RESET			0x1000
-#define HCCR_PAUSE			0x2000
-#define HCCR_RELEASE			0x3000
-#define HCCR_SINGLE_STEP		0x4000
-#define HCCR_SET_HOST_INTR		0x5000
-#define HCCR_CLEAR_HOST_INTR		0x6000
-#define HCCR_CLEAR_RISC_INTR		0x7000
-#define HCCR_BP_ENABLE			0x8000
-#define HCCR_BIOS_DISABLE		0x9000
-#define HCCR_TEST_MODE			0xf000
-
-#define RISC_BUSY			0x0004
-
-/* mailbox commands */
-#define MBOX_NO_OP			0x0000
-#define MBOX_LOAD_RAM			0x0001
-#define MBOX_EXEC_FIRMWARE		0x0002
-#define MBOX_DUMP_RAM			0x0003
-#define MBOX_WRITE_RAM_WORD		0x0004
-#define MBOX_READ_RAM_WORD		0x0005
-#define MBOX_MAILBOX_REG_TEST		0x0006
-#define MBOX_VERIFY_CHECKSUM		0x0007
-#define MBOX_ABOUT_FIRMWARE		0x0008
-#define MBOX_LOAD_RISC_RAM              0x0009
-#define MBOX_DUMP_RISC_RAM              0x000a
-#define MBOX_CHECK_FIRMWARE		0x000e
-#define MBOX_INIT_REQ_QUEUE		0x0010
-#define MBOX_INIT_RES_QUEUE		0x0011
-#define MBOX_EXECUTE_IOCB		0x0012
-#define MBOX_WAKE_UP			0x0013
-#define MBOX_STOP_FIRMWARE		0x0014
-#define MBOX_ABORT_IOCB			0x0015
-#define MBOX_ABORT_DEVICE		0x0016
-#define MBOX_ABORT_TARGET		0x0017
-#define MBOX_BUS_RESET			0x0018
-#define MBOX_STOP_QUEUE			0x0019
-#define MBOX_START_QUEUE		0x001a
-#define MBOX_SINGLE_STEP_QUEUE		0x001b
-#define MBOX_ABORT_QUEUE		0x001c
-#define MBOX_GET_DEV_QUEUE_STATUS	0x001d
-#define MBOX_GET_FIRMWARE_STATUS	0x001f
-#define MBOX_GET_INIT_SCSI_ID		0x0020
-#define MBOX_GET_RETRY_COUNT		0x0022
-#define MBOX_GET_TARGET_PARAMS		0x0028
-#define MBOX_GET_DEV_QUEUE_PARAMS	0x0029
-#define MBOX_SET_RETRY_COUNT		0x0032
-#define MBOX_SET_TARGET_PARAMS		0x0038
-#define MBOX_SET_DEV_QUEUE_PARAMS	0x0039
-#define MBOX_EXECUTE_IOCB64             0x0054
-#define MBOX_INIT_FIRMWARE              0x0060
-#define MBOX_GET_INIT_CB                0x0061
-#define MBOX_INIT_LIP			0x0062
-#define MBOX_GET_POS_MAP                0x0063
-#define MBOX_GET_PORT_DB                0x0064
-#define MBOX_CLEAR_ACA                  0x0065
-#define MBOX_TARGET_RESET               0x0066
-#define MBOX_CLEAR_TASK_SET             0x0067
-#define MBOX_ABORT_TASK_SET             0x0068
-#define MBOX_GET_FIRMWARE_STATE         0x0069
-#define MBOX_GET_PORT_NAME              0x006a
-#define MBOX_SEND_SNS                   0x006e
-#define MBOX_PORT_LOGIN                 0x006f
-#define MBOX_SEND_CHANGE_REQUEST        0x0070
-#define MBOX_PORT_LOGOUT                0x0071
-
-/*
- *	Firmware if needed (note this is a hack, it belongs in a separate
- *	module.
- */
- 
-#ifdef CONFIG_SCSI_QLOGIC_FC_FIRMWARE
-#include "qlogicfc_asm.c"
-#else
-static unsigned short risc_code_addr01 = 0x1000 ;
-#endif
-
-/* Each element in mbox_param is an 8 bit bitmap where each bit indicates
-   if that mbox should be copied as input.  For example 0x2 would mean
-   only copy mbox1. */
-
-const u_char mbox_param[] =
-{
-	0x01,			/* MBOX_NO_OP */
-	0x1f,			/* MBOX_LOAD_RAM */
-	0x03,			/* MBOX_EXEC_FIRMWARE */
-	0x1f,			/* MBOX_DUMP_RAM */
-	0x07,			/* MBOX_WRITE_RAM_WORD */
-	0x03,			/* MBOX_READ_RAM_WORD */
-	0xff,			/* MBOX_MAILBOX_REG_TEST */
-	0x03,			/* MBOX_VERIFY_CHECKSUM */
-	0x01,			/* MBOX_ABOUT_FIRMWARE */
-	0xff,			/* MBOX_LOAD_RISC_RAM */
-	0xff,			/* MBOX_DUMP_RISC_RAM */
-	0x00,			/* 0x000b */
-	0x00,			/* 0x000c */
-	0x00,			/* 0x000d */
-	0x01,			/* MBOX_CHECK_FIRMWARE */
-	0x00,			/* 0x000f */
-	0x1f,			/* MBOX_INIT_REQ_QUEUE */
-	0x2f,			/* MBOX_INIT_RES_QUEUE */
-	0x0f,			/* MBOX_EXECUTE_IOCB */
-	0x03,			/* MBOX_WAKE_UP */
-	0x01,			/* MBOX_STOP_FIRMWARE */
-	0x0f,			/* MBOX_ABORT_IOCB */
-	0x03,			/* MBOX_ABORT_DEVICE */
-	0x07,			/* MBOX_ABORT_TARGET */
-	0x03,			/* MBOX_BUS_RESET */
-	0x03,			/* MBOX_STOP_QUEUE */
-	0x03,			/* MBOX_START_QUEUE */
-	0x03,			/* MBOX_SINGLE_STEP_QUEUE */
-	0x03,			/* MBOX_ABORT_QUEUE */
-	0x03,			/* MBOX_GET_DEV_QUEUE_STATUS */
-	0x00,			/* 0x001e */
-	0x01,			/* MBOX_GET_FIRMWARE_STATUS */
-	0x01,			/* MBOX_GET_INIT_SCSI_ID */
-	0x00,			/* 0x0021 */
-	0x01,			/* MBOX_GET_RETRY_COUNT */
-	0x00,			/* 0x0023 */
-	0x00,			/* 0x0024 */
-	0x00,			/* 0x0025 */
-	0x00,			/* 0x0026 */
-	0x00,			/* 0x0027 */
-	0x03,			/* MBOX_GET_TARGET_PARAMS */
-	0x03,			/* MBOX_GET_DEV_QUEUE_PARAMS */
-	0x00,			/* 0x002a */
-	0x00,			/* 0x002b */
-	0x00,			/* 0x002c */
-	0x00,			/* 0x002d */
-	0x00,			/* 0x002e */
-	0x00,			/* 0x002f */
-	0x00,			/* 0x0030 */
-	0x00,			/* 0x0031 */
-	0x07,			/* MBOX_SET_RETRY_COUNT */
-	0x00,			/* 0x0033 */
-	0x00,			/* 0x0034 */
-	0x00,			/* 0x0035 */
-	0x00,			/* 0x0036 */
-	0x00,			/* 0x0037 */
-	0x0f,			/* MBOX_SET_TARGET_PARAMS */
-	0x0f,			/* MBOX_SET_DEV_QUEUE_PARAMS */
-	0x00,			/* 0x003a */
-	0x00,			/* 0x003b */
-	0x00,			/* 0x003c */
-	0x00,			/* 0x003d */
-	0x00,			/* 0x003e */
-	0x00,			/* 0x003f */
-	0x00,			/* 0x0040 */
-	0x00,			/* 0x0041 */
-	0x00,			/* 0x0042 */
-	0x00,			/* 0x0043 */
-	0x00,			/* 0x0044 */
-	0x00,			/* 0x0045 */
-	0x00,			/* 0x0046 */
-	0x00,			/* 0x0047 */
-	0x00,			/* 0x0048 */
-	0x00,			/* 0x0049 */
-	0x00,			/* 0x004a */
-	0x00,			/* 0x004b */
-	0x00,			/* 0x004c */
-	0x00,			/* 0x004d */
-	0x00,			/* 0x004e */
-	0x00,			/* 0x004f */
-	0x00,			/* 0x0050 */
-	0x00,			/* 0x0051 */
-	0x00,			/* 0x0052 */
-	0x00,			/* 0x0053 */
-	0xcf,			/* MBOX_EXECUTE_IOCB64 */
-	0x00,			/* 0x0055 */
-	0x00,			/* 0x0056 */
-	0x00,			/* 0x0057 */
-	0x00,			/* 0x0058 */
-	0x00,			/* 0x0059 */
-	0x00,			/* 0x005a */
-	0x00,			/* 0x005b */
-	0x00,			/* 0x005c */
-	0x00,			/* 0x005d */
-	0x00,			/* 0x005e */
-	0x00,			/* 0x005f */
-	0xff,			/* MBOX_INIT_FIRMWARE */
-	0xcd,			/* MBOX_GET_INIT_CB */
-	0x01,			/* MBOX_INIT_LIP */
-	0xcd,			/* MBOX_GET_POS_MAP */
-	0xcf,			/* MBOX_GET_PORT_DB */
-	0x03,			/* MBOX_CLEAR_ACA */
-	0x03,			/* MBOX_TARGET_RESET */
-	0x03,			/* MBOX_CLEAR_TASK_SET */
-	0x03,			/* MBOX_ABORT_TASK_SET */
-	0x01,			/* MBOX_GET_FIRMWARE_STATE */
-	0x03,			/* MBOX_GET_PORT_NAME */
-	0x00,			/* 0x006b */
-	0x00,			/* 0x006c */
-	0x00,			/* 0x006d */
-	0xcf,			/* MBOX_SEND_SNS */
-	0x0f,			/* MBOX_PORT_LOGIN */
-	0x03,			/* MBOX_SEND_CHANGE_REQUEST */
-	0x03,			/* MBOX_PORT_LOGOUT */
-};
-
-#define MAX_MBOX_COMMAND	(sizeof(mbox_param)/sizeof(u_short))
-
-
-struct id_name_map {
-	u64 wwn;
-	u_char loop_id;
-};
-
-struct sns_cb {
-	u_short len;
-	u_short res1;
-	u_int response_low;
-	u_int response_high;
-	u_short sub_len;
-	u_short res2;
-	u_char data[44];
-};
-
-/* address of instance of this struct is passed to adapter to initialize things
- */
-struct init_cb {
-	u_char version;
-	u_char reseverd1[1];
-	u_short firm_opts;
-	u_short max_frame_len;
-	u_short max_iocb;
-	u_short exec_throttle;
-	u_char retry_cnt;
-	u_char retry_delay;
-	u_short node_name[4];
-	u_short hard_addr;
-	u_char reserved2[10];
-	u_short req_queue_out;
-	u_short res_queue_in;
-	u_short req_queue_len;
-	u_short res_queue_len;
-	u_int req_queue_addr_lo;
-	u_int req_queue_addr_high;
-	u_int res_queue_addr_lo;
-	u_int res_queue_addr_high;
-        /* the rest of this structure only applies to the isp2200 */
-        u_short lun_enables;
-        u_char cmd_resource_cnt;
-        u_char notify_resource_cnt;
-        u_short timeout;
-        u_short reserved3;
-        u_short add_firm_opts;
-        u_char res_accum_timer;
-        u_char irq_delay_timer;
-        u_short special_options;
-        u_short reserved4[13];
-};
-
-/*
- * The result queue can be quite a bit smaller since continuation entries
- * do not show up there:
- */
-#define RES_QUEUE_LEN		((QLOGICFC_REQ_QUEUE_LEN + 1) / 8 - 1)
-#define QUEUE_ENTRY_LEN		64
-
-#if ISP2x00_FABRIC
-#define QLOGICFC_MAX_ID    0xff
-#else
-#define QLOGICFC_MAX_ID    0x7d
-#endif
-
-#define QLOGICFC_MAX_LUN	128
-#define QLOGICFC_MAX_LOOP_ID	0x7d
-
-/* the following connection options only apply to the 2200.  i have only
- * had success with LOOP_ONLY and P2P_ONLY.
- */
-
-#define LOOP_ONLY              0
-#define P2P_ONLY               1
-#define LOOP_PREFERED          2
-#define P2P_PREFERED           3
-
-#define CONNECTION_PREFERENCE  LOOP_ONLY
-
-/* adapter_state values */
-#define AS_FIRMWARE_DEAD      -1
-#define AS_LOOP_DOWN           0
-#define AS_LOOP_GOOD           1
-#define AS_REDO_FABRIC_PORTDB  2
-#define AS_REDO_LOOP_PORTDB    4
-
-#define RES_SIZE	((RES_QUEUE_LEN + 1)*QUEUE_ENTRY_LEN)
-#define REQ_SIZE	((QLOGICFC_REQ_QUEUE_LEN + 1)*QUEUE_ENTRY_LEN)
-
-struct isp2x00_hostdata {
-	u_char revision;
-	struct pci_dev *pci_dev;
-	/* result and request queues (shared with isp2x00): */
-	u_int req_in_ptr;	/* index of next request slot */
-	u_int res_out_ptr;	/* index of next result slot */
-
-	/* this is here so the queues are nicely aligned */
-	long send_marker;	/* do we need to send a marker? */
-
-	char * res;
-	char * req;
-	struct init_cb control_block;
-	int adapter_state;
-	unsigned long int tag_ages[QLOGICFC_MAX_ID + 1];
-	Scsi_Cmnd *handle_ptrs[QLOGICFC_REQ_QUEUE_LEN + 1];
-	unsigned long handle_serials[QLOGICFC_REQ_QUEUE_LEN + 1];
-	struct id_name_map port_db[QLOGICFC_MAX_ID + 1];
-	u_char mbox_done;
-	u64 wwn;
-	u_int port_id;
-	u_char queued;
-	u_char host_id;
-        struct timer_list explore_timer;
-	struct id_name_map tempmap[QLOGICFC_MAX_ID + 1];
-};
-
-
-/* queue length's _must_ be power of two: */
-#define QUEUE_DEPTH(in, out, ql)	((in - out) & (ql))
-#define REQ_QUEUE_DEPTH(in, out)	QUEUE_DEPTH(in, out, 		     \
-						    QLOGICFC_REQ_QUEUE_LEN)
-#define RES_QUEUE_DEPTH(in, out)	QUEUE_DEPTH(in, out, RES_QUEUE_LEN)
-
-static void isp2x00_enable_irqs(struct Scsi_Host *);
-static void isp2x00_disable_irqs(struct Scsi_Host *);
-static int isp2x00_init(struct Scsi_Host *);
-static int isp2x00_reset_hardware(struct Scsi_Host *);
-static int isp2x00_mbox_command(struct Scsi_Host *, u_short[]);
-static int isp2x00_return_status(Scsi_Cmnd *, struct Status_Entry *);
-static void isp2x00_intr_handler(int, void *, struct pt_regs *);
-static irqreturn_t do_isp2x00_intr_handler(int, void *, struct pt_regs *);
-static int isp2x00_make_portdb(struct Scsi_Host *);
-
-#if ISP2x00_FABRIC
-static int isp2x00_init_fabric(struct Scsi_Host *, struct id_name_map *, int);
-#endif
-
-#if USE_NVRAM_DEFAULTS
-static int isp2x00_get_nvram_defaults(struct Scsi_Host *, struct init_cb *);
-static u_short isp2x00_read_nvram_word(struct Scsi_Host *, u_short);
-#endif
-
-#if DEBUG_ISP2x00
-static void isp2x00_print_scsi_cmd(Scsi_Cmnd *);
-#endif
-
-#if DEBUG_ISP2x00_INTR
-static void isp2x00_print_status_entry(struct Status_Entry *);
-#endif
-
-static inline void isp2x00_enable_irqs(struct Scsi_Host *host)
-{
-	outw(ISP_EN_INT | ISP_EN_RISC, host->io_port + PCI_INTER_CTL);
-}
-
-
-static inline void isp2x00_disable_irqs(struct Scsi_Host *host)
-{
-	outw(0x0, host->io_port + PCI_INTER_CTL);
-}
-
-
-int isp2x00_detect(Scsi_Host_Template * tmpt)
-{
-	int hosts = 0;
-	unsigned long wait_time;
-	struct Scsi_Host *host = NULL;
-	struct isp2x00_hostdata *hostdata;
-	struct pci_dev *pdev;
-	unsigned short device_ids[2];
-	dma_addr_t busaddr;
-	int i;
-
-
-	ENTER("isp2x00_detect");
-
-       	device_ids[0] = PCI_DEVICE_ID_QLOGIC_ISP2100;
-	device_ids[1] = PCI_DEVICE_ID_QLOGIC_ISP2200;
-
-	tmpt->proc_name = "isp2x00";
-
-	for (i=0; i<2; i++){
-		pdev = NULL;
-	        while ((pdev = pci_find_device(PCI_VENDOR_ID_QLOGIC, device_ids[i], pdev))) {
-			if (pci_enable_device(pdev))
-				continue;
-
-			/* Try to configure DMA attributes. */
-			if (pci_set_dma_mask(pdev, 0xffffffffffffffffULL) &&
-			    pci_set_dma_mask(pdev, 0xffffffffULL))
-					continue;
-
-		        host = scsi_register(tmpt, sizeof(struct isp2x00_hostdata));
-			if (!host) {
-			        printk("qlogicfc%d : could not register host.\n", hosts);
-				continue;
-			}
- 			scsi_set_device(host, &pdev->dev);
-			host->max_id = QLOGICFC_MAX_ID + 1;
-			host->max_lun = QLOGICFC_MAX_LUN;
-			hostdata = (struct isp2x00_hostdata *) host->hostdata;
-
-			memset(hostdata, 0, sizeof(struct isp2x00_hostdata));
-			hostdata->pci_dev = pdev;
-			hostdata->res = pci_alloc_consistent(pdev, RES_SIZE + REQ_SIZE, &busaddr);
-
-			if (!hostdata->res){
-			        printk("qlogicfc%d : could not allocate memory for request and response queue.\n", hosts);
-			        scsi_unregister(host);
-				continue;
-			}
-			hostdata->req = hostdata->res + (RES_QUEUE_LEN + 1)*QUEUE_ENTRY_LEN;
-			hostdata->queued = 0;
-			/* set up the control block */
-			hostdata->control_block.version = 0x1;
-			hostdata->control_block.firm_opts = cpu_to_le16(0x800e);
-			hostdata->control_block.max_frame_len = cpu_to_le16(2048);
-			hostdata->control_block.max_iocb = cpu_to_le16(QLOGICFC_REQ_QUEUE_LEN);
-			hostdata->control_block.exec_throttle = cpu_to_le16(QLOGICFC_CMD_PER_LUN);
-			hostdata->control_block.retry_delay = 5;
-			hostdata->control_block.retry_cnt = 1;
-			hostdata->control_block.node_name[0] = cpu_to_le16(0x0020);
-			hostdata->control_block.node_name[1] = cpu_to_le16(0xE000);
-			hostdata->control_block.node_name[2] = cpu_to_le16(0x008B);
-			hostdata->control_block.node_name[3] = cpu_to_le16(0x0000);
-			hostdata->control_block.hard_addr = cpu_to_le16(0x0003);
-			hostdata->control_block.req_queue_len = cpu_to_le16(QLOGICFC_REQ_QUEUE_LEN + 1);
-			hostdata->control_block.res_queue_len = cpu_to_le16(RES_QUEUE_LEN + 1);
-			hostdata->control_block.res_queue_addr_lo = cpu_to_le32(pci64_dma_lo32(busaddr));
-			hostdata->control_block.res_queue_addr_high = cpu_to_le32(pci64_dma_hi32(busaddr));
-			hostdata->control_block.req_queue_addr_lo = cpu_to_le32(pci64_dma_lo32(busaddr + RES_SIZE));
-			hostdata->control_block.req_queue_addr_high = cpu_to_le32(pci64_dma_hi32(busaddr + RES_SIZE));
-
-
-			hostdata->control_block.add_firm_opts |= cpu_to_le16(CONNECTION_PREFERENCE<<4);
-			hostdata->adapter_state = AS_LOOP_DOWN;
-			hostdata->explore_timer.data = 1;
-			hostdata->host_id = hosts;
-
-			if (isp2x00_init(host) || isp2x00_reset_hardware(host)) {
-				pci_free_consistent (pdev, RES_SIZE + REQ_SIZE, hostdata->res, busaddr);
-			        scsi_unregister(host);
-				continue;
-			}
-			host->this_id = 0;
-
-			if (request_irq(host->irq, do_isp2x00_intr_handler, SA_INTERRUPT | SA_SHIRQ, "qlogicfc", host)) {
-			        printk("qlogicfc%d : interrupt %d already in use\n",
-				       hostdata->host_id, host->irq);
-				pci_free_consistent (pdev, RES_SIZE + REQ_SIZE, hostdata->res, busaddr);
-				scsi_unregister(host);
-				continue;
-			}
-			if (!request_region(host->io_port, 0xff, "qlogicfc")) {
-			        printk("qlogicfc%d : i/o region 0x%lx-0x%lx already "
-				       "in use\n",
-				       hostdata->host_id, host->io_port, host->io_port + 0xff);
-				free_irq(host->irq, host);
-				pci_free_consistent (pdev, RES_SIZE + REQ_SIZE, hostdata->res, busaddr);
-				scsi_unregister(host);
-				continue;
-			}
-
-			outw(0x0, host->io_port + PCI_SEMAPHORE);
-			outw(HCCR_CLEAR_RISC_INTR, host->io_port + HOST_HCCR);
-			isp2x00_enable_irqs(host);
-			/* wait for the loop to come up */
-			for (wait_time = jiffies + 10 * HZ; time_before(jiffies, wait_time) && hostdata->adapter_state == AS_LOOP_DOWN;) {
-			        barrier();
-				cpu_relax();
-			}
-			if (hostdata->adapter_state == AS_LOOP_DOWN) {
-			        printk("qlogicfc%d : link is not up\n", hostdata->host_id);
-			}
-			hosts++;
-			hostdata->explore_timer.data = 0;
-		}
-	}
-
-
-	/* this busy loop should not be needed but the isp2x00 seems to need 
-	   some time before recognizing it is attached to a fabric */
-
-#if ISP2x00_FABRIC
-	for (wait_time = jiffies + 5 * HZ; time_before(jiffies, wait_time);) {
-		barrier();
-		cpu_relax();
-	}
-#endif
-
-	LEAVE("isp2x00_detect");
-
-	return hosts;
-}
-
-
-static int isp2x00_make_portdb(struct Scsi_Host *host)
-{
-
-	short param[8];
-	int i, j;
-	struct isp2x00_hostdata *hostdata;
-
-	isp2x00_disable_irqs(host);
-
-	hostdata = (struct isp2x00_hostdata *) host->hostdata;
-	memset(hostdata->tempmap, 0, sizeof(hostdata->tempmap));
-
-#if ISP2x00_FABRIC
-	for (i = 0x81; i < QLOGICFC_MAX_ID; i++) {
-		param[0] = MBOX_PORT_LOGOUT;
-		param[1] = i << 8;
-		param[2] = 0;
-		param[3] = 0;
-
-		isp2x00_mbox_command(host, param);
-
-		if (param[0] != MBOX_COMMAND_COMPLETE) {
-
-			DEBUG_FABRIC(printk("qlogicfc%d : logout failed %x  %x\n", hostdata->host_id, i, param[0]));
-		}
-	}
-#endif
-
-
-	param[0] = MBOX_GET_INIT_SCSI_ID;
-
-	isp2x00_mbox_command(host, param);
-
-	if (param[0] == MBOX_COMMAND_COMPLETE) {
-		hostdata->port_id = ((u_int) param[3]) << 16;
-		hostdata->port_id |= param[2];
-		hostdata->tempmap[0].loop_id = param[1];
-		hostdata->tempmap[0].wwn = hostdata->wwn;
-	}
-	else {
-	        printk("qlogicfc%d : error getting scsi id.\n", hostdata->host_id);
-	}
-
-        for (i = 0; i <=QLOGICFC_MAX_ID; i++)
-                hostdata->tempmap[i].loop_id = hostdata->tempmap[0].loop_id;
-   
-        for (i = 0, j = 1; i <= QLOGICFC_MAX_LOOP_ID; i++) {
-                param[0] = MBOX_GET_PORT_NAME;
-		param[1] = (i << 8) & 0xff00;
-
-		isp2x00_mbox_command(host, param);
-
-		if (param[0] == MBOX_COMMAND_COMPLETE) {
-			hostdata->tempmap[j].loop_id = i;
-			hostdata->tempmap[j].wwn = ((u64) (param[2] & 0xff)) << 56;
-			hostdata->tempmap[j].wwn |= ((u64) ((param[2] >> 8) & 0xff)) << 48;
-			hostdata->tempmap[j].wwn |= ((u64) (param[3] & 0xff)) << 40;
-			hostdata->tempmap[j].wwn |= ((u64) ((param[3] >> 8) & 0xff)) << 32;
-			hostdata->tempmap[j].wwn |= ((u64) (param[6] & 0xff)) << 24;
-			hostdata->tempmap[j].wwn |= ((u64) ((param[6] >> 8) & 0xff)) << 16;
-			hostdata->tempmap[j].wwn |= ((u64) (param[7] & 0xff)) << 8;
-			hostdata->tempmap[j].wwn |= ((u64) ((param[7] >> 8) & 0xff));
-
-			j++;
-
-		}
-	}
-
-
-#if ISP2x00_FABRIC
-	isp2x00_init_fabric(host, hostdata->tempmap, j);
-#endif
-
-	for (i = 0; i <= QLOGICFC_MAX_ID; i++) {
-		if (hostdata->tempmap[i].wwn != hostdata->port_db[i].wwn) {
-			for (j = 0; j <= QLOGICFC_MAX_ID; j++) {
-				if (hostdata->tempmap[j].wwn == hostdata->port_db[i].wwn) {
-					hostdata->port_db[i].loop_id = hostdata->tempmap[j].loop_id;
-					break;
-				}
-			}
-			if (j == QLOGICFC_MAX_ID + 1)
-				hostdata->port_db[i].loop_id = hostdata->tempmap[0].loop_id;
-
-			for (j = 0; j <= QLOGICFC_MAX_ID; j++) {
-				if (hostdata->port_db[j].wwn == hostdata->tempmap[i].wwn || !hostdata->port_db[j].wwn) {
-					break;
-				}
-			}
-			if (j == QLOGICFC_MAX_ID + 1)
-				printk("qlogicfc%d : Too many scsi devices, no more room in port map.\n", hostdata->host_id);
-			if (!hostdata->port_db[j].wwn) {
-				hostdata->port_db[j].loop_id = hostdata->tempmap[i].loop_id;
-				hostdata->port_db[j].wwn = hostdata->tempmap[i].wwn;
-			}
-		} else
-			hostdata->port_db[i].loop_id = hostdata->tempmap[i].loop_id;
-
-	}
-
-	isp2x00_enable_irqs(host);
-
-	return 0;
-}
-
-
-#if ISP2x00_FABRIC
-
-#define FABRIC_PORT          0x7e
-#define FABRIC_CONTROLLER    0x7f
-#define FABRIC_SNS           0x80
-
-int isp2x00_init_fabric(struct Scsi_Host *host, struct id_name_map *port_db, int cur_scsi_id)
-{
-
-	u_short param[8];
-	u64 wwn;
-	int done = 0;
-	u_short loop_id = 0x81;
-	u_short scsi_id = cur_scsi_id;
-	u_int port_id;
-	struct sns_cb *req;
-	u_char *sns_response;
-	dma_addr_t busaddr;
-	struct isp2x00_hostdata *hostdata;
-
-	hostdata = (struct isp2x00_hostdata *) host->hostdata;
-	
-	DEBUG_FABRIC(printk("qlogicfc%d : Checking for a fabric.\n", hostdata->host_id));
-	param[0] = MBOX_GET_PORT_NAME;
-	param[1] = (u16)FABRIC_PORT << 8;
-
-	isp2x00_mbox_command(host, param);
-
-	if (param[0] != MBOX_COMMAND_COMPLETE) {
-		DEBUG_FABRIC(printk("qlogicfc%d : fabric check result %x\n", hostdata->host_id, param[0]));
-		return 0;
-	}
-	printk("qlogicfc%d : Fabric found.\n", hostdata->host_id);
-
-	req = (struct sns_cb *)pci_alloc_consistent(hostdata->pci_dev, sizeof(*req) + 608, &busaddr);
-	
-	if (!req){
-		printk("qlogicfc%d : Could not allocate DMA resources for fabric initialization\n", hostdata->host_id);
-		return 0;
-	}
-	sns_response = (u_char *)(req + 1);
-
-	if (hostdata->adapter_state & AS_REDO_LOOP_PORTDB){
-	        memset(req, 0, sizeof(*req));
-	
-		req->len = cpu_to_le16(8);
-		req->response_low = cpu_to_le32(pci64_dma_lo32(busaddr + sizeof(*req)));
-		req->response_high = cpu_to_le32(pci64_dma_hi32(busaddr + sizeof(*req)));
-		req->sub_len = cpu_to_le16(22);
-		req->data[0] = 0x17;
-		req->data[1] = 0x02;
-		req->data[8] = (u_char) (hostdata->port_id & 0xff);
-		req->data[9] = (u_char) (hostdata->port_id >> 8 & 0xff);
-		req->data[10] = (u_char) (hostdata->port_id >> 16 & 0xff);
-		req->data[13] = 0x01;
-		param[0] = MBOX_SEND_SNS;
-		param[1] = 30;
-		param[2] = pci64_dma_lo32(busaddr) >> 16;
-		param[3] = pci64_dma_lo32(busaddr);
-		param[6] = pci64_dma_hi32(busaddr) >> 16;
-		param[7] = pci64_dma_hi32(busaddr);
-
-		isp2x00_mbox_command(host, param);
-	
-		if (param[0] != MBOX_COMMAND_COMPLETE)
-		        printk("qlogicfc%d : error sending RFC-4\n", hostdata->host_id);
-	}
-
-	port_id = hostdata->port_id;
-	while (!done) {
-		memset(req, 0, sizeof(*req));
-
-		req->len = cpu_to_le16(304);
-		req->response_low = cpu_to_le32(pci64_dma_lo32(busaddr + sizeof(*req)));
-		req->response_high = cpu_to_le32(pci64_dma_hi32(busaddr + sizeof(*req)));
-		req->sub_len = cpu_to_le16(6);
-		req->data[0] = 0x00;
-		req->data[1] = 0x01;
-		req->data[8] = (u_char) (port_id & 0xff);
-		req->data[9] = (u_char) (port_id >> 8 & 0xff);
-		req->data[10] = (u_char) (port_id >> 16 & 0xff);
-
-		param[0] = MBOX_SEND_SNS;
-		param[1] = 14;
-		param[2] = pci64_dma_lo32(busaddr) >> 16;
-		param[3] = pci64_dma_lo32(busaddr);
-		param[6] = pci64_dma_hi32(busaddr) >> 16;
-		param[7] = pci64_dma_hi32(busaddr);
-
-		isp2x00_mbox_command(host, param);
-
-		if (param[0] == MBOX_COMMAND_COMPLETE) {
-			DEBUG_FABRIC(printk("qlogicfc%d : found node %02x%02x%02x%02x%02x%02x%02x%02x ", hostdata->host_id, sns_response[20], sns_response[21], sns_response[22], sns_response[23], sns_response[24], sns_response[25], sns_response[26], sns_response[27]));
-			DEBUG_FABRIC(printk("  port id: %02x%02x%02x\n", sns_response[17], sns_response[18], sns_response[19]));
-			port_id = ((u_int) sns_response[17]) << 16;
-			port_id |= ((u_int) sns_response[18]) << 8;
-			port_id |= ((u_int) sns_response[19]);
-			wwn = ((u64) sns_response[20]) << 56;
-			wwn |= ((u64) sns_response[21]) << 48;
-			wwn |= ((u64) sns_response[22]) << 40;
-			wwn |= ((u64) sns_response[23]) << 32;
-			wwn |= ((u64) sns_response[24]) << 24;
-			wwn |= ((u64) sns_response[25]) << 16;
-			wwn |= ((u64) sns_response[26]) << 8;
-			wwn |= ((u64) sns_response[27]);
-			if (hostdata->port_id >> 8 != port_id >> 8) {
-				DEBUG_FABRIC(printk("qlogicfc%d : adding a fabric port: %x\n", hostdata->host_id, port_id));
-				param[0] = MBOX_PORT_LOGIN;
-				param[1] = loop_id << 8;
-				param[2] = (u_short) (port_id >> 16);
-				param[3] = (u_short) (port_id);
-
-				isp2x00_mbox_command(host, param);
-
-				if (param[0] == MBOX_COMMAND_COMPLETE) {
-					port_db[scsi_id].wwn = wwn;
-					port_db[scsi_id].loop_id = loop_id;
-					loop_id++;
-					scsi_id++;
-				} else {
-					printk("qlogicfc%d : Error performing port login %x\n", hostdata->host_id, param[0]);
-					DEBUG_FABRIC(printk("qlogicfc%d : loop_id: %x\n", hostdata->host_id, loop_id));
-					param[0] = MBOX_PORT_LOGOUT;
-					param[1] = loop_id << 8;
-					param[2] = 0;
-					param[3] = 0;
-
-					isp2x00_mbox_command(host, param);
-					
-				}
-
-			}
-			if (hostdata->port_id == port_id)
-				done = 1;
-		} else {
-			printk("qlogicfc%d : Get All Next failed %x.\n", hostdata->host_id, param[0]);
-			pci_free_consistent(hostdata->pci_dev, sizeof(*req) + 608, req, busaddr);
-			return 0;
-		}
-	}
-
-	pci_free_consistent(hostdata->pci_dev, sizeof(*req) + 608, req, busaddr);
-	return 1;
-}
-
-#endif				/* ISP2x00_FABRIC */
-
-
-int isp2x00_release(struct Scsi_Host *host)
-{
-	struct isp2x00_hostdata *hostdata;
-	dma_addr_t busaddr;
-
-	ENTER("isp2x00_release");
-
-	hostdata = (struct isp2x00_hostdata *) host->hostdata;
-
-	outw(0x0, host->io_port + PCI_INTER_CTL);
-	free_irq(host->irq, host);
-
-	release_region(host->io_port, 0xff);
-
-	busaddr = pci64_dma_build(le32_to_cpu(hostdata->control_block.res_queue_addr_high),
-				  le32_to_cpu(hostdata->control_block.res_queue_addr_lo));
-	pci_free_consistent(hostdata->pci_dev, RES_SIZE + REQ_SIZE, hostdata->res, busaddr);
-
-	LEAVE("isp2x00_release");
-
-	return 0;
-}
-
-
-const char *isp2x00_info(struct Scsi_Host *host)
-{
-	static char buf[80];
-	struct isp2x00_hostdata *hostdata;
-	ENTER("isp2x00_info");
-
-	hostdata = (struct isp2x00_hostdata *) host->hostdata;
-	sprintf(buf,
-		"QLogic ISP%04x SCSI on PCI bus %02x device %02x irq %d base 0x%lx",
-		hostdata->pci_dev->device, hostdata->pci_dev->bus->number, hostdata->pci_dev->devfn, host->irq,
-		host->io_port);
-
-
-	LEAVE("isp2x00_info");
-
-	return buf;
-}
-
-
-/*
- * The middle SCSI layer ensures that queuecommand never gets invoked
- * concurrently with itself or the interrupt handler (though the
- * interrupt handler may call this routine as part of
- * request-completion handling).
- */
-int isp2x00_queuecommand(Scsi_Cmnd * Cmnd, void (*done) (Scsi_Cmnd *))
-{
-	int i, sg_count, n, num_free;
-	u_int in_ptr, out_ptr;
-	struct dataseg *ds;
-	struct scatterlist *sg;
-	struct Command_Entry *cmd;
-	struct Continuation_Entry *cont;
-	struct Scsi_Host *host;
-	struct isp2x00_hostdata *hostdata;
-
-	ENTER("isp2x00_queuecommand");
-
-	host = Cmnd->device->host;
-	hostdata = (struct isp2x00_hostdata *) host->hostdata;
-	Cmnd->scsi_done = done;
-
-	DEBUG(isp2x00_print_scsi_cmd(Cmnd));
-
-	if (hostdata->adapter_state & AS_REDO_FABRIC_PORTDB || hostdata->adapter_state & AS_REDO_LOOP_PORTDB) {
-		isp2x00_make_portdb(host);
-		hostdata->adapter_state = AS_LOOP_GOOD;
-		printk("qlogicfc%d : Port Database\n", hostdata->host_id);
-		for (i = 0; hostdata->port_db[i].wwn != 0; i++) {
-			printk("wwn: %08x%08x  scsi_id: %x  loop_id: ", (u_int) (hostdata->port_db[i].wwn >> 32), (u_int) hostdata->port_db[i].wwn, i);
-			if (hostdata->port_db[i].loop_id != hostdata->port_db[0].loop_id || i == 0)
-			        printk("%x", hostdata->port_db[i].loop_id);
-			else
-			        printk("Not Available");
-			printk("\n");
-		}
-	}
-	if (hostdata->adapter_state == AS_FIRMWARE_DEAD) {
-		printk("qlogicfc%d : The firmware is dead, just return.\n", hostdata->host_id);
-		host->max_id = 0;
-		return 0;
-	}
-
-	out_ptr = inw(host->io_port + MBOX4);
-	in_ptr = hostdata->req_in_ptr;
-
-	DEBUG(printk("qlogicfc%d : request queue depth %d\n", hostdata->host_id,
-		     REQ_QUEUE_DEPTH(in_ptr, out_ptr)));
-
-	cmd = (struct Command_Entry *) &hostdata->req[in_ptr*QUEUE_ENTRY_LEN];
-	in_ptr = (in_ptr + 1) & QLOGICFC_REQ_QUEUE_LEN;
-	if (in_ptr == out_ptr) {
-		DEBUG(printk("qlogicfc%d : request queue overflow\n", hostdata->host_id));
-		return 1;
-	}
-	if (hostdata->send_marker) {
-		struct Marker_Entry *marker;
-
-		TRACE("queue marker", in_ptr, 0);
-
-		DEBUG(printk("qlogicfc%d : adding marker entry\n", hostdata->host_id));
-		marker = (struct Marker_Entry *) cmd;
-		memset(marker, 0, sizeof(struct Marker_Entry));
-
-		marker->hdr.entry_type = ENTRY_MARKER;
-		marker->hdr.entry_cnt = 1;
-		marker->modifier = SYNC_ALL;
-
-		hostdata->send_marker = 0;
-
-		if (((in_ptr + 1) & QLOGICFC_REQ_QUEUE_LEN) == out_ptr) {
-			outw(in_ptr, host->io_port + MBOX4);
-			hostdata->req_in_ptr = in_ptr;
-			DEBUG(printk("qlogicfc%d : request queue overflow\n", hostdata->host_id));
-			return 1;
-		}
-		cmd = (struct Command_Entry *) &hostdata->req[in_ptr*QUEUE_ENTRY_LEN];
-		in_ptr = (in_ptr + 1) & QLOGICFC_REQ_QUEUE_LEN;
-	}
-	TRACE("queue command", in_ptr, Cmnd);
-
-	memset(cmd, 0, sizeof(struct Command_Entry));
-
-	/* find a free handle mapping slot */
-	for (i = in_ptr; i != (in_ptr - 1) && hostdata->handle_ptrs[i]; i = ((i + 1) % (QLOGICFC_REQ_QUEUE_LEN + 1)));
-
-	if (!hostdata->handle_ptrs[i]) {
-		cmd->handle = cpu_to_le32(i);
-		hostdata->handle_ptrs[i] = Cmnd;
-		hostdata->handle_serials[i] = Cmnd->serial_number;
-	} else {
-		printk("qlogicfc%d : no handle slots, this should not happen.\n", hostdata->host_id);
-		printk("hostdata->queued is %x, in_ptr: %x\n", hostdata->queued, in_ptr);
-		for (i = 0; i <= QLOGICFC_REQ_QUEUE_LEN; i++){
-			if (!hostdata->handle_ptrs[i]){
-				printk("slot %d has %p\n", i, hostdata->handle_ptrs[i]);
-			}
-		}
-		return 1;
-	}
-
-	cmd->hdr.entry_type = ENTRY_COMMAND;
-	cmd->hdr.entry_cnt = 1;
-	cmd->target_lun = Cmnd->device->lun;
-	cmd->expanded_lun = cpu_to_le16(Cmnd->device->lun);
-#if ISP2x00_PORTDB
-	cmd->target_id = hostdata->port_db[Cmnd->device->id].loop_id;
-#else
-	cmd->target_id = Cmnd->target;
-#endif
-	cmd->total_byte_cnt = cpu_to_le32(Cmnd->request_bufflen);
-	cmd->time_out = 0;
-	memcpy(cmd->cdb, Cmnd->cmnd, Cmnd->cmd_len);
-
-	if (Cmnd->use_sg) {
-		sg = (struct scatterlist *) Cmnd->request_buffer;
-		sg_count = pci_map_sg(hostdata->pci_dev, sg, Cmnd->use_sg, scsi_to_pci_dma_dir(Cmnd->sc_data_direction));
-		cmd->segment_cnt = cpu_to_le16(sg_count);
-		ds = cmd->dataseg;
-		/* fill in first two sg entries: */
-		n = sg_count;
-		if (n > DATASEGS_PER_COMMAND)
-			n = DATASEGS_PER_COMMAND;
-
-		for (i = 0; i < n; i++) {
-			ds[i].d_base = cpu_to_le32(pci64_dma_lo32(sg_dma_address(sg)));
-			ds[i].d_base_hi = cpu_to_le32(pci64_dma_hi32(sg_dma_address(sg)));
-			ds[i].d_count = cpu_to_le32(sg_dma_len(sg));
-			++sg;
-		}
-		sg_count -= DATASEGS_PER_COMMAND;
-
-		while (sg_count > 0) {
-			++cmd->hdr.entry_cnt;
-			cont = (struct Continuation_Entry *)
-			    &hostdata->req[in_ptr*QUEUE_ENTRY_LEN];
-			memset(cont, 0, sizeof(struct Continuation_Entry));
-			in_ptr = (in_ptr + 1) & QLOGICFC_REQ_QUEUE_LEN;
-			if (in_ptr == out_ptr) {
-				DEBUG(printk("qlogicfc%d : unexpected request queue overflow\n", hostdata->host_id));
-				return 1;
-			}
-			TRACE("queue continuation", in_ptr, 0);
-			cont->hdr.entry_type = ENTRY_CONTINUATION;
-			ds = cont->dataseg;
-			n = sg_count;
-			if (n > DATASEGS_PER_CONT)
-				n = DATASEGS_PER_CONT;
-			for (i = 0; i < n; ++i) {
-				ds[i].d_base = cpu_to_le32(pci64_dma_lo32(sg_dma_address(sg)));
-				ds[i].d_base_hi = cpu_to_le32(pci64_dma_hi32(sg_dma_address(sg)));
-				ds[i].d_count = cpu_to_le32(sg_dma_len(sg));
-				++sg;
-			}
-			sg_count -= n;
-		}
-	} else if (Cmnd->request_bufflen && Cmnd->sc_data_direction != PCI_DMA_NONE) {
-		struct page *page = virt_to_page(Cmnd->request_buffer);
-		unsigned long offset = offset_in_page(Cmnd->request_buffer);
-		dma_addr_t busaddr = pci_map_page(hostdata->pci_dev,
-						  page, offset,
-						  Cmnd->request_bufflen,
-						  scsi_to_pci_dma_dir(Cmnd->sc_data_direction));
-		Cmnd->SCp.dma_handle = busaddr;
-
-		cmd->dataseg[0].d_base = cpu_to_le32(pci64_dma_lo32(busaddr));
-		cmd->dataseg[0].d_base_hi = cpu_to_le32(pci64_dma_hi32(busaddr));
-		cmd->dataseg[0].d_count = cpu_to_le32(Cmnd->request_bufflen);
-		cmd->segment_cnt = cpu_to_le16(1);
-	} else {
-		cmd->dataseg[0].d_base = 0;
-		cmd->dataseg[0].d_base_hi = 0;
-		cmd->segment_cnt = cpu_to_le16(1); /* Shouldn't this be 0? */
-	}
-
-	if (Cmnd->sc_data_direction == SCSI_DATA_WRITE)
-		cmd->control_flags = cpu_to_le16(CFLAG_WRITE);
-	else 
-		cmd->control_flags = cpu_to_le16(CFLAG_READ);
-
-	if (Cmnd->device->tagged_supported) {
-		if ((jiffies - hostdata->tag_ages[Cmnd->device->id]) > (2 * SCSI_TIMEOUT)) {
-			cmd->control_flags |= cpu_to_le16(CFLAG_ORDERED_TAG);
-			hostdata->tag_ages[Cmnd->device->id] = jiffies;
-		} else
-			switch (Cmnd->tag) {
-			case HEAD_OF_QUEUE_TAG:
-				cmd->control_flags |= cpu_to_le16(CFLAG_HEAD_TAG);
-				break;
-			case ORDERED_QUEUE_TAG:
-				cmd->control_flags |= cpu_to_le16(CFLAG_ORDERED_TAG);
-				break;
-			default:
-				cmd->control_flags |= cpu_to_le16(CFLAG_SIMPLE_TAG);
-				break;
-		}
-	}
-	/*
-	 * TEST_UNIT_READY commands from scsi_scan will fail due to "overlapped
-	 * commands attempted" unless we setup at least a simple queue (midlayer 
-	 * will embelish this once it can do an INQUIRY command to the device)
-	 */
-	else
-		cmd->control_flags |= cpu_to_le16(CFLAG_SIMPLE_TAG);
-	outw(in_ptr, host->io_port + MBOX4);
-	hostdata->req_in_ptr = in_ptr;
-
-	hostdata->queued++;
-
-	num_free = QLOGICFC_REQ_QUEUE_LEN - REQ_QUEUE_DEPTH(in_ptr, out_ptr);
-	num_free = (num_free > 2) ? num_free - 2 : 0;
-       host->can_queue = host->host_busy + num_free;
-	if (host->can_queue > QLOGICFC_REQ_QUEUE_LEN)
-		host->can_queue = QLOGICFC_REQ_QUEUE_LEN;
-	host->sg_tablesize = QLOGICFC_MAX_SG(num_free);
-
-	LEAVE("isp2x00_queuecommand");
-
-	return 0;
-}
-
-
-/* we have received an event, such as a lip or an RSCN, which may mean that
- * our port database is incorrect so the port database must be recreated.
- */
-static void redo_port_db(unsigned long arg)
-{
-
-        struct Scsi_Host * host = (struct Scsi_Host *) arg;
-	struct isp2x00_hostdata * hostdata;
-	unsigned long flags;
-	int i;
-
-	hostdata = (struct isp2x00_hostdata *) host->hostdata;
-	hostdata->explore_timer.data = 0;
-	del_timer(&hostdata->explore_timer);
-
-	spin_lock_irqsave(host->host_lock, flags);
-
-	if (hostdata->adapter_state & AS_REDO_FABRIC_PORTDB || hostdata->adapter_state & AS_REDO_LOOP_PORTDB) {
-		isp2x00_make_portdb(host);
-		printk("qlogicfc%d : Port Database\n", hostdata->host_id);
-		for (i = 0; hostdata->port_db[i].wwn != 0; i++) {
-			printk("wwn: %08x%08x  scsi_id: %x  loop_id: ", (u_int) (hostdata->port_db[i].wwn >> 32), (u_int) hostdata->port_db[i].wwn, i);
-			if (hostdata->port_db[i].loop_id != hostdata->port_db[0].loop_id || i == 0)
-			        printk("%x", hostdata->port_db[i].loop_id);
-			else
-			        printk("Not Available");
-			printk("\n");
-		}
-		
-	        for (i = 0; i < QLOGICFC_REQ_QUEUE_LEN; i++){ 
-		        if (hostdata->handle_ptrs[i] && (hostdata->port_db[hostdata->handle_ptrs[i]->device->id].loop_id > QLOGICFC_MAX_LOOP_ID || hostdata->adapter_state & AS_REDO_LOOP_PORTDB)){
-                                if (hostdata->port_db[hostdata->handle_ptrs[i]->device->id].loop_id != hostdata->port_db[0].loop_id){
-					Scsi_Cmnd *Cmnd = hostdata->handle_ptrs[i];
-
-					 if (Cmnd->use_sg)
-						 pci_unmap_sg(hostdata->pci_dev,
-							      (struct scatterlist *)Cmnd->buffer,
-							      Cmnd->use_sg,
-							      scsi_to_pci_dma_dir(Cmnd->sc_data_direction));
-					 else if (Cmnd->request_bufflen &&
-						  Cmnd->sc_data_direction != PCI_DMA_NONE) {
-						 pci_unmap_page(hostdata->pci_dev,
-								Cmnd->SCp.dma_handle,
-								Cmnd->request_bufflen,
-								scsi_to_pci_dma_dir(Cmnd->sc_data_direction));
-					 }
-
-					 hostdata->handle_ptrs[i]->result = DID_SOFT_ERROR << 16;
-
-					 if (hostdata->handle_ptrs[i]->scsi_done){
-					   (*hostdata->handle_ptrs[i]->scsi_done) (hostdata->handle_ptrs[i]);
-					 }
-					 else printk("qlogicfc%d : done is null?\n", hostdata->host_id);
-					 hostdata->handle_ptrs[i] = NULL;
-					 hostdata->handle_serials[i] = 0;
-				}
-			}
-		}
-		
-		hostdata->adapter_state = AS_LOOP_GOOD;
-	}
-
-	spin_unlock_irqrestore(host->host_lock, flags);
-
-}
-
-#define ASYNC_EVENT_INTERRUPT	0x01
-
-irqreturn_t do_isp2x00_intr_handler(int irq, void *dev_id, struct pt_regs *regs)
-{
-	struct Scsi_Host *host = dev_id;
-	unsigned long flags;
-
-	spin_lock_irqsave(host->host_lock, flags);
-	isp2x00_intr_handler(irq, dev_id, regs);
-	spin_unlock_irqrestore(host->host_lock, flags);
-
-	return IRQ_HANDLED;
-}
-
-void isp2x00_intr_handler(int irq, void *dev_id, struct pt_regs *regs)
-{
-	Scsi_Cmnd *Cmnd;
-	struct Status_Entry *sts;
-	struct Scsi_Host *host = dev_id;
-	struct isp2x00_hostdata *hostdata;
-	u_int in_ptr, out_ptr, handle, num_free;
-	u_short status;
-
-	ENTER_INTR("isp2x00_intr_handler");
-
-	hostdata = (struct isp2x00_hostdata *) host->hostdata;
-
-	DEBUG_INTR(printk("qlogicfc%d : interrupt on line %d\n", hostdata->host_id, irq));
-
-	if (!(inw(host->io_port + PCI_INTER_STS) & 0x08)) {
-		/* spurious interrupts can happen legally */
-		DEBUG_INTR(printk("qlogicfc%d : got spurious interrupt\n", hostdata->host_id));
-		return;
-	}
-	in_ptr = inw(host->io_port + MBOX5);
-	out_ptr = hostdata->res_out_ptr;
-
-	if ((inw(host->io_port + PCI_SEMAPHORE) & ASYNC_EVENT_INTERRUPT)) {
-		status = inw(host->io_port + MBOX0);
-
-		DEBUG_INTR(printk("qlogicfc%d : mbox completion status: %x\n",
-				  hostdata->host_id, status));
-
-		switch (status) {
-		case LOOP_UP:
-		case POINT_TO_POINT_UP:
-		        printk("qlogicfc%d : Link is Up\n", hostdata->host_id);
-			hostdata->adapter_state = AS_REDO_FABRIC_PORTDB | AS_REDO_LOOP_PORTDB;
-			break;
-		case LOOP_DOWN:
-		        printk("qlogicfc%d : Link is Down\n", hostdata->host_id);
-			hostdata->adapter_state = AS_LOOP_DOWN;
-			break;
-		case CONNECTION_MODE:
-		        printk("received CONNECTION_MODE irq %x\n", inw(host->io_port + MBOX1));
-			break;
-		case CHANGE_NOTIFICATION:
-		        printk("qlogicfc%d : RSCN Received\n", hostdata->host_id);
-			if (hostdata->adapter_state == AS_LOOP_GOOD)
-				hostdata->adapter_state = AS_REDO_FABRIC_PORTDB;
-			break;		        
-		case LIP_OCCURRED:
-		case LIP_RECEIVED:
-		        printk("qlogicfc%d : Loop Reinitialized\n", hostdata->host_id);
-			if (hostdata->adapter_state == AS_LOOP_GOOD)
-				hostdata->adapter_state = AS_REDO_LOOP_PORTDB;
-			break;
-		case SYSTEM_ERROR:
-			printk("qlogicfc%d : The firmware just choked.\n", hostdata->host_id);
-			hostdata->adapter_state = AS_FIRMWARE_DEAD;
-			break;
-		case SCSI_COMMAND_COMPLETE:
-			handle = inw(host->io_port + MBOX1) | (inw(host->io_port + MBOX2) << 16);
-			Cmnd = hostdata->handle_ptrs[handle];
-			hostdata->handle_ptrs[handle] = NULL;
-			hostdata->handle_serials[handle] = 0;
-			hostdata->queued--;
-			if (Cmnd != NULL) {
-				if (Cmnd->use_sg)
-					pci_unmap_sg(hostdata->pci_dev,
-						     (struct scatterlist *)Cmnd->buffer,
-						     Cmnd->use_sg,
-						     scsi_to_pci_dma_dir(Cmnd->sc_data_direction));
-				else if (Cmnd->request_bufflen &&
-					 Cmnd->sc_data_direction != PCI_DMA_NONE)
-					pci_unmap_page(hostdata->pci_dev,
-						       Cmnd->SCp.dma_handle,
-						       Cmnd->request_bufflen,
-						       scsi_to_pci_dma_dir(Cmnd->sc_data_direction));
-				Cmnd->result = 0x0;
-				(*Cmnd->scsi_done) (Cmnd);
-			} else
-				printk("qlogicfc%d.c : got a null value out of handle_ptrs, this sucks\n", hostdata->host_id);
-			break;
-		case MBOX_COMMAND_COMPLETE:
-		case INVALID_COMMAND:
-		case HOST_INTERFACE_ERROR:
-		case TEST_FAILED:
-		case COMMAND_ERROR:
-		case COMMAND_PARAM_ERROR:
-		case PORT_ID_USED:
-		case LOOP_ID_USED:
-		case ALL_IDS_USED:
-			hostdata->mbox_done = 1;
-			outw(HCCR_CLEAR_RISC_INTR, host->io_port + HOST_HCCR);
-			return;
-		default:
-			printk("qlogicfc%d : got an unknown status? %x\n", hostdata->host_id, status);
-		}
-		if ((hostdata->adapter_state & AS_REDO_LOOP_PORTDB || hostdata->adapter_state & AS_REDO_FABRIC_PORTDB) && hostdata->explore_timer.data == 0){
-                        hostdata->explore_timer.function = redo_port_db;
-			hostdata->explore_timer.data = (unsigned long)host;
-			hostdata->explore_timer.expires = jiffies + (HZ/4);
-			init_timer(&hostdata->explore_timer);
-			add_timer(&hostdata->explore_timer);
-		}
-		outw(0x0, host->io_port + PCI_SEMAPHORE);
-	} else {
-		DEBUG_INTR(printk("qlogicfc%d : response queue update\n", hostdata->host_id));
-		DEBUG_INTR(printk("qlogicfc%d : response queue depth %d\n", hostdata->host_id, RES_QUEUE_DEPTH(in_ptr, out_ptr)));
-
-		while (out_ptr != in_ptr) {
-			unsigned le_hand;
-			sts = (struct Status_Entry *) &hostdata->res[out_ptr*QUEUE_ENTRY_LEN];
-			out_ptr = (out_ptr + 1) & RES_QUEUE_LEN;
-                 
-			TRACE("done", out_ptr, Cmnd);
-			DEBUG_INTR(isp2x00_print_status_entry(sts));
-			le_hand = le32_to_cpu(sts->handle);
-			if (sts->hdr.entry_type == ENTRY_STATUS && (Cmnd = hostdata->handle_ptrs[le_hand])) {
-				Cmnd->result = isp2x00_return_status(Cmnd, sts);
-				hostdata->queued--;
-
-				if (Cmnd->use_sg)
-					pci_unmap_sg(hostdata->pci_dev,
-						     (struct scatterlist *)Cmnd->buffer, Cmnd->use_sg,
-						     scsi_to_pci_dma_dir(Cmnd->sc_data_direction));
-				else if (Cmnd->request_bufflen && Cmnd->sc_data_direction != PCI_DMA_NONE)
-					pci_unmap_page(hostdata->pci_dev,
-						       Cmnd->SCp.dma_handle,
-						       Cmnd->request_bufflen,
-						       scsi_to_pci_dma_dir(Cmnd->sc_data_direction));
-
-				/* 
-				 * if any of the following are true we do not
-				 * call scsi_done.  if the status is CS_ABORTED
-				 * we don't have to call done because the upper
-				 * level should already know its aborted.
-				 */
-				if (hostdata->handle_serials[le_hand] != Cmnd->serial_number 
-				    || le16_to_cpu(sts->completion_status) == CS_ABORTED){
-					hostdata->handle_serials[le_hand] = 0;
-					hostdata->handle_ptrs[le_hand] = NULL;
-					outw(out_ptr, host->io_port + MBOX5);
-					continue;
-				}
-				/*
-				 * if we get back an error indicating the port
-				 * is not there or if the link is down and 
-				 * this is a device that used to be there 
-				 * allow the command to timeout.
-				 * the device may well be back in a couple of
-				 * seconds.
-				 */
-				if ((hostdata->adapter_state == AS_LOOP_DOWN || sts->completion_status == cpu_to_le16(CS_PORT_UNAVAILABLE) || sts->completion_status == cpu_to_le16(CS_PORT_LOGGED_OUT) || sts->completion_status == cpu_to_le16(CS_PORT_CONFIG_CHANGED)) && hostdata->port_db[Cmnd->device->id].wwn){
-					outw(out_ptr, host->io_port + MBOX5);
-					continue;
-				}
-			} else {
-				outw(out_ptr, host->io_port + MBOX5);
-				continue;
-			}
-
-			hostdata->handle_ptrs[le_hand] = NULL;
-
-			if (sts->completion_status == cpu_to_le16(CS_RESET_OCCURRED)
-			    || (sts->status_flags & cpu_to_le16(STF_BUS_RESET)))
-				hostdata->send_marker = 1;
-
-			if (le16_to_cpu(sts->scsi_status) & 0x0200)
-				memcpy(Cmnd->sense_buffer, sts->req_sense_data,
-				       sizeof(Cmnd->sense_buffer));
-
-			outw(out_ptr, host->io_port + MBOX5);
-
-			if (Cmnd->scsi_done != NULL) {
-				(*Cmnd->scsi_done) (Cmnd);
-			} else
-				printk("qlogicfc%d : Ouch, scsi done is NULL\n", hostdata->host_id);
-		}
-		hostdata->res_out_ptr = out_ptr;
-	}
-
-
-	out_ptr = inw(host->io_port + MBOX4);
-	in_ptr = hostdata->req_in_ptr;
-
-	num_free = QLOGICFC_REQ_QUEUE_LEN - REQ_QUEUE_DEPTH(in_ptr, out_ptr);
-	num_free = (num_free > 2) ? num_free - 2 : 0;
-       host->can_queue = host->host_busy + num_free;
-	if (host->can_queue > QLOGICFC_REQ_QUEUE_LEN)
-		host->can_queue = QLOGICFC_REQ_QUEUE_LEN;
-	host->sg_tablesize = QLOGICFC_MAX_SG(num_free);
-
-	outw(HCCR_CLEAR_RISC_INTR, host->io_port + HOST_HCCR);
-	LEAVE_INTR("isp2x00_intr_handler");
-}
-
-
-static int isp2x00_return_status(Scsi_Cmnd *Cmnd, struct Status_Entry *sts)
-{
-	int host_status = DID_ERROR;
-#if DEBUG_ISP2x00_INTR
-	static char *reason[] =
-	{
-		"DID_OK",
-		"DID_NO_CONNECT",
-		"DID_BUS_BUSY",
-		"DID_TIME_OUT",
-		"DID_BAD_TARGET",
-		"DID_ABORT",
-		"DID_PARITY",
-		"DID_ERROR",
-		"DID_RESET",
-		"DID_BAD_INTR"
-	};
-#endif				/* DEBUG_ISP2x00_INTR */
-
-	ENTER("isp2x00_return_status");
-
-	DEBUG(printk("qlogicfc : completion status = 0x%04x\n",
-		     le16_to_cpu(sts->completion_status)));
-
-	switch (le16_to_cpu(sts->completion_status)) {
-	case CS_COMPLETE:
-		host_status = DID_OK;
-		break;
-	case CS_DMA_ERROR:
-		host_status = DID_ERROR;
-		break;
-	case CS_RESET_OCCURRED:
-		host_status = DID_RESET;
-		break;
-	case CS_ABORTED:
-		host_status = DID_ABORT;
-		break;
-	case CS_TIMEOUT:
-		host_status = DID_TIME_OUT;
-		break;
-	case CS_DATA_OVERRUN:
-		host_status = DID_ERROR;
-		break;
-	case CS_DATA_UNDERRUN:
-	        if (Cmnd->underflow <= (Cmnd->request_bufflen - le32_to_cpu(sts->residual)))
-		        host_status = DID_OK;
-		else
-		        host_status = DID_ERROR;
-		break;
-	case CS_PORT_UNAVAILABLE:
-	case CS_PORT_LOGGED_OUT:
-	case CS_PORT_CONFIG_CHANGED:
-		host_status = DID_BAD_TARGET;
-		break;
-	case CS_QUEUE_FULL:
-		host_status = DID_ERROR;
-		break;
-	default:
-		printk("qlogicfc : unknown completion status 0x%04x\n",
-		       le16_to_cpu(sts->completion_status));
-		host_status = DID_ERROR;
-		break;
-	}
-
-	DEBUG_INTR(printk("qlogicfc : host status (%s) scsi status %x\n",
-			  reason[host_status], le16_to_cpu(sts->scsi_status)));
-
-	LEAVE("isp2x00_return_status");
-
-	return (le16_to_cpu(sts->scsi_status) & STATUS_MASK) | (host_status << 16);
-}
-
-
-int isp2x00_abort(Scsi_Cmnd * Cmnd)
-{
-	u_short param[8];
-	int i;
-	struct Scsi_Host *host;
-	struct isp2x00_hostdata *hostdata;
-	int return_status = SUCCESS;
-
-	ENTER("isp2x00_abort");
-
-	host = Cmnd->device->host;
-	hostdata = (struct isp2x00_hostdata *) host->hostdata;
-
-	for (i = 0; i < QLOGICFC_REQ_QUEUE_LEN; i++)
-		if (hostdata->handle_ptrs[i] == Cmnd)
-			break;
-
-	if (i == QLOGICFC_REQ_QUEUE_LEN){
-		return SUCCESS;
-	}
-
-	isp2x00_disable_irqs(host);
-
-	param[0] = MBOX_ABORT_IOCB;
-#if ISP2x00_PORTDB
-	param[1] = (((u_short) hostdata->port_db[Cmnd->device->id].loop_id) << 8) | Cmnd->device->lun;
-#else
-	param[1] = (((u_short) Cmnd->target) << 8) | Cmnd->lun;
-#endif
-	param[2] = i & 0xffff;
-	param[3] = i >> 16;
-
-	isp2x00_mbox_command(host, param);
-
-	if (param[0] != MBOX_COMMAND_COMPLETE) {
-		printk("qlogicfc%d : scsi abort failure: %x\n", hostdata->host_id, param[0]);
-		if (param[0] == 0x4005)
-			Cmnd->result = DID_ERROR << 16;
-		if (param[0] == 0x4006)
-			Cmnd->result = DID_BAD_TARGET << 16;
-		return_status = FAILED;
-	}
-
-	if (return_status != SUCCESS){
-		param[0] = MBOX_GET_FIRMWARE_STATE;
-		isp2x00_mbox_command(host, param);
-		printk("qlogicfc%d : abort failed\n", hostdata->host_id);
-		printk("qlogicfc%d : firmware status is %x %x\n", hostdata->host_id, param[0], param[1]);
-	}
-
-	isp2x00_enable_irqs(host);
-
-	LEAVE("isp2x00_abort");
-
-	return return_status;
-}
-
-
-int isp2x00_reset(Scsi_Cmnd * Cmnd, unsigned int reset_flags)
-{
-	u_short param[8];
-	struct Scsi_Host *host;
-	struct isp2x00_hostdata *hostdata;
-	int return_status = SCSI_RESET_SUCCESS;
-
-	ENTER("isp2x00_reset");
-
-	host = Cmnd->device->host;
-	hostdata = (struct isp2x00_hostdata *) host->hostdata;
-	param[0] = MBOX_BUS_RESET;
-	param[1] = 3;
-
-	isp2x00_disable_irqs(host);
-
-	isp2x00_mbox_command(host, param);
-
-	if (param[0] != MBOX_COMMAND_COMPLETE) {
-		printk("qlogicfc%d : scsi bus reset failure: %x\n", hostdata->host_id, param[0]);
-		return_status = SCSI_RESET_ERROR;
-	}
-	isp2x00_enable_irqs(host);
-
-	LEAVE("isp2x00_reset");
-
-	return return_status;;
-}
-
-
-int isp2x00_biosparam(struct scsi_device *sdev, struct block_device *n,
-		sector_t capacity, int ip[])
-{
-	int size = capacity;
-
-	ENTER("isp2x00_biosparam");
-
-	ip[0] = 64;
-	ip[1] = 32;
-	ip[2] = size >> 11;
-	if (ip[2] > 1024) {
-		ip[0] = 255;
-		ip[1] = 63;
-		ip[2] = size / (ip[0] * ip[1]);
-	}
-	LEAVE("isp2x00_biosparam");
-
-	return 0;
-}
-
-static int isp2x00_reset_hardware(struct Scsi_Host *host)
-{
-	u_short param[8];
-	struct isp2x00_hostdata *hostdata;
-	int loop_count;
-	dma_addr_t busaddr;
-
-	ENTER("isp2x00_reset_hardware");
-
-	hostdata = (struct isp2x00_hostdata *) host->hostdata;
-
-	/*
-	 *	This cannot be right - PCI writes are posted
-	 *	(apparently this is hardware design flaw not software ?)
-	 */
-	 
-	outw(0x01, host->io_port + ISP_CTRL_STATUS);
-	udelay(100);
-	outw(HCCR_RESET, host->io_port + HOST_HCCR);
-	udelay(100);
-	outw(HCCR_RELEASE, host->io_port + HOST_HCCR);
-	outw(HCCR_BIOS_DISABLE, host->io_port + HOST_HCCR);
-
-	loop_count = DEFAULT_LOOP_COUNT;
-	while (--loop_count && inw(host->io_port + HOST_HCCR) == RISC_BUSY) {
-		barrier();
-		cpu_relax();
-	}
-	if (!loop_count)
-		printk("qlogicfc%d : reset_hardware loop timeout\n", hostdata->host_id);
-
-
-
-#if DEBUG_ISP2x00
-	printk("qlogicfc%d : mbox 0 0x%04x \n", hostdata->host_id,  inw(host->io_port + MBOX0));
-	printk("qlogicfc%d : mbox 1 0x%04x \n", hostdata->host_id,  inw(host->io_port + MBOX1));
-	printk("qlogicfc%d : mbox 2 0x%04x \n", hostdata->host_id,  inw(host->io_port + MBOX2));
-	printk("qlogicfc%d : mbox 3 0x%04x \n", hostdata->host_id,  inw(host->io_port + MBOX3));
-	printk("qlogicfc%d : mbox 4 0x%04x \n", hostdata->host_id,  inw(host->io_port + MBOX4));
-	printk("qlogicfc%d : mbox 5 0x%04x \n", hostdata->host_id,  inw(host->io_port + MBOX5));
-	printk("qlogicfc%d : mbox 6 0x%04x \n", hostdata->host_id,  inw(host->io_port + MBOX6));
-	printk("qlogicfc%d : mbox 7 0x%04x \n", hostdata->host_id,  inw(host->io_port + MBOX7));
-#endif				/* DEBUG_ISP2x00 */
-
-	DEBUG(printk("qlogicfc%d : verifying checksum\n", hostdata->host_id));
-
-#if defined(CONFIG_SCSI_QLOGIC_FC_FIRMWARE)
-	{
-		int i;
-		unsigned short * risc_code = NULL;
-		unsigned short risc_code_len = 0;
-		if (hostdata->pci_dev->device == PCI_DEVICE_ID_QLOGIC_ISP2100){
-		        risc_code = risc_code2100;
-			risc_code_len = risc_code_length2100;
-		}
-		else if (hostdata->pci_dev->device == PCI_DEVICE_ID_QLOGIC_ISP2200){
-		        risc_code = risc_code2200;
-			risc_code_len = risc_code_length2200;
-		}
-
-		for (i = 0; i < risc_code_len; i++) {
-			param[0] = MBOX_WRITE_RAM_WORD;
-			param[1] = risc_code_addr01 + i;
-			param[2] = risc_code[i];
-
-			isp2x00_mbox_command(host, param);
-
-			if (param[0] != MBOX_COMMAND_COMPLETE) {
-				printk("qlogicfc%d : firmware load failure\n", hostdata->host_id);
-				return 1;
-			}
-		}
-	}
-#endif				/* RELOAD_FIRMWARE */
-
-	param[0] = MBOX_VERIFY_CHECKSUM;
-	param[1] = risc_code_addr01;
-
-	isp2x00_mbox_command(host, param);
-
-	if (param[0] != MBOX_COMMAND_COMPLETE) {
-		printk("qlogicfc%d : ram checksum failure\n", hostdata->host_id);
-		return 1;
-	}
-	DEBUG(printk("qlogicfc%d : executing firmware\n", hostdata->host_id));
-
-	param[0] = MBOX_EXEC_FIRMWARE;
-	param[1] = risc_code_addr01;
-
-	isp2x00_mbox_command(host, param);
-
-	param[0] = MBOX_ABOUT_FIRMWARE;
-
-	isp2x00_mbox_command(host, param);
-
-	if (param[0] != MBOX_COMMAND_COMPLETE) {
-		printk("qlogicfc%d : about firmware failure\n", hostdata->host_id);
-		return 1;
-	}
-	DEBUG(printk("qlogicfc%d : firmware major revision %d\n", hostdata->host_id,  param[1]));
-	DEBUG(printk("qlogicfc%d : firmware minor revision %d\n", hostdata->host_id,  param[2]));
-
-#ifdef USE_NVRAM_DEFAULTS
-
-	if (isp2x00_get_nvram_defaults(host, &hostdata->control_block) != 0) {
-		printk("qlogicfc%d : Could not read from NVRAM\n", hostdata->host_id);
-	}
-#endif
-
-	hostdata->wwn = (u64) (cpu_to_le16(hostdata->control_block.node_name[0])) << 56;
-	hostdata->wwn |= (u64) (cpu_to_le16(hostdata->control_block.node_name[0]) & 0xff00) << 48;
-	hostdata->wwn |= (u64) (cpu_to_le16(hostdata->control_block.node_name[1]) & 0xff00) << 24;
-	hostdata->wwn |= (u64) (cpu_to_le16(hostdata->control_block.node_name[1]) & 0x00ff) << 48;
-	hostdata->wwn |= (u64) (cpu_to_le16(hostdata->control_block.node_name[2]) & 0x00ff) << 24;
-	hostdata->wwn |= (u64) (cpu_to_le16(hostdata->control_block.node_name[2]) & 0xff00) << 8;
-	hostdata->wwn |= (u64) (cpu_to_le16(hostdata->control_block.node_name[3]) & 0x00ff) << 8;
-	hostdata->wwn |= (u64) (cpu_to_le16(hostdata->control_block.node_name[3]) & 0xff00) >> 8;
-
-	/* FIXME: If the DMA transfer goes one way only, this should use
-	 *        PCI_DMA_TODEVICE and below as well.
-	 */
-	busaddr = pci_map_page(hostdata->pci_dev,
-			       virt_to_page(&hostdata->control_block),
-			       offset_in_page(&hostdata->control_block),
-			       sizeof(hostdata->control_block),
-			       PCI_DMA_BIDIRECTIONAL);
-
-	param[0] = MBOX_INIT_FIRMWARE;
-	param[2] = (u_short) (pci64_dma_lo32(busaddr) >> 16);
-	param[3] = (u_short) (pci64_dma_lo32(busaddr) & 0xffff);
-	param[4] = 0;
-	param[5] = 0;
-	param[6] = (u_short) (pci64_dma_hi32(busaddr) >> 16);
-	param[7] = (u_short) (pci64_dma_hi32(busaddr) & 0xffff);
-	isp2x00_mbox_command(host, param);
-	if (param[0] != MBOX_COMMAND_COMPLETE) {
-		printk("qlogicfc%d.c: Ouch 0x%04x\n", hostdata->host_id,  param[0]);
-		pci_unmap_page(hostdata->pci_dev, busaddr,
-			       sizeof(hostdata->control_block),
-			       PCI_DMA_BIDIRECTIONAL);
-		return 1;
-	}
-	param[0] = MBOX_GET_FIRMWARE_STATE;
-	isp2x00_mbox_command(host, param);
-	if (param[0] != MBOX_COMMAND_COMPLETE) {
-		printk("qlogicfc%d.c: 0x%04x\n", hostdata->host_id,  param[0]);
-		pci_unmap_page(hostdata->pci_dev, busaddr,
-			       sizeof(hostdata->control_block),
-			       PCI_DMA_BIDIRECTIONAL);
-		return 1;
-	}
-
-	pci_unmap_page(hostdata->pci_dev, busaddr,
-		       sizeof(hostdata->control_block),
-		       PCI_DMA_BIDIRECTIONAL);
-	LEAVE("isp2x00_reset_hardware");
-
-	return 0;
-}
-
-#ifdef USE_NVRAM_DEFAULTS
-
-static int isp2x00_get_nvram_defaults(struct Scsi_Host *host, struct init_cb *control_block)
-{
-
-	u_short value;
-	if (isp2x00_read_nvram_word(host, 0) != 0x5349)
-		return 1;
-
-	value = isp2x00_read_nvram_word(host, 8);
-	control_block->node_name[0] = cpu_to_le16(isp2x00_read_nvram_word(host, 9));
-	control_block->node_name[1] = cpu_to_le16(isp2x00_read_nvram_word(host, 10));
-	control_block->node_name[2] = cpu_to_le16(isp2x00_read_nvram_word(host, 11));
-	control_block->node_name[3] = cpu_to_le16(isp2x00_read_nvram_word(host, 12));
-	control_block->hard_addr = cpu_to_le16(isp2x00_read_nvram_word(host, 13));
-
-	return 0;
-
-}
-
-#endif
-
-static int isp2x00_init(struct Scsi_Host *sh)
-{
-	u_long io_base;
-	struct isp2x00_hostdata *hostdata;
-	u_char revision;
-	u_int irq;
-	u_short command;
-	struct pci_dev *pdev;
-
-
-	ENTER("isp2x00_init");
-
-	hostdata = (struct isp2x00_hostdata *) sh->hostdata;
-	pdev = hostdata->pci_dev;
-
-	if (pci_read_config_word(pdev, PCI_COMMAND, &command)
-	  || pci_read_config_byte(pdev, PCI_CLASS_REVISION, &revision)) {
-		printk("qlogicfc%d : error reading PCI configuration\n", hostdata->host_id);
-		return 1;
-	}
-	io_base = pci_resource_start(pdev, 0);
-	irq = pdev->irq;
-
-
-	if (pdev->vendor != PCI_VENDOR_ID_QLOGIC) {
-		printk("qlogicfc%d : 0x%04x is not QLogic vendor ID\n", hostdata->host_id, 
-		       pdev->vendor);
-		return 1;
-	}
-	if (pdev->device != PCI_DEVICE_ID_QLOGIC_ISP2100 && pdev->device != PCI_DEVICE_ID_QLOGIC_ISP2200) {
-		printk("qlogicfc%d : 0x%04x does not match ISP2100 or ISP2200 device id\n", hostdata->host_id, 
-		       pdev->device);
-		return 1;
-	}
-	if (!(command & PCI_COMMAND_IO) ||
-	    !(pdev->resource[0].flags & IORESOURCE_IO)) {
-		printk("qlogicfc%d : i/o mapping is disabled\n", hostdata->host_id);
-		return 1;
-	}
-
-	pci_set_master(pdev);
-	if (revision != ISP2100_REV_ID1 && revision != ISP2100_REV_ID3 && revision != ISP2200_REV_ID5)
-		printk("qlogicfc%d : new isp2x00 revision ID (%d)\n", hostdata->host_id,  revision);
-
-
-	hostdata->revision = revision;
-
-	sh->irq = irq;
-	sh->io_port = io_base;
-
-	LEAVE("isp2x00_init");
-
-	return 0;
-}
-
-#if USE_NVRAM_DEFAULTS
-
-#define NVRAM_DELAY() udelay(10)	/* 10 microsecond delay */
-
-
-u_short isp2x00_read_nvram_word(struct Scsi_Host * host, u_short byte)
-{
-	int i;
-	u_short value, output, input;
-
-	outw(0x2, host->io_port + PCI_NVRAM);
-	NVRAM_DELAY();
-	outw(0x3, host->io_port + PCI_NVRAM);
-	NVRAM_DELAY();
-
-	byte &= 0xff;
-	byte |= 0x0600;
-	for (i = 10; i >= 0; i--) {
-		output = ((byte >> i) & 0x1) ? 0x4 : 0x0;
-		outw(output | 0x2, host->io_port + PCI_NVRAM);
-		NVRAM_DELAY();
-		outw(output | 0x3, host->io_port + PCI_NVRAM);
-		NVRAM_DELAY();
-		outw(output | 0x2, host->io_port + PCI_NVRAM);
-		NVRAM_DELAY();
-	}
-
-	for (i = 0xf, value = 0; i >= 0; i--) {
-		value <<= 1;
-		outw(0x3, host->io_port + PCI_NVRAM);
-		NVRAM_DELAY();
-		input = inw(host->io_port + PCI_NVRAM);
-		NVRAM_DELAY();
-		outw(0x2, host->io_port + PCI_NVRAM);
-		NVRAM_DELAY();
-		if (input & 0x8)
-			value |= 1;
-	}
-
-	outw(0x0, host->io_port + PCI_NVRAM);
-	NVRAM_DELAY();
-
-	return value;
-}
-
-
-#endif				/* USE_NVRAM_DEFAULTS */
-
-
-
-/*
- * currently, this is only called during initialization or abort/reset,
- * at which times interrupts are disabled, so polling is OK, I guess...
- */
-static int isp2x00_mbox_command(struct Scsi_Host *host, u_short param[])
-{
-	int loop_count;
-	struct isp2x00_hostdata *hostdata = (struct isp2x00_hostdata *) host->hostdata;
-
-	if (mbox_param[param[0]] == 0 || hostdata->adapter_state == AS_FIRMWARE_DEAD)
-		return 1;
-
-	loop_count = DEFAULT_LOOP_COUNT;
-	while (--loop_count && inw(host->io_port + HOST_HCCR) & 0x0080) {
-		barrier();
-		cpu_relax();
-	}
-	if (!loop_count) {
-		printk("qlogicfc%d : mbox_command loop timeout #1\n", hostdata->host_id);
-		param[0] = 0x4006;
-		hostdata->adapter_state = AS_FIRMWARE_DEAD;
-		return 1;
-	}
-	hostdata->mbox_done = 0;
-
-	if (mbox_param[param[0]] == 0)
-		printk("qlogicfc%d : invalid mbox command\n", hostdata->host_id);
-
-	if (mbox_param[param[0]] & 0x80)
-		outw(param[7], host->io_port + MBOX7);
-	if (mbox_param[param[0]] & 0x40)
-		outw(param[6], host->io_port + MBOX6);
-	if (mbox_param[param[0]] & 0x20)
-		outw(param[5], host->io_port + MBOX5);
-	if (mbox_param[param[0]] & 0x10)
-		outw(param[4], host->io_port + MBOX4);
-	if (mbox_param[param[0]] & 0x08)
-		outw(param[3], host->io_port + MBOX3);
-	if (mbox_param[param[0]] & 0x04)
-		outw(param[2], host->io_port + MBOX2);
-	if (mbox_param[param[0]] & 0x02)
-		outw(param[1], host->io_port + MBOX1);
-	if (mbox_param[param[0]] & 0x01)
-		outw(param[0], host->io_port + MBOX0);
-
-
-	outw(HCCR_SET_HOST_INTR, host->io_port + HOST_HCCR);
-
-	while (1) {
-		loop_count = DEFAULT_LOOP_COUNT;
-		while (--loop_count && !(inw(host->io_port + PCI_INTER_STS) & 0x08)) { 
-			barrier();
-			cpu_relax();
-		}
-
-		if (!loop_count) {
-			hostdata->adapter_state = AS_FIRMWARE_DEAD;
-			printk("qlogicfc%d : mbox_command loop timeout #2\n", hostdata->host_id);
-			break;
-		}
-		isp2x00_intr_handler(host->irq, host, NULL);
-
-		if (hostdata->mbox_done == 1)
-			break;
-
-	}
-
-	loop_count = DEFAULT_LOOP_COUNT;
-	while (--loop_count && inw(host->io_port + MBOX0) == 0x04) {
-		barrier();
-		cpu_relax();
-	}
-	if (!loop_count)
-		printk("qlogicfc%d : mbox_command loop timeout #3\n", hostdata->host_id);
-
-	param[7] = inw(host->io_port + MBOX7);
-	param[6] = inw(host->io_port + MBOX6);
-	param[5] = inw(host->io_port + MBOX5);
-	param[4] = inw(host->io_port + MBOX4);
-	param[3] = inw(host->io_port + MBOX3);
-	param[2] = inw(host->io_port + MBOX2);
-	param[1] = inw(host->io_port + MBOX1);
-	param[0] = inw(host->io_port + MBOX0);
-
-
-	outw(0x0, host->io_port + PCI_SEMAPHORE);
-
-	if (inw(host->io_port + HOST_HCCR) & 0x0080) {
-		hostdata->adapter_state = AS_FIRMWARE_DEAD;
-		printk("qlogicfc%d : mbox op is still pending\n", hostdata->host_id);
-	}
-	return 0;
-}
-
-#if DEBUG_ISP2x00_INTR
-
-void isp2x00_print_status_entry(struct Status_Entry *status)
-{
-	printk("qlogicfc : entry count = 0x%02x, type = 0x%02x, flags = 0x%02x\n", 
-	status->hdr.entry_cnt, status->hdr.entry_type, status->hdr.flags);
-	printk("qlogicfc : scsi status = 0x%04x, completion status = 0x%04x\n",
-	       le16_to_cpu(status->scsi_status), le16_to_cpu(status->completion_status));
-	printk("qlogicfc : state flags = 0x%04x, status flags = 0x%04x\n", 
-	       le16_to_cpu(status->state_flags), le16_to_cpu(status->status_flags));
-	printk("qlogicfc : response info length = 0x%04x, request sense length = 0x%04x\n",
-	       le16_to_cpu(status->res_info_len), le16_to_cpu(status->req_sense_len));
-	printk("qlogicfc : residual transfer length = 0x%08x, response = 0x%02x\n", le32_to_cpu(status->residual), status->res_info[3]);
-
-}
-
-#endif                         /* DEBUG_ISP2x00_INTR */
-
-
-#if DEBUG_ISP2x00
-
-void isp2x00_print_scsi_cmd(Scsi_Cmnd * cmd)
-{
-	int i;
-
-	printk("qlogicfc : target = 0x%02x, lun = 0x%02x, cmd_len = 0x%02x\n", 
-	       cmd->target, cmd->lun, cmd->cmd_len);
-	printk("qlogicfc : command = ");
-	for (i = 0; i < cmd->cmd_len; i++)
-		printk("0x%02x ", cmd->cmnd[i]);
-	printk("\n");
-}
-
-#endif				/* DEBUG_ISP2x00 */
-
-MODULE_LICENSE("GPL");
-
-static Scsi_Host_Template driver_template = {
-        .detect                 = isp2x00_detect,
-        .release                = isp2x00_release,
-        .info                   = isp2x00_info,
-        .queuecommand           = isp2x00_queuecommand,
-        .eh_abort_handler       = isp2x00_abort,
-        .bios_param             = isp2x00_biosparam,
-        .can_queue              = QLOGICFC_REQ_QUEUE_LEN,
-        .this_id                = -1,
-        .sg_tablesize           = QLOGICFC_MAX_SG(QLOGICFC_REQ_QUEUE_LEN),
-	.cmd_per_lun		= QLOGICFC_CMD_PER_LUN,
-        .use_clustering         = ENABLE_CLUSTERING,
-};
-#include "scsi_module.c"
--- diff/drivers/scsi/qlogicfc.h	2003-09-17 12:28:10.000000000 +0100
+++ source/drivers/scsi/qlogicfc.h	1970-01-01 01:00:00.000000000 +0100
@@ -1,80 +0,0 @@
-/*
- * QLogic ISP2x00 SCSI-FCP
- * 
- * Written by Erik H. Moe, ehm@cris.com
- * Copyright 1995, Erik H. Moe
- *
- * 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.
- */
-
-/* Renamed and updated to 1.3.x by Michael Griffith <grif@cs.ucr.edu> */
-
-/* This is a version of the isp1020 driver which was modified by
- * Chris Loveland <cwl@iol.unh.edu> to support the isp2x00
- */
-
-
-/*
- * $Date: 1995/09/22 02:32:56 $
- * $Revision: 0.5 $
- *
- * $Log: isp1020.h,v $
- * Revision 0.5  1995/09/22  02:32:56  root
- * do auto request sense
- *
- * Revision 0.4  1995/08/07  04:48:28  root
- * supply firmware with driver.
- * numerous bug fixes/general cleanup of code.
- *
- * Revision 0.3  1995/07/16  16:17:16  root
- * added reset/abort code.
- *
- * Revision 0.2  1995/06/29  03:19:43  root
- * fixed biosparam.
- * added queue protocol.
- *
- * Revision 0.1  1995/06/25  01:56:13  root
- * Initial release.
- *
- */
-
-#ifndef _QLOGICFC_H
-#define _QLOGICFC_H
-
-/*
- * With the qlogic interface, every queue slot can hold a SCSI
- * command with up to 2 scatter/gather entries.  If we need more
- * than 2 entries, continuation entries can be used that hold
- * another 5 entries each.  Unlike for other drivers, this means
- * that the maximum number of scatter/gather entries we can
- * support at any given time is a function of the number of queue
- * slots available.  That is, host->can_queue and host->sg_tablesize
- * are dynamic and _not_ independent.  This all works fine because
- * requests are queued serially and the scatter/gather limit is
- * determined for each queue request anew.
- */
-
-#define DATASEGS_PER_COMMAND 2
-#define DATASEGS_PER_CONT 5
-
-#define QLOGICFC_REQ_QUEUE_LEN 255     /* must be power of two - 1 */
-#define QLOGICFC_MAX_SG(ql)	(DATASEGS_PER_COMMAND + (((ql) > 0) ? DATASEGS_PER_CONT*((ql) - 1) : 0))
-#define QLOGICFC_CMD_PER_LUN    8
-
-int isp2x00_detect(Scsi_Host_Template *);
-int isp2x00_release(struct Scsi_Host *);
-const char * isp2x00_info(struct Scsi_Host *);
-int isp2x00_queuecommand(Scsi_Cmnd *, void (* done)(Scsi_Cmnd *));
-int isp2x00_abort(Scsi_Cmnd *);
-int isp2x00_reset(Scsi_Cmnd *, unsigned int);
-int isp2x00_biosparam(struct scsi_device *, struct block_device *,
-		sector_t, int[]);
-#endif /* _QLOGICFC_H */
--- diff/drivers/scsi/qlogicfc_asm.c	2002-10-16 04:27:13.000000000 +0100
+++ source/drivers/scsi/qlogicfc_asm.c	1970-01-01 01:00:00.000000000 +0100
@@ -1,9751 +0,0 @@
-/************************************************************************
- *									*
- * 	 --- ISP2100 Fabric Initiator/Target Firmware ---               *
- *                   with expanded LUN addressing                       *
- *                   and FcTape (FCP-2) support                         *
- *									*
- *									*
- ************************************************************************
-  Copyright (C) 2000 and 2001 Qlogic Corporation 
-  (www.qlogic.com)
-
-  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.16 (10:36 Nov 02, 2000)
- */
-
-unsigned short risc_code_addr01 = 0x1000 ;
-
-unsigned short risc_code_length2100 = 0x9260;
-unsigned short risc_code2100[] = {
-	0x0078, 0x102d, 0x0000, 0x9260, 0x0000, 0x0001, 0x0013, 0x0010,
-	0x0017, 0x2043, 0x4f50, 0x5952, 0x4947, 0x4854, 0x2031, 0x3939,
-	0x3920, 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, 0xaa00, 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,
-	0xa260, 0x2009, 0x0000, 0x20a9, 0x07a0, 0x41a4, 0x3400, 0x20c9,
-	0xa7ff, 0x2059, 0x0000, 0x2b78, 0x7823, 0x0004, 0x2089, 0x255d,
-	0x2051, 0xa300, 0x2a70, 0x775e, 0xa786, 0x8fff, 0x0040, 0x1092,
-	0x705b, 0xca00, 0x7057, 0xc9f1, 0x7063, 0x0200, 0x7067, 0x0200,
-	0x0078, 0x109a, 0x7057, 0xba01, 0x7063, 0x0100, 0x7067, 0x0100,
-	0x705b, 0xba00, 0x1078, 0x12df, 0x1078, 0x13c0, 0x1078, 0x1569,
-	0x1078, 0x1ca4, 0x1078, 0x4229, 0x1078, 0x74cf, 0x1078, 0x134b,
-	0x1078, 0x2a3f, 0x1078, 0x4da2, 0x1078, 0x48b2, 0x1078, 0x57df,
-	0x1078, 0x21f7, 0x1078, 0x5abf, 0x1078, 0x5369, 0x1078, 0x210d,
-	0x1078, 0x21d4, 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, 0x35bc, 0x1078, 0x2a67,
-	0x1078, 0x4df2, 0x1078, 0x4a75, 0x2009, 0x0100, 0x2104, 0xa082,
-	0x0002, 0x0048, 0x10f3, 0x1078, 0x57fb, 0x0078, 0x10d6, 0x1079,
-	0x10f7, 0x0078, 0x10dc, 0x1078, 0x6fa9, 0x0078, 0x10eb, 0x1101,
-	0x1102, 0x11be, 0x10ff, 0x1246, 0x12dc, 0x12dd, 0x12de, 0x1078,
-	0x1328, 0x007c, 0x127e, 0x0f7e, 0x2091, 0x8000, 0x7000, 0xa086,
-	0x0001, 0x00c0, 0x1198, 0x1078, 0x3a43, 0x2079, 0x0100, 0x7844,
-	0xa005, 0x00c0, 0x1198, 0x2011, 0x4129, 0x1078, 0x58d4, 0x1078,
-	0x1ab1, 0x780f, 0x00ff, 0x7840, 0xa084, 0xfffb, 0x7842, 0x2011,
-	0x8010, 0x73c0, 0x1078, 0x3579, 0x2001, 0xffff, 0x1078, 0x5975,
-	0x7238, 0xc284, 0x723a, 0x2001, 0xa30c, 0x2014, 0xc2ac, 0x2202,
-	0x1078, 0x6db5, 0x2011, 0x0004, 0x1078, 0x8a59, 0x1078, 0x47ce,
-	0x1078, 0x4211, 0x0040, 0x1144, 0x7083, 0x0001, 0x70bb, 0x0000,
-	0x1078, 0x3bf5, 0x0078, 0x1198, 0x1078, 0x4897, 0x0040, 0x114d,
-	0x7a0c, 0xc2b4, 0x7a0e, 0x0078, 0x1159, 0x1078, 0x8ddf, 0x70c8,
-	0xd09c, 0x00c0, 0x1159, 0x7094, 0xa005, 0x0040, 0x1159, 0x1078,
-	0x41f5, 0x70d3, 0x0000, 0x70cf, 0x0000, 0x72c8, 0x2079, 0xa351,
-	0x7804, 0xd0ac, 0x0040, 0x1165, 0xc295, 0x72ca, 0xa296, 0x0004,
-	0x0040, 0x1186, 0x2011, 0x0001, 0x1078, 0x8a59, 0x708f, 0x0000,
-	0x7093, 0xffff, 0x7003, 0x0002, 0x0f7f, 0x1078, 0x260d, 0x2011,
-	0x0005, 0x1078, 0x6ef2, 0x1078, 0x6109, 0x0c7e, 0x2061, 0x0100,
-	0x60e3, 0x0008, 0x0c7f, 0x127f, 0x0078, 0x119a, 0x708f, 0x0000,
-	0x7093, 0xffff, 0x7003, 0x0002, 0x2011, 0x0005, 0x1078, 0x6ef2,
-	0x1078, 0x6109, 0x0c7e, 0x2061, 0x0100, 0x60e3, 0x0008, 0x0c7f,
-	0x0f7f, 0x127f, 0x007c, 0x0c7e, 0x20a9, 0x0082, 0x2009, 0x007e,
-	0x017e, 0x027e, 0x037e, 0x2110, 0x027e, 0x2019, 0x0029, 0x1078,
-	0x71e0, 0x027f, 0x1078, 0xa190, 0x037f, 0x027f, 0x017f, 0x1078,
-	0x2921, 0x8108, 0x00f0, 0x11a0, 0x0c7f, 0x706b, 0x0000, 0x706c,
-	0xa084, 0x00ff, 0x706e, 0x7097, 0x0000, 0x007c, 0x127e, 0x2091,
-	0x8000, 0x7000, 0xa086, 0x0002, 0x00c0, 0x1244, 0x7090, 0xa086,
-	0xffff, 0x0040, 0x11d1, 0x1078, 0x260d, 0x1078, 0x6109, 0x0078,
-	0x1244, 0x70c8, 0xd09c, 0x0040, 0x11fd, 0xd084, 0x0040, 0x11fd,
-	0x0f7e, 0x2079, 0x0100, 0x790c, 0xc1b5, 0x790e, 0x0f7f, 0xd08c,
-	0x0040, 0x11fd, 0x70cc, 0xa086, 0xffff, 0x0040, 0x11f9, 0x1078,
-	0x278a, 0x1078, 0x6109, 0x70c8, 0xd094, 0x00c0, 0x1244, 0x2011,
-	0x0001, 0x2019, 0x0000, 0x1078, 0x27c2, 0x1078, 0x6109, 0x0078,
-	0x1244, 0x70d0, 0xa005, 0x00c0, 0x1244, 0x708c, 0xa005, 0x00c0,
-	0x1244, 0x1078, 0x4897, 0x00c0, 0x1244, 0x2001, 0xa352, 0x2004,
-	0xd0ac, 0x0040, 0x1227, 0x157e, 0x0c7e, 0x20a9, 0x007f, 0x2009,
-	0x0000, 0x017e, 0x1078, 0x4501, 0x00c0, 0x121a, 0x6000, 0xd0ec,
-	0x00c0, 0x1222, 0x017f, 0x8108, 0x00f0, 0x1211, 0x0c7f, 0x157f,
-	0x0078, 0x1227, 0x017f, 0x0c7f, 0x157f, 0x0078, 0x1244, 0x7003,
-	0x0003, 0x7093, 0xffff, 0x2001, 0x0000, 0x1078, 0x2480, 0x1078,
-	0x35f7, 0x2001, 0xa5ac, 0x2004, 0xa086, 0x0005, 0x00c0, 0x123c,
-	0x2011, 0x0000, 0x1078, 0x6ef2, 0x2011, 0x0000, 0x1078, 0x6efc,
-	0x1078, 0x6109, 0x1078, 0x61d3, 0x127f, 0x007c, 0x017e, 0x0f7e,
-	0x127e, 0x2091, 0x8000, 0x2079, 0x0100, 0x2009, 0x00f7, 0x1078,
-	0x41de, 0x7940, 0xa18c, 0x0010, 0x7942, 0x7924, 0xd1b4, 0x0040,
-	0x125b, 0x7827, 0x0040, 0xd19c, 0x0040, 0x1260, 0x7827, 0x0008,
-	0x007e, 0x037e, 0x157e, 0xa006, 0x1078, 0x5975, 0x7900, 0xa18a,
-	0x0003, 0x0050, 0x1289, 0x7954, 0xd1ac, 0x00c0, 0x1289, 0x2009,
-	0x00f8, 0x1078, 0x41de, 0x7843, 0x0090, 0x7843, 0x0010, 0x20a9,
-	0x09c4, 0x7820, 0xd09c, 0x00c0, 0x1281, 0x7824, 0xd0ac, 0x00c0,
-	0x12ca, 0x00f0, 0x1279, 0x2001, 0x0001, 0x1078, 0x2480, 0x0078,
-	0x12d5, 0x7853, 0x0000, 0x782f, 0x0020, 0x20a9, 0x0050, 0x00e0,
-	0x128f, 0x2091, 0x6000, 0x00f0, 0x128f, 0x7853, 0x0400, 0x782f,
-	0x0000, 0x2009, 0x00f8, 0x1078, 0x41de, 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,
-	0xa331, 0x2104, 0x8000, 0x200a, 0xa084, 0xfff0, 0x0040, 0x12c4,
-	0x200b, 0x0000, 0x1078, 0x251e, 0x2001, 0x0001, 0x1078, 0x2480,
-	0x0078, 0x12d3, 0x2001, 0xa331, 0x2003, 0x0000, 0x7828, 0xc09d,
-	0x782a, 0x7827, 0x0048, 0x7853, 0x0400, 0x157f, 0x037f, 0x007f,
-	0x127f, 0x0f7f, 0x017f, 0x007c, 0x007c, 0x007c, 0x007c, 0x2a70,
-	0x2009, 0x0100, 0x2104, 0xa082, 0x0002, 0x0048, 0x12eb, 0x704f,
-	0xffff, 0x0078, 0x12ed, 0x704f, 0x0000, 0x7053, 0xffff, 0x706b,
-	0x0000, 0x706f, 0x0000, 0x1078, 0x8ddf, 0x2061, 0xa58c, 0x6003,
-	0x0909, 0x6007, 0x0000, 0x600b, 0x8800, 0x600f, 0x0200, 0x6013,
-	0x00ff, 0x6017, 0x0003, 0x601b, 0x0000, 0x601f, 0x07d0, 0x2061,
-	0xa594, 0x6003, 0x8000, 0x6007, 0x0000, 0x600b, 0x0000, 0x600f,
-	0x0200, 0x6013, 0x00ff, 0x6017, 0x0000, 0x601b, 0x0001, 0x601f,
-	0x0000, 0x2061, 0xa5a3, 0x6003, 0x514c, 0x6007, 0x4f47, 0x600b,
-	0x4943, 0x600f, 0x2020, 0x2001, 0xa325, 0x2003, 0x0000, 0x007c,
-	0x2091, 0x8000, 0x0068, 0x132a, 0x007e, 0x017e, 0x2079, 0x0000,
-	0x7818, 0xd084, 0x00c0, 0x1330, 0x017f, 0x792e, 0x007f, 0x782a,
-	0x007f, 0x7826, 0x3900, 0x783a, 0x7823, 0x8002, 0x781b, 0x0001,
-	0x2091, 0x5000, 0x2091, 0x4080, 0x2079, 0xa300, 0x7803, 0x0005,
-	0x0078, 0x1348, 0x007c, 0x2071, 0xa300, 0x7158, 0x712e, 0x2021,
-	0x0001, 0xa190, 0x002d, 0xa298, 0x002d, 0x0048, 0x1361, 0x705c,
-	0xa302, 0x00c8, 0x1361, 0x220a, 0x2208, 0x2310, 0x8420, 0x0078,
-	0x1353, 0x200b, 0x0000, 0x74a6, 0x74aa, 0x007c, 0x0e7e, 0x127e,
-	0x2091, 0x8000, 0x2071, 0xa300, 0x70a8, 0xa0ea, 0x0010, 0x00c8,
-	0x1374, 0xa06e, 0x0078, 0x137e, 0x8001, 0x70aa, 0x702c, 0x2068,
-	0x2d04, 0x702e, 0x206b, 0x0000, 0x6807, 0x0000, 0x127f, 0x0e7f,
-	0x007c, 0x0e7e, 0x2071, 0xa300, 0x127e, 0x2091, 0x8000, 0x70a8,
-	0x8001, 0x00c8, 0x138e, 0xa06e, 0x0078, 0x1397, 0x70aa, 0x702c,
-	0x2068, 0x2d04, 0x702e, 0x206b, 0x0000, 0x6807, 0x0000, 0x127f,
-	0x0e7f, 0x007c, 0x0e7e, 0x127e, 0x2091, 0x8000, 0x2071, 0xa300,
-	0x702c, 0x206a, 0x2d00, 0x702e, 0x70a8, 0x8000, 0x70aa, 0x127f,
-	0x0e7f, 0x007c, 0x8dff, 0x0040, 0x13b6, 0x6804, 0x6807, 0x0000,
-	0x007e, 0x1078, 0x139a, 0x0d7f, 0x0078, 0x13aa, 0x007c, 0x0e7e,
-	0x2071, 0xa300, 0x70a8, 0xa08a, 0x0010, 0xa00d, 0x0e7f, 0x007c,
-	0x0e7e, 0x2071, 0xa5d0, 0x7007, 0x0000, 0x701b, 0x0000, 0x701f,
-	0x0000, 0x2071, 0x0000, 0x7010, 0xa085, 0x8004, 0x7012, 0x0e7f,
-	0x007c, 0x0e7e, 0x2270, 0x700b, 0x0000, 0x2071, 0xa5d0, 0x7018,
-	0xa088, 0xa5d9, 0x220a, 0x8000, 0xa084, 0x0007, 0x701a, 0x7004,
-	0xa005, 0x00c0, 0x13e9, 0x0f7e, 0x2079, 0x0010, 0x1078, 0x13fa,
-	0x0f7f, 0x0e7f, 0x007c, 0x0e7e, 0x2071, 0xa5d0, 0x7004, 0xa005,
-	0x00c0, 0x13f8, 0x0f7e, 0x2079, 0x0010, 0x1078, 0x13fa, 0x0f7f,
-	0x0e7f, 0x007c, 0x7000, 0x0079, 0x13fd, 0x1401, 0x146b, 0x1488,
-	0x1488, 0x7018, 0x711c, 0xa106, 0x00c0, 0x1409, 0x7007, 0x0000,
-	0x007c, 0x0d7e, 0xa180, 0xa5d9, 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, 0x142b, 0x7007, 0x0001,
-	0x1078, 0x1430, 0x007c, 0x7007, 0x0002, 0x1078, 0x1446, 0x007c,
-	0x017e, 0x027e, 0x710c, 0x2011, 0x0040, 0xa182, 0x0040, 0x00c8,
-	0x143b, 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, 0x145a,
-	0x2110, 0xa006, 0x700e, 0x22a8, 0x53a6, 0x8203, 0x7822, 0x7803,
-	0x0020, 0x3300, 0x7016, 0x7803, 0x0001, 0x157f, 0x147f, 0x137f,
-	0x027f, 0x017f, 0x007c, 0x137e, 0x147e, 0x157e, 0x2099, 0xa3f9,
-	0x20a1, 0x0018, 0x20a9, 0x0008, 0x53a3, 0x7803, 0x0020, 0x127e,
-	0x2091, 0x8000, 0x7803, 0x0041, 0x7007, 0x0003, 0x7000, 0xc084,
-	0x7002, 0x700b, 0xa3f4, 0x127f, 0x157f, 0x147f, 0x137f, 0x007c,
-	0x137e, 0x147e, 0x157e, 0x2001, 0xa428, 0x209c, 0x20a1, 0x0014,
-	0x7803, 0x0026, 0x2001, 0xa429, 0x20ac, 0x53a6, 0x2099, 0xa42a,
-	0x20a1, 0x0018, 0x20a9, 0x0008, 0x53a3, 0x7803, 0x0020, 0x127e,
-	0x2091, 0x8000, 0x7803, 0x0001, 0x7007, 0x0004, 0x7000, 0xc08c,
-	0x7002, 0x700b, 0xa425, 0x127f, 0x157f, 0x147f, 0x137f, 0x007c,
-	0x017e, 0x0e7e, 0x2071, 0xa5d0, 0x0f7e, 0x2079, 0x0010, 0x7904,
-	0x7803, 0x0002, 0xd1fc, 0x0040, 0x14c2, 0xa18c, 0x0700, 0x7004,
-	0x1079, 0x14c6, 0x0f7f, 0x0e7f, 0x017f, 0x007c, 0x13fa, 0x14ce,
-	0x14fb, 0x1523, 0x1556, 0x14cc, 0x0078, 0x14cc, 0xa18c, 0x0700,
-	0x00c0, 0x14f4, 0x137e, 0x147e, 0x157e, 0x7014, 0x20a0, 0x2099,
-	0x0014, 0x7803, 0x0040, 0x7010, 0x20a8, 0x53a5, 0x3400, 0x7016,
-	0x157f, 0x147f, 0x137f, 0x700c, 0xa005, 0x0040, 0x1510, 0x1078,
-	0x1430, 0x007c, 0x7008, 0xa080, 0x0002, 0x2003, 0x0100, 0x7007,
-	0x0000, 0x1078, 0x13fa, 0x007c, 0x7008, 0xa080, 0x0002, 0x2003,
-	0x0200, 0x0078, 0x14ef, 0xa18c, 0x0700, 0x00c0, 0x1506, 0x700c,
-	0xa005, 0x0040, 0x1510, 0x1078, 0x1446, 0x007c, 0x7008, 0xa080,
-	0x0002, 0x2003, 0x0200, 0x7007, 0x0000, 0x1078, 0x13fa, 0x007c,
-	0x0d7e, 0x7008, 0x2068, 0x7830, 0x6826, 0x7834, 0x682a, 0x7838,
-	0x682e, 0x783c, 0x6832, 0x680b, 0x0100, 0x0d7f, 0x7007, 0x0000,
-	0x1078, 0x13fa, 0x007c, 0xa18c, 0x0700, 0x00c0, 0x1550, 0x137e,
-	0x147e, 0x157e, 0x2001, 0xa3f7, 0x2004, 0xa080, 0x000d, 0x20a0,
-	0x2099, 0x0014, 0x7803, 0x0040, 0x20a9, 0x0020, 0x53a5, 0x2001,
-	0xa3f9, 0x2004, 0xd0bc, 0x0040, 0x1546, 0x2001, 0xa402, 0x2004,
-	0xa080, 0x000d, 0x20a0, 0x20a9, 0x0020, 0x53a5, 0x157f, 0x147f,
-	0x137f, 0x7007, 0x0000, 0x1078, 0x4e9b, 0x1078, 0x13fa, 0x007c,
-	0x2011, 0x8003, 0x1078, 0x3579, 0x0078, 0x1554, 0xa18c, 0x0700,
-	0x00c0, 0x1563, 0x2001, 0xa427, 0x2003, 0x0100, 0x7007, 0x0000,
-	0x1078, 0x13fa, 0x007c, 0x2011, 0x8004, 0x1078, 0x3579, 0x0078,
-	0x1567, 0x127e, 0x2091, 0x2100, 0x2079, 0x0030, 0x2071, 0xa5e1,
-	0x7803, 0x0004, 0x7003, 0x0000, 0x700f, 0xa5e7, 0x7013, 0xa5e7,
-	0x780f, 0x0076, 0x7803, 0x0004, 0x127f, 0x007c, 0x6934, 0xa184,
-	0x0007, 0x0079, 0x1583, 0x158b, 0x15d1, 0x158b, 0x158b, 0x158b,
-	0x15b6, 0x159a, 0x158f, 0xa085, 0x0001, 0x0078, 0x15eb, 0x684c,
-	0xd0bc, 0x0040, 0x158b, 0x6860, 0x682e, 0x685c, 0x682a, 0x6858,
-	0x0078, 0x15d9, 0xa18c, 0x00ff, 0xa186, 0x001e, 0x00c0, 0x158b,
-	0x684c, 0xd0bc, 0x0040, 0x158b, 0x6860, 0x682e, 0x685c, 0x682a,
-	0x6804, 0x681a, 0xa080, 0x000d, 0x2004, 0xa084, 0x000f, 0xa080,
-	0x2015, 0x2004, 0x6832, 0x6858, 0x0078, 0x15e1, 0xa18c, 0x00ff,
-	0xa186, 0x0015, 0x00c0, 0x158b, 0x684c, 0xd0ac, 0x0040, 0x158b,
-	0x6804, 0x681a, 0xa080, 0x000d, 0x2004, 0xa084, 0x000f, 0xa080,
-	0x2015, 0x2004, 0x6832, 0xa006, 0x682e, 0x682a, 0x6858, 0x0078,
-	0x15e1, 0x684c, 0xd0ac, 0x0040, 0x158b, 0xa006, 0x682e, 0x682a,
-	0x6858, 0xa18c, 0x000f, 0xa188, 0x2015, 0x210c, 0x6932, 0x2d08,
-	0x691a, 0x6826, 0x684c, 0xc0dd, 0x684e, 0xa006, 0x680a, 0x697c,
-	0x6912, 0x6980, 0x6916, 0x007c, 0x20e1, 0x0007, 0x20e1, 0x2000,
-	0x2001, 0x020a, 0x2004, 0x82ff, 0x0040, 0x160e, 0xa280, 0x0004,
-	0x0d7e, 0x206c, 0x684c, 0xd0dc, 0x00c0, 0x160a, 0x1078, 0x157e,
-	0x0040, 0x160a, 0x0d7f, 0xa280, 0x0000, 0x2003, 0x0002, 0xa016,
-	0x0078, 0x160e, 0x6808, 0x8000, 0x680a, 0x0d7f, 0x127e, 0x047e,
-	0x037e, 0x027e, 0x2091, 0x2100, 0x027f, 0x037f, 0x047f, 0x7000,
-	0xa005, 0x00c0, 0x1622, 0x7206, 0x2001, 0x1643, 0x007e, 0x2260,
-	0x0078, 0x17be, 0x710c, 0x220a, 0x8108, 0x230a, 0x8108, 0x240a,
-	0x8108, 0xa182, 0xa602, 0x0048, 0x162f, 0x2009, 0xa5e7, 0x710e,
-	0x7010, 0xa102, 0xa082, 0x0009, 0x0040, 0x163a, 0xa080, 0x001b,
-	0x00c0, 0x163d, 0x2009, 0x0138, 0x200a, 0x7000, 0xa005, 0x00c0,
-	0x1643, 0x1078, 0x179f, 0x127f, 0x007c, 0x127e, 0x027e, 0x037e,
-	0x0c7e, 0x007e, 0x2091, 0x2100, 0x007f, 0x047f, 0x037f, 0x027f,
-	0x0d7e, 0x0c7e, 0x2460, 0x6110, 0x2168, 0x6a62, 0x6b5e, 0xa005,
-	0x0040, 0x16cf, 0x6808, 0xa005, 0x0040, 0x173c, 0x7000, 0xa005,
-	0x00c0, 0x1664, 0x0078, 0x16c4, 0x700c, 0x7110, 0xa106, 0x00c0,
-	0x1745, 0x7004, 0xa406, 0x00c0, 0x16c4, 0x2001, 0x0005, 0x2004,
-	0xd08c, 0x0040, 0x1681, 0x047e, 0x1078, 0x18e2, 0x047f, 0x2460,
-	0x6010, 0xa080, 0x0002, 0x2004, 0xa005, 0x0040, 0x173c, 0x0078,
-	0x165e, 0x2001, 0x0207, 0x2004, 0xd09c, 0x00c0, 0x166d, 0x7804,
-	0xa084, 0x6000, 0x0040, 0x1692, 0xa086, 0x6000, 0x0040, 0x1692,
-	0x0078, 0x166d, 0x7100, 0xa186, 0x0002, 0x00c0, 0x16b2, 0x0e7e,
-	0x2b68, 0x6818, 0x2060, 0x1078, 0x1fea, 0x2804, 0xac70, 0x6034,
-	0xd09c, 0x00c0, 0x16a7, 0x7108, 0x720c, 0x0078, 0x16a9, 0x7110,
-	0x7214, 0x6810, 0xa100, 0x6812, 0x6814, 0xa201, 0x6816, 0x0e7f,
-	0x0078, 0x16b6, 0xa186, 0x0001, 0x00c0, 0x16be, 0x7820, 0x6910,
-	0xa100, 0x6812, 0x7824, 0x6914, 0xa101, 0x6816, 0x7803, 0x0004,
-	0x7003, 0x0000, 0x7004, 0x2060, 0x6100, 0xa18e, 0x0004, 0x00c0,
-	0x1745, 0x2009, 0x0048, 0x1078, 0x756c, 0x0078, 0x1745, 0x6808,
-	0xa005, 0x0040, 0x173c, 0x7000, 0xa005, 0x00c0, 0x16d9, 0x0078,
-	0x173c, 0x700c, 0x7110, 0xa106, 0x00c0, 0x16e2, 0x7004, 0xa406,
-	0x00c0, 0x173c, 0x2001, 0x0005, 0x2004, 0xd08c, 0x0040, 0x16f6,
-	0x047e, 0x1078, 0x18e2, 0x047f, 0x2460, 0x6010, 0xa080, 0x0002,
-	0x2004, 0xa005, 0x0040, 0x173c, 0x0078, 0x16d3, 0x2001, 0x0207,
-	0x2004, 0xd09c, 0x00c0, 0x16e2, 0x2001, 0x0005, 0x2004, 0xd08c,
-	0x00c0, 0x16e8, 0x7804, 0xa084, 0x6000, 0x0040, 0x170d, 0xa086,
-	0x6000, 0x0040, 0x170d, 0x0078, 0x16e2, 0x7007, 0x0000, 0xa016,
-	0x2218, 0x7000, 0xa08e, 0x0001, 0x0040, 0x172e, 0xa08e, 0x0002,
-	0x00c0, 0x173c, 0x0c7e, 0x0e7e, 0x6818, 0x2060, 0x1078, 0x1fea,
-	0x2804, 0xac70, 0x6034, 0xd09c, 0x00c0, 0x172a, 0x7308, 0x720c,
-	0x0078, 0x172c, 0x7310, 0x7214, 0x0e7f, 0x0c7f, 0x7820, 0xa318,
-	0x7824, 0xa211, 0x6810, 0xa300, 0x6812, 0x6814, 0xa201, 0x6816,
-	0x7803, 0x0004, 0x7003, 0x0000, 0x6100, 0xa18e, 0x0004, 0x00c0,
-	0x1745, 0x2009, 0x0048, 0x1078, 0x756c, 0x0c7f, 0x0d7f, 0x127f,
-	0x007c, 0x0f7e, 0x0e7e, 0x027e, 0x037e, 0x047e, 0x1078, 0x1af7,
-	0x027e, 0x2071, 0xa5e1, 0x7000, 0xa086, 0x0000, 0x0040, 0x1790,
-	0x7004, 0xac06, 0x00c0, 0x1781, 0x2079, 0x0030, 0x7000, 0xa086,
-	0x0003, 0x0040, 0x1781, 0x7804, 0xd0fc, 0x00c0, 0x177d, 0x2001,
-	0x0207, 0x2004, 0xd09c, 0x00c0, 0x1763, 0x7803, 0x0004, 0x7804,
-	0xd0ac, 0x00c0, 0x176f, 0x7803, 0x0002, 0x7803, 0x0009, 0x7003,
-	0x0003, 0x7007, 0x0000, 0x0078, 0x1781, 0x1078, 0x18e2, 0x0078,
-	0x1753, 0x157e, 0x20a9, 0x0009, 0x2009, 0xa5e7, 0x2104, 0xac06,
-	0x00c0, 0x178b, 0x200a, 0xa188, 0x0003, 0x00f0, 0x1786, 0x157f,
-	0x027f, 0x2001, 0x015d, 0x201c, 0x831a, 0x2302, 0x2001, 0x0138,
-	0x2202, 0x047f, 0x037f, 0x027f, 0x0e7f, 0x0f7f, 0x007c, 0x700c,
-	0x7110, 0xa106, 0x00c0, 0x17a7, 0x7003, 0x0000, 0x007c, 0x2104,
-	0x7006, 0x2060, 0x8108, 0x211c, 0x8108, 0x2124, 0x8108, 0xa182,
-	0xa602, 0x0048, 0x17b5, 0x2009, 0xa5e7, 0x7112, 0x700c, 0xa106,
-	0x00c0, 0x17be, 0x2001, 0x0138, 0x2003, 0x0008, 0x8cff, 0x00c0,
-	0x17c5, 0x1078, 0x1b22, 0x0078, 0x1823, 0x6010, 0x2068, 0x2d58,
-	0x6828, 0xa406, 0x00c0, 0x17d0, 0x682c, 0xa306, 0x0040, 0x17fe,
-	0x601c, 0xa086, 0x0008, 0x0040, 0x17fe, 0x6024, 0xd0f4, 0x00c0,
-	0x17fa, 0xd0d4, 0x0040, 0x17f6, 0x6038, 0xa402, 0x6034, 0xa303,
-	0x0040, 0x17e4, 0x00c8, 0x17f6, 0x643a, 0x6336, 0x6c2a, 0x6b2e,
-	0x047e, 0x037e, 0x2400, 0x6c7c, 0xa402, 0x6812, 0x2300, 0x6b80,
-	0xa303, 0x6816, 0x037f, 0x047f, 0x0078, 0x17fa, 0x1078, 0x8d8e,
-	0x0040, 0x17c1, 0x1078, 0x2035, 0x00c0, 0x17c1, 0x0c7e, 0x7004,
-	0x2060, 0x6024, 0xc0d4, 0x6026, 0x0c7f, 0x684c, 0xd0f4, 0x0040,
-	0x180f, 0x6817, 0xffff, 0x6813, 0xffff, 0x0078, 0x17c1, 0x6824,
-	0x2050, 0x6818, 0x2060, 0x6830, 0x2040, 0x6034, 0xa0cc, 0x000f,
-	0x2009, 0x0011, 0x1078, 0x1824, 0x0040, 0x1822, 0x2009, 0x0001,
-	0x1078, 0x1824, 0x2d58, 0x007c, 0x8aff, 0x0040, 0x18bb, 0xa03e,
-	0x2730, 0x6850, 0xd0fc, 0x00c0, 0x1846, 0xd0f4, 0x00c0, 0x1856,
-	0x0d7e, 0x2804, 0xac68, 0x2900, 0x0079, 0x1836, 0x189d, 0x185d,
-	0x185d, 0x189d, 0x189d, 0x1895, 0x189d, 0x185d, 0x189d, 0x1863,
-	0x1863, 0x189d, 0x189d, 0x189d, 0x188c, 0x1863, 0xc0fc, 0x6852,
-	0x6b6c, 0x6a70, 0x6d1c, 0x6c20, 0x0d7e, 0xd99c, 0x0040, 0x18a0,
-	0x2804, 0xac68, 0x6f08, 0x6e0c, 0x0078, 0x18a0, 0xc0f4, 0x6852,
-	0x6b6c, 0x6a70, 0x0d7e, 0x0078, 0x18a7, 0x6b08, 0x6a0c, 0x6d00,
-	0x6c04, 0x0078, 0x18a0, 0x7b0c, 0xd3bc, 0x0040, 0x1884, 0x7004,
-	0x0e7e, 0x2070, 0x701c, 0x0e7f, 0xa086, 0x0008, 0x00c0, 0x1884,
-	0x7b08, 0xa39c, 0x0fff, 0x2d20, 0x0d7f, 0x0d7e, 0x6a14, 0x82ff,
-	0x00c0, 0x187f, 0x6810, 0xa302, 0x0048, 0x187f, 0x6b10, 0x2011,
-	0x0000, 0x2468, 0x0078, 0x1886, 0x6b10, 0x6a14, 0x6d00, 0x6c04,
-	0x6f08, 0x6e0c, 0x0078, 0x18a0, 0x0d7f, 0x0d7e, 0x6834, 0xa084,
-	0x00ff, 0xa086, 0x001e, 0x00c0, 0x189d, 0x0d7f, 0x1078, 0x1fd1,
-	0x00c0, 0x1824, 0xa00e, 0x0078, 0x18bb, 0x0d7f, 0x1078, 0x1328,
-	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, 0x1fd1, 0x007c, 0x1078, 0x1328, 0x1078, 0x1c52,
-	0x7004, 0x2060, 0x0d7e, 0x6010, 0x2068, 0x7003, 0x0000, 0x1078,
-	0x1ac6, 0x1078, 0x8a44, 0x0040, 0x18db, 0x6808, 0x8001, 0x680a,
-	0x697c, 0x6912, 0x6980, 0x6916, 0x682b, 0xffff, 0x682f, 0xffff,
-	0x6850, 0xc0bd, 0x6852, 0x0d7f, 0x1078, 0x8758, 0x0078, 0x1aad,
-	0x1078, 0x1328, 0x127e, 0x2091, 0x2100, 0x007e, 0x017e, 0x2b68,
-	0x6818, 0x2060, 0x7904, 0x7803, 0x0002, 0xa184, 0x0700, 0x00c0,
-	0x18be, 0xa184, 0x0003, 0xa086, 0x0003, 0x0040, 0x18e0, 0x7000,
-	0x0079, 0x18fa, 0x1902, 0x1904, 0x1a06, 0x1a84, 0x1a9b, 0x1902,
-	0x1902, 0x1902, 0x1078, 0x1328, 0x8001, 0x7002, 0xa184, 0x0880,
-	0x00c0, 0x1919, 0x8aff, 0x0040, 0x199b, 0x2009, 0x0001, 0x1078,
-	0x1824, 0x0040, 0x1aad, 0x2009, 0x0001, 0x1078, 0x1824, 0x0078,
-	0x1aad, 0x7803, 0x0004, 0x7003, 0x0000, 0xd1bc, 0x00c0, 0x1979,
-	0x027e, 0x037e, 0x7808, 0xd0ec, 0x00c0, 0x1930, 0x7c20, 0x7d24,
-	0x7e30, 0x7f34, 0x7803, 0x0009, 0x7003, 0x0004, 0x0078, 0x1932,
-	0x1078, 0x1b9f, 0x6b28, 0x6a2c, 0x2400, 0x686e, 0xa31a, 0x2500,
-	0x6872, 0xa213, 0x6b2a, 0x6a2e, 0x0c7e, 0x7004, 0x2060, 0x6024,
-	0xd0f4, 0x00c0, 0x1945, 0x633a, 0x6236, 0x0c7f, 0x2400, 0x6910,
-	0xa100, 0x6812, 0x2500, 0x6914, 0xa101, 0x6816, 0x037f, 0x027f,
-	0x2600, 0x681e, 0x2700, 0x6822, 0x1078, 0x1fea, 0x2a00, 0x6826,
-	0x2c00, 0x681a, 0x2800, 0x6832, 0x6850, 0xc0fd, 0x6852, 0x6808,
-	0x8001, 0x680a, 0x00c0, 0x196e, 0x684c, 0xd0e4, 0x0040, 0x196e,
-	0x7004, 0x2060, 0x2009, 0x0048, 0x1078, 0x756c, 0x7000, 0xa086,
-	0x0004, 0x0040, 0x1aad, 0x7003, 0x0000, 0x1078, 0x179f, 0x0078,
-	0x1aad, 0x057e, 0x7d0c, 0xd5bc, 0x00c0, 0x1980, 0x1078, 0xa20c,
-	0x057f, 0x1078, 0x1ac6, 0x0f7e, 0x7004, 0x2078, 0x1078, 0x4893,
-	0x0040, 0x198d, 0x7824, 0xc0f5, 0x7826, 0x0f7f, 0x682b, 0xffff,
-	0x682f, 0xffff, 0x6808, 0x8001, 0x680a, 0x697c, 0x6912, 0x6980,
-	0x6916, 0x0078, 0x1aad, 0x7004, 0x0c7e, 0x2060, 0x6024, 0x0c7f,
-	0xd0f4, 0x0040, 0x19a8, 0x6808, 0x8001, 0x680a, 0x0078, 0x1aad,
-	0x684c, 0xc0f5, 0x684e, 0x7814, 0xa005, 0x00c0, 0x19c0, 0x7003,
-	0x0000, 0x6808, 0x8001, 0x680a, 0x00c0, 0x19bc, 0x7004, 0x2060,
-	0x2009, 0x0048, 0x1078, 0x756c, 0x1078, 0x179f, 0x0078, 0x1aad,
-	0x7814, 0x6910, 0xa102, 0x6812, 0x6914, 0xa183, 0x0000, 0x6816,
-	0x7814, 0x7908, 0xa18c, 0x0fff, 0xa188, 0x0007, 0x8114, 0x8214,
-	0x8214, 0xa10a, 0x8104, 0x8004, 0x8004, 0xa20a, 0x810b, 0x810b,
-	0x810b, 0x1078, 0x1b4d, 0x7803, 0x0004, 0x780f, 0xffff, 0x7803,
-	0x0001, 0x7804, 0xd0fc, 0x0040, 0x19e1, 0x7803, 0x0002, 0x7803,
-	0x0004, 0x780f, 0x0076, 0x7004, 0x7007, 0x0000, 0x2060, 0x2009,
-	0x0048, 0x1078, 0x756c, 0x1078, 0x1b81, 0x0040, 0x19bc, 0x7908,
-	0xd1ec, 0x00c0, 0x19ff, 0x2009, 0x0009, 0x0078, 0x1a01, 0x2009,
-	0x0019, 0x7902, 0x7003, 0x0003, 0x0078, 0x1aad, 0x8001, 0x7002,
-	0xd194, 0x0040, 0x1a18, 0x7804, 0xd0fc, 0x00c0, 0x18ea, 0x8aff,
-	0x0040, 0x1aad, 0x2009, 0x0001, 0x1078, 0x1824, 0x0078, 0x1aad,
-	0xa184, 0x0880, 0x00c0, 0x1a25, 0x8aff, 0x0040, 0x1aad, 0x2009,
-	0x0001, 0x1078, 0x1824, 0x0078, 0x1aad, 0x7803, 0x0004, 0x7003,
-	0x0000, 0xd1bc, 0x00c0, 0x1a65, 0x027e, 0x037e, 0x7808, 0xd0ec,
-	0x00c0, 0x1a38, 0x7803, 0x0009, 0x7003, 0x0004, 0x0078, 0x1a3a,
-	0x1078, 0x1b9f, 0x6b28, 0x6a2c, 0x1078, 0x1fea, 0x0d7e, 0x0f7e,
-	0x2d78, 0x2804, 0xac68, 0x6034, 0xd09c, 0x00c0, 0x1a55, 0x6808,
-	0x2008, 0xa31a, 0x680c, 0xa213, 0x7810, 0xa100, 0x7812, 0x690c,
-	0x7814, 0xa101, 0x7816, 0x0078, 0x1a61, 0x6810, 0x2008, 0xa31a,
-	0x6814, 0xa213, 0x7810, 0xa100, 0x7812, 0x6914, 0x7814, 0xa101,
-	0x7816, 0x0f7f, 0x0d7f, 0x0078, 0x1934, 0x057e, 0x7d0c, 0x1078,
-	0xa20c, 0x057f, 0x1078, 0x1ac6, 0x0f7e, 0x7004, 0x2078, 0x1078,
-	0x4893, 0x0040, 0x1a76, 0x7824, 0xc0f5, 0x7826, 0x0f7f, 0x682b,
-	0xffff, 0x682f, 0xffff, 0x6808, 0x8001, 0x680a, 0x697c, 0x6912,
-	0x6980, 0x6916, 0x0078, 0x1aad, 0x7803, 0x0004, 0x7003, 0x0000,
-	0x7004, 0xa00d, 0x0040, 0x1a97, 0x6808, 0x8001, 0x680a, 0x00c0,
-	0x1a97, 0x7004, 0x2060, 0x2009, 0x0048, 0x1078, 0x756c, 0x1078,
-	0x179f, 0x0078, 0x1aad, 0x7803, 0x0004, 0x7003, 0x0000, 0x7004,
-	0x2060, 0x6010, 0xa005, 0x0040, 0x1a97, 0x2068, 0x6808, 0x8000,
-	0x680a, 0x6c28, 0x6b2c, 0x1078, 0x17be, 0x017f, 0x007f, 0x127f,
-	0x007c, 0x127e, 0x2091, 0x2100, 0x7000, 0xa086, 0x0003, 0x00c0,
-	0x1ac4, 0x700c, 0x7110, 0xa106, 0x0040, 0x1ac4, 0x20e1, 0x9028,
-	0x700f, 0xa5e7, 0x7013, 0xa5e7, 0x127f, 0x007c, 0x0c7e, 0x1078,
-	0x1af7, 0x20e1, 0x9028, 0x700c, 0x7110, 0xa106, 0x0040, 0x1aed,
-	0x2104, 0xa005, 0x0040, 0x1ada, 0x2060, 0x6010, 0x2060, 0x6008,
-	0x8001, 0x600a, 0xa188, 0x0003, 0xa182, 0xa602, 0x0048, 0x1ae2,
-	0x2009, 0xa5e7, 0x7112, 0x700c, 0xa106, 0x00c0, 0x1acb, 0x2001,
-	0x0138, 0x2003, 0x0008, 0x0078, 0x1acb, 0x2001, 0x015d, 0x200c,
-	0x810a, 0x2102, 0x2001, 0x0138, 0x2202, 0x0c7f, 0x007c, 0x2001,
-	0x0138, 0x2014, 0x2003, 0x0000, 0x2021, 0xb015, 0x2001, 0x0141,
-	0x201c, 0xd3dc, 0x00c0, 0x1b14, 0x2001, 0x0109, 0x201c, 0xa39c,
-	0x0048, 0x00c0, 0x1b14, 0x2001, 0x0111, 0x201c, 0x83ff, 0x00c0,
-	0x1b14, 0x8421, 0x00c0, 0x1afe, 0x007c, 0x2011, 0x0201, 0x2009,
-	0x003c, 0x2204, 0xa005, 0x00c0, 0x1b21, 0x8109, 0x00c0, 0x1b19,
-	0x007c, 0x007c, 0x1078, 0x1b15, 0x0040, 0x1b4a, 0x7908, 0xd1ec,
-	0x00c0, 0x1b3a, 0x1078, 0x1b81, 0x0040, 0x1b3a, 0x7803, 0x0009,
-	0x7904, 0xd1fc, 0x0040, 0x1b30, 0x7803, 0x0006, 0x1078, 0x1b15,
-	0x0040, 0x1b4a, 0x780c, 0xd0a4, 0x00c0, 0x1b4a, 0x7007, 0x0000,
-	0x1078, 0x1b81, 0x0040, 0x1b4c, 0x7803, 0x0019, 0x7003, 0x0003,
-	0x0078, 0x1b4c, 0x1078, 0x1ac6, 0x007c, 0x0e7e, 0x2071, 0x0200,
-	0x7808, 0xa084, 0xf000, 0xa10d, 0x1078, 0x1af7, 0x2019, 0x5000,
-	0x8319, 0x0040, 0x1b6b, 0x2001, 0xa602, 0x2004, 0xa086, 0x0000,
-	0x0040, 0x1b6b, 0x2001, 0x0021, 0xd0fc, 0x0040, 0x1b58, 0x1078,
-	0x1e5d, 0x0078, 0x1b56, 0x20e1, 0x7000, 0x7324, 0x7420, 0x7028,
-	0x7028, 0x7426, 0x7037, 0x0001, 0x810f, 0x712e, 0x702f, 0x0100,
-	0x7037, 0x0008, 0x7326, 0x7422, 0x2001, 0x0138, 0x2202, 0x0e7f,
-	0x007c, 0x7908, 0xa18c, 0x0fff, 0xa182, 0x0009, 0x0048, 0x1b8c,
-	0xa085, 0x0001, 0x0078, 0x1b9e, 0x2001, 0x020a, 0x81ff, 0x0040,
-	0x1b97, 0x20e1, 0x6000, 0x200c, 0x200c, 0x200c, 0x200c, 0x20e1,
-	0x7000, 0x200c, 0x200c, 0x7003, 0x0000, 0xa006, 0x007c, 0x7c20,
-	0x7d24, 0x7e30, 0x7f34, 0x700c, 0x7110, 0xa106, 0x0040, 0x1c24,
-	0x7004, 0x017e, 0x210c, 0xa106, 0x017f, 0x0040, 0x1c24, 0x0d7e,
-	0x0c7e, 0x216c, 0x2d00, 0xa005, 0x0040, 0x1c22, 0x6824, 0xd0d4,
-	0x00c0, 0x1c22, 0x6810, 0x2068, 0x6850, 0xd0fc, 0x0040, 0x1bec,
-	0x8108, 0x2104, 0x6b2c, 0xa306, 0x00c0, 0x1c22, 0x8108, 0x2104,
-	0x6a28, 0xa206, 0x00c0, 0x1c22, 0x6850, 0xc0fc, 0xc0f5, 0x6852,
-	0x686c, 0x7822, 0x6870, 0x7826, 0x681c, 0x7832, 0x6820, 0x7836,
-	0x6818, 0x2060, 0x6034, 0xd09c, 0x0040, 0x1be7, 0x6830, 0x2004,
-	0xac68, 0x6808, 0x783a, 0x680c, 0x783e, 0x0078, 0x1c20, 0xa006,
-	0x783a, 0x783e, 0x0078, 0x1c20, 0x8108, 0x2104, 0xa005, 0x00c0,
-	0x1c22, 0x8108, 0x2104, 0xa005, 0x00c0, 0x1c22, 0x6850, 0xc0f5,
-	0x6852, 0x6830, 0x2004, 0x6918, 0xa160, 0xa180, 0x000d, 0x2004,
-	0xd09c, 0x00c0, 0x1c12, 0x6008, 0x7822, 0x686e, 0x600c, 0x7826,
-	0x6872, 0x6000, 0x7832, 0x6004, 0x7836, 0xa006, 0x783a, 0x783e,
-	0x0078, 0x1c20, 0x6010, 0x7822, 0x686e, 0x6014, 0x7826, 0x6872,
-	0x6000, 0x7832, 0x6004, 0x7836, 0x6008, 0x783a, 0x600c, 0x783e,
-	0x7803, 0x0011, 0x0c7f, 0x0d7f, 0x007c, 0x0f7e, 0x0e7e, 0x017e,
-	0x027e, 0x2071, 0xa5e1, 0x2079, 0x0030, 0x2011, 0x0050, 0x7000,
-	0xa086, 0x0000, 0x0040, 0x1c4d, 0x8211, 0x0040, 0x1c4b, 0x2001,
-	0x0005, 0x2004, 0xd08c, 0x0040, 0x1c34, 0x7904, 0xa18c, 0x0780,
-	0x017e, 0x1078, 0x18e2, 0x017f, 0x81ff, 0x00c0, 0x1c4b, 0x2011,
-	0x0050, 0x0078, 0x1c2f, 0xa085, 0x0001, 0x027f, 0x017f, 0x0e7f,
-	0x0f7f, 0x007c, 0x7803, 0x0004, 0x2009, 0x0064, 0x7804, 0xd0ac,
-	0x0040, 0x1ca3, 0x8109, 0x00c0, 0x1c56, 0x2009, 0x0100, 0x210c,
-	0xa18a, 0x0003, 0x1048, 0x1328, 0x1078, 0x1f75, 0x0e7e, 0x0f7e,
-	0x2071, 0xa5d0, 0x2079, 0x0010, 0x7004, 0xa086, 0x0000, 0x0040,
-	0x1c9b, 0x7800, 0x007e, 0x7820, 0x007e, 0x7830, 0x007e, 0x7834,
-	0x007e, 0x7838, 0x007e, 0x783c, 0x007e, 0x7803, 0x0004, 0x7823,
-	0x0000, 0x0005, 0x0005, 0x2079, 0x0030, 0x7804, 0xd0ac, 0x10c0,
-	0x1328, 0x2079, 0x0010, 0x007f, 0x783e, 0x007f, 0x783a, 0x007f,
-	0x7836, 0x007f, 0x7832, 0x007f, 0x7822, 0x007f, 0x7802, 0x0f7f,
-	0x0e7f, 0x0078, 0x1ca1, 0x0f7f, 0x0e7f, 0x7804, 0xd0ac, 0x10c0,
-	0x1328, 0x1078, 0x61d3, 0x007c, 0x0e7e, 0x2071, 0xa602, 0x7003,
-	0x0000, 0x0e7f, 0x007c, 0x0d7e, 0xa280, 0x0004, 0x206c, 0x694c,
-	0xd1dc, 0x00c0, 0x1d26, 0x6934, 0xa184, 0x0007, 0x0079, 0x1cb8,
-	0x1cc0, 0x1d11, 0x1cc0, 0x1cc0, 0x1cc0, 0x1cf6, 0x1cd3, 0x1cc2,
-	0x1078, 0x1328, 0x684c, 0xd0b4, 0x0040, 0x1e34, 0x6860, 0x682e,
-	0x6816, 0x685c, 0x682a, 0x6812, 0x687c, 0x680a, 0x6880, 0x680e,
-	0x6958, 0x0078, 0x1d19, 0x6834, 0xa084, 0x00ff, 0xa086, 0x001e,
-	0x00c0, 0x1cc0, 0x684c, 0xd0b4, 0x0040, 0x1e34, 0x6860, 0x682e,
-	0x6816, 0x685c, 0x682a, 0x6812, 0x687c, 0x680a, 0x6880, 0x680e,
-	0x6804, 0x681a, 0xa080, 0x000d, 0x2004, 0xa084, 0x000f, 0xa080,
-	0x2015, 0x2004, 0x6832, 0x6958, 0x0078, 0x1d22, 0xa18c, 0x00ff,
-	0xa186, 0x0015, 0x00c0, 0x1d26, 0x684c, 0xd0b4, 0x0040, 0x1e34,
-	0x6804, 0x681a, 0xa080, 0x000d, 0x2004, 0xa084, 0x000f, 0xa080,
-	0x2015, 0x2004, 0x6832, 0x6958, 0xa006, 0x682e, 0x682a, 0x0078,
-	0x1d22, 0x684c, 0xd0b4, 0x0040, 0x18bc, 0x6958, 0xa006, 0x682e,
-	0x682a, 0x2d00, 0x681a, 0x6834, 0xa084, 0x000f, 0xa080, 0x2015,
-	0x2004, 0x6832, 0x6926, 0x684c, 0xc0dd, 0x684e, 0x0d7f, 0x007c,
-	0x0f7e, 0x2079, 0x0020, 0x7804, 0xd0fc, 0x10c0, 0x1e5d, 0x0e7e,
-	0x0d7e, 0x2071, 0xa602, 0x7000, 0xa005, 0x00c0, 0x1dab, 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, 0x1d6d, 0xa184, 0x0007, 0x0040, 0x1d6d,
-	0x017e, 0x2009, 0x0008, 0xa102, 0x017f, 0xa108, 0x791a, 0x7116,
-	0x701e, 0x680c, 0xa081, 0x0000, 0x781e, 0x701a, 0xa006, 0x700e,
-	0x7012, 0x7004, 0x692c, 0x6814, 0xa106, 0x00c0, 0x1d84, 0x6928,
-	0x6810, 0xa106, 0x0040, 0x1d91, 0x037e, 0x047e, 0x6b14, 0x6c10,
-	0x1078, 0x2035, 0x047f, 0x037f, 0x0040, 0x1d91, 0x0c7f, 0x0078,
-	0x1dab, 0x8aff, 0x00c0, 0x1d99, 0x0c7f, 0xa085, 0x0001, 0x0078,
-	0x1dab, 0x127e, 0x2091, 0x8000, 0x2079, 0x0020, 0x2009, 0x0001,
-	0x1078, 0x1daf, 0x0040, 0x1da8, 0x2009, 0x0001, 0x1078, 0x1daf,
-	0x127f, 0x0c7f, 0xa006, 0x0d7f, 0x0e7f, 0x0f7f, 0x007c, 0x077e,
-	0x067e, 0x057e, 0x047e, 0x037e, 0x027e, 0x8aff, 0x0040, 0x1e2d,
-	0x700c, 0x7214, 0xa23a, 0x7010, 0x7218, 0xa203, 0x0048, 0x1e2c,
-	0xa705, 0x0040, 0x1e2c, 0xa03e, 0x2730, 0x6850, 0xd0fc, 0x00c0,
-	0x1ddf, 0x0d7e, 0x2804, 0xac68, 0x2900, 0x0079, 0x1dcf, 0x1e0e,
-	0x1def, 0x1def, 0x1e0e, 0x1e0e, 0x1e06, 0x1e0e, 0x1def, 0x1e0e,
-	0x1df5, 0x1df5, 0x1e0e, 0x1e0e, 0x1e0e, 0x1dfd, 0x1df5, 0xc0fc,
-	0x6852, 0x6b6c, 0x6a70, 0x6d1c, 0x6c20, 0xd99c, 0x0040, 0x1e12,
-	0x0d7e, 0x2804, 0xac68, 0x6f08, 0x6e0c, 0x0078, 0x1e11, 0x6b08,
-	0x6a0c, 0x6d00, 0x6c04, 0x0078, 0x1e11, 0x6b10, 0x6a14, 0x6d00,
-	0x6c04, 0x6f08, 0x6e0c, 0x0078, 0x1e11, 0x0d7f, 0x0d7e, 0x6834,
-	0xa084, 0x00ff, 0xa086, 0x001e, 0x00c0, 0x1e0e, 0x0d7f, 0x1078,
-	0x1fd1, 0x00c0, 0x1db5, 0xa00e, 0x0078, 0x1e2d, 0x0d7f, 0x1078,
-	0x1328, 0x0d7f, 0x7b22, 0x7a26, 0x7d32, 0x7c36, 0x7f3a, 0x7e3e,
-	0x7902, 0x7000, 0x8000, 0x7002, 0x6828, 0xa300, 0x682a, 0x682c,
-	0xa201, 0x682e, 0x700c, 0xa300, 0x700e, 0x7010, 0xa201, 0x7012,
-	0x1078, 0x1fd1, 0x0078, 0x1e2d, 0xa006, 0x027f, 0x037f, 0x047f,
-	0x057f, 0x067f, 0x077f, 0x007c, 0x1078, 0x1328, 0x027e, 0x2001,
-	0x0105, 0x2003, 0x0010, 0x20e1, 0x9040, 0x7803, 0x0004, 0x7003,
-	0x0000, 0x7004, 0x2060, 0x0d7e, 0x6010, 0x2068, 0x1078, 0x8a44,
-	0x0040, 0x1e4d, 0x6850, 0xc0bd, 0x6852, 0x0d7f, 0x1078, 0x8758,
-	0x20e1, 0x9040, 0x1078, 0x719a, 0x2011, 0x0000, 0x1078, 0x6efc,
-	0x1078, 0x61d3, 0x027f, 0x0078, 0x1f29, 0x127e, 0x2091, 0x2200,
-	0x007e, 0x017e, 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x2079, 0x0020,
-	0x2071, 0xa602, 0x2b68, 0x6818, 0x2060, 0x7904, 0x7803, 0x0002,
-	0xa184, 0x0700, 0x00c0, 0x1e36, 0x7000, 0x0079, 0x1e77, 0x1f29,
-	0x1e7b, 0x1ef6, 0x1f27, 0x8001, 0x7002, 0xd19c, 0x00c0, 0x1e8f,
-	0x8aff, 0x0040, 0x1eae, 0x2009, 0x0001, 0x1078, 0x1daf, 0x0040,
-	0x1f29, 0x2009, 0x0001, 0x1078, 0x1daf, 0x0078, 0x1f29, 0x7803,
-	0x0004, 0xd194, 0x0040, 0x1e9f, 0x6850, 0xc0fc, 0x6852, 0x8aff,
-	0x00c0, 0x1ea4, 0x684c, 0xc0f5, 0x684e, 0x0078, 0x1ea4, 0x1078,
-	0x1fea, 0x6850, 0xc0fd, 0x6852, 0x2a00, 0x6826, 0x2c00, 0x681a,
-	0x2800, 0x6832, 0x7003, 0x0000, 0x0078, 0x1f29, 0x711c, 0x81ff,
-	0x0040, 0x1ec4, 0x7918, 0x7922, 0x7827, 0x0000, 0x7803, 0x0001,
-	0x7000, 0x8000, 0x7002, 0x700c, 0xa100, 0x700e, 0x7010, 0xa081,
-	0x0000, 0x7012, 0x0078, 0x1f29, 0x0f7e, 0x027e, 0x781c, 0x007e,
-	0x7818, 0x007e, 0x2079, 0x0100, 0x7a14, 0xa284, 0x0004, 0xa085,
-	0x0012, 0x7816, 0x037e, 0x2019, 0x1000, 0x8319, 0x1040, 0x1328,
-	0x7820, 0xd0bc, 0x00c0, 0x1ed5, 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, 0x1f29, 0x8001, 0x7002,
-	0xd194, 0x0040, 0x1f0b, 0x7804, 0xd0fc, 0x00c0, 0x1e6d, 0xd19c,
-	0x00c0, 0x1f25, 0x8aff, 0x0040, 0x1f29, 0x2009, 0x0001, 0x1078,
-	0x1daf, 0x0078, 0x1f29, 0x027e, 0x037e, 0x6b28, 0x6a2c, 0x1078,
-	0x1fea, 0x0d7e, 0x2804, 0xac68, 0x6034, 0xd09c, 0x00c0, 0x1f1e,
-	0x6808, 0xa31a, 0x680c, 0xa213, 0x0078, 0x1f22, 0x6810, 0xa31a,
-	0x6814, 0xa213, 0x0d7f, 0x0078, 0x1e9f, 0x0078, 0x1e9f, 0x1078,
-	0x1328, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x017f, 0x007f, 0x127f,
-	0x007c, 0x0f7e, 0x0e7e, 0x2071, 0xa602, 0x7000, 0xa086, 0x0000,
-	0x0040, 0x1f72, 0x2079, 0x0020, 0x017e, 0x2009, 0x0207, 0x210c,
-	0xd194, 0x0040, 0x1f4f, 0x2009, 0x020c, 0x210c, 0xa184, 0x0003,
-	0x0040, 0x1f4f, 0x20e1, 0x9040, 0x2001, 0x020c, 0x2102, 0x2009,
-	0x0206, 0x2104, 0x2009, 0x0203, 0x210c, 0xa106, 0x00c0, 0x1f5a,
-	0x20e1, 0x9040, 0x7804, 0xd0fc, 0x0040, 0x1f3d, 0x1078, 0x1e5d,
-	0x7000, 0xa086, 0x0000, 0x00c0, 0x1f3d, 0x017f, 0x7803, 0x0004,
-	0x7804, 0xd0ac, 0x00c0, 0x1f68, 0x20e1, 0x9040, 0x7803, 0x0002,
-	0x7003, 0x0000, 0x0e7f, 0x0f7f, 0x007c, 0x027e, 0x0c7e, 0x0d7e,
-	0x0e7e, 0x0f7e, 0x2071, 0xa602, 0x2079, 0x0020, 0x7000, 0xa086,
-	0x0000, 0x0040, 0x1fae, 0x7004, 0x2060, 0x6010, 0x2068, 0x1078,
-	0x8a44, 0x0040, 0x1f98, 0x6850, 0xc0b5, 0x6852, 0x680c, 0x7a1c,
-	0xa206, 0x00c0, 0x1f98, 0x6808, 0x7a18, 0xa206, 0x0040, 0x1fb4,
-	0x2001, 0x0105, 0x2003, 0x0010, 0x20e1, 0x9040, 0x7803, 0x0004,
-	0x7003, 0x0000, 0x7004, 0x2060, 0x1078, 0x8758, 0x20e1, 0x9040,
-	0x1078, 0x719a, 0x2011, 0x0000, 0x1078, 0x6efc, 0x0f7f, 0x0e7f,
-	0x0d7f, 0x0c7f, 0x027f, 0x007c, 0x6810, 0x6a14, 0xa205, 0x00c0,
-	0x1f98, 0x684c, 0xc0dc, 0x684e, 0x2c10, 0x1078, 0x1cab, 0x2001,
-	0x0105, 0x2003, 0x0010, 0x20e1, 0x9040, 0x7803, 0x0004, 0x7003,
-	0x0000, 0x2069, 0xa5ab, 0x6833, 0x0000, 0x683f, 0x0000, 0x0078,
-	0x1fae, 0x8840, 0x2804, 0xa005, 0x00c0, 0x1fe5, 0x6004, 0xa005,
-	0x0040, 0x1fe7, 0x681a, 0x2060, 0x6034, 0xa084, 0x000f, 0xa080,
-	0x2015, 0x2044, 0x88ff, 0x1040, 0x1328, 0x8a51, 0x007c, 0x2051,
-	0x0000, 0x007c, 0x8a50, 0x8841, 0x2804, 0xa005, 0x00c0, 0x2004,
-	0x2c00, 0xad06, 0x0040, 0x1ff9, 0x6000, 0xa005, 0x00c0, 0x1ff9,
-	0x2d00, 0x2060, 0x681a, 0x6034, 0xa084, 0x000f, 0xa080, 0x2025,
-	0x2044, 0x88ff, 0x1040, 0x1328, 0x007c, 0x0000, 0x0011, 0x0015,
-	0x0019, 0x001d, 0x0021, 0x0025, 0x0029, 0x0000, 0x000f, 0x0015,
-	0x001b, 0x0021, 0x0027, 0x0000, 0x0000, 0x0000, 0x200a, 0x2006,
-	0x0000, 0x0000, 0x2014, 0x0000, 0x200a, 0x0000, 0x2011, 0x200e,
-	0x0000, 0x0000, 0x0000, 0x2014, 0x2011, 0x0000, 0x200c, 0x200c,
-	0x0000, 0x0000, 0x2014, 0x0000, 0x200c, 0x0000, 0x2012, 0x2012,
-	0x0000, 0x0000, 0x0000, 0x2014, 0x2012, 0x0a7e, 0x097e, 0x087e,
-	0x6b2e, 0x6c2a, 0x6858, 0xa055, 0x0040, 0x20d8, 0x2d60, 0x6034,
-	0xa0cc, 0x000f, 0xa9c0, 0x2015, 0xa986, 0x0007, 0x0040, 0x2050,
-	0xa986, 0x000e, 0x0040, 0x2050, 0xa986, 0x000f, 0x00c0, 0x2054,
-	0x605c, 0xa422, 0x6060, 0xa31a, 0x2804, 0xa045, 0x00c0, 0x2062,
-	0x0050, 0x205c, 0x0078, 0x20d8, 0x6004, 0xa065, 0x0040, 0x20d8,
-	0x0078, 0x203f, 0x2804, 0xa005, 0x0040, 0x2080, 0xac68, 0xd99c,
-	0x00c0, 0x2070, 0x6808, 0xa422, 0x680c, 0xa31b, 0x0078, 0x2074,
-	0x6810, 0xa422, 0x6814, 0xa31b, 0x0048, 0x209f, 0x2300, 0xa405,
-	0x0040, 0x2086, 0x8a51, 0x0040, 0x20d8, 0x8840, 0x0078, 0x2062,
-	0x6004, 0xa065, 0x0040, 0x20d8, 0x0078, 0x203f, 0x8a51, 0x0040,
-	0x20d8, 0x8840, 0x2804, 0xa005, 0x00c0, 0x2099, 0x6004, 0xa065,
-	0x0040, 0x20d8, 0x6034, 0xa0cc, 0x000f, 0xa9c0, 0x2015, 0x2804,
-	0x2040, 0x2b68, 0x6850, 0xc0fc, 0x6852, 0x0078, 0x20cc, 0x8422,
-	0x8420, 0x831a, 0xa399, 0x0000, 0x0d7e, 0x2b68, 0x6c6e, 0x6b72,
-	0x0d7f, 0xd99c, 0x00c0, 0x20ba, 0x6908, 0x2400, 0xa122, 0x690c,
-	0x2300, 0xa11b, 0x1048, 0x1328, 0x6800, 0xa420, 0x6804, 0xa319,
-	0x0078, 0x20c6, 0x6910, 0x2400, 0xa122, 0x6914, 0x2300, 0xa11b,
-	0x1048, 0x1328, 0x6800, 0xa420, 0x6804, 0xa319, 0x2b68, 0x6c1e,
-	0x6b22, 0x6850, 0xc0fd, 0x6852, 0x2c00, 0x681a, 0x2800, 0x6832,
-	0x2a00, 0x6826, 0x007f, 0x007f, 0x007f, 0xa006, 0x0078, 0x20dd,
-	0x087f, 0x097f, 0x0a7f, 0xa085, 0x0001, 0x007c, 0x2001, 0x0005,
-	0x2004, 0xa084, 0x0007, 0x0079, 0x20e5, 0x20ed, 0x20ee, 0x20f1,
-	0x20f4, 0x20f9, 0x20fc, 0x2101, 0x2106, 0x007c, 0x1078, 0x1e5d,
-	0x007c, 0x1078, 0x18e2, 0x007c, 0x1078, 0x18e2, 0x1078, 0x1e5d,
-	0x007c, 0x1078, 0x14b0, 0x007c, 0x1078, 0x1e5d, 0x1078, 0x14b0,
-	0x007c, 0x1078, 0x18e2, 0x1078, 0x14b0, 0x007c, 0x1078, 0x18e2,
-	0x1078, 0x1e5d, 0x1078, 0x14b0, 0x007c, 0x127e, 0x2091, 0x2300,
-	0x2079, 0x0200, 0x2071, 0xa880, 0x2069, 0xa300, 0x2009, 0x0004,
-	0x7912, 0x7817, 0x0004, 0x1078, 0x24b5, 0x781b, 0x0002, 0x20e1,
-	0x8700, 0x127f, 0x007c, 0x127e, 0x2091, 0x2300, 0x781c, 0xa084,
-	0x0007, 0x0079, 0x212b, 0x214f, 0x2133, 0x2137, 0x213b, 0x2141,
-	0x2145, 0x2149, 0x214d, 0x1078, 0x5372, 0x0078, 0x214f, 0x1078,
-	0x53b3, 0x0078, 0x214f, 0x1078, 0x5372, 0x1078, 0x53b3, 0x0078,
-	0x214f, 0x1078, 0x2151, 0x0078, 0x214f, 0x1078, 0x2151, 0x0078,
-	0x214f, 0x1078, 0x2151, 0x0078, 0x214f, 0x1078, 0x2151, 0x127f,
-	0x007c, 0x007e, 0x017e, 0x027e, 0x7930, 0xa184, 0x0003, 0x0040,
-	0x215d, 0x20e1, 0x9040, 0x0078, 0x2186, 0xa184, 0x0030, 0x0040,
-	0x216e, 0x6a00, 0xa286, 0x0003, 0x00c0, 0x2168, 0x0078, 0x216a,
-	0x1078, 0x4171, 0x20e1, 0x9010, 0x0078, 0x2186, 0xa184, 0x00c0,
-	0x0040, 0x2180, 0x0e7e, 0x037e, 0x047e, 0x057e, 0x2071, 0xa5e1,
-	0x1078, 0x1ac6, 0x057f, 0x047f, 0x037f, 0x0e7f, 0x0078, 0x2186,
-	0xa184, 0x0300, 0x0040, 0x2186, 0x20e1, 0x9020, 0x7932, 0x027f,
-	0x017f, 0x007f, 0x007c, 0x017e, 0x0e7e, 0x0f7e, 0x2071, 0xa300,
-	0x7128, 0x2001, 0xa58f, 0x2102, 0x2001, 0xa597, 0x2102, 0xa182,
-	0x0211, 0x00c8, 0x219f, 0x2009, 0x0008, 0x0078, 0x21c9, 0xa182,
-	0x0259, 0x00c8, 0x21a7, 0x2009, 0x0007, 0x0078, 0x21c9, 0xa182,
-	0x02c1, 0x00c8, 0x21af, 0x2009, 0x0006, 0x0078, 0x21c9, 0xa182,
-	0x0349, 0x00c8, 0x21b7, 0x2009, 0x0005, 0x0078, 0x21c9, 0xa182,
-	0x0421, 0x00c8, 0x21bf, 0x2009, 0x0004, 0x0078, 0x21c9, 0xa182,
-	0x0581, 0x00c8, 0x21c7, 0x2009, 0x0003, 0x0078, 0x21c9, 0x2009,
-	0x0002, 0x2079, 0x0200, 0x7912, 0x7817, 0x0004, 0x1078, 0x24b5,
-	0x0f7f, 0x0e7f, 0x017f, 0x007c, 0x127e, 0x2091, 0x2200, 0x2061,
-	0x0100, 0x2071, 0xa300, 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,
-	0xa32f, 0x2003, 0x0000, 0x2001, 0xa32e, 0x2003, 0x0001, 0x007c,
-	0x127e, 0x2091, 0x2200, 0x007e, 0x017e, 0x027e, 0x6124, 0xa184,
-	0x002c, 0x00c0, 0x220f, 0xa184, 0x0007, 0x0079, 0x2215, 0xa195,
-	0x0004, 0xa284, 0x0007, 0x0079, 0x2215, 0x2241, 0x221d, 0x2221,
-	0x2225, 0x222b, 0x222f, 0x2235, 0x223b, 0x1078, 0x5ad2, 0x0078,
-	0x2241, 0x1078, 0x5bc1, 0x0078, 0x2241, 0x1078, 0x5bc1, 0x1078,
-	0x5ad2, 0x0078, 0x2241, 0x1078, 0x2246, 0x0078, 0x2241, 0x1078,
-	0x5ad2, 0x1078, 0x2246, 0x0078, 0x2241, 0x1078, 0x5bc1, 0x1078,
-	0x2246, 0x0078, 0x2241, 0x1078, 0x5bc1, 0x1078, 0x5ad2, 0x1078,
-	0x2246, 0x027f, 0x017f, 0x007f, 0x127f, 0x007c, 0x6124, 0xd1ac,
-	0x0040, 0x2342, 0x017e, 0x047e, 0x0c7e, 0x644c, 0xa486, 0xf0f0,
-	0x00c0, 0x2259, 0x2061, 0x0100, 0x644a, 0x6043, 0x0090, 0x6043,
-	0x0010, 0x74c2, 0xa48c, 0xff00, 0x7034, 0xd084, 0x0040, 0x2271,
-	0xa186, 0xf800, 0x00c0, 0x2271, 0x7038, 0xd084, 0x00c0, 0x2271,
-	0xc085, 0x703a, 0x037e, 0x2418, 0x2011, 0x8016, 0x1078, 0x3579,
-	0x037f, 0xa196, 0xff00, 0x0040, 0x22b3, 0x6030, 0xa084, 0x00ff,
-	0x810f, 0xa116, 0x0040, 0x22b3, 0x7130, 0xd184, 0x00c0, 0x22b3,
-	0x2011, 0xa352, 0x2214, 0xd2ec, 0x0040, 0x228e, 0xc18d, 0x7132,
-	0x2011, 0xa352, 0x2214, 0xd2ac, 0x00c0, 0x22b3, 0x6240, 0xa294,
-	0x0010, 0x0040, 0x229a, 0x6248, 0xa294, 0xff00, 0xa296, 0xff00,
-	0x0040, 0x22b3, 0x7030, 0xd08c, 0x0040, 0x2305, 0x7034, 0xd08c,
-	0x00c0, 0x22aa, 0x2001, 0xa30c, 0x200c, 0xd1ac, 0x00c0, 0x2305,
-	0xc1ad, 0x2102, 0x037e, 0x73c0, 0x2011, 0x8013, 0x1078, 0x3579,
-	0x037f, 0x0078, 0x2305, 0x7034, 0xd08c, 0x00c0, 0x22bf, 0x2001,
-	0xa30c, 0x200c, 0xd1ac, 0x00c0, 0x2305, 0xc1ad, 0x2102, 0x037e,
-	0x73c0, 0x2011, 0x8013, 0x1078, 0x3579, 0x037f, 0x7130, 0xc185,
-	0x7132, 0x2011, 0xa352, 0x220c, 0xd1a4, 0x0040, 0x22e9, 0x017e,
-	0x2009, 0x0001, 0x2011, 0x0100, 0x1078, 0x5a6d, 0x2019, 0x000e,
-	0x1078, 0x9e3b, 0xa484, 0x00ff, 0xa080, 0x293f, 0x200c, 0xa18c,
-	0xff00, 0x810f, 0x8127, 0xa006, 0x2009, 0x000e, 0x1078, 0x9ec0,
-	0x017f, 0xd1ac, 0x00c0, 0x22f6, 0x017e, 0x2009, 0x0000, 0x2019,
-	0x0004, 0x1078, 0x27e2, 0x017f, 0x0078, 0x2305, 0x157e, 0x20a9,
-	0x007f, 0x2009, 0x0000, 0x1078, 0x4501, 0x00c0, 0x2301, 0x1078,
-	0x4235, 0x8108, 0x00f0, 0x22fb, 0x157f, 0x0c7f, 0x047f, 0x0f7e,
-	0x2079, 0xa5be, 0x783c, 0xa086, 0x0000, 0x0040, 0x2317, 0x6027,
-	0x0004, 0x783f, 0x0000, 0x2079, 0x0140, 0x7803, 0x0000, 0x0f7f,
-	0x2011, 0x0003, 0x1078, 0x6ef2, 0x2011, 0x0002, 0x1078, 0x6efc,
-	0x1078, 0x6dda, 0x1078, 0x595a, 0x037e, 0x2019, 0x0000, 0x1078,
-	0x6e6c, 0x037f, 0x60e3, 0x0000, 0x017f, 0x2001, 0xa300, 0x2014,
-	0xa296, 0x0004, 0x00c0, 0x233a, 0xd19c, 0x00c0, 0x233a, 0x6228,
-	0xc29d, 0x622a, 0x2003, 0x0001, 0x2001, 0xa321, 0x2003, 0x0000,
-	0x6027, 0x0020, 0xd194, 0x0040, 0x2426, 0x0f7e, 0x2079, 0xa5be,
-	0x783c, 0xa086, 0x0001, 0x00c0, 0x2366, 0x017e, 0x6027, 0x0004,
-	0x783f, 0x0000, 0x2079, 0x0140, 0x7803, 0x1000, 0x7803, 0x0000,
-	0x2079, 0xa5ab, 0x7807, 0x0000, 0x7833, 0x0000, 0x1078, 0x6109,
-	0x1078, 0x61d3, 0x017f, 0x0f7f, 0x0078, 0x2426, 0x0f7f, 0x017e,
-	0x3900, 0xa082, 0xa6cd, 0x00c8, 0x2371, 0x017e, 0x1078, 0x728a,
-	0x017f, 0x6220, 0xd2b4, 0x0040, 0x23dc, 0x1078, 0x595a, 0x1078,
-	0x6c41, 0x6027, 0x0004, 0x0f7e, 0x2019, 0xa5b4, 0x2304, 0xa07d,
-	0x0040, 0x23b2, 0x7804, 0xa086, 0x0032, 0x00c0, 0x23b2, 0x0d7e,
-	0x0c7e, 0x0e7e, 0x2069, 0x0140, 0x618c, 0x6288, 0x7818, 0x608e,
-	0x7808, 0x608a, 0x6043, 0x0002, 0x2001, 0x0003, 0x8001, 0x00c0,
-	0x2396, 0x6043, 0x0000, 0x6803, 0x1000, 0x6803, 0x0000, 0x618e,
-	0x628a, 0x1078, 0x6010, 0x1078, 0x6109, 0x7810, 0x2070, 0x7037,
-	0x0103, 0x2f60, 0x1078, 0x753d, 0x0e7f, 0x0c7f, 0x0d7f, 0x0f7f,
-	0x017f, 0x007c, 0x0f7f, 0x0d7e, 0x2069, 0x0140, 0x6804, 0xa084,
-	0x4000, 0x0040, 0x23bf, 0x6803, 0x1000, 0x6803, 0x0000, 0x0d7f,
-	0x0c7e, 0x2061, 0xa5ab, 0x6028, 0xa09a, 0x00c8, 0x00c8, 0x23cf,
-	0x8000, 0x602a, 0x0c7f, 0x1078, 0x6c33, 0x0078, 0x2425, 0x2019,
-	0xa5b4, 0x2304, 0xa065, 0x0040, 0x23d9, 0x2009, 0x0027, 0x1078,
-	0x756c, 0x0c7f, 0x0078, 0x2425, 0xd2bc, 0x0040, 0x2425, 0x1078,
-	0x5967, 0x6017, 0x0010, 0x6027, 0x0004, 0x0d7e, 0x2069, 0x0140,
-	0x6804, 0xa084, 0x4000, 0x0040, 0x23f1, 0x6803, 0x1000, 0x6803,
-	0x0000, 0x0d7f, 0x0c7e, 0x2061, 0xa5ab, 0x6044, 0xa09a, 0x00c8,
-	0x00c8, 0x2414, 0x8000, 0x6046, 0x603c, 0x0c7f, 0xa005, 0x0040,
-	0x2425, 0x2009, 0x07d0, 0x1078, 0x595f, 0xa080, 0x0007, 0x2004,
-	0xa086, 0x0006, 0x00c0, 0x2410, 0x6017, 0x0012, 0x0078, 0x2425,
-	0x6017, 0x0016, 0x0078, 0x2425, 0x037e, 0x2019, 0x0001, 0x1078,
-	0x6e6c, 0x037f, 0x2019, 0xa5ba, 0x2304, 0xa065, 0x0040, 0x2424,
-	0x2009, 0x004f, 0x1078, 0x756c, 0x0c7f, 0x017f, 0xd19c, 0x0040,
-	0x247c, 0x7034, 0xd0ac, 0x00c0, 0x2457, 0x017e, 0x157e, 0x6027,
-	0x0008, 0x602f, 0x0020, 0x20a9, 0x000a, 0x00f0, 0x2435, 0x602f,
-	0x0000, 0x6150, 0xa185, 0x1400, 0x6052, 0x20a9, 0x0320, 0x00e0,
-	0x243f, 0x2091, 0x6000, 0x6020, 0xd09c, 0x00c0, 0x244e, 0x157f,
-	0x6152, 0x017f, 0x6027, 0x0008, 0x0078, 0x247c, 0x1078, 0x250d,
-	0x00f0, 0x243f, 0x157f, 0x6152, 0x017f, 0x6027, 0x0008, 0x017e,
-	0x6028, 0xc09c, 0x602a, 0x2011, 0x0003, 0x1078, 0x6ef2, 0x2011,
-	0x0002, 0x1078, 0x6efc, 0x1078, 0x6dda, 0x1078, 0x595a, 0x037e,
-	0x2019, 0x0000, 0x1078, 0x6e6c, 0x037f, 0x60e3, 0x0000, 0x1078,
-	0xa22a, 0x1078, 0xa248, 0x2001, 0xa300, 0x2003, 0x0004, 0x6027,
-	0x0008, 0x1078, 0x1246, 0x017f, 0xa18c, 0xffd0, 0x6126, 0x007c,
-	0x007e, 0x017e, 0x027e, 0x0e7e, 0x0f7e, 0x127e, 0x2091, 0x8000,
-	0x2071, 0xa300, 0x71b8, 0x70ba, 0xa116, 0x0040, 0x24ae, 0x81ff,
-	0x0040, 0x2498, 0x2011, 0x8011, 0x1078, 0x3579, 0x0078, 0x24ae,
-	0x2011, 0x8012, 0x1078, 0x3579, 0x2001, 0xa371, 0x2004, 0xd0fc,
-	0x00c0, 0x24ae, 0x037e, 0x0c7e, 0x2061, 0x0100, 0x2019, 0x0028,
-	0x2009, 0x0000, 0x1078, 0x27e2, 0x0c7f, 0x037f, 0x127f, 0x0f7f,
-	0x0e7f, 0x027f, 0x017f, 0x007f, 0x007c, 0x0c7e, 0x0f7e, 0x007e,
-	0x027e, 0x2061, 0x0100, 0xa190, 0x24d1, 0x2204, 0x60f2, 0x2011,
-	0x24de, 0x6000, 0xa082, 0x0003, 0x00c8, 0x24ca, 0x2001, 0x00ff,
-	0x0078, 0x24cb, 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, 0x24ee, 0x81ff, 0x0040, 0x24f2, 0x1078, 0x5623,
-	0x0078, 0x24f9, 0xa080, 0x293f, 0x200c, 0xa18c, 0xff00, 0x810f,
-	0xa006, 0x007c, 0xa080, 0x293f, 0x200c, 0xa18c, 0x00ff, 0x007c,
-	0x0c7e, 0x2061, 0xa300, 0x6030, 0x0040, 0x2509, 0xc09d, 0x0078,
-	0x250a, 0xc09c, 0x6032, 0x0c7f, 0x007c, 0x007e, 0x157e, 0x0f7e,
-	0x2079, 0x0100, 0x20a9, 0x000a, 0x7854, 0xd08c, 0x00c0, 0x251a,
-	0x00f0, 0x2514, 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, 0x257d, 0x2581, 0x2585,
-	0x258b, 0x2591, 0x2597, 0x259d, 0x25a5, 0x25ad, 0x25b3, 0x25b9,
-	0x25c1, 0x25c9, 0x25d1, 0x25d9, 0x25e3, 0x25ed, 0x25ed, 0x25ed,
-	0x25ed, 0x25ed, 0x25ed, 0x25ed, 0x25ed, 0x25ed, 0x25ed, 0x25ed,
-	0x25ed, 0x25ed, 0x25ed, 0x25ed, 0x25ed, 0x107e, 0x007e, 0x0078,
-	0x2606, 0x107e, 0x007e, 0x0078, 0x2606, 0x107e, 0x007e, 0x1078,
-	0x2200, 0x0078, 0x2606, 0x107e, 0x007e, 0x1078, 0x2200, 0x0078,
-	0x2606, 0x107e, 0x007e, 0x1078, 0x20de, 0x0078, 0x2606, 0x107e,
-	0x007e, 0x1078, 0x20de, 0x0078, 0x2606, 0x107e, 0x007e, 0x1078,
-	0x2200, 0x1078, 0x20de, 0x0078, 0x2606, 0x107e, 0x007e, 0x1078,
-	0x2200, 0x1078, 0x20de, 0x0078, 0x2606, 0x107e, 0x007e, 0x1078,
-	0x2123, 0x0078, 0x2606, 0x107e, 0x007e, 0x1078, 0x2123, 0x0078,
-	0x2606, 0x107e, 0x007e, 0x1078, 0x2200, 0x1078, 0x2123, 0x0078,
-	0x2606, 0x107e, 0x007e, 0x1078, 0x2200, 0x1078, 0x2123, 0x0078,
-	0x2606, 0x107e, 0x007e, 0x1078, 0x20de, 0x1078, 0x2123, 0x0078,
-	0x2606, 0x107e, 0x007e, 0x1078, 0x20de, 0x1078, 0x2123, 0x0078,
-	0x2606, 0x107e, 0x007e, 0x1078, 0x2200, 0x1078, 0x20de, 0x1078,
-	0x2123, 0x0078, 0x2606, 0x107e, 0x007e, 0x1078, 0x2200, 0x1078,
-	0x20de, 0x1078, 0x2123, 0x0078, 0x2606, 0x0005, 0x0078, 0x25ed,
-	0xb084, 0x003c, 0x8004, 0x8004, 0x0079, 0x25f6, 0x2606, 0x2583,
-	0x2587, 0x258d, 0x2593, 0x2599, 0x259f, 0x25a7, 0x25af, 0x25b5,
-	0x25bb, 0x25c3, 0x25cb, 0x25d3, 0x25db, 0x25e5, 0x0008, 0x25f0,
-	0x007f, 0x107f, 0x2091, 0x8001, 0x007c, 0x0c7e, 0x027e, 0x047e,
-	0x2021, 0x0000, 0x1078, 0x4897, 0x00c0, 0x2705, 0x70c8, 0xd09c,
-	0x0040, 0x2624, 0xd084, 0x00c0, 0x2624, 0xd0bc, 0x00c0, 0x2705,
-	0x1078, 0x2709, 0x0078, 0x2705, 0xd094, 0x0040, 0x262b, 0x7093,
-	0xffff, 0x0078, 0x2705, 0x2001, 0x010c, 0x203c, 0x7280, 0xd284,
-	0x0040, 0x2694, 0xd28c, 0x00c0, 0x2694, 0x037e, 0x7390, 0xa38e,
-	0xffff, 0x0040, 0x263e, 0x83ff, 0x00c0, 0x2640, 0x2019, 0x0001,
-	0x8314, 0xa2e0, 0xa9c0, 0x2c04, 0xa38c, 0x0001, 0x0040, 0x264d,
-	0xa084, 0xff00, 0x8007, 0x0078, 0x264f, 0xa084, 0x00ff, 0xa70e,
-	0x0040, 0x2689, 0xa08e, 0x0000, 0x0040, 0x2689, 0xa08e, 0x00ff,
-	0x00c0, 0x2666, 0x7230, 0xd284, 0x00c0, 0x268f, 0x7280, 0xc28d,
-	0x7282, 0x7093, 0xffff, 0x037f, 0x0078, 0x2694, 0x2009, 0x0000,
-	0x1078, 0x24e3, 0x1078, 0x4499, 0x00c0, 0x268c, 0x6004, 0xa084,
-	0x00ff, 0xa086, 0x0006, 0x00c0, 0x2683, 0x7030, 0xd08c, 0x0040,
-	0x267d, 0x6000, 0xd0bc, 0x0040, 0x2683, 0x1078, 0x271f, 0x0040,
-	0x268c, 0x0078, 0x2689, 0x1078, 0x2857, 0x1078, 0x274c, 0x0040,
-	0x268c, 0x8318, 0x0078, 0x2640, 0x7392, 0x0078, 0x2691, 0x7093,
-	0xffff, 0x037f, 0x0078, 0x2705, 0xa780, 0x293f, 0x203c, 0xa7bc,
-	0xff00, 0x873f, 0x2041, 0x007e, 0x7090, 0xa096, 0xffff, 0x00c0,
-	0x26a6, 0x2009, 0x0000, 0x28a8, 0x0078, 0x26b2, 0xa812, 0x0048,
-	0x26ae, 0x2008, 0xa802, 0x20a8, 0x0078, 0x26b2, 0x7093, 0xffff,
-	0x0078, 0x2705, 0x2700, 0x157e, 0x017e, 0xa106, 0x0040, 0x26f9,
-	0xc484, 0x1078, 0x4501, 0x0040, 0x26c3, 0x1078, 0x4499, 0x00c0,
-	0x2702, 0x0078, 0x26c4, 0xc485, 0x6004, 0xa084, 0x00ff, 0xa086,
-	0x0006, 0x00c0, 0x26d3, 0x7030, 0xd08c, 0x0040, 0x26f1, 0x6000,
-	0xd0bc, 0x00c0, 0x26f1, 0x7280, 0xd28c, 0x0040, 0x26e9, 0x6004,
-	0xa084, 0x00ff, 0xa082, 0x0006, 0x0048, 0x26f9, 0xd484, 0x00c0,
-	0x26e5, 0x1078, 0x44bc, 0x0078, 0x26e7, 0x1078, 0x2921, 0x0078,
-	0x26f9, 0x1078, 0x2857, 0x1078, 0x274c, 0x0040, 0x2702, 0x0078,
-	0x26f9, 0x1078, 0x28ec, 0x0040, 0x26f9, 0x1078, 0x271f, 0x0040,
-	0x2702, 0x017f, 0x8108, 0x157f, 0x00f0, 0x26b2, 0x7093, 0xffff,
-	0x0078, 0x2705, 0x017f, 0x157f, 0x7192, 0x047f, 0x027f, 0x0c7f,
-	0x007c, 0x0c7e, 0x017e, 0x7093, 0x0000, 0x2009, 0x007e, 0x1078,
-	0x4499, 0x00c0, 0x271c, 0x1078, 0x2857, 0x1078, 0x274c, 0x0040,
-	0x271c, 0x70c8, 0xc0bd, 0x70ca, 0x017f, 0x0c7f, 0x007c, 0x017e,
-	0x077e, 0x0d7e, 0x0c7e, 0x2c68, 0x2001, 0xa356, 0x2004, 0xa084,
-	0x00ff, 0x6842, 0x1078, 0x74d7, 0x0040, 0x2747, 0x2d00, 0x601a,
-	0x601f, 0x0001, 0x2001, 0x0000, 0x1078, 0x442b, 0x2001, 0x0000,
-	0x1078, 0x443f, 0x127e, 0x2091, 0x8000, 0x708c, 0x8000, 0x708e,
-	0x127f, 0x2009, 0x0004, 0x1078, 0x756c, 0xa085, 0x0001, 0x0c7f,
-	0x0d7f, 0x077f, 0x017f, 0x007c, 0x017e, 0x077e, 0x0d7e, 0x0c7e,
-	0x2c68, 0x2001, 0xa356, 0x2004, 0xa084, 0x00ff, 0x6842, 0x1078,
-	0x74d7, 0x0040, 0x2785, 0x2d00, 0x601a, 0x6800, 0xc0c4, 0x6802,
-	0x68a0, 0xa086, 0x007e, 0x0040, 0x276e, 0x6804, 0xa084, 0x00ff,
-	0xa086, 0x0006, 0x00c0, 0x276e, 0x1078, 0x2813, 0x601f, 0x0001,
-	0x2001, 0x0000, 0x1078, 0x442b, 0x2001, 0x0002, 0x1078, 0x443f,
-	0x127e, 0x2091, 0x8000, 0x708c, 0x8000, 0x708e, 0x127f, 0x2009,
-	0x0002, 0x1078, 0x756c, 0xa085, 0x0001, 0x0c7f, 0x0d7f, 0x077f,
-	0x017f, 0x007c, 0x0c7e, 0x027e, 0x2009, 0x0080, 0x1078, 0x4499,
-	0x00c0, 0x2798, 0x1078, 0x279b, 0x0040, 0x2798, 0x70cf, 0xffff,
-	0x027f, 0x0c7f, 0x007c, 0x017e, 0x077e, 0x0d7e, 0x0c7e, 0x2c68,
-	0x1078, 0x74d7, 0x0040, 0x27bd, 0x2d00, 0x601a, 0x601f, 0x0001,
-	0x2001, 0x0000, 0x1078, 0x442b, 0x2001, 0x0002, 0x1078, 0x443f,
-	0x127e, 0x2091, 0x8000, 0x70d0, 0x8000, 0x70d2, 0x127f, 0x2009,
-	0x0002, 0x1078, 0x756c, 0xa085, 0x0001, 0x0c7f, 0x0d7f, 0x077f,
-	0x017f, 0x007c, 0x0c7e, 0x0d7e, 0x127e, 0x2091, 0x8000, 0x2009,
-	0x007f, 0x1078, 0x4499, 0x00c0, 0x27de, 0x2c68, 0x1078, 0x74d7,
-	0x0040, 0x27de, 0x2d00, 0x601a, 0x6312, 0x601f, 0x0001, 0x620a,
-	0x2009, 0x0022, 0x1078, 0x756c, 0xa085, 0x0001, 0x127f, 0x0d7f,
-	0x0c7f, 0x007c, 0x0e7e, 0x0c7e, 0x067e, 0x037e, 0x027e, 0x1078,
-	0x5d60, 0x1078, 0x5d02, 0x1078, 0x7ddf, 0x2130, 0x81ff, 0x0040,
-	0x27f7, 0x20a9, 0x007e, 0x2009, 0x0000, 0x0078, 0x27fb, 0x20a9,
-	0x007f, 0x2009, 0x0000, 0x017e, 0x1078, 0x4501, 0x00c0, 0x2804,
-	0x1078, 0x471b, 0x1078, 0x4235, 0x017f, 0x8108, 0x00f0, 0x27fb,
-	0x86ff, 0x00c0, 0x280d, 0x1078, 0x119b, 0x027f, 0x037f, 0x067f,
-	0x0c7f, 0x0e7f, 0x007c, 0x0e7e, 0x0c7e, 0x037e, 0x027e, 0x017e,
-	0x6218, 0x2270, 0x72a0, 0x027e, 0x2019, 0x0029, 0x1078, 0x5d53,
-	0x077e, 0x2039, 0x0000, 0x1078, 0x5c78, 0x2c08, 0x1078, 0x9c38,
-	0x077f, 0x017f, 0x2e60, 0x1078, 0x471b, 0x6210, 0x6314, 0x1078,
-	0x4235, 0x6212, 0x6316, 0x017f, 0x027f, 0x037f, 0x0c7f, 0x0e7f,
-	0x007c, 0x0e7e, 0x007e, 0x6018, 0xa080, 0x0028, 0x2004, 0xd0bc,
-	0x00c0, 0x284d, 0x2071, 0xa300, 0x708c, 0xa005, 0x0040, 0x284a,
-	0x8001, 0x708e, 0x007f, 0x0e7f, 0x007c, 0x2071, 0xa300, 0x70d0,
-	0xa005, 0x0040, 0x284a, 0x8001, 0x70d2, 0x0078, 0x284a, 0x6000,
-	0xc08c, 0x6002, 0x007c, 0x0f7e, 0x0e7e, 0x0c7e, 0x037e, 0x027e,
-	0x017e, 0x157e, 0x2178, 0x81ff, 0x00c0, 0x286a, 0x20a9, 0x0001,
-	0x0078, 0x2885, 0x2001, 0xa352, 0x2004, 0xd0c4, 0x0040, 0x2881,
-	0xd0a4, 0x0040, 0x2881, 0x047e, 0x6018, 0xa080, 0x0028, 0x2024,
-	0xa4a4, 0x00ff, 0x8427, 0xa006, 0x2009, 0x002d, 0x1078, 0x9ec0,
-	0x047f, 0x20a9, 0x00ff, 0x2011, 0x0000, 0x027e, 0xa28e, 0x007e,
-	0x0040, 0x28c9, 0xa28e, 0x007f, 0x0040, 0x28c9, 0xa28e, 0x0080,
-	0x0040, 0x28c9, 0xa288, 0xa434, 0x210c, 0x81ff, 0x0040, 0x28c9,
-	0x8fff, 0x1040, 0x28d5, 0x0c7e, 0x2160, 0x2001, 0x0001, 0x1078,
-	0x48a2, 0x0c7f, 0x2019, 0x0029, 0x1078, 0x5d53, 0x077e, 0x2039,
-	0x0000, 0x1078, 0x5c78, 0x0c7e, 0x027e, 0x2160, 0x6204, 0xa294,
-	0x00ff, 0xa286, 0x0006, 0x00c0, 0x28b9, 0x6007, 0x0404, 0x0078,
-	0x28be, 0x2001, 0x0004, 0x8007, 0xa215, 0x6206, 0x027f, 0x0c7f,
-	0x017e, 0x2c08, 0x1078, 0x9c38, 0x017f, 0x077f, 0x2160, 0x1078,
-	0x471b, 0x027f, 0x8210, 0x00f0, 0x2885, 0x157f, 0x017f, 0x027f,
-	0x037f, 0x0c7f, 0x0e7f, 0x0f7f, 0x007c, 0x047e, 0x027e, 0x017e,
-	0x2001, 0xa352, 0x2004, 0xd0c4, 0x0040, 0x28e8, 0xd0a4, 0x0040,
-	0x28e8, 0xa006, 0x2220, 0x8427, 0x2009, 0x0029, 0x1078, 0x9ec0,
-	0x017f, 0x027f, 0x047f, 0x007c, 0x017e, 0x027e, 0x037e, 0x0c7e,
-	0x7280, 0x82ff, 0x0040, 0x291a, 0xa290, 0xa352, 0x2214, 0xd2ac,
-	0x00c0, 0x291a, 0x2100, 0x1078, 0x24fa, 0x81ff, 0x0040, 0x291c,
-	0x2019, 0x0001, 0x8314, 0xa2e0, 0xa9c0, 0x2c04, 0xd384, 0x0040,
-	0x290e, 0xa084, 0xff00, 0x8007, 0x0078, 0x2910, 0xa084, 0x00ff,
-	0xa116, 0x0040, 0x291c, 0xa096, 0x00ff, 0x0040, 0x291a, 0x8318,
-	0x0078, 0x2902, 0xa085, 0x0001, 0x0c7f, 0x037f, 0x027f, 0x017f,
-	0x007c, 0x017e, 0x0c7e, 0x127e, 0x2091, 0x8000, 0xa180, 0xa434,
-	0x2004, 0xa065, 0x0040, 0x293b, 0x017e, 0x0c7e, 0x1078, 0x8ec0,
-	0x017f, 0x1040, 0x1328, 0x611a, 0x1078, 0x2813, 0x1078, 0x753d,
-	0x017f, 0x1078, 0x44bc, 0x127f, 0x0c7f, 0x017f, 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,
-	0xa381, 0x7003, 0x0002, 0xa006, 0x7012, 0x7016, 0x703a, 0x703e,
-	0x7033, 0xa391, 0x7037, 0xa391, 0x7007, 0x0001, 0x2061, 0xa3d1,
-	0x6003, 0x0002, 0x007c, 0x0090, 0x2a66, 0x0068, 0x2a66, 0x2071,
-	0xa381, 0x2b78, 0x7818, 0xd084, 0x00c0, 0x2a66, 0x2a60, 0x7820,
-	0xa08e, 0x0069, 0x00c0, 0x2b56, 0x0079, 0x2aea, 0x007c, 0x2071,
-	0xa381, 0x7004, 0x0079, 0x2a6c, 0x2a70, 0x2a71, 0x2a7b, 0x2a8d,
-	0x007c, 0x0090, 0x2a7a, 0x0068, 0x2a7a, 0x2b78, 0x7818, 0xd084,
-	0x0040, 0x2a99, 0x007c, 0x2b78, 0x2061, 0xa3d1, 0x6008, 0xa08e,
-	0x0100, 0x0040, 0x2a88, 0xa086, 0x0200, 0x0040, 0x2b4e, 0x007c,
-	0x7014, 0x2068, 0x2a60, 0x7018, 0x007a, 0x7010, 0x2068, 0x6834,
-	0xa086, 0x0103, 0x0040, 0x2a95, 0x007c, 0x2a60, 0x2b78, 0x7018,
-	0x007a, 0x2a60, 0x7820, 0xa08a, 0x0040, 0x00c8, 0x2aa2, 0x61b8,
-	0x0079, 0x2aaa, 0x2100, 0xa08a, 0x003f, 0x00c8, 0x2b4a, 0x61b8,
-	0x0079, 0x2aea, 0x2b2c, 0x2b5e, 0x2b66, 0x2b6a, 0x2b72, 0x2b78,
-	0x2b7c, 0x2b88, 0x2b8c, 0x2b96, 0x2b9a, 0x2b4a, 0x2b4a, 0x2b4a,
-	0x2b9e, 0x2b4a, 0x2bae, 0x2bc5, 0x2bdc, 0x2c58, 0x2c5d, 0x2c8a,
-	0x2ce4, 0x2cf5, 0x2d13, 0x2d54, 0x2d5e, 0x2d6b, 0x2d7e, 0x2d9d,
-	0x2da6, 0x2de3, 0x2de9, 0x2b4a, 0x2e05, 0x2b4a, 0x2b4a, 0x2b4a,
-	0x2b4a, 0x2b4a, 0x2e0c, 0x2e16, 0x2b4a, 0x2b4a, 0x2b4a, 0x2b4a,
-	0x2b4a, 0x2b4a, 0x2b4a, 0x2b4a, 0x2e1e, 0x2b4a, 0x2b4a, 0x2b4a,
-	0x2b4a, 0x2b4a, 0x2e30, 0x2e47, 0x2b4a, 0x2b4a, 0x2b4a, 0x2b4a,
-	0x2b4a, 0x2b4a, 0x2e59, 0x2eb0, 0x2f0e, 0x2f1f, 0x2b4a, 0x2b4a,
-	0x2b4a, 0x38f1, 0x2b4a, 0x2b4a, 0x2b4a, 0x2b4a, 0x2b4a, 0x2b4a,
-	0x2b4a, 0x2b4a, 0x2b96, 0x2b9a, 0x2f36, 0x2b4a, 0x2f43, 0x397d,
-	0x39da, 0x2b4a, 0x2b4a, 0x2b4a, 0x2b4a, 0x2b4a, 0x2b4a, 0x2b4a,
-	0x2b4a, 0x2b4a, 0x2f90, 0x30c5, 0x30e1, 0x30ed, 0x3150, 0x31a9,
-	0x31b4, 0x31f3, 0x3202, 0x3211, 0x3214, 0x2f47, 0x3238, 0x3284,
-	0x3291, 0x33a2, 0x34cd, 0x34f7, 0x3604, 0x3614, 0x3621, 0x365b,
-	0x372a, 0x2b4a, 0x2b4a, 0x2b4a, 0x2b4a, 0x3792, 0x37ae, 0x3828,
-	0x38e2, 0x713c, 0x0078, 0x2b2c, 0x2021, 0x4000, 0x1078, 0x3553,
-	0x127e, 0x2091, 0x8000, 0x0068, 0x2b39, 0x7818, 0xd084, 0x0040,
-	0x2b3c, 0x127f, 0x0078, 0x2b30, 0x7c22, 0x7926, 0x7a2a, 0x7b2e,
-	0x781b, 0x0001, 0x2091, 0x4080, 0x7007, 0x0001, 0x2091, 0x5000,
-	0x127f, 0x007c, 0x2021, 0x4001, 0x0078, 0x2b2e, 0x2021, 0x4002,
-	0x0078, 0x2b2e, 0x2021, 0x4003, 0x0078, 0x2b2e, 0x2021, 0x4005,
-	0x0078, 0x2b2e, 0x2021, 0x4006, 0x0078, 0x2b2e, 0xa02e, 0x2520,
-	0x7b28, 0x7a2c, 0x7824, 0x7930, 0x0078, 0x3562, 0x7823, 0x0004,
-	0x7824, 0x007a, 0xa02e, 0x2520, 0x7b28, 0x7a2c, 0x7824, 0x7930,
-	0x0078, 0x3566, 0x7924, 0x7828, 0x2114, 0x200a, 0x0078, 0x2b2c,
-	0x7924, 0x2114, 0x0078, 0x2b2c, 0x2099, 0x0009, 0x20a1, 0x0009,
-	0x20a9, 0x0007, 0x53a3, 0x7924, 0x7a28, 0x7b2c, 0x0078, 0x2b2c,
-	0x7824, 0x2060, 0x0078, 0x2ba0, 0x2009, 0x0001, 0x2011, 0x0013,
-	0x2019, 0x0010, 0x783b, 0x0017, 0x0078, 0x2b2c, 0x7d38, 0x7c3c,
-	0x0078, 0x2b60, 0x7d38, 0x7c3c, 0x0078, 0x2b6c, 0x2061, 0x1000,
-	0x610c, 0xa006, 0x2c14, 0xa200, 0x8c60, 0x8109, 0x00c0, 0x2ba2,
-	0x2010, 0xa005, 0x0040, 0x2b2c, 0x0078, 0x2b52, 0x2069, 0xa351,
-	0x7824, 0x7930, 0xa11a, 0x00c8, 0x2b5a, 0x8019, 0x0040, 0x2b5a,
-	0x684a, 0x6942, 0x782c, 0x6852, 0x7828, 0x6856, 0xa006, 0x685a,
-	0x685e, 0x1078, 0x4dbd, 0x0078, 0x2b2c, 0x2069, 0xa351, 0x7824,
-	0x7934, 0xa11a, 0x00c8, 0x2b5a, 0x8019, 0x0040, 0x2b5a, 0x684e,
-	0x6946, 0x782c, 0x6862, 0x7828, 0x6866, 0xa006, 0x686a, 0x686e,
-	0x1078, 0x494d, 0x0078, 0x2b2c, 0xa02e, 0x2520, 0x81ff, 0x00c0,
-	0x2b56, 0x7924, 0x7b28, 0x7a2c, 0x20a9, 0x0005, 0x20a1, 0xa388,
-	0x41a1, 0x1078, 0x3518, 0x0040, 0x2b56, 0x2009, 0x0020, 0x1078,
-	0x3562, 0x701b, 0x2bf4, 0x007c, 0x6834, 0x2008, 0xa084, 0x00ff,
-	0xa096, 0x0011, 0x0040, 0x2c00, 0xa096, 0x0019, 0x00c0, 0x2b56,
-	0x810f, 0xa18c, 0x00ff, 0x0040, 0x2b56, 0x710e, 0x700c, 0x8001,
-	0x0040, 0x2c31, 0x700e, 0x1078, 0x3518, 0x0040, 0x2b56, 0x2009,
-	0x0020, 0x2061, 0xa3d1, 0x6224, 0x6328, 0x642c, 0x6530, 0xa290,
-	0x0040, 0xa399, 0x0000, 0xa4a1, 0x0000, 0xa5a9, 0x0000, 0x1078,
-	0x3562, 0x701b, 0x2c24, 0x007c, 0x6834, 0xa084, 0x00ff, 0xa096,
-	0x0002, 0x0040, 0x2c2f, 0xa096, 0x000a, 0x00c0, 0x2b56, 0x0078,
-	0x2c06, 0x7010, 0x2068, 0x6838, 0xc0fd, 0x683a, 0x1078, 0x436e,
-	0x00c0, 0x2c3f, 0x7007, 0x0003, 0x701b, 0x2c41, 0x007c, 0x1078,
-	0x4a60, 0x127e, 0x2091, 0x8000, 0x20a9, 0x0005, 0x2099, 0xa388,
-	0x530a, 0x2100, 0xa210, 0xa399, 0x0000, 0xa4a1, 0x0000, 0xa5a9,
-	0x0000, 0xad80, 0x000d, 0x2009, 0x0020, 0x127f, 0x0078, 0x3566,
-	0x61a0, 0x7824, 0x60a2, 0x0078, 0x2b2c, 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, 0x2b56, 0x7924, 0x810f, 0xa18c,
-	0x00ff, 0x1078, 0x4501, 0x00c0, 0x2b5a, 0x7e38, 0xa684, 0x3fff,
-	0xa082, 0x4000, 0x0048, 0x2c9e, 0x0078, 0x2b5a, 0x7c28, 0x7d2c,
-	0x1078, 0x46d6, 0xd28c, 0x00c0, 0x2ca9, 0x1078, 0x466a, 0x0078,
-	0x2cab, 0x1078, 0x46a4, 0x00c0, 0x2cd5, 0x2061, 0xaa00, 0x127e,
-	0x2091, 0x8000, 0x6000, 0xa086, 0x0000, 0x0040, 0x2cc3, 0x6010,
-	0xa06d, 0x0040, 0x2cc3, 0x683c, 0xa406, 0x00c0, 0x2cc3, 0x6840,
-	0xa506, 0x0040, 0x2cce, 0x127f, 0xace0, 0x0010, 0x2001, 0xa315,
-	0x2004, 0xac02, 0x00c8, 0x2b56, 0x0078, 0x2caf, 0x1078, 0x8758,
-	0x127f, 0x0040, 0x2b56, 0x0078, 0x2b2c, 0xa00e, 0x2001, 0x0005,
-	0x1078, 0x4a60, 0x127e, 0x2091, 0x8000, 0x1078, 0x8cc0, 0x1078,
-	0x4982, 0x127f, 0x0078, 0x2b2c, 0x81ff, 0x00c0, 0x2b56, 0x1078,
-	0x3530, 0x0040, 0x2b5a, 0x1078, 0x45a7, 0x0040, 0x2b56, 0x1078,
-	0x46e4, 0x0040, 0x2b56, 0x0078, 0x2b2c, 0x81ff, 0x00c0, 0x2b56,
-	0x1078, 0x3542, 0x0040, 0x2b5a, 0x1078, 0x475f, 0x0040, 0x2b56,
-	0x2019, 0x0005, 0x1078, 0x4705, 0x0040, 0x2b56, 0x7828, 0xa08a,
-	0x1000, 0x00c8, 0x2b5a, 0x8003, 0x800b, 0x810b, 0xa108, 0x1078,
-	0x58e1, 0x0078, 0x2b2c, 0x127e, 0x2091, 0x8000, 0x81ff, 0x0040,
-	0x2d1d, 0x2009, 0x0001, 0x0078, 0x2d4e, 0x2029, 0x00ff, 0x644c,
-	0x2400, 0xa506, 0x0040, 0x2d48, 0x2508, 0x1078, 0x4501, 0x00c0,
-	0x2d48, 0x1078, 0x475f, 0x00c0, 0x2d33, 0x2009, 0x0002, 0x62a8,
-	0x2518, 0x0078, 0x2d4e, 0x2019, 0x0004, 0x1078, 0x4705, 0x00c0,
-	0x2d3d, 0x2009, 0x0006, 0x0078, 0x2d4e, 0x7824, 0xa08a, 0x1000,
-	0x00c8, 0x2d51, 0x8003, 0x800b, 0x810b, 0xa108, 0x1078, 0x58e1,
-	0x8529, 0x00c8, 0x2d20, 0x127f, 0x0078, 0x2b2c, 0x127f, 0x0078,
-	0x2b56, 0x127f, 0x0078, 0x2b5a, 0x1078, 0x3530, 0x0040, 0x2b5a,
-	0x1078, 0x461b, 0x1078, 0x46d6, 0x0078, 0x2b2c, 0x81ff, 0x00c0,
-	0x2b56, 0x1078, 0x3530, 0x0040, 0x2b5a, 0x1078, 0x460a, 0x1078,
-	0x46d6, 0x0078, 0x2b2c, 0x81ff, 0x00c0, 0x2b56, 0x1078, 0x3530,
-	0x0040, 0x2b5a, 0x1078, 0x46a7, 0x0040, 0x2b56, 0x1078, 0x43c1,
-	0x1078, 0x4663, 0x1078, 0x46d6, 0x0078, 0x2b2c, 0x1078, 0x3530,
-	0x0040, 0x2b5a, 0x1078, 0x45a7, 0x0040, 0x2b56, 0x62a0, 0x2019,
-	0x0005, 0x0c7e, 0x1078, 0x471b, 0x0c7f, 0x1078, 0x5d53, 0x077e,
-	0x2039, 0x0000, 0x1078, 0x5c78, 0x2009, 0x0000, 0x1078, 0x9c38,
-	0x077f, 0x1078, 0x46d6, 0x0078, 0x2b2c, 0x1078, 0x3530, 0x0040,
-	0x2b5a, 0x1078, 0x46d6, 0x2208, 0x0078, 0x2b2c, 0x157e, 0x0d7e,
-	0x0e7e, 0x2069, 0xa413, 0x6810, 0x6914, 0xa10a, 0x00c8, 0x2db2,
-	0x2009, 0x0000, 0x6816, 0x2011, 0x0000, 0x2019, 0x0000, 0x20a9,
-	0x00ff, 0x2069, 0xa434, 0x2d04, 0xa075, 0x0040, 0x2dc7, 0x704c,
-	0x1078, 0x2dd1, 0xa210, 0x7080, 0x1078, 0x2dd1, 0xa318, 0x8d68,
-	0x00f0, 0x2dbb, 0x2300, 0xa218, 0x0e7f, 0x0d7f, 0x157f, 0x0078,
-	0x2b2c, 0x0f7e, 0x017e, 0xa07d, 0x0040, 0x2de0, 0x2001, 0x0000,
-	0x8000, 0x2f0c, 0x81ff, 0x0040, 0x2de0, 0x2178, 0x0078, 0x2dd8,
-	0x017f, 0x0f7f, 0x007c, 0x2069, 0xa413, 0x6910, 0x62a4, 0x0078,
-	0x2b2c, 0x81ff, 0x00c0, 0x2b56, 0x614c, 0xa190, 0x293f, 0x2214,
-	0xa294, 0x00ff, 0x606c, 0xa084, 0xff00, 0xa215, 0x6368, 0x67c8,
-	0xd79c, 0x0040, 0x2dff, 0x2031, 0x0001, 0x0078, 0x2e01, 0x2031,
-	0x0000, 0x7e3a, 0x7f3e, 0x0078, 0x2b2c, 0x613c, 0x6240, 0x2019,
-	0xa5a0, 0x231c, 0x0078, 0x2b2c, 0x127e, 0x2091, 0x8000, 0x6134,
-	0xa006, 0x2010, 0x2018, 0x127f, 0x0078, 0x2b2c, 0x1078, 0x3542,
-	0x0040, 0x2b5a, 0x6244, 0x6338, 0x0078, 0x2b2c, 0x613c, 0x6240,
-	0x7824, 0x603e, 0x7b28, 0x6342, 0x2069, 0xa351, 0x831f, 0xa305,
-	0x6816, 0x782c, 0x2069, 0xa5a0, 0x2d1c, 0x206a, 0x0078, 0x2b2c,
-	0x017e, 0x127e, 0x2091, 0x8000, 0x7824, 0x6036, 0xd094, 0x0040,
-	0x2e43, 0x7828, 0xa085, 0x0001, 0x2009, 0xa5a9, 0x200a, 0x2001,
-	0xffff, 0x1078, 0x5975, 0x127f, 0x017f, 0x0078, 0x2b2c, 0x1078,
-	0x3542, 0x0040, 0x2b5a, 0x7828, 0xa00d, 0x0040, 0x2b5a, 0x782c,
-	0xa005, 0x0040, 0x2b5a, 0x6244, 0x6146, 0x6338, 0x603a, 0x0078,
-	0x2b2c, 0x2001, 0xa300, 0x2004, 0xa086, 0x0003, 0x00c0, 0x2b56,
-	0x0c7e, 0x2061, 0x0100, 0x7924, 0x810f, 0xa18c, 0x00ff, 0xa196,
-	0x00ff, 0x00c0, 0x2e70, 0x6030, 0xa085, 0xff00, 0x0078, 0x2e7f,
-	0xa182, 0x007f, 0x00c8, 0x2ea9, 0xa188, 0x293f, 0x210c, 0xa18c,
-	0x00ff, 0x6030, 0xa116, 0x0040, 0x2ea9, 0x810f, 0xa105, 0x127e,
-	0x2091, 0x8000, 0x007e, 0x1078, 0x74d7, 0x007f, 0x0040, 0x2ea5,
-	0x601a, 0x600b, 0xbc09, 0x601f, 0x0001, 0x1078, 0x3518, 0x0040,
-	0x2eac, 0x6837, 0x0000, 0x7007, 0x0003, 0x6833, 0x0000, 0x6838,
-	0xc0fd, 0x683a, 0x701b, 0x2f07, 0x2d00, 0x6012, 0x2009, 0x0032,
-	0x1078, 0x756c, 0x127f, 0x0c7f, 0x007c, 0x127f, 0x0c7f, 0x0078,
-	0x2b56, 0x0c7f, 0x0078, 0x2b5a, 0x1078, 0x753d, 0x0078, 0x2ea5,
-	0x2001, 0xa300, 0x2004, 0xa086, 0x0003, 0x00c0, 0x2b56, 0x0c7e,
-	0x2061, 0x0100, 0x7924, 0x810f, 0xa18c, 0x00ff, 0xa196, 0x00ff,
-	0x00c0, 0x2ec7, 0x6030, 0xa085, 0xff00, 0x0078, 0x2ed6, 0xa182,
-	0x007f, 0x00c8, 0x2f00, 0xa188, 0x293f, 0x210c, 0xa18c, 0x00ff,
-	0x6030, 0xa116, 0x0040, 0x2f00, 0x810f, 0xa105, 0x127e, 0x2091,
-	0x8000, 0x007e, 0x1078, 0x74d7, 0x007f, 0x0040, 0x2efc, 0x601a,
-	0x600b, 0xbc05, 0x601f, 0x0001, 0x1078, 0x3518, 0x0040, 0x2f03,
-	0x6837, 0x0000, 0x7007, 0x0003, 0x6833, 0x0000, 0x6838, 0xc0fd,
-	0x683a, 0x701b, 0x2f07, 0x2d00, 0x6012, 0x2009, 0x0032, 0x1078,
-	0x756c, 0x127f, 0x0c7f, 0x007c, 0x127f, 0x0c7f, 0x0078, 0x2b56,
-	0x0c7f, 0x0078, 0x2b5a, 0x1078, 0x753d, 0x0078, 0x2efc, 0x6830,
-	0xa086, 0x0100, 0x0040, 0x2b56, 0x0078, 0x2b2c, 0x2061, 0xa62d,
-	0x127e, 0x2091, 0x8000, 0x6000, 0xd084, 0x0040, 0x2f1c, 0x6104,
-	0x6208, 0x127f, 0x0078, 0x2b2c, 0x127f, 0x0078, 0x2b5a, 0x81ff,
-	0x00c0, 0x2b56, 0x127e, 0x2091, 0x8000, 0x6244, 0x6060, 0xa202,
-	0x0048, 0x2f33, 0xa085, 0x0001, 0x1078, 0x2500, 0x1078, 0x3bf5,
-	0x127f, 0x0078, 0x2b2c, 0x127f, 0x0078, 0x2b5a, 0x127e, 0x2091,
-	0x8000, 0x20a9, 0x0011, 0x2001, 0xa340, 0x20a0, 0xa006, 0x40a4,
-	0x127f, 0x0078, 0x2b2c, 0x7d38, 0x7c3c, 0x0078, 0x2bde, 0x7824,
-	0xa09c, 0x00ff, 0xa39a, 0x0003, 0x00c8, 0x2b56, 0x624c, 0xa084,
-	0xff00, 0x8007, 0xa206, 0x00c0, 0x2f5f, 0x2001, 0xa340, 0x2009,
-	0x000c, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x0078, 0x3566, 0x81ff,
-	0x00c0, 0x2b56, 0x1078, 0x3542, 0x0040, 0x2b5a, 0x6004, 0xa084,
-	0x00ff, 0xa086, 0x0006, 0x00c0, 0x2b56, 0x0c7e, 0x1078, 0x3518,
-	0x0c7f, 0x0040, 0x2b56, 0x6837, 0x0000, 0x6838, 0xc0fd, 0x683a,
-	0x1078, 0x8b85, 0x0040, 0x2b56, 0x7007, 0x0003, 0x701b, 0x2f81,
-	0x007c, 0x6830, 0xa086, 0x0100, 0x0040, 0x2b56, 0xad80, 0x000e,
-	0x2009, 0x000c, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x0078, 0x3566,
-	0x1078, 0x3518, 0x0040, 0x2b56, 0x1078, 0x421a, 0x2009, 0x001c,
-	0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x1078, 0x3562, 0x701b, 0x2fa1,
-	0x007c, 0xade8, 0x000d, 0x6800, 0xa005, 0x0040, 0x2b5a, 0x6804,
-	0xd0ac, 0x0040, 0x2fae, 0xd0a4, 0x0040, 0x2b5a, 0xd094, 0x0040,
-	0x2fb9, 0x0c7e, 0x2061, 0x0100, 0x6104, 0xa18c, 0xffdf, 0x6106,
-	0x0c7f, 0xd08c, 0x0040, 0x2fc4, 0x0c7e, 0x2061, 0x0100, 0x6104,
-	0xa18d, 0x0010, 0x6106, 0x0c7f, 0x2009, 0x0100, 0x210c, 0xa18a,
-	0x0002, 0x0048, 0x2fd9, 0xd084, 0x0040, 0x2fd9, 0x6a28, 0xa28a,
-	0x007f, 0x00c8, 0x2b5a, 0xa288, 0x293f, 0x210c, 0xa18c, 0x00ff,
-	0x6152, 0xd0dc, 0x0040, 0x2fe2, 0x6828, 0xa08a, 0x007f, 0x00c8,
-	0x2b5a, 0x604e, 0x6808, 0xa08a, 0x0100, 0x0048, 0x2b5a, 0xa08a,
-	0x0841, 0x00c8, 0x2b5a, 0xa084, 0x0007, 0x00c0, 0x2b5a, 0x680c,
-	0xa005, 0x0040, 0x2b5a, 0x6810, 0xa005, 0x0040, 0x2b5a, 0x6848,
-	0x6940, 0xa10a, 0x00c8, 0x2b5a, 0x8001, 0x0040, 0x2b5a, 0x684c,
-	0x6944, 0xa10a, 0x00c8, 0x2b5a, 0x8001, 0x0040, 0x2b5a, 0x6804,
-	0xd0fc, 0x0040, 0x3038, 0x1078, 0x3518, 0x0040, 0x2b56, 0x2009,
-	0x0014, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0xa290, 0x0038, 0xa399,
-	0x0000, 0x1078, 0x3562, 0x701b, 0x301e, 0x007c, 0xade8, 0x000d,
-	0x20a9, 0x0014, 0x2d98, 0x2069, 0xa36d, 0x2da0, 0x53a3, 0x7010,
-	0xa0e8, 0x000d, 0x2001, 0xa371, 0x200c, 0xd1e4, 0x0040, 0x3038,
-	0x0c7e, 0x2061, 0x0100, 0x6004, 0xa085, 0x0b00, 0x6006, 0x0c7f,
-	0x20a9, 0x001c, 0x2d98, 0x2069, 0xa351, 0x2da0, 0x53a3, 0x6814,
-	0xa08c, 0x00ff, 0x613e, 0x8007, 0xa084, 0x00ff, 0x6042, 0x1078,
-	0x4dbd, 0x1078, 0x48dd, 0x1078, 0x494d, 0x6000, 0xa086, 0x0000,
-	0x00c0, 0x30c3, 0x6808, 0x602a, 0x1078, 0x218b, 0x6818, 0x691c,
-	0x6a20, 0x6b24, 0x8007, 0x810f, 0x8217, 0x831f, 0x6016, 0x611a,
-	0x621e, 0x6322, 0x6c04, 0xd4f4, 0x0040, 0x3070, 0x6830, 0x6934,
-	0x6a38, 0x6b3c, 0x8007, 0x810f, 0x8217, 0x831f, 0x0078, 0x3072,
-	0xa084, 0xf0ff, 0x6006, 0x610a, 0x620e, 0x6312, 0x1078, 0x59a8,
-	0x6904, 0xd1fc, 0x0040, 0x30a5, 0x0c7e, 0x2009, 0x0000, 0x20a9,
-	0x0001, 0x6b70, 0xd384, 0x0040, 0x30a2, 0x0078, 0x308c, 0x839d,
-	0x00c8, 0x30a2, 0x3508, 0x8109, 0x1078, 0x5364, 0x6878, 0x6016,
-	0x6874, 0x2008, 0xa084, 0xff00, 0x8007, 0x600a, 0xa184, 0x00ff,
-	0x6006, 0x8108, 0x00c0, 0x30a0, 0x6003, 0x0003, 0x0078, 0x30a2,
-	0x6003, 0x0001, 0x00f0, 0x3087, 0x0c7f, 0x0c7e, 0x2061, 0x0100,
-	0x602f, 0x0040, 0x602f, 0x0000, 0x0c7f, 0x1078, 0x3784, 0x0040,
-	0x30b3, 0x1078, 0x2500, 0x60bc, 0xa005, 0x0040, 0x30bf, 0x6003,
-	0x0001, 0x2091, 0x301d, 0x1078, 0x4171, 0x0078, 0x30c3, 0x6003,
-	0x0004, 0x2091, 0x301d, 0x0078, 0x2b2c, 0x6000, 0xa086, 0x0000,
-	0x0040, 0x2b56, 0x2069, 0xa351, 0x7830, 0x6842, 0x7834, 0x6846,
-	0x6804, 0xd0fc, 0x0040, 0x30d8, 0x2009, 0x0030, 0x0078, 0x30da,
-	0x2009, 0x001c, 0x2d00, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x0078,
-	0x3566, 0xa006, 0x1078, 0x2500, 0x81ff, 0x00c0, 0x2b56, 0x1078,
-	0x421a, 0x1078, 0x4171, 0x0078, 0x2b2c, 0x81ff, 0x00c0, 0x2b56,
-	0x6180, 0x81ff, 0x0040, 0x3107, 0x703f, 0x0000, 0x2001, 0xa9c0,
-	0x2009, 0x0040, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x127e, 0x2091,
-	0x8000, 0x1078, 0x3566, 0x701b, 0x2b29, 0x127f, 0x007c, 0x703f,
-	0x0001, 0x0d7e, 0x2069, 0xa9c0, 0x20a9, 0x0040, 0x20a1, 0xa9c0,
-	0x2019, 0xffff, 0x43a4, 0x654c, 0xa588, 0x293f, 0x210c, 0xa18c,
-	0x00ff, 0x216a, 0xa00e, 0x2011, 0x0002, 0x2100, 0xa506, 0x0040,
-	0x3139, 0x1078, 0x4501, 0x00c0, 0x3139, 0x6014, 0x821c, 0x0048,
-	0x3131, 0xa398, 0xa9c0, 0xa085, 0xff00, 0x8007, 0x201a, 0x0078,
-	0x3138, 0xa398, 0xa9c0, 0x2324, 0xa4a4, 0xff00, 0xa405, 0x201a,
-	0x8210, 0x8108, 0xa182, 0x0080, 0x00c8, 0x3140, 0x0078, 0x311d,
-	0x8201, 0x8007, 0x2d0c, 0xa105, 0x206a, 0x0d7f, 0x20a9, 0x0040,
-	0x20a1, 0xa9c0, 0x2099, 0xa9c0, 0x1078, 0x41be, 0x0078, 0x30f6,
-	0x1078, 0x3542, 0x0040, 0x2b5a, 0x0c7e, 0x1078, 0x3518, 0x0c7f,
-	0x00c0, 0x315e, 0x2009, 0x0002, 0x0078, 0x2b56, 0x2001, 0xa352,
-	0x2004, 0xd0b4, 0x0040, 0x3185, 0x6000, 0xd08c, 0x00c0, 0x3185,
-	0x6004, 0xa084, 0x00ff, 0xa086, 0x0006, 0x00c0, 0x3185, 0x6837,
-	0x0000, 0x6838, 0xc0fd, 0x683a, 0x1078, 0x8bd9, 0x00c0, 0x317c,
-	0x2009, 0x0003, 0x0078, 0x2b56, 0x7007, 0x0003, 0x701b, 0x3181,
-	0x007c, 0x1078, 0x3542, 0x0040, 0x2b5a, 0x20a9, 0x002b, 0x2c98,
-	0xade8, 0x0002, 0x2da0, 0x53a3, 0x20a9, 0x0004, 0xac80, 0x0006,
-	0x2098, 0xad80, 0x0006, 0x20a0, 0x1078, 0x41be, 0x20a9, 0x0004,
-	0xac80, 0x000a, 0x2098, 0xad80, 0x000a, 0x20a0, 0x1078, 0x41be,
-	0x2d00, 0x2009, 0x002b, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x0078,
-	0x3566, 0x81ff, 0x00c0, 0x2b56, 0x1078, 0x3530, 0x0040, 0x2b5a,
-	0x1078, 0x46ef, 0x0078, 0x2b2c, 0x81ff, 0x00c0, 0x2b56, 0x7828,
-	0xa08a, 0x1000, 0x00c8, 0x2b5a, 0x1078, 0x3542, 0x0040, 0x2b5a,
-	0x1078, 0x475f, 0x0040, 0x2b56, 0x2019, 0x0004, 0x1078, 0x4705,
-	0x7924, 0x810f, 0x7a28, 0x1078, 0x31cf, 0x0078, 0x2b2c, 0xa186,
-	0x00ff, 0x0040, 0x31d7, 0x1078, 0x31e7, 0x0078, 0x31e6, 0x2029,
-	0x007e, 0x2061, 0xa300, 0x644c, 0x2400, 0xa506, 0x0040, 0x31e3,
-	0x2508, 0x1078, 0x31e7, 0x8529, 0x00c8, 0x31dc, 0x007c, 0x1078,
-	0x4501, 0x00c0, 0x31f2, 0x2200, 0x8003, 0x800b, 0x810b, 0xa108,
-	0x1078, 0x58e1, 0x007c, 0x81ff, 0x00c0, 0x2b56, 0x1078, 0x3530,
-	0x0040, 0x2b5a, 0x1078, 0x45a7, 0x0040, 0x2b56, 0x1078, 0x46fa,
-	0x0078, 0x2b2c, 0x81ff, 0x00c0, 0x2b56, 0x1078, 0x3530, 0x0040,
-	0x2b5a, 0x1078, 0x45a7, 0x0040, 0x2b56, 0x1078, 0x46e4, 0x0078,
-	0x2b2c, 0x6100, 0x0078, 0x2b2c, 0x1078, 0x3542, 0x0040, 0x2b5a,
-	0x2001, 0xa300, 0x2004, 0xa086, 0x0003, 0x00c0, 0x2b56, 0x0d7e,
-	0xace8, 0x000a, 0x7924, 0xd184, 0x0040, 0x3228, 0xace8, 0x0006,
-	0x680c, 0x8007, 0x783e, 0x6808, 0x8007, 0x783a, 0x6b04, 0x831f,
-	0x6a00, 0x8217, 0x0d7f, 0x6100, 0xa18c, 0x0200, 0x0078, 0x2b2c,
-	0xa006, 0x1078, 0x2500, 0x7824, 0xa084, 0x00ff, 0xa086, 0x00ff,
-	0x0040, 0x3245, 0x81ff, 0x00c0, 0x2b56, 0x1078, 0x421a, 0x7828,
-	0xa08a, 0x1000, 0x00c8, 0x2b5a, 0x7924, 0xa18c, 0xff00, 0x810f,
-	0xa186, 0x00ff, 0x0040, 0x325b, 0xa182, 0x007f, 0x00c8, 0x2b5a,
-	0x2100, 0x1078, 0x24fa, 0x027e, 0x0c7e, 0x127e, 0x2091, 0x8000,
-	0x2061, 0xa5be, 0x601b, 0x0000, 0x601f, 0x0000, 0x2061, 0x0100,
-	0x6030, 0xa084, 0x00ff, 0x810f, 0xa105, 0x604a, 0x6043, 0x0090,
-	0x6043, 0x0010, 0x2009, 0x002d, 0x2011, 0x4196, 0x1078, 0x596c,
-	0x7924, 0xa18c, 0xff00, 0x810f, 0x7a28, 0x1078, 0x31cf, 0x127f,
-	0x0c7f, 0x027f, 0x0078, 0x2b2c, 0x7924, 0xa18c, 0xff00, 0x810f,
-	0x0c7e, 0x1078, 0x4499, 0x2c08, 0x0c7f, 0x00c0, 0x2b5a, 0x0078,
-	0x2b2c, 0x81ff, 0x0040, 0x3298, 0x2009, 0x0001, 0x0078, 0x2b56,
-	0x60c8, 0xd09c, 0x00c0, 0x32a0, 0x2009, 0x0005, 0x0078, 0x2b56,
-	0x1078, 0x3518, 0x00c0, 0x32a8, 0x2009, 0x0002, 0x0078, 0x2b56,
-	0x7924, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x1078, 0x3562, 0x701b,
-	0x32b2, 0x007c, 0x2009, 0x0080, 0x1078, 0x4501, 0x00c0, 0x32bf,
-	0x6004, 0xa084, 0x00ff, 0xa086, 0x0006, 0x0040, 0x32c3, 0x2021,
-	0x400a, 0x0078, 0x2b2e, 0x0d7e, 0xade8, 0x000d, 0x6900, 0x6a08,
-	0x6b0c, 0x6c10, 0x6d14, 0x6e18, 0x6820, 0xa0be, 0x0100, 0x0040,
-	0x3336, 0xa0be, 0x0112, 0x0040, 0x3336, 0xa0be, 0x0113, 0x0040,
-	0x3336, 0xa0be, 0x0114, 0x0040, 0x3336, 0xa0be, 0x0117, 0x0040,
-	0x3336, 0xa0be, 0x011a, 0x0040, 0x3336, 0xa0be, 0x0121, 0x0040,
-	0x332c, 0xa0be, 0x0131, 0x0040, 0x332c, 0xa0be, 0x0171, 0x0040,
-	0x3336, 0xa0be, 0x0173, 0x0040, 0x3336, 0xa0be, 0x01a1, 0x00c0,
-	0x32fe, 0x6830, 0x8007, 0x6832, 0x0078, 0x333c, 0xa0be, 0x0212,
-	0x0040, 0x3332, 0xa0be, 0x0213, 0x0040, 0x3332, 0xa0be, 0x0214,
-	0x0040, 0x3324, 0xa0be, 0x0217, 0x0040, 0x331e, 0xa0be, 0x021a,
-	0x00c0, 0x3317, 0x6838, 0x8007, 0x683a, 0x0078, 0x3336, 0xa0be,
-	0x0300, 0x0040, 0x3336, 0x0d7f, 0x0078, 0x2b5a, 0xad80, 0x0010,
-	0x20a9, 0x0007, 0x1078, 0x337e, 0xad80, 0x000e, 0x20a9, 0x0001,
-	0x1078, 0x337e, 0x0078, 0x3336, 0xad80, 0x000c, 0x1078, 0x338c,
-	0x0078, 0x333c, 0xad80, 0x000e, 0x1078, 0x338c, 0xad80, 0x000c,
-	0x20a9, 0x0001, 0x1078, 0x337e, 0x0c7e, 0x1078, 0x3518, 0x0040,
-	0x336f, 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, 0x8ba1, 0x00c0, 0x336a, 0x2009, 0x0003,
-	0x0078, 0x2b56, 0x7007, 0x0003, 0x701b, 0x3375, 0x007c, 0x0c7f,
-	0x0d7f, 0x2009, 0x0002, 0x0078, 0x2b56, 0x6820, 0xa086, 0x8001,
-	0x00c0, 0x2b2c, 0x2009, 0x0004, 0x0078, 0x2b56, 0x017e, 0x2008,
-	0x2044, 0x8000, 0x204c, 0x8000, 0x290a, 0x8108, 0x280a, 0x8108,
-	0x00f0, 0x3380, 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, 0x33a9, 0x2009, 0x0001, 0x0078,
-	0x2b56, 0x7924, 0x2140, 0xa18c, 0xff00, 0x810f, 0xa182, 0x0080,
-	0x0048, 0x2b5a, 0xa182, 0x00ff, 0x00c8, 0x2b5a, 0x7a2c, 0x7b28,
-	0x6068, 0xa306, 0x00c0, 0x33c4, 0x606c, 0xa24e, 0x0040, 0x2b5a,
-	0xa9cc, 0xff00, 0x0040, 0x2b5a, 0x0c7e, 0x1078, 0x346d, 0x2c68,
-	0x0c7f, 0x0040, 0x33fc, 0xa0c6, 0x4000, 0x00c0, 0x33e2, 0x0c7e,
-	0x007e, 0x2d60, 0x2009, 0x0000, 0x1078, 0x47cb, 0x00c0, 0x33d9,
-	0xc185, 0x6000, 0xd0bc, 0x0040, 0x33de, 0xc18d, 0x007f, 0x0c7f,
-	0x0078, 0x33f9, 0xa0c6, 0x4007, 0x00c0, 0x33e9, 0x2408, 0x0078,
-	0x33f9, 0xa0c6, 0x4008, 0x00c0, 0x33f1, 0x2708, 0x2610, 0x0078,
-	0x33f9, 0xa0c6, 0x4009, 0x00c0, 0x33f7, 0x0078, 0x33f9, 0x2001,
-	0x4006, 0x2020, 0x0078, 0x2b2e, 0x2d00, 0x7022, 0x017e, 0x0b7e,
-	0x0c7e, 0x0e7e, 0x2c70, 0x1078, 0x74d7, 0x0040, 0x3442, 0x2d00,
-	0x601a, 0x2001, 0xa356, 0x2004, 0xa084, 0x00ff, 0x6842, 0x2e58,
-	0x0e7f, 0x0e7e, 0x0c7e, 0x1078, 0x3518, 0x0c7f, 0x2b70, 0x00c0,
-	0x3423, 0x1078, 0x753d, 0x0e7f, 0x0c7f, 0x0b7f, 0x017f, 0x2009,
-	0x0002, 0x0078, 0x2b56, 0x6837, 0x0000, 0x2d00, 0x6012, 0x6833,
-	0x0000, 0x6838, 0xc0fd, 0x683a, 0x127e, 0x2091, 0x8000, 0x1078,
-	0x2813, 0x127f, 0x601f, 0x0001, 0x2001, 0x0000, 0x1078, 0x442b,
-	0x2001, 0x0002, 0x1078, 0x443f, 0x2009, 0x0002, 0x1078, 0x756c,
-	0xa085, 0x0001, 0x0e7f, 0x0c7f, 0x0b7f, 0x017f, 0x00c0, 0x344c,
-	0x2009, 0x0003, 0x0078, 0x2b56, 0x7007, 0x0003, 0x701b, 0x3451,
-	0x007c, 0x6830, 0xa086, 0x0100, 0x7020, 0x2060, 0x00c0, 0x345f,
-	0x2009, 0x0004, 0x6204, 0xa294, 0x00ff, 0x0078, 0x2b56, 0x2009,
-	0x0000, 0x1078, 0x47cb, 0x00c0, 0x3466, 0xc185, 0x6000, 0xd0bc,
-	0x0040, 0x346b, 0xc18d, 0x0078, 0x2b2c, 0x0e7e, 0x0d7e, 0x2029,
-	0x0000, 0x2021, 0x0080, 0x20a9, 0x007f, 0x2071, 0xa4b4, 0x2e04,
-	0xa005, 0x00c0, 0x3482, 0x2100, 0xa406, 0x00c0, 0x34b3, 0x2428,
-	0x0078, 0x34b3, 0x2068, 0x6f10, 0x2700, 0xa306, 0x00c0, 0x34a4,
-	0x6e14, 0x2600, 0xa206, 0x00c0, 0x34a4, 0x2400, 0xa106, 0x00c0,
-	0x34a0, 0x2d60, 0xd884, 0x0040, 0x34c8, 0x6004, 0xa084, 0x00ff,
-	0xa086, 0x0006, 0x00c0, 0x34c8, 0x2001, 0x4000, 0x0078, 0x34c9,
-	0x2001, 0x4007, 0x0078, 0x34c9, 0x2400, 0xa106, 0x00c0, 0x34b3,
-	0x6e14, 0x87ff, 0x00c0, 0x34af, 0x86ff, 0x0040, 0x347f, 0x2001,
-	0x4008, 0x0078, 0x34c9, 0x8420, 0x8e70, 0x00f0, 0x3477, 0x85ff,
-	0x00c0, 0x34c2, 0x2001, 0x4009, 0x0078, 0x34c9, 0x2001, 0x0001,
-	0x0078, 0x34c9, 0x1078, 0x4499, 0x00c0, 0x34be, 0x6312, 0x6216,
-	0xa006, 0xa005, 0x0d7f, 0x0e7f, 0x007c, 0x81ff, 0x00c0, 0x2b56,
-	0x1078, 0x3518, 0x0040, 0x2b56, 0x6837, 0x0000, 0x6838, 0xc0fd,
-	0x683a, 0x7824, 0xa005, 0x0040, 0x2b5a, 0xa096, 0x00ff, 0x0040,
-	0x34e5, 0xa092, 0x0004, 0x00c8, 0x2b5a, 0x2010, 0x2d18, 0x1078,
-	0x27c2, 0x0040, 0x2b56, 0x7007, 0x0003, 0x701b, 0x34f0, 0x007c,
-	0x6830, 0xa086, 0x0100, 0x0040, 0x2b56, 0x0078, 0x2b2c, 0x7924,
-	0xa18c, 0xff00, 0x810f, 0xa182, 0x0080, 0x0048, 0x2b5a, 0xa182,
-	0x00ff, 0x00c8, 0x2b5a, 0x127e, 0x2091, 0x8000, 0x1078, 0x8a89,
-	0x00c0, 0x3515, 0xa190, 0xa434, 0x2204, 0xa065, 0x0040, 0x3515,
-	0x1078, 0x4235, 0x127f, 0x0078, 0x2b2c, 0x127f, 0x0078, 0x2b56,
-	0x1078, 0x1381, 0x0040, 0x352f, 0xa006, 0x6802, 0x7010, 0xa005,
-	0x00c0, 0x3527, 0x2d00, 0x7012, 0x7016, 0x0078, 0x352d, 0x7014,
-	0x6802, 0x2060, 0x2d00, 0x6006, 0x7016, 0xad80, 0x000d, 0x007c,
-	0x7924, 0x810f, 0xa18c, 0x00ff, 0x1078, 0x4501, 0x00c0, 0x353f,
-	0x7e28, 0xa684, 0x3fff, 0xa082, 0x4000, 0x0048, 0x3540, 0xa066,
-	0x8cff, 0x007c, 0x7e24, 0x860f, 0xa18c, 0x00ff, 0x1078, 0x4501,
-	0x00c0, 0x3550, 0xa6b4, 0x00ff, 0xa682, 0x4000, 0x0048, 0x3551,
-	0xa066, 0x8cff, 0x007c, 0x017e, 0x7110, 0x81ff, 0x0040, 0x355e,
-	0x2168, 0x6904, 0x1078, 0x139a, 0x0078, 0x3555, 0x7112, 0x7116,
-	0x017f, 0x007c, 0x2031, 0x0001, 0x0078, 0x3568, 0x2031, 0x0000,
-	0x2061, 0xa3d1, 0x6606, 0x6112, 0x600e, 0x6226, 0x632a, 0x642e,
-	0x6532, 0x2c10, 0x1078, 0x13d1, 0x7007, 0x0002, 0x701b, 0x2b2c,
-	0x007c, 0x0f7e, 0x127e, 0x2091, 0x8000, 0x2079, 0x0000, 0x2001,
-	0xa38f, 0x2004, 0xa005, 0x00c0, 0x3594, 0x0068, 0x3594, 0x7818,
-	0xd084, 0x00c0, 0x3594, 0x7a22, 0x7b26, 0x7c2a, 0x781b, 0x0001,
-	0x2091, 0x4080, 0x0078, 0x35b9, 0x017e, 0x0c7e, 0x0e7e, 0x2071,
-	0xa381, 0x7138, 0xa182, 0x0008, 0x0048, 0x35a2, 0x7030, 0x2060,
-	0x0078, 0x35b3, 0x7030, 0xa0e0, 0x0008, 0xac82, 0xa3d1, 0x0048,
-	0x35ab, 0x2061, 0xa391, 0x2c00, 0x7032, 0x81ff, 0x00c0, 0x35b1,
-	0x7036, 0x8108, 0x713a, 0x2262, 0x6306, 0x640a, 0x0e7f, 0x0c7f,
-	0x017f, 0x127f, 0x0f7f, 0x007c, 0x0e7e, 0x2071, 0xa381, 0x7038,
-	0xa005, 0x0040, 0x35f5, 0x127e, 0x2091, 0x8000, 0x0068, 0x35f4,
-	0x0f7e, 0x2079, 0x0000, 0x7818, 0xd084, 0x00c0, 0x35f3, 0x0c7e,
-	0x7034, 0x2060, 0x2c04, 0x7822, 0x6004, 0x7826, 0x6008, 0x782a,
-	0x781b, 0x0001, 0x2091, 0x4080, 0x7038, 0x8001, 0x703a, 0xa005,
-	0x00c0, 0x35e9, 0x7033, 0xa391, 0x7037, 0xa391, 0x0c7f, 0x0078,
-	0x35f3, 0xac80, 0x0008, 0xa0fa, 0xa3d1, 0x0048, 0x35f1, 0x2001,
-	0xa391, 0x7036, 0x0c7f, 0x0f7f, 0x127f, 0x0e7f, 0x007c, 0x027e,
-	0x2001, 0xa352, 0x2004, 0xd0c4, 0x0040, 0x3602, 0x2011, 0x8014,
-	0x1078, 0x3579, 0x027f, 0x007c, 0x81ff, 0x00c0, 0x2b56, 0x127e,
-	0x2091, 0x8000, 0x6030, 0xc08d, 0xc085, 0xc0ac, 0x6032, 0x1078,
-	0x4171, 0x127f, 0x0078, 0x2b2c, 0x7824, 0x2008, 0xa18c, 0xfffd,
-	0x00c0, 0x361f, 0x61d4, 0xa10d, 0x61d6, 0x0078, 0x2b2c, 0x0078,
-	0x2b5a, 0x81ff, 0x00c0, 0x2b56, 0x6000, 0xa086, 0x0003, 0x00c0,
-	0x2b56, 0x2001, 0xa352, 0x2004, 0xd0ac, 0x00c0, 0x2b56, 0x1078,
-	0x3542, 0x0040, 0x2b5a, 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006,
-	0x00c0, 0x363e, 0x7828, 0xa005, 0x0040, 0x2b2c, 0x0c7e, 0x1078,
-	0x3518, 0x0c7f, 0x0040, 0x2b56, 0x6837, 0x0000, 0x6833, 0x0000,
-	0x6838, 0xc0fd, 0x683a, 0x1078, 0x8c4d, 0x0040, 0x2b56, 0x7007,
-	0x0003, 0x701b, 0x3654, 0x007c, 0x6830, 0xa086, 0x0100, 0x0040,
-	0x2b56, 0x0078, 0x2b2c, 0x2001, 0xa300, 0x2004, 0xa086, 0x0003,
-	0x00c0, 0x2b56, 0x7f24, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x1078,
-	0x3518, 0x0040, 0x2b56, 0x2009, 0x0000, 0x2031, 0x0000, 0x7023,
-	0x0000, 0x702f, 0x0000, 0xad80, 0x0005, 0x7026, 0x20a0, 0x1078,
-	0x4501, 0x00c0, 0x36d8, 0x6004, 0xa0c4, 0x00ff, 0xa8c6, 0x0006,
-	0x0040, 0x3688, 0xa0c4, 0xff00, 0xa8c6, 0x0600, 0x00c0, 0x36d8,
-	0x2001, 0xa352, 0x2004, 0xd0ac, 0x00c0, 0x3695, 0x1078, 0x47cb,
-	0x00c0, 0x3695, 0xd79c, 0x0040, 0x36d8, 0xd794, 0x00c0, 0x369b,
-	0xd784, 0x0040, 0x36a7, 0xac80, 0x0006, 0x2098, 0x3400, 0x20a9,
-	0x0004, 0x53a3, 0x1078, 0x338c, 0xd794, 0x0040, 0x36b0, 0xac80,
-	0x000a, 0x2098, 0x3400, 0x20a9, 0x0004, 0x53a3, 0x1078, 0x338c,
-	0x21a2, 0xd794, 0x0040, 0x36d0, 0xac80, 0x0000, 0x2098, 0x94a0,
-	0x20a9, 0x0002, 0x53a3, 0xac80, 0x0003, 0x20a6, 0x94a0, 0xac80,
-	0x0004, 0x2098, 0x3400, 0x20a9, 0x0002, 0x53a3, 0x1078, 0x337e,
-	0xac80, 0x0026, 0x2098, 0x20a9, 0x0002, 0x53a3, 0x0078, 0x36d1,
-	0x94a0, 0xd794, 0x0040, 0x36d6, 0xa6b0, 0x000b, 0xa6b0, 0x0005,
-	0x8108, 0xd78c, 0x0040, 0x36e2, 0xa186, 0x0100, 0x0040, 0x36f3,
-	0x0078, 0x36e6, 0xa186, 0x007e, 0x0040, 0x36f3, 0xd794, 0x0040,
-	0x36ed, 0xa686, 0x0020, 0x0078, 0x36ef, 0xa686, 0x0028, 0x0040,
-	0x36fc, 0x0078, 0x3677, 0x86ff, 0x00c0, 0x36fa, 0x7120, 0x810b,
-	0x0078, 0x2b2c, 0x702f, 0x0001, 0x711e, 0x7020, 0xa600, 0x7022,
-	0x772a, 0x2061, 0xa3d1, 0x6007, 0x0000, 0x6612, 0x7024, 0x600e,
-	0x6226, 0x632a, 0x642e, 0x6532, 0x2c10, 0x1078, 0x13d1, 0x7007,
-	0x0002, 0x701b, 0x3714, 0x007c, 0x702c, 0xa005, 0x00c0, 0x3726,
-	0x711c, 0x7024, 0x20a0, 0x7728, 0x2031, 0x0000, 0x2061, 0xa3d1,
-	0x6224, 0x6328, 0x642c, 0x6530, 0x0078, 0x3677, 0x7120, 0x810b,
-	0x0078, 0x2b2c, 0x2029, 0x007e, 0x7924, 0x7a28, 0x7b2c, 0x7c38,
-	0xa184, 0xff00, 0x8007, 0xa0e2, 0x0020, 0x0048, 0x2b5a, 0xa502,
-	0x0048, 0x2b5a, 0xa184, 0x00ff, 0xa0e2, 0x0020, 0x0048, 0x2b5a,
-	0xa502, 0x0048, 0x2b5a, 0xa284, 0xff00, 0x8007, 0xa0e2, 0x0020,
-	0x0048, 0x2b5a, 0xa502, 0x0048, 0x2b5a, 0xa284, 0x00ff, 0xa0e2,
-	0x0020, 0x0048, 0x2b5a, 0xa502, 0x0048, 0x2b5a, 0xa384, 0xff00,
-	0x8007, 0xa0e2, 0x0020, 0x0048, 0x2b5a, 0xa502, 0x0048, 0x2b5a,
-	0xa384, 0x00ff, 0xa0e2, 0x0020, 0x0048, 0x2b5a, 0xa502, 0x0048,
-	0x2b5a, 0xa484, 0xff00, 0x8007, 0xa0e2, 0x0020, 0x0048, 0x2b5a,
-	0xa502, 0x0048, 0x2b5a, 0xa484, 0x00ff, 0xa0e2, 0x0020, 0x0048,
-	0x2b5a, 0xa502, 0x0048, 0x2b5a, 0x2061, 0xa5a3, 0x6102, 0x6206,
-	0x630a, 0x640e, 0x0078, 0x2b2c, 0x007e, 0x2001, 0xa352, 0x2004,
-	0xd0cc, 0x007f, 0x007c, 0x007e, 0x2001, 0xa371, 0x2004, 0xd0bc,
-	0x007f, 0x007c, 0x6160, 0x7a24, 0x6300, 0x82ff, 0x00c0, 0x379b,
-	0x7926, 0x0078, 0x2b2c, 0x83ff, 0x00c0, 0x2b5a, 0x2001, 0xfff0,
-	0xa200, 0x00c8, 0x2b5a, 0x2019, 0xffff, 0x6064, 0xa302, 0xa200,
-	0x0048, 0x2b5a, 0x7926, 0x6262, 0x0078, 0x2b2c, 0x2001, 0xa300,
-	0x2004, 0xa086, 0x0003, 0x00c0, 0x2b56, 0x7c28, 0x7d24, 0x7e38,
-	0x7f2c, 0x1078, 0x3518, 0x0040, 0x2b56, 0x2009, 0x0000, 0x2019,
-	0x0000, 0x7023, 0x0000, 0x702f, 0x0000, 0xad80, 0x0003, 0x7026,
-	0x20a0, 0xa1e0, 0xa434, 0x2c64, 0x8cff, 0x0040, 0x37e8, 0x6004,
-	0xa084, 0x00ff, 0xa086, 0x0006, 0x0040, 0x37dd, 0x6004, 0xa084,
-	0xff00, 0xa086, 0x0600, 0x00c0, 0x37e8, 0x6014, 0x20a2, 0x94a0,
-	0x6010, 0x8007, 0xa105, 0x8007, 0x20a2, 0x94a0, 0xa398, 0x0002,
-	0x8108, 0xa182, 0x00ff, 0x0040, 0x37f3, 0xa386, 0x002a, 0x0040,
-	0x37fc, 0x0078, 0x37c9, 0x83ff, 0x00c0, 0x37fa, 0x7120, 0x810c,
-	0x0078, 0x2b2c, 0x702f, 0x0001, 0x711e, 0x7020, 0xa300, 0x7022,
-	0x2061, 0xa3d1, 0x6007, 0x0000, 0x6312, 0x7024, 0x600e, 0x6426,
-	0x652a, 0x662e, 0x6732, 0x2c10, 0x1078, 0x13d1, 0x7007, 0x0002,
-	0x701b, 0x3813, 0x007c, 0x702c, 0xa005, 0x00c0, 0x3824, 0x711c,
-	0x7024, 0x20a0, 0x2019, 0x0000, 0x2061, 0xa3d1, 0x6424, 0x6528,
-	0x662c, 0x6730, 0x0078, 0x37c9, 0x7120, 0x810c, 0x0078, 0x2b2c,
-	0x81ff, 0x00c0, 0x2b56, 0x60c8, 0xd09c, 0x0040, 0x2b56, 0x1078,
-	0x3518, 0x0040, 0x2b56, 0x7924, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38,
-	0x1078, 0x3562, 0x701b, 0x383d, 0x007c, 0x0d7e, 0xade8, 0x000d,
-	0x6828, 0xa0be, 0x7000, 0x0040, 0x3850, 0xa0be, 0x7100, 0x0040,
-	0x3850, 0xa0be, 0x7200, 0x0040, 0x3850, 0x0d7f, 0x0078, 0x2b5a,
-	0x6820, 0x6924, 0x1078, 0x24e3, 0x00c0, 0x387b, 0x1078, 0x4499,
-	0x00c0, 0x387b, 0x7122, 0x6612, 0x6516, 0x6e18, 0x0c7e, 0x1078,
-	0x3518, 0x0040, 0x387b, 0x1078, 0x3518, 0x0040, 0x387b, 0x0c7f,
-	0x0d7f, 0x6837, 0x0000, 0x6838, 0xc0fd, 0x683a, 0x6823, 0x0000,
-	0x6804, 0x2068, 0x1078, 0x8bbd, 0x0040, 0x2b56, 0x7007, 0x0003,
-	0x701b, 0x387e, 0x007c, 0x0d7f, 0x0078, 0x2b56, 0x7120, 0x1078,
-	0x2921, 0x6820, 0xa086, 0x8001, 0x0040, 0x2b56, 0x2d00, 0x701e,
-	0x6804, 0xa080, 0x0002, 0x007e, 0x20a9, 0x002a, 0x2098, 0x20a0,
-	0x1078, 0x41be, 0x007f, 0xade8, 0x000d, 0x6a08, 0x6b0c, 0x6c10,
-	0x6d14, 0x2061, 0xa3d1, 0x6007, 0x0000, 0x6e00, 0x6f28, 0xa7c6,
-	0x7000, 0x00c0, 0x38a5, 0x0078, 0x38a9, 0xa7c6, 0x7100, 0x00c0,
-	0x38b1, 0xa6c2, 0x0004, 0x0048, 0x2b5a, 0x2009, 0x0004, 0x0078,
-	0x3566, 0xa7c6, 0x7200, 0x00c0, 0x2b5a, 0xa6c2, 0x0054, 0x0048,
-	0x2b5a, 0x600e, 0x6013, 0x002a, 0x6226, 0x632a, 0x642e, 0x6532,
-	0x2c10, 0x1078, 0x13d1, 0x7007, 0x0002, 0x701b, 0x38c8, 0x007c,
-	0x701c, 0x2068, 0x6804, 0xa080, 0x0001, 0x2004, 0xa080, 0x0002,
-	0x007e, 0x20a9, 0x002a, 0x2098, 0x20a0, 0x1078, 0x41be, 0x007f,
-	0x2009, 0x002a, 0x2061, 0xa3d1, 0x6224, 0x6328, 0x642c, 0x6530,
-	0x0078, 0x3566, 0x81ff, 0x00c0, 0x2b56, 0x1078, 0x3530, 0x0040,
-	0x2b5a, 0x1078, 0x45a7, 0x0040, 0x2b56, 0x1078, 0x4710, 0x0078,
-	0x2b2c, 0x7824, 0xd084, 0x0040, 0x3150, 0x1078, 0x3542, 0x0040,
-	0x2b5a, 0x0c7e, 0x1078, 0x3518, 0x0c7f, 0x00c0, 0x3903, 0x2009,
-	0x0002, 0x0078, 0x2b56, 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006,
-	0x0040, 0x3910, 0xa08e, 0x0004, 0x0040, 0x3910, 0xa08e, 0x0005,
-	0x00c0, 0x3934, 0x2001, 0xa352, 0x2004, 0xd0b4, 0x0040, 0x3185,
-	0x6000, 0xd08c, 0x00c0, 0x3185, 0x6837, 0x0000, 0x6838, 0xc0fd,
-	0x683a, 0x1078, 0x8bd9, 0x00c0, 0x3929, 0x2009, 0x0003, 0x0078,
-	0x2b56, 0x7007, 0x0003, 0x701b, 0x392e, 0x007c, 0x1078, 0x3542,
-	0x0040, 0x2b5a, 0x0078, 0x3185, 0x2009, 0xa32e, 0x210c, 0x81ff,
-	0x0040, 0x393e, 0x2009, 0x0001, 0x0078, 0x2b56, 0x2001, 0xa300,
-	0x2004, 0xa086, 0x0003, 0x0040, 0x3949, 0x2009, 0x0007, 0x0078,
-	0x2b56, 0x2001, 0xa352, 0x2004, 0xd0ac, 0x0040, 0x3953, 0x2009,
-	0x0008, 0x0078, 0x2b56, 0x609c, 0xd0a4, 0x00c0, 0x395a, 0xd0ac,
-	0x00c0, 0x3185, 0x6837, 0x0000, 0x6833, 0x0000, 0x6838, 0xc0fd,
-	0x683a, 0x1078, 0x8c4d, 0x00c0, 0x3969, 0x2009, 0x0003, 0x0078,
-	0x2b56, 0x7007, 0x0003, 0x701b, 0x396e, 0x007c, 0x6830, 0xa086,
-	0x0100, 0x00c0, 0x3977, 0x2009, 0x0004, 0x0078, 0x2b56, 0x1078,
-	0x3542, 0x0040, 0x2b5a, 0x0078, 0x3912, 0x81ff, 0x2009, 0x0001,
-	0x00c0, 0x2b56, 0x6000, 0xa086, 0x0003, 0x2009, 0x0007, 0x00c0,
-	0x2b56, 0x2001, 0xa352, 0x2004, 0xd0ac, 0x2009, 0x0008, 0x00c0,
-	0x2b56, 0x1078, 0x3542, 0x0040, 0x2b5a, 0x6004, 0xa084, 0x00ff,
-	0xa086, 0x0006, 0x2009, 0x0009, 0x00c0, 0x2b56, 0x0c7e, 0x1078,
-	0x3518, 0x0c7f, 0x2009, 0x0002, 0x0040, 0x2b56, 0x6837, 0x0000,
-	0x6833, 0x0000, 0x6838, 0xc0fd, 0x683a, 0x7928, 0xa194, 0xff00,
-	0xa18c, 0x00ff, 0xa006, 0x82ff, 0x00c0, 0x39bc, 0xc0ed, 0x6952,
-	0x792c, 0x6956, 0x0078, 0x39c5, 0xa28e, 0x0100, 0x00c0, 0x2b5a,
-	0xc0e5, 0x6853, 0x0000, 0x6857, 0x0000, 0x683e, 0x1078, 0x8df6,
-	0x2009, 0x0003, 0x0040, 0x2b56, 0x7007, 0x0003, 0x701b, 0x39d1,
-	0x007c, 0x6830, 0xa086, 0x0100, 0x2009, 0x0004, 0x0040, 0x2b56,
-	0x0078, 0x2b2c, 0x81ff, 0x2009, 0x0001, 0x00c0, 0x2b56, 0x6000,
-	0xa086, 0x0003, 0x2009, 0x0007, 0x00c0, 0x2b56, 0x1078, 0x3542,
-	0x0040, 0x2b5a, 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006, 0x2009,
-	0x0009, 0x00c0, 0x2b56, 0x0c7e, 0x1078, 0x3518, 0x0c7f, 0x2009,
-	0x0002, 0x0040, 0x2b56, 0xad80, 0x000f, 0x2009, 0x0008, 0x7a2c,
-	0x7b28, 0x7c3c, 0x7d38, 0x1078, 0x3562, 0x701b, 0x3a08, 0x007c,
-	0x0d7e, 0xade8, 0x000f, 0x6800, 0xa086, 0x0500, 0x00c0, 0x3a1b,
-	0x6804, 0xa005, 0x00c0, 0x3a1b, 0x6808, 0xa084, 0xff00, 0x00c0,
-	0x3a1b, 0x0078, 0x3a1e, 0x0d7f, 0x00c0, 0x2b5a, 0x0d7f, 0x6837,
-	0x0000, 0x6833, 0x0000, 0x6838, 0xc0fd, 0x683a, 0x0c7e, 0x1078,
-	0x3542, 0x00c0, 0x3a2e, 0x0c7f, 0x0078, 0x2b5a, 0x1078, 0x8e52,
-	0x2009, 0x0003, 0x0c7f, 0x0040, 0x2b56, 0x7007, 0x0003, 0x701b,
-	0x3a3a, 0x007c, 0x6830, 0xa086, 0x0100, 0x2009, 0x0004, 0x0040,
-	0x2b56, 0x0078, 0x2b2c, 0x127e, 0x0c7e, 0x0e7e, 0x2061, 0x0100,
-	0x2071, 0xa300, 0x6044, 0xd0a4, 0x00c0, 0x3a6c, 0xd084, 0x0040,
-	0x3a55, 0x1078, 0x3bcc, 0x0078, 0x3a68, 0xd08c, 0x0040, 0x3a5c,
-	0x1078, 0x3ae3, 0x0078, 0x3a68, 0xd094, 0x0040, 0x3a63, 0x1078,
-	0x3ab7, 0x0078, 0x3a68, 0xd09c, 0x0040, 0x3a68, 0x1078, 0x3a76,
-	0x0e7f, 0x0c7f, 0x127f, 0x007c, 0x017e, 0x6128, 0xd19c, 0x00c0,
-	0x3a73, 0xc19d, 0x612a, 0x017f, 0x0078, 0x3a68, 0x624c, 0xa286,
-	0xf0f0, 0x00c0, 0x3a87, 0x6048, 0xa086, 0xf0f0, 0x0040, 0x3a87,
-	0x624a, 0x6043, 0x0090, 0x6043, 0x0010, 0x0078, 0x3ab6, 0xa294,
-	0xff00, 0xa296, 0xf700, 0x0040, 0x3a9c, 0x7134, 0xd1a4, 0x00c0,
-	0x3a9c, 0x6240, 0xa294, 0x0010, 0x0040, 0x3a9c, 0x2009, 0x00f7,
-	0x1078, 0x41de, 0x0078, 0x3ab6, 0x6043, 0x0040, 0x6043, 0x0000,
-	0x7073, 0x0000, 0x708b, 0x0001, 0x70af, 0x0000, 0x70cb, 0x0000,
-	0x2009, 0xa9c0, 0x200b, 0x0000, 0x7083, 0x0000, 0x7077, 0x000f,
-	0x2009, 0x000f, 0x2011, 0x4122, 0x1078, 0x596c, 0x007c, 0x157e,
-	0x7074, 0xa005, 0x00c0, 0x3ae1, 0x2011, 0x4122, 0x1078, 0x58d4,
-	0x6040, 0xa094, 0x0010, 0xa285, 0x0020, 0x6042, 0x20a9, 0x00c8,
-	0x6044, 0xd08c, 0x00c0, 0x3ada, 0x00f0, 0x3ac8, 0x6242, 0x7087,
-	0x0000, 0x6040, 0xa094, 0x0010, 0xa285, 0x0080, 0x6042, 0x6242,
-	0x0078, 0x3ae1, 0x6242, 0x7087, 0x0000, 0x707b, 0x0000, 0x0078,
-	0x3ae1, 0x157f, 0x007c, 0x7078, 0xa08a, 0x0003, 0x00c8, 0x3aec,
-	0x1079, 0x3aef, 0x0078, 0x3aee, 0x1078, 0x1328, 0x007c, 0x3af2,
-	0x3b41, 0x3bcb, 0x0f7e, 0x707b, 0x0001, 0x20e1, 0xa000, 0x20e1,
-	0x8700, 0x1078, 0x218b, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2079,
-	0xa800, 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, 0xa80c, 0x207b, 0x1101, 0x7807, 0x0000, 0x2099,
-	0xa305, 0x20a1, 0xa80e, 0x20a9, 0x0004, 0x53a3, 0x2079, 0xa812,
-	0x207b, 0x0000, 0x7807, 0x0000, 0x2099, 0xa800, 0x20a1, 0x020b,
-	0x20a9, 0x0014, 0x53a6, 0x60c3, 0x000c, 0x600f, 0x0000, 0x1078,
-	0x4158, 0x0f7f, 0x707f, 0x0000, 0x6043, 0x0008, 0x6043, 0x0000,
-	0x007c, 0x0d7e, 0x707c, 0x707f, 0x0000, 0xa025, 0x0040, 0x3bb5,
-	0x6020, 0xd0b4, 0x00c0, 0x3bb3, 0x7188, 0x81ff, 0x0040, 0x3ba2,
-	0xa486, 0x000c, 0x00c0, 0x3bad, 0xa480, 0x0018, 0x8004, 0x20a8,
-	0x2011, 0xa880, 0x2019, 0xa800, 0x220c, 0x2304, 0xa106, 0x00c0,
-	0x3b79, 0x8210, 0x8318, 0x00f0, 0x3b5c, 0x6043, 0x0004, 0x608b,
-	0xbc94, 0x608f, 0xf0f0, 0x6043, 0x0006, 0x707b, 0x0002, 0x7087,
-	0x0002, 0x2009, 0x07d0, 0x2011, 0x4129, 0x1078, 0x596c, 0x0078,
-	0x3bb3, 0x2069, 0xa880, 0x6930, 0xa18e, 0x1101, 0x00c0, 0x3bad,
-	0x6834, 0xa005, 0x00c0, 0x3bad, 0x6900, 0xa18c, 0x00ff, 0x00c0,
-	0x3b8d, 0x6804, 0xa005, 0x0040, 0x3ba2, 0x2011, 0xa88e, 0x2019,
-	0xa305, 0x20a9, 0x0004, 0x220c, 0x2304, 0xa102, 0x0048, 0x3ba0,
-	0x00c0, 0x3bad, 0x8210, 0x8318, 0x00f0, 0x3b93, 0x0078, 0x3bad,
-	0x708b, 0x0000, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2099, 0xa880,
-	0x20a1, 0x020b, 0x20a9, 0x0014, 0x53a6, 0x6043, 0x0008, 0x6043,
-	0x0000, 0x0078, 0x3bb5, 0x0d7f, 0x007c, 0x6020, 0xd0b4, 0x00c0,
-	0x3bb3, 0x60c3, 0x000c, 0x2011, 0xa5b5, 0x2013, 0x0000, 0x707f,
-	0x0000, 0x20e1, 0x9080, 0x60a3, 0x0056, 0x60a7, 0x9575, 0x1078,
-	0x6c38, 0x0078, 0x3bb3, 0x007c, 0x7084, 0xa08a, 0x001d, 0x00c8,
-	0x3bd5, 0x1079, 0x3bd8, 0x0078, 0x3bd7, 0x1078, 0x1328, 0x007c,
-	0x3c02, 0x3c11, 0x3c40, 0x3c59, 0x3c85, 0x3cb1, 0x3cdd, 0x3d13,
-	0x3d3f, 0x3d67, 0x3daa, 0x3dd4, 0x3df6, 0x3e0c, 0x3e32, 0x3e45,
-	0x3e4e, 0x3e7e, 0x3eaa, 0x3ed6, 0x3f02, 0x3f38, 0x3f7d, 0x3fac,
-	0x3fce, 0x4010, 0x4036, 0x404f, 0x4050, 0x0c7e, 0x2061, 0xa300,
-	0x6003, 0x0007, 0x2061, 0x0100, 0x6004, 0xa084, 0xfff9, 0x6006,
-	0x0c7f, 0x007c, 0x608b, 0xbc94, 0x608f, 0xf0f0, 0x6043, 0x0002,
-	0x7087, 0x0001, 0x2009, 0x07d0, 0x2011, 0x4129, 0x1078, 0x596c,
-	0x007c, 0x0f7e, 0x707c, 0xa086, 0x0014, 0x00c0, 0x3c3e, 0x6043,
-	0x0000, 0x6020, 0xd0b4, 0x00c0, 0x3c3e, 0x2079, 0xa880, 0x7a30,
-	0xa296, 0x1102, 0x00c0, 0x3c3c, 0x7834, 0xa005, 0x00c0, 0x3c3c,
-	0x7a38, 0xd2fc, 0x0040, 0x3c32, 0x70ac, 0xa005, 0x00c0, 0x3c32,
-	0x70af, 0x0001, 0x2011, 0x4129, 0x1078, 0x58d4, 0x7087, 0x0010,
-	0x1078, 0x3e4e, 0x0078, 0x3c3e, 0x1078, 0x4171, 0x0f7f, 0x007c,
-	0x7087, 0x0003, 0x6043, 0x0004, 0x2011, 0x4129, 0x1078, 0x58d4,
-	0x1078, 0x41c6, 0x20a3, 0x1102, 0x20a3, 0x0000, 0x20a9, 0x000a,
-	0x20a3, 0x0000, 0x00f0, 0x3c50, 0x60c3, 0x0014, 0x1078, 0x4158,
-	0x007c, 0x0f7e, 0x707c, 0xa005, 0x0040, 0x3c83, 0x2011, 0x4129,
-	0x1078, 0x58d4, 0xa086, 0x0014, 0x00c0, 0x3c81, 0x2079, 0xa880,
-	0x7a30, 0xa296, 0x1102, 0x00c0, 0x3c81, 0x7834, 0xa005, 0x00c0,
-	0x3c81, 0x7a38, 0xd2fc, 0x0040, 0x3c7b, 0x70ac, 0xa005, 0x00c0,
-	0x3c7b, 0x70af, 0x0001, 0x7087, 0x0004, 0x1078, 0x3c85, 0x0078,
-	0x3c83, 0x1078, 0x4171, 0x0f7f, 0x007c, 0x7087, 0x0005, 0x1078,
-	0x41c6, 0x20a3, 0x1103, 0x20a3, 0x0000, 0x3430, 0x2011, 0xa88e,
-	0x1078, 0x4211, 0x00c0, 0x3ca3, 0x7070, 0xa005, 0x00c0, 0x3ca3,
-	0x714c, 0xa186, 0xffff, 0x0040, 0x3ca3, 0x1078, 0x40ea, 0x0040,
-	0x3ca3, 0x1078, 0x41f5, 0x20a9, 0x0008, 0x2298, 0x26a0, 0x53a6,
-	0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x4158,
-	0x007c, 0x0f7e, 0x707c, 0xa005, 0x0040, 0x3cdb, 0x2011, 0x4129,
-	0x1078, 0x58d4, 0xa086, 0x0014, 0x00c0, 0x3cd9, 0x2079, 0xa880,
-	0x7a30, 0xa296, 0x1103, 0x00c0, 0x3cd9, 0x7834, 0xa005, 0x00c0,
-	0x3cd9, 0x7a38, 0xd2fc, 0x0040, 0x3cd3, 0x70ac, 0xa005, 0x00c0,
-	0x3cd3, 0x70af, 0x0001, 0x7087, 0x0006, 0x1078, 0x3cdd, 0x0078,
-	0x3cdb, 0x1078, 0x4171, 0x0f7f, 0x007c, 0x7087, 0x0007, 0x1078,
-	0x41c6, 0x20a3, 0x1104, 0x20a3, 0x0000, 0x3430, 0x2011, 0xa88e,
-	0x1078, 0x4211, 0x00c0, 0x3d05, 0x7070, 0xa005, 0x00c0, 0x3d05,
-	0x7150, 0xa186, 0xffff, 0x0040, 0x3d05, 0xa180, 0x293f, 0x200c,
-	0xa18c, 0xff00, 0x810f, 0x1078, 0x40ea, 0x0040, 0x3d05, 0x1078,
-	0x378b, 0x0040, 0x3d05, 0x1078, 0x2500, 0x20a9, 0x0008, 0x2298,
-	0x26a0, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014,
-	0x1078, 0x4158, 0x007c, 0x0f7e, 0x707c, 0xa005, 0x0040, 0x3d3d,
-	0x2011, 0x4129, 0x1078, 0x58d4, 0xa086, 0x0014, 0x00c0, 0x3d3b,
-	0x2079, 0xa880, 0x7a30, 0xa296, 0x1104, 0x00c0, 0x3d3b, 0x7834,
-	0xa005, 0x00c0, 0x3d3b, 0x7a38, 0xd2fc, 0x0040, 0x3d35, 0x70ac,
-	0xa005, 0x00c0, 0x3d35, 0x70af, 0x0001, 0x7087, 0x0008, 0x1078,
-	0x3d3f, 0x0078, 0x3d3d, 0x1078, 0x4171, 0x0f7f, 0x007c, 0x7087,
-	0x0009, 0x1078, 0x41c6, 0x20a3, 0x1105, 0x20a3, 0x0100, 0x3430,
-	0x1078, 0x4211, 0x00c0, 0x3d58, 0x7070, 0xa005, 0x00c0, 0x3d58,
-	0x1078, 0x4051, 0x00c0, 0x3d62, 0xa085, 0x0001, 0x1078, 0x2500,
-	0x20a9, 0x0008, 0x2099, 0xa88e, 0x26a0, 0x53a6, 0x20a3, 0x0000,
-	0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x4158, 0x007c, 0x0f7e,
-	0x707c, 0xa005, 0x0040, 0x3da8, 0x2011, 0x4129, 0x1078, 0x58d4,
-	0xa086, 0x0014, 0x00c0, 0x3da6, 0x2079, 0xa880, 0x7a30, 0xa296,
-	0x1105, 0x00c0, 0x3da6, 0x7834, 0x2011, 0x0100, 0xa21e, 0x00c0,
-	0x3d91, 0x7a38, 0xd2fc, 0x0040, 0x3d8b, 0x70ac, 0xa005, 0x00c0,
-	0x3d8b, 0x70af, 0x0001, 0x7087, 0x000a, 0x1078, 0x3daa, 0x0078,
-	0x3da8, 0xa005, 0x00c0, 0x3da6, 0x7a38, 0xd2fc, 0x0040, 0x3d9e,
-	0x70ac, 0xa005, 0x00c0, 0x3d9e, 0x70af, 0x0001, 0x7083, 0x0000,
-	0x7087, 0x000e, 0x1078, 0x3e32, 0x0078, 0x3da8, 0x1078, 0x4171,
-	0x0f7f, 0x007c, 0x7087, 0x000b, 0x2011, 0xa80e, 0x22a0, 0x20a9,
-	0x0040, 0x2019, 0xffff, 0x43a4, 0x20a9, 0x0002, 0x2009, 0x0000,
-	0x41a4, 0x1078, 0x41c6, 0x20a3, 0x1106, 0x20a3, 0x0000, 0x1078,
-	0x4211, 0x0040, 0x3dc7, 0x2013, 0x0000, 0x0078, 0x3dcb, 0x6030,
-	0xa085, 0x0100, 0x2012, 0x2298, 0x20a9, 0x0042, 0x53a6, 0x60c3,
-	0x0084, 0x1078, 0x4158, 0x007c, 0x0f7e, 0x707c, 0xa005, 0x0040,
-	0x3df4, 0x2011, 0x4129, 0x1078, 0x58d4, 0xa086, 0x0084, 0x00c0,
-	0x3df2, 0x2079, 0xa880, 0x7a30, 0xa296, 0x1106, 0x00c0, 0x3df2,
-	0x7834, 0xa005, 0x00c0, 0x3df2, 0x7087, 0x000c, 0x1078, 0x3df6,
-	0x0078, 0x3df4, 0x1078, 0x4171, 0x0f7f, 0x007c, 0x7087, 0x000d,
-	0x1078, 0x41c6, 0x20a3, 0x1107, 0x20a3, 0x0000, 0x2099, 0xa88e,
-	0x20a9, 0x0040, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3,
-	0x0084, 0x1078, 0x4158, 0x007c, 0x0f7e, 0x707c, 0xa005, 0x0040,
-	0x3e30, 0x2011, 0x4129, 0x1078, 0x58d4, 0xa086, 0x0084, 0x00c0,
-	0x3e2e, 0x2079, 0xa880, 0x7a30, 0xa296, 0x1107, 0x00c0, 0x3e2e,
-	0x7834, 0xa005, 0x00c0, 0x3e2e, 0x7083, 0x0001, 0x1078, 0x41b8,
-	0x7087, 0x000e, 0x1078, 0x3e32, 0x0078, 0x3e30, 0x1078, 0x4171,
-	0x0f7f, 0x007c, 0x7087, 0x000f, 0x707f, 0x0000, 0x608b, 0xbc85,
-	0x608f, 0xb5b5, 0x6043, 0x0005, 0x6043, 0x0004, 0x2009, 0x07d0,
-	0x2011, 0x4129, 0x1078, 0x58c7, 0x007c, 0x707c, 0xa005, 0x0040,
-	0x3e4d, 0x2011, 0x4129, 0x1078, 0x58d4, 0x007c, 0x7087, 0x0011,
-	0x1078, 0x4211, 0x00c0, 0x3e67, 0x7168, 0x81ff, 0x0040, 0x3e67,
-	0x2009, 0x0000, 0x706c, 0xa084, 0x00ff, 0x1078, 0x24e3, 0xa186,
-	0x0080, 0x0040, 0x3e67, 0x2011, 0xa88e, 0x1078, 0x40ea, 0x20e1,
-	0x9080, 0x20e1, 0x4000, 0x2099, 0xa880, 0x20a1, 0x020b, 0x747c,
-	0xa480, 0x0018, 0xa080, 0x0007, 0xa084, 0x03f8, 0x8004, 0x20a8,
-	0x53a6, 0x60c3, 0x0014, 0x1078, 0x4158, 0x007c, 0x0f7e, 0x707c,
-	0xa005, 0x0040, 0x3ea8, 0x2011, 0x4129, 0x1078, 0x58d4, 0xa086,
-	0x0014, 0x00c0, 0x3ea6, 0x2079, 0xa880, 0x7a30, 0xa296, 0x1103,
-	0x00c0, 0x3ea6, 0x7834, 0xa005, 0x00c0, 0x3ea6, 0x7a38, 0xd2fc,
-	0x0040, 0x3ea0, 0x70ac, 0xa005, 0x00c0, 0x3ea0, 0x70af, 0x0001,
-	0x7087, 0x0012, 0x1078, 0x3eaa, 0x0078, 0x3ea8, 0x1078, 0x4171,
-	0x0f7f, 0x007c, 0x7087, 0x0013, 0x1078, 0x41d2, 0x20a3, 0x1103,
-	0x20a3, 0x0000, 0x3430, 0x2011, 0xa88e, 0x1078, 0x4211, 0x00c0,
-	0x3ec8, 0x7070, 0xa005, 0x00c0, 0x3ec8, 0x714c, 0xa186, 0xffff,
-	0x0040, 0x3ec8, 0x1078, 0x40ea, 0x0040, 0x3ec8, 0x1078, 0x41f5,
-	0x20a9, 0x0008, 0x2298, 0x26a0, 0x53a6, 0x20a3, 0x0000, 0x20a3,
-	0x0000, 0x60c3, 0x0014, 0x1078, 0x4158, 0x007c, 0x0f7e, 0x707c,
-	0xa005, 0x0040, 0x3f00, 0x2011, 0x4129, 0x1078, 0x58d4, 0xa086,
-	0x0014, 0x00c0, 0x3efe, 0x2079, 0xa880, 0x7a30, 0xa296, 0x1104,
-	0x00c0, 0x3efe, 0x7834, 0xa005, 0x00c0, 0x3efe, 0x7a38, 0xd2fc,
-	0x0040, 0x3ef8, 0x70ac, 0xa005, 0x00c0, 0x3ef8, 0x70af, 0x0001,
-	0x7087, 0x0014, 0x1078, 0x3f02, 0x0078, 0x3f00, 0x1078, 0x4171,
-	0x0f7f, 0x007c, 0x7087, 0x0015, 0x1078, 0x41d2, 0x20a3, 0x1104,
-	0x20a3, 0x0000, 0x3430, 0x2011, 0xa88e, 0x1078, 0x4211, 0x00c0,
-	0x3f2a, 0x7070, 0xa005, 0x00c0, 0x3f2a, 0x7150, 0xa186, 0xffff,
-	0x0040, 0x3f2a, 0xa180, 0x293f, 0x200c, 0xa18c, 0xff00, 0x810f,
-	0x1078, 0x40ea, 0x0040, 0x3f2a, 0x1078, 0x378b, 0x0040, 0x3f2a,
-	0x1078, 0x2500, 0x20a9, 0x0008, 0x2298, 0x26a0, 0x53a6, 0x20a3,
-	0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x4158, 0x007c,
-	0x0f7e, 0x707c, 0xa005, 0x0040, 0x3f7b, 0x2011, 0x4129, 0x1078,
-	0x58d4, 0xa086, 0x0014, 0x00c0, 0x3f79, 0x2079, 0xa880, 0x7a30,
-	0xa296, 0x1105, 0x00c0, 0x3f79, 0x7834, 0x2011, 0x0100, 0xa21e,
-	0x00c0, 0x3f5e, 0x7a38, 0xd2fc, 0x0040, 0x3f5c, 0x70ac, 0xa005,
-	0x00c0, 0x3f5c, 0x70af, 0x0001, 0x0078, 0x3f6d, 0xa005, 0x00c0,
-	0x3f79, 0x7a38, 0xd2fc, 0x0040, 0x3f6b, 0x70ac, 0xa005, 0x00c0,
-	0x3f6b, 0x70af, 0x0001, 0x7083, 0x0000, 0x7a38, 0xd2f4, 0x0040,
-	0x3f73, 0x70cb, 0x0008, 0x7087, 0x0016, 0x1078, 0x3f7d, 0x0078,
-	0x3f7b, 0x1078, 0x4171, 0x0f7f, 0x007c, 0x20e1, 0x9080, 0x20e1,
-	0x4000, 0x2099, 0xa880, 0x20a1, 0x020b, 0x20a9, 0x000e, 0x53a6,
-	0x3430, 0x2011, 0xa88e, 0x7087, 0x0017, 0x1078, 0x4211, 0x00c0,
-	0x3f9d, 0x7070, 0xa005, 0x00c0, 0x3f9d, 0x1078, 0x4051, 0x00c0,
-	0x3fa7, 0xa085, 0x0001, 0x1078, 0x2500, 0x20a9, 0x0008, 0x2099,
-	0xa88e, 0x26a0, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3,
-	0x0014, 0x1078, 0x4158, 0x007c, 0x0f7e, 0x707c, 0xa005, 0x0040,
-	0x3fcc, 0x2011, 0x4129, 0x1078, 0x58d4, 0xa086, 0x0084, 0x00c0,
-	0x3fca, 0x2079, 0xa880, 0x7a30, 0xa296, 0x1106, 0x00c0, 0x3fca,
-	0x7834, 0xa005, 0x00c0, 0x3fca, 0x7087, 0x0018, 0x1078, 0x3fce,
-	0x0078, 0x3fcc, 0x1078, 0x4171, 0x0f7f, 0x007c, 0x7087, 0x0019,
-	0x1078, 0x41d2, 0x20a3, 0x1106, 0x20a3, 0x0000, 0x3430, 0x2099,
-	0xa88e, 0x2039, 0xa80e, 0x27a0, 0x20a9, 0x0040, 0x53a3, 0x1078,
-	0x4211, 0x00c0, 0x4002, 0x2728, 0x2514, 0x8207, 0xa084, 0x00ff,
-	0x8000, 0x2018, 0xa294, 0x00ff, 0x8007, 0xa205, 0x202a, 0x6030,
-	0x2310, 0x8214, 0xa2a0, 0xa80e, 0x2414, 0xa38c, 0x0001, 0x0040,
-	0x3ffd, 0xa294, 0xff00, 0x0078, 0x4000, 0xa294, 0x00ff, 0x8007,
-	0xa215, 0x2222, 0x2798, 0x26a0, 0x20a9, 0x0040, 0x53a6, 0x20a3,
-	0x0000, 0x20a3, 0x0000, 0x60c3, 0x0084, 0x1078, 0x4158, 0x007c,
-	0x0f7e, 0x707c, 0xa005, 0x0040, 0x4034, 0x2011, 0x4129, 0x1078,
-	0x58d4, 0xa086, 0x0084, 0x00c0, 0x4032, 0x2079, 0xa880, 0x7a30,
-	0xa296, 0x1107, 0x00c0, 0x4032, 0x7834, 0xa005, 0x00c0, 0x4032,
-	0x7083, 0x0001, 0x1078, 0x41b8, 0x7087, 0x001a, 0x1078, 0x4036,
-	0x0078, 0x4034, 0x1078, 0x4171, 0x0f7f, 0x007c, 0x7087, 0x001b,
-	0x20e1, 0x9080, 0x20e1, 0x4000, 0x2099, 0xa880, 0x20a1, 0x020b,
-	0x747c, 0xa480, 0x0018, 0xa080, 0x0007, 0xa084, 0x03f8, 0x8004,
-	0x20a8, 0x53a6, 0x60c3, 0x0084, 0x1078, 0x4158, 0x007c, 0x007c,
-	0x007c, 0x087e, 0x097e, 0x2029, 0xa352, 0x252c, 0x20a9, 0x0008,
-	0x2041, 0xa80e, 0x28a0, 0x2099, 0xa88e, 0x53a3, 0x20a9, 0x0008,
-	0x2011, 0x0007, 0xd5d4, 0x0040, 0x4067, 0x2011, 0x0000, 0x2800,
-	0xa200, 0x200c, 0xa1a6, 0xffff, 0x00c0, 0x4079, 0xd5d4, 0x0040,
-	0x4074, 0x8210, 0x0078, 0x4075, 0x8211, 0x00f0, 0x4067, 0x0078,
-	0x40e1, 0x82ff, 0x00c0, 0x408b, 0xd5d4, 0x0040, 0x4085, 0xa1a6,
-	0x3fff, 0x0040, 0x4071, 0x0078, 0x4089, 0xa1a6, 0x3fff, 0x0040,
-	0x40e1, 0xa18d, 0xc000, 0x20a9, 0x0010, 0x2019, 0x0001, 0xd5d4,
-	0x0040, 0x4094, 0x2019, 0x0010, 0x2120, 0xd5d4, 0x0040, 0x409b,
-	0x8423, 0x0078, 0x409c, 0x8424, 0x00c8, 0x40a9, 0xd5d4, 0x0040,
-	0x40a4, 0x8319, 0x0078, 0x40a5, 0x8318, 0x00f0, 0x4095, 0x0078,
-	0x40e1, 0x23a8, 0x2021, 0x0001, 0x8426, 0x8425, 0x00f0, 0x40ad,
-	0x2328, 0x8529, 0xa2be, 0x0007, 0x0040, 0x40c1, 0x007e, 0x2039,
-	0x0007, 0x2200, 0xa73a, 0x007f, 0x27a8, 0xa5a8, 0x0010, 0x00f0,
-	0x40bd, 0x754e, 0xa5c8, 0x293f, 0x292c, 0xa5ac, 0x00ff, 0x6532,
-	0x60e7, 0x0000, 0x65ea, 0x706b, 0x0000, 0x756e, 0x2018, 0x2304,
-	0xa405, 0x201a, 0x7073, 0x0001, 0x26a0, 0x2898, 0x20a9, 0x0008,
-	0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000, 0xa085, 0x0001, 0x0078,
-	0x40e7, 0xa006, 0x0078, 0x40e7, 0xa006, 0x1078, 0x1328, 0x097f,
-	0x087f, 0x007c, 0x2118, 0x2021, 0x0000, 0x2001, 0x0007, 0xa39a,
-	0x0010, 0x0048, 0x40f7, 0x8420, 0x8001, 0x0078, 0x40ef, 0x2118,
-	0x84ff, 0x0040, 0x4100, 0xa39a, 0x0010, 0x8421, 0x00c0, 0x40fb,
-	0x2021, 0x0001, 0x83ff, 0x0040, 0x4109, 0x8423, 0x8319, 0x00c0,
-	0x4105, 0xa238, 0x2704, 0xa42c, 0x00c0, 0x4121, 0xa405, 0x203a,
-	0x714e, 0xa1a0, 0x293f, 0x242c, 0xa5ac, 0x00ff, 0x6532, 0x60e7,
-	0x0000, 0x65ea, 0x706b, 0x0000, 0x756e, 0x7073, 0x0001, 0xa084,
-	0x0000, 0x007c, 0x0e7e, 0x2071, 0xa300, 0x7077, 0x0000, 0x0e7f,
-	0x007c, 0x0e7e, 0x0f7e, 0x2001, 0x0002, 0x1078, 0x5975, 0x2079,
-	0x0100, 0x2071, 0x0140, 0x1078, 0x6c41, 0x7004, 0xa084, 0x4000,
-	0x0040, 0x413e, 0x7003, 0x1000, 0x7003, 0x0000, 0x127e, 0x2091,
-	0x8000, 0x2071, 0xa321, 0x2073, 0x0000, 0x7840, 0x027e, 0x017e,
-	0x2009, 0x00f7, 0x1078, 0x41de, 0x017f, 0xa094, 0x0010, 0xa285,
-	0x0080, 0x7842, 0x7a42, 0x027f, 0x127f, 0x0f7f, 0x0e7f, 0x007c,
-	0x127e, 0x2091, 0x8000, 0x2011, 0xa5b5, 0x2013, 0x0000, 0x707f,
-	0x0000, 0x127f, 0x20e1, 0x9080, 0x60a3, 0x0056, 0x60a7, 0x9575,
-	0x1078, 0x6c38, 0x2009, 0x07d0, 0x2011, 0x4129, 0x1078, 0x596c,
-	0x007c, 0x017e, 0x027e, 0x0c7e, 0x127e, 0x2091, 0x8000, 0x2009,
-	0x00f7, 0x1078, 0x41de, 0x2061, 0xa5be, 0x601b, 0x0000, 0x601f,
-	0x0000, 0x2061, 0xa300, 0x6003, 0x0001, 0x2061, 0x0100, 0x6043,
-	0x0090, 0x6043, 0x0010, 0x2009, 0x002d, 0x2011, 0x4196, 0x1078,
-	0x58c7, 0x127f, 0x0c7f, 0x027f, 0x017f, 0x007c, 0x0e7e, 0x007e,
-	0x127e, 0x2091, 0x8000, 0x2001, 0x0001, 0x1078, 0x5975, 0x2071,
-	0x0100, 0x1078, 0x6c41, 0x2071, 0x0140, 0x7004, 0xa084, 0x4000,
-	0x0040, 0x41ae, 0x7003, 0x1000, 0x7003, 0x0000, 0x2001, 0x0001,
-	0x1078, 0x2480, 0x1078, 0x4171, 0x127f, 0x007f, 0x0e7f, 0x007c,
-	0x20a9, 0x0040, 0x20a1, 0xa9c0, 0x2099, 0xa88e, 0x3304, 0x8007,
-	0x20a2, 0x9398, 0x94a0, 0x00f0, 0x41be, 0x007c, 0x20e1, 0x9080,
-	0x20e1, 0x4000, 0x2099, 0xa800, 0x20a1, 0x020b, 0x20a9, 0x000c,
-	0x53a6, 0x007c, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2099, 0xa880,
-	0x20a1, 0x020b, 0x20a9, 0x000c, 0x53a6, 0x007c, 0x0c7e, 0x007e,
-	0x2061, 0x0100, 0x810f, 0x2001, 0xa32e, 0x2004, 0xa005, 0x00c0,
-	0x41ef, 0x6030, 0xa084, 0x00ff, 0xa105, 0x0078, 0x41f1, 0xa185,
-	0x00f7, 0x604a, 0x007f, 0x0c7f, 0x007c, 0x017e, 0x047e, 0x2001,
-	0xa352, 0x2004, 0xd0a4, 0x0040, 0x4208, 0xa006, 0x2020, 0x2009,
-	0x002a, 0x1078, 0x9ec0, 0x2001, 0xa30c, 0x200c, 0xc195, 0x2102,
-	0x2019, 0x002a, 0x2009, 0x0000, 0x1078, 0x27e2, 0x047f, 0x017f,
-	0x007c, 0x007e, 0x2001, 0xa30c, 0x2004, 0xd09c, 0x0040, 0x4218,
-	0x007f, 0x007c, 0x007e, 0x017e, 0x127e, 0x2091, 0x8000, 0x2001,
-	0x0101, 0x200c, 0xa18d, 0x0006, 0x2102, 0x127f, 0x017f, 0x007f,
-	0x007c, 0x157e, 0x20a9, 0x00ff, 0x2009, 0xa434, 0xa006, 0x200a,
-	0x8108, 0x00f0, 0x422f, 0x157f, 0x007c, 0x0d7e, 0x037e, 0x157e,
-	0x137e, 0x147e, 0x2069, 0xa351, 0xa006, 0x6002, 0x6007, 0x0707,
-	0x600a, 0x600e, 0x6012, 0xa198, 0x293f, 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, 0x4275, 0x1078, 0x139a, 0x60a7, 0x0000, 0x60a8,
-	0xa06d, 0x0040, 0x427d, 0x1078, 0x139a, 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, 0x4361, 0xa18c, 0xff00, 0x810f, 0xa182, 0x00ff,
-	0x00c8, 0x4367, 0x2001, 0xa30c, 0x2004, 0xa084, 0x0003, 0x0040,
-	0x42c2, 0x2001, 0xa30c, 0x2004, 0xd084, 0x00c0, 0x4342, 0xa188,
-	0xa434, 0x2104, 0xa065, 0x0040, 0x4342, 0x6004, 0xa084, 0x00ff,
-	0xa08e, 0x0006, 0x00c0, 0x4342, 0x6000, 0xd0c4, 0x0040, 0x4342,
-	0x0078, 0x42cf, 0xa188, 0xa434, 0x2104, 0xa065, 0x0040, 0x4326,
-	0x6004, 0xa084, 0x00ff, 0xa08e, 0x0006, 0x00c0, 0x432c, 0x60a4,
-	0xa00d, 0x0040, 0x42d7, 0x1078, 0x4749, 0x0040, 0x4320, 0x60a8,
-	0xa00d, 0x0040, 0x42f1, 0x1078, 0x479a, 0x00c0, 0x42f1, 0x694c,
-	0xd1fc, 0x00c0, 0x42e7, 0x1078, 0x441c, 0x0078, 0x431b, 0x1078,
-	0x43d6, 0x694c, 0xd1ec, 0x00c0, 0x431b, 0x1078, 0x460a, 0x0078,
-	0x431b, 0x694c, 0xa184, 0xa000, 0x0040, 0x430b, 0xd1ec, 0x0040,
-	0x4304, 0xd1fc, 0x0040, 0x4300, 0x1078, 0x461b, 0x0078, 0x4307,
-	0x1078, 0x461b, 0x0078, 0x430b, 0xd1fc, 0x0040, 0x430b, 0x1078,
-	0x43d6, 0x0078, 0x431b, 0x6050, 0xa00d, 0x0040, 0x4316, 0x2d00,
-	0x200a, 0x6803, 0x0000, 0x6052, 0x0078, 0x431b, 0x2d00, 0x6052,
-	0x604e, 0x6803, 0x0000, 0x1078, 0x5c17, 0xa006, 0x127f, 0x007c,
-	0x2001, 0x0005, 0x2009, 0x0000, 0x0078, 0x436b, 0x2001, 0x0028,
-	0x2009, 0x0000, 0x0078, 0x436b, 0xa082, 0x0006, 0x00c8, 0x4342,
-	0x60a0, 0xd0bc, 0x00c0, 0x433e, 0x6100, 0xd1fc, 0x0040, 0x42cf,
-	0x2001, 0x0029, 0x2009, 0x1000, 0x0078, 0x436b, 0x2001, 0x0028,
-	0x0078, 0x435d, 0x2009, 0xa30c, 0x210c, 0xd18c, 0x0040, 0x434c,
-	0x2001, 0x0004, 0x0078, 0x435d, 0xd184, 0x0040, 0x4353, 0x2001,
-	0x0004, 0x0078, 0x435d, 0x2001, 0x0029, 0x6100, 0xd1fc, 0x0040,
-	0x435d, 0x2009, 0x1000, 0x0078, 0x436b, 0x2009, 0x0000, 0x0078,
-	0x436b, 0x2001, 0x0029, 0x2009, 0x0000, 0x0078, 0x436b, 0x2001,
-	0x0029, 0x2009, 0x0000, 0xa005, 0x127f, 0x007c, 0x6944, 0x6e48,
-	0xa684, 0x3fff, 0xa082, 0x4000, 0x00c8, 0x43bb, 0xa18c, 0xff00,
-	0x810f, 0xa182, 0x00ff, 0x00c8, 0x43a1, 0xa188, 0xa434, 0x2104,
-	0xa065, 0x0040, 0x43a1, 0x6004, 0xa084, 0x00ff, 0xa08e, 0x0006,
-	0x00c0, 0x43a7, 0x684c, 0xd0ec, 0x0040, 0x4394, 0x1078, 0x461b,
-	0x1078, 0x43d6, 0x0078, 0x439c, 0x1078, 0x43d6, 0x684c, 0xd0fc,
-	0x0040, 0x439c, 0x1078, 0x460a, 0x1078, 0x4663, 0xa006, 0x0078,
-	0x43bf, 0x2001, 0x0028, 0x2009, 0x0000, 0x0078, 0x43bf, 0xa082,
-	0x0006, 0x00c8, 0x43b5, 0x6100, 0xd1fc, 0x0040, 0x438a, 0x2001,
-	0x0029, 0x2009, 0x1000, 0x0078, 0x43bf, 0x2001, 0x0029, 0x2009,
-	0x0000, 0x0078, 0x43bf, 0x2001, 0x0029, 0x2009, 0x0000, 0xa005,
-	0x007c, 0x127e, 0x2091, 0x8000, 0x6050, 0xa00d, 0x0040, 0x43cf,
-	0x2d00, 0x200a, 0x6803, 0x0000, 0x6052, 0x127f, 0x007c, 0x2d00,
-	0x6052, 0x604e, 0x6803, 0x0000, 0x0078, 0x43cd, 0x127e, 0x2091,
-	0x8000, 0x604c, 0xa005, 0x0040, 0x43ec, 0x0e7e, 0x2071, 0xa5ab,
-	0x7004, 0xa086, 0x0002, 0x0040, 0x43f3, 0x0e7f, 0x604c, 0x6802,
-	0x2d00, 0x604e, 0x127f, 0x007c, 0x2d00, 0x6052, 0x604e, 0x6803,
-	0x0000, 0x0078, 0x43ea, 0x701c, 0xac06, 0x00c0, 0x43e5, 0x604c,
-	0x2070, 0x7000, 0x6802, 0x2d00, 0x7002, 0x0e7f, 0x127f, 0x007c,
-	0x127e, 0x2091, 0x8000, 0x604c, 0xa06d, 0x0040, 0x440e, 0x6800,
-	0xa005, 0x00c0, 0x440c, 0x6052, 0x604e, 0xad05, 0x127f, 0x007c,
-	0x604c, 0xa06d, 0x0040, 0x441b, 0x6800, 0xa005, 0x00c0, 0x4419,
-	0x6052, 0x604e, 0xad05, 0x007c, 0x6803, 0x0000, 0x6084, 0xa00d,
-	0x0040, 0x4426, 0x2d00, 0x200a, 0x6086, 0x007c, 0x2d00, 0x6086,
-	0x6082, 0x0078, 0x4425, 0x127e, 0x0c7e, 0x027e, 0x2091, 0x8000,
-	0x6218, 0x2260, 0x6200, 0xa005, 0x0040, 0x4439, 0xc285, 0x0078,
-	0x443a, 0xc284, 0x6202, 0x027f, 0x0c7f, 0x127f, 0x007c, 0x127e,
-	0x0c7e, 0x2091, 0x8000, 0x6218, 0x2260, 0x6204, 0x007e, 0xa086,
-	0x0006, 0x00c0, 0x445e, 0x609c, 0xd0ac, 0x0040, 0x445e, 0x2001,
-	0xa352, 0x2004, 0xd0a4, 0x0040, 0x445e, 0xa284, 0xff00, 0x8007,
-	0xa086, 0x0007, 0x00c0, 0x445e, 0x2011, 0x0600, 0x007f, 0xa294,
-	0xff00, 0xa215, 0x6206, 0x007e, 0xa086, 0x0006, 0x00c0, 0x446e,
-	0x6290, 0x82ff, 0x00c0, 0x446e, 0x1078, 0x1328, 0x007f, 0x0c7f,
-	0x127f, 0x007c, 0x127e, 0x0c7e, 0x2091, 0x8000, 0x6218, 0x2260,
-	0x6204, 0x007e, 0xa086, 0x0006, 0x00c0, 0x4490, 0x609c, 0xd0a4,
-	0x0040, 0x4490, 0x2001, 0xa352, 0x2004, 0xd0ac, 0x00c0, 0x4490,
-	0xa284, 0x00ff, 0xa086, 0x0007, 0x00c0, 0x4490, 0x2011, 0x0006,
-	0x007f, 0xa294, 0x00ff, 0x8007, 0xa215, 0x6206, 0x0c7f, 0x127f,
-	0x007c, 0x027e, 0xa182, 0x00ff, 0x0048, 0x44a2, 0xa085, 0x0001,
-	0x0078, 0x44ba, 0xa190, 0xa434, 0x2204, 0xa065, 0x00c0, 0x44b9,
-	0x017e, 0x0d7e, 0x1078, 0x1366, 0x2d60, 0x0d7f, 0x017f, 0x0040,
-	0x449e, 0x2c00, 0x2012, 0x60a7, 0x0000, 0x60ab, 0x0000, 0x1078,
-	0x4235, 0xa006, 0x027f, 0x007c, 0x127e, 0x2091, 0x8000, 0x027e,
-	0xa182, 0x00ff, 0x0048, 0x44c8, 0xa085, 0x0001, 0x0078, 0x44fe,
-	0x0d7e, 0xa190, 0xa434, 0x2204, 0xa06d, 0x0040, 0x44fc, 0x2013,
-	0x0000, 0x0d7e, 0x0c7e, 0x2d60, 0x60a4, 0xa06d, 0x0040, 0x44da,
-	0x1078, 0x139a, 0x60a8, 0xa06d, 0x0040, 0x44e0, 0x1078, 0x139a,
-	0x0c7f, 0x0d7f, 0x0d7e, 0x0c7e, 0x68ac, 0x2060, 0x8cff, 0x0040,
-	0x44f8, 0x600c, 0x007e, 0x6010, 0x2068, 0x1078, 0x8a44, 0x0040,
-	0x44f3, 0x1078, 0x13aa, 0x1078, 0x753d, 0x0c7f, 0x0078, 0x44e6,
-	0x0c7f, 0x0d7f, 0x1078, 0x139a, 0x0d7f, 0xa006, 0x027f, 0x127f,
-	0x007c, 0x017e, 0xa182, 0x00ff, 0x0048, 0x450a, 0xa085, 0x0001,
-	0x0078, 0x4511, 0xa188, 0xa434, 0x2104, 0xa065, 0x0040, 0x4506,
-	0xa006, 0x017f, 0x007c, 0x0d7e, 0x157e, 0x137e, 0x147e, 0x600b,
-	0x0000, 0x600f, 0x0000, 0x6000, 0xc08c, 0x6002, 0x2069, 0xa88e,
-	0x6808, 0x605e, 0x6810, 0x6062, 0x6138, 0xa10a, 0x0048, 0x4529,
-	0x603a, 0x6814, 0x6066, 0x2099, 0xa896, 0xac88, 0x000a, 0x21a0,
-	0x20a9, 0x0004, 0x53a3, 0x2099, 0xa89a, 0xac88, 0x0006, 0x21a0,
-	0x20a9, 0x0004, 0x53a3, 0x2069, 0xa8ae, 0x6808, 0x606a, 0x690c,
-	0x616e, 0x6810, 0x6072, 0x6818, 0x6076, 0xa182, 0x0211, 0x00c8,
-	0x454d, 0x2009, 0x0008, 0x0078, 0x4577, 0xa182, 0x0259, 0x00c8,
-	0x4555, 0x2009, 0x0007, 0x0078, 0x4577, 0xa182, 0x02c1, 0x00c8,
-	0x455d, 0x2009, 0x0006, 0x0078, 0x4577, 0xa182, 0x0349, 0x00c8,
-	0x4565, 0x2009, 0x0005, 0x0078, 0x4577, 0xa182, 0x0421, 0x00c8,
-	0x456d, 0x2009, 0x0004, 0x0078, 0x4577, 0xa182, 0x0581, 0x00c8,
-	0x4575, 0x2009, 0x0003, 0x0078, 0x4577, 0x2009, 0x0002, 0x6192,
-	0x147f, 0x137f, 0x157f, 0x0d7f, 0x007c, 0x017e, 0x027e, 0x0e7e,
-	0x2071, 0xa88d, 0x2e04, 0x6896, 0x2071, 0xa88e, 0x7004, 0x689a,
-	0x701c, 0x689e, 0x6a00, 0x2009, 0xa371, 0x210c, 0xd0bc, 0x0040,
-	0x4597, 0xd1ec, 0x0040, 0x4597, 0xc2ad, 0x0078, 0x4598, 0xc2ac,
-	0xd0c4, 0x0040, 0x45a1, 0xd1e4, 0x0040, 0x45a1, 0xc2bd, 0x0078,
-	0x45a2, 0xc2bc, 0x6a02, 0x0e7f, 0x027f, 0x017f, 0x007c, 0x0d7e,
-	0x127e, 0x2091, 0x8000, 0x60a4, 0xa06d, 0x0040, 0x45cb, 0x6900,
-	0x81ff, 0x00c0, 0x45df, 0x6a04, 0xa282, 0x0010, 0x00c8, 0x45e4,
-	0xad88, 0x0004, 0x20a9, 0x0010, 0x2104, 0xa086, 0xffff, 0x0040,
-	0x45c6, 0x8108, 0x00f0, 0x45bc, 0x1078, 0x1328, 0x260a, 0x8210,
-	0x6a06, 0x0078, 0x45df, 0x1078, 0x1381, 0x0040, 0x45e4, 0x2d00,
-	0x60a6, 0x6803, 0x0000, 0xad88, 0x0004, 0x20a9, 0x0010, 0x200b,
-	0xffff, 0x8108, 0x00f0, 0x45d7, 0x6807, 0x0001, 0x6e12, 0xa085,
-	0x0001, 0x127f, 0x0d7f, 0x007c, 0xa006, 0x0078, 0x45e1, 0x127e,
-	0x2091, 0x8000, 0x0d7e, 0x60a4, 0xa00d, 0x0040, 0x4607, 0x2168,
-	0x6800, 0xa005, 0x00c0, 0x4603, 0x1078, 0x4749, 0x00c0, 0x4607,
-	0x200b, 0xffff, 0x6804, 0xa08a, 0x0002, 0x0048, 0x4603, 0x8001,
-	0x6806, 0x0078, 0x4607, 0x1078, 0x139a, 0x60a7, 0x0000, 0x0d7f,
-	0x127f, 0x007c, 0x127e, 0x2091, 0x8000, 0x1078, 0x47af, 0x0078,
-	0x4613, 0x1078, 0x43c1, 0x1078, 0x46a7, 0x00c0, 0x4611, 0x1078,
-	0x4663, 0x127f, 0x007c, 0x0d7e, 0x127e, 0x2091, 0x8000, 0x60a8,
-	0xa06d, 0x0040, 0x463f, 0x6950, 0x81ff, 0x00c0, 0x4653, 0x6a54,
-	0xa282, 0x0010, 0x00c8, 0x4660, 0xad88, 0x0018, 0x20a9, 0x0010,
-	0x2104, 0xa086, 0xffff, 0x0040, 0x463a, 0x8108, 0x00f0, 0x4630,
-	0x1078, 0x1328, 0x260a, 0x8210, 0x6a56, 0x0078, 0x4653, 0x1078,
-	0x1381, 0x0040, 0x4660, 0x2d00, 0x60aa, 0x6853, 0x0000, 0xad88,
-	0x0018, 0x20a9, 0x0010, 0x200b, 0xffff, 0x8108, 0x00f0, 0x464b,
-	0x6857, 0x0001, 0x6e62, 0x0078, 0x4657, 0x1078, 0x441c, 0x1078,
-	0x466d, 0x00c0, 0x4655, 0xa085, 0x0001, 0x127f, 0x0d7f, 0x007c,
-	0xa006, 0x0078, 0x465d, 0x127e, 0x2091, 0x8000, 0x1078, 0x5c17,
-	0x127f, 0x007c, 0xa01e, 0x0078, 0x466f, 0x2019, 0x0001, 0xa00e,
-	0x127e, 0x2091, 0x8000, 0x604c, 0x2068, 0x6000, 0xd0dc, 0x00c0,
-	0x468d, 0x8dff, 0x0040, 0x46a2, 0x83ff, 0x0040, 0x4685, 0x6848,
-	0xa606, 0x0040, 0x4692, 0x0078, 0x468d, 0x683c, 0xa406, 0x00c0,
-	0x468d, 0x6840, 0xa506, 0x0040, 0x4692, 0x2d08, 0x6800, 0x2068,
-	0x0078, 0x4679, 0x6a00, 0x604c, 0xad06, 0x00c0, 0x469a, 0x624e,
-	0x0078, 0x469d, 0xa180, 0x0000, 0x2202, 0x82ff, 0x00c0, 0x46a2,
-	0x6152, 0x8dff, 0x127f, 0x007c, 0xa01e, 0x0078, 0x46a9, 0x2019,
-	0x0001, 0xa00e, 0x6080, 0x2068, 0x8dff, 0x0040, 0x46d5, 0x83ff,
-	0x0040, 0x46b8, 0x6848, 0xa606, 0x0040, 0x46c5, 0x0078, 0x46c0,
-	0x683c, 0xa406, 0x00c0, 0x46c0, 0x6840, 0xa506, 0x0040, 0x46c5,
-	0x2d08, 0x6800, 0x2068, 0x0078, 0x46ac, 0x6a00, 0x6080, 0xad06,
-	0x00c0, 0x46cd, 0x6282, 0x0078, 0x46d0, 0xa180, 0x0000, 0x2202,
-	0x82ff, 0x00c0, 0x46d5, 0x6186, 0x8dff, 0x007c, 0xa016, 0x1078,
-	0x4742, 0x00c0, 0x46dd, 0x2011, 0x0001, 0x1078, 0x4793, 0x00c0,
-	0x46e3, 0xa295, 0x0002, 0x007c, 0x1078, 0x47cb, 0x0040, 0x46ec,
-	0x1078, 0x8b12, 0x0078, 0x46ee, 0xa085, 0x0001, 0x007c, 0x1078,
-	0x47cb, 0x0040, 0x46f7, 0x1078, 0x8aaa, 0x0078, 0x46f9, 0xa085,
-	0x0001, 0x007c, 0x1078, 0x47cb, 0x0040, 0x4702, 0x1078, 0x8af4,
-	0x0078, 0x4704, 0xa085, 0x0001, 0x007c, 0x1078, 0x47cb, 0x0040,
-	0x470d, 0x1078, 0x8ac6, 0x0078, 0x470f, 0xa085, 0x0001, 0x007c,
-	0x1078, 0x47cb, 0x0040, 0x4718, 0x1078, 0x8b30, 0x0078, 0x471a,
-	0xa085, 0x0001, 0x007c, 0x127e, 0x007e, 0x0d7e, 0x2091, 0x8000,
-	0x6080, 0xa06d, 0x0040, 0x473a, 0x6800, 0x007e, 0x6837, 0x0103,
-	0x6b4a, 0x6847, 0x0000, 0x1078, 0x8cb8, 0x007e, 0x6000, 0xd0fc,
-	0x0040, 0x4734, 0x1078, 0xa18c, 0x007f, 0x1078, 0x4982, 0x007f,
-	0x0078, 0x4721, 0x6083, 0x0000, 0x6087, 0x0000, 0x0d7f, 0x007f,
-	0x127f, 0x007c, 0x60a4, 0xa00d, 0x00c0, 0x4749, 0xa085, 0x0001,
-	0x007c, 0x0e7e, 0x2170, 0x7000, 0xa005, 0x00c0, 0x475c, 0x20a9,
-	0x0010, 0xae88, 0x0004, 0x2104, 0xa606, 0x0040, 0x475c, 0x8108,
-	0x00f0, 0x4753, 0xa085, 0x0001, 0xa006, 0x0e7f, 0x007c, 0x0d7e,
-	0x127e, 0x2091, 0x8000, 0x60a4, 0xa06d, 0x00c0, 0x476d, 0x1078,
-	0x1381, 0x0040, 0x477f, 0x2d00, 0x60a6, 0x6803, 0x0001, 0x6807,
-	0x0000, 0xad88, 0x0004, 0x20a9, 0x0010, 0x200b, 0xffff, 0x8108,
-	0x00f0, 0x4775, 0xa085, 0x0001, 0x127f, 0x0d7f, 0x007c, 0xa006,
-	0x0078, 0x477c, 0x0d7e, 0x127e, 0x2091, 0x8000, 0x60a4, 0xa06d,
-	0x0040, 0x4790, 0x60a7, 0x0000, 0x1078, 0x139a, 0xa085, 0x0001,
-	0x127f, 0x0d7f, 0x007c, 0x60a8, 0xa00d, 0x00c0, 0x479a, 0xa085,
-	0x0001, 0x007c, 0x0e7e, 0x2170, 0x7050, 0xa005, 0x00c0, 0x47ad,
-	0x20a9, 0x0010, 0xae88, 0x0018, 0x2104, 0xa606, 0x0040, 0x47ad,
-	0x8108, 0x00f0, 0x47a4, 0xa085, 0x0001, 0x0e7f, 0x007c, 0x127e,
-	0x2091, 0x8000, 0x1078, 0x4793, 0x00c0, 0x47c9, 0x200b, 0xffff,
-	0x0d7e, 0x60a8, 0x2068, 0x6854, 0xa08a, 0x0002, 0x0048, 0x47c4,
-	0x8001, 0x6856, 0x0078, 0x47c8, 0x1078, 0x139a, 0x60ab, 0x0000,
-	0x0d7f, 0x127f, 0x007c, 0x609c, 0xd0a4, 0x007c, 0x0f7e, 0x71ac,
-	0x81ff, 0x00c0, 0x47e9, 0x71c8, 0xd19c, 0x0040, 0x47e9, 0x2001,
-	0x007e, 0xa080, 0xa434, 0x2004, 0xa07d, 0x0040, 0x47e9, 0x7804,
-	0xa084, 0x00ff, 0xa086, 0x0006, 0x00c0, 0x47e9, 0x7800, 0xc0ed,
-	0x7802, 0x2079, 0xa351, 0x7804, 0xd0a4, 0x0040, 0x480f, 0x157e,
-	0x0c7e, 0x20a9, 0x007f, 0x2009, 0x0000, 0x017e, 0x1078, 0x4501,
-	0x00c0, 0x4809, 0x6004, 0xa084, 0xff00, 0x8007, 0xa096, 0x0004,
-	0x0040, 0x4806, 0xa086, 0x0006, 0x00c0, 0x4809, 0x6000, 0xc0ed,
-	0x6002, 0x017f, 0x8108, 0x00f0, 0x47f5, 0x0c7f, 0x157f, 0x1078,
-	0x4897, 0x0040, 0x4818, 0x2001, 0xa59f, 0x200c, 0x0078, 0x4820,
-	0x2079, 0xa351, 0x7804, 0xd0a4, 0x0040, 0x4824, 0x2009, 0x07d0,
-	0x2011, 0x4826, 0x1078, 0x596c, 0x0f7f, 0x007c, 0x2011, 0x4826,
-	0x1078, 0x58d4, 0x1078, 0x4897, 0x0040, 0x484e, 0x2001, 0xa4b2,
-	0x2004, 0xa080, 0x0000, 0x200c, 0xc1ec, 0x2102, 0x2001, 0xa352,
-	0x2004, 0xd0a4, 0x0040, 0x4842, 0x2009, 0x07d0, 0x2011, 0x4826,
-	0x1078, 0x596c, 0x0e7e, 0x2071, 0xa300, 0x706b, 0x0000, 0x706f,
-	0x0000, 0x1078, 0x260d, 0x0e7f, 0x0078, 0x4886, 0x157e, 0x0c7e,
-	0x20a9, 0x007f, 0x2009, 0x0000, 0x017e, 0x1078, 0x4501, 0x00c0,
-	0x4880, 0x6000, 0xd0ec, 0x0040, 0x4880, 0x047e, 0x62a0, 0xa294,
-	0x00ff, 0x8227, 0xa006, 0x2009, 0x0029, 0x1078, 0x9ec0, 0x6000,
-	0xc0e5, 0xc0ec, 0x6002, 0x6004, 0xa084, 0x00ff, 0xa085, 0x0700,
-	0x6006, 0x2019, 0x0029, 0x1078, 0x5d53, 0x077e, 0x2039, 0x0000,
-	0x1078, 0x5c78, 0x2009, 0x0000, 0x1078, 0x9c38, 0x077f, 0x047f,
-	0x017f, 0x8108, 0x00f0, 0x4854, 0x0c7f, 0x157f, 0x007c, 0x0c7e,
-	0x6018, 0x2060, 0x6000, 0xc0ec, 0x6002, 0x0c7f, 0x007c, 0x7818,
-	0x2004, 0xd0ac, 0x007c, 0x7818, 0x2004, 0xd0bc, 0x007c, 0x0f7e,
-	0x2001, 0xa4b2, 0x2004, 0xa07d, 0x0040, 0x48a0, 0x7800, 0xd0ec,
-	0x0f7f, 0x007c, 0x127e, 0x027e, 0x2091, 0x8000, 0x6200, 0xa005,
-	0x0040, 0x48ad, 0xc2fd, 0x0078, 0x48ae, 0xc2fc, 0x6202, 0x027f,
-	0x127f, 0x007c, 0x2071, 0xa413, 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, 0xa57c, 0x7003, 0xa413,
-	0x7007, 0x0000, 0x700b, 0x0000, 0x700f, 0xa55c, 0x7013, 0x0020,
-	0x7017, 0x0040, 0x7037, 0x0000, 0x007c, 0x017e, 0x0e7e, 0x2071,
-	0xa534, 0xa00e, 0x7186, 0x718a, 0x7097, 0x0001, 0x2001, 0xa352,
-	0x2004, 0xd0fc, 0x00c0, 0x48f7, 0x2001, 0xa352, 0x2004, 0xa00e,
-	0xd09c, 0x0040, 0x48f4, 0x8108, 0x7102, 0x0078, 0x494a, 0x2001,
-	0xa371, 0x200c, 0xa184, 0x000f, 0x2009, 0xa372, 0x210c, 0x0079,
-	0x4901, 0x48ec, 0x4922, 0x492a, 0x4935, 0x493b, 0x48ec, 0x48ec,
-	0x48ec, 0x4911, 0x48ec, 0x48ec, 0x48ec, 0x48ec, 0x48ec, 0x48ec,
-	0x48ec, 0x7003, 0x0004, 0x137e, 0x147e, 0x157e, 0x2099, 0xa375,
-	0x20a1, 0xa585, 0x20a9, 0x0004, 0x53a3, 0x157f, 0x147f, 0x137f,
-	0x0078, 0x494a, 0x708f, 0x0005, 0x7007, 0x0122, 0x2001, 0x0002,
-	0x0078, 0x4930, 0x708f, 0x0002, 0x7007, 0x0121, 0x2001, 0x0003,
-	0x7002, 0x7097, 0x0001, 0x0078, 0x4947, 0x7007, 0x0122, 0x2001,
-	0x0002, 0x0078, 0x493f, 0x7007, 0x0121, 0x2001, 0x0003, 0x7002,
-	0xa006, 0x7096, 0x708e, 0xa184, 0xff00, 0x8007, 0x709a, 0xa184,
-	0x00ff, 0x7092, 0x0e7f, 0x017f, 0x007c, 0x0e7e, 0x2071, 0xa413,
-	0x684c, 0xa005, 0x00c0, 0x495b, 0x7028, 0xc085, 0x702a, 0xa085,
-	0x0001, 0x0078, 0x4980, 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, 0x49d8,
-	0x6804, 0xa00d, 0x0040, 0x499e, 0x0d7e, 0x2071, 0xa300, 0xa016,
-	0x702c, 0x2168, 0x6904, 0x206a, 0x8210, 0x2d00, 0x81ff, 0x00c0,
-	0x4991, 0x702e, 0x70a8, 0xa200, 0x70aa, 0x0d7f, 0x2071, 0xa413,
-	0x701c, 0xa005, 0x00c0, 0x49ea, 0x0068, 0x49e8, 0x2071, 0xa534,
-	0x7200, 0x82ff, 0x0040, 0x49e8, 0x6934, 0xa186, 0x0103, 0x00c0,
-	0x49fb, 0x6948, 0x6844, 0xa105, 0x00c0, 0x49db, 0x2009, 0x8020,
-	0x2200, 0x0079, 0x49bb, 0x49e8, 0x49c0, 0x4a18, 0x4a26, 0x49e8,
-	0x2071, 0x0000, 0x7018, 0xd084, 0x00c0, 0x49e8, 0x7122, 0x683c,
-	0x7026, 0x6840, 0x702a, 0x701b, 0x0001, 0x2091, 0x4080, 0x2071,
-	0xa300, 0x702c, 0x206a, 0x2d00, 0x702e, 0x70a8, 0x8000, 0x70aa,
-	0x027f, 0x0e7f, 0x007c, 0x6844, 0xa086, 0x0100, 0x00c0, 0x49e8,
-	0x6868, 0xa005, 0x00c0, 0x49e8, 0x2009, 0x8020, 0x0078, 0x49b8,
-	0x2071, 0xa413, 0x2d08, 0x206b, 0x0000, 0x7010, 0x8000, 0x7012,
-	0x7018, 0xa06d, 0x711a, 0x0040, 0x49f8, 0x6902, 0x0078, 0x49f9,
-	0x711e, 0x0078, 0x49d8, 0xa18c, 0x00ff, 0xa186, 0x0017, 0x0040,
-	0x4a09, 0xa186, 0x001e, 0x0040, 0x4a09, 0xa18e, 0x001f, 0x00c0,
-	0x49e8, 0x684c, 0xd0cc, 0x0040, 0x49e8, 0x6850, 0xa084, 0x00ff,
-	0xa086, 0x0001, 0x00c0, 0x49e8, 0x2009, 0x8021, 0x0078, 0x49b8,
-	0x7084, 0x8008, 0xa092, 0x001e, 0x00c8, 0x49e8, 0x7186, 0xae90,
-	0x0003, 0xa210, 0x683c, 0x2012, 0x0078, 0x4a36, 0x7084, 0x8008,
-	0xa092, 0x000f, 0x00c8, 0x49e8, 0x7186, 0xae90, 0x0003, 0x8003,
-	0xa210, 0x683c, 0x2012, 0x8210, 0x6840, 0x2012, 0x7088, 0xa10a,
-	0x0048, 0x49cf, 0x718c, 0x7084, 0xa10a, 0x0048, 0x49cf, 0x2071,
-	0x0000, 0x7018, 0xd084, 0x00c0, 0x49cf, 0x2071, 0xa534, 0x7000,
-	0xa086, 0x0002, 0x00c0, 0x4a56, 0x1078, 0x4cd2, 0x2071, 0x0000,
-	0x701b, 0x0001, 0x2091, 0x4080, 0x0078, 0x49cf, 0x1078, 0x4cfd,
-	0x2071, 0x0000, 0x701b, 0x0001, 0x2091, 0x4080, 0x0078, 0x49cf,
-	0x007e, 0x684c, 0x007e, 0x6837, 0x0103, 0x20a9, 0x001c, 0xad80,
-	0x0011, 0x20a0, 0x2001, 0x0000, 0x40a4, 0x007f, 0xa084, 0x00ff,
-	0x684e, 0x007f, 0x684a, 0x6952, 0x007c, 0x2071, 0xa413, 0x7004,
-	0x0079, 0x4a7a, 0x4a84, 0x4a95, 0x4ca3, 0x4ca4, 0x4ccb, 0x4cd1,
-	0x4a85, 0x4c91, 0x4c32, 0x4cb4, 0x007c, 0x127e, 0x2091, 0x8000,
-	0x0068, 0x4a94, 0x2009, 0x000d, 0x7030, 0x200a, 0x2091, 0x4080,
-	0x7007, 0x0001, 0x700b, 0x0000, 0x127f, 0x2069, 0xa5be, 0x6844,
-	0xa005, 0x0050, 0x4abd, 0x00c0, 0x4abd, 0x127e, 0x2091, 0x8000,
-	0x2069, 0x0000, 0x6934, 0x2001, 0xa41f, 0x2004, 0xa10a, 0x0040,
-	0x4ab8, 0x0068, 0x4abc, 0x2069, 0x0000, 0x6818, 0xd084, 0x00c0,
-	0x4abc, 0x2009, 0x8040, 0x6922, 0x681b, 0x0001, 0x2091, 0x4080,
-	0x2069, 0xa5be, 0x6847, 0xffff, 0x127f, 0x2069, 0xa300, 0x6844,
-	0x6960, 0xa102, 0x2069, 0xa534, 0x688a, 0x6984, 0x701c, 0xa06d,
-	0x0040, 0x4acf, 0x81ff, 0x0040, 0x4b17, 0x0078, 0x4ae5, 0x81ff,
-	0x0040, 0x4be9, 0x2071, 0xa534, 0x7184, 0x7088, 0xa10a, 0x00c8,
-	0x4ae5, 0x7190, 0x2071, 0xa5be, 0x7040, 0xa005, 0x0040, 0x4ae5,
-	0x00d0, 0x4be9, 0x7142, 0x0078, 0x4be9, 0x2071, 0xa534, 0x718c,
-	0x127e, 0x2091, 0x8000, 0x7084, 0xa10a, 0x0048, 0x4c06, 0x0068,
-	0x4b9b, 0x2071, 0x0000, 0x7018, 0xd084, 0x00c0, 0x4b9b, 0x2001,
-	0xffff, 0x2071, 0xa5be, 0x7042, 0x2071, 0xa534, 0x7000, 0xa086,
-	0x0002, 0x00c0, 0x4b0d, 0x1078, 0x4cd2, 0x2071, 0x0000, 0x701b,
-	0x0001, 0x2091, 0x4080, 0x0078, 0x4b9b, 0x1078, 0x4cfd, 0x2071,
-	0x0000, 0x701b, 0x0001, 0x2091, 0x4080, 0x0078, 0x4b9b, 0x2071,
-	0xa534, 0x7000, 0xa005, 0x0040, 0x4bc8, 0x6934, 0xa186, 0x0103,
-	0x00c0, 0x4b9e, 0x684c, 0xd0bc, 0x00c0, 0x4bc8, 0x6948, 0x6844,
-	0xa105, 0x00c0, 0x4bbb, 0x2009, 0x8020, 0x2071, 0xa534, 0x7000,
-	0x0079, 0x4b32, 0x4bc8, 0x4b80, 0x4b58, 0x4b6a, 0x4b37, 0x137e,
-	0x147e, 0x157e, 0x2099, 0xa375, 0x20a1, 0xa585, 0x20a9, 0x0004,
-	0x53a3, 0x157f, 0x147f, 0x137f, 0x2071, 0xa57c, 0xad80, 0x000f,
-	0x700e, 0x7013, 0x0002, 0x7007, 0x0002, 0x700b, 0x0000, 0x2e10,
-	0x1078, 0x13d1, 0x2071, 0xa413, 0x7007, 0x0009, 0x0078, 0x4be9,
-	0x7084, 0x8008, 0xa092, 0x001e, 0x00c8, 0x4be9, 0xae90, 0x0003,
-	0xa210, 0x683c, 0x2012, 0x7186, 0x2071, 0xa413, 0x1078, 0x4d5b,
-	0x0078, 0x4be9, 0x7084, 0x8008, 0xa092, 0x000f, 0x00c8, 0x4be9,
-	0xae90, 0x0003, 0x8003, 0xa210, 0x683c, 0x2012, 0x8210, 0x6840,
-	0x2012, 0x7186, 0x2071, 0xa413, 0x1078, 0x4d5b, 0x0078, 0x4be9,
-	0x127e, 0x2091, 0x8000, 0x0068, 0x4b9b, 0x2071, 0x0000, 0x7018,
-	0xd084, 0x00c0, 0x4b9b, 0x7122, 0x683c, 0x7026, 0x6840, 0x702a,
-	0x701b, 0x0001, 0x2091, 0x4080, 0x127f, 0x2071, 0xa413, 0x1078,
-	0x4d5b, 0x0078, 0x4be9, 0x127f, 0x0078, 0x4be9, 0xa18c, 0x00ff,
-	0xa186, 0x0017, 0x0040, 0x4bac, 0xa186, 0x001e, 0x0040, 0x4bac,
-	0xa18e, 0x001f, 0x00c0, 0x4bc8, 0x684c, 0xd0cc, 0x0040, 0x4bc8,
-	0x6850, 0xa084, 0x00ff, 0xa086, 0x0001, 0x00c0, 0x4bc8, 0x2009,
-	0x8021, 0x0078, 0x4b2d, 0x6844, 0xa086, 0x0100, 0x00c0, 0x4bc8,
-	0x6868, 0xa005, 0x00c0, 0x4bc8, 0x2009, 0x8020, 0x0078, 0x4b2d,
-	0x2071, 0xa413, 0x1078, 0x4d6f, 0x0040, 0x4be9, 0x2071, 0xa413,
-	0x700f, 0x0001, 0x6934, 0xa184, 0x00ff, 0xa086, 0x0003, 0x00c0,
-	0x4be0, 0x810f, 0xa18c, 0x00ff, 0x8101, 0x0040, 0x4be0, 0x710e,
-	0x7007, 0x0003, 0x1078, 0x4d8f, 0x7050, 0xa086, 0x0100, 0x0040,
-	0x4ca4, 0x127e, 0x2091, 0x8000, 0x2071, 0xa413, 0x7008, 0xa086,
-	0x0001, 0x00c0, 0x4c04, 0x0068, 0x4c04, 0x2009, 0x000d, 0x7030,
-	0x200a, 0x2091, 0x4080, 0x700b, 0x0000, 0x7004, 0xa086, 0x0006,
-	0x00c0, 0x4c04, 0x7007, 0x0001, 0x127f, 0x007c, 0x2071, 0xa413,
-	0x1078, 0x4d6f, 0x0040, 0x4c2f, 0x2071, 0xa534, 0x7084, 0x700a,
-	0x20a9, 0x0020, 0x2099, 0xa535, 0x20a1, 0xa55c, 0x53a3, 0x7087,
-	0x0000, 0x2071, 0xa413, 0x2069, 0xa57c, 0x706c, 0x6826, 0x7070,
-	0x682a, 0x7074, 0x682e, 0x7078, 0x6832, 0x2d10, 0x1078, 0x13d1,
-	0x7007, 0x0008, 0x2001, 0xffff, 0x2071, 0xa5be, 0x7042, 0x127f,
-	0x0078, 0x4be9, 0x2069, 0xa57c, 0x6808, 0xa08e, 0x0000, 0x0040,
-	0x4c90, 0xa08e, 0x0200, 0x0040, 0x4c8e, 0xa08e, 0x0100, 0x00c0,
-	0x4c90, 0x127e, 0x2091, 0x8000, 0x0068, 0x4c8b, 0x2069, 0x0000,
-	0x6818, 0xd084, 0x00c0, 0x4c8b, 0x702c, 0x7130, 0x8108, 0xa102,
-	0x0048, 0x4c59, 0xa00e, 0x7034, 0x706e, 0x7038, 0x7072, 0x0078,
-	0x4c63, 0x706c, 0xa080, 0x0040, 0x706e, 0x00c8, 0x4c63, 0x7070,
-	0xa081, 0x0000, 0x7072, 0x7132, 0x6936, 0x700b, 0x0000, 0x2001,
-	0xa559, 0x2004, 0xa005, 0x00c0, 0x4c82, 0x6934, 0x2069, 0xa534,
-	0x689c, 0x699e, 0x2069, 0xa5be, 0xa102, 0x00c0, 0x4c7b, 0x6844,
-	0xa005, 0x00d0, 0x4c89, 0x2001, 0xa55a, 0x200c, 0x810d, 0x6946,
-	0x0078, 0x4c89, 0x2009, 0x8040, 0x6922, 0x681b, 0x0001, 0x2091,
-	0x4080, 0x7007, 0x0001, 0x127f, 0x0078, 0x4c90, 0x7007, 0x0005,
-	0x007c, 0x701c, 0xa06d, 0x0040, 0x4ca2, 0x1078, 0x4d6f, 0x0040,
-	0x4ca2, 0x7007, 0x0003, 0x1078, 0x4d8f, 0x7050, 0xa086, 0x0100,
-	0x0040, 0x4ca4, 0x007c, 0x007c, 0x7050, 0xa09e, 0x0100, 0x00c0,
-	0x4cad, 0x7007, 0x0004, 0x0078, 0x4ccb, 0xa086, 0x0200, 0x00c0,
-	0x4cb3, 0x7007, 0x0005, 0x007c, 0x2001, 0xa57e, 0x2004, 0xa08e,
-	0x0100, 0x00c0, 0x4cc0, 0x7007, 0x0001, 0x1078, 0x4d5b, 0x007c,
-	0xa08e, 0x0000, 0x0040, 0x4cbf, 0xa08e, 0x0200, 0x00c0, 0x4cbf,
-	0x7007, 0x0005, 0x007c, 0x1078, 0x4d25, 0x7006, 0x1078, 0x4d5b,
-	0x007c, 0x007c, 0x0e7e, 0x157e, 0x2071, 0xa534, 0x7184, 0x81ff,
-	0x0040, 0x4cfa, 0xa006, 0x7086, 0xae80, 0x0003, 0x2071, 0x0000,
-	0x21a8, 0x2014, 0x7226, 0x8000, 0x0070, 0x4cf7, 0x2014, 0x722a,
-	0x8000, 0x0070, 0x4cf7, 0x2014, 0x722e, 0x8000, 0x0070, 0x4cf7,
-	0x2014, 0x723a, 0x8000, 0x0070, 0x4cf7, 0x2014, 0x723e, 0xa180,
-	0x8030, 0x7022, 0x157f, 0x0e7f, 0x007c, 0x0e7e, 0x157e, 0x2071,
-	0xa534, 0x7184, 0x81ff, 0x0040, 0x4d22, 0xa006, 0x7086, 0xae80,
-	0x0003, 0x2071, 0x0000, 0x21a8, 0x2014, 0x7226, 0x8000, 0x2014,
-	0x722a, 0x8000, 0x0070, 0x4d1b, 0x2014, 0x723a, 0x8000, 0x2014,
-	0x723e, 0x0078, 0x4d1f, 0x2001, 0x8020, 0x0078, 0x4d21, 0x2001,
-	0x8042, 0x7022, 0x157f, 0x0e7f, 0x007c, 0x702c, 0x7130, 0x8108,
-	0xa102, 0x0048, 0x4d32, 0xa00e, 0x7034, 0x706e, 0x7038, 0x7072,
-	0x0078, 0x4d3c, 0x706c, 0xa080, 0x0040, 0x706e, 0x00c8, 0x4d3c,
-	0x7070, 0xa081, 0x0000, 0x7072, 0x7132, 0x700c, 0x8001, 0x700e,
-	0x00c0, 0x4d52, 0x127e, 0x2091, 0x8000, 0x0068, 0x4d55, 0x2001,
-	0x000d, 0x2102, 0x2091, 0x4080, 0x2001, 0x0001, 0x700b, 0x0000,
-	0x127f, 0x007c, 0x2001, 0x0007, 0x007c, 0x2001, 0x0006, 0x700b,
-	0x0001, 0x127f, 0x007c, 0x701c, 0xa06d, 0x0040, 0x4d6e, 0x127e,
-	0x2091, 0x8000, 0x7010, 0x8001, 0x7012, 0x2d04, 0x701e, 0xa005,
-	0x00c0, 0x4d6b, 0x701a, 0x127f, 0x1078, 0x139a, 0x007c, 0x2019,
-	0x000d, 0x2304, 0x230c, 0xa10e, 0x0040, 0x4d7e, 0x2304, 0x230c,
-	0xa10e, 0x0040, 0x4d7e, 0xa006, 0x0078, 0x4d8e, 0x732c, 0x8319,
-	0x7130, 0xa102, 0x00c0, 0x4d88, 0x2300, 0xa005, 0x0078, 0x4d8e,
-	0x0048, 0x4d8d, 0xa302, 0x0078, 0x4d8e, 0x8002, 0x007c, 0x2d00,
-	0x7026, 0xa080, 0x000d, 0x7056, 0x7053, 0x0000, 0x127e, 0x2091,
-	0x8000, 0x2009, 0xa5d0, 0x2104, 0xc08d, 0x200a, 0x127f, 0x1078,
-	0x13eb, 0x007c, 0x2071, 0xa3e1, 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, 0xa3e1,
-	0x6848, 0xa005, 0x00c0, 0x4dcb, 0x7028, 0xc085, 0x702a, 0xa085,
-	0x0001, 0x0078, 0x4df0, 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, 0xa3e1, 0x7004, 0x1079, 0x4e50,
-	0x700c, 0x0079, 0x4dfb, 0x4e00, 0x4df5, 0x4df5, 0x4df5, 0x4df5,
-	0x007c, 0x700c, 0x0079, 0x4e04, 0x4e09, 0x4e4e, 0x4e4e, 0x4e4f,
-	0x4e4f, 0x7830, 0x7930, 0xa106, 0x0040, 0x4e13, 0x7830, 0x7930,
-	0xa106, 0x00c0, 0x4e39, 0x7030, 0xa10a, 0x0040, 0x4e39, 0x00c8,
-	0x4e1b, 0x712c, 0xa10a, 0xa18a, 0x0002, 0x00c8, 0x4e3a, 0x1078,
-	0x1366, 0x0040, 0x4e39, 0x2d00, 0x705a, 0x7063, 0x0040, 0x2001,
-	0x0003, 0x7057, 0x0000, 0x127e, 0x007e, 0x2091, 0x8000, 0x2009,
-	0xa5d0, 0x2104, 0xc085, 0x200a, 0x007f, 0x700e, 0x127f, 0x1078,
-	0x13eb, 0x007c, 0x1078, 0x1366, 0x0040, 0x4e39, 0x2d00, 0x705a,
-	0x1078, 0x1366, 0x00c0, 0x4e46, 0x0078, 0x4e25, 0x2d00, 0x7086,
-	0x7063, 0x0080, 0x2001, 0x0004, 0x0078, 0x4e29, 0x007c, 0x007c,
-	0x4e61, 0x4e62, 0x4e99, 0x4e9a, 0x4e4e, 0x4ed0, 0x4ed5, 0x4f0c,
-	0x4f0d, 0x4f28, 0x4f29, 0x4f2a, 0x4f2b, 0x4f2c, 0x4f2d, 0x4fad,
-	0x4fd7, 0x007c, 0x700c, 0x0079, 0x4e65, 0x4e6a, 0x4e6d, 0x4e7d,
-	0x4e98, 0x4e98, 0x1078, 0x4e01, 0x007c, 0x127e, 0x8001, 0x700e,
-	0x7058, 0x007e, 0x1078, 0x5348, 0x0040, 0x4e7a, 0x2091, 0x8000,
-	0x1078, 0x4e01, 0x0d7f, 0x0078, 0x4e86, 0x127e, 0x8001, 0x700e,
-	0x1078, 0x5348, 0x7058, 0x2068, 0x7084, 0x705a, 0x6803, 0x0000,
-	0x6807, 0x0000, 0x6834, 0xa084, 0x00ff, 0xa08a, 0x0020, 0x00c8,
-	0x4e95, 0x1079, 0x4eb0, 0x127f, 0x007c, 0x127f, 0x1078, 0x4f2e,
-	0x007c, 0x007c, 0x007c, 0x0e7e, 0x2071, 0xa3e1, 0x700c, 0x0079,
-	0x4ea1, 0x4ea6, 0x4ea6, 0x4ea6, 0x4ea8, 0x4eac, 0x0e7f, 0x007c,
-	0x700f, 0x0001, 0x0078, 0x4eae, 0x700f, 0x0002, 0x0e7f, 0x007c,
-	0x4f2e, 0x4f2e, 0x4f4a, 0x4f2e, 0x5080, 0x4f2e, 0x4f2e, 0x4f2e,
-	0x4f2e, 0x4f2e, 0x4f4a, 0x50ca, 0x5117, 0x5170, 0x5186, 0x4f2e,
-	0x4f2e, 0x4f66, 0x4f4a, 0x4f2e, 0x4f2e, 0x4f87, 0x5245, 0x5263,
-	0x4f2e, 0x4f66, 0x4f2e, 0x4f2e, 0x4f2e, 0x4f2e, 0x4f7c, 0x5263,
-	0x7020, 0x2068, 0x1078, 0x139a, 0x007c, 0x700c, 0x0079, 0x4ed8,
-	0x4edd, 0x4ee0, 0x4ef0, 0x4f0b, 0x4f0b, 0x1078, 0x4e01, 0x007c,
-	0x127e, 0x8001, 0x700e, 0x7058, 0x007e, 0x1078, 0x5348, 0x0040,
-	0x4eed, 0x2091, 0x8000, 0x1078, 0x4e01, 0x0d7f, 0x0078, 0x4ef9,
-	0x127e, 0x8001, 0x700e, 0x1078, 0x5348, 0x7058, 0x2068, 0x7084,
-	0x705a, 0x6803, 0x0000, 0x6807, 0x0000, 0x6834, 0xa084, 0x00ff,
-	0xa08a, 0x001a, 0x00c8, 0x4f08, 0x1079, 0x4f0e, 0x127f, 0x007c,
-	0x127f, 0x1078, 0x4f2e, 0x007c, 0x007c, 0x007c, 0x4f2e, 0x4f4a,
-	0x506a, 0x4f2e, 0x4f4a, 0x4f2e, 0x4f4a, 0x4f4a, 0x4f2e, 0x4f4a,
-	0x506a, 0x4f4a, 0x4f4a, 0x4f4a, 0x4f4a, 0x4f4a, 0x4f2e, 0x4f4a,
-	0x506a, 0x4f2e, 0x4f2e, 0x4f4a, 0x4f2e, 0x4f2e, 0x4f2e, 0x4f4a,
-	0x007c, 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, 0x7007, 0x0001,
-	0x6838, 0xa084, 0x00ff, 0xc0d5, 0x683a, 0x127e, 0x2091, 0x8000,
-	0x1078, 0x4982, 0x127f, 0x007c, 0x7007, 0x0001, 0x6838, 0xa084,
-	0x00ff, 0xc0e5, 0x683a, 0x127e, 0x2091, 0x8000, 0x1078, 0x4982,
-	0x127f, 0x007c, 0x7007, 0x0001, 0x6838, 0xa084, 0x00ff, 0xc0ed,
-	0x683a, 0x127e, 0x2091, 0x8000, 0x1078, 0x4982, 0x127f, 0x007c,
-	0x7007, 0x0001, 0x6838, 0xa084, 0x00ff, 0xc0dd, 0x683a, 0x127e,
-	0x2091, 0x8000, 0x1078, 0x4982, 0x127f, 0x007c, 0x6834, 0x8007,
-	0xa084, 0x00ff, 0x0040, 0x4f3c, 0x8001, 0x00c0, 0x4f73, 0x7007,
-	0x0001, 0x0078, 0x5049, 0x7007, 0x0006, 0x7012, 0x2d00, 0x7016,
-	0x701a, 0x704b, 0x5049, 0x007c, 0x684c, 0xa084, 0x00c0, 0xa086,
-	0x00c0, 0x00c0, 0x4f87, 0x7007, 0x0001, 0x0078, 0x5280, 0x2d00,
-	0x7016, 0x701a, 0x20a9, 0x0004, 0xa080, 0x0024, 0x2098, 0x20a1,
-	0xa40c, 0x53a3, 0x6858, 0x7012, 0xa082, 0x0401, 0x00c8, 0x4f58,
-	0x6884, 0xa08a, 0x0002, 0x00c8, 0x4f58, 0x82ff, 0x00c0, 0x4fa9,
-	0x6888, 0x698c, 0xa105, 0x0040, 0x4fa9, 0x2001, 0x5019, 0x0078,
-	0x4fac, 0xa280, 0x500f, 0x2004, 0x70c6, 0x7010, 0xa015, 0x0040,
-	0x4ff7, 0x1078, 0x1366, 0x00c0, 0x4fb8, 0x7007, 0x000f, 0x007c,
-	0x2d00, 0x7022, 0x70c4, 0x2060, 0x6000, 0x6836, 0x6004, 0xad00,
-	0x7096, 0x6008, 0xa20a, 0x00c8, 0x4fc7, 0xa00e, 0x2200, 0x7112,
-	0x620c, 0x8003, 0x800b, 0xa296, 0x0004, 0x0040, 0x4fd0, 0xa108,
-	0x719a, 0x810b, 0x719e, 0xae90, 0x0022, 0x1078, 0x13d1, 0x7090,
-	0xa08e, 0x0100, 0x0040, 0x4feb, 0xa086, 0x0200, 0x0040, 0x4fe3,
-	0x7007, 0x0010, 0x007c, 0x7020, 0x2068, 0x1078, 0x139a, 0x7014,
-	0x2068, 0x0078, 0x4f58, 0x7020, 0x2068, 0x7018, 0x6802, 0x6807,
-	0x0000, 0x2d08, 0x2068, 0x6906, 0x711a, 0x0078, 0x4fad, 0x7014,
-	0x2068, 0x7007, 0x0001, 0x6884, 0xa005, 0x00c0, 0x5006, 0x6888,
-	0x698c, 0xa105, 0x0040, 0x5006, 0x1078, 0x501d, 0x6834, 0xa084,
-	0x00ff, 0xa086, 0x001e, 0x0040, 0x5280, 0x0078, 0x5049, 0x5011,
-	0x5015, 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,
-	0x503f, 0xaef2, 0x0004, 0xaffa, 0x0006, 0x0078, 0x502c, 0x6004,
-	0xa065, 0x00c0, 0x5026, 0x067f, 0x077f, 0x0c7f, 0x0e7f, 0x0f7f,
-	0x007c, 0x2009, 0xa32e, 0x210c, 0x81ff, 0x00c0, 0x5064, 0x6838,
-	0xa084, 0x00ff, 0x683a, 0x1078, 0x4290, 0x00c0, 0x5058, 0x007c,
-	0x1078, 0x4a60, 0x127e, 0x2091, 0x8000, 0x1078, 0x8cb8, 0x1078,
-	0x4982, 0x127f, 0x0078, 0x5057, 0x2001, 0x0028, 0x2009, 0x0000,
-	0x0078, 0x5058, 0x7018, 0x6802, 0x2d08, 0x2068, 0x6906, 0x711a,
-	0x7010, 0x8001, 0x7012, 0x0040, 0x5079, 0x7007, 0x0006, 0x0078,
-	0x507f, 0x7014, 0x2068, 0x7007, 0x0001, 0x7048, 0x107a, 0x007c,
-	0x7007, 0x0001, 0x6944, 0x810f, 0xa18c, 0x00ff, 0x6848, 0xa084,
-	0x00ff, 0x20a9, 0x0001, 0xa096, 0x0001, 0x0040, 0x50a9, 0x2009,
-	0x0000, 0x20a9, 0x00ff, 0xa096, 0x0002, 0x0040, 0x50a9, 0xa005,
-	0x00c0, 0x50bc, 0x6944, 0x810f, 0xa18c, 0x00ff, 0x1078, 0x4501,
-	0x00c0, 0x50bc, 0x067e, 0x6e50, 0x1078, 0x45e7, 0x067f, 0x0078,
-	0x50bc, 0x047e, 0x2011, 0xa30c, 0x2224, 0xc484, 0xc48c, 0x2412,
-	0x047f, 0x0c7e, 0x1078, 0x4501, 0x00c0, 0x50b8, 0x1078, 0x4782,
-	0x8108, 0x00f0, 0x50b2, 0x0c7f, 0x684c, 0xd084, 0x00c0, 0x50c3,
-	0x1078, 0x139a, 0x007c, 0x127e, 0x2091, 0x8000, 0x1078, 0x4982,
-	0x127f, 0x007c, 0x127e, 0x2091, 0x8000, 0x7007, 0x0001, 0x2001,
-	0xa352, 0x2004, 0xd0a4, 0x0040, 0x510e, 0x2061, 0xa62d, 0x6100,
-	0xd184, 0x0040, 0x50ee, 0x6858, 0xa084, 0x00ff, 0x00c0, 0x5111,
-	0x6000, 0xd084, 0x0040, 0x510e, 0x6004, 0xa005, 0x00c0, 0x5114,
-	0x6003, 0x0000, 0x600b, 0x0000, 0x0078, 0x510b, 0x2011, 0x0001,
-	0x6860, 0xa005, 0x00c0, 0x50f6, 0x2001, 0x001e, 0x8000, 0x6016,
-	0x6858, 0xa084, 0x00ff, 0x0040, 0x510e, 0x6006, 0x6858, 0x8007,
-	0xa084, 0x00ff, 0x0040, 0x510e, 0x600a, 0x6858, 0x8000, 0x00c0,
-	0x510a, 0xc28d, 0x6202, 0x127f, 0x0078, 0x5337, 0x127f, 0x0078,
-	0x532f, 0x127f, 0x0078, 0x5327, 0x127f, 0x0078, 0x532b, 0x127e,
-	0x2091, 0x8000, 0x7007, 0x0001, 0x2001, 0xa352, 0x2004, 0xd0a4,
-	0x0040, 0x516d, 0x2061, 0xa62d, 0x6000, 0xd084, 0x0040, 0x516d,
-	0x6204, 0x6308, 0xd08c, 0x00c0, 0x515f, 0x6c48, 0xa484, 0x0003,
-	0x0040, 0x5145, 0x6958, 0xa18c, 0x00ff, 0x8001, 0x00c0, 0x513e,
-	0x2100, 0xa210, 0x0048, 0x516a, 0x0078, 0x5145, 0x8001, 0x00c0,
-	0x516a, 0x2100, 0xa212, 0x0048, 0x516a, 0xa484, 0x000c, 0x0040,
-	0x515f, 0x6958, 0x810f, 0xa18c, 0x00ff, 0xa082, 0x0004, 0x00c0,
-	0x5157, 0x2100, 0xa318, 0x0048, 0x516a, 0x0078, 0x515f, 0xa082,
-	0x0004, 0x00c0, 0x516a, 0x2100, 0xa31a, 0x0048, 0x516a, 0x6860,
-	0xa005, 0x0040, 0x5165, 0x8000, 0x6016, 0x6206, 0x630a, 0x127f,
-	0x0078, 0x5337, 0x127f, 0x0078, 0x5333, 0x127f, 0x0078, 0x532f,
-	0x127e, 0x2091, 0x8000, 0x7007, 0x0001, 0x2061, 0xa62d, 0x6300,
-	0xd38c, 0x00c0, 0x5180, 0x6308, 0x8318, 0x0048, 0x5183, 0x630a,
-	0x127f, 0x0078, 0x5345, 0x127f, 0x0078, 0x5333, 0x127e, 0x0c7e,
-	0x2091, 0x8000, 0x7007, 0x0001, 0x684c, 0xd0ac, 0x0040, 0x519a,
-	0x0c7e, 0x2061, 0xa62d, 0x6000, 0xa084, 0xfcff, 0x6002, 0x0c7f,
-	0x0078, 0x51c9, 0x6858, 0xa005, 0x0040, 0x51e0, 0x685c, 0xa065,
-	0x0040, 0x51dc, 0x2001, 0xa32e, 0x2004, 0xa005, 0x0040, 0x51ac,
-	0x1078, 0x8c01, 0x0078, 0x51ba, 0x6013, 0x0400, 0x6037, 0x0000,
-	0x694c, 0xd1a4, 0x0040, 0x51b6, 0x6950, 0x6136, 0x2009, 0x0041,
-	0x1078, 0x756c, 0x6958, 0xa18c, 0xff00, 0xa186, 0x2000, 0x00c0,
-	0x51c9, 0x027e, 0x2009, 0x0000, 0x2011, 0xfdff, 0x1078, 0x5a6d,
-	0x027f, 0x684c, 0xd0c4, 0x0040, 0x51d8, 0x2061, 0xa62d, 0x6000,
-	0xd08c, 0x00c0, 0x51d8, 0x6008, 0x8000, 0x0048, 0x51dc, 0x600a,
-	0x0c7f, 0x127f, 0x0078, 0x5337, 0x0c7f, 0x127f, 0x0078, 0x532f,
-	0x6954, 0xa186, 0x0045, 0x0040, 0x5213, 0xa186, 0x002a, 0x00c0,
-	0x51f0, 0x2001, 0xa30c, 0x200c, 0xc194, 0x2102, 0x0078, 0x51c9,
-	0xa186, 0x0020, 0x0040, 0x5209, 0xa186, 0x0029, 0x0040, 0x51fc,
-	0xa186, 0x002d, 0x00c0, 0x51dc, 0x6944, 0xa18c, 0xff00, 0x810f,
-	0x1078, 0x4501, 0x00c0, 0x51c9, 0x6000, 0xc0e4, 0x6002, 0x0078,
-	0x51c9, 0x685c, 0xa065, 0x0040, 0x51dc, 0x2001, 0xa5a1, 0x2004,
-	0x6016, 0x0078, 0x51c9, 0x685c, 0xa065, 0x0040, 0x51dc, 0x0e7e,
-	0x6860, 0xa075, 0x2001, 0xa32e, 0x2004, 0xa005, 0x0040, 0x522b,
-	0x1078, 0x8c01, 0x8eff, 0x0040, 0x5228, 0x2e60, 0x1078, 0x8c01,
-	0x0e7f, 0x0078, 0x51c9, 0x6024, 0xc0dc, 0xc0d5, 0x6026, 0x2e60,
-	0x6007, 0x003a, 0x6870, 0xa005, 0x0040, 0x523c, 0x6007, 0x003b,
-	0x6874, 0x602a, 0x6878, 0x6012, 0x6003, 0x0001, 0x1078, 0x5bf8,
-	0x1078, 0x6109, 0x0e7f, 0x0078, 0x51c9, 0x2061, 0xa62d, 0x6000,
-	0xd084, 0x0040, 0x525f, 0xd08c, 0x00c0, 0x5345, 0x2091, 0x8000,
-	0x6204, 0x8210, 0x0048, 0x5259, 0x6206, 0x2091, 0x8001, 0x0078,
-	0x5345, 0x2091, 0x8001, 0x6853, 0x0016, 0x0078, 0x533e, 0x6853,
-	0x0007, 0x0078, 0x533e, 0x6834, 0x8007, 0xa084, 0x00ff, 0x00c0,
-	0x526d, 0x1078, 0x4f3c, 0x0078, 0x527f, 0x2030, 0x8001, 0x00c0,
-	0x5277, 0x7007, 0x0001, 0x1078, 0x5280, 0x0078, 0x527f, 0x7007,
-	0x0006, 0x7012, 0x2d00, 0x7016, 0x701a, 0x704b, 0x5280, 0x007c,
-	0x0e7e, 0x127e, 0x2091, 0x8000, 0x2009, 0xa32e, 0x210c, 0x81ff,
-	0x00c0, 0x530b, 0x2009, 0xa30c, 0x210c, 0xd194, 0x00c0, 0x5315,
-	0x6848, 0x2070, 0xae82, 0xaa00, 0x0048, 0x52fb, 0x2001, 0xa315,
-	0x2004, 0xae02, 0x00c8, 0x52fb, 0x2061, 0xa62d, 0x6100, 0xa184,
-	0x0301, 0xa086, 0x0001, 0x00c0, 0x52de, 0x711c, 0xa186, 0x0006,
-	0x00c0, 0x52e6, 0x7018, 0xa005, 0x0040, 0x530b, 0x2004, 0xd0e4,
-	0x00c0, 0x530f, 0x7024, 0xd0dc, 0x00c0, 0x5319, 0x6853, 0x0000,
-	0x6803, 0x0000, 0x2d08, 0x7010, 0xa005, 0x00c0, 0x52ca, 0x7112,
-	0x684c, 0xd0f4, 0x00c0, 0x531d, 0x2e60, 0x1078, 0x59b6, 0x127f,
-	0x0e7f, 0x007c, 0x2068, 0x6800, 0xa005, 0x00c0, 0x52ca, 0x6902,
-	0x2168, 0x684c, 0xd0f4, 0x00c0, 0x531d, 0x127f, 0x0e7f, 0x007c,
-	0x127f, 0x0e7f, 0x6853, 0x0006, 0x0078, 0x533e, 0xd184, 0x0040,
-	0x52d8, 0xd1c4, 0x00c0, 0x52ff, 0x0078, 0x5303, 0x6944, 0xa18c,
-	0xff00, 0x810f, 0x1078, 0x4501, 0x00c0, 0x530f, 0x6000, 0xd0e4,
-	0x00c0, 0x530f, 0x711c, 0xa186, 0x0007, 0x00c0, 0x52fb, 0x6853,
-	0x0002, 0x0078, 0x5311, 0x6853, 0x0008, 0x0078, 0x5311, 0x6853,
-	0x000e, 0x0078, 0x5311, 0x6853, 0x0017, 0x0078, 0x5311, 0x6853,
-	0x0035, 0x0078, 0x5311, 0x6853, 0x0028, 0x0078, 0x5311, 0x6853,
-	0x0029, 0x127f, 0x0e7f, 0x0078, 0x533e, 0x6853, 0x002a, 0x0078,
-	0x5311, 0x6853, 0x0045, 0x0078, 0x5311, 0x2e60, 0x2019, 0x0002,
-	0x6017, 0x0014, 0x1078, 0x9a6a, 0x127f, 0x0e7f, 0x007c, 0x2009,
-	0x003e, 0x0078, 0x5339, 0x2009, 0x0004, 0x0078, 0x5339, 0x2009,
-	0x0006, 0x0078, 0x5339, 0x2009, 0x0016, 0x0078, 0x5339, 0x2009,
-	0x0001, 0x6854, 0xa084, 0xff00, 0xa105, 0x6856, 0x2091, 0x8000,
-	0x1078, 0x4982, 0x2091, 0x8001, 0x007c, 0x1078, 0x139a, 0x007c,
-	0x702c, 0x7130, 0x8108, 0xa102, 0x0048, 0x5355, 0xa00e, 0x7034,
-	0x7072, 0x7038, 0x7076, 0x0078, 0x5361, 0x7070, 0xa080, 0x0040,
-	0x7072, 0x00c8, 0x5361, 0x7074, 0xa081, 0x0000, 0x7076, 0xa085,
-	0x0001, 0x7932, 0x7132, 0x007c, 0x0d7e, 0x1078, 0x59ad, 0x0d7f,
-	0x007c, 0x0d7e, 0x2011, 0x0004, 0x2204, 0xa085, 0x8002, 0x2012,
-	0x0d7f, 0x007c, 0x20e1, 0x0002, 0x3d08, 0x20e1, 0x2000, 0x3d00,
-	0xa084, 0x7000, 0x0040, 0x5380, 0xa086, 0x1000, 0x00c0, 0x53ac,
-	0x20e1, 0x0000, 0x3d00, 0xa094, 0xff00, 0x8217, 0xa084, 0xf000,
-	0xa086, 0x3000, 0x00c0, 0x5390, 0x1078, 0x5570, 0x0078, 0x53a7,
-	0x20e1, 0x0004, 0x3d60, 0xd1bc, 0x00c0, 0x5397, 0x3e60, 0xac84,
-	0x000f, 0x00c0, 0x53ac, 0xac82, 0xaa00, 0x0048, 0x53ac, 0x6854,
-	0xac02, 0x00c8, 0x53ac, 0x2009, 0x0047, 0x1078, 0x756c, 0x7a1c,
-	0xd284, 0x00c0, 0x5372, 0x007c, 0xa016, 0x1078, 0x15ec, 0x0078,
-	0x53a7, 0x0078, 0x53ac, 0x781c, 0xd08c, 0x0040, 0x53db, 0x157e,
-	0x137e, 0x147e, 0x20e1, 0x3000, 0x3d20, 0x3e28, 0xa584, 0x0076,
-	0x00c0, 0x53f1, 0xa484, 0x7000, 0xa086, 0x1000, 0x00c0, 0x53e0,
-	0x1078, 0x540c, 0x0040, 0x53f1, 0x20e1, 0x3000, 0x7828, 0x7828,
-	0x1078, 0x542a, 0x147f, 0x137f, 0x157f, 0x2009, 0xa5b3, 0x2104,
-	0xa005, 0x00c0, 0x53dc, 0x007c, 0x1078, 0x6109, 0x0078, 0x53db,
-	0xa484, 0x7000, 0x00c0, 0x53f1, 0x1078, 0x540c, 0x0040, 0x5403,
-	0x7000, 0xa084, 0xff00, 0xa086, 0x8100, 0x0040, 0x53cc, 0x0078,
-	0x5403, 0x1078, 0xa1ee, 0xd5a4, 0x0040, 0x53ff, 0x1078, 0x1af7,
-	0x20e1, 0x9010, 0x2001, 0x0138, 0x2202, 0x0078, 0x5407, 0x1078,
-	0x540c, 0x687f, 0x0000, 0x20e1, 0x3000, 0x7828, 0x7828, 0x147f,
-	0x137f, 0x157f, 0x0078, 0x53db, 0xa484, 0x01ff, 0x687e, 0xa005,
-	0x0040, 0x541e, 0xa080, 0x001f, 0xa084, 0x03f8, 0x80ac, 0x20e1,
-	0x1000, 0x2ea0, 0x2099, 0x020a, 0x53a5, 0x007c, 0x20a9, 0x000c,
-	0x20e1, 0x1000, 0x2ea0, 0x2099, 0x020a, 0x53a5, 0xa085, 0x0001,
-	0x0078, 0x541d, 0x7000, 0xa084, 0xff00, 0xa08c, 0xf000, 0x8007,
-	0xa196, 0x0000, 0x00c0, 0x5437, 0x0078, 0x567c, 0x007c, 0xa196,
-	0x2000, 0x00c0, 0x5448, 0x6900, 0xa18e, 0x0001, 0x00c0, 0x5444,
-	0x1078, 0x3a43, 0x0078, 0x5436, 0x1078, 0x5450, 0x0078, 0x5436,
-	0xa196, 0x8000, 0x00c0, 0x5436, 0x1078, 0x570c, 0x0078, 0x5436,
-	0x0c7e, 0x7110, 0xa18c, 0xff00, 0x810f, 0xa196, 0x0001, 0x0040,
-	0x545d, 0xa196, 0x0023, 0x00c0, 0x5568, 0xa08e, 0x0023, 0x00c0,
-	0x5492, 0x1078, 0x57b2, 0x0040, 0x5568, 0x7124, 0x610a, 0x7030,
-	0xa08e, 0x0200, 0x00c0, 0x5476, 0x7034, 0xa005, 0x00c0, 0x5568,
-	0x2009, 0x0015, 0x1078, 0x756c, 0x0078, 0x5568, 0xa08e, 0x0214,
-	0x0040, 0x547e, 0xa08e, 0x0210, 0x00c0, 0x5484, 0x2009, 0x0015,
-	0x1078, 0x756c, 0x0078, 0x5568, 0xa08e, 0x0100, 0x00c0, 0x5568,
-	0x7034, 0xa005, 0x00c0, 0x5568, 0x2009, 0x0016, 0x1078, 0x756c,
-	0x0078, 0x5568, 0xa08e, 0x0022, 0x00c0, 0x5568, 0x7030, 0xa08e,
-	0x0300, 0x00c0, 0x54a3, 0x7034, 0xa005, 0x00c0, 0x5568, 0x2009,
-	0x0017, 0x0078, 0x5534, 0xa08e, 0x0500, 0x00c0, 0x54af, 0x7034,
-	0xa005, 0x00c0, 0x5568, 0x2009, 0x0018, 0x0078, 0x5534, 0xa08e,
-	0x2010, 0x00c0, 0x54b7, 0x2009, 0x0019, 0x0078, 0x5534, 0xa08e,
-	0x2110, 0x00c0, 0x54bf, 0x2009, 0x001a, 0x0078, 0x5534, 0xa08e,
-	0x5200, 0x00c0, 0x54cb, 0x7034, 0xa005, 0x00c0, 0x5568, 0x2009,
-	0x001b, 0x0078, 0x5534, 0xa08e, 0x5000, 0x00c0, 0x54d7, 0x7034,
-	0xa005, 0x00c0, 0x5568, 0x2009, 0x001c, 0x0078, 0x5534, 0xa08e,
-	0x1300, 0x00c0, 0x54df, 0x2009, 0x0034, 0x0078, 0x5534, 0xa08e,
-	0x1200, 0x00c0, 0x54eb, 0x7034, 0xa005, 0x00c0, 0x5568, 0x2009,
-	0x0024, 0x0078, 0x5534, 0xa08c, 0xff00, 0xa18e, 0x2400, 0x00c0,
-	0x54f5, 0x2009, 0x002d, 0x0078, 0x5534, 0xa08c, 0xff00, 0xa18e,
-	0x5300, 0x00c0, 0x54ff, 0x2009, 0x002a, 0x0078, 0x5534, 0xa08e,
-	0x0f00, 0x00c0, 0x5507, 0x2009, 0x0020, 0x0078, 0x5534, 0xa08e,
-	0x5300, 0x00c0, 0x550d, 0x0078, 0x552a, 0xa08e, 0x6104, 0x00c0,
-	0x552a, 0x2011, 0xa88d, 0x8208, 0x2204, 0xa082, 0x0004, 0x20a8,
-	0x95ac, 0x95ac, 0x2011, 0x8015, 0x211c, 0x8108, 0x047e, 0x2124,
-	0x1078, 0x3579, 0x047f, 0x8108, 0x00f0, 0x551a, 0x2009, 0x0023,
-	0x0078, 0x5534, 0xa08e, 0x6000, 0x00c0, 0x5532, 0x2009, 0x003f,
-	0x0078, 0x5534, 0x2009, 0x001d, 0x017e, 0x2011, 0xa883, 0x2204,
-	0x8211, 0x220c, 0x1078, 0x24e3, 0x00c0, 0x556a, 0x1078, 0x4499,
-	0x00c0, 0x556a, 0x6612, 0x6516, 0x86ff, 0x0040, 0x555a, 0x017f,
-	0x017e, 0xa186, 0x0017, 0x00c0, 0x555a, 0x6868, 0xa606, 0x00c0,
-	0x555a, 0x686c, 0xa506, 0xa084, 0xff00, 0x00c0, 0x555a, 0x6000,
-	0xc0f5, 0x6002, 0x0c7e, 0x1078, 0x74d7, 0x0040, 0x556d, 0x017f,
-	0x611a, 0x601f, 0x0004, 0x7120, 0x610a, 0x017f, 0x1078, 0x756c,
-	0x0c7f, 0x007c, 0x017f, 0x0078, 0x5568, 0x0c7f, 0x0078, 0x556a,
-	0x0c7e, 0x1078, 0x55d4, 0x00c0, 0x55d2, 0xa184, 0xff00, 0x8007,
-	0xa086, 0x0008, 0x00c0, 0x55d2, 0xa28e, 0x0033, 0x00c0, 0x55a3,
-	0x1078, 0x57b2, 0x0040, 0x55d2, 0x7124, 0x610a, 0x7030, 0xa08e,
-	0x0200, 0x00c0, 0x5595, 0x7034, 0xa005, 0x00c0, 0x55d2, 0x2009,
-	0x0015, 0x1078, 0x756c, 0x0078, 0x55d2, 0xa08e, 0x0100, 0x00c0,
-	0x55d2, 0x7034, 0xa005, 0x00c0, 0x55d2, 0x2009, 0x0016, 0x1078,
-	0x756c, 0x0078, 0x55d2, 0xa28e, 0x0032, 0x00c0, 0x55d2, 0x7030,
-	0xa08e, 0x1400, 0x00c0, 0x55d2, 0x2009, 0x0038, 0x017e, 0x2011,
-	0xa883, 0x2204, 0x8211, 0x220c, 0x1078, 0x24e3, 0x00c0, 0x55d1,
-	0x1078, 0x4499, 0x00c0, 0x55d1, 0x6612, 0x6516, 0x0c7e, 0x1078,
-	0x74d7, 0x0040, 0x55d0, 0x017f, 0x611a, 0x601f, 0x0004, 0x7120,
-	0x610a, 0x017f, 0x1078, 0x756c, 0x1078, 0x6109, 0x0078, 0x55d2,
-	0x0c7f, 0x017f, 0x0c7f, 0x007c, 0x0f7e, 0x0d7e, 0x027e, 0x017e,
-	0x137e, 0x147e, 0x157e, 0x3c00, 0x007e, 0x2079, 0x0030, 0x2069,
-	0x0200, 0x1078, 0x1c25, 0x00c0, 0x5615, 0x1078, 0x1b15, 0x0040,
-	0x561f, 0x7908, 0xa18c, 0x1fff, 0xa182, 0x0011, 0x00c8, 0x561f,
-	0x20a9, 0x000c, 0x20e1, 0x0000, 0x2ea0, 0x2099, 0x020a, 0x53a5,
-	0x20e1, 0x2000, 0x2001, 0x020a, 0x2004, 0x7a0c, 0x7808, 0xa080,
-	0x0007, 0xa084, 0x1ff8, 0xa08a, 0x0140, 0x10c8, 0x1328, 0x80ac,
-	0x20e1, 0x6000, 0x2099, 0x020a, 0x53a5, 0x20e1, 0x7000, 0x6828,
-	0x6828, 0x7803, 0x0004, 0xa294, 0x0070, 0x007f, 0x20e0, 0x157f,
-	0x147f, 0x137f, 0x017f, 0x027f, 0x0d7f, 0x0f7f, 0x007c, 0xa085,
-	0x0001, 0x0078, 0x5615, 0x047e, 0x0e7e, 0x0d7e, 0x2028, 0x2130,
-	0xa696, 0x00ff, 0x00c0, 0x5644, 0xa596, 0xfffd, 0x00c0, 0x5634,
-	0x2009, 0x007f, 0x0078, 0x5677, 0xa596, 0xfffe, 0x00c0, 0x563c,
-	0x2009, 0x007e, 0x0078, 0x5677, 0xa596, 0xfffc, 0x00c0, 0x5644,
-	0x2009, 0x0080, 0x0078, 0x5677, 0x2011, 0x0000, 0x2021, 0x0081,
-	0x20a9, 0x007e, 0x2071, 0xa4b5, 0x2e1c, 0x83ff, 0x00c0, 0x5656,
-	0x82ff, 0x00c0, 0x566b, 0x2410, 0x0078, 0x566b, 0x2368, 0x6f10,
-	0x007e, 0x2100, 0xa706, 0x007f, 0x6b14, 0x00c0, 0x5665, 0xa346,
-	0x00c0, 0x5665, 0x2408, 0x0078, 0x5677, 0x87ff, 0x00c0, 0x566b,
-	0x83ff, 0x0040, 0x5650, 0x8420, 0x8e70, 0x00f0, 0x564c, 0x82ff,
-	0x00c0, 0x5676, 0xa085, 0x0001, 0x0078, 0x5678, 0x2208, 0xa006,
-	0x0d7f, 0x0e7f, 0x047f, 0x007c, 0xa084, 0x0007, 0x0079, 0x5681,
-	0x007c, 0x5689, 0x5689, 0x5689, 0x57c8, 0x5689, 0x568a, 0x56a3,
-	0x56f3, 0x007c, 0x7110, 0xd1bc, 0x0040, 0x56a2, 0x7120, 0x2160,
-	0xac8c, 0x000f, 0x00c0, 0x56a2, 0xac8a, 0xaa00, 0x0048, 0x56a2,
-	0x6854, 0xac02, 0x00c8, 0x56a2, 0x7124, 0x610a, 0x2009, 0x0046,
-	0x1078, 0x756c, 0x007c, 0x0c7e, 0x7110, 0xd1bc, 0x00c0, 0x56f1,
-	0x2011, 0xa883, 0x2204, 0x8211, 0x220c, 0x1078, 0x24e3, 0x00c0,
-	0x56f1, 0x1078, 0x4499, 0x00c0, 0x56f1, 0x6612, 0x6516, 0x6000,
-	0xd0ec, 0x00c0, 0x56f1, 0x6204, 0xa294, 0xff00, 0x8217, 0xa286,
-	0x0006, 0x00c0, 0x56d6, 0x0c7e, 0x1078, 0x74d7, 0x017f, 0x0040,
-	0x56f1, 0x611a, 0x601f, 0x0006, 0x7120, 0x610a, 0x7130, 0x6122,
-	0x2009, 0x0044, 0x1078, 0x756c, 0x0078, 0x56f1, 0x0c7e, 0x1078,
-	0x74d7, 0x017f, 0x0040, 0x56f1, 0x611a, 0x601f, 0x0004, 0x7120,
-	0x610a, 0xa286, 0x0004, 0x00c0, 0x56e9, 0x6007, 0x0005, 0x0078,
-	0x56eb, 0x6007, 0x0001, 0x6003, 0x0001, 0x1078, 0x5c45, 0x1078,
-	0x6109, 0x0c7f, 0x007c, 0x7110, 0xd1bc, 0x0040, 0x570b, 0x7020,
-	0x2060, 0xac84, 0x000f, 0x00c0, 0x570b, 0xac82, 0xaa00, 0x0048,
-	0x570b, 0x6854, 0xac02, 0x00c8, 0x570b, 0x7124, 0x610a, 0x2009,
-	0x0045, 0x1078, 0x756c, 0x007c, 0x7110, 0xa18c, 0xff00, 0x810f,
-	0xa18e, 0x0000, 0x00c0, 0x571c, 0xa084, 0x000f, 0xa08a, 0x0006,
-	0x00c8, 0x571c, 0x1079, 0x571d, 0x007c, 0x5723, 0x5724, 0x5723,
-	0x5723, 0x5794, 0x57a3, 0x007c, 0x7110, 0xd1bc, 0x0040, 0x572c,
-	0x702c, 0xd084, 0x0040, 0x5793, 0x700c, 0x7108, 0x1078, 0x24e3,
-	0x00c0, 0x5793, 0x1078, 0x4499, 0x00c0, 0x5793, 0x6612, 0x6516,
-	0x6204, 0x7110, 0xd1bc, 0x0040, 0x575e, 0xa28c, 0x00ff, 0xa186,
-	0x0004, 0x0040, 0x5747, 0xa186, 0x0006, 0x00c0, 0x5784, 0x0c7e,
-	0x1078, 0x57b2, 0x0c7f, 0x0040, 0x5793, 0x0c7e, 0x1078, 0x74d7,
-	0x017f, 0x0040, 0x5793, 0x611a, 0x601f, 0x0002, 0x7120, 0x610a,
-	0x2009, 0x0088, 0x1078, 0x756c, 0x0078, 0x5793, 0xa28c, 0x00ff,
-	0xa186, 0x0006, 0x0040, 0x5773, 0xa186, 0x0004, 0x0040, 0x5773,
-	0xa294, 0xff00, 0x8217, 0xa286, 0x0004, 0x0040, 0x5773, 0xa286,
-	0x0006, 0x00c0, 0x5784, 0x0c7e, 0x1078, 0x74d7, 0x017f, 0x0040,
-	0x5793, 0x611a, 0x601f, 0x0005, 0x7120, 0x610a, 0x2009, 0x0088,
-	0x1078, 0x756c, 0x0078, 0x5793, 0x0c7e, 0x1078, 0x74d7, 0x017f,
-	0x0040, 0x5793, 0x611a, 0x601f, 0x0004, 0x7120, 0x610a, 0x2009,
-	0x0001, 0x1078, 0x756c, 0x007c, 0x7110, 0xd1bc, 0x0040, 0x57a2,
-	0x1078, 0x57b2, 0x0040, 0x57a2, 0x7124, 0x610a, 0x2009, 0x0089,
-	0x1078, 0x756c, 0x007c, 0x7110, 0xd1bc, 0x0040, 0x57b1, 0x1078,
-	0x57b2, 0x0040, 0x57b1, 0x7124, 0x610a, 0x2009, 0x008a, 0x1078,
-	0x756c, 0x007c, 0x7020, 0x2060, 0xac84, 0x000f, 0x00c0, 0x57c5,
-	0xac82, 0xaa00, 0x0048, 0x57c5, 0x2001, 0xa315, 0x2004, 0xac02,
-	0x00c8, 0x57c5, 0xa085, 0x0001, 0x007c, 0xa006, 0x0078, 0x57c4,
-	0x7110, 0xd1bc, 0x00c0, 0x57de, 0x7024, 0x2060, 0xac84, 0x000f,
-	0x00c0, 0x57de, 0xac82, 0xaa00, 0x0048, 0x57de, 0x6854, 0xac02,
-	0x00c8, 0x57de, 0x2009, 0x0051, 0x1078, 0x756c, 0x007c, 0x2071,
-	0xa5be, 0x7003, 0x0003, 0x700f, 0x0361, 0xa006, 0x701a, 0x7012,
-	0x7017, 0xaa00, 0x7007, 0x0000, 0x7026, 0x702b, 0x6c4e, 0x7032,
-	0x7037, 0x6ca0, 0x703b, 0x0002, 0x703f, 0x0000, 0x7043, 0xffff,
-	0x7047, 0xffff, 0x007c, 0x2071, 0xa5be, 0x00e0, 0x58c1, 0x2091,
-	0x6000, 0x700c, 0x8001, 0x700e, 0x00c0, 0x5873, 0x700f, 0x0361,
-	0x7007, 0x0001, 0x127e, 0x2091, 0x8000, 0x7138, 0x8109, 0x713a,
-	0x00c0, 0x5871, 0x703b, 0x0002, 0x2009, 0x0100, 0x2104, 0xa082,
-	0x0003, 0x00c8, 0x5871, 0x703c, 0xa086, 0x0001, 0x00c0, 0x584e,
-	0x0d7e, 0x2069, 0x0140, 0x6804, 0xa084, 0x4000, 0x0040, 0x582c,
-	0x6803, 0x1000, 0x0078, 0x5833, 0x6804, 0xa084, 0x1000, 0x0040,
-	0x5833, 0x6803, 0x0100, 0x6803, 0x0000, 0x703f, 0x0000, 0x2069,
-	0xa5ab, 0x6804, 0xa082, 0x0006, 0x00c0, 0x5840, 0x6807, 0x0000,
-	0x6830, 0xa082, 0x0003, 0x00c0, 0x5847, 0x6833, 0x0000, 0x1078,
-	0x6109, 0x1078, 0x61d3, 0x0d7f, 0x0078, 0x5871, 0x0d7e, 0x2069,
-	0xa300, 0x6944, 0x6860, 0xa102, 0x00c8, 0x5870, 0x2069, 0xa5ab,
-	0x6804, 0xa086, 0x0000, 0x00c0, 0x5870, 0x6830, 0xa086, 0x0000,
-	0x00c0, 0x5870, 0x703f, 0x0001, 0x6807, 0x0006, 0x6833, 0x0003,
-	0x2069, 0x0100, 0x6830, 0x689e, 0x2069, 0x0140, 0x6803, 0x0600,
-	0x0d7f, 0x0078, 0x5876, 0x127e, 0x2091, 0x8000, 0x7024, 0xa00d,
-	0x0040, 0x588e, 0x7020, 0x8001, 0x7022, 0x00c0, 0x588e, 0x7023,
-	0x0009, 0x8109, 0x7126, 0xa186, 0x03e8, 0x00c0, 0x5889, 0x7028,
-	0x107a, 0x81ff, 0x00c0, 0x588e, 0x7028, 0x107a, 0x7030, 0xa00d,
-	0x0040, 0x589f, 0x702c, 0x8001, 0x702e, 0x00c0, 0x589f, 0x702f,
-	0x0009, 0x8109, 0x7132, 0x00c0, 0x589f, 0x7034, 0x107a, 0x7040,
-	0xa005, 0x0040, 0x58a7, 0x0050, 0x58a7, 0x8001, 0x7042, 0x7044,
-	0xa005, 0x0040, 0x58af, 0x0050, 0x58af, 0x8001, 0x7046, 0x7018,
-	0xa00d, 0x0040, 0x58c0, 0x7008, 0x8001, 0x700a, 0x00c0, 0x58c0,
-	0x700b, 0x0009, 0x8109, 0x711a, 0x00c0, 0x58c0, 0x701c, 0x107a,
-	0x127f, 0x7004, 0x0079, 0x58c4, 0x58eb, 0x58ec, 0x5908, 0x0e7e,
-	0x2071, 0xa5be, 0x7018, 0xa005, 0x00c0, 0x58d2, 0x711a, 0x721e,
-	0x700b, 0x0009, 0x0e7f, 0x007c, 0x0e7e, 0x007e, 0x2071, 0xa5be,
-	0x701c, 0xa206, 0x00c0, 0x58de, 0x701a, 0x701e, 0x007f, 0x0e7f,
-	0x007c, 0x0e7e, 0x2071, 0xa5be, 0x6088, 0xa102, 0x0048, 0x58e9,
-	0x618a, 0x0e7f, 0x007c, 0x007c, 0x7110, 0x1078, 0x4501, 0x00c0,
-	0x58fe, 0x6088, 0x8001, 0x0048, 0x58fe, 0x608a, 0x00c0, 0x58fe,
-	0x127e, 0x2091, 0x8000, 0x1078, 0x6109, 0x127f, 0x8108, 0xa182,
-	0x00ff, 0x0048, 0x5906, 0xa00e, 0x7007, 0x0002, 0x7112, 0x007c,
-	0x7014, 0x2060, 0x127e, 0x2091, 0x8000, 0x603c, 0xa005, 0x0040,
-	0x5917, 0x8001, 0x603e, 0x00c0, 0x5917, 0x1078, 0x8cd7, 0x6014,
-	0xa005, 0x0040, 0x5941, 0x8001, 0x6016, 0x00c0, 0x5941, 0x611c,
-	0xa186, 0x0003, 0x0040, 0x5928, 0xa186, 0x0006, 0x00c0, 0x593f,
-	0x6010, 0x2068, 0x6854, 0xa08a, 0x199a, 0x0048, 0x593f, 0xa082,
-	0x1999, 0x6856, 0xa08a, 0x199a, 0x0048, 0x5938, 0x2001, 0x1999,
-	0x8003, 0x800b, 0x810b, 0xa108, 0x6116, 0x0078, 0x5941, 0x1078,
-	0x8810, 0x127f, 0xac88, 0x0010, 0x7116, 0x2001, 0xca00, 0xa102,
-	0x0048, 0x594e, 0x7017, 0xaa00, 0x7007, 0x0000, 0x007c, 0x0e7e,
-	0x2071, 0xa5be, 0x7027, 0x07d0, 0x7023, 0x0009, 0x703b, 0x0002,
-	0x0e7f, 0x007c, 0x2001, 0xa5c7, 0x2003, 0x0000, 0x007c, 0x0e7e,
-	0x2071, 0xa5be, 0x7132, 0x702f, 0x0009, 0x0e7f, 0x007c, 0x2011,
-	0xa5ca, 0x2013, 0x0000, 0x007c, 0x0e7e, 0x2071, 0xa5be, 0x711a,
-	0x721e, 0x700b, 0x0009, 0x0e7f, 0x007c, 0x027e, 0x0e7e, 0x0f7e,
-	0x2079, 0xa300, 0x7a34, 0xd294, 0x0040, 0x59a4, 0x2071, 0xa5aa,
-	0x2e14, 0xa0fe, 0x0000, 0x0040, 0x5991, 0xa0fe, 0x0001, 0x0040,
-	0x5995, 0xa0fe, 0x0002, 0x00c0, 0x59a0, 0xa292, 0x0085, 0x0078,
-	0x5997, 0xa292, 0x0005, 0x0078, 0x5997, 0xa292, 0x0002, 0x2272,
-	0x0040, 0x599c, 0x00c8, 0x59a4, 0x2011, 0x8037, 0x1078, 0x3579,
-	0x2011, 0xa5a9, 0x2204, 0x2072, 0x0f7f, 0x0e7f, 0x027f, 0x007c,
-	0x0c7e, 0x2061, 0xa62d, 0x0c7f, 0x007c, 0xa184, 0x000f, 0x8003,
-	0x8003, 0x8003, 0xa080, 0xa62d, 0x2060, 0x007c, 0x6854, 0xa08a,
-	0x199a, 0x0048, 0x59bd, 0x2001, 0x1999, 0xa005, 0x00c0, 0x59cc,
-	0x0c7e, 0x2061, 0xa62d, 0x6014, 0x0c7f, 0xa005, 0x00c0, 0x59d1,
-	0x2001, 0x001e, 0x0078, 0x59d1, 0xa08e, 0xffff, 0x00c0, 0x59d1,
-	0xa006, 0x8003, 0x800b, 0x810b, 0xa108, 0x6116, 0x684c, 0xa08c,
-	0x00c0, 0xa18e, 0x00c0, 0x0040, 0x5a24, 0xd0b4, 0x00c0, 0x59e8,
-	0xd0bc, 0x00c0, 0x5a14, 0x2009, 0x0006, 0x1078, 0x5a43, 0x007c,
-	0xd0fc, 0x0040, 0x59f3, 0xa084, 0x0003, 0x0040, 0x59f3, 0xa086,
-	0x0003, 0x00c0, 0x5a3c, 0x6024, 0xd0d4, 0x0040, 0x59fd, 0xc0d4,
-	0x6026, 0x6860, 0x602a, 0x685c, 0x602e, 0x2009, 0xa373, 0x2104,
-	0xd084, 0x0040, 0x5a0f, 0x6118, 0xa188, 0x0027, 0x2104, 0xd08c,
-	0x00c0, 0x5a0f, 0x2009, 0x0042, 0x1078, 0x756c, 0x007c, 0x2009,
-	0x0043, 0x1078, 0x756c, 0x007c, 0xd0fc, 0x0040, 0x5a1f, 0xa084,
-	0x0003, 0x0040, 0x5a1f, 0xa086, 0x0003, 0x00c0, 0x5a3c, 0x2009,
-	0x0042, 0x1078, 0x756c, 0x007c, 0xd0fc, 0x0040, 0x5a32, 0xa084,
-	0x0003, 0xa08e, 0x0002, 0x0040, 0x5a36, 0x2009, 0x0041, 0x1078,
-	0x756c, 0x007c, 0x1078, 0x5a41, 0x0078, 0x5a31, 0x2009, 0x0043,
-	0x1078, 0x756c, 0x0078, 0x5a31, 0x2009, 0x0004, 0x1078, 0x5a43,
-	0x007c, 0x2009, 0x0001, 0x0d7e, 0x6010, 0xa0ec, 0xf000, 0x0040,
-	0x5a6b, 0x2068, 0x6952, 0x6800, 0x6012, 0xa186, 0x0001, 0x00c0,
-	0x5a65, 0x694c, 0xa18c, 0x8100, 0xa18e, 0x8100, 0x00c0, 0x5a65,
-	0x0c7e, 0x2061, 0xa62d, 0x6200, 0xd28c, 0x00c0, 0x5a64, 0x6204,
-	0x8210, 0x0048, 0x5a64, 0x6206, 0x0c7f, 0x1078, 0x4982, 0x6010,
-	0xa06d, 0x10c0, 0x59b6, 0x0d7f, 0x007c, 0x157e, 0x0c7e, 0x2061,
-	0xa62d, 0x6000, 0x81ff, 0x0040, 0x5a78, 0xa205, 0x0078, 0x5a79,
-	0xa204, 0x6002, 0x0c7f, 0x157f, 0x007c, 0x6800, 0xd08c, 0x00c0,
-	0x5a89, 0x6808, 0xa005, 0x0040, 0x5a89, 0x8001, 0x680a, 0xa085,
-	0x0001, 0x007c, 0x20a9, 0x0010, 0xa006, 0x8004, 0x8086, 0x818e,
-	0x00c8, 0x5a93, 0xa200, 0x00f0, 0x5a8e, 0x8086, 0x818e, 0x007c,
-	0x157e, 0x20a9, 0x0010, 0xa005, 0x0040, 0x5ab9, 0xa11a, 0x00c8,
-	0x5ab9, 0x8213, 0x818d, 0x0048, 0x5aac, 0xa11a, 0x00c8, 0x5aad,
-	0x00f0, 0x5aa1, 0x0078, 0x5ab1, 0xa11a, 0x2308, 0x8210, 0x00f0,
-	0x5aa1, 0x007e, 0x3200, 0xa084, 0xf7ff, 0x2080, 0x007f, 0x157f,
-	0x007c, 0x007e, 0x3200, 0xa085, 0x0800, 0x0078, 0x5ab5, 0x127e,
-	0x2091, 0x2200, 0x2079, 0xa5ab, 0x127f, 0x0d7e, 0x2069, 0xa5ab,
-	0x6803, 0x0005, 0x2069, 0x0004, 0x2d04, 0xa085, 0x8001, 0x206a,
-	0x0d7f, 0x007c, 0x0c7e, 0x6027, 0x0001, 0x7804, 0xa084, 0x0007,
-	0x0079, 0x5ada, 0x5ae4, 0x5b09, 0x5b64, 0x5aea, 0x5b09, 0x5ae4,
-	0x5ae2, 0x5ae2, 0x1078, 0x1328, 0x1078, 0x595a, 0x1078, 0x6109,
-	0x0c7f, 0x007c, 0x62c0, 0x82ff, 0x00c0, 0x5af0, 0x0c7f, 0x007c,
-	0x2011, 0x4129, 0x1078, 0x58d4, 0x7828, 0xa092, 0x00c8, 0x00c8,
-	0x5aff, 0x8000, 0x782a, 0x1078, 0x4168, 0x0078, 0x5aee, 0x1078,
-	0x4129, 0x7807, 0x0003, 0x7827, 0x0000, 0x782b, 0x0000, 0x0078,
-	0x5aee, 0x1078, 0x595a, 0x3c00, 0x007e, 0x2011, 0x0209, 0x20e1,
-	0x4000, 0x2214, 0x007f, 0x20e0, 0x82ff, 0x0040, 0x5b27, 0x62c0,
-	0x82ff, 0x00c0, 0x5b27, 0x782b, 0x0000, 0x7824, 0xa065, 0x1040,
-	0x1328, 0x2009, 0x0013, 0x1078, 0x756c, 0x0c7f, 0x007c, 0x3900,
-	0xa082, 0xa6cd, 0x00c8, 0x5b2e, 0x1078, 0x728a, 0x0c7e, 0x7824,
-	0xa065, 0x1040, 0x1328, 0x7804, 0xa086, 0x0004, 0x0040, 0x5ba9,
-	0x7828, 0xa092, 0x2710, 0x00c8, 0x5b44, 0x8000, 0x782a, 0x0c7f,
-	0x1078, 0x6c33, 0x0078, 0x5b25, 0x6104, 0xa186, 0x0003, 0x00c0,
-	0x5b5b, 0x0e7e, 0x2071, 0xa300, 0x70d4, 0x0e7f, 0xd08c, 0x0040,
-	0x5b5b, 0x0c7e, 0x0e7e, 0x2061, 0x0100, 0x2071, 0xa300, 0x1078,
-	0x4171, 0x0e7f, 0x0c7f, 0x1078, 0xa241, 0x2009, 0x0014, 0x1078,
-	0x756c, 0x0c7f, 0x0078, 0x5b25, 0x2001, 0xa5c7, 0x2003, 0x0000,
-	0x62c0, 0x82ff, 0x00c0, 0x5b78, 0x782b, 0x0000, 0x7824, 0xa065,
-	0x1040, 0x1328, 0x2009, 0x0013, 0x1078, 0x75c3, 0x0c7f, 0x007c,
-	0x0c7e, 0x0d7e, 0x3900, 0xa082, 0xa6cd, 0x00c8, 0x5b81, 0x1078,
-	0x728a, 0x7824, 0xa005, 0x1040, 0x1328, 0x781c, 0xa06d, 0x1040,
-	0x1328, 0x6800, 0xc0dc, 0x6802, 0x7924, 0x2160, 0x1078, 0x753d,
-	0x693c, 0x81ff, 0x1040, 0x1328, 0x8109, 0x693e, 0x6854, 0xa015,
-	0x0040, 0x5b9d, 0x7a1e, 0x0078, 0x5b9f, 0x7918, 0x791e, 0x7807,
-	0x0000, 0x7827, 0x0000, 0x0d7f, 0x0c7f, 0x1078, 0x6109, 0x0078,
-	0x5b76, 0x6104, 0xa186, 0x0002, 0x0040, 0x5bb4, 0xa186, 0x0004,
-	0x0040, 0x5bb4, 0x0078, 0x5b38, 0x7808, 0xac06, 0x0040, 0x5b38,
-	0x1078, 0x6010, 0x1078, 0x5c45, 0x0c7f, 0x1078, 0x6109, 0x0078,
-	0x5b25, 0x0c7e, 0x6027, 0x0002, 0x62c8, 0x82ff, 0x00c0, 0x5bdb,
-	0x62c4, 0x82ff, 0x00c0, 0x5bdb, 0x793c, 0xa1e5, 0x0000, 0x0040,
-	0x5bd5, 0x2009, 0x0049, 0x1078, 0x756c, 0x2011, 0xa5ca, 0x2013,
-	0x0000, 0x0c7f, 0x007c, 0x3908, 0xa192, 0xa6cd, 0x00c8, 0x5be2,
-	0x1078, 0x728a, 0x6017, 0x0010, 0x793c, 0x81ff, 0x0040, 0x5bd5,
-	0x793c, 0xa188, 0x0007, 0x210c, 0xa18e, 0x0006, 0x00c0, 0x5bf4,
-	0x6017, 0x0012, 0x0078, 0x5bd9, 0x6017, 0x0016, 0x0078, 0x5bd9,
-	0x007e, 0x017e, 0x0c7e, 0x127e, 0x2091, 0x8000, 0x600f, 0x0000,
-	0x2c08, 0x2061, 0xa5ab, 0x6020, 0x8000, 0x6022, 0x6010, 0xa005,
-	0x0040, 0x5c13, 0xa080, 0x0003, 0x2102, 0x6112, 0x127f, 0x0c7f,
-	0x017f, 0x007f, 0x007c, 0x6116, 0x6112, 0x0078, 0x5c0e, 0x0d7e,
-	0x2069, 0xa5ab, 0x6000, 0xd0d4, 0x0040, 0x5c2c, 0x6820, 0x8000,
-	0x6822, 0xa086, 0x0001, 0x00c0, 0x5c27, 0x2c00, 0x681e, 0x6804,
-	0xa084, 0x0007, 0x0079, 0x6111, 0xc0d5, 0x6002, 0x6818, 0xa005,
-	0x0040, 0x5c3e, 0x6056, 0x605b, 0x0000, 0x007e, 0x2c00, 0x681a,
-	0x0d7f, 0x685a, 0x2069, 0xa5ab, 0x0078, 0x5c1e, 0x6056, 0x605a,
-	0x2c00, 0x681a, 0x681e, 0x0078, 0x5c1e, 0x007e, 0x017e, 0x0c7e,
-	0x127e, 0x2091, 0x8000, 0x600f, 0x0000, 0x2c08, 0x2061, 0xa5ab,
-	0x6020, 0x8000, 0x6022, 0x6008, 0xa005, 0x0040, 0x5c60, 0xa080,
-	0x0003, 0x2102, 0x610a, 0x127f, 0x0c7f, 0x017f, 0x007f, 0x007c,
-	0x610e, 0x610a, 0x0078, 0x5c5b, 0x0c7e, 0x600f, 0x0000, 0x2c08,
-	0x2061, 0xa5ab, 0x6034, 0xa005, 0x0040, 0x5c74, 0xa080, 0x0003,
-	0x2102, 0x6136, 0x0c7f, 0x007c, 0x613a, 0x6136, 0x0078, 0x5c72,
-	0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x067e, 0x027e, 0x017e, 0x007e,
-	0x127e, 0x2071, 0xa5ab, 0x7638, 0x2660, 0x2678, 0x2091, 0x8000,
-	0x8cff, 0x0040, 0x5ced, 0x6018, 0xa080, 0x0028, 0x2004, 0xa206,
-	0x00c0, 0x5ce8, 0x87ff, 0x0040, 0x5c99, 0x6020, 0xa106, 0x00c0,
-	0x5ce8, 0x703c, 0xac06, 0x00c0, 0x5cab, 0x037e, 0x2019, 0x0001,
-	0x1078, 0x6e6c, 0x7033, 0x0000, 0x703f, 0x0000, 0x7043, 0x0000,
-	0x7047, 0x0000, 0x037f, 0x7038, 0xac36, 0x00c0, 0x5cb1, 0x660c,
-	0x763a, 0x7034, 0xac36, 0x00c0, 0x5cbf, 0x2c00, 0xaf36, 0x0040,
-	0x5cbd, 0x2f00, 0x7036, 0x0078, 0x5cbf, 0x7037, 0x0000, 0x660c,
-	0x067e, 0x2c00, 0xaf06, 0x0040, 0x5cc8, 0x7e0e, 0x0078, 0x5cc9,
-	0x2678, 0x600f, 0x0000, 0x1078, 0x8a44, 0x0040, 0x5ce3, 0x6010,
-	0x2068, 0x601c, 0xa086, 0x0003, 0x00c0, 0x5cf7, 0x6837, 0x0103,
-	0x6b4a, 0x6847, 0x0000, 0x1078, 0x8cb8, 0x1078, 0xa181, 0x1078,
-	0x4982, 0x1078, 0x8bf4, 0x1078, 0x8c01, 0x0c7f, 0x0078, 0x5c88,
-	0x2c78, 0x600c, 0x2060, 0x0078, 0x5c88, 0x127f, 0x007f, 0x017f,
-	0x027f, 0x067f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x007c, 0x601c,
-	0xa086, 0x0006, 0x00c0, 0x5cd6, 0x1078, 0xa181, 0x1078, 0x9e70,
-	0x0078, 0x5ce3, 0x007e, 0x067e, 0x0c7e, 0x0d7e, 0x0f7e, 0x2031,
-	0x0000, 0x127e, 0x2091, 0x8000, 0x2079, 0xa5ab, 0x7838, 0xa065,
-	0x0040, 0x5d41, 0x600c, 0x007e, 0x600f, 0x0000, 0x783c, 0xac06,
-	0x00c0, 0x5d28, 0x037e, 0x2019, 0x0001, 0x1078, 0x6e6c, 0x7833,
-	0x0000, 0x783f, 0x0000, 0x7843, 0x0000, 0x7847, 0x0000, 0x037f,
-	0x1078, 0x8a44, 0x0040, 0x5d3c, 0x6010, 0x2068, 0x601c, 0xa086,
-	0x0003, 0x00c0, 0x5d4a, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000,
-	0x1078, 0x4982, 0x1078, 0x8bf4, 0x1078, 0x8c01, 0x007f, 0x0078,
-	0x5d0f, 0x7e3a, 0x7e36, 0x127f, 0x0f7f, 0x0d7f, 0x0c7f, 0x067f,
-	0x007f, 0x007c, 0x601c, 0xa086, 0x0006, 0x00c0, 0x5d33, 0x1078,
-	0x9e70, 0x0078, 0x5d3c, 0x017e, 0x027e, 0x087e, 0x2041, 0x0000,
-	0x1078, 0x5d6d, 0x1078, 0x5e21, 0x087f, 0x027f, 0x017f, 0x007c,
-	0x0f7e, 0x127e, 0x2079, 0xa5ab, 0x2091, 0x8000, 0x1078, 0x5ebc,
-	0x1078, 0x5f32, 0x127f, 0x0f7f, 0x007c, 0x0f7e, 0x0e7e, 0x0d7e,
-	0x0c7e, 0x067e, 0x017e, 0x007e, 0x127e, 0x2091, 0x8000, 0x2071,
-	0xa5ab, 0x7614, 0x2660, 0x2678, 0x8cff, 0x0040, 0x5e01, 0x6018,
-	0xa080, 0x0028, 0x2004, 0xa206, 0x00c0, 0x5dfc, 0x88ff, 0x0040,
-	0x5d8d, 0x6020, 0xa106, 0x00c0, 0x5dfc, 0x7024, 0xac06, 0x00c0,
-	0x5dbd, 0x2069, 0x0100, 0x68c0, 0xa005, 0x0040, 0x5db8, 0x1078,
-	0x595a, 0x1078, 0x6c41, 0x68c3, 0x0000, 0x1078, 0x7188, 0x7027,
-	0x0000, 0x037e, 0x2069, 0x0140, 0x6b04, 0xa384, 0x1000, 0x0040,
-	0x5dad, 0x6803, 0x0100, 0x6803, 0x0000, 0x2069, 0x0100, 0x6824,
-	0xd084, 0x0040, 0x5db5, 0x6827, 0x0001, 0x037f, 0x0078, 0x5dbd,
-	0x6003, 0x0009, 0x630a, 0x0078, 0x5dfc, 0x7014, 0xac36, 0x00c0,
-	0x5dc3, 0x660c, 0x7616, 0x7010, 0xac36, 0x00c0, 0x5dd1, 0x2c00,
-	0xaf36, 0x0040, 0x5dcf, 0x2f00, 0x7012, 0x0078, 0x5dd1, 0x7013,
-	0x0000, 0x660c, 0x067e, 0x2c00, 0xaf06, 0x0040, 0x5dda, 0x7e0e,
-	0x0078, 0x5ddb, 0x2678, 0x600f, 0x0000, 0x6010, 0x2068, 0x1078,
-	0x8a44, 0x0040, 0x5df5, 0x601c, 0xa086, 0x0003, 0x00c0, 0x5e0a,
-	0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x8cb8, 0x1078,
-	0xa181, 0x1078, 0x4982, 0x1078, 0x8bf4, 0x1078, 0x8c01, 0x1078,
-	0x7045, 0x0c7f, 0x0078, 0x5d7c, 0x2c78, 0x600c, 0x2060, 0x0078,
-	0x5d7c, 0x127f, 0x007f, 0x017f, 0x067f, 0x0c7f, 0x0d7f, 0x0e7f,
-	0x0f7f, 0x007c, 0x601c, 0xa086, 0x0006, 0x00c0, 0x5e15, 0x1078,
-	0xa181, 0x1078, 0x9e70, 0x0078, 0x5df5, 0x601c, 0xa086, 0x0002,
-	0x00c0, 0x5df5, 0x6004, 0xa086, 0x0085, 0x0040, 0x5de8, 0x0078,
-	0x5df5, 0x0c7e, 0x007e, 0x127e, 0x2091, 0x8000, 0xa280, 0xa434,
-	0x2004, 0xa065, 0x0040, 0x5eb8, 0x0f7e, 0x0e7e, 0x0d7e, 0x067e,
-	0x2071, 0xa5ab, 0x6654, 0x7018, 0xac06, 0x00c0, 0x5e38, 0x761a,
-	0x701c, 0xac06, 0x00c0, 0x5e44, 0x86ff, 0x00c0, 0x5e43, 0x7018,
-	0x701e, 0x0078, 0x5e44, 0x761e, 0x6058, 0xa07d, 0x0040, 0x5e49,
-	0x7e56, 0xa6ed, 0x0000, 0x0040, 0x5e4f, 0x2f00, 0x685a, 0x6057,
-	0x0000, 0x605b, 0x0000, 0x6000, 0xc0d4, 0xc0dc, 0x6002, 0x1078,
-	0x4410, 0x0040, 0x5eb4, 0x7624, 0x86ff, 0x0040, 0x5ea2, 0xa680,
-	0x0004, 0x2004, 0xad06, 0x00c0, 0x5ea2, 0x0d7e, 0x2069, 0x0100,
-	0x68c0, 0xa005, 0x0040, 0x5e99, 0x1078, 0x595a, 0x1078, 0x6c41,
-	0x68c3, 0x0000, 0x1078, 0x7188, 0x7027, 0x0000, 0x037e, 0x2069,
-	0x0140, 0x6b04, 0xa384, 0x1000, 0x0040, 0x5e82, 0x6803, 0x0100,
-	0x6803, 0x0000, 0x2069, 0x0100, 0x6824, 0xd084, 0x0040, 0x5e8a,
-	0x6827, 0x0001, 0x037f, 0x0d7f, 0x0c7e, 0x603c, 0xa005, 0x0040,
-	0x5e93, 0x8001, 0x603e, 0x2660, 0x1078, 0x8c01, 0x0c7f, 0x0078,
-	0x5ea2, 0x0d7f, 0x0c7e, 0x2660, 0x6003, 0x0009, 0x630a, 0x0c7f,
-	0x0078, 0x5e57, 0x8dff, 0x0040, 0x5eb0, 0x6837, 0x0103, 0x6b4a,
-	0x6847, 0x0000, 0x1078, 0x8cb8, 0x1078, 0xa181, 0x1078, 0x4982,
-	0x1078, 0x7045, 0x0078, 0x5e57, 0x067f, 0x0d7f, 0x0e7f, 0x0f7f,
-	0x127f, 0x007f, 0x0c7f, 0x007c, 0x007e, 0x067e, 0x0c7e, 0x0d7e,
-	0x2031, 0x0000, 0x7814, 0xa065, 0x0040, 0x5f16, 0x600c, 0x007e,
-	0x600f, 0x0000, 0x7824, 0xac06, 0x00c0, 0x5efb, 0x2069, 0x0100,
-	0x68c0, 0xa005, 0x0040, 0x5ef5, 0x1078, 0x595a, 0x1078, 0x6c41,
-	0x68c3, 0x0000, 0x1078, 0x7188, 0x7827, 0x0000, 0x037e, 0x2069,
-	0x0140, 0x6b04, 0xa384, 0x1000, 0x0040, 0x5eea, 0x6803, 0x0100,
-	0x6803, 0x0000, 0x2069, 0x0100, 0x6824, 0xd084, 0x0040, 0x5ef2,
-	0x6827, 0x0001, 0x037f, 0x0078, 0x5efb, 0x6003, 0x0009, 0x630a,
-	0x2c30, 0x0078, 0x5f13, 0x6010, 0x2068, 0x1078, 0x8a44, 0x0040,
-	0x5f0f, 0x601c, 0xa086, 0x0003, 0x00c0, 0x5f1d, 0x6837, 0x0103,
-	0x6b4a, 0x6847, 0x0000, 0x1078, 0x4982, 0x1078, 0x8bf4, 0x1078,
-	0x8c01, 0x1078, 0x7045, 0x007f, 0x0078, 0x5ec3, 0x7e16, 0x7e12,
-	0x0d7f, 0x0c7f, 0x067f, 0x007f, 0x007c, 0x601c, 0xa086, 0x0006,
-	0x00c0, 0x5f26, 0x1078, 0x9e70, 0x0078, 0x5f0f, 0x601c, 0xa086,
-	0x0002, 0x00c0, 0x5f0f, 0x6004, 0xa086, 0x0085, 0x0040, 0x5f06,
-	0x0078, 0x5f0f, 0x007e, 0x067e, 0x0c7e, 0x0d7e, 0x7818, 0xa065,
-	0x0040, 0x5fa0, 0x6054, 0x007e, 0x6057, 0x0000, 0x605b, 0x0000,
-	0x6000, 0xc0d4, 0xc0dc, 0x6002, 0x1078, 0x4410, 0x0040, 0x5f9d,
-	0x7e24, 0x86ff, 0x0040, 0x5f8f, 0xa680, 0x0004, 0x2004, 0xad06,
-	0x00c0, 0x5f8f, 0x0d7e, 0x2069, 0x0100, 0x68c0, 0xa005, 0x0040,
-	0x5f86, 0x1078, 0x595a, 0x1078, 0x6c41, 0x68c3, 0x0000, 0x1078,
-	0x7188, 0x7827, 0x0000, 0x037e, 0x2069, 0x0140, 0x6b04, 0xa384,
-	0x1000, 0x0040, 0x5f6f, 0x6803, 0x0100, 0x6803, 0x0000, 0x2069,
-	0x0100, 0x6824, 0xd084, 0x0040, 0x5f77, 0x6827, 0x0001, 0x037f,
-	0x0d7f, 0x0c7e, 0x603c, 0xa005, 0x0040, 0x5f80, 0x8001, 0x603e,
-	0x2660, 0x1078, 0x8c01, 0x0c7f, 0x0078, 0x5f8f, 0x0d7f, 0x0c7e,
-	0x2660, 0x6003, 0x0009, 0x630a, 0x0c7f, 0x0078, 0x5f44, 0x8dff,
-	0x0040, 0x5f99, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078,
-	0x4982, 0x1078, 0x7045, 0x0078, 0x5f44, 0x007f, 0x0078, 0x5f37,
-	0x781e, 0x781a, 0x0d7f, 0x0c7f, 0x067f, 0x007f, 0x007c, 0x0e7e,
-	0x0d7e, 0x067e, 0x6000, 0xd0dc, 0x0040, 0x5fc4, 0x604c, 0xa06d,
-	0x0040, 0x5fc4, 0x6848, 0xa606, 0x00c0, 0x5fc4, 0x2071, 0xa5ab,
-	0x7024, 0xa035, 0x0040, 0x5fc4, 0xa080, 0x0004, 0x2004, 0xad06,
-	0x00c0, 0x5fc4, 0x1078, 0x5fc8, 0x067f, 0x0d7f, 0x0e7f, 0x007c,
-	0x0f7e, 0x2079, 0x0100, 0x78c0, 0xa005, 0x00c0, 0x5fd7, 0x0c7e,
-	0x2660, 0x6003, 0x0009, 0x630a, 0x0c7f, 0x0078, 0x600e, 0x1078,
-	0x6c41, 0x78c3, 0x0000, 0x1078, 0x7188, 0x7027, 0x0000, 0x037e,
-	0x2079, 0x0140, 0x7b04, 0xa384, 0x1000, 0x0040, 0x5feb, 0x7803,
-	0x0100, 0x7803, 0x0000, 0x2079, 0x0100, 0x7824, 0xd084, 0x0040,
-	0x5ff3, 0x7827, 0x0001, 0x1078, 0x7188, 0x037f, 0x1078, 0x4410,
-	0x0c7e, 0x603c, 0xa005, 0x0040, 0x5fff, 0x8001, 0x603e, 0x2660,
-	0x1078, 0x753d, 0x0c7f, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000,
-	0x1078, 0x8cb8, 0x1078, 0x4982, 0x1078, 0x7045, 0x0f7f, 0x007c,
-	0x0e7e, 0x0c7e, 0x2071, 0xa5ab, 0x7004, 0xa084, 0x0007, 0x0079,
-	0x6019, 0x6023, 0x6026, 0x603f, 0x605b, 0x60a0, 0x6023, 0x6023,
-	0x6021, 0x1078, 0x1328, 0x0c7f, 0x0e7f, 0x007c, 0x7024, 0xa065,
-	0x0040, 0x6034, 0x7020, 0x8001, 0x7022, 0x600c, 0xa015, 0x0040,
-	0x603b, 0x7216, 0x600f, 0x0000, 0x7007, 0x0000, 0x7027, 0x0000,
-	0x0c7f, 0x0e7f, 0x007c, 0x7216, 0x7212, 0x0078, 0x6034, 0x6018,
-	0x2060, 0x1078, 0x4410, 0x6000, 0xc0dc, 0x6002, 0x7020, 0x8001,
-	0x7022, 0x0040, 0x6050, 0x6054, 0xa015, 0x0040, 0x6057, 0x721e,
-	0x7007, 0x0000, 0x7027, 0x0000, 0x0c7f, 0x0e7f, 0x007c, 0x7218,
-	0x721e, 0x0078, 0x6050, 0x7024, 0xa065, 0x0040, 0x609d, 0x700c,
-	0xac06, 0x00c0, 0x6072, 0x1078, 0x7045, 0x600c, 0xa015, 0x0040,
-	0x606e, 0x720e, 0x600f, 0x0000, 0x0078, 0x609b, 0x720e, 0x720a,
-	0x0078, 0x609b, 0x7014, 0xac06, 0x00c0, 0x6085, 0x1078, 0x7045,
-	0x600c, 0xa015, 0x0040, 0x6081, 0x7216, 0x600f, 0x0000, 0x0078,
-	0x609b, 0x7216, 0x7212, 0x0078, 0x609b, 0x6018, 0x2060, 0x1078,
-	0x4410, 0x6000, 0xc0dc, 0x6002, 0x1078, 0x7045, 0x701c, 0xa065,
-	0x0040, 0x609b, 0x6054, 0xa015, 0x0040, 0x6099, 0x721e, 0x0078,
-	0x609b, 0x7218, 0x721e, 0x7027, 0x0000, 0x0c7f, 0x0e7f, 0x007c,
-	0x7024, 0xa065, 0x0040, 0x60ad, 0x1078, 0x7045, 0x600c, 0xa015,
-	0x0040, 0x60b4, 0x720e, 0x600f, 0x0000, 0x1078, 0x7188, 0x7027,
-	0x0000, 0x0c7f, 0x0e7f, 0x007c, 0x720e, 0x720a, 0x0078, 0x60ad,
-	0x0d7e, 0x2069, 0xa5ab, 0x6830, 0xa084, 0x0003, 0x0079, 0x60c0,
-	0x60c6, 0x60c8, 0x60ee, 0x60c6, 0x1078, 0x1328, 0x0d7f, 0x007c,
-	0x0c7e, 0x6840, 0xa086, 0x0001, 0x0040, 0x60e4, 0x683c, 0xa065,
-	0x0040, 0x60d9, 0x600c, 0xa015, 0x0040, 0x60e0, 0x6a3a, 0x600f,
-	0x0000, 0x6833, 0x0000, 0x683f, 0x0000, 0x0c7f, 0x0d7f, 0x007c,
-	0x683a, 0x6836, 0x0078, 0x60d9, 0x6843, 0x0000, 0x6838, 0xa065,
-	0x0040, 0x60d9, 0x6003, 0x0003, 0x0078, 0x60d9, 0x0c7e, 0x6843,
-	0x0000, 0x6847, 0x0000, 0x683c, 0xa065, 0x0040, 0x6106, 0x600c,
-	0xa015, 0x0040, 0x6102, 0x6a3a, 0x600f, 0x0000, 0x683f, 0x0000,
-	0x0078, 0x6106, 0x683f, 0x0000, 0x683a, 0x6836, 0x0c7f, 0x0d7f,
-	0x007c, 0x0d7e, 0x2069, 0xa5ab, 0x6804, 0xa084, 0x0007, 0x0079,
-	0x6111, 0x611b, 0x61c2, 0x61c2, 0x61c2, 0x61c2, 0x61c4, 0x61c2,
-	0x6119, 0x1078, 0x1328, 0x6820, 0xa005, 0x00c0, 0x6121, 0x0d7f,
-	0x007c, 0x0c7e, 0x680c, 0xa065, 0x0040, 0x6130, 0x6807, 0x0004,
-	0x6826, 0x682b, 0x0000, 0x1078, 0x620a, 0x0c7f, 0x0d7f, 0x007c,
-	0x6814, 0xa065, 0x0040, 0x613e, 0x6807, 0x0001, 0x6826, 0x682b,
-	0x0000, 0x1078, 0x620a, 0x0c7f, 0x0d7f, 0x007c, 0x0e7e, 0x037e,
-	0x6a1c, 0xa2f5, 0x0000, 0x0040, 0x61bd, 0x704c, 0xa00d, 0x0040,
-	0x614d, 0x7088, 0xa005, 0x0040, 0x6165, 0x7054, 0xa075, 0x0040,
-	0x6156, 0xa20e, 0x0040, 0x61bd, 0x0078, 0x615b, 0x6818, 0xa20e,
-	0x0040, 0x61bd, 0x2070, 0x704c, 0xa00d, 0x0040, 0x614d, 0x7088,
-	0xa005, 0x00c0, 0x614d, 0x2e00, 0x681e, 0x733c, 0x7038, 0xa302,
-	0x00c8, 0x614d, 0x1078, 0x750c, 0x0040, 0x61bd, 0x8318, 0x733e,
-	0x6112, 0x2e10, 0x621a, 0xa180, 0x0014, 0x2004, 0xa084, 0x00ff,
-	0x6032, 0xa180, 0x0014, 0x2003, 0x0000, 0xa180, 0x0015, 0x2004,
-	0xa08a, 0x199a, 0x0048, 0x6186, 0x2001, 0x1999, 0x8003, 0x801b,
-	0x831b, 0xa318, 0x6316, 0x037f, 0x0f7e, 0x2c78, 0x71a0, 0xd1bc,
-	0x0040, 0x619f, 0x7100, 0xd1f4, 0x0040, 0x619b, 0x7114, 0xa18c,
-	0x00ff, 0x0078, 0x61a4, 0x2009, 0x0000, 0x0078, 0x61a4, 0xa1e0,
-	0x293f, 0x2c0c, 0xa18c, 0x00ff, 0x2061, 0x0100, 0x619a, 0x1078,
-	0x679b, 0x7300, 0xc3dd, 0x7302, 0x6807, 0x0002, 0x2f18, 0x6b26,
-	0x682b, 0x0000, 0x781f, 0x0003, 0x7803, 0x0001, 0x7807, 0x0040,
-	0x0f7f, 0x0e7f, 0x0c7f, 0x0d7f, 0x007c, 0x037f, 0x0e7f, 0x0c7f,
-	0x0078, 0x61bb, 0x0d7f, 0x007c, 0x0c7e, 0x680c, 0xa065, 0x0040,
-	0x61d0, 0x6807, 0x0004, 0x6826, 0x682b, 0x0000, 0x1078, 0x620a,
-	0x0c7f, 0x0d7f, 0x007c, 0x0f7e, 0x0d7e, 0x2069, 0xa5ab, 0x6830,
-	0xa086, 0x0000, 0x00c0, 0x61f1, 0x6838, 0xa07d, 0x0040, 0x61f1,
-	0x6833, 0x0001, 0x683e, 0x6847, 0x0000, 0x127e, 0x0f7e, 0x2091,
-	0x2200, 0x027f, 0x1078, 0x1d28, 0x00c0, 0x61f4, 0x127f, 0x1078,
-	0x6ae5, 0x0d7f, 0x0f7f, 0x007c, 0x127f, 0x6843, 0x0000, 0x7803,
-	0x0002, 0x780c, 0xa015, 0x0040, 0x6206, 0x6a3a, 0x780f, 0x0000,
-	0x6833, 0x0000, 0x683f, 0x0000, 0x0078, 0x61f1, 0x683a, 0x6836,
-	0x0078, 0x6200, 0x601c, 0xa084, 0x000f, 0x1079, 0x6210, 0x007c,
-	0x6219, 0x621e, 0x663f, 0x6758, 0x621e, 0x663f, 0x6758, 0x6219,
-	0x621e, 0x1078, 0x6010, 0x1078, 0x6109, 0x007c, 0x157e, 0x137e,
-	0x147e, 0x0c7e, 0x0f7e, 0x6004, 0xa08a, 0x0044, 0x10c8, 0x1328,
-	0x6118, 0x2178, 0x79a0, 0xd1bc, 0x0040, 0x623b, 0x7900, 0xd1f4,
-	0x0040, 0x6237, 0x7914, 0xa18c, 0x00ff, 0x0078, 0x6240, 0x2009,
-	0x0000, 0x0078, 0x6240, 0xa1f8, 0x293f, 0x2f0c, 0xa18c, 0x00ff,
-	0x2c78, 0x2061, 0x0100, 0x619a, 0xa08a, 0x0040, 0x00c8, 0x6292,
-	0x1079, 0x6250, 0x0f7f, 0x0c7f, 0x147f, 0x137f, 0x157f, 0x007c,
-	0x62f8, 0x6340, 0x6368, 0x6403, 0x6433, 0x643b, 0x6462, 0x6473,
-	0x6484, 0x648c, 0x64a4, 0x648c, 0x650f, 0x6473, 0x6530, 0x6538,
-	0x6484, 0x6538, 0x6549, 0x6290, 0x6290, 0x6290, 0x6290, 0x6290,
-	0x6290, 0x6290, 0x6290, 0x6290, 0x6290, 0x6290, 0x6d05, 0x6d2a,
-	0x6d3f, 0x6d62, 0x6d83, 0x6462, 0x6290, 0x6462, 0x648c, 0x6290,
-	0x6368, 0x6403, 0x6290, 0x72ac, 0x648c, 0x6290, 0x72cc, 0x648c,
-	0x6290, 0x6290, 0x62f3, 0x62a1, 0x6290, 0x72f1, 0x7368, 0x7450,
-	0x6290, 0x7461, 0x645c, 0x747d, 0x6290, 0x6d98, 0x6290, 0x6290,
-	0x1078, 0x1328, 0x2100, 0x1079, 0x629b, 0x0f7f, 0x0c7f, 0x147f,
-	0x137f, 0x157f, 0x007c, 0x629f, 0x629f, 0x629f, 0x62d5, 0x1078,
-	0x1328, 0x0d7e, 0x20a1, 0x020b, 0x1078, 0x6567, 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, 0x6c2d, 0x0d7f, 0x007c, 0x0d7e, 0x7818,
-	0x2068, 0x68a0, 0xa082, 0x007e, 0x0048, 0x62d2, 0xa085, 0x0001,
-	0x0d7f, 0x007c, 0xa006, 0x0078, 0x62d0, 0x0d7e, 0x20a1, 0x020b,
-	0x1078, 0x6567, 0x20a3, 0x0500, 0x20a3, 0x0000, 0x7810, 0xa0e8,
-	0x000f, 0x6808, 0x20a2, 0x680c, 0x20a2, 0x6810, 0x20a2, 0x6814,
-	0x20a2, 0x6818, 0x20a2, 0x681c, 0x20a2, 0x60c3, 0x0010, 0x1078,
-	0x6c2d, 0x0d7f, 0x007c, 0x6030, 0x609a, 0x1078, 0x6c2d, 0x007c,
-	0x20a1, 0x020b, 0x1078, 0x6567, 0x20a3, 0x5200, 0x20a3, 0x0000,
-	0x0d7e, 0x2069, 0xa351, 0x6804, 0xd084, 0x0040, 0x6312, 0x6828,
-	0x20a3, 0x0000, 0x017e, 0x1078, 0x24fa, 0x21a2, 0x017f, 0x0d7f,
-	0x0078, 0x6317, 0x0d7f, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a9,
-	0x0004, 0x2099, 0xa305, 0x53a6, 0x20a9, 0x0004, 0x2099, 0xa301,
-	0x53a6, 0x7818, 0xa080, 0x0028, 0x2004, 0xa082, 0x007f, 0x0048,
-	0x6331, 0x2001, 0xa31a, 0x20a6, 0x2001, 0xa31b, 0x20a6, 0x0078,
-	0x6337, 0x20a3, 0x0000, 0x6030, 0xa084, 0x00ff, 0x20a2, 0x20a3,
-	0x0000, 0x20a3, 0x0000, 0x60c3, 0x001c, 0x1078, 0x6c2d, 0x007c,
-	0x20a1, 0x020b, 0x1078, 0x6567, 0x20a3, 0x0500, 0x20a3, 0x0000,
-	0x7818, 0xa080, 0x0028, 0x2004, 0xa082, 0x007f, 0x0048, 0x6358,
-	0x2001, 0xa31a, 0x20a6, 0x2001, 0xa31b, 0x20a6, 0x0078, 0x635e,
-	0x20a3, 0x0000, 0x6030, 0xa084, 0x00ff, 0x20a2, 0x20a9, 0x0004,
-	0x2099, 0xa305, 0x53a6, 0x60c3, 0x0010, 0x1078, 0x6c2d, 0x007c,
-	0x20a1, 0x020b, 0x1078, 0x6567, 0x0c7e, 0x7818, 0x2060, 0x2001,
-	0x0000, 0x1078, 0x48a2, 0x0c7f, 0x7818, 0xa080, 0x0028, 0x2004,
-	0xa086, 0x007e, 0x00c0, 0x6383, 0x20a3, 0x0400, 0x620c, 0xc2b4,
-	0x620e, 0x0078, 0x6385, 0x20a3, 0x0300, 0x20a3, 0x0000, 0x7818,
-	0xa080, 0x0028, 0x2004, 0xa086, 0x007e, 0x00c0, 0x63d2, 0x2099,
-	0xa58c, 0x33a6, 0x9398, 0x33a6, 0x9398, 0x3304, 0xa084, 0x3fff,
-	0x20a2, 0x9398, 0x33a6, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3,
-	0x0000, 0x20a3, 0x0000, 0x20a9, 0x0004, 0x2099, 0xa305, 0x53a6,
-	0x20a9, 0x0004, 0x2099, 0xa301, 0x53a6, 0x20a9, 0x0010, 0x20a3,
-	0x0000, 0x00f0, 0x63af, 0x2099, 0xa594, 0x3304, 0xc0dd, 0x20a2,
-	0x2001, 0xa371, 0x2004, 0xd0e4, 0x0040, 0x63ca, 0x20a3, 0x0000,
-	0x20a3, 0x0000, 0x9398, 0x9398, 0x9398, 0x33a6, 0x20a9, 0x0004,
-	0x0078, 0x63cc, 0x20a9, 0x0007, 0x20a3, 0x0000, 0x00f0, 0x63cc,
-	0x0078, 0x63f2, 0x2099, 0xa58c, 0x20a9, 0x0008, 0x53a6, 0x20a9,
-	0x0004, 0x2099, 0xa305, 0x53a6, 0x20a9, 0x0004, 0x2099, 0xa301,
-	0x53a6, 0x20a9, 0x0008, 0x20a3, 0x0000, 0x00f0, 0x63e3, 0x20a9,
-	0x0008, 0x20a3, 0x0000, 0x00f0, 0x63e9, 0x2099, 0xa594, 0x20a9,
-	0x0008, 0x53a6, 0x20a9, 0x0008, 0x20a3, 0x0000, 0x00f0, 0x63f4,
-	0x20a9, 0x000a, 0x20a3, 0x0000, 0x00f0, 0x63fa, 0x60c3, 0x0074,
-	0x1078, 0x6c2d, 0x007c, 0x20a1, 0x020b, 0x1078, 0x6567, 0x20a3,
-	0x2010, 0x20a3, 0x0014, 0x20a3, 0x0800, 0x20a3, 0x2000, 0xa006,
-	0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x0f7e, 0x2079, 0xa351,
-	0x7904, 0x0f7f, 0xd1ac, 0x00c0, 0x641f, 0xa085, 0x0020, 0xd1a4,
-	0x0040, 0x6424, 0xa085, 0x0010, 0xa085, 0x0002, 0x0d7e, 0x0078,
-	0x64ed, 0x20a2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014,
-	0x1078, 0x6c2d, 0x007c, 0x20a1, 0x020b, 0x1078, 0x6567, 0x20a3,
-	0x5000, 0x0078, 0x6385, 0x20a1, 0x020b, 0x1078, 0x6567, 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, 0x6c2d, 0x007c, 0x20a1, 0x020b, 0x1078, 0x65ef,
-	0x0078, 0x6466, 0x20a1, 0x020b, 0x1078, 0x65f8, 0x20a3, 0x0200,
-	0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0004,
-	0x1078, 0x6c2d, 0x007c, 0x20a1, 0x020b, 0x1078, 0x65f8, 0x20a3,
-	0x0100, 0x20a3, 0x0000, 0x20a3, 0x0003, 0x20a3, 0x2a00, 0x60c3,
-	0x0008, 0x1078, 0x6c2d, 0x007c, 0x20a1, 0x020b, 0x1078, 0x65f8,
-	0x20a3, 0x0200, 0x0078, 0x6385, 0x20a1, 0x020b, 0x1078, 0x65f8,
-	0x20a3, 0x0100, 0x20a3, 0x0000, 0x7828, 0xa005, 0x0040, 0x649b,
-	0x20a2, 0x0078, 0x649d, 0x20a3, 0x0003, 0x7810, 0x20a2, 0x60c3,
-	0x0008, 0x1078, 0x6c2d, 0x007c, 0x0d7e, 0x20a1, 0x020b, 0x1078,
-	0x65f8, 0x20a3, 0x0210, 0x20a3, 0x0014, 0x20a3, 0x0800, 0x7818,
-	0x2068, 0x6894, 0xa086, 0x0014, 0x00c0, 0x64ca, 0x6998, 0xa184,
-	0xc000, 0x00c0, 0x64c6, 0xd1ec, 0x0040, 0x64c2, 0x20a3, 0x2100,
-	0x0078, 0x64cc, 0x20a3, 0x0100, 0x0078, 0x64cc, 0x20a3, 0x0400,
-	0x0078, 0x64cc, 0x20a3, 0x0700, 0xa006, 0x20a2, 0x20a2, 0x20a2,
-	0x20a2, 0x20a2, 0x0f7e, 0x2079, 0xa351, 0x7904, 0x0f7f, 0xd1ac,
-	0x00c0, 0x64dc, 0xa085, 0x0020, 0xd1a4, 0x0040, 0x64e1, 0xa085,
-	0x0010, 0x2009, 0xa373, 0x210c, 0xd184, 0x0040, 0x64eb, 0x699c,
-	0xd18c, 0x0040, 0x64ed, 0xa085, 0x0002, 0x027e, 0x2009, 0xa371,
-	0x210c, 0xd1e4, 0x0040, 0x64fb, 0xc0c5, 0xa094, 0x0030, 0xa296,
-	0x0010, 0x0040, 0x6505, 0xd1ec, 0x0040, 0x6505, 0xa094, 0x0030,
-	0xa296, 0x0010, 0x0040, 0x6505, 0xc0bd, 0x027f, 0x20a2, 0x20a2,
-	0x20a2, 0x60c3, 0x0014, 0x1078, 0x6c2d, 0x0d7f, 0x007c, 0x20a1,
-	0x020b, 0x1078, 0x65f8, 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, 0x6c2d, 0x007c,
-	0x20a1, 0x020b, 0x1078, 0x65f8, 0x20a3, 0x0200, 0x0078, 0x62fe,
-	0x20a1, 0x020b, 0x1078, 0x65f8, 0x20a3, 0x0100, 0x20a3, 0x0000,
-	0x20a3, 0x0003, 0x20a3, 0x2a00, 0x60c3, 0x0008, 0x1078, 0x6c2d,
-	0x007c, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x20a1, 0x020b, 0x1078,
-	0x65f8, 0x20a3, 0x0100, 0x20a3, 0x0000, 0x20a3, 0x000b, 0x20a3,
-	0x0000, 0x60c3, 0x0008, 0x1078, 0x6c2d, 0x007c, 0x027e, 0x037e,
-	0x047e, 0x2019, 0x3200, 0x2021, 0x0800, 0x0078, 0x656e, 0x027e,
-	0x037e, 0x047e, 0x2019, 0x2200, 0x2021, 0x0100, 0x20e1, 0x9080,
-	0x20e1, 0x4000, 0x7818, 0xa080, 0x0028, 0x2014, 0xa286, 0x007e,
-	0x00c0, 0x6581, 0xa385, 0x00ff, 0x20a2, 0x20a3, 0xfffe, 0x0078,
-	0x65b6, 0xa286, 0x007f, 0x00c0, 0x658d, 0x0d7e, 0xa385, 0x00ff,
-	0x20a2, 0x20a3, 0xfffd, 0x0078, 0x65a4, 0xd2bc, 0x0040, 0x65ac,
-	0xa286, 0x0080, 0x0d7e, 0x00c0, 0x659c, 0xa385, 0x00ff, 0x20a2,
-	0x20a3, 0xfffc, 0x0078, 0x65a4, 0xa2e8, 0xa434, 0x2d6c, 0x6810,
-	0xa305, 0x20a2, 0x6814, 0x20a2, 0x2069, 0xa31a, 0x2da6, 0x8d68,
-	0x2da6, 0x0d7f, 0x0078, 0x65ba, 0x0d7e, 0xa2e8, 0xa434, 0x2d6c,
-	0x6810, 0xa305, 0x20a2, 0x6814, 0x20a2, 0x0d7f, 0x20a3, 0x0000,
-	0x6230, 0x22a2, 0xa485, 0x0029, 0x20a2, 0x047f, 0x037f, 0x20a3,
-	0x0000, 0x1078, 0x6c1c, 0x22a2, 0x20a3, 0x0000, 0x2fa2, 0x20a3,
-	0xffff, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x027f, 0x007c, 0x027e,
-	0x20e1, 0x9080, 0x20e1, 0x4000, 0x20a3, 0x02ff, 0x2011, 0xfffc,
-	0x22a2, 0x0d7e, 0x2069, 0xa31a, 0x2da6, 0x8d68, 0x2da6, 0x0d7f,
-	0x20a3, 0x2029, 0x20a3, 0x0000, 0x0078, 0x65c1, 0x20a3, 0x0100,
-	0x20a3, 0x0000, 0x20a3, 0xfc02, 0x20a3, 0x0000, 0x007c, 0x027e,
-	0x037e, 0x047e, 0x2019, 0x3300, 0x2021, 0x0800, 0x0078, 0x65ff,
-	0x027e, 0x037e, 0x047e, 0x2019, 0x2300, 0x2021, 0x0100, 0x20e1,
-	0x9080, 0x20e1, 0x4000, 0x7818, 0xa080, 0x0028, 0x2004, 0xa092,
-	0x007e, 0x0048, 0x661c, 0x0d7e, 0xa0e8, 0xa434, 0x2d6c, 0x6810,
-	0xa305, 0x20a2, 0x6814, 0x20a2, 0x2069, 0xa31a, 0x2da6, 0x8d68,
-	0x2da6, 0x0d7f, 0x0078, 0x662a, 0x0d7e, 0xa0e8, 0xa434, 0x2d6c,
-	0x6810, 0xa305, 0x20a2, 0x6814, 0x20a2, 0x0d7f, 0x20a3, 0x0000,
-	0x6230, 0x22a2, 0xa485, 0x0098, 0x20a2, 0x20a3, 0x0000, 0x047f,
-	0x037f, 0x1078, 0x6c1c, 0x22a2, 0x20a3, 0x0000, 0x7a08, 0x22a2,
-	0x2fa2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x027f, 0x007c, 0x0c7e,
-	0x0f7e, 0x6004, 0xa08a, 0x0085, 0x1048, 0x1328, 0xa08a, 0x008c,
-	0x10c8, 0x1328, 0x6118, 0x2178, 0x79a0, 0xd1bc, 0x0040, 0x665d,
-	0x7900, 0xd1f4, 0x0040, 0x6659, 0x7914, 0xa18c, 0x00ff, 0x0078,
-	0x6662, 0x2009, 0x0000, 0x0078, 0x6662, 0xa1f8, 0x293f, 0x2f0c,
-	0xa18c, 0x00ff, 0x2c78, 0x2061, 0x0100, 0x619a, 0xa082, 0x0085,
-	0x1079, 0x666d, 0x0f7f, 0x0c7f, 0x007c, 0x6676, 0x6681, 0x669c,
-	0x6674, 0x6674, 0x6674, 0x6676, 0x1078, 0x1328, 0x147e, 0x20a1,
-	0x020b, 0x1078, 0x66af, 0x60c3, 0x0000, 0x1078, 0x6c2d, 0x147f,
-	0x007c, 0x147e, 0x20a1, 0x020b, 0x1078, 0x66e3, 0x20a3, 0x0000,
-	0x20a3, 0x0000, 0x7808, 0x20a2, 0x7810, 0x20a2, 0x20a3, 0x0000,
-	0x20a3, 0xffff, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x000c,
-	0x1078, 0x6c2d, 0x147f, 0x007c, 0x147e, 0x20a1, 0x020b, 0x1078,
-	0x6724, 0x20a3, 0x0003, 0x20a3, 0x0300, 0x20a3, 0x0000, 0x20a3,
-	0x0000, 0x60c3, 0x0004, 0x1078, 0x6c2d, 0x147f, 0x007c, 0x027e,
-	0x20e1, 0x9080, 0x20e1, 0x4000, 0x7818, 0xa080, 0x0028, 0x2004,
-	0xa092, 0x007e, 0x0048, 0x66ce, 0x0d7e, 0xa0e8, 0xa434, 0x2d6c,
-	0x6810, 0xa085, 0x8100, 0x20a2, 0x6814, 0x20a2, 0x2069, 0xa31a,
-	0x2da6, 0x8d68, 0x2da6, 0x0d7f, 0x0078, 0x66dd, 0x0d7e, 0xa0e8,
-	0xa434, 0x2d6c, 0x6810, 0xa085, 0x8100, 0x20a2, 0x6814, 0x20a2,
-	0x0d7f, 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3, 0x0009, 0x20a3,
-	0x0000, 0x0078, 0x65c1, 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000,
-	0x7818, 0xa080, 0x0028, 0x2004, 0xa092, 0x007e, 0x0048, 0x6702,
-	0x0d7e, 0xa0e8, 0xa434, 0x2d6c, 0x6810, 0xa085, 0x8400, 0x20a2,
-	0x6814, 0x20a2, 0x2069, 0xa31a, 0x2da6, 0x8d68, 0x2da6, 0x0d7f,
-	0x0078, 0x6711, 0x0d7e, 0xa0e8, 0xa434, 0x2d6c, 0x6810, 0xa085,
-	0x8400, 0x20a2, 0x6814, 0x20a2, 0x0d7f, 0x20a3, 0x0000, 0x6230,
-	0x22a2, 0x20a3, 0x0099, 0x20a3, 0x0000, 0x1078, 0x6c1c, 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,
-	0x6743, 0x0d7e, 0xa0e8, 0xa434, 0x2d6c, 0x6810, 0xa085, 0x8500,
-	0x20a2, 0x6814, 0x20a2, 0x2069, 0xa31a, 0x2da6, 0x8d68, 0x2da6,
-	0x0d7f, 0x0078, 0x6752, 0x0d7e, 0xa0e8, 0xa434, 0x2d6c, 0x6810,
-	0xa085, 0x8500, 0x20a2, 0x6814, 0x20a2, 0x0d7f, 0x20a3, 0x0000,
-	0x6230, 0x22a2, 0x20a3, 0x0099, 0x20a3, 0x0000, 0x0078, 0x6715,
-	0x0c7e, 0x0f7e, 0x2c78, 0x7804, 0xa08a, 0x0040, 0x1048, 0x1328,
-	0xa08a, 0x0053, 0x10c8, 0x1328, 0x7918, 0x2160, 0x61a0, 0xd1bc,
-	0x0040, 0x6777, 0x6100, 0xd1f4, 0x0040, 0x6773, 0x6114, 0xa18c,
-	0x00ff, 0x0078, 0x677c, 0x2009, 0x0000, 0x0078, 0x677c, 0xa1e0,
-	0x293f, 0x2c0c, 0xa18c, 0x00ff, 0x2061, 0x0100, 0x619a, 0xa082,
-	0x0040, 0x1079, 0x6786, 0x0f7f, 0x0c7f, 0x007c, 0x679b, 0x68a9,
-	0x684a, 0x6a59, 0x6799, 0x6799, 0x6799, 0x6799, 0x6799, 0x6799,
-	0x6799, 0x6f5e, 0x6f6f, 0x6f80, 0x6f91, 0x6799, 0x748e, 0x6799,
-	0x6f4d, 0x1078, 0x1328, 0x0d7e, 0x157e, 0x147e, 0x780b, 0xffff,
-	0x20a1, 0x020b, 0x1078, 0x6806, 0x7910, 0x2168, 0x6948, 0x7922,
-	0x21a2, 0xa016, 0x22a2, 0x22a2, 0x22a2, 0x694c, 0xa184, 0x000f,
-	0x00c0, 0x67b6, 0x2001, 0x0005, 0x0078, 0x67c0, 0xd184, 0x0040,
-	0x67bd, 0x2001, 0x0004, 0x0078, 0x67c0, 0xa084, 0x0006, 0x8004,
-	0x017e, 0x2008, 0x7830, 0xa084, 0x00ff, 0x8007, 0xa105, 0x017f,
-	0x20a2, 0xd1ac, 0x0040, 0x67d0, 0x20a3, 0x0002, 0x0078, 0x67dc,
-	0xd1b4, 0x0040, 0x67d7, 0x20a3, 0x0001, 0x0078, 0x67dc, 0x20a3,
-	0x0000, 0x2230, 0x0078, 0x67de, 0x6a80, 0x6e7c, 0x20a9, 0x0008,
-	0xad80, 0x0017, 0x200c, 0x810f, 0x21a2, 0x8000, 0x00f0, 0x67e2,
-	0x22a2, 0x26a2, 0x60c3, 0x0020, 0x20e1, 0x9080, 0x6014, 0xa084,
-	0x0004, 0xa085, 0x0009, 0x6016, 0x2001, 0xa5c7, 0x2003, 0x07d0,
-	0x2001, 0xa5c6, 0x2003, 0x0009, 0x2001, 0xa5cc, 0x2003, 0x0002,
-	0x1078, 0x157e, 0x147f, 0x157f, 0x0d7f, 0x007c, 0x20e1, 0x9080,
-	0x20e1, 0x4000, 0x7a18, 0xa280, 0x0023, 0x2014, 0x8210, 0xa294,
-	0x00ff, 0x2202, 0x8217, 0x7818, 0xa080, 0x0028, 0x2004, 0xd0bc,
-	0x0040, 0x682c, 0x0d7e, 0xa0e8, 0xa434, 0x2d6c, 0x6810, 0xa085,
-	0x0600, 0x20a2, 0x6814, 0x20a2, 0x2069, 0xa31a, 0x2da6, 0x8d68,
-	0x2da6, 0x0d7f, 0x0078, 0x683b, 0x0d7e, 0xa0e8, 0xa434, 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, 0x686a, 0x7810, 0x2068, 0x6860, 0x20a2, 0x685c, 0x20a2,
-	0x6880, 0x20a2, 0x687c, 0x20a2, 0xa006, 0x20a2, 0x20a2, 0x20a2,
-	0x20a2, 0x60c3, 0x000c, 0x1078, 0x6c2d, 0x147f, 0x137f, 0x157f,
-	0x0d7f, 0x007c, 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x7818,
-	0xa080, 0x0028, 0x2004, 0xd0bc, 0x0040, 0x6888, 0x0d7e, 0xa0e8,
-	0xa434, 0x2d6c, 0x6810, 0xa085, 0x0500, 0x20a2, 0x6814, 0x20a2,
-	0x2069, 0xa31a, 0x2da6, 0x8d68, 0x2da6, 0x0d7f, 0x0078, 0x6897,
-	0x0d7e, 0xa0e8, 0xa434, 0x2d6c, 0x6810, 0xa085, 0x0500, 0x20a2,
-	0x6814, 0x20a2, 0x0d7f, 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3,
-	0x0889, 0x20a3, 0x0000, 0x1078, 0x6c1c, 0x22a2, 0x20a3, 0x0000,
-	0x7a08, 0x22a2, 0x2fa2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x027f,
-	0x007c, 0x0d7e, 0x157e, 0x137e, 0x147e, 0x7810, 0xa06d, 0x1078,
-	0x488f, 0x0040, 0x68bd, 0x684c, 0xa084, 0x2020, 0xa086, 0x2020,
-	0x00c0, 0x68bd, 0x7824, 0xc0cd, 0x7826, 0x20a1, 0x020b, 0x1078,
-	0x6a12, 0xa016, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x7810,
-	0xa084, 0xf000, 0x00c0, 0x68d4, 0x7810, 0xa084, 0x0700, 0x8007,
-	0x1079, 0x68dc, 0x0078, 0x68d7, 0xa006, 0x1079, 0x68dc, 0x147f,
-	0x137f, 0x157f, 0x0d7f, 0x007c, 0x68e6, 0x697e, 0x6989, 0x69b3,
-	0x69c7, 0x69e3, 0x69ee, 0x68e4, 0x1078, 0x1328, 0x017e, 0x037e,
-	0x694c, 0xa18c, 0x0003, 0x0040, 0x68f1, 0xa186, 0x0003, 0x00c0,
-	0x6900, 0x6b78, 0x7824, 0xd0cc, 0x0040, 0x68f7, 0xc3e5, 0x23a2,
-	0x6868, 0x20a2, 0x6864, 0x20a2, 0x037f, 0x017f, 0x0078, 0x69be,
-	0xa186, 0x0001, 0x10c0, 0x1328, 0x6b78, 0x7824, 0xd0cc, 0x0040,
-	0x690a, 0xc3e5, 0x23a2, 0x6868, 0x20a2, 0x6864, 0x20a2, 0x22a2,
-	0x6874, 0x20a2, 0x22a2, 0x687c, 0x20a2, 0x2009, 0x0018, 0xa384,
-	0x0300, 0x0040, 0x6978, 0xd3c4, 0x0040, 0x6920, 0x687c, 0xa108,
-	0xd3cc, 0x0040, 0x6925, 0x6874, 0xa108, 0x157e, 0x20a9, 0x000d,
-	0xad80, 0x0020, 0x201c, 0x831f, 0x23a2, 0x8000, 0x00f0, 0x692a,
-	0x157f, 0x22a2, 0x22a2, 0x22a2, 0xa184, 0x0003, 0x0040, 0x6978,
-	0x20a1, 0x020b, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x007e, 0x7818,
-	0xa080, 0x0028, 0x2004, 0xd0bc, 0x0040, 0x6958, 0x0d7e, 0xa0e8,
-	0xa434, 0x2d6c, 0x6810, 0xa085, 0x0700, 0x20a2, 0x6814, 0x20a2,
-	0x2069, 0xa31a, 0x2da6, 0x8d68, 0x2da6, 0x0d7f, 0x0078, 0x6967,
-	0x0d7e, 0xa0e8, 0xa434, 0x2d6c, 0x6810, 0xa085, 0x0700, 0x20a2,
-	0x6814, 0x20a2, 0x0d7f, 0x20a3, 0x0000, 0x6230, 0x22a2, 0x007f,
-	0x7b24, 0xd3cc, 0x0040, 0x6970, 0x20a3, 0x0889, 0x0078, 0x6972,
-	0x20a3, 0x0898, 0x20a2, 0x1078, 0x6c1c, 0x22a2, 0x20a3, 0x0000,
-	0x61c2, 0x037f, 0x017f, 0x1078, 0x6c2d, 0x007c, 0x2011, 0x0008,
-	0x7824, 0xd0cc, 0x0040, 0x6985, 0xc2e5, 0x22a2, 0xa016, 0x0078,
-	0x69bc, 0x2011, 0x0302, 0x7824, 0xd0cc, 0x0040, 0x6990, 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, 0x6c2d, 0x007c, 0x2011, 0x0028, 0x7824, 0xd0cc, 0x0040,
-	0x69ba, 0xc2e5, 0x22a2, 0xa016, 0x22a2, 0x22a2, 0x22a2, 0x22a2,
-	0x22a2, 0x22a2, 0x60c3, 0x0018, 0x1078, 0x6c2d, 0x007c, 0x2011,
-	0x0100, 0x7824, 0xd0cc, 0x0040, 0x69ce, 0xc2e5, 0x22a2, 0xa016,
-	0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x20a3, 0x0008, 0x22a2,
-	0x7834, 0xa084, 0x00ff, 0x20a2, 0x22a2, 0x22a2, 0x60c3, 0x0020,
-	0x1078, 0x6c2d, 0x007c, 0x2011, 0x0008, 0x7824, 0xd0cc, 0x0040,
-	0x69ea, 0xc2e5, 0x22a2, 0xa016, 0x0078, 0x69bc, 0x037e, 0x7b10,
-	0xa384, 0xff00, 0x7812, 0xa384, 0x00ff, 0x8001, 0x00c0, 0x6a01,
-	0x7824, 0xd0cc, 0x0040, 0x69fd, 0xc2e5, 0x22a2, 0x037f, 0x0078,
-	0x69bc, 0x047e, 0x2021, 0x0800, 0x007e, 0x7824, 0xd0cc, 0x007f,
-	0x0040, 0x6a0b, 0xc4e5, 0x24a2, 0x047f, 0x22a2, 0x20a2, 0x037f,
-	0x0078, 0x69be, 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x7818,
-	0xa080, 0x0028, 0x2004, 0xd0bc, 0x0040, 0x6a30, 0x0d7e, 0xa0e8,
-	0xa434, 0x2d6c, 0x6810, 0xa085, 0x0700, 0x20a2, 0x6814, 0x20a2,
-	0x2069, 0xa31a, 0x2da6, 0x8d68, 0x2da6, 0x0d7f, 0x0078, 0x6a3f,
-	0x0d7e, 0xa0e8, 0xa434, 0x2d6c, 0x6810, 0xa085, 0x0700, 0x20a2,
-	0x6814, 0x20a2, 0x0d7f, 0x20a3, 0x0000, 0x6230, 0x22a2, 0x7824,
-	0xd0cc, 0x0040, 0x6a47, 0x20a3, 0x0889, 0x0078, 0x6a49, 0x20a3,
-	0x0898, 0x20a3, 0x0000, 0x1078, 0x6c1c, 0x22a2, 0x20a3, 0x0000,
-	0x7a08, 0x22a2, 0x2fa2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x027f,
-	0x007c, 0x0d7e, 0x157e, 0x137e, 0x147e, 0x017e, 0x037e, 0x7810,
-	0xa084, 0x0700, 0x8007, 0x1079, 0x6a6c, 0x037f, 0x017f, 0x147f,
-	0x137f, 0x157f, 0x0d7f, 0x007c, 0x6a74, 0x6a74, 0x6a76, 0x6a74,
-	0x6a74, 0x6a74, 0x6a9b, 0x6a74, 0x1078, 0x1328, 0x7910, 0xa18c,
-	0xf8ff, 0xa18d, 0x0600, 0x7912, 0x20a1, 0x020b, 0x2009, 0x0003,
-	0x1078, 0x6aa5, 0x0d7e, 0x2069, 0xa351, 0x6804, 0xd0bc, 0x0040,
-	0x6a90, 0x682c, 0xa084, 0x00ff, 0x8007, 0x20a2, 0x0078, 0x6a92,
-	0x20a3, 0x3f00, 0x0d7f, 0x22a2, 0x22a2, 0x22a2, 0x60c3, 0x0001,
-	0x1078, 0x6c2d, 0x007c, 0x20a1, 0x020b, 0x2009, 0x0003, 0x1078,
-	0x6aa5, 0x20a3, 0x7f00, 0x0078, 0x6a93, 0x027e, 0x20e1, 0x9080,
-	0x20e1, 0x4000, 0x7818, 0xa080, 0x0028, 0x2004, 0xd0bc, 0x0040,
-	0x6ac3, 0x0d7e, 0xa0e8, 0xa434, 0x2d6c, 0x6810, 0xa085, 0x0100,
-	0x20a2, 0x6814, 0x20a2, 0x2069, 0xa31a, 0x2da6, 0x8d68, 0x2da6,
-	0x0d7f, 0x0078, 0x6ad2, 0x0d7e, 0xa0e8, 0xa434, 0x2d6c, 0x6810,
-	0xa085, 0x0100, 0x20a2, 0x6814, 0x20a2, 0x0d7f, 0x20a3, 0x0000,
-	0x6230, 0x22a2, 0x20a3, 0x0888, 0xa18d, 0x0008, 0x21a2, 0x1078,
-	0x6c1c, 0x22a2, 0x20a3, 0x0000, 0x7a08, 0x22a2, 0x2fa2, 0x20a3,
-	0x0000, 0x20a3, 0x0000, 0x027f, 0x007c, 0x0e7e, 0x0d7e, 0x0c7e,
-	0x057e, 0x047e, 0x037e, 0x2061, 0x0100, 0x2071, 0xa300, 0x6130,
-	0x7818, 0x2068, 0x68a0, 0x2028, 0xd0bc, 0x00c0, 0x6afc, 0x6910,
-	0x6a14, 0x6430, 0x0078, 0x6b00, 0x6910, 0x6a14, 0x7368, 0x746c,
-	0x781c, 0xa086, 0x0006, 0x0040, 0x6b5f, 0xd5bc, 0x0040, 0x6b10,
-	0xa185, 0x0100, 0x6062, 0x6266, 0x636a, 0x646e, 0x0078, 0x6b17,
-	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, 0x6b49, 0x6a00, 0xd2f4,
-	0x0040, 0x6b47, 0x6a14, 0xa294, 0x00ff, 0x0078, 0x6b49, 0x2011,
-	0x0000, 0x629e, 0x6017, 0x0016, 0x2009, 0x07d0, 0x60c4, 0xa084,
-	0xfff0, 0xa005, 0x0040, 0x6b56, 0x2009, 0x1b58, 0x1078, 0x595f,
-	0x037f, 0x047f, 0x057f, 0x0c7f, 0x0d7f, 0x0e7f, 0x007c, 0x7810,
-	0x2070, 0x704c, 0xa084, 0x0003, 0xa086, 0x0002, 0x0040, 0x6bb7,
-	0xd5bc, 0x0040, 0x6b73, 0xa185, 0x0100, 0x6062, 0x6266, 0x636a,
-	0x646e, 0x0078, 0x6b7a, 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, 0x6bb2, 0x6a00,
-	0xd2f4, 0x0040, 0x6bb0, 0x6a14, 0xa294, 0x00ff, 0x0078, 0x6bb2,
-	0x2011, 0x0000, 0x629e, 0x6017, 0x0012, 0x0078, 0x6b4c, 0xd5bc,
-	0x0040, 0x6bc2, 0xa185, 0x0700, 0x6062, 0x6266, 0x636a, 0x646e,
-	0x0078, 0x6bc9, 0xa185, 0x0700, 0x6062, 0x6266, 0x606b, 0x0000,
-	0x646e, 0x1078, 0x488f, 0x0040, 0x6bdf, 0x0d7e, 0x7810, 0xa06d,
-	0x684c, 0x0d7f, 0xa084, 0x2020, 0xa086, 0x2020, 0x00c0, 0x6bdf,
-	0x7824, 0xc0cd, 0x7826, 0x6073, 0x0889, 0x0078, 0x6be1, 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, 0x6c0f, 0x6a00, 0xd2f4, 0x0040, 0x6c0d,
-	0x6a14, 0xa294, 0x00ff, 0x0078, 0x6c0f, 0x2011, 0x0000, 0x629e,
-	0x7824, 0xd0cc, 0x0040, 0x6c18, 0x6017, 0x0016, 0x0078, 0x6b4c,
-	0x6017, 0x0012, 0x0078, 0x6b4c, 0x7a18, 0xa280, 0x0023, 0x2014,
-	0x8210, 0xa294, 0x00ff, 0x2202, 0x8217, 0x007c, 0x0d7e, 0x2069,
-	0xa5ab, 0x6843, 0x0001, 0x0d7f, 0x007c, 0x20e1, 0x9080, 0x60a3,
-	0x0056, 0x60a7, 0x9575, 0x1078, 0x6c38, 0x1078, 0x594f, 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, 0x6c89, 0x1078, 0x6c41, 0x6803, 0x1000, 0x6803,
-	0x0000, 0x0c7e, 0x2061, 0xa5ab, 0x6128, 0xa192, 0x00c8, 0x00c8,
-	0x6c76, 0x8108, 0x612a, 0x6124, 0x0c7f, 0x81ff, 0x0040, 0x6c84,
-	0x1078, 0x594f, 0x1078, 0x6c38, 0x0078, 0x6c84, 0x6124, 0xa1e5,
-	0x0000, 0x0040, 0x6c81, 0x1078, 0xa241, 0x2009, 0x0014, 0x1078,
-	0x756c, 0x0c7f, 0x0078, 0x6c84, 0x027f, 0x017f, 0x0d7f, 0x0c7f,
-	0x007c, 0x2001, 0xa5c7, 0x2004, 0xa005, 0x00c0, 0x6c84, 0x0c7e,
-	0x2061, 0xa5ab, 0x6128, 0xa192, 0x0003, 0x00c8, 0x6c76, 0x8108,
-	0x612a, 0x0c7f, 0x1078, 0x594f, 0x1078, 0x4171, 0x0078, 0x6c84,
-	0x0c7e, 0x0d7e, 0x0e7e, 0x017e, 0x027e, 0x1078, 0x5967, 0x2071,
-	0xa5ab, 0x713c, 0x81ff, 0x0040, 0x6cca, 0x2061, 0x0100, 0x2069,
-	0x0140, 0x6904, 0xa194, 0x4000, 0x0040, 0x6cd0, 0x6803, 0x1000,
-	0x6803, 0x0000, 0x037e, 0x2019, 0x0001, 0x1078, 0x6e6c, 0x037f,
-	0x713c, 0x2160, 0x1078, 0xa241, 0x2009, 0x004a, 0x1078, 0x756c,
-	0x0078, 0x6cca, 0x027f, 0x017f, 0x0e7f, 0x0d7f, 0x0c7f, 0x007c,
-	0x0078, 0x6cba, 0x0e7e, 0x0d7e, 0x0c7e, 0x067e, 0x057e, 0x047e,
-	0x007e, 0x127e, 0x2091, 0x8000, 0x6018, 0x2068, 0x6ca0, 0x2071,
-	0xa5ab, 0x7018, 0x2068, 0x8dff, 0x0040, 0x6cfc, 0x68a0, 0xa406,
-	0x0040, 0x6cee, 0x6854, 0x2068, 0x0078, 0x6ce3, 0x6010, 0x2060,
-	0x643c, 0x6540, 0x6e48, 0x2d60, 0x1078, 0x466a, 0x0040, 0x6cfc,
-	0x1078, 0x7045, 0xa085, 0x0001, 0x127f, 0x007f, 0x047f, 0x057f,
-	0x067f, 0x0c7f, 0x0d7f, 0x0e7f, 0x007c, 0x20a1, 0x020b, 0x1078,
-	0x6567, 0x20a3, 0x1200, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x781c,
-	0xa086, 0x0004, 0x00c0, 0x6d17, 0x6098, 0x0078, 0x6d18, 0x6030,
-	0x20a2, 0x7834, 0x20a2, 0x7838, 0x20a2, 0x20a9, 0x0010, 0xa006,
-	0x20a2, 0x00f0, 0x6d20, 0x20a2, 0x20a2, 0x60c3, 0x002c, 0x1078,
-	0x6c2d, 0x007c, 0x157e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x6567,
-	0x20a3, 0x0f00, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x7808, 0x20a2,
-	0x60c3, 0x0008, 0x1078, 0x6c2d, 0x147f, 0x157f, 0x007c, 0x157e,
-	0x147e, 0x20a1, 0x020b, 0x1078, 0x65f8, 0x20a3, 0x0200, 0x20a3,
-	0x0000, 0x20a9, 0x0006, 0x2011, 0xa340, 0x2019, 0xa341, 0x23a6,
-	0x22a6, 0xa398, 0x0002, 0xa290, 0x0002, 0x00f0, 0x6d4f, 0x20a3,
-	0x0000, 0x20a3, 0x0000, 0x60c3, 0x001c, 0x1078, 0x6c2d, 0x147f,
-	0x157f, 0x007c, 0x157e, 0x147e, 0x017e, 0x027e, 0x20a1, 0x020b,
-	0x1078, 0x65cf, 0x1078, 0x65e6, 0x7810, 0xa080, 0x0000, 0x2004,
-	0xa080, 0x0015, 0x2098, 0x7808, 0xa088, 0x0002, 0x21a8, 0x53a6,
-	0xa080, 0x0004, 0x8003, 0x60c2, 0x1078, 0x6c2d, 0x027f, 0x017f,
-	0x147f, 0x157f, 0x007c, 0x157e, 0x147e, 0x20a1, 0x020b, 0x1078,
-	0x6567, 0x20a3, 0x6200, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x7808,
-	0x20a2, 0x60c3, 0x0008, 0x1078, 0x6c2d, 0x147f, 0x157f, 0x007c,
-	0x157e, 0x147e, 0x017e, 0x027e, 0x20a1, 0x020b, 0x1078, 0x6567,
-	0x7810, 0xa080, 0x0000, 0x2004, 0xa080, 0x0017, 0x2098, 0x7808,
-	0xa088, 0x0002, 0x21a8, 0x53a6, 0x8003, 0x60c2, 0x1078, 0x6c2d,
-	0x027f, 0x017f, 0x147f, 0x157f, 0x007c, 0x0e7e, 0x0c7e, 0x007e,
-	0x127e, 0x2091, 0x8000, 0x2071, 0xa5ab, 0x700c, 0x2060, 0x8cff,
-	0x0040, 0x6dd1, 0x1078, 0x8c3b, 0x00c0, 0x6dc8, 0x1078, 0x7a05,
-	0x600c, 0x007e, 0x1078, 0x753d, 0x1078, 0x7045, 0x0c7f, 0x0078,
-	0x6dbf, 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, 0xa5ab, 0x7024, 0x2060, 0x8cff, 0x0040, 0x6e2a,
-	0x1078, 0x6c41, 0x68c3, 0x0000, 0x1078, 0x595a, 0x2009, 0x0013,
-	0x1078, 0x756c, 0x20a9, 0x01f4, 0x6824, 0xd094, 0x0040, 0x6e0d,
-	0x6827, 0x0004, 0x7804, 0xa084, 0x4000, 0x0040, 0x6e1f, 0x7803,
-	0x1000, 0x7803, 0x0000, 0x0078, 0x6e1f, 0xd084, 0x0040, 0x6e14,
-	0x6827, 0x0001, 0x0078, 0x6e16, 0x00f0, 0x6dfc, 0x7804, 0xa084,
-	0x1000, 0x0040, 0x6e1f, 0x7803, 0x0100, 0x7803, 0x0000, 0x6824,
-	0x007f, 0x017f, 0x027f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x157f,
-	0x127f, 0x007c, 0x2001, 0xa300, 0x2004, 0xa096, 0x0001, 0x0040,
-	0x6e62, 0xa096, 0x0004, 0x0040, 0x6e62, 0x6817, 0x0008, 0x68c3,
-	0x0000, 0x2011, 0x4129, 0x1078, 0x58d4, 0x20a9, 0x01f4, 0x6824,
-	0xd094, 0x0040, 0x6e50, 0x6827, 0x0004, 0x7804, 0xa084, 0x4000,
-	0x0040, 0x6e62, 0x7803, 0x1000, 0x7803, 0x0000, 0x0078, 0x6e62,
-	0xd084, 0x0040, 0x6e57, 0x6827, 0x0001, 0x0078, 0x6e59, 0x00f0,
-	0x6e3f, 0x7804, 0xa084, 0x1000, 0x0040, 0x6e62, 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, 0xa5ab, 0x703c, 0x2060, 0x8cff,
-	0x0040, 0x6ee8, 0x6817, 0x0010, 0x2009, 0x00fa, 0x8109, 0x00c0,
-	0x6e86, 0x68c7, 0x0000, 0x68cb, 0x0008, 0x1078, 0x5967, 0x1078,
-	0x1f31, 0x047e, 0x057e, 0x2009, 0x017f, 0x212c, 0x200b, 0x00a5,
-	0x2021, 0x0169, 0x2404, 0xa084, 0x000f, 0xa086, 0x0004, 0x00c0,
-	0x6eb7, 0x68c7, 0x0000, 0x68cb, 0x0008, 0x0e7e, 0x0f7e, 0x2079,
-	0x0020, 0x2071, 0xa602, 0x6814, 0xa084, 0x0004, 0xa085, 0x0012,
-	0x6816, 0x7803, 0x0008, 0x7003, 0x0000, 0x0f7f, 0x0e7f, 0x250a,
-	0x057f, 0x047f, 0xa39d, 0x0000, 0x00c0, 0x6ec2, 0x2009, 0x0049,
-	0x1078, 0x756c, 0x20a9, 0x03e8, 0x6824, 0xd094, 0x0040, 0x6ed5,
-	0x6827, 0x0004, 0x7804, 0xa084, 0x4000, 0x0040, 0x6ee7, 0x7803,
-	0x1000, 0x7803, 0x0000, 0x0078, 0x6ee7, 0xd08c, 0x0040, 0x6edc,
-	0x6827, 0x0002, 0x0078, 0x6ede, 0x00f0, 0x6ec4, 0x7804, 0xa084,
-	0x1000, 0x0040, 0x6ee7, 0x7803, 0x0100, 0x7803, 0x0000, 0x6824,
-	0x007f, 0x017f, 0x027f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x157f,
-	0x127f, 0x007c, 0x0d7e, 0x127e, 0x2091, 0x8000, 0x2069, 0xa5ab,
-	0x6a06, 0x127f, 0x0d7f, 0x007c, 0x0d7e, 0x127e, 0x2091, 0x8000,
-	0x2069, 0xa5ab, 0x6a32, 0x127f, 0x0d7f, 0x007c, 0x0f7e, 0x0e7e,
-	0x0c7e, 0x067e, 0x007e, 0x127e, 0x2071, 0xa5ab, 0x7614, 0x2660,
-	0x2678, 0x2091, 0x8000, 0x8cff, 0x0040, 0x6f46, 0x601c, 0xa206,
-	0x00c0, 0x6f41, 0x7014, 0xac36, 0x00c0, 0x6f20, 0x660c, 0x7616,
-	0x7010, 0xac36, 0x00c0, 0x6f2e, 0x2c00, 0xaf36, 0x0040, 0x6f2c,
-	0x2f00, 0x7012, 0x0078, 0x6f2e, 0x7013, 0x0000, 0x660c, 0x067e,
-	0x2c00, 0xaf06, 0x0040, 0x6f37, 0x7e0e, 0x0078, 0x6f38, 0x2678,
-	0x600f, 0x0000, 0x1078, 0x8c01, 0x1078, 0x7045, 0x0c7f, 0x0078,
-	0x6f13, 0x2c78, 0x600c, 0x2060, 0x0078, 0x6f13, 0x127f, 0x007f,
-	0x067f, 0x0c7f, 0x0e7f, 0x0f7f, 0x007c, 0x157e, 0x147e, 0x20a1,
-	0x020b, 0x1078, 0x6806, 0x7810, 0x20a2, 0xa006, 0x20a2, 0x20a2,
-	0x20a2, 0x20a2, 0x20a3, 0x1000, 0x0078, 0x6fa0, 0x157e, 0x147e,
-	0x20a1, 0x020b, 0x1078, 0x6806, 0x7810, 0x20a2, 0xa006, 0x20a2,
-	0x20a2, 0x20a2, 0x20a2, 0x20a3, 0x4000, 0x0078, 0x6fa0, 0x157e,
-	0x147e, 0x20a1, 0x020b, 0x1078, 0x6806, 0x7810, 0x20a2, 0xa006,
-	0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a3, 0x2000, 0x0078, 0x6fa0,
-	0x157e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x6806, 0x7810, 0x20a2,
-	0xa006, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a3, 0x0400, 0x0078,
-	0x6fa0, 0x157e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x6806, 0x7810,
-	0x20a2, 0xa006, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a3, 0x0200,
-	0x1078, 0x7050, 0x60c3, 0x0020, 0x1078, 0x6c2d, 0x147f, 0x157f,
-	0x007c, 0x127e, 0x0c7e, 0x2091, 0x8000, 0x2061, 0x0100, 0x6120,
-	0xd1b4, 0x00c0, 0x6fb8, 0xd1bc, 0x00c0, 0x7002, 0x0078, 0x7042,
-	0x2009, 0x017f, 0x200b, 0x00a1, 0x157e, 0x007e, 0x0d7e, 0x2069,
-	0x0140, 0x20a9, 0x001e, 0x2009, 0x0169, 0x6804, 0xa084, 0x4000,
-	0x0040, 0x6ff9, 0x6020, 0xd0b4, 0x0040, 0x6ff9, 0x6024, 0xd094,
-	0x00c0, 0x6ff9, 0x2104, 0xa084, 0x000f, 0xa086, 0x0004, 0x00c0,
-	0x6ff9, 0x00f0, 0x6fc5, 0x027e, 0x6198, 0xa18c, 0x00ff, 0x8107,
-	0x6130, 0xa18c, 0x00ff, 0xa10d, 0x6088, 0x628c, 0x618e, 0x608b,
-	0xbc91, 0x6043, 0x0001, 0x6043, 0x0000, 0x608a, 0x628e, 0x6024,
-	0xd094, 0x00c0, 0x6ff8, 0x6a04, 0xa294, 0x4000, 0x00c0, 0x6fef,
-	0x027f, 0x0d7f, 0x007f, 0x157f, 0x2009, 0x017f, 0x200b, 0x0000,
-	0x0078, 0x7042, 0x2009, 0x017f, 0x200b, 0x00a1, 0x157e, 0x007e,
-	0x0d7e, 0x2069, 0x0140, 0x20a9, 0x001e, 0x2009, 0x0169, 0x6804,
-	0xa084, 0x4000, 0x0040, 0x703b, 0x6020, 0xd0bc, 0x0040, 0x703b,
-	0x2104, 0xa084, 0x000f, 0xa086, 0x0004, 0x00c0, 0x703b, 0x00f0,
-	0x700f, 0x027e, 0x6164, 0xa18c, 0x00ff, 0x8107, 0x6130, 0xa18c,
-	0x00ff, 0xa10d, 0x6088, 0x628c, 0x608b, 0xbc91, 0x618e, 0x6043,
-	0x0001, 0x6043, 0x0000, 0x608a, 0x628e, 0x6a04, 0xa294, 0x4000,
-	0x00c0, 0x7035, 0x027f, 0x0d7f, 0x007f, 0x157f, 0x2009, 0x017f,
-	0x200b, 0x0000, 0x0c7f, 0x127f, 0x007c, 0x0e7e, 0x2071, 0xa5ab,
-	0x7020, 0xa005, 0x0040, 0x704e, 0x8001, 0x7022, 0x0e7f, 0x007c,
-	0x20a9, 0x0008, 0x20a2, 0x00f0, 0x7052, 0x20a2, 0x20a2, 0x007c,
-	0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x077e, 0x067e, 0x007e, 0x127e,
-	0x2091, 0x8000, 0x2071, 0xa5ab, 0x7614, 0x2660, 0x2678, 0x2039,
-	0x0001, 0x87ff, 0x0040, 0x70f4, 0x8cff, 0x0040, 0x70f4, 0x601c,
-	0xa086, 0x0006, 0x00c0, 0x70ef, 0x88ff, 0x0040, 0x707f, 0x2800,
-	0xac06, 0x00c0, 0x70ef, 0x2039, 0x0000, 0x0078, 0x708a, 0x6018,
-	0xa206, 0x00c0, 0x70ef, 0x85ff, 0x0040, 0x708a, 0x6020, 0xa106,
-	0x00c0, 0x70ef, 0x7024, 0xac06, 0x00c0, 0x70ba, 0x2069, 0x0100,
-	0x68c0, 0xa005, 0x0040, 0x70b5, 0x1078, 0x595a, 0x6817, 0x0008,
-	0x68c3, 0x0000, 0x1078, 0x7188, 0x7027, 0x0000, 0x037e, 0x2069,
-	0x0140, 0x6b04, 0xa384, 0x1000, 0x0040, 0x70aa, 0x6803, 0x0100,
-	0x6803, 0x0000, 0x2069, 0x0100, 0x6824, 0xd084, 0x0040, 0x70b2,
-	0x6827, 0x0001, 0x037f, 0x0078, 0x70ba, 0x6003, 0x0009, 0x630a,
-	0x0078, 0x70ef, 0x7014, 0xac36, 0x00c0, 0x70c0, 0x660c, 0x7616,
-	0x7010, 0xac36, 0x00c0, 0x70ce, 0x2c00, 0xaf36, 0x0040, 0x70cc,
-	0x2f00, 0x7012, 0x0078, 0x70ce, 0x7013, 0x0000, 0x660c, 0x067e,
-	0x2c00, 0xaf06, 0x0040, 0x70d7, 0x7e0e, 0x0078, 0x70d8, 0x2678,
-	0x89ff, 0x00c0, 0x70e7, 0x600f, 0x0000, 0x6010, 0x2068, 0x1078,
-	0x8a44, 0x0040, 0x70e5, 0x1078, 0x9e70, 0x1078, 0x8c01, 0x1078,
-	0x7045, 0x88ff, 0x00c0, 0x70fe, 0x0c7f, 0x0078, 0x7069, 0x2c78,
-	0x600c, 0x2060, 0x0078, 0x7069, 0xa006, 0x127f, 0x007f, 0x067f,
-	0x077f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x007c, 0x6017, 0x0000,
-	0x0c7f, 0xa8c5, 0x0001, 0x0078, 0x70f5, 0x0f7e, 0x0e7e, 0x0d7e,
-	0x0c7e, 0x067e, 0x027e, 0x007e, 0x127e, 0x2091, 0x8000, 0x2071,
-	0xa5ab, 0x7638, 0x2660, 0x2678, 0x8cff, 0x0040, 0x7177, 0x601c,
-	0xa086, 0x0006, 0x00c0, 0x7172, 0x87ff, 0x0040, 0x7125, 0x2700,
-	0xac06, 0x00c0, 0x7172, 0x0078, 0x7130, 0x6018, 0xa206, 0x00c0,
-	0x7172, 0x85ff, 0x0040, 0x7130, 0x6020, 0xa106, 0x00c0, 0x7172,
-	0x703c, 0xac06, 0x00c0, 0x7142, 0x037e, 0x2019, 0x0001, 0x1078,
-	0x6e6c, 0x7033, 0x0000, 0x703f, 0x0000, 0x7043, 0x0000, 0x7047,
-	0x0000, 0x037f, 0x7038, 0xac36, 0x00c0, 0x7148, 0x660c, 0x763a,
-	0x7034, 0xac36, 0x00c0, 0x7156, 0x2c00, 0xaf36, 0x0040, 0x7154,
-	0x2f00, 0x7036, 0x0078, 0x7156, 0x7037, 0x0000, 0x660c, 0x067e,
-	0x2c00, 0xaf06, 0x0040, 0x715f, 0x7e0e, 0x0078, 0x7160, 0x2678,
-	0x600f, 0x0000, 0x6010, 0x2068, 0x1078, 0x8a44, 0x0040, 0x716a,
-	0x1078, 0x9e70, 0x1078, 0x8c01, 0x87ff, 0x00c0, 0x7181, 0x0c7f,
-	0x0078, 0x7114, 0x2c78, 0x600c, 0x2060, 0x0078, 0x7114, 0xa006,
-	0x127f, 0x007f, 0x027f, 0x067f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f,
-	0x007c, 0x6017, 0x0000, 0x0c7f, 0xa7bd, 0x0001, 0x0078, 0x7178,
-	0x0e7e, 0x2071, 0xa5ab, 0x2001, 0xa300, 0x2004, 0xa086, 0x0002,
-	0x00c0, 0x7196, 0x7007, 0x0005, 0x0078, 0x7198, 0x7007, 0x0000,
-	0x0e7f, 0x007c, 0x0f7e, 0x0e7e, 0x0c7e, 0x067e, 0x027e, 0x007e,
-	0x127e, 0x2091, 0x8000, 0x2071, 0xa5ab, 0x2c10, 0x7638, 0x2660,
-	0x2678, 0x8cff, 0x0040, 0x71d8, 0x2200, 0xac06, 0x00c0, 0x71d3,
-	0x7038, 0xac36, 0x00c0, 0x71b6, 0x660c, 0x763a, 0x7034, 0xac36,
-	0x00c0, 0x71c4, 0x2c00, 0xaf36, 0x0040, 0x71c2, 0x2f00, 0x7036,
-	0x0078, 0x71c4, 0x7037, 0x0000, 0x660c, 0x2c00, 0xaf06, 0x0040,
-	0x71cc, 0x7e0e, 0x0078, 0x71cd, 0x2678, 0x600f, 0x0000, 0xa085,
-	0x0001, 0x0078, 0x71d8, 0x2c78, 0x600c, 0x2060, 0x0078, 0x71a9,
-	0x127f, 0x007f, 0x027f, 0x067f, 0x0c7f, 0x0e7f, 0x0f7f, 0x007c,
-	0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x067e, 0x007e, 0x127e, 0x2091,
-	0x8000, 0x2071, 0xa5ab, 0x760c, 0x2660, 0x2678, 0x8cff, 0x0040,
-	0x7279, 0x6018, 0xa080, 0x0028, 0x2004, 0xa206, 0x00c0, 0x7274,
-	0x7024, 0xac06, 0x00c0, 0x721f, 0x2069, 0x0100, 0x68c0, 0xa005,
-	0x0040, 0x724d, 0x1078, 0x6c41, 0x68c3, 0x0000, 0x1078, 0x7188,
-	0x7027, 0x0000, 0x037e, 0x2069, 0x0140, 0x6b04, 0xa384, 0x1000,
-	0x0040, 0x7216, 0x6803, 0x0100, 0x6803, 0x0000, 0x2069, 0x0100,
-	0x6824, 0xd084, 0x0040, 0x721e, 0x6827, 0x0001, 0x037f, 0x700c,
-	0xac36, 0x00c0, 0x7225, 0x660c, 0x760e, 0x7008, 0xac36, 0x00c0,
-	0x7233, 0x2c00, 0xaf36, 0x0040, 0x7231, 0x2f00, 0x700a, 0x0078,
-	0x7233, 0x700b, 0x0000, 0x660c, 0x067e, 0x2c00, 0xaf06, 0x0040,
-	0x723c, 0x7e0e, 0x0078, 0x723d, 0x2678, 0x600f, 0x0000, 0x1078,
-	0x8c27, 0x00c0, 0x7251, 0x1078, 0x2839, 0x1078, 0x8c3b, 0x00c0,
-	0x726d, 0x1078, 0x7a05, 0x0078, 0x726d, 0x1078, 0x7188, 0x0078,
-	0x721f, 0x1078, 0x8c3b, 0x00c0, 0x7259, 0x1078, 0x7a05, 0x0078,
-	0x726d, 0x6010, 0x2068, 0x1078, 0x8a44, 0x0040, 0x726d, 0x601c,
-	0xa086, 0x0003, 0x00c0, 0x7281, 0x6837, 0x0103, 0x6b4a, 0x6847,
-	0x0000, 0x1078, 0x4982, 0x1078, 0x8bf4, 0x1078, 0x8c01, 0x1078,
-	0x7045, 0x0c7f, 0x0078, 0x71ee, 0x2c78, 0x600c, 0x2060, 0x0078,
-	0x71ee, 0x127f, 0x007f, 0x067f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f,
-	0x007c, 0x601c, 0xa086, 0x0006, 0x00c0, 0x726d, 0x1078, 0x9e70,
-	0x0078, 0x726d, 0x037e, 0x157e, 0x137e, 0x147e, 0x3908, 0xa006,
-	0xa190, 0x0020, 0x221c, 0xa39e, 0x260c, 0x00c0, 0x729b, 0x8210,
-	0x8000, 0x0078, 0x7292, 0xa005, 0x0040, 0x72a7, 0x20a9, 0x0020,
-	0x2198, 0x8211, 0xa282, 0x0020, 0x20c8, 0x20a0, 0x53a3, 0x147f,
-	0x137f, 0x157f, 0x037f, 0x007c, 0x0d7e, 0x20a1, 0x020b, 0x1078,
-	0x65f8, 0x20a3, 0x0200, 0x20a3, 0x0014, 0x60c3, 0x0014, 0x20a3,
-	0x0000, 0x20a3, 0x0000, 0x2099, 0xa5a3, 0x20a9, 0x0004, 0x53a6,
-	0x20a3, 0x0004, 0x20a3, 0x7878, 0x20a3, 0x0000, 0x20a3, 0x0000,
-	0x1078, 0x6c2d, 0x0d7f, 0x007c, 0x20a1, 0x020b, 0x1078, 0x65f8,
-	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, 0x6c2d,
-	0x007c, 0x0d7e, 0x017e, 0x2f68, 0x2009, 0x0035, 0x1078, 0x8ef5,
-	0x00c0, 0x7361, 0x20a1, 0x020b, 0x1078, 0x6567, 0x20a3, 0x1300,
-	0x20a3, 0x0000, 0x7828, 0x2068, 0x681c, 0xa086, 0x0003, 0x0040,
-	0x733d, 0x7818, 0xa080, 0x0028, 0x2014, 0xa286, 0x007e, 0x00c0,
-	0x7317, 0x20a3, 0x00ff, 0x20a3, 0xfffe, 0x0078, 0x7352, 0xa286,
-	0x007f, 0x00c0, 0x7321, 0x20a3, 0x00ff, 0x20a3, 0xfffd, 0x0078,
-	0x7352, 0xd2bc, 0x0040, 0x7337, 0xa286, 0x0080, 0x00c0, 0x732e,
-	0x20a3, 0x00ff, 0x20a3, 0xfffc, 0x0078, 0x7352, 0xa2e8, 0xa434,
-	0x2d6c, 0x6810, 0x20a2, 0x6814, 0x20a2, 0x0078, 0x7352, 0x20a3,
-	0x0000, 0x6098, 0x20a2, 0x0078, 0x7352, 0x7818, 0xa080, 0x0028,
-	0x2004, 0xa082, 0x007e, 0x0048, 0x734e, 0x0d7e, 0x2069, 0xa31a,
-	0x2da6, 0x8d68, 0x2da6, 0x0d7f, 0x0078, 0x7352, 0x20a3, 0x0000,
-	0x6030, 0x20a2, 0x7834, 0x20a2, 0x7838, 0x20a2, 0x20a3, 0x0000,
-	0x20a3, 0x0000, 0x60c3, 0x000c, 0x1078, 0x6c2d, 0x017f, 0x0d7f,
-	0x007c, 0x7817, 0x0001, 0x7803, 0x0006, 0x017f, 0x0d7f, 0x007c,
-	0x0d7e, 0x027e, 0x7928, 0x2168, 0x691c, 0xa186, 0x0006, 0x0040,
-	0x738a, 0xa186, 0x0003, 0x0040, 0x73e5, 0xa186, 0x0005, 0x0040,
-	0x73c8, 0xa186, 0x0004, 0x0040, 0x73b8, 0xa186, 0x0008, 0x0040,
-	0x73d2, 0x7807, 0x0037, 0x7813, 0x1700, 0x1078, 0x7450, 0x027f,
-	0x0d7f, 0x007c, 0x1078, 0x740d, 0x2009, 0x4000, 0x6800, 0x0079,
-	0x7391, 0x73a4, 0x73b2, 0x73a6, 0x73b2, 0x73ad, 0x73a4, 0x73a4,
-	0x73b2, 0x73b2, 0x73b2, 0x73b2, 0x73a4, 0x73a4, 0x73a4, 0x73a4,
-	0x73a4, 0x73b2, 0x73a4, 0x73b2, 0x1078, 0x1328, 0x6824, 0xd0e4,
-	0x0040, 0x73ad, 0xd0cc, 0x0040, 0x73b0, 0xa00e, 0x0078, 0x73b2,
-	0x2009, 0x2000, 0x6828, 0x20a2, 0x682c, 0x20a2, 0x0078, 0x7403,
-	0x1078, 0x740d, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x2009, 0x4000,
-	0x6a00, 0xa286, 0x0002, 0x00c0, 0x73c6, 0xa00e, 0x0078, 0x7403,
-	0x1078, 0x740d, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x2009, 0x4000,
-	0x0078, 0x7403, 0x1078, 0x740d, 0x20a3, 0x0000, 0x20a3, 0x0000,
-	0x2009, 0x4000, 0xa286, 0x0005, 0x0040, 0x73e2, 0xa286, 0x0002,
-	0x00c0, 0x73e3, 0xa00e, 0x0078, 0x7403, 0x1078, 0x740d, 0x6810,
-	0x2068, 0x697c, 0x6810, 0xa112, 0x6980, 0x6814, 0xa103, 0x20a2,
-	0x22a2, 0x7928, 0xa180, 0x0000, 0x2004, 0xa08e, 0x0002, 0x0040,
-	0x7401, 0xa08e, 0x0004, 0x0040, 0x7401, 0x2009, 0x4000, 0x0078,
-	0x7403, 0x2009, 0x0000, 0x21a2, 0x20a3, 0x0000, 0x60c3, 0x0018,
-	0x1078, 0x6c2d, 0x027f, 0x0d7f, 0x007c, 0x037e, 0x047e, 0x057e,
-	0x067e, 0x20a1, 0x020b, 0x1078, 0x65f8, 0xa006, 0x20a3, 0x0200,
-	0x20a2, 0x7934, 0x21a2, 0x7938, 0x21a2, 0x7818, 0xa080, 0x0028,
-	0x2004, 0xa092, 0x007e, 0x0048, 0x7433, 0x0d7e, 0x2069, 0xa31a,
-	0x2d2c, 0x8d68, 0x2d34, 0xa0e8, 0xa434, 0x2d6c, 0x6b10, 0x6c14,
-	0x0d7f, 0x0078, 0x7439, 0x2019, 0x0000, 0x6498, 0x2029, 0x0000,
-	0x6630, 0x7828, 0xa080, 0x0007, 0x2004, 0xa086, 0x0003, 0x00c0,
-	0x7447, 0x25a2, 0x26a2, 0x23a2, 0x24a2, 0x0078, 0x744b, 0x23a2,
-	0x24a2, 0x25a2, 0x26a2, 0x067f, 0x057f, 0x047f, 0x037f, 0x007c,
-	0x20a1, 0x020b, 0x1078, 0x65f8, 0x20a3, 0x0100, 0x20a3, 0x0000,
-	0x20a3, 0x0009, 0x7810, 0x20a2, 0x60c3, 0x0008, 0x1078, 0x6c2d,
-	0x007c, 0x20a1, 0x020b, 0x1078, 0x655e, 0x20a3, 0x1400, 0x20a3,
-	0x0000, 0x7834, 0x20a2, 0x7838, 0x20a2, 0x7828, 0x20a2, 0x782c,
-	0x20a2, 0x7830, 0xa084, 0x00ff, 0x8007, 0x20a2, 0x20a3, 0x0000,
-	0x60c3, 0x0010, 0x1078, 0x6c2d, 0x007c, 0x20a1, 0x020b, 0x1078,
-	0x65ef, 0x20a3, 0x0100, 0x20a3, 0x0000, 0x7828, 0x20a2, 0x7810,
-	0x20a2, 0x60c3, 0x0008, 0x1078, 0x6c2d, 0x007c, 0x147e, 0x20a1,
-	0x020b, 0x1078, 0x7499, 0x60c3, 0x0000, 0x1078, 0x6c2d, 0x147f,
-	0x007c, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x7818, 0xa080, 0x0028,
-	0x2004, 0xd0bc, 0x0040, 0x74b6, 0x0d7e, 0xa0e8, 0xa434, 0x2d6c,
-	0x6810, 0xa085, 0x0300, 0x20a2, 0x6814, 0x20a2, 0x2069, 0xa31a,
-	0x2da6, 0x8d68, 0x2da6, 0x0d7f, 0x0078, 0x74be, 0x20a3, 0x0300,
-	0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3, 0x0819,
-	0x20a3, 0x0000, 0x1078, 0x6c1c, 0x22a2, 0x20a3, 0x0000, 0x2fa2,
-	0x7a08, 0x22a2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x007c, 0x2061,
-	0xaa00, 0x2a70, 0x7060, 0x7046, 0x704b, 0xaa00, 0x007c, 0x0e7e,
-	0x127e, 0x2071, 0xa300, 0x2091, 0x8000, 0x7544, 0xa582, 0x0010,
-	0x0048, 0x7509, 0x7048, 0x2060, 0x6000, 0xa086, 0x0000, 0x0040,
-	0x74f5, 0xace0, 0x0010, 0x7054, 0xac02, 0x00c8, 0x74f1, 0x0078,
-	0x74e4, 0x2061, 0xaa00, 0x0078, 0x74e4, 0x6003, 0x0008, 0x8529,
-	0x7546, 0xaca8, 0x0010, 0x7054, 0xa502, 0x00c8, 0x7505, 0x754a,
-	0xa085, 0x0001, 0x127f, 0x0e7f, 0x007c, 0x704b, 0xaa00, 0x0078,
-	0x7500, 0xa006, 0x0078, 0x7502, 0x0e7e, 0x2071, 0xa300, 0x7544,
-	0xa582, 0x0010, 0x0048, 0x753a, 0x7048, 0x2060, 0x6000, 0xa086,
-	0x0000, 0x0040, 0x7527, 0xace0, 0x0010, 0x7054, 0xac02, 0x00c8,
-	0x7523, 0x0078, 0x7516, 0x2061, 0xaa00, 0x0078, 0x7516, 0x6003,
-	0x0008, 0x8529, 0x7546, 0xaca8, 0x0010, 0x7054, 0xa502, 0x00c8,
-	0x7536, 0x754a, 0xa085, 0x0001, 0x0e7f, 0x007c, 0x704b, 0xaa00,
-	0x0078, 0x7532, 0xa006, 0x0078, 0x7534, 0xac82, 0xaa00, 0x1048,
-	0x1328, 0x2001, 0xa315, 0x2004, 0xac02, 0x10c8, 0x1328, 0xa006,
-	0x6006, 0x600a, 0x600e, 0x6012, 0x6016, 0x601a, 0x601f, 0x0000,
-	0x6003, 0x0000, 0x6022, 0x6026, 0x602a, 0x602e, 0x6032, 0x6036,
-	0x603a, 0x603e, 0x2061, 0xa300, 0x6044, 0x8000, 0x6046, 0xa086,
-	0x0001, 0x0040, 0x7564, 0x007c, 0x127e, 0x2091, 0x8000, 0x1078,
-	0x6109, 0x127f, 0x0078, 0x7563, 0x601c, 0xa084, 0x000f, 0x0079,
-	0x7571, 0x757a, 0x758b, 0x75a7, 0x75c3, 0x8f2d, 0x8f49, 0x8f65,
-	0x757a, 0x758b, 0xa186, 0x0013, 0x00c0, 0x7583, 0x1078, 0x6010,
-	0x1078, 0x6109, 0x007c, 0xa18e, 0x0047, 0x00c0, 0x758a, 0xa016,
-	0x1078, 0x15ec, 0x007c, 0x067e, 0x6000, 0xa0b2, 0x0010, 0x10c8,
-	0x1328, 0x1079, 0x7595, 0x067f, 0x007c, 0x75a5, 0x7891, 0x7a34,
-	0x75a5, 0x7ab8, 0x75df, 0x75a5, 0x75a5, 0x7823, 0x7e6d, 0x75a5,
-	0x75a5, 0x75a5, 0x75a5, 0x75a5, 0x75a5, 0x1078, 0x1328, 0x067e,
-	0x6000, 0xa0b2, 0x0010, 0x10c8, 0x1328, 0x1079, 0x75b1, 0x067f,
-	0x007c, 0x75c1, 0x8522, 0x75c1, 0x75c1, 0x75c1, 0x75c1, 0x75c1,
-	0x75c1, 0x84c5, 0x86a8, 0x75c1, 0x8552, 0x85d8, 0x8552, 0x85d8,
-	0x75c1, 0x1078, 0x1328, 0x067e, 0x6000, 0xa0b2, 0x0010, 0x10c8,
-	0x1328, 0x1079, 0x75cd, 0x067f, 0x007c, 0x75dd, 0x7eb4, 0x7f81,
-	0x80c6, 0x8242, 0x75dd, 0x75dd, 0x75dd, 0x7e8d, 0x846d, 0x8471,
-	0x75dd, 0x75dd, 0x75dd, 0x75dd, 0x84a1, 0x1078, 0x1328, 0xa1b6,
-	0x0015, 0x00c0, 0x75e7, 0x1078, 0x753d, 0x0078, 0x75ed, 0xa1b6,
-	0x0016, 0x10c0, 0x1328, 0x1078, 0x753d, 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, 0x75fc,
-	0x0e7e, 0x1078, 0x8a44, 0x0040, 0x7613, 0x6010, 0x2070, 0x7007,
-	0x0000, 0x7037, 0x0103, 0x0e7f, 0x1078, 0x753d, 0x007c, 0x0d7e,
-	0x037e, 0x7330, 0xa386, 0x0200, 0x00c0, 0x7624, 0x6018, 0x2068,
-	0x6813, 0x00ff, 0x6817, 0xfffd, 0x6010, 0xa005, 0x0040, 0x762e,
-	0x2068, 0x6807, 0x0000, 0x6837, 0x0103, 0x6b32, 0x1078, 0x753d,
-	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,
-	0x753d, 0x017f, 0x007c, 0x0e7e, 0x0d7e, 0x603f, 0x0000, 0x2c68,
-	0x017e, 0x2009, 0x0035, 0x1078, 0x8ef5, 0x017f, 0x00c0, 0x766f,
-	0x027e, 0x6228, 0x2268, 0x027f, 0x2071, 0xa88c, 0x6b1c, 0xa386,
-	0x0003, 0x0040, 0x7673, 0xa386, 0x0006, 0x0040, 0x7677, 0x1078,
-	0x753d, 0x0078, 0x7679, 0x1078, 0x767c, 0x0078, 0x7679, 0x1078,
-	0x771e, 0x0d7f, 0x0e7f, 0x007c, 0x0f7e, 0x6810, 0x2078, 0xa186,
-	0x0015, 0x0040, 0x7705, 0xa18e, 0x0016, 0x00c0, 0x771c, 0x700c,
-	0xa084, 0xff00, 0xa086, 0x1700, 0x00c0, 0x76e0, 0x8fff, 0x0040,
-	0x771a, 0x6808, 0xa086, 0xffff, 0x00c0, 0x7709, 0x784c, 0xa084,
-	0x0060, 0xa086, 0x0020, 0x00c0, 0x76a7, 0x797c, 0x7810, 0xa106,
-	0x00c0, 0x7709, 0x7980, 0x7814, 0xa106, 0x00c0, 0x7709, 0x1078,
-	0x8bf4, 0x6830, 0x7852, 0x784c, 0xc0dc, 0xc0f4, 0xc0d4, 0x784e,
-	0x027e, 0xa00e, 0x6a14, 0x2001, 0x000a, 0x1078, 0x5a98, 0x7854,
-	0xa20a, 0x0048, 0x76bc, 0x8011, 0x7a56, 0x82ff, 0x027f, 0x00c0,
-	0x76c8, 0x0c7e, 0x2d60, 0x1078, 0x8832, 0x0c7f, 0x0078, 0x771a,
-	0x0c7e, 0x0d7e, 0x2f68, 0x6838, 0xd0fc, 0x00c0, 0x76d3, 0x1078,
-	0x4290, 0x0078, 0x76d5, 0x1078, 0x436e, 0x0d7f, 0x0c7f, 0x00c0,
-	0x7709, 0x0c7e, 0x2d60, 0x1078, 0x753d, 0x0c7f, 0x0078, 0x771a,
-	0x7008, 0xa086, 0x000b, 0x00c0, 0x76fa, 0x6018, 0x200c, 0xc1bc,
-	0x2102, 0x0c7e, 0x2d60, 0x7853, 0x0003, 0x6007, 0x0085, 0x6003,
-	0x000b, 0x601f, 0x0002, 0x1078, 0x5bf8, 0x1078, 0x6109, 0x0c7f,
-	0x0078, 0x771a, 0x700c, 0xa086, 0x2a00, 0x00c0, 0x7709, 0x2001,
-	0xa5a2, 0x2004, 0x683e, 0x0078, 0x771a, 0x1078, 0x7739, 0x0078,
-	0x771c, 0x8fff, 0x1040, 0x1328, 0x0c7e, 0x0d7e, 0x2d60, 0x2f68,
-	0x684b, 0x0003, 0x1078, 0x8726, 0x1078, 0x8bf4, 0x1078, 0x8c01,
-	0x0d7f, 0x0c7f, 0x1078, 0x753d, 0x0f7f, 0x007c, 0xa186, 0x0015,
-	0x00c0, 0x7728, 0x2001, 0xa5a2, 0x2004, 0x683e, 0x0078, 0x7736,
-	0xa18e, 0x0016, 0x00c0, 0x7738, 0x0c7e, 0x2d00, 0x2060, 0x1078,
-	0xa134, 0x1078, 0x5a41, 0x1078, 0x753d, 0x0c7f, 0x1078, 0x753d,
-	0x007c, 0x027e, 0x037e, 0x047e, 0x7228, 0x7c80, 0x7b7c, 0xd2f4,
-	0x0040, 0x7748, 0x2001, 0xa5a2, 0x2004, 0x683e, 0x0078, 0x77ac,
-	0x0c7e, 0x2d60, 0x1078, 0x874a, 0x0c7f, 0x6804, 0xa086, 0x0050,
-	0x00c0, 0x7760, 0x0c7e, 0x2d00, 0x2060, 0x6003, 0x0001, 0x6007,
-	0x0050, 0x1078, 0x5bf8, 0x1078, 0x6109, 0x0c7f, 0x0078, 0x77ac,
-	0x6800, 0xa086, 0x000f, 0x0040, 0x7782, 0x8fff, 0x1040, 0x1328,
-	0x6824, 0xd0dc, 0x00c0, 0x7782, 0x6800, 0xa086, 0x0004, 0x00c0,
-	0x7787, 0x784c, 0xd0ac, 0x0040, 0x7787, 0x784c, 0xc0dc, 0xc0f4,
-	0x784e, 0x7850, 0xc0f4, 0xc0fc, 0x7852, 0x2001, 0x0001, 0x682e,
-	0x0078, 0x77a6, 0x2001, 0x0007, 0x682e, 0x0078, 0x77a6, 0x784c,
-	0xd0b4, 0x00c0, 0x7794, 0xd0ac, 0x0040, 0x7782, 0x784c, 0xd0f4,
-	0x00c0, 0x7782, 0x0078, 0x7775, 0xd2ec, 0x00c0, 0x7782, 0x7024,
-	0xa306, 0x00c0, 0x779f, 0x7020, 0xa406, 0x0040, 0x7782, 0x7020,
-	0x6836, 0x7024, 0x683a, 0x2001, 0x0005, 0x682e, 0x1078, 0x8d2b,
-	0x1078, 0x6109, 0x0078, 0x77ae, 0x1078, 0x753d, 0x047f, 0x037f,
-	0x027f, 0x007c, 0x0e7e, 0x0d7e, 0x027e, 0x6034, 0x2068, 0x6a1c,
-	0xa286, 0x0007, 0x0040, 0x7806, 0xa286, 0x0002, 0x0040, 0x7806,
-	0xa286, 0x0000, 0x0040, 0x7806, 0x6808, 0x6338, 0xa306, 0x00c0,
-	0x7806, 0x2071, 0xa88c, 0xa186, 0x0015, 0x0040, 0x7800, 0xa18e,
-	0x0016, 0x00c0, 0x77e8, 0x6030, 0xa084, 0x00ff, 0xa086, 0x0001,
-	0x00c0, 0x77e8, 0x700c, 0xa086, 0x2a00, 0x00c0, 0x77e8, 0x6034,
-	0xa080, 0x0009, 0x200c, 0xc1dd, 0xc1f5, 0x2102, 0x0078, 0x7800,
-	0x0c7e, 0x6034, 0x2060, 0x6010, 0x2068, 0x1078, 0x8a44, 0x1040,
-	0x1328, 0x6853, 0x0003, 0x6007, 0x0085, 0x6003, 0x000b, 0x601f,
-	0x0002, 0x1078, 0x5bf8, 0x1078, 0x6109, 0x0c7f, 0x0078, 0x7806,
-	0x6034, 0x2068, 0x2001, 0xa5a2, 0x2004, 0x683e, 0x1078, 0x753d,
-	0x027f, 0x0d7f, 0x0e7f, 0x007c, 0x0d7e, 0x20a9, 0x000e, 0x2e98,
-	0x6010, 0x20a0, 0x53a3, 0xa1b6, 0x0015, 0x00c0, 0x7820, 0x6018,
-	0x2068, 0x7038, 0x680a, 0x703c, 0x680e, 0x6800, 0xc08d, 0x6802,
-	0x0d7f, 0x0078, 0x7608, 0x2100, 0xa1b2, 0x0044, 0x10c8, 0x1328,
-	0xa1b2, 0x0040, 0x00c8, 0x7888, 0x0079, 0x782e, 0x787c, 0x7870,
-	0x787c, 0x787c, 0x787c, 0x787c, 0x786e, 0x786e, 0x786e, 0x786e,
-	0x786e, 0x786e, 0x786e, 0x786e, 0x786e, 0x786e, 0x786e, 0x786e,
-	0x786e, 0x786e, 0x786e, 0x786e, 0x786e, 0x786e, 0x786e, 0x786e,
-	0x786e, 0x786e, 0x786e, 0x786e, 0x786e, 0x787c, 0x786e, 0x787c,
-	0x787c, 0x786e, 0x786e, 0x786e, 0x786e, 0x786e, 0x787c, 0x786e,
-	0x786e, 0x786e, 0x786e, 0x786e, 0x786e, 0x786e, 0x786e, 0x786e,
-	0x787c, 0x787c, 0x786e, 0x786e, 0x786e, 0x786e, 0x786e, 0x786e,
-	0x786e, 0x786e, 0x786e, 0x787c, 0x786e, 0x786e, 0x1078, 0x1328,
-	0x6003, 0x0001, 0x6106, 0x1078, 0x5c45, 0x127e, 0x2091, 0x8000,
-	0x1078, 0x6109, 0x127f, 0x007c, 0x6003, 0x0001, 0x6106, 0x1078,
-	0x5c45, 0x127e, 0x2091, 0x8000, 0x1078, 0x6109, 0x127f, 0x007c,
-	0x2600, 0x0079, 0x788b, 0x788f, 0x788f, 0x788f, 0x787c, 0x1078,
-	0x1328, 0x6004, 0xa0b2, 0x0044, 0x10c8, 0x1328, 0xa1b6, 0x0013,
-	0x00c0, 0x78a1, 0xa0b2, 0x0040, 0x00c8, 0x79fb, 0x2008, 0x0079,
-	0x7941, 0xa1b6, 0x0027, 0x00c0, 0x78fe, 0x1078, 0x6010, 0x6004,
-	0x1078, 0x8c27, 0x0040, 0x78be, 0x1078, 0x8c3b, 0x0040, 0x78f6,
-	0xa08e, 0x0021, 0x0040, 0x78fa, 0xa08e, 0x0022, 0x0040, 0x78f6,
-	0xa08e, 0x003d, 0x0040, 0x78fa, 0x0078, 0x78f1, 0x1078, 0x2839,
-	0x2001, 0x0007, 0x1078, 0x443f, 0x6018, 0xa080, 0x0028, 0x200c,
-	0x1078, 0x7a05, 0xa186, 0x007e, 0x00c0, 0x78d3, 0x2001, 0xa332,
-	0x2014, 0xc285, 0x2202, 0x017e, 0x027e, 0x037e, 0x2110, 0x2019,
-	0x0028, 0x1078, 0x5d53, 0x077e, 0x2039, 0x0000, 0x1078, 0x5c78,
-	0x0c7e, 0x6018, 0xa065, 0x0040, 0x78e7, 0x1078, 0x471b, 0x0c7f,
-	0x2c08, 0x1078, 0x9c38, 0x077f, 0x037f, 0x027f, 0x017f, 0x1078,
-	0x44bc, 0x1078, 0x753d, 0x1078, 0x6109, 0x007c, 0x1078, 0x7a05,
-	0x0078, 0x78f1, 0x1078, 0x7a28, 0x0078, 0x78f1, 0xa186, 0x0014,
-	0x00c0, 0x78f5, 0x1078, 0x6010, 0x1078, 0x2813, 0x1078, 0x8c27,
-	0x00c0, 0x791d, 0x1078, 0x2839, 0x6018, 0xa080, 0x0028, 0x200c,
-	0x1078, 0x7a05, 0xa186, 0x007e, 0x00c0, 0x791b, 0x2001, 0xa332,
-	0x200c, 0xc185, 0x2102, 0x0078, 0x78f1, 0x1078, 0x8c3b, 0x00c0,
-	0x7925, 0x1078, 0x7a05, 0x0078, 0x78f1, 0x6004, 0xa08e, 0x0032,
-	0x00c0, 0x7936, 0x0e7e, 0x0f7e, 0x2071, 0xa381, 0x2079, 0x0000,
-	0x1078, 0x2b56, 0x0f7f, 0x0e7f, 0x0078, 0x78f1, 0x6004, 0xa08e,
-	0x0021, 0x0040, 0x7921, 0xa08e, 0x0022, 0x1040, 0x7a05, 0x0078,
-	0x78f1, 0x7983, 0x7985, 0x7989, 0x798d, 0x7991, 0x7995, 0x7981,
-	0x7981, 0x7981, 0x7981, 0x7981, 0x7981, 0x7981, 0x7981, 0x7981,
-	0x7981, 0x7981, 0x7981, 0x7981, 0x7981, 0x7981, 0x7981, 0x7981,
-	0x7981, 0x7981, 0x7981, 0x7981, 0x7981, 0x7981, 0x7981, 0x7999,
-	0x79ab, 0x7981, 0x79ad, 0x79ab, 0x7981, 0x7981, 0x7981, 0x7981,
-	0x7981, 0x79ab, 0x79ab, 0x7981, 0x7981, 0x7981, 0x7981, 0x7981,
-	0x7981, 0x7981, 0x7981, 0x79de, 0x79ab, 0x7981, 0x79a5, 0x7981,
-	0x7981, 0x7981, 0x79a7, 0x7981, 0x7981, 0x7981, 0x79ab, 0x7981,
-	0x7981, 0x1078, 0x1328, 0x0078, 0x79ab, 0x2001, 0x000b, 0x0078,
-	0x79b8, 0x2001, 0x0003, 0x0078, 0x79b8, 0x2001, 0x0005, 0x0078,
-	0x79b8, 0x2001, 0x0001, 0x0078, 0x79b8, 0x2001, 0x0009, 0x0078,
-	0x79b8, 0x1078, 0x6010, 0x6003, 0x0005, 0x2001, 0xa5a2, 0x2004,
-	0x603e, 0x1078, 0x6109, 0x0078, 0x79b7, 0x0078, 0x79ab, 0x0078,
-	0x79ab, 0x1078, 0x443f, 0x0078, 0x79f0, 0x1078, 0x6010, 0x6003,
-	0x0004, 0x2001, 0xa5a0, 0x2004, 0x6016, 0x1078, 0x6109, 0x007c,
-	0x1078, 0x443f, 0x1078, 0x6010, 0x2001, 0xa5a2, 0x2004, 0x603e,
-	0x6003, 0x0002, 0x037e, 0x2019, 0xa35c, 0x2304, 0xa084, 0xff00,
-	0x00c0, 0x79cf, 0x2019, 0xa5a0, 0x231c, 0x0078, 0x79d8, 0x8007,
-	0xa09a, 0x0004, 0x0048, 0x79ca, 0x8003, 0x801b, 0x831b, 0xa318,
-	0x6316, 0x037f, 0x1078, 0x6109, 0x0078, 0x79b7, 0x0e7e, 0x0f7e,
-	0x2071, 0xa381, 0x2079, 0x0000, 0x1078, 0x2b56, 0x0f7f, 0x0e7f,
-	0x1078, 0x6010, 0x1078, 0x753d, 0x1078, 0x6109, 0x0078, 0x79b7,
-	0x1078, 0x6010, 0x6003, 0x0002, 0x2001, 0xa5a0, 0x2004, 0x6016,
-	0x1078, 0x6109, 0x007c, 0x2600, 0x2008, 0x0079, 0x79ff, 0x7a03,
-	0x7a03, 0x7a03, 0x79f0, 0x1078, 0x1328, 0x0e7e, 0x1078, 0x8a44,
-	0x0040, 0x7a21, 0x6010, 0x2070, 0x7038, 0xd0fc, 0x0040, 0x7a21,
-	0x7007, 0x0000, 0x017e, 0x6004, 0xa08e, 0x0021, 0x0040, 0x7a23,
-	0xa08e, 0x003d, 0x0040, 0x7a23, 0x017f, 0x7037, 0x0103, 0x7033,
-	0x0100, 0x0e7f, 0x007c, 0x017f, 0x1078, 0x7a28, 0x0078, 0x7a21,
-	0x0e7e, 0xacf0, 0x0004, 0x2e74, 0x7000, 0x2070, 0x7037, 0x0103,
-	0x7023, 0x8001, 0x0e7f, 0x007c, 0x0d7e, 0x6618, 0x2668, 0x6804,
-	0xa084, 0x00ff, 0x0d7f, 0xa0b2, 0x000c, 0x10c8, 0x1328, 0x6604,
-	0xa6b6, 0x0043, 0x00c0, 0x7a48, 0x1078, 0x8e6d, 0x0078, 0x7aa7,
-	0x6604, 0xa6b6, 0x0033, 0x00c0, 0x7a51, 0x1078, 0x8e11, 0x0078,
-	0x7aa7, 0x6604, 0xa6b6, 0x0028, 0x00c0, 0x7a5a, 0x1078, 0x8c6a,
-	0x0078, 0x7aa7, 0x6604, 0xa6b6, 0x0029, 0x00c0, 0x7a63, 0x1078,
-	0x8c84, 0x0078, 0x7aa7, 0x6604, 0xa6b6, 0x001f, 0x00c0, 0x7a6c,
-	0x1078, 0x75ee, 0x0078, 0x7aa7, 0x6604, 0xa6b6, 0x0000, 0x00c0,
-	0x7a75, 0x1078, 0x780c, 0x0078, 0x7aa7, 0x6604, 0xa6b6, 0x0022,
-	0x00c0, 0x7a7e, 0x1078, 0x7617, 0x0078, 0x7aa7, 0x6604, 0xa6b6,
-	0x0035, 0x00c0, 0x7a87, 0x1078, 0x7653, 0x0078, 0x7aa7, 0x6604,
-	0xa6b6, 0x0039, 0x00c0, 0x7a90, 0x1078, 0x77b2, 0x0078, 0x7aa7,
-	0x6604, 0xa6b6, 0x003d, 0x00c0, 0x7a99, 0x1078, 0x7633, 0x0078,
-	0x7aa7, 0xa1b6, 0x0015, 0x00c0, 0x7aa1, 0x1079, 0x7aac, 0x0078,
-	0x7aa7, 0xa1b6, 0x0016, 0x00c0, 0x7aa8, 0x1079, 0x7bfd, 0x007c,
-	0x1078, 0x7583, 0x0078, 0x7aa7, 0x7ad0, 0x7ad3, 0x7ad0, 0x7b1e,
-	0x7ad0, 0x7b91, 0x7c09, 0x7ad0, 0x7ad0, 0x7bd5, 0x7ad0, 0x7beb,
-	0xa1b6, 0x0048, 0x0040, 0x7ac4, 0x20e1, 0x0005, 0x3d18, 0x3e20,
-	0x2c10, 0x1078, 0x15ec, 0x007c, 0x0e7e, 0xacf0, 0x0004, 0x2e74,
-	0x7000, 0x2070, 0x7037, 0x0103, 0x0e7f, 0x1078, 0x753d, 0x007c,
-	0x0005, 0x0005, 0x007c, 0x0e7e, 0x2071, 0xa300, 0x707c, 0xa086,
-	0x0074, 0x00c0, 0x7b07, 0x1078, 0x9c0c, 0x00c0, 0x7af9, 0x0d7e,
-	0x6018, 0x2068, 0x7030, 0xd08c, 0x0040, 0x7aec, 0x6800, 0xd0bc,
-	0x0040, 0x7aec, 0xc0c5, 0x6802, 0x1078, 0x7b0b, 0x0d7f, 0x2001,
-	0x0006, 0x1078, 0x443f, 0x1078, 0x2839, 0x1078, 0x753d, 0x0078,
-	0x7b09, 0x2001, 0x000a, 0x1078, 0x443f, 0x1078, 0x2839, 0x6003,
-	0x0001, 0x6007, 0x0001, 0x1078, 0x5c45, 0x0078, 0x7b09, 0x1078,
-	0x7b81, 0x0e7f, 0x007c, 0x6800, 0xd084, 0x0040, 0x7b1d, 0x2001,
-	0x0000, 0x1078, 0x442b, 0x2069, 0xa351, 0x6804, 0xd0a4, 0x0040,
-	0x7b1d, 0x2001, 0x0006, 0x1078, 0x4472, 0x007c, 0x0d7e, 0x2011,
-	0xa31f, 0x2204, 0xa086, 0x0074, 0x00c0, 0x7b7d, 0x6018, 0x2068,
-	0x6aa0, 0xa286, 0x007e, 0x00c0, 0x7b31, 0x1078, 0x7d17, 0x0078,
-	0x7b7f, 0x1078, 0x7d0d, 0x6018, 0x2068, 0xa080, 0x0028, 0x2014,
-	0xa286, 0x0080, 0x00c0, 0x7b55, 0x6813, 0x00ff, 0x6817, 0xfffc,
-	0x6010, 0xa005, 0x0040, 0x7b4b, 0x2068, 0x6807, 0x0000, 0x6837,
-	0x0103, 0x6833, 0x0200, 0x2001, 0x0006, 0x1078, 0x443f, 0x1078,
-	0x2839, 0x1078, 0x753d, 0x0078, 0x7b7f, 0x0e7e, 0x2071, 0xa332,
-	0x2e04, 0xd09c, 0x0040, 0x7b70, 0x2071, 0xa880, 0x7108, 0x720c,
-	0xa18c, 0x00ff, 0x00c0, 0x7b68, 0xa284, 0xff00, 0x0040, 0x7b70,
-	0x6018, 0x2070, 0x70a0, 0xd0bc, 0x00c0, 0x7b70, 0x7112, 0x7216,
-	0x0e7f, 0x2001, 0x0004, 0x1078, 0x443f, 0x6003, 0x0001, 0x6007,
-	0x0003, 0x1078, 0x5c45, 0x0078, 0x7b7f, 0x1078, 0x7b81, 0x0d7f,
-	0x007c, 0x2001, 0xa300, 0x2004, 0xa086, 0x0003, 0x0040, 0x7b8c,
-	0x2001, 0x0007, 0x1078, 0x443f, 0x1078, 0x2839, 0x1078, 0x753d,
-	0x007c, 0x0e7e, 0x2071, 0xa300, 0x707c, 0xa086, 0x0014, 0x00c0,
-	0x7bcf, 0x7000, 0xa086, 0x0003, 0x00c0, 0x7ba4, 0x6010, 0xa005,
-	0x00c0, 0x7ba4, 0x1078, 0x35f7, 0x0d7e, 0x6018, 0x2068, 0x1078,
-	0x457d, 0x1078, 0x7b0b, 0x0d7f, 0x1078, 0x7dba, 0x00c0, 0x7bcf,
-	0x0d7e, 0x6018, 0x2068, 0x6890, 0x0d7f, 0xa005, 0x0040, 0x7bcf,
-	0x2001, 0x0006, 0x1078, 0x443f, 0x0e7e, 0x6010, 0xa005, 0x0040,
-	0x7bc8, 0x2070, 0x7007, 0x0000, 0x7037, 0x0103, 0x7033, 0x0200,
-	0x0e7f, 0x1078, 0x2839, 0x1078, 0x753d, 0x0078, 0x7bd3, 0x1078,
-	0x7a05, 0x1078, 0x7b81, 0x0e7f, 0x007c, 0x2011, 0xa31f, 0x2204,
-	0xa086, 0x0014, 0x00c0, 0x7be8, 0x2001, 0x0002, 0x1078, 0x443f,
-	0x6003, 0x0001, 0x6007, 0x0001, 0x1078, 0x5c45, 0x0078, 0x7bea,
-	0x1078, 0x7b81, 0x007c, 0x2011, 0xa31f, 0x2204, 0xa086, 0x0004,
-	0x00c0, 0x7bfa, 0x2001, 0x0007, 0x1078, 0x443f, 0x1078, 0x753d,
-	0x0078, 0x7bfc, 0x1078, 0x7b81, 0x007c, 0x7ad0, 0x7c11, 0x7ad0,
-	0x7c4e, 0x7ad0, 0x7cc0, 0x7c09, 0x7ad0, 0x7ad0, 0x7cd5, 0x7ad0,
-	0x7ce8, 0x6604, 0xa6b6, 0x001e, 0x00c0, 0x7c10, 0x1078, 0x753d,
-	0x007c, 0x0d7e, 0x0c7e, 0x1078, 0x7cfb, 0x00c0, 0x7c27, 0x2001,
-	0x0000, 0x1078, 0x442b, 0x2001, 0x0002, 0x1078, 0x443f, 0x6003,
-	0x0001, 0x6007, 0x0002, 0x1078, 0x5c45, 0x0078, 0x7c4b, 0x2009,
-	0xa88e, 0x2104, 0xa086, 0x0009, 0x00c0, 0x7c3c, 0x6018, 0x2068,
-	0x6840, 0xa084, 0x00ff, 0xa005, 0x0040, 0x7c49, 0x8001, 0x6842,
-	0x6017, 0x000a, 0x0078, 0x7c4b, 0x2009, 0xa88f, 0x2104, 0xa084,
-	0xff00, 0xa086, 0x1900, 0x00c0, 0x7c49, 0x1078, 0x753d, 0x0078,
-	0x7c4b, 0x1078, 0x7b81, 0x0c7f, 0x0d7f, 0x007c, 0x1078, 0x7d0a,
-	0x00c0, 0x7c62, 0x2001, 0x0000, 0x1078, 0x442b, 0x2001, 0x0002,
-	0x1078, 0x443f, 0x6003, 0x0001, 0x6007, 0x0002, 0x1078, 0x5c45,
-	0x0078, 0x7c8e, 0x1078, 0x7a05, 0x2009, 0xa88e, 0x2134, 0xa6b4,
-	0x00ff, 0xa686, 0x0005, 0x0040, 0x7c8f, 0xa686, 0x000b, 0x0040,
-	0x7c8c, 0x2009, 0xa88f, 0x2104, 0xa084, 0xff00, 0x00c0, 0x7c7c,
-	0xa686, 0x0009, 0x0040, 0x7c8f, 0xa086, 0x1900, 0x00c0, 0x7c8c,
-	0xa686, 0x0009, 0x0040, 0x7c8f, 0x2001, 0x0004, 0x1078, 0x443f,
-	0x1078, 0x753d, 0x0078, 0x7c8e, 0x1078, 0x7b81, 0x007c, 0x0d7e,
-	0x6010, 0x2068, 0x1078, 0x8a44, 0x0040, 0x7c9d, 0x6838, 0xd0fc,
-	0x0040, 0x7c9d, 0x0d7f, 0x0078, 0x7c8c, 0x6018, 0x2068, 0x6840,
-	0xa084, 0x00ff, 0xa005, 0x0040, 0x7cae, 0x8001, 0x6842, 0x6017,
-	0x000a, 0x6007, 0x0016, 0x0d7f, 0x0078, 0x7c8e, 0x68a0, 0xa086,
-	0x007e, 0x00c0, 0x7cbb, 0x0e7e, 0x2071, 0xa300, 0x1078, 0x41f5,
-	0x0e7f, 0x0078, 0x7cbd, 0x1078, 0x2813, 0x0d7f, 0x0078, 0x7c8c,
-	0x1078, 0x7d0a, 0x00c0, 0x7cd0, 0x2001, 0x0004, 0x1078, 0x443f,
-	0x6003, 0x0001, 0x6007, 0x0003, 0x1078, 0x5c45, 0x0078, 0x7cd4,
-	0x1078, 0x7a05, 0x1078, 0x7b81, 0x007c, 0x1078, 0x7d0a, 0x00c0,
-	0x7ce5, 0x2001, 0x0008, 0x1078, 0x443f, 0x6003, 0x0001, 0x6007,
-	0x0005, 0x1078, 0x5c45, 0x0078, 0x7ce7, 0x1078, 0x7b81, 0x007c,
-	0x1078, 0x7d0a, 0x00c0, 0x7cf8, 0x2001, 0x000a, 0x1078, 0x443f,
-	0x6003, 0x0001, 0x6007, 0x0001, 0x1078, 0x5c45, 0x0078, 0x7cfa,
-	0x1078, 0x7b81, 0x007c, 0x2009, 0xa88e, 0x2104, 0xa086, 0x0003,
-	0x00c0, 0x7d09, 0x2009, 0xa88f, 0x2104, 0xa084, 0xff00, 0xa086,
-	0x2a00, 0x007c, 0xa085, 0x0001, 0x007c, 0x0c7e, 0x017e, 0xac88,
-	0x0006, 0x2164, 0x1078, 0x4513, 0x017f, 0x0c7f, 0x007c, 0x0f7e,
-	0x0e7e, 0x0d7e, 0x037e, 0x017e, 0x6018, 0x2068, 0x2071, 0xa332,
-	0x2e04, 0xa085, 0x0003, 0x2072, 0x1078, 0x7d8b, 0x0040, 0x7d50,
-	0x2001, 0xa352, 0x2004, 0xd0a4, 0x0040, 0x7d39, 0xa006, 0x2020,
-	0x2009, 0x002a, 0x1078, 0x9ec0, 0x2001, 0xa30c, 0x200c, 0xc195,
-	0x2102, 0x2019, 0x002a, 0x2009, 0x0001, 0x1078, 0x27e2, 0x2071,
-	0xa300, 0x1078, 0x260d, 0x0c7e, 0x157e, 0x20a9, 0x0081, 0x2009,
-	0x007f, 0x1078, 0x2921, 0x8108, 0x00f0, 0x7d49, 0x157f, 0x0c7f,
-	0x1078, 0x7d0d, 0x6813, 0x00ff, 0x6817, 0xfffe, 0x2071, 0xa880,
-	0x2079, 0x0100, 0x2e04, 0xa084, 0x00ff, 0x2069, 0xa31a, 0x206a,
-	0x78e6, 0x007e, 0x8e70, 0x2e04, 0x2069, 0xa31b, 0x206a, 0x78ea,
-	0xa084, 0xff00, 0x017f, 0xa105, 0x2009, 0xa325, 0x200a, 0x2069,
-	0xa88e, 0x2071, 0xa59c, 0x6810, 0x2072, 0x6814, 0x7006, 0x6818,
-	0x700a, 0x681c, 0x700e, 0x1078, 0x8da9, 0x2001, 0x0006, 0x1078,
-	0x443f, 0x1078, 0x2839, 0x1078, 0x753d, 0x017f, 0x037f, 0x0d7f,
-	0x0e7f, 0x0f7f, 0x007c, 0x027e, 0x037e, 0x0e7e, 0x157e, 0x2019,
-	0xa325, 0x231c, 0x83ff, 0x0040, 0x7db5, 0x2071, 0xa880, 0x2e14,
-	0xa294, 0x00ff, 0x7004, 0xa084, 0xff00, 0xa205, 0xa306, 0x00c0,
-	0x7db5, 0x2011, 0xa896, 0xad98, 0x000a, 0x20a9, 0x0004, 0x1078,
-	0x7e55, 0x00c0, 0x7db5, 0x2011, 0xa89a, 0xad98, 0x0006, 0x20a9,
-	0x0004, 0x1078, 0x7e55, 0x00c0, 0x7db5, 0x157f, 0x0e7f, 0x037f,
-	0x027f, 0x007c, 0x0e7e, 0x2071, 0xa88c, 0x7004, 0xa086, 0x0014,
-	0x00c0, 0x7ddd, 0x7008, 0xa086, 0x0800, 0x00c0, 0x7ddd, 0x700c,
-	0xd0ec, 0x0040, 0x7ddb, 0xa084, 0x0f00, 0xa086, 0x0100, 0x00c0,
-	0x7ddb, 0x7024, 0xd0a4, 0x00c0, 0x7dd8, 0xd0ac, 0x0040, 0x7ddb,
-	0xa006, 0x0078, 0x7ddd, 0xa085, 0x0001, 0x0e7f, 0x007c, 0x0e7e,
-	0x0d7e, 0x0c7e, 0x077e, 0x057e, 0x047e, 0x027e, 0x007e, 0x127e,
-	0x2091, 0x8000, 0x2029, 0xa5b4, 0x252c, 0x2021, 0xa5ba, 0x2424,
-	0x2061, 0xaa00, 0x2071, 0xa300, 0x7244, 0x7060, 0xa202, 0x00c8,
-	0x7e43, 0x1078, 0x9ee5, 0x0040, 0x7e3b, 0x671c, 0xa786, 0x0001,
-	0x0040, 0x7e3b, 0xa786, 0x0007, 0x0040, 0x7e3b, 0x2500, 0xac06,
-	0x0040, 0x7e3b, 0x2400, 0xac06, 0x0040, 0x7e3b, 0x0c7e, 0x6000,
-	0xa086, 0x0004, 0x00c0, 0x7e16, 0x1078, 0x1749, 0xa786, 0x0008,
-	0x00c0, 0x7e25, 0x1078, 0x8c3b, 0x00c0, 0x7e25, 0x0c7f, 0x1078,
-	0x7a05, 0x1078, 0x8c01, 0x0078, 0x7e3b, 0x6010, 0x2068, 0x1078,
-	0x8a44, 0x0040, 0x7e38, 0xa786, 0x0003, 0x00c0, 0x7e4d, 0x6837,
-	0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x4982, 0x1078, 0x8bf4,
-	0x1078, 0x8c01, 0x0c7f, 0xace0, 0x0010, 0x7054, 0xac02, 0x00c8,
-	0x7e43, 0x0078, 0x7df4, 0x127f, 0x007f, 0x027f, 0x047f, 0x057f,
-	0x077f, 0x0c7f, 0x0d7f, 0x0e7f, 0x007c, 0xa786, 0x0006, 0x00c0,
-	0x7e2f, 0x1078, 0x9e70, 0x0078, 0x7e38, 0x220c, 0x2304, 0xa106,
-	0x00c0, 0x7e60, 0x8210, 0x8318, 0x00f0, 0x7e55, 0xa006, 0x007c,
-	0x2304, 0xa102, 0x0048, 0x7e68, 0x2001, 0x0001, 0x0078, 0x7e6a,
-	0x2001, 0x0000, 0xa18d, 0x0001, 0x007c, 0x6004, 0xa08a, 0x0044,
-	0x10c8, 0x1328, 0x1078, 0x8c27, 0x0040, 0x7e7c, 0x1078, 0x8c3b,
-	0x0040, 0x7e89, 0x0078, 0x7e82, 0x1078, 0x2839, 0x1078, 0x8c3b,
-	0x0040, 0x7e89, 0x1078, 0x6010, 0x1078, 0x753d, 0x1078, 0x6109,
-	0x007c, 0x1078, 0x7a05, 0x0078, 0x7e82, 0xa182, 0x0040, 0x0079,
-	0x7e91, 0x7ea4, 0x7ea4, 0x7ea4, 0x7ea4, 0x7ea4, 0x7ea4, 0x7ea4,
-	0x7ea4, 0x7ea4, 0x7ea4, 0x7ea4, 0x7ea6, 0x7ea6, 0x7ea6, 0x7ea6,
-	0x7ea4, 0x7ea4, 0x7ea4, 0x7ea6, 0x1078, 0x1328, 0x600b, 0xffff,
-	0x6003, 0x0001, 0x6106, 0x1078, 0x5bf8, 0x127e, 0x2091, 0x8000,
-	0x1078, 0x6109, 0x127f, 0x007c, 0xa186, 0x0013, 0x00c0, 0x7ebd,
-	0x6004, 0xa082, 0x0040, 0x0079, 0x7f48, 0xa186, 0x0027, 0x00c0,
-	0x7edf, 0x1078, 0x6010, 0x1078, 0x2813, 0x0d7e, 0x6110, 0x2168,
-	0x1078, 0x8a44, 0x0040, 0x7ed9, 0x6837, 0x0103, 0x684b, 0x0029,
-	0x6847, 0x0000, 0x694c, 0xc1c5, 0x694e, 0x1078, 0x4982, 0x1078,
-	0x8bf4, 0x0d7f, 0x1078, 0x753d, 0x1078, 0x6109, 0x007c, 0xa186,
-	0x0014, 0x00c0, 0x7ee8, 0x6004, 0xa082, 0x0040, 0x0079, 0x7f10,
-	0xa186, 0x0046, 0x0040, 0x7ef4, 0xa186, 0x0045, 0x0040, 0x7ef4,
-	0xa186, 0x0047, 0x10c0, 0x1328, 0x2001, 0x0109, 0x2004, 0xd084,
-	0x0040, 0x7f0d, 0x127e, 0x2091, 0x2200, 0x007e, 0x017e, 0x027e,
-	0x1078, 0x5ad2, 0x027f, 0x017f, 0x007f, 0x127f, 0x6000, 0xa086,
-	0x0002, 0x00c0, 0x7f0d, 0x0078, 0x7f81, 0x1078, 0x7583, 0x007c,
-	0x7f25, 0x7f23, 0x7f23, 0x7f23, 0x7f23, 0x7f23, 0x7f23, 0x7f23,
-	0x7f23, 0x7f23, 0x7f23, 0x7f41, 0x7f41, 0x7f41, 0x7f41, 0x7f23,
-	0x7f41, 0x7f23, 0x7f41, 0x1078, 0x1328, 0x1078, 0x6010, 0x0d7e,
-	0x6110, 0x2168, 0x1078, 0x8a44, 0x0040, 0x7f3b, 0x6837, 0x0103,
-	0x684b, 0x0006, 0x6847, 0x0000, 0x6850, 0xc0ec, 0x6852, 0x1078,
-	0x4982, 0x1078, 0x8bf4, 0x0d7f, 0x1078, 0x753d, 0x1078, 0x6109,
-	0x007c, 0x1078, 0x6010, 0x1078, 0x753d, 0x1078, 0x6109, 0x007c,
-	0x7f5d, 0x7f5b, 0x7f5b, 0x7f5b, 0x7f5b, 0x7f5b, 0x7f5b, 0x7f5b,
-	0x7f5b, 0x7f5b, 0x7f5b, 0x7f6f, 0x7f6f, 0x7f6f, 0x7f6f, 0x7f5b,
-	0x7f7a, 0x7f5b, 0x7f6f, 0x1078, 0x1328, 0x1078, 0x6010, 0x2001,
-	0xa5a2, 0x2004, 0x603e, 0x6003, 0x0002, 0x1078, 0x6109, 0x6010,
-	0xa088, 0x0013, 0x2104, 0xa085, 0x0400, 0x200a, 0x007c, 0x1078,
-	0x6010, 0x2001, 0xa5a2, 0x2004, 0x603e, 0x6003, 0x000f, 0x1078,
-	0x6109, 0x007c, 0x1078, 0x6010, 0x1078, 0x753d, 0x1078, 0x6109,
-	0x007c, 0xa182, 0x0040, 0x0079, 0x7f85, 0x7f98, 0x7f98, 0x7f98,
-	0x7f98, 0x7f98, 0x7f9a, 0x8095, 0x80b7, 0x7f98, 0x7f98, 0x7f98,
-	0x7f98, 0x7f98, 0x7f98, 0x7f98, 0x7f98, 0x7f98, 0x7f98, 0x7f98,
-	0x1078, 0x1328, 0x0e7e, 0x0d7e, 0x603f, 0x0000, 0x2071, 0xa880,
-	0x7124, 0x610a, 0x2071, 0xa88c, 0x6110, 0x2168, 0x7614, 0xa6b4,
-	0x0fff, 0x86ff, 0x0040, 0x8058, 0xa68c, 0x0c00, 0x0040, 0x7fd1,
-	0x0f7e, 0x2c78, 0x1078, 0x4893, 0x0f7f, 0x0040, 0x7fcd, 0x684c,
-	0xd0ac, 0x0040, 0x7fcd, 0x6024, 0xd0dc, 0x00c0, 0x7fcd, 0x6850,
-	0xd0bc, 0x00c0, 0x7fcd, 0x7318, 0x6814, 0xa306, 0x00c0, 0x806f,
-	0x731c, 0x6810, 0xa306, 0x00c0, 0x806f, 0x7318, 0x6b62, 0x731c,
-	0x6b5e, 0xa68c, 0x00ff, 0xa186, 0x0002, 0x0040, 0x8004, 0xa186,
-	0x0028, 0x00c0, 0x7fe1, 0x1078, 0x8c15, 0x684b, 0x001c, 0x0078,
-	0x8006, 0xd6dc, 0x0040, 0x7ffd, 0x684b, 0x0015, 0x684c, 0xd0ac,
-	0x0040, 0x7ffb, 0x6914, 0x6a10, 0x2100, 0xa205, 0x0040, 0x7ffb,
-	0x7018, 0xa106, 0x00c0, 0x7ff8, 0x701c, 0xa206, 0x0040, 0x7ffb,
-	0x6962, 0x6a5e, 0xc6dc, 0x0078, 0x8006, 0xd6d4, 0x0040, 0x8004,
-	0x684b, 0x0007, 0x0078, 0x8006, 0x684b, 0x0000, 0x6837, 0x0103,
-	0x6e46, 0xa01e, 0xd6c4, 0x0040, 0x802f, 0xa686, 0x0100, 0x00c0,
-	0x801a, 0x2001, 0xa899, 0x2004, 0xa005, 0x00c0, 0x801a, 0xc6c4,
-	0x0078, 0x7fa9, 0x7328, 0x732c, 0x6b56, 0x83ff, 0x0040, 0x802f,
-	0xa38a, 0x0009, 0x0048, 0x8026, 0x2019, 0x0008, 0x037e, 0x2308,
-	0x2019, 0xa898, 0xad90, 0x0019, 0x1078, 0x8739, 0x037f, 0xd6cc,
-	0x0040, 0x8085, 0x7124, 0x695a, 0x81ff, 0x0040, 0x8085, 0xa192,
-	0x0021, 0x00c8, 0x8046, 0x2071, 0xa898, 0x831c, 0x2300, 0xae18,
-	0xad90, 0x001d, 0x1078, 0x8739, 0x0078, 0x8085, 0x6838, 0xd0fc,
-	0x0040, 0x804f, 0x2009, 0x0020, 0x695a, 0x0078, 0x803b, 0x0f7e,
-	0x2d78, 0x1078, 0x86d1, 0x0f7f, 0x1078, 0x8726, 0x0078, 0x8087,
-	0x0f7e, 0x2c78, 0x1078, 0x4893, 0x0f7f, 0x0040, 0x8075, 0x684c,
-	0xd0ac, 0x0040, 0x8075, 0x6024, 0xd0dc, 0x00c0, 0x8075, 0x6850,
-	0xd0bc, 0x00c0, 0x8075, 0x684c, 0xd0f4, 0x00c0, 0x8075, 0x1078,
-	0x8cfa, 0x0d7f, 0x0e7f, 0x0078, 0x8094, 0x684b, 0x0000, 0x6837,
-	0x0103, 0x6e46, 0x684c, 0xd0ac, 0x0040, 0x8085, 0x6810, 0x6914,
-	0xa115, 0x0040, 0x8085, 0x1078, 0x8233, 0x1078, 0x4982, 0x6218,
-	0x2268, 0x6a3c, 0x8211, 0x6a3e, 0x1078, 0x8cc4, 0x0d7f, 0x0e7f,
-	0x00c0, 0x8094, 0x1078, 0x753d, 0x007c, 0x0f7e, 0x6003, 0x0003,
-	0x2079, 0xa88c, 0x7c04, 0x7b00, 0x7e0c, 0x7d08, 0x6010, 0x2078,
-	0x784c, 0xd0ac, 0x0040, 0x80a8, 0x6003, 0x0002, 0x0f7f, 0x007c,
-	0x7c12, 0x7b16, 0x7e0a, 0x7d0e, 0x0f7f, 0x603f, 0x0000, 0x2c10,
-	0x1078, 0x1cab, 0x1078, 0x5c64, 0x1078, 0x61d3, 0x007c, 0x2001,
-	0xa5a2, 0x2004, 0x603e, 0x6003, 0x0004, 0x6110, 0x20e1, 0x0005,
-	0x3d18, 0x3e20, 0x2c10, 0x1078, 0x15ec, 0x007c, 0xa182, 0x0040,
-	0x0079, 0x80ca, 0x80dd, 0x80dd, 0x80dd, 0x80dd, 0x80dd, 0x80df,
-	0x8182, 0x80dd, 0x80dd, 0x8198, 0x8209, 0x80dd, 0x80dd, 0x80dd,
-	0x80dd, 0x8218, 0x80dd, 0x80dd, 0x80dd, 0x1078, 0x1328, 0x077e,
-	0x0f7e, 0x0e7e, 0x0d7e, 0x2071, 0xa88c, 0x6110, 0x2178, 0x7614,
-	0xa6b4, 0x0fff, 0x7e46, 0x7f4c, 0xc7e5, 0x7f4e, 0x6218, 0x2268,
-	0x6a3c, 0x8211, 0x6a3e, 0x86ff, 0x0040, 0x817d, 0xa694, 0xff00,
-	0xa284, 0x0c00, 0x0040, 0x8100, 0x7018, 0x7862, 0x701c, 0x785e,
-	0xa284, 0x0300, 0x0040, 0x817d, 0x1078, 0x1381, 0x1040, 0x1328,
-	0x2d00, 0x784a, 0x7f4c, 0xc7cd, 0x7f4e, 0x6837, 0x0103, 0x7838,
-	0x683a, 0x783c, 0x683e, 0x7840, 0x6842, 0x6e46, 0xa68c, 0x0c00,
-	0x0040, 0x811e, 0x7318, 0x6b62, 0x731c, 0x6b5e, 0xa68c, 0x00ff,
-	0xa186, 0x0002, 0x0040, 0x813a, 0xa186, 0x0028, 0x00c0, 0x812c,
-	0x684b, 0x001c, 0x0078, 0x813c, 0xd6dc, 0x0040, 0x8133, 0x684b,
-	0x0015, 0x0078, 0x813c, 0xd6d4, 0x0040, 0x813a, 0x684b, 0x0007,
-	0x0078, 0x813c, 0x684b, 0x0000, 0x6f4e, 0x7850, 0x6852, 0x7854,
-	0x6856, 0xa01e, 0xd6c4, 0x0040, 0x815a, 0x7328, 0x732c, 0x6b56,
-	0x83ff, 0x0040, 0x815a, 0xa38a, 0x0009, 0x0048, 0x8151, 0x2019,
-	0x0008, 0x037e, 0x2308, 0x2019, 0xa898, 0xad90, 0x0019, 0x1078,
-	0x8739, 0x037f, 0xd6cc, 0x0040, 0x817d, 0x7124, 0x695a, 0x81ff,
-	0x0040, 0x817d, 0xa192, 0x0021, 0x00c8, 0x8171, 0x2071, 0xa898,
-	0x831c, 0x2300, 0xae18, 0xad90, 0x001d, 0x1078, 0x8739, 0x0078,
-	0x817d, 0x7838, 0xd0fc, 0x0040, 0x817a, 0x2009, 0x0020, 0x695a,
-	0x0078, 0x8166, 0x2d78, 0x1078, 0x86d1, 0x0d7f, 0x0e7f, 0x0f7f,
-	0x077f, 0x007c, 0x0f7e, 0x6003, 0x0003, 0x2079, 0xa88c, 0x7c04,
-	0x7b00, 0x7e0c, 0x7d08, 0x6010, 0x2078, 0x7c12, 0x7b16, 0x7e0a,
-	0x7d0e, 0x0f7f, 0x2c10, 0x1078, 0x1cab, 0x1078, 0x6c26, 0x007c,
-	0x0d7e, 0x0f7e, 0x2c78, 0x1078, 0x4893, 0x0f7f, 0x0040, 0x81a4,
-	0x2001, 0xa5a2, 0x2004, 0x603e, 0x6003, 0x0002, 0x1078, 0x60b8,
-	0x1078, 0x61d3, 0x6110, 0x2168, 0x694c, 0xd1e4, 0x0040, 0x8207,
-	0xd1cc, 0x0040, 0x81de, 0x6948, 0x6838, 0xd0fc, 0x0040, 0x81d6,
-	0x017e, 0x684c, 0x007e, 0x6850, 0x007e, 0xad90, 0x000d, 0xa198,
-	0x000d, 0x2009, 0x0020, 0x157e, 0x21a8, 0x2304, 0x2012, 0x8318,
-	0x8210, 0x00f0, 0x81c5, 0x157f, 0x007f, 0x6852, 0x007f, 0x684e,
-	0x017f, 0x2168, 0x1078, 0x13aa, 0x0078, 0x8201, 0x017e, 0x1078,
-	0x13aa, 0x0d7f, 0x1078, 0x8726, 0x0078, 0x8201, 0x6837, 0x0103,
-	0x6944, 0xa184, 0x00ff, 0xa0b6, 0x0002, 0x0040, 0x81fd, 0xa086,
-	0x0028, 0x00c0, 0x81ef, 0x684b, 0x001c, 0x0078, 0x81ff, 0xd1dc,
-	0x0040, 0x81f6, 0x684b, 0x0015, 0x0078, 0x81ff, 0xd1d4, 0x0040,
-	0x81fd, 0x684b, 0x0007, 0x0078, 0x81ff, 0x684b, 0x0000, 0x1078,
-	0x4982, 0x1078, 0x8cc4, 0x00c0, 0x8207, 0x1078, 0x753d, 0x0d7f,
-	0x007c, 0x2019, 0x0001, 0x1078, 0x6e6c, 0x6003, 0x0002, 0x2001,
-	0xa5a2, 0x2004, 0x603e, 0x1078, 0x60b8, 0x1078, 0x61d3, 0x007c,
-	0x1078, 0x60b8, 0x1078, 0x2813, 0x0d7e, 0x6110, 0x2168, 0x1078,
-	0x8a44, 0x0040, 0x822d, 0x6837, 0x0103, 0x684b, 0x0029, 0x6847,
-	0x0000, 0x1078, 0x4982, 0x1078, 0x8bf4, 0x0d7f, 0x1078, 0x753d,
-	0x1078, 0x61d3, 0x007c, 0x684b, 0x0015, 0xd1fc, 0x0040, 0x823f,
-	0x684b, 0x0007, 0x8002, 0x8000, 0x810a, 0xa189, 0x0000, 0x6962,
-	0x685e, 0x007c, 0xa182, 0x0040, 0x0079, 0x8246, 0x8259, 0x8259,
-	0x8259, 0x8259, 0x8259, 0x825b, 0x8259, 0x8333, 0x833f, 0x8259,
-	0x8259, 0x8259, 0x8259, 0x8259, 0x8259, 0x8259, 0x8259, 0x8259,
-	0x8259, 0x1078, 0x1328, 0x077e, 0x0f7e, 0x0e7e, 0x0d7e, 0x2071,
-	0xa88c, 0x6110, 0x2178, 0x7614, 0xa6b4, 0x0fff, 0x0f7e, 0x2c78,
-	0x1078, 0x4893, 0x0f7f, 0x0040, 0x827e, 0xa684, 0x00ff, 0x00c0,
-	0x827e, 0x6024, 0xd0f4, 0x00c0, 0x827a, 0x7808, 0xa086, 0x0000,
-	0x00c0, 0x827e, 0x1078, 0x8cfa, 0x0078, 0x832e, 0x7e46, 0x7f4c,
-	0xc7e5, 0x7f4e, 0x6218, 0x2268, 0x6a3c, 0x8211, 0x6a3e, 0x86ff,
-	0x0040, 0x8323, 0xa694, 0xff00, 0xa284, 0x0c00, 0x0040, 0x8294,
-	0x7018, 0x7862, 0x701c, 0x785e, 0xa284, 0x0300, 0x0040, 0x8320,
-	0xa686, 0x0100, 0x00c0, 0x82a6, 0x2001, 0xa899, 0x2004, 0xa005,
-	0x00c0, 0x82a6, 0xc6c4, 0x7e46, 0x0078, 0x8287, 0x1078, 0x1381,
-	0x1040, 0x1328, 0x2d00, 0x784a, 0x7f4c, 0xa7bd, 0x0200, 0x7f4e,
-	0x6837, 0x0103, 0x7838, 0x683a, 0x783c, 0x683e, 0x7840, 0x6842,
-	0x6e46, 0xa68c, 0x0c00, 0x0040, 0x82c1, 0x7318, 0x6b62, 0x731c,
-	0x6b5e, 0xa68c, 0x00ff, 0xa186, 0x0002, 0x0040, 0x82dd, 0xa186,
-	0x0028, 0x00c0, 0x82cf, 0x684b, 0x001c, 0x0078, 0x82df, 0xd6dc,
-	0x0040, 0x82d6, 0x684b, 0x0015, 0x0078, 0x82df, 0xd6d4, 0x0040,
-	0x82dd, 0x684b, 0x0007, 0x0078, 0x82df, 0x684b, 0x0000, 0x6f4e,
-	0x7850, 0x6852, 0x7854, 0x6856, 0xa01e, 0xd6c4, 0x0040, 0x82fd,
-	0x7328, 0x732c, 0x6b56, 0x83ff, 0x0040, 0x82fd, 0xa38a, 0x0009,
-	0x0048, 0x82f4, 0x2019, 0x0008, 0x037e, 0x2308, 0x2019, 0xa898,
-	0xad90, 0x0019, 0x1078, 0x8739, 0x037f, 0xd6cc, 0x0040, 0x8320,
-	0x7124, 0x695a, 0x81ff, 0x0040, 0x8320, 0xa192, 0x0021, 0x00c8,
-	0x8314, 0x2071, 0xa898, 0x831c, 0x2300, 0xae18, 0xad90, 0x001d,
-	0x1078, 0x8739, 0x0078, 0x8320, 0x7838, 0xd0fc, 0x0040, 0x831d,
-	0x2009, 0x0020, 0x695a, 0x0078, 0x8309, 0x2d78, 0x1078, 0x86d1,
-	0xd6dc, 0x00c0, 0x8326, 0xa006, 0x0078, 0x832c, 0x2001, 0x0001,
-	0x2071, 0xa88c, 0x7218, 0x731c, 0x1078, 0x1645, 0x0d7f, 0x0e7f,
-	0x0f7f, 0x077f, 0x007c, 0x2001, 0xa5a2, 0x2004, 0x603e, 0x20e1,
-	0x0005, 0x3d18, 0x3e20, 0x2c10, 0x1078, 0x15ec, 0x007c, 0x2001,
-	0xa5a2, 0x2004, 0x603e, 0x0d7e, 0x6003, 0x0002, 0x6110, 0x2168,
-	0x694c, 0xd1e4, 0x0040, 0x846b, 0x603f, 0x0000, 0x0f7e, 0x2c78,
-	0x1078, 0x4893, 0x0f7f, 0x0040, 0x8385, 0x6814, 0x6910, 0xa115,
-	0x0040, 0x8385, 0x6a60, 0xa206, 0x00c0, 0x8362, 0x685c, 0xa106,
-	0x0040, 0x8385, 0x684c, 0xc0e4, 0x684e, 0x6847, 0x0000, 0x6863,
-	0x0000, 0x685f, 0x0000, 0x6024, 0xd0f4, 0x00c0, 0x837a, 0x697c,
-	0x6810, 0xa102, 0x603a, 0x6980, 0x6814, 0xa103, 0x6036, 0x6024,
-	0xc0f5, 0x6026, 0x0d7e, 0x6018, 0x2068, 0x683c, 0x8000, 0x683e,
-	0x0d7f, 0x1078, 0x8cfa, 0x0078, 0x846b, 0x694c, 0xd1cc, 0x0040,
-	0x8430, 0x6948, 0x6838, 0xd0fc, 0x0040, 0x83ea, 0x017e, 0x684c,
-	0x007e, 0x6850, 0x007e, 0x0f7e, 0x2178, 0x7944, 0xa184, 0x00ff,
-	0xa0b6, 0x0002, 0x0040, 0x83bf, 0xa086, 0x0028, 0x00c0, 0x83a6,
-	0x684b, 0x001c, 0x784b, 0x001c, 0x0078, 0x83ca, 0xd1dc, 0x0040,
-	0x83b6, 0x684b, 0x0015, 0x784b, 0x0015, 0x1078, 0x8ea5, 0x0040,
-	0x83b4, 0x7944, 0xc1dc, 0x7946, 0x0078, 0x83ca, 0xd1d4, 0x0040,
-	0x83bf, 0x684b, 0x0007, 0x784b, 0x0007, 0x0078, 0x83ca, 0x684c,
-	0xd0ac, 0x0040, 0x83ca, 0x6810, 0x6914, 0xa115, 0x0040, 0x83ca,
-	0x1078, 0x8233, 0x6848, 0x784a, 0x6860, 0x7862, 0x685c, 0x785e,
-	0xad90, 0x000d, 0xaf98, 0x000d, 0x2009, 0x0020, 0x157e, 0x21a8,
-	0x2304, 0x2012, 0x8318, 0x8210, 0x00f0, 0x83d8, 0x157f, 0x0f7f,
-	0x007f, 0x6852, 0x007f, 0x684e, 0x017f, 0x2168, 0x1078, 0x13aa,
-	0x0078, 0x8465, 0x017e, 0x0f7e, 0x2178, 0x7944, 0xa184, 0x00ff,
-	0xa0b6, 0x0002, 0x0040, 0x8417, 0xa086, 0x0028, 0x00c0, 0x83fe,
-	0x684b, 0x001c, 0x784b, 0x001c, 0x0078, 0x8422, 0xd1dc, 0x0040,
-	0x840e, 0x684b, 0x0015, 0x784b, 0x0015, 0x1078, 0x8ea5, 0x0040,
-	0x840c, 0x7944, 0xc1dc, 0x7946, 0x0078, 0x8422, 0xd1d4, 0x0040,
-	0x8417, 0x684b, 0x0007, 0x784b, 0x0007, 0x0078, 0x8422, 0x684c,
-	0xd0ac, 0x0040, 0x8422, 0x6810, 0x6914, 0xa115, 0x0040, 0x8422,
-	0x1078, 0x8233, 0x6860, 0x7862, 0x685c, 0x785e, 0x684c, 0x784e,
-	0x0f7f, 0x1078, 0x13aa, 0x0d7f, 0x1078, 0x8726, 0x0078, 0x8465,
-	0x6837, 0x0103, 0x6944, 0xa184, 0x00ff, 0xa0b6, 0x0002, 0x0040,
-	0x8456, 0xa086, 0x0028, 0x00c0, 0x8441, 0x684b, 0x001c, 0x0078,
-	0x8463, 0xd1dc, 0x0040, 0x844f, 0x684b, 0x0015, 0x1078, 0x8ea5,
-	0x0040, 0x844d, 0x6944, 0xc1dc, 0x6946, 0x0078, 0x8463, 0xd1d4,
-	0x0040, 0x8456, 0x684b, 0x0007, 0x0078, 0x8463, 0x684b, 0x0000,
-	0x684c, 0xd0ac, 0x0040, 0x8463, 0x6810, 0x6914, 0xa115, 0x0040,
-	0x8463, 0x1078, 0x8233, 0x1078, 0x4982, 0x1078, 0x8cc4, 0x00c0,
-	0x846b, 0x1078, 0x753d, 0x0d7f, 0x007c, 0x1078, 0x6010, 0x0078,
-	0x8473, 0x1078, 0x60b8, 0x1078, 0x8a44, 0x0040, 0x8492, 0x0d7e,
-	0x6110, 0x2168, 0x6837, 0x0103, 0x2009, 0xa30c, 0x210c, 0xd18c,
-	0x00c0, 0x849d, 0xd184, 0x00c0, 0x8499, 0x6108, 0x694a, 0xa18e,
-	0x0029, 0x00c0, 0x848d, 0x1078, 0xa181, 0x6847, 0x0000, 0x1078,
-	0x4982, 0x0d7f, 0x1078, 0x753d, 0x1078, 0x6109, 0x1078, 0x61d3,
-	0x007c, 0x684b, 0x0004, 0x0078, 0x848d, 0x684b, 0x0004, 0x0078,
-	0x848d, 0xa182, 0x0040, 0x0079, 0x84a5, 0x84b8, 0x84b8, 0x84b8,
-	0x84b8, 0x84b8, 0x84ba, 0x84b8, 0x84bd, 0x84b8, 0x84b8, 0x84b8,
-	0x84b8, 0x84b8, 0x84b8, 0x84b8, 0x84b8, 0x84b8, 0x84b8, 0x84b8,
-	0x1078, 0x1328, 0x1078, 0x753d, 0x007c, 0x007e, 0x027e, 0xa016,
-	0x1078, 0x15ec, 0x027f, 0x007f, 0x007c, 0xa182, 0x0085, 0x0079,
-	0x84c9, 0x84d2, 0x84d0, 0x84d0, 0x84de, 0x84d0, 0x84d0, 0x84d0,
-	0x1078, 0x1328, 0x6003, 0x0001, 0x6106, 0x1078, 0x5bf8, 0x127e,
-	0x2091, 0x8000, 0x1078, 0x6109, 0x127f, 0x007c, 0x027e, 0x057e,
-	0x0d7e, 0x0e7e, 0x2071, 0xa880, 0x7224, 0x6212, 0x7220, 0x1078,
-	0x8a30, 0x0040, 0x8503, 0x2268, 0x6800, 0xa086, 0x0000, 0x0040,
-	0x8503, 0x6018, 0x6d18, 0xa52e, 0x00c0, 0x8503, 0x0c7e, 0x2d60,
-	0x1078, 0x874a, 0x0c7f, 0x0040, 0x8503, 0x6803, 0x0002, 0x6007,
-	0x0086, 0x0078, 0x8505, 0x6007, 0x0087, 0x6003, 0x0001, 0x1078,
-	0x5bf8, 0x1078, 0x6109, 0x0f7e, 0x2278, 0x1078, 0x4893, 0x0f7f,
-	0x0040, 0x851d, 0x6824, 0xd0ec, 0x0040, 0x851d, 0x0c7e, 0x2260,
-	0x603f, 0x0000, 0x1078, 0x8cfa, 0x0c7f, 0x0e7f, 0x0d7f, 0x057f,
-	0x027f, 0x007c, 0xa186, 0x0013, 0x00c0, 0x8533, 0x6004, 0xa08a,
-	0x0085, 0x1048, 0x1328, 0xa08a, 0x008c, 0x10c8, 0x1328, 0xa082,
-	0x0085, 0x0079, 0x8542, 0xa186, 0x0027, 0x0040, 0x853b, 0xa186,
-	0x0014, 0x10c0, 0x1328, 0x1078, 0x6010, 0x1078, 0x8c01, 0x1078,
-	0x6109, 0x007c, 0x8549, 0x854b, 0x854b, 0x8549, 0x8549, 0x8549,
-	0x8549, 0x1078, 0x1328, 0x1078, 0x6010, 0x1078, 0x8c01, 0x1078,
-	0x6109, 0x007c, 0xa186, 0x0013, 0x00c0, 0x855c, 0x6004, 0xa082,
-	0x0085, 0x2008, 0x0078, 0x8597, 0xa186, 0x0027, 0x00c0, 0x857f,
-	0x1078, 0x6010, 0x1078, 0x2813, 0x0d7e, 0x6010, 0x2068, 0x1078,
-	0x8a44, 0x0040, 0x8575, 0x6837, 0x0103, 0x6847, 0x0000, 0x684b,
-	0x0029, 0x1078, 0x4982, 0x1078, 0x8bf4, 0x0d7f, 0x1078, 0x753d,
-	0x1078, 0x6109, 0x007c, 0x1078, 0x7583, 0x0078, 0x857a, 0xa186,
-	0x0014, 0x00c0, 0x857b, 0x1078, 0x6010, 0x0d7e, 0x6010, 0x2068,
-	0x1078, 0x8a44, 0x0040, 0x8575, 0x6837, 0x0103, 0x6847, 0x0000,
-	0x684b, 0x0006, 0x6850, 0xc0ec, 0x6852, 0x0078, 0x8571, 0x0079,
-	0x8599, 0x85a2, 0x85a0, 0x85a0, 0x85a0, 0x85a0, 0x85a0, 0x85bd,
-	0x1078, 0x1328, 0x1078, 0x6010, 0x6030, 0xa08c, 0xff00, 0x810f,
-	0xa186, 0x0039, 0x0040, 0x85b0, 0xa186, 0x0035, 0x00c0, 0x85b4,
-	0x2001, 0xa5a0, 0x0078, 0x85b6, 0x2001, 0xa5a1, 0x2004, 0x6016,
-	0x6003, 0x000c, 0x1078, 0x6109, 0x007c, 0x1078, 0x6010, 0x6030,
-	0xa08c, 0xff00, 0x810f, 0xa186, 0x0039, 0x0040, 0x85cb, 0xa186,
-	0x0035, 0x00c0, 0x85cf, 0x2001, 0xa5a0, 0x0078, 0x85d1, 0x2001,
-	0xa5a1, 0x2004, 0x6016, 0x6003, 0x000e, 0x1078, 0x6109, 0x007c,
-	0xa182, 0x008c, 0x00c8, 0x85e2, 0xa182, 0x0085, 0x0048, 0x85e2,
-	0x0079, 0x85e5, 0x1078, 0x7583, 0x007c, 0x85ec, 0x85ec, 0x85ec,
-	0x85ec, 0x85ee, 0x8643, 0x85ec, 0x1078, 0x1328, 0x0f7e, 0x2c78,
-	0x1078, 0x4893, 0x0f7f, 0x0040, 0x8601, 0x6030, 0xa08c, 0xff00,
-	0x810f, 0xa186, 0x0039, 0x0040, 0x865a, 0xa186, 0x0035, 0x0040,
-	0x865a, 0x0d7e, 0x1078, 0x8bf4, 0x1078, 0x8a44, 0x0040, 0x8625,
-	0x6010, 0x2068, 0x6837, 0x0103, 0x6850, 0xd0b4, 0x0040, 0x8616,
-	0x684b, 0x0006, 0xc0ec, 0x6852, 0x0078, 0x8621, 0xd0bc, 0x0040,
-	0x861d, 0x684b, 0x0002, 0x0078, 0x8621, 0x684b, 0x0005, 0x1078,
-	0x8cc0, 0x6847, 0x0000, 0x1078, 0x4982, 0x2c68, 0x1078, 0x74d7,
-	0x0040, 0x863e, 0x6003, 0x0001, 0x6007, 0x001e, 0x2009, 0xa88e,
-	0x210c, 0x6136, 0x2009, 0xa88f, 0x210c, 0x613a, 0x6918, 0x611a,
-	0x6920, 0x6122, 0x601f, 0x0001, 0x1078, 0x5bf8, 0x2d60, 0x1078,
-	0x753d, 0x0d7f, 0x007c, 0x0f7e, 0x2c78, 0x1078, 0x4893, 0x0f7f,
-	0x0040, 0x8680, 0x6030, 0xa08c, 0xff00, 0x810f, 0xa186, 0x0035,
-	0x0040, 0x865a, 0xa186, 0x001e, 0x0040, 0x865a, 0xa186, 0x0039,
-	0x00c0, 0x8680, 0x0d7e, 0x2c68, 0x1078, 0x8ef5, 0x00c0, 0x86a4,
-	0x1078, 0x74d7, 0x0040, 0x867d, 0x6106, 0x6003, 0x0001, 0x601f,
-	0x0001, 0x6918, 0x611a, 0x6928, 0x612a, 0x692c, 0x612e, 0x6930,
-	0xa18c, 0x00ff, 0x6132, 0x6934, 0x6136, 0x6938, 0x613a, 0x6920,
-	0x6122, 0x1078, 0x5bf8, 0x1078, 0x6109, 0x2d60, 0x0078, 0x86a4,
-	0x0d7e, 0x6010, 0x2068, 0x1078, 0x8a44, 0x0040, 0x86a4, 0x6837,
-	0x0103, 0x6850, 0xd0b4, 0x0040, 0x8693, 0xc0ec, 0x6852, 0x684b,
-	0x0006, 0x0078, 0x869e, 0xd0bc, 0x0040, 0x869a, 0x684b, 0x0002,
-	0x0078, 0x869e, 0x684b, 0x0005, 0x1078, 0x8cc0, 0x6847, 0x0000,
-	0x1078, 0x4982, 0x1078, 0x8bf4, 0x0d7f, 0x1078, 0x753d, 0x007c,
-	0x017e, 0x0d7e, 0x6010, 0x2068, 0x1078, 0x8a44, 0x0040, 0x86b8,
-	0x6837, 0x0103, 0x684b, 0x0028, 0x6847, 0x0000, 0x1078, 0x4982,
-	0x0d7f, 0x017f, 0xa186, 0x0013, 0x0040, 0x86ca, 0xa186, 0x0014,
-	0x0040, 0x86ca, 0xa186, 0x0027, 0x0040, 0x86ca, 0x1078, 0x7583,
-	0x0078, 0x86d0, 0x1078, 0x6010, 0x1078, 0x8c01, 0x1078, 0x6109,
-	0x007c, 0x057e, 0x067e, 0x0d7e, 0x0f7e, 0x2029, 0x0001, 0xa182,
-	0x0101, 0x00c8, 0x86dd, 0x0078, 0x86df, 0x2009, 0x0100, 0x2130,
-	0x2069, 0xa898, 0x831c, 0x2300, 0xad18, 0x2009, 0x0020, 0xaf90,
-	0x001d, 0x1078, 0x8739, 0xa6b2, 0x0020, 0x7804, 0xa06d, 0x0040,
-	0x86f3, 0x1078, 0x13aa, 0x1078, 0x1381, 0x0040, 0x871d, 0x8528,
-	0x6837, 0x0110, 0x683b, 0x0000, 0x2d20, 0x7c06, 0xa68a, 0x003d,
-	0x00c8, 0x8709, 0x2608, 0xad90, 0x000f, 0x1078, 0x8739, 0x0078,
-	0x871d, 0xa6b2, 0x003c, 0x2009, 0x003c, 0x2d78, 0xad90, 0x000f,
-	0x1078, 0x8739, 0x0078, 0x86f3, 0x0f7f, 0x852f, 0xa5ad, 0x0003,
-	0x7d36, 0xa5ac, 0x0000, 0x0078, 0x8722, 0x0f7f, 0x852f, 0xa5ad,
-	0x0003, 0x7d36, 0x0d7f, 0x067f, 0x057f, 0x007c, 0x0f7e, 0x8dff,
-	0x0040, 0x8737, 0x6804, 0xa07d, 0x0040, 0x8735, 0x6807, 0x0000,
-	0x1078, 0x4982, 0x2f68, 0x0078, 0x872a, 0x1078, 0x4982, 0x0f7f,
-	0x007c, 0x157e, 0xa184, 0x0001, 0x0040, 0x873f, 0x8108, 0x810c,
-	0x21a8, 0x2304, 0x8007, 0x2012, 0x8318, 0x8210, 0x00f0, 0x8741,
-	0x157f, 0x007c, 0x067e, 0x127e, 0x2091, 0x8000, 0x2031, 0x0001,
-	0x601c, 0xa084, 0x000f, 0x1079, 0x8766, 0x127f, 0x067f, 0x007c,
-	0x127e, 0x2091, 0x8000, 0x067e, 0x2031, 0x0000, 0x601c, 0xa084,
-	0x000f, 0x1079, 0x8766, 0x067f, 0x127f, 0x007c, 0x8780, 0x876e,
-	0x877b, 0x879c, 0x876e, 0x877b, 0x879c, 0x877b, 0x1078, 0x1328,
-	0x037e, 0x2019, 0x0010, 0x1078, 0x9a6a, 0x601f, 0x0006, 0x6003,
-	0x0007, 0x037f, 0x007c, 0xa006, 0x007c, 0xa085, 0x0001, 0x007c,
-	0x0d7e, 0x86ff, 0x00c0, 0x8797, 0x6010, 0x2068, 0x1078, 0x8a44,
-	0x0040, 0x8799, 0xa00e, 0x2001, 0x0005, 0x1078, 0x4a60, 0x1078,
-	0x8cc0, 0x1078, 0x4982, 0x1078, 0x753d, 0xa085, 0x0001, 0x0d7f,
-	0x007c, 0xa006, 0x0078, 0x8797, 0x6000, 0xa08a, 0x0010, 0x10c8,
-	0x1328, 0x1079, 0x87a4, 0x007c, 0x87b4, 0x87d4, 0x87b6, 0x87f7,
-	0x87d0, 0x87b4, 0x877b, 0x8780, 0x8780, 0x877b, 0x877b, 0x877b,
-	0x877b, 0x877b, 0x877b, 0x877b, 0x1078, 0x1328, 0x86ff, 0x00c0,
-	0x87cd, 0x0d7e, 0x6010, 0x2068, 0x1078, 0x8a44, 0x0040, 0x87c2,
-	0x1078, 0x8cc0, 0x0d7f, 0x6007, 0x0085, 0x6003, 0x000b, 0x601f,
-	0x0002, 0x1078, 0x5bf8, 0x1078, 0x6109, 0xa085, 0x0001, 0x007c,
-	0x1078, 0x1749, 0x0078, 0x87b6, 0x0e7e, 0x2071, 0xa5ab, 0x7024,
-	0xac06, 0x00c0, 0x87dd, 0x1078, 0x6dda, 0x601c, 0xa084, 0x000f,
-	0xa086, 0x0006, 0x00c0, 0x87ef, 0x087e, 0x097e, 0x2049, 0x0001,
-	0x2c40, 0x1078, 0x7058, 0x097f, 0x087f, 0x0078, 0x87f1, 0x1078,
-	0x6cd2, 0x0e7f, 0x00c0, 0x87b6, 0x1078, 0x877b, 0x007c, 0x037e,
-	0x0e7e, 0x2071, 0xa5ab, 0x703c, 0xac06, 0x00c0, 0x8807, 0x2019,
-	0x0000, 0x1078, 0x6e6c, 0x0e7f, 0x037f, 0x0078, 0x87b6, 0x1078,
-	0x719a, 0x0e7f, 0x037f, 0x00c0, 0x87b6, 0x1078, 0x877b, 0x007c,
-	0x0c7e, 0x601c, 0xa084, 0x000f, 0x1079, 0x8818, 0x0c7f, 0x007c,
-	0x8827, 0x8895, 0x89cd, 0x8832, 0x8c01, 0x8827, 0x9a5b, 0x753d,
-	0x8895, 0x1078, 0x8c3b, 0x00c0, 0x8827, 0x1078, 0x7a05, 0x007c,
-	0x1078, 0x6010, 0x1078, 0x6109, 0x1078, 0x753d, 0x007c, 0x6017,
-	0x0001, 0x007c, 0x6010, 0xa080, 0x0019, 0x2c02, 0x6000, 0xa08a,
-	0x0010, 0x10c8, 0x1328, 0x1079, 0x883e, 0x007c, 0x884e, 0x8850,
-	0x8872, 0x8884, 0x8891, 0x884e, 0x8827, 0x8827, 0x8827, 0x8884,
-	0x8884, 0x884e, 0x884e, 0x884e, 0x884e, 0x888e, 0x1078, 0x1328,
-	0x0e7e, 0x6010, 0x2070, 0x7050, 0xc0b5, 0x7052, 0x2071, 0xa5ab,
-	0x7024, 0xac06, 0x0040, 0x886e, 0x1078, 0x6cd2, 0x6007, 0x0085,
-	0x6003, 0x000b, 0x601f, 0x0002, 0x2001, 0xa5a1, 0x2004, 0x6016,
-	0x1078, 0x5bf8, 0x1078, 0x6109, 0x0e7f, 0x007c, 0x6017, 0x0001,
-	0x0078, 0x886c, 0x0d7e, 0x6010, 0x2068, 0x6850, 0xc0b5, 0x6852,
-	0x0d7f, 0x6007, 0x0085, 0x6003, 0x000b, 0x601f, 0x0002, 0x1078,
-	0x5bf8, 0x1078, 0x6109, 0x007c, 0x0d7e, 0x6017, 0x0001, 0x6010,
-	0x2068, 0x6850, 0xc0b5, 0x6852, 0x0d7f, 0x007c, 0x1078, 0x753d,
-	0x007c, 0x1078, 0x1749, 0x0078, 0x8872, 0x6000, 0xa08a, 0x0010,
-	0x10c8, 0x1328, 0x1079, 0x889d, 0x007c, 0x88ad, 0x882f, 0x88af,
-	0x88ad, 0x88af, 0x88af, 0x8828, 0x88ad, 0x8821, 0x8821, 0x88ad,
-	0x88ad, 0x88ad, 0x88ad, 0x88ad, 0x88ad, 0x1078, 0x1328, 0x0d7e,
-	0x6018, 0x2068, 0x6804, 0xa084, 0x00ff, 0x0d7f, 0xa08a, 0x000c,
-	0x10c8, 0x1328, 0x1079, 0x88bd, 0x007c, 0x88c9, 0x8971, 0x88cb,
-	0x890b, 0x88cb, 0x890b, 0x88cb, 0x88d8, 0x88c9, 0x890b, 0x88c9,
-	0x88f5, 0x1078, 0x1328, 0x6004, 0xa08e, 0x0016, 0x0040, 0x8906,
-	0xa08e, 0x0004, 0x0040, 0x8906, 0xa08e, 0x0002, 0x0040, 0x8906,
-	0x6004, 0x1078, 0x8c3b, 0x0040, 0x898c, 0xa08e, 0x0021, 0x0040,
-	0x8990, 0xa08e, 0x0022, 0x0040, 0x898c, 0xa08e, 0x003d, 0x0040,
-	0x8990, 0xa08e, 0x0039, 0x0040, 0x8994, 0xa08e, 0x0035, 0x0040,
-	0x8994, 0xa08e, 0x001e, 0x0040, 0x8908, 0xa08e, 0x0001, 0x00c0,
-	0x8904, 0x0d7e, 0x6018, 0x2068, 0x6804, 0xa084, 0x00ff, 0x0d7f,
-	0xa086, 0x0006, 0x0040, 0x8906, 0x1078, 0x2813, 0x1078, 0x7a05,
-	0x1078, 0x8c01, 0x007c, 0x0c7e, 0x0d7e, 0x6104, 0xa186, 0x0016,
-	0x0040, 0x8961, 0xa186, 0x0002, 0x00c0, 0x8934, 0x6018, 0x2068,
-	0x68a0, 0xd0bc, 0x00c0, 0x89b8, 0x6840, 0xa084, 0x00ff, 0xa005,
-	0x0040, 0x8934, 0x8001, 0x6842, 0x6013, 0x0000, 0x601f, 0x0007,
-	0x6017, 0x0398, 0x1078, 0x74d7, 0x0040, 0x8934, 0x2d00, 0x601a,
-	0x601f, 0x0001, 0x0078, 0x8961, 0x0d7f, 0x0c7f, 0x6004, 0xa08e,
-	0x0002, 0x00c0, 0x8952, 0x6018, 0xa080, 0x0028, 0x2004, 0xa086,
-	0x007e, 0x00c0, 0x8952, 0x2009, 0xa332, 0x2104, 0xc085, 0x200a,
-	0x0e7e, 0x2071, 0xa300, 0x1078, 0x41f5, 0x0e7f, 0x1078, 0x7a05,
-	0x0078, 0x8956, 0x1078, 0x7a05, 0x1078, 0x2813, 0x0e7e, 0x127e,
-	0x2091, 0x8000, 0x1078, 0x2839, 0x127f, 0x0e7f, 0x1078, 0x8c01,
-	0x007c, 0x2001, 0x0002, 0x1078, 0x443f, 0x6003, 0x0001, 0x6007,
-	0x0002, 0x1078, 0x5c45, 0x1078, 0x6109, 0x0d7f, 0x0c7f, 0x0078,
-	0x8960, 0x0c7e, 0x0d7e, 0x6104, 0xa186, 0x0016, 0x0040, 0x8961,
-	0x6018, 0x2068, 0x6840, 0xa084, 0x00ff, 0xa005, 0x0040, 0x8934,
-	0x8001, 0x6842, 0x6003, 0x0001, 0x1078, 0x5c45, 0x1078, 0x6109,
-	0x0d7f, 0x0c7f, 0x0078, 0x8960, 0x1078, 0x7a05, 0x0078, 0x8908,
-	0x1078, 0x7a28, 0x0078, 0x8908, 0x0d7e, 0x2c68, 0x6104, 0x1078,
-	0x8ef5, 0x0d7f, 0x0040, 0x89a0, 0x1078, 0x753d, 0x0078, 0x89b7,
-	0x6004, 0x8007, 0x6130, 0xa18c, 0x00ff, 0xa105, 0x6032, 0x6007,
-	0x0085, 0x6003, 0x000b, 0x601f, 0x0002, 0x6038, 0x600a, 0x2001,
-	0xa5a1, 0x2004, 0x6016, 0x1078, 0x5bf8, 0x1078, 0x6109, 0x007c,
-	0x0d7f, 0x0c7f, 0x1078, 0x7a05, 0x1078, 0x2813, 0x0e7e, 0x127e,
-	0x2091, 0x8000, 0x1078, 0x2839, 0x6013, 0x0000, 0x601f, 0x0007,
-	0x6017, 0x0398, 0x127f, 0x0e7f, 0x007c, 0x6000, 0xa08a, 0x0010,
-	0x10c8, 0x1328, 0x1079, 0x89d5, 0x007c, 0x89e5, 0x89e5, 0x89e5,
-	0x89e5, 0x89e5, 0x89e5, 0x89e5, 0x89e5, 0x89e5, 0x8827, 0x89e5,
-	0x882f, 0x89e7, 0x882f, 0x89f5, 0x89e5, 0x1078, 0x1328, 0x6004,
-	0xa086, 0x008b, 0x0040, 0x89f5, 0x6007, 0x008b, 0x6003, 0x000d,
-	0x1078, 0x5bf8, 0x1078, 0x6109, 0x007c, 0x1078, 0x8bf4, 0x1078,
-	0x8a44, 0x0040, 0x8a2d, 0x1078, 0x2813, 0x0d7e, 0x1078, 0x8a44,
-	0x0040, 0x8a0f, 0x6010, 0x2068, 0x6837, 0x0103, 0x684b, 0x0006,
-	0x6847, 0x0000, 0x6850, 0xc0ed, 0x6852, 0x1078, 0x4982, 0x2c68,
-	0x1078, 0x74d7, 0x0040, 0x8a1d, 0x6818, 0x601a, 0x0c7e, 0x2d60,
-	0x1078, 0x8c01, 0x0c7f, 0x0078, 0x8a1e, 0x2d60, 0x0d7f, 0x6013,
-	0x0000, 0x601f, 0x0001, 0x6007, 0x0001, 0x6003, 0x0001, 0x1078,
-	0x5c45, 0x1078, 0x6109, 0x0078, 0x8a2f, 0x1078, 0x8c01, 0x007c,
-	0xa284, 0x000f, 0x00c0, 0x8a41, 0xa282, 0xaa00, 0x0048, 0x8a41,
-	0x2001, 0xa315, 0x2004, 0xa202, 0x00c8, 0x8a41, 0xa085, 0x0001,
-	0x007c, 0xa006, 0x0078, 0x8a40, 0x027e, 0x0e7e, 0x2071, 0xa300,
-	0x6210, 0x7058, 0xa202, 0x0048, 0x8a56, 0x705c, 0xa202, 0x00c8,
-	0x8a56, 0xa085, 0x0001, 0x0e7f, 0x027f, 0x007c, 0xa006, 0x0078,
-	0x8a53, 0x0e7e, 0x0c7e, 0x037e, 0x007e, 0x127e, 0x2091, 0x8000,
-	0x2061, 0xaa00, 0x2071, 0xa300, 0x7344, 0x7060, 0xa302, 0x00c8,
-	0x8a83, 0x601c, 0xa206, 0x00c0, 0x8a7b, 0x1078, 0x8d66, 0x0040,
-	0x8a7b, 0x1078, 0x8c3b, 0x00c0, 0x8a77, 0x1078, 0x7a05, 0x0c7e,
-	0x1078, 0x753d, 0x0c7f, 0xace0, 0x0010, 0x7054, 0xac02, 0x00c8,
-	0x8a83, 0x0078, 0x8a64, 0x127f, 0x007f, 0x037f, 0x0c7f, 0x0e7f,
-	0x007c, 0x0e7e, 0x0c7e, 0x017e, 0xa188, 0xa434, 0x210c, 0x81ff,
-	0x0040, 0x8aa1, 0x2061, 0xaa00, 0x2071, 0xa300, 0x017e, 0x1078,
-	0x74d7, 0x017f, 0x0040, 0x8aa4, 0x611a, 0x1078, 0x2813, 0x1078,
-	0x753d, 0xa006, 0x0078, 0x8aa6, 0xa085, 0x0001, 0x017f, 0x0c7f,
-	0x0e7f, 0x007c, 0x0c7e, 0x057e, 0x127e, 0x2091, 0x8000, 0x0c7e,
-	0x1078, 0x74d7, 0x057f, 0x0040, 0x8ac3, 0x6612, 0x651a, 0x601f,
-	0x0003, 0x2009, 0x004b, 0x1078, 0x756c, 0xa085, 0x0001, 0x127f,
-	0x057f, 0x0c7f, 0x007c, 0xa006, 0x0078, 0x8abf, 0x0c7e, 0x057e,
-	0x127e, 0x2091, 0x8000, 0x62a0, 0x0c7e, 0x1078, 0x74d7, 0x057f,
-	0x0040, 0x8af1, 0x6013, 0x0000, 0x651a, 0x601f, 0x0003, 0x0c7e,
-	0x2560, 0x1078, 0x471b, 0x0c7f, 0x1078, 0x5d53, 0x077e, 0x2039,
-	0x0000, 0x1078, 0x5c78, 0x2c08, 0x1078, 0x9c38, 0x077f, 0x2009,
-	0x004c, 0x1078, 0x756c, 0xa085, 0x0001, 0x127f, 0x057f, 0x0c7f,
-	0x007c, 0xa006, 0x0078, 0x8aed, 0x0f7e, 0x0c7e, 0x047e, 0x0c7e,
-	0x1078, 0x74d7, 0x2c78, 0x0c7f, 0x0040, 0x8b0e, 0x7e12, 0x2c00,
-	0x781a, 0x781f, 0x0003, 0x2021, 0x0005, 0x1078, 0x8b4e, 0x2f60,
-	0x2009, 0x004d, 0x1078, 0x756c, 0xa085, 0x0001, 0x047f, 0x0c7f,
-	0x0f7f, 0x007c, 0x0f7e, 0x0c7e, 0x047e, 0x0c7e, 0x1078, 0x74d7,
-	0x2c78, 0x0c7f, 0x0040, 0x8b2c, 0x7e12, 0x2c00, 0x781a, 0x781f,
-	0x0003, 0x2021, 0x0005, 0x1078, 0x8b4e, 0x2f60, 0x2009, 0x004e,
-	0x1078, 0x756c, 0xa085, 0x0001, 0x047f, 0x0c7f, 0x0f7f, 0x007c,
-	0x0f7e, 0x0c7e, 0x047e, 0x0c7e, 0x1078, 0x74d7, 0x2c78, 0x0c7f,
-	0x0040, 0x8b4a, 0x7e12, 0x2c00, 0x781a, 0x781f, 0x0003, 0x2021,
-	0x0004, 0x1078, 0x8b4e, 0x2f60, 0x2009, 0x0052, 0x1078, 0x756c,
-	0xa085, 0x0001, 0x047f, 0x0c7f, 0x0f7f, 0x007c, 0x097e, 0x077e,
-	0x127e, 0x2091, 0x8000, 0x1078, 0x46a7, 0x0040, 0x8b5b, 0x2001,
-	0x8b53, 0x0078, 0x8b61, 0x1078, 0x466d, 0x0040, 0x8b6a, 0x2001,
-	0x8b5b, 0x007e, 0xa00e, 0x2400, 0x1078, 0x4a60, 0x1078, 0x4982,
-	0x007f, 0x007a, 0x2418, 0x1078, 0x5fa7, 0x62a0, 0x087e, 0x2041,
-	0x0001, 0x2039, 0x0001, 0x2608, 0x1078, 0x5d6d, 0x087f, 0x1078,
-	0x5c78, 0x2f08, 0x2648, 0x1078, 0x9c38, 0x613c, 0x81ff, 0x1040,
-	0x5e21, 0x127f, 0x077f, 0x097f, 0x007c, 0x0c7e, 0x127e, 0x2091,
-	0x8000, 0x0c7e, 0x1078, 0x74d7, 0x017f, 0x0040, 0x8b9e, 0x660a,
-	0x611a, 0x601f, 0x0001, 0x2d00, 0x6012, 0x2009, 0x001f, 0x1078,
-	0x756c, 0xa085, 0x0001, 0x127f, 0x0c7f, 0x007c, 0xa006, 0x0078,
-	0x8b9b, 0x0c7e, 0x127e, 0x2091, 0x8000, 0x0c7e, 0x1078, 0x74d7,
-	0x017f, 0x0040, 0x8bba, 0x660a, 0x611a, 0x601f, 0x0008, 0x2d00,
-	0x6012, 0x2009, 0x0021, 0x1078, 0x756c, 0xa085, 0x0001, 0x127f,
-	0x0c7f, 0x007c, 0xa006, 0x0078, 0x8bb7, 0x0c7e, 0x127e, 0x2091,
-	0x8000, 0x0c7e, 0x1078, 0x74d7, 0x017f, 0x0040, 0x8bd6, 0x660a,
-	0x611a, 0x601f, 0x0001, 0x2d00, 0x6012, 0x2009, 0x003d, 0x1078,
-	0x756c, 0xa085, 0x0001, 0x127f, 0x0c7f, 0x007c, 0xa006, 0x0078,
-	0x8bd3, 0x0c7e, 0x127e, 0x2091, 0x8000, 0x0c7e, 0x1078, 0x74d7,
-	0x017f, 0x0040, 0x8bf1, 0x611a, 0x601f, 0x0001, 0x2d00, 0x6012,
-	0x2009, 0x0000, 0x1078, 0x756c, 0xa085, 0x0001, 0x127f, 0x0c7f,
-	0x007c, 0xa006, 0x0078, 0x8bee, 0x027e, 0x0d7e, 0x6218, 0x2268,
-	0x6a3c, 0x82ff, 0x0040, 0x8bfe, 0x8211, 0x6a3e, 0x0d7f, 0x027f,
-	0x007c, 0x007e, 0x6000, 0xa086, 0x0000, 0x0040, 0x8c13, 0x6013,
-	0x0000, 0x601f, 0x0007, 0x2001, 0xa5a1, 0x2004, 0x6016, 0x1078,
-	0xa134, 0x603f, 0x0000, 0x007f, 0x007c, 0x067e, 0x0c7e, 0x0d7e,
-	0x2031, 0xa352, 0x2634, 0xd6e4, 0x0040, 0x8c23, 0x6618, 0x2660,
-	0x6e48, 0x1078, 0x461b, 0x0d7f, 0x0c7f, 0x067f, 0x007c, 0x007e,
-	0x017e, 0x6004, 0xa08e, 0x0002, 0x0040, 0x8c38, 0xa08e, 0x0003,
-	0x0040, 0x8c38, 0xa08e, 0x0004, 0x0040, 0x8c38, 0xa085, 0x0001,
-	0x017f, 0x007f, 0x007c, 0x007e, 0x0d7e, 0x6010, 0xa06d, 0x0040,
-	0x8c48, 0x6838, 0xd0fc, 0x0040, 0x8c48, 0xa006, 0x0078, 0x8c4a,
-	0xa085, 0x0001, 0x0d7f, 0x007f, 0x007c, 0x0c7e, 0x127e, 0x2091,
-	0x8000, 0x0c7e, 0x1078, 0x74d7, 0x017f, 0x0040, 0x8c67, 0x611a,
-	0x601f, 0x0001, 0x2d00, 0x6012, 0x1078, 0x2813, 0x2009, 0x0028,
-	0x1078, 0x756c, 0xa085, 0x0001, 0x127f, 0x0c7f, 0x007c, 0xa006,
-	0x0078, 0x8c64, 0xa186, 0x0015, 0x00c0, 0x8c7f, 0x2011, 0xa31f,
-	0x2204, 0xa086, 0x0074, 0x00c0, 0x8c7f, 0x1078, 0x7d0d, 0x6003,
-	0x0001, 0x6007, 0x0029, 0x1078, 0x5c45, 0x0078, 0x8c83, 0x1078,
-	0x7a05, 0x1078, 0x753d, 0x007c, 0xa186, 0x0016, 0x00c0, 0x8c8e,
-	0x2001, 0x0004, 0x1078, 0x443f, 0x0078, 0x8caf, 0xa186, 0x0015,
-	0x00c0, 0x8cb3, 0x2011, 0xa31f, 0x2204, 0xa086, 0x0014, 0x00c0,
-	0x8cb3, 0x0d7e, 0x6018, 0x2068, 0x1078, 0x457d, 0x0d7f, 0x1078,
-	0x7dba, 0x00c0, 0x8cb3, 0x0d7e, 0x6018, 0x2068, 0x6890, 0x0d7f,
-	0xa005, 0x0040, 0x8cb3, 0x2001, 0x0006, 0x1078, 0x443f, 0x1078,
-	0x7608, 0x0078, 0x8cb7, 0x1078, 0x7a05, 0x1078, 0x753d, 0x007c,
-	0x6848, 0xa086, 0x0005, 0x00c0, 0x8cbf, 0x1078, 0x8cc0, 0x007c,
-	0x6850, 0xc0ad, 0x6852, 0x007c, 0x0e7e, 0x2071, 0xa88c, 0x7014,
-	0xd0e4, 0x0040, 0x8cd5, 0x6013, 0x0000, 0x6003, 0x0001, 0x6007,
-	0x0050, 0x1078, 0x5bf8, 0x1078, 0x6109, 0x0e7f, 0x007c, 0x0c7e,
-	0x0f7e, 0x2c78, 0x1078, 0x4893, 0x0f7f, 0x0040, 0x8ce4, 0x601c,
-	0xa084, 0x000f, 0x1079, 0x8ce6, 0x0c7f, 0x007c, 0x8827, 0x8cf1,
-	0x8cf4, 0x8cf7, 0x9f00, 0x9f1c, 0x9f1f, 0x8827, 0x8827, 0x1078,
-	0x1328, 0x0005, 0x0005, 0x007c, 0x0005, 0x0005, 0x007c, 0x1078,
-	0x8cfa, 0x007c, 0x0f7e, 0x2c78, 0x1078, 0x4893, 0x0040, 0x8d29,
-	0x1078, 0x74d7, 0x00c0, 0x8d0a, 0x2001, 0xa5a2, 0x2004, 0x783e,
-	0x0078, 0x8d29, 0x7818, 0x601a, 0x781c, 0xa086, 0x0003, 0x0040,
-	0x8d17, 0x7808, 0x6036, 0x2f00, 0x603a, 0x0078, 0x8d1b, 0x7808,
-	0x603a, 0x2f00, 0x6036, 0x602a, 0x601f, 0x0001, 0x6007, 0x0035,
-	0x6003, 0x0001, 0x7920, 0x6122, 0x1078, 0x5bf8, 0x1078, 0x6109,
-	0x2f60, 0x0f7f, 0x007c, 0x017e, 0x0f7e, 0x682c, 0x6032, 0xa08e,
-	0x0001, 0x0040, 0x8d3c, 0xa086, 0x0005, 0x0040, 0x8d40, 0xa006,
-	0x602a, 0x602e, 0x0078, 0x8d51, 0x6824, 0xc0f4, 0xc0d5, 0x6826,
-	0x6810, 0x2078, 0x787c, 0x6938, 0xa102, 0x7880, 0x6934, 0xa103,
-	0x00c8, 0x8d37, 0x6834, 0x602a, 0x6838, 0xa084, 0xfffc, 0x683a,
-	0x602e, 0x2d00, 0x6036, 0x6808, 0x603a, 0x6918, 0x611a, 0x6920,
-	0x6122, 0x601f, 0x0001, 0x6007, 0x0039, 0x6003, 0x0001, 0x1078,
-	0x5bf8, 0x6803, 0x0002, 0x0f7f, 0x017f, 0x007c, 0x007e, 0x017e,
-	0x6004, 0xa08e, 0x0034, 0x0040, 0x8d8b, 0xa08e, 0x0035, 0x0040,
-	0x8d8b, 0xa08e, 0x0036, 0x0040, 0x8d8b, 0xa08e, 0x0037, 0x0040,
-	0x8d8b, 0xa08e, 0x0038, 0x0040, 0x8d8b, 0xa08e, 0x0039, 0x0040,
-	0x8d8b, 0xa08e, 0x003a, 0x0040, 0x8d8b, 0xa08e, 0x003b, 0x0040,
-	0x8d8b, 0xa085, 0x0001, 0x017f, 0x007f, 0x007c, 0x0f7e, 0x2c78,
-	0x1078, 0x4893, 0x00c0, 0x8d98, 0xa085, 0x0001, 0x0078, 0x8da7,
-	0x6024, 0xd0f4, 0x00c0, 0x8da6, 0xc0f5, 0x6026, 0x6010, 0x2078,
-	0x7828, 0x603a, 0x782c, 0x6036, 0x1078, 0x1749, 0xa006, 0x0f7f,
-	0x007c, 0x007e, 0x017e, 0x027e, 0x037e, 0x0e7e, 0x2001, 0xa59c,
-	0x200c, 0x8000, 0x2014, 0x2001, 0x0032, 0x1078, 0x5a98, 0x2001,
-	0xa5a0, 0x82ff, 0x00c0, 0x8dbe, 0x2011, 0x0002, 0x2202, 0x2001,
-	0xa59e, 0x200c, 0x8000, 0x2014, 0x2071, 0xa58c, 0x711a, 0x721e,
-	0x2001, 0x0064, 0x1078, 0x5a98, 0x2001, 0xa5a1, 0x82ff, 0x00c0,
-	0x8dd3, 0x2011, 0x0002, 0x2202, 0x2009, 0xa5a2, 0xa280, 0x000a,
-	0x200a, 0x0e7f, 0x037f, 0x027f, 0x017f, 0x007f, 0x007c, 0x007e,
-	0x0e7e, 0x2001, 0xa5a0, 0x2003, 0x0028, 0x2001, 0xa5a1, 0x2003,
-	0x0014, 0x2071, 0xa58c, 0x701b, 0x0000, 0x701f, 0x07d0, 0x2001,
-	0xa5a2, 0x2003, 0x001e, 0x0e7f, 0x007f, 0x007c, 0x0c7e, 0x127e,
-	0x2091, 0x8000, 0x0c7e, 0x1078, 0x74d7, 0x017f, 0x0040, 0x8e0e,
-	0x611a, 0x601f, 0x0001, 0x2d00, 0x6012, 0x2009, 0x0033, 0x1078,
-	0x756c, 0xa085, 0x0001, 0x127f, 0x0c7f, 0x007c, 0xa006, 0x0078,
-	0x8e0b, 0x0d7e, 0x0e7e, 0x0f7e, 0x2071, 0xa300, 0xa186, 0x0015,
-	0x00c0, 0x8e40, 0x707c, 0xa086, 0x0018, 0x00c0, 0x8e40, 0x6010,
-	0x2068, 0x6a3c, 0xd2e4, 0x00c0, 0x8e34, 0x2c78, 0x1078, 0x62c6,
-	0x0040, 0x8e48, 0x7068, 0x6a50, 0xa206, 0x00c0, 0x8e3c, 0x706c,
-	0x6a54, 0xa206, 0x00c0, 0x8e3c, 0x6218, 0xa290, 0x0028, 0x2214,
-	0x2009, 0x0000, 0x1078, 0x285b, 0x1078, 0x7608, 0x0078, 0x8e44,
-	0x1078, 0x7a05, 0x1078, 0x753d, 0x0f7f, 0x0e7f, 0x0d7f, 0x007c,
-	0x704c, 0xa080, 0x293f, 0x2004, 0x6a54, 0xa206, 0x0040, 0x8e34,
-	0x0078, 0x8e3c, 0x0c7e, 0x127e, 0x2091, 0x8000, 0x0c7e, 0x1078,
-	0x74d7, 0x017f, 0x0040, 0x8e6a, 0x611a, 0x601f, 0x0001, 0x2d00,
-	0x6012, 0x2009, 0x0043, 0x1078, 0x756c, 0xa085, 0x0001, 0x127f,
-	0x0c7f, 0x007c, 0xa006, 0x0078, 0x8e67, 0x0d7e, 0x0e7e, 0x0f7e,
-	0x2071, 0xa300, 0xa186, 0x0015, 0x00c0, 0x8e93, 0x707c, 0xa086,
-	0x0004, 0x00c0, 0x8e93, 0x6010, 0xa0e8, 0x000f, 0x2c78, 0x1078,
-	0x62c6, 0x0040, 0x8e9b, 0x7068, 0x6a08, 0xa206, 0x00c0, 0x8e8f,
-	0x706c, 0x6a0c, 0xa206, 0x00c0, 0x8e8f, 0x1078, 0x2813, 0x1078,
-	0x7608, 0x0078, 0x8e97, 0x1078, 0x7a05, 0x1078, 0x753d, 0x0f7f,
-	0x0e7f, 0x0d7f, 0x007c, 0x704c, 0xa080, 0x293f, 0x2004, 0x6a0c,
-	0xa206, 0x0040, 0x8e8d, 0x0078, 0x8e8f, 0x017e, 0x027e, 0x684c,
-	0xd0ac, 0x0040, 0x8ebd, 0x6914, 0x6a10, 0x2100, 0xa205, 0x0040,
-	0x8ebd, 0x6860, 0xa106, 0x00c0, 0x8eb9, 0x685c, 0xa206, 0x0040,
-	0x8ebd, 0x6962, 0x6a5e, 0xa085, 0x0001, 0x027f, 0x017f, 0x007c,
-	0x0e7e, 0x127e, 0x2071, 0xa300, 0x2091, 0x8000, 0x7544, 0xa582,
-	0x0001, 0x0048, 0x8ef2, 0x7048, 0x2060, 0x6000, 0xa086, 0x0000,
-	0x0040, 0x8ede, 0xace0, 0x0010, 0x7054, 0xac02, 0x00c8, 0x8eda,
-	0x0078, 0x8ecd, 0x2061, 0xaa00, 0x0078, 0x8ecd, 0x6003, 0x0008,
-	0x8529, 0x7546, 0xaca8, 0x0010, 0x7054, 0xa502, 0x00c8, 0x8eee,
-	0x754a, 0xa085, 0x0001, 0x127f, 0x0e7f, 0x007c, 0x704b, 0xaa00,
-	0x0078, 0x8ee9, 0xa006, 0x0078, 0x8eeb, 0x0c7e, 0x027e, 0x017e,
-	0xa186, 0x0035, 0x0040, 0x8eff, 0x6a34, 0x0078, 0x8f00, 0x6a28,
-	0x1078, 0x8a30, 0x0040, 0x8f29, 0x2260, 0x611c, 0xa186, 0x0003,
-	0x0040, 0x8f0e, 0xa186, 0x0006, 0x00c0, 0x8f25, 0x6834, 0xa206,
-	0x0040, 0x8f1d, 0x6838, 0xa206, 0x00c0, 0x8f25, 0x6108, 0x6834,
-	0xa106, 0x00c0, 0x8f25, 0x0078, 0x8f22, 0x6008, 0x6938, 0xa106,
-	0x00c0, 0x8f25, 0x6018, 0x6918, 0xa106, 0x017f, 0x027f, 0x0c7f,
-	0x007c, 0xa085, 0x0001, 0x0078, 0x8f25, 0x067e, 0x6000, 0xa0b2,
-	0x0010, 0x10c8, 0x1328, 0x1079, 0x8f37, 0x067f, 0x007c, 0x8f47,
-	0x93bb, 0x94d3, 0x8f47, 0x8f47, 0x8f47, 0x8f47, 0x8f47, 0x8f81,
-	0x955e, 0x8f47, 0x8f47, 0x8f47, 0x8f47, 0x8f47, 0x8f47, 0x1078,
-	0x1328, 0x067e, 0x6000, 0xa0b2, 0x0010, 0x10c8, 0x1328, 0x1079,
-	0x8f53, 0x067f, 0x007c, 0x8f63, 0x99f6, 0x8f63, 0x8f63, 0x8f63,
-	0x8f63, 0x8f63, 0x8f63, 0x99b4, 0x9a44, 0x8f63, 0xa053, 0xa087,
-	0xa053, 0xa087, 0x8f63, 0x1078, 0x1328, 0x067e, 0x6000, 0xa0b2,
-	0x0010, 0x10c8, 0x1328, 0x1079, 0x8f6f, 0x067f, 0x007c, 0x8f7f,
-	0x969f, 0x976a, 0x9798, 0x9813, 0x8f7f, 0x9919, 0x98c1, 0x956a,
-	0x9988, 0x999e, 0x8f7f, 0x8f7f, 0x8f7f, 0x8f7f, 0x8f7f, 0x1078,
-	0x1328, 0xa1b2, 0x0044, 0x10c8, 0x1328, 0x2100, 0x0079, 0x8f88,
-	0x8fc8, 0x919a, 0x8fc8, 0x8fc8, 0x8fc8, 0x91a2, 0x8fc8, 0x8fc8,
-	0x8fc8, 0x8fc8, 0x8fc8, 0x8fc8, 0x8fc8, 0x8fc8, 0x8fc8, 0x8fc8,
-	0x8fc8, 0x8fc8, 0x8fc8, 0x8fc8, 0x8fc8, 0x8fc8, 0x8fc8, 0x8fca,
-	0x902d, 0x9038, 0x9081, 0x909c, 0x911b, 0x918b, 0x8fc8, 0x8fc8,
-	0x91a6, 0x8fc8, 0x8fc8, 0x91b5, 0x91bc, 0x8fc8, 0x8fc8, 0x8fc8,
-	0x8fc8, 0x8fc8, 0x91ea, 0x8fc8, 0x8fc8, 0x91f5, 0x8fc8, 0x8fc8,
-	0x8fc8, 0x8fc8, 0x8fc8, 0x8fc8, 0x920a, 0x8fc8, 0x8fc8, 0x8fc8,
-	0x9291, 0x8fc8, 0x8fc8, 0x8fc8, 0x8fc8, 0x8fc8, 0x8fc8, 0x9305,
-	0x1078, 0x1328, 0x1078, 0x4897, 0x00c0, 0x8fd7, 0x2001, 0xa332,
-	0x2004, 0xa084, 0x0009, 0xa086, 0x0008, 0x00c0, 0x8fdf, 0x6007,
-	0x0009, 0x602b, 0x0009, 0x6013, 0x0000, 0x0078, 0x9195, 0x1078,
-	0x4887, 0x0e7e, 0x0c7e, 0x037e, 0x027e, 0x017e, 0x6218, 0x2270,
-	0x72a0, 0x027e, 0x2019, 0x0029, 0x1078, 0x5d53, 0x077e, 0x2039,
-	0x0000, 0x1078, 0x5c78, 0x2c08, 0x1078, 0x9c38, 0x077f, 0x017f,
-	0x2e60, 0x1078, 0x471b, 0x017f, 0x027f, 0x037f, 0x0c7f, 0x0e7f,
-	0x6618, 0x0c7e, 0x2660, 0x1078, 0x4513, 0x0c7f, 0xa6b0, 0x0001,
-	0x2634, 0xa684, 0x00ff, 0xa082, 0x0006, 0x0048, 0x901f, 0x1078,
-	0x9b6c, 0x00c0, 0x907b, 0x1078, 0x9afd, 0x00c0, 0x901b, 0x6007,
-	0x0008, 0x0078, 0x9195, 0x6007, 0x0009, 0x0078, 0x9195, 0x1078,
-	0x9d45, 0x0040, 0x9029, 0x1078, 0x9b6c, 0x0040, 0x9013, 0x0078,
-	0x907b, 0x6013, 0x1900, 0x0078, 0x901b, 0x6106, 0x1078, 0x9aa8,
-	0x6007, 0x0006, 0x0078, 0x9195, 0x6007, 0x0007, 0x0078, 0x9195,
-	0x1078, 0xa0bf, 0x00c0, 0x9340, 0x0d7e, 0x6618, 0x2668, 0x6e04,
-	0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006, 0x0040, 0x905d, 0xa686,
-	0x0004, 0x0040, 0x905d, 0x6e04, 0xa6b4, 0x00ff, 0xa686, 0x0006,
-	0x0040, 0x905d, 0xa686, 0x0004, 0x0040, 0x905d, 0xa686, 0x0005,
-	0x0040, 0x905d, 0x0d7f, 0x0078, 0x907b, 0x1078, 0x9bd2, 0x00c0,
-	0x9076, 0xa686, 0x0006, 0x00c0, 0x906f, 0x027e, 0x6218, 0xa290,
-	0x0028, 0x2214, 0x2009, 0x0000, 0x1078, 0x285b, 0x027f, 0x1078,
-	0x457d, 0x6007, 0x000a, 0x0d7f, 0x0078, 0x9195, 0x6007, 0x000b,
-	0x0d7f, 0x0078, 0x9195, 0x1078, 0x2813, 0x6007, 0x0001, 0x0078,
-	0x9195, 0x1078, 0xa0bf, 0x00c0, 0x9340, 0x6618, 0x0d7e, 0x2668,
-	0x6e04, 0x0d7f, 0xa686, 0x0707, 0x0040, 0x907b, 0x027e, 0x6218,
-	0xa290, 0x0028, 0x2214, 0x2009, 0x0000, 0x1078, 0x285b, 0x027f,
-	0x6007, 0x000c, 0x0078, 0x9195, 0x1078, 0x4897, 0x00c0, 0x90a9,
-	0x2001, 0xa332, 0x2004, 0xa084, 0x0009, 0xa086, 0x0008, 0x00c0,
-	0x90b1, 0x6007, 0x0009, 0x602b, 0x0009, 0x6013, 0x0000, 0x0078,
-	0x9195, 0x1078, 0x4887, 0x6618, 0xa6b0, 0x0001, 0x2634, 0xa684,
-	0x00ff, 0xa082, 0x0006, 0x0048, 0x90f5, 0xa6b4, 0xff00, 0x8637,
-	0xa686, 0x0004, 0x0040, 0x90c8, 0xa686, 0x0006, 0x00c0, 0x907b,
-	0x1078, 0x9be1, 0x00c0, 0x90d0, 0x6007, 0x000e, 0x0078, 0x9195,
-	0x047e, 0x6418, 0xa4a0, 0x0028, 0x2424, 0xa4a4, 0x00ff, 0x8427,
-	0x047e, 0x1078, 0x2813, 0x047f, 0x017e, 0xa006, 0x2009, 0xa352,
-	0x210c, 0xd1a4, 0x0040, 0x90ef, 0x2009, 0x0029, 0x1078, 0x9ec0,
-	0x6018, 0x0d7e, 0x2068, 0x6800, 0xc0e5, 0x6802, 0x0d7f, 0x017f,
-	0x047f, 0x6007, 0x0001, 0x0078, 0x9195, 0x2001, 0x0001, 0x1078,
-	0x442b, 0x157e, 0x017e, 0x027e, 0x037e, 0x20a9, 0x0004, 0x2019,
-	0xa305, 0x2011, 0xa890, 0x1078, 0x7e55, 0x037f, 0x027f, 0x017f,
-	0x157f, 0xa005, 0x0040, 0x9115, 0xa6b4, 0xff00, 0x8637, 0xa686,
-	0x0006, 0x0040, 0x90c8, 0x0078, 0x907b, 0x6013, 0x1900, 0x6007,
-	0x0009, 0x0078, 0x9195, 0x1078, 0x4897, 0x00c0, 0x9128, 0x2001,
-	0xa332, 0x2004, 0xa084, 0x0009, 0xa086, 0x0008, 0x00c0, 0x9130,
-	0x6007, 0x0009, 0x602b, 0x0009, 0x6013, 0x0000, 0x0078, 0x9195,
-	0x1078, 0x4887, 0x6618, 0xa6b0, 0x0001, 0x2634, 0xa684, 0x00ff,
-	0xa082, 0x0006, 0x0048, 0x9178, 0xa6b4, 0xff00, 0x8637, 0xa686,
-	0x0004, 0x0040, 0x9147, 0xa686, 0x0006, 0x00c0, 0x907b, 0x1078,
-	0x9c0c, 0x00c0, 0x9153, 0x1078, 0x9afd, 0x00c0, 0x9153, 0x6007,
-	0x0010, 0x0078, 0x9195, 0x047e, 0x6418, 0xa4a0, 0x0028, 0x2424,
-	0xa4a4, 0x00ff, 0x8427, 0x047e, 0x1078, 0x2813, 0x047f, 0x017e,
-	0xa006, 0x2009, 0xa352, 0x210c, 0xd1a4, 0x0040, 0x9172, 0x2009,
-	0x0029, 0x1078, 0x9ec0, 0x6018, 0x0d7e, 0x2068, 0x6800, 0xc0e5,
-	0x6802, 0x0d7f, 0x017f, 0x047f, 0x6007, 0x0001, 0x0078, 0x9195,
-	0x1078, 0x9d45, 0x0040, 0x9185, 0xa6b4, 0xff00, 0x8637, 0xa686,
-	0x0006, 0x0040, 0x9147, 0x0078, 0x907b, 0x6013, 0x1900, 0x6007,
-	0x0009, 0x0078, 0x9195, 0x1078, 0xa0bf, 0x00c0, 0x9340, 0x1078,
-	0x9343, 0x00c0, 0x907b, 0x6007, 0x0012, 0x6003, 0x0001, 0x1078,
-	0x5c45, 0x007c, 0x6007, 0x0001, 0x6003, 0x0001, 0x1078, 0x5c45,
-	0x0078, 0x9199, 0x6007, 0x0005, 0x0078, 0x919c, 0x1078, 0xa0bf,
-	0x00c0, 0x9340, 0x1078, 0x9343, 0x00c0, 0x907b, 0x6007, 0x0020,
-	0x6003, 0x0001, 0x1078, 0x5c45, 0x007c, 0x6007, 0x0023, 0x6003,
-	0x0001, 0x1078, 0x5c45, 0x007c, 0x1078, 0xa0bf, 0x00c0, 0x9340,
-	0x1078, 0x9343, 0x00c0, 0x907b, 0x017e, 0x027e, 0x2011, 0xa890,
-	0x2214, 0x2c08, 0x1078, 0x9e8c, 0x00c0, 0x91de, 0x2160, 0x6007,
-	0x0026, 0x6013, 0x1700, 0x2011, 0xa889, 0x2214, 0xa296, 0xffff,
-	0x00c0, 0x91e3, 0x6007, 0x0025, 0x0078, 0x91e3, 0x1078, 0x753d,
-	0x2160, 0x6007, 0x0025, 0x6003, 0x0001, 0x1078, 0x5c45, 0x027f,
-	0x017f, 0x007c, 0x6106, 0x1078, 0x9363, 0x6007, 0x002b, 0x0078,
-	0x9195, 0x6007, 0x002c, 0x0078, 0x9195, 0x1078, 0xa0bf, 0x00c0,
-	0x9340, 0x1078, 0x9343, 0x00c0, 0x907b, 0x6106, 0x1078, 0x9368,
-	0x00c0, 0x9206, 0x6007, 0x002e, 0x0078, 0x9195, 0x6007, 0x002f,
-	0x0078, 0x9195, 0x0e7e, 0x0d7e, 0x0c7e, 0x6018, 0xa080, 0x0001,
-	0x200c, 0xa184, 0x00ff, 0xa086, 0x0006, 0x0040, 0x9223, 0xa184,
-	0xff00, 0x8007, 0xa086, 0x0006, 0x0040, 0x9223, 0x0c7f, 0x0d7f,
-	0x0e7f, 0x0078, 0x919a, 0x2001, 0xa371, 0x2004, 0xd0e4, 0x0040,
-	0x928d, 0x2071, 0xa88c, 0x7010, 0x6036, 0x7014, 0x603a, 0x7108,
-	0x720c, 0x2001, 0xa352, 0x2004, 0xd0a4, 0x0040, 0x9241, 0x6018,
-	0x2068, 0x6810, 0xa106, 0x00c0, 0x9241, 0x6814, 0xa206, 0x0040,
-	0x9265, 0x2001, 0xa352, 0x2004, 0xd0ac, 0x00c0, 0x9281, 0x2069,
-	0xa300, 0x686c, 0xa206, 0x00c0, 0x9281, 0x6868, 0xa106, 0x00c0,
-	0x9281, 0x7210, 0x1078, 0x8a30, 0x0040, 0x9287, 0x1078, 0x9f31,
-	0x0040, 0x9287, 0x622a, 0x6007, 0x0036, 0x6003, 0x0001, 0x1078,
-	0x5bf8, 0x0c7f, 0x0d7f, 0x0e7f, 0x007c, 0x7214, 0xa286, 0xffff,
-	0x0040, 0x9277, 0x1078, 0x8a30, 0x0040, 0x9287, 0xa280, 0x0002,
-	0x2004, 0x7110, 0xa106, 0x00c0, 0x9287, 0x0078, 0x9252, 0x7210,
-	0x2c08, 0x1078, 0x9e8c, 0x2c10, 0x2160, 0x0040, 0x9287, 0x0078,
-	0x9252, 0x6007, 0x0037, 0x6013, 0x1500, 0x0078, 0x925d, 0x6007,
-	0x0037, 0x6013, 0x1700, 0x0078, 0x925d, 0x6007, 0x0012, 0x0078,
-	0x925d, 0x6018, 0xa080, 0x0001, 0x2004, 0xa084, 0xff00, 0x8007,
-	0xa086, 0x0006, 0x00c0, 0x919a, 0x0e7e, 0x0d7e, 0x0c7e, 0x2001,
-	0xa371, 0x2004, 0xd0e4, 0x0040, 0x92fd, 0x2069, 0xa300, 0x2071,
-	0xa88c, 0x7008, 0x6036, 0x720c, 0x623a, 0xa286, 0xffff, 0x00c0,
-	0x92ba, 0x7208, 0x0c7e, 0x2c08, 0x1078, 0x9e8c, 0x2c10, 0x0c7f,
-	0x0040, 0x92f1, 0x1078, 0x8a30, 0x0040, 0x92f1, 0x0c7e, 0x027e,
-	0x2260, 0x1078, 0x874a, 0x027f, 0x0c7f, 0x7118, 0xa18c, 0xff00,
-	0x810f, 0xa186, 0x0001, 0x0040, 0x92db, 0xa186, 0x0005, 0x0040,
-	0x92d5, 0xa186, 0x0007, 0x00c0, 0x92e5, 0xa280, 0x0004, 0x2004,
-	0xa005, 0x0040, 0x92e5, 0x057e, 0x7510, 0x7614, 0x1078, 0x9f46,
-	0x057f, 0x0c7f, 0x0d7f, 0x0e7f, 0x007c, 0x6007, 0x003b, 0x602b,
-	0x0009, 0x6013, 0x2a00, 0x6003, 0x0001, 0x1078, 0x5bf8, 0x0078,
-	0x92e1, 0x6007, 0x003b, 0x602b, 0x0009, 0x6013, 0x1700, 0x6003,
-	0x0001, 0x1078, 0x5bf8, 0x0078, 0x92e1, 0x6007, 0x003b, 0x602b,
-	0x000b, 0x6013, 0x0000, 0x0078, 0x925d, 0x0e7e, 0x027e, 0x1078,
-	0x4897, 0x0040, 0x933a, 0x1078, 0x4887, 0x1078, 0xa148, 0x00c0,
-	0x9338, 0x2071, 0xa300, 0x70c8, 0xc085, 0x70ca, 0x0f7e, 0x2079,
-	0x0100, 0x7294, 0xa284, 0x00ff, 0x706a, 0x78e6, 0xa284, 0xff00,
-	0x726c, 0xa205, 0x706e, 0x78ea, 0x0f7f, 0x70d3, 0x0000, 0x2001,
-	0xa352, 0x2004, 0xd0a4, 0x0040, 0x9331, 0x2011, 0xa5c4, 0x2013,
-	0x07d0, 0xd0ac, 0x00c0, 0x933a, 0x1078, 0x260d, 0x0078, 0x933a,
-	0x1078, 0xa178, 0x027f, 0x0e7f, 0x1078, 0x753d, 0x0078, 0x9199,
-	0x1078, 0x753d, 0x007c, 0x0d7e, 0x067e, 0x6618, 0x2668, 0x6e04,
-	0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006, 0x0040, 0x9360, 0xa686,
-	0x0004, 0x0040, 0x9360, 0x6e04, 0xa6b4, 0x00ff, 0xa686, 0x0006,
-	0x0040, 0x9360, 0xa686, 0x0004, 0x0040, 0x9360, 0xa085, 0x0001,
-	0x067f, 0x0d7f, 0x007c, 0x0d7e, 0x1078, 0x9397, 0x0d7f, 0x007c,
-	0x0d7e, 0x1078, 0x93a6, 0x00c0, 0x9390, 0x680c, 0xa08c, 0xff00,
-	0x6820, 0xa084, 0x00ff, 0xa115, 0x6212, 0x6824, 0x602a, 0xd1e4,
-	0x0040, 0x937e, 0x2009, 0x0001, 0x0078, 0x938c, 0xd1ec, 0x0040,
-	0x9390, 0x6920, 0xa18c, 0x00ff, 0x6824, 0x1078, 0x24e3, 0x00c0,
-	0x9390, 0x2110, 0x2009, 0x0000, 0x1078, 0x285b, 0x0078, 0x9394,
-	0xa085, 0x0001, 0x0078, 0x9395, 0xa006, 0x0d7f, 0x007c, 0x2069,
-	0xa88d, 0x6800, 0xa082, 0x0010, 0x00c8, 0x93a4, 0x6013, 0x0000,
-	0xa085, 0x0001, 0x0078, 0x93a5, 0xa006, 0x007c, 0x6013, 0x0000,
-	0x2069, 0xa88c, 0x6808, 0xa084, 0xff00, 0xa086, 0x0800, 0x00c0,
-	0x93ba, 0x6800, 0xa084, 0x00ff, 0xa08e, 0x0014, 0x0040, 0x93ba,
-	0xa08e, 0x0010, 0x007c, 0x6004, 0xa0b2, 0x0044, 0x10c8, 0x1328,
-	0xa1b6, 0x0013, 0x00c0, 0x93c7, 0x2008, 0x0079, 0x93da, 0xa1b6,
-	0x0027, 0x0040, 0x93cf, 0xa1b6, 0x0014, 0x10c0, 0x1328, 0x2001,
-	0x0007, 0x1078, 0x4472, 0x1078, 0x6010, 0x1078, 0x8c01, 0x1078,
-	0x6109, 0x007c, 0x941a, 0x941c, 0x941a, 0x941a, 0x941a, 0x941c,
-	0x9424, 0x94ae, 0x9471, 0x94ae, 0x9485, 0x94ae, 0x9424, 0x94ae,
-	0x94a6, 0x94ae, 0x94a6, 0x94ae, 0x94ae, 0x941a, 0x941a, 0x941a,
-	0x941a, 0x941a, 0x941a, 0x941a, 0x941a, 0x941a, 0x941a, 0x941a,
-	0x941c, 0x941a, 0x94ae, 0x941a, 0x941a, 0x94ae, 0x941a, 0x94ae,
-	0x94ae, 0x941a, 0x941a, 0x941a, 0x941a, 0x94ae, 0x94ae, 0x941a,
-	0x94ae, 0x94ae, 0x941a, 0x941a, 0x941a, 0x941a, 0x941a, 0x941c,
-	0x94ae, 0x94ae, 0x941a, 0x941a, 0x94ae, 0x94ae, 0x941a, 0x941a,
-	0x941a, 0x941a, 0x1078, 0x1328, 0x1078, 0x6010, 0x6003, 0x0002,
-	0x1078, 0x6109, 0x0078, 0x94b4, 0x0f7e, 0x2079, 0xa351, 0x7804,
-	0x0f7f, 0xd0ac, 0x00c0, 0x94ae, 0x2001, 0x0000, 0x1078, 0x442b,
-	0x6018, 0xa080, 0x0004, 0x2004, 0xa086, 0x00ff, 0x0040, 0x94ae,
-	0x0c7e, 0x6018, 0x2060, 0x6000, 0xd0f4, 0x00c0, 0x9448, 0x6010,
-	0xa005, 0x0040, 0x9448, 0x0c7f, 0x1078, 0x35f7, 0x0078, 0x94ae,
-	0x0c7f, 0x2001, 0xa300, 0x2004, 0xa086, 0x0002, 0x00c0, 0x9457,
-	0x0f7e, 0x2079, 0xa300, 0x788c, 0x8000, 0x788e, 0x0f7f, 0x2001,
-	0x0002, 0x1078, 0x443f, 0x1078, 0x6010, 0x601f, 0x0001, 0x6003,
-	0x0001, 0x6007, 0x0002, 0x1078, 0x5c45, 0x1078, 0x6109, 0x0c7e,
-	0x6118, 0x2160, 0x2009, 0x0001, 0x1078, 0x58e1, 0x0c7f, 0x0078,
-	0x94b4, 0x6618, 0x0d7e, 0x2668, 0x6e04, 0x0d7f, 0xa6b4, 0xff00,
-	0x8637, 0xa686, 0x0006, 0x0040, 0x94ae, 0xa686, 0x0004, 0x0040,
-	0x94ae, 0x2001, 0x0004, 0x0078, 0x94ac, 0x2001, 0xa300, 0x2004,
-	0xa086, 0x0003, 0x00c0, 0x948e, 0x1078, 0x35f7, 0x2001, 0x0006,
-	0x1078, 0x94b5, 0x6618, 0x0d7e, 0x2668, 0x6e04, 0x0d7f, 0xa6b4,
-	0xff00, 0x8637, 0xa686, 0x0006, 0x0040, 0x94ae, 0x2001, 0x0006,
-	0x0078, 0x94ac, 0x2001, 0x0004, 0x0078, 0x94ac, 0x2001, 0x0006,
-	0x1078, 0x94b5, 0x0078, 0x94ae, 0x1078, 0x4472, 0x1078, 0x6010,
-	0x1078, 0x753d, 0x1078, 0x6109, 0x007c, 0x017e, 0x0d7e, 0x6118,
-	0x2168, 0x6900, 0xd184, 0x0040, 0x94d0, 0x6104, 0xa18e, 0x000a,
-	0x00c0, 0x94c8, 0x699c, 0xd1a4, 0x00c0, 0x94c8, 0x2001, 0x0007,
-	0x1078, 0x443f, 0x2001, 0x0000, 0x1078, 0x442b, 0x1078, 0x2839,
-	0x0d7f, 0x017f, 0x007c, 0x0d7e, 0x6618, 0x2668, 0x6804, 0xa084,
-	0xff00, 0x8007, 0x0d7f, 0xa0b2, 0x000c, 0x10c8, 0x1328, 0xa1b6,
-	0x0015, 0x00c0, 0x94e7, 0x1079, 0x94ee, 0x0078, 0x94ed, 0xa1b6,
-	0x0016, 0x10c0, 0x1328, 0x1079, 0x94fa, 0x007c, 0x7ad0, 0x7ad0,
-	0x7ad0, 0x7ad0, 0x7ad0, 0x7ad0, 0x9547, 0x9506, 0x7ad0, 0x7ad0,
-	0x7ad0, 0x7ad0, 0x7ad0, 0x7ad0, 0x7ad0, 0x7ad0, 0x7ad0, 0x7ad0,
-	0x9547, 0x954f, 0x7ad0, 0x7ad0, 0x7ad0, 0x7ad0, 0x0f7e, 0x2079,
-	0xa351, 0x7804, 0xd0ac, 0x00c0, 0x952d, 0x6018, 0xa07d, 0x0040,
-	0x952d, 0x7800, 0xd0f4, 0x00c0, 0x9519, 0x7810, 0xa005, 0x00c0,
-	0x952d, 0x2001, 0x0000, 0x1078, 0x442b, 0x2001, 0x0002, 0x1078,
-	0x443f, 0x601f, 0x0001, 0x6003, 0x0001, 0x6007, 0x0002, 0x1078,
-	0x5c45, 0x1078, 0x6109, 0x0078, 0x9545, 0x2011, 0xa883, 0x2204,
-	0x8211, 0x220c, 0x1078, 0x24e3, 0x00c0, 0x9545, 0x0c7e, 0x1078,
-	0x4501, 0x0040, 0x9540, 0x0c7f, 0x1078, 0x753d, 0x0078, 0x9545,
-	0x1078, 0x4235, 0x0c7f, 0x1078, 0x753d, 0x0f7f, 0x007c, 0x6604,
-	0xa6b6, 0x001e, 0x00c0, 0x954e, 0x1078, 0x753d, 0x007c, 0x1078,
-	0x7d0a, 0x00c0, 0x955b, 0x6003, 0x0001, 0x6007, 0x0001, 0x1078,
-	0x5c45, 0x0078, 0x955d, 0x1078, 0x753d, 0x007c, 0x6004, 0xa08a,
-	0x0044, 0x10c8, 0x1328, 0x1078, 0x6010, 0x1078, 0x8c01, 0x1078,
-	0x6109, 0x007c, 0xa182, 0x0040, 0x0079, 0x956e, 0x9581, 0x9581,
-	0x9581, 0x9581, 0x9583, 0x9581, 0x9581, 0x9581, 0x9581, 0x9581,
-	0x9581, 0x9581, 0x9581, 0x9581, 0x9581, 0x9581, 0x9581, 0x9581,
-	0x9581, 0x1078, 0x1328, 0x0d7e, 0x0e7e, 0x0f7e, 0x157e, 0x047e,
-	0x027e, 0x6218, 0xa280, 0x002b, 0x2004, 0xa005, 0x0040, 0x9594,
-	0x2021, 0x0000, 0x1078, 0xa111, 0x6106, 0x2071, 0xa880, 0x7444,
-	0xa4a4, 0xff00, 0x0040, 0x95eb, 0xa486, 0x2000, 0x00c0, 0x95a6,
-	0x2009, 0x0001, 0x2011, 0x0200, 0x1078, 0x5a6d, 0x1078, 0x1381,
-	0x1040, 0x1328, 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, 0x4982,
-	0x017f, 0xa486, 0x2000, 0x00c0, 0x95d3, 0x2019, 0x0017, 0x1078,
-	0x9e3b, 0x0078, 0x9645, 0xa486, 0x0400, 0x00c0, 0x95dd, 0x2019,
-	0x0002, 0x1078, 0x9dec, 0x0078, 0x9645, 0xa486, 0x0200, 0x00c0,
-	0x95e3, 0x1078, 0x9dd1, 0xa486, 0x1000, 0x00c0, 0x95e9, 0x1078,
-	0x9e20, 0x0078, 0x9645, 0x2069, 0xa62d, 0x6a00, 0xd284, 0x0040,
-	0x969b, 0xa284, 0x0300, 0x00c0, 0x9693, 0x6804, 0xa005, 0x0040,
-	0x9683, 0x2d78, 0x6003, 0x0007, 0x1078, 0x1366, 0x0040, 0x964c,
-	0x7800, 0xd08c, 0x00c0, 0x9607, 0x7804, 0x8001, 0x7806, 0x6013,
-	0x0000, 0x6803, 0x0000, 0x6837, 0x0116, 0x683b, 0x0000, 0x6008,
-	0x68b2, 0x2c00, 0x684a, 0x6018, 0x2078, 0x78a0, 0x8007, 0x7130,
-	0x6986, 0x6846, 0x6853, 0x003d, 0x7244, 0xa294, 0x0003, 0xa286,
-	0x0002, 0x00c0, 0x9627, 0x684f, 0x0040, 0x0078, 0x9631, 0xa286,
-	0x0001, 0x00c0, 0x962f, 0x684f, 0x0080, 0x0078, 0x9631, 0x684f,
-	0x0000, 0x20a9, 0x000a, 0x2001, 0xa890, 0xad90, 0x0015, 0x200c,
-	0x810f, 0x2112, 0x8000, 0x8210, 0x00f0, 0x9637, 0x200c, 0x6982,
-	0x8000, 0x200c, 0x697e, 0x1078, 0x4982, 0x027f, 0x047f, 0x157f,
-	0x0f7f, 0x0e7f, 0x0d7f, 0x007c, 0x6013, 0x0100, 0x6003, 0x0001,
-	0x6007, 0x0041, 0x1078, 0x5bf8, 0x1078, 0x6109, 0x0078, 0x9645,
-	0x2069, 0xa892, 0x2d04, 0xa084, 0xff00, 0xa086, 0x1200, 0x00c0,
-	0x9677, 0x2069, 0xa880, 0x686c, 0xa084, 0x00ff, 0x017e, 0x6110,
-	0xa18c, 0x0700, 0xa10d, 0x6112, 0x017f, 0x6003, 0x0001, 0x6007,
-	0x0043, 0x1078, 0x5bf8, 0x1078, 0x6109, 0x0078, 0x9645, 0x6013,
-	0x0200, 0x6003, 0x0001, 0x6007, 0x0041, 0x1078, 0x5bf8, 0x1078,
-	0x6109, 0x0078, 0x9645, 0x6013, 0x0300, 0x0078, 0x9689, 0x6013,
-	0x0100, 0x6003, 0x0001, 0x6007, 0x0041, 0x1078, 0x5bf8, 0x1078,
-	0x6109, 0x0078, 0x9645, 0x6013, 0x0500, 0x0078, 0x9689, 0x6013,
-	0x0600, 0x0078, 0x9658, 0x6013, 0x0200, 0x0078, 0x9658, 0xa186,
-	0x0013, 0x00c0, 0x96b1, 0x6004, 0xa08a, 0x0040, 0x1048, 0x1328,
-	0xa08a, 0x0053, 0x10c8, 0x1328, 0xa082, 0x0040, 0x2008, 0x0079,
-	0x9725, 0xa186, 0x0051, 0x0040, 0x96be, 0xa186, 0x0047, 0x00c0,
-	0x96d7, 0x6004, 0xa086, 0x0041, 0x0040, 0x96e5, 0x2001, 0x0109,
-	0x2004, 0xd084, 0x0040, 0x96e5, 0x127e, 0x2091, 0x2200, 0x007e,
-	0x017e, 0x027e, 0x1078, 0x5ad2, 0x027f, 0x017f, 0x007f, 0x127f,
-	0x6000, 0xa086, 0x0002, 0x00c0, 0x96e5, 0x0078, 0x976a, 0xa186,
-	0x0027, 0x0040, 0x96df, 0xa186, 0x0014, 0x10c0, 0x1328, 0x6004,
-	0xa082, 0x0040, 0x2008, 0x0079, 0x96e8, 0x1078, 0x7583, 0x007c,
-	0x96fb, 0x96fd, 0x96fd, 0x96fb, 0x96fb, 0x96fb, 0x96fb, 0x96fb,
-	0x96fb, 0x96fb, 0x96fb, 0x96fb, 0x96fb, 0x96fb, 0x96fb, 0x96fb,
-	0x96fb, 0x96fb, 0x96fb, 0x1078, 0x1328, 0x1078, 0x6010, 0x1078,
-	0x6109, 0x037e, 0x0d7e, 0x6010, 0xa06d, 0x0040, 0x9722, 0xad84,
-	0xf000, 0x0040, 0x9722, 0x6003, 0x0002, 0x6018, 0x2004, 0xd0bc,
-	0x00c0, 0x9722, 0x2019, 0x0004, 0x1078, 0x9e70, 0x6013, 0x0000,
-	0x6014, 0xa005, 0x00c0, 0x9720, 0x2001, 0xa5a1, 0x2004, 0x6016,
-	0x6003, 0x0007, 0x0d7f, 0x037f, 0x007c, 0x9738, 0x9757, 0x9741,
-	0x9764, 0x9738, 0x9738, 0x9738, 0x9738, 0x9738, 0x9738, 0x9738,
-	0x9738, 0x9738, 0x9738, 0x9738, 0x9738, 0x9738, 0x9738, 0x9738,
-	0x1078, 0x1328, 0x6010, 0xa088, 0x0013, 0x2104, 0xa085, 0x0400,
-	0x200a, 0x1078, 0x6010, 0x6010, 0xa080, 0x0013, 0x2004, 0xd0b4,
-	0x0040, 0x9752, 0x6003, 0x0007, 0x2009, 0x0043, 0x1078, 0x756c,
-	0x0078, 0x9754, 0x6003, 0x0002, 0x1078, 0x6109, 0x007c, 0x1078,
-	0x6010, 0x1078, 0xa0c6, 0x00c0, 0x9761, 0x1078, 0x5a41, 0x1078,
-	0x753d, 0x1078, 0x6109, 0x007c, 0x1078, 0x6010, 0x2009, 0x0041,
-	0x0078, 0x98c1, 0xa182, 0x0040, 0x0079, 0x976e, 0x9781, 0x9783,
-	0x9781, 0x9781, 0x9781, 0x9781, 0x9781, 0x9784, 0x9781, 0x9781,
-	0x9781, 0x9781, 0x9781, 0x9781, 0x9781, 0x9781, 0x9781, 0x978f,
-	0x9781, 0x1078, 0x1328, 0x007c, 0x6003, 0x0004, 0x6110, 0x20e1,
-	0x0005, 0x3d18, 0x3e20, 0x2c10, 0x1078, 0x15ec, 0x007c, 0x0d7e,
-	0x1078, 0x5a41, 0x0d7f, 0x1078, 0xa134, 0x1078, 0x753d, 0x007c,
-	0xa182, 0x0040, 0x0079, 0x979c, 0x97af, 0x97af, 0x97af, 0x97af,
-	0x97af, 0x97af, 0x97af, 0x97b1, 0x97af, 0x97b4, 0x97df, 0x97af,
-	0x97af, 0x97af, 0x97af, 0x97df, 0x97af, 0x97af, 0x97af, 0x1078,
-	0x1328, 0x1078, 0x7583, 0x007c, 0x1078, 0x60b8, 0x1078, 0x61d3,
-	0x6010, 0x0d7e, 0x2068, 0x684c, 0xd0fc, 0x0040, 0x97ca, 0xa08c,
-	0x0003, 0xa18e, 0x0002, 0x0040, 0x97d2, 0x2009, 0x0041, 0x0d7f,
-	0x0078, 0x98c1, 0x6003, 0x0007, 0x6017, 0x0000, 0x1078, 0x5a41,
-	0x0d7f, 0x007c, 0x1078, 0xa0c6, 0x0040, 0x97d8, 0x0d7f, 0x007c,
-	0x1078, 0x5a41, 0x1078, 0x753d, 0x0d7f, 0x0078, 0x97d1, 0x037e,
-	0x1078, 0x60b8, 0x1078, 0x61d3, 0x6010, 0x0d7e, 0x2068, 0x6018,
-	0x2004, 0xd0bc, 0x0040, 0x97ff, 0x684c, 0xa084, 0x0003, 0xa086,
-	0x0002, 0x0040, 0x97fb, 0x687c, 0x632c, 0xa31a, 0x632e, 0x6880,
-	0x6328, 0xa31b, 0x632a, 0x6003, 0x0002, 0x0078, 0x9810, 0x2019,
-	0x0004, 0x1078, 0x9e70, 0x6014, 0xa005, 0x00c0, 0x980c, 0x2001,
-	0xa5a1, 0x2004, 0x8003, 0x6016, 0x6013, 0x0000, 0x6003, 0x0007,
-	0x0d7f, 0x037f, 0x007c, 0xa186, 0x0013, 0x00c0, 0x9821, 0x6004,
-	0xa086, 0x0042, 0x10c0, 0x1328, 0x1078, 0x6010, 0x1078, 0x6109,
-	0x007c, 0xa186, 0x0027, 0x0040, 0x9829, 0xa186, 0x0014, 0x00c0,
-	0x9839, 0x6004, 0xa086, 0x0042, 0x10c0, 0x1328, 0x2001, 0x0007,
-	0x1078, 0x4472, 0x1078, 0x6010, 0x1078, 0x8c01, 0x1078, 0x6109,
-	0x007c, 0xa182, 0x0040, 0x0079, 0x983d, 0x9850, 0x9850, 0x9850,
-	0x9850, 0x9850, 0x9850, 0x9850, 0x9852, 0x985e, 0x9850, 0x9850,
-	0x9850, 0x9850, 0x9850, 0x9850, 0x9850, 0x9850, 0x9850, 0x9850,
-	0x1078, 0x1328, 0x037e, 0x047e, 0x20e1, 0x0005, 0x3d18, 0x3e20,
-	0x2c10, 0x1078, 0x15ec, 0x047f, 0x037f, 0x007c, 0x6010, 0x0d7e,
-	0x2068, 0x6810, 0x6a14, 0x6118, 0x210c, 0xd1bc, 0x0040, 0x987d,
-	0x6124, 0xd1f4, 0x00c0, 0x987d, 0x007e, 0x047e, 0x057e, 0x6c7c,
-	0xa422, 0x6d80, 0x2200, 0xa52b, 0x602c, 0xa420, 0x642e, 0x6028,
-	0xa529, 0x652a, 0x057f, 0x047f, 0x007f, 0xa20d, 0x00c0, 0x9891,
-	0x684c, 0xd0fc, 0x0040, 0x9889, 0x2009, 0x0041, 0x0d7f, 0x0078,
-	0x98c1, 0x6003, 0x0007, 0x6017, 0x0000, 0x1078, 0x5a41, 0x0d7f,
-	0x007c, 0x007e, 0x0f7e, 0x2c78, 0x1078, 0x4893, 0x0f7f, 0x007f,
-	0x0040, 0x989e, 0x6003, 0x0002, 0x0d7f, 0x007c, 0x2009, 0xa30d,
-	0x210c, 0xd19c, 0x0040, 0x98a8, 0x6003, 0x0007, 0x0078, 0x98aa,
-	0x6003, 0x0006, 0x1078, 0x98b0, 0x1078, 0x5a43, 0x0d7f, 0x007c,
-	0xd2fc, 0x0040, 0x98bc, 0x8002, 0x8000, 0x8212, 0xa291, 0x0000,
-	0x2009, 0x0009, 0x0078, 0x98be, 0x2009, 0x0015, 0x6a6a, 0x6866,
-	0x007c, 0xa182, 0x0040, 0x0048, 0x98c7, 0x0079, 0x98d4, 0xa186,
-	0x0013, 0x0040, 0x98cf, 0xa186, 0x0014, 0x10c0, 0x1328, 0x6024,
-	0xd0dc, 0x1040, 0x1328, 0x007c, 0x98e7, 0x98ee, 0x98fa, 0x9906,
-	0x98e7, 0x98e7, 0x98e7, 0x9915, 0x98e7, 0x98e9, 0x98e9, 0x98e7,
-	0x98e7, 0x98e7, 0x98e7, 0x98e7, 0x98e7, 0x98e7, 0x98e7, 0x1078,
-	0x1328, 0x6024, 0xd0dc, 0x1040, 0x1328, 0x007c, 0x6003, 0x0001,
-	0x6106, 0x1078, 0x5bf8, 0x127e, 0x2091, 0x8000, 0x1078, 0x6109,
-	0x127f, 0x007c, 0x6003, 0x0001, 0x6106, 0x1078, 0x5bf8, 0x127e,
-	0x2091, 0x8000, 0x1078, 0x6109, 0x127f, 0x007c, 0x6003, 0x0003,
-	0x6106, 0x2c10, 0x1078, 0x1cab, 0x127e, 0x2091, 0x8000, 0x1078,
-	0x5c64, 0x1078, 0x61d3, 0x127f, 0x007c, 0xa016, 0x1078, 0x15ec,
-	0x007c, 0x127e, 0x2091, 0x8000, 0x037e, 0x0d7e, 0xa182, 0x0040,
-	0x1079, 0x9926, 0x0d7f, 0x037f, 0x127f, 0x007c, 0x9936, 0x9938,
-	0x994d, 0x996c, 0x9936, 0x9936, 0x9936, 0x9984, 0x9936, 0x9936,
-	0x9936, 0x9936, 0x9936, 0x9936, 0x9936, 0x9936, 0x1078, 0x1328,
-	0x6010, 0x2068, 0x684c, 0xd0fc, 0x0040, 0x9962, 0xa09c, 0x0003,
-	0xa39e, 0x0003, 0x0040, 0x9962, 0x6003, 0x0001, 0x6106, 0x1078,
-	0x5bf8, 0x1078, 0x6109, 0x0078, 0x9987, 0x6010, 0x2068, 0x684c,
-	0xd0fc, 0x0040, 0x9962, 0xa09c, 0x0003, 0xa39e, 0x0003, 0x0040,
-	0x9962, 0x6003, 0x0001, 0x6106, 0x1078, 0x5bf8, 0x1078, 0x6109,
-	0x0078, 0x9987, 0x6013, 0x0000, 0x6017, 0x0000, 0x2019, 0x0004,
-	0x1078, 0x9e70, 0x0078, 0x9987, 0x6010, 0x2068, 0x684c, 0xd0fc,
-	0x0040, 0x9962, 0xa09c, 0x0003, 0xa39e, 0x0003, 0x0040, 0x9962,
-	0x6003, 0x0003, 0x6106, 0x2c10, 0x1078, 0x1cab, 0x1078, 0x5c64,
-	0x1078, 0x61d3, 0x0078, 0x9987, 0xa016, 0x1078, 0x15ec, 0x007c,
-	0x1078, 0x6010, 0x6110, 0x81ff, 0x0040, 0x9999, 0x0d7e, 0x2168,
-	0x1078, 0xa181, 0x037e, 0x2019, 0x0029, 0x1078, 0x9e70, 0x037f,
-	0x0d7f, 0x1078, 0x8c01, 0x1078, 0x6109, 0x007c, 0x1078, 0x60b8,
-	0x6110, 0x81ff, 0x0040, 0x99af, 0x0d7e, 0x2168, 0x1078, 0xa181,
-	0x037e, 0x2019, 0x0029, 0x1078, 0x9e70, 0x037f, 0x0d7f, 0x1078,
-	0x8c01, 0x1078, 0x61d3, 0x007c, 0xa182, 0x0085, 0x0079, 0x99b8,
-	0x99c1, 0x99bf, 0x99bf, 0x99cd, 0x99bf, 0x99bf, 0x99bf, 0x1078,
-	0x1328, 0x6003, 0x000b, 0x6106, 0x1078, 0x5bf8, 0x127e, 0x2091,
-	0x8000, 0x1078, 0x6109, 0x127f, 0x007c, 0x027e, 0x0e7e, 0x1078,
-	0xa0bf, 0x0040, 0x99d7, 0x1078, 0x753d, 0x0078, 0x99f3, 0x2071,
-	0xa880, 0x7224, 0x6212, 0x7220, 0x1078, 0x9d10, 0x0040, 0x99e4,
-	0x6007, 0x0086, 0x0078, 0x99ed, 0x6007, 0x0087, 0x7224, 0xa296,
-	0xffff, 0x00c0, 0x99ed, 0x6007, 0x0086, 0x6003, 0x0001, 0x1078,
-	0x5bf8, 0x1078, 0x6109, 0x0e7f, 0x027f, 0x007c, 0xa186, 0x0013,
-	0x00c0, 0x9a07, 0x6004, 0xa08a, 0x0085, 0x1048, 0x1328, 0xa08a,
-	0x008c, 0x10c8, 0x1328, 0xa082, 0x0085, 0x0079, 0x9a1e, 0xa186,
-	0x0027, 0x0040, 0x9a13, 0xa186, 0x0014, 0x0040, 0x9a13, 0x1078,
-	0x7583, 0x0078, 0x9a1d, 0x2001, 0x0007, 0x1078, 0x4472, 0x1078,
-	0x6010, 0x1078, 0x8c01, 0x1078, 0x6109, 0x007c, 0x9a25, 0x9a27,
-	0x9a27, 0x9a25, 0x9a25, 0x9a25, 0x9a25, 0x1078, 0x1328, 0x1078,
-	0x6010, 0x1078, 0x8c01, 0x1078, 0x6109, 0x007c, 0xa182, 0x0085,
-	0x1048, 0x1328, 0xa182, 0x008c, 0x10c8, 0x1328, 0xa182, 0x0085,
-	0x0079, 0x9a3a, 0x9a41, 0x9a41, 0x9a41, 0x9a43, 0x9a41, 0x9a41,
-	0x9a41, 0x1078, 0x1328, 0x007c, 0xa186, 0x0013, 0x0040, 0x9a54,
-	0xa186, 0x0014, 0x0040, 0x9a54, 0xa186, 0x0027, 0x0040, 0x9a54,
-	0x1078, 0x7583, 0x0078, 0x9a5a, 0x1078, 0x6010, 0x1078, 0x8c01,
-	0x1078, 0x6109, 0x007c, 0x037e, 0x1078, 0xa134, 0x603f, 0x0000,
-	0x2019, 0x000b, 0x1078, 0x9a6a, 0x601f, 0x0006, 0x6003, 0x0007,
-	0x037f, 0x007c, 0x127e, 0x037e, 0x2091, 0x8000, 0x087e, 0x2c40,
-	0x097e, 0x2049, 0x0000, 0x1078, 0x7058, 0x097f, 0x087f, 0x00c0,
-	0x9aa5, 0x077e, 0x2c38, 0x1078, 0x7105, 0x077f, 0x00c0, 0x9aa5,
-	0x6000, 0xa086, 0x0000, 0x0040, 0x9aa5, 0x601c, 0xa086, 0x0007,
-	0x0040, 0x9aa5, 0x0d7e, 0x6000, 0xa086, 0x0004, 0x00c0, 0x9a96,
-	0x1078, 0xa134, 0x601f, 0x0007, 0x1078, 0x1749, 0x6010, 0x2068,
-	0x1078, 0x8a44, 0x0040, 0x9a9e, 0x1078, 0x9e70, 0x0d7f, 0x6013,
-	0x0000, 0x1078, 0xa134, 0x601f, 0x0007, 0x037f, 0x127f, 0x007c,
-	0x0f7e, 0x0c7e, 0x037e, 0x157e, 0x2079, 0xa880, 0x7938, 0x783c,
-	0x1078, 0x24e3, 0x00c0, 0x9af6, 0x017e, 0x0c7e, 0x1078, 0x4501,
-	0x00c0, 0x9af6, 0x2011, 0xa890, 0xac98, 0x000a, 0x20a9, 0x0004,
-	0x1078, 0x7e55, 0x00c0, 0x9af6, 0x017f, 0x027f, 0x027e, 0x017e,
-	0x2019, 0x0029, 0x1078, 0x71e0, 0x1078, 0x5d53, 0x077e, 0x2039,
-	0x0000, 0x1078, 0x5c78, 0x077f, 0x017f, 0x077e, 0x2039, 0x0000,
-	0x1078, 0x9c38, 0x077f, 0x1078, 0x471b, 0x027e, 0x6204, 0xa294,
-	0xff00, 0x8217, 0xa286, 0x0006, 0x0040, 0x9aea, 0xa286, 0x0004,
-	0x00c0, 0x9aed, 0x62a0, 0x1078, 0x28d5, 0x027f, 0x017f, 0x1078,
-	0x4235, 0x6612, 0x6516, 0xa006, 0x0078, 0x9af8, 0x0c7f, 0x017f,
-	0x157f, 0x037f, 0x0c7f, 0x0f7f, 0x007c, 0x0c7e, 0x0d7e, 0x0e7e,
-	0x017e, 0x2009, 0xa31f, 0x2104, 0xa086, 0x0074, 0x00c0, 0x9b60,
-	0x2069, 0xa88e, 0x690c, 0xa182, 0x0100, 0x0048, 0x9b50, 0x6908,
-	0xa184, 0x8000, 0x0040, 0x9b5c, 0x6018, 0x2070, 0x7010, 0xa084,
-	0x00ff, 0x0040, 0x9b1f, 0x7000, 0xd0f4, 0x0040, 0x9b23, 0xa184,
-	0x0800, 0x0040, 0x9b5c, 0x6910, 0xa18a, 0x0001, 0x0048, 0x9b54,
-	0x6914, 0x2069, 0xa8ae, 0x6904, 0x81ff, 0x00c0, 0x9b48, 0x690c,
-	0xa182, 0x0100, 0x0048, 0x9b50, 0x6908, 0x81ff, 0x00c0, 0x9b4c,
-	0x6910, 0xa18a, 0x0001, 0x0048, 0x9b54, 0x6918, 0xa18a, 0x0001,
-	0x0048, 0x9b5c, 0x0078, 0x9b66, 0x6013, 0x0100, 0x0078, 0x9b62,
-	0x6013, 0x0300, 0x0078, 0x9b62, 0x6013, 0x0500, 0x0078, 0x9b62,
-	0x6013, 0x0700, 0x0078, 0x9b62, 0x6013, 0x0900, 0x0078, 0x9b62,
-	0x6013, 0x0b00, 0x0078, 0x9b62, 0x6013, 0x0f00, 0x0078, 0x9b62,
-	0x6013, 0x2d00, 0xa085, 0x0001, 0x0078, 0x9b67, 0xa006, 0x017f,
-	0x0e7f, 0x0d7f, 0x0c7f, 0x007c, 0x0c7e, 0x0d7e, 0x027e, 0x037e,
-	0x157e, 0x6218, 0x2268, 0x6b04, 0xa394, 0x00ff, 0xa286, 0x0006,
-	0x0040, 0x9b90, 0xa286, 0x0004, 0x0040, 0x9b90, 0xa394, 0xff00,
-	0x8217, 0xa286, 0x0006, 0x0040, 0x9b90, 0xa286, 0x0004, 0x0040,
-	0x9b90, 0x0c7e, 0x2d60, 0x1078, 0x4513, 0x0c7f, 0x0078, 0x9bcb,
-	0x2011, 0xa896, 0xad98, 0x000a, 0x20a9, 0x0004, 0x1078, 0x7e55,
-	0x00c0, 0x9bcc, 0x2011, 0xa89a, 0xad98, 0x0006, 0x20a9, 0x0004,
-	0x1078, 0x7e55, 0x00c0, 0x9bcc, 0x047e, 0x017e, 0x6aa0, 0xa294,
-	0x00ff, 0x8227, 0xa006, 0x2009, 0xa352, 0x210c, 0xd1a4, 0x0040,
-	0x9bb8, 0x2009, 0x0029, 0x1078, 0x9ec0, 0x6800, 0xc0e5, 0x6802,
-	0x2019, 0x0029, 0x1078, 0x5d53, 0x077e, 0x2039, 0x0000, 0x1078,
-	0x5c78, 0x2c08, 0x1078, 0x9c38, 0x077f, 0x2001, 0x0007, 0x1078,
-	0x4472, 0x017f, 0x047f, 0xa006, 0x157f, 0x037f, 0x027f, 0x0d7f,
-	0x0c7f, 0x007c, 0x0d7e, 0x2069, 0xa88e, 0x6800, 0xa086, 0x0800,
-	0x0040, 0x9bde, 0x6013, 0x0000, 0x0078, 0x9bdf, 0xa006, 0x0d7f,
-	0x007c, 0x0c7e, 0x0f7e, 0x017e, 0x027e, 0x037e, 0x157e, 0x2079,
-	0xa88c, 0x7930, 0x7834, 0x1078, 0x24e3, 0x00c0, 0x9c05, 0x1078,
-	0x4501, 0x00c0, 0x9c05, 0x2011, 0xa890, 0xac98, 0x000a, 0x20a9,
-	0x0004, 0x1078, 0x7e55, 0x00c0, 0x9c05, 0x2011, 0xa894, 0xac98,
-	0x0006, 0x20a9, 0x0004, 0x1078, 0x7e55, 0x157f, 0x037f, 0x027f,
-	0x017f, 0x0f7f, 0x0c7f, 0x007c, 0x0c7e, 0x007e, 0x017e, 0x027e,
-	0x037e, 0x157e, 0x2011, 0xa883, 0x2204, 0x8211, 0x220c, 0x1078,
-	0x24e3, 0x00c0, 0x9c31, 0x1078, 0x4501, 0x00c0, 0x9c31, 0x2011,
-	0xa896, 0xac98, 0x000a, 0x20a9, 0x0004, 0x1078, 0x7e55, 0x00c0,
-	0x9c31, 0x2011, 0xa89a, 0xac98, 0x0006, 0x20a9, 0x0004, 0x1078,
-	0x7e55, 0x157f, 0x037f, 0x027f, 0x017f, 0x007f, 0x0c7f, 0x007c,
-	0x0e7e, 0x0c7e, 0x087e, 0x077e, 0x067e, 0x057e, 0x047e, 0x027e,
-	0x127e, 0x2091, 0x8000, 0x2740, 0x2029, 0xa5b4, 0x252c, 0x2021,
-	0xa5ba, 0x2424, 0x2061, 0xaa00, 0x2071, 0xa300, 0x7644, 0x7060,
-	0x81ff, 0x0040, 0x9c59, 0x8001, 0xa602, 0x00c8, 0x9cc3, 0x0078,
-	0x9c5c, 0xa606, 0x0040, 0x9cc3, 0x2100, 0xac06, 0x0040, 0x9cb9,
-	0x1078, 0x9ee5, 0x0040, 0x9cb9, 0x671c, 0xa786, 0x0001, 0x0040,
-	0x9cde, 0xa786, 0x0004, 0x0040, 0x9cde, 0xa786, 0x0007, 0x0040,
-	0x9cb9, 0x2500, 0xac06, 0x0040, 0x9cb9, 0x2400, 0xac06, 0x0040,
-	0x9cb9, 0x1078, 0x9ef9, 0x00c0, 0x9cb9, 0x88ff, 0x0040, 0x9c84,
-	0x6020, 0xa906, 0x00c0, 0x9cb9, 0x0d7e, 0x6000, 0xa086, 0x0004,
-	0x00c0, 0x9c8e, 0x017e, 0x1078, 0x1749, 0x017f, 0xa786, 0x0008,
-	0x00c0, 0x9c9d, 0x1078, 0x8c3b, 0x00c0, 0x9c9d, 0x1078, 0x7a05,
-	0x0d7f, 0x1078, 0x8c01, 0x0078, 0x9cb9, 0x6010, 0x2068, 0x1078,
-	0x8a44, 0x0040, 0x9cb6, 0xa786, 0x0003, 0x00c0, 0x9ccd, 0x6837,
-	0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0xa181, 0x017e, 0x1078,
-	0x8cb8, 0x1078, 0x4982, 0x017f, 0x1078, 0x8bf4, 0x0d7f, 0x1078,
-	0x8c01, 0xace0, 0x0010, 0x2001, 0xa315, 0x2004, 0xac02, 0x00c8,
-	0x9cc3, 0x0078, 0x9c4c, 0x127f, 0x027f, 0x047f, 0x057f, 0x067f,
-	0x077f, 0x087f, 0x0c7f, 0x0e7f, 0x007c, 0xa786, 0x0006, 0x00c0,
-	0x9ca7, 0xa386, 0x0005, 0x0040, 0x9cdb, 0x1078, 0xa181, 0x1078,
-	0x9e70, 0x0078, 0x9cb6, 0x0d7f, 0x0078, 0x9cb9, 0x1078, 0x9ef9,
-	0x00c0, 0x9cb9, 0x81ff, 0x0040, 0x9cb9, 0xa180, 0x0001, 0x2004,
-	0xa086, 0x0018, 0x0040, 0x9cf3, 0xa180, 0x0001, 0x2004, 0xa086,
-	0x002d, 0x00c0, 0x9cb9, 0x6000, 0xa086, 0x0002, 0x00c0, 0x9cb9,
-	0x1078, 0x8c27, 0x0040, 0x9d04, 0x1078, 0x8c3b, 0x00c0, 0x9cb9,
-	0x1078, 0x7a05, 0x0078, 0x9d0c, 0x1078, 0x2839, 0x1078, 0x8c3b,
-	0x00c0, 0x9d0c, 0x1078, 0x7a05, 0x1078, 0x8c01, 0x0078, 0x9cb9,
-	0x0c7e, 0x0e7e, 0x017e, 0x2c08, 0x2170, 0x1078, 0x9e8c, 0x017f,
-	0x0040, 0x9d1f, 0x601c, 0xa084, 0x000f, 0x1079, 0x9d22, 0x0e7f,
-	0x0c7f, 0x007c, 0x9d2a, 0x9d2a, 0x9d2a, 0x9d2a, 0x9d2a, 0x9d2a,
-	0x9d2c, 0x9d2a, 0xa006, 0x007c, 0x047e, 0x017e, 0x7018, 0xa080,
-	0x0028, 0x2024, 0xa4a4, 0x00ff, 0x8427, 0x2c00, 0x2009, 0x0020,
-	0x1078, 0x9ec0, 0x017f, 0x047f, 0x037e, 0x2019, 0x0002, 0x1078,
-	0x9a6a, 0x037f, 0xa085, 0x0001, 0x007c, 0x2001, 0x0001, 0x1078,
-	0x442b, 0x157e, 0x017e, 0x027e, 0x037e, 0x20a9, 0x0004, 0x2019,
-	0xa305, 0x2011, 0xa896, 0x1078, 0x7e55, 0x037f, 0x027f, 0x017f,
-	0x157f, 0xa005, 0x007c, 0x0f7e, 0x0e7e, 0x0c7e, 0x087e, 0x077e,
-	0x067e, 0x027e, 0x127e, 0x2091, 0x8000, 0x2740, 0x2061, 0xaa00,
-	0x2079, 0x0001, 0x8fff, 0x0040, 0x9dc3, 0x2071, 0xa300, 0x7644,
-	0x7060, 0x8001, 0xa602, 0x00c8, 0x9dc3, 0x88ff, 0x0040, 0x9d7e,
-	0x2800, 0xac06, 0x00c0, 0x9db9, 0x2079, 0x0000, 0x1078, 0x9ee5,
-	0x0040, 0x9db9, 0x2400, 0xac06, 0x0040, 0x9db9, 0x671c, 0xa786,
-	0x0006, 0x00c0, 0x9db9, 0xa786, 0x0007, 0x0040, 0x9db9, 0x88ff,
-	0x00c0, 0x9d9d, 0x6018, 0xa206, 0x00c0, 0x9db9, 0x85ff, 0x0040,
-	0x9d9d, 0x6020, 0xa106, 0x00c0, 0x9db9, 0x0d7e, 0x6000, 0xa086,
-	0x0004, 0x00c0, 0x9da9, 0x1078, 0xa134, 0x601f, 0x0007, 0x1078,
-	0x1749, 0x6010, 0x2068, 0x1078, 0x8a44, 0x0040, 0x9db3, 0x047e,
-	0x1078, 0x9e70, 0x047f, 0x0d7f, 0x1078, 0x8c01, 0x88ff, 0x00c0,
-	0x9dcd, 0xace0, 0x0010, 0x2001, 0xa315, 0x2004, 0xac02, 0x00c8,
-	0x9dc3, 0x0078, 0x9d6a, 0xa006, 0x127f, 0x027f, 0x067f, 0x077f,
-	0x087f, 0x0c7f, 0x0e7f, 0x0f7f, 0x007c, 0xa8c5, 0x0001, 0x0078,
-	0x9dc4, 0x077e, 0x057e, 0x087e, 0x2041, 0x0000, 0x2029, 0x0001,
-	0x2c20, 0x2019, 0x0002, 0x6218, 0x097e, 0x2049, 0x0000, 0x1078,
-	0x7058, 0x097f, 0x087f, 0x2039, 0x0000, 0x1078, 0x7105, 0x1078,
-	0x9d5b, 0x057f, 0x077f, 0x007c, 0x027e, 0x047e, 0x057e, 0x077e,
-	0x0c7e, 0x157e, 0x2c20, 0x2128, 0x20a9, 0x007f, 0x2009, 0x0000,
-	0x017e, 0x037e, 0x1078, 0x4501, 0x00c0, 0x9e14, 0x2c10, 0x057e,
-	0x087e, 0x2041, 0x0000, 0x2508, 0x2029, 0x0001, 0x097e, 0x2049,
-	0x0000, 0x1078, 0x7058, 0x097f, 0x087f, 0x2039, 0x0000, 0x1078,
-	0x7105, 0x1078, 0x9d5b, 0x057f, 0x037f, 0x017f, 0x8108, 0x00f0,
-	0x9df8, 0x157f, 0x0c7f, 0x077f, 0x057f, 0x047f, 0x027f, 0x007c,
-	0x077e, 0x057e, 0x6218, 0x087e, 0x2041, 0x0000, 0x2029, 0x0001,
-	0x2019, 0x0048, 0x097e, 0x2049, 0x0000, 0x1078, 0x7058, 0x097f,
-	0x087f, 0x2039, 0x0000, 0x1078, 0x7105, 0x2c20, 0x1078, 0x9d5b,
-	0x057f, 0x077f, 0x007c, 0x027e, 0x047e, 0x057e, 0x077e, 0x0c7e,
-	0x157e, 0x2c20, 0x20a9, 0x007f, 0x2009, 0x0000, 0x017e, 0x037e,
-	0x1078, 0x4501, 0x00c0, 0x9e64, 0x2c10, 0x087e, 0x2041, 0x0000,
-	0x2828, 0x047e, 0x2021, 0x0001, 0x1078, 0xa111, 0x047f, 0x097e,
-	0x2049, 0x0000, 0x1078, 0x7058, 0x097f, 0x087f, 0x2039, 0x0000,
-	0x1078, 0x7105, 0x1078, 0x9d5b, 0x037f, 0x017f, 0x8108, 0x00f0,
-	0x9e46, 0x157f, 0x0c7f, 0x077f, 0x057f, 0x047f, 0x027f, 0x007c,
-	0x017e, 0x0f7e, 0xad82, 0xca00, 0x0048, 0x9e89, 0xad82, 0xffff,
-	0x00c8, 0x9e89, 0x6800, 0xa07d, 0x0040, 0x9e86, 0x6803, 0x0000,
-	0x6b52, 0x1078, 0x4982, 0x2f68, 0x0078, 0x9e7a, 0x6b52, 0x1078,
-	0x4982, 0x0f7f, 0x017f, 0x007c, 0x0e7e, 0x047e, 0x037e, 0x2061,
-	0xaa00, 0x2071, 0xa300, 0x7444, 0x7060, 0x8001, 0xa402, 0x00c8,
-	0x9ebb, 0x2100, 0xac06, 0x0040, 0x9ead, 0x6000, 0xa086, 0x0000,
-	0x0040, 0x9ead, 0x6008, 0xa206, 0x00c0, 0x9ead, 0x6018, 0xa1a0,
-	0x0006, 0x2424, 0xa406, 0x0040, 0x9eb7, 0xace0, 0x0010, 0x2001,
-	0xa315, 0x2004, 0xac02, 0x00c8, 0x9ebb, 0x0078, 0x9e91, 0xa085,
-	0x0001, 0x0078, 0x9ebc, 0xa006, 0x037f, 0x047f, 0x0e7f, 0x007c,
-	0x0d7e, 0x007e, 0x1078, 0x1381, 0x007f, 0x1040, 0x1328, 0x6837,
-	0x010d, 0x685e, 0x027e, 0x2010, 0x1078, 0x8a30, 0x2001, 0x0000,
-	0x0040, 0x9ed6, 0x2200, 0xa080, 0x0008, 0x2004, 0x027f, 0x684a,
-	0x6956, 0x6c46, 0x684f, 0x0000, 0xa006, 0x68b2, 0x6802, 0x683a,
-	0x685a, 0x1078, 0x4982, 0x0d7f, 0x007c, 0x6700, 0xa786, 0x0000,
-	0x0040, 0x9ef8, 0xa786, 0x0001, 0x0040, 0x9ef8, 0xa786, 0x000a,
-	0x0040, 0x9ef8, 0xa786, 0x0009, 0x0040, 0x9ef8, 0xa085, 0x0001,
-	0x007c, 0x0e7e, 0x6018, 0x2070, 0x70a0, 0xa206, 0x0e7f, 0x007c,
-	0x017e, 0x6004, 0xa08e, 0x001e, 0x00c0, 0x9f1a, 0x8007, 0x6130,
-	0xa18c, 0x00ff, 0xa105, 0x6032, 0x6007, 0x0085, 0x6003, 0x000b,
-	0x601f, 0x0005, 0x2001, 0xa5a1, 0x2004, 0x6016, 0x1078, 0x5bf8,
-	0x1078, 0x6109, 0x017f, 0x007c, 0x0005, 0x0005, 0x007c, 0x6024,
-	0xd0e4, 0x0040, 0x9f30, 0xd0cc, 0x0040, 0x9f2a, 0x1078, 0x8cfa,
-	0x0078, 0x9f30, 0x1078, 0xa134, 0x1078, 0x5a41, 0x1078, 0x753d,
-	0x007c, 0xa280, 0x0007, 0x2004, 0xa084, 0x000f, 0x0079, 0x9f38,
-	0x9f41, 0x9f41, 0x9f41, 0x9f43, 0x9f41, 0x9f43, 0x9f43, 0x9f41,
-	0x9f43, 0xa006, 0x007c, 0xa085, 0x0001, 0x007c, 0xa280, 0x0007,
-	0x2004, 0xa084, 0x000f, 0x0079, 0x9f4d, 0x9f56, 0x9f56, 0x9f56,
-	0x9f56, 0x9f56, 0x9f56, 0x9f61, 0x9f56, 0x9f56, 0x6007, 0x003b,
-	0x602b, 0x0009, 0x6013, 0x2a00, 0x6003, 0x0001, 0x1078, 0x5bf8,
-	0x007c, 0x0c7e, 0x2260, 0x1078, 0xa134, 0x603f, 0x0000, 0x6024,
-	0xc0f4, 0xc0cc, 0x6026, 0x0c7f, 0x0d7e, 0x2268, 0xa186, 0x0007,
-	0x00c0, 0x9fc2, 0x6810, 0xa005, 0x0040, 0x9f7f, 0xa080, 0x0013,
-	0x2004, 0xd0fc, 0x00c0, 0x9f7f, 0x0d7f, 0x0078, 0x9f56, 0x6007,
-	0x003a, 0x6003, 0x0001, 0x1078, 0x5bf8, 0x1078, 0x6109, 0x0c7e,
-	0x2d60, 0x6100, 0xa186, 0x0002, 0x00c0, 0xa050, 0x6010, 0xa005,
-	0x00c0, 0x9f99, 0x6000, 0xa086, 0x0007, 0x10c0, 0x1328, 0x0078,
-	0xa050, 0xa08c, 0xf000, 0x00c0, 0x9fa5, 0x0078, 0x9fa5, 0x2068,
-	0x6800, 0xa005, 0x00c0, 0x9f9f, 0x2d00, 0xa080, 0x0013, 0x2004,
-	0xa084, 0x0003, 0xa086, 0x0002, 0x00c0, 0x9fbe, 0x6010, 0x2068,
-	0x684c, 0xc0dc, 0xc0f4, 0x684e, 0x6850, 0xc0f4, 0xc0fc, 0x6852,
-	0x2009, 0x0043, 0x1078, 0x98c1, 0x0078, 0xa050, 0x2009, 0x0041,
-	0x0078, 0xa04a, 0xa186, 0x0005, 0x00c0, 0xa009, 0x6810, 0xa080,
-	0x0013, 0x2004, 0xd0bc, 0x00c0, 0x9fd0, 0x0d7f, 0x0078, 0x9f56,
-	0xd0b4, 0x0040, 0x9fd8, 0xd0fc, 0x1040, 0x1328, 0x0078, 0x9f72,
-	0x6007, 0x003a, 0x6003, 0x0001, 0x1078, 0x5bf8, 0x1078, 0x6109,
-	0x0c7e, 0x2d60, 0x6100, 0xa186, 0x0002, 0x0040, 0x9feb, 0xa186,
-	0x0004, 0x00c0, 0xa050, 0x2071, 0xa5e1, 0x7000, 0xa086, 0x0003,
-	0x00c0, 0x9ff8, 0x7004, 0xac06, 0x00c0, 0x9ff8, 0x7003, 0x0000,
-	0x6810, 0xa080, 0x0013, 0x200c, 0xc1f4, 0xc1dc, 0x2102, 0x8000,
-	0x200c, 0xc1f4, 0xc1fc, 0xc1bc, 0x2102, 0x2009, 0x0042, 0x0078,
-	0xa04a, 0x037e, 0x0d7e, 0x0d7e, 0x1078, 0x1381, 0x037f, 0x1040,
-	0x1328, 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, 0x4982, 0x2019, 0x0045,
-	0x6008, 0x2068, 0x1078, 0x9a6a, 0x2d00, 0x600a, 0x601f, 0x0006,
-	0x6003, 0x0007, 0x6017, 0x0000, 0x603f, 0x0000, 0x0d7f, 0x037f,
-	0x0078, 0xa051, 0x603f, 0x0000, 0x6003, 0x0007, 0x1078, 0x98c1,
-	0x0c7f, 0x0d7f, 0x007c, 0xa186, 0x0013, 0x00c0, 0xa05d, 0x6004,
-	0xa082, 0x0085, 0x2008, 0x0079, 0xa077, 0xa186, 0x0027, 0x00c0,
-	0xa070, 0x1078, 0x6010, 0x037e, 0x0d7e, 0x6010, 0x2068, 0x2019,
-	0x0004, 0x1078, 0x9e70, 0x0d7f, 0x037f, 0x1078, 0x6109, 0x007c,
-	0xa186, 0x0014, 0x0040, 0xa061, 0x1078, 0x7583, 0x007c, 0xa080,
-	0xa07e, 0xa07e, 0xa07e, 0xa07e, 0xa07e, 0xa080, 0x1078, 0x1328,
-	0x1078, 0x6010, 0x6003, 0x000c, 0x1078, 0x6109, 0x007c, 0xa182,
-	0x008c, 0x00c8, 0xa091, 0xa182, 0x0085, 0x0048, 0xa091, 0x0079,
-	0xa094, 0x1078, 0x7583, 0x007c, 0xa09b, 0xa09b, 0xa09b, 0xa09b,
-	0xa09d, 0xa0bc, 0xa09b, 0x1078, 0x1328, 0x0d7e, 0x2c68, 0x1078,
-	0x74d7, 0x0040, 0xa0b7, 0x6003, 0x0001, 0x6007, 0x001e, 0x2009,
-	0xa88e, 0x210c, 0x6136, 0x2009, 0xa88f, 0x210c, 0x613a, 0x600b,
-	0xffff, 0x6918, 0x611a, 0x601f, 0x0004, 0x1078, 0x5bf8, 0x2d60,
-	0x1078, 0x753d, 0x0d7f, 0x007c, 0x1078, 0x753d, 0x007c, 0x0e7e,
-	0x6018, 0x2070, 0x7000, 0xd0ec, 0x0e7f, 0x007c, 0x6010, 0xa080,
-	0x0013, 0x200c, 0xd1ec, 0x0040, 0xa110, 0x2001, 0xa371, 0x2004,
-	0xd0ec, 0x0040, 0xa110, 0x6003, 0x0002, 0x6024, 0xc0e5, 0x6026,
-	0xd1ac, 0x0040, 0xa0ee, 0x0f7e, 0x2c78, 0x1078, 0x488f, 0x0f7f,
-	0x0040, 0xa0ee, 0x2001, 0xa5a2, 0x2004, 0x603e, 0x2009, 0xa371,
-	0x210c, 0xd1f4, 0x00c0, 0xa10e, 0x0078, 0xa100, 0x2009, 0xa371,
-	0x210c, 0xd1f4, 0x0040, 0xa0fa, 0x6024, 0xc0e4, 0x6026, 0xa006,
-	0x0078, 0xa110, 0x2001, 0xa5a2, 0x200c, 0x8103, 0xa100, 0x603e,
-	0x6018, 0xa088, 0x002b, 0x2104, 0xa005, 0x0040, 0xa10b, 0xa088,
-	0x0003, 0x0078, 0xa103, 0x2c0a, 0x600f, 0x0000, 0xa085, 0x0001,
-	0x007c, 0x017e, 0x0c7e, 0x0e7e, 0x6120, 0xa2f0, 0x002b, 0x2e04,
-	0x2060, 0x8cff, 0x0040, 0xa130, 0x84ff, 0x00c0, 0xa123, 0x6020,
-	0xa106, 0x00c0, 0xa12b, 0x600c, 0x2072, 0x1078, 0x5a41, 0x1078,
-	0x753d, 0x0078, 0xa12d, 0xacf0, 0x0003, 0x2e64, 0x0078, 0xa119,
-	0x0e7f, 0x0c7f, 0x017f, 0x007c, 0x0d7e, 0x6018, 0xa0e8, 0x002b,
-	0x2d04, 0xa005, 0x0040, 0xa146, 0xac06, 0x0040, 0xa144, 0x2d04,
-	0xa0e8, 0x0003, 0x0078, 0xa138, 0x600c, 0x206a, 0x0d7f, 0x007c,
-	0x027e, 0x037e, 0x157e, 0x2011, 0xa325, 0x2204, 0xa084, 0x00ff,
-	0x2019, 0xa88e, 0x2334, 0xa636, 0x00c0, 0xa174, 0x8318, 0x2334,
-	0x2204, 0xa084, 0xff00, 0xa636, 0x00c0, 0xa174, 0x2011, 0xa890,
-	0x6018, 0xa098, 0x000a, 0x20a9, 0x0004, 0x1078, 0x7e55, 0x00c0,
-	0xa174, 0x2011, 0xa894, 0x6018, 0xa098, 0x0006, 0x20a9, 0x0004,
-	0x1078, 0x7e55, 0x00c0, 0xa174, 0x157f, 0x037f, 0x027f, 0x007c,
-	0x0e7e, 0x2071, 0xa300, 0x1078, 0x41f5, 0x1078, 0x260d, 0x0e7f,
-	0x007c, 0x0e7e, 0x6018, 0x2070, 0x7000, 0xd0fc, 0x0040, 0xa18a,
-	0x1078, 0xa18c, 0x0e7f, 0x007c, 0x6850, 0xc0e5, 0x6852, 0x007c,
-	0x0e7e, 0x0c7e, 0x077e, 0x067e, 0x057e, 0x047e, 0x027e, 0x017e,
-	0x127e, 0x2091, 0x8000, 0x2029, 0xa5b4, 0x252c, 0x2021, 0xa5ba,
-	0x2424, 0x2061, 0xaa00, 0x2071, 0xa300, 0x7644, 0x7060, 0xa606,
-	0x0040, 0xa1e4, 0x671c, 0xa786, 0x0001, 0x0040, 0xa1b3, 0xa786,
-	0x0008, 0x00c0, 0xa1da, 0x2500, 0xac06, 0x0040, 0xa1da, 0x2400,
-	0xac06, 0x0040, 0xa1da, 0x1078, 0x9ee5, 0x0040, 0xa1da, 0x1078,
-	0x9ef9, 0x00c0, 0xa1da, 0x6000, 0xa086, 0x0004, 0x00c0, 0xa1cc,
-	0x017e, 0x1078, 0x1749, 0x017f, 0x1078, 0x8c27, 0x00c0, 0xa1d2,
-	0x1078, 0x2839, 0x1078, 0x8c3b, 0x00c0, 0xa1d8, 0x1078, 0x7a05,
-	0x1078, 0x8c01, 0xace0, 0x0010, 0x2001, 0xa315, 0x2004, 0xac02,
-	0x00c8, 0xa1e4, 0x0078, 0xa1a3, 0x127f, 0x017f, 0x027f, 0x047f,
-	0x057f, 0x067f, 0x077f, 0x0c7f, 0x0e7f, 0x007c, 0x127e, 0x007e,
-	0x0e7e, 0x2091, 0x8000, 0x2071, 0xa340, 0xd5a4, 0x0040, 0xa1fb,
-	0x7034, 0x8000, 0x7036, 0xd5b4, 0x0040, 0xa201, 0x7030, 0x8000,
-	0x7032, 0xd5ac, 0x0040, 0xa208, 0x2071, 0xa34a, 0x1078, 0xa237,
-	0x0e7f, 0x007f, 0x127f, 0x007c, 0x127e, 0x007e, 0x0e7e, 0x2091,
-	0x8000, 0x2071, 0xa340, 0xd5a4, 0x0040, 0xa219, 0x7034, 0x8000,
-	0x7036, 0xd5b4, 0x0040, 0xa21f, 0x7030, 0x8000, 0x7032, 0xd5ac,
-	0x0040, 0xa226, 0x2071, 0xa34a, 0x1078, 0xa237, 0x0e7f, 0x007f,
-	0x127f, 0x007c, 0x127e, 0x007e, 0x0e7e, 0x2091, 0x8000, 0x2071,
-	0xa342, 0x1078, 0xa237, 0x0e7f, 0x007f, 0x127f, 0x007c, 0x2e04,
-	0x8000, 0x2072, 0x00c8, 0xa240, 0x8e70, 0x2e04, 0x8000, 0x2072,
-	0x007c, 0x0e7e, 0x2071, 0xa340, 0x1078, 0xa237, 0x0e7f, 0x007c,
-	0x0e7e, 0x2071, 0xa344, 0x1078, 0xa237, 0x0e7f, 0x007c, 0x0001,
-	0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080, 0x0100,
-	0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000, 0x8000, 0x6286
-};
-
-/************************************************************************
- *									*
- *               --- ISP2200 Initiator/Target Firmware ---              *
- *             with Fabric (Public Loop), Point-point, and              *
- *             expanded LUN addressing for FCTAPE                       *
- *									*
- ************************************************************************
-  Copyright (C) 2000 and 2100 Qlogic Corporation 
-  (www.qlogic.com)
-
-  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.01.27 (11:07 Dec 18, 2000)
- */
-
-unsigned short risc_code_length2200 = 0x9cbf;
-unsigned short risc_code2200[] = { 
-	0x0470, 0x0000, 0x0000, 0x9cbf, 0x0000, 0x0002, 0x0001, 0x001b,
-	0x0017, 0x2043, 0x4f50, 0x5952, 0x4947, 0x4854, 0x2031, 0x3939,
-	0x3920, 0x514c, 0x4f47, 0x4943, 0x2043, 0x4f52, 0x504f, 0x5241,
-	0x5449, 0x4f4e, 0x2049, 0x5350, 0x3232, 0x3030, 0x2046, 0x6972,
-	0x6d77, 0x6172, 0x6520, 0x2056, 0x6572, 0x7369, 0x6f6e, 0x2030,
-	0x322e, 0x3031, 0x2e32, 0x3720, 0x2020, 0x2020, 0x2400, 0x20c1,
-	0x0005, 0x2001, 0x017f, 0x2003, 0x0000, 0x20c9, 0xb1ff, 0x2091,
-	0x2000, 0x2059, 0x0000, 0x2b78, 0x7823, 0x0004, 0x2089, 0x27b5,
-	0x2051, 0xad00, 0x2a70, 0x2029, 0xe400, 0x2031, 0xffff, 0x2039,
-	0xe3e9, 0x2021, 0x0200, 0x0804, 0x1449, 0x20a1, 0xacbf, 0xa00e,
-	0x20a9, 0x0741, 0x41a4, 0x3400, 0x755e, 0x7662, 0x775a, 0x7466,
-	0x746a, 0x20a1, 0xb400, 0x7160, 0x810d, 0x810d, 0x810d, 0x810d,
-	0xa18c, 0x000f, 0x2001, 0x000b, 0xa112, 0xa00e, 0x21a8, 0x41a4,
-	0x3400, 0x8211, 0x1dd8, 0x7160, 0x3400, 0xa102, 0x0120, 0x0218,
-	0x20a8, 0xa00e, 0x41a4, 0x3800, 0xd08c, 0x01d8, 0x2009, 0xad00,
-	0x810d, 0x810d, 0x810d, 0x810d, 0xa18c, 0x000f, 0x2001, 0x0001,
-	0xa112, 0x20a1, 0x1000, 0xa00e, 0x21a8, 0x41a4, 0x8211, 0x1de0,
-	0x2009, 0xad00, 0x3400, 0xa102, 0x0120, 0x0218, 0x20a8, 0xa00e,
-	0x41a4, 0x080c, 0x13fc, 0x080c, 0x1613, 0x080c, 0x17ac, 0x080c,
-	0x1e67, 0x080c, 0x492e, 0x080c, 0x801a, 0x080c, 0x159c, 0x080c,
-	0x2ce6, 0x080c, 0x5a01, 0x080c, 0x5045, 0x080c, 0x6487, 0x080c,
-	0x236a, 0x080c, 0x6686, 0x080c, 0x5fae, 0x080c, 0x226b, 0x080c,
-	0x2338, 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, 0x3c98, 0x080c,
-	0x2d0d, 0x080c, 0x5a4f, 0x080c, 0x51f4, 0x080c, 0x64a2, 0x0c80,
-	0x000b, 0x0c98, 0x10e4, 0x10e5, 0x1203, 0x10e2, 0x12cc, 0x13f9,
-	0x13fa, 0x13fb, 0x080c, 0x14f6, 0x0005, 0x0126, 0x00f6, 0x2091,
-	0x8000, 0x7000, 0xa086, 0x0001, 0x1904, 0x11d1, 0x080c, 0x1569,
-	0x080c, 0x574f, 0x0150, 0x080c, 0x5775, 0x1580, 0x2079, 0x0100,
-	0x7828, 0xa085, 0x1800, 0x782a, 0x0448, 0x080c, 0x569a, 0x7000,
-	0xa086, 0x0001, 0x1904, 0x11d1, 0x7088, 0xa086, 0x0028, 0x1904,
-	0x11d1, 0x2079, 0x0100, 0x7827, 0xffff, 0x7a28, 0xa295, 0x1e2f,
-	0x7a2a, 0x2011, 0x566e, 0x080c, 0x650d, 0x2011, 0x567b, 0x080c,
-	0x650d, 0x2011, 0x481b, 0x080c, 0x650d, 0x2011, 0x8030, 0x2019,
-	0x0000, 0x7087, 0x0000, 0x080c, 0x1d0f, 0x00e8, 0x080c, 0x41d1,
-	0x2079, 0x0100, 0x7844, 0xa005, 0x1904, 0x11d1, 0x2011, 0x481b,
-	0x080c, 0x650d, 0x2011, 0x567b, 0x080c, 0x650d, 0x080c, 0x1d0f,
-	0x2001, 0xaf8c, 0x2004, 0x780e, 0x7840, 0xa084, 0xfffb, 0x7842,
-	0x2011, 0x8010, 0x73c8, 0x080c, 0x3c5c, 0x7238, 0xc284, 0x723a,
-	0x2001, 0xad0c, 0x200c, 0xc1ac, 0x2102, 0x080c, 0x79bd, 0x2011,
-	0x0004, 0x080c, 0x959c, 0x080c, 0x4f71, 0x080c, 0x574f, 0x0158,
-	0x080c, 0x4917, 0x0140, 0x7087, 0x0001, 0x70c3, 0x0000, 0x080c,
-	0x436e, 0x0804, 0x11d1, 0x080c, 0x502d, 0x0120, 0x7a0c, 0xc2b4,
-	0x7a0e, 0x0050, 0x080c, 0x9937, 0x70d0, 0xd09c, 0x1128, 0x709c,
-	0xa005, 0x0110, 0x080c, 0x48f5, 0x70db, 0x0000, 0x70d7, 0x0000,
-	0x72d0, 0x080c, 0x574f, 0x1178, 0x2011, 0x0000, 0x0016, 0x080c,
-	0x2744, 0x2019, 0xaf8e, 0x211a, 0x001e, 0x704f, 0xffff, 0x7053,
-	0x00ef, 0x7073, 0x0000, 0x2079, 0xad51, 0x7804, 0xd0ac, 0x0108,
-	0xc295, 0x72d2, 0x080c, 0x574f, 0x0118, 0xa296, 0x0004, 0x0508,
-	0x2011, 0x0001, 0x080c, 0x959c, 0x7097, 0x0000, 0x709b, 0xffff,
-	0x7003, 0x0002, 0x00fe, 0x080c, 0x28fa, 0x2011, 0x0005, 0x080c,
-	0x7adf, 0x080c, 0x6c50, 0x080c, 0x574f, 0x0148, 0x00c6, 0x2061,
-	0x0100, 0x0016, 0x080c, 0x2744, 0x61e2, 0x001e, 0x00ce, 0x012e,
-	0x00d0, 0x7097, 0x0000, 0x709b, 0xffff, 0x7003, 0x0002, 0x2011,
-	0x0005, 0x080c, 0x7adf, 0x080c, 0x6c50, 0x080c, 0x574f, 0x0148,
-	0x00c6, 0x2061, 0x0100, 0x0016, 0x080c, 0x2744, 0x61e2, 0x001e,
-	0x00ce, 0x00fe, 0x012e, 0x0005, 0x00c6, 0x080c, 0x574f, 0x1118,
-	0x20a9, 0x0100, 0x0010, 0x20a9, 0x0082, 0x080c, 0x574f, 0x1118,
-	0x2009, 0x0000, 0x0010, 0x2009, 0x007e, 0x0016, 0x0026, 0x0036,
-	0x2110, 0x0026, 0x2019, 0x0029, 0x080c, 0x7cf4, 0x002e, 0x080c,
-	0xac07, 0x003e, 0x002e, 0x001e, 0x080c, 0x2bc9, 0x8108, 0x1f04,
-	0x11e5, 0x00ce, 0x706f, 0x0000, 0x7070, 0xa084, 0x00ff, 0x7072,
-	0x709f, 0x0000, 0x0005, 0x0126, 0x2091, 0x8000, 0x7000, 0xa086,
-	0x0002, 0x1904, 0x12ca, 0x7098, 0xa086, 0xffff, 0x0130, 0x080c,
-	0x28fa, 0x080c, 0x6c50, 0x0804, 0x12ca, 0x70d0, 0xd0ac, 0x1110,
-	0xd09c, 0x0540, 0xd084, 0x0530, 0x0006, 0x0016, 0x2001, 0x0103,
-	0x2009, 0xaf8c, 0x210c, 0x2102, 0x001e, 0x000e, 0xd08c, 0x01d0,
-	0x70d4, 0xa086, 0xffff, 0x0190, 0x080c, 0x2a56, 0x080c, 0x6c50,
-	0x70d0, 0xd094, 0x1904, 0x12ca, 0x2011, 0x0001, 0x2019, 0x0000,
-	0x080c, 0x2a8c, 0x080c, 0x6c50, 0x0804, 0x12ca, 0x70d8, 0xa005,
-	0x1904, 0x12ca, 0x7094, 0xa005, 0x1904, 0x12ca, 0x70d0, 0xd0a4,
-	0x0118, 0xd0b4, 0x0904, 0x12ca, 0x080c, 0x502d, 0x1904, 0x12ca,
-	0x2001, 0xad52, 0x2004, 0xd0ac, 0x01c8, 0x0156, 0x00c6, 0x20a9,
-	0x007f, 0x2009, 0x0000, 0x0016, 0x080c, 0x4cdc, 0x1118, 0x6000,
-	0xd0ec, 0x1138, 0x001e, 0x8108, 0x1f04, 0x125b, 0x00ce, 0x015e,
-	0x0028, 0x001e, 0x00ce, 0x015e, 0x0804, 0x12ca, 0x0006, 0x0016,
-	0x2001, 0x0103, 0x2009, 0xaf8c, 0x210c, 0x2102, 0x001e, 0x000e,
-	0xa006, 0x2009, 0x0700, 0x20a9, 0x0002, 0x20a1, 0xafb5, 0x40a1,
-	0x706c, 0x8007, 0x7170, 0x810f, 0x20a9, 0x0002, 0x40a1, 0x2009,
-	0x0000, 0x080c, 0x14dc, 0x2001, 0x0000, 0x810f, 0x20a9, 0x0002,
-	0x40a1, 0xa006, 0x2009, 0x0200, 0x20a9, 0x0002, 0x20a1, 0xafc5,
-	0x40a1, 0x7030, 0xc08c, 0x7032, 0x7003, 0x0003, 0x709b, 0xffff,
-	0x080c, 0x1562, 0xa006, 0x080c, 0x261e, 0x080c, 0x3cce, 0x00f6,
-	0x2079, 0x0100, 0x080c, 0x5775, 0x0150, 0x080c, 0x574f, 0x7828,
-	0x0118, 0xa084, 0xe1ff, 0x0010, 0xa084, 0xffdf, 0x782a, 0x00fe,
-	0x2001, 0xafc8, 0x2004, 0xa086, 0x0005, 0x1120, 0x2011, 0x0000,
-	0x080c, 0x7adf, 0x2011, 0x0000, 0x080c, 0x7ae9, 0x080c, 0x6c50,
-	0x080c, 0x6d0d, 0x012e, 0x0005, 0x0016, 0x0046, 0x00f6, 0x0126,
-	0x2091, 0x8000, 0x2079, 0x0100, 0x2009, 0xad33, 0x2104, 0xa005,
-	0x1110, 0x080c, 0x2770, 0x2009, 0x00f7, 0x080c, 0x48de, 0x7940,
-	0xa18c, 0x0010, 0x7942, 0x7924, 0xd1b4, 0x0110, 0x7827, 0x0040,
-	0xd19c, 0x0110, 0x7827, 0x0008, 0x0006, 0x0036, 0x0156, 0x7954,
-	0xd1ac, 0x1904, 0x133a, 0x080c, 0x5761, 0x0158, 0x080c, 0x5775,
-	0x1128, 0x2001, 0xaf9d, 0x2003, 0x0000, 0x0070, 0x080c, 0x5757,
-	0x0dc0, 0x2001, 0xaf9d, 0x2003, 0xaaaa, 0x2001, 0xaf9e, 0x2003,
-	0x0001, 0x080c, 0x569a, 0x0058, 0x080c, 0x574f, 0x0140, 0x2009,
-	0x00f8, 0x080c, 0x48de, 0x7843, 0x0090, 0x7843, 0x0010, 0x20a9,
-	0x09c4, 0x7820, 0xd09c, 0x1138, 0x080c, 0x574f, 0x0138, 0x7824,
-	0xd0ac, 0x1904, 0x13e0, 0x1f04, 0x1319, 0x0070, 0x7824, 0x080c,
-	0x576b, 0x0118, 0xd0ac, 0x1904, 0x13e0, 0xa084, 0x1800, 0x0d98,
-	0x7003, 0x0001, 0x0804, 0x13e0, 0x2001, 0x0001, 0x080c, 0x261e,
-	0x0804, 0x13ef, 0x7850, 0xa084, 0x0180, 0x7852, 0x782f, 0x0020,
-	0x20a9, 0x0046, 0x1d04, 0x1342, 0x2091, 0x6000, 0x1f04, 0x1342,
-	0x7850, 0xa084, 0x0180, 0xa085, 0x0400, 0x7852, 0x782f, 0x0000,
-	0x080c, 0x5761, 0x0158, 0x080c, 0x5775, 0x1128, 0x2001, 0xaf9d,
-	0x2003, 0x0000, 0x0070, 0x080c, 0x5757, 0x0dc0, 0x2001, 0xaf9d,
-	0x2003, 0xaaaa, 0x2001, 0xaf9e, 0x2003, 0x0001, 0x080c, 0x569a,
-	0x0020, 0x2009, 0x00f8, 0x080c, 0x48de, 0x20a9, 0x000e, 0xe000,
-	0x1f04, 0x136f, 0x7850, 0xa084, 0x0180, 0xa085, 0x1400, 0x7852,
-	0x080c, 0x574f, 0x0120, 0x7843, 0x0090, 0x7843, 0x0010, 0x2021,
-	0xe678, 0x2019, 0xea60, 0x7820, 0xd09c, 0x1558, 0x080c, 0x574f,
-	0x05b8, 0x7824, 0xd0ac, 0x1904, 0x13e0, 0x080c, 0x5775, 0x1508,
-	0x0046, 0x2021, 0x0190, 0x8421, 0x1df0, 0x004e, 0x8421, 0x11c8,
-	0x7827, 0x0048, 0x20a9, 0x01f4, 0x1d04, 0x139c, 0x2091, 0x6000,
-	0x1f04, 0x139c, 0x7824, 0xa084, 0x0068, 0x15a8, 0x2001, 0xaf9d,
-	0x2003, 0xaaaa, 0x2001, 0xaf9e, 0x2003, 0x0001, 0x7003, 0x0001,
-	0x0478, 0x8319, 0x1980, 0x2009, 0xad33, 0x2104, 0x8000, 0x200a,
-	0xa084, 0xfff0, 0x0120, 0x200b, 0x0000, 0x080c, 0x2770, 0x00d8,
-	0x080c, 0x5761, 0x1140, 0xa4a2, 0x0064, 0x1128, 0x080c, 0x5726,
-	0x7003, 0x0001, 0x00a8, 0x7827, 0x1800, 0xe000, 0xe000, 0x7824,
-	0x080c, 0x576b, 0x0110, 0xd0ac, 0x1158, 0xa084, 0x1800, 0x09c8,
-	0x7003, 0x0001, 0x0028, 0x2001, 0x0001, 0x080c, 0x261e, 0x0048,
-	0x2001, 0xad33, 0x2003, 0x0000, 0x7827, 0x0048, 0x7828, 0xc09d,
-	0x782a, 0x7850, 0xa084, 0x0180, 0xa085, 0x0400, 0x7852, 0x015e,
-	0x003e, 0x000e, 0x080c, 0x1539, 0x012e, 0x00fe, 0x004e, 0x001e,
-	0x0005, 0x0005, 0x0005, 0x0005, 0x2a70, 0x2001, 0xaf9d, 0x2003,
-	0x0000, 0x7087, 0x0000, 0x2009, 0x0100, 0x2104, 0xa082, 0x0002,
-	0x0218, 0x704f, 0xffff, 0x0010, 0x704f, 0x0000, 0x7057, 0xffff,
-	0x706f, 0x0000, 0x7073, 0x0000, 0x080c, 0x9937, 0x2061, 0xaf8d,
-	0x6003, 0x0909, 0x6007, 0x0000, 0x600b, 0x8800, 0x600f, 0x0200,
-	0x6013, 0x00ff, 0x6017, 0x0003, 0x601b, 0x0000, 0x601f, 0x07d0,
-	0x2061, 0xaf95, 0x6003, 0x8000, 0x6007, 0x0000, 0x600b, 0x0000,
-	0x600f, 0x0200, 0x6013, 0x00ff, 0x6017, 0x0000, 0x601b, 0x0001,
-	0x601f, 0x0000, 0x2061, 0xafa6, 0x6003, 0x514c, 0x6007, 0x4f47,
-	0x600b, 0x4943, 0x600f, 0x2020, 0x2001, 0xad27, 0x2003, 0x0000,
-	0x0005, 0x04a0, 0x2011, 0x0000, 0x81ff, 0x0570, 0xa186, 0x0001,
-	0x1148, 0x2031, 0x8fff, 0x2039, 0xcc01, 0x2021, 0x0100, 0x2029,
-	0xcc00, 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, 0x1485, 0x0804, 0x14d6, 0x2019, 0xaaaa, 0x2061,
-	0xffff, 0x2c14, 0x2362, 0xe000, 0xe000, 0x2c04, 0xa306, 0x2262,
-	0x1110, 0xc1b5, 0xc1a5, 0x2011, 0x0000, 0x2019, 0x1498, 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, 0x14b3, 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, 0x14d4, 0x0010, 0x0804, 0x144a, 0x3800, 0xa084,
-	0xfffc, 0xa205, 0x20c0, 0x0837, 0x2011, 0x0000, 0x080c, 0x4cdc,
-	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, 0x14f8, 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, 0xb0c8, 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, 0xad00, 0x7803, 0x0005, 0x2091, 0x4080, 0x04c9, 0x0cf8,
-	0x0005, 0x0006, 0x080c, 0x1584, 0x1518, 0x00f6, 0x2079, 0xad23,
-	0x2f04, 0x8000, 0x207a, 0xa082, 0x000f, 0x0258, 0xa006, 0x207a,
-	0x2079, 0xad25, 0x2f04, 0xa084, 0x0001, 0xa086, 0x0001, 0x207a,
-	0x0070, 0x2079, 0xad25, 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, 0x1593, 0x2091, 0x6000, 0x1f04,
-	0x1593, 0x012e, 0x015e, 0x0005, 0x2071, 0xad00, 0x715c, 0x712e,
-	0x2021, 0x0001, 0xa190, 0x0030, 0xa298, 0x0030, 0x0240, 0x7060,
-	0xa302, 0x1228, 0x220a, 0x2208, 0x2310, 0x8420, 0x0ca8, 0x3800,
-	0xd08c, 0x0148, 0x7060, 0xa086, 0xad00, 0x0128, 0x7063, 0xad00,
-	0x2011, 0x1000, 0x0c48, 0x200b, 0x0000, 0x74ae, 0x74b2, 0x0005,
-	0x00e6, 0x0126, 0x2091, 0x8000, 0x2071, 0xad00, 0x70b0, 0xa0ea,
-	0x0010, 0x0268, 0x8001, 0x70b2, 0x702c, 0x2068, 0x2d04, 0x702e,
-	0x206b, 0x0000, 0x6807, 0x0000, 0x012e, 0x00ee, 0x0005, 0xa06e,
-	0x0cd8, 0x00e6, 0x2071, 0xad00, 0x0126, 0x2091, 0x8000, 0x70b0,
-	0x8001, 0x0260, 0x70b2, 0x702c, 0x2068, 0x2d04, 0x702e, 0x206b,
-	0x0000, 0x6807, 0x0000, 0x012e, 0x00ee, 0x0005, 0xa06e, 0x0cd8,
-	0x00e6, 0x0126, 0x2091, 0x8000, 0x2071, 0xad00, 0x702c, 0x206a,
-	0x2d00, 0x702e, 0x70b0, 0x8000, 0x70b2, 0x012e, 0x00ee, 0x0005,
-	0x8dff, 0x0138, 0x6804, 0x6807, 0x0000, 0x0006, 0x0c49, 0x00de,
-	0x0cb8, 0x0005, 0x00e6, 0x2071, 0xad00, 0x70b0, 0xa08a, 0x0010,
-	0xa00d, 0x00ee, 0x0005, 0x00e6, 0x2071, 0xafec, 0x7007, 0x0000,
-	0x701b, 0x0000, 0x701f, 0x0000, 0x2071, 0x0000, 0x7010, 0xa085,
-	0x8004, 0x7012, 0x00ee, 0x0005, 0x00e6, 0x2270, 0x700b, 0x0000,
-	0x2071, 0xafec, 0x7018, 0xa088, 0xaff5, 0x220a, 0x8000, 0xa084,
-	0x0007, 0x701a, 0x7004, 0xa005, 0x1128, 0x00f6, 0x2079, 0x0010,
-	0x0081, 0x00fe, 0x00ee, 0x0005, 0x00e6, 0x2071, 0xafec, 0x7004,
-	0xa005, 0x1128, 0x00f6, 0x2079, 0x0010, 0x0019, 0x00fe, 0x00ee,
-	0x0005, 0x7000, 0x0002, 0x164f, 0x16b3, 0x16d0, 0x16d0, 0x7018,
-	0x711c, 0xa106, 0x1118, 0x7007, 0x0000, 0x0005, 0x00d6, 0xa180,
-	0xaff5, 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, 0xadf9,
-	0x20a1, 0x0018, 0x20a9, 0x0008, 0x53a3, 0x7803, 0x0020, 0x0126,
-	0x2091, 0x8000, 0x7803, 0x0041, 0x7007, 0x0003, 0x7000, 0xc084,
-	0x7002, 0x700b, 0xadf4, 0x012e, 0x015e, 0x014e, 0x013e, 0x0005,
-	0x0136, 0x0146, 0x0156, 0x2001, 0xae28, 0x209c, 0x20a1, 0x0014,
-	0x7803, 0x0026, 0x2001, 0xae29, 0x20ac, 0x53a6, 0x2099, 0xae2a,
-	0x20a1, 0x0018, 0x20a9, 0x0008, 0x53a3, 0x7803, 0x0020, 0x0126,
-	0x2091, 0x8000, 0x7803, 0x0001, 0x7007, 0x0004, 0x7000, 0xc08c,
-	0x7002, 0x700b, 0xae25, 0x012e, 0x015e, 0x014e, 0x013e, 0x0005,
-	0x0016, 0x00e6, 0x2071, 0xafec, 0x00f6, 0x2079, 0x0010, 0x7904,
-	0x7803, 0x0002, 0xd1fc, 0x0120, 0xa18c, 0x0700, 0x7004, 0x0023,
-	0x00fe, 0x00ee, 0x001e, 0x0005, 0x1649, 0x1713, 0x1741, 0x176b,
-	0x179b, 0x1712, 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, 0x167a,
-	0x0005, 0x7008, 0xa080, 0x0002, 0x2003, 0x0100, 0x7007, 0x0000,
-	0x080c, 0x1649, 0x0005, 0x7008, 0xa080, 0x0002, 0x2003, 0x0200,
-	0x0ca8, 0xa18c, 0x0700, 0x1150, 0x700c, 0xa005, 0x0188, 0x7830,
-	0x7832, 0x7834, 0x7836, 0x080c, 0x168f, 0x0005, 0x7008, 0xa080,
-	0x0002, 0x2003, 0x0200, 0x7007, 0x0000, 0x080c, 0x1649, 0x0005,
-	0x00d6, 0x7008, 0x2068, 0x7830, 0x6826, 0x7834, 0x682a, 0x7838,
-	0x682e, 0x783c, 0x6832, 0x680b, 0x0100, 0x00de, 0x7007, 0x0000,
-	0x080c, 0x1649, 0x0005, 0xa18c, 0x0700, 0x1540, 0x0136, 0x0146,
-	0x0156, 0x2001, 0xadf7, 0x2004, 0xa080, 0x000d, 0x20a0, 0x2099,
-	0x0014, 0x7803, 0x0040, 0x20a9, 0x0020, 0x53a5, 0x2001, 0xadf9,
-	0x2004, 0xd0bc, 0x0148, 0x2001, 0xae02, 0x2004, 0xa080, 0x000d,
-	0x20a0, 0x20a9, 0x0020, 0x53a5, 0x015e, 0x014e, 0x013e, 0x7007,
-	0x0000, 0x080c, 0x5ae6, 0x080c, 0x1649, 0x0005, 0x2011, 0x8003,
-	0x080c, 0x3c5c, 0x0cf8, 0xa18c, 0x0700, 0x1148, 0x2001, 0xae27,
-	0x2003, 0x0100, 0x7007, 0x0000, 0x080c, 0x1649, 0x0005, 0x2011,
-	0x8004, 0x080c, 0x3c5c, 0x0cf8, 0x0126, 0x2091, 0x2200, 0x2079,
-	0x0030, 0x2071, 0xaffd, 0x7003, 0x0000, 0x700f, 0xb003, 0x7013,
-	0xb003, 0x780f, 0x00f6, 0x7803, 0x0004, 0x012e, 0x0005, 0x6934,
-	0xa184, 0x0007, 0x0002, 0x17cb, 0x1809, 0x17cb, 0x17cb, 0x17cb,
-	0x17f1, 0x17d8, 0x17cf, 0xa085, 0x0001, 0x0804, 0x1823, 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, 0x2186, 0x2005, 0x6832, 0x6858,
-	0x0440, 0xa18c, 0x00ff, 0xa186, 0x0015, 0x19a8, 0x684c, 0xd0ac,
-	0x0990, 0x6804, 0x681a, 0xa080, 0x000d, 0x2004, 0xa084, 0x000f,
-	0xa080, 0x2186, 0x2005, 0x6832, 0xa006, 0x682e, 0x682a, 0x6858,
-	0x0080, 0x684c, 0xd0ac, 0x0904, 0x17cb, 0xa006, 0x682e, 0x682a,
-	0x6858, 0xa18c, 0x000f, 0xa188, 0x2186, 0x210d, 0x6932, 0x2d08,
-	0x691a, 0x6826, 0x684c, 0xc0dd, 0x684e, 0xa006, 0x680a, 0x697c,
-	0x6912, 0x6980, 0x6916, 0x0005, 0x20e1, 0x0007, 0x20e1, 0x2000,
-	0x2001, 0x020a, 0x2004, 0x82ff, 0x01a8, 0xa280, 0x0004, 0x00d6,
-	0x206c, 0x684c, 0xd0dc, 0x1150, 0x080c, 0x17bf, 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, 0xb01e, 0x0210,
-	0x2009, 0xb003, 0x710e, 0x7010, 0xa102, 0xa082, 0x0009, 0x0118,
-	0xa080, 0x001b, 0x1118, 0x2009, 0x0138, 0x200a, 0x012e, 0x0005,
-	0x7206, 0x2001, 0x1866, 0x0006, 0x2260, 0x0804, 0x197a, 0x0126,
-	0x0026, 0x0036, 0x00c6, 0x0006, 0x2091, 0x2200, 0x000e, 0x004e,
-	0x003e, 0x002e, 0x00d6, 0x00c6, 0x2460, 0x6110, 0x2168, 0x6a62,
-	0x6b5e, 0xa005, 0x0904, 0x18c8, 0x6808, 0xa005, 0x0904, 0x18ff,
-	0x7000, 0xa005, 0x1108, 0x0488, 0x700c, 0x7110, 0xa106, 0x1904,
-	0x1907, 0x7004, 0xa406, 0x1548, 0x2001, 0x0005, 0x2004, 0xd08c,
-	0x0168, 0x0046, 0x080c, 0x1a6c, 0x004e, 0x2460, 0x6010, 0xa080,
-	0x0002, 0x2004, 0xa005, 0x0904, 0x18ff, 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, 0x1907, 0x2009, 0x0048, 0x080c, 0x80a7, 0x0804, 0x1907,
-	0x6808, 0xa005, 0x05a0, 0x7000, 0xa005, 0x0588, 0x700c, 0x7110,
-	0xa106, 0x1118, 0x7004, 0xa406, 0x1550, 0x2001, 0x0005, 0x2004,
-	0xd08c, 0x0160, 0x0046, 0x080c, 0x1a6c, 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, 0x80a7, 0x00ce,
-	0x00de, 0x012e, 0x0005, 0x00f6, 0x00e6, 0x0026, 0x0036, 0x0046,
-	0x0056, 0x080c, 0x1d86, 0x0026, 0x0056, 0x2071, 0xaffd, 0x7000,
-	0xa086, 0x0000, 0x0580, 0x7004, 0xac06, 0x11f8, 0x2079, 0x0030,
-	0x7000, 0xa086, 0x0003, 0x01c8, 0x7804, 0xd0fc, 0x1198, 0x2001,
-	0x0207, 0x2004, 0xd09c, 0x1dc0, 0x7803, 0x0004, 0x7804, 0xd0ac,
-	0x1de8, 0x7803, 0x0002, 0x7803, 0x0009, 0x7003, 0x0003, 0x7007,
-	0x0000, 0x0018, 0x080c, 0x1a6c, 0x08d0, 0x0156, 0x20a9, 0x0009,
-	0x2009, 0xb003, 0x2104, 0xac06, 0x1108, 0x200a, 0xa188, 0x0003,
-	0x1f04, 0x1942, 0x015e, 0x005e, 0x002e, 0x2001, 0x015d, 0x201c,
-	0x831a, 0x2302, 0x2001, 0x0160, 0x2502, 0x2001, 0x0138, 0x2202,
-	0x005e, 0x004e, 0x003e, 0x002e, 0x00ee, 0x00fe, 0x0005, 0x700c,
-	0x7110, 0xa106, 0x0904, 0x19dd, 0x2104, 0x7006, 0x2060, 0x8108,
-	0x211c, 0x8108, 0x2124, 0x8108, 0xa182, 0xb01e, 0x0210, 0x2009,
-	0xb003, 0x7112, 0x700c, 0xa106, 0x1128, 0x080c, 0x2744, 0x2001,
-	0x0138, 0x2102, 0x8cff, 0x0588, 0x6010, 0x2068, 0x2d58, 0x6828,
-	0xa406, 0x1580, 0x682c, 0xa306, 0x1568, 0x7004, 0x2060, 0x6020,
-	0xc0d4, 0x6022, 0x684c, 0xd0f4, 0x0128, 0x6817, 0xffff, 0x6813,
-	0xffff, 0x00d8, 0x6850, 0xd0f4, 0x1130, 0x7803, 0x0004, 0x6810,
-	0x781a, 0x6814, 0x781e, 0x6824, 0x2050, 0x6818, 0x2060, 0x6830,
-	0x2040, 0x6034, 0xa0cc, 0x000f, 0x2009, 0x0011, 0x04c9, 0x0118,
-	0x2009, 0x0001, 0x04a9, 0x2d58, 0x0005, 0x080c, 0x1ced, 0x0904,
-	0x195f, 0x0cd0, 0x6020, 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, 0x98cb, 0x09f0, 0x601c,
-	0xa08e, 0x0008, 0x0904, 0x1985, 0xa08e, 0x000a, 0x0904, 0x1985,
-	0x080c, 0x21a6, 0x1990, 0x0804, 0x1985, 0x7003, 0x0000, 0x0005,
-	0x8aff, 0x0904, 0x1a46, 0xa03e, 0x2730, 0x6850, 0xd0fc, 0x11b8,
-	0xd0f4, 0x1528, 0x00d6, 0x2805, 0xac68, 0x2900, 0x0002, 0x1a30,
-	0x1a15, 0x1a15, 0x1a30, 0x1a30, 0x1a29, 0x1a30, 0x1a15, 0x1a30,
-	0x1a1a, 0x1a1a, 0x1a30, 0x1a30, 0x1a30, 0x1a21, 0x1a1a, 0x7803,
-	0x0004, 0xc0fc, 0x6852, 0x6b6c, 0x6a70, 0x6d1c, 0x6c20, 0x00d6,
-	0xd99c, 0x0548, 0x2805, 0xac68, 0x6f08, 0x6e0c, 0x0420, 0xc0f4,
-	0x6852, 0x6b6c, 0x6a70, 0x00d6, 0x0428, 0x6b08, 0x6a0c, 0x6d00,
-	0x6c04, 0x00c8, 0x6b10, 0x6a14, 0x6d00, 0x6c04, 0x6f08, 0x6e0c,
-	0x0090, 0x00de, 0x00d6, 0x6834, 0xa084, 0x00ff, 0xa086, 0x001e,
-	0x1138, 0x00de, 0x080c, 0x2148, 0x1904, 0x19e0, 0xa00e, 0x00b0,
-	0x00de, 0x080c, 0x14f6, 0x7b22, 0x7a26, 0x7d32, 0x7c36, 0x7f3a,
-	0x7e3e, 0x7902, 0x7000, 0x8000, 0x7002, 0x00de, 0x6828, 0xa300,
-	0x682a, 0x682c, 0xa201, 0x682e, 0x080c, 0x2148, 0x0005, 0x080c,
-	0x14f6, 0x080c, 0x1e1a, 0x7004, 0x2060, 0x00d6, 0x6010, 0x2068,
-	0x7003, 0x0000, 0x080c, 0x1d22, 0x080c, 0x9596, 0x0170, 0x6808,
-	0x8001, 0x680a, 0x697c, 0x6912, 0x6980, 0x6916, 0x682b, 0xffff,
-	0x682f, 0xffff, 0x6850, 0xc0bd, 0x6852, 0x00de, 0x080c, 0x929c,
-	0x0804, 0x1c5e, 0x080c, 0x14f6, 0x0126, 0x2091, 0x2200, 0x0006,
-	0x0016, 0x2b68, 0x6818, 0x2060, 0x7904, 0x7803, 0x0002, 0xa184,
-	0x0700, 0x1978, 0xa184, 0x0003, 0xa086, 0x0003, 0x0d58, 0x7000,
-	0x0002, 0x1a89, 0x1a8f, 0x1b92, 0x1c39, 0x1c4d, 0x1a89, 0x1a89,
-	0x1a89, 0x7804, 0xd09c, 0x1904, 0x1c5e, 0x080c, 0x14f6, 0x8001,
-	0x7002, 0xa184, 0x0880, 0x1190, 0xd19c, 0x1904, 0x1b20, 0x8aff,
-	0x0904, 0x1b20, 0x2009, 0x0001, 0x080c, 0x19e0, 0x0904, 0x1c5e,
-	0x2009, 0x0001, 0x080c, 0x19e0, 0x0804, 0x1c5e, 0x7803, 0x0004,
-	0x7003, 0x0000, 0xd1bc, 0x1904, 0x1b00, 0x0026, 0x0036, 0x7c20,
-	0x7d24, 0x7e30, 0x7f34, 0x7818, 0x6812, 0x781c, 0x6816, 0x2001,
-	0x0201, 0x2004, 0xa005, 0x0140, 0x7808, 0xd0ec, 0x1128, 0x7803,
-	0x0009, 0x7003, 0x0004, 0x0010, 0x080c, 0x1c62, 0x6b28, 0x6a2c,
-	0x2400, 0x686e, 0xa31a, 0x2500, 0x6872, 0xa213, 0x6b2a, 0x6a2e,
-	0x00c6, 0x7004, 0x2060, 0x6020, 0xd0f4, 0x1110, 0x633a, 0x6236,
-	0x00ce, 0x003e, 0x002e, 0x6e1e, 0x6f22, 0x080c, 0x215e, 0x2a00,
-	0x6826, 0x2c00, 0x681a, 0x2800, 0x6832, 0x6850, 0xc0fd, 0x6852,
-	0x6808, 0x8001, 0x680a, 0x1148, 0x684c, 0xd0e4, 0x0130, 0x7004,
-	0x2060, 0x2009, 0x0048, 0x080c, 0x80a7, 0x7000, 0xa086, 0x0004,
-	0x0904, 0x1c5e, 0x7003, 0x0000, 0x080c, 0x195f, 0x0804, 0x1c5e,
-	0x0056, 0x7d0c, 0xd5bc, 0x1110, 0x080c, 0xac73, 0x005e, 0x080c,
-	0x1d22, 0x00f6, 0x7004, 0x2078, 0x080c, 0x5029, 0x0118, 0x7820,
-	0xc0f5, 0x7822, 0x00fe, 0x682b, 0xffff, 0x682f, 0xffff, 0x6808,
-	0x8001, 0x680a, 0x697c, 0x791a, 0x6980, 0x791e, 0x0804, 0x1c5e,
-	0x7004, 0x00c6, 0x2060, 0x6020, 0x00ce, 0xd0f4, 0x0128, 0x6808,
-	0x8001, 0x680a, 0x0804, 0x1c5e, 0x7818, 0x6812, 0x7a1c, 0x6a16,
-	0xd19c, 0x0160, 0xa205, 0x0150, 0x7004, 0xa080, 0x0007, 0x2004,
-	0xa084, 0xfffd, 0xa086, 0x0008, 0x1904, 0x1aa6, 0x684c, 0xc0f5,
-	0x684e, 0x7814, 0xa005, 0x1180, 0x7003, 0x0000, 0x6808, 0x8001,
-	0x680a, 0x1130, 0x7004, 0x2060, 0x2009, 0x0048, 0x080c, 0x80a7,
-	0x080c, 0x195f, 0x0804, 0x1c5e, 0x7818, 0x6812, 0x781c, 0x6816,
-	0x7814, 0x7908, 0xa18c, 0x0fff, 0xa188, 0x0007, 0x8114, 0x8214,
-	0x8214, 0xa10a, 0x8104, 0x8004, 0x8004, 0xa20a, 0x810b, 0x810b,
-	0x810b, 0x080c, 0x1da5, 0x7803, 0x0004, 0x780f, 0xffff, 0x7803,
-	0x0001, 0x7804, 0xd0fc, 0x0de8, 0x7803, 0x0002, 0x7803, 0x0004,
-	0x780f, 0x00f6, 0x7004, 0x7007, 0x0000, 0x2060, 0x2009, 0x0048,
-	0x080c, 0x80a7, 0x080c, 0x1dd7, 0x0958, 0x7908, 0xd1ec, 0x1118,
-	0x2009, 0x0009, 0x0010, 0x2009, 0x0019, 0x7902, 0x7003, 0x0003,
-	0x0804, 0x1c5e, 0x8001, 0x7002, 0xd194, 0x01a8, 0x7804, 0xd0fc,
-	0x1904, 0x1c2c, 0xd09c, 0x0130, 0x7804, 0xd0fc, 0x1904, 0x1a74,
-	0xd09c, 0x11a8, 0x8aff, 0x0904, 0x1c5e, 0x2009, 0x0001, 0x080c,
-	0x19e0, 0x0804, 0x1c5e, 0xa184, 0x0888, 0x1148, 0x8aff, 0x0904,
-	0x1c5e, 0x2009, 0x0001, 0x080c, 0x19e0, 0x0804, 0x1c5e, 0x7818,
-	0x6812, 0x7a1c, 0x6a16, 0xa205, 0x0904, 0x1b3e, 0x7803, 0x0004,
-	0x7003, 0x0000, 0xd1bc, 0x1904, 0x1c0f, 0x6834, 0xa084, 0x00ff,
-	0xa086, 0x0029, 0x1118, 0xd19c, 0x1904, 0x1b3e, 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, 0x1c62,
-	0x001e, 0x6b28, 0x6a2c, 0x080c, 0x215e, 0x00d6, 0x2805, 0xac68,
-	0x6034, 0xd09c, 0x1128, 0x6808, 0xa31a, 0x680c, 0xa213, 0x0020,
-	0x6810, 0xa31a, 0x6814, 0xa213, 0x00de, 0xd194, 0x0904, 0x1ac8,
-	0x2a00, 0x6826, 0x2c00, 0x681a, 0x2800, 0x6832, 0x6808, 0x8001,
-	0x680a, 0x6b2a, 0x6a2e, 0x003e, 0x002e, 0x0804, 0x1b50, 0x0056,
-	0x7d0c, 0x080c, 0xac73, 0x005e, 0x080c, 0x1d22, 0x00f6, 0x7004,
-	0x2078, 0x080c, 0x5029, 0x0118, 0x7820, 0xc0f5, 0x7822, 0x00fe,
-	0x682b, 0xffff, 0x682f, 0xffff, 0x6808, 0x8001, 0x680a, 0x697c,
-	0x791a, 0x6980, 0x791e, 0x0490, 0x7804, 0xd09c, 0x0904, 0x1a74,
-	0x7c20, 0x7824, 0xa405, 0x1904, 0x1a74, 0x7803, 0x0002, 0x0804,
-	0x1bb7, 0x7803, 0x0004, 0x7003, 0x0000, 0x7004, 0xa00d, 0x0150,
-	0x6808, 0x8001, 0x680a, 0x1130, 0x7004, 0x2060, 0x2009, 0x0048,
-	0x080c, 0x80a7, 0x080c, 0x195f, 0x0088, 0x7803, 0x0004, 0x7003,
-	0x0000, 0x7004, 0x2060, 0x6010, 0xa005, 0x0da0, 0x2068, 0x6808,
-	0x8000, 0x680a, 0x6c28, 0x6b2c, 0x080c, 0x197a, 0x001e, 0x000e,
-	0x012e, 0x0005, 0x700c, 0x7110, 0xa106, 0x0904, 0x1ce1, 0x7004,
-	0x0016, 0x210c, 0xa106, 0x001e, 0x0904, 0x1ce1, 0x00d6, 0x00c6,
-	0x216c, 0x2d00, 0xa005, 0x0904, 0x1cdf, 0x6820, 0xd0d4, 0x1904,
-	0x1cdf, 0x6810, 0x2068, 0x6850, 0xd0fc, 0x0558, 0x8108, 0x2104,
-	0x6b2c, 0xa306, 0x1904, 0x1cdf, 0x8108, 0x2104, 0x6a28, 0xa206,
-	0x1904, 0x1cdf, 0x6850, 0xc0fc, 0xc0f5, 0x6852, 0x686c, 0x7822,
-	0x6870, 0x7826, 0x681c, 0x7832, 0x6820, 0x7836, 0x6818, 0x2060,
-	0x6034, 0xd09c, 0x0150, 0x6830, 0x2005, 0x00d6, 0xac68, 0x6808,
-	0x783a, 0x680c, 0x783e, 0x00de, 0x04a0, 0xa006, 0x783a, 0x783e,
-	0x0480, 0x8108, 0x2104, 0xa005, 0x1590, 0x8108, 0x2104, 0xa005,
-	0x1570, 0x6850, 0xc0f5, 0x6852, 0x6830, 0x2005, 0x6918, 0xa160,
-	0xa180, 0x000d, 0x2004, 0xd09c, 0x1170, 0x6008, 0x7822, 0x686e,
-	0x600c, 0x7826, 0x6872, 0x6000, 0x7832, 0x6004, 0x7836, 0xa006,
-	0x783a, 0x783e, 0x0070, 0x6010, 0x7822, 0x686e, 0x6014, 0x7826,
-	0x6872, 0x6000, 0x7832, 0x6004, 0x7836, 0x6008, 0x783a, 0x600c,
-	0x783e, 0x6810, 0x781a, 0x6814, 0x781e, 0x7803, 0x0011, 0x00ce,
-	0x00de, 0x0005, 0x2011, 0x0201, 0x2009, 0x003c, 0x2204, 0xa005,
-	0x1118, 0x8109, 0x1dd8, 0x0005, 0x0005, 0x0ca1, 0x01e0, 0x7908,
-	0xd1ec, 0x1160, 0x080c, 0x1dd7, 0x0148, 0x7803, 0x0009, 0x7904,
-	0xd1fc, 0x0de8, 0x7803, 0x0006, 0x0c29, 0x0168, 0x780c, 0xd0a4,
-	0x1150, 0x7007, 0x0000, 0x080c, 0x1dd7, 0x0140, 0x7803, 0x0019,
-	0x7003, 0x0003, 0x0018, 0x00b1, 0xa085, 0x0001, 0x0005, 0x0126,
-	0x2091, 0x2200, 0x7000, 0xa086, 0x0003, 0x1150, 0x700c, 0x7110,
-	0xa106, 0x0130, 0x20e1, 0x9028, 0x700f, 0xb003, 0x7013, 0xb003,
-	0x012e, 0x0005, 0x00c6, 0x080c, 0x574f, 0x1550, 0x2001, 0x0160,
-	0x2003, 0x0000, 0x2001, 0x0138, 0x2003, 0x0000, 0x2011, 0x00c8,
-	0xe000, 0xe000, 0x8211, 0x1de0, 0x080c, 0x1d7e, 0x700c, 0x7110,
-	0xa106, 0x0190, 0x2104, 0xa005, 0x0130, 0x2060, 0x6010, 0x2060,
-	0x6008, 0x8001, 0x600a, 0xa188, 0x0003, 0xa182, 0xb01e, 0x0210,
-	0x2009, 0xb003, 0x7112, 0x0c50, 0x080c, 0x57d1, 0x00ce, 0x0005,
-	0x04a9, 0x20e1, 0x9028, 0x700c, 0x7110, 0xa106, 0x01d0, 0x2104,
-	0xa005, 0x0130, 0x2060, 0x6010, 0x2060, 0x6008, 0x8001, 0x600a,
-	0xa188, 0x0003, 0xa182, 0xb01e, 0x0210, 0x2009, 0xb003, 0x7112,
-	0x700c, 0xa106, 0x1d40, 0x080c, 0x2744, 0x2001, 0x0138, 0x2102,
-	0x0c10, 0x2001, 0x015d, 0x200c, 0x810a, 0x2102, 0x2001, 0x0160,
-	0x2502, 0x2001, 0x0138, 0x2202, 0x00ce, 0x0005, 0x20e1, 0x9028,
-	0x2001, 0x015d, 0x200c, 0x810a, 0x2102, 0x0005, 0x2001, 0x0138,
-	0x2014, 0x2003, 0x0000, 0x2001, 0x0160, 0x202c, 0x2003, 0x0000,
-	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, 0x08c9, 0x2019, 0x5000, 0x8319,
-	0x0168, 0x2001, 0xb01e, 0x2004, 0xa086, 0x0000, 0x0138, 0x2001,
-	0x0021, 0xd0fc, 0x0da0, 0x080c, 0x1ff4, 0x0c78, 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, 0x7908,
-	0xa18c, 0x0fff, 0xa182, 0x0009, 0x0218, 0xa085, 0x0001, 0x0088,
-	0x2001, 0x020a, 0x81ff, 0x0130, 0x20e1, 0x6000, 0x200c, 0x200c,
-	0x200c, 0x200c, 0x20e1, 0x7000, 0x200c, 0x200c, 0x7003, 0x0000,
-	0xa006, 0x0005, 0x00f6, 0x00e6, 0x0016, 0x0026, 0x2071, 0xaffd,
-	0x2079, 0x0030, 0x2011, 0x0050, 0x7000, 0xa086, 0x0000, 0x01a8,
-	0x8211, 0x0188, 0x2001, 0x0005, 0x2004, 0xd08c, 0x0dc8, 0x7904,
-	0xa18c, 0x0780, 0x0016, 0x080c, 0x1a6c, 0x001e, 0x81ff, 0x1118,
-	0x2011, 0x0050, 0x0c48, 0xa085, 0x0001, 0x002e, 0x001e, 0x00ee,
-	0x00fe, 0x0005, 0x7803, 0x0004, 0x2009, 0x0064, 0x7804, 0xd0ac,
-	0x0904, 0x1e66, 0x8109, 0x1dd0, 0x2009, 0x0100, 0x210c, 0xa18a,
-	0x0003, 0x0a0c, 0x14f6, 0x080c, 0x20f2, 0x00e6, 0x00f6, 0x2071,
-	0xafec, 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, 0x14f6, 0x2079, 0x0010, 0x000e,
-	0x783e, 0x000e, 0x783a, 0x000e, 0x7836, 0x000e, 0x7832, 0x000e,
-	0x7822, 0x000e, 0x7802, 0x00fe, 0x00ee, 0x0030, 0x00fe, 0x00ee,
-	0x7804, 0xd0ac, 0x190c, 0x14f6, 0x080c, 0x6d0d, 0x0005, 0x00e6,
-	0x2071, 0xb01e, 0x7003, 0x0000, 0x00ee, 0x0005, 0x00d6, 0xa280,
-	0x0004, 0x206c, 0x694c, 0xd1dc, 0x1904, 0x1ee4, 0x6934, 0xa184,
-	0x0007, 0x0002, 0x1e82, 0x1ecf, 0x1e82, 0x1e82, 0x1e82, 0x1eb6,
-	0x1e95, 0x1e84, 0x080c, 0x14f6, 0x684c, 0xd0b4, 0x0904, 0x1fcc,
-	0x6860, 0x682e, 0x6816, 0x685c, 0x682a, 0x6812, 0x687c, 0x680a,
-	0x6880, 0x680e, 0x6958, 0x0804, 0x1ed7, 0x6834, 0xa084, 0x00ff,
-	0xa086, 0x001e, 0x1d38, 0x684c, 0xd0b4, 0x0904, 0x1fcc, 0x6860,
-	0x682e, 0x6816, 0x685c, 0x682a, 0x6812, 0x687c, 0x680a, 0x6880,
-	0x680e, 0x6804, 0x681a, 0xa080, 0x000d, 0x2004, 0xa084, 0x000f,
-	0xa080, 0x2186, 0x2005, 0x6832, 0x6958, 0x0450, 0xa18c, 0x00ff,
-	0xa186, 0x0015, 0x1548, 0x684c, 0xd0b4, 0x0904, 0x1fcc, 0x6804,
-	0x681a, 0xa080, 0x000d, 0x2004, 0xa084, 0x000f, 0xa080, 0x2186,
-	0x2005, 0x6832, 0x6958, 0xa006, 0x682e, 0x682a, 0x0088, 0x684c,
-	0xd0b4, 0x0904, 0x1a47, 0x6958, 0xa006, 0x682e, 0x682a, 0x2d00,
-	0x681a, 0x6834, 0xa084, 0x000f, 0xa080, 0x2186, 0x2005, 0x6832,
-	0x6926, 0x684c, 0xc0dd, 0x684e, 0x00de, 0x0005, 0x00f6, 0x2079,
-	0x0020, 0x7804, 0xd0fc, 0x190c, 0x1ff4, 0x00e6, 0x00d6, 0x2071,
-	0xb01e, 0x7000, 0xa005, 0x1904, 0x1f4c, 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, 0x21a6, 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,
-	0x1fc5, 0x700c, 0x7214, 0xa23a, 0x7010, 0x7218, 0xa203, 0x0a04,
-	0x1fc4, 0xa705, 0x0904, 0x1fc4, 0xa03e, 0x2730, 0x6850, 0xd0fc,
-	0x11a8, 0x00d6, 0x2805, 0xac68, 0x2900, 0x0002, 0x1fa7, 0x1f8c,
-	0x1f8c, 0x1fa7, 0x1fa7, 0x1fa0, 0x1fa7, 0x1f8c, 0x1fa7, 0x1f91,
-	0x1f91, 0x1fa7, 0x1fa7, 0x1fa7, 0x1f98, 0x1f91, 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, 0x2148, 0x1904, 0x1f56, 0xa00e, 0x00f0, 0x00de,
-	0x080c, 0x14f6, 0x00de, 0x7b22, 0x7a26, 0x7d32, 0x7c36, 0x7f3a,
-	0x7e3e, 0x7902, 0x7000, 0x8000, 0x7002, 0x6828, 0xa300, 0x682a,
-	0x682c, 0xa201, 0x682e, 0x700c, 0xa300, 0x700e, 0x7010, 0xa201,
-	0x7012, 0x080c, 0x2148, 0x0008, 0xa006, 0x002e, 0x003e, 0x004e,
-	0x005e, 0x006e, 0x007e, 0x0005, 0x080c, 0x14f6, 0x0026, 0x2001,
-	0x0105, 0x2003, 0x0010, 0x20e1, 0x9040, 0x7803, 0x0004, 0x7003,
-	0x0000, 0x7004, 0x2060, 0x00d6, 0x6010, 0x2068, 0x080c, 0x9596,
-	0x0118, 0x6850, 0xc0bd, 0x6852, 0x00de, 0x080c, 0x929c, 0x20e1,
-	0x9040, 0x080c, 0x7cb8, 0x2011, 0x0000, 0x080c, 0x7ae9, 0x080c,
-	0x6d0d, 0x002e, 0x0804, 0x20ad, 0x0126, 0x2091, 0x2400, 0x0006,
-	0x0016, 0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x2079, 0x0020, 0x2071,
-	0xb01e, 0x2b68, 0x6818, 0x2060, 0x7904, 0x7803, 0x0002, 0xa184,
-	0x0700, 0x1920, 0x7000, 0x0002, 0x20ad, 0x2010, 0x2080, 0x20ab,
-	0x8001, 0x7002, 0xd19c, 0x1170, 0x8aff, 0x05d0, 0x2009, 0x0001,
-	0x080c, 0x1f50, 0x0904, 0x20ad, 0x2009, 0x0001, 0x080c, 0x1f50,
-	0x0804, 0x20ad, 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, 0x215e, 0x6850, 0xc0fd, 0x6852, 0x2a00, 0x6826,
-	0x2c00, 0x681a, 0x2800, 0x6832, 0x7003, 0x0000, 0x0804, 0x20ad,
-	0x00f6, 0x0026, 0x781c, 0x0006, 0x7818, 0x0006, 0x2079, 0x0100,
-	0x7a14, 0xa284, 0x0184, 0xa085, 0x0012, 0x7816, 0x0036, 0x2019,
-	0x1000, 0x8319, 0x090c, 0x14f6, 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, 0x2004,
-	0xd19c, 0x11f8, 0x8aff, 0x0508, 0x2009, 0x0001, 0x080c, 0x1f50,
-	0x00e0, 0x0026, 0x0036, 0x6b28, 0x6a2c, 0x080c, 0x215e, 0x00d6,
-	0x2805, 0xac68, 0x6034, 0xd09c, 0x1128, 0x6808, 0xa31a, 0x680c,
-	0xa213, 0x0020, 0x6810, 0xa31a, 0x6814, 0xa213, 0x00de, 0x0804,
-	0x2033, 0x0804, 0x202f, 0x080c, 0x14f6, 0x00ce, 0x00de, 0x00ee,
-	0x00fe, 0x001e, 0x000e, 0x012e, 0x0005, 0x00f6, 0x00e6, 0x2071,
-	0xb01e, 0x7000, 0xa086, 0x0000, 0x0590, 0x2079, 0x0020, 0x0016,
-	0x2009, 0x0207, 0x210c, 0xd194, 0x0158, 0x2009, 0x020c, 0x210c,
-	0xa184, 0x0003, 0x0128, 0x20e1, 0x9040, 0x2001, 0x020c, 0x2102,
-	0x2009, 0x0206, 0x2104, 0x2009, 0x0203, 0x210c, 0xa106, 0x1110,
-	0x20e1, 0x9040, 0x7804, 0xd0fc, 0x0d18, 0x080c, 0x1ff4, 0x7000,
-	0xa086, 0x0000, 0x19e8, 0x001e, 0x7803, 0x0004, 0x7804, 0xd0ac,
-	0x1de8, 0x20e1, 0x9040, 0x7803, 0x0002, 0x7003, 0x0000, 0x00ee,
-	0x00fe, 0x0005, 0x0026, 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x2071,
-	0xb01e, 0x2079, 0x0020, 0x7000, 0xa086, 0x0000, 0x0540, 0x7004,
-	0x2060, 0x6010, 0x2068, 0x080c, 0x9596, 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, 0x929c, 0x20e1,
-	0x9040, 0x080c, 0x7cb8, 0x2011, 0x0000, 0x080c, 0x7ae9, 0x00fe,
-	0x00ee, 0x00de, 0x00ce, 0x002e, 0x0005, 0x6810, 0x6a14, 0xa205,
-	0x1d00, 0x684c, 0xc0dc, 0x684e, 0x2c10, 0x080c, 0x1e6e, 0x2001,
-	0x0105, 0x2003, 0x0010, 0x20e1, 0x9040, 0x7803, 0x0004, 0x7003,
-	0x0000, 0x2069, 0xafc7, 0x6833, 0x0000, 0x683f, 0x0000, 0x08f8,
-	0x8840, 0x2805, 0xa005, 0x1170, 0x6004, 0xa005, 0x0168, 0x681a,
-	0x2060, 0x6034, 0xa084, 0x000f, 0xa080, 0x2186, 0x2045, 0x88ff,
-	0x090c, 0x14f6, 0x8a51, 0x0005, 0x2050, 0x0005, 0x8a50, 0x8841,
-	0x2805, 0xa005, 0x1190, 0x2c00, 0xad06, 0x0120, 0x6000, 0xa005,
-	0x1108, 0x2d00, 0x2060, 0x681a, 0x6034, 0xa084, 0x000f, 0xa080,
-	0x2196, 0x2045, 0x88ff, 0x090c, 0x14f6, 0x0005, 0x0000, 0x0011,
-	0x0015, 0x0019, 0x001d, 0x0021, 0x0025, 0x0029, 0x0000, 0x000f,
-	0x0015, 0x001b, 0x0021, 0x0027, 0x0000, 0x0000, 0x0000, 0x217b,
-	0x2177, 0x0000, 0x0000, 0x2185, 0x0000, 0x217b, 0x0000, 0x2182,
-	0x217f, 0x0000, 0x0000, 0x0000, 0x2185, 0x2182, 0x0000, 0x217d,
-	0x217d, 0x0000, 0x0000, 0x2185, 0x0000, 0x217d, 0x0000, 0x2183,
-	0x2183, 0x0000, 0x0000, 0x0000, 0x2185, 0x2183, 0x00a6, 0x0096,
-	0x0086, 0x6b2e, 0x6c2a, 0x6858, 0xa055, 0x0904, 0x2237, 0x2d60,
-	0x6034, 0xa0cc, 0x000f, 0xa9c0, 0x2186, 0xa986, 0x0007, 0x0130,
-	0xa986, 0x000e, 0x0118, 0xa986, 0x000f, 0x1120, 0x605c, 0xa422,
-	0x6060, 0xa31a, 0x2805, 0xa045, 0x1140, 0x0310, 0x0804, 0x2237,
-	0x6004, 0xa065, 0x0904, 0x2237, 0x0c18, 0x2805, 0xa005, 0x01a8,
-	0xac68, 0xd99c, 0x1128, 0x6808, 0xa422, 0x680c, 0xa31b, 0x0020,
-	0x6810, 0xa422, 0x6814, 0xa31b, 0x0620, 0x2300, 0xa405, 0x0150,
-	0x8a51, 0x0904, 0x2237, 0x8840, 0x0c40, 0x6004, 0xa065, 0x0904,
-	0x2237, 0x0830, 0x8a51, 0x0904, 0x2237, 0x8840, 0x2805, 0xa005,
-	0x1158, 0x6004, 0xa065, 0x0904, 0x2237, 0x6034, 0xa0cc, 0x000f,
-	0xa9c0, 0x2186, 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, 0x14f6, 0x6800, 0xa420, 0x6804,
-	0xa319, 0x0060, 0x6910, 0x2400, 0xa122, 0x6914, 0x2300, 0xa11b,
-	0x0a0c, 0x14f6, 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, 0x224b, 0x224c, 0x224f, 0x2252, 0x2257,
-	0x225a, 0x225f, 0x2264, 0x0005, 0x080c, 0x1ff4, 0x0005, 0x080c,
-	0x1a6c, 0x0005, 0x080c, 0x1a6c, 0x080c, 0x1ff4, 0x0005, 0x080c,
-	0x16f8, 0x0005, 0x080c, 0x1ff4, 0x080c, 0x16f8, 0x0005, 0x080c,
-	0x1a6c, 0x080c, 0x16f8, 0x0005, 0x080c, 0x1a6c, 0x080c, 0x1ff4,
-	0x080c, 0x16f8, 0x0005, 0x0126, 0x2091, 0x2600, 0x2079, 0x0200,
-	0x2071, 0xb280, 0x2069, 0xad00, 0x2009, 0x0004, 0x7912, 0x7817,
-	0x0004, 0x080c, 0x2651, 0x781b, 0x0002, 0x20e1, 0x9080, 0x20e1,
-	0x4000, 0x20a9, 0x0080, 0x782f, 0x0000, 0x1f04, 0x2283, 0x20e1,
-	0x9080, 0x783b, 0x001f, 0x20e1, 0x8700, 0x012e, 0x0005, 0x0126,
-	0x2091, 0x2600, 0x781c, 0xd0a4, 0x190c, 0x2335, 0xa084, 0x0007,
-	0x0002, 0x22b3, 0x22a1, 0x22a4, 0x22a7, 0x22ac, 0x22ae, 0x22b0,
-	0x22b2, 0x080c, 0x5fb7, 0x0078, 0x080c, 0x5ff0, 0x0060, 0x080c,
-	0x5fb7, 0x080c, 0x5ff0, 0x0038, 0x0041, 0x0028, 0x0031, 0x0018,
-	0x0021, 0x0008, 0x0011, 0x012e, 0x0005, 0x0006, 0x0016, 0x0026,
-	0x7930, 0xa184, 0x0003, 0x0118, 0x20e1, 0x9040, 0x04a0, 0xa184,
-	0x0030, 0x01e0, 0x6a00, 0xa286, 0x0003, 0x1108, 0x00a0, 0x080c,
-	0x574f, 0x1178, 0x2001, 0xaf9e, 0x2003, 0x0001, 0x2001, 0xad00,
-	0x2003, 0x0001, 0xa085, 0x0001, 0x080c, 0x5793, 0x080c, 0x569a,
-	0x0010, 0x080c, 0x485e, 0x20e1, 0x9010, 0x00a8, 0xa184, 0x00c0,
-	0x0168, 0x00e6, 0x0036, 0x0046, 0x0056, 0x2071, 0xaffd, 0x080c,
-	0x1d22, 0x005e, 0x004e, 0x003e, 0x00ee, 0x0028, 0xa184, 0x0300,
-	0x0110, 0x20e1, 0x9020, 0x7932, 0x002e, 0x001e, 0x000e, 0x0005,
-	0x0016, 0x00e6, 0x00f6, 0x2071, 0xad00, 0x7128, 0x2001, 0xaf90,
-	0x2102, 0x2001, 0xaf98, 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,
-	0x2651, 0x00fe, 0x00ee, 0x001e, 0x0005, 0x7938, 0x080c, 0x14f6,
-	0x0126, 0x2091, 0x2800, 0x2061, 0x0100, 0x2071, 0xad00, 0x6024,
-	0x6026, 0x6053, 0x0030, 0x080c, 0x2690, 0x6050, 0xa084, 0xfe7f,
-	0x6052, 0x2009, 0x00ef, 0x6132, 0x6136, 0x080c, 0x26a0, 0x60e7,
-	0x0000, 0x61ea, 0x60e3, 0x0008, 0x604b, 0xf7f7, 0x6043, 0x0000,
-	0x602f, 0x0080, 0x602f, 0x0000, 0x6007, 0x0e9f, 0x601b, 0x001e,
-	0x600f, 0x00ff, 0x2001, 0xaf8c, 0x2003, 0x00ff, 0x602b, 0x002f,
-	0x012e, 0x0005, 0x2001, 0xad31, 0x2003, 0x0000, 0x2001, 0xad30,
-	0x2003, 0x0001, 0x0005, 0x0126, 0x2091, 0x2800, 0x0006, 0x0016,
-	0x0026, 0x6124, 0xa184, 0x1e2c, 0x1118, 0xa184, 0x0007, 0x002a,
-	0xa195, 0x0004, 0xa284, 0x0007, 0x0002, 0x23a7, 0x238d, 0x2390,
-	0x2393, 0x2398, 0x239a, 0x239e, 0x23a2, 0x080c, 0x6699, 0x00b8,
-	0x080c, 0x6774, 0x00a0, 0x080c, 0x6774, 0x080c, 0x6699, 0x0078,
-	0x0099, 0x0068, 0x080c, 0x6699, 0x0079, 0x0048, 0x080c, 0x6774,
-	0x0059, 0x0028, 0x080c, 0x6774, 0x080c, 0x6699, 0x0029, 0x002e,
-	0x001e, 0x000e, 0x012e, 0x0005, 0x6124, 0xd19c, 0x1904, 0x25bf,
-	0x080c, 0x574f, 0x0578, 0x7000, 0xa086, 0x0003, 0x0198, 0x6024,
-	0xa084, 0x1800, 0x0178, 0x080c, 0x5775, 0x0118, 0x080c, 0x5761,
-	0x1148, 0x6027, 0x0020, 0x6043, 0x0000, 0x2001, 0xaf9d, 0x2003,
-	0xaaaa, 0x0458, 0x080c, 0x5775, 0x15d0, 0x6024, 0xa084, 0x1800,
-	0x1108, 0x04a8, 0x2001, 0xaf9d, 0x2003, 0xaaaa, 0x2001, 0xaf9e,
-	0x2003, 0x0001, 0x2001, 0xad00, 0x2003, 0x0001, 0x080c, 0x569a,
-	0x0804, 0x25bf, 0xd1ac, 0x1518, 0x6024, 0xd0dc, 0x1170, 0xd0e4,
-	0x1188, 0xd0d4, 0x11a0, 0xd0cc, 0x0130, 0x7088, 0xa086, 0x0028,
-	0x1110, 0x080c, 0x58da, 0x0804, 0x25bf, 0x2001, 0xaf9e, 0x2003,
-	0x0000, 0x0048, 0x2001, 0xaf9e, 0x2003, 0x0002, 0x0020, 0x080c,
-	0x584d, 0x0804, 0x25bf, 0x080c, 0x597a, 0x0804, 0x25bf, 0xd1ac,
-	0x0904, 0x2507, 0x080c, 0x574f, 0x11d8, 0x6027, 0x0020, 0x0006,
-	0x0026, 0x0036, 0x080c, 0x576b, 0x1170, 0x2001, 0xaf9e, 0x2003,
-	0x0001, 0x2001, 0xad00, 0x2003, 0x0001, 0x080c, 0x569a, 0x003e,
-	0x002e, 0x000e, 0x0005, 0x003e, 0x002e, 0x000e, 0x080c, 0x5726,
-	0x0016, 0x0046, 0x00c6, 0x644c, 0xa486, 0xf0f0, 0x1138, 0x2061,
-	0x0100, 0x644a, 0x6043, 0x0090, 0x6043, 0x0010, 0x74ca, 0xa48c,
-	0xff00, 0x7034, 0xd084, 0x0178, 0xa186, 0xf800, 0x1160, 0x7038,
-	0xd084, 0x1148, 0xc085, 0x703a, 0x0036, 0x2418, 0x2011, 0x8016,
-	0x080c, 0x3c5c, 0x003e, 0xa196, 0xff00, 0x05b8, 0x7050, 0xa084,
-	0x00ff, 0x810f, 0xa116, 0x0588, 0x7130, 0xd184, 0x1570, 0x2011,
-	0xad52, 0x2214, 0xd2ec, 0x0138, 0xc18d, 0x7132, 0x2011, 0xad52,
-	0x2214, 0xd2ac, 0x1510, 0x6240, 0xa294, 0x0010, 0x0130, 0x6248,
-	0xa294, 0xff00, 0xa296, 0xff00, 0x01c0, 0x7030, 0xd08c, 0x0904,
-	0x24d2, 0x7034, 0xd08c, 0x1140, 0x2001, 0xad0c, 0x200c, 0xd1ac,
-	0x1904, 0x24d2, 0xc1ad, 0x2102, 0x0036, 0x73c8, 0x2011, 0x8013,
-	0x080c, 0x3c5c, 0x003e, 0x0804, 0x24d2, 0x7034, 0xd08c, 0x1140,
-	0x2001, 0xad0c, 0x200c, 0xd1ac, 0x1904, 0x24d2, 0xc1ad, 0x2102,
-	0x0036, 0x73c8, 0x2011, 0x8013, 0x080c, 0x3c5c, 0x003e, 0x7130,
-	0xc185, 0x7132, 0x2011, 0xad52, 0x220c, 0xd1a4, 0x01d0, 0x0016,
-	0x2009, 0x0001, 0x2011, 0x0100, 0x080c, 0x663f, 0x2019, 0x000e,
-	0x080c, 0xa8eb, 0xa484, 0x00ff, 0xa080, 0x2be6, 0x200d, 0xa18c,
-	0xff00, 0x810f, 0x8127, 0xa006, 0x2009, 0x000e, 0x080c, 0xa96c,
-	0x001e, 0xd1ac, 0x1148, 0x0016, 0x2009, 0x0000, 0x2019, 0x0004,
-	0x080c, 0x2aac, 0x001e, 0x0070, 0x0156, 0x20a9, 0x007f, 0x2009,
-	0x0000, 0x080c, 0x4cdc, 0x1110, 0x080c, 0x493a, 0x8108, 0x1f04,
-	0x24c9, 0x015e, 0x00ce, 0x004e, 0x2011, 0x0003, 0x080c, 0x7adf,
-	0x2011, 0x0002, 0x080c, 0x7ae9, 0x080c, 0x79e1, 0x080c, 0x6581,
-	0x0036, 0x2019, 0x0000, 0x080c, 0x7a64, 0x003e, 0x60e3, 0x0000,
-	0x001e, 0x2001, 0xad00, 0x2014, 0xa296, 0x0004, 0x1128, 0xd19c,
-	0x1118, 0x6228, 0xc29d, 0x622a, 0x2003, 0x0001, 0x2001, 0xad22,
-	0x2003, 0x0000, 0x6027, 0x0020, 0x080c, 0x5775, 0x1140, 0x0016,
-	0x2009, 0x07d0, 0x2011, 0x567b, 0x080c, 0x6593, 0x001e, 0xd194,
-	0x0904, 0x25bf, 0x0016, 0x6220, 0xd2b4, 0x0904, 0x2570, 0x080c,
-	0x6581, 0x080c, 0x7834, 0x6027, 0x0004, 0x00f6, 0x2019, 0xafd0,
-	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, 0x6b73, 0x080c, 0x6c50, 0x7810, 0x2070, 0x7037, 0x0103,
-	0x2f60, 0x080c, 0x8078, 0x00ee, 0x00ce, 0x00de, 0x00fe, 0x001e,
-	0x0005, 0x00fe, 0x00d6, 0x2069, 0x0140, 0x6804, 0xa084, 0x4000,
-	0x0120, 0x6803, 0x1000, 0x6803, 0x0000, 0x00de, 0x00c6, 0x2061,
-	0xafc7, 0x6028, 0xa09a, 0x00c8, 0x1238, 0x8000, 0x602a, 0x00ce,
-	0x080c, 0x7827, 0x0804, 0x25be, 0x2019, 0xafd0, 0x2304, 0xa065,
-	0x0120, 0x2009, 0x0027, 0x080c, 0x80a7, 0x00ce, 0x0804, 0x25be,
-	0xd2bc, 0x0904, 0x25be, 0x080c, 0x658e, 0x6014, 0xa084, 0x0184,
-	0xa085, 0x0010, 0x6016, 0x6027, 0x0004, 0x00d6, 0x2069, 0x0140,
-	0x6804, 0xa084, 0x4000, 0x0120, 0x6803, 0x1000, 0x6803, 0x0000,
-	0x00de, 0x00c6, 0x2061, 0xafc7, 0x6044, 0xa09a, 0x00c8, 0x12f0,
-	0x8000, 0x6046, 0x603c, 0x00ce, 0xa005, 0x0540, 0x2009, 0x07d0,
-	0x080c, 0x6586, 0xa080, 0x0007, 0x2004, 0xa086, 0x0006, 0x1138,
-	0x6114, 0xa18c, 0x0184, 0xa18d, 0x0012, 0x6116, 0x00b8, 0x6114,
-	0xa18c, 0x0184, 0xa18d, 0x0016, 0x6116, 0x0080, 0x0036, 0x2019,
-	0x0001, 0x080c, 0x7a64, 0x003e, 0x2019, 0xafd6, 0x2304, 0xa065,
-	0x0120, 0x2009, 0x004f, 0x080c, 0x80a7, 0x00ce, 0x001e, 0xd19c,
-	0x0904, 0x261a, 0x7034, 0xd0ac, 0x1560, 0x0016, 0x0156, 0x6027,
-	0x0008, 0x602f, 0x0020, 0x20a9, 0x0006, 0x1d04, 0x25cd, 0x2091,
-	0x6000, 0x1f04, 0x25cd, 0x602f, 0x0000, 0x6150, 0xa185, 0x1400,
-	0x6052, 0x20a9, 0x0366, 0x1d04, 0x25db, 0x2091, 0x6000, 0x6020,
-	0xd09c, 0x1130, 0x015e, 0x6152, 0x001e, 0x6027, 0x0008, 0x0490,
-	0x080c, 0x2760, 0x1f04, 0x25db, 0x015e, 0x6152, 0x001e, 0x6027,
-	0x0008, 0x0016, 0x6028, 0xc09c, 0x602a, 0x2011, 0x0003, 0x080c,
-	0x7adf, 0x2011, 0x0002, 0x080c, 0x7ae9, 0x080c, 0x79e1, 0x080c,
-	0x6581, 0x0036, 0x2019, 0x0000, 0x080c, 0x7a64, 0x003e, 0x60e3,
-	0x0000, 0x080c, 0xac8d, 0x080c, 0xaca8, 0xa085, 0x0001, 0x080c,
-	0x5793, 0x2001, 0xad00, 0x2003, 0x0004, 0x6027, 0x0008, 0x080c,
-	0x12cc, 0x001e, 0xa18c, 0xffd0, 0x6126, 0x0005, 0x0006, 0x0016,
-	0x0026, 0x00e6, 0x00f6, 0x0126, 0x2091, 0x8000, 0x2071, 0xad00,
-	0x71c0, 0x70c2, 0xa116, 0x01f0, 0x81ff, 0x0128, 0x2011, 0x8011,
-	0x080c, 0x3c5c, 0x00b8, 0x2011, 0x8012, 0x080c, 0x3c5c, 0x2001,
-	0xad71, 0x2004, 0xd0fc, 0x1170, 0x0036, 0x00c6, 0x080c, 0x26eb,
-	0x2061, 0x0100, 0x2019, 0x0028, 0x2009, 0x0000, 0x080c, 0x2aac,
-	0x00ce, 0x003e, 0x012e, 0x00fe, 0x00ee, 0x002e, 0x001e, 0x000e,
-	0x0005, 0x00c6, 0x00f6, 0x0006, 0x0026, 0x2061, 0x0100, 0xa190,
-	0x2664, 0x2205, 0x60f2, 0x2011, 0x2671, 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,
-	0x6278, 0x0038, 0xa080, 0x2be6, 0x200d, 0xa18c, 0xff00, 0x810f,
-	0xa006, 0x0005, 0xa080, 0x2be6, 0x200d, 0xa18c, 0x00ff, 0x0005,
-	0x00d6, 0x2069, 0x0140, 0x2001, 0xad14, 0x2003, 0x00ef, 0x20a9,
-	0x0010, 0xa006, 0x6852, 0x6856, 0x1f04, 0x269b, 0x00de, 0x0005,
-	0x0006, 0x00d6, 0x0026, 0x2069, 0x0140, 0x2001, 0xad14, 0x2102,
-	0x8114, 0x8214, 0x8214, 0x8214, 0x20a9, 0x0010, 0x6853, 0x0000,
-	0xa006, 0x82ff, 0x1128, 0xa184, 0x000f, 0xa080, 0xacae, 0x2005,
-	0x6856, 0x8211, 0x1f04, 0x26b0, 0x002e, 0x00de, 0x000e, 0x0005,
-	0x00c6, 0x2061, 0xad00, 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, 0x26e0, 0x680f, 0x0000, 0x000e, 0x001e, 0x002e,
-	0x00de, 0x015e, 0x0005, 0x2001, 0xad52, 0x2004, 0xd0c4, 0x0150,
-	0xd0a4, 0x0140, 0xa006, 0x0046, 0x2020, 0x2009, 0x002e, 0x080c,
-	0xa96c, 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, 0x6665, 0x2011, 0x0030, 0x2200, 0x8007, 0xa085,
-	0x004c, 0x78c2, 0x2009, 0x0204, 0x210c, 0x2200, 0xa100, 0x2009,
-	0x0138, 0x200a, 0x080c, 0x574f, 0x1118, 0x2009, 0xaf8e, 0x200a,
-	0x002e, 0x001e, 0x00fe, 0x0005, 0x78c3, 0x0000, 0x0cc8, 0x0126,
-	0x2091, 0x2800, 0x0006, 0x0016, 0x0026, 0x2001, 0x0170, 0x200c,
-	0x8000, 0x2014, 0xa184, 0x0003, 0x0110, 0x0804, 0x1a6a, 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, 0x2767, 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,
-	0x26a0, 0x000e, 0x00ce, 0x001e, 0x0005, 0x2845, 0x2849, 0x284d,
-	0x2853, 0x2859, 0x285f, 0x2865, 0x286d, 0x2875, 0x287b, 0x2881,
-	0x2889, 0x2891, 0x2899, 0x28a1, 0x28ab, 0x28b5, 0x28b5, 0x28b5,
-	0x28b5, 0x28b5, 0x28b5, 0x28b5, 0x28b5, 0x28b5, 0x28b5, 0x28b5,
-	0x28b5, 0x28b5, 0x28b5, 0x28b5, 0x28b5, 0x28b5, 0x28b5, 0x28b5,
-	0x28b5, 0x28b5, 0x28b5, 0x28b5, 0x28b5, 0x28b5, 0x28b5, 0x28b5,
-	0x28b5, 0x28b5, 0x28b5, 0x28b5, 0x28b5, 0x28b5, 0x28b5, 0x28b5,
-	0x28b5, 0x28b5, 0x28b5, 0x28b5, 0x28b5, 0x28b5, 0x28b5, 0x28b5,
-	0x28b5, 0x28b5, 0x28b5, 0x28b5, 0x28b5, 0x28b7, 0x28b7, 0x28bc,
-	0x28bc, 0x28c3, 0x28c3, 0x28ca, 0x28ca, 0x28d3, 0x28d3, 0x28da,
-	0x28da, 0x28e3, 0x28e3, 0x28ec, 0x28ec, 0x28b5, 0x28b5, 0x28b5,
-	0x28b5, 0x28b5, 0x28b5, 0x28b5, 0x28b5, 0x28b5, 0x28b5, 0x28b5,
-	0x28b5, 0x28b5, 0x28b5, 0x28b5, 0x28b5, 0x28b5, 0x28b5, 0x28b5,
-	0x28b5, 0x28b5, 0x28b5, 0x28b5, 0x28b5, 0x28b5, 0x28b5, 0x28b5,
-	0x28b5, 0x28b5, 0x28b5, 0x28b5, 0x28b5, 0x28b5, 0x28b5, 0x28b5,
-	0x28b5, 0x28b5, 0x28b5, 0x28b5, 0x28b5, 0x28b5, 0x28b5, 0x28b5,
-	0x28b5, 0x28b5, 0x28b5, 0x28b5, 0x28b5, 0x28b5, 0x28b5, 0x28b5,
-	0x28b5, 0x28b5, 0x28b5, 0x28b5, 0x28b5, 0x28b5, 0x28b5, 0x28b5,
-	0x28b5, 0x28b5, 0x28b5, 0x28b5, 0x28b5, 0x0106, 0x0006, 0x0804,
-	0x28f7, 0x0106, 0x0006, 0x0804, 0x28f7, 0x0106, 0x0006, 0x080c,
-	0x2373, 0x0804, 0x28f7, 0x0106, 0x0006, 0x080c, 0x2373, 0x0804,
-	0x28f7, 0x0106, 0x0006, 0x080c, 0x223d, 0x0804, 0x28f7, 0x0106,
-	0x0006, 0x080c, 0x223d, 0x0804, 0x28f7, 0x0106, 0x0006, 0x080c,
-	0x2373, 0x080c, 0x223d, 0x0804, 0x28f7, 0x0106, 0x0006, 0x080c,
-	0x2373, 0x080c, 0x223d, 0x0804, 0x28f7, 0x0106, 0x0006, 0x080c,
-	0x228f, 0x0804, 0x28f7, 0x0106, 0x0006, 0x080c, 0x228f, 0x0804,
-	0x28f7, 0x0106, 0x0006, 0x080c, 0x2373, 0x080c, 0x228f, 0x0804,
-	0x28f7, 0x0106, 0x0006, 0x080c, 0x2373, 0x080c, 0x228f, 0x0804,
-	0x28f7, 0x0106, 0x0006, 0x080c, 0x223d, 0x080c, 0x228f, 0x0804,
-	0x28f7, 0x0106, 0x0006, 0x080c, 0x223d, 0x080c, 0x228f, 0x0804,
-	0x28f7, 0x0106, 0x0006, 0x080c, 0x2373, 0x080c, 0x223d, 0x080c,
-	0x228f, 0x0804, 0x28f7, 0x0106, 0x0006, 0x080c, 0x2373, 0x080c,
-	0x223d, 0x080c, 0x228f, 0x0804, 0x28f7, 0xe000, 0x0cf0, 0x0106,
-	0x0006, 0x080c, 0x272f, 0x04d8, 0x0106, 0x0006, 0x080c, 0x272f,
-	0x080c, 0x2373, 0x04a0, 0x0106, 0x0006, 0x080c, 0x272f, 0x080c,
-	0x223d, 0x0468, 0x0106, 0x0006, 0x080c, 0x272f, 0x080c, 0x2373,
-	0x080c, 0x223d, 0x0420, 0x0106, 0x0006, 0x080c, 0x272f, 0x080c,
-	0x228f, 0x00e8, 0x0106, 0x0006, 0x080c, 0x272f, 0x080c, 0x2373,
-	0x080c, 0x228f, 0x00a0, 0x0106, 0x0006, 0x080c, 0x272f, 0x080c,
-	0x223d, 0x080c, 0x228f, 0x0058, 0x0106, 0x0006, 0x080c, 0x272f,
-	0x080c, 0x2373, 0x080c, 0x223d, 0x080c, 0x228f, 0x0000, 0x000e,
-	0x010e, 0x000d, 0x00c6, 0x0026, 0x0046, 0x2021, 0x0000, 0x080c,
-	0x502d, 0x1904, 0x29d4, 0x72d0, 0x2001, 0xaf9d, 0x2004, 0xa005,
-	0x1110, 0xd29c, 0x0148, 0xd284, 0x1138, 0xd2bc, 0x1904, 0x29d4,
-	0x080c, 0x29d8, 0x0804, 0x29d4, 0x080c, 0x574f, 0x1120, 0x709b,
-	0xffff, 0x0804, 0x29d4, 0xd294, 0x0120, 0x709b, 0xffff, 0x0804,
-	0x29d4, 0x2001, 0xad14, 0x203c, 0x7284, 0xd284, 0x0904, 0x2976,
-	0xd28c, 0x1904, 0x2976, 0x0036, 0x7398, 0xa38e, 0xffff, 0x1110,
-	0x2019, 0x0001, 0x8314, 0xa2e0, 0xb3c0, 0x2c04, 0xa38c, 0x0001,
-	0x0120, 0xa084, 0xff00, 0x8007, 0x0010, 0xa084, 0x00ff, 0xa70e,
-	0x0560, 0xa08e, 0x0000, 0x0548, 0xa08e, 0x00ff, 0x1150, 0x7230,
-	0xd284, 0x1538, 0x7284, 0xc28d, 0x7286, 0x709b, 0xffff, 0x003e,
-	0x0428, 0x2009, 0x0000, 0x080c, 0x2676, 0x080c, 0x4c80, 0x11b8,
-	0x6004, 0xa084, 0x00ff, 0xa086, 0x0006, 0x1150, 0x7030, 0xd08c,
-	0x0118, 0x6000, 0xd0bc, 0x0120, 0x080c, 0x29eb, 0x0140, 0x0028,
-	0x080c, 0x2b1a, 0x080c, 0x2a19, 0x0110, 0x8318, 0x0818, 0x739a,
-	0x0010, 0x709b, 0xffff, 0x003e, 0x0804, 0x29d4, 0xa780, 0x2be6,
-	0x203d, 0xa7bc, 0xff00, 0x873f, 0x2041, 0x007e, 0x7098, 0xa096,
-	0xffff, 0x1120, 0x2009, 0x0000, 0x28a8, 0x0050, 0xa812, 0x0220,
-	0x2008, 0xa802, 0x20a8, 0x0020, 0x709b, 0xffff, 0x0804, 0x29d4,
-	0x2700, 0x0156, 0x0016, 0xa106, 0x05a0, 0xc484, 0x080c, 0x4cdc,
-	0x0120, 0x080c, 0x4c80, 0x15a8, 0x0008, 0xc485, 0x6004, 0xa084,
-	0x00ff, 0xa086, 0x0006, 0x1130, 0x7030, 0xd08c, 0x01e8, 0x6000,
-	0xd0bc, 0x11d0, 0x7284, 0xd28c, 0x0188, 0x6004, 0xa084, 0x00ff,
-	0xa082, 0x0006, 0x02b0, 0xd484, 0x1118, 0x080c, 0x4c9f, 0x0028,
-	0x080c, 0x2b9c, 0x0170, 0x080c, 0x2bc9, 0x0058, 0x080c, 0x2b1a,
-	0x080c, 0x2a19, 0x0170, 0x0028, 0x080c, 0x2b9c, 0x0110, 0x0419,
-	0x0140, 0x001e, 0x8108, 0x015e, 0x1f04, 0x2990, 0x709b, 0xffff,
-	0x0018, 0x001e, 0x015e, 0x719a, 0x004e, 0x002e, 0x00ce, 0x0005,
-	0x00c6, 0x0016, 0x709b, 0x0000, 0x2009, 0x007e, 0x080c, 0x4c80,
-	0x1138, 0x080c, 0x2b1a, 0x04a9, 0x0118, 0x70d0, 0xc0bd, 0x70d2,
-	0x001e, 0x00ce, 0x0005, 0x0016, 0x0076, 0x00d6, 0x00c6, 0x2c68,
-	0x2001, 0xad56, 0x2004, 0xa084, 0x00ff, 0x6842, 0x080c, 0x9807,
-	0x01d8, 0x2d00, 0x601a, 0x080c, 0x9956, 0x601f, 0x0001, 0x2001,
-	0x0000, 0x080c, 0x4c1e, 0x2001, 0x0000, 0x080c, 0x4c30, 0x0126,
-	0x2091, 0x8000, 0x7094, 0x8000, 0x7096, 0x012e, 0x2009, 0x0004,
-	0x080c, 0x80a7, 0xa085, 0x0001, 0x00ce, 0x00de, 0x007e, 0x001e,
-	0x0005, 0x0016, 0x0076, 0x00d6, 0x00c6, 0x2c68, 0x2001, 0xad56,
-	0x2004, 0xa084, 0x00ff, 0x6842, 0x080c, 0x9807, 0x0550, 0x2d00,
-	0x601a, 0x6800, 0xc0c4, 0x6802, 0x68a0, 0xa086, 0x007e, 0x0140,
-	0x6804, 0xa084, 0x00ff, 0xa086, 0x0006, 0x1110, 0x080c, 0x2ad9,
-	0x080c, 0x9956, 0x601f, 0x0001, 0x2001, 0x0000, 0x080c, 0x4c1e,
-	0x2001, 0x0002, 0x080c, 0x4c30, 0x0126, 0x2091, 0x8000, 0x7094,
-	0x8000, 0x7096, 0x012e, 0x2009, 0x0002, 0x080c, 0x80a7, 0xa085,
-	0x0001, 0x00ce, 0x00de, 0x007e, 0x001e, 0x0005, 0x00c6, 0x0026,
-	0x2009, 0x0080, 0x080c, 0x4c80, 0x1120, 0x0031, 0x0110, 0x70d7,
-	0xffff, 0x002e, 0x00ce, 0x0005, 0x0016, 0x0076, 0x00d6, 0x00c6,
-	0x2c68, 0x080c, 0x8022, 0x01d8, 0x2d00, 0x601a, 0x080c, 0x9956,
-	0x601f, 0x0001, 0x2001, 0x0000, 0x080c, 0x4c1e, 0x2001, 0x0002,
-	0x080c, 0x4c30, 0x0126, 0x2091, 0x8000, 0x70d8, 0x8000, 0x70da,
-	0x012e, 0x2009, 0x0002, 0x080c, 0x80a7, 0xa085, 0x0001, 0x00ce,
-	0x00de, 0x007e, 0x001e, 0x0005, 0x00c6, 0x00d6, 0x0126, 0x2091,
-	0x8000, 0x2009, 0x007f, 0x080c, 0x4c80, 0x1190, 0x2c68, 0x080c,
-	0x8022, 0x0170, 0x2d00, 0x601a, 0x6312, 0x601f, 0x0001, 0x620a,
-	0x080c, 0x9956, 0x2009, 0x0022, 0x080c, 0x80a7, 0xa085, 0x0001,
-	0x012e, 0x00de, 0x00ce, 0x0005, 0x00e6, 0x00c6, 0x0066, 0x0036,
-	0x0026, 0x080c, 0x68f3, 0x080c, 0x689d, 0x080c, 0x8a15, 0x2130,
-	0x81ff, 0x0128, 0x20a9, 0x007e, 0x2009, 0x0000, 0x0020, 0x20a9,
-	0x007f, 0x2009, 0x0000, 0x0016, 0x080c, 0x4cdc, 0x1120, 0x080c,
-	0x4ecf, 0x080c, 0x493a, 0x001e, 0x8108, 0x1f04, 0x2ac3, 0x86ff,
-	0x1110, 0x080c, 0x11d4, 0x002e, 0x003e, 0x006e, 0x00ce, 0x00ee,
-	0x0005, 0x00e6, 0x00c6, 0x0036, 0x0026, 0x0016, 0x6218, 0x2270,
-	0x72a0, 0x0026, 0x2019, 0x0029, 0x080c, 0x68e7, 0x0076, 0x2039,
-	0x0000, 0x080c, 0x681d, 0x2c08, 0x080c, 0xa712, 0x007e, 0x001e,
-	0x2e60, 0x080c, 0x4ecf, 0x6210, 0x6314, 0x080c, 0x493a, 0x6212,
-	0x6316, 0x001e, 0x002e, 0x003e, 0x00ce, 0x00ee, 0x0005, 0x00e6,
-	0x0006, 0x6018, 0xa080, 0x0028, 0x2004, 0xa086, 0x0080, 0x0150,
-	0x2071, 0xad00, 0x7094, 0xa005, 0x0110, 0x8001, 0x7096, 0x000e,
-	0x00ee, 0x0005, 0x2071, 0xad00, 0x70d8, 0xa005, 0x0dc0, 0x8001,
-	0x70da, 0x0ca8, 0x6000, 0xc08c, 0x6002, 0x0005, 0x00f6, 0x00e6,
-	0x00c6, 0x0036, 0x0026, 0x0016, 0x0156, 0x2178, 0x81ff, 0x1118,
-	0x20a9, 0x0001, 0x0098, 0x2001, 0xad52, 0x2004, 0xd0c4, 0x0150,
-	0xd0a4, 0x0140, 0xa006, 0x0046, 0x2020, 0x2009, 0x002d, 0x080c,
-	0xa96c, 0x004e, 0x20a9, 0x00ff, 0x2011, 0x0000, 0x0026, 0xa28e,
-	0x007e, 0x05c8, 0xa28e, 0x007f, 0x05b0, 0xa28e, 0x0080, 0x0598,
-	0xa288, 0xae34, 0x210c, 0x81ff, 0x0570, 0x8fff, 0x05c1, 0x00c6,
-	0x2160, 0x2001, 0x0001, 0x080c, 0x5037, 0x00ce, 0x2019, 0x0029,
-	0x080c, 0x68e7, 0x0076, 0x2039, 0x0000, 0x080c, 0x681d, 0x00c6,
-	0x0026, 0x2160, 0x6204, 0xa294, 0x00ff, 0xa286, 0x0006, 0x1118,
-	0x6007, 0x0404, 0x0028, 0x2001, 0x0004, 0x8007, 0xa215, 0x6206,
-	0x002e, 0x00ce, 0x0016, 0x2c08, 0x080c, 0xa712, 0x001e, 0x007e,
-	0x2160, 0x080c, 0x4ecf, 0x002e, 0x8210, 0x1f04, 0x2b3e, 0x015e,
-	0x001e, 0x002e, 0x003e, 0x00ce, 0x00ee, 0x00fe, 0x0005, 0x0046,
-	0x0026, 0x0016, 0x2001, 0xad52, 0x2004, 0xd0c4, 0x0148, 0xd0a4,
-	0x0138, 0xa006, 0x2220, 0x8427, 0x2009, 0x0029, 0x080c, 0xa96c,
-	0x001e, 0x002e, 0x004e, 0x0005, 0x0016, 0x0026, 0x0036, 0x00c6,
-	0x7284, 0x82ff, 0x01f8, 0x2011, 0xad52, 0x2214, 0xd2ac, 0x11d0,
-	0x2100, 0x080c, 0x268a, 0x81ff, 0x01b8, 0x2019, 0x0001, 0x8314,
-	0xa2e0, 0xb3c0, 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, 0xa180, 0xae34,
-	0x2004, 0xa065, 0x0178, 0x0016, 0x00c6, 0x080c, 0x9807, 0x001e,
-	0x090c, 0x14f6, 0x611a, 0x080c, 0x2ad9, 0x080c, 0x8078, 0x001e,
-	0x080c, 0x4c9f, 0x012e, 0x00ce, 0x001e, 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, 0xad81,
-	0x7003, 0x0002, 0xa006, 0x7012, 0x7016, 0x703a, 0x703e, 0x7033,
-	0xad91, 0x7037, 0xad91, 0x7007, 0x0001, 0x2061, 0xadd1, 0x6003,
-	0x0002, 0x0005, 0x1004, 0x2d0c, 0x0e04, 0x2d0c, 0x2071, 0xad81,
-	0x2b78, 0x7818, 0xd084, 0x1140, 0x2a60, 0x7820, 0xa08e, 0x0069,
-	0x1904, 0x2df1, 0x0804, 0x2d8a, 0x0005, 0x2071, 0xad81, 0x7004,
-	0x0002, 0x2d15, 0x2d16, 0x2d1f, 0x2d30, 0x0005, 0x1004, 0x2d1e,
-	0x0e04, 0x2d1e, 0x2b78, 0x7818, 0xd084, 0x01e8, 0x0005, 0x2b78,
-	0x2061, 0xadd1, 0x6008, 0xa08e, 0x0100, 0x0128, 0xa086, 0x0200,
-	0x0904, 0x2deb, 0x0005, 0x7014, 0x2068, 0x2a60, 0x7018, 0x0807,
-	0x7010, 0x2068, 0x6834, 0xa086, 0x0103, 0x0108, 0x0005, 0x2a60,
-	0x2b78, 0x7018, 0x0807, 0x2a60, 0x7820, 0xa08a, 0x0040, 0x1210,
-	0x61c0, 0x0042, 0x2100, 0xa08a, 0x003f, 0x1a04, 0x2de8, 0x61c0,
-	0x0804, 0x2d8a, 0x2dcc, 0x2df7, 0x2dff, 0x2e03, 0x2e0b, 0x2e11,
-	0x2e15, 0x2e21, 0x2e24, 0x2e2e, 0x2e31, 0x2de8, 0x2de8, 0x2de8,
-	0x2e34, 0x2de8, 0x2e43, 0x2e5a, 0x2e71, 0x2ee8, 0x2eed, 0x2f16,
-	0x2f67, 0x2f78, 0x2f96, 0x2fcd, 0x2fd7, 0x2fe4, 0x2ff7, 0x3018,
-	0x3021, 0x3057, 0x305d, 0x2de8, 0x3086, 0x2de8, 0x2de8, 0x2de8,
-	0x2de8, 0x2de8, 0x308d, 0x3097, 0x2de8, 0x2de8, 0x2de8, 0x2de8,
-	0x2de8, 0x2de8, 0x2de8, 0x2de8, 0x309f, 0x2de8, 0x2de8, 0x2de8,
-	0x2de8, 0x2de8, 0x30b1, 0x30b9, 0x2de8, 0x2de8, 0x2de8, 0x2de8,
-	0x2de8, 0x2de8, 0x0002, 0x30cb, 0x311f, 0x317a, 0x318a, 0x2de8,
-	0x31a4, 0x35cb, 0x3fbb, 0x2de8, 0x2de8, 0x2de8, 0x2de8, 0x2de8,
-	0x2de8, 0x2de8, 0x2de8, 0x2e2e, 0x2e31, 0x35cd, 0x2de8, 0x35da,
-	0x403c, 0x4097, 0x40fb, 0x2de8, 0x415a, 0x4180, 0x419f, 0x2de8,
-	0x2de8, 0x2de8, 0x2de8, 0x35de, 0x376b, 0x3785, 0x37a3, 0x3804,
-	0x3858, 0x3863, 0x389a, 0x38a9, 0x38b8, 0x38bb, 0x38de, 0x3928,
-	0x398e, 0x399b, 0x3a9c, 0x3bb3, 0x3bdc, 0x3cda, 0x3cfc, 0x3d08,
-	0x3d41, 0x3e05, 0x2de8, 0x2de8, 0x2de8, 0x2de8, 0x3e6d, 0x3e88,
-	0x3efa, 0x3fac, 0x713c, 0x0000, 0x2021, 0x4000, 0x080c, 0x3c39,
-	0x0126, 0x2091, 0x8000, 0x0e04, 0x2dd8, 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, 0x3c46, 0x7823,
-	0x0004, 0x7824, 0x0807, 0xa02e, 0x2520, 0x7b28, 0x7a2c, 0x7824,
-	0x7930, 0x0804, 0x3c49, 0x7924, 0x7828, 0x2114, 0x200a, 0x0804,
-	0x2dcc, 0x7924, 0x2114, 0x0804, 0x2dcc, 0x2099, 0x0009, 0x20a1,
-	0x0009, 0x20a9, 0x0007, 0x53a3, 0x7924, 0x7a28, 0x7b2c, 0x0804,
-	0x2dcc, 0x7824, 0x2060, 0x0090, 0x2009, 0x0002, 0x2011, 0x0001,
-	0x2019, 0x001b, 0x783b, 0x0017, 0x0804, 0x2dcc, 0x7d38, 0x7c3c,
-	0x0840, 0x7d38, 0x7c3c, 0x0888, 0x2061, 0x1000, 0xe10c, 0xa006,
-	0x2c15, 0xa200, 0x8c60, 0x8109, 0x1dd8, 0x2010, 0xa005, 0x0904,
-	0x2dcc, 0x0804, 0x2dee, 0x2069, 0xad51, 0x7824, 0x7930, 0xa11a,
-	0x1a04, 0x2df4, 0x8019, 0x0904, 0x2df4, 0x684a, 0x6942, 0x782c,
-	0x6852, 0x7828, 0x6856, 0xa006, 0x685a, 0x685e, 0x080c, 0x5a1c,
-	0x0804, 0x2dcc, 0x2069, 0xad51, 0x7824, 0x7934, 0xa11a, 0x1a04,
-	0x2df4, 0x8019, 0x0904, 0x2df4, 0x684e, 0x6946, 0x782c, 0x6862,
-	0x7828, 0x6866, 0xa006, 0x686a, 0x686e, 0x080c, 0x50d9, 0x0804,
-	0x2dcc, 0xa02e, 0x2520, 0x81ff, 0x1904, 0x2df1, 0x7924, 0x7b28,
-	0x7a2c, 0x20a9, 0x0005, 0x20a1, 0xad88, 0x41a1, 0x080c, 0x3c05,
-	0x0904, 0x2df1, 0x2009, 0x0020, 0x080c, 0x3c46, 0x701b, 0x2e89,
-	0x0005, 0x6834, 0x2008, 0xa084, 0x00ff, 0xa096, 0x0011, 0x0120,
-	0xa096, 0x0019, 0x1904, 0x2df1, 0x810f, 0xa18c, 0x00ff, 0x0904,
-	0x2df1, 0x710e, 0x700c, 0x8001, 0x0528, 0x700e, 0x080c, 0x3c05,
-	0x0904, 0x2df1, 0x2009, 0x0020, 0x2061, 0xadd1, 0x6224, 0x6328,
-	0x642c, 0x6530, 0xa290, 0x0040, 0xa399, 0x0000, 0xa4a1, 0x0000,
-	0xa5a9, 0x0000, 0x080c, 0x3c46, 0x701b, 0x2eb7, 0x0005, 0x6834,
-	0xa084, 0x00ff, 0xa096, 0x0002, 0x0120, 0xa096, 0x000a, 0x1904,
-	0x2df1, 0x08c0, 0x7010, 0x2068, 0x6838, 0xc0fd, 0x683a, 0x080c,
-	0x4b7c, 0x1128, 0x7007, 0x0003, 0x701b, 0x2ed1, 0x0005, 0x080c,
-	0x51df, 0x0126, 0x2091, 0x8000, 0x20a9, 0x0005, 0x2099, 0xad88,
-	0x530a, 0x2100, 0xa210, 0xa399, 0x0000, 0xa4a1, 0x0000, 0xa5a9,
-	0x0000, 0xad80, 0x000d, 0x2009, 0x0020, 0x012e, 0x0804, 0x3c49,
-	0x61a8, 0x7824, 0x60aa, 0x0804, 0x2dcc, 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,
-	0x2df1, 0x7924, 0x810f, 0xa18c, 0x00ff, 0x080c, 0x4cdc, 0x1904,
-	0x2df4, 0x7e38, 0xa684, 0x3fff, 0xa082, 0x4000, 0x0210, 0x0804,
-	0x2df4, 0x7c28, 0x7d2c, 0x080c, 0x4e96, 0xd28c, 0x1118, 0x080c,
-	0x4e41, 0x0010, 0x080c, 0x4e6f, 0x1518, 0x2061, 0xb400, 0x0126,
-	0x2091, 0x8000, 0x6000, 0xa086, 0x0000, 0x0148, 0x6010, 0xa06d,
-	0x0130, 0x683c, 0xa406, 0x1118, 0x6840, 0xa506, 0x0150, 0x012e,
-	0xace0, 0x0018, 0x2001, 0xad16, 0x2004, 0xac02, 0x1a04, 0x2df1,
-	0x0c30, 0x080c, 0x929c, 0x012e, 0x0904, 0x2df1, 0x0804, 0x2dcc,
-	0xa00e, 0x2001, 0x0005, 0x080c, 0x51df, 0x0126, 0x2091, 0x8000,
-	0x080c, 0x9803, 0x080c, 0x510c, 0x012e, 0x0804, 0x2dcc, 0x81ff,
-	0x1904, 0x2df1, 0x080c, 0x3c1a, 0x0904, 0x2df4, 0x080c, 0x4d96,
-	0x0904, 0x2df1, 0x080c, 0x4ea2, 0x0904, 0x2df1, 0x0804, 0x2dcc,
-	0x81ff, 0x1904, 0x2df1, 0x080c, 0x3c2a, 0x0904, 0x2df4, 0x080c,
-	0x4f0d, 0x0904, 0x2df1, 0x2019, 0x0005, 0x080c, 0x4ebd, 0x0904,
-	0x2df1, 0x7828, 0xa08a, 0x1000, 0x1a04, 0x2df4, 0x8003, 0x800b,
-	0x810b, 0xa108, 0x080c, 0x6519, 0x0804, 0x2dcc, 0x0126, 0x2091,
-	0x8000, 0x81ff, 0x0118, 0x2009, 0x0001, 0x0448, 0x2029, 0x00ff,
-	0x644c, 0x2400, 0xa506, 0x01f0, 0x2508, 0x080c, 0x4cdc, 0x11d0,
-	0x080c, 0x4f0d, 0x1128, 0x2009, 0x0002, 0x62b0, 0x2518, 0x00b8,
-	0x2019, 0x0004, 0x080c, 0x4ebd, 0x1118, 0x2009, 0x0006, 0x0078,
-	0x7824, 0xa08a, 0x1000, 0x1270, 0x8003, 0x800b, 0x810b, 0xa108,
-	0x080c, 0x6519, 0x8529, 0x1ae8, 0x012e, 0x0804, 0x2dcc, 0x012e,
-	0x0804, 0x2df1, 0x012e, 0x0804, 0x2df4, 0x080c, 0x3c1a, 0x0904,
-	0x2df4, 0x080c, 0x4dfc, 0x080c, 0x4e96, 0x0804, 0x2dcc, 0x81ff,
-	0x1904, 0x2df1, 0x080c, 0x3c1a, 0x0904, 0x2df4, 0x080c, 0x4ded,
-	0x080c, 0x4e96, 0x0804, 0x2dcc, 0x81ff, 0x1904, 0x2df1, 0x080c,
-	0x3c1a, 0x0904, 0x2df4, 0x080c, 0x4e71, 0x0904, 0x2df1, 0x080c,
-	0x4bc0, 0x080c, 0x4e3a, 0x080c, 0x4e96, 0x0804, 0x2dcc, 0x080c,
-	0x3c1a, 0x0904, 0x2df4, 0x080c, 0x4d96, 0x0904, 0x2df1, 0x62a0,
-	0x2019, 0x0005, 0x00c6, 0x080c, 0x4ecf, 0x2061, 0x0000, 0x080c,
-	0x68e7, 0x0076, 0x2039, 0x0000, 0x080c, 0x681d, 0x2009, 0x0000,
-	0x080c, 0xa712, 0x007e, 0x00ce, 0x080c, 0x4e96, 0x0804, 0x2dcc,
-	0x080c, 0x3c1a, 0x0904, 0x2df4, 0x080c, 0x4e96, 0x2208, 0x0804,
-	0x2dcc, 0x0156, 0x00d6, 0x00e6, 0x2069, 0xae13, 0x6810, 0x6914,
-	0xa10a, 0x1210, 0x2009, 0x0000, 0x6816, 0x2011, 0x0000, 0x2019,
-	0x0000, 0x20a9, 0x007e, 0x2069, 0xae34, 0x2d04, 0xa075, 0x0130,
-	0x704c, 0x0071, 0xa210, 0x7080, 0x0059, 0xa318, 0x8d68, 0x1f04,
-	0x3035, 0x2300, 0xa218, 0x00ee, 0x00de, 0x015e, 0x0804, 0x2dcc,
-	0x00f6, 0x0016, 0xa07d, 0x0140, 0x2001, 0x0000, 0x8000, 0x2f0c,
-	0x81ff, 0x0110, 0x2178, 0x0cd0, 0x001e, 0x00fe, 0x0005, 0x2069,
-	0xae13, 0x6910, 0x62ac, 0x0804, 0x2dcc, 0x81ff, 0x1904, 0x2df1,
-	0x614c, 0xa190, 0x2be6, 0x2215, 0xa294, 0x00ff, 0x636c, 0x83ff,
-	0x0108, 0x6270, 0x67d0, 0xd79c, 0x0118, 0x2031, 0x0001, 0x0090,
-	0xd7ac, 0x0118, 0x2031, 0x0003, 0x0068, 0xd7a4, 0x0118, 0x2031,
-	0x0002, 0x0040, 0x080c, 0x574f, 0x1118, 0x2031, 0x0004, 0x0010,
-	0x2031, 0x0000, 0x7e3a, 0x7f3e, 0x0804, 0x2dcc, 0x613c, 0x6240,
-	0x2019, 0xafa3, 0x231c, 0x0804, 0x2dcc, 0x0126, 0x2091, 0x8000,
-	0x6134, 0xa006, 0x2010, 0x2018, 0x012e, 0x0804, 0x2dcc, 0x080c,
-	0x3c2a, 0x0904, 0x2df4, 0x6244, 0x6338, 0x0804, 0x2dcc, 0x613c,
-	0x6240, 0x7824, 0x603e, 0x7b28, 0x6342, 0x2069, 0xad51, 0x831f,
-	0xa305, 0x6816, 0x782c, 0x2069, 0xafa3, 0x2d1c, 0x206a, 0x0804,
-	0x2dcc, 0x0126, 0x2091, 0x8000, 0x7824, 0x6036, 0x012e, 0x0804,
-	0x2dcc, 0x080c, 0x3c2a, 0x0904, 0x2df4, 0x7828, 0xa00d, 0x0904,
-	0x2df4, 0x782c, 0xa005, 0x0904, 0x2df4, 0x6244, 0x6146, 0x6338,
-	0x603a, 0x0804, 0x2dcc, 0x2001, 0xad00, 0x2004, 0xa086, 0x0003,
-	0x1904, 0x2df1, 0x00c6, 0x2061, 0x0100, 0x7924, 0x810f, 0xa18c,
-	0x00ff, 0xa196, 0x00ff, 0x1130, 0x2001, 0xad14, 0x2004, 0xa085,
-	0xff00, 0x0078, 0xa182, 0x007f, 0x16a0, 0xa188, 0x2be6, 0x210d,
-	0xa18c, 0x00ff, 0x2001, 0xad14, 0x2004, 0xa116, 0x0550, 0x810f,
-	0xa105, 0x0126, 0x2091, 0x8000, 0x0006, 0x080c, 0x8022, 0x000e,
-	0x01e0, 0x601a, 0x600b, 0xbc09, 0x601f, 0x0001, 0x080c, 0x3c05,
-	0x01d8, 0x6837, 0x0000, 0x7007, 0x0003, 0x6833, 0x0000, 0x6838,
-	0xc0fd, 0x683a, 0x701b, 0x3173, 0x2d00, 0x6012, 0x2009, 0x0032,
-	0x080c, 0x80a7, 0x012e, 0x00ce, 0x0005, 0x012e, 0x00ce, 0x0804,
-	0x2df1, 0x00ce, 0x0804, 0x2df4, 0x080c, 0x8078, 0x0cb0, 0x2001,
-	0xad00, 0x2004, 0xa086, 0x0003, 0x1904, 0x2df1, 0x00c6, 0x2061,
-	0x0100, 0x7924, 0x810f, 0xa18c, 0x00ff, 0xa196, 0x00ff, 0x1130,
-	0x2001, 0xad14, 0x2004, 0xa085, 0xff00, 0x0078, 0xa182, 0x007f,
-	0x16a0, 0xa188, 0x2be6, 0x210d, 0xa18c, 0x00ff, 0x2001, 0xad14,
-	0x2004, 0xa116, 0x0550, 0x810f, 0xa105, 0x0126, 0x2091, 0x8000,
-	0x0006, 0x080c, 0x8022, 0x000e, 0x01e0, 0x601a, 0x600b, 0xbc05,
-	0x601f, 0x0001, 0x080c, 0x3c05, 0x01d8, 0x6837, 0x0000, 0x7007,
-	0x0003, 0x6833, 0x0000, 0x6838, 0xc0fd, 0x683a, 0x701b, 0x3173,
-	0x2d00, 0x6012, 0x2009, 0x0032, 0x080c, 0x80a7, 0x012e, 0x00ce,
-	0x0005, 0x012e, 0x00ce, 0x0804, 0x2df1, 0x00ce, 0x0804, 0x2df4,
-	0x080c, 0x8078, 0x0cb0, 0x6830, 0xa086, 0x0100, 0x0904, 0x2df1,
-	0x0804, 0x2dcc, 0x2061, 0xb048, 0x0126, 0x2091, 0x8000, 0x6000,
-	0xd084, 0x0128, 0x6104, 0x6208, 0x012e, 0x0804, 0x2dcc, 0x012e,
-	0x0804, 0x2df4, 0x81ff, 0x1904, 0x2df1, 0x080c, 0x574f, 0x0904,
-	0x2df1, 0x0126, 0x2091, 0x8000, 0x6244, 0x6064, 0xa202, 0x0248,
-	0xa085, 0x0001, 0x080c, 0x26c0, 0x080c, 0x436e, 0x012e, 0x0804,
-	0x2dcc, 0x012e, 0x0804, 0x2df4, 0x0126, 0x2091, 0x8000, 0x7824,
-	0xa084, 0x0007, 0x0002, 0x31b6, 0x31bf, 0x31c6, 0x31b3, 0x31b3,
-	0x31b3, 0x31b3, 0x31b3, 0x012e, 0x0804, 0x2df4, 0x2009, 0x0114,
-	0x2104, 0xa085, 0x0800, 0x200a, 0x080c, 0x332f, 0x0070, 0x2009,
-	0x010b, 0x200b, 0x0010, 0x080c, 0x332f, 0x0038, 0x81ff, 0x0128,
-	0x012e, 0x2021, 0x400b, 0x0804, 0x2dce, 0x0086, 0x0096, 0x00a6,
-	0x00b6, 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x2009, 0x0101, 0x210c,
-	0x0016, 0x2001, 0x0138, 0x200c, 0x2003, 0x0001, 0x0016, 0x2001,
-	0x007a, 0x2034, 0x2001, 0x007b, 0x202c, 0xa006, 0x2048, 0x2050,
-	0x2058, 0x080c, 0x3570, 0x080c, 0x34da, 0xa03e, 0x2720, 0x00f6,
-	0x00e6, 0x00c6, 0x2d60, 0x2071, 0xb01e, 0x2079, 0x0020, 0x00d6,
-	0x2069, 0x0000, 0x6824, 0xd0b4, 0x0140, 0x2001, 0x007d, 0x2004,
-	0x783e, 0x2001, 0x007c, 0x2004, 0x783a, 0x00de, 0x2011, 0x0001,
-	0x080c, 0x3486, 0x080c, 0x3486, 0x00ce, 0x00ee, 0x00fe, 0x080c,
-	0x33d5, 0x080c, 0x34ae, 0x080c, 0x342b, 0x080c, 0x3394, 0x080c,
-	0x33c5, 0x00f6, 0x2079, 0x0100, 0x7824, 0xd094, 0x0530, 0x7814,
-	0xa084, 0x0184, 0xa085, 0x0010, 0x7816, 0x2079, 0x0140, 0x080c,
-	0x330d, 0x1110, 0x00fe, 0x0430, 0x7804, 0xd0dc, 0x0dc0, 0x2079,
-	0x0100, 0x7827, 0x0086, 0x7814, 0xa084, 0x0184, 0xa085, 0x0032,
-	0x7816, 0x080c, 0x330d, 0x1110, 0x00fe, 0x00a0, 0x7824, 0xd0bc,
-	0x0dc0, 0x7827, 0x0080, 0xa026, 0x7c16, 0x7824, 0xd0ac, 0x0130,
-	0x8b58, 0x080c, 0x3317, 0x00fe, 0x0804, 0x32d7, 0x00fe, 0x080c,
-	0x330d, 0x1150, 0x8948, 0x2001, 0x007a, 0x2602, 0x2001, 0x007b,
-	0x2502, 0x080c, 0x3317, 0x0088, 0x87ff, 0x0140, 0x2001, 0x0201,
-	0x2004, 0xa005, 0x1904, 0x3211, 0x8739, 0x0038, 0x2001, 0xaffd,
-	0x2004, 0xa086, 0x0000, 0x1904, 0x3211, 0x2001, 0x0033, 0x2003,
-	0x00f6, 0x8631, 0x1208, 0x8529, 0x2500, 0xa605, 0x0904, 0x32d7,
-	0x7824, 0xd0bc, 0x0128, 0x2900, 0xaa05, 0xab05, 0x1904, 0x32d7,
-	0x6033, 0x000d, 0x2001, 0x0030, 0x2003, 0x0004, 0x7824, 0xd0ac,
-	0x1148, 0x2001, 0xaffd, 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, 0x32ac, 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, 0x31ef, 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, 0x2dcc,
-	0x012e, 0x2021, 0x400c, 0x0804, 0x2dce, 0xa085, 0x0001, 0x1d04,
-	0x3316, 0x2091, 0x6000, 0x8420, 0xa486, 0x0064, 0x0005, 0x2001,
-	0x0105, 0x2003, 0x0010, 0x2001, 0x0030, 0x2003, 0x0004, 0x2001,
-	0x0020, 0x2003, 0x0004, 0x2001, 0xaffd, 0x2003, 0x0000, 0x2001,
-	0xb01e, 0x2003, 0x0000, 0x20e1, 0xf000, 0xa026, 0x0005, 0x00f6,
-	0x2079, 0x0100, 0x2001, 0xad14, 0x200c, 0x7932, 0x7936, 0x080c,
-	0x26a0, 0x7850, 0xa084, 0x0980, 0xa085, 0x0030, 0x7852, 0x2019,
-	0x01f4, 0x8319, 0x1df0, 0xa084, 0x0980, 0x7852, 0x782c, 0xc0ad,
-	0x782e, 0x20a9, 0x0046, 0x1d04, 0x334b, 0x2091, 0x6000, 0x1f04,
-	0x334b, 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, 0x3368, 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, 0xaffd, 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,
-	0x2009, 0xad14, 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, 0x34ae, 0x080c, 0x330d, 0x1110, 0x8421, 0x0028, 0x7024,
-	0xd0bc, 0x0db0, 0x7027, 0x0080, 0x00f6, 0x00e6, 0x2071, 0xaffd,
-	0x2079, 0x0030, 0x00d6, 0x2069, 0x0000, 0x6824, 0xd0b4, 0x0120,
-	0x683c, 0x783e, 0x6838, 0x783a, 0x00de, 0x2011, 0x0011, 0x080c,
-	0x3486, 0x2011, 0x0001, 0x080c, 0x3486, 0x00ee, 0x00fe, 0x7017,
-	0x0000, 0x00ee, 0x0005, 0x00f6, 0x00e6, 0x2071, 0xaffd, 0x2079,
-	0x0030, 0x7904, 0xd1fc, 0x0904, 0x3483, 0x7803, 0x0002, 0xa026,
-	0xd19c, 0x1904, 0x347f, 0x7000, 0x0002, 0x3483, 0x3441, 0x3465,
-	0x347f, 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, 0x33b1, 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, 0xb01e, 0x2079, 0x0020, 0x7904, 0xd1fc, 0x01f0,
-	0x7803, 0x0002, 0x2d60, 0xa026, 0x7000, 0x0002, 0x34d6, 0x34c1,
-	0x34cd, 0x8001, 0x7002, 0xd19c, 0x1188, 0x2011, 0x0001, 0x080c,
-	0x3486, 0x0160, 0x080c, 0x3486, 0x0048, 0x8001, 0x7002, 0x7804,
-	0xd0fc, 0x1d30, 0x2011, 0x0001, 0x080c, 0x3486, 0x00ce, 0x00ee,
-	0x00fe, 0x0005, 0x00f6, 0x00e6, 0x00c6, 0x2061, 0x0200, 0x601b,
-	0x0004, 0x2061, 0x0100, 0x60cf, 0x0400, 0x6004, 0xc0ac, 0xa085,
-	0x0200, 0x6006, 0x2001, 0x0074, 0x2004, 0xa005, 0x01f8, 0x2038,
-	0x2001, 0x0076, 0x2024, 0x2001, 0x0077, 0x201c, 0x080c, 0x3c05,
-	0x6833, 0x000d, 0x6f26, 0x2d00, 0x681a, 0xa78a, 0x0007, 0x0220,
-	0x2138, 0x2009, 0x0007, 0x0010, 0x2708, 0xa03e, 0x6818, 0xa080,
-	0x000d, 0x04a1, 0x1d90, 0x2d00, 0x681a, 0x0088, 0x080c, 0x3c05,
-	0x6833, 0x000d, 0x2070, 0x6827, 0x0001, 0x2d00, 0x681a, 0x2001,
-	0x0076, 0x2004, 0x2072, 0x2001, 0x0077, 0x2004, 0x7006, 0x2061,
-	0x0020, 0x2079, 0x0100, 0x6013, 0x0400, 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, 0x3c05, 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, 0x3c05, 0x2d60,
-	0x6833, 0x000d, 0x6f26, 0x2d00, 0x681a, 0xa78a, 0x0007, 0x0220,
-	0x2138, 0x2009, 0x0007, 0x0010, 0x2708, 0xa03e, 0x6818, 0xa080,
-	0x000d, 0x080c, 0x353e, 0x1d88, 0x2d00, 0x681a, 0x00e0, 0x080c,
-	0x3c05, 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, 0xaffd, 0x2003, 0x0003, 0x2001, 0x0030, 0x2003,
-	0x0009, 0x00ee, 0x0005, 0x0804, 0x2dcc, 0x0126, 0x2091, 0x8000,
-	0x20a9, 0x0011, 0x2001, 0xad40, 0x20a0, 0xa006, 0x40a4, 0x012e,
-	0x0804, 0x2dcc, 0x7d38, 0x7c3c, 0x0804, 0x2e73, 0x080c, 0x3c05,
-	0x0904, 0x2df1, 0x080c, 0x574f, 0x0110, 0x080c, 0x491f, 0x2009,
-	0x001c, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x080c, 0x3c46, 0x701b,
-	0x35f2, 0x0005, 0xade8, 0x000d, 0x6800, 0xa005, 0x0904, 0x2df4,
-	0x6804, 0xd0ac, 0x0118, 0xd0a4, 0x0904, 0x2df4, 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,
-	0x2df4, 0xa288, 0x2be6, 0x210d, 0xa18c, 0x00ff, 0x6156, 0xd0dc,
-	0x0130, 0x6828, 0xa08a, 0x007f, 0x1a04, 0x2df4, 0x604e, 0x6808,
-	0xa08a, 0x0100, 0x0a04, 0x2df4, 0xa08a, 0x0841, 0x1a04, 0x2df4,
-	0xa084, 0x0007, 0x1904, 0x2df4, 0x680c, 0xa005, 0x0904, 0x2df4,
-	0x6810, 0xa005, 0x0904, 0x2df4, 0x6848, 0x6940, 0xa10a, 0x1a04,
-	0x2df4, 0x8001, 0x0904, 0x2df4, 0x684c, 0x6944, 0xa10a, 0x1a04,
-	0x2df4, 0x8001, 0x0904, 0x2df4, 0x6804, 0xd0fc, 0x0560, 0x080c,
-	0x3c05, 0x0904, 0x2df1, 0x2009, 0x0014, 0x7a2c, 0x7b28, 0x7c3c,
-	0x7d38, 0xa290, 0x0038, 0xa399, 0x0000, 0x080c, 0x3c46, 0x701b,
-	0x3672, 0x0005, 0xade8, 0x000d, 0x20a9, 0x0014, 0x2d98, 0x2069,
-	0xad6d, 0x2da0, 0x53a3, 0x7010, 0xa0e8, 0x000d, 0x2001, 0xad71,
-	0x200c, 0xd1e4, 0x0140, 0x00c6, 0x2061, 0x0100, 0x6004, 0xa085,
-	0x0b00, 0x6006, 0x00ce, 0x20a9, 0x001c, 0x2d98, 0x2069, 0xad51,
-	0x2da0, 0x53a3, 0x6814, 0xa08c, 0x00ff, 0x613e, 0x8007, 0xa084,
-	0x00ff, 0x6042, 0x080c, 0x5a1c, 0x080c, 0x5070, 0x080c, 0x50d9,
-	0x6000, 0xa086, 0x0000, 0x1904, 0x3755, 0x6808, 0x602a, 0x080c,
-	0x22f8, 0x0006, 0x2001, 0x0100, 0x2004, 0xa082, 0x0005, 0x000e,
-	0x0268, 0x2009, 0x0170, 0x200b, 0x0080, 0xe000, 0xe000, 0x200b,
-	0x0000, 0x0036, 0x6b08, 0x080c, 0x26fb, 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, 0xafad, 0x40a1, 0x080c, 0x659c, 0x6904,
-	0xd1fc, 0x0520, 0x00c6, 0x2009, 0x0000, 0x20a9, 0x0001, 0x6b70,
-	0xd384, 0x01c8, 0x0020, 0x839d, 0x12b0, 0x3508, 0x8109, 0x080c,
-	0x5fa9, 0x6878, 0x6016, 0x6874, 0x2008, 0xa084, 0xff00, 0x8007,
-	0x600a, 0xa184, 0x00ff, 0x6006, 0x8108, 0x1118, 0x6003, 0x0003,
-	0x0010, 0x6003, 0x0001, 0x1f04, 0x36f3, 0x00ce, 0x2069, 0xad51,
-	0x2001, 0xaf9d, 0x6a80, 0xa294, 0x0030, 0xa28e, 0x0000, 0x0170,
-	0xa28e, 0x0010, 0x0118, 0xa28e, 0x0020, 0x0140, 0x2003, 0xaaaa,
-	0x080c, 0x2744, 0x2001, 0xaf8e, 0x2102, 0x0008, 0x2102, 0x00c6,
-	0x2061, 0x0100, 0x602f, 0x0040, 0x602f, 0x0000, 0x00ce, 0x080c,
-	0x574f, 0x0128, 0x080c, 0x3e5f, 0x0110, 0x080c, 0x26c0, 0x60c4,
-	0xa005, 0x01b0, 0x6003, 0x0001, 0x2009, 0x373f, 0x00c0, 0x080c,
-	0x574f, 0x1158, 0x2011, 0x566e, 0x080c, 0x650d, 0x2001, 0xaf9e,
-	0x2003, 0x0000, 0x080c, 0x569a, 0x0040, 0x080c, 0x485e, 0x0028,
-	0x6003, 0x0004, 0x2009, 0x3755, 0x0010, 0x0804, 0x2dcc, 0x2001,
-	0x0100, 0x2004, 0xa082, 0x0005, 0x0258, 0x2001, 0x0170, 0x2004,
-	0xa084, 0x00ff, 0xa086, 0x004c, 0x1118, 0x2091, 0x309d, 0x0817,
-	0x2091, 0x301d, 0x0817, 0x6000, 0xa086, 0x0000, 0x0904, 0x2df1,
-	0x2069, 0xad51, 0x7830, 0x6842, 0x7834, 0x6846, 0x6804, 0xd0fc,
-	0x0118, 0x2009, 0x0030, 0x0010, 0x2009, 0x001c, 0x2d00, 0x7a2c,
-	0x7b28, 0x7c3c, 0x7d38, 0x0804, 0x3c49, 0xa006, 0x080c, 0x26c0,
-	0x81ff, 0x1904, 0x2df1, 0x080c, 0x574f, 0x1178, 0x2001, 0xaf9e,
-	0x2003, 0x0001, 0x2001, 0xad00, 0x2003, 0x0001, 0xa085, 0x0001,
-	0x080c, 0x5793, 0x080c, 0x569a, 0x0020, 0x080c, 0x491f, 0x080c,
-	0x485e, 0x0804, 0x2dcc, 0x81ff, 0x1904, 0x2df1, 0x080c, 0x574f,
-	0x1110, 0x0804, 0x2df1, 0x6184, 0x81ff, 0x0198, 0x703f, 0x0000,
-	0x2001, 0xb3c0, 0x2009, 0x0040, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38,
-	0x0126, 0x2091, 0x8000, 0x080c, 0x3c49, 0x701b, 0x2dca, 0x012e,
-	0x0005, 0x703f, 0x0001, 0x00d6, 0x2069, 0xb3c0, 0x20a9, 0x0040,
-	0x20a1, 0xb3c0, 0x2019, 0xffff, 0x43a4, 0x654c, 0xa588, 0x2be6,
-	0x210d, 0xa18c, 0x00ff, 0x216a, 0xa00e, 0x2011, 0x0002, 0x2100,
-	0xa506, 0x01a8, 0x080c, 0x4cdc, 0x1190, 0x6014, 0x821c, 0x0238,
-	0xa398, 0xb3c0, 0xa085, 0xff00, 0x8007, 0x201a, 0x0038, 0xa398,
-	0xb3c0, 0x2324, 0xa4a4, 0xff00, 0xa405, 0x201a, 0x8210, 0x8108,
-	0xa182, 0x0080, 0x1208, 0x0c18, 0x8201, 0x8007, 0x2d0c, 0xa105,
-	0x206a, 0x00de, 0x20a9, 0x0040, 0x20a1, 0xb3c0, 0x2099, 0xb3c0,
-	0x080c, 0x48be, 0x0804, 0x37b0, 0x080c, 0x3c2a, 0x0904, 0x2df4,
-	0x00c6, 0x080c, 0x3c05, 0x00ce, 0x1120, 0x2009, 0x0002, 0x0804,
-	0x2df1, 0x2001, 0xad52, 0x2004, 0xd0b4, 0x01f0, 0x6000, 0xd08c,
-	0x11d8, 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006, 0x11a8, 0x6837,
-	0x0000, 0x6838, 0xc0fd, 0x683a, 0x080c, 0x970b, 0x1120, 0x2009,
-	0x0003, 0x0804, 0x2df1, 0x7007, 0x0003, 0x701b, 0x3830, 0x0005,
-	0x080c, 0x3c2a, 0x0904, 0x2df4, 0x20a9, 0x002b, 0x2c98, 0xade8,
-	0x0002, 0x2da0, 0x53a3, 0x20a9, 0x0004, 0xac80, 0x0006, 0x2098,
-	0xad80, 0x0006, 0x20a0, 0x080c, 0x48be, 0x20a9, 0x0004, 0xac80,
-	0x000a, 0x2098, 0xad80, 0x000a, 0x20a0, 0x080c, 0x48be, 0x2d00,
-	0x2009, 0x002b, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x0804, 0x3c49,
-	0x81ff, 0x1904, 0x2df1, 0x080c, 0x3c1a, 0x0904, 0x2df4, 0x080c,
-	0x4eab, 0x0804, 0x2dcc, 0x81ff, 0x1904, 0x2df1, 0x7828, 0xa08a,
-	0x1000, 0x1a04, 0x2df4, 0x080c, 0x3c2a, 0x0904, 0x2df4, 0x080c,
-	0x4f0d, 0x0904, 0x2df1, 0x2019, 0x0004, 0x080c, 0x4ebd, 0x7924,
-	0x810f, 0x7a28, 0x0011, 0x0804, 0x2dcc, 0xa186, 0x00ff, 0x0110,
-	0x0071, 0x0060, 0x2029, 0x007e, 0x2061, 0xad00, 0x644c, 0x2400,
-	0xa506, 0x0110, 0x2508, 0x0019, 0x8529, 0x1ec8, 0x0005, 0x080c,
-	0x4cdc, 0x1138, 0x2200, 0x8003, 0x800b, 0x810b, 0xa108, 0x080c,
-	0x6519, 0x0005, 0x81ff, 0x1904, 0x2df1, 0x080c, 0x3c1a, 0x0904,
-	0x2df4, 0x080c, 0x4d96, 0x0904, 0x2df1, 0x080c, 0x4eb4, 0x0804,
-	0x2dcc, 0x81ff, 0x1904, 0x2df1, 0x080c, 0x3c1a, 0x0904, 0x2df4,
-	0x080c, 0x4d96, 0x0904, 0x2df1, 0x080c, 0x4ea2, 0x0804, 0x2dcc,
-	0x6100, 0x0804, 0x2dcc, 0x080c, 0x3c2a, 0x0904, 0x2df4, 0x2001,
-	0xad00, 0x2004, 0xa086, 0x0003, 0x1904, 0x2df1, 0x00d6, 0xace8,
-	0x000a, 0x7924, 0xd184, 0x0110, 0xace8, 0x0006, 0x680c, 0x8007,
-	0x783e, 0x6808, 0x8007, 0x783a, 0x6b04, 0x831f, 0x6a00, 0x8217,
-	0x00de, 0x6100, 0xa18c, 0x0200, 0x0804, 0x2dcc, 0x7824, 0xa09c,
-	0x00ff, 0xa39a, 0x0003, 0x1a04, 0x2df1, 0x624c, 0xa294, 0x00ff,
-	0xa084, 0xff00, 0x8007, 0xa206, 0x1150, 0x2001, 0xad40, 0x2009,
-	0x000c, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x0804, 0x3c49, 0x81ff,
-	0x1904, 0x2df1, 0x080c, 0x3c2a, 0x0904, 0x2df4, 0x6004, 0xa084,
-	0x00ff, 0xa086, 0x0006, 0x1904, 0x2df1, 0x00c6, 0x080c, 0x3c05,
-	0x00ce, 0x0904, 0x2df1, 0x6837, 0x0000, 0x6838, 0xc0fd, 0x683a,
-	0x080c, 0x96b7, 0x0904, 0x2df1, 0x7007, 0x0003, 0x701b, 0x3919,
-	0x0005, 0x6830, 0xa086, 0x0100, 0x0904, 0x2df1, 0xad80, 0x000e,
-	0x2009, 0x000c, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x0804, 0x3c49,
-	0xa006, 0x080c, 0x26c0, 0x7824, 0xa084, 0x00ff, 0xa086, 0x00ff,
-	0x0118, 0x81ff, 0x1904, 0x2df1, 0x080c, 0x574f, 0x0110, 0x080c,
-	0x491f, 0x7828, 0xa08a, 0x1000, 0x1a04, 0x2df4, 0x7924, 0xa18c,
-	0xff00, 0x810f, 0xa186, 0x00ff, 0x0138, 0xa182, 0x007f, 0x1a04,
-	0x2df4, 0x2100, 0x080c, 0x268a, 0x0026, 0x00c6, 0x0126, 0x2091,
-	0x8000, 0x2061, 0xafda, 0x601b, 0x0000, 0x601f, 0x0000, 0x080c,
-	0x574f, 0x1178, 0x2001, 0xaf9e, 0x2003, 0x0001, 0x2001, 0xad00,
-	0x2003, 0x0001, 0xa085, 0x0001, 0x080c, 0x5793, 0x080c, 0x569a,
-	0x00a0, 0x2061, 0x0100, 0x2001, 0xad14, 0x2004, 0xa084, 0x00ff,
-	0x810f, 0xa105, 0x604a, 0x6043, 0x0090, 0x6043, 0x0010, 0x2009,
-	0x002d, 0x2011, 0x4883, 0x080c, 0x6593, 0x7924, 0xa18c, 0xff00,
-	0x810f, 0x080c, 0x574f, 0x1110, 0x2009, 0x00ff, 0x7a28, 0x080c,
-	0x387d, 0x012e, 0x00ce, 0x002e, 0x0804, 0x2dcc, 0x7924, 0xa18c,
-	0xff00, 0x810f, 0x00c6, 0x080c, 0x4c80, 0x2c08, 0x00ce, 0x1904,
-	0x2df4, 0x0804, 0x2dcc, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804,
-	0x2df1, 0x60d0, 0xd0ac, 0x1130, 0xd09c, 0x1120, 0x2009, 0x0005,
-	0x0804, 0x2df1, 0x080c, 0x3c05, 0x1120, 0x2009, 0x0002, 0x0804,
-	0x2df1, 0x7924, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x080c, 0x3c46,
-	0x701b, 0x39bb, 0x0005, 0x2009, 0x0080, 0x080c, 0x4cdc, 0x1130,
-	0x6004, 0xa084, 0x00ff, 0xa086, 0x0006, 0x0120, 0x2021, 0x400a,
-	0x0804, 0x2dce, 0x00d6, 0xade8, 0x000d, 0x6900, 0x6a08, 0x6b0c,
-	0x6c10, 0x6d14, 0x6e18, 0x6820, 0xa0be, 0x0100, 0x0904, 0x3a32,
-	0xa0be, 0x0112, 0x0904, 0x3a32, 0xa0be, 0x0113, 0x0904, 0x3a32,
-	0xa0be, 0x0114, 0x0904, 0x3a32, 0xa0be, 0x0117, 0x0904, 0x3a32,
-	0xa0be, 0x011a, 0x0904, 0x3a32, 0xa0be, 0x011c, 0x0904, 0x3a32,
-	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, 0x2df4, 0xad80, 0x0010, 0x20a9, 0x0007,
-	0x080c, 0x3a78, 0xad80, 0x000e, 0x20a9, 0x0001, 0x080c, 0x3a78,
-	0x0048, 0xad80, 0x000c, 0x080c, 0x3a86, 0x0050, 0xad80, 0x000e,
-	0x080c, 0x3a86, 0xad80, 0x000c, 0x20a9, 0x0001, 0x080c, 0x3a78,
-	0x00c6, 0x080c, 0x3c05, 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, 0x96d3, 0x1120,
-	0x2009, 0x0003, 0x0804, 0x2df1, 0x7007, 0x0003, 0x701b, 0x3a6f,
-	0x0005, 0x00ce, 0x00de, 0x2009, 0x0002, 0x0804, 0x2df1, 0x6820,
-	0xa086, 0x8001, 0x1904, 0x2dcc, 0x2009, 0x0004, 0x0804, 0x2df1,
-	0x0016, 0x2008, 0x2044, 0x8000, 0x204c, 0x8000, 0x290a, 0x8108,
-	0x280a, 0x8108, 0x1f04, 0x3a7a, 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, 0x2df1, 0x7924, 0x2140, 0xa18c, 0xff00, 0x810f, 0x60d0,
-	0xd0ac, 0x1120, 0xa182, 0x0080, 0x0a04, 0x2df4, 0xa182, 0x00ff,
-	0x1a04, 0x2df4, 0x7a2c, 0x7b28, 0x606c, 0xa306, 0x1140, 0x6070,
-	0xa24e, 0x0904, 0x2df4, 0xa9cc, 0xff00, 0x0904, 0x2df4, 0x00c6,
-	0x080c, 0x3b58, 0x2c68, 0x00ce, 0x0538, 0xa0c6, 0x4000, 0x1180,
-	0x00c6, 0x0006, 0x2d60, 0x2009, 0x0000, 0x080c, 0x4f6e, 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, 0x2dce, 0x2d00, 0x7022, 0x0016, 0x00b6,
-	0x00c6, 0x00e6, 0x2c70, 0x080c, 0x8022, 0x05d8, 0x2d00, 0x601a,
-	0x080c, 0x9956, 0x2e58, 0x00ee, 0x00e6, 0x00c6, 0x080c, 0x3c05,
-	0x00ce, 0x2b70, 0x1150, 0x080c, 0x8078, 0x00ee, 0x00ce, 0x00be,
-	0x001e, 0x2009, 0x0002, 0x0804, 0x2df1, 0x6837, 0x0000, 0x683b,
-	0x0000, 0x2d00, 0x6012, 0x6833, 0x0000, 0x6838, 0xc0fd, 0xd88c,
-	0x0108, 0xc0f5, 0x683a, 0x0126, 0x2091, 0x8000, 0x080c, 0x2ad9,
-	0x012e, 0x601f, 0x0001, 0x2001, 0x0000, 0x080c, 0x4c1e, 0x2001,
-	0x0002, 0x080c, 0x4c30, 0x2009, 0x0002, 0x080c, 0x80a7, 0xa085,
-	0x0001, 0x00ee, 0x00ce, 0x00be, 0x001e, 0x1120, 0x2009, 0x0003,
-	0x0804, 0x2df1, 0x7007, 0x0003, 0x701b, 0x3b3f, 0x0005, 0x6830,
-	0xa086, 0x0100, 0x7020, 0x2060, 0x1138, 0x2009, 0x0004, 0x6204,
-	0xa294, 0x00ff, 0x0804, 0x2df1, 0x2009, 0x0000, 0x080c, 0x4f6e,
-	0x1108, 0xc185, 0x6000, 0xd0bc, 0x0108, 0xc18d, 0x0804, 0x2dcc,
-	0x00e6, 0x00d6, 0x2029, 0x0000, 0x2001, 0xad34, 0x2004, 0xd0ac,
-	0x0138, 0x2021, 0x0000, 0x20a9, 0x00ff, 0x2071, 0xae34, 0x0030,
-	0x2021, 0x0080, 0x20a9, 0x007f, 0x2071, 0xaeb4, 0x2e04, 0xa005,
-	0x1130, 0x2100, 0xa406, 0x1548, 0x2428, 0xc5fd, 0x0430, 0x2068,
-	0x6f10, 0x2700, 0xa306, 0x11b0, 0x6e14, 0x2600, 0xa206, 0x1190,
-	0x2400, 0xa106, 0x1160, 0x2d60, 0xd884, 0x0540, 0x6004, 0xa084,
-	0x00ff, 0xa086, 0x0006, 0x1510, 0x2001, 0x4000, 0x0400, 0x2001,
-	0x4007, 0x00e8, 0x2400, 0xa106, 0x1140, 0x6e14, 0x87ff, 0x1110,
-	0x86ff, 0x09d0, 0x2001, 0x4008, 0x0090, 0x8420, 0x8e70, 0x1f04,
-	0x3b6e, 0x85ff, 0x1130, 0x2001, 0x4009, 0x0048, 0x2001, 0x0001,
-	0x0030, 0x080c, 0x4c80, 0x1dd0, 0x6312, 0x6216, 0xa006, 0xa005,
-	0x00de, 0x00ee, 0x0005, 0x81ff, 0x1904, 0x2df1, 0x080c, 0x3c05,
-	0x0904, 0x2df1, 0x6837, 0x0000, 0x6838, 0xc0fd, 0x683a, 0x7824,
-	0xa005, 0x0904, 0x2df4, 0xa096, 0x00ff, 0x0120, 0xa092, 0x0004,
-	0x1a04, 0x2df4, 0x2010, 0x2d18, 0x080c, 0x2a8c, 0x0904, 0x2df1,
-	0x7007, 0x0003, 0x701b, 0x3bd5, 0x0005, 0x6830, 0xa086, 0x0100,
-	0x0904, 0x2df1, 0x0804, 0x2dcc, 0x7924, 0xa18c, 0xff00, 0x810f,
-	0x60d0, 0xd0ac, 0x1120, 0xa182, 0x0080, 0x0a04, 0x2df4, 0xa182,
-	0x00ff, 0x1a04, 0x2df4, 0x0126, 0x2091, 0x8000, 0x080c, 0x95c6,
-	0x1188, 0xa190, 0xae34, 0x2204, 0xa065, 0x0160, 0x080c, 0x493a,
-	0x2001, 0xad34, 0x2004, 0xd0ac, 0x0110, 0x6017, 0x0000, 0x012e,
-	0x0804, 0x2dcc, 0x012e, 0x0804, 0x2df1, 0x080c, 0x15d9, 0x0188,
-	0xa006, 0x6802, 0x7010, 0xa005, 0x1120, 0x2d00, 0x7012, 0x7016,
-	0x0030, 0x7014, 0x6802, 0x2060, 0x2d00, 0x6006, 0x7016, 0xad80,
-	0x000d, 0x0005, 0x7924, 0x810f, 0xa18c, 0x00ff, 0x080c, 0x4cdc,
-	0x1130, 0x7e28, 0xa684, 0x3fff, 0xa082, 0x4000, 0x0208, 0xa066,
-	0x8cff, 0x0005, 0x7e24, 0x860f, 0xa18c, 0x00ff, 0x080c, 0x4cdc,
-	0x1128, 0xa6b4, 0x00ff, 0xa682, 0x4000, 0x0208, 0xa066, 0x8cff,
-	0x0005, 0x0016, 0x7110, 0x81ff, 0x0128, 0x2168, 0x6904, 0x080c,
-	0x15f0, 0x0cc8, 0x7112, 0x7116, 0x001e, 0x0005, 0x2031, 0x0001,
-	0x0010, 0x2031, 0x0000, 0x2061, 0xadd1, 0x6606, 0x6112, 0x600e,
-	0x6226, 0x632a, 0x642e, 0x6532, 0x2c10, 0x080c, 0x1624, 0x7007,
-	0x0002, 0x701b, 0x2dcc, 0x0005, 0x00f6, 0x0126, 0x2091, 0x8000,
-	0x2079, 0x0000, 0x2001, 0xad8f, 0x2004, 0xa005, 0x1168, 0x0e04,
-	0x3c74, 0x7818, 0xd084, 0x1140, 0x7a22, 0x7b26, 0x7c2a, 0x781b,
-	0x0001, 0x2091, 0x4080, 0x0408, 0x0016, 0x00c6, 0x00e6, 0x2071,
-	0xad81, 0x7138, 0xa182, 0x0010, 0x0218, 0x7030, 0x2060, 0x0078,
-	0x7030, 0xa0e0, 0x0004, 0xac82, 0xadd1, 0x0210, 0x2061, 0xad91,
-	0x2c00, 0x7032, 0x81ff, 0x1108, 0x7036, 0x8108, 0x713a, 0x2262,
-	0x6306, 0x640a, 0x00ee, 0x00ce, 0x001e, 0x012e, 0x00fe, 0x0005,
-	0x00e6, 0x2071, 0xad81, 0x7038, 0xa005, 0x0570, 0x0126, 0x2091,
-	0x8000, 0x0e04, 0x3ccb, 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, 0xad91, 0x7037, 0xad91, 0x00ce,
-	0x0048, 0xac80, 0x0004, 0xa0fa, 0xadd1, 0x0210, 0x2001, 0xad91,
-	0x7036, 0x00ce, 0x00fe, 0x012e, 0x00ee, 0x0005, 0x0026, 0x2001,
-	0xad52, 0x2004, 0xd0c4, 0x0120, 0x2011, 0x8014, 0x080c, 0x3c5c,
-	0x002e, 0x0005, 0x81ff, 0x1904, 0x2df1, 0x0126, 0x2091, 0x8000,
-	0x6030, 0xc08d, 0xc085, 0xc0ac, 0x6032, 0x080c, 0x574f, 0x1178,
-	0x2001, 0xaf9e, 0x2003, 0x0001, 0x2001, 0xad00, 0x2003, 0x0001,
-	0xa085, 0x0001, 0x080c, 0x5793, 0x080c, 0x569a, 0x0010, 0x080c,
-	0x485e, 0x012e, 0x0804, 0x2dcc, 0x7824, 0x2008, 0xa18c, 0xfffd,
-	0x1128, 0x61dc, 0xa10d, 0x61de, 0x0804, 0x2dcc, 0x0804, 0x2df4,
-	0x81ff, 0x1904, 0x2df1, 0x6000, 0xa086, 0x0003, 0x1904, 0x2df1,
-	0x2001, 0xad52, 0x2004, 0xd0ac, 0x1904, 0x2df1, 0x080c, 0x3c2a,
-	0x0904, 0x2df4, 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006, 0x1120,
-	0x7828, 0xa005, 0x0904, 0x2dcc, 0x00c6, 0x080c, 0x3c05, 0x00ce,
-	0x0904, 0x2df1, 0x6837, 0x0000, 0x6833, 0x0000, 0x6838, 0xc0fd,
-	0x683a, 0x080c, 0x979c, 0x0904, 0x2df1, 0x7007, 0x0003, 0x701b,
-	0x3d3a, 0x0005, 0x6830, 0xa086, 0x0100, 0x0904, 0x2df1, 0x0804,
-	0x2dcc, 0x2001, 0xad00, 0x2004, 0xa086, 0x0003, 0x1904, 0x2df1,
-	0x7f24, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x080c, 0x3c05, 0x0904,
-	0x2df1, 0x2009, 0x0000, 0x2031, 0x0000, 0x7023, 0x0000, 0x702f,
-	0x0000, 0xad80, 0x0005, 0x7026, 0x20a0, 0x080c, 0x4cdc, 0x1904,
-	0x3db4, 0x6004, 0xa0c4, 0x00ff, 0xa8c6, 0x0006, 0x0130, 0xa0c4,
-	0xff00, 0xa8c6, 0x0600, 0x1904, 0x3db4, 0x2001, 0xad52, 0x2004,
-	0xd0ac, 0x1128, 0x080c, 0x4f6e, 0x1110, 0xd79c, 0x05e8, 0xd794,
-	0x1110, 0xd784, 0x0158, 0xac80, 0x0006, 0x2098, 0x3400, 0x20a9,
-	0x0004, 0x53a3, 0x080c, 0x3a86, 0xd794, 0x0148, 0xac80, 0x000a,
-	0x2098, 0x3400, 0x20a9, 0x0004, 0x53a3, 0x080c, 0x3a86, 0x21a2,
-	0xd794, 0x01d8, 0xac80, 0x0000, 0x2098, 0x94a0, 0x20a9, 0x0002,
-	0x53a3, 0xac80, 0x0003, 0x20a6, 0x94a0, 0xac80, 0x0004, 0x2098,
-	0x3400, 0x20a9, 0x0002, 0x53a3, 0x080c, 0x3a78, 0xac80, 0x0026,
-	0x2098, 0x20a9, 0x0002, 0x53a3, 0x0008, 0x94a0, 0xd794, 0x0110,
-	0xa6b0, 0x000b, 0xa6b0, 0x0005, 0x8108, 0x2001, 0xad34, 0x2004,
-	0xd0ac, 0x0118, 0xa186, 0x0100, 0x0040, 0xd78c, 0x0120, 0xa186,
-	0x0100, 0x0170, 0x0018, 0xa186, 0x007e, 0x0150, 0xd794, 0x0118,
-	0xa686, 0x0020, 0x0010, 0xa686, 0x0028, 0x0150, 0x0804, 0x3d5d,
-	0x86ff, 0x1120, 0x7120, 0x810b, 0x0804, 0x2dcc, 0x702f, 0x0001,
-	0x711e, 0x7020, 0xa600, 0x7022, 0x772a, 0x2061, 0xadd1, 0x6007,
-	0x0000, 0x6612, 0x7024, 0x600e, 0x6226, 0x632a, 0x642e, 0x6532,
-	0x2c10, 0x080c, 0x1624, 0x7007, 0x0002, 0x701b, 0x3df0, 0x0005,
-	0x702c, 0xa005, 0x1170, 0x711c, 0x7024, 0x20a0, 0x7728, 0x2031,
-	0x0000, 0x2061, 0xadd1, 0x6224, 0x6328, 0x642c, 0x6530, 0x0804,
-	0x3d5d, 0x7120, 0x810b, 0x0804, 0x2dcc, 0x2029, 0x007e, 0x7924,
-	0x7a28, 0x7b2c, 0x7c38, 0xa184, 0xff00, 0x8007, 0xa0e2, 0x0020,
-	0x0a04, 0x2df4, 0xa502, 0x0a04, 0x2df4, 0xa184, 0x00ff, 0xa0e2,
-	0x0020, 0x0a04, 0x2df4, 0xa502, 0x0a04, 0x2df4, 0xa284, 0xff00,
-	0x8007, 0xa0e2, 0x0020, 0x0a04, 0x2df4, 0xa502, 0x0a04, 0x2df4,
-	0xa284, 0x00ff, 0xa0e2, 0x0020, 0x0a04, 0x2df4, 0xa502, 0x0a04,
-	0x2df4, 0xa384, 0xff00, 0x8007, 0xa0e2, 0x0020, 0x0a04, 0x2df4,
-	0xa502, 0x0a04, 0x2df4, 0xa384, 0x00ff, 0xa0e2, 0x0020, 0x0a04,
-	0x2df4, 0xa502, 0x0a04, 0x2df4, 0xa484, 0xff00, 0x8007, 0xa0e2,
-	0x0020, 0x0a04, 0x2df4, 0xa502, 0x0a04, 0x2df4, 0xa484, 0x00ff,
-	0xa0e2, 0x0020, 0x0a04, 0x2df4, 0xa502, 0x0a04, 0x2df4, 0x2061,
-	0xafa6, 0x6102, 0x6206, 0x630a, 0x640e, 0x0804, 0x2dcc, 0x0006,
-	0x2001, 0xad52, 0x2004, 0xd0cc, 0x000e, 0x0005, 0x0006, 0x2001,
-	0xad71, 0x2004, 0xd0bc, 0x000e, 0x0005, 0x6164, 0x7a24, 0x6300,
-	0x82ff, 0x1118, 0x7926, 0x0804, 0x2dcc, 0x83ff, 0x1904, 0x2df4,
-	0x2001, 0xfff0, 0xa200, 0x1a04, 0x2df4, 0x2019, 0xffff, 0x6068,
-	0xa302, 0xa200, 0x0a04, 0x2df4, 0x7926, 0x6266, 0x0804, 0x2dcc,
-	0x2001, 0xad00, 0x2004, 0xa086, 0x0003, 0x1904, 0x2df1, 0x7c28,
-	0x7d24, 0x7e38, 0x7f2c, 0x080c, 0x3c05, 0x0904, 0x2df1, 0x2009,
-	0x0000, 0x2019, 0x0000, 0x7023, 0x0000, 0x702f, 0x0000, 0xad80,
-	0x0003, 0x7026, 0x20a0, 0xa1e0, 0xae34, 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, 0x2dcc, 0x702f, 0x0001, 0x711e,
-	0x7020, 0xa300, 0x7022, 0x2061, 0xadd1, 0x6007, 0x0000, 0x6312,
-	0x7024, 0x600e, 0x6426, 0x652a, 0x662e, 0x6732, 0x2c10, 0x080c,
-	0x1624, 0x7007, 0x0002, 0x701b, 0x3ee6, 0x0005, 0x702c, 0xa005,
-	0x1168, 0x711c, 0x7024, 0x20a0, 0x2019, 0x0000, 0x2061, 0xadd1,
-	0x6424, 0x6528, 0x662c, 0x6730, 0x0804, 0x3ea3, 0x7120, 0x810c,
-	0x0804, 0x2dcc, 0x81ff, 0x1904, 0x2df1, 0x60d0, 0xd0ac, 0x1118,
-	0xd09c, 0x0904, 0x2df1, 0x080c, 0x3c05, 0x0904, 0x2df1, 0x7924,
-	0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x080c, 0x3c46, 0x701b, 0x3f11,
-	0x0005, 0x00d6, 0xade8, 0x000d, 0x6828, 0xa0be, 0x7000, 0x0148,
-	0xa0be, 0x7100, 0x0130, 0xa0be, 0x7200, 0x0118, 0x00de, 0x0804,
-	0x2df4, 0x6820, 0x6924, 0x080c, 0x2676, 0x1510, 0x080c, 0x4c80,
-	0x11f8, 0x7122, 0x6612, 0x6516, 0x6e18, 0x00c6, 0x080c, 0x3c05,
-	0x01b8, 0x080c, 0x3c05, 0x01a0, 0x00ce, 0x00de, 0x6837, 0x0000,
-	0x6838, 0xc0fd, 0x683a, 0x6823, 0x0000, 0x6804, 0x2068, 0x080c,
-	0x96ef, 0x0904, 0x2df1, 0x7007, 0x0003, 0x701b, 0x3f4b, 0x0005,
-	0x00de, 0x0804, 0x2df1, 0x7120, 0x080c, 0x2bc9, 0x6820, 0xa086,
-	0x8001, 0x0904, 0x2df1, 0x2d00, 0x701e, 0x6804, 0xa080, 0x0002,
-	0x0006, 0x20a9, 0x002a, 0x2098, 0x20a0, 0x080c, 0x48be, 0x000e,
-	0xade8, 0x000d, 0x6a08, 0x6b0c, 0x6c10, 0x6d14, 0x2061, 0xadd1,
-	0x6007, 0x0000, 0x6e00, 0x6f28, 0xa7c6, 0x7000, 0x1108, 0x0018,
-	0xa7c6, 0x7100, 0x1140, 0xa6c2, 0x0004, 0x0a04, 0x2df4, 0x2009,
-	0x0004, 0x0804, 0x3c49, 0xa7c6, 0x7200, 0x1904, 0x2df4, 0xa6c2,
-	0x0054, 0x0a04, 0x2df4, 0x600e, 0x6013, 0x002a, 0x6226, 0x632a,
-	0x642e, 0x6532, 0x2c10, 0x080c, 0x1624, 0x7007, 0x0002, 0x701b,
-	0x3f92, 0x0005, 0x701c, 0x2068, 0x6804, 0xa080, 0x0001, 0x2004,
-	0xa080, 0x0002, 0x0006, 0x20a9, 0x002a, 0x2098, 0x20a0, 0x080c,
-	0x48be, 0x000e, 0x2009, 0x002a, 0x2061, 0xadd1, 0x6224, 0x6328,
-	0x642c, 0x6530, 0x0804, 0x3c49, 0x81ff, 0x1904, 0x2df1, 0x080c,
-	0x3c1a, 0x0904, 0x2df4, 0x080c, 0x4d96, 0x0904, 0x2df1, 0x080c,
-	0x4ec6, 0x0804, 0x2dcc, 0x7824, 0xd084, 0x0904, 0x3804, 0x080c,
-	0x3c2a, 0x0904, 0x2df4, 0x00c6, 0x080c, 0x3c05, 0x00ce, 0x1120,
-	0x2009, 0x0002, 0x0804, 0x2df1, 0x6004, 0xa084, 0x00ff, 0xa086,
-	0x0006, 0x0128, 0xa08e, 0x0004, 0x0110, 0xa08e, 0x0005, 0x1508,
-	0x2001, 0xad52, 0x2004, 0xd0b4, 0x0904, 0x3834, 0x6000, 0xd08c,
-	0x1904, 0x3834, 0x6837, 0x0000, 0x6838, 0xc0fd, 0x683a, 0x080c,
-	0x970b, 0x1120, 0x2009, 0x0003, 0x0804, 0x2df1, 0x7007, 0x0003,
-	0x701b, 0x3ff3, 0x0005, 0x080c, 0x3c2a, 0x0904, 0x2df4, 0x0804,
-	0x3834, 0x2009, 0xad30, 0x210c, 0x81ff, 0x0120, 0x2009, 0x0001,
-	0x0804, 0x2df1, 0x2001, 0xad00, 0x2004, 0xa086, 0x0003, 0x0120,
-	0x2009, 0x0007, 0x0804, 0x2df1, 0x2001, 0xad52, 0x2004, 0xd0ac,
-	0x0120, 0x2009, 0x0008, 0x0804, 0x2df1, 0x609c, 0xd0a4, 0x1118,
-	0xd0ac, 0x1904, 0x3834, 0x6837, 0x0000, 0x6833, 0x0000, 0x6838,
-	0xc0fd, 0x683a, 0x080c, 0x979c, 0x1120, 0x2009, 0x0003, 0x0804,
-	0x2df1, 0x7007, 0x0003, 0x701b, 0x402e, 0x0005, 0x6830, 0xa086,
-	0x0100, 0x1120, 0x2009, 0x0004, 0x0804, 0x2df1, 0x080c, 0x3c2a,
-	0x0904, 0x2df4, 0x0804, 0x3fd8, 0x81ff, 0x2009, 0x0001, 0x1904,
-	0x2df1, 0x6000, 0xa086, 0x0003, 0x2009, 0x0007, 0x1904, 0x2df1,
-	0x2001, 0xad52, 0x2004, 0xd0ac, 0x2009, 0x0008, 0x1904, 0x2df1,
-	0x080c, 0x3c2a, 0x0904, 0x2df4, 0x6004, 0xa084, 0x00ff, 0xa086,
-	0x0006, 0x2009, 0x0009, 0x1904, 0x2df1, 0x00c6, 0x080c, 0x3c05,
-	0x00ce, 0x2009, 0x0002, 0x0904, 0x2df1, 0x6837, 0x0000, 0x6833,
-	0x0000, 0x6838, 0xc0fd, 0x683a, 0x7928, 0xa194, 0xff00, 0xa18c,
-	0x00ff, 0xa006, 0x82ff, 0x1128, 0xc0ed, 0x6952, 0x792c, 0x6956,
-	0x0048, 0xa28e, 0x0100, 0x1904, 0x2df4, 0xc0e5, 0x6853, 0x0000,
-	0x6857, 0x0000, 0x683e, 0x080c, 0x9957, 0x2009, 0x0003, 0x0904,
-	0x2df1, 0x7007, 0x0003, 0x701b, 0x408e, 0x0005, 0x6830, 0xa086,
-	0x0100, 0x2009, 0x0004, 0x0904, 0x2df1, 0x0804, 0x2dcc, 0x81ff,
-	0x2009, 0x0001, 0x1904, 0x2df1, 0x6000, 0xa086, 0x0003, 0x2009,
-	0x0007, 0x1904, 0x2df1, 0x080c, 0x3c2a, 0x0904, 0x2df4, 0x6004,
-	0xa084, 0x00ff, 0xa086, 0x0006, 0x2009, 0x0009, 0x1904, 0x2df1,
-	0x00c6, 0x080c, 0x3c05, 0x00ce, 0x2009, 0x0002, 0x0904, 0x2df1,
-	0xad80, 0x000f, 0x2009, 0x0008, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38,
-	0x080c, 0x3c46, 0x701b, 0x40c5, 0x0005, 0x00d6, 0xade8, 0x000f,
-	0x6800, 0xa086, 0x0500, 0x1140, 0x6804, 0xa005, 0x1128, 0x6808,
-	0xa084, 0xff00, 0x1108, 0x0018, 0x00de, 0x1904, 0x2df4, 0x00de,
-	0x6837, 0x0000, 0x6833, 0x0000, 0x6838, 0xc0fd, 0x683a, 0x00c6,
-	0x080c, 0x3c2a, 0x1118, 0x00ce, 0x0804, 0x2df4, 0x080c, 0x99a6,
-	0x2009, 0x0003, 0x00ce, 0x0904, 0x2df1, 0x7007, 0x0003, 0x701b,
-	0x40f2, 0x0005, 0x6830, 0xa086, 0x0100, 0x2009, 0x0004, 0x0904,
-	0x2df1, 0x0804, 0x2dcc, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804,
-	0x2df1, 0x6000, 0xa086, 0x0003, 0x0120, 0x2009, 0x0007, 0x0804,
-	0x2df1, 0x7e24, 0x860f, 0xa18c, 0x00ff, 0xa6b4, 0x00ff, 0x080c,
-	0x4cdc, 0x1904, 0x2df4, 0xa186, 0x007f, 0x0150, 0x6004, 0xa084,
-	0x00ff, 0xa086, 0x0006, 0x0120, 0x2009, 0x0009, 0x0804, 0x2df1,
-	0x00c6, 0x080c, 0x3c05, 0x00ce, 0x1120, 0x2009, 0x0002, 0x0804,
-	0x2df1, 0x6837, 0x0000, 0x6838, 0xc0fd, 0x683a, 0x080c, 0x9726,
-	0x1120, 0x2009, 0x0003, 0x0804, 0x2df1, 0x7007, 0x0003, 0x701b,
-	0x413a, 0x0005, 0x6808, 0x8007, 0xa086, 0x0100, 0x1120, 0x2009,
-	0x0004, 0x0804, 0x2df1, 0x68b0, 0x6836, 0x6810, 0x8007, 0xa084,
-	0x00ff, 0x808e, 0x6814, 0x8007, 0xa084, 0x00ff, 0x8086, 0xa080,
-	0x0002, 0xa108, 0xad80, 0x0004, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38,
-	0x0804, 0x3c49, 0x080c, 0x3c05, 0x1120, 0x2009, 0x0002, 0x0804,
-	0x2df1, 0x7924, 0xa194, 0xff00, 0xa18c, 0x00ff, 0x8217, 0x82ff,
-	0x0110, 0x0804, 0x2df4, 0x2009, 0x001a, 0x7a2c, 0x7b28, 0x7c3c,
-	0x7d38, 0x080c, 0x3c46, 0x701b, 0x4176, 0x0005, 0xad80, 0x000d,
-	0x2098, 0x20a9, 0x001a, 0x20a1, 0xafad, 0x53a3, 0x0804, 0x2dcc,
-	0x080c, 0x3c05, 0x1120, 0x2009, 0x0002, 0x0804, 0x2df1, 0x7924,
-	0xa194, 0xff00, 0xa18c, 0x00ff, 0x8217, 0x82ff, 0x0110, 0x0804,
-	0x2df4, 0x2099, 0xafad, 0x20a0, 0x20a9, 0x001a, 0x53a3, 0x2009,
-	0x001a, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x0804, 0x3c49, 0x7824,
-	0xa08a, 0x1000, 0x1a04, 0x2df4, 0x0126, 0x2091, 0x8000, 0x8003,
-	0x800b, 0x810b, 0xa108, 0x00c6, 0x2061, 0xafda, 0x6142, 0x00ce,
-	0x012e, 0x0804, 0x2dcc, 0x00c6, 0x080c, 0x574f, 0x1188, 0x2001,
-	0xaf9e, 0x2003, 0x0001, 0x2001, 0xad00, 0x2003, 0x0001, 0xa085,
-	0x0001, 0x080c, 0x5793, 0x080c, 0x569a, 0x080c, 0x14f6, 0x0038,
-	0x2061, 0xad00, 0x6030, 0xc09d, 0x6032, 0x080c, 0x485e, 0x00ce,
-	0x0005, 0x0126, 0x00c6, 0x00e6, 0x2061, 0x0100, 0x2071, 0xad00,
-	0x6044, 0xd0a4, 0x11b0, 0xd084, 0x0118, 0x080c, 0x4348, 0x0068,
-	0xd08c, 0x0118, 0x080c, 0x4269, 0x0040, 0xd094, 0x0118, 0x080c,
-	0x423a, 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, 0x48de, 0x00f0, 0x6040, 0xa084, 0x0010, 0xa085, 0x0040,
-	0x6042, 0x6043, 0x0000, 0x7077, 0x0000, 0x7093, 0x0001, 0x70b7,
-	0x0000, 0x70d3, 0x0000, 0x2009, 0xb3c0, 0x200b, 0x0000, 0x7087,
-	0x0000, 0x707b, 0x000a, 0x2009, 0x000a, 0x2011, 0x4814, 0x080c,
-	0x6593, 0x0005, 0x0156, 0x2001, 0xad73, 0x2004, 0xd08c, 0x0110,
-	0x704f, 0xffff, 0x7078, 0xa005, 0x1510, 0x2011, 0x4814, 0x080c,
-	0x650d, 0x6040, 0xa094, 0x0010, 0xa285, 0x0020, 0x6042, 0x20a9,
-	0x00c8, 0x6044, 0xd08c, 0x1168, 0x1f04, 0x4251, 0x6242, 0x708b,
-	0x0000, 0x6040, 0xa094, 0x0010, 0xa285, 0x0080, 0x6042, 0x6242,
-	0x0030, 0x6242, 0x708b, 0x0000, 0x707f, 0x0000, 0x0000, 0x015e,
-	0x0005, 0x707c, 0xa08a, 0x0003, 0x1210, 0x0023, 0x0010, 0x080c,
-	0x14f6, 0x0005, 0x4275, 0x42c5, 0x4347, 0x00f6, 0x707f, 0x0001,
-	0x20e1, 0xa000, 0xe000, 0x20e1, 0x8700, 0x080c, 0x22f8, 0x20e1,
-	0x9080, 0x20e1, 0x4000, 0x2079, 0xb200, 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, 0xb20c, 0x207b,
-	0x1101, 0x7807, 0x0000, 0x2099, 0xad05, 0x20a1, 0xb20e, 0x20a9,
-	0x0004, 0x53a3, 0x2079, 0xb212, 0x207b, 0x0000, 0x7807, 0x0000,
-	0x2099, 0xb200, 0x20a1, 0x020b, 0x20a9, 0x0014, 0x53a6, 0x60c3,
-	0x000c, 0x600f, 0x0000, 0x080c, 0x4845, 0x00fe, 0x7083, 0x0000,
-	0x6043, 0x0008, 0x6043, 0x0000, 0x0005, 0x00d6, 0x7080, 0x7083,
-	0x0000, 0xa025, 0x0904, 0x432f, 0x6020, 0xd0b4, 0x1904, 0x432d,
-	0x7190, 0x81ff, 0x0904, 0x431d, 0xa486, 0x000c, 0x1904, 0x4328,
-	0xa480, 0x0018, 0x8004, 0x20a8, 0x2011, 0xb280, 0x2019, 0xb200,
-	0x220c, 0x2304, 0xa106, 0x11b8, 0x8210, 0x8318, 0x1f04, 0x42e0,
-	0x6043, 0x0004, 0x608b, 0xbc94, 0x608f, 0xf0f0, 0x6043, 0x0006,
-	0x707f, 0x0002, 0x708b, 0x0002, 0x2009, 0x07d0, 0x2011, 0x481b,
-	0x080c, 0x6593, 0x0490, 0x2069, 0xb280, 0x6930, 0xa18e, 0x1101,
-	0x1538, 0x6834, 0xa005, 0x1520, 0x6900, 0xa18c, 0x00ff, 0x1118,
-	0x6804, 0xa005, 0x0190, 0x2011, 0xb28e, 0x2019, 0xad05, 0x20a9,
-	0x0004, 0x220c, 0x2304, 0xa102, 0x0230, 0x1190, 0x8210, 0x8318,
-	0x1f04, 0x4311, 0x0068, 0x7093, 0x0000, 0x20e1, 0x9080, 0x20e1,
-	0x4000, 0x2099, 0xb280, 0x20a1, 0x020b, 0x20a9, 0x0014, 0x53a6,
-	0x6043, 0x0008, 0x6043, 0x0000, 0x0010, 0x00de, 0x0005, 0x6040,
-	0xa085, 0x0100, 0x6042, 0x6020, 0xd0b4, 0x1db8, 0x60c3, 0x000c,
-	0x2011, 0xafd1, 0x2013, 0x0000, 0x7083, 0x0000, 0x20e1, 0x9080,
-	0x60a3, 0x0056, 0x60a7, 0x9575, 0x080c, 0x782b, 0x0c30, 0x0005,
-	0x7088, 0xa08a, 0x001d, 0x1210, 0x0023, 0x0010, 0x080c, 0x14f6,
-	0x0005, 0x437b, 0x438a, 0x43b2, 0x43cb, 0x43ef, 0x4417, 0x443b,
-	0x446c, 0x4490, 0x44b8, 0x44ef, 0x4517, 0x4533, 0x4549, 0x4569,
-	0x457c, 0x4584, 0x45b1, 0x45d5, 0x45fd, 0x4621, 0x4652, 0x468f,
-	0x46be, 0x46da, 0x4719, 0x4739, 0x4752, 0x4753, 0x00c6, 0x2061,
-	0xad00, 0x6003, 0x0007, 0x2061, 0x0100, 0x6004, 0xa084, 0xfff9,
-	0x6006, 0x00ce, 0x0005, 0x608b, 0xbc94, 0x608f, 0xf0f0, 0x6043,
-	0x0002, 0x708b, 0x0001, 0x2009, 0x07d0, 0x2011, 0x481b, 0x080c,
-	0x6593, 0x0005, 0x00f6, 0x7080, 0xa086, 0x0014, 0x1508, 0x6043,
-	0x0000, 0x6020, 0xd0b4, 0x11e0, 0x2079, 0xb280, 0x7a30, 0xa296,
-	0x1102, 0x11a0, 0x7834, 0xa005, 0x1188, 0x7a38, 0xd2fc, 0x0128,
-	0x70b4, 0xa005, 0x1110, 0x70b7, 0x0001, 0x2011, 0x481b, 0x080c,
-	0x650d, 0x708b, 0x0010, 0x080c, 0x4584, 0x0010, 0x080c, 0x485e,
-	0x00fe, 0x0005, 0x708b, 0x0003, 0x6043, 0x0004, 0x2011, 0x481b,
-	0x080c, 0x650d, 0x080c, 0x48c6, 0x20a3, 0x1102, 0x20a3, 0x0000,
-	0x20a9, 0x000a, 0x20a3, 0x0000, 0x1f04, 0x43c2, 0x60c3, 0x0014,
-	0x080c, 0x4845, 0x0005, 0x00f6, 0x7080, 0xa005, 0x01f0, 0x2011,
-	0x481b, 0x080c, 0x650d, 0xa086, 0x0014, 0x11a8, 0x2079, 0xb280,
-	0x7a30, 0xa296, 0x1102, 0x1178, 0x7834, 0xa005, 0x1160, 0x7a38,
-	0xd2fc, 0x0128, 0x70b4, 0xa005, 0x1110, 0x70b7, 0x0001, 0x708b,
-	0x0004, 0x0029, 0x0010, 0x080c, 0x485e, 0x00fe, 0x0005, 0x708b,
-	0x0005, 0x080c, 0x48c6, 0x20a3, 0x1103, 0x20a3, 0x0000, 0x3430,
-	0x2011, 0xb28e, 0x080c, 0x4917, 0x1160, 0x7074, 0xa005, 0x1148,
-	0x714c, 0xa186, 0xffff, 0x0128, 0x080c, 0x47df, 0x0110, 0x080c,
-	0x48f5, 0x20a9, 0x0008, 0x2298, 0x26a0, 0x53a6, 0x20a3, 0x0000,
-	0x20a3, 0x0000, 0x60c3, 0x0014, 0x080c, 0x4845, 0x0005, 0x00f6,
-	0x7080, 0xa005, 0x01f0, 0x2011, 0x481b, 0x080c, 0x650d, 0xa086,
-	0x0014, 0x11a8, 0x2079, 0xb280, 0x7a30, 0xa296, 0x1103, 0x1178,
-	0x7834, 0xa005, 0x1160, 0x7a38, 0xd2fc, 0x0128, 0x70b4, 0xa005,
-	0x1110, 0x70b7, 0x0001, 0x708b, 0x0006, 0x0029, 0x0010, 0x080c,
-	0x485e, 0x00fe, 0x0005, 0x708b, 0x0007, 0x080c, 0x48c6, 0x20a3,
-	0x1104, 0x20a3, 0x0000, 0x3430, 0x2011, 0xb28e, 0x080c, 0x4917,
-	0x11a8, 0x7074, 0xa005, 0x1190, 0x7154, 0xa186, 0xffff, 0x0170,
-	0xa180, 0x2be6, 0x200d, 0xa18c, 0xff00, 0x810f, 0x080c, 0x47df,
-	0x0128, 0x080c, 0x3e66, 0x0110, 0x080c, 0x26c0, 0x20a9, 0x0008,
-	0x2298, 0x26a0, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3,
-	0x0014, 0x080c, 0x4845, 0x0005, 0x00f6, 0x7080, 0xa005, 0x01f0,
-	0x2011, 0x481b, 0x080c, 0x650d, 0xa086, 0x0014, 0x11a8, 0x2079,
-	0xb280, 0x7a30, 0xa296, 0x1104, 0x1178, 0x7834, 0xa005, 0x1160,
-	0x7a38, 0xd2fc, 0x0128, 0x70b4, 0xa005, 0x1110, 0x70b7, 0x0001,
-	0x708b, 0x0008, 0x0029, 0x0010, 0x080c, 0x485e, 0x00fe, 0x0005,
-	0x708b, 0x0009, 0x080c, 0x48c6, 0x20a3, 0x1105, 0x20a3, 0x0100,
-	0x3430, 0x080c, 0x4917, 0x1150, 0x7074, 0xa005, 0x1138, 0x080c,
-	0x4754, 0x1170, 0xa085, 0x0001, 0x080c, 0x26c0, 0x20a9, 0x0008,
-	0x2099, 0xb28e, 0x26a0, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000,
-	0x60c3, 0x0014, 0x080c, 0x4845, 0x0010, 0x080c, 0x436e, 0x0005,
-	0x00f6, 0x7080, 0xa005, 0x0588, 0x2011, 0x481b, 0x080c, 0x650d,
-	0xa086, 0x0014, 0x1540, 0x2079, 0xb280, 0x7a30, 0xa296, 0x1105,
-	0x1510, 0x7834, 0x2011, 0x0100, 0xa21e, 0x1160, 0x7a38, 0xd2fc,
-	0x0128, 0x70b4, 0xa005, 0x1110, 0x70b7, 0x0001, 0x708b, 0x000a,
-	0x00b1, 0x0098, 0xa005, 0x1178, 0x7a38, 0xd2fc, 0x0128, 0x70b4,
-	0xa005, 0x1110, 0x70b7, 0x0001, 0x7087, 0x0000, 0x708b, 0x000e,
-	0x080c, 0x4569, 0x0010, 0x080c, 0x485e, 0x00fe, 0x0005, 0x708b,
-	0x000b, 0x2011, 0xb20e, 0x22a0, 0x20a9, 0x0040, 0x2019, 0xffff,
-	0x43a4, 0x20a9, 0x0002, 0x2009, 0x0000, 0x41a4, 0x080c, 0x48c6,
-	0x20a3, 0x1106, 0x20a3, 0x0000, 0x080c, 0x4917, 0x0118, 0x2013,
-	0x0000, 0x0020, 0x7050, 0xa085, 0x0100, 0x2012, 0x2298, 0x20a9,
-	0x0042, 0x53a6, 0x60c3, 0x0084, 0x080c, 0x4845, 0x0005, 0x00f6,
-	0x7080, 0xa005, 0x01b0, 0x2011, 0x481b, 0x080c, 0x650d, 0xa086,
-	0x0084, 0x1168, 0x2079, 0xb280, 0x7a30, 0xa296, 0x1106, 0x1138,
-	0x7834, 0xa005, 0x1120, 0x708b, 0x000c, 0x0029, 0x0010, 0x080c,
-	0x485e, 0x00fe, 0x0005, 0x708b, 0x000d, 0x080c, 0x48c6, 0x20a3,
-	0x1107, 0x20a3, 0x0000, 0x2099, 0xb28e, 0x20a9, 0x0040, 0x53a6,
-	0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0084, 0x080c, 0x4845,
-	0x0005, 0x00f6, 0x7080, 0xa005, 0x01d0, 0x2011, 0x481b, 0x080c,
-	0x650d, 0xa086, 0x0084, 0x1188, 0x2079, 0xb280, 0x7a30, 0xa296,
-	0x1107, 0x1158, 0x7834, 0xa005, 0x1140, 0x7087, 0x0001, 0x080c,
-	0x48b8, 0x708b, 0x000e, 0x0029, 0x0010, 0x080c, 0x485e, 0x00fe,
-	0x0005, 0x708b, 0x000f, 0x7083, 0x0000, 0x608b, 0xbc85, 0x608f,
-	0xb5b5, 0x6043, 0x0005, 0x6043, 0x0004, 0x2009, 0x07d0, 0x2011,
-	0x481b, 0x080c, 0x6501, 0x0005, 0x7080, 0xa005, 0x0120, 0x2011,
-	0x481b, 0x080c, 0x650d, 0x0005, 0x708b, 0x0011, 0x080c, 0x4917,
-	0x1188, 0x716c, 0x81ff, 0x0170, 0x2009, 0x0000, 0x7070, 0xa084,
-	0x00ff, 0x080c, 0x2676, 0xa186, 0x0080, 0x0120, 0x2011, 0xb28e,
-	0x080c, 0x47df, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2099, 0xb280,
-	0x20a1, 0x020b, 0x7480, 0xa480, 0x0018, 0xa080, 0x0007, 0xa084,
-	0x03f8, 0x8004, 0x20a8, 0x53a6, 0x60c3, 0x0014, 0x080c, 0x4845,
-	0x0005, 0x00f6, 0x7080, 0xa005, 0x01f0, 0x2011, 0x481b, 0x080c,
-	0x650d, 0xa086, 0x0014, 0x11a8, 0x2079, 0xb280, 0x7a30, 0xa296,
-	0x1103, 0x1178, 0x7834, 0xa005, 0x1160, 0x7a38, 0xd2fc, 0x0128,
-	0x70b4, 0xa005, 0x1110, 0x70b7, 0x0001, 0x708b, 0x0012, 0x0029,
-	0x0010, 0x080c, 0x485e, 0x00fe, 0x0005, 0x708b, 0x0013, 0x080c,
-	0x48d2, 0x20a3, 0x1103, 0x20a3, 0x0000, 0x3430, 0x2011, 0xb28e,
-	0x080c, 0x4917, 0x1160, 0x7074, 0xa005, 0x1148, 0x714c, 0xa186,
-	0xffff, 0x0128, 0x080c, 0x47df, 0x0110, 0x080c, 0x48f5, 0x20a9,
-	0x0008, 0x2298, 0x26a0, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000,
-	0x60c3, 0x0014, 0x080c, 0x4845, 0x0005, 0x00f6, 0x7080, 0xa005,
-	0x01f0, 0x2011, 0x481b, 0x080c, 0x650d, 0xa086, 0x0014, 0x11a8,
-	0x2079, 0xb280, 0x7a30, 0xa296, 0x1104, 0x1178, 0x7834, 0xa005,
-	0x1160, 0x7a38, 0xd2fc, 0x0128, 0x70b4, 0xa005, 0x1110, 0x70b7,
-	0x0001, 0x708b, 0x0014, 0x0029, 0x0010, 0x080c, 0x485e, 0x00fe,
-	0x0005, 0x708b, 0x0015, 0x080c, 0x48d2, 0x20a3, 0x1104, 0x20a3,
-	0x0000, 0x3430, 0x2011, 0xb28e, 0x080c, 0x4917, 0x11a8, 0x7074,
-	0xa005, 0x1190, 0x7154, 0xa186, 0xffff, 0x0170, 0xa180, 0x2be6,
-	0x200d, 0xa18c, 0xff00, 0x810f, 0x080c, 0x47df, 0x0128, 0x080c,
-	0x3e66, 0x0110, 0x080c, 0x26c0, 0x20a9, 0x0008, 0x2298, 0x26a0,
-	0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014, 0x080c,
-	0x4845, 0x0005, 0x00f6, 0x7080, 0xa005, 0x05b8, 0x2011, 0x481b,
-	0x080c, 0x650d, 0xa086, 0x0014, 0x1570, 0x2079, 0xb280, 0x7a30,
-	0xa296, 0x1105, 0x1540, 0x7834, 0x2011, 0x0100, 0xa21e, 0x1148,
-	0x7a38, 0xd2fc, 0x0128, 0x70b4, 0xa005, 0x1110, 0x70b7, 0x0001,
-	0x0060, 0xa005, 0x11c0, 0x7a38, 0xd2fc, 0x0128, 0x70b4, 0xa005,
-	0x1110, 0x70b7, 0x0001, 0x7087, 0x0000, 0x7a38, 0xd2f4, 0x0138,
-	0x2001, 0xad73, 0x2004, 0xd0a4, 0x1110, 0x70d3, 0x0008, 0x708b,
-	0x0016, 0x0029, 0x0010, 0x080c, 0x485e, 0x00fe, 0x0005, 0x20e1,
-	0x9080, 0x20e1, 0x4000, 0x2099, 0xb280, 0x20a1, 0x020b, 0x20a9,
-	0x000e, 0x53a6, 0x3430, 0x2011, 0xb28e, 0x708b, 0x0017, 0x080c,
-	0x4917, 0x1150, 0x7074, 0xa005, 0x1138, 0x080c, 0x4754, 0x1170,
-	0xa085, 0x0001, 0x080c, 0x26c0, 0x20a9, 0x0008, 0x2099, 0xb28e,
-	0x26a0, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014,
-	0x080c, 0x4845, 0x0010, 0x080c, 0x436e, 0x0005, 0x00f6, 0x7080,
-	0xa005, 0x01b0, 0x2011, 0x481b, 0x080c, 0x650d, 0xa086, 0x0084,
-	0x1168, 0x2079, 0xb280, 0x7a30, 0xa296, 0x1106, 0x1138, 0x7834,
-	0xa005, 0x1120, 0x708b, 0x0018, 0x0029, 0x0010, 0x080c, 0x485e,
-	0x00fe, 0x0005, 0x708b, 0x0019, 0x080c, 0x48d2, 0x20a3, 0x1106,
-	0x20a3, 0x0000, 0x3430, 0x2099, 0xb28e, 0x2039, 0xb20e, 0x27a0,
-	0x20a9, 0x0040, 0x53a3, 0x080c, 0x4917, 0x11e8, 0x2728, 0x2514,
-	0x8207, 0xa084, 0x00ff, 0x8000, 0x2018, 0xa294, 0x00ff, 0x8007,
-	0xa205, 0x202a, 0x7050, 0x2310, 0x8214, 0xa2a0, 0xb20e, 0x2414,
-	0xa38c, 0x0001, 0x0118, 0xa294, 0xff00, 0x0018, 0xa294, 0x00ff,
-	0x8007, 0xa215, 0x2222, 0x2798, 0x26a0, 0x20a9, 0x0040, 0x53a6,
-	0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0084, 0x080c, 0x4845,
-	0x0005, 0x00f6, 0x7080, 0xa005, 0x01d0, 0x2011, 0x481b, 0x080c,
-	0x650d, 0xa086, 0x0084, 0x1188, 0x2079, 0xb280, 0x7a30, 0xa296,
-	0x1107, 0x1158, 0x7834, 0xa005, 0x1140, 0x7087, 0x0001, 0x080c,
-	0x48b8, 0x708b, 0x001a, 0x0029, 0x0010, 0x080c, 0x485e, 0x00fe,
-	0x0005, 0x708b, 0x001b, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2099,
-	0xb280, 0x20a1, 0x020b, 0x7480, 0xa480, 0x0018, 0xa080, 0x0007,
-	0xa084, 0x03f8, 0x8004, 0x20a8, 0x53a6, 0x60c3, 0x0084, 0x080c,
-	0x4845, 0x0005, 0x0005, 0x0005, 0x0086, 0x0096, 0x2029, 0xad52,
-	0x252c, 0x20a9, 0x0008, 0x2041, 0xb20e, 0x28a0, 0x2099, 0xb28e,
-	0x53a3, 0x20a9, 0x0008, 0x2011, 0x0007, 0xd5d4, 0x0110, 0x2011,
-	0x0000, 0x2800, 0xa200, 0x200c, 0xa1a6, 0xffff, 0x1148, 0xd5d4,
-	0x0110, 0x8210, 0x0008, 0x8211, 0x1f04, 0x4769, 0x0804, 0x47d7,
-	0x82ff, 0x1160, 0xd5d4, 0x0120, 0xa1a6, 0x3fff, 0x0d90, 0x0020,
-	0xa1a6, 0x3fff, 0x0904, 0x47d7, 0xa18d, 0xc000, 0x20a9, 0x0010,
-	0x2019, 0x0001, 0xd5d4, 0x0110, 0x2019, 0x0010, 0x2120, 0xd5d4,
-	0x0110, 0x8423, 0x0008, 0x8424, 0x1240, 0xd5d4, 0x0110, 0x8319,
-	0x0008, 0x8318, 0x1f04, 0x478f, 0x04d0, 0x23a8, 0x2021, 0x0001,
-	0x8426, 0x8425, 0x1f04, 0x47a1, 0x2328, 0x8529, 0xa2be, 0x0007,
-	0x0158, 0x0006, 0x2039, 0x0007, 0x2200, 0xa73a, 0x000e, 0x27a8,
-	0xa5a8, 0x0010, 0x1f04, 0x47b0, 0x754e, 0xa5c8, 0x2be6, 0x292d,
-	0xa5ac, 0x00ff, 0x7572, 0x6532, 0x6536, 0x0016, 0x2508, 0x080c,
-	0x26a0, 0x001e, 0x60e7, 0x0000, 0x65ea, 0x2018, 0x2304, 0xa405,
-	0x201a, 0x7077, 0x0001, 0x26a0, 0x2898, 0x20a9, 0x0008, 0x53a6,
-	0x20a3, 0x0000, 0x20a3, 0x0000, 0xa085, 0x0001, 0x0028, 0xa006,
-	0x0018, 0xa006, 0x080c, 0x14f6, 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, 0x714e, 0xa1a0,
-	0x2be6, 0x242d, 0xa5ac, 0x00ff, 0x7572, 0x6532, 0x6536, 0x0016,
-	0x2508, 0x080c, 0x26a0, 0x001e, 0x60e7, 0x0000, 0x65ea, 0x7077,
-	0x0001, 0xa084, 0x0000, 0x0005, 0x00e6, 0x2071, 0xad00, 0x707b,
-	0x0000, 0x00ee, 0x0005, 0x00e6, 0x00f6, 0x2079, 0x0100, 0x2071,
-	0x0140, 0x080c, 0x7834, 0x7004, 0xa084, 0x4000, 0x0120, 0x7003,
-	0x1000, 0x7003, 0x0000, 0x0126, 0x2091, 0x8000, 0x2071, 0xad22,
-	0x2073, 0x0000, 0x7840, 0x0026, 0x0016, 0x2009, 0x00f7, 0x080c,
-	0x48de, 0x001e, 0xa094, 0x0010, 0xa285, 0x0080, 0x7842, 0x7a42,
-	0x002e, 0x012e, 0x00fe, 0x00ee, 0x0005, 0x0126, 0x2091, 0x8000,
-	0x2011, 0xafd1, 0x2013, 0x0000, 0x7083, 0x0000, 0x012e, 0x20e1,
-	0x9080, 0x60a3, 0x0056, 0x60a7, 0x9575, 0x080c, 0x782b, 0x2009,
-	0x07d0, 0x2011, 0x481b, 0x080c, 0x6593, 0x0005, 0x0016, 0x0026,
-	0x00c6, 0x0126, 0x2091, 0x8000, 0x2009, 0x00f7, 0x080c, 0x48de,
-	0x2061, 0xafda, 0x601b, 0x0000, 0x601f, 0x0000, 0x2061, 0xad00,
-	0x6003, 0x0001, 0x2061, 0x0100, 0x6043, 0x0090, 0x6043, 0x0010,
-	0x2009, 0x002d, 0x2011, 0x4883, 0x080c, 0x6501, 0x012e, 0x00ce,
-	0x002e, 0x001e, 0x0005, 0x00e6, 0x0006, 0x0126, 0x2091, 0x8000,
-	0x2071, 0x0100, 0x080c, 0x7834, 0x2071, 0x0140, 0x7004, 0xa084,
-	0x4000, 0x0120, 0x7003, 0x1000, 0x7003, 0x0000, 0x080c, 0x5757,
-	0x01a8, 0x080c, 0x5775, 0x1190, 0x2001, 0xaf9d, 0x2003, 0xaaaa,
-	0x0016, 0x080c, 0x2744, 0x2001, 0xaf8e, 0x2102, 0x001e, 0x2001,
-	0xaf9e, 0x2003, 0x0000, 0x080c, 0x569a, 0x0030, 0x2001, 0x0001,
-	0x080c, 0x261e, 0x080c, 0x485e, 0x012e, 0x000e, 0x00ee, 0x0005,
-	0x20a9, 0x0040, 0x20a1, 0xb3c0, 0x2099, 0xb28e, 0x3304, 0x8007,
-	0x20a2, 0x9398, 0x94a0, 0x1f04, 0x48be, 0x0005, 0x20e1, 0x9080,
-	0x20e1, 0x4000, 0x2099, 0xb200, 0x20a1, 0x020b, 0x20a9, 0x000c,
-	0x53a6, 0x0005, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2099, 0xb280,
-	0x20a1, 0x020b, 0x20a9, 0x000c, 0x53a6, 0x0005, 0x00c6, 0x0006,
-	0x2061, 0x0100, 0x810f, 0x2001, 0xad30, 0x2004, 0xa005, 0x1138,
-	0x2001, 0xad14, 0x2004, 0xa084, 0x00ff, 0xa105, 0x0010, 0xa185,
-	0x00f7, 0x604a, 0x000e, 0x00ce, 0x0005, 0x0016, 0x0046, 0x2001,
-	0xad52, 0x2004, 0xd0a4, 0x0158, 0xa006, 0x2020, 0x2009, 0x002a,
-	0x080c, 0xa96c, 0x2001, 0xad0c, 0x200c, 0xc195, 0x2102, 0x2019,
-	0x002a, 0x2009, 0x0000, 0x080c, 0x2aac, 0x004e, 0x001e, 0x0005,
-	0x080c, 0x485e, 0x708b, 0x0000, 0x7083, 0x0000, 0x0005, 0x0006,
-	0x2001, 0xad0c, 0x2004, 0xd09c, 0x0100, 0x000e, 0x0005, 0x0006,
-	0x0016, 0x0126, 0x2091, 0x8000, 0x2001, 0x0101, 0x200c, 0xa18d,
-	0x0006, 0x2102, 0x012e, 0x001e, 0x000e, 0x0005, 0x0156, 0x20a9,
-	0x00ff, 0x2009, 0xae34, 0xa006, 0x200a, 0x8108, 0x1f04, 0x4934,
-	0x015e, 0x0005, 0x00d6, 0x0036, 0x0156, 0x0136, 0x0146, 0x2069,
-	0xad51, 0xa006, 0x6002, 0x6007, 0x0707, 0x600a, 0x600e, 0x6012,
-	0xa198, 0x2be6, 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,
-	0x15f0, 0x60a7, 0x0000, 0x60a8, 0xa06d, 0x0110, 0x080c, 0x15f0,
-	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, 0x4a49, 0xa18c, 0xff00,
-	0x810f, 0xa182, 0x00ff, 0x1a04, 0x4a4e, 0x2001, 0xad0c, 0x2004,
-	0xa084, 0x0003, 0x01c0, 0x2001, 0xad0c, 0x2004, 0xd084, 0x1904,
-	0x4a31, 0xa188, 0xae34, 0x2104, 0xa065, 0x0904, 0x4a31, 0x6004,
-	0xa084, 0x00ff, 0xa08e, 0x0006, 0x1904, 0x4a31, 0x6000, 0xd0c4,
-	0x0904, 0x4a31, 0x0068, 0xa188, 0xae34, 0x2104, 0xa065, 0x0904,
-	0x4a15, 0x6004, 0xa084, 0x00ff, 0xa08e, 0x0006, 0x1904, 0x4a1a,
-	0x60a4, 0xa00d, 0x0118, 0x080c, 0x4ef9, 0x05d0, 0x60a8, 0xa00d,
-	0x0188, 0x080c, 0x4f43, 0x1170, 0x694c, 0xd1fc, 0x1118, 0x080c,
-	0x4c11, 0x0448, 0x080c, 0x4bd3, 0x694c, 0xd1ec, 0x1520, 0x080c,
-	0x4ded, 0x0408, 0x694c, 0xa184, 0xa000, 0x0178, 0xd1ec, 0x0140,
-	0xd1fc, 0x0118, 0x080c, 0x4dfc, 0x0028, 0x080c, 0x4dfc, 0x0028,
-	0xd1fc, 0x0118, 0x080c, 0x4bd3, 0x0070, 0x6050, 0xa00d, 0x0130,
-	0x2d00, 0x200a, 0x6803, 0x0000, 0x6052, 0x0028, 0x2d00, 0x6052,
-	0x604e, 0x6803, 0x0000, 0x080c, 0x67c5, 0xa006, 0x012e, 0x0005,
-	0x2001, 0x0005, 0x2009, 0x0000, 0x04e8, 0x2001, 0x0028, 0x2009,
-	0x0000, 0x04c0, 0xa082, 0x0006, 0x12a0, 0x2001, 0xad34, 0x2004,
-	0xd0ac, 0x1160, 0x60a0, 0xd0bc, 0x1148, 0x6100, 0xd1fc, 0x0904,
-	0x49d0, 0x2001, 0x0029, 0x2009, 0x1000, 0x0420, 0x2001, 0x0028,
-	0x00a8, 0x2009, 0xad0c, 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, 0x4aa8, 0xa188, 0xae34, 0x2104, 0xa065, 0x01c0, 0x6004,
-	0xa084, 0x00ff, 0xa08e, 0x0006, 0x11a8, 0x2c70, 0x080c, 0x8022,
-	0x05e8, 0x2e00, 0x601a, 0x2d00, 0x6012, 0x600b, 0xffff, 0x601f,
-	0x000a, 0x2009, 0x0003, 0x080c, 0x80a7, 0xa006, 0x0460, 0x2001,
-	0x0028, 0x0440, 0xa082, 0x0006, 0x1298, 0x2001, 0xad34, 0x2004,
-	0xd0ac, 0x1158, 0x60a0, 0xd0bc, 0x1140, 0x6100, 0xd1fc, 0x09e8,
-	0x2001, 0x0029, 0x2009, 0x1000, 0x00a8, 0x2001, 0x0028, 0x0090,
-	0x2009, 0xad0c, 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, 0xad00, 0x6944, 0xa18c, 0xff00, 0x810f, 0xa182, 0x00ff,
-	0x1a04, 0x4b77, 0x2001, 0xad0c, 0x2004, 0xa084, 0x0003, 0x1904,
-	0x4b65, 0x080c, 0x4cdc, 0x1180, 0x6004, 0xa084, 0x00ff, 0xa082,
-	0x0006, 0x1250, 0x2001, 0xad34, 0x2004, 0xd0ac, 0x1904, 0x4b60,
-	0x60a0, 0xd0bc, 0x1904, 0x4b60, 0x6864, 0xa0c6, 0x006f, 0x0118,
-	0x2008, 0x0804, 0x4b28, 0x6968, 0x2140, 0xa18c, 0xff00, 0x810f,
-	0x78d0, 0xd0ac, 0x1118, 0xa182, 0x0080, 0x06d0, 0xa182, 0x00ff,
-	0x16b8, 0x6a70, 0x6b6c, 0x786c, 0xa306, 0x1160, 0x7870, 0xa24e,
-	0x1118, 0x2208, 0x2310, 0x0460, 0xa9cc, 0xff00, 0x1118, 0x2208,
-	0x2310, 0x0430, 0x080c, 0x3b58, 0x2c70, 0x0550, 0x2009, 0x0000,
-	0x2011, 0x0000, 0xa0c6, 0x4000, 0x1160, 0x0006, 0x2e60, 0x080c,
-	0x4f6e, 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, 0x0458,
-	0x080c, 0x8022, 0x1138, 0x2001, 0x4005, 0x2009, 0x0003, 0x2011,
-	0x0000, 0x0c80, 0x2e00, 0x601a, 0x080c, 0x9956, 0x2d00, 0x6012,
-	0x601f, 0x0001, 0xa006, 0xd88c, 0x0110, 0x2001, 0x4000, 0x683a,
-	0x0126, 0x2091, 0x8000, 0x080c, 0x2ad9, 0x012e, 0x2001, 0x0000,
-	0x080c, 0x4c1e, 0x2001, 0x0002, 0x080c, 0x4c30, 0x2009, 0x0002,
-	0x080c, 0x80a7, 0xa006, 0xa005, 0x012e, 0x00ee, 0x00fe, 0x0005,
-	0x2001, 0x0028, 0x2009, 0x0000, 0x0cb0, 0x2009, 0xad0c, 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, 0xae34, 0x2104, 0xa065, 0x01b8, 0x6004, 0xa084,
-	0x00ff, 0xa08e, 0x0006, 0x11b0, 0x684c, 0xd0ec, 0x0120, 0x080c,
-	0x4dfc, 0x04c9, 0x0030, 0x04b9, 0x684c, 0xd0fc, 0x0110, 0x080c,
-	0x4ded, 0x080c, 0x4e3a, 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, 0xafc7, 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, 0xad52,
-	0x2004, 0xd0a4, 0x0140, 0xa284, 0xff00, 0x8007, 0xa086, 0x0007,
-	0x1110, 0x2011, 0x0600, 0x000e, 0xa294, 0xff00, 0xa215, 0x6206,
-	0x0006, 0xa086, 0x0006, 0x1128, 0x6290, 0x82ff, 0x1110, 0x080c,
-	0x14f6, 0x000e, 0x00ce, 0x012e, 0x0005, 0x0126, 0x00c6, 0x2091,
-	0x8000, 0x6218, 0x2260, 0x6204, 0x0006, 0xa086, 0x0006, 0x1178,
-	0x609c, 0xd0a4, 0x0160, 0x2001, 0xad52, 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,
-	0xae34, 0x2204, 0xa065, 0x1180, 0x0016, 0x00d6, 0x080c, 0x15c0,
-	0x2d60, 0x00de, 0x001e, 0x0d80, 0x2c00, 0x2012, 0x60a7, 0x0000,
-	0x60ab, 0x0000, 0x080c, 0x493a, 0xa006, 0x002e, 0x0005, 0x0126,
-	0x2091, 0x8000, 0x0026, 0xa182, 0x00ff, 0x0218, 0xa085, 0x0001,
-	0x0480, 0x00d6, 0xa190, 0xae34, 0x2204, 0xa06d, 0x0540, 0x2013,
-	0x0000, 0x00d6, 0x00c6, 0x2d60, 0x60a4, 0xa06d, 0x0110, 0x080c,
-	0x15f0, 0x60a8, 0xa06d, 0x0110, 0x080c, 0x15f0, 0x00ce, 0x00de,
-	0x00d6, 0x00c6, 0x68ac, 0x2060, 0x8cff, 0x0168, 0x600c, 0x0006,
-	0x6010, 0x2068, 0x080c, 0x9596, 0x0110, 0x080c, 0x1600, 0x080c,
-	0x8078, 0x00ce, 0x0c88, 0x00ce, 0x00de, 0x080c, 0x15f0, 0x00de,
-	0xa006, 0x002e, 0x012e, 0x0005, 0x0016, 0xa182, 0x00ff, 0x0218,
-	0xa085, 0x0001, 0x0030, 0xa188, 0xae34, 0x2104, 0xa065, 0x0dc0,
-	0xa006, 0x001e, 0x0005, 0x00d6, 0x0156, 0x0136, 0x0146, 0x600b,
-	0x0000, 0x600f, 0x0000, 0x6000, 0xc08c, 0x6002, 0x080c, 0x574f,
-	0x1538, 0x60a0, 0xa086, 0x007e, 0x2069, 0xb290, 0x0130, 0x2001,
-	0xad34, 0x2004, 0xd0ac, 0x11e0, 0x0098, 0x2d04, 0xd0e4, 0x01c0,
-	0x00d6, 0x2069, 0xb28e, 0x00c6, 0x2061, 0xaf9f, 0x6810, 0x2062,
-	0x6814, 0x6006, 0x6818, 0x600a, 0x681c, 0x600e, 0x00ce, 0x00de,
-	0x8d69, 0x2d04, 0x2069, 0x0140, 0x6886, 0x2069, 0xad00, 0x68a2,
-	0x2069, 0xb28e, 0x6808, 0x605e, 0x6810, 0x6062, 0x6138, 0xa10a,
-	0x0208, 0x603a, 0x6814, 0x6066, 0x2099, 0xb296, 0xac88, 0x000a,
-	0x21a0, 0x20a9, 0x0004, 0x53a3, 0x2099, 0xb29a, 0xac88, 0x0006,
-	0x21a0, 0x20a9, 0x0004, 0x53a3, 0x2069, 0xb2ae, 0x6808, 0x606a,
-	0x690c, 0x616e, 0x6810, 0x6072, 0x6818, 0x6076, 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, 0xb28d, 0x2e04,
-	0x6896, 0x2071, 0xb28e, 0x7004, 0x689a, 0x701c, 0x689e, 0x6a00,
-	0x2009, 0xad71, 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, 0x4da8, 0x080c,
-	0x14f6, 0x260a, 0x8210, 0x6a06, 0x0098, 0x080c, 0x15d9, 0x01a8,
-	0x2d00, 0x60a6, 0x6803, 0x0000, 0xad88, 0x0004, 0x20a9, 0x0010,
-	0x200b, 0xffff, 0x8108, 0x1f04, 0x4dc0, 0x6807, 0x0001, 0x6e12,
-	0xa085, 0x0001, 0x012e, 0x00de, 0x0005, 0xa006, 0x0cd8, 0x0126,
-	0x2091, 0x8000, 0x00d6, 0x60a4, 0xa00d, 0x01a0, 0x2168, 0x6800,
-	0xa005, 0x1160, 0x080c, 0x4ef9, 0x1168, 0x200b, 0xffff, 0x6804,
-	0xa08a, 0x0002, 0x0218, 0x8001, 0x6806, 0x0020, 0x080c, 0x15f0,
-	0x60a7, 0x0000, 0x00de, 0x012e, 0x0005, 0x0126, 0x2091, 0x8000,
-	0x080c, 0x4f56, 0x0010, 0x080c, 0x4bc0, 0x080c, 0x4e71, 0x1dd8,
-	0x080c, 0x4e3a, 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, 0x4e0e, 0x080c, 0x14f6, 0x260a,
-	0x8210, 0x6a56, 0x0098, 0x080c, 0x15d9, 0x01d0, 0x2d00, 0x60aa,
-	0x6853, 0x0000, 0xad88, 0x0018, 0x20a9, 0x0010, 0x200b, 0xffff,
-	0x8108, 0x1f04, 0x4e26, 0x6857, 0x0001, 0x6e62, 0x0010, 0x080c,
-	0x4c11, 0x0089, 0x1de0, 0xa085, 0x0001, 0x012e, 0x00de, 0x0005,
-	0xa006, 0x0cd8, 0x0126, 0x2091, 0x8000, 0x080c, 0x67c5, 0x012e,
-	0x0005, 0xa01e, 0x0010, 0x2019, 0x0001, 0xa00e, 0x0126, 0x2091,
-	0x8000, 0x604c, 0x2068, 0x6000, 0xd0dc, 0x1170, 0x8dff, 0x01e8,
-	0x83ff, 0x0120, 0x6848, 0xa606, 0x0158, 0x0030, 0x683c, 0xa406,
-	0x1118, 0x6840, 0xa506, 0x0120, 0x2d08, 0x6800, 0x2068, 0x0c70,
-	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,
-	0x4ef3, 0x1110, 0x2011, 0x0001, 0x080c, 0x4f3d, 0x1110, 0xa295,
-	0x0002, 0x0005, 0x080c, 0x4f6e, 0x0118, 0x080c, 0x964b, 0x0010,
-	0xa085, 0x0001, 0x0005, 0x080c, 0x4f6e, 0x0118, 0x080c, 0x95e4,
-	0x0010, 0xa085, 0x0001, 0x0005, 0x080c, 0x4f6e, 0x0118, 0x080c,
-	0x962e, 0x0010, 0xa085, 0x0001, 0x0005, 0x080c, 0x4f6e, 0x0118,
-	0x080c, 0x9600, 0x0010, 0xa085, 0x0001, 0x0005, 0x080c, 0x4f6e,
-	0x0118, 0x080c, 0x9667, 0x0010, 0xa085, 0x0001, 0x0005, 0x0126,
-	0x0006, 0x00d6, 0x2091, 0x8000, 0x6080, 0xa06d, 0x01a0, 0x6800,
-	0x0006, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x080c, 0x97fd,
-	0x0006, 0x6000, 0xd0fc, 0x0110, 0x080c, 0xac03, 0x000e, 0x080c,
-	0x510c, 0x000e, 0x0c50, 0x6083, 0x0000, 0x6087, 0x0000, 0x00de,
-	0x000e, 0x012e, 0x0005, 0x60a4, 0xa00d, 0x1118, 0xa085, 0x0001,
-	0x0005, 0x00e6, 0x2170, 0x7000, 0xa005, 0x1160, 0x20a9, 0x0010,
-	0xae88, 0x0004, 0x2104, 0xa606, 0x0128, 0x8108, 0x1f04, 0x4f02,
-	0xa085, 0x0001, 0xa006, 0x00ee, 0x0005, 0x00d6, 0x0126, 0x2091,
-	0x8000, 0x60a4, 0xa06d, 0x1128, 0x080c, 0x15d9, 0x01a0, 0x2d00,
-	0x60a6, 0x6803, 0x0001, 0x6807, 0x0000, 0xad88, 0x0004, 0x20a9,
-	0x0010, 0x200b, 0xffff, 0x8108, 0x1f04, 0x4f21, 0xa085, 0x0001,
-	0x012e, 0x00de, 0x0005, 0xa006, 0x0cd8, 0x00d6, 0x0126, 0x2091,
-	0x8000, 0x60a4, 0xa06d, 0x0130, 0x60a7, 0x0000, 0x080c, 0x15f0,
-	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, 0x4f4c, 0xa085, 0x0001, 0x00ee, 0x0005, 0x0126, 0x2091,
-	0x8000, 0x0c19, 0x1188, 0x200b, 0xffff, 0x00d6, 0x60a8, 0x2068,
-	0x6854, 0xa08a, 0x0002, 0x0218, 0x8001, 0x6856, 0x0020, 0x080c,
-	0x15f0, 0x60ab, 0x0000, 0x00de, 0x012e, 0x0005, 0x609c, 0xd0a4,
-	0x0005, 0x00f6, 0x080c, 0x574f, 0x01b0, 0x71b4, 0x81ff, 0x1198,
-	0x71d0, 0xd19c, 0x0180, 0x2001, 0x007e, 0xa080, 0xae34, 0x2004,
-	0xa07d, 0x0148, 0x7804, 0xa084, 0x00ff, 0xa086, 0x0006, 0x1118,
-	0x7800, 0xc0ed, 0x7802, 0x2079, 0xad51, 0x7804, 0xd0a4, 0x01e8,
-	0x0156, 0x00c6, 0x20a9, 0x007f, 0x2009, 0x0000, 0x0016, 0x080c,
-	0x4cdc, 0x1168, 0x6004, 0xa084, 0xff00, 0x8007, 0xa096, 0x0004,
-	0x0118, 0xa086, 0x0006, 0x1118, 0x6000, 0xc0ed, 0x6002, 0x001e,
-	0x8108, 0x1f04, 0x4f96, 0x00ce, 0x015e, 0x080c, 0x502d, 0x0120,
-	0x2001, 0xafa2, 0x200c, 0x0038, 0x2079, 0xad51, 0x7804, 0xd0a4,
-	0x0130, 0x2009, 0x07d0, 0x2011, 0x4fc1, 0x080c, 0x6593, 0x00fe,
-	0x0005, 0x2011, 0x4fc1, 0x080c, 0x650d, 0x080c, 0x502d, 0x01f0,
-	0x2001, 0xaeb2, 0x2004, 0xa080, 0x0000, 0x200c, 0xc1ec, 0x2102,
-	0x2001, 0xad52, 0x2004, 0xd0a4, 0x0130, 0x2009, 0x07d0, 0x2011,
-	0x4fc1, 0x080c, 0x6593, 0x00e6, 0x2071, 0xad00, 0x706f, 0x0000,
-	0x7073, 0x0000, 0x080c, 0x28fa, 0x00ee, 0x04b0, 0x0156, 0x00c6,
-	0x20a9, 0x007f, 0x2009, 0x0000, 0x0016, 0x080c, 0x4cdc, 0x1530,
-	0x6000, 0xd0ec, 0x0518, 0x0046, 0x62a0, 0xa294, 0x00ff, 0x8227,
-	0xa006, 0x2009, 0x0029, 0x080c, 0xa96c, 0x6000, 0xc0e5, 0xc0ec,
-	0x6002, 0x6004, 0xa084, 0x00ff, 0xa085, 0x0700, 0x6006, 0x2019,
-	0x0029, 0x080c, 0x68e7, 0x0076, 0x2039, 0x0000, 0x080c, 0x681d,
-	0x2009, 0x0000, 0x080c, 0xa712, 0x007e, 0x004e, 0x001e, 0x8108,
-	0x1f04, 0x4fec, 0x00ce, 0x015e, 0x0005, 0x00c6, 0x6018, 0x2060,
-	0x6000, 0xc0ec, 0x6002, 0x00ce, 0x0005, 0x7818, 0x2004, 0xd0ac,
-	0x0005, 0x7818, 0x2004, 0xd0bc, 0x0005, 0x00f6, 0x2001, 0xaeb2,
-	0x2004, 0xa07d, 0x0110, 0x7800, 0xd0ec, 0x00fe, 0x0005, 0x0126,
-	0x0026, 0x2091, 0x8000, 0x6200, 0xa005, 0x0110, 0xc2fd, 0x0008,
-	0xc2fc, 0x6202, 0x002e, 0x012e, 0x0005, 0x2071, 0xae13, 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,
-	0xaf7c, 0x7003, 0xae13, 0x7007, 0x0000, 0x700b, 0x0000, 0x700f,
-	0xaf5c, 0x7013, 0x0020, 0x7017, 0x0040, 0x7037, 0x0000, 0x0005,
-	0x0016, 0x00e6, 0x2071, 0xaf34, 0xa00e, 0x7186, 0x718a, 0x7097,
-	0x0001, 0x2001, 0xad52, 0x2004, 0xd0fc, 0x1150, 0x2001, 0xad52,
-	0x2004, 0xa00e, 0xd09c, 0x0108, 0x8108, 0x7102, 0x0804, 0x50d6,
-	0x2001, 0xad71, 0x200c, 0xa184, 0x000f, 0x2009, 0xad72, 0x210c,
-	0x0002, 0x507e, 0x50b1, 0x50b8, 0x50c2, 0x50c7, 0x507e, 0x507e,
-	0x507e, 0x50a1, 0x507e, 0x507e, 0x507e, 0x507e, 0x507e, 0x507e,
-	0x507e, 0x7003, 0x0004, 0x0136, 0x0146, 0x0156, 0x2099, 0xad75,
-	0x20a1, 0xaf85, 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, 0xae13, 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, 0x5165, 0x6804, 0xa00d, 0x0188, 0x00d6, 0x2071,
-	0xad00, 0xa016, 0x702c, 0x2168, 0x6904, 0x206a, 0x8210, 0x2d00,
-	0x81ff, 0x1dc8, 0x702e, 0x70b0, 0xa200, 0x70b2, 0x00de, 0x2071,
-	0xae13, 0x701c, 0xa005, 0x1904, 0x5175, 0x20a9, 0x0032, 0x0f04,
-	0x5173, 0x0e04, 0x512f, 0x2071, 0xaf34, 0x7200, 0x82ff, 0x05d8,
-	0x6934, 0xa186, 0x0103, 0x1904, 0x5183, 0x6948, 0x6844, 0xa105,
-	0x1540, 0x2009, 0x8020, 0x2200, 0x0002, 0x5173, 0x514a, 0x519b,
-	0x51a7, 0x5173, 0x2071, 0x0000, 0x20a9, 0x0032, 0x0f04, 0x5173,
-	0x7018, 0xd084, 0x1dd8, 0x7122, 0x683c, 0x7026, 0x6840, 0x702a,
-	0x701b, 0x0001, 0x2091, 0x4080, 0x2071, 0xad00, 0x702c, 0x206a,
-	0x2d00, 0x702e, 0x70b0, 0x8000, 0x70b2, 0x002e, 0x00ee, 0x015e,
-	0x0005, 0x6844, 0xa086, 0x0100, 0x1130, 0x6868, 0xa005, 0x1118,
-	0x2009, 0x8020, 0x0880, 0x2071, 0xae13, 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, 0x5143, 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, 0x515c, 0x718c, 0x7084, 0xa10a, 0x0a04, 0x515c, 0x2071,
-	0x0000, 0x7018, 0xd084, 0x1904, 0x515c, 0x2071, 0xaf34, 0x7000,
-	0xa086, 0x0002, 0x1150, 0x080c, 0x5426, 0x2071, 0x0000, 0x701b,
-	0x0001, 0x2091, 0x4080, 0x0804, 0x515c, 0x080c, 0x5450, 0x2071,
-	0x0000, 0x701b, 0x0001, 0x2091, 0x4080, 0x0804, 0x515c, 0x0006,
-	0x684c, 0x0006, 0x6837, 0x0103, 0x20a9, 0x001c, 0xad80, 0x0011,
-	0x20a0, 0x2001, 0x0000, 0x40a4, 0x000e, 0xa084, 0x00ff, 0x684e,
-	0x000e, 0x684a, 0x6952, 0x0005, 0x2071, 0xae13, 0x7004, 0x0002,
-	0x5202, 0x5213, 0x5411, 0x5412, 0x541f, 0x5425, 0x5203, 0x5402,
-	0x5398, 0x53ee, 0x0005, 0x0126, 0x2091, 0x8000, 0x0e04, 0x5212,
-	0x2009, 0x000d, 0x7030, 0x200a, 0x2091, 0x4080, 0x7007, 0x0001,
-	0x700b, 0x0000, 0x012e, 0x2069, 0xafda, 0x683c, 0xa005, 0x03f8,
-	0x11f0, 0x0126, 0x2091, 0x8000, 0x2069, 0x0000, 0x6934, 0x2001,
-	0xae1f, 0x2004, 0xa10a, 0x0170, 0x0e04, 0x5236, 0x2069, 0x0000,
-	0x6818, 0xd084, 0x1158, 0x2009, 0x8040, 0x6922, 0x681b, 0x0001,
-	0x2091, 0x4080, 0x2069, 0xafda, 0x683f, 0xffff, 0x012e, 0x2069,
-	0xad00, 0x6844, 0x6964, 0xa102, 0x2069, 0xaf34, 0x688a, 0x6984,
-	0x701c, 0xa06d, 0x0120, 0x81ff, 0x0904, 0x528c, 0x00a0, 0x81ff,
-	0x0904, 0x5352, 0x2071, 0xaf34, 0x7184, 0x7088, 0xa10a, 0x1258,
-	0x7190, 0x2071, 0xafda, 0x7038, 0xa005, 0x0128, 0x1b04, 0x5352,
-	0x713a, 0x0804, 0x5352, 0x2071, 0xaf34, 0x718c, 0x0126, 0x2091,
-	0x8000, 0x7084, 0xa10a, 0x0a04, 0x536d, 0x0e04, 0x530e, 0x2071,
-	0x0000, 0x7018, 0xd084, 0x1904, 0x530e, 0x2001, 0xffff, 0x2071,
-	0xafda, 0x703a, 0x2071, 0xaf34, 0x7000, 0xa086, 0x0002, 0x1150,
-	0x080c, 0x5426, 0x2071, 0x0000, 0x701b, 0x0001, 0x2091, 0x4080,
-	0x0804, 0x530e, 0x080c, 0x5450, 0x2071, 0x0000, 0x701b, 0x0001,
-	0x2091, 0x4080, 0x0804, 0x530e, 0x2071, 0xaf34, 0x7000, 0xa005,
-	0x0904, 0x5334, 0x6934, 0xa186, 0x0103, 0x1904, 0x5311, 0x684c,
-	0xd0bc, 0x1904, 0x5334, 0x6948, 0x6844, 0xa105, 0x1904, 0x5329,
-	0x2009, 0x8020, 0x2071, 0xaf34, 0x7000, 0x0002, 0x5334, 0x52f4,
-	0x52cc, 0x52de, 0x52ab, 0x0136, 0x0146, 0x0156, 0x2099, 0xad75,
-	0x20a1, 0xaf85, 0x20a9, 0x0004, 0x53a3, 0x015e, 0x014e, 0x013e,
-	0x2071, 0xaf7c, 0xad80, 0x000f, 0x700e, 0x7013, 0x0002, 0x7007,
-	0x0002, 0x700b, 0x0000, 0x2e10, 0x080c, 0x1624, 0x2071, 0xae13,
-	0x7007, 0x0009, 0x0804, 0x5352, 0x7084, 0x8008, 0xa092, 0x001e,
-	0x1a04, 0x5352, 0xae90, 0x0003, 0xa210, 0x683c, 0x2012, 0x7186,
-	0x2071, 0xae13, 0x080c, 0x54a7, 0x0804, 0x5352, 0x7084, 0x8008,
-	0xa092, 0x000f, 0x1a04, 0x5352, 0xae90, 0x0003, 0x8003, 0xa210,
-	0x683c, 0x2012, 0x8210, 0x6840, 0x2012, 0x7186, 0x2071, 0xae13,
-	0x080c, 0x54a7, 0x0804, 0x5352, 0x0126, 0x2091, 0x8000, 0x0e04,
-	0x530e, 0x2071, 0x0000, 0x7018, 0xd084, 0x1180, 0x7122, 0x683c,
-	0x7026, 0x6840, 0x702a, 0x701b, 0x0001, 0x2091, 0x4080, 0x012e,
-	0x2071, 0xae13, 0x080c, 0x54a7, 0x0804, 0x5352, 0x012e, 0x0804,
-	0x5352, 0xa18c, 0x00ff, 0xa186, 0x0017, 0x0130, 0xa186, 0x001e,
-	0x0118, 0xa18e, 0x001f, 0x11c0, 0x684c, 0xd0cc, 0x01a8, 0x6850,
-	0xa084, 0x00ff, 0xa086, 0x0001, 0x1178, 0x2009, 0x8021, 0x0804,
-	0x52a2, 0x6844, 0xa086, 0x0100, 0x1138, 0x6868, 0xa005, 0x1120,
-	0x2009, 0x8020, 0x0804, 0x52a2, 0x2071, 0xae13, 0x080c, 0x54b9,
-	0x01c8, 0x2071, 0xae13, 0x700f, 0x0001, 0x6934, 0xa184, 0x00ff,
-	0xa086, 0x0003, 0x1130, 0x810f, 0xa18c, 0x00ff, 0x8101, 0x0108,
-	0x710e, 0x7007, 0x0003, 0x080c, 0x54d2, 0x7050, 0xa086, 0x0100,
-	0x0904, 0x5412, 0x0126, 0x2091, 0x8000, 0x2071, 0xae13, 0x7008,
-	0xa086, 0x0001, 0x1180, 0x0e04, 0x536b, 0x2009, 0x000d, 0x7030,
-	0x200a, 0x2091, 0x4080, 0x700b, 0x0000, 0x7004, 0xa086, 0x0006,
-	0x1110, 0x7007, 0x0001, 0x012e, 0x0005, 0x2071, 0xae13, 0x080c,
-	0x54b9, 0x0518, 0x2071, 0xaf34, 0x7084, 0x700a, 0x20a9, 0x0020,
-	0x2099, 0xaf35, 0x20a1, 0xaf5c, 0x53a3, 0x7087, 0x0000, 0x2071,
-	0xae13, 0x2069, 0xaf7c, 0x706c, 0x6826, 0x7070, 0x682a, 0x7074,
-	0x682e, 0x7078, 0x6832, 0x2d10, 0x080c, 0x1624, 0x7007, 0x0008,
-	0x2001, 0xffff, 0x2071, 0xafda, 0x703a, 0x012e, 0x0804, 0x5352,
-	0x2069, 0xaf7c, 0x6808, 0xa08e, 0x0000, 0x0904, 0x53ed, 0xa08e,
-	0x0200, 0x0904, 0x53eb, 0xa08e, 0x0100, 0x1904, 0x53ed, 0x0126,
-	0x2091, 0x8000, 0x0e04, 0x53e9, 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, 0xaf59, 0x2004, 0xa005, 0x1190, 0x6934, 0x2069,
-	0xaf34, 0x689c, 0x699e, 0x2069, 0xafda, 0xa102, 0x1118, 0x683c,
-	0xa005, 0x1368, 0x2001, 0xaf5a, 0x200c, 0x810d, 0x693e, 0x0038,
-	0x2009, 0x8040, 0x6922, 0x681b, 0x0001, 0x2091, 0x4080, 0x7007,
-	0x0001, 0x012e, 0x0010, 0x7007, 0x0005, 0x0005, 0x2001, 0xaf7e,
-	0x2004, 0xa08e, 0x0100, 0x1128, 0x7007, 0x0001, 0x080c, 0x54a7,
-	0x0005, 0xa08e, 0x0000, 0x0de0, 0xa08e, 0x0200, 0x1dc8, 0x7007,
-	0x0005, 0x0005, 0x701c, 0xa06d, 0x0158, 0x080c, 0x54b9, 0x0140,
-	0x7007, 0x0003, 0x080c, 0x54d2, 0x7050, 0xa086, 0x0100, 0x0110,
-	0x0005, 0x0005, 0x7050, 0xa09e, 0x0100, 0x1118, 0x7007, 0x0004,
-	0x0030, 0xa086, 0x0200, 0x1110, 0x7007, 0x0005, 0x0005, 0x080c,
-	0x5475, 0x7006, 0x080c, 0x54a7, 0x0005, 0x0005, 0x00e6, 0x0156,
-	0x2071, 0xaf34, 0x7184, 0x81ff, 0x0500, 0xa006, 0x7086, 0xae80,
-	0x0003, 0x2071, 0x0000, 0x21a8, 0x2014, 0x7226, 0x8000, 0x0f04,
-	0x544a, 0x2014, 0x722a, 0x8000, 0x0f04, 0x544a, 0x2014, 0x722e,
-	0x8000, 0x0f04, 0x544a, 0x2014, 0x723a, 0x8000, 0x0f04, 0x544a,
-	0x2014, 0x723e, 0xa180, 0x8030, 0x7022, 0x015e, 0x00ee, 0x0005,
-	0x00e6, 0x0156, 0x2071, 0xaf34, 0x7184, 0x81ff, 0x01d8, 0xa006,
-	0x7086, 0xae80, 0x0003, 0x2071, 0x0000, 0x21a8, 0x2014, 0x7226,
-	0x8000, 0x2014, 0x722a, 0x8000, 0x0f04, 0x546c, 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, 0x54a1, 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, 0x15f0,
-	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, 0xafec, 0x2104, 0xc08d,
-	0x200a, 0x012e, 0x080c, 0x163c, 0x0005, 0x7088, 0xa08a, 0x0029,
-	0x1220, 0xa082, 0x001d, 0x0033, 0x0010, 0x080c, 0x14f6, 0x6027,
-	0x1e00, 0x0005, 0x55c1, 0x555b, 0x5571, 0x5595, 0x55b4, 0x55e6,
-	0x55f8, 0x5571, 0x55d2, 0x54ff, 0x552d, 0x54fe, 0x0005, 0x00d6,
-	0x2069, 0x0200, 0x6804, 0xa005, 0x1180, 0x6808, 0xa005, 0x1518,
-	0x708b, 0x0028, 0x2069, 0xafac, 0x2d04, 0x7002, 0x080c, 0x584d,
-	0x6028, 0xa085, 0x0600, 0x602a, 0x00b0, 0x708b, 0x0028, 0x2069,
-	0xafac, 0x2d04, 0x7002, 0x6028, 0xa085, 0x0600, 0x602a, 0x00e6,
-	0x0036, 0x0046, 0x0056, 0x2071, 0xaffd, 0x080c, 0x1d22, 0x005e,
-	0x004e, 0x003e, 0x00ee, 0x00de, 0x0005, 0x00d6, 0x2069, 0x0200,
-	0x6804, 0xa005, 0x1180, 0x6808, 0xa005, 0x1518, 0x708b, 0x0028,
-	0x2069, 0xafac, 0x2d04, 0x7002, 0x080c, 0x58da, 0x6028, 0xa085,
-	0x0600, 0x602a, 0x00b0, 0x708b, 0x0028, 0x2069, 0xafac, 0x2d04,
-	0x7002, 0x6028, 0xa085, 0x0600, 0x602a, 0x00e6, 0x0036, 0x0046,
-	0x0056, 0x2071, 0xaffd, 0x080c, 0x1d22, 0x005e, 0x004e, 0x003e,
-	0x00ee, 0x00de, 0x0005, 0x6803, 0x0090, 0x6124, 0xd1e4, 0x1180,
-	0x080c, 0x5663, 0xd1d4, 0x1150, 0xd1dc, 0x1128, 0xd1cc, 0x0140,
-	0x708b, 0x0020, 0x0028, 0x708b, 0x001d, 0x0010, 0x708b, 0x001f,
-	0x0005, 0x6803, 0x0088, 0x6124, 0xd1cc, 0x11c8, 0xd1dc, 0x11a0,
-	0xd1e4, 0x1178, 0xa184, 0x1e00, 0x11b8, 0x60e3, 0x0001, 0x600c,
-	0xc0b4, 0x600e, 0x080c, 0x577f, 0x6803, 0x0080, 0x708b, 0x0028,
-	0x0058, 0x708b, 0x001e, 0x0040, 0x708b, 0x001d, 0x0028, 0x708b,
-	0x0020, 0x0010, 0x708b, 0x001f, 0x0005, 0x60e3, 0x0001, 0x600c,
-	0xc0b4, 0x600e, 0x080c, 0x577f, 0x6803, 0x0080, 0x6124, 0xd1d4,
-	0x1180, 0xd1dc, 0x1158, 0xd1e4, 0x1130, 0xa184, 0x1e00, 0x1158,
-	0x708b, 0x0028, 0x0040, 0x708b, 0x001e, 0x0028, 0x708b, 0x001d,
-	0x0010, 0x708b, 0x001f, 0x0005, 0x6803, 0x00a0, 0x6124, 0xd1dc,
-	0x1128, 0xd1e4, 0x0128, 0x708b, 0x001e, 0x0010, 0x708b, 0x001d,
-	0x0005, 0x080c, 0x568d, 0x6124, 0xd1dc, 0x1158, 0x080c, 0x5663,
-	0xd1d4, 0x1128, 0xd1e4, 0x0128, 0x708b, 0x001e, 0x0010, 0x708b,
-	0x001f, 0x0005, 0x6803, 0x00a0, 0x6124, 0xd1d4, 0x1160, 0xd1cc,
-	0x1150, 0xd1dc, 0x1128, 0xd1e4, 0x0140, 0x708b, 0x001e, 0x0028,
-	0x708b, 0x001d, 0x0010, 0x708b, 0x0021, 0x0005, 0x080c, 0x568d,
-	0x6124, 0xd1d4, 0x1150, 0xd1dc, 0x1128, 0xd1e4, 0x0140, 0x708b,
-	0x001e, 0x0028, 0x708b, 0x001d, 0x0010, 0x708b, 0x001f, 0x0005,
-	0x6803, 0x0090, 0x6124, 0xd1d4, 0x1178, 0xd1cc, 0x1150, 0xd1dc,
-	0x1128, 0xd1e4, 0x0158, 0x708b, 0x001e, 0x0040, 0x708b, 0x001d,
-	0x0028, 0x708b, 0x0020, 0x0010, 0x708b, 0x001f, 0x0005, 0x0016,
-	0x00c6, 0x00d6, 0x00e6, 0x0126, 0x2061, 0x0100, 0x2069, 0x0140,
-	0x2071, 0xad00, 0x2091, 0x8000, 0x080c, 0x574f, 0x11e8, 0x2001,
-	0xad0c, 0x200c, 0xd1b4, 0x01c0, 0xc1b4, 0x2102, 0x6027, 0x0200,
-	0xe000, 0xe000, 0x6024, 0xd0cc, 0x0158, 0x6803, 0x00a0, 0x2001,
-	0xaf9e, 0x2003, 0x0001, 0x2001, 0xad00, 0x2003, 0x0001, 0x0428,
-	0x6028, 0xc0cd, 0x602a, 0x0408, 0x080c, 0x576b, 0x0150, 0x080c,
-	0x5761, 0x1138, 0x2001, 0x0001, 0x080c, 0x261e, 0x080c, 0x5726,
-	0x00a0, 0x080c, 0x568a, 0x0178, 0x2001, 0x0001, 0x080c, 0x261e,
-	0x7088, 0xa086, 0x001e, 0x0120, 0x7088, 0xa086, 0x0022, 0x1118,
-	0x708b, 0x0025, 0x0010, 0x708b, 0x0021, 0x012e, 0x00ee, 0x00de,
-	0x00ce, 0x001e, 0x0005, 0x0016, 0x0026, 0x2009, 0x0064, 0x2011,
-	0x566e, 0x080c, 0x6501, 0x002e, 0x001e, 0x0005, 0x00e6, 0x00f6,
-	0x0016, 0x080c, 0x7834, 0x2071, 0xad00, 0x080c, 0x560f, 0x001e,
-	0x00fe, 0x00ee, 0x0005, 0x2001, 0xad00, 0x2004, 0xa086, 0x0004,
-	0x0140, 0x2001, 0xaf9d, 0x2003, 0xaaaa, 0x2001, 0xaf9e, 0x2003,
-	0x0000, 0x0005, 0x6020, 0xd09c, 0x0005, 0x6803, 0x00c0, 0x0156,
-	0x20a9, 0x002d, 0x1d04, 0x5692, 0x2091, 0x6000, 0x1f04, 0x5692,
-	0x015e, 0x0005, 0x00c6, 0x00d6, 0x00e6, 0x2061, 0x0100, 0x2069,
-	0x0140, 0x2071, 0xad00, 0x2001, 0xaf9e, 0x200c, 0xa186, 0x0000,
-	0x0158, 0xa186, 0x0001, 0x0158, 0xa186, 0x0002, 0x0158, 0xa186,
-	0x0003, 0x0158, 0x0804, 0x5714, 0x708b, 0x0022, 0x0040, 0x708b,
-	0x0021, 0x0028, 0x708b, 0x0023, 0x0020, 0x708b, 0x0024, 0x6043,
-	0x0000, 0x60e3, 0x0000, 0x6887, 0x0001, 0x2001, 0x0001, 0x080c,
-	0x26cb, 0x0026, 0x2011, 0x0003, 0x080c, 0x7adf, 0x2011, 0x0002,
-	0x080c, 0x7ae9, 0x002e, 0x7000, 0xa08e, 0x0004, 0x0118, 0x602b,
-	0x0028, 0x0010, 0x602b, 0x0020, 0x0156, 0x0126, 0x2091, 0x8000,
-	0x20a9, 0x0005, 0x6024, 0xd0ac, 0x0118, 0x012e, 0x015e, 0x04d0,
-	0x6800, 0xa084, 0x00a0, 0xc0bd, 0x6802, 0x6904, 0xd1d4, 0x1130,
-	0x6803, 0x0100, 0x1f04, 0x56e2, 0x080c, 0x57a0, 0x012e, 0x015e,
-	0x080c, 0x5761, 0x01a8, 0x6044, 0xa005, 0x0168, 0x6050, 0x0006,
-	0xa085, 0x0020, 0x6052, 0x080c, 0x57a0, 0xa006, 0x8001, 0x1df0,
-	0x000e, 0x6052, 0x0028, 0x6804, 0xd0d4, 0x1110, 0x080c, 0x57a0,
-	0x2001, 0xaf9e, 0x2003, 0x0004, 0x080c, 0x54e5, 0x080c, 0x5761,
-	0x0148, 0x6804, 0xd0d4, 0x1130, 0xd0dc, 0x1100, 0x2001, 0xaf9e,
-	0x2003, 0x0000, 0x00ee, 0x00de, 0x00ce, 0x0005, 0x00c6, 0x00d6,
-	0x00e6, 0x2061, 0x0100, 0x2069, 0x0140, 0x2071, 0xad00, 0x2001,
-	0xaf9d, 0x2003, 0x0000, 0x2001, 0xaf8e, 0x2003, 0x0000, 0x708b,
-	0x0000, 0x60e3, 0x0000, 0x6887, 0x0000, 0x2001, 0x0000, 0x080c,
-	0x26cb, 0x6803, 0x0000, 0x6043, 0x0090, 0x6043, 0x0010, 0x6027,
-	0xffff, 0x602b, 0x182f, 0x00ee, 0x00de, 0x00ce, 0x0005, 0x0006,
-	0x2001, 0xaf9d, 0x2004, 0xa086, 0xaaaa, 0x000e, 0x0005, 0x0006,
-	0x2001, 0xad71, 0x2004, 0xa084, 0x0030, 0xa086, 0x0000, 0x000e,
-	0x0005, 0x0006, 0x2001, 0xad71, 0x2004, 0xa084, 0x0030, 0xa086,
-	0x0030, 0x000e, 0x0005, 0x0006, 0x2001, 0xad71, 0x2004, 0xa084,
-	0x0030, 0xa086, 0x0010, 0x000e, 0x0005, 0x0006, 0x2001, 0xad71,
-	0x2004, 0xa084, 0x0030, 0xa086, 0x0020, 0x000e, 0x0005, 0x2001,
-	0xad0c, 0x2004, 0xd0a4, 0x0170, 0x080c, 0x26eb, 0x0036, 0x0016,
-	0x2009, 0x0000, 0x2019, 0x0028, 0x080c, 0x2aac, 0x001e, 0x003e,
-	0xa006, 0x0009, 0x0005, 0x00e6, 0x2071, 0xad0c, 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, 0x26cb, 0x6800, 0xa084,
-	0x00a0, 0xc0bd, 0x6802, 0x6803, 0x00a0, 0x000e, 0x6052, 0x6050,
-	0x0005, 0x0156, 0x0016, 0x0026, 0x0036, 0x00c6, 0x00d6, 0x00e6,
-	0x2061, 0x0100, 0x2069, 0x0140, 0x2071, 0xad00, 0x6020, 0xa084,
-	0x0080, 0x0138, 0x2001, 0xad0c, 0x200c, 0xc1bd, 0x2102, 0x0804,
-	0x5845, 0x2001, 0xad0c, 0x200c, 0xc1bc, 0x2102, 0x6028, 0xa084,
-	0xe1ff, 0x602a, 0x6027, 0x0200, 0x6803, 0x0090, 0x20a9, 0x0384,
-	0x6024, 0xd0cc, 0x1518, 0x1d04, 0x57f8, 0x2091, 0x6000, 0x1f04,
-	0x57f8, 0x2011, 0x0003, 0x080c, 0x7adf, 0x2011, 0x0002, 0x080c,
-	0x7ae9, 0x080c, 0x79e1, 0x080c, 0x6581, 0x2019, 0x0000, 0x080c,
-	0x7a64, 0x6803, 0x00a0, 0x2001, 0xaf9e, 0x2003, 0x0001, 0x2001,
-	0xad00, 0x2003, 0x0001, 0xa085, 0x0001, 0x0438, 0x60e3, 0x0000,
-	0x2001, 0xaf8e, 0x2004, 0x080c, 0x26cb, 0x60e2, 0x6803, 0x0080,
-	0x20a9, 0x0384, 0x6027, 0x1e00, 0x2009, 0x1e00, 0xe000, 0x6024,
-	0xa10c, 0x0138, 0x1d04, 0x582a, 0x2091, 0x6000, 0x1f04, 0x582a,
-	0x0840, 0x6028, 0xa085, 0x1e00, 0x602a, 0x70a0, 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, 0xad00,
-	0x2069, 0x0140, 0x6020, 0xa084, 0x00c0, 0x0120, 0x6884, 0xa005,
-	0x1904, 0x58a1, 0x6803, 0x0088, 0x60e3, 0x0000, 0x6887, 0x0000,
-	0x2001, 0x0000, 0x080c, 0x26cb, 0x2069, 0x0200, 0x6804, 0xa005,
-	0x1118, 0x6808, 0xa005, 0x01c0, 0x6028, 0xa084, 0xfbff, 0x602a,
-	0x6027, 0x0400, 0x2069, 0xafac, 0x7000, 0x206a, 0x708b, 0x0026,
-	0x7003, 0x0001, 0x20a9, 0x0002, 0x1d04, 0x5884, 0x2091, 0x6000,
-	0x1f04, 0x5884, 0x0804, 0x58d2, 0x2069, 0x0140, 0x20a9, 0x0384,
-	0x6027, 0x1e00, 0x2009, 0x1e00, 0xe000, 0x6024, 0xa10c, 0x0530,
-	0xa084, 0x1a00, 0x1518, 0x1d04, 0x5890, 0x2091, 0x6000, 0x1f04,
-	0x5890, 0x2011, 0x0003, 0x080c, 0x7adf, 0x2011, 0x0002, 0x080c,
-	0x7ae9, 0x080c, 0x79e1, 0x080c, 0x6581, 0x2019, 0x0000, 0x080c,
-	0x7a64, 0x6803, 0x00a0, 0x2001, 0xaf9e, 0x2003, 0x0001, 0x2001,
-	0xad00, 0x2003, 0x0001, 0xa085, 0x0001, 0x00a0, 0x6803, 0x0080,
-	0x2069, 0x0140, 0x60e3, 0x0000, 0x70a0, 0xa005, 0x1118, 0x6887,
-	0x0001, 0x0008, 0x6886, 0x2001, 0xaf8e, 0x2004, 0x080c, 0x26cb,
-	0x60e2, 0xa006, 0x00ee, 0x00de, 0x00ce, 0x003e, 0x002e, 0x001e,
-	0x015e, 0x0005, 0x0156, 0x0016, 0x0026, 0x0036, 0x00c6, 0x00d6,
-	0x00e6, 0x2061, 0x0100, 0x2071, 0xad00, 0x6020, 0xa084, 0x00c0,
-	0x01f0, 0x2011, 0x0003, 0x080c, 0x7adf, 0x2011, 0x0002, 0x080c,
-	0x7ae9, 0x080c, 0x79e1, 0x080c, 0x6581, 0x2019, 0x0000, 0x080c,
-	0x7a64, 0x2069, 0x0140, 0x6803, 0x00a0, 0x2001, 0xaf9e, 0x2003,
-	0x0001, 0x2001, 0xad00, 0x2003, 0x0001, 0x0804, 0x5972, 0x2001,
-	0xad0c, 0x200c, 0xd1b4, 0x1150, 0xc1b5, 0x2102, 0x080c, 0x5663,
-	0x2069, 0x0140, 0x6803, 0x0080, 0x60e3, 0x0000, 0x2069, 0x0200,
-	0x6804, 0xa005, 0x1118, 0x6808, 0xa005, 0x01b8, 0x6028, 0xa084,
-	0xfdff, 0x602a, 0x6027, 0x0200, 0x2069, 0xafac, 0x7000, 0x206a,
-	0x708b, 0x0027, 0x7003, 0x0001, 0x20a9, 0x0002, 0x1d04, 0x592e,
-	0x2091, 0x6000, 0x1f04, 0x592e, 0x04e8, 0x6027, 0x1e00, 0x2009,
-	0x1e00, 0xe000, 0x6024, 0xa10c, 0x01c8, 0xa084, 0x1c00, 0x11b0,
-	0x1d04, 0x5935, 0x0006, 0x0016, 0x00c6, 0x00d6, 0x00e6, 0x080c,
-	0x64a2, 0x00ee, 0x00de, 0x00ce, 0x001e, 0x000e, 0x00e6, 0x2071,
-	0xafda, 0x7018, 0x00ee, 0xa005, 0x1d00, 0x01e0, 0x0026, 0x2011,
-	0x566e, 0x080c, 0x650d, 0x002e, 0x2069, 0x0140, 0x60e3, 0x0000,
-	0x70a0, 0xa005, 0x1118, 0x6887, 0x0001, 0x0008, 0x6886, 0x2001,
-	0xaf8e, 0x2004, 0x080c, 0x26cb, 0x60e2, 0x2001, 0xad0c, 0x200c,
-	0xc1b4, 0x2102, 0x00ee, 0x00de, 0x00ce, 0x003e, 0x002e, 0x001e,
-	0x015e, 0x0005, 0x0156, 0x0016, 0x0026, 0x0036, 0x0046, 0x00c6,
-	0x00e6, 0x2061, 0x0100, 0x2071, 0xad00, 0x7130, 0xd184, 0x1180,
-	0x2011, 0xad52, 0x2214, 0xd2ec, 0x0138, 0xc18d, 0x7132, 0x2011,
-	0xad52, 0x2214, 0xd2ac, 0x1120, 0x7030, 0xd08c, 0x0904, 0x59df,
-	0x7130, 0xc185, 0x7132, 0x2011, 0xad52, 0x220c, 0xd1a4, 0x0530,
-	0x0016, 0x2009, 0x0001, 0x2011, 0x0100, 0x080c, 0x663f, 0x2019,
-	0x000e, 0x080c, 0xa8eb, 0x0156, 0x20a9, 0x007f, 0x2009, 0x0000,
-	0xa186, 0x007e, 0x0170, 0xa186, 0x0080, 0x0158, 0x080c, 0x4cdc,
-	0x1140, 0x8127, 0xa006, 0x0016, 0x2009, 0x000e, 0x080c, 0xa96c,
-	0x001e, 0x8108, 0x1f04, 0x59b0, 0x015e, 0x001e, 0xd1ac, 0x1148,
-	0x0016, 0x2009, 0x0000, 0x2019, 0x0004, 0x080c, 0x2aac, 0x001e,
-	0x0070, 0x0156, 0x20a9, 0x007f, 0x2009, 0x0000, 0x080c, 0x4cdc,
-	0x1110, 0x080c, 0x493a, 0x8108, 0x1f04, 0x59d6, 0x015e, 0x2011,
-	0x0003, 0x080c, 0x7adf, 0x2011, 0x0002, 0x080c, 0x7ae9, 0x080c,
-	0x79e1, 0x080c, 0x6581, 0x0036, 0x2019, 0x0000, 0x080c, 0x7a64,
-	0x003e, 0x60e3, 0x0000, 0x2001, 0xad00, 0x2003, 0x0001, 0x080c,
-	0x569a, 0x00ee, 0x00ce, 0x004e, 0x003e, 0x002e, 0x001e, 0x015e,
-	0x0005, 0x2071, 0xade1, 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, 0xade1, 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, 0xade1, 0x7004, 0x0043, 0x700c, 0x0002, 0x5a5b, 0x5a52,
-	0x5a52, 0x5a52, 0x5a52, 0x0005, 0x5ab1, 0x5ab2, 0x5ae4, 0x5ae5,
-	0x5aaf, 0x5b33, 0x5b38, 0x5b69, 0x5b6a, 0x5b85, 0x5b86, 0x5b87,
-	0x5b88, 0x5b89, 0x5b8a, 0x5c40, 0x5c67, 0x700c, 0x0002, 0x5a74,
-	0x5aaf, 0x5aaf, 0x5ab0, 0x5ab0, 0x7830, 0x7930, 0xa106, 0x0120,
-	0x7830, 0x7930, 0xa106, 0x1510, 0x7030, 0xa10a, 0x01f8, 0x1210,
-	0x712c, 0xa10a, 0xa18a, 0x0002, 0x12d0, 0x080c, 0x15c0, 0x01b0,
-	0x2d00, 0x705a, 0x7063, 0x0040, 0x2001, 0x0003, 0x7057, 0x0000,
-	0x0126, 0x0006, 0x2091, 0x8000, 0x2009, 0xafec, 0x2104, 0xc085,
-	0x200a, 0x000e, 0x700e, 0x012e, 0x080c, 0x163c, 0x0005, 0x080c,
-	0x15c0, 0x0de0, 0x2d00, 0x705a, 0x080c, 0x15c0, 0x1108, 0x0c10,
-	0x2d00, 0x7086, 0x7063, 0x0080, 0x2001, 0x0004, 0x08f8, 0x0005,
-	0x0005, 0x0005, 0x700c, 0x0002, 0x5ab9, 0x5abc, 0x5aca, 0x5ae3,
-	0x5ae3, 0x080c, 0x5a6d, 0x0005, 0x0126, 0x8001, 0x700e, 0x7058,
-	0x0006, 0x080c, 0x5f90, 0x0120, 0x2091, 0x8000, 0x080c, 0x5a6d,
-	0x00de, 0x0048, 0x0126, 0x8001, 0x700e, 0x080c, 0x5f90, 0x7058,
-	0x2068, 0x7084, 0x705a, 0x6803, 0x0000, 0x6807, 0x0000, 0x6834,
-	0xa084, 0x00ff, 0xa08a, 0x003a, 0x1218, 0x00db, 0x012e, 0x0005,
-	0x012e, 0x080c, 0x5b8b, 0x0005, 0x0005, 0x0005, 0x00e6, 0x2071,
-	0xade1, 0x700c, 0x0002, 0x5af0, 0x5af0, 0x5af0, 0x5af2, 0x5af5,
-	0x00ee, 0x0005, 0x700f, 0x0001, 0x0010, 0x700f, 0x0002, 0x00ee,
-	0x0005, 0x5b8b, 0x5b8b, 0x5ba7, 0x5b8b, 0x5d22, 0x5b8b, 0x5b8b,
-	0x5b8b, 0x5b8b, 0x5b8b, 0x5ba7, 0x5d64, 0x5da7, 0x5df0, 0x5e04,
-	0x5b8b, 0x5b8b, 0x5bc3, 0x5ba7, 0x5b8b, 0x5b8b, 0x5c1d, 0x5ead,
-	0x5ec8, 0x5b8b, 0x5bc3, 0x5b8b, 0x5b8b, 0x5b8b, 0x5b8b, 0x5c13,
-	0x5ec8, 0x5b8b, 0x5b8b, 0x5b8b, 0x5b8b, 0x5b8b, 0x5b8b, 0x5b8b,
-	0x5b8b, 0x5b8b, 0x5bd7, 0x5b8b, 0x5b8b, 0x5b8b, 0x5b8b, 0x5b8b,
-	0x5b8b, 0x5b8b, 0x5b8b, 0x5b8b, 0x5b8b, 0x5b8b, 0x5b8b, 0x5b8b,
-	0x5b8b, 0x5b8b, 0x5bec, 0x7020, 0x2068, 0x080c, 0x15f0, 0x0005,
-	0x700c, 0x0002, 0x5b3f, 0x5b42, 0x5b50, 0x5b68, 0x5b68, 0x080c,
-	0x5a6d, 0x0005, 0x0126, 0x8001, 0x700e, 0x7058, 0x0006, 0x080c,
-	0x5f90, 0x0120, 0x2091, 0x8000, 0x080c, 0x5a6d, 0x00de, 0x0048,
-	0x0126, 0x8001, 0x700e, 0x080c, 0x5f90, 0x7058, 0x2068, 0x7084,
-	0x705a, 0x6803, 0x0000, 0x6807, 0x0000, 0x6834, 0xa084, 0x00ff,
-	0xa08a, 0x001a, 0x1218, 0x003b, 0x012e, 0x0005, 0x012e, 0x0419,
-	0x0005, 0x0005, 0x0005, 0x5b8b, 0x5ba7, 0x5d0e, 0x5b8b, 0x5ba7,
-	0x5b8b, 0x5ba7, 0x5ba7, 0x5b8b, 0x5ba7, 0x5d0e, 0x5ba7, 0x5ba7,
-	0x5ba7, 0x5ba7, 0x5ba7, 0x5b8b, 0x5ba7, 0x5d0e, 0x5b8b, 0x5b8b,
-	0x5ba7, 0x5b8b, 0x5b8b, 0x5b8b, 0x5ba7, 0x0005, 0x0005, 0x0005,
-	0x0005, 0x0005, 0x0005, 0x7007, 0x0001, 0x6838, 0xa084, 0x00ff,
-	0xc0d5, 0x683a, 0x0126, 0x2091, 0x8000, 0x080c, 0x510c, 0x012e,
-	0x0005, 0x7007, 0x0001, 0x6838, 0xa084, 0x00ff, 0xc0e5, 0x683a,
-	0x0126, 0x2091, 0x8000, 0x080c, 0x510c, 0x012e, 0x0005, 0x7007,
-	0x0001, 0x6838, 0xa084, 0x00ff, 0xc0ed, 0x683a, 0x0126, 0x2091,
-	0x8000, 0x080c, 0x510c, 0x012e, 0x0005, 0x7007, 0x0001, 0x6838,
-	0xa084, 0x00ff, 0xc0dd, 0x683a, 0x0126, 0x2091, 0x8000, 0x080c,
-	0x510c, 0x012e, 0x0005, 0x6834, 0x8007, 0xa084, 0x00ff, 0x0988,
-	0x8001, 0x1120, 0x7007, 0x0001, 0x0804, 0x5cd0, 0x7007, 0x0006,
-	0x7012, 0x2d00, 0x7016, 0x701a, 0x704b, 0x5cd0, 0x0005, 0x6834,
-	0x8007, 0xa084, 0x00ff, 0x0904, 0x5b99, 0x8001, 0x1120, 0x7007,
-	0x0001, 0x0804, 0x5ced, 0x7007, 0x0006, 0x7012, 0x2d00, 0x7016,
-	0x701a, 0x704b, 0x5ced, 0x0005, 0x6834, 0x8007, 0xa084, 0x00ff,
-	0xa086, 0x0001, 0x1904, 0x5b99, 0x7007, 0x0001, 0x2009, 0xad30,
-	0x210c, 0x81ff, 0x11a8, 0x6838, 0xa084, 0x00ff, 0x683a, 0x6853,
-	0x0000, 0x080c, 0x4ab1, 0x1108, 0x0005, 0x0126, 0x2091, 0x8000,
-	0x6837, 0x0139, 0x684a, 0x6952, 0x080c, 0x510c, 0x012e, 0x0ca0,
-	0x2001, 0x0028, 0x0c90, 0x684c, 0xa084, 0x00c0, 0xa086, 0x00c0,
-	0x1120, 0x7007, 0x0001, 0x0804, 0x5ee0, 0x2d00, 0x7016, 0x701a,
-	0x20a9, 0x0004, 0xa080, 0x0024, 0x2098, 0x20a1, 0xae0c, 0x53a3,
-	0x6858, 0x7012, 0xa082, 0x0401, 0x1a04, 0x5bb5, 0x6a84, 0xa28a,
-	0x0002, 0x1a04, 0x5bb5, 0x82ff, 0x1138, 0x6888, 0x698c, 0xa105,
-	0x0118, 0x2001, 0x5ca3, 0x0018, 0xa280, 0x5c99, 0x2005, 0x70c6,
-	0x7010, 0xa015, 0x0904, 0x5c85, 0x080c, 0x15c0, 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, 0x1624, 0x7090,
-	0xa08e, 0x0100, 0x0170, 0xa086, 0x0200, 0x0118, 0x7007, 0x0010,
-	0x0005, 0x7020, 0x2068, 0x080c, 0x15f0, 0x7014, 0x2068, 0x0804,
-	0x5bb5, 0x7020, 0x2068, 0x7018, 0x6802, 0x6807, 0x0000, 0x2d08,
-	0x2068, 0x6906, 0x711a, 0x0804, 0x5c40, 0x7014, 0x2068, 0x7007,
-	0x0001, 0x6884, 0xa005, 0x1128, 0x6888, 0x698c, 0xa105, 0x0108,
-	0x00b1, 0x6834, 0xa084, 0x00ff, 0xa086, 0x001e, 0x0904, 0x5ee0,
-	0x04b8, 0x5c9b, 0x5c9f, 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, 0xad30, 0x210c, 0x81ff, 0x1198, 0x6838, 0xa084, 0x00ff,
-	0x683a, 0x080c, 0x4993, 0x1108, 0x0005, 0x080c, 0x51df, 0x0126,
-	0x2091, 0x8000, 0x080c, 0x97fd, 0x080c, 0x510c, 0x012e, 0x0ca0,
-	0x2001, 0x0028, 0x2009, 0x0000, 0x0c80, 0x2009, 0xad30, 0x210c,
-	0x81ff, 0x11b0, 0x6858, 0xa005, 0x01b0, 0x6838, 0xa084, 0x00ff,
-	0x683a, 0x6853, 0x0000, 0x080c, 0x4a55, 0x1108, 0x0005, 0x0126,
-	0x2091, 0x8000, 0x080c, 0x51df, 0x080c, 0x510c, 0x012e, 0x0cb0,
-	0x2001, 0x0028, 0x0ca0, 0x2001, 0x0000, 0x0c88, 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, 0x4cdc, 0x11b8,
-	0x0066, 0x6e50, 0x080c, 0x4dcf, 0x006e, 0x0088, 0x0046, 0x2011,
-	0xad0c, 0x2224, 0xc484, 0x2412, 0x004e, 0x00c6, 0x080c, 0x4cdc,
-	0x1110, 0x080c, 0x4f2d, 0x8108, 0x1f04, 0x5d4e, 0x00ce, 0x684c,
-	0xd084, 0x1118, 0x080c, 0x15f0, 0x0005, 0x0126, 0x2091, 0x8000,
-	0x080c, 0x510c, 0x012e, 0x0005, 0x0126, 0x2091, 0x8000, 0x7007,
-	0x0001, 0x2001, 0xad52, 0x2004, 0xd0a4, 0x0580, 0x2061, 0xb048,
-	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, 0x5f7f, 0x012e, 0x0804,
-	0x5f79, 0x012e, 0x0804, 0x5f73, 0x012e, 0x0804, 0x5f76, 0x0126,
-	0x2091, 0x8000, 0x7007, 0x0001, 0x2001, 0xad52, 0x2004, 0xd0a4,
-	0x05e0, 0x2061, 0xb048, 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, 0x5f7f, 0x012e, 0x0804, 0x5f7c, 0x012e, 0x0804, 0x5f79,
-	0x0126, 0x2091, 0x8000, 0x7007, 0x0001, 0x2061, 0xb048, 0x6300,
-	0xd38c, 0x1120, 0x6308, 0x8318, 0x0220, 0x630a, 0x012e, 0x0804,
-	0x5f8d, 0x012e, 0x0804, 0x5f7c, 0x0126, 0x00c6, 0x2091, 0x8000,
-	0x7007, 0x0001, 0x684c, 0xd0ac, 0x0148, 0x00c6, 0x2061, 0xb048,
-	0x6000, 0xa084, 0xfcff, 0x6002, 0x00ce, 0x0448, 0x6858, 0xa005,
-	0x05d0, 0x685c, 0xa065, 0x0598, 0x2001, 0xad30, 0x2004, 0xa005,
-	0x0118, 0x080c, 0x974e, 0x0068, 0x6013, 0x0400, 0x6057, 0x0000,
-	0x694c, 0xd1a4, 0x0110, 0x6950, 0x6156, 0x2009, 0x0041, 0x080c,
-	0x80a7, 0x6958, 0xa18c, 0xff00, 0xa186, 0x2000, 0x1140, 0x0026,
-	0x2009, 0x0000, 0x2011, 0xfdff, 0x080c, 0x663f, 0x002e, 0x684c,
-	0xd0c4, 0x0148, 0x2061, 0xb048, 0x6000, 0xd08c, 0x1120, 0x6008,
-	0x8000, 0x0208, 0x600a, 0x00ce, 0x012e, 0x0804, 0x5f7f, 0x00ce,
-	0x012e, 0x0804, 0x5f79, 0x6954, 0xa186, 0x002e, 0x0d40, 0xa186,
-	0x002d, 0x0d28, 0xa186, 0x0045, 0x0510, 0xa186, 0x002a, 0x1130,
-	0x2001, 0xad0c, 0x200c, 0xc194, 0x2102, 0x08c8, 0xa186, 0x0020,
-	0x0170, 0xa186, 0x0029, 0x1d18, 0x6944, 0xa18c, 0xff00, 0x810f,
-	0x080c, 0x4cdc, 0x1960, 0x6000, 0xc0e4, 0x6002, 0x0840, 0x685c,
-	0xa065, 0x09a8, 0x2001, 0xafa3, 0x2004, 0x6016, 0x0800, 0x685c,
-	0xa065, 0x0968, 0x00e6, 0x6860, 0xa075, 0x2001, 0xad30, 0x2004,
-	0xa005, 0x0150, 0x080c, 0x974e, 0x8eff, 0x0118, 0x2e60, 0x080c,
-	0x974e, 0x00ee, 0x0804, 0x5e3f, 0x6020, 0xc0dc, 0xc0d5, 0x6022,
-	0x2e60, 0x6007, 0x003a, 0x6870, 0xa005, 0x0130, 0x6007, 0x003b,
-	0x6874, 0x602a, 0x6878, 0x6012, 0x6003, 0x0001, 0x080c, 0x67a8,
-	0x080c, 0x6c50, 0x00ee, 0x0804, 0x5e3f, 0x2061, 0xb048, 0x6000,
-	0xd084, 0x0190, 0xd08c, 0x1904, 0x5f8d, 0x0126, 0x2091, 0x8000,
-	0x6204, 0x8210, 0x0220, 0x6206, 0x012e, 0x0804, 0x5f8d, 0x012e,
-	0x6853, 0x0016, 0x0804, 0x5f86, 0x6853, 0x0007, 0x0804, 0x5f86,
-	0x6834, 0x8007, 0xa084, 0x00ff, 0x1118, 0x080c, 0x5b99, 0x0078,
-	0x2030, 0x8001, 0x1120, 0x7007, 0x0001, 0x0051, 0x0040, 0x7007,
-	0x0006, 0x7012, 0x2d00, 0x7016, 0x701a, 0x704b, 0x5ee0, 0x0005,
-	0x00e6, 0x0126, 0x2091, 0x8000, 0x2009, 0xad30, 0x210c, 0x81ff,
-	0x1904, 0x5f5b, 0x2009, 0xad0c, 0x210c, 0xd194, 0x1904, 0x5f63,
-	0x6848, 0x2070, 0xae82, 0xb400, 0x0a04, 0x5f4f, 0x2001, 0xad16,
-	0x2004, 0xae02, 0x1a04, 0x5f4f, 0x2061, 0xb048, 0x6100, 0xa184,
-	0x0301, 0xa086, 0x0001, 0x15a8, 0x711c, 0xa186, 0x0006, 0x15b0,
-	0x7018, 0xa005, 0x0904, 0x5f5b, 0x2004, 0xd0e4, 0x1904, 0x5f5e,
-	0x7020, 0xd0dc, 0x1904, 0x5f66, 0x6853, 0x0000, 0x6803, 0x0000,
-	0x2d08, 0x7010, 0xa005, 0x1158, 0x7112, 0x684c, 0xd0f4, 0x1904,
-	0x5f69, 0x2e60, 0x080c, 0x65aa, 0x012e, 0x00ee, 0x0005, 0x2068,
-	0x6800, 0xa005, 0x1de0, 0x6902, 0x2168, 0x684c, 0xd0f4, 0x15c8,
-	0x012e, 0x00ee, 0x0005, 0x012e, 0x00ee, 0x6853, 0x0006, 0x0804,
-	0x5f86, 0xd184, 0x0dc0, 0xd1c4, 0x11a8, 0x00b8, 0x6944, 0xa18c,
-	0xff00, 0x810f, 0x080c, 0x4cdc, 0x11c8, 0x6000, 0xd0e4, 0x11b0,
-	0x711c, 0xa186, 0x0007, 0x1118, 0x6853, 0x0002, 0x0088, 0x6853,
-	0x0008, 0x0070, 0x6853, 0x000e, 0x0058, 0x6853, 0x0017, 0x0040,
-	0x6853, 0x0035, 0x0028, 0x6853, 0x0028, 0x0010, 0x6853, 0x0029,
-	0x012e, 0x00ee, 0x0418, 0x6853, 0x002a, 0x0cd0, 0x6853, 0x0045,
-	0x0cb8, 0x2e60, 0x2019, 0x0002, 0x6017, 0x0014, 0x080c, 0xa566,
-	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, 0x510c, 0x012e, 0x0005, 0x080c, 0x15f0, 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, 0x65a1, 0x00de, 0x0005, 0x00d6, 0x2011,
-	0x0004, 0x2204, 0xa085, 0x8002, 0x2012, 0x00de, 0x0005, 0x20e1,
-	0x0002, 0x3d08, 0x20e1, 0x2000, 0x3d00, 0xa084, 0x7000, 0x0118,
-	0xa086, 0x1000, 0x1540, 0x20e1, 0x0000, 0x3d00, 0xa094, 0xff00,
-	0x8217, 0xa084, 0xf000, 0xa086, 0x3000, 0x1118, 0x080c, 0x61c6,
-	0x00b0, 0x20e1, 0x0004, 0x3d60, 0xd1bc, 0x1108, 0x3e60, 0xac84,
-	0x0007, 0x1188, 0xac82, 0xb400, 0x0270, 0x6858, 0xac02, 0x1258,
-	0x6120, 0xd1f4, 0x1160, 0x2009, 0x0047, 0x080c, 0x80a7, 0x7a1c,
-	0xd284, 0x1968, 0x0005, 0xa016, 0x080c, 0x1824, 0x0cc0, 0x0cd8,
-	0x781c, 0xd08c, 0x0500, 0x0156, 0x0136, 0x0146, 0x20e1, 0x3000,
-	0x3d20, 0x3e28, 0xa584, 0x0076, 0x1530, 0xa484, 0x7000, 0xa086,
-	0x1000, 0x11a8, 0x080c, 0x604e, 0x01f0, 0x20e1, 0x3000, 0x7828,
-	0x7828, 0x080c, 0x606a, 0x014e, 0x013e, 0x015e, 0x2009, 0xafcf,
-	0x2104, 0xa005, 0x1108, 0x0005, 0x080c, 0x6c50, 0x0ce0, 0xa484,
-	0x7000, 0x1518, 0x0499, 0x01b8, 0x7000, 0xa084, 0xff00, 0xa086,
-	0x8100, 0x0d18, 0x0080, 0xd5a4, 0x0158, 0x080c, 0x1d86, 0x20e1,
-	0x9010, 0x2001, 0x0160, 0x2502, 0x2001, 0x0138, 0x2202, 0x0048,
-	0x00e9, 0x6883, 0x0000, 0x080c, 0xac59, 0x20e1, 0x3000, 0x7828,
-	0x7828, 0x014e, 0x013e, 0x015e, 0x08b0, 0x0081, 0x1130, 0x7000,
-	0xa084, 0xff00, 0xa086, 0x8100, 0x1d70, 0x080c, 0xac59, 0x20e1,
-	0x3000, 0x7828, 0x7828, 0x080c, 0x642d, 0x0c58, 0xa484, 0x01ff,
-	0x6882, 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, 0x62cf, 0x0005, 0xa196, 0x2000,
-	0x1148, 0x6900, 0xa18e, 0x0001, 0x1118, 0x080c, 0x41d1, 0x0ca8,
-	0x0039, 0x0c98, 0xa196, 0x8000, 0x1d80, 0x080c, 0x6372, 0x0c68,
-	0x00c6, 0x6a80, 0x82ff, 0x0904, 0x61c0, 0x7110, 0xa18c, 0xff00,
-	0x810f, 0xa196, 0x0001, 0x0120, 0xa196, 0x0023, 0x1904, 0x61c0,
-	0xa08e, 0x0023, 0x1570, 0x080c, 0x6408, 0x0904, 0x61c0, 0x7124,
-	0x610a, 0x7030, 0xa08e, 0x0200, 0x1150, 0x7034, 0xa005, 0x1904,
-	0x61c0, 0x2009, 0x0015, 0x080c, 0x80a7, 0x0804, 0x61c0, 0xa08e,
-	0x0214, 0x0118, 0xa08e, 0x0210, 0x1130, 0x2009, 0x0015, 0x080c,
-	0x80a7, 0x0804, 0x61c0, 0xa08e, 0x0100, 0x1904, 0x61c0, 0x7034,
-	0xa005, 0x1904, 0x61c0, 0x2009, 0x0016, 0x080c, 0x80a7, 0x0804,
-	0x61c0, 0xa08e, 0x0022, 0x1904, 0x61c0, 0x7030, 0xa08e, 0x0300,
-	0x1580, 0x68d0, 0xd0a4, 0x0528, 0xc0b5, 0x68d2, 0x7100, 0xa18c,
-	0x00ff, 0x696e, 0x7004, 0x6872, 0x00f6, 0x2079, 0x0100, 0x79e6,
-	0x78ea, 0x0006, 0xa084, 0x00ff, 0x0016, 0x2008, 0x080c, 0x26a0,
-	0x7932, 0x7936, 0x001e, 0x000e, 0x00fe, 0x080c, 0x2676, 0x694e,
-	0x703c, 0x00e6, 0x2071, 0x0140, 0x7086, 0x2071, 0xad00, 0x70a2,
-	0x00ee, 0x7034, 0xa005, 0x1904, 0x61c0, 0x2009, 0x0017, 0x0804,
-	0x6193, 0xa08e, 0x0400, 0x1158, 0x7034, 0xa005, 0x1904, 0x61c0,
-	0x68d0, 0xc0a5, 0x68d2, 0x2009, 0x0030, 0x0804, 0x6193, 0xa08e,
-	0x0500, 0x1140, 0x7034, 0xa005, 0x1904, 0x61c0, 0x2009, 0x0018,
-	0x0804, 0x6193, 0xa08e, 0x2010, 0x1120, 0x2009, 0x0019, 0x0804,
-	0x6193, 0xa08e, 0x2110, 0x1120, 0x2009, 0x001a, 0x0804, 0x6193,
-	0xa08e, 0x5200, 0x1140, 0x7034, 0xa005, 0x1904, 0x61c0, 0x2009,
-	0x001b, 0x0804, 0x6193, 0xa08e, 0x5000, 0x1140, 0x7034, 0xa005,
-	0x1904, 0x61c0, 0x2009, 0x001c, 0x0804, 0x6193, 0xa08e, 0x1300,
-	0x1120, 0x2009, 0x0034, 0x0804, 0x6193, 0xa08e, 0x1200, 0x1140,
-	0x7034, 0xa005, 0x1904, 0x61c0, 0x2009, 0x0024, 0x0804, 0x6193,
-	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, 0xb28d, 0x8208,
-	0x2204, 0xa082, 0x0004, 0x20a8, 0x95ac, 0x95ac, 0x2011, 0x8015,
-	0x211c, 0x8108, 0x0046, 0x2124, 0x080c, 0x3c5c, 0x004e, 0x8108,
-	0x1f04, 0x6176, 0x2009, 0x0023, 0x0070, 0xa08e, 0x6000, 0x1118,
-	0x2009, 0x003f, 0x0040, 0xa08e, 0x7800, 0x1118, 0x2009, 0x0045,
-	0x0010, 0x2009, 0x001d, 0x0016, 0x2011, 0xb283, 0x2204, 0x8211,
-	0x220c, 0x080c, 0x2676, 0x1530, 0x080c, 0x4c80, 0x1518, 0x6612,
-	0x6516, 0x86ff, 0x0180, 0x001e, 0x0016, 0xa186, 0x0017, 0x1158,
-	0x686c, 0xa606, 0x1140, 0x6870, 0xa506, 0xa084, 0xff00, 0x1118,
-	0x6000, 0xc0f5, 0x6002, 0x00c6, 0x080c, 0x8022, 0x0168, 0x001e,
-	0x611a, 0x601f, 0x0004, 0x7120, 0x610a, 0x001e, 0x080c, 0x80a7,
-	0x00ce, 0x0005, 0x001e, 0x0ce0, 0x00ce, 0x0ce0, 0x00c6, 0x0046,
-	0x080c, 0x6221, 0x1904, 0x621e, 0xa184, 0xff00, 0x8007, 0xa086,
-	0x0008, 0x1904, 0x621e, 0xa28e, 0x0033, 0x11e8, 0x080c, 0x6408,
-	0x0904, 0x621e, 0x7124, 0x610a, 0x7030, 0xa08e, 0x0200, 0x1140,
-	0x7034, 0xa005, 0x15d8, 0x2009, 0x0015, 0x080c, 0x80a7, 0x04b0,
-	0xa08e, 0x0100, 0x1598, 0x7034, 0xa005, 0x1580, 0x2009, 0x0016,
-	0x080c, 0x80a7, 0x0458, 0xa28e, 0x0032, 0x1540, 0x7030, 0xa08e,
-	0x1400, 0x1520, 0x2009, 0x0038, 0x0016, 0x2011, 0xb283, 0x2204,
-	0x8211, 0x220c, 0x080c, 0x2676, 0x11c0, 0x080c, 0x4c80, 0x11a8,
-	0x6612, 0x6516, 0x00c6, 0x080c, 0x8022, 0x0170, 0x001e, 0x611a,
-	0x080c, 0x9956, 0x601f, 0x0004, 0x7120, 0x610a, 0x001e, 0x080c,
-	0x80a7, 0x080c, 0x6c50, 0x0010, 0x00ce, 0x001e, 0x004e, 0x00ce,
-	0x0005, 0x00f6, 0x00d6, 0x0026, 0x0016, 0x0136, 0x0146, 0x0156,
-	0x3c00, 0x0006, 0x2079, 0x0030, 0x2069, 0x0200, 0x080c, 0x1df2,
-	0x1590, 0x080c, 0x1ce2, 0x05c8, 0x04d9, 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, 0x0401,
-	0x1120, 0xa08a, 0x0140, 0x1a0c, 0x14f6, 0x80ac, 0x20e1, 0x6000,
-	0x2099, 0x020a, 0x53a5, 0x20e1, 0x7000, 0x6828, 0x6828, 0x7803,
-	0x0004, 0xa294, 0x0070, 0x000e, 0x20e0, 0x015e, 0x014e, 0x013e,
-	0x001e, 0x002e, 0x00de, 0x00fe, 0x0005, 0xa085, 0x0001, 0x0c98,
-	0x0006, 0x2001, 0x0111, 0x2004, 0xa084, 0x0003, 0x000e, 0x0005,
-	0x0046, 0x00e6, 0x00d6, 0x2028, 0x2130, 0xa696, 0x00ff, 0x1198,
-	0xa596, 0xfffd, 0x1120, 0x2009, 0x007f, 0x0804, 0x62ca, 0xa596,
-	0xfffe, 0x1118, 0x2009, 0x007e, 0x04e8, 0xa596, 0xfffc, 0x1118,
-	0x2009, 0x0080, 0x04b8, 0x2011, 0x0000, 0x2019, 0xad34, 0x231c,
-	0xd3ac, 0x0138, 0x2021, 0x0000, 0x20a9, 0x00ff, 0x2071, 0xae34,
-	0x0030, 0x2021, 0x0081, 0x20a9, 0x007e, 0x2071, 0xaeb5, 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, 0x62a7, 0x82ff, 0x1118, 0xa085, 0x0001, 0x0018,
-	0xc2fc, 0x2208, 0xa006, 0x00de, 0x00ee, 0x004e, 0x0005, 0xa084,
-	0x0007, 0x000a, 0x0005, 0x62db, 0x62db, 0x62db, 0x641a, 0x62db,
-	0x62dc, 0x62f1, 0x635d, 0x0005, 0x7110, 0xd1bc, 0x0188, 0x7120,
-	0x2160, 0xac8c, 0x0007, 0x1160, 0xac8a, 0xb400, 0x0248, 0x6858,
-	0xac02, 0x1230, 0x7124, 0x610a, 0x2009, 0x0046, 0x080c, 0x80a7,
-	0x0005, 0x00c6, 0x7110, 0xd1bc, 0x1904, 0x6344, 0x2011, 0xb283,
-	0x2204, 0x8211, 0x220c, 0x080c, 0x2676, 0x1904, 0x6344, 0x080c,
-	0x4c80, 0x1904, 0x6344, 0x6612, 0x6516, 0x6000, 0xd0ec, 0x15e0,
-	0x6204, 0xa294, 0xff00, 0x8217, 0xa286, 0x0006, 0x0160, 0x080c,
-	0x574f, 0x11d0, 0x6204, 0xa294, 0x00ff, 0xa286, 0x0006, 0x11a0,
-	0xa295, 0x0600, 0x6206, 0x00c6, 0x080c, 0x8022, 0x001e, 0x0530,
-	0x611a, 0x601f, 0x0006, 0x7120, 0x610a, 0x7130, 0x6152, 0x2009,
-	0x0044, 0x080c, 0x80a7, 0x00c0, 0x00c6, 0x080c, 0x8022, 0x001e,
-	0x0198, 0x611a, 0x601f, 0x0004, 0x7120, 0x610a, 0xa286, 0x0004,
-	0x1118, 0x6007, 0x0005, 0x0010, 0x6007, 0x0001, 0x6003, 0x0001,
-	0x080c, 0x67ee, 0x080c, 0x6c50, 0x00ce, 0x0005, 0x00c6, 0x080c,
-	0x9807, 0x001e, 0x0dc8, 0x611a, 0x601f, 0x0006, 0x7120, 0x610a,
-	0x7130, 0x6152, 0x6013, 0x0300, 0x6003, 0x0001, 0x6007, 0x0041,
-	0x080c, 0x67a8, 0x080c, 0x6c50, 0x0c38, 0x7110, 0xd1bc, 0x0188,
-	0x7020, 0x2060, 0xac84, 0x0007, 0x1160, 0xac82, 0xb400, 0x0248,
-	0x6858, 0xac02, 0x1230, 0x7124, 0x610a, 0x2009, 0x0045, 0x080c,
-	0x80a7, 0x0005, 0x7110, 0xa18c, 0xff00, 0x810f, 0xa18e, 0x0000,
-	0x1130, 0xa084, 0x000f, 0xa08a, 0x0006, 0x1208, 0x000b, 0x0005,
-	0x6386, 0x6387, 0x6386, 0x6386, 0x63f0, 0x63fc, 0x0005, 0x7110,
-	0xd1bc, 0x0120, 0x702c, 0xd084, 0x0904, 0x63ef, 0x700c, 0x7108,
-	0x080c, 0x2676, 0x1904, 0x63ef, 0x080c, 0x4c80, 0x1904, 0x63ef,
-	0x6612, 0x6516, 0x6204, 0x7110, 0xd1bc, 0x01f8, 0xa28c, 0x00ff,
-	0xa186, 0x0004, 0x0118, 0xa186, 0x0006, 0x15c8, 0x00c6, 0x080c,
-	0x6408, 0x00ce, 0x0904, 0x63ef, 0x00c6, 0x080c, 0x8022, 0x001e,
-	0x05f0, 0x611a, 0x080c, 0x9956, 0x601f, 0x0002, 0x7120, 0x610a,
-	0x2009, 0x0088, 0x080c, 0x80a7, 0x0490, 0xa28c, 0x00ff, 0xa186,
-	0x0006, 0x0160, 0xa186, 0x0004, 0x0148, 0xa294, 0xff00, 0x8217,
-	0xa286, 0x0004, 0x0118, 0xa286, 0x0006, 0x1188, 0x00c6, 0x080c,
-	0x8022, 0x001e, 0x01e0, 0x611a, 0x080c, 0x9956, 0x601f, 0x0005,
-	0x7120, 0x610a, 0x2009, 0x0088, 0x080c, 0x80a7, 0x0080, 0x00c6,
-	0x080c, 0x8022, 0x001e, 0x0158, 0x611a, 0x080c, 0x9956, 0x601f,
-	0x0004, 0x7120, 0x610a, 0x2009, 0x0001, 0x080c, 0x80a7, 0x0005,
-	0x7110, 0xd1bc, 0x0140, 0x00a1, 0x0130, 0x7124, 0x610a, 0x2009,
-	0x0089, 0x080c, 0x80a7, 0x0005, 0x7110, 0xd1bc, 0x0140, 0x0041,
-	0x0130, 0x7124, 0x610a, 0x2009, 0x008a, 0x080c, 0x80a7, 0x0005,
-	0x7020, 0x2060, 0xac84, 0x0007, 0x1158, 0xac82, 0xb400, 0x0240,
-	0x2001, 0xad16, 0x2004, 0xac02, 0x1218, 0xa085, 0x0001, 0x0005,
-	0xa006, 0x0ce8, 0x7110, 0xd1bc, 0x1178, 0x7024, 0x2060, 0xac84,
-	0x0007, 0x1150, 0xac82, 0xb400, 0x0238, 0x6858, 0xac02, 0x1220,
-	0x2009, 0x0051, 0x080c, 0x80a7, 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, 0x8022,
-	0x0598, 0x0066, 0x00c6, 0x0046, 0x2011, 0xb283, 0x2204, 0x8211,
-	0x220c, 0x080c, 0x2676, 0x1580, 0x080c, 0x4c80, 0x1568, 0x6612,
-	0x6516, 0x2c00, 0x004e, 0x00ce, 0x601a, 0x080c, 0x9956, 0x080c,
-	0x15d9, 0x01f0, 0x2d00, 0x6056, 0x6803, 0x0000, 0x6837, 0x0000,
-	0x6c3a, 0xadf8, 0x000f, 0x20a9, 0x000e, 0x2fa0, 0x2e98, 0x53a3,
-	0x006e, 0x6612, 0x6007, 0x003e, 0x601f, 0x0001, 0x6003, 0x0001,
-	0x080c, 0x67ee, 0x080c, 0x6c50, 0x00fe, 0x00de, 0x00ce, 0x0005,
-	0x080c, 0x8078, 0x006e, 0x0cc0, 0x004e, 0x00ce, 0x0cc8, 0x2071,
-	0xafda, 0x7003, 0x0003, 0x700f, 0x0361, 0xa006, 0x701a, 0x7012,
-	0x7017, 0xb400, 0x7007, 0x0000, 0x7026, 0x702b, 0x7841, 0x7032,
-	0x7037, 0x789d, 0x703b, 0xffff, 0x703f, 0xffff, 0x7042, 0x7047,
-	0x41b3, 0x0005, 0x2071, 0xafda, 0x1d04, 0x64fc, 0x2091, 0x6000,
-	0x700c, 0x8001, 0x700e, 0x1180, 0x700f, 0x0361, 0x7007, 0x0001,
-	0x0126, 0x2091, 0x8000, 0x7040, 0xa00d, 0x0148, 0x8109, 0x7142,
-	0x1130, 0x7044, 0x080f, 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, 0x0158, 0x702c, 0x8001,
-	0x702e, 0x1138, 0x702f, 0x0009, 0x8109, 0x7132, 0x1110, 0x7034,
-	0x080f, 0x7038, 0xa005, 0x0118, 0x0310, 0x8001, 0x703a, 0x703c,
-	0xa005, 0x0118, 0x0310, 0x8001, 0x703e, 0x7018, 0xa00d, 0x0158,
-	0x7008, 0x8001, 0x700a, 0x1138, 0x700b, 0x0009, 0x8109, 0x711a,
-	0x1110, 0x701c, 0x080f, 0x012e, 0x7004, 0x0002, 0x6522, 0x6523,
-	0x653b, 0x00e6, 0x2071, 0xafda, 0x7018, 0xa005, 0x1120, 0x711a,
-	0x721e, 0x700b, 0x0009, 0x00ee, 0x0005, 0x00e6, 0x0006, 0x2071,
-	0xafda, 0x701c, 0xa206, 0x1110, 0x701a, 0x701e, 0x000e, 0x00ee,
-	0x0005, 0x00e6, 0x2071, 0xafda, 0x6088, 0xa102, 0x0208, 0x618a,
-	0x00ee, 0x0005, 0x0005, 0x7110, 0x080c, 0x4cdc, 0x1158, 0x6088,
-	0x8001, 0x0240, 0x608a, 0x1130, 0x0126, 0x2091, 0x8000, 0x080c,
-	0x6c50, 0x012e, 0x8108, 0xa182, 0x00ff, 0x0218, 0xa00e, 0x7007,
-	0x0002, 0x7112, 0x0005, 0x7014, 0x2060, 0x0126, 0x2091, 0x8000,
-	0x603c, 0xa005, 0x0128, 0x8001, 0x603e, 0x1110, 0x080c, 0x9846,
-	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, 0x9350, 0x012e, 0xac88, 0x0018, 0x7116, 0x2001,
-	0xe400, 0xa102, 0x0220, 0x7017, 0xb400, 0x7007, 0x0000, 0x0005,
-	0x00e6, 0x2071, 0xafda, 0x7027, 0x07d0, 0x7023, 0x0009, 0x00ee,
-	0x0005, 0x2001, 0xafe3, 0x2003, 0x0000, 0x0005, 0x00e6, 0x2071,
-	0xafda, 0x7132, 0x702f, 0x0009, 0x00ee, 0x0005, 0x2011, 0xafe6,
-	0x2013, 0x0000, 0x0005, 0x00e6, 0x2071, 0xafda, 0x711a, 0x721e,
-	0x700b, 0x0009, 0x00ee, 0x0005, 0x00c6, 0x2061, 0xb048, 0x00ce,
-	0x0005, 0xa184, 0x000f, 0x8003, 0x8003, 0x8003, 0xa080, 0xb048,
-	0x2060, 0x0005, 0x6854, 0xa08a, 0x199a, 0x0210, 0x2001, 0x1999,
-	0xa005, 0x1150, 0x00c6, 0x2061, 0xb048, 0x6014, 0x00ce, 0xa005,
-	0x1138, 0x2001, 0x001e, 0x0020, 0xa08e, 0xffff, 0x1108, 0xa006,
-	0x8003, 0x800b, 0x810b, 0xa108, 0x6116, 0x684c, 0xa08c, 0x00c0,
-	0xa18e, 0x00c0, 0x05b0, 0xd0b4, 0x1138, 0xd0bc, 0x1528, 0x2009,
-	0x0006, 0x080c, 0x661a, 0x0005, 0xd0fc, 0x0130, 0xa084, 0x0003,
-	0x0118, 0xa086, 0x0003, 0x15c0, 0x6020, 0xd0d4, 0x0130, 0xc0d4,
-	0x6022, 0x6860, 0x602a, 0x685c, 0x602e, 0x2009, 0xad73, 0x2104,
-	0xd084, 0x0128, 0x2009, 0x0042, 0x080c, 0x80a7, 0x0005, 0x2009,
-	0x0043, 0x080c, 0x80a7, 0x0005, 0xd0fc, 0x0130, 0xa084, 0x0003,
-	0x0118, 0xa086, 0x0003, 0x11c0, 0x2009, 0x0042, 0x080c, 0x80a7,
-	0x0005, 0xd0fc, 0x0150, 0xa084, 0x0003, 0xa08e, 0x0002, 0x0138,
-	0x2009, 0x0041, 0x080c, 0x80a7, 0x0005, 0x0051, 0x0ce8, 0x2009,
-	0x0043, 0x080c, 0x80a7, 0x0cc0, 0x2009, 0x0004, 0x0019, 0x0005,
-	0x2009, 0x0001, 0x00d6, 0x6010, 0xa0ec, 0xf000, 0x01f0, 0x2068,
-	0x6952, 0x6800, 0x6012, 0xa186, 0x0001, 0x1188, 0x694c, 0xa18c,
-	0x8100, 0xa18e, 0x8100, 0x1158, 0x00c6, 0x2061, 0xb048, 0x6200,
-	0xd28c, 0x1120, 0x6204, 0x8210, 0x0208, 0x6206, 0x00ce, 0x080c,
-	0x510c, 0x6010, 0xa06d, 0x190c, 0x65aa, 0x00de, 0x0005, 0x0156,
-	0x00c6, 0x2061, 0xb048, 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, 0x665c, 0x8086, 0x818e, 0x0005, 0x0156, 0x20a9, 0x0010,
-	0xa005, 0x01b8, 0xa11a, 0x12a8, 0x8213, 0x818d, 0x0228, 0xa11a,
-	0x1220, 0x1f04, 0x666c, 0x0028, 0xa11a, 0x2308, 0x8210, 0x1f04,
-	0x666c, 0x0006, 0x3200, 0xa084, 0xefff, 0x2080, 0x000e, 0x015e,
-	0x0005, 0x0006, 0x3200, 0xa085, 0x1000, 0x0cb8, 0x0126, 0x2091,
-	0x2800, 0x2079, 0xafc7, 0x012e, 0x00d6, 0x2069, 0xafc7, 0x6803,
-	0x0005, 0x2069, 0x0004, 0x2d04, 0xa085, 0x8001, 0x206a, 0x00de,
-	0x0005, 0x00c6, 0x6027, 0x0001, 0x7804, 0xa084, 0x0007, 0x0002,
-	0x66aa, 0x66cb, 0x671e, 0x66b0, 0x66cb, 0x66aa, 0x66a8, 0x66a8,
-	0x080c, 0x14f6, 0x080c, 0x6581, 0x080c, 0x6c50, 0x00ce, 0x0005,
-	0x62c0, 0x82ff, 0x1110, 0x00ce, 0x0005, 0x2011, 0x481b, 0x080c,
-	0x650d, 0x7828, 0xa092, 0x00c8, 0x1228, 0x8000, 0x782a, 0x080c,
-	0x4855, 0x0c88, 0x080c, 0x481b, 0x7807, 0x0003, 0x7827, 0x0000,
-	0x782b, 0x0000, 0x0c40, 0x080c, 0x6581, 0x3c00, 0x0006, 0x2011,
-	0x0209, 0x20e1, 0x4000, 0x2214, 0x000e, 0x20e0, 0x82ff, 0x0178,
-	0x62c0, 0x82ff, 0x1160, 0x782b, 0x0000, 0x7824, 0xa065, 0x090c,
-	0x14f6, 0x2009, 0x0013, 0x080c, 0x80a7, 0x00ce, 0x0005, 0x3900,
-	0xa082, 0xb0e8, 0x1210, 0x080c, 0x7d8d, 0x00c6, 0x7824, 0xa065,
-	0x090c, 0x14f6, 0x7804, 0xa086, 0x0004, 0x0904, 0x675e, 0x7828,
-	0xa092, 0x2710, 0x1230, 0x8000, 0x782a, 0x00ce, 0x080c, 0x7827,
-	0x0c20, 0x6104, 0xa186, 0x0003, 0x1188, 0x00e6, 0x2071, 0xad00,
-	0x70dc, 0x00ee, 0xd08c, 0x0150, 0x00c6, 0x00e6, 0x2061, 0x0100,
-	0x2071, 0xad00, 0x080c, 0x485e, 0x00ee, 0x00ce, 0x080c, 0xaca2,
-	0x2009, 0x0014, 0x080c, 0x80a7, 0x00ce, 0x0838, 0x2001, 0xafe3,
-	0x2003, 0x0000, 0x62c0, 0x82ff, 0x1160, 0x782b, 0x0000, 0x7824,
-	0xa065, 0x090c, 0x14f6, 0x2009, 0x0013, 0x080c, 0x80fb, 0x00ce,
-	0x0005, 0x00c6, 0x00d6, 0x3900, 0xa082, 0xb0e8, 0x1210, 0x080c,
-	0x7d8d, 0x7824, 0xa005, 0x090c, 0x14f6, 0x781c, 0xa06d, 0x090c,
-	0x14f6, 0x6800, 0xc0dc, 0x6802, 0x7924, 0x2160, 0x080c, 0x8078,
-	0x693c, 0x81ff, 0x090c, 0x14f6, 0x8109, 0x693e, 0x6854, 0xa015,
-	0x0110, 0x7a1e, 0x0010, 0x7918, 0x791e, 0x7807, 0x0000, 0x7827,
-	0x0000, 0x00de, 0x00ce, 0x080c, 0x6c50, 0x0888, 0x6104, 0xa186,
-	0x0002, 0x0128, 0xa186, 0x0004, 0x0110, 0x0804, 0x66f7, 0x7808,
-	0xac06, 0x0904, 0x66f7, 0x080c, 0x6b73, 0x080c, 0x67ee, 0x00ce,
-	0x080c, 0x6c50, 0x0804, 0x66e5, 0x00c6, 0x6027, 0x0002, 0x62c8,
-	0x60c4, 0xa205, 0x1178, 0x793c, 0xa1e5, 0x0000, 0x0130, 0x2009,
-	0x0049, 0x080c, 0x80a7, 0x00ce, 0x0005, 0x2011, 0xafe6, 0x2013,
-	0x0000, 0x0cc8, 0x3908, 0xa192, 0xb0e8, 0x1210, 0x080c, 0x7d8d,
-	0x793c, 0x81ff, 0x0d90, 0x793c, 0xa188, 0x0007, 0x210c, 0xa18e,
-	0x0006, 0x1138, 0x6014, 0xa084, 0x0184, 0xa085, 0x0012, 0x6016,
-	0x0c10, 0x6014, 0xa084, 0x0184, 0xa085, 0x0016, 0x6016, 0x08d8,
-	0x0006, 0x0016, 0x00c6, 0x0126, 0x2091, 0x8000, 0x600f, 0x0000,
-	0x2c08, 0x2061, 0xafc7, 0x6020, 0x8000, 0x6022, 0x6010, 0xa005,
-	0x0148, 0xa080, 0x0003, 0x2102, 0x6112, 0x012e, 0x00ce, 0x001e,
-	0x000e, 0x0005, 0x6116, 0x6112, 0x0cc0, 0x00d6, 0x2069, 0xafc7,
-	0x6000, 0xd0d4, 0x0168, 0x6820, 0x8000, 0x6822, 0xa086, 0x0001,
-	0x1110, 0x2c00, 0x681e, 0x6804, 0xa084, 0x0007, 0x0804, 0x6c56,
-	0xc0d5, 0x6002, 0x6818, 0xa005, 0x0158, 0x6056, 0x605b, 0x0000,
-	0x0006, 0x2c00, 0x681a, 0x00de, 0x685a, 0x2069, 0xafc7, 0x0c18,
-	0x6056, 0x605a, 0x2c00, 0x681a, 0x681e, 0x08e8, 0x0006, 0x0016,
-	0x00c6, 0x0126, 0x2091, 0x8000, 0x600f, 0x0000, 0x2c08, 0x2061,
-	0xafc7, 0x6020, 0x8000, 0x6022, 0x6008, 0xa005, 0x0148, 0xa080,
-	0x0003, 0x2102, 0x610a, 0x012e, 0x00ce, 0x001e, 0x000e, 0x0005,
-	0x610e, 0x610a, 0x0cc0, 0x00c6, 0x600f, 0x0000, 0x2c08, 0x2061,
-	0xafc7, 0x6034, 0xa005, 0x0130, 0xa080, 0x0003, 0x2102, 0x6136,
-	0x00ce, 0x0005, 0x613a, 0x6136, 0x0cd8, 0x00f6, 0x00e6, 0x00d6,
-	0x00c6, 0x0076, 0x0066, 0x0026, 0x0016, 0x0006, 0x0126, 0x2071,
-	0xafc7, 0x7638, 0x2660, 0x2678, 0x2091, 0x8000, 0x8cff, 0x0904,
-	0x6889, 0x6018, 0xa080, 0x0028, 0x2004, 0xa206, 0x1904, 0x6884,
-	0x87ff, 0x0120, 0x6050, 0xa106, 0x1904, 0x6884, 0x703c, 0xac06,
-	0x1170, 0x0036, 0x2019, 0x0001, 0x080c, 0x7a64, 0x7033, 0x0000,
-	0x703f, 0x0000, 0x7043, 0x0000, 0x7047, 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, 0x080c, 0x9596, 0x0198, 0x6010, 0x2068, 0x601c, 0xa086,
-	0x0003, 0x1510, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x080c,
-	0x97fd, 0x080c, 0xabfa, 0x080c, 0x510c, 0x080c, 0x9742, 0x080c,
-	0x974e, 0x00ce, 0x0804, 0x682e, 0x2c78, 0x600c, 0x2060, 0x0804,
-	0x682e, 0x012e, 0x000e, 0x001e, 0x002e, 0x006e, 0x007e, 0x00ce,
-	0x00de, 0x00ee, 0x00fe, 0x0005, 0x601c, 0xa086, 0x0006, 0x19d0,
-	0x080c, 0xabfa, 0x080c, 0xa91f, 0x0c10, 0x0006, 0x0066, 0x00c6,
-	0x00d6, 0x00f6, 0x2031, 0x0000, 0x0126, 0x2091, 0x8000, 0x2079,
-	0xafc7, 0x7838, 0xa065, 0x0558, 0x600c, 0x0006, 0x600f, 0x0000,
-	0x783c, 0xac06, 0x1170, 0x0036, 0x2019, 0x0001, 0x080c, 0x7a64,
-	0x7833, 0x0000, 0x783f, 0x0000, 0x7843, 0x0000, 0x7847, 0x0000,
-	0x003e, 0x080c, 0x9596, 0x0178, 0x6010, 0x2068, 0x601c, 0xa086,
-	0x0003, 0x11b0, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x080c,
-	0x510c, 0x080c, 0x9742, 0x080c, 0x974e, 0x000e, 0x0898, 0x7e3a,
-	0x7e36, 0x012e, 0x00fe, 0x00de, 0x00ce, 0x006e, 0x000e, 0x0005,
-	0x601c, 0xa086, 0x0006, 0x1d30, 0x080c, 0xa91f, 0x0c60, 0x0016,
-	0x0026, 0x0086, 0x2041, 0x0000, 0x0099, 0x080c, 0x69a9, 0x008e,
-	0x002e, 0x001e, 0x0005, 0x00f6, 0x0126, 0x2079, 0xafc7, 0x2091,
-	0x8000, 0x080c, 0x6a36, 0x080c, 0x6aa8, 0x012e, 0x00fe, 0x0005,
-	0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x0066, 0x0016, 0x0006, 0x0126,
-	0x2091, 0x8000, 0x2071, 0xafc7, 0x7614, 0x2660, 0x2678, 0x8cff,
-	0x0904, 0x6985, 0x6018, 0xa080, 0x0028, 0x2004, 0xa206, 0x1904,
-	0x6980, 0x88ff, 0x0120, 0x6050, 0xa106, 0x1904, 0x6980, 0x7024,
-	0xac06, 0x1538, 0x2069, 0x0100, 0x68c0, 0xa005, 0x01f0, 0x080c,
-	0x6581, 0x080c, 0x7834, 0x68c3, 0x0000, 0x080c, 0x7ca8, 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,
-	0x04b8, 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, 0x9596, 0x0188,
-	0x601c, 0xa086, 0x0003, 0x1510, 0x6837, 0x0103, 0x6b4a, 0x6847,
-	0x0000, 0x080c, 0x97fd, 0x080c, 0xabfa, 0x080c, 0x510c, 0x080c,
-	0x9742, 0x080c, 0x974e, 0x080c, 0x7b88, 0x00ce, 0x0804, 0x690f,
-	0x2c78, 0x600c, 0x2060, 0x0804, 0x690f, 0x012e, 0x000e, 0x001e,
-	0x006e, 0x00ce, 0x00de, 0x00ee, 0x00fe, 0x0005, 0x601c, 0xa086,
-	0x0006, 0x1128, 0x080c, 0xabfa, 0x080c, 0xa91f, 0x0c10, 0x601c,
-	0xa086, 0x0002, 0x1128, 0x6004, 0xa086, 0x0085, 0x0968, 0x08c8,
-	0x601c, 0xa086, 0x0005, 0x19a8, 0x6004, 0xa086, 0x0085, 0x0d50,
-	0x0880, 0x00c6, 0x0006, 0x0126, 0x2091, 0x8000, 0xa280, 0xae34,
-	0x2004, 0xa065, 0x0904, 0x6a32, 0x00f6, 0x00e6, 0x00d6, 0x0066,
-	0x2071, 0xafc7, 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, 0x4c07, 0x0904, 0x6a2e, 0x7624, 0x86ff, 0x05e8,
-	0xa680, 0x0004, 0x2004, 0xad06, 0x15c0, 0x00d6, 0x2069, 0x0100,
-	0x68c0, 0xa005, 0x0548, 0x080c, 0x6581, 0x080c, 0x7834, 0x68c3,
-	0x0000, 0x080c, 0x7ca8, 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, 0x974e, 0x00ce, 0x0048, 0x00de, 0x00c6, 0x2660, 0x6003,
-	0x0009, 0x630a, 0x00ce, 0x0804, 0x69d9, 0x8dff, 0x0158, 0x6837,
-	0x0103, 0x6b4a, 0x6847, 0x0000, 0x080c, 0x97fd, 0x080c, 0xabfa,
-	0x080c, 0x510c, 0x080c, 0x7b88, 0x0804, 0x69d9, 0x006e, 0x00de,
-	0x00ee, 0x00fe, 0x012e, 0x000e, 0x00ce, 0x0005, 0x0006, 0x0066,
-	0x00c6, 0x00d6, 0x2031, 0x0000, 0x7814, 0xa065, 0x0904, 0x6a88,
-	0x600c, 0x0006, 0x600f, 0x0000, 0x7824, 0xac06, 0x1540, 0x2069,
-	0x0100, 0x68c0, 0xa005, 0x01f0, 0x080c, 0x6581, 0x080c, 0x7834,
-	0x68c3, 0x0000, 0x080c, 0x7ca8, 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, 0x9596, 0x0168, 0x601c, 0xa086, 0x0003, 0x11b8,
-	0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x080c, 0x510c, 0x080c,
-	0x9742, 0x080c, 0x974e, 0x080c, 0x7b88, 0x000e, 0x0804, 0x6a3d,
-	0x7e16, 0x7e12, 0x00de, 0x00ce, 0x006e, 0x000e, 0x0005, 0x601c,
-	0xa086, 0x0006, 0x1118, 0x080c, 0xa91f, 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, 0x6b0e,
-	0x6054, 0x0006, 0x6057, 0x0000, 0x605b, 0x0000, 0x6000, 0xc0d4,
-	0xc0dc, 0x6002, 0x080c, 0x4c07, 0x0904, 0x6b0b, 0x7e24, 0x86ff,
-	0x05e8, 0xa680, 0x0004, 0x2004, 0xad06, 0x15c0, 0x00d6, 0x2069,
-	0x0100, 0x68c0, 0xa005, 0x0548, 0x080c, 0x6581, 0x080c, 0x7834,
-	0x68c3, 0x0000, 0x080c, 0x7ca8, 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, 0x974e, 0x00ce, 0x0048, 0x00de, 0x00c6, 0x2660,
-	0x6003, 0x0009, 0x630a, 0x00ce, 0x0804, 0x6aba, 0x8dff, 0x0138,
-	0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x080c, 0x510c, 0x080c,
-	0x7b88, 0x0804, 0x6aba, 0x000e, 0x0804, 0x6aad, 0x781e, 0x781a,
-	0x00de, 0x00ce, 0x006e, 0x000e, 0x0005, 0x00e6, 0x00d6, 0x0066,
-	0x6000, 0xd0dc, 0x0188, 0x604c, 0xa06d, 0x0170, 0x6848, 0xa606,
-	0x1158, 0x2071, 0xafc7, 0x7024, 0xa035, 0x0130, 0xa080, 0x0004,
-	0x2004, 0xad06, 0x1108, 0x0021, 0x006e, 0x00de, 0x00ee, 0x0005,
-	0x00f6, 0x2079, 0x0100, 0x78c0, 0xa005, 0x1138, 0x00c6, 0x2660,
-	0x6003, 0x0009, 0x630a, 0x00ce, 0x04a0, 0x080c, 0x7834, 0x78c3,
-	0x0000, 0x080c, 0x7ca8, 0x7027, 0x0000, 0x0036, 0x2079, 0x0140,
-	0x7b04, 0xa384, 0x1000, 0x0120, 0x7803, 0x0100, 0x7803, 0x0000,
-	0x2079, 0x0100, 0x7824, 0xd084, 0x0110, 0x7827, 0x0001, 0x080c,
-	0x7ca8, 0x003e, 0x080c, 0x4c07, 0x00c6, 0x603c, 0xa005, 0x0110,
-	0x8001, 0x603e, 0x2660, 0x080c, 0x8078, 0x00ce, 0x6837, 0x0103,
-	0x6b4a, 0x6847, 0x0000, 0x080c, 0x97fd, 0x080c, 0x510c, 0x080c,
-	0x7b88, 0x00fe, 0x0005, 0x00e6, 0x00c6, 0x2071, 0xafc7, 0x7004,
-	0xa084, 0x0007, 0x0002, 0x6b85, 0x6b88, 0x6b9e, 0x6bb7, 0x6bf0,
-	0x6b85, 0x6b83, 0x6b83, 0x080c, 0x14f6, 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, 0x4c07, 0x6000, 0xc0dc, 0x6002, 0x7020, 0x8001, 0x7022,
-	0x0120, 0x6054, 0xa015, 0x0140, 0x721e, 0x7007, 0x0000, 0x7027,
-	0x0000, 0x00ce, 0x00ee, 0x0005, 0x7218, 0x721e, 0x0cb0, 0x7024,
-	0xa065, 0x0598, 0x700c, 0xac06, 0x1160, 0x080c, 0x7b88, 0x600c,
-	0xa015, 0x0120, 0x720e, 0x600f, 0x0000, 0x0428, 0x720e, 0x720a,
-	0x0410, 0x7014, 0xac06, 0x1160, 0x080c, 0x7b88, 0x600c, 0xa015,
-	0x0120, 0x7216, 0x600f, 0x0000, 0x00b0, 0x7216, 0x7212, 0x0098,
-	0x6018, 0x2060, 0x080c, 0x4c07, 0x6000, 0xc0dc, 0x6002, 0x080c,
-	0x7b88, 0x701c, 0xa065, 0x0138, 0x6054, 0xa015, 0x0110, 0x721e,
-	0x0010, 0x7218, 0x721e, 0x7027, 0x0000, 0x00ce, 0x00ee, 0x0005,
-	0x7024, 0xa065, 0x0140, 0x080c, 0x7b88, 0x600c, 0xa015, 0x0150,
-	0x720e, 0x600f, 0x0000, 0x080c, 0x7ca8, 0x7027, 0x0000, 0x00ce,
-	0x00ee, 0x0005, 0x720e, 0x720a, 0x0cb0, 0x00d6, 0x2069, 0xafc7,
-	0x6830, 0xa084, 0x0003, 0x0002, 0x6c12, 0x6c14, 0x6c38, 0x6c10,
-	0x080c, 0x14f6, 0x00de, 0x0005, 0x00c6, 0x6840, 0xa086, 0x0001,
-	0x01b8, 0x683c, 0xa065, 0x0130, 0x600c, 0xa015, 0x0170, 0x6a3a,
-	0x600f, 0x0000, 0x6833, 0x0000, 0x683f, 0x0000, 0x2011, 0xafe6,
-	0x2013, 0x0000, 0x00ce, 0x00de, 0x0005, 0x683a, 0x6836, 0x0c90,
-	0x6843, 0x0000, 0x6838, 0xa065, 0x0d68, 0x6003, 0x0003, 0x0c50,
-	0x00c6, 0x6843, 0x0000, 0x6847, 0x0000, 0x683c, 0xa065, 0x0168,
-	0x600c, 0xa015, 0x0130, 0x6a3a, 0x600f, 0x0000, 0x683f, 0x0000,
-	0x0020, 0x683f, 0x0000, 0x683a, 0x6836, 0x00ce, 0x00de, 0x0005,
-	0x00d6, 0x2069, 0xafc7, 0x6804, 0xa084, 0x0007, 0x0002, 0x6c61,
-	0x6cfd, 0x6cfd, 0x6cfd, 0x6cfd, 0x6cff, 0x6c5f, 0x6c5f, 0x080c,
-	0x14f6, 0x6820, 0xa005, 0x1110, 0x00de, 0x0005, 0x00c6, 0x680c,
-	0xa065, 0x0150, 0x6807, 0x0004, 0x6826, 0x682b, 0x0000, 0x080c,
-	0x6d49, 0x00ce, 0x00de, 0x0005, 0x6814, 0xa065, 0x0150, 0x6807,
-	0x0001, 0x6826, 0x682b, 0x0000, 0x080c, 0x6d49, 0x00ce, 0x00de,
-	0x0005, 0x00e6, 0x0036, 0x6a1c, 0xa2f5, 0x0000, 0x0904, 0x6cf9,
-	0x704c, 0xa00d, 0x0118, 0x7088, 0xa005, 0x01a0, 0x7054, 0xa075,
-	0x0120, 0xa20e, 0x0904, 0x6cf9, 0x0028, 0x6818, 0xa20e, 0x0904,
-	0x6cf9, 0x2070, 0x704c, 0xa00d, 0x0d88, 0x7088, 0xa005, 0x1d70,
-	0x2e00, 0x681e, 0x733c, 0x7038, 0xa302, 0x1e40, 0x080c, 0x804f,
-	0x0904, 0x6cf9, 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, 0xad34, 0x2004, 0xd0ac, 0x1110, 0xd1bc,
-	0x0150, 0x7100, 0xd1f4, 0x0120, 0x7114, 0xa18c, 0x00ff, 0x0040,
-	0x2009, 0x0000, 0x0028, 0xa1e0, 0x2be6, 0x2c0d, 0xa18c, 0x00ff,
-	0x2061, 0x0100, 0x619a, 0x080c, 0x736f, 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, 0x6d49, 0x00ce, 0x00de, 0x0005, 0x00f6, 0x00d6, 0x2069,
-	0xafc7, 0x6830, 0xa086, 0x0000, 0x11c0, 0x2001, 0xad0c, 0x200c,
-	0xd1bc, 0x1550, 0x6838, 0xa07d, 0x0180, 0x6833, 0x0001, 0x683e,
-	0x6847, 0x0000, 0x0126, 0x00f6, 0x2091, 0x2400, 0x002e, 0x080c,
-	0x1ee6, 0x1130, 0x012e, 0x080c, 0x76a5, 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, 0x080c, 0x57d1,
-	0x0888, 0x601c, 0xa084, 0x000f, 0x000b, 0x0005, 0x6d57, 0x6d5c,
-	0x7210, 0x732c, 0x6d5c, 0x7210, 0x732c, 0x6d57, 0x6d5c, 0x080c,
-	0x6b73, 0x080c, 0x6c50, 0x0005, 0x0156, 0x0136, 0x0146, 0x00c6,
-	0x00f6, 0x6004, 0xa08a, 0x0080, 0x1a0c, 0x14f6, 0x6118, 0x2178,
-	0x79a0, 0x2011, 0xad34, 0x2214, 0xd2ac, 0x1110, 0xd1bc, 0x0150,
-	0x7900, 0xd1f4, 0x0120, 0x7914, 0xa18c, 0x00ff, 0x0040, 0x2009,
-	0x0000, 0x0028, 0xa1f8, 0x2be6, 0x2f0d, 0xa18c, 0x00ff, 0x2c78,
-	0x2061, 0x0100, 0x619a, 0xa08a, 0x0040, 0x1a04, 0x6dd0, 0x0033,
-	0x00fe, 0x00ce, 0x014e, 0x013e, 0x015e, 0x0005, 0x6e7c, 0x6ec7,
-	0x6ef4, 0x6fc1, 0x6fef, 0x6ff7, 0x701d, 0x702e, 0x703f, 0x7047,
-	0x705d, 0x7047, 0x70b7, 0x702e, 0x70d8, 0x70e0, 0x703f, 0x70e0,
-	0x70f1, 0x6dce, 0x6dce, 0x6dce, 0x6dce, 0x6dce, 0x6dce, 0x6dce,
-	0x6dce, 0x6dce, 0x6dce, 0x6dce, 0x790d, 0x7932, 0x7947, 0x796a,
-	0x798b, 0x701d, 0x6dce, 0x701d, 0x7047, 0x6dce, 0x6ef4, 0x6fc1,
-	0x6dce, 0x7daa, 0x7047, 0x6dce, 0x7dca, 0x7047, 0x6dce, 0x703f,
-	0x6e75, 0x6de0, 0x6dce, 0x7def, 0x7e64, 0x7f3b, 0x6dce, 0x7f4c,
-	0x7018, 0x7f68, 0x6dce, 0x79a0, 0x7fc3, 0x6dce, 0x080c, 0x14f6,
-	0x2100, 0x0033, 0x00fe, 0x00ce, 0x014e, 0x013e, 0x015e, 0x0005,
-	0x6dde, 0x6dde, 0x6dde, 0x6e14, 0x6e32, 0x6e48, 0x080c, 0x14f6,
-	0x00d6, 0x20a1, 0x020b, 0x080c, 0x710e, 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, 0x7821, 0x00de, 0x0005, 0x00d6, 0x7818, 0x2068,
-	0x68a0, 0x2069, 0xad00, 0x6ad0, 0xd2ac, 0x1110, 0xd0bc, 0x0110,
-	0xa085, 0x0001, 0x00de, 0x0005, 0x00d6, 0x20a1, 0x020b, 0x080c,
-	0x710e, 0x20a3, 0x0500, 0x20a3, 0x0000, 0x7810, 0xa0e8, 0x000f,
-	0x6808, 0x20a2, 0x680c, 0x20a2, 0x6810, 0x20a2, 0x6814, 0x20a2,
-	0x6818, 0x20a2, 0x681c, 0x20a2, 0x60c3, 0x0010, 0x080c, 0x7821,
-	0x00de, 0x0005, 0x0156, 0x0146, 0x20a1, 0x020b, 0x080c, 0x710e,
-	0x20a3, 0x7800, 0x20a3, 0x0000, 0x7808, 0x8007, 0x20a2, 0x20a3,
-	0x0000, 0x60c3, 0x0008, 0x080c, 0x7821, 0x014e, 0x015e, 0x0005,
-	0x0156, 0x0146, 0x20a1, 0x020b, 0x080c, 0x71aa, 0x20a3, 0x0200,
-	0x20a3, 0x0000, 0x20a3, 0xdf10, 0x20a3, 0x0034, 0x2099, 0xad05,
-	0x20a9, 0x0004, 0x53a6, 0x2099, 0xad01, 0x20a9, 0x0004, 0x53a6,
-	0x2099, 0xafad, 0x20a9, 0x001a, 0x3304, 0x8007, 0x20a2, 0x9398,
-	0x1f04, 0x6e64, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x004c,
-	0x080c, 0x7821, 0x014e, 0x015e, 0x0005, 0x2001, 0xad14, 0x2004,
-	0x609a, 0x080c, 0x7821, 0x0005, 0x20a1, 0x020b, 0x080c, 0x710e,
-	0x20a3, 0x5200, 0x20a3, 0x0000, 0x00d6, 0x2069, 0xad51, 0x6804,
-	0xd084, 0x0150, 0x6828, 0x20a3, 0x0000, 0x0016, 0x080c, 0x268a,
-	0x21a2, 0x001e, 0x00de, 0x0028, 0x00de, 0x20a3, 0x0000, 0x20a3,
-	0x0000, 0x20a9, 0x0004, 0x2099, 0xad05, 0x53a6, 0x20a9, 0x0004,
-	0x2099, 0xad01, 0x53a6, 0x2001, 0xad34, 0x2004, 0xd0ac, 0x1138,
-	0x7818, 0xa080, 0x0028, 0x2004, 0xa082, 0x007f, 0x0238, 0x2001,
-	0xad1b, 0x20a6, 0x2001, 0xad1c, 0x20a6, 0x0040, 0x20a3, 0x0000,
-	0x2001, 0xad14, 0x2004, 0xa084, 0x00ff, 0x20a2, 0x20a3, 0x0000,
-	0x20a3, 0x0000, 0x60c3, 0x001c, 0x080c, 0x7821, 0x0005, 0x20a1,
-	0x020b, 0x080c, 0x710e, 0x20a3, 0x0500, 0x20a3, 0x0000, 0x2001,
-	0xad34, 0x2004, 0xd0ac, 0x1138, 0x7818, 0xa080, 0x0028, 0x2004,
-	0xa082, 0x007f, 0x0238, 0x2001, 0xad1b, 0x20a6, 0x2001, 0xad1c,
-	0x20a6, 0x0040, 0x20a3, 0x0000, 0x2001, 0xad14, 0x2004, 0xa084,
-	0x00ff, 0x20a2, 0x20a9, 0x0004, 0x2099, 0xad05, 0x53a6, 0x60c3,
-	0x0010, 0x080c, 0x7821, 0x0005, 0x20a1, 0x020b, 0x080c, 0x710e,
-	0x00c6, 0x7818, 0x2060, 0x2001, 0x0000, 0x080c, 0x5037, 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,
-	0x6f83, 0x2001, 0xad34, 0x2004, 0xd0a4, 0x01c8, 0x2099, 0xaf8d,
-	0x33a6, 0x9398, 0x20a3, 0x0000, 0x9398, 0x3304, 0xa084, 0x2000,
-	0x20a2, 0x9398, 0x33a6, 0x9398, 0x20a3, 0x0000, 0x9398, 0x2001,
-	0x2710, 0x20a2, 0x9398, 0x33a6, 0x9398, 0x33a6, 0x00d0, 0x2099,
-	0xaf8d, 0x33a6, 0x9398, 0x33a6, 0x9398, 0x3304, 0x080c, 0x574f,
-	0x1118, 0xa084, 0x37ff, 0x0010, 0xa084, 0x3fff, 0x20a2, 0x9398,
-	0x33a6, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3,
-	0x0000, 0x20a9, 0x0004, 0x2099, 0xad05, 0x53a6, 0x20a9, 0x0004,
-	0x2099, 0xad01, 0x53a6, 0x20a9, 0x0008, 0x20a3, 0x0000, 0x1f04,
-	0x6f5d, 0x20a9, 0x0008, 0x20a3, 0x0000, 0x1f04, 0x6f63, 0x2099,
-	0xaf95, 0x3304, 0xc0dd, 0x20a2, 0x2001, 0xad71, 0x2004, 0xd0e4,
-	0x0158, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x9398, 0x9398, 0x9398,
-	0x33a6, 0x20a9, 0x0004, 0x0010, 0x20a9, 0x0007, 0x20a3, 0x0000,
-	0x1f04, 0x6f7e, 0x0468, 0x2001, 0xad34, 0x2004, 0xd0a4, 0x0140,
-	0x2001, 0xaf8e, 0x2004, 0x60e3, 0x0000, 0x080c, 0x26cb, 0x60e2,
-	0x2099, 0xaf8d, 0x20a9, 0x0008, 0x53a6, 0x20a9, 0x0004, 0x2099,
-	0xad05, 0x53a6, 0x20a9, 0x0004, 0x2099, 0xad01, 0x53a6, 0x20a9,
-	0x0008, 0x20a3, 0x0000, 0x1f04, 0x6fa1, 0x20a9, 0x0008, 0x20a3,
-	0x0000, 0x1f04, 0x6fa7, 0x2099, 0xaf95, 0x20a9, 0x0008, 0x53a6,
-	0x20a9, 0x0008, 0x20a3, 0x0000, 0x1f04, 0x6fb2, 0x20a9, 0x000a,
-	0x20a3, 0x0000, 0x1f04, 0x6fb8, 0x60c3, 0x0074, 0x080c, 0x7821,
-	0x0005, 0x20a1, 0x020b, 0x080c, 0x710e, 0x20a3, 0x2010, 0x20a3,
-	0x0014, 0x20a3, 0x0800, 0x20a3, 0x2000, 0xa006, 0x20a2, 0x20a2,
-	0x20a2, 0x20a2, 0x20a2, 0x00f6, 0x2079, 0xad51, 0x7904, 0x00fe,
-	0xd1ac, 0x1110, 0xa085, 0x0020, 0xd1a4, 0x0110, 0xa085, 0x0010,
-	0xa085, 0x0002, 0x00d6, 0x0804, 0x7099, 0x20a2, 0x20a3, 0x0000,
-	0x20a3, 0x0000, 0x60c3, 0x0014, 0x080c, 0x7821, 0x0005, 0x20a1,
-	0x020b, 0x080c, 0x710e, 0x20a3, 0x5000, 0x0804, 0x6f0f, 0x20a1,
-	0x020b, 0x080c, 0x710e, 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, 0x7821, 0x0005,
-	0x20a1, 0x020b, 0x080c, 0x71a2, 0x0020, 0x20a1, 0x020b, 0x080c,
-	0x71aa, 0x20a3, 0x0200, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3,
-	0x0000, 0x60c3, 0x0004, 0x080c, 0x7821, 0x0005, 0x20a1, 0x020b,
-	0x080c, 0x71aa, 0x20a3, 0x0100, 0x20a3, 0x0000, 0x20a3, 0x0003,
-	0x20a3, 0x2a00, 0x60c3, 0x0008, 0x080c, 0x7821, 0x0005, 0x20a1,
-	0x020b, 0x080c, 0x71aa, 0x20a3, 0x0200, 0x0804, 0x6f0f, 0x20a1,
-	0x020b, 0x080c, 0x71aa, 0x20a3, 0x0100, 0x20a3, 0x0000, 0x7828,
-	0xa005, 0x0110, 0x20a2, 0x0010, 0x20a3, 0x0003, 0x7810, 0x20a2,
-	0x60c3, 0x0008, 0x080c, 0x7821, 0x0005, 0x00d6, 0x20a1, 0x020b,
-	0x080c, 0x71aa, 0x20a3, 0x0210, 0x20a3, 0x0014, 0x20a3, 0x0800,
-	0x7818, 0x2068, 0x6894, 0xa086, 0x0014, 0x1178, 0x6998, 0xa184,
-	0xc000, 0x1140, 0xd1ec, 0x0118, 0x20a3, 0x2100, 0x0040, 0x20a3,
-	0x0100, 0x0028, 0x20a3, 0x0400, 0x0010, 0x20a3, 0x0700, 0xa006,
-	0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x00f6, 0x2079, 0xad51,
-	0x7904, 0x00fe, 0xd1ac, 0x1110, 0xa085, 0x0020, 0xd1a4, 0x0110,
-	0xa085, 0x0010, 0x2009, 0xad73, 0x210c, 0xd184, 0x1110, 0xa085,
-	0x0002, 0x0026, 0x2009, 0xad71, 0x210c, 0xd1e4, 0x0130, 0xc0c5,
-	0xa094, 0x0030, 0xa296, 0x0010, 0x0140, 0xd1ec, 0x0130, 0xa094,
-	0x0030, 0xa296, 0x0010, 0x0108, 0xc0bd, 0x002e, 0x20a2, 0x20a2,
-	0x20a2, 0x60c3, 0x0014, 0x080c, 0x7821, 0x00de, 0x0005, 0x20a1,
-	0x020b, 0x080c, 0x71aa, 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, 0x7821, 0x0005,
-	0x20a1, 0x020b, 0x080c, 0x71aa, 0x20a3, 0x0200, 0x0804, 0x6e82,
-	0x20a1, 0x020b, 0x080c, 0x71aa, 0x20a3, 0x0100, 0x20a3, 0x0000,
-	0x20a3, 0x0003, 0x20a3, 0x2a00, 0x60c3, 0x0008, 0x080c, 0x7821,
-	0x0005, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x20a1, 0x020b, 0x080c,
-	0x71aa, 0x20a3, 0x0100, 0x20a3, 0x0000, 0x20a3, 0x000b, 0x20a3,
-	0x0000, 0x60c3, 0x0008, 0x080c, 0x7821, 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,
-	0xad14, 0x2214, 0x2001, 0xaf9d, 0x2004, 0xa005, 0x0118, 0x2011,
-	0xad1c, 0x2214, 0x22a2, 0x04d0, 0xa286, 0x007f, 0x1138, 0x00d6,
-	0xa385, 0x00ff, 0x20a2, 0x20a3, 0xfffd, 0x00c8, 0x2001, 0xad34,
-	0x2004, 0xd0ac, 0x1110, 0xd2bc, 0x01c8, 0xa286, 0x0080, 0x00d6,
-	0x1130, 0xa385, 0x00ff, 0x20a2, 0x20a3, 0xfffc, 0x0040, 0xa2e8,
-	0xae34, 0x2d6c, 0x6810, 0xa305, 0x20a2, 0x6814, 0x20a2, 0x2069,
-	0xad1b, 0x2da6, 0x8d68, 0x2da6, 0x00de, 0x0080, 0x00d6, 0xa2e8,
-	0xae34, 0x2d6c, 0x6810, 0xa305, 0x20a2, 0x6814, 0x20a2, 0x00de,
-	0x20a3, 0x0000, 0x2011, 0xad14, 0x2214, 0x22a2, 0xa485, 0x0029,
-	0x20a2, 0x004e, 0x003e, 0x20a3, 0x0000, 0x080c, 0x7810, 0x22a2,
-	0x20a3, 0x0000, 0x2fa2, 0x20a3, 0xffff, 0x20a3, 0x0000, 0x20a3,
-	0x0000, 0x002e, 0x0005, 0x0026, 0x20e1, 0x9080, 0x20e1, 0x4000,
-	0x20a3, 0x02ff, 0x2011, 0xfffc, 0x22a2, 0x00d6, 0x2069, 0xad1b,
-	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, 0xad34, 0x2214, 0xd2ac, 0x1118, 0xa092, 0x007e,
-	0x02d8, 0x00d6, 0xa0e8, 0xae34, 0x2d6c, 0x6810, 0xa305, 0x20a2,
-	0x6814, 0x20a2, 0x6810, 0xa005, 0x1140, 0x6814, 0xa005, 0x1128,
-	0x20a3, 0x00ff, 0x20a3, 0xfffe, 0x0028, 0x2069, 0xad1b, 0x2da6,
-	0x8d68, 0x2da6, 0x00de, 0x0080, 0x00d6, 0xa0e8, 0xae34, 0x2d6c,
-	0x6810, 0xa305, 0x20a2, 0x6814, 0x20a2, 0x00de, 0x20a3, 0x0000,
-	0x2011, 0xad14, 0x2214, 0x22a2, 0xa485, 0x0098, 0x20a2, 0x20a3,
-	0x0000, 0x004e, 0x003e, 0x080c, 0x7810, 0x22a2, 0x20a3, 0x0000,
-	0x7a08, 0x22a2, 0x2fa2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x002e,
-	0x0005, 0x080c, 0x7810, 0x22a2, 0x20a3, 0x0000, 0x7a08, 0x22a2,
-	0x7810, 0x20a2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x002e, 0x0005,
-	0x00c6, 0x00f6, 0x6004, 0xa08a, 0x0085, 0x0a0c, 0x14f6, 0xa08a,
-	0x008c, 0x1a0c, 0x14f6, 0x6118, 0x2178, 0x79a0, 0x2011, 0xad34,
-	0x2214, 0xd2ac, 0x1110, 0xd1bc, 0x0150, 0x7900, 0xd1f4, 0x0120,
-	0x7914, 0xa18c, 0x00ff, 0x0040, 0x2009, 0x0000, 0x0028, 0xa1f8,
-	0x2be6, 0x2f0d, 0xa18c, 0x00ff, 0x2c78, 0x2061, 0x0100, 0x619a,
-	0xa082, 0x0085, 0x001b, 0x00fe, 0x00ce, 0x0005, 0x7247, 0x7251,
-	0x726c, 0x7245, 0x7245, 0x7245, 0x7247, 0x080c, 0x14f6, 0x0146,
-	0x20a1, 0x020b, 0x04a1, 0x60c3, 0x0000, 0x080c, 0x7821, 0x014e,
-	0x0005, 0x0146, 0x20a1, 0x020b, 0x080c, 0x72b8, 0x20a3, 0x0000,
-	0x20a3, 0x0000, 0x7808, 0x20a2, 0x7810, 0x20a2, 0x20a3, 0x0000,
-	0x20a3, 0xffff, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x000c,
-	0x080c, 0x7821, 0x014e, 0x0005, 0x0146, 0x20a1, 0x020b, 0x080c,
-	0x72f2, 0x20a3, 0x0003, 0x20a3, 0x0300, 0x20a3, 0x0000, 0x20a3,
-	0x0000, 0x60c3, 0x0004, 0x080c, 0x7821, 0x014e, 0x0005, 0x0026,
-	0x20e1, 0x9080, 0x20e1, 0x4000, 0x7818, 0xa080, 0x0028, 0x2004,
-	0x2011, 0xad34, 0x2214, 0xd2ac, 0x1118, 0xa092, 0x007e, 0x0288,
-	0x00d6, 0xa0e8, 0xae34, 0x2d6c, 0x6810, 0xa085, 0x8100, 0x20a2,
-	0x6814, 0x20a2, 0x2069, 0xad1b, 0x2da6, 0x8d68, 0x2da6, 0x00de,
-	0x0088, 0x00d6, 0xa0e8, 0xae34, 0x2d6c, 0x6810, 0xa085, 0x8100,
-	0x20a2, 0x6814, 0x20a2, 0x00de, 0x20a3, 0x0000, 0x2011, 0xad14,
-	0x2214, 0x22a2, 0x20a3, 0x0009, 0x20a3, 0x0000, 0x0804, 0x7175,
-	0x0026, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x7818, 0xa080, 0x0028,
-	0x2004, 0x2011, 0xad34, 0x2214, 0xd2ac, 0x1118, 0xa092, 0x007e,
-	0x0288, 0x00d6, 0xa0e8, 0xae34, 0x2d6c, 0x6810, 0xa085, 0x8400,
-	0x20a2, 0x6814, 0x20a2, 0x2069, 0xad1b, 0x2da6, 0x8d68, 0x2da6,
-	0x00de, 0x0088, 0x00d6, 0xa0e8, 0xae34, 0x2d6c, 0x6810, 0xa085,
-	0x8400, 0x20a2, 0x6814, 0x20a2, 0x00de, 0x20a3, 0x0000, 0x2011,
-	0xad14, 0x2214, 0x22a2, 0x2001, 0x0099, 0x20a2, 0x20a3, 0x0000,
-	0x0804, 0x7201, 0x0026, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x7818,
-	0xa080, 0x0028, 0x2004, 0x2011, 0xad34, 0x2214, 0xd2ac, 0x1118,
-	0xa092, 0x007e, 0x0288, 0x00d6, 0xa0e8, 0xae34, 0x2d6c, 0x6810,
-	0xa085, 0x8500, 0x20a2, 0x6814, 0x20a2, 0x2069, 0xad1b, 0x2da6,
-	0x8d68, 0x2da6, 0x00de, 0x0088, 0x00d6, 0xa0e8, 0xae34, 0x2d6c,
-	0x6810, 0xa085, 0x8500, 0x20a2, 0x6814, 0x20a2, 0x00de, 0x20a3,
-	0x0000, 0x2011, 0xad14, 0x2214, 0x22a2, 0x2001, 0x0099, 0x20a2,
-	0x20a3, 0x0000, 0x0804, 0x7201, 0x00c6, 0x00f6, 0x2c78, 0x7804,
-	0xa08a, 0x0040, 0x0a0c, 0x14f6, 0xa08a, 0x0053, 0x1a0c, 0x14f6,
-	0x7918, 0x2160, 0x61a0, 0x2011, 0xad34, 0x2214, 0xd2ac, 0x1110,
-	0xd1bc, 0x0150, 0x6100, 0xd1f4, 0x0120, 0x6114, 0xa18c, 0x00ff,
-	0x0040, 0x2009, 0x0000, 0x0028, 0xa1e0, 0x2be6, 0x2c0d, 0xa18c,
-	0x00ff, 0x2061, 0x0100, 0x619a, 0xa082, 0x0040, 0x001b, 0x00fe,
-	0x00ce, 0x0005, 0x736f, 0x747b, 0x7418, 0x761a, 0x736d, 0x736d,
-	0x736d, 0x736d, 0x736d, 0x736d, 0x736d, 0x7b41, 0x7b51, 0x7b61,
-	0x7b71, 0x736d, 0x7f79, 0x736d, 0x7b30, 0x080c, 0x14f6, 0x00d6,
-	0x0156, 0x0146, 0x780b, 0xffff, 0x20a1, 0x020b, 0x080c, 0x73cf,
-	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, 0xafe3, 0x2003, 0x07d0, 0x2001, 0xafe2, 0x2003,
-	0x0009, 0x080c, 0x17bf, 0x014e, 0x015e, 0x00de, 0x0005, 0x20e1,
-	0x9080, 0x20e1, 0x4000, 0x7a18, 0xa280, 0x0023, 0x2014, 0x8210,
-	0xa294, 0x00ff, 0x2202, 0x8217, 0x7818, 0xa080, 0x0028, 0x2004,
-	0x2019, 0xad34, 0x231c, 0xd3ac, 0x1110, 0xd0bc, 0x0188, 0x00d6,
-	0xa0e8, 0xae34, 0x2d6c, 0x6810, 0xa085, 0x0600, 0x20a2, 0x6814,
-	0x20a2, 0x2069, 0xad1b, 0x2da6, 0x8d68, 0x2da6, 0x00de, 0x0088,
-	0x00d6, 0xa0e8, 0xae34, 0x2d6c, 0x6810, 0xa085, 0x0600, 0x20a2,
-	0x6814, 0x20a2, 0x00de, 0x20a3, 0x0000, 0x2009, 0xad14, 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, 0x7821, 0x014e, 0x013e, 0x015e, 0x00de, 0x0005, 0x0026,
-	0x20e1, 0x9080, 0x20e1, 0x4000, 0x7818, 0xa080, 0x0028, 0x2004,
-	0x2011, 0xad34, 0x2214, 0xd2ac, 0x1110, 0xd0bc, 0x0188, 0x00d6,
-	0xa0e8, 0xae34, 0x2d6c, 0x6810, 0xa085, 0x0500, 0x20a2, 0x6814,
-	0x20a2, 0x2069, 0xad1b, 0x2da6, 0x8d68, 0x2da6, 0x00de, 0x0088,
-	0x00d6, 0xa0e8, 0xae34, 0x2d6c, 0x6810, 0xa085, 0x0500, 0x20a2,
-	0x6814, 0x20a2, 0x00de, 0x20a3, 0x0000, 0x2011, 0xad14, 0x2214,
-	0x22a2, 0x20a3, 0x0889, 0x20a3, 0x0000, 0x080c, 0x7810, 0x22a2,
-	0x20a3, 0x0000, 0x7a08, 0x22a2, 0x2fa2, 0x20a3, 0x0000, 0x20a3,
-	0x0000, 0x002e, 0x0005, 0x00d6, 0x0156, 0x0136, 0x0146, 0x7810,
-	0xa06d, 0x080c, 0x5025, 0x0148, 0x684c, 0xa084, 0x2020, 0xa086,
-	0x2020, 0x1118, 0x7820, 0xc0cd, 0x7822, 0x20a1, 0x020b, 0x080c,
-	0x75d0, 0xa016, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x7810,
-	0xa084, 0xf000, 0x1130, 0x7810, 0xa084, 0x0700, 0x8007, 0x0043,
-	0x0010, 0xa006, 0x002b, 0x014e, 0x013e, 0x015e, 0x00de, 0x0005,
-	0x74b2, 0x7547, 0x7550, 0x7579, 0x758c, 0x75a7, 0x75b0, 0x74b0,
-	0x080c, 0x14f6, 0x0016, 0x0036, 0x694c, 0xa18c, 0x0003, 0x0118,
-	0xa186, 0x0003, 0x1170, 0x6b78, 0x7820, 0xd0cc, 0x0108, 0xc3e5,
-	0x23a2, 0x6868, 0x20a2, 0x6864, 0x20a2, 0x003e, 0x001e, 0x0804,
-	0x7583, 0xa186, 0x0001, 0x190c, 0x14f6, 0x6b78, 0x7820, 0xd0cc,
-	0x0108, 0xc3e5, 0x23a2, 0x6868, 0x20a2, 0x6864, 0x20a2, 0x22a2,
-	0x6874, 0x20a2, 0x22a2, 0x687c, 0x20a2, 0x2009, 0x0018, 0xa384,
-	0x0300, 0x0904, 0x7541, 0xd3c4, 0x0110, 0x687c, 0xa108, 0xd3cc,
-	0x0110, 0x6874, 0xa108, 0x0156, 0x20a9, 0x000d, 0xad80, 0x0020,
-	0x201c, 0x831f, 0x23a2, 0x8000, 0x1f04, 0x74f0, 0x015e, 0x22a2,
-	0x22a2, 0x22a2, 0xa184, 0x0003, 0x0904, 0x7541, 0x20a1, 0x020b,
-	0x20e1, 0x9080, 0x20e1, 0x4000, 0x0006, 0x7818, 0xa080, 0x0028,
-	0x2004, 0x2011, 0xad34, 0x2214, 0xd2ac, 0x1110, 0xd0bc, 0x0188,
-	0x00d6, 0xa0e8, 0xae34, 0x2d6c, 0x6810, 0xa085, 0x0700, 0x20a2,
-	0x6814, 0x20a2, 0x2069, 0xad1b, 0x2da6, 0x8d68, 0x2da6, 0x00de,
-	0x0088, 0x00d6, 0xa0e8, 0xae34, 0x2d6c, 0x6810, 0xa085, 0x0700,
-	0x20a2, 0x6814, 0x20a2, 0x00de, 0x20a3, 0x0000, 0x2011, 0xad14,
-	0x2214, 0x22a2, 0x000e, 0x7b20, 0xd3cc, 0x0118, 0x20a3, 0x0889,
-	0x0010, 0x20a3, 0x0898, 0x20a2, 0x080c, 0x7810, 0x22a2, 0x20a3,
-	0x0000, 0x61c2, 0x003e, 0x001e, 0x080c, 0x7821, 0x0005, 0x2011,
-	0x0008, 0x7820, 0xd0cc, 0x0108, 0xc2e5, 0x22a2, 0xa016, 0x0488,
-	0x2011, 0x0302, 0x7820, 0xd0cc, 0x0108, 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, 0x080c, 0x7821,
-	0x0005, 0x2011, 0x0028, 0x7820, 0xd0cc, 0x0108, 0xc2e5, 0x22a2,
-	0xa016, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x60c3,
-	0x0018, 0x080c, 0x7821, 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, 0x7821, 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, 0x7583,
-	0x0026, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x7818, 0xa080, 0x0028,
-	0x2004, 0x2011, 0xad34, 0x2214, 0xd2ac, 0x1110, 0xd0bc, 0x0188,
-	0x00d6, 0xa0e8, 0xae34, 0x2d6c, 0x6810, 0xa085, 0x0700, 0x20a2,
-	0x6814, 0x20a2, 0x2069, 0xad1b, 0x2da6, 0x8d68, 0x2da6, 0x00de,
-	0x0088, 0x00d6, 0xa0e8, 0xae34, 0x2d6c, 0x6810, 0xa085, 0x0700,
-	0x20a2, 0x6814, 0x20a2, 0x00de, 0x20a3, 0x0000, 0x2011, 0xad14,
-	0x2214, 0x22a2, 0x7820, 0xd0cc, 0x0118, 0x20a3, 0x0889, 0x0010,
-	0x20a3, 0x0898, 0x20a3, 0x0000, 0x080c, 0x7810, 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, 0x7634, 0x7634, 0x7636, 0x7634,
-	0x7634, 0x7634, 0x7658, 0x7634, 0x080c, 0x14f6, 0x7910, 0xa18c,
-	0xf8ff, 0xa18d, 0x0600, 0x7912, 0x20a1, 0x020b, 0x2009, 0x0003,
-	0x00f9, 0x00d6, 0x2069, 0xad51, 0x6804, 0xd0bc, 0x0130, 0x682c,
-	0xa084, 0x00ff, 0x8007, 0x20a2, 0x0010, 0x20a3, 0x3f00, 0x00de,
-	0x22a2, 0x22a2, 0x22a2, 0x60c3, 0x0001, 0x080c, 0x7821, 0x0005,
-	0x20a1, 0x020b, 0x2009, 0x0003, 0x0019, 0x20a3, 0x7f00, 0x0c80,
-	0x0026, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x7818, 0xa080, 0x0028,
-	0x2004, 0x2011, 0xad34, 0x2214, 0xd2ac, 0x1110, 0xd0bc, 0x0188,
-	0x00d6, 0xa0e8, 0xae34, 0x2d6c, 0x6810, 0xa085, 0x0100, 0x20a2,
-	0x6814, 0x20a2, 0x2069, 0xad1b, 0x2da6, 0x8d68, 0x2da6, 0x00de,
-	0x0088, 0x00d6, 0xa0e8, 0xae34, 0x2d6c, 0x6810, 0xa085, 0x0100,
-	0x20a2, 0x6814, 0x20a2, 0x00de, 0x20a3, 0x0000, 0x2011, 0xad14,
-	0x2214, 0x22a2, 0x20a3, 0x0888, 0xa18d, 0x0008, 0x21a2, 0x080c,
-	0x7810, 0x22a2, 0x20a3, 0x0000, 0x7a08, 0x22a2, 0x2fa2, 0x20a3,
-	0x0000, 0x20a3, 0x0000, 0x002e, 0x0005, 0x00e6, 0x00d6, 0x00c6,
-	0x0056, 0x0046, 0x0036, 0x2061, 0x0100, 0x2071, 0xad00, 0x7150,
-	0x7818, 0x2068, 0x68a0, 0x2028, 0x76d0, 0xd6ac, 0x1130, 0xd0bc,
-	0x1120, 0x6910, 0x6a14, 0x7450, 0x0020, 0x6910, 0x6a14, 0x736c,
-	0x7470, 0x781c, 0xa0be, 0x0006, 0x0904, 0x775b, 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, 0x8014, 0x2009, 0x07d0, 0x60c4, 0xa084,
-	0xfff0, 0xa005, 0x0110, 0x2009, 0x1b58, 0x080c, 0x6586, 0x003e,
-	0x004e, 0x005e, 0x00ce, 0x00de, 0x00ee, 0x0005, 0x70d0, 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,
-	0x8014, 0x2009, 0x07d0, 0x60c4, 0xa084, 0xfff0, 0xa005, 0x0110,
-	0x2009, 0x1b58, 0x080c, 0x6586, 0x003e, 0x004e, 0x005e, 0x00ce,
-	0x00de, 0x00ee, 0x0005, 0x7810, 0x2070, 0x704c, 0xa084, 0x0003,
-	0xa086, 0x0002, 0x0904, 0x77b1, 0x2001, 0xad34, 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, 0x8011, 0x0804,
-	0x7749, 0x2001, 0xad34, 0x2004, 0xd0ac, 0x1110, 0xd5bc, 0x0138,
-	0xa185, 0x0700, 0x6062, 0x6266, 0x636a, 0x646e, 0x0038, 0xa185,
-	0x0700, 0x6062, 0x6266, 0x606b, 0x0000, 0x646e, 0x080c, 0x5025,
-	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, 0x8014, 0x0804, 0x7749, 0x080c, 0x8011, 0x0804, 0x7749,
-	0x7a18, 0xa280, 0x0023, 0x2014, 0x8210, 0xa294, 0x00ff, 0x2202,
-	0x8217, 0x0005, 0x00d6, 0x2069, 0xafc7, 0x6843, 0x0001, 0x00de,
-	0x0005, 0x20e1, 0x9080, 0x60a3, 0x0056, 0x60a7, 0x9575, 0x0019,
-	0x080c, 0x6578, 0x0005, 0x0006, 0x6014, 0xa084, 0x0004, 0xa085,
-	0x0009, 0x6016, 0x000e, 0x0005, 0x0006, 0x00c6, 0x2061, 0x0100,
-	0x6014, 0xa084, 0x0004, 0xa085, 0x0008, 0x6016, 0x00ce, 0x000e,
-	0x0005, 0x00c6, 0x00d6, 0x0016, 0x0026, 0x2061, 0x0100, 0x2069,
-	0x0140, 0x080c, 0x574f, 0x1178, 0x2001, 0xafe3, 0x2004, 0xa005,
-	0x1598, 0x080c, 0x57d1, 0x1118, 0x080c, 0x6578, 0x0468, 0x00c6,
-	0x2061, 0xafc7, 0x00d8, 0x6904, 0xa194, 0x4000, 0x0550, 0x08a1,
-	0x6803, 0x1000, 0x6803, 0x0000, 0x00c6, 0x2061, 0xafc7, 0x6128,
-	0xa192, 0x00c8, 0x1258, 0x8108, 0x612a, 0x6124, 0x00ce, 0x81ff,
-	0x0198, 0x080c, 0x6578, 0x080c, 0x782b, 0x0070, 0x6124, 0xa1e5,
-	0x0000, 0x0140, 0x080c, 0xaca2, 0x2009, 0x0014, 0x080c, 0x80a7,
-	0x080c, 0x6581, 0x00ce, 0x0000, 0x002e, 0x001e, 0x00de, 0x00ce,
-	0x0005, 0x2001, 0xafe3, 0x2004, 0xa005, 0x1db0, 0x00c6, 0x2061,
-	0xafc7, 0x6128, 0xa192, 0x0003, 0x1e08, 0x8108, 0x612a, 0x00ce,
-	0x080c, 0x6578, 0x080c, 0x485e, 0x0c38, 0x00c6, 0x00d6, 0x00e6,
-	0x0016, 0x0026, 0x080c, 0x658e, 0x2071, 0xafc7, 0x713c, 0x81ff,
-	0x0570, 0x2061, 0x0100, 0x2069, 0x0140, 0x080c, 0x574f, 0x1188,
-	0x0036, 0x2019, 0x0001, 0x080c, 0x7a64, 0x003e, 0x713c, 0x2160,
-	0x080c, 0xaca2, 0x2009, 0x004a, 0x080c, 0x80a7, 0x080c, 0x57d1,
-	0x00b0, 0x6904, 0xa194, 0x4000, 0x01c0, 0x6803, 0x1000, 0x6803,
-	0x0000, 0x0036, 0x2019, 0x0001, 0x080c, 0x7a64, 0x003e, 0x713c,
-	0x2160, 0x080c, 0xaca2, 0x2009, 0x004a, 0x080c, 0x80a7, 0x002e,
-	0x001e, 0x00ee, 0x00de, 0x00ce, 0x0005, 0x0c58, 0x00e6, 0x00d6,
-	0x00c6, 0x0066, 0x0056, 0x0046, 0x0006, 0x0126, 0x2091, 0x8000,
-	0x6018, 0x2068, 0x6ca0, 0x2071, 0xafc7, 0x7018, 0x2068, 0x8dff,
-	0x0198, 0x68a0, 0xa406, 0x0118, 0x6854, 0x2068, 0x0cc0, 0x6010,
-	0x2060, 0x643c, 0x6540, 0x6e48, 0x2d60, 0x080c, 0x4e41, 0x0120,
-	0x080c, 0x7b88, 0xa085, 0x0001, 0x012e, 0x000e, 0x004e, 0x005e,
-	0x006e, 0x00ce, 0x00de, 0x00ee, 0x0005, 0x20a1, 0x020b, 0x080c,
-	0x710e, 0x20a3, 0x1200, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x781c,
-	0xa086, 0x0004, 0x1110, 0x6098, 0x0018, 0x2001, 0xad14, 0x2004,
-	0x20a2, 0x7834, 0x20a2, 0x7838, 0x20a2, 0x20a9, 0x0010, 0xa006,
-	0x20a2, 0x1f04, 0x7928, 0x20a2, 0x20a2, 0x60c3, 0x002c, 0x080c,
-	0x7821, 0x0005, 0x0156, 0x0146, 0x20a1, 0x020b, 0x080c, 0x710e,
-	0x20a3, 0x0f00, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x7808, 0x20a2,
-	0x60c3, 0x0008, 0x080c, 0x7821, 0x014e, 0x015e, 0x0005, 0x0156,
-	0x0146, 0x20a1, 0x020b, 0x080c, 0x71aa, 0x20a3, 0x0200, 0x20a3,
-	0x0000, 0x20a9, 0x0006, 0x2011, 0xad40, 0x2019, 0xad41, 0x23a6,
-	0x22a6, 0xa398, 0x0002, 0xa290, 0x0002, 0x1f04, 0x7957, 0x20a3,
-	0x0000, 0x20a3, 0x0000, 0x60c3, 0x001c, 0x080c, 0x7821, 0x014e,
-	0x015e, 0x0005, 0x0156, 0x0146, 0x0016, 0x0026, 0x20a1, 0x020b,
-	0x080c, 0x7183, 0x080c, 0x7199, 0x7810, 0xa080, 0x0000, 0x2004,
-	0xa080, 0x0015, 0x2098, 0x7808, 0xa088, 0x0002, 0x21a8, 0x53a6,
-	0xa080, 0x0004, 0x8003, 0x60c2, 0x080c, 0x7821, 0x002e, 0x001e,
-	0x014e, 0x015e, 0x0005, 0x0156, 0x0146, 0x20a1, 0x020b, 0x080c,
-	0x710e, 0x20a3, 0x6200, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x7808,
-	0x20a2, 0x60c3, 0x0008, 0x080c, 0x7821, 0x014e, 0x015e, 0x0005,
-	0x0156, 0x0146, 0x0016, 0x0026, 0x20a1, 0x020b, 0x080c, 0x710e,
-	0x7810, 0xa080, 0x0000, 0x2004, 0xa080, 0x0017, 0x2098, 0x7808,
-	0xa088, 0x0002, 0x21a8, 0x53a6, 0x8003, 0x60c2, 0x080c, 0x7821,
-	0x002e, 0x001e, 0x014e, 0x015e, 0x0005, 0x00e6, 0x00c6, 0x0006,
-	0x0126, 0x2091, 0x8000, 0x2071, 0xafc7, 0x700c, 0x2060, 0x8cff,
-	0x0178, 0x080c, 0x9789, 0x1110, 0x080c, 0x85f3, 0x600c, 0x0006,
-	0x080c, 0x994e, 0x080c, 0x8078, 0x080c, 0x7b88, 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, 0xafc7, 0x7024, 0x2060, 0x8cff, 0x05a0, 0x080c, 0x7834,
-	0x68c3, 0x0000, 0x080c, 0x6581, 0x2009, 0x0013, 0x080c, 0x80a7,
-	0x20a9, 0x01f4, 0x6824, 0xd094, 0x0158, 0x6827, 0x0004, 0x7804,
-	0xa084, 0x4000, 0x01a0, 0x7803, 0x1000, 0x7803, 0x0000, 0x0078,
-	0xd084, 0x0118, 0x6827, 0x0001, 0x0010, 0x1f04, 0x7a02, 0x7804,
-	0xa084, 0x1000, 0x0120, 0x7803, 0x0100, 0x7803, 0x0000, 0x6824,
-	0x000e, 0x001e, 0x002e, 0x00ce, 0x00de, 0x00ee, 0x00fe, 0x015e,
-	0x012e, 0x0005, 0x2001, 0xad00, 0x2004, 0xa096, 0x0001, 0x0550,
-	0xa096, 0x0004, 0x0538, 0x6817, 0x0008, 0x68c3, 0x0000, 0x2011,
-	0x481b, 0x080c, 0x650d, 0x20a9, 0x01f4, 0x6824, 0xd094, 0x0158,
-	0x6827, 0x0004, 0x7804, 0xa084, 0x4000, 0x01a0, 0x7803, 0x1000,
-	0x7803, 0x0000, 0x0078, 0xd084, 0x0118, 0x6827, 0x0001, 0x0010,
-	0x1f04, 0x7a3d, 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, 0xafc7, 0x703c, 0x2060, 0x8cff,
-	0x0904, 0x7ad5, 0x6817, 0x0010, 0x2009, 0x00fa, 0x8109, 0x1df0,
-	0x68c7, 0x0000, 0x68cb, 0x0008, 0x080c, 0x658e, 0x080c, 0x20b5,
-	0x0046, 0x2009, 0x017f, 0x200b, 0x00a5, 0x2021, 0x0169, 0x2404,
-	0xa084, 0x000f, 0xa086, 0x0004, 0x11b0, 0x68c7, 0x0000, 0x68cb,
-	0x0008, 0x00e6, 0x00f6, 0x2079, 0x0020, 0x2071, 0xb01e, 0x6814,
-	0xa084, 0x0184, 0xa085, 0x0012, 0x6816, 0x7803, 0x0008, 0x7003,
-	0x0000, 0x00fe, 0x00ee, 0x200b, 0x0000, 0x004e, 0xa39d, 0x0000,
-	0x1120, 0x2009, 0x0049, 0x080c, 0x80a7, 0x20a9, 0x03e8, 0x6824,
-	0xd094, 0x0158, 0x6827, 0x0004, 0x7804, 0xa084, 0x4000, 0x01a0,
-	0x7803, 0x1000, 0x7803, 0x0000, 0x0078, 0xd08c, 0x0118, 0x6827,
-	0x0002, 0x0010, 0x1f04, 0x7ab7, 0x7804, 0xa084, 0x1000, 0x0120,
-	0x7803, 0x0100, 0x7803, 0x0000, 0x6824, 0x000e, 0x001e, 0x002e,
-	0x00ce, 0x00de, 0x00ee, 0x00fe, 0x015e, 0x012e, 0x0005, 0x00d6,
-	0x0126, 0x2091, 0x8000, 0x2069, 0xafc7, 0x6a06, 0x012e, 0x00de,
-	0x0005, 0x00d6, 0x0126, 0x2091, 0x8000, 0x2069, 0xafc7, 0x6a32,
-	0x012e, 0x00de, 0x0005, 0x00f6, 0x00e6, 0x00c6, 0x0066, 0x0006,
-	0x0126, 0x2071, 0xafc7, 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,
-	0x974e, 0x080c, 0x7b88, 0x00ce, 0x08d8, 0x2c78, 0x600c, 0x2060,
-	0x08b8, 0x012e, 0x000e, 0x006e, 0x00ce, 0x00ee, 0x00fe, 0x0005,
-	0x0156, 0x0146, 0x20a1, 0x020b, 0x080c, 0x73cf, 0x7810, 0x20a2,
-	0xa006, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a3, 0x1000, 0x0804,
-	0x7b80, 0x0156, 0x0146, 0x20a1, 0x020b, 0x080c, 0x73cf, 0x7810,
-	0x20a2, 0xa006, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a3, 0x4000,
-	0x0478, 0x0156, 0x0146, 0x20a1, 0x020b, 0x080c, 0x73cf, 0x7810,
-	0x20a2, 0xa006, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a3, 0x2000,
-	0x00f8, 0x0156, 0x0146, 0x20a1, 0x020b, 0x080c, 0x73cf, 0x7810,
-	0x20a2, 0xa006, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a3, 0x0400,
-	0x0078, 0x0156, 0x0146, 0x20a1, 0x020b, 0x080c, 0x73cf, 0x7810,
-	0x20a2, 0xa006, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a3, 0x0200,
-	0x0089, 0x60c3, 0x0020, 0x080c, 0x7821, 0x014e, 0x015e, 0x0005,
-	0x00e6, 0x2071, 0xafc7, 0x7020, 0xa005, 0x0110, 0x8001, 0x7022,
-	0x00ee, 0x0005, 0x20a9, 0x0008, 0x20a2, 0x1f04, 0x7b94, 0x20a2,
-	0x20a2, 0x0005, 0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x0076, 0x0066,
-	0x0006, 0x0126, 0x2091, 0x8000, 0x2071, 0xafc7, 0x7614, 0x2660,
-	0x2678, 0x2039, 0x0001, 0x87ff, 0x0904, 0x7c24, 0x8cff, 0x0904,
-	0x7c24, 0x601c, 0xa086, 0x0006, 0x1904, 0x7c1f, 0x88ff, 0x0138,
-	0x2800, 0xac06, 0x1904, 0x7c1f, 0x2039, 0x0000, 0x0050, 0x6018,
-	0xa206, 0x1904, 0x7c1f, 0x85ff, 0x0120, 0x6050, 0xa106, 0x1904,
-	0x7c1f, 0x7024, 0xac06, 0x1538, 0x2069, 0x0100, 0x68c0, 0xa005,
-	0x01f0, 0x080c, 0x6581, 0x6817, 0x0008, 0x68c3, 0x0000, 0x080c,
-	0x7ca8, 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, 0x0460, 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, 0x9596, 0x0110, 0x080c, 0xa91f, 0x080c, 0x974e,
-	0x080c, 0x7b88, 0x88ff, 0x1190, 0x00ce, 0x0804, 0x7bab, 0x2c78,
-	0x600c, 0x2060, 0x0804, 0x7bab, 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, 0xafc7,
-	0x7638, 0x2660, 0x2678, 0x8cff, 0x0904, 0x7c98, 0x601c, 0xa086,
-	0x0006, 0x1904, 0x7c93, 0x87ff, 0x0128, 0x2700, 0xac06, 0x1904,
-	0x7c93, 0x0040, 0x6018, 0xa206, 0x15f0, 0x85ff, 0x0118, 0x6050,
-	0xa106, 0x15c8, 0x703c, 0xac06, 0x1170, 0x0036, 0x2019, 0x0001,
-	0x080c, 0x7a64, 0x7033, 0x0000, 0x703f, 0x0000, 0x7043, 0x0000,
-	0x7047, 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,
-	0x9596, 0x0110, 0x080c, 0xa91f, 0x080c, 0x974e, 0x87ff, 0x1190,
-	0x00ce, 0x0804, 0x7c43, 0x2c78, 0x600c, 0x2060, 0x0804, 0x7c43,
-	0xa006, 0x012e, 0x000e, 0x002e, 0x006e, 0x00ce, 0x00de, 0x00ee,
-	0x00fe, 0x0005, 0x6017, 0x0000, 0x00ce, 0xa7bd, 0x0001, 0x0c88,
-	0x00e6, 0x2071, 0xafc7, 0x2001, 0xad00, 0x2004, 0xa086, 0x0002,
-	0x1118, 0x7007, 0x0005, 0x0010, 0x7007, 0x0000, 0x00ee, 0x0005,
-	0x00f6, 0x00e6, 0x00c6, 0x0066, 0x0026, 0x0006, 0x0126, 0x2091,
-	0x8000, 0x2071, 0xafc7, 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, 0xafc7, 0x760c,
-	0x2660, 0x2678, 0x8cff, 0x0904, 0x7d7e, 0x6018, 0xa080, 0x0028,
-	0x2004, 0xa206, 0x1904, 0x7d79, 0x7024, 0xac06, 0x1508, 0x2069,
-	0x0100, 0x68c0, 0xa005, 0x0904, 0x7d55, 0x080c, 0x7834, 0x68c3,
-	0x0000, 0x080c, 0x7ca8, 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, 0x9778, 0x1158, 0x080c, 0x2aff, 0x080c,
-	0x9789, 0x11f0, 0x080c, 0x85f3, 0x00d8, 0x080c, 0x7ca8, 0x08c0,
-	0x080c, 0x9789, 0x1118, 0x080c, 0x85f3, 0x0090, 0x6010, 0x2068,
-	0x080c, 0x9596, 0x0168, 0x601c, 0xa086, 0x0003, 0x11f8, 0x6837,
-	0x0103, 0x6b4a, 0x6847, 0x0000, 0x080c, 0x510c, 0x080c, 0x9742,
-	0x080c, 0x994e, 0x080c, 0x974e, 0x080c, 0x7b88, 0x00ce, 0x0804,
-	0x7d02, 0x2c78, 0x600c, 0x2060, 0x0804, 0x7d02, 0x012e, 0x000e,
-	0x006e, 0x00ce, 0x00de, 0x00ee, 0x00fe, 0x0005, 0x601c, 0xa086,
-	0x0006, 0x1d30, 0x080c, 0xa91f, 0x0c18, 0x0036, 0x0156, 0x0136,
-	0x0146, 0x3908, 0xa006, 0xa190, 0x0020, 0x221c, 0xa39e, 0x28f9,
-	0x1118, 0x8210, 0x8000, 0x0cc8, 0xa005, 0x0138, 0x20a9, 0x0020,
-	0x2198, 0xa110, 0x22a0, 0x22c8, 0x53a3, 0x014e, 0x013e, 0x015e,
-	0x003e, 0x0005, 0x00d6, 0x20a1, 0x020b, 0x080c, 0x71aa, 0x20a3,
-	0x0200, 0x20a3, 0x0014, 0x60c3, 0x0014, 0x20a3, 0x0000, 0x20a3,
-	0x0000, 0x2099, 0xafa6, 0x20a9, 0x0004, 0x53a6, 0x20a3, 0x0004,
-	0x20a3, 0x7878, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x080c, 0x7821,
-	0x00de, 0x0005, 0x20a1, 0x020b, 0x080c, 0x71aa, 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, 0x7821, 0x0005, 0x00d6,
-	0x0016, 0x2f68, 0x2009, 0x0035, 0x080c, 0x9a34, 0x1904, 0x7e5d,
-	0x20a1, 0x020b, 0x080c, 0x710e, 0x20a3, 0x1300, 0x20a3, 0x0000,
-	0x7828, 0x2068, 0x681c, 0xa086, 0x0003, 0x0580, 0x7818, 0xa080,
-	0x0028, 0x2014, 0x2001, 0xad34, 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, 0xae34, 0x2d6c, 0x6810, 0x20a2, 0x6814, 0x20a2,
-	0x00e8, 0x20a3, 0x0000, 0x6098, 0x20a2, 0x00c0, 0x2001, 0xad34,
-	0x2004, 0xd0ac, 0x1138, 0x7818, 0xa080, 0x0028, 0x2004, 0xa082,
-	0x007e, 0x0240, 0x00d6, 0x2069, 0xad1b, 0x2da6, 0x8d68, 0x2da6,
-	0x00de, 0x0020, 0x20a3, 0x0000, 0x6034, 0x20a2, 0x7834, 0x20a2,
-	0x7838, 0x20a2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x000c,
-	0x080c, 0x7821, 0x001e, 0x00de, 0x0005, 0x7817, 0x0001, 0x7803,
-	0x0006, 0x001e, 0x00de, 0x0005, 0x00d6, 0x0026, 0x7928, 0x2168,
-	0x691c, 0xa186, 0x0006, 0x01c0, 0xa186, 0x0003, 0x0904, 0x7ed3,
-	0xa186, 0x0005, 0x0904, 0x7ebc, 0xa186, 0x0004, 0x05b8, 0xa186,
-	0x0008, 0x0904, 0x7ec4, 0x7807, 0x0037, 0x7813, 0x1700, 0x080c,
-	0x7f3b, 0x002e, 0x00de, 0x0005, 0x080c, 0x7ef7, 0x2009, 0x4000,
-	0x6800, 0x0002, 0x7e9d, 0x7ea8, 0x7e9f, 0x7ea8, 0x7ea4, 0x7e9d,
-	0x7e9d, 0x7ea8, 0x7ea8, 0x7ea8, 0x7ea8, 0x7e9d, 0x7e9d, 0x7e9d,
-	0x7e9d, 0x7e9d, 0x7ea8, 0x7e9d, 0x7ea8, 0x080c, 0x14f6, 0x6820,
-	0xd0e4, 0x0110, 0xd0cc, 0x0110, 0xa00e, 0x0010, 0x2009, 0x2000,
-	0x6828, 0x20a2, 0x682c, 0x20a2, 0x0804, 0x7eed, 0x080c, 0x7ef7,
-	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, 0x7821, 0x002e, 0x00de, 0x0005, 0x0036,
-	0x0046, 0x0056, 0x0066, 0x20a1, 0x020b, 0x080c, 0x71aa, 0xa006,
-	0x20a3, 0x0200, 0x20a2, 0x7934, 0x21a2, 0x7938, 0x21a2, 0x7818,
-	0xa080, 0x0028, 0x2004, 0x2011, 0xad34, 0x2214, 0xd2ac, 0x1118,
-	0xa092, 0x007e, 0x0268, 0x00d6, 0x2069, 0xad1b, 0x2d2c, 0x8d68,
-	0x2d34, 0xa0e8, 0xae34, 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, 0x71aa, 0x20a3,
-	0x0100, 0x20a3, 0x0000, 0x20a3, 0x0009, 0x7810, 0x20a2, 0x60c3,
-	0x0008, 0x080c, 0x7821, 0x0005, 0x20a1, 0x020b, 0x080c, 0x7106,
-	0x20a3, 0x1400, 0x20a3, 0x0000, 0x7834, 0x20a2, 0x7838, 0x20a2,
-	0x7828, 0x20a2, 0x782c, 0x20a2, 0x7830, 0xa084, 0x00ff, 0x8007,
-	0x20a2, 0x20a3, 0x0000, 0x60c3, 0x0010, 0x080c, 0x7821, 0x0005,
-	0x20a1, 0x020b, 0x080c, 0x71a2, 0x20a3, 0x0100, 0x20a3, 0x0000,
-	0x7828, 0x20a2, 0x7810, 0x20a2, 0x60c3, 0x0008, 0x080c, 0x7821,
-	0x0005, 0x0146, 0x20a1, 0x020b, 0x0031, 0x60c3, 0x0000, 0x080c,
-	0x7821, 0x014e, 0x0005, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x7818,
-	0xa080, 0x0028, 0x2004, 0x2011, 0xad34, 0x2214, 0xd2ac, 0x1110,
-	0xd0bc, 0x0188, 0x00d6, 0xa0e8, 0xae34, 0x2d6c, 0x6810, 0xa085,
-	0x0300, 0x20a2, 0x6814, 0x20a2, 0x2069, 0xad1b, 0x2da6, 0x8d68,
-	0x2da6, 0x00de, 0x0078, 0x00d6, 0xa0e8, 0xae34, 0x2d6c, 0x6810,
-	0xa085, 0x0300, 0x20a2, 0x6814, 0x20a2, 0x00de, 0x20a3, 0x0000,
-	0x6234, 0x22a2, 0x20a3, 0x0819, 0x20a3, 0x0000, 0x080c, 0x7810,
-	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, 0x782b, 0x080c, 0x6578, 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, 0xb400, 0x2a70, 0x7064, 0x7046, 0x704b,
-	0xb400, 0x0005, 0x00e6, 0x0126, 0x2071, 0xad00, 0x2091, 0x8000,
-	0x7544, 0xa582, 0x0010, 0x0608, 0x7048, 0x2060, 0x6000, 0xa086,
-	0x0000, 0x0148, 0xace0, 0x0018, 0x7058, 0xac02, 0x1208, 0x0cb0,
-	0x2061, 0xb400, 0x0c98, 0x6003, 0x0008, 0x8529, 0x7546, 0xaca8,
-	0x0018, 0x7058, 0xa502, 0x1230, 0x754a, 0xa085, 0x0001, 0x012e,
-	0x00ee, 0x0005, 0x704b, 0xb400, 0x0cc0, 0xa006, 0x0cc0, 0x00e6,
-	0x2071, 0xad00, 0x7544, 0xa582, 0x0010, 0x0600, 0x7048, 0x2060,
-	0x6000, 0xa086, 0x0000, 0x0148, 0xace0, 0x0018, 0x7058, 0xac02,
-	0x1208, 0x0cb0, 0x2061, 0xb400, 0x0c98, 0x6003, 0x0008, 0x8529,
-	0x7546, 0xaca8, 0x0018, 0x7058, 0xa502, 0x1228, 0x754a, 0xa085,
-	0x0001, 0x00ee, 0x0005, 0x704b, 0xb400, 0x0cc8, 0xa006, 0x0cc8,
-	0xac82, 0xb400, 0x0a0c, 0x14f6, 0x2001, 0xad16, 0x2004, 0xac02,
-	0x1a0c, 0x14f6, 0xa006, 0x6006, 0x600a, 0x600e, 0x6012, 0x6016,
-	0x601a, 0x601f, 0x0000, 0x6003, 0x0000, 0x6052, 0x6056, 0x6022,
-	0x6026, 0x602a, 0x602e, 0x6032, 0x6036, 0x603a, 0x603e, 0x2061,
-	0xad00, 0x6044, 0x8000, 0x6046, 0xa086, 0x0001, 0x0108, 0x0005,
-	0x0126, 0x2091, 0x8000, 0x080c, 0x6c50, 0x012e, 0x0cc0, 0x601c,
-	0xa084, 0x000f, 0x0002, 0x80b6, 0x80c5, 0x80e0, 0x80fb, 0x9a61,
-	0x9a7c, 0x9a97, 0x80b6, 0x80c5, 0x80b6, 0x8116, 0xa186, 0x0013,
-	0x1128, 0x080c, 0x6b73, 0x080c, 0x6c50, 0x0005, 0xa18e, 0x0047,
-	0x1118, 0xa016, 0x080c, 0x1824, 0x0005, 0x0066, 0x6000, 0xa0b2,
-	0x0010, 0x1a0c, 0x14f6, 0x0013, 0x006e, 0x0005, 0x80de, 0x8478,
-	0x862d, 0x80de, 0x86a2, 0x81cf, 0x80de, 0x80de, 0x840a, 0x8a91,
-	0x80de, 0x80de, 0x80de, 0x80de, 0x80de, 0x80de, 0x080c, 0x14f6,
-	0x0066, 0x6000, 0xa0b2, 0x0010, 0x1a0c, 0x14f6, 0x0013, 0x006e,
-	0x0005, 0x80f9, 0x909a, 0x80f9, 0x80f9, 0x80f9, 0x80f9, 0x80f9,
-	0x80f9, 0x9045, 0x9200, 0x80f9, 0x90c7, 0x913e, 0x90c7, 0x913e,
-	0x80f9, 0x080c, 0x14f6, 0x0066, 0x6000, 0xa0b2, 0x0010, 0x1a0c,
-	0x14f6, 0x0013, 0x006e, 0x0005, 0x8114, 0x8ad2, 0x8b98, 0x8cb8,
-	0x8e12, 0x8114, 0x8114, 0x8114, 0x8aac, 0x8ff5, 0x8ff8, 0x8114,
-	0x8114, 0x8114, 0x8114, 0x9022, 0x080c, 0x14f6, 0x0066, 0x6000,
-	0xa0b2, 0x0010, 0x1a0c, 0x14f6, 0x0013, 0x006e, 0x0005, 0x812f,
-	0x812f, 0x812f, 0x8152, 0x81a5, 0x812f, 0x812f, 0x812f, 0x8131,
-	0x812f, 0x812f, 0x812f, 0x812f, 0x812f, 0x812f, 0x812f, 0x080c,
-	0x14f6, 0xa186, 0x0003, 0x190c, 0x14f6, 0x00d6, 0x6003, 0x0003,
-	0x6106, 0x6010, 0x2068, 0x684f, 0x0040, 0x687c, 0x680a, 0x6880,
-	0x680e, 0x6813, 0x0000, 0x6817, 0x0000, 0x00de, 0x2c10, 0x080c,
-	0x1e6e, 0x080c, 0x680b, 0x0126, 0x2091, 0x8000, 0x080c, 0x6d0d,
-	0x012e, 0x0005, 0xa182, 0x0047, 0x0002, 0x815e, 0x815e, 0x8160,
-	0x817f, 0x815e, 0x815e, 0x815e, 0x815e, 0x8191, 0x080c, 0x14f6,
-	0x00d6, 0x0016, 0x080c, 0x6c05, 0x080c, 0x6d0d, 0x6003, 0x0004,
-	0x6110, 0x2168, 0x6854, 0x8003, 0x800b, 0x810b, 0xa108, 0x6116,
-	0x684f, 0x0020, 0x685c, 0x685a, 0x6874, 0x687e, 0x6878, 0x6882,
-	0x6897, 0x0000, 0x689b, 0x0000, 0x001e, 0x00de, 0x0005, 0x080c,
-	0x6c05, 0x00d6, 0x6110, 0x2168, 0x080c, 0x9596, 0x0120, 0x684b,
-	0x0006, 0x080c, 0x510c, 0x00de, 0x080c, 0x8078, 0x080c, 0x6d0d,
-	0x0005, 0x080c, 0x6c05, 0x080c, 0x2ad9, 0x00d6, 0x6110, 0x2168,
-	0x080c, 0x9596, 0x0120, 0x684b, 0x0029, 0x080c, 0x510c, 0x00de,
-	0x080c, 0x8078, 0x080c, 0x6d0d, 0x0005, 0xa182, 0x0047, 0x0002,
-	0x81b3, 0x81c2, 0x81b1, 0x81b1, 0x81b1, 0x81b1, 0x81b1, 0x81b1,
-	0x81b1, 0x080c, 0x14f6, 0x00d6, 0x6010, 0x2068, 0x684c, 0xc0f4,
-	0x684e, 0x00de, 0x20e1, 0x0005, 0x3d18, 0x3e20, 0x2c10, 0x080c,
-	0x1824, 0x0005, 0x00d6, 0x6110, 0x2168, 0x684b, 0x0000, 0x6853,
-	0x0000, 0x080c, 0x510c, 0x00de, 0x080c, 0x8078, 0x0005, 0xa1b6,
-	0x0015, 0x1118, 0x080c, 0x8078, 0x0030, 0xa1b6, 0x0016, 0x190c,
-	0x14f6, 0x080c, 0x8078, 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, 0x81ea, 0x00e6, 0x080c,
-	0x9596, 0x0130, 0x6010, 0x2070, 0x7007, 0x0000, 0x7037, 0x0103,
-	0x00ee, 0x080c, 0x8078, 0x0005, 0x00d6, 0x0036, 0x7330, 0xa386,
-	0x0200, 0x1130, 0x6018, 0x2068, 0x6813, 0x00ff, 0x6817, 0xfffd,
-	0x6010, 0xa005, 0x0130, 0x2068, 0x6807, 0x0000, 0x6837, 0x0103,
-	0x6b32, 0x080c, 0x8078, 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, 0x8078, 0x001e, 0x0005, 0x0016, 0x2009,
-	0x0000, 0x7030, 0xa086, 0x0100, 0x0140, 0x7038, 0xa084, 0x00ff,
-	0x808e, 0x703c, 0xa084, 0x00ff, 0x8086, 0xa080, 0x0004, 0xa108,
-	0x21a8, 0xae80, 0x000c, 0x2098, 0x6010, 0xa080, 0x0002, 0x20a0,
-	0x080c, 0x48be, 0x00e6, 0x080c, 0x9596, 0x0140, 0x6010, 0x2070,
-	0x7007, 0x0000, 0x7034, 0x70b2, 0x7037, 0x0103, 0x00ee, 0x080c,
-	0x8078, 0x001e, 0x0005, 0x00e6, 0x00d6, 0x603f, 0x0000, 0x2c68,
-	0x0016, 0x2009, 0x0035, 0x080c, 0x9a34, 0x001e, 0x1168, 0x0026,
-	0x6228, 0x2268, 0x002e, 0x2071, 0xb28c, 0x6b1c, 0xa386, 0x0003,
-	0x0130, 0xa386, 0x0006, 0x0128, 0x080c, 0x8078, 0x0020, 0x0031,
-	0x0010, 0x080c, 0x8323, 0x00de, 0x00ee, 0x0005, 0x00f6, 0x6810,
-	0x2078, 0xa186, 0x0015, 0x0904, 0x830c, 0xa18e, 0x0016, 0x1904,
-	0x8321, 0x700c, 0xa084, 0xff00, 0xa086, 0x1700, 0x1904, 0x82eb,
-	0x8fff, 0x0904, 0x831f, 0x6808, 0xa086, 0xffff, 0x1904, 0x830e,
-	0x784c, 0xa084, 0x0060, 0xa086, 0x0020, 0x1150, 0x797c, 0x7810,
-	0xa106, 0x1904, 0x830e, 0x7980, 0x7814, 0xa106, 0x1904, 0x830e,
-	0x080c, 0x9742, 0x6858, 0x7852, 0x784c, 0xc0dc, 0xc0f4, 0xc0d4,
-	0x784e, 0x0026, 0xa00e, 0x6a14, 0x2001, 0x000a, 0x080c, 0x6665,
-	0x7854, 0xa20a, 0x0208, 0x8011, 0x7a56, 0x82ff, 0x002e, 0x1138,
-	0x00c6, 0x2d60, 0x080c, 0x9374, 0x00ce, 0x0804, 0x831f, 0x00c6,
-	0x00d6, 0x2f68, 0x6838, 0xd0fc, 0x1118, 0x080c, 0x4993, 0x0010,
-	0x080c, 0x4b7c, 0x00de, 0x00ce, 0x1548, 0x00c6, 0x2d60, 0x080c,
-	0x8078, 0x00ce, 0x04a0, 0x7008, 0xa086, 0x000b, 0x11a0, 0x6018,
-	0x200c, 0xc1bc, 0x2102, 0x00c6, 0x2d60, 0x7853, 0x0003, 0x6007,
-	0x0085, 0x6003, 0x000b, 0x601f, 0x0002, 0x080c, 0x67a8, 0x080c,
-	0x6c50, 0x00ce, 0x00e0, 0x700c, 0xa086, 0x2a00, 0x1138, 0x2001,
-	0xafa5, 0x2004, 0x683e, 0x0098, 0x0471, 0x0098, 0x8fff, 0x090c,
-	0x14f6, 0x00c6, 0x00d6, 0x2d60, 0x2f68, 0x684b, 0x0003, 0x080c,
-	0x926f, 0x080c, 0x9742, 0x080c, 0x974e, 0x00de, 0x00ce, 0x080c,
-	0x8078, 0x00fe, 0x0005, 0xa186, 0x0015, 0x1128, 0x2001, 0xafa5,
-	0x2004, 0x683e, 0x0068, 0xa18e, 0x0016, 0x1160, 0x00c6, 0x2d00,
-	0x2060, 0x080c, 0xabb4, 0x080c, 0x6618, 0x080c, 0x8078, 0x00ce,
-	0x080c, 0x8078, 0x0005, 0x0026, 0x0036, 0x0046, 0x7228, 0x7c80,
-	0x7b7c, 0xd2f4, 0x0130, 0x2001, 0xafa5, 0x2004, 0x683e, 0x0804,
-	0x839d, 0x00c6, 0x2d60, 0x080c, 0x928f, 0x00ce, 0x6804, 0xa086,
-	0x0050, 0x1168, 0x00c6, 0x2d00, 0x2060, 0x6003, 0x0001, 0x6007,
-	0x0050, 0x080c, 0x67a8, 0x080c, 0x6c50, 0x00ce, 0x04f0, 0x6800,
-	0xa086, 0x000f, 0x01c8, 0x8fff, 0x090c, 0x14f6, 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, 0x9894, 0x080c, 0x6c50, 0x0010, 0x080c, 0x8078, 0x004e,
-	0x003e, 0x002e, 0x0005, 0x00e6, 0x00d6, 0x0026, 0x6034, 0x2068,
-	0x6a1c, 0xa286, 0x0007, 0x0904, 0x83ee, 0xa286, 0x0002, 0x05f0,
-	0xa286, 0x0000, 0x05d8, 0x6808, 0x6338, 0xa306, 0x15b8, 0x2071,
-	0xb28c, 0xa186, 0x0015, 0x0560, 0xa18e, 0x0016, 0x1190, 0x6030,
-	0xa084, 0x00ff, 0xa086, 0x0001, 0x1160, 0x700c, 0xa086, 0x2a00,
-	0x1140, 0x6034, 0xa080, 0x0008, 0x200c, 0xc1dd, 0xc1f5, 0x2102,
-	0x00b8, 0x00c6, 0x6034, 0x2060, 0x6010, 0x2068, 0x080c, 0x9596,
-	0x090c, 0x14f6, 0x6853, 0x0003, 0x6007, 0x0085, 0x6003, 0x000b,
-	0x601f, 0x0002, 0x080c, 0x67a8, 0x080c, 0x6c50, 0x00ce, 0x0030,
-	0x6034, 0x2070, 0x2001, 0xafa5, 0x2004, 0x703e, 0x080c, 0x8078,
-	0x002e, 0x00de, 0x00ee, 0x0005, 0x00d6, 0x20a9, 0x000e, 0x2e98,
-	0x6010, 0x20a0, 0x53a3, 0xa1b6, 0x0015, 0x1148, 0x6018, 0x2068,
-	0x7038, 0x680a, 0x703c, 0x680e, 0x6800, 0xc08d, 0x6802, 0x00de,
-	0x0804, 0x81f6, 0x2100, 0xa1b2, 0x0080, 0x1a0c, 0x14f6, 0xa1b2,
-	0x0040, 0x1a04, 0x846e, 0x0002, 0x8462, 0x8456, 0x8462, 0x8462,
-	0x8462, 0x8462, 0x8454, 0x8454, 0x8454, 0x8454, 0x8454, 0x8454,
-	0x8454, 0x8454, 0x8454, 0x8454, 0x8454, 0x8454, 0x8454, 0x8454,
-	0x8454, 0x8454, 0x8454, 0x8454, 0x8454, 0x8454, 0x8454, 0x8454,
-	0x8454, 0x8454, 0x8454, 0x8462, 0x8454, 0x8462, 0x8462, 0x8454,
-	0x8454, 0x8454, 0x8454, 0x8454, 0x8462, 0x8454, 0x8454, 0x8454,
-	0x8454, 0x8454, 0x8454, 0x8454, 0x8454, 0x8454, 0x8462, 0x8462,
-	0x8454, 0x8454, 0x8454, 0x8454, 0x8454, 0x8454, 0x8454, 0x8454,
-	0x8454, 0x8462, 0x8454, 0x8454, 0x080c, 0x14f6, 0x6003, 0x0001,
-	0x6106, 0x080c, 0x67ee, 0x0126, 0x2091, 0x8000, 0x080c, 0x6c50,
-	0x012e, 0x0005, 0x6003, 0x0001, 0x6106, 0x080c, 0x67ee, 0x0126,
-	0x2091, 0x8000, 0x080c, 0x6c50, 0x012e, 0x0005, 0x2600, 0x0002,
-	0x8462, 0x8476, 0x8476, 0x8462, 0x8462, 0x8476, 0x080c, 0x14f6,
-	0x6004, 0xa0b2, 0x0080, 0x1a0c, 0x14f6, 0xa1b6, 0x0013, 0x0904,
-	0x8518, 0xa1b6, 0x0027, 0x1904, 0x84de, 0x080c, 0x6b73, 0x6004,
-	0x080c, 0x9778, 0x0188, 0x080c, 0x9789, 0x0904, 0x84d8, 0xa08e,
-	0x0021, 0x0904, 0x84db, 0xa08e, 0x0022, 0x0904, 0x84d8, 0xa08e,
-	0x003d, 0x0904, 0x84db, 0x04a8, 0x080c, 0x2aff, 0x2001, 0x0007,
-	0x080c, 0x4c30, 0x6018, 0xa080, 0x0028, 0x200c, 0x080c, 0x85f3,
-	0xa186, 0x007e, 0x1148, 0x2001, 0xad34, 0x2014, 0xc285, 0x080c,
-	0x574f, 0x1108, 0xc2ad, 0x2202, 0x0016, 0x0026, 0x0036, 0x2110,
-	0x2019, 0x0028, 0x080c, 0x68e7, 0x0076, 0x2039, 0x0000, 0x080c,
-	0x681d, 0x00c6, 0x6018, 0xa065, 0x0110, 0x080c, 0x4ecf, 0x00ce,
-	0x2c08, 0x080c, 0xa712, 0x007e, 0x003e, 0x002e, 0x001e, 0x080c,
-	0x4c9f, 0x080c, 0x994e, 0x080c, 0x8078, 0x080c, 0x6c50, 0x0005,
-	0x080c, 0x85f3, 0x0cb0, 0x080c, 0x8621, 0x0c98, 0xa186, 0x0014,
-	0x1db0, 0x080c, 0x6b73, 0x080c, 0x2ad9, 0x080c, 0x9778, 0x1188,
-	0x080c, 0x2aff, 0x6018, 0xa080, 0x0028, 0x200c, 0x080c, 0x85f3,
-	0xa186, 0x007e, 0x1128, 0x2001, 0xad34, 0x200c, 0xc185, 0x2102,
-	0x08c0, 0x080c, 0x9789, 0x1118, 0x080c, 0x85f3, 0x0890, 0x6004,
-	0xa08e, 0x0032, 0x1158, 0x00e6, 0x00f6, 0x2071, 0xad81, 0x2079,
-	0x0000, 0x080c, 0x2df1, 0x00fe, 0x00ee, 0x0818, 0x6004, 0xa08e,
-	0x0021, 0x0d50, 0xa08e, 0x0022, 0x090c, 0x85f3, 0x0804, 0x84d1,
-	0xa0b2, 0x0040, 0x1a04, 0x85db, 0x2008, 0x0002, 0x8560, 0x8561,
-	0x8564, 0x8567, 0x856a, 0x856d, 0x855e, 0x855e, 0x855e, 0x855e,
-	0x855e, 0x855e, 0x855e, 0x855e, 0x855e, 0x855e, 0x855e, 0x855e,
-	0x855e, 0x855e, 0x855e, 0x855e, 0x855e, 0x855e, 0x855e, 0x855e,
-	0x855e, 0x855e, 0x855e, 0x855e, 0x8570, 0x857f, 0x855e, 0x8581,
-	0x857f, 0x855e, 0x855e, 0x855e, 0x855e, 0x855e, 0x857f, 0x857f,
-	0x855e, 0x855e, 0x855e, 0x855e, 0x855e, 0x855e, 0x855e, 0x855e,
-	0x85bb, 0x857f, 0x855e, 0x857b, 0x855e, 0x855e, 0x855e, 0x857c,
-	0x855e, 0x855e, 0x855e, 0x857f, 0x85b2, 0x855e, 0x080c, 0x14f6,
-	0x00f0, 0x2001, 0x000b, 0x0460, 0x2001, 0x0003, 0x0448, 0x2001,
-	0x0005, 0x0430, 0x2001, 0x0001, 0x0418, 0x2001, 0x0009, 0x0400,
-	0x080c, 0x6b73, 0x6003, 0x0005, 0x2001, 0xafa5, 0x2004, 0x603e,
-	0x080c, 0x6c50, 0x00a0, 0x0018, 0x0010, 0x080c, 0x4c30, 0x0804,
-	0x85cc, 0x080c, 0x6b73, 0x2001, 0xafa3, 0x2004, 0x6016, 0x2001,
-	0xafa5, 0x2004, 0x603e, 0x6003, 0x0004, 0x080c, 0x6c50, 0x0005,
-	0x080c, 0x4c30, 0x080c, 0x6b73, 0x6003, 0x0002, 0x2001, 0xafa5,
-	0x2004, 0x603e, 0x0036, 0x2019, 0xad5c, 0x2304, 0xa084, 0xff00,
-	0x1120, 0x2001, 0xafa3, 0x201c, 0x0040, 0x8007, 0xa09a, 0x0004,
-	0x0ec0, 0x8003, 0x801b, 0x831b, 0xa318, 0x6316, 0x003e, 0x080c,
-	0x6c50, 0x08e8, 0x080c, 0x6b73, 0x080c, 0x994e, 0x080c, 0x8078,
-	0x080c, 0x6c50, 0x08a0, 0x00e6, 0x00f6, 0x2071, 0xad81, 0x2079,
-	0x0000, 0x080c, 0x2df1, 0x00fe, 0x00ee, 0x080c, 0x6b73, 0x080c,
-	0x8078, 0x080c, 0x6c50, 0x0818, 0x080c, 0x6b73, 0x2001, 0xafa5,
-	0x2004, 0x603e, 0x6003, 0x0002, 0x2001, 0xafa3, 0x2004, 0x6016,
-	0x080c, 0x6c50, 0x0005, 0x2600, 0x2008, 0x0002, 0x85e6, 0x85e4,
-	0x85e4, 0x85cc, 0x85cc, 0x85e4, 0x080c, 0x14f6, 0x080c, 0x6b73,
-	0x00d6, 0x6010, 0x2068, 0x080c, 0x15f0, 0x00de, 0x080c, 0x8078,
-	0x080c, 0x6c50, 0x0005, 0x00e6, 0x0026, 0x0016, 0x080c, 0x9596,
-	0x0508, 0x6010, 0x2070, 0x7034, 0xa086, 0x0139, 0x1148, 0x2001,
-	0x0030, 0x2009, 0x0000, 0x2011, 0x4005, 0x080c, 0x9a05, 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, 0x14f6,
-	0x6604, 0xa6b6, 0x0043, 0x1120, 0x080c, 0x99c1, 0x0804, 0x8692,
-	0x6604, 0xa6b6, 0x0033, 0x1120, 0x080c, 0x9971, 0x0804, 0x8692,
-	0x6604, 0xa6b6, 0x0028, 0x1120, 0x080c, 0x97b9, 0x0804, 0x8692,
-	0x6604, 0xa6b6, 0x0029, 0x1118, 0x080c, 0x97d0, 0x04d8, 0x6604,
-	0xa6b6, 0x001f, 0x1118, 0x080c, 0x81dc, 0x04a0, 0x6604, 0xa6b6,
-	0x0000, 0x1118, 0x080c, 0x83f4, 0x0468, 0x6604, 0xa6b6, 0x0022,
-	0x1118, 0x080c, 0x8204, 0x0430, 0x6604, 0xa6b6, 0x0035, 0x1118,
-	0x080c, 0x826b, 0x00f8, 0x6604, 0xa6b6, 0x0039, 0x1118, 0x080c,
-	0x83a3, 0x00c0, 0x6604, 0xa6b6, 0x003d, 0x1118, 0x080c, 0x821e,
-	0x0088, 0x6604, 0xa6b6, 0x0044, 0x1118, 0x080c, 0x823e, 0x0050,
-	0xa1b6, 0x0015, 0x1110, 0x0053, 0x0028, 0xa1b6, 0x0016, 0x1118,
-	0x0804, 0x883f, 0x0005, 0x080c, 0x80be, 0x0ce0, 0x86b9, 0x86bc,
-	0x86b9, 0x86fe, 0x86b9, 0x87cc, 0x884d, 0x86b9, 0x86b9, 0x881b,
-	0x86b9, 0x882f, 0xa1b6, 0x0048, 0x0140, 0x20e1, 0x0005, 0x3d18,
-	0x3e20, 0x2c10, 0x080c, 0x1824, 0x0005, 0x00e6, 0xacf0, 0x0004,
-	0x2e74, 0x7000, 0x2070, 0x7037, 0x0103, 0x00ee, 0x080c, 0x8078,
-	0x0005, 0xe000, 0xe000, 0x0005, 0x00e6, 0x2071, 0xad00, 0x7080,
-	0xa086, 0x0074, 0x1530, 0x080c, 0xa6e9, 0x11b0, 0x00d6, 0x6018,
-	0x2068, 0x7030, 0xd08c, 0x0128, 0x6800, 0xd0bc, 0x0110, 0xc0c5,
-	0x6802, 0x00d9, 0x00de, 0x2001, 0x0006, 0x080c, 0x4c30, 0x080c,
-	0x2aff, 0x080c, 0x8078, 0x0078, 0x2001, 0x000a, 0x080c, 0x4c30,
-	0x080c, 0x2aff, 0x6003, 0x0001, 0x6007, 0x0001, 0x080c, 0x67ee,
-	0x0010, 0x080c, 0x87bd, 0x00ee, 0x0005, 0x6800, 0xd084, 0x0168,
-	0x2001, 0x0000, 0x080c, 0x4c1e, 0x2069, 0xad51, 0x6804, 0xd0a4,
-	0x0120, 0x2001, 0x0006, 0x080c, 0x4c5d, 0x0005, 0x00d6, 0x2011,
-	0xad20, 0x2204, 0xa086, 0x0074, 0x1904, 0x87ba, 0x6018, 0x2068,
-	0x6aa0, 0xa286, 0x007e, 0x1120, 0x080c, 0x894d, 0x0804, 0x875e,
-	0x080c, 0x8943, 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, 0x4c30, 0x080c, 0x2aff, 0x080c, 0x8078,
-	0x0804, 0x87bb, 0x00e6, 0x2071, 0xad34, 0x2e04, 0xd09c, 0x0188,
-	0x2071, 0xb280, 0x7108, 0x720c, 0xa18c, 0x00ff, 0x1118, 0xa284,
-	0xff00, 0x0138, 0x6018, 0x2070, 0x70a0, 0xd0bc, 0x1110, 0x7112,
-	0x7216, 0x00ee, 0x6010, 0xa005, 0x0128, 0x2068, 0x6838, 0xd0f4,
-	0x0108, 0x0880, 0x2001, 0x0004, 0x080c, 0x4c30, 0x6003, 0x0001,
-	0x6007, 0x0003, 0x080c, 0x67ee, 0x0804, 0x87bb, 0x685c, 0xd0e4,
-	0x01d0, 0x080c, 0x9903, 0x080c, 0x574f, 0x0110, 0xd0dc, 0x1900,
-	0x2011, 0xad34, 0x2204, 0xc0ad, 0x2012, 0x2001, 0xaf8e, 0x2004,
-	0x00f6, 0x2079, 0x0100, 0x78e3, 0x0000, 0x080c, 0x26cb, 0x78e2,
-	0x00fe, 0x0804, 0x8728, 0x080c, 0x9937, 0x2011, 0xad34, 0x2204,
-	0xc0a5, 0x2012, 0x0006, 0x080c, 0xa801, 0x000e, 0x1904, 0x8728,
-	0xc0b5, 0x2012, 0x2001, 0x0000, 0x080c, 0x4c1e, 0x00c6, 0x2009,
-	0x00ef, 0x00f6, 0x2079, 0x0100, 0x79ea, 0x7932, 0x7936, 0x00fe,
-	0x080c, 0x26a0, 0x00f6, 0x2079, 0xad00, 0x7972, 0x2100, 0x2009,
-	0x0000, 0x080c, 0x2676, 0x794e, 0x00fe, 0x8108, 0x080c, 0x4c80,
-	0x2c00, 0x00ce, 0x1904, 0x8728, 0x601a, 0x2001, 0x0002, 0x080c,
-	0x4c30, 0x601f, 0x0001, 0x6003, 0x0001, 0x6007, 0x0002, 0x080c,
-	0x67ee, 0x0008, 0x0011, 0x00de, 0x0005, 0x2001, 0xad00, 0x2004,
-	0xa086, 0x0003, 0x0120, 0x2001, 0x0007, 0x080c, 0x4c30, 0x080c,
-	0x2aff, 0x080c, 0x8078, 0x0005, 0x00e6, 0x0026, 0x0016, 0x2071,
-	0xad00, 0x7080, 0xa086, 0x0014, 0x15f0, 0x7000, 0xa086, 0x0003,
-	0x1128, 0x6010, 0xa005, 0x1110, 0x080c, 0x3cce, 0x00d6, 0x6018,
-	0x2068, 0x080c, 0x4d72, 0x080c, 0x86ed, 0x00de, 0x080c, 0x89f7,
-	0x1550, 0x00d6, 0x6018, 0x2068, 0x6890, 0x00de, 0xa005, 0x0518,
-	0x2001, 0x0006, 0x080c, 0x4c30, 0x00e6, 0x6010, 0xa075, 0x01a8,
-	0x7034, 0xa084, 0x00ff, 0xa086, 0x0039, 0x1148, 0x2001, 0x0000,
-	0x2009, 0x0000, 0x2011, 0x4000, 0x080c, 0x9a05, 0x0030, 0x7007,
-	0x0000, 0x7037, 0x0103, 0x7033, 0x0200, 0x00ee, 0x080c, 0x2aff,
-	0x080c, 0x8078, 0x0020, 0x080c, 0x85f3, 0x080c, 0x87bd, 0x001e,
-	0x002e, 0x00ee, 0x0005, 0x2011, 0xad20, 0x2204, 0xa086, 0x0014,
-	0x1158, 0x2001, 0x0002, 0x080c, 0x4c30, 0x6003, 0x0001, 0x6007,
-	0x0001, 0x080c, 0x67ee, 0x0010, 0x080c, 0x87bd, 0x0005, 0x2011,
-	0xad20, 0x2204, 0xa086, 0x0004, 0x1138, 0x2001, 0x0007, 0x080c,
-	0x4c30, 0x080c, 0x8078, 0x0010, 0x080c, 0x87bd, 0x0005, 0x000b,
-	0x0005, 0x86b9, 0x8854, 0x86b9, 0x888a, 0x86b9, 0x88ff, 0x884d,
-	0x86b9, 0x86b9, 0x8912, 0x86b9, 0x8922, 0x6604, 0xa6b6, 0x001e,
-	0x1110, 0x080c, 0x8078, 0x0005, 0x00d6, 0x00c6, 0x080c, 0x8932,
-	0x1178, 0x2001, 0x0000, 0x080c, 0x4c1e, 0x2001, 0x0002, 0x080c,
-	0x4c30, 0x6003, 0x0001, 0x6007, 0x0002, 0x080c, 0x67ee, 0x00f8,
-	0x2009, 0xb28e, 0x2104, 0xa086, 0x0009, 0x1160, 0x6018, 0x2068,
-	0x6840, 0xa084, 0x00ff, 0xa005, 0x0180, 0x8001, 0x6842, 0x6017,
-	0x000a, 0x0068, 0x2009, 0xb28f, 0x2104, 0xa084, 0xff00, 0xa086,
-	0x1900, 0x1118, 0x080c, 0x8078, 0x0010, 0x080c, 0x87bd, 0x00ce,
-	0x00de, 0x0005, 0x080c, 0x8940, 0x00d6, 0x2069, 0xaf9d, 0x2d04,
-	0xa005, 0x0168, 0x6018, 0x2068, 0x68a0, 0xa086, 0x007e, 0x1138,
-	0x2069, 0xad1c, 0x2d04, 0x8000, 0x206a, 0x00de, 0x0010, 0x00de,
-	0x0078, 0x2001, 0x0000, 0x080c, 0x4c1e, 0x2001, 0x0002, 0x080c,
-	0x4c30, 0x6003, 0x0001, 0x6007, 0x0002, 0x080c, 0x67ee, 0x0428,
-	0x080c, 0x85f3, 0x2009, 0xb28e, 0x2134, 0xa6b4, 0x00ff, 0xa686,
-	0x0005, 0x01e0, 0xa686, 0x000b, 0x01b0, 0x2009, 0xb28f, 0x2104,
-	0xa084, 0xff00, 0x1118, 0xa686, 0x0009, 0x0180, 0xa086, 0x1900,
-	0x1150, 0xa686, 0x0009, 0x0150, 0x2001, 0x0004, 0x080c, 0x4c30,
-	0x080c, 0x8078, 0x0010, 0x080c, 0x87bd, 0x0005, 0x00d6, 0x6010,
-	0x2068, 0x080c, 0x9596, 0x0128, 0x6838, 0xd0fc, 0x0110, 0x00de,
-	0x0c90, 0x6018, 0x2068, 0x6840, 0xa084, 0x00ff, 0xa005, 0x0140,
-	0x8001, 0x6842, 0x6017, 0x000a, 0x6007, 0x0016, 0x00de, 0x0c28,
-	0x68a0, 0xa086, 0x007e, 0x1138, 0x00e6, 0x2071, 0xad00, 0x080c,
-	0x48f5, 0x00ee, 0x0010, 0x080c, 0x2ad9, 0x00de, 0x08a0, 0x080c,
-	0x8940, 0x1158, 0x2001, 0x0004, 0x080c, 0x4c30, 0x6003, 0x0001,
-	0x6007, 0x0003, 0x080c, 0x67ee, 0x0020, 0x080c, 0x85f3, 0x080c,
-	0x87bd, 0x0005, 0x0469, 0x1158, 0x2001, 0x0008, 0x080c, 0x4c30,
-	0x6003, 0x0001, 0x6007, 0x0005, 0x080c, 0x67ee, 0x0010, 0x080c,
-	0x87bd, 0x0005, 0x00e9, 0x1158, 0x2001, 0x000a, 0x080c, 0x4c30,
-	0x6003, 0x0001, 0x6007, 0x0001, 0x080c, 0x67ee, 0x0010, 0x080c,
-	0x87bd, 0x0005, 0x2009, 0xb28e, 0x2104, 0xa086, 0x0003, 0x1138,
-	0x2009, 0xb28f, 0x2104, 0xa084, 0xff00, 0xa086, 0x2a00, 0x0005,
-	0xa085, 0x0001, 0x0005, 0x00c6, 0x0016, 0xac88, 0x0006, 0x2164,
-	0x080c, 0x4ceb, 0x001e, 0x00ce, 0x0005, 0x00f6, 0x00e6, 0x00d6,
-	0x0036, 0x0016, 0x6018, 0x2068, 0x2071, 0xad34, 0x2e04, 0xa085,
-	0x0003, 0x2072, 0x080c, 0x89cc, 0x0538, 0x2001, 0xad52, 0x2004,
-	0xd0a4, 0x0158, 0xa006, 0x2020, 0x2009, 0x002a, 0x080c, 0xa96c,
-	0x2001, 0xad0c, 0x200c, 0xc195, 0x2102, 0x2019, 0x002a, 0x2009,
-	0x0001, 0x080c, 0x2aac, 0x2071, 0xad00, 0x080c, 0x28fa, 0x00c6,
-	0x0156, 0x20a9, 0x0081, 0x2009, 0x007f, 0x080c, 0x2bc9, 0x8108,
-	0x1f04, 0x897d, 0x015e, 0x00ce, 0x080c, 0x8943, 0x6813, 0x00ff,
-	0x6817, 0xfffe, 0x2071, 0xb280, 0x2079, 0x0100, 0x2e04, 0xa084,
-	0x00ff, 0x2069, 0xad1b, 0x206a, 0x78e6, 0x0006, 0x8e70, 0x2e04,
-	0x2069, 0xad1c, 0x206a, 0x78ea, 0x7832, 0x7836, 0x2010, 0xa084,
-	0xff00, 0x001e, 0xa105, 0x2009, 0xad27, 0x200a, 0x2200, 0xa084,
-	0x00ff, 0x2008, 0x080c, 0x26a0, 0x080c, 0x574f, 0x0170, 0x2069,
-	0xb28e, 0x2071, 0xaf9f, 0x6810, 0x2072, 0x6814, 0x7006, 0x6818,
-	0x700a, 0x681c, 0x700e, 0x080c, 0x9903, 0x0040, 0x2001, 0x0006,
-	0x080c, 0x4c30, 0x080c, 0x2aff, 0x080c, 0x8078, 0x001e, 0x003e,
-	0x00de, 0x00ee, 0x00fe, 0x0005, 0x0026, 0x0036, 0x00e6, 0x0156,
-	0x2019, 0xad27, 0x231c, 0x83ff, 0x01e8, 0x2071, 0xb280, 0x2e14,
-	0xa294, 0x00ff, 0x7004, 0xa084, 0xff00, 0xa205, 0xa306, 0x1190,
-	0x2011, 0xb296, 0xad98, 0x000a, 0x20a9, 0x0004, 0x080c, 0x8a7c,
-	0x1148, 0x2011, 0xb29a, 0xad98, 0x0006, 0x20a9, 0x0004, 0x080c,
-	0x8a7c, 0x1100, 0x015e, 0x00ee, 0x003e, 0x002e, 0x0005, 0x00e6,
-	0x2071, 0xb28c, 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, 0xafd0, 0x252c, 0x2021, 0xafd6, 0x2424, 0x2061, 0xb400,
-	0x2071, 0xad00, 0x7244, 0x7064, 0xa202, 0x16f0, 0x080c, 0xa990,
-	0x05a0, 0x671c, 0xa786, 0x0001, 0x0580, 0xa786, 0x0007, 0x0568,
-	0x2500, 0xac06, 0x0550, 0x2400, 0xac06, 0x0538, 0x00c6, 0x6000,
-	0xa086, 0x0004, 0x1110, 0x080c, 0x190b, 0xa786, 0x0008, 0x1148,
-	0x080c, 0x9789, 0x1130, 0x00ce, 0x080c, 0x85f3, 0x080c, 0x974e,
-	0x00a0, 0x6010, 0x2068, 0x080c, 0x9596, 0x0160, 0xa786, 0x0003,
-	0x11e8, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x080c, 0x510c,
-	0x080c, 0x9742, 0x080c, 0x974e, 0x00ce, 0xace0, 0x0018, 0x7058,
-	0xac02, 0x1210, 0x0804, 0x8a2a, 0x012e, 0x000e, 0x002e, 0x004e,
-	0x005e, 0x007e, 0x00ce, 0x00de, 0x00ee, 0x0005, 0xa786, 0x0006,
-	0x1d00, 0x080c, 0xa91f, 0x0c30, 0x220c, 0x2304, 0xa106, 0x1130,
-	0x8210, 0x8318, 0x1f04, 0x8a7c, 0xa006, 0x0005, 0x2304, 0xa102,
-	0x0218, 0x2001, 0x0001, 0x0010, 0x2001, 0x0000, 0xa18d, 0x0001,
-	0x0005, 0x6004, 0xa08a, 0x0080, 0x1a0c, 0x14f6, 0x080c, 0x9778,
-	0x0120, 0x080c, 0x9789, 0x0168, 0x0028, 0x080c, 0x2aff, 0x080c,
-	0x9789, 0x0138, 0x080c, 0x6b73, 0x080c, 0x8078, 0x080c, 0x6c50,
-	0x0005, 0x080c, 0x85f3, 0x0cb0, 0xa182, 0x0040, 0x0002, 0x8ac2,
-	0x8ac2, 0x8ac2, 0x8ac2, 0x8ac2, 0x8ac2, 0x8ac2, 0x8ac2, 0x8ac2,
-	0x8ac2, 0x8ac2, 0x8ac4, 0x8ac4, 0x8ac4, 0x8ac4, 0x8ac2, 0x8ac2,
-	0x8ac2, 0x8ac4, 0x080c, 0x14f6, 0x600b, 0xffff, 0x6003, 0x0001,
-	0x6106, 0x080c, 0x67a8, 0x0126, 0x2091, 0x8000, 0x080c, 0x6c50,
-	0x012e, 0x0005, 0xa186, 0x0013, 0x1128, 0x6004, 0xa082, 0x0040,
-	0x0804, 0x8b5e, 0xa186, 0x0027, 0x11e8, 0x080c, 0x6b73, 0x080c,
-	0x2ad9, 0x00d6, 0x6110, 0x2168, 0x080c, 0x9596, 0x0168, 0x6837,
-	0x0103, 0x684b, 0x0029, 0x6847, 0x0000, 0x694c, 0xc1c5, 0x694e,
-	0x080c, 0x510c, 0x080c, 0x9742, 0x00de, 0x080c, 0x8078, 0x080c,
-	0x6c50, 0x0005, 0xa186, 0x0014, 0x1120, 0x6004, 0xa082, 0x0040,
-	0x0428, 0xa186, 0x0046, 0x0138, 0xa186, 0x0045, 0x0120, 0xa186,
-	0x0047, 0x190c, 0x14f6, 0x2001, 0x0109, 0x2004, 0xd084, 0x0198,
-	0x0126, 0x2091, 0x2800, 0x0006, 0x0016, 0x0026, 0x080c, 0x6699,
-	0x002e, 0x001e, 0x000e, 0x012e, 0xe000, 0x6000, 0xa086, 0x0002,
-	0x1110, 0x0804, 0x8b98, 0x080c, 0x80be, 0x0005, 0x0002, 0x8b3c,
-	0x8b3a, 0x8b3a, 0x8b3a, 0x8b3a, 0x8b3a, 0x8b3a, 0x8b3a, 0x8b3a,
-	0x8b3a, 0x8b3a, 0x8b57, 0x8b57, 0x8b57, 0x8b57, 0x8b3a, 0x8b57,
-	0x8b3a, 0x8b57, 0x080c, 0x14f6, 0x080c, 0x6b73, 0x00d6, 0x6110,
-	0x2168, 0x080c, 0x9596, 0x0168, 0x6837, 0x0103, 0x684b, 0x0006,
-	0x6847, 0x0000, 0x6850, 0xc0ec, 0x6852, 0x080c, 0x510c, 0x080c,
-	0x9742, 0x00de, 0x080c, 0x8078, 0x080c, 0x6c50, 0x0005, 0x080c,
-	0x6b73, 0x080c, 0x8078, 0x080c, 0x6c50, 0x0005, 0x0002, 0x8b74,
-	0x8b72, 0x8b72, 0x8b72, 0x8b72, 0x8b72, 0x8b72, 0x8b72, 0x8b72,
-	0x8b72, 0x8b72, 0x8b86, 0x8b86, 0x8b86, 0x8b86, 0x8b72, 0x8b91,
-	0x8b72, 0x8b86, 0x080c, 0x14f6, 0x080c, 0x6b73, 0x2001, 0xafa5,
-	0x2004, 0x603e, 0x6003, 0x0002, 0x080c, 0x6c50, 0x6010, 0xa088,
-	0x0013, 0x2104, 0xa085, 0x0400, 0x200a, 0x0005, 0x080c, 0x6b73,
-	0x2001, 0xafa5, 0x2004, 0x603e, 0x6003, 0x000f, 0x080c, 0x6c50,
-	0x0005, 0x080c, 0x6b73, 0x080c, 0x8078, 0x080c, 0x6c50, 0x0005,
-	0xa182, 0x0040, 0x0002, 0x8bae, 0x8bae, 0x8bae, 0x8bae, 0x8bae,
-	0x8bb0, 0x8c88, 0x8ca9, 0x8bae, 0x8bae, 0x8bae, 0x8bae, 0x8bae,
-	0x8bae, 0x8bae, 0x8bae, 0x8bae, 0x8bae, 0x8bae, 0x080c, 0x14f6,
-	0x00e6, 0x00d6, 0x603f, 0x0000, 0x2071, 0xb280, 0x7124, 0x610a,
-	0x2071, 0xb28c, 0x6110, 0x2168, 0x7614, 0xa6b4, 0x0fff, 0x86ff,
-	0x0904, 0x8c54, 0xa68c, 0x0c00, 0x01e8, 0x00f6, 0x2c78, 0x080c,
-	0x5029, 0x00fe, 0x0198, 0x684c, 0xd0ac, 0x0180, 0x6020, 0xd0dc,
-	0x1168, 0x6850, 0xd0bc, 0x1150, 0x7318, 0x6814, 0xa306, 0x1904,
-	0x8c66, 0x731c, 0x6810, 0xa306, 0x1904, 0x8c66, 0x7318, 0x6b62,
-	0x731c, 0x6b5e, 0xa68c, 0x00ff, 0xa186, 0x0002, 0x0518, 0xa186,
-	0x0028, 0x1128, 0x080c, 0x9767, 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, 0xb299, 0x2004,
-	0xa005, 0x1118, 0xc6c4, 0x0804, 0x8bbf, 0x7328, 0x732c, 0x6b56,
-	0x83ff, 0x0170, 0xa38a, 0x0009, 0x0210, 0x2019, 0x0008, 0x0036,
-	0x2308, 0x2019, 0xb298, 0xad90, 0x0019, 0x080c, 0x927f, 0x003e,
-	0xd6cc, 0x0904, 0x8c79, 0x7124, 0x695a, 0x81ff, 0x0904, 0x8c79,
-	0xa192, 0x0021, 0x1250, 0x2071, 0xb298, 0x831c, 0x2300, 0xae18,
-	0xad90, 0x001d, 0x080c, 0x927f, 0x04a0, 0x6838, 0xd0fc, 0x0120,
-	0x2009, 0x0020, 0x695a, 0x0c78, 0x00f6, 0x2d78, 0x080c, 0x9224,
-	0x00fe, 0x080c, 0x926f, 0x0438, 0x00f6, 0x2c78, 0x080c, 0x5029,
-	0x00fe, 0x0188, 0x684c, 0xd0ac, 0x0170, 0x6020, 0xd0dc, 0x1158,
-	0x6850, 0xd0bc, 0x1140, 0x684c, 0xd0f4, 0x1128, 0x080c, 0x9866,
-	0x00de, 0x00ee, 0x00e0, 0x684b, 0x0000, 0x6837, 0x0103, 0x6e46,
-	0x684c, 0xd0ac, 0x0130, 0x6810, 0x6914, 0xa115, 0x0110, 0x080c,
-	0x8e04, 0x080c, 0x510c, 0x6218, 0x2268, 0x6a3c, 0x8211, 0x6a3e,
-	0x080c, 0x9834, 0x00de, 0x00ee, 0x1110, 0x080c, 0x8078, 0x0005,
-	0x00f6, 0x6003, 0x0003, 0x2079, 0xb28c, 0x7c04, 0x7b00, 0x7e0c,
-	0x7d08, 0x6010, 0x2078, 0x784c, 0xd0ac, 0x0120, 0x6003, 0x0002,
-	0x00fe, 0x0005, 0x7c12, 0x7b16, 0x7e0a, 0x7d0e, 0x00fe, 0x603f,
-	0x0000, 0x2c10, 0x080c, 0x1e6e, 0x080c, 0x680b, 0x080c, 0x6d0d,
-	0x0005, 0x2001, 0xafa5, 0x2004, 0x603e, 0x6003, 0x0004, 0x6110,
-	0x20e1, 0x0005, 0x3d18, 0x3e20, 0x2c10, 0x080c, 0x1824, 0x0005,
-	0xa182, 0x0040, 0x0002, 0x8cce, 0x8cce, 0x8cce, 0x8cce, 0x8cce,
-	0x8cd0, 0x8d61, 0x8cce, 0x8cce, 0x8d77, 0x8ddb, 0x8cce, 0x8cce,
-	0x8cce, 0x8cce, 0x8dea, 0x8cce, 0x8cce, 0x8cce, 0x080c, 0x14f6,
-	0x0076, 0x00f6, 0x00e6, 0x00d6, 0x2071, 0xb28c, 0x6110, 0x2178,
-	0x7614, 0xa6b4, 0x0fff, 0x7e46, 0x7f4c, 0xc7e5, 0x7f4e, 0x6218,
-	0x2268, 0x6a3c, 0x8211, 0x6a3e, 0x86ff, 0x0904, 0x8d5c, 0xa694,
-	0xff00, 0xa284, 0x0c00, 0x0120, 0x7018, 0x7862, 0x701c, 0x785e,
-	0xa284, 0x0300, 0x0904, 0x8d5c, 0x080c, 0x15d9, 0x090c, 0x14f6,
-	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, 0xb298, 0xad90, 0x0019, 0x080c, 0x927f, 0x003e, 0xd6cc,
-	0x01d8, 0x7124, 0x695a, 0x81ff, 0x01b8, 0xa192, 0x0021, 0x1250,
-	0x2071, 0xb298, 0x831c, 0x2300, 0xae18, 0xad90, 0x001d, 0x080c,
-	0x927f, 0x0050, 0x7838, 0xd0fc, 0x0120, 0x2009, 0x0020, 0x695a,
-	0x0c78, 0x2d78, 0x080c, 0x9224, 0x00de, 0x00ee, 0x00fe, 0x007e,
-	0x0005, 0x00f6, 0x6003, 0x0003, 0x2079, 0xb28c, 0x7c04, 0x7b00,
-	0x7e0c, 0x7d08, 0x6010, 0x2078, 0x7c12, 0x7b16, 0x7e0a, 0x7d0e,
-	0x00fe, 0x2c10, 0x080c, 0x1e6e, 0x080c, 0x781a, 0x0005, 0x00d6,
-	0x00f6, 0x2c78, 0x080c, 0x5029, 0x00fe, 0x0120, 0x2001, 0xafa5,
-	0x2004, 0x603e, 0x6003, 0x0002, 0x080c, 0x6c05, 0x080c, 0x6d0d,
-	0x6110, 0x2168, 0x694c, 0xd1e4, 0x0904, 0x8dd9, 0xd1cc, 0x0540,
-	0x6948, 0x6838, 0xd0fc, 0x01e8, 0x0016, 0x684c, 0x0006, 0x6850,
-	0x0006, 0xad90, 0x000d, 0xa198, 0x000d, 0x2009, 0x0020, 0x0156,
-	0x21a8, 0x2304, 0x2012, 0x8318, 0x8210, 0x1f04, 0x8da1, 0x015e,
-	0x000e, 0x6852, 0x000e, 0x684e, 0x001e, 0x2168, 0x080c, 0x1600,
-	0x0418, 0x0016, 0x080c, 0x1600, 0x00de, 0x080c, 0x926f, 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, 0x510c, 0x080c, 0x9834, 0x1110, 0x080c,
-	0x8078, 0x00de, 0x0005, 0x2019, 0x0001, 0x080c, 0x7a64, 0x6003,
-	0x0002, 0x2001, 0xafa5, 0x2004, 0x603e, 0x080c, 0x6c05, 0x080c,
-	0x6d0d, 0x0005, 0x080c, 0x6c05, 0x080c, 0x2ad9, 0x00d6, 0x6110,
-	0x2168, 0x080c, 0x9596, 0x0150, 0x6837, 0x0103, 0x684b, 0x0029,
-	0x6847, 0x0000, 0x080c, 0x510c, 0x080c, 0x9742, 0x00de, 0x080c,
-	0x8078, 0x080c, 0x6d0d, 0x0005, 0x684b, 0x0015, 0xd1fc, 0x0138,
-	0x684b, 0x0007, 0x8002, 0x8000, 0x810a, 0xa189, 0x0000, 0x6962,
-	0x685e, 0x0005, 0xa182, 0x0040, 0x0002, 0x8e28, 0x8e28, 0x8e28,
-	0x8e28, 0x8e28, 0x8e2a, 0x8e28, 0x8ee3, 0x8eef, 0x8e28, 0x8e28,
-	0x8e28, 0x8e28, 0x8e28, 0x8e28, 0x8e28, 0x8e28, 0x8e28, 0x8e28,
-	0x080c, 0x14f6, 0x0076, 0x00f6, 0x00e6, 0x00d6, 0x2071, 0xb28c,
-	0x6110, 0x2178, 0x7614, 0xa6b4, 0x0fff, 0x00f6, 0x2c78, 0x080c,
-	0x5029, 0x00fe, 0x0150, 0xa684, 0x00ff, 0x1138, 0x6020, 0xd0f4,
-	0x0120, 0x080c, 0x9866, 0x0804, 0x8ede, 0x7e46, 0x7f4c, 0xc7e5,
-	0x7f4e, 0x6218, 0x2268, 0x6a3c, 0x8211, 0x6a3e, 0x86ff, 0x0904,
-	0x8ed4, 0xa694, 0xff00, 0xa284, 0x0c00, 0x0120, 0x7018, 0x7862,
-	0x701c, 0x785e, 0xa284, 0x0300, 0x0904, 0x8ed2, 0xa686, 0x0100,
-	0x1140, 0x2001, 0xb299, 0x2004, 0xa005, 0x1118, 0xc6c4, 0x7e46,
-	0x0c28, 0x080c, 0x15d9, 0x090c, 0x14f6, 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, 0xb298,
-	0xad90, 0x0019, 0x080c, 0x927f, 0x003e, 0xd6cc, 0x01d8, 0x7124,
-	0x695a, 0x81ff, 0x01b8, 0xa192, 0x0021, 0x1250, 0x2071, 0xb298,
-	0x831c, 0x2300, 0xae18, 0xad90, 0x001d, 0x080c, 0x927f, 0x0050,
-	0x7838, 0xd0fc, 0x0120, 0x2009, 0x0020, 0x695a, 0x0c78, 0x2d78,
-	0x080c, 0x9224, 0xd6dc, 0x1110, 0xa006, 0x0030, 0x2001, 0x0001,
-	0x2071, 0xb28c, 0x7218, 0x731c, 0x080c, 0x186f, 0x00de, 0x00ee,
-	0x00fe, 0x007e, 0x0005, 0x2001, 0xafa5, 0x2004, 0x603e, 0x20e1,
-	0x0005, 0x3d18, 0x3e20, 0x2c10, 0x080c, 0x1824, 0x0005, 0x2001,
-	0xafa5, 0x2004, 0x603e, 0x00d6, 0x6003, 0x0002, 0x6110, 0x2168,
-	0x694c, 0xd1e4, 0x0904, 0x8ff3, 0x603f, 0x0000, 0x00f6, 0x2c78,
-	0x080c, 0x5029, 0x00fe, 0x0548, 0x6814, 0x6910, 0xa115, 0x0528,
-	0x6a60, 0xa206, 0x1118, 0x685c, 0xa106, 0x01f8, 0x684c, 0xc0e4,
-	0x684e, 0x6847, 0x0000, 0x6863, 0x0000, 0x685f, 0x0000, 0x697c,
-	0x6810, 0xa102, 0x603a, 0x6980, 0x6814, 0xa103, 0x6036, 0x6020,
-	0xc0f5, 0x6022, 0x00d6, 0x6018, 0x2068, 0x683c, 0x8000, 0x683e,
-	0x00de, 0x080c, 0x9866, 0x0804, 0x8ff3, 0x694c, 0xd1cc, 0x0904,
-	0x8fc3, 0x6948, 0x6838, 0xd0fc, 0x0904, 0x8f88, 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, 0x99ee, 0x0118, 0x7944, 0xc1dc, 0x7946, 0x0080,
-	0xd1d4, 0x0128, 0x684b, 0x0007, 0x784b, 0x0007, 0x0048, 0x684c,
-	0xd0ac, 0x0130, 0x6810, 0x6914, 0xa115, 0x0110, 0x080c, 0x8e04,
-	0x6848, 0x784a, 0x6860, 0x7862, 0x685c, 0x785e, 0xad90, 0x000d,
-	0xaf98, 0x000d, 0x2009, 0x0020, 0x0156, 0x21a8, 0x2304, 0x2012,
-	0x8318, 0x8210, 0x1f04, 0x8f76, 0x015e, 0x00fe, 0x000e, 0x6852,
-	0x000e, 0x684e, 0x001e, 0x2168, 0x080c, 0x1600, 0x0804, 0x8fee,
-	0x0016, 0x00f6, 0x2178, 0x7944, 0xa184, 0x00ff, 0xa0b6, 0x0002,
-	0x01e0, 0xa086, 0x0028, 0x1128, 0x684b, 0x001c, 0x784b, 0x001c,
-	0x00e8, 0xd1dc, 0x0158, 0x684b, 0x0015, 0x784b, 0x0015, 0x080c,
-	0x99ee, 0x0118, 0x7944, 0xc1dc, 0x7946, 0x0080, 0xd1d4, 0x0128,
-	0x684b, 0x0007, 0x784b, 0x0007, 0x0048, 0x684c, 0xd0ac, 0x0130,
-	0x6810, 0x6914, 0xa115, 0x0110, 0x080c, 0x8e04, 0x6860, 0x7862,
-	0x685c, 0x785e, 0x684c, 0x784e, 0x00fe, 0x080c, 0x1600, 0x00de,
-	0x080c, 0x926f, 0x0458, 0x6837, 0x0103, 0x6944, 0xa184, 0x00ff,
-	0xa0b6, 0x0002, 0x01b0, 0xa086, 0x0028, 0x1118, 0x684b, 0x001c,
-	0x00d8, 0xd1dc, 0x0148, 0x684b, 0x0015, 0x080c, 0x99ee, 0x0118,
-	0x6944, 0xc1dc, 0x6946, 0x0080, 0xd1d4, 0x0118, 0x684b, 0x0007,
-	0x0058, 0x684b, 0x0000, 0x684c, 0xd0ac, 0x0130, 0x6810, 0x6914,
-	0xa115, 0x0110, 0x080c, 0x8e04, 0x080c, 0x510c, 0x080c, 0x9834,
-	0x1110, 0x080c, 0x8078, 0x00de, 0x0005, 0x080c, 0x6b73, 0x0010,
-	0x080c, 0x6c05, 0x080c, 0x9596, 0x01c0, 0x00d6, 0x6110, 0x2168,
-	0x6837, 0x0103, 0x2009, 0xad0c, 0x210c, 0xd18c, 0x11c0, 0xd184,
-	0x1198, 0x6108, 0x694a, 0xa18e, 0x0029, 0x1110, 0x080c, 0xabfa,
-	0x6847, 0x0000, 0x080c, 0x510c, 0x00de, 0x080c, 0x8078, 0x080c,
-	0x6c50, 0x080c, 0x6d0d, 0x0005, 0x684b, 0x0004, 0x0c88, 0x684b,
-	0x0004, 0x0c70, 0xa182, 0x0040, 0x0002, 0x9038, 0x9038, 0x9038,
-	0x9038, 0x9038, 0x903a, 0x9038, 0x903d, 0x9038, 0x9038, 0x9038,
-	0x9038, 0x9038, 0x9038, 0x9038, 0x9038, 0x9038, 0x9038, 0x9038,
-	0x080c, 0x14f6, 0x080c, 0x8078, 0x0005, 0x0006, 0x0026, 0xa016,
-	0x080c, 0x1824, 0x002e, 0x000e, 0x0005, 0xa182, 0x0085, 0x0002,
-	0x9051, 0x904f, 0x904f, 0x905d, 0x904f, 0x904f, 0x904f, 0x080c,
-	0x14f6, 0x6003, 0x0001, 0x6106, 0x080c, 0x67a8, 0x0126, 0x2091,
-	0x8000, 0x080c, 0x6c50, 0x012e, 0x0005, 0x0026, 0x0056, 0x00d6,
-	0x00e6, 0x2071, 0xb280, 0x7224, 0x6212, 0x7220, 0x080c, 0x9586,
-	0x01a0, 0x2268, 0x6800, 0xa086, 0x0000, 0x0178, 0x6018, 0x6d18,
-	0xa52e, 0x1158, 0x00c6, 0x2d60, 0x080c, 0x928f, 0x00ce, 0x0128,
-	0x6803, 0x0002, 0x6007, 0x0086, 0x0010, 0x6007, 0x0087, 0x6003,
-	0x0001, 0x080c, 0x67a8, 0x080c, 0x6c50, 0x00f6, 0x2278, 0x080c,
-	0x5029, 0x00fe, 0x0150, 0x6820, 0xd0ec, 0x0138, 0x00c6, 0x2260,
-	0x603f, 0x0000, 0x080c, 0x9866, 0x00ce, 0x00ee, 0x00de, 0x005e,
-	0x002e, 0x0005, 0xa186, 0x0013, 0x1160, 0x6004, 0xa08a, 0x0085,
-	0x0a0c, 0x14f6, 0xa08a, 0x008c, 0x1a0c, 0x14f6, 0xa082, 0x0085,
-	0x0072, 0xa186, 0x0027, 0x0120, 0xa186, 0x0014, 0x190c, 0x14f6,
-	0x080c, 0x6b73, 0x080c, 0x974e, 0x080c, 0x6c50, 0x0005, 0x90be,
-	0x90c0, 0x90c0, 0x90be, 0x90be, 0x90be, 0x90be, 0x080c, 0x14f6,
-	0x080c, 0x6b73, 0x080c, 0x974e, 0x080c, 0x6c50, 0x0005, 0xa186,
-	0x0013, 0x1128, 0x6004, 0xa082, 0x0085, 0x2008, 0x04a8, 0xa186,
-	0x0027, 0x11e8, 0x080c, 0x6b73, 0x080c, 0x2ad9, 0x00d6, 0x6010,
-	0x2068, 0x080c, 0x9596, 0x0150, 0x6837, 0x0103, 0x6847, 0x0000,
-	0x684b, 0x0029, 0x080c, 0x510c, 0x080c, 0x9742, 0x00de, 0x080c,
-	0x8078, 0x080c, 0x6c50, 0x0005, 0x080c, 0x80be, 0x0ce0, 0xa186,
-	0x0014, 0x1dd0, 0x080c, 0x6b73, 0x00d6, 0x6010, 0x2068, 0x080c,
-	0x9596, 0x0d60, 0x6837, 0x0103, 0x6847, 0x0000, 0x684b, 0x0006,
-	0x6850, 0xc0ec, 0x6852, 0x08f0, 0x0002, 0x910e, 0x910c, 0x910c,
-	0x910c, 0x910c, 0x910c, 0x9126, 0x080c, 0x14f6, 0x080c, 0x6b73,
-	0x6030, 0xa08c, 0xff00, 0x810f, 0xa186, 0x0039, 0x0118, 0xa186,
-	0x0035, 0x1118, 0x2001, 0xafa3, 0x0010, 0x2001, 0xafa4, 0x2004,
-	0x6016, 0x6003, 0x000c, 0x080c, 0x6c50, 0x0005, 0x080c, 0x6b73,
-	0x6030, 0xa08c, 0xff00, 0x810f, 0xa186, 0x0039, 0x0118, 0xa186,
-	0x0035, 0x1118, 0x2001, 0xafa3, 0x0010, 0x2001, 0xafa4, 0x2004,
-	0x6016, 0x6003, 0x000e, 0x080c, 0x6c50, 0x0005, 0xa182, 0x008c,
-	0x1220, 0xa182, 0x0085, 0x0208, 0x001a, 0x080c, 0x80be, 0x0005,
-	0x914f, 0x914f, 0x914f, 0x914f, 0x9151, 0x91a4, 0x914f, 0x080c,
-	0x14f6, 0x00d6, 0x00f6, 0x2c78, 0x080c, 0x5029, 0x00fe, 0x0168,
-	0x6030, 0xa08c, 0xff00, 0x810f, 0xa186, 0x0039, 0x0118, 0xa186,
-	0x0035, 0x1118, 0x00de, 0x0804, 0x91b7, 0x080c, 0x9742, 0x080c,
-	0x9596, 0x01c8, 0x6010, 0x2068, 0x6837, 0x0103, 0x6850, 0xd0b4,
-	0x0128, 0x684b, 0x0006, 0xc0ec, 0x6852, 0x0048, 0xd0bc, 0x0118,
-	0x684b, 0x0002, 0x0020, 0x684b, 0x0005, 0x080c, 0x9803, 0x6847,
-	0x0000, 0x080c, 0x510c, 0x2c68, 0x080c, 0x8022, 0x01c0, 0x6003,
-	0x0001, 0x6007, 0x001e, 0x600b, 0xffff, 0x2009, 0xb28e, 0x210c,
-	0x6136, 0x2009, 0xb28f, 0x210c, 0x613a, 0x6918, 0x611a, 0x080c,
-	0x9956, 0x6950, 0x6152, 0x601f, 0x0001, 0x080c, 0x67a8, 0x2d60,
-	0x080c, 0x8078, 0x00de, 0x0005, 0x00f6, 0x2c78, 0x080c, 0x5029,
-	0x00fe, 0x0598, 0x6030, 0xa08c, 0xff00, 0x810f, 0xa186, 0x0035,
-	0x0130, 0xa186, 0x001e, 0x0118, 0xa186, 0x0039, 0x1530, 0x00d6,
-	0x2c68, 0x080c, 0x9a34, 0x1904, 0x91fc, 0x080c, 0x8022, 0x01d8,
-	0x6106, 0x6003, 0x0001, 0x601f, 0x0001, 0x6918, 0x611a, 0x6928,
-	0x612a, 0x692c, 0x612e, 0x6930, 0xa18c, 0x00ff, 0x6132, 0x6934,
-	0x6136, 0x6938, 0x613a, 0x6950, 0x6152, 0x080c, 0x9956, 0x080c,
-	0x67a8, 0x080c, 0x6c50, 0x2d60, 0x00f8, 0x00d6, 0x6010, 0x2068,
-	0x080c, 0x9596, 0x01c8, 0x6837, 0x0103, 0x6850, 0xd0b4, 0x0128,
-	0xc0ec, 0x6852, 0x684b, 0x0006, 0x0048, 0xd0bc, 0x0118, 0x684b,
-	0x0002, 0x0020, 0x684b, 0x0005, 0x080c, 0x9803, 0x6847, 0x0000,
-	0x080c, 0x510c, 0x080c, 0x9742, 0x00de, 0x080c, 0x8078, 0x0005,
-	0x0016, 0x00d6, 0x6010, 0x2068, 0x080c, 0x9596, 0x0140, 0x6837,
-	0x0103, 0x684b, 0x0028, 0x6847, 0x0000, 0x080c, 0x510c, 0x00de,
-	0x001e, 0xa186, 0x0013, 0x0148, 0xa186, 0x0014, 0x0130, 0xa186,
-	0x0027, 0x0118, 0x080c, 0x80be, 0x0030, 0x080c, 0x6b73, 0x080c,
-	0x974e, 0x080c, 0x6c50, 0x0005, 0x0056, 0x0066, 0x00d6, 0x00f6,
-	0x2029, 0x0001, 0xa182, 0x0101, 0x1208, 0x0010, 0x2009, 0x0100,
-	0x2130, 0x2069, 0xb298, 0x831c, 0x2300, 0xad18, 0x2009, 0x0020,
-	0xaf90, 0x001d, 0x080c, 0x927f, 0xa6b2, 0x0020, 0x7804, 0xa06d,
-	0x0110, 0x080c, 0x1600, 0x080c, 0x15d9, 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,
-	0x510c, 0x2f68, 0x0cb8, 0x080c, 0x510c, 0x00fe, 0x0005, 0x0156,
-	0xa184, 0x0001, 0x0108, 0x8108, 0x810c, 0x21a8, 0x2304, 0x8007,
-	0x2012, 0x8318, 0x8210, 0x1f04, 0x9286, 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, 0x92c3, 0x92c3, 0x92be, 0x92e5, 0x92b1, 0x92be, 0x92e5,
-	0x92be, 0x080c, 0x14f6, 0x0036, 0x2019, 0x0010, 0x080c, 0xa566,
-	0x601f, 0x0006, 0x6003, 0x0007, 0x003e, 0x0005, 0xa006, 0x0005,
-	0xa085, 0x0001, 0x0005, 0x00d6, 0x86ff, 0x11d8, 0x6010, 0x2068,
-	0x080c, 0x9596, 0x01c0, 0x6834, 0xa086, 0x0139, 0x1128, 0x684b,
-	0x0005, 0x6853, 0x0000, 0x0028, 0xa00e, 0x2001, 0x0005, 0x080c,
-	0x51df, 0x080c, 0x9803, 0x080c, 0x510c, 0x080c, 0x8078, 0xa085,
-	0x0001, 0x00de, 0x0005, 0xa006, 0x0ce0, 0x6000, 0xa08a, 0x0010,
-	0x1a0c, 0x14f6, 0x000b, 0x0005, 0x92fc, 0x9319, 0x92fe, 0x9338,
-	0x9316, 0x92fc, 0x92be, 0x92c3, 0x92c3, 0x92be, 0x92be, 0x92be,
-	0x92be, 0x92be, 0x92be, 0x92be, 0x080c, 0x14f6, 0x86ff, 0x1198,
-	0x00d6, 0x6010, 0x2068, 0x080c, 0x9596, 0x0110, 0x080c, 0x9803,
-	0x00de, 0x6007, 0x0085, 0x6003, 0x000b, 0x601f, 0x0002, 0x080c,
-	0x67a8, 0x080c, 0x6c50, 0xa085, 0x0001, 0x0005, 0x080c, 0x190b,
-	0x0c28, 0x00e6, 0x2071, 0xafc7, 0x7024, 0xac06, 0x1110, 0x080c,
-	0x79e1, 0x601c, 0xa084, 0x000f, 0xa086, 0x0006, 0x1150, 0x0086,
-	0x0096, 0x2049, 0x0001, 0x2c40, 0x080c, 0x7b9a, 0x009e, 0x008e,
-	0x0010, 0x080c, 0x78de, 0x00ee, 0x1948, 0x080c, 0x92be, 0x0005,
-	0x0036, 0x00e6, 0x2071, 0xafc7, 0x703c, 0xac06, 0x1140, 0x2019,
-	0x0000, 0x080c, 0x7a64, 0x00ee, 0x003e, 0x0804, 0x92fe, 0x080c,
-	0x7cb8, 0x00ee, 0x003e, 0x1904, 0x92fe, 0x080c, 0x92be, 0x0005,
-	0x00c6, 0x601c, 0xa084, 0x000f, 0x0013, 0x00ce, 0x0005, 0x9369,
-	0x93d3, 0x9501, 0x9374, 0x974e, 0x9369, 0xa558, 0x8078, 0x93d3,
-	0x9362, 0x955f, 0x080c, 0x14f6, 0x080c, 0x9789, 0x1110, 0x080c,
-	0x85f3, 0x0005, 0x080c, 0x6b73, 0x080c, 0x6c50, 0x080c, 0x8078,
-	0x0005, 0x6017, 0x0001, 0x0005, 0x6010, 0xa080, 0x0019, 0x2c02,
-	0x6000, 0xa08a, 0x0010, 0x1a0c, 0x14f6, 0x000b, 0x0005, 0x938f,
-	0x9391, 0x93b1, 0x93c3, 0x93d0, 0x938f, 0x9369, 0x9369, 0x9369,
-	0x93c3, 0x93c3, 0x938f, 0x938f, 0x938f, 0x938f, 0x93cd, 0x080c,
-	0x14f6, 0x00e6, 0x6010, 0x2070, 0x7050, 0xc0b5, 0x7052, 0x2071,
-	0xafc7, 0x7024, 0xac06, 0x0190, 0x080c, 0x78de, 0x6007, 0x0085,
-	0x6003, 0x000b, 0x601f, 0x0002, 0x2001, 0xafa4, 0x2004, 0x6016,
-	0x080c, 0x67a8, 0x080c, 0x6c50, 0x00ee, 0x0005, 0x6017, 0x0001,
-	0x0cd8, 0x00d6, 0x6010, 0x2068, 0x6850, 0xc0b5, 0x6852, 0x00de,
-	0x6007, 0x0085, 0x6003, 0x000b, 0x601f, 0x0002, 0x080c, 0x67a8,
-	0x080c, 0x6c50, 0x0005, 0x00d6, 0x6017, 0x0001, 0x6010, 0x2068,
-	0x6850, 0xc0b5, 0x6852, 0x00de, 0x0005, 0x080c, 0x8078, 0x0005,
-	0x080c, 0x190b, 0x08f0, 0x6000, 0xa08a, 0x0010, 0x1a0c, 0x14f6,
-	0x000b, 0x0005, 0x93ea, 0x9371, 0x93ec, 0x93ea, 0x93ec, 0x93ec,
-	0x936a, 0x93ea, 0x9364, 0x9364, 0x93ea, 0x93ea, 0x93ea, 0x93ea,
-	0x93ea, 0x93ea, 0x080c, 0x14f6, 0x00d6, 0x6018, 0x2068, 0x6804,
-	0xa084, 0x00ff, 0x00de, 0xa08a, 0x000c, 0x1a0c, 0x14f6, 0x000b,
-	0x0005, 0x9405, 0x94a7, 0x9407, 0x9441, 0x9407, 0x9441, 0x9407,
-	0x9411, 0x9405, 0x9441, 0x9405, 0x942d, 0x080c, 0x14f6, 0x6004,
-	0xa08e, 0x0016, 0x0588, 0xa08e, 0x0004, 0x0570, 0xa08e, 0x0002,
-	0x0558, 0x6004, 0x080c, 0x9789, 0x0904, 0x94c0, 0xa08e, 0x0021,
-	0x0904, 0x94c4, 0xa08e, 0x0022, 0x0904, 0x94c0, 0xa08e, 0x003d,
-	0x0904, 0x94c4, 0xa08e, 0x0039, 0x0904, 0x94c8, 0xa08e, 0x0035,
-	0x0904, 0x94c8, 0xa08e, 0x001e, 0x0188, 0xa08e, 0x0001, 0x1150,
-	0x00d6, 0x6018, 0x2068, 0x6804, 0xa084, 0x00ff, 0x00de, 0xa086,
-	0x0006, 0x0110, 0x080c, 0x2ad9, 0x080c, 0x85f3, 0x080c, 0x974e,
-	0x0005, 0x00c6, 0x00d6, 0x6104, 0xa186, 0x0016, 0x0904, 0x9498,
-	0xa186, 0x0002, 0x1518, 0x6018, 0x2068, 0x2001, 0xad34, 0x2004,
-	0xd0ac, 0x1904, 0x94ea, 0x68a0, 0xd0bc, 0x1904, 0x94ea, 0x6840,
-	0xa084, 0x00ff, 0xa005, 0x0190, 0x8001, 0x6842, 0x6013, 0x0000,
-	0x601f, 0x0007, 0x6017, 0x0398, 0x603f, 0x0000, 0x080c, 0x8022,
-	0x0128, 0x2d00, 0x601a, 0x601f, 0x0001, 0x0450, 0x00de, 0x00ce,
-	0x6004, 0xa08e, 0x0002, 0x11a8, 0x6018, 0xa080, 0x0028, 0x2004,
-	0xa086, 0x007e, 0x1170, 0x2009, 0xad34, 0x2104, 0xc085, 0x200a,
-	0x00e6, 0x2071, 0xad00, 0x080c, 0x48f5, 0x00ee, 0x080c, 0x85f3,
-	0x0020, 0x080c, 0x85f3, 0x080c, 0x2ad9, 0x00e6, 0x0126, 0x2091,
-	0x8000, 0x080c, 0x2aff, 0x012e, 0x00ee, 0x080c, 0x974e, 0x0005,
-	0x2001, 0x0002, 0x080c, 0x4c30, 0x6003, 0x0001, 0x6007, 0x0002,
-	0x080c, 0x67ee, 0x080c, 0x6c50, 0x00de, 0x00ce, 0x0c80, 0x00c6,
-	0x00d6, 0x6104, 0xa186, 0x0016, 0x0d58, 0x6018, 0x2068, 0x6840,
-	0xa084, 0x00ff, 0xa005, 0x0904, 0x946e, 0x8001, 0x6842, 0x6003,
-	0x0001, 0x080c, 0x67ee, 0x080c, 0x6c50, 0x00de, 0x00ce, 0x08b8,
-	0x080c, 0x85f3, 0x0804, 0x943e, 0x080c, 0x8621, 0x0804, 0x943e,
-	0x00d6, 0x2c68, 0x6104, 0x080c, 0x9a34, 0x00de, 0x0118, 0x080c,
-	0x8078, 0x00b8, 0x6004, 0x8007, 0x6130, 0xa18c, 0x00ff, 0xa105,
-	0x6032, 0x6007, 0x0085, 0x6003, 0x000b, 0x601f, 0x0002, 0x6038,
-	0x600a, 0x2001, 0xafa4, 0x2004, 0x6016, 0x080c, 0x67a8, 0x080c,
-	0x6c50, 0x0005, 0x00de, 0x00ce, 0x080c, 0x85f3, 0x080c, 0x2ad9,
-	0x00e6, 0x0126, 0x2091, 0x8000, 0x080c, 0x2aff, 0x6013, 0x0000,
-	0x601f, 0x0007, 0x6017, 0x0398, 0x603f, 0x0000, 0x012e, 0x00ee,
-	0x0005, 0x6000, 0xa08a, 0x0010, 0x1a0c, 0x14f6, 0x000b, 0x0005,
-	0x9518, 0x9518, 0x9518, 0x9518, 0x9518, 0x9518, 0x9518, 0x9518,
-	0x9518, 0x9369, 0x9518, 0x9371, 0x951a, 0x9371, 0x9527, 0x9518,
-	0x080c, 0x14f6, 0x6004, 0xa086, 0x008b, 0x0148, 0x6007, 0x008b,
-	0x6003, 0x000d, 0x080c, 0x67a8, 0x080c, 0x6c50, 0x0005, 0x080c,
-	0x9742, 0x080c, 0x9596, 0x0580, 0x080c, 0x2ad9, 0x00d6, 0x080c,
-	0x9596, 0x0168, 0x6010, 0x2068, 0x6837, 0x0103, 0x684b, 0x0006,
-	0x6847, 0x0000, 0x6850, 0xc0ed, 0x6852, 0x080c, 0x510c, 0x2c68,
-	0x080c, 0x8022, 0x0150, 0x6818, 0x601a, 0x080c, 0x9956, 0x00c6,
-	0x2d60, 0x080c, 0x974e, 0x00ce, 0x0008, 0x2d60, 0x00de, 0x6013,
-	0x0000, 0x601f, 0x0001, 0x6007, 0x0001, 0x6003, 0x0001, 0x080c,
-	0x67ee, 0x080c, 0x6c50, 0x0010, 0x080c, 0x974e, 0x0005, 0x6000,
-	0xa08a, 0x0010, 0x1a0c, 0x14f6, 0x000b, 0x0005, 0x9576, 0x9576,
-	0x9576, 0x9578, 0x9579, 0x9576, 0x9576, 0x9576, 0x9576, 0x9576,
-	0x9576, 0x9576, 0x9576, 0x9576, 0x9576, 0x9576, 0x080c, 0x14f6,
-	0x0005, 0x080c, 0x7cb8, 0x190c, 0x14f6, 0x6110, 0x2168, 0x684b,
-	0x0006, 0x080c, 0x510c, 0x080c, 0x8078, 0x0005, 0xa284, 0x0007,
-	0x1158, 0xa282, 0xb400, 0x0240, 0x2001, 0xad16, 0x2004, 0xa202,
-	0x1218, 0xa085, 0x0001, 0x0005, 0xa006, 0x0ce8, 0x0026, 0x6210,
-	0xa294, 0xf000, 0x002e, 0x0005, 0x00e6, 0x00c6, 0x0036, 0x0006,
-	0x0126, 0x2091, 0x8000, 0x2061, 0xb400, 0x2071, 0xad00, 0x7344,
-	0x7064, 0xa302, 0x12a8, 0x601c, 0xa206, 0x1160, 0x080c, 0x98e3,
-	0x0148, 0x080c, 0x9789, 0x1110, 0x080c, 0x85f3, 0x00c6, 0x080c,
-	0x8078, 0x00ce, 0xace0, 0x0018, 0x7058, 0xac02, 0x1208, 0x0c38,
-	0x012e, 0x000e, 0x003e, 0x00ce, 0x00ee, 0x0005, 0x00e6, 0x00c6,
-	0x0016, 0xa188, 0xae34, 0x210c, 0x81ff, 0x0170, 0x2061, 0xb400,
-	0x2071, 0xad00, 0x0016, 0x080c, 0x8022, 0x001e, 0x0138, 0x611a,
-	0x080c, 0x2ad9, 0x080c, 0x8078, 0xa006, 0x0010, 0xa085, 0x0001,
-	0x001e, 0x00ce, 0x00ee, 0x0005, 0x00c6, 0x0056, 0x0126, 0x2091,
-	0x8000, 0x00c6, 0x080c, 0x8022, 0x005e, 0x0180, 0x6612, 0x651a,
-	0x080c, 0x9956, 0x601f, 0x0003, 0x2009, 0x004b, 0x080c, 0x80a7,
-	0xa085, 0x0001, 0x012e, 0x005e, 0x00ce, 0x0005, 0xa006, 0x0cd0,
-	0x00c6, 0x0056, 0x0126, 0x2091, 0x8000, 0x62a0, 0x00c6, 0x080c,
-	0x8022, 0x005e, 0x0508, 0x6013, 0x0000, 0x651a, 0x080c, 0x9956,
-	0x601f, 0x0003, 0x00c6, 0x2560, 0x080c, 0x4ecf, 0x00ce, 0x080c,
-	0x68e7, 0x0076, 0x2039, 0x0000, 0x080c, 0x681d, 0x2c08, 0x080c,
-	0xa712, 0x007e, 0x2009, 0x004c, 0x080c, 0x80a7, 0xa085, 0x0001,
-	0x012e, 0x005e, 0x00ce, 0x0005, 0xa006, 0x0cd0, 0x00f6, 0x00c6,
-	0x0046, 0x00c6, 0x080c, 0x8022, 0x2c78, 0x00ce, 0x0180, 0x7e12,
-	0x2c00, 0x781a, 0x781f, 0x0003, 0x2021, 0x0005, 0x080c, 0x9683,
-	0x2f60, 0x2009, 0x004d, 0x080c, 0x80a7, 0xa085, 0x0001, 0x004e,
-	0x00ce, 0x00fe, 0x0005, 0x00f6, 0x00c6, 0x0046, 0x00c6, 0x080c,
-	0x8022, 0x2c78, 0x00ce, 0x0178, 0x7e12, 0x2c00, 0x781a, 0x781f,
-	0x0003, 0x2021, 0x0005, 0x0439, 0x2f60, 0x2009, 0x004e, 0x080c,
-	0x80a7, 0xa085, 0x0001, 0x004e, 0x00ce, 0x00fe, 0x0005, 0x00f6,
-	0x00c6, 0x0046, 0x00c6, 0x080c, 0x8022, 0x2c78, 0x00ce, 0x0178,
-	0x7e12, 0x2c00, 0x781a, 0x781f, 0x0003, 0x2021, 0x0004, 0x0059,
-	0x2f60, 0x2009, 0x0052, 0x080c, 0x80a7, 0xa085, 0x0001, 0x004e,
-	0x00ce, 0x00fe, 0x0005, 0x0096, 0x0076, 0x0126, 0x2091, 0x8000,
-	0x080c, 0x4e71, 0x0118, 0x2001, 0x9688, 0x0028, 0x080c, 0x4e43,
-	0x0158, 0x2001, 0x968e, 0x0006, 0xa00e, 0x2400, 0x080c, 0x51df,
-	0x080c, 0x510c, 0x000e, 0x0807, 0x2418, 0x080c, 0x6b15, 0x62a0,
-	0x0086, 0x2041, 0x0001, 0x2039, 0x0001, 0x2608, 0x080c, 0x6900,
-	0x008e, 0x080c, 0x681d, 0x2f08, 0x2648, 0x080c, 0xa712, 0x613c,
-	0x81ff, 0x090c, 0x69a9, 0x012e, 0x007e, 0x009e, 0x0005, 0x00c6,
-	0x0126, 0x2091, 0x8000, 0x00c6, 0x080c, 0x8022, 0x001e, 0x0188,
-	0x660a, 0x611a, 0x080c, 0x9956, 0x601f, 0x0001, 0x2d00, 0x6012,
-	0x2009, 0x001f, 0x080c, 0x80a7, 0xa085, 0x0001, 0x012e, 0x00ce,
-	0x0005, 0xa006, 0x0cd8, 0x00c6, 0x0126, 0x2091, 0x8000, 0x00c6,
-	0x080c, 0x8022, 0x001e, 0x0188, 0x660a, 0x611a, 0x080c, 0x9956,
-	0x601f, 0x0008, 0x2d00, 0x6012, 0x2009, 0x0021, 0x080c, 0x80a7,
-	0xa085, 0x0001, 0x012e, 0x00ce, 0x0005, 0xa006, 0x0cd8, 0x00c6,
-	0x0126, 0x2091, 0x8000, 0x00c6, 0x080c, 0x8022, 0x001e, 0x0188,
-	0x660a, 0x611a, 0x080c, 0x9956, 0x601f, 0x0001, 0x2d00, 0x6012,
-	0x2009, 0x003d, 0x080c, 0x80a7, 0xa085, 0x0001, 0x012e, 0x00ce,
-	0x0005, 0xa006, 0x0cd8, 0x00c6, 0x0126, 0x2091, 0x8000, 0x00c6,
-	0x080c, 0x9807, 0x001e, 0x0180, 0x611a, 0x080c, 0x9956, 0x601f,
-	0x0001, 0x2d00, 0x6012, 0x2009, 0x0000, 0x080c, 0x80a7, 0xa085,
-	0x0001, 0x012e, 0x00ce, 0x0005, 0xa006, 0x0cd8, 0x00c6, 0x0126,
-	0x2091, 0x8000, 0x00c6, 0x080c, 0x8022, 0x001e, 0x0188, 0x660a,
-	0x611a, 0x080c, 0x9956, 0x601f, 0x0001, 0x2d00, 0x6012, 0x2009,
-	0x0044, 0x080c, 0x80a7, 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,
-	0xafa3, 0x2004, 0x0006, 0xa082, 0x0051, 0x000e, 0x0208, 0x8004,
-	0x6016, 0x080c, 0xabb4, 0x603f, 0x0000, 0x000e, 0x0005, 0x0066,
-	0x00c6, 0x00d6, 0x2031, 0xad52, 0x2634, 0xd6e4, 0x0128, 0x6618,
-	0x2660, 0x6e48, 0x080c, 0x4dfc, 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, 0x8022, 0x001e, 0x0190, 0x611a, 0x080c, 0x9956,
-	0x601f, 0x0001, 0x2d00, 0x6012, 0x080c, 0x2ad9, 0x2009, 0x0028,
-	0x080c, 0x80a7, 0xa085, 0x0001, 0x012e, 0x00ce, 0x0005, 0xa006,
-	0x0cd8, 0xa186, 0x0015, 0x1178, 0x2011, 0xad20, 0x2204, 0xa086,
-	0x0074, 0x1148, 0x080c, 0x8943, 0x6003, 0x0001, 0x6007, 0x0029,
-	0x080c, 0x67ee, 0x0020, 0x080c, 0x85f3, 0x080c, 0x8078, 0x0005,
-	0xa186, 0x0016, 0x1128, 0x2001, 0x0004, 0x080c, 0x4c30, 0x00e8,
-	0xa186, 0x0015, 0x11e8, 0x2011, 0xad20, 0x2204, 0xa086, 0x0014,
-	0x11b8, 0x00d6, 0x6018, 0x2068, 0x080c, 0x4d72, 0x00de, 0x080c,
-	0x89f7, 0x1170, 0x00d6, 0x6018, 0x2068, 0x6890, 0x00de, 0xa005,
-	0x0138, 0x2001, 0x0006, 0x080c, 0x4c30, 0x080c, 0x81f6, 0x0020,
-	0x080c, 0x85f3, 0x080c, 0x8078, 0x0005, 0x6848, 0xa086, 0x0005,
-	0x1108, 0x0009, 0x0005, 0x6850, 0xc0ad, 0x6852, 0x0005, 0x00e6,
-	0x0126, 0x2071, 0xad00, 0x2091, 0x8000, 0x7544, 0xa582, 0x0001,
-	0x0608, 0x7048, 0x2060, 0x6000, 0xa086, 0x0000, 0x0148, 0xace0,
-	0x0018, 0x7058, 0xac02, 0x1208, 0x0cb0, 0x2061, 0xb400, 0x0c98,
-	0x6003, 0x0008, 0x8529, 0x7546, 0xaca8, 0x0018, 0x7058, 0xa502,
-	0x1230, 0x754a, 0xa085, 0x0001, 0x012e, 0x00ee, 0x0005, 0x704b,
-	0xb400, 0x0cc0, 0xa006, 0x0cc0, 0x00e6, 0x2071, 0xb28c, 0x7014,
-	0xd0e4, 0x0150, 0x6013, 0x0000, 0x6003, 0x0001, 0x6007, 0x0050,
-	0x080c, 0x67a8, 0x080c, 0x6c50, 0x00ee, 0x0005, 0x00c6, 0x00f6,
-	0x2c78, 0x080c, 0x5029, 0x00fe, 0x0120, 0x601c, 0xa084, 0x000f,
-	0x0013, 0x00ce, 0x0005, 0x9369, 0x985e, 0x9861, 0x9864, 0xa9a7,
-	0xa9c2, 0xa9c5, 0x9369, 0x9369, 0x080c, 0x14f6, 0xe000, 0xe000,
-	0x0005, 0xe000, 0xe000, 0x0005, 0x0009, 0x0005, 0x00f6, 0x2c78,
-	0x080c, 0x5029, 0x0538, 0x080c, 0x8022, 0x1128, 0x2001, 0xafa5,
-	0x2004, 0x783e, 0x00f8, 0x7818, 0x601a, 0x080c, 0x9956, 0x781c,
-	0xa086, 0x0003, 0x0128, 0x7808, 0x6036, 0x2f00, 0x603a, 0x0020,
-	0x7808, 0x603a, 0x2f00, 0x6036, 0x602a, 0x601f, 0x0001, 0x6007,
-	0x0035, 0x6003, 0x0001, 0x7950, 0x6152, 0x080c, 0x67a8, 0x080c,
-	0x6c50, 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, 0x67a8, 0x6803, 0x0002,
-	0x00fe, 0x001e, 0x0005, 0x00f6, 0x2c78, 0x080c, 0x5029, 0x1118,
-	0xa085, 0x0001, 0x0070, 0x6020, 0xd0f4, 0x1150, 0xc0f5, 0x6022,
-	0x6010, 0x2078, 0x7828, 0x603a, 0x782c, 0x6036, 0x080c, 0x190b,
-	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, 0xaf9f, 0x200c, 0x8000, 0x2014, 0x2001, 0x0032, 0x080c,
-	0x6665, 0x2001, 0xafa3, 0x82ff, 0x1110, 0x2011, 0x0002, 0x2202,
-	0x2001, 0xafa1, 0x200c, 0x8000, 0x2014, 0x2071, 0xaf8d, 0x711a,
-	0x721e, 0x2001, 0x0064, 0x080c, 0x6665, 0x2001, 0xafa4, 0x82ff,
-	0x1110, 0x2011, 0x0002, 0x2202, 0x2009, 0xafa5, 0xa280, 0x000a,
-	0x200a, 0x00ee, 0x003e, 0x002e, 0x001e, 0x000e, 0x0005, 0x0006,
-	0x00e6, 0x2001, 0xafa3, 0x2003, 0x0028, 0x2001, 0xafa4, 0x2003,
-	0x0014, 0x2071, 0xaf8d, 0x701b, 0x0000, 0x701f, 0x07d0, 0x2001,
-	0xafa5, 0x2003, 0x001e, 0x00ee, 0x000e, 0x0005, 0x00d6, 0x6054,
-	0xa06d, 0x0110, 0x080c, 0x15f0, 0x00de, 0x0005, 0x0005, 0x00c6,
-	0x0126, 0x2091, 0x8000, 0x00c6, 0x080c, 0x8022, 0x001e, 0x0178,
-	0x611a, 0x0ca1, 0x601f, 0x0001, 0x2d00, 0x6012, 0x2009, 0x0033,
-	0x080c, 0x80a7, 0xa085, 0x0001, 0x012e, 0x00ce, 0x0005, 0xa006,
-	0x0cd8, 0x00d6, 0x00e6, 0x00f6, 0x2071, 0xad00, 0xa186, 0x0015,
-	0x1500, 0x7080, 0xa086, 0x0018, 0x11e0, 0x6010, 0x2068, 0x6a3c,
-	0xd2e4, 0x1160, 0x2c78, 0x080c, 0x6e05, 0x01d8, 0x706c, 0x6a50,
-	0xa206, 0x1160, 0x7070, 0x6a54, 0xa206, 0x1140, 0x6218, 0xa290,
-	0x0028, 0x2214, 0x2009, 0x0000, 0x080c, 0x2b1e, 0x080c, 0x81f6,
-	0x0020, 0x080c, 0x85f3, 0x080c, 0x8078, 0x00fe, 0x00ee, 0x00de,
-	0x0005, 0x7050, 0x6a54, 0xa206, 0x0d48, 0x0c80, 0x00c6, 0x0126,
-	0x2091, 0x8000, 0x00c6, 0x080c, 0x8022, 0x001e, 0x0180, 0x611a,
-	0x080c, 0x9956, 0x601f, 0x0001, 0x2d00, 0x6012, 0x2009, 0x0043,
-	0x080c, 0x80a7, 0xa085, 0x0001, 0x012e, 0x00ce, 0x0005, 0xa006,
-	0x0cd8, 0x00d6, 0x00e6, 0x00f6, 0x2071, 0xad00, 0xa186, 0x0015,
-	0x11c0, 0x7080, 0xa086, 0x0004, 0x11a0, 0x6010, 0xa0e8, 0x000f,
-	0x2c78, 0x080c, 0x6e05, 0x01a8, 0x706c, 0x6a08, 0xa206, 0x1130,
-	0x7070, 0x6a0c, 0xa206, 0x1110, 0x080c, 0x2ad9, 0x080c, 0x81f6,
-	0x0020, 0x080c, 0x85f3, 0x080c, 0x8078, 0x00fe, 0x00ee, 0x00de,
-	0x0005, 0x7050, 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, 0x1188, 0x00c6, 0x6318,
-	0x2360, 0x2009, 0x0000, 0x080c, 0x4f6e, 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,
-	0x510c, 0x003e, 0x00de, 0x0005, 0x00c6, 0x0026, 0x0016, 0xa186,
-	0x0035, 0x0110, 0x6a34, 0x0008, 0x6a28, 0x080c, 0x9586, 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, 0x0066, 0x6000, 0xa0b2, 0x0010, 0x1a0c, 0x14f6, 0x0013,
-	0x006e, 0x0005, 0x9a7a, 0x9eff, 0xa027, 0x9a7a, 0x9a7a, 0x9a7a,
-	0x9a7a, 0x9a7a, 0x9ab2, 0xa0a3, 0x9a7a, 0x9a7a, 0x9a7a, 0x9a7a,
-	0x9a7a, 0x9a7a, 0x080c, 0x14f6, 0x0066, 0x6000, 0xa0b2, 0x0010,
-	0x1a0c, 0x14f6, 0x0013, 0x006e, 0x0005, 0x9a95, 0xa4fd, 0x9a95,
-	0x9a95, 0x9a95, 0x9a95, 0x9a95, 0x9a95, 0xa4c1, 0xa545, 0x9a95,
-	0xaaea, 0xab1a, 0xaaea, 0xab1a, 0x9a95, 0x080c, 0x14f6, 0x0066,
-	0x6000, 0xa0b2, 0x0010, 0x1a0c, 0x14f6, 0x0013, 0x006e, 0x0005,
-	0x9ab0, 0xa1d8, 0xa295, 0xa2c2, 0xa346, 0x9ab0, 0xa433, 0xa3de,
-	0xa0af, 0xa497, 0xa4ac, 0x9ab0, 0x9ab0, 0x9ab0, 0x9ab0, 0x9ab0,
-	0x080c, 0x14f6, 0xa1b2, 0x0080, 0x1a0c, 0x14f6, 0x2100, 0xa1b2,
-	0x0040, 0x1a04, 0x9e79, 0x0002, 0x9afc, 0x9cab, 0x9afc, 0x9afc,
-	0x9afc, 0x9cb2, 0x9afc, 0x9afc, 0x9afc, 0x9afc, 0x9afc, 0x9afc,
-	0x9afc, 0x9afc, 0x9afc, 0x9afc, 0x9afc, 0x9afc, 0x9afc, 0x9afc,
-	0x9afc, 0x9afc, 0x9afc, 0x9afe, 0x9b5a, 0x9b65, 0x9ba6, 0x9bc0,
-	0x9c3e, 0x9c9c, 0x9afc, 0x9afc, 0x9cb5, 0x9afc, 0x9afc, 0x9cc4,
-	0x9ccb, 0x9afc, 0x9afc, 0x9afc, 0x9afc, 0x9afc, 0x9d42, 0x9afc,
-	0x9afc, 0x9d4d, 0x9afc, 0x9afc, 0x9d18, 0x9afc, 0x9afc, 0x9afc,
-	0x9d61, 0x9afc, 0x9afc, 0x9afc, 0x9dd5, 0x9afc, 0x9afc, 0x9afc,
-	0x9afc, 0x9afc, 0x9afc, 0x9e40, 0x080c, 0x14f6, 0x080c, 0x502d,
-	0x1140, 0x2001, 0xad34, 0x2004, 0xa084, 0x0009, 0xa086, 0x0008,
-	0x1140, 0x6007, 0x0009, 0x602b, 0x0009, 0x6013, 0x0000, 0x0804,
-	0x9ca6, 0x080c, 0x501d, 0x00e6, 0x00c6, 0x0036, 0x0026, 0x0016,
-	0x6218, 0x2270, 0x72a0, 0x0026, 0x2019, 0x0029, 0x080c, 0x68e7,
-	0x0076, 0x2039, 0x0000, 0x080c, 0x681d, 0x2c08, 0x080c, 0xa712,
-	0x007e, 0x001e, 0x2e60, 0x080c, 0x4ecf, 0x001e, 0x002e, 0x003e,
-	0x00ce, 0x00ee, 0x6618, 0x00c6, 0x2660, 0x080c, 0x4ceb, 0x00ce,
-	0xa6b0, 0x0001, 0x2634, 0xa684, 0x00ff, 0xa082, 0x0006, 0x0278,
-	0x080c, 0xa656, 0x1904, 0x9ba0, 0x080c, 0xa5f6, 0x1120, 0x6007,
-	0x0008, 0x0804, 0x9ca6, 0x6007, 0x0009, 0x0804, 0x9ca6, 0x080c,
-	0xa801, 0x0128, 0x080c, 0xa656, 0x0d78, 0x0804, 0x9ba0, 0x6013,
-	0x1900, 0x0c88, 0x6106, 0x080c, 0xa5a6, 0x6007, 0x0006, 0x0804,
-	0x9ca6, 0x6007, 0x0007, 0x0804, 0x9ca6, 0x080c, 0xab4e, 0x1904,
-	0x9e76, 0x00d6, 0x6618, 0x2668, 0x6e04, 0xa6b4, 0xff00, 0x8637,
-	0xa686, 0x0006, 0x0188, 0xa686, 0x0004, 0x0170, 0x6e04, 0xa6b4,
-	0x00ff, 0xa686, 0x0006, 0x0140, 0xa686, 0x0004, 0x0128, 0xa686,
-	0x0005, 0x0110, 0x00de, 0x00e0, 0x080c, 0xa6b4, 0x11a0, 0xa686,
-	0x0006, 0x1150, 0x0026, 0x6218, 0xa290, 0x0028, 0x2214, 0x2009,
-	0x0000, 0x080c, 0x2b1e, 0x002e, 0x080c, 0x4d72, 0x6007, 0x000a,
-	0x00de, 0x0804, 0x9ca6, 0x6007, 0x000b, 0x00de, 0x0804, 0x9ca6,
-	0x080c, 0x2ad9, 0x6007, 0x0001, 0x0804, 0x9ca6, 0x080c, 0xab4e,
-	0x1904, 0x9e76, 0x6618, 0x00d6, 0x2668, 0x6e04, 0x00de, 0xa686,
-	0x0707, 0x0d70, 0x0026, 0x6218, 0xa290, 0x0028, 0x2214, 0x2009,
-	0x0000, 0x080c, 0x2b1e, 0x002e, 0x6007, 0x000c, 0x0804, 0x9ca6,
-	0x080c, 0x502d, 0x1140, 0x2001, 0xad34, 0x2004, 0xa084, 0x0009,
-	0xa086, 0x0008, 0x1110, 0x0804, 0x9b09, 0x080c, 0x501d, 0x6618,
-	0xa6b0, 0x0001, 0x2634, 0xa684, 0x00ff, 0xa082, 0x0006, 0x06e8,
-	0x1138, 0x0026, 0x2001, 0x0006, 0x080c, 0x4c5d, 0x002e, 0x0050,
-	0xa6b4, 0xff00, 0x8637, 0xa686, 0x0004, 0x0120, 0xa686, 0x0006,
-	0x1904, 0x9ba0, 0x080c, 0xa6c1, 0x1120, 0x6007, 0x000e, 0x0804,
-	0x9ca6, 0x0046, 0x6418, 0xa4a0, 0x0028, 0x2424, 0xa4a4, 0x00ff,
-	0x8427, 0x0046, 0x080c, 0x2ad9, 0x004e, 0x0016, 0xa006, 0x2009,
-	0xad52, 0x210c, 0xd1a4, 0x0158, 0x2009, 0x0029, 0x080c, 0xa96c,
-	0x6018, 0x00d6, 0x2068, 0x6800, 0xc0e5, 0x6802, 0x00de, 0x001e,
-	0x004e, 0x6007, 0x0001, 0x0804, 0x9ca6, 0x2001, 0x0001, 0x080c,
-	0x4c1e, 0x0156, 0x0016, 0x0026, 0x0036, 0x20a9, 0x0004, 0x2019,
-	0xad05, 0x2011, 0xb290, 0x080c, 0x8a7c, 0x003e, 0x002e, 0x001e,
-	0x015e, 0xa005, 0x0168, 0xa6b4, 0xff00, 0x8637, 0xa682, 0x0004,
-	0x0a04, 0x9ba0, 0xa682, 0x0007, 0x0a04, 0x9bea, 0x0804, 0x9ba0,
-	0x6013, 0x1900, 0x6007, 0x0009, 0x0804, 0x9ca6, 0x080c, 0x502d,
-	0x1140, 0x2001, 0xad34, 0x2004, 0xa084, 0x0009, 0xa086, 0x0008,
-	0x1110, 0x0804, 0x9b09, 0x080c, 0x501d, 0x6618, 0xa6b0, 0x0001,
-	0x2634, 0xa684, 0x00ff, 0xa082, 0x0006, 0x06b0, 0xa6b4, 0xff00,
-	0x8637, 0xa686, 0x0004, 0x0120, 0xa686, 0x0006, 0x1904, 0x9ba0,
-	0x080c, 0xa6e9, 0x1130, 0x080c, 0xa5f6, 0x1118, 0x6007, 0x0010,
-	0x04e8, 0x0046, 0x6418, 0xa4a0, 0x0028, 0x2424, 0xa4a4, 0x00ff,
-	0x8427, 0x0046, 0x080c, 0x2ad9, 0x004e, 0x0016, 0xa006, 0x2009,
-	0xad52, 0x210c, 0xd1a4, 0x0158, 0x2009, 0x0029, 0x080c, 0xa96c,
-	0x6018, 0x00d6, 0x2068, 0x6800, 0xc0e5, 0x6802, 0x00de, 0x001e,
-	0x004e, 0x6007, 0x0001, 0x00d0, 0x080c, 0xa801, 0x0140, 0xa6b4,
-	0xff00, 0x8637, 0xa686, 0x0006, 0x0958, 0x0804, 0x9ba0, 0x6013,
-	0x1900, 0x6007, 0x0009, 0x0050, 0x080c, 0xab4e, 0x1904, 0x9e76,
-	0x080c, 0x9e98, 0x1904, 0x9ba0, 0x6007, 0x0012, 0x6003, 0x0001,
-	0x080c, 0x67ee, 0x0005, 0x6007, 0x0001, 0x6003, 0x0001, 0x080c,
-	0x67ee, 0x0cc0, 0x6007, 0x0005, 0x0cc0, 0x080c, 0xab4e, 0x1904,
-	0x9e76, 0x080c, 0x9e98, 0x1904, 0x9ba0, 0x6007, 0x0020, 0x6003,
-	0x0001, 0x080c, 0x67ee, 0x0005, 0x6007, 0x0023, 0x6003, 0x0001,
-	0x080c, 0x67ee, 0x0005, 0x080c, 0xab4e, 0x1904, 0x9e76, 0x080c,
-	0x9e98, 0x1904, 0x9ba0, 0x0016, 0x0026, 0x2011, 0xb291, 0x2214,
-	0xa286, 0xffff, 0x0190, 0x2c08, 0x080c, 0x9586, 0x01d8, 0x2260,
-	0x2011, 0xb290, 0x2214, 0x6008, 0xa206, 0x11a0, 0x6018, 0xa190,
-	0x0006, 0x2214, 0xa206, 0x01e0, 0x0068, 0x2011, 0xb290, 0x2214,
-	0x2c08, 0x080c, 0xa940, 0x11a0, 0x2011, 0xb291, 0x2214, 0xa286,
-	0xffff, 0x01a0, 0x2160, 0x6007, 0x0026, 0x6013, 0x1700, 0x2011,
-	0xb289, 0x2214, 0xa296, 0xffff, 0x1160, 0x6007, 0x0025, 0x0048,
-	0x601c, 0xa086, 0x0007, 0x1d70, 0x080c, 0x8078, 0x2160, 0x6007,
-	0x0025, 0x6003, 0x0001, 0x080c, 0x67ee, 0x002e, 0x001e, 0x0005,
-	0x2001, 0x0001, 0x080c, 0x4c1e, 0x0156, 0x0016, 0x0026, 0x0036,
-	0x20a9, 0x0004, 0x2019, 0xad05, 0x2011, 0xb296, 0x080c, 0x8a7c,
-	0x003e, 0x002e, 0x001e, 0x015e, 0x0120, 0x6007, 0x0031, 0x0804,
-	0x9ca6, 0x080c, 0x87bd, 0x080c, 0x574f, 0x1158, 0x0006, 0x0026,
-	0x0036, 0x080c, 0x576b, 0x0110, 0x080c, 0x5726, 0x003e, 0x002e,
-	0x000e, 0x0005, 0x6106, 0x080c, 0x9eb4, 0x6007, 0x002b, 0x0804,
-	0x9ca6, 0x6007, 0x002c, 0x0804, 0x9ca6, 0x080c, 0xab4e, 0x1904,
-	0x9e76, 0x080c, 0x9e98, 0x1904, 0x9ba0, 0x6106, 0x080c, 0x9eb8,
-	0x1120, 0x6007, 0x002e, 0x0804, 0x9ca6, 0x6007, 0x002f, 0x0804,
-	0x9ca6, 0x00e6, 0x00d6, 0x00c6, 0x6018, 0xa080, 0x0001, 0x200c,
-	0xa184, 0x00ff, 0xa086, 0x0006, 0x0158, 0xa184, 0xff00, 0x8007,
-	0xa086, 0x0006, 0x0128, 0x00ce, 0x00de, 0x00ee, 0x0804, 0x9cab,
-	0x2001, 0xad71, 0x2004, 0xd0e4, 0x0904, 0x9dd2, 0x2071, 0xb28c,
-	0x7010, 0x6036, 0x7014, 0x603a, 0x7108, 0x720c, 0x2001, 0xad52,
-	0x2004, 0xd0a4, 0x0140, 0x6018, 0x2068, 0x6810, 0xa106, 0x1118,
-	0x6814, 0xa206, 0x01f8, 0x2001, 0xad52, 0x2004, 0xd0ac, 0x1580,
-	0x2069, 0xad00, 0x6870, 0xa206, 0x1558, 0x686c, 0xa106, 0x1540,
-	0x7210, 0x080c, 0x9586, 0x0548, 0x080c, 0xa9d4, 0x0530, 0x622a,
-	0x6007, 0x0036, 0x6003, 0x0001, 0x080c, 0x67a8, 0x00ce, 0x00de,
-	0x00ee, 0x0005, 0x7214, 0xa286, 0xffff, 0x0150, 0x080c, 0x9586,
-	0x01a0, 0xa280, 0x0002, 0x2004, 0x7110, 0xa106, 0x1170, 0x0c08,
-	0x7210, 0x2c08, 0x080c, 0xa940, 0x2c10, 0x2160, 0x0130, 0x08c8,
-	0x6007, 0x0037, 0x6013, 0x1500, 0x08e8, 0x6007, 0x0037, 0x6013,
-	0x1700, 0x08c0, 0x6007, 0x0012, 0x08a8, 0x6018, 0xa080, 0x0001,
-	0x2004, 0xa084, 0xff00, 0x8007, 0xa086, 0x0006, 0x1904, 0x9cab,
-	0x00e6, 0x00d6, 0x00c6, 0x2001, 0xad71, 0x2004, 0xd0e4, 0x0904,
-	0x9e38, 0x2069, 0xad00, 0x2071, 0xb28c, 0x7008, 0x6036, 0x720c,
-	0x623a, 0xa286, 0xffff, 0x1140, 0x7208, 0x00c6, 0x2c08, 0x080c,
-	0xa940, 0x2c10, 0x00ce, 0x0588, 0x080c, 0x9586, 0x0570, 0x00c6,
-	0x0026, 0x2260, 0x080c, 0x928f, 0x002e, 0x00ce, 0x7118, 0xa18c,
-	0xff00, 0x810f, 0xa186, 0x0001, 0x0158, 0xa186, 0x0005, 0x0118,
-	0xa186, 0x0007, 0x1178, 0xa280, 0x0004, 0x2004, 0xa005, 0x0150,
-	0x0056, 0x7510, 0x7614, 0x080c, 0xa9eb, 0x005e, 0x00ce, 0x00de,
-	0x00ee, 0x0005, 0x6007, 0x003b, 0x602b, 0x0009, 0x6013, 0x2a00,
-	0x6003, 0x0001, 0x080c, 0x67a8, 0x0c88, 0x6007, 0x003b, 0x602b,
-	0x0009, 0x6013, 0x1700, 0x6003, 0x0001, 0x080c, 0x67a8, 0x0c30,
-	0x6007, 0x003b, 0x602b, 0x000b, 0x6013, 0x0000, 0x0804, 0x9daa,
-	0x00e6, 0x0026, 0x080c, 0x502d, 0x0558, 0x080c, 0x501d, 0x080c,
-	0xabc5, 0x1520, 0x2071, 0xad00, 0x70d0, 0xc085, 0x70d2, 0x00f6,
-	0x2079, 0x0100, 0x729c, 0xa284, 0x00ff, 0x706e, 0x78e6, 0xa284,
-	0xff00, 0x7270, 0xa205, 0x7072, 0x78ea, 0x00fe, 0x70db, 0x0000,
-	0x2001, 0xad52, 0x2004, 0xd0a4, 0x0120, 0x2011, 0xafe0, 0x2013,
-	0x07d0, 0xd0ac, 0x1128, 0x080c, 0x28fa, 0x0010, 0x080c, 0xabf1,
-	0x002e, 0x00ee, 0x080c, 0x8078, 0x0804, 0x9caa, 0x080c, 0x8078,
-	0x0005, 0x2600, 0x0002, 0x9e81, 0x9e81, 0x9e81, 0x9e81, 0x9e81,
-	0x9e83, 0x080c, 0x14f6, 0x080c, 0xab4e, 0x1d80, 0x0089, 0x1138,
-	0x6007, 0x0045, 0x6003, 0x0001, 0x080c, 0x67ee, 0x0005, 0x080c,
-	0x2ad9, 0x6007, 0x0001, 0x6003, 0x0001, 0x080c, 0x67ee, 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, 0x2676, 0x1130, 0x2110, 0x2009, 0x0000, 0x080c, 0x2b1e,
-	0x0018, 0xa085, 0x0001, 0x0008, 0xa006, 0x00de, 0x0005, 0x2069,
-	0xb28d, 0x6800, 0xa082, 0x0010, 0x1228, 0x6013, 0x0000, 0xa085,
-	0x0001, 0x0008, 0xa006, 0x0005, 0x6013, 0x0000, 0x2069, 0xb28c,
-	0x6808, 0xa084, 0xff00, 0xa086, 0x0800, 0x1140, 0x6800, 0xa084,
-	0x00ff, 0xa08e, 0x0014, 0x0110, 0xa08e, 0x0010, 0x0005, 0x6004,
-	0xa0b2, 0x0080, 0x1a0c, 0x14f6, 0xa1b6, 0x0013, 0x1130, 0x2008,
-	0xa1b2, 0x0040, 0x1a04, 0x9ffb, 0x0092, 0xa1b6, 0x0027, 0x0120,
-	0xa1b6, 0x0014, 0x190c, 0x14f6, 0x2001, 0x0007, 0x080c, 0x4c5d,
-	0x080c, 0x6b73, 0x080c, 0x974e, 0x080c, 0x6c50, 0x0005, 0x9f5f,
-	0x9f61, 0x9f5f, 0x9f5f, 0x9f5f, 0x9f61, 0x9f6f, 0x9ff4, 0x9fbf,
-	0x9ff4, 0x9fd0, 0x9ff4, 0x9f6f, 0x9ff4, 0x9fec, 0x9ff4, 0x9fec,
-	0x9ff4, 0x9ff4, 0x9f5f, 0x9f5f, 0x9f5f, 0x9f5f, 0x9f5f, 0x9f5f,
-	0x9f5f, 0x9f5f, 0x9f5f, 0x9f5f, 0x9f5f, 0x9f61, 0x9f5f, 0x9ff4,
-	0x9f5f, 0x9f5f, 0x9ff4, 0x9f5f, 0x9ff1, 0x9ff4, 0x9f5f, 0x9f5f,
-	0x9f5f, 0x9f5f, 0x9ff4, 0x9ff4, 0x9f5f, 0x9ff4, 0x9ff4, 0x9f5f,
-	0x9f69, 0x9f5f, 0x9f5f, 0x9f5f, 0x9f5f, 0x9ff0, 0x9ff4, 0x9f5f,
-	0x9f5f, 0x9ff4, 0x9ff4, 0x9f5f, 0x9f5f, 0x9f5f, 0x9f5f, 0x080c,
-	0x14f6, 0x080c, 0x6b73, 0x6003, 0x0002, 0x080c, 0x6c50, 0x0804,
-	0x9ffa, 0x2001, 0x0000, 0x080c, 0x4c1e, 0x0804, 0x9ff4, 0x00f6,
-	0x2079, 0xad51, 0x7804, 0x00fe, 0xd0ac, 0x1904, 0x9ff4, 0x2001,
-	0x0000, 0x080c, 0x4c1e, 0x6018, 0xa080, 0x0004, 0x2004, 0xa086,
-	0x00ff, 0x1140, 0x00f6, 0x2079, 0xad00, 0x7894, 0x8000, 0x7896,
-	0x00fe, 0x00e0, 0x00c6, 0x6018, 0x2060, 0x6000, 0xd0f4, 0x1140,
-	0x6010, 0xa005, 0x0128, 0x00ce, 0x080c, 0x3cce, 0x0804, 0x9ff4,
-	0x00ce, 0x2001, 0xad00, 0x2004, 0xa086, 0x0002, 0x1138, 0x00f6,
-	0x2079, 0xad00, 0x7894, 0x8000, 0x7896, 0x00fe, 0x2001, 0x0002,
-	0x080c, 0x4c30, 0x080c, 0x6b73, 0x601f, 0x0001, 0x6003, 0x0001,
-	0x6007, 0x0002, 0x080c, 0x67ee, 0x080c, 0x6c50, 0x00c6, 0x6118,
-	0x2160, 0x2009, 0x0001, 0x080c, 0x6519, 0x00ce, 0x04d8, 0x6618,
-	0x00d6, 0x2668, 0x6e04, 0x00de, 0xa6b4, 0xff00, 0x8637, 0xa686,
-	0x0006, 0x0550, 0xa686, 0x0004, 0x0538, 0x2001, 0x0004, 0x0410,
-	0x2001, 0xad00, 0x2004, 0xa086, 0x0003, 0x1110, 0x080c, 0x3cce,
-	0x2001, 0x0006, 0x0489, 0x6618, 0x00d6, 0x2668, 0x6e04, 0x00de,
-	0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006, 0x0170, 0x2001, 0x0006,
-	0x0048, 0x2001, 0x0004, 0x0030, 0x2001, 0x0006, 0x00e9, 0x0020,
-	0x0018, 0x0010, 0x080c, 0x4c5d, 0x080c, 0x6b73, 0x080c, 0x8078,
-	0x080c, 0x6c50, 0x0005, 0x2600, 0x0002, 0xa003, 0xa003, 0xa003,
-	0xa003, 0xa003, 0xa005, 0x080c, 0x14f6, 0x080c, 0x6b73, 0x080c,
-	0x8078, 0x080c, 0x6c50, 0x0005, 0x0016, 0x00d6, 0x6118, 0x2168,
-	0x6900, 0xd184, 0x0188, 0x6104, 0xa18e, 0x000a, 0x1128, 0x699c,
-	0xd1a4, 0x1110, 0x2001, 0x0007, 0x080c, 0x4c30, 0x2001, 0x0000,
-	0x080c, 0x4c1e, 0x080c, 0x2aff, 0x00de, 0x001e, 0x0005, 0x00d6,
-	0x6618, 0x2668, 0x6804, 0xa084, 0xff00, 0x8007, 0x00de, 0xa0b2,
-	0x000c, 0x1a0c, 0x14f6, 0xa1b6, 0x0015, 0x1110, 0x003b, 0x0028,
-	0xa1b6, 0x0016, 0x190c, 0x14f6, 0x006b, 0x0005, 0x86b9, 0x86b9,
-	0x86b9, 0x86b9, 0x86b9, 0x86b9, 0xa08f, 0xa056, 0x86b9, 0x86b9,
-	0x86b9, 0x86b9, 0x86b9, 0x86b9, 0x86b9, 0x86b9, 0x86b9, 0x86b9,
-	0xa08f, 0xa096, 0x86b9, 0x86b9, 0x86b9, 0x86b9, 0x00f6, 0x2079,
-	0xad51, 0x7804, 0xd0ac, 0x11e0, 0x6018, 0xa07d, 0x01c8, 0x7800,
-	0xd0f4, 0x1118, 0x7810, 0xa005, 0x1198, 0x2001, 0x0000, 0x080c,
-	0x4c1e, 0x2001, 0x0002, 0x080c, 0x4c30, 0x601f, 0x0001, 0x6003,
-	0x0001, 0x6007, 0x0002, 0x080c, 0x67ee, 0x080c, 0x6c50, 0x00a8,
-	0x2011, 0xb283, 0x2204, 0x8211, 0x220c, 0x080c, 0x2676, 0x1168,
-	0x00c6, 0x080c, 0x4cdc, 0x0120, 0x00ce, 0x080c, 0x8078, 0x0028,
-	0x080c, 0x493a, 0x00ce, 0x080c, 0x8078, 0x00fe, 0x0005, 0x6604,
-	0xa6b6, 0x001e, 0x1110, 0x080c, 0x8078, 0x0005, 0x080c, 0x8940,
-	0x1138, 0x6003, 0x0001, 0x6007, 0x0001, 0x080c, 0x67ee, 0x0010,
-	0x080c, 0x8078, 0x0005, 0x6004, 0xa08a, 0x0080, 0x1a0c, 0x14f6,
-	0x080c, 0x6b73, 0x080c, 0x974e, 0x080c, 0x6c50, 0x0005, 0xa182,
-	0x0040, 0x0002, 0xa0c5, 0xa0c5, 0xa0c5, 0xa0c5, 0xa0c7, 0xa0c5,
-	0xa0c5, 0xa0c5, 0xa0c5, 0xa0c5, 0xa0c5, 0xa0c5, 0xa0c5, 0xa0c5,
-	0xa0c5, 0xa0c5, 0xa0c5, 0xa0c5, 0xa0c5, 0x080c, 0x14f6, 0x00d6,
-	0x00e6, 0x00f6, 0x0156, 0x0046, 0x0026, 0x6218, 0xa280, 0x002b,
-	0x2004, 0xa005, 0x0120, 0x2021, 0x0000, 0x080c, 0xab96, 0x6106,
-	0x2071, 0xb280, 0x7444, 0xa4a4, 0xff00, 0x0904, 0xa129, 0xa486,
-	0x2000, 0x1130, 0x2009, 0x0001, 0x2011, 0x0200, 0x080c, 0x663f,
-	0x080c, 0x15d9, 0x090c, 0x14f6, 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, 0x6857, 0x0036,
-	0x080c, 0x510c, 0x001e, 0xa486, 0x2000, 0x1130, 0x2019, 0x0017,
-	0x080c, 0xa8eb, 0x0804, 0xa186, 0xa486, 0x0400, 0x1130, 0x2019,
-	0x0002, 0x080c, 0xa89d, 0x0804, 0xa186, 0xa486, 0x0200, 0x1110,
-	0x080c, 0xa882, 0xa486, 0x1000, 0x1110, 0x080c, 0xa8d0, 0x0804,
-	0xa186, 0x2069, 0xb048, 0x6a00, 0xd284, 0x0904, 0xa1d5, 0xa284,
-	0x0300, 0x1904, 0xa1cf, 0x6804, 0xa005, 0x0904, 0xa1c0, 0x2d78,
-	0x6003, 0x0007, 0x080c, 0x15c0, 0x0904, 0xa18d, 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, 0xb290, 0xad90, 0x0015,
-	0x200c, 0x810f, 0x2112, 0x8000, 0x8210, 0x1f04, 0xa178, 0x200c,
-	0x6982, 0x8000, 0x200c, 0x697e, 0x080c, 0x510c, 0x002e, 0x004e,
-	0x015e, 0x00fe, 0x00ee, 0x00de, 0x0005, 0x6013, 0x0100, 0x6003,
-	0x0001, 0x6007, 0x0041, 0x080c, 0x67a8, 0x080c, 0x6c50, 0x0c70,
-	0x2069, 0xb292, 0x2d04, 0xa084, 0xff00, 0xa086, 0x1200, 0x11a8,
-	0x2069, 0xb280, 0x686c, 0xa084, 0x00ff, 0x0016, 0x6110, 0xa18c,
-	0x0700, 0xa10d, 0x6112, 0x001e, 0x6003, 0x0001, 0x6007, 0x0043,
-	0x080c, 0x67a8, 0x080c, 0x6c50, 0x0888, 0x6013, 0x0200, 0x6003,
-	0x0001, 0x6007, 0x0041, 0x080c, 0x67a8, 0x080c, 0x6c50, 0x0830,
-	0x6013, 0x0300, 0x0010, 0x6013, 0x0100, 0x6003, 0x0001, 0x6007,
-	0x0041, 0x080c, 0x67a8, 0x080c, 0x6c50, 0x0804, 0xa186, 0x6013,
-	0x0500, 0x0c98, 0x6013, 0x0600, 0x0818, 0x6013, 0x0200, 0x0800,
-	0xa186, 0x0013, 0x1170, 0x6004, 0xa08a, 0x0040, 0x0a0c, 0x14f6,
-	0xa08a, 0x0053, 0x1a0c, 0x14f6, 0xa082, 0x0040, 0x2008, 0x0804,
-	0xa252, 0xa186, 0x0051, 0x0138, 0xa186, 0x0047, 0x11d8, 0x6004,
-	0xa086, 0x0041, 0x0518, 0x2001, 0x0109, 0x2004, 0xd084, 0x01f0,
-	0x0126, 0x2091, 0x2800, 0x0006, 0x0016, 0x0026, 0x080c, 0x6699,
-	0x002e, 0x001e, 0x000e, 0x012e, 0x6000, 0xa086, 0x0002, 0x1170,
-	0x0804, 0xa295, 0xa186, 0x0027, 0x0120, 0xa186, 0x0014, 0x190c,
-	0x14f6, 0x6004, 0xa082, 0x0040, 0x2008, 0x001a, 0x080c, 0x80be,
-	0x0005, 0xa22c, 0xa22e, 0xa22e, 0xa22c, 0xa22c, 0xa22c, 0xa22c,
-	0xa22c, 0xa22c, 0xa22c, 0xa22c, 0xa22c, 0xa22c, 0xa22c, 0xa22c,
-	0xa22c, 0xa22c, 0xa22c, 0xa22c, 0x080c, 0x14f6, 0x080c, 0x6b73,
-	0x080c, 0x6c50, 0x0036, 0x00d6, 0x6010, 0xa06d, 0x01c0, 0xad84,
-	0xf000, 0x01a8, 0x6003, 0x0002, 0x6018, 0x2004, 0xd0bc, 0x1178,
-	0x2019, 0x0004, 0x080c, 0xa91f, 0x6013, 0x0000, 0x6014, 0xa005,
-	0x1120, 0x2001, 0xafa4, 0x2004, 0x6016, 0x6003, 0x0007, 0x00de,
-	0x003e, 0x0005, 0x0002, 0xa266, 0xa283, 0xa26f, 0xa28f, 0xa266,
-	0xa266, 0xa266, 0xa266, 0xa266, 0xa266, 0xa266, 0xa266, 0xa266,
-	0xa266, 0xa266, 0xa266, 0xa266, 0xa266, 0xa266, 0x080c, 0x14f6,
-	0x6010, 0xa088, 0x0013, 0x2104, 0xa085, 0x0400, 0x200a, 0x080c,
-	0x6b73, 0x6010, 0xa080, 0x0013, 0x2004, 0xd0b4, 0x0138, 0x6003,
-	0x0007, 0x2009, 0x0043, 0x080c, 0x80a7, 0x0010, 0x6003, 0x0002,
-	0x080c, 0x6c50, 0x0005, 0x080c, 0x6b73, 0x080c, 0xab55, 0x1120,
-	0x080c, 0x6618, 0x080c, 0x8078, 0x080c, 0x6c50, 0x0005, 0x080c,
-	0x6b73, 0x2009, 0x0041, 0x0804, 0xa3de, 0xa182, 0x0040, 0x0002,
-	0xa2ab, 0xa2ad, 0xa2ab, 0xa2ab, 0xa2ab, 0xa2ab, 0xa2ab, 0xa2ae,
-	0xa2ab, 0xa2ab, 0xa2ab, 0xa2ab, 0xa2ab, 0xa2ab, 0xa2ab, 0xa2ab,
-	0xa2ab, 0xa2b9, 0xa2ab, 0x080c, 0x14f6, 0x0005, 0x6003, 0x0004,
-	0x6110, 0x20e1, 0x0005, 0x3d18, 0x3e20, 0x2c10, 0x080c, 0x1824,
-	0x0005, 0x00d6, 0x080c, 0x6618, 0x00de, 0x080c, 0xabb4, 0x080c,
-	0x8078, 0x0005, 0xa182, 0x0040, 0x0002, 0xa2d8, 0xa2d8, 0xa2d8,
-	0xa2d8, 0xa2d8, 0xa2d8, 0xa2d8, 0xa2da, 0xa2d8, 0xa2dd, 0xa316,
-	0xa2d8, 0xa2d8, 0xa2d8, 0xa2d8, 0xa316, 0xa2d8, 0xa2d8, 0xa2d8,
-	0x080c, 0x14f6, 0x080c, 0x80be, 0x0005, 0x2001, 0xad71, 0x2004,
-	0xd0e4, 0x0158, 0x2001, 0x0100, 0x2004, 0xa082, 0x0005, 0x0228,
-	0x2001, 0x011f, 0x2004, 0x6036, 0x0010, 0x6037, 0x0000, 0x080c,
-	0x6c05, 0x080c, 0x6d0d, 0x6010, 0x00d6, 0x2068, 0x684c, 0xd0fc,
-	0x0150, 0xa08c, 0x0003, 0xa18e, 0x0002, 0x0168, 0x2009, 0x0041,
-	0x00de, 0x0804, 0xa3de, 0x6003, 0x0007, 0x6017, 0x0000, 0x080c,
-	0x6618, 0x00de, 0x0005, 0x080c, 0xab55, 0x0110, 0x00de, 0x0005,
-	0x080c, 0x6618, 0x080c, 0x8078, 0x00de, 0x0ca0, 0x0036, 0x080c,
-	0x6c05, 0x080c, 0x6d0d, 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, 0xa91f, 0x6014,
-	0xa005, 0x1128, 0x2001, 0xafa4, 0x2004, 0x8003, 0x6016, 0x6013,
-	0x0000, 0x6003, 0x0007, 0x00de, 0x003e, 0x0005, 0xa186, 0x0013,
-	0x1150, 0x6004, 0xa086, 0x0042, 0x190c, 0x14f6, 0x080c, 0x6b73,
-	0x080c, 0x6c50, 0x0005, 0xa186, 0x0027, 0x0118, 0xa186, 0x0014,
-	0x1180, 0x6004, 0xa086, 0x0042, 0x190c, 0x14f6, 0x2001, 0x0007,
-	0x080c, 0x4c5d, 0x080c, 0x6b73, 0x080c, 0x974e, 0x080c, 0x6c50,
-	0x0005, 0xa182, 0x0040, 0x0002, 0xa37f, 0xa37f, 0xa37f, 0xa37f,
-	0xa37f, 0xa37f, 0xa37f, 0xa381, 0xa38d, 0xa37f, 0xa37f, 0xa37f,
-	0xa37f, 0xa37f, 0xa37f, 0xa37f, 0xa37f, 0xa37f, 0xa37f, 0x080c,
-	0x14f6, 0x0036, 0x0046, 0x20e1, 0x0005, 0x3d18, 0x3e20, 0x2c10,
-	0x080c, 0x1824, 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, 0x6618, 0x00de, 0x0005, 0x0006, 0x00f6, 0x2c78, 0x080c,
-	0x5029, 0x00fe, 0x000e, 0x0120, 0x6003, 0x0002, 0x00de, 0x0005,
-	0x2009, 0xad0d, 0x210c, 0xd19c, 0x0118, 0x6003, 0x0007, 0x0010,
-	0x6003, 0x0006, 0x0021, 0x080c, 0x661a, 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,
-	0x14f6, 0x6020, 0xd0dc, 0x090c, 0x14f6, 0x0005, 0xa401, 0xa408,
-	0xa414, 0xa420, 0xa401, 0xa401, 0xa401, 0xa42f, 0xa401, 0xa403,
-	0xa403, 0xa401, 0xa401, 0xa401, 0xa401, 0xa403, 0xa401, 0xa403,
-	0xa401, 0x080c, 0x14f6, 0x6020, 0xd0dc, 0x090c, 0x14f6, 0x0005,
-	0x6003, 0x0001, 0x6106, 0x080c, 0x67a8, 0x0126, 0x2091, 0x8000,
-	0x080c, 0x6c50, 0x012e, 0x0005, 0x6003, 0x0001, 0x6106, 0x080c,
-	0x67a8, 0x0126, 0x2091, 0x8000, 0x080c, 0x6c50, 0x012e, 0x0005,
-	0x6003, 0x0003, 0x6106, 0x2c10, 0x080c, 0x1e6e, 0x0126, 0x2091,
-	0x8000, 0x080c, 0x680b, 0x080c, 0x6d0d, 0x012e, 0x0005, 0xa016,
-	0x080c, 0x1824, 0x0005, 0x0126, 0x2091, 0x8000, 0x0036, 0x00d6,
-	0xa182, 0x0040, 0x0023, 0x00de, 0x003e, 0x012e, 0x0005, 0xa44f,
-	0xa451, 0xa463, 0xa47e, 0xa44f, 0xa44f, 0xa44f, 0xa493, 0xa44f,
-	0xa44f, 0xa44f, 0xa44f, 0xa44f, 0xa44f, 0xa44f, 0xa44f, 0x080c,
-	0x14f6, 0x6010, 0x2068, 0x684c, 0xd0fc, 0x01f8, 0xa09c, 0x0003,
-	0xa39e, 0x0003, 0x01d0, 0x6003, 0x0001, 0x6106, 0x080c, 0x67a8,
-	0x080c, 0x6c50, 0x0498, 0x6010, 0x2068, 0x684c, 0xd0fc, 0x0168,
-	0xa09c, 0x0003, 0xa39e, 0x0003, 0x0140, 0x6003, 0x0001, 0x6106,
-	0x080c, 0x67a8, 0x080c, 0x6c50, 0x0408, 0x6013, 0x0000, 0x6017,
-	0x0000, 0x2019, 0x0004, 0x080c, 0xa91f, 0x00c0, 0x6010, 0x2068,
-	0x684c, 0xd0fc, 0x0d90, 0xa09c, 0x0003, 0xa39e, 0x0003, 0x0d68,
-	0x6003, 0x0003, 0x6106, 0x2c10, 0x080c, 0x1e6e, 0x080c, 0x680b,
-	0x080c, 0x6d0d, 0x0018, 0xa016, 0x080c, 0x1824, 0x0005, 0x080c,
-	0x6b73, 0x6110, 0x81ff, 0x0158, 0x00d6, 0x2168, 0x080c, 0xabfa,
-	0x0036, 0x2019, 0x0029, 0x080c, 0xa91f, 0x003e, 0x00de, 0x080c,
-	0x974e, 0x080c, 0x6c50, 0x0005, 0x080c, 0x6c05, 0x6110, 0x81ff,
-	0x0158, 0x00d6, 0x2168, 0x080c, 0xabfa, 0x0036, 0x2019, 0x0029,
-	0x080c, 0xa91f, 0x003e, 0x00de, 0x080c, 0x974e, 0x080c, 0x6d0d,
-	0x0005, 0xa182, 0x0085, 0x0002, 0xa4cd, 0xa4cb, 0xa4cb, 0xa4d9,
-	0xa4cb, 0xa4cb, 0xa4cb, 0x080c, 0x14f6, 0x6003, 0x000b, 0x6106,
-	0x080c, 0x67a8, 0x0126, 0x2091, 0x8000, 0x080c, 0x6c50, 0x012e,
-	0x0005, 0x0026, 0x00e6, 0x080c, 0xab4e, 0x0118, 0x080c, 0x8078,
-	0x00c8, 0x2071, 0xb280, 0x7224, 0x6212, 0x7220, 0x080c, 0xa7ce,
-	0x0118, 0x6007, 0x0086, 0x0040, 0x6007, 0x0087, 0x7224, 0xa296,
-	0xffff, 0x1110, 0x6007, 0x0086, 0x6003, 0x0001, 0x080c, 0x67a8,
-	0x080c, 0x6c50, 0x00ee, 0x002e, 0x0005, 0xa186, 0x0013, 0x1160,
-	0x6004, 0xa08a, 0x0085, 0x0a0c, 0x14f6, 0xa08a, 0x008c, 0x1a0c,
-	0x14f6, 0xa082, 0x0085, 0x00a2, 0xa186, 0x0027, 0x0130, 0xa186,
-	0x0014, 0x0118, 0x080c, 0x80be, 0x0050, 0x2001, 0x0007, 0x080c,
-	0x4c5d, 0x080c, 0x6b73, 0x080c, 0x974e, 0x080c, 0x6c50, 0x0005,
-	0xa527, 0xa529, 0xa529, 0xa527, 0xa527, 0xa527, 0xa527, 0x080c,
-	0x14f6, 0x080c, 0x6b73, 0x080c, 0x974e, 0x080c, 0x6c50, 0x0005,
-	0xa182, 0x0085, 0x0a0c, 0x14f6, 0xa182, 0x008c, 0x1a0c, 0x14f6,
-	0xa182, 0x0085, 0x0002, 0xa542, 0xa542, 0xa542, 0xa544, 0xa542,
-	0xa542, 0xa542, 0x080c, 0x14f6, 0x0005, 0xa186, 0x0013, 0x0148,
-	0xa186, 0x0014, 0x0130, 0xa186, 0x0027, 0x0118, 0x080c, 0x80be,
-	0x0030, 0x080c, 0x6b73, 0x080c, 0x974e, 0x080c, 0x6c50, 0x0005,
-	0x0036, 0x080c, 0xabb4, 0x603f, 0x0000, 0x2019, 0x000b, 0x0031,
-	0x601f, 0x0006, 0x6003, 0x0007, 0x003e, 0x0005, 0x0126, 0x0036,
-	0x2091, 0x8000, 0x0086, 0x2c40, 0x0096, 0x2049, 0x0000, 0x080c,
-	0x7b9a, 0x009e, 0x008e, 0x1578, 0x0076, 0x2c38, 0x080c, 0x7c34,
-	0x007e, 0x1548, 0x6000, 0xa086, 0x0000, 0x0528, 0x601c, 0xa086,
-	0x0007, 0x0508, 0x00d6, 0x6000, 0xa086, 0x0004, 0x1150, 0x080c,
-	0xabb4, 0x601f, 0x0007, 0x2001, 0xafa3, 0x2004, 0x6016, 0x080c,
-	0x190b, 0x6010, 0x2068, 0x080c, 0x9596, 0x0110, 0x080c, 0xa91f,
-	0x00de, 0x6013, 0x0000, 0x080c, 0xabb4, 0x601f, 0x0007, 0x2001,
-	0xafa3, 0x2004, 0x6016, 0x003e, 0x012e, 0x0005, 0x00f6, 0x00c6,
-	0x0036, 0x0156, 0x2079, 0xb280, 0x7938, 0x783c, 0x080c, 0x2676,
-	0x1904, 0xa5f1, 0x0016, 0x00c6, 0x080c, 0x4cdc, 0x15c0, 0x2011,
-	0xb290, 0xac98, 0x000a, 0x20a9, 0x0004, 0x080c, 0x8a7c, 0x1578,
-	0x001e, 0x002e, 0x0026, 0x0016, 0x2019, 0x0029, 0x080c, 0x7cf4,
-	0x080c, 0x68e7, 0x0076, 0x2039, 0x0000, 0x080c, 0x681d, 0x007e,
-	0x001e, 0x0076, 0x2039, 0x0000, 0x080c, 0xa712, 0x007e, 0x080c,
-	0x4ecf, 0x0026, 0x6204, 0xa294, 0xff00, 0x8217, 0xa286, 0x0006,
-	0x0118, 0xa286, 0x0004, 0x1118, 0x62a0, 0x080c, 0x2b87, 0x002e,
-	0x001e, 0x080c, 0x493a, 0x6612, 0x6516, 0xa006, 0x0010, 0x00ce,
-	0x001e, 0x015e, 0x003e, 0x00ce, 0x00fe, 0x0005, 0x00c6, 0x00d6,
-	0x00e6, 0x0016, 0x2009, 0xad20, 0x2104, 0xa086, 0x0074, 0x1904,
-	0xa64b, 0x2069, 0xb28e, 0x690c, 0xa182, 0x0100, 0x06c0, 0x6908,
-	0xa184, 0x8000, 0x05e8, 0x2001, 0xaf9d, 0x2004, 0xa005, 0x1160,
-	0x6018, 0x2070, 0x7010, 0xa084, 0x00ff, 0x0118, 0x7000, 0xd0f4,
-	0x0118, 0xa184, 0x0800, 0x0560, 0x6910, 0xa18a, 0x0001, 0x0610,
-	0x6914, 0x2069, 0xb2ae, 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, 0x4ceb, 0x00ce, 0x04c0, 0x2011, 0xb296, 0xad98,
-	0x000a, 0x20a9, 0x0004, 0x080c, 0x8a7c, 0x1580, 0x2011, 0xb29a,
-	0xad98, 0x0006, 0x20a9, 0x0004, 0x080c, 0x8a7c, 0x1538, 0x0046,
-	0x0016, 0x6aa0, 0xa294, 0x00ff, 0x8227, 0xa006, 0x2009, 0xad52,
-	0x210c, 0xd1a4, 0x0138, 0x2009, 0x0029, 0x080c, 0xa96c, 0x6800,
-	0xc0e5, 0x6802, 0x2019, 0x0029, 0x080c, 0x68e7, 0x0076, 0x2039,
-	0x0000, 0x080c, 0x681d, 0x2c08, 0x080c, 0xa712, 0x007e, 0x2001,
-	0x0007, 0x080c, 0x4c5d, 0x001e, 0x004e, 0xa006, 0x015e, 0x003e,
-	0x002e, 0x00de, 0x00ce, 0x0005, 0x00d6, 0x2069, 0xb28e, 0x6800,
-	0xa086, 0x0800, 0x0118, 0x6013, 0x0000, 0x0008, 0xa006, 0x00de,
-	0x0005, 0x00c6, 0x00f6, 0x0016, 0x0026, 0x0036, 0x0156, 0x2079,
-	0xb28c, 0x7930, 0x7834, 0x080c, 0x2676, 0x11a0, 0x080c, 0x4cdc,
-	0x1188, 0x2011, 0xb290, 0xac98, 0x000a, 0x20a9, 0x0004, 0x080c,
-	0x8a7c, 0x1140, 0x2011, 0xb294, 0xac98, 0x0006, 0x20a9, 0x0004,
-	0x080c, 0x8a7c, 0x015e, 0x003e, 0x002e, 0x001e, 0x00fe, 0x00ce,
-	0x0005, 0x00c6, 0x0006, 0x0016, 0x0026, 0x0036, 0x0156, 0x2011,
-	0xb283, 0x2204, 0x8211, 0x220c, 0x080c, 0x2676, 0x11a0, 0x080c,
-	0x4cdc, 0x1188, 0x2011, 0xb296, 0xac98, 0x000a, 0x20a9, 0x0004,
-	0x080c, 0x8a7c, 0x1140, 0x2011, 0xb29a, 0xac98, 0x0006, 0x20a9,
-	0x0004, 0x080c, 0x8a7c, 0x015e, 0x003e, 0x002e, 0x001e, 0x000e,
-	0x00ce, 0x0005, 0x00e6, 0x00c6, 0x0086, 0x0076, 0x0066, 0x0056,
-	0x0046, 0x0026, 0x0126, 0x2091, 0x8000, 0x2740, 0x2029, 0xafd0,
-	0x252c, 0x2021, 0xafd6, 0x2424, 0x2061, 0xb400, 0x2071, 0xad00,
-	0x7644, 0x7064, 0x81ff, 0x0128, 0x8001, 0xa602, 0x1a04, 0xa78e,
-	0x0018, 0xa606, 0x0904, 0xa78e, 0x2100, 0xac06, 0x0904, 0xa785,
-	0x080c, 0xa990, 0x0904, 0xa785, 0x671c, 0xa786, 0x0001, 0x0904,
-	0xa7a5, 0xa786, 0x0004, 0x0904, 0xa7a5, 0xa786, 0x0007, 0x05e8,
-	0x2500, 0xac06, 0x05d0, 0x2400, 0xac06, 0x05b8, 0x080c, 0xa9a0,
-	0x15a0, 0x88ff, 0x0118, 0x6050, 0xa906, 0x1578, 0x00d6, 0x6000,
-	0xa086, 0x0004, 0x1120, 0x0016, 0x080c, 0x190b, 0x001e, 0xa786,
-	0x0008, 0x1148, 0x080c, 0x9789, 0x1130, 0x080c, 0x85f3, 0x00de,
-	0x080c, 0x974e, 0x00d0, 0x6010, 0x2068, 0x080c, 0x9596, 0x0190,
-	0xa786, 0x0003, 0x1528, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000,
-	0x080c, 0xabfa, 0x0016, 0x080c, 0x97fd, 0x080c, 0x510c, 0x001e,
-	0x080c, 0x9742, 0x00de, 0x080c, 0x974e, 0xace0, 0x0018, 0x2001,
-	0xad16, 0x2004, 0xac02, 0x1210, 0x0804, 0xa726, 0x012e, 0x002e,
-	0x004e, 0x005e, 0x006e, 0x007e, 0x008e, 0x00ce, 0x00ee, 0x0005,
-	0xa786, 0x0006, 0x19c0, 0xa386, 0x0005, 0x0128, 0x080c, 0xabfa,
-	0x080c, 0xa91f, 0x08f8, 0x00de, 0x0c00, 0x080c, 0xa9a0, 0x19e8,
-	0x81ff, 0x09d8, 0xa180, 0x0001, 0x2004, 0xa086, 0x0018, 0x0130,
-	0xa180, 0x0001, 0x2004, 0xa086, 0x002d, 0x1978, 0x6000, 0xa086,
-	0x0002, 0x1958, 0x080c, 0x9778, 0x0130, 0x080c, 0x9789, 0x1928,
-	0x080c, 0x85f3, 0x0038, 0x080c, 0x2aff, 0x080c, 0x9789, 0x1110,
-	0x080c, 0x85f3, 0x080c, 0x974e, 0x0804, 0xa785, 0x00c6, 0x00e6,
-	0x0016, 0x2c08, 0x2170, 0x080c, 0xa940, 0x001e, 0x0120, 0x601c,
-	0xa084, 0x000f, 0x001b, 0x00ee, 0x00ce, 0x0005, 0xa7e6, 0xa7e6,
-	0xa7e6, 0xa7e6, 0xa7e6, 0xa7e6, 0xa7e8, 0xa7e6, 0xa006, 0x0005,
-	0x0046, 0x0016, 0x7018, 0xa080, 0x0028, 0x2024, 0xa4a4, 0x00ff,
-	0x8427, 0x2c00, 0x2009, 0x0020, 0x080c, 0xa96c, 0x001e, 0x004e,
-	0x0036, 0x2019, 0x0002, 0x080c, 0xa566, 0x003e, 0xa085, 0x0001,
-	0x0005, 0x2001, 0x0001, 0x080c, 0x4c1e, 0x0156, 0x0016, 0x0026,
-	0x0036, 0x20a9, 0x0004, 0x2019, 0xad05, 0x2011, 0xb296, 0x080c,
-	0x8a7c, 0x003e, 0x002e, 0x001e, 0x015e, 0xa005, 0x0005, 0x00f6,
-	0x00e6, 0x00c6, 0x0086, 0x0076, 0x0066, 0x0026, 0x0126, 0x2091,
-	0x8000, 0x2740, 0x2061, 0xb400, 0x2079, 0x0001, 0x8fff, 0x0904,
-	0xa875, 0x2071, 0xad00, 0x7644, 0x7064, 0x8001, 0xa602, 0x1a04,
-	0xa875, 0x88ff, 0x0128, 0x2800, 0xac06, 0x15b0, 0x2079, 0x0000,
-	0x080c, 0xa990, 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, 0xabb4, 0x601f, 0x0007,
-	0x2001, 0xafa3, 0x2004, 0x6016, 0x080c, 0x190b, 0x6010, 0x2068,
-	0x080c, 0x9596, 0x0120, 0x0046, 0x080c, 0xa91f, 0x004e, 0x00de,
-	0x080c, 0x974e, 0x88ff, 0x1198, 0xace0, 0x0018, 0x2001, 0xad16,
-	0x2004, 0xac02, 0x1210, 0x0804, 0xa826, 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, 0x7b9a, 0x009e, 0x008e, 0x2039, 0x0000, 0x080c, 0x7c34,
-	0x080c, 0xa817, 0x005e, 0x007e, 0x0005, 0x0026, 0x0046, 0x0056,
-	0x0076, 0x00c6, 0x0156, 0x2c20, 0x2128, 0x20a9, 0x007f, 0x2009,
-	0x0000, 0x0016, 0x0036, 0x080c, 0x4cdc, 0x11b0, 0x2c10, 0x0056,
-	0x0086, 0x2041, 0x0000, 0x2508, 0x2029, 0x0001, 0x0096, 0x2049,
-	0x0000, 0x080c, 0x7b9a, 0x009e, 0x008e, 0x2039, 0x0000, 0x080c,
-	0x7c34, 0x080c, 0xa817, 0x005e, 0x003e, 0x001e, 0x8108, 0x1f04,
-	0xa8a9, 0x015e, 0x00ce, 0x007e, 0x005e, 0x004e, 0x002e, 0x0005,
-	0x0076, 0x0056, 0x6218, 0x0086, 0x2041, 0x0000, 0x2029, 0x0001,
-	0x2019, 0x0048, 0x0096, 0x2049, 0x0000, 0x080c, 0x7b9a, 0x009e,
-	0x008e, 0x2039, 0x0000, 0x080c, 0x7c34, 0x2c20, 0x080c, 0xa817,
-	0x005e, 0x007e, 0x0005, 0x0026, 0x0046, 0x0056, 0x0076, 0x00c6,
-	0x0156, 0x2c20, 0x20a9, 0x007f, 0x2009, 0x0000, 0x0016, 0x0036,
-	0x080c, 0x4cdc, 0x11c0, 0x2c10, 0x0086, 0x2041, 0x0000, 0x2828,
-	0x0046, 0x2021, 0x0001, 0x080c, 0xab96, 0x004e, 0x0096, 0x2049,
-	0x0000, 0x080c, 0x7b9a, 0x009e, 0x008e, 0x2039, 0x0000, 0x080c,
-	0x7c34, 0x080c, 0xa817, 0x003e, 0x001e, 0x8108, 0x1f04, 0xa8f6,
-	0x015e, 0x00ce, 0x007e, 0x005e, 0x004e, 0x002e, 0x0005, 0x0016,
-	0x00f6, 0x3800, 0xd08c, 0x0130, 0xad82, 0x1000, 0x02b0, 0xad82,
-	0xad00, 0x0230, 0xad82, 0xe400, 0x0280, 0xad82, 0xffff, 0x1268,
-	0x6800, 0xa07d, 0x0138, 0x6803, 0x0000, 0x6b52, 0x080c, 0x510c,
-	0x2f68, 0x0cb0, 0x6b52, 0x080c, 0x510c, 0x00fe, 0x001e, 0x0005,
-	0x00e6, 0x0046, 0x0036, 0x2061, 0xb400, 0x2071, 0xad00, 0x7444,
-	0x7064, 0x8001, 0xa402, 0x12d8, 0x2100, 0xac06, 0x0168, 0x6000,
-	0xa086, 0x0000, 0x0148, 0x6008, 0xa206, 0x1130, 0x6018, 0xa1a0,
-	0x0006, 0x2424, 0xa406, 0x0140, 0xace0, 0x0018, 0x2001, 0xad16,
-	0x2004, 0xac02, 0x1220, 0x0c08, 0xa085, 0x0001, 0x0008, 0xa006,
-	0x003e, 0x004e, 0x00ee, 0x0005, 0x00d6, 0x0006, 0x080c, 0x15d9,
-	0x000e, 0x090c, 0x14f6, 0x6837, 0x010d, 0x685e, 0x0026, 0x2010,
-	0x080c, 0x9586, 0x2001, 0x0000, 0x0120, 0x2200, 0xa080, 0x0014,
-	0x2004, 0x002e, 0x684a, 0x6956, 0x6c46, 0x684f, 0x0000, 0xa006,
-	0x68b2, 0x6802, 0x683a, 0x685a, 0x080c, 0x510c, 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, 0xafa4, 0x2004, 0x6016, 0x080c, 0x67a8, 0x080c, 0x6c50,
-	0x001e, 0x0005, 0xe000, 0xe000, 0x0005, 0x6020, 0xd0e4, 0x0158,
-	0xd0cc, 0x0118, 0x080c, 0x9866, 0x0030, 0x080c, 0xabb4, 0x080c,
-	0x6618, 0x080c, 0x8078, 0x0005, 0xa280, 0x0007, 0x2004, 0xa084,
-	0x000f, 0x0002, 0xa9e3, 0xa9e3, 0xa9e3, 0xa9e8, 0xa9e3, 0xa9e5,
-	0xa9e5, 0xa9e3, 0xa9e5, 0xa006, 0x0005, 0x00c6, 0x2260, 0x00ce,
-	0xa085, 0x0001, 0x0005, 0xa280, 0x0007, 0x2004, 0xa084, 0x000f,
-	0x0002, 0xa9fa, 0xa9fa, 0xa9fa, 0xa9fa, 0xa9fa, 0xa9fa, 0xaa05,
-	0xa9fa, 0xa9fa, 0x6007, 0x003b, 0x602b, 0x0009, 0x6013, 0x2a00,
-	0x6003, 0x0001, 0x080c, 0x67a8, 0x0005, 0x00c6, 0x2260, 0x080c,
-	0xabb4, 0x603f, 0x0000, 0x6020, 0xc0f4, 0xc0cc, 0x6022, 0x6037,
-	0x0000, 0x00ce, 0x00d6, 0x2268, 0xa186, 0x0007, 0x1904, 0xaa60,
-	0x6810, 0xa005, 0x0138, 0xa080, 0x0013, 0x2004, 0xd0fc, 0x1110,
-	0x00de, 0x08c0, 0x6007, 0x003a, 0x6003, 0x0001, 0x080c, 0x67a8,
-	0x080c, 0x6c50, 0x00c6, 0x2d60, 0x6100, 0xa186, 0x0002, 0x1904,
-	0xaae7, 0x6010, 0xa005, 0x1138, 0x6000, 0xa086, 0x0007, 0x190c,
-	0x14f6, 0x0804, 0xaae7, 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, 0xa3de, 0x0804, 0xaae7, 0x2009, 0x0041, 0x0804, 0xaae1,
-	0xa186, 0x0005, 0x15f0, 0x6810, 0xa080, 0x0013, 0x2004, 0xd0bc,
-	0x1118, 0x00de, 0x0804, 0xa9fa, 0xd0b4, 0x0128, 0xd0fc, 0x090c,
-	0x14f6, 0x0804, 0xaa18, 0x6007, 0x003a, 0x6003, 0x0001, 0x080c,
-	0x67a8, 0x080c, 0x6c50, 0x00c6, 0x2d60, 0x6100, 0xa186, 0x0002,
-	0x0120, 0xa186, 0x0004, 0x1904, 0xaae7, 0x2071, 0xaffd, 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,
-	0xaae1, 0x0036, 0x00d6, 0x00d6, 0x080c, 0x15d9, 0x003e, 0x090c,
-	0x14f6, 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,
-	0x6d6a, 0x6e66, 0x686f, 0x0001, 0x080c, 0x510c, 0x2019, 0x0045,
-	0x6008, 0x2068, 0x080c, 0xa566, 0x2d00, 0x600a, 0x601f, 0x0006,
-	0x6003, 0x0007, 0x6017, 0x0000, 0x603f, 0x0000, 0x00de, 0x003e,
-	0x0038, 0x603f, 0x0000, 0x6003, 0x0007, 0x080c, 0xa3de, 0x00ce,
-	0x00de, 0x0005, 0xa186, 0x0013, 0x1128, 0x6004, 0xa082, 0x0085,
-	0x2008, 0x00c2, 0xa186, 0x0027, 0x1178, 0x080c, 0x6b73, 0x0036,
-	0x00d6, 0x6010, 0x2068, 0x2019, 0x0004, 0x080c, 0xa91f, 0x00de,
-	0x003e, 0x080c, 0x6c50, 0x0005, 0xa186, 0x0014, 0x0d70, 0x080c,
-	0x80be, 0x0005, 0xab13, 0xab11, 0xab11, 0xab11, 0xab11, 0xab11,
-	0xab13, 0x080c, 0x14f6, 0x080c, 0x6b73, 0x6003, 0x000c, 0x080c,
-	0x6c50, 0x0005, 0xa182, 0x008c, 0x1220, 0xa182, 0x0085, 0x0208,
-	0x001a, 0x080c, 0x80be, 0x0005, 0xab2b, 0xab2b, 0xab2b, 0xab2b,
-	0xab2d, 0xab4b, 0xab2b, 0x080c, 0x14f6, 0x00d6, 0x2c68, 0x080c,
-	0x8022, 0x01a0, 0x6003, 0x0001, 0x6007, 0x001e, 0x2009, 0xb28e,
-	0x210c, 0x6136, 0x2009, 0xb28f, 0x210c, 0x613a, 0x600b, 0xffff,
-	0x6918, 0x611a, 0x601f, 0x0004, 0x080c, 0x67a8, 0x2d60, 0x080c,
-	0x8078, 0x00de, 0x0005, 0x080c, 0x8078, 0x0005, 0x00e6, 0x6018,
-	0x2070, 0x7000, 0xd0ec, 0x00ee, 0x0005, 0x6010, 0xa080, 0x0013,
-	0x200c, 0xd1ec, 0x05d0, 0x2001, 0xad71, 0x2004, 0xd0ec, 0x05a8,
-	0x6003, 0x0002, 0x6020, 0xc0e5, 0x6022, 0xd1ac, 0x0180, 0x00f6,
-	0x2c78, 0x080c, 0x5025, 0x00fe, 0x0150, 0x2001, 0xafa5, 0x2004,
-	0x603e, 0x2009, 0xad71, 0x210c, 0xd1f4, 0x11e8, 0x0080, 0x2009,
-	0xad71, 0x210c, 0xd1f4, 0x0128, 0x6020, 0xc0e4, 0x6022, 0xa006,
-	0x00a0, 0x2001, 0xafa5, 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,
-	0x6618, 0x080c, 0x8078, 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, 0xad27, 0x2204, 0xa084, 0x00ff, 0x2019, 0xb28e, 0x2334,
-	0xa636, 0x11d8, 0x8318, 0x2334, 0x2204, 0xa084, 0xff00, 0xa636,
-	0x11a0, 0x2011, 0xb290, 0x6018, 0xa098, 0x000a, 0x20a9, 0x0004,
-	0x080c, 0x8a7c, 0x1150, 0x2011, 0xb294, 0x6018, 0xa098, 0x0006,
-	0x20a9, 0x0004, 0x080c, 0x8a7c, 0x1100, 0x015e, 0x003e, 0x002e,
-	0x0005, 0x00e6, 0x2071, 0xad00, 0x080c, 0x48f5, 0x080c, 0x28fa,
-	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, 0xafd0, 0x252c, 0x2021, 0xafd6, 0x2424,
-	0x2061, 0xb400, 0x2071, 0xad00, 0x7644, 0x7064, 0xa606, 0x0578,
-	0x671c, 0xa786, 0x0001, 0x0118, 0xa786, 0x0008, 0x1500, 0x2500,
-	0xac06, 0x01e8, 0x2400, 0xac06, 0x01d0, 0x080c, 0xa990, 0x01b8,
-	0x080c, 0xa9a0, 0x11a0, 0x6000, 0xa086, 0x0004, 0x1120, 0x0016,
-	0x080c, 0x190b, 0x001e, 0x080c, 0x9778, 0x1110, 0x080c, 0x2aff,
-	0x080c, 0x9789, 0x1110, 0x080c, 0x85f3, 0x080c, 0x974e, 0xace0,
-	0x0018, 0x2001, 0xad16, 0x2004, 0xac02, 0x1208, 0x0858, 0x012e,
-	0x001e, 0x002e, 0x004e, 0x005e, 0x006e, 0x007e, 0x00ce, 0x00ee,
-	0x0005, 0x0126, 0x0006, 0x00e6, 0x2091, 0x8000, 0x2071, 0xad40,
-	0xd5a4, 0x0118, 0x7034, 0x8000, 0x7036, 0xd5b4, 0x0118, 0x7030,
-	0x8000, 0x7032, 0xd5ac, 0x0118, 0x2071, 0xad4a, 0x0451, 0x00ee,
-	0x000e, 0x012e, 0x0005, 0x0126, 0x0006, 0x00e6, 0x2091, 0x8000,
-	0x2071, 0xad40, 0xd5a4, 0x0118, 0x7034, 0x8000, 0x7036, 0xd5b4,
-	0x0118, 0x7030, 0x8000, 0x7032, 0xd5ac, 0x0118, 0x2071, 0xad4a,
-	0x0081, 0x00ee, 0x000e, 0x012e, 0x0005, 0x0126, 0x0006, 0x00e6,
-	0x2091, 0x8000, 0x2071, 0xad42, 0x0021, 0x00ee, 0x000e, 0x012e,
-	0x0005, 0x2e04, 0x8000, 0x2072, 0x1220, 0x8e70, 0x2e04, 0x8000,
-	0x2072, 0x0005, 0x00e6, 0x2071, 0xad40, 0x0c99, 0x00ee, 0x0005,
-	0x00e6, 0x2071, 0xad44, 0x0c69, 0x00ee, 0x0005, 0x0001, 0x0002,
-	0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080, 0x0100, 0x0200,
-	0x0400, 0x0800, 0x1000, 0x2000, 0x4000, 0x8000, 0x8529
-};
-
--- diff/drivers/usb/core/usb-debug.c	2003-08-20 14:16:31.000000000 +0100
+++ source/drivers/usb/core/usb-debug.c	1970-01-01 01:00:00.000000000 +0100
@@ -1,201 +0,0 @@
-/*
- * debug.c - USB debug helper routines.
- *
- * I just want these out of the way where they aren't in your
- * face, but so that you can still use them..
- */
-#include <linux/config.h>
-#include <linux/kernel.h>
-#include <linux/mm.h>
-#include <linux/slab.h>
-#ifdef CONFIG_USB_DEBUG
-	#define DEBUG
-#else
-	#undef DEBUG
-#endif
-#include <linux/usb.h>
-
-static void usb_show_endpoint(struct usb_host_endpoint *endpoint)
-{
-	usb_show_endpoint_descriptor(&endpoint->desc);
-}
-
-static void usb_show_interface(struct usb_host_interface *altsetting)
-{
-	int i;
-
-	usb_show_interface_descriptor(&altsetting->desc);
-
-	for (i = 0; i < altsetting->desc.bNumEndpoints; i++)
-		usb_show_endpoint(altsetting->endpoint + i);
-}
-
-static void usb_show_config(struct usb_host_config *config)
-{
-	int i, j;
-	struct usb_interface *ifp;
-
-	usb_show_config_descriptor(&config->desc);
-	for (i = 0; i < config->desc.bNumInterfaces; i++) {
-		ifp = config->interface[i];
-
-		if (!ifp)
-			break;
-
-		printk("\n  Interface: %d\n", i);
-		for (j = 0; j < ifp->num_altsetting; j++)
-			usb_show_interface(ifp->altsetting + j);
-	}
-}
-
-void usb_show_device(struct usb_device *dev)
-{
-	int i;
-
-	usb_show_device_descriptor(&dev->descriptor);
-	for (i = 0; i < dev->descriptor.bNumConfigurations; i++)
-		usb_show_config(dev->config + i);
-}
-
-/*
- * Parse and show the different USB descriptors.
- */
-void usb_show_device_descriptor(struct usb_device_descriptor *desc)
-{
-	if (!desc)
-	{
-		printk("Invalid USB device descriptor (NULL POINTER)\n");
-		return;
-	}
-	printk("  Length              = %2d%s\n", desc->bLength,
-		desc->bLength == USB_DT_DEVICE_SIZE ? "" : " (!!!)");
-	printk("  DescriptorType      = %02x\n", desc->bDescriptorType);
-
-	printk("  USB version         = %x.%02x\n",
-		desc->bcdUSB >> 8, desc->bcdUSB & 0xff);
-	printk("  Vendor:Product      = %04x:%04x\n",
-		desc->idVendor, desc->idProduct);
-	printk("  MaxPacketSize0      = %d\n", desc->bMaxPacketSize0);
-	printk("  NumConfigurations   = %d\n", desc->bNumConfigurations);
-	printk("  Device version      = %x.%02x\n",
-		desc->bcdDevice >> 8, desc->bcdDevice & 0xff);
-
-	printk("  Device Class:SubClass:Protocol = %02x:%02x:%02x\n",
-		desc->bDeviceClass, desc->bDeviceSubClass, desc->bDeviceProtocol);
-	switch (desc->bDeviceClass) {
-	case 0:
-		printk("    Per-interface classes\n");
-		break;
-	case USB_CLASS_AUDIO:
-		printk("    Audio device class\n");
-		break;
-	case USB_CLASS_COMM:
-		printk("    Communications class\n");
-		break;
-	case USB_CLASS_HID:
-		printk("    Human Interface Devices class\n");
-		break;
-	case USB_CLASS_PRINTER:
-		printk("    Printer device class\n");
-		break;
-	case USB_CLASS_MASS_STORAGE:
-		printk("    Mass Storage device class\n");
-		break;
-	case USB_CLASS_HUB:
-		printk("    Hub device class\n");
-		break;
-	case USB_CLASS_VENDOR_SPEC:
-		printk("    Vendor class\n");
-		break;
-	default:
-		printk("    Unknown class\n");
-	}
-}
-
-void usb_show_config_descriptor(struct usb_config_descriptor *desc)
-{
-	printk("Configuration:\n");
-	printk("  bLength             = %4d%s\n", desc->bLength,
-		desc->bLength == USB_DT_CONFIG_SIZE ? "" : " (!!!)");
-	printk("  bDescriptorType     =   %02x\n", desc->bDescriptorType);
-	printk("  wTotalLength        = %04x\n", desc->wTotalLength);
-	printk("  bNumInterfaces      =   %02x\n", desc->bNumInterfaces);
-	printk("  bConfigurationValue =   %02x\n", desc->bConfigurationValue);
-	printk("  iConfiguration      =   %02x\n", desc->iConfiguration);
-	printk("  bmAttributes        =   %02x\n", desc->bmAttributes);
-	printk("  bMaxPower            = %4dmA\n", desc->bMaxPower * 2);
-}
-
-void usb_show_interface_descriptor(struct usb_interface_descriptor *desc)
-{
-	printk("  Alternate Setting: %2d\n", desc->bAlternateSetting);
-	printk("    bLength             = %4d%s\n", desc->bLength,
-		desc->bLength == USB_DT_INTERFACE_SIZE ? "" : " (!!!)");
-	printk("    bDescriptorType     =   %02x\n", desc->bDescriptorType);
-	printk("    bInterfaceNumber    =   %02x\n", desc->bInterfaceNumber);
-	printk("    bAlternateSetting   =   %02x\n", desc->bAlternateSetting);
-	printk("    bNumEndpoints       =   %02x\n", desc->bNumEndpoints);
-	printk("    bInterface Class:SubClass:Protocol =   %02x:%02x:%02x\n",
-		desc->bInterfaceClass, desc->bInterfaceSubClass, desc->bInterfaceProtocol);
-	printk("    iInterface          =   %02x\n", desc->iInterface);
-}
-
-void usb_show_endpoint_descriptor(struct usb_endpoint_descriptor *desc)
-{
-	char *LengthCommentString = (desc->bLength ==
-		USB_DT_ENDPOINT_AUDIO_SIZE) ? " (Audio)" : (desc->bLength ==
-		USB_DT_ENDPOINT_SIZE) ? "" : " (!!!)";
-	char *EndpointType[4] = { "Control", "Isochronous", "Bulk", "Interrupt" };
-
-	printk("    Endpoint:\n");
-	printk("      bLength             = %4d%s\n",
-		desc->bLength, LengthCommentString);
-	printk("      bDescriptorType     =   %02x\n", desc->bDescriptorType);
-	printk("      bEndpointAddress    =   %02x (%s)\n", desc->bEndpointAddress,
-		(desc->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
-			USB_ENDPOINT_XFER_CONTROL ? "i/o" :
-		(desc->bEndpointAddress & USB_ENDPOINT_DIR_MASK) ? "in" : "out");
-	printk("      bmAttributes        =   %02x (%s)\n", desc->bmAttributes,
-		EndpointType[USB_ENDPOINT_XFERTYPE_MASK & desc->bmAttributes]);
-	printk("      wMaxPacketSize      = %04x\n", desc->wMaxPacketSize);
-	printk("      bInterval           =   %02x\n", desc->bInterval);
-
-	/* Audio extensions to the endpoint descriptor */
-	if (desc->bLength == USB_DT_ENDPOINT_AUDIO_SIZE) {
-		printk("      bRefresh            =   %02x\n", desc->bRefresh);
-		printk("      bSynchAddress       =   %02x\n", desc->bSynchAddress);
-	}
-}
-
-void usb_show_string(struct usb_device *dev, char *id, int index)
-{
-	char *buf;
-
-	if (!index)
-		return;
-	if (!(buf = kmalloc(256, GFP_KERNEL)))
-		return;
-	if (usb_string(dev, index, buf, 256) > 0)
-		dev_printk(KERN_INFO, &dev->dev, "%s: %s\n", id, buf);
-	kfree(buf);
-}
-
-void usb_dump_urb (struct urb *urb)
-{
-	printk ("urb                   :%p\n", urb);
-	printk ("dev                   :%p\n", urb->dev);
-	printk ("pipe                  :%08X\n", urb->pipe);
-	printk ("status                :%d\n", urb->status);
-	printk ("transfer_flags        :%08X\n", urb->transfer_flags);
-	printk ("transfer_buffer       :%p\n", urb->transfer_buffer);
-	printk ("transfer_buffer_length:%d\n", urb->transfer_buffer_length);
-	printk ("actual_length         :%d\n", urb->actual_length);
-	printk ("setup_packet          :%p\n", urb->setup_packet);
-	printk ("start_frame           :%d\n", urb->start_frame);
-	printk ("number_of_packets     :%d\n", urb->number_of_packets);
-	printk ("interval              :%d\n", urb->interval);
-	printk ("error_count           :%d\n", urb->error_count);
-	printk ("context               :%p\n", urb->context);
-	printk ("complete              :%p\n", urb->complete);
-}
-
--- diff/fs/devfs/internal.h	2003-02-13 11:46:39.000000000 +0000
+++ source/fs/devfs/internal.h	1970-01-01 01:00:00.000000000 +0100
@@ -1,3 +0,0 @@
-
-extern dev_t devfs_alloc_devnum(umode_t mode);
-extern void devfs_dealloc_devnum(umode_t mode, dev_t devnum);
--- diff/include/asm-i386/memblk.h	2003-06-30 10:07:24.000000000 +0100
+++ source/include/asm-i386/memblk.h	1970-01-01 01:00:00.000000000 +0100
@@ -1,23 +0,0 @@
-#ifndef _ASM_I386_MEMBLK_H_
-#define _ASM_I386_MEMBLK_H_
-
-#include <linux/device.h>
-#include <linux/mmzone.h>
-#include <linux/memblk.h>
-#include <linux/topology.h>
-
-#include <asm/node.h>
-
-struct i386_memblk {
-	struct memblk memblk;
-};
-extern struct i386_memblk memblk_devices[MAX_NR_MEMBLKS];
-
-static inline int arch_register_memblk(int num){
-	int p_node = memblk_to_node(num);
-
-	return register_memblk(&memblk_devices[num].memblk, num, 
-				&node_devices[p_node].node);
-}
-
-#endif /* _ASM_I386_MEMBLK_H_ */
--- diff/include/asm-ia64/sn/alenlist.h	2004-02-09 10:36:12.000000000 +0000
+++ source/include/asm-ia64/sn/alenlist.h	1970-01-01 01:00:00.000000000 +0100
@@ -1,204 +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) 1992 - 1997, 2000-2003 Silicon Graphics, Inc. All rights reserved.
- */
-#ifndef _ASM_IA64_SN_ALENLIST_H
-#define _ASM_IA64_SN_ALENLIST_H
-
-#include <linux/types.h>
-
-/* Definition of Address/Length List */
-
-/*
- * An Address/Length List is used when setting up for an I/O DMA operation.
- * A driver creates an Address/Length List that describes to the the DMA 
- * interface where in memory the DMA should go.  The bus interface sets up 
- * mapping registers, if required, and returns a suitable list of "physical 
- * addresses" or "I/O address" to the driver.  The driver then uses these 
- * to set up an appropriate scatter/gather operation(s).
- */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * An Address/Length List Address.  It'll get cast to the appropriate type,
- * and must be big enough to hold the largest possible address in any
- * supported address space.
- */
-typedef u64 alenaddr_t;
-typedef u64 uvaddr_t;
-
-typedef struct alenlist_s *alenlist_t;
-
-/* 
- * For tracking progress as we walk down an address/length list.
- */
-typedef struct alenlist_cursor_s *alenlist_cursor_t;
-
-/*
- * alenlist representation that can be passed via an idl
- */
-struct external_alenlist {
-	alenaddr_t	addr;
-	size_t		len;
-};
-typedef struct external_alenlist *external_alenlist_t;
-
-
-/* Return codes from alenlist routines.  */
-#define ALENLIST_FAILURE (-1)
-#define ALENLIST_SUCCESS 0
-
-
-/* Flags to alenlist routines */
-#define AL_NOSLEEP	0x01		/* Do not sleep, waiting for memory */
-#define AL_NOCOMPACT	0x02		/* Do not try to compact adjacent entries */
-#define AL_LEAVE_CURSOR	0x04		/* Do not update cursor */
-
-
-/* Create an Address/Length List, and clear it of all entries.  */
-extern alenlist_t alenlist_create(unsigned flags);
-
-/* Grow/shrink an Address/Length List and FIX its size. */
-extern int alenlist_grow(alenlist_t, size_t npairs);
-
-/* Clear an Address/Length List so that it now describes 0 pairs. */
-extern void alenlist_clear(alenlist_t alenlist);
-
-/*
- * Convenience function to create an Address/Length List and then append 
- * the specified Address/Length Pair.  Exactly the same as alenlist_create 
- * followed by alenlist_append.  Can be used when a small list (e.g. 1 pair)
- * is adequate.
- */
-extern alenlist_t
-alenpair_init(	alenaddr_t address, 			/* init to this address */
-		size_t length);				/* init to this length */
-
-/* 
- * Peek at the head of an Address/Length List.  This does *NOT* update
- * the internal cursor.
- */
-extern int
-alenpair_get(	alenlist_t alenlist,		/* in: get from this List */
-		alenaddr_t *address,		/* out: address */
-		size_t *length);		/* out: length */
-
-/* Free the space consumed by an Address/Length List. */
-extern void alenlist_destroy(alenlist_t alenlist);
-
-/*
- * Indicate that we're done using an Address/Length List.
- * If we are the last user, destroy the List.
- */
-extern void
-alenlist_done(alenlist_t alenlist);
-
-/* Append another Pair to a List */
-extern int alenlist_append(alenlist_t alenlist, 	/* append to this list */
-			alenaddr_t address,		/* address to append */
-			size_t length,			/* length to append */
-			unsigned flags);
-
-/* 
- * Replace a Pair in the middle of a List, and return old values.
- * (not generally useful for drivers; used by bus providers).
- */
-extern int
-alenlist_replace(	alenlist_t alenlist, 		/* in: replace in this list */
-			alenlist_cursor_t cursorp,	/* inout: which item to replace */
-			alenaddr_t *addrp, 		/* inout: address */
-			size_t *lengthp,		/* inout: length */
-			unsigned flags);
-
-
-/* Get the next Pair from a List */
-extern int alenlist_get(alenlist_t alenlist, 		/* in: get from this list */
-			alenlist_cursor_t cursorp,	/* inout: which item to get */
-			size_t maxlength,		/* in: at most length */
-			alenaddr_t *addr, 		/* out: address */
-			size_t *length,			/* out: length */
-			unsigned flags);
-
-
-/* Return the number of Pairs stored in this List */
-extern int alenlist_size(alenlist_t alenlist);
-
-/* Concatenate two Lists. */
-extern void alenlist_concat(	alenlist_t from, 	/* copy from this list */
-				alenlist_t to);		/* to this list */
-
-/* Create a copy of an Address/Length List */
-extern alenlist_t alenlist_clone(alenlist_t old,	/* clone this list */
-				 unsigned flags);
-
-
-/* Allocate and initialize an Address/Length List Cursor */
-extern alenlist_cursor_t alenlist_cursor_create(alenlist_t alenlist, unsigned flags);
-
-/* Free an Address/Length List Cursor */
-extern void alenlist_cursor_destroy(alenlist_cursor_t cursorp);
-
-/*
- * Initialize an Address/Length List Cursor in order to walk thru an
- * Address/Length List from the beginning.
- */
-extern int alenlist_cursor_init(alenlist_t alenlist, 
-				size_t offset, 
-				alenlist_cursor_t cursorp);
-
-/* Clone an Address/Length List Cursor. */
-extern int alenlist_cursor_clone(alenlist_t alenlist, 
-				alenlist_cursor_t cursorp_in, 
-				alenlist_cursor_t cursorp_out);
-
-/* 
- * Return the number of bytes passed so far according to the specified
- * Address/Length List Cursor.
- */
-extern size_t alenlist_cursor_offset(alenlist_t alenlist, alenlist_cursor_t cursorp);
-
-
-
-
-/* Convert from a Kernel Virtual Address to a Physical Address/Length List */
-extern alenlist_t kvaddr_to_alenlist(	alenlist_t alenlist, 
-					caddr_t kvaddr, 
-					size_t length, 
-					unsigned flags);
-
-/* Convert from a User Virtual Address to a Physical Address/Length List */
-extern alenlist_t uvaddr_to_alenlist(	alenlist_t alenlist,
-					uvaddr_t vaddr, 
-					size_t length,
-					unsigned flags);
-
-/* Convert from a buf struct to a Physical Address/Length List */
-struct buf;
-extern alenlist_t buf_to_alenlist(	alenlist_t alenlist, 
-					struct buf *buf, 
-					unsigned flags);
-
-
-/* 
- * Tracking position as we walk down an Address/Length List.
- * This structure is NOT generally for use by device drivers.
- */
-struct alenlist_cursor_s {
-	struct alenlist_s	*al_alenlist;	/* which list */
-	size_t			al_offset;	/* total bytes passed by cursor */
-	struct alenlist_chunk_s	*al_chunk;	/* which chunk in alenlist */
-	unsigned int		al_index;	/* which pair in chunk */
-	size_t			al_bcount;	/* offset into address/length pair */
-};
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _ASM_IA64_SN_ALENLIST_H */
--- diff/include/asm-um/spinlock.h	2002-10-16 04:29:02.000000000 +0100
+++ source/include/asm-um/spinlock.h	1970-01-01 01:00:00.000000000 +0100
@@ -1,10 +0,0 @@
-#ifndef __UM_SPINLOCK_H
-#define __UM_SPINLOCK_H
-
-#include "linux/config.h"
-
-#ifdef CONFIG_SMP
-#include "asm/arch/spinlock.h"
-#endif
-
-#endif
--- diff/include/asm-x86_64/memblk.h	2004-01-19 10:22:59.000000000 +0000
+++ source/include/asm-x86_64/memblk.h	1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-#include <asm-i386/memblk.h>
--- diff/include/linux/if_pppvar.h	2002-10-16 04:29:05.000000000 +0100
+++ source/include/linux/if_pppvar.h	1970-01-01 01:00:00.000000000 +0100
@@ -1,138 +0,0 @@
-/*	From: if_pppvar.h,v 1.2 1995/06/12 11:36:51 paulus Exp */
-/*
- * if_pppvar.h - private structures and declarations for PPP.
- *
- * Copyright (c) 1994 The Australian National University.
- * All rights reserved.
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation is hereby granted, provided that the above copyright
- * notice appears in all copies.  This software is provided without any
- * warranty, express or implied. The Australian National University
- * makes no representations about the suitability of this software for
- * any purpose.
- *
- * IN NO EVENT SHALL THE AUSTRALIAN NATIONAL UNIVERSITY BE LIABLE TO ANY
- * PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
- * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
- * THE AUSTRALIAN NATIONAL UNIVERSITY HAVE BEEN ADVISED OF THE POSSIBILITY
- * OF SUCH DAMAGE.
- *
- * THE AUSTRALIAN NATIONAL UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
- * ON AN "AS IS" BASIS, AND THE AUSTRALIAN NATIONAL UNIVERSITY HAS NO
- * OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS,
- * OR MODIFICATIONS.
- *
- * Copyright (c) 1989 Carnegie Mellon University.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms are permitted
- * provided that the above copyright notice and this paragraph are
- * duplicated in all such forms and that any documentation,
- * advertising materials, and other materials related to such
- * distribution and use acknowledge that the software was developed
- * by Carnegie Mellon University.  The name of the
- * University may not be used to endorse or promote products derived
- * from this software without specific prior written permission.
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- */
-
-/*
- *  ==FILEVERSION 990806==
- *
- *  NOTE TO MAINTAINERS:
- *   If you modify this file at all, please set the above date.
- *   if_pppvar.h is shipped with a PPP distribution as well as with the kernel;
- *   if everyone increases the FILEVERSION number above, then scripts
- *   can do the right thing when deciding whether to install a new if_pppvar.h
- *   file.  Don't change the format of that line otherwise, so the
- *   installation script can recognize it.
- */
-
-/*
- * Supported network protocols.  These values are used for
- * indexing sc_npmode.
- */
-
-#define NP_IP	0		/* Internet Protocol */
-#define NP_IPX	1		/* IPX protocol */
-#define NP_AT	2		/* Appletalk protocol */
-#define NP_IPV6	3		/* Internet Protocol */
-#define NUM_NP	4		/* Number of NPs. */
-
-#define OBUFSIZE	256	/* # chars of output buffering */
-
-/*
- * Structure describing each ppp unit.
- */
-
-struct ppp {
-	int		magic;		/* magic value for structure	*/
-	struct ppp	*next;		/* unit with next index		*/
-	unsigned long	inuse;		/* are we allocated?		*/
-	int		line;		/* network interface unit #	*/
-	__u32		flags;		/* miscellaneous control flags	*/
-	int		mtu;		/* maximum xmit frame size	*/
-	int		mru;		/* maximum receive frame size	*/
-	struct slcompress *slcomp;	/* for TCP header compression	*/
-	struct sk_buff_head xmt_q;	/* frames to send from pppd	*/
-	struct sk_buff_head rcv_q;	/* frames for pppd to read	*/
-	unsigned long	xmit_busy;	/* bit 0 set when xmitter busy  */
-
-	/* Information specific to using ppp on async serial lines. */
-	struct tty_struct *tty;		/* ptr to TTY structure	*/
-	struct tty_struct *backup_tty;	/* TTY to use if tty gets closed */
-	__u8		escape;		/* 0x20 if prev char was PPP_ESC */
-	__u8		toss;		/* toss this frame		*/
-	volatile __u8	tty_pushing;	/* internal state flag		*/
-	volatile __u8	woke_up;	/* internal state flag		*/
-	__u32		xmit_async_map[8]; /* 1 bit means that given control 
-					   character is quoted on output*/
-	__u32		recv_async_map; /* 1 bit means that given control 
-					   character is ignored on input*/
-	__u32		bytes_sent;	/* Bytes sent on frame	*/
-	__u32		bytes_rcvd;	/* Bytes recvd on frame	*/
-
-	/* Async transmission information */
-	struct sk_buff	*tpkt;		/* frame currently being sent	*/
-	int		tpkt_pos;	/* how much of it we've done	*/
-	__u16		tfcs;		/* FCS so far for it		*/
-	unsigned char	*optr;		/* where we're up to in sending */
-	unsigned char	*olim;		/* points past last valid char	*/
-
-	/* Async reception information */
-	struct sk_buff	*rpkt;		/* frame currently being rcvd	*/
-	__u16		rfcs;		/* FCS so far of rpkt		*/
-
-	/* Queues for select() functionality */
-	wait_queue_head_t read_wait;	/* queue for reading processes	*/
-
-	/* info for detecting idle channels */
-	unsigned long	last_xmit;	/* time of last transmission	*/
-	unsigned long	last_recv;	/* time last packet received    */
-
-	/* Statistic information */
-	struct pppstat	stats;		/* statistic information	*/
-
-	/* PPP compression protocol information */
-	struct	compressor *sc_xcomp;	/* transmit compressor */
-	void	*sc_xc_state;		/* transmit compressor state */
-	struct	compressor *sc_rcomp;	/* receive decompressor */
-	void	*sc_rc_state;		/* receive decompressor state */
-
-	enum	NPmode sc_npmode[NUM_NP]; /* what to do with each NP */
-	int	 sc_xfer;		/* PID of reserved PPP table */
-	char	name[16];		/* space for unit name */
-	struct net_device	dev;		/* net device structure */
-	struct net_device_stats estats;	/* more detailed stats */
-
-	/* tty output buffer */
-	unsigned char	obuf[OBUFSIZE];	/* buffer for characters to send */
-};
-
-#define PPP_MAGIC	0x5002
-#define PPP_VERSION	"2.3.7"
--- diff/include/linux/memblk.h	2002-11-11 11:09:43.000000000 +0000
+++ source/include/linux/memblk.h	1970-01-01 01:00:00.000000000 +0100
@@ -1,32 +0,0 @@
-/*
- * include/linux/memblk.h - generic memblk definition
- *
- * This is mainly for topological representation. We define the 
- * basic 'struct memblk' here, which can be embedded in per-arch 
- * definitions of memory blocks.
- *
- * Basic handling of the devices is done in drivers/base/memblk.c
- * and system devices are handled in drivers/base/sys.c. 
- *
- * MemBlks are exported via driverfs in the class/memblk/devices/
- * directory. 
- *
- * Per-memblk interfaces can be implemented using a struct device_interface. 
- * See the following for how to do this: 
- * - drivers/base/intf.c 
- * - Documentation/driver-model/interface.txt
- */
-#ifndef _LINUX_MEMBLK_H_
-#define _LINUX_MEMBLK_H_
-
-#include <linux/device.h>
-#include <linux/node.h>
-
-struct memblk {
-	int node_id;		/* The node which contains the MemBlk */
-	struct sys_device sysdev;
-};
-
-extern int register_memblk(struct memblk *, int, struct node *);
-
-#endif /* _LINUX_MEMBLK_H_ */
--- diff/include/linux/ppp.h	2002-10-16 04:27:11.000000000 +0100
+++ source/include/linux/ppp.h	1970-01-01 01:00:00.000000000 +0100
@@ -1,4 +0,0 @@
-/*
- *	Back compatibility for a while.
- */
-#include <linux/if_ppp.h>
--- diff/lib/mask.c	2004-01-19 10:22:59.000000000 +0000
+++ source/lib/mask.c	1970-01-01 01:00:00.000000000 +0100
@@ -1,178 +0,0 @@
-/*
- * lib/mask.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.
- *
- * Copyright (C) 2003 Silicon Graphics, Inc.  All Rights Reserved.
- */
-
-/*
- * Routines to manipulate multi-word bit masks, such as cpumasks.
- *
- * The ascii representation of multi-word bit masks displays each
- * 32bit word in hex (not zero filled), and for masks longer than
- * one word, uses a comma separator between words.  Words are
- * displayed in big-endian order most significant first.  And hex
- * digits within a word are also in big-endian order, of course.
- *
- * Examples:
- *   A mask with just bit 0 set displays as "1".
- *   A mask with just bit 127 set displays as "80000000,0,0,0".
- *   A mask with just bit 64 set displays as "1,0,0".
- *   A mask with bits 0, 1, 2, 4, 8, 16, 32 and 64 set displays
- *     as "1,1,10117".  The first "1" is for bit 64, the second
- *     for bit 32, the third for bit 16, and so forth, to the
- *     "7", which is for bits 2, 1 and 0.
- *   A mask with bits 32 through 39 set displays as "ff,0".
- *
- * The internal binary representation of masks is as one or
- * an array of unsigned longs, perhaps wrapped in a struct for
- * convenient use as an lvalue.  The following code doesn't know
- * about any such struct details, relying on inline macros in
- * files such as cpumask.h to pass in an unsigned long pointer
- * and a length (in bytes), describing the mask contents.
- * The 32bit words in the array are in little-endian order,
- * low order word first.  Beware that this is the reverse order
- * of the ascii representation.
- *
- * Even though the size of the input mask is provided in bytes,
- * the following code may assume that the mask is a multiple of
- * 32 or 64 bit words long, and ignore any fractional portion
- * of a word at the end.  The main reason the size is passed in
- * bytes is because it is so easy to write 'sizeof(somemask_t)'
- * in the macros.
- *
- * Masks are not a single,simple type, like classic 'C'
- * nul-term strings.  Rather they are a family of types, one
- * for each different length.  Inline macros are used to pick
- * up the actual length, where it is known to the compiler, and
- * pass it down to these routines, which work on any specified
- * length array of unsigned longs.  Poor man's templates.
- *
- * Many of the inline macros don't call into the following
- * routines.  Some of them call into other kernel routines,
- * such as memset(), set_bit() or ffs().  Some of them can
- * accomplish their task right inline, such as returning the
- * size or address of the unsigned long array, or optimized
- * versions of the macros for the most common case of an array
- * of a single unsigned long.
- */
-
-#include <linux/kernel.h>
-#include <linux/string.h>
-#include <linux/ctype.h>
-#include <linux/slab.h>
-#include <linux/errno.h>
-#include <linux/gfp.h>
-#include <asm/uaccess.h>
-
-#define MAX_HEX_PER_BYTE 4	/* dont need > 4 hex chars to encode byte */
-#define BASE 16			/* masks are input in hex (base 16) */
-#define NUL ((char)'\0')	/* nul-terminator */
-
-/**
- * __mask_snprintf_len - represent multi-word bit mask as string.
- * @buf: The buffer to place the result into
- * @buflen: The size of the buffer, including the trailing null space
- * @maskp: Points to beginning of multi-word bit mask.
- * @maskbytes: Number of bytes in bit mask at maskp.
- *
- * This routine is expected to be called from a macro such as:
- *
- * #define cpumask_snprintf(buf, buflen, mask) \
- *   __mask_snprintf_len(buf, buflen, cpus_addr(mask), sizeof(mask))
- */
-
-int __mask_snprintf_len(char *buf, unsigned int buflen,
-	const unsigned long *maskp, unsigned int maskbytes)
-{
-	u32 *wordp = (u32 *)maskp;
-	int i = maskbytes/sizeof(u32) - 1;
-	int len = 0;
-	char *sep = "";
-
-	while (i >= 1 && wordp[i] == 0)
-		i--;
-	while (i >= 0) {
-		len += snprintf(buf+len, buflen-len, "%s%x", sep, wordp[i]);
-		sep = ",";
-		i--;
-	}
-	return len;
-}
-
-/**
- * __mask_parse_len - parse user string into maskbytes mask at maskp
- * @ubuf: The user buffer from which to take the string
- * @ubuflen: The size of this buffer, including the terminating char
- * @maskp: Place resulting mask (array of unsigned longs) here
- * @masklen: Construct mask at @maskp to have exactly @masklen bytes
- *
- * @masklen is a multiple of sizeof(unsigned long).  A mask of
- * @masklen bytes is constructed starting at location @maskp.
- * The value of this mask is specified by the user provided
- * string starting at address @ubuf.  Only bytes in the range
- * [@ubuf, @ubuf+@ubuflen) can be read from user space, and
- * reading will stop after the first byte that is not a comma
- * or valid hex digit in the characters [,0-9a-fA-F], or at
- * the point @ubuf+@ubuflen, whichever comes first.
- *
- * Since the user only needs about 2.25 chars per byte to encode
- * a mask (one char per nibble plus one comma separator or nul
- * terminator per byte), we blow them off with -EINVAL if they
- * claim a @ubuflen more than 4 (MAX_HEX_PER_BYTE) times maskbytes.
- * An empty word (delimited by two consecutive commas, for example)
- * is taken as zero.  If @buflen is zero, the entire @maskp is set
- * to zero.
- *
- * If the user provides fewer comma-separated ascii words
- * than there are 32 bit words in maskbytes, we zero fill the
- * remaining high order words.  If they provide more, they fail
- * with -EINVAL.  Each comma-separate ascii word is taken as
- * a hex representation; leading zeros are ignored, and do not
- * imply octal.  '00e1', 'e1', '00E1', 'E1' are all the same.
- * If user passes a word that is larger than fits in a u32,
- * they fail with -EOVERFLOW.
- */
-
-int __mask_parse_len(const char __user *ubuf, unsigned int ubuflen,
-	unsigned long *maskp, unsigned int maskbytes)
-{
-	char buf[maskbytes * MAX_HEX_PER_BYTE + sizeof(NUL)];
-	char *bp = buf;
-	u32 *wordp = (u32 *)maskp;
-	char *p;
-	int i, j;
-
-	if (ubuflen > maskbytes * MAX_HEX_PER_BYTE)
-		return -EINVAL;
-	if (copy_from_user(buf, ubuf, ubuflen))
-		return -EFAULT;
-	buf[ubuflen] = NUL;
-
-	/*
-	 * Put the words into wordp[] in big-endian order,
-	 * then go back and reverse them.
-	 */
-	memset(wordp, 0, maskbytes);
-	i = j = 0;
-	while ((p = strsep(&bp, ",")) != NULL) {
-		unsigned long long t;
-		if (j == maskbytes/sizeof(u32))
-			return -EINVAL;
-		t = simple_strtoull(p, 0, BASE);
-		if (t != (u32)t)
-			return -EOVERFLOW;
-		wordp[j++] = t;
-	}
-	--j;
-	while (i < j) {
-		u32 t = wordp[i];
-		wordp[i] = wordp[j];
-		wordp[j] = t;
-		i++, --j;
-	}
-	return 0;
-}
